summaryrefslogtreecommitdiff
path: root/poky
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 20:05:37 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-23 04:26:31 +0300
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadopenbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky')
-rw-r--r--poky/.gitignore31
-rw-r--r--poky/.templateconf2
-rw-r--r--poky/LICENSE14
-rw-r--r--poky/README.LSB26
l---------poky/README.hardware1
l---------poky/README.poky1
-rw-r--r--poky/README.qemu15
-rw-r--r--poky/bitbake/AUTHORS10
-rw-r--r--poky/bitbake/COPYING339
-rw-r--r--poky/bitbake/ChangeLog317
-rw-r--r--poky/bitbake/HEADER19
-rw-r--r--poky/bitbake/LICENSE19
-rw-r--r--poky/bitbake/README35
-rwxr-xr-xpoky/bitbake/bin/bitbake56
-rwxr-xr-xpoky/bitbake/bin/bitbake-diffsigs183
-rwxr-xr-xpoky/bitbake/bin/bitbake-dumpsig94
-rwxr-xr-xpoky/bitbake/bin/bitbake-layers110
-rwxr-xr-xpoky/bitbake/bin/bitbake-prserv55
-rwxr-xr-xpoky/bitbake/bin/bitbake-selftest73
-rwxr-xr-xpoky/bitbake/bin/bitbake-worker501
-rwxr-xr-xpoky/bitbake/bin/bitdoc531
-rwxr-xr-xpoky/bitbake/bin/git-make-shallow165
-rwxr-xr-xpoky/bitbake/bin/toaster314
-rwxr-xr-xpoky/bitbake/bin/toaster-eventreplay126
-rw-r--r--poky/bitbake/contrib/README1
-rw-r--r--poky/bitbake/contrib/bbdev.sh31
-rwxr-xr-xpoky/bitbake/contrib/dump_cache.py85
-rw-r--r--poky/bitbake/contrib/vim/ftdetect/bitbake.vim24
-rw-r--r--poky/bitbake/contrib/vim/ftplugin/bitbake.vim2
-rwxr-xr-xpoky/bitbake/contrib/vim/plugin/newbb.vim84
-rw-r--r--poky/bitbake/contrib/vim/syntax/bitbake.vim126
-rw-r--r--poky/bitbake/doc/COPYING.GPL339
-rw-r--r--poky/bitbake/doc/COPYING.MIT17
-rw-r--r--poky/bitbake/doc/Makefile91
-rw-r--r--poky/bitbake/doc/README39
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl29
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml932
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml857
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml513
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml728
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml2722
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml2383
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css984
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml88
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.pngbin0 -> 5086 bytes
-rw-r--r--poky/bitbake/doc/bitbake-user-manual/html.css281
-rw-r--r--poky/bitbake/doc/bitbake.1142
-rw-r--r--poky/bitbake/doc/poky.ent59
-rw-r--r--poky/bitbake/doc/template/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--poky/bitbake/doc/template/Vera.xml1
-rw-r--r--poky/bitbake/doc/template/VeraMoBd.ttfbin0 -> 49052 bytes
-rw-r--r--poky/bitbake/doc/template/VeraMoBd.xml1
-rw-r--r--poky/bitbake/doc/template/VeraMono.ttfbin0 -> 49224 bytes
-rw-r--r--poky/bitbake/doc/template/VeraMono.xml1
-rw-r--r--poky/bitbake/doc/template/component.title.xsl39
-rw-r--r--poky/bitbake/doc/template/db-pdf.xsl64
-rw-r--r--poky/bitbake/doc/template/division.title.xsl25
-rw-r--r--poky/bitbake/doc/template/draft.pngbin0 -> 24847 bytes
-rw-r--r--poky/bitbake/doc/template/fop-config.xml58
-rw-r--r--poky/bitbake/doc/template/formal.object.heading.xsl21
-rw-r--r--poky/bitbake/doc/template/gloss-permalinks.xsl14
-rw-r--r--poky/bitbake/doc/template/permalinks.xsl25
-rw-r--r--poky/bitbake/doc/template/section.title.xsl55
-rw-r--r--poky/bitbake/doc/template/titlepage.templates.xml1259
-rwxr-xr-xpoky/bitbake/doc/tools/docbook-to-pdf51
-rw-r--r--poky/bitbake/lib/bb/COW.py319
-rw-r--r--poky/bitbake/lib/bb/__init__.py144
-rw-r--r--poky/bitbake/lib/bb/build.py913
-rw-r--r--poky/bitbake/lib/bb/cache.py891
-rw-r--r--poky/bitbake/lib/bb/cache_extra.py75
-rw-r--r--poky/bitbake/lib/bb/checksum.py134
-rw-r--r--poky/bitbake/lib/bb/codeparser.py476
-rw-r--r--poky/bitbake/lib/bb/command.py765
-rw-r--r--poky/bitbake/lib/bb/compat.py6
-rw-r--r--poky/bitbake/lib/bb/cooker.py2161
-rw-r--r--poky/bitbake/lib/bb/cookerdata.py434
-rw-r--r--poky/bitbake/lib/bb/daemonize.py82
-rw-r--r--poky/bitbake/lib/bb/data.py403
-rw-r--r--poky/bitbake/lib/bb/data_smart.py1037
-rw-r--r--poky/bitbake/lib/bb/event.py831
-rw-r--r--poky/bitbake/lib/bb/exceptions.py91
-rw-r--r--poky/bitbake/lib/bb/fetch2/__init__.py1864
-rw-r--r--poky/bitbake/lib/bb/fetch2/bzr.py139
-rw-r--r--poky/bitbake/lib/bb/fetch2/clearcase.py260
-rw-r--r--poky/bitbake/lib/bb/fetch2/cvs.py172
-rw-r--r--poky/bitbake/lib/bb/fetch2/git.py664
-rw-r--r--poky/bitbake/lib/bb/fetch2/gitannex.py91
-rw-r--r--poky/bitbake/lib/bb/fetch2/gitsm.py135
-rw-r--r--poky/bitbake/lib/bb/fetch2/hg.py270
-rw-r--r--poky/bitbake/lib/bb/fetch2/local.py119
-rw-r--r--poky/bitbake/lib/bb/fetch2/npm.py309
-rw-r--r--poky/bitbake/lib/bb/fetch2/osc.py132
-rw-r--r--poky/bitbake/lib/bb/fetch2/perforce.py209
-rw-r--r--poky/bitbake/lib/bb/fetch2/repo.py97
-rw-r--r--poky/bitbake/lib/bb/fetch2/s3.py98
-rw-r--r--poky/bitbake/lib/bb/fetch2/sftp.py125
-rw-r--r--poky/bitbake/lib/bb/fetch2/ssh.py125
-rw-r--r--poky/bitbake/lib/bb/fetch2/svn.py193
-rw-r--r--poky/bitbake/lib/bb/fetch2/wget.py626
-rwxr-xr-xpoky/bitbake/lib/bb/main.py508
-rw-r--r--poky/bitbake/lib/bb/methodpool.py40
-rw-r--r--poky/bitbake/lib/bb/monitordisk.py268
-rw-r--r--poky/bitbake/lib/bb/msg.py225
-rw-r--r--poky/bitbake/lib/bb/namedtuple_with_abc.py255
-rw-r--r--poky/bitbake/lib/bb/parse/__init__.py175
-rw-r--r--poky/bitbake/lib/bb/parse/ast.py442
-rw-r--r--poky/bitbake/lib/bb/parse/parse_py/BBHandler.py251
-rw-r--r--poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py210
-rw-r--r--poky/bitbake/lib/bb/parse/parse_py/__init__.py33
-rw-r--r--poky/bitbake/lib/bb/persist_data.py214
-rw-r--r--poky/bitbake/lib/bb/process.py179
-rw-r--r--poky/bitbake/lib/bb/progress.py276
-rw-r--r--poky/bitbake/lib/bb/providers.py430
-rw-r--r--poky/bitbake/lib/bb/pysh/__init__.py0
-rw-r--r--poky/bitbake/lib/bb/pysh/builtin.py710
-rw-r--r--poky/bitbake/lib/bb/pysh/interp.py1367
-rw-r--r--poky/bitbake/lib/bb/pysh/lsprof.py116
-rw-r--r--poky/bitbake/lib/bb/pysh/pysh.py167
-rw-r--r--poky/bitbake/lib/bb/pysh/pyshlex.py888
-rw-r--r--poky/bitbake/lib/bb/pysh/pyshyacc.py779
-rw-r--r--poky/bitbake/lib/bb/pysh/sherrors.py41
-rw-r--r--poky/bitbake/lib/bb/pysh/subprocess_fix.py77
-rw-r--r--poky/bitbake/lib/bb/remotedata.py116
-rw-r--r--poky/bitbake/lib/bb/runqueue.py2682
-rw-r--r--poky/bitbake/lib/bb/server/__init__.py21
-rw-r--r--poky/bitbake/lib/bb/server/process.py624
-rw-r--r--poky/bitbake/lib/bb/server/xmlrpcclient.py154
-rw-r--r--poky/bitbake/lib/bb/server/xmlrpcserver.py158
-rw-r--r--poky/bitbake/lib/bb/siggen.py729
-rw-r--r--poky/bitbake/lib/bb/taskdata.py578
-rw-r--r--poky/bitbake/lib/bb/tests/__init__.py0
-rw-r--r--poky/bitbake/lib/bb/tests/codeparser.py428
-rw-r--r--poky/bitbake/lib/bb/tests/cow.py136
-rw-r--r--poky/bitbake/lib/bb/tests/data.py607
-rw-r--r--poky/bitbake/lib/bb/tests/event.py986
-rw-r--r--poky/bitbake/lib/bb/tests/fetch.py1573
-rw-r--r--poky/bitbake/lib/bb/tests/parse.py185
-rw-r--r--poky/bitbake/lib/bb/tests/utils.py603
-rw-r--r--poky/bitbake/lib/bb/tinfoil.py900
-rw-r--r--poky/bitbake/lib/bb/ui/__init__.py17
-rw-r--r--poky/bitbake/lib/bb/ui/buildinfohelper.py2002
-rw-r--r--poky/bitbake/lib/bb/ui/icons/images/images_display.pngbin0 -> 6898 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/images/images_hover.pngbin0 -> 7051 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/add-hover.pngbin0 -> 1212 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/add.pngbin0 -> 1176 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/alert.pngbin0 -> 3954 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/confirmation.pngbin0 -> 5789 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/denied.pngbin0 -> 3955 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/error.pngbin0 -> 6482 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/info.pngbin0 -> 3311 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/issues.pngbin0 -> 4549 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/refresh.pngbin0 -> 5250 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.pngbin0 -> 2809 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/remove.pngbin0 -> 1971 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/indicators/tick.pngbin0 -> 4563 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/info/info_display.pngbin0 -> 4117 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/info/info_hover.pngbin0 -> 4167 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/layers/layers_display.pngbin0 -> 4840 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/layers/layers_hover.pngbin0 -> 5257 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/packages/packages_display.pngbin0 -> 7011 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/packages/packages_hover.pngbin0 -> 7121 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.pngbin0 -> 4723 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.pngbin0 -> 4866 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/settings/settings_display.pngbin0 -> 6076 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/settings/settings_hover.pngbin0 -> 6269 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/templates/templates_display.pngbin0 -> 5651 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/icons/templates/templates_hover.pngbin0 -> 5791 bytes
-rw-r--r--poky/bitbake/lib/bb/ui/knotty.py728
-rw-r--r--poky/bitbake/lib/bb/ui/ncurses.py373
-rw-r--r--poky/bitbake/lib/bb/ui/taskexp.py328
-rw-r--r--poky/bitbake/lib/bb/ui/toasterui.py487
-rw-r--r--poky/bitbake/lib/bb/ui/uievent.py161
-rw-r--r--poky/bitbake/lib/bb/ui/uihelper.py70
-rw-r--r--poky/bitbake/lib/bb/utils.py1539
-rw-r--r--poky/bitbake/lib/bblayers/__init__.py2
-rw-r--r--poky/bitbake/lib/bblayers/action.py256
-rw-r--r--poky/bitbake/lib/bblayers/common.py33
-rw-r--r--poky/bitbake/lib/bblayers/layerindex.py271
-rw-r--r--poky/bitbake/lib/bblayers/query.py501
-rw-r--r--poky/bitbake/lib/bs4/AUTHORS.txt43
-rw-r--r--poky/bitbake/lib/bs4/COPYING.txt26
-rw-r--r--poky/bitbake/lib/bs4/NEWS.txt1066
-rw-r--r--poky/bitbake/lib/bs4/__init__.py468
-rw-r--r--poky/bitbake/lib/bs4/builder/__init__.py324
-rw-r--r--poky/bitbake/lib/bs4/builder/_html5lib.py339
-rw-r--r--poky/bitbake/lib/bs4/builder/_htmlparser.py262
-rw-r--r--poky/bitbake/lib/bs4/builder/_lxml.py248
-rw-r--r--poky/bitbake/lib/bs4/dammit.py840
-rw-r--r--poky/bitbake/lib/bs4/diagnose.py216
-rw-r--r--poky/bitbake/lib/bs4/element.py1725
-rw-r--r--poky/bitbake/lib/bs4/testing.py687
-rw-r--r--poky/bitbake/lib/bs4/tests/__init__.py1
-rw-r--r--poky/bitbake/lib/bs4/tests/test_builder_registry.py147
-rw-r--r--poky/bitbake/lib/bs4/tests/test_docs.py36
-rw-r--r--poky/bitbake/lib/bs4/tests/test_html5lib.py98
-rw-r--r--poky/bitbake/lib/bs4/tests/test_htmlparser.py32
-rw-r--r--poky/bitbake/lib/bs4/tests/test_lxml.py76
-rw-r--r--poky/bitbake/lib/bs4/tests/test_soup.py483
-rw-r--r--poky/bitbake/lib/bs4/tests/test_tree.py2011
-rw-r--r--poky/bitbake/lib/codegen.py570
-rw-r--r--poky/bitbake/lib/ply/__init__.py4
-rw-r--r--poky/bitbake/lib/ply/lex.py1058
-rw-r--r--poky/bitbake/lib/ply/yacc.py3278
-rw-r--r--poky/bitbake/lib/progressbar/LICENSE.txt52
-rw-r--r--poky/bitbake/lib/progressbar/__init__.py49
-rw-r--r--poky/bitbake/lib/progressbar/compat.py44
-rw-r--r--poky/bitbake/lib/progressbar/progressbar.py315
-rw-r--r--poky/bitbake/lib/progressbar/widgets.py391
-rw-r--r--poky/bitbake/lib/prserv/__init__.py14
-rw-r--r--poky/bitbake/lib/prserv/db.py276
-rw-r--r--poky/bitbake/lib/prserv/serv.py504
-rw-r--r--poky/bitbake/lib/pyinotify.py2362
-rw-r--r--poky/bitbake/lib/simplediff/LICENSE22
-rw-r--r--poky/bitbake/lib/simplediff/__init__.py198
-rw-r--r--poky/bitbake/lib/toaster/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcollector/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcollector/admin.py33
-rw-r--r--poky/bitbake/lib/toaster/bldcollector/urls.py27
-rw-r--r--poky/bitbake/lib/toaster/bldcollector/views.py62
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/admin.py8
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py142
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py401
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/management/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py167
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py192
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py113
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py19
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py19
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0004_auto_20160523_1446.py34
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0005_reorder_buildrequest_states.py19
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py19
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py29
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/models.py162
-rw-r--r--poky/bitbake/lib/toaster/bldcontrol/views.py1
-rwxr-xr-xpoky/bitbake/lib/toaster/manage.py10
-rw-r--r--poky/bitbake/lib/toaster/orm/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/orm/fixtures/README30
-rwxr-xr-xpoky/bitbake/lib/toaster/orm/fixtures/custom_toaster_append.sh_sample49
-rw-r--r--poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml97
-rw-r--r--poky/bitbake/lib/toaster/orm/fixtures/poky.xml234
-rw-r--r--poky/bitbake/lib/toaster/orm/fixtures/settings.xml33
-rw-r--r--poky/bitbake/lib/toaster/orm/management/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/orm/management/commands/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py337
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0001_initial.py504
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py24
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py24
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0004_provides.py27
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py48
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py19
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0007_auto_20160523_1446.py89
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py39
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py19
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0010_delete_layer_source_references.py118
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py17
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py62
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0013_recipe_parse_progress_fields.py24
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0014_allow_empty_buildname.py19
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0015_layer_local_source_dir.py19
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py24
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py25
-rw-r--r--poky/bitbake/lib/toaster/orm/migrations/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/orm/models.py1832
-rw-r--r--poky/bitbake/lib/toaster/tests/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/README74
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py34
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py227
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py233
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py217
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py347
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py222
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py66
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py65
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py57
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_landing_page.py108
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py216
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py211
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py161
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_new_project_page.py113
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py168
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_project_config_page.py231
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_project_page.py59
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_sample.py41
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_task_page.py76
-rw-r--r--poky/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py160
-rw-r--r--poky/bitbake/lib/toaster/tests/builds/README14
-rw-r--r--poky/bitbake/lib/toaster/tests/builds/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/builds/buildtest.py169
-rw-r--r--poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py386
-rw-r--r--poky/bitbake/lib/toaster/tests/commands/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/commands/test_loaddata.py61
-rw-r--r--poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py45
-rw-r--r--poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py88
-rw-r--r--poky/bitbake/lib/toaster/tests/db/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/db/test_db.py55
-rw-r--r--poky/bitbake/lib/toaster/tests/eventreplay/README22
-rw-r--r--poky/bitbake/lib/toaster/tests/eventreplay/__init__.py97
-rw-r--r--poky/bitbake/lib/toaster/tests/functional/README0
-rw-r--r--poky/bitbake/lib/toaster/tests/functional/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/functional/functional_helpers.py122
-rw-r--r--poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py243
-rw-r--r--poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt1
-rw-r--r--poky/bitbake/lib/toaster/tests/views/README4
-rw-r--r--poky/bitbake/lib/toaster/tests/views/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/tests/views/test_views.py540
-rw-r--r--poky/bitbake/lib/toaster/toastergui/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/toastergui/api.py1056
-rw-r--r--poky/bitbake/lib/toaster/toastergui/buildtables.py609
-rw-r--r--poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml459
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css6760
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css.map1
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css6
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css.map1
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/bootstrap3-transition.css238
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/default.css369
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css33
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.pngbin0 -> 418 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.pngbin0 -> 312 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.pngbin0 -> 205 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.pngbin0 -> 262 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.pngbin0 -> 348 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.pngbin0 -> 207 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.pngbin0 -> 5815 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.pngbin0 -> 278 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.pngbin0 -> 328 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.pngbin0 -> 6922 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.pngbin0 -> 4549 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.pngbin0 -> 4549 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.pngbin0 -> 4549 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.pngbin0 -> 6299 bytes
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css7
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css5
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css5
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css28
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css64
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css38
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css1
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/css/screen.css28
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otfbin0 -> 48748 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eotbin0 -> 25395 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg284
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttfbin0 -> 55096 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woffbin0 -> 29380 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eotbin0 -> 20127 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg288
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttfbin0 -> 45404 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woffbin0 -> 23424 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff2bin0 -> 18028 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html21
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/img/logo.pngbin0 -> 3020 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.pngbin0 -> 140514 bytes
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt278
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt20
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md20
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css66
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc11
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.js2363
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js7
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js322
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js94
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js2
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js447
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js6
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map1
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js7
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js117
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js620
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/jsrender.min.js4
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js83
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js98
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js521
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js735
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js150
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js199
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js390
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js97
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js347
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js51
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/table.js857
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js177
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/typeahead.jquery.js1551
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js10
-rw-r--r--poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js10
-rw-r--r--poky/bitbake/lib/toaster/toastergui/tablefilter.py292
-rw-r--r--poky/bitbake/lib/toaster/toastergui/tables.py1629
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/base.html144
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html31
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html234
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html15
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html52
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html94
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html256
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html5
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/bfile.html24
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/brtargets.html20
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html319
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html25
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html52
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/configuration.html85
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/configvars.html145
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html4
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html15
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html268
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html57
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html72
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html25
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html245
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/diskio.html4
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/distro_btn.html20
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html88
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html72
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html17
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/health.html6
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/importlayer.html170
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html47
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/landing.html67
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html34
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html26
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html373
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html21
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html301
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html21
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html60
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/newproject.html138
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html99
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html65
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html169
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html110
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html44
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html50
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html33
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html34
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/project.html161
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html65
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html118
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/projectconf.html1042
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html42
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html79
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/recipe.html320
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html23
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html135
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html175
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html8
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html38
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html38
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/tablesort.html38
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/target.html56
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/task.html348
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html24
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html100
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/toastertable.html125
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html18
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py18
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py35
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py34
-rw-r--r--poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py299
-rw-r--r--poky/bitbake/lib/toaster/toastergui/typeaheads.py211
-rw-r--r--poky/bitbake/lib/toaster/toastergui/urls.py254
-rwxr-xr-xpoky/bitbake/lib/toaster/toastergui/views.py1791
-rw-r--r--poky/bitbake/lib/toaster/toastergui/widgets.py577
-rw-r--r--poky/bitbake/lib/toaster/toastermain/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py0
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py54
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py13
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py69
-rw-r--r--poky/bitbake/lib/toaster/toastermain/management/commands/perf.py58
-rw-r--r--poky/bitbake/lib/toaster/toastermain/settings.py369
-rw-r--r--poky/bitbake/lib/toaster/toastermain/settings_production_example.py58
-rw-r--r--poky/bitbake/lib/toaster/toastermain/settings_test.py41
-rw-r--r--poky/bitbake/lib/toaster/toastermain/urls.py93
-rw-r--r--poky/bitbake/lib/toaster/toastermain/wsgi.py35
-rw-r--r--poky/bitbake/toaster-requirements.txt3
-rw-r--r--poky/documentation/Makefile482
-rw-r--r--poky/documentation/README93
-rw-r--r--poky/documentation/adt-manual/adt-command.xml265
-rw-r--r--poky/documentation/adt-manual/adt-intro.xml180
-rw-r--r--poky/documentation/adt-manual/adt-manual-customization.xsl27
-rw-r--r--poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/adt-manual/adt-manual-intro.xml33
-rw-r--r--poky/documentation/adt-manual/adt-manual.xml140
-rw-r--r--poky/documentation/adt-manual/adt-package.xml102
-rw-r--r--poky/documentation/adt-manual/adt-prepare.xml999
-rw-r--r--poky/documentation/adt-manual/adt-style.css984
-rw-r--r--poky/documentation/adt-manual/figures/adt-title.pngbin0 -> 13498 bytes
-rw-r--r--poky/documentation/adt-manual/figures/using-a-pre-built-image.pngbin0 -> 12733 bytes
-rw-r--r--poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-customization.xsl24
-rw-r--r--poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-eclipse-customization.xsl35
-rw-r--r--poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-style.css989
-rw-r--r--poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-titlepage.xsl3820
-rw-r--r--poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.xml491
-rw-r--r--poky/documentation/brief-yoctoprojectqs/figures/bypqs-title.pngbin0 -> 14312 bytes
-rwxr-xr-xpoky/documentation/brief-yoctoprojectqs/figures/yocto-project-transp.pngbin0 -> 8626 bytes
-rw-r--r--poky/documentation/bsp-guide/bsp-guide-customization.xsl27
-rw-r--r--poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl35
-rw-r--r--poky/documentation/bsp-guide/bsp-guide.xml190
-rw-r--r--poky/documentation/bsp-guide/bsp-style.css987
-rw-r--r--poky/documentation/bsp-guide/bsp.xml2269
-rw-r--r--poky/documentation/bsp-guide/figures/bsp-dev-flow.pngbin0 -> 52657 bytes
-rw-r--r--poky/documentation/bsp-guide/figures/bsp-title.pngbin0 -> 17388 bytes
-rw-r--r--poky/documentation/dev-manual/dev-manual-common-tasks.xml15326
-rw-r--r--poky/documentation/dev-manual/dev-manual-customization.xsl27
-rw-r--r--poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/dev-manual/dev-manual-intro.xml103
-rw-r--r--poky/documentation/dev-manual/dev-manual-qemu.xml687
-rw-r--r--poky/documentation/dev-manual/dev-manual-start.xml1086
-rw-r--r--poky/documentation/dev-manual/dev-manual.xml178
-rw-r--r--poky/documentation/dev-manual/dev-style.css988
-rw-r--r--poky/documentation/dev-manual/figures/bitbake-build-flow.pngbin0 -> 50338 bytes
-rw-r--r--poky/documentation/dev-manual/figures/buildhistory-web.pngbin0 -> 49966 bytes
-rw-r--r--poky/documentation/dev-manual/figures/buildhistory.pngbin0 -> 44900 bytes
-rw-r--r--poky/documentation/dev-manual/figures/dev-title.pngbin0 -> 15950 bytes
-rw-r--r--poky/documentation/dev-manual/figures/recipe-workflow.pngbin0 -> 48276 bytes
-rwxr-xr-xpoky/documentation/kernel-dev/figures/kernel-architecture-overview.pngbin0 -> 40748 bytes
-rw-r--r--poky/documentation/kernel-dev/figures/kernel-dev-flow.pngbin0 -> 53197 bytes
-rw-r--r--poky/documentation/kernel-dev/figures/kernel-dev-title.pngbin0 -> 13453 bytes
-rw-r--r--poky/documentation/kernel-dev/figures/kernel-overview-2-generic.pngbin0 -> 49230 bytes
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-advanced.xml1256
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-common.xml2706
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml622
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-customization.xsl26
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl35
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-faq.xml142
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-intro.xml259
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-maint-appx.xml356
-rw-r--r--poky/documentation/kernel-dev/kernel-dev-style.css988
-rw-r--r--poky/documentation/kernel-dev/kernel-dev.xml170
-rw-r--r--poky/documentation/mega-manual/figures/YP-flow-diagram.pngbin0 -> 185562 bytes
-rw-r--r--poky/documentation/mega-manual/figures/add-variable.pngbin0 -> 110712 bytes
-rw-r--r--poky/documentation/mega-manual/figures/analysis-for-package-splitting.pngbin0 -> 68434 bytes
-rw-r--r--poky/documentation/mega-manual/figures/bash-oecore.pngbin0 -> 138198 bytes
-rw-r--r--poky/documentation/mega-manual/figures/bitbake-build-flow.pngbin0 -> 49242 bytes
-rw-r--r--poky/documentation/mega-manual/figures/bsp-dev-flow.pngbin0 -> 52657 bytes
-rw-r--r--poky/documentation/mega-manual/figures/bsp-title.pngbin0 -> 17388 bytes
-rw-r--r--poky/documentation/mega-manual/figures/build-workspace-directory.pngbin0 -> 29627 bytes
-rw-r--r--poky/documentation/mega-manual/figures/buildhistory-web.pngbin0 -> 49966 bytes
-rw-r--r--poky/documentation/mega-manual/figures/buildhistory.pngbin0 -> 44900 bytes
-rwxr-xr-xpoky/documentation/mega-manual/figures/building-an-image.pngbin0 -> 14891 bytes
-rw-r--r--poky/documentation/mega-manual/figures/bypqs-title.pngbin0 -> 14312 bytes
-rw-r--r--poky/documentation/mega-manual/figures/compatible-layers.pngbin0 -> 163081 bytes
-rw-r--r--poky/documentation/mega-manual/figures/concepts-manual-title.pngbin0 -> 11920 bytes
-rw-r--r--poky/documentation/mega-manual/figures/configuration-compile-autoreconf.pngbin0 -> 70877 bytes
-rw-r--r--poky/documentation/mega-manual/figures/cross-development-toolchains.pngbin0 -> 82633 bytes
-rw-r--r--poky/documentation/mega-manual/figures/define-generic.pngbin0 -> 623 bytes
-rw-r--r--poky/documentation/mega-manual/figures/dev-title.pngbin0 -> 15950 bytes
-rw-r--r--poky/documentation/mega-manual/figures/git-workflow.pngbin0 -> 26586 bytes
-rw-r--r--poky/documentation/mega-manual/figures/hosted-service.pngbin0 -> 13552 bytes
-rw-r--r--poky/documentation/mega-manual/figures/image-generation.pngbin0 -> 123348 bytes
-rw-r--r--poky/documentation/mega-manual/figures/images.pngbin0 -> 32674 bytes
-rw-r--r--poky/documentation/mega-manual/figures/import-layer.pngbin0 -> 139108 bytes
-rw-r--r--poky/documentation/mega-manual/figures/index-downloads.pngbin0 -> 36362 bytes
-rwxr-xr-xpoky/documentation/mega-manual/figures/kernel-architecture-overview.pngbin0 -> 40748 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernel-dev-flow.pngbin0 -> 53197 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernel-dev-title.pngbin0 -> 13453 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernel-overview-1.pngbin0 -> 35839 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernel-overview-2-generic.pngbin0 -> 49230 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernel-title.pngbin0 -> 13970 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernelshark-all.pngbin0 -> 89316 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernelshark-choose-events.pngbin0 -> 57372 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernelshark-i915-display.pngbin0 -> 98765 bytes
-rw-r--r--poky/documentation/mega-manual/figures/kernelshark-output-display.pngbin0 -> 204454 bytes
-rw-r--r--poky/documentation/mega-manual/figures/key-dev-elements.pngbin0 -> 20424 bytes
-rw-r--r--poky/documentation/mega-manual/figures/layer-input.pngbin0 -> 62330 bytes
-rw-r--r--poky/documentation/mega-manual/figures/lttngmain0.pngbin0 -> 120581 bytes
-rw-r--r--poky/documentation/mega-manual/figures/mega-title.pngbin0 -> 10536 bytes
-rw-r--r--poky/documentation/mega-manual/figures/new-project.pngbin0 -> 73760 bytes
-rw-r--r--poky/documentation/mega-manual/figures/oprofileui-busybox.pngbin0 -> 98334 bytes
-rw-r--r--poky/documentation/mega-manual/figures/oprofileui-copy-to-user.pngbin0 -> 105661 bytes
-rw-r--r--poky/documentation/mega-manual/figures/oprofileui-downloading.pngbin0 -> 37301 bytes
-rw-r--r--poky/documentation/mega-manual/figures/oprofileui-processes.pngbin0 -> 95741 bytes
-rw-r--r--poky/documentation/mega-manual/figures/overview-manual-title.pngbin0 -> 17387 bytes
-rw-r--r--poky/documentation/mega-manual/figures/package-feeds.pngbin0 -> 40900 bytes
-rw-r--r--poky/documentation/mega-manual/figures/patching.pngbin0 -> 57414 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.pngbin0 -> 59078 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-report-cycles-u.pngbin0 -> 171368 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-systemwide-libc.pngbin0 -> 136826 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-systemwide.pngbin0 -> 140616 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.pngbin0 -> 22364 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.pngbin0 -> 171529 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.pngbin0 -> 174971 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.pngbin0 -> 23735 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.pngbin0 -> 101685 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.pngbin0 -> 95140 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-flat-stripped.pngbin0 -> 178919 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.pngbin0 -> 138550 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.pngbin0 -> 102790 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.pngbin0 -> 110101 bytes
-rw-r--r--poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.pngbin0 -> 102812 bytes
-rw-r--r--poky/documentation/mega-manual/figures/poky-reference-distribution.pngbin0 -> 23784 bytes
-rw-r--r--poky/documentation/mega-manual/figures/poky-title.pngbin0 -> 11592 bytes
-rw-r--r--poky/documentation/mega-manual/figures/profile-title.pngbin0 -> 12799 bytes
-rw-r--r--poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.pngbin0 -> 36366 bytes
-rw-r--r--poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.pngbin0 -> 98053 bytes
-rw-r--r--poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.pngbin0 -> 81053 bytes
-rw-r--r--poky/documentation/mega-manual/figures/recipe-workflow.pngbin0 -> 48276 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sched-wakeup-profile.pngbin0 -> 123810 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-autotools-flow.pngbin0 -> 50443 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-devtool-add-flow.pngbin0 -> 181699 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.pngbin0 -> 171676 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-devtool-upgrade-flow.pngbin0 -> 138917 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.pngbin0 -> 62626 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-environment.pngbin0 -> 42098 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-generation.pngbin0 -> 60574 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.pngbin0 -> 42892 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.pngbin0 -> 56096 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-makefile-flow.pngbin0 -> 47197 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk-title.pngbin0 -> 31039 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sdk.pngbin0 -> 49804 bytes
-rw-r--r--poky/documentation/mega-manual/figures/set-variable.pngbin0 -> 111430 bytes
-rw-r--r--poky/documentation/mega-manual/figures/simple-configuration.pngbin0 -> 10789 bytes
-rw-r--r--poky/documentation/mega-manual/figures/source-fetching.pngbin0 -> 46896 bytes
-rw-r--r--poky/documentation/mega-manual/figures/source-input.pngbin0 -> 51170 bytes
-rw-r--r--poky/documentation/mega-manual/figures/source-repos.pngbin0 -> 167009 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sysprof-callers.pngbin0 -> 145043 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sysprof-copy-from-user.pngbin0 -> 132976 bytes
-rw-r--r--poky/documentation/mega-manual/figures/sysprof-copy-to-user.pngbin0 -> 132074 bytes
-rw-r--r--poky/documentation/mega-manual/figures/toaster-title.pngbin0 -> 9277 bytes
-rw-r--r--poky/documentation/mega-manual/figures/user-configuration.pngbin0 -> 51171 bytes
-rw-r--r--poky/documentation/mega-manual/figures/using-a-pre-built-image.pngbin0 -> 12733 bytes
-rw-r--r--poky/documentation/mega-manual/figures/variable-added.pngbin0 -> 112163 bytes
-rwxr-xr-xpoky/documentation/mega-manual/figures/yocto-project-transp.pngbin0 -> 8626 bytes
-rw-r--r--poky/documentation/mega-manual/figures/yp-download.pngbin0 -> 82939 bytes
-rw-r--r--poky/documentation/mega-manual/mega-manual-customization.xsl42
-rw-r--r--poky/documentation/mega-manual/mega-manual.xml319
-rw-r--r--poky/documentation/mega-manual/mega-style.css989
-rw-r--r--poky/documentation/overview-manual/figures/YP-flow-diagram.pngbin0 -> 190715 bytes
-rw-r--r--poky/documentation/overview-manual/figures/analysis-for-package-splitting.pngbin0 -> 68434 bytes
-rw-r--r--poky/documentation/overview-manual/figures/configuration-compile-autoreconf.pngbin0 -> 70877 bytes
-rw-r--r--poky/documentation/overview-manual/figures/cross-development-toolchains.pngbin0 -> 82633 bytes
-rw-r--r--poky/documentation/overview-manual/figures/git-workflow.pngbin0 -> 26586 bytes
-rw-r--r--poky/documentation/overview-manual/figures/image-generation.pngbin0 -> 123348 bytes
-rw-r--r--poky/documentation/overview-manual/figures/images.pngbin0 -> 32674 bytes
-rw-r--r--poky/documentation/overview-manual/figures/index-downloads.pngbin0 -> 36362 bytes
-rw-r--r--poky/documentation/overview-manual/figures/key-dev-elements.pngbin0 -> 20424 bytes
-rw-r--r--poky/documentation/overview-manual/figures/layer-input.pngbin0 -> 62330 bytes
-rw-r--r--poky/documentation/overview-manual/figures/overview-manual-title.pngbin0 -> 17387 bytes
-rw-r--r--poky/documentation/overview-manual/figures/package-feeds.pngbin0 -> 40900 bytes
-rw-r--r--poky/documentation/overview-manual/figures/patching.pngbin0 -> 57414 bytes
-rw-r--r--poky/documentation/overview-manual/figures/poky-reference-distribution.pngbin0 -> 23784 bytes
-rw-r--r--poky/documentation/overview-manual/figures/sdk-generation.pngbin0 -> 60574 bytes
-rw-r--r--poky/documentation/overview-manual/figures/sdk.pngbin0 -> 49804 bytes
-rw-r--r--poky/documentation/overview-manual/figures/source-fetching.pngbin0 -> 46896 bytes
-rw-r--r--poky/documentation/overview-manual/figures/source-input.pngbin0 -> 51170 bytes
-rw-r--r--poky/documentation/overview-manual/figures/source-repos.pngbin0 -> 298757 bytes
-rw-r--r--poky/documentation/overview-manual/figures/user-configuration.pngbin0 -> 51171 bytes
-rw-r--r--poky/documentation/overview-manual/figures/yp-download.pngbin0 -> 82939 bytes
-rw-r--r--poky/documentation/overview-manual/overview-manual-concepts.xml3232
-rw-r--r--poky/documentation/overview-manual/overview-manual-customization.xsl27
-rw-r--r--poky/documentation/overview-manual/overview-manual-development-environment.xml970
-rw-r--r--poky/documentation/overview-manual/overview-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/overview-manual/overview-manual-intro.xml112
-rw-r--r--poky/documentation/overview-manual/overview-manual-style.css988
-rw-r--r--poky/documentation/overview-manual/overview-manual-yp-intro.xml1357
-rw-r--r--poky/documentation/overview-manual/overview-manual.xml108
-rw-r--r--poky/documentation/poky.ent85
-rw-r--r--poky/documentation/profile-manual/figures/kernelshark-all.pngbin0 -> 89316 bytes
-rw-r--r--poky/documentation/profile-manual/figures/kernelshark-choose-events.pngbin0 -> 57372 bytes
-rw-r--r--poky/documentation/profile-manual/figures/kernelshark-i915-display.pngbin0 -> 98765 bytes
-rw-r--r--poky/documentation/profile-manual/figures/kernelshark-output-display.pngbin0 -> 204454 bytes
-rw-r--r--poky/documentation/profile-manual/figures/lttngmain0.pngbin0 -> 120581 bytes
-rw-r--r--poky/documentation/profile-manual/figures/oprofileui-busybox.pngbin0 -> 98334 bytes
-rw-r--r--poky/documentation/profile-manual/figures/oprofileui-copy-to-user.pngbin0 -> 105661 bytes
-rw-r--r--poky/documentation/profile-manual/figures/oprofileui-downloading.pngbin0 -> 37301 bytes
-rw-r--r--poky/documentation/profile-manual/figures/oprofileui-processes.pngbin0 -> 95741 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.pngbin0 -> 59078 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-report-cycles-u.pngbin0 -> 171368 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-systemwide-libc.pngbin0 -> 136826 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-systemwide.pngbin0 -> 140616 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.pngbin0 -> 22364 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.pngbin0 -> 171529 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.pngbin0 -> 174971 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.pngbin0 -> 23735 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.pngbin0 -> 101685 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.pngbin0 -> 95140 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-flat-stripped.pngbin0 -> 178919 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.pngbin0 -> 138550 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.pngbin0 -> 102790 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.pngbin0 -> 110101 bytes
-rw-r--r--poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.pngbin0 -> 102812 bytes
-rw-r--r--poky/documentation/profile-manual/figures/profile-title.pngbin0 -> 12799 bytes
-rw-r--r--poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.pngbin0 -> 36366 bytes
-rw-r--r--poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.pngbin0 -> 98053 bytes
-rw-r--r--poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.pngbin0 -> 81053 bytes
-rw-r--r--poky/documentation/profile-manual/figures/sched-wakeup-profile.pngbin0 -> 123810 bytes
-rw-r--r--poky/documentation/profile-manual/figures/sysprof-callers.pngbin0 -> 145043 bytes
-rw-r--r--poky/documentation/profile-manual/figures/sysprof-copy-from-user.pngbin0 -> 132976 bytes
-rw-r--r--poky/documentation/profile-manual/figures/sysprof-copy-to-user.pngbin0 -> 132074 bytes
-rw-r--r--poky/documentation/profile-manual/profile-manual-arch.xml45
-rw-r--r--poky/documentation/profile-manual/profile-manual-customization.xsl27
-rw-r--r--poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/profile-manual/profile-manual-examples.xml39
-rw-r--r--poky/documentation/profile-manual/profile-manual-intro.xml104
-rw-r--r--poky/documentation/profile-manual/profile-manual-style.css984
-rw-r--r--poky/documentation/profile-manual/profile-manual-usage.xml3163
-rw-r--r--poky/documentation/profile-manual/profile-manual.xml163
-rw-r--r--poky/documentation/ref-manual/TODO11
-rw-r--r--poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb8
-rw-r--r--poky/documentation/ref-manual/examples/hello-single/files/helloworld.c8
-rw-r--r--poky/documentation/ref-manual/examples/hello-single/hello.bb17
-rw-r--r--poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb14
-rw-r--r--poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb15
-rw-r--r--poky/documentation/ref-manual/faq.xml835
-rw-r--r--poky/documentation/ref-manual/figures/build-workspace-directory.pngbin0 -> 29627 bytes
-rw-r--r--poky/documentation/ref-manual/figures/define-generic.pngbin0 -> 623 bytes
-rw-r--r--poky/documentation/ref-manual/figures/poky-title.pngbin0 -> 11592 bytes
-rw-r--r--poky/documentation/ref-manual/migration.xml5684
-rw-r--r--poky/documentation/ref-manual/ref-classes.xml3900
-rw-r--r--poky/documentation/ref-manual/ref-devtool-reference.xml734
-rw-r--r--poky/documentation/ref-manual/ref-features.xml482
-rw-r--r--poky/documentation/ref-manual/ref-images.xml169
-rw-r--r--poky/documentation/ref-manual/ref-kickstart.xml334
-rw-r--r--poky/documentation/ref-manual/ref-manual-customization.xsl29
-rw-r--r--poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/ref-manual/ref-manual.xml221
-rw-r--r--poky/documentation/ref-manual/ref-qa-checks.xml1199
-rw-r--r--poky/documentation/ref-manual/ref-release-process.xml255
-rw-r--r--poky/documentation/ref-manual/ref-structure.xml1122
-rw-r--r--poky/documentation/ref-manual/ref-style.css1032
-rw-r--r--poky/documentation/ref-manual/ref-system-requirements.xml490
-rw-r--r--poky/documentation/ref-manual/ref-tasks.xml1155
-rw-r--r--poky/documentation/ref-manual/ref-terms.xml507
-rw-r--r--poky/documentation/ref-manual/ref-variables.xml16652
-rw-r--r--poky/documentation/ref-manual/ref-varlocality.xml198
-rw-r--r--poky/documentation/ref-manual/resources.xml305
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-autotools-flow.pngbin0 -> 50443 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.pngbin0 -> 181699 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.pngbin0 -> 171676 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-devtool-upgrade-flow.pngbin0 -> 138917 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.pngbin0 -> 62626 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-environment.pngbin0 -> 42098 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.pngbin0 -> 42892 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.pngbin0 -> 56096 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-makefile-flow.pngbin0 -> 47197 bytes
-rw-r--r--poky/documentation/sdk-manual/figures/sdk-title.pngbin0 -> 31039 bytes
-rw-r--r--poky/documentation/sdk-manual/sdk-appendix-customizing-standard.xml58
-rw-r--r--poky/documentation/sdk-manual/sdk-appendix-customizing.xml398
-rw-r--r--poky/documentation/sdk-manual/sdk-appendix-neon.xml905
-rw-r--r--poky/documentation/sdk-manual/sdk-appendix-obtain.xml429
-rw-r--r--poky/documentation/sdk-manual/sdk-eclipse-project.xml1219
-rw-r--r--poky/documentation/sdk-manual/sdk-extensible.xml1785
-rw-r--r--poky/documentation/sdk-manual/sdk-intro.xml417
-rw-r--r--poky/documentation/sdk-manual/sdk-manual-customization.xsl26
-rw-r--r--poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl35
-rw-r--r--poky/documentation/sdk-manual/sdk-manual.xml141
-rw-r--r--poky/documentation/sdk-manual/sdk-style.css988
-rw-r--r--poky/documentation/sdk-manual/sdk-using.xml205
-rw-r--r--poky/documentation/sdk-manual/sdk-working-projects.xml514
-rw-r--r--poky/documentation/template/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--poky/documentation/template/Vera.xml1
-rw-r--r--poky/documentation/template/VeraMoBd.ttfbin0 -> 49052 bytes
-rw-r--r--poky/documentation/template/VeraMoBd.xml1
-rw-r--r--poky/documentation/template/VeraMono.ttfbin0 -> 49224 bytes
-rw-r--r--poky/documentation/template/VeraMono.xml1
-rw-r--r--poky/documentation/template/component.title.xsl39
-rw-r--r--poky/documentation/template/division.title.xsl24
-rw-r--r--poky/documentation/template/draft.pngbin0 -> 24847 bytes
-rw-r--r--poky/documentation/template/embedded_video.xsl22
-rw-r--r--poky/documentation/template/fop-config.xml58
-rw-r--r--poky/documentation/template/formal.object.heading.xsl21
-rw-r--r--poky/documentation/template/gloss-permalinks.xsl14
-rw-r--r--poky/documentation/template/ohand-color.svg150
-rw-r--r--poky/documentation/template/permalinks.xsl25
-rw-r--r--poky/documentation/template/poky-db-pdf.xsl64
-rw-r--r--poky/documentation/template/poky-ref-manual.pngbin0 -> 32145 bytes
-rw-r--r--poky/documentation/template/poky.svg163
-rw-r--r--poky/documentation/template/qa-code-permalinks.xsl23
-rw-r--r--poky/documentation/template/section.title.xsl55
-rw-r--r--poky/documentation/template/titlepage.templates.xml1227
-rw-r--r--poky/documentation/template/yocto-project-qs.pngbin0 -> 17829 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/add-variable.pngbin0 -> 110712 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/bash-oecore.pngbin0 -> 138198 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/compatible-layers.pngbin0 -> 163081 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/hosted-service.pngbin0 -> 13552 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/import-layer.pngbin0 -> 139108 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/new-project.pngbin0 -> 73760 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/set-variable.pngbin0 -> 111430 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/simple-configuration.pngbin0 -> 10789 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/toaster-title.pngbin0 -> 9277 bytes
-rw-r--r--poky/documentation/toaster-manual/figures/variable-added.pngbin0 -> 112163 bytes
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-customization.xsl28
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-intro.xml164
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-reference.xml836
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml843
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-start.xml115
-rw-r--r--poky/documentation/toaster-manual/toaster-manual-style.css984
-rw-r--r--poky/documentation/toaster-manual/toaster-manual.xml137
-rw-r--r--poky/documentation/tools/eclipse-help.sed18
-rw-r--r--poky/documentation/tools/mega-manual.sed40
-rwxr-xr-xpoky/documentation/tools/poky-docbook-to-pdf51
-rw-r--r--poky/documentation/tools/update-documentation-conf168
-rw-r--r--poky/meta-poky/README.poky58
-rw-r--r--poky/meta-poky/classes/poky-sanity.bbclass46
-rw-r--r--poky/meta-poky/conf/bblayers.conf.sample12
-rw-r--r--poky/meta-poky/conf/conf-notes.txt12
-rw-r--r--poky/meta-poky/conf/distro/include/poky-floating-revisions.inc58
-rw-r--r--poky/meta-poky/conf/distro/include/poky-world-exclude.inc4
-rw-r--r--poky/meta-poky/conf/distro/poky-bleeding.conf11
-rw-r--r--poky/meta-poky/conf/distro/poky-lsb.conf15
-rw-r--r--poky/meta-poky/conf/distro/poky-tiny.conf132
-rw-r--r--poky/meta-poky/conf/distro/poky.conf101
-rw-r--r--poky/meta-poky/conf/layer.conf20
-rw-r--r--poky/meta-poky/conf/local.conf.sample247
-rw-r--r--poky/meta-poky/conf/local.conf.sample.extended394
-rw-r--r--poky/meta-poky/conf/site.conf.sample31
-rw-r--r--poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig1009
-rw-r--r--poky/meta-poky/recipes-core/busybox/busybox_%.bbappend2
-rw-r--r--poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h914
-rw-r--r--poky/meta-poky/recipes-core/psplash/psplash_git.bbappend2
-rw-r--r--poky/meta-poky/recipes-core/tiny-init/files/init26
-rw-r--r--poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample23
-rw-r--r--poky/meta-poky/recipes-core/tiny-init/tiny-init.bb30
-rw-r--r--poky/meta-selftest/COPYING.MIT17
-rw-r--r--poky/meta-selftest/README3
-rw-r--r--poky/meta-selftest/classes/test_events.bbclass16
-rw-r--r--poky/meta-selftest/conf/layer.conf12
-rw-r--r--poky/meta-selftest/conf/machine/qemux86copy.conf3
-rw-r--r--poky/meta-selftest/files/signing/key.passphrase1
-rw-r--r--poky/meta-selftest/files/signing/key.pub30
-rw-r--r--poky/meta-selftest/files/signing/key.secret59
-rw-r--r--poky/meta-selftest/files/static-group14
-rw-r--r--poky/meta-selftest/files/static-passwd11
-rw-r--r--poky/meta-selftest/lib/devtool/__init__.py0
-rw-r--r--poky/meta-selftest/lib/devtool/bbpath.py44
-rw-r--r--poky/meta-selftest/lib/devtool/test.py11
-rw-r--r--poky/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py47
-rw-r--r--poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json6
-rw-r--r--poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py31
-rw-r--r--poky/meta-selftest/lib/oeqa/selftest/cases/external-layer.py16
-rw-r--r--poky/meta-selftest/lib/recipetool/bbpath.py41
-rw-r--r--poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb32
-rw-r--r--poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend2
-rw-r--r--poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb8
-rw-r--r--poky/meta-selftest/recipes-test/container-image/container-test-image.bb8
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-local/file11
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-local/file21
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb16
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb7
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file11
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file21
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb18
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gzbin0 -> 449 bytes
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb9
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gzbin0 -> 181 bytes
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile1
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch25
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb20
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded18
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb22
-rw-r--r--poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded21
-rw-r--r--poky/meta-selftest/recipes-test/emptytest/emptytest.bb7
-rw-r--r--poky/meta-selftest/recipes-test/error/error.bb10
-rw-r--r--poky/meta-selftest/recipes-test/images/error-image.bb8
-rw-r--r--poky/meta-selftest/recipes-test/images/oe-selftest-image.bb9
-rw-r--r--poky/meta-selftest/recipes-test/images/test-empty-image.bb6
-rw-r--r--poky/meta-selftest/recipes-test/images/wic-image-minimal.bb15
-rw-r--r--poky/meta-selftest/recipes-test/images/wic-image-minimal.wks10
-rw-r--r--poky/meta-selftest/recipes-test/m4/m4_%.bbappend2
-rw-r--r--poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch22
-rw-r--r--poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend2
-rw-r--r--poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb72
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/add-file.patch8
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/file12
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/installscript.sh3
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir1
-rw-r--r--poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb44
-rw-r--r--poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb22
-rw-r--r--poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb36
-rw-r--r--poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend2
-rw-r--r--poky/meta-selftest/wic/test_rawcopy_plugin.wks.in6
-rw-r--r--poky/meta-selftest/wic/wictestdisk.wks7
-rw-r--r--poky/meta-skeleton/COPYING.MIT17
-rw-r--r--poky/meta-skeleton/conf/layer.conf17
-rw-r--r--poky/meta-skeleton/conf/multilib-example.conf13
-rw-r--r--poky/meta-skeleton/conf/multilib-example2.conf13
-rw-r--r--poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg1
-rw-r--r--poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend12
-rw-r--r--poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING340
-rw-r--r--poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile14
-rw-r--r--poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c33
-rw-r--r--poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb17
-rw-r--r--poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb71
-rw-r--r--poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch29
-rw-r--r--poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc1
-rw-r--r--poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg1
-rw-r--r--poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb13
-rw-r--r--poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT15
-rw-r--r--poky/meta-skeleton/recipes-skeleton/service/service/skeleton193
-rw-r--r--poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c12
-rw-r--r--poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb31
-rw-r--r--poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb77
-rw-r--r--poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file10
-rw-r--r--poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file20
-rw-r--r--poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file30
-rw-r--r--poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file40
-rw-r--r--poky/meta-yocto-bsp/README.hardware407
-rw-r--r--poky/meta-yocto-bsp/conf/layer.conf12
-rw-r--r--poky/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf40
-rw-r--r--poky/meta-yocto-bsp/conf/machine/edgerouter.conf26
-rw-r--r--poky/meta-yocto-bsp/conf/machine/genericx86-64.conf10
-rw-r--r--poky/meta-yocto-bsp/conf/machine/genericx86.conf10
-rw-r--r--poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc25
-rw-r--r--poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf35
-rw-r--r--poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py0
-rw-r--r--poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py98
-rw-r--r--poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py90
-rw-r--r--poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py71
-rw-r--r--poky/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py98
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone-yocto/machconfig3
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig6
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig6
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend1
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf2
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh15
-rw-r--r--poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb18
-rw-r--r--poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone-yocto/xorg.conf20
-rw-r--r--poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf0
-rw-r--r--poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf0
-rw-r--r--poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend1
-rw-r--r--poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend28
-rw-r--r--poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.14.bbappend27
-rw-r--r--poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.15.bbappend27
-rw-r--r--poky/meta-yocto-bsp/wic/beaglebone-yocto.wks6
-rw-r--r--poky/meta-yocto-bsp/wic/edgerouter.wks4
-rw-r--r--poky/meta-yocto-bsp/wic/genericx86.wks7
-rw-r--r--poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks4
-rw-r--r--poky/meta/COPYING.GPLv2339
-rw-r--r--poky/meta/COPYING.MIT17
-rw-r--r--poky/meta/classes/allarch.bbclass51
-rw-r--r--poky/meta/classes/archiver.bbclass474
-rw-r--r--poky/meta/classes/autotools-brokensep.bbclass5
-rw-r--r--poky/meta/classes/autotools.bbclass255
-rw-r--r--poky/meta/classes/base.bbclass704
-rw-r--r--poky/meta/classes/bash-completion.bbclass7
-rw-r--r--poky/meta/classes/bin_package.bbclass39
-rw-r--r--poky/meta/classes/binconfig-disabled.bbclass30
-rw-r--r--poky/meta/classes/binconfig.bbclass63
-rw-r--r--poky/meta/classes/blacklist.bbclass20
-rw-r--r--poky/meta/classes/bluetooth.bbclass14
-rw-r--r--poky/meta/classes/bugzilla.bbclass187
-rw-r--r--poky/meta/classes/buildhistory.bbclass944
-rw-r--r--poky/meta/classes/buildstats-summary.bbclass40
-rw-r--r--poky/meta/classes/buildstats.bbclass219
-rw-r--r--poky/meta/classes/ccache.bbclass11
-rw-r--r--poky/meta/classes/chrpath.bbclass123
-rw-r--r--poky/meta/classes/clutter.bbclass22
-rw-r--r--poky/meta/classes/cmake.bbclass175
-rw-r--r--poky/meta/classes/cml1.bbclass79
-rw-r--r--poky/meta/classes/compress_doc.bbclass260
-rw-r--r--poky/meta/classes/copyleft_compliance.bbclass64
-rw-r--r--poky/meta/classes/copyleft_filter.bbclass79
-rw-r--r--poky/meta/classes/core-image.bbclass72
-rw-r--r--poky/meta/classes/cpan-base.bbclass18
-rw-r--r--poky/meta/classes/cpan.bbclass55
-rw-r--r--poky/meta/classes/cpan_build.bbclass40
-rw-r--r--poky/meta/classes/cross-canadian.bbclass192
-rw-r--r--poky/meta/classes/cross.bbclass97
-rw-r--r--poky/meta/classes/crosssdk.bbclass44
-rw-r--r--poky/meta/classes/cve-check.bbclass290
-rw-r--r--poky/meta/classes/debian.bbclass146
-rw-r--r--poky/meta/classes/deploy.bbclass11
-rw-r--r--poky/meta/classes/devshell.bbclass155
-rw-r--r--poky/meta/classes/devtool-source.bbclass221
-rw-r--r--poky/meta/classes/devupstream.bbclass48
-rw-r--r--poky/meta/classes/distro_features_check.bbclass37
-rw-r--r--poky/meta/classes/distrodata.bbclass427
-rw-r--r--poky/meta/classes/distrooverrides.bbclass32
-rw-r--r--poky/meta/classes/distutils-base.bbclass4
-rw-r--r--poky/meta/classes/distutils-common-base.bbclass13
-rw-r--r--poky/meta/classes/distutils-tools.bbclass73
-rw-r--r--poky/meta/classes/distutils.bbclass82
-rw-r--r--poky/meta/classes/distutils3-base.bbclass5
-rw-r--r--poky/meta/classes/distutils3.bbclass76
-rw-r--r--poky/meta/classes/externalsrc.bbclass240
-rw-r--r--poky/meta/classes/extrausers.bbclass69
-rw-r--r--poky/meta/classes/fontcache.bbclass56
-rw-r--r--poky/meta/classes/fs-uuid.bbclass24
-rw-r--r--poky/meta/classes/gconf.bbclass71
-rw-r--r--poky/meta/classes/gettext.bbclass22
-rw-r--r--poky/meta/classes/gio-module-cache.bbclass38
-rw-r--r--poky/meta/classes/glide.bbclass9
-rw-r--r--poky/meta/classes/gnome.bbclass1
-rw-r--r--poky/meta/classes/gnomebase.bbclass30
-rw-r--r--poky/meta/classes/go.bbclass181
-rw-r--r--poky/meta/classes/goarch.bbclass100
-rw-r--r--poky/meta/classes/gobject-introspection-data.bbclass7
-rw-r--r--poky/meta/classes/gobject-introspection.bbclass43
-rw-r--r--poky/meta/classes/godep.bbclass8
-rw-r--r--poky/meta/classes/grub-efi-cfg.bbclass114
-rw-r--r--poky/meta/classes/grub-efi.bbclass39
-rw-r--r--poky/meta/classes/gsettings.bbclass38
-rw-r--r--poky/meta/classes/gtk-doc.bbclass68
-rw-r--r--poky/meta/classes/gtk-icon-cache.bbclass66
-rw-r--r--poky/meta/classes/gtk-immodules-cache.bbclass89
-rw-r--r--poky/meta/classes/icecc.bbclass416
-rw-r--r--poky/meta/classes/image-buildinfo.bbclass85
-rw-r--r--poky/meta/classes/image-combined-dbg.bbclass9
-rw-r--r--poky/meta/classes/image-container.bbclass21
-rw-r--r--poky/meta/classes/image-live.bbclass266
-rw-r--r--poky/meta/classes/image-mklibs.bbclass56
-rw-r--r--poky/meta/classes/image-prelink.bbclass64
-rw-r--r--poky/meta/classes/image.bbclass678
-rw-r--r--poky/meta/classes/image_types.bbclass326
-rw-r--r--poky/meta/classes/image_types_wic.bbclass129
-rw-r--r--poky/meta/classes/insane.bbclass1317
-rw-r--r--poky/meta/classes/kernel-arch.bbclass66
-rw-r--r--poky/meta/classes/kernel-devicetree.bbclass112
-rw-r--r--poky/meta/classes/kernel-fitimage.bbclass487
-rw-r--r--poky/meta/classes/kernel-grub.bbclass105
-rw-r--r--poky/meta/classes/kernel-module-split.bbclass158
-rw-r--r--poky/meta/classes/kernel-uboot.bbclass30
-rw-r--r--poky/meta/classes/kernel-uimage.bbclass35
-rw-r--r--poky/meta/classes/kernel-yocto.bbclass406
-rw-r--r--poky/meta/classes/kernel.bbclass713
-rw-r--r--poky/meta/classes/kernelsrc.bbclass10
-rw-r--r--poky/meta/classes/lib_package.bbclass7
-rw-r--r--poky/meta/classes/libc-common.bbclass41
-rw-r--r--poky/meta/classes/libc-package.bbclass380
-rw-r--r--poky/meta/classes/license.bbclass684
-rw-r--r--poky/meta/classes/linux-kernel-base.bbclass41
-rw-r--r--poky/meta/classes/linuxloader.bbclass70
-rw-r--r--poky/meta/classes/live-vm-common.bbclass61
-rw-r--r--poky/meta/classes/logging.bbclass101
-rw-r--r--poky/meta/classes/manpages.bbclass5
-rw-r--r--poky/meta/classes/meson.bbclass130
-rw-r--r--poky/meta/classes/meta.bbclass4
-rw-r--r--poky/meta/classes/metadata_scm.bbclass82
-rw-r--r--poky/meta/classes/migrate_localcount.bbclass46
-rw-r--r--poky/meta/classes/mime.bbclass57
-rw-r--r--poky/meta/classes/mirrors.bbclass75
-rw-r--r--poky/meta/classes/module-base.bbclass21
-rw-r--r--poky/meta/classes/module.bbclass73
-rw-r--r--poky/meta/classes/multilib.bbclass153
-rw-r--r--poky/meta/classes/multilib_global.bbclass202
-rw-r--r--poky/meta/classes/multilib_header.bbclass52
-rw-r--r--poky/meta/classes/native.bbclass192
-rw-r--r--poky/meta/classes/nativesdk.bbclass109
-rw-r--r--poky/meta/classes/nopackages.bbclass12
-rw-r--r--poky/meta/classes/npm.bbclass90
-rw-r--r--poky/meta/classes/oelint.bbclass84
-rw-r--r--poky/meta/classes/own-mirrors.bbclass13
-rw-r--r--poky/meta/classes/package.bbclass2281
-rw-r--r--poky/meta/classes/package_deb.bbclass370
-rw-r--r--poky/meta/classes/package_ipk.bbclass328
-rw-r--r--poky/meta/classes/package_rpm.bbclass746
-rw-r--r--poky/meta/classes/package_tar.bbclass73
-rw-r--r--poky/meta/classes/packagedata.bbclass34
-rw-r--r--poky/meta/classes/packagefeed-stability.bbclass252
-rw-r--r--poky/meta/classes/packagegroup.bbclass59
-rw-r--r--poky/meta/classes/patch.bbclass159
-rw-r--r--poky/meta/classes/perl-version.bbclass24
-rw-r--r--poky/meta/classes/perlnative.bbclass3
-rw-r--r--poky/meta/classes/pixbufcache.bbclass64
-rw-r--r--poky/meta/classes/pkgconfig.bbclass2
-rw-r--r--poky/meta/classes/populate_sdk.bbclass7
-rw-r--r--poky/meta/classes/populate_sdk_base.bbclass309
-rw-r--r--poky/meta/classes/populate_sdk_ext.bbclass727
-rw-r--r--poky/meta/classes/prexport.bbclass59
-rw-r--r--poky/meta/classes/primport.bbclass21
-rw-r--r--poky/meta/classes/ptest-gnome.bbclass8
-rw-r--r--poky/meta/classes/ptest-perl.bbclass30
-rw-r--r--poky/meta/classes/ptest.bbclass67
-rw-r--r--poky/meta/classes/pypi.bbclass26
-rw-r--r--poky/meta/classes/python-dir.bbclass5
-rw-r--r--poky/meta/classes/python3-dir.bbclass5
-rw-r--r--poky/meta/classes/python3native.bbclass16
-rw-r--r--poky/meta/classes/pythonnative.bbclass19
-rw-r--r--poky/meta/classes/qemu.bbclass64
-rw-r--r--poky/meta/classes/qemuboot.bbclass124
-rw-r--r--poky/meta/classes/recipe_sanity.bbclass149
-rw-r--r--poky/meta/classes/relative_symlinks.bbclass5
-rw-r--r--poky/meta/classes/relocatable.bbclass18
-rw-r--r--poky/meta/classes/remove-libtool.bbclass11
-rw-r--r--poky/meta/classes/report-error.bbclass109
-rw-r--r--poky/meta/classes/reproducible_build.bbclass150
-rw-r--r--poky/meta/classes/reproducible_build_simple.bbclass10
-rw-r--r--poky/meta/classes/rm_work.bbclass189
-rw-r--r--poky/meta/classes/rm_work_and_downloads.bbclass33
-rw-r--r--poky/meta/classes/rootfs-postcommands.bbclass351
-rw-r--r--poky/meta/classes/rootfs_deb.bbclass35
-rw-r--r--poky/meta/classes/rootfs_ipk.bbclass38
-rw-r--r--poky/meta/classes/rootfs_rpm.bbclass39
-rw-r--r--poky/meta/classes/rootfsdebugfiles.bbclass41
-rw-r--r--poky/meta/classes/sanity.bbclass970
-rw-r--r--poky/meta/classes/scons.bbclass17
-rw-r--r--poky/meta/classes/setuptools.bbclass8
-rw-r--r--poky/meta/classes/setuptools3.bbclass8
-rw-r--r--poky/meta/classes/sign_ipk.bbclass52
-rw-r--r--poky/meta/classes/sign_package_feed.bbclass46
-rw-r--r--poky/meta/classes/sign_rpm.bbclass71
-rw-r--r--poky/meta/classes/siteconfig.bbclass33
-rw-r--r--poky/meta/classes/siteinfo.bbclass194
-rw-r--r--poky/meta/classes/spdx.bbclass364
-rw-r--r--poky/meta/classes/sstate.bbclass1070
-rw-r--r--poky/meta/classes/staging.bbclass591
-rw-r--r--poky/meta/classes/syslinux.bbclass199
-rw-r--r--poky/meta/classes/systemd-boot-cfg.bbclass68
-rw-r--r--poky/meta/classes/systemd-boot.bbclass60
-rw-r--r--poky/meta/classes/systemd.bbclass212
-rw-r--r--poky/meta/classes/terminal.bbclass105
-rw-r--r--poky/meta/classes/testexport.bbclass177
-rw-r--r--poky/meta/classes/testimage-auto.bbclass23
-rw-r--r--poky/meta/classes/testimage.bbclass375
-rw-r--r--poky/meta/classes/testsdk.bbclass196
-rw-r--r--poky/meta/classes/texinfo.bbclass18
-rw-r--r--poky/meta/classes/tinderclient.bbclass368
-rw-r--r--poky/meta/classes/toaster.bbclass380
-rw-r--r--poky/meta/classes/toolchain-scripts-base.bbclass11
-rw-r--r--poky/meta/classes/toolchain-scripts.bbclass178
-rw-r--r--poky/meta/classes/typecheck.bbclass12
-rw-r--r--poky/meta/classes/uboot-config.bbclass57
-rw-r--r--poky/meta/classes/uboot-extlinux-config.bbclass152
-rw-r--r--poky/meta/classes/uboot-sign.bbclass95
-rw-r--r--poky/meta/classes/uninative.bbclass165
-rw-r--r--poky/meta/classes/update-alternatives.bbclass277
-rw-r--r--poky/meta/classes/update-rc.d.bbclass143
-rw-r--r--poky/meta/classes/upstream-version-is-even.bbclass5
-rw-r--r--poky/meta/classes/useradd-staticids.bbclass311
-rw-r--r--poky/meta/classes/useradd.bbclass252
-rw-r--r--poky/meta/classes/useradd_base.bbclass147
-rw-r--r--poky/meta/classes/utility-tasks.bbclass53
-rw-r--r--poky/meta/classes/utils.bbclass399
-rw-r--r--poky/meta/classes/vala.bbclass24
-rw-r--r--poky/meta/classes/waf.bbclass37
-rw-r--r--poky/meta/conf/abi_version.conf7
-rw-r--r--poky/meta/conf/bitbake.conf886
-rw-r--r--poky/meta/conf/conf-notes.txt12
-rw-r--r--poky/meta/conf/distro/defaultsetup.conf24
-rw-r--r--poky/meta/conf/distro/include/as-needed.inc13
-rw-r--r--poky/meta/conf/distro/include/default-distrovars.inc55
-rw-r--r--poky/meta/conf/distro/include/default-providers.inc56
-rw-r--r--poky/meta/conf/distro/include/default-versions.inc7
-rw-r--r--poky/meta/conf/distro/include/distro_alias.inc451
-rw-r--r--poky/meta/conf/distro/include/maintainers.inc799
-rw-r--r--poky/meta/conf/distro/include/no-static-libs.inc42
-rw-r--r--poky/meta/conf/distro/include/security_flags.inc71
-rw-r--r--poky/meta/conf/distro/include/tclibc-baremetal.inc32
-rw-r--r--poky/meta/conf/distro/include/tclibc-glibc.inc40
-rw-r--r--poky/meta/conf/distro/include/tclibc-musl.inc32
-rw-r--r--poky/meta/conf/distro/include/tcmode-default.inc84
-rw-r--r--poky/meta/conf/distro/include/uninative-flags.inc7
-rw-r--r--poky/meta/conf/distro/include/upstream_tracking.inc24
-rw-r--r--poky/meta/conf/distro/include/world-broken.inc27
-rw-r--r--poky/meta/conf/distro/include/yocto-uninative.inc13
-rw-r--r--poky/meta/conf/documentation.conf464
-rw-r--r--poky/meta/conf/layer.conf82
-rw-r--r--poky/meta/conf/licenses.conf192
-rw-r--r--poky/meta/conf/machine-sdk/i586.conf4
-rw-r--r--poky/meta/conf/machine-sdk/i686.conf3
-rw-r--r--poky/meta/conf/machine-sdk/x86_64.conf2
-rw-r--r--poky/meta/conf/machine/include/README100
-rw-r--r--poky/meta/conf/machine/include/arm/README40
-rw-r--r--poky/meta/conf/machine/include/arm/arch-arm.inc16
-rw-r--r--poky/meta/conf/machine/include/arm/arch-arm64.inc36
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv4.inc34
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc52
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv5.inc57
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv6.inc50
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv7a.inc141
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv7ve.inc140
-rw-r--r--poky/meta/conf/machine/include/arm/arch-armv8.inc1
-rw-r--r--poky/meta/conf/machine/include/arm/feature-arm-neon.inc18
-rw-r--r--poky/meta/conf/machine/include/arm/feature-arm-thumb.inc30
-rw-r--r--poky/meta/conf/machine/include/arm/feature-arm-vfp.inc14
-rw-r--r--poky/meta/conf/machine/include/microblaze/arch-microblaze.inc53
-rw-r--r--poky/meta/conf/machine/include/microblaze/feature-microblaze-math.inc33
-rw-r--r--poky/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc67
-rw-r--r--poky/meta/conf/machine/include/mips/README56
-rw-r--r--poky/meta/conf/machine/include/mips/arch-mips.inc151
-rw-r--r--poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc17
-rw-r--r--poky/meta/conf/machine/include/mips/tune-mips-24k.inc51
-rw-r--r--poky/meta/conf/machine/include/powerpc/README17
-rw-r--r--poky/meta/conf/machine/include/powerpc/arch-powerpc.inc34
-rw-r--r--poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc17
-rw-r--r--poky/meta/conf/machine/include/qemu.inc30
-rw-r--r--poky/meta/conf/machine/include/qemuboot-mips.inc8
-rw-r--r--poky/meta/conf/machine/include/qemuboot-x86.inc17
-rw-r--r--poky/meta/conf/machine/include/sh/README11
-rw-r--r--poky/meta/conf/machine/include/sh/arch-sh.inc9
-rw-r--r--poky/meta/conf/machine/include/soc-family.inc3
-rw-r--r--poky/meta/conf/machine/include/tune-arm1136jf-s.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-arm920t.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-arm926ejs.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-arm9tdmi.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-atom.inc2
-rw-r--r--poky/meta/conf/machine/include/tune-c3.inc12
-rw-r--r--poky/meta/conf/machine/include/tune-core2.inc38
-rw-r--r--poky/meta/conf/machine/include/tune-corei7.inc39
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa15.inc48
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa17.inc48
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa5.inc36
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa7.inc48
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa8.inc36
-rw-r--r--poky/meta/conf/machine/include/tune-cortexa9.inc51
-rw-r--r--poky/meta/conf/machine/include/tune-ep9312.inc12
-rw-r--r--poky/meta/conf/machine/include/tune-i586-nlp.inc19
-rw-r--r--poky/meta/conf/machine/include/tune-i586.inc14
-rw-r--r--poky/meta/conf/machine/include/tune-i686.inc27
-rw-r--r--poky/meta/conf/machine/include/tune-iwmmxt.inc14
-rw-r--r--poky/meta/conf/machine/include/tune-microblaze.inc8
-rw-r--r--poky/meta/conf/machine/include/tune-mips32.inc29
-rw-r--r--poky/meta/conf/machine/include/tune-mips32r2.inc29
-rw-r--r--poky/meta/conf/machine/include/tune-mips32r6.inc29
-rw-r--r--poky/meta/conf/machine/include/tune-mips64.inc3
-rw-r--r--poky/meta/conf/machine/include/tune-mips64r2.inc84
-rw-r--r--poky/meta/conf/machine/include/tune-mips64r6.inc58
-rw-r--r--poky/meta/conf/machine/include/tune-octeon.inc32
-rw-r--r--poky/meta/conf/machine/include/tune-power5.inc21
-rw-r--r--poky/meta/conf/machine/include/tune-power6.inc21
-rw-r--r--poky/meta/conf/machine/include/tune-power7.inc21
-rw-r--r--poky/meta/conf/machine/include/tune-ppc476.inc14
-rw-r--r--poky/meta/conf/machine/include/tune-ppc603e.inc14
-rw-r--r--poky/meta/conf/machine/include/tune-ppc7400.inc14
-rw-r--r--poky/meta/conf/machine/include/tune-ppce300c2.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-ppce300c3.inc23
-rw-r--r--poky/meta/conf/machine/include/tune-ppce500.inc20
-rw-r--r--poky/meta/conf/machine/include/tune-ppce500mc.inc17
-rw-r--r--poky/meta/conf/machine/include/tune-ppce500v2.inc20
-rw-r--r--poky/meta/conf/machine/include/tune-ppce5500.inc23
-rw-r--r--poky/meta/conf/machine/include/tune-ppce6500.inc24
-rw-r--r--poky/meta/conf/machine/include/tune-sh3.inc17
-rw-r--r--poky/meta/conf/machine/include/tune-sh4.inc34
-rw-r--r--poky/meta/conf/machine/include/tune-strongarm1100.inc11
-rw-r--r--poky/meta/conf/machine/include/tune-supersparc.inc4
-rw-r--r--poky/meta/conf/machine/include/tune-thunderx.inc19
-rw-r--r--poky/meta/conf/machine/include/tune-xscale.inc16
-rw-r--r--poky/meta/conf/machine/include/x86-base.inc49
-rw-r--r--poky/meta/conf/machine/include/x86/README24
-rw-r--r--poky/meta/conf/machine/include/x86/arch-x86.inc54
-rw-r--r--poky/meta/conf/machine/qemuarm.conf20
-rw-r--r--poky/meta/conf/machine/qemuarm64.conf24
-rw-r--r--poky/meta/conf/machine/qemumips.conf14
-rw-r--r--poky/meta/conf/machine/qemumips64.conf14
-rw-r--r--poky/meta/conf/machine/qemuppc.conf21
-rw-r--r--poky/meta/conf/machine/qemux86-64.conf37
-rw-r--r--poky/meta/conf/machine/qemux86.conf36
-rw-r--r--poky/meta/conf/migrate_localcount.conf1
-rw-r--r--poky/meta/conf/multiconfig/default.conf0
-rw-r--r--poky/meta/conf/multilib.conf28
-rw-r--r--poky/meta/conf/prexport.conf1
-rw-r--r--poky/meta/conf/primport.conf1
-rw-r--r--poky/meta/conf/sanity.conf16
-rw-r--r--poky/meta/files/common-licenses/AAL51
-rw-r--r--poky/meta/files/common-licenses/AFL-1.2123
-rw-r--r--poky/meta/files/common-licenses/AFL-2.048
-rw-r--r--poky/meta/files/common-licenses/AFL-2.150
-rw-r--r--poky/meta/files/common-licenses/AFL-3.027
-rw-r--r--poky/meta/files/common-licenses/AGPL-3.0661
-rw-r--r--poky/meta/files/common-licenses/ANTLR-PD32
-rw-r--r--poky/meta/files/common-licenses/APL-1.0218
-rw-r--r--poky/meta/files/common-licenses/APSL-1.0372
-rw-r--r--poky/meta/files/common-licenses/APSL-1.1374
-rw-r--r--poky/meta/files/common-licenses/APSL-1.2105
-rw-r--r--poky/meta/files/common-licenses/APSL-2.0102
-rw-r--r--poky/meta/files/common-licenses/Adobe14
-rw-r--r--poky/meta/files/common-licenses/Apache-1.061
-rw-r--r--poky/meta/files/common-licenses/Apache-1.160
-rw-r--r--poky/meta/files/common-licenses/Apache-2.0204
-rw-r--r--poky/meta/files/common-licenses/Artistic-1.050
-rw-r--r--poky/meta/files/common-licenses/Artistic-2.0203
-rw-r--r--poky/meta/files/common-licenses/BSD26
-rw-r--r--poky/meta/files/common-licenses/BSD-0-Clause12
-rw-r--r--poky/meta/files/common-licenses/BSD-1-Clause9
-rw-r--r--poky/meta/files/common-licenses/BSD-2-Clause13
-rw-r--r--poky/meta/files/common-licenses/BSD-3-Clause11
-rw-r--r--poky/meta/files/common-licenses/BSD-4-Clause29
-rw-r--r--poky/meta/files/common-licenses/BSL-1.025
-rw-r--r--poky/meta/files/common-licenses/BitstreamVera160
-rw-r--r--poky/meta/files/common-licenses/CATOSL-1.1116
-rw-r--r--poky/meta/files/common-licenses/CC-BY-1.060
-rw-r--r--poky/meta/files/common-licenses/CC-BY-2.063
-rw-r--r--poky/meta/files/common-licenses/CC-BY-2.563
-rw-r--r--poky/meta/files/common-licenses/CC-BY-3.070
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-1.063
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-2.066
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-2.566
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-3.072
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-ND-1.05
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-ND-2.063
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-ND-2.563
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-ND-3.069
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-SA-1.064
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-SA-2.068
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-SA-2.568
-rw-r--r--poky/meta/files/common-licenses/CC-BY-NC-SA-3.074
-rw-r--r--poky/meta/files/common-licenses/CC-BY-ND-1.059
-rw-r--r--poky/meta/files/common-licenses/CC-BY-ND-2.062
-rw-r--r--poky/meta/files/common-licenses/CC-BY-ND-2.562
-rw-r--r--poky/meta/files/common-licenses/CC-BY-ND-3.068
-rw-r--r--poky/meta/files/common-licenses/CC-BY-SA-1.063
-rw-r--r--poky/meta/files/common-licenses/CC-BY-SA-2.067
-rw-r--r--poky/meta/files/common-licenses/CC-BY-SA-2.567
-rw-r--r--poky/meta/files/common-licenses/CC-BY-SA-3.074
-rw-r--r--poky/meta/files/common-licenses/CC0-1.032
-rw-r--r--poky/meta/files/common-licenses/CDDL-1.0131
-rw-r--r--poky/meta/files/common-licenses/CECILL-1.0242
-rw-r--r--poky/meta/files/common-licenses/CECILL-2.0243
-rw-r--r--poky/meta/files/common-licenses/CECILL-B247
-rw-r--r--poky/meta/files/common-licenses/CECILL-C241
-rw-r--r--poky/meta/files/common-licenses/CPAL-1.0109
-rw-r--r--poky/meta/files/common-licenses/CPL-1.0215
-rw-r--r--poky/meta/files/common-licenses/CUA-OPL-1.0471
-rw-r--r--poky/meta/files/common-licenses/ClArtistic138
-rw-r--r--poky/meta/files/common-licenses/DSSSL49
-rw-r--r--poky/meta/files/common-licenses/ECL-1.055
-rw-r--r--poky/meta/files/common-licenses/ECL-2.099
-rw-r--r--poky/meta/files/common-licenses/EDL-1.013
-rw-r--r--poky/meta/files/common-licenses/EFL-1.025
-rw-r--r--poky/meta/files/common-licenses/EFL-2.012
-rw-r--r--poky/meta/files/common-licenses/EPL-1.072
-rw-r--r--poky/meta/files/common-licenses/EUDatagrid29
-rw-r--r--poky/meta/files/common-licenses/EUPL-1.0184
-rw-r--r--poky/meta/files/common-licenses/EUPL-1.1204
-rw-r--r--poky/meta/files/common-licenses/Elfutils-Exception12
-rw-r--r--poky/meta/files/common-licenses/Entessa20
-rw-r--r--poky/meta/files/common-licenses/ErlPL-1.1288
-rw-r--r--poky/meta/files/common-licenses/FSF-Unlimited4
-rw-r--r--poky/meta/files/common-licenses/Fair11
-rw-r--r--poky/meta/files/common-licenses/Frameworx-1.069
-rw-r--r--poky/meta/files/common-licenses/FreeType170
-rw-r--r--poky/meta/files/common-licenses/GFDL-1.1355
-rw-r--r--poky/meta/files/common-licenses/GFDL-1.2399
-rw-r--r--poky/meta/files/common-licenses/GFDL-1.3453
-rw-r--r--poky/meta/files/common-licenses/GPL-1.0252
-rw-r--r--poky/meta/files/common-licenses/GPL-2-with-bison-exception7
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0132
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception17
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception285
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception6
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception7
-rw-r--r--poky/meta/files/common-licenses/GPL-2.0-with-font-exception18
-rw-r--r--poky/meta/files/common-licenses/GPL-3.0225
-rw-r--r--poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception27
-rw-r--r--poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception28
-rw-r--r--poky/meta/files/common-licenses/HPND11
-rw-r--r--poky/meta/files/common-licenses/ICU13
-rw-r--r--poky/meta/files/common-licenses/IPA95
-rw-r--r--poky/meta/files/common-licenses/IPL-1.0213
-rw-r--r--poky/meta/files/common-licenses/ISC10
-rw-r--r--poky/meta/files/common-licenses/LGPL-2.0342
-rw-r--r--poky/meta/files/common-licenses/LGPL-2.1176
-rw-r--r--poky/meta/files/common-licenses/LGPL-3.065
-rw-r--r--poky/meta/files/common-licenses/LPL-1.0276
-rw-r--r--poky/meta/files/common-licenses/LPPL-1.0213
-rw-r--r--poky/meta/files/common-licenses/LPPL-1.1316
-rw-r--r--poky/meta/files/common-licenses/LPPL-1.2320
-rw-r--r--poky/meta/files/common-licenses/LPPL-1.3c418
-rw-r--r--poky/meta/files/common-licenses/Libpng112
-rw-r--r--poky/meta/files/common-licenses/MIT23
-rw-r--r--poky/meta/files/common-licenses/MPL-1.0109
-rw-r--r--poky/meta/files/common-licenses/MPL-1.1185
-rw-r--r--poky/meta/files/common-licenses/MPL-2.0373
-rw-r--r--poky/meta/files/common-licenses/MS-PL19
-rw-r--r--poky/meta/files/common-licenses/MS-RL23
-rw-r--r--poky/meta/files/common-licenses/MirOS58
-rw-r--r--poky/meta/files/common-licenses/Motosoto422
-rw-r--r--poky/meta/files/common-licenses/Multics40
-rw-r--r--poky/meta/files/common-licenses/NASA-1.379
-rw-r--r--poky/meta/files/common-licenses/NCSA34
-rw-r--r--poky/meta/files/common-licenses/NGPL45
-rw-r--r--poky/meta/files/common-licenses/NPOSL-3.061
-rw-r--r--poky/meta/files/common-licenses/NTP7
-rw-r--r--poky/meta/files/common-licenses/Nauman50
-rw-r--r--poky/meta/files/common-licenses/Nokia423
-rw-r--r--poky/meta/files/common-licenses/OASIS13
-rw-r--r--poky/meta/files/common-licenses/OCLC-2.078
-rw-r--r--poky/meta/files/common-licenses/ODbL-1.0543
-rw-r--r--poky/meta/files/common-licenses/OFL-1.188
-rw-r--r--poky/meta/files/common-licenses/OGTSL120
-rw-r--r--poky/meta/files/common-licenses/OLDAP-2.849
-rw-r--r--poky/meta/files/common-licenses/OSL-1.0164
-rw-r--r--poky/meta/files/common-licenses/OSL-2.048
-rw-r--r--poky/meta/files/common-licenses/OSL-3.027
-rw-r--r--poky/meta/files/common-licenses/OpenSSL107
-rw-r--r--poky/meta/files/common-licenses/PD1
-rw-r--r--poky/meta/files/common-licenses/PHP-3.070
-rw-r--r--poky/meta/files/common-licenses/ParaTypeFFL-1.344
-rw-r--r--poky/meta/files/common-licenses/PostgreSQL14
-rw-r--r--poky/meta/files/common-licenses/Proprietary1
-rw-r--r--poky/meta/files/common-licenses/Python-2.0192
-rw-r--r--poky/meta/files/common-licenses/QPL-1.048
-rw-r--r--poky/meta/files/common-licenses/RHeCos-1401
-rw-r--r--poky/meta/files/common-licenses/RHeCos-1.1151
-rw-r--r--poky/meta/files/common-licenses/RPL-1.5546
-rw-r--r--poky/meta/files/common-licenses/RPSL-1.0182
-rw-r--r--poky/meta/files/common-licenses/RSCPL193
-rw-r--r--poky/meta/files/common-licenses/Ruby60
-rw-r--r--poky/meta/files/common-licenses/SAX-PD33
-rw-r--r--poky/meta/files/common-licenses/SGI-136
-rw-r--r--poky/meta/files/common-licenses/SMAIL_GPL164
-rw-r--r--poky/meta/files/common-licenses/SPL-1.0507
-rw-r--r--poky/meta/files/common-licenses/Simple-2.027
-rw-r--r--poky/meta/files/common-licenses/Sleepycat90
-rw-r--r--poky/meta/files/common-licenses/SugarCRM-1431
-rw-r--r--poky/meta/files/common-licenses/SugarCRM-1.1.3160
-rw-r--r--poky/meta/files/common-licenses/UCB26
-rw-r--r--poky/meta/files/common-licenses/VSL-1.049
-rw-r--r--poky/meta/files/common-licenses/W3C17
-rw-r--r--poky/meta/files/common-licenses/WXwindows55
-rw-r--r--poky/meta/files/common-licenses/Watcom-1.0140
-rw-r--r--poky/meta/files/common-licenses/XFree86-1.022
-rw-r--r--poky/meta/files/common-licenses/XFree86-1.118
-rw-r--r--poky/meta/files/common-licenses/XSL48
-rw-r--r--poky/meta/files/common-licenses/Xnet27
-rw-r--r--poky/meta/files/common-licenses/YPL-1.130
-rw-r--r--poky/meta/files/common-licenses/ZPL-1.128
-rw-r--r--poky/meta/files/common-licenses/ZPL-2.061
-rw-r--r--poky/meta/files/common-licenses/ZPL-2.118
-rw-r--r--poky/meta/files/common-licenses/Zimbra-1.330
-rw-r--r--poky/meta/files/common-licenses/Zlib21
-rw-r--r--poky/meta/files/common-licenses/bzip241
-rw-r--r--poky/meta/files/common-licenses/eCos-2.018
-rw-r--r--poky/meta/files/common-licenses/gSOAP-1380
-rw-r--r--poky/meta/files/common-licenses/gSOAP-1.3b157
-rw-r--r--poky/meta/files/common-licenses/pkgconf10
-rw-r--r--poky/meta/files/common-licenses/tcl40
-rw-r--r--poky/meta/files/common-licenses/unfs324
-rw-r--r--poky/meta/files/device_table-minimal.txt35
-rw-r--r--poky/meta/files/ext-sdk-prepare.py74
-rw-r--r--poky/meta/files/fs-perms-persistent-log.txt66
-rw-r--r--poky/meta/files/fs-perms.txt67
-rw-r--r--poky/meta/files/ptest-perl/run-ptest16
-rw-r--r--poky/meta/files/toolchain-shar-extract.sh278
-rw-r--r--poky/meta/files/toolchain-shar-relocate.sh79
-rw-r--r--poky/meta/lib/bblayers/create.py66
-rw-r--r--poky/meta/lib/bblayers/templates/README41
-rw-r--r--poky/meta/lib/bblayers/templates/example.bb11
-rw-r--r--poky/meta/lib/bblayers/templates/layer.conf10
-rw-r--r--poky/meta/lib/buildstats.py158
-rw-r--r--poky/meta/lib/oe/__init__.py2
-rw-r--r--poky/meta/lib/oe/buildhistory_analysis.py665
-rw-r--r--poky/meta/lib/oe/cachedpath.py233
-rw-r--r--poky/meta/lib/oe/classextend.py122
-rw-r--r--poky/meta/lib/oe/classutils.py44
-rw-r--r--poky/meta/lib/oe/copy_buildsystem.py262
-rw-r--r--poky/meta/lib/oe/data.py47
-rw-r--r--poky/meta/lib/oe/distro_check.py308
-rw-r--r--poky/meta/lib/oe/gpg_sign.py128
-rw-r--r--poky/meta/lib/oe/license.py243
-rw-r--r--poky/meta/lib/oe/lsb.py117
-rw-r--r--poky/meta/lib/oe/maketype.py102
-rw-r--r--poky/meta/lib/oe/manifest.py344
-rw-r--r--poky/meta/lib/oe/package.py294
-rw-r--r--poky/meta/lib/oe/package_manager.py1787
-rw-r--r--poky/meta/lib/oe/packagedata.py95
-rw-r--r--poky/meta/lib/oe/packagegroup.py36
-rw-r--r--poky/meta/lib/oe/patch.py895
-rw-r--r--poky/meta/lib/oe/path.py261
-rw-r--r--poky/meta/lib/oe/prservice.py126
-rw-r--r--poky/meta/lib/oe/qa.py171
-rw-r--r--poky/meta/lib/oe/recipeutils.py971
-rw-r--r--poky/meta/lib/oe/rootfs.py973
-rw-r--r--poky/meta/lib/oe/sdk.py473
-rw-r--r--poky/meta/lib/oe/sstatesig.py404
-rw-r--r--poky/meta/lib/oe/terminal.py308
-rw-r--r--poky/meta/lib/oe/types.py153
-rw-r--r--poky/meta/lib/oe/useradd.py68
-rw-r--r--poky/meta/lib/oe/utils.py421
-rw-r--r--poky/meta/lib/oeqa/buildperf/__init__.py19
-rw-r--r--poky/meta/lib/oeqa/buildperf/base.py511
-rw-r--r--poky/meta/lib/oeqa/buildperf/test_basic.py127
-rw-r--r--poky/meta/lib/oeqa/controllers/__init__.py3
-rw-r--r--poky/meta/lib/oeqa/controllers/masterimage.py239
-rw-r--r--poky/meta/lib/oeqa/controllers/testtargetloader.py68
-rw-r--r--poky/meta/lib/oeqa/core/README76
-rw-r--r--poky/meta/lib/oeqa/core/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/core/case.py46
-rw-r--r--poky/meta/lib/oeqa/core/cases/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/core/cases/example/data.json1
-rw-r--r--poky/meta/lib/oeqa/core/cases/example/test_basic.py20
-rw-r--r--poky/meta/lib/oeqa/core/context.py191
-rw-r--r--poky/meta/lib/oeqa/core/decorator/__init__.py71
-rw-r--r--poky/meta/lib/oeqa/core/decorator/data.py98
-rw-r--r--poky/meta/lib/oeqa/core/decorator/depends.py100
-rw-r--r--poky/meta/lib/oeqa/core/decorator/oeid.py23
-rw-r--r--poky/meta/lib/oeqa/core/decorator/oetag.py24
-rw-r--r--poky/meta/lib/oeqa/core/decorator/oetimeout.py45
-rw-r--r--poky/meta/lib/oeqa/core/exception.py23
-rw-r--r--poky/meta/lib/oeqa/core/loader.py355
-rw-r--r--poky/meta/lib/oeqa/core/runner.py277
-rw-r--r--poky/meta/lib/oeqa/core/target/__init__.py33
-rw-r--r--poky/meta/lib/oeqa/core/target/qemu.py45
-rw-r--r--poky/meta/lib/oeqa/core/target/ssh.py267
-rw-r--r--poky/meta/lib/oeqa/core/tests/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/data.py20
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/depends.py38
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py15
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py12
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py8
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py10
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py12
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py9
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/oeid.py18
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/oetag.py18
-rw-r--r--poky/meta/lib/oeqa/core/tests/cases/timeout.py18
-rw-r--r--poky/meta/lib/oeqa/core/tests/common.py45
-rwxr-xr-xpoky/meta/lib/oeqa/core/tests/test_data.py51
-rwxr-xr-xpoky/meta/lib/oeqa/core/tests/test_decorators.py147
-rwxr-xr-xpoky/meta/lib/oeqa/core/tests/test_loader.py114
-rwxr-xr-xpoky/meta/lib/oeqa/core/tests/test_runner.py38
-rw-r--r--poky/meta/lib/oeqa/core/threaded.py275
-rw-r--r--poky/meta/lib/oeqa/core/utils/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/core/utils/misc.py44
-rw-r--r--poky/meta/lib/oeqa/core/utils/path.py19
-rw-r--r--poky/meta/lib/oeqa/core/utils/test.py86
-rw-r--r--poky/meta/lib/oeqa/files/test.c26
-rw-r--r--poky/meta/lib/oeqa/files/test.cpp3
-rw-r--r--poky/meta/lib/oeqa/files/test.pl2
-rw-r--r--poky/meta/lib/oeqa/files/test.py6
-rw-r--r--poky/meta/lib/oeqa/oetest.py616
-rwxr-xr-xpoky/meta/lib/oeqa/runexported.py153
-rw-r--r--poky/meta/lib/oeqa/runtime/case.py17
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/_qemutiny.py8
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/apt.py47
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/buildcpio.py29
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/buildgalculator.py28
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/buildlzip.py34
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/connman.py30
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/date.py38
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/df.py13
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/dnf.py123
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/gcc.py73
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/gi.py15
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/kernelmodule.py40
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/ldd.py25
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/logrotate.py42
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/multilib.py41
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/oe_syslog.py66
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/opkg.py47
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/pam.py33
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/parselogs.py363
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/perl.py37
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/ping.py24
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/ptest.py93
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/python.py43
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/rpm.py142
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/scanelf.py26
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/scp.py33
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/skeletoninit.py33
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/ssh.py15
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/stap.py33
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/systemd.py181
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/x32lib.py19
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/xorg.py17
-rw-r--r--poky/meta/lib/oeqa/runtime/context.py226
-rw-r--r--poky/meta/lib/oeqa/runtime/decorator/package.py53
-rw-r--r--poky/meta/lib/oeqa/runtime/files/hello.stp1
-rw-r--r--poky/meta/lib/oeqa/runtime/files/hellomod.c19
-rw-r--r--poky/meta/lib/oeqa/runtime/files/hellomod_makefile8
-rw-r--r--poky/meta/lib/oeqa/runtime/files/testmakefile5
-rw-r--r--poky/meta/lib/oeqa/runtime/loader.py16
-rw-r--r--poky/meta/lib/oeqa/runtime/utils/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py39
-rw-r--r--poky/meta/lib/oeqa/sdk/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/sdk/case.py12
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/buildcpio.py33
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/buildgalculator.py35
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/buildlzip.py36
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/gcc.py43
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/perl.py28
-rw-r--r--poky/meta/lib/oeqa/sdk/cases/python.py32
-rw-r--r--poky/meta/lib/oeqa/sdk/context.py134
-rw-r--r--poky/meta/lib/oeqa/sdk/files/testsdkmakefile5
-rw-r--r--poky/meta/lib/oeqa/sdk/utils/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py45
-rw-r--r--poky/meta/lib/oeqa/sdkext/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/sdkext/case.py21
-rw-r--r--poky/meta/lib/oeqa/sdkext/cases/devtool.py129
-rw-r--r--poky/meta/lib/oeqa/sdkext/context.py29
-rw-r--r--poky/meta/lib/oeqa/sdkext/files/myapp/Makefile10
-rw-r--r--poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c9
-rw-r--r--poky/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt11
-rw-r--r--poky/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c9
-rw-r--r--poky/meta/lib/oeqa/selftest/case.py278
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py92
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/archiver.py131
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/bblayers.py97
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/bbtests.py278
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/buildhistory.py46
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/buildoptions.py180
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/containerimage.py85
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/devtool.py1716
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/distrodata.py99
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/eSDK.py111
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/efibootpartition.py45
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/gotoolchain.py67
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/image_typedep.py53
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/imagefeatures.py240
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/layerappend.py95
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/liboe.py102
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/lic_checksum.py35
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/manifest.py166
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/meta_ide.py49
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/__init__.py0
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py99
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/elf.py21
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/license.py99
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/path.py89
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/types.py50
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oelib/utils.py51
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/oescripts.py15
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/package.py86
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/pkgdata.py224
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/prservice.py131
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/recipetool.py698
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/runcmd.py134
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/runqemu.py206
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/runtime_test.py260
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/selftest.py51
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/signing.py187
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/sstate.py63
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/sstatetests.py532
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/tinfoil.py231
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/wic.py1066
-rw-r--r--poky/meta/lib/oeqa/selftest/context.py279
-rw-r--r--poky/meta/lib/oeqa/targetcontrol.py232
-rw-r--r--poky/meta/lib/oeqa/utils/__init__.py103
-rw-r--r--poky/meta/lib/oeqa/utils/buildproject.py55
-rw-r--r--poky/meta/lib/oeqa/utils/commands.py357
-rw-r--r--poky/meta/lib/oeqa/utils/decorators.py295
-rw-r--r--poky/meta/lib/oeqa/utils/dump.py91
-rw-r--r--poky/meta/lib/oeqa/utils/ftools.py46
-rw-r--r--poky/meta/lib/oeqa/utils/git.py80
-rw-r--r--poky/meta/lib/oeqa/utils/httpserver.py36
-rw-r--r--poky/meta/lib/oeqa/utils/logparser.py126
-rw-r--r--poky/meta/lib/oeqa/utils/metadata.py108
-rw-r--r--poky/meta/lib/oeqa/utils/network.py8
-rw-r--r--poky/meta/lib/oeqa/utils/package_manager.py211
-rw-r--r--poky/meta/lib/oeqa/utils/qemurunner.py591
-rw-r--r--poky/meta/lib/oeqa/utils/qemutinyrunner.py176
-rw-r--r--poky/meta/lib/oeqa/utils/sshcontrol.py242
-rw-r--r--poky/meta/lib/oeqa/utils/subprocesstweak.py19
-rw-r--r--poky/meta/lib/oeqa/utils/targetbuild.py139
-rw-r--r--poky/meta/lib/oeqa/utils/testexport.py263
-rw-r--r--poky/meta/lib/rootfspostcommands.py56
-rw-r--r--poky/meta/recipes-bsp/acpid/acpid.inc32
-rw-r--r--poky/meta/recipes-bsp/acpid/acpid/acpid.service10
-rwxr-xr-xpoky/meta/recipes-bsp/acpid/acpid/init31
-rw-r--r--poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb7
-rw-r--r--poky/meta/recipes-bsp/alsa-state/alsa-state.bb68
-rwxr-xr-xpoky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init39
-rw-r--r--poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf1
-rw-r--r--poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state1
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/apmd.service7
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/apmd_proxy91
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf16
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/default8
-rwxr-xr-xpoky/meta/recipes-bsp/apmd/apmd/init51
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/legacy.patch133
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/libtool.patch33
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/linkage.patch53
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/unlinux.patch25
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch26
-rw-r--r--poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb85
-rw-r--r--poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb39
-rw-r--r--poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs8
-rw-r--r--poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch22
-rw-r--r--poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch60
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/config50
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/machconfig0
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemumips/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig10
-rwxr-xr-xpoky/meta/recipes-bsp/formfactor/files/qemux86/machconfig10
-rw-r--r--poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb20
-rw-r--r--poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch35
-rw-r--r--poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch38
-rw-r--r--poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch54
-rw-r--r--poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.6.bb71
-rw-r--r--poky/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch46
-rw-r--r--poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch56
-rw-r--r--poky/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch34
-rw-r--r--poky/meta/recipes-bsp/grub/files/cfg2
-rw-r--r--poky/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch39
-rw-r--r--poky/meta/recipes-bsp/grub/files/gcc8.patch74
-rw-r--r--poky/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch58
-rw-r--r--poky/meta/recipes-bsp/grub/grub-bootconf_1.00.bb29
-rw-r--r--poky/meta/recipes-bsp/grub/grub-efi_2.02.bb109
-rw-r--r--poky/meta/recipes-bsp/grub/grub2.inc71
-rw-r--r--poky/meta/recipes-bsp/grub/grub_2.02.bb29
-rw-r--r--poky/meta/recipes-bsp/keymaps/files/GPLv2.patch347
-rwxr-xr-xpoky/meta/recipes-bsp/keymaps/files/keymap.sh16
-rw-r--r--poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb50
-rw-r--r--poky/meta/recipes-bsp/libacpi/files/ldflags.patch41
-rw-r--r--poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch37
-rw-r--r--poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch47
-rw-r--r--poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch23
-rw-r--r--poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb32
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch19
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch39
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch21884
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch32
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch49
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch22
-rw-r--r--poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb48
-rw-r--r--poky/meta/recipes-bsp/pciutils/pciutils/configure.patch81
-rw-r--r--poky/meta/recipes-bsp/pciutils/pciutils_3.5.6.bb58
-rw-r--r--poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch21
-rw-r--r--poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch101
-rw-r--r--poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch29
-rw-r--r--poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc34
-rw-r--r--poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb11
-rw-r--r--poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb27
-rw-r--r--poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch18
-rw-r--r--poky/meta/recipes-bsp/setserial/setserial/ldflags.patch24
-rw-r--r--poky/meta/recipes-bsp/setserial/setserial_2.17.bb29
-rw-r--r--poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch19
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot-common_2018.01.inc16
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.01.bb34
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.01.bb29
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot.inc307
-rw-r--r--poky/meta/recipes-bsp/u-boot/u-boot_2018.01.bb4
-rw-r--r--poky/meta/recipes-bsp/usbinit/usbinit.bb21
-rw-r--r--poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL339
-rwxr-xr-xpoky/meta/recipes-bsp/usbinit/usbinit/usb-gether23
-rw-r--r--poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch30
-rw-r--r--poky/meta/recipes-bsp/usbutils/usbutils_009.bb34
-rw-r--r--poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch21766
-rw-r--r--poky/meta/recipes-bsp/v86d/v86d/aarch64-host.patch18
-rw-r--r--poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch33
-rw-r--r--poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb35
-rw-r--r--poky/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb62
-rw-r--r--poky/meta/recipes-connectivity/avahi/avahi.inc139
-rw-r--r--poky/meta/recipes-connectivity/avahi/avahi_0.7.bb20
-rw-r--r--poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd10
-rw-r--r--poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd10
-rw-r--r--poky/meta/recipes-connectivity/avahi/files/initscript.patch47
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch54
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch25
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch34
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch48
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch49
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/bind92
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/conf.patch330
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch17
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh8
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch65
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch42
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/named.service22
-rw-r--r--poky/meta/recipes-connectivity/bind/bind/use-python3-and-fix-install-lib-path.patch36
-rw-r--r--poky/meta/recipes-connectivity/bind/bind_9.10.6.bb123
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5.inc146
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch63
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5/init65
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5/out-of-tree.patch26
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest31
-rw-r--r--poky/meta/recipes-connectivity/bluez5/bluez5_5.48.bb69
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-conf.bb36
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service10
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup16
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config9
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch277
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch35
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch187
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.pngbin0 -> 490 bytes
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.pngbin0 -> 496 bytes
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.pngbin0 -> 492 bytes
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.pngbin0 -> 470 bytes
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.pngbin0 -> 419 bytes
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch36
-rw-r--r--poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb30
-rw-r--r--poky/meta/recipes-connectivity/connman/connman.inc216
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch29
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch41
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch63
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch35
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch112
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch69
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch77
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch68
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch77
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/connman83
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/includes.patch423
-rw-r--r--poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch27
-rw-r--r--poky/meta/recipes-connectivity/connman/connman_1.35.bb22
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp.inc143
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch30
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch117
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch38
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch100
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch36
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0006-site.h-enable-gentle-shutdown.patch30
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch42
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0008-tweak-to-support-external-bind.patch117
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch28
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0010-build-shared-libs.patch208
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch81
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch37
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2017-3144.patch74
-rw-r--r--poky/meta/recipes-connectivity/dhcp/dhcp_4.3.6.bb22
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/default-relay12
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/default-server7
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper39
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhclient.conf50
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhclient.service13
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf108
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhcpd.service15
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service15
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service10
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/init-relay44
-rw-r--r--poky/meta/recipes-connectivity/dhcp/files/init-server44
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2.inc54
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2/0001-ip-Remove-unneed-header.patch30
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch63
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch41
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch32
-rw-r--r--poky/meta/recipes-connectivity/iproute2/iproute2_4.14.1.bb15
-rwxr-xr-xpoky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init78
-rw-r--r--poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch87
-rw-r--r--poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch29
-rw-r--r--poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb51
-rw-r--r--poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch41
-rw-r--r--poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch35
-rw-r--r--poky/meta/recipes-connectivity/iw/iw_4.14.bb33
-rw-r--r--poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch56
-rw-r--r--poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb40
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap.inc42
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch41
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch67
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch36
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch29
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch73
-rw-r--r--poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb31
-rw-r--r--poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb13
-rw-r--r--poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch35
-rw-r--r--poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch36
-rw-r--r--poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch30
-rw-r--r--poky/meta/recipes-connectivity/neard/neard/neard.in54
-rw-r--r--poky/meta/recipes-connectivity/neard/neard_0.16.bb50
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch31
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch42
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch27
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch18
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch13
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb27
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch40
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch27
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service15
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service24
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service13
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch37
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch42
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf35
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon63
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver130
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount8
-rw-r--r--poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb150
-rw-r--r--poky/meta/recipes-connectivity/ofono/ofono.inc39
-rw-r--r--poky/meta/recipes-connectivity/ofono/ofono/ofono42
-rw-r--r--poky/meta/recipes-connectivity/ofono/ofono/use-python3.patch27
-rw-r--r--poky/meta/recipes-connectivity/ofono/ofono_1.22.bb9
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch47
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/disable-ciphers-not-supported-by-OpenSSL-DES.patch39
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch99
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/init90
-rwxr-xr-xpoky/meta/recipes-connectivity/openssh/openssh/run-ptest44
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/ssh_config48
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshd10
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshd.socket10
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshd@.service13
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys90
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshd_config132
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service8
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd2
-rw-r--r--poky/meta/recipes-connectivity/openssh/openssh_7.6p1.bb167
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-Fix-build-with-clang-using-external-assembler.patch45
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-openssl-force-soft-link-to-avoid-rare-race.patch46
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Makefiles-ptest.patch93
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Use-SHA256-not-MD5-as-default-digest.patch69
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-musl-target.patch25
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-targets.patch35
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/c_rehash-compat.patch71
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/ca.patch22
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/debian-targets.patch73
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-dir.patch15
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-section.patch34
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-rpath.patch15
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-symbolic.patch15
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/pic.patch177
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_digicert_malaysia.patch29
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_diginotar.patch68
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/soname.patch15
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/version-script.patch4658
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/engines-install-in-libdir-ssl.patch64
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/find.pl54
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/oe-ldflags.patch24
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-c_rehash.sh222
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-fix-des.pod-error.patch19
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-util-perlpath.pl-cwd.patch34
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl_fix_for_x32.patch39
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/parallel.patch370
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest-deps.patch34
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest_makefile_deps.patch248
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-cflags.patch20
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-mkbuildinf.patch21
-rwxr-xr-xpoky/meta/recipes-connectivity/openssl/openssl-1.0.2o/run-ptest2
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/shared-libs.patch41
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl/0001-Take-linking-flags-from-LDFLAGS-env-var.patch43
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh222
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl/run-ptest4
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl10.inc285
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb64
-rw-r--r--poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb161
-rw-r--r--poky/meta/recipes-connectivity/ppp-dialin/files/host-peer11
-rw-r--r--poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin3
-rw-r--r--poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb27
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch163
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch30
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch43
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/0001-pppoe-include-netinet-in.h-before-linux-in.h.patch54
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/08setupdns12
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/92removedns5
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch297
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/copts.patch21
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch30
-rwxr-xr-xpoky/meta/recipes-connectivity/ppp/ppp/init57
-rwxr-xr-xpoky/meta/recipes-connectivity/ppp/ppp/ip-down43
-rwxr-xr-xpoky/meta/recipes-connectivity/ppp/ppp/ip-up44
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch38
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/makefile.patch95
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/pap22
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/poff26
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/pon9
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/ppp@.service9
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot21
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch45
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp/provider35
-rw-r--r--poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb101
-rw-r--r--poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf4
-rw-r--r--poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch20
-rw-r--r--poky/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb67
-rw-r--r--poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch52
-rw-r--r--poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch32
-rw-r--r--poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch35
-rw-r--r--poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb41
-rw-r--r--poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch21
-rw-r--r--poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch22
-rw-r--r--poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch15
-rw-r--r--poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch19
-rw-r--r--poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb50
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant1
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig552
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch1025
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh86
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf690
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane7
-rw-r--r--poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb111
-rw-r--r--poky/meta/recipes-core/base-files/base-files/filesystems8
-rw-r--r--poky/meta/recipes-core/base-files/base-files/fstab11
-rw-r--r--poky/meta/recipes-core/base-files/base-files/host.conf2
-rw-r--r--poky/meta/recipes-core/base-files/base-files/issue0
-rw-r--r--poky/meta/recipes-core/base-files/base-files/issue.net0
-rw-r--r--poky/meta/recipes-core/base-files/base-files/licenses/GPL-2340
-rw-r--r--poky/meta/recipes-core/base-files/base-files/motd0
-rw-r--r--poky/meta/recipes-core/base-files/base-files/nsswitch.conf19
-rw-r--r--poky/meta/recipes-core/base-files/base-files/profile34
-rw-r--r--poky/meta/recipes-core/base-files/base-files/rotation1
-rw-r--r--poky/meta/recipes-core/base-files/base-files/share/dot.bashrc16
-rw-r--r--poky/meta/recipes-core/base-files/base-files/share/dot.profile11
-rw-r--r--poky/meta/recipes-core/base-files/base-files/shells2
-rw-r--r--poky/meta/recipes-core/base-files/base-files/usbd0
-rw-r--r--poky/meta/recipes-core/base-files/base-files_3.0.14.bb176
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch19
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch24
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd/input.patch22
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch15
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch14
-rw-r--r--poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb115
-rw-r--r--poky/meta/recipes-core/busybox/busybox-inittab_1.27.2.bb32
-rw-r--r--poky/meta/recipes-core/busybox/busybox.inc447
-rw-r--r--poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch114
-rwxr-xr-xpoky/meta/recipes-core/busybox/busybox/CVE-2011-5325.patch481
-rw-r--r--poky/meta/recipes-core/busybox/busybox/CVE-2017-15873.patch95
-rw-r--r--poky/meta/recipes-core/busybox/busybox/busybox-CVE-2017-16544.patch43
-rw-r--r--poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch71
-rw-r--r--poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch137
-rw-r--r--poky/meta/recipes-core/busybox/busybox/defconfig1149
-rw-r--r--poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch32
-rw-r--r--poky/meta/recipes-core/busybox/busybox/getopts.cfg3
-rw-r--r--poky/meta/recipes-core/busybox/busybox/init.cfg3
-rw-r--r--poky/meta/recipes-core/busybox/busybox/login-utilities.cfg13
-rw-r--r--poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch34
-rw-r--r--poky/meta/recipes-core/busybox/busybox/mdev.cfg11
-rw-r--r--poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg9
-rw-r--r--poky/meta/recipes-core/busybox/busybox/musl.cfg11
-rw-r--r--poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch21
-rw-r--r--poky/meta/recipes-core/busybox/busybox/resize.cfg2
-rw-r--r--poky/meta/recipes-core/busybox/busybox/sha1sum.cfg1
-rw-r--r--poky/meta/recipes-core/busybox/busybox/sha256sum.cfg1
-rw-r--r--poky/meta/recipes-core/busybox/busybox/syslog.cfg11
-rw-r--r--poky/meta/recipes-core/busybox/busybox_1.27.2.bb52
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/busybox-cron39
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/busybox-httpd44
-rw-r--r--poky/meta/recipes-core/busybox/files/busybox-klogd.service.in8
-rw-r--r--poky/meta/recipes-core/busybox/files/busybox-syslog.default25
-rw-r--r--poky/meta/recipes-core/busybox/files/busybox-syslog.service.in13
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/busybox-udhcpd43
-rw-r--r--poky/meta/recipes-core/busybox/files/default.script4
-rw-r--r--poky/meta/recipes-core/busybox/files/find-touchscreen.sh6
-rw-r--r--poky/meta/recipes-core/busybox/files/hwclock.sh83
-rw-r--r--poky/meta/recipes-core/busybox/files/inetd33
-rw-r--r--poky/meta/recipes-core/busybox/files/inetd.conf20
-rw-r--r--poky/meta/recipes-core/busybox/files/inittab24
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/mdev21
-rw-r--r--poky/meta/recipes-core/busybox/files/mdev-mount.sh63
-rw-r--r--poky/meta/recipes-core/busybox/files/mdev.conf44
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/mount.busybox3
-rw-r--r--poky/meta/recipes-core/busybox/files/rcK26
-rw-r--r--poky/meta/recipes-core/busybox/files/rcS27
-rw-r--r--poky/meta/recipes-core/busybox/files/run-ptest7
-rw-r--r--poky/meta/recipes-core/busybox/files/runlevel11
-rw-r--r--poky/meta/recipes-core/busybox/files/simple.script88
-rw-r--r--poky/meta/recipes-core/busybox/files/syslog77
-rw-r--r--poky/meta/recipes-core/busybox/files/syslog-startup.conf13
-rw-r--r--poky/meta/recipes-core/busybox/files/syslog.conf1
-rwxr-xr-xpoky/meta/recipes-core/busybox/files/umount.busybox3
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch51
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch57
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch44
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars41
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch17
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch12
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch29
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch56
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch75
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m424
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch19
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch22
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch49
-rw-r--r--poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb45
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch26
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch64
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch49
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch39
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch31
-rw-r--r--poky/meta/recipes-core/coreutils/coreutils_8.29.bb133
-rw-r--r--poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb18
-rw-r--r--poky/meta/recipes-core/dbus/dbus-glib.inc39
-rw-r--r--poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch17
-rw-r--r--poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch57
-rw-r--r--poky/meta/recipes-core/dbus/dbus-glib_0.108.bb4
-rw-r--r--poky/meta/recipes-core/dbus/dbus-test_1.12.2.bb82
-rw-r--r--poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch104
-rw-r--r--poky/meta/recipes-core/dbus/dbus/dbus-1.init123
-rw-r--r--poky/meta/recipes-core/dbus/dbus/python-config.patch34
-rwxr-xr-xpoky/meta/recipes-core/dbus/dbus/run-ptest24
-rw-r--r--poky/meta/recipes-core/dbus/dbus/tmpdir.patch44
-rw-r--r--poky/meta/recipes-core/dbus/dbus_1.12.2.bb181
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear.inc107
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch23
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch43
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch19
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch36
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch22
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch140
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/dropbear4
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/dropbear@.service12
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service13
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear/fix-libtomcrypt-libtommath-ordering.patch49
-rwxr-xr-xpoky/meta/recipes-core/dropbear/dropbear/init89
-rw-r--r--poky/meta/recipes-core/dropbear/dropbear_2017.75.bb5
-rw-r--r--poky/meta/recipes-core/expat/expat/autotools.patch25
-rw-r--r--poky/meta/recipes-core/expat/expat/libtool-tag.patch30
-rw-r--r--poky/meta/recipes-core/expat/expat_2.2.5.bb23
-rw-r--r--poky/meta/recipes-core/fts/fts.bb22
-rw-r--r--poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch58
-rw-r--r--poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch87
-rw-r--r--poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch23
-rw-r--r--poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch321
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch38
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING4
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in483
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgzbin0 -> 40014 bytes
-rwxr-xr-xpoky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath684
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin19
-rw-r--r--poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb31
-rw-r--r--poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb127
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch42
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch31
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch43
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch70
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch46
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch85
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch39
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch44
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch30
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch47
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest5
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch22
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb24
-rw-r--r--poky/meta/recipes-core/glib-2.0/glib.inc157
-rw-r--r--poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb29
-rw-r--r--poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb52
-rw-r--r--poky/meta/recipes-core/glibc/glibc-collateral.inc22
-rw-r--r--poky/meta/recipes-core/glibc/glibc-common.inc10
-rw-r--r--poky/meta/recipes-core/glibc/glibc-initial.inc57
-rw-r--r--poky/meta/recipes-core/glibc/glibc-initial_2.27.bb9
-rw-r--r--poky/meta/recipes-core/glibc/glibc-ld.inc48
-rw-r--r--poky/meta/recipes-core/glibc/glibc-locale.inc98
-rw-r--r--poky/meta/recipes-core/glibc/glibc-locale_2.27.bb1
-rw-r--r--poky/meta/recipes-core/glibc/glibc-mtrace.inc13
-rw-r--r--poky/meta/recipes-core/glibc/glibc-mtrace_2.27.bb1
-rw-r--r--poky/meta/recipes-core/glibc/glibc-package.inc231
-rw-r--r--poky/meta/recipes-core/glibc/glibc-scripts.inc20
-rw-r--r--poky/meta/recipes-core/glibc/glibc-scripts_2.27.bb1
-rw-r--r--poky/meta/recipes-core/glibc/glibc-testing.inc95
-rw-r--r--poky/meta/recipes-core/glibc/glibc.inc89
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch69
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch50
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch140
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch34
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch1584
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch33
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch208
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch387
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch62
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch36
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch61
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch42
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0013-Add-unused-attribute.patch34
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0014-yes-within-the-path-sets-wrong-config-variables.patch263
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0015-timezone-re-written-tzselect-as-posix-sh.patch45
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0016-Remove-bash-dependency-for-nscd-init-script.patch75
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0017-eglibc-Cross-building-and-testing-instructions.patch619
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0018-eglibc-Help-bootstrap-cross-toolchain.patch100
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0019-eglibc-Clear-cache-lines-on-ppc8xx.patch83
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch56
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0021-eglibc-Install-PIC-archives.patch123
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch566
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch32
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch56
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch38
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0026-reset-dl_load_write_lock-after-forking.patch40
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch70
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch69
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch40
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0030-plural_c_no_preprocessor_lines.patch21
-rw-r--r--poky/meta/recipes-core/glibc/glibc/0031-nativesdk-deprecate-libcrypt.patch419
-rw-r--r--poky/meta/recipes-core/glibc/glibc/archive-path.patch39
-rw-r--r--poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf0
-rw-r--r--poky/meta/recipes-core/glibc/glibc/generate-supported.mk11
-rw-r--r--poky/meta/recipes-core/glibc/glibc/relocate-locales.patch55
-rw-r--r--poky/meta/recipes-core/glibc/glibc_2.27.bb146
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch331
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README8
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch116
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch454
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch47
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch113
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch24
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch37
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch471
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch36
-rw-r--r--poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb34
-rw-r--r--poky/meta/recipes-core/glibc/site_config/funcs474
-rw-r--r--poky/meta/recipes-core/glibc/site_config/headers155
-rw-r--r--poky/meta/recipes-core/glibc/site_config/types21
-rw-r--r--poky/meta/recipes-core/ifupdown/files/99_network1
-rw-r--r--poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch57
-rw-r--r--poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch422
-rw-r--r--poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb46
-rw-r--r--poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt75
-rw-r--r--poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt78
-rw-r--r--poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx46
-rw-r--r--poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf8
-rw-r--r--poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb136
-rw-r--r--poky/meta/recipes-core/images/core-image-base.bb8
-rw-r--r--poky/meta/recipes-core/images/core-image-minimal-dev.bb7
-rw-r--r--poky/meta/recipes-core/images/core-image-minimal-initramfs.bb33
-rw-r--r--poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb7
-rw-r--r--poky/meta/recipes-core/images/core-image-minimal.bb12
-rw-r--r--poky/meta/recipes-core/images/core-image-tiny-initramfs.bb43
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright11
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init90
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces31
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces5
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces5
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces5
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces5
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces8
-rw-r--r--poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb41
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-boot.sh10
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh199
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh299
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh220
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-install.sh341
-rw-r--r--poky/meta/recipes-core/initrdscripts/files/init-live.sh236
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb16
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/debug82
-rwxr-xr-xpoky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs28
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/exec29
-rwxr-xr-xpoky/meta/recipes-core/initrdscripts/initramfs-framework/finish27
-rwxr-xr-xpoky/meta/recipes-core/initrdscripts/initramfs-framework/init145
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev30
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs67
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live64
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework/udev46
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb92
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb21
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb21
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb16
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb24
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb16
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb24
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb17
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb22
-rw-r--r--poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb20
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch347
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh13
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh24
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh81
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh50
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh148
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/devpts5
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh28
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh17
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/functions91
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/halt29
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh22
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf9
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh39
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh88
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh244
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh38
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/reboot15
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh20
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh13
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs21
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/single24
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/sushell5
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh31
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/umountfs24
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh33
-rwxr-xr-xpoky/meta/recipes-core/initscripts/initscripts-1.0/urandom49
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles37
-rw-r--r--poky/meta/recipes-core/initscripts/initscripts_1.0.bb186
-rw-r--r--poky/meta/recipes-core/kbd/kbd/run-ptest4
-rw-r--r--poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch56
-rw-r--r--poky/meta/recipes-core/kbd/kbd_2.0.4.bb64
-rw-r--r--poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch235
-rw-r--r--poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb45
-rw-r--r--poky/meta/recipes-core/libxcrypt/libxcrypt_4.0.1.bb32
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch96
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/ansidecl.patch25
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch21
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch22
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch204
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch30
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/run-ptest4
-rw-r--r--poky/meta/recipes-core/libxml/libxml2/runtest.patch817
-rw-r--r--poky/meta/recipes-core/libxml/libxml2_2.9.7.bb105
-rw-r--r--poky/meta/recipes-core/meta/build-sysroots.bb38
-rw-r--r--poky/meta/recipes-core/meta/buildtools-tarball.bb83
-rw-r--r--poky/meta/recipes-core/meta/dummy-sdk-package.inc24
-rw-r--r--poky/meta/recipes-core/meta/meta-environment-extsdk.bb12
-rw-r--r--poky/meta/recipes-core/meta/meta-environment.bb78
-rw-r--r--poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb26
-rw-r--r--poky/meta/recipes-core/meta/meta-go-toolchain.bb12
-rw-r--r--poky/meta/recipes-core/meta/meta-ide-support.bb15
-rw-r--r--poky/meta/recipes-core/meta/meta-toolchain.bb6
-rw-r--r--poky/meta/recipes-core/meta/meta-world-pkgdata.bb53
-rw-r--r--poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb11
-rw-r--r--poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb15
-rw-r--r--poky/meta/recipes-core/meta/package-index.bb25
-rw-r--r--poky/meta/recipes-core/meta/signing-keys.bb83
-rw-r--r--poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb11
-rw-r--r--poky/meta/recipes-core/meta/testexport-tarball.bb70
-rw-r--r--poky/meta/recipes-core/meta/uninative-tarball.bb66
-rw-r--r--poky/meta/recipes-core/meta/wic-tools.bb26
-rw-r--r--poky/meta/recipes-core/musl/bsd-headers.bb31
-rw-r--r--poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h26
-rw-r--r--poky/meta/recipes-core/musl/bsd-headers/sys-queue.h846
-rw-r--r--poky/meta/recipes-core/musl/bsd-headers/sys-tree.h761
-rw-r--r--poky/meta/recipes-core/musl/musl-utils.bb25
-rw-r--r--poky/meta/recipes-core/musl/musl.inc33
-rw-r--r--poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch76
-rw-r--r--poky/meta/recipes-core/musl/musl_git.bb72
-rw-r--r--poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch43
-rw-r--r--poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch35
-rw-r--r--poky/meta/recipes-core/ncurses/files/config.cache4
-rw-r--r--poky/meta/recipes-core/ncurses/ncurses.inc318
-rw-r--r--poky/meta/recipes-core/ncurses/ncurses_6.0+20171125.bb11
-rw-r--r--poky/meta/recipes-core/ncurses/site_config/headers5
-rw-r--r--poky/meta/recipes-core/netbase/netbase/hosts8
-rw-r--r--poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch48
-rw-r--r--poky/meta/recipes-core/netbase/netbase_5.4.bb25
-rw-r--r--poky/meta/recipes-core/os-release/os-release.bb47
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf-shell-image.bb20
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch46
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch33
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch39
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch18
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch1124
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch33
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch20
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks4
-rw-r--r--poky/meta/recipes-core/ovmf/ovmf_git.bb248
-rw-r--r--poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb34
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-base.bb364
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb49
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb28
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb9
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb20
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb80
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb6
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb6
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb19
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb19
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb72
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb50
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb18
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb12
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb9
-rw-r--r--poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb197
-rwxr-xr-xpoky/meta/recipes-core/psplash/files/psplash-init35
-rw-r--r--poky/meta/recipes-core/psplash/files/psplash-poky-img.h1259
-rw-r--r--poky/meta/recipes-core/psplash/psplash_git.bb122
-rw-r--r--poky/meta/recipes-core/readline/files/inputrc61
-rw-r--r--poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch35
-rw-r--r--poky/meta/recipes-core/readline/readline-7.0/norpath.patch21
-rw-r--r--poky/meta/recipes-core/readline/readline.inc45
-rw-r--r--poky/meta/recipes-core/readline/readline_7.0.bb7
-rw-r--r--poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch15
-rw-r--r--poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch65
-rw-r--r--poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch23
-rw-r--r--poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb33
-rw-r--r--poky/meta/recipes-core/systemd/systemd-boot_237.bb70
-rw-r--r--poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb31
-rw-r--r--poky/meta/recipes-core/systemd/systemd-compat-units.bb47
-rw-r--r--poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb13
-rw-r--r--poky/meta/recipes-core/systemd/systemd-serialgetty.bb50
-rw-r--r--poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service37
-rw-r--r--poky/meta/recipes-core/systemd/systemd-systemctl-native.bb17
-rwxr-xr-xpoky/meta/recipes-core/systemd/systemd-systemctl/systemctl195
-rw-r--r--poky/meta/recipes-core/systemd/systemd.inc21
-rw-r--r--poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf7
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-Also-check-i386-i586-and-i686-for-ia32.patch28
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch62
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch34
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch33
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch33
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch30
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch81
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch64
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch43
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch33
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch78
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch28
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch377
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch41
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch45
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch39
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch43
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch431
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch118
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch157
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch47
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch85
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch47
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch29
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch28
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch42
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch105
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch99
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch31
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch43
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch89
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch63
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch50
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch43
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch45
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch30
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0032-memfd.patch272
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch203
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch173
-rw-r--r--poky/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch33
-rw-r--r--poky/meta/recipes-core/systemd/systemd/init104
-rw-r--r--poky/meta/recipes-core/systemd/systemd/libmount.patch75
-rw-r--r--poky/meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--poky/meta/recipes-core/systemd/systemd_237.bb595
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch25
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch83
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch189
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab30
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty43
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb93
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch52
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd1
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init98
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/rc182
-rwxr-xr-xpoky/meta/recipes-core/sysvinit/sysvinit/rcS34
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/rcS-default29
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch78
-rw-r--r--poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb109
-rw-r--r--poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch28
-rw-r--r--poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch364
-rw-r--r--poky/meta/recipes-core/udev/eudev/devfs-udev.rules108
-rw-r--r--poky/meta/recipes-core/udev/eudev/init93
-rw-r--r--poky/meta/recipes-core/udev/eudev/links.conf21
-rw-r--r--poky/meta/recipes-core/udev/eudev/local.rules19
-rw-r--r--poky/meta/recipes-core/udev/eudev/permissions.rules131
-rw-r--r--poky/meta/recipes-core/udev/eudev/run.rules14
-rw-r--r--poky/meta/recipes-core/udev/eudev/udev.rules116
-rw-r--r--poky/meta/recipes-core/udev/eudev_3.2.5.bb92
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/automount.rules19
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/autonet.rules19
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/localextra.rules23
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist5
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/mount.sh90
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf/network.sh54
-rw-r--r--poky/meta/recipes-core/udev/udev-extraconf_1.1.bb42
-rw-r--r--poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch49
-rw-r--r--poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch59
-rw-r--r--poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch28
-rw-r--r--poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb33
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux.inc338
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch20
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch23
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch25
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/ptest.patch23
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/run-ptest25
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd3
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/runuser.pamd4
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch33
-rw-r--r--poky/meta/recipes-core/util-linux/util-linux_2.32.bb30
-rw-r--r--poky/meta/recipes-core/volatile-binds/files/COPYING.MIT17
-rwxr-xr-xpoky/meta/recipes-core/volatile-binds/files/mount-copybind34
-rw-r--r--poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in19
-rw-r--r--poky/meta/recipes-core/volatile-binds/volatile-binds.bb80
-rw-r--r--poky/meta/recipes-core/zlib/site_config/headers1
-rw-r--r--poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch38
-rw-r--r--poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch45
-rw-r--r--poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch21
-rw-r--r--poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest2
-rw-r--r--poky/meta/recipes-core/zlib/zlib_1.2.11.bb67
-rw-r--r--poky/meta/recipes-devtools/apt/apt-native.inc76
-rw-r--r--poky/meta/recipes-devtools/apt/apt-native_1.2.24.bb7
-rw-r--r--poky/meta/recipes-devtools/apt/apt-package.inc93
-rw-r--r--poky/meta/recipes-devtools/apt/apt.inc35
-rw-r--r--poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch126
-rw-r--r--poky/meta/recipes-devtools/apt/apt/0001-apt-1.2.12-Fix-musl-build.patch50
-rw-r--r--poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch29
-rw-r--r--poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch74
-rw-r--r--poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch43
-rw-r--r--poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch18
-rw-r--r--poky/meta/recipes-devtools/apt/apt/disable-test.patch72
-rw-r--r--poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch14
-rw-r--r--poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch80
-rw-r--r--poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch46
-rw-r--r--poky/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch33
-rw-r--r--poky/meta/recipes-devtools/apt/apt/makerace.patch23
-rw-r--r--poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch28
-rw-r--r--poky/meta/recipes-devtools/apt/apt/noconfigure.patch37
-rw-r--r--poky/meta/recipes-devtools/apt/apt/nodoc.patch18
-rw-r--r--poky/meta/recipes-devtools/apt/apt/truncate-filename.patch35
-rw-r--r--poky/meta/recipes-devtools/apt/apt/use-host.patch15
-rw-r--r--poky/meta/recipes-devtools/apt/apt_1.2.24.bb20
-rw-r--r--poky/meta/recipes-devtools/apt/files/apt.conf42
-rw-r--r--poky/meta/recipes-devtools/apt/files/db_linking_hack.patch29
-rw-r--r--poky/meta/recipes-devtools/apt/files/environment.patch15
-rw-r--r--poky/meta/recipes-devtools/apt/files/no-curl.patch54
-rw-r--r--poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb18
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf.inc53
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch162
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch26
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch120
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch139
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch38
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch136
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch34
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch40
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch120
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/performance.patch60
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch25
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch20
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch29
-rw-r--r--poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb28
-rw-r--r--poky/meta/recipes-devtools/automake/automake.inc21
-rw-r--r--poky/meta/recipes-devtools/automake/automake/0001-automake-Add-default-libtool_tag-to-cppasm.patch27
-rw-r--r--poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch96
-rw-r--r--poky/meta/recipes-devtools/automake/automake/buildtest.patch35
-rw-r--r--poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch36
-rw-r--r--poky/meta/recipes-devtools/automake/automake/performance.patch73
-rw-r--r--poky/meta/recipes-devtools/automake/automake/python-libdir.patch91
-rw-r--r--poky/meta/recipes-devtools/automake/automake_1.15.1.bb43
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-2.30.inc43
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc32
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.30.bb3
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-cross.inc38
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-cross_2.30.bb3
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.30.bb13
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils.inc162
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch62
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch61
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch47
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch42
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch41
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch21143
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch35
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch35
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch273
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch52
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch59
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch393
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch36
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch50
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch89
-rw-r--r--poky/meta/recipes-devtools/binutils/binutils_2.30.bb49
-rw-r--r--poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch34
-rw-r--r--poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch58
-rw-r--r--poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch46
-rw-r--r--poky/meta/recipes-devtools/bison/bison_3.0.4.bb38
-rw-r--r--poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch30
-rw-r--r--poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch45
-rw-r--r--poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh18
-rw-r--r--poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb156
-rw-r--r--poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch26
-rw-r--r--poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-build-mktables-using-native-gcc.patch27
-rw-r--r--poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.13.3.bb39
-rw-r--r--poky/meta/recipes-devtools/build-compare/build-compare_git.bb39
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch64
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch40
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch1599
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch117
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/functions.sh-remove-space-at-head.patch41
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/functions.sh-run-rpm-once-to-make-it-faster.patch361
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check-for-fifo-named-pipe.patch35
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check_single_file-return-at-once-when-sa.patch37
-rw-r--r--poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-remove-space-in-the-end-for-ftype.patch32
-rw-r--r--poky/meta/recipes-devtools/ccache/ccache.inc16
-rw-r--r--poky/meta/recipes-devtools/ccache/ccache_3.3.5.bb12
-rw-r--r--poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch29
-rw-r--r--poky/meta/recipes-devtools/ccache/files/Revert-Create-man-page-in-the-make-install-from-git-.patch33
-rw-r--r--poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb30
-rw-r--r--poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch32
-rw-r--r--poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb27
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake-native_3.10.3.bb38
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake.inc28
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Boost-1.66.0-dependency-and-release-update.patch52
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Fix-incorrect-alphabetisation-of-headers-l.patch29
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/0002-FindBoost-Implement-Architecture-and-Address-Model-t.patch132
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/0003-FindBoost-Search-for-upstream-packaged-libs-next-to-.patch31
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake22
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/cmake-Prevent-the-detection-of-Qt5.patch215
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch26
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh1
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch77
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch58
-rw-r--r--poky/meta/recipes-devtools/cmake/cmake_3.10.3.bb50
-rw-r--r--poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch28
-rw-r--r--poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch27
-rw-r--r--poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb31
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb62
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch50
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch215
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/files/0001-print-progress-in-percent-when-downloading-CVE-db.patch135
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch52
-rw-r--r--poky/meta/recipes-devtools/cve-check-tool/files/check-for-malloc_trim-before-using-it.patch51
-rw-r--r--poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb18
-rw-r--r--poky/meta/recipes-devtools/devel-config/distcc-config.bb22
-rw-r--r--poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh4
-rw-r--r--poky/meta/recipes-devtools/devel-config/nfs-export-root.bb17
-rw-r--r--poky/meta/recipes-devtools/devel-config/nfs-export-root/exports1
-rw-r--r--poky/meta/recipes-devtools/diffstat/diffstat/run-ptest5
-rw-r--r--poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb27
-rw-r--r--poky/meta/recipes-devtools/distcc/distcc_3.2.bb69
-rw-r--r--poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch29
-rw-r--r--poky/meta/recipes-devtools/distcc/files/default24
-rwxr-xr-xpoky/meta/recipes-devtools/distcc/files/distcc119
-rw-r--r--poky/meta/recipes-devtools/distcc/files/distcc.service11
-rw-r--r--poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop12
-rw-r--r--poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch21
-rw-r--r--poky/meta/recipes-devtools/dmidecode/dmidecode_3.1.bb23
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch22
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch30
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch31
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch28
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch38
-rw-r--r--poky/meta/recipes-devtools/dnf/dnf_2.7.5.bb74
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS16
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch515
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml68
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb55
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch24
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml6
-rw-r--r--poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb63
-rw-r--r--poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb25
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg.inc101
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0001-arch-Add-support-for-riscv64-CPU.patch54
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0001-dpkg-Support-muslx32-build.patch41
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch38
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch75
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch31
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch36
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch42
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch39
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch48
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch29
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service17
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch97
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/noman.patch22
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch17
-rw-r--r--poky/meta/recipes-devtools/dpkg/dpkg_1.18.24.bb22
-rw-r--r--poky/meta/recipes-devtools/dwarfsrcfiles/dwarfsrcfiles.bb22
-rw-r--r--poky/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c111
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc27
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-build-failure-in-swapfs.c-on-big-endia.patch40
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch41
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch36
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch36
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch20
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch82
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch19
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch44
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest10
-rw-r--r--poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.8.bb120
-rw-r--r--poky/meta/recipes-devtools/elfutils/elfutils_0.170.bb70
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch34
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0001-Use-fallthrough-attribute.patch791
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch52
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch39
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch42
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch40
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch44
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch35
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch61
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch45
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch1029
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch35
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch171
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch229
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff603
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff802
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch715
-rw-r--r--poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch25
-rw-r--r--poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch29
-rw-r--r--poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch108
-rw-r--r--poky/meta/recipes-devtools/expect/expect/0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch91
-rw-r--r--poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch34
-rw-r--r--poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch17
-rw-r--r--poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch144
-rw-r--r--poky/meta/recipes-devtools/expect/expect_5.45.4.bb76
-rw-r--r--poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.3.bb26
-rw-r--r--poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch39
-rw-r--r--poky/meta/recipes-devtools/file/file/debian-742262.patch27
-rw-r--r--poky/meta/recipes-devtools/file/file_5.32.bb48
-rw-r--r--poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--poky/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch64
-rw-r--r--poky/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch59
-rw-r--r--poky/meta/recipes-devtools/flex/flex/disable-tests.patch19
-rw-r--r--poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch17
-rwxr-xr-xpoky/meta/recipes-devtools/flex/flex/run-ptest5
-rw-r--r--poky/meta/recipes-devtools/flex/flex_2.6.0.bb70
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3.inc132
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch212
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch40
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch58
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch272
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0008-c99-snprintf.patch28
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch192
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch39
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch85
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch125
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch46
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch54
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch57
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch234
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch113
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch42
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch43
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch31
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch53
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch56
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch42
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch98
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch54
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch38
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch29
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch28
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch54
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch213
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch102
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch137
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch28
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch87
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch284
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch54
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch124
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch29
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch91
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch46
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch49
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch259
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-common.inc119
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-configure-common.inc123
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc173
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb5
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc89
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb2
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross.inc218
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb3
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc10
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb3
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc12
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb2
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc235
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-runtime.inc291
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb7
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc108
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb2
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-shared-source.inc11
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-source.inc39
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-source_7.3.bb4
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc-target.inc237
-rw-r--r--poky/meta/recipes-devtools/gcc/gcc_7.3.bb10
-rw-r--r--poky/meta/recipes-devtools/gcc/libgcc-common.inc155
-rw-r--r--poky/meta/recipes-devtools/gcc/libgcc-initial.inc20
-rw-r--r--poky/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb2
-rw-r--r--poky/meta/recipes-devtools/gcc/libgcc.inc42
-rw-r--r--poky/meta/recipes-devtools/gcc/libgcc_7.3.bb2
-rw-r--r--poky/meta/recipes-devtools/gcc/libgfortran.inc77
-rw-r--r--poky/meta/recipes-devtools/gcc/libgfortran_7.3.bb3
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-8.0.1.inc24
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-common.inc61
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc43
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-cross-canadian_8.0.1.bb3
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-cross.inc30
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb-cross_8.0.1.bb2
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb.inc10
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch30
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch28
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch37
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch53
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch922
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch50
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch36
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch50
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch30
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch48
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/0012-Unbreak-GDBserver-build-for-x32.patch101
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch56
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch45
-rw-r--r--poky/meta/recipes-devtools/gdb/gdb_8.0.1.bb27
-rw-r--r--poky/meta/recipes-devtools/git/git.inc145
-rw-r--r--poky/meta/recipes-devtools/git/git_2.16.1.bb11
-rw-r--r--poky/meta/recipes-devtools/glide/glide_0.13.1.bb15
-rwxr-xr-xpoky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in267
-rw-r--r--poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch25
-rw-r--r--poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb40
-rw-r--r--poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb40
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10.inc24
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch33
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch220
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch64
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch47
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch40
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch277
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch108
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch58
-rw-r--r--poky/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch130
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9.inc26
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch32
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch67
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch92
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch68
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch41
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch36
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch46
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch33
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch47
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch43
-rw-r--r--poky/meta/recipes-devtools/go/go-1.9/set-external-linker.patch111
-rw-r--r--poky/meta/recipes-devtools/go/go-common.inc33
-rw-r--r--poky/meta/recipes-devtools/go/go-cross-canadian.inc58
-rw-r--r--poky/meta/recipes-devtools/go/go-cross-canadian_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go-cross-canadian_1.9.bb12
-rw-r--r--poky/meta/recipes-devtools/go/go-cross.inc62
-rw-r--r--poky/meta/recipes-devtools/go/go-cross_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go-cross_1.9.bb10
-rw-r--r--poky/meta/recipes-devtools/go/go-crosssdk.inc50
-rw-r--r--poky/meta/recipes-devtools/go/go-crosssdk_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go-crosssdk_1.9.bb11
-rw-r--r--poky/meta/recipes-devtools/go/go-dep/0001-Add-support-for-mips-mips64.patch54
-rw-r--r--poky/meta/recipes-devtools/go/go-dep_0.4.1.bb20
-rw-r--r--poky/meta/recipes-devtools/go/go-native.inc59
-rw-r--r--poky/meta/recipes-devtools/go/go-native_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go-native_1.9.bb4
-rw-r--r--poky/meta/recipes-devtools/go/go-runtime.inc92
-rw-r--r--poky/meta/recipes-devtools/go/go-runtime_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go-runtime_1.9.bb23
-rw-r--r--poky/meta/recipes-devtools/go/go-target.inc53
-rw-r--r--poky/meta/recipes-devtools/go/go_1.10.bb2
-rw-r--r--poky/meta/recipes-devtools/go/go_1.9.bb17
-rw-r--r--poky/meta/recipes-devtools/help2man/help2man-native_1.47.5.bb25
-rw-r--r--poky/meta/recipes-devtools/i2c-tools/files/0001-i2c-tools-eeprog-Module.mk-Add-missing-dependency.patch32
-rw-r--r--poky/meta/recipes-devtools/i2c-tools/files/0001-lib-Module.mk-Add-missing-dependencies.patch37
-rw-r--r--poky/meta/recipes-devtools/i2c-tools/files/0001-tools-Module.mk-Add-missing-dependencies.patch66
-rw-r--r--poky/meta/recipes-devtools/i2c-tools/files/remove-i2c-dev.patch98
-rw-r--r--poky/meta/recipes-devtools/i2c-tools/i2c-tools_4.0.bb36
-rwxr-xr-xpoky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env382
-rw-r--r--poky/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb36
-rw-r--r--poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-env.sh49
-rw-r--r--poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-setup.sh43
-rw-r--r--poky/meta/recipes-devtools/icecc-toolchain/nativesdk-icecc-toolchain_0.1.bb38
-rw-r--r--poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb30
-rw-r--r--poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch42
-rw-r--r--poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch40
-rw-r--r--poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch57
-rw-r--r--poky/meta/recipes-devtools/intltool/intltool/remove-perl-check.patch45
-rw-r--r--poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb37
-rw-r--r--poky/meta/recipes-devtools/json-c/json-c_0.13.bb31
-rw-r--r--poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch41
-rw-r--r--poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch35
-rw-r--r--poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch27
-rw-r--r--poky/meta/recipes-devtools/libcomps/libcomps_git.bb24
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch31
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch30
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch36
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch29
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch31
-rw-r--r--poky/meta/recipes-devtools/libdnf/libdnf_0.11.1.bb28
-rw-r--r--poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch62
-rw-r--r--poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch29
-rw-r--r--poky/meta/recipes-devtools/librepo/librepo_1.8.1.bb21
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc48
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb40
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb22
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch68
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch30
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch50
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch42
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch65
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch102
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch29
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch38
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/prefix.patch98
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch166
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch35
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch179
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch22
-rw-r--r--poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb28
-rw-r--r--poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb31
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch41
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch93
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch39
-rw-r--r--poky/meta/recipes-devtools/llvm/llvm_git.bb187
-rw-r--r--poky/meta/recipes-devtools/m4/m4-1.4.18.inc29
-rw-r--r--poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb14
-rw-r--r--poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-devtools/m4/m4/ac_config_links.patch31
-rw-r--r--poky/meta/recipes-devtools/m4/m4/remove-gets.patch24
-rw-r--r--poky/meta/recipes-devtools/m4/m4_1.4.18.bb3
-rw-r--r--poky/meta/recipes-devtools/make/make.inc15
-rw-r--r--poky/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch70
-rw-r--r--poky/meta/recipes-devtools/make/make/0002-glob-Do-not-assume-glibc-glob-internals.patch38
-rw-r--r--poky/meta/recipes-devtools/make/make_4.2.1.bb12
-rw-r--r--poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch346
-rw-r--r--poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c589
-rw-r--r--poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb26
-rw-r--r--poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch30
-rw-r--r--poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch113
-rw-r--r--poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch42
-rw-r--r--poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch114
-rw-r--r--poky/meta/recipes-devtools/meson/meson_0.44.1.bb21
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch19
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch103
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch26
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch81
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch34
-rw-r--r--poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch18
-rw-r--r--poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb24
-rw-r--r--poky/meta/recipes-devtools/mmc/mmc-utils/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch36
-rw-r--r--poky/meta/recipes-devtools/mmc/mmc-utils_git.bb25
-rw-r--r--poky/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch92
-rw-r--r--poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch105
-rw-r--r--poky/meta/recipes-devtools/mtd/mtd-utils_git.bb72
-rw-r--r--poky/meta/recipes-devtools/mtools/mtools/0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch34
-rw-r--r--poky/meta/recipes-devtools/mtools/mtools/disable-hardcoded-configs.patch23
-rw-r--r--poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch69
-rw-r--r--poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch18
-rw-r--r--poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb51
-rw-r--r--poky/meta/recipes-devtools/nasm/nasm/0001-asmlib-Drop-pure-function-attribute-from-seg_init.patch27
-rw-r--r--poky/meta/recipes-devtools/nasm/nasm_2.13.03.bb30
-rw-r--r--poky/meta/recipes-devtools/ninja/ninja_1.8.2.bb30
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch51
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch112
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch44
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch48
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch18
-rw-r--r--poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb67
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb35
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb48
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch34
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg/opkg.conf28
-rw-r--r--poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb75
-rw-r--r--poky/meta/recipes-devtools/orc/orc_0.4.28.bb27
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch119
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch62
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch58
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch43
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch19
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch26
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch21
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch27
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch19
-rw-r--r--poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb66
-rw-r--r--poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb16
-rw-r--r--poky/meta/recipes-devtools/patch/patch.inc14
-rw-r--r--poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-devtools/patch/patch/0002-Fix-segfault-with-mangled-rename-patch.patch35
-rw-r--r--poky/meta/recipes-devtools/patch/patch/0003-Allow-input-files-to-be-missing-for-ed-style-patches.patch38
-rw-r--r--poky/meta/recipes-devtools/patch/patch/0004-Fix-arbitrary-command-execution-in-ed-style-patches-.patch215
-rw-r--r--poky/meta/recipes-devtools/patch/patch_2.7.6.bb19
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/Increase-maxSize-to-64MB.patch46
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/Skip-empty-section-fixes-66.patch30
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch163
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch38
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch53
-rw-r--r--poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb19
-rw-r--r--poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb36
-rw-r--r--poky/meta/recipes-devtools/perl/liberror-perl_0.17025.bb33
-rw-r--r--poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb29
-rw-r--r--poky/meta/recipes-devtools/perl/liburi-perl_1.73.bb38
-rw-r--r--poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb46
-rw-r--r--poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb28
-rw-r--r--poky/meta/recipes-devtools/perl/libxml-simple-perl_2.24.bb24
-rw-r--r--poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb139
-rw-r--r--poky/meta/recipes-devtools/perl/perl-ptest.inc57
-rw-r--r--poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc2575
-rw-r--r--poky/meta/recipes-devtools/perl/perl.inc10
-rw-r--r--poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch103
-rw-r--r--poky/meta/recipes-devtools/perl/perl/CVE-2017-12837.patch32
-rw-r--r--poky/meta/recipes-devtools/perl/perl/CVE-2017-12883.patch44
-rw-r--r--poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch17
-rw-r--r--poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch22
-rw-r--r--poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch383
-rw-r--r--poky/meta/recipes-devtools/perl/perl/Makefile.patch58
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh1249
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-3238
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-32-be1
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-32-le1
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-6438
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-64-be1
-rw-r--r--poky/meta/recipes-devtools/perl/perl/config.sh-64-le1
-rw-r--r--poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch15
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff63
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff38
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff35
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff57
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff36
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff71
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff37
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff38
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff43
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff36
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff32
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff111
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff26
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff74
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff171
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff52
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff110
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff87
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff34
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff154
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff28
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff25
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff38
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff27
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff53
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff31
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff43
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff100
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff93
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff31
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch30
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff40
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff24
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff119
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff43
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff28
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff41
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff29
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff57
-rw-r--r--poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff37
-rw-r--r--poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch35
-rw-r--r--poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch35
-rw-r--r--poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch33
-rw-r--r--poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch24
-rw-r--r--poky/meta/recipes-devtools/perl/perl/generate-sh.patch56
-rw-r--r--poky/meta/recipes-devtools/perl/perl/installperl.patch17
-rw-r--r--poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch46
-rw-r--r--poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch27
-rw-r--r--poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch91
-rw-r--r--poky/meta/recipes-devtools/perl/perl/native-perlinc.patch26
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-5.26.1-guard_old_libcrypt_fix.patch28
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch33
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch40
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch47
-rwxr-xr-xpoky/meta/recipes-devtools/perl/perl/perl-configure.sh43
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch34
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch37
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-fix-conflict-between-skip_all-and-END.patch181
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch18
-rw-r--r--poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch86
-rw-r--r--poky/meta/recipes-devtools/perl/perl/run-ptest2
-rw-r--r--poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch30
-rw-r--r--poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch38
-rw-r--r--poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch26
-rw-r--r--poky/meta/recipes-devtools/perl/perl_5.24.1.bb353
-rw-r--r--poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-esdk.in24
-rw-r--r--poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-native.in6
-rwxr-xr-xpoky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-wrapper16
-rw-r--r--poky/meta/recipes-devtools/pkgconf/pkgconf_1.4.2.bb71
-rw-r--r--poky/meta/recipes-devtools/pkgconfig/pkgconfig/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch41
-rw-r--r--poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch45
-rw-r--r--poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-esdk.in24
-rw-r--r--poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in7
-rw-r--r--poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb73
-rw-r--r--poky/meta/recipes-devtools/prelink/prelink/macros.prelink5
-rw-r--r--poky/meta/recipes-devtools/prelink/prelink/prelink.conf18
-rw-r--r--poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily40
-rw-r--r--poky/meta/recipes-devtools/prelink/prelink/prelink.default22
-rw-r--r--poky/meta/recipes-devtools/prelink/prelink_git.bb178
-rw-r--r--poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch44
-rw-r--r--poky/meta/recipes-devtools/pseudo/files/fallback-group3
-rw-r--r--poky/meta/recipes-devtools/pseudo/files/fallback-passwd3
-rw-r--r--poky/meta/recipes-devtools/pseudo/files/moreretries.patch19
-rw-r--r--poky/meta/recipes-devtools/pseudo/files/toomanyfiles.patch71
-rw-r--r--poky/meta/recipes-devtools/pseudo/pseudo.inc142
-rw-r--r--poky/meta/recipes-devtools/pseudo/pseudo_git.bb14
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch79
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/0001-npy_cpu-Add-riscv-support.patch28
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/aarch64/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/arm/config.h21
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h17
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/armeb/config.h21
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h17
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/fix_shebang_f2py.patch29
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h31
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h31
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h138
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h138
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h21
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h18
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/powerpc/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/powerpc64/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/riscv64/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h32
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/x86-64/config.h139
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/x86/config.h108
-rw-r--r--poky/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h24
-rw-r--r--poky/meta/recipes-devtools/python-numpy/python-numpy.inc114
-rw-r--r--poky/meta/recipes-devtools/python-numpy/python-numpy_1.14.2.bb6
-rw-r--r--poky/meta/recipes-devtools/python-numpy/python3-numpy_1.14.2.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python-async.inc14
-rw-r--r--poky/meta/recipes-devtools/python/python-git.inc32
-rw-r--r--poky/meta/recipes-devtools/python/python-gitdb.inc24
-rw-r--r--poky/meta/recipes-devtools/python/python-mako.inc21
-rw-r--r--poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--poky/meta/recipes-devtools/python/python-native/debug.patch32
-rw-r--r--poky/meta/recipes-devtools/python/python-native/multilib.patch235
-rw-r--r--poky/meta/recipes-devtools/python/python-native/nohostlibs.patch54
-rw-r--r--poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch86
-rw-r--r--poky/meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--poky/meta/recipes-devtools/python/python-native_2.7.14.bb86
-rw-r--r--poky/meta/recipes-devtools/python/python-nose.inc18
-rw-r--r--poky/meta/recipes-devtools/python/python-nose_1.3.7.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb8
-rw-r--r--poky/meta/recipes-devtools/python/python-scons_3.0.1.bb21
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools.inc48
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb9
-rw-r--r--poky/meta/recipes-devtools/python/python-six.inc14
-rw-r--r--poky/meta/recipes-devtools/python/python-smmap.inc18
-rw-r--r--poky/meta/recipes-devtools/python/python.inc40
-rw-r--r--poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch51
-rw-r--r--poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch100
-rw-r--r--poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch27
-rw-r--r--poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch29
-rw-r--r--poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python/builddir.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python/create_manifest2.py277
-rw-r--r--poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch43
-rw-r--r--poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch34
-rw-r--r--poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch77
-rw-r--r--poky/meta/recipes-devtools/python/python/get_module_deps2.py112
-rw-r--r--poky/meta/recipes-devtools/python/python/host_include_contamination.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/multilib.patch298
-rw-r--r--poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch82
-rw-r--r--poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/python2-manifest.json1047
-rw-r--r--poky/meta/recipes-devtools/python/python/run-ptest5
-rw-r--r--poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--poky/meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python/sitecustomize.py37
-rw-r--r--poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch34
-rw-r--r--poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch21
-rw-r--r--poky/meta/recipes-devtools/python/python3-async_0.6.2.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb23
-rw-r--r--poky/meta/recipes-devtools/python/python3-docutils_0.14.bb18
-rw-r--r--poky/meta/recipes-devtools/python/python3-git_2.1.8.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch552
-rw-r--r--poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb17
-rw-r--r--poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-native_3.5.5.bb112
-rw-r--r--poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb6
-rw-r--r--poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb48
-rw-r--r--poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb31
-rw-r--r--poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb29
-rw-r--r--poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb6
-rw-r--r--poky/meta/recipes-devtools/python/python3-six_1.11.0.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch38
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch66
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch96
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch38
-rw-r--r--poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch21
-rw-r--r--poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch29
-rw-r--r--poky/meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch30
-rw-r--r--poky/meta/recipes-devtools/python/python3/create_manifest3.py354
-rw-r--r--poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--poky/meta/recipes-devtools/python/python3/get_module_deps3.py146
-rw-r--r--poky/meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch82
-rw-r--r--poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch363
-rw-r--r--poky/meta/recipes-devtools/python/python3/python-config.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python3/python3-manifest.json1149
-rw-r--r--poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch25
-rw-r--r--poky/meta/recipes-devtools/python/python3/regen-all.patch25
-rw-r--r--poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch50
-rw-r--r--poky/meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--poky/meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch97
-rw-r--r--poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch51
-rw-r--r--poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch52
-rw-r--r--poky/meta/recipes-devtools/python/python3/unixccompiler.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python3_3.5.5.bb323
-rw-r--r--poky/meta/recipes-devtools/python/python_2.7.14.bb282
-rw-r--r--poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb37
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb24
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c156
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu-targets.inc22
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu.inc119
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/0001-arm-translate-a64-treat-DISAS_UPDATE-as-variant-of-D.patch67
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile-v10.patch28
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/apic-fixup-fallthrough-to-PIC.patch43
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch242
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/check-PS2Queue-pointers-in-post_load-routine.patch63
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch76
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch69
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch84
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch35
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/memfd.patch57
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch19
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch137
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.binbin0 -> 4096 bytes
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch15
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch31
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/run-ptest10
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu/wacom.patch130
-rw-r--r--poky/meta/recipes-devtools/qemu/qemu_2.11.1.bb59
-rw-r--r--poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb50
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt-native.inc18
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb2
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt.inc77
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch29
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt/Makefile13
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch26
-rwxr-xr-xpoky/meta/recipes-devtools/quilt/quilt/run-ptest8
-rwxr-xr-xpoky/meta/recipes-devtools/quilt/quilt/test.sh1
-rw-r--r--poky/meta/recipes-devtools/quilt/quilt_0.65.bb8
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch40
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch33
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch61
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch38
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch40
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Factor-out-and-unify-setting-CLOEXEC.patch148
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch48
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch84
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch37
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-configure.ac-add-option-for-dbus.patch42
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch32
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch72
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0002-Optimize-rpmSetCloseOnExec.patch100
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch127
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0003-rpmSetCloseOnExec-use-getrlimit.patch53
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch207
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch339
-rw-r--r--poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch33
-rw-r--r--poky/meta/recipes-devtools/rpm/rpm_4.14.1.bb138
-rw-r--r--poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch69
-rw-r--r--poky/meta/recipes-devtools/rsync/files/rsyncd.conf15
-rw-r--r--poky/meta/recipes-devtools/rsync/rsync.inc20
-rw-r--r--poky/meta/recipes-devtools/rsync/rsync_3.1.3.bb32
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby.inc40
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch25
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/extmk.patch16
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch32
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch34
-rw-r--r--poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb49
-rwxr-xr-xpoky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts97
-rw-r--r--poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init3
-rw-r--r--poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service16
-rw-r--r--poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb44
-rw-r--r--poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch154
-rw-r--r--poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch63
-rw-r--r--poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch32
-rw-r--r--poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb41
-rw-r--r--poky/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch36
-rw-r--r--poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch49
-rw-r--r--poky/meta/recipes-devtools/strace/strace/0001-tests-sigaction-Check-for-mips-and-alpha-before-usin.patch37
-rw-r--r--poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch54
-rw-r--r--poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch20
-rw-r--r--poky/meta/recipes-devtools/strace/strace/mips-SIGEMT.patch24
-rw-r--r--poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch46
-rwxr-xr-xpoky/meta/recipes-devtools/strace/strace/run-ptest2
-rw-r--r--poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch126
-rw-r--r--poky/meta/recipes-devtools/strace/strace_4.20.bb59
-rw-r--r--poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch29
-rw-r--r--poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch68
-rw-r--r--poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch32
-rw-r--r--poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch22
-rw-r--r--poky/meta/recipes-devtools/subversion/subversion_1.9.7.bb55
-rw-r--r--poky/meta/recipes-devtools/swig/swig.inc62
-rw-r--r--poky/meta/recipes-devtools/swig/swig/0001-Add-Node-7.x-aka-V8-5.2-support.patch330
-rw-r--r--poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch69
-rw-r--r--poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch64
-rw-r--r--poky/meta/recipes-devtools/swig/swig_3.0.12.bb9
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch84
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch141
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch116
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch91
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch127
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch215
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch84
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch427
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch50
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch37
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch33
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch45
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch35
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch31
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch17
-rw-r--r--poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb90
-rw-r--r--poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch36
-rw-r--r--poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch423
-rw-r--r--poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch33
-rw-r--r--poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb37
-rw-r--r--poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch46
-rw-r--r--poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch16
-rw-r--r--poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch28
-rwxr-xr-xpoky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init65
-rw-r--r--poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service12
-rw-r--r--poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb58
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch76
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch39
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch64
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch53
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/run-ptest8
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch46
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch47
-rw-r--r--poky/meta/recipes-devtools/tcltk/tcl_8.6.8.bb101
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch37
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch158
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch25
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch61
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch74
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch64
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch56
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch37
-rw-r--r--poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb46
-rw-r--r--poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb19
-rw-r--r--poky/meta/recipes-devtools/vala/vala.inc57
-rw-r--r--poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch32
-rw-r--r--poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch55
-rw-r--r--poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch38
-rw-r--r--poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch223
-rw-r--r--poky/meta/recipes-devtools/vala/vala_0.38.8.bb10
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch51
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch108
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch32
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch30
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch31
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch39
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch49
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch32
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch45
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch68
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch183
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch37
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch252
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch30
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch32
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch96
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch33
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch78
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/link-gz-tests.patch27
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/mask-CPUID-support-in-HWCAP-on-aarch64.patch36
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/ppc-headers.patch87
-rwxr-xr-xpoky/meta/recipes-devtools/valgrind/valgrind/run-ptest25
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch44
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch45
-rw-r--r--poky/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb156
-rw-r--r--poky/meta/recipes-devtools/xmlto/files/catalog.xml19
-rw-r--r--poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch30
-rw-r--r--poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb41
-rw-r--r--poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb16
-rw-r--r--poky/meta/recipes-extended/acpica/acpica_20170303.bb53
-rw-r--r--poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch31
-rw-r--r--poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch72
-rw-r--r--poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch64
-rw-r--r--poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb24
-rw-r--r--poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch59
-rw-r--r--poky/meta/recipes-extended/at/at/atd.init45
-rw-r--r--poky/meta/recipes-extended/at/at/atd.service9
-rw-r--r--poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch25
-rw-r--r--poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch30
-rw-r--r--poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch35
-rw-r--r--poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch32
-rw-r--r--poky/meta/recipes-extended/at/at/pam.conf.patch27
-rw-r--r--poky/meta/recipes-extended/at/at/posixtm.c328
-rw-r--r--poky/meta/recipes-extended/at/at/posixtm.h37
-rw-r--r--poky/meta/recipes-extended/at/at_3.1.20.bb72
-rw-r--r--poky/meta/recipes-extended/bash/bash.inc92
-rw-r--r--poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch35
-rw-r--r--poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch35
-rw-r--r--poky/meta/recipes-extended/bash/bash/build-tests.patch55
-rw-r--r--poky/meta/recipes-extended/bash/bash/execute_cmd.patch19
-rw-r--r--poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch33
-rw-r--r--poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch45
-rw-r--r--poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch26
-rw-r--r--poky/meta/recipes-extended/bash/bash/pathexp-dep.patch13
-rw-r--r--poky/meta/recipes-extended/bash/bash/run-ptest22
-rw-r--r--poky/meta/recipes-extended/bash/bash/test-output.patch42
-rw-r--r--poky/meta/recipes-extended/bash/bash_4.4.12.bb24
-rw-r--r--poky/meta/recipes-extended/bc/bc_1.06.bb26
-rw-r--r--poky/meta/recipes-extended/bc/files/fix-segment-fault.patch28
-rw-r--r--poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch40
-rw-r--r--poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch31
-rw-r--r--poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch78
-rw-r--r--poky/meta/recipes-extended/blktool/blktool_4-7.bb28
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch18
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am73
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac11
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch55
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest2
-rw-r--r--poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb44
-rw-r--r--poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb44
-rw-r--r--poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch33
-rw-r--r--poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb71
-rw-r--r--poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch178
-rw-r--r--poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-extended/cpio/cpio_2.12.bb12
-rw-r--r--poky/meta/recipes-extended/cpio/cpio_v2.inc43
-rw-r--r--poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch105
-rw-r--r--poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch339
-rw-r--r--poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch53
-rw-r--r--poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb29
-rwxr-xr-xpoky/meta/recipes-extended/cronie/cronie/crond.init58
-rw-r--r--poky/meta/recipes-extended/cronie/cronie/crond.service11
-rw-r--r--poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch22
-rw-r--r--poky/meta/recipes-extended/cronie/cronie/crontab14
-rw-r--r--poky/meta/recipes-extended/cronie/cronie_1.5.1.bb83
-rw-r--r--poky/meta/recipes-extended/cups/cups.inc110
-rw-r--r--poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch69
-rw-r--r--poky/meta/recipes-extended/cups/cups/cups_serverbin.patch32
-rw-r--r--poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch15
-rw-r--r--poky/meta/recipes-extended/cups/cups_2.2.6.bb6
-rw-r--r--poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb22
-rw-r--r--poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch30
-rw-r--r--poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest3
-rw-r--r--poky/meta/recipes-extended/diffutils/diffutils.inc13
-rw-r--r--poky/meta/recipes-extended/diffutils/diffutils_3.6.bb39
-rw-r--r--poky/meta/recipes-extended/ed/ed_1.14.2.bb35
-rw-r--r--poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch20
-rw-r--r--poky/meta/recipes-extended/ethtool/ethtool/run-ptest2
-rw-r--r--poky/meta/recipes-extended/ethtool/ethtool_4.13.bb30
-rw-r--r--poky/meta/recipes-extended/findutils/findutils.inc16
-rw-r--r--poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-extended/findutils/findutils_4.6.0.bb17
-rw-r--r--poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch23
-rw-r--r--poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch23
-rw-r--r--poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb44
-rw-r--r--poky/meta/recipes-extended/gawk/gawk/run-ptest10
-rw-r--r--poky/meta/recipes-extended/gawk/gawk_4.2.0.bb48
-rw-r--r--poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch38
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch61
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch44
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch39
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch37
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch36
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch34
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch35
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch33
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch35
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch37
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch125
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch19
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch36
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch31
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch29
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch30
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch37
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch96
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h41
l---------poky/meta/recipes-extended/ghostscript/ghostscript/i6861
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch36
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h40
-rw-r--r--poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb136
-rw-r--r--poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb20
-rw-r--r--poky/meta/recipes-extended/gperf/gperf_3.1.bb18
-rw-r--r--poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-extended/grep/grep_3.1.bb47
-rw-r--r--poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch102
-rw-r--r--poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch34
-rw-r--r--poky/meta/recipes-extended/groff/groff_1.22.3.bb84
-rw-r--r--poky/meta/recipes-extended/gzip/files/run-ptest6
-rw-r--r--poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch36
-rw-r--r--poky/meta/recipes-extended/gzip/gzip.inc33
-rw-r--r--poky/meta/recipes-extended/gzip/gzip_1.9.bb38
-rw-r--r--poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch38
-rw-r--r--poky/meta/recipes-extended/hdparm/hdparm_9.53.bb43
-rw-r--r--poky/meta/recipes-extended/images/core-image-full-cmdline.bb12
-rw-r--r--poky/meta/recipes-extended/images/core-image-kernel-dev.bb20
-rw-r--r--poky/meta/recipes-extended/images/core-image-lsb-dev.bb7
-rw-r--r--poky/meta/recipes-extended/images/core-image-lsb-sdk.bb12
-rw-r--r--poky/meta/recipes-extended/images/core-image-lsb.bb14
-rw-r--r--poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb23
-rw-r--r--poky/meta/recipes-extended/images/core-image-testmaster.bb18
-rw-r--r--poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch47
-rw-r--r--poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch51
-rw-r--r--poky/meta/recipes-extended/iptables/iptables_1.6.2.bb47
-rw-r--r--poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch95
-rw-r--r--poky/meta/recipes-extended/iputils/iputils_s20161105.bb62
-rw-r--r--poky/meta/recipes-extended/less/less_529.bb42
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/00_arches.patch607
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/destdir.patch17
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch65
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch62
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch61
-rw-r--r--poky/meta/recipes-extended/libaio/libaio/system-linkage.patch37
-rw-r--r--poky/meta/recipes-extended/libaio/libaio_0.3.110.bb26
-rw-r--r--poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch37
-rw-r--r--poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch37
-rw-r--r--poky/meta/recipes-extended/libarchive/libarchive/bug929.patch38
-rw-r--r--poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch153
-rw-r--r--poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb71
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch694
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch181
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch25
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch23
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch334
-rw-r--r--poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch26
-rw-r--r--poky/meta/recipes-extended/libidn/libidn_1.33.bb44
-rw-r--r--poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb15
-rw-r--r--poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch68
-rw-r--r--poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch27
-rw-r--r--poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch57
-rw-r--r--poky/meta/recipes-extended/libnsl/libnsl2_git.bb37
-rw-r--r--poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb14
-rw-r--r--poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch251
-rw-r--r--poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch105
-rw-r--r--poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb30
-rw-r--r--poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch29
-rw-r--r--poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch64
-rw-r--r--poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch878
-rw-r--r--poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch31
-rw-r--r--poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb33
-rw-r--r--poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch62
-rw-r--r--poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch34
-rw-r--r--poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch27
-rw-r--r--poky/meta/recipes-extended/libuser/libuser_0.62.bb35
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch42
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd1
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd34
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf331
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service12
-rw-r--r--poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb85
-rw-r--r--poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch151
-rw-r--r--poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch32
-rw-r--r--poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch38
-rw-r--r--poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb85
-rw-r--r--poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch38
-rwxr-xr-xpoky/meta/recipes-extended/lsb/lsb/init-functions44
-rwxr-xr-xpoky/meta/recipes-extended/lsb/lsb/lsb_killproc6
-rwxr-xr-xpoky/meta/recipes-extended/lsb/lsb/lsb_log_message27
-rwxr-xr-xpoky/meta/recipes-extended/lsb/lsb/lsb_pidofproc6
-rwxr-xr-xpoky/meta/recipes-extended/lsb/lsb/lsb_start_daemon45
-rw-r--r--poky/meta/recipes-extended/lsb/lsb_5.0.bb134
-rw-r--r--poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch21
-rw-r--r--poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch33
-rw-r--r--poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb32
-rw-r--r--poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh525
-rw-r--r--poky/meta/recipes-extended/lsb/lsbtest/packages_list49
-rw-r--r--poky/meta/recipes-extended/lsb/lsbtest/session176
-rw-r--r--poky/meta/recipes-extended/lsb/lsbtest_1.0.bb49
-rw-r--r--poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch76
-rw-r--r--poky/meta/recipes-extended/lsof/lsof_4.89.bb64
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch31
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch50
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch46
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch146
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch46
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch31
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch283
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch36
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch75
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch33
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch50
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch70
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch50
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch70
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch31
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch48
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch55
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch32
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch41
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch252
-rw-r--r--poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch40
-rw-r--r--poky/meta/recipes-extended/ltp/ltp_20180118.bb116
-rw-r--r--poky/meta/recipes-extended/lzip/lzip_1.19.bb41
-rw-r--r--poky/meta/recipes-extended/man-db/man-db_2.8.1.bb43
-rw-r--r--poky/meta/recipes-extended/man-pages/man-pages_4.14.bb31
-rw-r--r--poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch129
-rw-r--r--poky/meta/recipes-extended/mc/mc_4.8.20.bb49
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch44
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch31
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch48
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch37
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch43
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch75
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch59
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch33
-rw-r--r--poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch128
-rw-r--r--poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch22
-rw-r--r--poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch25
-rw-r--r--poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch45
-rw-r--r--poky/meta/recipes-extended/mdadm/files/run-ptest10
-rw-r--r--poky/meta/recipes-extended/mdadm/mdadm_4.0.bb78
-rw-r--r--poky/meta/recipes-extended/mingetty/mingetty_1.08.bb28
-rw-r--r--poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch47
-rw-r--r--poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch35
-rw-r--r--poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch21
-rw-r--r--poky/meta/recipes-extended/minicom/minicom_2.7.1.bb30
-rw-r--r--poky/meta/recipes-extended/mktemp/files/disable-strip.patch15
-rw-r--r--poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch24
-rw-r--r--poky/meta/recipes-extended/mktemp/mktemp_1.7.bb36
-rw-r--r--poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb30
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch87
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch32
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch100
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch635
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch28
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch363
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h75
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make36
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch52
-rw-r--r--poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb122
-rw-r--r--poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch31
-rw-r--r--poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch26
-rw-r--r--poky/meta/recipes-extended/newt/files/cross_ar.patch56
-rw-r--r--poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch37
-rw-r--r--poky/meta/recipes-extended/newt/files/pie-flags.patch36
-rw-r--r--poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb28
-rw-r--r--poky/meta/recipes-extended/newt/libnewt_0.52.20.bb54
-rw-r--r--poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb151
-rw-r--r--poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb242
-rw-r--r--poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch68
-rw-r--r--poky/meta/recipes-extended/pam/libpam/99_pam1
-rw-r--r--poky/meta/recipes-extended/pam/libpam/crypt_configure.patch40
-rw-r--r--poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch24
-rw-r--r--poky/meta/recipes-extended/pam/libpam/include_paths_header.patch59
-rw-r--r--poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch226
-rw-r--r--poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch37
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch203
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch195
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/common-account25
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/common-auth18
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/common-password26
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/common-session19
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive19
-rw-r--r--poky/meta/recipes-extended/pam/libpam/pam.d/other24
-rw-r--r--poky/meta/recipes-extended/pam/libpam_1.3.0.bb164
-rw-r--r--poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch29
-rw-r--r--poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch44
-rw-r--r--poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch224
-rw-r--r--poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch34
-rw-r--r--poky/meta/recipes-extended/parted/files/Makefile285
-rw-r--r--poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch57
-rw-r--r--poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch20
-rw-r--r--poky/meta/recipes-extended/parted/files/no_check.patch20
-rw-r--r--poky/meta/recipes-extended/parted/files/run-ptest3
-rw-r--r--poky/meta/recipes-extended/parted/files/syscalls.patch55
-rw-r--r--poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch32
-rw-r--r--poky/meta/recipes-extended/parted/parted_3.2.bb50
-rw-r--r--poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb28
-rw-r--r--poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb17
-rw-r--r--poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb20
-rw-r--r--poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb27
-rw-r--r--poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb24
-rw-r--r--poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb33
-rw-r--r--poky/meta/recipes-extended/pigz/pigz_2.4.bb30
-rw-r--r--poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch51
-rw-r--r--poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch47
-rw-r--r--poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch68
-rw-r--r--poky/meta/recipes-extended/pixz/pixz_1.0.6.bb25
-rw-r--r--poky/meta/recipes-extended/procps/procps/sysctl.conf64
-rw-r--r--poky/meta/recipes-extended/procps/procps_3.3.12.bb65
-rw-r--r--poky/meta/recipes-extended/psmisc/psmisc.inc57
-rw-r--r--poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch30
-rw-r--r--poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch51
-rw-r--r--poky/meta/recipes-extended/psmisc/psmisc_23.0.bb10
-rw-r--r--poky/meta/recipes-extended/quota/quota/fcntl.patch85
-rw-r--r--poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch198
-rw-r--r--poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch32
-rw-r--r--poky/meta/recipes-extended/quota/quota_4.04.bb38
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch221
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/init.d87
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch30
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf3
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service12
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket8
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch100
-rw-r--r--poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb65
-rw-r--r--poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch109
-rw-r--r--poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch58
-rw-r--r--poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch30
-rw-r--r--poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch57
-rw-r--r--poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch137
-rw-r--r--poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch65
-rw-r--r--poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch135
-rw-r--r--poky/meta/recipes-extended/screen/screen/screen.pam2
-rw-r--r--poky/meta/recipes-extended/screen/screen_4.6.2.bb52
-rw-r--r--poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest3
-rw-r--r--poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch66
-rw-r--r--poky/meta/recipes-extended/sed/sed_4.2.2.bb53
-rw-r--r--poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch124
-rw-r--r--poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch46
-rw-r--r--poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-1242446
-rw-r--r--poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch47
-rw-r--r--poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch115
-rw-r--r--poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch201
-rw-r--r--poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch41
-rw-r--r--poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch46
-rw-r--r--poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch28
-rw-r--r--poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot386
-rw-r--r--poky/meta/recipes-extended/shadow/files/login_defs_pam.sed32
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/chfn14
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/chpasswd4
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/chsh19
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/login81
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/newusers4
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/passwd5
-rw-r--r--poky/meta/recipes-extended/shadow/files/pam.d/su57
-rw-r--r--poky/meta/recipes-extended/shadow/files/securetty238
-rw-r--r--poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch27
-rw-r--r--poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch100
-rw-r--r--poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch91
-rw-r--r--poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch33
-rw-r--r--poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb38
-rw-r--r--poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb32
-rw-r--r--poky/meta/recipes-extended/shadow/shadow.inc201
-rw-r--r--poky/meta/recipes-extended/shadow/shadow_4.2.1.bb10
-rw-r--r--poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch16
-rw-r--r--poky/meta/recipes-extended/slang/slang/no-x.patch18
-rw-r--r--poky/meta/recipes-extended/slang/slang/run-ptest3
-rw-r--r--poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch148
-rw-r--r--poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch30
-rw-r--r--poky/meta/recipes-extended/slang/slang_2.3.2.bb81
-rw-r--r--poky/meta/recipes-extended/stress/files/texinfo.patch80
-rw-r--r--poky/meta/recipes-extended/stress/stress_1.0.4.bb15
-rw-r--r--poky/meta/recipes-extended/sudo/files/sudo.pam6
-rw-r--r--poky/meta/recipes-extended/sudo/sudo.inc46
-rw-r--r--poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch34
-rw-r--r--poky/meta/recipes-extended/sudo/sudo_1.8.22.bb36
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch132
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch28
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch35
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/klogd.service13
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch17
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch20
-rwxr-xr-xpoky/meta/recipes-extended/sysklogd/files/sysklogd151
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/syslog.conf71
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/syslogd.service14
-rw-r--r--poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf1
-rw-r--r--poky/meta/recipes-extended/sysklogd/sysklogd.inc72
-rw-r--r--poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb4
-rw-r--r--poky/meta/recipes-extended/sysstat/sysstat.inc65
-rw-r--r--poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch59
-rw-r--r--poky/meta/recipes-extended/sysstat/sysstat/99_sysstat1
-rw-r--r--poky/meta/recipes-extended/sysstat/sysstat/sysstat.service12
-rw-r--r--poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb8
-rw-r--r--poky/meta/recipes-extended/tar/tar.inc52
-rw-r--r--poky/meta/recipes-extended/tar/tar/musl_dirent.patch19
-rw-r--r--poky/meta/recipes-extended/tar/tar/remove-gets.patch29
-rw-r--r--poky/meta/recipes-extended/tar/tar_1.30.bb18
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch65
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff77
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch250
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch105
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch32
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch1255
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch153
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch47
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch85
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch255
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch68
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch14
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch73
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch21
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch45
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch54
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch23
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch31
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch35
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch39
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff41
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.834
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch31
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch36
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch32
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch59
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch41
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.828
-rw-r--r--poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb133
-rw-r--r--poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch39
-rw-r--r--poky/meta/recipes-extended/texi2html/texi2html_5.0.bb31
-rw-r--r--poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb30
-rw-r--r--poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING19
-rw-r--r--poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py122
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch43
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch65
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch16
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch256
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch17
-rw-r--r--poky/meta/recipes-extended/texinfo/texinfo_6.5.bb90
-rw-r--r--poky/meta/recipes-extended/time/time_1.8.bb21
-rw-r--r--poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb30
-rw-r--r--poky/meta/recipes-extended/tzdata/tzdata_2018d.bb215
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch403
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch53
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch36
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch145
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch33
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch32
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch39
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch32
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch50
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch46
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch18
-rw-r--r--poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch97
-rw-r--r--poky/meta/recipes-extended/unzip/unzip_6.0.bb61
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog-config.bb20
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf42
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default2
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch32
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch68
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch16
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch56
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init121
-rw-r--r--poky/meta/recipes-extended/watchdog/watchdog_5.15.bb69
-rw-r--r--poky/meta/recipes-extended/wget/wget.inc31
-rw-r--r--poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch61
-rw-r--r--poky/meta/recipes-extended/wget/wget_1.19.5.bb9
-rw-r--r--poky/meta/recipes-extended/which/which-2.21/automake.patch19
-rw-r--r--poky/meta/recipes-extended/which/which_2.21.bb35
-rw-r--r--poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch30
-rw-r--r--poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch29
-rw-r--r--poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb37
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch100
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch86
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch79
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch34
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch112
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf11
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd.default12
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd.init64
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd/xinetd.service13
-rw-r--r--poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb78
-rw-r--r--poky/meta/recipes-extended/xz/xz_5.2.3.bb36
-rw-r--r--poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch42
-rw-r--r--poky/meta/recipes-extended/zip/zip_3.0.bb43
-rw-r--r--poky/meta/recipes-gnome/epiphany/epiphany_3.26.6.bb22
-rw-r--r--poky/meta/recipes-gnome/epiphany/files/0002-help-meson.build-disable-the-use-of-yelp.patch34
-rw-r--r--poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch51
-rw-r--r--poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb26
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Fix-without-libtiff-not-having-an-effect.patch27
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch47
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch42
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch92
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch33
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest3
-rw-r--r--poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.11.bb102
-rw-r--r--poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-Disable-libseccomp-sycall-filtering-mechanism.patch38
-rw-r--r--poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-configure.ac-Remove-gnome-common-macro-calls.patch33
-rw-r--r--poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-assume-time_t-is-long.patch61
-rw-r--r--poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.26.2.bb29
-rw-r--r--poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Don-t-use-AC_CANONICAL_HOST.patch27
-rw-r--r--poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Run-installation-commands-as-shell-jobs.patch82
-rw-r--r--poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.26.1.bb44
-rw-r--r--poky/meta/recipes-gnome/gnome/gconf/create_config_directory.patch28
-rw-r--r--poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch19
-rw-r--r--poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch95
-rw-r--r--poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb55
-rw-r--r--poky/meta/recipes-gnome/gnome/gnome-doc-utils/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch40
-rw-r--r--poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.3.bb46
-rw-r--r--poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch84
-rw-r--r--poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb22
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch50
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-lib-dirs-envvar-option.patch73
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch200
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch51
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch47
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch96
-rw-r--r--poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.54.1.bb190
-rw-r--r--poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.24.1.bb13
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+.inc103
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch22
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch36
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch24
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff102
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch20
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+3.inc130
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch47
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch60
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch847
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb18
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb34
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb63
-rw-r--r--poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch102
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-error-out-if-xsltproc-is-not-found.patch31
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch142
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/files/conditionaltests.patch46
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/files/no-clobber.patch27
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/files/pkg-config-native.patch42
-rw-r--r--poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.27.bb50
-rw-r--r--poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.17.bb14
-rw-r--r--poky/meta/recipes-gnome/json-glib/json-glib_1.4.2.bb40
-rw-r--r--poky/meta/recipes-gnome/libgudev/libgudev_232.bb18
-rw-r--r--poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb21
-rw-r--r--poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch60
-rw-r--r--poky/meta/recipes-gnome/librsvg/librsvg_2.40.20.bb47
-rw-r--r--poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb20
-rw-r--r--poky/meta/recipes-graphics/builder/builder_0.1.bb31
-rw-r--r--poky/meta/recipes-graphics/builder/files/builder_session.sh33
-rw-r--r--poky/meta/recipes-graphics/cairo/cairo-fpu.inc6
-rw-r--r--poky/meta/recipes-graphics/cairo/cairo.inc48
-rw-r--r--poky/meta/recipes-graphics/cairo/cairo/0001-cairo-Fix-CVE-2017-9814.patch45
-rw-r--r--poky/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff22
-rw-r--r--poky/meta/recipes-graphics/cairo/cairo_1.14.12.bb46
-rw-r--r--poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb25
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0.inc46
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0/0001-Remove-clutter.types-as-it-is-build-configuration-sp.patch143
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch19
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch32
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest3
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-1.0_1.26.2.bb10
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc17
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch33
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.24.bb7
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc15
-rw-r--r--poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.4.bb6
-rw-r--r--poky/meta/recipes-graphics/cogl/cogl-1.0.inc77
-rw-r--r--poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch32
-rw-r--r--poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch35
-rw-r--r--poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb8
-rw-r--r--poky/meta/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch53
-rw-r--r--poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch24
-rw-r--r--poky/meta/recipes-graphics/drm/libdrm/installtests.patch25
-rw-r--r--poky/meta/recipes-graphics/drm/libdrm_2.4.91.bb51
-rw-r--r--poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb7
-rw-r--r--poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb13
-rw-r--r--poky/meta/recipes-graphics/eglinfo/eglinfo.inc33
-rw-r--r--poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch34
-rw-r--r--poky/meta/recipes-graphics/fontconfig/fontconfig/0001-src-fcxml.c-avoid-double-free-of-filename.patch28
-rw-r--r--poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch20
-rw-r--r--poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb58
-rw-r--r--poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch14
-rw-r--r--poky/meta/recipes-graphics/freetype/freetype_2.9.bb49
-rw-r--r--poky/meta/recipes-graphics/fstests/fstests_git.bb19
-rw-r--r--poky/meta/recipes-graphics/glew/glew/no-strip.patch12
-rw-r--r--poky/meta/recipes-graphics/glew/glew_2.1.0.bb44
-rw-r--r--poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.7.5.bb39
-rw-r--r--poky/meta/recipes-graphics/images/core-image-clutter.bb13
-rw-r--r--poky/meta/recipes-graphics/images/core-image-weston.bb12
-rw-r--r--poky/meta/recipes-graphics/images/core-image-x11.bb9
-rw-r--r--poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.3.bb59
-rw-r--r--poky/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch116
-rw-r--r--poky/meta/recipes-graphics/kmscube/kmscube_git.bb18
-rw-r--r--poky/meta/recipes-graphics/libepoxy/libepoxy/no-tests.patch33
-rw-r--r--poky/meta/recipes-graphics/libepoxy/libepoxy_1.5.0.bb23
-rw-r--r--poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb23
-rw-r--r--poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.12.bb28
-rw-r--r--poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/0001-build-Pass-tag-CC-explictly-when-using-libtool.patch73
-rw-r--r--poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch19
-rw-r--r--poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch187
-rw-r--r--poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb72
-rw-r--r--poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb65
-rw-r--r--poky/meta/recipes-graphics/libva/libva-utils_2.1.0.bb32
-rw-r--r--poky/meta/recipes-graphics/libva/libva_2.1.0.bb46
-rw-r--r--poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session24
-rw-r--r--poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb25
-rw-r--r--poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig42
-rw-r--r--poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb39
-rw-r--r--poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb18
-rw-r--r--poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch42
-rw-r--r--poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch34
-rw-r--r--poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch43
-rw-r--r--poky/meta/recipes-graphics/mesa/files/0001-winsys-svga-drm-Include-sys-types.h.patch34
-rw-r--r--poky/meta/recipes-graphics/mesa/files/0002-hardware-gloat.patch51
-rw-r--r--poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch32
-rw-r--r--poky/meta/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch29
-rw-r--r--poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch41
-rw-r--r--poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb30
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch624
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch377
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch234
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch45
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch101
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch73
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch44
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch62
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb59
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb9
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa.inc222
-rw-r--r--poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb23
-rw-r--r--poky/meta/recipes-graphics/mini-x-session/files/mini-x-session39
-rw-r--r--poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb27
-rw-r--r--poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch20
-rw-r--r--poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb16
-rw-r--r--poky/meta/recipes-graphics/mx/mx.inc21
-rw-r--r--poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb22
-rw-r--r--poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb17
-rw-r--r--poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb20
-rw-r--r--poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb36
-rw-r--r--poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch120
-rw-r--r--poky/meta/recipes-graphics/pango/pango/0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch147
-rw-r--r--poky/meta/recipes-graphics/pango/pango/run-ptest3
-rw-r--r--poky/meta/recipes-graphics/pango/pango_1.40.14.bb50
-rw-r--r--poky/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch35
-rw-r--r--poky/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch54
-rw-r--r--poky/meta/recipes-graphics/piglit/piglit_git.bb52
-rw-r--r--poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c410
-rw-r--r--poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb22
-rw-r--r--poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch15
-rw-r--r--poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb29
-rw-r--r--poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf17
-rw-r--r--poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_2.00.1.bb39
-rw-r--r--poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb32
-rw-r--r--poky/meta/recipes-graphics/vulkan/assimp_4.1.0.bb20
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Don-t-build-demos-with-questionably-licensed-data.patch91
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Fix-build-on-x86.patch41
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Support-installing-demos-support-out-of-tree-builds.patch85
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan-demos_git.bb41
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch108
-rw-r--r--poky/meta/recipes-graphics/vulkan/vulkan_1.0.65.2.bb36
-rw-r--r--poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch54
-rw-r--r--poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb37
-rw-r--r--poky/meta/recipes-graphics/wayland/libinput_1.9.4.bb29
-rw-r--r--poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb18
-rw-r--r--poky/meta/recipes-graphics/wayland/wayland-protocols_1.13.bb20
-rw-r--r--poky/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch32
-rw-r--r--poky/meta/recipes-graphics/wayland/wayland_1.14.0.bb42
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init.bb31
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/init53
-rwxr-xr-xpoky/meta/recipes-graphics/wayland/weston-init/weston-start69
-rw-r--r--poky/meta/recipes-graphics/wayland/weston-init/weston.service12
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch76
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch174
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/fix-missing-header.patch30
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch55
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/weston.desktop9
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/weston.pngbin0 -> 2383 bytes
-rw-r--r--poky/meta/recipes-graphics/wayland/weston/xwayland.weston-start7
-rw-r--r--poky/meta/recipes-graphics/wayland/weston_3.0.0.bb114
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession38
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh13
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh7
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh7
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver25
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch355
-rwxr-xr-xpoky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm67
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in7
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in11
-rw-r--r--poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb69
-rw-r--r--poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb20
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput1
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/qemuall/pointercal.xinput2
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb20
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh7
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch66
-rw-r--r--poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb37
-rw-r--r--poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb16
-rw-r--r--poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb23
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb15
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch22
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch82
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb12
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xkbcomp_1.4.0.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb17
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc17
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xrandr_1.5.0.bb15
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch26
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb15
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb13
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.26.0.bb11
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb16
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb26
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb13
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb9
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-Add-Coffeelake-PCI-IDs-for-S-Skus.patch116
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch24
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch17
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb45
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb41
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch37
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch41
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch32
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch31
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch33
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch325
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch272
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch48
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb37
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch103
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc42
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc12
-rw-r--r--poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc8
-rw-r--r--poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch33
-rw-r--r--poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch32
-rw-r--r--poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb24
-rw-r--r--poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc43
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb32
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gzbin0 -> 4637 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gzbin0 -> 4551 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gzbin0 -> 4409 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gzbin0 -> 4689 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gzbin0 -> 4502 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gzbin0 -> 4614 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gzbin0 -> 4547 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gzbin0 -> 4519 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gzbin0 -> 4418 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gzbin0 -> 4572 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gzbin0 -> 4541 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gzbin0 -> 4550 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gzbin0 -> 4035 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gzbin0 -> 4645 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gzbin0 -> 5057 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gzbin0 -> 76746 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gzbin0 -> 4643 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gzbin0 -> 4569 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gzbin0 -> 4700 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gzbin0 -> 4494 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gzbin0 -> 4638 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gzbin0 -> 4539 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gzbin0 -> 4498 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gzbin0 -> 4362 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gzbin0 -> 4584 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gzbin0 -> 4500 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gzbin0 -> 4529 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gzbin0 -> 4008 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gzbin0 -> 4653 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gzbin0 -> 23787 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gzbin0 -> 4219 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gzbin0 -> 4152 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gzbin0 -> 4275 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gzbin0 -> 4083 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gzbin0 -> 4209 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gzbin0 -> 4111 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gzbin0 -> 4115 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gzbin0 -> 3959 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gzbin0 -> 4154 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gzbin0 -> 4075 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gzbin0 -> 4124 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gzbin0 -> 4206 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gzbin0 -> 15495 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gzbin0 -> 5225 bytes
-rw-r--r--poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir410
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb17
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb28
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch28
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.14.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb31
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.5.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11.inc37
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch60
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff520
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff17
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb24
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch29
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb23
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcb/Fix-inconsistent-use-of-tabs-vs.-space.patch62
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch25
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch28
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb39
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch18
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb28
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.15.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb28
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb29
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb26
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb23
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.3.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb25
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb33
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.8.0.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb35
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb27
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb23
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb24
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxres_1.2.0.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb23
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxshmfence/extensions.patch17
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxt/0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch33
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb35
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch144
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/pixman/0001-test-utils-Check-for-FE_INVALID-definition-before-us.patch33
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch29
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/pixman_0.34.0.bb41
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch24
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb13
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb9
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb10
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb11
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util.inc23
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb8
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.22.bb32
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc27
-rw-r--r--poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb24
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb16
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch42
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb20
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb15
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.2.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.3.bb14
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch215
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch75
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb53
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb17
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb24
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb17
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb17
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb18
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc26
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch24
-rw-r--r--poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb21
-rw-r--r--poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb19
-rw-r--r--poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc13
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf38
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf39
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf38
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf38
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf38
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf33
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf33
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf0
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb22
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc180
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch61
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch53
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch47
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch46
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch25
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch18
-rw-r--r--poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb32
-rw-r--r--poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb24
-rw-r--r--poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb18
-rw-r--r--poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch114
-rw-r--r--poky/meta/recipes-kernel/blktrace/blktrace_git.bb41
-rw-r--r--poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb13
-rw-r--r--poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb18
-rw-r--r--poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb21
-rw-r--r--poky/meta/recipes-kernel/cryptodev/cryptodev.inc11
-rw-r--r--poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch66
-rw-r--r--poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch24
-rw-r--r--poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch49
-rw-r--r--poky/meta/recipes-kernel/dtc/dtc.inc25
-rw-r--r--poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch43
-rw-r--r--poky/meta/recipes-kernel/dtc/dtc/make_install.patch17
-rw-r--r--poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb10
-rw-r--r--poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb24
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch31
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch32
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch35
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch52
-rwxr-xr-xpoky/meta/recipes-kernel/kexec/kexec-tools/kdump145
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf14
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service12
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch88
-rw-r--r--poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb86
-rw-r--r--poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb46
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod-native_git.bb18
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod.inc42
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch39
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch26
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf6
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch35
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod/ptest.patch25
-rwxr-xr-xpoky/meta/recipes-kernel/kmod/kmod/run-ptest5
-rw-r--r--poky/meta/recipes-kernel/kmod/kmod_git.bb62
-rw-r--r--poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb807
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc91
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch31
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch90
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch46
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch30
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch29
-rw-r--r--poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb13
-rw-r--r--poky/meta/recipes-kernel/linux/kernel-devsrc.bb86
-rw-r--r--poky/meta/recipes-kernel/linux/linux-dtb.inc3
-rw-r--r--poky/meta/recipes-kernel/linux/linux-dummy.bb60
-rw-r--r--poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL339
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-dev.bb50
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb38
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb41
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb41
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb25
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb28
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb25
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto.inc69
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb46
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb47
-rw-r--r--poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb47
-rw-r--r--poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb19
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch43
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch49
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb35
-rwxr-xr-xpoky/meta/recipes-kernel/lttng/lttng-tools/run-ptest6
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch16
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb123
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch17
-rw-r--r--poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb37
-rw-r--r--poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb27
-rw-r--r--poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch8
-rwxr-xr-xpoky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh52
-rw-r--r--poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb33
-rw-r--r--poky/meta/recipes-kernel/perf/perf.bb261
-rw-r--r--poky/meta/recipes-kernel/powertop/powertop_2.9.bb33
-rw-r--r--poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch26
-rw-r--r--poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch22
-rw-r--r--poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb34
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb6
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb40
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch42
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch61
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch25
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch277
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch215
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch36
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch128
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch29
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch39
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch38
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch42
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch62
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch40
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch53
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch117
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch39
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch40
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch33
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch34
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap_git.bb36
-rw-r--r--poky/meta/recipes-kernel/systemtap/systemtap_git.inc38
-rw-r--r--poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb33
-rw-r--r--poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc13
-rw-r--r--poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch27
-rw-r--r--poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch29
-rw-r--r--poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb34
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-fpu.inc4
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.5.bb40
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.5.bb103
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch32
-rwxr-xr-xpoky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest13
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch29
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.5.bb40
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.5.bb25
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch56
-rw-r--r--poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb108
-rw-r--r--poky/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch32
-rw-r--r--poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.4.2.bb151
-rw-r--r--poky/meta/recipes-multimedia/flac/flac_1.3.2.bb44
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch35
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch42
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch47
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gst-examples/0001-Make-player-examples-installable.patch39
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gst-examples/gst-player.desktop10
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gst-examples_git.bb32
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc56
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gst-validate_1.12.4.bb23
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc51
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch33
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch35
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch33
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch32
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch26
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.4.bb21
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb68
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc49
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.4.bb11
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc147
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch74
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch29
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch37
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch64
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-glimagesink-Downrank-to-marginal.patch32
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch30
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch61
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch85
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch28
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch35
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.4.bb24
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc50
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch168
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch295
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch28
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch225
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch27
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch69
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch44
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch47
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.4.bb18
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc52
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch62
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch44
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch40
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.4.bb20
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc31
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.4.bb13
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc41
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc33
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.4.bb7
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc31
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch27
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.4.bb6
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc46
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.4.bb5
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc61
-rw-r--r--poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.4.bb14
-rw-r--r--poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch20
-rw-r--r--poky/meta/recipes-multimedia/lame/lame_3.100.bb27
-rw-r--r--poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch89
-rw-r--r--poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb26
-rw-r--r--poky/meta/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch40
-rw-r--r--poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch43
-rw-r--r--poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch15
-rw-r--r--poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb25
-rw-r--r--poky/meta/recipes-multimedia/libogg/libogg_1.3.3.bb17
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch58
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch36
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch20
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch19
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch18
-rw-r--r--poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb37
-rw-r--r--poky/meta/recipes-multimedia/libpng/libpng_1.6.34.bb30
-rw-r--r--poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch62
-rw-r--r--poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb28
-rw-r--r--poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch34
-rw-r--r--poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch73
-rw-r--r--poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch59
-rw-r--r--poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch37
-rw-r--r--poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb33
-rw-r--r--poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch15
-rw-r--r--poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb22
-rw-r--r--poky/meta/recipes-multimedia/libtiff/files/CVE-2017-18013.patch42
-rw-r--r--poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9935.patch160
-rw-r--r--poky/meta/recipes-multimedia/libtiff/files/CVE-2018-5784.patch135
-rw-r--r--poky/meta/recipes-multimedia/libtiff/files/libtool2.patch19
-rw-r--r--poky/meta/recipes-multimedia/libtiff/tiff_4.0.9.bb55
-rw-r--r--poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch56
-rw-r--r--poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14632.patch62
-rw-r--r--poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14633.patch42
-rw-r--r--poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2018-5146.patch100
-rw-r--r--poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb22
-rw-r--r--poky/meta/recipes-multimedia/mpeg2dec/files/0001-check-for-available-arm-optimizations.patch55
-rw-r--r--poky/meta/recipes-multimedia/mpeg2dec/files/0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch63
-rw-r--r--poky/meta/recipes-multimedia/mpeg2dec/files/altivec_h_needed.patch43
-rw-r--r--poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb45
-rw-r--r--poky/meta/recipes-multimedia/mpg123/mpg123_1.25.10.bb51
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc272
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch97
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch66
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch70
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse2
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb15
-rw-r--r--poky/meta/recipes-multimedia/sbc/sbc_1.3.bb23
-rw-r--r--poky/meta/recipes-multimedia/speex/speex_1.2.0.bb20
-rw-r--r--poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch63
-rw-r--r--poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb39
-rw-r--r--poky/meta/recipes-multimedia/webp/libwebp_0.6.1.bb54
-rw-r--r--poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch53
-rw-r--r--poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch33
-rw-r--r--poky/meta/recipes-multimedia/x264/x264_git.bb55
-rw-r--r--poky/meta/recipes-rt/README13
-rw-r--r--poky/meta/recipes-rt/images/core-image-rt-sdk.bb20
-rw-r--r--poky/meta/recipes-rt/images/core-image-rt.bb17
-rwxr-xr-xpoky/meta/recipes-rt/rt-tests/files/rt_bmark.py412
-rw-r--r--poky/meta/recipes-rt/rt-tests/files/run-ptest3
-rw-r--r--poky/meta/recipes-rt/rt-tests/hwlatdetect_1.1.bb26
-rw-r--r--poky/meta/recipes-rt/rt-tests/rt-tests.inc10
-rw-r--r--poky/meta/recipes-rt/rt-tests/rt-tests_1.1.bb31
-rw-r--r--poky/meta/recipes-sato/images/core-image-sato-dev.bb7
-rw-r--r--poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb11
-rw-r--r--poky/meta/recipes-sato/images/core-image-sato-sdk.bb11
-rw-r--r--poky/meta/recipes-sato/images/core-image-sato.bb12
-rw-r--r--poky/meta/recipes-sato/l3afpad/l3afpad_git.bb25
-rw-r--r--poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch39
-rw-r--r--poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_0.2.bb23
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/files/vfolders/All.directory5
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Applications.directory6
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Games.directory9
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Root.order4
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Settings.directory8
-rw-r--r--poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.2.bb33
-rw-r--r--poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch33
-rw-r--r--poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh21
-rw-r--r--poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_0.1.1.bb59
-rw-r--r--poky/meta/recipes-sato/matchbox-panel-2/files/0001-applets-systray-Allow-icons-to-be-smaller.patch34
-rw-r--r--poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb40
-rw-r--r--poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/index.theme7
-rw-r--r--poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session28
-rw-r--r--poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb56
-rw-r--r--poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_0.1.bb21
-rw-r--r--poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc16
-rw-r--r--poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.2.bb8
-rw-r--r--poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb59
-rw-r--r--poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.pngbin0 -> 999 bytes
-rw-r--r--poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.pngbin0 -> 2044 bytes
-rw-r--r--poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.pngbin0 -> 3220 bytes
-rw-r--r--poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.pngbin0 -> 2855 bytes
-rw-r--r--poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch15
-rw-r--r--poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb40
-rw-r--r--poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf7
-rw-r--r--poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb17
-rw-r--r--poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch32
-rw-r--r--poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch46
-rw-r--r--poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch72
-rw-r--r--poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch43
-rw-r--r--poky/meta/recipes-sato/puzzles/puzzles_git.bb76
-rw-r--r--poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc58
-rw-r--r--poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop9
-rw-r--r--poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.pngbin0 -> 2847 bytes
-rw-r--r--poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch26
-rw-r--r--poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb8
-rw-r--r--poky/meta/recipes-sato/sato-screenshot/sato-screenshot_0.3.bb28
-rw-r--r--poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh1
-rw-r--r--poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch49
-rw-r--r--poky/meta/recipes-sato/settings-daemon/settings-daemon_0.0.2.bb30
-rw-r--r--poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb24
-rw-r--r--poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop10
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch27
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch77
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-gles3-header-when-gles2-is-enabled.patch38
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch49
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch34
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch50
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch127
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch41
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch23
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch46
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/fix-configure-failure-aarch64.patch29
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch21
-rw-r--r--poky/meta/recipes-sato/webkit/webkitgtk_2.18.6.bb123
-rw-r--r--poky/meta/recipes-support/apr/apr-util/configfix.patch51
-rw-r--r--poky/meta/recipes-support/apr/apr-util/configure_fixes.patch31
-rw-r--r--poky/meta/recipes-support/apr/apr-util/run-ptest6
-rw-r--r--poky/meta/recipes-support/apr/apr-util_1.6.1.bb93
-rw-r--r--poky/meta/recipes-support/apr/apr/0001-build-buildcheck.sh-improve-libtool-detection.patch32
-rw-r--r--poky/meta/recipes-support/apr/apr/0002-apr-Remove-workdir-path-references-from-installed-ap.patch74
-rw-r--r--poky/meta/recipes-support/apr/apr/0003-Makefile.in-configure.in-support-cross-compiling.patch63
-rw-r--r--poky/meta/recipes-support/apr/apr/0004-Fix-packet-discards-HTTP-redirect.patch39
-rw-r--r--poky/meta/recipes-support/apr/apr/0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch36
-rw-r--r--poky/meta/recipes-support/apr/apr/0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch78
-rw-r--r--poky/meta/recipes-support/apr/apr/0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch50
-rw-r--r--poky/meta/recipes-support/apr/apr/run-ptest6
-rw-r--r--poky/meta/recipes-support/apr/apr_1.6.3.bb117
-rw-r--r--poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb32
-rw-r--r--poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch84
-rw-r--r--poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch51
-rw-r--r--poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch19
-rw-r--r--poky/meta/recipes-support/aspell/aspell/gcc7.patch40
-rw-r--r--poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb31
-rw-r--r--poky/meta/recipes-support/atk/at-spi2-atk_2.26.1.bb22
-rw-r--r--poky/meta/recipes-support/atk/at-spi2-core/0001-build-Add-with-systemduserunitdir.patch52
-rw-r--r--poky/meta/recipes-support/atk/at-spi2-core_2.26.2.bb29
-rw-r--r--poky/meta/recipes-support/atk/atk_2.26.1.bb19
-rw-r--r--poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch51
-rw-r--r--poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch198
-rw-r--r--poky/meta/recipes-support/attr/acl/configure.ac49
-rw-r--r--poky/meta/recipes-support/attr/acl/run-ptest64
-rw-r--r--poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch37
-rw-r--r--poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch100
-rw-r--r--poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch84
-rw-r--r--poky/meta/recipes-support/attr/acl_2.2.52.bb55
-rw-r--r--poky/meta/recipes-support/attr/attr.inc45
-rw-r--r--poky/meta/recipes-support/attr/attr/0001-Use-stdint-types-consistently.patch69
-rw-r--r--poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch63
-rw-r--r--poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch56
-rw-r--r--poky/meta/recipes-support/attr/attr_2.4.47.bb15
-rw-r--r--poky/meta/recipes-support/attr/ea-acl.inc49
-rw-r--r--poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch70
-rw-r--r--poky/meta/recipes-support/attr/files/Remove-the-attr.5-man-page-moved-to-man-pages.patch240
-rw-r--r--poky/meta/recipes-support/attr/files/Remove-the-section-2-man-pages.patch666
-rw-r--r--poky/meta/recipes-support/attr/files/relative-libdir.patch25
-rw-r--r--poky/meta/recipes-support/attr/files/run-ptest5
-rw-r--r--poky/meta/recipes-support/bash-completion/bash-completion_2.7.bb42
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch34
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch37
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch43
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch39
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch47
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt/run-ptest5
-rw-r--r--poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb48
-rw-r--r--poky/meta/recipes-support/bmap-tools/bmap-tools_3.4.bb24
-rw-r--r--poky/meta/recipes-support/boost/bjam-native_1.66.0.bb19
-rw-r--r--poky/meta/recipes-support/boost/boost-1.66.0.inc21
-rw-r--r--poky/meta/recipes-support/boost/boost.inc200
-rw-r--r--poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch100
-rw-r--r--poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch65
-rw-r--r--poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch151
-rw-r--r--poky/meta/recipes-support/boost/boost/arm-intrinsics.patch55
-rw-r--r--poky/meta/recipes-support/boost/boost/boost-CVE-2012-2677.patch112
-rw-r--r--poky/meta/recipes-support/boost/boost/boost-math-disable-pch-for-gcc.patch31
-rw-r--r--poky/meta/recipes-support/boost/boost_1.66.0.bb11
-rw-r--r--poky/meta/recipes-support/boost/files/0001-Fix-a-strange-assert-typo-how-was-this-released-with.patch37
-rw-r--r--poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch50
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch34
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch46
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/0003-update-ca-certificates-use-relative-symlinks-from-ET.patch71
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch50
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch20
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch34
-rw-r--r--poky/meta/recipes-support/ca-certificates/ca-certificates_20170717.bb88
-rw-r--r--poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch33
-rw-r--r--poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch19
-rw-r--r--poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb49
-rw-r--r--poky/meta/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch44
-rw-r--r--poky/meta/recipes-support/curl/curl_7.60.0.bb70
-rw-r--r--poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch45
-rw-r--r--poky/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch42
-rw-r--r--poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch50
-rw-r--r--poky/meta/recipes-support/db/db/fix-parallel-build.patch21
-rw-r--r--poky/meta/recipes-support/db/db/sequence-type.patch59
-rw-r--r--poky/meta/recipes-support/db/db_5.3.28.bb123
-rw-r--r--poky/meta/recipes-support/debianutils/debianutils_4.8.4.bb57
-rw-r--r--poky/meta/recipes-support/enchant/enchant_1.6.0.bb34
-rw-r--r--poky/meta/recipes-support/gdbm/files/ptest.patch50
-rwxr-xr-xpoky/meta/recipes-support/gdbm/files/run-ptest7
-rw-r--r--poky/meta/recipes-support/gdbm/gdbm_1.14.1.bb43
-rw-r--r--poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch61
-rw-r--r--poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch49
-rw-r--r--poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch18
-rw-r--r--poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch15
-rw-r--r--poky/meta/recipes-support/gmp/gmp.inc12
-rw-r--r--poky/meta/recipes-support/gmp/gmp_6.1.2.bb41
-rw-r--r--poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch35
-rw-r--r--poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch27
-rw-r--r--poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb22
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg/0001-Use-pkg-config-to-find-pth-instead-of-pth-config.patch105
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg/0001-configure.ac-use-a-custom-value-for-the-location-of-.patch30
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg/0002-use-pkgconfig-instead-of-npth-config.patch85
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg/0003-dirmngr-uses-libgpg-error.patch32
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch34
-rw-r--r--poky/meta/recipes-support/gnupg/gnupg_2.2.4.bb50
-rw-r--r--poky/meta/recipes-support/gnutls/gnutls.inc59
-rw-r--r--poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch29
-rw-r--r--poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch19
-rw-r--r--poky/meta/recipes-support/gnutls/gnutls_3.6.1.bb9
-rw-r--r--poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch63
-rw-r--r--poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch14
-rw-r--r--poky/meta/recipes-support/gnutls/libtasn1_4.13.bb23
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0001-pkgconfig.patch303
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0002-gpgme-lang-python-gpg-error-config-should-not-be-use.patch51
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0003-Correctly-install-python-modules.patch33
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0004-python-import.patch34
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0005-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch31
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0006-fix-build-path-issue.patch37
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme/0007-qt-python-Add-variables-to-tests.patch78
-rw-r--r--poky/meta/recipes-support/gpgme/gpgme_1.10.0.bb86
-rw-r--r--poky/meta/recipes-support/icu/icu.inc87
-rw-r--r--poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch28
-rw-r--r--poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch34
-rw-r--r--poky/meta/recipes-support/icu/icu/fix-install-manx.patch57
-rw-r--r--poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch49
-rw-r--r--poky/meta/recipes-support/icu/icu_60.2.bb29
-rw-r--r--poky/meta/recipes-support/iso-codes/iso-codes_3.77.bb15
-rw-r--r--poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch159
-rw-r--r--poky/meta/recipes-support/libassuan/libassuan_2.5.1.bb32
-rw-r--r--poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.6.2.bb21
-rw-r--r--poky/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch376
-rw-r--r--poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch33
-rw-r--r--poky/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch52
-rw-r--r--poky/meta/recipes-support/libbsd/libbsd_0.8.7.bb50
-rw-r--r--poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch58
-rw-r--r--poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.8.bb37
-rw-r--r--poky/meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch41
-rw-r--r--poky/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch32
-rw-r--r--poky/meta/recipes-support/libcap/libcap_2.25.bb74
-rw-r--r--poky/meta/recipes-support/libcheck/libcheck_0.12.0.bb23
-rw-r--r--poky/meta/recipes-support/libcroco/libcroco_0.6.12.bb20
-rw-r--r--poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch20
-rw-r--r--poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb18
-rw-r--r--poky/meta/recipes-support/libevdev/libevdev_1.5.8.bb14
-rw-r--r--poky/meta/recipes-support/libevent/libevent/0001-test-fix-32bit-linux-regress.patch48
-rw-r--r--poky/meta/recipes-support/libevent/libevent/Makefile-missing-test-dir.patch27
-rw-r--r--poky/meta/recipes-support/libevent/libevent/run-ptest18
-rw-r--r--poky/meta/recipes-support/libevent/libevent_2.1.8.bb43
-rw-r--r--poky/meta/recipes-support/libexif/libexif_0.6.21.bb17
-rw-r--r--poky/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch30
-rw-r--r--poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch32
-rw-r--r--poky/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch177
-rw-r--r--poky/meta/recipes-support/libffi/libffi/not-win32.patch26
-rw-r--r--poky/meta/recipes-support/libffi/libffi_3.2.1.bb34
-rw-r--r--poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch54
-rw-r--r--poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb23
-rw-r--r--poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch28
-rw-r--r--poky/meta/recipes-support/libfm/libfm/0001-Enclose-text-in-programlisting-into-CDATA.patch76
-rw-r--r--poky/meta/recipes-support/libfm/libfm_1.2.5.bb54
-rw-r--r--poky/meta/recipes-support/libgcrypt/files/0001-Add-and-use-pkg-config-for-libgcrypt-instead-of-conf.patch183
-rw-r--r--poky/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch41
-rw-r--r--poky/meta/recipes-support/libgcrypt/files/0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch79
-rw-r--r--poky/meta/recipes-support/libgcrypt/files/0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch28
-rw-r--r--poky/meta/recipes-support/libgcrypt/libgcrypt_1.8.2.bb53
-rw-r--r--poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch150
-rw-r--r--poky/meta/recipes-support/libgpg-error/libgpg-error_1.27.bb62
-rw-r--r--poky/meta/recipes-support/libical/libical/0001-CMakeLists.txt-libical.pc.in-fix-iculibs-remove-full.patch44
-rw-r--r--poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch30
-rw-r--r--poky/meta/recipes-support/libical/libical_2.0.0.bb19
-rw-r--r--poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch152
-rw-r--r--poky/meta/recipes-support/libksba/libksba_1.3.5.bb28
-rw-r--r--poky/meta/recipes-support/libmpc/libmpc.inc7
-rw-r--r--poky/meta/recipes-support/libmpc/libmpc_1.1.0.bb15
-rw-r--r--poky/meta/recipes-support/libnl/libnl/0001-PATCH-fix-libnl-3.4.0-musl-compile-problem.patch38
-rw-r--r--poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch17
-rw-r--r--poky/meta/recipes-support/libnl/libnl_3.4.0.bb46
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre/Makefile183
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch41
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch48
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre/run-ptest3
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch65
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre2_10.30.bb61
-rw-r--r--poky/meta/recipes-support/libpcre/libpcre_8.41.bb87
-rw-r--r--poky/meta/recipes-support/libproxy/libproxy_0.4.15.bb36
-rw-r--r--poky/meta/recipes-support/libsoup/libsoup-2.4_2.60.3.bb35
-rw-r--r--poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch56
-rw-r--r--poky/meta/recipes-support/libunistring/libunistring_0.9.9.bb30
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind.inc23
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch81
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/0001-add-knobs-to-disable-enable-tests.patch69
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch45
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch248
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch54
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch59
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch31
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch37
-rw-r--r--poky/meta/recipes-support/libunwind/libunwind_1.2.1.bb23
-rw-r--r--poky/meta/recipes-support/liburcu/liburcu_0.10.1.bb19
-rw-r--r--poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch30
-rw-r--r--poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb42
-rw-r--r--poky/meta/recipes-support/libusb/libusb1/no-dll.patch19
-rw-r--r--poky/meta/recipes-support/libusb/libusb1_1.0.21.bb35
-rw-r--r--poky/meta/recipes-support/libxslt/libxslt_1.1.32.bb46
-rw-r--r--poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb20
-rw-r--r--poky/meta/recipes-support/lz4/files/0001-tests-Makefile-don-t-use-LIBDIR-as-variable.patch82
-rw-r--r--poky/meta/recipes-support/lz4/files/run-ptest43
-rw-r--r--poky/meta/recipes-support/lz4/lz4_1.7.4.bb27
-rw-r--r--poky/meta/recipes-support/lzo/lzo/0001-Add-pkgconfigdir-to-solve-the-undefine-error.patch27
-rw-r--r--poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch70
-rw-r--r--poky/meta/recipes-support/lzo/lzo/run-ptest33
-rw-r--r--poky/meta/recipes-support/lzo/lzo_2.10.bb31
-rw-r--r--poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch100
-rw-r--r--poky/meta/recipes-support/lzop/lzop/acinclude.m4390
-rw-r--r--poky/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch37
-rw-r--r--poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch36
-rw-r--r--poky/meta/recipes-support/lzop/lzop_1.03.bb29
-rw-r--r--poky/meta/recipes-support/mpfr/mpfr/long-long-thumb.patch39
-rw-r--r--poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb20
-rw-r--r--poky/meta/recipes-support/nettle/nettle-3.4/Add-target-to-only-build-tests-not-run-them.patch38
-rw-r--r--poky/meta/recipes-support/nettle/nettle-3.4/check-header-files-of-openssl-only-if-enable_.patch36
-rw-r--r--poky/meta/recipes-support/nettle/nettle-3.4/dlopen-test.patch20
-rw-r--r--poky/meta/recipes-support/nettle/nettle-3.4/run-ptest36
-rw-r--r--poky/meta/recipes-support/nettle/nettle_3.4.bb47
-rw-r--r--poky/meta/recipes-support/npth/npth/pkgconfig.patch49
-rw-r--r--poky/meta/recipes-support/npth/npth_1.5.bb23
-rw-r--r--poky/meta/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch31
-rw-r--r--poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch105
-rw-r--r--poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch52
-rw-r--r--poky/meta/recipes-support/nspr/nspr/nspr.pc.in11
-rw-r--r--poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch26
-rw-r--r--poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch19
-rw-r--r--poky/meta/recipes-support/nspr/nspr_4.19.bb190
-rw-r--r--poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch53
-rw-r--r--poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb31
-rw-r--r--poky/meta/recipes-support/nss/nss/0001-Bug-1437734-Use-snprintf-in-sign.c-r-ttaubert.patch119
-rw-r--r--poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch48
-rw-r--r--poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch33
-rw-r--r--poky/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch33
-rw-r--r--poky/meta/recipes-support/nss/nss/nss-build-hacl-poly1305-aarch64.patch30
-rw-r--r--poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch110
-rw-r--r--poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch36
-rw-r--r--poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch26
-rw-r--r--poky/meta/recipes-support/nss/nss/nss.pc.in11
-rw-r--r--poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch23
-rw-r--r--poky/meta/recipes-support/nss/nss/signlibs.sh20
-rw-r--r--poky/meta/recipes-support/nss/nss_3.35.bb255
-rw-r--r--poky/meta/recipes-support/p11-kit/p11-kit/0001-LINGUAS-drop-the-languages-for-which-upstream-does-n.patch32
-rw-r--r--poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb46
-rw-r--r--poky/meta/recipes-support/pinentry/pinentry-1.1.0/gpg-error_pkconf.patch100
-rw-r--r--poky/meta/recipes-support/pinentry/pinentry-1.1.0/libassuan_pkgconf.patch153
-rw-r--r--poky/meta/recipes-support/pinentry/pinentry_1.1.0.bb38
-rw-r--r--poky/meta/recipes-support/popt/popt/disable_tests.patch21
-rw-r--r--poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch15
-rw-r--r--poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch21
-rw-r--r--poky/meta/recipes-support/popt/popt_1.16.bb22
-rw-r--r--poky/meta/recipes-support/ptest-runner/ptest-runner_2.1.1.bb26
-rw-r--r--poky/meta/recipes-support/re2c/re2c/mkdir.patch36
-rw-r--r--poky/meta/recipes-support/re2c/re2c_0.16.bb15
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch60
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch92
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/default2
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/init49
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch98
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch103
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/rngd.service9
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch33
-rw-r--r--poky/meta/recipes-support/rng-tools/rng-tools_5.bb55
-rw-r--r--poky/meta/recipes-support/serf/serf/env.patch28
-rw-r--r--poky/meta/recipes-support/serf/serf/norpath.patch42
-rw-r--r--poky/meta/recipes-support/serf/serf_1.3.9.bb26
-rw-r--r--poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc35
-rw-r--r--poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch25
-rw-r--r--poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch33
-rw-r--r--poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.9.bb7
-rw-r--r--poky/meta/recipes-support/source-highlight/files/0001-source-highlight.pc.in-do-not-add-Boost-s-libraries-.patch30
-rw-r--r--poky/meta/recipes-support/source-highlight/source-highlight_3.1.8.bb28
-rw-r--r--poky/meta/recipes-support/sqlite/sqlite3.inc57
-rw-r--r--poky/meta/recipes-support/sqlite/sqlite3_3.22.0.bb10
-rw-r--r--poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch40
-rw-r--r--poky/meta/recipes-support/taglib/taglib_1.11.1.bb43
-rw-r--r--poky/meta/recipes-support/user-creation/files/system-xuser.conf11
-rw-r--r--poky/meta/recipes-support/user-creation/xuser-account_0.1.bb28
-rw-r--r--poky/meta/recipes-support/vte/vte/0001-Add-m4-vapigen.m4.patch119
-rw-r--r--poky/meta/recipes-support/vte/vte/0001-Don-t-enable-stack-protection-by-default.patch29
-rw-r--r--poky/meta/recipes-support/vte/vte_0.50.2.bb48
-rw-r--r--poky/meta/recipes.txt14
-rw-r--r--poky/meta/site/arm-3247
-rw-r--r--poky/meta/site/arm-6446
-rw-r--r--poky/meta/site/arm-common153
-rw-r--r--poky/meta/site/arm-darwin11
-rw-r--r--poky/meta/site/arm-darwin811
-rw-r--r--poky/meta/site/arm-linux157
-rw-r--r--poky/meta/site/armeb-linux43
-rw-r--r--poky/meta/site/common21
-rw-r--r--poky/meta/site/common-darwin2
-rw-r--r--poky/meta/site/common-glibc86
-rw-r--r--poky/meta/site/common-linux67
-rw-r--r--poky/meta/site/common-mingw2
-rw-r--r--poky/meta/site/common-musl53
-rw-r--r--poky/meta/site/endian-big8
-rw-r--r--poky/meta/site/endian-little8
-rw-r--r--poky/meta/site/ix86-common224
-rw-r--r--poky/meta/site/microblaze-linux54
-rw-r--r--poky/meta/site/mips-common53
-rw-r--r--poky/meta/site/mips-linux79
-rw-r--r--poky/meta/site/mips64-linux83
-rw-r--r--poky/meta/site/mips64el-linux83
-rw-r--r--poky/meta/site/mipsel-linux79
-rw-r--r--poky/meta/site/mipsisa32r6-linux79
-rw-r--r--poky/meta/site/mipsisa32r6el-linux79
-rw-r--r--poky/meta/site/mipsisa64r6-linux83
-rw-r--r--poky/meta/site/mipsisa64r6el-linux83
-rw-r--r--poky/meta/site/native1
-rw-r--r--poky/meta/site/nios2-linux387
-rw-r--r--poky/meta/site/powerpc-common14
-rw-r--r--poky/meta/site/powerpc-darwin7
-rw-r--r--poky/meta/site/powerpc-linux16
-rw-r--r--poky/meta/site/powerpc32-linux271
-rw-r--r--poky/meta/site/powerpc64-linux39
-rw-r--r--poky/meta/site/riscv32-linux11
-rw-r--r--poky/meta/site/riscv64-linux11
-rw-r--r--poky/meta/site/sh-common233
-rw-r--r--poky/meta/site/sparc-linux48
-rw-r--r--poky/meta/site/x32-linux8
-rw-r--r--poky/meta/site/x86_64-linux134
-rwxr-xr-xpoky/oe-init-build-env59
-rw-r--r--poky/scripts/README1
-rwxr-xr-xpoky/scripts/bitbake-prserv-tool112
-rwxr-xr-xpoky/scripts/bitbake-whatchanged330
-rwxr-xr-xpoky/scripts/buildhistory-collect-srcrevs117
-rwxr-xr-xpoky/scripts/buildhistory-diff139
-rwxr-xr-xpoky/scripts/buildstats-diff306
-rwxr-xr-xpoky/scripts/combo-layer1376
-rwxr-xr-xpoky/scripts/combo-layer-hook-default.sh20
-rw-r--r--poky/scripts/combo-layer.conf.example93
-rwxr-xr-xpoky/scripts/contrib/bb-perf/bb-matrix-plot.sh137
-rwxr-xr-xpoky/scripts/contrib/bb-perf/bb-matrix.sh79
-rwxr-xr-xpoky/scripts/contrib/bb-perf/buildstats-plot.sh157
-rwxr-xr-xpoky/scripts/contrib/bb-perf/buildstats.sh155
-rwxr-xr-xpoky/scripts/contrib/bbvars.py180
-rwxr-xr-xpoky/scripts/contrib/build-perf-test-wrapper.sh239
-rwxr-xr-xpoky/scripts/contrib/build-perf-test.sh400
-rwxr-xr-xpoky/scripts/contrib/ddimage108
-rwxr-xr-xpoky/scripts/contrib/devtool-stress.py256
-rwxr-xr-xpoky/scripts/contrib/dialog-power-control53
-rwxr-xr-xpoky/scripts/contrib/documentation-audit.sh94
-rwxr-xr-xpoky/scripts/contrib/graph-tool91
-rwxr-xr-xpoky/scripts/contrib/list-packageconfig-flags.py178
-rwxr-xr-xpoky/scripts/contrib/mkefidisk.sh464
-rwxr-xr-xpoky/scripts/contrib/oe-build-perf-report-email.py282
-rwxr-xr-xpoky/scripts/contrib/patchreview.py211
-rwxr-xr-xpoky/scripts/contrib/patchtest.sh118
-rwxr-xr-xpoky/scripts/contrib/serdevtry60
-rwxr-xr-xpoky/scripts/contrib/test_build_time.sh237
-rwxr-xr-xpoky/scripts/contrib/test_build_time_worker.sh37
-rwxr-xr-xpoky/scripts/contrib/uncovered39
-rwxr-xr-xpoky/scripts/contrib/verify-homepage.py62
-rwxr-xr-xpoky/scripts/cp-noerror52
-rwxr-xr-xpoky/scripts/create-pull-request303
-rwxr-xr-xpoky/scripts/crosstap469
-rwxr-xr-xpoky/scripts/devtool349
-rwxr-xr-xpoky/scripts/distro/build-recipe-list.py129
-rwxr-xr-xpoky/scripts/distro/distrocompare.sh123
-rwxr-xr-xpoky/scripts/gen-lockedsig-cache74
-rwxr-xr-xpoky/scripts/gen-site-config53
-rw-r--r--poky/scripts/lib/argparse_oe.py176
-rw-r--r--poky/scripts/lib/build_perf/__init__.py31
-rw-r--r--poky/scripts/lib/build_perf/html.py19
-rw-r--r--poky/scripts/lib/build_perf/html/measurement_chart.html50
-rw-r--r--poky/scripts/lib/build_perf/html/report.html286
-rw-r--r--poky/scripts/lib/build_perf/report.py345
-rw-r--r--poky/scripts/lib/build_perf/scrape-html-report.js56
-rw-r--r--poky/scripts/lib/buildstats.py349
-rw-r--r--poky/scripts/lib/checklayer/__init__.py394
-rw-r--r--poky/scripts/lib/checklayer/case.py7
-rw-r--r--poky/scripts/lib/checklayer/cases/__init__.py0
-rw-r--r--poky/scripts/lib/checklayer/cases/bsp.py204
-rw-r--r--poky/scripts/lib/checklayer/cases/common.py58
-rw-r--r--poky/scripts/lib/checklayer/cases/distro.py26
-rw-r--r--poky/scripts/lib/checklayer/context.py15
-rw-r--r--poky/scripts/lib/devtool/__init__.py383
-rw-r--r--poky/scripts/lib/devtool/build.py86
-rw-r--r--poky/scripts/lib/devtool/build_image.py174
-rw-r--r--poky/scripts/lib/devtool/build_sdk.py65
-rw-r--r--poky/scripts/lib/devtool/deploy.py350
-rw-r--r--poky/scripts/lib/devtool/export.py119
-rw-r--r--poky/scripts/lib/devtool/import.py144
-rw-r--r--poky/scripts/lib/devtool/package.py60
-rw-r--r--poky/scripts/lib/devtool/runqemu.py74
-rw-r--r--poky/scripts/lib/devtool/sdk.py336
-rw-r--r--poky/scripts/lib/devtool/search.py118
-rw-r--r--poky/scripts/lib/devtool/standard.py2164
-rw-r--r--poky/scripts/lib/devtool/upgrade.py626
-rw-r--r--poky/scripts/lib/devtool/utilcmds.py252
-rw-r--r--poky/scripts/lib/recipetool/__init__.py0
-rw-r--r--poky/scripts/lib/recipetool/append.py457
-rw-r--r--poky/scripts/lib/recipetool/create.py1329
-rw-r--r--poky/scripts/lib/recipetool/create_buildsys.py893
-rw-r--r--poky/scripts/lib/recipetool/create_buildsys_python.py719
-rw-r--r--poky/scripts/lib/recipetool/create_kernel.py99
-rw-r--r--poky/scripts/lib/recipetool/create_kmod.py152
-rw-r--r--poky/scripts/lib/recipetool/create_npm.py330
-rw-r--r--poky/scripts/lib/recipetool/newappend.py89
-rw-r--r--poky/scripts/lib/recipetool/setvar.py75
-rw-r--r--poky/scripts/lib/scriptpath.py42
-rw-r--r--poky/scripts/lib/scriptutils.py241
-rw-r--r--poky/scripts/lib/wic/__init__.py20
-rw-r--r--poky/scripts/lib/wic/canned-wks/common.wks.inc3
-rw-r--r--poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg27
-rw-r--r--poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks8
-rw-r--r--poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks10
-rw-r--r--poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks23
-rw-r--r--poky/scripts/lib/wic/canned-wks/directdisk.wks8
-rw-r--r--poky/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in3
-rw-r--r--poky/scripts/lib/wic/canned-wks/mkefidisk.wks11
-rw-r--r--poky/scripts/lib/wic/canned-wks/mkhybridiso.wks7
-rw-r--r--poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks8
-rw-r--r--poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks6
-rw-r--r--poky/scripts/lib/wic/canned-wks/systemd-bootdisk.wks11
-rw-r--r--poky/scripts/lib/wic/engine.py565
-rw-r--r--poky/scripts/lib/wic/filemap.py600
-rw-r--r--poky/scripts/lib/wic/help.py1055
-rw-r--r--poky/scripts/lib/wic/ksparser.py235
-rw-r--r--poky/scripts/lib/wic/misc.py263
-rw-r--r--poky/scripts/lib/wic/partition.py425
-rw-r--r--poky/scripts/lib/wic/pluginbase.py149
-rw-r--r--poky/scripts/lib/wic/plugins/imager/direct.py607
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-efi.py258
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-partition.py132
-rw-r--r--poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py207
-rw-r--r--poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py466
-rw-r--r--poky/scripts/lib/wic/plugins/source/rawcopy.py91
-rw-r--r--poky/scripts/lib/wic/plugins/source/rootfs.py126
-rwxr-xr-xpoky/scripts/lnr21
-rw-r--r--poky/scripts/multilib_header_wrapper.h61
-rwxr-xr-xpoky/scripts/native-intercept/chown2
-rwxr-xr-xpoky/scripts/oe-build-perf-report661
-rwxr-xr-xpoky/scripts/oe-build-perf-test223
-rwxr-xr-xpoky/scripts/oe-buildenv-internal140
-rwxr-xr-xpoky/scripts/oe-check-sstate121
-rwxr-xr-xpoky/scripts/oe-depends-dot121
-rwxr-xr-xpoky/scripts/oe-find-native-sysroot115
-rwxr-xr-xpoky/scripts/oe-git-archive271
-rwxr-xr-xpoky/scripts/oe-git-proxy181
-rwxr-xr-xpoky/scripts/oe-gnome-terminal-phonehome10
-rwxr-xr-xpoky/scripts/oe-pkgdata-util630
-rwxr-xr-xpoky/scripts/oe-publish-sdk155
-rwxr-xr-xpoky/scripts/oe-run-native68
-rwxr-xr-xpoky/scripts/oe-selftest75
-rwxr-xr-xpoky/scripts/oe-setup-builddir140
-rwxr-xr-xpoky/scripts/oe-test81
-rwxr-xr-xpoky/scripts/oe-trim-schemas58
-rwxr-xr-xpoky/scripts/oepydevshell-internal.py97
-rwxr-xr-xpoky/scripts/opkg-query-helper.py85
-rw-r--r--poky/scripts/postinst-intercepts/delay_to_first_boot2
-rwxr-xr-xpoky/scripts/postinst-intercepts/postinst_intercept56
-rw-r--r--poky/scripts/postinst-intercepts/update_font_cache7
-rw-r--r--poky/scripts/postinst-intercepts/update_gio_module_cache9
-rw-r--r--poky/scripts/postinst-intercepts/update_icon_cache13
-rw-r--r--poky/scripts/postinst-intercepts/update_pixbuf_cache11
-rw-r--r--poky/scripts/pybootchartgui/AUTHORS11
-rw-r--r--poky/scripts/pybootchartgui/COPYING340
-rw-r--r--poky/scripts/pybootchartgui/MAINTAINERS3
-rw-r--r--poky/scripts/pybootchartgui/NEWS204
-rw-r--r--poky/scripts/pybootchartgui/README.pybootchart37
-rwxr-xr-xpoky/scripts/pybootchartgui/pybootchartgui.py23
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/__init__.py0
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/batch.py46
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/draw.py968
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/gui.py350
l---------poky/scripts/pybootchartgui/pybootchartgui/main.py1
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/main.py.in183
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/parsing.py821
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/process_tree.py292
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/samples.py178
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py105
-rw-r--r--poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py92
-rwxr-xr-xpoky/scripts/pythondeps250
-rwxr-xr-xpoky/scripts/recipetool126
-rwxr-xr-xpoky/scripts/relocate_sdk.py266
-rw-r--r--poky/scripts/rootfs_rpm-extract-postinst.awk11
-rwxr-xr-xpoky/scripts/rpm2cpio.sh55
-rwxr-xr-xpoky/scripts/runqemu1307
-rwxr-xr-xpoky/scripts/runqemu-addptable2image51
-rwxr-xr-xpoky/scripts/runqemu-export-rootfs156
-rwxr-xr-xpoky/scripts/runqemu-extract-sdk104
-rwxr-xr-xpoky/scripts/runqemu-gen-tapdevs108
-rwxr-xr-xpoky/scripts/runqemu-ifdown66
-rwxr-xr-xpoky/scripts/runqemu-ifup121
-rw-r--r--poky/scripts/runqemu.README42
-rwxr-xr-xpoky/scripts/send-error-report200
-rwxr-xr-xpoky/scripts/send-pull-request184
-rwxr-xr-xpoky/scripts/sstate-cache-management.sh469
-rwxr-xr-xpoky/scripts/sstate-diff-machines.sh172
-rwxr-xr-xpoky/scripts/sstate-sysroot-cruft.sh199
-rwxr-xr-xpoky/scripts/sysroot-relativelinks.py31
-rwxr-xr-xpoky/scripts/task-time132
-rwxr-xr-xpoky/scripts/test-reexec123
-rwxr-xr-xpoky/scripts/test-remote-image357
-rwxr-xr-xpoky/scripts/tiny/dirsize.py89
-rwxr-xr-xpoky/scripts/tiny/ksize.py170
-rwxr-xr-xpoky/scripts/tiny/ksum.py168
-rwxr-xr-xpoky/scripts/verify-bashisms155
-rwxr-xr-xpoky/scripts/wic542
-rwxr-xr-xpoky/scripts/yocto-check-layer208
-rwxr-xr-xpoky/scripts/yocto-check-layer-wrapper43
5103 files changed, 622701 insertions, 0 deletions
diff --git a/poky/.gitignore b/poky/.gitignore
new file mode 100644
index 000000000..d3ef473b0
--- /dev/null
+++ b/poky/.gitignore
@@ -0,0 +1,31 @@
+*.pyc
+*.pyo
+/*.patch
+/build*/
+pyshtables.py
+pstage/
+scripts/oe-git-proxy-socks
+sources/
+meta-*/
+!meta-skeleton
+!meta-selftest
+hob-image-*.bb
+*.swp
+*.orig
+*.rej
+*~
+!meta-poky
+!meta-yocto
+!meta-yocto-bsp
+!meta-yocto-imported
+/documentation/*/eclipse/
+/documentation/*/*.html
+/documentation/*/*.pdf
+/documentation/*/*.tgz
+/bitbake/doc/bitbake-user-manual/bitbake-user-manual.html
+/bitbake/doc/bitbake-user-manual/bitbake-user-manual.pdf
+/bitbake/doc/bitbake-user-manual/bitbake-user-manual.tgz
+pull-*/
+bitbake/lib/toaster/contrib/tts/backlog.txt
+bitbake/lib/toaster/contrib/tts/log/*
+bitbake/lib/toaster/contrib/tts/.cache/* \ No newline at end of file
diff --git a/poky/.templateconf b/poky/.templateconf
new file mode 100644
index 000000000..0fe6f8250
--- /dev/null
+++ b/poky/.templateconf
@@ -0,0 +1,2 @@
+# Template settings
+TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
diff --git a/poky/LICENSE b/poky/LICENSE
new file mode 100644
index 000000000..21fa6e6bd
--- /dev/null
+++ b/poky/LICENSE
@@ -0,0 +1,14 @@
+Different components of OpenEmbedded are under different licenses (a mix
+of MIT and GPLv2). Please see:
+
+meta/COPYING.GPLv2 (GPLv2)
+meta/COPYING.MIT (MIT)
+meta-selftest/COPYING.MIT (MIT)
+meta-skeleton/COPYING.MIT (MIT)
+
+All metadata is MIT licensed unless otherwise stated. Source code
+included in tree for individual recipes is under the LICENSE stated in
+the associated recipe (.bb file) unless otherwise stated.
+
+License information for any other files is either explicitly stated
+or defaults to GPL version 2.
diff --git a/poky/README.LSB b/poky/README.LSB
new file mode 100644
index 000000000..f68d07c9e
--- /dev/null
+++ b/poky/README.LSB
@@ -0,0 +1,26 @@
+OE-Core aims to be able to provide basic LSB compatible images. There
+are some challenges for OE as LSB isn't always 100% relevant to its
+target embedded and IoT audiences.
+
+One challenge is that the LSB spec is no longer being actively
+developed [https://github.com/LinuxStandardBase/lsb] and has
+components which are end of life or significantly dated. OE
+therefore provides compatibility with the following caveats:
+
+* Qt4 is provided by the separate meta-qt4 layer. Its noted that Qt4
+ is end of life and this isn't something the core project regularly
+ tests any longer. Users are recommended to group together to support
+ maintenance of that layer. [http://git.yoctoproject.org/cgit/cgit.cgi/meta-qt4/]
+
+* mailx has been dropped since its no longer being developed upstream
+ and there are better, more modern replacements such as s-nail
+ (http://sdaoden.eu/code.html) or mailutils (http://mailutils.org/).
+
+* A few perl modules that were required by LSB 4.x aren't provided:
+ libclass-isa, libenv, libdumpvalue, libfile-checktree,
+ libi18n-collate, libpod-plainer.
+
+* libpng 1.2 isn't provided; oe-core includes the latest release of libpng
+ instead.
+
+* pax (POSIX standard archive) tool is not provided.
diff --git a/poky/README.hardware b/poky/README.hardware
new file mode 120000
index 000000000..8b6258d49
--- /dev/null
+++ b/poky/README.hardware
@@ -0,0 +1 @@
+meta-yocto-bsp/README.hardware \ No newline at end of file
diff --git a/poky/README.poky b/poky/README.poky
new file mode 120000
index 000000000..1877dca10
--- /dev/null
+++ b/poky/README.poky
@@ -0,0 +1 @@
+meta-poky/README.poky \ No newline at end of file
diff --git a/poky/README.qemu b/poky/README.qemu
new file mode 100644
index 000000000..9f56b7d66
--- /dev/null
+++ b/poky/README.qemu
@@ -0,0 +1,15 @@
+QEMU Emulation Targets
+======================
+
+To simplify development, the build system supports building images to
+work with the QEMU emulator in system emulation mode. Several architectures
+are currently supported in 32 and 64 bit variants:
+
+ * ARM (qemuarm + qemuarm64)
+ * x86 (qemux86 + qemux86-64)
+ * PowerPC (qemuppc only)
+ * MIPS (qemumips + qemumips64)
+
+Use of the QEMU images is covered in the Yocto Project Reference Manual.
+The appropriate MACHINE variable value corresponding to the target is given
+in brackets.
diff --git a/poky/bitbake/AUTHORS b/poky/bitbake/AUTHORS
new file mode 100644
index 000000000..91fd78fd2
--- /dev/null
+++ b/poky/bitbake/AUTHORS
@@ -0,0 +1,10 @@
+Tim Ansell <mithro@mithis.net>
+Phil Blundell <pb@handhelds.org>
+Seb Frankengul <seb@frankengul.org>
+Holger Freyther <holger@moiji-mobile.com>
+Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+Chris Larson <kergoth@handhelds.org>
+Ulrich Luckas <luckas@musoft.de>
+Mickey Lauer <mickey@Vanille.de>
+Richard Purdie <rpurdie@rpsys.net>
+Holger Schurig <holgerschurig@gmx.de>
diff --git a/poky/bitbake/COPYING b/poky/bitbake/COPYING
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/poky/bitbake/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/poky/bitbake/ChangeLog b/poky/bitbake/ChangeLog
new file mode 100644
index 000000000..4ac2a6446
--- /dev/null
+++ b/poky/bitbake/ChangeLog
@@ -0,0 +1,317 @@
+Changes in Bitbake 1.9.x:
+ - Add PE (Package Epoch) support from Philipp Zabel (pH5)
+ - Treat python functions the same as shell functions for logging
+ - Use TMPDIR/anonfunc as a __anonfunc temp directory (T)
+ - Catch truncated cache file errors
+ - Allow operations other than assignment on flag variables
+ - Add code to handle inter-task dependencies
+ - Fix cache errors when generation dotGraphs
+ - Make sure __inherit_cache is updated before calling include() (from Michael Krelin)
+ - Fix bug when target was in ASSUME_PROVIDED (#2236)
+ - Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062)
+ - Fix invalid regexp in BBMASK error handling (missing import) (#1124)
+ - Promote certain warnings from debug to note 2 level
+ - Update manual
+ - Correctly redirect stdin when forking
+ - If parsing errors are found, exit, too many users miss the errors
+ - Remove supriours PREFERRED_PROVIDER warnings
+ - svn fetcher: Add _buildsvncommand function
+ - Improve certain error messages
+ - Rewrite svn fetcher to make adding extra operations easier
+ as part of future SRCDATE="now" fixes
+ (requires new FETCHCMD_svn definition in bitbake.conf)
+ - Change SVNDIR layout to be more unique (fixes #2644 and #2624)
+ - Add ConfigParsed Event after configuration parsing is complete
+ - Add SRCREV support for svn fetcher
+ - data.emit_var() - only call getVar if we need the variable
+ - Stop generating the A variable (seems to be legacy code)
+ - Make sure intertask depends get processed correcting in recursive depends
+ - Add pn-PN to overrides when evaluating PREFERRED_VERSION
+ - Improve the progress indicator by skipping tasks that have
+ already run before starting the build rather than during it
+ - Add profiling option (-P)
+ - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
+ - Add SRCREV_FORMAT support
+ - Fix local fetcher's localpath return values
+ - Apply OVERRIDES before performing immediate expansions
+ - Allow the -b -e option combination to take regular expressions
+ - Fix handling of variables with expansion in the name using _append/_prepend
+ e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
+ - Add plain message function to bb.msg
+ - Sort the list of providers before processing so dependency problems are
+ reproducible rather than effectively random
+ - Fix/improve bitbake -s output
+ - Add locking for fetchers so only one tries to fetch a given file at a given time
+ - Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains
+ - Expand data in addtasks
+ - Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...."
+ error message.
+ - Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction)
+ - Sort digraph output to make builds more reproducible
+ - Split expandKeys into two for loops to benefit from the expand_cache (12% speedup)
+ - runqueue.py: Fix idepends handling to avoid dependency errors
+ - Clear the terminal TOSTOP flag if set (and warn the user)
+ - Fix regression from r653 and make SRCDATE/CVSDATE work for packages again
+ - Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530)
+ - Warn about malformed PREFERRED_PROVIDERS (#1072)
+ - Add support for BB_NICE_LEVEL option (#1627)
+ - Psyco is used only on x86 as there is no support for other architectures.
+ - Sort initial providers list by default preference (#1145, #2024)
+ - Improve provider sorting so prefered versions have preference over latest versions (#768)
+ - Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359)
+ - Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed
+ - Handle paths in svn fetcher module parameter
+ - Support the syntax "export VARIABLE"
+ - Add bzr fetcher
+ - Add support for cleaning directories before a task in the form:
+ do_taskname[cleandirs] = "dir"
+ - bzr fetcher tweaks from Robert Schuster (#2913)
+ - Add mercurial (hg) fetcher from Robert Schuster (#2913)
+ - Don't add duplicates to BBPATH
+ - Fix preferred_version return values (providers.py)
+ - Fix 'depends' flag splitting
+ - Fix unexport handling (#3135)
+ - Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting)
+ - Allow multiple options for deptask flag
+ - Use git-fetch instead of git-pull removing any need for merges when
+ fetching (we don't care about the index). Fixes fetch errors.
+ - Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches
+ faster at the expense of not creating mirror tarballs.
+ - SRCREV handling updates, improvements and fixes from Poky
+ - Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky
+ - Add support for task selfstamp and lockfiles flags
+ - Disable task number acceleration since it can allow the tasks to run
+ out of sequence
+ - Improve runqueue code comments
+ - Add task scheduler abstraction and some example schedulers
+ - Improve circular dependency chain debugging code and user feedback
+ - Don't give a stacktrace for invalid tasks, have a user friendly message (#3431)
+ - Add support for "-e target" (#3432)
+ - Fix shell showdata command (#3259)
+ - Fix shell data updating problems (#1880)
+ - Properly raise errors for invalid source URI protocols
+ - Change the wget fetcher failure handling to avoid lockfile problems
+ - Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
+ - Make taskdata and runqueue errors more user friendly
+ - Add norecurse and fullpath options to cvs fetcher
+ - Fix exit code for build failures in --continue mode
+ - Fix git branch tags fetching
+ - Change parseConfigurationFile so it works on real data, not a copy
+ - Handle 'base' inherit and all other INHERITs from parseConfigurationFile
+ instead of BBHandler
+ - Fix getVarFlags bug in data_smart
+ - Optmise cache handling by more quickly detecting an invalid cache, only
+ saving the cache when its changed, moving the cache validity check into
+ the parsing loop and factoring some getVar calls outside a for loop
+ - Cooker: Remove a debug message from the parsing loop to lower overhead
+ - Convert build.py exec_task to use getVarFlags
+ - Update shell to use cooker.buildFile
+ - Add StampUpdate event
+ - Convert -b option to use taskdata/runqueue
+ - Remove digraph and switch to new stamp checking code. exec_task no longer
+ honours dependencies
+ - Make fetcher timestamp updating non-fatal when permissions don't allow
+ updates
+ - Add BB_SCHEDULER variable/option ("completion" or "speed") controlling
+ the way bitbake schedules tasks
+ - Add BB_STAMP_POLICY variable/option ("perfile" or "full") controlling
+ how extensively stamps are looked at for validity
+ - When handling build target failures make sure idepends are checked and
+ failed where needed. Fixes --continue mode crashes.
+ - Fix -f (force) in conjunction with -b
+ - Fix problems with recrdeptask handling where some idepends weren't handled
+ correctly.
+ - Handle exit codes correctly (from pH5)
+ - Work around refs/HEAD issues with git over http (#3410)
+ - Add proxy support to the CVS fetcher (from Cyril Chemparathy)
+ - Improve runfetchcmd so errors are seen and various GIT variables are exported
+ - Add ability to fetchers to check URL validity without downloading
+ - Improve runtime PREFERRED_PROVIDERS warning message
+ - Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when
+ checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist"
+ - No longer weight providers on the basis of a package being "already staged". This
+ leads to builds being non-deterministic.
+ - Flush stdout/stderr before forking to fix duplicate console output
+ - Make sure recrdeps tasks include all inter-task dependencies of a given fn
+ - Add bb.runqueue.check_stamp_fn() for use by packaged-staging
+ - Add PERSISTENT_DIR to store the PersistData in a persistent
+ directory != the cache dir.
+ - Add md5 and sha256 checksum generation functions to utils.py
+ - Correctly handle '-' characters in class names (#2958)
+ - Make sure expandKeys has been called on the data dictionary before running tasks
+ - Correctly add a task override in the form task-TASKNAME.
+ - Revert the '-' character fix in class names since it breaks things
+ - When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444)
+ - Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE.
+ - Move prunedir function to utils.py and add explode_dep_versions function
+ - Raise an exception if SRCREV == 'INVALID'
+ - Fix hg fetcher username/password handling and fix crash
+ - Fix PACKAGES_DYNAMIC handling of packages with '++' in the name
+ - Rename __depends to __base_depends after configuration parsing so we don't
+ recheck the validity of the config files time after time
+ - Add better environmental variable handling. By default it will now only pass certain
+ whitelisted variables into the data store. If BB_PRESERVE_ENV is set bitbake will use
+ all variable from the environment. If BB_ENV_WHITELIST is set, that whitelist will be
+ used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
+ to extend the internal whitelist.
+ - Perforce fetcher fix to use commandline options instead of being overriden by the environment
+ - bb.utils.prunedir can cope with symlinks to directoriees without exceptions
+ - use @rev when doing a svn checkout
+ - Add osc fetcher (from Joshua Lock in Poky)
+ - When SRCREV autorevisioning for a recipe is in use, don't cache the recipe
+ - Add tryaltconfigs option to control whether bitbake trys using alternative providers
+ to fulfil failed dependencies. It defaults to off, changing the default since this
+ behaviour confuses many users and isn't often useful.
+ - Improve lock file function error handling
+ - Add username handling to the git fetcher (Robert Bragg)
+ - Add support for HTTP_PROXY and HTTP_PROXY_IGNORE variables to the wget fetcher
+ - Export more variables to the fetcher commands to allow ssh checkouts and checkouts through
+ proxies to work better. (from Poky)
+ - Also allow user and pswd options in SRC_URIs globally (from Poky)
+ - Improve proxy handling when using mirrors (from Poky)
+ - Add bb.utils.prune_suffix function
+ - Fix hg checkouts of specific revisions (from Poky)
+ - Fix wget fetching of urls with parameters specified (from Poky)
+ - Add username handling to git fetcher (from Poky)
+ - Set HOME environmental variable when running fetcher commands (from Poky)
+ - Make sure allowed variables inherited from the environment are exported again (from Poky)
+ - When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
+ - Fix + character escaping from PACKAGES_DYNAMIC (thanks Otavio Salvador)
+ - Addition of BBCLASSEXTEND support for allowing one recipe to provide multiple targets (from Poky)
+
+Changes in Bitbake 1.8.0:
+ - Release 1.7.x as a stable series
+
+Changes in BitBake 1.7.x:
+ - Major updates of the dependency handling and execution
+ of tasks. Code from bin/bitbake replaced with runqueue.py
+ and taskdata.py
+ - New task execution code supports multithreading with a simplistic
+ threading algorithm controlled by BB_NUMBER_THREADS
+ - Change of the SVN Fetcher to keep the checkout around
+ courtsey of Paul Sokolovsky (#1367)
+ - PATH fix to bbimage (#1108)
+ - Allow debug domains to be specified on the commandline (-l)
+ - Allow 'interactive' tasks
+ - Logging message improvements
+ - Drop now uneeded BUILD_ALL_DEPS variable
+ - Add support for wildcards to -b option
+ - Major overhaul of the fetchers making a large amount of code common
+ including mirroring code
+ - Fetchers now touch md5 stamps upon access (to show activity)
+ - Fix -f force option when used without -b (long standing bug)
+ - Add expand_cache to data_cache.py, caching expanded data (speedup)
+ - Allow version field in DEPENDS (ignored for now)
+ - Add abort flag support to the shell
+ - Make inherit fail if the class doesn't exist (#1478)
+ - Fix data.emit_env() to expand keynames as well as values
+ - Add ssh fetcher
+ - Add perforce fetcher
+ - Make PREFERRED_PROVIDER_foobar defaults to foobar if available
+ - Share the parser's mtime_cache, reducing the number of stat syscalls
+ - Compile all anonfuncs at once!
+ *** Anonfuncs must now use common spacing format ***
+ - Memorise the list of handlers in __BBHANDLERS and tasks in __BBTASKS
+ This removes 2 million function calls resulting in a 5-10% speedup
+ - Add manpage
+ - Update generateDotGraph to use taskData/runQueue improving accuracy
+ and also adding a task dependency graph
+ - Fix/standardise on GPLv2 licence
+ - Move most functionality from bin/bitbake to cooker.py and split into
+ separate funcitons
+ - CVS fetcher: Added support for non-default port
+ - Add BBINCLUDELOGS_LINES, the number of lines to read from any logfile
+ - Drop shebangs from lib/bb scripts
+
+Changes in Bitbake 1.6.0:
+ - Better msg handling
+ - COW dict implementation from Tim Ansell (mithro) leading
+ to better performance
+ - Speed up of -s
+
+Changes in Bitbake 1.4.4:
+ - SRCDATE now handling courtsey Justin Patrin
+ - #1017 fix to work with rm_work
+
+Changes in BitBake 1.4.2:
+ - Send logs to oe.pastebin.com instead of pastebin.com
+ fixes #856
+ - Copy the internal bitbake data before building the
+ dependency graph. This fixes nano not having a
+ virtual/libc dependency
+ - Allow multiple TARBALL_STASH entries
+ - Cache, check if the directory exists before changing
+ into it
+ - git speedup cloning by not doing a checkout
+ - allow to have spaces in filenames (.conf, .bb, .bbclass)
+
+Changes in BitBake 1.4.0:
+ - Fix to check both RDEPENDS and RDEPENDS_${PN}
+ - Fix a RDEPENDS parsing bug in utils:explode_deps()
+ - Update git fetcher behaviour to match git changes
+ - ASSUME_PROVIDED allowed to include runtime packages
+ - git fetcher cleanup and efficency improvements
+ - Change the format of the cache
+ - Update usermanual to document the Fetchers
+ - Major changes to caching with a new strategy
+ giving a major performance increase when reparsing
+ with few data changes
+
+Changes in BitBake 1.3.3:
+ - Create a new Fetcher module to ease the
+ development of new Fetchers.
+ Issue #438 fixed by rpurdie@openedhand.com
+ - Make the Subversion fetcher honor the SRC Date
+ (CVSDATE).
+ Issue #555 fixed by chris@openedhand.com
+ - Expand PREFERRED_PROVIDER properly
+ Issue #436 fixed by rprudie@openedhand.com
+ - Typo fix for Issue #531 by Philipp Zabel for the
+ BitBake Shell
+ - Introduce a new special variable SRCDATE as
+ a generic naming to replace CVSDATE.
+ - Introduce a new keyword 'required'. In contrast
+ to 'include' parsing will fail if a to be included
+ file can not be found.
+ - Remove hardcoding of the STAMP directory. Patch
+ courtsey pHilipp Zabel
+ - Track the RDEPENDS of each package (rpurdie@openedhand.com)
+ - Introduce BUILD_ALL_DEPS to build all RDEPENDS. E.g
+ this is used by the OpenEmbedded Meta Packages.
+ (rpurdie@openedhand.com).
+
+Changes in BitBake 1.3.2:
+ - reintegration of make.py into BitBake
+ - bbread is gone, use bitbake -e
+ - lots of shell updates and bugfixes
+ - Introduction of the .= and =. operator
+ - Sort variables, keys and groups in bitdoc
+ - Fix regression in the handling of BBCOLLECTIONS
+ - Update the bitbake usermanual
+
+Changes in BitBake 1.3.0:
+ - add bitbake interactive shell (bitbake -i)
+ - refactor bitbake utility in OO style
+ - kill default arguments in methods in the bb.data module
+ - kill default arguments in methods in the bb.fetch module
+ - the http/https/ftp fetcher will fail if the to be
+ downloaded file was not found in DL_DIR (this is needed
+ to avoid unpacking the sourceforge mirror page)
+ - Switch to a cow like data instance for persistent and non
+ persisting mode (called data_smart.py)
+ - Changed the callback of bb.make.collect_bbfiles to carry
+ additional parameters
+ - Drastically reduced the amount of needed RAM by not holding
+ each data instance in memory when using a cache/persistent
+ storage
+
+Changes in BitBake 1.2.1:
+ The 1.2.1 release is meant as a intermediate release to lay the
+ ground for more radical changes. The most notable changes are:
+
+ - Do not hardcode {}, use bb.data.init() instead if you want to
+ get a instance of a data class
+ - bb.data.init() is a factory and the old bb.data methods are delegates
+ - Do not use deepcopy use bb.data.createCopy() instead.
+ - Removed default arguments in bb.fetch
+
diff --git a/poky/bitbake/HEADER b/poky/bitbake/HEADER
new file mode 100644
index 000000000..9859255df
--- /dev/null
+++ b/poky/bitbake/HEADER
@@ -0,0 +1,19 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# <one line to give the program's name and a brief idea of what it does.>
+# Copyright (C) <year> <name of author>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
diff --git a/poky/bitbake/LICENSE b/poky/bitbake/LICENSE
new file mode 100644
index 000000000..7d4e5f44b
--- /dev/null
+++ b/poky/bitbake/LICENSE
@@ -0,0 +1,19 @@
+BitBake is licensed under the GNU General Public License version 2.0. See COPYING for further details.
+
+The following external components are distributed with this software:
+
+* The Toaster Simple UI application is based upon the Django project template, the files of which are covered by the BSD license and are copyright (c) Django Software
+Foundation and individual contributors.
+
+* Twitter Bootstrap (including Glyphicons), redistributed under the MIT license
+* jQuery is redistributed under the MIT license.
+
+* Twitter typeahead.js redistributed under the MIT license. Note that the JS source has one small modification, so the full unminified file is currently included to make it obvious where this is.
+
+* jsrender is redistributed under the MIT license.
+
+* QUnit is redistributed under the MIT license.
+
+* Font Awesome fonts redistributed under the SIL Open Font License 1.1
+
+* simplediff is distributed under the zlib license.
diff --git a/poky/bitbake/README b/poky/bitbake/README
new file mode 100644
index 000000000..479c37658
--- /dev/null
+++ b/poky/bitbake/README
@@ -0,0 +1,35 @@
+Bitbake
+=======
+
+BitBake is a generic task execution engine that allows shell and Python tasks to be run
+efficiently and in parallel while working within complex inter-task dependency constraints.
+One of BitBake's main users, OpenEmbedded, takes this core and builds embedded Linux software
+stacks using a task-oriented approach.
+
+For information about Bitbake, see the OpenEmbedded website:
+ http://www.openembedded.org/
+
+Bitbake plain documentation can be found under the doc directory or its integrated
+html version at the Yocto Project website:
+ http://yoctoproject.org/documentation
+
+Contributing
+------------
+
+Please refer to
+http://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
+for guidelines on how to submit patches, just note that the latter documentation is intended
+for OpenEmbedded (and its core) not bitbake patches (bitbake-devel@lists.openembedded.org)
+but in general main guidelines apply. Once the commit(s) have been created, the way to send
+the patch is through git-send-email. For example, to send the last commit (HEAD) on current
+branch, type:
+
+ git send-email -M -1 --to bitbake-devel@lists.openembedded.org
+
+Mailing list:
+
+ http://lists.openembedded.org/mailman/listinfo/bitbake-devel
+
+Source code:
+
+ http://git.openembedded.org/bitbake/
diff --git a/poky/bitbake/bin/bitbake b/poky/bitbake/bin/bitbake
new file mode 100755
index 000000000..342cef916
--- /dev/null
+++ b/poky/bitbake/bin/bitbake
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
+ 'lib'))
+try:
+ import bb
+except RuntimeError as exc:
+ sys.exit(str(exc))
+
+from bb import cookerdata
+from bb.main import bitbake_main, BitBakeConfigParameters, BBMainException
+
+if sys.getfilesystemencoding() != "utf-8":
+ sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
+
+__version__ = "1.38.0"
+
+if __name__ == "__main__":
+ if __version__ != bb.__version__:
+ sys.exit("Bitbake core version and program version mismatch!")
+ try:
+ sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
+ cookerdata.CookerConfiguration()))
+ except BBMainException as err:
+ sys.exit(err)
+ except bb.BBHandledException:
+ sys.exit(1)
+ except Exception:
+ import traceback
+ traceback.print_exc()
+ sys.exit(1)
diff --git a/poky/bitbake/bin/bitbake-diffsigs b/poky/bitbake/bin/bitbake-diffsigs
new file mode 100755
index 000000000..4e6bbddcd
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-diffsigs
@@ -0,0 +1,183 @@
+#!/usr/bin/env python3
+
+# bitbake-diffsigs
+# BitBake task signature data comparison utility
+#
+# Copyright (C) 2012-2013, 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import warnings
+import fnmatch
+import argparse
+import logging
+import pickle
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
+
+import bb.tinfoil
+import bb.siggen
+import bb.msg
+
+logger = bb.msg.logger_create('bitbake-diffsigs')
+
+def find_siginfo(tinfoil, pn, taskname, sigs=None):
+ result = None
+ tinfoil.set_event_mask(['bb.event.FindSigInfoResult',
+ 'logging.LogRecord',
+ 'bb.command.CommandCompleted',
+ 'bb.command.CommandFailed'])
+ ret = tinfoil.run_command('findSigInfo', pn, taskname, sigs)
+ if ret:
+ while True:
+ event = tinfoil.wait_event(1)
+ if event:
+ if isinstance(event, bb.command.CommandCompleted):
+ break
+ elif isinstance(event, bb.command.CommandFailed):
+ logger.error(str(event))
+ sys.exit(2)
+ elif isinstance(event, bb.event.FindSigInfoResult):
+ result = event.result
+ elif isinstance(event, logging.LogRecord):
+ logger.handle(event)
+ else:
+ logger.error('No result returned from findSigInfo command')
+ sys.exit(2)
+ return result
+
+def find_compare_task(bbhandler, pn, taskname, sig1=None, sig2=None, color=False):
+ """ Find the most recent signature files for the specified PN/task and compare them """
+
+ if not taskname.startswith('do_'):
+ taskname = 'do_%s' % taskname
+
+ if sig1 and sig2:
+ sigfiles = find_siginfo(bbhandler, pn, taskname, [sig1, sig2])
+ if len(sigfiles) == 0:
+ logger.error('No sigdata files found matching %s %s matching either %s or %s' % (pn, taskname, sig1, sig2))
+ sys.exit(1)
+ elif not sig1 in sigfiles:
+ logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig1))
+ sys.exit(1)
+ elif not sig2 in sigfiles:
+ logger.error('No sigdata files found matching %s %s with signature %s' % (pn, taskname, sig2))
+ sys.exit(1)
+ latestfiles = [sigfiles[sig1], sigfiles[sig2]]
+ else:
+ filedates = find_siginfo(bbhandler, pn, taskname)
+ latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-3:]
+ if not latestfiles:
+ logger.error('No sigdata files found matching %s %s' % (pn, taskname))
+ sys.exit(1)
+ elif len(latestfiles) < 2:
+ logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
+ sys.exit(1)
+
+ # Define recursion callback
+ def recursecb(key, hash1, hash2):
+ hashes = [hash1, hash2]
+ hashfiles = find_siginfo(bbhandler, key, None, hashes)
+
+ recout = []
+ if len(hashfiles) == 0:
+ recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
+ elif not hash1 in hashfiles:
+ recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash1))
+ elif not hash2 in hashfiles:
+ recout.append("Unable to find matching sigdata for %s with hash %s" % (key, hash2))
+ else:
+ out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, color=color)
+ for change in out2:
+ for line in change.splitlines():
+ recout.append(' ' + line)
+
+ return recout
+
+ # Recurse into signature comparison
+ logger.debug("Signature file (previous): %s" % latestfiles[-2])
+ logger.debug("Signature file (latest): %s" % latestfiles[-1])
+ output = bb.siggen.compare_sigfiles(latestfiles[-2], latestfiles[-1], recursecb, color=color)
+ if output:
+ print('\n'.join(output))
+ sys.exit(0)
+
+
+
+parser = argparse.ArgumentParser(
+ description="Compares siginfo/sigdata files written out by BitBake")
+
+parser.add_argument('-d', '--debug',
+ help='Enable debug output',
+ action='store_true')
+
+parser.add_argument('--color',
+ help='Colorize output (where %(metavar)s is %(choices)s)',
+ choices=['auto', 'always', 'never'], default='auto', metavar='color')
+
+parser.add_argument("-t", "--task",
+ help="find the signature data files for last two runs of the specified task and compare them",
+ action="store", dest="taskargs", nargs=2, metavar=('recipename', 'taskname'))
+
+parser.add_argument("-s", "--signature",
+ help="With -t/--task, specify the signatures to look for instead of taking the last two",
+ action="store", dest="sigargs", nargs=2, metavar=('fromsig', 'tosig'))
+
+parser.add_argument("sigdatafile1",
+ help="First signature file to compare (or signature file to dump, if second not specified). Not used when using -t/--task.",
+ action="store", nargs='?')
+
+parser.add_argument("sigdatafile2",
+ help="Second signature file to compare",
+ action="store", nargs='?')
+
+
+options = parser.parse_args()
+
+if options.debug:
+ logger.setLevel(logging.DEBUG)
+
+color = (options.color == 'always' or (options.color == 'auto' and sys.stdout.isatty()))
+
+if options.taskargs:
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ if options.sigargs:
+ find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], options.sigargs[0], options.sigargs[1], color=color)
+ else:
+ find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1], color=color)
+else:
+ if options.sigargs:
+ logger.error('-s/--signature can only be used together with -t/--task')
+ sys.exit(1)
+ try:
+ if options.sigdatafile1 and options.sigdatafile2:
+ output = bb.siggen.compare_sigfiles(options.sigdatafile1, options.sigdatafile2, color=color)
+ elif options.sigdatafile1:
+ output = bb.siggen.dump_sigfile(options.sigdatafile1)
+ else:
+ logger.error('Must specify signature file(s) or -t/--task')
+ parser.print_help()
+ sys.exit(1)
+ except IOError as e:
+ logger.error(str(e))
+ sys.exit(1)
+ except (pickle.UnpicklingError, EOFError):
+ logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
+ sys.exit(1)
+
+ if output:
+ print('\n'.join(output))
diff --git a/poky/bitbake/bin/bitbake-dumpsig b/poky/bitbake/bin/bitbake-dumpsig
new file mode 100755
index 000000000..95ebd9354
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-dumpsig
@@ -0,0 +1,94 @@
+#!/usr/bin/env python3
+
+# bitbake-dumpsig
+# BitBake task signature dump utility
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import warnings
+import optparse
+import logging
+import pickle
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
+
+import bb.tinfoil
+import bb.siggen
+import bb.msg
+
+logger = bb.msg.logger_create('bitbake-dumpsig')
+
+def find_siginfo_task(bbhandler, pn, taskname):
+ """ Find the most recent signature file for the specified PN/task """
+
+ if not hasattr(bb.siggen, 'find_siginfo'):
+ logger.error('Metadata does not support finding signature data files')
+ sys.exit(1)
+
+ if not taskname.startswith('do_'):
+ taskname = 'do_%s' % taskname
+
+ filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
+ latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-1:]
+ if not latestfiles:
+ logger.error('No sigdata files found matching %s %s' % (pn, taskname))
+ sys.exit(1)
+
+ return latestfiles[0]
+
+parser = optparse.OptionParser(
+ description = "Dumps siginfo/sigdata files written out by BitBake",
+ usage = """
+ %prog -t recipename taskname
+ %prog sigdatafile""")
+
+parser.add_option("-D", "--debug",
+ help = "enable debug",
+ action = "store_true", dest="debug", default = False)
+
+parser.add_option("-t", "--task",
+ help = "find the signature data file for the specified task",
+ action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
+
+options, args = parser.parse_args(sys.argv)
+
+if options.debug:
+ logger.setLevel(logging.DEBUG)
+
+if options.taskargs:
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(config_only = True)
+ file = find_siginfo_task(tinfoil, options.taskargs[0], options.taskargs[1])
+ logger.debug("Signature file: %s" % file)
+elif len(args) == 1:
+ parser.print_help()
+ sys.exit(0)
+else:
+ file = args[1]
+
+try:
+ output = bb.siggen.dump_sigfile(file)
+except IOError as e:
+ logger.error(str(e))
+ sys.exit(1)
+except (pickle.UnpicklingError, EOFError):
+ logger.error('Invalid signature data - ensure you are specifying a sigdata/siginfo file')
+ sys.exit(1)
+
+if output:
+ print('\n'.join(output))
diff --git a/poky/bitbake/bin/bitbake-layers b/poky/bitbake/bin/bitbake-layers
new file mode 100755
index 000000000..d184011ea
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-layers
@@ -0,0 +1,110 @@
+#!/usr/bin/env python3
+
+# This script has subcommands which operate against your bitbake layers, either
+# displaying useful information, or acting against them.
+# See the help output for details on available commands.
+
+# Copyright (C) 2011 Mentor Graphics Corporation
+# Copyright (C) 2011-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import logging
+import os
+import sys
+import argparse
+import signal
+
+bindir = os.path.dirname(__file__)
+topdir = os.path.dirname(bindir)
+sys.path[0:0] = [os.path.join(topdir, 'lib')]
+
+import bb.tinfoil
+import bb.msg
+
+logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
+
+def main():
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+ parser = argparse.ArgumentParser(
+ description="BitBake layers utility",
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command",
+ add_help=False)
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+ parser.add_argument('-F', '--force', help='Force add without recipe parse verification', action='store_true')
+ parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
+
+ global_args, unparsed_args = parser.parse_known_args()
+
+ # Help is added here rather than via add_help=True, as we don't want it to
+ # be handled by parse_known_args()
+ parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
+ help='show this help message and exit')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
+
+ if global_args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif global_args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ # Need to re-run logger_create with color argument
+ # (will be the same logger since it has the same name)
+ bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color)
+
+ plugins = []
+ tinfoil = bb.tinfoil.Tinfoil(tracking=True)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ try:
+ tinfoil.prepare(True)
+ for path in ([topdir] +
+ tinfoil.config_data.getVar('BBPATH').split(':')):
+ pluginpath = os.path.join(path, 'lib', 'bblayers')
+ bb.utils.load_plugins(logger, plugins, pluginpath)
+
+ registered = False
+ for plugin in plugins:
+ if hasattr(plugin, 'register_commands'):
+ registered = True
+ plugin.register_commands(subparsers)
+ if hasattr(plugin, 'tinfoil_init'):
+ plugin.tinfoil_init(tinfoil)
+
+ if not registered:
+ logger.error("No commands registered - missing plugins?")
+ sys.exit(1)
+
+ args = parser.parse_args(unparsed_args, namespace=global_args)
+
+ if getattr(args, 'parserecipes', False):
+ tinfoil.config_data.disableTracking()
+ tinfoil.parse_recipes()
+ tinfoil.config_data.enableTracking()
+
+ return args.func(args)
+ finally:
+ tinfoil.shutdown()
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except bb.BBHandledException:
+ ret = 1
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/bitbake/bin/bitbake-prserv b/poky/bitbake/bin/bitbake-prserv
new file mode 100755
index 000000000..f38d2dd88
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-prserv
@@ -0,0 +1,55 @@
+#!/usr/bin/env python3
+import os
+import sys,logging
+import optparse
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),'lib'))
+
+import prserv
+import prserv.serv
+
+__version__="1.0.0"
+
+PRHOST_DEFAULT='0.0.0.0'
+PRPORT_DEFAULT=8585
+
+def main():
+ parser = optparse.OptionParser(
+ version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
+ usage = "%prog < --start | --stop > [options]")
+
+ parser.add_option("-f", "--file", help="database filename(default: prserv.sqlite3)", action="store",
+ dest="dbfile", type="string", default="prserv.sqlite3")
+ parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store",
+ dest="logfile", type="string", default="prserv.log")
+ parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
+ action = "store", type="string", dest="loglevel", default = "INFO")
+ parser.add_option("--start", help="start daemon",
+ action="store_true", dest="start")
+ parser.add_option("--stop", help="stop daemon",
+ action="store_true", dest="stop")
+ parser.add_option("--host", help="ip address to bind", action="store",
+ dest="host", type="string", default=PRHOST_DEFAULT)
+ parser.add_option("--port", help="port number(default: 8585)", action="store",
+ dest="port", type="int", default=PRPORT_DEFAULT)
+
+ options, args = parser.parse_args(sys.argv)
+ prserv.init_logger(os.path.abspath(options.logfile),options.loglevel)
+
+ if options.start:
+ ret=prserv.serv.start_daemon(options.dbfile, options.host, options.port,os.path.abspath(options.logfile))
+ elif options.stop:
+ ret=prserv.serv.stop_daemon(options.host, options.port)
+ else:
+ ret=parser.print_help()
+ return ret
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
+
diff --git a/poky/bitbake/bin/bitbake-selftest b/poky/bitbake/bin/bitbake-selftest
new file mode 100755
index 000000000..afe1603d0
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-selftest
@@ -0,0 +1,73 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys, logging
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib'))
+
+import unittest
+try:
+ import bb
+except RuntimeError as exc:
+ sys.exit(str(exc))
+
+tests = ["bb.tests.codeparser",
+ "bb.tests.cow",
+ "bb.tests.data",
+ "bb.tests.event",
+ "bb.tests.fetch",
+ "bb.tests.parse",
+ "bb.tests.utils"]
+
+for t in tests:
+ t = '.'.join(t.split('.')[:3])
+ __import__(t)
+
+
+# Set-up logging
+class StdoutStreamHandler(logging.StreamHandler):
+ """Special handler so that unittest is able to capture stdout"""
+ def __init__(self):
+ # Override __init__() because we don't want to set self.stream here
+ logging.Handler.__init__(self)
+
+ @property
+ def stream(self):
+ # We want to dynamically write wherever sys.stdout is pointing to
+ return sys.stdout
+
+
+handler = StdoutStreamHandler()
+bb.logger.addHandler(handler)
+bb.logger.setLevel(logging.DEBUG)
+
+
+ENV_HELP = """\
+Environment variables:
+ BB_SKIP_NETTESTS set to 'yes' in order to skip tests using network
+ connection
+ BB_TMPDIR_NOCLEAN set to 'yes' to preserve test tmp directories
+"""
+
+class main(unittest.main):
+ def _print_help(self, *args, **kwargs):
+ super(main, self)._print_help(*args, **kwargs)
+ print(ENV_HELP)
+
+
+if __name__ == '__main__':
+ main(defaultTest=tests, buffer=True)
diff --git a/poky/bitbake/bin/bitbake-worker b/poky/bitbake/bin/bitbake-worker
new file mode 100755
index 000000000..e925054b7
--- /dev/null
+++ b/poky/bitbake/bin/bitbake-worker
@@ -0,0 +1,501 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import warnings
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
+from bb import fetch2
+import logging
+import bb
+import select
+import errno
+import signal
+import pickle
+import traceback
+import queue
+from multiprocessing import Lock
+from threading import Thread
+
+if sys.getfilesystemencoding() != "utf-8":
+ sys.exit("Please use a locale setting which supports UTF-8 (such as LANG=en_US.UTF-8).\nPython can't change the filesystem locale after loading so we need a UTF-8 when Python starts or things won't work.")
+
+# Users shouldn't be running this code directly
+if len(sys.argv) != 2 or not sys.argv[1].startswith("decafbad"):
+ print("bitbake-worker is meant for internal execution by bitbake itself, please don't use it standalone.")
+ sys.exit(1)
+
+profiling = False
+if sys.argv[1].startswith("decafbadbad"):
+ profiling = True
+ try:
+ import cProfile as profile
+ except:
+ import profile
+
+# Unbuffer stdout to avoid log truncation in the event
+# of an unorderly exit as well as to provide timely
+# updates to log files for use with tail
+try:
+ if sys.stdout.name == '<stdout>':
+ import fcntl
+ fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
+ fl |= os.O_SYNC
+ fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl)
+ #sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+except:
+ pass
+
+logger = logging.getLogger("BitBake")
+
+worker_pipe = sys.stdout.fileno()
+bb.utils.nonblockingfd(worker_pipe)
+# Need to guard against multiprocessing being used in child processes
+# and multiple processes trying to write to the parent at the same time
+worker_pipe_lock = None
+
+handler = bb.event.LogHandler()
+logger.addHandler(handler)
+
+if 0:
+ # Code to write out a log file of all events passing through the worker
+ logfilename = "/tmp/workerlogfile"
+ format_str = "%(levelname)s: %(message)s"
+ conlogformat = bb.msg.BBLogFormatter(format_str)
+ consolelog = logging.FileHandler(logfilename)
+ bb.msg.addDefaultlogFilter(consolelog)
+ consolelog.setFormatter(conlogformat)
+ logger.addHandler(consolelog)
+
+worker_queue = queue.Queue()
+
+def worker_fire(event, d):
+ data = b"<event>" + pickle.dumps(event) + b"</event>"
+ worker_fire_prepickled(data)
+
+def worker_fire_prepickled(event):
+ global worker_queue
+
+ worker_queue.put(event)
+
+#
+# We can end up with write contention with the cooker, it can be trying to send commands
+# and we can be trying to send event data back. Therefore use a separate thread for writing
+# back data to cooker.
+#
+worker_thread_exit = False
+
+def worker_flush(worker_queue):
+ worker_queue_int = b""
+ global worker_pipe, worker_thread_exit
+
+ while True:
+ try:
+ worker_queue_int = worker_queue_int + worker_queue.get(True, 1)
+ except queue.Empty:
+ pass
+ while (worker_queue_int or not worker_queue.empty()):
+ try:
+ (_, ready, _) = select.select([], [worker_pipe], [], 1)
+ if not worker_queue.empty():
+ worker_queue_int = worker_queue_int + worker_queue.get()
+ written = os.write(worker_pipe, worker_queue_int)
+ worker_queue_int = worker_queue_int[written:]
+ except (IOError, OSError) as e:
+ if e.errno != errno.EAGAIN and e.errno != errno.EPIPE:
+ raise
+ if worker_thread_exit and worker_queue.empty() and not worker_queue_int:
+ return
+
+worker_thread = Thread(target=worker_flush, args=(worker_queue,))
+worker_thread.start()
+
+def worker_child_fire(event, d):
+ global worker_pipe
+ global worker_pipe_lock
+
+ data = b"<event>" + pickle.dumps(event) + b"</event>"
+ try:
+ worker_pipe_lock.acquire()
+ worker_pipe.write(data)
+ worker_pipe_lock.release()
+ except IOError:
+ sigterm_handler(None, None)
+ raise
+
+bb.event.worker_fire = worker_fire
+
+lf = None
+#lf = open("/tmp/workercommandlog", "w+")
+def workerlog_write(msg):
+ if lf:
+ lf.write(msg)
+ lf.flush()
+
+def sigterm_handler(signum, frame):
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
+ os.killpg(0, signal.SIGTERM)
+ sys.exit()
+
+def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, appends, taskdepdata, extraconfigdata, quieterrors=False, dry_run_exec=False):
+ # We need to setup the environment BEFORE the fork, since
+ # a fork() or exec*() activates PSEUDO...
+
+ envbackup = {}
+ fakeenv = {}
+ umask = None
+
+ taskdep = workerdata["taskdeps"][fn]
+ if 'umask' in taskdep and taskname in taskdep['umask']:
+ # umask might come in as a number or text string..
+ try:
+ umask = int(taskdep['umask'][taskname],8)
+ except TypeError:
+ umask = taskdep['umask'][taskname]
+
+ dry_run = cfg.dry_run or dry_run_exec
+
+ # We can't use the fakeroot environment in a dry run as it possibly hasn't been built
+ if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run:
+ envvars = (workerdata["fakerootenv"][fn] or "").split()
+ for key, value in (var.split('=') for var in envvars):
+ envbackup[key] = os.environ.get(key)
+ os.environ[key] = value
+ fakeenv[key] = value
+
+ fakedirs = (workerdata["fakerootdirs"][fn] or "").split()
+ for p in fakedirs:
+ bb.utils.mkdirhier(p)
+ logger.debug(2, 'Running %s:%s under fakeroot, fakedirs: %s' %
+ (fn, taskname, ', '.join(fakedirs)))
+ else:
+ envvars = (workerdata["fakerootnoenv"][fn] or "").split()
+ for key, value in (var.split('=') for var in envvars):
+ envbackup[key] = os.environ.get(key)
+ os.environ[key] = value
+ fakeenv[key] = value
+
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ try:
+ pipein, pipeout = os.pipe()
+ pipein = os.fdopen(pipein, 'rb', 4096)
+ pipeout = os.fdopen(pipeout, 'wb', 0)
+ pid = os.fork()
+ except OSError as e:
+ logger.critical("fork failed: %d (%s)" % (e.errno, e.strerror))
+ sys.exit(1)
+
+ if pid == 0:
+ def child():
+ global worker_pipe
+ global worker_pipe_lock
+ pipein.close()
+
+ signal.signal(signal.SIGTERM, sigterm_handler)
+ # Let SIGHUP exit as SIGTERM
+ signal.signal(signal.SIGHUP, sigterm_handler)
+ bb.utils.signal_on_parent_exit("SIGTERM")
+
+ # Save out the PID so that the event can include it the
+ # events
+ bb.event.worker_pid = os.getpid()
+ bb.event.worker_fire = worker_child_fire
+ worker_pipe = pipeout
+ worker_pipe_lock = Lock()
+
+ # Make the child the process group leader and ensure no
+ # child process will be controlled by the current terminal
+ # This ensures signals sent to the controlling terminal like Ctrl+C
+ # don't stop the child processes.
+ os.setsid()
+ # No stdin
+ newsi = os.open(os.devnull, os.O_RDWR)
+ os.dup2(newsi, sys.stdin.fileno())
+
+ if umask:
+ os.umask(umask)
+
+ try:
+ bb_cache = bb.cache.NoCache(databuilder)
+ (realfn, virtual, mc) = bb.cache.virtualfn2realfn(fn)
+ the_data = databuilder.mcdata[mc]
+ the_data.setVar("BB_WORKERCONTEXT", "1")
+ the_data.setVar("BB_TASKDEPDATA", taskdepdata)
+ if cfg.limited_deps:
+ the_data.setVar("BB_LIMITEDDEPS", "1")
+ the_data.setVar("BUILDNAME", workerdata["buildname"])
+ the_data.setVar("DATE", workerdata["date"])
+ the_data.setVar("TIME", workerdata["time"])
+ for varname, value in extraconfigdata.items():
+ the_data.setVar(varname, value)
+
+ bb.parse.siggen.set_taskdata(workerdata["sigdata"])
+ ret = 0
+
+ the_data = bb_cache.loadDataFull(fn, appends)
+ the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
+
+ bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
+
+ # exported_vars() returns a generator which *cannot* be passed to os.environ.update()
+ # successfully. We also need to unset anything from the environment which shouldn't be there
+ exports = bb.data.exported_vars(the_data)
+
+ bb.utils.empty_environment()
+ for e, v in exports:
+ os.environ[e] = v
+
+ for e in fakeenv:
+ os.environ[e] = fakeenv[e]
+ the_data.setVar(e, fakeenv[e])
+ the_data.setVarFlag(e, 'export', "1")
+
+ task_exports = the_data.getVarFlag(taskname, 'exports')
+ if task_exports:
+ for e in task_exports.split():
+ the_data.setVarFlag(e, 'export', '1')
+ v = the_data.getVar(e)
+ if v is not None:
+ os.environ[e] = v
+
+ if quieterrors:
+ the_data.setVarFlag(taskname, "quieterrors", "1")
+
+ except Exception:
+ if not quieterrors:
+ logger.critical(traceback.format_exc())
+ os._exit(1)
+ try:
+ if dry_run:
+ return 0
+ return bb.build.exec_task(fn, taskname, the_data, cfg.profile)
+ except:
+ os._exit(1)
+ if not profiling:
+ os._exit(child())
+ else:
+ profname = "profile-%s.log" % (fn.replace("/", "-") + "-" + taskname)
+ prof = profile.Profile()
+ try:
+ ret = profile.Profile.runcall(prof, child)
+ finally:
+ prof.dump_stats(profname)
+ bb.utils.process_profilelog(profname)
+ os._exit(ret)
+ else:
+ for key, value in iter(envbackup.items()):
+ if value is None:
+ del os.environ[key]
+ else:
+ os.environ[key] = value
+
+ return pid, pipein, pipeout
+
+class runQueueWorkerPipe():
+ """
+ Abstraction for a pipe between a worker thread and the worker server
+ """
+ def __init__(self, pipein, pipeout):
+ self.input = pipein
+ if pipeout:
+ pipeout.close()
+ bb.utils.nonblockingfd(self.input)
+ self.queue = b""
+
+ def read(self):
+ start = len(self.queue)
+ try:
+ self.queue = self.queue + (self.input.read(102400) or b"")
+ except (OSError, IOError) as e:
+ if e.errno != errno.EAGAIN:
+ raise
+
+ end = len(self.queue)
+ index = self.queue.find(b"</event>")
+ while index != -1:
+ worker_fire_prepickled(self.queue[:index+8])
+ self.queue = self.queue[index+8:]
+ index = self.queue.find(b"</event>")
+ return (end > start)
+
+ def close(self):
+ while self.read():
+ continue
+ if len(self.queue) > 0:
+ print("Warning, worker child left partial message: %s" % self.queue)
+ self.input.close()
+
+normalexit = False
+
+class BitbakeWorker(object):
+ def __init__(self, din):
+ self.input = din
+ bb.utils.nonblockingfd(self.input)
+ self.queue = b""
+ self.cookercfg = None
+ self.databuilder = None
+ self.data = None
+ self.extraconfigdata = None
+ self.build_pids = {}
+ self.build_pipes = {}
+
+ signal.signal(signal.SIGTERM, self.sigterm_exception)
+ # Let SIGHUP exit as SIGTERM
+ signal.signal(signal.SIGHUP, self.sigterm_exception)
+ if "beef" in sys.argv[1]:
+ bb.utils.set_process_name("Worker (Fakeroot)")
+ else:
+ bb.utils.set_process_name("Worker")
+
+ def sigterm_exception(self, signum, stackframe):
+ if signum == signal.SIGTERM:
+ bb.warn("Worker received SIGTERM, shutting down...")
+ elif signum == signal.SIGHUP:
+ bb.warn("Worker received SIGHUP, shutting down...")
+ self.handle_finishnow(None)
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
+ os.kill(os.getpid(), signal.SIGTERM)
+
+ def serve(self):
+ while True:
+ (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1)
+ if self.input in ready:
+ try:
+ r = self.input.read()
+ if len(r) == 0:
+ # EOF on pipe, server must have terminated
+ self.sigterm_exception(signal.SIGTERM, None)
+ self.queue = self.queue + r
+ except (OSError, IOError):
+ pass
+ if len(self.queue):
+ self.handle_item(b"cookerconfig", self.handle_cookercfg)
+ self.handle_item(b"extraconfigdata", self.handle_extraconfigdata)
+ self.handle_item(b"workerdata", self.handle_workerdata)
+ self.handle_item(b"runtask", self.handle_runtask)
+ self.handle_item(b"finishnow", self.handle_finishnow)
+ self.handle_item(b"ping", self.handle_ping)
+ self.handle_item(b"quit", self.handle_quit)
+
+ for pipe in self.build_pipes:
+ if self.build_pipes[pipe].input in ready:
+ self.build_pipes[pipe].read()
+ if len(self.build_pids):
+ while self.process_waitpid():
+ continue
+
+
+ def handle_item(self, item, func):
+ if self.queue.startswith(b"<" + item + b">"):
+ index = self.queue.find(b"</" + item + b">")
+ while index != -1:
+ func(self.queue[(len(item) + 2):index])
+ self.queue = self.queue[(index + len(item) + 3):]
+ index = self.queue.find(b"</" + item + b">")
+
+ def handle_cookercfg(self, data):
+ self.cookercfg = pickle.loads(data)
+ self.databuilder = bb.cookerdata.CookerDataBuilder(self.cookercfg, worker=True)
+ self.databuilder.parseBaseConfiguration()
+ self.data = self.databuilder.data
+
+ def handle_extraconfigdata(self, data):
+ self.extraconfigdata = pickle.loads(data)
+
+ def handle_workerdata(self, data):
+ self.workerdata = pickle.loads(data)
+ bb.msg.loggerDefaultDebugLevel = self.workerdata["logdefaultdebug"]
+ bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"]
+ bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"]
+ bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"]
+ for mc in self.databuilder.mcdata:
+ self.databuilder.mcdata[mc].setVar("PRSERV_HOST", self.workerdata["prhost"])
+
+ def handle_ping(self, _):
+ workerlog_write("Handling ping\n")
+
+ logger.warning("Pong from bitbake-worker!")
+
+ def handle_quit(self, data):
+ workerlog_write("Handling quit\n")
+
+ global normalexit
+ normalexit = True
+ sys.exit(0)
+
+ def handle_runtask(self, data):
+ fn, task, taskname, quieterrors, appends, taskdepdata, dry_run_exec = pickle.loads(data)
+ workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
+
+ pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.databuilder, self.workerdata, fn, task, taskname, appends, taskdepdata, self.extraconfigdata, quieterrors, dry_run_exec)
+
+ self.build_pids[pid] = task
+ self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)
+
+ def process_waitpid(self):
+ """
+ Return none is there are no processes awaiting result collection, otherwise
+ collect the process exit codes and close the information pipe.
+ """
+ try:
+ pid, status = os.waitpid(-1, os.WNOHANG)
+ if pid == 0 or os.WIFSTOPPED(status):
+ return False
+ except OSError:
+ return False
+
+ workerlog_write("Exit code of %s for pid %s\n" % (status, pid))
+
+ if os.WIFEXITED(status):
+ status = os.WEXITSTATUS(status)
+ elif os.WIFSIGNALED(status):
+ # Per shell conventions for $?, when a process exits due to
+ # a signal, we return an exit code of 128 + SIGNUM
+ status = 128 + os.WTERMSIG(status)
+
+ task = self.build_pids[pid]
+ del self.build_pids[pid]
+
+ self.build_pipes[pid].close()
+ del self.build_pipes[pid]
+
+ worker_fire_prepickled(b"<exitcode>" + pickle.dumps((task, status)) + b"</exitcode>")
+
+ return True
+
+ def handle_finishnow(self, _):
+ if self.build_pids:
+ logger.info("Sending SIGTERM to remaining %s tasks", len(self.build_pids))
+ for k, v in iter(self.build_pids.items()):
+ try:
+ os.kill(-k, signal.SIGTERM)
+ os.waitpid(-1, 0)
+ except:
+ pass
+ for pipe in self.build_pipes:
+ self.build_pipes[pipe].read()
+
+try:
+ worker = BitbakeWorker(os.fdopen(sys.stdin.fileno(), 'rb'))
+ if not profiling:
+ worker.serve()
+ else:
+ profname = "profile-worker.log"
+ prof = profile.Profile()
+ try:
+ profile.Profile.runcall(prof, worker.serve)
+ finally:
+ prof.dump_stats(profname)
+ bb.utils.process_profilelog(profname)
+except BaseException as e:
+ if not normalexit:
+ import traceback
+ sys.stderr.write(traceback.format_exc())
+ sys.stderr.write(str(e))
+
+worker_thread_exit = True
+worker_thread.join()
+
+workerlog_write("exitting")
+sys.exit(0)
diff --git a/poky/bitbake/bin/bitdoc b/poky/bitbake/bin/bitdoc
new file mode 100755
index 000000000..274467882
--- /dev/null
+++ b/poky/bitbake/bin/bitdoc
@@ -0,0 +1,531 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2005 Holger Hans Peter Freyther
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import optparse, os, sys
+
+# bitbake
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__), 'lib'))
+import bb
+import bb.parse
+from string import split, join
+
+__version__ = "0.0.2"
+
+class HTMLFormatter:
+ """
+ Simple class to help to generate some sort of HTML files. It is
+ quite inferior solution compared to docbook, gtkdoc, doxygen but it
+ should work for now.
+ We've a global introduction site (index.html) and then one site for
+ the list of keys (alphabetical sorted) and one for the list of groups,
+ one site for each key with links to the relations and groups.
+
+ index.html
+ all_keys.html
+ all_groups.html
+ groupNAME.html
+ keyNAME.html
+ """
+
+ def replace(self, text, *pairs):
+ """
+ From pydoc... almost identical at least
+ """
+ while pairs:
+ (a, b) = pairs[0]
+ text = join(split(text, a), b)
+ pairs = pairs[1:]
+ return text
+ def escape(self, text):
+ """
+ Escape string to be conform HTML
+ """
+ return self.replace(text,
+ ('&', '&amp;'),
+ ('<', '&lt;' ),
+ ('>', '&gt;' ) )
+ def createNavigator(self):
+ """
+ Create the navgiator
+ """
+ return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
+<tr valign="middle">
+<td><a accesskey="g" href="index.html">Home</a></td>
+<td><a accesskey="n" href="all_groups.html">Groups</a></td>
+<td><a accesskey="u" href="all_keys.html">Keys</a></td>
+</tr></table>
+"""
+
+ def relatedKeys(self, item):
+ """
+ Create HTML to link to foreign keys
+ """
+
+ if len(item.related()) == 0:
+ return ""
+
+ txt = "<p><b>See also:</b><br>"
+ txts = []
+ for it in item.related():
+ txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() )
+
+ return txt + ",".join(txts)
+
+ def groups(self, item):
+ """
+ Create HTML to link to related groups
+ """
+
+ if len(item.groups()) == 0:
+ return ""
+
+
+ txt = "<p><b>See also:</b><br>"
+ txts = []
+ for group in item.groups():
+ txts.append( """<a href="group%s.html">%s</a> """ % (group, group) )
+
+ return txt + ",".join(txts)
+
+
+ def createKeySite(self, item):
+ """
+ Create a site for a key. It contains the header/navigator, a heading,
+ the description, links to related keys and to the groups.
+ """
+
+ return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Key %s</title></head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+%s
+<h2><span class="refentrytitle">%s</span></h2>
+
+<div class="refsynopsisdiv">
+<h2>Synopsis</h2>
+<p>
+%s
+</p>
+</div>
+
+<div class="refsynopsisdiv">
+<h2>Related Keys</h2>
+<p>
+%s
+</p>
+</div>
+
+<div class="refsynopsisdiv">
+<h2>Groups</h2>
+<p>
+%s
+</p>
+</div>
+
+
+</body>
+""" % (item.name(), self.createNavigator(), item.name(),
+ self.escape(item.description()), self.relatedKeys(item), self.groups(item))
+
+ def createGroupsSite(self, doc):
+ """
+ Create the Group Overview site
+ """
+
+ groups = ""
+ sorted_groups = sorted(doc.groups())
+ for group in sorted_groups:
+ groups += """<a href="group%s.html">%s</a><br>""" % (group, group)
+
+ return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Group overview</title></head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+%s
+<h2>Available Groups</h2>
+%s
+</body>
+""" % (self.createNavigator(), groups)
+
+ def createIndex(self):
+ """
+ Create the index file
+ """
+
+ return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Bitbake Documentation</title></head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+%s
+<h2>Documentation Entrance</h2>
+<a href="all_groups.html">All available groups</a><br>
+<a href="all_keys.html">All available keys</a><br>
+</body>
+""" % self.createNavigator()
+
+ def createKeysSite(self, doc):
+ """
+ Create Overview of all avilable keys
+ """
+ keys = ""
+ sorted_keys = sorted(doc.doc_keys())
+ for key in sorted_keys:
+ keys += """<a href="key%s.html">%s</a><br>""" % (key, key)
+
+ return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Key overview</title></head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+%s
+<h2>Available Keys</h2>
+%s
+</body>
+""" % (self.createNavigator(), keys)
+
+ def createGroupSite(self, gr, items, _description = None):
+ """
+ Create a site for a group:
+ Group the name of the group, items contain the name of the keys
+ inside this group
+ """
+ groups = ""
+ description = ""
+
+ # create a section with the group descriptions
+ if _description:
+ description += "<h2 Description of Grozp %s</h2>" % gr
+ description += _description
+
+ items.sort(lambda x, y:cmp(x.name(), y.name()))
+ for group in items:
+ groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())
+
+ return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><title>Group %s</title></head>
+<link rel="stylesheet" href="style.css" type="text/css">
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+%s
+%s
+<div class="refsynopsisdiv">
+<h2>Keys in Group %s</h2>
+<pre class="synopsis">
+%s
+</pre>
+</div>
+</body>
+""" % (gr, self.createNavigator(), description, gr, groups)
+
+
+
+ def createCSS(self):
+ """
+ Create the CSS file
+ """
+ return """.synopsis, .classsynopsis
+{
+ background: #eeeeee;
+ border: solid 1px #aaaaaa;
+ padding: 0.5em;
+}
+.programlisting
+{
+ background: #eeeeff;
+ border: solid 1px #aaaaff;
+ padding: 0.5em;
+}
+.variablelist
+{
+ padding: 4px;
+ margin-left: 3em;
+}
+.variablelist td:first-child
+{
+ vertical-align: top;
+}
+table.navigation
+{
+ background: #ffeeee;
+ border: solid 1px #ffaaaa;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+.navigation a
+{
+ color: #770000;
+}
+.navigation a:visited
+{
+ color: #550000;
+}
+.navigation .title
+{
+ font-size: 200%;
+}
+div.refnamediv
+{
+ margin-top: 2em;
+}
+div.gallery-float
+{
+ float: left;
+ padding: 10px;
+}
+div.gallery-float img
+{
+ border-style: none;
+}
+div.gallery-spacer
+{
+ clear: both;
+}
+a
+{
+ text-decoration: none;
+}
+a:hover
+{
+ text-decoration: underline;
+ color: #FF0000;
+}
+"""
+
+
+
+class DocumentationItem:
+ """
+ A class to hold information about a configuration
+ item. It contains the key name, description, a list of related names,
+ and the group this item is contained in.
+ """
+
+ def __init__(self):
+ self._groups = []
+ self._related = []
+ self._name = ""
+ self._desc = ""
+
+ def groups(self):
+ return self._groups
+
+ def name(self):
+ return self._name
+
+ def description(self):
+ return self._desc
+
+ def related(self):
+ return self._related
+
+ def setName(self, name):
+ self._name = name
+
+ def setDescription(self, desc):
+ self._desc = desc
+
+ def addGroup(self, group):
+ self._groups.append(group)
+
+ def addRelation(self, relation):
+ self._related.append(relation)
+
+ def sort(self):
+ self._related.sort()
+ self._groups.sort()
+
+
+class Documentation:
+ """
+ Holds the documentation... with mappings from key to items...
+ """
+
+ def __init__(self):
+ self.__keys = {}
+ self.__groups = {}
+
+ def insert_doc_item(self, item):
+ """
+ Insert the Doc Item into the internal list
+ of representation
+ """
+ item.sort()
+ self.__keys[item.name()] = item
+
+ for group in item.groups():
+ if not group in self.__groups:
+ self.__groups[group] = []
+ self.__groups[group].append(item)
+ self.__groups[group].sort()
+
+
+ def doc_item(self, key):
+ """
+ Return the DocumentationInstance describing the key
+ """
+ try:
+ return self.__keys[key]
+ except KeyError:
+ return None
+
+ def doc_keys(self):
+ """
+ Return the documented KEYS (names)
+ """
+ return self.__keys.keys()
+
+ def groups(self):
+ """
+ Return the names of available groups
+ """
+ return self.__groups.keys()
+
+ def group_content(self, group_name):
+ """
+ Return a list of keys/names that are in a specefic
+ group or the empty list
+ """
+ try:
+ return self.__groups[group_name]
+ except KeyError:
+ return []
+
+
+def parse_cmdline(args):
+ """
+ Parse the CMD line and return the result as a n-tuple
+ """
+
+ parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__, __version__))
+ usage = """%prog [options]
+
+Create a set of html pages (documentation) for a bitbake.conf....
+"""
+
+ # Add the needed options
+ parser.add_option( "-c", "--config", help = "Use the specified configuration file as source",
+ action = "store", dest = "config", default = os.path.join("conf", "documentation.conf") )
+
+ parser.add_option( "-o", "--output", help = "Output directory for html files",
+ action = "store", dest = "output", default = "html/" )
+
+ parser.add_option( "-D", "--debug", help = "Increase the debug level",
+ action = "count", dest = "debug", default = 0 )
+
+ parser.add_option( "-v", "--verbose", help = "output more chit-char to the terminal",
+ action = "store_true", dest = "verbose", default = False )
+
+ options, args = parser.parse_args( sys.argv )
+
+ bb.msg.init_msgconfig(options.verbose, options.debug)
+
+ return options.config, options.output
+
+def main():
+ """
+ The main Method
+ """
+
+ (config_file, output_dir) = parse_cmdline( sys.argv )
+
+ # right to let us load the file now
+ try:
+ documentation = bb.parse.handle( config_file, bb.data.init() )
+ except IOError:
+ bb.fatal( "Unable to open %s" % config_file )
+ except bb.parse.ParseError:
+ bb.fatal( "Unable to parse %s" % config_file )
+
+ if isinstance(documentation, dict):
+ documentation = documentation[""]
+
+ # Assuming we've the file loaded now, we will initialize the 'tree'
+ doc = Documentation()
+
+ # defined states
+ state_begin = 0
+ state_see = 1
+ state_group = 2
+
+ for key in bb.data.keys(documentation):
+ data = documentation.getVarFlag(key, "doc", False)
+ if not data:
+ continue
+
+ # The Documentation now starts
+ doc_ins = DocumentationItem()
+ doc_ins.setName(key)
+
+
+ tokens = data.split(' ')
+ state = state_begin
+ string= ""
+ for token in tokens:
+ token = token.strip(',')
+
+ if not state == state_see and token == "@see":
+ state = state_see
+ continue
+ elif not state == state_group and token == "@group":
+ state = state_group
+ continue
+
+ if state == state_begin:
+ string += " %s" % token
+ elif state == state_see:
+ doc_ins.addRelation(token)
+ elif state == state_group:
+ doc_ins.addGroup(token)
+
+ # set the description
+ doc_ins.setDescription(string)
+ doc.insert_doc_item(doc_ins)
+
+ # let us create the HTML now
+ bb.utils.mkdirhier(output_dir)
+ os.chdir(output_dir)
+
+ # Let us create the sites now. We do it in the following order
+ # Start with the index.html. It will point to sites explaining all
+ # keys and groups
+ html_slave = HTMLFormatter()
+
+ f = file('style.css', 'w')
+ print >> f, html_slave.createCSS()
+
+ f = file('index.html', 'w')
+ print >> f, html_slave.createIndex()
+
+ f = file('all_groups.html', 'w')
+ print >> f, html_slave.createGroupsSite(doc)
+
+ f = file('all_keys.html', 'w')
+ print >> f, html_slave.createKeysSite(doc)
+
+ # now for each group create the site
+ for group in doc.groups():
+ f = file('group%s.html' % group, 'w')
+ print >> f, html_slave.createGroupSite(group, doc.group_content(group))
+
+ # now for the keys
+ for key in doc.doc_keys():
+ f = file('key%s.html' % doc.doc_item(key).name(), 'w')
+ print >> f, html_slave.createKeySite(doc.doc_item(key))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/bitbake/bin/git-make-shallow b/poky/bitbake/bin/git-make-shallow
new file mode 100755
index 000000000..296d3a3db
--- /dev/null
+++ b/poky/bitbake/bin/git-make-shallow
@@ -0,0 +1,165 @@
+#!/usr/bin/env python3
+"""git-make-shallow: make the current git repository shallow
+
+Remove the history of the specified revisions, then optionally filter the
+available refs to those specified.
+"""
+
+import argparse
+import collections
+import errno
+import itertools
+import os
+import subprocess
+import sys
+
+version = 1.0
+
+
+def main():
+ if sys.version_info < (3, 4, 0):
+ sys.exit('Python 3.4 or greater is required')
+
+ git_dir = check_output(['git', 'rev-parse', '--git-dir']).rstrip()
+ shallow_file = os.path.join(git_dir, 'shallow')
+ if os.path.exists(shallow_file):
+ try:
+ check_output(['git', 'fetch', '--unshallow'])
+ except subprocess.CalledProcessError:
+ try:
+ os.unlink(shallow_file)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+
+ args = process_args()
+ revs = check_output(['git', 'rev-list'] + args.revisions).splitlines()
+
+ make_shallow(shallow_file, args.revisions, args.refs)
+
+ ref_revs = check_output(['git', 'rev-list'] + args.refs).splitlines()
+ remaining_history = set(revs) & set(ref_revs)
+ for rev in remaining_history:
+ if check_output(['git', 'rev-parse', '{}^@'.format(rev)]):
+ sys.exit('Error: %s was not made shallow' % rev)
+
+ filter_refs(args.refs)
+
+ if args.shrink:
+ shrink_repo(git_dir)
+ subprocess.check_call(['git', 'fsck', '--unreachable'])
+
+
+def process_args():
+ # TODO: add argument to automatically keep local-only refs, since they
+ # can't be easily restored with a git fetch.
+ parser = argparse.ArgumentParser(description='Remove the history of the specified revisions, then optionally filter the available refs to those specified.')
+ parser.add_argument('--ref', '-r', metavar='REF', action='append', dest='refs', help='remove all but the specified refs (cumulative)')
+ parser.add_argument('--shrink', '-s', action='store_true', help='shrink the git repository by repacking and pruning')
+ parser.add_argument('revisions', metavar='REVISION', nargs='+', help='a git revision/commit')
+ if len(sys.argv) < 2:
+ parser.print_help()
+ sys.exit(2)
+
+ args = parser.parse_args()
+
+ if args.refs:
+ args.refs = check_output(['git', 'rev-parse', '--symbolic-full-name'] + args.refs).splitlines()
+ else:
+ args.refs = get_all_refs(lambda r, t, tt: t == 'commit' or tt == 'commit')
+
+ args.refs = list(filter(lambda r: not r.endswith('/HEAD'), args.refs))
+ args.revisions = check_output(['git', 'rev-parse'] + ['%s^{}' % i for i in args.revisions]).splitlines()
+ return args
+
+
+def check_output(cmd, input=None):
+ return subprocess.check_output(cmd, universal_newlines=True, input=input)
+
+
+def make_shallow(shallow_file, revisions, refs):
+ """Remove the history of the specified revisions."""
+ for rev in follow_history_intersections(revisions, refs):
+ print("Processing %s" % rev)
+ with open(shallow_file, 'a') as f:
+ f.write(rev + '\n')
+
+
+def get_all_refs(ref_filter=None):
+ """Return all the existing refs in this repository, optionally filtering the refs."""
+ ref_output = check_output(['git', 'for-each-ref', '--format=%(refname)\t%(objecttype)\t%(*objecttype)'])
+ ref_split = [tuple(iter_extend(l.rsplit('\t'), 3)) for l in ref_output.splitlines()]
+ if ref_filter:
+ ref_split = (e for e in ref_split if ref_filter(*e))
+ refs = [r[0] for r in ref_split]
+ return refs
+
+
+def iter_extend(iterable, length, obj=None):
+ """Ensure that iterable is the specified length by extending with obj."""
+ return itertools.islice(itertools.chain(iterable, itertools.repeat(obj)), length)
+
+
+def filter_refs(refs):
+ """Remove all but the specified refs from the git repository."""
+ all_refs = get_all_refs()
+ to_remove = set(all_refs) - set(refs)
+ if to_remove:
+ check_output(['xargs', '-0', '-n', '1', 'git', 'update-ref', '-d', '--no-deref'],
+ input=''.join(l + '\0' for l in to_remove))
+
+
+def follow_history_intersections(revisions, refs):
+ """Determine all the points where the history of the specified revisions intersects the specified refs."""
+ queue = collections.deque(revisions)
+ seen = set()
+
+ for rev in iter_except(queue.popleft, IndexError):
+ if rev in seen:
+ continue
+
+ parents = check_output(['git', 'rev-parse', '%s^@' % rev]).splitlines()
+
+ yield rev
+ seen.add(rev)
+
+ if not parents:
+ continue
+
+ check_refs = check_output(['git', 'merge-base', '--independent'] + sorted(refs)).splitlines()
+ for parent in parents:
+ for ref in check_refs:
+ print("Checking %s vs %s" % (parent, ref))
+ try:
+ merge_base = check_output(['git', 'merge-base', parent, ref]).rstrip()
+ except subprocess.CalledProcessError:
+ continue
+ else:
+ queue.append(merge_base)
+
+
+def iter_except(func, exception, start=None):
+ """Yield a function repeatedly until it raises an exception."""
+ try:
+ if start is not None:
+ yield start()
+ while True:
+ yield func()
+ except exception:
+ pass
+
+
+def shrink_repo(git_dir):
+ """Shrink the newly shallow repository, removing the unreachable objects."""
+ subprocess.check_call(['git', 'reflog', 'expire', '--expire-unreachable=now', '--all'])
+ subprocess.check_call(['git', 'repack', '-ad'])
+ try:
+ os.unlink(os.path.join(git_dir, 'objects', 'info', 'alternates'))
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+ subprocess.check_call(['git', 'prune', '--expire', 'now'])
+
+
+if __name__ == '__main__':
+ main()
diff --git a/poky/bitbake/bin/toaster b/poky/bitbake/bin/toaster
new file mode 100755
index 000000000..ed365ee82
--- /dev/null
+++ b/poky/bitbake/bin/toaster
@@ -0,0 +1,314 @@
+#!/bin/echo ERROR: This script needs to be sourced. Please run as .
+
+# toaster - shell script to start Toaster
+
+# Copyright (C) 2013-2015 Intel Corp.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see http://www.gnu.org/licenses/.
+
+HELP="
+Usage: source toaster start|stop [webport=<address:port>] [noweb] [nobuild]
+ Optional arguments:
+ [nobuild] Setup the environment for capturing builds with toaster but disable managed builds
+ [noweb] Setup the environment for capturing builds with toaster but don't start the web server
+ [webport] Set the development server (default: localhost:8000)
+"
+
+custom_extention()
+{
+ custom_extension=$BBBASEDIR/lib/toaster/orm/fixtures/custom_toaster_append.sh
+ if [ -f $custom_extension ] ; then
+ $custom_extension $*
+ fi
+}
+
+databaseCheck()
+{
+ retval=0
+ # you can always add a superuser later via
+ # ../bitbake/lib/toaster/manage.py createsuperuser --username=<ME>
+ $MANAGE migrate --noinput || retval=1
+
+ if [ $retval -eq 1 ]; then
+ echo "Failed migrations, aborting system start" 1>&2
+ return $retval
+ fi
+ # Make sure that checksettings can pick up any value for TEMPLATECONF
+ export TEMPLATECONF
+ $MANAGE checksettings --traceback || retval=1
+
+ if [ $retval -eq 1 ]; then
+ printf "\nError while checking settings; aborting\n"
+ return $retval
+ fi
+
+ return $retval
+}
+
+webserverKillAll()
+{
+ local pidfile
+ if [ -f ${BUILDDIR}/.toastermain.pid ] ; then
+ custom_extention web_stop_postpend
+ else
+ custom_extention noweb_stop_postpend
+ fi
+ for pidfile in ${BUILDDIR}/.toastermain.pid ${BUILDDIR}/.runbuilds.pid; do
+ if [ -f ${pidfile} ]; then
+ pid=`cat ${pidfile}`
+ while kill -0 $pid 2>/dev/null; do
+ kill -SIGTERM $pid 2>/dev/null
+ sleep 1
+ done
+ rm ${pidfile}
+ fi
+ done
+}
+
+webserverStartAll()
+{
+ # do not start if toastermain points to a valid process
+ if ! cat "${BUILDDIR}/.toastermain.pid" 2>/dev/null | xargs -I{} kill -0 {} ; then
+ retval=1
+ rm "${BUILDDIR}/.toastermain.pid"
+ fi
+
+ retval=0
+
+ # check the database
+ databaseCheck || return 1
+
+ echo "Starting webserver..."
+
+ $MANAGE runserver --noreload "$ADDR_PORT" \
+ </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 \
+ & echo $! >${BUILDDIR}/.toastermain.pid
+
+ sleep 1
+
+ if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
+ retval=1
+ rm "${BUILDDIR}/.toastermain.pid"
+ else
+ echo "Toaster development webserver started at http://$ADDR_PORT"
+ echo -e "\nYou can now run 'bitbake <target>' on the command line and monitor your build in Toaster.\nYou can also use a Toaster project to configure and run a build.\n"
+ custom_extention web_start_postpend $ADDR_PORT
+ fi
+
+ return $retval
+}
+
+INSTOPSYSTEM=0
+
+# define the stop command
+stop_system()
+{
+ # prevent reentry
+ if [ $INSTOPSYSTEM -eq 1 ]; then return; fi
+ INSTOPSYSTEM=1
+ webserverKillAll
+ # unset exported variables
+ unset TOASTER_DIR
+ unset BITBAKE_UI
+ unset BBBASEDIR
+ trap - SIGHUP
+ #trap - SIGCHLD
+ INSTOPSYSTEM=0
+}
+
+verify_prereq() {
+ # Verify Django version
+ reqfile=$(python3 -c "import os; print(os.path.realpath('$BBBASEDIR/toaster-requirements.txt'))")
+ exp='s/Django\([><=]\+\)\([^,]\+\),\([><=]\+\)\(.\+\)/'
+ # expand version parts to 2 digits to support 1.10.x > 1.8
+ # (note:helper functions hard to insert in-line)
+ exp=$exp'import sys,django;'
+ exp=$exp'version=["%02d" % int(n) for n in django.get_version().split(".")];'
+ exp=$exp'vmin=["%02d" % int(n) for n in "\2".split(".")];'
+ exp=$exp'vmax=["%02d" % int(n) for n in "\4".split(".")];'
+ exp=$exp'sys.exit(not (version \1 vmin and version \3 vmax))'
+ exp=$exp'/p'
+ if ! sed -n "$exp" $reqfile | python3 - ; then
+ req=`grep ^Django $reqfile`
+ echo "This program needs $req"
+ echo "Please install with pip3 install -r $reqfile"
+ return 2
+ fi
+
+ return 0
+}
+
+# read command line parameters
+if [ -n "$BASH_SOURCE" ] ; then
+ TOASTER=${BASH_SOURCE}
+elif [ -n "$ZSH_NAME" ] ; then
+ TOASTER=${(%):-%x}
+else
+ TOASTER=$0
+fi
+
+export BBBASEDIR=`dirname $TOASTER`/..
+MANAGE="python3 $BBBASEDIR/lib/toaster/manage.py"
+OE_ROOT=`dirname $TOASTER`/../..
+
+# this is the configuraton file we are using for toaster
+# we are using the same logic that oe-setup-builddir uses
+# (based on TEMPLATECONF and .templateconf) to determine
+# which toasterconf.json to use.
+# note: There are a number of relative path assumptions
+# in the local layers that currently make using an arbitrary
+# toasterconf.json difficult.
+
+. $OE_ROOT/.templateconf
+if [ -n "$TEMPLATECONF" ]; then
+ if [ ! -d "$TEMPLATECONF" ]; then
+ # Allow TEMPLATECONF=meta-xyz/conf as a shortcut
+ if [ -d "$OE_ROOT/$TEMPLATECONF" ]; then
+ TEMPLATECONF="$OE_ROOT/$TEMPLATECONF"
+ fi
+ fi
+fi
+
+unset OE_ROOT
+
+
+WEBSERVER=1
+export TOASTER_BUILDSERVER=1
+ADDR_PORT="localhost:8000"
+unset CMD
+for param in $*; do
+ case $param in
+ noweb )
+ WEBSERVER=0
+ ;;
+ nobuild )
+ TOASTER_BUILDSERVER=0
+ ;;
+ start )
+ CMD=$param
+ ;;
+ stop )
+ CMD=$param
+ ;;
+ webport=*)
+ ADDR_PORT="${param#*=}"
+ # Split the addr:port string
+ ADDR=`echo $ADDR_PORT | cut -f 1 -d ':'`
+ PORT=`echo $ADDR_PORT | cut -f 2 -d ':'`
+ # If only a port has been speified then set address to localhost.
+ if [ $ADDR = $PORT ] ; then
+ ADDR_PORT="localhost:$PORT"
+ fi
+ ;;
+ --help)
+ echo "$HELP"
+ return 0
+ ;;
+ *)
+ echo "$HELP"
+ return 1
+ ;;
+
+ esac
+done
+
+if [ `basename \"$0\"` = `basename \"${TOASTER}\"` ]; then
+ echo "Error: This script needs to be sourced. Please run as . $TOASTER"
+ return 1
+fi
+
+verify_prereq || return 1
+
+# We make sure we're running in the current shell and in a good environment
+if [ -z "$BUILDDIR" ] || ! which bitbake >/dev/null 2>&1 ; then
+ echo "Error: Build environment is not setup or bitbake is not in path." 1>&2
+ return 2
+fi
+
+# this defines the dir toaster will use for
+# 1) clones of layers (in _toaster_clones )
+# 2) the build dir (in build)
+# 3) the sqlite db if that is being used.
+# 4) pid's we need to clean up on exit/shutdown
+export TOASTER_DIR=`dirname $BUILDDIR`
+export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE TOASTER_DIR"
+
+# Determine the action. If specified by arguments, fine, if not, toggle it
+if [ "$CMD" = "start" ] ; then
+ if [ -n "$BBSERVER" ]; then
+ echo " Toaster is already running. Exiting..."
+ return 1
+fi
+elif [ "$CMD" = "" ]; then
+ echo "No command specified"
+ echo "$HELP"
+ return 1
+fi
+
+echo "The system will $CMD."
+
+# Execute the commands
+custom_extention toaster_prepend $CMD $ADDR_PORT
+
+case $CMD in
+ start )
+ # check if addr:port is not in use
+ if [ "$CMD" == 'start' ]; then
+ if [ $WEBSERVER -gt 0 ]; then
+ $MANAGE checksocket "$ADDR_PORT" || return 1
+ fi
+ fi
+
+ # Create configuration file
+ conf=${BUILDDIR}/conf/local.conf
+ line='INHERIT+="toaster buildhistory"'
+ grep -q "$line" $conf || echo $line >> $conf
+
+ if [ $WEBSERVER -eq 0 ] ; then
+ # Do not update the database for "noweb" unless
+ # it does not yet exist
+ if [ ! -f "$TOASTER_DIR/toaster.sqlite" ] ; then
+ if ! databaseCheck; then
+ echo "Failed ${CMD}."
+ return 4
+ fi
+ fi
+ custom_extention noweb_start_postpend $ADDR_PORT
+ fi
+ if [ $WEBSERVER -gt 0 ] && ! webserverStartAll; then
+ echo "Failed ${CMD}."
+ return 4
+ fi
+ export BITBAKE_UI='toasterui'
+ if [ $TOASTER_BUILDSERVER -eq 1 ] ; then
+ $MANAGE runbuilds \
+ </dev/null >>${BUILDDIR}/toaster_runbuilds.log 2>&1 \
+ & echo $! >${BUILDDIR}/.runbuilds.pid
+ else
+ echo "Toaster build server not started."
+ fi
+
+ # set fail safe stop system on terminal exit
+ trap stop_system SIGHUP
+ echo "Successful ${CMD}."
+ custom_extention toaster_postpend $CMD $ADDR_PORT
+ return 0
+ ;;
+ stop )
+ stop_system
+ echo "Successful ${CMD}."
+ ;;
+esac
+custom_extention toaster_postpend $CMD $ADDR_PORT
+
diff --git a/poky/bitbake/bin/toaster-eventreplay b/poky/bitbake/bin/toaster-eventreplay
new file mode 100755
index 000000000..80967a093
--- /dev/null
+++ b/poky/bitbake/bin/toaster-eventreplay
@@ -0,0 +1,126 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2014 Alex Damian
+#
+# This file re-uses code spread throughout other Bitbake source files.
+# As such, all other copyrights belong to their own right holders.
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+This command takes a filename as a single parameter. The filename is read
+as a build eventlog, and the ToasterUI is used to process events in the file
+and log data in the database
+"""
+
+import os
+import sys
+import json
+import pickle
+import codecs
+
+from collections import namedtuple
+
+# mangle syspath to allow easy import of modules
+from os.path import join, dirname, abspath
+sys.path.insert(0, join(dirname(dirname(abspath(__file__))), 'lib'))
+
+import bb.cooker
+from bb.ui import toasterui
+
+class EventPlayer:
+ """Emulate a connection to a bitbake server."""
+
+ def __init__(self, eventfile, variables):
+ self.eventfile = eventfile
+ self.variables = variables
+ self.eventmask = []
+
+ def waitEvent(self, _timeout):
+ """Read event from the file."""
+ line = self.eventfile.readline().strip()
+ if not line:
+ return
+ try:
+ event_str = json.loads(line)['vars'].encode('utf-8')
+ event = pickle.loads(codecs.decode(event_str, 'base64'))
+ event_name = "%s.%s" % (event.__module__, event.__class__.__name__)
+ if event_name not in self.eventmask:
+ return
+ return event
+ except ValueError as err:
+ print("Failed loading ", line)
+ raise err
+
+ def runCommand(self, command_line):
+ """Emulate running a command on the server."""
+ name = command_line[0]
+
+ if name == "getVariable":
+ var_name = command_line[1]
+ variable = self.variables.get(var_name)
+ if variable:
+ return variable['v'], None
+ return None, "Missing variable %s" % var_name
+
+ elif name == "getAllKeysWithFlags":
+ dump = {}
+ flaglist = command_line[1]
+ for key, val in self.variables.items():
+ try:
+ if not key.startswith("__"):
+ dump[key] = {
+ 'v': val['v'],
+ 'history' : val['history'],
+ }
+ for flag in flaglist:
+ dump[key][flag] = val[flag]
+ except Exception as err:
+ print(err)
+ return (dump, None)
+
+ elif name == 'setEventMask':
+ self.eventmask = command_line[-1]
+ return True, None
+
+ else:
+ raise Exception("Command %s not implemented" % command_line[0])
+
+ def getEventHandle(self):
+ """
+ This method is called by toasterui.
+ The return value is passed to self.runCommand but not used there.
+ """
+ pass
+
+def main(argv):
+ with open(argv[-1]) as eventfile:
+ # load variables from the first line
+ variables = json.loads(eventfile.readline().strip())['allvariables']
+
+ params = namedtuple('ConfigParams', ['observe_only'])(True)
+ player = EventPlayer(eventfile, variables)
+
+ return toasterui.main(player, player, params)
+
+# run toaster ui on our mock bitbake class
+if __name__ == "__main__":
+ if len(sys.argv) != 2:
+ print("Usage: %s <event file>" % os.path.basename(sys.argv[0]))
+ sys.exit(1)
+
+ sys.exit(main(sys.argv))
diff --git a/poky/bitbake/contrib/README b/poky/bitbake/contrib/README
new file mode 100644
index 000000000..25e515661
--- /dev/null
+++ b/poky/bitbake/contrib/README
@@ -0,0 +1 @@
+This directory is for additional contributed files which may be useful.
diff --git a/poky/bitbake/contrib/bbdev.sh b/poky/bitbake/contrib/bbdev.sh
new file mode 100644
index 000000000..33a78531e
--- /dev/null
+++ b/poky/bitbake/contrib/bbdev.sh
@@ -0,0 +1,31 @@
+# This is a shell function to be sourced into your shell or placed in your .profile,
+# which makes setting things up for BitBake a bit easier.
+#
+# The author disclaims copyright to the contents of this file and places it in the
+# public domain.
+
+bbdev () {
+ local BBDIR PKGDIR BUILDDIR
+ if test x"$1" = "x--help"; then echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"; return 1; fi
+ if test x"$1" = x; then BBDIR=`pwd`; else BBDIR=$1; fi
+ if test x"$2" = x; then PKGDIR=`pwd`; else PKGDIR=$2; fi
+ if test x"$3" = x; then BUILDDIR=`pwd`; else BUILDDIR=$3; fi
+
+ BBDIR=`readlink -f $BBDIR`
+ PKGDIR=`readlink -f $PKGDIR`
+ BUILDDIR=`readlink -f $BUILDDIR`
+ if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then
+ echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"
+ return 1
+ fi
+
+ PATH=$BBDIR/bin:$PATH
+ BBPATH=$BBDIR
+ if test x"$BBDIR" != x"$PKGDIR"; then
+ BBPATH=$PKGDIR:$BBPATH
+ fi
+ if test x"$PKGDIR" != x"$BUILDDIR"; then
+ BBPATH=$BUILDDIR:$BBPATH
+ fi
+ export BBPATH
+}
diff --git a/poky/bitbake/contrib/dump_cache.py b/poky/bitbake/contrib/dump_cache.py
new file mode 100755
index 000000000..8963ca4b0
--- /dev/null
+++ b/poky/bitbake/contrib/dump_cache.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2012, 2018 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+#
+# Used for dumping the bb_cache.dat
+#
+import os
+import sys
+import argparse
+
+# For importing bb.cache
+sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '../lib'))
+from bb.cache import CoreRecipeInfo
+
+import pickle
+
+class DumpCache(object):
+ def __init__(self):
+ parser = argparse.ArgumentParser(
+ description="bb_cache.dat's dumper",
+ epilog="Use %(prog)s --help to get help")
+ parser.add_argument("-r", "--recipe",
+ help="specify the recipe, default: all recipes", action="store")
+ parser.add_argument("-m", "--members",
+ help = "specify the member, use comma as separator for multiple ones, default: all members", action="store", default="")
+ parser.add_argument("-s", "--skip",
+ help = "skip skipped recipes", action="store_true")
+ parser.add_argument("cachefile",
+ help = "specify bb_cache.dat", nargs = 1, action="store", default="")
+
+ self.args = parser.parse_args()
+
+ def main(self):
+ with open(self.args.cachefile[0], "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ while True:
+ try:
+ key = pickled.load()
+ val = pickled.load()
+ except Exception:
+ break
+ if isinstance(val, CoreRecipeInfo):
+ pn = val.pn
+
+ if self.args.recipe and self.args.recipe != pn:
+ continue
+
+ if self.args.skip and val.skipped:
+ continue
+
+ if self.args.members:
+ out = key
+ for member in self.args.members.split(','):
+ out += ": %s" % val.__dict__.get(member)
+ print("%s" % out)
+ else:
+ print("%s: %s" % (key, val.__dict__))
+ elif not self.args.recipe:
+ print("%s %s" % (key, val))
+
+if __name__ == "__main__":
+ try:
+ dump = DumpCache()
+ ret = dump.main()
+ except Exception as esc:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/bitbake/contrib/vim/ftdetect/bitbake.vim b/poky/bitbake/contrib/vim/ftdetect/bitbake.vim
new file mode 100644
index 000000000..200f8ae49
--- /dev/null
+++ b/poky/bitbake/contrib/vim/ftdetect/bitbake.vim
@@ -0,0 +1,24 @@
+" Vim filetype detection file
+" Language: BitBake
+" Author: Ricardo Salveti <rsalveti@rsalveti.net>
+" Copyright: Copyright (C) 2008 Ricardo Salveti <rsalveti@rsalveti.net>
+" Licence: You may redistribute this under the same terms as Vim itself
+"
+" This sets up the syntax highlighting for BitBake files, like .bb, .bbclass and .inc
+
+if &compatible || version < 600
+ finish
+endif
+
+" .bb, .bbappend and .bbclass
+au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake
+
+" .inc
+au BufNewFile,BufRead *.inc set filetype=bitbake
+
+" .conf
+au BufNewFile,BufRead *.conf
+ \ if (match(expand("%:p:h"), "conf") > 0) |
+ \ set filetype=bitbake |
+ \ endif
+
diff --git a/poky/bitbake/contrib/vim/ftplugin/bitbake.vim b/poky/bitbake/contrib/vim/ftplugin/bitbake.vim
new file mode 100644
index 000000000..db0d75319
--- /dev/null
+++ b/poky/bitbake/contrib/vim/ftplugin/bitbake.vim
@@ -0,0 +1,2 @@
+set sts=4 sw=4 et
+set cms=#%s
diff --git a/poky/bitbake/contrib/vim/plugin/newbb.vim b/poky/bitbake/contrib/vim/plugin/newbb.vim
new file mode 100755
index 000000000..874e33805
--- /dev/null
+++ b/poky/bitbake/contrib/vim/plugin/newbb.vim
@@ -0,0 +1,84 @@
+" Vim plugin file
+" Purpose: Create a template for new bb files
+" Author: Ricardo Salveti <rsalveti@gmail.com>
+" Copyright: Copyright (C) 2008 Ricardo Salveti <rsalveti@gmail.com>
+"
+" This file is licensed under the MIT license, see COPYING.MIT in
+" this source distribution for the terms.
+"
+" Based on the gentoo-syntax package
+"
+" Will try to use git to find the user name and email
+
+if &compatible || v:version < 600
+ finish
+endif
+
+fun! <SID>GetUserName()
+ let l:user_name = system("git config --get user.name")
+ if v:shell_error
+ return "Unknown User"
+ else
+ return substitute(l:user_name, "\n", "", "")
+endfun
+
+fun! <SID>GetUserEmail()
+ let l:user_email = system("git config --get user.email")
+ if v:shell_error
+ return "unknow@user.org"
+ else
+ return substitute(l:user_email, "\n", "", "")
+endfun
+
+fun! BBHeader()
+ let l:current_year = strftime("%Y")
+ let l:user_name = <SID>GetUserName()
+ let l:user_email = <SID>GetUserEmail()
+ 0 put ='# Copyright (C) ' . l:current_year .
+ \ ' ' . l:user_name . ' <' . l:user_email . '>'
+ put ='# Released under the MIT license (see COPYING.MIT for the terms)'
+ $
+endfun
+
+fun! NewBBTemplate()
+ let l:paste = &paste
+ set nopaste
+
+ " Get the header
+ call BBHeader()
+
+ " New the bb template
+ put ='DESCRIPTION = \"\"'
+ put ='HOMEPAGE = \"\"'
+ put ='LICENSE = \"\"'
+ put ='SECTION = \"\"'
+ put ='DEPENDS = \"\"'
+ put =''
+ put ='SRC_URI = \"\"'
+
+ " Go to the first place to edit
+ 0
+ /^DESCRIPTION =/
+ exec "normal 2f\""
+
+ if paste == 1
+ set paste
+ endif
+endfun
+
+if !exists("g:bb_create_on_empty")
+ let g:bb_create_on_empty = 1
+endif
+
+" disable in case of vimdiff
+if v:progname =~ "vimdiff"
+ let g:bb_create_on_empty = 0
+endif
+
+augroup NewBB
+ au BufNewFile *.bb
+ \ if g:bb_create_on_empty |
+ \ call NewBBTemplate() |
+ \ endif
+augroup END
+
diff --git a/poky/bitbake/contrib/vim/syntax/bitbake.vim b/poky/bitbake/contrib/vim/syntax/bitbake.vim
new file mode 100644
index 000000000..fb55f9102
--- /dev/null
+++ b/poky/bitbake/contrib/vim/syntax/bitbake.vim
@@ -0,0 +1,126 @@
+" Vim syntax file
+" Language: BitBake bb/bbclasses/inc
+" Author: Chris Larson <kergoth@handhelds.org>
+" Ricardo Salveti <rsalveti@rsalveti.net>
+" Copyright: Copyright (C) 2004 Chris Larson <kergoth@handhelds.org>
+" Copyright (C) 2008 Ricardo Salveti <rsalveti@rsalveti.net>
+"
+" This file is licensed under the MIT license, see COPYING.MIT in
+" this source distribution for the terms.
+"
+" Syntax highlighting for bb, bbclasses and inc files.
+"
+" It's an entirely new type, just has specific syntax in shell and python code
+
+if &compatible || v:version < 600
+ finish
+endif
+if exists("b:current_syntax")
+ finish
+endif
+
+syn include @python syntax/python.vim
+if exists("b:current_syntax")
+ unlet b:current_syntax
+endif
+
+" BitBake syntax
+
+" Matching case
+syn case match
+
+" Indicates the error when nothing is matched
+syn match bbUnmatched "."
+
+" Comments
+syn cluster bbCommentGroup contains=bbTodo,@Spell
+syn keyword bbTodo COMBAK FIXME TODO XXX contained
+syn match bbComment "#.*$" contains=@bbCommentGroup
+
+" String helpers
+syn match bbQuote +['"]+ contained
+syn match bbDelimiter "[(){}=]" contained
+syn match bbArrayBrackets "[\[\]]" contained
+
+" BitBake strings
+syn match bbContinue "\\$"
+syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ end=+"+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
+syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ end=+'+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
+
+" Vars definition
+syn match bbExport "^export" nextgroup=bbIdentifier skipwhite
+syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
+syn match bbIdentifier "[a-zA-Z0-9\-_\.\/\+]\+" display contained
+syn match bbVarDeref "${[a-zA-Z0-9\-_\.\/\+]\+}" contained
+syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)" contained nextgroup=bbVarValue
+syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
+syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue
+syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
+
+" Vars metadata flags
+syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
+syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
+
+" Includes and requires
+syn keyword bbInclude inherit include require contained
+syn match bbIncludeRest ".*$" contained contains=bbString,bbVarDeref
+syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
+
+" Add taks and similar
+syn keyword bbStatement addtask addhandler after before EXPORT_FUNCTIONS contained
+syn match bbStatementRest ".*$" skipwhite contained contains=bbStatement
+syn match bbStatementLine "^\(addtask\|addhandler\|after\|before\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
+
+" OE Important Functions
+syn keyword bbOEFunctions do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
+
+" Generic Functions
+syn match bbFunction "\h[0-9A-Za-z_-]*" display contained contains=bbOEFunctions
+
+" BitBake shell metadata
+syn include @shell syntax/sh.vim
+if exists("b:current_syntax")
+ unlet b:current_syntax
+endif
+syn keyword bbShFakeRootFlag fakeroot contained
+syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_${}-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
+syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
+
+" Python value inside shell functions
+syn region shDeref start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python
+
+" BitBake python metadata
+syn keyword bbPyFlag python contained
+syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_${}-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
+syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
+
+" BitBake 'def'd python functions
+syn keyword bbPyDef def contained
+syn region bbPyDefRegion start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
+
+" Highlighting Definitions
+hi def link bbUnmatched Error
+hi def link bbInclude Include
+hi def link bbTodo Todo
+hi def link bbComment Comment
+hi def link bbQuote String
+hi def link bbString String
+hi def link bbDelimiter Keyword
+hi def link bbArrayBrackets Statement
+hi def link bbContinue Special
+hi def link bbExport Type
+hi def link bbExportFlag Type
+hi def link bbIdentifier Identifier
+hi def link bbVarDeref PreProc
+hi def link bbVarDef Identifier
+hi def link bbVarValue String
+hi def link bbShFakeRootFlag Type
+hi def link bbFunction Function
+hi def link bbPyFlag Type
+hi def link bbPyDef Statement
+hi def link bbStatement Statement
+hi def link bbStatementRest Identifier
+hi def link bbOEFunctions Special
+hi def link bbVarPyValue PreProc
+
+let b:current_syntax = "bb"
diff --git a/poky/bitbake/doc/COPYING.GPL b/poky/bitbake/doc/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/poky/bitbake/doc/COPYING.GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/poky/bitbake/doc/COPYING.MIT b/poky/bitbake/doc/COPYING.MIT
new file mode 100644
index 000000000..7e7d57413
--- /dev/null
+++ b/poky/bitbake/doc/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/poky/bitbake/doc/Makefile b/poky/bitbake/doc/Makefile
new file mode 100644
index 000000000..3c28f4b22
--- /dev/null
+++ b/poky/bitbake/doc/Makefile
@@ -0,0 +1,91 @@
+# This is a single Makefile to handle all generated BitBake documents.
+# The Makefile needs to live in the documentation directory and all figures used
+# in any manuals must be .PNG files and live in the individual book's figures
+# directory.
+#
+# The Makefile has these targets:
+#
+# pdf: generates a PDF version of a manual.
+# html: generates an HTML version of a manual.
+# tarball: creates a tarball for the doc files.
+# validate: validates
+# clean: removes files
+#
+# The Makefile generates an HTML version of every document. The
+# variable DOC indicates the folder name for a given manual.
+#
+# To build a manual, you must invoke 'make' with the DOC argument.
+#
+# Examples:
+#
+# make DOC=bitbake-user-manual
+# make pdf DOC=bitbake-user-manual
+#
+# The first example generates the HTML version of the User Manual.
+# The second example generates the PDF version of the User Manual.
+#
+
+ifeq ($(DOC),bitbake-user-manual)
+XSLTOPTS = --stringparam html.stylesheet bitbake-user-manual-style.css \
+ --stringparam chapter.autolabel 1 \
+ --stringparam section.autolabel 1 \
+ --stringparam section.label.includes.component.label 1 \
+ --xinclude
+ALLPREQ = html tarball
+TARFILES = bitbake-user-manual-style.css bitbake-user-manual.html figures/bitbake-title.png
+MANUALS = $(DOC)/$(DOC).html
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+##
+# These URI should be rewritten by your distribution's xml catalog to
+# match your localy installed XSL stylesheets.
+XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/current
+XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
+
+all: $(ALLPREQ)
+
+pdf:
+ifeq ($(DOC),bitbake-user-manual)
+ @echo " "
+ @echo "********** Building."$(DOC)
+ @echo " "
+ cd $(DOC); ../tools/docbook-to-pdf $(DOC).xml ../template; cd ..
+endif
+
+html:
+ifeq ($(DOC),bitbake-user-manual)
+# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
+ @echo " "
+ @echo "******** Building "$(DOC)
+ @echo " "
+ cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
+endif
+
+tarball: html
+ @echo " "
+ @echo "******** Creating Tarball of document files"
+ @echo " "
+ cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
+
+validate:
+ cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
+
+publish:
+ @if test -f $(DOC)/$(DOC).html; \
+ then \
+ echo " "; \
+ echo "******** Publishing "$(DOC)".html"; \
+ echo " "; \
+ scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
+ cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
+ else \
+ echo " "; \
+ echo $(DOC)".html missing. Generate the file first then try again."; \
+ echo " "; \
+ fi
+
+clean:
+ rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;
diff --git a/poky/bitbake/doc/README b/poky/bitbake/doc/README
new file mode 100644
index 000000000..303cf8eec
--- /dev/null
+++ b/poky/bitbake/doc/README
@@ -0,0 +1,39 @@
+Documentation
+=============
+
+This is the directory that contains the BitBake documentation.
+
+Manual Organization
+===================
+
+Folders exist for individual manuals as follows:
+
+* bitbake-user-manual - The BitBake User Manual
+
+Each folder is self-contained regarding content and figures.
+
+If you want to find HTML versions of the BitBake manuals on the web,
+go to http://www.openembedded.org/wiki/Documentation.
+
+Makefile
+========
+
+The Makefile processes manual directories to create HTML, PDF,
+tarballs, etc. Details on how the Makefile work are documented
+inside the Makefile. See that file for more information.
+
+To build a manual, you run the make command and pass it the name
+of the folder containing the manual's contents.
+For example, the following command run from the documentation directory
+creates an HTML and a PDF version of the BitBake User Manual.
+The DOC variable specifies the manual you are making:
+
+ $ make DOC=bitbake-user-manual
+
+template
+========
+Contains various templates, fonts, and some old PNG files.
+
+tools
+=====
+Contains a tool to convert the DocBook files to PDF format.
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
new file mode 100644
index 000000000..5985ea783
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl
@@ -0,0 +1,29 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+ <xsl:include href="../template/gloss-permalinks.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'user-manual-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+
+<!-- <xsl:param name="generate.toc" select="'article nop'"></xsl:param> -->
+
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
new file mode 100644
index 000000000..f1caaecd2
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml
@@ -0,0 +1,932 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<chapter id="bitbake-user-manual-execution">
+ <title>Execution</title>
+
+ <para>
+ The primary purpose for running BitBake is to produce some kind
+ of output such as a single installable package, a kernel, a software
+ development kit, or even a full, board-specific bootable Linux image,
+ complete with bootloader, kernel, and root filesystem.
+ Of course, you can execute the <filename>bitbake</filename>
+ command with options that cause it to execute single tasks,
+ compile single recipe files, capture or clear data, or simply
+ return information about the execution environment.
+ </para>
+
+ <para>
+ This chapter describes BitBake's execution process from start
+ to finish when you use it to create an image.
+ The execution process is launched using the following command
+ form:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>target</replaceable>
+ </literallayout>
+ For information on the BitBake command and its options,
+ see
+ "<link linkend='bitbake-user-manual-command'>The BitBake Command</link>"
+ section.
+ <note>
+ <para>
+ Prior to executing BitBake, you should take advantage of available
+ parallel thread execution on your build host by setting the
+ <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
+ variable in your project's <filename>local.conf</filename>
+ configuration file.
+ </para>
+
+ <para>
+ A common method to determine this value for your build host is to run
+ the following:
+ <literallayout class='monospaced'>
+ $ grep processor /proc/cpuinfo
+ </literallayout>
+ This command returns the number of processors, which takes into
+ account hyper-threading.
+ Thus, a quad-core build host with hyper-threading most likely
+ shows eight processors, which is the value you would then assign to
+ <filename>BB_NUMBER_THREADS</filename>.
+ </para>
+
+ <para>
+ A possibly simpler solution is that some Linux distributions
+ (e.g. Debian and Ubuntu) provide the <filename>ncpus</filename> command.
+ </para>
+ </note>
+ </para>
+
+ <section id='parsing-the-base-configuration-metadata'>
+ <title>Parsing the Base Configuration Metadata</title>
+
+ <para>
+ The first thing BitBake does is parse base configuration
+ metadata.
+ Base configuration metadata consists of your project's
+ <filename>bblayers.conf</filename> file to determine what
+ layers BitBake needs to recognize, all necessary
+ <filename>layer.conf</filename> files (one from each layer),
+ and <filename>bitbake.conf</filename>.
+ The data itself is of various types:
+ <itemizedlist>
+ <listitem><para><emphasis>Recipes:</emphasis>
+ Details about particular pieces of software.
+ </para></listitem>
+ <listitem><para><emphasis>Class Data:</emphasis>
+ An abstraction of common build information
+ (e.g. how to build a Linux kernel).
+ </para></listitem>
+ <listitem><para><emphasis>Configuration Data:</emphasis>
+ Machine-specific settings, policy decisions,
+ and so forth.
+ Configuration data acts as the glue to bind everything
+ together.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The <filename>layer.conf</filename> files are used to
+ construct key variables such as
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ and
+ <link linkend='var-BBFILES'><filename>BBFILES</filename></link>.
+ <filename>BBPATH</filename> is used to search for
+ configuration and class files under the
+ <filename>conf</filename> and <filename>classes</filename>
+ directories, respectively.
+ <filename>BBFILES</filename> is used to locate both recipe
+ and recipe append files
+ (<filename>.bb</filename> and <filename>.bbappend</filename>).
+ If there is no <filename>bblayers.conf</filename> file,
+ it is assumed the user has set the <filename>BBPATH</filename>
+ and <filename>BBFILES</filename> directly in the environment.
+ </para>
+
+ <para>
+ Next, the <filename>bitbake.conf</filename> file is located
+ using the <filename>BBPATH</filename> variable that was
+ just constructed.
+ The <filename>bitbake.conf</filename> file may also include other
+ configuration files using the
+ <filename>include</filename> or
+ <filename>require</filename> directives.
+ </para>
+
+ <para>
+ Prior to parsing configuration files, Bitbake looks
+ at certain variables, including:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-BB_ENV_WHITELIST'><filename>BB_ENV_WHITELIST</filename></link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_ENV_EXTRAWHITE'><filename>BB_ENV_EXTRAWHITE</filename></link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_PRESERVE_ENV'><filename>BB_PRESERVE_ENV</filename></link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_ORIGENV'><filename>BB_ORIGENV</filename></link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BITBAKE_UI'><filename>BITBAKE_UI</filename></link>
+ </para></listitem>
+ </itemizedlist>
+ The first four variables in this list relate to how BitBake treats shell
+ environment variables during task execution.
+ By default, BitBake cleans the environment variables and provides tight
+ control over the shell execution environment.
+ However, through the use of these first four variables, you can
+ apply your control regarding the
+ environment variables allowed to be used by BitBake in the shell
+ during execution of tasks.
+ See the
+ "<link linkend='passing-information-into-the-build-task-environment'>Passing Information Into the Build Task Environment</link>"
+ section and the information about these variables in the
+ variable glossary for more information on how they work and
+ on how to use them.
+ </para>
+
+ <para>
+ The base configuration metadata is global
+ and therefore affects all recipes and tasks that are executed.
+ </para>
+
+ <para>
+ BitBake first searches the current working directory for an
+ optional <filename>conf/bblayers.conf</filename> configuration file.
+ This file is expected to contain a
+ <link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
+ variable that is a space-delimited list of 'layer' directories.
+ Recall that if BitBake cannot find a <filename>bblayers.conf</filename>
+ file, then it is assumed the user has set the <filename>BBPATH</filename>
+ and <filename>BBFILES</filename> variables directly in the environment.
+ </para>
+
+ <para>
+ For each directory (layer) in this list, a <filename>conf/layer.conf</filename>
+ file is located and parsed with the
+ <link linkend='var-LAYERDIR'><filename>LAYERDIR</filename></link>
+ variable being set to the directory where the layer was found.
+ The idea is these files automatically set up
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ and other variables correctly for a given build directory.
+ </para>
+
+ <para>
+ BitBake then expects to find the <filename>conf/bitbake.conf</filename>
+ file somewhere in the user-specified <filename>BBPATH</filename>.
+ That configuration file generally has include directives to pull
+ in any other metadata such as files specific to the architecture,
+ the machine, the local environment, and so forth.
+ </para>
+
+ <para>
+ Only variable definitions and include directives are allowed
+ in BitBake <filename>.conf</filename> files.
+ Some variables directly influence BitBake's behavior.
+ These variables might have been set from the environment
+ depending on the environment variables previously
+ mentioned or set in the configuration files.
+ The
+ "<link linkend='ref-variables-glos'>Variables Glossary</link>"
+ chapter presents a full list of variables.
+ </para>
+
+ <para>
+ After parsing configuration files, BitBake uses its rudimentary
+ inheritance mechanism, which is through class files, to inherit
+ some standard classes.
+ BitBake parses a class when the inherit directive responsible
+ for getting that class is encountered.
+ </para>
+
+ <para>
+ The <filename>base.bbclass</filename> file is always included.
+ Other classes that are specified in the configuration using the
+ <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
+ variable are also included.
+ BitBake searches for class files in a
+ <filename>classes</filename> subdirectory under
+ the paths in <filename>BBPATH</filename> in the same way as
+ configuration files.
+ </para>
+
+ <para>
+ A good way to get an idea of the configuration files and
+ the class files used in your execution environment is to
+ run the following BitBake command:
+ <literallayout class='monospaced'>
+ $ bitbake -e > mybb.log
+ </literallayout>
+ Examining the top of the <filename>mybb.log</filename>
+ shows you the many configuration files and class files
+ used in your execution environment.
+ </para>
+
+ <note>
+ <para>
+ You need to be aware of how BitBake parses curly braces.
+ If a recipe uses a closing curly brace within the function and
+ the character has no leading spaces, BitBake produces a parsing
+ error.
+ If you use a pair of curly braces in a shell function, the
+ closing curly brace must not be located at the start of the line
+ without leading spaces.
+ </para>
+
+ <para>
+ Here is an example that causes BitBake to produce a parsing
+ error:
+ <literallayout class='monospaced'>
+ fakeroot create_shar() {
+ cat &lt;&lt; "EOF" &gt; ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+ usage()
+ {
+ echo "test"
+ ###### The following "}" at the start of the line causes a parsing error ######
+ }
+ EOF
+ }
+ </literallayout>
+ Writing the recipe this way avoids the error:
+ <literallayout class='monospaced'>
+ fakeroot create_shar() {
+ cat &lt;&lt; "EOF" &gt; ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+ usage()
+ {
+ echo "test"
+ ######The following "}" with a leading space at the start of the line avoids the error ######
+ }
+ EOF
+ }
+ </literallayout>
+ </para>
+ </note>
+ </section>
+
+ <section id='locating-and-parsing-recipes'>
+ <title>Locating and Parsing Recipes</title>
+
+ <para>
+ During the configuration phase, BitBake will have set
+ <link linkend='var-BBFILES'><filename>BBFILES</filename></link>.
+ BitBake now uses it to construct a list of recipes to parse,
+ along with any append files (<filename>.bbappend</filename>)
+ to apply.
+ <filename>BBFILES</filename> is a space-separated list of
+ available files and supports wildcards.
+ An example would be:
+ <literallayout class='monospaced'>
+ BBFILES = "/path/to/bbfiles/*.bb /path/to/appends/*.bbappend"
+ </literallayout>
+ BitBake parses each recipe and append file located
+ with <filename>BBFILES</filename> and stores the values of
+ various variables into the datastore.
+ <note>
+ Append files are applied in the order they are encountered in
+ <filename>BBFILES</filename>.
+ </note>
+ For each file, a fresh copy of the base configuration is
+ made, then the recipe is parsed line by line.
+ Any inherit statements cause BitBake to find and
+ then parse class files (<filename>.bbclass</filename>)
+ using
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ as the search path.
+ Finally, BitBake parses in order any append files found in
+ <filename>BBFILES</filename>.
+ </para>
+
+ <para>
+ One common convention is to use the recipe filename to define
+ pieces of metadata.
+ For example, in <filename>bitbake.conf</filename> the recipe
+ name and version are used to set the variables
+ <link linkend='var-PN'><filename>PN</filename></link> and
+ <link linkend='var-PV'><filename>PV</filename></link>:
+ <literallayout class='monospaced'>
+ PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
+ PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+ </literallayout>
+ In this example, a recipe called "something_1.2.3.bb" would set
+ <filename>PN</filename> to "something" and
+ <filename>PV</filename> to "1.2.3".
+ </para>
+
+ <para>
+ By the time parsing is complete for a recipe, BitBake
+ has a list of tasks that the recipe defines and a set of
+ data consisting of keys and values as well as
+ dependency information about the tasks.
+ </para>
+
+ <para>
+ BitBake does not need all of this information.
+ It only needs a small subset of the information to make
+ decisions about the recipe.
+ Consequently, BitBake caches the values in which it is
+ interested and does not store the rest of the information.
+ Experience has shown it is faster to re-parse the metadata than to
+ try and write it out to the disk and then reload it.
+ </para>
+
+ <para>
+ Where possible, subsequent BitBake commands reuse this cache of
+ recipe information.
+ The validity of this cache is determined by first computing a
+ checksum of the base configuration data (see
+ <link linkend='var-BB_HASHCONFIG_WHITELIST'><filename>BB_HASHCONFIG_WHITELIST</filename></link>)
+ and then checking if the checksum matches.
+ If that checksum matches what is in the cache and the recipe
+ and class files have not changed, Bitbake is able to use
+ the cache.
+ BitBake then reloads the cached information about the recipe
+ instead of reparsing it from scratch.
+ </para>
+
+ <para>
+ Recipe file collections exist to allow the user to
+ have multiple repositories of
+ <filename>.bb</filename> files that contain the same
+ exact package.
+ For example, one could easily use them to make one's
+ own local copy of an upstream repository, but with
+ custom modifications that one does not want upstream.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBFILES = "/stuff/openembedded/*/*.bb /stuff/openembedded.modified/*/*.bb"
+ BBFILE_COLLECTIONS = "upstream local"
+ BBFILE_PATTERN_upstream = "^/stuff/openembedded/"
+ BBFILE_PATTERN_local = "^/stuff/openembedded.modified/"
+ BBFILE_PRIORITY_upstream = "5"
+ BBFILE_PRIORITY_local = "10"
+ </literallayout>
+ <note>
+ The layers mechanism is now the preferred method of collecting
+ code.
+ While the collections code remains, its main use is to set layer
+ priorities and to deal with overlap (conflicts) between layers.
+ </note>
+ </para>
+ </section>
+
+ <section id='bb-bitbake-providers'>
+ <title>Providers</title>
+
+ <para>
+ Assuming BitBake has been instructed to execute a target
+ and that all the recipe files have been parsed, BitBake
+ starts to figure out how to build the target.
+ BitBake looks through the <filename>PROVIDES</filename> list
+ for each of the recipes.
+ A <filename>PROVIDES</filename> list is the list of names by which
+ the recipe can be known.
+ Each recipe's <filename>PROVIDES</filename> list is created
+ implicitly through the recipe's
+ <link linkend='var-PN'><filename>PN</filename></link> variable
+ and explicitly through the recipe's
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ variable, which is optional.
+ </para>
+
+ <para>
+ When a recipe uses <filename>PROVIDES</filename>, that recipe's
+ functionality can be found under an alternative name or names other
+ than the implicit <filename>PN</filename> name.
+ As an example, suppose a recipe named <filename>keyboard_1.0.bb</filename>
+ contained the following:
+ <literallayout class='monospaced'>
+ PROVIDES += "fullkeyboard"
+ </literallayout>
+ The <filename>PROVIDES</filename> list for this recipe becomes
+ "keyboard", which is implicit, and "fullkeyboard", which is explicit.
+ Consequently, the functionality found in
+ <filename>keyboard_1.0.bb</filename> can be found under two
+ different names.
+ </para>
+ </section>
+
+ <section id='bb-bitbake-preferences'>
+ <title>Preferences</title>
+
+ <para>
+ The <filename>PROVIDES</filename> list is only part of the solution
+ for figuring out a target's recipes.
+ Because targets might have multiple providers, BitBake needs
+ to prioritize providers by determining provider preferences.
+ </para>
+
+ <para>
+ A common example in which a target has multiple providers
+ is "virtual/kernel", which is on the
+ <filename>PROVIDES</filename> list for each kernel recipe.
+ Each machine often selects the best kernel provider by using a
+ line similar to the following in the machine configuration file:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+ </literallayout>
+ The default
+ <link linkend='var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></link>
+ is the provider with the same name as the target.
+ Bitbake iterates through each target it needs to build and
+ resolves them and their dependencies using this process.
+ </para>
+
+ <para>
+ Understanding how providers are chosen is made complicated by the fact
+ that multiple versions might exist for a given provider.
+ BitBake defaults to the highest version of a provider.
+ Version comparisons are made using the same method as Debian.
+ You can use the
+ <link linkend='var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></link>
+ variable to specify a particular version.
+ You can influence the order by using the
+ <link linkend='var-DEFAULT_PREFERENCE'><filename>DEFAULT_PREFERENCE</filename></link>
+ variable.
+ </para>
+
+ <para>
+ By default, files have a preference of "0".
+ Setting <filename>DEFAULT_PREFERENCE</filename> to "-1" makes the
+ recipe unlikely to be used unless it is explicitly referenced.
+ Setting <filename>DEFAULT_PREFERENCE</filename> to "1" makes it
+ likely the recipe is used.
+ <filename>PREFERRED_VERSION</filename> overrides any
+ <filename>DEFAULT_PREFERENCE</filename> setting.
+ <filename>DEFAULT_PREFERENCE</filename> is often used to mark newer
+ and more experimental recipe versions until they have undergone
+ sufficient testing to be considered stable.
+ </para>
+
+ <para>
+ When there are multiple “versions†of a given recipe,
+ BitBake defaults to selecting the most recent
+ version, unless otherwise specified.
+ If the recipe in question has a
+ <link linkend='var-DEFAULT_PREFERENCE'><filename>DEFAULT_PREFERENCE</filename></link>
+ set lower than the other recipes (default is 0), then
+ it will not be selected.
+ This allows the person or persons maintaining
+ the repository of recipe files to specify
+ their preference for the default selected version.
+ Additionally, the user can specify their preferred version.
+ </para>
+
+ <para>
+ If the first recipe is named <filename>a_1.1.bb</filename>, then the
+ <link linkend='var-PN'><filename>PN</filename></link> variable
+ will be set to “aâ€, and the
+ <link linkend='var-PV'><filename>PV</filename></link>
+ variable will be set to 1.1.
+ </para>
+
+ <para>
+ Thus, if a recipe named <filename>a_1.2.bb</filename> exists, BitBake
+ will choose 1.2 by default.
+ However, if you define the following variable in a
+ <filename>.conf</filename> file that BitBake parses, you
+ can change that preference:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_a = "1.1"
+ </literallayout>
+ </para>
+
+ <note>
+ <para>
+ It is common for a recipe to provide two versions -- a stable,
+ numbered (and preferred) version, and a version that is
+ automatically checked out from a source code repository that
+ is considered more "bleeding edge" but can be selected only
+ explicitly.
+ </para>
+
+ <para>
+ For example, in the OpenEmbedded codebase, there is a standard,
+ versioned recipe file for BusyBox,
+ <filename>busybox_1.22.1.bb</filename>,
+ but there is also a Git-based version,
+ <filename>busybox_git.bb</filename>, which explicitly contains the line
+ <literallayout class='monospaced'>
+ DEFAULT_PREFERENCE = "-1"
+ </literallayout>
+ to ensure that the numbered, stable version is always preferred
+ unless the developer selects otherwise.
+ </para>
+ </note>
+ </section>
+
+ <section id='bb-bitbake-dependencies'>
+ <title>Dependencies</title>
+
+ <para>
+ Each target BitBake builds consists of multiple tasks such as
+ <filename>fetch</filename>, <filename>unpack</filename>,
+ <filename>patch</filename>, <filename>configure</filename>,
+ and <filename>compile</filename>.
+ For best performance on multi-core systems, BitBake considers each
+ task as an independent
+ entity with its own set of dependencies.
+ </para>
+
+ <para>
+ Dependencies are defined through several variables.
+ You can find information about variables BitBake uses in
+ the <link linkend='ref-variables-glos'>Variables Glossary</link>
+ near the end of this manual.
+ At a basic level, it is sufficient to know that BitBake uses the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link> and
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> variables when
+ calculating dependencies.
+ </para>
+
+ <para>
+ For more information on how BitBake handles dependencies, see the
+ "<link linkend='dependencies'>Dependencies</link>" section.
+ </para>
+ </section>
+
+ <section id='ref-bitbake-tasklist'>
+ <title>The Task List</title>
+
+ <para>
+ Based on the generated list of providers and the dependency information,
+ BitBake can now calculate exactly what tasks it needs to run and in what
+ order it needs to run them.
+ The
+ "<link linkend='executing-tasks'>Executing Tasks</link>" section has more
+ information on how BitBake chooses which task to execute next.
+ </para>
+
+ <para>
+ The build now starts with BitBake forking off threads up to the limit set in the
+ <link linkend='var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></link>
+ variable.
+ BitBake continues to fork threads as long as there are tasks ready to run,
+ those tasks have all their dependencies met, and the thread threshold has not been
+ exceeded.
+ </para>
+
+ <para>
+ It is worth noting that you can greatly speed up the build time by properly setting
+ the <filename>BB_NUMBER_THREADS</filename> variable.
+ </para>
+
+ <para>
+ As each task completes, a timestamp is written to the directory specified by the
+ <link linkend='var-STAMP'><filename>STAMP</filename></link> variable.
+ On subsequent runs, BitBake looks in the build directory within
+ <filename>tmp/stamps</filename> and does not rerun
+ tasks that are already completed unless a timestamp is found to be invalid.
+ Currently, invalid timestamps are only considered on a per
+ recipe file basis.
+ So, for example, if the configure stamp has a timestamp greater than the
+ compile timestamp for a given target, then the compile task would rerun.
+ Running the compile task again, however, has no effect on other providers
+ that depend on that target.
+ </para>
+
+ <para>
+ The exact format of the stamps is partly configurable.
+ In modern versions of BitBake, a hash is appended to the
+ stamp so that if the configuration changes, the stamp becomes
+ invalid and the task is automatically rerun.
+ This hash, or signature used, is governed by the signature policy
+ that is configured (see the
+ "<link linkend='checksums'>Checksums (Signatures)</link>"
+ section for information).
+ It is also possible to append extra metadata to the stamp using
+ the <filename>[stamp-extra-info]</filename> task flag.
+ For example, OpenEmbedded uses this flag to make some tasks machine-specific.
+ </para>
+
+ <note>
+ Some tasks are marked as "nostamp" tasks.
+ No timestamp file is created when these tasks are run.
+ Consequently, "nostamp" tasks are always rerun.
+ </note>
+
+ <para>
+ For more information on tasks, see the
+ "<link linkend='tasks'>Tasks</link>" section.
+ </para>
+ </section>
+
+ <section id='executing-tasks'>
+ <title>Executing Tasks</title>
+
+ <para>
+ Tasks can be either a shell task or a Python task.
+ For shell tasks, BitBake writes a shell script to
+ <filename>${</filename><link linkend='var-T'><filename>T</filename></link><filename>}/run.do_taskname.pid</filename>
+ and then executes the script.
+ The generated shell script contains all the exported variables,
+ and the shell functions with all variables expanded.
+ Output from the shell script goes to the file
+ <filename>${T}/log.do_taskname.pid</filename>.
+ Looking at the expanded shell functions in the run file and
+ the output in the log files is a useful debugging technique.
+ </para>
+
+ <para>
+ For Python tasks, BitBake executes the task internally and logs
+ information to the controlling terminal.
+ Future versions of BitBake will write the functions to files
+ similar to the way shell tasks are handled.
+ Logging will be handled in a way similar to shell tasks as well.
+ </para>
+
+ <para>
+ The order in which BitBake runs the tasks is controlled by its
+ task scheduler.
+ It is possible to configure the scheduler and define custom
+ implementations for specific use cases.
+ For more information, see these variables that control the
+ behavior:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-BB_SCHEDULER'><filename>BB_SCHEDULER</filename></link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_SCHEDULERS'><filename>BB_SCHEDULERS</filename></link>
+ </para></listitem>
+ </itemizedlist>
+ It is possible to have functions run before and after a task's main
+ function.
+ This is done using the <filename>[prefuncs]</filename>
+ and <filename>[postfuncs]</filename> flags of the task
+ that lists the functions to run.
+ </para>
+ </section>
+
+ <section id='checksums'>
+ <title>Checksums (Signatures)</title>
+
+ <para>
+ A checksum is a unique signature of a task's inputs.
+ The signature of a task can be used to determine if a task
+ needs to be run.
+ Because it is a change in a task's inputs that triggers running
+ the task, BitBake needs to detect all the inputs to a given task.
+ For shell tasks, this turns out to be fairly easy because
+ BitBake generates a "run" shell script for each task and
+ it is possible to create a checksum that gives you a good idea of when
+ the task's data changes.
+ </para>
+
+ <para>
+ To complicate the problem, some things should not be included in
+ the checksum.
+ First, there is the actual specific build path of a given task -
+ the working directory.
+ It does not matter if the working directory changes because it should not
+ affect the output for target packages.
+ The simplistic approach for excluding the working directory is to set
+ it to some fixed value and create the checksum for the "run" script.
+ BitBake goes one step better and uses the
+ <link linkend='var-BB_HASHBASE_WHITELIST'><filename>BB_HASHBASE_WHITELIST</filename></link>
+ variable to define a list of variables that should never be included
+ when generating the signatures.
+ </para>
+
+ <para>
+ Another problem results from the "run" scripts containing functions that
+ might or might not get called.
+ The incremental build solution contains code that figures out dependencies
+ between shell functions.
+ This code is used to prune the "run" scripts down to the minimum set,
+ thereby alleviating this problem and making the "run" scripts much more
+ readable as a bonus.
+ </para>
+
+ <para>
+ So far we have solutions for shell scripts.
+ What about Python tasks?
+ The same approach applies even though these tasks are more difficult.
+ The process needs to figure out what variables a Python function accesses
+ and what functions it calls.
+ Again, the incremental build solution contains code that first figures out
+ the variable and function dependencies, and then creates a checksum for the data
+ used as the input to the task.
+ </para>
+
+ <para>
+ Like the working directory case, situations exist where dependencies
+ should be ignored.
+ For these cases, you can instruct the build process to ignore a dependency
+ by using a line like the following:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCHS[vardepsexclude] = "MACHINE"
+ </literallayout>
+ This example ensures that the <filename>PACKAGE_ARCHS</filename> variable does not
+ depend on the value of <filename>MACHINE</filename>, even if it does reference it.
+ </para>
+
+ <para>
+ Equally, there are cases where we need to add dependencies BitBake
+ is not able to find.
+ You can accomplish this by using a line like the following:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCHS[vardeps] = "MACHINE"
+ </literallayout>
+ This example explicitly adds the <filename>MACHINE</filename> variable as a
+ dependency for <filename>PACKAGE_ARCHS</filename>.
+ </para>
+
+ <para>
+ Consider a case with in-line Python, for example, where BitBake is not
+ able to figure out dependencies.
+ When running in debug mode (i.e. using <filename>-DDD</filename>), BitBake
+ produces output when it discovers something for which it cannot figure out
+ dependencies.
+ </para>
+
+ <para>
+ Thus far, this section has limited discussion to the direct inputs into a task.
+ Information based on direct inputs is referred to as the "basehash" in the
+ code.
+ However, there is still the question of a task's indirect inputs - the
+ things that were already built and present in the build directory.
+ The checksum (or signature) for a particular task needs to add the hashes
+ of all the tasks on which the particular task depends.
+ Choosing which dependencies to add is a policy decision.
+ However, the effect is to generate a master checksum that combines the basehash
+ and the hashes of the task's dependencies.
+ </para>
+
+ <para>
+ At the code level, there are a variety of ways both the basehash and the
+ dependent task hashes can be influenced.
+ Within the BitBake configuration file, we can give BitBake some extra information
+ to help it construct the basehash.
+ The following statement effectively results in a list of global variable
+ dependency excludes - variables never included in any checksum.
+ This example uses variables from OpenEmbedded to help illustrate
+ the concept:
+ <literallayout class='monospaced'>
+ BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
+ SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+ USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
+ PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
+ CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX"
+ </literallayout>
+ The previous example excludes the work directory, which is part of
+ <filename>TMPDIR</filename>.
+ </para>
+
+ <para>
+ The rules for deciding which hashes of dependent tasks to include through
+ dependency chains are more complex and are generally accomplished with a
+ Python function.
+ The code in <filename>meta/lib/oe/sstatesig.py</filename> shows two examples
+ of this and also illustrates how you can insert your own policy into the system
+ if so desired.
+ This file defines the two basic signature generators OpenEmbedded-Core
+ uses: "OEBasic" and "OEBasicHash".
+ By default, there is a dummy "noop" signature handler enabled in BitBake.
+ This means that behavior is unchanged from previous versions.
+ <filename>OE-Core</filename> uses the "OEBasicHash" signature handler by default
+ through this setting in the <filename>bitbake.conf</filename> file:
+ <literallayout class='monospaced'>
+ BB_SIGNATURE_HANDLER ?= "OEBasicHash"
+ </literallayout>
+ The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename> is the same as the
+ "OEBasic" version but adds the task hash to the stamp files.
+ This results in any metadata change that changes the task hash, automatically
+ causing the task to be run again.
+ This removes the need to bump
+ <link linkend='var-PR'><filename>PR</filename></link>
+ values, and changes to metadata automatically ripple across the build.
+ </para>
+
+ <para>
+ It is also worth noting that the end result of these signature generators is to
+ make some dependency and hash information available to the build.
+ This information includes:
+ <itemizedlist>
+ <listitem><para><filename>BB_BASEHASH_task-</filename><replaceable>taskname</replaceable>:
+ The base hashes for each task in the recipe.
+ </para></listitem>
+ <listitem><para><filename>BB_BASEHASH_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
+ The base hashes for each dependent task.
+ </para></listitem>
+ <listitem><para><filename>BBHASHDEPS_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
+ The task dependencies for each task.
+ </para></listitem>
+ <listitem><para><filename>BB_TASKHASH</filename>:
+ The hash of the currently running task.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ It is worth noting that BitBake's "-S" option lets you
+ debug Bitbake's processing of signatures.
+ The options passed to -S allow different debugging modes
+ to be used, either using BitBake's own debug functions
+ or possibly those defined in the metadata/signature handler
+ itself.
+ The simplest parameter to pass is "none", which causes a
+ set of signature information to be written out into
+ <filename>STAMPS_DIR</filename>
+ corresponding to the targets specified.
+ The other currently available parameter is "printdiff",
+ which causes BitBake to try to establish the closest
+ signature match it can (e.g. in the sstate cache) and then
+ run <filename>bitbake-diffsigs</filename> over the matches
+ to determine the stamps and delta where these two
+ stamp trees diverge.
+ <note>
+ It is likely that future versions of BitBake will
+ provide other signature handlers triggered through
+ additional "-S" parameters.
+ </note>
+ </para>
+
+ <para>
+ You can find more information on checksum metadata in the
+ "<link linkend='task-checksums-and-setscene'>Task Checksums and Setscene</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='setscene'>
+ <title>Setscene</title>
+
+ <para>
+ The setscene process enables BitBake to handle "pre-built" artifacts.
+ The ability to handle and reuse these artifacts allows BitBake
+ the luxury of not having to build something from scratch every time.
+ Instead, BitBake can use, when possible, existing build artifacts.
+ </para>
+
+ <para>
+ BitBake needs to have reliable data indicating whether or not an
+ artifact is compatible.
+ Signatures, described in the previous section, provide an ideal
+ way of representing whether an artifact is compatible.
+ If a signature is the same, an object can be reused.
+ </para>
+
+ <para>
+ If an object can be reused, the problem then becomes how to
+ replace a given task or set of tasks with the pre-built artifact.
+ BitBake solves the problem with the "setscene" process.
+ </para>
+
+ <para>
+ When BitBake is asked to build a given target, before building anything,
+ it first asks whether cached information is available for any of the
+ targets it's building, or any of the intermediate targets.
+ If cached information is available, BitBake uses this information instead of
+ running the main tasks.
+ </para>
+
+ <para>
+ BitBake first calls the function defined by the
+ <link linkend='var-BB_HASHCHECK_FUNCTION'><filename>BB_HASHCHECK_FUNCTION</filename></link>
+ variable with a list of tasks and corresponding
+ hashes it wants to build.
+ This function is designed to be fast and returns a list
+ of the tasks for which it believes in can obtain artifacts.
+ </para>
+
+ <para>
+ Next, for each of the tasks that were returned as possibilities,
+ BitBake executes a setscene version of the task that the possible
+ artifact covers.
+ Setscene versions of a task have the string "_setscene" appended to the
+ task name.
+ So, for example, the task with the name <filename>xxx</filename> has
+ a setscene task named <filename>xxx_setscene</filename>.
+ The setscene version of the task executes and provides the necessary
+ artifacts returning either success or failure.
+ </para>
+
+ <para>
+ As previously mentioned, an artifact can cover more than one task.
+ For example, it is pointless to obtain a compiler if you
+ already have the compiled binary.
+ To handle this, BitBake calls the
+ <link linkend='var-BB_SETSCENE_DEPVALID'><filename>BB_SETSCENE_DEPVALID</filename></link>
+ function for each successful setscene task to know whether or not it needs
+ to obtain the dependencies of that task.
+ </para>
+
+ <para>
+ Finally, after all the setscene tasks have executed, BitBake calls the
+ function listed in
+ <link linkend='var-BB_SETSCENE_VERIFY_FUNCTION2'><filename>BB_SETSCENE_VERIFY_FUNCTION2</filename></link>
+ with the list of tasks BitBake thinks has been "covered".
+ The metadata can then ensure that this list is correct and can
+ inform BitBake that it wants specific tasks to be run regardless
+ of the setscene result.
+ </para>
+
+ <para>
+ You can find more information on setscene metadata in the
+ "<link linkend='task-checksums-and-setscene'>Task Checksums and Setscene</link>"
+ section.
+ </para>
+ </section>
+</chapter>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
new file mode 100644
index 000000000..29ae486a7
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml
@@ -0,0 +1,857 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<chapter>
+<title>File Download Support</title>
+
+ <para>
+ BitBake's fetch module is a standalone piece of library code
+ that deals with the intricacies of downloading source code
+ and files from remote systems.
+ Fetching source code is one of the cornerstones of building software.
+ As such, this module forms an important part of BitBake.
+ </para>
+
+ <para>
+ The current fetch module is called "fetch2" and refers to the
+ fact that it is the second major version of the API.
+ The original version is obsolete and has been removed from the codebase.
+ Thus, in all cases, "fetch" refers to "fetch2" in this
+ manual.
+ </para>
+
+ <section id='the-download-fetch'>
+ <title>The Download (Fetch)</title>
+
+ <para>
+ BitBake takes several steps when fetching source code or files.
+ The fetcher codebase deals with two distinct processes in order:
+ obtaining the files from somewhere (cached or otherwise)
+ and then unpacking those files into a specific location and
+ perhaps in a specific way.
+ Getting and unpacking the files is often optionally followed
+ by patching.
+ Patching, however, is not covered by this module.
+ </para>
+
+ <para>
+ The code to execute the first part of this process, a fetch,
+ looks something like the following:
+ <literallayout class='monospaced'>
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.download()
+ </literallayout>
+ This code sets up an instance of the fetch class.
+ The instance uses a space-separated list of URLs from the
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ variable and then calls the <filename>download</filename>
+ method to download the files.
+ </para>
+
+ <para>
+ The instantiation of the fetch class is usually followed by:
+ <literallayout class='monospaced'>
+ rootdir = l.getVar('WORKDIR')
+ fetcher.unpack(rootdir)
+ </literallayout>
+ This code unpacks the downloaded files to the
+ specified by <filename>WORKDIR</filename>.
+ <note>
+ For convenience, the naming in these examples matches
+ the variables used by OpenEmbedded.
+ If you want to see the above code in action, examine
+ the OpenEmbedded class file <filename>base.bbclass</filename>.
+ </note>
+ The <filename>SRC_URI</filename> and <filename>WORKDIR</filename>
+ variables are not hardcoded into the fetcher, since those fetcher
+ methods can be (and are) called with different variable names.
+ In OpenEmbedded for example, the shared state (sstate) code uses
+ the fetch module to fetch the sstate files.
+ </para>
+
+ <para>
+ When the <filename>download()</filename> method is called,
+ BitBake tries to resolve the URLs by looking for source files
+ in a specific search order:
+ <itemizedlist>
+ <listitem><para><emphasis>Pre-mirror Sites:</emphasis>
+ BitBake first uses pre-mirrors to try and find source files.
+ These locations are defined using the
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ variable.
+ </para></listitem>
+ <listitem><para><emphasis>Source URI:</emphasis>
+ If pre-mirrors fail, BitBake uses the original URL (e.g from
+ <filename>SRC_URI</filename>).
+ </para></listitem>
+ <listitem><para><emphasis>Mirror Sites:</emphasis>
+ If fetch failures occur, BitBake next uses mirror locations as
+ defined by the
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ variable.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For each URL passed to the fetcher, the fetcher
+ calls the submodule that handles that particular URL type.
+ This behavior can be the source of some confusion when you
+ are providing URLs for the <filename>SRC_URI</filename>
+ variable.
+ Consider the following two URLs:
+ <literallayout class='monospaced'>
+ http://git.yoctoproject.org/git/poky;protocol=git
+ git://git.yoctoproject.org/git/poky;protocol=http
+ </literallayout>
+ In the former case, the URL is passed to the
+ <filename>wget</filename> fetcher, which does not
+ understand "git".
+ Therefore, the latter case is the correct form since the
+ Git fetcher does know how to use HTTP as a transport.
+ </para>
+
+ <para>
+ Here are some examples that show commonly used mirror
+ definitions:
+ <literallayout class='monospaced'>
+ PREMIRRORS ?= "\
+ bzr://.*/.* http://somemirror.org/sources/ \n \
+ cvs://.*/.* http://somemirror.org/sources/ \n \
+ git://.*/.* http://somemirror.org/sources/ \n \
+ hg://.*/.* http://somemirror.org/sources/ \n \
+ osc://.*/.* http://somemirror.org/sources/ \n \
+ p4://.*/.* http://somemirror.org/sources/ \n \
+ svn://.*/.* http://somemirror.org/sources/ \n"
+
+ MIRRORS =+ "\
+ ftp://.*/.* http://somemirror.org/sources/ \n \
+ http://.*/.* http://somemirror.org/sources/ \n \
+ https://.*/.* http://somemirror.org/sources/ \n"
+ </literallayout>
+ It is useful to note that BitBake supports
+ cross-URLs.
+ It is possible to mirror a Git repository on an HTTP
+ server as a tarball.
+ This is what the <filename>git://</filename> mapping in
+ the previous example does.
+ </para>
+
+ <para>
+ Since network accesses are slow, Bitbake maintains a
+ cache of files downloaded from the network.
+ Any source files that are not local (i.e.
+ downloaded from the Internet) are placed into the download
+ directory, which is specified by the
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ variable.
+ </para>
+
+ <para>
+ File integrity is of key importance for reproducing builds.
+ For non-local archive downloads, the fetcher code can verify
+ SHA-256 and MD5 checksums to ensure the archives have been
+ downloaded correctly.
+ You can specify these checksums by using the
+ <filename>SRC_URI</filename> variable with the appropriate
+ varflags as follows:
+ <literallayout class='monospaced'>
+ SRC_URI[md5sum] = "<replaceable>value</replaceable>"
+ SRC_URI[sha256sum] = "<replaceable>value</replaceable>"
+ </literallayout>
+ You can also specify the checksums as parameters on the
+ <filename>SRC_URI</filename> as shown below:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://example.com/foobar.tar.bz2;md5sum=4a8e0f237e961fd7785d19d07fdb994d"
+ </literallayout>
+ If multiple URIs exist, you can specify the checksums either
+ directly as in the previous example, or you can name the URLs.
+ The following syntax shows how you name the URIs:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://example.com/foobar.tar.bz2;name=foo"
+ SRC_URI[foo.md5sum] = 4a8e0f237e961fd7785d19d07fdb994d
+ </literallayout>
+ After a file has been downloaded and has had its checksum checked,
+ a ".done" stamp is placed in <filename>DL_DIR</filename>.
+ BitBake uses this stamp during subsequent builds to avoid
+ downloading or comparing a checksum for the file again.
+ <note>
+ It is assumed that local storage is safe from data corruption.
+ If this were not the case, there would be bigger issues to worry about.
+ </note>
+ </para>
+
+ <para>
+ If
+ <link linkend='var-BB_STRICT_CHECKSUM'><filename>BB_STRICT_CHECKSUM</filename></link>
+ is set, any download without a checksum triggers an
+ error message.
+ The
+ <link linkend='var-BB_NO_NETWORK'><filename>BB_NO_NETWORK</filename></link>
+ variable can be used to make any attempted network access a fatal
+ error, which is useful for checking that mirrors are complete
+ as well as other things.
+ </para>
+ </section>
+
+ <section id='bb-the-unpack'>
+ <title>The Unpack</title>
+
+ <para>
+ The unpack process usually immediately follows the download.
+ For all URLs except Git URLs, BitBake uses the common
+ <filename>unpack</filename> method.
+ </para>
+
+ <para>
+ A number of parameters exist that you can specify within the
+ URL to govern the behavior of the unpack stage:
+ <itemizedlist>
+ <listitem><para><emphasis>unpack:</emphasis>
+ Controls whether the URL components are unpacked.
+ If set to "1", which is the default, the components
+ are unpacked.
+ If set to "0", the unpack stage leaves the file alone.
+ This parameter is useful when you want an archive to be
+ copied in and not be unpacked.
+ </para></listitem>
+ <listitem><para><emphasis>dos:</emphasis>
+ Applies to <filename>.zip</filename> and
+ <filename>.jar</filename> files and specifies whether to
+ use DOS line ending conversion on text files.
+ </para></listitem>
+ <listitem><para><emphasis>basepath:</emphasis>
+ Instructs the unpack stage to strip the specified
+ directories from the source path when unpacking.
+ </para></listitem>
+ <listitem><para><emphasis>subdir:</emphasis>
+ Unpacks the specific URL to the specified subdirectory
+ within the root directory.
+ </para></listitem>
+ </itemizedlist>
+ The unpack call automatically decompresses and extracts files
+ with ".Z", ".z", ".gz", ".xz", ".zip", ".jar", ".ipk", ".rpm".
+ ".srpm", ".deb" and ".bz2" extensions as well as various combinations
+ of tarball extensions.
+ </para>
+
+ <para>
+ As mentioned, the Git fetcher has its own unpack method that
+ is optimized to work with Git trees.
+ Basically, this method works by cloning the tree into the final
+ directory.
+ The process is completed using references so that there is
+ only one central copy of the Git metadata needed.
+ </para>
+ </section>
+
+ <section id='bb-fetchers'>
+ <title>Fetchers</title>
+
+ <para>
+ As mentioned earlier, the URL prefix determines which
+ fetcher submodule BitBake uses.
+ Each submodule can support different URL parameters,
+ which are described in the following sections.
+ </para>
+
+ <section id='local-file-fetcher'>
+ <title>Local file fetcher (<filename>file://</filename>)</title>
+
+ <para>
+ This submodule handles URLs that begin with
+ <filename>file://</filename>.
+ The filename you specify within the URL can be
+ either an absolute or relative path to a file.
+ If the filename is relative, the contents of the
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ variable is used in the same way
+ <filename>PATH</filename> is used to find executables.
+ If the file cannot be found, it is assumed that it is available in
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ by the time the <filename>download()</filename> method is called.
+ </para>
+
+ <para>
+ If you specify a directory, the entire directory is
+ unpacked.
+ </para>
+
+ <para>
+ Here are a couple of example URLs, the first relative and
+ the second absolute:
+ <literallayout class='monospaced'>
+ SRC_URI = "file://relativefile.patch"
+ SRC_URI = "file:///Users/ich/very_important_software"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='http-ftp-fetcher'>
+ <title>HTTP/FTP wget fetcher (<filename>http://</filename>, <filename>ftp://</filename>, <filename>https://</filename>)</title>
+
+ <para>
+ This fetcher obtains files from web and FTP servers.
+ Internally, the fetcher uses the wget utility.
+ </para>
+
+ <para>
+ The executable and parameters used are specified by the
+ <filename>FETCHCMD_wget</filename> variable, which defaults
+ to sensible values.
+ The fetcher supports a parameter "downloadfilename" that
+ allows the name of the downloaded file to be specified.
+ Specifying the name of the downloaded file is useful
+ for avoiding collisions in
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ when dealing with multiple files that have the same name.
+ </para>
+
+ <para>
+ Some example URLs are as follows:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://oe.handhelds.org/not_there.aac"
+ SRC_URI = "ftp://oe.handhelds.org/not_there_as_well.aac"
+ SRC_URI = "ftp://you@oe.handhelds.org/home/you/secret.plan"
+ </literallayout>
+ </para>
+ <note>
+ Because URL parameters are delimited by semi-colons, this can
+ introduce ambiguity when parsing URLs that also contain semi-colons,
+ for example:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git;a=snapshot;h=a5dd47"
+ </literallayout>
+ Such URLs should should be modified by replacing semi-colons with '&amp;' characters:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git&amp;a=snapshot&amp;h=a5dd47"
+ </literallayout>
+ In most cases this should work. Treating semi-colons and '&amp;' in queries
+ identically is recommended by the World Wide Web Consortium (W3C).
+ Note that due to the nature of the URL, you may have to specify the name
+ of the downloaded file as well:
+ <literallayout class='monospaced'>
+ SRC_URI = "http://abc123.org/git/?p=gcc/gcc.git&amp;a=snapshot&amp;h=a5dd47;downloadfilename=myfile.bz2"
+ </literallayout>
+ </note>
+ </section>
+
+ <section id='cvs-fetcher'>
+ <title>CVS fetcher (<filename>(cvs://</filename>)</title>
+
+ <para>
+ This submodule handles checking out files from the
+ CVS version control system.
+ You can configure it using a number of different variables:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>FETCHCMD_cvs</filename>:</emphasis>
+ The name of the executable to use when running
+ the <filename>cvs</filename> command.
+ This name is usually "cvs".
+ </para></listitem>
+ <listitem><para><emphasis><filename>SRCDATE</filename>:</emphasis>
+ The date to use when fetching the CVS source code.
+ A special value of "now" causes the checkout to
+ be updated on every build.
+ </para></listitem>
+ <listitem><para><emphasis><link linkend='var-CVSDIR'><filename>CVSDIR</filename></link>:</emphasis>
+ Specifies where a temporary checkout is saved.
+ The location is often <filename>DL_DIR/cvs</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>CVS_PROXY_HOST</filename>:</emphasis>
+ The name to use as a "proxy=" parameter to the
+ <filename>cvs</filename> command.
+ </para></listitem>
+ <listitem><para><emphasis><filename>CVS_PROXY_PORT</filename>:</emphasis>
+ The port number to use as a "proxyport=" parameter to
+ the <filename>cvs</filename> command.
+ </para></listitem>
+ </itemizedlist>
+ As well as the standard username and password URL syntax,
+ you can also configure the fetcher with various URL parameters:
+ </para>
+
+ <para>
+ The supported parameters are as follows:
+ <itemizedlist>
+ <listitem><para><emphasis>"method":</emphasis>
+ The protocol over which to communicate with the CVS
+ server.
+ By default, this protocol is "pserver".
+ If "method" is set to "ext", BitBake examines the
+ "rsh" parameter and sets <filename>CVS_RSH</filename>.
+ You can use "dir" for local directories.
+ </para></listitem>
+ <listitem><para><emphasis>"module":</emphasis>
+ Specifies the module to check out.
+ You must supply this parameter.
+ </para></listitem>
+ <listitem><para><emphasis>"tag":</emphasis>
+ Describes which CVS TAG should be used for
+ the checkout.
+ By default, the TAG is empty.
+ </para></listitem>
+ <listitem><para><emphasis>"date":</emphasis>
+ Specifies a date.
+ If no "date" is specified, the
+ <link linkend='var-SRCDATE'><filename>SRCDATE</filename></link>
+ of the configuration is used to checkout a specific date.
+ The special value of "now" causes the checkout to be
+ updated on every build.
+ </para></listitem>
+ <listitem><para><emphasis>"localdir":</emphasis>
+ Used to rename the module.
+ Effectively, you are renaming the output directory
+ to which the module is unpacked.
+ You are forcing the module into a special
+ directory relative to
+ <link linkend='var-CVSDIR'><filename>CVSDIR</filename></link>.
+ </para></listitem>
+ <listitem><para><emphasis>"rsh"</emphasis>
+ Used in conjunction with the "method" parameter.
+ </para></listitem>
+ <listitem><para><emphasis>"scmdata":</emphasis>
+ Causes the CVS metadata to be maintained in the tarball
+ the fetcher creates when set to "keep".
+ The tarball is expanded into the work directory.
+ By default, the CVS metadata is removed.
+ </para></listitem>
+ <listitem><para><emphasis>"fullpath":</emphasis>
+ Controls whether the resulting checkout is at the
+ module level, which is the default, or is at deeper
+ paths.
+ </para></listitem>
+ <listitem><para><emphasis>"norecurse":</emphasis>
+ Causes the fetcher to only checkout the specified
+ directory with no recurse into any subdirectories.
+ </para></listitem>
+ <listitem><para><emphasis>"port":</emphasis>
+ The port to which the CVS server connects.
+ </para></listitem>
+ </itemizedlist>
+ Some example URLs are as follows:
+ <literallayout class='monospaced'>
+ SRC_URI = "cvs://CVSROOT;module=mymodule;tag=some-version;method=ext"
+ SRC_URI = "cvs://CVSROOT;module=mymodule;date=20060126;localdir=usethat"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='svn-fetcher'>
+ <title>Subversion (SVN) Fetcher (<filename>svn://</filename>)</title>
+
+ <para>
+ This fetcher submodule fetches code from the
+ Subversion source control system.
+ The executable used is specified by
+ <filename>FETCHCMD_svn</filename>, which defaults
+ to "svn".
+ The fetcher's temporary working directory is set by
+ <link linkend='var-SVNDIR'><filename>SVNDIR</filename></link>,
+ which is usually <filename>DL_DIR/svn</filename>.
+ </para>
+
+ <para>
+ The supported parameters are as follows:
+ <itemizedlist>
+ <listitem><para><emphasis>"module":</emphasis>
+ The name of the svn module to checkout.
+ You must provide this parameter.
+ You can think of this parameter as the top-level
+ directory of the repository data you want.
+ </para></listitem>
+ <listitem><para><emphasis>"path_spec":</emphasis>
+ A specific directory in which to checkout the
+ specified svn module.
+ </para></listitem>
+ <listitem><para><emphasis>"protocol":</emphasis>
+ The protocol to use, which defaults to "svn".
+ If "protocol" is set to "svn+ssh", the "ssh"
+ parameter is also used.
+ </para></listitem>
+ <listitem><para><emphasis>"rev":</emphasis>
+ The revision of the source code to checkout.
+ </para></listitem>
+ <listitem><para><emphasis>"scmdata":</emphasis>
+ Causes the “.svn†directories to be available during
+ compile-time when set to "keep".
+ By default, these directories are removed.
+ </para></listitem>
+ <listitem><para><emphasis>"ssh":</emphasis>
+ An optional parameter used when "protocol" is set
+ to "svn+ssh".
+ You can use this parameter to specify the ssh
+ program used by svn.
+ </para></listitem>
+ <listitem><para><emphasis>"transportuser":</emphasis>
+ When required, sets the username for the transport.
+ By default, this parameter is empty.
+ The transport username is different than the username
+ used in the main URL, which is passed to the subversion
+ command.
+ </para></listitem>
+ </itemizedlist>
+ Following are three examples using svn:
+ <literallayout class='monospaced'>
+ SRC_URI = "svn://myrepos/proj1;module=vip;protocol=http;rev=667"
+ SRC_URI = "svn://myrepos/proj1;module=opie;protocol=svn+ssh"
+ SRC_URI = "svn://myrepos/proj1;module=trunk;protocol=http;path_spec=${MY_DIR}/proj1"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='git-fetcher'>
+ <title>Git Fetcher (<filename>git://</filename>)</title>
+
+ <para>
+ This fetcher submodule fetches code from the Git
+ source control system.
+ The fetcher works by creating a bare clone of the
+ remote into
+ <link linkend='var-GITDIR'><filename>GITDIR</filename></link>,
+ which is usually <filename>DL_DIR/git2</filename>.
+ This bare clone is then cloned into the work directory during the
+ unpack stage when a specific tree is checked out.
+ This is done using alternates and by reference to
+ minimize the amount of duplicate data on the disk and
+ make the unpack process fast.
+ The executable used can be set with
+ <filename>FETCHCMD_git</filename>.
+ </para>
+
+ <para>
+ This fetcher supports the following parameters:
+ <itemizedlist>
+ <listitem><para><emphasis>"protocol":</emphasis>
+ The protocol used to fetch the files.
+ The default is "git" when a hostname is set.
+ If a hostname is not set, the Git protocol is "file".
+ You can also use "http", "https", "ssh" and "rsync".
+ </para></listitem>
+ <listitem><para><emphasis>"nocheckout":</emphasis>
+ Tells the fetcher to not checkout source code when
+ unpacking when set to "1".
+ Set this option for the URL where there is a custom
+ routine to checkout code.
+ The default is "0".
+ </para></listitem>
+ <listitem><para><emphasis>"rebaseable":</emphasis>
+ Indicates that the upstream Git repository can be rebased.
+ You should set this parameter to "1" if
+ revisions can become detached from branches.
+ In this case, the source mirror tarball is done per
+ revision, which has a loss of efficiency.
+ Rebasing the upstream Git repository could cause the
+ current revision to disappear from the upstream repository.
+ This option reminds the fetcher to preserve the local cache
+ carefully for future use.
+ The default value for this parameter is "0".
+ </para></listitem>
+ <listitem><para><emphasis>"nobranch":</emphasis>
+ Tells the fetcher to not check the SHA validation
+ for the branch when set to "1".
+ The default is "0".
+ Set this option for the recipe that refers to
+ the commit that is valid for a tag instead of
+ the branch.
+ </para></listitem>
+ <listitem><para><emphasis>"bareclone":</emphasis>
+ Tells the fetcher to clone a bare clone into the
+ destination directory without checking out a working tree.
+ Only the raw Git metadata is provided.
+ This parameter implies the "nocheckout" parameter as well.
+ </para></listitem>
+ <listitem><para><emphasis>"branch":</emphasis>
+ The branch(es) of the Git tree to clone.
+ If unset, this is assumed to be "master".
+ The number of branch parameters much match the number of
+ name parameters.
+ </para></listitem>
+ <listitem><para><emphasis>"rev":</emphasis>
+ The revision to use for the checkout.
+ The default is "master".
+ </para></listitem>
+ <listitem><para><emphasis>"tag":</emphasis>
+ Specifies a tag to use for the checkout.
+ To correctly resolve tags, BitBake must access the
+ network.
+ For that reason, tags are often not used.
+ As far as Git is concerned, the "tag" parameter behaves
+ effectively the same as the "rev" parameter.
+ </para></listitem>
+ <listitem><para><emphasis>"subpath":</emphasis>
+ Limits the checkout to a specific subpath of the tree.
+ By default, the whole tree is checked out.
+ </para></listitem>
+ <listitem><para><emphasis>"destsuffix":</emphasis>
+ The name of the path in which to place the checkout.
+ By default, the path is <filename>git/</filename>.
+ </para></listitem>
+ </itemizedlist>
+ Here are some example URLs:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://git.oe.handhelds.org/git/vip.git;tag=version-1"
+ SRC_URI = "git://git.oe.handhelds.org/git/vip.git;protocol=http"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='gitsm-fetcher'>
+ <title>Git Submodule Fetcher (<filename>gitsm://</filename>)</title>
+
+ <para>
+ This fetcher submodule inherits from the
+ <link linkend='git-fetcher'>Git fetcher</link> and extends
+ that fetcher's behavior by fetching a repository's submodules.
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ is passed to the Git fetcher as described in the
+ "<link linkend='git-fetcher'>Git Fetcher (<filename>git://</filename>)</link>"
+ section.
+ <note>
+ <title>Notes and Warnings</title>
+ <para>
+ You must clean a recipe when switching between
+ '<filename>git://</filename>' and
+ '<filename>gitsm://</filename>' URLs.
+ </para>
+
+ <para>
+ The Git Submodules fetcher is not a complete fetcher
+ implementation.
+ The fetcher has known issues where it does not use the
+ normal source mirroring infrastructure properly. Further,
+ the submodule sources it fetches are not visible to the
+ licensing and source archiving infrastructures.
+ </para>
+ </note>
+ </para>
+ </section>
+
+ <section id='clearcase-fetcher'>
+ <title>ClearCase Fetcher (<filename>ccrc://</filename>)</title>
+
+ <para>
+ This fetcher submodule fetches code from a
+ <ulink url='http://en.wikipedia.org/wiki/Rational_ClearCase'>ClearCase</ulink>
+ repository.
+ </para>
+
+ <para>
+ To use this fetcher, make sure your recipe has proper
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>, and
+ <link linkend='var-PV'><filename>PV</filename></link> settings.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SRC_URI = "ccrc://cc.example.org/ccrc;vob=/example_vob;module=/example_module"
+ SRCREV = "EXAMPLE_CLEARCASE_TAG"
+ PV = "${@d.getVar("SRCREV", False).replace("/", "+")}"
+ </literallayout>
+ The fetcher uses the <filename>rcleartool</filename> or
+ <filename>cleartool</filename> remote client, depending on
+ which one is available.
+ </para>
+
+ <para>
+ Following are options for the <filename>SRC_URI</filename>
+ statement:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>vob</filename></emphasis>:
+ The name, which must include the
+ prepending "/" character, of the ClearCase VOB.
+ This option is required.
+ </para></listitem>
+ <listitem><para><emphasis><filename>module</filename></emphasis>:
+ The module, which must include the
+ prepending "/" character, in the selected VOB.
+ <note>
+ The <filename>module</filename> and <filename>vob</filename>
+ options are combined to create the <filename>load</filename> rule in
+ the view config spec.
+ As an example, consider the <filename>vob</filename> and
+ <filename>module</filename> values from the
+ <filename>SRC_URI</filename> statement at the start of this section.
+ Combining those values results in the following:
+ <literallayout class='monospaced'>
+ load /example_vob/example_module
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis><filename>proto</filename></emphasis>:
+ The protocol, which can be either <filename>http</filename> or
+ <filename>https</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ By default, the fetcher creates a configuration specification.
+ If you want this specification written to an area other than the default,
+ use the <filename>CCASE_CUSTOM_CONFIG_SPEC</filename> variable
+ in your recipe to define where the specification is written.
+ <note>
+ the <filename>SRCREV</filename> loses its functionality if you
+ specify this variable.
+ However, <filename>SRCREV</filename> is still used to label the
+ archive after a fetch even though it does not define what is
+ fetched.
+ </note>
+ </para>
+
+ <para>
+ Here are a couple of other behaviors worth mentioning:
+ <itemizedlist>
+ <listitem><para>
+ When using <filename>cleartool</filename>, the login of
+ <filename>cleartool</filename> is handled by the system.
+ The login require no special steps.
+ </para></listitem>
+ <listitem><para>
+ In order to use <filename>rcleartool</filename> with authenticated
+ users, an "rcleartool login" is necessary before using the fetcher.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='perforce-fetcher'>
+ <title>Perforce Fetcher (<filename>p4://</filename>)</title>
+
+ <para>
+ This fetcher submodule fetches code from the
+ <ulink url='https://www.perforce.com/'>Perforce</ulink>
+ source control system.
+ The executable used is specified by
+ <filename>FETCHCMD_p4</filename>, which defaults
+ to "p4".
+ The fetcher's temporary working directory is set by
+ <link linkend='var-P4DIR'><filename>P4DIR</filename></link>,
+ which defaults to "DL_DIR/p4".
+ </para>
+
+ <para>
+ To use this fetcher, make sure your recipe has proper
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>, and
+ <link linkend='var-PV'><filename>PV</filename></link> values.
+ The p4 executable is able to use the config file defined by your
+ system's <filename>P4CONFIG</filename> environment variable in
+ order to define the Perforce server URL and port, username, and
+ password if you do not wish to keep those values in a recipe
+ itself.
+ If you choose not to use <filename>P4CONFIG</filename>,
+ or to explicitly set variables that <filename>P4CONFIG</filename>
+ can contain, you can specify the <filename>P4PORT</filename> value,
+ which is the server's URL and port number, and you can
+ specify a username and password directly in your recipe within
+ <filename>SRC_URI</filename>.
+ </para>
+
+ <para>
+ Here is an example that relies on <filename>P4CONFIG</filename>
+ to specify the server URL and port, username, and password, and
+ fetches the Head Revision:
+ <literallayout class='monospaced'>
+ SRC_URI = "p4://example-depot/main/source/..."
+ SRCREV = "${AUTOREV}"
+ PV = "p4-${SRCPV}"
+ S = "${WORKDIR}/p4"
+ </literallayout>
+ </para>
+
+ <para>
+ Here is an example that specifies the server URL and port,
+ username, and password, and fetches a Revision based on a Label:
+ <literallayout class='monospaced'>
+ P4PORT = "tcp:p4server.example.net:1666"
+ SRC_URI = "p4://user:passwd@example-depot/main/source/..."
+ SRCREV = "release-1.0"
+ PV = "p4-${SRCPV}"
+ S = "${WORKDIR}/p4"
+ </literallayout>
+ <note>
+ You should always set <filename>S</filename>
+ to <filename>"${WORKDIR}/p4"</filename> in your recipe.
+ </note>
+ </para>
+ </section>
+
+ <section id='repo-fetcher'>
+ <title>Repo Fetcher (<filename>repo://</filename>)</title>
+
+ <para>
+ This fetcher submodule fetches code from
+ <filename>google-repo</filename> source control system.
+ The fetcher works by initiating and syncing sources of the
+ repository into
+ <link linkend='var-REPODIR'><filename>REPODIR</filename></link>,
+ which is usually
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link><filename>/repo</filename>.
+ </para>
+
+ <para>
+ This fetcher supports the following parameters:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>"protocol":</emphasis>
+ Protocol to fetch the repository manifest (default: git).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"branch":</emphasis>
+ Branch or tag of repository to get (default: master).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"manifest":</emphasis>
+ Name of the manifest file (default: <filename>default.xml</filename>).
+ </para></listitem>
+ </itemizedlist>
+ Here are some example URLs:
+ <literallayout class='monospaced'>
+ SRC_URI = "repo://REPOROOT;protocol=git;branch=some_branch;manifest=my_manifest.xml"
+ SRC_URI = "repo://REPOROOT;protocol=file;branch=some_branch;manifest=my_manifest.xml"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='other-fetchers'>
+ <title>Other Fetchers</title>
+
+ <para>
+ Fetch submodules also exist for the following:
+ <itemizedlist>
+ <listitem><para>
+ Bazaar (<filename>bzr://</filename>)
+ </para></listitem>
+ <listitem><para>
+ Trees using Git Annex (<filename>gitannex://</filename>)
+ </para></listitem>
+ <listitem><para>
+ Secure FTP (<filename>sftp://</filename>)
+ </para></listitem>
+ <listitem><para>
+ Secure Shell (<filename>ssh://</filename>)
+ </para></listitem>
+ <listitem><para>
+ OSC (<filename>osc://</filename>)
+ </para></listitem>
+ <listitem><para>
+ Mercurial (<filename>hg://</filename>)
+ </para></listitem>
+ </itemizedlist>
+ No documentation currently exists for these lesser used
+ fetcher submodules.
+ However, you might find the code helpful and readable.
+ </para>
+ </section>
+ </section>
+
+ <section id='auto-revisions'>
+ <title>Auto Revisions</title>
+
+ <para>
+ We need to document <filename>AUTOREV</filename> and
+ <filename>SRCREV_FORMAT</filename> here.
+ </para>
+ </section>
+</chapter>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
new file mode 100644
index 000000000..9076f0fcd
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml
@@ -0,0 +1,513 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<appendix id='hello-world-example'>
+ <title>Hello World Example</title>
+
+ <section id='bitbake-hello-world'>
+ <title>BitBake Hello World</title>
+
+ <para>
+ The simplest example commonly used to demonstrate any new
+ programming language or tool is the
+ "<ulink url="http://en.wikipedia.org/wiki/Hello_world_program">Hello World</ulink>"
+ example.
+ This appendix demonstrates, in tutorial form, Hello
+ World within the context of BitBake.
+ The tutorial describes how to create a new project
+ and the applicable metadata files necessary to allow
+ BitBake to build it.
+ </para>
+ </section>
+
+ <section id='example-obtaining-bitbake'>
+ <title>Obtaining BitBake</title>
+
+ <para>
+ See the
+ "<link linkend='obtaining-bitbake'>Obtaining BitBake</link>"
+ section for information on how to obtain BitBake.
+ Once you have the source code on your machine, the BitBake directory
+ appears as follows:
+ <literallayout class='monospaced'>
+ $ ls -al
+ total 100
+ drwxrwxr-x. 9 wmat wmat 4096 Jan 31 13:44 .
+ drwxrwxr-x. 3 wmat wmat 4096 Feb 4 10:45 ..
+ -rw-rw-r--. 1 wmat wmat 365 Nov 26 04:55 AUTHORS
+ drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 bin
+ drwxrwxr-x. 4 wmat wmat 4096 Jan 31 13:44 build
+ -rw-rw-r--. 1 wmat wmat 16501 Nov 26 04:55 ChangeLog
+ drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 classes
+ drwxrwxr-x. 2 wmat wmat 4096 Nov 26 04:55 conf
+ drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 contrib
+ -rw-rw-r--. 1 wmat wmat 17987 Nov 26 04:55 COPYING
+ drwxrwxr-x. 3 wmat wmat 4096 Nov 26 04:55 doc
+ -rw-rw-r--. 1 wmat wmat 69 Nov 26 04:55 .gitignore
+ -rw-rw-r--. 1 wmat wmat 849 Nov 26 04:55 HEADER
+ drwxrwxr-x. 5 wmat wmat 4096 Jan 31 13:44 lib
+ -rw-rw-r--. 1 wmat wmat 195 Nov 26 04:55 MANIFEST.in
+ -rw-rw-r--. 1 wmat wmat 2887 Nov 26 04:55 TODO
+ </literallayout>
+ </para>
+
+ <para>
+ At this point, you should have BitBake cloned to
+ a directory that matches the previous listing except for
+ dates and user names.
+ </para>
+ </section>
+
+ <section id='setting-up-the-bitbake-environment'>
+ <title>Setting Up the BitBake Environment</title>
+
+ <para>
+ First, you need to be sure that you can run BitBake.
+ Set your working directory to where your local BitBake
+ files are and run the following command:
+ <literallayout class='monospaced'>
+ $ ./bin/bitbake --version
+ BitBake Build Tool Core version 1.23.0, bitbake version 1.23.0
+ </literallayout>
+ The console output tells you what version you are running.
+ </para>
+
+ <para>
+ The recommended method to run BitBake is from a directory of your
+ choice.
+ To be able to run BitBake from any directory, you need to add the
+ executable binary to your binary to your shell's environment
+ <filename>PATH</filename> variable.
+ First, look at your current <filename>PATH</filename> variable
+ by entering the following:
+ <literallayout class='monospaced'>
+ $ echo $PATH
+ </literallayout>
+ Next, add the directory location for the BitBake binary to the
+ <filename>PATH</filename>.
+ Here is an example that adds the
+ <filename>/home/scott-lenovo/bitbake/bin</filename> directory
+ to the front of the <filename>PATH</filename> variable:
+ <literallayout class='monospaced'>
+ $ export PATH=/home/scott-lenovo/bitbake/bin:$PATH
+ </literallayout>
+ You should now be able to enter the <filename>bitbake</filename>
+ command from the command line while working from any directory.
+ </para>
+ </section>
+
+ <section id='the-hello-world-example'>
+ <title>The Hello World Example</title>
+
+ <para>
+ The overall goal of this exercise is to build a
+ complete "Hello World" example utilizing task and layer
+ concepts.
+ Because this is how modern projects such as OpenEmbedded and
+ the Yocto Project utilize BitBake, the example
+ provides an excellent starting point for understanding
+ BitBake.
+ </para>
+
+ <para>
+ To help you understand how to use BitBake to build targets,
+ the example starts with nothing but the <filename>bitbake</filename>
+ command, which causes BitBake to fail and report problems.
+ The example progresses by adding pieces to the build to
+ eventually conclude with a working, minimal "Hello World"
+ example.
+ </para>
+
+ <para>
+ While every attempt is made to explain what is happening during
+ the example, the descriptions cannot cover everything.
+ You can find further information throughout this manual.
+ Also, you can actively participate in the
+ <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'></ulink>
+ discussion mailing list about the BitBake build tool.
+ </para>
+
+ <note>
+ This example was inspired by and drew heavily from
+ <ulink url="http://www.mail-archive.com/yocto@yoctoproject.org/msg09379.html">Mailing List post - The BitBake equivalent of "Hello, World!"</ulink>.
+ </note>
+
+ <para>
+ As stated earlier, the goal of this example
+ is to eventually compile "Hello World".
+ However, it is unknown what BitBake needs and what you have
+ to provide in order to achieve that goal.
+ Recall that BitBake utilizes three types of metadata files:
+ <link linkend='configuration-files'>Configuration Files</link>,
+ <link linkend='classes'>Classes</link>, and
+ <link linkend='recipes'>Recipes</link>.
+ But where do they go?
+ How does BitBake find them?
+ BitBake's error messaging helps you answer these types of questions
+ and helps you better understand exactly what is going on.
+ </para>
+
+ <para>
+ Following is the complete "Hello World" example.
+ </para>
+
+ <orderedlist>
+ <listitem><para><emphasis>Create a Project Directory:</emphasis>
+ First, set up a directory for the "Hello World" project.
+ Here is how you can do so in your home directory:
+ <literallayout class='monospaced'>
+ $ mkdir ~/hello
+ $ cd ~/hello
+ </literallayout>
+ This is the directory that BitBake will use to do all of
+ its work.
+ You can use this directory to keep all the metafiles needed
+ by BitBake.
+ Having a project directory is a good way to isolate your
+ project.
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake:</emphasis>
+ At this point, you have nothing but a project directory.
+ Run the <filename>bitbake</filename> command and see what
+ it does:
+ <literallayout class='monospaced'>
+ $ bitbake
+ The BBPATH variable is not set and bitbake did not
+ find a conf/bblayers.conf file in the expected location.
+ Maybe you accidentally invoked bitbake from the wrong directory?
+ DEBUG: Removed the following variables from the environment:
+ GNOME_DESKTOP_SESSION_ID, XDG_CURRENT_DESKTOP,
+ GNOME_KEYRING_CONTROL, DISPLAY, SSH_AGENT_PID, LANG, no_proxy,
+ XDG_SESSION_PATH, XAUTHORITY, SESSION_MANAGER, SHLVL,
+ MANDATORY_PATH, COMPIZ_CONFIG_PROFILE, WINDOWID, EDITOR,
+ GPG_AGENT_INFO, SSH_AUTH_SOCK, GDMSESSION, GNOME_KEYRING_PID,
+ XDG_SEAT_PATH, XDG_CONFIG_DIRS, LESSOPEN, DBUS_SESSION_BUS_ADDRESS,
+ _, XDG_SESSION_COOKIE, DESKTOP_SESSION, LESSCLOSE, DEFAULTS_PATH,
+ UBUNTU_MENUPROXY, OLDPWD, XDG_DATA_DIRS, COLORTERM, LS_COLORS
+ </literallayout>
+ The majority of this output is specific to environment variables
+ that are not directly relevant to BitBake.
+ However, the very first message regarding the
+ <filename>BBPATH</filename> variable and the
+ <filename>conf/bblayers.conf</filename> file
+ is relevant.</para>
+ <para>
+ When you run BitBake, it begins looking for metadata files.
+ The
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ variable is what tells BitBake where to look for those files.
+ <filename>BBPATH</filename> is not set and you need to set it.
+ Without <filename>BBPATH</filename>, Bitbake cannot
+ find any configuration files (<filename>.conf</filename>)
+ or recipe files (<filename>.bb</filename>) at all.
+ BitBake also cannot find the <filename>bitbake.conf</filename>
+ file.
+ </para></listitem>
+ <listitem><para><emphasis>Setting <filename>BBPATH</filename>:</emphasis>
+ For this example, you can set <filename>BBPATH</filename>
+ in the same manner that you set <filename>PATH</filename>
+ earlier in the appendix.
+ You should realize, though, that it is much more flexible to set the
+ <filename>BBPATH</filename> variable up in a configuration
+ file for each project.</para>
+ <para>From your shell, enter the following commands to set and
+ export the <filename>BBPATH</filename> variable:
+ <literallayout class='monospaced'>
+ $ BBPATH="<replaceable>projectdirectory</replaceable>"
+ $ export BBPATH
+ </literallayout>
+ Use your actual project directory in the command.
+ BitBake uses that directory to find the metadata it needs for
+ your project.
+ <note>
+ When specifying your project directory, do not use the
+ tilde ("~") character as BitBake does not expand that character
+ as the shell would.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake:</emphasis>
+ Now that you have <filename>BBPATH</filename> defined, run
+ the <filename>bitbake</filename> command again:
+ <literallayout class='monospaced'>
+ $ bitbake
+ ERROR: Traceback (most recent call last):
+ File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
+ return func(fn, *args)
+ File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 173, in parse_config_file
+ return bb.parse.handle(fn, data, include)
+ File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 99, in handle
+ return h['handle'](fn, data, include)
+ File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 120, in handle
+ abs_fn = resolve_file(fn, data)
+ File "/home/scott-lenovo/bitbake/lib/bb/parse/__init__.py", line 117, in resolve_file
+ raise IOError("file %s not found in %s" % (fn, bbpath))
+ IOError: file conf/bitbake.conf not found in /home/scott-lenovo/hello
+
+ ERROR: Unable to parse conf/bitbake.conf: file conf/bitbake.conf not found in /home/scott-lenovo/hello
+ </literallayout>
+ This sample output shows that BitBake could not find the
+ <filename>conf/bitbake.conf</filename> file in the project
+ directory.
+ This file is the first thing BitBake must find in order
+ to build a target.
+ And, since the project directory for this example is
+ empty, you need to provide a <filename>conf/bitbake.conf</filename>
+ file.
+ </para></listitem>
+ <listitem><para><emphasis>Creating <filename>conf/bitbake.conf</filename>:</emphasis>
+ The <filename>conf/bitbake.conf</filename> includes a number of
+ configuration variables BitBake uses for metadata and recipe
+ files.
+ For this example, you need to create the file in your project directory
+ and define some key BitBake variables.
+ For more information on the <filename>bitbake.conf</filename> file,
+ see
+ <ulink url='http://git.openembedded.org/bitbake/tree/conf/bitbake.conf'></ulink>.
+ </para>
+ <para>Use the following commands to create the <filename>conf</filename>
+ directory in the project directory:
+ <literallayout class='monospaced'>
+ $ mkdir conf
+ </literallayout>
+ From within the <filename>conf</filename> directory, use
+ some editor to create the <filename>bitbake.conf</filename>
+ so that it contains the following:
+ <literallayout class='monospaced'>
+ <link linkend='var-PN'>PN</link> = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
+ </literallayout>
+ <literallayout class='monospaced'>
+ TMPDIR = "${<link linkend='var-TOPDIR'>TOPDIR</link>}/tmp"
+ <link linkend='var-CACHE'>CACHE</link> = "${TMPDIR}/cache"
+ <link linkend='var-STAMP'>STAMP</link> = "${TMPDIR}/${PN}/stamps"
+ <link linkend='var-T'>T</link> = "${TMPDIR}/${PN}/work"
+ <link linkend='var-B'>B</link> = "${TMPDIR}/${PN}"
+ </literallayout>
+ <note>
+ Without a value for <filename>PN</filename>, the
+ variables <filename>STAMP</filename>,
+ <filename>T</filename>, and <filename>B</filename>,
+ prevent more than one recipe from working. You can fix
+ this by either setting <filename>PN</filename> to have
+ a value similar to what OpenEmbedded and BitBake use
+ in the default <filename>bitbake.conf</filename> file
+ (see previous example). Or, by manually updating each
+ recipe to set <filename>PN</filename>. You will also
+ need to include <filename>PN</filename> as part of the
+ <filename>STAMP</filename>, <filename>T</filename>, and
+ <filename>B</filename> variable definitions in the
+ <filename>local.conf</filename> file.
+ </note>
+ The <filename>TMPDIR</filename> variable establishes a directory
+ that BitBake uses for build output and intermediate files other
+ than the cached information used by the
+ <link linkend='setscene'>Setscene</link> process.
+ Here, the <filename>TMPDIR</filename> directory is set to
+ <filename>hello/tmp</filename>.
+ <note><title>Tip</title>
+ You can always safely delete the <filename>tmp</filename>
+ directory in order to rebuild a BitBake target.
+ The build process creates the directory for you
+ when you run BitBake.
+ </note></para>
+ <para>For information about each of the other variables defined in this
+ example, click on the links to take you to the definitions in
+ the glossary.
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake:</emphasis>
+ After making sure that the <filename>conf/bitbake.conf</filename>
+ file exists, you can run the <filename>bitbake</filename>
+ command again:
+ <literallayout class='monospaced'>
+ $ bitbake
+ ERROR: Traceback (most recent call last):
+ File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
+ return func(fn, *args)
+ File "/home/scott-lenovo/bitbake/lib/bb/cookerdata.py", line 177, in _inherit
+ bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
+ File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/BBHandler.py", line 92, in inherit
+ include(fn, file, lineno, d, "inherit")
+ File "/home/scott-lenovo/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
+ raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
+ ParseError: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
+
+ ERROR: Unable to parse base: ParseError in configuration INHERITs: Could not inherit file classes/base.bbclass
+ </literallayout>
+ In the sample output, BitBake could not find the
+ <filename>classes/base.bbclass</filename> file.
+ You need to create that file next.
+ </para></listitem>
+ <listitem><para><emphasis>Creating <filename>classes/base.bbclass</filename>:</emphasis>
+ BitBake uses class files to provide common code and functionality.
+ The minimally required class for BitBake is the
+ <filename>classes/base.bbclass</filename> file.
+ The <filename>base</filename> class is implicitly inherited by
+ every recipe.
+ BitBake looks for the class in the <filename>classes</filename>
+ directory of the project (i.e <filename>hello/classes</filename>
+ in this example).
+ </para>
+ <para>Create the <filename>classes</filename> directory as follows:
+ <literallayout class='monospaced'>
+ $ cd $HOME/hello
+ $ mkdir classes
+ </literallayout>
+ Move to the <filename>classes</filename> directory and then
+ create the <filename>base.bbclass</filename> file by inserting
+ this single line:
+ <literallayout class='monospaced'>
+ addtask build
+ </literallayout>
+ The minimal task that BitBake runs is the
+ <filename>do_build</filename> task.
+ This is all the example needs in order to build the project.
+ Of course, the <filename>base.bbclass</filename> can have much
+ more depending on which build environments BitBake is
+ supporting.
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake:</emphasis>
+ After making sure that the <filename>classes/base.bbclass</filename>
+ file exists, you can run the <filename>bitbake</filename>
+ command again:
+ <literallayout class='monospaced'>
+ $ bitbake
+ Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.
+ </literallayout>
+ BitBake is finally reporting no errors.
+ However, you can see that it really does not have anything
+ to do.
+ You need to create a recipe that gives BitBake something to do.
+ </para></listitem>
+ <listitem><para><emphasis>Creating a Layer:</emphasis>
+ While it is not really necessary for such a small example,
+ it is good practice to create a layer in which to keep your
+ code separate from the general metadata used by BitBake.
+ Thus, this example creates and uses a layer called "mylayer".
+ <note>
+ You can find additional information on layers in the
+ "<link linkend='layers'>Layers</link>" section.
+ </note></para>
+
+ <para>Minimally, you need a recipe file and a layer configuration
+ file in your layer.
+ The configuration file needs to be in the <filename>conf</filename>
+ directory inside the layer.
+ Use these commands to set up the layer and the <filename>conf</filename>
+ directory:
+ <literallayout class='monospaced'>
+ $ cd $HOME
+ $ mkdir mylayer
+ $ cd mylayer
+ $ mkdir conf
+ </literallayout>
+ Move to the <filename>conf</filename> directory and create a
+ <filename>layer.conf</filename> file that has the following:
+ <literallayout class='monospaced'>
+ BBPATH .= ":${<link linkend='var-LAYERDIR'>LAYERDIR</link>}"
+
+ <link linkend='var-BBFILES'>BBFILES</link> += "${LAYERDIR}/*.bb"
+
+ <link linkend='var-BBFILE_COLLECTIONS'>BBFILE_COLLECTIONS</link> += "mylayer"
+ <link linkend='var-BBFILE_PATTERN'>BBFILE_PATTERN_mylayer</link> := "^${LAYERDIR_RE}/"
+ </literallayout>
+ For information on these variables, click the links
+ to go to the definitions in the glossary.</para>
+ <para>You need to create the recipe file next.
+ Inside your layer at the top-level, use an editor and create
+ a recipe file named <filename>printhello.bb</filename> that
+ has the following:
+ <literallayout class='monospaced'>
+ <link linkend='var-DESCRIPTION'>DESCRIPTION</link> = "Prints Hello World"
+ <link linkend='var-PN'>PN</link> = 'printhello'
+ <link linkend='var-PV'>PV</link> = '1'
+
+ python do_build() {
+ bb.plain("********************");
+ bb.plain("* *");
+ bb.plain("* Hello, World! *");
+ bb.plain("* *");
+ bb.plain("********************");
+ }
+ </literallayout>
+ The recipe file simply provides a description of the
+ recipe, the name, version, and the <filename>do_build</filename>
+ task, which prints out "Hello World" to the console.
+ For more information on these variables, follow the links
+ to the glossary.
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake With a Target:</emphasis>
+ Now that a BitBake target exists, run the command and provide
+ that target:
+ <literallayout class='monospaced'>
+ $ cd $HOME/hello
+ $ bitbake printhello
+ ERROR: no recipe files to build, check your BBPATH and BBFILES?
+
+ Summary: There was 1 ERROR message shown, returning a non-zero exit code.
+ </literallayout>
+ We have created the layer with the recipe and the layer
+ configuration file but it still seems that BitBake cannot
+ find the recipe.
+ BitBake needs a <filename>conf/bblayers.conf</filename> that
+ lists the layers for the project.
+ Without this file, BitBake cannot find the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Creating <filename>conf/bblayers.conf</filename>:</emphasis>
+ BitBake uses the <filename>conf/bblayers.conf</filename> file
+ to locate layers needed for the project.
+ This file must reside in the <filename>conf</filename> directory
+ of the project (i.e. <filename>hello/conf</filename> for this
+ example).</para>
+ <para>Set your working directory to the <filename>hello/conf</filename>
+ directory and then create the <filename>bblayers.conf</filename>
+ file so that it contains the following:
+ <literallayout class='monospaced'>
+ BBLAYERS ?= " \
+ /home/&lt;you&gt;/mylayer \
+ "
+ </literallayout>
+ You need to provide your own information for
+ <filename>you</filename> in the file.
+ </para></listitem>
+ <listitem><para><emphasis>Run Bitbake With a Target:</emphasis>
+ Now that you have supplied the <filename>bblayers.conf</filename>
+ file, run the <filename>bitbake</filename> command and provide
+ the target:
+ <literallayout class='monospaced'>
+ $ bitbake printhello
+ Parsing recipes: 100% |##################################################################################|
+ Time: 00:00:00
+ Parsing of 1 .bb files complete (0 cached, 1 parsed). 1 targets, 0 skipped, 0 masked, 0 errors.
+ NOTE: Resolving any missing task queue dependencies
+ NOTE: Preparing RunQueue
+ NOTE: Executing RunQueue Tasks
+ ********************
+ * *
+ * Hello, World! *
+ * *
+ ********************
+ NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
+ </literallayout>
+ BitBake finds the <filename>printhello</filename> recipe and
+ successfully runs the task.
+ <note>
+ After the first execution, re-running
+ <filename>bitbake printhello</filename> again will not
+ result in a BitBake run that prints the same console
+ output.
+ The reason for this is that the first time the
+ <filename>printhello.bb</filename> recipe's
+ <filename>do_build</filename> task executes
+ successfully, BitBake writes a stamp file for the task.
+ Thus, the next time you attempt to run the task
+ using that same <filename>bitbake</filename> command,
+ BitBake notices the stamp and therefore determines
+ that the task does not need to be re-run.
+ If you delete the <filename>tmp</filename> directory
+ or run <filename>bitbake -c clean printhello</filename>
+ and then re-run the build, the "Hello, World!" message will
+ be printed again.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </section>
+</appendix>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
new file mode 100644
index 000000000..4cf0ed9d1
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml
@@ -0,0 +1,728 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<chapter id="bitbake-user-manual-intro">
+ <title>Overview</title>
+
+ <para>
+ Welcome to the BitBake User Manual.
+ This manual provides information on the BitBake tool.
+ The information attempts to be as independent as possible regarding
+ systems that use BitBake, such as OpenEmbedded and the
+ Yocto Project.
+ In some cases, scenarios or examples within the context of
+ a build system are used in the manual to help with understanding.
+ For these cases, the manual clearly states the context.
+ </para>
+
+ <section id="intro">
+ <title>Introduction</title>
+
+ <para>
+ Fundamentally, BitBake is a generic task execution
+ engine that allows shell and Python tasks to be run
+ efficiently and in parallel while working within
+ complex inter-task dependency constraints.
+ One of BitBake's main users, OpenEmbedded, takes this core
+ and builds embedded Linux software stacks using
+ a task-oriented approach.
+ </para>
+
+ <para>
+ Conceptually, BitBake is similar to GNU Make in
+ some regards but has significant differences:
+ <itemizedlist>
+ <listitem><para>
+ BitBake executes tasks according to provided
+ metadata that builds up the tasks.
+ Metadata is stored in recipe (<filename>.bb</filename>)
+ and related recipe "append" (<filename>.bbappend</filename>)
+ files, configuration (<filename>.conf</filename>) and
+ underlying include (<filename>.inc</filename>) files, and
+ in class (<filename>.bbclass</filename>) files.
+ The metadata provides
+ BitBake with instructions on what tasks to run and
+ the dependencies between those tasks.
+ </para></listitem>
+ <listitem><para>
+ BitBake includes a fetcher library for obtaining source
+ code from various places such as local files, source control
+ systems, or websites.
+ </para></listitem>
+ <listitem><para>
+ The instructions for each unit to be built (e.g. a piece
+ of software) are known as "recipe" files and
+ contain all the information about the unit
+ (dependencies, source file locations, checksums, description
+ and so on).
+ </para></listitem>
+ <listitem><para>
+ BitBake includes a client/server abstraction and can
+ be used from a command line or used as a service over
+ XML-RPC and has several different user interfaces.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="history-and-goals">
+ <title>History and Goals</title>
+
+ <para>
+ BitBake was originally a part of the OpenEmbedded project.
+ It was inspired by the Portage package management system
+ used by the Gentoo Linux distribution.
+ On December 7, 2004, OpenEmbedded project team member
+ Chris Larson split the project into two distinct pieces:
+ <itemizedlist>
+ <listitem><para>BitBake, a generic task executor</para></listitem>
+ <listitem><para>OpenEmbedded, a metadata set utilized by
+ BitBake</para></listitem>
+ </itemizedlist>
+ Today, BitBake is the primary basis of the
+ <ulink url="http://www.openembedded.org/">OpenEmbedded</ulink>
+ project, which is being used to build and maintain Linux
+ distributions such as the
+ <ulink url='http://www.angstrom-distribution.org/'>Angstrom Distribution</ulink>,
+ and which is also being used as the build tool for Linux projects
+ such as the
+ <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink>.
+ </para>
+
+ <para>
+ Prior to BitBake, no other build tool adequately met the needs of
+ an aspiring embedded Linux distribution.
+ All of the build systems used by traditional desktop Linux
+ distributions lacked important functionality, and none of the
+ ad hoc Buildroot-based systems, prevalent in the
+ embedded space, were scalable or maintainable.
+ </para>
+
+ <para>
+ Some important original goals for BitBake were:
+ <itemizedlist>
+ <listitem><para>
+ Handle cross-compilation.
+ </para></listitem>
+ <listitem><para>
+ Handle inter-package dependencies (build time on
+ target architecture, build time on native
+ architecture, and runtime).
+ </para></listitem>
+ <listitem><para>
+ Support running any number of tasks within a given
+ package, including, but not limited to, fetching
+ upstream sources, unpacking them, patching them,
+ configuring them, and so forth.
+ </para></listitem>
+ <listitem><para>
+ Be Linux distribution agnostic for both build and
+ target systems.
+ </para></listitem>
+ <listitem><para>
+ Be architecture agnostic.
+ </para></listitem>
+ <listitem><para>
+ Support multiple build and target operating systems
+ (e.g. Cygwin, the BSDs, and so forth).
+ </para></listitem>
+ <listitem><para>
+ Be self contained, rather than tightly
+ integrated into the build machine's root
+ filesystem.
+ </para></listitem>
+ <listitem><para>
+ Handle conditional metadata on the target architecture,
+ operating system, distribution, and machine.
+ </para></listitem>
+ <listitem><para>
+ Be easy to use the tools to supply local metadata and packages
+ against which to operate.
+ </para></listitem>
+ <listitem><para>
+ Be easy to use BitBake to collaborate between multiple
+ projects for their builds.
+ </para></listitem>
+ <listitem><para>
+ Provide an inheritance mechanism to share
+ common metadata between many packages.
+ </para></listitem>
+ </itemizedlist>
+ Over time it became apparent that some further requirements
+ were necessary:
+ <itemizedlist>
+ <listitem><para>
+ Handle variants of a base recipe (e.g. native, sdk,
+ and multilib).
+ </para></listitem>
+ <listitem><para>
+ Split metadata into layers and allow layers
+ to enhance or override other layers.
+ </para></listitem>
+ <listitem><para>
+ Allow representation of a given set of input variables
+ to a task as a checksum.
+ Based on that checksum, allow acceleration of builds
+ with prebuilt components.
+ </para></listitem>
+ </itemizedlist>
+ BitBake satisfies all the original requirements and many more
+ with extensions being made to the basic functionality to
+ reflect the additional requirements.
+ Flexibility and power have always been the priorities.
+ BitBake is highly extensible and supports embedded Python code and
+ execution of any arbitrary tasks.
+ </para>
+ </section>
+
+ <section id="Concepts">
+ <title>Concepts</title>
+
+ <para>
+ BitBake is a program written in the Python language.
+ At the highest level, BitBake interprets metadata, decides
+ what tasks are required to run, and executes those tasks.
+ Similar to GNU Make, BitBake controls how software is
+ built.
+ GNU Make achieves its control through "makefiles", while
+ BitBake uses "recipes".
+ </para>
+
+ <para>
+ BitBake extends the capabilities of a simple
+ tool like GNU Make by allowing for the definition of much more
+ complex tasks, such as assembling entire embedded Linux
+ distributions.
+ </para>
+
+ <para>
+ The remainder of this section introduces several concepts
+ that should be understood in order to better leverage
+ the power of BitBake.
+ </para>
+
+ <section id='recipes'>
+ <title>Recipes</title>
+
+ <para>
+ BitBake Recipes, which are denoted by the file extension
+ <filename>.bb</filename>, are the most basic metadata files.
+ These recipe files provide BitBake with the following:
+ <itemizedlist>
+ <listitem><para>Descriptive information about the
+ package (author, homepage, license, and so on)</para></listitem>
+ <listitem><para>The version of the recipe</para></listitem>
+ <listitem><para>Existing dependencies (both build
+ and runtime dependencies)</para></listitem>
+ <listitem><para>Where the source code resides and
+ how to fetch it</para></listitem>
+ <listitem><para>Whether the source code requires
+ any patches, where to find them, and how to apply
+ them</para></listitem>
+ <listitem><para>How to configure and compile the
+ source code</para></listitem>
+ <listitem><para>Where on the target machine to install the
+ package or packages created</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Within the context of BitBake, or any project utilizing BitBake
+ as its build system, files with the <filename>.bb</filename>
+ extension are referred to as recipes.
+ <note>
+ The term "package" is also commonly used to describe recipes.
+ However, since the same word is used to describe packaged
+ output from a project, it is best to maintain a single
+ descriptive term - "recipes".
+ Put another way, a single "recipe" file is quite capable
+ of generating a number of related but separately installable
+ "packages".
+ In fact, that ability is fairly common.
+ </note>
+ </para>
+ </section>
+
+ <section id='configuration-files'>
+ <title>Configuration Files</title>
+
+ <para>
+ Configuration files, which are denoted by the
+ <filename>.conf</filename> extension, define
+ various configuration variables that govern the project's build
+ process.
+ These files fall into several areas that define
+ machine configuration options, distribution configuration
+ options, compiler tuning options, general common
+ configuration options, and user configuration options.
+ The main configuration file is the sample
+ <filename>bitbake.conf</filename> file, which is
+ located within the BitBake source tree
+ <filename>conf</filename> directory.
+ </para>
+ </section>
+
+ <section id='classes'>
+ <title>Classes</title>
+
+ <para>
+ Class files, which are denoted by the
+ <filename>.bbclass</filename> extension, contain
+ information that is useful to share between metadata files.
+ The BitBake source tree currently comes with one class metadata file
+ called <filename>base.bbclass</filename>.
+ You can find this file in the
+ <filename>classes</filename> directory.
+ The <filename>base.bbclass</filename> class files is special since it
+ is always included automatically for all recipes
+ and classes.
+ This class contains definitions for standard basic tasks such
+ as fetching, unpacking, configuring (empty by default),
+ compiling (runs any Makefile present), installing (empty by
+ default) and packaging (empty by default).
+ These tasks are often overridden or extended by other classes
+ added during the project development process.
+ </para>
+ </section>
+
+ <section id='layers'>
+ <title>Layers</title>
+
+ <para>
+ Layers allow you to isolate different types of
+ customizations from each other.
+ While you might find it tempting to keep everything in one layer
+ when working on a single project, the more modular you organize
+ your metadata, the easier it is to cope with future changes.
+ </para>
+
+ <para>
+ To illustrate how you can use layers to keep things modular,
+ consider customizations you might make to support a specific target machine.
+ These types of customizations typically reside in a special layer,
+ rather than a general layer, called a Board Support Package (BSP)
+ Layer.
+ Furthermore, the machine customizations should be isolated from
+ recipes and metadata that support a new GUI environment, for
+ example.
+ This situation gives you a couple of layers: one for the machine
+ configurations and one for the GUI environment.
+ It is important to understand, however, that the BSP layer can still
+ make machine-specific additions to recipes within
+ the GUI environment layer without polluting the GUI layer itself
+ with those machine-specific changes.
+ You can accomplish this through a recipe that is a BitBake append
+ (<filename>.bbappend</filename>) file.
+ </para>
+ </section>
+
+ <section id='append-bbappend-files'>
+ <title>Append Files</title>
+
+ <para>
+ Append files, which are files that have the
+ <filename>.bbappend</filename> file extension, extend or
+ override information in an existing recipe file.
+ </para>
+
+ <para>
+ BitBake expects every append file to have a corresponding recipe file.
+ Furthermore, the append file and corresponding recipe file
+ must use the same root filename.
+ The filenames can differ only in the file type suffix used
+ (e.g. <filename>formfactor_0.0.bb</filename> and
+ <filename>formfactor_0.0.bbappend</filename>).
+ </para>
+
+ <para>
+ Information in append files extends or
+ overrides the information in the underlying,
+ similarly-named recipe files.
+ </para>
+
+ <para>
+ When you name an append file, you can use the
+ wildcard character (%) to allow for matching recipe names.
+ For example, suppose you have an append file named
+ as follows:
+ <literallayout class='monospaced'>
+ busybox_1.21.%.bbappend
+ </literallayout>
+ That append file would match any <filename>busybox_1.21.x.bb</filename>
+ version of the recipe.
+ So, the append file would match the following recipe names:
+ <literallayout class='monospaced'>
+ busybox_1.21.1.bb
+ busybox_1.21.2.bb
+ busybox_1.21.3.bb
+ </literallayout>
+ If the <filename>busybox</filename> recipe was updated to
+ <filename>busybox_1.3.0.bb</filename>, the append name would not
+ match.
+ However, if you named the append file
+ <filename>busybox_1.%.bbappend</filename>, then you would have a match.
+ </para>
+
+ <para>
+ In the most general case, you could name the append file something as
+ simple as <filename>busybox_%.bbappend</filename> to be entirely
+ version independent.
+ </para>
+ </section>
+ </section>
+
+ <section id='obtaining-bitbake'>
+ <title>Obtaining BitBake</title>
+
+ <para>
+ You can obtain BitBake several different ways:
+ <itemizedlist>
+ <listitem><para><emphasis>Cloning BitBake:</emphasis>
+ Using Git to clone the BitBake source code repository
+ is the recommended method for obtaining BitBake.
+ Cloning the repository makes it easy to get bug fixes
+ and have access to stable branches and the master
+ branch.
+ Once you have cloned BitBake, you should use
+ the latest stable
+ branch for development since the master branch is for
+ BitBake development and might contain less stable changes.
+ </para>
+ <para>You usually need a version of BitBake
+ that matches the metadata you are using.
+ The metadata is generally backwards compatible but
+ not forward compatible.</para>
+ <para>Here is an example that clones the BitBake repository:
+ <literallayout class='monospaced'>
+ $ git clone git://git.openembedded.org/bitbake
+ </literallayout>
+ This command clones the BitBake Git repository into a
+ directory called <filename>bitbake</filename>.
+ Alternatively, you can
+ designate a directory after the
+ <filename>git clone</filename> command
+ if you want to call the new directory something
+ other than <filename>bitbake</filename>.
+ Here is an example that names the directory
+ <filename>bbdev</filename>:
+ <literallayout class='monospaced'>
+ $ git clone git://git.openembedded.org/bitbake bbdev
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Installation using your Distribution
+ Package Management System:</emphasis>
+ This method is not
+ recommended because the BitBake version that is
+ provided by your distribution, in most cases,
+ is several
+ releases behind a snapshot of the BitBake repository.
+ </para></listitem>
+ <listitem><para><emphasis>Taking a snapshot of BitBake:</emphasis>
+ Downloading a snapshot of BitBake from the
+ source code repository gives you access to a known
+ branch or release of BitBake.
+ <note>
+ Cloning the Git repository, as described earlier,
+ is the preferred method for getting BitBake.
+ Cloning the repository makes it easier to update as
+ patches are added to the stable branches.
+ </note></para>
+ <para>The following example downloads a snapshot of
+ BitBake version 1.17.0:
+ <literallayout class='monospaced'>
+ $ wget http://git.openembedded.org/bitbake/snapshot/bitbake-1.17.0.tar.gz
+ $ tar zxpvf bitbake-1.17.0.tar.gz
+ </literallayout>
+ After extraction of the tarball using the tar utility,
+ you have a directory entitled
+ <filename>bitbake-1.17.0</filename>.
+ </para></listitem>
+ <listitem><para><emphasis>Using the BitBake that Comes With Your
+ Build Checkout:</emphasis>
+ A final possibility for getting a copy of BitBake is that it
+ already comes with your checkout of a larger Bitbake-based build
+ system, such as Poky.
+ Rather than manually checking out individual layers and
+ gluing them together yourself, you can check
+ out an entire build system.
+ The checkout will already include a version of BitBake that
+ has been thoroughly tested for compatibility with the other
+ components.
+ For information on how to check out a particular BitBake-based
+ build system, consult that build system's supporting documentation.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="bitbake-user-manual-command">
+ <title>The BitBake Command</title>
+
+ <para>
+ The <filename>bitbake</filename> command is the primary interface
+ to the BitBake tool.
+ This section presents the BitBake command syntax and provides
+ several execution examples.
+ </para>
+
+ <section id='usage-and-syntax'>
+ <title>Usage and syntax</title>
+
+ <para>
+ Following is the usage and syntax for BitBake:
+ <literallayout class='monospaced'>
+ $ bitbake -h
+ Usage: bitbake [options] [recipename/target recipe:do_task ...]
+
+ Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
+ It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
+ will provide the layer, BBFILES and other configuration information.
+
+ Options:
+ --version show program's version number and exit
+ -h, --help show this help message and exit
+ -b BUILDFILE, --buildfile=BUILDFILE
+ Execute tasks from a specific .bb recipe directly.
+ WARNING: Does not handle any dependencies from other
+ recipes.
+ -k, --continue Continue as much as possible after an error. While the
+ target that failed and anything depending on it cannot
+ be built, as much as possible will be built before
+ stopping.
+ -f, --force Force the specified targets/task to run (invalidating
+ any existing stamp file).
+ -c CMD, --cmd=CMD Specify the task to execute. The exact options
+ available depend on the metadata. Some examples might
+ be 'compile' or 'populate_sysroot' or 'listtasks' may
+ give a list of the tasks available.
+ -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP
+ Invalidate the stamp for the specified task such as
+ 'compile' and then run the default task for the
+ specified target(s).
+ -r PREFILE, --read=PREFILE
+ Read the specified file before bitbake.conf.
+ -R POSTFILE, --postread=POSTFILE
+ Read the specified file after bitbake.conf.
+ -v, --verbose Enable tracing of shell tasks (with 'set -x'). Also
+ print bb.note(...) messages to stdout (in addition to
+ writing them to ${T}/log.do_&lt;task&gt;).
+ -D, --debug Increase the debug level. You can specify this more
+ than once. -D sets the debug level to 1, where only
+ bb.debug(1, ...) messages are printed to stdout; -DD
+ sets the debug level to 2, where both bb.debug(1, ...)
+ and bb.debug(2, ...) messages are printed; etc.
+ Without -D, no debug messages are printed. Note that
+ -D only affects output to stdout. All debug messages
+ are written to ${T}/log.do_taskname, regardless of the
+ debug level.
+ -q, --quiet Output less log message data to the terminal. You can
+ specify this more than once.
+ -n, --dry-run Don't execute, just go through the motions.
+ -S SIGNATURE_HANDLER, --dump-signatures=SIGNATURE_HANDLER
+ Dump out the signature construction information, with
+ no task execution. The SIGNATURE_HANDLER parameter is
+ passed to the handler. Two common values are none and
+ printdiff but the handler may define more/less. none
+ means only dump the signature, printdiff means compare
+ the dumped signature with the cached one.
+ -p, --parse-only Quit after parsing the BB recipes.
+ -s, --show-versions Show current and preferred versions of all recipes.
+ -e, --environment Show the global or per-recipe environment complete
+ with information about where variables were
+ set/changed.
+ -g, --graphviz Save dependency tree information for the specified
+ targets in the dot syntax.
+ -I EXTRA_ASSUME_PROVIDED, --ignore-deps=EXTRA_ASSUME_PROVIDED
+ Assume these dependencies don't exist and are already
+ provided (equivalent to ASSUME_PROVIDED). Useful to
+ make dependency graphs more appealing
+ -l DEBUG_DOMAINS, --log-domains=DEBUG_DOMAINS
+ Show debug logging for the specified logging domains
+ -P, --profile Profile the command and save reports.
+ -u UI, --ui=UI The user interface to use (knotty, ncurses or taskexp
+ - default knotty).
+ --token=XMLRPCTOKEN Specify the connection token to be used when
+ connecting to a remote server.
+ --revisions-changed Set the exit code depending on whether upstream
+ floating revisions have changed or not.
+ --server-only Run bitbake without a UI, only starting a server
+ (cooker) process.
+ -B BIND, --bind=BIND The name/address for the bitbake xmlrpc server to bind
+ to.
+ -T SERVER_TIMEOUT, --idle-timeout=SERVER_TIMEOUT
+ Set timeout to unload bitbake server due to
+ inactivity, set to -1 means no unload, default:
+ Environment variable BB_SERVER_TIMEOUT.
+ --no-setscene Do not run any setscene tasks. sstate will be ignored
+ and everything needed, built.
+ --setscene-only Only run setscene tasks, don't run any real tasks.
+ --remote-server=REMOTE_SERVER
+ Connect to the specified server.
+ -m, --kill-server Terminate any running bitbake server.
+ --observe-only Connect to a server as an observing-only client.
+ --status-only Check the status of the remote bitbake server.
+ -w WRITEEVENTLOG, --write-log=WRITEEVENTLOG
+ Writes the event log of the build to a bitbake event
+ json file. Use '' (empty string) to assign the name
+ automatically.
+ --runall=RUNALL Run the specified task for any recipe in the taskgraph
+ of the specified target (even if it wouldn't otherwise
+ have run).
+ --runonly=RUNONLY Run only the specified task within the taskgraph of
+ the specified targets (and any task dependencies those
+ tasks may have).
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='bitbake-examples'>
+ <title>Examples</title>
+
+ <para>
+ This section presents some examples showing how to use BitBake.
+ </para>
+
+ <section id='example-executing-a-task-against-a-single-recipe'>
+ <title>Executing a Task Against a Single Recipe</title>
+
+ <para>
+ Executing tasks for a single recipe file is relatively simple.
+ You specify the file in question, and BitBake parses
+ it and executes the specified task.
+ If you do not specify a task, BitBake executes the default
+ task, which is "buildâ€.
+ BitBake obeys inter-task dependencies when doing
+ so.
+ </para>
+
+ <para>
+ The following command runs the build task, which is
+ the default task, on the <filename>foo_1.0.bb</filename>
+ recipe file:
+ <literallayout class='monospaced'>
+ $ bitbake -b foo_1.0.bb
+ </literallayout>
+ The following command runs the clean task on the
+ <filename>foo.bb</filename> recipe file:
+ <literallayout class='monospaced'>
+ $ bitbake -b foo.bb -c clean
+ </literallayout>
+ <note>
+ The "-b" option explicitly does not handle recipe
+ dependencies.
+ Other than for debugging purposes, it is instead
+ recommended that you use the syntax presented in the
+ next section.
+ </note>
+ </para>
+ </section>
+
+ <section id='executing-tasks-against-a-set-of-recipe-files'>
+ <title>Executing Tasks Against a Set of Recipe Files</title>
+
+ <para>
+ There are a number of additional complexities introduced
+ when one wants to manage multiple <filename>.bb</filename>
+ files.
+ Clearly there needs to be a way to tell BitBake what
+ files are available and, of those, which you
+ want to execute.
+ There also needs to be a way for each recipe
+ to express its dependencies, both for build-time and
+ runtime.
+ There must be a way for you to express recipe preferences
+ when multiple recipes provide the same functionality, or when
+ there are multiple versions of a recipe.
+ </para>
+
+ <para>
+ The <filename>bitbake</filename> command, when not using
+ "--buildfile" or "-b" only accepts a "PROVIDES".
+ You cannot provide anything else.
+ By default, a recipe file generally "PROVIDES" its
+ "packagename" as shown in the following example:
+ <literallayout class='monospaced'>
+ $ bitbake foo
+ </literallayout>
+ This next example "PROVIDES" the package name and also uses
+ the "-c" option to tell BitBake to just execute the
+ <filename>do_clean</filename> task:
+ <literallayout class='monospaced'>
+ $ bitbake -c clean foo
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='executing-a-list-of-task-and-recipe-combinations'>
+ <title>Executing a List of Task and Recipe Combinations</title>
+
+ <para>
+ The BitBake command line supports specifying different
+ tasks for individual targets when you specify multiple
+ targets.
+ For example, suppose you had two targets (or recipes)
+ <filename>myfirstrecipe</filename> and
+ <filename>mysecondrecipe</filename> and you needed
+ BitBake to run <filename>taskA</filename> for the first
+ recipe and <filename>taskB</filename> for the second
+ recipe:
+ <literallayout class='monospaced'>
+ $ bitbake myfirstrecipe:do_taskA mysecondrecipe:do_taskB
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='generating-dependency-graphs'>
+ <title>Generating Dependency Graphs</title>
+
+ <para>
+ BitBake is able to generate dependency graphs using
+ the <filename>dot</filename> syntax.
+ You can convert these graphs into images using the
+ <filename>dot</filename> tool from
+ <ulink url='http://www.graphviz.org'>Graphviz</ulink>.
+ </para>
+
+ <para>
+ When you generate a dependency graph, BitBake writes three files
+ to the current working directory:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>recipe-depends.dot</filename>:</emphasis>
+ Shows dependencies between recipes (i.e. a collapsed version of
+ <filename>task-depends.dot</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>task-depends.dot</filename>:</emphasis>
+ Shows dependencies between tasks.
+ These dependencies match BitBake's internal task execution list.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>pn-buildlist</filename>:</emphasis>
+ Shows a simple list of targets that are to be built.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ To stop depending on common depends, use the "-I" depend
+ option and BitBake omits them from the graph.
+ Leaving this information out can produce more readable graphs.
+ This way, you can remove from the graph
+ <filename>DEPENDS</filename> from inherited classes
+ such as <filename>base.bbclass</filename>.
+ </para>
+
+ <para>
+ Here are two examples that create dependency graphs.
+ The second example omits depends common in OpenEmbedded from
+ the graph:
+ <literallayout class='monospaced'>
+ $ bitbake -g foo
+
+ $ bitbake -g -I virtual/kernel -I eglibc foo
+ </literallayout>
+ </para>
+ </section>
+ </section>
+ </section>
+</chapter>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
new file mode 100644
index 000000000..b4fc64e75
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
@@ -0,0 +1,2722 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<chapter id="bitbake-user-manual-metadata">
+ <title>Syntax and Operators</title>
+
+ <para>
+ Bitbake files have their own syntax.
+ The syntax has similarities to several
+ other languages but also has some unique features.
+ This section describes the available syntax and operators
+ as well as provides examples.
+ </para>
+
+ <section id='basic-syntax'>
+ <title>Basic Syntax</title>
+
+ <para>
+ This section provides some basic syntax examples.
+ </para>
+
+ <section id='basic-variable-setting'>
+ <title>Basic Variable Setting</title>
+
+ <para>
+ The following example sets <filename>VARIABLE</filename> to
+ "value".
+ This assignment occurs immediately as the statement is parsed.
+ It is a "hard" assignment.
+ <literallayout class='monospaced'>
+ VARIABLE = "value"
+ </literallayout>
+ As expected, if you include leading or trailing spaces as part of
+ an assignment, the spaces are retained:
+ <literallayout class='monospaced'>
+ VARIABLE = " value"
+ VARIABLE = "value "
+ </literallayout>
+ Setting <filename>VARIABLE</filename> to "" sets it to an empty string,
+ while setting the variable to " " sets it to a blank space
+ (i.e. these are not the same values).
+ <literallayout class='monospaced'>
+ VARIABLE = ""
+ VARIABLE = " "
+ </literallayout>
+ </para>
+
+ <para>
+ You can use single quotes instead of double quotes
+ when setting a variable's value.
+ Doing so allows you to use values that contain the double
+ quote character:
+ <literallayout class='monospaced'>
+ VARIABLE = 'I have a " in my value'
+ </literallayout>
+ <note>
+ Unlike in Bourne shells, single quotes work identically
+ to double quotes in all other ways.
+ They do not suppress variable expansions.
+ </note>
+ </para>
+ </section>
+
+ <section id='line-joining'>
+ <title>Line Joining</title>
+
+ <para>
+ Outside of
+ <link linkend='functions'>functions</link>, BitBake joins
+ any line ending in a backslash character ("\")
+ with the following line before parsing statements.
+ The most common use for the "\" character is to split variable
+ assignments over multiple lines, as in the following example:
+ <literallayout class='monospaced'>
+ FOO = "bar \
+ baz \
+ qaz"
+ </literallayout>
+ Both the "\" character and the newline character
+ that follow it are removed when joining lines.
+ Thus, no newline characters end up in the value of
+ <filename>FOO</filename>.
+ </para>
+
+ <para>
+ Consider this additional example where the two
+ assignments both assign "barbaz" to
+ <filename>FOO</filename>:
+ <literallayout class='monospaced'>
+ FOO = "barbaz"
+
+ FOO = "bar\
+ baz"
+ </literallayout>
+ <note>
+ BitBake does not interpret escape sequences like
+ "\n" in variable values.
+ For these to have an effect, the value must be passed
+ to some utility that interprets escape sequences,
+ such as <filename>printf</filename> or
+ <filename>echo -n</filename>.
+ </note>
+ </para>
+ </section>
+
+ <section id='variable-expansion'>
+ <title>Variable Expansion</title>
+
+ <para>
+ Variables can reference the contents of other variables
+ using a syntax that is similar to variable expansion in
+ Bourne shells.
+ The following assignments
+ result in A containing "aval" and B evaluating to "preavalpost".
+ <literallayout class='monospaced'>
+ A = "aval"
+ B = "pre${A}post"
+ </literallayout>
+ <note>
+ Unlike in Bourne shells, the curly braces are mandatory:
+ Only <filename>${FOO}</filename> and not
+ <filename>$FOO</filename> is recognized as an expansion of
+ <filename>FOO</filename>.
+ </note>
+ The "=" operator does not immediately expand variable
+ references in the right-hand side.
+ Instead, expansion is deferred until the variable assigned to
+ is actually used.
+ The result depends on the current values of the referenced
+ variables.
+ The following example should clarify this behavior:
+ <literallayout class='monospaced'>
+ A = "${B} baz"
+ B = "${C} bar"
+ C = "foo"
+ *At this point, ${A} equals "foo bar baz"*
+ C = "qux"
+ *At this point, ${A} equals "qux bar baz"*
+ B = "norf"
+ *At this point, ${A} equals "norf baz"*
+ </literallayout>
+ Contrast this behavior with the
+ <link linkend='immediate-variable-expansion'>immediate variable expansion</link>
+ operator (i.e. ":=").
+ </para>
+
+ <para>
+ If the variable expansion syntax is used on a variable that
+ does not exist, the string is kept as is.
+ For example, given the following assignment,
+ <filename>BAR</filename> expands to the literal string
+ "${FOO}" as long as <filename>FOO</filename> does not exist.
+ <literallayout class='monospaced'>
+ BAR = "${FOO}"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-a-default-value'>
+ <title>Setting a default value (?=)</title>
+
+ <para>
+ You can use the "?=" operator to achieve a "softer" assignment
+ for a variable.
+ This type of assignment allows you to define a variable if it
+ is undefined when the statement is parsed, but to leave the
+ value alone if the variable has a value.
+ Here is an example:
+ <literallayout class='monospaced'>
+ A ?= "aval"
+ </literallayout>
+ If <filename>A</filename> is set at the time this statement is parsed,
+ the variable retains its value.
+ However, if <filename>A</filename> is not set,
+ the variable is set to "aval".
+ <note>
+ This assignment is immediate.
+ Consequently, if multiple "?=" assignments
+ to a single variable exist, the first of those ends up getting
+ used.
+ </note>
+ </para>
+ </section>
+
+ <section id='setting-a-weak-default-value'>
+ <title>Setting a weak default value (??=)</title>
+
+ <para>
+ It is possible to use a "weaker" assignment than in the
+ previous section by using the "??=" operator.
+ This assignment behaves identical to "?=" except that the
+ assignment is made at the end of the parsing process rather
+ than immediately.
+ Consequently, when multiple "??=" assignments exist, the last
+ one is used.
+ Also, any "=" or "?=" assignment will override the value set with
+ "??=".
+ Here is an example:
+ <literallayout class='monospaced'>
+ A ??= "somevalue"
+ A ??= "someothervalue"
+ </literallayout>
+ If <filename>A</filename> is set before the above statements are parsed,
+ the variable retains its value.
+ If <filename>A</filename> is not set,
+ the variable is set to "someothervalue".
+ </para>
+
+ <para>
+ Again, this assignment is a "lazy" or "weak" assignment
+ because it does not occur until the end
+ of the parsing process.
+ </para>
+ </section>
+
+ <section id='immediate-variable-expansion'>
+ <title>Immediate variable expansion (:=)</title>
+
+ <para>
+ The ":=" operator results in a variable's
+ contents being expanded immediately,
+ rather than when the variable is actually used:
+ <literallayout class='monospaced'>
+ T = "123"
+ A := "${B} ${A} test ${T}"
+ T = "456"
+ B = "${T} bval"
+ C = "cval"
+ C := "${C}append"
+ </literallayout>
+ In this example, <filename>A</filename> contains
+ "test 123" because <filename>${B}</filename> and
+ <filename>${A}</filename> at the time of parsing are undefined,
+ which leaves "test 123".
+ And, the variable <filename>C</filename>
+ contains "cvalappend" since <filename>${C}</filename> immediately
+ expands to "cval".
+ </para>
+ </section>
+
+ <section id='appending-and-prepending'>
+ <title>Appending (+=) and prepending (=+) With Spaces</title>
+
+ <para>
+ Appending and prepending values is common and can be accomplished
+ using the "+=" and "=+" operators.
+ These operators insert a space between the current
+ value and prepended or appended value.
+ </para>
+
+ <para>
+ These operators take immediate effect during parsing.
+ Here are some examples:
+ <literallayout class='monospaced'>
+ B = "bval"
+ B += "additionaldata"
+ C = "cval"
+ C =+ "test"
+ </literallayout>
+ The variable <filename>B</filename> contains
+ "bval additionaldata" and <filename>C</filename>
+ contains "test cval".
+ </para>
+ </section>
+
+ <section id='appending-and-prepending-without-spaces'>
+ <title>Appending (.=) and Prepending (=.) Without Spaces</title>
+
+ <para>
+ If you want to append or prepend values without an
+ inserted space, use the ".=" and "=." operators.
+ </para>
+
+ <para>
+ These operators take immediate effect during parsing.
+ Here are some examples:
+ <literallayout class='monospaced'>
+ B = "bval"
+ B .= "additionaldata"
+ C = "cval"
+ C =. "test"
+ </literallayout>
+ The variable <filename>B</filename> contains
+ "bvaladditionaldata" and
+ <filename>C</filename> contains "testcval".
+ </para>
+ </section>
+
+ <section id='appending-and-prepending-override-style-syntax'>
+ <title>Appending and Prepending (Override Style Syntax)</title>
+
+ <para>
+ You can also append and prepend a variable's value
+ using an override style syntax.
+ When you use this syntax, no spaces are inserted.
+ </para>
+
+ <para>
+ These operators differ from the ":=", ".=", "=.", "+=", and "=+"
+ operators in that their effects are deferred
+ until after parsing completes rather than being immediately
+ applied.
+ Here are some examples:
+ <literallayout class='monospaced'>
+ B = "bval"
+ B_append = " additional data"
+ C = "cval"
+ C_prepend = "additional data "
+ D = "dval"
+ D_append = "additional data"
+ </literallayout>
+ The variable <filename>B</filename> becomes
+ "bval additional data" and <filename>C</filename> becomes
+ "additional data cval".
+ The variable <filename>D</filename> becomes
+ "dvaladditional data".
+ <note>
+ You must control all spacing when you use the
+ override syntax.
+ </note>
+ </para>
+
+ <para>
+ It is also possible to append and prepend to shell
+ functions and BitBake-style Python functions.
+ See the
+ "<link linkend='shell-functions'>Shell Functions</link>" and
+ "<link linkend='bitbake-style-python-functions'>BitBake-Style Python Functions</link>
+ sections for examples.
+ </para>
+ </section>
+
+ <section id='removing-override-style-syntax'>
+ <title>Removal (Override Style Syntax)</title>
+
+ <para>
+ You can remove values from lists using the removal
+ override style syntax.
+ Specifying a value for removal causes all occurrences of that
+ value to be removed from the variable.
+ </para>
+
+ <para>
+ When you use this syntax, BitBake expects one or more strings.
+ Surrounding spaces are removed as well.
+ Here is an example:
+ <literallayout class='monospaced'>
+ FOO = "123 456 789 123456 123 456 123 456"
+ FOO_remove = "123"
+ FOO_remove = "456"
+ FOO2 = "abc def ghi abcdef abc def abc def"
+ FOO2_remove = "abc def"
+ </literallayout>
+ The variable <filename>FOO</filename> becomes
+ "789 123456" and <filename>FOO2</filename> becomes
+ "ghi abcdef".
+ </para>
+
+ <para>
+ Like "_append" and "_prepend", "_remove"
+ is deferred until after parsing completes.
+ </para>
+ </section>
+
+ <section id='override-style-operation-advantages'>
+ <title>Override Style Operation Advantages</title>
+
+ <para>
+ An advantage of the override style operations
+ "_append", "_prepend", and "_remove" as compared to the
+ "+=" and "=+" operators is that the override style
+ operators provide guaranteed operations.
+ For example, consider a class <filename>foo.bbclass</filename>
+ that needs to add the value "val" to the variable
+ <filename>FOO</filename>, and a recipe that uses
+ <filename>foo.bbclass</filename> as follows:
+ <literallayout class='monospaced'>
+ inherit foo
+
+ FOO = "initial"
+ </literallayout>
+ If <filename>foo.bbclass</filename> uses the "+=" operator,
+ as follows, then the final value of <filename>FOO</filename>
+ will be "initial", which is not what is desired:
+ <literallayout class='monospaced'>
+ FOO += "val"
+ </literallayout>
+ If, on the other hand, <filename>foo.bbclass</filename>
+ uses the "_append" operator, then the final value of
+ <filename>FOO</filename> will be "initial val", as intended:
+ <literallayout class='monospaced'>
+ FOO_append = " val"
+ </literallayout>
+ <note>
+ It is never necessary to use "+=" together with "_append".
+ The following sequence of assignments appends "barbaz" to
+ <filename>FOO</filename>:
+ <literallayout class='monospaced'>
+ FOO_append = "bar"
+ FOO_append = "baz"
+ </literallayout>
+ The only effect of changing the second assignment in the
+ previous example to use "+=" would be to add a space before
+ "baz" in the appended value (due to how the "+=" operator
+ works).
+ </note>
+ Another advantage of the override style operations is that
+ you can combine them with other overrides as described in the
+ "<link linkend='conditional-syntax-overrides'>Conditional Syntax (Overrides)</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='variable-flag-syntax'>
+ <title>Variable Flag Syntax</title>
+
+ <para>
+ Variable flags are BitBake's implementation of variable properties
+ or attributes.
+ It is a way of tagging extra information onto a variable.
+ You can find more out about variable flags in general in the
+ "<link linkend='variable-flags'>Variable Flags</link>"
+ section.
+ </para>
+
+ <para>
+ You can define, append, and prepend values to variable flags.
+ All the standard syntax operations previously mentioned work
+ for variable flags except for override style syntax
+ (i.e. "_prepend", "_append", and "_remove").
+ </para>
+
+ <para>
+ Here are some examples showing how to set variable flags:
+ <literallayout class='monospaced'>
+ FOO[a] = "abc"
+ FOO[b] = "123"
+ FOO[a] += "456"
+ </literallayout>
+ The variable <filename>FOO</filename> has two flags:
+ <filename>[a]</filename> and <filename>[b]</filename>.
+ The flags are immediately set to "abc" and "123", respectively.
+ The <filename>[a]</filename> flag becomes "abc 456".
+ </para>
+
+ <para>
+ No need exists to pre-define variable flags.
+ You can simply start using them.
+ One extremely common application
+ is to attach some brief documentation to a BitBake variable as
+ follows:
+ <literallayout class='monospaced'>
+ CACHE[doc] = "The directory holding the cache of the metadata."
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='inline-python-variable-expansion'>
+ <title>Inline Python Variable Expansion</title>
+
+ <para>
+ You can use inline Python variable expansion to
+ set variables.
+ Here is an example:
+ <literallayout class='monospaced'>
+ DATE = "${@time.strftime('%Y%m%d',time.gmtime())}"
+ </literallayout>
+ This example results in the <filename>DATE</filename>
+ variable being set to the current date.
+ </para>
+
+ <para>
+ Probably the most common use of this feature is to extract
+ the value of variables from BitBake's internal data dictionary,
+ <filename>d</filename>.
+ The following lines select the values of a package name
+ and its version number, respectively:
+ <literallayout class='monospaced'>
+ PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
+ PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+ </literallayout>
+ <note>
+ Inline Python expressions work just like variable expansions
+ insofar as the "=" and ":=" operators are concerned.
+ Given the following assignment, <filename>foo()</filename>
+ is called each time <filename>FOO</filename> is expanded:
+ <literallayout class='monospaced'>
+ FOO = "${@foo()}"
+ </literallayout>
+ Contrast this with the following immediate assignment, where
+ <filename>foo()</filename> is only called once, while the
+ assignment is parsed:
+ <literallayout class='monospaced'>
+ FOO := "${@foo()}"
+ </literallayout>
+ </note>
+ For a different way to set variables with Python code during
+ parsing, see the
+ "<link linkend='anonymous-python-functions'>Anonymous Python Functions</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='unsetting-variables'>
+ <title>Unseting variables</title>
+
+ <para>
+ It is possible to completely remove a variable or a variable flag
+ from BitBake's internal data dictionary by using the "unset" keyword.
+ Here is an example:
+ <literallayout class='monospaced'>
+ unset DATE
+ unset do_fetch[noexec]
+ </literallayout>
+ These two statements remove the <filename>DATE</filename> and the
+ <filename>do_fetch[noexec]</filename> flag.
+ </para>
+
+ </section>
+
+ <section id='providing-pathnames'>
+ <title>Providing Pathnames</title>
+
+ <para>
+ When specifying pathnames for use with BitBake,
+ do not use the tilde ("~") character as a shortcut
+ for your home directory.
+ Doing so might cause BitBake to not recognize the
+ path since BitBake does not expand this character in
+ the same way a shell would.
+ </para>
+
+ <para>
+ Instead, provide a fuller path as the following
+ example illustrates:
+ <literallayout class='monospaced'>
+ BBLAYERS ?= " \
+ /home/scott-lenovo/LayerA \
+ "
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='exporting-variables-to-the-environment'>
+ <title>Exporting Variables to the Environment</title>
+
+ <para>
+ You can export variables to the environment of running
+ tasks by using the <filename>export</filename> keyword.
+ For example, in the following example, the
+ <filename>do_foo</filename> task prints "value from
+ the environment" when run:
+ <literallayout class='monospaced'>
+ export ENV_VARIABLE
+ ENV_VARIABLE = "value from the environment"
+
+ do_foo() {
+ bbplain "$ENV_VARIABLE"
+ }
+ </literallayout>
+ <note>
+ BitBake does not expand <filename>$ENV_VARIABLE</filename>
+ in this case because it lacks the obligatory
+ <filename>{}</filename>.
+ Rather, <filename>$ENV_VARIABLE</filename> is expanded
+ by the shell.
+ </note>
+ It does not matter whether
+ <filename>export ENV_VARIABLE</filename> appears before or
+ after assignments to <filename>ENV_VARIABLE</filename>.
+ </para>
+
+ <para>
+ It is also possible to combine <filename>export</filename>
+ with setting a value for the variable.
+ Here is an example:
+ <literallayout class='monospaced'>
+ export ENV_VARIABLE = "<replaceable>variable-value</replaceable>"
+ </literallayout>
+ In the output of <filename>bitbake -e</filename>, variables
+ that are exported to the environment are preceded by "export".
+ </para>
+
+ <para>
+ Among the variables commonly exported to the environment
+ are <filename>CC</filename> and <filename>CFLAGS</filename>,
+ which are picked up by many build systems.
+ </para>
+ </section>
+
+ <section id='conditional-syntax-overrides'>
+ <title>Conditional Syntax (Overrides)</title>
+
+ <para>
+ BitBake uses
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ to control what variables are overridden after BitBake
+ parses recipes and configuration files.
+ This section describes how you can use
+ <filename>OVERRIDES</filename> as conditional metadata,
+ talks about key expansion in relationship to
+ <filename>OVERRIDES</filename>, and provides some examples
+ to help with understanding.
+ </para>
+
+ <section id='conditional-metadata'>
+ <title>Conditional Metadata</title>
+
+ <para>
+ You can use <filename>OVERRIDES</filename> to conditionally select
+ a specific version of a variable and to conditionally
+ append or prepend the value of a variable.
+ <note>
+ Overrides can only use lower-case characters.
+ Additionally, underscores are not permitted in override names
+ as they are used to separate overrides from each other and
+ from the variable name.
+ </note>
+ <itemizedlist>
+ <listitem><para><emphasis>Selecting a Variable:</emphasis>
+ The <filename>OVERRIDES</filename> variable is
+ a colon-character-separated list that contains items
+ for which you want to satisfy conditions.
+ Thus, if you have a variable that is conditional on “armâ€, and “armâ€
+ is in <filename>OVERRIDES</filename>, then the “armâ€-specific
+ version of the variable is used rather than the non-conditional
+ version.
+ Here is an example:
+ <literallayout class='monospaced'>
+ OVERRIDES = "architecture:os:machine"
+ TEST = "default"
+ TEST_os = "osspecific"
+ TEST_nooverride = "othercondvalue"
+ </literallayout>
+ In this example, the <filename>OVERRIDES</filename>
+ variable lists three overrides:
+ "architecture", "os", and "machine".
+ The variable <filename>TEST</filename> by itself has a default
+ value of "default".
+ You select the os-specific version of the <filename>TEST</filename>
+ variable by appending the "os" override to the variable
+ (i.e.<filename>TEST_os</filename>).
+ </para>
+
+ <para>
+ To better understand this, consider a practical example
+ that assumes an OpenEmbedded metadata-based Linux
+ kernel recipe file.
+ The following lines from the recipe file first set
+ the kernel branch variable <filename>KBRANCH</filename>
+ to a default value, then conditionally override that
+ value based on the architecture of the build:
+ <literallayout class='monospaced'>
+ KBRANCH = "standard/base"
+ KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
+ KBRANCH_qemumips = "standard/mti-malta32"
+ KBRANCH_qemuppc = "standard/qemuppc"
+ KBRANCH_qemux86 = "standard/common-pc/base"
+ KBRANCH_qemux86-64 = "standard/common-pc-64/base"
+ KBRANCH_qemumips64 = "standard/mti-malta64"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Appending and Prepending:</emphasis>
+ BitBake also supports append and prepend operations to
+ variable values based on whether a specific item is
+ listed in <filename>OVERRIDES</filename>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ DEPENDS = "glibc ncurses"
+ OVERRIDES = "machine:local"
+ DEPENDS_append_machine = " libmad"
+ </literallayout>
+ In this example, <filename>DEPENDS</filename> becomes
+ "glibc ncurses libmad".
+ </para>
+
+ <para>
+ Again, using an OpenEmbedded metadata-based
+ kernel recipe file as an example, the
+ following lines will conditionally append to the
+ <filename>KERNEL_FEATURES</filename> variable based
+ on the architecture:
+ <literallayout class='monospaced'>
+ KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+ KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+ KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Setting a Variable for a Single Task:</emphasis>
+ BitBake supports setting a variable just for the
+ duration of a single task.
+ Here is an example:
+ <literallayout class='monospaced'>
+ FOO_task-configure = "val 1"
+ FOO_task-compile = "val 2"
+ </literallayout>
+ In the previous example, <filename>FOO</filename>
+ has the value "val 1" while the
+ <filename>do_configure</filename> task is executed,
+ and the value "val 2" while the
+ <filename>do_compile</filename> task is executed.
+ </para>
+
+ <para>Internally, this is implemented by prepending
+ the task (e.g. "task-compile:") to the value of
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ for the local datastore of the <filename>do_compile</filename>
+ task.</para>
+
+ <para>You can also use this syntax with other combinations
+ (e.g. "<filename>_prepend</filename>") as shown in the
+ following example:
+ <literallayout class='monospaced'>
+ EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='key-expansion'>
+ <title>Key Expansion</title>
+
+ <para>
+ Key expansion happens when the BitBake datastore is finalized
+ just before BitBake expands overrides.
+ To better understand this, consider the following example:
+ <literallayout class='monospaced'>
+ A${B} = "X"
+ B = "2"
+ A2 = "Y"
+ </literallayout>
+ In this case, after all the parsing is complete, and
+ before any overrides are handled, BitBake expands
+ <filename>${B}</filename> into "2".
+ This expansion causes <filename>A2</filename>, which was
+ set to "Y" before the expansion, to become "X".
+ </para>
+ </section>
+
+ <section id='variable-interaction-worked-examples'>
+ <title>Examples</title>
+
+ <para>
+ Despite the previous explanations that show the different forms of
+ variable definitions, it can be hard to work
+ out exactly what happens when variable operators, conditional
+ overrides, and unconditional overrides are combined.
+ This section presents some common scenarios along
+ with explanations for variable interactions that
+ typically confuse users.
+ </para>
+
+ <para>
+ There is often confusion concerning the order in which
+ overrides and various "append" operators take effect.
+ Recall that an append or prepend operation using "_append"
+ and "_prepend" does not result in an immediate assignment
+ as would "+=", ".=", "=+", or "=.".
+ Consider the following example:
+ <literallayout class='monospaced'>
+ OVERRIDES = "foo"
+ A = "Z"
+ A_foo_append = "X"
+ </literallayout>
+ For this case, <filename>A</filename> is
+ unconditionally set to "Z" and "X" is
+ unconditionally and immediately appended to the variable
+ <filename>A_foo</filename>.
+ Because overrides have not been applied yet,
+ <filename>A_foo</filename> is set to "X" due to the append
+ and <filename>A</filename> simply equals "Z".
+ </para>
+
+ <para>
+ Applying overrides, however, changes things.
+ Since "foo" is listed in <filename>OVERRIDES</filename>,
+ the conditional variable <filename>A</filename> is replaced
+ with the "foo" version, which is equal to "X".
+ So effectively, <filename>A_foo</filename> replaces <filename>A</filename>.
+ </para>
+
+ <para>
+ This next example changes the order of the override and
+ the append:
+ <literallayout class='monospaced'>
+ OVERRIDES = "foo"
+ A = "Z"
+ A_append_foo = "X"
+ </literallayout>
+ For this case, before overrides are handled,
+ <filename>A</filename> is set to "Z" and <filename>A_append_foo</filename>
+ is set to "X".
+ Once the override for "foo" is applied, however,
+ <filename>A</filename> gets appended with "X".
+ Consequently, <filename>A</filename> becomes "ZX".
+ Notice that spaces are not appended.
+ </para>
+
+ <para>
+ This next example has the order of the appends and overrides reversed
+ back as in the first example:
+ <literallayout class='monospaced'>
+ OVERRIDES = "foo"
+ A = "Y"
+ A_foo_append = "Z"
+ A_foo_append = "X"
+ </literallayout>
+ For this case, before any overrides are resolved,
+ <filename>A</filename> is set to "Y" using an immediate assignment.
+ After this immediate assignment, <filename>A_foo</filename> is set
+ to "Z", and then further appended with
+ "X" leaving the variable set to "ZX".
+ Finally, applying the override for "foo" results in the conditional
+ variable <filename>A</filename> becoming "ZX" (i.e.
+ <filename>A</filename> is replaced with <filename>A_foo</filename>).
+ </para>
+
+ <para>
+ This final example mixes in some varying operators:
+ <literallayout class='monospaced'>
+ A = "1"
+ A_append = "2"
+ A_append = "3"
+ A += "4"
+ A .= "5"
+ </literallayout>
+ For this case, the type of append operators are affecting the
+ order of assignments as BitBake passes through the code
+ multiple times.
+ Initially, <filename>A</filename> is set to "1 45" because
+ of the three statements that use immediate operators.
+ After these assignments are made, BitBake applies the
+ "_append" operations.
+ Those operations result in <filename>A</filename> becoming "1 4523".
+ </para>
+ </section>
+ </section>
+
+ <section id='sharing-functionality'>
+ <title>Sharing Functionality</title>
+
+ <para>
+ BitBake allows for metadata sharing through include files
+ (<filename>.inc</filename>) and class files
+ (<filename>.bbclass</filename>).
+ For example, suppose you have a piece of common functionality
+ such as a task definition that you want to share between
+ more than one recipe.
+ In this case, creating a <filename>.bbclass</filename>
+ file that contains the common functionality and then using
+ the <filename>inherit</filename> directive in your recipes to
+ inherit the class would be a common way to share the task.
+ </para>
+
+ <para>
+ This section presents the mechanisms BitBake provides to
+ allow you to share functionality between recipes.
+ Specifically, the mechanisms include <filename>include</filename>,
+ <filename>inherit</filename>, <filename>INHERIT</filename>, and
+ <filename>require</filename> directives.
+ </para>
+
+ <section id='locating-include-and-class-files'>
+ <title>Locating Include and Class Files</title>
+
+ <para>
+ BitBake uses the
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ variable to locate needed include and class files.
+ Additionally, BitBake searches the current directory for
+ <filename>include</filename> and <filename>require</filename>
+ directives.
+ <note>
+ The <filename>BBPATH</filename> variable is analogous to
+ the environment variable <filename>PATH</filename>.
+ </note>
+ </para>
+
+ <para>
+ In order for include and class files to be found by BitBake,
+ they need to be located in a "classes" subdirectory that can
+ be found in <filename>BBPATH</filename>.
+ </para>
+ </section>
+
+ <section id='inherit-directive'>
+ <title><filename>inherit</filename> Directive</title>
+
+ <para>
+ When writing a recipe or class file, you can use the
+ <filename>inherit</filename> directive to inherit the
+ functionality of a class (<filename>.bbclass</filename>).
+ BitBake only supports this directive when used within recipe
+ and class files (i.e. <filename>.bb</filename> and
+ <filename>.bbclass</filename>).
+ </para>
+
+ <para>
+ The <filename>inherit</filename> directive is a rudimentary
+ means of specifying functionality contained in class files
+ that your recipes require.
+ For example, you can easily abstract out the tasks involved in
+ building a package that uses Autoconf and Automake and put
+ those tasks into a class file and then have your recipe
+ inherit that class file.
+ </para>
+
+ <para>
+ As an example, your recipes could use the following directive
+ to inherit an <filename>autotools.bbclass</filename> file.
+ The class file would contain common functionality for using
+ Autotools that could be shared across recipes:
+ <literallayout class='monospaced'>
+ inherit autotools
+ </literallayout>
+ In this case, BitBake would search for the directory
+ <filename>classes/autotools.bbclass</filename>
+ in <filename>BBPATH</filename>.
+ <note>
+ You can override any values and functions of the
+ inherited class within your recipe by doing so
+ after the "inherit" statement.
+ </note>
+ If you want to use the directive to inherit
+ multiple classes, separate them with spaces.
+ The following example shows how to inherit both the
+ <filename>buildhistory</filename> and <filename>rm_work</filename>
+ classes:
+ <literallayout class='monospaced'>
+ inherit buildhistory rm_work
+ </literallayout>
+ </para>
+
+ <para>
+ An advantage with the inherit directive as compared to both
+ the
+ <link linkend='include-directive'>include</link> and
+ <link linkend='require-inclusion'>require</link> directives
+ is that you can inherit class files conditionally.
+ You can accomplish this by using a variable expression
+ after the <filename>inherit</filename> statement.
+ Here is an example:
+ <literallayout class='monospaced'>
+ inherit ${VARNAME}
+ </literallayout>
+ If <filename>VARNAME</filename> is going to be set, it needs
+ to be set before the <filename>inherit</filename> statement
+ is parsed.
+ One way to achieve a conditional inherit in this case is to use
+ overrides:
+ <literallayout class='monospaced'>
+ VARIABLE = ""
+ VARIABLE_someoverride = "myclass"
+ </literallayout>
+ </para>
+
+ <para>
+ Another method is by using anonymous Python.
+ Here is an example:
+ <literallayout class='monospaced'>
+ python () {
+ if condition == value:
+ d.setVar('VARIABLE', 'myclass')
+ else:
+ d.setVar('VARIABLE', '')
+ }
+ </literallayout>
+ </para>
+
+ <para>
+ Alternatively, you could use an in-line Python expression
+ in the following form:
+ <literallayout class='monospaced'>
+ inherit ${@'classname' if condition else ''}
+ inherit ${@functionname(params)}
+ </literallayout>
+ In all cases, if the expression evaluates to an empty
+ string, the statement does not trigger a syntax error
+ because it becomes a no-op.
+ </para>
+ </section>
+
+ <section id='include-directive'>
+ <title><filename>include</filename> Directive</title>
+
+ <para>
+ BitBake understands the <filename>include</filename>
+ directive.
+ This directive causes BitBake to parse whatever file you specify,
+ and to insert that file at that location.
+ The directive is much like its equivalent in Make except
+ that if the path specified on the include line is a relative
+ path, BitBake locates the first file it can find
+ within <filename>BBPATH</filename>.
+ </para>
+
+ <para>
+ The include directive is a more generic method of including
+ functionality as compared to the
+ <link linkend='inherit-directive'>inherit</link> directive,
+ which is restricted to class (i.e. <filename>.bbclass</filename>)
+ files.
+ The include directive is applicable for any other kind of
+ shared or encapsulated functionality or configuration that
+ does not suit a <filename>.bbclass</filename> file.
+ </para>
+
+ <para>
+ As an example, suppose you needed a recipe to include some
+ self-test definitions:
+ <literallayout class='monospaced'>
+ include test_defs.inc
+ </literallayout>
+ <note>
+ The <filename>include</filename> directive does not
+ produce an error when the file cannot be found.
+ Consequently, it is recommended that if the file you
+ are including is expected to exist, you should use
+ <link linkend='require-inclusion'><filename>require</filename></link>
+ instead of <filename>include</filename>.
+ Doing so makes sure that an error is produced if the
+ file cannot be found.
+ </note>
+ </para>
+ </section>
+
+ <section id='require-inclusion'>
+ <title><filename>require</filename> Directive</title>
+
+ <para>
+ BitBake understands the <filename>require</filename>
+ directive.
+ This directive behaves just like the
+ <filename>include</filename> directive with the exception that
+ BitBake raises a parsing error if the file to be included cannot
+ be found.
+ Thus, any file you require is inserted into the file that is
+ being parsed at the location of the directive.
+ </para>
+
+ <para>
+ The require directive, like the include directive previously
+ described, is a more generic method of including
+ functionality as compared to the
+ <link linkend='inherit-directive'>inherit</link> directive,
+ which is restricted to class (i.e. <filename>.bbclass</filename>)
+ files.
+ The require directive is applicable for any other kind of
+ shared or encapsulated functionality or configuration that
+ does not suit a <filename>.bbclass</filename> file.
+ </para>
+
+ <para>
+ Similar to how BitBake handles
+ <link linkend='include-directive'><filename>include</filename></link>,
+ if the path specified
+ on the require line is a relative path, BitBake locates
+ the first file it can find within <filename>BBPATH</filename>.
+ </para>
+
+ <para>
+ As an example, suppose you have two versions of a recipe
+ (e.g. <filename>foo_1.2.2.bb</filename> and
+ <filename>foo_2.0.0.bb</filename>) where
+ each version contains some identical functionality that could be
+ shared.
+ You could create an include file named <filename>foo.inc</filename>
+ that contains the common definitions needed to build "foo".
+ You need to be sure <filename>foo.inc</filename> is located in the
+ same directory as your two recipe files as well.
+ Once these conditions are set up, you can share the functionality
+ using a <filename>require</filename> directive from within each
+ recipe:
+ <literallayout class='monospaced'>
+ require foo.inc
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='inherit-configuration-directive'>
+ <title><filename>INHERIT</filename> Configuration Directive</title>
+
+ <para>
+ When creating a configuration file (<filename>.conf</filename>),
+ you can use the
+ <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
+ configuration directive to inherit a class.
+ BitBake only supports this directive when used within
+ a configuration file.
+ </para>
+
+ <para>
+ As an example, suppose you needed to inherit a class
+ file called <filename>abc.bbclass</filename> from a
+ configuration file as follows:
+ <literallayout class='monospaced'>
+ INHERIT += "abc"
+ </literallayout>
+ This configuration directive causes the named
+ class to be inherited at the point of the directive
+ during parsing.
+ As with the <filename>inherit</filename> directive, the
+ <filename>.bbclass</filename> file must be located in a
+ "classes" subdirectory in one of the directories specified
+ in <filename>BBPATH</filename>.
+ <note>
+ Because <filename>.conf</filename> files are parsed
+ first during BitBake's execution, using
+ <filename>INHERIT</filename> to inherit a class effectively
+ inherits the class globally (i.e. for all recipes).
+ </note>
+ If you want to use the directive to inherit
+ multiple classes, you can provide them on the same line in the
+ <filename>local.conf</filename> file.
+ Use spaces to separate the classes.
+ The following example shows how to inherit both the
+ <filename>autotools</filename> and <filename>pkgconfig</filename>
+ classes:
+ <literallayout class='monospaced'>
+ INHERIT += "autotools pkgconfig"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='functions'>
+ <title>Functions</title>
+
+ <para>
+ As with most languages, functions are the building blocks that
+ are used to build up operations into tasks.
+ BitBake supports these types of functions:
+ <itemizedlist>
+ <listitem><para><emphasis>Shell Functions:</emphasis>
+ Functions written in shell script and executed either
+ directly as functions, tasks, or both.
+ They can also be called by other shell functions.
+ </para></listitem>
+ <listitem><para><emphasis>BitBake-Style Python Functions:</emphasis>
+ Functions written in Python and executed by BitBake or other
+ Python functions using <filename>bb.build.exec_func()</filename>.
+ </para></listitem>
+ <listitem><para><emphasis>Python Functions:</emphasis>
+ Functions written in Python and executed by Python.
+ </para></listitem>
+ <listitem><para><emphasis>Anonymous Python Functions:</emphasis>
+ Python functions executed automatically during
+ parsing.
+ </para></listitem>
+ </itemizedlist>
+ Regardless of the type of function, you can only
+ define them in class (<filename>.bbclass</filename>)
+ and recipe (<filename>.bb</filename> or <filename>.inc</filename>)
+ files.
+ </para>
+
+ <section id='shell-functions'>
+ <title>Shell Functions</title>
+
+ <para>
+ Functions written in shell script and executed either
+ directly as functions, tasks, or both.
+ They can also be called by other shell functions.
+ Here is an example shell function definition:
+ <literallayout class='monospaced'>
+ some_function () {
+ echo "Hello World"
+ }
+ </literallayout>
+ When you create these types of functions in your recipe
+ or class files, you need to follow the shell programming
+ rules.
+ The scripts are executed by <filename>/bin/sh</filename>,
+ which may not be a bash shell but might be something
+ such as <filename>dash</filename>.
+ You should not use Bash-specific script (bashisms).
+ </para>
+
+ <para>
+ Overrides and override-style operators like
+ <filename>_append</filename> and
+ <filename>_prepend</filename> can also be applied to
+ shell functions.
+ Most commonly, this application would be used in a
+ <filename>.bbappend</filename> file to modify functions in
+ the main recipe.
+ It can also be used to modify functions inherited from
+ classes.
+ </para>
+
+ <para>
+ As an example, consider the following:
+ <literallayout class='monospaced'>
+ do_foo() {
+ bbplain first
+ fn
+ }
+
+ fn_prepend() {
+ bbplain second
+ }
+
+ fn() {
+ bbplain third
+ }
+
+ do_foo_append() {
+ bbplain fourth
+ }
+ </literallayout>
+ Running <filename>do_foo</filename>
+ prints the following:
+ <literallayout class='monospaced'>
+ recipename do_foo: first
+ recipename do_foo: second
+ recipename do_foo: third
+ recipename do_foo: fourth
+ </literallayout>
+ <note>
+ Overrides and override-style operators can
+ be applied to any shell function, not just
+ <link linkend='tasks'>tasks</link>.
+ </note>
+ You can use the <filename>bitbake -e</filename>&nbsp;<replaceable>recipename</replaceable>
+ command to view the final assembled function
+ after all overrides have been applied.
+ </para>
+ </section>
+
+ <section id='bitbake-style-python-functions'>
+ <title>BitBake-Style Python Functions</title>
+
+ <para>
+ These functions are written in Python and executed by
+ BitBake or other Python functions using
+ <filename>bb.build.exec_func()</filename>.
+ </para>
+
+ <para>
+ An example BitBake function is:
+ <literallayout class='monospaced'>
+ python some_python_function () {
+ d.setVar("TEXT", "Hello World")
+ print d.getVar("TEXT")
+ }
+ </literallayout>
+ Because the Python "bb" and "os" modules are already
+ imported, you do not need to import these modules.
+ Also in these types of functions, the datastore ("d")
+ is a global variable and is always automatically
+ available.
+ <note>
+ Variable expressions (e.g. <filename>${X}</filename>)
+ are no longer expanded within Python functions.
+ This behavior is intentional in order to allow you
+ to freely set variable values to expandable expressions
+ without having them expanded prematurely.
+ If you do wish to expand a variable within a Python
+ function, use <filename>d.getVar("X")</filename>.
+ Or, for more complicated expressions, use
+ <filename>d.expand()</filename>.
+ </note>
+ </para>
+
+ <para>
+ Similar to shell functions, you can also apply overrides
+ and override-style operators to BitBake-style Python
+ functions.
+ </para>
+
+ <para>
+ As an example, consider the following:
+ <literallayout class='monospaced'>
+ python do_foo_prepend() {
+ bb.plain("first")
+ }
+
+ python do_foo() {
+ bb.plain("second")
+ }
+
+ python do_foo_append() {
+ bb.plain("third")
+ }
+ </literallayout>
+ Running <filename>do_foo</filename> prints
+ the following:
+ <literallayout class='monospaced'>
+ recipename do_foo: first
+ recipename do_foo: second
+ recipename do_foo: third
+ </literallayout>
+ You can use the <filename>bitbake -e</filename>&nbsp;<replaceable>recipename</replaceable>
+ command to view the final assembled function
+ after all overrides have been applied.
+ </para>
+ </section>
+
+ <section id='python-functions'>
+ <title>Python Functions</title>
+
+ <para>
+ These functions are written in Python and are executed by
+ other Python code.
+ Examples of Python functions are utility functions
+ that you intend to call from in-line Python or
+ from within other Python functions.
+ Here is an example:
+ <literallayout class='monospaced'>
+ def get_depends(d):
+ if d.getVar('SOMECONDITION'):
+ return "dependencywithcond"
+ else:
+ return "dependency"
+ SOMECONDITION = "1"
+ DEPENDS = "${@get_depends(d)}"
+ </literallayout>
+ This would result in <filename>DEPENDS</filename>
+ containing <filename>dependencywithcond</filename>.
+ </para>
+
+ <para>
+ Here are some things to know about Python functions:
+ <itemizedlist>
+ <listitem><para>Python functions can take parameters.
+ </para></listitem>
+ <listitem><para>The BitBake datastore is not
+ automatically available.
+ Consequently, you must pass it in as a
+ parameter to the function.
+ </para></listitem>
+ <listitem><para>The "bb" and "os" Python modules are
+ automatically available.
+ You do not need to import them.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='bitbake-style-python-functions-versus-python-functions'>
+ <title>Bitbake-Style Python Functions Versus Python Functions</title>
+
+ <para>
+ Following are some important differences between
+ BitBake-style Python functions and regular Python
+ functions defined with "def":
+ <itemizedlist>
+ <listitem><para>
+ Only BitBake-style Python functions can be
+ <link linkend='tasks'>tasks</link>.
+ </para></listitem>
+ <listitem><para>
+ Overrides and override-style operators can only
+ be applied to BitBake-style Python functions.
+ </para></listitem>
+ <listitem><para>
+ Only regular Python functions can take arguments
+ and return values.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='variable-flags'>Variable flags</link>
+ such as <filename>[dirs]</filename>,
+ <filename>[cleandirs]</filename>, and
+ <filename>[lockfiles]</filename> can be used
+ on BitBake-style Python functions, but not on
+ regular Python functions.
+ </para></listitem>
+ <listitem><para>
+ BitBake-style Python functions generate a separate
+ <filename>${</filename><link linkend='var-T'><filename>T</filename></link><filename>}/run.</filename><replaceable>function-name</replaceable><filename>.</filename><replaceable>pid</replaceable>
+ script that is executed to run the function, and also
+ generate a log file in
+ <filename>${T}/log.</filename><replaceable>function-name</replaceable><filename>.</filename><replaceable>pid</replaceable>
+ if they are executed as tasks.</para>
+
+ <para>
+ Regular Python functions execute "inline" and do not
+ generate any files in <filename>${T}</filename>.
+ </para></listitem>
+ <listitem><para>
+ Regular Python functions are called with the usual
+ Python syntax.
+ BitBake-style Python functions are usually tasks and
+ are called directly by BitBake, but can also be called
+ manually from Python code by using the
+ <filename>bb.build.exec_func()</filename> function.
+ Here is an example:
+ <literallayout class='monospaced'>
+ bb.build.exec_func("my_bitbake_style_function", d)
+ </literallayout>
+ <note>
+ <filename>bb.build.exec_func()</filename> can also
+ be used to run shell functions from Python code.
+ If you want to run a shell function before a Python
+ function within the same task, then you can use a
+ parent helper Python function that starts by running
+ the shell function with
+ <filename>bb.build.exec_func()</filename> and then
+ runs the Python code.
+ </note></para>
+
+ <para>To detect errors from functions executed with
+ <filename>bb.build.exec_func()</filename>, you
+ can catch the <filename>bb.build.FuncFailed</filename>
+ exception.
+ <note>
+ Functions in metadata (recipes and classes) should
+ not themselves raise
+ <filename>bb.build.FuncFailed</filename>.
+ Rather, <filename>bb.build.FuncFailed</filename>
+ should be viewed as a general indicator that the
+ called function failed by raising an exception.
+ For example, an exception raised by
+ <filename>bb.fatal()</filename> will be caught inside
+ <filename>bb.build.exec_func()</filename>, and a
+ <filename>bb.build.FuncFailed</filename> will be raised
+ in response.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Due to their simplicity, you should prefer regular Python functions
+ over BitBake-style Python functions unless you need a feature specific
+ to BitBake-style Python functions.
+ Regular Python functions in metadata are a more recent invention than
+ BitBake-style Python functions, and older code tends to use
+ <filename>bb.build.exec_func()</filename> more often.
+ </para>
+ </section>
+
+ <section id='anonymous-python-functions'>
+ <title>Anonymous Python Functions</title>
+
+ <para>
+ Sometimes it is useful to set variables or perform
+ other operations programmatically during parsing.
+ To do this, you can define special Python functions,
+ called anonymous Python functions, that run at the
+ end of parsing.
+ For example, the following conditionally sets a variable
+ based on the value of another variable:
+ <literallayout class='monospaced'>
+ python () {
+ if d.getVar('SOMEVAR') == 'value':
+ d.setVar('ANOTHERVAR', 'value2')
+ }
+ </literallayout>
+ An equivalent way to mark a function as an anonymous
+ function is to give it the name "__anonymous", rather
+ than no name.
+ </para>
+
+ <para>
+ Anonymous Python functions always run at the end
+ of parsing, regardless of where they are defined.
+ If a recipe contains many anonymous functions, they
+ run in the same order as they are defined within the
+ recipe.
+ As an example, consider the following snippet:
+ <literallayout class='monospaced'>
+ python () {
+ d.setVar('FOO', 'foo 2')
+ }
+
+ FOO = "foo 1"
+
+ python () {
+ d.appendVar('BAR', ' bar 2')
+ }
+
+ BAR = "bar 1"
+ </literallayout>
+ The previous example is conceptually equivalent to the
+ following snippet:
+ <literallayout class='monospaced'>
+ FOO = "foo 1"
+ BAR = "bar 1"
+ FOO = "foo 2"
+ BAR += "bar 2"
+ </literallayout>
+ <filename>FOO</filename> ends up with the value "foo 2",
+ and <filename>BAR</filename> with the value "bar 1 bar 2".
+ Just as in the second snippet, the values set for the
+ variables within the anonymous functions become available
+ to tasks, which always run after parsing.
+ </para>
+
+ <para>
+ Overrides and override-style operators such as
+ "<filename>_append</filename>" are applied before
+ anonymous functions run.
+ In the following example, <filename>FOO</filename> ends
+ up with the value "foo from anonymous":
+ <literallayout class='monospaced'>
+ FOO = "foo"
+ FOO_append = " from outside"
+
+ python () {
+ d.setVar("FOO", "foo from anonymous")
+ }
+ </literallayout>
+ For methods you can use with anonymous Python functions,
+ see the
+ "<link linkend='functions-you-can-call-from-within-python'>Functions You Can Call From Within Python</link>"
+ section.
+ For a different method to run Python code during parsing,
+ see the
+ "<link linkend='inline-python-variable-expansion'>Inline Python Variable Expansion</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='flexible-inheritance-for-class-functions'>
+ <title>Flexible Inheritance for Class Functions</title>
+
+ <para>
+ Through coding techniques and the use of
+ <filename>EXPORT_FUNCTIONS</filename>, BitBake supports
+ exporting a function from a class such that the
+ class function appears as the default implementation
+ of the function, but can still be called if a recipe
+ inheriting the class needs to define its own version of
+ the function.
+ </para>
+
+ <para>
+ To understand the benefits of this feature, consider
+ the basic scenario where a class defines a task function
+ and your recipe inherits the class.
+ In this basic scenario, your recipe inherits the task
+ function as defined in the class.
+ If desired, your recipe can add to the start and end of the
+ function by using the "_prepend" or "_append" operations
+ respectively, or it can redefine the function completely.
+ However, if it redefines the function, there is
+ no means for it to call the class version of the function.
+ <filename>EXPORT_FUNCTIONS</filename> provides a mechanism
+ that enables the recipe's version of the function to call
+ the original version of the function.
+ </para>
+
+ <para>
+ To make use of this technique, you need the following
+ things in place:
+ <itemizedlist>
+ <listitem><para>
+ The class needs to define the function as follows:
+ <literallayout class='monospaced'>
+ <replaceable>classname</replaceable><filename>_</filename><replaceable>functionname</replaceable>
+ </literallayout>
+ For example, if you have a class file
+ <filename>bar.bbclass</filename> and a function named
+ <filename>do_foo</filename>, the class must define the function
+ as follows:
+ <literallayout class='monospaced'>
+ bar_do_foo
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The class needs to contain the <filename>EXPORT_FUNCTIONS</filename>
+ statement as follows:
+ <literallayout class='monospaced'>
+ EXPORT_FUNCTIONS <replaceable>functionname</replaceable>
+ </literallayout>
+ For example, continuing with the same example, the
+ statement in the <filename>bar.bbclass</filename> would be
+ as follows:
+ <literallayout class='monospaced'>
+ EXPORT_FUNCTIONS do_foo
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ You need to call the function appropriately from within your
+ recipe.
+ Continuing with the same example, if your recipe
+ needs to call the class version of the function,
+ it should call <filename>bar_do_foo</filename>.
+ Assuming <filename>do_foo</filename> was a shell function
+ and <filename>EXPORT_FUNCTIONS</filename> was used as above,
+ the recipe's function could conditionally call the
+ class version of the function as follows:
+ <literallayout class='monospaced'>
+ do_foo() {
+ if [ somecondition ] ; then
+ bar_do_foo
+ else
+ # Do something else
+ fi
+ }
+ </literallayout>
+ To call your modified version of the function as defined
+ in your recipe, call it as <filename>do_foo</filename>.
+ </para></listitem>
+ </itemizedlist>
+ With these conditions met, your single recipe
+ can freely choose between the original function
+ as defined in the class file and the modified function in your recipe.
+ If you do not set up these conditions, you are limited to using one function
+ or the other.
+ </para>
+ </section>
+ </section>
+
+ <section id='tasks'>
+ <title>Tasks</title>
+
+ <para>
+ Tasks are BitBake execution units that make up the
+ steps that BitBake can run for a given recipe.
+ Tasks are only supported in recipes and classes
+ (i.e. in <filename>.bb</filename> files and files
+ included or inherited from <filename>.bb</filename>
+ files).
+ By convention, tasks have names that start with "do_".
+ </para>
+
+ <section id='promoting-a-function-to-a-task'>
+ <title>Promoting a Function to a Task</title>
+
+ <para>
+ Tasks are either
+ <link linkend='shell-functions'>shell functions</link> or
+ <link linkend='bitbake-style-python-functions'>BitBake-style Python functions</link>
+ that have been promoted to tasks by using the
+ <filename>addtask</filename> command.
+ The <filename>addtask</filename> command can also
+ optionally describe dependencies between the
+ task and other tasks.
+ Here is an example that shows how to define a task
+ and declare some dependencies:
+ <literallayout class='monospaced'>
+ python do_printdate () {
+ import time
+ print time.strftime('%Y%m%d', time.gmtime())
+ }
+ addtask printdate after do_fetch before do_build
+ </literallayout>
+ The first argument to <filename>addtask</filename>
+ is the name of the function to promote to
+ a task.
+ If the name does not start with "do_", "do_" is
+ implicitly added, which enforces the convention that
+ all task names start with "do_".
+ </para>
+
+ <para>
+ In the previous example, the
+ <filename>do_printdate</filename> task becomes a
+ dependency of the <filename>do_build</filename>
+ task, which is the default task (i.e. the task run by
+ the <filename>bitbake</filename> command unless
+ another task is specified explicitly).
+ Additionally, the <filename>do_printdate</filename>
+ task becomes dependent upon the
+ <filename>do_fetch</filename> task.
+ Running the <filename>do_build</filename> task
+ results in the <filename>do_printdate</filename>
+ task running first.
+ <note>
+ If you try out the previous example, you might see that
+ the <filename>do_printdate</filename> task is only run
+ the first time you build the recipe with
+ the <filename>bitbake</filename> command.
+ This is because BitBake considers the task "up-to-date"
+ after that initial run.
+ If you want to force the task to always be rerun for
+ experimentation purposes, you can make BitBake always
+ consider the task "out-of-date" by using the
+ <filename>[</filename><link linkend='variable-flags'><filename>nostamp</filename></link><filename>]</filename>
+ variable flag, as follows:
+ <literallayout class='monospaced'>
+ do_printdate[nostamp] = "1"
+ </literallayout>
+ You can also explicitly run the task and provide the
+ <filename>-f</filename> option as follows:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>recipe</replaceable> -c printdate -f
+ </literallayout>
+ When manually selecting a task to run with the
+ <filename>bitbake</filename>&nbsp;<replaceable>recipe</replaceable>&nbsp;<filename>-c</filename>&nbsp;<replaceable>task</replaceable>
+ command, you can omit the "do_" prefix as part of the
+ task name.
+ </note>
+ </para>
+
+ <para>
+ You might wonder about the practical effects of using
+ <filename>addtask</filename> without specifying any
+ dependencies as is done in the following example:
+ <literallayout class='monospaced'>
+ addtask printdate
+ </literallayout>
+ In this example, assuming dependencies have not been
+ added through some other means, the only way to run
+ the task is by explicitly selecting it with
+ <filename>bitbake</filename>&nbsp;<replaceable>recipe</replaceable>&nbsp;<filename>-c printdate</filename>.
+ You can use the
+ <filename>do_listtasks</filename> task to list all tasks
+ defined in a recipe as shown in the following example:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>recipe</replaceable> -c listtasks
+ </literallayout>
+ For more information on task dependencies, see the
+ "<link linkend='dependencies'>Dependencies</link>"
+ section.
+ </para>
+
+ <para>
+ See the
+ "<link linkend='variable-flags'>Variable Flags</link>"
+ section for information on variable flags you can use with
+ tasks.
+ </para>
+ </section>
+
+ <section id='deleting-a-task'>
+ <title>Deleting a Task</title>
+
+ <para>
+ As well as being able to add tasks, you can delete them.
+ Simply use the <filename>deltask</filename> command to
+ delete a task.
+ For example, to delete the example task used in the previous
+ sections, you would use:
+ <literallayout class='monospaced'>
+ deltask printdate
+ </literallayout>
+ If you delete a task using the <filename>deltask</filename>
+ command and the task has dependencies, the dependencies are
+ not reconnected.
+ For example, suppose you have three tasks named
+ <filename>do_a</filename>, <filename>do_b</filename>, and
+ <filename>do_c</filename>.
+ Furthermore, <filename>do_c</filename> is dependent on
+ <filename>do_b</filename>, which in turn is dependent on
+ <filename>do_a</filename>.
+ Given this scenario, if you use <filename>deltask</filename>
+ to delete <filename>do_b</filename>, the implicit dependency
+ relationship between <filename>do_c</filename> and
+ <filename>do_a</filename> through <filename>do_b</filename>
+ no longer exists, and <filename>do_c</filename> dependencies
+ are not updated to include <filename>do_a</filename>.
+ Thus, <filename>do_c</filename> is free to run before
+ <filename>do_a</filename>.
+ </para>
+
+ <para>
+ If you want dependencies such as these to remain intact, use
+ the <filename>[noexec]</filename> varflag to disable the task
+ instead of using the <filename>deltask</filename> command to
+ delete it:
+ <literallayout class='monospaced'>
+ do_b[noexec] = "1"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='passing-information-into-the-build-task-environment'>
+ <title>Passing Information Into the Build Task Environment</title>
+
+ <para>
+ When running a task, BitBake tightly controls the shell execution
+ environment of the build tasks to make
+ sure unwanted contamination from the build machine cannot
+ influence the build.
+ <note>
+ By default, BitBake cleans the environment to include only those
+ things exported or listed in its whitelist to ensure that the build
+ environment is reproducible and consistent.
+ You can prevent this "cleaning" by setting the
+ <link linkend='var-BB_PRESERVE_ENV'><filename>BB_PRESERVE_ENV</filename></link>
+ variable.
+ </note>
+ Consequently, if you do want something to get passed into the
+ build task environment, you must take these two steps:
+ <orderedlist>
+ <listitem><para>
+ Tell BitBake to load what you want from the environment
+ into the datastore.
+ You can do so through the
+ <link linkend='var-BB_ENV_WHITELIST'><filename>BB_ENV_WHITELIST</filename></link>
+ and
+ <link linkend='var-BB_ENV_EXTRAWHITE'><filename>BB_ENV_EXTRAWHITE</filename></link>
+ variables.
+ For example, assume you want to prevent the build system from
+ accessing your <filename>$HOME/.ccache</filename>
+ directory.
+ The following command "whitelists" the environment variable
+ <filename>CCACHE_DIR</filename> causing BitBack to allow that
+ variable into the datastore:
+ <literallayout class='monospaced'>
+ export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE CCACHE_DIR"
+ </literallayout></para></listitem>
+ <listitem><para>
+ Tell BitBake to export what you have loaded into the
+ datastore to the task environment of every running task.
+ Loading something from the environment into the datastore
+ (previous step) only makes it available in the datastore.
+ To export it to the task environment of every running task,
+ use a command similar to the following in your local configuration
+ file <filename>local.conf</filename> or your
+ distribution configuration file:
+ <literallayout class='monospaced'>
+ export CCACHE_DIR
+ </literallayout>
+ <note>
+ A side effect of the previous steps is that BitBake
+ records the variable as a dependency of the build process
+ in things like the setscene checksums.
+ If doing so results in unnecessary rebuilds of tasks, you can
+ whitelist the variable so that the setscene code
+ ignores the dependency when it creates checksums.
+ </note></para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Sometimes, it is useful to be able to obtain information
+ from the original execution environment.
+ Bitbake saves a copy of the original environment into
+ a special variable named
+ <link linkend='var-BB_ORIGENV'><filename>BB_ORIGENV</filename></link>.
+ </para>
+
+ <para>
+ The <filename>BB_ORIGENV</filename> variable returns a datastore
+ object that can be queried using the standard datastore operators
+ such as <filename>getVar(, False)</filename>.
+ The datastore object is useful, for example, to find the original
+ <filename>DISPLAY</filename> variable.
+ Here is an example:
+ <literallayout class='monospaced'>
+ origenv = d.getVar("BB_ORIGENV", False)
+ bar = origenv.getVar("BAR", False)
+ </literallayout>
+ The previous example returns <filename>BAR</filename> from the original
+ execution environment.
+ </para>
+ </section>
+ </section>
+
+ <section id='variable-flags'>
+ <title>Variable Flags</title>
+
+ <para>
+ Variable flags (varflags) help control a task's functionality
+ and dependencies.
+ BitBake reads and writes varflags to the datastore using the following
+ command forms:
+ <literallayout class='monospaced'>
+ <replaceable>variable</replaceable> = d.getVarFlags("<replaceable>variable</replaceable>")
+ self.d.setVarFlags("FOO", {"func": True})
+ </literallayout>
+ </para>
+
+ <para>
+ When working with varflags, the same syntax, with the exception of
+ overrides, applies.
+ In other words, you can set, append, and prepend varflags just like
+ variables.
+ See the
+ "<link linkend='variable-flag-syntax'>Variable Flag Syntax</link>"
+ section for details.
+ </para>
+
+ <para>
+ BitBake has a defined set of varflags available for recipes and
+ classes.
+ Tasks support a number of these flags which control various
+ functionality of the task:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>[cleandirs]</filename>:</emphasis>
+ Empty directories that should be created before the
+ task runs.
+ Directories that already exist are removed and recreated
+ to empty them.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[depends]</filename>:</emphasis>
+ Controls inter-task dependencies.
+ See the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable and the
+ "<link linkend='inter-task-dependencies'>Inter-Task Dependencies</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[deptask]</filename>:</emphasis>
+ Controls task build-time dependencies.
+ See the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable and the
+ "<link linkend='build-dependencies'>Build Dependencies</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[dirs]</filename>:</emphasis>
+ Directories that should be created before the task runs.
+ Directories that already exist are left as is.
+ The last directory listed is used as the
+ current working directory for the task.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[lockfiles]</filename>:</emphasis>
+ Specifies one or more lockfiles to lock while the task
+ executes.
+ Only one task may hold a lockfile, and any task that
+ attempts to lock an already locked file will block until
+ the lock is released.
+ You can use this variable flag to accomplish mutual
+ exclusion.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[noexec]</filename>:</emphasis>
+ When set to "1", marks the task as being empty, with
+ no execution required.
+ You can use the <filename>[noexec]</filename> flag to set up
+ tasks as dependency placeholders, or to disable tasks defined
+ elsewhere that are not needed in a particular recipe.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[nostamp]</filename>:</emphasis>
+ When set to "1", tells BitBake to not generate a stamp
+ file for a task, which implies the task should always
+ be executed.
+ <note><title>Caution</title>
+ Any task that depends (possibly indirectly) on a
+ <filename>[nostamp]</filename> task will always be
+ executed as well.
+ This can cause unnecessary rebuilding if you are
+ not careful.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis><filename>[postfuncs]</filename>:</emphasis>
+ List of functions to call after the completion of the task.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[prefuncs]</filename>:</emphasis>
+ List of functions to call before the task executes.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[rdepends]</filename>:</emphasis>
+ Controls inter-task runtime dependencies.
+ See the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable, the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variable, and the
+ "<link linkend='inter-task-dependencies'>Inter-Task Dependencies</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[rdeptask]</filename>:</emphasis>
+ Controls task runtime dependencies.
+ See the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable, the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variable, and the
+ "<link linkend='runtime-dependencies'>Runtime Dependencies</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[recideptask]</filename>:</emphasis>
+ When set in conjunction with
+ <filename>recrdeptask</filename>, specifies a task that
+ should be inspected for additional dependencies.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[recrdeptask]</filename>:</emphasis>
+ Controls task recursive runtime dependencies.
+ See the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable, the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variable, and the
+ "<link linkend='recursive-dependencies'>Recursive Dependencies</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[stamp-extra-info]</filename>:</emphasis>
+ Extra stamp information to append to the task's stamp.
+ As an example, OpenEmbedded uses this flag to allow
+ machine-specific tasks.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[umask]</filename>:</emphasis>
+ The umask to run the task under.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Several varflags are useful for controlling how signatures are
+ calculated for variables.
+ For more information on this process, see the
+ "<link linkend='checksums'>Checksums (Signatures)</link>"
+ section.
+ <itemizedlist>
+ <listitem><para><emphasis><filename>[vardeps]</filename>:</emphasis>
+ Specifies a space-separated list of additional
+ variables to add to a variable's dependencies
+ for the purposes of calculating its signature.
+ Adding variables to this list is useful, for example, when
+ a function refers to a variable in a manner that
+ does not allow BitBake to automatically determine
+ that the variable is referred to.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[vardepsexclude]</filename>:</emphasis>
+ Specifies a space-separated list of variables
+ that should be excluded from a variable's dependencies
+ for the purposes of calculating its signature.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[vardepvalue]</filename>:</emphasis>
+ If set, instructs BitBake to ignore the actual
+ value of the variable and instead use the specified
+ value when calculating the variable's signature.
+ </para></listitem>
+ <listitem><para><emphasis><filename>[vardepvalueexclude]</filename>:</emphasis>
+ Specifies a pipe-separated list of strings to exclude
+ from the variable's value when calculating the
+ variable's signature.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='events'>
+ <title>Events</title>
+
+ <para>
+ BitBake allows installation of event handlers within recipe
+ and class files.
+ Events are triggered at certain points during operation, such
+ as the beginning of operation against a given recipe
+ (i.e. <filename>*.bb</filename>), the start of a given task,
+ a task failure, a task success, and so forth.
+ The intent is to make it easy to do things like email
+ notification on build failures.
+ </para>
+
+ <para>
+ Following is an example event handler that prints the name
+ of the event and the content of the
+ <filename>FILE</filename> variable:
+ <literallayout class='monospaced'>
+ addhandler myclass_eventhandler
+ python myclass_eventhandler() {
+ from bb.event import getName
+ print("The name of the Event is %s" % getName(e))
+ print("The file we run for is %s" % d.getVar('FILE'))
+ }
+ myclass_eventhandler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted"
+ </literallayout>
+ In the previous example, an eventmask has been set so that
+ the handler only sees the "BuildStarted" and "BuildCompleted"
+ events.
+ This event handler gets called every time an event matching
+ the eventmask is triggered.
+ A global variable "e" is defined, which represents the current
+ event.
+ With the <filename>getName(e)</filename> method, you can get
+ the name of the triggered event.
+ The global datastore is available as "d".
+ In legacy code, you might see "e.data" used to get the datastore.
+ However, realize that "e.data" is deprecated and you should use
+ "d" going forward.
+ </para>
+
+ <para>
+ The context of the datastore is appropriate to the event
+ in question.
+ For example, "BuildStarted" and "BuildCompleted" events run
+ before any tasks are executed so would be in the global
+ configuration datastore namespace.
+ No recipe-specific metadata exists in that namespace.
+ The "BuildStarted" and "BuildCompleted" events also run in
+ the main cooker/server process rather than any worker context.
+ Thus, any changes made to the datastore would be seen by other
+ cooker/server events within the current build but not seen
+ outside of that build or in any worker context.
+ Task events run in the actual tasks in question consequently
+ have recipe-specific and task-specific contents.
+ These events run in the worker context and are discarded at
+ the end of task execution.
+ </para>
+
+ <para>
+ During a standard build, the following common events might
+ occur.
+ The following events are the most common kinds of events that
+ most metadata might have an interest in viewing:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bb.event.ConfigParsed()</filename>:
+ Fired when the base configuration; which consists of
+ <filename>bitbake.conf</filename>,
+ <filename>base.bbclass</filename> and any global
+ <filename>INHERIT</filename> statements; has been parsed.
+ You can see multiple such events when each of the
+ workers parse the base configuration or if the server
+ changes configuration and reparses.
+ Any given datastore only has one such event executed
+ against it, however.
+ If
+ <link linkende='var-BB_INVALIDCONF'><filename>BB_INVALIDCONF</filename></link>
+ is set in the datastore by the event handler, the
+ configuration is reparsed and a new event triggered,
+ allowing the metadata to update configuration.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.HeartbeatEvent()</filename>:
+ Fires at regular time intervals of one second.
+ You can configure the interval time using the
+ <filename>BB_HEARTBEAT_EVENT</filename> variable.
+ The event's "time" attribute is the
+ <filename>time.time()</filename> value when the
+ event is triggered.
+ This event is useful for activities such as
+ system state monitoring.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseStarted()</filename>:
+ Fired when BitBake is about to start parsing recipes.
+ This event's "total" attribute represents the number of
+ recipes BitBake plans to parse.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseProgress()</filename>:
+ Fired as parsing progresses.
+ This event's "current" attribute is the number of
+ recipes parsed as well as the "total" attribute.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ParseCompleted()</filename>:
+ Fired when parsing is complete.
+ This event's "cached", "parsed", "skipped", "virtuals",
+ "masked", and "errors" attributes provide statistics
+ for the parsing results.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.BuildStarted()</filename>:
+ Fired when a new build starts.
+ BitBake fires multiple "BuildStarted" events (one per configuration)
+ when multiple configuration (multiconfig) is enabled.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskStarted()</filename>:
+ Fired when a task starts.
+ This event's "taskfile" attribute points to the recipe
+ from which the task originates.
+ The "taskname" attribute, which is the task's name,
+ includes the <filename>do_</filename> prefix, and the
+ "logfile" attribute point to where the task's output is
+ stored.
+ Finally, the "time" attribute is the task's execution start
+ time.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskInvalid()</filename>:
+ Fired if BitBake tries to execute a task that does not exist.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskFailedSilent()</filename>:
+ Fired for setscene tasks that fail and should not be
+ presented to the user verbosely.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskFailed()</filename>:
+ Fired for normal tasks that fail.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.build.TaskSucceeded()</filename>:
+ Fired when a task successfully completes.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.BuildCompleted()</filename>:
+ Fired when a build finishes.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.cooker.CookerExit()</filename>:
+ Fired when the BitBake server/cooker shuts down.
+ This event is usually only seen by the UIs as a
+ sign they should also shutdown.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This next list of example events occur based on specific
+ requests to the server.
+ These events are often used to communicate larger pieces of
+ information from the BitBake server to other parts of
+ BitBake such as user interfaces:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bb.event.TreeDataPreparationStarted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.TreeDataPreparationProgress()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.TreeDataPreparationCompleted()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.DepTreeGenerated()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.CoreBaseFilesFound()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ConfigFilePathFound()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.FilesMatchingFound()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.ConfigFilesFound()</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.event.TargetsTreeGenerated()</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='variants-class-extension-mechanism'>
+ <title>Variants - Class Extension Mechanism</title>
+
+ <para>
+ BitBake supports two features that facilitate creating
+ from a single recipe file multiple incarnations of that
+ recipe file where all incarnations are buildable.
+ These features are enabled through the
+ <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link>
+ and
+ <link linkend='var-BBVERSIONS'><filename>BBVERSIONS</filename></link>
+ variables.
+ <note>
+ The mechanism for this class extension is extremely
+ specific to the implementation.
+ Usually, the recipe's
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>,
+ <link linkend='var-PN'><filename>PN</filename></link>, and
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variables would need to be modified by the extension class.
+ For specific examples, see the OE-Core
+ <filename>native</filename>, <filename>nativesdk</filename>,
+ and <filename>multilib</filename> classes.
+ </note>
+ <itemizedlist>
+ <listitem><para><emphasis><filename>BBCLASSEXTEND</filename>:</emphasis>
+ This variable is a space separated list of classes used to "extend" the
+ recipe for each variant.
+ Here is an example that results in a second incarnation of the current
+ recipe being available.
+ This second incarnation will have the "native" class inherited.
+ <literallayout class='monospaced'>
+ BBCLASSEXTEND = "native"
+ </literallayout></para></listitem>
+ <listitem><para><emphasis><filename>BBVERSIONS</filename>:</emphasis>
+ This variable allows a single recipe to build multiple versions of a
+ project from a single recipe file.
+ You can also specify conditional metadata
+ (using the
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ mechanism) for a single version, or an optionally named range of versions.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBVERSIONS = "1.0 2.0 git"
+ SRC_URI_git = "git://someurl/somepath.git"
+
+ BBVERSIONS = "1.0.[0-6]:1.0.0+ \ 1.0.[7-9]:1.0.7+"
+ SRC_URI_append_1.0.7+ = "file://some_patch_which_the_new_versions_need.patch;patch=1"
+ </literallayout>
+ The name of the range defaults to the original version of the
+ recipe.
+ For example, in OpenEmbedded, the recipe file
+ <filename>foo_1.0.0+.bb</filename> creates a default name range
+ of <filename>1.0.0+</filename>.
+ This is useful because the range name is not only placed
+ into overrides, but it is also made available for the metadata to use
+ in the variable that defines the base recipe versions for use in
+ <filename>file://</filename> search paths
+ (<link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='dependencies'>
+ <title>Dependencies</title>
+
+ <para>
+ To allow for efficient parallel processing, BitBake handles
+ dependencies at the task level.
+ Dependencies can exist both between tasks within a single recipe
+ and between tasks in different recipes.
+ Following are examples of each:
+ <itemizedlist>
+ <listitem><para>For tasks within a single recipe, a
+ recipe's <filename>do_configure</filename>
+ task might need to complete before its
+ <filename>do_compile</filename> task can run.
+ </para></listitem>
+ <listitem><para>For tasks in different recipes, one
+ recipe's <filename>do_configure</filename>
+ task might require another recipe's
+ <filename>do_populate_sysroot</filename>
+ task to finish first such that the libraries and headers
+ provided by the other recipe are available.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This section describes several ways to declare dependencies.
+ Remember, even though dependencies are declared in different ways, they
+ are all simply dependencies between tasks.
+ </para>
+
+ <section id='dependencies-internal-to-the-bb-file'>
+ <title>Dependencies Internal to the <filename>.bb</filename> File</title>
+
+ <para>
+ BitBake uses the <filename>addtask</filename> directive
+ to manage dependencies that are internal to a given recipe
+ file.
+ You can use the <filename>addtask</filename> directive to
+ indicate when a task is dependent on other tasks or when
+ other tasks depend on that recipe.
+ Here is an example:
+ <literallayout class='monospaced'>
+ addtask printdate after do_fetch before do_build
+ </literallayout>
+ In this example, the <filename>do_printdate</filename>
+ task depends on the completion of the
+ <filename>do_fetch</filename> task, and the
+ <filename>do_build</filename> task depends on the
+ completion of the <filename>do_printdate</filename>
+ task.
+ <note><para>
+ For a task to run, it must be a direct or indirect
+ dependency of some other task that is scheduled to
+ run.</para>
+
+ <para>For illustration, here are some examples:
+ <itemizedlist>
+ <listitem><para>
+ The directive
+ <filename>addtask mytask before do_configure</filename>
+ causes <filename>do_mytask</filename> to run before
+ <filename>do_configure</filename> runs.
+ Be aware that <filename>do_mytask</filename> still only
+ runs if its <link linkend='checksums'>input checksum</link>
+ has changed since the last time it was run.
+ Changes to the input checksum of
+ <filename>do_mytask</filename> also indirectly cause
+ <filename>do_configure</filename> to run.
+ </para></listitem>
+ <listitem><para>
+ The directive
+ <filename>addtask mytask after do_configure</filename>
+ by itself never causes <filename>do_mytask</filename>
+ to run.
+ <filename>do_mytask</filename> can still be run manually
+ as follows:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>recipe</replaceable> -c mytask
+ </literallayout>
+ Declaring <filename>do_mytask</filename> as a dependency
+ of some other task that is scheduled to run also causes
+ it to run.
+ Regardless, the task runs after
+ <filename>do_configure</filename>.
+ </para></listitem>
+ </itemizedlist></para>
+ </note>
+ </para>
+ </section>
+
+ <section id='build-dependencies'>
+ <title>Build Dependencies</title>
+
+ <para>
+ BitBake uses the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable to manage build time dependencies.
+ The <filename>[deptask]</filename> varflag for tasks
+ signifies the task of each
+ item listed in <filename>DEPENDS</filename> that must
+ complete before that task can be executed.
+ Here is an example:
+ <literallayout class='monospaced'>
+ do_configure[deptask] = "do_populate_sysroot"
+ </literallayout>
+ In this example, the <filename>do_populate_sysroot</filename>
+ task of each item in <filename>DEPENDS</filename> must complete before
+ <filename>do_configure</filename> can execute.
+ </para>
+ </section>
+
+ <section id='runtime-dependencies'>
+ <title>Runtime Dependencies</title>
+
+ <para>
+ BitBake uses the
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>,
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>, and
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variables to manage runtime dependencies.
+ </para>
+
+ <para>
+ The <filename>PACKAGES</filename> variable lists runtime
+ packages.
+ Each of those packages can have <filename>RDEPENDS</filename> and
+ <filename>RRECOMMENDS</filename> runtime dependencies.
+ The <filename>[rdeptask]</filename> flag for tasks is used to
+ signify the task of each
+ item runtime dependency which must have completed before that
+ task can be executed.
+ <literallayout class='monospaced'>
+ do_package_qa[rdeptask] = "do_packagedata"
+ </literallayout>
+ In the previous example, the <filename>do_packagedata</filename>
+ task of each item in <filename>RDEPENDS</filename> must have
+ completed before <filename>do_package_qa</filename> can execute.
+ </para>
+ </section>
+
+ <section id='recursive-dependencies'>
+ <title>Recursive Dependencies</title>
+
+ <para>
+ BitBake uses the <filename>[recrdeptask]</filename> flag to manage
+ recursive task dependencies.
+ BitBake looks through the build-time and runtime
+ dependencies of the current recipe, looks through
+ the task's inter-task
+ dependencies, and then adds dependencies for the
+ listed task.
+ Once BitBake has accomplished this, it recursively works through
+ the dependencies of those tasks.
+ Iterative passes continue until all dependencies are discovered
+ and added.
+ </para>
+
+ <para>
+ The <filename>[recrdeptask]</filename> flag is most commonly
+ used in high-level
+ recipes that need to wait for some task to finish "globally".
+ For example, <filename>image.bbclass</filename> has the following:
+ <literallayout class='monospaced'>
+ do_rootfs[recrdeptask] += "do_packagedata"
+ </literallayout>
+ This statement says that the <filename>do_packagedata</filename>
+ task of the current recipe and all recipes reachable
+ (by way of dependencies) from the
+ image recipe must run before the <filename>do_rootfs</filename>
+ task can run.
+ </para>
+
+ <para>
+ You might want to not only have BitBake look for
+ dependencies of those tasks, but also have BitBake look
+ for build-time and runtime dependencies of the dependent
+ tasks as well.
+ If that is the case, you need to reference the task name
+ itself in the task list:
+ <literallayout class='monospaced'>
+ do_a[recrdeptask] = "do_a do_b"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='inter-task-dependencies'>
+ <title>Inter-Task Dependencies</title>
+
+ <para>
+ BitBake uses the <filename>[depends]</filename>
+ flag in a more generic form
+ to manage inter-task dependencies.
+ This more generic form allows for inter-dependency
+ checks for specific tasks rather than checks for
+ the data in <filename>DEPENDS</filename>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ do_patch[depends] = "quilt-native:do_populate_sysroot"
+ </literallayout>
+ In this example, the <filename>do_populate_sysroot</filename>
+ task of the target <filename>quilt-native</filename>
+ must have completed before the
+ <filename>do_patch</filename> task can execute.
+ </para>
+
+ <para>
+ The <filename>[rdepends]</filename> flag works in a similar
+ way but takes targets
+ in the runtime namespace instead of the build-time dependency
+ namespace.
+ </para>
+ </section>
+ </section>
+
+ <section id='functions-you-can-call-from-within-python'>
+ <title>Functions You Can Call From Within Python</title>
+
+ <para>
+ BitBake provides many functions you can call from
+ within Python functions.
+ This section lists the most commonly used functions,
+ and mentions where to find others.
+ </para>
+
+ <section id='functions-for-accessing-datastore-variables'>
+ <title>Functions for Accessing Datastore Variables</title>
+
+ <para>
+ It is often necessary to access variables in the
+ BitBake datastore using Python functions.
+ The Bitbake datastore has an API that allows you this
+ access.
+ Here is a list of available operations:
+ </para>
+
+ <para>
+ <informaltable frame='none'>
+ <tgroup cols='2' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth='1*'/>
+ <colspec colname='c2' colwidth='1*'/>
+ <thead>
+ <row>
+ <entry align="left"><emphasis>Operation</emphasis></entry>
+ <entry align="left"><emphasis>Description</emphasis></entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry align="left"><filename>d.getVar("X", expand)</filename></entry>
+ <entry align="left">Returns the value of variable "X".
+ Using "expand=True" expands the value.
+ Returns "None" if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.setVar("X", "value")</filename></entry>
+ <entry align="left">Sets the variable "X" to "value".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.appendVar("X", "value")</filename></entry>
+ <entry align="left">Adds "value" to the end of the variable "X".
+ Acts like <filename>d.setVar("X", "value")</filename>
+ if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.prependVar("X", "value")</filename></entry>
+ <entry align="left">Adds "value" to the start of the variable "X".
+ Acts like <filename>d.setVar("X", "value")</filename>
+ if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.delVar("X")</filename></entry>
+ <entry align="left">Deletes the variable "X" from the datastore.
+ Does nothing if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.renameVar("X", "Y")</filename></entry>
+ <entry align="left">Renames the variable "X" to "Y".
+ Does nothing if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.getVarFlag("X", flag, expand)</filename></entry>
+ <entry align="left">Returns the value of variable "X".
+ Using "expand=True" expands the value.
+ Returns "None" if either the variable "X" or the named flag
+ does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.setVarFlag("X", flag, "value")</filename></entry>
+ <entry align="left">Sets the named flag for variable "X" to "value".</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.appendVarFlag("X", flag, "value")</filename></entry>
+ <entry align="left">Appends "value" to the named flag on the
+ variable "X".
+ Acts like <filename>d.setVarFlag("X", flag, "value")</filename>
+ if the named flag does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.prependVarFlag("X", flag, "value")</filename></entry>
+ <entry align="left">Prepends "value" to the named flag on
+ the variable "X".
+ Acts like <filename>d.setVarFlag("X", flag, "value")</filename>
+ if the named flag does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.delVarFlag("X", flag)</filename></entry>
+ <entry align="left">Deletes the named flag on the variable
+ "X" from the datastore.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.setVarFlags("X", flagsdict)</filename></entry>
+ <entry align="left">Sets the flags specified in
+ the <filename>flagsdict()</filename> parameter.
+ <filename>setVarFlags</filename> does not clear previous flags.
+ Think of this operation as <filename>addVarFlags</filename>.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.getVarFlags("X")</filename></entry>
+ <entry align="left">Returns a <filename>flagsdict</filename>
+ of the flags for the variable "X".
+ Returns "None" if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.delVarFlags("X")</filename></entry>
+ <entry align="left">Deletes all the flags for the variable "X".
+ Does nothing if the variable "X" does not exist.</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>d.expand(expression)</filename></entry>
+ <entry align="left">Expands variable references in the specified
+ string expression.
+ References to variables that do not exist are left as is.
+ For example, <filename>d.expand("foo ${X}")</filename>
+ expands to the literal string "foo ${X}" if the
+ variable "X" does not exist.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </section>
+
+ <section id='other-functions'>
+ <title>Other Functions</title>
+
+ <para>
+ You can find many other functions that can be called
+ from Python by looking at the source code of the
+ <filename>bb</filename> module, which is in
+ <filename>bitbake/lib/bb</filename>.
+ For example,
+ <filename>bitbake/lib/bb/utils.py</filename> includes
+ the commonly used functions
+ <filename>bb.utils.contains()</filename> and
+ <filename>bb.utils.mkdirhier()</filename>, which come
+ with docstrings.
+ </para>
+ </section>
+ </section>
+
+ <section id='task-checksums-and-setscene'>
+ <title>Task Checksums and Setscene</title>
+
+ <para>
+ BitBake uses checksums (or signatures) along with the setscene
+ to determine if a task needs to be run.
+ This section describes the process.
+ To help understand how BitBake does this, the section assumes an
+ OpenEmbedded metadata-based example.
+ </para>
+
+ <para>
+ These checksums are stored in
+ <link linkend='var-STAMP'><filename>STAMP</filename></link>.
+ You can examine the checksums using the following BitBake command:
+ <literallayout class='monospaced'>
+ $ bitbake-dumpsigs
+ </literallayout>
+ This command returns the signature data in a readable format
+ that allows you to examine the inputs used when the
+ OpenEmbedded build system generates signatures.
+ For example, using <filename>bitbake-dumpsigs</filename>
+ allows you to examine the <filename>do_compile</filename>
+ task's “sigdata†for a C application (e.g.
+ <filename>bash</filename>).
+ Running the command also reveals that the “CC†variable is part of
+ the inputs that are hashed.
+ Any changes to this variable would invalidate the stamp and
+ cause the <filename>do_compile</filename> task to run.
+ </para>
+
+ <para>
+ The following list describes related variables:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-BB_HASHCHECK_FUNCTION'><filename>BB_HASHCHECK_FUNCTION</filename></link>:
+ Specifies the name of the function to call during
+ the "setscene" part of the task's execution in order
+ to validate the list of task hashes.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_SETSCENE_DEPVALID'><filename>BB_SETSCENE_DEPVALID</filename></link>:
+ Specifies a function BitBake calls that determines
+ whether BitBake requires a setscene dependency to
+ be met.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_SETSCENE_VERIFY_FUNCTION2'><filename>BB_SETSCENE_VERIFY_FUNCTION2</filename></link>:
+ Specifies a function to call that verifies the list of
+ planned task execution before the main task execution
+ happens.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_STAMP_POLICY'><filename>BB_STAMP_POLICY</filename></link>:
+ Defines the mode for comparing timestamps of stamp files.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_STAMP_WHITELIST'><filename>BB_STAMP_WHITELIST</filename></link>:
+ Lists stamp files that are looked at when the stamp policy
+ is "whitelist".
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BB_TASKHASH'><filename>BB_TASKHASH</filename></link>:
+ Within an executing task, this variable holds the hash
+ of the task as returned by the currently enabled
+ signature generator.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-STAMP'><filename>STAMP</filename></link>:
+ The base path to create stamp files.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-STAMPCLEAN'><filename>STAMPCLEAN</filename></link>:
+ Again, the base path to create stamp files but can use wildcards
+ for matching a range of files for clean operations.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
new file mode 100644
index 000000000..0313359d9
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml
@@ -0,0 +1,2383 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<!-- Dummy chapter -->
+<chapter id='ref-variables-glos'>
+
+<title>Variables Glossary</title>
+
+<para>
+ This chapter lists common variables used by BitBake and gives an overview
+ of their function and contents.
+</para>
+
+<note>
+ Following are some points regarding the variables listed in this glossary:
+ <itemizedlist>
+ <listitem><para>The variables listed in this glossary
+ are specific to BitBake.
+ Consequently, the descriptions are limited to that context.
+ </para></listitem>
+ <listitem><para>Also, variables exist in other systems that use BitBake
+ (e.g. The Yocto Project and OpenEmbedded) that have names identical
+ to those found in this glossary.
+ For such cases, the variables in those systems extend the
+ functionality of the variable as it is described here in
+ this glossary.
+ </para></listitem>
+ <listitem><para>Finally, there are variables mentioned in this
+ glossary that do not appear in the BitBake glossary.
+ These other variables are variables used in systems that use
+ BitBake.
+ </para></listitem>
+ </itemizedlist>
+</note>
+
+<glossary id='ref-variables-glossary'>
+
+ <para>
+ <link linkend='var-ASSUME_PROVIDED'>A</link>
+ <link linkend='var-B'>B</link>
+ <link linkend='var-CACHE'>C</link>
+ <link linkend='var-DEFAULT_PREFERENCE'>D</link>
+ <link linkend='var-EXCLUDE_FROM_WORLD'>E</link>
+ <link linkend='var-FAKEROOT'>F</link>
+ <link linkend='var-GITDIR'>G</link>
+ <link linkend='var-HGDIR'>H</link>
+<!-- <link linkend='var-ICECC_DISABLED'>I</link> -->
+<!-- <link linkend='var-glossary-j'>J</link> -->
+<!-- <link linkend='var-KARCH'>K</link> -->
+ <link linkend='var-LAYERDEPENDS'>L</link>
+ <link linkend='var-MIRRORS'>M</link>
+<!-- <link linkend='var-glossary-n'>N</link> -->
+ <link linkend='var-OVERRIDES'>O</link>
+ <link linkend='var-P4DIR'>P</link>
+<!-- <link linkend='var-QMAKE_PROFILES'>Q</link> -->
+ <link linkend='var-RDEPENDS'>R</link>
+ <link linkend='var-SECTION'>S</link>
+ <link linkend='var-T'>T</link>
+<!-- <link linkend='var-UBOOT_CONFIG'>U</link> -->
+<!-- <link linkend='var-glossary-v'>V</link> -->
+<!-- <link linkend='var-WARN_QA'>W</link> -->
+<!-- <link linkend='var-glossary-x'>X</link> -->
+<!-- <link linkend='var-glossary-y'>Y</link> -->
+<!-- <link linkend='var-glossary-z'>Z</link>-->
+ </para>
+
+ <glossdiv id='var-glossary-a'><title>A</title>
+
+ <glossentry id='var-ASSUME_PROVIDED'><glossterm>ASSUME_PROVIDED</glossterm>
+ <glossdef>
+ <para>
+ Lists recipe names
+ (<link linkend='var-PN'><filename>PN</filename></link>
+ values) BitBake does not attempt to build.
+ Instead, BitBake assumes these recipes have already been
+ built.
+ </para>
+
+ <para>
+ In OpenEmbedded-Core, <filename>ASSUME_PROVIDED</filename>
+ mostly specifies native tools that should not be built.
+ An example is <filename>git-native</filename>, which
+ when specified allows for the Git binary from the host to
+ be used rather than building
+ <filename>git-native</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+
+ <glossdiv id='var-glossary-b'><title>B</title>
+
+ <glossentry id='var-B'><glossterm>B</glossterm>
+ <glossdef>
+ <para>
+ The directory in which BitBake executes functions
+ during a recipe's build process.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_ALLOWED_NETWORKS'><glossterm>BB_ALLOWED_NETWORKS</glossterm>
+ <glossdef>
+ <para>
+ Specifies a space-delimited list of hosts that the fetcher
+ is allowed to use to obtain the required source code.
+ Following are considerations surrounding this variable:
+ <itemizedlist>
+ <listitem><para>
+ This host list is only used if
+ <link linkend='var-BB_NO_NETWORK'><filename>BB_NO_NETWORK</filename></link>
+ is either not set or set to "0".
+ </para></listitem>
+ <listitem><para>
+ Limited support for wildcard matching against the
+ beginning of host names exists.
+ For example, the following setting matches
+ <filename>git.gnu.org</filename>,
+ <filename>ftp.gnu.org</filename>, and
+ <filename>foo.git.gnu.org</filename>.
+ <literallayout class='monospaced'>
+ BB_ALLOWED_NETWORKS = "*.gnu.org"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Mirrors not in the host list are skipped and
+ logged in debug.
+ </para></listitem>
+ <listitem><para>
+ Attempts to access networks not in the host list
+ cause a failure.
+ </para></listitem>
+ </itemizedlist>
+ Using <filename>BB_ALLOWED_NETWORKS</filename> in
+ conjunction with
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ is very useful.
+ Adding the host you want to use to
+ <filename>PREMIRRORS</filename> results in the source code
+ being fetched from an allowed location and avoids raising
+ an error when a host that is not allowed is in a
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ statement.
+ This is because the fetcher does not attempt to use the
+ host listed in <filename>SRC_URI</filename> after a
+ successful fetch from the
+ <filename>PREMIRRORS</filename> occurs.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_CONSOLELOG'><glossterm>BB_CONSOLELOG</glossterm>
+ <glossdef>
+ <para>
+ Specifies the path to a log file into which BitBake's user
+ interface writes output during the build.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_CURRENTTASK'><glossterm>BB_CURRENTTASK</glossterm>
+ <glossdef>
+ <para>
+ Contains the name of the currently running task.
+ The name does not include the
+ <filename>do_</filename> prefix.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DANGLINGAPPENDS_WARNONLY'><glossterm>BB_DANGLINGAPPENDS_WARNONLY</glossterm>
+ <glossdef>
+ <para>
+ Defines how BitBake handles situations where an append
+ file (<filename>.bbappend</filename>) has no
+ corresponding recipe file (<filename>.bb</filename>).
+ This condition often occurs when layers get out of sync
+ (e.g. <filename>oe-core</filename> bumps a
+ recipe version and the old recipe no longer exists and the
+ other layer has not been updated to the new version
+ of the recipe yet).
+ </para>
+
+ <para>
+ The default fatal behavior is safest because it is
+ the sane reaction given something is out of sync.
+ It is important to realize when your changes are no longer
+ being applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DEFAULT_TASK'><glossterm>BB_DEFAULT_TASK</glossterm>
+ <glossdef>
+ <para>
+ The default task to use when none is specified (e.g.
+ with the <filename>-c</filename> command line option).
+ The task name specified should not include the
+ <filename>do_</filename> prefix.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DISKMON_DIRS'><glossterm>BB_DISKMON_DIRS</glossterm>
+ <glossdef>
+ <para>
+ Monitors disk space and available inodes during the build
+ and allows you to control the build based on these
+ parameters.
+ </para>
+
+ <para>
+ Disk space monitoring is disabled by default.
+ When setting this variable, use the following form:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "&lt;action&gt;,&lt;dir&gt;,&lt;threshold&gt; [...]"
+
+ where:
+
+ &lt;action&gt; is:
+ ABORT: Immediately abort the build when
+ a threshold is broken.
+ STOPTASKS: Stop the build after the currently
+ executing tasks have finished when
+ a threshold is broken.
+ WARN: Issue a warning but continue the
+ build when a threshold is broken.
+ Subsequent warnings are issued as
+ defined by the
+ <link linkend='var-BB_DISKMON_WARNINTERVAL'>BB_DISKMON_WARNINTERVAL</link> variable,
+ which must be defined.
+
+ &lt;dir&gt; is:
+ Any directory you choose. You can specify one or
+ more directories to monitor by separating the
+ groupings with a space. If two directories are
+ on the same device, only the first directory
+ is monitored.
+
+ &lt;threshold&gt; is:
+ Either the minimum available disk space,
+ the minimum number of free inodes, or
+ both. You must specify at least one. To
+ omit one or the other, simply omit the value.
+ Specify the threshold using G, M, K for Gbytes,
+ Mbytes, and Kbytes, respectively. If you do
+ not specify G, M, or K, Kbytes is assumed by
+ default. Do not use GB, MB, or KB.
+ </literallayout>
+ </para>
+
+ <para>
+ Here are some examples:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "ABORT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
+ BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G"
+ BB_DISKMON_DIRS = "ABORT,${TMPDIR},,100K"
+ </literallayout>
+ The first example works only if you also set
+ the <link linkend='var-BB_DISKMON_WARNINTERVAL'><filename>BB_DISKMON_WARNINTERVAL</filename></link> variable.
+ This example causes the build system to immediately
+ abort when either the disk space in <filename>${TMPDIR}</filename> drops
+ below 1 Gbyte or the available free inodes drops below
+ 100 Kbytes.
+ Because two directories are provided with the variable, the
+ build system also issues a
+ warning when the disk space in the
+ <filename>${SSTATE_DIR}</filename> directory drops
+ below 1 Gbyte or the number of free inodes drops
+ below 100 Kbytes.
+ Subsequent warnings are issued during intervals as
+ defined by the <filename>BB_DISKMON_WARNINTERVAL</filename>
+ variable.
+ </para>
+
+ <para>
+ The second example stops the build after all currently
+ executing tasks complete when the minimum disk space
+ in the <filename>${TMPDIR}</filename>
+ directory drops below 1 Gbyte.
+ No disk monitoring occurs for the free inodes in this case.
+ </para>
+
+ <para>
+ The final example immediately aborts the build when the
+ number of free inodes in the <filename>${TMPDIR}</filename> directory
+ drops below 100 Kbytes.
+ No disk space monitoring for the directory itself occurs
+ in this case.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DISKMON_WARNINTERVAL'><glossterm>BB_DISKMON_WARNINTERVAL</glossterm>
+ <glossdef>
+ <para>
+ Defines the disk space and free inode warning intervals.
+ </para>
+
+ <para>
+ If you are going to use the
+ <filename>BB_DISKMON_WARNINTERVAL</filename> variable, you must
+ also use the
+ <link linkend='var-BB_DISKMON_DIRS'><filename>BB_DISKMON_DIRS</filename></link> variable
+ and define its action as "WARN".
+ During the build, subsequent warnings are issued each time
+ disk space or number of free inodes further reduces by
+ the respective interval.
+ </para>
+
+ <para>
+ If you do not provide a <filename>BB_DISKMON_WARNINTERVAL</filename>
+ variable and you do use <filename>BB_DISKMON_DIRS</filename> with
+ the "WARN" action, the disk monitoring interval defaults to
+ the following:
+ <literallayout class='monospaced'>
+ BB_DISKMON_WARNINTERVAL = "50M,5K"
+ </literallayout>
+ </para>
+
+ <para>
+ When specifying the variable in your configuration file,
+ use the following form:
+ <literallayout class='monospaced'>
+ BB_DISKMON_WARNINTERVAL = "&lt;disk_space_interval&gt;,&lt;disk_inode_interval&gt;"
+
+ where:
+
+ &lt;disk_space_interval&gt; is:
+ An interval of memory expressed in either
+ G, M, or K for Gbytes, Mbytes, or Kbytes,
+ respectively. You cannot use GB, MB, or KB.
+
+ &lt;disk_inode_interval&gt; is:
+ An interval of free inodes expressed in either
+ G, M, or K for Gbytes, Mbytes, or Kbytes,
+ respectively. You cannot use GB, MB, or KB.
+ </literallayout>
+ </para>
+
+ <para>
+ Here is an example:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "WARN,${SSTATE_DIR},1G,100K"
+ BB_DISKMON_WARNINTERVAL = "50M,5K"
+ </literallayout>
+ These variables cause BitBake to
+ issue subsequent warnings each time the available
+ disk space further reduces by 50 Mbytes or the number
+ of free inodes further reduces by 5 Kbytes in the
+ <filename>${SSTATE_DIR}</filename> directory.
+ Subsequent warnings based on the interval occur each time
+ a respective interval is reached beyond the initial warning
+ (i.e. 1 Gbytes and 100 Kbytes).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_ENV_WHITELIST'><glossterm>BB_ENV_WHITELIST</glossterm>
+ <glossdef>
+ <para>
+ Specifies the internal whitelist of variables to allow
+ through from the external environment into BitBake's
+ datastore.
+ If the value of this variable is not specified
+ (which is the default), the following list is used:
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>,
+ <link linkend='var-BB_PRESERVE_ENV'><filename>BB_PRESERVE_ENV</filename></link>,
+ <link linkend='var-BB_ENV_WHITELIST'><filename>BB_ENV_WHITELIST</filename></link>,
+ and
+ <link linkend='var-BB_ENV_EXTRAWHITE'><filename>BB_ENV_EXTRAWHITE</filename></link>.
+ <note>
+ You must set this variable in the external environment
+ in order for it to work.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_ENV_EXTRAWHITE'><glossterm>BB_ENV_EXTRAWHITE</glossterm>
+ <glossdef>
+ <para>
+ Specifies an additional set of variables to allow through
+ (whitelist) from the external environment into BitBake's
+ datastore.
+ This list of variables are on top of the internal list
+ set in
+ <link linkend='var-BB_ENV_WHITELIST'><filename>BB_ENV_WHITELIST</filename></link>.
+ <note>
+ You must set this variable in the external
+ environment in order for it to work.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_FETCH_PREMIRRORONLY'><glossterm>BB_FETCH_PREMIRRORONLY</glossterm>
+ <glossdef>
+ <para>
+ When set to "1", causes BitBake's fetcher module to only
+ search
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ for files.
+ BitBake will not search the main
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ or
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_FILENAME'><glossterm>BB_FILENAME</glossterm>
+ <glossdef>
+ <para>
+ Contains the filename of the recipe that owns the currently
+ running task.
+ For example, if the <filename>do_fetch</filename> task that
+ resides in the <filename>my-recipe.bb</filename> is
+ executing, the <filename>BB_FILENAME</filename> variable
+ contains "/foo/path/my-recipe.bb".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_GENERATE_MIRROR_TARBALLS'><glossterm>BB_GENERATE_MIRROR_TARBALLS</glossterm>
+ <glossdef>
+ <para>
+ Causes tarballs of the Git repositories, including the
+ Git metadata, to be placed in the
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ directory.
+ Anyone wishing to create a source mirror would want to
+ enable this variable.
+ </para>
+
+ <para>
+ For performance reasons, creating and placing tarballs of
+ the Git repositories is not the default action by BitBake.
+ <literallayout class='monospaced'>
+ BB_GENERATE_MIRROR_TARBALLS = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_HASHCONFIG_WHITELIST'><glossterm>BB_HASHCONFIG_WHITELIST</glossterm>
+ <glossdef>
+ <para>
+ Lists variables that are excluded from base configuration
+ checksum, which is used to determine if the cache can
+ be reused.
+ </para>
+
+ <para>
+ One of the ways BitBake determines whether to re-parse the
+ main metadata is through checksums of the variables in the
+ datastore of the base configuration data.
+ There are variables that you typically want to exclude when
+ checking whether or not to re-parse and thus rebuild the
+ cache.
+ As an example, you would usually exclude
+ <filename>TIME</filename> and <filename>DATE</filename>
+ because these variables are always changing.
+ If you did not exclude them, BitBake would never reuse the
+ cache.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_HASHBASE_WHITELIST'><glossterm>BB_HASHBASE_WHITELIST</glossterm>
+ <glossdef>
+ <para>
+ Lists variables that are excluded from checksum and
+ dependency data.
+ Variables that are excluded can therefore change without
+ affecting the checksum mechanism.
+ A common example would be the variable for the path of
+ the build.
+ BitBake's output should not (and usually does not) depend
+ on the directory in which it was built.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_HASHCHECK_FUNCTION'><glossterm>BB_HASHCHECK_FUNCTION</glossterm>
+ <glossdef>
+ <para>
+ Specifies the name of the function to call during the
+ "setscene" part of the task's execution in order to
+ validate the list of task hashes.
+ The function returns the list of setscene tasks that should
+ be executed.
+ </para>
+
+ <para>
+ At this point in the execution of the code, the objective
+ is to quickly verify if a given setscene function is likely
+ to work or not.
+ It's easier to check the list of setscene functions in
+ one pass than to call many individual tasks.
+ The returned list need not be completely accurate.
+ A given setscene task can still later fail.
+ However, the more accurate the data returned, the more
+ efficient the build will be.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_INVALIDCONF'><glossterm>BB_INVALIDCONF</glossterm>
+ <glossdef>
+ <para>
+ Used in combination with the
+ <filename>ConfigParsed</filename> event to trigger
+ re-parsing the base metadata (i.e. all the
+ recipes).
+ The <filename>ConfigParsed</filename> event can set the
+ variable to trigger the re-parse.
+ You must be careful to avoid recursive loops with this
+ functionality.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_LOGFMT'><glossterm>BB_LOGFMT</glossterm>
+ <glossdef>
+ <para>
+ Specifies the name of the log files saved into
+ <filename>${</filename><link linkend='var-T'><filename>T</filename></link><filename>}</filename>.
+ By default, the <filename>BB_LOGFMT</filename> variable
+ is undefined and the log file names get created using the
+ following form:
+ <literallayout class='monospaced'>
+ log.{task}.{pid}
+ </literallayout>
+ If you want to force log files to take a specific name,
+ you can set this variable in a configuration file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_NICE_LEVEL'><glossterm>BB_NICE_LEVEL</glossterm>
+ <glossdef>
+ <para>
+ Allows BitBake to run at a specific priority
+ (i.e. nice level).
+ System permissions usually mean that BitBake can reduce its
+ priority but not raise it again.
+ See
+ <link linkend='var-BB_TASK_NICE_LEVEL'><filename>BB_TASK_NICE_LEVEL</filename></link>
+ for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_NO_NETWORK'><glossterm>BB_NO_NETWORK</glossterm>
+ <glossdef>
+ <para>
+ Disables network access in the BitBake fetcher modules.
+ With this access disabled, any command that attempts to
+ access the network becomes an error.
+ </para>
+
+ <para>
+ Disabling network access is useful for testing source
+ mirrors, running builds when not connected to the Internet,
+ and when operating in certain kinds of firewall
+ environments.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_NUMBER_THREADS'><glossterm>BB_NUMBER_THREADS</glossterm>
+ <glossdef>
+ <para>
+ The maximum number of tasks BitBake should run in parallel
+ at any one time.
+ If your host development system supports multiple cores,
+ a good rule of thumb is to set this variable to twice the
+ number of cores.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_NUMBER_PARSE_THREADS'><glossterm>BB_NUMBER_PARSE_THREADS</glossterm>
+ <glossdef>
+ <para>
+ Sets the number of threads BitBake uses when parsing.
+ By default, the number of threads is equal to the number
+ of cores on the system.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_ORIGENV'><glossterm>BB_ORIGENV</glossterm>
+ <glossdef>
+ <para>
+ Contains a copy of the original external environment in
+ which BitBake was run.
+ The copy is taken before any whitelisted variable values
+ are filtered into BitBake's datastore.
+ <note>
+ The contents of this variable is a datastore object
+ that can be queried using the normal datastore
+ operations.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_PRESERVE_ENV'><glossterm>BB_PRESERVE_ENV</glossterm>
+ <glossdef>
+ <para>
+ Disables whitelisting and instead allows all variables
+ through from the external environment into BitBake's
+ datastore.
+ <note>
+ You must set this variable in the external
+ environment in order for it to work.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_RUNFMT'><glossterm>BB_RUNFMT</glossterm>
+ <glossdef>
+ <para>
+ Specifies the name of the executable script files
+ (i.e. run files) saved into
+ <filename>${</filename><link linkend='var-T'><filename>T</filename></link><filename>}</filename>.
+ By default, the <filename>BB_RUNFMT</filename> variable
+ is undefined and the run file names get created using the
+ following form:
+ <literallayout class='monospaced'>
+ run.{task}.{pid}
+ </literallayout>
+ If you want to force run files to take a specific name,
+ you can set this variable in a configuration file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_RUNTASK'><glossterm>BB_RUNTASK</glossterm>
+ <glossdef>
+ <para>
+ Contains the name of the currently executing task.
+ The value does not include the "do_" prefix.
+ For example, if the currently executing task is
+ <filename>do_config</filename>, the value is
+ "config".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SCHEDULER'><glossterm>BB_SCHEDULER</glossterm>
+ <glossdef>
+ <para>
+ Selects the name of the scheduler to use for the
+ scheduling of BitBake tasks.
+ Three options exist:
+ <itemizedlist>
+ <listitem><para><emphasis>basic</emphasis> -
+ The basic framework from which everything derives.
+ Using this option causes tasks to be ordered
+ numerically as they are parsed.
+ </para></listitem>
+ <listitem><para><emphasis>speed</emphasis> -
+ Executes tasks first that have more tasks
+ depending on them.
+ The "speed" option is the default.
+ </para></listitem>
+ <listitem><para><emphasis>completion</emphasis> -
+ Causes the scheduler to try to complete a given
+ recipe once its build has started.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SCHEDULERS'><glossterm>BB_SCHEDULERS</glossterm>
+ <glossdef>
+ <para>
+ Defines custom schedulers to import.
+ Custom schedulers need to be derived from the
+ <filename>RunQueueScheduler</filename> class.
+ </para>
+
+ <para>
+ For information how to select a scheduler, see the
+ <link linkend='var-BB_SCHEDULER'><filename>BB_SCHEDULER</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SETSCENE_DEPVALID'><glossterm>BB_SETSCENE_DEPVALID</glossterm>
+ <glossdef>
+ <para>
+ Specifies a function BitBake calls that determines
+ whether BitBake requires a setscene dependency to be met.
+ </para>
+
+ <para>
+ When running a setscene task, BitBake needs to
+ know which dependencies of that setscene task also need
+ to be run.
+ Whether dependencies also need to be run is highly
+ dependent on the metadata.
+ The function specified by this variable returns a
+ "True" or "False" depending on whether the dependency needs
+ to be met.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SETSCENE_VERIFY_FUNCTION2'><glossterm>BB_SETSCENE_VERIFY_FUNCTION2</glossterm>
+ <glossdef>
+ <para>
+ Specifies a function to call that verifies the list of
+ planned task execution before the main task execution
+ happens.
+ The function is called once BitBake has a list of setscene
+ tasks that have run and either succeeded or failed.
+ </para>
+
+ <para>
+ The function allows for a task list check to see if they
+ make sense.
+ Even if BitBake was planning to skip a task, the
+ returned value of the function can force BitBake to run
+ the task, which is necessary under certain metadata
+ defined circumstances.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SIGNATURE_EXCLUDE_FLAGS'><glossterm>BB_SIGNATURE_EXCLUDE_FLAGS</glossterm>
+ <glossdef>
+ <para>
+ Lists variable flags (varflags)
+ that can be safely excluded from checksum
+ and dependency data for keys in the datastore.
+ When generating checksum or dependency data for keys in the
+ datastore, the flags set against that key are normally
+ included in the checksum.
+ </para>
+
+ <para>
+ For more information on varflags, see the
+ "<link linkend='variable-flags'>Variable Flags</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SIGNATURE_HANDLER'><glossterm>BB_SIGNATURE_HANDLER</glossterm>
+ <glossdef>
+ <para>
+ Defines the name of the signature handler BitBake uses.
+ The signature handler defines the way stamp files are
+ created and handled, if and how the signature is
+ incorporated into the stamps, and how the signature
+ itself is generated.
+ </para>
+
+ <para>
+ A new signature handler can be added by injecting a class
+ derived from the
+ <filename>SignatureGenerator</filename> class into the
+ global namespace.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SRCREV_POLICY'><glossterm>BB_SRCREV_POLICY</glossterm>
+ <glossdef>
+ <para>
+ Defines the behavior of the fetcher when it interacts with
+ source control systems and dynamic source revisions.
+ The <filename>BB_SRCREV_POLICY</filename> variable is
+ useful when working without a network.
+ </para>
+
+ <para>
+ The variable can be set using one of two policies:
+ <itemizedlist>
+ <listitem><para><emphasis>cache</emphasis> -
+ Retains the value the system obtained previously
+ rather than querying the source control system
+ each time.
+ </para></listitem>
+ <listitem><para><emphasis>clear</emphasis> -
+ Queries the source controls system every time.
+ With this policy, there is no cache.
+ The "clear" policy is the default.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_STAMP_POLICY'><glossterm>BB_STAMP_POLICY</glossterm>
+ <glossdef>
+ <para>
+ Defines the mode used for how timestamps of stamp files
+ are compared.
+ You can set the variable to one of the following modes:
+ <itemizedlist>
+ <listitem><para><emphasis>perfile</emphasis> -
+ Timestamp comparisons are only made
+ between timestamps of a specific recipe.
+ This is the default mode.
+ </para></listitem>
+ <listitem><para><emphasis>full</emphasis> -
+ Timestamp comparisons are made for all
+ dependencies.
+ </para></listitem>
+ <listitem><para><emphasis>whitelist</emphasis> -
+ Identical to "full" mode except timestamp
+ comparisons are made for recipes listed in the
+ <link linkend='var-BB_STAMP_WHITELIST'><filename>BB_STAMP_WHITELIST</filename></link>
+ variable.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ Stamp policies are largely obsolete with the
+ introduction of setscene tasks.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_STAMP_WHITELIST'><glossterm>BB_STAMP_WHITELIST</glossterm>
+ <glossdef>
+ <para>
+ Lists files whose stamp file timestamps are compared when
+ the stamp policy mode is set to "whitelist".
+ For information on stamp policies, see the
+ <link linkend='var-BB_STAMP_POLICY'><filename>BB_STAMP_POLICY</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_STRICT_CHECKSUM'><glossterm>BB_STRICT_CHECKSUM</glossterm>
+ <glossdef>
+ <para>
+ Sets a more strict checksum mechanism for non-local URLs.
+ Setting this variable to a value causes BitBake
+ to report an error if it encounters a non-local URL
+ that does not have at least one checksum specified.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_TASK_IONICE_LEVEL'><glossterm>BB_TASK_IONICE_LEVEL</glossterm>
+ <glossdef>
+ <para>
+ Allows adjustment of a task's Input/Output priority.
+ During Autobuilder testing, random failures can occur
+ for tasks due to I/O starvation.
+ These failures occur during various QEMU runtime timeouts.
+ You can use the <filename>BB_TASK_IONICE_LEVEL</filename>
+ variable to adjust the I/O priority of these tasks.
+ <note>
+ This variable works similarly to the
+ <link linkend='var-BB_TASK_NICE_LEVEL'><filename>BB_TASK_NICE_LEVEL</filename></link>
+ variable except with a task's I/O priorities.
+ </note>
+ </para>
+
+ <para>
+ Set the variable as follows:
+ <literallayout class='monospaced'>
+ BB_TASK_IONICE_LEVEL = "<replaceable>class</replaceable>.<replaceable>prio</replaceable>"
+ </literallayout>
+ For <replaceable>class</replaceable>, the default value is
+ "2", which is a best effort.
+ You can use "1" for realtime and "3" for idle.
+ If you want to use realtime, you must have superuser
+ privileges.
+ </para>
+
+ <para>
+ For <replaceable>prio</replaceable>, you can use any
+ value from "0", which is the highest priority, to "7",
+ which is the lowest.
+ The default value is "4".
+ You do not need any special privileges to use this range
+ of priority values.
+ <note>
+ In order for your I/O priority settings to take effect,
+ you need the Completely Fair Queuing (CFQ) Scheduler
+ selected for the backing block device.
+ To select the scheduler, use the following command form
+ where <replaceable>device</replaceable> is the device
+ (e.g. sda, sdb, and so forth):
+ <literallayout class='monospaced'>
+ $ sudo sh -c “echo cfq > /sys/block/<replaceable>device</replaceable>/queu/scheduler
+ </literallayout>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_TASK_NICE_LEVEL'><glossterm>BB_TASK_NICE_LEVEL</glossterm>
+ <glossdef>
+ <para>
+ Allows specific tasks to change their priority
+ (i.e. nice level).
+ </para>
+
+ <para>
+ You can use this variable in combination with task
+ overrides to raise or lower priorities of specific tasks.
+ For example, on the
+ <ulink url='http://www.yoctoproject.org'>Yocto Project</ulink>
+ autobuilder, QEMU emulation in images is given a higher
+ priority as compared to build tasks to ensure that images
+ do not suffer timeouts on loaded systems.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_TASKHASH'><glossterm>BB_TASKHASH</glossterm>
+ <glossdef>
+ <para>
+ Within an executing task, this variable holds the hash
+ of the task as returned by the currently enabled
+ signature generator.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_VERBOSE_LOGS'><glossterm>BB_VERBOSE_LOGS</glossterm>
+ <glossdef>
+ <para>
+ Controls how verbose BitBake is during builds.
+ If set, shell scripts echo commands and shell script output
+ appears on standard out (stdout).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_WORKERCONTEXT'><glossterm>BB_WORKERCONTEXT</glossterm>
+ <glossdef>
+ <para>
+ Specifies if the current context is executing a task.
+ BitBake sets this variable to "1" when a task is
+ being executed.
+ The value is not set when the task is in server context
+ during parsing or event handling.
+ </para>
+ </glossdef>
+ </glossentry>
+
+
+ <glossentry id='var-BBCLASSEXTEND'><glossterm>BBCLASSEXTEND</glossterm>
+ <glossdef>
+ <para>
+ Allows you to extend a recipe so that it builds variants
+ of the software.
+ Some examples of these variants for recipes from the
+ OpenEmbedded-Core metadata are "natives" such as
+ <filename>quilt-native</filename>, which is a copy of
+ Quilt built to run on the build system; "crosses" such
+ as <filename>gcc-cross</filename>, which is a compiler
+ built to run on the build machine but produces binaries
+ that run on the target <filename>MACHINE</filename>;
+ "nativesdk", which targets the SDK machine instead of
+ <filename>MACHINE</filename>; and "mulitlibs" in the form
+ "<filename>multilib:</filename><replaceable>multilib_name</replaceable>".
+ </para>
+
+ <para>
+ To build a different variant of the recipe with a minimal
+ amount of code, it usually is as simple as adding the
+ variable to your recipe.
+ Here are two examples.
+ The "native" variants are from the OpenEmbedded-Core
+ metadata:
+ <literallayout class='monospaced'>
+ BBCLASSEXTEND =+ "native nativesdk"
+ BBCLASSEXTEND =+ "multilib:<replaceable>multilib_name</replaceable>"
+ </literallayout>
+ <note>
+ <para>
+ Internally, the <filename>BBCLASSEXTEND</filename>
+ mechanism generates recipe variants by rewriting
+ variable values and applying overrides such as
+ <filename>_class-native</filename>.
+ For example, to generate a native version of a recipe,
+ a
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ on "foo" is rewritten to a <filename>DEPENDS</filename>
+ on "foo-native".
+ </para>
+
+ <para>
+ Even when using <filename>BBCLASSEXTEND</filename>, the
+ recipe is only parsed once.
+ Parsing once adds some limitations.
+ For example, it is not possible to
+ include a different file depending on the variant,
+ since <filename>include</filename> statements are
+ processed when the recipe is parsed.
+ </para>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBDEBUG'><glossterm>BBDEBUG</glossterm>
+ <glossdef>
+ <para>
+ Sets the BitBake debug output level to a specific value
+ as incremented by the <filename>-D</filename> command line
+ option.
+ <note>
+ You must set this variable in the external environment
+ in order for it to work.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_COLLECTIONS'><glossterm>BBFILE_COLLECTIONS</glossterm>
+ <glossdef>
+ <para>Lists the names of configured layers.
+ These names are used to find the other <filename>BBFILE_*</filename>
+ variables.
+ Typically, each layer appends its name to this variable in its
+ <filename>conf/layer.conf</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_PATTERN'><glossterm>BBFILE_PATTERN</glossterm>
+ <glossdef>
+ <para>Variable that expands to match files from
+ <link linkend='var-BBFILES'><filename>BBFILES</filename></link>
+ in a particular layer.
+ This variable is used in the <filename>conf/layer.conf</filename> file and must
+ be suffixed with the name of the specific layer (e.g.
+ <filename>BBFILE_PATTERN_emenlow</filename>).</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_PRIORITY'><glossterm>BBFILE_PRIORITY</glossterm>
+ <glossdef>
+ <para>Assigns the priority for recipe files in each layer.</para>
+ <para>This variable is useful in situations where the same recipe appears in
+ more than one layer.
+ Setting this variable allows you to prioritize a
+ layer against other layers that contain the same recipe - effectively
+ letting you control the precedence for the multiple layers.
+ The precedence established through this variable stands regardless of a
+ recipe's version
+ (<link linkend='var-PV'><filename>PV</filename></link> variable).
+ For example, a layer that has a recipe with a higher <filename>PV</filename> value but for
+ which the <filename>BBFILE_PRIORITY</filename> is set to have a lower precedence still has a
+ lower precedence.</para>
+ <para>A larger value for the <filename>BBFILE_PRIORITY</filename> variable results in a higher
+ precedence.
+ For example, the value 6 has a higher precedence than the value 5.
+ If not specified, the <filename>BBFILE_PRIORITY</filename> variable is set based on layer
+ dependencies (see the
+ <filename><link linkend='var-LAYERDEPENDS'>LAYERDEPENDS</link></filename> variable for
+ more information.
+ The default priority, if unspecified
+ for a layer with no dependencies, is the lowest defined priority + 1
+ (or 1 if no priorities are defined).</para>
+ <tip>
+ You can use the command <filename>bitbake-layers show-layers</filename> to list
+ all configured layers along with their priorities.
+ </tip>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm>
+ <glossdef>
+ <para>List of recipe files BitBake uses to build software.</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBINCLUDED'><glossterm>BBINCLUDED</glossterm>
+ <glossdef>
+ <para>
+ Contains a space-separated list of all of all files that
+ BitBake's parser included during parsing of the current
+ file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBINCLUDELOGS'><glossterm>BBINCLUDELOGS</glossterm>
+ <glossdef>
+ <para>
+ If set to a value, enables printing the task log when
+ reporting a failed task.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBINCLUDELOGS_LINES'><glossterm>BBINCLUDELOGS_LINES</glossterm>
+ <glossdef>
+ <para>
+ If
+ <link linkend='var-BBINCLUDELOGS'><filename>BBINCLUDELOGS</filename></link>
+ is set, specifies the maximum number of lines from the
+ task log file to print when reporting a failed task.
+ If you do not set <filename>BBINCLUDELOGS_LINES</filename>,
+ the entire log is printed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBLAYERS'><glossterm>BBLAYERS</glossterm>
+ <glossdef>
+ <para>Lists the layers to enable during the build.
+ This variable is defined in the <filename>bblayers.conf</filename> configuration
+ file in the build directory.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBLAYERS = " \
+ /home/scottrif/poky/meta \
+ /home/scottrif/poky/meta-yocto \
+ /home/scottrif/poky/meta-yocto-bsp \
+ /home/scottrif/poky/meta-mykernel \
+ "
+
+ </literallayout>
+ This example enables four layers, one of which is a custom, user-defined layer
+ named <filename>meta-mykernel</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBLAYERS_FETCH_DIR'><glossterm>BBLAYERS_FETCH_DIR</glossterm>
+ <glossdef>
+ <para>
+ Sets the base location where layers are stored.
+ This setting is used in conjunction with
+ <filename>bitbake-layers layerindex-fetch</filename> and
+ tells <filename>bitbake-layers</filename> where to place
+ the fetched layers.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBMASK'><glossterm>BBMASK</glossterm>
+ <glossdef>
+ <para>
+ Prevents BitBake from processing recipes and recipe
+ append files.
+ </para>
+
+ <para>
+ You can use the <filename>BBMASK</filename> variable
+ to "hide" these <filename>.bb</filename> and
+ <filename>.bbappend</filename> files.
+ BitBake ignores any recipe or recipe append files that
+ match any of the expressions.
+ It is as if BitBake does not see them at all.
+ Consequently, matching files are not parsed or otherwise
+ used by BitBake.</para>
+ <para>
+ The values you provide are passed to Python's regular
+ expression compiler.
+ The expressions are compared against the full paths to
+ the files.
+ For complete syntax information, see Python's
+ documentation at
+ <ulink url='http://docs.python.org/release/2.3/lib/re-syntax.html'></ulink>.
+ </para>
+
+ <para>
+ The following example uses a complete regular expression
+ to tell BitBake to ignore all recipe and recipe append
+ files in the <filename>meta-ti/recipes-misc/</filename>
+ directory:
+ <literallayout class='monospaced'>
+ BBMASK = "meta-ti/recipes-misc/"
+ </literallayout>
+ If you want to mask out multiple directories or recipes,
+ you can specify multiple regular expression fragments.
+ This next example masks out multiple directories and
+ individual recipes:
+ <literallayout class='monospaced'>
+ BBMASK += "/meta-ti/recipes-misc/ meta-ti/recipes-ti/packagegroup/"
+ BBMASK += "/meta-oe/recipes-support/"
+ BBMASK += "/meta-foo/.*/openldap"
+ BBMASK += "opencv.*\.bbappend"
+ BBMASK += "lzma"
+ </literallayout>
+ <note>
+ When specifying a directory name, use the trailing
+ slash character to ensure you match just that directory
+ name.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBPATH'><glossterm>BBPATH</glossterm>
+ <glossdef>
+ <para>
+ Used by BitBake to locate class
+ (<filename>.bbclass</filename>) and configuration
+ (<filename>.conf</filename>) files.
+ This variable is analogous to the
+ <filename>PATH</filename> variable.
+ </para>
+
+ <para>
+ If you run BitBake from a directory outside of the
+ build directory,
+ you must be sure to set
+ <filename>BBPATH</filename> to point to the
+ build directory.
+ Set the variable as you would any environment variable
+ and then run BitBake:
+ <literallayout class='monospaced'>
+ $ BBPATH="<replaceable>build_directory</replaceable>"
+ $ export BBPATH
+ $ bitbake <replaceable>target</replaceable>
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBSERVER'><glossterm>BBSERVER</glossterm>
+ <glossdef>
+ <para>
+ Points to the server that runs memory-resident BitBake.
+ The variable is only used when you employ memory-resident
+ BitBake.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBTARGETS'><glossterm>BBTARGETS</glossterm>
+ <glossdef>
+ <para>
+ Allows you to use a configuration file to add to the list
+ of command-line target recipes you want to build.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBVERSIONS'><glossterm>BBVERSIONS</glossterm>
+ <glossdef>
+ <para>
+ Allows a single recipe to build multiple versions of a
+ project from a single recipe file.
+ You also able to specify conditional metadata
+ using the
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ mechanism for a single version or for an optionally named
+ range of versions.
+ </para>
+
+ <para>
+ For more information on <filename>BBVERSIONS</filename>,
+ see the
+ "<link linkend='variants-class-extension-mechanism'>Variants - Class Extension Mechanism</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BITBAKE_UI'><glossterm>BITBAKE_UI</glossterm>
+ <glossdef>
+ <para>
+ Used to specify the UI module to use when running BitBake.
+ Using this variable is equivalent to using the
+ <filename>-u</filename> command-line option.
+ <note>
+ You must set this variable in the external environment
+ in order for it to work.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDNAME'><glossterm>BUILDNAME</glossterm>
+ <glossdef>
+ <para>
+ A name assigned to the build.
+ The name defaults to a datetime stamp of when the build was
+ started but can be defined by the metadata.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BZRDIR'><glossterm>BZRDIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which files checked out of a Bazaar
+ system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-c'><title>C</title>
+
+ <glossentry id='var-CACHE'><glossterm>CACHE</glossterm>
+ <glossdef>
+ <para>
+ Specifies the directory BitBake uses to store a cache
+ of the metadata so it does not need to be parsed every
+ time BitBake is started.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CVSDIR'><glossterm>CVSDIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which files checked out under the
+ CVS system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-d'><title>D</title>
+
+ <glossentry id='var-DEFAULT_PREFERENCE'><glossterm>DEFAULT_PREFERENCE</glossterm>
+ <glossdef>
+ <para>
+ Specifies a weak bias for recipe selection priority.
+ </para>
+ <para>
+ The most common usage of this is variable is to set
+ it to "-1" within a recipe for a development version of a
+ piece of software.
+ Using the variable in this way causes the stable version
+ of the recipe to build by default in the absence of
+ <filename><link linkend='var-PREFERRED_VERSION'>PREFERRED_VERSION</link></filename>
+ being used to build the development version.
+ </para>
+ <note>
+ The bias provided by <filename>DEFAULT_PREFERENCE</filename>
+ is weak and is overridden by
+ <filename><link linkend='var-BBFILE_PRIORITY'>BBFILE_PRIORITY</link></filename>
+ if that variable is different between two layers
+ that contain different versions of the same recipe.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPENDS'><glossterm>DEPENDS</glossterm>
+ <glossdef>
+ <para>
+ Lists a recipe's build-time dependencies
+ (i.e. other recipe files).
+ </para>
+
+ <para>
+ Consider this simple example for two recipes named "a" and
+ "b" that produce similarly named packages.
+ In this example, the <filename>DEPENDS</filename>
+ statement appears in the "a" recipe:
+ <literallayout class='monospaced'>
+ DEPENDS = "b"
+ </literallayout>
+ Here, the dependency is such that the
+ <filename>do_configure</filename> task for recipe "a"
+ depends on the <filename>do_populate_sysroot</filename>
+ task of recipe "b".
+ This means anything that recipe "b" puts into sysroot
+ is available when recipe "a" is configuring itself.
+ </para>
+
+ <para>
+ For information on runtime dependencies, see the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DESCRIPTION'><glossterm>DESCRIPTION</glossterm>
+ <glossdef>
+ <para>
+ A long description for the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DL_DIR'><glossterm>DL_DIR</glossterm>
+ <glossdef>
+ <para>
+ The central download directory used by the build process to
+ store downloads.
+ By default, <filename>DL_DIR</filename> gets files
+ suitable for mirroring for everything except Git
+ repositories.
+ If you want tarballs of Git repositories, use the
+ <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link>
+ variable.
+ </para>
+ </glossdef>
+
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-e'><title>E</title>
+
+ <glossentry id='var-EXCLUDE_FROM_WORLD'><glossterm>EXCLUDE_FROM_WORLD</glossterm>
+ <glossdef>
+ <para>
+ Directs BitBake to exclude a recipe from world builds (i.e.
+ <filename>bitbake world</filename>).
+ During world builds, BitBake locates, parses and builds all
+ recipes found in every layer exposed in the
+ <filename>bblayers.conf</filename> configuration file.
+ </para>
+
+ <para>
+ To exclude a recipe from a world build using this variable,
+ set the variable to "1" in the recipe.
+ </para>
+
+ <note>
+ Recipes added to <filename>EXCLUDE_FROM_WORLD</filename>
+ may still be built during a world build in order to satisfy
+ dependencies of other recipes.
+ Adding a recipe to <filename>EXCLUDE_FROM_WORLD</filename>
+ only ensures that the recipe is not explicitly added
+ to the list of build targets in a world build.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-f'><title>F</title>
+
+ <glossentry id='var-FAKEROOT'><glossterm>FAKEROOT</glossterm>
+ <glossdef>
+ <para>
+ Contains the command to use when running a shell script
+ in a fakeroot environment.
+ The <filename>FAKEROOT</filename> variable is obsolete
+ and has been replaced by the other
+ <filename>FAKEROOT*</filename> variables.
+ See these entries in the glossary for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FAKEROOTBASEENV'><glossterm>FAKEROOTBASEENV</glossterm>
+ <glossdef>
+ <para>
+ Lists environment variables to set when executing
+ the command defined by
+ <link linkend='var-FAKEROOTCMD'><filename>FAKEROOTCMD</filename></link>
+ that starts the bitbake-worker process
+ in the fakeroot environment.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FAKEROOTCMD'><glossterm>FAKEROOTCMD</glossterm>
+ <glossdef>
+ <para>
+ Contains the command that starts the bitbake-worker
+ process in the fakeroot environment.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FAKEROOTDIRS'><glossterm>FAKEROOTDIRS</glossterm>
+ <glossdef>
+ <para>
+ Lists directories to create before running a task in
+ the fakeroot environment.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FAKEROOTENV'><glossterm>FAKEROOTENV</glossterm>
+ <glossdef>
+ <para>
+ Lists environment variables to set when running a task
+ in the fakeroot environment.
+ For additional information on environment variables and
+ the fakeroot environment, see the
+ <link linkend='var-FAKEROOTBASEENV'><filename>FAKEROOTBASEENV</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FAKEROOTNOENV'><glossterm>FAKEROOTNOENV</glossterm>
+ <glossdef>
+ <para>
+ Lists environment variables to set when running a task
+ that is not in the fakeroot environment.
+ For additional information on environment variables and
+ the fakeroot environment, see the
+ <link linkend='var-FAKEROOTENV'><filename>FAKEROOTENV</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FETCHCMD'><glossterm>FETCHCMD</glossterm>
+ <glossdef>
+ <para>
+ Defines the command the BitBake fetcher module
+ executes when running fetch operations.
+ You need to use an override suffix when you use the
+ variable (e.g. <filename>FETCHCMD_git</filename>
+ or <filename>FETCHCMD_svn</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILE'><glossterm>FILE</glossterm>
+ <glossdef>
+ <para>
+ Points at the current file.
+ BitBake sets this variable during the parsing process
+ to identify the file being parsed.
+ BitBake also sets this variable when a recipe is being
+ executed to identify the recipe file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILESPATH'><glossterm>FILESPATH</glossterm>
+ <glossdef>
+ <para>
+ Specifies directories BitBake uses when searching for
+ patches and files.
+ The "local" fetcher module uses these directories when
+ handling <filename>file://</filename> URLs.
+ The variable behaves like a shell <filename>PATH</filename>
+ environment variable.
+ The value is a colon-separated list of directories that
+ are searched left-to-right in order.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+
+ <glossdiv id='var-glossary-g'><title>G</title>
+
+ <glossentry id='var-GITDIR'><glossterm>GITDIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which a local copy of a Git repository
+ is stored when it is cloned.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+
+ <glossdiv id='var-glossary-h'><title>H</title>
+
+ <glossentry id='var-HGDIR'><glossterm>HGDIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which files checked out of a Mercurial
+ system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOMEPAGE'><glossterm>HOMEPAGE</glossterm>
+ <glossdef>
+ <para>Website where more information about the software the recipe is building
+ can be found.</para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-i'><title>I</title>
+
+ <glossentry id='var-INHERIT'><glossterm>INHERIT</glossterm>
+ <glossdef>
+ <para>
+ Causes the named class or classes to be inherited globally.
+ Anonymous functions in the class or classes
+ are not executed for the
+ base configuration and in each individual recipe.
+ The OpenEmbedded build system ignores changes to
+ <filename>INHERIT</filename> in individual recipes.
+ </para>
+
+ <para>
+ For more information on <filename>INHERIT</filename>, see
+ the
+ "<link linkend="inherit-configuration-directive"><filename>INHERIT</filename> Configuration Directive</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+<!--
+ <glossdiv id='var-glossary-j'><title>J</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-k'><title>K</title>
+ </glossdiv>
+-->
+
+ <glossdiv id='var-glossary-l'><title>L</title>
+
+ <glossentry id='var-LAYERDEPENDS'><glossterm>LAYERDEPENDS</glossterm>
+ <glossdef>
+ <para>Lists the layers, separated by spaces, upon which this recipe depends.
+ Optionally, you can specify a specific layer version for a dependency
+ by adding it to the end of the layer name with a colon, (e.g. "anotherlayer:3"
+ to be compared against
+ <link linkend='var-LAYERVERSION'><filename>LAYERVERSION</filename></link><filename>_anotherlayer</filename>
+ in this case).
+ BitBake produces an error if any dependency is missing or
+ the version numbers do not match exactly (if specified).</para>
+ <para>
+ You use this variable in the <filename>conf/layer.conf</filename> file.
+ You must also use the specific layer name as a suffix
+ to the variable (e.g. <filename>LAYERDEPENDS_mylayer</filename>).</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERDIR'><glossterm>LAYERDIR</glossterm>
+ <glossdef>
+ <para>When used inside the <filename>layer.conf</filename> configuration
+ file, this variable provides the path of the current layer.
+ This variable is not available outside of <filename>layer.conf</filename>
+ and references are expanded immediately when parsing of the file completes.</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERDIR_RE'><glossterm>LAYERDIR_RE</glossterm>
+ <glossdef>
+ <para>When used inside the <filename>layer.conf</filename> configuration
+ file, this variable provides the path of the current layer,
+ escaped for use in a regular expression
+ (<link linkend='var-BBFILE_PATTERN'><filename>BBFILE_PATTERN</filename></link>).
+ This variable is not available outside of <filename>layer.conf</filename>
+ and references are expanded immediately when parsing of the file completes.</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERVERSION'><glossterm>LAYERVERSION</glossterm>
+ <glossdef>
+ <para>Optionally specifies the version of a layer as a single number.
+ You can use this variable within
+ <link linkend='var-LAYERDEPENDS'><filename>LAYERDEPENDS</filename></link>
+ for another layer in order to depend on a specific version
+ of the layer.</para>
+ <para>
+ You use this variable in the <filename>conf/layer.conf</filename> file.
+ You must also use the specific layer name as a suffix
+ to the variable (e.g. <filename>LAYERDEPENDS_mylayer</filename>).</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE'><glossterm>LICENSE</glossterm>
+ <glossdef>
+ <para>
+ The list of source licenses for the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-m'><title>M</title>
+
+ <glossentry id='var-MIRRORS'><glossterm>MIRRORS</glossterm>
+ <glossdef>
+ <para>
+ Specifies additional paths from which BitBake gets source code.
+ When the build system searches for source code, it first
+ tries the local download directory.
+ If that location fails, the build system tries locations
+ defined by
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
+ the upstream source, and then locations specified by
+ <filename>MIRRORS</filename> in that order.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MULTI_PROVIDER_WHITELIST'><glossterm>MULTI_PROVIDER_WHITELIST</glossterm>
+ <glossdef>
+ <para>
+ Allows you to suppress BitBake warnings caused when
+ building two separate recipes that provide the same
+ output.
+ </para>
+
+ <para>
+ Bitbake normally issues a warning when building two
+ different recipes where each provides the same output.
+ This scenario is usually something the user does not
+ want.
+ However, cases do exist where it makes sense, particularly
+ in the <filename>virtual/*</filename> namespace.
+ You can use this variable to suppress BitBake's warnings.
+ </para>
+
+ <para>
+ To use the variable, list provider names (e.g.
+ recipe names, <filename>virtual/kernel</filename>,
+ and so forth).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+<!--
+ <glossdiv id='var-glossary-n'><title>N</title>
+ </glossdiv>
+-->
+
+ <glossdiv id='var-glossary-o'><title>O</title>
+
+ <glossentry id='var-OVERRIDES'><glossterm>OVERRIDES</glossterm>
+ <glossdef>
+ <para>
+ BitBake uses <filename>OVERRIDES</filename> to control
+ what variables are overridden after BitBake parses
+ recipes and configuration files.
+ </para>
+
+ <para>
+ Following is a simple example that uses an overrides
+ list based on machine architectures:
+ <literallayout class='monospaced'>
+ OVERRIDES = "arm:x86:mips:powerpc"
+ </literallayout>
+ You can find information on how to use
+ <filename>OVERRIDES</filename> in the
+ "<link linkend='conditional-syntax-overrides'>Conditional Syntax (Overrides)</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-p'><title>P</title>
+
+ <glossentry id='var-P4DIR'><glossterm>P4DIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which a local copy of a Perforce depot
+ is stored when it is fetched.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGES'><glossterm>PACKAGES</glossterm>
+ <glossdef>
+ <para>The list of packages the recipe creates.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGES_DYNAMIC'><glossterm>PACKAGES_DYNAMIC</glossterm>
+ <glossdef>
+ <para>
+ A promise that your recipe satisfies runtime dependencies
+ for optional modules that are found in other recipes.
+ <filename>PACKAGES_DYNAMIC</filename>
+ does not actually satisfy the dependencies, it only states that
+ they should be satisfied.
+ For example, if a hard, runtime dependency
+ (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>)
+ of another package is satisfied during the build
+ through the <filename>PACKAGES_DYNAMIC</filename>
+ variable, but a package with the module name is never actually
+ produced, then the other package will be broken.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PE'><glossterm>PE</glossterm>
+ <glossdef>
+ <para>
+ The epoch of the recipe.
+ By default, this variable is unset.
+ The variable is used to make upgrades possible when the
+ versioning scheme changes in some backwards incompatible
+ way.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PERSISTENT_DIR'><glossterm>PERSISTENT_DIR</glossterm>
+ <glossdef>
+ <para>
+ Specifies the directory BitBake uses to store data that
+ should be preserved between builds.
+ In particular, the data stored is the data that uses
+ BitBake's persistent data API and the data used by the
+ PR Server and PR Service.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PF'><glossterm>PF</glossterm>
+ <glossdef>
+ <para>
+ Specifies the recipe or package name and includes all version and revision
+ numbers (i.e. <filename>eglibc-2.13-r20+svnr15508/</filename> and
+ <filename>bash-4.2-r1/</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PN'><glossterm>PN</glossterm>
+ <glossdef>
+ <para>The recipe name.</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PR'><glossterm>PR</glossterm>
+ <glossdef>
+ <para>The revision of the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREFERRED_PROVIDER'><glossterm>PREFERRED_PROVIDER</glossterm>
+ <glossdef>
+ <para>
+ Determines which recipe should be given preference when
+ multiple recipes provide the same item.
+ You should always suffix the variable with the name of the
+ provided item, and you should set it to the
+ <link linkend='var-PN'><filename>PN</filename></link>
+ of the recipe to which you want to give precedence.
+ Some examples:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+ PREFERRED_PROVIDER_virtual/xserver = "xserver-xf86"
+ PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREFERRED_PROVIDERS'><glossterm>PREFERRED_PROVIDERS</glossterm>
+ <glossdef>
+ <para>
+ Determines which recipe should be given preference for
+ cases where multiple recipes provide the same item.
+ Functionally,
+ <filename>PREFERRED_PROVIDERS</filename> is identical to
+ <link linkend='var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></link>.
+ However, the <filename>PREFERRED_PROVIDERS</filename>
+ variable lets you define preferences for multiple
+ situations using the following form:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDERS = "xxx:yyy aaa:bbb ..."
+ </literallayout>
+ This form is a convenient replacement for the following:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_xxx = "yyy"
+ PREFERRED_PROVIDER_aaa = "bbb"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREFERRED_VERSION'><glossterm>PREFERRED_VERSION</glossterm>
+ <glossdef>
+ <para>
+ If there are multiple versions of recipes available, this
+ variable determines which recipe should be given preference.
+ You must always suffix the variable with the
+ <link linkend='var-PN'><filename>PN</filename></link>
+ you want to select, and you should set
+ <link linkend='var-PV'><filename>PV</filename></link>
+ accordingly for precedence.
+ You can use the "<filename>%</filename>" character as a
+ wildcard to match any number of characters, which can be
+ useful when specifying versions that contain long revision
+ numbers that could potentially change.
+ Here are two examples:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_python = "2.7.3"
+ PREFERRED_VERSION_linux-yocto = "4.12%"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREMIRRORS'><glossterm>PREMIRRORS</glossterm>
+ <glossdef>
+ <para>
+ Specifies additional paths from which BitBake gets source code.
+ When the build system searches for source code, it first
+ tries the local download directory.
+ If that location fails, the build system tries locations
+ defined by <filename>PREMIRRORS</filename>, the upstream
+ source, and then locations specified by
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ in that order.
+ </para>
+
+ <para>
+ Typically, you would add a specific server for the
+ build system to attempt before any others by adding
+ something like the following to your configuration:
+ <literallayout class='monospaced'>
+ PREMIRRORS_prepend = "\
+ git://.*/.* http://www.yoctoproject.org/sources/ \n \
+ ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
+ http://.*/.* http://www.yoctoproject.org/sources/ \n \
+ https://.*/.* http://www.yoctoproject.org/sources/ \n"
+ </literallayout>
+ These changes cause the build system to intercept
+ Git, FTP, HTTP, and HTTPS requests and direct them to
+ the <filename>http://</filename> sources mirror.
+ You can use <filename>file://</filename> URLs to point
+ to local directories or network shares as well.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PROVIDES'><glossterm>PROVIDES</glossterm>
+ <glossdef>
+ <para>
+ A list of aliases by which a particular recipe can be
+ known.
+ By default, a recipe's own
+ <filename><link linkend='var-PN'>PN</link></filename>
+ is implicitly already in its <filename>PROVIDES</filename>
+ list.
+ If a recipe uses <filename>PROVIDES</filename>, the
+ additional aliases are synonyms for the recipe and can
+ be useful satisfying dependencies of other recipes during
+ the build as specified by
+ <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename>.
+ </para>
+
+ <para>
+ Consider the following example
+ <filename>PROVIDES</filename> statement from a recipe
+ file <filename>libav_0.8.11.bb</filename>:
+ <literallayout class='monospaced'>
+ PROVIDES += "libpostproc"
+ </literallayout>
+ The <filename>PROVIDES</filename> statement results in
+ the "libav" recipe also being known as "libpostproc".
+ </para>
+
+ <para>
+ In addition to providing recipes under alternate names,
+ the <filename>PROVIDES</filename> mechanism is also used
+ to implement virtual targets.
+ A virtual target is a name that corresponds to some
+ particular functionality (e.g. a Linux kernel).
+ Recipes that provide the functionality in question list the
+ virtual target in <filename>PROVIDES</filename>.
+ Recipes that depend on the functionality in question can
+ include the virtual target in
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ to leave the choice of provider open.
+ </para>
+
+ <para>
+ Conventionally, virtual targets have names on the form
+ "virtual/function" (e.g. "virtual/kernel").
+ The slash is simply part of the name and has no
+ syntactical significance.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PRSERV_HOST'><glossterm>PRSERV_HOST</glossterm>
+ <glossdef>
+ <para>
+ The network based
+ <link linkend='var-PR'><filename>PR</filename></link>
+ service host and port.
+ </para>
+
+ <para>
+ Following is an example of how the <filename>PRSERV_HOST</filename> variable is
+ set:
+ <literallayout class='monospaced'>
+ PRSERV_HOST = "localhost:0"
+ </literallayout>
+ You must set the variable if you want to automatically
+ start a local PR service.
+ You can set <filename>PRSERV_HOST</filename> to other
+ values to use a remote PR service.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PV'><glossterm>PV</glossterm>
+ <glossdef>
+ <para>The version of the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+<!--
+ <glossdiv id='var-glossary-q'><title>Q</title>
+ </glossdiv>
+-->
+
+ <glossdiv id='var-glossary-r'><title>R</title>
+
+ <glossentry id='var-RDEPENDS'><glossterm>RDEPENDS</glossterm>
+ <glossdef>
+ <para>
+ Lists a package's runtime dependencies (i.e. other packages)
+ that must be installed in order for the built package to run
+ correctly.
+ If a package in this list cannot be found during the build,
+ you will get a build error.
+ </para>
+
+ <para>
+ Because the <filename>RDEPENDS</filename> variable applies
+ to packages being built, you should always use the variable
+ in a form with an attached package name.
+ For example, suppose you are building a development package
+ that depends on the <filename>perl</filename> package.
+ In this case, you would use the following
+ <filename>RDEPENDS</filename> statement:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN}-dev += "perl"
+ </literallayout>
+ In the example, the development package depends on
+ the <filename>perl</filename> package.
+ Thus, the <filename>RDEPENDS</filename> variable has the
+ <filename>${PN}-dev</filename> package name as part of the
+ variable.
+ </para>
+
+ <para>
+ BitBake supports specifying versioned dependencies.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RDEPENDS</filename> variable:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <filename>operator</filename>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For example, the following sets up a dependency on version
+ 1.2 or greater of the package <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on build-time dependencies, see the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-REPODIR'><glossterm>REPODIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which a local copy of a
+ <filename>google-repo</filename> directory is stored
+ when it is synced.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RPROVIDES'><glossterm>RPROVIDES</glossterm>
+ <glossdef>
+ <para>
+ A list of package name aliases that a package also provides.
+ These aliases are useful for satisfying runtime dependencies
+ of other packages both during the build and on the target
+ (as specified by
+ <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename>).
+ </para>
+ <para>
+ As with all package-controlling variables, you must always
+ use the variable in conjunction with a package name override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RPROVIDES_${PN} = "widget-abi-2"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RRECOMMENDS'><glossterm>RRECOMMENDS</glossterm>
+ <glossdef>
+ <para>
+ A list of packages that extends the usability of a package
+ being built.
+ The package being built does not depend on this list of
+ packages in order to successfully build, but needs them for
+ the extended usability.
+ To specify runtime dependencies for packages, see the
+ <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename>
+ variable.
+ </para>
+
+ <para>
+ BitBake supports specifying versioned recommends.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RRECOMMENDS</filename> variable:
+ <literallayout class='monospaced'>
+ RRECOMMENDS_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <filename>operator</filename>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For example, the following sets up a recommend on version
+ 1.2 or greater of the package <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RRECOMMENDS_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-s'><title>S</title>
+
+ <glossentry id='var-SECTION'><glossterm>SECTION</glossterm>
+ <glossdef>
+ <para>The section in which packages should be categorized.</para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRC_URI'><glossterm>SRC_URI</glossterm>
+ <glossdef>
+ <para>
+ The list of source files - local or remote.
+ This variable tells BitBake which bits
+ to pull for the build and how to pull them.
+ For example, if the recipe or append file needs to
+ fetch a single tarball from the Internet, the recipe or
+ append file uses a <filename>SRC_URI</filename>
+ entry that specifies that tarball.
+ On the other hand, if the recipe or append file needs to
+ fetch a tarball and include a custom file, the recipe or
+ append file needs an <filename>SRC_URI</filename> variable
+ that specifies all those sources.</para>
+ <para>The following list explains the available URI protocols:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>file://</filename> -</emphasis>
+ Fetches files, which are usually files shipped with
+ the metadata,
+ from the local machine.
+ The path is relative to the
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ variable.</para></listitem>
+ <listitem><para><emphasis><filename>bzr://</filename> -</emphasis> Fetches files from a
+ Bazaar revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>git://</filename> -</emphasis> Fetches files from a
+ Git revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>osc://</filename> -</emphasis> Fetches files from
+ an OSC (OpenSUSE Build service) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>repo://</filename> -</emphasis> Fetches files from
+ a repo (Git) repository.</para></listitem>
+ <listitem><para><emphasis><filename>http://</filename> -</emphasis> Fetches files from
+ the Internet using HTTP.</para></listitem>
+ <listitem><para><emphasis><filename>https://</filename> -</emphasis> Fetches files
+ from the Internet using HTTPS.</para></listitem>
+ <listitem><para><emphasis><filename>ftp://</filename> -</emphasis> Fetches files
+ from the Internet using FTP.</para></listitem>
+ <listitem><para><emphasis><filename>cvs://</filename> -</emphasis> Fetches files from
+ a CVS revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>hg://</filename> -</emphasis> Fetches files from
+ a Mercurial (<filename>hg</filename>) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>p4://</filename> -</emphasis> Fetches files from
+ a Perforce (<filename>p4</filename>) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>ssh://</filename> -</emphasis> Fetches files from
+ a secure shell.</para></listitem>
+ <listitem><para><emphasis><filename>svn://</filename> -</emphasis> Fetches files from
+ a Subversion (<filename>svn</filename>) revision control repository.</para></listitem>
+ </itemizedlist>
+ </para>
+ <para>Here are some additional options worth mentioning:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>unpack</filename> -</emphasis> Controls
+ whether or not to unpack the file if it is an archive.
+ The default action is to unpack the file.</para></listitem>
+ <listitem><para><emphasis><filename>subdir</filename> -</emphasis> Places the file
+ (or extracts its contents) into the specified
+ subdirectory.
+ This option is useful for unusual tarballs or other archives that
+ do not have their files already in a subdirectory within the archive.
+ </para></listitem>
+ <listitem><para><emphasis><filename>name</filename> -</emphasis> Specifies a
+ name to be used for association with <filename>SRC_URI</filename> checksums
+ when you have more than one file specified in <filename>SRC_URI</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>downloadfilename</filename> -</emphasis> Specifies
+ the filename used when storing the downloaded file.</para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCDATE'><glossterm>SRCDATE</glossterm>
+ <glossdef>
+ <para>
+ The date of the source code used to build the package.
+ This variable applies only if the source was fetched from a Source Code Manager (SCM).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCREV'><glossterm>SRCREV</glossterm>
+ <glossdef>
+ <para>
+ The revision of the source code used to build the package.
+ This variable applies only when using Subversion, Git, Mercurial and Bazaar.
+ If you want to build a fixed revision and you want
+ to avoid performing a query on the remote repository every time
+ BitBake parses your recipe, you should specify a <filename>SRCREV</filename> that is a
+ full revision identifier and not just a tag.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCREV_FORMAT'><glossterm>SRCREV_FORMAT</glossterm>
+ <glossdef>
+ <para>
+ Helps construct valid
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ values when multiple source controlled URLs are used in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>.
+ </para>
+
+ <para>
+ The system needs help constructing these values under these
+ circumstances.
+ Each component in the <filename>SRC_URI</filename>
+ is assigned a name and these are referenced
+ in the <filename>SRCREV_FORMAT</filename> variable.
+ Consider an example with URLs named "machine" and "meta".
+ In this case, <filename>SRCREV_FORMAT</filename> could look
+ like "machine_meta" and those names would have the SCM
+ versions substituted into each position.
+ Only one <filename>AUTOINC</filename> placeholder is added
+ and if needed.
+ And, this placeholder is placed at the start of the
+ returned string.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAMP'><glossterm>STAMP</glossterm>
+ <glossdef>
+ <para>
+ Specifies the base path used to create recipe stamp files.
+ The path to an actual stamp file is constructed by evaluating this
+ string and then appending additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAMPCLEAN'><glossterm>STAMPCLEAN</glossterm>
+ <glossdef>
+ <para>
+ Specifies the base path used to create recipe stamp files.
+ Unlike the
+ <link linkend='var-STAMP'><filename>STAMP</filename></link>
+ variable, <filename>STAMPCLEAN</filename> can contain
+ wildcards to match the range of files a clean operation
+ should remove.
+ BitBake uses a clean operation to remove any other stamps
+ it should be removing when creating a new stamp.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SUMMARY'><glossterm>SUMMARY</glossterm>
+ <glossdef>
+ <para>
+ A short summary for the recipe, which is 72 characters or less.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SVNDIR'><glossterm>SVNDIR</glossterm>
+ <glossdef>
+ <para>
+ The directory in which files checked out of a Subversion
+ system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-t'><title>T</title>
+
+ <glossentry id='var-T'><glossterm>T</glossterm>
+ <glossdef>
+ <para>Points to a directory were BitBake places
+ temporary files, which consist mostly of task logs and
+ scripts, when building a particular recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TOPDIR'><glossterm>TOPDIR</glossterm>
+ <glossdef>
+ <para>
+ Points to the build directory.
+ BitBake automatically sets this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+<!--
+ <glossdiv id='var-glossary-u'><title>U</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-v'><title>V</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-w'><title>W</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-x'><title>X</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-y'><title>Y</title>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-z'><title>Z</title>
+ </glossdiv>
+-->
+
+
+</glossary>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css
new file mode 100644
index 000000000..65da2a4e3
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css
@@ -0,0 +1,984 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/bitbake-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml
new file mode 100644
index 000000000..d793265c9
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml
@@ -0,0 +1,88 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<book id='bitbake-user-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/bitbake-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ BitBake User Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Richard Purdie, Chris Larson, and </firstname> <surname>Phil Blundell</surname>
+ <affiliation>
+ <orgname>BitBake Community</orgname>
+ </affiliation>
+ <email>bitbake-devel@lists.openembedded.org</email>
+ </author>
+ </authorgroup>
+
+<!--
+# Add in some revision history if we want it here.
+ <revhistory>
+ <revision>
+ <revnumber>x.x</revnumber>
+ <date>dd month year</date>
+ <revremark>Some relevent comment</revremark>
+ </revision>
+ <revision>
+ <revnumber>x.x</revnumber>
+ <date>dd month year</date>
+ <revremark>Some relevent comment</revremark>
+ </revision>
+ <revision>
+ <revnumber>x.x</revnumber>
+ <date>dd month year</date>
+ <revremark>Some relevent comment</revremark>
+ </revision>
+ <revision>
+ <revnumber>x.x</revnumber>
+ <date>dd month year</date>
+ <revremark>Some relevent comment</revremark>
+ </revision>
+ </revhistory>
+-->
+
+ <copyright>
+ <year>2004-2018</year>
+ <holder>Richard Purdie</holder>
+ <holder>Chris Larson</holder>
+ <holder>and Phil Blundell</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ This work is licensed under the Creative Commons Attribution License.
+ To view a copy of this license, visit
+ <ulink url="http://creativecommons.org/licenses/by/2.5/">http://creativecommons.org/licenses/by/2.5/</ulink>
+ or send a letter to Creative Commons, 444 Castro Street,
+ Suite 900, Mountain View, California 94041, USA.
+ </para>
+ </legalnotice>
+ </bookinfo>
+
+ <xi:include href="bitbake-user-manual-intro.xml"/>
+
+ <xi:include href="bitbake-user-manual-execution.xml"/>
+
+ <xi:include href="bitbake-user-manual-metadata.xml"/>
+
+ <xi:include href="bitbake-user-manual-fetching.xml"/>
+
+ <xi:include href="bitbake-user-manual-ref-variables.xml"/>
+
+ <xi:include href="bitbake-user-manual-hello.xml"/>
+
+</book>
diff --git a/poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png b/poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png
new file mode 100644
index 000000000..cb290154d
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/figures/bitbake-title.png
Binary files differ
diff --git a/poky/bitbake/doc/bitbake-user-manual/html.css b/poky/bitbake/doc/bitbake-user-manual/html.css
new file mode 100644
index 000000000..6eedfd318
--- /dev/null
+++ b/poky/bitbake/doc/bitbake-user-manual/html.css
@@ -0,0 +1,281 @@
+/* Feuille de style DocBook du projet Traduc.org */
+/* DocBook CSS stylesheet of the Traduc.org project */
+
+/* (c) Jean-Philippe Guérard - 14 août 2004 */
+/* (c) Jean-Philippe Guérard - 14 August 2004 */
+
+/* Cette feuille de style est libre, vous pouvez la */
+/* redistribuer et la modifier selon les termes de la Licence */
+/* Art Libre. Vous trouverez un exemplaire de cette Licence sur */
+/* http://tigreraye.org/Petit-guide-du-traducteur.html#licence-art-libre */
+
+/* This work of art is free, you can redistribute it and/or */
+/* modify it according to terms of the Free Art license. You */
+/* will find a specimen of this license on the Copyleft */
+/* Attitude web site: http://artlibre.org as well as on other */
+/* sites. */
+/* Please note that the French version of this licence as shown */
+/* on http://tigreraye.org/Petit-guide-du-traducteur.html#licence-art-libre */
+/* is only official licence of this document. The English */
+/* is only provided to help you understand this licence. */
+
+/* La dernière version de cette feuille de style est toujours */
+/* disponible sur : http://tigreraye.org/style.css */
+/* Elle est également disponible sur : */
+/* http://www.traduc.org/docs/HOWTO/lecture/style.css */
+
+/* The latest version of this stylesheet is available from: */
+/* http://tigreraye.org/style.css */
+/* It is also available on: */
+/* http://www.traduc.org/docs/HOWTO/lecture/style.css */
+
+/* N'hésitez pas à envoyer vos commentaires et corrections à */
+/* Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org> */
+
+/* Please send feedback and bug reports to */
+/* Jean-Philippe Guérard <jean-philippe.guerard@tigreraye.org> */
+
+/* $Id: style.css,v 1.14 2004/09/10 20:12:09 fevrier Exp fevrier $ */
+
+/* Présentation générale du document */
+/* Overall document presentation */
+
+body {
+ /*
+ font-family: Apolline, "URW Palladio L", Garamond, jGaramond,
+ "Bitstream Cyberbit", "Palatino Linotype", serif;
+ */
+ margin: 7%;
+ background-color: white;
+}
+
+/* Taille du texte */
+/* Text size */
+
+* { font-size: 100%; }
+
+/* Gestion des textes mis en relief imbriqués */
+/* Embedded emphasis */
+
+em { font-style: italic; }
+em em { font-style: normal; }
+em em em { font-style: italic; }
+
+/* Titres */
+/* Titles */
+
+h1 { font-size: 200%; font-weight: 900; }
+h2 { font-size: 160%; font-weight: 900; }
+h3 { font-size: 130%; font-weight: bold; }
+h4 { font-size: 115%; font-weight: bold; }
+h5 { font-size: 108%; font-weight: bold; }
+h6 { font-weight: bold; }
+
+/* Nom de famille en petites majuscules (uniquement en français) */
+/* Last names in small caps (for French only) */
+
+*[class~="surname"]:lang(fr) { font-variant: small-caps; }
+
+/* Blocs de citation */
+/* Quotation blocs */
+
+div[class~="blockquote"] {
+ border: solid 2px #AAA;
+ padding: 5px;
+ margin: 5px;
+}
+
+div[class~="blockquote"] > table {
+ border: none;
+}
+
+/* Blocs litéraux : fond gris clair */
+/* Literal blocs: light gray background */
+
+*[class~="literallayout"] {
+ background: #f0f0f0;
+ padding: 5px;
+ margin: 5px;
+}
+
+/* Programmes et captures texte : fond bleu clair */
+/* Listing and text screen snapshots: light blue background */
+
+*[class~="programlisting"], *[class~="screen"] {
+ background: #f0f0ff;
+ padding: 5px;
+ margin: 5px;
+}
+
+/* Les textes à remplacer sont surlignés en vert pâle */
+/* Replaceable text in highlighted in pale green */
+
+*[class~="replaceable"] {
+ background-color: #98fb98;
+ font-style: normal; }
+
+/* Tables : fonds gris clair & bords simples */
+/* Tables: light gray background and solid borders */
+
+*[class~="table"] *[class~="title"] { width:100%; border: 0px; }
+
+table {
+ border: 1px solid #aaa;
+ border-collapse: collapse;
+ padding: 2px;
+ margin: 5px;
+}
+
+/* Listes simples en style table */
+/* Simples lists in table presentation */
+
+table[class~="simplelist"] {
+ background-color: #F0F0F0;
+ margin: 5px;
+ border: solid 1px #AAA;
+}
+
+table[class~="simplelist"] td {
+ border: solid 1px #AAA;
+}
+
+/* Les tables */
+/* Tables */
+
+*[class~="table"] table {
+ background-color: #F0F0F0;
+ border: solid 1px #AAA;
+}
+*[class~="informaltable"] table { background-color: #F0F0F0; }
+
+th,td {
+ vertical-align: baseline;
+ text-align: left;
+ padding: 0.1em 0.3em;
+ empty-cells: show;
+}
+
+/* Alignement des colonnes */
+/* Colunms alignment */
+
+td[align=center] , th[align=center] { text-align: center; }
+td[align=right] , th[align=right] { text-align: right; }
+td[align=left] , th[align=left] { text-align: left; }
+td[align=justify] , th[align=justify] { text-align: justify; }
+
+/* Pas de marge autour des images */
+/* No inside margins for images */
+
+img { border: 0; }
+
+/* Les liens ne sont pas soulignés */
+/* No underlines for links */
+
+:link , :visited , :active { text-decoration: none; }
+
+/* Prudence : cadre jaune et fond jaune clair */
+/* Caution: yellow border and light yellow background */
+
+*[class~="caution"] {
+ border: solid 2px yellow;
+ background-color: #ffffe0;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="caution"] th {
+ vertical-align: middle
+}
+
+*[class~="caution"] table {
+ background-color: #ffffe0;
+ border: none;
+}
+
+/* Note importante : cadre jaune et fond jaune clair */
+/* Important: yellow border and light yellow background */
+
+*[class~="important"] {
+ border: solid 2px yellow;
+ background-color: #ffffe0;
+ padding: 1em 6px 1em;
+ margin: 5px;
+}
+
+*[class~="important"] th {
+ vertical-align: middle
+}
+
+*[class~="important"] table {
+ background-color: #ffffe0;
+ border: none;
+}
+
+/* Mise en évidence : texte légèrement plus grand */
+/* Highlights: slightly larger texts */
+
+*[class~="highlights"] {
+ font-size: 110%;
+}
+
+/* Note : cadre bleu et fond bleu clair */
+/* Notes: blue border and light blue background */
+
+*[class~="note"] {
+ border: solid 2px #7099C5;
+ background-color: #f0f0ff;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="note"] th {
+ vertical-align: middle
+}
+
+*[class~="note"] table {
+ background-color: #f0f0ff;
+ border: none;
+}
+
+/* Astuce : cadre vert et fond vert clair */
+/* Tip: green border and light green background */
+
+*[class~="tip"] {
+ border: solid 2px #00ff00;
+ background-color: #f0ffff;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="tip"] th {
+ vertical-align: middle;
+}
+
+*[class~="tip"] table {
+ background-color: #f0ffff;
+ border: none;
+}
+
+/* Avertissement : cadre rouge et fond rouge clair */
+/* Warning: red border and light red background */
+
+*[class~="warning"] {
+ border: solid 2px #ff0000;
+ background-color: #fff0f0;
+ padding: 1em 6px 1em ;
+ margin: 5px;
+}
+
+*[class~="warning"] th {
+ vertical-align: middle;
+}
+
+
+*[class~="warning"] table {
+ background-color: #fff0f0;
+ border: none;
+}
+
+/* Fin */
+/* The End */
+
diff --git a/poky/bitbake/doc/bitbake.1 b/poky/bitbake/doc/bitbake.1
new file mode 100644
index 000000000..7fc1652ec
--- /dev/null
+++ b/poky/bitbake/doc/bitbake.1
@@ -0,0 +1,142 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH BITBAKE 1 "November 19, 2006"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+BitBake \- simple tool for the execution of tasks
+.SH SYNOPSIS
+.B bitbake
+.RI [ options ] " packagenames"
+.br
+.SH DESCRIPTION
+This manual page documents briefly the
+.B bitbake
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBbitbake\fP is a program that executes the specified task (default is 'build')
+for a given set of BitBake files.
+.br
+It expects that BBFILES is defined, which is a space separated list of files to
+be executed. BBFILES does support wildcards.
+.br
+Default BBFILES are the .bb files in the current directory.
+.SH OPTIONS
+This program follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-\-version
+Show version of program.
+.TP
+.B \-bBUILDFILE, \-\-buildfile=BUILDFILE
+execute the task against this .bb file, rather than a package from BBFILES.
+.TP
+.B \-k, \-\-continue
+continue as much as possible after an error. While the target that failed, and
+those that depend on it, cannot be remade, the other dependencies of these
+targets can be processed all the same.
+.TP
+.B \-a, \-\-tryaltconfigs
+continue with builds by trying to use alternative providers where possible.
+.TP
+.B \-f, \-\-force
+force run of specified cmd, regardless of stamp status
+.TP
+.B \-i, \-\-interactive
+drop into the interactive mode also called the BitBake shell.
+.TP
+.B \-cCMD, \-\-cmd=CMD
+Specify task to execute. Note that this only executes the specified task for
+the providee and the packages it depends on, i.e. 'compile' does not implicitly
+call stage for the dependencies (IOW: use only if you know what you are doing).
+Depending on the base.bbclass a listtasks task is defined and will show
+available tasks.
+.TP
+.B \-rFILE, \-\-read=FILE
+read the specified file before bitbake.conf
+.TP
+.B \-v, \-\-verbose
+output more chit-chat to the terminal
+.TP
+.B \-D, \-\-debug
+Increase the debug level. You can specify this more than once.
+.TP
+.B \-n, \-\-dry-run
+don't execute, just go through the motions
+.TP
+.B \-p, \-\-parse-only
+quit after parsing the BB files (developers only)
+.TP
+.B \-s, \-\-show-versions
+show current and preferred versions of all packages
+.TP
+.B \-e, \-\-environment
+show the global or per-recipe environment (this is what used to be bbread)
+.TP
+.B \-g, \-\-graphviz
+emit the dependency trees of the specified packages in the dot syntax
+.TP
+.B \-IIGNORED\_DOT\_DEPS, \-\-ignore-deps=IGNORED_DOT_DEPS
+Stop processing at the given list of dependencies when generating dependency
+graphs. This can help to make the graph more appealing
+.TP
+.B \-lDEBUG_DOMAINS, \-\-log-domains=DEBUG_DOMAINS
+Show debug logging for the specified logging domains
+.TP
+.B \-P, \-\-profile
+profile the command and print a report
+.TP
+.B \-uUI, \-\-ui=UI
+User interface to use. Currently, knotty, taskexp or ncurses can be specified as UI.
+.TP
+.B \-tSERVERTYPE, \-\-servertype=SERVERTYPE
+Choose which server to use, none, process or xmlrpc.
+.TP
+.B \-\-revisions-changed
+Set the exit code depending on whether upstream floating revisions have changed or not.
+.TP
+.B \-\-server-only
+Run bitbake without UI, the frontend can connect with bitbake server itself.
+.TP
+.B \-BBIND, \-\-bind=BIND
+The name/address for the bitbake server to bind to.
+.TP
+.B \-\-no\-setscene
+Do not run any setscene tasks, forces builds.
+
+.SH ENVIRONMENT VARIABLES
+bitbake uses the following environment variables to control its
+operation:
+.TP
+.B BITBAKE_UI
+The bitbake user interface; overridden by the \fB-u\fP commandline option.
+
+.SH AUTHORS
+BitBake was written by
+Phil Blundell,
+Holger Freyther,
+Chris Larson,
+Mickey Lauer,
+Richard Purdie,
+Holger Schurig
+.PP
+This manual page was written by Marcin Juszkiewicz <marcin@hrw.one.pl>
+for the Debian project (but may be used by others).
diff --git a/poky/bitbake/doc/poky.ent b/poky/bitbake/doc/poky.ent
new file mode 100644
index 000000000..c032e1418
--- /dev/null
+++ b/poky/bitbake/doc/poky.ent
@@ -0,0 +1,59 @@
+<!ENTITY DISTRO "1.4">
+<!ENTITY DISTRO_NAME "tbd">
+<!ENTITY YOCTO_DOC_VERSION "1.4">
+<!ENTITY POKYVERSION "8.0">
+<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
+<!ENTITY COPYRIGHT_YEAR "2010-2013">
+<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
+<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
+<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
+<!ENTITY YOCTO_BUGZILLA_URL "http://bugzilla.yoctoproject.org">
+<!ENTITY YOCTO_WIKI_URL "https://wiki.yoctoproject.org">
+<!ENTITY YOCTO_AB_URL "http://autobuilder.yoctoproject.org">
+<!ENTITY YOCTO_GIT_URL "http://git.yoctoproject.org">
+<!ENTITY YOCTO_ADTREPO_URL "http://adtrepo.yoctoproject.org">
+<!ENTITY OE_HOME_URL "http://www.openembedded.org">
+<!ENTITY OE_LISTS_URL "http://lists.linuxtogo.org/cgi-bin/mailman">
+<!ENTITY OE_DOCS_URL "http://docs.openembedded.org">
+<!ENTITY OH_HOME_URL "http://o-hand.com">
+<!ENTITY BITBAKE_HOME_URL "http://developer.berlios.de/projects/bitbake/">
+<!ENTITY ECLIPSE_MAIN_URL "http://www.eclipse.org/downloads">
+<!ENTITY ECLIPSE_DL_URL "http://download.eclipse.org">
+<!ENTITY ECLIPSE_DL_PLUGIN_URL "&YOCTO_DL_URL;/releases/eclipse-plugin/&DISTRO;">
+<!ENTITY ECLIPSE_UPDATES_URL "&ECLIPSE_DL_URL;/tm/updates/3.3">
+<!ENTITY ECLIPSE_INDIGO_URL "&ECLIPSE_DL_URL;/releases/indigo">
+<!ENTITY ECLIPSE_JUNO_URL "&ECLIPSE_DL_URL;/releases/juno">
+<!ENTITY ECLIPSE_INDIGO_CDT_URL "&ECLIPSE_DL_URL;tools/cdt/releases/indigo">
+<!ENTITY YOCTO_DOCS_URL "&YOCTO_HOME_URL;/docs">
+<!ENTITY YOCTO_SOURCES_URL "&YOCTO_HOME_URL;/sources/">
+<!ENTITY YOCTO_AB_PORT_URL "&YOCTO_AB_URL;:8010">
+<!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_URL;/nightly/">
+<!ENTITY YOCTO_POKY_URL "&YOCTO_DL_URL;/releases/poky/">
+<!ENTITY YOCTO_RELEASE_DL_URL "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;">
+<!ENTITY YOCTO_TOOLCHAIN_DL_URL "&YOCTO_RELEASE_DL_URL;/toolchain/">
+<!ENTITY YOCTO_ECLIPSE_DL_URL "&YOCTO_RELEASE_DL_URL;/eclipse-plugin/indigo;">
+<!ENTITY YOCTO_ADTINSTALLER_DL_URL "&YOCTO_RELEASE_DL_URL;/adt_installer">
+<!ENTITY YOCTO_POKY_DL_URL "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2">
+<!ENTITY YOCTO_MACHINES_DL_URL "&YOCTO_RELEASE_DL_URL;/machines">
+<!ENTITY YOCTO_QEMU_DL_URL "&YOCTO_MACHINES_DL_URL;/qemu">
+<!ENTITY YOCTO_PYTHON-i686_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2">
+<!ENTITY YOCTO_PYTHON-x86_64_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2">
+<!ENTITY YOCTO_DOCS_QS_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html">
+<!ENTITY YOCTO_DOCS_ADT_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html">
+<!ENTITY YOCTO_DOCS_REF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html">
+<!ENTITY YOCTO_DOCS_BSP_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html">
+<!ENTITY YOCTO_DOCS_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html">
+<!ENTITY YOCTO_DOCS_KERNEL_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-manual/kernel-manual.html">
+<!ENTITY YOCTO_ADTPATH_DIR "/opt/poky/&DISTRO;">
+<!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2">
+<!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
+<!ENTITY OE_INIT_FILE "oe-init-build-env">
+<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "gawk wget git-core diffstat unzip texinfo \
+ build-essential chrpath">
+<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
+ diffutils diffstat git cpp gcc gcc-c++ eglibc-devel texinfo chrpath \
+ ccache">
+<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
+ diffstat texinfo python-curses">
+<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
+ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath">
diff --git a/poky/bitbake/doc/template/Vera.ttf b/poky/bitbake/doc/template/Vera.ttf
new file mode 100644
index 000000000..58cd6b5e6
--- /dev/null
+++ b/poky/bitbake/doc/template/Vera.ttf
Binary files differ
diff --git a/poky/bitbake/doc/template/Vera.xml b/poky/bitbake/doc/template/Vera.xml
new file mode 100644
index 000000000..3c82043e3
--- /dev/null
+++ b/poky/bitbake/doc/template/Vera.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics type="TYPE0"><font-name>BitstreamVeraSans</font-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>928</ascender><descender>-235</descender><bbox><left>-183</left><bottom>-235</bottom><right>1287</right><top>928</top></bbox><flags>32</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="600"/><wx w="0"/><wx w="317"/><wx w="317"/><wx w="400"/><wx w="459"/><wx w="837"/><wx w="636"/><wx w="950"/><wx w="779"/><wx w="274"/><wx w="390"/><wx w="390"/><wx w="500"/><wx w="837"/><wx w="317"/><wx w="360"/><wx w="317"/><wx w="336"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="336"/><wx w="336"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="530"/><wx w="1000"/><wx w="684"/><wx w="686"/><wx w="698"/><wx w="770"/><wx w="631"/><wx w="575"/><wx w="774"/><wx w="751"/><wx w="294"/><wx w="294"/><wx w="655"/><wx w="557"/><wx w="862"/><wx w="748"/><wx w="787"/><wx w="603"/><wx w="787"/><wx w="694"/><wx w="634"/><wx w="610"/><wx w="731"/><wx w="684"/><wx w="988"/><wx w="685"/><wx w="610"/><wx w="685"/><wx w="390"/><wx w="336"/><wx w="390"/><wx w="837"/><wx w="500"/><wx w="500"/><wx w="612"/><wx w="634"/><wx w="549"/><wx w="634"/><wx w="615"/><wx w="352"/><wx w="634"/><wx w="633"/><wx w="277"/><wx w="277"/><wx w="579"/><wx w="277"/><wx w="974"/><wx w="633"/><wx w="611"/><wx w="634"/><wx w="634"/><wx w="411"/><wx w="520"/><wx w="392"/><wx w="633"/><wx w="591"/><wx w="817"/><wx w="591"/><wx w="591"/><wx w="524"/><wx w="636"/><wx w="336"/><wx w="636"/><wx w="837"/><wx w="684"/><wx w="684"/><wx w="698"/><wx w="631"/><wx w="748"/><wx w="787"/><wx w="731"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="549"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="633"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="500"/><wx w="500"/><wx w="636"/><wx w="636"/><wx w="500"/><wx w="589"/><wx w="636"/><wx w="629"/><wx w="1000"/><wx w="1000"/><wx w="1000"/><wx w="500"/><wx w="500"/><wx w="837"/><wx w="974"/><wx w="787"/><wx w="833"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="636"/><wx w="636"/><wx w="517"/><wx w="673"/><wx w="756"/><wx w="588"/><wx w="520"/><wx w="471"/><wx w="471"/><wx w="764"/><wx w="981"/><wx w="611"/><wx w="530"/><wx w="400"/><wx w="837"/><wx w="637"/><wx w="636"/><wx w="837"/><wx w="668"/><wx w="611"/><wx w="611"/><wx w="1000"/><wx w="636"/><wx w="684"/><wx w="684"/><wx w="787"/><wx w="1069"/><wx w="1022"/><wx w="500"/><wx w="1000"/><wx w="518"/><wx w="518"/><wx w="317"/><wx w="317"/><wx w="837"/><wx w="494"/><wx w="591"/><wx w="610"/><wx w="166"/><wx w="636"/><wx w="399"/><wx w="399"/><wx w="629"/><wx w="629"/><wx w="500"/><wx w="317"/><wx w="317"/><wx w="518"/><wx w="1341"/><wx w="684"/><wx w="631"/><wx w="684"/><wx w="631"/><wx w="631"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="787"/><wx w="787"/><wx w="787"/><wx w="731"/><wx w="731"/><wx w="731"/><wx w="277"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="562"/><wx w="284"/><wx w="634"/><wx w="520"/><wx w="685"/><wx w="524"/><wx w="336"/><wx w="774"/><wx w="611"/><wx w="610"/><wx w="591"/><wx w="604"/><wx w="634"/><wx w="837"/><wx w="837"/><wx w="400"/><wx w="400"/><wx w="400"/><wx w="969"/><wx w="969"/><wx w="969"/><wx w="774"/><wx w="634"/><wx w="294"/><wx w="634"/><wx w="520"/><wx w="698"/><wx w="549"/><wx w="698"/><wx w="549"/><wx w="634"/><wx w="360"/><wx w="317"/><wx w="636"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="400"/><wx w="500"/><wx w="500"/></cid-widths></multibyte-extras><kerning kpx1="246"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="235"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="43"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-35" kpx2="197"/><pair kern="-30" kpx2="181"/></kerning><kerning kpx1="16"><pair kern="36" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-21" kpx2="199"/><pair kern="18" kpx2="123"/><pair kern="27" kpx2="208"/><pair kern="-118" kpx2="187"/><pair kern="-49" kpx2="59"/><pair kern="18" kpx2="124"/><pair kern="-21" kpx2="201"/><pair kern="-118" kpx2="60"/><pair kern="36" kpx2="52"/><pair kern="18" kpx2="125"/><pair kern="36" kpx2="42"/><pair kern="-118" kpx2="234"/><pair kern="18" kpx2="122"/><pair kern="27" kpx2="210"/><pair kern="-21" kpx2="36"/><pair kern="18" kpx2="82"/><pair kern="-40" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="27" kpx2="175"/><pair kern="27" kpx2="50"/><pair kern="27" kpx2="209"/><pair kern="27" kpx2="103"/><pair kern="-21" kpx2="98"/><pair kern="55" kpx2="45"/><pair kern="-21" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-26" kpx2="89"/><pair kern="18" kpx2="121"/><pair kern="-58" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-21" kpx2="174"/></kerning><kerning kpx1="112"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="123"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="251"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="213"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="208"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="187"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="113"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="144"><pair kern="-40" kpx2="180"/><pair kern="-54" kpx2="197"/><pair kern="-44" kpx2="181"/></kerning><kerning kpx1="59"><pair kern="-72" kpx2="100"/><pair kern="-63" kpx2="210"/><pair kern="-17" kpx2="55"/><pair kern="-44" kpx2="114"/><pair kern="-44" kpx2="72"/><pair kern="-63" kpx2="175"/><pair kern="-49" kpx2="16"/><pair kern="-63" kpx2="50"/><pair kern="-63" kpx2="209"/><pair kern="-44" kpx2="112"/><pair kern="-72" kpx2="251"/><pair kern="-63" kpx2="103"/><pair kern="-63" kpx2="208"/><pair kern="-44" kpx2="113"/><pair kern="-40" kpx2="181"/><pair kern="-77" kpx2="180"/><pair kern="-54" kpx2="169"/><pair kern="-21" kpx2="197"/><pair kern="-72" kpx2="38"/><pair kern="-72" kpx2="253"/><pair kern="-44" kpx2="115"/></kerning><kerning kpx1="73"><pair kern="31" kpx2="180"/><pair kern="-17" kpx2="90"/><pair kern="-72" kpx2="17"/><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="169"/><pair kern="-114" kpx2="197"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="87"/><pair kern="-54" kpx2="16"/><pair kern="-35" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="41"><pair kern="-17" kpx2="227"/><pair kern="-54" kpx2="126"/><pair kern="-91" kpx2="107"/><pair kern="-91" kpx2="235"/><pair kern="-54" kpx2="72"/><pair kern="-91" kpx2="199"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="112"/><pair kern="-54" kpx2="113"/><pair kern="-17" kpx2="54"/><pair kern="-21" kpx2="180"/><pair kern="-91" kpx2="105"/><pair kern="-54" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-91" kpx2="201"/><pair kern="-72" kpx2="85"/><pair kern="-91" kpx2="106"/><pair kern="-77" kpx2="29"/><pair kern="-35" kpx2="125"/><pair kern="-54" kpx2="115"/><pair kern="-54" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-91" kpx2="68"/><pair kern="-91" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-91" kpx2="186"/><pair kern="-17" kpx2="55"/><pair kern="-54" kpx2="114"/><pair kern="-54" kpx2="127"/><pair kern="-91" kpx2="108"/><pair kern="-91" kpx2="98"/><pair kern="-72" kpx2="76"/><pair kern="-160" kpx2="17"/><pair kern="-54" kpx2="128"/><pair kern="-91" kpx2="173"/><pair kern="-91" kpx2="109"/><pair kern="-183" kpx2="197"/><pair kern="-91" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-91" kpx2="110"/><pair kern="-91" kpx2="174"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="124"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="169"><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-17" kpx2="58"/><pair kern="-17" kpx2="186"/><pair kern="-54" kpx2="55"/><pair kern="-17" kpx2="251"/><pair kern="-72" kpx2="187"/><pair kern="-17" kpx2="39"/><pair kern="73" kpx2="144"/><pair kern="-17" kpx2="45"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-72" kpx2="60"/><pair kern="-17" kpx2="89"/><pair kern="-17" kpx2="253"/><pair kern="-54" kpx2="57"/><pair kern="-17" kpx2="37"/><pair kern="-17" kpx2="42"/><pair kern="-72" kpx2="234"/></kerning><kerning kpx1="201"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="60"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="85"><pair kern="-21" kpx2="254"/><pair kern="-21" kpx2="72"/><pair kern="-63" kpx2="16"/><pair kern="-21" kpx2="112"/><pair kern="-21" kpx2="123"/><pair kern="-17" kpx2="80"/><pair kern="-21" kpx2="113"/><pair kern="-17" kpx2="71"/><pair kern="-21" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-21" kpx2="252"/><pair kern="-21" kpx2="70"/><pair kern="-17" kpx2="85"/><pair kern="-17" kpx2="29"/><pair kern="-21" kpx2="125"/><pair kern="-21" kpx2="115"/><pair kern="-21" kpx2="111"/><pair kern="-21" kpx2="122"/><pair kern="-21" kpx2="82"/><pair kern="-17" kpx2="75"/><pair kern="-21" kpx2="114"/><pair kern="-26" kpx2="91"/><pair kern="-17" kpx2="81"/><pair kern="41" kpx2="181"/><pair kern="-91" kpx2="17"/><pair kern="-151" kpx2="197"/><pair kern="-17" kpx2="74"/><pair kern="-17" kpx2="84"/><pair kern="-21" kpx2="121"/><pair kern="-17" kpx2="247"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="61"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="234"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="100"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="122"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="47"><pair kern="-17" kpx2="126"/><pair kern="-91" kpx2="235"/><pair kern="-49" kpx2="104"/><pair kern="-17" kpx2="72"/><pair kern="22" kpx2="199"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-49" kpx2="213"/><pair kern="-35" kpx2="208"/><pair kern="-132" kpx2="187"/><pair kern="-17" kpx2="113"/><pair kern="-202" kpx2="180"/><pair kern="-17" kpx2="129"/><pair kern="-17" kpx2="124"/><pair kern="22" kpx2="201"/><pair kern="-132" kpx2="60"/><pair kern="-49" kpx2="211"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="115"/><pair kern="-132" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-17" kpx2="122"/><pair kern="-35" kpx2="210"/><pair kern="22" kpx2="36"/><pair kern="-17" kpx2="82"/><pair kern="-91" kpx2="58"/><pair kern="-91" kpx2="186"/><pair kern="-137" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-35" kpx2="175"/><pair kern="-17" kpx2="127"/><pair kern="-35" kpx2="50"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="22" kpx2="98"/><pair kern="-262" kpx2="181"/><pair kern="-17" kpx2="128"/><pair kern="22" kpx2="173"/><pair kern="-49" kpx2="212"/><pair kern="-91" kpx2="92"/><pair kern="-17" kpx2="121"/><pair kern="-109" kpx2="57"/><pair kern="22" kpx2="174"/><pair kern="-49" kpx2="56"/></kerning><kerning kpx1="210"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="58"><pair kern="-35" kpx2="126"/><pair kern="-63" kpx2="107"/><pair kern="-17" kpx2="235"/><pair kern="-58" kpx2="72"/><pair kern="-54" kpx2="199"/><pair kern="-40" kpx2="16"/><pair kern="-58" kpx2="112"/><pair kern="-58" kpx2="123"/><pair kern="-58" kpx2="113"/><pair kern="-17" kpx2="180"/><pair kern="-63" kpx2="105"/><pair kern="-35" kpx2="129"/><pair kern="-58" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-54" kpx2="201"/><pair kern="-44" kpx2="85"/><pair kern="-63" kpx2="106"/><pair kern="-58" kpx2="29"/><pair kern="-58" kpx2="125"/><pair kern="-17" kpx2="170"/><pair kern="-58" kpx2="115"/><pair kern="-35" kpx2="88"/><pair kern="-58" kpx2="122"/><pair kern="-63" kpx2="68"/><pair kern="-54" kpx2="36"/><pair kern="-58" kpx2="82"/><pair kern="-17" kpx2="186"/><pair kern="-58" kpx2="114"/><pair kern="-35" kpx2="127"/><pair kern="-63" kpx2="108"/><pair kern="-54" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-114" kpx2="17"/><pair kern="-35" kpx2="128"/><pair kern="-54" kpx2="173"/><pair kern="-63" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-17" kpx2="92"/><pair kern="-58" kpx2="121"/><pair kern="-63" kpx2="110"/><pair kern="-54" kpx2="174"/></kerning><kerning kpx1="82"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="186"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="175"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="209"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="103"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="81"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="98"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="212"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="229"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="38"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="121"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="57"><pair kern="-67" kpx2="126"/><pair kern="-77" kpx2="107"/><pair kern="-26" kpx2="235"/><pair kern="-77" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-58" kpx2="16"/><pair kern="-77" kpx2="123"/><pair kern="-77" kpx2="112"/><pair kern="-17" kpx2="208"/><pair kern="-77" kpx2="113"/><pair kern="-77" kpx2="105"/><pair kern="-67" kpx2="129"/><pair kern="-77" kpx2="124"/><pair kern="-86" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-77" kpx2="106"/><pair kern="-81" kpx2="29"/><pair kern="-77" kpx2="125"/><pair kern="-54" kpx2="170"/><pair kern="-77" kpx2="115"/><pair kern="-67" kpx2="88"/><pair kern="-77" kpx2="122"/><pair kern="-77" kpx2="68"/><pair kern="-17" kpx2="210"/><pair kern="-63" kpx2="36"/><pair kern="-77" kpx2="82"/><pair kern="-26" kpx2="186"/><pair kern="-77" kpx2="114"/><pair kern="-17" kpx2="175"/><pair kern="-67" kpx2="127"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-77" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-128" kpx2="17"/><pair kern="-67" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-77" kpx2="109"/><pair kern="-137" kpx2="197"/><pair kern="-26" kpx2="92"/><pair kern="-77" kpx2="121"/><pair kern="-77" kpx2="110"/><pair kern="-63" kpx2="174"/></kerning><kerning kpx1="37"><pair kern="-17" kpx2="227"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="251"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-17" kpx2="54"/><pair kern="-54" kpx2="180"/><pair kern="-30" kpx2="169"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-54" kpx2="181"/><pair kern="-40" kpx2="197"/><pair kern="-17" kpx2="38"/><pair kern="-30" kpx2="57"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="120"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="249"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="227"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="51"><pair kern="-17" kpx2="126"/><pair kern="-44" kpx2="107"/><pair kern="-35" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-21" kpx2="16"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="112"/><pair kern="-21" kpx2="187"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="86"/><pair kern="18" kpx2="180"/><pair kern="-44" kpx2="105"/><pair kern="-17" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-17" kpx2="85"/><pair kern="-21" kpx2="60"/><pair kern="-44" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-21" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-44" kpx2="68"/><pair kern="-63" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-17" kpx2="250"/><pair kern="-17" kpx2="127"/><pair kern="-44" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-17" kpx2="81"/><pair kern="-21" kpx2="76"/><pair kern="18" kpx2="181"/><pair kern="-155" kpx2="17"/><pair kern="-17" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-44" kpx2="109"/><pair kern="-160" kpx2="197"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="228"/><pair kern="-44" kpx2="110"/><pair kern="-63" kpx2="174"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="104"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="72"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="199"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="54"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="180"><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="246"/><pair kern="-30" kpx2="43"/><pair kern="-72" kpx2="123"/><pair kern="-35" kpx2="251"/><pair kern="-35" kpx2="208"/><pair kern="-188" kpx2="144"/><pair kern="-58" kpx2="59"/><pair kern="-35" kpx2="73"/><pair kern="-30" kpx2="41"/><pair kern="-72" kpx2="124"/><pair kern="-54" kpx2="85"/><pair kern="-128" kpx2="201"/><pair kern="-17" kpx2="61"/><pair kern="-35" kpx2="100"/><pair kern="-72" kpx2="122"/><pair kern="-30" kpx2="47"/><pair kern="-35" kpx2="210"/><pair kern="-72" kpx2="82"/><pair kern="-35" kpx2="186"/><pair kern="-35" kpx2="175"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="-128" kpx2="98"/><pair kern="-54" kpx2="81"/><pair kern="-17" kpx2="229"/><pair kern="-35" kpx2="38"/><pair kern="-72" kpx2="121"/><pair kern="-30" kpx2="37"/><pair kern="-54" kpx2="120"/><pair kern="-30" kpx2="51"/><pair kern="-128" kpx2="199"/><pair kern="-30" kpx2="53"/><pair kern="-30" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-35" kpx2="253"/><pair kern="-35" kpx2="52"/><pair kern="-72" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-35" kpx2="90"/><pair kern="-128" kpx2="36"/><pair kern="-35" kpx2="50"/><pair kern="-30" kpx2="39"/><pair kern="-30" kpx2="236"/><pair kern="-30" kpx2="45"/><pair kern="-128" kpx2="173"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="89"/><pair kern="-30" kpx2="46"/><pair kern="-128" kpx2="174"/></kerning><kerning kpx1="53"><pair kern="-21" kpx2="107"/><pair kern="-54" kpx2="235"/><pair kern="-40" kpx2="16"/><pair kern="-44" kpx2="112"/><pair kern="-44" kpx2="123"/><pair kern="-49" kpx2="251"/><pair kern="-44" kpx2="113"/><pair kern="-63" kpx2="187"/><pair kern="-44" kpx2="129"/><pair kern="-44" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-63" kpx2="60"/><pair kern="-40" kpx2="201"/><pair kern="-21" kpx2="106"/><pair kern="-30" kpx2="29"/><pair kern="-63" kpx2="234"/><pair kern="-49" kpx2="100"/><pair kern="-44" kpx2="122"/><pair kern="-21" kpx2="68"/><pair kern="-40" kpx2="58"/><pair kern="-44" kpx2="82"/><pair kern="-54" kpx2="186"/><pair kern="-40" kpx2="98"/><pair kern="-63" kpx2="181"/><pair kern="-35" kpx2="17"/><pair kern="-49" kpx2="38"/><pair kern="-44" kpx2="121"/><pair kern="-54" kpx2="57"/><pair kern="-44" kpx2="126"/><pair kern="-44" kpx2="72"/><pair kern="-40" kpx2="199"/><pair kern="-72" kpx2="180"/><pair kern="-21" kpx2="105"/><pair kern="-49" kpx2="253"/><pair kern="-44" kpx2="125"/><pair kern="-44" kpx2="115"/><pair kern="-17" kpx2="170"/><pair kern="-44" kpx2="88"/><pair kern="-40" kpx2="36"/><pair kern="-44" kpx2="114"/><pair kern="-72" kpx2="55"/><pair kern="-44" kpx2="127"/><pair kern="-21" kpx2="108"/><pair kern="-44" kpx2="128"/><pair kern="-40" kpx2="173"/><pair kern="-21" kpx2="109"/><pair kern="-54" kpx2="92"/><pair kern="-17" kpx2="197"/><pair kern="-21" kpx2="110"/><pair kern="-40" kpx2="174"/></kerning><kerning kpx1="137"><pair kern="-54" kpx2="180"/><pair kern="-40" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="233"><pair kern="-44" kpx2="180"/><pair kern="-35" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="253"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="211"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="78"><pair kern="-17" kpx2="107"/><pair kern="-30" kpx2="126"/><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="72"/><pair kern="-35" kpx2="112"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="105"/><pair kern="-30" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-30" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-35" kpx2="186"/><pair kern="-30" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-30" kpx2="128"/><pair kern="-17" kpx2="109"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="110"/></kerning><kerning kpx1="52"><pair kern="-21" kpx2="180"/><pair kern="-63" kpx2="197"/><pair kern="27" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="125"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="42"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="170"><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="199"/><pair kern="-17" kpx2="251"/><pair kern="-109" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-54" kpx2="59"/><pair kern="-109" kpx2="60"/><pair kern="-35" kpx2="201"/><pair kern="-17" kpx2="253"/><pair kern="-109" kpx2="234"/><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="36"/><pair kern="-54" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-17" kpx2="39"/><pair kern="-35" kpx2="98"/><pair kern="-17" kpx2="45"/><pair kern="-35" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="89"/><pair kern="-86" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="174"/></kerning><kerning kpx1="115"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="90"><pair kern="-91" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-104" kpx2="197"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="36"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="55"><pair kern="-165" kpx2="107"/><pair kern="-155" kpx2="235"/><pair kern="-91" kpx2="16"/><pair kern="-169" kpx2="112"/><pair kern="-169" kpx2="123"/><pair kern="-58" kpx2="251"/><pair kern="-169" kpx2="113"/><pair kern="-165" kpx2="86"/><pair kern="-151" kpx2="129"/><pair kern="-169" kpx2="124"/><pair kern="-91" kpx2="169"/><pair kern="-169" kpx2="252"/><pair kern="-169" kpx2="70"/><pair kern="-146" kpx2="85"/><pair kern="-77" kpx2="201"/><pair kern="-165" kpx2="106"/><pair kern="-109" kpx2="29"/><pair kern="-58" kpx2="100"/><pair kern="-169" kpx2="122"/><pair kern="-165" kpx2="68"/><pair kern="-169" kpx2="82"/><pair kern="-155" kpx2="186"/><pair kern="-165" kpx2="250"/><pair kern="-77" kpx2="98"/><pair kern="-21" kpx2="181"/><pair kern="-118" kpx2="17"/><pair kern="-58" kpx2="38"/><pair kern="-169" kpx2="121"/><pair kern="-165" kpx2="228"/><pair kern="-169" kpx2="254"/><pair kern="-151" kpx2="126"/><pair kern="-169" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-165" kpx2="105"/><pair kern="-58" kpx2="253"/><pair kern="-169" kpx2="125"/><pair kern="-169" kpx2="115"/><pair kern="-54" kpx2="170"/><pair kern="-151" kpx2="88"/><pair kern="-169" kpx2="111"/><pair kern="-165" kpx2="90"/><pair kern="-77" kpx2="36"/><pair kern="-17" kpx2="55"/><pair kern="-169" kpx2="114"/><pair kern="-151" kpx2="127"/><pair kern="-165" kpx2="108"/><pair kern="-30" kpx2="76"/><pair kern="-151" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-165" kpx2="109"/><pair kern="-155" kpx2="92"/><pair kern="-128" kpx2="197"/><pair kern="-165" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="114"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="50"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="91"><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="111"/><pair kern="-30" kpx2="122"/><pair kern="-30" kpx2="82"/><pair kern="-30" kpx2="114"/><pair kern="-30" kpx2="72"/><pair kern="-30" kpx2="112"/><pair kern="-30" kpx2="123"/><pair kern="-30" kpx2="113"/><pair kern="-30" kpx2="124"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-30" kpx2="121"/><pair kern="-30" kpx2="125"/><pair kern="-30" kpx2="115"/></kerning><kerning kpx1="39"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="-17" kpx2="98"/><pair kern="-54" kpx2="187"/><pair kern="-26" kpx2="181"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="236"><pair kern="-17" kpx2="180"/><pair kern="-72" kpx2="17"/><pair kern="-91" kpx2="197"/><pair kern="-35" kpx2="29"/></kerning><kerning kpx1="45"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="169"/><pair kern="-54" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="199"/><pair kern="-35" kpx2="16"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="173"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="197"><pair kern="-35" kpx2="246"/><pair kern="-54" kpx2="235"/><pair kern="-35" kpx2="43"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-183" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="18" kpx2="144"/><pair kern="-35" kpx2="59"/><pair kern="-17" kpx2="73"/><pair kern="-35" kpx2="41"/><pair kern="-35" kpx2="124"/><pair kern="-35" kpx2="85"/><pair kern="-183" kpx2="60"/><pair kern="18" kpx2="201"/><pair kern="-183" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-35" kpx2="122"/><pair kern="-35" kpx2="47"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="82"/><pair kern="-123" kpx2="58"/><pair kern="-54" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-35" kpx2="81"/><pair kern="18" kpx2="98"/><pair kern="-54" kpx2="38"/><pair kern="-35" kpx2="121"/><pair kern="-183" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="120"/><pair kern="-35" kpx2="51"/><pair kern="18" kpx2="199"/><pair kern="-35" kpx2="53"/><pair kern="-35" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-54" kpx2="253"/><pair kern="-54" kpx2="52"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-95" kpx2="90"/><pair kern="18" kpx2="36"/><pair kern="-137" kpx2="55"/><pair kern="-54" kpx2="50"/><pair kern="-35" kpx2="39"/><pair kern="-35" kpx2="236"/><pair kern="22" kpx2="45"/><pair kern="18" kpx2="173"/><pair kern="-54" kpx2="92"/><pair kern="-114" kpx2="89"/><pair kern="-35" kpx2="46"/><pair kern="18" kpx2="174"/></kerning><kerning kpx1="92"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="89"><pair kern="-77" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-132" kpx2="197"/><pair kern="-26" kpx2="16"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="46"><pair kern="-17" kpx2="107"/><pair kern="-72" kpx2="235"/><pair kern="-104" kpx2="16"/><pair kern="-49" kpx2="112"/><pair kern="-49" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-26" kpx2="213"/><pair kern="-49" kpx2="113"/><pair kern="-35" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="-49" kpx2="129"/><pair kern="-49" kpx2="124"/><pair kern="-63" kpx2="169"/><pair kern="-35" kpx2="60"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-49" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-49" kpx2="82"/><pair kern="-72" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-26" kpx2="212"/><pair kern="-54" kpx2="38"/><pair kern="-49" kpx2="121"/><pair kern="-49" kpx2="126"/><pair kern="-26" kpx2="104"/><pair kern="-49" kpx2="72"/><pair kern="-17" kpx2="199"/><pair kern="-30" kpx2="180"/><pair kern="-17" kpx2="105"/><pair kern="-54" kpx2="253"/><pair kern="-26" kpx2="211"/><pair kern="-49" kpx2="125"/><pair kern="-49" kpx2="115"/><pair kern="-49" kpx2="88"/><pair kern="-17" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-49" kpx2="114"/><pair kern="-54" kpx2="50"/><pair kern="-49" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-49" kpx2="128"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="109"/><pair kern="-72" kpx2="92"/><pair kern="-17" kpx2="110"/><pair kern="-17" kpx2="174"/><pair kern="-26" kpx2="56"/></kerning><kerning kpx1="174"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="56"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning></font-metrics> \ No newline at end of file
diff --git a/poky/bitbake/doc/template/VeraMoBd.ttf b/poky/bitbake/doc/template/VeraMoBd.ttf
new file mode 100644
index 000000000..9be6547ed
--- /dev/null
+++ b/poky/bitbake/doc/template/VeraMoBd.ttf
Binary files differ
diff --git a/poky/bitbake/doc/template/VeraMoBd.xml b/poky/bitbake/doc/template/VeraMoBd.xml
new file mode 100644
index 000000000..9b33107a4
--- /dev/null
+++ b/poky/bitbake/doc/template/VeraMoBd.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Bold</font-name><full-name>Bitstream Vera Sans Mono Bold</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-19</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file
diff --git a/poky/bitbake/doc/template/VeraMono.ttf b/poky/bitbake/doc/template/VeraMono.ttf
new file mode 100644
index 000000000..139f0b431
--- /dev/null
+++ b/poky/bitbake/doc/template/VeraMono.ttf
Binary files differ
diff --git a/poky/bitbake/doc/template/VeraMono.xml b/poky/bitbake/doc/template/VeraMono.xml
new file mode 100644
index 000000000..3a0a86659
--- /dev/null
+++ b/poky/bitbake/doc/template/VeraMono.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Roman</font-name><full-name>Bitstream Vera Sans Mono</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-4</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file
diff --git a/poky/bitbake/doc/template/component.title.xsl b/poky/bitbake/doc/template/component.title.xsl
new file mode 100644
index 000000000..faef04326
--- /dev/null
+++ b/poky/bitbake/doc/template/component.title.xsl
@@ -0,0 +1,39 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="component.title">
+ <xsl:param name="node" select="."/>
+
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="ancestor::d:section">
+ <xsl:value-of select="count(ancestor::d:section)+1"/>
+ </xsl:when>
+ <xsl:when test="ancestor::d:sect5">6</xsl:when>
+ <xsl:when test="ancestor::d:sect4">5</xsl:when>
+ <xsl:when test="ancestor::d:sect3">4</xsl:when>
+ <xsl:when test="ancestor::d:sect2">3</xsl:when>
+ <xsl:when test="ancestor::d:sect1">2</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="class">title</xsl:attribute>
+ <xsl:if test="$generate.id.attributes = 0">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:apply-templates select="$node" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/template/db-pdf.xsl b/poky/bitbake/doc/template/db-pdf.xsl
new file mode 100644
index 000000000..3dd065a57
--- /dev/null
+++ b/poky/bitbake/doc/template/db-pdf.xsl
@@ -0,0 +1,64 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" />
+
+ <!-- check project-plan.sh for how this is generated, needed to tweak
+ the cover page
+ -->
+ <xsl:include href="/tmp/titlepage.xsl"/>
+
+ <!-- To force a page break in document, i.e per section add a
+ <?hard-pagebreak?> tag.
+ -->
+ <xsl:template match="processing-instruction('hard-pagebreak')">
+ <fo:block break-before='page' />
+ </xsl:template>
+
+ <!--Fix for defualt indent getting TOC all wierd..
+ See http://sources.redhat.com/ml/docbook-apps/2005-q1/msg00455.html
+ FIXME: must be a better fix
+ -->
+ <xsl:param name="body.start.indent" select="'0'"/>
+ <!--<xsl:param name="title.margin.left" select="'0'"/>-->
+
+ <!-- stop long-ish header titles getting wrapped -->
+ <xsl:param name="header.column.widths">1 10 1</xsl:param>
+
+ <!-- customise headers and footers a little -->
+
+ <xsl:template name="head.sep.rule">
+ <xsl:if test="$header.rule != 0">
+ <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
+ <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+ <xsl:attribute name="border-bottom-color">#cccccc</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="foot.sep.rule">
+ <xsl:if test="$footer.rule != 0">
+ <xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
+ <xsl:attribute name="border-top-style">solid</xsl:attribute>
+ <xsl:attribute name="border-top-color">#cccccc</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:attribute-set name="header.content.properties">
+ <xsl:attribute name="color">#cccccc</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="footer.content.properties">
+ <xsl:attribute name="color">#cccccc</xsl:attribute>
+ </xsl:attribute-set>
+
+
+ <!-- general settings -->
+
+ <xsl:param name="fop1.extensions" select="1"></xsl:param>
+ <xsl:param name="paper.type" select="'A4'"></xsl:param>
+ <xsl:param name="section.autolabel" select="1"></xsl:param>
+ <xsl:param name="body.font.family" select="'verasans'"></xsl:param>
+ <xsl:param name="title.font.family" select="'verasans'"></xsl:param>
+ <xsl:param name="monospace.font.family" select="'veramono'"></xsl:param>
+
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/template/division.title.xsl b/poky/bitbake/doc/template/division.title.xsl
new file mode 100644
index 000000000..9c843bc7c
--- /dev/null
+++ b/poky/bitbake/doc/template/division.title.xsl
@@ -0,0 +1,25 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="division.title">
+ <xsl:param name="node" select="."/>
+
+ <h1>
+ <xsl:attribute name="class">title</xsl:attribute>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="$node" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </h1>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/poky/bitbake/doc/template/draft.png b/poky/bitbake/doc/template/draft.png
new file mode 100644
index 000000000..53051a9dd
--- /dev/null
+++ b/poky/bitbake/doc/template/draft.png
Binary files differ
diff --git a/poky/bitbake/doc/template/fop-config.xml b/poky/bitbake/doc/template/fop-config.xml
new file mode 100644
index 000000000..09cc5ca0f
--- /dev/null
+++ b/poky/bitbake/doc/template/fop-config.xml
@@ -0,0 +1,58 @@
+<fop version="1.0">
+
+ <!-- Strict user configuration -->
+ <strict-configuration>true</strict-configuration>
+
+ <!-- Strict FO validation -->
+ <strict-validation>true</strict-validation>
+
+ <!--
+ Set the baseDir so common/openedhand.svg references in plans still
+ work ok. Note, relative file references to current dir should still work.
+ -->
+ <base>../template</base>
+ <font-base>../template</font-base>
+
+ <!-- Source resolution in dpi (dots/pixels per inch) for determining the
+ size of pixels in SVG and bitmap images, default: 72dpi -->
+ <!-- <source-resolution>72</source-resolution> -->
+ <!-- Target resolution in dpi (dots/pixels per inch) for specifying the
+ target resolution for generated bitmaps, default: 72dpi -->
+ <!-- <target-resolution>72</target-resolution> -->
+
+ <!-- default page-height and page-width, in case
+ value is specified as auto -->
+ <default-page-settings height="11in" width="8.26in"/>
+
+ <!-- <use-cache>false</use-cache> -->
+
+ <renderers>
+ <renderer mime="application/pdf">
+ <fonts>
+ <font metrics-file="VeraMono.xml"
+ kerning="yes"
+ embed-url="VeraMono.ttf">
+ <font-triplet name="veramono" style="normal" weight="normal"/>
+ </font>
+
+ <font metrics-file="VeraMoBd.xml"
+ kerning="yes"
+ embed-url="VeraMoBd.ttf">
+ <font-triplet name="veramono" style="normal" weight="bold"/>
+ </font>
+
+ <font metrics-file="Vera.xml"
+ kerning="yes"
+ embed-url="Vera.ttf">
+ <font-triplet name="verasans" style="normal" weight="normal"/>
+ <font-triplet name="verasans" style="normal" weight="bold"/>
+ <font-triplet name="verasans" style="italic" weight="normal"/>
+ <font-triplet name="verasans" style="italic" weight="bold"/>
+ </font>
+
+ <auto-detect/>
+ </fonts>
+ </renderer>
+ </renderers>
+</fop>
+
diff --git a/poky/bitbake/doc/template/formal.object.heading.xsl b/poky/bitbake/doc/template/formal.object.heading.xsl
new file mode 100644
index 000000000..4f3900d16
--- /dev/null
+++ b/poky/bitbake/doc/template/formal.object.heading.xsl
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="formal.object.heading">
+ <xsl:param name="object" select="."/>
+ <xsl:param name="title">
+ <xsl:apply-templates select="$object" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ </xsl:param>
+ <p class="title">
+ <b><xsl:copy-of select="$title"/></b>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$object"/>
+ </xsl:call-template>
+ </p>
+ </xsl:template>
+</xsl:stylesheet> \ No newline at end of file
diff --git a/poky/bitbake/doc/template/gloss-permalinks.xsl b/poky/bitbake/doc/template/gloss-permalinks.xsl
new file mode 100644
index 000000000..6bf58116f
--- /dev/null
+++ b/poky/bitbake/doc/template/gloss-permalinks.xsl
@@ -0,0 +1,14 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:template match="glossentry/glossterm">
+ <xsl:apply-imports/>
+ <xsl:if test="$generate.permalink != 0">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/template/permalinks.xsl b/poky/bitbake/doc/template/permalinks.xsl
new file mode 100644
index 000000000..d2a1c1452
--- /dev/null
+++ b/poky/bitbake/doc/template/permalinks.xsl
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="generate.permalink" select="1"/>
+ <xsl:param name="permalink.text">¶</xsl:param>
+
+ <xsl:template name="permalink">
+ <xsl:param name="node"/>
+
+ <xsl:if test="$generate.permalink != '0'">
+ <span class="permalink">
+ <a alt="Permalink" title="Permalink">
+ <xsl:attribute name="href">
+ <xsl:call-template name="href.target">
+ <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:copy-of select="$permalink.text"/>
+ </a>
+ </span>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/template/section.title.xsl b/poky/bitbake/doc/template/section.title.xsl
new file mode 100644
index 000000000..5c6ff9a96
--- /dev/null
+++ b/poky/bitbake/doc/template/section.title.xsl
@@ -0,0 +1,55 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d">
+
+ <xsl:template name="section.title">
+ <xsl:variable name="section"
+ select="(ancestor::section |
+ ancestor::simplesect|
+ ancestor::sect1|
+ ancestor::sect2|
+ ancestor::sect3|
+ ancestor::sect4|
+ ancestor::sect5)[last()]"/>
+
+ <xsl:variable name="renderas">
+ <xsl:choose>
+ <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
+ <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="$renderas != ''">
+ <xsl:value-of select="$renderas"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="section.level">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="section.heading">
+ <xsl:with-param name="section" select="$section"/>
+ <xsl:with-param name="level" select="$level"/>
+ <xsl:with-param name="title">
+ <xsl:apply-templates select="$section" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:if test="$level &gt; 0">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/bitbake/doc/template/titlepage.templates.xml b/poky/bitbake/doc/template/titlepage.templates.xml
new file mode 100644
index 000000000..38ec11a4c
--- /dev/null
+++ b/poky/bitbake/doc/template/titlepage.templates.xml
@@ -0,0 +1,1259 @@
+<!DOCTYPE t:templates [
+<!ENTITY hsize0 "10pt">
+<!ENTITY hsize1 "12pt">
+<!ENTITY hsize2 "14.4pt">
+<!ENTITY hsize3 "17.28pt">
+<!ENTITY hsize4 "20.736pt">
+<!ENTITY hsize5 "24.8832pt">
+<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
+<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
+<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
+<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
+<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
+<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
+]>
+<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
+ xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- ********************************************************************
+ $Id: titlepage.templates.xml,v 1.23 2003/12/16 00:30:49 bobstayton Exp $
+ ********************************************************************
+
+ This file is part of the DocBook XSL Stylesheet distribution.
+ See ../README or http://docbook.sf.net/ for copyright
+ and other information.
+
+ ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="article" t:wrapper="fo:block"
+ font-family="{$title.fontset}">
+
+ <t:titlepage-content t:side="recto"
+ text-align="center">
+
+ <mediaobject/>
+
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::article[1]"
+ keep-with-next="always"
+ font-size="&hsize5;"
+ font-weight="bold"/>
+
+ <subtitle param:node="ancestor-or-self::article[1]"
+ keep-with-next="always"
+ font-size="&hsize3;"
+ font-weight="bold"
+ space-after="0.8em"/>
+
+ <corpauthor space-before="0.5em"
+ font-size="&hsize3;"/>
+ <authorgroup space-before="0.5em"
+ font-size="&hsize2;"/>
+ <author space-before="0.5em"
+ font-size="&hsize2;"
+ space-after="0.8em"/>
+
+ <email font-size="&hsize2;"/>
+
+ <othercredit space-before="0.5em"/>
+ <releaseinfo space-before="0.5em"/>
+ <copyright space-before="0.5em"/>
+ <legalnotice text-align="start"
+ margin-left="0.5in"
+ margin-right="0.5in"
+ font-family="{$body.fontset}"/>
+ <pubdate space-before="0.5em"/>
+ <para></para>
+ <revision space-before="0.5em"/>
+ <revhistory space-before="0.5em"/>
+ <abstract space-before="0.5em"
+ text-align="start"
+ margin-left="0.5in"
+ margin-right="0.5in"
+ font-family="{$body.fontset}"/>
+
+ <para></para>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="set" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::set[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"
+ text-align="center"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="book" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+
+ <mediaobject/>
+
+<!--
+
+# If you leave this block of code in then the text title in the
+# <title>BitBake User Manual</title> statement of the
+# bitbake-user-manual.xml file is rendered on the title page below the
+# image. Commenting it out gets it out of there yet allows it
+# to be retained in the tab text for the HTML version of the
+# manual.
+
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::book[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+-->
+ <subtitle
+ text-align="center"
+ font-size="&hsize4;"
+ space-before="&hsize4space;"
+ font-family="{$title.fontset}"/>
+ <corpauthor font-size="&hsize3;"
+ keep-with-next="always"
+ space-before="2in"/>
+ <authorgroup space-before="2in"/>
+ <author font-size="&hsize3;"
+ space-before="&hsize2space;"
+ keep-with-next="always"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+<!--
+# If you leave this block of code in then the text title in the
+# <title>BitBake User Manual</title> statement of the
+# bitbake-user-manual.xml file is rendered on the title page below the
+# image. Commenting it out gets it out of there yet allows it
+# to be retained in the tab text for the HTML version of the
+# manual.
+
+ <title
+ t:named-template="book.verso.title"
+ font-size="&hsize2;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+-->
+ <corpauthor/>
+ <authorgroup t:named-template="verso.authorgroup"/>
+ <author/>
+ <othercredit/>
+ <pubdate space-before="1em"/>
+ <copyright/>
+ <abstract/>
+ <legalnotice font-size="8pt"/>
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ <fo:block break-after="page"/>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ <fo:block break-after="page"/>
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="part" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::part[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ text-align="center"
+ font-size="&hsize4;"
+ space-before="&hsize4space;"
+ font-weight='bold'
+ font-style='italic'
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="partintro" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ text-align="center"
+ font-size="&hsize5;"
+ font-weight="bold"
+ space-before="1em"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ text-align="center"
+ font-size="&hsize2;"
+ font-weight="bold"
+ font-style="italic"
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="reference" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::reference[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"
+ text-align="center"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsynopsisdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsection" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect1" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect2" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect3" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="dedication" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::dedication[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="preface" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::preface[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="chapter" t:wrapper="fo:block"
+ font-family="{$title.fontset}">
+ <t:titlepage-content t:side="recto" margin-left="{$title.margin.left}">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::chapter[1]"
+ font-size="&hsize5;"
+ font-weight="bold"/>
+
+ <subtitle space-before="0.5em"
+ font-style="italic"
+ font-size="&hsize2;"
+ font-weight="bold"/>
+
+ <corpauthor space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <authorgroup space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <author space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="appendix" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="component.title"
+ param:node="ancestor-or-self::appendix[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="section" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect1" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect2" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect3" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect4" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect5" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="simplesect" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="bibliography" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::bibliography[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="bibliodiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::bibliodiv[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize4;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="glossary" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::glossary[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="glossdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::glossdiv[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize4;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="index" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::index[1]"
+ param:pagewide="1"
+ margin-left="0pt"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <!-- The indexdiv.title template is used so that manual and -->
+ <!-- automatically generated indexdiv titles get the same -->
+ <!-- formatting. -->
+
+ <t:titlepage t:element="indexdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:force="1"
+ t:named-template="indexdiv.title"
+ param:title="title"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="setindex" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::setindex[1]"
+ param:pagewide="1"
+ margin-left="0pt"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="colophon" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::colophon[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="table.of.contents" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'TableofContents'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.tables" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofTables'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.figures" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofFigures'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.examples" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofExamples'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.equations" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofEquations'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.procedures" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofProcedures'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.unknowns" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofUnknown'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+</t:templates>
diff --git a/poky/bitbake/doc/tools/docbook-to-pdf b/poky/bitbake/doc/tools/docbook-to-pdf
new file mode 100755
index 000000000..558ded9e0
--- /dev/null
+++ b/poky/bitbake/doc/tools/docbook-to-pdf
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+if [ -z "$1" -o -z "$2" ]; then
+ echo "usage: [-v] $0 <docbook file> <templatedir>"
+ echo
+ echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets"
+ echo " installed for this to work!"
+ echo
+ exit 0
+fi
+
+FO=`echo $1 | sed s/.xml/.fo/` || exit 1
+PDF=`echo $1 | sed s/.xml/.pdf/` || exit 1
+TEMPLATEDIR=$2
+
+##
+# These URI should be rewritten by your distribution's xml catalog to
+# match your localy installed XSL stylesheets.
+XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current"
+
+# Creates a temporary XSL stylesheet based on titlepage.xsl
+xsltproc -o /tmp/titlepage.xsl \
+ --xinclude \
+ $XSL_BASE_URI/template/titlepage.xsl \
+ $TEMPLATEDIR/titlepage.templates.xml || exit 1
+
+# Creates the file needed for FOP
+xsltproc --xinclude \
+ --stringparam hyphenate false \
+ --stringparam formal.title.placement "figure after" \
+ --stringparam ulink.show 1 \
+ --stringparam body.font.master 9 \
+ --stringparam title.font.master 11 \
+ --stringparam draft.watermark.image "$TEMPLATEDIR/draft.png" \
+ --stringparam chapter.autolabel 1 \
+ --stringparam appendix.autolabel A \
+ --stringparam section.autolabel 1 \
+ --stringparam section.label.includes.component.label 1 \
+ --output $FO \
+ $TEMPLATEDIR/db-pdf.xsl \
+ $1 || exit 1
+
+# Invokes the Java version of FOP. Uses the additional configuration file common/fop-config.xml
+fop -c $TEMPLATEDIR/fop-config.xml -fo $FO -pdf $PDF || exit 1
+
+rm -f $FO
+rm -f /tmp/titlepage.xsl
+
+echo
+echo " #### Success! $PDF ready. ####"
+echo
diff --git a/poky/bitbake/lib/bb/COW.py b/poky/bitbake/lib/bb/COW.py
new file mode 100644
index 000000000..bec620809
--- /dev/null
+++ b/poky/bitbake/lib/bb/COW.py
@@ -0,0 +1,319 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# This is a copy on write dictionary and set which abuses classes to try and be nice and fast.
+#
+# Copyright (C) 2006 Tim Ansell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+#Please Note:
+# Be careful when using mutable types (ie Dict and Lists) - operations involving these are SLOW.
+# Assign a file to __warn__ to get warnings about slow operations.
+#
+
+
+import copy
+import types
+ImmutableTypes = (
+ bool,
+ complex,
+ float,
+ int,
+ tuple,
+ frozenset,
+ str
+)
+
+MUTABLE = "__mutable__"
+
+class COWMeta(type):
+ pass
+
+class COWDictMeta(COWMeta):
+ __warn__ = False
+ __hasmutable__ = False
+ __marker__ = tuple()
+
+ def __str__(cls):
+ # FIXME: I have magic numbers!
+ return "<COWDict Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) - 3)
+ __repr__ = __str__
+
+ def cow(cls):
+ class C(cls):
+ __count__ = cls.__count__ + 1
+ return C
+ copy = cow
+ __call__ = cow
+
+ def __setitem__(cls, key, value):
+ if value is not None and not isinstance(value, ImmutableTypes):
+ if not isinstance(value, COWMeta):
+ cls.__hasmutable__ = True
+ key += MUTABLE
+ setattr(cls, key, value)
+
+ def __getmutable__(cls, key, readonly=False):
+ nkey = key + MUTABLE
+ try:
+ return cls.__dict__[nkey]
+ except KeyError:
+ pass
+
+ value = getattr(cls, nkey)
+ if readonly:
+ return value
+
+ if not cls.__warn__ is False and not isinstance(value, COWMeta):
+ print("Warning: Doing a copy because %s is a mutable type." % key, file=cls.__warn__)
+ try:
+ value = value.copy()
+ except AttributeError as e:
+ value = copy.copy(value)
+ setattr(cls, nkey, value)
+ return value
+
+ __getmarker__ = []
+ def __getreadonly__(cls, key, default=__getmarker__):
+ """\
+ Get a value (even if mutable) which you promise not to change.
+ """
+ return cls.__getitem__(key, default, True)
+
+ def __getitem__(cls, key, default=__getmarker__, readonly=False):
+ try:
+ try:
+ value = getattr(cls, key)
+ except AttributeError:
+ value = cls.__getmutable__(key, readonly)
+
+ # This is for values which have been deleted
+ if value is cls.__marker__:
+ raise AttributeError("key %s does not exist." % key)
+
+ return value
+ except AttributeError as e:
+ if not default is cls.__getmarker__:
+ return default
+
+ raise KeyError(str(e))
+
+ def __delitem__(cls, key):
+ cls.__setitem__(key, cls.__marker__)
+
+ def __revertitem__(cls, key):
+ if key not in cls.__dict__:
+ key += MUTABLE
+ delattr(cls, key)
+
+ def __contains__(cls, key):
+ return cls.has_key(key)
+
+ def has_key(cls, key):
+ value = cls.__getreadonly__(key, cls.__marker__)
+ if value is cls.__marker__:
+ return False
+ return True
+
+ def iter(cls, type, readonly=False):
+ for key in dir(cls):
+ if key.startswith("__"):
+ continue
+
+ if key.endswith(MUTABLE):
+ key = key[:-len(MUTABLE)]
+
+ if type == "keys":
+ yield key
+
+ try:
+ if readonly:
+ value = cls.__getreadonly__(key)
+ else:
+ value = cls[key]
+ except KeyError:
+ continue
+
+ if type == "values":
+ yield value
+ if type == "items":
+ yield (key, value)
+ raise StopIteration()
+
+ def iterkeys(cls):
+ return cls.iter("keys")
+ def itervalues(cls, readonly=False):
+ if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False:
+ print("Warning: If you arn't going to change any of the values call with True.", file=cls.__warn__)
+ return cls.iter("values", readonly)
+ def iteritems(cls, readonly=False):
+ if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False:
+ print("Warning: If you arn't going to change any of the values call with True.", file=cls.__warn__)
+ return cls.iter("items", readonly)
+
+class COWSetMeta(COWDictMeta):
+ def __str__(cls):
+ # FIXME: I have magic numbers!
+ return "<COWSet Level: %i Current Keys: %i>" % (cls.__count__, len(cls.__dict__) -3)
+ __repr__ = __str__
+
+ def cow(cls):
+ class C(cls):
+ __count__ = cls.__count__ + 1
+ return C
+
+ def add(cls, value):
+ COWDictMeta.__setitem__(cls, repr(hash(value)), value)
+
+ def remove(cls, value):
+ COWDictMeta.__delitem__(cls, repr(hash(value)))
+
+ def __in__(cls, value):
+ return repr(hash(value)) in COWDictMeta
+
+ def iterkeys(cls):
+ raise TypeError("sets don't have keys")
+
+ def iteritems(cls):
+ raise TypeError("sets don't have 'items'")
+
+# These are the actual classes you use!
+class COWDictBase(object, metaclass = COWDictMeta):
+ __count__ = 0
+
+class COWSetBase(object, metaclass = COWSetMeta):
+ __count__ = 0
+
+if __name__ == "__main__":
+ import sys
+ COWDictBase.__warn__ = sys.stderr
+ a = COWDictBase()
+ print("a", a)
+
+ a['a'] = 'a'
+ a['b'] = 'b'
+ a['dict'] = {}
+
+ b = a.copy()
+ print("b", b)
+ b['c'] = 'b'
+
+ print()
+
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems():
+ print(x)
+ print()
+
+ b['dict']['a'] = 'b'
+ b['a'] = 'c'
+
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems():
+ print(x)
+ print()
+
+ try:
+ b['dict2']
+ except KeyError as e:
+ print("Okay!")
+
+ a['set'] = COWSetBase()
+ a['set'].add("o1")
+ a['set'].add("o1")
+ a['set'].add("o2")
+
+ print("a", a)
+ for x in a['set'].itervalues():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b['set'].itervalues():
+ print(x)
+ print()
+
+ b['set'].add('o3')
+
+ print("a", a)
+ for x in a['set'].itervalues():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b['set'].itervalues():
+ print(x)
+ print()
+
+ a['set2'] = set()
+ a['set2'].add("o1")
+ a['set2'].add("o1")
+ a['set2'].add("o2")
+
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems(readonly=True):
+ print(x)
+ print()
+
+ del b['b']
+ try:
+ print(b['b'])
+ except KeyError:
+ print("Yay! deleted key raises error")
+
+ if 'b' in b:
+ print("Boo!")
+ else:
+ print("Yay - has_key with delete works!")
+
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems(readonly=True):
+ print(x)
+ print()
+
+ b.__revertitem__('b')
+
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems(readonly=True):
+ print(x)
+ print()
+
+ b.__revertitem__('dict')
+ print("a", a)
+ for x in a.iteritems():
+ print(x)
+ print("--")
+ print("b", b)
+ for x in b.iteritems(readonly=True):
+ print(x)
+ print()
diff --git a/poky/bitbake/lib/bb/__init__.py b/poky/bitbake/lib/bb/__init__.py
new file mode 100644
index 000000000..d24adb8ea
--- /dev/null
+++ b/poky/bitbake/lib/bb/__init__.py
@@ -0,0 +1,144 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Build System Python Library
+#
+# Copyright (C) 2003 Holger Schurig
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# Based on Gentoo's portage.py.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+__version__ = "1.38.0"
+
+import sys
+if sys.version_info < (3, 4, 0):
+ raise RuntimeError("Sorry, python 3.4.0 or later is required for this version of bitbake")
+
+
+class BBHandledException(Exception):
+ """
+ The big dilemma for generic bitbake code is what information to give the user
+ when an exception occurs. Any exception inheriting this base exception class
+ has already provided information to the user via some 'fired' message type such as
+ an explicitly fired event using bb.fire, or a bb.error message. If bitbake
+ encounters an exception derived from this class, no backtrace or other information
+ will be given to the user, its assumed the earlier event provided the relevant information.
+ """
+ pass
+
+import os
+import logging
+
+
+class NullHandler(logging.Handler):
+ def emit(self, record):
+ pass
+
+Logger = logging.getLoggerClass()
+class BBLogger(Logger):
+ def __init__(self, name):
+ if name.split(".")[0] == "BitBake":
+ self.debug = self.bbdebug
+ Logger.__init__(self, name)
+
+ def bbdebug(self, level, msg, *args, **kwargs):
+ return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs)
+
+ def plain(self, msg, *args, **kwargs):
+ return self.log(logging.INFO + 1, msg, *args, **kwargs)
+
+ def verbose(self, msg, *args, **kwargs):
+ return self.log(logging.INFO - 1, msg, *args, **kwargs)
+
+logging.raiseExceptions = False
+logging.setLoggerClass(BBLogger)
+
+logger = logging.getLogger("BitBake")
+logger.addHandler(NullHandler())
+logger.setLevel(logging.DEBUG - 2)
+
+mainlogger = logging.getLogger("BitBake.Main")
+
+# This has to be imported after the setLoggerClass, as the import of bb.msg
+# can result in construction of the various loggers.
+import bb.msg
+
+from bb import fetch2 as fetch
+sys.modules['bb.fetch'] = sys.modules['bb.fetch2']
+
+# Messaging convenience functions
+def plain(*args):
+ mainlogger.plain(''.join(args))
+
+def debug(lvl, *args):
+ if isinstance(lvl, str):
+ mainlogger.warning("Passed invalid debug level '%s' to bb.debug", lvl)
+ args = (lvl,) + args
+ lvl = 1
+ mainlogger.debug(lvl, ''.join(args))
+
+def note(*args):
+ mainlogger.info(''.join(args))
+
+def warn(*args):
+ mainlogger.warning(''.join(args))
+
+def error(*args, **kwargs):
+ mainlogger.error(''.join(args), extra=kwargs)
+
+def fatal(*args, **kwargs):
+ mainlogger.critical(''.join(args), extra=kwargs)
+ raise BBHandledException()
+
+def deprecated(func, name=None, advice=""):
+ """This is a decorator which can be used to mark functions
+ as deprecated. It will result in a warning being emitted
+ when the function is used."""
+ import warnings
+
+ if advice:
+ advice = ": %s" % advice
+ if name is None:
+ name = func.__name__
+
+ def newFunc(*args, **kwargs):
+ warnings.warn("Call to deprecated function %s%s." % (name,
+ advice),
+ category=DeprecationWarning,
+ stacklevel=2)
+ return func(*args, **kwargs)
+ newFunc.__name__ = func.__name__
+ newFunc.__doc__ = func.__doc__
+ newFunc.__dict__.update(func.__dict__)
+ return newFunc
+
+# For compatibility
+def deprecate_import(current, modulename, fromlist, renames = None):
+ """Import objects from one module into another, wrapping them with a DeprecationWarning"""
+ import sys
+
+ module = __import__(modulename, fromlist = fromlist)
+ for position, objname in enumerate(fromlist):
+ obj = getattr(module, objname)
+ newobj = deprecated(obj, "{0}.{1}".format(current, objname),
+ "Please use {0}.{1} instead".format(modulename, objname))
+ if renames:
+ newname = renames[position]
+ else:
+ newname = objname
+
+ setattr(sys.modules[current], newname, newobj)
+
diff --git a/poky/bitbake/lib/bb/build.py b/poky/bitbake/lib/bb/build.py
new file mode 100644
index 000000000..4631abdde
--- /dev/null
+++ b/poky/bitbake/lib/bb/build.py
@@ -0,0 +1,913 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake 'Build' implementation
+#
+# Core code for function execution and task handling in the
+# BitBake build tools.
+#
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# Based on Gentoo's portage.py.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import sys
+import logging
+import shlex
+import glob
+import time
+import stat
+import bb
+import bb.msg
+import bb.process
+import bb.progress
+from bb import data, event, utils
+
+bblogger = logging.getLogger('BitBake')
+logger = logging.getLogger('BitBake.Build')
+
+NULL = open(os.devnull, 'r+')
+
+__mtime_cache = {}
+
+def cached_mtime_noerror(f):
+ if f not in __mtime_cache:
+ try:
+ __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
+ except OSError:
+ return 0
+ return __mtime_cache[f]
+
+def reset_cache():
+ global __mtime_cache
+ __mtime_cache = {}
+
+# When we execute a Python function, we'd like certain things
+# in all namespaces, hence we add them to __builtins__.
+# If we do not do this and use the exec globals, they will
+# not be available to subfunctions.
+if hasattr(__builtins__, '__setitem__'):
+ builtins = __builtins__
+else:
+ builtins = __builtins__.__dict__
+
+builtins['bb'] = bb
+builtins['os'] = os
+
+class FuncFailed(Exception):
+ def __init__(self, name = None, logfile = None):
+ self.logfile = logfile
+ self.name = name
+ if name:
+ self.msg = 'Function failed: %s' % name
+ else:
+ self.msg = "Function failed"
+
+ def __str__(self):
+ if self.logfile and os.path.exists(self.logfile):
+ msg = ("%s (log file is located at %s)" %
+ (self.msg, self.logfile))
+ else:
+ msg = self.msg
+ return msg
+
+class TaskBase(event.Event):
+ """Base class for task events"""
+
+ def __init__(self, t, logfile, d):
+ self._task = t
+ self._package = d.getVar("PF")
+ self._mc = d.getVar("BB_CURRENT_MC")
+ self.taskfile = d.getVar("FILE")
+ self.taskname = self._task
+ self.logfile = logfile
+ self.time = time.time()
+ event.Event.__init__(self)
+ self._message = "recipe %s: task %s: %s" % (d.getVar("PF"), t, self.getDisplayName())
+
+ def getTask(self):
+ return self._task
+
+ def setTask(self, task):
+ self._task = task
+
+ def getDisplayName(self):
+ return bb.event.getName(self)[4:]
+
+ task = property(getTask, setTask, None, "task property")
+
+class TaskStarted(TaskBase):
+ """Task execution started"""
+ def __init__(self, t, logfile, taskflags, d):
+ super(TaskStarted, self).__init__(t, logfile, d)
+ self.taskflags = taskflags
+
+class TaskSucceeded(TaskBase):
+ """Task execution completed"""
+
+class TaskFailed(TaskBase):
+ """Task execution failed"""
+
+ def __init__(self, task, logfile, metadata, errprinted = False):
+ self.errprinted = errprinted
+ super(TaskFailed, self).__init__(task, logfile, metadata)
+
+class TaskFailedSilent(TaskBase):
+ """Task execution failed (silently)"""
+ def getDisplayName(self):
+ # Don't need to tell the user it was silent
+ return "Failed"
+
+class TaskInvalid(TaskBase):
+
+ def __init__(self, task, metadata):
+ super(TaskInvalid, self).__init__(task, None, metadata)
+ self._message = "No such task '%s'" % task
+
+class TaskProgress(event.Event):
+ """
+ Task made some progress that could be reported to the user, usually in
+ the form of a progress bar or similar.
+ NOTE: this class does not inherit from TaskBase since it doesn't need
+ to - it's fired within the task context itself, so we don't have any of
+ the context information that you do in the case of the other events.
+ The event PID can be used to determine which task it came from.
+ The progress value is normally 0-100, but can also be negative
+ indicating that progress has been made but we aren't able to determine
+ how much.
+ The rate is optional, this is simply an extra string to display to the
+ user if specified.
+ """
+ def __init__(self, progress, rate=None):
+ self.progress = progress
+ self.rate = rate
+ event.Event.__init__(self)
+
+
+class LogTee(object):
+ def __init__(self, logger, outfile):
+ self.outfile = outfile
+ self.logger = logger
+ self.name = self.outfile.name
+
+ def write(self, string):
+ self.logger.plain(string)
+ self.outfile.write(string)
+
+ def __enter__(self):
+ self.outfile.__enter__()
+ return self
+
+ def __exit__(self, *excinfo):
+ self.outfile.__exit__(*excinfo)
+
+ def __repr__(self):
+ return '<LogTee {0}>'.format(self.name)
+ def flush(self):
+ self.outfile.flush()
+
+#
+# pythonexception allows the python exceptions generated to be raised
+# as the real exceptions (not FuncFailed) and without a backtrace at the
+# origin of the failure.
+#
+def exec_func(func, d, dirs = None, pythonexception=False):
+ """Execute a BB 'function'"""
+
+ try:
+ oldcwd = os.getcwd()
+ except:
+ oldcwd = None
+
+ flags = d.getVarFlags(func)
+ cleandirs = flags.get('cleandirs') if flags else None
+ if cleandirs:
+ for cdir in d.expand(cleandirs).split():
+ bb.utils.remove(cdir, True)
+ bb.utils.mkdirhier(cdir)
+
+ if flags and dirs is None:
+ dirs = flags.get('dirs')
+ if dirs:
+ dirs = d.expand(dirs).split()
+
+ if dirs:
+ for adir in dirs:
+ bb.utils.mkdirhier(adir)
+ adir = dirs[-1]
+ else:
+ adir = None
+
+ body = d.getVar(func, False)
+ if not body:
+ if body is None:
+ logger.warning("Function %s doesn't exist", func)
+ return
+
+ ispython = flags.get('python')
+
+ lockflag = flags.get('lockfiles')
+ if lockflag:
+ lockfiles = [f for f in d.expand(lockflag).split()]
+ else:
+ lockfiles = None
+
+ tempdir = d.getVar('T')
+
+ # or func allows items to be executed outside of the normal
+ # task set, such as buildhistory
+ task = d.getVar('BB_RUNTASK') or func
+ if task == func:
+ taskfunc = task
+ else:
+ taskfunc = "%s.%s" % (task, func)
+
+ runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}"
+ runfn = runfmt.format(taskfunc=taskfunc, task=task, func=func, pid=os.getpid())
+ runfile = os.path.join(tempdir, runfn)
+ bb.utils.mkdirhier(os.path.dirname(runfile))
+
+ # Setup the courtesy link to the runfn, only for tasks
+ # we create the link 'just' before the run script is created
+ # if we create it after, and if the run script fails, then the
+ # link won't be created as an exception would be fired.
+ if task == func:
+ runlink = os.path.join(tempdir, 'run.{0}'.format(task))
+ if runlink:
+ bb.utils.remove(runlink)
+
+ try:
+ os.symlink(runfn, runlink)
+ except OSError:
+ pass
+
+ with bb.utils.fileslocked(lockfiles):
+ if ispython:
+ exec_func_python(func, d, runfile, cwd=adir, pythonexception=pythonexception)
+ else:
+ exec_func_shell(func, d, runfile, cwd=adir)
+
+ try:
+ curcwd = os.getcwd()
+ except:
+ curcwd = None
+
+ if oldcwd and curcwd != oldcwd:
+ try:
+ bb.warn("Task %s changed cwd to %s" % (func, curcwd))
+ os.chdir(oldcwd)
+ except:
+ pass
+
+_functionfmt = """
+{function}(d)
+"""
+logformatter = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+def exec_func_python(func, d, runfile, cwd=None, pythonexception=False):
+ """Execute a python BB 'function'"""
+
+ code = _functionfmt.format(function=func)
+ bb.utils.mkdirhier(os.path.dirname(runfile))
+ with open(runfile, 'w') as script:
+ bb.data.emit_func_python(func, script, d)
+
+ if cwd:
+ try:
+ olddir = os.getcwd()
+ except OSError as e:
+ bb.warn("%s: Cannot get cwd: %s" % (func, e))
+ olddir = None
+ os.chdir(cwd)
+
+ bb.debug(2, "Executing python function %s" % func)
+
+ try:
+ text = "def %s(d):\n%s" % (func, d.getVar(func, False))
+ fn = d.getVarFlag(func, "filename", False)
+ lineno = int(d.getVarFlag(func, "lineno", False))
+ bb.methodpool.insert_method(func, text, fn, lineno - 1)
+
+ comp = utils.better_compile(code, func, "exec_python_func() autogenerated")
+ utils.better_exec(comp, {"d": d}, code, "exec_python_func() autogenerated", pythonexception=pythonexception)
+ except (bb.parse.SkipRecipe, bb.build.FuncFailed):
+ raise
+ except:
+ if pythonexception:
+ raise
+ raise FuncFailed(func, None)
+ finally:
+ bb.debug(2, "Python function %s finished" % func)
+
+ if cwd and olddir:
+ try:
+ os.chdir(olddir)
+ except OSError as e:
+ bb.warn("%s: Cannot restore cwd %s: %s" % (func, olddir, e))
+
+def shell_trap_code():
+ return '''#!/bin/sh\n
+# Emit a useful diagnostic if something fails:
+bb_exit_handler() {
+ ret=$?
+ case $ret in
+ 0) ;;
+ *) case $BASH_VERSION in
+ "") echo "WARNING: exit code $ret from a shell command.";;
+ *) echo "WARNING: ${BASH_SOURCE[0]}:${BASH_LINENO[0]} exit $ret from '$BASH_COMMAND'";;
+ esac
+ exit $ret
+ esac
+}
+trap 'bb_exit_handler' 0
+set -e
+'''
+
+def exec_func_shell(func, d, runfile, cwd=None):
+ """Execute a shell function from the metadata
+
+ Note on directory behavior. The 'dirs' varflag should contain a list
+ of the directories you need created prior to execution. The last
+ item in the list is where we will chdir/cd to.
+ """
+
+ # Don't let the emitted shell script override PWD
+ d.delVarFlag('PWD', 'export')
+
+ with open(runfile, 'w') as script:
+ script.write(shell_trap_code())
+
+ bb.data.emit_func(func, script, d)
+
+ if bb.msg.loggerVerboseLogs:
+ script.write("set -x\n")
+ if cwd:
+ script.write("cd '%s'\n" % cwd)
+ script.write("%s\n" % func)
+ script.write('''
+# cleanup
+ret=$?
+trap '' 0
+exit $ret
+''')
+
+ os.chmod(runfile, 0o775)
+
+ cmd = runfile
+ if d.getVarFlag(func, 'fakeroot', False):
+ fakerootcmd = d.getVar('FAKEROOT')
+ if fakerootcmd:
+ cmd = [fakerootcmd, runfile]
+
+ if bb.msg.loggerDefaultVerbose:
+ logfile = LogTee(logger, sys.stdout)
+ else:
+ logfile = sys.stdout
+
+ progress = d.getVarFlag(func, 'progress')
+ if progress:
+ if progress == 'percent':
+ # Use default regex
+ logfile = bb.progress.BasicProgressHandler(d, outfile=logfile)
+ elif progress.startswith('percent:'):
+ # Use specified regex
+ logfile = bb.progress.BasicProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
+ elif progress.startswith('outof:'):
+ # Use specified regex
+ logfile = bb.progress.OutOfProgressHandler(d, regex=progress.split(':', 1)[1], outfile=logfile)
+ else:
+ bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress))
+
+ fifobuffer = bytearray()
+ def readfifo(data):
+ nonlocal fifobuffer
+ fifobuffer.extend(data)
+ while fifobuffer:
+ message, token, nextmsg = fifobuffer.partition(b"\00")
+ if token:
+ splitval = message.split(b' ', 1)
+ cmd = splitval[0].decode("utf-8")
+ if len(splitval) > 1:
+ value = splitval[1].decode("utf-8")
+ else:
+ value = ''
+ if cmd == 'bbplain':
+ bb.plain(value)
+ elif cmd == 'bbnote':
+ bb.note(value)
+ elif cmd == 'bbwarn':
+ bb.warn(value)
+ elif cmd == 'bberror':
+ bb.error(value)
+ elif cmd == 'bbfatal':
+ # The caller will call exit themselves, so bb.error() is
+ # what we want here rather than bb.fatal()
+ bb.error(value)
+ elif cmd == 'bbfatal_log':
+ bb.error(value, forcelog=True)
+ elif cmd == 'bbdebug':
+ splitval = value.split(' ', 1)
+ level = int(splitval[0])
+ value = splitval[1]
+ bb.debug(level, value)
+ else:
+ bb.warn("Unrecognised command '%s' on FIFO" % cmd)
+ fifobuffer = nextmsg
+ else:
+ break
+
+ tempdir = d.getVar('T')
+ fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
+ if os.path.exists(fifopath):
+ os.unlink(fifopath)
+ os.mkfifo(fifopath)
+ with open(fifopath, 'r+b', buffering=0) as fifo:
+ try:
+ bb.debug(2, "Executing shell function %s" % func)
+
+ try:
+ with open(os.devnull, 'r+') as stdin:
+ bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
+ except bb.process.CmdError:
+ logfn = d.getVar('BB_LOGFILE')
+ raise FuncFailed(func, logfn)
+ finally:
+ os.unlink(fifopath)
+
+ bb.debug(2, "Shell function %s finished" % func)
+
+def _task_data(fn, task, d):
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('BB_FILENAME', fn)
+ localdata.setVar('BB_CURRENTTASK', task[3:])
+ localdata.setVar('OVERRIDES', 'task-%s:%s' %
+ (task[3:].replace('_', '-'), d.getVar('OVERRIDES', False)))
+ localdata.finalize()
+ bb.data.expandKeys(localdata)
+ return localdata
+
+def _exec_task(fn, task, d, quieterr):
+ """Execute a BB 'task'
+
+ Execution of a task involves a bit more setup than executing a function,
+ running it with its own local metadata, and with some useful variables set.
+ """
+ if not d.getVarFlag(task, 'task', False):
+ event.fire(TaskInvalid(task, d), d)
+ logger.error("No such task: %s" % task)
+ return 1
+
+ logger.debug(1, "Executing task %s", task)
+
+ localdata = _task_data(fn, task, d)
+ tempdir = localdata.getVar('T')
+ if not tempdir:
+ bb.fatal("T variable not set, unable to build")
+
+ # Change nice level if we're asked to
+ nice = localdata.getVar("BB_TASK_NICE_LEVEL")
+ if nice:
+ curnice = os.nice(0)
+ nice = int(nice) - curnice
+ newnice = os.nice(nice)
+ logger.debug(1, "Renice to %s " % newnice)
+ ionice = localdata.getVar("BB_TASK_IONICE_LEVEL")
+ if ionice:
+ try:
+ cls, prio = ionice.split(".", 1)
+ bb.utils.ioprio_set(os.getpid(), int(cls), int(prio))
+ except:
+ bb.warn("Invalid ionice level %s" % ionice)
+
+ bb.utils.mkdirhier(tempdir)
+
+ # Determine the logfile to generate
+ logfmt = localdata.getVar('BB_LOGFMT') or 'log.{task}.{pid}'
+ logbase = logfmt.format(task=task, pid=os.getpid())
+
+ # Document the order of the tasks...
+ logorder = os.path.join(tempdir, 'log.task_order')
+ try:
+ with open(logorder, 'a') as logorderfile:
+ logorderfile.write('{0} ({1}): {2}\n'.format(task, os.getpid(), logbase))
+ except OSError:
+ logger.exception("Opening log file '%s'", logorder)
+ pass
+
+ # Setup the courtesy link to the logfn
+ loglink = os.path.join(tempdir, 'log.{0}'.format(task))
+ logfn = os.path.join(tempdir, logbase)
+ if loglink:
+ bb.utils.remove(loglink)
+
+ try:
+ os.symlink(logbase, loglink)
+ except OSError:
+ pass
+
+ prefuncs = localdata.getVarFlag(task, 'prefuncs', expand=True)
+ postfuncs = localdata.getVarFlag(task, 'postfuncs', expand=True)
+
+ class ErrorCheckHandler(logging.Handler):
+ def __init__(self):
+ self.triggered = False
+ logging.Handler.__init__(self, logging.ERROR)
+ def emit(self, record):
+ if getattr(record, 'forcelog', False):
+ self.triggered = False
+ else:
+ self.triggered = True
+
+ # Handle logfiles
+ si = open('/dev/null', 'r')
+ try:
+ bb.utils.mkdirhier(os.path.dirname(logfn))
+ logfile = open(logfn, 'w')
+ except OSError:
+ logger.exception("Opening log file '%s'", logfn)
+ pass
+
+ # Dup the existing fds so we dont lose them
+ osi = [os.dup(sys.stdin.fileno()), sys.stdin.fileno()]
+ oso = [os.dup(sys.stdout.fileno()), sys.stdout.fileno()]
+ ose = [os.dup(sys.stderr.fileno()), sys.stderr.fileno()]
+
+ # Replace those fds with our own
+ os.dup2(si.fileno(), osi[1])
+ os.dup2(logfile.fileno(), oso[1])
+ os.dup2(logfile.fileno(), ose[1])
+
+ # Ensure Python logging goes to the logfile
+ handler = logging.StreamHandler(logfile)
+ handler.setFormatter(logformatter)
+ # Always enable full debug output into task logfiles
+ handler.setLevel(logging.DEBUG - 2)
+ bblogger.addHandler(handler)
+
+ errchk = ErrorCheckHandler()
+ bblogger.addHandler(errchk)
+
+ localdata.setVar('BB_LOGFILE', logfn)
+ localdata.setVar('BB_RUNTASK', task)
+ localdata.setVar('BB_TASK_LOGGER', bblogger)
+
+ flags = localdata.getVarFlags(task)
+
+ try:
+ try:
+ event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
+ except (bb.BBHandledException, SystemExit):
+ return 1
+ except FuncFailed as exc:
+ logger.error(str(exc))
+ return 1
+
+ try:
+ for func in (prefuncs or '').split():
+ exec_func(func, localdata)
+ exec_func(task, localdata)
+ for func in (postfuncs or '').split():
+ exec_func(func, localdata)
+ except FuncFailed as exc:
+ if quieterr:
+ event.fire(TaskFailedSilent(task, logfn, localdata), localdata)
+ else:
+ errprinted = errchk.triggered
+ logger.error(str(exc))
+ event.fire(TaskFailed(task, logfn, localdata, errprinted), localdata)
+ return 1
+ except bb.BBHandledException:
+ event.fire(TaskFailed(task, logfn, localdata, True), localdata)
+ return 1
+ finally:
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ bblogger.removeHandler(handler)
+
+ # Restore the backup fds
+ os.dup2(osi[0], osi[1])
+ os.dup2(oso[0], oso[1])
+ os.dup2(ose[0], ose[1])
+
+ # Close the backup fds
+ os.close(osi[0])
+ os.close(oso[0])
+ os.close(ose[0])
+ si.close()
+
+ logfile.close()
+ if os.path.exists(logfn) and os.path.getsize(logfn) == 0:
+ logger.debug(2, "Zero size logfn %s, removing", logfn)
+ bb.utils.remove(logfn)
+ bb.utils.remove(loglink)
+ event.fire(TaskSucceeded(task, logfn, localdata), localdata)
+
+ if not localdata.getVarFlag(task, 'nostamp', False) and not localdata.getVarFlag(task, 'selfstamp', False):
+ make_stamp(task, localdata)
+
+ return 0
+
+def exec_task(fn, task, d, profile = False):
+ try:
+ quieterr = False
+ if d.getVarFlag(task, "quieterrors", False) is not None:
+ quieterr = True
+
+ if profile:
+ profname = "profile-%s.log" % (d.getVar("PN") + "-" + task)
+ try:
+ import cProfile as profile
+ except:
+ import profile
+ prof = profile.Profile()
+ ret = profile.Profile.runcall(prof, _exec_task, fn, task, d, quieterr)
+ prof.dump_stats(profname)
+ bb.utils.process_profilelog(profname)
+
+ return ret
+ else:
+ return _exec_task(fn, task, d, quieterr)
+
+ except Exception:
+ from traceback import format_exc
+ if not quieterr:
+ logger.error("Build of %s failed" % (task))
+ logger.error(format_exc())
+ failedevent = TaskFailed(task, None, d, True)
+ event.fire(failedevent, d)
+ return 1
+
+def stamp_internal(taskname, d, file_name, baseonly=False, noextra=False):
+ """
+ Internal stamp helper function
+ Makes sure the stamp directory exists
+ Returns the stamp path+filename
+
+ In the bitbake core, d can be a CacheData and file_name will be set.
+ When called in task context, d will be a data store, file_name will not be set
+ """
+ taskflagname = taskname
+ if taskname.endswith("_setscene") and taskname != "do_setscene":
+ taskflagname = taskname.replace("_setscene", "")
+
+ if file_name:
+ stamp = d.stamp[file_name]
+ extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
+ else:
+ stamp = d.getVar('STAMP')
+ file_name = d.getVar('BB_FILENAME')
+ extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
+
+ if baseonly:
+ return stamp
+ if noextra:
+ extrainfo = ""
+
+ if not stamp:
+ return
+
+ stamp = bb.parse.siggen.stampfile(stamp, file_name, taskname, extrainfo)
+
+ stampdir = os.path.dirname(stamp)
+ if cached_mtime_noerror(stampdir) == 0:
+ bb.utils.mkdirhier(stampdir)
+
+ return stamp
+
+def stamp_cleanmask_internal(taskname, d, file_name):
+ """
+ Internal stamp helper function to generate stamp cleaning mask
+ Returns the stamp path+filename
+
+ In the bitbake core, d can be a CacheData and file_name will be set.
+ When called in task context, d will be a data store, file_name will not be set
+ """
+ taskflagname = taskname
+ if taskname.endswith("_setscene") and taskname != "do_setscene":
+ taskflagname = taskname.replace("_setscene", "")
+
+ if file_name:
+ stamp = d.stampclean[file_name]
+ extrainfo = d.stamp_extrainfo[file_name].get(taskflagname) or ""
+ else:
+ stamp = d.getVar('STAMPCLEAN')
+ file_name = d.getVar('BB_FILENAME')
+ extrainfo = d.getVarFlag(taskflagname, 'stamp-extra-info') or ""
+
+ if not stamp:
+ return []
+
+ cleanmask = bb.parse.siggen.stampcleanmask(stamp, file_name, taskname, extrainfo)
+
+ return [cleanmask, cleanmask.replace(taskflagname, taskflagname + "_setscene")]
+
+def make_stamp(task, d, file_name = None):
+ """
+ Creates/updates a stamp for a given task
+ (d can be a data dict or dataCache)
+ """
+ cleanmask = stamp_cleanmask_internal(task, d, file_name)
+ for mask in cleanmask:
+ for name in glob.glob(mask):
+ # Preserve sigdata files in the stamps directory
+ if "sigdata" in name or "sigbasedata" in name:
+ continue
+ # Preserve taint files in the stamps directory
+ if name.endswith('.taint'):
+ continue
+ os.unlink(name)
+
+ stamp = stamp_internal(task, d, file_name)
+ # Remove the file and recreate to force timestamp
+ # change on broken NFS filesystems
+ if stamp:
+ bb.utils.remove(stamp)
+ open(stamp, "w").close()
+
+ # If we're in task context, write out a signature file for each task
+ # as it completes
+ if not task.endswith("_setscene") and task != "do_setscene" and not file_name:
+ stampbase = stamp_internal(task, d, None, True)
+ file_name = d.getVar('BB_FILENAME')
+ bb.parse.siggen.dump_sigtask(file_name, task, stampbase, True)
+
+def del_stamp(task, d, file_name = None):
+ """
+ Removes a stamp for a given task
+ (d can be a data dict or dataCache)
+ """
+ stamp = stamp_internal(task, d, file_name)
+ bb.utils.remove(stamp)
+
+def write_taint(task, d, file_name = None):
+ """
+ Creates a "taint" file which will force the specified task and its
+ dependents to be re-run the next time by influencing the value of its
+ taskhash.
+ (d can be a data dict or dataCache)
+ """
+ import uuid
+ if file_name:
+ taintfn = d.stamp[file_name] + '.' + task + '.taint'
+ else:
+ taintfn = d.getVar('STAMP') + '.' + task + '.taint'
+ bb.utils.mkdirhier(os.path.dirname(taintfn))
+ # The specific content of the taint file is not really important,
+ # we just need it to be random, so a random UUID is used
+ with open(taintfn, 'w') as taintf:
+ taintf.write(str(uuid.uuid4()))
+
+def stampfile(taskname, d, file_name = None, noextra=False):
+ """
+ Return the stamp for a given task
+ (d can be a data dict or dataCache)
+ """
+ return stamp_internal(taskname, d, file_name, noextra=noextra)
+
+def add_tasks(tasklist, d):
+ task_deps = d.getVar('_task_deps', False)
+ if not task_deps:
+ task_deps = {}
+ if not 'tasks' in task_deps:
+ task_deps['tasks'] = []
+ if not 'parents' in task_deps:
+ task_deps['parents'] = {}
+
+ for task in tasklist:
+ task = d.expand(task)
+
+ d.setVarFlag(task, 'task', 1)
+
+ if not task in task_deps['tasks']:
+ task_deps['tasks'].append(task)
+
+ flags = d.getVarFlags(task)
+ def getTask(name):
+ if not name in task_deps:
+ task_deps[name] = {}
+ if name in flags:
+ deptask = d.expand(flags[name])
+ task_deps[name][task] = deptask
+ getTask('depends')
+ getTask('rdepends')
+ getTask('deptask')
+ getTask('rdeptask')
+ getTask('recrdeptask')
+ getTask('recideptask')
+ getTask('nostamp')
+ getTask('fakeroot')
+ getTask('noexec')
+ getTask('umask')
+ task_deps['parents'][task] = []
+ if 'deps' in flags:
+ for dep in flags['deps']:
+ dep = d.expand(dep)
+ task_deps['parents'][task].append(dep)
+
+ # don't assume holding a reference
+ d.setVar('_task_deps', task_deps)
+
+def addtask(task, before, after, d):
+ if task[:3] != "do_":
+ task = "do_" + task
+
+ d.setVarFlag(task, "task", 1)
+ bbtasks = d.getVar('__BBTASKS', False) or []
+ if task not in bbtasks:
+ bbtasks.append(task)
+ d.setVar('__BBTASKS', bbtasks)
+
+ existing = d.getVarFlag(task, "deps", False) or []
+ if after is not None:
+ # set up deps for function
+ for entry in after.split():
+ if entry not in existing:
+ existing.append(entry)
+ d.setVarFlag(task, "deps", existing)
+ if before is not None:
+ # set up things that depend on this func
+ for entry in before.split():
+ existing = d.getVarFlag(entry, "deps", False) or []
+ if task not in existing:
+ d.setVarFlag(entry, "deps", [task] + existing)
+
+def deltask(task, d):
+ if task[:3] != "do_":
+ task = "do_" + task
+
+ bbtasks = d.getVar('__BBTASKS', False) or []
+ if task in bbtasks:
+ bbtasks.remove(task)
+ d.delVarFlag(task, 'task')
+ d.setVar('__BBTASKS', bbtasks)
+
+ d.delVarFlag(task, 'deps')
+ for bbtask in d.getVar('__BBTASKS', False) or []:
+ deps = d.getVarFlag(bbtask, 'deps', False) or []
+ if task in deps:
+ deps.remove(task)
+ d.setVarFlag(bbtask, 'deps', deps)
+
+def preceedtask(task, with_recrdeptasks, d):
+ """
+ Returns a set of tasks in the current recipe which were specified as
+ precondition by the task itself ("after") or which listed themselves
+ as precondition ("before"). Preceeding tasks specified via the
+ "recrdeptask" are included in the result only if requested. Beware
+ that this may lead to the task itself being listed.
+ """
+ preceed = set()
+
+ # Ignore tasks which don't exist
+ tasks = d.getVar('__BBTASKS', False)
+ if task not in tasks:
+ return preceed
+
+ preceed.update(d.getVarFlag(task, 'deps') or [])
+ if with_recrdeptasks:
+ recrdeptask = d.getVarFlag(task, 'recrdeptask')
+ if recrdeptask:
+ preceed.update(recrdeptask.split())
+ return preceed
+
+def tasksbetween(task_start, task_end, d):
+ """
+ Return the list of tasks between two tasks in the current recipe,
+ where task_start is to start at and task_end is the task to end at
+ (and task_end has a dependency chain back to task_start).
+ """
+ outtasks = []
+ tasks = list(filter(lambda k: d.getVarFlag(k, "task"), d.keys()))
+ def follow_chain(task, endtask, chain=None):
+ if not chain:
+ chain = []
+ chain.append(task)
+ for othertask in tasks:
+ if othertask == task:
+ continue
+ if task == endtask:
+ for ctask in chain:
+ if ctask not in outtasks:
+ outtasks.append(ctask)
+ else:
+ deps = d.getVarFlag(othertask, 'deps', False)
+ if task in deps:
+ follow_chain(othertask, endtask, chain)
+ chain.pop()
+ follow_chain(task_start, task_end)
+ return outtasks
diff --git a/poky/bitbake/lib/bb/cache.py b/poky/bitbake/lib/bb/cache.py
new file mode 100644
index 000000000..168a77ac0
--- /dev/null
+++ b/poky/bitbake/lib/bb/cache.py
@@ -0,0 +1,891 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Cache implementation
+#
+# Caching of bitbake variables before task execution
+
+# Copyright (C) 2006 Richard Purdie
+# Copyright (C) 2012 Intel Corporation
+
+# but small sections based on code from bin/bitbake:
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import logging
+import pickle
+from collections import defaultdict
+import bb.utils
+
+logger = logging.getLogger("BitBake.Cache")
+
+__cache_version__ = "151"
+
+def getCacheFile(path, filename, data_hash):
+ return os.path.join(path, filename + "." + data_hash)
+
+# RecipeInfoCommon defines common data retrieving methods
+# from meta data for caches. CoreRecipeInfo as well as other
+# Extra RecipeInfo needs to inherit this class
+class RecipeInfoCommon(object):
+
+ @classmethod
+ def listvar(cls, var, metadata):
+ return cls.getvar(var, metadata).split()
+
+ @classmethod
+ def intvar(cls, var, metadata):
+ return int(cls.getvar(var, metadata) or 0)
+
+ @classmethod
+ def depvar(cls, var, metadata):
+ return bb.utils.explode_deps(cls.getvar(var, metadata))
+
+ @classmethod
+ def pkgvar(cls, var, packages, metadata):
+ return dict((pkg, cls.depvar("%s_%s" % (var, pkg), metadata))
+ for pkg in packages)
+
+ @classmethod
+ def taskvar(cls, var, tasks, metadata):
+ return dict((task, cls.getvar("%s_task-%s" % (var, task), metadata))
+ for task in tasks)
+
+ @classmethod
+ def flaglist(cls, flag, varlist, metadata, squash=False):
+ out_dict = dict((var, metadata.getVarFlag(var, flag))
+ for var in varlist)
+ if squash:
+ return dict((k,v) for (k,v) in out_dict.items() if v)
+ else:
+ return out_dict
+
+ @classmethod
+ def getvar(cls, var, metadata, expand = True):
+ return metadata.getVar(var, expand) or ''
+
+
+class CoreRecipeInfo(RecipeInfoCommon):
+ __slots__ = ()
+
+ cachefile = "bb_cache.dat"
+
+ def __init__(self, filename, metadata):
+ self.file_depends = metadata.getVar('__depends', False)
+ self.timestamp = bb.parse.cached_mtime(filename)
+ self.variants = self.listvar('__VARIANTS', metadata) + ['']
+ self.appends = self.listvar('__BBAPPEND', metadata)
+ self.nocache = self.getvar('BB_DONT_CACHE', metadata)
+
+ self.skipreason = self.getvar('__SKIPPED', metadata)
+ if self.skipreason:
+ self.pn = self.getvar('PN', metadata) or bb.parse.BBHandler.vars_from_file(filename,metadata)[0]
+ self.skipped = True
+ self.provides = self.depvar('PROVIDES', metadata)
+ self.rprovides = self.depvar('RPROVIDES', metadata)
+ return
+
+ self.tasks = metadata.getVar('__BBTASKS', False)
+
+ self.pn = self.getvar('PN', metadata)
+ self.packages = self.listvar('PACKAGES', metadata)
+ if not self.packages:
+ self.packages.append(self.pn)
+
+ self.basetaskhashes = self.taskvar('BB_BASEHASH', self.tasks, metadata)
+ self.hashfilename = self.getvar('BB_HASHFILENAME', metadata)
+
+ self.task_deps = metadata.getVar('_task_deps', False) or {'tasks': [], 'parents': {}}
+
+ self.skipped = False
+ self.pe = self.getvar('PE', metadata)
+ self.pv = self.getvar('PV', metadata)
+ self.pr = self.getvar('PR', metadata)
+ self.defaultpref = self.intvar('DEFAULT_PREFERENCE', metadata)
+ self.not_world = self.getvar('EXCLUDE_FROM_WORLD', metadata)
+ self.stamp = self.getvar('STAMP', metadata)
+ self.stampclean = self.getvar('STAMPCLEAN', metadata)
+ self.stamp_extrainfo = self.flaglist('stamp-extra-info', self.tasks, metadata)
+ self.file_checksums = self.flaglist('file-checksums', self.tasks, metadata, True)
+ self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata)
+ self.depends = self.depvar('DEPENDS', metadata)
+ self.provides = self.depvar('PROVIDES', metadata)
+ self.rdepends = self.depvar('RDEPENDS', metadata)
+ self.rprovides = self.depvar('RPROVIDES', metadata)
+ self.rrecommends = self.depvar('RRECOMMENDS', metadata)
+ self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
+ self.rdepends_pkg = self.pkgvar('RDEPENDS', self.packages, metadata)
+ self.rrecommends_pkg = self.pkgvar('RRECOMMENDS', self.packages, metadata)
+ self.inherits = self.getvar('__inherit_cache', metadata, expand=False)
+ self.fakerootenv = self.getvar('FAKEROOTENV', metadata)
+ self.fakerootdirs = self.getvar('FAKEROOTDIRS', metadata)
+ self.fakerootnoenv = self.getvar('FAKEROOTNOENV', metadata)
+ self.extradepsfunc = self.getvar('calculate_extra_depends', metadata)
+
+ @classmethod
+ def init_cacheData(cls, cachedata):
+ # CacheData in Core RecipeInfo Class
+ cachedata.task_deps = {}
+ cachedata.pkg_fn = {}
+ cachedata.pkg_pn = defaultdict(list)
+ cachedata.pkg_pepvpr = {}
+ cachedata.pkg_dp = {}
+
+ cachedata.stamp = {}
+ cachedata.stampclean = {}
+ cachedata.stamp_extrainfo = {}
+ cachedata.file_checksums = {}
+ cachedata.fn_provides = {}
+ cachedata.pn_provides = defaultdict(list)
+ cachedata.all_depends = []
+
+ cachedata.deps = defaultdict(list)
+ cachedata.packages = defaultdict(list)
+ cachedata.providers = defaultdict(list)
+ cachedata.rproviders = defaultdict(list)
+ cachedata.packages_dynamic = defaultdict(list)
+
+ cachedata.rundeps = defaultdict(lambda: defaultdict(list))
+ cachedata.runrecs = defaultdict(lambda: defaultdict(list))
+ cachedata.possible_world = []
+ cachedata.universe_target = []
+ cachedata.hashfn = {}
+
+ cachedata.basetaskhash = {}
+ cachedata.inherits = {}
+ cachedata.fakerootenv = {}
+ cachedata.fakerootnoenv = {}
+ cachedata.fakerootdirs = {}
+ cachedata.extradepsfunc = {}
+
+ def add_cacheData(self, cachedata, fn):
+ cachedata.task_deps[fn] = self.task_deps
+ cachedata.pkg_fn[fn] = self.pn
+ cachedata.pkg_pn[self.pn].append(fn)
+ cachedata.pkg_pepvpr[fn] = (self.pe, self.pv, self.pr)
+ cachedata.pkg_dp[fn] = self.defaultpref
+ cachedata.stamp[fn] = self.stamp
+ cachedata.stampclean[fn] = self.stampclean
+ cachedata.stamp_extrainfo[fn] = self.stamp_extrainfo
+ cachedata.file_checksums[fn] = self.file_checksums
+
+ provides = [self.pn]
+ for provide in self.provides:
+ if provide not in provides:
+ provides.append(provide)
+ cachedata.fn_provides[fn] = provides
+
+ for provide in provides:
+ cachedata.providers[provide].append(fn)
+ if provide not in cachedata.pn_provides[self.pn]:
+ cachedata.pn_provides[self.pn].append(provide)
+
+ for dep in self.depends:
+ if dep not in cachedata.deps[fn]:
+ cachedata.deps[fn].append(dep)
+ if dep not in cachedata.all_depends:
+ cachedata.all_depends.append(dep)
+
+ rprovides = self.rprovides
+ for package in self.packages:
+ cachedata.packages[package].append(fn)
+ rprovides += self.rprovides_pkg[package]
+
+ for rprovide in rprovides:
+ if fn not in cachedata.rproviders[rprovide]:
+ cachedata.rproviders[rprovide].append(fn)
+
+ for package in self.packages_dynamic:
+ cachedata.packages_dynamic[package].append(fn)
+
+ # Build hash of runtime depends and recommends
+ for package in self.packages:
+ cachedata.rundeps[fn][package] = list(self.rdepends) + self.rdepends_pkg[package]
+ cachedata.runrecs[fn][package] = list(self.rrecommends) + self.rrecommends_pkg[package]
+
+ # Collect files we may need for possible world-dep
+ # calculations
+ if self.not_world:
+ logger.debug(1, "EXCLUDE FROM WORLD: %s", fn)
+ else:
+ cachedata.possible_world.append(fn)
+
+ # create a collection of all targets for sanity checking
+ # tasks, such as upstream versions, license, and tools for
+ # task and image creation.
+ cachedata.universe_target.append(self.pn)
+
+ cachedata.hashfn[fn] = self.hashfilename
+ for task, taskhash in self.basetaskhashes.items():
+ identifier = '%s.%s' % (fn, task)
+ cachedata.basetaskhash[identifier] = taskhash
+
+ cachedata.inherits[fn] = self.inherits
+ cachedata.fakerootenv[fn] = self.fakerootenv
+ cachedata.fakerootnoenv[fn] = self.fakerootnoenv
+ cachedata.fakerootdirs[fn] = self.fakerootdirs
+ cachedata.extradepsfunc[fn] = self.extradepsfunc
+
+def virtualfn2realfn(virtualfn):
+ """
+ Convert a virtual file name to a real one + the associated subclass keyword
+ """
+ mc = ""
+ if virtualfn.startswith('multiconfig:'):
+ elems = virtualfn.split(':')
+ mc = elems[1]
+ virtualfn = ":".join(elems[2:])
+
+ fn = virtualfn
+ cls = ""
+ if virtualfn.startswith('virtual:'):
+ elems = virtualfn.split(':')
+ cls = ":".join(elems[1:-1])
+ fn = elems[-1]
+
+ return (fn, cls, mc)
+
+def realfn2virtual(realfn, cls, mc):
+ """
+ Convert a real filename + the associated subclass keyword to a virtual filename
+ """
+ if cls:
+ realfn = "virtual:" + cls + ":" + realfn
+ if mc:
+ realfn = "multiconfig:" + mc + ":" + realfn
+ return realfn
+
+def variant2virtual(realfn, variant):
+ """
+ Convert a real filename + the associated subclass keyword to a virtual filename
+ """
+ if variant == "":
+ return realfn
+ if variant.startswith("multiconfig:"):
+ elems = variant.split(":")
+ if elems[2]:
+ return "multiconfig:" + elems[1] + ":virtual:" + ":".join(elems[2:]) + ":" + realfn
+ return "multiconfig:" + elems[1] + ":" + realfn
+ return "virtual:" + variant + ":" + realfn
+
+def parse_recipe(bb_data, bbfile, appends, mc=''):
+ """
+ Parse a recipe
+ """
+
+ chdir_back = False
+
+ bb_data.setVar("__BBMULTICONFIG", mc)
+
+ # expand tmpdir to include this topdir
+ bb_data.setVar('TMPDIR', bb_data.getVar('TMPDIR') or "")
+ bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
+ oldpath = os.path.abspath(os.getcwd())
+ bb.parse.cached_mtime_noerror(bbfile_loc)
+
+ # The ConfHandler first looks if there is a TOPDIR and if not
+ # then it would call getcwd().
+ # Previously, we chdir()ed to bbfile_loc, called the handler
+ # and finally chdir()ed back, a couple of thousand times. We now
+ # just fill in TOPDIR to point to bbfile_loc if there is no TOPDIR yet.
+ if not bb_data.getVar('TOPDIR', False):
+ chdir_back = True
+ bb_data.setVar('TOPDIR', bbfile_loc)
+ try:
+ if appends:
+ bb_data.setVar('__BBAPPEND', " ".join(appends))
+ bb_data = bb.parse.handle(bbfile, bb_data)
+ if chdir_back:
+ os.chdir(oldpath)
+ return bb_data
+ except:
+ if chdir_back:
+ os.chdir(oldpath)
+ raise
+
+
+
+class NoCache(object):
+
+ def __init__(self, databuilder):
+ self.databuilder = databuilder
+ self.data = databuilder.data
+
+ def loadDataFull(self, virtualfn, appends):
+ """
+ Return a complete set of data for fn.
+ To do this, we need to parse the file.
+ """
+ logger.debug(1, "Parsing %s (full)" % virtualfn)
+ (fn, virtual, mc) = virtualfn2realfn(virtualfn)
+ bb_data = self.load_bbfile(virtualfn, appends, virtonly=True)
+ return bb_data[virtual]
+
+ def load_bbfile(self, bbfile, appends, virtonly = False):
+ """
+ Load and parse one .bb build file
+ Return the data and whether parsing resulted in the file being skipped
+ """
+
+ if virtonly:
+ (bbfile, virtual, mc) = virtualfn2realfn(bbfile)
+ bb_data = self.databuilder.mcdata[mc].createCopy()
+ bb_data.setVar("__ONLYFINALISE", virtual or "default")
+ datastores = parse_recipe(bb_data, bbfile, appends, mc)
+ return datastores
+
+ bb_data = self.data.createCopy()
+ datastores = parse_recipe(bb_data, bbfile, appends)
+
+ for mc in self.databuilder.mcdata:
+ if not mc:
+ continue
+ bb_data = self.databuilder.mcdata[mc].createCopy()
+ newstores = parse_recipe(bb_data, bbfile, appends, mc)
+ for ns in newstores:
+ datastores["multiconfig:%s:%s" % (mc, ns)] = newstores[ns]
+
+ return datastores
+
+class Cache(NoCache):
+ """
+ BitBake Cache implementation
+ """
+
+ def __init__(self, databuilder, data_hash, caches_array):
+ super().__init__(databuilder)
+ data = databuilder.data
+
+ # Pass caches_array information into Cache Constructor
+ # It will be used later for deciding whether we
+ # need extra cache file dump/load support
+ self.caches_array = caches_array
+ self.cachedir = data.getVar("CACHE")
+ self.clean = set()
+ self.checked = set()
+ self.depends_cache = {}
+ self.data_fn = None
+ self.cacheclean = True
+ self.data_hash = data_hash
+
+ if self.cachedir in [None, '']:
+ self.has_cache = False
+ logger.info("Not using a cache. "
+ "Set CACHE = <directory> to enable.")
+ return
+
+ self.has_cache = True
+ self.cachefile = getCacheFile(self.cachedir, "bb_cache.dat", self.data_hash)
+
+ logger.debug(1, "Cache dir: %s", self.cachedir)
+ bb.utils.mkdirhier(self.cachedir)
+
+ cache_ok = True
+ if self.caches_array:
+ for cache_class in self.caches_array:
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ cache_ok = cache_ok and os.path.exists(cachefile)
+ cache_class.init_cacheData(self)
+ if cache_ok:
+ self.load_cachefile()
+ elif os.path.isfile(self.cachefile):
+ logger.info("Out of date cache found, rebuilding...")
+ else:
+ logger.debug(1, "Cache file %s not found, building..." % self.cachefile)
+
+ def load_cachefile(self):
+ cachesize = 0
+ previous_progress = 0
+ previous_percent = 0
+
+ # Calculate the correct cachesize of all those cache files
+ for cache_class in self.caches_array:
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ with open(cachefile, "rb") as cachefile:
+ cachesize += os.fstat(cachefile.fileno()).st_size
+
+ bb.event.fire(bb.event.CacheLoadStarted(cachesize), self.data)
+
+ for cache_class in self.caches_array:
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ logger.debug(1, 'Loading cache file: %s' % cachefile)
+ with open(cachefile, "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ # Check cache version information
+ try:
+ cache_ver = pickled.load()
+ bitbake_ver = pickled.load()
+ except Exception:
+ logger.info('Invalid cache, rebuilding...')
+ return
+
+ if cache_ver != __cache_version__:
+ logger.info('Cache version mismatch, rebuilding...')
+ return
+ elif bitbake_ver != bb.__version__:
+ logger.info('Bitbake version mismatch, rebuilding...')
+ return
+
+ # Load the rest of the cache file
+ current_progress = 0
+ while cachefile:
+ try:
+ key = pickled.load()
+ value = pickled.load()
+ except Exception:
+ break
+ if not isinstance(key, str):
+ bb.warn("%s from extras cache is not a string?" % key)
+ break
+ if not isinstance(value, RecipeInfoCommon):
+ bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value)
+ break
+
+ if key in self.depends_cache:
+ self.depends_cache[key].append(value)
+ else:
+ self.depends_cache[key] = [value]
+ # only fire events on even percentage boundaries
+ current_progress = cachefile.tell() + previous_progress
+ if current_progress > cachesize:
+ # we might have calculated incorrect total size because a file
+ # might've been written out just after we checked its size
+ cachesize = current_progress
+ current_percent = 100 * current_progress / cachesize
+ if current_percent > previous_percent:
+ previous_percent = current_percent
+ bb.event.fire(bb.event.CacheLoadProgress(current_progress, cachesize),
+ self.data)
+
+ previous_progress += current_progress
+
+ # Note: depends cache number is corresponding to the parsing file numbers.
+ # The same file has several caches, still regarded as one item in the cache
+ bb.event.fire(bb.event.CacheLoadCompleted(cachesize,
+ len(self.depends_cache)),
+ self.data)
+
+ def parse(self, filename, appends):
+ """Parse the specified filename, returning the recipe information"""
+ logger.debug(1, "Parsing %s", filename)
+ infos = []
+ datastores = self.load_bbfile(filename, appends)
+ depends = []
+ variants = []
+ # Process the "real" fn last so we can store variants list
+ for variant, data in sorted(datastores.items(),
+ key=lambda i: i[0],
+ reverse=True):
+ virtualfn = variant2virtual(filename, variant)
+ variants.append(variant)
+ depends = depends + (data.getVar("__depends", False) or [])
+ if depends and not variant:
+ data.setVar("__depends", depends)
+ if virtualfn == filename:
+ data.setVar("__VARIANTS", " ".join(variants))
+ info_array = []
+ for cache_class in self.caches_array:
+ info = cache_class(filename, data)
+ info_array.append(info)
+ infos.append((virtualfn, info_array))
+
+ return infos
+
+ def load(self, filename, appends):
+ """Obtain the recipe information for the specified filename,
+ using cached values if available, otherwise parsing.
+
+ Note that if it does parse to obtain the info, it will not
+ automatically add the information to the cache or to your
+ CacheData. Use the add or add_info method to do so after
+ running this, or use loadData instead."""
+ cached = self.cacheValid(filename, appends)
+ if cached:
+ infos = []
+ # info_array item is a list of [CoreRecipeInfo, XXXRecipeInfo]
+ info_array = self.depends_cache[filename]
+ for variant in info_array[0].variants:
+ virtualfn = variant2virtual(filename, variant)
+ infos.append((virtualfn, self.depends_cache[virtualfn]))
+ else:
+ return self.parse(filename, appends, configdata, self.caches_array)
+
+ return cached, infos
+
+ def loadData(self, fn, appends, cacheData):
+ """Load the recipe info for the specified filename,
+ parsing and adding to the cache if necessary, and adding
+ the recipe information to the supplied CacheData instance."""
+ skipped, virtuals = 0, 0
+
+ cached, infos = self.load(fn, appends)
+ for virtualfn, info_array in infos:
+ if info_array[0].skipped:
+ logger.debug(1, "Skipping %s: %s", virtualfn, info_array[0].skipreason)
+ skipped += 1
+ else:
+ self.add_info(virtualfn, info_array, cacheData, not cached)
+ virtuals += 1
+
+ return cached, skipped, virtuals
+
+ def cacheValid(self, fn, appends):
+ """
+ Is the cache valid for fn?
+ Fast version, no timestamps checked.
+ """
+ if fn not in self.checked:
+ self.cacheValidUpdate(fn, appends)
+
+ # Is cache enabled?
+ if not self.has_cache:
+ return False
+ if fn in self.clean:
+ return True
+ return False
+
+ def cacheValidUpdate(self, fn, appends):
+ """
+ Is the cache valid for fn?
+ Make thorough (slower) checks including timestamps.
+ """
+ # Is cache enabled?
+ if not self.has_cache:
+ return False
+
+ self.checked.add(fn)
+
+ # File isn't in depends_cache
+ if not fn in self.depends_cache:
+ logger.debug(2, "Cache: %s is not cached", fn)
+ return False
+
+ mtime = bb.parse.cached_mtime_noerror(fn)
+
+ # Check file still exists
+ if mtime == 0:
+ logger.debug(2, "Cache: %s no longer exists", fn)
+ self.remove(fn)
+ return False
+
+ info_array = self.depends_cache[fn]
+ # Check the file's timestamp
+ if mtime != info_array[0].timestamp:
+ logger.debug(2, "Cache: %s changed", fn)
+ self.remove(fn)
+ return False
+
+ # Check dependencies are still valid
+ depends = info_array[0].file_depends
+ if depends:
+ for f, old_mtime in depends:
+ fmtime = bb.parse.cached_mtime_noerror(f)
+ # Check if file still exists
+ if old_mtime != 0 and fmtime == 0:
+ logger.debug(2, "Cache: %s's dependency %s was removed",
+ fn, f)
+ self.remove(fn)
+ return False
+
+ if (fmtime != old_mtime):
+ logger.debug(2, "Cache: %s's dependency %s changed",
+ fn, f)
+ self.remove(fn)
+ return False
+
+ if hasattr(info_array[0], 'file_checksums'):
+ for _, fl in info_array[0].file_checksums.items():
+ fl = fl.strip()
+ while fl:
+ # A .split() would be simpler but means spaces or colons in filenames would break
+ a = fl.find(":True")
+ b = fl.find(":False")
+ if ((a < 0) and b) or ((b > 0) and (b < a)):
+ f = fl[:b+6]
+ fl = fl[b+7:]
+ elif ((b < 0) and a) or ((a > 0) and (a < b)):
+ f = fl[:a+5]
+ fl = fl[a+6:]
+ else:
+ break
+ fl = fl.strip()
+ if "*" in f:
+ continue
+ f, exist = f.split(":")
+ if (exist == "True" and not os.path.exists(f)) or (exist == "False" and os.path.exists(f)):
+ logger.debug(2, "Cache: %s's file checksum list file %s changed",
+ fn, f)
+ self.remove(fn)
+ return False
+
+ if appends != info_array[0].appends:
+ logger.debug(2, "Cache: appends for %s changed", fn)
+ logger.debug(2, "%s to %s" % (str(appends), str(info_array[0].appends)))
+ self.remove(fn)
+ return False
+
+ invalid = False
+ for cls in info_array[0].variants:
+ virtualfn = variant2virtual(fn, cls)
+ self.clean.add(virtualfn)
+ if virtualfn not in self.depends_cache:
+ logger.debug(2, "Cache: %s is not cached", virtualfn)
+ invalid = True
+ elif len(self.depends_cache[virtualfn]) != len(self.caches_array):
+ logger.debug(2, "Cache: Extra caches missing for %s?" % virtualfn)
+ invalid = True
+
+ # If any one of the variants is not present, mark as invalid for all
+ if invalid:
+ for cls in info_array[0].variants:
+ virtualfn = variant2virtual(fn, cls)
+ if virtualfn in self.clean:
+ logger.debug(2, "Cache: Removing %s from cache", virtualfn)
+ self.clean.remove(virtualfn)
+ if fn in self.clean:
+ logger.debug(2, "Cache: Marking %s as not clean", fn)
+ self.clean.remove(fn)
+ return False
+
+ self.clean.add(fn)
+ return True
+
+ def remove(self, fn):
+ """
+ Remove a fn from the cache
+ Called from the parser in error cases
+ """
+ if fn in self.depends_cache:
+ logger.debug(1, "Removing %s from cache", fn)
+ del self.depends_cache[fn]
+ if fn in self.clean:
+ logger.debug(1, "Marking %s as unclean", fn)
+ self.clean.remove(fn)
+
+ def sync(self):
+ """
+ Save the cache
+ Called from the parser when complete (or exiting)
+ """
+
+ if not self.has_cache:
+ return
+
+ if self.cacheclean:
+ logger.debug(2, "Cache is clean, not saving.")
+ return
+
+ for cache_class in self.caches_array:
+ cache_class_name = cache_class.__name__
+ cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
+ with open(cachefile, "wb") as f:
+ p = pickle.Pickler(f, pickle.HIGHEST_PROTOCOL)
+ p.dump(__cache_version__)
+ p.dump(bb.__version__)
+
+ for key, info_array in self.depends_cache.items():
+ for info in info_array:
+ if isinstance(info, RecipeInfoCommon) and info.__class__.__name__ == cache_class_name:
+ p.dump(key)
+ p.dump(info)
+
+ del self.depends_cache
+
+ @staticmethod
+ def mtime(cachefile):
+ return bb.parse.cached_mtime_noerror(cachefile)
+
+ def add_info(self, filename, info_array, cacheData, parsed=None, watcher=None):
+ if isinstance(info_array[0], CoreRecipeInfo) and (not info_array[0].skipped):
+ cacheData.add_from_recipeinfo(filename, info_array)
+
+ if watcher:
+ watcher(info_array[0].file_depends)
+
+ if not self.has_cache:
+ return
+
+ if (info_array[0].skipped or 'SRCREVINACTION' not in info_array[0].pv) and not info_array[0].nocache:
+ if parsed:
+ self.cacheclean = False
+ self.depends_cache[filename] = info_array
+
+ def add(self, file_name, data, cacheData, parsed=None):
+ """
+ Save data we need into the cache
+ """
+
+ realfn = virtualfn2realfn(file_name)[0]
+
+ info_array = []
+ for cache_class in self.caches_array:
+ info_array.append(cache_class(realfn, data))
+ self.add_info(file_name, info_array, cacheData, parsed)
+
+
+def init(cooker):
+ """
+ The Objective: Cache the minimum amount of data possible yet get to the
+ stage of building packages (i.e. tryBuild) without reparsing any .bb files.
+
+ To do this, we intercept getVar calls and only cache the variables we see
+ being accessed. We rely on the cache getVar calls being made for all
+ variables bitbake might need to use to reach this stage. For each cached
+ file we need to track:
+
+ * Its mtime
+ * The mtimes of all its dependencies
+ * Whether it caused a parse.SkipRecipe exception
+
+ Files causing parsing errors are evicted from the cache.
+
+ """
+ return Cache(cooker.configuration.data, cooker.configuration.data_hash)
+
+
+class CacheData(object):
+ """
+ The data structures we compile from the cached data
+ """
+
+ def __init__(self, caches_array):
+ self.caches_array = caches_array
+ for cache_class in self.caches_array:
+ if not issubclass(cache_class, RecipeInfoCommon):
+ bb.error("Extra cache data class %s should subclass RecipeInfoCommon class" % cache_class)
+ cache_class.init_cacheData(self)
+
+ # Direct cache variables
+ self.task_queues = {}
+ self.preferred = {}
+ self.tasks = {}
+ # Indirect Cache variables (set elsewhere)
+ self.ignored_dependencies = []
+ self.world_target = set()
+ self.bbfile_priority = {}
+
+ def add_from_recipeinfo(self, fn, info_array):
+ for info in info_array:
+ info.add_cacheData(self, fn)
+
+class MultiProcessCache(object):
+ """
+ BitBake multi-process cache implementation
+
+ Used by the codeparser & file checksum caches
+ """
+
+ def __init__(self):
+ self.cachefile = None
+ self.cachedata = self.create_cachedata()
+ self.cachedata_extras = self.create_cachedata()
+
+ def init_cache(self, d, cache_file_name=None):
+ cachedir = (d.getVar("PERSISTENT_DIR") or
+ d.getVar("CACHE"))
+ if cachedir in [None, '']:
+ return
+ bb.utils.mkdirhier(cachedir)
+ self.cachefile = os.path.join(cachedir,
+ cache_file_name or self.__class__.cache_file_name)
+ logger.debug(1, "Using cache in '%s'", self.cachefile)
+
+ glf = bb.utils.lockfile(self.cachefile + ".lock")
+
+ try:
+ with open(self.cachefile, "rb") as f:
+ p = pickle.Unpickler(f)
+ data, version = p.load()
+ except:
+ bb.utils.unlockfile(glf)
+ return
+
+ bb.utils.unlockfile(glf)
+
+ if version != self.__class__.CACHE_VERSION:
+ return
+
+ self.cachedata = data
+
+ def create_cachedata(self):
+ data = [{}]
+ return data
+
+ def save_extras(self):
+ if not self.cachefile:
+ return
+
+ glf = bb.utils.lockfile(self.cachefile + ".lock", shared=True)
+
+ i = os.getpid()
+ lf = None
+ while not lf:
+ lf = bb.utils.lockfile(self.cachefile + ".lock." + str(i), retry=False)
+ if not lf or os.path.exists(self.cachefile + "-" + str(i)):
+ if lf:
+ bb.utils.unlockfile(lf)
+ lf = None
+ i = i + 1
+ continue
+
+ with open(self.cachefile + "-" + str(i), "wb") as f:
+ p = pickle.Pickler(f, -1)
+ p.dump([self.cachedata_extras, self.__class__.CACHE_VERSION])
+
+ bb.utils.unlockfile(lf)
+ bb.utils.unlockfile(glf)
+
+ def merge_data(self, source, dest):
+ for j in range(0,len(dest)):
+ for h in source[j]:
+ if h not in dest[j]:
+ dest[j][h] = source[j][h]
+
+ def save_merge(self):
+ if not self.cachefile:
+ return
+
+ glf = bb.utils.lockfile(self.cachefile + ".lock")
+
+ data = self.cachedata
+
+ for f in [y for y in os.listdir(os.path.dirname(self.cachefile)) if y.startswith(os.path.basename(self.cachefile) + '-')]:
+ f = os.path.join(os.path.dirname(self.cachefile), f)
+ try:
+ with open(f, "rb") as fd:
+ p = pickle.Unpickler(fd)
+ extradata, version = p.load()
+ except (IOError, EOFError):
+ os.unlink(f)
+ continue
+
+ if version != self.__class__.CACHE_VERSION:
+ os.unlink(f)
+ continue
+
+ self.merge_data(extradata, data)
+ os.unlink(f)
+
+ with open(self.cachefile, "wb") as f:
+ p = pickle.Pickler(f, -1)
+ p.dump([data, self.__class__.CACHE_VERSION])
+
+ bb.utils.unlockfile(glf)
diff --git a/poky/bitbake/lib/bb/cache_extra.py b/poky/bitbake/lib/bb/cache_extra.py
new file mode 100644
index 000000000..83f4959d6
--- /dev/null
+++ b/poky/bitbake/lib/bb/cache_extra.py
@@ -0,0 +1,75 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Extra RecipeInfo will be all defined in this file. Currently,
+# Only Hob (Image Creator) Requests some extra fields. So
+# HobRecipeInfo is defined. It's named HobRecipeInfo because it
+# is introduced by 'hob'. Users could also introduce other
+# RecipeInfo or simply use those already defined RecipeInfo.
+# In the following patch, this newly defined new extra RecipeInfo
+# will be dynamically loaded and used for loading/saving the extra
+# cache fields
+
+# Copyright (C) 2011, Intel Corporation. All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from bb.cache import RecipeInfoCommon
+
+class HobRecipeInfo(RecipeInfoCommon):
+ __slots__ = ()
+
+ classname = "HobRecipeInfo"
+ # please override this member with the correct data cache file
+ # such as (bb_cache.dat, bb_extracache_hob.dat)
+ cachefile = "bb_extracache_" + classname +".dat"
+
+ # override this member with the list of extra cache fields
+ # that this class will provide
+ cachefields = ['summary', 'license', 'section',
+ 'description', 'homepage', 'bugtracker',
+ 'prevision', 'files_info']
+
+ def __init__(self, filename, metadata):
+
+ self.summary = self.getvar('SUMMARY', metadata)
+ self.license = self.getvar('LICENSE', metadata)
+ self.section = self.getvar('SECTION', metadata)
+ self.description = self.getvar('DESCRIPTION', metadata)
+ self.homepage = self.getvar('HOMEPAGE', metadata)
+ self.bugtracker = self.getvar('BUGTRACKER', metadata)
+ self.prevision = self.getvar('PR', metadata)
+ self.files_info = self.getvar('FILES_INFO', metadata)
+
+ @classmethod
+ def init_cacheData(cls, cachedata):
+ # CacheData in Hob RecipeInfo Class
+ cachedata.summary = {}
+ cachedata.license = {}
+ cachedata.section = {}
+ cachedata.description = {}
+ cachedata.homepage = {}
+ cachedata.bugtracker = {}
+ cachedata.prevision = {}
+ cachedata.files_info = {}
+
+ def add_cacheData(self, cachedata, fn):
+ cachedata.summary[fn] = self.summary
+ cachedata.license[fn] = self.license
+ cachedata.section[fn] = self.section
+ cachedata.description[fn] = self.description
+ cachedata.homepage[fn] = self.homepage
+ cachedata.bugtracker[fn] = self.bugtracker
+ cachedata.prevision[fn] = self.prevision
+ cachedata.files_info[fn] = self.files_info
diff --git a/poky/bitbake/lib/bb/checksum.py b/poky/bitbake/lib/bb/checksum.py
new file mode 100644
index 000000000..84289208f
--- /dev/null
+++ b/poky/bitbake/lib/bb/checksum.py
@@ -0,0 +1,134 @@
+# Local file checksum cache implementation
+#
+# Copyright (C) 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import glob
+import operator
+import os
+import stat
+import pickle
+import bb.utils
+import logging
+from bb.cache import MultiProcessCache
+
+logger = logging.getLogger("BitBake.Cache")
+
+# mtime cache (non-persistent)
+# based upon the assumption that files do not change during bitbake run
+class FileMtimeCache(object):
+ cache = {}
+
+ def cached_mtime(self, f):
+ if f not in self.cache:
+ self.cache[f] = os.stat(f)[stat.ST_MTIME]
+ return self.cache[f]
+
+ def cached_mtime_noerror(self, f):
+ if f not in self.cache:
+ try:
+ self.cache[f] = os.stat(f)[stat.ST_MTIME]
+ except OSError:
+ return 0
+ return self.cache[f]
+
+ def update_mtime(self, f):
+ self.cache[f] = os.stat(f)[stat.ST_MTIME]
+ return self.cache[f]
+
+ def clear(self):
+ self.cache.clear()
+
+# Checksum + mtime cache (persistent)
+class FileChecksumCache(MultiProcessCache):
+ cache_file_name = "local_file_checksum_cache.dat"
+ CACHE_VERSION = 1
+
+ def __init__(self):
+ self.mtime_cache = FileMtimeCache()
+ MultiProcessCache.__init__(self)
+
+ def get_checksum(self, f):
+ entry = self.cachedata[0].get(f)
+ cmtime = self.mtime_cache.cached_mtime(f)
+ if entry:
+ (mtime, hashval) = entry
+ if cmtime == mtime:
+ return hashval
+ else:
+ bb.debug(2, "file %s changed mtime, recompute checksum" % f)
+
+ hashval = bb.utils.md5_file(f)
+ self.cachedata_extras[0][f] = (cmtime, hashval)
+ return hashval
+
+ def merge_data(self, source, dest):
+ for h in source[0]:
+ if h in dest:
+ (smtime, _) = source[0][h]
+ (dmtime, _) = dest[0][h]
+ if smtime > dmtime:
+ dest[0][h] = source[0][h]
+ else:
+ dest[0][h] = source[0][h]
+
+ def get_checksums(self, filelist, pn):
+ """Get checksums for a list of files"""
+
+ def checksum_file(f):
+ try:
+ checksum = self.get_checksum(f)
+ except OSError as e:
+ bb.warn("Unable to get checksum for %s SRC_URI entry %s: %s" % (pn, os.path.basename(f), e))
+ return None
+ return checksum
+
+ def checksum_dir(pth):
+ # Handle directories recursively
+ dirchecksums = []
+ for root, dirs, files in os.walk(pth):
+ for name in files:
+ fullpth = os.path.join(root, name)
+ checksum = checksum_file(fullpth)
+ if checksum:
+ dirchecksums.append((fullpth, checksum))
+ return dirchecksums
+
+ checksums = []
+ for pth in filelist.split():
+ exist = pth.split(":")[1]
+ if exist == "False":
+ continue
+ pth = pth.split(":")[0]
+ if '*' in pth:
+ # Handle globs
+ for f in glob.glob(pth):
+ if os.path.isdir(f):
+ if not os.path.islink(f):
+ checksums.extend(checksum_dir(f))
+ else:
+ checksum = checksum_file(f)
+ if checksum:
+ checksums.append((f, checksum))
+ elif os.path.isdir(pth):
+ if not os.path.islink(pth):
+ checksums.extend(checksum_dir(pth))
+ else:
+ checksum = checksum_file(pth)
+ if checksum:
+ checksums.append((pth, checksum))
+
+ checksums.sort(key=operator.itemgetter(1))
+ return checksums
diff --git a/poky/bitbake/lib/bb/codeparser.py b/poky/bitbake/lib/bb/codeparser.py
new file mode 100644
index 000000000..530f44e57
--- /dev/null
+++ b/poky/bitbake/lib/bb/codeparser.py
@@ -0,0 +1,476 @@
+"""
+BitBake code parser
+
+Parses actual code (i.e. python and shell) for functions and in-line
+expressions. Used mainly to determine dependencies on other functions
+and variables within the BitBake metadata. Also provides a cache for
+this information in order to speed up processing.
+
+(Not to be confused with the code that parses the metadata itself,
+see lib/bb/parse/ for that).
+
+NOTE: if you change how the parsers gather information you will almost
+certainly need to increment CodeParserCache.CACHE_VERSION below so that
+any existing codeparser cache gets invalidated. Additionally you'll need
+to increment __cache_version__ in cache.py in order to ensure that old
+recipe caches don't trigger "Taskhash mismatch" errors.
+
+"""
+
+import ast
+import sys
+import codegen
+import logging
+import pickle
+import bb.pysh as pysh
+import os.path
+import bb.utils, bb.data
+import hashlib
+from itertools import chain
+from bb.pysh import pyshyacc, pyshlex, sherrors
+from bb.cache import MultiProcessCache
+
+logger = logging.getLogger('BitBake.CodeParser')
+
+def bbhash(s):
+ return hashlib.md5(s.encode("utf-8")).hexdigest()
+
+def check_indent(codestr):
+ """If the code is indented, add a top level piece of code to 'remove' the indentation"""
+
+ i = 0
+ while codestr[i] in ["\n", "\t", " "]:
+ i = i + 1
+
+ if i == 0:
+ return codestr
+
+ if codestr[i-1] == "\t" or codestr[i-1] == " ":
+ if codestr[0] == "\n":
+ # Since we're adding a line, we need to remove one line of any empty padding
+ # to ensure line numbers are correct
+ codestr = codestr[1:]
+ return "if 1:\n" + codestr
+
+ return codestr
+
+
+# Basically pickle, in python 2.7.3 at least, does badly with data duplication
+# upon pickling and unpickling. Combine this with duplicate objects and things
+# are a mess.
+#
+# When the sets are originally created, python calls intern() on the set keys
+# which significantly improves memory usage. Sadly the pickle/unpickle process
+# doesn't call intern() on the keys and results in the same strings being duplicated
+# in memory. This also means pickle will save the same string multiple times in
+# the cache file.
+#
+# By having shell and python cacheline objects with setstate/getstate, we force
+# the object creation through our own routine where we can call intern (via internSet).
+#
+# We also use hashable frozensets and ensure we use references to these so that
+# duplicates can be removed, both in memory and in the resulting pickled data.
+#
+# By playing these games, the size of the cache file shrinks dramatically
+# meaning faster load times and the reloaded cache files also consume much less
+# memory. Smaller cache files, faster load times and lower memory usage is good.
+#
+# A custom getstate/setstate using tuples is actually worth 15% cachesize by
+# avoiding duplication of the attribute names!
+
+class SetCache(object):
+ def __init__(self):
+ self.setcache = {}
+
+ def internSet(self, items):
+
+ new = []
+ for i in items:
+ new.append(sys.intern(i))
+ s = frozenset(new)
+ h = hash(s)
+ if h in self.setcache:
+ return self.setcache[h]
+ self.setcache[h] = s
+ return s
+
+codecache = SetCache()
+
+class pythonCacheLine(object):
+ def __init__(self, refs, execs, contains):
+ self.refs = codecache.internSet(refs)
+ self.execs = codecache.internSet(execs)
+ self.contains = {}
+ for c in contains:
+ self.contains[c] = codecache.internSet(contains[c])
+
+ def __getstate__(self):
+ return (self.refs, self.execs, self.contains)
+
+ def __setstate__(self, state):
+ (refs, execs, contains) = state
+ self.__init__(refs, execs, contains)
+ def __hash__(self):
+ l = (hash(self.refs), hash(self.execs))
+ for c in sorted(self.contains.keys()):
+ l = l + (c, hash(self.contains[c]))
+ return hash(l)
+ def __repr__(self):
+ return " ".join([str(self.refs), str(self.execs), str(self.contains)])
+
+
+class shellCacheLine(object):
+ def __init__(self, execs):
+ self.execs = codecache.internSet(execs)
+
+ def __getstate__(self):
+ return (self.execs)
+
+ def __setstate__(self, state):
+ (execs) = state
+ self.__init__(execs)
+ def __hash__(self):
+ return hash(self.execs)
+ def __repr__(self):
+ return str(self.execs)
+
+class CodeParserCache(MultiProcessCache):
+ cache_file_name = "bb_codeparser.dat"
+ # NOTE: you must increment this if you change how the parsers gather information,
+ # so that an existing cache gets invalidated. Additionally you'll need
+ # to increment __cache_version__ in cache.py in order to ensure that old
+ # recipe caches don't trigger "Taskhash mismatch" errors.
+ CACHE_VERSION = 9
+
+ def __init__(self):
+ MultiProcessCache.__init__(self)
+ self.pythoncache = self.cachedata[0]
+ self.shellcache = self.cachedata[1]
+ self.pythoncacheextras = self.cachedata_extras[0]
+ self.shellcacheextras = self.cachedata_extras[1]
+
+ # To avoid duplication in the codeparser cache, keep
+ # a lookup of hashes of objects we already have
+ self.pythoncachelines = {}
+ self.shellcachelines = {}
+
+ def newPythonCacheLine(self, refs, execs, contains):
+ cacheline = pythonCacheLine(refs, execs, contains)
+ h = hash(cacheline)
+ if h in self.pythoncachelines:
+ return self.pythoncachelines[h]
+ self.pythoncachelines[h] = cacheline
+ return cacheline
+
+ def newShellCacheLine(self, execs):
+ cacheline = shellCacheLine(execs)
+ h = hash(cacheline)
+ if h in self.shellcachelines:
+ return self.shellcachelines[h]
+ self.shellcachelines[h] = cacheline
+ return cacheline
+
+ def init_cache(self, d):
+ # Check if we already have the caches
+ if self.pythoncache:
+ return
+
+ MultiProcessCache.init_cache(self, d)
+
+ # cachedata gets re-assigned in the parent
+ self.pythoncache = self.cachedata[0]
+ self.shellcache = self.cachedata[1]
+
+ def create_cachedata(self):
+ data = [{}, {}]
+ return data
+
+codeparsercache = CodeParserCache()
+
+def parser_cache_init(d):
+ codeparsercache.init_cache(d)
+
+def parser_cache_save():
+ codeparsercache.save_extras()
+
+def parser_cache_savemerge():
+ codeparsercache.save_merge()
+
+Logger = logging.getLoggerClass()
+class BufferedLogger(Logger):
+ def __init__(self, name, level=0, target=None):
+ Logger.__init__(self, name)
+ self.setLevel(level)
+ self.buffer = []
+ self.target = target
+
+ def handle(self, record):
+ self.buffer.append(record)
+
+ def flush(self):
+ for record in self.buffer:
+ if self.target.isEnabledFor(record.levelno):
+ self.target.handle(record)
+ self.buffer = []
+
+class PythonParser():
+ getvars = (".getVar", ".appendVar", ".prependVar")
+ getvarflags = (".getVarFlag", ".appendVarFlag", ".prependVarFlag")
+ containsfuncs = ("bb.utils.contains", "base_contains")
+ containsanyfuncs = ("bb.utils.contains_any", "bb.utils.filter")
+ execfuncs = ("bb.build.exec_func", "bb.build.exec_task")
+
+ def warn(self, func, arg):
+ """Warn about calls of bitbake APIs which pass a non-literal
+ argument for the variable name, as we're not able to track such
+ a reference.
+ """
+
+ try:
+ funcstr = codegen.to_source(func)
+ argstr = codegen.to_source(arg)
+ except TypeError:
+ self.log.debug(2, 'Failed to convert function and argument to source form')
+ else:
+ self.log.debug(1, self.unhandled_message % (funcstr, argstr))
+
+ def visit_Call(self, node):
+ name = self.called_node_name(node.func)
+ if name and (name.endswith(self.getvars) or name.endswith(self.getvarflags) or name in self.containsfuncs or name in self.containsanyfuncs):
+ if isinstance(node.args[0], ast.Str):
+ varname = node.args[0].s
+ if name in self.containsfuncs and isinstance(node.args[1], ast.Str):
+ if varname not in self.contains:
+ self.contains[varname] = set()
+ self.contains[varname].add(node.args[1].s)
+ elif name in self.containsanyfuncs and isinstance(node.args[1], ast.Str):
+ if varname not in self.contains:
+ self.contains[varname] = set()
+ self.contains[varname].update(node.args[1].s.split())
+ elif name.endswith(self.getvarflags):
+ if isinstance(node.args[1], ast.Str):
+ self.references.add('%s[%s]' % (varname, node.args[1].s))
+ else:
+ self.warn(node.func, node.args[1])
+ else:
+ self.references.add(varname)
+ else:
+ self.warn(node.func, node.args[0])
+ elif name and name.endswith(".expand"):
+ if isinstance(node.args[0], ast.Str):
+ value = node.args[0].s
+ d = bb.data.init()
+ parser = d.expandWithRefs(value, self.name)
+ self.references |= parser.references
+ self.execs |= parser.execs
+ for varname in parser.contains:
+ if varname not in self.contains:
+ self.contains[varname] = set()
+ self.contains[varname] |= parser.contains[varname]
+ elif name in self.execfuncs:
+ if isinstance(node.args[0], ast.Str):
+ self.var_execs.add(node.args[0].s)
+ else:
+ self.warn(node.func, node.args[0])
+ elif name and isinstance(node.func, (ast.Name, ast.Attribute)):
+ self.execs.add(name)
+
+ def called_node_name(self, node):
+ """Given a called node, return its original string form"""
+ components = []
+ while node:
+ if isinstance(node, ast.Attribute):
+ components.append(node.attr)
+ node = node.value
+ elif isinstance(node, ast.Name):
+ components.append(node.id)
+ return '.'.join(reversed(components))
+ else:
+ break
+
+ def __init__(self, name, log):
+ self.name = name
+ self.var_execs = set()
+ self.contains = {}
+ self.execs = set()
+ self.references = set()
+ self.log = BufferedLogger('BitBake.Data.PythonParser', logging.DEBUG, log)
+
+ self.unhandled_message = "in call of %s, argument '%s' is not a string literal"
+ self.unhandled_message = "while parsing %s, %s" % (name, self.unhandled_message)
+
+ def parse_python(self, node, lineno=0, filename="<string>"):
+ if not node or not node.strip():
+ return
+
+ h = bbhash(str(node))
+
+ if h in codeparsercache.pythoncache:
+ self.references = set(codeparsercache.pythoncache[h].refs)
+ self.execs = set(codeparsercache.pythoncache[h].execs)
+ self.contains = {}
+ for i in codeparsercache.pythoncache[h].contains:
+ self.contains[i] = set(codeparsercache.pythoncache[h].contains[i])
+ return
+
+ if h in codeparsercache.pythoncacheextras:
+ self.references = set(codeparsercache.pythoncacheextras[h].refs)
+ self.execs = set(codeparsercache.pythoncacheextras[h].execs)
+ self.contains = {}
+ for i in codeparsercache.pythoncacheextras[h].contains:
+ self.contains[i] = set(codeparsercache.pythoncacheextras[h].contains[i])
+ return
+
+ # We can't add to the linenumbers for compile, we can pad to the correct number of blank lines though
+ node = "\n" * int(lineno) + node
+ code = compile(check_indent(str(node)), filename, "exec",
+ ast.PyCF_ONLY_AST)
+
+ for n in ast.walk(code):
+ if n.__class__.__name__ == "Call":
+ self.visit_Call(n)
+
+ self.execs.update(self.var_execs)
+
+ codeparsercache.pythoncacheextras[h] = codeparsercache.newPythonCacheLine(self.references, self.execs, self.contains)
+
+class ShellParser():
+ def __init__(self, name, log):
+ self.funcdefs = set()
+ self.allexecs = set()
+ self.execs = set()
+ self.log = BufferedLogger('BitBake.Data.%s' % name, logging.DEBUG, log)
+ self.unhandled_template = "unable to handle non-literal command '%s'"
+ self.unhandled_template = "while parsing %s, %s" % (name, self.unhandled_template)
+
+ def parse_shell(self, value):
+ """Parse the supplied shell code in a string, returning the external
+ commands it executes.
+ """
+
+ h = bbhash(str(value))
+
+ if h in codeparsercache.shellcache:
+ self.execs = set(codeparsercache.shellcache[h].execs)
+ return self.execs
+
+ if h in codeparsercache.shellcacheextras:
+ self.execs = set(codeparsercache.shellcacheextras[h].execs)
+ return self.execs
+
+ self._parse_shell(value)
+ self.execs = set(cmd for cmd in self.allexecs if cmd not in self.funcdefs)
+
+ codeparsercache.shellcacheextras[h] = codeparsercache.newShellCacheLine(self.execs)
+
+ return self.execs
+
+ def _parse_shell(self, value):
+ try:
+ tokens, _ = pyshyacc.parse(value, eof=True, debug=False)
+ except pyshlex.NeedMore:
+ raise sherrors.ShellSyntaxError("Unexpected EOF")
+
+ self.process_tokens(tokens)
+
+ def process_tokens(self, tokens):
+ """Process a supplied portion of the syntax tree as returned by
+ pyshyacc.parse.
+ """
+
+ def function_definition(value):
+ self.funcdefs.add(value.name)
+ return [value.body], None
+
+ def case_clause(value):
+ # Element 0 of each item in the case is the list of patterns, and
+ # Element 1 of each item in the case is the list of commands to be
+ # executed when that pattern matches.
+ words = chain(*[item[0] for item in value.items])
+ cmds = chain(*[item[1] for item in value.items])
+ return cmds, words
+
+ def if_clause(value):
+ main = chain(value.cond, value.if_cmds)
+ rest = value.else_cmds
+ if isinstance(rest, tuple) and rest[0] == "elif":
+ return chain(main, if_clause(rest[1]))
+ else:
+ return chain(main, rest)
+
+ def simple_command(value):
+ return None, chain(value.words, (assign[1] for assign in value.assigns))
+
+ token_handlers = {
+ "and_or": lambda x: ((x.left, x.right), None),
+ "async": lambda x: ([x], None),
+ "brace_group": lambda x: (x.cmds, None),
+ "for_clause": lambda x: (x.cmds, x.items),
+ "function_definition": function_definition,
+ "if_clause": lambda x: (if_clause(x), None),
+ "pipeline": lambda x: (x.commands, None),
+ "redirect_list": lambda x: ([x.cmd], None),
+ "subshell": lambda x: (x.cmds, None),
+ "while_clause": lambda x: (chain(x.condition, x.cmds), None),
+ "until_clause": lambda x: (chain(x.condition, x.cmds), None),
+ "simple_command": simple_command,
+ "case_clause": case_clause,
+ }
+
+ def process_token_list(tokens):
+ for token in tokens:
+ if isinstance(token, list):
+ process_token_list(token)
+ continue
+ name, value = token
+ try:
+ more_tokens, words = token_handlers[name](value)
+ except KeyError:
+ raise NotImplementedError("Unsupported token type " + name)
+
+ if more_tokens:
+ self.process_tokens(more_tokens)
+
+ if words:
+ self.process_words(words)
+
+ process_token_list(tokens)
+
+ def process_words(self, words):
+ """Process a set of 'words' in pyshyacc parlance, which includes
+ extraction of executed commands from $() blocks, as well as grabbing
+ the command name argument.
+ """
+
+ words = list(words)
+ for word in list(words):
+ wtree = pyshlex.make_wordtree(word[1])
+ for part in wtree:
+ if not isinstance(part, list):
+ continue
+
+ if part[0] in ('`', '$('):
+ command = pyshlex.wordtree_as_string(part[1:-1])
+ self._parse_shell(command)
+
+ if word[0] in ("cmd_name", "cmd_word"):
+ if word in words:
+ words.remove(word)
+
+ usetoken = False
+ for word in words:
+ if word[0] in ("cmd_name", "cmd_word") or \
+ (usetoken and word[0] == "TOKEN"):
+ if "=" in word[1]:
+ usetoken = True
+ continue
+
+ cmd = word[1]
+ if cmd.startswith("$"):
+ self.log.debug(1, self.unhandled_template % cmd)
+ elif cmd == "eval":
+ command = " ".join(word for _, word in words[1:])
+ self._parse_shell(command)
+ else:
+ self.allexecs.add(cmd)
+ break
diff --git a/poky/bitbake/lib/bb/command.py b/poky/bitbake/lib/bb/command.py
new file mode 100644
index 000000000..6c966e3db
--- /dev/null
+++ b/poky/bitbake/lib/bb/command.py
@@ -0,0 +1,765 @@
+"""
+BitBake 'Command' module
+
+Provide an interface to interact with the bitbake server through 'commands'
+"""
+
+# Copyright (C) 2006-2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+The bitbake server takes 'commands' from its UI/commandline.
+Commands are either synchronous or asynchronous.
+Async commands return data to the client in the form of events.
+Sync commands must only return data through the function return value
+and must not trigger events, directly or indirectly.
+Commands are queued in a CommandQueue
+"""
+
+from collections import OrderedDict, defaultdict
+
+import bb.event
+import bb.cooker
+import bb.remotedata
+
+class DataStoreConnectionHandle(object):
+ def __init__(self, dsindex=0):
+ self.dsindex = dsindex
+
+class CommandCompleted(bb.event.Event):
+ pass
+
+class CommandExit(bb.event.Event):
+ def __init__(self, exitcode):
+ bb.event.Event.__init__(self)
+ self.exitcode = int(exitcode)
+
+class CommandFailed(CommandExit):
+ def __init__(self, message):
+ self.error = message
+ CommandExit.__init__(self, 1)
+ def __str__(self):
+ return "Command execution failed: %s" % self.error
+
+class CommandError(Exception):
+ pass
+
+class Command:
+ """
+ A queue of asynchronous commands for bitbake
+ """
+ def __init__(self, cooker):
+ self.cooker = cooker
+ self.cmds_sync = CommandsSync()
+ self.cmds_async = CommandsAsync()
+ self.remotedatastores = bb.remotedata.RemoteDatastores(cooker)
+
+ # FIXME Add lock for this
+ self.currentAsyncCommand = None
+
+ def runCommand(self, commandline, ro_only = False):
+ command = commandline.pop(0)
+ if hasattr(CommandsSync, command):
+ # Can run synchronous commands straight away
+ command_method = getattr(self.cmds_sync, command)
+ if ro_only:
+ if not hasattr(command_method, 'readonly') or False == getattr(command_method, 'readonly'):
+ return None, "Not able to execute not readonly commands in readonly mode"
+ try:
+ self.cooker.process_inotify_updates()
+ if getattr(command_method, 'needconfig', True):
+ self.cooker.updateCacheSync()
+ result = command_method(self, commandline)
+ except CommandError as exc:
+ return None, exc.args[0]
+ except (Exception, SystemExit):
+ import traceback
+ return None, traceback.format_exc()
+ else:
+ return result, None
+ if self.currentAsyncCommand is not None:
+ return None, "Busy (%s in progress)" % self.currentAsyncCommand[0]
+ if command not in CommandsAsync.__dict__:
+ return None, "No such command"
+ self.currentAsyncCommand = (command, commandline)
+ self.cooker.configuration.server_register_idlecallback(self.cooker.runCommands, self.cooker)
+ return True, None
+
+ def runAsyncCommand(self):
+ try:
+ self.cooker.process_inotify_updates()
+ if self.cooker.state in (bb.cooker.state.error, bb.cooker.state.shutdown, bb.cooker.state.forceshutdown):
+ # updateCache will trigger a shutdown of the parser
+ # and then raise BBHandledException triggering an exit
+ self.cooker.updateCache()
+ return False
+ if self.currentAsyncCommand is not None:
+ (command, options) = self.currentAsyncCommand
+ commandmethod = getattr(CommandsAsync, command)
+ needcache = getattr( commandmethod, "needcache" )
+ if needcache and self.cooker.state != bb.cooker.state.running:
+ self.cooker.updateCache()
+ return True
+ else:
+ commandmethod(self.cmds_async, self, options)
+ return False
+ else:
+ return False
+ except KeyboardInterrupt as exc:
+ self.finishAsyncCommand("Interrupted")
+ return False
+ except SystemExit as exc:
+ arg = exc.args[0]
+ if isinstance(arg, str):
+ self.finishAsyncCommand(arg)
+ else:
+ self.finishAsyncCommand("Exited with %s" % arg)
+ return False
+ except Exception as exc:
+ import traceback
+ if isinstance(exc, bb.BBHandledException):
+ self.finishAsyncCommand("")
+ else:
+ self.finishAsyncCommand(traceback.format_exc())
+ return False
+
+ def finishAsyncCommand(self, msg=None, code=None):
+ if msg or msg == "":
+ bb.event.fire(CommandFailed(msg), self.cooker.data)
+ elif code:
+ bb.event.fire(CommandExit(code), self.cooker.data)
+ else:
+ bb.event.fire(CommandCompleted(), self.cooker.data)
+ self.currentAsyncCommand = None
+ self.cooker.finishcommand()
+
+ def reset(self):
+ self.remotedatastores = bb.remotedata.RemoteDatastores(self.cooker)
+
+def split_mc_pn(pn):
+ if pn.startswith("multiconfig:"):
+ _, mc, pn = pn.split(":", 2)
+ return (mc, pn)
+ return ('', pn)
+
+class CommandsSync:
+ """
+ A class of synchronous commands
+ These should run quickly so as not to hurt interactive performance.
+ These must not influence any running synchronous command.
+ """
+
+ def stateShutdown(self, command, params):
+ """
+ Trigger cooker 'shutdown' mode
+ """
+ command.cooker.shutdown(False)
+
+ def stateForceShutdown(self, command, params):
+ """
+ Stop the cooker
+ """
+ command.cooker.shutdown(True)
+
+ def getAllKeysWithFlags(self, command, params):
+ """
+ Returns a dump of the global state. Call with
+ variable flags to be retrieved as params.
+ """
+ flaglist = params[0]
+ return command.cooker.getAllKeysWithFlags(flaglist)
+ getAllKeysWithFlags.readonly = True
+
+ def getVariable(self, command, params):
+ """
+ Read the value of a variable from data
+ """
+ varname = params[0]
+ expand = True
+ if len(params) > 1:
+ expand = (params[1] == "True")
+
+ return command.cooker.data.getVar(varname, expand)
+ getVariable.readonly = True
+
+ def setVariable(self, command, params):
+ """
+ Set the value of variable in data
+ """
+ varname = params[0]
+ value = str(params[1])
+ command.cooker.extraconfigdata[varname] = value
+ command.cooker.data.setVar(varname, value)
+
+ def getSetVariable(self, command, params):
+ """
+ Read the value of a variable from data and set it into the datastore
+ which effectively expands and locks the value.
+ """
+ varname = params[0]
+ result = self.getVariable(command, params)
+ command.cooker.data.setVar(varname, result)
+ return result
+
+ def setConfig(self, command, params):
+ """
+ Set the value of variable in configuration
+ """
+ varname = params[0]
+ value = str(params[1])
+ setattr(command.cooker.configuration, varname, value)
+
+ def enableDataTracking(self, command, params):
+ """
+ Enable history tracking for variables
+ """
+ command.cooker.enableDataTracking()
+
+ def disableDataTracking(self, command, params):
+ """
+ Disable history tracking for variables
+ """
+ command.cooker.disableDataTracking()
+
+ def setPrePostConfFiles(self, command, params):
+ prefiles = params[0].split()
+ postfiles = params[1].split()
+ command.cooker.configuration.prefile = prefiles
+ command.cooker.configuration.postfile = postfiles
+ setPrePostConfFiles.needconfig = False
+
+ def matchFile(self, command, params):
+ fMatch = params[0]
+ return command.cooker.matchFile(fMatch)
+ matchFile.needconfig = False
+
+ def getUIHandlerNum(self, command, params):
+ return bb.event.get_uihandler()
+ getUIHandlerNum.needconfig = False
+ getUIHandlerNum.readonly = True
+
+ def setEventMask(self, command, params):
+ handlerNum = params[0]
+ llevel = params[1]
+ debug_domains = params[2]
+ mask = params[3]
+ return bb.event.set_UIHmask(handlerNum, llevel, debug_domains, mask)
+ setEventMask.needconfig = False
+ setEventMask.readonly = True
+
+ def setFeatures(self, command, params):
+ """
+ Set the cooker features to include the passed list of features
+ """
+ features = params[0]
+ command.cooker.setFeatures(features)
+ setFeatures.needconfig = False
+ # although we change the internal state of the cooker, this is transparent since
+ # we always take and leave the cooker in state.initial
+ setFeatures.readonly = True
+
+ def updateConfig(self, command, params):
+ options = params[0]
+ environment = params[1]
+ cmdline = params[2]
+ command.cooker.updateConfigOpts(options, environment, cmdline)
+ updateConfig.needconfig = False
+
+ def parseConfiguration(self, command, params):
+ """Instruct bitbake to parse its configuration
+ NOTE: it is only necessary to call this if you aren't calling any normal action
+ (otherwise parsing is taken care of automatically)
+ """
+ command.cooker.parseConfiguration()
+ parseConfiguration.needconfig = False
+
+ def getLayerPriorities(self, command, params):
+ command.cooker.parseConfiguration()
+ ret = []
+ # regex objects cannot be marshalled by xmlrpc
+ for collection, pattern, regex, pri in command.cooker.bbfile_config_priorities:
+ ret.append((collection, pattern, regex.pattern, pri))
+ return ret
+ getLayerPriorities.readonly = True
+
+ def getRecipes(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return list(command.cooker.recipecaches[mc].pkg_pn.items())
+ getRecipes.readonly = True
+
+ def getRecipeDepends(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return list(command.cooker.recipecaches[mc].deps.items())
+ getRecipeDepends.readonly = True
+
+ def getRecipeVersions(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].pkg_pepvpr
+ getRecipeVersions.readonly = True
+
+ def getRecipeProvides(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].fn_provides
+ getRecipeProvides.readonly = True
+
+ def getRecipePackages(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].packages
+ getRecipePackages.readonly = True
+
+ def getRecipePackagesDynamic(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].packages_dynamic
+ getRecipePackagesDynamic.readonly = True
+
+ def getRProviders(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].rproviders
+ getRProviders.readonly = True
+
+ def getRuntimeDepends(self, command, params):
+ ret = []
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ rundeps = command.cooker.recipecaches[mc].rundeps
+ for key, value in rundeps.items():
+ if isinstance(value, defaultdict):
+ value = dict(value)
+ ret.append((key, value))
+ return ret
+ getRuntimeDepends.readonly = True
+
+ def getRuntimeRecommends(self, command, params):
+ ret = []
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ runrecs = command.cooker.recipecaches[mc].runrecs
+ for key, value in runrecs.items():
+ if isinstance(value, defaultdict):
+ value = dict(value)
+ ret.append((key, value))
+ return ret
+ getRuntimeRecommends.readonly = True
+
+ def getRecipeInherits(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].inherits
+ getRecipeInherits.readonly = True
+
+ def getBbFilePriority(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].bbfile_priority
+ getBbFilePriority.readonly = True
+
+ def getDefaultPreference(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return command.cooker.recipecaches[mc].pkg_dp
+ getDefaultPreference.readonly = True
+
+ def getSkippedRecipes(self, command, params):
+ # Return list sorted by reverse priority order
+ import bb.cache
+ skipdict = OrderedDict(sorted(command.cooker.skiplist.items(),
+ key=lambda x: (-command.cooker.collection.calc_bbfile_priority(bb.cache.virtualfn2realfn(x[0])[0]), x[0])))
+ return list(skipdict.items())
+ getSkippedRecipes.readonly = True
+
+ def getOverlayedRecipes(self, command, params):
+ return list(command.cooker.collection.overlayed.items())
+ getOverlayedRecipes.readonly = True
+
+ def getFileAppends(self, command, params):
+ fn = params[0]
+ return command.cooker.collection.get_file_appends(fn)
+ getFileAppends.readonly = True
+
+ def getAllAppends(self, command, params):
+ return command.cooker.collection.bbappends
+ getAllAppends.readonly = True
+
+ def findProviders(self, command, params):
+ return command.cooker.findProviders()
+ findProviders.readonly = True
+
+ def findBestProvider(self, command, params):
+ (mc, pn) = split_mc_pn(params[0])
+ return command.cooker.findBestProvider(pn, mc)
+ findBestProvider.readonly = True
+
+ def allProviders(self, command, params):
+ try:
+ mc = params[0]
+ except IndexError:
+ mc = ''
+ return list(bb.providers.allProviders(command.cooker.recipecaches[mc]).items())
+ allProviders.readonly = True
+
+ def getRuntimeProviders(self, command, params):
+ rprovide = params[0]
+ try:
+ mc = params[1]
+ except IndexError:
+ mc = ''
+ all_p = bb.providers.getRuntimeProviders(command.cooker.recipecaches[mc], rprovide)
+ if all_p:
+ best = bb.providers.filterProvidersRunTime(all_p, rprovide,
+ command.cooker.data,
+ command.cooker.recipecaches[mc])[0][0]
+ else:
+ best = None
+ return all_p, best
+ getRuntimeProviders.readonly = True
+
+ def dataStoreConnectorFindVar(self, command, params):
+ dsindex = params[0]
+ name = params[1]
+ datastore = command.remotedatastores[dsindex]
+ value, overridedata = datastore._findVar(name)
+
+ if value:
+ content = value.get('_content', None)
+ if isinstance(content, bb.data_smart.DataSmart):
+ # Value is a datastore (e.g. BB_ORIGENV) - need to handle this carefully
+ idx = command.remotedatastores.check_store(content, True)
+ return {'_content': DataStoreConnectionHandle(idx),
+ '_connector_origtype': 'DataStoreConnectionHandle',
+ '_connector_overrides': overridedata}
+ elif isinstance(content, set):
+ return {'_content': list(content),
+ '_connector_origtype': 'set',
+ '_connector_overrides': overridedata}
+ else:
+ value['_connector_overrides'] = overridedata
+ else:
+ value = {}
+ value['_connector_overrides'] = overridedata
+ return value
+ dataStoreConnectorFindVar.readonly = True
+
+ def dataStoreConnectorGetKeys(self, command, params):
+ dsindex = params[0]
+ datastore = command.remotedatastores[dsindex]
+ return list(datastore.keys())
+ dataStoreConnectorGetKeys.readonly = True
+
+ def dataStoreConnectorGetVarHistory(self, command, params):
+ dsindex = params[0]
+ name = params[1]
+ datastore = command.remotedatastores[dsindex]
+ return datastore.varhistory.variable(name)
+ dataStoreConnectorGetVarHistory.readonly = True
+
+ def dataStoreConnectorExpandPythonRef(self, command, params):
+ config_data_dict = params[0]
+ varname = params[1]
+ expr = params[2]
+
+ config_data = command.remotedatastores.receive_datastore(config_data_dict)
+
+ varparse = bb.data_smart.VariableParse(varname, config_data)
+ return varparse.python_sub(expr)
+
+ def dataStoreConnectorRelease(self, command, params):
+ dsindex = params[0]
+ if dsindex <= 0:
+ raise CommandError('dataStoreConnectorRelease: invalid index %d' % dsindex)
+ command.remotedatastores.release(dsindex)
+
+ def dataStoreConnectorSetVarFlag(self, command, params):
+ dsindex = params[0]
+ name = params[1]
+ flag = params[2]
+ value = params[3]
+ datastore = command.remotedatastores[dsindex]
+ datastore.setVarFlag(name, flag, value)
+
+ def dataStoreConnectorDelVar(self, command, params):
+ dsindex = params[0]
+ name = params[1]
+ datastore = command.remotedatastores[dsindex]
+ if len(params) > 2:
+ flag = params[2]
+ datastore.delVarFlag(name, flag)
+ else:
+ datastore.delVar(name)
+
+ def dataStoreConnectorRenameVar(self, command, params):
+ dsindex = params[0]
+ name = params[1]
+ newname = params[2]
+ datastore = command.remotedatastores[dsindex]
+ datastore.renameVar(name, newname)
+
+ def parseRecipeFile(self, command, params):
+ """
+ Parse the specified recipe file (with or without bbappends)
+ and return a datastore object representing the environment
+ for the recipe.
+ """
+ fn = params[0]
+ appends = params[1]
+ appendlist = params[2]
+ if len(params) > 3:
+ config_data_dict = params[3]
+ config_data = command.remotedatastores.receive_datastore(config_data_dict)
+ else:
+ config_data = None
+
+ if appends:
+ if appendlist is not None:
+ appendfiles = appendlist
+ else:
+ appendfiles = command.cooker.collection.get_file_appends(fn)
+ else:
+ appendfiles = []
+ # We are calling bb.cache locally here rather than on the server,
+ # but that's OK because it doesn't actually need anything from
+ # the server barring the global datastore (which we have a remote
+ # version of)
+ if config_data:
+ # We have to use a different function here if we're passing in a datastore
+ # NOTE: we took a copy above, so we don't do it here again
+ envdata = bb.cache.parse_recipe(config_data, fn, appendfiles)['']
+ else:
+ # Use the standard path
+ parser = bb.cache.NoCache(command.cooker.databuilder)
+ envdata = parser.loadDataFull(fn, appendfiles)
+ idx = command.remotedatastores.store(envdata)
+ return DataStoreConnectionHandle(idx)
+ parseRecipeFile.readonly = True
+
+class CommandsAsync:
+ """
+ A class of asynchronous commands
+ These functions communicate via generated events.
+ Any function that requires metadata parsing should be here.
+ """
+
+ def buildFile(self, command, params):
+ """
+ Build a single specified .bb file
+ """
+ bfile = params[0]
+ task = params[1]
+ if len(params) > 2:
+ internal = params[2]
+ else:
+ internal = False
+
+ if internal:
+ command.cooker.buildFileInternal(bfile, task, fireevents=False, quietlog=True)
+ else:
+ command.cooker.buildFile(bfile, task)
+ buildFile.needcache = False
+
+ def buildTargets(self, command, params):
+ """
+ Build a set of targets
+ """
+ pkgs_to_build = params[0]
+ task = params[1]
+
+ command.cooker.buildTargets(pkgs_to_build, task)
+ buildTargets.needcache = True
+
+ def generateDepTreeEvent(self, command, params):
+ """
+ Generate an event containing the dependency information
+ """
+ pkgs_to_build = params[0]
+ task = params[1]
+
+ command.cooker.generateDepTreeEvent(pkgs_to_build, task)
+ command.finishAsyncCommand()
+ generateDepTreeEvent.needcache = True
+
+ def generateDotGraph(self, command, params):
+ """
+ Dump dependency information to disk as .dot files
+ """
+ pkgs_to_build = params[0]
+ task = params[1]
+
+ command.cooker.generateDotGraphFiles(pkgs_to_build, task)
+ command.finishAsyncCommand()
+ generateDotGraph.needcache = True
+
+ def generateTargetsTree(self, command, params):
+ """
+ Generate a tree of buildable targets.
+ If klass is provided ensure all recipes that inherit the class are
+ included in the package list.
+ If pkg_list provided use that list (plus any extras brought in by
+ klass) rather than generating a tree for all packages.
+ """
+ klass = params[0]
+ pkg_list = params[1]
+
+ command.cooker.generateTargetsTree(klass, pkg_list)
+ command.finishAsyncCommand()
+ generateTargetsTree.needcache = True
+
+ def findConfigFiles(self, command, params):
+ """
+ Find config files which provide appropriate values
+ for the passed configuration variable. i.e. MACHINE
+ """
+ varname = params[0]
+
+ command.cooker.findConfigFiles(varname)
+ command.finishAsyncCommand()
+ findConfigFiles.needcache = False
+
+ def findFilesMatchingInDir(self, command, params):
+ """
+ Find implementation files matching the specified pattern
+ in the requested subdirectory of a BBPATH
+ """
+ pattern = params[0]
+ directory = params[1]
+
+ command.cooker.findFilesMatchingInDir(pattern, directory)
+ command.finishAsyncCommand()
+ findFilesMatchingInDir.needcache = False
+
+ def findConfigFilePath(self, command, params):
+ """
+ Find the path of the requested configuration file
+ """
+ configfile = params[0]
+
+ command.cooker.findConfigFilePath(configfile)
+ command.finishAsyncCommand()
+ findConfigFilePath.needcache = False
+
+ def showVersions(self, command, params):
+ """
+ Show the currently selected versions
+ """
+ command.cooker.showVersions()
+ command.finishAsyncCommand()
+ showVersions.needcache = True
+
+ def showEnvironmentTarget(self, command, params):
+ """
+ Print the environment of a target recipe
+ (needs the cache to work out which recipe to use)
+ """
+ pkg = params[0]
+
+ command.cooker.showEnvironment(None, pkg)
+ command.finishAsyncCommand()
+ showEnvironmentTarget.needcache = True
+
+ def showEnvironment(self, command, params):
+ """
+ Print the standard environment
+ or if specified the environment for a specified recipe
+ """
+ bfile = params[0]
+
+ command.cooker.showEnvironment(bfile)
+ command.finishAsyncCommand()
+ showEnvironment.needcache = False
+
+ def parseFiles(self, command, params):
+ """
+ Parse the .bb files
+ """
+ command.cooker.updateCache()
+ command.finishAsyncCommand()
+ parseFiles.needcache = True
+
+ def compareRevisions(self, command, params):
+ """
+ Parse the .bb files
+ """
+ if bb.fetch.fetcher_compare_revisions(command.cooker.data):
+ command.finishAsyncCommand(code=1)
+ else:
+ command.finishAsyncCommand()
+ compareRevisions.needcache = True
+
+ def triggerEvent(self, command, params):
+ """
+ Trigger a certain event
+ """
+ event = params[0]
+ bb.event.fire(eval(event), command.cooker.data)
+ command.currentAsyncCommand = None
+ triggerEvent.needcache = False
+
+ def resetCooker(self, command, params):
+ """
+ Reset the cooker to its initial state, thus forcing a reparse for
+ any async command that has the needcache property set to True
+ """
+ command.cooker.reset()
+ command.finishAsyncCommand()
+ resetCooker.needcache = False
+
+ def clientComplete(self, command, params):
+ """
+ Do the right thing when the controlling client exits
+ """
+ command.cooker.clientComplete()
+ command.finishAsyncCommand()
+ clientComplete.needcache = False
+
+ def findSigInfo(self, command, params):
+ """
+ Find signature info files via the signature generator
+ """
+ pn = params[0]
+ taskname = params[1]
+ sigs = params[2]
+ res = bb.siggen.find_siginfo(pn, taskname, sigs, command.cooker.data)
+ bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.data)
+ command.finishAsyncCommand()
+ findSigInfo.needcache = False
diff --git a/poky/bitbake/lib/bb/compat.py b/poky/bitbake/lib/bb/compat.py
new file mode 100644
index 000000000..de1923d28
--- /dev/null
+++ b/poky/bitbake/lib/bb/compat.py
@@ -0,0 +1,6 @@
+"""Code pulled from future python versions, here for compatibility"""
+
+from collections import MutableMapping, KeysView, ValuesView, ItemsView, OrderedDict
+from functools import total_ordering
+
+
diff --git a/poky/bitbake/lib/bb/cooker.py b/poky/bitbake/lib/bb/cooker.py
new file mode 100644
index 000000000..1fda40dd4
--- /dev/null
+++ b/poky/bitbake/lib/bb/cooker.py
@@ -0,0 +1,2161 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 - 2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import sys, os, glob, os.path, re, time
+import atexit
+import itertools
+import logging
+import multiprocessing
+import sre_constants
+import threading
+from io import StringIO, UnsupportedOperation
+from contextlib import closing
+from functools import wraps
+from collections import defaultdict, namedtuple
+import bb, bb.exceptions, bb.command
+from bb import utils, data, parse, event, cache, providers, taskdata, runqueue, build
+import queue
+import signal
+import subprocess
+import errno
+import prserv.serv
+import pyinotify
+import json
+import pickle
+import codecs
+
+logger = logging.getLogger("BitBake")
+collectlog = logging.getLogger("BitBake.Collection")
+buildlog = logging.getLogger("BitBake.Build")
+parselog = logging.getLogger("BitBake.Parsing")
+providerlog = logging.getLogger("BitBake.Provider")
+
+class NoSpecificMatch(bb.BBHandledException):
+ """
+ Exception raised when no or multiple file matches are found
+ """
+
+class NothingToBuild(Exception):
+ """
+ Exception raised when there is nothing to build
+ """
+
+class CollectionError(bb.BBHandledException):
+ """
+ Exception raised when layer configuration is incorrect
+ """
+
+class state:
+ initial, parsing, running, shutdown, forceshutdown, stopped, error = list(range(7))
+
+ @classmethod
+ def get_name(cls, code):
+ for name in dir(cls):
+ value = getattr(cls, name)
+ if type(value) == type(cls.initial) and value == code:
+ return name
+ raise ValueError("Invalid status code: %s" % code)
+
+
+class SkippedPackage:
+ def __init__(self, info = None, reason = None):
+ self.pn = None
+ self.skipreason = None
+ self.provides = None
+ self.rprovides = None
+
+ if info:
+ self.pn = info.pn
+ self.skipreason = info.skipreason
+ self.provides = info.provides
+ self.rprovides = info.rprovides
+ elif reason:
+ self.skipreason = reason
+
+
+class CookerFeatures(object):
+ _feature_list = [HOB_EXTRA_CACHES, BASEDATASTORE_TRACKING, SEND_SANITYEVENTS] = list(range(3))
+
+ def __init__(self):
+ self._features=set()
+
+ def setFeature(self, f):
+ # validate we got a request for a feature we support
+ if f not in CookerFeatures._feature_list:
+ return
+ self._features.add(f)
+
+ def __contains__(self, f):
+ return f in self._features
+
+ def __iter__(self):
+ return self._features.__iter__()
+
+ def __next__(self):
+ return next(self._features)
+
+
+class EventWriter:
+ def __init__(self, cooker, eventfile):
+ self.file_inited = None
+ self.cooker = cooker
+ self.eventfile = eventfile
+ self.event_queue = []
+
+ def write_event(self, event):
+ with open(self.eventfile, "a") as f:
+ try:
+ str_event = codecs.encode(pickle.dumps(event), 'base64').decode('utf-8')
+ f.write("%s\n" % json.dumps({"class": event.__module__ + "." + event.__class__.__name__,
+ "vars": str_event}))
+ except Exception as err:
+ import traceback
+ print(err, traceback.format_exc())
+
+ def send(self, event):
+ if self.file_inited:
+ # we have the file, just write the event
+ self.write_event(event)
+ else:
+ # init on bb.event.BuildStarted
+ name = "%s.%s" % (event.__module__, event.__class__.__name__)
+ if name in ("bb.event.BuildStarted", "bb.cooker.CookerExit"):
+ with open(self.eventfile, "w") as f:
+ f.write("%s\n" % json.dumps({ "allvariables" : self.cooker.getAllKeysWithFlags(["doc", "func"])}))
+
+ self.file_inited = True
+
+ # write pending events
+ for evt in self.event_queue:
+ self.write_event(evt)
+
+ # also write the current event
+ self.write_event(event)
+ else:
+ # queue all events until the file is inited
+ self.event_queue.append(event)
+
+#============================================================================#
+# BBCooker
+#============================================================================#
+class BBCooker:
+ """
+ Manages one bitbake build run
+ """
+
+ def __init__(self, configuration, featureSet=None):
+ self.recipecaches = None
+ self.skiplist = {}
+ self.featureset = CookerFeatures()
+ if featureSet:
+ for f in featureSet:
+ self.featureset.setFeature(f)
+
+ self.configuration = configuration
+
+ self.configwatcher = pyinotify.WatchManager()
+ self.configwatcher.bbseen = []
+ self.configwatcher.bbwatchedfiles = []
+ self.confignotifier = pyinotify.Notifier(self.configwatcher, self.config_notifications)
+ self.watchmask = pyinotify.IN_CLOSE_WRITE | pyinotify.IN_CREATE | pyinotify.IN_DELETE | \
+ pyinotify.IN_DELETE_SELF | pyinotify.IN_MODIFY | pyinotify.IN_MOVE_SELF | \
+ pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO
+ self.watcher = pyinotify.WatchManager()
+ self.watcher.bbseen = []
+ self.watcher.bbwatchedfiles = []
+ self.notifier = pyinotify.Notifier(self.watcher, self.notifications)
+
+ # If being called by something like tinfoil, we need to clean cached data
+ # which may now be invalid
+ bb.parse.clear_cache()
+ bb.parse.BBHandler.cached_statements = {}
+
+ self.ui_cmdline = None
+
+ self.initConfigurationData()
+
+ # we log all events to a file if so directed
+ if self.configuration.writeeventlog:
+ # register the log file writer as UI Handler
+ writer = EventWriter(self, self.configuration.writeeventlog)
+ EventLogWriteHandler = namedtuple('EventLogWriteHandler', ['event'])
+ bb.event.register_UIHhandler(EventLogWriteHandler(writer))
+
+ self.inotify_modified_files = []
+
+ def _process_inotify_updates(server, cooker, abort):
+ cooker.process_inotify_updates()
+ return 1.0
+
+ self.configuration.server_register_idlecallback(_process_inotify_updates, self)
+
+ # TOSTOP must not be set or our children will hang when they output
+ try:
+ fd = sys.stdout.fileno()
+ if os.isatty(fd):
+ import termios
+ tcattr = termios.tcgetattr(fd)
+ if tcattr[3] & termios.TOSTOP:
+ buildlog.info("The terminal had the TOSTOP bit set, clearing...")
+ tcattr[3] = tcattr[3] & ~termios.TOSTOP
+ termios.tcsetattr(fd, termios.TCSANOW, tcattr)
+ except UnsupportedOperation:
+ pass
+
+ self.command = bb.command.Command(self)
+ self.state = state.initial
+
+ self.parser = None
+
+ signal.signal(signal.SIGTERM, self.sigterm_exception)
+ # Let SIGHUP exit as SIGTERM
+ signal.signal(signal.SIGHUP, self.sigterm_exception)
+
+ def process_inotify_updates(self):
+ for n in [self.confignotifier, self.notifier]:
+ if n.check_events(timeout=0):
+ # read notified events and enqeue them
+ n.read_events()
+ n.process_events()
+
+ def config_notifications(self, event):
+ if event.maskname == "IN_Q_OVERFLOW":
+ bb.warn("inotify event queue overflowed, invalidating caches.")
+ self.parsecache_valid = False
+ self.baseconfig_valid = False
+ bb.parse.clear_cache()
+ return
+ if not event.pathname in self.configwatcher.bbwatchedfiles:
+ return
+ if not event.pathname in self.inotify_modified_files:
+ self.inotify_modified_files.append(event.pathname)
+ self.baseconfig_valid = False
+
+ def notifications(self, event):
+ if event.maskname == "IN_Q_OVERFLOW":
+ bb.warn("inotify event queue overflowed, invalidating caches.")
+ self.parsecache_valid = False
+ bb.parse.clear_cache()
+ return
+ if event.pathname.endswith("bitbake-cookerdaemon.log") \
+ or event.pathname.endswith("bitbake.lock"):
+ return
+ if not event.pathname in self.inotify_modified_files:
+ self.inotify_modified_files.append(event.pathname)
+ self.parsecache_valid = False
+
+ def add_filewatch(self, deps, watcher=None, dirs=False):
+ if not watcher:
+ watcher = self.watcher
+ for i in deps:
+ watcher.bbwatchedfiles.append(i[0])
+ if dirs:
+ f = i[0]
+ else:
+ f = os.path.dirname(i[0])
+ if f in watcher.bbseen:
+ continue
+ watcher.bbseen.append(f)
+ watchtarget = None
+ while True:
+ # We try and add watches for files that don't exist but if they did, would influence
+ # the parser. The parent directory of these files may not exist, in which case we need
+ # to watch any parent that does exist for changes.
+ try:
+ watcher.add_watch(f, self.watchmask, quiet=False)
+ if watchtarget:
+ watcher.bbwatchedfiles.append(watchtarget)
+ break
+ except pyinotify.WatchManagerError as e:
+ if 'ENOENT' in str(e):
+ watchtarget = f
+ f = os.path.dirname(f)
+ if f in watcher.bbseen:
+ break
+ watcher.bbseen.append(f)
+ continue
+ if 'ENOSPC' in str(e):
+ providerlog.error("No space left on device or exceeds fs.inotify.max_user_watches?")
+ providerlog.error("To check max_user_watches: sysctl -n fs.inotify.max_user_watches.")
+ providerlog.error("To modify max_user_watches: sysctl -n -w fs.inotify.max_user_watches=<value>.")
+ providerlog.error("Root privilege is required to modify max_user_watches.")
+ raise
+
+ def sigterm_exception(self, signum, stackframe):
+ if signum == signal.SIGTERM:
+ bb.warn("Cooker received SIGTERM, shutting down...")
+ elif signum == signal.SIGHUP:
+ bb.warn("Cooker received SIGHUP, shutting down...")
+ self.state = state.forceshutdown
+
+ def setFeatures(self, features):
+ # we only accept a new feature set if we're in state initial, so we can reset without problems
+ if not self.state in [state.initial, state.shutdown, state.forceshutdown, state.stopped, state.error]:
+ raise Exception("Illegal state for feature set change")
+ original_featureset = list(self.featureset)
+ for feature in features:
+ self.featureset.setFeature(feature)
+ bb.debug(1, "Features set %s (was %s)" % (original_featureset, list(self.featureset)))
+ if (original_featureset != list(self.featureset)) and self.state != state.error:
+ self.reset()
+
+ def initConfigurationData(self):
+
+ self.state = state.initial
+ self.caches_array = []
+
+ # Need to preserve BB_CONSOLELOG over resets
+ consolelog = None
+ if hasattr(self, "data"):
+ consolelog = self.data.getVar("BB_CONSOLELOG")
+
+ if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
+ self.enableDataTracking()
+
+ all_extra_cache_names = []
+ # We hardcode all known cache types in a single place, here.
+ if CookerFeatures.HOB_EXTRA_CACHES in self.featureset:
+ all_extra_cache_names.append("bb.cache_extra:HobRecipeInfo")
+
+ caches_name_array = ['bb.cache:CoreRecipeInfo'] + all_extra_cache_names
+
+ # At least CoreRecipeInfo will be loaded, so caches_array will never be empty!
+ # This is the entry point, no further check needed!
+ for var in caches_name_array:
+ try:
+ module_name, cache_name = var.split(':')
+ module = __import__(module_name, fromlist=(cache_name,))
+ self.caches_array.append(getattr(module, cache_name))
+ except ImportError as exc:
+ logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc))
+ sys.exit("FATAL: Failed to import extra cache class '%s'." % cache_name)
+
+ self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, False)
+ self.databuilder.parseBaseConfiguration()
+ self.data = self.databuilder.data
+ self.data_hash = self.databuilder.data_hash
+ self.extraconfigdata = {}
+
+ if consolelog:
+ self.data.setVar("BB_CONSOLELOG", consolelog)
+
+ self.data.setVar('BB_CMDLINE', self.ui_cmdline)
+
+ #
+ # Copy of the data store which has been expanded.
+ # Used for firing events and accessing variables where expansion needs to be accounted for
+ #
+ bb.parse.init_parser(self.data)
+
+ if CookerFeatures.BASEDATASTORE_TRACKING in self.featureset:
+ self.disableDataTracking()
+
+ self.data.renameVar("__depends", "__base_depends")
+ self.add_filewatch(self.data.getVar("__base_depends", False), self.configwatcher)
+
+ self.baseconfig_valid = True
+ self.parsecache_valid = False
+
+ def handlePRServ(self):
+ # Setup a PR Server based on the new configuration
+ try:
+ self.prhost = prserv.serv.auto_start(self.data)
+ except prserv.serv.PRServiceConfigError as e:
+ bb.fatal("Unable to start PR Server, exitting")
+
+ def enableDataTracking(self):
+ self.configuration.tracking = True
+ if hasattr(self, "data"):
+ self.data.enableTracking()
+
+ def disableDataTracking(self):
+ self.configuration.tracking = False
+ if hasattr(self, "data"):
+ self.data.disableTracking()
+
+ def parseConfiguration(self):
+ # Set log file verbosity
+ verboselogs = bb.utils.to_boolean(self.data.getVar("BB_VERBOSE_LOGS", False))
+ if verboselogs:
+ bb.msg.loggerVerboseLogs = True
+
+ # Change nice level if we're asked to
+ nice = self.data.getVar("BB_NICE_LEVEL")
+ if nice:
+ curnice = os.nice(0)
+ nice = int(nice) - curnice
+ buildlog.verbose("Renice to %s " % os.nice(nice))
+
+ if self.recipecaches:
+ del self.recipecaches
+ self.multiconfigs = self.databuilder.mcdata.keys()
+ self.recipecaches = {}
+ for mc in self.multiconfigs:
+ self.recipecaches[mc] = bb.cache.CacheData(self.caches_array)
+
+ self.handleCollections(self.data.getVar("BBFILE_COLLECTIONS"))
+
+ self.parsecache_valid = False
+
+ def updateConfigOpts(self, options, environment, cmdline):
+ self.ui_cmdline = cmdline
+ clean = True
+ for o in options:
+ if o in ['prefile', 'postfile']:
+ # Only these options may require a reparse
+ try:
+ if getattr(self.configuration, o) == options[o]:
+ # Value is the same, no need to mark dirty
+ continue
+ except AttributeError:
+ pass
+ logger.debug(1, "Marking as dirty due to '%s' option change to '%s'" % (o, options[o]))
+ print("Marking as dirty due to '%s' option change to '%s'" % (o, options[o]))
+ clean = False
+ setattr(self.configuration, o, options[o])
+ for k in bb.utils.approved_variables():
+ if k in environment and k not in self.configuration.env:
+ logger.debug(1, "Updating new environment variable %s to %s" % (k, environment[k]))
+ self.configuration.env[k] = environment[k]
+ clean = False
+ if k in self.configuration.env and k not in environment:
+ logger.debug(1, "Updating environment variable %s (deleted)" % (k))
+ del self.configuration.env[k]
+ clean = False
+ if k not in self.configuration.env and k not in environment:
+ continue
+ if environment[k] != self.configuration.env[k]:
+ logger.debug(1, "Updating environment variable %s from %s to %s" % (k, self.configuration.env[k], environment[k]))
+ self.configuration.env[k] = environment[k]
+ clean = False
+ if not clean:
+ logger.debug(1, "Base environment change, triggering reparse")
+ self.reset()
+
+ def runCommands(self, server, data, abort):
+ """
+ Run any queued asynchronous command
+ This is done by the idle handler so it runs in true context rather than
+ tied to any UI.
+ """
+
+ return self.command.runAsyncCommand()
+
+ def showVersions(self):
+
+ (latest_versions, preferred_versions) = self.findProviders()
+
+ logger.plain("%-35s %25s %25s", "Recipe Name", "Latest Version", "Preferred Version")
+ logger.plain("%-35s %25s %25s\n", "===========", "==============", "=================")
+
+ for p in sorted(self.recipecaches[''].pkg_pn):
+ pref = preferred_versions[p]
+ latest = latest_versions[p]
+
+ prefstr = pref[0][0] + ":" + pref[0][1] + '-' + pref[0][2]
+ lateststr = latest[0][0] + ":" + latest[0][1] + "-" + latest[0][2]
+
+ if pref == latest:
+ prefstr = ""
+
+ logger.plain("%-35s %25s %25s", p, lateststr, prefstr)
+
+ def showEnvironment(self, buildfile=None, pkgs_to_build=None):
+ """
+ Show the outer or per-recipe environment
+ """
+ fn = None
+ envdata = None
+ if not pkgs_to_build:
+ pkgs_to_build = []
+
+ orig_tracking = self.configuration.tracking
+ if not orig_tracking:
+ self.enableDataTracking()
+ self.reset()
+
+
+ if buildfile:
+ # Parse the configuration here. We need to do it explicitly here since
+ # this showEnvironment() code path doesn't use the cache
+ self.parseConfiguration()
+
+ fn, cls, mc = bb.cache.virtualfn2realfn(buildfile)
+ fn = self.matchFile(fn)
+ fn = bb.cache.realfn2virtual(fn, cls, mc)
+ elif len(pkgs_to_build) == 1:
+ ignore = self.data.getVar("ASSUME_PROVIDED") or ""
+ if pkgs_to_build[0] in set(ignore.split()):
+ bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
+
+ taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True)
+
+ mc = runlist[0][0]
+ fn = runlist[0][3]
+ else:
+ envdata = self.data
+ data.expandKeys(envdata)
+ parse.ast.runAnonFuncs(envdata)
+
+ if fn:
+ try:
+ bb_cache = bb.cache.Cache(self.databuilder, self.data_hash, self.caches_array)
+ envdata = bb_cache.loadDataFull(fn, self.collection.get_file_appends(fn))
+ except Exception as e:
+ parselog.exception("Unable to read %s", fn)
+ raise
+
+ # Display history
+ with closing(StringIO()) as env:
+ self.data.inchistory.emit(env)
+ logger.plain(env.getvalue())
+
+ # emit variables and shell functions
+ with closing(StringIO()) as env:
+ data.emit_env(env, envdata, True)
+ logger.plain(env.getvalue())
+
+ # emit the metadata which isnt valid shell
+ for e in sorted(envdata.keys()):
+ if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False):
+ logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
+
+ if not orig_tracking:
+ self.disableDataTracking()
+ self.reset()
+
+ def buildTaskData(self, pkgs_to_build, task, abort, allowincomplete=False):
+ """
+ Prepare a runqueue and taskdata object for iteration over pkgs_to_build
+ """
+ bb.event.fire(bb.event.TreeDataPreparationStarted(), self.data)
+
+ # A task of None means use the default task
+ if task is None:
+ task = self.configuration.cmd
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+
+ targetlist = self.checkPackages(pkgs_to_build, task)
+ fulltargetlist = []
+ defaulttask_implicit = ''
+ defaulttask_explicit = False
+ wildcard = False
+
+ # Wild card expansion:
+ # Replace string such as "multiconfig:*:bash"
+ # into "multiconfig:A:bash multiconfig:B:bash bash"
+ for k in targetlist:
+ if k.startswith("multiconfig:"):
+ if wildcard:
+ bb.fatal('multiconfig conflict')
+ if k.split(":")[1] == "*":
+ wildcard = True
+ for mc in self.multiconfigs:
+ if mc:
+ fulltargetlist.append(k.replace('*', mc))
+ # implicit default task
+ else:
+ defaulttask_implicit = k.split(":")[2]
+ else:
+ fulltargetlist.append(k)
+ else:
+ defaulttask_explicit = True
+ fulltargetlist.append(k)
+
+ if not defaulttask_explicit and defaulttask_implicit != '':
+ fulltargetlist.append(defaulttask_implicit)
+
+ bb.debug(1,"Target list: %s" % (str(fulltargetlist)))
+ taskdata = {}
+ localdata = {}
+
+ for mc in self.multiconfigs:
+ taskdata[mc] = bb.taskdata.TaskData(abort, skiplist=self.skiplist, allowincomplete=allowincomplete)
+ localdata[mc] = data.createCopy(self.databuilder.mcdata[mc])
+ bb.data.expandKeys(localdata[mc])
+
+ current = 0
+ runlist = []
+ for k in fulltargetlist:
+ mc = ""
+ if k.startswith("multiconfig:"):
+ mc = k.split(":")[1]
+ k = ":".join(k.split(":")[2:])
+ ktask = task
+ if ":do_" in k:
+ k2 = k.split(":do_")
+ k = k2[0]
+ ktask = k2[1]
+ taskdata[mc].add_provider(localdata[mc], self.recipecaches[mc], k)
+ current += 1
+ if not ktask.startswith("do_"):
+ ktask = "do_%s" % ktask
+ if k not in taskdata[mc].build_targets or not taskdata[mc].build_targets[k]:
+ # e.g. in ASSUME_PROVIDED
+ continue
+ fn = taskdata[mc].build_targets[k][0]
+ runlist.append([mc, k, ktask, fn])
+ bb.event.fire(bb.event.TreeDataPreparationProgress(current, len(fulltargetlist)), self.data)
+
+ for mc in self.multiconfigs:
+ taskdata[mc].add_unresolved(localdata[mc], self.recipecaches[mc])
+
+ bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)
+ return taskdata, runlist
+
+ def prepareTreeData(self, pkgs_to_build, task):
+ """
+ Prepare a runqueue and taskdata object for iteration over pkgs_to_build
+ """
+
+ # We set abort to False here to prevent unbuildable targets raising
+ # an exception when we're just generating data
+ taskdata, runlist = self.buildTaskData(pkgs_to_build, task, False, allowincomplete=True)
+
+ return runlist, taskdata
+
+ ######## WARNING : this function requires cache_extra to be enabled ########
+
+ def generateTaskDepTreeData(self, pkgs_to_build, task):
+ """
+ Create a dependency graph of pkgs_to_build including reverse dependency
+ information.
+ """
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+
+ runlist, taskdata = self.prepareTreeData(pkgs_to_build, task)
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
+ rq.rqdata.prepare()
+ return self.buildDependTree(rq, taskdata)
+
+ @staticmethod
+ def add_mc_prefix(mc, pn):
+ if mc:
+ return "multiconfig:%s:%s" % (mc, pn)
+ return pn
+
+ def buildDependTree(self, rq, taskdata):
+ seen_fns = []
+ depend_tree = {}
+ depend_tree["depends"] = {}
+ depend_tree["tdepends"] = {}
+ depend_tree["pn"] = {}
+ depend_tree["rdepends-pn"] = {}
+ depend_tree["packages"] = {}
+ depend_tree["rdepends-pkg"] = {}
+ depend_tree["rrecs-pkg"] = {}
+ depend_tree['providermap'] = {}
+ depend_tree["layer-priorities"] = self.bbfile_config_priorities
+
+ for mc in taskdata:
+ for name, fn in list(taskdata[mc].get_providermap().items()):
+ pn = self.recipecaches[mc].pkg_fn[fn]
+ pn = self.add_mc_prefix(mc, pn)
+ if name != pn:
+ version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[fn]
+ depend_tree['providermap'][name] = (pn, version)
+
+ for tid in rq.rqdata.runtaskentries:
+ (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
+ pn = self.recipecaches[mc].pkg_fn[taskfn]
+ pn = self.add_mc_prefix(mc, pn)
+ version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[taskfn]
+ if pn not in depend_tree["pn"]:
+ depend_tree["pn"][pn] = {}
+ depend_tree["pn"][pn]["filename"] = taskfn
+ depend_tree["pn"][pn]["version"] = version
+ depend_tree["pn"][pn]["inherits"] = self.recipecaches[mc].inherits.get(taskfn, None)
+
+ # if we have extra caches, list all attributes they bring in
+ extra_info = []
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, bb.cache.RecipeInfoCommon) and hasattr(cache_class, 'cachefields'):
+ cachefields = getattr(cache_class, 'cachefields', [])
+ extra_info = extra_info + cachefields
+
+ # for all attributes stored, add them to the dependency tree
+ for ei in extra_info:
+ depend_tree["pn"][pn][ei] = vars(self.recipecaches[mc])[ei][taskfn]
+
+
+ dotname = "%s.%s" % (pn, bb.runqueue.taskname_from_tid(tid))
+ if not dotname in depend_tree["tdepends"]:
+ depend_tree["tdepends"][dotname] = []
+ for dep in rq.rqdata.runtaskentries[tid].depends:
+ (depmc, depfn, deptaskname, deptaskfn) = bb.runqueue.split_tid_mcfn(dep)
+ deppn = self.recipecaches[mc].pkg_fn[deptaskfn]
+ depend_tree["tdepends"][dotname].append("%s.%s" % (deppn, bb.runqueue.taskname_from_tid(dep)))
+ if taskfn not in seen_fns:
+ seen_fns.append(taskfn)
+ packages = []
+
+ depend_tree["depends"][pn] = []
+ for dep in taskdata[mc].depids[taskfn]:
+ depend_tree["depends"][pn].append(dep)
+
+ depend_tree["rdepends-pn"][pn] = []
+ for rdep in taskdata[mc].rdepids[taskfn]:
+ depend_tree["rdepends-pn"][pn].append(rdep)
+
+ rdepends = self.recipecaches[mc].rundeps[taskfn]
+ for package in rdepends:
+ depend_tree["rdepends-pkg"][package] = []
+ for rdepend in rdepends[package]:
+ depend_tree["rdepends-pkg"][package].append(rdepend)
+ packages.append(package)
+
+ rrecs = self.recipecaches[mc].runrecs[taskfn]
+ for package in rrecs:
+ depend_tree["rrecs-pkg"][package] = []
+ for rdepend in rrecs[package]:
+ depend_tree["rrecs-pkg"][package].append(rdepend)
+ if not package in packages:
+ packages.append(package)
+
+ for package in packages:
+ if package not in depend_tree["packages"]:
+ depend_tree["packages"][package] = {}
+ depend_tree["packages"][package]["pn"] = pn
+ depend_tree["packages"][package]["filename"] = taskfn
+ depend_tree["packages"][package]["version"] = version
+
+ return depend_tree
+
+ ######## WARNING : this function requires cache_extra to be enabled ########
+ def generatePkgDepTreeData(self, pkgs_to_build, task):
+ """
+ Create a dependency tree of pkgs_to_build, returning the data.
+ """
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+
+ _, taskdata = self.prepareTreeData(pkgs_to_build, task)
+
+ seen_fns = []
+ depend_tree = {}
+ depend_tree["depends"] = {}
+ depend_tree["pn"] = {}
+ depend_tree["rdepends-pn"] = {}
+ depend_tree["rdepends-pkg"] = {}
+ depend_tree["rrecs-pkg"] = {}
+
+ # if we have extra caches, list all attributes they bring in
+ extra_info = []
+ for cache_class in self.caches_array:
+ if type(cache_class) is type and issubclass(cache_class, bb.cache.RecipeInfoCommon) and hasattr(cache_class, 'cachefields'):
+ cachefields = getattr(cache_class, 'cachefields', [])
+ extra_info = extra_info + cachefields
+
+ tids = []
+ for mc in taskdata:
+ for tid in taskdata[mc].taskentries:
+ tids.append(tid)
+
+ for tid in tids:
+ (mc, fn, taskname, taskfn) = bb.runqueue.split_tid_mcfn(tid)
+
+ pn = self.recipecaches[mc].pkg_fn[taskfn]
+ pn = self.add_mc_prefix(mc, pn)
+
+ if pn not in depend_tree["pn"]:
+ depend_tree["pn"][pn] = {}
+ depend_tree["pn"][pn]["filename"] = taskfn
+ version = "%s:%s-%s" % self.recipecaches[mc].pkg_pepvpr[taskfn]
+ depend_tree["pn"][pn]["version"] = version
+ rdepends = self.recipecaches[mc].rundeps[taskfn]
+ rrecs = self.recipecaches[mc].runrecs[taskfn]
+ depend_tree["pn"][pn]["inherits"] = self.recipecaches[mc].inherits.get(taskfn, None)
+
+ # for all extra attributes stored, add them to the dependency tree
+ for ei in extra_info:
+ depend_tree["pn"][pn][ei] = vars(self.recipecaches[mc])[ei][taskfn]
+
+ if taskfn not in seen_fns:
+ seen_fns.append(taskfn)
+
+ depend_tree["depends"][pn] = []
+ for dep in taskdata[mc].depids[taskfn]:
+ pn_provider = ""
+ if dep in taskdata[mc].build_targets and taskdata[mc].build_targets[dep]:
+ fn_provider = taskdata[mc].build_targets[dep][0]
+ pn_provider = self.recipecaches[mc].pkg_fn[fn_provider]
+ else:
+ pn_provider = dep
+ pn_provider = self.add_mc_prefix(mc, pn_provider)
+ depend_tree["depends"][pn].append(pn_provider)
+
+ depend_tree["rdepends-pn"][pn] = []
+ for rdep in taskdata[mc].rdepids[taskfn]:
+ pn_rprovider = ""
+ if rdep in taskdata[mc].run_targets and taskdata[mc].run_targets[rdep]:
+ fn_rprovider = taskdata[mc].run_targets[rdep][0]
+ pn_rprovider = self.recipecaches[mc].pkg_fn[fn_rprovider]
+ else:
+ pn_rprovider = rdep
+ pn_rprovider = self.add_mc_prefix(mc, pn_rprovider)
+ depend_tree["rdepends-pn"][pn].append(pn_rprovider)
+
+ depend_tree["rdepends-pkg"].update(rdepends)
+ depend_tree["rrecs-pkg"].update(rrecs)
+
+ return depend_tree
+
+ def generateDepTreeEvent(self, pkgs_to_build, task):
+ """
+ Create a task dependency graph of pkgs_to_build.
+ Generate an event with the result
+ """
+ depgraph = self.generateTaskDepTreeData(pkgs_to_build, task)
+ bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.data)
+
+ def generateDotGraphFiles(self, pkgs_to_build, task):
+ """
+ Create a task dependency graph of pkgs_to_build.
+ Save the result to a set of .dot files.
+ """
+
+ depgraph = self.generateTaskDepTreeData(pkgs_to_build, task)
+
+ with open('pn-buildlist', 'w') as f:
+ for pn in depgraph["pn"]:
+ f.write(pn + "\n")
+ logger.info("PN build list saved to 'pn-buildlist'")
+
+ # Remove old format output files to ensure no confusion with stale data
+ try:
+ os.unlink('pn-depends.dot')
+ except FileNotFoundError:
+ pass
+ try:
+ os.unlink('package-depends.dot')
+ except FileNotFoundError:
+ pass
+
+ with open('task-depends.dot', 'w') as f:
+ f.write("digraph depends {\n")
+ for task in sorted(depgraph["tdepends"]):
+ (pn, taskname) = task.rsplit(".", 1)
+ fn = depgraph["pn"][pn]["filename"]
+ version = depgraph["pn"][pn]["version"]
+ f.write('"%s.%s" [label="%s %s\\n%s\\n%s"]\n' % (pn, taskname, pn, taskname, version, fn))
+ for dep in sorted(depgraph["tdepends"][task]):
+ f.write('"%s" -> "%s"\n' % (task, dep))
+ f.write("}\n")
+ logger.info("Task dependencies saved to 'task-depends.dot'")
+
+ with open('recipe-depends.dot', 'w') as f:
+ f.write("digraph depends {\n")
+ pndeps = {}
+ for task in sorted(depgraph["tdepends"]):
+ (pn, taskname) = task.rsplit(".", 1)
+ if pn not in pndeps:
+ pndeps[pn] = set()
+ for dep in sorted(depgraph["tdepends"][task]):
+ (deppn, deptaskname) = dep.rsplit(".", 1)
+ pndeps[pn].add(deppn)
+ for pn in sorted(pndeps):
+ fn = depgraph["pn"][pn]["filename"]
+ version = depgraph["pn"][pn]["version"]
+ f.write('"%s" [label="%s\\n%s\\n%s"]\n' % (pn, pn, version, fn))
+ for dep in sorted(pndeps[pn]):
+ if dep == pn:
+ continue
+ f.write('"%s" -> "%s"\n' % (pn, dep))
+ f.write("}\n")
+ logger.info("Flattened recipe dependencies saved to 'recipe-depends.dot'")
+
+ def show_appends_with_no_recipes(self):
+ # Determine which bbappends haven't been applied
+
+ # First get list of recipes, including skipped
+ recipefns = list(self.recipecaches[''].pkg_fn.keys())
+ recipefns.extend(self.skiplist.keys())
+
+ # Work out list of bbappends that have been applied
+ applied_appends = []
+ for fn in recipefns:
+ applied_appends.extend(self.collection.get_file_appends(fn))
+
+ appends_without_recipes = []
+ for _, appendfn in self.collection.bbappends:
+ if not appendfn in applied_appends:
+ appends_without_recipes.append(appendfn)
+
+ if appends_without_recipes:
+ msg = 'No recipes available for:\n %s' % '\n '.join(appends_without_recipes)
+ warn_only = self.data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \
+ False) or "no"
+ if warn_only.lower() in ("1", "yes", "true"):
+ bb.warn(msg)
+ else:
+ bb.fatal(msg)
+
+ def handlePrefProviders(self):
+
+ for mc in self.multiconfigs:
+ localdata = data.createCopy(self.databuilder.mcdata[mc])
+ bb.data.expandKeys(localdata)
+
+ # Handle PREFERRED_PROVIDERS
+ for p in (localdata.getVar('PREFERRED_PROVIDERS') or "").split():
+ try:
+ (providee, provider) = p.split(':')
+ except:
+ providerlog.critical("Malformed option in PREFERRED_PROVIDERS variable: %s" % p)
+ continue
+ if providee in self.recipecaches[mc].preferred and self.recipecaches[mc].preferred[providee] != provider:
+ providerlog.error("conflicting preferences for %s: both %s and %s specified", providee, provider, self.recipecaches[mc].preferred[providee])
+ self.recipecaches[mc].preferred[providee] = provider
+
+ def findConfigFilePath(self, configfile):
+ """
+ Find the location on disk of configfile and if it exists and was parsed by BitBake
+ emit the ConfigFilePathFound event with the path to the file.
+ """
+ path = bb.cookerdata.findConfigFile(configfile, self.data)
+ if not path:
+ return
+
+ # Generate a list of parsed configuration files by searching the files
+ # listed in the __depends and __base_depends variables with a .conf suffix.
+ conffiles = []
+ dep_files = self.data.getVar('__base_depends', False) or []
+ dep_files = dep_files + (self.data.getVar('__depends', False) or [])
+
+ for f in dep_files:
+ if f[0].endswith(".conf"):
+ conffiles.append(f[0])
+
+ _, conf, conffile = path.rpartition("conf/")
+ match = os.path.join(conf, conffile)
+ # Try and find matches for conf/conffilename.conf as we don't always
+ # have the full path to the file.
+ for cfg in conffiles:
+ if cfg.endswith(match):
+ bb.event.fire(bb.event.ConfigFilePathFound(path),
+ self.data)
+ break
+
+ def findFilesMatchingInDir(self, filepattern, directory):
+ """
+ Searches for files containing the substring 'filepattern' which are children of
+ 'directory' in each BBPATH. i.e. to find all rootfs package classes available
+ to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes')
+ or to find all machine configuration files one could call:
+ findFilesMatchingInDir(self, '.conf', 'conf/machine')
+ """
+
+ matches = []
+ bbpaths = self.data.getVar('BBPATH').split(':')
+ for path in bbpaths:
+ dirpath = os.path.join(path, directory)
+ if os.path.exists(dirpath):
+ for root, dirs, files in os.walk(dirpath):
+ for f in files:
+ if filepattern in f:
+ matches.append(f)
+
+ if matches:
+ bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.data)
+
+ def findProviders(self, mc=''):
+ return bb.providers.findProviders(self.data, self.recipecaches[mc], self.recipecaches[mc].pkg_pn)
+
+ def findBestProvider(self, pn, mc=''):
+ if pn in self.recipecaches[mc].providers:
+ filenames = self.recipecaches[mc].providers[pn]
+ eligible, foundUnique = bb.providers.filterProviders(filenames, pn, self.data, self.recipecaches[mc])
+ filename = eligible[0]
+ return None, None, None, filename
+ elif pn in self.recipecaches[mc].pkg_pn:
+ return bb.providers.findBestProvider(pn, self.data, self.recipecaches[mc], self.recipecaches[mc].pkg_pn)
+ else:
+ return None, None, None, None
+
+ def findConfigFiles(self, varname):
+ """
+ Find config files which are appropriate values for varname.
+ i.e. MACHINE, DISTRO
+ """
+ possible = []
+ var = varname.lower()
+
+ data = self.data
+ # iterate configs
+ bbpaths = data.getVar('BBPATH').split(':')
+ for path in bbpaths:
+ confpath = os.path.join(path, "conf", var)
+ if os.path.exists(confpath):
+ for root, dirs, files in os.walk(confpath):
+ # get all child files, these are appropriate values
+ for f in files:
+ val, sep, end = f.rpartition('.')
+ if end == 'conf':
+ possible.append(val)
+
+ if possible:
+ bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.data)
+
+ def findInheritsClass(self, klass):
+ """
+ Find all recipes which inherit the specified class
+ """
+ pkg_list = []
+
+ for pfn in self.recipecaches[''].pkg_fn:
+ inherits = self.recipecaches[''].inherits.get(pfn, None)
+ if inherits and klass in inherits:
+ pkg_list.append(self.recipecaches[''].pkg_fn[pfn])
+
+ return pkg_list
+
+ def generateTargetsTree(self, klass=None, pkgs=None):
+ """
+ Generate a dependency tree of buildable targets
+ Generate an event with the result
+ """
+ # if the caller hasn't specified a pkgs list default to universe
+ if not pkgs:
+ pkgs = ['universe']
+ # if inherited_class passed ensure all recipes which inherit the
+ # specified class are included in pkgs
+ if klass:
+ extra_pkgs = self.findInheritsClass(klass)
+ pkgs = pkgs + extra_pkgs
+
+ # generate a dependency tree for all our packages
+ tree = self.generatePkgDepTreeData(pkgs, 'build')
+ bb.event.fire(bb.event.TargetsTreeGenerated(tree), self.data)
+
+ def interactiveMode( self ):
+ """Drop off into a shell"""
+ try:
+ from bb import shell
+ except ImportError:
+ parselog.exception("Interactive mode not available")
+ sys.exit(1)
+ else:
+ shell.start( self )
+
+
+ def handleCollections(self, collections):
+ """Handle collections"""
+ errors = False
+ self.bbfile_config_priorities = []
+ if collections:
+ collection_priorities = {}
+ collection_depends = {}
+ collection_list = collections.split()
+ min_prio = 0
+ for c in collection_list:
+ bb.debug(1,'Processing %s in collection list' % (c))
+
+ # Get collection priority if defined explicitly
+ priority = self.data.getVar("BBFILE_PRIORITY_%s" % c)
+ if priority:
+ try:
+ prio = int(priority)
+ except ValueError:
+ parselog.error("invalid value for BBFILE_PRIORITY_%s: \"%s\"", c, priority)
+ errors = True
+ if min_prio == 0 or prio < min_prio:
+ min_prio = prio
+ collection_priorities[c] = prio
+ else:
+ collection_priorities[c] = None
+
+ # Check dependencies and store information for priority calculation
+ deps = self.data.getVar("LAYERDEPENDS_%s" % c)
+ if deps:
+ try:
+ depDict = bb.utils.explode_dep_versions2(deps)
+ except bb.utils.VersionStringException as vse:
+ bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse)))
+ for dep, oplist in list(depDict.items()):
+ if dep in collection_list:
+ for opstr in oplist:
+ layerver = self.data.getVar("LAYERVERSION_%s" % dep)
+ (op, depver) = opstr.split()
+ if layerver:
+ try:
+ res = bb.utils.vercmp_string_op(layerver, depver, op)
+ except bb.utils.VersionStringException as vse:
+ bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (c, str(vse)))
+ if not res:
+ parselog.error("Layer '%s' depends on version %s of layer '%s', but version %s is currently enabled in your configuration. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, dep, layerver)
+ errors = True
+ else:
+ parselog.error("Layer '%s' depends on version %s of layer '%s', which exists in your configuration but does not specify a version. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, dep)
+ errors = True
+ else:
+ parselog.error("Layer '%s' depends on layer '%s', but this layer is not enabled in your configuration", c, dep)
+ errors = True
+ collection_depends[c] = list(depDict.keys())
+ else:
+ collection_depends[c] = []
+
+ # Check recommends and store information for priority calculation
+ recs = self.data.getVar("LAYERRECOMMENDS_%s" % c)
+ if recs:
+ try:
+ recDict = bb.utils.explode_dep_versions2(recs)
+ except bb.utils.VersionStringException as vse:
+ bb.fatal('Error parsing LAYERRECOMMENDS_%s: %s' % (c, str(vse)))
+ for rec, oplist in list(recDict.items()):
+ if rec in collection_list:
+ if oplist:
+ opstr = oplist[0]
+ layerver = self.data.getVar("LAYERVERSION_%s" % rec)
+ if layerver:
+ (op, recver) = opstr.split()
+ try:
+ res = bb.utils.vercmp_string_op(layerver, recver, op)
+ except bb.utils.VersionStringException as vse:
+ bb.fatal('Error parsing LAYERRECOMMENDS_%s: %s' % (c, str(vse)))
+ if not res:
+ parselog.debug(3,"Layer '%s' recommends version %s of layer '%s', but version %s is currently enabled in your configuration. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, rec, layerver)
+ continue
+ else:
+ parselog.debug(3,"Layer '%s' recommends version %s of layer '%s', which exists in your configuration but does not specify a version. Check that you are using the correct matching versions/branches of these two layers.", c, opstr, rec)
+ continue
+ parselog.debug(3,"Layer '%s' recommends layer '%s', so we are adding it", c, rec)
+ collection_depends[c].append(rec)
+ else:
+ parselog.debug(3,"Layer '%s' recommends layer '%s', but this layer is not enabled in your configuration", c, rec)
+
+ # Recursively work out collection priorities based on dependencies
+ def calc_layer_priority(collection):
+ if not collection_priorities[collection]:
+ max_depprio = min_prio
+ for dep in collection_depends[collection]:
+ calc_layer_priority(dep)
+ depprio = collection_priorities[dep]
+ if depprio > max_depprio:
+ max_depprio = depprio
+ max_depprio += 1
+ parselog.debug(1, "Calculated priority of layer %s as %d", collection, max_depprio)
+ collection_priorities[collection] = max_depprio
+
+ # Calculate all layer priorities using calc_layer_priority and store in bbfile_config_priorities
+ for c in collection_list:
+ calc_layer_priority(c)
+ regex = self.data.getVar("BBFILE_PATTERN_%s" % c)
+ if regex == None:
+ parselog.error("BBFILE_PATTERN_%s not defined" % c)
+ errors = True
+ continue
+ elif regex == "":
+ parselog.debug(1, "BBFILE_PATTERN_%s is empty" % c)
+ errors = False
+ continue
+ else:
+ try:
+ cre = re.compile(regex)
+ except re.error:
+ parselog.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression", c, regex)
+ errors = True
+ continue
+ self.bbfile_config_priorities.append((c, regex, cre, collection_priorities[c]))
+ if errors:
+ # We've already printed the actual error(s)
+ raise CollectionError("Errors during parsing layer configuration")
+
+ def buildSetVars(self):
+ """
+ Setup any variables needed before starting a build
+ """
+ t = time.gmtime()
+ for mc in self.databuilder.mcdata:
+ ds = self.databuilder.mcdata[mc]
+ if not ds.getVar("BUILDNAME", False):
+ ds.setVar("BUILDNAME", "${DATE}${TIME}")
+ ds.setVar("BUILDSTART", time.strftime('%m/%d/%Y %H:%M:%S', t))
+ ds.setVar("DATE", time.strftime('%Y%m%d', t))
+ ds.setVar("TIME", time.strftime('%H%M%S', t))
+
+ def reset_mtime_caches(self):
+ """
+ Reset mtime caches - this is particularly important when memory resident as something
+ which is cached is not unlikely to have changed since the last invocation (e.g. a
+ file associated with a recipe might have been modified by the user).
+ """
+ build.reset_cache()
+ bb.fetch._checksum_cache.mtime_cache.clear()
+ siggen_cache = getattr(bb.parse.siggen, 'checksum_cache', None)
+ if siggen_cache:
+ bb.parse.siggen.checksum_cache.mtime_cache.clear()
+
+ def matchFiles(self, bf):
+ """
+ Find the .bb files which match the expression in 'buildfile'.
+ """
+ if bf.startswith("/") or bf.startswith("../"):
+ bf = os.path.abspath(bf)
+
+ self.collection = CookerCollectFiles(self.bbfile_config_priorities)
+ filelist, masked, searchdirs = self.collection.collect_bbfiles(self.data, self.data)
+ try:
+ os.stat(bf)
+ bf = os.path.abspath(bf)
+ return [bf]
+ except OSError:
+ regexp = re.compile(bf)
+ matches = []
+ for f in filelist:
+ if regexp.search(f) and os.path.isfile(f):
+ matches.append(f)
+ return matches
+
+ def matchFile(self, buildfile):
+ """
+ Find the .bb file which matches the expression in 'buildfile'.
+ Raise an error if multiple files
+ """
+ matches = self.matchFiles(buildfile)
+ if len(matches) != 1:
+ if matches:
+ msg = "Unable to match '%s' to a specific recipe file - %s matches found:" % (buildfile, len(matches))
+ if matches:
+ for f in matches:
+ msg += "\n %s" % f
+ parselog.error(msg)
+ else:
+ parselog.error("Unable to find any recipe file matching '%s'" % buildfile)
+ raise NoSpecificMatch
+ return matches[0]
+
+ def buildFile(self, buildfile, task):
+ """
+ Build the file matching regexp buildfile
+ """
+ bb.event.fire(bb.event.BuildInit(), self.data)
+
+ # Too many people use -b because they think it's how you normally
+ # specify a target to be built, so show a warning
+ bb.warn("Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.")
+
+ self.buildFileInternal(buildfile, task)
+
+ def buildFileInternal(self, buildfile, task, fireevents=True, quietlog=False):
+ """
+ Build the file matching regexp buildfile
+ """
+
+ # Parse the configuration here. We need to do it explicitly here since
+ # buildFile() doesn't use the cache
+ self.parseConfiguration()
+
+ # If we are told to do the None task then query the default task
+ if (task == None):
+ task = self.configuration.cmd
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+
+ fn, cls, mc = bb.cache.virtualfn2realfn(buildfile)
+ fn = self.matchFile(fn)
+
+ self.buildSetVars()
+ self.reset_mtime_caches()
+
+ bb_cache = bb.cache.Cache(self.databuilder, self.data_hash, self.caches_array)
+
+ infos = bb_cache.parse(fn, self.collection.get_file_appends(fn))
+ infos = dict(infos)
+
+ fn = bb.cache.realfn2virtual(fn, cls, mc)
+ try:
+ info_array = infos[fn]
+ except KeyError:
+ bb.fatal("%s does not exist" % fn)
+
+ if info_array[0].skipped:
+ bb.fatal("%s was skipped: %s" % (fn, info_array[0].skipreason))
+
+ self.recipecaches[mc].add_from_recipeinfo(fn, info_array)
+
+ # Tweak some variables
+ item = info_array[0].pn
+ self.recipecaches[mc].ignored_dependencies = set()
+ self.recipecaches[mc].bbfile_priority[fn] = 1
+ self.configuration.limited_deps = True
+
+ # Remove external dependencies
+ self.recipecaches[mc].task_deps[fn]['depends'] = {}
+ self.recipecaches[mc].deps[fn] = []
+ self.recipecaches[mc].rundeps[fn] = defaultdict(list)
+ self.recipecaches[mc].runrecs[fn] = defaultdict(list)
+
+ # Invalidate task for target if force mode active
+ if self.configuration.force:
+ logger.verbose("Invalidate task %s, %s", task, fn)
+ bb.parse.siggen.invalidate_task(task, self.recipecaches[mc], fn)
+
+ # Setup taskdata structure
+ taskdata = {}
+ taskdata[mc] = bb.taskdata.TaskData(self.configuration.abort)
+ taskdata[mc].add_provider(self.databuilder.mcdata[mc], self.recipecaches[mc], item)
+
+ if quietlog:
+ rqloglevel = bb.runqueue.logger.getEffectiveLevel()
+ bb.runqueue.logger.setLevel(logging.WARNING)
+
+ buildname = self.databuilder.mcdata[mc].getVar("BUILDNAME")
+ if fireevents:
+ bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.databuilder.mcdata[mc])
+
+ # Execute the runqueue
+ runlist = [[mc, item, task, fn]]
+
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
+
+ def buildFileIdle(server, rq, abort):
+
+ msg = None
+ interrupted = 0
+ if abort or self.state == state.forceshutdown:
+ rq.finish_runqueue(True)
+ msg = "Forced shutdown"
+ interrupted = 2
+ elif self.state == state.shutdown:
+ rq.finish_runqueue(False)
+ msg = "Stopped build"
+ interrupted = 1
+ failures = 0
+ try:
+ retval = rq.execute_runqueue()
+ except runqueue.TaskFailure as exc:
+ failures += len(exc.args)
+ retval = False
+ except SystemExit as exc:
+ self.command.finishAsyncCommand(str(exc))
+ if quietlog:
+ bb.runqueue.logger.setLevel(rqloglevel)
+ return False
+
+ if not retval:
+ if fireevents:
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, item, failures, interrupted), self.databuilder.mcdata[mc])
+ self.command.finishAsyncCommand(msg)
+ # We trashed self.recipecaches above
+ self.parsecache_valid = False
+ self.configuration.limited_deps = False
+ bb.parse.siggen.reset(self.data)
+ if quietlog:
+ bb.runqueue.logger.setLevel(rqloglevel)
+ return False
+ if retval is True:
+ return True
+ return retval
+
+ self.configuration.server_register_idlecallback(buildFileIdle, rq)
+
+ def buildTargets(self, targets, task):
+ """
+ Attempt to build the targets specified
+ """
+
+ def buildTargetsIdle(server, rq, abort):
+ msg = None
+ interrupted = 0
+ if abort or self.state == state.forceshutdown:
+ rq.finish_runqueue(True)
+ msg = "Forced shutdown"
+ interrupted = 2
+ elif self.state == state.shutdown:
+ rq.finish_runqueue(False)
+ msg = "Stopped build"
+ interrupted = 1
+ failures = 0
+ try:
+ retval = rq.execute_runqueue()
+ except runqueue.TaskFailure as exc:
+ failures += len(exc.args)
+ retval = False
+ except SystemExit as exc:
+ self.command.finishAsyncCommand(str(exc))
+ return False
+
+ if not retval:
+ try:
+ for mc in self.multiconfigs:
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.databuilder.mcdata[mc])
+ finally:
+ self.command.finishAsyncCommand(msg)
+ return False
+ if retval is True:
+ return True
+ return retval
+
+ self.reset_mtime_caches()
+ self.buildSetVars()
+
+ # If we are told to do the None task then query the default task
+ if (task == None):
+ task = self.configuration.cmd
+
+ if not task.startswith("do_"):
+ task = "do_%s" % task
+
+ packages = [target if ':' in target else '%s:%s' % (target, task) for target in targets]
+
+ bb.event.fire(bb.event.BuildInit(packages), self.data)
+
+ taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)
+
+ buildname = self.data.getVar("BUILDNAME", False)
+
+ # make targets to always look as <target>:do_<task>
+ ntargets = []
+ for target in runlist:
+ if target[0]:
+ ntargets.append("multiconfig:%s:%s:%s" % (target[0], target[1], target[2]))
+ ntargets.append("%s:%s" % (target[1], target[2]))
+
+ for mc in self.multiconfigs:
+ bb.event.fire(bb.event.BuildStarted(buildname, ntargets), self.databuilder.mcdata[mc])
+
+ rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
+ if 'universe' in targets:
+ rq.rqdata.warn_multi_bb = True
+
+ self.configuration.server_register_idlecallback(buildTargetsIdle, rq)
+
+
+ def getAllKeysWithFlags(self, flaglist):
+ dump = {}
+ for k in self.data.keys():
+ try:
+ expand = True
+ flags = self.data.getVarFlags(k)
+ if flags and "func" in flags and "python" in flags:
+ expand = False
+ v = self.data.getVar(k, expand)
+ if not k.startswith("__") and not isinstance(v, bb.data_smart.DataSmart):
+ dump[k] = {
+ 'v' : str(v) ,
+ 'history' : self.data.varhistory.variable(k),
+ }
+ for d in flaglist:
+ if flags and d in flags:
+ dump[k][d] = flags[d]
+ else:
+ dump[k][d] = None
+ except Exception as e:
+ print(e)
+ return dump
+
+
+ def updateCacheSync(self):
+ if self.state == state.running:
+ return
+
+ # reload files for which we got notifications
+ for p in self.inotify_modified_files:
+ bb.parse.update_cache(p)
+ if p in bb.parse.BBHandler.cached_statements:
+ del bb.parse.BBHandler.cached_statements[p]
+ self.inotify_modified_files = []
+
+ if not self.baseconfig_valid:
+ logger.debug(1, "Reloading base configuration data")
+ self.initConfigurationData()
+ self.handlePRServ()
+
+ # This is called for all async commands when self.state != running
+ def updateCache(self):
+ if self.state == state.running:
+ return
+
+ if self.state in (state.shutdown, state.forceshutdown, state.error):
+ if hasattr(self.parser, 'shutdown'):
+ self.parser.shutdown(clean=False, force = True)
+ raise bb.BBHandledException()
+
+ if self.state != state.parsing:
+ self.updateCacheSync()
+
+ if self.state != state.parsing and not self.parsecache_valid:
+ bb.parse.siggen.reset(self.data)
+ self.parseConfiguration ()
+ if CookerFeatures.SEND_SANITYEVENTS in self.featureset:
+ for mc in self.multiconfigs:
+ bb.event.fire(bb.event.SanityCheck(False), self.databuilder.mcdata[mc])
+
+ for mc in self.multiconfigs:
+ ignore = self.databuilder.mcdata[mc].getVar("ASSUME_PROVIDED") or ""
+ self.recipecaches[mc].ignored_dependencies = set(ignore.split())
+
+ for dep in self.configuration.extra_assume_provided:
+ self.recipecaches[mc].ignored_dependencies.add(dep)
+
+ self.collection = CookerCollectFiles(self.bbfile_config_priorities)
+ (filelist, masked, searchdirs) = self.collection.collect_bbfiles(self.data, self.data)
+
+ # Add inotify watches for directories searched for bb/bbappend files
+ for dirent in searchdirs:
+ self.add_filewatch([[dirent]], dirs=True)
+
+ self.parser = CookerParser(self, filelist, masked)
+ self.parsecache_valid = True
+
+ self.state = state.parsing
+
+ if not self.parser.parse_next():
+ collectlog.debug(1, "parsing complete")
+ if self.parser.error:
+ raise bb.BBHandledException()
+ self.show_appends_with_no_recipes()
+ self.handlePrefProviders()
+ for mc in self.multiconfigs:
+ self.recipecaches[mc].bbfile_priority = self.collection.collection_priorities(self.recipecaches[mc].pkg_fn, self.data)
+ self.state = state.running
+
+ # Send an event listing all stamps reachable after parsing
+ # which the metadata may use to clean up stale data
+ for mc in self.multiconfigs:
+ event = bb.event.ReachableStamps(self.recipecaches[mc].stamp)
+ bb.event.fire(event, self.databuilder.mcdata[mc])
+ return None
+
+ return True
+
+ def checkPackages(self, pkgs_to_build, task=None):
+
+ # Return a copy, don't modify the original
+ pkgs_to_build = pkgs_to_build[:]
+
+ if len(pkgs_to_build) == 0:
+ raise NothingToBuild
+
+ ignore = (self.data.getVar("ASSUME_PROVIDED") or "").split()
+ for pkg in pkgs_to_build:
+ if pkg in ignore:
+ parselog.warning("Explicit target \"%s\" is in ASSUME_PROVIDED, ignoring" % pkg)
+
+ if 'world' in pkgs_to_build:
+ pkgs_to_build.remove('world')
+ for mc in self.multiconfigs:
+ bb.providers.buildWorldTargetList(self.recipecaches[mc], task)
+ for t in self.recipecaches[mc].world_target:
+ if mc:
+ t = "multiconfig:" + mc + ":" + t
+ pkgs_to_build.append(t)
+
+ if 'universe' in pkgs_to_build:
+ parselog.warning("The \"universe\" target is only intended for testing and may produce errors.")
+ parselog.debug(1, "collating packages for \"universe\"")
+ pkgs_to_build.remove('universe')
+ for mc in self.multiconfigs:
+ for t in self.recipecaches[mc].universe_target:
+ if task:
+ foundtask = False
+ for provider_fn in self.recipecaches[mc].providers[t]:
+ if task in self.recipecaches[mc].task_deps[provider_fn]['tasks']:
+ foundtask = True
+ break
+ if not foundtask:
+ bb.debug(1, "Skipping %s for universe tasks as task %s doesn't exist" % (t, task))
+ continue
+ if mc:
+ t = "multiconfig:" + mc + ":" + t
+ pkgs_to_build.append(t)
+
+ return pkgs_to_build
+
+ def pre_serve(self):
+ # We now are in our own process so we can call this here.
+ # PRServ exits if its parent process exits
+ self.handlePRServ()
+ return
+
+ def post_serve(self):
+ prserv.serv.auto_shutdown()
+ bb.event.fire(CookerExit(), self.data)
+
+
+ def shutdown(self, force = False):
+ if force:
+ self.state = state.forceshutdown
+ else:
+ self.state = state.shutdown
+
+ if self.parser:
+ self.parser.shutdown(clean=not force, force=force)
+
+ def finishcommand(self):
+ self.state = state.initial
+
+ def reset(self):
+ self.initConfigurationData()
+
+ def clientComplete(self):
+ """Called when the client is done using the server"""
+ self.finishcommand()
+ self.extraconfigdata = {}
+ self.command.reset()
+ self.databuilder.reset()
+ self.data = self.databuilder.data
+
+
+class CookerExit(bb.event.Event):
+ """
+ Notify clients of the Cooker shutdown
+ """
+
+ def __init__(self):
+ bb.event.Event.__init__(self)
+
+
+class CookerCollectFiles(object):
+ def __init__(self, priorities):
+ self.bbappends = []
+ self.bbfile_config_priorities = priorities
+
+ def calc_bbfile_priority( self, filename, matched = None ):
+ for _, _, regex, pri in self.bbfile_config_priorities:
+ if regex.match(filename):
+ if matched != None:
+ if not regex in matched:
+ matched.add(regex)
+ return pri
+ return 0
+
+ def get_bbfiles(self):
+ """Get list of default .bb files by reading out the current directory"""
+ path = os.getcwd()
+ contents = os.listdir(path)
+ bbfiles = []
+ for f in contents:
+ if f.endswith(".bb"):
+ bbfiles.append(os.path.abspath(os.path.join(path, f)))
+ return bbfiles
+
+ def find_bbfiles(self, path):
+ """Find all the .bb and .bbappend files in a directory"""
+ found = []
+ for dir, dirs, files in os.walk(path):
+ for ignored in ('SCCS', 'CVS', '.svn'):
+ if ignored in dirs:
+ dirs.remove(ignored)
+ found += [os.path.join(dir, f) for f in files if (f.endswith(['.bb', '.bbappend']))]
+
+ return found
+
+ def collect_bbfiles(self, config, eventdata):
+ """Collect all available .bb build files"""
+ masked = 0
+
+ collectlog.debug(1, "collecting .bb files")
+
+ files = (config.getVar( "BBFILES") or "").split()
+ config.setVar("BBFILES", " ".join(files))
+
+ # Sort files by priority
+ files.sort( key=lambda fileitem: self.calc_bbfile_priority(fileitem) )
+
+ if not len(files):
+ files = self.get_bbfiles()
+
+ if not len(files):
+ collectlog.error("no recipe files to build, check your BBPATH and BBFILES?")
+ bb.event.fire(CookerExit(), eventdata)
+
+ # We need to track where we look so that we can add inotify watches. There
+ # is no nice way to do this, this is horrid. We intercept the os.listdir()
+ # (or os.scandir() for python 3.6+) calls while we run glob().
+ origlistdir = os.listdir
+ if hasattr(os, 'scandir'):
+ origscandir = os.scandir
+ searchdirs = []
+
+ def ourlistdir(d):
+ searchdirs.append(d)
+ return origlistdir(d)
+
+ def ourscandir(d):
+ searchdirs.append(d)
+ return origscandir(d)
+
+ os.listdir = ourlistdir
+ if hasattr(os, 'scandir'):
+ os.scandir = ourscandir
+ try:
+ # Can't use set here as order is important
+ newfiles = []
+ for f in files:
+ if os.path.isdir(f):
+ dirfiles = self.find_bbfiles(f)
+ for g in dirfiles:
+ if g not in newfiles:
+ newfiles.append(g)
+ else:
+ globbed = glob.glob(f)
+ if not globbed and os.path.exists(f):
+ globbed = [f]
+ # glob gives files in order on disk. Sort to be deterministic.
+ for g in sorted(globbed):
+ if g not in newfiles:
+ newfiles.append(g)
+ finally:
+ os.listdir = origlistdir
+ if hasattr(os, 'scandir'):
+ os.scandir = origscandir
+
+ bbmask = config.getVar('BBMASK')
+
+ if bbmask:
+ # First validate the individual regular expressions and ignore any
+ # that do not compile
+ bbmasks = []
+ for mask in bbmask.split():
+ # When constructing an older style single regex, it's possible for BBMASK
+ # to end up beginning with '|', which matches and masks _everything_.
+ if mask.startswith("|"):
+ collectlog.warn("BBMASK contains regular expression beginning with '|', fixing: %s" % mask)
+ mask = mask[1:]
+ try:
+ re.compile(mask)
+ bbmasks.append(mask)
+ except sre_constants.error:
+ collectlog.critical("BBMASK contains an invalid regular expression, ignoring: %s" % mask)
+
+ # Then validate the combined regular expressions. This should never
+ # fail, but better safe than sorry...
+ bbmask = "|".join(bbmasks)
+ try:
+ bbmask_compiled = re.compile(bbmask)
+ except sre_constants.error:
+ collectlog.critical("BBMASK is not a valid regular expression, ignoring: %s" % bbmask)
+ bbmask = None
+
+ bbfiles = []
+ bbappend = []
+ for f in newfiles:
+ if bbmask and bbmask_compiled.search(f):
+ collectlog.debug(1, "skipping masked file %s", f)
+ masked += 1
+ continue
+ if f.endswith('.bb'):
+ bbfiles.append(f)
+ elif f.endswith('.bbappend'):
+ bbappend.append(f)
+ else:
+ collectlog.debug(1, "skipping %s: unknown file extension", f)
+
+ # Build a list of .bbappend files for each .bb file
+ for f in bbappend:
+ base = os.path.basename(f).replace('.bbappend', '.bb')
+ self.bbappends.append((base, f))
+
+ # Find overlayed recipes
+ # bbfiles will be in priority order which makes this easy
+ bbfile_seen = dict()
+ self.overlayed = defaultdict(list)
+ for f in reversed(bbfiles):
+ base = os.path.basename(f)
+ if base not in bbfile_seen:
+ bbfile_seen[base] = f
+ else:
+ topfile = bbfile_seen[base]
+ self.overlayed[topfile].append(f)
+
+ return (bbfiles, masked, searchdirs)
+
+ def get_file_appends(self, fn):
+ """
+ Returns a list of .bbappend files to apply to fn
+ """
+ filelist = []
+ f = os.path.basename(fn)
+ for b in self.bbappends:
+ (bbappend, filename) = b
+ if (bbappend == f) or ('%' in bbappend and bbappend.startswith(f[:bbappend.index('%')])):
+ filelist.append(filename)
+ return filelist
+
+ def collection_priorities(self, pkgfns, d):
+
+ priorities = {}
+
+ # Calculate priorities for each file
+ matched = set()
+ for p in pkgfns:
+ realfn, cls, mc = bb.cache.virtualfn2realfn(p)
+ priorities[p] = self.calc_bbfile_priority(realfn, matched)
+
+ unmatched = set()
+ for _, _, regex, pri in self.bbfile_config_priorities:
+ if not regex in matched:
+ unmatched.add(regex)
+
+ # Don't show the warning if the BBFILE_PATTERN did match .bbappend files
+ def find_bbappend_match(regex):
+ for b in self.bbappends:
+ (bbfile, append) = b
+ if regex.match(append):
+ # If the bbappend is matched by already "matched set", return False
+ for matched_regex in matched:
+ if matched_regex.match(append):
+ return False
+ return True
+ return False
+
+ for unmatch in unmatched.copy():
+ if find_bbappend_match(unmatch):
+ unmatched.remove(unmatch)
+
+ for collection, pattern, regex, _ in self.bbfile_config_priorities:
+ if regex in unmatched:
+ if d.getVar('BBFILE_PATTERN_IGNORE_EMPTY_%s' % collection) != '1':
+ collectlog.warning("No bb files matched BBFILE_PATTERN_%s '%s'" % (collection, pattern))
+
+ return priorities
+
+class ParsingFailure(Exception):
+ def __init__(self, realexception, recipe):
+ self.realexception = realexception
+ self.recipe = recipe
+ Exception.__init__(self, realexception, recipe)
+
+class Feeder(multiprocessing.Process):
+ def __init__(self, jobs, to_parsers, quit):
+ self.quit = quit
+ self.jobs = jobs
+ self.to_parsers = to_parsers
+ multiprocessing.Process.__init__(self)
+
+ def run(self):
+ while True:
+ try:
+ quit = self.quit.get_nowait()
+ except queue.Empty:
+ pass
+ else:
+ if quit == 'cancel':
+ self.to_parsers.cancel_join_thread()
+ break
+
+ try:
+ job = self.jobs.pop()
+ except IndexError:
+ break
+
+ try:
+ self.to_parsers.put(job, timeout=0.5)
+ except queue.Full:
+ self.jobs.insert(0, job)
+ continue
+
+class Parser(multiprocessing.Process):
+ def __init__(self, jobs, results, quit, init, profile):
+ self.jobs = jobs
+ self.results = results
+ self.quit = quit
+ self.init = init
+ multiprocessing.Process.__init__(self)
+ self.context = bb.utils.get_context().copy()
+ self.handlers = bb.event.get_class_handlers().copy()
+ self.profile = profile
+
+ def run(self):
+
+ if not self.profile:
+ self.realrun()
+ return
+
+ try:
+ import cProfile as profile
+ except:
+ import profile
+ prof = profile.Profile()
+ try:
+ profile.Profile.runcall(prof, self.realrun)
+ finally:
+ logfile = "profile-parse-%s.log" % multiprocessing.current_process().name
+ prof.dump_stats(logfile)
+
+ def realrun(self):
+ if self.init:
+ self.init()
+
+ pending = []
+ while True:
+ try:
+ self.quit.get_nowait()
+ except queue.Empty:
+ pass
+ else:
+ self.results.cancel_join_thread()
+ break
+
+ if pending:
+ result = pending.pop()
+ else:
+ try:
+ job = self.jobs.get(timeout=0.25)
+ except queue.Empty:
+ continue
+
+ if job is None:
+ break
+ result = self.parse(*job)
+
+ try:
+ self.results.put(result, timeout=0.25)
+ except queue.Full:
+ pending.append(result)
+
+ def parse(self, filename, appends):
+ try:
+ # Record the filename we're parsing into any events generated
+ def parse_filter(self, record):
+ record.taskpid = bb.event.worker_pid
+ record.fn = filename
+ return True
+
+ # Reset our environment and handlers to the original settings
+ bb.utils.set_context(self.context.copy())
+ bb.event.set_class_handlers(self.handlers.copy())
+ bb.event.LogHandler.filter = parse_filter
+
+ return True, self.bb_cache.parse(filename, appends)
+ except Exception as exc:
+ tb = sys.exc_info()[2]
+ exc.recipe = filename
+ exc.traceback = list(bb.exceptions.extract_traceback(tb, context=3))
+ return True, exc
+ # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown
+ # and for example a worker thread doesn't just exit on its own in response to
+ # a SystemExit event for example.
+ except BaseException as exc:
+ return True, ParsingFailure(exc, filename)
+
+class CookerParser(object):
+ def __init__(self, cooker, filelist, masked):
+ self.filelist = filelist
+ self.cooker = cooker
+ self.cfgdata = cooker.data
+ self.cfghash = cooker.data_hash
+ self.cfgbuilder = cooker.databuilder
+
+ # Accounting statistics
+ self.parsed = 0
+ self.cached = 0
+ self.error = 0
+ self.masked = masked
+
+ self.skipped = 0
+ self.virtuals = 0
+ self.total = len(filelist)
+
+ self.current = 0
+ self.process_names = []
+
+ self.bb_cache = bb.cache.Cache(self.cfgbuilder, self.cfghash, cooker.caches_array)
+ self.fromcache = []
+ self.willparse = []
+ for filename in self.filelist:
+ appends = self.cooker.collection.get_file_appends(filename)
+ if not self.bb_cache.cacheValid(filename, appends):
+ self.willparse.append((filename, appends))
+ else:
+ self.fromcache.append((filename, appends))
+ self.toparse = self.total - len(self.fromcache)
+ self.progress_chunk = int(max(self.toparse / 100, 1))
+
+ self.num_processes = min(int(self.cfgdata.getVar("BB_NUMBER_PARSE_THREADS") or
+ multiprocessing.cpu_count()), len(self.willparse))
+
+ self.start()
+ self.haveshutdown = False
+
+ def start(self):
+ self.results = self.load_cached()
+ self.processes = []
+ if self.toparse:
+ bb.event.fire(bb.event.ParseStarted(self.toparse), self.cfgdata)
+ def init():
+ Parser.bb_cache = self.bb_cache
+ bb.utils.set_process_name(multiprocessing.current_process().name)
+ multiprocessing.util.Finalize(None, bb.codeparser.parser_cache_save, exitpriority=1)
+ multiprocessing.util.Finalize(None, bb.fetch.fetcher_parse_save, exitpriority=1)
+
+ self.feeder_quit = multiprocessing.Queue(maxsize=1)
+ self.parser_quit = multiprocessing.Queue(maxsize=self.num_processes)
+ self.jobs = multiprocessing.Queue(maxsize=self.num_processes)
+ self.result_queue = multiprocessing.Queue()
+ self.feeder = Feeder(self.willparse, self.jobs, self.feeder_quit)
+ self.feeder.start()
+ for i in range(0, self.num_processes):
+ parser = Parser(self.jobs, self.result_queue, self.parser_quit, init, self.cooker.configuration.profile)
+ parser.start()
+ self.process_names.append(parser.name)
+ self.processes.append(parser)
+
+ self.results = itertools.chain(self.results, self.parse_generator())
+
+ def shutdown(self, clean=True, force=False):
+ if not self.toparse:
+ return
+ if self.haveshutdown:
+ return
+ self.haveshutdown = True
+
+ if clean:
+ event = bb.event.ParseCompleted(self.cached, self.parsed,
+ self.skipped, self.masked,
+ self.virtuals, self.error,
+ self.total)
+
+ bb.event.fire(event, self.cfgdata)
+ self.feeder_quit.put(None)
+ for process in self.processes:
+ self.parser_quit.put(None)
+ else:
+ self.feeder_quit.put('cancel')
+
+ self.parser_quit.cancel_join_thread()
+ for process in self.processes:
+ self.parser_quit.put(None)
+
+ self.jobs.cancel_join_thread()
+
+ for process in self.processes:
+ if force:
+ process.join(.1)
+ process.terminate()
+ else:
+ process.join()
+ self.feeder.join()
+
+ sync = threading.Thread(target=self.bb_cache.sync)
+ sync.start()
+ multiprocessing.util.Finalize(None, sync.join, exitpriority=-100)
+ bb.codeparser.parser_cache_savemerge()
+ bb.fetch.fetcher_parse_done()
+ if self.cooker.configuration.profile:
+ profiles = []
+ for i in self.process_names:
+ logfile = "profile-parse-%s.log" % i
+ if os.path.exists(logfile):
+ profiles.append(logfile)
+
+ pout = "profile-parse.log.processed"
+ bb.utils.process_profilelog(profiles, pout = pout)
+ print("Processed parsing statistics saved to %s" % (pout))
+
+ def load_cached(self):
+ for filename, appends in self.fromcache:
+ cached, infos = self.bb_cache.load(filename, appends)
+ yield not cached, infos
+
+ def parse_generator(self):
+ while True:
+ if self.parsed >= self.toparse:
+ break
+
+ try:
+ result = self.result_queue.get(timeout=0.25)
+ except queue.Empty:
+ pass
+ else:
+ value = result[1]
+ if isinstance(value, BaseException):
+ raise value
+ else:
+ yield result
+
+ def parse_next(self):
+ result = []
+ parsed = None
+ try:
+ parsed, result = next(self.results)
+ except StopIteration:
+ self.shutdown()
+ return False
+ except bb.BBHandledException as exc:
+ self.error += 1
+ logger.error('Failed to parse recipe: %s' % exc.recipe)
+ self.shutdown(clean=False)
+ return False
+ except ParsingFailure as exc:
+ self.error += 1
+ logger.error('Unable to parse %s: %s' %
+ (exc.recipe, bb.exceptions.to_string(exc.realexception)))
+ self.shutdown(clean=False)
+ return False
+ except bb.parse.ParseError as exc:
+ self.error += 1
+ logger.error(str(exc))
+ self.shutdown(clean=False)
+ return False
+ except bb.data_smart.ExpansionError as exc:
+ self.error += 1
+ bbdir = os.path.dirname(__file__) + os.sep
+ etype, value, _ = sys.exc_info()
+ tb = list(itertools.dropwhile(lambda e: e.filename.startswith(bbdir), exc.traceback))
+ logger.error('ExpansionError during parsing %s', value.recipe,
+ exc_info=(etype, value, tb))
+ self.shutdown(clean=False)
+ return False
+ except Exception as exc:
+ self.error += 1
+ etype, value, tb = sys.exc_info()
+ if hasattr(value, "recipe"):
+ logger.error('Unable to parse %s' % value.recipe,
+ exc_info=(etype, value, exc.traceback))
+ else:
+ # Most likely, an exception occurred during raising an exception
+ import traceback
+ logger.error('Exception during parse: %s' % traceback.format_exc())
+ self.shutdown(clean=False)
+ return False
+
+ self.current += 1
+ self.virtuals += len(result)
+ if parsed:
+ self.parsed += 1
+ if self.parsed % self.progress_chunk == 0:
+ bb.event.fire(bb.event.ParseProgress(self.parsed, self.toparse),
+ self.cfgdata)
+ else:
+ self.cached += 1
+
+ for virtualfn, info_array in result:
+ if info_array[0].skipped:
+ self.skipped += 1
+ self.cooker.skiplist[virtualfn] = SkippedPackage(info_array[0])
+ (fn, cls, mc) = bb.cache.virtualfn2realfn(virtualfn)
+ self.bb_cache.add_info(virtualfn, info_array, self.cooker.recipecaches[mc],
+ parsed=parsed, watcher = self.cooker.add_filewatch)
+ return True
+
+ def reparse(self, filename):
+ infos = self.bb_cache.parse(filename, self.cooker.collection.get_file_appends(filename))
+ for vfn, info_array in infos:
+ (fn, cls, mc) = bb.cache.virtualfn2realfn(vfn)
+ self.cooker.recipecaches[mc].add_from_recipeinfo(vfn, info_array)
diff --git a/poky/bitbake/lib/bb/cookerdata.py b/poky/bitbake/lib/bb/cookerdata.py
new file mode 100644
index 000000000..5df66e617
--- /dev/null
+++ b/poky/bitbake/lib/bb/cookerdata.py
@@ -0,0 +1,434 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import logging
+import os
+import re
+import sys
+from functools import wraps
+import bb
+from bb import data
+import bb.parse
+
+logger = logging.getLogger("BitBake")
+parselog = logging.getLogger("BitBake.Parsing")
+
+class ConfigParameters(object):
+ def __init__(self, argv=sys.argv):
+ self.options, targets = self.parseCommandLine(argv)
+ self.environment = self.parseEnvironment()
+
+ self.options.pkgs_to_build = targets or []
+
+ for key, val in self.options.__dict__.items():
+ setattr(self, key, val)
+
+ def parseCommandLine(self, argv=sys.argv):
+ raise Exception("Caller must implement commandline option parsing")
+
+ def parseEnvironment(self):
+ return os.environ.copy()
+
+ def updateFromServer(self, server):
+ if not self.options.cmd:
+ defaulttask, error = server.runCommand(["getVariable", "BB_DEFAULT_TASK"])
+ if error:
+ raise Exception("Unable to get the value of BB_DEFAULT_TASK from the server: %s" % error)
+ self.options.cmd = defaulttask or "build"
+ _, error = server.runCommand(["setConfig", "cmd", self.options.cmd])
+ if error:
+ raise Exception("Unable to set configuration option 'cmd' on the server: %s" % error)
+
+ if not self.options.pkgs_to_build:
+ bbpkgs, error = server.runCommand(["getVariable", "BBTARGETS"])
+ if error:
+ raise Exception("Unable to get the value of BBTARGETS from the server: %s" % error)
+ if bbpkgs:
+ self.options.pkgs_to_build.extend(bbpkgs.split())
+
+ def updateToServer(self, server, environment):
+ options = {}
+ for o in ["abort", "force", "invalidate_stamp",
+ "verbose", "debug", "dry_run", "dump_signatures",
+ "debug_domains", "extra_assume_provided", "profile",
+ "prefile", "postfile", "server_timeout"]:
+ options[o] = getattr(self.options, o)
+
+ ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
+ if error:
+ raise Exception("Unable to update the server configuration with local parameters: %s" % error)
+
+ def parseActions(self):
+ # Parse any commandline into actions
+ action = {'action':None, 'msg':None}
+ if self.options.show_environment:
+ if 'world' in self.options.pkgs_to_build:
+ action['msg'] = "'world' is not a valid target for --environment."
+ elif 'universe' in self.options.pkgs_to_build:
+ action['msg'] = "'universe' is not a valid target for --environment."
+ elif len(self.options.pkgs_to_build) > 1:
+ action['msg'] = "Only one target can be used with the --environment option."
+ elif self.options.buildfile and len(self.options.pkgs_to_build) > 0:
+ action['msg'] = "No target should be used with the --environment and --buildfile options."
+ elif len(self.options.pkgs_to_build) > 0:
+ action['action'] = ["showEnvironmentTarget", self.options.pkgs_to_build]
+ else:
+ action['action'] = ["showEnvironment", self.options.buildfile]
+ elif self.options.buildfile is not None:
+ action['action'] = ["buildFile", self.options.buildfile, self.options.cmd]
+ elif self.options.revisions_changed:
+ action['action'] = ["compareRevisions"]
+ elif self.options.show_versions:
+ action['action'] = ["showVersions"]
+ elif self.options.parse_only:
+ action['action'] = ["parseFiles"]
+ elif self.options.dot_graph:
+ if self.options.pkgs_to_build:
+ action['action'] = ["generateDotGraph", self.options.pkgs_to_build, self.options.cmd]
+ else:
+ action['msg'] = "Please specify a package name for dependency graph generation."
+ else:
+ if self.options.pkgs_to_build:
+ action['action'] = ["buildTargets", self.options.pkgs_to_build, self.options.cmd]
+ else:
+ #action['msg'] = "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information."
+ action = None
+ self.options.initialaction = action
+ return action
+
+class CookerConfiguration(object):
+ """
+ Manages build options and configurations for one run
+ """
+
+ def __init__(self):
+ self.debug_domains = []
+ self.extra_assume_provided = []
+ self.prefile = []
+ self.postfile = []
+ self.debug = 0
+ self.cmd = None
+ self.abort = True
+ self.force = False
+ self.profile = False
+ self.nosetscene = False
+ self.setsceneonly = False
+ self.invalidate_stamp = False
+ self.dump_signatures = []
+ self.dry_run = False
+ self.tracking = False
+ self.xmlrpcinterface = []
+ self.server_timeout = None
+ self.writeeventlog = False
+ self.server_only = False
+ self.limited_deps = False
+ self.runall = []
+ self.runonly = []
+
+ self.env = {}
+
+ def setConfigParameters(self, parameters):
+ for key in self.__dict__.keys():
+ if key in parameters.options.__dict__:
+ setattr(self, key, parameters.options.__dict__[key])
+ self.env = parameters.environment.copy()
+
+ def setServerRegIdleCallback(self, srcb):
+ self.server_register_idlecallback = srcb
+
+ def __getstate__(self):
+ state = {}
+ for key in self.__dict__.keys():
+ if key == "server_register_idlecallback":
+ state[key] = None
+ else:
+ state[key] = getattr(self, key)
+ return state
+
+ def __setstate__(self,state):
+ for k in state:
+ setattr(self, k, state[k])
+
+
+def catch_parse_error(func):
+ """Exception handling bits for our parsing"""
+ @wraps(func)
+ def wrapped(fn, *args):
+ try:
+ return func(fn, *args)
+ except IOError as exc:
+ import traceback
+ parselog.critical(traceback.format_exc())
+ parselog.critical("Unable to parse %s: %s" % (fn, exc))
+ sys.exit(1)
+ except bb.data_smart.ExpansionError as exc:
+ import traceback
+
+ bbdir = os.path.dirname(__file__) + os.sep
+ exc_class, exc, tb = sys.exc_info()
+ for tb in iter(lambda: tb.tb_next, None):
+ # Skip frames in bitbake itself, we only want the metadata
+ fn, _, _, _ = traceback.extract_tb(tb, 1)[0]
+ if not fn.startswith(bbdir):
+ break
+ parselog.critical("Unable to parse %s" % fn, exc_info=(exc_class, exc, tb))
+ sys.exit(1)
+ except bb.parse.ParseError as exc:
+ parselog.critical(str(exc))
+ sys.exit(1)
+ return wrapped
+
+@catch_parse_error
+def parse_config_file(fn, data, include=True):
+ return bb.parse.handle(fn, data, include)
+
+@catch_parse_error
+def _inherit(bbclass, data):
+ bb.parse.BBHandler.inherit(bbclass, "configuration INHERITs", 0, data)
+ return data
+
+def findConfigFile(configfile, data):
+ search = []
+ bbpath = data.getVar("BBPATH")
+ if bbpath:
+ for i in bbpath.split(":"):
+ search.append(os.path.join(i, "conf", configfile))
+ path = os.getcwd()
+ while path != "/":
+ search.append(os.path.join(path, "conf", configfile))
+ path, _ = os.path.split(path)
+
+ for i in search:
+ if os.path.exists(i):
+ return i
+
+ return None
+
+#
+# We search for a conf/bblayers.conf under an entry in BBPATH or in cwd working
+# up to /. If that fails, we search for a conf/bitbake.conf in BBPATH.
+#
+
+def findTopdir():
+ d = bb.data.init()
+ bbpath = None
+ if 'BBPATH' in os.environ:
+ bbpath = os.environ['BBPATH']
+ d.setVar('BBPATH', bbpath)
+
+ layerconf = findConfigFile("bblayers.conf", d)
+ if layerconf:
+ return os.path.dirname(os.path.dirname(layerconf))
+ if bbpath:
+ bitbakeconf = bb.utils.which(bbpath, "conf/bitbake.conf")
+ if bitbakeconf:
+ return os.path.dirname(os.path.dirname(bitbakeconf))
+ return None
+
+class CookerDataBuilder(object):
+
+ def __init__(self, cookercfg, worker = False):
+
+ self.prefiles = cookercfg.prefile
+ self.postfiles = cookercfg.postfile
+ self.tracking = cookercfg.tracking
+
+ bb.utils.set_context(bb.utils.clean_context())
+ bb.event.set_class_handlers(bb.event.clean_class_handlers())
+ self.basedata = bb.data.init()
+ if self.tracking:
+ self.basedata.enableTracking()
+
+ # Keep a datastore of the initial environment variables and their
+ # values from when BitBake was launched to enable child processes
+ # to use environment variables which have been cleaned from the
+ # BitBake processes env
+ self.savedenv = bb.data.init()
+ for k in cookercfg.env:
+ self.savedenv.setVar(k, cookercfg.env[k])
+
+ filtered_keys = bb.utils.approved_variables()
+ bb.data.inheritFromOS(self.basedata, self.savedenv, filtered_keys)
+ self.basedata.setVar("BB_ORIGENV", self.savedenv)
+
+ if worker:
+ self.basedata.setVar("BB_WORKERCONTEXT", "1")
+
+ self.data = self.basedata
+ self.mcdata = {}
+
+ def parseBaseConfiguration(self):
+ try:
+ bb.parse.init_parser(self.basedata)
+ self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
+
+ if self.data.getVar("BB_WORKERCONTEXT", False) is None:
+ bb.fetch.fetcher_init(self.data)
+ bb.codeparser.parser_cache_init(self.data)
+
+ bb.event.fire(bb.event.ConfigParsed(), self.data)
+
+ reparse_cnt = 0
+ while self.data.getVar("BB_INVALIDCONF", False) is True:
+ if reparse_cnt > 20:
+ logger.error("Configuration has been re-parsed over 20 times, "
+ "breaking out of the loop...")
+ raise Exception("Too deep config re-parse loop. Check locations where "
+ "BB_INVALIDCONF is being set (ConfigParsed event handlers)")
+ self.data.setVar("BB_INVALIDCONF", False)
+ self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
+ reparse_cnt += 1
+ bb.event.fire(bb.event.ConfigParsed(), self.data)
+
+ bb.parse.init_parser(self.data)
+ self.data_hash = self.data.get_hash()
+ self.mcdata[''] = self.data
+
+ multiconfig = (self.data.getVar("BBMULTICONFIG") or "").split()
+ for config in multiconfig:
+ mcdata = self.parseConfigurationFiles(self.prefiles, self.postfiles, config)
+ bb.event.fire(bb.event.ConfigParsed(), mcdata)
+ self.mcdata[config] = mcdata
+ if multiconfig:
+ bb.event.fire(bb.event.MultiConfigParsed(self.mcdata), self.data)
+
+ except (SyntaxError, bb.BBHandledException):
+ raise bb.BBHandledException
+ except bb.data_smart.ExpansionError as e:
+ logger.error(str(e))
+ raise bb.BBHandledException
+ except Exception:
+ logger.exception("Error parsing configuration files")
+ raise bb.BBHandledException
+
+ # Create a copy so we can reset at a later date when UIs disconnect
+ self.origdata = self.data
+ self.data = bb.data.createCopy(self.origdata)
+ self.mcdata[''] = self.data
+
+ def reset(self):
+ # We may not have run parseBaseConfiguration() yet
+ if not hasattr(self, 'origdata'):
+ return
+ self.data = bb.data.createCopy(self.origdata)
+ self.mcdata[''] = self.data
+
+ def _findLayerConf(self, data):
+ return findConfigFile("bblayers.conf", data)
+
+ def parseConfigurationFiles(self, prefiles, postfiles, mc = "default"):
+ data = bb.data.createCopy(self.basedata)
+ data.setVar("BB_CURRENT_MC", mc)
+
+ # Parse files for loading *before* bitbake.conf and any includes
+ for f in prefiles:
+ data = parse_config_file(f, data)
+
+ layerconf = self._findLayerConf(data)
+ if layerconf:
+ parselog.debug(2, "Found bblayers.conf (%s)", layerconf)
+ # By definition bblayers.conf is in conf/ of TOPDIR.
+ # We may have been called with cwd somewhere else so reset TOPDIR
+ data.setVar("TOPDIR", os.path.dirname(os.path.dirname(layerconf)))
+ data = parse_config_file(layerconf, data)
+
+ layers = (data.getVar('BBLAYERS') or "").split()
+
+ data = bb.data.createCopy(data)
+ approved = bb.utils.approved_variables()
+ for layer in layers:
+ if not os.path.isdir(layer):
+ parselog.critical("Layer directory '%s' does not exist! "
+ "Please check BBLAYERS in %s" % (layer, layerconf))
+ sys.exit(1)
+ parselog.debug(2, "Adding layer %s", layer)
+ if 'HOME' in approved and '~' in layer:
+ layer = os.path.expanduser(layer)
+ if layer.endswith('/'):
+ layer = layer.rstrip('/')
+ data.setVar('LAYERDIR', layer)
+ data.setVar('LAYERDIR_RE', re.escape(layer))
+ data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
+ data.expandVarref('LAYERDIR')
+ data.expandVarref('LAYERDIR_RE')
+
+ data.delVar('LAYERDIR_RE')
+ data.delVar('LAYERDIR')
+
+ bbfiles_dynamic = (data.getVar('BBFILES_DYNAMIC') or "").split()
+ collections = (data.getVar('BBFILE_COLLECTIONS') or "").split()
+ invalid = []
+ for entry in bbfiles_dynamic:
+ parts = entry.split(":", 1)
+ if len(parts) != 2:
+ invalid.append(entry)
+ continue
+ l, f = parts
+ if l in collections:
+ data.appendVar("BBFILES", " " + f)
+ if invalid:
+ bb.fatal("BBFILES_DYNAMIC entries must be of the form <collection name>:<filename pattern>, not:\n %s" % "\n ".join(invalid))
+
+ layerseries = set((data.getVar("LAYERSERIES_CORENAMES") or "").split())
+ for c in collections:
+ compat = set((data.getVar("LAYERSERIES_COMPAT_%s" % c) or "").split())
+ if compat and not (compat & layerseries):
+ bb.fatal("Layer %s is not compatible with the core layer which only supports these series: %s (layer is compatible with %s)"
+ % (c, " ".join(layerseries), " ".join(compat)))
+ elif not compat and not data.getVar("BB_WORKERCONTEXT"):
+ bb.warn("Layer %s should set LAYERSERIES_COMPAT_%s in its conf/layer.conf file to list the core layer names it is compatible with." % (c, c))
+
+ if not data.getVar("BBPATH"):
+ msg = "The BBPATH variable is not set"
+ if not layerconf:
+ msg += (" and bitbake did not find a conf/bblayers.conf file in"
+ " the expected location.\nMaybe you accidentally"
+ " invoked bitbake from the wrong directory?")
+ raise SystemExit(msg)
+
+ data = parse_config_file(os.path.join("conf", "bitbake.conf"), data)
+
+ # Parse files for loading *after* bitbake.conf and any includes
+ for p in postfiles:
+ data = parse_config_file(p, data)
+
+ # Handle any INHERITs and inherit the base class
+ bbclasses = ["base"] + (data.getVar('INHERIT') or "").split()
+ for bbclass in bbclasses:
+ data = _inherit(bbclass, data)
+
+ # Nomally we only register event handlers at the end of parsing .bb files
+ # We register any handlers we've found so far here...
+ for var in data.getVar('__BBHANDLERS', False) or []:
+ handlerfn = data.getVarFlag(var, "filename", False)
+ if not handlerfn:
+ parselog.critical("Undefined event handler function '%s'" % var)
+ sys.exit(1)
+ handlerln = int(data.getVarFlag(var, "lineno", False))
+ bb.event.register(var, data.getVar(var, False), (data.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
+
+ data.setVar('BBINCLUDED',bb.parse.get_file_depends(data))
+
+ return data
+
diff --git a/poky/bitbake/lib/bb/daemonize.py b/poky/bitbake/lib/bb/daemonize.py
new file mode 100644
index 000000000..8300d1d0f
--- /dev/null
+++ b/poky/bitbake/lib/bb/daemonize.py
@@ -0,0 +1,82 @@
+"""
+Python Daemonizing helper
+
+Originally based on code Copyright (C) 2005 Chad J. Schroeder but now heavily modified
+to allow a function to be daemonized and return for bitbake use by Richard Purdie
+"""
+
+import os
+import sys
+import io
+import traceback
+
+def createDaemon(function, logfile):
+ """
+ Detach a process from the controlling terminal and run it in the
+ background as a daemon, returning control to the caller.
+ """
+
+ try:
+ # Fork a child process so the parent can exit. This returns control to
+ # the command-line or shell. It also guarantees that the child will not
+ # be a process group leader, since the child receives a new process ID
+ # and inherits the parent's process group ID. This step is required
+ # to insure that the next call to os.setsid is successful.
+ pid = os.fork()
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
+
+ if (pid == 0): # The first child.
+ # To become the session leader of this new session and the process group
+ # leader of the new process group, we call os.setsid(). The process is
+ # also guaranteed not to have a controlling terminal.
+ os.setsid()
+ try:
+ # Fork a second child and exit immediately to prevent zombies. This
+ # causes the second child process to be orphaned, making the init
+ # process responsible for its cleanup. And, since the first child is
+ # a session leader without a controlling terminal, it's possible for
+ # it to acquire one by opening a terminal in the future (System V-
+ # based systems). This second fork guarantees that the child is no
+ # longer a session leader, preventing the daemon from ever acquiring
+ # a controlling terminal.
+ pid = os.fork() # Fork a second child.
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
+
+ if (pid != 0):
+ # Parent (the first child) of the second child.
+ # exit() or _exit()?
+ # _exit is like exit(), but it doesn't call any functions registered
+ # with atexit (and on_exit) or any registered signal handlers. It also
+ # closes any open file descriptors. Using exit() may cause all stdio
+ # streams to be flushed twice and any temporary files may be unexpectedly
+ # removed. It's therefore recommended that child branches of a fork()
+ # and the parent branch(es) of a daemon use _exit().
+ os._exit(0)
+ else:
+ os.waitpid(pid, 0)
+ return
+
+ # The second child.
+
+ # Replace standard fds with our own
+ si = open('/dev/null', 'r')
+ os.dup2(si.fileno(), sys.stdin.fileno())
+
+ try:
+ so = open(logfile, 'a+')
+ se = so
+ os.dup2(so.fileno(), sys.stdout.fileno())
+ os.dup2(se.fileno(), sys.stderr.fileno())
+ except io.UnsupportedOperation:
+ sys.stdout = open(logfile, 'a+')
+ sys.stderr = sys.stdout
+
+ try:
+ function()
+ except Exception as e:
+ traceback.print_exc()
+ finally:
+ bb.event.print_ui_queue()
+ os._exit(0)
diff --git a/poky/bitbake/lib/bb/data.py b/poky/bitbake/lib/bb/data.py
new file mode 100644
index 000000000..80a7879cb
--- /dev/null
+++ b/poky/bitbake/lib/bb/data.py
@@ -0,0 +1,403 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Data' implementations
+
+Functions for interacting with the data structure used by the
+BitBake build tools.
+
+The expandKeys and update_data are the most expensive
+operations. At night the cookie monster came by and
+suggested 'give me cookies on setting the variables and
+things will work out'. Taking this suggestion into account
+applying the skills from the not yet passed 'Entwurf und
+Analyse von Algorithmen' lecture and the cookie
+monster seems to be right. We will track setVar more carefully
+to have faster update_data and expandKeys operations.
+
+This is a trade-off between speed and memory again but
+the speed is more critical here.
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2005 Holger Hans Peter Freyther
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import sys, os, re
+if sys.argv[0][-5:] == "pydoc":
+ path = os.path.dirname(os.path.dirname(sys.argv[1]))
+else:
+ path = os.path.dirname(os.path.dirname(sys.argv[0]))
+sys.path.insert(0, path)
+from itertools import groupby
+
+from bb import data_smart
+from bb import codeparser
+import bb
+
+logger = data_smart.logger
+_dict_type = data_smart.DataSmart
+
+def init():
+ """Return a new object representing the Bitbake data"""
+ return _dict_type()
+
+def init_db(parent = None):
+ """Return a new object representing the Bitbake data,
+ optionally based on an existing object"""
+ if parent is not None:
+ return parent.createCopy()
+ else:
+ return _dict_type()
+
+def createCopy(source):
+ """Link the source set to the destination
+ If one does not find the value in the destination set,
+ search will go on to the source set to get the value.
+ Value from source are copy-on-write. i.e. any try to
+ modify one of them will end up putting the modified value
+ in the destination set.
+ """
+ return source.createCopy()
+
+def initVar(var, d):
+ """Non-destructive var init for data structure"""
+ d.initVar(var)
+
+def keys(d):
+ """Return a list of keys in d"""
+ return d.keys()
+
+
+__expand_var_regexp__ = re.compile(r"\${[^{}]+}")
+__expand_python_regexp__ = re.compile(r"\${@.+?}")
+
+def expand(s, d, varname = None):
+ """Variable expansion using the data store"""
+ return d.expand(s, varname)
+
+def expandKeys(alterdata, readdata = None):
+ if readdata == None:
+ readdata = alterdata
+
+ todolist = {}
+ for key in alterdata:
+ if not '${' in key:
+ continue
+
+ ekey = expand(key, readdata)
+ if key == ekey:
+ continue
+ todolist[key] = ekey
+
+ # These two for loops are split for performance to maximise the
+ # usefulness of the expand cache
+ for key in sorted(todolist):
+ ekey = todolist[key]
+ newval = alterdata.getVar(ekey, False)
+ if newval is not None:
+ val = alterdata.getVar(key, False)
+ if val is not None:
+ bb.warn("Variable key %s (%s) replaces original key %s (%s)." % (key, val, ekey, newval))
+ alterdata.renameVar(key, ekey)
+
+def inheritFromOS(d, savedenv, permitted):
+ """Inherit variables from the initial environment."""
+ exportlist = bb.utils.preserved_envvars_exported()
+ for s in savedenv.keys():
+ if s in permitted:
+ try:
+ d.setVar(s, savedenv.getVar(s), op = 'from env')
+ if s in exportlist:
+ d.setVarFlag(s, "export", True, op = 'auto env export')
+ except TypeError:
+ pass
+
+def emit_var(var, o=sys.__stdout__, d = init(), all=False):
+ """Emit a variable to be sourced by a shell."""
+ func = d.getVarFlag(var, "func", False)
+ if d.getVarFlag(var, 'python', False) and func:
+ return False
+
+ export = d.getVarFlag(var, "export", False)
+ unexport = d.getVarFlag(var, "unexport", False)
+ if not all and not export and not unexport and not func:
+ return False
+
+ try:
+ if all:
+ oval = d.getVar(var, False)
+ val = d.getVar(var)
+ except (KeyboardInterrupt, bb.build.FuncFailed):
+ raise
+ except Exception as exc:
+ o.write('# expansion of %s threw %s: %s\n' % (var, exc.__class__.__name__, str(exc)))
+ return False
+
+ if all:
+ d.varhistory.emit(var, oval, val, o, d)
+
+ if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all:
+ return False
+
+ varExpanded = d.expand(var)
+
+ if unexport:
+ o.write('unset %s\n' % varExpanded)
+ return False
+
+ if val is None:
+ return False
+
+ val = str(val)
+
+ if varExpanded.startswith("BASH_FUNC_"):
+ varExpanded = varExpanded[10:-2]
+ val = val[3:] # Strip off "() "
+ o.write("%s() %s\n" % (varExpanded, val))
+ o.write("export -f %s\n" % (varExpanded))
+ return True
+
+ if func:
+ # NOTE: should probably check for unbalanced {} within the var
+ val = val.rstrip('\n')
+ o.write("%s() {\n%s\n}\n" % (varExpanded, val))
+ return 1
+
+ if export:
+ o.write('export ')
+
+ # if we're going to output this within doublequotes,
+ # to a shell, we need to escape the quotes in the var
+ alter = re.sub('"', '\\"', val)
+ alter = re.sub('\n', ' \\\n', alter)
+ alter = re.sub('\\$', '\\\\$', alter)
+ o.write('%s="%s"\n' % (varExpanded, alter))
+ return False
+
+def emit_env(o=sys.__stdout__, d = init(), all=False):
+ """Emits all items in the data store in a format such that it can be sourced by a shell."""
+
+ isfunc = lambda key: bool(d.getVarFlag(key, "func", False))
+ keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc)
+ grouped = groupby(keys, isfunc)
+ for isfunc, keys in grouped:
+ for key in sorted(keys):
+ emit_var(key, o, d, all and not isfunc) and o.write('\n')
+
+def exported_keys(d):
+ return (key for key in d.keys() if not key.startswith('__') and
+ d.getVarFlag(key, 'export', False) and
+ not d.getVarFlag(key, 'unexport', False))
+
+def exported_vars(d):
+ k = list(exported_keys(d))
+ for key in k:
+ try:
+ value = d.getVar(key)
+ except Exception as err:
+ bb.warn("%s: Unable to export ${%s}: %s" % (d.getVar("FILE"), key, err))
+ continue
+
+ if value is not None:
+ yield key, str(value)
+
+def emit_func(func, o=sys.__stdout__, d = init()):
+ """Emits all items in the data store in a format such that it can be sourced by a shell."""
+
+ keys = (key for key in d.keys() if not key.startswith("__") and not d.getVarFlag(key, "func", False))
+ for key in sorted(keys):
+ emit_var(key, o, d, False)
+
+ o.write('\n')
+ emit_var(func, o, d, False) and o.write('\n')
+ newdeps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
+ newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
+ seen = set()
+ while newdeps:
+ deps = newdeps
+ seen |= deps
+ newdeps = set()
+ for dep in deps:
+ if d.getVarFlag(dep, "func", False) and not d.getVarFlag(dep, "python", False):
+ emit_var(dep, o, d, False) and o.write('\n')
+ newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep))
+ newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
+ newdeps -= seen
+
+_functionfmt = """
+def {function}(d):
+{body}"""
+
+def emit_func_python(func, o=sys.__stdout__, d = init()):
+ """Emits all items in the data store in a format such that it can be sourced by a shell."""
+
+ def write_func(func, o, call = False):
+ body = d.getVar(func, False)
+ if not body.startswith("def"):
+ body = _functionfmt.format(function=func, body=body)
+
+ o.write(body.strip() + "\n\n")
+ if call:
+ o.write(func + "(d)" + "\n\n")
+
+ write_func(func, o, True)
+ pp = bb.codeparser.PythonParser(func, logger)
+ pp.parse_python(d.getVar(func, False))
+ newdeps = pp.execs
+ newdeps |= set((d.getVarFlag(func, "vardeps") or "").split())
+ seen = set()
+ while newdeps:
+ deps = newdeps
+ seen |= deps
+ newdeps = set()
+ for dep in deps:
+ if d.getVarFlag(dep, "func", False) and d.getVarFlag(dep, "python", False):
+ write_func(dep, o)
+ pp = bb.codeparser.PythonParser(dep, logger)
+ pp.parse_python(d.getVar(dep, False))
+ newdeps |= pp.execs
+ newdeps |= set((d.getVarFlag(dep, "vardeps") or "").split())
+ newdeps -= seen
+
+def update_data(d):
+ """Performs final steps upon the datastore, including application of overrides"""
+ d.finalize(parent = True)
+
+def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
+ deps = set()
+ try:
+ if key[-1] == ']':
+ vf = key[:-1].split('[')
+ value = d.getVarFlag(vf[0], vf[1], False)
+ parser = d.expandWithRefs(value, key)
+ deps |= parser.references
+ deps = deps | (keys & parser.execs)
+ return deps, value
+ varflags = d.getVarFlags(key, ["vardeps", "vardepvalue", "vardepsexclude", "exports", "postfuncs", "prefuncs", "lineno", "filename"]) or {}
+ vardeps = varflags.get("vardeps")
+ value = d.getVarFlag(key, "_content", False)
+
+ def handle_contains(value, contains, d):
+ newvalue = ""
+ for k in sorted(contains):
+ l = (d.getVar(k) or "").split()
+ for item in sorted(contains[k]):
+ for word in item.split():
+ if not word in l:
+ newvalue += "\n%s{%s} = Unset" % (k, item)
+ break
+ else:
+ newvalue += "\n%s{%s} = Set" % (k, item)
+ if not newvalue:
+ return value
+ if not value:
+ return newvalue
+ return value + newvalue
+
+ if "vardepvalue" in varflags:
+ value = varflags.get("vardepvalue")
+ elif varflags.get("func"):
+ if varflags.get("python"):
+ parser = bb.codeparser.PythonParser(key, logger)
+ if value and "\t" in value:
+ logger.warning("Variable %s contains tabs, please remove these (%s)" % (key, d.getVar("FILE")))
+ parser.parse_python(value, filename=varflags.get("filename"), lineno=varflags.get("lineno"))
+ deps = deps | parser.references
+ deps = deps | (keys & parser.execs)
+ value = handle_contains(value, parser.contains, d)
+ else:
+ parsedvar = d.expandWithRefs(value, key)
+ parser = bb.codeparser.ShellParser(key, logger)
+ parser.parse_shell(parsedvar.value)
+ deps = deps | shelldeps
+ deps = deps | parsedvar.references
+ deps = deps | (keys & parser.execs) | (keys & parsedvar.execs)
+ value = handle_contains(value, parsedvar.contains, d)
+ if vardeps is None:
+ parser.log.flush()
+ if "prefuncs" in varflags:
+ deps = deps | set(varflags["prefuncs"].split())
+ if "postfuncs" in varflags:
+ deps = deps | set(varflags["postfuncs"].split())
+ if "exports" in varflags:
+ deps = deps | set(varflags["exports"].split())
+ else:
+ parser = d.expandWithRefs(value, key)
+ deps |= parser.references
+ deps = deps | (keys & parser.execs)
+ value = handle_contains(value, parser.contains, d)
+
+ if "vardepvalueexclude" in varflags:
+ exclude = varflags.get("vardepvalueexclude")
+ for excl in exclude.split('|'):
+ if excl:
+ value = value.replace(excl, '')
+
+ # Add varflags, assuming an exclusion list is set
+ if varflagsexcl:
+ varfdeps = []
+ for f in varflags:
+ if f not in varflagsexcl:
+ varfdeps.append('%s[%s]' % (key, f))
+ if varfdeps:
+ deps |= set(varfdeps)
+
+ deps |= set((vardeps or "").split())
+ deps -= set(varflags.get("vardepsexclude", "").split())
+ except bb.parse.SkipRecipe:
+ raise
+ except Exception as e:
+ bb.warn("Exception during build_dependencies for %s" % key)
+ raise
+ return deps, value
+ #bb.note("Variable %s references %s and calls %s" % (key, str(deps), str(execs)))
+ #d.setVarFlag(key, "vardeps", deps)
+
+def generate_dependencies(d):
+
+ keys = set(key for key in d if not key.startswith("__"))
+ shelldeps = set(key for key in d.getVar("__exportlist", False) if d.getVarFlag(key, "export", False) and not d.getVarFlag(key, "unexport", False))
+ varflagsexcl = d.getVar('BB_SIGNATURE_EXCLUDE_FLAGS')
+
+ deps = {}
+ values = {}
+
+ tasklist = d.getVar('__BBTASKS', False) or []
+ for task in tasklist:
+ deps[task], values[task] = build_dependencies(task, keys, shelldeps, varflagsexcl, d)
+ newdeps = deps[task]
+ seen = set()
+ while newdeps:
+ nextdeps = newdeps
+ seen |= nextdeps
+ newdeps = set()
+ for dep in nextdeps:
+ if dep not in deps:
+ deps[dep], values[dep] = build_dependencies(dep, keys, shelldeps, varflagsexcl, d)
+ newdeps |= deps[dep]
+ newdeps -= seen
+ #print "For %s: %s" % (task, str(deps[task]))
+ return tasklist, deps, values
+
+def inherits_class(klass, d):
+ val = d.getVar('__inherit_cache', False) or []
+ needle = os.path.join('classes', '%s.bbclass' % klass)
+ for v in val:
+ if v.endswith(needle):
+ return True
+ return False
diff --git a/poky/bitbake/lib/bb/data_smart.py b/poky/bitbake/lib/bb/data_smart.py
new file mode 100644
index 000000000..7b09af5cf
--- /dev/null
+++ b/poky/bitbake/lib/bb/data_smart.py
@@ -0,0 +1,1037 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake Smart Dictionary Implementation
+
+Functions for interacting with the data structure used by the
+BitBake build tools.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2004, 2005 Seb Frankengul
+# Copyright (C) 2005, 2006 Holger Hans Peter Freyther
+# Copyright (C) 2005 Uli Luckas
+# Copyright (C) 2005 ROAD GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import copy, re, sys, traceback
+from collections import MutableMapping
+import logging
+import hashlib
+import bb, bb.codeparser
+from bb import utils
+from bb.COW import COWDictBase
+
+logger = logging.getLogger("BitBake.Data")
+
+__setvar_keyword__ = ["_append", "_prepend", "_remove"]
+__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
+__expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
+__expand_python_regexp__ = re.compile(r"\${@.+?}")
+
+def infer_caller_details(loginfo, parent = False, varval = True):
+ """Save the caller the trouble of specifying everything."""
+ # Save effort.
+ if 'ignore' in loginfo and loginfo['ignore']:
+ return
+ # If nothing was provided, mark this as possibly unneeded.
+ if not loginfo:
+ loginfo['ignore'] = True
+ return
+ # Infer caller's likely values for variable (var) and value (value),
+ # to reduce clutter in the rest of the code.
+ above = None
+ def set_above():
+ try:
+ raise Exception
+ except Exception:
+ tb = sys.exc_info()[2]
+ if parent:
+ return tb.tb_frame.f_back.f_back.f_back
+ else:
+ return tb.tb_frame.f_back.f_back
+
+ if varval and ('variable' not in loginfo or 'detail' not in loginfo):
+ if not above:
+ above = set_above()
+ lcls = above.f_locals.items()
+ for k, v in lcls:
+ if k == 'value' and 'detail' not in loginfo:
+ loginfo['detail'] = v
+ if k == 'var' and 'variable' not in loginfo:
+ loginfo['variable'] = v
+ # Infer file/line/function from traceback
+ # Don't use traceback.extract_stack() since it fills the line contents which
+ # we don't need and that hits stat syscalls
+ if 'file' not in loginfo:
+ if not above:
+ above = set_above()
+ f = above.f_back
+ line = f.f_lineno
+ file = f.f_code.co_filename
+ func = f.f_code.co_name
+ loginfo['file'] = file
+ loginfo['line'] = line
+ if func not in loginfo:
+ loginfo['func'] = func
+
+class VariableParse:
+ def __init__(self, varname, d, val = None):
+ self.varname = varname
+ self.d = d
+ self.value = val
+
+ self.references = set()
+ self.execs = set()
+ self.contains = {}
+
+ def var_sub(self, match):
+ key = match.group()[2:-1]
+ if self.varname and key:
+ if self.varname == key:
+ raise Exception("variable %s references itself!" % self.varname)
+ if key in self.d.expand_cache:
+ varparse = self.d.expand_cache[key]
+ var = varparse.value
+ else:
+ var = self.d.getVarFlag(key, "_content")
+ self.references.add(key)
+ if var is not None:
+ return var
+ else:
+ return match.group()
+
+ def python_sub(self, match):
+ if isinstance(match, str):
+ code = match
+ else:
+ code = match.group()[3:-1]
+
+ if "_remote_data" in self.d:
+ connector = self.d["_remote_data"]
+ return connector.expandPythonRef(self.varname, code, self.d)
+
+ codeobj = compile(code.strip(), self.varname or "<expansion>", "eval")
+
+ parser = bb.codeparser.PythonParser(self.varname, logger)
+ parser.parse_python(code)
+ if self.varname:
+ vardeps = self.d.getVarFlag(self.varname, "vardeps")
+ if vardeps is None:
+ parser.log.flush()
+ else:
+ parser.log.flush()
+ self.references |= parser.references
+ self.execs |= parser.execs
+
+ for k in parser.contains:
+ if k not in self.contains:
+ self.contains[k] = parser.contains[k].copy()
+ else:
+ self.contains[k].update(parser.contains[k])
+ value = utils.better_eval(codeobj, DataContext(self.d), {'d' : self.d})
+ return str(value)
+
+
+class DataContext(dict):
+ def __init__(self, metadata, **kwargs):
+ self.metadata = metadata
+ dict.__init__(self, **kwargs)
+ self['d'] = metadata
+
+ def __missing__(self, key):
+ value = self.metadata.getVar(key)
+ if value is None or self.metadata.getVarFlag(key, 'func', False):
+ raise KeyError(key)
+ else:
+ return value
+
+class ExpansionError(Exception):
+ def __init__(self, varname, expression, exception):
+ self.expression = expression
+ self.variablename = varname
+ self.exception = exception
+ if varname:
+ if expression:
+ self.msg = "Failure expanding variable %s, expression was %s which triggered exception %s: %s" % (varname, expression, type(exception).__name__, exception)
+ else:
+ self.msg = "Failure expanding variable %s: %s: %s" % (varname, type(exception).__name__, exception)
+ else:
+ self.msg = "Failure expanding expression %s which triggered exception %s: %s" % (expression, type(exception).__name__, exception)
+ Exception.__init__(self, self.msg)
+ self.args = (varname, expression, exception)
+ def __str__(self):
+ return self.msg
+
+class IncludeHistory(object):
+ def __init__(self, parent = None, filename = '[TOP LEVEL]'):
+ self.parent = parent
+ self.filename = filename
+ self.children = []
+ self.current = self
+
+ def copy(self):
+ new = IncludeHistory(self.parent, self.filename)
+ for c in self.children:
+ new.children.append(c)
+ return new
+
+ def include(self, filename):
+ newfile = IncludeHistory(self.current, filename)
+ self.current.children.append(newfile)
+ self.current = newfile
+ return self
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, a, b, c):
+ if self.current.parent:
+ self.current = self.current.parent
+ else:
+ bb.warn("Include log: Tried to finish '%s' at top level." % filename)
+ return False
+
+ def emit(self, o, level = 0):
+ """Emit an include history file, and its children."""
+ if level:
+ spaces = " " * (level - 1)
+ o.write("# %s%s" % (spaces, self.filename))
+ if len(self.children) > 0:
+ o.write(" includes:")
+ else:
+ o.write("#\n# INCLUDE HISTORY:\n#")
+ level = level + 1
+ for child in self.children:
+ o.write("\n")
+ child.emit(o, level)
+
+class VariableHistory(object):
+ def __init__(self, dataroot):
+ self.dataroot = dataroot
+ self.variables = COWDictBase.copy()
+
+ def copy(self):
+ new = VariableHistory(self.dataroot)
+ new.variables = self.variables.copy()
+ return new
+
+ def __getstate__(self):
+ vardict = {}
+ for k, v in self.variables.iteritems():
+ vardict[k] = v
+ return {'dataroot': self.dataroot,
+ 'variables': vardict}
+
+ def __setstate__(self, state):
+ self.dataroot = state['dataroot']
+ self.variables = COWDictBase.copy()
+ for k, v in state['variables'].items():
+ self.variables[k] = v
+
+ def record(self, *kwonly, **loginfo):
+ if not self.dataroot._tracking:
+ return
+ if len(kwonly) > 0:
+ raise TypeError
+ infer_caller_details(loginfo, parent = True)
+ if 'ignore' in loginfo and loginfo['ignore']:
+ return
+ if 'op' not in loginfo or not loginfo['op']:
+ loginfo['op'] = 'set'
+ if 'detail' in loginfo:
+ loginfo['detail'] = str(loginfo['detail'])
+ if 'variable' not in loginfo or 'file' not in loginfo:
+ raise ValueError("record() missing variable or file.")
+ var = loginfo['variable']
+
+ if var not in self.variables:
+ self.variables[var] = []
+ if not isinstance(self.variables[var], list):
+ return
+ if 'nodups' in loginfo and loginfo in self.variables[var]:
+ return
+ self.variables[var].append(loginfo.copy())
+
+ def variable(self, var):
+ remote_connector = self.dataroot.getVar('_remote_data', False)
+ if remote_connector:
+ varhistory = remote_connector.getVarHistory(var)
+ else:
+ varhistory = []
+
+ if var in self.variables:
+ varhistory.extend(self.variables[var])
+ return varhistory
+
+ def emit(self, var, oval, val, o, d):
+ history = self.variable(var)
+
+ # Append override history
+ if var in d.overridedata:
+ for (r, override) in d.overridedata[var]:
+ for event in self.variable(r):
+ loginfo = event.copy()
+ if 'flag' in loginfo and not loginfo['flag'].startswith("_"):
+ continue
+ loginfo['variable'] = var
+ loginfo['op'] = 'override[%s]:%s' % (override, loginfo['op'])
+ history.append(loginfo)
+
+ commentVal = re.sub('\n', '\n#', str(oval))
+ if history:
+ if len(history) == 1:
+ o.write("#\n# $%s\n" % var)
+ else:
+ o.write("#\n# $%s [%d operations]\n" % (var, len(history)))
+ for event in history:
+ # o.write("# %s\n" % str(event))
+ if 'func' in event:
+ # If we have a function listed, this is internal
+ # code, not an operation in a config file, and the
+ # full path is distracting.
+ event['file'] = re.sub('.*/', '', event['file'])
+ display_func = ' [%s]' % event['func']
+ else:
+ display_func = ''
+ if 'flag' in event:
+ flag = '[%s] ' % (event['flag'])
+ else:
+ flag = ''
+ o.write("# %s %s:%s%s\n# %s\"%s\"\n" % (event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', event['detail'])))
+ if len(history) > 1:
+ o.write("# pre-expansion value:\n")
+ o.write('# "%s"\n' % (commentVal))
+ else:
+ o.write("#\n# $%s\n# [no history recorded]\n#\n" % var)
+ o.write('# "%s"\n' % (commentVal))
+
+ def get_variable_files(self, var):
+ """Get the files where operations are made on a variable"""
+ var_history = self.variable(var)
+ files = []
+ for event in var_history:
+ files.append(event['file'])
+ return files
+
+ def get_variable_lines(self, var, f):
+ """Get the line where a operation is made on a variable in file f"""
+ var_history = self.variable(var)
+ lines = []
+ for event in var_history:
+ if f== event['file']:
+ line = event['line']
+ lines.append(line)
+ return lines
+
+ def get_variable_items_files(self, var, d):
+ """
+ Use variable history to map items added to a list variable and
+ the files in which they were added.
+ """
+ history = self.variable(var)
+ finalitems = (d.getVar(var) or '').split()
+ filemap = {}
+ isset = False
+ for event in history:
+ if 'flag' in event:
+ continue
+ if event['op'] == '_remove':
+ continue
+ if isset and event['op'] == 'set?':
+ continue
+ isset = True
+ items = d.expand(event['detail']).split()
+ for item in items:
+ # This is a little crude but is belt-and-braces to avoid us
+ # having to handle every possible operation type specifically
+ if item in finalitems and not item in filemap:
+ filemap[item] = event['file']
+ return filemap
+
+ def del_var_history(self, var, f=None, line=None):
+ """If file f and line are not given, the entire history of var is deleted"""
+ if var in self.variables:
+ if f and line:
+ self.variables[var] = [ x for x in self.variables[var] if x['file']!=f and x['line']!=line]
+ else:
+ self.variables[var] = []
+
+class DataSmart(MutableMapping):
+ def __init__(self):
+ self.dict = {}
+
+ self.inchistory = IncludeHistory()
+ self.varhistory = VariableHistory(self)
+ self._tracking = False
+
+ self.expand_cache = {}
+
+ # cookie monster tribute
+ # Need to be careful about writes to overridedata as
+ # its only a shallow copy, could influence other data store
+ # copies!
+ self.overridedata = {}
+ self.overrides = None
+ self.overridevars = set(["OVERRIDES", "FILE"])
+ self.inoverride = False
+
+ def enableTracking(self):
+ self._tracking = True
+
+ def disableTracking(self):
+ self._tracking = False
+
+ def expandWithRefs(self, s, varname):
+
+ if not isinstance(s, str): # sanity check
+ return VariableParse(varname, self, s)
+
+ if varname and varname in self.expand_cache:
+ return self.expand_cache[varname]
+
+ varparse = VariableParse(varname, self)
+
+ while s.find('${') != -1:
+ olds = s
+ try:
+ s = __expand_var_regexp__.sub(varparse.var_sub, s)
+ try:
+ s = __expand_python_regexp__.sub(varparse.python_sub, s)
+ except SyntaxError as e:
+ # Likely unmatched brackets, just don't expand the expression
+ if e.msg != "EOL while scanning string literal":
+ raise
+ if s == olds:
+ break
+ except ExpansionError:
+ raise
+ except bb.parse.SkipRecipe:
+ raise
+ except Exception as exc:
+ raise ExpansionError(varname, s, exc) from exc
+
+ varparse.value = s
+
+ if varname:
+ self.expand_cache[varname] = varparse
+
+ return varparse
+
+ def expand(self, s, varname = None):
+ return self.expandWithRefs(s, varname).value
+
+ def finalize(self, parent = False):
+ return
+
+ def internal_finalize(self, parent = False):
+ """Performs final steps upon the datastore, including application of overrides"""
+ self.overrides = None
+
+ def need_overrides(self):
+ if self.overrides is not None:
+ return
+ if self.inoverride:
+ return
+ for count in range(5):
+ self.inoverride = True
+ # Can end up here recursively so setup dummy values
+ self.overrides = []
+ self.overridesset = set()
+ self.overrides = (self.getVar("OVERRIDES") or "").split(":") or []
+ self.overridesset = set(self.overrides)
+ self.inoverride = False
+ self.expand_cache = {}
+ newoverrides = (self.getVar("OVERRIDES") or "").split(":") or []
+ if newoverrides == self.overrides:
+ break
+ self.overrides = newoverrides
+ self.overridesset = set(self.overrides)
+ else:
+ bb.fatal("Overrides could not be expanded into a stable state after 5 iterations, overrides must be being referenced by other overridden variables in some recursive fashion. Please provide your configuration to bitbake-devel so we can laugh, er, I mean try and understand how to make it work.")
+
+ def initVar(self, var):
+ self.expand_cache = {}
+ if not var in self.dict:
+ self.dict[var] = {}
+
+ def _findVar(self, var):
+ dest = self.dict
+ while dest:
+ if var in dest:
+ return dest[var], self.overridedata.get(var, None)
+
+ if "_remote_data" in dest:
+ connector = dest["_remote_data"]["_content"]
+ return connector.getVar(var)
+
+ if "_data" not in dest:
+ break
+ dest = dest["_data"]
+ return None, self.overridedata.get(var, None)
+
+ def _makeShadowCopy(self, var):
+ if var in self.dict:
+ return
+
+ local_var, _ = self._findVar(var)
+
+ if local_var:
+ self.dict[var] = copy.copy(local_var)
+ else:
+ self.initVar(var)
+
+
+ def setVar(self, var, value, **loginfo):
+ #print("var=" + str(var) + " val=" + str(value))
+ parsing=False
+ if 'parsing' in loginfo:
+ parsing=True
+
+ if '_remote_data' in self.dict:
+ connector = self.dict["_remote_data"]["_content"]
+ res = connector.setVar(var, value)
+ if not res:
+ return
+
+ if 'op' not in loginfo:
+ loginfo['op'] = "set"
+ self.expand_cache = {}
+ match = __setvar_regexp__.match(var)
+ if match and match.group("keyword") in __setvar_keyword__:
+ base = match.group('base')
+ keyword = match.group("keyword")
+ override = match.group('add')
+ l = self.getVarFlag(base, keyword, False) or []
+ l.append([value, override])
+ self.setVarFlag(base, keyword, l, ignore=True)
+ # And cause that to be recorded:
+ loginfo['detail'] = value
+ loginfo['variable'] = base
+ if override:
+ loginfo['op'] = '%s[%s]' % (keyword, override)
+ else:
+ loginfo['op'] = keyword
+ self.varhistory.record(**loginfo)
+ # todo make sure keyword is not __doc__ or __module__
+ # pay the cookie monster
+
+ # more cookies for the cookie monster
+ if '_' in var:
+ self._setvar_update_overrides(base, **loginfo)
+
+ if base in self.overridevars:
+ self._setvar_update_overridevars(var, value)
+ return
+
+ if not var in self.dict:
+ self._makeShadowCopy(var)
+
+ if not parsing:
+ if "_append" in self.dict[var]:
+ del self.dict[var]["_append"]
+ if "_prepend" in self.dict[var]:
+ del self.dict[var]["_prepend"]
+ if "_remove" in self.dict[var]:
+ del self.dict[var]["_remove"]
+ if var in self.overridedata:
+ active = []
+ self.need_overrides()
+ for (r, o) in self.overridedata[var]:
+ if o in self.overridesset:
+ active.append(r)
+ elif "_" in o:
+ if set(o.split("_")).issubset(self.overridesset):
+ active.append(r)
+ for a in active:
+ self.delVar(a)
+ del self.overridedata[var]
+
+ # more cookies for the cookie monster
+ if '_' in var:
+ self._setvar_update_overrides(var, **loginfo)
+
+ # setting var
+ self.dict[var]["_content"] = value
+ self.varhistory.record(**loginfo)
+
+ if var in self.overridevars:
+ self._setvar_update_overridevars(var, value)
+
+ def _setvar_update_overridevars(self, var, value):
+ vardata = self.expandWithRefs(value, var)
+ new = vardata.references
+ new.update(vardata.contains.keys())
+ while not new.issubset(self.overridevars):
+ nextnew = set()
+ self.overridevars.update(new)
+ for i in new:
+ vardata = self.expandWithRefs(self.getVar(i), i)
+ nextnew.update(vardata.references)
+ nextnew.update(vardata.contains.keys())
+ new = nextnew
+ self.internal_finalize(True)
+
+ def _setvar_update_overrides(self, var, **loginfo):
+ # aka pay the cookie monster
+ override = var[var.rfind('_')+1:]
+ shortvar = var[:var.rfind('_')]
+ while override and override.islower():
+ if shortvar not in self.overridedata:
+ self.overridedata[shortvar] = []
+ if [var, override] not in self.overridedata[shortvar]:
+ # Force CoW by recreating the list first
+ self.overridedata[shortvar] = list(self.overridedata[shortvar])
+ self.overridedata[shortvar].append([var, override])
+ override = None
+ if "_" in shortvar:
+ override = var[shortvar.rfind('_')+1:]
+ shortvar = var[:shortvar.rfind('_')]
+ if len(shortvar) == 0:
+ override = None
+
+ def getVar(self, var, expand=True, noweakdefault=False, parsing=False):
+ return self.getVarFlag(var, "_content", expand, noweakdefault, parsing)
+
+ def renameVar(self, key, newkey, **loginfo):
+ """
+ Rename the variable key to newkey
+ """
+ if '_remote_data' in self.dict:
+ connector = self.dict["_remote_data"]["_content"]
+ res = connector.renameVar(key, newkey)
+ if not res:
+ return
+
+ val = self.getVar(key, 0, parsing=True)
+ if val is not None:
+ loginfo['variable'] = newkey
+ loginfo['op'] = 'rename from %s' % key
+ loginfo['detail'] = val
+ self.varhistory.record(**loginfo)
+ self.setVar(newkey, val, ignore=True, parsing=True)
+
+ for i in (__setvar_keyword__):
+ src = self.getVarFlag(key, i, False)
+ if src is None:
+ continue
+
+ dest = self.getVarFlag(newkey, i, False) or []
+ dest.extend(src)
+ self.setVarFlag(newkey, i, dest, ignore=True)
+
+ if key in self.overridedata:
+ self.overridedata[newkey] = []
+ for (v, o) in self.overridedata[key]:
+ self.overridedata[newkey].append([v.replace(key, newkey), o])
+ self.renameVar(v, v.replace(key, newkey))
+
+ if '_' in newkey and val is None:
+ self._setvar_update_overrides(newkey, **loginfo)
+
+ loginfo['variable'] = key
+ loginfo['op'] = 'rename (to)'
+ loginfo['detail'] = newkey
+ self.varhistory.record(**loginfo)
+ self.delVar(key, ignore=True)
+
+ def appendVar(self, var, value, **loginfo):
+ loginfo['op'] = 'append'
+ self.varhistory.record(**loginfo)
+ self.setVar(var + "_append", value, ignore=True, parsing=True)
+
+ def prependVar(self, var, value, **loginfo):
+ loginfo['op'] = 'prepend'
+ self.varhistory.record(**loginfo)
+ self.setVar(var + "_prepend", value, ignore=True, parsing=True)
+
+ def delVar(self, var, **loginfo):
+ if '_remote_data' in self.dict:
+ connector = self.dict["_remote_data"]["_content"]
+ res = connector.delVar(var)
+ if not res:
+ return
+
+ loginfo['detail'] = ""
+ loginfo['op'] = 'del'
+ self.varhistory.record(**loginfo)
+ self.expand_cache = {}
+ self.dict[var] = {}
+ if var in self.overridedata:
+ del self.overridedata[var]
+ if '_' in var:
+ override = var[var.rfind('_')+1:]
+ shortvar = var[:var.rfind('_')]
+ while override and override.islower():
+ try:
+ if shortvar in self.overridedata:
+ # Force CoW by recreating the list first
+ self.overridedata[shortvar] = list(self.overridedata[shortvar])
+ self.overridedata[shortvar].remove([var, override])
+ except ValueError as e:
+ pass
+ override = None
+ if "_" in shortvar:
+ override = var[shortvar.rfind('_')+1:]
+ shortvar = var[:shortvar.rfind('_')]
+ if len(shortvar) == 0:
+ override = None
+
+ def setVarFlag(self, var, flag, value, **loginfo):
+ if '_remote_data' in self.dict:
+ connector = self.dict["_remote_data"]["_content"]
+ res = connector.setVarFlag(var, flag, value)
+ if not res:
+ return
+
+ self.expand_cache = {}
+ if 'op' not in loginfo:
+ loginfo['op'] = "set"
+ loginfo['flag'] = flag
+ self.varhistory.record(**loginfo)
+ if not var in self.dict:
+ self._makeShadowCopy(var)
+ self.dict[var][flag] = value
+
+ if flag == "_defaultval" and '_' in var:
+ self._setvar_update_overrides(var, **loginfo)
+ if flag == "_defaultval" and var in self.overridevars:
+ self._setvar_update_overridevars(var, value)
+
+ if flag == "unexport" or flag == "export":
+ if not "__exportlist" in self.dict:
+ self._makeShadowCopy("__exportlist")
+ if not "_content" in self.dict["__exportlist"]:
+ self.dict["__exportlist"]["_content"] = set()
+ self.dict["__exportlist"]["_content"].add(var)
+
+ def getVarFlag(self, var, flag, expand=True, noweakdefault=False, parsing=False):
+ local_var, overridedata = self._findVar(var)
+ value = None
+ if flag == "_content" and overridedata is not None and not parsing:
+ match = False
+ active = {}
+ self.need_overrides()
+ for (r, o) in overridedata:
+ # What about double overrides both with "_" in the name?
+ if o in self.overridesset:
+ active[o] = r
+ elif "_" in o:
+ if set(o.split("_")).issubset(self.overridesset):
+ active[o] = r
+
+ mod = True
+ while mod:
+ mod = False
+ for o in self.overrides:
+ for a in active.copy():
+ if a.endswith("_" + o):
+ t = active[a]
+ del active[a]
+ active[a.replace("_" + o, "")] = t
+ mod = True
+ elif a == o:
+ match = active[a]
+ del active[a]
+ if match:
+ value = self.getVar(match, False)
+
+ if local_var is not None and value is None:
+ if flag in local_var:
+ value = copy.copy(local_var[flag])
+ elif flag == "_content" and "_defaultval" in local_var and not noweakdefault:
+ value = copy.copy(local_var["_defaultval"])
+
+
+ if flag == "_content" and local_var is not None and "_append" in local_var and not parsing:
+ if not value:
+ value = ""
+ self.need_overrides()
+ for (r, o) in local_var["_append"]:
+ match = True
+ if o:
+ for o2 in o.split("_"):
+ if not o2 in self.overrides:
+ match = False
+ if match:
+ value = value + r
+
+ if flag == "_content" and local_var is not None and "_prepend" in local_var and not parsing:
+ if not value:
+ value = ""
+ self.need_overrides()
+ for (r, o) in local_var["_prepend"]:
+
+ match = True
+ if o:
+ for o2 in o.split("_"):
+ if not o2 in self.overrides:
+ match = False
+ if match:
+ value = r + value
+
+ if expand and value:
+ # Only getvar (flag == _content) hits the expand cache
+ cachename = None
+ if flag == "_content":
+ cachename = var
+ else:
+ cachename = var + "[" + flag + "]"
+ value = self.expand(value, cachename)
+
+ if value and flag == "_content" and local_var is not None and "_remove" in local_var:
+ removes = []
+ self.need_overrides()
+ for (r, o) in local_var["_remove"]:
+ match = True
+ if o:
+ for o2 in o.split("_"):
+ if not o2 in self.overrides:
+ match = False
+ if match:
+ removes.extend(self.expand(r).split())
+
+ if removes:
+ filtered = filter(lambda v: v not in removes,
+ value.split())
+ value = " ".join(filtered)
+ if expand and var in self.expand_cache:
+ # We need to ensure the expand cache has the correct value
+ # flag == "_content" here
+ self.expand_cache[var].value = value
+ return value
+
+ def delVarFlag(self, var, flag, **loginfo):
+ if '_remote_data' in self.dict:
+ connector = self.dict["_remote_data"]["_content"]
+ res = connector.delVarFlag(var, flag)
+ if not res:
+ return
+
+ self.expand_cache = {}
+ local_var, _ = self._findVar(var)
+ if not local_var:
+ return
+ if not var in self.dict:
+ self._makeShadowCopy(var)
+
+ if var in self.dict and flag in self.dict[var]:
+ loginfo['detail'] = ""
+ loginfo['op'] = 'delFlag'
+ loginfo['flag'] = flag
+ self.varhistory.record(**loginfo)
+
+ del self.dict[var][flag]
+
+ def appendVarFlag(self, var, flag, value, **loginfo):
+ loginfo['op'] = 'append'
+ loginfo['flag'] = flag
+ self.varhistory.record(**loginfo)
+ newvalue = (self.getVarFlag(var, flag, False) or "") + value
+ self.setVarFlag(var, flag, newvalue, ignore=True)
+
+ def prependVarFlag(self, var, flag, value, **loginfo):
+ loginfo['op'] = 'prepend'
+ loginfo['flag'] = flag
+ self.varhistory.record(**loginfo)
+ newvalue = value + (self.getVarFlag(var, flag, False) or "")
+ self.setVarFlag(var, flag, newvalue, ignore=True)
+
+ def setVarFlags(self, var, flags, **loginfo):
+ self.expand_cache = {}
+ infer_caller_details(loginfo)
+ if not var in self.dict:
+ self._makeShadowCopy(var)
+
+ for i in flags:
+ if i == "_content":
+ continue
+ loginfo['flag'] = i
+ loginfo['detail'] = flags[i]
+ self.varhistory.record(**loginfo)
+ self.dict[var][i] = flags[i]
+
+ def getVarFlags(self, var, expand = False, internalflags=False):
+ local_var, _ = self._findVar(var)
+ flags = {}
+
+ if local_var:
+ for i in local_var:
+ if i.startswith("_") and not internalflags:
+ continue
+ flags[i] = local_var[i]
+ if expand and i in expand:
+ flags[i] = self.expand(flags[i], var + "[" + i + "]")
+ if len(flags) == 0:
+ return None
+ return flags
+
+
+ def delVarFlags(self, var, **loginfo):
+ self.expand_cache = {}
+ if not var in self.dict:
+ self._makeShadowCopy(var)
+
+ if var in self.dict:
+ content = None
+
+ loginfo['op'] = 'delete flags'
+ self.varhistory.record(**loginfo)
+
+ # try to save the content
+ if "_content" in self.dict[var]:
+ content = self.dict[var]["_content"]
+ self.dict[var] = {}
+ self.dict[var]["_content"] = content
+ else:
+ del self.dict[var]
+
+ def createCopy(self):
+ """
+ Create a copy of self by setting _data to self
+ """
+ # we really want this to be a DataSmart...
+ data = DataSmart()
+ data.dict["_data"] = self.dict
+ data.varhistory = self.varhistory.copy()
+ data.varhistory.dataroot = data
+ data.inchistory = self.inchistory.copy()
+
+ data._tracking = self._tracking
+
+ data.overrides = None
+ data.overridevars = copy.copy(self.overridevars)
+ # Should really be a deepcopy but has heavy overhead.
+ # Instead, we're careful with writes.
+ data.overridedata = copy.copy(self.overridedata)
+
+ return data
+
+ def expandVarref(self, variable, parents=False):
+ """Find all references to variable in the data and expand it
+ in place, optionally descending to parent datastores."""
+
+ if parents:
+ keys = iter(self)
+ else:
+ keys = self.localkeys()
+
+ ref = '${%s}' % variable
+ value = self.getVar(variable, False)
+ for key in keys:
+ referrervalue = self.getVar(key, False)
+ if referrervalue and ref in referrervalue:
+ self.setVar(key, referrervalue.replace(ref, value))
+
+ def localkeys(self):
+ for key in self.dict:
+ if key not in ['_data', '_remote_data']:
+ yield key
+
+ def __iter__(self):
+ deleted = set()
+ overrides = set()
+ def keylist(d):
+ klist = set()
+ for key in d:
+ if key in ["_data", "_remote_data"]:
+ continue
+ if key in deleted:
+ continue
+ if key in overrides:
+ continue
+ if not d[key]:
+ deleted.add(key)
+ continue
+ klist.add(key)
+
+ if "_data" in d:
+ klist |= keylist(d["_data"])
+
+ if "_remote_data" in d:
+ connector = d["_remote_data"]["_content"]
+ for key in connector.getKeys():
+ if key in deleted:
+ continue
+ klist.add(key)
+
+ return klist
+
+ self.need_overrides()
+ for var in self.overridedata:
+ for (r, o) in self.overridedata[var]:
+ if o in self.overridesset:
+ overrides.add(var)
+ elif "_" in o:
+ if set(o.split("_")).issubset(self.overridesset):
+ overrides.add(var)
+
+ for k in keylist(self.dict):
+ yield k
+
+ for k in overrides:
+ yield k
+
+ def __len__(self):
+ return len(frozenset(iter(self)))
+
+ def __getitem__(self, item):
+ value = self.getVar(item, False)
+ if value is None:
+ raise KeyError(item)
+ else:
+ return value
+
+ def __setitem__(self, var, value):
+ self.setVar(var, value)
+
+ def __delitem__(self, var):
+ self.delVar(var)
+
+ def get_hash(self):
+ data = {}
+ d = self.createCopy()
+ bb.data.expandKeys(d)
+
+ config_whitelist = set((d.getVar("BB_HASHCONFIG_WHITELIST") or "").split())
+ keys = set(key for key in iter(d) if not key.startswith("__"))
+ for key in keys:
+ if key in config_whitelist:
+ continue
+
+ value = d.getVar(key, False) or ""
+ data.update({key:value})
+
+ varflags = d.getVarFlags(key, internalflags = True)
+ if not varflags:
+ continue
+ for f in varflags:
+ if f == "_content":
+ continue
+ data.update({'%s[%s]' % (key, f):varflags[f]})
+
+ for key in ["__BBTASKS", "__BBANONFUNCS", "__BBHANDLERS"]:
+ bb_list = d.getVar(key, False) or []
+ data.update({key:str(bb_list)})
+
+ if key == "__BBANONFUNCS":
+ for i in bb_list:
+ value = d.getVar(i, False) or ""
+ data.update({i:value})
+
+ data_str = str([(k, data[k]) for k in sorted(data.keys())])
+ return hashlib.md5(data_str.encode("utf-8")).hexdigest()
diff --git a/poky/bitbake/lib/bb/event.py b/poky/bitbake/lib/bb/event.py
new file mode 100644
index 000000000..5d0049626
--- /dev/null
+++ b/poky/bitbake/lib/bb/event.py
@@ -0,0 +1,831 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Event' implementation
+
+Classes and functions for manipulating 'events' in the
+BitBake build tools.
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os, sys
+import warnings
+import pickle
+import logging
+import atexit
+import traceback
+import ast
+import threading
+
+import bb.utils
+import bb.compat
+import bb.exceptions
+
+# This is the pid for which we should generate the event. This is set when
+# the runqueue forks off.
+worker_pid = 0
+worker_fire = None
+
+logger = logging.getLogger('BitBake.Event')
+
+class Event(object):
+ """Base class for events"""
+
+ def __init__(self):
+ self.pid = worker_pid
+
+
+class HeartbeatEvent(Event):
+ """Triggered at regular time intervals of 10 seconds. Other events can fire much more often
+ (runQueueTaskStarted when there are many short tasks) or not at all for long periods
+ of time (again runQueueTaskStarted, when there is just one long-running task), so this
+ event is more suitable for doing some task-independent work occassionally."""
+ def __init__(self, time):
+ Event.__init__(self)
+ self.time = time
+
+Registered = 10
+AlreadyRegistered = 14
+
+def get_class_handlers():
+ return _handlers
+
+def set_class_handlers(h):
+ global _handlers
+ _handlers = h
+
+def clean_class_handlers():
+ return bb.compat.OrderedDict()
+
+# Internal
+_handlers = clean_class_handlers()
+_ui_handlers = {}
+_ui_logfilters = {}
+_ui_handler_seq = 0
+_event_handler_map = {}
+_catchall_handlers = {}
+_eventfilter = None
+_uiready = False
+_thread_lock = threading.Lock()
+_thread_lock_enabled = False
+
+if hasattr(__builtins__, '__setitem__'):
+ builtins = __builtins__
+else:
+ builtins = __builtins__.__dict__
+
+def enable_threadlock():
+ global _thread_lock_enabled
+ _thread_lock_enabled = True
+
+def disable_threadlock():
+ global _thread_lock_enabled
+ _thread_lock_enabled = False
+
+def execute_handler(name, handler, event, d):
+ event.data = d
+ addedd = False
+ if 'd' not in builtins:
+ builtins['d'] = d
+ addedd = True
+ try:
+ ret = handler(event)
+ except (bb.parse.SkipRecipe, bb.BBHandledException):
+ raise
+ except Exception:
+ etype, value, tb = sys.exc_info()
+ logger.error("Execution of event handler '%s' failed" % name,
+ exc_info=(etype, value, tb.tb_next))
+ raise
+ except SystemExit as exc:
+ if exc.code != 0:
+ logger.error("Execution of event handler '%s' failed" % name)
+ raise
+ finally:
+ del event.data
+ if addedd:
+ del builtins['d']
+
+def fire_class_handlers(event, d):
+ if isinstance(event, logging.LogRecord):
+ return
+
+ eid = str(event.__class__)[8:-2]
+ evt_hmap = _event_handler_map.get(eid, {})
+ for name, handler in list(_handlers.items()):
+ if name in _catchall_handlers or name in evt_hmap:
+ if _eventfilter:
+ if not _eventfilter(name, handler, event, d):
+ continue
+ execute_handler(name, handler, event, d)
+
+ui_queue = []
+@atexit.register
+def print_ui_queue():
+ """If we're exiting before a UI has been spawned, display any queued
+ LogRecords to the console."""
+ logger = logging.getLogger("BitBake")
+ if not _uiready:
+ from bb.msg import BBLogFormatter
+ stdout = logging.StreamHandler(sys.stdout)
+ stderr = logging.StreamHandler(sys.stderr)
+ formatter = BBLogFormatter("%(levelname)s: %(message)s")
+ stdout.setFormatter(formatter)
+ stderr.setFormatter(formatter)
+
+ # First check to see if we have any proper messages
+ msgprint = False
+ msgerrs = False
+
+ # Should we print to stderr?
+ for event in ui_queue[:]:
+ if isinstance(event, logging.LogRecord) and event.levelno >= logging.WARNING:
+ msgerrs = True
+ break
+
+ if msgerrs:
+ logger.addHandler(stderr)
+ else:
+ logger.addHandler(stdout)
+
+ for event in ui_queue[:]:
+ if isinstance(event, logging.LogRecord):
+ if event.levelno > logging.DEBUG:
+ logger.handle(event)
+ msgprint = True
+
+ # Nope, so just print all of the messages we have (including debug messages)
+ if not msgprint:
+ for event in ui_queue[:]:
+ if isinstance(event, logging.LogRecord):
+ logger.handle(event)
+ if msgerrs:
+ logger.removeHandler(stderr)
+ else:
+ logger.removeHandler(stdout)
+
+def fire_ui_handlers(event, d):
+ global _thread_lock
+ global _thread_lock_enabled
+
+ if not _uiready:
+ # No UI handlers registered yet, queue up the messages
+ ui_queue.append(event)
+ return
+
+ if _thread_lock_enabled:
+ _thread_lock.acquire()
+
+ errors = []
+ for h in _ui_handlers:
+ #print "Sending event %s" % event
+ try:
+ if not _ui_logfilters[h].filter(event):
+ continue
+ # We use pickle here since it better handles object instances
+ # which xmlrpc's marshaller does not. Events *must* be serializable
+ # by pickle.
+ if hasattr(_ui_handlers[h].event, "sendpickle"):
+ _ui_handlers[h].event.sendpickle((pickle.dumps(event)))
+ else:
+ _ui_handlers[h].event.send(event)
+ except:
+ errors.append(h)
+ for h in errors:
+ del _ui_handlers[h]
+
+ if _thread_lock_enabled:
+ _thread_lock.release()
+
+def fire(event, d):
+ """Fire off an Event"""
+
+ # We can fire class handlers in the worker process context and this is
+ # desired so they get the task based datastore.
+ # UI handlers need to be fired in the server context so we defer this. They
+ # don't have a datastore so the datastore context isn't a problem.
+
+ fire_class_handlers(event, d)
+ if worker_fire:
+ worker_fire(event, d)
+ else:
+ # If messages have been queued up, clear the queue
+ global _uiready, ui_queue
+ if _uiready and ui_queue:
+ for queue_event in ui_queue:
+ fire_ui_handlers(queue_event, d)
+ ui_queue = []
+ fire_ui_handlers(event, d)
+
+def fire_from_worker(event, d):
+ fire_ui_handlers(event, d)
+
+noop = lambda _: None
+def register(name, handler, mask=None, filename=None, lineno=None):
+ """Register an Event handler"""
+
+ # already registered
+ if name in _handlers:
+ return AlreadyRegistered
+
+ if handler is not None:
+ # handle string containing python code
+ if isinstance(handler, str):
+ tmp = "def %s(e):\n%s" % (name, handler)
+ try:
+ code = bb.methodpool.compile_cache(tmp)
+ if not code:
+ if filename is None:
+ filename = "%s(e)" % name
+ code = compile(tmp, filename, "exec", ast.PyCF_ONLY_AST)
+ if lineno is not None:
+ ast.increment_lineno(code, lineno-1)
+ code = compile(code, filename, "exec")
+ bb.methodpool.compile_cache_add(tmp, code)
+ except SyntaxError:
+ logger.error("Unable to register event handler '%s':\n%s", name,
+ ''.join(traceback.format_exc(limit=0)))
+ _handlers[name] = noop
+ return
+ env = {}
+ bb.utils.better_exec(code, env)
+ func = bb.utils.better_eval(name, env)
+ _handlers[name] = func
+ else:
+ _handlers[name] = handler
+
+ if not mask or '*' in mask:
+ _catchall_handlers[name] = True
+ else:
+ for m in mask:
+ if _event_handler_map.get(m, None) is None:
+ _event_handler_map[m] = {}
+ _event_handler_map[m][name] = True
+
+ return Registered
+
+def remove(name, handler):
+ """Remove an Event handler"""
+ _handlers.pop(name)
+ if name in _catchall_handlers:
+ _catchall_handlers.pop(name)
+ for event in _event_handler_map.keys():
+ if name in _event_handler_map[event]:
+ _event_handler_map[event].pop(name)
+
+def get_handlers():
+ return _handlers
+
+def set_handlers(handlers):
+ global _handlers
+ _handlers = handlers
+
+def set_eventfilter(func):
+ global _eventfilter
+ _eventfilter = func
+
+def register_UIHhandler(handler, mainui=False):
+ bb.event._ui_handler_seq = bb.event._ui_handler_seq + 1
+ _ui_handlers[_ui_handler_seq] = handler
+ level, debug_domains = bb.msg.constructLogOptions()
+ _ui_logfilters[_ui_handler_seq] = UIEventFilter(level, debug_domains)
+ if mainui:
+ global _uiready
+ _uiready = _ui_handler_seq
+ return _ui_handler_seq
+
+def unregister_UIHhandler(handlerNum, mainui=False):
+ if mainui:
+ global _uiready
+ _uiready = False
+ if handlerNum in _ui_handlers:
+ del _ui_handlers[handlerNum]
+ return
+
+def get_uihandler():
+ if _uiready is False:
+ return None
+ return _uiready
+
+# Class to allow filtering of events and specific filtering of LogRecords *before* we put them over the IPC
+class UIEventFilter(object):
+ def __init__(self, level, debug_domains):
+ self.update(None, level, debug_domains)
+
+ def update(self, eventmask, level, debug_domains):
+ self.eventmask = eventmask
+ self.stdlevel = level
+ self.debug_domains = debug_domains
+
+ def filter(self, event):
+ if isinstance(event, logging.LogRecord):
+ if event.levelno >= self.stdlevel:
+ return True
+ if event.name in self.debug_domains and event.levelno >= self.debug_domains[event.name]:
+ return True
+ return False
+ eid = str(event.__class__)[8:-2]
+ if self.eventmask and eid not in self.eventmask:
+ return False
+ return True
+
+def set_UIHmask(handlerNum, level, debug_domains, mask):
+ if not handlerNum in _ui_handlers:
+ return False
+ if '*' in mask:
+ _ui_logfilters[handlerNum].update(None, level, debug_domains)
+ else:
+ _ui_logfilters[handlerNum].update(mask, level, debug_domains)
+ return True
+
+def getName(e):
+ """Returns the name of a class or class instance"""
+ if getattr(e, "__name__", None) == None:
+ return e.__class__.__name__
+ else:
+ return e.__name__
+
+class OperationStarted(Event):
+ """An operation has begun"""
+ def __init__(self, msg = "Operation Started"):
+ Event.__init__(self)
+ self.msg = msg
+
+class OperationCompleted(Event):
+ """An operation has completed"""
+ def __init__(self, total, msg = "Operation Completed"):
+ Event.__init__(self)
+ self.total = total
+ self.msg = msg
+
+class OperationProgress(Event):
+ """An operation is in progress"""
+ def __init__(self, current, total, msg = "Operation in Progress"):
+ Event.__init__(self)
+ self.current = current
+ self.total = total
+ self.msg = msg + ": %s/%s" % (current, total);
+
+class ConfigParsed(Event):
+ """Configuration Parsing Complete"""
+
+class MultiConfigParsed(Event):
+ """Multi-Config Parsing Complete"""
+ def __init__(self, mcdata):
+ self.mcdata = mcdata
+ Event.__init__(self)
+
+class RecipeEvent(Event):
+ def __init__(self, fn):
+ self.fn = fn
+ Event.__init__(self)
+
+class RecipePreFinalise(RecipeEvent):
+ """ Recipe Parsing Complete but not yet finialised"""
+
+class RecipeTaskPreProcess(RecipeEvent):
+ """
+ Recipe Tasks about to be finalised
+ The list of tasks should be final at this point and handlers
+ are only able to change interdependencies
+ """
+ def __init__(self, fn, tasklist):
+ self.fn = fn
+ self.tasklist = tasklist
+ Event.__init__(self)
+
+class RecipeParsed(RecipeEvent):
+ """ Recipe Parsing Complete """
+
+class StampUpdate(Event):
+ """Trigger for any adjustment of the stamp files to happen"""
+
+ def __init__(self, targets, stampfns):
+ self._targets = targets
+ self._stampfns = stampfns
+ Event.__init__(self)
+
+ def getStampPrefix(self):
+ return self._stampfns
+
+ def getTargets(self):
+ return self._targets
+
+ stampPrefix = property(getStampPrefix)
+ targets = property(getTargets)
+
+class BuildBase(Event):
+ """Base class for bitbake build events"""
+
+ def __init__(self, n, p, failures = 0):
+ self._name = n
+ self._pkgs = p
+ Event.__init__(self)
+ self._failures = failures
+
+ def getPkgs(self):
+ return self._pkgs
+
+ def setPkgs(self, pkgs):
+ self._pkgs = pkgs
+
+ def getName(self):
+ return self._name
+
+ def setName(self, name):
+ self._name = name
+
+ def getFailures(self):
+ """
+ Return the number of failed packages
+ """
+ return self._failures
+
+ pkgs = property(getPkgs, setPkgs, None, "pkgs property")
+ name = property(getName, setName, None, "name property")
+
+class BuildInit(BuildBase):
+ """buildFile or buildTargets was invoked"""
+ def __init__(self, p=[]):
+ name = None
+ BuildBase.__init__(self, name, p)
+
+class BuildStarted(BuildBase, OperationStarted):
+ """Event when builds start"""
+ def __init__(self, n, p, failures = 0):
+ OperationStarted.__init__(self, "Building Started")
+ BuildBase.__init__(self, n, p, failures)
+
+class BuildCompleted(BuildBase, OperationCompleted):
+ """Event when builds have completed"""
+ def __init__(self, total, n, p, failures=0, interrupted=0):
+ if not failures:
+ OperationCompleted.__init__(self, total, "Building Succeeded")
+ else:
+ OperationCompleted.__init__(self, total, "Building Failed")
+ self._interrupted = interrupted
+ BuildBase.__init__(self, n, p, failures)
+
+class DiskFull(Event):
+ """Disk full case build aborted"""
+ def __init__(self, dev, type, freespace, mountpoint):
+ Event.__init__(self)
+ self._dev = dev
+ self._type = type
+ self._free = freespace
+ self._mountpoint = mountpoint
+
+class DiskUsageSample:
+ def __init__(self, available_bytes, free_bytes, total_bytes):
+ # Number of bytes available to non-root processes.
+ self.available_bytes = available_bytes
+ # Number of bytes available to root processes.
+ self.free_bytes = free_bytes
+ # Total capacity of the volume.
+ self.total_bytes = total_bytes
+
+class MonitorDiskEvent(Event):
+ """If BB_DISKMON_DIRS is set, then this event gets triggered each time disk space is checked.
+ Provides information about devices that are getting monitored."""
+ def __init__(self, disk_usage):
+ Event.__init__(self)
+ # hash of device root path -> DiskUsageSample
+ self.disk_usage = disk_usage
+
+class NoProvider(Event):
+ """No Provider for an Event"""
+
+ def __init__(self, item, runtime=False, dependees=None, reasons=None, close_matches=None):
+ Event.__init__(self)
+ self._item = item
+ self._runtime = runtime
+ self._dependees = dependees
+ self._reasons = reasons
+ self._close_matches = close_matches
+
+ def getItem(self):
+ return self._item
+
+ def isRuntime(self):
+ return self._runtime
+
+ def __str__(self):
+ msg = ''
+ if self._runtime:
+ r = "R"
+ else:
+ r = ""
+
+ extra = ''
+ if not self._reasons:
+ if self._close_matches:
+ extra = ". Close matches:\n %s" % '\n '.join(self._close_matches)
+
+ if self._dependees:
+ msg = "Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % (r, self._item, ", ".join(self._dependees), r, extra)
+ else:
+ msg = "Nothing %sPROVIDES '%s'%s" % (r, self._item, extra)
+ if self._reasons:
+ for reason in self._reasons:
+ msg += '\n' + reason
+ return msg
+
+
+class MultipleProviders(Event):
+ """Multiple Providers"""
+
+ def __init__(self, item, candidates, runtime = False):
+ Event.__init__(self)
+ self._item = item
+ self._candidates = candidates
+ self._is_runtime = runtime
+
+ def isRuntime(self):
+ """
+ Is this a runtime issue?
+ """
+ return self._is_runtime
+
+ def getItem(self):
+ """
+ The name for the to be build item
+ """
+ return self._item
+
+ def getCandidates(self):
+ """
+ Get the possible Candidates for a PROVIDER.
+ """
+ return self._candidates
+
+ def __str__(self):
+ msg = "Multiple providers are available for %s%s (%s)" % (self._is_runtime and "runtime " or "",
+ self._item,
+ ", ".join(self._candidates))
+ rtime = ""
+ if self._is_runtime:
+ rtime = "R"
+ msg += "\nConsider defining a PREFERRED_%sPROVIDER entry to match %s" % (rtime, self._item)
+ return msg
+
+class ParseStarted(OperationStarted):
+ """Recipe parsing for the runqueue has begun"""
+ def __init__(self, total):
+ OperationStarted.__init__(self, "Recipe parsing Started")
+ self.total = total
+
+class ParseCompleted(OperationCompleted):
+ """Recipe parsing for the runqueue has completed"""
+ def __init__(self, cached, parsed, skipped, masked, virtuals, errors, total):
+ OperationCompleted.__init__(self, total, "Recipe parsing Completed")
+ self.cached = cached
+ self.parsed = parsed
+ self.skipped = skipped
+ self.virtuals = virtuals
+ self.masked = masked
+ self.errors = errors
+ self.sofar = cached + parsed
+
+class ParseProgress(OperationProgress):
+ """Recipe parsing progress"""
+ def __init__(self, current, total):
+ OperationProgress.__init__(self, current, total, "Recipe parsing")
+
+
+class CacheLoadStarted(OperationStarted):
+ """Loading of the dependency cache has begun"""
+ def __init__(self, total):
+ OperationStarted.__init__(self, "Loading cache Started")
+ self.total = total
+
+class CacheLoadProgress(OperationProgress):
+ """Cache loading progress"""
+ def __init__(self, current, total):
+ OperationProgress.__init__(self, current, total, "Loading cache")
+
+class CacheLoadCompleted(OperationCompleted):
+ """Cache loading is complete"""
+ def __init__(self, total, num_entries):
+ OperationCompleted.__init__(self, total, "Loading cache Completed")
+ self.num_entries = num_entries
+
+class TreeDataPreparationStarted(OperationStarted):
+ """Tree data preparation started"""
+ def __init__(self):
+ OperationStarted.__init__(self, "Preparing tree data Started")
+
+class TreeDataPreparationProgress(OperationProgress):
+ """Tree data preparation is in progress"""
+ def __init__(self, current, total):
+ OperationProgress.__init__(self, current, total, "Preparing tree data")
+
+class TreeDataPreparationCompleted(OperationCompleted):
+ """Tree data preparation completed"""
+ def __init__(self, total):
+ OperationCompleted.__init__(self, total, "Preparing tree data Completed")
+
+class DepTreeGenerated(Event):
+ """
+ Event when a dependency tree has been generated
+ """
+
+ def __init__(self, depgraph):
+ Event.__init__(self)
+ self._depgraph = depgraph
+
+class TargetsTreeGenerated(Event):
+ """
+ Event when a set of buildable targets has been generated
+ """
+ def __init__(self, model):
+ Event.__init__(self)
+ self._model = model
+
+class ReachableStamps(Event):
+ """
+ An event listing all stamps reachable after parsing
+ which the metadata may use to clean up stale data
+ """
+
+ def __init__(self, stamps):
+ Event.__init__(self)
+ self.stamps = stamps
+
+class FilesMatchingFound(Event):
+ """
+ Event when a list of files matching the supplied pattern has
+ been generated
+ """
+ def __init__(self, pattern, matches):
+ Event.__init__(self)
+ self._pattern = pattern
+ self._matches = matches
+
+class ConfigFilesFound(Event):
+ """
+ Event when a list of appropriate config files has been generated
+ """
+ def __init__(self, variable, values):
+ Event.__init__(self)
+ self._variable = variable
+ self._values = values
+
+class ConfigFilePathFound(Event):
+ """
+ Event when a path for a config file has been found
+ """
+ def __init__(self, path):
+ Event.__init__(self)
+ self._path = path
+
+class MsgBase(Event):
+ """Base class for messages"""
+
+ def __init__(self, msg):
+ self._message = msg
+ Event.__init__(self)
+
+class MsgDebug(MsgBase):
+ """Debug Message"""
+
+class MsgNote(MsgBase):
+ """Note Message"""
+
+class MsgWarn(MsgBase):
+ """Warning Message"""
+
+class MsgError(MsgBase):
+ """Error Message"""
+
+class MsgFatal(MsgBase):
+ """Fatal Message"""
+
+class MsgPlain(MsgBase):
+ """General output"""
+
+class LogExecTTY(Event):
+ """Send event containing program to spawn on tty of the logger"""
+ def __init__(self, msg, prog, sleep_delay, retries):
+ Event.__init__(self)
+ self.msg = msg
+ self.prog = prog
+ self.sleep_delay = sleep_delay
+ self.retries = retries
+
+class LogHandler(logging.Handler):
+ """Dispatch logging messages as bitbake events"""
+
+ def emit(self, record):
+ if record.exc_info:
+ etype, value, tb = record.exc_info
+ if hasattr(tb, 'tb_next'):
+ tb = list(bb.exceptions.extract_traceback(tb, context=3))
+ # Need to turn the value into something the logging system can pickle
+ record.bb_exc_info = (etype, value, tb)
+ record.bb_exc_formatted = bb.exceptions.format_exception(etype, value, tb, limit=5)
+ value = str(value)
+ record.exc_info = None
+ fire(record, None)
+
+ def filter(self, record):
+ record.taskpid = worker_pid
+ return True
+
+class MetadataEvent(Event):
+ """
+ Generic event that target for OE-Core classes
+ to report information during asynchrous execution
+ """
+ def __init__(self, eventtype, eventdata):
+ Event.__init__(self)
+ self.type = eventtype
+ self._localdata = eventdata
+
+class ProcessStarted(Event):
+ """
+ Generic process started event (usually part of the initial startup)
+ where further progress events will be delivered
+ """
+ def __init__(self, processname, total):
+ Event.__init__(self)
+ self.processname = processname
+ self.total = total
+
+class ProcessProgress(Event):
+ """
+ Generic process progress event (usually part of the initial startup)
+ """
+ def __init__(self, processname, progress):
+ Event.__init__(self)
+ self.processname = processname
+ self.progress = progress
+
+class ProcessFinished(Event):
+ """
+ Generic process finished event (usually part of the initial startup)
+ """
+ def __init__(self, processname):
+ Event.__init__(self)
+ self.processname = processname
+
+class SanityCheck(Event):
+ """
+ Event to run sanity checks, either raise errors or generate events as return status.
+ """
+ def __init__(self, generateevents = True):
+ Event.__init__(self)
+ self.generateevents = generateevents
+
+class SanityCheckPassed(Event):
+ """
+ Event to indicate sanity check has passed
+ """
+
+class SanityCheckFailed(Event):
+ """
+ Event to indicate sanity check has failed
+ """
+ def __init__(self, msg, network_error=False):
+ Event.__init__(self)
+ self._msg = msg
+ self._network_error = network_error
+
+class NetworkTest(Event):
+ """
+ Event to run network connectivity tests, either raise errors or generate events as return status.
+ """
+ def __init__(self, generateevents = True):
+ Event.__init__(self)
+ self.generateevents = generateevents
+
+class NetworkTestPassed(Event):
+ """
+ Event to indicate network test has passed
+ """
+
+class NetworkTestFailed(Event):
+ """
+ Event to indicate network test has failed
+ """
+
+class FindSigInfoResult(Event):
+ """
+ Event to return results from findSigInfo command
+ """
+ def __init__(self, result):
+ Event.__init__(self)
+ self.result = result
diff --git a/poky/bitbake/lib/bb/exceptions.py b/poky/bitbake/lib/bb/exceptions.py
new file mode 100644
index 000000000..cd713439e
--- /dev/null
+++ b/poky/bitbake/lib/bb/exceptions.py
@@ -0,0 +1,91 @@
+
+import inspect
+import traceback
+import bb.namedtuple_with_abc
+from collections import namedtuple
+
+
+class TracebackEntry(namedtuple.abc):
+ """Pickleable representation of a traceback entry"""
+ _fields = 'filename lineno function args code_context index'
+ _header = ' File "{0.filename}", line {0.lineno}, in {0.function}{0.args}'
+
+ def format(self, formatter=None):
+ if not self.code_context:
+ return self._header.format(self) + '\n'
+
+ formatted = [self._header.format(self) + ':\n']
+
+ for lineindex, line in enumerate(self.code_context):
+ if formatter:
+ line = formatter(line)
+
+ if lineindex == self.index:
+ formatted.append(' >%s' % line)
+ else:
+ formatted.append(' %s' % line)
+ return formatted
+
+ def __str__(self):
+ return ''.join(self.format())
+
+def _get_frame_args(frame):
+ """Get the formatted arguments and class (if available) for a frame"""
+ arginfo = inspect.getargvalues(frame)
+
+ try:
+ if not arginfo.args:
+ return '', None
+ # There have been reports from the field of python 2.6 which doesn't
+ # return a namedtuple here but simply a tuple so fallback gracefully if
+ # args isn't present.
+ except AttributeError:
+ return '', None
+
+ firstarg = arginfo.args[0]
+ if firstarg == 'self':
+ self = arginfo.locals['self']
+ cls = self.__class__.__name__
+
+ arginfo.args.pop(0)
+ del arginfo.locals['self']
+ else:
+ cls = None
+
+ formatted = inspect.formatargvalues(*arginfo)
+ return formatted, cls
+
+def extract_traceback(tb, context=1):
+ frames = inspect.getinnerframes(tb, context)
+ for frame, filename, lineno, function, code_context, index in frames:
+ formatted_args, cls = _get_frame_args(frame)
+ if cls:
+ function = '%s.%s' % (cls, function)
+ yield TracebackEntry(filename, lineno, function, formatted_args,
+ code_context, index)
+
+def format_extracted(extracted, formatter=None, limit=None):
+ if limit:
+ extracted = extracted[-limit:]
+
+ formatted = []
+ for tracebackinfo in extracted:
+ formatted.extend(tracebackinfo.format(formatter))
+ return formatted
+
+
+def format_exception(etype, value, tb, context=1, limit=None, formatter=None):
+ formatted = ['Traceback (most recent call last):\n']
+
+ if hasattr(tb, 'tb_next'):
+ tb = extract_traceback(tb, context)
+
+ formatted.extend(format_extracted(tb, formatter, limit))
+ formatted.extend(traceback.format_exception_only(etype, value))
+ return formatted
+
+def to_string(exc):
+ if isinstance(exc, SystemExit):
+ if not isinstance(exc.code, str):
+ return 'Exited with "%d"' % exc.code
+ return str(exc)
diff --git a/poky/bitbake/lib/bb/fetch2/__init__.py b/poky/bitbake/lib/bb/fetch2/__init__.py
new file mode 100644
index 000000000..72d6092de
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/__init__.py
@@ -0,0 +1,1864 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementations
+
+Classes for obtaining upstream sources for the
+BitBake build tools.
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os, re
+import signal
+import logging
+import urllib.request, urllib.parse, urllib.error
+if 'git' not in urllib.parse.uses_netloc:
+ urllib.parse.uses_netloc.append('git')
+import operator
+import collections
+import subprocess
+import pickle
+import errno
+import bb.persist_data, bb.utils
+import bb.checksum
+import bb.process
+import bb.event
+
+__version__ = "2"
+_checksum_cache = bb.checksum.FileChecksumCache()
+
+logger = logging.getLogger("BitBake.Fetcher")
+
+class BBFetchException(Exception):
+ """Class all fetch exceptions inherit from"""
+ def __init__(self, message):
+ self.msg = message
+ Exception.__init__(self, message)
+
+ def __str__(self):
+ return self.msg
+
+class UntrustedUrl(BBFetchException):
+ """Exception raised when encountering a host not listed in BB_ALLOWED_NETWORKS"""
+ def __init__(self, url, message=''):
+ if message:
+ msg = message
+ else:
+ msg = "The URL: '%s' is not trusted and cannot be used" % url
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (url,)
+
+class MalformedUrl(BBFetchException):
+ """Exception raised when encountering an invalid url"""
+ def __init__(self, url, message=''):
+ if message:
+ msg = message
+ else:
+ msg = "The URL: '%s' is invalid and cannot be interpreted" % url
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (url,)
+
+class FetchError(BBFetchException):
+ """General fetcher exception when something happens incorrectly"""
+ def __init__(self, message, url = None):
+ if url:
+ msg = "Fetcher failure for URL: '%s'. %s" % (url, message)
+ else:
+ msg = "Fetcher failure: %s" % message
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (message, url)
+
+class ChecksumError(FetchError):
+ """Exception when mismatched checksum encountered"""
+ def __init__(self, message, url = None, checksum = None):
+ self.checksum = checksum
+ FetchError.__init__(self, message, url)
+
+class NoChecksumError(FetchError):
+ """Exception when no checksum is specified, but BB_STRICT_CHECKSUM is set"""
+
+class UnpackError(BBFetchException):
+ """General fetcher exception when something happens incorrectly when unpacking"""
+ def __init__(self, message, url):
+ msg = "Unpack failure for URL: '%s'. %s" % (url, message)
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (message, url)
+
+class NoMethodError(BBFetchException):
+ """Exception raised when there is no method to obtain a supplied url or set of urls"""
+ def __init__(self, url):
+ msg = "Could not find a fetcher which supports the URL: '%s'" % url
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (url,)
+
+class MissingParameterError(BBFetchException):
+ """Exception raised when a fetch method is missing a critical parameter in the url"""
+ def __init__(self, missing, url):
+ msg = "URL: '%s' is missing the required parameter '%s'" % (url, missing)
+ self.url = url
+ self.missing = missing
+ BBFetchException.__init__(self, msg)
+ self.args = (missing, url)
+
+class ParameterError(BBFetchException):
+ """Exception raised when a url cannot be proccessed due to invalid parameters."""
+ def __init__(self, message, url):
+ msg = "URL: '%s' has invalid parameters. %s" % (url, message)
+ self.url = url
+ BBFetchException.__init__(self, msg)
+ self.args = (message, url)
+
+class NetworkAccess(BBFetchException):
+ """Exception raised when network access is disabled but it is required."""
+ def __init__(self, url, cmd):
+ msg = "Network access disabled through BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY) but access requested with command %s (for url %s)" % (cmd, url)
+ self.url = url
+ self.cmd = cmd
+ BBFetchException.__init__(self, msg)
+ self.args = (url, cmd)
+
+class NonLocalMethod(Exception):
+ def __init__(self):
+ Exception.__init__(self)
+
+class MissingChecksumEvent(bb.event.Event):
+ def __init__(self, url, md5sum, sha256sum):
+ self.url = url
+ self.checksums = {'md5sum': md5sum,
+ 'sha256sum': sha256sum}
+ bb.event.Event.__init__(self)
+
+
+class URI(object):
+ """
+ A class representing a generic URI, with methods for
+ accessing the URI components, and stringifies to the
+ URI.
+
+ It is constructed by calling it with a URI, or setting
+ the attributes manually:
+
+ uri = URI("http://example.com/")
+
+ uri = URI()
+ uri.scheme = 'http'
+ uri.hostname = 'example.com'
+ uri.path = '/'
+
+ It has the following attributes:
+
+ * scheme (read/write)
+ * userinfo (authentication information) (read/write)
+ * username (read/write)
+ * password (read/write)
+
+ Note, password is deprecated as of RFC 3986.
+
+ * hostname (read/write)
+ * port (read/write)
+ * hostport (read only)
+ "hostname:port", if both are set, otherwise just "hostname"
+ * path (read/write)
+ * path_quoted (read/write)
+ A URI quoted version of path
+ * params (dict) (read/write)
+ * query (dict) (read/write)
+ * relative (bool) (read only)
+ True if this is a "relative URI", (e.g. file:foo.diff)
+
+ It stringifies to the URI itself.
+
+ Some notes about relative URIs: while it's specified that
+ a URI beginning with <scheme>:// should either be directly
+ followed by a hostname or a /, the old URI handling of the
+ fetch2 library did not comform to this. Therefore, this URI
+ class has some kludges to make sure that URIs are parsed in
+ a way comforming to bitbake's current usage. This URI class
+ supports the following:
+
+ file:relative/path.diff (IETF compliant)
+ git:relative/path.git (IETF compliant)
+ git:///absolute/path.git (IETF compliant)
+ file:///absolute/path.diff (IETF compliant)
+
+ file://relative/path.diff (not IETF compliant)
+
+ But it does not support the following:
+
+ file://hostname/absolute/path.diff (would be IETF compliant)
+
+ Note that the last case only applies to a list of
+ "whitelisted" schemes (currently only file://), that requires
+ its URIs to not have a network location.
+ """
+
+ _relative_schemes = ['file', 'git']
+ _netloc_forbidden = ['file']
+
+ def __init__(self, uri=None):
+ self.scheme = ''
+ self.userinfo = ''
+ self.hostname = ''
+ self.port = None
+ self._path = ''
+ self.params = {}
+ self.query = {}
+ self.relative = False
+
+ if not uri:
+ return
+
+ # We hijack the URL parameters, since the way bitbake uses
+ # them are not quite RFC compliant.
+ uri, param_str = (uri.split(";", 1) + [None])[:2]
+
+ urlp = urllib.parse.urlparse(uri)
+ self.scheme = urlp.scheme
+
+ reparse = 0
+
+ # Coerce urlparse to make URI scheme use netloc
+ if not self.scheme in urllib.parse.uses_netloc:
+ urllib.parse.uses_params.append(self.scheme)
+ reparse = 1
+
+ # Make urlparse happy(/ier) by converting local resources
+ # to RFC compliant URL format. E.g.:
+ # file://foo.diff -> file:foo.diff
+ if urlp.scheme in self._netloc_forbidden:
+ uri = re.sub("(?<=:)//(?!/)", "", uri, 1)
+ reparse = 1
+
+ if reparse:
+ urlp = urllib.parse.urlparse(uri)
+
+ # Identify if the URI is relative or not
+ if urlp.scheme in self._relative_schemes and \
+ re.compile("^\w+:(?!//)").match(uri):
+ self.relative = True
+
+ if not self.relative:
+ self.hostname = urlp.hostname or ''
+ self.port = urlp.port
+
+ self.userinfo += urlp.username or ''
+
+ if urlp.password:
+ self.userinfo += ':%s' % urlp.password
+
+ self.path = urllib.parse.unquote(urlp.path)
+
+ if param_str:
+ self.params = self._param_str_split(param_str, ";")
+ if urlp.query:
+ self.query = self._param_str_split(urlp.query, "&")
+
+ def __str__(self):
+ userinfo = self.userinfo
+ if userinfo:
+ userinfo += '@'
+
+ return "%s:%s%s%s%s%s%s" % (
+ self.scheme,
+ '' if self.relative else '//',
+ userinfo,
+ self.hostport,
+ self.path_quoted,
+ self._query_str(),
+ self._param_str())
+
+ def _param_str(self):
+ return (
+ ''.join([';', self._param_str_join(self.params, ";")])
+ if self.params else '')
+
+ def _query_str(self):
+ return (
+ ''.join(['?', self._param_str_join(self.query, "&")])
+ if self.query else '')
+
+ def _param_str_split(self, string, elmdelim, kvdelim="="):
+ ret = collections.OrderedDict()
+ for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim)]:
+ ret[k] = v
+ return ret
+
+ def _param_str_join(self, dict_, elmdelim, kvdelim="="):
+ return elmdelim.join([kvdelim.join([k, v]) for k, v in dict_.items()])
+
+ @property
+ def hostport(self):
+ if not self.port:
+ return self.hostname
+ return "%s:%d" % (self.hostname, self.port)
+
+ @property
+ def path_quoted(self):
+ return urllib.parse.quote(self.path)
+
+ @path_quoted.setter
+ def path_quoted(self, path):
+ self.path = urllib.parse.unquote(path)
+
+ @property
+ def path(self):
+ return self._path
+
+ @path.setter
+ def path(self, path):
+ self._path = path
+
+ if not path or re.compile("^/").match(path):
+ self.relative = False
+ else:
+ self.relative = True
+
+ @property
+ def username(self):
+ if self.userinfo:
+ return (self.userinfo.split(":", 1))[0]
+ return ''
+
+ @username.setter
+ def username(self, username):
+ password = self.password
+ self.userinfo = username
+ if password:
+ self.userinfo += ":%s" % password
+
+ @property
+ def password(self):
+ if self.userinfo and ":" in self.userinfo:
+ return (self.userinfo.split(":", 1))[1]
+ return ''
+
+ @password.setter
+ def password(self, password):
+ self.userinfo = "%s:%s" % (self.username, password)
+
+def decodeurl(url):
+ """Decodes an URL into the tokens (scheme, network location, path,
+ user, password, parameters).
+ """
+
+ m = re.compile('(?P<type>[^:]*)://((?P<user>[^/;]+)@)?(?P<location>[^;]+)(;(?P<parm>.*))?').match(url)
+ if not m:
+ raise MalformedUrl(url)
+
+ type = m.group('type')
+ location = m.group('location')
+ if not location:
+ raise MalformedUrl(url)
+ user = m.group('user')
+ parm = m.group('parm')
+
+ locidx = location.find('/')
+ if locidx != -1 and type.lower() != 'file':
+ host = location[:locidx]
+ path = location[locidx:]
+ elif type.lower() == 'file':
+ host = ""
+ path = location
+ else:
+ host = location
+ path = ""
+ if user:
+ m = re.compile('(?P<user>[^:]+)(:?(?P<pswd>.*))').match(user)
+ if m:
+ user = m.group('user')
+ pswd = m.group('pswd')
+ else:
+ user = ''
+ pswd = ''
+
+ p = collections.OrderedDict()
+ if parm:
+ for s in parm.split(';'):
+ if s:
+ if not '=' in s:
+ raise MalformedUrl(url, "The URL: '%s' is invalid: parameter %s does not specify a value (missing '=')" % (url, s))
+ s1, s2 = s.split('=')
+ p[s1] = s2
+
+ return type, host, urllib.parse.unquote(path), user, pswd, p
+
+def encodeurl(decoded):
+ """Encodes a URL from tokens (scheme, network location, path,
+ user, password, parameters).
+ """
+
+ type, host, path, user, pswd, p = decoded
+
+ if not type:
+ raise MissingParameterError('type', "encoded from the data %s" % str(decoded))
+ url = '%s://' % type
+ if user and type != "file":
+ url += "%s" % user
+ if pswd:
+ url += ":%s" % pswd
+ url += "@"
+ if host and type != "file":
+ url += "%s" % host
+ if path:
+ # Standardise path to ensure comparisons work
+ while '//' in path:
+ path = path.replace("//", "/")
+ url += "%s" % urllib.parse.quote(path)
+ if p:
+ for parm in p:
+ url += ";%s=%s" % (parm, p[parm])
+
+ return url
+
+def uri_replace(ud, uri_find, uri_replace, replacements, d, mirrortarball=None):
+ if not ud.url or not uri_find or not uri_replace:
+ logger.error("uri_replace: passed an undefined value, not replacing")
+ return None
+ uri_decoded = list(decodeurl(ud.url))
+ uri_find_decoded = list(decodeurl(uri_find))
+ uri_replace_decoded = list(decodeurl(uri_replace))
+ logger.debug(2, "For url %s comparing %s to %s" % (uri_decoded, uri_find_decoded, uri_replace_decoded))
+ result_decoded = ['', '', '', '', '', {}]
+ for loc, i in enumerate(uri_find_decoded):
+ result_decoded[loc] = uri_decoded[loc]
+ regexp = i
+ if loc == 0 and regexp and not regexp.endswith("$"):
+ # Leaving the type unanchored can mean "https" matching "file" can become "files"
+ # which is clearly undesirable.
+ regexp += "$"
+ if loc == 5:
+ # Handle URL parameters
+ if i:
+ # Any specified URL parameters must match
+ for k in uri_replace_decoded[loc]:
+ if uri_decoded[loc][k] != uri_replace_decoded[loc][k]:
+ return None
+ # Overwrite any specified replacement parameters
+ for k in uri_replace_decoded[loc]:
+ for l in replacements:
+ uri_replace_decoded[loc][k] = uri_replace_decoded[loc][k].replace(l, replacements[l])
+ result_decoded[loc][k] = uri_replace_decoded[loc][k]
+ elif (re.match(regexp, uri_decoded[loc])):
+ if not uri_replace_decoded[loc]:
+ result_decoded[loc] = ""
+ else:
+ for k in replacements:
+ uri_replace_decoded[loc] = uri_replace_decoded[loc].replace(k, replacements[k])
+ #bb.note("%s %s %s" % (regexp, uri_replace_decoded[loc], uri_decoded[loc]))
+ result_decoded[loc] = re.sub(regexp, uri_replace_decoded[loc], uri_decoded[loc], 1)
+ if loc == 2:
+ # Handle path manipulations
+ basename = None
+ if uri_decoded[0] != uri_replace_decoded[0] and mirrortarball:
+ # If the source and destination url types differ, must be a mirrortarball mapping
+ basename = os.path.basename(mirrortarball)
+ # Kill parameters, they make no sense for mirror tarballs
+ uri_decoded[5] = {}
+ elif ud.localpath and ud.method.supports_checksum(ud):
+ basename = os.path.basename(ud.localpath)
+ if basename and not result_decoded[loc].endswith(basename):
+ result_decoded[loc] = os.path.join(result_decoded[loc], basename)
+ else:
+ return None
+ result = encodeurl(result_decoded)
+ if result == ud.url:
+ return None
+ logger.debug(2, "For url %s returning %s" % (ud.url, result))
+ return result
+
+methods = []
+urldata_cache = {}
+saved_headrevs = {}
+
+def fetcher_init(d):
+ """
+ Called to initialize the fetchers once the configuration data is known.
+ Calls before this must not hit the cache.
+ """
+ # When to drop SCM head revisions controlled by user policy
+ srcrev_policy = d.getVar('BB_SRCREV_POLICY') or "clear"
+ if srcrev_policy == "cache":
+ logger.debug(1, "Keeping SRCREV cache due to cache policy of: %s", srcrev_policy)
+ elif srcrev_policy == "clear":
+ logger.debug(1, "Clearing SRCREV cache due to cache policy of: %s", srcrev_policy)
+ revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
+ try:
+ bb.fetch2.saved_headrevs = revs.items()
+ except:
+ pass
+ revs.clear()
+ else:
+ raise FetchError("Invalid SRCREV cache policy of: %s" % srcrev_policy)
+
+ _checksum_cache.init_cache(d)
+
+ for m in methods:
+ if hasattr(m, "init"):
+ m.init(d)
+
+def fetcher_parse_save():
+ _checksum_cache.save_extras()
+
+def fetcher_parse_done():
+ _checksum_cache.save_merge()
+
+def fetcher_compare_revisions():
+ """
+ Compare the revisions in the persistant cache with current values and
+ return true/false on whether they've changed.
+ """
+
+ data = bb.persist_data.persist('BB_URI_HEADREVS', d).items()
+ data2 = bb.fetch2.saved_headrevs
+
+ changed = False
+ for key in data:
+ if key not in data2 or data2[key] != data[key]:
+ logger.debug(1, "%s changed", key)
+ changed = True
+ return True
+ else:
+ logger.debug(2, "%s did not change", key)
+ return False
+
+def mirror_from_string(data):
+ mirrors = (data or "").replace('\\n',' ').split()
+ # Split into pairs
+ if len(mirrors) % 2 != 0:
+ bb.warn('Invalid mirror data %s, should have paired members.' % data)
+ return list(zip(*[iter(mirrors)]*2))
+
+def verify_checksum(ud, d, precomputed={}):
+ """
+ verify the MD5 and SHA256 checksum for downloaded src
+
+ Raises a FetchError if one or both of the SRC_URI checksums do not match
+ the downloaded file, or if BB_STRICT_CHECKSUM is set and there are no
+ checksums specified.
+
+ Returns a dict of checksums that can be stored in a done stamp file and
+ passed in as precomputed parameter in a later call to avoid re-computing
+ the checksums from the file. This allows verifying the checksums of the
+ file against those in the recipe each time, rather than only after
+ downloading. See https://bugzilla.yoctoproject.org/show_bug.cgi?id=5571.
+ """
+
+ _MD5_KEY = "md5"
+ _SHA256_KEY = "sha256"
+
+ if ud.ignore_checksums or not ud.method.supports_checksum(ud):
+ return {}
+
+ if _MD5_KEY in precomputed:
+ md5data = precomputed[_MD5_KEY]
+ else:
+ md5data = bb.utils.md5_file(ud.localpath)
+
+ if _SHA256_KEY in precomputed:
+ sha256data = precomputed[_SHA256_KEY]
+ else:
+ sha256data = bb.utils.sha256_file(ud.localpath)
+
+ if ud.method.recommends_checksum(ud) and not ud.md5_expected and not ud.sha256_expected:
+ # If strict checking enabled and neither sum defined, raise error
+ strict = d.getVar("BB_STRICT_CHECKSUM") or "0"
+ if strict == "1":
+ logger.error('No checksum specified for %s, please add at least one to the recipe:\n'
+ 'SRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"' %
+ (ud.localpath, ud.md5_name, md5data,
+ ud.sha256_name, sha256data))
+ raise NoChecksumError('Missing SRC_URI checksum', ud.url)
+
+ bb.event.fire(MissingChecksumEvent(ud.url, md5data, sha256data), d)
+
+ if strict == "ignore":
+ return {
+ _MD5_KEY: md5data,
+ _SHA256_KEY: sha256data
+ }
+
+ # Log missing sums so user can more easily add them
+ logger.warning('Missing md5 SRC_URI checksum for %s, consider adding to the recipe:\n'
+ 'SRC_URI[%s] = "%s"',
+ ud.localpath, ud.md5_name, md5data)
+ logger.warning('Missing sha256 SRC_URI checksum for %s, consider adding to the recipe:\n'
+ 'SRC_URI[%s] = "%s"',
+ ud.localpath, ud.sha256_name, sha256data)
+
+ # We want to alert the user if a checksum is defined in the recipe but
+ # it does not match.
+ msg = ""
+ mismatch = False
+ if ud.md5_expected and ud.md5_expected != md5data:
+ msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'md5', md5data, ud.md5_expected)
+ mismatch = True;
+
+ if ud.sha256_expected and ud.sha256_expected != sha256data:
+ msg = msg + "\nFile: '%s' has %s checksum %s when %s was expected" % (ud.localpath, 'sha256', sha256data, ud.sha256_expected)
+ mismatch = True;
+
+ if mismatch:
+ msg = msg + '\nIf this change is expected (e.g. you have upgraded to a new version without updating the checksums) then you can use these lines within the recipe:\nSRC_URI[%s] = "%s"\nSRC_URI[%s] = "%s"\nOtherwise you should retry the download and/or check with upstream to determine if the file has become corrupted or otherwise unexpectedly modified.\n' % (ud.md5_name, md5data, ud.sha256_name, sha256data)
+
+ if len(msg):
+ raise ChecksumError('Checksum mismatch!%s' % msg, ud.url, md5data)
+
+ return {
+ _MD5_KEY: md5data,
+ _SHA256_KEY: sha256data
+ }
+
+
+def verify_donestamp(ud, d, origud=None):
+ """
+ Check whether the done stamp file has the right checksums (if the fetch
+ method supports them). If it doesn't, delete the done stamp and force
+ a re-download.
+
+ Returns True, if the donestamp exists and is valid, False otherwise. When
+ returning False, any existing done stamps are removed.
+ """
+ if not ud.needdonestamp or (origud and not origud.needdonestamp):
+ return True
+
+ if not os.path.exists(ud.localpath):
+ # local path does not exist
+ if os.path.exists(ud.donestamp):
+ # done stamp exists, but the downloaded file does not; the done stamp
+ # must be incorrect, re-trigger the download
+ bb.utils.remove(ud.donestamp)
+ return False
+
+ if (not ud.method.supports_checksum(ud) or
+ (origud and not origud.method.supports_checksum(origud))):
+ # if done stamp exists and checksums not supported; assume the local
+ # file is current
+ return os.path.exists(ud.donestamp)
+
+ precomputed_checksums = {}
+ # Only re-use the precomputed checksums if the donestamp is newer than the
+ # file. Do not rely on the mtime of directories, though. If ud.localpath is
+ # a directory, there will probably not be any checksums anyway.
+ if os.path.exists(ud.donestamp) and (os.path.isdir(ud.localpath) or
+ os.path.getmtime(ud.localpath) < os.path.getmtime(ud.donestamp)):
+ try:
+ with open(ud.donestamp, "rb") as cachefile:
+ pickled = pickle.Unpickler(cachefile)
+ precomputed_checksums.update(pickled.load())
+ except Exception as e:
+ # Avoid the warnings on the upgrade path from emtpy done stamp
+ # files to those containing the checksums.
+ if not isinstance(e, EOFError):
+ # Ignore errors, they aren't fatal
+ logger.warning("Couldn't load checksums from donestamp %s: %s "
+ "(msg: %s)" % (ud.donestamp, type(e).__name__,
+ str(e)))
+
+ try:
+ checksums = verify_checksum(ud, d, precomputed_checksums)
+ # If the cache file did not have the checksums, compute and store them
+ # as an upgrade path from the previous done stamp file format.
+ if checksums != precomputed_checksums:
+ with open(ud.donestamp, "wb") as cachefile:
+ p = pickle.Pickler(cachefile, 2)
+ p.dump(checksums)
+ return True
+ except ChecksumError as e:
+ # Checksums failed to verify, trigger re-download and remove the
+ # incorrect stamp file.
+ logger.warning("Checksum mismatch for local file %s\n"
+ "Cleaning and trying again." % ud.localpath)
+ if os.path.exists(ud.localpath):
+ rename_bad_checksum(ud, e.checksum)
+ bb.utils.remove(ud.donestamp)
+ return False
+
+
+def update_stamp(ud, d):
+ """
+ donestamp is file stamp indicating the whole fetching is done
+ this function update the stamp after verifying the checksum
+ """
+ if not ud.needdonestamp:
+ return
+
+ if os.path.exists(ud.donestamp):
+ # Touch the done stamp file to show active use of the download
+ try:
+ os.utime(ud.donestamp, None)
+ except:
+ # Errors aren't fatal here
+ pass
+ else:
+ try:
+ checksums = verify_checksum(ud, d)
+ # Store the checksums for later re-verification against the recipe
+ with open(ud.donestamp, "wb") as cachefile:
+ p = pickle.Pickler(cachefile, 2)
+ p.dump(checksums)
+ except ChecksumError as e:
+ # Checksums failed to verify, trigger re-download and remove the
+ # incorrect stamp file.
+ logger.warning("Checksum mismatch for local file %s\n"
+ "Cleaning and trying again." % ud.localpath)
+ if os.path.exists(ud.localpath):
+ rename_bad_checksum(ud, e.checksum)
+ bb.utils.remove(ud.donestamp)
+ raise
+
+def subprocess_setup():
+ # Python installs a SIGPIPE handler by default. This is usually not what
+ # non-Python subprocesses expect.
+ # SIGPIPE errors are known issues with gzip/bash
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+def get_autorev(d):
+ # only not cache src rev in autorev case
+ if d.getVar('BB_SRCREV_POLICY') != "cache":
+ d.setVar('BB_DONT_CACHE', '1')
+ return "AUTOINC"
+
+def get_srcrev(d, method_name='sortable_revision'):
+ """
+ Return the revision string, usually for use in the version string (PV) of the current package
+ Most packages usually only have one SCM so we just pass on the call.
+ In the multi SCM case, we build a value based on SRCREV_FORMAT which must
+ have been set.
+
+ The idea here is that we put the string "AUTOINC+" into return value if the revisions are not
+ incremental, other code is then responsible for turning that into an increasing value (if needed)
+
+ A method_name can be supplied to retrieve an alternatively formatted revision from a fetcher, if
+ that fetcher provides a method with the given name and the same signature as sortable_revision.
+ """
+
+ scms = []
+ fetcher = Fetch(d.getVar('SRC_URI').split(), d)
+ urldata = fetcher.ud
+ for u in urldata:
+ if urldata[u].method.supports_srcrev():
+ scms.append(u)
+
+ if len(scms) == 0:
+ raise FetchError("SRCREV was used yet no valid SCM was found in SRC_URI")
+
+ if len(scms) == 1 and len(urldata[scms[0]].names) == 1:
+ autoinc, rev = getattr(urldata[scms[0]].method, method_name)(urldata[scms[0]], d, urldata[scms[0]].names[0])
+ if len(rev) > 10:
+ rev = rev[:10]
+ if autoinc:
+ return "AUTOINC+" + rev
+ return rev
+
+ #
+ # Mutiple SCMs are in SRC_URI so we resort to SRCREV_FORMAT
+ #
+ format = d.getVar('SRCREV_FORMAT')
+ if not format:
+ raise FetchError("The SRCREV_FORMAT variable must be set when multiple SCMs are used.")
+
+ name_to_rev = {}
+ seenautoinc = False
+ for scm in scms:
+ ud = urldata[scm]
+ for name in ud.names:
+ autoinc, rev = getattr(ud.method, method_name)(ud, d, name)
+ seenautoinc = seenautoinc or autoinc
+ if len(rev) > 10:
+ rev = rev[:10]
+ name_to_rev[name] = rev
+ # Replace names by revisions in the SRCREV_FORMAT string. The approach used
+ # here can handle names being prefixes of other names and names appearing
+ # as substrings in revisions (in which case the name should not be
+ # expanded). The '|' regular expression operator tries matches from left to
+ # right, so we need to sort the names with the longest ones first.
+ names_descending_len = sorted(name_to_rev, key=len, reverse=True)
+ name_to_rev_re = "|".join(re.escape(name) for name in names_descending_len)
+ format = re.sub(name_to_rev_re, lambda match: name_to_rev[match.group(0)], format)
+
+ if seenautoinc:
+ format = "AUTOINC+" + format
+
+ return format
+
+def localpath(url, d):
+ fetcher = bb.fetch2.Fetch([url], d)
+ return fetcher.localpath(url)
+
+def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None, workdir=None):
+ """
+ Run cmd returning the command output
+ Raise an error if interrupted or cmd fails
+ Optionally echo command output to stdout
+ Optionally remove the files/directories listed in cleanup upon failure
+ """
+
+ # Need to export PATH as binary could be in metadata paths
+ # rather than host provided
+ # Also include some other variables.
+ # FIXME: Should really include all export varaiables?
+ exportvars = ['HOME', 'PATH',
+ 'HTTP_PROXY', 'http_proxy',
+ 'HTTPS_PROXY', 'https_proxy',
+ 'FTP_PROXY', 'ftp_proxy',
+ 'FTPS_PROXY', 'ftps_proxy',
+ 'NO_PROXY', 'no_proxy',
+ 'ALL_PROXY', 'all_proxy',
+ 'GIT_PROXY_COMMAND',
+ 'GIT_SSL_CAINFO',
+ 'GIT_SMART_HTTP',
+ 'SSH_AUTH_SOCK', 'SSH_AGENT_PID',
+ 'SOCKS5_USER', 'SOCKS5_PASSWD',
+ 'DBUS_SESSION_BUS_ADDRESS',
+ 'P4CONFIG']
+
+ if not cleanup:
+ cleanup = []
+
+ # If PATH contains WORKDIR which contains PV which contains SRCPV we
+ # can end up in circular recursion here so give the option of breaking it
+ # in a data store copy.
+ try:
+ d.getVar("PV")
+ except bb.data_smart.ExpansionError:
+ d = bb.data.createCopy(d)
+ d.setVar("PV", "fetcheravoidrecurse")
+
+ origenv = d.getVar("BB_ORIGENV", False)
+ for var in exportvars:
+ val = d.getVar(var) or (origenv and origenv.getVar(var))
+ if val:
+ cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+
+ # Disable pseudo as it may affect ssh, potentially causing it to hang.
+ cmd = 'export PSEUDO_DISABLED=1; ' + cmd
+
+ logger.debug(1, "Running %s", cmd)
+
+ success = False
+ error_message = ""
+
+ try:
+ (output, errors) = bb.process.run(cmd, log=log, shell=True, stderr=subprocess.PIPE, cwd=workdir)
+ success = True
+ except bb.process.NotFoundError as e:
+ error_message = "Fetch command %s" % (e.command)
+ except bb.process.ExecutionError as e:
+ if e.stdout:
+ output = "output:\n%s\n%s" % (e.stdout, e.stderr)
+ elif e.stderr:
+ output = "output:\n%s" % e.stderr
+ else:
+ output = "no output"
+ error_message = "Fetch command %s failed with exit code %s, %s" % (e.command, e.exitcode, output)
+ except bb.process.CmdError as e:
+ error_message = "Fetch command %s could not be run:\n%s" % (e.command, e.msg)
+ if not success:
+ for f in cleanup:
+ try:
+ bb.utils.remove(f, True)
+ except OSError:
+ pass
+
+ raise FetchError(error_message)
+
+ return output
+
+def check_network_access(d, info, url):
+ """
+ log remote network access, and error if BB_NO_NETWORK is set or the given
+ URI is untrusted
+ """
+ if d.getVar("BB_NO_NETWORK") == "1":
+ raise NetworkAccess(url, info)
+ elif not trusted_network(d, url):
+ raise UntrustedUrl(url, info)
+ else:
+ logger.debug(1, "Fetcher accessed the network with the command %s" % info)
+
+def build_mirroruris(origud, mirrors, ld):
+ uris = []
+ uds = []
+
+ replacements = {}
+ replacements["TYPE"] = origud.type
+ replacements["HOST"] = origud.host
+ replacements["PATH"] = origud.path
+ replacements["BASENAME"] = origud.path.split("/")[-1]
+ replacements["MIRRORNAME"] = origud.host.replace(':','.') + origud.path.replace('/', '.').replace('*', '.')
+
+ def adduri(ud, uris, uds, mirrors, tarballs):
+ for line in mirrors:
+ try:
+ (find, replace) = line
+ except ValueError:
+ continue
+
+ for tarball in tarballs:
+ newuri = uri_replace(ud, find, replace, replacements, ld, tarball)
+ if not newuri or newuri in uris or newuri == origud.url:
+ continue
+
+ if not trusted_network(ld, newuri):
+ logger.debug(1, "Mirror %s not in the list of trusted networks, skipping" % (newuri))
+ continue
+
+ # Create a local copy of the mirrors minus the current line
+ # this will prevent us from recursively processing the same line
+ # as well as indirect recursion A -> B -> C -> A
+ localmirrors = list(mirrors)
+ localmirrors.remove(line)
+
+ try:
+ newud = FetchData(newuri, ld)
+ newud.setup_localpath(ld)
+ except bb.fetch2.BBFetchException as e:
+ logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (newuri, origud.url))
+ logger.debug(1, str(e))
+ try:
+ # setup_localpath of file:// urls may fail, we should still see
+ # if mirrors of the url exist
+ adduri(newud, uris, uds, localmirrors, tarballs)
+ except UnboundLocalError:
+ pass
+ continue
+ uris.append(newuri)
+ uds.append(newud)
+
+ adduri(newud, uris, uds, localmirrors, tarballs)
+
+ adduri(origud, uris, uds, mirrors, origud.mirrortarballs or [None])
+
+ return uris, uds
+
+def rename_bad_checksum(ud, suffix):
+ """
+ Renames files to have suffix from parameter
+ """
+
+ if ud.localpath is None:
+ return
+
+ new_localpath = "%s_bad-checksum_%s" % (ud.localpath, suffix)
+ bb.warn("Renaming %s to %s" % (ud.localpath, new_localpath))
+ bb.utils.movefile(ud.localpath, new_localpath)
+
+
+def try_mirror_url(fetch, origud, ud, ld, check = False):
+ # Return of None or a value means we're finished
+ # False means try another url
+
+ if ud.lockfile and ud.lockfile != origud.lockfile:
+ lf = bb.utils.lockfile(ud.lockfile)
+
+ try:
+ if check:
+ found = ud.method.checkstatus(fetch, ud, ld)
+ if found:
+ return found
+ return False
+
+ if not verify_donestamp(ud, ld, origud) or ud.method.need_update(ud, ld):
+ ud.method.download(ud, ld)
+ if hasattr(ud.method,"build_mirror_data"):
+ ud.method.build_mirror_data(ud, ld)
+
+ if not ud.localpath or not os.path.exists(ud.localpath):
+ return False
+
+ if ud.localpath == origud.localpath:
+ return ud.localpath
+
+ # We may be obtaining a mirror tarball which needs further processing by the real fetcher
+ # If that tarball is a local file:// we need to provide a symlink to it
+ dldir = ld.getVar("DL_DIR")
+
+ if origud.mirrortarballs and os.path.basename(ud.localpath) in origud.mirrortarballs and os.path.basename(ud.localpath) != os.path.basename(origud.localpath):
+ # Create donestamp in old format to avoid triggering a re-download
+ if ud.donestamp:
+ bb.utils.mkdirhier(os.path.dirname(ud.donestamp))
+ open(ud.donestamp, 'w').close()
+ dest = os.path.join(dldir, os.path.basename(ud.localpath))
+ if not os.path.exists(dest):
+ # In case this is executing without any file locks held (as is
+ # the case for file:// URLs), two tasks may end up here at the
+ # same time, in which case we do not want the second task to
+ # fail when the link has already been created by the first task.
+ try:
+ os.symlink(ud.localpath, dest)
+ except FileExistsError:
+ pass
+ if not verify_donestamp(origud, ld) or origud.method.need_update(origud, ld):
+ origud.method.download(origud, ld)
+ if hasattr(origud.method, "build_mirror_data"):
+ origud.method.build_mirror_data(origud, ld)
+ return origud.localpath
+ # Otherwise the result is a local file:// and we symlink to it
+ if not os.path.exists(origud.localpath):
+ if os.path.islink(origud.localpath):
+ # Broken symbolic link
+ os.unlink(origud.localpath)
+
+ # As per above, in case two tasks end up here simultaneously.
+ try:
+ os.symlink(ud.localpath, origud.localpath)
+ except FileExistsError:
+ pass
+ update_stamp(origud, ld)
+ return ud.localpath
+
+ except bb.fetch2.NetworkAccess:
+ raise
+
+ except IOError as e:
+ if e.errno in [os.errno.ESTALE]:
+ logger.warning("Stale Error Observed %s." % ud.url)
+ return False
+ raise
+
+ except bb.fetch2.BBFetchException as e:
+ if isinstance(e, ChecksumError):
+ logger.warning("Mirror checksum failure for url %s (original url: %s)\nCleaning and trying again." % (ud.url, origud.url))
+ logger.warning(str(e))
+ if os.path.exists(ud.localpath):
+ rename_bad_checksum(ud, e.checksum)
+ elif isinstance(e, NoChecksumError):
+ raise
+ else:
+ logger.debug(1, "Mirror fetch failure for url %s (original url: %s)" % (ud.url, origud.url))
+ logger.debug(1, str(e))
+ try:
+ ud.method.clean(ud, ld)
+ except UnboundLocalError:
+ pass
+ return False
+ finally:
+ if ud.lockfile and ud.lockfile != origud.lockfile:
+ bb.utils.unlockfile(lf)
+
+
+def try_mirrors(fetch, d, origud, mirrors, check = False):
+ """
+ Try to use a mirrored version of the sources.
+ This method will be automatically called before the fetchers go.
+
+ d Is a bb.data instance
+ uri is the original uri we're trying to download
+ mirrors is the list of mirrors we're going to try
+ """
+ ld = d.createCopy()
+
+ uris, uds = build_mirroruris(origud, mirrors, ld)
+
+ for index, uri in enumerate(uris):
+ ret = try_mirror_url(fetch, origud, uds[index], ld, check)
+ if ret != False:
+ return ret
+ return None
+
+def trusted_network(d, url):
+ """
+ Use a trusted url during download if networking is enabled and
+ BB_ALLOWED_NETWORKS is set globally or for a specific recipe.
+ Note: modifies SRC_URI & mirrors.
+ """
+ if d.getVar('BB_NO_NETWORK') == "1":
+ return True
+
+ pkgname = d.expand(d.getVar('PN', False))
+ trusted_hosts = d.getVarFlag('BB_ALLOWED_NETWORKS', pkgname, False)
+
+ if not trusted_hosts:
+ trusted_hosts = d.getVar('BB_ALLOWED_NETWORKS')
+
+ # Not enabled.
+ if not trusted_hosts:
+ return True
+
+ scheme, network, path, user, passwd, param = decodeurl(url)
+
+ if not network:
+ return True
+
+ network = network.split(':')[0]
+ network = network.lower()
+
+ for host in trusted_hosts.split(" "):
+ host = host.lower()
+ if host.startswith("*.") and ("." + network).endswith(host[1:]):
+ return True
+ if host == network:
+ return True
+
+ return False
+
+def srcrev_internal_helper(ud, d, name):
+ """
+ Return:
+ a) a source revision if specified
+ b) latest revision if SRCREV="AUTOINC"
+ c) None if not specified
+ """
+
+ srcrev = None
+ pn = d.getVar("PN")
+ attempts = []
+ if name != '' and pn:
+ attempts.append("SRCREV_%s_pn-%s" % (name, pn))
+ if name != '':
+ attempts.append("SRCREV_%s" % name)
+ if pn:
+ attempts.append("SRCREV_pn-%s" % pn)
+ attempts.append("SRCREV")
+
+ for a in attempts:
+ srcrev = d.getVar(a)
+ if srcrev and srcrev != "INVALID":
+ break
+
+ if 'rev' in ud.parm and 'tag' in ud.parm:
+ raise FetchError("Please specify a ;rev= parameter or a ;tag= parameter in the url %s but not both." % (ud.url))
+
+ if 'rev' in ud.parm or 'tag' in ud.parm:
+ if 'rev' in ud.parm:
+ parmrev = ud.parm['rev']
+ else:
+ parmrev = ud.parm['tag']
+ if srcrev == "INVALID" or not srcrev:
+ return parmrev
+ if srcrev != parmrev:
+ raise FetchError("Conflicting revisions (%s from SRCREV and %s from the url) found, please specify one valid value" % (srcrev, parmrev))
+ return parmrev
+
+ if srcrev == "INVALID" or not srcrev:
+ raise FetchError("Please set a valid SRCREV for url %s (possible key names are %s, or use a ;rev=X URL parameter)" % (str(attempts), ud.url), ud.url)
+ if srcrev == "AUTOINC":
+ srcrev = ud.method.latest_revision(ud, d, name)
+
+ return srcrev
+
+def get_checksum_file_list(d):
+ """ Get a list of files checksum in SRC_URI
+
+ Returns the resolved local paths of all local file entries in
+ SRC_URI as a space-separated string
+ """
+ fetch = Fetch([], d, cache = False, localonly = True)
+
+ dl_dir = d.getVar('DL_DIR')
+ filelist = []
+ for u in fetch.urls:
+ ud = fetch.ud[u]
+
+ if ud and isinstance(ud.method, local.Local):
+ paths = ud.method.localpaths(ud, d)
+ for f in paths:
+ pth = ud.decodedurl
+ if '*' in pth:
+ f = os.path.join(os.path.abspath(f), pth)
+ if f.startswith(dl_dir):
+ # The local fetcher's behaviour is to return a path under DL_DIR if it couldn't find the file anywhere else
+ if os.path.exists(f):
+ bb.warn("Getting checksum for %s SRC_URI entry %s: file not found except in DL_DIR" % (d.getVar('PN'), os.path.basename(f)))
+ else:
+ bb.warn("Unable to get checksum for %s SRC_URI entry %s: file could not be found" % (d.getVar('PN'), os.path.basename(f)))
+ filelist.append(f + ":" + str(os.path.exists(f)))
+
+ return " ".join(filelist)
+
+def get_file_checksums(filelist, pn):
+ """Get a list of the checksums for a list of local files
+
+ Returns the checksums for a list of local files, caching the results as
+ it proceeds
+
+ """
+ return _checksum_cache.get_checksums(filelist, pn)
+
+
+class FetchData(object):
+ """
+ A class which represents the fetcher state for a given URI.
+ """
+ def __init__(self, url, d, localonly = False):
+ # localpath is the location of a downloaded result. If not set, the file is local.
+ self.donestamp = None
+ self.needdonestamp = True
+ self.localfile = ""
+ self.localpath = None
+ self.lockfile = None
+ self.mirrortarballs = []
+ self.basename = None
+ self.basepath = None
+ (self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(d.expand(url))
+ self.date = self.getSRCDate(d)
+ self.url = url
+ if not self.user and "user" in self.parm:
+ self.user = self.parm["user"]
+ if not self.pswd and "pswd" in self.parm:
+ self.pswd = self.parm["pswd"]
+ self.setup = False
+
+ if "name" in self.parm:
+ self.md5_name = "%s.md5sum" % self.parm["name"]
+ self.sha256_name = "%s.sha256sum" % self.parm["name"]
+ else:
+ self.md5_name = "md5sum"
+ self.sha256_name = "sha256sum"
+ if self.md5_name in self.parm:
+ self.md5_expected = self.parm[self.md5_name]
+ elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3"]:
+ self.md5_expected = None
+ else:
+ self.md5_expected = d.getVarFlag("SRC_URI", self.md5_name)
+ if self.sha256_name in self.parm:
+ self.sha256_expected = self.parm[self.sha256_name]
+ elif self.type not in ["http", "https", "ftp", "ftps", "sftp", "s3"]:
+ self.sha256_expected = None
+ else:
+ self.sha256_expected = d.getVarFlag("SRC_URI", self.sha256_name)
+ self.ignore_checksums = False
+
+ self.names = self.parm.get("name",'default').split(',')
+
+ self.method = None
+ for m in methods:
+ if m.supports(self, d):
+ self.method = m
+ break
+
+ if not self.method:
+ raise NoMethodError(url)
+
+ if localonly and not isinstance(self.method, local.Local):
+ raise NonLocalMethod()
+
+ if self.parm.get("proto", None) and "protocol" not in self.parm:
+ logger.warning('Consider updating %s recipe to use "protocol" not "proto" in SRC_URI.', d.getVar('PN'))
+ self.parm["protocol"] = self.parm.get("proto", None)
+
+ if hasattr(self.method, "urldata_init"):
+ self.method.urldata_init(self, d)
+
+ if "localpath" in self.parm:
+ # if user sets localpath for file, use it instead.
+ self.localpath = self.parm["localpath"]
+ self.basename = os.path.basename(self.localpath)
+ elif self.localfile:
+ self.localpath = self.method.localpath(self, d)
+
+ dldir = d.getVar("DL_DIR")
+
+ if not self.needdonestamp:
+ return
+
+ # Note: .done and .lock files should always be in DL_DIR whereas localpath may not be.
+ if self.localpath and self.localpath.startswith(dldir):
+ basepath = self.localpath
+ elif self.localpath:
+ basepath = dldir + os.sep + os.path.basename(self.localpath)
+ elif self.basepath or self.basename:
+ basepath = dldir + os.sep + (self.basepath or self.basename)
+ else:
+ bb.fatal("Can't determine lock path for url %s" % url)
+
+ self.donestamp = basepath + '.done'
+ self.lockfile = basepath + '.lock'
+
+ def setup_revisions(self, d):
+ self.revisions = {}
+ for name in self.names:
+ self.revisions[name] = srcrev_internal_helper(self, d, name)
+
+ # add compatibility code for non name specified case
+ if len(self.names) == 1:
+ self.revision = self.revisions[self.names[0]]
+
+ def setup_localpath(self, d):
+ if not self.localpath:
+ self.localpath = self.method.localpath(self, d)
+
+ def getSRCDate(self, d):
+ """
+ Return the SRC Date for the component
+
+ d the bb.data module
+ """
+ if "srcdate" in self.parm:
+ return self.parm['srcdate']
+
+ pn = d.getVar("PN")
+
+ if pn:
+ return d.getVar("SRCDATE_%s" % pn) or d.getVar("SRCDATE") or d.getVar("DATE")
+
+ return d.getVar("SRCDATE") or d.getVar("DATE")
+
+class FetchMethod(object):
+ """Base class for 'fetch'ing data"""
+
+ def __init__(self, urls=None):
+ self.urls = []
+
+ def supports(self, urldata, d):
+ """
+ Check to see if this fetch class supports a given url.
+ """
+ return 0
+
+ def localpath(self, urldata, d):
+ """
+ Return the local filename of a given url assuming a successful fetch.
+ Can also setup variables in urldata for use in go (saving code duplication
+ and duplicate code execution)
+ """
+ return os.path.join(d.getVar("DL_DIR"), urldata.localfile)
+
+ def supports_checksum(self, urldata):
+ """
+ Is localpath something that can be represented by a checksum?
+ """
+
+ # We cannot compute checksums for directories
+ if os.path.isdir(urldata.localpath) == True:
+ return False
+ if urldata.localpath.find("*") != -1:
+ return False
+
+ return True
+
+ def recommends_checksum(self, urldata):
+ """
+ Is the backend on where checksumming is recommended (should warnings
+ be displayed if there is no checksum)?
+ """
+ return False
+
+ def _strip_leading_slashes(self, relpath):
+ """
+ Remove leading slash as os.path.join can't cope
+ """
+ while os.path.isabs(relpath):
+ relpath = relpath[1:]
+ return relpath
+
+ def setUrls(self, urls):
+ self.__urls = urls
+
+ def getUrls(self):
+ return self.__urls
+
+ urls = property(getUrls, setUrls, None, "Urls property")
+
+ def need_update(self, ud, d):
+ """
+ Force a fetch, even if localpath exists?
+ """
+ if os.path.exists(ud.localpath):
+ return False
+ return True
+
+ def supports_srcrev(self):
+ """
+ The fetcher supports auto source revisions (SRCREV)
+ """
+ return False
+
+ def download(self, urldata, d):
+ """
+ Fetch urls
+ Assumes localpath was called first
+ """
+ raise NoMethodError(url)
+
+ def unpack(self, urldata, rootdir, data):
+ iterate = False
+ file = urldata.localpath
+
+ # Localpath can't deal with 'dir/*' entries, so it converts them to '.',
+ # but it must be corrected back for local files copying
+ if urldata.basename == '*' and file.endswith('/.'):
+ file = '%s/%s' % (file.rstrip('/.'), urldata.path)
+
+ try:
+ unpack = bb.utils.to_boolean(urldata.parm.get('unpack'), True)
+ except ValueError as exc:
+ bb.fatal("Invalid value for 'unpack' parameter for %s: %s" %
+ (file, urldata.parm.get('unpack')))
+
+ base, ext = os.path.splitext(file)
+ if ext in ['.gz', '.bz2', '.Z', '.xz', '.lz']:
+ efile = os.path.join(rootdir, os.path.basename(base))
+ else:
+ efile = file
+ cmd = None
+
+ if unpack:
+ if file.endswith('.tar'):
+ cmd = 'tar x --no-same-owner -f %s' % file
+ elif file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'):
+ cmd = 'tar xz --no-same-owner -f %s' % file
+ elif file.endswith('.tbz') or file.endswith('.tbz2') or file.endswith('.tar.bz2'):
+ cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file
+ elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
+ cmd = 'gzip -dc %s > %s' % (file, efile)
+ elif file.endswith('.bz2'):
+ cmd = 'bzip2 -dc %s > %s' % (file, efile)
+ elif file.endswith('.txz') or file.endswith('.tar.xz'):
+ cmd = 'xz -dc %s | tar x --no-same-owner -f -' % file
+ elif file.endswith('.xz'):
+ cmd = 'xz -dc %s > %s' % (file, efile)
+ elif file.endswith('.tar.lz'):
+ cmd = 'lzip -dc %s | tar x --no-same-owner -f -' % file
+ elif file.endswith('.lz'):
+ cmd = 'lzip -dc %s > %s' % (file, efile)
+ elif file.endswith('.tar.7z'):
+ cmd = '7z x -so %s | tar x --no-same-owner -f -' % file
+ elif file.endswith('.7z'):
+ cmd = '7za x -y %s 1>/dev/null' % file
+ elif file.endswith('.zip') or file.endswith('.jar'):
+ try:
+ dos = bb.utils.to_boolean(urldata.parm.get('dos'), False)
+ except ValueError as exc:
+ bb.fatal("Invalid value for 'dos' parameter for %s: %s" %
+ (file, urldata.parm.get('dos')))
+ cmd = 'unzip -q -o'
+ if dos:
+ cmd = '%s -a' % cmd
+ cmd = "%s '%s'" % (cmd, file)
+ elif file.endswith('.rpm') or file.endswith('.srpm'):
+ if 'extract' in urldata.parm:
+ unpack_file = urldata.parm.get('extract')
+ cmd = 'rpm2cpio.sh %s | cpio -id %s' % (file, unpack_file)
+ iterate = True
+ iterate_file = unpack_file
+ else:
+ cmd = 'rpm2cpio.sh %s | cpio -id' % (file)
+ elif file.endswith('.deb') or file.endswith('.ipk'):
+ output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True)
+ datafile = None
+ if output:
+ for line in output.decode().splitlines():
+ if line.startswith('data.tar.'):
+ datafile = line
+ break
+ else:
+ raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar.* file", urldata.url)
+ else:
+ raise UnpackError("Unable to unpack deb/ipk package - could not list contents", urldata.url)
+ cmd = 'ar x %s %s && tar --no-same-owner -xpf %s && rm %s' % (file, datafile, datafile, datafile)
+
+ # If 'subdir' param exists, create a dir and use it as destination for unpack cmd
+ if 'subdir' in urldata.parm:
+ subdir = urldata.parm.get('subdir')
+ if os.path.isabs(subdir):
+ if not os.path.realpath(subdir).startswith(os.path.realpath(rootdir)):
+ raise UnpackError("subdir argument isn't a subdirectory of unpack root %s" % rootdir, urldata.url)
+ unpackdir = subdir
+ else:
+ unpackdir = os.path.join(rootdir, subdir)
+ bb.utils.mkdirhier(unpackdir)
+ else:
+ unpackdir = rootdir
+
+ if not unpack or not cmd:
+ # If file == dest, then avoid any copies, as we already put the file into dest!
+ dest = os.path.join(unpackdir, os.path.basename(file))
+ if file != dest and not (os.path.exists(dest) and os.path.samefile(file, dest)):
+ destdir = '.'
+ # For file:// entries all intermediate dirs in path must be created at destination
+ if urldata.type == "file":
+ # Trailing '/' does a copying to wrong place
+ urlpath = urldata.path.rstrip('/')
+ # Want files places relative to cwd so no leading '/'
+ urlpath = urlpath.lstrip('/')
+ if urlpath.find("/") != -1:
+ destdir = urlpath.rsplit("/", 1)[0] + '/'
+ bb.utils.mkdirhier("%s/%s" % (unpackdir, destdir))
+ cmd = 'cp -fpPRH %s %s' % (file, destdir)
+
+ if not cmd:
+ return
+
+ path = data.getVar('PATH')
+ if path:
+ cmd = "PATH=\"%s\" %s" % (path, cmd)
+ bb.note("Unpacking %s to %s/" % (file, unpackdir))
+ ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True, cwd=unpackdir)
+
+ if ret != 0:
+ raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), urldata.url)
+
+ if iterate is True:
+ iterate_urldata = urldata
+ iterate_urldata.localpath = "%s/%s" % (rootdir, iterate_file)
+ self.unpack(urldata, rootdir, data)
+
+ return
+
+ def clean(self, urldata, d):
+ """
+ Clean any existing full or partial download
+ """
+ bb.utils.remove(urldata.localpath)
+
+ def try_premirror(self, urldata, d):
+ """
+ Should premirrors be used?
+ """
+ return True
+
+ def checkstatus(self, fetch, urldata, d):
+ """
+ Check the status of a URL
+ Assumes localpath was called first
+ """
+ logger.info("URL %s could not be checked for status since no method exists.", url)
+ return True
+
+ def latest_revision(self, ud, d, name):
+ """
+ Look in the cache for the latest revision, if not present ask the SCM.
+ """
+ if not hasattr(self, "_latest_revision"):
+ raise ParameterError("The fetcher for this URL does not support _latest_revision", url)
+
+ revs = bb.persist_data.persist('BB_URI_HEADREVS', d)
+ key = self.generate_revision_key(ud, d, name)
+ try:
+ return revs[key]
+ except KeyError:
+ revs[key] = rev = self._latest_revision(ud, d, name)
+ return rev
+
+ def sortable_revision(self, ud, d, name):
+ latest_rev = self._build_revision(ud, d, name)
+ return True, str(latest_rev)
+
+ def generate_revision_key(self, ud, d, name):
+ key = self._revision_key(ud, d, name)
+ return "%s-%s" % (key, d.getVar("PN") or "")
+
+ def latest_versionstring(self, ud, d):
+ """
+ Compute the latest release name like "x.y.x" in "x.y.x+gitHASH"
+ by searching through the tags output of ls-remote, comparing
+ versions and returning the highest match as a (version, revision) pair.
+ """
+ return ('', '')
+
+class Fetch(object):
+ def __init__(self, urls, d, cache = True, localonly = False, connection_cache = None):
+ if localonly and cache:
+ raise Exception("bb.fetch2.Fetch.__init__: cannot set cache and localonly at same time")
+
+ if len(urls) == 0:
+ urls = d.getVar("SRC_URI").split()
+ self.urls = urls
+ self.d = d
+ self.ud = {}
+ self.connection_cache = connection_cache
+
+ fn = d.getVar('FILE')
+ mc = d.getVar('__BBMULTICONFIG') or ""
+ if cache and fn and mc + fn in urldata_cache:
+ self.ud = urldata_cache[mc + fn]
+
+ for url in urls:
+ if url not in self.ud:
+ try:
+ self.ud[url] = FetchData(url, d, localonly)
+ except NonLocalMethod:
+ if localonly:
+ self.ud[url] = None
+ pass
+
+ if fn and cache:
+ urldata_cache[mc + fn] = self.ud
+
+ def localpath(self, url):
+ if url not in self.urls:
+ self.ud[url] = FetchData(url, self.d)
+
+ self.ud[url].setup_localpath(self.d)
+ return self.d.expand(self.ud[url].localpath)
+
+ def localpaths(self):
+ """
+ Return a list of the local filenames, assuming successful fetch
+ """
+ local = []
+
+ for u in self.urls:
+ ud = self.ud[u]
+ ud.setup_localpath(self.d)
+ local.append(ud.localpath)
+
+ return local
+
+ def download(self, urls=None):
+ """
+ Fetch all urls
+ """
+ if not urls:
+ urls = self.urls
+
+ network = self.d.getVar("BB_NO_NETWORK")
+ premirroronly = (self.d.getVar("BB_FETCH_PREMIRRORONLY") == "1")
+
+ for u in urls:
+ ud = self.ud[u]
+ ud.setup_localpath(self.d)
+ m = ud.method
+ localpath = ""
+
+ if ud.lockfile:
+ lf = bb.utils.lockfile(ud.lockfile)
+
+ try:
+ self.d.setVar("BB_NO_NETWORK", network)
+
+ if verify_donestamp(ud, self.d) and not m.need_update(ud, self.d):
+ localpath = ud.localpath
+ elif m.try_premirror(ud, self.d):
+ logger.debug(1, "Trying PREMIRRORS")
+ mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
+ localpath = try_mirrors(self, self.d, ud, mirrors, False)
+ if localpath:
+ try:
+ # early checksum verification so that if the checksum of the premirror
+ # contents mismatch the fetcher can still try upstream and mirrors
+ update_stamp(ud, self.d)
+ except ChecksumError as e:
+ logger.warning("Checksum failure encountered with premirror download of %s - will attempt other sources." % u)
+ logger.debug(1, str(e))
+ localpath = ""
+
+ if premirroronly:
+ self.d.setVar("BB_NO_NETWORK", "1")
+
+ firsterr = None
+ verified_stamp = verify_donestamp(ud, self.d)
+ if not localpath and (not verified_stamp or m.need_update(ud, self.d)):
+ try:
+ if not trusted_network(self.d, ud.url):
+ raise UntrustedUrl(ud.url)
+ logger.debug(1, "Trying Upstream")
+ m.download(ud, self.d)
+ if hasattr(m, "build_mirror_data"):
+ m.build_mirror_data(ud, self.d)
+ localpath = ud.localpath
+ # early checksum verify, so that if checksum mismatched,
+ # fetcher still have chance to fetch from mirror
+ update_stamp(ud, self.d)
+
+ except bb.fetch2.NetworkAccess:
+ raise
+
+ except BBFetchException as e:
+ if isinstance(e, ChecksumError):
+ logger.warning("Checksum failure encountered with download of %s - will attempt other sources if available" % u)
+ logger.debug(1, str(e))
+ if os.path.exists(ud.localpath):
+ rename_bad_checksum(ud, e.checksum)
+ elif isinstance(e, NoChecksumError):
+ raise
+ else:
+ logger.warning('Failed to fetch URL %s, attempting MIRRORS if available' % u)
+ logger.debug(1, str(e))
+ firsterr = e
+ # Remove any incomplete fetch
+ if not verified_stamp:
+ m.clean(ud, self.d)
+ logger.debug(1, "Trying MIRRORS")
+ mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
+ localpath = try_mirrors(self, self.d, ud, mirrors)
+
+ if not localpath or ((not os.path.exists(localpath)) and localpath.find("*") == -1):
+ if firsterr:
+ logger.error(str(firsterr))
+ raise FetchError("Unable to fetch URL from any source.", u)
+
+ update_stamp(ud, self.d)
+
+ except IOError as e:
+ if e.errno in [os.errno.ESTALE]:
+ logger.error("Stale Error Observed %s." % u)
+ raise ChecksumError("Stale Error Detected")
+
+ except BBFetchException as e:
+ if isinstance(e, ChecksumError):
+ logger.error("Checksum failure fetching %s" % u)
+ raise
+
+ finally:
+ if ud.lockfile:
+ bb.utils.unlockfile(lf)
+
+ def checkstatus(self, urls=None):
+ """
+ Check all urls exist upstream
+ """
+
+ if not urls:
+ urls = self.urls
+
+ for u in urls:
+ ud = self.ud[u]
+ ud.setup_localpath(self.d)
+ m = ud.method
+ logger.debug(1, "Testing URL %s", u)
+ # First try checking uri, u, from PREMIRRORS
+ mirrors = mirror_from_string(self.d.getVar('PREMIRRORS'))
+ ret = try_mirrors(self, self.d, ud, mirrors, True)
+ if not ret:
+ # Next try checking from the original uri, u
+ ret = m.checkstatus(self, ud, self.d)
+ if not ret:
+ # Finally, try checking uri, u, from MIRRORS
+ mirrors = mirror_from_string(self.d.getVar('MIRRORS'))
+ ret = try_mirrors(self, self.d, ud, mirrors, True)
+
+ if not ret:
+ raise FetchError("URL %s doesn't work" % u, u)
+
+ def unpack(self, root, urls=None):
+ """
+ Unpack urls to root
+ """
+
+ if not urls:
+ urls = self.urls
+
+ for u in urls:
+ ud = self.ud[u]
+ ud.setup_localpath(self.d)
+
+ if ud.lockfile:
+ lf = bb.utils.lockfile(ud.lockfile)
+
+ ud.method.unpack(ud, root, self.d)
+
+ if ud.lockfile:
+ bb.utils.unlockfile(lf)
+
+ def clean(self, urls=None):
+ """
+ Clean files that the fetcher gets or places
+ """
+
+ if not urls:
+ urls = self.urls
+
+ for url in urls:
+ if url not in self.ud:
+ self.ud[url] = FetchData(url, d)
+ ud = self.ud[url]
+ ud.setup_localpath(self.d)
+
+ if not ud.localfile and ud.localpath is None:
+ continue
+
+ if ud.lockfile:
+ lf = bb.utils.lockfile(ud.lockfile)
+
+ ud.method.clean(ud, self.d)
+ if ud.donestamp:
+ bb.utils.remove(ud.donestamp)
+
+ if ud.lockfile:
+ bb.utils.unlockfile(lf)
+
+class FetchConnectionCache(object):
+ """
+ A class which represents an container for socket connections.
+ """
+ def __init__(self):
+ self.cache = {}
+
+ def get_connection_name(self, host, port):
+ return host + ':' + str(port)
+
+ def add_connection(self, host, port, connection):
+ cn = self.get_connection_name(host, port)
+
+ if cn not in self.cache:
+ self.cache[cn] = connection
+
+ def get_connection(self, host, port):
+ connection = None
+
+ cn = self.get_connection_name(host, port)
+ if cn in self.cache:
+ connection = self.cache[cn]
+
+ return connection
+
+ def remove_connection(self, host, port):
+ cn = self.get_connection_name(host, port)
+ if cn in self.cache:
+ self.cache[cn].close()
+ del self.cache[cn]
+
+ def close_connections(self):
+ for cn in list(self.cache.keys()):
+ self.cache[cn].close()
+ del self.cache[cn]
+
+from . import cvs
+from . import git
+from . import gitsm
+from . import gitannex
+from . import local
+from . import svn
+from . import wget
+from . import ssh
+from . import sftp
+from . import s3
+from . import perforce
+from . import bzr
+from . import hg
+from . import osc
+from . import repo
+from . import clearcase
+from . import npm
+
+methods.append(local.Local())
+methods.append(wget.Wget())
+methods.append(svn.Svn())
+methods.append(git.Git())
+methods.append(gitsm.GitSM())
+methods.append(gitannex.GitANNEX())
+methods.append(cvs.Cvs())
+methods.append(ssh.SSH())
+methods.append(sftp.SFTP())
+methods.append(s3.S3())
+methods.append(perforce.Perforce())
+methods.append(bzr.Bzr())
+methods.append(hg.Hg())
+methods.append(osc.Osc())
+methods.append(repo.Repo())
+methods.append(clearcase.ClearCase())
+methods.append(npm.Npm())
diff --git a/poky/bitbake/lib/bb/fetch2/bzr.py b/poky/bitbake/lib/bb/fetch2/bzr.py
new file mode 100644
index 000000000..16123f8af
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/bzr.py
@@ -0,0 +1,139 @@
+"""
+BitBake 'Fetch' implementation for bzr.
+
+"""
+
+# Copyright (C) 2007 Ross Burton
+# Copyright (C) 2007 Richard Purdie
+#
+# Classes for obtaining upstream sources for the
+# BitBake build tools.
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import logging
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class Bzr(FetchMethod):
+ def supports(self, ud, d):
+ return ud.type in ['bzr']
+
+ def urldata_init(self, ud, d):
+ """
+ init bzr specific variable within url data
+ """
+ # Create paths to bzr checkouts
+ relpath = self._strip_leading_slashes(ud.path)
+ ud.pkgdir = os.path.join(d.expand('${BZRDIR}'), ud.host, relpath)
+
+ ud.setup_revisions(d)
+
+ if not ud.revision:
+ ud.revision = self.latest_revision(ud, d)
+
+ ud.localfile = d.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision))
+
+ def _buildbzrcommand(self, ud, d, command):
+ """
+ Build up an bzr commandline based on ud
+ command is "fetch", "update", "revno"
+ """
+
+ basecmd = d.expand('${FETCHCMD_bzr}')
+
+ proto = ud.parm.get('protocol', 'http')
+
+ bzrroot = ud.host + ud.path
+
+ options = []
+
+ if command == "revno":
+ bzrcmd = "%s revno %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
+ else:
+ if ud.revision:
+ options.append("-r %s" % ud.revision)
+
+ if command == "fetch":
+ bzrcmd = "%s branch %s %s://%s" % (basecmd, " ".join(options), proto, bzrroot)
+ elif command == "update":
+ bzrcmd = "%s pull %s --overwrite" % (basecmd, " ".join(options))
+ else:
+ raise FetchError("Invalid bzr command %s" % command, ud.url)
+
+ return bzrcmd
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ if os.access(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir), '.bzr'), os.R_OK):
+ bzrcmd = self._buildbzrcommand(ud, d, "update")
+ logger.debug(1, "BZR Update %s", ud.url)
+ bb.fetch2.check_network_access(d, bzrcmd, ud.url)
+ runfetchcmd(bzrcmd, d, workdir=os.path.join(ud.pkgdir, os.path.basename(ud.path)))
+ else:
+ bb.utils.remove(os.path.join(ud.pkgdir, os.path.basename(ud.pkgdir)), True)
+ bzrcmd = self._buildbzrcommand(ud, d, "fetch")
+ bb.fetch2.check_network_access(d, bzrcmd, ud.url)
+ logger.debug(1, "BZR Checkout %s", ud.url)
+ bb.utils.mkdirhier(ud.pkgdir)
+ logger.debug(1, "Running %s", bzrcmd)
+ runfetchcmd(bzrcmd, d, workdir=ud.pkgdir)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata == "keep":
+ tar_flags = ""
+ else:
+ tar_flags = "--exclude='.bzr' --exclude='.bzrtags'"
+
+ # tar them up to a defined filename
+ runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)),
+ d, cleanup=[ud.localpath], workdir=ud.pkgdir)
+
+ def supports_srcrev(self):
+ return True
+
+ def _revision_key(self, ud, d, name):
+ """
+ Return a unique key for the url
+ """
+ return "bzr:" + ud.pkgdir
+
+ def _latest_revision(self, ud, d, name):
+ """
+ Return the latest upstream revision number
+ """
+ logger.debug(2, "BZR fetcher hitting network for %s", ud.url)
+
+ bb.fetch2.check_network_access(d, self._buildbzrcommand(ud, d, "revno"), ud.url)
+
+ output = runfetchcmd(self._buildbzrcommand(ud, d, "revno"), d, True)
+
+ return output.strip()
+
+ def sortable_revision(self, ud, d, name):
+ """
+ Return a sortable revision number which in our case is the revision number
+ """
+
+ return False, self._build_revision(ud, d)
+
+ def _build_revision(self, ud, d):
+ return ud.revision
diff --git a/poky/bitbake/lib/bb/fetch2/clearcase.py b/poky/bitbake/lib/bb/fetch2/clearcase.py
new file mode 100644
index 000000000..36beab6a5
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/clearcase.py
@@ -0,0 +1,260 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' clearcase implementation
+
+The clearcase fetcher is used to retrieve files from a ClearCase repository.
+
+Usage in the recipe:
+
+ SRC_URI = "ccrc://cc.example.org/ccrc;vob=/example_vob;module=/example_module"
+ SRCREV = "EXAMPLE_CLEARCASE_TAG"
+ PV = "${@d.getVar("SRCREV", False).replace("/", "+")}"
+
+The fetcher uses the rcleartool or cleartool remote client, depending on which one is available.
+
+Supported SRC_URI options are:
+
+- vob
+ (required) The name of the clearcase VOB (with prepending "/")
+
+- module
+ The module in the selected VOB (with prepending "/")
+
+ The module and vob parameters are combined to create
+ the following load rule in the view config spec:
+ load <vob><module>
+
+- proto
+ http or https
+
+Related variables:
+
+ CCASE_CUSTOM_CONFIG_SPEC
+ Write a config spec to this variable in your recipe to use it instead
+ of the default config spec generated by this fetcher.
+ Please note that the SRCREV loses its functionality if you specify
+ this variable. SRCREV is still used to label the archive after a fetch,
+ but it doesn't define what's fetched.
+
+User credentials:
+ cleartool:
+ The login of cleartool is handled by the system. No special steps needed.
+
+ rcleartool:
+ In order to use rcleartool with authenticated users an `rcleartool login` is
+ necessary before using the fetcher.
+"""
+# Copyright (C) 2014 Siemens AG
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import os
+import sys
+import shutil
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+from distutils import spawn
+
+class ClearCase(FetchMethod):
+ """Class to fetch urls via 'clearcase'"""
+ def init(self, d):
+ pass
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with Clearcase.
+ """
+ return ud.type in ['ccrc']
+
+ def debug(self, msg):
+ logger.debug(1, "ClearCase: %s", msg)
+
+ def urldata_init(self, ud, d):
+ """
+ init ClearCase specific variable within url data
+ """
+ ud.proto = "https"
+ if 'protocol' in ud.parm:
+ ud.proto = ud.parm['protocol']
+ if not ud.proto in ('http', 'https'):
+ raise fetch2.ParameterError("Invalid protocol type", ud.url)
+
+ ud.vob = ''
+ if 'vob' in ud.parm:
+ ud.vob = ud.parm['vob']
+ else:
+ msg = ud.url+": vob must be defined so the fetcher knows what to get."
+ raise MissingParameterError('vob', msg)
+
+ if 'module' in ud.parm:
+ ud.module = ud.parm['module']
+ else:
+ ud.module = ""
+
+ ud.basecmd = d.getVar("FETCHCMD_ccrc") or spawn.find_executable("cleartool") or spawn.find_executable("rcleartool")
+
+ if d.getVar("SRCREV") == "INVALID":
+ raise FetchError("Set a valid SRCREV for the clearcase fetcher in your recipe, e.g. SRCREV = \"/main/LATEST\" or any other label of your choice.")
+
+ ud.label = d.getVar("SRCREV", False)
+ ud.customspec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC")
+
+ ud.server = "%s://%s%s" % (ud.proto, ud.host, ud.path)
+
+ ud.identifier = "clearcase-%s%s-%s" % ( ud.vob.replace("/", ""),
+ ud.module.replace("/", "."),
+ ud.label.replace("/", "."))
+
+ ud.viewname = "%s-view%s" % (ud.identifier, d.getVar("DATETIME", d, True))
+ ud.csname = "%s-config-spec" % (ud.identifier)
+ ud.ccasedir = os.path.join(d.getVar("DL_DIR"), ud.type)
+ ud.viewdir = os.path.join(ud.ccasedir, ud.viewname)
+ ud.configspecfile = os.path.join(ud.ccasedir, ud.csname)
+ ud.localfile = "%s.tar.gz" % (ud.identifier)
+
+ self.debug("host = %s" % ud.host)
+ self.debug("path = %s" % ud.path)
+ self.debug("server = %s" % ud.server)
+ self.debug("proto = %s" % ud.proto)
+ self.debug("type = %s" % ud.type)
+ self.debug("vob = %s" % ud.vob)
+ self.debug("module = %s" % ud.module)
+ self.debug("basecmd = %s" % ud.basecmd)
+ self.debug("label = %s" % ud.label)
+ self.debug("ccasedir = %s" % ud.ccasedir)
+ self.debug("viewdir = %s" % ud.viewdir)
+ self.debug("viewname = %s" % ud.viewname)
+ self.debug("configspecfile = %s" % ud.configspecfile)
+ self.debug("localfile = %s" % ud.localfile)
+
+ ud.localfile = os.path.join(d.getVar("DL_DIR"), ud.localfile)
+
+ def _build_ccase_command(self, ud, command):
+ """
+ Build up a commandline based on ud
+ command is: mkview, setcs, rmview
+ """
+ options = []
+
+ if "rcleartool" in ud.basecmd:
+ options.append("-server %s" % ud.server)
+
+ basecmd = "%s %s" % (ud.basecmd, command)
+
+ if command is 'mkview':
+ if not "rcleartool" in ud.basecmd:
+ # Cleartool needs a -snapshot view
+ options.append("-snapshot")
+ options.append("-tag %s" % ud.viewname)
+ options.append(ud.viewdir)
+
+ elif command is 'rmview':
+ options.append("-force")
+ options.append("%s" % ud.viewdir)
+
+ elif command is 'setcs':
+ options.append("-overwrite")
+ options.append(ud.configspecfile)
+
+ else:
+ raise FetchError("Invalid ccase command %s" % command)
+
+ ccasecmd = "%s %s" % (basecmd, " ".join(options))
+ self.debug("ccasecmd = %s" % ccasecmd)
+ return ccasecmd
+
+ def _write_configspec(self, ud, d):
+ """
+ Create config spec file (ud.configspecfile) for ccase view
+ """
+ config_spec = ""
+ custom_config_spec = d.getVar("CCASE_CUSTOM_CONFIG_SPEC", d)
+ if custom_config_spec is not None:
+ for line in custom_config_spec.split("\\n"):
+ config_spec += line+"\n"
+ bb.warn("A custom config spec has been set, SRCREV is only relevant for the tarball name.")
+ else:
+ config_spec += "element * CHECKEDOUT\n"
+ config_spec += "element * %s\n" % ud.label
+ config_spec += "load %s%s\n" % (ud.vob, ud.module)
+
+ logger.info("Using config spec: \n%s" % config_spec)
+
+ with open(ud.configspecfile, 'w') as f:
+ f.write(config_spec)
+
+ def _remove_view(self, ud, d):
+ if os.path.exists(ud.viewdir):
+ cmd = self._build_ccase_command(ud, 'rmview');
+ logger.info("cleaning up [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ output = runfetchcmd(cmd, d, workdir=ud.ccasedir)
+ logger.info("rmview output: %s", output)
+
+ def need_update(self, ud, d):
+ if ("LATEST" in ud.label) or (ud.customspec and "LATEST" in ud.customspec):
+ ud.identifier += "-%s" % d.getVar("DATETIME",d, True)
+ return True
+ if os.path.exists(ud.localpath):
+ return False
+ return True
+
+ def supports_srcrev(self):
+ return True
+
+ def sortable_revision(self, ud, d, name):
+ return False, ud.identifier
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ # Make a fresh view
+ bb.utils.mkdirhier(ud.ccasedir)
+ self._write_configspec(ud, d)
+ cmd = self._build_ccase_command(ud, 'mkview')
+ logger.info("creating view [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ try:
+ runfetchcmd(cmd, d)
+ except FetchError as e:
+ if "CRCLI2008E" in e.msg:
+ raise FetchError("%s\n%s\n" % (e.msg, "Call `rcleartool login` in your console to authenticate to the clearcase server before running bitbake."))
+ else:
+ raise e
+
+ # Set configspec: Setting the configspec effectively fetches the files as defined in the configspec
+ cmd = self._build_ccase_command(ud, 'setcs');
+ logger.info("fetching data [VOB=%s label=%s view=%s]", ud.vob, ud.label, ud.viewname)
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ output = runfetchcmd(cmd, d, workdir=ud.viewdir)
+ logger.info("%s", output)
+
+ # Copy the configspec to the viewdir so we have it in our source tarball later
+ shutil.copyfile(ud.configspecfile, os.path.join(ud.viewdir, ud.csname))
+
+ # Clean clearcase meta-data before tar
+
+ runfetchcmd('tar -czf "%s" .' % (ud.localpath), d, cleanup = [ud.localpath])
+
+ # Clean up so we can create a new view next time
+ self.clean(ud, d);
+
+ def clean(self, ud, d):
+ self._remove_view(ud, d)
+ bb.utils.remove(ud.configspecfile)
diff --git a/poky/bitbake/lib/bb/fetch2/cvs.py b/poky/bitbake/lib/bb/fetch2/cvs.py
new file mode 100644
index 000000000..490c95471
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/cvs.py
@@ -0,0 +1,172 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementations
+
+Classes for obtaining upstream sources for the
+BitBake build tools.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+#Based on functions from the base bb module, Copyright 2003 Holger Schurig
+#
+
+import os
+import logging
+import bb
+from bb.fetch2 import FetchMethod, FetchError, MissingParameterError, logger
+from bb.fetch2 import runfetchcmd
+
+class Cvs(FetchMethod):
+ """
+ Class to fetch a module or modules from cvs repositories
+ """
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with cvs.
+ """
+ return ud.type in ['cvs']
+
+ def urldata_init(self, ud, d):
+ if not "module" in ud.parm:
+ raise MissingParameterError("module", ud.url)
+ ud.module = ud.parm["module"]
+
+ ud.tag = ud.parm.get('tag', "")
+
+ # Override the default date in certain cases
+ if 'date' in ud.parm:
+ ud.date = ud.parm['date']
+ elif ud.tag:
+ ud.date = ""
+
+ norecurse = ''
+ if 'norecurse' in ud.parm:
+ norecurse = '_norecurse'
+
+ fullpath = ''
+ if 'fullpath' in ud.parm:
+ fullpath = '_fullpath'
+
+ ud.localfile = d.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath))
+
+ def need_update(self, ud, d):
+ if (ud.date == "now"):
+ return True
+ if not os.path.exists(ud.localpath):
+ return True
+ return False
+
+ def download(self, ud, d):
+
+ method = ud.parm.get('method', 'pserver')
+ localdir = ud.parm.get('localdir', ud.module)
+ cvs_port = ud.parm.get('port', '')
+
+ cvs_rsh = None
+ if method == "ext":
+ if "rsh" in ud.parm:
+ cvs_rsh = ud.parm["rsh"]
+
+ if method == "dir":
+ cvsroot = ud.path
+ else:
+ cvsroot = ":" + method
+ cvsproxyhost = d.getVar('CVS_PROXY_HOST')
+ if cvsproxyhost:
+ cvsroot += ";proxy=" + cvsproxyhost
+ cvsproxyport = d.getVar('CVS_PROXY_PORT')
+ if cvsproxyport:
+ cvsroot += ";proxyport=" + cvsproxyport
+ cvsroot += ":" + ud.user
+ if ud.pswd:
+ cvsroot += ":" + ud.pswd
+ cvsroot += "@" + ud.host + ":" + cvs_port + ud.path
+
+ options = []
+ if 'norecurse' in ud.parm:
+ options.append("-l")
+ if ud.date:
+ # treat YYYYMMDDHHMM specially for CVS
+ if len(ud.date) == 12:
+ options.append("-D \"%s %s:%s UTC\"" % (ud.date[0:8], ud.date[8:10], ud.date[10:12]))
+ else:
+ options.append("-D \"%s UTC\"" % ud.date)
+ if ud.tag:
+ options.append("-r %s" % ud.tag)
+
+ cvsbasecmd = d.getVar("FETCHCMD_cvs")
+ cvscmd = cvsbasecmd + " '-d" + cvsroot + "' co " + " ".join(options) + " " + ud.module
+ cvsupdatecmd = cvsbasecmd + " '-d" + cvsroot + "' update -d -P " + " ".join(options)
+
+ if cvs_rsh:
+ cvscmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvscmd)
+ cvsupdatecmd = "CVS_RSH=\"%s\" %s" % (cvs_rsh, cvsupdatecmd)
+
+ # create module directory
+ logger.debug(2, "Fetch: checking for module directory")
+ pkg = d.getVar('PN')
+ pkgdir = os.path.join(d.getVar('CVSDIR'), pkg)
+ moddir = os.path.join(pkgdir, localdir)
+ workdir = None
+ if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
+ logger.info("Update " + ud.url)
+ bb.fetch2.check_network_access(d, cvsupdatecmd, ud.url)
+ # update sources there
+ workdir = moddir
+ cmd = cvsupdatecmd
+ else:
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(pkgdir)
+ workdir = pkgdir
+ logger.debug(1, "Running %s", cvscmd)
+ bb.fetch2.check_network_access(d, cvscmd, ud.url)
+ cmd = cvscmd
+
+ runfetchcmd(cmd, d, cleanup=[moddir], workdir=workdir)
+
+ if not os.access(moddir, os.R_OK):
+ raise FetchError("Directory %s was not readable despite sucessful fetch?!" % moddir, ud.url)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata == "keep":
+ tar_flags = ""
+ else:
+ tar_flags = "--exclude='CVS'"
+
+ # tar them up to a defined filename
+ workdir = None
+ if 'fullpath' in ud.parm:
+ workdir = pkgdir
+ cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, localdir)
+ else:
+ workdir = os.path.dirname(os.path.realpath(moddir))
+ cmd = "tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(moddir))
+
+ runfetchcmd(cmd, d, cleanup=[ud.localpath], workdir=workdir)
+
+ def clean(self, ud, d):
+ """ Clean CVS Files and tarballs """
+
+ pkg = d.getVar('PN')
+ pkgdir = os.path.join(d.getVar("CVSDIR"), pkg)
+
+ bb.utils.remove(pkgdir, True)
+ bb.utils.remove(ud.localpath)
+
diff --git a/poky/bitbake/lib/bb/fetch2/git.py b/poky/bitbake/lib/bb/fetch2/git.py
new file mode 100644
index 000000000..3de83bed1
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/git.py
@@ -0,0 +1,664 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' git implementation
+
+git fetcher support the SRC_URI with format of:
+SRC_URI = "git://some.host/somepath;OptionA=xxx;OptionB=xxx;..."
+
+Supported SRC_URI options are:
+
+- branch
+ The git branch to retrieve from. The default is "master"
+
+ This option also supports multiple branch fetching, with branches
+ separated by commas. In multiple branches case, the name option
+ must have the same number of names to match the branches, which is
+ used to specify the SRC_REV for the branch
+ e.g:
+ SRC_URI="git://some.host/somepath;branch=branchX,branchY;name=nameX,nameY"
+ SRCREV_nameX = "xxxxxxxxxxxxxxxxxxxx"
+ SRCREV_nameY = "YYYYYYYYYYYYYYYYYYYY"
+
+- tag
+ The git tag to retrieve. The default is "master"
+
+- protocol
+ The method to use to access the repository. Common options are "git",
+ "http", "https", "file", "ssh" and "rsync". The default is "git".
+
+- rebaseable
+ rebaseable indicates that the upstream git repo may rebase in the future,
+ and current revision may disappear from upstream repo. This option will
+ remind fetcher to preserve local cache carefully for future use.
+ The default value is "0", set rebaseable=1 for rebaseable git repo.
+
+- nocheckout
+ Don't checkout source code when unpacking. set this option for the recipe
+ who has its own routine to checkout code.
+ The default is "0", set nocheckout=1 if needed.
+
+- bareclone
+ Create a bare clone of the source code and don't checkout the source code
+ when unpacking. Set this option for the recipe who has its own routine to
+ checkout code and tracking branch requirements.
+ The default is "0", set bareclone=1 if needed.
+
+- nobranch
+ Don't check the SHA validation for branch. set this option for the recipe
+ referring to commit which is valid in tag instead of branch.
+ The default is "0", set nobranch=1 if needed.
+
+- usehead
+ For local git:// urls to use the current branch HEAD as the revision for use with
+ AUTOREV. Implies nobranch.
+
+"""
+
+#Copyright (C) 2005 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import collections
+import errno
+import fnmatch
+import os
+import re
+import subprocess
+import tempfile
+import bb
+import bb.progress
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+
+class GitProgressHandler(bb.progress.LineFilterProgressHandler):
+ """Extract progress information from git output"""
+ def __init__(self, d):
+ self._buffer = ''
+ self._count = 0
+ super(GitProgressHandler, self).__init__(d)
+ # Send an initial progress event so the bar gets shown
+ self._fire_progress(-1)
+
+ def write(self, string):
+ self._buffer += string
+ stages = ['Counting objects', 'Compressing objects', 'Receiving objects', 'Resolving deltas']
+ stage_weights = [0.2, 0.05, 0.5, 0.25]
+ stagenum = 0
+ for i, stage in reversed(list(enumerate(stages))):
+ if stage in self._buffer:
+ stagenum = i
+ self._buffer = ''
+ break
+ self._status = stages[stagenum]
+ percs = re.findall(r'(\d+)%', string)
+ if percs:
+ progress = int(round((int(percs[-1]) * stage_weights[stagenum]) + (sum(stage_weights[:stagenum]) * 100)))
+ rates = re.findall(r'([\d.]+ [a-zA-Z]*/s+)', string)
+ if rates:
+ rate = rates[-1]
+ else:
+ rate = None
+ self.update(progress, rate)
+ else:
+ if stagenum == 0:
+ percs = re.findall(r': (\d+)', string)
+ if percs:
+ count = int(percs[-1])
+ if count > self._count:
+ self._count = count
+ self._fire_progress(-count)
+ super(GitProgressHandler, self).write(string)
+
+
+class Git(FetchMethod):
+ bitbake_dir = os.path.abspath(os.path.join(os.path.dirname(os.path.join(os.path.abspath(__file__))), '..', '..', '..'))
+ make_shallow_path = os.path.join(bitbake_dir, 'bin', 'git-make-shallow')
+
+ """Class to fetch a module or modules from git repositories"""
+ def init(self, d):
+ pass
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with git.
+ """
+ return ud.type in ['git']
+
+ def supports_checksum(self, urldata):
+ return False
+
+ def urldata_init(self, ud, d):
+ """
+ init git specific variable within url data
+ so that the git method like latest_revision() can work
+ """
+ if 'protocol' in ud.parm:
+ ud.proto = ud.parm['protocol']
+ elif not ud.host:
+ ud.proto = 'file'
+ else:
+ ud.proto = "git"
+
+ if not ud.proto in ('git', 'file', 'ssh', 'http', 'https', 'rsync'):
+ raise bb.fetch2.ParameterError("Invalid protocol type", ud.url)
+
+ ud.nocheckout = ud.parm.get("nocheckout","0") == "1"
+
+ ud.rebaseable = ud.parm.get("rebaseable","0") == "1"
+
+ ud.nobranch = ud.parm.get("nobranch","0") == "1"
+
+ # usehead implies nobranch
+ ud.usehead = ud.parm.get("usehead","0") == "1"
+ if ud.usehead:
+ if ud.proto != "file":
+ raise bb.fetch2.ParameterError("The usehead option is only for use with local ('protocol=file') git repositories", ud.url)
+ ud.nobranch = 1
+
+ # bareclone implies nocheckout
+ ud.bareclone = ud.parm.get("bareclone","0") == "1"
+ if ud.bareclone:
+ ud.nocheckout = 1
+
+ ud.unresolvedrev = {}
+ branches = ud.parm.get("branch", "master").split(',')
+ if len(branches) != len(ud.names):
+ raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
+
+ ud.cloneflags = "-s -n"
+ if ud.bareclone:
+ ud.cloneflags += " --mirror"
+
+ ud.shallow = d.getVar("BB_GIT_SHALLOW") == "1"
+ ud.shallow_extra_refs = (d.getVar("BB_GIT_SHALLOW_EXTRA_REFS") or "").split()
+
+ depth_default = d.getVar("BB_GIT_SHALLOW_DEPTH")
+ if depth_default is not None:
+ try:
+ depth_default = int(depth_default or 0)
+ except ValueError:
+ raise bb.fetch2.FetchError("Invalid depth for BB_GIT_SHALLOW_DEPTH: %s" % depth_default)
+ else:
+ if depth_default < 0:
+ raise bb.fetch2.FetchError("Invalid depth for BB_GIT_SHALLOW_DEPTH: %s" % depth_default)
+ else:
+ depth_default = 1
+ ud.shallow_depths = collections.defaultdict(lambda: depth_default)
+
+ revs_default = d.getVar("BB_GIT_SHALLOW_REVS", True)
+ ud.shallow_revs = []
+ ud.branches = {}
+ for pos, name in enumerate(ud.names):
+ branch = branches[pos]
+ ud.branches[name] = branch
+ ud.unresolvedrev[name] = branch
+
+ shallow_depth = d.getVar("BB_GIT_SHALLOW_DEPTH_%s" % name)
+ if shallow_depth is not None:
+ try:
+ shallow_depth = int(shallow_depth or 0)
+ except ValueError:
+ raise bb.fetch2.FetchError("Invalid depth for BB_GIT_SHALLOW_DEPTH_%s: %s" % (name, shallow_depth))
+ else:
+ if shallow_depth < 0:
+ raise bb.fetch2.FetchError("Invalid depth for BB_GIT_SHALLOW_DEPTH_%s: %s" % (name, shallow_depth))
+ ud.shallow_depths[name] = shallow_depth
+
+ revs = d.getVar("BB_GIT_SHALLOW_REVS_%s" % name)
+ if revs is not None:
+ ud.shallow_revs.extend(revs.split())
+ elif revs_default is not None:
+ ud.shallow_revs.extend(revs_default.split())
+
+ if (ud.shallow and
+ not ud.shallow_revs and
+ all(ud.shallow_depths[n] == 0 for n in ud.names)):
+ # Shallow disabled for this URL
+ ud.shallow = False
+
+ if ud.usehead:
+ ud.unresolvedrev['default'] = 'HEAD'
+
+ ud.basecmd = d.getVar("FETCHCMD_git") or "git -c core.fsyncobjectfiles=0"
+
+ write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0"
+ ud.write_tarballs = write_tarballs != "0" or ud.rebaseable
+ ud.write_shallow_tarballs = (d.getVar("BB_GENERATE_SHALLOW_TARBALLS") or write_tarballs) != "0"
+
+ ud.setup_revisions(d)
+
+ for name in ud.names:
+ # Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
+ if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
+ if ud.revisions[name]:
+ ud.unresolvedrev[name] = ud.revisions[name]
+ ud.revisions[name] = self.latest_revision(ud, d, name)
+
+ gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.'))
+ if gitsrcname.startswith('.'):
+ gitsrcname = gitsrcname[1:]
+
+ # for rebaseable git repo, it is necessary to keep mirror tar ball
+ # per revision, so that even the revision disappears from the
+ # upstream repo in the future, the mirror will remain intact and still
+ # contains the revision
+ if ud.rebaseable:
+ for name in ud.names:
+ gitsrcname = gitsrcname + '_' + ud.revisions[name]
+
+ dl_dir = d.getVar("DL_DIR")
+ gitdir = d.getVar("GITDIR") or (dl_dir + "/git2/")
+ ud.clonedir = os.path.join(gitdir, gitsrcname)
+ ud.localfile = ud.clonedir
+
+ mirrortarball = 'git2_%s.tar.gz' % gitsrcname
+ ud.fullmirror = os.path.join(dl_dir, mirrortarball)
+ ud.mirrortarballs = [mirrortarball]
+ if ud.shallow:
+ tarballname = gitsrcname
+ if ud.bareclone:
+ tarballname = "%s_bare" % tarballname
+
+ if ud.shallow_revs:
+ tarballname = "%s_%s" % (tarballname, "_".join(sorted(ud.shallow_revs)))
+
+ for name, revision in sorted(ud.revisions.items()):
+ tarballname = "%s_%s" % (tarballname, ud.revisions[name][:7])
+ depth = ud.shallow_depths[name]
+ if depth:
+ tarballname = "%s-%s" % (tarballname, depth)
+
+ shallow_refs = []
+ if not ud.nobranch:
+ shallow_refs.extend(ud.branches.values())
+ if ud.shallow_extra_refs:
+ shallow_refs.extend(r.replace('refs/heads/', '').replace('*', 'ALL') for r in ud.shallow_extra_refs)
+ if shallow_refs:
+ tarballname = "%s_%s" % (tarballname, "_".join(sorted(shallow_refs)).replace('/', '.'))
+
+ fetcher = self.__class__.__name__.lower()
+ ud.shallowtarball = '%sshallow_%s.tar.gz' % (fetcher, tarballname)
+ ud.fullshallow = os.path.join(dl_dir, ud.shallowtarball)
+ ud.mirrortarballs.insert(0, ud.shallowtarball)
+
+ def localpath(self, ud, d):
+ return ud.clonedir
+
+ def need_update(self, ud, d):
+ if not os.path.exists(ud.clonedir):
+ return True
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name, ud.clonedir):
+ return True
+ if ud.shallow and ud.write_shallow_tarballs and not os.path.exists(ud.fullshallow):
+ return True
+ if ud.write_tarballs and not os.path.exists(ud.fullmirror):
+ return True
+ return False
+
+ def try_premirror(self, ud, d):
+ # If we don't do this, updating an existing checkout with only premirrors
+ # is not possible
+ if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
+ return True
+ if os.path.exists(ud.clonedir):
+ return False
+ return True
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ no_clone = not os.path.exists(ud.clonedir)
+ need_update = no_clone or self.need_update(ud, d)
+
+ # A current clone is preferred to either tarball, a shallow tarball is
+ # preferred to an out of date clone, and a missing clone will use
+ # either tarball.
+ if ud.shallow and os.path.exists(ud.fullshallow) and need_update:
+ ud.localpath = ud.fullshallow
+ return
+ elif os.path.exists(ud.fullmirror) and no_clone:
+ bb.utils.mkdirhier(ud.clonedir)
+ runfetchcmd("tar -xzf %s" % ud.fullmirror, d, workdir=ud.clonedir)
+
+ repourl = self._get_repo_url(ud)
+
+ # If the repo still doesn't exist, fallback to cloning it
+ if not os.path.exists(ud.clonedir):
+ # We do this since git will use a "-l" option automatically for local urls where possible
+ if repourl.startswith("file://"):
+ repourl = repourl[7:]
+ clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, repourl, ud.clonedir)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, clone_cmd, ud.url)
+ progresshandler = GitProgressHandler(d)
+ runfetchcmd(clone_cmd, d, log=progresshandler)
+
+ # Update the checkout if needed
+ needupdate = False
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name, ud.clonedir):
+ needupdate = True
+ if needupdate:
+ try:
+ runfetchcmd("%s remote rm origin" % ud.basecmd, d, workdir=ud.clonedir)
+ except bb.fetch2.FetchError:
+ logger.debug(1, "No Origin")
+
+ runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d, workdir=ud.clonedir)
+ fetch_cmd = "LANG=C %s fetch -f --prune --progress %s refs/*:refs/*" % (ud.basecmd, repourl)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
+ progresshandler = GitProgressHandler(d)
+ runfetchcmd(fetch_cmd, d, log=progresshandler, workdir=ud.clonedir)
+ runfetchcmd("%s prune-packed" % ud.basecmd, d, workdir=ud.clonedir)
+ runfetchcmd("%s pack-refs --all" % ud.basecmd, d, workdir=ud.clonedir)
+ runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d, workdir=ud.clonedir)
+ try:
+ os.unlink(ud.fullmirror)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+ for name in ud.names:
+ if not self._contains_ref(ud, d, name, ud.clonedir):
+ raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name]))
+
+ def build_mirror_data(self, ud, d):
+ if ud.shallow and ud.write_shallow_tarballs:
+ if not os.path.exists(ud.fullshallow):
+ if os.path.islink(ud.fullshallow):
+ os.unlink(ud.fullshallow)
+ tempdir = tempfile.mkdtemp(dir=d.getVar('DL_DIR'))
+ shallowclone = os.path.join(tempdir, 'git')
+ try:
+ self.clone_shallow_local(ud, shallowclone, d)
+
+ logger.info("Creating tarball of git repository")
+ runfetchcmd("tar -czf %s ." % ud.fullshallow, d, workdir=shallowclone)
+ runfetchcmd("touch %s.done" % ud.fullshallow, d)
+ finally:
+ bb.utils.remove(tempdir, recurse=True)
+ elif ud.write_tarballs and not os.path.exists(ud.fullmirror):
+ if os.path.islink(ud.fullmirror):
+ os.unlink(ud.fullmirror)
+
+ logger.info("Creating tarball of git repository")
+ runfetchcmd("tar -czf %s ." % ud.fullmirror, d, workdir=ud.clonedir)
+ runfetchcmd("touch %s.done" % ud.fullmirror, d)
+
+ def clone_shallow_local(self, ud, dest, d):
+ """Clone the repo and make it shallow.
+
+ The upstream url of the new clone isn't set at this time, as it'll be
+ set correctly when unpacked."""
+ runfetchcmd("%s clone %s %s %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, dest), d)
+
+ to_parse, shallow_branches = [], []
+ for name in ud.names:
+ revision = ud.revisions[name]
+ depth = ud.shallow_depths[name]
+ if depth:
+ to_parse.append('%s~%d^{}' % (revision, depth - 1))
+
+ # For nobranch, we need a ref, otherwise the commits will be
+ # removed, and for non-nobranch, we truncate the branch to our
+ # srcrev, to avoid keeping unnecessary history beyond that.
+ branch = ud.branches[name]
+ if ud.nobranch:
+ ref = "refs/shallow/%s" % name
+ elif ud.bareclone:
+ ref = "refs/heads/%s" % branch
+ else:
+ ref = "refs/remotes/origin/%s" % branch
+
+ shallow_branches.append(ref)
+ runfetchcmd("%s update-ref %s %s" % (ud.basecmd, ref, revision), d, workdir=dest)
+
+ # Map srcrev+depths to revisions
+ parsed_depths = runfetchcmd("%s rev-parse %s" % (ud.basecmd, " ".join(to_parse)), d, workdir=dest)
+
+ # Resolve specified revisions
+ parsed_revs = runfetchcmd("%s rev-parse %s" % (ud.basecmd, " ".join('"%s^{}"' % r for r in ud.shallow_revs)), d, workdir=dest)
+ shallow_revisions = parsed_depths.splitlines() + parsed_revs.splitlines()
+
+ # Apply extra ref wildcards
+ all_refs = runfetchcmd('%s for-each-ref "--format=%%(refname)"' % ud.basecmd,
+ d, workdir=dest).splitlines()
+ for r in ud.shallow_extra_refs:
+ if not ud.bareclone:
+ r = r.replace('refs/heads/', 'refs/remotes/origin/')
+
+ if '*' in r:
+ matches = filter(lambda a: fnmatch.fnmatchcase(a, r), all_refs)
+ shallow_branches.extend(matches)
+ else:
+ shallow_branches.append(r)
+
+ # Make the repository shallow
+ shallow_cmd = [self.make_shallow_path, '-s']
+ for b in shallow_branches:
+ shallow_cmd.append('-r')
+ shallow_cmd.append(b)
+ shallow_cmd.extend(shallow_revisions)
+ runfetchcmd(subprocess.list2cmdline(shallow_cmd), d, workdir=dest)
+
+ def unpack(self, ud, destdir, d):
+ """ unpack the downloaded src to destdir"""
+
+ subdir = ud.parm.get("subpath", "")
+ if subdir != "":
+ readpathspec = ":%s" % subdir
+ def_destsuffix = "%s/" % os.path.basename(subdir.rstrip('/'))
+ else:
+ readpathspec = ""
+ def_destsuffix = "git/"
+
+ destsuffix = ud.parm.get("destsuffix", def_destsuffix)
+ destdir = ud.destdir = os.path.join(destdir, destsuffix)
+ if os.path.exists(destdir):
+ bb.utils.prunedir(destdir)
+
+ if ud.shallow and (not os.path.exists(ud.clonedir) or self.need_update(ud, d)):
+ bb.utils.mkdirhier(destdir)
+ runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=destdir)
+ else:
+ runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)
+
+ repourl = self._get_repo_url(ud)
+ runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, repourl), d, workdir=destdir)
+ if not ud.nocheckout:
+ if subdir != "":
+ runfetchcmd("%s read-tree %s%s" % (ud.basecmd, ud.revisions[ud.names[0]], readpathspec), d,
+ workdir=destdir)
+ runfetchcmd("%s checkout-index -q -f -a" % ud.basecmd, d, workdir=destdir)
+ elif not ud.nobranch:
+ branchname = ud.branches[ud.names[0]]
+ runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, branchname, \
+ ud.revisions[ud.names[0]]), d, workdir=destdir)
+ runfetchcmd("%s branch %s --set-upstream-to origin/%s" % (ud.basecmd, branchname, \
+ branchname), d, workdir=destdir)
+ else:
+ runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=destdir)
+
+ return True
+
+ def clean(self, ud, d):
+ """ clean the git directory """
+
+ bb.utils.remove(ud.localpath, True)
+ bb.utils.remove(ud.fullmirror)
+ bb.utils.remove(ud.fullmirror + ".done")
+
+ def supports_srcrev(self):
+ return True
+
+ def _contains_ref(self, ud, d, name, wd):
+ cmd = ""
+ if ud.nobranch:
+ cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (
+ ud.basecmd, ud.revisions[name])
+ else:
+ cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (
+ ud.basecmd, ud.revisions[name], ud.branches[name])
+ try:
+ output = runfetchcmd(cmd, d, quiet=True, workdir=wd)
+ except bb.fetch2.FetchError:
+ return False
+ if len(output.split()) > 1:
+ raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output))
+ return output.split()[0] != "0"
+
+ def _get_repo_url(self, ud):
+ """
+ Return the repository URL
+ """
+ if ud.user:
+ username = ud.user + '@'
+ else:
+ username = ""
+ return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
+
+ def _revision_key(self, ud, d, name):
+ """
+ Return a unique key for the url
+ """
+ return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
+
+ def _lsremote(self, ud, d, search):
+ """
+ Run git ls-remote with the specified search string
+ """
+ # Prevent recursion e.g. in OE if SRCPV is in PV, PV is in WORKDIR,
+ # and WORKDIR is in PATH (as a result of RSS), our call to
+ # runfetchcmd() exports PATH so this function will get called again (!)
+ # In this scenario the return call of the function isn't actually
+ # important - WORKDIR isn't needed in PATH to call git ls-remote
+ # anyway.
+ if d.getVar('_BB_GIT_IN_LSREMOTE', False):
+ return ''
+ d.setVar('_BB_GIT_IN_LSREMOTE', '1')
+ try:
+ repourl = self._get_repo_url(ud)
+ cmd = "%s ls-remote %s %s" % \
+ (ud.basecmd, repourl, search)
+ if ud.proto.lower() != 'file':
+ bb.fetch2.check_network_access(d, cmd, repourl)
+ output = runfetchcmd(cmd, d, True)
+ if not output:
+ raise bb.fetch2.FetchError("The command %s gave empty output unexpectedly" % cmd, ud.url)
+ finally:
+ d.delVar('_BB_GIT_IN_LSREMOTE')
+ return output
+
+ def _latest_revision(self, ud, d, name):
+ """
+ Compute the HEAD revision for the url
+ """
+ output = self._lsremote(ud, d, "")
+ # Tags of the form ^{} may not work, need to fallback to other form
+ if ud.unresolvedrev[name][:5] == "refs/" or ud.usehead:
+ head = ud.unresolvedrev[name]
+ tag = ud.unresolvedrev[name]
+ else:
+ head = "refs/heads/%s" % ud.unresolvedrev[name]
+ tag = "refs/tags/%s" % ud.unresolvedrev[name]
+ for s in [head, tag + "^{}", tag]:
+ for l in output.strip().split('\n'):
+ sha1, ref = l.split()
+ if s == ref:
+ return sha1
+ raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \
+ (ud.unresolvedrev[name], ud.host+ud.path))
+
+ def latest_versionstring(self, ud, d):
+ """
+ Compute the latest release name like "x.y.x" in "x.y.x+gitHASH"
+ by searching through the tags output of ls-remote, comparing
+ versions and returning the highest match.
+ """
+ pupver = ('', '')
+
+ tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or "(?P<pver>([0-9][\.|_]?)+)")
+ try:
+ output = self._lsremote(ud, d, "refs/tags/*")
+ except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e:
+ bb.note("Could not list remote: %s" % str(e))
+ return pupver
+
+ verstring = ""
+ revision = ""
+ for line in output.split("\n"):
+ if not line:
+ break
+
+ tag_head = line.split("/")[-1]
+ # Ignore non-released branches
+ m = re.search("(alpha|beta|rc|final)+", tag_head)
+ if m:
+ continue
+
+ # search for version in the line
+ tag = tagregex.search(tag_head)
+ if tag == None:
+ continue
+
+ tag = tag.group('pver')
+ tag = tag.replace("_", ".")
+
+ if verstring and bb.utils.vercmp(("0", tag, ""), ("0", verstring, "")) < 0:
+ continue
+
+ verstring = tag
+ revision = line.split()[0]
+ pupver = (verstring, revision)
+
+ return pupver
+
+ def _build_revision(self, ud, d, name):
+ return ud.revisions[name]
+
+ def gitpkgv_revision(self, ud, d, name):
+ """
+ Return a sortable revision number by counting commits in the history
+ Based on gitpkgv.bblass in meta-openembedded
+ """
+ rev = self._build_revision(ud, d, name)
+ localpath = ud.localpath
+ rev_file = os.path.join(localpath, "oe-gitpkgv_" + rev)
+ if not os.path.exists(localpath):
+ commits = None
+ else:
+ if not os.path.exists(rev_file) or not os.path.getsize(rev_file):
+ from pipes import quote
+ commits = bb.fetch2.runfetchcmd(
+ "git rev-list %s -- | wc -l" % quote(rev),
+ d, quiet=True).strip().lstrip('0')
+ if commits:
+ open(rev_file, "w").write("%d\n" % int(commits))
+ else:
+ commits = open(rev_file, "r").readline(128).strip()
+ if commits:
+ return False, "%s+%s" % (commits, rev[:7])
+ else:
+ return True, str(rev)
+
+ def checkstatus(self, fetch, ud, d):
+ try:
+ self._lsremote(ud, d, "")
+ return True
+ except bb.fetch2.FetchError:
+ return False
diff --git a/poky/bitbake/lib/bb/fetch2/gitannex.py b/poky/bitbake/lib/bb/fetch2/gitannex.py
new file mode 100644
index 000000000..a9b69caab
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/gitannex.py
@@ -0,0 +1,91 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' git annex implementation
+"""
+
+# Copyright (C) 2014 Otavio Salvador
+# Copyright (C) 2014 O.S. Systems Software LTDA.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import bb
+from bb.fetch2.git import Git
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class GitANNEX(Git):
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with git.
+ """
+ return ud.type in ['gitannex']
+
+ def urldata_init(self, ud, d):
+ super(GitANNEX, self).urldata_init(ud, d)
+ if ud.shallow:
+ ud.shallow_extra_refs += ['refs/heads/git-annex', 'refs/heads/synced/*']
+
+ def uses_annex(self, ud, d, wd):
+ for name in ud.names:
+ try:
+ runfetchcmd("%s rev-list git-annex" % (ud.basecmd), d, quiet=True, workdir=wd)
+ return True
+ except bb.fetch.FetchError:
+ pass
+
+ return False
+
+ def update_annex(self, ud, d, wd):
+ try:
+ runfetchcmd("%s annex get --all" % (ud.basecmd), d, quiet=True, workdir=wd)
+ except bb.fetch.FetchError:
+ return False
+ runfetchcmd("chmod u+w -R %s/annex" % (ud.clonedir), d, quiet=True, workdir=wd)
+
+ return True
+
+ def download(self, ud, d):
+ Git.download(self, ud, d)
+
+ if not ud.shallow or ud.localpath != ud.fullshallow:
+ if self.uses_annex(ud, d, ud.clonedir):
+ self.update_annex(ud, d, ud.clonedir)
+
+ def clone_shallow_local(self, ud, dest, d):
+ super(GitANNEX, self).clone_shallow_local(ud, dest, d)
+
+ try:
+ runfetchcmd("%s annex init" % ud.basecmd, d, workdir=dest)
+ except bb.fetch.FetchError:
+ pass
+
+ if self.uses_annex(ud, d, dest):
+ runfetchcmd("%s annex get" % ud.basecmd, d, workdir=dest)
+ runfetchcmd("chmod u+w -R %s/.git/annex" % (dest), d, quiet=True, workdir=dest)
+
+ def unpack(self, ud, destdir, d):
+ Git.unpack(self, ud, destdir, d)
+
+ try:
+ runfetchcmd("%s annex init" % (ud.basecmd), d, workdir=ud.destdir)
+ except bb.fetch.FetchError:
+ pass
+
+ annex = self.uses_annex(ud, d, ud.destdir)
+ if annex:
+ runfetchcmd("%s annex get" % (ud.basecmd), d, workdir=ud.destdir)
+ runfetchcmd("chmod u+w -R %s/.git/annex" % (ud.destdir), d, quiet=True, workdir=ud.destdir)
+
diff --git a/poky/bitbake/lib/bb/fetch2/gitsm.py b/poky/bitbake/lib/bb/fetch2/gitsm.py
new file mode 100644
index 000000000..0aff1008e
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/gitsm.py
@@ -0,0 +1,135 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' git submodules implementation
+
+Inherits from and extends the Git fetcher to retrieve submodules of a git repository
+after cloning.
+
+SRC_URI = "gitsm://<see Git fetcher for syntax>"
+
+See the Git fetcher, git://, for usage documentation.
+
+NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your recipe.
+
+"""
+
+# Copyright (C) 2013 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import bb
+from bb.fetch2.git import Git
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class GitSM(Git):
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with git.
+ """
+ return ud.type in ['gitsm']
+
+ def uses_submodules(self, ud, d, wd):
+ for name in ud.names:
+ try:
+ runfetchcmd("%s show %s:.gitmodules" % (ud.basecmd, ud.revisions[name]), d, quiet=True, workdir=wd)
+ return True
+ except bb.fetch.FetchError:
+ pass
+ return False
+
+ def _set_relative_paths(self, repopath):
+ """
+ Fix submodule paths to be relative instead of absolute,
+ so that when we move the repo it doesn't break
+ (In Git 1.7.10+ this is done automatically)
+ """
+ submodules = []
+ with open(os.path.join(repopath, '.gitmodules'), 'r') as f:
+ for line in f.readlines():
+ if line.startswith('[submodule'):
+ submodules.append(line.split('"')[1])
+
+ for module in submodules:
+ repo_conf = os.path.join(repopath, module, '.git')
+ if os.path.exists(repo_conf):
+ with open(repo_conf, 'r') as f:
+ lines = f.readlines()
+ newpath = ''
+ for i, line in enumerate(lines):
+ if line.startswith('gitdir:'):
+ oldpath = line.split(': ')[-1].rstrip()
+ if oldpath.startswith('/'):
+ newpath = '../' * (module.count('/') + 1) + '.git/modules/' + module
+ lines[i] = 'gitdir: %s\n' % newpath
+ break
+ if newpath:
+ with open(repo_conf, 'w') as f:
+ for line in lines:
+ f.write(line)
+
+ repo_conf2 = os.path.join(repopath, '.git', 'modules', module, 'config')
+ if os.path.exists(repo_conf2):
+ with open(repo_conf2, 'r') as f:
+ lines = f.readlines()
+ newpath = ''
+ for i, line in enumerate(lines):
+ if line.lstrip().startswith('worktree = '):
+ oldpath = line.split(' = ')[-1].rstrip()
+ if oldpath.startswith('/'):
+ newpath = '../' * (module.count('/') + 3) + module
+ lines[i] = '\tworktree = %s\n' % newpath
+ break
+ if newpath:
+ with open(repo_conf2, 'w') as f:
+ for line in lines:
+ f.write(line)
+
+ def update_submodules(self, ud, d):
+ # We have to convert bare -> full repo, do the submodule bit, then convert back
+ tmpclonedir = ud.clonedir + ".tmp"
+ gitdir = tmpclonedir + os.sep + ".git"
+ bb.utils.remove(tmpclonedir, True)
+ os.mkdir(tmpclonedir)
+ os.rename(ud.clonedir, gitdir)
+ runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*true/bare = false/'", d)
+ runfetchcmd(ud.basecmd + " reset --hard", d, workdir=tmpclonedir)
+ runfetchcmd(ud.basecmd + " checkout -f " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir)
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=tmpclonedir)
+ self._set_relative_paths(tmpclonedir)
+ runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d, workdir=tmpclonedir)
+ os.rename(gitdir, ud.clonedir,)
+ bb.utils.remove(tmpclonedir, True)
+
+ def download(self, ud, d):
+ Git.download(self, ud, d)
+
+ if not ud.shallow or ud.localpath != ud.fullshallow:
+ submodules = self.uses_submodules(ud, d, ud.clonedir)
+ if submodules:
+ self.update_submodules(ud, d)
+
+ def clone_shallow_local(self, ud, dest, d):
+ super(GitSM, self).clone_shallow_local(ud, dest, d)
+
+ runfetchcmd('cp -fpPRH "%s/modules" "%s/"' % (ud.clonedir, os.path.join(dest, '.git')), d)
+
+ def unpack(self, ud, destdir, d):
+ Git.unpack(self, ud, destdir, d)
+
+ if self.uses_submodules(ud, d, ud.destdir):
+ runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)
diff --git a/poky/bitbake/lib/bb/fetch2/hg.py b/poky/bitbake/lib/bb/fetch2/hg.py
new file mode 100644
index 000000000..d0857e63f
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/hg.py
@@ -0,0 +1,270 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementation for mercurial DRCS (hg).
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2004 Marcin Juszkiewicz
+# Copyright (C) 2007 Robert Schuster
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import sys
+import logging
+import bb
+import errno
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import MissingParameterError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class Hg(FetchMethod):
+ """Class to fetch from mercurial repositories"""
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with mercurial.
+ """
+ return ud.type in ['hg']
+
+ def supports_checksum(self, urldata):
+ """
+ Don't require checksums for local archives created from
+ repository checkouts.
+ """
+ return False
+
+ def urldata_init(self, ud, d):
+ """
+ init hg specific variable within url data
+ """
+ if not "module" in ud.parm:
+ raise MissingParameterError('module', ud.url)
+
+ ud.module = ud.parm["module"]
+
+ if 'protocol' in ud.parm:
+ ud.proto = ud.parm['protocol']
+ elif not ud.host:
+ ud.proto = 'file'
+ else:
+ ud.proto = "hg"
+
+ ud.setup_revisions(d)
+
+ if 'rev' in ud.parm:
+ ud.revision = ud.parm['rev']
+ elif not ud.revision:
+ ud.revision = self.latest_revision(ud, d)
+
+ # Create paths to mercurial checkouts
+ hgsrcname = '%s_%s_%s' % (ud.module.replace('/', '.'), \
+ ud.host, ud.path.replace('/', '.'))
+ mirrortarball = 'hg_%s.tar.gz' % hgsrcname
+ ud.fullmirror = os.path.join(d.getVar("DL_DIR"), mirrortarball)
+ ud.mirrortarballs = [mirrortarball]
+
+ hgdir = d.getVar("HGDIR") or (d.getVar("DL_DIR") + "/hg/")
+ ud.pkgdir = os.path.join(hgdir, hgsrcname)
+ ud.moddir = os.path.join(ud.pkgdir, ud.module)
+ ud.localfile = ud.moddir
+ ud.basecmd = d.getVar("FETCHCMD_hg") or "/usr/bin/env hg"
+
+ ud.write_tarballs = d.getVar("BB_GENERATE_MIRROR_TARBALLS")
+
+ def need_update(self, ud, d):
+ revTag = ud.parm.get('rev', 'tip')
+ if revTag == "tip":
+ return True
+ if not os.path.exists(ud.localpath):
+ return True
+ return False
+
+ def try_premirror(self, ud, d):
+ # If we don't do this, updating an existing checkout with only premirrors
+ # is not possible
+ if d.getVar("BB_FETCH_PREMIRRORONLY") is not None:
+ return True
+ if os.path.exists(ud.moddir):
+ return False
+ return True
+
+ def _buildhgcommand(self, ud, d, command):
+ """
+ Build up an hg commandline based on ud
+ command is "fetch", "update", "info"
+ """
+
+ proto = ud.parm.get('protocol', 'http')
+
+ host = ud.host
+ if proto == "file":
+ host = "/"
+ ud.host = "localhost"
+
+ if not ud.user:
+ hgroot = host + ud.path
+ else:
+ if ud.pswd:
+ hgroot = ud.user + ":" + ud.pswd + "@" + host + ud.path
+ else:
+ hgroot = ud.user + "@" + host + ud.path
+
+ if command == "info":
+ return "%s identify -i %s://%s/%s" % (ud.basecmd, proto, hgroot, ud.module)
+
+ options = [];
+
+ # Don't specify revision for the fetch; clone the entire repo.
+ # This avoids an issue if the specified revision is a tag, because
+ # the tag actually exists in the specified revision + 1, so it won't
+ # be available when used in any successive commands.
+ if ud.revision and command != "fetch":
+ options.append("-r %s" % ud.revision)
+
+ if command == "fetch":
+ if ud.user and ud.pswd:
+ cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" clone %s %s://%s/%s %s" % (ud.basecmd, ud.user, ud.pswd, proto, " ".join(options), proto, hgroot, ud.module, ud.module)
+ else:
+ cmd = "%s clone %s %s://%s/%s %s" % (ud.basecmd, " ".join(options), proto, hgroot, ud.module, ud.module)
+ elif command == "pull":
+ # do not pass options list; limiting pull to rev causes the local
+ # repo not to contain it and immediately following "update" command
+ # will crash
+ if ud.user and ud.pswd:
+ cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" pull" % (ud.basecmd, ud.user, ud.pswd, proto)
+ else:
+ cmd = "%s pull" % (ud.basecmd)
+ elif command == "update":
+ if ud.user and ud.pswd:
+ cmd = "%s --config auth.default.prefix=* --config auth.default.username=%s --config auth.default.password=%s --config \"auth.default.schemes=%s\" update -C %s" % (ud.basecmd, ud.user, ud.pswd, proto, " ".join(options))
+ else:
+ cmd = "%s update -C %s" % (ud.basecmd, " ".join(options))
+ else:
+ raise FetchError("Invalid hg command %s" % command, ud.url)
+
+ return cmd
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
+
+ # If the checkout doesn't exist and the mirror tarball does, extract it
+ if not os.path.exists(ud.pkgdir) and os.path.exists(ud.fullmirror):
+ bb.utils.mkdirhier(ud.pkgdir)
+ runfetchcmd("tar -xzf %s" % (ud.fullmirror), d, workdir=ud.pkgdir)
+
+ if os.access(os.path.join(ud.moddir, '.hg'), os.R_OK):
+ # Found the source, check whether need pull
+ updatecmd = self._buildhgcommand(ud, d, "update")
+ logger.debug(1, "Running %s", updatecmd)
+ try:
+ runfetchcmd(updatecmd, d, workdir=ud.moddir)
+ except bb.fetch2.FetchError:
+ # Runnning pull in the repo
+ pullcmd = self._buildhgcommand(ud, d, "pull")
+ logger.info("Pulling " + ud.url)
+ # update sources there
+ logger.debug(1, "Running %s", pullcmd)
+ bb.fetch2.check_network_access(d, pullcmd, ud.url)
+ runfetchcmd(pullcmd, d, workdir=ud.moddir)
+ try:
+ os.unlink(ud.fullmirror)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+
+ # No source found, clone it.
+ if not os.path.exists(ud.moddir):
+ fetchcmd = self._buildhgcommand(ud, d, "fetch")
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(ud.pkgdir)
+ logger.debug(1, "Running %s", fetchcmd)
+ bb.fetch2.check_network_access(d, fetchcmd, ud.url)
+ runfetchcmd(fetchcmd, d, workdir=ud.pkgdir)
+
+ # Even when we clone (fetch), we still need to update as hg's clone
+ # won't checkout the specified revision if its on a branch
+ updatecmd = self._buildhgcommand(ud, d, "update")
+ logger.debug(1, "Running %s", updatecmd)
+ runfetchcmd(updatecmd, d, workdir=ud.moddir)
+
+ def clean(self, ud, d):
+ """ Clean the hg dir """
+
+ bb.utils.remove(ud.localpath, True)
+ bb.utils.remove(ud.fullmirror)
+ bb.utils.remove(ud.fullmirror + ".done")
+
+ def supports_srcrev(self):
+ return True
+
+ def _latest_revision(self, ud, d, name):
+ """
+ Compute tip revision for the url
+ """
+ bb.fetch2.check_network_access(d, self._buildhgcommand(ud, d, "info"), ud.url)
+ output = runfetchcmd(self._buildhgcommand(ud, d, "info"), d)
+ return output.strip()
+
+ def _build_revision(self, ud, d, name):
+ return ud.revision
+
+ def _revision_key(self, ud, d, name):
+ """
+ Return a unique key for the url
+ """
+ return "hg:" + ud.moddir
+
+ def build_mirror_data(self, ud, d):
+ # Generate a mirror tarball if needed
+ if ud.write_tarballs == "1" and not os.path.exists(ud.fullmirror):
+ # it's possible that this symlink points to read-only filesystem with PREMIRROR
+ if os.path.islink(ud.fullmirror):
+ os.unlink(ud.fullmirror)
+
+ logger.info("Creating tarball of hg repository")
+ runfetchcmd("tar -czf %s %s" % (ud.fullmirror, ud.module), d, workdir=ud.pkgdir)
+ runfetchcmd("touch %s.done" % (ud.fullmirror), d, workdir=ud.pkgdir)
+
+ def localpath(self, ud, d):
+ return ud.pkgdir
+
+ def unpack(self, ud, destdir, d):
+ """
+ Make a local clone or export for the url
+ """
+
+ revflag = "-r %s" % ud.revision
+ subdir = ud.parm.get("destsuffix", ud.module)
+ codir = "%s/%s" % (destdir, subdir)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata != "nokeep":
+ if not os.access(os.path.join(codir, '.hg'), os.R_OK):
+ logger.debug(2, "Unpack: creating new hg repository in '" + codir + "'")
+ runfetchcmd("%s init %s" % (ud.basecmd, codir), d)
+ logger.debug(2, "Unpack: updating source in '" + codir + "'")
+ runfetchcmd("%s pull %s" % (ud.basecmd, ud.moddir), d, workdir=codir)
+ runfetchcmd("%s up -C %s" % (ud.basecmd, revflag), d, workdir=codir)
+ else:
+ logger.debug(2, "Unpack: extracting source to '" + codir + "'")
+ runfetchcmd("%s archive -t files %s %s" % (ud.basecmd, revflag, codir), d, workdir=ud.moddir)
diff --git a/poky/bitbake/lib/bb/fetch2/local.py b/poky/bitbake/lib/bb/fetch2/local.py
new file mode 100644
index 000000000..a114ac12e
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/local.py
@@ -0,0 +1,119 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementations
+
+Classes for obtaining upstream sources for the
+BitBake build tools.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import urllib.request, urllib.parse, urllib.error
+import bb
+import bb.utils
+from bb.fetch2 import FetchMethod, FetchError
+from bb.fetch2 import logger
+
+class Local(FetchMethod):
+ def supports(self, urldata, d):
+ """
+ Check to see if a given url represents a local fetch.
+ """
+ return urldata.type in ['file']
+
+ def urldata_init(self, ud, d):
+ # We don't set localfile as for this fetcher the file is already local!
+ ud.decodedurl = urllib.parse.unquote(ud.url.split("://")[1].split(";")[0])
+ ud.basename = os.path.basename(ud.decodedurl)
+ ud.basepath = ud.decodedurl
+ ud.needdonestamp = False
+ return
+
+ def localpath(self, urldata, d):
+ """
+ Return the local filename of a given url assuming a successful fetch.
+ """
+ return self.localpaths(urldata, d)[-1]
+
+ def localpaths(self, urldata, d):
+ """
+ Return the local filename of a given url assuming a successful fetch.
+ """
+ searched = []
+ path = urldata.decodedurl
+ newpath = path
+ if path[0] == "/":
+ return [path]
+ filespath = d.getVar('FILESPATH')
+ if filespath:
+ logger.debug(2, "Searching for %s in paths:\n %s" % (path, "\n ".join(filespath.split(":"))))
+ newpath, hist = bb.utils.which(filespath, path, history=True)
+ searched.extend(hist)
+ if (not newpath or not os.path.exists(newpath)) and path.find("*") != -1:
+ # For expressions using '*', best we can do is take the first directory in FILESPATH that exists
+ newpath, hist = bb.utils.which(filespath, ".", history=True)
+ searched.extend(hist)
+ logger.debug(2, "Searching for %s in path: %s" % (path, newpath))
+ return searched
+ if not os.path.exists(newpath):
+ dldirfile = os.path.join(d.getVar("DL_DIR"), path)
+ logger.debug(2, "Defaulting to %s for %s" % (dldirfile, path))
+ bb.utils.mkdirhier(os.path.dirname(dldirfile))
+ searched.append(dldirfile)
+ return searched
+ return searched
+
+ def need_update(self, ud, d):
+ if ud.url.find("*") != -1:
+ return False
+ if os.path.exists(ud.localpath):
+ return False
+ return True
+
+ def download(self, urldata, d):
+ """Fetch urls (no-op for Local method)"""
+ # no need to fetch local files, we'll deal with them in place.
+ if self.supports_checksum(urldata) and not os.path.exists(urldata.localpath):
+ locations = []
+ filespath = d.getVar('FILESPATH')
+ if filespath:
+ locations = filespath.split(":")
+ locations.append(d.getVar("DL_DIR"))
+
+ msg = "Unable to find file " + urldata.url + " anywhere. The paths that were searched were:\n " + "\n ".join(locations)
+ raise FetchError(msg)
+
+ return True
+
+ def checkstatus(self, fetch, urldata, d):
+ """
+ Check the status of the url
+ """
+ if urldata.localpath.find("*") != -1:
+ logger.info("URL %s looks like a glob and was therefore not checked.", urldata.url)
+ return True
+ if os.path.exists(urldata.localpath):
+ return True
+ return False
+
+ def clean(self, urldata, d):
+ return
+
diff --git a/poky/bitbake/lib/bb/fetch2/npm.py b/poky/bitbake/lib/bb/fetch2/npm.py
new file mode 100644
index 000000000..730c346a9
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/npm.py
@@ -0,0 +1,309 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' NPM implementation
+
+The NPM fetcher is used to retrieve files from the npmjs repository
+
+Usage in the recipe:
+
+ SRC_URI = "npm://registry.npmjs.org/;name=${PN};version=${PV}"
+ Suported SRC_URI options are:
+
+ - name
+ - version
+
+ npm://registry.npmjs.org/${PN}/-/${PN}-${PV}.tgz would become npm://registry.npmjs.org;name=${PN};version=${PV}
+ The fetcher all triggers off the existence of ud.localpath. If that exists and has the ".done" stamp, its assumed the fetch is good/done
+
+"""
+
+import os
+import sys
+import urllib.request, urllib.parse, urllib.error
+import json
+import subprocess
+import signal
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import ChecksumError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+from bb.fetch2 import UnpackError
+from bb.fetch2 import ParameterError
+from distutils import spawn
+
+def subprocess_setup():
+ # Python installs a SIGPIPE handler by default. This is usually not what
+ # non-Python subprocesses expect.
+ # SIGPIPE errors are known issues with gzip/bash
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+class Npm(FetchMethod):
+
+ """Class to fetch urls via 'npm'"""
+ def init(self, d):
+ pass
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with npm
+ """
+ return ud.type in ['npm']
+
+ def debug(self, msg):
+ logger.debug(1, "NpmFetch: %s", msg)
+
+ def clean(self, ud, d):
+ logger.debug(2, "Calling cleanup %s" % ud.pkgname)
+ bb.utils.remove(ud.localpath, False)
+ bb.utils.remove(ud.pkgdatadir, True)
+ bb.utils.remove(ud.fullmirror, False)
+
+ def urldata_init(self, ud, d):
+ """
+ init NPM specific variable within url data
+ """
+ if 'downloadfilename' in ud.parm:
+ ud.basename = ud.parm['downloadfilename']
+ else:
+ ud.basename = os.path.basename(ud.path)
+
+ # can't call it ud.name otherwise fetcher base class will start doing sha1stuff
+ # TODO: find a way to get an sha1/sha256 manifest of pkg & all deps
+ ud.pkgname = ud.parm.get("name", None)
+ if not ud.pkgname:
+ raise ParameterError("NPM fetcher requires a name parameter", ud.url)
+ ud.version = ud.parm.get("version", None)
+ if not ud.version:
+ raise ParameterError("NPM fetcher requires a version parameter", ud.url)
+ ud.bbnpmmanifest = "%s-%s.deps.json" % (ud.pkgname, ud.version)
+ ud.bbnpmmanifest = ud.bbnpmmanifest.replace('/', '-')
+ ud.registry = "http://%s" % (ud.url.replace('npm://', '', 1).split(';'))[0]
+ prefixdir = "npm/%s" % ud.pkgname
+ ud.pkgdatadir = d.expand("${DL_DIR}/%s" % prefixdir)
+ if not os.path.exists(ud.pkgdatadir):
+ bb.utils.mkdirhier(ud.pkgdatadir)
+ ud.localpath = d.expand("${DL_DIR}/npm/%s" % ud.bbnpmmanifest)
+
+ self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -O -t 2 -T 30 -nv --passive-ftp --no-check-certificate "
+ ud.prefixdir = prefixdir
+
+ ud.write_tarballs = ((d.getVar("BB_GENERATE_MIRROR_TARBALLS") or "0") != "0")
+ mirrortarball = 'npm_%s-%s.tar.xz' % (ud.pkgname, ud.version)
+ mirrortarball = mirrortarball.replace('/', '-')
+ ud.fullmirror = os.path.join(d.getVar("DL_DIR"), mirrortarball)
+ ud.mirrortarballs = [mirrortarball]
+
+ def need_update(self, ud, d):
+ if os.path.exists(ud.localpath):
+ return False
+ return True
+
+ def _runwget(self, ud, d, command, quiet):
+ logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
+ bb.fetch2.check_network_access(d, command, ud.url)
+ dldir = d.getVar("DL_DIR")
+ runfetchcmd(command, d, quiet, workdir=dldir)
+
+ def _unpackdep(self, ud, pkg, data, destdir, dldir, d):
+ file = data[pkg]['tgz']
+ logger.debug(2, "file to extract is %s" % file)
+ if file.endswith('.tgz') or file.endswith('.tar.gz') or file.endswith('.tar.Z'):
+ cmd = 'tar xz --strip 1 --no-same-owner --warning=no-unknown-keyword -f %s/%s' % (dldir, file)
+ else:
+ bb.fatal("NPM package %s downloaded not a tarball!" % file)
+
+ # Change to subdir before executing command
+ if not os.path.exists(destdir):
+ os.makedirs(destdir)
+ path = d.getVar('PATH')
+ if path:
+ cmd = "PATH=\"%s\" %s" % (path, cmd)
+ bb.note("Unpacking %s to %s/" % (file, destdir))
+ ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True, cwd=destdir)
+
+ if ret != 0:
+ raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud.url)
+
+ if 'deps' not in data[pkg]:
+ return
+ for dep in data[pkg]['deps']:
+ self._unpackdep(ud, dep, data[pkg]['deps'], "%s/node_modules/%s" % (destdir, dep), dldir, d)
+
+
+ def unpack(self, ud, destdir, d):
+ dldir = d.getVar("DL_DIR")
+ with open("%s/npm/%s" % (dldir, ud.bbnpmmanifest)) as datafile:
+ workobj = json.load(datafile)
+ dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname)
+
+ if 'subdir' in ud.parm:
+ unpackdir = '%s/%s' % (destdir, ud.parm.get('subdir'))
+ else:
+ unpackdir = '%s/npmpkg' % destdir
+
+ self._unpackdep(ud, ud.pkgname, workobj, unpackdir, dldir, d)
+
+ def _parse_view(self, output):
+ '''
+ Parse the output of npm view --json; the last JSON result
+ is assumed to be the one that we're interested in.
+ '''
+ pdata = None
+ outdeps = {}
+ datalines = []
+ bracelevel = 0
+ for line in output.splitlines():
+ if bracelevel:
+ datalines.append(line)
+ elif '{' in line:
+ datalines = []
+ datalines.append(line)
+ bracelevel = bracelevel + line.count('{') - line.count('}')
+ if datalines:
+ pdata = json.loads('\n'.join(datalines))
+ return pdata
+
+ def _getdependencies(self, pkg, data, version, d, ud, optional=False, fetchedlist=None):
+ if fetchedlist is None:
+ fetchedlist = []
+ pkgfullname = pkg
+ if version != '*' and not '/' in version:
+ pkgfullname += "@'%s'" % version
+ logger.debug(2, "Calling getdeps on %s" % pkg)
+ fetchcmd = "npm view %s --json --registry %s" % (pkgfullname, ud.registry)
+ output = runfetchcmd(fetchcmd, d, True)
+ pdata = self._parse_view(output)
+ if not pdata:
+ raise FetchError("The command '%s' returned no output" % fetchcmd)
+ if optional:
+ pkg_os = pdata.get('os', None)
+ if pkg_os:
+ if not isinstance(pkg_os, list):
+ pkg_os = [pkg_os]
+ blacklist = False
+ for item in pkg_os:
+ if item.startswith('!'):
+ blacklist = True
+ break
+ if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
+ logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
+ return
+ #logger.debug(2, "Output URL is %s - %s - %s" % (ud.basepath, ud.basename, ud.localfile))
+ outputurl = pdata['dist']['tarball']
+ data[pkg] = {}
+ data[pkg]['tgz'] = os.path.basename(outputurl)
+ if outputurl in fetchedlist:
+ return
+
+ self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False)
+ fetchedlist.append(outputurl)
+
+ dependencies = pdata.get('dependencies', {})
+ optionalDependencies = pdata.get('optionalDependencies', {})
+ dependencies.update(optionalDependencies)
+ depsfound = {}
+ optdepsfound = {}
+ data[pkg]['deps'] = {}
+ for dep in dependencies:
+ if dep in optionalDependencies:
+ optdepsfound[dep] = dependencies[dep]
+ else:
+ depsfound[dep] = dependencies[dep]
+ for dep, version in optdepsfound.items():
+ self._getdependencies(dep, data[pkg]['deps'], version, d, ud, optional=True, fetchedlist=fetchedlist)
+ for dep, version in depsfound.items():
+ self._getdependencies(dep, data[pkg]['deps'], version, d, ud, fetchedlist=fetchedlist)
+
+ def _getshrinkeddependencies(self, pkg, data, version, d, ud, lockdown, manifest, toplevel=True):
+ logger.debug(2, "NPM shrinkwrap file is %s" % data)
+ if toplevel:
+ name = data.get('name', None)
+ if name and name != pkg:
+ for obj in data.get('dependencies', []):
+ if obj == pkg:
+ self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest, False)
+ return
+ outputurl = "invalid"
+ if ('resolved' not in data) or (not data['resolved'].startswith('http')):
+ # will be the case for ${PN}
+ fetchcmd = "npm view %s@%s dist.tarball --registry %s" % (pkg, version, ud.registry)
+ logger.debug(2, "Found this matching URL: %s" % str(fetchcmd))
+ outputurl = runfetchcmd(fetchcmd, d, True)
+ else:
+ outputurl = data['resolved']
+ self._runwget(ud, d, "%s --directory-prefix=%s %s" % (self.basecmd, ud.prefixdir, outputurl), False)
+ manifest[pkg] = {}
+ manifest[pkg]['tgz'] = os.path.basename(outputurl).rstrip()
+ manifest[pkg]['deps'] = {}
+
+ if pkg in lockdown:
+ sha1_expected = lockdown[pkg][version]
+ sha1_data = bb.utils.sha1_file("npm/%s/%s" % (ud.pkgname, manifest[pkg]['tgz']))
+ if sha1_expected != sha1_data:
+ msg = "\nFile: '%s' has %s checksum %s when %s was expected" % (manifest[pkg]['tgz'], 'sha1', sha1_data, sha1_expected)
+ raise ChecksumError('Checksum mismatch!%s' % msg)
+ else:
+ logger.debug(2, "No lockdown data for %s@%s" % (pkg, version))
+
+ if 'dependencies' in data:
+ for obj in data['dependencies']:
+ logger.debug(2, "Found dep is %s" % str(obj))
+ self._getshrinkeddependencies(obj, data['dependencies'][obj], data['dependencies'][obj]['version'], d, ud, lockdown, manifest[pkg]['deps'], False)
+
+ def download(self, ud, d):
+ """Fetch url"""
+ jsondepobj = {}
+ shrinkobj = {}
+ lockdown = {}
+
+ if not os.listdir(ud.pkgdatadir) and os.path.exists(ud.fullmirror):
+ dest = d.getVar("DL_DIR")
+ bb.utils.mkdirhier(dest)
+ runfetchcmd("tar -xJf %s" % (ud.fullmirror), d, workdir=dest)
+ return
+
+ if ud.parm.get("noverify", None) != '1':
+ shwrf = d.getVar('NPM_SHRINKWRAP')
+ logger.debug(2, "NPM shrinkwrap file is %s" % shwrf)
+ if shwrf:
+ try:
+ with open(shwrf) as datafile:
+ shrinkobj = json.load(datafile)
+ except Exception as e:
+ raise FetchError('Error loading NPM_SHRINKWRAP file "%s" for %s: %s' % (shwrf, ud.pkgname, str(e)))
+ elif not ud.ignore_checksums:
+ logger.warning('Missing shrinkwrap file in NPM_SHRINKWRAP for %s, this will lead to unreliable builds!' % ud.pkgname)
+ lckdf = d.getVar('NPM_LOCKDOWN')
+ logger.debug(2, "NPM lockdown file is %s" % lckdf)
+ if lckdf:
+ try:
+ with open(lckdf) as datafile:
+ lockdown = json.load(datafile)
+ except Exception as e:
+ raise FetchError('Error loading NPM_LOCKDOWN file "%s" for %s: %s' % (lckdf, ud.pkgname, str(e)))
+ elif not ud.ignore_checksums:
+ logger.warning('Missing lockdown file in NPM_LOCKDOWN for %s, this will lead to unreproducible builds!' % ud.pkgname)
+
+ if ('name' not in shrinkobj):
+ self._getdependencies(ud.pkgname, jsondepobj, ud.version, d, ud)
+ else:
+ self._getshrinkeddependencies(ud.pkgname, shrinkobj, ud.version, d, ud, lockdown, jsondepobj)
+
+ with open(ud.localpath, 'w') as outfile:
+ json.dump(jsondepobj, outfile)
+
+ def build_mirror_data(self, ud, d):
+ # Generate a mirror tarball if needed
+ if ud.write_tarballs and not os.path.exists(ud.fullmirror):
+ # it's possible that this symlink points to read-only filesystem with PREMIRROR
+ if os.path.islink(ud.fullmirror):
+ os.unlink(ud.fullmirror)
+
+ dldir = d.getVar("DL_DIR")
+ logger.info("Creating tarball of npm data")
+ runfetchcmd("tar -cJf %s npm/%s npm/%s" % (ud.fullmirror, ud.bbnpmmanifest, ud.pkgname), d,
+ workdir=dldir)
+ runfetchcmd("touch %s.done" % (ud.fullmirror), d, workdir=dldir)
diff --git a/poky/bitbake/lib/bb/fetch2/osc.py b/poky/bitbake/lib/bb/fetch2/osc.py
new file mode 100644
index 000000000..2b4f7d9c1
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/osc.py
@@ -0,0 +1,132 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+Bitbake "Fetch" implementation for osc (Opensuse build service client).
+Based on the svn "Fetch" implementation.
+
+"""
+
+import os
+import sys
+import logging
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import MissingParameterError
+from bb.fetch2 import runfetchcmd
+
+class Osc(FetchMethod):
+ """Class to fetch a module or modules from Opensuse build server
+ repositories."""
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with osc.
+ """
+ return ud.type in ['osc']
+
+ def urldata_init(self, ud, d):
+ if not "module" in ud.parm:
+ raise MissingParameterError('module', ud.url)
+
+ ud.module = ud.parm["module"]
+
+ # Create paths to osc checkouts
+ relpath = self._strip_leading_slashes(ud.path)
+ ud.pkgdir = os.path.join(d.getVar('OSCDIR'), ud.host)
+ ud.moddir = os.path.join(ud.pkgdir, relpath, ud.module)
+
+ if 'rev' in ud.parm:
+ ud.revision = ud.parm['rev']
+ else:
+ pv = d.getVar("PV", False)
+ rev = bb.fetch2.srcrev_internal_helper(ud, d)
+ if rev and rev != True:
+ ud.revision = rev
+ else:
+ ud.revision = ""
+
+ ud.localfile = d.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision))
+
+ def _buildosccommand(self, ud, d, command):
+ """
+ Build up an ocs commandline based on ud
+ command is "fetch", "update", "info"
+ """
+
+ basecmd = d.expand('${FETCHCMD_osc}')
+
+ proto = ud.parm.get('protocol', 'ocs')
+
+ options = []
+
+ config = "-c %s" % self.generate_config(ud, d)
+
+ if ud.revision:
+ options.append("-r %s" % ud.revision)
+
+ coroot = self._strip_leading_slashes(ud.path)
+
+ if command == "fetch":
+ osccmd = "%s %s co %s/%s %s" % (basecmd, config, coroot, ud.module, " ".join(options))
+ elif command == "update":
+ osccmd = "%s %s up %s" % (basecmd, config, " ".join(options))
+ else:
+ raise FetchError("Invalid osc command %s" % command, ud.url)
+
+ return osccmd
+
+ def download(self, ud, d):
+ """
+ Fetch url
+ """
+
+ logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
+
+ if os.access(os.path.join(d.getVar('OSCDIR'), ud.path, ud.module), os.R_OK):
+ oscupdatecmd = self._buildosccommand(ud, d, "update")
+ logger.info("Update "+ ud.url)
+ # update sources there
+ logger.debug(1, "Running %s", oscupdatecmd)
+ bb.fetch2.check_network_access(d, oscupdatecmd, ud.url)
+ runfetchcmd(oscupdatecmd, d, workdir=ud.moddir)
+ else:
+ oscfetchcmd = self._buildosccommand(ud, d, "fetch")
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(ud.pkgdir)
+ logger.debug(1, "Running %s", oscfetchcmd)
+ bb.fetch2.check_network_access(d, oscfetchcmd, ud.url)
+ runfetchcmd(oscfetchcmd, d, workdir=ud.pkgdir)
+
+ # tar them up to a defined filename
+ runfetchcmd("tar -czf %s %s" % (ud.localpath, ud.module), d,
+ cleanup=[ud.localpath], workdir=os.path.join(ud.pkgdir + ud.path))
+
+ def supports_srcrev(self):
+ return False
+
+ def generate_config(self, ud, d):
+ """
+ Generate a .oscrc to be used for this run.
+ """
+
+ config_path = os.path.join(d.getVar('OSCDIR'), "oscrc")
+ if (os.path.exists(config_path)):
+ os.remove(config_path)
+
+ f = open(config_path, 'w')
+ f.write("[general]\n")
+ f.write("apisrv = %s\n" % ud.host)
+ f.write("scheme = http\n")
+ f.write("su-wrapper = su -c\n")
+ f.write("build-root = %s\n" % d.getVar('WORKDIR'))
+ f.write("urllist = %s\n" % d.getVar("OSCURLLIST"))
+ f.write("extra-pkgs = gzip\n")
+ f.write("\n")
+ f.write("[%s]\n" % ud.host)
+ f.write("user = %s\n" % ud.parm["user"])
+ f.write("pass = %s\n" % ud.parm["pswd"])
+ f.close()
+
+ return config_path
diff --git a/poky/bitbake/lib/bb/fetch2/perforce.py b/poky/bitbake/lib/bb/fetch2/perforce.py
new file mode 100644
index 000000000..3debad59f
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/perforce.py
@@ -0,0 +1,209 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementation for perforce
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2016 Kodak Alaris, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import logging
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import logger
+from bb.fetch2 import runfetchcmd
+
+class Perforce(FetchMethod):
+ """ Class to fetch from perforce repositories """
+ def supports(self, ud, d):
+ """ Check to see if a given url can be fetched with perforce. """
+ return ud.type in ['p4']
+
+ def urldata_init(self, ud, d):
+ """
+ Initialize perforce specific variables within url data. If P4CONFIG is
+ provided by the env, use it. If P4PORT is specified by the recipe, use
+ its values, which may override the settings in P4CONFIG.
+ """
+ ud.basecmd = d.getVar('FETCHCMD_p4')
+ if not ud.basecmd:
+ ud.basecmd = "/usr/bin/env p4"
+
+ ud.dldir = d.getVar('P4DIR')
+ if not ud.dldir:
+ ud.dldir = '%s/%s' % (d.getVar('DL_DIR'), 'p4')
+
+ path = ud.url.split('://')[1]
+ path = path.split(';')[0]
+ delim = path.find('@');
+ if delim != -1:
+ (ud.user, ud.pswd) = path.split('@')[0].split(':')
+ ud.path = path.split('@')[1]
+ else:
+ ud.path = path
+
+ ud.usingp4config = False
+ p4port = d.getVar('P4PORT')
+
+ if p4port:
+ logger.debug(1, 'Using recipe provided P4PORT: %s' % p4port)
+ ud.host = p4port
+ else:
+ logger.debug(1, 'Trying to use P4CONFIG to automatically set P4PORT...')
+ ud.usingp4config = True
+ p4cmd = '%s info | grep "Server address"' % ud.basecmd
+ bb.fetch2.check_network_access(d, p4cmd, ud.url)
+ ud.host = runfetchcmd(p4cmd, d, True)
+ ud.host = ud.host.split(': ')[1].strip()
+ logger.debug(1, 'Determined P4PORT to be: %s' % ud.host)
+ if not ud.host:
+ raise FetchError('Could not determine P4PORT from P4CONFIG')
+
+ if ud.path.find('/...') >= 0:
+ ud.pathisdir = True
+ else:
+ ud.pathisdir = False
+
+ cleanedpath = ud.path.replace('/...', '').replace('/', '.')
+ cleanedhost = ud.host.replace(':', '.')
+ ud.pkgdir = os.path.join(ud.dldir, cleanedhost, cleanedpath)
+
+ ud.setup_revisions(d)
+
+ ud.localfile = d.expand('%s_%s_%s.tar.gz' % (cleanedhost, cleanedpath, ud.revision))
+
+ def _buildp4command(self, ud, d, command, depot_filename=None):
+ """
+ Build a p4 commandline. Valid commands are "changes", "print", and
+ "files". depot_filename is the full path to the file in the depot
+ including the trailing '#rev' value.
+ """
+ p4opt = ""
+
+ if ud.user:
+ p4opt += ' -u "%s"' % (ud.user)
+
+ if ud.pswd:
+ p4opt += ' -P "%s"' % (ud.pswd)
+
+ if ud.host and not ud.usingp4config:
+ p4opt += ' -p %s' % (ud.host)
+
+ if hasattr(ud, 'revision') and ud.revision:
+ pathnrev = '%s@%s' % (ud.path, ud.revision)
+ else:
+ pathnrev = '%s' % (ud.path)
+
+ if depot_filename:
+ if ud.pathisdir: # Remove leading path to obtain filename
+ filename = depot_filename[len(ud.path)-1:]
+ else:
+ filename = depot_filename[depot_filename.rfind('/'):]
+ filename = filename[:filename.find('#')] # Remove trailing '#rev'
+
+ if command == 'changes':
+ p4cmd = '%s%s changes -m 1 //%s' % (ud.basecmd, p4opt, pathnrev)
+ elif command == 'print':
+ if depot_filename != None:
+ p4cmd = '%s%s print -o "p4/%s" "%s"' % (ud.basecmd, p4opt, filename, depot_filename)
+ else:
+ raise FetchError('No depot file name provided to p4 %s' % command, ud.url)
+ elif command == 'files':
+ p4cmd = '%s%s files //%s' % (ud.basecmd, p4opt, pathnrev)
+ else:
+ raise FetchError('Invalid p4 command %s' % command, ud.url)
+
+ return p4cmd
+
+ def _p4listfiles(self, ud, d):
+ """
+ Return a list of the file names which are present in the depot using the
+ 'p4 files' command, including trailing '#rev' file revision indicator
+ """
+ p4cmd = self._buildp4command(ud, d, 'files')
+ bb.fetch2.check_network_access(d, p4cmd, ud.url)
+ p4fileslist = runfetchcmd(p4cmd, d, True)
+ p4fileslist = [f.rstrip() for f in p4fileslist.splitlines()]
+
+ if not p4fileslist:
+ raise FetchError('Unable to fetch listing of p4 files from %s@%s' % (ud.host, ud.path))
+
+ count = 0
+ filelist = []
+
+ for filename in p4fileslist:
+ item = filename.split(' - ')
+ lastaction = item[1].split()
+ logger.debug(1, 'File: %s Last Action: %s' % (item[0], lastaction[0]))
+ if lastaction[0] == 'delete':
+ continue
+ filelist.append(item[0])
+
+ return filelist
+
+ def download(self, ud, d):
+ """ Get the list of files, fetch each one """
+ filelist = self._p4listfiles(ud, d)
+ if not filelist:
+ raise FetchError('No files found in depot %s@%s' % (ud.host, ud.path))
+
+ bb.utils.remove(ud.pkgdir, True)
+ bb.utils.mkdirhier(ud.pkgdir)
+
+ for afile in filelist:
+ p4fetchcmd = self._buildp4command(ud, d, 'print', afile)
+ bb.fetch2.check_network_access(d, p4fetchcmd, ud.url)
+ runfetchcmd(p4fetchcmd, d, workdir=ud.pkgdir)
+
+ runfetchcmd('tar -czf %s p4' % (ud.localpath), d, cleanup=[ud.localpath], workdir=ud.pkgdir)
+
+ def clean(self, ud, d):
+ """ Cleanup p4 specific files and dirs"""
+ bb.utils.remove(ud.localpath)
+ bb.utils.remove(ud.pkgdir, True)
+
+ def supports_srcrev(self):
+ return True
+
+ def _revision_key(self, ud, d, name):
+ """ Return a unique key for the url """
+ return 'p4:%s' % ud.pkgdir
+
+ def _latest_revision(self, ud, d, name):
+ """ Return the latest upstream scm revision number """
+ p4cmd = self._buildp4command(ud, d, "changes")
+ bb.fetch2.check_network_access(d, p4cmd, ud.url)
+ tip = runfetchcmd(p4cmd, d, True)
+
+ if not tip:
+ raise FetchError('Could not determine the latest perforce changelist')
+
+ tipcset = tip.split(' ')[1]
+ logger.debug(1, 'p4 tip found to be changelist %s' % tipcset)
+ return tipcset
+
+ def sortable_revision(self, ud, d, name):
+ """ Return a sortable revision number """
+ return False, self._build_revision(ud, d)
+
+ def _build_revision(self, ud, d):
+ return ud.revision
+
diff --git a/poky/bitbake/lib/bb/fetch2/repo.py b/poky/bitbake/lib/bb/fetch2/repo.py
new file mode 100644
index 000000000..c22d9b557
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/repo.py
@@ -0,0 +1,97 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake "Fetch" repo (git) implementation
+
+"""
+
+# Copyright (C) 2009 Tom Rini <trini@embeddedalley.com>
+#
+# Based on git.py which is:
+#Copyright (C) 2005 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import bb
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class Repo(FetchMethod):
+ """Class to fetch a module or modules from repo (git) repositories"""
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with repo.
+ """
+ return ud.type in ["repo"]
+
+ def urldata_init(self, ud, d):
+ """
+ We don"t care about the git rev of the manifests repository, but
+ we do care about the manifest to use. The default is "default".
+ We also care about the branch or tag to be used. The default is
+ "master".
+ """
+
+ ud.proto = ud.parm.get('protocol', 'git')
+ ud.branch = ud.parm.get('branch', 'master')
+ ud.manifest = ud.parm.get('manifest', 'default.xml')
+ if not ud.manifest.endswith('.xml'):
+ ud.manifest += '.xml'
+
+ ud.localfile = d.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch))
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ if os.access(os.path.join(d.getVar("DL_DIR"), ud.localfile), os.R_OK):
+ logger.debug(1, "%s already exists (or was stashed). Skipping repo init / sync.", ud.localpath)
+ return
+
+ gitsrcname = "%s%s" % (ud.host, ud.path.replace("/", "."))
+ repodir = d.getVar("REPODIR") or os.path.join(d.getVar("DL_DIR"), "repo")
+ codir = os.path.join(repodir, gitsrcname, ud.manifest)
+
+ if ud.user:
+ username = ud.user + "@"
+ else:
+ username = ""
+
+ repodir = os.path.join(codir, "repo")
+ bb.utils.mkdirhier(repodir)
+ if not os.path.exists(os.path.join(repodir, ".repo")):
+ bb.fetch2.check_network_access(d, "repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), ud.url)
+ runfetchcmd("repo init -m %s -b %s -u %s://%s%s%s" % (ud.manifest, ud.branch, ud.proto, username, ud.host, ud.path), d, workdir=repodir)
+
+ bb.fetch2.check_network_access(d, "repo sync %s" % ud.url, ud.url)
+ runfetchcmd("repo sync", d, workdir=repodir)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata == "keep":
+ tar_flags = ""
+ else:
+ tar_flags = "--exclude='.repo' --exclude='.git'"
+
+ # Create a cache
+ runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.join(".", "*") ), d, workdir=codir)
+
+ def supports_srcrev(self):
+ return False
+
+ def _build_revision(self, ud, d):
+ return ud.manifest
+
+ def _want_sortable_revision(self, ud, d):
+ return False
diff --git a/poky/bitbake/lib/bb/fetch2/s3.py b/poky/bitbake/lib/bb/fetch2/s3.py
new file mode 100644
index 000000000..162928862
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/s3.py
@@ -0,0 +1,98 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementation for Amazon AWS S3.
+
+Class for fetching files from Amazon S3 using the AWS Command Line Interface.
+The aws tool must be correctly installed and configured prior to use.
+
+"""
+
+# Copyright (C) 2017, Andre McCurdy <armccurdy@gmail.com>
+#
+# Based in part on bb.fetch2.wget:
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import bb
+import urllib.request, urllib.parse, urllib.error
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import runfetchcmd
+
+class S3(FetchMethod):
+ """Class to fetch urls via 'aws s3'"""
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with s3.
+ """
+ return ud.type in ['s3']
+
+ def recommends_checksum(self, urldata):
+ return True
+
+ def urldata_init(self, ud, d):
+ if 'downloadfilename' in ud.parm:
+ ud.basename = ud.parm['downloadfilename']
+ else:
+ ud.basename = os.path.basename(ud.path)
+
+ ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
+
+ ud.basecmd = d.getVar("FETCHCMD_s3") or "/usr/bin/env aws s3"
+
+ def download(self, ud, d):
+ """
+ Fetch urls
+ Assumes localpath was called first
+ """
+
+ cmd = '%s cp s3://%s%s %s' % (ud.basecmd, ud.host, ud.path, ud.localpath)
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ runfetchcmd(cmd, d)
+
+ # Additional sanity checks copied from the wget class (although there
+ # are no known issues which mean these are required, treat the aws cli
+ # tool with a little healthy suspicion).
+
+ if not os.path.exists(ud.localpath):
+ raise FetchError("The aws cp command returned success for s3://%s%s but %s doesn't exist?!" % (ud.host, ud.path, ud.localpath))
+
+ if os.path.getsize(ud.localpath) == 0:
+ os.remove(ud.localpath)
+ raise FetchError("The aws cp command for s3://%s%s resulted in a zero size file?! Deleting and failing since this isn't right." % (ud.host, ud.path))
+
+ return True
+
+ def checkstatus(self, fetch, ud, d):
+ """
+ Check the status of a URL
+ """
+
+ cmd = '%s ls s3://%s%s' % (ud.basecmd, ud.host, ud.path)
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ output = runfetchcmd(cmd, d)
+
+ # "aws s3 ls s3://mybucket/foo" will exit with success even if the file
+ # is not found, so check output of the command to confirm success.
+
+ if not output:
+ raise FetchError("The aws ls command for s3://%s%s gave empty output" % (ud.host, ud.path))
+
+ return True
diff --git a/poky/bitbake/lib/bb/fetch2/sftp.py b/poky/bitbake/lib/bb/fetch2/sftp.py
new file mode 100644
index 000000000..81884a6aa
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/sftp.py
@@ -0,0 +1,125 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake SFTP Fetch implementation
+
+Class for fetching files via SFTP. It tries to adhere to the (now
+expired) IETF Internet Draft for "Uniform Resource Identifier (URI)
+Scheme for Secure File Transfer Protocol (SFTP) and Secure Shell
+(SSH)" (SECSH URI).
+
+It uses SFTP (as to adhere to the SECSH URI specification). It only
+supports key based authentication, not password. This class, unlike
+the SSH fetcher, does not support fetching a directory tree from the
+remote.
+
+ http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04
+ https://www.iana.org/assignments/uri-schemes/prov/sftp
+ https://tools.ietf.org/html/draft-ietf-secsh-filexfer-13
+
+Please note that '/' is used as host path seperator, and not ":"
+as you may be used to from the scp/sftp commands. You can use a
+~ (tilde) to specify a path relative to your home directory.
+(The /~user/ syntax, for specyfing a path relative to another
+user's home directory is not supported.) Note that the tilde must
+still follow the host path seperator ("/"). See exampels below.
+
+Example SRC_URIs:
+
+SRC_URI = "sftp://host.example.com/dir/path.file.txt"
+
+A path relative to your home directory.
+
+SRC_URI = "sftp://host.example.com/~/dir/path.file.txt"
+
+You can also specify a username (specyfing password in the
+URI is not supported, use SSH keys to authenticate):
+
+SRC_URI = "sftp://user@host.example.com/dir/path.file.txt"
+
+"""
+
+# Copyright (C) 2013, Olof Johansson <olof.johansson@axis.com>
+#
+# Based in part on bb.fetch2.wget:
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import bb
+import urllib.request, urllib.parse, urllib.error
+from bb.fetch2 import URI
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import runfetchcmd
+
+class SFTP(FetchMethod):
+ """Class to fetch urls via 'sftp'"""
+
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with sftp.
+ """
+ return ud.type in ['sftp']
+
+ def recommends_checksum(self, urldata):
+ return True
+
+ def urldata_init(self, ud, d):
+ if 'protocol' in ud.parm and ud.parm['protocol'] == 'git':
+ raise bb.fetch2.ParameterError(
+ "Invalid protocol - if you wish to fetch from a " +
+ "git repository using ssh, you need to use the " +
+ "git:// prefix with protocol=ssh", ud.url)
+
+ if 'downloadfilename' in ud.parm:
+ ud.basename = ud.parm['downloadfilename']
+ else:
+ ud.basename = os.path.basename(ud.path)
+
+ ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
+
+ def download(self, ud, d):
+ """Fetch urls"""
+
+ urlo = URI(ud.url)
+ basecmd = 'sftp -oBatchMode=yes'
+ port = ''
+ if urlo.port:
+ port = '-P %d' % urlo.port
+ urlo.port = None
+
+ dldir = d.getVar('DL_DIR')
+ lpath = os.path.join(dldir, ud.localfile)
+
+ user = ''
+ if urlo.userinfo:
+ user = urlo.userinfo + '@'
+
+ path = urlo.path
+
+ # Supoprt URIs relative to the user's home directory, with
+ # the tilde syntax. (E.g. <sftp://example.com/~/foo.diff>).
+ if path[:3] == '/~/':
+ path = path[3:]
+
+ remote = '%s%s:%s' % (user, urlo.hostname, path)
+
+ cmd = '%s %s %s %s' % (basecmd, port, remote, lpath)
+
+ bb.fetch2.check_network_access(d, cmd, ud.url)
+ runfetchcmd(cmd, d)
+ return True
diff --git a/poky/bitbake/lib/bb/fetch2/ssh.py b/poky/bitbake/lib/bb/fetch2/ssh.py
new file mode 100644
index 000000000..6047ee417
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/ssh.py
@@ -0,0 +1,125 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+'''
+BitBake 'Fetch' implementations
+
+This implementation is for Secure Shell (SSH), and attempts to comply with the
+IETF secsh internet draft:
+ http://tools.ietf.org/wg/secsh/draft-ietf-secsh-scp-sftp-ssh-uri/
+
+ Currently does not support the sftp parameters, as this uses scp
+ Also does not support the 'fingerprint' connection parameter.
+
+ Please note that '/' is used as host, path separator not ':' as you may
+ be used to, also '~' can be used to specify user HOME, but again after '/'
+
+ Example SRC_URI:
+ SRC_URI = "ssh://user@host.example.com/dir/path/file.txt"
+ SRC_URI = "ssh://user@host.example.com/~/file.txt"
+'''
+
+# Copyright (C) 2006 OpenedHand Ltd.
+#
+#
+# Based in part on svk.py:
+# Copyright (C) 2006 Holger Hans Peter Freyther
+# Based on svn.py:
+# Copyright (C) 2003, 2004 Chris Larson
+# Based on functions from the base bb module:
+# Copyright 2003 Holger Schurig
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re, os
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import logger
+from bb.fetch2 import runfetchcmd
+
+
+__pattern__ = re.compile(r'''
+ \s* # Skip leading whitespace
+ ssh:// # scheme
+ ( # Optional username/password block
+ (?P<user>\S+) # username
+ (:(?P<pass>\S+))? # colon followed by the password (optional)
+ )?
+ (?P<cparam>(;[^;]+)*)? # connection parameters block (optional)
+ @
+ (?P<host>\S+?) # non-greedy match of the host
+ (:(?P<port>[0-9]+))? # colon followed by the port (optional)
+ /
+ (?P<path>[^;]+) # path on the remote system, may be absolute or relative,
+ # and may include the use of '~' to reference the remote home
+ # directory
+ (?P<sparam>(;[^;]+)*)? # parameters block (optional)
+ $
+''', re.VERBOSE)
+
+class SSH(FetchMethod):
+ '''Class to fetch a module or modules via Secure Shell'''
+
+ def supports(self, urldata, d):
+ return __pattern__.match(urldata.url) != None
+
+ def supports_checksum(self, urldata):
+ return False
+
+ def urldata_init(self, urldata, d):
+ if 'protocol' in urldata.parm and urldata.parm['protocol'] == 'git':
+ raise bb.fetch2.ParameterError(
+ "Invalid protocol - if you wish to fetch from a git " +
+ "repository using ssh, you need to use " +
+ "git:// prefix with protocol=ssh", urldata.url)
+ m = __pattern__.match(urldata.url)
+ path = m.group('path')
+ host = m.group('host')
+ urldata.localpath = os.path.join(d.getVar('DL_DIR'),
+ os.path.basename(os.path.normpath(path)))
+
+ def download(self, urldata, d):
+ dldir = d.getVar('DL_DIR')
+
+ m = __pattern__.match(urldata.url)
+ path = m.group('path')
+ host = m.group('host')
+ port = m.group('port')
+ user = m.group('user')
+ password = m.group('pass')
+
+ if port:
+ portarg = '-P %s' % port
+ else:
+ portarg = ''
+
+ if user:
+ fr = user
+ if password:
+ fr += ':%s' % password
+ fr += '@%s' % host
+ else:
+ fr = host
+ fr += ':%s' % path
+
+ cmd = 'scp -B -r %s %s %s/' % (
+ portarg,
+ fr,
+ dldir
+ )
+
+ bb.fetch2.check_network_access(d, cmd, urldata.url)
+
+ runfetchcmd(cmd, d)
+
diff --git a/poky/bitbake/lib/bb/fetch2/svn.py b/poky/bitbake/lib/bb/fetch2/svn.py
new file mode 100644
index 000000000..3f172eec9
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/svn.py
@@ -0,0 +1,193 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementation for svn.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2004 Marcin Juszkiewicz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import os
+import sys
+import logging
+import bb
+import re
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import MissingParameterError
+from bb.fetch2 import runfetchcmd
+from bb.fetch2 import logger
+
+class Svn(FetchMethod):
+ """Class to fetch a module or modules from svn repositories"""
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with svn.
+ """
+ return ud.type in ['svn']
+
+ def urldata_init(self, ud, d):
+ """
+ init svn specific variable within url data
+ """
+ if not "module" in ud.parm:
+ raise MissingParameterError('module', ud.url)
+
+ ud.basecmd = d.getVar('FETCHCMD_svn')
+
+ ud.module = ud.parm["module"]
+
+ if not "path_spec" in ud.parm:
+ ud.path_spec = ud.module
+ else:
+ ud.path_spec = ud.parm["path_spec"]
+
+ # Create paths to svn checkouts
+ relpath = self._strip_leading_slashes(ud.path)
+ ud.pkgdir = os.path.join(d.expand('${SVNDIR}'), ud.host, relpath)
+ ud.moddir = os.path.join(ud.pkgdir, ud.module)
+
+ ud.setup_revisions(d)
+
+ if 'rev' in ud.parm:
+ ud.revision = ud.parm['rev']
+
+ ud.localfile = d.expand('%s_%s_%s_%s_.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision))
+
+ def _buildsvncommand(self, ud, d, command):
+ """
+ Build up an svn commandline based on ud
+ command is "fetch", "update", "info"
+ """
+
+ proto = ud.parm.get('protocol', 'svn')
+
+ svn_ssh = None
+ if proto == "svn+ssh" and "ssh" in ud.parm:
+ svn_ssh = ud.parm["ssh"]
+
+ svnroot = ud.host + ud.path
+
+ options = []
+
+ options.append("--no-auth-cache")
+
+ if ud.user:
+ options.append("--username %s" % ud.user)
+
+ if ud.pswd:
+ options.append("--password %s" % ud.pswd)
+
+ if command == "info":
+ svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
+ elif command == "log1":
+ svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
+ else:
+ suffix = ""
+ if ud.revision:
+ options.append("-r %s" % ud.revision)
+ suffix = "@%s" % (ud.revision)
+
+ if command == "fetch":
+ transportuser = ud.parm.get("transportuser", "")
+ svncmd = "%s co %s %s://%s%s/%s%s %s" % (ud.basecmd, " ".join(options), proto, transportuser, svnroot, ud.module, suffix, ud.path_spec)
+ elif command == "update":
+ svncmd = "%s update %s" % (ud.basecmd, " ".join(options))
+ else:
+ raise FetchError("Invalid svn command %s" % command, ud.url)
+
+ if svn_ssh:
+ svncmd = "SVN_SSH=\"%s\" %s" % (svn_ssh, svncmd)
+
+ return svncmd
+
+ def download(self, ud, d):
+ """Fetch url"""
+
+ logger.debug(2, "Fetch: checking for module directory '" + ud.moddir + "'")
+
+ if os.access(os.path.join(ud.moddir, '.svn'), os.R_OK):
+ svnupdatecmd = self._buildsvncommand(ud, d, "update")
+ logger.info("Update " + ud.url)
+ # We need to attempt to run svn upgrade first in case its an older working format
+ try:
+ runfetchcmd(ud.basecmd + " upgrade", d, workdir=ud.moddir)
+ except FetchError:
+ pass
+ logger.debug(1, "Running %s", svnupdatecmd)
+ bb.fetch2.check_network_access(d, svnupdatecmd, ud.url)
+ runfetchcmd(svnupdatecmd, d, workdir=ud.moddir)
+ else:
+ svnfetchcmd = self._buildsvncommand(ud, d, "fetch")
+ logger.info("Fetch " + ud.url)
+ # check out sources there
+ bb.utils.mkdirhier(ud.pkgdir)
+ logger.debug(1, "Running %s", svnfetchcmd)
+ bb.fetch2.check_network_access(d, svnfetchcmd, ud.url)
+ runfetchcmd(svnfetchcmd, d, workdir=ud.pkgdir)
+
+ scmdata = ud.parm.get("scmdata", "")
+ if scmdata == "keep":
+ tar_flags = ""
+ else:
+ tar_flags = "--exclude='.svn'"
+
+ # tar them up to a defined filename
+ runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, ud.path_spec), d,
+ cleanup=[ud.localpath], workdir=ud.pkgdir)
+
+ def clean(self, ud, d):
+ """ Clean SVN specific files and dirs """
+
+ bb.utils.remove(ud.localpath)
+ bb.utils.remove(ud.moddir, True)
+
+
+ def supports_srcrev(self):
+ return True
+
+ def _revision_key(self, ud, d, name):
+ """
+ Return a unique key for the url
+ """
+ return "svn:" + ud.moddir
+
+ def _latest_revision(self, ud, d, name):
+ """
+ Return the latest upstream revision number
+ """
+ bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"), ud.url)
+
+ output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "log1"), d, True)
+
+ # skip the first line, as per output of svn log
+ # then we expect the revision on the 2nd line
+ revision = re.search('^r([0-9]*)', output.splitlines()[1]).group(1)
+
+ return revision
+
+ def sortable_revision(self, ud, d, name):
+ """
+ Return a sortable revision number which in our case is the revision number
+ """
+
+ return False, self._build_revision(ud, d)
+
+ def _build_revision(self, ud, d):
+ return ud.revision
diff --git a/poky/bitbake/lib/bb/fetch2/wget.py b/poky/bitbake/lib/bb/fetch2/wget.py
new file mode 100644
index 000000000..8f505b6de
--- /dev/null
+++ b/poky/bitbake/lib/bb/fetch2/wget.py
@@ -0,0 +1,626 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'Fetch' implementations
+
+Classes for obtaining upstream sources for the
+BitBake build tools.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+import re
+import tempfile
+import subprocess
+import os
+import logging
+import errno
+import bb
+import bb.progress
+import urllib.request, urllib.parse, urllib.error
+from bb.fetch2 import FetchMethod
+from bb.fetch2 import FetchError
+from bb.fetch2 import logger
+from bb.fetch2 import runfetchcmd
+from bb.utils import export_proxies
+from bs4 import BeautifulSoup
+from bs4 import SoupStrainer
+
+class WgetProgressHandler(bb.progress.LineFilterProgressHandler):
+ """
+ Extract progress information from wget output.
+ Note: relies on --progress=dot (with -v or without -q/-nv) being
+ specified on the wget command line.
+ """
+ def __init__(self, d):
+ super(WgetProgressHandler, self).__init__(d)
+ # Send an initial progress event so the bar gets shown
+ self._fire_progress(0)
+
+ def writeline(self, line):
+ percs = re.findall(r'(\d+)%\s+([\d.]+[A-Z])', line)
+ if percs:
+ progress = int(percs[-1][0])
+ rate = percs[-1][1] + '/s'
+ self.update(progress, rate)
+ return False
+ return True
+
+
+class Wget(FetchMethod):
+ """Class to fetch urls via 'wget'"""
+ def supports(self, ud, d):
+ """
+ Check to see if a given url can be fetched with wget.
+ """
+ return ud.type in ['http', 'https', 'ftp']
+
+ def recommends_checksum(self, urldata):
+ return True
+
+ def urldata_init(self, ud, d):
+ if 'protocol' in ud.parm:
+ if ud.parm['protocol'] == 'git':
+ raise bb.fetch2.ParameterError("Invalid protocol - if you wish to fetch from a git repository using http, you need to instead use the git:// prefix with protocol=http", ud.url)
+
+ if 'downloadfilename' in ud.parm:
+ ud.basename = ud.parm['downloadfilename']
+ else:
+ ud.basename = os.path.basename(ud.path)
+
+ ud.localfile = d.expand(urllib.parse.unquote(ud.basename))
+ if not ud.localfile:
+ ud.localfile = d.expand(urllib.parse.unquote(ud.host + ud.path).replace("/", "."))
+
+ self.basecmd = d.getVar("FETCHCMD_wget") or "/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate"
+
+ def _runwget(self, ud, d, command, quiet, workdir=None):
+
+ progresshandler = WgetProgressHandler(d)
+
+ logger.debug(2, "Fetching %s using command '%s'" % (ud.url, command))
+ bb.fetch2.check_network_access(d, command, ud.url)
+ runfetchcmd(command + ' --progress=dot -v', d, quiet, log=progresshandler, workdir=workdir)
+
+ def download(self, ud, d):
+ """Fetch urls"""
+
+ fetchcmd = self.basecmd
+
+ if 'downloadfilename' in ud.parm:
+ dldir = d.getVar("DL_DIR")
+ bb.utils.mkdirhier(os.path.dirname(dldir + os.sep + ud.localfile))
+ fetchcmd += " -O " + dldir + os.sep + ud.localfile
+
+ if ud.user and ud.pswd:
+ fetchcmd += " --user=%s --password=%s --auth-no-challenge" % (ud.user, ud.pswd)
+
+ uri = ud.url.split(";")[0]
+ if os.path.exists(ud.localpath):
+ # file exists, but we didnt complete it.. trying again..
+ fetchcmd += d.expand(" -c -P ${DL_DIR} '%s'" % uri)
+ else:
+ fetchcmd += d.expand(" -P ${DL_DIR} '%s'" % uri)
+
+ self._runwget(ud, d, fetchcmd, False)
+
+ # Sanity check since wget can pretend it succeed when it didn't
+ # Also, this used to happen if sourceforge sent us to the mirror page
+ if not os.path.exists(ud.localpath):
+ raise FetchError("The fetch command returned success for url %s but %s doesn't exist?!" % (uri, ud.localpath), uri)
+
+ if os.path.getsize(ud.localpath) == 0:
+ os.remove(ud.localpath)
+ raise FetchError("The fetch of %s resulted in a zero size file?! Deleting and failing since this isn't right." % (uri), uri)
+
+ return True
+
+ def checkstatus(self, fetch, ud, d, try_again=True):
+ import urllib.request, urllib.error, urllib.parse, socket, http.client
+ from urllib.response import addinfourl
+ from bb.fetch2 import FetchConnectionCache
+
+ class HTTPConnectionCache(http.client.HTTPConnection):
+ if fetch.connection_cache:
+ def connect(self):
+ """Connect to the host and port specified in __init__."""
+
+ sock = fetch.connection_cache.get_connection(self.host, self.port)
+ if sock:
+ self.sock = sock
+ else:
+ self.sock = socket.create_connection((self.host, self.port),
+ self.timeout, self.source_address)
+ fetch.connection_cache.add_connection(self.host, self.port, self.sock)
+
+ if self._tunnel_host:
+ self._tunnel()
+
+ class CacheHTTPHandler(urllib.request.HTTPHandler):
+ def http_open(self, req):
+ return self.do_open(HTTPConnectionCache, req)
+
+ def do_open(self, http_class, req):
+ """Return an addinfourl object for the request, using http_class.
+
+ http_class must implement the HTTPConnection API from httplib.
+ The addinfourl return value is a file-like object. It also
+ has methods and attributes including:
+ - info(): return a mimetools.Message object for the headers
+ - geturl(): return the original request URL
+ - code: HTTP status code
+ """
+ host = req.host
+ if not host:
+ raise urlllib2.URLError('no host given')
+
+ h = http_class(host, timeout=req.timeout) # will parse host:port
+ h.set_debuglevel(self._debuglevel)
+
+ headers = dict(req.unredirected_hdrs)
+ headers.update(dict((k, v) for k, v in list(req.headers.items())
+ if k not in headers))
+
+ # We want to make an HTTP/1.1 request, but the addinfourl
+ # class isn't prepared to deal with a persistent connection.
+ # It will try to read all remaining data from the socket,
+ # which will block while the server waits for the next request.
+ # So make sure the connection gets closed after the (only)
+ # request.
+
+ # Don't close connection when connection_cache is enabled,
+ if fetch.connection_cache is None:
+ headers["Connection"] = "close"
+ else:
+ headers["Connection"] = "Keep-Alive" # Works for HTTP/1.0
+
+ headers = dict(
+ (name.title(), val) for name, val in list(headers.items()))
+
+ if req._tunnel_host:
+ tunnel_headers = {}
+ proxy_auth_hdr = "Proxy-Authorization"
+ if proxy_auth_hdr in headers:
+ tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
+ # Proxy-Authorization should not be sent to origin
+ # server.
+ del headers[proxy_auth_hdr]
+ h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
+
+ try:
+ h.request(req.get_method(), req.selector, req.data, headers)
+ except socket.error as err: # XXX what error?
+ # Don't close connection when cache is enabled.
+ # Instead, try to detect connections that are no longer
+ # usable (for example, closed unexpectedly) and remove
+ # them from the cache.
+ if fetch.connection_cache is None:
+ h.close()
+ elif isinstance(err, OSError) and err.errno == errno.EBADF:
+ # This happens when the server closes the connection despite the Keep-Alive.
+ # Apparently urllib then uses the file descriptor, expecting it to be
+ # connected, when in reality the connection is already gone.
+ # We let the request fail and expect it to be
+ # tried once more ("try_again" in check_status()),
+ # with the dead connection removed from the cache.
+ # If it still fails, we give up, which can happend for bad
+ # HTTP proxy settings.
+ fetch.connection_cache.remove_connection(h.host, h.port)
+ raise urllib.error.URLError(err)
+ else:
+ try:
+ r = h.getresponse(buffering=True)
+ except TypeError: # buffering kw not supported
+ r = h.getresponse()
+
+ # Pick apart the HTTPResponse object to get the addinfourl
+ # object initialized properly.
+
+ # Wrap the HTTPResponse object in socket's file object adapter
+ # for Windows. That adapter calls recv(), so delegate recv()
+ # to read(). This weird wrapping allows the returned object to
+ # have readline() and readlines() methods.
+
+ # XXX It might be better to extract the read buffering code
+ # out of socket._fileobject() and into a base class.
+ r.recv = r.read
+
+ # no data, just have to read
+ r.read()
+ class fp_dummy(object):
+ def read(self):
+ return ""
+ def readline(self):
+ return ""
+ def close(self):
+ pass
+ closed = False
+
+ resp = addinfourl(fp_dummy(), r.msg, req.get_full_url())
+ resp.code = r.status
+ resp.msg = r.reason
+
+ # Close connection when server request it.
+ if fetch.connection_cache is not None:
+ if 'Connection' in r.msg and r.msg['Connection'] == 'close':
+ fetch.connection_cache.remove_connection(h.host, h.port)
+
+ return resp
+
+ class HTTPMethodFallback(urllib.request.BaseHandler):
+ """
+ Fallback to GET if HEAD is not allowed (405 HTTP error)
+ """
+ def http_error_405(self, req, fp, code, msg, headers):
+ fp.read()
+ fp.close()
+
+ newheaders = dict((k,v) for k,v in list(req.headers.items())
+ if k.lower() not in ("content-length", "content-type"))
+ return self.parent.open(urllib.request.Request(req.get_full_url(),
+ headers=newheaders,
+ origin_req_host=req.origin_req_host,
+ unverifiable=True))
+
+ """
+ Some servers (e.g. GitHub archives, hosted on Amazon S3) return 403
+ Forbidden when they actually mean 405 Method Not Allowed.
+ """
+ http_error_403 = http_error_405
+
+
+ class FixedHTTPRedirectHandler(urllib.request.HTTPRedirectHandler):
+ """
+ urllib2.HTTPRedirectHandler resets the method to GET on redirect,
+ when we want to follow redirects using the original method.
+ """
+ def redirect_request(self, req, fp, code, msg, headers, newurl):
+ newreq = urllib.request.HTTPRedirectHandler.redirect_request(self, req, fp, code, msg, headers, newurl)
+ newreq.get_method = lambda: req.get_method()
+ return newreq
+ exported_proxies = export_proxies(d)
+
+ handlers = [FixedHTTPRedirectHandler, HTTPMethodFallback]
+ if export_proxies:
+ handlers.append(urllib.request.ProxyHandler())
+ handlers.append(CacheHTTPHandler())
+ # XXX: Since Python 2.7.9 ssl cert validation is enabled by default
+ # see PEP-0476, this causes verification errors on some https servers
+ # so disable by default.
+ import ssl
+ if hasattr(ssl, '_create_unverified_context'):
+ handlers.append(urllib.request.HTTPSHandler(context=ssl._create_unverified_context()))
+ opener = urllib.request.build_opener(*handlers)
+
+ try:
+ uri = ud.url.split(";")[0]
+ r = urllib.request.Request(uri)
+ r.get_method = lambda: "HEAD"
+ # Some servers (FusionForge, as used on Alioth) require that the
+ # optional Accept header is set.
+ r.add_header("Accept", "*/*")
+ def add_basic_auth(login_str, request):
+ '''Adds Basic auth to http request, pass in login:password as string'''
+ import base64
+ encodeuser = base64.b64encode(login_str.encode('utf-8')).decode("utf-8")
+ authheader = "Basic %s" % encodeuser
+ r.add_header("Authorization", authheader)
+
+ if ud.user:
+ add_basic_auth(ud.user, r)
+
+ try:
+ import netrc, urllib.parse
+ n = netrc.netrc()
+ login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
+ add_basic_auth("%s:%s" % (login, password), r)
+ except (TypeError, ImportError, IOError, netrc.NetrcParseError):
+ pass
+
+ with opener.open(r) as response:
+ pass
+ except urllib.error.URLError as e:
+ if try_again:
+ logger.debug(2, "checkstatus: trying again")
+ return self.checkstatus(fetch, ud, d, False)
+ else:
+ # debug for now to avoid spamming the logs in e.g. remote sstate searches
+ logger.debug(2, "checkstatus() urlopen failed: %s" % e)
+ return False
+ return True
+
+ def _parse_path(self, regex, s):
+ """
+ Find and group name, version and archive type in the given string s
+ """
+
+ m = regex.search(s)
+ if m:
+ pname = ''
+ pver = ''
+ ptype = ''
+
+ mdict = m.groupdict()
+ if 'name' in mdict.keys():
+ pname = mdict['name']
+ if 'pver' in mdict.keys():
+ pver = mdict['pver']
+ if 'type' in mdict.keys():
+ ptype = mdict['type']
+
+ bb.debug(3, "_parse_path: %s, %s, %s" % (pname, pver, ptype))
+
+ return (pname, pver, ptype)
+
+ return None
+
+ def _modelate_version(self, version):
+ if version[0] in ['.', '-']:
+ if version[1].isdigit():
+ version = version[1] + version[0] + version[2:len(version)]
+ else:
+ version = version[1:len(version)]
+
+ version = re.sub('-', '.', version)
+ version = re.sub('_', '.', version)
+ version = re.sub('(rc)+', '.1000.', version)
+ version = re.sub('(beta)+', '.100.', version)
+ version = re.sub('(alpha)+', '.10.', version)
+ if version[0] == 'v':
+ version = version[1:len(version)]
+ return version
+
+ def _vercmp(self, old, new):
+ """
+ Check whether 'new' is newer than 'old' version. We use existing vercmp() for the
+ purpose. PE is cleared in comparison as it's not for build, and PR is cleared too
+ for simplicity as it's somehow difficult to get from various upstream format
+ """
+
+ (oldpn, oldpv, oldsuffix) = old
+ (newpn, newpv, newsuffix) = new
+
+ """
+ Check for a new suffix type that we have never heard of before
+ """
+ if (newsuffix):
+ m = self.suffix_regex_comp.search(newsuffix)
+ if not m:
+ bb.warn("%s has a possible unknown suffix: %s" % (newpn, newsuffix))
+ return False
+
+ """
+ Not our package so ignore it
+ """
+ if oldpn != newpn:
+ return False
+
+ oldpv = self._modelate_version(oldpv)
+ newpv = self._modelate_version(newpv)
+
+ return bb.utils.vercmp(("0", oldpv, ""), ("0", newpv, ""))
+
+ def _fetch_index(self, uri, ud, d):
+ """
+ Run fetch checkstatus to get directory information
+ """
+ f = tempfile.NamedTemporaryFile()
+ with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
+ agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12"
+ fetchcmd = self.basecmd
+ fetchcmd += " -O " + f.name + " --user-agent='" + agent + "' '" + uri + "'"
+ try:
+ self._runwget(ud, d, fetchcmd, True, workdir=workdir)
+ fetchresult = f.read()
+ except bb.fetch2.BBFetchException:
+ fetchresult = ""
+
+ return fetchresult
+
+ def _check_latest_version(self, url, package, package_regex, current_version, ud, d):
+ """
+ Return the latest version of a package inside a given directory path
+ If error or no version, return ""
+ """
+ valid = 0
+ version = ['', '', '']
+
+ bb.debug(3, "VersionURL: %s" % (url))
+ soup = BeautifulSoup(self._fetch_index(url, ud, d), "html.parser", parse_only=SoupStrainer("a"))
+ if not soup:
+ bb.debug(3, "*** %s NO SOUP" % (url))
+ return ""
+
+ for line in soup.find_all('a', href=True):
+ bb.debug(3, "line['href'] = '%s'" % (line['href']))
+ bb.debug(3, "line = '%s'" % (str(line)))
+
+ newver = self._parse_path(package_regex, line['href'])
+ if not newver:
+ newver = self._parse_path(package_regex, str(line))
+
+ if newver:
+ bb.debug(3, "Upstream version found: %s" % newver[1])
+ if valid == 0:
+ version = newver
+ valid = 1
+ elif self._vercmp(version, newver) < 0:
+ version = newver
+
+ pupver = re.sub('_', '.', version[1])
+
+ bb.debug(3, "*** %s -> UpstreamVersion = %s (CurrentVersion = %s)" %
+ (package, pupver or "N/A", current_version[1]))
+
+ if valid:
+ return pupver
+
+ return ""
+
+ def _check_latest_version_by_dir(self, dirver, package, package_regex,
+ current_version, ud, d):
+ """
+ Scan every directory in order to get upstream version.
+ """
+ version_dir = ['', '', '']
+ version = ['', '', '']
+
+ dirver_regex = re.compile("(?P<pfx>\D*)(?P<ver>(\d+[\.\-_])+(\d+))")
+ s = dirver_regex.search(dirver)
+ if s:
+ version_dir[1] = s.group('ver')
+ else:
+ version_dir[1] = dirver
+
+ dirs_uri = bb.fetch.encodeurl([ud.type, ud.host,
+ ud.path.split(dirver)[0], ud.user, ud.pswd, {}])
+ bb.debug(3, "DirURL: %s, %s" % (dirs_uri, package))
+
+ soup = BeautifulSoup(self._fetch_index(dirs_uri, ud, d), "html.parser", parse_only=SoupStrainer("a"))
+ if not soup:
+ return version[1]
+
+ for line in soup.find_all('a', href=True):
+ s = dirver_regex.search(line['href'].strip("/"))
+ if s:
+ sver = s.group('ver')
+
+ # When prefix is part of the version directory it need to
+ # ensure that only version directory is used so remove previous
+ # directories if exists.
+ #
+ # Example: pfx = '/dir1/dir2/v' and version = '2.5' the expected
+ # result is v2.5.
+ spfx = s.group('pfx').split('/')[-1]
+
+ version_dir_new = ['', sver, '']
+ if self._vercmp(version_dir, version_dir_new) <= 0:
+ dirver_new = spfx + sver
+ path = ud.path.replace(dirver, dirver_new, True) \
+ .split(package)[0]
+ uri = bb.fetch.encodeurl([ud.type, ud.host, path,
+ ud.user, ud.pswd, {}])
+
+ pupver = self._check_latest_version(uri,
+ package, package_regex, current_version, ud, d)
+ if pupver:
+ version[1] = pupver
+
+ version_dir = version_dir_new
+
+ return version[1]
+
+ def _init_regexes(self, package, ud, d):
+ """
+ Match as many patterns as possible such as:
+ gnome-common-2.20.0.tar.gz (most common format)
+ gtk+-2.90.1.tar.gz
+ xf86-input-synaptics-12.6.9.tar.gz
+ dri2proto-2.3.tar.gz
+ blktool_4.orig.tar.gz
+ libid3tag-0.15.1b.tar.gz
+ unzip552.tar.gz
+ icu4c-3_6-src.tgz
+ genext2fs_1.3.orig.tar.gz
+ gst-fluendo-mp3
+ """
+ # match most patterns which uses "-" as separator to version digits
+ pn_prefix1 = "[a-zA-Z][a-zA-Z0-9]*([-_][a-zA-Z]\w+)*\+?[-_]"
+ # a loose pattern such as for unzip552.tar.gz
+ pn_prefix2 = "[a-zA-Z]+"
+ # a loose pattern such as for 80325-quicky-0.4.tar.gz
+ pn_prefix3 = "[0-9]+[-]?[a-zA-Z]+"
+ # Save the Package Name (pn) Regex for use later
+ pn_regex = "(%s|%s|%s)" % (pn_prefix1, pn_prefix2, pn_prefix3)
+
+ # match version
+ pver_regex = "(([A-Z]*\d+[a-zA-Z]*[\.\-_]*)+)"
+
+ # match arch
+ parch_regex = "-source|_all_"
+
+ # src.rpm extension was added only for rpm package. Can be removed if the rpm
+ # packaged will always be considered as having to be manually upgraded
+ psuffix_regex = "(tar\.gz|tgz|tar\.bz2|zip|xz|tar\.lz|rpm|bz2|orig\.tar\.gz|tar\.xz|src\.tar\.gz|src\.tgz|svnr\d+\.tar\.bz2|stable\.tar\.gz|src\.rpm)"
+
+ # match name, version and archive type of a package
+ package_regex_comp = re.compile("(?P<name>%s?\.?v?)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s$)"
+ % (pn_regex, pver_regex, parch_regex, psuffix_regex))
+ self.suffix_regex_comp = re.compile(psuffix_regex)
+
+ # compile regex, can be specific by package or generic regex
+ pn_regex = d.getVar('UPSTREAM_CHECK_REGEX')
+ if pn_regex:
+ package_custom_regex_comp = re.compile(pn_regex)
+ else:
+ version = self._parse_path(package_regex_comp, package)
+ if version:
+ package_custom_regex_comp = re.compile(
+ "(?P<name>%s)(?P<pver>%s)(?P<arch>%s)?[\.-](?P<type>%s)" %
+ (re.escape(version[0]), pver_regex, parch_regex, psuffix_regex))
+ else:
+ package_custom_regex_comp = None
+
+ return package_custom_regex_comp
+
+ def latest_versionstring(self, ud, d):
+ """
+ Manipulate the URL and try to obtain the latest package version
+
+ sanity check to ensure same name and type.
+ """
+ package = ud.path.split("/")[-1]
+ current_version = ['', d.getVar('PV'), '']
+
+ """possible to have no version in pkg name, such as spectrum-fw"""
+ if not re.search("\d+", package):
+ current_version[1] = re.sub('_', '.', current_version[1])
+ current_version[1] = re.sub('-', '.', current_version[1])
+ return (current_version[1], '')
+
+ package_regex = self._init_regexes(package, ud, d)
+ if package_regex is None:
+ bb.warn("latest_versionstring: package %s don't match pattern" % (package))
+ return ('', '')
+ bb.debug(3, "latest_versionstring, regex: %s" % (package_regex.pattern))
+
+ uri = ""
+ regex_uri = d.getVar("UPSTREAM_CHECK_URI")
+ if not regex_uri:
+ path = ud.path.split(package)[0]
+
+ # search for version matches on folders inside the path, like:
+ # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz
+ dirver_regex = re.compile("(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/")
+ m = dirver_regex.search(path)
+ if m:
+ pn = d.getVar('PN')
+ dirver = m.group('dirver')
+
+ dirver_pn_regex = re.compile("%s\d?" % (re.escape(pn)))
+ if not dirver_pn_regex.search(dirver):
+ return (self._check_latest_version_by_dir(dirver,
+ package, package_regex, current_version, ud, d), '')
+
+ uri = bb.fetch.encodeurl([ud.type, ud.host, path, ud.user, ud.pswd, {}])
+ else:
+ uri = regex_uri
+
+ return (self._check_latest_version(uri, package, package_regex,
+ current_version, ud, d), '')
diff --git a/poky/bitbake/lib/bb/main.py b/poky/bitbake/lib/bb/main.py
new file mode 100755
index 000000000..f4474e410
--- /dev/null
+++ b/poky/bitbake/lib/bb/main.py
@@ -0,0 +1,508 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import logging
+import optparse
+import warnings
+import fcntl
+import time
+import traceback
+
+import bb
+from bb import event
+import bb.msg
+from bb import cooker
+from bb import ui
+from bb import server
+from bb import cookerdata
+
+import bb.server.process
+import bb.server.xmlrpcclient
+
+logger = logging.getLogger("BitBake")
+
+class BBMainException(Exception):
+ pass
+
+class BBMainFatal(bb.BBHandledException):
+ pass
+
+def present_options(optionlist):
+ if len(optionlist) > 1:
+ return ' or '.join([', '.join(optionlist[:-1]), optionlist[-1]])
+ else:
+ return optionlist[0]
+
+class BitbakeHelpFormatter(optparse.IndentedHelpFormatter):
+ def format_option(self, option):
+ # We need to do this here rather than in the text we supply to
+ # add_option() because we don't want to call list_extension_modules()
+ # on every execution (since it imports all of the modules)
+ # Note also that we modify option.help rather than the returned text
+ # - this is so that we don't have to re-format the text ourselves
+ if option.dest == 'ui':
+ valid_uis = list_extension_modules(bb.ui, 'main')
+ option.help = option.help.replace('@CHOICES@', present_options(valid_uis))
+
+ return optparse.IndentedHelpFormatter.format_option(self, option)
+
+def list_extension_modules(pkg, checkattr):
+ """
+ Lists extension modules in a specific Python package
+ (e.g. UIs, servers). NOTE: Calling this function will import all of the
+ submodules of the specified module in order to check for the specified
+ attribute; this can have unusual side-effects. As a result, this should
+ only be called when displaying help text or error messages.
+ Parameters:
+ pkg: previously imported Python package to list
+ checkattr: attribute to look for in module to determine if it's valid
+ as the type of extension you are looking for
+ """
+ import pkgutil
+ pkgdir = os.path.dirname(pkg.__file__)
+
+ modules = []
+ for _, modulename, _ in pkgutil.iter_modules([pkgdir]):
+ if os.path.isdir(os.path.join(pkgdir, modulename)):
+ # ignore directories
+ continue
+ try:
+ module = __import__(pkg.__name__, fromlist=[modulename])
+ except:
+ # If we can't import it, it's not valid
+ continue
+ module_if = getattr(module, modulename)
+ if getattr(module_if, 'hidden_extension', False):
+ continue
+ if not checkattr or hasattr(module_if, checkattr):
+ modules.append(modulename)
+ return modules
+
+def import_extension_module(pkg, modulename, checkattr):
+ try:
+ # Dynamically load the UI based on the ui name. Although we
+ # suggest a fixed set this allows you to have flexibility in which
+ # ones are available.
+ module = __import__(pkg.__name__, fromlist=[modulename])
+ return getattr(module, modulename)
+ except AttributeError:
+ modules = present_options(list_extension_modules(pkg, checkattr))
+ raise BBMainException('FATAL: Unable to import extension module "%s" from %s. '
+ 'Valid extension modules: %s' % (modulename, pkg.__name__, modules))
+
+# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
+warnlog = logging.getLogger("BitBake.Warnings")
+_warnings_showwarning = warnings.showwarning
+def _showwarning(message, category, filename, lineno, file=None, line=None):
+ if file is not None:
+ if _warnings_showwarning is not None:
+ _warnings_showwarning(message, category, filename, lineno, file, line)
+ else:
+ s = warnings.formatwarning(message, category, filename, lineno)
+ warnlog.warning(s)
+
+warnings.showwarning = _showwarning
+warnings.filterwarnings("ignore")
+warnings.filterwarnings("default", module="(<string>$|(oe|bb)\.)")
+warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
+warnings.filterwarnings("ignore", category=ImportWarning)
+warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$")
+warnings.filterwarnings("ignore", message="With-statements now directly support multiple context managers")
+
+class BitBakeConfigParameters(cookerdata.ConfigParameters):
+
+ def parseCommandLine(self, argv=sys.argv):
+ parser = optparse.OptionParser(
+ formatter=BitbakeHelpFormatter(),
+ version="BitBake Build Tool Core version %s" % bb.__version__,
+ usage="""%prog [options] [recipename/target recipe:do_task ...]
+
+ Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
+ It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
+ will provide the layer, BBFILES and other configuration information.""")
+
+ parser.add_option("-b", "--buildfile", action="store", dest="buildfile", default=None,
+ help="Execute tasks from a specific .bb recipe directly. WARNING: Does "
+ "not handle any dependencies from other recipes.")
+
+ parser.add_option("-k", "--continue", action="store_false", dest="abort", default=True,
+ help="Continue as much as possible after an error. While the target that "
+ "failed and anything depending on it cannot be built, as much as "
+ "possible will be built before stopping.")
+
+ parser.add_option("-f", "--force", action="store_true", dest="force", default=False,
+ help="Force the specified targets/task to run (invalidating any "
+ "existing stamp file).")
+
+ parser.add_option("-c", "--cmd", action="store", dest="cmd",
+ help="Specify the task to execute. The exact options available "
+ "depend on the metadata. Some examples might be 'compile'"
+ " or 'populate_sysroot' or 'listtasks' may give a list of "
+ "the tasks available.")
+
+ parser.add_option("-C", "--clear-stamp", action="store", dest="invalidate_stamp",
+ help="Invalidate the stamp for the specified task such as 'compile' "
+ "and then run the default task for the specified target(s).")
+
+ parser.add_option("-r", "--read", action="append", dest="prefile", default=[],
+ help="Read the specified file before bitbake.conf.")
+
+ parser.add_option("-R", "--postread", action="append", dest="postfile", default=[],
+ help="Read the specified file after bitbake.conf.")
+
+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
+ help="Enable tracing of shell tasks (with 'set -x'). "
+ "Also print bb.note(...) messages to stdout (in "
+ "addition to writing them to ${T}/log.do_<task>).")
+
+ parser.add_option("-D", "--debug", action="count", dest="debug", default=0,
+ help="Increase the debug level. You can specify this "
+ "more than once. -D sets the debug level to 1, "
+ "where only bb.debug(1, ...) messages are printed "
+ "to stdout; -DD sets the debug level to 2, where "
+ "both bb.debug(1, ...) and bb.debug(2, ...) "
+ "messages are printed; etc. Without -D, no debug "
+ "messages are printed. Note that -D only affects "
+ "output to stdout. All debug messages are written "
+ "to ${T}/log.do_taskname, regardless of the debug "
+ "level.")
+
+ parser.add_option("-q", "--quiet", action="count", dest="quiet", default=0,
+ help="Output less log message data to the terminal. You can specify this more than once.")
+
+ parser.add_option("-n", "--dry-run", action="store_true", dest="dry_run", default=False,
+ help="Don't execute, just go through the motions.")
+
+ parser.add_option("-S", "--dump-signatures", action="append", dest="dump_signatures",
+ default=[], metavar="SIGNATURE_HANDLER",
+ help="Dump out the signature construction information, with no task "
+ "execution. The SIGNATURE_HANDLER parameter is passed to the "
+ "handler. Two common values are none and printdiff but the handler "
+ "may define more/less. none means only dump the signature, printdiff"
+ " means compare the dumped signature with the cached one.")
+
+ parser.add_option("-p", "--parse-only", action="store_true",
+ dest="parse_only", default=False,
+ help="Quit after parsing the BB recipes.")
+
+ parser.add_option("-s", "--show-versions", action="store_true",
+ dest="show_versions", default=False,
+ help="Show current and preferred versions of all recipes.")
+
+ parser.add_option("-e", "--environment", action="store_true",
+ dest="show_environment", default=False,
+ help="Show the global or per-recipe environment complete with information"
+ " about where variables were set/changed.")
+
+ parser.add_option("-g", "--graphviz", action="store_true", dest="dot_graph", default=False,
+ help="Save dependency tree information for the specified "
+ "targets in the dot syntax.")
+
+ parser.add_option("-I", "--ignore-deps", action="append",
+ dest="extra_assume_provided", default=[],
+ help="Assume these dependencies don't exist and are already provided "
+ "(equivalent to ASSUME_PROVIDED). Useful to make dependency "
+ "graphs more appealing")
+
+ parser.add_option("-l", "--log-domains", action="append", dest="debug_domains", default=[],
+ help="Show debug logging for the specified logging domains")
+
+ parser.add_option("-P", "--profile", action="store_true", dest="profile", default=False,
+ help="Profile the command and save reports.")
+
+ # @CHOICES@ is substituted out by BitbakeHelpFormatter above
+ parser.add_option("-u", "--ui", action="store", dest="ui",
+ default=os.environ.get('BITBAKE_UI', 'knotty'),
+ help="The user interface to use (@CHOICES@ - default %default).")
+
+ parser.add_option("", "--token", action="store", dest="xmlrpctoken",
+ default=os.environ.get("BBTOKEN"),
+ help="Specify the connection token to be used when connecting "
+ "to a remote server.")
+
+ parser.add_option("", "--revisions-changed", action="store_true",
+ dest="revisions_changed", default=False,
+ help="Set the exit code depending on whether upstream floating "
+ "revisions have changed or not.")
+
+ parser.add_option("", "--server-only", action="store_true",
+ dest="server_only", default=False,
+ help="Run bitbake without a UI, only starting a server "
+ "(cooker) process.")
+
+ parser.add_option("-B", "--bind", action="store", dest="bind", default=False,
+ help="The name/address for the bitbake xmlrpc server to bind to.")
+
+ parser.add_option("-T", "--idle-timeout", type=float, dest="server_timeout",
+ default=os.getenv("BB_SERVER_TIMEOUT"),
+ help="Set timeout to unload bitbake server due to inactivity, "
+ "set to -1 means no unload, "
+ "default: Environment variable BB_SERVER_TIMEOUT.")
+
+ parser.add_option("", "--no-setscene", action="store_true",
+ dest="nosetscene", default=False,
+ help="Do not run any setscene tasks. sstate will be ignored and "
+ "everything needed, built.")
+
+ parser.add_option("", "--setscene-only", action="store_true",
+ dest="setsceneonly", default=False,
+ help="Only run setscene tasks, don't run any real tasks.")
+
+ parser.add_option("", "--remote-server", action="store", dest="remote_server",
+ default=os.environ.get("BBSERVER"),
+ help="Connect to the specified server.")
+
+ parser.add_option("-m", "--kill-server", action="store_true",
+ dest="kill_server", default=False,
+ help="Terminate any running bitbake server.")
+
+ parser.add_option("", "--observe-only", action="store_true",
+ dest="observe_only", default=False,
+ help="Connect to a server as an observing-only client.")
+
+ parser.add_option("", "--status-only", action="store_true",
+ dest="status_only", default=False,
+ help="Check the status of the remote bitbake server.")
+
+ parser.add_option("-w", "--write-log", action="store", dest="writeeventlog",
+ default=os.environ.get("BBEVENTLOG"),
+ help="Writes the event log of the build to a bitbake event json file. "
+ "Use '' (empty string) to assign the name automatically.")
+
+ parser.add_option("", "--runall", action="append", dest="runall",
+ help="Run the specified task for any recipe in the taskgraph of the specified target (even if it wouldn't otherwise have run).")
+
+ parser.add_option("", "--runonly", action="append", dest="runonly",
+ help="Run only the specified task within the taskgraph of the specified targets (and any task dependencies those tasks may have).")
+
+
+ options, targets = parser.parse_args(argv)
+
+ if options.quiet and options.verbose:
+ parser.error("options --quiet and --verbose are mutually exclusive")
+
+ if options.quiet and options.debug:
+ parser.error("options --quiet and --debug are mutually exclusive")
+
+ # use configuration files from environment variables
+ if "BBPRECONF" in os.environ:
+ options.prefile.append(os.environ["BBPRECONF"])
+
+ if "BBPOSTCONF" in os.environ:
+ options.postfile.append(os.environ["BBPOSTCONF"])
+
+ # fill in proper log name if not supplied
+ if options.writeeventlog is not None and len(options.writeeventlog) == 0:
+ from datetime import datetime
+ eventlog = "bitbake_eventlog_%s.json" % datetime.now().strftime("%Y%m%d%H%M%S")
+ options.writeeventlog = eventlog
+
+ if options.bind:
+ try:
+ #Checking that the port is a number and is a ':' delimited value
+ (host, port) = options.bind.split(':')
+ port = int(port)
+ except (ValueError,IndexError):
+ raise BBMainException("FATAL: Malformed host:port bind parameter")
+ options.xmlrpcinterface = (host, port)
+ else:
+ options.xmlrpcinterface = (None, 0)
+
+ return options, targets[1:]
+
+
+def bitbake_main(configParams, configuration):
+
+ # Python multiprocessing requires /dev/shm on Linux
+ if sys.platform.startswith('linux') and not os.access('/dev/shm', os.W_OK | os.X_OK):
+ raise BBMainException("FATAL: /dev/shm does not exist or is not writable")
+
+ # Unbuffer stdout to avoid log truncation in the event
+ # of an unorderly exit as well as to provide timely
+ # updates to log files for use with tail
+ try:
+ if sys.stdout.name == '<stdout>':
+ # Reopen with O_SYNC (unbuffered)
+ fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
+ fl |= os.O_SYNC
+ fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl)
+ except:
+ pass
+
+ configuration.setConfigParameters(configParams)
+
+ if configParams.server_only and configParams.remote_server:
+ raise BBMainException("FATAL: The '--server-only' option conflicts with %s.\n" %
+ ("the BBSERVER environment variable" if "BBSERVER" in os.environ \
+ else "the '--remote-server' option"))
+
+ if configParams.observe_only and not (configParams.remote_server or configParams.bind):
+ raise BBMainException("FATAL: '--observe-only' can only be used by UI clients "
+ "connecting to a server.\n")
+
+ if "BBDEBUG" in os.environ:
+ level = int(os.environ["BBDEBUG"])
+ if level > configuration.debug:
+ configuration.debug = level
+
+ bb.msg.init_msgconfig(configParams.verbose, configuration.debug,
+ configuration.debug_domains)
+
+ server_connection, ui_module = setup_bitbake(configParams, configuration)
+ # No server connection
+ if server_connection is None:
+ if configParams.status_only:
+ return 1
+ if configParams.kill_server:
+ return 0
+
+ if not configParams.server_only:
+ if configParams.status_only:
+ server_connection.terminate()
+ return 0
+
+ try:
+ for event in bb.event.ui_queue:
+ server_connection.events.queue_event(event)
+ bb.event.ui_queue = []
+
+ return ui_module.main(server_connection.connection, server_connection.events,
+ configParams)
+ finally:
+ server_connection.terminate()
+ else:
+ return 0
+
+ return 1
+
+def setup_bitbake(configParams, configuration, extrafeatures=None):
+ # Ensure logging messages get sent to the UI as events
+ handler = bb.event.LogHandler()
+ if not configParams.status_only:
+ # In status only mode there are no logs and no UI
+ logger.addHandler(handler)
+
+ # Clear away any spurious environment variables while we stoke up the cooker
+ cleanedvars = bb.utils.clean_environment()
+
+ if configParams.server_only:
+ featureset = []
+ ui_module = None
+ else:
+ ui_module = import_extension_module(bb.ui, configParams.ui, 'main')
+ # Collect the feature set for the UI
+ featureset = getattr(ui_module, "featureSet", [])
+
+ if extrafeatures:
+ for feature in extrafeatures:
+ if not feature in featureset:
+ featureset.append(feature)
+
+ server_connection = None
+
+ if configParams.remote_server:
+ # Connect to a remote XMLRPC server
+ server_connection = bb.server.xmlrpcclient.connectXMLRPC(configParams.remote_server, featureset,
+ configParams.observe_only, configParams.xmlrpctoken)
+ else:
+ retries = 8
+ while retries:
+ try:
+ topdir, lock = lockBitbake()
+ sockname = topdir + "/bitbake.sock"
+ if lock:
+ if configParams.status_only or configParams.kill_server:
+ logger.info("bitbake server is not running.")
+ lock.close()
+ return None, None
+ # we start a server with a given configuration
+ logger.info("Starting bitbake server...")
+ # Clear the event queue since we already displayed messages
+ bb.event.ui_queue = []
+ server = bb.server.process.BitBakeServer(lock, sockname, configuration, featureset)
+
+ else:
+ logger.info("Reconnecting to bitbake server...")
+ if not os.path.exists(sockname):
+ print("Previous bitbake instance shutting down?, waiting to retry...")
+ i = 0
+ lock = None
+ # Wait for 5s or until we can get the lock
+ while not lock and i < 50:
+ time.sleep(0.1)
+ _, lock = lockBitbake()
+ i += 1
+ if lock:
+ bb.utils.unlockfile(lock)
+ raise bb.server.process.ProcessTimeout("Bitbake still shutting down as socket exists but no lock?")
+ if not configParams.server_only:
+ try:
+ server_connection = bb.server.process.connectProcessServer(sockname, featureset)
+ except EOFError:
+ # The server may have been shutting down but not closed the socket yet. If that happened,
+ # ignore it.
+ pass
+
+ if server_connection or configParams.server_only:
+ break
+ except BBMainFatal:
+ raise
+ except (Exception, bb.server.process.ProcessTimeout) as e:
+ if not retries:
+ raise
+ retries -= 1
+ if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError)):
+ logger.info("Retrying server connection...")
+ else:
+ logger.info("Retrying server connection... (%s)" % traceback.format_exc())
+ if not retries:
+ bb.fatal("Unable to connect to bitbake server, or start one")
+ if retries < 5:
+ time.sleep(5)
+
+ if configParams.kill_server:
+ server_connection.connection.terminateServer()
+ server_connection.terminate()
+ bb.event.ui_queue = []
+ logger.info("Terminated bitbake server.")
+ return None, None
+
+ # Restore the environment in case the UI needs it
+ for k in cleanedvars:
+ os.environ[k] = cleanedvars[k]
+
+ logger.removeHandler(handler)
+
+ return server_connection, ui_module
+
+def lockBitbake():
+ topdir = bb.cookerdata.findTopdir()
+ if not topdir:
+ bb.error("Unable to find conf/bblayers.conf or conf/bitbake.conf. BBAPTH is unset and/or not in a build directory?")
+ raise BBMainFatal
+ lockfile = topdir + "/bitbake.lock"
+ return topdir, bb.utils.lockfile(lockfile, False, False)
+
diff --git a/poky/bitbake/lib/bb/methodpool.py b/poky/bitbake/lib/bb/methodpool.py
new file mode 100644
index 000000000..49aed3338
--- /dev/null
+++ b/poky/bitbake/lib/bb/methodpool.py
@@ -0,0 +1,40 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+#
+# Copyright (C) 2006 Holger Hans Peter Freyther
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from bb.utils import better_compile, better_exec
+
+def insert_method(modulename, code, fn, lineno):
+ """
+ Add code of a module should be added. The methods
+ will be simply added, no checking will be done
+ """
+ comp = better_compile(code, modulename, fn, lineno=lineno)
+ better_exec(comp, None, code, fn)
+
+compilecache = {}
+
+def compile_cache(code):
+ h = hash(code)
+ if h in compilecache:
+ return compilecache[h]
+ return None
+
+def compile_cache_add(code, compileobj):
+ h = hash(code)
+ compilecache[h] = compileobj
diff --git a/poky/bitbake/lib/bb/monitordisk.py b/poky/bitbake/lib/bb/monitordisk.py
new file mode 100644
index 000000000..833cd3d34
--- /dev/null
+++ b/poky/bitbake/lib/bb/monitordisk.py
@@ -0,0 +1,268 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2012 Robert Yang
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os, logging, re, sys
+import bb
+logger = logging.getLogger("BitBake.Monitor")
+
+def printErr(info):
+ logger.error("%s\n Disk space monitor will NOT be enabled" % info)
+
+def convertGMK(unit):
+
+ """ Convert the space unit G, M, K, the unit is case-insensitive """
+
+ unitG = re.match('([1-9][0-9]*)[gG]\s?$', unit)
+ if unitG:
+ return int(unitG.group(1)) * (1024 ** 3)
+ unitM = re.match('([1-9][0-9]*)[mM]\s?$', unit)
+ if unitM:
+ return int(unitM.group(1)) * (1024 ** 2)
+ unitK = re.match('([1-9][0-9]*)[kK]\s?$', unit)
+ if unitK:
+ return int(unitK.group(1)) * 1024
+ unitN = re.match('([1-9][0-9]*)\s?$', unit)
+ if unitN:
+ return int(unitN.group(1))
+ else:
+ return None
+
+def getMountedDev(path):
+
+ """ Get the device mounted at the path, uses /proc/mounts """
+
+ # Get the mount point of the filesystem containing path
+ # st_dev is the ID of device containing file
+ parentDev = os.stat(path).st_dev
+ currentDev = parentDev
+ # When the current directory's device is different from the
+ # parent's, then the current directory is a mount point
+ while parentDev == currentDev:
+ mountPoint = path
+ # Use dirname to get the parent's directory
+ path = os.path.dirname(path)
+ # Reach the "/"
+ if path == mountPoint:
+ break
+ parentDev= os.stat(path).st_dev
+
+ try:
+ with open("/proc/mounts", "r") as ifp:
+ for line in ifp:
+ procLines = line.rstrip('\n').split()
+ if procLines[1] == mountPoint:
+ return procLines[0]
+ except EnvironmentError:
+ pass
+ return None
+
+def getDiskData(BBDirs, configuration):
+
+ """Prepare disk data for disk space monitor"""
+
+ # Save the device IDs, need the ID to be unique (the dictionary's key is
+ # unique), so that when more than one directory is located on the same
+ # device, we just monitor it once
+ devDict = {}
+ for pathSpaceInode in BBDirs.split():
+ # The input format is: "dir,space,inode", dir is a must, space
+ # and inode are optional
+ pathSpaceInodeRe = re.match('([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode)
+ if not pathSpaceInodeRe:
+ printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode)
+ return None
+
+ action = pathSpaceInodeRe.group(1)
+ if action not in ("ABORT", "STOPTASKS", "WARN"):
+ printErr("Unknown disk space monitor action: %s" % action)
+ return None
+
+ path = os.path.realpath(pathSpaceInodeRe.group(2))
+ if not path:
+ printErr("Invalid path value in BB_DISKMON_DIRS: %s" % pathSpaceInode)
+ return None
+
+ # The disk space or inode is optional, but it should have a correct
+ # value once it is specified
+ minSpace = pathSpaceInodeRe.group(3)
+ if minSpace:
+ minSpace = convertGMK(minSpace)
+ if not minSpace:
+ printErr("Invalid disk space value in BB_DISKMON_DIRS: %s" % pathSpaceInodeRe.group(3))
+ return None
+ else:
+ # None means that it is not specified
+ minSpace = None
+
+ minInode = pathSpaceInodeRe.group(4)
+ if minInode:
+ minInode = convertGMK(minInode)
+ if not minInode:
+ printErr("Invalid inode value in BB_DISKMON_DIRS: %s" % pathSpaceInodeRe.group(4))
+ return None
+ else:
+ # None means that it is not specified
+ minInode = None
+
+ if minSpace is None and minInode is None:
+ printErr("No disk space or inode value in found BB_DISKMON_DIRS: %s" % pathSpaceInode)
+ return None
+ # mkdir for the directory since it may not exist, for example the
+ # DL_DIR may not exist at the very beginning
+ if not os.path.exists(path):
+ bb.utils.mkdirhier(path)
+ dev = getMountedDev(path)
+ # Use path/action as the key
+ devDict[(path, action)] = [dev, minSpace, minInode]
+
+ return devDict
+
+def getInterval(configuration):
+
+ """ Get the disk space interval """
+
+ # The default value is 50M and 5K.
+ spaceDefault = 50 * 1024 * 1024
+ inodeDefault = 5 * 1024
+
+ interval = configuration.getVar("BB_DISKMON_WARNINTERVAL")
+ if not interval:
+ return spaceDefault, inodeDefault
+ else:
+ # The disk space or inode interval is optional, but it should
+ # have a correct value once it is specified
+ intervalRe = re.match('([^,]*),?\s*(.*)', interval)
+ if intervalRe:
+ intervalSpace = intervalRe.group(1)
+ if intervalSpace:
+ intervalSpace = convertGMK(intervalSpace)
+ if not intervalSpace:
+ printErr("Invalid disk space interval value in BB_DISKMON_WARNINTERVAL: %s" % intervalRe.group(1))
+ return None, None
+ else:
+ intervalSpace = spaceDefault
+ intervalInode = intervalRe.group(2)
+ if intervalInode:
+ intervalInode = convertGMK(intervalInode)
+ if not intervalInode:
+ printErr("Invalid disk inode interval value in BB_DISKMON_WARNINTERVAL: %s" % intervalRe.group(2))
+ return None, None
+ else:
+ intervalInode = inodeDefault
+ return intervalSpace, intervalInode
+ else:
+ printErr("Invalid interval value in BB_DISKMON_WARNINTERVAL: %s" % interval)
+ return None, None
+
+class diskMonitor:
+
+ """Prepare the disk space monitor data"""
+
+ def __init__(self, configuration):
+
+ self.enableMonitor = False
+ self.configuration = configuration
+
+ BBDirs = configuration.getVar("BB_DISKMON_DIRS") or None
+ if BBDirs:
+ self.devDict = getDiskData(BBDirs, configuration)
+ if self.devDict:
+ self.spaceInterval, self.inodeInterval = getInterval(configuration)
+ if self.spaceInterval and self.inodeInterval:
+ self.enableMonitor = True
+ # These are for saving the previous disk free space and inode, we
+ # use them to avoid printing too many warning messages
+ self.preFreeS = {}
+ self.preFreeI = {}
+ # This is for STOPTASKS and ABORT, to avoid printing the message
+ # repeatedly while waiting for the tasks to finish
+ self.checked = {}
+ for k in self.devDict:
+ self.preFreeS[k] = 0
+ self.preFreeI[k] = 0
+ self.checked[k] = False
+ if self.spaceInterval is None and self.inodeInterval is None:
+ self.enableMonitor = False
+
+ def check(self, rq):
+
+ """ Take action for the monitor """
+
+ if self.enableMonitor:
+ diskUsage = {}
+ for k, attributes in self.devDict.items():
+ path, action = k
+ dev, minSpace, minInode = attributes
+
+ st = os.statvfs(path)
+
+ # The available free space, integer number
+ freeSpace = st.f_bavail * st.f_frsize
+
+ # Send all relevant information in the event.
+ freeSpaceRoot = st.f_bfree * st.f_frsize
+ totalSpace = st.f_blocks * st.f_frsize
+ diskUsage[dev] = bb.event.DiskUsageSample(freeSpace, freeSpaceRoot, totalSpace)
+
+ if minSpace and freeSpace < minSpace:
+ # Always show warning, the self.checked would always be False if the action is WARN
+ if self.preFreeS[k] == 0 or self.preFreeS[k] - freeSpace > self.spaceInterval and not self.checked[k]:
+ logger.warning("The free space of %s (%s) is running low (%.3fGB left)" % \
+ (path, dev, freeSpace / 1024 / 1024 / 1024.0))
+ self.preFreeS[k] = freeSpace
+
+ if action == "STOPTASKS" and not self.checked[k]:
+ logger.error("No new tasks can be executed since the disk space monitor action is \"STOPTASKS\"!")
+ self.checked[k] = True
+ rq.finish_runqueue(False)
+ bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
+ elif action == "ABORT" and not self.checked[k]:
+ logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
+ self.checked[k] = True
+ rq.finish_runqueue(True)
+ bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, path), self.configuration)
+
+ # The free inodes, integer number
+ freeInode = st.f_favail
+
+ if minInode and freeInode < minInode:
+ # Some filesystems use dynamic inodes so can't run out
+ # (e.g. btrfs). This is reported by the inode count being 0.
+ if st.f_files == 0:
+ self.devDict[k][2] = None
+ continue
+ # Always show warning, the self.checked would always be False if the action is WARN
+ if self.preFreeI[k] == 0 or self.preFreeI[k] - freeInode > self.inodeInterval and not self.checked[k]:
+ logger.warning("The free inode of %s (%s) is running low (%.3fK left)" % \
+ (path, dev, freeInode / 1024.0))
+ self.preFreeI[k] = freeInode
+
+ if action == "STOPTASKS" and not self.checked[k]:
+ logger.error("No new tasks can be executed since the disk space monitor action is \"STOPTASKS\"!")
+ self.checked[k] = True
+ rq.finish_runqueue(False)
+ bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)
+ elif action == "ABORT" and not self.checked[k]:
+ logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
+ self.checked[k] = True
+ rq.finish_runqueue(True)
+ bb.event.fire(bb.event.DiskFull(dev, 'inode', freeInode, path), self.configuration)
+
+ bb.event.fire(bb.event.MonitorDiskEvent(diskUsage), self.configuration)
+ return
diff --git a/poky/bitbake/lib/bb/msg.py b/poky/bitbake/lib/bb/msg.py
new file mode 100644
index 000000000..f1723be79
--- /dev/null
+++ b/poky/bitbake/lib/bb/msg.py
@@ -0,0 +1,225 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'msg' implementation
+
+Message handling infrastructure for bitbake
+
+"""
+
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import copy
+import logging
+import collections
+from itertools import groupby
+import warnings
+import bb
+import bb.event
+
+class BBLogFormatter(logging.Formatter):
+ """Formatter which ensures that our 'plain' messages (logging.INFO + 1) are used as is"""
+
+ DEBUG3 = logging.DEBUG - 2
+ DEBUG2 = logging.DEBUG - 1
+ DEBUG = logging.DEBUG
+ VERBOSE = logging.INFO - 1
+ NOTE = logging.INFO
+ PLAIN = logging.INFO + 1
+ ERROR = logging.ERROR
+ WARNING = logging.WARNING
+ CRITICAL = logging.CRITICAL
+
+ levelnames = {
+ DEBUG3 : 'DEBUG',
+ DEBUG2 : 'DEBUG',
+ DEBUG : 'DEBUG',
+ VERBOSE: 'NOTE',
+ NOTE : 'NOTE',
+ PLAIN : '',
+ WARNING : 'WARNING',
+ ERROR : 'ERROR',
+ CRITICAL: 'ERROR',
+ }
+
+ color_enabled = False
+ BASECOLOR, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = list(range(29,38))
+
+ COLORS = {
+ DEBUG3 : CYAN,
+ DEBUG2 : CYAN,
+ DEBUG : CYAN,
+ VERBOSE : BASECOLOR,
+ NOTE : BASECOLOR,
+ PLAIN : BASECOLOR,
+ WARNING : YELLOW,
+ ERROR : RED,
+ CRITICAL: RED,
+ }
+
+ BLD = '\033[1;%dm'
+ STD = '\033[%dm'
+ RST = '\033[0m'
+
+ def getLevelName(self, levelno):
+ try:
+ return self.levelnames[levelno]
+ except KeyError:
+ self.levelnames[levelno] = value = 'Level %d' % levelno
+ return value
+
+ def format(self, record):
+ record.levelname = self.getLevelName(record.levelno)
+ if record.levelno == self.PLAIN:
+ msg = record.getMessage()
+ else:
+ if self.color_enabled:
+ record = self.colorize(record)
+ msg = logging.Formatter.format(self, record)
+ if hasattr(record, 'bb_exc_formatted'):
+ msg += '\n' + ''.join(record.bb_exc_formatted)
+ elif hasattr(record, 'bb_exc_info'):
+ etype, value, tb = record.bb_exc_info
+ formatted = bb.exceptions.format_exception(etype, value, tb, limit=5)
+ msg += '\n' + ''.join(formatted)
+ return msg
+
+ def colorize(self, record):
+ color = self.COLORS[record.levelno]
+ if self.color_enabled and color is not None:
+ record = copy.copy(record)
+ record.levelname = "".join([self.BLD % color, record.levelname, self.RST])
+ record.msg = "".join([self.STD % color, record.msg, self.RST])
+ return record
+
+ def enable_color(self):
+ self.color_enabled = True
+
+class BBLogFilter(object):
+ def __init__(self, handler, level, debug_domains):
+ self.stdlevel = level
+ self.debug_domains = debug_domains
+ loglevel = level
+ for domain in debug_domains:
+ if debug_domains[domain] < loglevel:
+ loglevel = debug_domains[domain]
+ handler.setLevel(loglevel)
+ handler.addFilter(self)
+
+ def filter(self, record):
+ if record.levelno >= self.stdlevel:
+ return True
+ if record.name in self.debug_domains and record.levelno >= self.debug_domains[record.name]:
+ return True
+ return False
+
+class BBLogFilterStdErr(BBLogFilter):
+ def filter(self, record):
+ if not BBLogFilter.filter(self, record):
+ return False
+ if record.levelno >= logging.ERROR:
+ return True
+ return False
+
+class BBLogFilterStdOut(BBLogFilter):
+ def filter(self, record):
+ if not BBLogFilter.filter(self, record):
+ return False
+ if record.levelno < logging.ERROR:
+ return True
+ return False
+
+# Message control functions
+#
+
+loggerDefaultDebugLevel = 0
+loggerDefaultVerbose = False
+loggerVerboseLogs = False
+loggerDefaultDomains = []
+
+def init_msgconfig(verbose, debug, debug_domains=None):
+ """
+ Set default verbosity and debug levels config the logger
+ """
+ bb.msg.loggerDefaultDebugLevel = debug
+ bb.msg.loggerDefaultVerbose = verbose
+ if verbose:
+ bb.msg.loggerVerboseLogs = True
+ if debug_domains:
+ bb.msg.loggerDefaultDomains = debug_domains
+ else:
+ bb.msg.loggerDefaultDomains = []
+
+def constructLogOptions():
+ debug = loggerDefaultDebugLevel
+ verbose = loggerDefaultVerbose
+ domains = loggerDefaultDomains
+
+ if debug:
+ level = BBLogFormatter.DEBUG - debug + 1
+ elif verbose:
+ level = BBLogFormatter.VERBOSE
+ else:
+ level = BBLogFormatter.NOTE
+
+ debug_domains = {}
+ for (domainarg, iterator) in groupby(domains):
+ dlevel = len(tuple(iterator))
+ debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
+ return level, debug_domains
+
+def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None):
+ level, debug_domains = constructLogOptions()
+
+ if forcelevel is not None:
+ level = forcelevel
+
+ cls(handler, level, debug_domains)
+
+#
+# Message handling functions
+#
+
+def fatal(msgdomain, msg):
+ if msgdomain:
+ logger = logging.getLogger("BitBake.%s" % msgdomain)
+ else:
+ logger = logging.getLogger("BitBake")
+ logger.critical(msg)
+ sys.exit(1)
+
+def logger_create(name, output=sys.stderr, level=logging.INFO, preserve_handlers=False, color='auto'):
+ """Standalone logger creation function"""
+ logger = logging.getLogger(name)
+ console = logging.StreamHandler(output)
+ format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ if color == 'always' or (color == 'auto' and output.isatty()):
+ format.enable_color()
+ console.setFormatter(format)
+ if preserve_handlers:
+ logger.addHandler(console)
+ else:
+ logger.handlers = [console]
+ logger.setLevel(level)
+ return logger
+
+def has_console_handler(logger):
+ for handler in logger.handlers:
+ if isinstance(handler, logging.StreamHandler):
+ if handler.stream in [sys.stderr, sys.stdout]:
+ return True
+ return False
diff --git a/poky/bitbake/lib/bb/namedtuple_with_abc.py b/poky/bitbake/lib/bb/namedtuple_with_abc.py
new file mode 100644
index 000000000..32f2fc642
--- /dev/null
+++ b/poky/bitbake/lib/bb/namedtuple_with_abc.py
@@ -0,0 +1,255 @@
+# http://code.activestate.com/recipes/577629-namedtupleabc-abstract-base-class-mix-in-for-named/
+#!/usr/bin/env python
+# Copyright (c) 2011 Jan Kaliszewski (zuo). Available under the MIT License.
+
+"""
+namedtuple_with_abc.py:
+* named tuple mix-in + ABC (abstract base class) recipe,
+* works under Python 2.6, 2.7 as well as 3.x.
+
+Import this module to patch collections.namedtuple() factory function
+-- enriching it with the 'abc' attribute (an abstract base class + mix-in
+for named tuples) and decorating it with a wrapper that registers each
+newly created named tuple as a subclass of namedtuple.abc.
+
+How to import:
+ import collections, namedtuple_with_abc
+or:
+ import namedtuple_with_abc
+ from collections import namedtuple
+ # ^ in this variant you must import namedtuple function
+ # *after* importing namedtuple_with_abc module
+or simply:
+ from namedtuple_with_abc import namedtuple
+
+Simple usage example:
+ class Credentials(namedtuple.abc):
+ _fields = 'username password'
+ def __str__(self):
+ return ('{0.__class__.__name__}'
+ '(username={0.username}, password=...)'.format(self))
+ print(Credentials("alice", "Alice's password"))
+
+For more advanced examples -- see below the "if __name__ == '__main__':".
+"""
+
+import collections
+from abc import ABCMeta, abstractproperty
+from functools import wraps
+from sys import version_info
+
+__all__ = ('namedtuple',)
+_namedtuple = collections.namedtuple
+
+
+class _NamedTupleABCMeta(ABCMeta):
+ '''The metaclass for the abstract base class + mix-in for named tuples.'''
+ def __new__(mcls, name, bases, namespace):
+ fields = namespace.get('_fields')
+ for base in bases:
+ if fields is not None:
+ break
+ fields = getattr(base, '_fields', None)
+ if not isinstance(fields, abstractproperty):
+ basetuple = _namedtuple(name, fields)
+ bases = (basetuple,) + bases
+ namespace.pop('_fields', None)
+ namespace.setdefault('__doc__', basetuple.__doc__)
+ namespace.setdefault('__slots__', ())
+ return ABCMeta.__new__(mcls, name, bases, namespace)
+
+
+exec(
+ # Python 2.x metaclass declaration syntax
+ """class _NamedTupleABC(object):
+ '''The abstract base class + mix-in for named tuples.'''
+ __metaclass__ = _NamedTupleABCMeta
+ _fields = abstractproperty()""" if version_info[0] < 3 else
+ # Python 3.x metaclass declaration syntax
+ """class _NamedTupleABC(metaclass=_NamedTupleABCMeta):
+ '''The abstract base class + mix-in for named tuples.'''
+ _fields = abstractproperty()"""
+)
+
+
+_namedtuple.abc = _NamedTupleABC
+#_NamedTupleABC.register(type(version_info)) # (and similar, in the future...)
+
+@wraps(_namedtuple)
+def namedtuple(*args, **kwargs):
+ '''Named tuple factory with namedtuple.abc subclass registration.'''
+ cls = _namedtuple(*args, **kwargs)
+ _NamedTupleABC.register(cls)
+ return cls
+
+collections.namedtuple = namedtuple
+
+
+
+
+if __name__ == '__main__':
+
+ '''Examples and explanations'''
+
+ # Simple usage
+
+ class MyRecord(namedtuple.abc):
+ _fields = 'x y z' # such form will be transformed into ('x', 'y', 'z')
+ def _my_custom_method(self):
+ return list(self._asdict().items())
+ # (the '_fields' attribute belongs to the named tuple public API anyway)
+
+ rec = MyRecord(1, 2, 3)
+ print(rec)
+ print(rec._my_custom_method())
+ print(rec._replace(y=222))
+ print(rec._replace(y=222)._my_custom_method())
+
+ # Custom abstract classes...
+
+ class MyAbstractRecord(namedtuple.abc):
+ def _my_custom_method(self):
+ return list(self._asdict().items())
+
+ try:
+ MyAbstractRecord() # (abstract classes cannot be instantiated)
+ except TypeError as exc:
+ print(exc)
+
+ class AnotherAbstractRecord(MyAbstractRecord):
+ def __str__(self):
+ return '<<<{0}>>>'.format(super(AnotherAbstractRecord,
+ self).__str__())
+
+ # ...and their non-abstract subclasses
+
+ class MyRecord2(MyAbstractRecord):
+ _fields = 'a, b'
+
+ class MyRecord3(AnotherAbstractRecord):
+ _fields = 'p', 'q', 'r'
+
+ rec2 = MyRecord2('foo', 'bar')
+ print(rec2)
+ print(rec2._my_custom_method())
+ print(rec2._replace(b=222))
+ print(rec2._replace(b=222)._my_custom_method())
+
+ rec3 = MyRecord3('foo', 'bar', 'baz')
+ print(rec3)
+ print(rec3._my_custom_method())
+ print(rec3._replace(q=222))
+ print(rec3._replace(q=222)._my_custom_method())
+
+ # You can also subclass non-abstract ones...
+
+ class MyRecord33(MyRecord3):
+ def __str__(self):
+ return '< {0!r}, ..., {0!r} >'.format(self.p, self.r)
+
+ rec33 = MyRecord33('foo', 'bar', 'baz')
+ print(rec33)
+ print(rec33._my_custom_method())
+ print(rec33._replace(q=222))
+ print(rec33._replace(q=222)._my_custom_method())
+
+ # ...and even override the magic '_fields' attribute again
+
+ class MyRecord345(MyRecord3):
+ _fields = 'e f g h i j k'
+
+ rec345 = MyRecord345(1, 2, 3, 4, 3, 2, 1)
+ print(rec345)
+ print(rec345._my_custom_method())
+ print(rec345._replace(f=222))
+ print(rec345._replace(f=222)._my_custom_method())
+
+ # Mixing-in some other classes is also possible:
+
+ class MyMixIn(object):
+ def method(self):
+ return "MyMixIn.method() called"
+ def _my_custom_method(self):
+ return "MyMixIn._my_custom_method() called"
+ def count(self, item):
+ return "MyMixIn.count({0}) called".format(item)
+ def _asdict(self): # (cannot override a namedtuple method, see below)
+ return "MyMixIn._asdict() called"
+
+ class MyRecord4(MyRecord33, MyMixIn): # mix-in on the right
+ _fields = 'j k l x'
+
+ class MyRecord5(MyMixIn, MyRecord33): # mix-in on the left
+ _fields = 'j k l x y'
+
+ rec4 = MyRecord4(1, 2, 3, 2)
+ print(rec4)
+ print(rec4.method())
+ print(rec4._my_custom_method()) # MyRecord33's
+ print(rec4.count(2)) # tuple's
+ print(rec4._replace(k=222))
+ print(rec4._replace(k=222).method())
+ print(rec4._replace(k=222)._my_custom_method()) # MyRecord33's
+ print(rec4._replace(k=222).count(8)) # tuple's
+
+ rec5 = MyRecord5(1, 2, 3, 2, 1)
+ print(rec5)
+ print(rec5.method())
+ print(rec5._my_custom_method()) # MyMixIn's
+ print(rec5.count(2)) # MyMixIn's
+ print(rec5._replace(k=222))
+ print(rec5._replace(k=222).method())
+ print(rec5._replace(k=222)._my_custom_method()) # MyMixIn's
+ print(rec5._replace(k=222).count(2)) # MyMixIn's
+
+ # Note that behavior: the standard namedtuple methods cannot be
+ # overridden by a foreign mix-in -- even if the mix-in is declared
+ # as the leftmost base class (but, obviously, you can override them
+ # in the defined class or its subclasses):
+
+ print(rec4._asdict()) # (returns a dict, not "MyMixIn._asdict() called")
+ print(rec5._asdict()) # (returns a dict, not "MyMixIn._asdict() called")
+
+ class MyRecord6(MyRecord33):
+ _fields = 'j k l x y z'
+ def _asdict(self):
+ return "MyRecord6._asdict() called"
+ rec6 = MyRecord6(1, 2, 3, 1, 2, 3)
+ print(rec6._asdict()) # (this returns "MyRecord6._asdict() called")
+
+ # All that record classes are real subclasses of namedtuple.abc:
+
+ assert issubclass(MyRecord, namedtuple.abc)
+ assert issubclass(MyAbstractRecord, namedtuple.abc)
+ assert issubclass(AnotherAbstractRecord, namedtuple.abc)
+ assert issubclass(MyRecord2, namedtuple.abc)
+ assert issubclass(MyRecord3, namedtuple.abc)
+ assert issubclass(MyRecord33, namedtuple.abc)
+ assert issubclass(MyRecord345, namedtuple.abc)
+ assert issubclass(MyRecord4, namedtuple.abc)
+ assert issubclass(MyRecord5, namedtuple.abc)
+ assert issubclass(MyRecord6, namedtuple.abc)
+
+ # ...but abstract ones are not subclasses of tuple
+ # (and this is what you probably want):
+
+ assert not issubclass(MyAbstractRecord, tuple)
+ assert not issubclass(AnotherAbstractRecord, tuple)
+
+ assert issubclass(MyRecord, tuple)
+ assert issubclass(MyRecord2, tuple)
+ assert issubclass(MyRecord3, tuple)
+ assert issubclass(MyRecord33, tuple)
+ assert issubclass(MyRecord345, tuple)
+ assert issubclass(MyRecord4, tuple)
+ assert issubclass(MyRecord5, tuple)
+ assert issubclass(MyRecord6, tuple)
+
+ # Named tuple classes created with namedtuple() factory function
+ # (in the "traditional" way) are registered as "virtual" subclasses
+ # of namedtuple.abc:
+
+ MyTuple = namedtuple('MyTuple', 'a b c')
+ mt = MyTuple(1, 2, 3)
+ assert issubclass(MyTuple, namedtuple.abc)
+ assert isinstance(mt, namedtuple.abc)
diff --git a/poky/bitbake/lib/bb/parse/__init__.py b/poky/bitbake/lib/bb/parse/__init__.py
new file mode 100644
index 000000000..5397d57a5
--- /dev/null
+++ b/poky/bitbake/lib/bb/parse/__init__.py
@@ -0,0 +1,175 @@
+"""
+BitBake Parsers
+
+File parsers for the BitBake build tools.
+
+"""
+
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+handlers = []
+
+import errno
+import logging
+import os
+import stat
+import bb
+import bb.utils
+import bb.siggen
+
+logger = logging.getLogger("BitBake.Parsing")
+
+class ParseError(Exception):
+ """Exception raised when parsing fails"""
+ def __init__(self, msg, filename, lineno=0):
+ self.msg = msg
+ self.filename = filename
+ self.lineno = lineno
+ Exception.__init__(self, msg, filename, lineno)
+
+ def __str__(self):
+ if self.lineno:
+ return "ParseError at %s:%d: %s" % (self.filename, self.lineno, self.msg)
+ else:
+ return "ParseError in %s: %s" % (self.filename, self.msg)
+
+class SkipRecipe(Exception):
+ """Exception raised to skip this recipe"""
+
+class SkipPackage(SkipRecipe):
+ """Exception raised to skip this recipe (use SkipRecipe in new code)"""
+
+__mtime_cache = {}
+def cached_mtime(f):
+ if f not in __mtime_cache:
+ __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
+ return __mtime_cache[f]
+
+def cached_mtime_noerror(f):
+ if f not in __mtime_cache:
+ try:
+ __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
+ except OSError:
+ return 0
+ return __mtime_cache[f]
+
+def update_mtime(f):
+ try:
+ __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
+ except OSError:
+ if f in __mtime_cache:
+ del __mtime_cache[f]
+ return 0
+ return __mtime_cache[f]
+
+def update_cache(f):
+ if f in __mtime_cache:
+ logger.debug(1, "Updating mtime cache for %s" % f)
+ update_mtime(f)
+
+def clear_cache():
+ global __mtime_cache
+ __mtime_cache = {}
+
+def mark_dependency(d, f):
+ if f.startswith('./'):
+ f = "%s/%s" % (os.getcwd(), f[2:])
+ deps = (d.getVar('__depends', False) or [])
+ s = (f, cached_mtime_noerror(f))
+ if s not in deps:
+ deps.append(s)
+ d.setVar('__depends', deps)
+
+def check_dependency(d, f):
+ s = (f, cached_mtime_noerror(f))
+ deps = (d.getVar('__depends', False) or [])
+ return s in deps
+
+def supports(fn, data):
+ """Returns true if we have a handler for this file, false otherwise"""
+ for h in handlers:
+ if h['supports'](fn, data):
+ return 1
+ return 0
+
+def handle(fn, data, include = 0):
+ """Call the handler that is appropriate for this file"""
+ for h in handlers:
+ if h['supports'](fn, data):
+ with data.inchistory.include(fn):
+ return h['handle'](fn, data, include)
+ raise ParseError("not a BitBake file", fn)
+
+def init(fn, data):
+ for h in handlers:
+ if h['supports'](fn):
+ return h['init'](data)
+
+def init_parser(d):
+ bb.parse.siggen = bb.siggen.init(d)
+
+def resolve_file(fn, d):
+ if not os.path.isabs(fn):
+ bbpath = d.getVar("BBPATH")
+ newfn, attempts = bb.utils.which(bbpath, fn, history=True)
+ for af in attempts:
+ mark_dependency(d, af)
+ if not newfn:
+ raise IOError(errno.ENOENT, "file %s not found in %s" % (fn, bbpath))
+ fn = newfn
+ else:
+ mark_dependency(d, fn)
+
+ if not os.path.isfile(fn):
+ raise IOError(errno.ENOENT, "file %s not found" % fn)
+
+ return fn
+
+# Used by OpenEmbedded metadata
+__pkgsplit_cache__={}
+def vars_from_file(mypkg, d):
+ if not mypkg or not mypkg.endswith((".bb", ".bbappend")):
+ return (None, None, None)
+ if mypkg in __pkgsplit_cache__:
+ return __pkgsplit_cache__[mypkg]
+
+ myfile = os.path.splitext(os.path.basename(mypkg))
+ parts = myfile[0].split('_')
+ __pkgsplit_cache__[mypkg] = parts
+ if len(parts) > 3:
+ raise ParseError("Unable to generate default variables from filename (too many underscores)", mypkg)
+ exp = 3 - len(parts)
+ tmplist = []
+ while exp != 0:
+ exp -= 1
+ tmplist.append(None)
+ parts.extend(tmplist)
+ return parts
+
+def get_file_depends(d):
+ '''Return the dependent files'''
+ dep_files = []
+ depends = d.getVar('__base_depends', False) or []
+ depends = depends + (d.getVar('__depends', False) or [])
+ for (fn, _) in depends:
+ dep_files.append(os.path.abspath(fn))
+ return " ".join(dep_files)
+
+from bb.parse.parse_py import __version__, ConfHandler, BBHandler
diff --git a/poky/bitbake/lib/bb/parse/ast.py b/poky/bitbake/lib/bb/parse/ast.py
new file mode 100644
index 000000000..6690dc51c
--- /dev/null
+++ b/poky/bitbake/lib/bb/parse/ast.py
@@ -0,0 +1,442 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+ AbstractSyntaxTree classes for the Bitbake language
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2009 Holger Hans Peter Freyther
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import re
+import string
+import logging
+import bb
+import itertools
+from bb import methodpool
+from bb.parse import logger
+
+class StatementGroup(list):
+ def eval(self, data):
+ for statement in self:
+ statement.eval(data)
+
+class AstNode(object):
+ def __init__(self, filename, lineno):
+ self.filename = filename
+ self.lineno = lineno
+
+class IncludeNode(AstNode):
+ def __init__(self, filename, lineno, what_file, force):
+ AstNode.__init__(self, filename, lineno)
+ self.what_file = what_file
+ self.force = force
+
+ def eval(self, data):
+ """
+ Include the file and evaluate the statements
+ """
+ s = data.expand(self.what_file)
+ logger.debug(2, "CONF %s:%s: including %s", self.filename, self.lineno, s)
+
+ # TODO: Cache those includes... maybe not here though
+ if self.force:
+ bb.parse.ConfHandler.include(self.filename, s, self.lineno, data, "include required")
+ else:
+ bb.parse.ConfHandler.include(self.filename, s, self.lineno, data, False)
+
+class ExportNode(AstNode):
+ def __init__(self, filename, lineno, var):
+ AstNode.__init__(self, filename, lineno)
+ self.var = var
+
+ def eval(self, data):
+ data.setVarFlag(self.var, "export", 1, op = 'exported')
+
+class UnsetNode(AstNode):
+ def __init__(self, filename, lineno, var):
+ AstNode.__init__(self, filename, lineno)
+ self.var = var
+
+ def eval(self, data):
+ loginfo = {
+ 'variable': self.var,
+ 'file': self.filename,
+ 'line': self.lineno,
+ }
+ data.delVar(self.var,**loginfo)
+
+class UnsetFlagNode(AstNode):
+ def __init__(self, filename, lineno, var, flag):
+ AstNode.__init__(self, filename, lineno)
+ self.var = var
+ self.flag = flag
+
+ def eval(self, data):
+ loginfo = {
+ 'variable': self.var,
+ 'file': self.filename,
+ 'line': self.lineno,
+ }
+ data.delVarFlag(self.var, self.flag, **loginfo)
+
+class DataNode(AstNode):
+ """
+ Various data related updates. For the sake of sanity
+ we have one class doing all this. This means that all
+ this need to be re-evaluated... we might be able to do
+ that faster with multiple classes.
+ """
+ def __init__(self, filename, lineno, groupd):
+ AstNode.__init__(self, filename, lineno)
+ self.groupd = groupd
+
+ def getFunc(self, key, data):
+ if 'flag' in self.groupd and self.groupd['flag'] != None:
+ return data.getVarFlag(key, self.groupd['flag'], expand=False, noweakdefault=True)
+ else:
+ return data.getVar(key, False, noweakdefault=True, parsing=True)
+
+ def eval(self, data):
+ groupd = self.groupd
+ key = groupd["var"]
+ loginfo = {
+ 'variable': key,
+ 'file': self.filename,
+ 'line': self.lineno,
+ }
+ if "exp" in groupd and groupd["exp"] != None:
+ data.setVarFlag(key, "export", 1, op = 'exported', **loginfo)
+
+ op = "set"
+ if "ques" in groupd and groupd["ques"] != None:
+ val = self.getFunc(key, data)
+ op = "set?"
+ if val == None:
+ val = groupd["value"]
+ elif "colon" in groupd and groupd["colon"] != None:
+ e = data.createCopy()
+ op = "immediate"
+ val = e.expand(groupd["value"], key + "[:=]")
+ elif "append" in groupd and groupd["append"] != None:
+ op = "append"
+ val = "%s %s" % ((self.getFunc(key, data) or ""), groupd["value"])
+ elif "prepend" in groupd and groupd["prepend"] != None:
+ op = "prepend"
+ val = "%s %s" % (groupd["value"], (self.getFunc(key, data) or ""))
+ elif "postdot" in groupd and groupd["postdot"] != None:
+ op = "postdot"
+ val = "%s%s" % ((self.getFunc(key, data) or ""), groupd["value"])
+ elif "predot" in groupd and groupd["predot"] != None:
+ op = "predot"
+ val = "%s%s" % (groupd["value"], (self.getFunc(key, data) or ""))
+ else:
+ val = groupd["value"]
+
+ flag = None
+ if 'flag' in groupd and groupd['flag'] != None:
+ flag = groupd['flag']
+ elif groupd["lazyques"]:
+ flag = "_defaultval"
+
+ loginfo['op'] = op
+ loginfo['detail'] = groupd["value"]
+
+ if flag:
+ data.setVarFlag(key, flag, val, **loginfo)
+ else:
+ data.setVar(key, val, parsing=True, **loginfo)
+
+class MethodNode(AstNode):
+ tr_tbl = str.maketrans('/.+-@%&', '_______')
+
+ def __init__(self, filename, lineno, func_name, body, python, fakeroot):
+ AstNode.__init__(self, filename, lineno)
+ self.func_name = func_name
+ self.body = body
+ self.python = python
+ self.fakeroot = fakeroot
+
+ def eval(self, data):
+ text = '\n'.join(self.body)
+ funcname = self.func_name
+ if self.func_name == "__anonymous":
+ funcname = ("__anon_%s_%s" % (self.lineno, self.filename.translate(MethodNode.tr_tbl)))
+ self.python = True
+ text = "def %s(d):\n" % (funcname) + text
+ bb.methodpool.insert_method(funcname, text, self.filename, self.lineno - len(self.body))
+ anonfuncs = data.getVar('__BBANONFUNCS', False) or []
+ anonfuncs.append(funcname)
+ data.setVar('__BBANONFUNCS', anonfuncs)
+ if data.getVar(funcname, False):
+ # clean up old version of this piece of metadata, as its
+ # flags could cause problems
+ data.delVarFlag(funcname, 'python')
+ data.delVarFlag(funcname, 'fakeroot')
+ if self.python:
+ data.setVarFlag(funcname, "python", "1")
+ if self.fakeroot:
+ data.setVarFlag(funcname, "fakeroot", "1")
+ data.setVarFlag(funcname, "func", 1)
+ data.setVar(funcname, text, parsing=True)
+ data.setVarFlag(funcname, 'filename', self.filename)
+ data.setVarFlag(funcname, 'lineno', str(self.lineno - len(self.body)))
+
+class PythonMethodNode(AstNode):
+ def __init__(self, filename, lineno, function, modulename, body):
+ AstNode.__init__(self, filename, lineno)
+ self.function = function
+ self.modulename = modulename
+ self.body = body
+
+ def eval(self, data):
+ # Note we will add root to parsedmethods after having parse
+ # 'this' file. This means we will not parse methods from
+ # bb classes twice
+ text = '\n'.join(self.body)
+ bb.methodpool.insert_method(self.modulename, text, self.filename, self.lineno - len(self.body) - 1)
+ data.setVarFlag(self.function, "func", 1)
+ data.setVarFlag(self.function, "python", 1)
+ data.setVar(self.function, text, parsing=True)
+ data.setVarFlag(self.function, 'filename', self.filename)
+ data.setVarFlag(self.function, 'lineno', str(self.lineno - len(self.body) - 1))
+
+class ExportFuncsNode(AstNode):
+ def __init__(self, filename, lineno, fns, classname):
+ AstNode.__init__(self, filename, lineno)
+ self.n = fns.split()
+ self.classname = classname
+
+ def eval(self, data):
+
+ for func in self.n:
+ calledfunc = self.classname + "_" + func
+
+ if data.getVar(func, False) and not data.getVarFlag(func, 'export_func', False):
+ continue
+
+ if data.getVar(func, False):
+ data.setVarFlag(func, 'python', None)
+ data.setVarFlag(func, 'func', None)
+
+ for flag in [ "func", "python" ]:
+ if data.getVarFlag(calledfunc, flag, False):
+ data.setVarFlag(func, flag, data.getVarFlag(calledfunc, flag, False))
+ for flag in [ "dirs" ]:
+ if data.getVarFlag(func, flag, False):
+ data.setVarFlag(calledfunc, flag, data.getVarFlag(func, flag, False))
+ data.setVarFlag(func, "filename", "autogenerated")
+ data.setVarFlag(func, "lineno", 1)
+
+ if data.getVarFlag(calledfunc, "python", False):
+ data.setVar(func, " bb.build.exec_func('" + calledfunc + "', d)\n", parsing=True)
+ else:
+ if "-" in self.classname:
+ bb.fatal("The classname %s contains a dash character and is calling an sh function %s using EXPORT_FUNCTIONS. Since a dash is illegal in sh function names, this cannot work, please rename the class or don't use EXPORT_FUNCTIONS." % (self.classname, calledfunc))
+ data.setVar(func, " " + calledfunc + "\n", parsing=True)
+ data.setVarFlag(func, 'export_func', '1')
+
+class AddTaskNode(AstNode):
+ def __init__(self, filename, lineno, func, before, after):
+ AstNode.__init__(self, filename, lineno)
+ self.func = func
+ self.before = before
+ self.after = after
+
+ def eval(self, data):
+ bb.build.addtask(self.func, self.before, self.after, data)
+
+class DelTaskNode(AstNode):
+ def __init__(self, filename, lineno, func):
+ AstNode.__init__(self, filename, lineno)
+ self.func = func
+
+ def eval(self, data):
+ bb.build.deltask(self.func, data)
+
+class BBHandlerNode(AstNode):
+ def __init__(self, filename, lineno, fns):
+ AstNode.__init__(self, filename, lineno)
+ self.hs = fns.split()
+
+ def eval(self, data):
+ bbhands = data.getVar('__BBHANDLERS', False) or []
+ for h in self.hs:
+ bbhands.append(h)
+ data.setVarFlag(h, "handler", 1)
+ data.setVar('__BBHANDLERS', bbhands)
+
+class InheritNode(AstNode):
+ def __init__(self, filename, lineno, classes):
+ AstNode.__init__(self, filename, lineno)
+ self.classes = classes
+
+ def eval(self, data):
+ bb.parse.BBHandler.inherit(self.classes, self.filename, self.lineno, data)
+
+def handleInclude(statements, filename, lineno, m, force):
+ statements.append(IncludeNode(filename, lineno, m.group(1), force))
+
+def handleExport(statements, filename, lineno, m):
+ statements.append(ExportNode(filename, lineno, m.group(1)))
+
+def handleUnset(statements, filename, lineno, m):
+ statements.append(UnsetNode(filename, lineno, m.group(1)))
+
+def handleUnsetFlag(statements, filename, lineno, m):
+ statements.append(UnsetFlagNode(filename, lineno, m.group(1), m.group(2)))
+
+def handleData(statements, filename, lineno, groupd):
+ statements.append(DataNode(filename, lineno, groupd))
+
+def handleMethod(statements, filename, lineno, func_name, body, python, fakeroot):
+ statements.append(MethodNode(filename, lineno, func_name, body, python, fakeroot))
+
+def handlePythonMethod(statements, filename, lineno, funcname, modulename, body):
+ statements.append(PythonMethodNode(filename, lineno, funcname, modulename, body))
+
+def handleExportFuncs(statements, filename, lineno, m, classname):
+ statements.append(ExportFuncsNode(filename, lineno, m.group(1), classname))
+
+def handleAddTask(statements, filename, lineno, m):
+ func = m.group("func")
+ before = m.group("before")
+ after = m.group("after")
+ if func is None:
+ return
+
+ statements.append(AddTaskNode(filename, lineno, func, before, after))
+
+def handleDelTask(statements, filename, lineno, m):
+ func = m.group("func")
+ if func is None:
+ return
+
+ statements.append(DelTaskNode(filename, lineno, func))
+
+def handleBBHandlers(statements, filename, lineno, m):
+ statements.append(BBHandlerNode(filename, lineno, m.group(1)))
+
+def handleInherit(statements, filename, lineno, m):
+ classes = m.group(1)
+ statements.append(InheritNode(filename, lineno, classes))
+
+def runAnonFuncs(d):
+ code = []
+ for funcname in d.getVar("__BBANONFUNCS", False) or []:
+ code.append("%s(d)" % funcname)
+ bb.utils.better_exec("\n".join(code), {"d": d})
+
+def finalize(fn, d, variant = None):
+ saved_handlers = bb.event.get_handlers().copy()
+
+ for var in d.getVar('__BBHANDLERS', False) or []:
+ # try to add the handler
+ handlerfn = d.getVarFlag(var, "filename", False)
+ if not handlerfn:
+ bb.fatal("Undefined event handler function '%s'" % var)
+ handlerln = int(d.getVarFlag(var, "lineno", False))
+ bb.event.register(var, d.getVar(var, False), (d.getVarFlag(var, "eventmask") or "").split(), handlerfn, handlerln)
+
+ bb.event.fire(bb.event.RecipePreFinalise(fn), d)
+
+ bb.data.expandKeys(d)
+ runAnonFuncs(d)
+
+ tasklist = d.getVar('__BBTASKS', False) or []
+ bb.event.fire(bb.event.RecipeTaskPreProcess(fn, list(tasklist)), d)
+ bb.build.add_tasks(tasklist, d)
+
+ bb.parse.siggen.finalise(fn, d, variant)
+
+ d.setVar('BBINCLUDED', bb.parse.get_file_depends(d))
+
+ bb.event.fire(bb.event.RecipeParsed(fn), d)
+ bb.event.set_handlers(saved_handlers)
+
+def _create_variants(datastores, names, function, onlyfinalise):
+ def create_variant(name, orig_d, arg = None):
+ if onlyfinalise and name not in onlyfinalise:
+ return
+ new_d = bb.data.createCopy(orig_d)
+ function(arg or name, new_d)
+ datastores[name] = new_d
+
+ for variant in list(datastores.keys()):
+ for name in names:
+ if not variant:
+ # Based on main recipe
+ create_variant(name, datastores[""])
+ else:
+ create_variant("%s-%s" % (variant, name), datastores[variant], name)
+
+def multi_finalize(fn, d):
+ appends = (d.getVar("__BBAPPEND") or "").split()
+ for append in appends:
+ logger.debug(1, "Appending .bbappend file %s to %s", append, fn)
+ bb.parse.BBHandler.handle(append, d, True)
+
+ onlyfinalise = d.getVar("__ONLYFINALISE", False)
+
+ safe_d = d
+ d = bb.data.createCopy(safe_d)
+ try:
+ finalize(fn, d)
+ except bb.parse.SkipRecipe as e:
+ d.setVar("__SKIPPED", e.args[0])
+ datastores = {"": safe_d}
+
+ extended = d.getVar("BBCLASSEXTEND") or ""
+ if extended:
+ # the following is to support bbextends with arguments, for e.g. multilib
+ # an example is as follows:
+ # BBCLASSEXTEND = "multilib:lib32"
+ # it will create foo-lib32, inheriting multilib.bbclass and set
+ # BBEXTENDCURR to "multilib" and BBEXTENDVARIANT to "lib32"
+ extendedmap = {}
+ variantmap = {}
+
+ for ext in extended.split():
+ eext = ext.split(':', 2)
+ if len(eext) > 1:
+ extendedmap[ext] = eext[0]
+ variantmap[ext] = eext[1]
+ else:
+ extendedmap[ext] = ext
+
+ pn = d.getVar("PN")
+ def extendfunc(name, d):
+ if name != extendedmap[name]:
+ d.setVar("BBEXTENDCURR", extendedmap[name])
+ d.setVar("BBEXTENDVARIANT", variantmap[name])
+ else:
+ d.setVar("PN", "%s-%s" % (pn, name))
+ bb.parse.BBHandler.inherit(extendedmap[name], fn, 0, d)
+
+ safe_d.setVar("BBCLASSEXTEND", extended)
+ _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise)
+
+ for variant in datastores.keys():
+ if variant:
+ try:
+ if not onlyfinalise or variant in onlyfinalise:
+ finalize(fn, datastores[variant], variant)
+ except bb.parse.SkipRecipe as e:
+ datastores[variant].setVar("__SKIPPED", e.args[0])
+
+ datastores[""] = d
+ return datastores
diff --git a/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py b/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
new file mode 100644
index 000000000..e5039e3bd
--- /dev/null
+++ b/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -0,0 +1,251 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+ class for handling .bb files
+
+ Reads a .bb file and obtains its metadata
+
+"""
+
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import re, bb, os
+import logging
+import bb.build, bb.utils
+from bb import data
+
+from . import ConfHandler
+from .. import resolve_file, ast, logger, ParseError
+from .ConfHandler import include, init
+
+# For compatibility
+bb.deprecate_import(__name__, "bb.parse", ["vars_from_file"])
+
+__func_start_regexp__ = re.compile( r"(((?P<py>python)|(?P<fr>fakeroot))\s*)*(?P<func>[\w\.\-\+\{\}\$]+)?\s*\(\s*\)\s*{$" )
+__inherit_regexp__ = re.compile( r"inherit\s+(.+)" )
+__export_func_regexp__ = re.compile( r"EXPORT_FUNCTIONS\s+(.+)" )
+__addtask_regexp__ = re.compile("addtask\s+(?P<func>\w+)\s*((before\s*(?P<before>((.*(?=after))|(.*))))|(after\s*(?P<after>((.*(?=before))|(.*)))))*")
+__deltask_regexp__ = re.compile("deltask\s+(?P<func>\w+)")
+__addhandler_regexp__ = re.compile( r"addhandler\s+(.+)" )
+__def_regexp__ = re.compile( r"def\s+(\w+).*:" )
+__python_func_regexp__ = re.compile( r"(\s+.*)|(^$)" )
+
+__infunc__ = []
+__inpython__ = False
+__body__ = []
+__classname__ = ""
+
+cached_statements = {}
+
+def supports(fn, d):
+ """Return True if fn has a supported extension"""
+ return os.path.splitext(fn)[-1] in [".bb", ".bbclass", ".inc"]
+
+def inherit(files, fn, lineno, d):
+ __inherit_cache = d.getVar('__inherit_cache', False) or []
+ files = d.expand(files).split()
+ for file in files:
+ if not os.path.isabs(file) and not file.endswith(".bbclass"):
+ file = os.path.join('classes', '%s.bbclass' % file)
+
+ if not os.path.isabs(file):
+ bbpath = d.getVar("BBPATH")
+ abs_fn, attempts = bb.utils.which(bbpath, file, history=True)
+ for af in attempts:
+ if af != abs_fn:
+ bb.parse.mark_dependency(d, af)
+ if abs_fn:
+ file = abs_fn
+
+ if not file in __inherit_cache:
+ logger.debug(1, "Inheriting %s (from %s:%d)" % (file, fn, lineno))
+ __inherit_cache.append( file )
+ d.setVar('__inherit_cache', __inherit_cache)
+ include(fn, file, lineno, d, "inherit")
+ __inherit_cache = d.getVar('__inherit_cache', False) or []
+
+def get_statements(filename, absolute_filename, base_name):
+ global cached_statements
+
+ try:
+ return cached_statements[absolute_filename]
+ except KeyError:
+ with open(absolute_filename, 'r') as f:
+ statements = ast.StatementGroup()
+
+ lineno = 0
+ while True:
+ lineno = lineno + 1
+ s = f.readline()
+ if not s: break
+ s = s.rstrip()
+ feeder(lineno, s, filename, base_name, statements)
+
+ if __inpython__:
+ # add a blank line to close out any python definition
+ feeder(lineno, "", filename, base_name, statements, eof=True)
+
+ if filename.endswith(".bbclass") or filename.endswith(".inc"):
+ cached_statements[absolute_filename] = statements
+ return statements
+
+def handle(fn, d, include):
+ global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__, __classname__
+ __body__ = []
+ __infunc__ = []
+ __classname__ = ""
+ __residue__ = []
+
+ base_name = os.path.basename(fn)
+ (root, ext) = os.path.splitext(base_name)
+ init(d)
+
+ if ext == ".bbclass":
+ __classname__ = root
+ __inherit_cache = d.getVar('__inherit_cache', False) or []
+ if not fn in __inherit_cache:
+ __inherit_cache.append(fn)
+ d.setVar('__inherit_cache', __inherit_cache)
+
+ if include != 0:
+ oldfile = d.getVar('FILE', False)
+ else:
+ oldfile = None
+
+ abs_fn = resolve_file(fn, d)
+
+ # actual loading
+ statements = get_statements(fn, abs_fn, base_name)
+
+ # DONE WITH PARSING... time to evaluate
+ if ext != ".bbclass" and abs_fn != oldfile:
+ d.setVar('FILE', abs_fn)
+
+ try:
+ statements.eval(d)
+ except bb.parse.SkipRecipe:
+ d.setVar("__SKIPPED", True)
+ if include == 0:
+ return { "" : d }
+
+ if __infunc__:
+ raise ParseError("Shell function %s is never closed" % __infunc__[0], __infunc__[1], __infunc__[2])
+ if __residue__:
+ raise ParseError("Leftover unparsed (incomplete?) data %s from %s" % __residue__, fn)
+
+ if ext != ".bbclass" and include == 0:
+ return ast.multi_finalize(fn, d)
+
+ if ext != ".bbclass" and oldfile and abs_fn != oldfile:
+ d.setVar("FILE", oldfile)
+
+ return d
+
+def feeder(lineno, s, fn, root, statements, eof=False):
+ global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __def_regexp__, __python_func_regexp__, __inpython__, __infunc__, __body__, bb, __residue__, __classname__
+ if __infunc__:
+ if s == '}':
+ __body__.append('')
+ ast.handleMethod(statements, fn, lineno, __infunc__[0], __body__, __infunc__[3], __infunc__[4])
+ __infunc__ = []
+ __body__ = []
+ else:
+ __body__.append(s)
+ return
+
+ if __inpython__:
+ m = __python_func_regexp__.match(s)
+ if m and not eof:
+ __body__.append(s)
+ return
+ else:
+ ast.handlePythonMethod(statements, fn, lineno, __inpython__,
+ root, __body__)
+ __body__ = []
+ __inpython__ = False
+
+ if eof:
+ return
+
+ if s and s[0] == '#':
+ if len(__residue__) != 0 and __residue__[0][0] != "#":
+ bb.fatal("There is a comment on line %s of file %s (%s) which is in the middle of a multiline expression.\nBitbake used to ignore these but no longer does so, please fix your metadata as errors are likely as a result of this change." % (lineno, fn, s))
+
+ if len(__residue__) != 0 and __residue__[0][0] == "#" and (not s or s[0] != "#"):
+ bb.fatal("There is a confusing multiline, partially commented expression on line %s of file %s (%s).\nPlease clarify whether this is all a comment or should be parsed." % (lineno, fn, s))
+
+ if s and s[-1] == '\\':
+ __residue__.append(s[:-1])
+ return
+
+ s = "".join(__residue__) + s
+ __residue__ = []
+
+ # Skip empty lines
+ if s == '':
+ return
+
+ # Skip comments
+ if s[0] == '#':
+ return
+
+ m = __func_start_regexp__.match(s)
+ if m:
+ __infunc__ = [m.group("func") or "__anonymous", fn, lineno, m.group("py") is not None, m.group("fr") is not None]
+ return
+
+ m = __def_regexp__.match(s)
+ if m:
+ __body__.append(s)
+ __inpython__ = m.group(1)
+
+ return
+
+ m = __export_func_regexp__.match(s)
+ if m:
+ ast.handleExportFuncs(statements, fn, lineno, m, __classname__)
+ return
+
+ m = __addtask_regexp__.match(s)
+ if m:
+ ast.handleAddTask(statements, fn, lineno, m)
+ return
+
+ m = __deltask_regexp__.match(s)
+ if m:
+ ast.handleDelTask(statements, fn, lineno, m)
+ return
+
+ m = __addhandler_regexp__.match(s)
+ if m:
+ ast.handleBBHandlers(statements, fn, lineno, m)
+ return
+
+ m = __inherit_regexp__.match(s)
+ if m:
+ ast.handleInherit(statements, fn, lineno, m)
+ return
+
+ return ConfHandler.feeder(lineno, s, fn, statements)
+
+# Add us to the handlers list
+from .. import handlers
+handlers.append({'supports': supports, 'handle': handle, 'init': init})
+del handlers
diff --git a/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py b/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
new file mode 100644
index 000000000..9d3ebe16f
--- /dev/null
+++ b/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py
@@ -0,0 +1,210 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+ class for handling configuration data files
+
+ Reads a .conf file and obtains its metadata
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import errno
+import re
+import os
+import bb.utils
+from bb.parse import ParseError, resolve_file, ast, logger, handle
+
+__config_regexp__ = re.compile( r"""
+ ^
+ (?P<exp>export\s+)?
+ (?P<var>[a-zA-Z0-9\-_+.${}/~]+?)
+ (\[(?P<flag>[a-zA-Z0-9\-_+.]+)\])?
+
+ \s* (
+ (?P<colon>:=) |
+ (?P<lazyques>\?\?=) |
+ (?P<ques>\?=) |
+ (?P<append>\+=) |
+ (?P<prepend>=\+) |
+ (?P<predot>=\.) |
+ (?P<postdot>\.=) |
+ =
+ ) \s*
+
+ (?!'[^']*'[^']*'$)
+ (?!\"[^\"]*\"[^\"]*\"$)
+ (?P<apo>['\"])
+ (?P<value>.*)
+ (?P=apo)
+ $
+ """, re.X)
+__include_regexp__ = re.compile( r"include\s+(.+)" )
+__require_regexp__ = re.compile( r"require\s+(.+)" )
+__export_regexp__ = re.compile( r"export\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
+__unset_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)$" )
+__unset_flag_regexp__ = re.compile( r"unset\s+([a-zA-Z0-9\-_+.${}/~]+)\[([a-zA-Z0-9\-_+.]+)\]$" )
+
+def init(data):
+ topdir = data.getVar('TOPDIR', False)
+ if not topdir:
+ data.setVar('TOPDIR', os.getcwd())
+
+
+def supports(fn, d):
+ return fn[-5:] == ".conf"
+
+def include(parentfn, fns, lineno, data, error_out):
+ """
+ error_out: A string indicating the verb (e.g. "include", "inherit") to be
+ used in a ParseError that will be raised if the file to be included could
+ not be included. Specify False to avoid raising an error in this case.
+ """
+ fns = data.expand(fns)
+ parentfn = data.expand(parentfn)
+
+ # "include" or "require" accept zero to n space-separated file names to include.
+ for fn in fns.split():
+ include_single_file(parentfn, fn, lineno, data, error_out)
+
+def include_single_file(parentfn, fn, lineno, data, error_out):
+ """
+ Helper function for include() which does not expand or split its parameters.
+ """
+ if parentfn == fn: # prevent infinite recursion
+ return None
+
+ if not os.path.isabs(fn):
+ dname = os.path.dirname(parentfn)
+ bbpath = "%s:%s" % (dname, data.getVar("BBPATH"))
+ abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
+ if abs_fn and bb.parse.check_dependency(data, abs_fn):
+ logger.warning("Duplicate inclusion for %s in %s" % (abs_fn, data.getVar('FILE')))
+ for af in attempts:
+ bb.parse.mark_dependency(data, af)
+ if abs_fn:
+ fn = abs_fn
+ elif bb.parse.check_dependency(data, fn):
+ logger.warning("Duplicate inclusion for %s in %s" % (fn, data.getVar('FILE')))
+
+ try:
+ bb.parse.handle(fn, data, True)
+ except (IOError, OSError) as exc:
+ if exc.errno == errno.ENOENT:
+ if error_out:
+ raise ParseError("Could not %s file %s" % (error_out, fn), parentfn, lineno)
+ logger.debug(2, "CONF file '%s' not found", fn)
+ else:
+ if error_out:
+ raise ParseError("Could not %s file %s: %s" % (error_out, fn, exc.strerror), parentfn, lineno)
+ else:
+ raise ParseError("Error parsing %s: %s" % (fn, exc.strerror), parentfn, lineno)
+
+# We have an issue where a UI might want to enforce particular settings such as
+# an empty DISTRO variable. If configuration files do something like assigning
+# a weak default, it turns out to be very difficult to filter out these changes,
+# particularly when the weak default might appear half way though parsing a chain
+# of configuration files. We therefore let the UIs hook into configuration file
+# parsing. This turns out to be a hard problem to solve any other way.
+confFilters = []
+
+def handle(fn, data, include):
+ init(data)
+
+ if include == 0:
+ oldfile = None
+ else:
+ oldfile = data.getVar('FILE', False)
+
+ abs_fn = resolve_file(fn, data)
+ f = open(abs_fn, 'r')
+
+ statements = ast.StatementGroup()
+ lineno = 0
+ while True:
+ lineno = lineno + 1
+ s = f.readline()
+ if not s:
+ break
+ w = s.strip()
+ # skip empty lines
+ if not w:
+ continue
+ s = s.rstrip()
+ while s[-1] == '\\':
+ s2 = f.readline().strip()
+ lineno = lineno + 1
+ if (not s2 or s2 and s2[0] != "#") and s[0] == "#" :
+ bb.fatal("There is a confusing multiline, partially commented expression on line %s of file %s (%s).\nPlease clarify whether this is all a comment or should be parsed." % (lineno, fn, s))
+ s = s[:-1] + s2
+ # skip comments
+ if s[0] == '#':
+ continue
+ feeder(lineno, s, abs_fn, statements)
+
+ # DONE WITH PARSING... time to evaluate
+ data.setVar('FILE', abs_fn)
+ statements.eval(data)
+ if oldfile:
+ data.setVar('FILE', oldfile)
+
+ f.close()
+
+ for f in confFilters:
+ f(fn, data)
+
+ return data
+
+def feeder(lineno, s, fn, statements):
+ m = __config_regexp__.match(s)
+ if m:
+ groupd = m.groupdict()
+ ast.handleData(statements, fn, lineno, groupd)
+ return
+
+ m = __include_regexp__.match(s)
+ if m:
+ ast.handleInclude(statements, fn, lineno, m, False)
+ return
+
+ m = __require_regexp__.match(s)
+ if m:
+ ast.handleInclude(statements, fn, lineno, m, True)
+ return
+
+ m = __export_regexp__.match(s)
+ if m:
+ ast.handleExport(statements, fn, lineno, m)
+ return
+
+ m = __unset_regexp__.match(s)
+ if m:
+ ast.handleUnset(statements, fn, lineno, m)
+ return
+
+ m = __unset_flag_regexp__.match(s)
+ if m:
+ ast.handleUnsetFlag(statements, fn, lineno, m)
+ return
+
+ raise ParseError("unparsed line: '%s'" % s, fn, lineno);
+
+# Add us to the handlers list
+from bb.parse import handlers
+handlers.append({'supports': supports, 'handle': handle, 'init': init})
+del handlers
diff --git a/poky/bitbake/lib/bb/parse/parse_py/__init__.py b/poky/bitbake/lib/bb/parse/parse_py/__init__.py
new file mode 100644
index 000000000..3e658d0de
--- /dev/null
+++ b/poky/bitbake/lib/bb/parse/parse_py/__init__.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake Parsers
+
+File parsers for the BitBake build tools.
+
+"""
+
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Based on functions from the base bb module, Copyright 2003 Holger Schurig
+
+from __future__ import absolute_import
+from . import ConfHandler
+from . import BBHandler
+
+__version__ = '1.0'
diff --git a/poky/bitbake/lib/bb/persist_data.py b/poky/bitbake/lib/bb/persist_data.py
new file mode 100644
index 000000000..bef701861
--- /dev/null
+++ b/poky/bitbake/lib/bb/persist_data.py
@@ -0,0 +1,214 @@
+"""BitBake Persistent Data Store
+
+Used to store data in a central location such that other threads/tasks can
+access them at some future date. Acts as a convenience wrapper around sqlite,
+currently, providing a key/value store accessed by 'domain'.
+"""
+
+# Copyright (C) 2007 Richard Purdie
+# Copyright (C) 2010 Chris Larson <chris_larson@mentor.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import collections
+import logging
+import os.path
+import sys
+import warnings
+from bb.compat import total_ordering
+from collections import Mapping
+import sqlite3
+
+sqlversion = sqlite3.sqlite_version_info
+if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
+ raise Exception("sqlite3 version 3.3.0 or later is required.")
+
+
+logger = logging.getLogger("BitBake.PersistData")
+if hasattr(sqlite3, 'enable_shared_cache'):
+ try:
+ sqlite3.enable_shared_cache(True)
+ except sqlite3.OperationalError:
+ pass
+
+
+@total_ordering
+class SQLTable(collections.MutableMapping):
+ """Object representing a table/domain in the database"""
+ def __init__(self, cachefile, table):
+ self.cachefile = cachefile
+ self.table = table
+ self.cursor = connect(self.cachefile)
+
+ self._execute("CREATE TABLE IF NOT EXISTS %s(key TEXT, value TEXT);"
+ % table)
+
+ def _execute(self, *query):
+ """Execute a query, waiting to acquire a lock if necessary"""
+ count = 0
+ while True:
+ try:
+ return self.cursor.execute(*query)
+ except sqlite3.OperationalError as exc:
+ if 'database is locked' in str(exc) and count < 500:
+ count = count + 1
+ self.cursor.close()
+ self.cursor = connect(self.cachefile)
+ continue
+ raise
+
+ def __enter__(self):
+ self.cursor.__enter__()
+ return self
+
+ def __exit__(self, *excinfo):
+ self.cursor.__exit__(*excinfo)
+
+ def __getitem__(self, key):
+ data = self._execute("SELECT * from %s where key=?;" %
+ self.table, [key])
+ for row in data:
+ return row[1]
+ raise KeyError(key)
+
+ def __delitem__(self, key):
+ if key not in self:
+ raise KeyError(key)
+ self._execute("DELETE from %s where key=?;" % self.table, [key])
+
+ def __setitem__(self, key, value):
+ if not isinstance(key, str):
+ raise TypeError('Only string keys are supported')
+ elif not isinstance(value, str):
+ raise TypeError('Only string values are supported')
+
+ data = self._execute("SELECT * from %s where key=?;" %
+ self.table, [key])
+ exists = len(list(data))
+ if exists:
+ self._execute("UPDATE %s SET value=? WHERE key=?;" % self.table,
+ [value, key])
+ else:
+ self._execute("INSERT into %s(key, value) values (?, ?);" %
+ self.table, [key, value])
+
+ def __contains__(self, key):
+ return key in set(self)
+
+ def __len__(self):
+ data = self._execute("SELECT COUNT(key) FROM %s;" % self.table)
+ for row in data:
+ return row[0]
+
+ def __iter__(self):
+ data = self._execute("SELECT key FROM %s;" % self.table)
+ return (row[0] for row in data)
+
+ def __lt__(self, other):
+ if not isinstance(other, Mapping):
+ raise NotImplemented
+
+ return len(self) < len(other)
+
+ def get_by_pattern(self, pattern):
+ data = self._execute("SELECT * FROM %s WHERE key LIKE ?;" %
+ self.table, [pattern])
+ return [row[1] for row in data]
+
+ def values(self):
+ return list(self.itervalues())
+
+ def itervalues(self):
+ data = self._execute("SELECT value FROM %s;" % self.table)
+ return (row[0] for row in data)
+
+ def items(self):
+ return list(self.iteritems())
+
+ def iteritems(self):
+ return self._execute("SELECT * FROM %s;" % self.table)
+
+ def clear(self):
+ self._execute("DELETE FROM %s;" % self.table)
+
+ def has_key(self, key):
+ return key in self
+
+
+class PersistData(object):
+ """Deprecated representation of the bitbake persistent data store"""
+ def __init__(self, d):
+ warnings.warn("Use of PersistData is deprecated. Please use "
+ "persist(domain, d) instead.",
+ category=DeprecationWarning,
+ stacklevel=2)
+
+ self.data = persist(d)
+ logger.debug(1, "Using '%s' as the persistent data cache",
+ self.data.filename)
+
+ def addDomain(self, domain):
+ """
+ Add a domain (pending deprecation)
+ """
+ return self.data[domain]
+
+ def delDomain(self, domain):
+ """
+ Removes a domain and all the data it contains
+ """
+ del self.data[domain]
+
+ def getKeyValues(self, domain):
+ """
+ Return a list of key + value pairs for a domain
+ """
+ return list(self.data[domain].items())
+
+ def getValue(self, domain, key):
+ """
+ Return the value of a key for a domain
+ """
+ return self.data[domain][key]
+
+ def setValue(self, domain, key, value):
+ """
+ Sets the value of a key for a domain
+ """
+ self.data[domain][key] = value
+
+ def delValue(self, domain, key):
+ """
+ Deletes a key/value pair
+ """
+ del self.data[domain][key]
+
+def connect(database):
+ connection = sqlite3.connect(database, timeout=5, isolation_level=None)
+ connection.execute("pragma synchronous = off;")
+ connection.text_factory = str
+ return connection
+
+def persist(domain, d):
+ """Convenience factory for SQLTable objects based upon metadata"""
+ import bb.utils
+ cachedir = (d.getVar("PERSISTENT_DIR") or
+ d.getVar("CACHE"))
+ if not cachedir:
+ logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
+ sys.exit(1)
+
+ bb.utils.mkdirhier(cachedir)
+ cachefile = os.path.join(cachedir, "bb_persist_data.sqlite3")
+ return SQLTable(cachefile, domain)
diff --git a/poky/bitbake/lib/bb/process.py b/poky/bitbake/lib/bb/process.py
new file mode 100644
index 000000000..e69697cb6
--- /dev/null
+++ b/poky/bitbake/lib/bb/process.py
@@ -0,0 +1,179 @@
+import logging
+import signal
+import subprocess
+import errno
+import select
+
+logger = logging.getLogger('BitBake.Process')
+
+def subprocess_setup():
+ # Python installs a SIGPIPE handler by default. This is usually not what
+ # non-Python subprocesses expect.
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+class CmdError(RuntimeError):
+ def __init__(self, command, msg=None):
+ self.command = command
+ self.msg = msg
+
+ def __str__(self):
+ if not isinstance(self.command, str):
+ cmd = subprocess.list2cmdline(self.command)
+ else:
+ cmd = self.command
+
+ msg = "Execution of '%s' failed" % cmd
+ if self.msg:
+ msg += ': %s' % self.msg
+ return msg
+
+class NotFoundError(CmdError):
+ def __str__(self):
+ return CmdError.__str__(self) + ": command not found"
+
+class ExecutionError(CmdError):
+ def __init__(self, command, exitcode, stdout = None, stderr = None):
+ CmdError.__init__(self, command)
+ self.exitcode = exitcode
+ self.stdout = stdout
+ self.stderr = stderr
+
+ def __str__(self):
+ message = ""
+ if self.stderr:
+ message += self.stderr
+ if self.stdout:
+ message += self.stdout
+ if message:
+ message = ":\n" + message
+ return (CmdError.__str__(self) +
+ " with exit code %s" % self.exitcode + message)
+
+class Popen(subprocess.Popen):
+ defaults = {
+ "close_fds": True,
+ "preexec_fn": subprocess_setup,
+ "stdout": subprocess.PIPE,
+ "stderr": subprocess.STDOUT,
+ "stdin": subprocess.PIPE,
+ "shell": False,
+ }
+
+ def __init__(self, *args, **kwargs):
+ options = dict(self.defaults)
+ options.update(kwargs)
+ subprocess.Popen.__init__(self, *args, **options)
+
+def _logged_communicate(pipe, log, input, extrafiles):
+ if pipe.stdin:
+ if input is not None:
+ pipe.stdin.write(input)
+ pipe.stdin.close()
+
+ outdata, errdata = [], []
+ rin = []
+
+ if pipe.stdout is not None:
+ bb.utils.nonblockingfd(pipe.stdout.fileno())
+ rin.append(pipe.stdout)
+ if pipe.stderr is not None:
+ bb.utils.nonblockingfd(pipe.stderr.fileno())
+ rin.append(pipe.stderr)
+ for fobj, _ in extrafiles:
+ bb.utils.nonblockingfd(fobj.fileno())
+ rin.append(fobj)
+
+ def readextras(selected):
+ for fobj, func in extrafiles:
+ if fobj in selected:
+ try:
+ data = fobj.read()
+ except IOError as err:
+ if err.errno == errno.EAGAIN or err.errno == errno.EWOULDBLOCK:
+ data = None
+ if data is not None:
+ func(data)
+
+ def read_all_pipes(log, rin, outdata, errdata):
+ rlist = rin
+ stdoutbuf = b""
+ stderrbuf = b""
+
+ try:
+ r,w,e = select.select (rlist, [], [], 1)
+ except OSError as e:
+ if e.errno != errno.EINTR:
+ raise
+
+ readextras(r)
+
+ if pipe.stdout in r:
+ data = stdoutbuf + pipe.stdout.read()
+ if data is not None and len(data) > 0:
+ try:
+ data = data.decode("utf-8")
+ outdata.append(data)
+ log.write(data)
+ log.flush()
+ stdoutbuf = b""
+ except UnicodeDecodeError:
+ stdoutbuf = data
+
+ if pipe.stderr in r:
+ data = stderrbuf + pipe.stderr.read()
+ if data is not None and len(data) > 0:
+ try:
+ data = data.decode("utf-8")
+ errdata.append(data)
+ log.write(data)
+ log.flush()
+ stderrbuf = b""
+ except UnicodeDecodeError:
+ stderrbuf = data
+
+ try:
+ # Read all pipes while the process is open
+ while pipe.poll() is None:
+ read_all_pipes(log, rin, outdata, errdata)
+
+ # Pocess closed, drain all pipes...
+ read_all_pipes(log, rin, outdata, errdata)
+ finally:
+ log.flush()
+
+ if pipe.stdout is not None:
+ pipe.stdout.close()
+ if pipe.stderr is not None:
+ pipe.stderr.close()
+ return ''.join(outdata), ''.join(errdata)
+
+def run(cmd, input=None, log=None, extrafiles=None, **options):
+ """Convenience function to run a command and return its output, raising an
+ exception when the command fails"""
+
+ if not extrafiles:
+ extrafiles = []
+
+ if isinstance(cmd, str) and not "shell" in options:
+ options["shell"] = True
+
+ try:
+ pipe = Popen(cmd, **options)
+ except OSError as exc:
+ if exc.errno == 2:
+ raise NotFoundError(cmd)
+ else:
+ raise CmdError(cmd, exc)
+
+ if log:
+ stdout, stderr = _logged_communicate(pipe, log, input, extrafiles)
+ else:
+ stdout, stderr = pipe.communicate(input)
+ if not stdout is None:
+ stdout = stdout.decode("utf-8")
+ if not stderr is None:
+ stderr = stderr.decode("utf-8")
+
+ if pipe.returncode != 0:
+ raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
+ return stdout, stderr
diff --git a/poky/bitbake/lib/bb/progress.py b/poky/bitbake/lib/bb/progress.py
new file mode 100644
index 000000000..f54d1c76f
--- /dev/null
+++ b/poky/bitbake/lib/bb/progress.py
@@ -0,0 +1,276 @@
+"""
+BitBake progress handling code
+"""
+
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import re
+import time
+import inspect
+import bb.event
+import bb.build
+
+class ProgressHandler(object):
+ """
+ Base class that can pretend to be a file object well enough to be
+ used to build objects to intercept console output and determine the
+ progress of some operation.
+ """
+ def __init__(self, d, outfile=None):
+ self._progress = 0
+ self._data = d
+ self._lastevent = 0
+ if outfile:
+ self._outfile = outfile
+ else:
+ self._outfile = sys.stdout
+
+ def _fire_progress(self, taskprogress, rate=None):
+ """Internal function to fire the progress event"""
+ bb.event.fire(bb.build.TaskProgress(taskprogress, rate), self._data)
+
+ def write(self, string):
+ self._outfile.write(string)
+
+ def flush(self):
+ self._outfile.flush()
+
+ def update(self, progress, rate=None):
+ ts = time.time()
+ if progress > 100:
+ progress = 100
+ if progress != self._progress or self._lastevent + 1 < ts:
+ self._fire_progress(progress, rate)
+ self._lastevent = ts
+ self._progress = progress
+
+class LineFilterProgressHandler(ProgressHandler):
+ """
+ A ProgressHandler variant that provides the ability to filter out
+ the lines if they contain progress information. Additionally, it
+ filters out anything before the last line feed on a line. This can
+ be used to keep the logs clean of output that we've only enabled for
+ getting progress, assuming that that can be done on a per-line
+ basis.
+ """
+ def __init__(self, d, outfile=None):
+ self._linebuffer = ''
+ super(LineFilterProgressHandler, self).__init__(d, outfile)
+
+ def write(self, string):
+ self._linebuffer += string
+ while True:
+ breakpos = self._linebuffer.find('\n') + 1
+ if breakpos == 0:
+ break
+ line = self._linebuffer[:breakpos]
+ self._linebuffer = self._linebuffer[breakpos:]
+ # Drop any line feeds and anything that precedes them
+ lbreakpos = line.rfind('\r') + 1
+ if lbreakpos:
+ line = line[lbreakpos:]
+ if self.writeline(line):
+ super(LineFilterProgressHandler, self).write(line)
+
+ def writeline(self, line):
+ return True
+
+class BasicProgressHandler(ProgressHandler):
+ def __init__(self, d, regex=r'(\d+)%', outfile=None):
+ super(BasicProgressHandler, self).__init__(d, outfile)
+ self._regex = re.compile(regex)
+ # Send an initial progress event so the bar gets shown
+ self._fire_progress(0)
+
+ def write(self, string):
+ percs = self._regex.findall(string)
+ if percs:
+ progress = int(percs[-1])
+ self.update(progress)
+ super(BasicProgressHandler, self).write(string)
+
+class OutOfProgressHandler(ProgressHandler):
+ def __init__(self, d, regex, outfile=None):
+ super(OutOfProgressHandler, self).__init__(d, outfile)
+ self._regex = re.compile(regex)
+ # Send an initial progress event so the bar gets shown
+ self._fire_progress(0)
+
+ def write(self, string):
+ nums = self._regex.findall(string)
+ if nums:
+ progress = (float(nums[-1][0]) / float(nums[-1][1])) * 100
+ self.update(progress)
+ super(OutOfProgressHandler, self).write(string)
+
+class MultiStageProgressReporter(object):
+ """
+ Class which allows reporting progress without the caller
+ having to know where they are in the overall sequence. Useful
+ for tasks made up of python code spread across multiple
+ classes / functions - the progress reporter object can
+ be passed around or stored at the object level and calls
+ to next_stage() and update() made whereever needed.
+ """
+ def __init__(self, d, stage_weights, debug=False):
+ """
+ Initialise the progress reporter.
+
+ Parameters:
+ * d: the datastore (needed for firing the events)
+ * stage_weights: a list of weight values, one for each stage.
+ The value is scaled internally so you only need to specify
+ values relative to other values in the list, so if there
+ are two stages and the first takes 2s and the second takes
+ 10s you would specify [2, 10] (or [1, 5], it doesn't matter).
+ * debug: specify True (and ensure you call finish() at the end)
+ in order to show a printout of the calculated stage weights
+ based on timing each stage. Use this to determine what the
+ weights should be when you're not sure.
+ """
+ self._data = d
+ total = sum(stage_weights)
+ self._stage_weights = [float(x)/total for x in stage_weights]
+ self._stage = -1
+ self._base_progress = 0
+ # Send an initial progress event so the bar gets shown
+ self._fire_progress(0)
+ self._debug = debug
+ self._finished = False
+ if self._debug:
+ self._last_time = time.time()
+ self._stage_times = []
+ self._stage_total = None
+ self._callers = []
+
+ def _fire_progress(self, taskprogress):
+ bb.event.fire(bb.build.TaskProgress(taskprogress), self._data)
+
+ def next_stage(self, stage_total=None):
+ """
+ Move to the next stage.
+ Parameters:
+ * stage_total: optional total for progress within the stage,
+ see update() for details
+ NOTE: you need to call this before the first stage.
+ """
+ self._stage += 1
+ self._stage_total = stage_total
+ if self._stage == 0:
+ # First stage
+ if self._debug:
+ self._last_time = time.time()
+ else:
+ if self._stage < len(self._stage_weights):
+ self._base_progress = sum(self._stage_weights[:self._stage]) * 100
+ if self._debug:
+ currtime = time.time()
+ self._stage_times.append(currtime - self._last_time)
+ self._last_time = currtime
+ self._callers.append(inspect.getouterframes(inspect.currentframe())[1])
+ elif not self._debug:
+ bb.warn('ProgressReporter: current stage beyond declared number of stages')
+ self._base_progress = 100
+ self._fire_progress(self._base_progress)
+
+ def update(self, stage_progress):
+ """
+ Update progress within the current stage.
+ Parameters:
+ * stage_progress: progress value within the stage. If stage_total
+ was specified when next_stage() was last called, then this
+ value is considered to be out of stage_total, otherwise it should
+ be a percentage value from 0 to 100.
+ """
+ if self._stage_total:
+ stage_progress = (float(stage_progress) / self._stage_total) * 100
+ if self._stage < 0:
+ bb.warn('ProgressReporter: update called before first call to next_stage()')
+ elif self._stage < len(self._stage_weights):
+ progress = self._base_progress + (stage_progress * self._stage_weights[self._stage])
+ else:
+ progress = self._base_progress
+ if progress > 100:
+ progress = 100
+ self._fire_progress(progress)
+
+ def finish(self):
+ if self._finished:
+ return
+ self._finished = True
+ if self._debug:
+ import math
+ self._stage_times.append(time.time() - self._last_time)
+ mintime = max(min(self._stage_times), 0.01)
+ self._callers.append(None)
+ stage_weights = [int(math.ceil(x / mintime)) for x in self._stage_times]
+ bb.warn('Stage weights: %s' % stage_weights)
+ out = []
+ for stage_weight, caller in zip(stage_weights, self._callers):
+ if caller:
+ out.append('Up to %s:%d: %d' % (caller[1], caller[2], stage_weight))
+ else:
+ out.append('Up to finish: %d' % stage_weight)
+ bb.warn('Stage times:\n %s' % '\n '.join(out))
+
+class MultiStageProcessProgressReporter(MultiStageProgressReporter):
+ """
+ Version of MultiStageProgressReporter intended for use with
+ standalone processes (such as preparing the runqueue)
+ """
+ def __init__(self, d, processname, stage_weights, debug=False):
+ self._processname = processname
+ self._started = False
+ MultiStageProgressReporter.__init__(self, d, stage_weights, debug)
+
+ def start(self):
+ if not self._started:
+ bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data)
+ self._started = True
+
+ def _fire_progress(self, taskprogress):
+ if taskprogress == 0:
+ self.start()
+ return
+ bb.event.fire(bb.event.ProcessProgress(self._processname, taskprogress), self._data)
+
+ def finish(self):
+ MultiStageProgressReporter.finish(self)
+ bb.event.fire(bb.event.ProcessFinished(self._processname), self._data)
+
+class DummyMultiStageProcessProgressReporter(MultiStageProgressReporter):
+ """
+ MultiStageProcessProgressReporter that takes the calls and does nothing
+ with them (to avoid a bunch of "if progress_reporter:" checks)
+ """
+ def __init__(self):
+ MultiStageProcessProgressReporter.__init__(self, "", None, [])
+
+ def _fire_progress(self, taskprogress, rate=None):
+ pass
+
+ def start(self):
+ pass
+
+ def next_stage(self, stage_total=None):
+ pass
+
+ def update(self, stage_progress):
+ pass
+
+ def finish(self):
+ pass
diff --git a/poky/bitbake/lib/bb/providers.py b/poky/bitbake/lib/bb/providers.py
new file mode 100644
index 000000000..c2aa98c06
--- /dev/null
+++ b/poky/bitbake/lib/bb/providers.py
@@ -0,0 +1,430 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2003, 2004 Chris Larson
+# Copyright (C) 2003, 2004 Phil Blundell
+# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
+# Copyright (C) 2005 Holger Hans Peter Freyther
+# Copyright (C) 2005 ROAD GmbH
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+import logging
+from bb import data, utils
+from collections import defaultdict
+import bb
+
+logger = logging.getLogger("BitBake.Provider")
+
+class NoProvider(bb.BBHandledException):
+ """Exception raised when no provider of a build dependency can be found"""
+
+class NoRProvider(bb.BBHandledException):
+ """Exception raised when no provider of a runtime dependency can be found"""
+
+class MultipleRProvider(bb.BBHandledException):
+ """Exception raised when multiple providers of a runtime dependency can be found"""
+
+def findProviders(cfgData, dataCache, pkg_pn = None):
+ """
+ Convenience function to get latest and preferred providers in pkg_pn
+ """
+
+ if not pkg_pn:
+ pkg_pn = dataCache.pkg_pn
+
+ # Need to ensure data store is expanded
+ localdata = data.createCopy(cfgData)
+ bb.data.expandKeys(localdata)
+
+ preferred_versions = {}
+ latest_versions = {}
+
+ for pn in pkg_pn:
+ (last_ver, last_file, pref_ver, pref_file) = findBestProvider(pn, localdata, dataCache, pkg_pn)
+ preferred_versions[pn] = (pref_ver, pref_file)
+ latest_versions[pn] = (last_ver, last_file)
+
+ return (latest_versions, preferred_versions)
+
+
+def allProviders(dataCache):
+ """
+ Find all providers for each pn
+ """
+ all_providers = defaultdict(list)
+ for (fn, pn) in dataCache.pkg_fn.items():
+ ver = dataCache.pkg_pepvpr[fn]
+ all_providers[pn].append((ver, fn))
+ return all_providers
+
+
+def sortPriorities(pn, dataCache, pkg_pn = None):
+ """
+ Reorder pkg_pn by file priority and default preference
+ """
+
+ if not pkg_pn:
+ pkg_pn = dataCache.pkg_pn
+
+ files = pkg_pn[pn]
+ priorities = {}
+ for f in files:
+ priority = dataCache.bbfile_priority[f]
+ preference = dataCache.pkg_dp[f]
+ if priority not in priorities:
+ priorities[priority] = {}
+ if preference not in priorities[priority]:
+ priorities[priority][preference] = []
+ priorities[priority][preference].append(f)
+ tmp_pn = []
+ for pri in sorted(priorities):
+ tmp_pref = []
+ for pref in sorted(priorities[pri]):
+ tmp_pref.extend(priorities[pri][pref])
+ tmp_pn = [tmp_pref] + tmp_pn
+
+ return tmp_pn
+
+def preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
+ """
+ Check if the version pe,pv,pr is the preferred one.
+ If there is preferred version defined and ends with '%', then pv has to start with that version after removing the '%'
+ """
+ if (pr == preferred_r or preferred_r == None):
+ if (pe == preferred_e or preferred_e == None):
+ if preferred_v == pv:
+ return True
+ if preferred_v != None and preferred_v.endswith('%') and pv.startswith(preferred_v[:len(preferred_v)-1]):
+ return True
+ return False
+
+def findPreferredProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
+ """
+ Find the first provider in pkg_pn with a PREFERRED_VERSION set.
+ """
+
+ preferred_file = None
+ preferred_ver = None
+
+ # pn can contain '_', e.g. gcc-cross-x86_64 and an override cannot
+ # hence we do this manually rather than use OVERRIDES
+ preferred_v = cfgData.getVar("PREFERRED_VERSION_pn-%s" % pn)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION_%s" % pn)
+ if not preferred_v:
+ preferred_v = cfgData.getVar("PREFERRED_VERSION")
+
+ if preferred_v:
+ m = re.match('(\d+:)*(.*)(_.*)*', preferred_v)
+ if m:
+ if m.group(1):
+ preferred_e = m.group(1)[:-1]
+ else:
+ preferred_e = None
+ preferred_v = m.group(2)
+ if m.group(3):
+ preferred_r = m.group(3)[1:]
+ else:
+ preferred_r = None
+ else:
+ preferred_e = None
+ preferred_r = None
+
+ for file_set in pkg_pn:
+ for f in file_set:
+ pe, pv, pr = dataCache.pkg_pepvpr[f]
+ if preferredVersionMatch(pe, pv, pr, preferred_e, preferred_v, preferred_r):
+ preferred_file = f
+ preferred_ver = (pe, pv, pr)
+ break
+ if preferred_file:
+ break;
+ if preferred_r:
+ pv_str = '%s-%s' % (preferred_v, preferred_r)
+ else:
+ pv_str = preferred_v
+ if not (preferred_e is None):
+ pv_str = '%s:%s' % (preferred_e, pv_str)
+ itemstr = ""
+ if item:
+ itemstr = " (for item %s)" % item
+ if preferred_file is None:
+ logger.info("preferred version %s of %s not available%s", pv_str, pn, itemstr)
+ available_vers = []
+ for file_set in pkg_pn:
+ for f in file_set:
+ pe, pv, pr = dataCache.pkg_pepvpr[f]
+ ver_str = pv
+ if pe:
+ ver_str = "%s:%s" % (pe, ver_str)
+ if not ver_str in available_vers:
+ available_vers.append(ver_str)
+ if available_vers:
+ available_vers.sort()
+ logger.info("versions of %s available: %s", pn, ' '.join(available_vers))
+ else:
+ logger.debug(1, "selecting %s as PREFERRED_VERSION %s of package %s%s", preferred_file, pv_str, pn, itemstr)
+
+ return (preferred_ver, preferred_file)
+
+
+def findLatestProvider(pn, cfgData, dataCache, file_set):
+ """
+ Return the highest version of the providers in file_set.
+ Take default preferences into account.
+ """
+ latest = None
+ latest_p = 0
+ latest_f = None
+ for file_name in file_set:
+ pe, pv, pr = dataCache.pkg_pepvpr[file_name]
+ dp = dataCache.pkg_dp[file_name]
+
+ if (latest is None) or ((latest_p == dp) and (utils.vercmp(latest, (pe, pv, pr)) < 0)) or (dp > latest_p):
+ latest = (pe, pv, pr)
+ latest_f = file_name
+ latest_p = dp
+
+ return (latest, latest_f)
+
+
+def findBestProvider(pn, cfgData, dataCache, pkg_pn = None, item = None):
+ """
+ If there is a PREFERRED_VERSION, find the highest-priority bbfile
+ providing that version. If not, find the latest version provided by
+ an bbfile in the highest-priority set.
+ """
+
+ sortpkg_pn = sortPriorities(pn, dataCache, pkg_pn)
+ # Find the highest priority provider with a PREFERRED_VERSION set
+ (preferred_ver, preferred_file) = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn, item)
+ # Find the latest version of the highest priority provider
+ (latest, latest_f) = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[0])
+
+ if preferred_file is None:
+ preferred_file = latest_f
+ preferred_ver = latest
+
+ return (latest, latest_f, preferred_ver, preferred_file)
+
+
+def _filterProviders(providers, item, cfgData, dataCache):
+ """
+ Take a list of providers and filter/reorder according to the
+ environment variables
+ """
+ eligible = []
+ preferred_versions = {}
+ sortpkg_pn = {}
+
+ # The order of providers depends on the order of the files on the disk
+ # up to here. Sort pkg_pn to make dependency issues reproducible rather
+ # than effectively random.
+ providers.sort()
+
+ # Collate providers by PN
+ pkg_pn = {}
+ for p in providers:
+ pn = dataCache.pkg_fn[p]
+ if pn not in pkg_pn:
+ pkg_pn[pn] = []
+ pkg_pn[pn].append(p)
+
+ logger.debug(1, "providers for %s are: %s", item, list(sorted(pkg_pn.keys())))
+
+ # First add PREFERRED_VERSIONS
+ for pn in sorted(pkg_pn):
+ sortpkg_pn[pn] = sortPriorities(pn, dataCache, pkg_pn)
+ preferred_versions[pn] = findPreferredProvider(pn, cfgData, dataCache, sortpkg_pn[pn], item)
+ if preferred_versions[pn][1]:
+ eligible.append(preferred_versions[pn][1])
+
+ # Now add latest versions
+ for pn in sorted(sortpkg_pn):
+ if pn in preferred_versions and preferred_versions[pn][1]:
+ continue
+ preferred_versions[pn] = findLatestProvider(pn, cfgData, dataCache, sortpkg_pn[pn][0])
+ eligible.append(preferred_versions[pn][1])
+
+ if len(eligible) == 0:
+ logger.error("no eligible providers for %s", item)
+ return 0
+
+ # If pn == item, give it a slight default preference
+ # This means PREFERRED_PROVIDER_foobar defaults to foobar if available
+ for p in providers:
+ pn = dataCache.pkg_fn[p]
+ if pn != item:
+ continue
+ (newvers, fn) = preferred_versions[pn]
+ if not fn in eligible:
+ continue
+ eligible.remove(fn)
+ eligible = [fn] + eligible
+
+ return eligible
+
+
+def filterProviders(providers, item, cfgData, dataCache):
+ """
+ Take a list of providers and filter/reorder according to the
+ environment variables
+ Takes a "normal" target item
+ """
+
+ eligible = _filterProviders(providers, item, cfgData, dataCache)
+
+ prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % item)
+ if prefervar:
+ dataCache.preferred[item] = prefervar
+
+ foundUnique = False
+ if item in dataCache.preferred:
+ for p in eligible:
+ pn = dataCache.pkg_fn[p]
+ if dataCache.preferred[item] == pn:
+ logger.verbose("selecting %s to satisfy %s due to PREFERRED_PROVIDERS", pn, item)
+ eligible.remove(p)
+ eligible = [p] + eligible
+ foundUnique = True
+ break
+
+ logger.debug(1, "sorted providers for %s are: %s", item, eligible)
+
+ return eligible, foundUnique
+
+def filterProvidersRunTime(providers, item, cfgData, dataCache):
+ """
+ Take a list of providers and filter/reorder according to the
+ environment variables
+ Takes a "runtime" target item
+ """
+
+ eligible = _filterProviders(providers, item, cfgData, dataCache)
+
+ # First try and match any PREFERRED_RPROVIDER entry
+ prefervar = cfgData.getVar('PREFERRED_RPROVIDER_%s' % item)
+ foundUnique = False
+ if prefervar:
+ for p in eligible:
+ pn = dataCache.pkg_fn[p]
+ if prefervar == pn:
+ logger.verbose("selecting %s to satisfy %s due to PREFERRED_RPROVIDER", pn, item)
+ eligible.remove(p)
+ eligible = [p] + eligible
+ foundUnique = True
+ numberPreferred = 1
+ break
+
+ # If we didn't find an RPROVIDER entry, try and infer the provider from PREFERRED_PROVIDER entries
+ # by looking through the provides of each eligible recipe and seeing if a PREFERRED_PROVIDER was set.
+ # This is most useful for virtual/ entries rather than having a RPROVIDER per entry.
+ if not foundUnique:
+ # Should use dataCache.preferred here?
+ preferred = []
+ preferred_vars = []
+ pns = {}
+ for p in eligible:
+ pns[dataCache.pkg_fn[p]] = p
+ for p in eligible:
+ pn = dataCache.pkg_fn[p]
+ provides = dataCache.pn_provides[pn]
+ for provide in provides:
+ prefervar = cfgData.getVar('PREFERRED_PROVIDER_%s' % provide)
+ #logger.debug(1, "checking PREFERRED_PROVIDER_%s (value %s) against %s", provide, prefervar, pns.keys())
+ if prefervar in pns and pns[prefervar] not in preferred:
+ var = "PREFERRED_PROVIDER_%s = %s" % (provide, prefervar)
+ logger.verbose("selecting %s to satisfy runtime %s due to %s", prefervar, item, var)
+ preferred_vars.append(var)
+ pref = pns[prefervar]
+ eligible.remove(pref)
+ eligible = [pref] + eligible
+ preferred.append(pref)
+ break
+
+ numberPreferred = len(preferred)
+
+ if numberPreferred > 1:
+ logger.error("Trying to resolve runtime dependency %s resulted in conflicting PREFERRED_PROVIDER entries being found.\nThe providers found were: %s\nThe PREFERRED_PROVIDER entries resulting in this conflict were: %s. You could set PREFERRED_RPROVIDER_%s" % (item, preferred, preferred_vars, item))
+
+ logger.debug(1, "sorted runtime providers for %s are: %s", item, eligible)
+
+ return eligible, numberPreferred
+
+regexp_cache = {}
+
+def getRuntimeProviders(dataCache, rdepend):
+ """
+ Return any providers of runtime dependency
+ """
+ rproviders = []
+
+ if rdepend in dataCache.rproviders:
+ rproviders += dataCache.rproviders[rdepend]
+
+ if rdepend in dataCache.packages:
+ rproviders += dataCache.packages[rdepend]
+
+ if rproviders:
+ return rproviders
+
+ # Only search dynamic packages if we can't find anything in other variables
+ for pattern in dataCache.packages_dynamic:
+ pattern = pattern.replace('+', "\+")
+ if pattern in regexp_cache:
+ regexp = regexp_cache[pattern]
+ else:
+ try:
+ regexp = re.compile(pattern)
+ except:
+ logger.error("Error parsing regular expression '%s'", pattern)
+ raise
+ regexp_cache[pattern] = regexp
+ if regexp.match(rdepend):
+ rproviders += dataCache.packages_dynamic[pattern]
+ logger.debug(1, "Assuming %s is a dynamic package, but it may not exist" % rdepend)
+
+ return rproviders
+
+
+def buildWorldTargetList(dataCache, task=None):
+ """
+ Build package list for "bitbake world"
+ """
+ if dataCache.world_target:
+ return
+
+ logger.debug(1, "collating packages for \"world\"")
+ for f in dataCache.possible_world:
+ terminal = True
+ pn = dataCache.pkg_fn[f]
+ if task and task not in dataCache.task_deps[f]['tasks']:
+ logger.debug(2, "World build skipping %s as task %s doesn't exist", f, task)
+ terminal = False
+
+ for p in dataCache.pn_provides[pn]:
+ if p.startswith('virtual/'):
+ logger.debug(2, "World build skipping %s due to %s provider starting with virtual/", f, p)
+ terminal = False
+ break
+ for pf in dataCache.providers[p]:
+ if dataCache.pkg_fn[pf] != pn:
+ logger.debug(2, "World build skipping %s due to both us and %s providing %s", f, pf, p)
+ terminal = False
+ break
+ if terminal:
+ dataCache.world_target.add(pn)
diff --git a/poky/bitbake/lib/bb/pysh/__init__.py b/poky/bitbake/lib/bb/pysh/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/__init__.py
diff --git a/poky/bitbake/lib/bb/pysh/builtin.py b/poky/bitbake/lib/bb/pysh/builtin.py
new file mode 100644
index 000000000..a8814dc33
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/builtin.py
@@ -0,0 +1,710 @@
+# builtin.py - builtins and utilities definitions for pysh.
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+"""Builtin and internal utilities implementations.
+
+- Beware not to use python interpreter environment as if it were the shell
+environment. For instance, commands working directory must be explicitely handled
+through env['PWD'] instead of relying on python working directory.
+"""
+import errno
+import optparse
+import os
+import re
+import subprocess
+import sys
+import time
+
+def has_subprocess_bug():
+ return getattr(subprocess, 'list2cmdline') and \
+ ( subprocess.list2cmdline(['']) == '' or \
+ subprocess.list2cmdline(['foo|bar']) == 'foo|bar')
+
+# Detect python bug 1634343: "subprocess swallows empty arguments under win32"
+# <http://sourceforge.net/tracker/index.php?func=detail&aid=1634343&group_id=5470&atid=105470>
+# Also detect: "[ 1710802 ] subprocess must escape redirection characters under win32"
+# <http://sourceforge.net/tracker/index.php?func=detail&aid=1710802&group_id=5470&atid=105470>
+if has_subprocess_bug():
+ import subprocess_fix
+ subprocess.list2cmdline = subprocess_fix.list2cmdline
+
+from sherrors import *
+
+class NonExitingParser(optparse.OptionParser):
+ """OptionParser default behaviour upon error is to print the error message and
+ exit. Raise a utility error instead.
+ """
+ def error(self, msg):
+ raise UtilityError(msg)
+
+#-------------------------------------------------------------------------------
+# set special builtin
+#-------------------------------------------------------------------------------
+OPT_SET = NonExitingParser(usage="set - set or unset options and positional parameters")
+OPT_SET.add_option( '-f', action='store_true', dest='has_f', default=False,
+ help='The shell shall disable pathname expansion.')
+OPT_SET.add_option('-e', action='store_true', dest='has_e', default=False,
+ help="""When this option is on, if a simple command fails for any of the \
+ reasons listed in Consequences of Shell Errors or returns an exit status \
+ value >0, and is not part of the compound list following a while, until, \
+ or if keyword, and is not a part of an AND or OR list, and is not a \
+ pipeline preceded by the ! reserved word, then the shell shall immediately \
+ exit.""")
+OPT_SET.add_option('-x', action='store_true', dest='has_x', default=False,
+ help="""The shell shall write to standard error a trace for each command \
+ after it expands the command and before it executes it. It is unspecified \
+ whether the command that turns tracing off is traced.""")
+
+def builtin_set(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_SET.parse_args(args)
+ env = interp.get_env()
+
+ if option.has_f:
+ env.set_opt('-f')
+ if option.has_e:
+ env.set_opt('-e')
+ if option.has_x:
+ env.set_opt('-x')
+ return 0
+
+#-------------------------------------------------------------------------------
+# shift special builtin
+#-------------------------------------------------------------------------------
+def builtin_shift(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ params = interp.get_env().get_positional_args()
+ if args:
+ try:
+ n = int(args[0])
+ if n > len(params):
+ raise ValueError()
+ except ValueError:
+ return 1
+ else:
+ n = 1
+
+ params[:n] = []
+ interp.get_env().set_positional_args(params)
+ return 0
+
+#-------------------------------------------------------------------------------
+# export special builtin
+#-------------------------------------------------------------------------------
+OPT_EXPORT = NonExitingParser(usage="set - set or unset options and positional parameters")
+OPT_EXPORT.add_option('-p', action='store_true', dest='has_p', default=False)
+
+def builtin_export(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_EXPORT.parse_args(args)
+ if option.has_p:
+ raise NotImplementedError()
+
+ for arg in args:
+ try:
+ name, value = arg.split('=', 1)
+ except ValueError:
+ name, value = arg, None
+ env = interp.get_env().export(name, value)
+
+ return 0
+
+#-------------------------------------------------------------------------------
+# return special builtin
+#-------------------------------------------------------------------------------
+def builtin_return(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ res = 0
+ if args:
+ try:
+ res = int(args[0])
+ except ValueError:
+ res = 0
+ if not 0<=res<=255:
+ res = 0
+
+ # BUG: should be last executed command exit code
+ raise ReturnSignal(res)
+
+#-------------------------------------------------------------------------------
+# trap special builtin
+#-------------------------------------------------------------------------------
+def builtin_trap(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ if len(args) < 2:
+ stderr.write('trap: usage: trap [[arg] signal_spec ...]\n')
+ return 2
+
+ action = args[0]
+ for sig in args[1:]:
+ try:
+ env.traps[sig] = action
+ except Exception as e:
+ stderr.write('trap: %s\n' % str(e))
+ return 0
+
+#-------------------------------------------------------------------------------
+# unset special builtin
+#-------------------------------------------------------------------------------
+OPT_UNSET = NonExitingParser("unset - unset values and attributes of variables and functions")
+OPT_UNSET.add_option( '-f', action='store_true', dest='has_f', default=False)
+OPT_UNSET.add_option( '-v', action='store_true', dest='has_v', default=False)
+
+def builtin_unset(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_UNSET.parse_args(args)
+
+ status = 0
+ env = interp.get_env()
+ for arg in args:
+ try:
+ if option.has_f:
+ env.remove_function(arg)
+ else:
+ del env[arg]
+ except KeyError:
+ pass
+ except VarAssignmentError:
+ status = 1
+
+ return status
+
+#-------------------------------------------------------------------------------
+# wait special builtin
+#-------------------------------------------------------------------------------
+def builtin_wait(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ return interp.wait([int(arg) for arg in args])
+
+#-------------------------------------------------------------------------------
+# cat utility
+#-------------------------------------------------------------------------------
+def utility_cat(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ if not args:
+ args = ['-']
+
+ status = 0
+ for arg in args:
+ if arg == '-':
+ data = stdin.read()
+ else:
+ path = os.path.join(env['PWD'], arg)
+ try:
+ f = file(path, 'rb')
+ try:
+ data = f.read()
+ finally:
+ f.close()
+ except IOError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ status = 1
+ continue
+ stdout.write(data)
+ stdout.flush()
+ return status
+
+#-------------------------------------------------------------------------------
+# cd utility
+#-------------------------------------------------------------------------------
+OPT_CD = NonExitingParser("cd - change the working directory")
+
+def utility_cd(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_CD.parse_args(args)
+ env = interp.get_env()
+
+ directory = None
+ printdir = False
+ if not args:
+ home = env.get('HOME')
+ if home:
+ # Unspecified, do nothing
+ return 0
+ else:
+ directory = home
+ elif len(args)==1:
+ directory = args[0]
+ if directory=='-':
+ if 'OLDPWD' not in env:
+ raise UtilityError("OLDPWD not set")
+ printdir = True
+ directory = env['OLDPWD']
+ else:
+ raise UtilityError("too many arguments")
+
+ curpath = None
+ # Absolute directories will be handled correctly by the os.path.join call.
+ if not directory.startswith('.') and not directory.startswith('..'):
+ cdpaths = env.get('CDPATH', '.').split(';')
+ for cdpath in cdpaths:
+ p = os.path.join(cdpath, directory)
+ if os.path.isdir(p):
+ curpath = p
+ break
+
+ if curpath is None:
+ curpath = directory
+ curpath = os.path.join(env['PWD'], directory)
+
+ env['OLDPWD'] = env['PWD']
+ env['PWD'] = curpath
+ if printdir:
+ stdout.write('%s\n' % curpath)
+ return 0
+
+#-------------------------------------------------------------------------------
+# colon utility
+#-------------------------------------------------------------------------------
+def utility_colon(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ return 0
+
+#-------------------------------------------------------------------------------
+# echo utility
+#-------------------------------------------------------------------------------
+def utility_echo(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ # Echo only takes arguments, no options. Use printf if you need fancy stuff.
+ output = ' '.join(args) + '\n'
+ stdout.write(output)
+ stdout.flush()
+ return 0
+
+#-------------------------------------------------------------------------------
+# egrep utility
+#-------------------------------------------------------------------------------
+# egrep is usually a shell script.
+# Unfortunately, pysh does not support shell scripts *with arguments* right now,
+# so the redirection is implemented here, assuming grep is available.
+def utility_egrep(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ return run_command('grep', ['-E'] + args, interp, env, stdin, stdout,
+ stderr, debugflags)
+
+#-------------------------------------------------------------------------------
+# env utility
+#-------------------------------------------------------------------------------
+def utility_env(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ if args and args[0]=='-i':
+ raise NotImplementedError('env: -i option is not implemented')
+
+ i = 0
+ for arg in args:
+ if '=' not in arg:
+ break
+ # Update the current environment
+ name, value = arg.split('=', 1)
+ env[name] = value
+ i += 1
+
+ if args[i:]:
+ # Find then execute the specified interpreter
+ utility = env.find_in_path(args[i])
+ if not utility:
+ return 127
+ args[i:i+1] = utility
+ name = args[i]
+ args = args[i+1:]
+ try:
+ return run_command(name, args, interp, env, stdin, stdout, stderr,
+ debugflags)
+ except UtilityError:
+ stderr.write('env: failed to execute %s' % ' '.join([name]+args))
+ return 126
+ else:
+ for pair in env.get_variables().iteritems():
+ stdout.write('%s=%s\n' % pair)
+ return 0
+
+#-------------------------------------------------------------------------------
+# exit utility
+#-------------------------------------------------------------------------------
+def utility_exit(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ res = None
+ if args:
+ try:
+ res = int(args[0])
+ except ValueError:
+ res = None
+ if not 0<=res<=255:
+ res = None
+
+ if res is None:
+ # BUG: should be last executed command exit code
+ res = 0
+
+ raise ExitSignal(res)
+
+#-------------------------------------------------------------------------------
+# fgrep utility
+#-------------------------------------------------------------------------------
+# see egrep
+def utility_fgrep(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ return run_command('grep', ['-F'] + args, interp, env, stdin, stdout,
+ stderr, debugflags)
+
+#-------------------------------------------------------------------------------
+# gunzip utility
+#-------------------------------------------------------------------------------
+# see egrep
+def utility_gunzip(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ return run_command('gzip', ['-d'] + args, interp, env, stdin, stdout,
+ stderr, debugflags)
+
+#-------------------------------------------------------------------------------
+# kill utility
+#-------------------------------------------------------------------------------
+def utility_kill(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ for arg in args:
+ pid = int(arg)
+ status = subprocess.call(['pskill', '/T', str(pid)],
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ # pskill is asynchronous, hence the stupid polling loop
+ while 1:
+ p = subprocess.Popen(['pslist', str(pid)],
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ output = p.communicate()[0]
+ if ('process %d was not' % pid) in output:
+ break
+ time.sleep(1)
+ return status
+
+#-------------------------------------------------------------------------------
+# mkdir utility
+#-------------------------------------------------------------------------------
+OPT_MKDIR = NonExitingParser("mkdir - make directories.")
+OPT_MKDIR.add_option('-p', action='store_true', dest='has_p', default=False)
+
+def utility_mkdir(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ # TODO: implement umask
+ # TODO: implement proper utility error report
+ option, args = OPT_MKDIR.parse_args(args)
+ for arg in args:
+ path = os.path.join(env['PWD'], arg)
+ if option.has_p:
+ try:
+ os.makedirs(path)
+ except IOError as e:
+ if e.errno != errno.EEXIST:
+ raise
+ else:
+ os.mkdir(path)
+ return 0
+
+#-------------------------------------------------------------------------------
+# netstat utility
+#-------------------------------------------------------------------------------
+def utility_netstat(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ # Do you really expect me to implement netstat ?
+ # This empty form is enough for Mercurial tests since it's
+ # supposed to generate nothing upon success. Faking this test
+ # is not a big deal either.
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ return 0
+
+#-------------------------------------------------------------------------------
+# pwd utility
+#-------------------------------------------------------------------------------
+OPT_PWD = NonExitingParser("pwd - return working directory name")
+OPT_PWD.add_option('-L', action='store_true', dest='has_L', default=True,
+ help="""If the PWD environment variable contains an absolute pathname of \
+ the current directory that does not contain the filenames dot or dot-dot, \
+ pwd shall write this pathname to standard output. Otherwise, the -L option \
+ shall behave as the -P option.""")
+OPT_PWD.add_option('-P', action='store_true', dest='has_L', default=False,
+ help="""The absolute pathname written shall not contain filenames that, in \
+ the context of the pathname, refer to files of type symbolic link.""")
+
+def utility_pwd(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_PWD.parse_args(args)
+ stdout.write('%s\n' % env['PWD'])
+ return 0
+
+#-------------------------------------------------------------------------------
+# printf utility
+#-------------------------------------------------------------------------------
+RE_UNESCAPE = re.compile(r'(\\x[a-zA-Z0-9]{2}|\\[0-7]{1,3}|\\.)')
+
+def utility_printf(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ def replace(m):
+ assert m.group()
+ g = m.group()[1:]
+ if g.startswith('x'):
+ return chr(int(g[1:], 16))
+ if len(g) <= 3 and len([c for c in g if c in '01234567']) == len(g):
+ # Yay, an octal number
+ return chr(int(g, 8))
+ return {
+ 'a': '\a',
+ 'b': '\b',
+ 'f': '\f',
+ 'n': '\n',
+ 'r': '\r',
+ 't': '\t',
+ 'v': '\v',
+ '\\': '\\',
+ }.get(g)
+
+ # Convert escape sequences
+ format = re.sub(RE_UNESCAPE, replace, args[0])
+ stdout.write(format % tuple(args[1:]))
+ return 0
+
+#-------------------------------------------------------------------------------
+# true utility
+#-------------------------------------------------------------------------------
+def utility_true(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ return 0
+
+#-------------------------------------------------------------------------------
+# sed utility
+#-------------------------------------------------------------------------------
+RE_SED = re.compile(r'^s(.).*\1[a-zA-Z]*$')
+
+# cygwin sed fails with some expressions when they do not end with a single space.
+# see unit tests for details. Interestingly, the same expressions works perfectly
+# in cygwin shell.
+def utility_sed(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ # Scan pattern arguments and append a space if necessary
+ for i in range(len(args)):
+ if not RE_SED.search(args[i]):
+ continue
+ args[i] = args[i] + ' '
+
+ return run_command(name, args, interp, env, stdin, stdout,
+ stderr, debugflags)
+
+#-------------------------------------------------------------------------------
+# sleep utility
+#-------------------------------------------------------------------------------
+def utility_sleep(name, args, interp, env, stdin, stdout, stderr, debugflags):
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+ time.sleep(int(args[0]))
+ return 0
+
+#-------------------------------------------------------------------------------
+# sort utility
+#-------------------------------------------------------------------------------
+OPT_SORT = NonExitingParser("sort - sort, merge, or sequence check text files")
+
+def utility_sort(name, args, interp, env, stdin, stdout, stderr, debugflags):
+
+ def sort(path):
+ if path == '-':
+ lines = stdin.readlines()
+ else:
+ try:
+ f = file(path)
+ try:
+ lines = f.readlines()
+ finally:
+ f.close()
+ except IOError as e:
+ stderr.write(str(e) + '\n')
+ return 1
+
+ if lines and lines[-1][-1]!='\n':
+ lines[-1] = lines[-1] + '\n'
+ return lines
+
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ option, args = OPT_SORT.parse_args(args)
+ alllines = []
+
+ if len(args)<=0:
+ args += ['-']
+
+ # Load all files lines
+ curdir = os.getcwd()
+ try:
+ os.chdir(env['PWD'])
+ for path in args:
+ alllines += sort(path)
+ finally:
+ os.chdir(curdir)
+
+ alllines.sort()
+ for line in alllines:
+ stdout.write(line)
+ return 0
+
+#-------------------------------------------------------------------------------
+# hg utility
+#-------------------------------------------------------------------------------
+
+hgcommands = [
+ 'add',
+ 'addremove',
+ 'commit', 'ci',
+ 'debugrename',
+ 'debugwalk',
+ 'falabala', # Dummy command used in a mercurial test
+ 'incoming',
+ 'locate',
+ 'pull',
+ 'push',
+ 'qinit',
+ 'remove', 'rm',
+ 'rename', 'mv',
+ 'revert',
+ 'showconfig',
+ 'status', 'st',
+ 'strip',
+ ]
+
+def rewriteslashes(name, args):
+ # Several hg commands output file paths, rewrite the separators
+ if len(args) > 1 and name.lower().endswith('python') \
+ and args[0].endswith('hg'):
+ for cmd in hgcommands:
+ if cmd in args[1:]:
+ return True
+
+ # svn output contains many paths with OS specific separators.
+ # Normalize these to unix paths.
+ base = os.path.basename(name)
+ if base.startswith('svn'):
+ return True
+
+ return False
+
+def rewritehg(output):
+ if not output:
+ return output
+ # Rewrite os specific messages
+ output = output.replace(': The system cannot find the file specified',
+ ': No such file or directory')
+ output = re.sub(': Access is denied.*$', ': Permission denied', output)
+ output = output.replace(': No connection could be made because the target machine actively refused it',
+ ': Connection refused')
+ return output
+
+
+def run_command(name, args, interp, env, stdin, stdout,
+ stderr, debugflags):
+ # Execute the command
+ if 'debug-utility' in debugflags:
+ print interp.log(' '.join([name, str(args), interp['PWD']]) + '\n')
+
+ hgbin = interp.options().hgbinary
+ ishg = hgbin and ('hg' in name or args and 'hg' in args[0])
+ unixoutput = 'cygwin' in name or ishg
+
+ exec_env = env.get_variables()
+ try:
+ # BUG: comparing file descriptor is clearly not a reliable way to tell
+ # whether they point on the same underlying object. But in pysh limited
+ # scope this is usually right, we do not expect complicated redirections
+ # besides usual 2>&1.
+ # Still there is one case we have but cannot deal with is when stdout
+ # and stderr are redirected *by pysh caller*. This the reason for the
+ # --redirect pysh() option.
+ # Now, we want to know they are the same because we sometimes need to
+ # transform the command output, mostly remove CR-LF to ensure that
+ # command output is unix-like. Cygwin utilies are a special case because
+ # they explicitely set their output streams to binary mode, so we have
+ # nothing to do. For all others commands, we have to guess whether they
+ # are sending text data, in which case the transformation must be done.
+ # Again, the NUL character test is unreliable but should be enough for
+ # hg tests.
+ redirected = stdout.fileno()==stderr.fileno()
+ if not redirected:
+ p = subprocess.Popen([name] + args, cwd=env['PWD'], env=exec_env,
+ stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ else:
+ p = subprocess.Popen([name] + args, cwd=env['PWD'], env=exec_env,
+ stdin=stdin, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ out, err = p.communicate()
+ except WindowsError as e:
+ raise UtilityError(str(e))
+
+ if not unixoutput:
+ def encode(s):
+ if '\0' in s:
+ return s
+ return s.replace('\r\n', '\n')
+ else:
+ encode = lambda s: s
+
+ if rewriteslashes(name, args):
+ encode1_ = encode
+ def encode(s):
+ s = encode1_(s)
+ s = s.replace('\\\\', '\\')
+ s = s.replace('\\', '/')
+ return s
+
+ if ishg:
+ encode2_ = encode
+ def encode(s):
+ return rewritehg(encode2_(s))
+
+ stdout.write(encode(out))
+ if not redirected:
+ stderr.write(encode(err))
+ return p.returncode
+
diff --git a/poky/bitbake/lib/bb/pysh/interp.py b/poky/bitbake/lib/bb/pysh/interp.py
new file mode 100644
index 000000000..d14ecf3c6
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/interp.py
@@ -0,0 +1,1367 @@
+# interp.py - shell interpreter for pysh.
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+"""Implement the shell interpreter.
+
+Most references are made to "The Open Group Base Specifications Issue 6".
+<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>
+"""
+# TODO: document the fact input streams must implement fileno() so Popen will work correctly.
+# it requires non-stdin stream to be implemented as files. Still to be tested...
+# DOC: pathsep is used in PATH instead of ':'. Clearly, there are path syntax issues here.
+# TODO: stop command execution upon error.
+# TODO: sort out the filename/io_number mess. It should be possible to use filenames only.
+# TODO: review subshell implementation
+# TODO: test environment cloning for non-special builtins
+# TODO: set -x should not rebuild commands from tokens, assignments/redirections are lost
+# TODO: unit test for variable assignment
+# TODO: test error management wrt error type/utility type
+# TODO: test for binary output everywhere
+# BUG: debug-parsing does not pass log file to PLY. Maybe a PLY upgrade is necessary.
+import base64
+import cPickle as pickle
+import errno
+import glob
+import os
+import re
+import subprocess
+import sys
+import tempfile
+
+try:
+ s = set()
+ del s
+except NameError:
+ from Set import Set as set
+
+import builtin
+from sherrors import *
+import pyshlex
+import pyshyacc
+
+def mappend(func, *args, **kargs):
+ """Like map but assume func returns a list. Returned lists are merged into
+ a single one.
+ """
+ return reduce(lambda a,b: a+b, map(func, *args, **kargs), [])
+
+class FileWrapper:
+ """File object wrapper to ease debugging.
+
+ Allow mode checking and implement file duplication through a simple
+ reference counting scheme. Not sure the latter is really useful since
+ only real file descriptors can be used.
+ """
+ def __init__(self, mode, file, close=True):
+ if mode not in ('r', 'w', 'a'):
+ raise IOError('invalid mode: %s' % mode)
+ self._mode = mode
+ self._close = close
+ if isinstance(file, FileWrapper):
+ if file._refcount[0] <= 0:
+ raise IOError(0, 'Error')
+ self._refcount = file._refcount
+ self._refcount[0] += 1
+ self._file = file._file
+ else:
+ self._refcount = [1]
+ self._file = file
+
+ def dup(self):
+ return FileWrapper(self._mode, self, self._close)
+
+ def fileno(self):
+ """fileno() should be only necessary for input streams."""
+ return self._file.fileno()
+
+ def read(self, size=-1):
+ if self._mode!='r':
+ raise IOError(0, 'Error')
+ return self._file.read(size)
+
+ def readlines(self, *args, **kwargs):
+ return self._file.readlines(*args, **kwargs)
+
+ def write(self, s):
+ if self._mode not in ('w', 'a'):
+ raise IOError(0, 'Error')
+ return self._file.write(s)
+
+ def flush(self):
+ self._file.flush()
+
+ def close(self):
+ if not self._refcount:
+ return
+ assert self._refcount[0] > 0
+
+ self._refcount[0] -= 1
+ if self._refcount[0] == 0:
+ self._mode = 'c'
+ if self._close:
+ self._file.close()
+ self._refcount = None
+
+ def mode(self):
+ return self._mode
+
+ def __getattr__(self, name):
+ if name == 'name':
+ self.name = getattr(self._file, name)
+ return self.name
+ else:
+ raise AttributeError(name)
+
+ def __del__(self):
+ self.close()
+
+
+def win32_open_devnull(mode):
+ return open('NUL', mode)
+
+
+class Redirections:
+ """Stores open files and their mapping to pseudo-sh file descriptor.
+ """
+ # BUG: redirections are not handled correctly: 1>&3 2>&3 3>&4 does
+ # not make 1 to redirect to 4
+ def __init__(self, stdin=None, stdout=None, stderr=None):
+ self._descriptors = {}
+ if stdin is not None:
+ self._add_descriptor(0, stdin)
+ if stdout is not None:
+ self._add_descriptor(1, stdout)
+ if stderr is not None:
+ self._add_descriptor(2, stderr)
+
+ def add_here_document(self, interp, name, content, io_number=None):
+ if io_number is None:
+ io_number = 0
+
+ if name==pyshlex.unquote_wordtree(name):
+ content = interp.expand_here_document(('TOKEN', content))
+
+ # Write document content in a temporary file
+ tmp = tempfile.TemporaryFile()
+ try:
+ tmp.write(content)
+ tmp.flush()
+ tmp.seek(0)
+ self._add_descriptor(io_number, FileWrapper('r', tmp))
+ except:
+ tmp.close()
+ raise
+
+ def add(self, interp, op, filename, io_number=None):
+ if op not in ('<', '>', '>|', '>>', '>&'):
+ # TODO: add descriptor duplication and here_documents
+ raise RedirectionError('Unsupported redirection operator "%s"' % op)
+
+ if io_number is not None:
+ io_number = int(io_number)
+
+ if (op == '>&' and filename.isdigit()) or filename=='-':
+ # No expansion for file descriptors, quote them if you want a filename
+ fullname = filename
+ else:
+ if filename.startswith('/'):
+ # TODO: win32 kludge
+ if filename=='/dev/null':
+ fullname = 'NUL'
+ else:
+ # TODO: handle absolute pathnames, they are unlikely to exist on the
+ # current platform (win32 for instance).
+ raise NotImplementedError()
+ else:
+ fullname = interp.expand_redirection(('TOKEN', filename))
+ if not fullname:
+ raise RedirectionError('%s: ambiguous redirect' % filename)
+ # Build absolute path based on PWD
+ fullname = os.path.join(interp.get_env()['PWD'], fullname)
+
+ if op=='<':
+ return self._add_input_redirection(interp, fullname, io_number)
+ elif op in ('>', '>|'):
+ clobber = ('>|'==op)
+ return self._add_output_redirection(interp, fullname, io_number, clobber)
+ elif op=='>>':
+ return self._add_output_appending(interp, fullname, io_number)
+ elif op=='>&':
+ return self._dup_output_descriptor(fullname, io_number)
+
+ def close(self):
+ if self._descriptors is not None:
+ for desc in self._descriptors.itervalues():
+ desc.flush()
+ desc.close()
+ self._descriptors = None
+
+ def stdin(self):
+ return self._descriptors[0]
+
+ def stdout(self):
+ return self._descriptors[1]
+
+ def stderr(self):
+ return self._descriptors[2]
+
+ def clone(self):
+ clone = Redirections()
+ for desc, fileobj in self._descriptors.iteritems():
+ clone._descriptors[desc] = fileobj.dup()
+ return clone
+
+ def _add_output_redirection(self, interp, filename, io_number, clobber):
+ if io_number is None:
+ # io_number default to standard output
+ io_number = 1
+
+ if not clobber and interp.get_env().has_opt('-C') and os.path.isfile(filename):
+ # File already exist in no-clobber mode, bail out
+ raise RedirectionError('File "%s" already exists' % filename)
+
+ # Open and register
+ self._add_file_descriptor(io_number, filename, 'w')
+
+ def _add_output_appending(self, interp, filename, io_number):
+ if io_number is None:
+ io_number = 1
+ self._add_file_descriptor(io_number, filename, 'a')
+
+ def _add_input_redirection(self, interp, filename, io_number):
+ if io_number is None:
+ io_number = 0
+ self._add_file_descriptor(io_number, filename, 'r')
+
+ def _add_file_descriptor(self, io_number, filename, mode):
+ try:
+ if filename.startswith('/'):
+ if filename=='/dev/null':
+ f = win32_open_devnull(mode+'b')
+ else:
+ # TODO: handle absolute pathnames, they are unlikely to exist on the
+ # current platform (win32 for instance).
+ raise NotImplementedError('cannot open absolute path %s' % repr(filename))
+ else:
+ f = file(filename, mode+'b')
+ except IOError as e:
+ raise RedirectionError(str(e))
+
+ wrapper = None
+ try:
+ wrapper = FileWrapper(mode, f)
+ f = None
+ self._add_descriptor(io_number, wrapper)
+ except:
+ if f: f.close()
+ if wrapper: wrapper.close()
+ raise
+
+ def _dup_output_descriptor(self, source_fd, dest_fd):
+ if source_fd is None:
+ source_fd = 1
+ self._dup_file_descriptor(source_fd, dest_fd, 'w')
+
+ def _dup_file_descriptor(self, source_fd, dest_fd, mode):
+ source_fd = int(source_fd)
+ if source_fd not in self._descriptors:
+ raise RedirectionError('"%s" is not a valid file descriptor' % str(source_fd))
+ source = self._descriptors[source_fd]
+
+ if source.mode()!=mode:
+ raise RedirectionError('Descriptor %s cannot be duplicated in mode "%s"' % (str(source), mode))
+
+ if dest_fd=='-':
+ # Close the source descriptor
+ del self._descriptors[source_fd]
+ source.close()
+ else:
+ dest_fd = int(dest_fd)
+ if dest_fd not in self._descriptors:
+ raise RedirectionError('Cannot replace file descriptor %s' % str(dest_fd))
+
+ dest = self._descriptors[dest_fd]
+ if dest.mode()!=mode:
+ raise RedirectionError('Descriptor %s cannot be cannot be redirected in mode "%s"' % (str(dest), mode))
+
+ self._descriptors[dest_fd] = source.dup()
+ dest.close()
+
+ def _add_descriptor(self, io_number, file):
+ io_number = int(io_number)
+
+ if io_number in self._descriptors:
+ # Close the current descriptor
+ d = self._descriptors[io_number]
+ del self._descriptors[io_number]
+ d.close()
+
+ self._descriptors[io_number] = file
+
+ def __str__(self):
+ names = [('%d=%r' % (k, getattr(v, 'name', None))) for k,v
+ in self._descriptors.iteritems()]
+ names = ','.join(names)
+ return 'Redirections(%s)' % names
+
+ def __del__(self):
+ self.close()
+
+def cygwin_to_windows_path(path):
+ """Turn /cygdrive/c/foo into c:/foo, or return path if it
+ is not a cygwin path.
+ """
+ if not path.startswith('/cygdrive/'):
+ return path
+ path = path[len('/cygdrive/'):]
+ path = path[:1] + ':' + path[1:]
+ return path
+
+def win32_to_unix_path(path):
+ if path is not None:
+ path = path.replace('\\', '/')
+ return path
+
+_RE_SHEBANG = re.compile(r'^\#!\s?([^\s]+)(?:\s([^\s]+))?')
+_SHEBANG_CMDS = {
+ '/usr/bin/env': 'env',
+ '/bin/sh': 'pysh',
+ 'python': 'python',
+}
+
+def resolve_shebang(path, ignoreshell=False):
+ """Return a list of arguments as shebang interpreter call or an empty list
+ if path does not refer to an executable script.
+ See <http://www.opengroup.org/austin/docs/austin_51r2.txt>.
+
+ ignoreshell - set to True to ignore sh shebangs. Return an empty list instead.
+ """
+ try:
+ f = file(path)
+ try:
+ # At most 80 characters in the first line
+ header = f.read(80).splitlines()[0]
+ finally:
+ f.close()
+
+ m = _RE_SHEBANG.search(header)
+ if not m:
+ return []
+ cmd, arg = m.group(1,2)
+ if os.path.isfile(cmd):
+ # Keep this one, the hg script for instance contains a weird windows
+ # shebang referencing the current python install.
+ cmdfile = os.path.basename(cmd).lower()
+ if cmdfile == 'python.exe':
+ cmd = 'python'
+ pass
+ elif cmd not in _SHEBANG_CMDS:
+ raise CommandNotFound('Unknown interpreter "%s" referenced in '\
+ 'shebang' % header)
+ cmd = _SHEBANG_CMDS.get(cmd)
+ if cmd is None or (ignoreshell and cmd == 'pysh'):
+ return []
+ if arg is None:
+ return [cmd, win32_to_unix_path(path)]
+ return [cmd, arg, win32_to_unix_path(path)]
+ except IOError as e:
+ if e.errno!=errno.ENOENT and \
+ (e.errno!=errno.EPERM and not os.path.isdir(path)): # Opening a directory raises EPERM
+ raise
+ return []
+
+def win32_find_in_path(name, path):
+ if isinstance(path, str):
+ path = path.split(os.pathsep)
+
+ exts = os.environ.get('PATHEXT', '').lower().split(os.pathsep)
+ for p in path:
+ p_name = os.path.join(p, name)
+
+ prefix = resolve_shebang(p_name)
+ if prefix:
+ return prefix
+
+ for ext in exts:
+ p_name_ext = p_name + ext
+ if os.path.exists(p_name_ext):
+ return [win32_to_unix_path(p_name_ext)]
+ return []
+
+class Traps(dict):
+ def __setitem__(self, key, value):
+ if key not in ('EXIT',):
+ raise NotImplementedError()
+ super(Traps, self).__setitem__(key, value)
+
+# IFS white spaces character class
+_IFS_WHITESPACES = (' ', '\t', '\n')
+
+class Environment:
+ """Environment holds environment variables, export table, function
+ definitions and whatever is defined in 2.12 "Shell Execution Environment",
+ redirection excepted.
+ """
+ def __init__(self, pwd):
+ self._opt = set() #Shell options
+
+ self._functions = {}
+ self._env = {'?': '0', '#': '0'}
+ self._exported = set([
+ 'HOME', 'IFS', 'PATH'
+ ])
+
+ # Set environment vars with side-effects
+ self._ifs_ws = None # Set of IFS whitespace characters
+ self._ifs_re = None # Regular expression used to split between words using IFS classes
+ self['IFS'] = ''.join(_IFS_WHITESPACES) #Default environment values
+ self['PWD'] = pwd
+ self.traps = Traps()
+
+ def clone(self, subshell=False):
+ env = Environment(self['PWD'])
+ env._opt = set(self._opt)
+ for k,v in self.get_variables().iteritems():
+ if k in self._exported:
+ env.export(k,v)
+ elif subshell:
+ env[k] = v
+
+ if subshell:
+ env._functions = dict(self._functions)
+
+ return env
+
+ def __getitem__(self, key):
+ if key in ('@', '*', '-', '$'):
+ raise NotImplementedError('%s is not implemented' % repr(key))
+ return self._env[key]
+
+ def get(self, key, defval=None):
+ try:
+ return self[key]
+ except KeyError:
+ return defval
+
+ def __setitem__(self, key, value):
+ if key=='IFS':
+ # Update the whitespace/non-whitespace classes
+ self._update_ifs(value)
+ elif key=='PWD':
+ pwd = os.path.abspath(value)
+ if not os.path.isdir(pwd):
+ raise VarAssignmentError('Invalid directory %s' % value)
+ value = pwd
+ elif key in ('?', '!'):
+ value = str(int(value))
+ self._env[key] = value
+
+ def __delitem__(self, key):
+ if key in ('IFS', 'PWD', '?'):
+ raise VarAssignmentError('%s cannot be unset' % key)
+ del self._env[key]
+
+ def __contains__(self, item):
+ return item in self._env
+
+ def set_positional_args(self, args):
+ """Set the content of 'args' as positional argument from 1 to len(args).
+ Return previous argument as a list of strings.
+ """
+ # Save and remove previous arguments
+ prevargs = []
+ for i in range(int(self._env['#'])):
+ i = str(i+1)
+ prevargs.append(self._env[i])
+ del self._env[i]
+ self._env['#'] = '0'
+
+ #Set new ones
+ for i,arg in enumerate(args):
+ self._env[str(i+1)] = str(arg)
+ self._env['#'] = str(len(args))
+
+ return prevargs
+
+ def get_positional_args(self):
+ return [self._env[str(i+1)] for i in range(int(self._env['#']))]
+
+ def get_variables(self):
+ return dict(self._env)
+
+ def export(self, key, value=None):
+ if value is not None:
+ self[key] = value
+ self._exported.add(key)
+
+ def get_exported(self):
+ return [(k,self._env.get(k)) for k in self._exported]
+
+ def split_fields(self, word):
+ if not self._ifs_ws or not word:
+ return [word]
+ return re.split(self._ifs_re, word)
+
+ def _update_ifs(self, value):
+ """Update the split_fields related variables when IFS character set is
+ changed.
+ """
+ # TODO: handle NULL IFS
+
+ # Separate characters in whitespace and non-whitespace
+ chars = set(value)
+ ws = [c for c in chars if c in _IFS_WHITESPACES]
+ nws = [c for c in chars if c not in _IFS_WHITESPACES]
+
+ # Keep whitespaces in a string for left and right stripping
+ self._ifs_ws = ''.join(ws)
+
+ # Build a regexp to split fields
+ trailing = '[' + ''.join([re.escape(c) for c in ws]) + ']'
+ if nws:
+ # First, the single non-whitespace occurence.
+ nws = '[' + ''.join([re.escape(c) for c in nws]) + ']'
+ nws = '(?:' + trailing + '*' + nws + trailing + '*' + '|' + trailing + '+)'
+ else:
+ # Then mix all parts with quantifiers
+ nws = trailing + '+'
+ self._ifs_re = re.compile(nws)
+
+ def has_opt(self, opt, val=None):
+ return (opt, val) in self._opt
+
+ def set_opt(self, opt, val=None):
+ self._opt.add((opt, val))
+
+ def find_in_path(self, name, pwd=False):
+ path = self._env.get('PATH', '').split(os.pathsep)
+ if pwd:
+ path[:0] = [self['PWD']]
+ if os.name == 'nt':
+ return win32_find_in_path(name, self._env.get('PATH', ''))
+ else:
+ raise NotImplementedError()
+
+ def define_function(self, name, body):
+ if not is_name(name):
+ raise ShellSyntaxError('%s is not a valid function name' % repr(name))
+ self._functions[name] = body
+
+ def remove_function(self, name):
+ del self._functions[name]
+
+ def is_function(self, name):
+ return name in self._functions
+
+ def get_function(self, name):
+ return self._functions.get(name)
+
+
+name_charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
+name_charset = dict(zip(name_charset,name_charset))
+
+def match_name(s):
+ """Return the length in characters of the longest prefix made of name
+ allowed characters in s.
+ """
+ for i,c in enumerate(s):
+ if c not in name_charset:
+ return s[:i]
+ return s
+
+def is_name(s):
+ return len([c for c in s if c not in name_charset])<=0
+
+def is_special_param(c):
+ return len(c)==1 and c in ('@','*','#','?','-','$','!','0')
+
+def utility_not_implemented(name, *args, **kwargs):
+ raise NotImplementedError('%s utility is not implemented' % name)
+
+
+class Utility:
+ """Define utilities properties:
+ func -- utility callable. See builtin module for utility samples.
+ is_special -- see XCU 2.8.
+ """
+ def __init__(self, func, is_special=0):
+ self.func = func
+ self.is_special = bool(is_special)
+
+
+def encodeargs(args):
+ def encodearg(s):
+ lines = base64.encodestring(s)
+ lines = [l.splitlines()[0] for l in lines]
+ return ''.join(lines)
+
+ s = pickle.dumps(args)
+ return encodearg(s)
+
+def decodeargs(s):
+ s = base64.decodestring(s)
+ return pickle.loads(s)
+
+
+class GlobError(Exception):
+ pass
+
+class Options:
+ def __init__(self):
+ # True if Mercurial operates with binary streams
+ self.hgbinary = True
+
+class Interpreter:
+ # Implementation is very basic: the execute() method just makes a DFS on the
+ # AST and execute nodes one by one. Nodes are tuple (name,obj) where name
+ # is a string identifier and obj the AST element returned by the parser.
+ #
+ # Handler are named after the node identifiers.
+ # TODO: check node names and remove the switch in execute with some
+ # dynamic getattr() call to find node handlers.
+ """Shell interpreter.
+
+ The following debugging flags can be passed:
+ debug-parsing - enable PLY debugging.
+ debug-tree - print the generated AST.
+ debug-cmd - trace command execution before word expansion, plus exit status.
+ debug-utility - trace utility execution.
+ """
+
+ # List supported commands.
+ COMMANDS = {
+ 'cat': Utility(builtin.utility_cat,),
+ 'cd': Utility(builtin.utility_cd,),
+ ':': Utility(builtin.utility_colon,),
+ 'echo': Utility(builtin.utility_echo),
+ 'env': Utility(builtin.utility_env),
+ 'exit': Utility(builtin.utility_exit),
+ 'export': Utility(builtin.builtin_export, is_special=1),
+ 'egrep': Utility(builtin.utility_egrep),
+ 'fgrep': Utility(builtin.utility_fgrep),
+ 'gunzip': Utility(builtin.utility_gunzip),
+ 'kill': Utility(builtin.utility_kill),
+ 'mkdir': Utility(builtin.utility_mkdir),
+ 'netstat': Utility(builtin.utility_netstat),
+ 'printf': Utility(builtin.utility_printf),
+ 'pwd': Utility(builtin.utility_pwd),
+ 'return': Utility(builtin.builtin_return, is_special=1),
+ 'sed': Utility(builtin.utility_sed,),
+ 'set': Utility(builtin.builtin_set,),
+ 'shift': Utility(builtin.builtin_shift,),
+ 'sleep': Utility(builtin.utility_sleep,),
+ 'sort': Utility(builtin.utility_sort,),
+ 'trap': Utility(builtin.builtin_trap, is_special=1),
+ 'true': Utility(builtin.utility_true),
+ 'unset': Utility(builtin.builtin_unset, is_special=1),
+ 'wait': Utility(builtin.builtin_wait, is_special=1),
+ }
+
+ def __init__(self, pwd, debugflags = [], env=None, redirs=None, stdin=None,
+ stdout=None, stderr=None, opts=Options()):
+ self._env = env
+ if self._env is None:
+ self._env = Environment(pwd)
+ self._children = {}
+
+ self._redirs = redirs
+ self._close_redirs = False
+
+ if self._redirs is None:
+ if stdin is None:
+ stdin = sys.stdin
+ if stdout is None:
+ stdout = sys.stdout
+ if stderr is None:
+ stderr = sys.stderr
+ stdin = FileWrapper('r', stdin, False)
+ stdout = FileWrapper('w', stdout, False)
+ stderr = FileWrapper('w', stderr, False)
+ self._redirs = Redirections(stdin, stdout, stderr)
+ self._close_redirs = True
+
+ self._debugflags = list(debugflags)
+ self._logfile = sys.stderr
+ self._options = opts
+
+ def close(self):
+ """Must be called when the interpreter is no longer used."""
+ script = self._env.traps.get('EXIT')
+ if script:
+ try:
+ self.execute_script(script=script)
+ except:
+ pass
+
+ if self._redirs is not None and self._close_redirs:
+ self._redirs.close()
+ self._redirs = None
+
+ def log(self, s):
+ self._logfile.write(s)
+ self._logfile.flush()
+
+ def __getitem__(self, key):
+ return self._env[key]
+
+ def __setitem__(self, key, value):
+ self._env[key] = value
+
+ def options(self):
+ return self._options
+
+ def redirect(self, redirs, ios):
+ def add_redir(io):
+ if isinstance(io, pyshyacc.IORedirect):
+ redirs.add(self, io.op, io.filename, io.io_number)
+ else:
+ redirs.add_here_document(self, io.name, io.content, io.io_number)
+
+ map(add_redir, ios)
+ return redirs
+
+ def execute_script(self, script=None, ast=None, sourced=False,
+ scriptpath=None):
+ """If script is not None, parse the input. Otherwise takes the supplied
+ AST. Then execute the AST.
+ Return the script exit status.
+ """
+ try:
+ if scriptpath is not None:
+ self._env['0'] = os.path.abspath(scriptpath)
+
+ if script is not None:
+ debug_parsing = ('debug-parsing' in self._debugflags)
+ cmds, script = pyshyacc.parse(script, True, debug_parsing)
+ if 'debug-tree' in self._debugflags:
+ pyshyacc.print_commands(cmds, self._logfile)
+ self._logfile.flush()
+ else:
+ cmds, script = ast, ''
+
+ status = 0
+ for cmd in cmds:
+ try:
+ status = self.execute(cmd)
+ except ExitSignal as e:
+ if sourced:
+ raise
+ status = int(e.args[0])
+ return status
+ except ShellError:
+ self._env['?'] = 1
+ raise
+ if 'debug-utility' in self._debugflags or 'debug-cmd' in self._debugflags:
+ self.log('returncode ' + str(status)+ '\n')
+ return status
+ except CommandNotFound as e:
+ print >>self._redirs.stderr, str(e)
+ self._redirs.stderr.flush()
+ # Command not found by non-interactive shell
+ # return 127
+ raise
+ except RedirectionError as e:
+ # TODO: should be handled depending on the utility status
+ print >>self._redirs.stderr, str(e)
+ self._redirs.stderr.flush()
+ # Command not found by non-interactive shell
+ # return 127
+ raise
+
+ def dotcommand(self, env, args):
+ if len(args) < 1:
+ raise ShellError('. expects at least one argument')
+ path = args[0]
+ if '/' not in path:
+ found = env.find_in_path(args[0], True)
+ if found:
+ path = found[0]
+ script = file(path).read()
+ return self.execute_script(script=script, sourced=True)
+
+ def execute(self, token, redirs=None):
+ """Execute and AST subtree with supplied redirections overriding default
+ interpreter ones.
+ Return the exit status.
+ """
+ if not token:
+ return 0
+
+ if redirs is None:
+ redirs = self._redirs
+
+ if isinstance(token, list):
+ # Commands sequence
+ res = 0
+ for t in token:
+ res = self.execute(t, redirs)
+ return res
+
+ type, value = token
+ status = 0
+ if type=='simple_command':
+ redirs_copy = redirs.clone()
+ try:
+ # TODO: define and handle command return values
+ # TODO: implement set -e
+ status = self._execute_simple_command(value, redirs_copy)
+ finally:
+ redirs_copy.close()
+ elif type=='pipeline':
+ status = self._execute_pipeline(value, redirs)
+ elif type=='and_or':
+ status = self._execute_and_or(value, redirs)
+ elif type=='for_clause':
+ status = self._execute_for_clause(value, redirs)
+ elif type=='while_clause':
+ status = self._execute_while_clause(value, redirs)
+ elif type=='function_definition':
+ status = self._execute_function_definition(value, redirs)
+ elif type=='brace_group':
+ status = self._execute_brace_group(value, redirs)
+ elif type=='if_clause':
+ status = self._execute_if_clause(value, redirs)
+ elif type=='subshell':
+ status = self.subshell(ast=value.cmds, redirs=redirs)
+ elif type=='async':
+ status = self._asynclist(value)
+ elif type=='redirect_list':
+ redirs_copy = self.redirect(redirs.clone(), value.redirs)
+ try:
+ status = self.execute(value.cmd, redirs_copy)
+ finally:
+ redirs_copy.close()
+ else:
+ raise NotImplementedError('Unsupported token type ' + type)
+
+ if status < 0:
+ status = 255
+ return status
+
+ def _execute_if_clause(self, if_clause, redirs):
+ cond_status = self.execute(if_clause.cond, redirs)
+ if cond_status==0:
+ return self.execute(if_clause.if_cmds, redirs)
+ else:
+ return self.execute(if_clause.else_cmds, redirs)
+
+ def _execute_brace_group(self, group, redirs):
+ status = 0
+ for cmd in group.cmds:
+ status = self.execute(cmd, redirs)
+ return status
+
+ def _execute_function_definition(self, fundef, redirs):
+ self._env.define_function(fundef.name, fundef.body)
+ return 0
+
+ def _execute_while_clause(self, while_clause, redirs):
+ status = 0
+ while 1:
+ cond_status = 0
+ for cond in while_clause.condition:
+ cond_status = self.execute(cond, redirs)
+
+ if cond_status:
+ break
+
+ for cmd in while_clause.cmds:
+ status = self.execute(cmd, redirs)
+
+ return status
+
+ def _execute_for_clause(self, for_clause, redirs):
+ if not is_name(for_clause.name):
+ raise ShellSyntaxError('%s is not a valid name' % repr(for_clause.name))
+ items = mappend(self.expand_token, for_clause.items)
+
+ status = 0
+ for item in items:
+ self._env[for_clause.name] = item
+ for cmd in for_clause.cmds:
+ status = self.execute(cmd, redirs)
+ return status
+
+ def _execute_and_or(self, or_and, redirs):
+ res = self.execute(or_and.left, redirs)
+ if (or_and.op=='&&' and res==0) or (or_and.op!='&&' and res!=0):
+ res = self.execute(or_and.right, redirs)
+ return res
+
+ def _execute_pipeline(self, pipeline, redirs):
+ if len(pipeline.commands)==1:
+ status = self.execute(pipeline.commands[0], redirs)
+ else:
+ # Execute all commands one after the other
+ status = 0
+ inpath, outpath = None, None
+ try:
+ # Commands inputs and outputs cannot really be plugged as done
+ # by a real shell. Run commands sequentially and chain their
+ # input/output throught temporary files.
+ tmpfd, inpath = tempfile.mkstemp()
+ os.close(tmpfd)
+ tmpfd, outpath = tempfile.mkstemp()
+ os.close(tmpfd)
+
+ inpath = win32_to_unix_path(inpath)
+ outpath = win32_to_unix_path(outpath)
+
+ for i, cmd in enumerate(pipeline.commands):
+ call_redirs = redirs.clone()
+ try:
+ if i!=0:
+ call_redirs.add(self, '<', inpath)
+ if i!=len(pipeline.commands)-1:
+ call_redirs.add(self, '>', outpath)
+
+ status = self.execute(cmd, call_redirs)
+
+ # Chain inputs/outputs
+ inpath, outpath = outpath, inpath
+ finally:
+ call_redirs.close()
+ finally:
+ if inpath: os.remove(inpath)
+ if outpath: os.remove(outpath)
+
+ if pipeline.reverse_status:
+ status = int(not status)
+ self._env['?'] = status
+ return status
+
+ def _execute_function(self, name, args, interp, env, stdin, stdout, stderr, *others):
+ assert interp is self
+
+ func = env.get_function(name)
+ #Set positional parameters
+ prevargs = None
+ try:
+ prevargs = env.set_positional_args(args)
+ try:
+ redirs = Redirections(stdin.dup(), stdout.dup(), stderr.dup())
+ try:
+ status = self.execute(func, redirs)
+ finally:
+ redirs.close()
+ except ReturnSignal as e:
+ status = int(e.args[0])
+ env['?'] = status
+ return status
+ finally:
+ #Reset positional parameters
+ if prevargs is not None:
+ env.set_positional_args(prevargs)
+
+ def _execute_simple_command(self, token, redirs):
+ """Can raise ReturnSignal when return builtin is called, ExitSignal when
+ exit is called, and other shell exceptions upon builtin failures.
+ """
+ debug_command = 'debug-cmd' in self._debugflags
+ if debug_command:
+ self.log('word' + repr(token.words) + '\n')
+ self.log('assigns' + repr(token.assigns) + '\n')
+ self.log('redirs' + repr(token.redirs) + '\n')
+
+ is_special = None
+ env = self._env
+
+ try:
+ # Word expansion
+ args = []
+ for word in token.words:
+ args += self.expand_token(word)
+ if is_special is None and args:
+ is_special = env.is_function(args[0]) or \
+ (args[0] in self.COMMANDS and self.COMMANDS[args[0]].is_special)
+
+ if debug_command:
+ self.log('_execute_simple_command' + str(args) + '\n')
+
+ if not args:
+ # Redirections happen is a subshell
+ redirs = redirs.clone()
+ elif not is_special:
+ env = self._env.clone()
+
+ # Redirections
+ self.redirect(redirs, token.redirs)
+
+ # Variables assignments
+ res = 0
+ for type,(k,v) in token.assigns:
+ status, expanded = self.expand_variable((k,v))
+ if status is not None:
+ res = status
+ if args:
+ env.export(k, expanded)
+ else:
+ env[k] = expanded
+
+ if args and args[0] in ('.', 'source'):
+ res = self.dotcommand(env, args[1:])
+ elif args:
+ if args[0] in self.COMMANDS:
+ command = self.COMMANDS[args[0]]
+ elif env.is_function(args[0]):
+ command = Utility(self._execute_function, is_special=True)
+ else:
+ if not '/' in args[0].replace('\\', '/'):
+ cmd = env.find_in_path(args[0])
+ if not cmd:
+ # TODO: test error code on unknown command => 127
+ raise CommandNotFound('Unknown command: "%s"' % args[0])
+ else:
+ # Handle commands like '/cygdrive/c/foo.bat'
+ cmd = cygwin_to_windows_path(args[0])
+ if not os.path.exists(cmd):
+ raise CommandNotFound('%s: No such file or directory' % args[0])
+ shebang = resolve_shebang(cmd)
+ if shebang:
+ cmd = shebang
+ else:
+ cmd = [cmd]
+ args[0:1] = cmd
+ command = Utility(builtin.run_command)
+
+ # Command execution
+ if 'debug-cmd' in self._debugflags:
+ self.log('redirections ' + str(redirs) + '\n')
+
+ res = command.func(args[0], args[1:], self, env,
+ redirs.stdin(), redirs.stdout(),
+ redirs.stderr(), self._debugflags)
+
+ if self._env.has_opt('-x'):
+ # Trace command execution in shell environment
+ # BUG: would be hard to reproduce a real shell behaviour since
+ # the AST is not annotated with source lines/tokens.
+ self._redirs.stdout().write(' '.join(args))
+
+ except ReturnSignal:
+ raise
+ except ShellError as e:
+ if is_special or isinstance(e, (ExitSignal,
+ ShellSyntaxError, ExpansionError)):
+ raise e
+ self._redirs.stderr().write(str(e)+'\n')
+ return 1
+
+ return res
+
+ def expand_token(self, word):
+ """Expand a word as specified in [2.6 Word Expansions]. Return the list
+ of expanded words.
+ """
+ status, wtrees = self._expand_word(word)
+ return map(pyshlex.wordtree_as_string, wtrees)
+
+ def expand_variable(self, word):
+ """Return a status code (or None if no command expansion occurred)
+ and a single word.
+ """
+ status, wtrees = self._expand_word(word, pathname=False, split=False)
+ words = map(pyshlex.wordtree_as_string, wtrees)
+ assert len(words)==1
+ return status, words[0]
+
+ def expand_here_document(self, word):
+ """Return the expanded document as a single word. The here document is
+ assumed to be unquoted.
+ """
+ status, wtrees = self._expand_word(word, pathname=False,
+ split=False, here_document=True)
+ words = map(pyshlex.wordtree_as_string, wtrees)
+ assert len(words)==1
+ return words[0]
+
+ def expand_redirection(self, word):
+ """Return a single word."""
+ return self.expand_variable(word)[1]
+
+ def get_env(self):
+ return self._env
+
+ def _expand_word(self, token, pathname=True, split=True, here_document=False):
+ wtree = pyshlex.make_wordtree(token[1], here_document=here_document)
+
+ # TODO: implement tilde expansion
+ def expand(wtree):
+ """Return a pseudo wordtree: the tree or its subelements can be empty
+ lists when no value result from the expansion.
+ """
+ status = None
+ for part in wtree:
+ if not isinstance(part, list):
+ continue
+ if part[0]in ("'", '\\'):
+ continue
+ elif part[0] in ('`', '$('):
+ status, result = self._expand_command(part)
+ part[:] = result
+ elif part[0] in ('$', '${'):
+ part[:] = self._expand_parameter(part, wtree[0]=='"', split)
+ elif part[0] in ('', '"'):
+ status, result = expand(part)
+ part[:] = result
+ else:
+ raise NotImplementedError('%s expansion is not implemented'
+ % part[0])
+ # [] is returned when an expansion result in no-field,
+ # like an empty $@
+ wtree = [p for p in wtree if p != []]
+ if len(wtree) < 3:
+ return status, []
+ return status, wtree
+
+ status, wtree = expand(wtree)
+ if len(wtree) == 0:
+ return status, wtree
+ wtree = pyshlex.normalize_wordtree(wtree)
+
+ if split:
+ wtrees = self._split_fields(wtree)
+ else:
+ wtrees = [wtree]
+
+ if pathname:
+ wtrees = mappend(self._expand_pathname, wtrees)
+
+ wtrees = map(self._remove_quotes, wtrees)
+ return status, wtrees
+
+ def _expand_command(self, wtree):
+ # BUG: there is something to do with backslashes and quoted
+ # characters here
+ command = pyshlex.wordtree_as_string(wtree[1:-1])
+ status, output = self.subshell_output(command)
+ return status, ['', output, '']
+
+ def _expand_parameter(self, wtree, quoted=False, split=False):
+ """Return a valid wtree or an empty list when no parameter results."""
+ # Get the parameter name
+ # TODO: implement weird expansion rules with ':'
+ name = pyshlex.wordtree_as_string(wtree[1:-1])
+ if not is_name(name) and not is_special_param(name):
+ raise ExpansionError('Bad substitution "%s"' % name)
+ # TODO: implement special parameters
+ if name in ('@', '*'):
+ args = self._env.get_positional_args()
+ if len(args) == 0:
+ return []
+ if len(args)<2:
+ return ['', ''.join(args), '']
+
+ sep = self._env.get('IFS', '')[:1]
+ if split and quoted and name=='@':
+ # Introduce a new token to tell the caller that these parameters
+ # cause a split as specified in 2.5.2
+ return ['@'] + args + ['']
+ else:
+ return ['', sep.join(args), '']
+
+ return ['', self._env.get(name, ''), '']
+
+ def _split_fields(self, wtree):
+ def is_empty(split):
+ return split==['', '', '']
+
+ def split_positional(quoted):
+ # Return a list of wtree split according positional parameters rules.
+ # All remaining '@' groups are removed.
+ assert quoted[0]=='"'
+
+ splits = [[]]
+ for part in quoted:
+ if not isinstance(part, list) or part[0]!='@':
+ splits[-1].append(part)
+ else:
+ # Empty or single argument list were dealt with already
+ assert len(part)>3
+ # First argument must join with the beginning part of the original word
+ splits[-1].append(part[1])
+ # Create double-quotes expressions for every argument after the first
+ for arg in part[2:-1]:
+ splits[-1].append('"')
+ splits.append(['"', arg])
+ return splits
+
+ # At this point, all expansions but pathnames have occured. Only quoted
+ # and positional sequences remain. Thus, all candidates for field splitting
+ # are in the tree root, or are positional splits ('@') and lie in root
+ # children.
+ if not wtree or wtree[0] not in ('', '"'):
+ # The whole token is quoted or empty, nothing to split
+ return [wtree]
+
+ if wtree[0]=='"':
+ wtree = ['', wtree, '']
+
+ result = [['', '']]
+ for part in wtree[1:-1]:
+ if isinstance(part, list):
+ if part[0]=='"':
+ splits = split_positional(part)
+ if len(splits)<=1:
+ result[-1] += [part, '']
+ else:
+ # Terminate the current split
+ result[-1] += [splits[0], '']
+ result += splits[1:-1]
+ # Create a new split
+ result += [['', splits[-1], '']]
+ else:
+ result[-1] += [part, '']
+ else:
+ splits = self._env.split_fields(part)
+ if len(splits)<=1:
+ # No split
+ result[-1][-1] += part
+ else:
+ # Terminate the current resulting part and create a new one
+ result[-1][-1] += splits[0]
+ result[-1].append('')
+ result += [['', r, ''] for r in splits[1:-1]]
+ result += [['', splits[-1]]]
+ result[-1].append('')
+
+ # Leading and trailing empty groups come from leading/trailing blanks
+ if result and is_empty(result[-1]):
+ result[-1:] = []
+ if result and is_empty(result[0]):
+ result[:1] = []
+ return result
+
+ def _expand_pathname(self, wtree):
+ """See [2.6.6 Pathname Expansion]."""
+ if self._env.has_opt('-f'):
+ return [wtree]
+
+ # All expansions have been performed, only quoted sequences should remain
+ # in the tree. Generate the pattern by folding the tree, escaping special
+ # characters when appear quoted
+ special_chars = '*?[]'
+
+ def make_pattern(wtree):
+ subpattern = []
+ for part in wtree[1:-1]:
+ if isinstance(part, list):
+ part = make_pattern(part)
+ elif wtree[0]!='':
+ for c in part:
+ # Meta-characters cannot be quoted
+ if c in special_chars:
+ raise GlobError()
+ subpattern.append(part)
+ return ''.join(subpattern)
+
+ def pwd_glob(pattern):
+ cwd = os.getcwd()
+ os.chdir(self._env['PWD'])
+ try:
+ return glob.glob(pattern)
+ finally:
+ os.chdir(cwd)
+
+ #TODO: check working directory issues here wrt relative patterns
+ try:
+ pattern = make_pattern(wtree)
+ paths = pwd_glob(pattern)
+ except GlobError:
+ # BUG: Meta-characters were found in quoted sequences. The should
+ # have been used literally but this is unsupported in current glob module.
+ # Instead we consider the whole tree must be used literally and
+ # therefore there is no point in globbing. This is wrong when meta
+ # characters are mixed with quoted meta in the same pattern like:
+ # < foo*"py*" >
+ paths = []
+
+ if not paths:
+ return [wtree]
+ return [['', path, ''] for path in paths]
+
+ def _remove_quotes(self, wtree):
+ """See [2.6.7 Quote Removal]."""
+
+ def unquote(wtree):
+ unquoted = []
+ for part in wtree[1:-1]:
+ if isinstance(part, list):
+ part = unquote(part)
+ unquoted.append(part)
+ return ''.join(unquoted)
+
+ return ['', unquote(wtree), '']
+
+ def subshell(self, script=None, ast=None, redirs=None):
+ """Execute the script or AST in a subshell, with inherited redirections
+ if redirs is not None.
+ """
+ if redirs:
+ sub_redirs = redirs
+ else:
+ sub_redirs = redirs.clone()
+
+ subshell = None
+ try:
+ subshell = Interpreter(None, self._debugflags, self._env.clone(True),
+ sub_redirs, opts=self._options)
+ return subshell.execute_script(script, ast)
+ finally:
+ if not redirs: sub_redirs.close()
+ if subshell: subshell.close()
+
+ def subshell_output(self, script):
+ """Execute the script in a subshell and return the captured output."""
+ # Create temporary file to capture subshell output
+ tmpfd, tmppath = tempfile.mkstemp()
+ try:
+ tmpfile = os.fdopen(tmpfd, 'wb')
+ stdout = FileWrapper('w', tmpfile)
+
+ redirs = Redirections(self._redirs.stdin().dup(),
+ stdout,
+ self._redirs.stderr().dup())
+ try:
+ status = self.subshell(script=script, redirs=redirs)
+ finally:
+ redirs.close()
+ redirs = None
+
+ # Extract subshell standard output
+ tmpfile = open(tmppath, 'rb')
+ try:
+ output = tmpfile.read()
+ return status, output.rstrip('\n')
+ finally:
+ tmpfile.close()
+ finally:
+ os.remove(tmppath)
+
+ def _asynclist(self, cmd):
+ args = (self._env.get_variables(), cmd)
+ arg = encodeargs(args)
+ assert len(args) < 30*1024
+ cmd = ['pysh.bat', '--ast', '-c', arg]
+ p = subprocess.Popen(cmd, cwd=self._env['PWD'])
+ self._children[p.pid] = p
+ self._env['!'] = p.pid
+ return 0
+
+ def wait(self, pids=None):
+ if not pids:
+ pids = self._children.keys()
+
+ status = 127
+ for pid in pids:
+ if pid not in self._children:
+ continue
+ p = self._children.pop(pid)
+ status = p.wait()
+
+ return status
+
diff --git a/poky/bitbake/lib/bb/pysh/lsprof.py b/poky/bitbake/lib/bb/pysh/lsprof.py
new file mode 100644
index 000000000..b1831c22a
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/lsprof.py
@@ -0,0 +1,116 @@
+#! /usr/bin/env python
+
+import sys
+from _lsprof import Profiler, profiler_entry
+
+__all__ = ['profile', 'Stats']
+
+def profile(f, *args, **kwds):
+ """XXX docstring"""
+ p = Profiler()
+ p.enable(subcalls=True, builtins=True)
+ try:
+ f(*args, **kwds)
+ finally:
+ p.disable()
+ return Stats(p.getstats())
+
+
+class Stats(object):
+ """XXX docstring"""
+
+ def __init__(self, data):
+ self.data = data
+
+ def sort(self, crit="inlinetime"):
+ """XXX docstring"""
+ if crit not in profiler_entry.__dict__:
+ raise ValueError("Can't sort by %s" % crit)
+ self.data.sort(lambda b, a: cmp(getattr(a, crit),
+ getattr(b, crit)))
+ for e in self.data:
+ if e.calls:
+ e.calls.sort(lambda b, a: cmp(getattr(a, crit),
+ getattr(b, crit)))
+
+ def pprint(self, top=None, file=None, limit=None, climit=None):
+ """XXX docstring"""
+ if file is None:
+ file = sys.stdout
+ d = self.data
+ if top is not None:
+ d = d[:top]
+ cols = "% 12s %12s %11.4f %11.4f %s\n"
+ hcols = "% 12s %12s %12s %12s %s\n"
+ cols2 = "+%12s %12s %11.4f %11.4f + %s\n"
+ file.write(hcols % ("CallCount", "Recursive", "Total(ms)",
+ "Inline(ms)", "module:lineno(function)"))
+ count = 0
+ for e in d:
+ file.write(cols % (e.callcount, e.reccallcount, e.totaltime,
+ e.inlinetime, label(e.code)))
+ count += 1
+ if limit is not None and count == limit:
+ return
+ ccount = 0
+ if e.calls:
+ for se in e.calls:
+ file.write(cols % ("+%s" % se.callcount, se.reccallcount,
+ se.totaltime, se.inlinetime,
+ "+%s" % label(se.code)))
+ count += 1
+ ccount += 1
+ if limit is not None and count == limit:
+ return
+ if climit is not None and ccount == climit:
+ break
+
+ def freeze(self):
+ """Replace all references to code objects with string
+ descriptions; this makes it possible to pickle the instance."""
+
+ # this code is probably rather ickier than it needs to be!
+ for i in range(len(self.data)):
+ e = self.data[i]
+ if not isinstance(e.code, str):
+ self.data[i] = type(e)((label(e.code),) + e[1:])
+ if e.calls:
+ for j in range(len(e.calls)):
+ se = e.calls[j]
+ if not isinstance(se.code, str):
+ e.calls[j] = type(se)((label(se.code),) + se[1:])
+
+_fn2mod = {}
+
+def label(code):
+ if isinstance(code, str):
+ return code
+ try:
+ mname = _fn2mod[code.co_filename]
+ except KeyError:
+ for k, v in sys.modules.items():
+ if v is None:
+ continue
+ if not hasattr(v, '__file__'):
+ continue
+ if not isinstance(v.__file__, str):
+ continue
+ if v.__file__.startswith(code.co_filename):
+ mname = _fn2mod[code.co_filename] = k
+ break
+ else:
+ mname = _fn2mod[code.co_filename] = '<%s>'%code.co_filename
+
+ return '%s:%d(%s)' % (mname, code.co_firstlineno, code.co_name)
+
+
+if __name__ == '__main__':
+ import os
+ sys.argv = sys.argv[1:]
+ if not sys.argv:
+ print >> sys.stderr, "usage: lsprof.py <script> <arguments...>"
+ sys.exit(2)
+ sys.path.insert(0, os.path.abspath(os.path.dirname(sys.argv[0])))
+ stats = profile(execfile, sys.argv[0], globals(), locals())
+ stats.sort()
+ stats.pprint()
diff --git a/poky/bitbake/lib/bb/pysh/pysh.py b/poky/bitbake/lib/bb/pysh/pysh.py
new file mode 100644
index 000000000..b4e6145b5
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/pysh.py
@@ -0,0 +1,167 @@
+# pysh.py - command processing for pysh.
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+import optparse
+import os
+import sys
+
+import interp
+
+SH_OPT = optparse.OptionParser(prog='pysh', usage="%prog [OPTIONS]", version='0.1')
+SH_OPT.add_option('-c', action='store_true', dest='command_string', default=None,
+ help='A string that shall be interpreted by the shell as one or more commands')
+SH_OPT.add_option('--redirect-to', dest='redirect_to', default=None,
+ help='Redirect script commands stdout and stderr to the specified file')
+# See utility_command in builtin.py about the reason for this flag.
+SH_OPT.add_option('--redirected', dest='redirected', action='store_true', default=False,
+ help='Tell the interpreter that stdout and stderr are actually the same objects, which is really stdout')
+SH_OPT.add_option('--debug-parsing', action='store_true', dest='debug_parsing', default=False,
+ help='Trace PLY execution')
+SH_OPT.add_option('--debug-tree', action='store_true', dest='debug_tree', default=False,
+ help='Display the generated syntax tree.')
+SH_OPT.add_option('--debug-cmd', action='store_true', dest='debug_cmd', default=False,
+ help='Trace command execution before parameters expansion and exit status.')
+SH_OPT.add_option('--debug-utility', action='store_true', dest='debug_utility', default=False,
+ help='Trace utility calls, after parameters expansions')
+SH_OPT.add_option('--ast', action='store_true', dest='ast', default=False,
+ help='Encoded commands to execute in a subprocess')
+SH_OPT.add_option('--profile', action='store_true', default=False,
+ help='Profile pysh run')
+
+
+def split_args(args):
+ # Separate shell arguments from command ones
+ # Just stop at the first argument not starting with a dash. I know, this is completely broken,
+ # it ignores files starting with a dash or may take option values for command file. This is not
+ # supposed to happen for now
+ command_index = len(args)
+ for i,arg in enumerate(args):
+ if not arg.startswith('-'):
+ command_index = i
+ break
+
+ return args[:command_index], args[command_index:]
+
+
+def fixenv(env):
+ path = env.get('PATH')
+ if path is not None:
+ parts = path.split(os.pathsep)
+ # Remove Windows utilities from PATH, they are useless at best and
+ # some of them (find) may be confused with other utilities.
+ parts = [p for p in parts if 'system32' not in p.lower()]
+ env['PATH'] = os.pathsep.join(parts)
+ if env.get('HOME') is None:
+ # Several utilities, including cvsps, cannot work without
+ # a defined HOME directory.
+ env['HOME'] = os.path.expanduser('~')
+ return env
+
+def _sh(cwd, shargs, cmdargs, options, debugflags=None, env=None):
+ if os.environ.get('PYSH_TEXT') != '1':
+ import msvcrt
+ for fp in (sys.stdin, sys.stdout, sys.stderr):
+ msvcrt.setmode(fp.fileno(), os.O_BINARY)
+
+ hgbin = os.environ.get('PYSH_HGTEXT') != '1'
+
+ if debugflags is None:
+ debugflags = []
+ if options.debug_parsing: debugflags.append('debug-parsing')
+ if options.debug_utility: debugflags.append('debug-utility')
+ if options.debug_cmd: debugflags.append('debug-cmd')
+ if options.debug_tree: debugflags.append('debug-tree')
+
+ if env is None:
+ env = fixenv(dict(os.environ))
+ if cwd is None:
+ cwd = os.getcwd()
+
+ if not cmdargs:
+ # Nothing to do
+ return 0
+
+ ast = None
+ command_file = None
+ if options.command_string:
+ input = cmdargs[0]
+ if not options.ast:
+ input += '\n'
+ else:
+ args, input = interp.decodeargs(input), None
+ env, ast = args
+ cwd = env.get('PWD', cwd)
+ else:
+ command_file = cmdargs[0]
+ arguments = cmdargs[1:]
+
+ prefix = interp.resolve_shebang(command_file, ignoreshell=True)
+ if prefix:
+ input = ' '.join(prefix + [command_file] + arguments)
+ else:
+ # Read commands from file
+ f = file(command_file)
+ try:
+ # Trailing newline to help the parser
+ input = f.read() + '\n'
+ finally:
+ f.close()
+
+ redirect = None
+ try:
+ if options.redirected:
+ stdout = sys.stdout
+ stderr = stdout
+ elif options.redirect_to:
+ redirect = open(options.redirect_to, 'wb')
+ stdout = redirect
+ stderr = redirect
+ else:
+ stdout = sys.stdout
+ stderr = sys.stderr
+
+ # TODO: set arguments to environment variables
+ opts = interp.Options()
+ opts.hgbinary = hgbin
+ ip = interp.Interpreter(cwd, debugflags, stdout=stdout, stderr=stderr,
+ opts=opts)
+ try:
+ # Export given environment in shell object
+ for k,v in env.iteritems():
+ ip.get_env().export(k,v)
+ return ip.execute_script(input, ast, scriptpath=command_file)
+ finally:
+ ip.close()
+ finally:
+ if redirect is not None:
+ redirect.close()
+
+def sh(cwd=None, args=None, debugflags=None, env=None):
+ if args is None:
+ args = sys.argv[1:]
+ shargs, cmdargs = split_args(args)
+ options, shargs = SH_OPT.parse_args(shargs)
+
+ if options.profile:
+ import lsprof
+ p = lsprof.Profiler()
+ p.enable(subcalls=True)
+ try:
+ return _sh(cwd, shargs, cmdargs, options, debugflags, env)
+ finally:
+ p.disable()
+ stats = lsprof.Stats(p.getstats())
+ stats.sort()
+ stats.pprint(top=10, file=sys.stderr, climit=5)
+ else:
+ return _sh(cwd, shargs, cmdargs, options, debugflags, env)
+
+def main():
+ sys.exit(sh())
+
+if __name__=='__main__':
+ main()
diff --git a/poky/bitbake/lib/bb/pysh/pyshlex.py b/poky/bitbake/lib/bb/pysh/pyshlex.py
new file mode 100644
index 000000000..fbf094b7a
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/pyshlex.py
@@ -0,0 +1,888 @@
+# pyshlex.py - PLY compatible lexer for pysh.
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+# TODO:
+# - review all "char in 'abc'" snippets: the empty string can be matched
+# - test line continuations within quoted/expansion strings
+# - eof is buggy wrt sublexers
+# - the lexer cannot really work in pull mode as it would be required to run
+# PLY in pull mode. It was designed to work incrementally and it would not be
+# that hard to enable pull mode.
+import re
+try:
+ s = set()
+ del s
+except NameError:
+ from Set import Set as set
+
+from ply import lex
+from bb.pysh.sherrors import *
+
+class NeedMore(Exception):
+ pass
+
+def is_blank(c):
+ return c in (' ', '\t')
+
+_RE_DIGITS = re.compile(r'^\d+$')
+
+def are_digits(s):
+ return _RE_DIGITS.search(s) is not None
+
+_OPERATORS = dict([
+ ('&&', 'AND_IF'),
+ ('||', 'OR_IF'),
+ (';;', 'DSEMI'),
+ ('<<', 'DLESS'),
+ ('>>', 'DGREAT'),
+ ('<&', 'LESSAND'),
+ ('>&', 'GREATAND'),
+ ('<>', 'LESSGREAT'),
+ ('<<-', 'DLESSDASH'),
+ ('>|', 'CLOBBER'),
+ ('&', 'AMP'),
+ (';', 'COMMA'),
+ ('<', 'LESS'),
+ ('>', 'GREATER'),
+ ('(', 'LPARENS'),
+ (')', 'RPARENS'),
+])
+
+#Make a function to silence pychecker "Local variable shadows global"
+def make_partial_ops():
+ partials = {}
+ for k in _OPERATORS:
+ for i in range(1, len(k)+1):
+ partials[k[:i]] = None
+ return partials
+
+_PARTIAL_OPERATORS = make_partial_ops()
+
+def is_partial_op(s):
+ """Return True if s matches a non-empty subpart of an operator starting
+ at its first character.
+ """
+ return s in _PARTIAL_OPERATORS
+
+def is_op(s):
+ """If s matches an operator, returns the operator identifier. Return None
+ otherwise.
+ """
+ return _OPERATORS.get(s)
+
+_RESERVEDS = dict([
+ ('if', 'If'),
+ ('then', 'Then'),
+ ('else', 'Else'),
+ ('elif', 'Elif'),
+ ('fi', 'Fi'),
+ ('do', 'Do'),
+ ('done', 'Done'),
+ ('case', 'Case'),
+ ('esac', 'Esac'),
+ ('while', 'While'),
+ ('until', 'Until'),
+ ('for', 'For'),
+ ('{', 'Lbrace'),
+ ('}', 'Rbrace'),
+ ('!', 'Bang'),
+ ('in', 'In'),
+ ('|', 'PIPE'),
+])
+
+def get_reserved(s):
+ return _RESERVEDS.get(s)
+
+_RE_NAME = re.compile(r'^[0-9a-zA-Z_]+$')
+
+def is_name(s):
+ return _RE_NAME.search(s) is not None
+
+def find_chars(seq, chars):
+ for i,v in enumerate(seq):
+ if v in chars:
+ return i,v
+ return -1, None
+
+class WordLexer:
+ """WordLexer parse quoted or expansion expressions and return an expression
+ tree. The input string can be any well formed sequence beginning with quoting
+ or expansion character. Embedded expressions are handled recursively. The
+ resulting tree is made of lists and strings. Lists represent quoted or
+ expansion expressions. Each list first element is the opening separator,
+ the last one the closing separator. In-between can be any number of strings
+ or lists for sub-expressions. Non quoted/expansion expression can written as
+ strings or as lists with empty strings as starting and ending delimiters.
+ """
+
+ NAME_CHARSET = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
+ NAME_CHARSET = dict(zip(NAME_CHARSET, NAME_CHARSET))
+
+ SPECIAL_CHARSET = '@*#?-$!0'
+
+ #Characters which can be escaped depends on the current delimiters
+ ESCAPABLE = {
+ '`': set(['$', '\\', '`']),
+ '"': set(['$', '\\', '`', '"']),
+ "'": set(),
+ }
+
+ def __init__(self, heredoc = False):
+ # _buffer is the unprocessed input characters buffer
+ self._buffer = []
+ # _stack is empty or contains a quoted list being processed
+ # (this is the DFS path to the quoted expression being evaluated).
+ self._stack = []
+ self._escapable = None
+ # True when parsing unquoted here documents
+ self._heredoc = heredoc
+
+ def add(self, data, eof=False):
+ """Feed the lexer with more data. If the quoted expression can be
+ delimited, return a tuple (expr, remaining) containing the expression
+ tree and the unconsumed data.
+ Otherwise, raise NeedMore.
+ """
+ self._buffer += list(data)
+ self._parse(eof)
+
+ result = self._stack[0]
+ remaining = ''.join(self._buffer)
+ self._stack = []
+ self._buffer = []
+ return result, remaining
+
+ def _is_escapable(self, c, delim=None):
+ if delim is None:
+ if self._heredoc:
+ # Backslashes works as if they were double quoted in unquoted
+ # here-documents
+ delim = '"'
+ else:
+ if len(self._stack)<=1:
+ return True
+ delim = self._stack[-2][0]
+
+ escapables = self.ESCAPABLE.get(delim, None)
+ return escapables is None or c in escapables
+
+ def _parse_squote(self, buf, result, eof):
+ if not buf:
+ raise NeedMore()
+ try:
+ pos = buf.index("'")
+ except ValueError:
+ raise NeedMore()
+ result[-1] += ''.join(buf[:pos])
+ result += ["'"]
+ return pos+1, True
+
+ def _parse_bquote(self, buf, result, eof):
+ if not buf:
+ raise NeedMore()
+
+ if buf[0]=='\n':
+ #Remove line continuations
+ result[:] = ['', '', '']
+ elif self._is_escapable(buf[0]):
+ result[-1] += buf[0]
+ result += ['']
+ else:
+ #Keep as such
+ result[:] = ['', '\\'+buf[0], '']
+
+ return 1, True
+
+ def _parse_dquote(self, buf, result, eof):
+ if not buf:
+ raise NeedMore()
+ pos, sep = find_chars(buf, '$\\`"')
+ if pos==-1:
+ raise NeedMore()
+
+ result[-1] += ''.join(buf[:pos])
+ if sep=='"':
+ result += ['"']
+ return pos+1, True
+ else:
+ #Keep everything until the separator and defer processing
+ return pos, False
+
+ def _parse_command(self, buf, result, eof):
+ if not buf:
+ raise NeedMore()
+
+ chars = '$\\`"\''
+ if result[0] == '$(':
+ chars += ')'
+ pos, sep = find_chars(buf, chars)
+ if pos == -1:
+ raise NeedMore()
+
+ result[-1] += ''.join(buf[:pos])
+ if (result[0]=='$(' and sep==')') or (result[0]=='`' and sep=='`'):
+ result += [sep]
+ return pos+1, True
+ else:
+ return pos, False
+
+ def _parse_parameter(self, buf, result, eof):
+ if not buf:
+ raise NeedMore()
+
+ pos, sep = find_chars(buf, '$\\`"\'}')
+ if pos==-1:
+ raise NeedMore()
+
+ result[-1] += ''.join(buf[:pos])
+ if sep=='}':
+ result += [sep]
+ return pos+1, True
+ else:
+ return pos, False
+
+ def _parse_dollar(self, buf, result, eof):
+ sep = result[0]
+ if sep=='$':
+ if not buf:
+ #TODO: handle empty $
+ raise NeedMore()
+ if buf[0]=='(':
+ if len(buf)==1:
+ raise NeedMore()
+
+ if buf[1]=='(':
+ result[0] = '$(('
+ buf[:2] = []
+ else:
+ result[0] = '$('
+ buf[:1] = []
+
+ elif buf[0]=='{':
+ result[0] = '${'
+ buf[:1] = []
+ else:
+ if buf[0] in self.SPECIAL_CHARSET:
+ result[-1] = buf[0]
+ read = 1
+ else:
+ for read,c in enumerate(buf):
+ if c not in self.NAME_CHARSET:
+ break
+ else:
+ if not eof:
+ raise NeedMore()
+ read += 1
+
+ result[-1] += ''.join(buf[0:read])
+
+ if not result[-1]:
+ result[:] = ['', result[0], '']
+ else:
+ result += ['']
+ return read,True
+
+ sep = result[0]
+ if sep=='$(':
+ parsefunc = self._parse_command
+ elif sep=='${':
+ parsefunc = self._parse_parameter
+ else:
+ raise NotImplementedError(sep)
+
+ pos, closed = parsefunc(buf, result, eof)
+ return pos, closed
+
+ def _parse(self, eof):
+ buf = self._buffer
+ stack = self._stack
+ recurse = False
+
+ while 1:
+ if not stack or recurse:
+ if not buf:
+ raise NeedMore()
+ if buf[0] not in ('"\\`$\''):
+ raise ShellSyntaxError('Invalid quoted string sequence')
+ stack.append([buf[0], ''])
+ buf[:1] = []
+ recurse = False
+
+ result = stack[-1]
+ if result[0]=="'":
+ parsefunc = self._parse_squote
+ elif result[0]=='\\':
+ parsefunc = self._parse_bquote
+ elif result[0]=='"':
+ parsefunc = self._parse_dquote
+ elif result[0]=='`':
+ parsefunc = self._parse_command
+ elif result[0][0]=='$':
+ parsefunc = self._parse_dollar
+ else:
+ raise NotImplementedError()
+
+ read, closed = parsefunc(buf, result, eof)
+
+ buf[:read] = []
+ if closed:
+ if len(stack)>1:
+ #Merge in parent expression
+ parsed = stack.pop()
+ stack[-1] += [parsed]
+ stack[-1] += ['']
+ else:
+ break
+ else:
+ recurse = True
+
+def normalize_wordtree(wtree):
+ """Fold back every literal sequence (delimited with empty strings) into
+ parent sequence.
+ """
+ def normalize(wtree):
+ result = []
+ for part in wtree[1:-1]:
+ if isinstance(part, list):
+ part = normalize(part)
+ if part[0]=='':
+ #Move the part content back at current level
+ result += part[1:-1]
+ continue
+ elif not part:
+ #Remove empty strings
+ continue
+ result.append(part)
+ if not result:
+ result = ['']
+ return [wtree[0]] + result + [wtree[-1]]
+
+ return normalize(wtree)
+
+
+def make_wordtree(token, here_document=False):
+ """Parse a delimited token and return a tree similar to the ones returned by
+ WordLexer. token may contain any combinations of expansion/quoted fields and
+ non-ones.
+ """
+ tree = ['']
+ remaining = token
+ delimiters = '\\$`'
+ if not here_document:
+ delimiters += '\'"'
+
+ while 1:
+ pos, sep = find_chars(remaining, delimiters)
+ if pos==-1:
+ tree += [remaining, '']
+ return normalize_wordtree(tree)
+ tree.append(remaining[:pos])
+ remaining = remaining[pos:]
+
+ try:
+ result, remaining = WordLexer(heredoc = here_document).add(remaining, True)
+ except NeedMore:
+ raise ShellSyntaxError('Invalid token "%s"')
+ tree.append(result)
+
+
+def wordtree_as_string(wtree):
+ """Rewrite an expression tree generated by make_wordtree as string."""
+ def visit(node, output):
+ for child in node:
+ if isinstance(child, list):
+ visit(child, output)
+ else:
+ output.append(child)
+
+ output = []
+ visit(wtree, output)
+ return ''.join(output)
+
+
+def unquote_wordtree(wtree):
+ """Fold the word tree while removing quotes everywhere. Other expansion
+ sequences are joined as such.
+ """
+ def unquote(wtree):
+ unquoted = []
+ if wtree[0] in ('', "'", '"', '\\'):
+ wtree = wtree[1:-1]
+
+ for part in wtree:
+ if isinstance(part, list):
+ part = unquote(part)
+ unquoted.append(part)
+ return ''.join(unquoted)
+
+ return unquote(wtree)
+
+
+class HereDocLexer:
+ """HereDocLexer delimits whatever comes from the here-document starting newline
+ not included to the closing delimiter line included.
+ """
+ def __init__(self, op, delim):
+ assert op in ('<<', '<<-')
+ if not delim:
+ raise ShellSyntaxError('invalid here document delimiter %s' % str(delim))
+
+ self._op = op
+ self._delim = delim
+ self._buffer = []
+ self._token = []
+
+ def add(self, data, eof):
+ """If the here-document was delimited, return a tuple (content, remaining).
+ Raise NeedMore() otherwise.
+ """
+ self._buffer += list(data)
+ self._parse(eof)
+ token = ''.join(self._token)
+ remaining = ''.join(self._buffer)
+ self._token, self._remaining = [], []
+ return token, remaining
+
+ def _parse(self, eof):
+ while 1:
+ #Look for first unescaped newline. Quotes may be ignored
+ escaped = False
+ for i,c in enumerate(self._buffer):
+ if escaped:
+ escaped = False
+ elif c=='\\':
+ escaped = True
+ elif c=='\n':
+ break
+ else:
+ i = -1
+
+ if i==-1 or self._buffer[i]!='\n':
+ if not eof:
+ raise NeedMore()
+ #No more data, maybe the last line is closing delimiter
+ line = ''.join(self._buffer)
+ eol = ''
+ self._buffer[:] = []
+ else:
+ line = ''.join(self._buffer[:i])
+ eol = self._buffer[i]
+ self._buffer[:i+1] = []
+
+ if self._op=='<<-':
+ line = line.lstrip('\t')
+
+ if line==self._delim:
+ break
+
+ self._token += [line, eol]
+ if i==-1:
+ break
+
+class Token:
+ #TODO: check this is still in use
+ OPERATOR = 'OPERATOR'
+ WORD = 'WORD'
+
+ def __init__(self):
+ self.value = ''
+ self.type = None
+
+ def __getitem__(self, key):
+ #Behave like a two elements tuple
+ if key==0:
+ return self.type
+ if key==1:
+ return self.value
+ raise IndexError(key)
+
+
+class HereDoc:
+ def __init__(self, op, name=None):
+ self.op = op
+ self.name = name
+ self.pendings = []
+
+TK_COMMA = 'COMMA'
+TK_AMPERSAND = 'AMP'
+TK_OP = 'OP'
+TK_TOKEN = 'TOKEN'
+TK_COMMENT = 'COMMENT'
+TK_NEWLINE = 'NEWLINE'
+TK_IONUMBER = 'IO_NUMBER'
+TK_ASSIGNMENT = 'ASSIGNMENT_WORD'
+TK_HERENAME = 'HERENAME'
+
+class Lexer:
+ """Main lexer.
+
+ Call add() until the script AST is returned.
+ """
+ # Here-document handling makes the whole thing more complex because they basically
+ # force tokens to be reordered: here-content must come right after the operator
+ # and the here-document name, while some other tokens might be following the
+ # here-document expression on the same line.
+ #
+ # So, here-doc states are basically:
+ # *self._state==ST_NORMAL
+ # - self._heredoc.op is None: no here-document
+ # - self._heredoc.op is not None but name is: here-document operator matched,
+ # waiting for the document name/delimiter
+ # - self._heredoc.op and name are not None: here-document is ready, following
+ # tokens are being stored and will be pushed again when the document is
+ # completely parsed.
+ # *self._state==ST_HEREDOC
+ # - The here-document is being delimited by self._herelexer. Once it is done
+ # the content is pushed in front of the pending token list then all these
+ # tokens are pushed once again.
+ ST_NORMAL = 'ST_NORMAL'
+ ST_OP = 'ST_OP'
+ ST_BACKSLASH = 'ST_BACKSLASH'
+ ST_QUOTED = 'ST_QUOTED'
+ ST_COMMENT = 'ST_COMMENT'
+ ST_HEREDOC = 'ST_HEREDOC'
+
+ #Match end of backquote strings
+ RE_BACKQUOTE_END = re.compile(r'(?<!\\)(`)')
+
+ def __init__(self, parent_state = None):
+ self._input = []
+ self._pos = 0
+
+ self._token = ''
+ self._type = TK_TOKEN
+
+ self._state = self.ST_NORMAL
+ self._parent_state = parent_state
+ self._wordlexer = None
+
+ self._heredoc = HereDoc(None)
+ self._herelexer = None
+
+ ### Following attributes are not used for delimiting token and can safely
+ ### be changed after here-document detection (see _push_toke)
+
+ # Count the number of tokens following a 'For' reserved word. Needed to
+ # return an 'In' reserved word if it comes in third place.
+ self._for_count = None
+
+ def add(self, data, eof=False):
+ """Feed the lexer with data.
+
+ When eof is set to True, returns unconsumed data or raise if the lexer
+ is in the middle of a delimiting operation.
+ Raise NeedMore otherwise.
+ """
+ self._input += list(data)
+ self._parse(eof)
+ self._input[:self._pos] = []
+ return ''.join(self._input)
+
+ def _parse(self, eof):
+ while self._state:
+ if self._pos>=len(self._input):
+ if not eof:
+ raise NeedMore()
+ elif self._state not in (self.ST_OP, self.ST_QUOTED, self.ST_HEREDOC):
+ #Delimit the current token and leave cleanly
+ self._push_token('')
+ break
+ else:
+ #Let the sublexer handle the eof themselves
+ pass
+
+ if self._state==self.ST_NORMAL:
+ self._parse_normal()
+ elif self._state==self.ST_COMMENT:
+ self._parse_comment()
+ elif self._state==self.ST_OP:
+ self._parse_op(eof)
+ elif self._state==self.ST_QUOTED:
+ self._parse_quoted(eof)
+ elif self._state==self.ST_HEREDOC:
+ self._parse_heredoc(eof)
+ else:
+ assert False, "Unknown state " + str(self._state)
+
+ if self._heredoc.op is not None:
+ raise ShellSyntaxError('missing here-document delimiter')
+
+ def _parse_normal(self):
+ c = self._input[self._pos]
+ if c=='\n':
+ self._push_token(c)
+ self._token = c
+ self._type = TK_NEWLINE
+ self._push_token('')
+ self._pos += 1
+ elif c in ('\\', '\'', '"', '`', '$'):
+ self._state = self.ST_QUOTED
+ elif is_partial_op(c):
+ self._push_token(c)
+
+ self._type = TK_OP
+ self._token += c
+ self._pos += 1
+ self._state = self.ST_OP
+ elif is_blank(c):
+ self._push_token(c)
+
+ #Discard blanks
+ self._pos += 1
+ elif self._token:
+ self._token += c
+ self._pos += 1
+ elif c=='#':
+ self._state = self.ST_COMMENT
+ self._type = TK_COMMENT
+ self._pos += 1
+ else:
+ self._pos += 1
+ self._token += c
+
+ def _parse_op(self, eof):
+ assert self._token
+
+ while 1:
+ if self._pos>=len(self._input):
+ if not eof:
+ raise NeedMore()
+ c = ''
+ else:
+ c = self._input[self._pos]
+
+ op = self._token + c
+ if c and is_partial_op(op):
+ #Still parsing an operator
+ self._token = op
+ self._pos += 1
+ else:
+ #End of operator
+ self._push_token(c)
+ self._state = self.ST_NORMAL
+ break
+
+ def _parse_comment(self):
+ while 1:
+ if self._pos>=len(self._input):
+ raise NeedMore()
+
+ c = self._input[self._pos]
+ if c=='\n':
+ #End of comment, do not consume the end of line
+ self._state = self.ST_NORMAL
+ break
+ else:
+ self._token += c
+ self._pos += 1
+
+ def _parse_quoted(self, eof):
+ """Precondition: the starting backquote/dollar is still in the input queue."""
+ if not self._wordlexer:
+ self._wordlexer = WordLexer()
+
+ if self._pos<len(self._input):
+ #Transfer input queue character into the subparser
+ input = self._input[self._pos:]
+ self._pos += len(input)
+
+ wtree, remaining = self._wordlexer.add(input, eof)
+ self._wordlexer = None
+ self._token += wordtree_as_string(wtree)
+
+ #Put unparsed character back in the input queue
+ if remaining:
+ self._input[self._pos:self._pos] = list(remaining)
+ self._state = self.ST_NORMAL
+
+ def _parse_heredoc(self, eof):
+ assert not self._token
+
+ if self._herelexer is None:
+ self._herelexer = HereDocLexer(self._heredoc.op, self._heredoc.name)
+
+ if self._pos<len(self._input):
+ #Transfer input queue character into the subparser
+ input = self._input[self._pos:]
+ self._pos += len(input)
+
+ self._token, remaining = self._herelexer.add(input, eof)
+
+ #Reset here-document state
+ self._herelexer = None
+ heredoc, self._heredoc = self._heredoc, HereDoc(None)
+ if remaining:
+ self._input[self._pos:self._pos] = list(remaining)
+ self._state = self.ST_NORMAL
+
+ #Push pending tokens
+ heredoc.pendings[:0] = [(self._token, self._type, heredoc.name)]
+ for token, type, delim in heredoc.pendings:
+ self._token = token
+ self._type = type
+ self._push_token(delim)
+
+ def _push_token(self, delim):
+ if not self._token:
+ return 0
+
+ if self._heredoc.op is not None:
+ if self._heredoc.name is None:
+ #Here-document name
+ if self._type!=TK_TOKEN:
+ raise ShellSyntaxError("expecting here-document name, got '%s'" % self._token)
+ self._heredoc.name = unquote_wordtree(make_wordtree(self._token))
+ self._type = TK_HERENAME
+ else:
+ #Capture all tokens until the newline starting the here-document
+ if self._type==TK_NEWLINE:
+ assert self._state==self.ST_NORMAL
+ self._state = self.ST_HEREDOC
+
+ self._heredoc.pendings.append((self._token, self._type, delim))
+ self._token = ''
+ self._type = TK_TOKEN
+ return 1
+
+ # BEWARE: do not change parser state from here to the end of the function:
+ # when parsing between an here-document operator to the end of the line
+ # tokens are stored in self._heredoc.pendings. Therefore, they will not
+ # reach the section below.
+
+ #Check operators
+ if self._type==TK_OP:
+ #False positive because of partial op matching
+ op = is_op(self._token)
+ if not op:
+ self._type = TK_TOKEN
+ else:
+ #Map to the specific operator
+ self._type = op
+ if self._token in ('<<', '<<-'):
+ #Done here rather than in _parse_op because there is no need
+ #to change the parser state since we are still waiting for
+ #the here-document name
+ if self._heredoc.op is not None:
+ raise ShellSyntaxError("syntax error near token '%s'" % self._token)
+ assert self._heredoc.op is None
+ self._heredoc.op = self._token
+
+ if self._type==TK_TOKEN:
+ if '=' in self._token and not delim:
+ if self._token.startswith('='):
+ #Token is a WORD... a TOKEN that is.
+ pass
+ else:
+ prev = self._token[:self._token.find('=')]
+ if is_name(prev):
+ self._type = TK_ASSIGNMENT
+ else:
+ #Just a token (unspecified)
+ pass
+ else:
+ reserved = get_reserved(self._token)
+ if reserved is not None:
+ if reserved=='In' and self._for_count!=2:
+ #Sorry, not a reserved word after all
+ pass
+ else:
+ self._type = reserved
+ if reserved in ('For', 'Case'):
+ self._for_count = 0
+ elif are_digits(self._token) and delim in ('<', '>'):
+ #Detect IO_NUMBER
+ self._type = TK_IONUMBER
+ elif self._token==';':
+ self._type = TK_COMMA
+ elif self._token=='&':
+ self._type = TK_AMPERSAND
+ elif self._type==TK_COMMENT:
+ #Comments are not part of sh grammar, ignore them
+ self._token = ''
+ self._type = TK_TOKEN
+ return 0
+
+ if self._for_count is not None:
+ #Track token count in 'For' expression to detect 'In' reserved words.
+ #Can only be in third position, no need to go beyond
+ self._for_count += 1
+ if self._for_count==3:
+ self._for_count = None
+
+ self.on_token((self._token, self._type))
+ self._token = ''
+ self._type = TK_TOKEN
+ return 1
+
+ def on_token(self, token):
+ raise NotImplementedError
+
+
+tokens = [
+ TK_TOKEN,
+# To silence yacc unused token warnings
+# TK_COMMENT,
+ TK_NEWLINE,
+ TK_IONUMBER,
+ TK_ASSIGNMENT,
+ TK_HERENAME,
+]
+
+#Add specific operators
+tokens += _OPERATORS.values()
+#Add reserved words
+tokens += _RESERVEDS.values()
+
+class PLYLexer(Lexer):
+ """Bridge Lexer and PLY lexer interface."""
+ def __init__(self):
+ Lexer.__init__(self)
+ self._tokens = []
+ self._current = 0
+ self.lineno = 0
+
+ def on_token(self, token):
+ value, type = token
+
+ self.lineno = 0
+ t = lex.LexToken()
+ t.value = value
+ t.type = type
+ t.lexer = self
+ t.lexpos = 0
+ t.lineno = 0
+
+ self._tokens.append(t)
+
+ def is_empty(self):
+ return not bool(self._tokens)
+
+ #PLY compliant interface
+ def token(self):
+ if self._current>=len(self._tokens):
+ return None
+ t = self._tokens[self._current]
+ self._current += 1
+ return t
+
+
+def get_tokens(s):
+ """Parse the input string and return a tuple (tokens, unprocessed) where
+ tokens is a list of parsed tokens and unprocessed is the part of the input
+ string left untouched by the lexer.
+ """
+ lexer = PLYLexer()
+ untouched = lexer.add(s, True)
+ tokens = []
+ while 1:
+ token = lexer.token()
+ if token is None:
+ break
+ tokens.append(token)
+
+ tokens = [(t.value, t.type) for t in tokens]
+ return tokens, untouched
diff --git a/poky/bitbake/lib/bb/pysh/pyshyacc.py b/poky/bitbake/lib/bb/pysh/pyshyacc.py
new file mode 100644
index 000000000..ba4cefdcb
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/pyshyacc.py
@@ -0,0 +1,779 @@
+# pyshyacc.py - PLY grammar definition for pysh
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+"""PLY grammar file.
+"""
+import os.path
+import sys
+
+import bb.pysh.pyshlex as pyshlex
+tokens = pyshlex.tokens
+
+from ply import yacc
+import bb.pysh.sherrors as sherrors
+
+class IORedirect:
+ def __init__(self, op, filename, io_number=None):
+ self.op = op
+ self.filename = filename
+ self.io_number = io_number
+
+class HereDocument:
+ def __init__(self, op, name, content, io_number=None):
+ self.op = op
+ self.name = name
+ self.content = content
+ self.io_number = io_number
+
+def make_io_redirect(p):
+ """Make an IORedirect instance from the input 'io_redirect' production."""
+ name, io_number, io_target = p
+ assert name=='io_redirect'
+
+ if io_target[0]=='io_file':
+ io_type, io_op, io_file = io_target
+ return IORedirect(io_op, io_file, io_number)
+ elif io_target[0]=='io_here':
+ io_type, io_op, io_name, io_content = io_target
+ return HereDocument(io_op, io_name, io_content, io_number)
+ else:
+ assert False, "Invalid IO redirection token %s" % repr(io_type)
+
+class SimpleCommand:
+ """
+ assigns contains (name, value) pairs.
+ """
+ def __init__(self, words, redirs, assigns):
+ self.words = list(words)
+ self.redirs = list(redirs)
+ self.assigns = list(assigns)
+
+class Pipeline:
+ def __init__(self, commands, reverse_status=False):
+ self.commands = list(commands)
+ assert self.commands #Grammar forbids this
+ self.reverse_status = reverse_status
+
+class AndOr:
+ def __init__(self, op, left, right):
+ self.op = str(op)
+ self.left = left
+ self.right = right
+
+class ForLoop:
+ def __init__(self, name, items, cmds):
+ self.name = str(name)
+ self.items = list(items)
+ self.cmds = list(cmds)
+
+class WhileLoop:
+ def __init__(self, condition, cmds):
+ self.condition = list(condition)
+ self.cmds = list(cmds)
+
+class UntilLoop:
+ def __init__(self, condition, cmds):
+ self.condition = list(condition)
+ self.cmds = list(cmds)
+
+class FunDef:
+ def __init__(self, name, body):
+ self.name = str(name)
+ self.body = body
+
+class BraceGroup:
+ def __init__(self, cmds):
+ self.cmds = list(cmds)
+
+class IfCond:
+ def __init__(self, cond, if_cmds, else_cmds):
+ self.cond = list(cond)
+ self.if_cmds = if_cmds
+ self.else_cmds = else_cmds
+
+class Case:
+ def __init__(self, name, items):
+ self.name = name
+ self.items = items
+
+class SubShell:
+ def __init__(self, cmds):
+ self.cmds = cmds
+
+class RedirectList:
+ def __init__(self, cmd, redirs):
+ self.cmd = cmd
+ self.redirs = list(redirs)
+
+def get_production(productions, ptype):
+ """productions must be a list of production tuples like (name, obj) where
+ name is the production string identifier.
+ Return the first production named 'ptype'. Raise KeyError if None can be
+ found.
+ """
+ for production in productions:
+ if production is not None and production[0]==ptype:
+ return production
+ raise KeyError(ptype)
+
+#-------------------------------------------------------------------------------
+# PLY grammar definition
+#-------------------------------------------------------------------------------
+
+def p_multiple_commands(p):
+ """multiple_commands : newline_sequence
+ | complete_command
+ | multiple_commands complete_command"""
+ if len(p)==2:
+ if p[1] is not None:
+ p[0] = [p[1]]
+ else:
+ p[0] = []
+ else:
+ p[0] = p[1] + [p[2]]
+
+def p_complete_command(p):
+ """complete_command : list separator
+ | list"""
+ if len(p)==3 and p[2] and p[2][1] == '&':
+ p[0] = ('async', p[1])
+ else:
+ p[0] = p[1]
+
+def p_list(p):
+ """list : list separator_op and_or
+ | and_or"""
+ if len(p)==2:
+ p[0] = [p[1]]
+ else:
+ #if p[2]!=';':
+ # raise NotImplementedError('AND-OR list asynchronous execution is not implemented')
+ p[0] = p[1] + [p[3]]
+
+def p_and_or(p):
+ """and_or : pipeline
+ | and_or AND_IF linebreak pipeline
+ | and_or OR_IF linebreak pipeline"""
+ if len(p)==2:
+ p[0] = p[1]
+ else:
+ p[0] = ('and_or', AndOr(p[2], p[1], p[4]))
+
+def p_maybe_bang_word(p):
+ """maybe_bang_word : Bang"""
+ p[0] = ('maybe_bang_word', p[1])
+
+def p_pipeline(p):
+ """pipeline : pipe_sequence
+ | bang_word pipe_sequence"""
+ if len(p)==3:
+ p[0] = ('pipeline', Pipeline(p[2][1:], True))
+ else:
+ p[0] = ('pipeline', Pipeline(p[1][1:]))
+
+def p_pipe_sequence(p):
+ """pipe_sequence : command
+ | pipe_sequence PIPE linebreak command"""
+ if len(p)==2:
+ p[0] = ['pipe_sequence', p[1]]
+ else:
+ p[0] = p[1] + [p[4]]
+
+def p_command(p):
+ """command : simple_command
+ | compound_command
+ | compound_command redirect_list
+ | function_definition"""
+
+ if p[1][0] in ( 'simple_command',
+ 'for_clause',
+ 'while_clause',
+ 'until_clause',
+ 'case_clause',
+ 'if_clause',
+ 'function_definition',
+ 'subshell',
+ 'brace_group',):
+ if len(p) == 2:
+ p[0] = p[1]
+ else:
+ p[0] = ('redirect_list', RedirectList(p[1], p[2][1:]))
+ else:
+ raise NotImplementedError('%s command is not implemented' % repr(p[1][0]))
+
+def p_compound_command(p):
+ """compound_command : brace_group
+ | subshell
+ | for_clause
+ | case_clause
+ | if_clause
+ | while_clause
+ | until_clause"""
+ p[0] = p[1]
+
+def p_subshell(p):
+ """subshell : LPARENS compound_list RPARENS"""
+ p[0] = ('subshell', SubShell(p[2][1:]))
+
+def p_compound_list(p):
+ """compound_list : term
+ | newline_list term
+ | term separator
+ | newline_list term separator"""
+ productions = p[1:]
+ try:
+ sep = get_production(productions, 'separator')
+ if sep[1]!=';':
+ raise NotImplementedError()
+ except KeyError:
+ pass
+ term = get_production(productions, 'term')
+ p[0] = ['compound_list'] + term[1:]
+
+def p_term(p):
+ """term : term separator and_or
+ | and_or"""
+ if len(p)==2:
+ p[0] = ['term', p[1]]
+ else:
+ if p[2] is not None and p[2][1] == '&':
+ p[0] = ['term', ('async', p[1][1:])] + [p[3]]
+ else:
+ p[0] = p[1] + [p[3]]
+
+def p_maybe_for_word(p):
+ # Rearrange 'For' priority wrt TOKEN. See p_for_word
+ """maybe_for_word : For"""
+ p[0] = ('maybe_for_word', p[1])
+
+def p_for_clause(p):
+ """for_clause : for_word name linebreak do_group
+ | for_word name linebreak in sequential_sep do_group
+ | for_word name linebreak in wordlist sequential_sep do_group"""
+ productions = p[1:]
+ do_group = get_production(productions, 'do_group')
+ try:
+ items = get_production(productions, 'in')[1:]
+ except KeyError:
+ raise NotImplementedError('"in" omission is not implemented')
+
+ try:
+ items = get_production(productions, 'wordlist')[1:]
+ except KeyError:
+ items = []
+
+ name = p[2]
+ p[0] = ('for_clause', ForLoop(name, items, do_group[1:]))
+
+def p_name(p):
+ """name : token""" #Was NAME instead of token
+ p[0] = p[1]
+
+def p_in(p):
+ """in : In"""
+ p[0] = ('in', p[1])
+
+def p_wordlist(p):
+ """wordlist : wordlist token
+ | token"""
+ if len(p)==2:
+ p[0] = ['wordlist', ('TOKEN', p[1])]
+ else:
+ p[0] = p[1] + [('TOKEN', p[2])]
+
+def p_case_clause(p):
+ """case_clause : Case token linebreak in linebreak case_list Esac
+ | Case token linebreak in linebreak case_list_ns Esac
+ | Case token linebreak in linebreak Esac"""
+ if len(p) < 8:
+ items = []
+ else:
+ items = p[6][1:]
+ name = p[2]
+ p[0] = ('case_clause', Case(name, [c[1] for c in items]))
+
+def p_case_list_ns(p):
+ """case_list_ns : case_list case_item_ns
+ | case_item_ns"""
+ p_case_list(p)
+
+def p_case_list(p):
+ """case_list : case_list case_item
+ | case_item"""
+ if len(p)==2:
+ p[0] = ['case_list', p[1]]
+ else:
+ p[0] = p[1] + [p[2]]
+
+def p_case_item_ns(p):
+ """case_item_ns : pattern RPARENS linebreak
+ | pattern RPARENS compound_list linebreak
+ | LPARENS pattern RPARENS linebreak
+ | LPARENS pattern RPARENS compound_list linebreak"""
+ p_case_item(p)
+
+def p_case_item(p):
+ """case_item : pattern RPARENS linebreak DSEMI linebreak
+ | pattern RPARENS compound_list DSEMI linebreak
+ | LPARENS pattern RPARENS linebreak DSEMI linebreak
+ | LPARENS pattern RPARENS compound_list DSEMI linebreak"""
+ if len(p) < 7:
+ name = p[1][1:]
+ else:
+ name = p[2][1:]
+
+ try:
+ cmds = get_production(p[1:], "compound_list")[1:]
+ except KeyError:
+ cmds = []
+
+ p[0] = ('case_item', (name, cmds))
+
+def p_pattern(p):
+ """pattern : token
+ | pattern PIPE token"""
+ if len(p)==2:
+ p[0] = ['pattern', ('TOKEN', p[1])]
+ else:
+ p[0] = p[1] + [('TOKEN', p[2])]
+
+def p_maybe_if_word(p):
+ # Rearrange 'If' priority wrt TOKEN. See p_if_word
+ """maybe_if_word : If"""
+ p[0] = ('maybe_if_word', p[1])
+
+def p_maybe_then_word(p):
+ # Rearrange 'Then' priority wrt TOKEN. See p_then_word
+ """maybe_then_word : Then"""
+ p[0] = ('maybe_then_word', p[1])
+
+def p_if_clause(p):
+ """if_clause : if_word compound_list then_word compound_list else_part Fi
+ | if_word compound_list then_word compound_list Fi"""
+ else_part = []
+ if len(p)==7:
+ else_part = p[5]
+ p[0] = ('if_clause', IfCond(p[2][1:], p[4][1:], else_part))
+
+def p_else_part(p):
+ """else_part : Elif compound_list then_word compound_list else_part
+ | Elif compound_list then_word compound_list
+ | Else compound_list"""
+ if len(p)==3:
+ p[0] = p[2][1:]
+ else:
+ else_part = []
+ if len(p)==6:
+ else_part = p[5]
+ p[0] = ('elif', IfCond(p[2][1:], p[4][1:], else_part))
+
+def p_while_clause(p):
+ """while_clause : While compound_list do_group"""
+ p[0] = ('while_clause', WhileLoop(p[2][1:], p[3][1:]))
+
+def p_maybe_until_word(p):
+ # Rearrange 'Until' priority wrt TOKEN. See p_until_word
+ """maybe_until_word : Until"""
+ p[0] = ('maybe_until_word', p[1])
+
+def p_until_clause(p):
+ """until_clause : until_word compound_list do_group"""
+ p[0] = ('until_clause', UntilLoop(p[2][1:], p[3][1:]))
+
+def p_function_definition(p):
+ """function_definition : fname LPARENS RPARENS linebreak function_body"""
+ p[0] = ('function_definition', FunDef(p[1], p[5]))
+
+def p_function_body(p):
+ """function_body : compound_command
+ | compound_command redirect_list"""
+ if len(p)!=2:
+ raise NotImplementedError('functions redirections lists are not implemented')
+ p[0] = p[1]
+
+def p_fname(p):
+ """fname : TOKEN""" #Was NAME instead of token
+ p[0] = p[1]
+
+def p_brace_group(p):
+ """brace_group : Lbrace compound_list Rbrace"""
+ p[0] = ('brace_group', BraceGroup(p[2][1:]))
+
+def p_maybe_done_word(p):
+ #See p_assignment_word for details.
+ """maybe_done_word : Done"""
+ p[0] = ('maybe_done_word', p[1])
+
+def p_maybe_do_word(p):
+ """maybe_do_word : Do"""
+ p[0] = ('maybe_do_word', p[1])
+
+def p_do_group(p):
+ """do_group : do_word compound_list done_word"""
+ #Do group contains a list of AndOr
+ p[0] = ['do_group'] + p[2][1:]
+
+def p_simple_command(p):
+ """simple_command : cmd_prefix cmd_word cmd_suffix
+ | cmd_prefix cmd_word
+ | cmd_prefix
+ | cmd_name cmd_suffix
+ | cmd_name"""
+ words, redirs, assigns = [], [], []
+ for e in p[1:]:
+ name = e[0]
+ if name in ('cmd_prefix', 'cmd_suffix'):
+ for sube in e[1:]:
+ subname = sube[0]
+ if subname=='io_redirect':
+ redirs.append(make_io_redirect(sube))
+ elif subname=='ASSIGNMENT_WORD':
+ assigns.append(sube)
+ else:
+ words.append(sube)
+ elif name in ('cmd_word', 'cmd_name'):
+ words.append(e)
+
+ cmd = SimpleCommand(words, redirs, assigns)
+ p[0] = ('simple_command', cmd)
+
+def p_cmd_name(p):
+ """cmd_name : TOKEN"""
+ p[0] = ('cmd_name', p[1])
+
+def p_cmd_word(p):
+ """cmd_word : token"""
+ p[0] = ('cmd_word', p[1])
+
+def p_maybe_assignment_word(p):
+ #See p_assignment_word for details.
+ """maybe_assignment_word : ASSIGNMENT_WORD"""
+ p[0] = ('maybe_assignment_word', p[1])
+
+def p_cmd_prefix(p):
+ """cmd_prefix : io_redirect
+ | cmd_prefix io_redirect
+ | assignment_word
+ | cmd_prefix assignment_word"""
+ try:
+ prefix = get_production(p[1:], 'cmd_prefix')
+ except KeyError:
+ prefix = ['cmd_prefix']
+
+ try:
+ value = get_production(p[1:], 'assignment_word')[1]
+ value = ('ASSIGNMENT_WORD', value.split('=', 1))
+ except KeyError:
+ value = get_production(p[1:], 'io_redirect')
+ p[0] = prefix + [value]
+
+def p_cmd_suffix(p):
+ """cmd_suffix : io_redirect
+ | cmd_suffix io_redirect
+ | token
+ | cmd_suffix token
+ | maybe_for_word
+ | cmd_suffix maybe_for_word
+ | maybe_done_word
+ | cmd_suffix maybe_done_word
+ | maybe_do_word
+ | cmd_suffix maybe_do_word
+ | maybe_until_word
+ | cmd_suffix maybe_until_word
+ | maybe_assignment_word
+ | cmd_suffix maybe_assignment_word
+ | maybe_if_word
+ | cmd_suffix maybe_if_word
+ | maybe_then_word
+ | cmd_suffix maybe_then_word
+ | maybe_bang_word
+ | cmd_suffix maybe_bang_word"""
+ try:
+ suffix = get_production(p[1:], 'cmd_suffix')
+ token = p[2]
+ except KeyError:
+ suffix = ['cmd_suffix']
+ token = p[1]
+
+ if isinstance(token, tuple):
+ if token[0]=='io_redirect':
+ p[0] = suffix + [token]
+ else:
+ #Convert maybe_* to TOKEN if necessary
+ p[0] = suffix + [('TOKEN', token[1])]
+ else:
+ p[0] = suffix + [('TOKEN', token)]
+
+def p_redirect_list(p):
+ """redirect_list : io_redirect
+ | redirect_list io_redirect"""
+ if len(p) == 2:
+ p[0] = ['redirect_list', make_io_redirect(p[1])]
+ else:
+ p[0] = p[1] + [make_io_redirect(p[2])]
+
+def p_io_redirect(p):
+ """io_redirect : io_file
+ | IO_NUMBER io_file
+ | io_here
+ | IO_NUMBER io_here"""
+ if len(p)==3:
+ p[0] = ('io_redirect', p[1], p[2])
+ else:
+ p[0] = ('io_redirect', None, p[1])
+
+def p_io_file(p):
+ #Return the tuple (operator, filename)
+ """io_file : LESS filename
+ | LESSAND filename
+ | GREATER filename
+ | GREATAND filename
+ | DGREAT filename
+ | LESSGREAT filename
+ | CLOBBER filename"""
+ #Extract the filename from the file
+ p[0] = ('io_file', p[1], p[2][1])
+
+def p_filename(p):
+ #Return the filename
+ """filename : TOKEN"""
+ p[0] = ('filename', p[1])
+
+def p_io_here(p):
+ """io_here : DLESS here_end
+ | DLESSDASH here_end"""
+ p[0] = ('io_here', p[1], p[2][1], p[2][2])
+
+def p_here_end(p):
+ """here_end : HERENAME TOKEN"""
+ p[0] = ('here_document', p[1], p[2])
+
+def p_newline_sequence(p):
+ # Nothing in the grammar can handle leading NEWLINE productions, so add
+ # this one with the lowest possible priority relatively to newline_list.
+ """newline_sequence : newline_list"""
+ p[0] = None
+
+def p_newline_list(p):
+ """newline_list : NEWLINE
+ | newline_list NEWLINE"""
+ p[0] = None
+
+def p_linebreak(p):
+ """linebreak : newline_list
+ | empty"""
+ p[0] = None
+
+def p_separator_op(p):
+ """separator_op : COMMA
+ | AMP"""
+ p[0] = p[1]
+
+def p_separator(p):
+ """separator : separator_op linebreak
+ | newline_list"""
+ if len(p)==2:
+ #Ignore newlines
+ p[0] = None
+ else:
+ #Keep the separator operator
+ p[0] = ('separator', p[1])
+
+def p_sequential_sep(p):
+ """sequential_sep : COMMA linebreak
+ | newline_list"""
+ p[0] = None
+
+# Low priority TOKEN => for_word conversion.
+# Let maybe_for_word be used as a token when necessary in higher priority
+# rules.
+def p_for_word(p):
+ """for_word : maybe_for_word"""
+ p[0] = p[1]
+
+def p_if_word(p):
+ """if_word : maybe_if_word"""
+ p[0] = p[1]
+
+def p_then_word(p):
+ """then_word : maybe_then_word"""
+ p[0] = p[1]
+
+def p_done_word(p):
+ """done_word : maybe_done_word"""
+ p[0] = p[1]
+
+def p_do_word(p):
+ """do_word : maybe_do_word"""
+ p[0] = p[1]
+
+def p_until_word(p):
+ """until_word : maybe_until_word"""
+ p[0] = p[1]
+
+def p_assignment_word(p):
+ """assignment_word : maybe_assignment_word"""
+ p[0] = ('assignment_word', p[1][1])
+
+def p_bang_word(p):
+ """bang_word : maybe_bang_word"""
+ p[0] = ('bang_word', p[1][1])
+
+def p_token(p):
+ """token : TOKEN
+ | Fi"""
+ p[0] = p[1]
+
+def p_empty(p):
+ 'empty :'
+ p[0] = None
+
+# Error rule for syntax errors
+def p_error(p):
+ msg = []
+ w = msg.append
+ w('%r\n' % p)
+ w('followed by:\n')
+ for i in range(5):
+ n = yacc.token()
+ if not n:
+ break
+ w(' %r\n' % n)
+ raise sherrors.ShellSyntaxError(''.join(msg))
+
+# Build the parser
+try:
+ import pyshtables
+except ImportError:
+ outputdir = os.path.dirname(__file__)
+ if not os.access(outputdir, os.W_OK):
+ outputdir = ''
+ yacc.yacc(tabmodule = 'pyshtables', outputdir = outputdir, debug = 0)
+else:
+ yacc.yacc(tabmodule = 'pysh.pyshtables', write_tables = 0, debug = 0)
+
+
+def parse(input, eof=False, debug=False):
+ """Parse a whole script at once and return the generated AST and unconsumed
+ data in a tuple.
+
+ NOTE: eof is probably meaningless for now, the parser being unable to work
+ in pull mode. It should be set to True.
+ """
+ lexer = pyshlex.PLYLexer()
+ remaining = lexer.add(input, eof)
+ if lexer.is_empty():
+ return [], remaining
+ if debug:
+ debug = 2
+ return yacc.parse(lexer=lexer, debug=debug), remaining
+
+#-------------------------------------------------------------------------------
+# AST rendering helpers
+#-------------------------------------------------------------------------------
+
+def format_commands(v):
+ """Return a tree made of strings and lists. Make command trees easier to
+ display.
+ """
+ if isinstance(v, list):
+ return [format_commands(c) for c in v]
+ if isinstance(v, tuple):
+ if len(v)==2 and isinstance(v[0], str) and not isinstance(v[1], str):
+ if v[0] == 'async':
+ return ['AsyncList', map(format_commands, v[1])]
+ else:
+ #Avoid decomposing tuples like ('pipeline', Pipeline(...))
+ return format_commands(v[1])
+ return format_commands(list(v))
+ elif isinstance(v, IfCond):
+ name = ['IfCond']
+ name += ['if', map(format_commands, v.cond)]
+ name += ['then', map(format_commands, v.if_cmds)]
+ name += ['else', map(format_commands, v.else_cmds)]
+ return name
+ elif isinstance(v, ForLoop):
+ name = ['ForLoop']
+ name += [repr(v.name)+' in ', map(str, v.items)]
+ name += ['commands', map(format_commands, v.cmds)]
+ return name
+ elif isinstance(v, AndOr):
+ return [v.op, format_commands(v.left), format_commands(v.right)]
+ elif isinstance(v, Pipeline):
+ name = 'Pipeline'
+ if v.reverse_status:
+ name = '!' + name
+ return [name, format_commands(v.commands)]
+ elif isinstance(v, Case):
+ name = ['Case']
+ name += [v.name, format_commands(v.items)]
+ elif isinstance(v, SimpleCommand):
+ name = ['SimpleCommand']
+ if v.words:
+ name += ['words', map(str, v.words)]
+ if v.assigns:
+ assigns = [tuple(a[1]) for a in v.assigns]
+ name += ['assigns', map(str, assigns)]
+ if v.redirs:
+ name += ['redirs', map(format_commands, v.redirs)]
+ return name
+ elif isinstance(v, RedirectList):
+ name = ['RedirectList']
+ if v.redirs:
+ name += ['redirs', map(format_commands, v.redirs)]
+ name += ['command', format_commands(v.cmd)]
+ return name
+ elif isinstance(v, IORedirect):
+ return ' '.join(map(str, (v.io_number, v.op, v.filename)))
+ elif isinstance(v, HereDocument):
+ return ' '.join(map(str, (v.io_number, v.op, repr(v.name), repr(v.content))))
+ elif isinstance(v, SubShell):
+ return ['SubShell', map(format_commands, v.cmds)]
+ else:
+ return repr(v)
+
+def print_commands(cmds, output=sys.stdout):
+ """Pretty print a command tree."""
+ def print_tree(cmd, spaces, output):
+ if isinstance(cmd, list):
+ for c in cmd:
+ print_tree(c, spaces + 3, output)
+ else:
+ print >>output, ' '*spaces + str(cmd)
+
+ formatted = format_commands(cmds)
+ print_tree(formatted, 0, output)
+
+
+def stringify_commands(cmds):
+ """Serialize a command tree as a string.
+
+ Returned string is not pretty and is currently used for unit tests only.
+ """
+ def stringify(value):
+ output = []
+ if isinstance(value, list):
+ formatted = []
+ for v in value:
+ formatted.append(stringify(v))
+ formatted = ' '.join(formatted)
+ output.append(''.join(['<', formatted, '>']))
+ else:
+ output.append(value)
+ return ' '.join(output)
+
+ return stringify(format_commands(cmds))
+
+
+def visit_commands(cmds, callable):
+ """Visit the command tree and execute callable on every Pipeline and
+ SimpleCommand instances.
+ """
+ if isinstance(cmds, (tuple, list)):
+ map(lambda c: visit_commands(c,callable), cmds)
+ elif isinstance(cmds, (Pipeline, SimpleCommand)):
+ callable(cmds)
diff --git a/poky/bitbake/lib/bb/pysh/sherrors.py b/poky/bitbake/lib/bb/pysh/sherrors.py
new file mode 100644
index 000000000..49d0533de
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/sherrors.py
@@ -0,0 +1,41 @@
+# sherrors.py - shell errors and signals
+#
+# Copyright 2007 Patrick Mezard
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+
+"""Define shell exceptions and error codes.
+"""
+
+class ShellError(Exception):
+ pass
+
+class ShellSyntaxError(ShellError):
+ pass
+
+class UtilityError(ShellError):
+ """Raised upon utility syntax error (option or operand error)."""
+ pass
+
+class ExpansionError(ShellError):
+ pass
+
+class CommandNotFound(ShellError):
+ """Specified command was not found."""
+ pass
+
+class RedirectionError(ShellError):
+ pass
+
+class VarAssignmentError(ShellError):
+ """Variable assignment error."""
+ pass
+
+class ExitSignal(ShellError):
+ """Exit signal."""
+ pass
+
+class ReturnSignal(ShellError):
+ """Exit signal."""
+ pass
diff --git a/poky/bitbake/lib/bb/pysh/subprocess_fix.py b/poky/bitbake/lib/bb/pysh/subprocess_fix.py
new file mode 100644
index 000000000..46eca2280
--- /dev/null
+++ b/poky/bitbake/lib/bb/pysh/subprocess_fix.py
@@ -0,0 +1,77 @@
+# subprocess - Subprocesses with accessible I/O streams
+#
+# For more information about this module, see PEP 324.
+#
+# This module should remain compatible with Python 2.2, see PEP 291.
+#
+# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
+#
+# Licensed to PSF under a Contributor Agreement.
+# See http://www.python.org/2.4/license for licensing details.
+
+def list2cmdline(seq):
+ """
+ Translate a sequence of arguments into a command line
+ string, using the same rules as the MS C runtime:
+
+ 1) Arguments are delimited by white space, which is either a
+ space or a tab.
+
+ 2) A string surrounded by double quotation marks is
+ interpreted as a single argument, regardless of white space
+ contained within. A quoted string can be embedded in an
+ argument.
+
+ 3) A double quotation mark preceded by a backslash is
+ interpreted as a literal double quotation mark.
+
+ 4) Backslashes are interpreted literally, unless they
+ immediately precede a double quotation mark.
+
+ 5) If backslashes immediately precede a double quotation mark,
+ every pair of backslashes is interpreted as a literal
+ backslash. If the number of backslashes is odd, the last
+ backslash escapes the next double quotation mark as
+ described in rule 3.
+ """
+
+ # See
+ # http://msdn.microsoft.com/library/en-us/vccelng/htm/progs_12.asp
+ result = []
+ needquote = False
+ for arg in seq:
+ bs_buf = []
+
+ # Add a space to separate this argument from the others
+ if result:
+ result.append(' ')
+
+ needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or arg == ""
+ if needquote:
+ result.append('"')
+
+ for c in arg:
+ if c == '\\':
+ # Don't know if we need to double yet.
+ bs_buf.append(c)
+ elif c == '"':
+ # Double backspaces.
+ result.append('\\' * len(bs_buf)*2)
+ bs_buf = []
+ result.append('\\"')
+ else:
+ # Normal char
+ if bs_buf:
+ result.extend(bs_buf)
+ bs_buf = []
+ result.append(c)
+
+ # Add remaining backspaces, if any.
+ if bs_buf:
+ result.extend(bs_buf)
+
+ if needquote:
+ result.extend(bs_buf)
+ result.append('"')
+
+ return ''.join(result)
diff --git a/poky/bitbake/lib/bb/remotedata.py b/poky/bitbake/lib/bb/remotedata.py
new file mode 100644
index 000000000..68ecffc19
--- /dev/null
+++ b/poky/bitbake/lib/bb/remotedata.py
@@ -0,0 +1,116 @@
+"""
+BitBake 'remotedata' module
+
+Provides support for using a datastore from the bitbake client
+"""
+
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import bb.data
+
+class RemoteDatastores:
+ """Used on the server side to manage references to server-side datastores"""
+ def __init__(self, cooker):
+ self.cooker = cooker
+ self.datastores = {}
+ self.locked = []
+ self.nextindex = 1
+
+ def __len__(self):
+ return len(self.datastores)
+
+ def __getitem__(self, key):
+ if key is None:
+ return self.cooker.data
+ else:
+ return self.datastores[key]
+
+ def items(self):
+ return self.datastores.items()
+
+ def store(self, d, locked=False):
+ """
+ Put a datastore into the collection. If locked=True then the datastore
+ is understood to be managed externally and cannot be released by calling
+ release().
+ """
+ idx = self.nextindex
+ self.datastores[idx] = d
+ if locked:
+ self.locked.append(idx)
+ self.nextindex += 1
+ return idx
+
+ def check_store(self, d, locked=False):
+ """
+ Put a datastore into the collection if it's not already in there;
+ in either case return the index
+ """
+ for key, val in self.datastores.items():
+ if val is d:
+ idx = key
+ break
+ else:
+ idx = self.store(d, locked)
+ return idx
+
+ def release(self, idx):
+ """Discard a datastore in the collection"""
+ if idx in self.locked:
+ raise Exception('Tried to release locked datastore %d' % idx)
+ del self.datastores[idx]
+
+ def receive_datastore(self, remote_data):
+ """Receive a datastore object sent from the client (as prepared by transmit_datastore())"""
+ dct = dict(remote_data)
+ d = bb.data_smart.DataSmart()
+ d.dict = dct
+ while True:
+ if '_remote_data' in dct:
+ dsindex = dct['_remote_data']['_content']
+ del dct['_remote_data']
+ if dsindex is None:
+ dct['_data'] = self.cooker.data.dict
+ else:
+ dct['_data'] = self.datastores[dsindex].dict
+ break
+ elif '_data' in dct:
+ idct = dict(dct['_data'])
+ dct['_data'] = idct
+ dct = idct
+ else:
+ break
+ return d
+
+ @staticmethod
+ def transmit_datastore(d):
+ """Prepare a datastore object for sending over IPC from the client end"""
+ # FIXME content might be a dict, need to turn that into a list as well
+ def copy_dicts(dct):
+ if '_remote_data' in dct:
+ dsindex = dct['_remote_data']['_content'].dsindex
+ newdct = dct.copy()
+ newdct['_remote_data'] = {'_content': dsindex}
+ return list(newdct.items())
+ elif '_data' in dct:
+ newdct = dct.copy()
+ newdata = copy_dicts(dct['_data'])
+ if newdata:
+ newdct['_data'] = newdata
+ return list(newdct.items())
+ return None
+ main_dict = copy_dicts(d.dict)
+ return main_dict
diff --git a/poky/bitbake/lib/bb/runqueue.py b/poky/bitbake/lib/bb/runqueue.py
new file mode 100644
index 000000000..f2e52cf75
--- /dev/null
+++ b/poky/bitbake/lib/bb/runqueue.py
@@ -0,0 +1,2682 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'RunQueue' implementation
+
+Handles preparation and execution of a queue of tasks
+"""
+
+# Copyright (C) 2006-2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import copy
+import os
+import sys
+import signal
+import stat
+import fcntl
+import errno
+import logging
+import re
+import bb
+from bb import msg, data, event
+from bb import monitordisk
+import subprocess
+import pickle
+from multiprocessing import Process
+
+bblogger = logging.getLogger("BitBake")
+logger = logging.getLogger("BitBake.RunQueue")
+
+__find_md5__ = re.compile( r'(?i)(?<![a-z0-9])[a-f0-9]{32}(?![a-z0-9])' )
+
+def fn_from_tid(tid):
+ return tid.rsplit(":", 1)[0]
+
+def taskname_from_tid(tid):
+ return tid.rsplit(":", 1)[1]
+
+def split_tid(tid):
+ (mc, fn, taskname, _) = split_tid_mcfn(tid)
+ return (mc, fn, taskname)
+
+def split_tid_mcfn(tid):
+ if tid.startswith('multiconfig:'):
+ elems = tid.split(':')
+ mc = elems[1]
+ fn = ":".join(elems[2:-1])
+ taskname = elems[-1]
+ mcfn = "multiconfig:" + mc + ":" + fn
+ else:
+ tid = tid.rsplit(":", 1)
+ mc = ""
+ fn = tid[0]
+ taskname = tid[1]
+ mcfn = fn
+
+ return (mc, fn, taskname, mcfn)
+
+def build_tid(mc, fn, taskname):
+ if mc:
+ return "multiconfig:" + mc + ":" + fn + ":" + taskname
+ return fn + ":" + taskname
+
+class RunQueueStats:
+ """
+ Holds statistics on the tasks handled by the associated runQueue
+ """
+ def __init__(self, total):
+ self.completed = 0
+ self.skipped = 0
+ self.failed = 0
+ self.active = 0
+ self.total = total
+
+ def copy(self):
+ obj = self.__class__(self.total)
+ obj.__dict__.update(self.__dict__)
+ return obj
+
+ def taskFailed(self):
+ self.active = self.active - 1
+ self.failed = self.failed + 1
+
+ def taskCompleted(self, number = 1):
+ self.active = self.active - number
+ self.completed = self.completed + number
+
+ def taskSkipped(self, number = 1):
+ self.active = self.active + number
+ self.skipped = self.skipped + number
+
+ def taskActive(self):
+ self.active = self.active + 1
+
+# These values indicate the next step due to be run in the
+# runQueue state machine
+runQueuePrepare = 2
+runQueueSceneInit = 3
+runQueueSceneRun = 4
+runQueueRunInit = 5
+runQueueRunning = 6
+runQueueFailed = 7
+runQueueCleanUp = 8
+runQueueComplete = 9
+
+class RunQueueScheduler(object):
+ """
+ Control the order tasks are scheduled in.
+ """
+ name = "basic"
+
+ def __init__(self, runqueue, rqdata):
+ """
+ The default scheduler just returns the first buildable task (the
+ priority map is sorted by task number)
+ """
+ self.rq = runqueue
+ self.rqdata = rqdata
+ self.numTasks = len(self.rqdata.runtaskentries)
+
+ self.prio_map = [self.rqdata.runtaskentries.keys()]
+
+ self.buildable = []
+ self.stamps = {}
+ for tid in self.rqdata.runtaskentries:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ self.stamps[tid] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
+ if tid in self.rq.runq_buildable:
+ self.buildable.append(tid)
+
+ self.rev_prio_map = None
+
+ def next_buildable_task(self):
+ """
+ Return the id of the first task we find that is buildable
+ """
+ self.buildable = [x for x in self.buildable if x not in self.rq.runq_running]
+ if not self.buildable:
+ return None
+ if len(self.buildable) == 1:
+ tid = self.buildable[0]
+ stamp = self.stamps[tid]
+ if stamp not in self.rq.build_stamps.values():
+ return tid
+
+ if not self.rev_prio_map:
+ self.rev_prio_map = {}
+ for tid in self.rqdata.runtaskentries:
+ self.rev_prio_map[tid] = self.prio_map.index(tid)
+
+ best = None
+ bestprio = None
+ for tid in self.buildable:
+ prio = self.rev_prio_map[tid]
+ if bestprio is None or bestprio > prio:
+ stamp = self.stamps[tid]
+ if stamp in self.rq.build_stamps.values():
+ continue
+ bestprio = prio
+ best = tid
+
+ return best
+
+ def next(self):
+ """
+ Return the id of the task we should build next
+ """
+ if self.rq.stats.active < self.rq.number_tasks:
+ return self.next_buildable_task()
+
+ def newbuildable(self, task):
+ self.buildable.append(task)
+
+ def describe_task(self, taskid):
+ result = 'ID %s' % taskid
+ if self.rev_prio_map:
+ result = result + (' pri %d' % self.rev_prio_map[taskid])
+ return result
+
+ def dump_prio(self, comment):
+ bb.debug(3, '%s (most important first):\n%s' %
+ (comment,
+ '\n'.join(['%d. %s' % (index + 1, self.describe_task(taskid)) for
+ index, taskid in enumerate(self.prio_map)])))
+
+class RunQueueSchedulerSpeed(RunQueueScheduler):
+ """
+ A scheduler optimised for speed. The priority map is sorted by task weight,
+ heavier weighted tasks (tasks needed by the most other tasks) are run first.
+ """
+ name = "speed"
+
+ def __init__(self, runqueue, rqdata):
+ """
+ The priority map is sorted by task weight.
+ """
+ RunQueueScheduler.__init__(self, runqueue, rqdata)
+
+ weights = {}
+ for tid in self.rqdata.runtaskentries:
+ weight = self.rqdata.runtaskentries[tid].weight
+ if not weight in weights:
+ weights[weight] = []
+ weights[weight].append(tid)
+
+ self.prio_map = []
+ for weight in sorted(weights):
+ for w in weights[weight]:
+ self.prio_map.append(w)
+
+ self.prio_map.reverse()
+
+class RunQueueSchedulerCompletion(RunQueueSchedulerSpeed):
+ """
+ A scheduler optimised to complete .bb files as quickly as possible. The
+ priority map is sorted by task weight, but then reordered so once a given
+ .bb file starts to build, it's completed as quickly as possible by
+ running all tasks related to the same .bb file one after the after.
+ This works well where disk space is at a premium and classes like OE's
+ rm_work are in force.
+ """
+ name = "completion"
+
+ def __init__(self, runqueue, rqdata):
+ super(RunQueueSchedulerCompletion, self).__init__(runqueue, rqdata)
+
+ # Extract list of tasks for each recipe, with tasks sorted
+ # ascending from "must run first" (typically do_fetch) to
+ # "runs last" (do_build). The speed scheduler prioritizes
+ # tasks that must run first before the ones that run later;
+ # this is what we depend on here.
+ task_lists = {}
+ for taskid in self.prio_map:
+ fn, taskname = taskid.rsplit(':', 1)
+ task_lists.setdefault(fn, []).append(taskname)
+
+ # Now unify the different task lists. The strategy is that
+ # common tasks get skipped and new ones get inserted after the
+ # preceeding common one(s) as they are found. Because task
+ # lists should differ only by their number of tasks, but not
+ # the ordering of the common tasks, this should result in a
+ # deterministic result that is a superset of the individual
+ # task ordering.
+ all_tasks = []
+ for recipe, new_tasks in task_lists.items():
+ index = 0
+ old_task = all_tasks[index] if index < len(all_tasks) else None
+ for new_task in new_tasks:
+ if old_task == new_task:
+ # Common task, skip it. This is the fast-path which
+ # avoids a full search.
+ index += 1
+ old_task = all_tasks[index] if index < len(all_tasks) else None
+ else:
+ try:
+ index = all_tasks.index(new_task)
+ # Already present, just not at the current
+ # place. We re-synchronized by changing the
+ # index so that it matches again. Now
+ # move on to the next existing task.
+ index += 1
+ old_task = all_tasks[index] if index < len(all_tasks) else None
+ except ValueError:
+ # Not present. Insert before old_task, which
+ # remains the same (but gets shifted back).
+ all_tasks.insert(index, new_task)
+ index += 1
+ bb.debug(3, 'merged task list: %s' % all_tasks)
+
+ # Now reverse the order so that tasks that finish the work on one
+ # recipe are considered more imporant (= come first). The ordering
+ # is now so that do_build is most important.
+ all_tasks.reverse()
+
+ # Group tasks of the same kind before tasks of less important
+ # kinds at the head of the queue (because earlier = lower
+ # priority number = runs earlier), while preserving the
+ # ordering by recipe. If recipe foo is more important than
+ # bar, then the goal is to work on foo's do_populate_sysroot
+ # before bar's do_populate_sysroot and on the more important
+ # tasks of foo before any of the less important tasks in any
+ # other recipe (if those other recipes are more important than
+ # foo).
+ #
+ # All of this only applies when tasks are runable. Explicit
+ # dependencies still override this ordering by priority.
+ #
+ # Here's an example why this priority re-ordering helps with
+ # minimizing disk usage. Consider a recipe foo with a higher
+ # priority than bar where foo DEPENDS on bar. Then the
+ # implicit rule (from base.bbclass) is that foo's do_configure
+ # depends on bar's do_populate_sysroot. This ensures that
+ # bar's do_populate_sysroot gets done first. Normally the
+ # tasks from foo would continue to run once that is done, and
+ # bar only gets completed and cleaned up later. By ordering
+ # bar's task that depend on bar's do_populate_sysroot before foo's
+ # do_configure, that problem gets avoided.
+ task_index = 0
+ self.dump_prio('original priorities')
+ for task in all_tasks:
+ for index in range(task_index, self.numTasks):
+ taskid = self.prio_map[index]
+ taskname = taskid.rsplit(':', 1)[1]
+ if taskname == task:
+ del self.prio_map[index]
+ self.prio_map.insert(task_index, taskid)
+ task_index += 1
+ self.dump_prio('completion priorities')
+
+class RunTaskEntry(object):
+ def __init__(self):
+ self.depends = set()
+ self.revdeps = set()
+ self.hash = None
+ self.task = None
+ self.weight = 1
+
+class RunQueueData:
+ """
+ BitBake Run Queue implementation
+ """
+ def __init__(self, rq, cooker, cfgData, dataCaches, taskData, targets):
+ self.cooker = cooker
+ self.dataCaches = dataCaches
+ self.taskData = taskData
+ self.targets = targets
+ self.rq = rq
+ self.warn_multi_bb = False
+
+ self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST") or ""
+ self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
+ self.setscenewhitelist = get_setscene_enforce_whitelist(cfgData)
+ self.setscenewhitelist_checked = False
+ self.setscene_enforce = (cfgData.getVar('BB_SETSCENE_ENFORCE') == "1")
+ self.init_progress_reporter = bb.progress.DummyMultiStageProcessProgressReporter()
+
+ self.reset()
+
+ def reset(self):
+ self.runtaskentries = {}
+
+ def runq_depends_names(self, ids):
+ import re
+ ret = []
+ for id in ids:
+ nam = os.path.basename(id)
+ nam = re.sub("_[^,]*,", ",", nam)
+ ret.extend([nam])
+ return ret
+
+ def get_task_hash(self, tid):
+ return self.runtaskentries[tid].hash
+
+ def get_user_idstring(self, tid, task_name_suffix = ""):
+ return tid + task_name_suffix
+
+ def get_short_user_idstring(self, task, task_name_suffix = ""):
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(task)
+ pn = self.dataCaches[mc].pkg_fn[taskfn]
+ taskname = taskname_from_tid(task) + task_name_suffix
+ return "%s:%s" % (pn, taskname)
+
+ def circular_depchains_handler(self, tasks):
+ """
+ Some tasks aren't buildable, likely due to circular dependency issues.
+ Identify the circular dependencies and print them in a user readable format.
+ """
+ from copy import deepcopy
+
+ valid_chains = []
+ explored_deps = {}
+ msgs = []
+
+ def chain_reorder(chain):
+ """
+ Reorder a dependency chain so the lowest task id is first
+ """
+ lowest = 0
+ new_chain = []
+ for entry in range(len(chain)):
+ if chain[entry] < chain[lowest]:
+ lowest = entry
+ new_chain.extend(chain[lowest:])
+ new_chain.extend(chain[:lowest])
+ return new_chain
+
+ def chain_compare_equal(chain1, chain2):
+ """
+ Compare two dependency chains and see if they're the same
+ """
+ if len(chain1) != len(chain2):
+ return False
+ for index in range(len(chain1)):
+ if chain1[index] != chain2[index]:
+ return False
+ return True
+
+ def chain_array_contains(chain, chain_array):
+ """
+ Return True if chain_array contains chain
+ """
+ for ch in chain_array:
+ if chain_compare_equal(ch, chain):
+ return True
+ return False
+
+ def find_chains(tid, prev_chain):
+ prev_chain.append(tid)
+ total_deps = []
+ total_deps.extend(self.runtaskentries[tid].revdeps)
+ for revdep in self.runtaskentries[tid].revdeps:
+ if revdep in prev_chain:
+ idx = prev_chain.index(revdep)
+ # To prevent duplicates, reorder the chain to start with the lowest taskid
+ # and search through an array of those we've already printed
+ chain = prev_chain[idx:]
+ new_chain = chain_reorder(chain)
+ if not chain_array_contains(new_chain, valid_chains):
+ valid_chains.append(new_chain)
+ msgs.append("Dependency loop #%d found:\n" % len(valid_chains))
+ for dep in new_chain:
+ msgs.append(" Task %s (dependent Tasks %s)\n" % (dep, self.runq_depends_names(self.runtaskentries[dep].depends)))
+ msgs.append("\n")
+ if len(valid_chains) > 10:
+ msgs.append("Aborted dependency loops search after 10 matches.\n")
+ return msgs
+ continue
+ scan = False
+ if revdep not in explored_deps:
+ scan = True
+ elif revdep in explored_deps[revdep]:
+ scan = True
+ else:
+ for dep in prev_chain:
+ if dep in explored_deps[revdep]:
+ scan = True
+ if scan:
+ find_chains(revdep, copy.deepcopy(prev_chain))
+ for dep in explored_deps[revdep]:
+ if dep not in total_deps:
+ total_deps.append(dep)
+
+ explored_deps[tid] = total_deps
+
+ for task in tasks:
+ find_chains(task, [])
+
+ return msgs
+
+ def calculate_task_weights(self, endpoints):
+ """
+ Calculate a number representing the "weight" of each task. Heavier weighted tasks
+ have more dependencies and hence should be executed sooner for maximum speed.
+
+ This function also sanity checks the task list finding tasks that are not
+ possible to execute due to circular dependencies.
+ """
+
+ numTasks = len(self.runtaskentries)
+ weight = {}
+ deps_left = {}
+ task_done = {}
+
+ for tid in self.runtaskentries:
+ task_done[tid] = False
+ weight[tid] = 1
+ deps_left[tid] = len(self.runtaskentries[tid].revdeps)
+
+ for tid in endpoints:
+ weight[tid] = 10
+ task_done[tid] = True
+
+ while True:
+ next_points = []
+ for tid in endpoints:
+ for revdep in self.runtaskentries[tid].depends:
+ weight[revdep] = weight[revdep] + weight[tid]
+ deps_left[revdep] = deps_left[revdep] - 1
+ if deps_left[revdep] == 0:
+ next_points.append(revdep)
+ task_done[revdep] = True
+ endpoints = next_points
+ if len(next_points) == 0:
+ break
+
+ # Circular dependency sanity check
+ problem_tasks = []
+ for tid in self.runtaskentries:
+ if task_done[tid] is False or deps_left[tid] != 0:
+ problem_tasks.append(tid)
+ logger.debug(2, "Task %s is not buildable", tid)
+ logger.debug(2, "(Complete marker was %s and the remaining dependency count was %s)\n", task_done[tid], deps_left[tid])
+ self.runtaskentries[tid].weight = weight[tid]
+
+ if problem_tasks:
+ message = "%s unbuildable tasks were found.\n" % len(problem_tasks)
+ message = message + "These are usually caused by circular dependencies and any circular dependency chains found will be printed below. Increase the debug level to see a list of unbuildable tasks.\n\n"
+ message = message + "Identifying dependency loops (this may take a short while)...\n"
+ logger.error(message)
+
+ msgs = self.circular_depchains_handler(problem_tasks)
+
+ message = "\n"
+ for msg in msgs:
+ message = message + msg
+ bb.msg.fatal("RunQueue", message)
+
+ return weight
+
+ def prepare(self):
+ """
+ Turn a set of taskData into a RunQueue and compute data needed
+ to optimise the execution order.
+ """
+
+ runq_build = {}
+ recursivetasks = {}
+ recursiveitasks = {}
+ recursivetasksselfref = set()
+
+ taskData = self.taskData
+
+ found = False
+ for mc in self.taskData:
+ if len(taskData[mc].taskentries) > 0:
+ found = True
+ break
+ if not found:
+ # Nothing to do
+ return 0
+
+ self.init_progress_reporter.start()
+ self.init_progress_reporter.next_stage()
+
+ # Step A - Work out a list of tasks to run
+ #
+ # Taskdata gives us a list of possible providers for every build and run
+ # target ordered by priority. It also gives information on each of those
+ # providers.
+ #
+ # To create the actual list of tasks to execute we fix the list of
+ # providers and then resolve the dependencies into task IDs. This
+ # process is repeated for each type of dependency (tdepends, deptask,
+ # rdeptast, recrdeptask, idepends).
+
+ def add_build_dependencies(depids, tasknames, depends, mc):
+ for depname in depids:
+ # Won't be in build_targets if ASSUME_PROVIDED
+ if depname not in taskData[mc].build_targets or not taskData[mc].build_targets[depname]:
+ continue
+ depdata = taskData[mc].build_targets[depname][0]
+ if depdata is None:
+ continue
+ for taskname in tasknames:
+ t = depdata + ":" + taskname
+ if t in taskData[mc].taskentries:
+ depends.add(t)
+
+ def add_runtime_dependencies(depids, tasknames, depends, mc):
+ for depname in depids:
+ if depname not in taskData[mc].run_targets or not taskData[mc].run_targets[depname]:
+ continue
+ depdata = taskData[mc].run_targets[depname][0]
+ if depdata is None:
+ continue
+ for taskname in tasknames:
+ t = depdata + ":" + taskname
+ if t in taskData[mc].taskentries:
+ depends.add(t)
+
+ for mc in taskData:
+ for tid in taskData[mc].taskentries:
+
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ #runtid = build_tid(mc, fn, taskname)
+
+ #logger.debug(2, "Processing %s,%s:%s", mc, fn, taskname)
+
+ depends = set()
+ task_deps = self.dataCaches[mc].task_deps[taskfn]
+
+ self.runtaskentries[tid] = RunTaskEntry()
+
+ if fn in taskData[mc].failed_fns:
+ continue
+
+ # Resolve task internal dependencies
+ #
+ # e.g. addtask before X after Y
+ for t in taskData[mc].taskentries[tid].tdepends:
+ (_, depfn, deptaskname, _) = split_tid_mcfn(t)
+ depends.add(build_tid(mc, depfn, deptaskname))
+
+ # Resolve 'deptask' dependencies
+ #
+ # e.g. do_sometask[deptask] = "do_someothertask"
+ # (makes sure sometask runs after someothertask of all DEPENDS)
+ if 'deptask' in task_deps and taskname in task_deps['deptask']:
+ tasknames = task_deps['deptask'][taskname].split()
+ add_build_dependencies(taskData[mc].depids[taskfn], tasknames, depends, mc)
+
+ # Resolve 'rdeptask' dependencies
+ #
+ # e.g. do_sometask[rdeptask] = "do_someothertask"
+ # (makes sure sometask runs after someothertask of all RDEPENDS)
+ if 'rdeptask' in task_deps and taskname in task_deps['rdeptask']:
+ tasknames = task_deps['rdeptask'][taskname].split()
+ add_runtime_dependencies(taskData[mc].rdepids[taskfn], tasknames, depends, mc)
+
+ # Resolve inter-task dependencies
+ #
+ # e.g. do_sometask[depends] = "targetname:do_someothertask"
+ # (makes sure sometask runs after targetname's someothertask)
+ idepends = taskData[mc].taskentries[tid].idepends
+ for (depname, idependtask) in idepends:
+ if depname in taskData[mc].build_targets and taskData[mc].build_targets[depname] and not depname in taskData[mc].failed_deps:
+ # Won't be in build_targets if ASSUME_PROVIDED
+ depdata = taskData[mc].build_targets[depname][0]
+ if depdata is not None:
+ t = depdata + ":" + idependtask
+ depends.add(t)
+ if t not in taskData[mc].taskentries:
+ bb.msg.fatal("RunQueue", "Task %s in %s depends upon non-existent task %s in %s" % (taskname, fn, idependtask, depdata))
+ irdepends = taskData[mc].taskentries[tid].irdepends
+ for (depname, idependtask) in irdepends:
+ if depname in taskData[mc].run_targets:
+ # Won't be in run_targets if ASSUME_PROVIDED
+ if not taskData[mc].run_targets[depname]:
+ continue
+ depdata = taskData[mc].run_targets[depname][0]
+ if depdata is not None:
+ t = depdata + ":" + idependtask
+ depends.add(t)
+ if t not in taskData[mc].taskentries:
+ bb.msg.fatal("RunQueue", "Task %s in %s rdepends upon non-existent task %s in %s" % (taskname, fn, idependtask, depdata))
+
+ # Resolve recursive 'recrdeptask' dependencies (Part A)
+ #
+ # e.g. do_sometask[recrdeptask] = "do_someothertask"
+ # (makes sure sometask runs after someothertask of all DEPENDS, RDEPENDS and intertask dependencies, recursively)
+ # We cover the recursive part of the dependencies below
+ if 'recrdeptask' in task_deps and taskname in task_deps['recrdeptask']:
+ tasknames = task_deps['recrdeptask'][taskname].split()
+ recursivetasks[tid] = tasknames
+ add_build_dependencies(taskData[mc].depids[taskfn], tasknames, depends, mc)
+ add_runtime_dependencies(taskData[mc].rdepids[taskfn], tasknames, depends, mc)
+ if taskname in tasknames:
+ recursivetasksselfref.add(tid)
+
+ if 'recideptask' in task_deps and taskname in task_deps['recideptask']:
+ recursiveitasks[tid] = []
+ for t in task_deps['recideptask'][taskname].split():
+ newdep = build_tid(mc, fn, t)
+ recursiveitasks[tid].append(newdep)
+
+ self.runtaskentries[tid].depends = depends
+ # Remove all self references
+ self.runtaskentries[tid].depends.discard(tid)
+
+ #self.dump_data()
+
+ self.init_progress_reporter.next_stage()
+
+ # Resolve recursive 'recrdeptask' dependencies (Part B)
+ #
+ # e.g. do_sometask[recrdeptask] = "do_someothertask"
+ # (makes sure sometask runs after someothertask of all DEPENDS, RDEPENDS and intertask dependencies, recursively)
+ # We need to do this separately since we need all of runtaskentries[*].depends to be complete before this is processed
+
+ # Generating/interating recursive lists of dependencies is painful and potentially slow
+ # Precompute recursive task dependencies here by:
+ # a) create a temp list of reverse dependencies (revdeps)
+ # b) walk up the ends of the chains (when a given task no longer has dependencies i.e. len(deps) == 0)
+ # c) combine the total list of dependencies in cumulativedeps
+ # d) optimise by pre-truncating 'task' off the items in cumulativedeps (keeps items in sets lower)
+
+
+ revdeps = {}
+ deps = {}
+ cumulativedeps = {}
+ for tid in self.runtaskentries:
+ deps[tid] = set(self.runtaskentries[tid].depends)
+ revdeps[tid] = set()
+ cumulativedeps[tid] = set()
+ # Generate a temp list of reverse dependencies
+ for tid in self.runtaskentries:
+ for dep in self.runtaskentries[tid].depends:
+ revdeps[dep].add(tid)
+ # Find the dependency chain endpoints
+ endpoints = set()
+ for tid in self.runtaskentries:
+ if len(deps[tid]) == 0:
+ endpoints.add(tid)
+ # Iterate the chains collating dependencies
+ while endpoints:
+ next = set()
+ for tid in endpoints:
+ for dep in revdeps[tid]:
+ cumulativedeps[dep].add(fn_from_tid(tid))
+ cumulativedeps[dep].update(cumulativedeps[tid])
+ if tid in deps[dep]:
+ deps[dep].remove(tid)
+ if len(deps[dep]) == 0:
+ next.add(dep)
+ endpoints = next
+ #for tid in deps:
+ # if len(deps[tid]) != 0:
+ # bb.warn("Sanity test failure, dependencies left for %s (%s)" % (tid, deps[tid]))
+
+ # Loop here since recrdeptasks can depend upon other recrdeptasks and we have to
+ # resolve these recursively until we aren't adding any further extra dependencies
+ extradeps = True
+ while extradeps:
+ extradeps = 0
+ for tid in recursivetasks:
+ tasknames = recursivetasks[tid]
+
+ totaldeps = set(self.runtaskentries[tid].depends)
+ if tid in recursiveitasks:
+ totaldeps.update(recursiveitasks[tid])
+ for dep in recursiveitasks[tid]:
+ if dep not in self.runtaskentries:
+ continue
+ totaldeps.update(self.runtaskentries[dep].depends)
+
+ deps = set()
+ for dep in totaldeps:
+ if dep in cumulativedeps:
+ deps.update(cumulativedeps[dep])
+
+ for t in deps:
+ for taskname in tasknames:
+ newtid = t + ":" + taskname
+ if newtid == tid:
+ continue
+ if newtid in self.runtaskentries and newtid not in self.runtaskentries[tid].depends:
+ extradeps += 1
+ self.runtaskentries[tid].depends.add(newtid)
+
+ # Handle recursive tasks which depend upon other recursive tasks
+ deps = set()
+ for dep in self.runtaskentries[tid].depends.intersection(recursivetasks):
+ deps.update(self.runtaskentries[dep].depends.difference(self.runtaskentries[tid].depends))
+ for newtid in deps:
+ for taskname in tasknames:
+ if not newtid.endswith(":" + taskname):
+ continue
+ if newtid in self.runtaskentries:
+ extradeps += 1
+ self.runtaskentries[tid].depends.add(newtid)
+
+ bb.debug(1, "Added %s recursive dependencies in this loop" % extradeps)
+
+ # Remove recrdeptask circular references so that do_a[recrdeptask] = "do_a do_b" can work
+ for tid in recursivetasksselfref:
+ self.runtaskentries[tid].depends.difference_update(recursivetasksselfref)
+
+ self.init_progress_reporter.next_stage()
+
+ #self.dump_data()
+
+ # Step B - Mark all active tasks
+ #
+ # Start with the tasks we were asked to run and mark all dependencies
+ # as active too. If the task is to be 'forced', clear its stamp. Once
+ # all active tasks are marked, prune the ones we don't need.
+
+ logger.verbose("Marking Active Tasks")
+
+ def mark_active(tid, depth):
+ """
+ Mark an item as active along with its depends
+ (calls itself recursively)
+ """
+
+ if tid in runq_build:
+ return
+
+ runq_build[tid] = 1
+
+ depends = self.runtaskentries[tid].depends
+ for depend in depends:
+ mark_active(depend, depth+1)
+
+ self.target_tids = []
+ for (mc, target, task, fn) in self.targets:
+
+ if target not in taskData[mc].build_targets or not taskData[mc].build_targets[target]:
+ continue
+
+ if target in taskData[mc].failed_deps:
+ continue
+
+ parents = False
+ if task.endswith('-'):
+ parents = True
+ task = task[:-1]
+
+ if fn in taskData[mc].failed_fns:
+ continue
+
+ # fn already has mc prefix
+ tid = fn + ":" + task
+ self.target_tids.append(tid)
+ if tid not in taskData[mc].taskentries:
+ import difflib
+ tasks = []
+ for x in taskData[mc].taskentries:
+ if x.startswith(fn + ":"):
+ tasks.append(taskname_from_tid(x))
+ close_matches = difflib.get_close_matches(task, tasks, cutoff=0.7)
+ if close_matches:
+ extra = ". Close matches:\n %s" % "\n ".join(close_matches)
+ else:
+ extra = ""
+ bb.msg.fatal("RunQueue", "Task %s does not exist for target %s (%s)%s" % (task, target, tid, extra))
+
+ # For tasks called "XXXX-", ony run their dependencies
+ if parents:
+ for i in self.runtaskentries[tid].depends:
+ mark_active(i, 1)
+ else:
+ mark_active(tid, 1)
+
+ self.init_progress_reporter.next_stage()
+
+ # Step C - Prune all inactive tasks
+ #
+ # Once all active tasks are marked, prune the ones we don't need.
+
+ delcount = {}
+ for tid in list(self.runtaskentries.keys()):
+ if tid not in runq_build:
+ delcount[tid] = self.runtaskentries[tid]
+ del self.runtaskentries[tid]
+
+ # Handle --runall
+ if self.cooker.configuration.runall:
+ # re-run the mark_active and then drop unused tasks from new list
+ runq_build = {}
+
+ for task in self.cooker.configuration.runall:
+ runall_tids = set()
+ for tid in list(self.runtaskentries):
+ wanttid = fn_from_tid(tid) + ":do_%s" % task
+ if wanttid in delcount:
+ self.runtaskentries[wanttid] = delcount[wanttid]
+ if wanttid in self.runtaskentries:
+ runall_tids.add(wanttid)
+
+ for tid in list(runall_tids):
+ mark_active(tid,1)
+
+ for tid in list(self.runtaskentries.keys()):
+ if tid not in runq_build:
+ delcount[tid] = self.runtaskentries[tid]
+ del self.runtaskentries[tid]
+
+ if len(self.runtaskentries) == 0:
+ bb.msg.fatal("RunQueue", "Could not find any tasks with the tasknames %s to run within the recipes of the taskgraphs of the targets %s" % (str(self.cooker.configuration.runall), str(self.targets)))
+
+ self.init_progress_reporter.next_stage()
+
+ # Handle runonly
+ if self.cooker.configuration.runonly:
+ # re-run the mark_active and then drop unused tasks from new list
+ runq_build = {}
+
+ for task in self.cooker.configuration.runonly:
+ runonly_tids = { k: v for k, v in self.runtaskentries.items() if taskname_from_tid(k) == "do_%s" % task }
+
+ for tid in list(runonly_tids):
+ mark_active(tid,1)
+
+ for tid in list(self.runtaskentries.keys()):
+ if tid not in runq_build:
+ delcount[tid] = self.runtaskentries[tid]
+ del self.runtaskentries[tid]
+
+ if len(self.runtaskentries) == 0:
+ bb.msg.fatal("RunQueue", "Could not find any tasks with the tasknames %s to run within the taskgraphs of the targets %s" % (str(self.cooker.configuration.runonly), str(self.targets)))
+
+ #
+ # Step D - Sanity checks and computation
+ #
+
+ # Check to make sure we still have tasks to run
+ if len(self.runtaskentries) == 0:
+ if not taskData[''].abort:
+ bb.msg.fatal("RunQueue", "All buildable tasks have been run but the build is incomplete (--continue mode). Errors for the tasks that failed will have been printed above.")
+ else:
+ bb.msg.fatal("RunQueue", "No active tasks and not in --continue mode?! Please report this bug.")
+
+ logger.verbose("Pruned %s inactive tasks, %s left", len(delcount), len(self.runtaskentries))
+
+ logger.verbose("Assign Weightings")
+
+ self.init_progress_reporter.next_stage()
+
+ # Generate a list of reverse dependencies to ease future calculations
+ for tid in self.runtaskentries:
+ for dep in self.runtaskentries[tid].depends:
+ self.runtaskentries[dep].revdeps.add(tid)
+
+ self.init_progress_reporter.next_stage()
+
+ # Identify tasks at the end of dependency chains
+ # Error on circular dependency loops (length two)
+ endpoints = []
+ for tid in self.runtaskentries:
+ revdeps = self.runtaskentries[tid].revdeps
+ if len(revdeps) == 0:
+ endpoints.append(tid)
+ for dep in revdeps:
+ if dep in self.runtaskentries[tid].depends:
+ bb.msg.fatal("RunQueue", "Task %s has circular dependency on %s" % (tid, dep))
+
+
+ logger.verbose("Compute totals (have %s endpoint(s))", len(endpoints))
+
+ self.init_progress_reporter.next_stage()
+
+ # Calculate task weights
+ # Check of higher length circular dependencies
+ self.runq_weight = self.calculate_task_weights(endpoints)
+
+ self.init_progress_reporter.next_stage()
+
+ # Sanity Check - Check for multiple tasks building the same provider
+ for mc in self.dataCaches:
+ prov_list = {}
+ seen_fn = []
+ for tid in self.runtaskentries:
+ (tidmc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ if taskfn in seen_fn:
+ continue
+ if mc != tidmc:
+ continue
+ seen_fn.append(taskfn)
+ for prov in self.dataCaches[mc].fn_provides[taskfn]:
+ if prov not in prov_list:
+ prov_list[prov] = [taskfn]
+ elif taskfn not in prov_list[prov]:
+ prov_list[prov].append(taskfn)
+ for prov in prov_list:
+ if len(prov_list[prov]) < 2:
+ continue
+ if prov in self.multi_provider_whitelist:
+ continue
+ seen_pn = []
+ # If two versions of the same PN are being built its fatal, we don't support it.
+ for fn in prov_list[prov]:
+ pn = self.dataCaches[mc].pkg_fn[fn]
+ if pn not in seen_pn:
+ seen_pn.append(pn)
+ else:
+ bb.fatal("Multiple versions of %s are due to be built (%s). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_%s to select the correct version or don't depend on multiple versions." % (pn, " ".join(prov_list[prov]), pn))
+ msg = "Multiple .bb files are due to be built which each provide %s:\n %s" % (prov, "\n ".join(prov_list[prov]))
+ #
+ # Construct a list of things which uniquely depend on each provider
+ # since this may help the user figure out which dependency is triggering this warning
+ #
+ msg += "\nA list of tasks depending on these providers is shown and may help explain where the dependency comes from."
+ deplist = {}
+ commondeps = None
+ for provfn in prov_list[prov]:
+ deps = set()
+ for tid in self.runtaskentries:
+ fn = fn_from_tid(tid)
+ if fn != provfn:
+ continue
+ for dep in self.runtaskentries[tid].revdeps:
+ fn = fn_from_tid(dep)
+ if fn == provfn:
+ continue
+ deps.add(dep)
+ if not commondeps:
+ commondeps = set(deps)
+ else:
+ commondeps &= deps
+ deplist[provfn] = deps
+ for provfn in deplist:
+ msg += "\n%s has unique dependees:\n %s" % (provfn, "\n ".join(deplist[provfn] - commondeps))
+ #
+ # Construct a list of provides and runtime providers for each recipe
+ # (rprovides has to cover RPROVIDES, PACKAGES, PACKAGES_DYNAMIC)
+ #
+ msg += "\nIt could be that one recipe provides something the other doesn't and should. The following provider and runtime provider differences may be helpful."
+ provide_results = {}
+ rprovide_results = {}
+ commonprovs = None
+ commonrprovs = None
+ for provfn in prov_list[prov]:
+ provides = set(self.dataCaches[mc].fn_provides[provfn])
+ rprovides = set()
+ for rprovide in self.dataCaches[mc].rproviders:
+ if provfn in self.dataCaches[mc].rproviders[rprovide]:
+ rprovides.add(rprovide)
+ for package in self.dataCaches[mc].packages:
+ if provfn in self.dataCaches[mc].packages[package]:
+ rprovides.add(package)
+ for package in self.dataCaches[mc].packages_dynamic:
+ if provfn in self.dataCaches[mc].packages_dynamic[package]:
+ rprovides.add(package)
+ if not commonprovs:
+ commonprovs = set(provides)
+ else:
+ commonprovs &= provides
+ provide_results[provfn] = provides
+ if not commonrprovs:
+ commonrprovs = set(rprovides)
+ else:
+ commonrprovs &= rprovides
+ rprovide_results[provfn] = rprovides
+ #msg += "\nCommon provides:\n %s" % ("\n ".join(commonprovs))
+ #msg += "\nCommon rprovides:\n %s" % ("\n ".join(commonrprovs))
+ for provfn in prov_list[prov]:
+ msg += "\n%s has unique provides:\n %s" % (provfn, "\n ".join(provide_results[provfn] - commonprovs))
+ msg += "\n%s has unique rprovides:\n %s" % (provfn, "\n ".join(rprovide_results[provfn] - commonrprovs))
+
+ if self.warn_multi_bb:
+ logger.warning(msg)
+ else:
+ logger.error(msg)
+
+ self.init_progress_reporter.next_stage()
+
+ # Create a whitelist usable by the stamp checks
+ self.stampfnwhitelist = {}
+ for mc in self.taskData:
+ self.stampfnwhitelist[mc] = []
+ for entry in self.stampwhitelist.split():
+ if entry not in self.taskData[mc].build_targets:
+ continue
+ fn = self.taskData.build_targets[entry][0]
+ self.stampfnwhitelist[mc].append(fn)
+
+ self.init_progress_reporter.next_stage()
+
+ # Iterate over the task list looking for tasks with a 'setscene' function
+ self.runq_setscene_tids = []
+ if not self.cooker.configuration.nosetscene:
+ for tid in self.runtaskentries:
+ (mc, fn, taskname, _) = split_tid_mcfn(tid)
+ setscenetid = tid + "_setscene"
+ if setscenetid not in taskData[mc].taskentries:
+ continue
+ self.runq_setscene_tids.append(tid)
+
+ def invalidate_task(tid, error_nostamp):
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ taskdep = self.dataCaches[mc].task_deps[taskfn]
+ if fn + ":" + taskname not in taskData[mc].taskentries:
+ logger.warning("Task %s does not exist, invalidating this task will have no effect" % taskname)
+ if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
+ if error_nostamp:
+ bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname)
+ else:
+ bb.debug(1, "Task %s is marked nostamp, cannot invalidate this task" % taskname)
+ else:
+ logger.verbose("Invalidate task %s, %s", taskname, fn)
+ bb.parse.siggen.invalidate_task(taskname, self.dataCaches[mc], fn)
+
+ self.init_progress_reporter.next_stage()
+
+ # Invalidate task if force mode active
+ if self.cooker.configuration.force:
+ for tid in self.target_tids:
+ invalidate_task(tid, False)
+
+ # Invalidate task if invalidate mode active
+ if self.cooker.configuration.invalidate_stamp:
+ for tid in self.target_tids:
+ fn = fn_from_tid(tid)
+ for st in self.cooker.configuration.invalidate_stamp.split(','):
+ if not st.startswith("do_"):
+ st = "do_%s" % st
+ invalidate_task(fn + ":" + st, True)
+
+ self.init_progress_reporter.next_stage()
+
+ # Create and print to the logs a virtual/xxxx -> PN (fn) table
+ for mc in taskData:
+ virtmap = taskData[mc].get_providermap(prefix="virtual/")
+ virtpnmap = {}
+ for v in virtmap:
+ virtpnmap[v] = self.dataCaches[mc].pkg_fn[virtmap[v]]
+ bb.debug(2, "%s resolved to: %s (%s)" % (v, virtpnmap[v], virtmap[v]))
+ if hasattr(bb.parse.siggen, "tasks_resolved"):
+ bb.parse.siggen.tasks_resolved(virtmap, virtpnmap, self.dataCaches[mc])
+
+ self.init_progress_reporter.next_stage()
+
+ # Iterate over the task list and call into the siggen code
+ dealtwith = set()
+ todeal = set(self.runtaskentries)
+ while len(todeal) > 0:
+ for tid in todeal.copy():
+ if len(self.runtaskentries[tid].depends - dealtwith) == 0:
+ dealtwith.add(tid)
+ todeal.remove(tid)
+ procdep = []
+ for dep in self.runtaskentries[tid].depends:
+ procdep.append(fn_from_tid(dep) + "." + taskname_from_tid(dep))
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(taskfn, taskname, procdep, self.dataCaches[mc])
+ task = self.runtaskentries[tid].task
+
+ bb.parse.siggen.writeout_file_checksum_cache()
+
+ #self.dump_data()
+ return len(self.runtaskentries)
+
+ def dump_data(self):
+ """
+ Dump some debug information on the internal data structures
+ """
+ logger.debug(3, "run_tasks:")
+ for tid in self.runtaskentries:
+ logger.debug(3, " %s: %s Deps %s RevDeps %s", tid,
+ self.runtaskentries[tid].weight,
+ self.runtaskentries[tid].depends,
+ self.runtaskentries[tid].revdeps)
+
+class RunQueueWorker():
+ def __init__(self, process, pipe):
+ self.process = process
+ self.pipe = pipe
+
+class RunQueue:
+ def __init__(self, cooker, cfgData, dataCaches, taskData, targets):
+
+ self.cooker = cooker
+ self.cfgData = cfgData
+ self.rqdata = RunQueueData(self, cooker, cfgData, dataCaches, taskData, targets)
+
+ self.stamppolicy = cfgData.getVar("BB_STAMP_POLICY") or "perfile"
+ self.hashvalidate = cfgData.getVar("BB_HASHCHECK_FUNCTION") or None
+ self.setsceneverify = cfgData.getVar("BB_SETSCENE_VERIFY_FUNCTION2") or None
+ self.depvalidate = cfgData.getVar("BB_SETSCENE_DEPVALID") or None
+
+ self.state = runQueuePrepare
+
+ # For disk space monitor
+ # Invoked at regular time intervals via the bitbake heartbeat event
+ # while the build is running. We generate a unique name for the handler
+ # here, just in case that there ever is more than one RunQueue instance,
+ # start the handler when reaching runQueueSceneRun, and stop it when
+ # done with the build.
+ self.dm = monitordisk.diskMonitor(cfgData)
+ self.dm_event_handler_name = '_bb_diskmonitor_' + str(id(self))
+ self.dm_event_handler_registered = False
+ self.rqexe = None
+ self.worker = {}
+ self.fakeworker = {}
+
+ def _start_worker(self, mc, fakeroot = False, rqexec = None):
+ logger.debug(1, "Starting bitbake-worker")
+ magic = "decafbad"
+ if self.cooker.configuration.profile:
+ magic = "decafbadbad"
+ if fakeroot:
+ magic = magic + "beef"
+ mcdata = self.cooker.databuilder.mcdata[mc]
+ fakerootcmd = mcdata.getVar("FAKEROOTCMD")
+ fakerootenv = (mcdata.getVar("FAKEROOTBASEENV") or "").split()
+ env = os.environ.copy()
+ for key, value in (var.split('=') for var in fakerootenv):
+ env[key] = value
+ worker = subprocess.Popen([fakerootcmd, "bitbake-worker", magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE, env=env)
+ else:
+ worker = subprocess.Popen(["bitbake-worker", magic], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
+ bb.utils.nonblockingfd(worker.stdout)
+ workerpipe = runQueuePipe(worker.stdout, None, self.cfgData, self, rqexec)
+
+ runqhash = {}
+ for tid in self.rqdata.runtaskentries:
+ runqhash[tid] = self.rqdata.runtaskentries[tid].hash
+
+ workerdata = {
+ "taskdeps" : self.rqdata.dataCaches[mc].task_deps,
+ "fakerootenv" : self.rqdata.dataCaches[mc].fakerootenv,
+ "fakerootdirs" : self.rqdata.dataCaches[mc].fakerootdirs,
+ "fakerootnoenv" : self.rqdata.dataCaches[mc].fakerootnoenv,
+ "sigdata" : bb.parse.siggen.get_taskdata(),
+ "runq_hash" : runqhash,
+ "logdefaultdebug" : bb.msg.loggerDefaultDebugLevel,
+ "logdefaultverbose" : bb.msg.loggerDefaultVerbose,
+ "logdefaultverboselogs" : bb.msg.loggerVerboseLogs,
+ "logdefaultdomain" : bb.msg.loggerDefaultDomains,
+ "prhost" : self.cooker.prhost,
+ "buildname" : self.cfgData.getVar("BUILDNAME"),
+ "date" : self.cfgData.getVar("DATE"),
+ "time" : self.cfgData.getVar("TIME"),
+ }
+
+ worker.stdin.write(b"<cookerconfig>" + pickle.dumps(self.cooker.configuration) + b"</cookerconfig>")
+ worker.stdin.write(b"<extraconfigdata>" + pickle.dumps(self.cooker.extraconfigdata) + b"</extraconfigdata>")
+ worker.stdin.write(b"<workerdata>" + pickle.dumps(workerdata) + b"</workerdata>")
+ worker.stdin.flush()
+
+ return RunQueueWorker(worker, workerpipe)
+
+ def _teardown_worker(self, worker):
+ if not worker:
+ return
+ logger.debug(1, "Teardown for bitbake-worker")
+ try:
+ worker.process.stdin.write(b"<quit></quit>")
+ worker.process.stdin.flush()
+ worker.process.stdin.close()
+ except IOError:
+ pass
+ while worker.process.returncode is None:
+ worker.pipe.read()
+ worker.process.poll()
+ while worker.pipe.read():
+ continue
+ worker.pipe.close()
+
+ def start_worker(self):
+ if self.worker:
+ self.teardown_workers()
+ self.teardown = False
+ for mc in self.rqdata.dataCaches:
+ self.worker[mc] = self._start_worker(mc)
+
+ def start_fakeworker(self, rqexec, mc):
+ if not mc in self.fakeworker:
+ self.fakeworker[mc] = self._start_worker(mc, True, rqexec)
+
+ def teardown_workers(self):
+ self.teardown = True
+ for mc in self.worker:
+ self._teardown_worker(self.worker[mc])
+ self.worker = {}
+ for mc in self.fakeworker:
+ self._teardown_worker(self.fakeworker[mc])
+ self.fakeworker = {}
+
+ def read_workers(self):
+ for mc in self.worker:
+ self.worker[mc].pipe.read()
+ for mc in self.fakeworker:
+ self.fakeworker[mc].pipe.read()
+
+ def active_fds(self):
+ fds = []
+ for mc in self.worker:
+ fds.append(self.worker[mc].pipe.input)
+ for mc in self.fakeworker:
+ fds.append(self.fakeworker[mc].pipe.input)
+ return fds
+
+ def check_stamp_task(self, tid, taskname = None, recurse = False, cache = None):
+ def get_timestamp(f):
+ try:
+ if not os.access(f, os.F_OK):
+ return None
+ return os.stat(f)[stat.ST_MTIME]
+ except:
+ return None
+
+ (mc, fn, tn, taskfn) = split_tid_mcfn(tid)
+ if taskname is None:
+ taskname = tn
+
+ if self.stamppolicy == "perfile":
+ fulldeptree = False
+ else:
+ fulldeptree = True
+ stampwhitelist = []
+ if self.stamppolicy == "whitelist":
+ stampwhitelist = self.rqdata.stampfnwhitelist[mc]
+
+ stampfile = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn)
+
+ # If the stamp is missing, it's not current
+ if not os.access(stampfile, os.F_OK):
+ logger.debug(2, "Stampfile %s not available", stampfile)
+ return False
+ # If it's a 'nostamp' task, it's not current
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
+ logger.debug(2, "%s.%s is nostamp\n", fn, taskname)
+ return False
+
+ if taskname != "do_setscene" and taskname.endswith("_setscene"):
+ return True
+
+ if cache is None:
+ cache = {}
+
+ iscurrent = True
+ t1 = get_timestamp(stampfile)
+ for dep in self.rqdata.runtaskentries[tid].depends:
+ if iscurrent:
+ (mc2, fn2, taskname2, taskfn2) = split_tid_mcfn(dep)
+ stampfile2 = bb.build.stampfile(taskname2, self.rqdata.dataCaches[mc2], taskfn2)
+ stampfile3 = bb.build.stampfile(taskname2 + "_setscene", self.rqdata.dataCaches[mc2], taskfn2)
+ t2 = get_timestamp(stampfile2)
+ t3 = get_timestamp(stampfile3)
+ if t3 and not t2:
+ continue
+ if t3 and t3 > t2:
+ continue
+ if fn == fn2 or (fulldeptree and fn2 not in stampwhitelist):
+ if not t2:
+ logger.debug(2, 'Stampfile %s does not exist', stampfile2)
+ iscurrent = False
+ break
+ if t1 < t2:
+ logger.debug(2, 'Stampfile %s < %s', stampfile, stampfile2)
+ iscurrent = False
+ break
+ if recurse and iscurrent:
+ if dep in cache:
+ iscurrent = cache[dep]
+ if not iscurrent:
+ logger.debug(2, 'Stampfile for dependency %s:%s invalid (cached)' % (fn2, taskname2))
+ else:
+ iscurrent = self.check_stamp_task(dep, recurse=True, cache=cache)
+ cache[dep] = iscurrent
+ if recurse:
+ cache[tid] = iscurrent
+ return iscurrent
+
+ def _execute_runqueue(self):
+ """
+ Run the tasks in a queue prepared by rqdata.prepare()
+ Upon failure, optionally try to recover the build using any alternate providers
+ (if the abort on failure configuration option isn't set)
+ """
+
+ retval = True
+
+ if self.state is runQueuePrepare:
+ self.rqexe = RunQueueExecuteDummy(self)
+ # NOTE: if you add, remove or significantly refactor the stages of this
+ # process then you should recalculate the weightings here. This is quite
+ # easy to do - just change the next line temporarily to pass debug=True as
+ # the last parameter and you'll get a printout of the weightings as well
+ # as a map to the lines where next_stage() was called. Of course this isn't
+ # critical, but it helps to keep the progress reporting accurate.
+ self.rqdata.init_progress_reporter = bb.progress.MultiStageProcessProgressReporter(self.cooker.data,
+ "Initialising tasks",
+ [43, 967, 4, 3, 1, 5, 3, 7, 13, 1, 2, 1, 1, 246, 35, 1, 38, 1, 35, 2, 338, 204, 142, 3, 3, 37, 244])
+ if self.rqdata.prepare() == 0:
+ self.state = runQueueComplete
+ else:
+ self.state = runQueueSceneInit
+ self.rqdata.init_progress_reporter.next_stage()
+
+ # we are ready to run, emit dependency info to any UI or class which
+ # needs it
+ depgraph = self.cooker.buildDependTree(self, self.rqdata.taskData)
+ self.rqdata.init_progress_reporter.next_stage()
+ bb.event.fire(bb.event.DepTreeGenerated(depgraph), self.cooker.data)
+
+ if self.state is runQueueSceneInit:
+ dump = self.cooker.configuration.dump_signatures
+ if dump:
+ self.rqdata.init_progress_reporter.finish()
+ if 'printdiff' in dump:
+ invalidtasks = self.print_diffscenetasks()
+ self.dump_signatures(dump)
+ if 'printdiff' in dump:
+ self.write_diffscenetasks(invalidtasks)
+ self.state = runQueueComplete
+ else:
+ self.rqdata.init_progress_reporter.next_stage()
+ self.start_worker()
+ self.rqdata.init_progress_reporter.next_stage()
+ self.rqexe = RunQueueExecuteScenequeue(self)
+
+ if self.state is runQueueSceneRun:
+ if not self.dm_event_handler_registered:
+ res = bb.event.register(self.dm_event_handler_name,
+ lambda x: self.dm.check(self) if self.state in [runQueueSceneRun, runQueueRunning, runQueueCleanUp] else False,
+ ('bb.event.HeartbeatEvent',))
+ self.dm_event_handler_registered = True
+ retval = self.rqexe.execute()
+
+ if self.state is runQueueRunInit:
+ if self.cooker.configuration.setsceneonly:
+ self.state = runQueueComplete
+ else:
+ # Just in case we didn't setscene
+ self.rqdata.init_progress_reporter.finish()
+ logger.info("Executing RunQueue Tasks")
+ self.rqexe = RunQueueExecuteTasks(self)
+ self.state = runQueueRunning
+
+ if self.state is runQueueRunning:
+ retval = self.rqexe.execute()
+
+ if self.state is runQueueCleanUp:
+ retval = self.rqexe.finish()
+
+ build_done = self.state is runQueueComplete or self.state is runQueueFailed
+
+ if build_done and self.dm_event_handler_registered:
+ bb.event.remove(self.dm_event_handler_name, None)
+ self.dm_event_handler_registered = False
+
+ if build_done and self.rqexe:
+ self.teardown_workers()
+ if self.rqexe.stats.failed:
+ logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and %d failed.", self.rqexe.stats.completed + self.rqexe.stats.failed, self.rqexe.stats.skipped, self.rqexe.stats.failed)
+ else:
+ # Let's avoid the word "failed" if nothing actually did
+ logger.info("Tasks Summary: Attempted %d tasks of which %d didn't need to be rerun and all succeeded.", self.rqexe.stats.completed, self.rqexe.stats.skipped)
+
+ if self.state is runQueueFailed:
+ raise bb.runqueue.TaskFailure(self.rqexe.failed_tids)
+
+ if self.state is runQueueComplete:
+ # All done
+ return False
+
+ # Loop
+ return retval
+
+ def execute_runqueue(self):
+ # Catch unexpected exceptions and ensure we exit when an error occurs, not loop.
+ try:
+ return self._execute_runqueue()
+ except bb.runqueue.TaskFailure:
+ raise
+ except SystemExit:
+ raise
+ except bb.BBHandledException:
+ try:
+ self.teardown_workers()
+ except:
+ pass
+ self.state = runQueueComplete
+ raise
+ except Exception as err:
+ logger.exception("An uncaught exception occurred in runqueue")
+ try:
+ self.teardown_workers()
+ except:
+ pass
+ self.state = runQueueComplete
+ raise
+
+ def finish_runqueue(self, now = False):
+ if not self.rqexe:
+ self.state = runQueueComplete
+ return
+
+ if now:
+ self.rqexe.finish_now()
+ else:
+ self.rqexe.finish()
+
+ def rq_dump_sigfn(self, fn, options):
+ bb_cache = bb.cache.NoCache(self.cooker.databuilder)
+ the_data = bb_cache.loadDataFull(fn, self.cooker.collection.get_file_appends(fn))
+ siggen = bb.parse.siggen
+ dataCaches = self.rqdata.dataCaches
+ siggen.dump_sigfn(fn, dataCaches, options)
+
+ def dump_signatures(self, options):
+ fns = set()
+ bb.note("Reparsing files to collect dependency data")
+
+ for tid in self.rqdata.runtaskentries:
+ fn = fn_from_tid(tid)
+ fns.add(fn)
+
+ max_process = int(self.cfgData.getVar("BB_NUMBER_PARSE_THREADS") or os.cpu_count() or 1)
+ # We cannot use the real multiprocessing.Pool easily due to some local data
+ # that can't be pickled. This is a cheap multi-process solution.
+ launched = []
+ while fns:
+ if len(launched) < max_process:
+ p = Process(target=self.rq_dump_sigfn, args=(fns.pop(), options))
+ p.start()
+ launched.append(p)
+ for q in launched:
+ # The finished processes are joined when calling is_alive()
+ if not q.is_alive():
+ launched.remove(q)
+ for p in launched:
+ p.join()
+
+ bb.parse.siggen.dump_sigs(self.rqdata.dataCaches, options)
+
+ return
+
+ def print_diffscenetasks(self):
+
+ valid = []
+ sq_hash = []
+ sq_hashfn = []
+ sq_fn = []
+ sq_taskname = []
+ sq_task = []
+ noexec = []
+ stamppresent = []
+ valid_new = set()
+
+ for tid in self.rqdata.runtaskentries:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ noexec.append(tid)
+ continue
+
+ sq_fn.append(fn)
+ sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn])
+ sq_hash.append(self.rqdata.runtaskentries[tid].hash)
+ sq_taskname.append(taskname)
+ sq_task.append(tid)
+ locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
+ try:
+ call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=True)"
+ valid = bb.utils.better_eval(call, locs)
+ # Handle version with no siginfo parameter
+ except TypeError:
+ call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)"
+ valid = bb.utils.better_eval(call, locs)
+ for v in valid:
+ valid_new.add(sq_task[v])
+
+ # Tasks which are both setscene and noexec never care about dependencies
+ # We therefore find tasks which are setscene and noexec and mark their
+ # unique dependencies as valid.
+ for tid in noexec:
+ if tid not in self.rqdata.runq_setscene_tids:
+ continue
+ for dep in self.rqdata.runtaskentries[tid].depends:
+ hasnoexecparents = True
+ for dep2 in self.rqdata.runtaskentries[dep].revdeps:
+ if dep2 in self.rqdata.runq_setscene_tids and dep2 in noexec:
+ continue
+ hasnoexecparents = False
+ break
+ if hasnoexecparents:
+ valid_new.add(dep)
+
+ invalidtasks = set()
+ for tid in self.rqdata.runtaskentries:
+ if tid not in valid_new and tid not in noexec:
+ invalidtasks.add(tid)
+
+ found = set()
+ processed = set()
+ for tid in invalidtasks:
+ toprocess = set([tid])
+ while toprocess:
+ next = set()
+ for t in toprocess:
+ for dep in self.rqdata.runtaskentries[t].depends:
+ if dep in invalidtasks:
+ found.add(tid)
+ if dep not in processed:
+ processed.add(dep)
+ next.add(dep)
+ toprocess = next
+ if tid in found:
+ toprocess = set()
+
+ tasklist = []
+ for tid in invalidtasks.difference(found):
+ tasklist.append(tid)
+
+ if tasklist:
+ bb.plain("The differences between the current build and any cached tasks start at the following tasks:\n" + "\n".join(tasklist))
+
+ return invalidtasks.difference(found)
+
+ def write_diffscenetasks(self, invalidtasks):
+
+ # Define recursion callback
+ def recursecb(key, hash1, hash2):
+ hashes = [hash1, hash2]
+ hashfiles = bb.siggen.find_siginfo(key, None, hashes, self.cfgData)
+
+ recout = []
+ if len(hashfiles) == 2:
+ out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb)
+ recout.extend(list(' ' + l for l in out2))
+ else:
+ recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
+
+ return recout
+
+
+ for tid in invalidtasks:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ h = self.rqdata.runtaskentries[tid].hash
+ matches = bb.siggen.find_siginfo(pn, taskname, [], self.cfgData)
+ match = None
+ for m in matches:
+ if h in m:
+ match = m
+ if match is None:
+ bb.fatal("Can't find a task we're supposed to have written out? (hash: %s)?" % h)
+ matches = {k : v for k, v in iter(matches.items()) if h not in k}
+ if matches:
+ latestmatch = sorted(matches.keys(), key=lambda f: matches[f])[-1]
+ prevh = __find_md5__.search(latestmatch).group(0)
+ output = bb.siggen.compare_sigfiles(latestmatch, match, recursecb)
+ bb.plain("\nTask %s:%s couldn't be used from the cache because:\n We need hash %s, closest matching task was %s\n " % (pn, taskname, h, prevh) + '\n '.join(output))
+
+class RunQueueExecute:
+
+ def __init__(self, rq):
+ self.rq = rq
+ self.cooker = rq.cooker
+ self.cfgData = rq.cfgData
+ self.rqdata = rq.rqdata
+
+ self.number_tasks = int(self.cfgData.getVar("BB_NUMBER_THREADS") or 1)
+ self.scheduler = self.cfgData.getVar("BB_SCHEDULER") or "speed"
+
+ self.runq_buildable = set()
+ self.runq_running = set()
+ self.runq_complete = set()
+
+ self.build_stamps = {}
+ self.build_stamps2 = []
+ self.failed_tids = []
+
+ self.stampcache = {}
+
+ for mc in rq.worker:
+ rq.worker[mc].pipe.setrunqueueexec(self)
+ for mc in rq.fakeworker:
+ rq.fakeworker[mc].pipe.setrunqueueexec(self)
+
+ if self.number_tasks <= 0:
+ bb.fatal("Invalid BB_NUMBER_THREADS %s" % self.number_tasks)
+
+ def runqueue_process_waitpid(self, task, status):
+
+ # self.build_stamps[pid] may not exist when use shared work directory.
+ if task in self.build_stamps:
+ self.build_stamps2.remove(self.build_stamps[task])
+ del self.build_stamps[task]
+
+ if status != 0:
+ self.task_fail(task, status)
+ else:
+ self.task_complete(task)
+ return True
+
+ def finish_now(self):
+ for mc in self.rq.worker:
+ try:
+ self.rq.worker[mc].process.stdin.write(b"<finishnow></finishnow>")
+ self.rq.worker[mc].process.stdin.flush()
+ except IOError:
+ # worker must have died?
+ pass
+ for mc in self.rq.fakeworker:
+ try:
+ self.rq.fakeworker[mc].process.stdin.write(b"<finishnow></finishnow>")
+ self.rq.fakeworker[mc].process.stdin.flush()
+ except IOError:
+ # worker must have died?
+ pass
+
+ if len(self.failed_tids) != 0:
+ self.rq.state = runQueueFailed
+ return
+
+ self.rq.state = runQueueComplete
+ return
+
+ def finish(self):
+ self.rq.state = runQueueCleanUp
+
+ if self.stats.active > 0:
+ bb.event.fire(runQueueExitWait(self.stats.active), self.cfgData)
+ self.rq.read_workers()
+ return self.rq.active_fds()
+
+ if len(self.failed_tids) != 0:
+ self.rq.state = runQueueFailed
+ return True
+
+ self.rq.state = runQueueComplete
+ return True
+
+ def check_dependencies(self, task, taskdeps, setscene = False):
+ if not self.rq.depvalidate:
+ return False
+
+ taskdata = {}
+ taskdeps.add(task)
+ for dep in taskdeps:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(dep)
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ taskdata[dep] = [pn, taskname, fn]
+ call = self.rq.depvalidate + "(task, taskdata, notneeded, d)"
+ locs = { "task" : task, "taskdata" : taskdata, "notneeded" : self.scenequeue_notneeded, "d" : self.cooker.data }
+ valid = bb.utils.better_eval(call, locs)
+ return valid
+
+class RunQueueExecuteDummy(RunQueueExecute):
+ def __init__(self, rq):
+ self.rq = rq
+ self.stats = RunQueueStats(0)
+
+ def finish(self):
+ self.rq.state = runQueueComplete
+ return
+
+class RunQueueExecuteTasks(RunQueueExecute):
+ def __init__(self, rq):
+ RunQueueExecute.__init__(self, rq)
+
+ self.stats = RunQueueStats(len(self.rqdata.runtaskentries))
+
+ self.stampcache = {}
+
+ initial_covered = self.rq.scenequeue_covered.copy()
+
+ # Mark initial buildable tasks
+ for tid in self.rqdata.runtaskentries:
+ if len(self.rqdata.runtaskentries[tid].depends) == 0:
+ self.runq_buildable.add(tid)
+ if len(self.rqdata.runtaskentries[tid].revdeps) > 0 and self.rqdata.runtaskentries[tid].revdeps.issubset(self.rq.scenequeue_covered):
+ self.rq.scenequeue_covered.add(tid)
+
+ found = True
+ while found:
+ found = False
+ for tid in self.rqdata.runtaskentries:
+ if tid in self.rq.scenequeue_covered:
+ continue
+ logger.debug(1, 'Considering %s: %s' % (tid, str(self.rqdata.runtaskentries[tid].revdeps)))
+
+ if len(self.rqdata.runtaskentries[tid].revdeps) > 0 and self.rqdata.runtaskentries[tid].revdeps.issubset(self.rq.scenequeue_covered):
+ if tid in self.rq.scenequeue_notcovered:
+ continue
+ found = True
+ self.rq.scenequeue_covered.add(tid)
+
+ logger.debug(1, 'Skip list (pre setsceneverify) %s', sorted(self.rq.scenequeue_covered))
+
+ # Allow the metadata to elect for setscene tasks to run anyway
+ covered_remove = set()
+ if self.rq.setsceneverify:
+ invalidtasks = []
+ tasknames = {}
+ fns = {}
+ for tid in self.rqdata.runtaskentries:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ fns[tid] = taskfn
+ tasknames[tid] = taskname
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ continue
+ if self.rq.check_stamp_task(tid, taskname + "_setscene", cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current for task %s', tid)
+ continue
+ if self.rq.check_stamp_task(tid, taskname, recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Normal stamp current for task %s', tid)
+ continue
+ invalidtasks.append(tid)
+
+ call = self.rq.setsceneverify + "(covered, tasknames, fns, d, invalidtasks=invalidtasks)"
+ locs = { "covered" : self.rq.scenequeue_covered, "tasknames" : tasknames, "fns" : fns, "d" : self.cooker.data, "invalidtasks" : invalidtasks }
+ covered_remove = bb.utils.better_eval(call, locs)
+
+ def removecoveredtask(tid):
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ taskname = taskname + '_setscene'
+ bb.build.del_stamp(taskname, self.rqdata.dataCaches[mc], taskfn)
+ self.rq.scenequeue_covered.remove(tid)
+
+ toremove = covered_remove
+ for task in toremove:
+ logger.debug(1, 'Not skipping task %s due to setsceneverify', task)
+ while toremove:
+ covered_remove = []
+ for task in toremove:
+ removecoveredtask(task)
+ for deptask in self.rqdata.runtaskentries[task].depends:
+ if deptask not in self.rq.scenequeue_covered:
+ continue
+ if deptask in toremove or deptask in covered_remove or deptask in initial_covered:
+ continue
+ logger.debug(1, 'Task %s depends on task %s so not skipping' % (task, deptask))
+ covered_remove.append(deptask)
+ toremove = covered_remove
+
+ logger.debug(1, 'Full skip list %s', self.rq.scenequeue_covered)
+
+
+ for mc in self.rqdata.dataCaches:
+ target_pairs = []
+ for tid in self.rqdata.target_tids:
+ (tidmc, fn, taskname, _) = split_tid_mcfn(tid)
+ if tidmc == mc:
+ target_pairs.append((fn, taskname))
+
+ event.fire(bb.event.StampUpdate(target_pairs, self.rqdata.dataCaches[mc].stamp), self.cfgData)
+
+ schedulers = self.get_schedulers()
+ for scheduler in schedulers:
+ if self.scheduler == scheduler.name:
+ self.sched = scheduler(self, self.rqdata)
+ logger.debug(1, "Using runqueue scheduler '%s'", scheduler.name)
+ break
+ else:
+ bb.fatal("Invalid scheduler '%s'. Available schedulers: %s" %
+ (self.scheduler, ", ".join(obj.name for obj in schedulers)))
+
+ def get_schedulers(self):
+ schedulers = set(obj for obj in globals().values()
+ if type(obj) is type and
+ issubclass(obj, RunQueueScheduler))
+
+ user_schedulers = self.cfgData.getVar("BB_SCHEDULERS")
+ if user_schedulers:
+ for sched in user_schedulers.split():
+ if not "." in sched:
+ bb.note("Ignoring scheduler '%s' from BB_SCHEDULERS: not an import" % sched)
+ continue
+
+ modname, name = sched.rsplit(".", 1)
+ try:
+ module = __import__(modname, fromlist=(name,))
+ except ImportError as exc:
+ logger.critical("Unable to import scheduler '%s' from '%s': %s" % (name, modname, exc))
+ raise SystemExit(1)
+ else:
+ schedulers.add(getattr(module, name))
+ return schedulers
+
+ def setbuildable(self, task):
+ self.runq_buildable.add(task)
+ self.sched.newbuildable(task)
+
+ def task_completeoutright(self, task):
+ """
+ Mark a task as completed
+ Look at the reverse dependencies and mark any task with
+ completed dependencies as buildable
+ """
+ self.runq_complete.add(task)
+ for revdep in self.rqdata.runtaskentries[task].revdeps:
+ if revdep in self.runq_running:
+ continue
+ if revdep in self.runq_buildable:
+ continue
+ alldeps = 1
+ for dep in self.rqdata.runtaskentries[revdep].depends:
+ if dep not in self.runq_complete:
+ alldeps = 0
+ if alldeps == 1:
+ self.setbuildable(revdep)
+ fn = fn_from_tid(revdep)
+ taskname = taskname_from_tid(revdep)
+ logger.debug(1, "Marking task %s as buildable", revdep)
+
+ def task_complete(self, task):
+ self.stats.taskCompleted()
+ bb.event.fire(runQueueTaskCompleted(task, self.stats, self.rq), self.cfgData)
+ self.task_completeoutright(task)
+
+ def task_fail(self, task, exitcode):
+ """
+ Called when a task has failed
+ Updates the state engine with the failure
+ """
+ self.stats.taskFailed()
+ self.failed_tids.append(task)
+ bb.event.fire(runQueueTaskFailed(task, self.stats, exitcode, self.rq), self.cfgData)
+ if self.rqdata.taskData[''].abort:
+ self.rq.state = runQueueCleanUp
+
+ def task_skip(self, task, reason):
+ self.runq_running.add(task)
+ self.setbuildable(task)
+ bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq, reason), self.cfgData)
+ self.task_completeoutright(task)
+ self.stats.taskCompleted()
+ self.stats.taskSkipped()
+
+ def execute(self):
+ """
+ Run the tasks in a queue prepared by rqdata.prepare()
+ """
+
+ if self.rqdata.setscenewhitelist is not None and not self.rqdata.setscenewhitelist_checked:
+ self.rqdata.setscenewhitelist_checked = True
+
+ # Check tasks that are going to run against the whitelist
+ def check_norun_task(tid, showerror=False):
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ # Ignore covered tasks
+ if tid in self.rq.scenequeue_covered:
+ return False
+ # Ignore stamped tasks
+ if self.rq.check_stamp_task(tid, taskname, cache=self.stampcache):
+ return False
+ # Ignore noexec tasks
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ return False
+
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ if not check_setscene_enforce_whitelist(pn, taskname, self.rqdata.setscenewhitelist):
+ if showerror:
+ if tid in self.rqdata.runq_setscene_tids:
+ logger.error('Task %s.%s attempted to execute unexpectedly and should have been setscened' % (pn, taskname))
+ else:
+ logger.error('Task %s.%s attempted to execute unexpectedly' % (pn, taskname))
+ return True
+ return False
+ # Look to see if any tasks that we think shouldn't run are going to
+ unexpected = False
+ for tid in self.rqdata.runtaskentries:
+ if check_norun_task(tid):
+ unexpected = True
+ break
+ if unexpected:
+ # Run through the tasks in the rough order they'd have executed and print errors
+ # (since the order can be useful - usually missing sstate for the last few tasks
+ # is the cause of the problem)
+ task = self.sched.next()
+ while task is not None:
+ check_norun_task(task, showerror=True)
+ self.task_skip(task, 'Setscene enforcement check')
+ task = self.sched.next()
+
+ self.rq.state = runQueueCleanUp
+ return True
+
+ self.rq.read_workers()
+
+ if self.stats.total == 0:
+ # nothing to do
+ self.rq.state = runQueueCleanUp
+
+ task = self.sched.next()
+ if task is not None:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(task)
+
+ if task in self.rq.scenequeue_covered:
+ logger.debug(2, "Setscene covered task %s", task)
+ self.task_skip(task, "covered")
+ return True
+
+ if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
+ logger.debug(2, "Stamp current task %s", task)
+
+ self.task_skip(task, "existing")
+ return True
+
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ startevent = runQueueTaskStarted(task, self.stats, self.rq,
+ noexec=True)
+ bb.event.fire(startevent, self.cfgData)
+ self.runq_running.add(task)
+ self.stats.taskActive()
+ if not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce):
+ bb.build.make_stamp(taskname, self.rqdata.dataCaches[mc], taskfn)
+ self.task_complete(task)
+ return True
+ else:
+ startevent = runQueueTaskStarted(task, self.stats, self.rq)
+ bb.event.fire(startevent, self.cfgData)
+
+ taskdepdata = self.build_taskdepdata(task)
+
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not (self.cooker.configuration.dry_run or self.rqdata.setscene_enforce):
+ if not mc in self.rq.fakeworker:
+ try:
+ self.rq.start_fakeworker(self, mc)
+ except OSError as exc:
+ logger.critical("Failed to spawn fakeroot worker to run %s: %s" % (task, str(exc)))
+ self.rq.state = runQueueFailed
+ self.stats.taskFailed()
+ return True
+ self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>")
+ self.rq.fakeworker[mc].process.stdin.flush()
+ else:
+ self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, False, self.cooker.collection.get_file_appends(taskfn), taskdepdata, self.rqdata.setscene_enforce)) + b"</runtask>")
+ self.rq.worker[mc].process.stdin.flush()
+
+ self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
+ self.build_stamps2.append(self.build_stamps[task])
+ self.runq_running.add(task)
+ self.stats.taskActive()
+ if self.stats.active < self.number_tasks:
+ return True
+
+ if self.stats.active > 0:
+ self.rq.read_workers()
+ return self.rq.active_fds()
+
+ if len(self.failed_tids) != 0:
+ self.rq.state = runQueueFailed
+ return True
+
+ # Sanity Checks
+ for task in self.rqdata.runtaskentries:
+ if task not in self.runq_buildable:
+ logger.error("Task %s never buildable!", task)
+ if task not in self.runq_running:
+ logger.error("Task %s never ran!", task)
+ if task not in self.runq_complete:
+ logger.error("Task %s never completed!", task)
+ self.rq.state = runQueueComplete
+
+ return True
+
+ def build_taskdepdata(self, task):
+ taskdepdata = {}
+ next = self.rqdata.runtaskentries[task].depends
+ next.add(task)
+ while next:
+ additional = []
+ for revdep in next:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(revdep)
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ deps = self.rqdata.runtaskentries[revdep].depends
+ provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
+ taskhash = self.rqdata.runtaskentries[revdep].hash
+ taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash]
+ for revdep2 in deps:
+ if revdep2 not in taskdepdata:
+ additional.append(revdep2)
+ next = additional
+
+ #bb.note("Task %s: " % task + str(taskdepdata).replace("], ", "],\n"))
+ return taskdepdata
+
+class RunQueueExecuteScenequeue(RunQueueExecute):
+ def __init__(self, rq):
+ RunQueueExecute.__init__(self, rq)
+
+ self.scenequeue_covered = set()
+ self.scenequeue_notcovered = set()
+ self.scenequeue_notneeded = set()
+
+ # If we don't have any setscene functions, skip this step
+ if len(self.rqdata.runq_setscene_tids) == 0:
+ rq.scenequeue_covered = set()
+ rq.state = runQueueRunInit
+ return
+
+ self.stats = RunQueueStats(len(self.rqdata.runq_setscene_tids))
+
+ sq_revdeps = {}
+ sq_revdeps_new = {}
+ sq_revdeps_squash = {}
+ self.sq_harddeps = {}
+ self.stamps = {}
+
+ # We need to construct a dependency graph for the setscene functions. Intermediate
+ # dependencies between the setscene tasks only complicate the code. This code
+ # therefore aims to collapse the huge runqueue dependency tree into a smaller one
+ # only containing the setscene functions.
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ # First process the chains up to the first setscene task.
+ endpoints = {}
+ for tid in self.rqdata.runtaskentries:
+ sq_revdeps[tid] = copy.copy(self.rqdata.runtaskentries[tid].revdeps)
+ sq_revdeps_new[tid] = set()
+ if (len(sq_revdeps[tid]) == 0) and tid not in self.rqdata.runq_setscene_tids:
+ #bb.warn("Added endpoint %s" % (tid))
+ endpoints[tid] = set()
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ # Secondly process the chains between setscene tasks.
+ for tid in self.rqdata.runq_setscene_tids:
+ #bb.warn("Added endpoint 2 %s" % (tid))
+ for dep in self.rqdata.runtaskentries[tid].depends:
+ if tid in sq_revdeps[dep]:
+ sq_revdeps[dep].remove(tid)
+ if dep not in endpoints:
+ endpoints[dep] = set()
+ #bb.warn(" Added endpoint 3 %s" % (dep))
+ endpoints[dep].add(tid)
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ def process_endpoints(endpoints):
+ newendpoints = {}
+ for point, task in endpoints.items():
+ tasks = set()
+ if task:
+ tasks |= task
+ if sq_revdeps_new[point]:
+ tasks |= sq_revdeps_new[point]
+ sq_revdeps_new[point] = set()
+ if point in self.rqdata.runq_setscene_tids:
+ sq_revdeps_new[point] = tasks
+ tasks = set()
+ continue
+ for dep in self.rqdata.runtaskentries[point].depends:
+ if point in sq_revdeps[dep]:
+ sq_revdeps[dep].remove(point)
+ if tasks:
+ sq_revdeps_new[dep] |= tasks
+ if len(sq_revdeps[dep]) == 0 and dep not in self.rqdata.runq_setscene_tids:
+ newendpoints[dep] = task
+ if len(newendpoints) != 0:
+ process_endpoints(newendpoints)
+
+ process_endpoints(endpoints)
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ # Build a list of setscene tasks which are "unskippable"
+ # These are direct endpoints referenced by the build
+ endpoints2 = {}
+ sq_revdeps2 = {}
+ sq_revdeps_new2 = {}
+ def process_endpoints2(endpoints):
+ newendpoints = {}
+ for point, task in endpoints.items():
+ tasks = set([point])
+ if task:
+ tasks |= task
+ if sq_revdeps_new2[point]:
+ tasks |= sq_revdeps_new2[point]
+ sq_revdeps_new2[point] = set()
+ if point in self.rqdata.runq_setscene_tids:
+ sq_revdeps_new2[point] = tasks
+ for dep in self.rqdata.runtaskentries[point].depends:
+ if point in sq_revdeps2[dep]:
+ sq_revdeps2[dep].remove(point)
+ if tasks:
+ sq_revdeps_new2[dep] |= tasks
+ if (len(sq_revdeps2[dep]) == 0 or len(sq_revdeps_new2[dep]) != 0) and dep not in self.rqdata.runq_setscene_tids:
+ newendpoints[dep] = tasks
+ if len(newendpoints) != 0:
+ process_endpoints2(newendpoints)
+ for tid in self.rqdata.runtaskentries:
+ sq_revdeps2[tid] = copy.copy(self.rqdata.runtaskentries[tid].revdeps)
+ sq_revdeps_new2[tid] = set()
+ if (len(sq_revdeps2[tid]) == 0) and tid not in self.rqdata.runq_setscene_tids:
+ endpoints2[tid] = set()
+ process_endpoints2(endpoints2)
+ self.unskippable = []
+ for tid in self.rqdata.runq_setscene_tids:
+ if sq_revdeps_new2[tid]:
+ self.unskippable.append(tid)
+
+ self.rqdata.init_progress_reporter.next_stage(len(self.rqdata.runtaskentries))
+
+ for taskcounter, tid in enumerate(self.rqdata.runtaskentries):
+ if tid in self.rqdata.runq_setscene_tids:
+ deps = set()
+ for dep in sq_revdeps_new[tid]:
+ deps.add(dep)
+ sq_revdeps_squash[tid] = deps
+ elif len(sq_revdeps_new[tid]) != 0:
+ bb.msg.fatal("RunQueue", "Something went badly wrong during scenequeue generation, aborting. Please report this problem.")
+ self.rqdata.init_progress_reporter.update(taskcounter)
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ # Resolve setscene inter-task dependencies
+ # e.g. do_sometask_setscene[depends] = "targetname:do_someothertask_setscene"
+ # Note that anything explicitly depended upon will have its reverse dependencies removed to avoid circular dependencies
+ for tid in self.rqdata.runq_setscene_tids:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+ realtid = tid + "_setscene"
+ idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends
+ self.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True)
+ for (depname, idependtask) in idepends:
+
+ if depname not in self.rqdata.taskData[mc].build_targets:
+ continue
+
+ depfn = self.rqdata.taskData[mc].build_targets[depname][0]
+ if depfn is None:
+ continue
+ deptid = depfn + ":" + idependtask.replace("_setscene", "")
+ if deptid not in self.rqdata.runtaskentries:
+ bb.msg.fatal("RunQueue", "Task %s depends upon non-existent task %s:%s" % (realtid, depfn, idependtask))
+
+ if not deptid in self.sq_harddeps:
+ self.sq_harddeps[deptid] = set()
+ self.sq_harddeps[deptid].add(tid)
+
+ sq_revdeps_squash[tid].add(deptid)
+ # Have to zero this to avoid circular dependencies
+ sq_revdeps_squash[deptid] = set()
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ for task in self.sq_harddeps:
+ for dep in self.sq_harddeps[task]:
+ sq_revdeps_squash[dep].add(task)
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ #for tid in sq_revdeps_squash:
+ # for dep in sq_revdeps_squash[tid]:
+ # data = data + "\n %s" % dep
+ # bb.warn("Task %s_setscene: is %s " % (tid, data
+
+ self.sq_deps = {}
+ self.sq_revdeps = sq_revdeps_squash
+ self.sq_revdeps2 = copy.deepcopy(self.sq_revdeps)
+
+ for tid in self.sq_revdeps:
+ self.sq_deps[tid] = set()
+ for tid in self.sq_revdeps:
+ for dep in self.sq_revdeps[tid]:
+ self.sq_deps[dep].add(tid)
+
+ self.rqdata.init_progress_reporter.next_stage()
+
+ for tid in self.sq_revdeps:
+ if len(self.sq_revdeps[tid]) == 0:
+ self.runq_buildable.add(tid)
+
+ self.rqdata.init_progress_reporter.finish()
+
+ self.outrightfail = []
+ if self.rq.hashvalidate:
+ sq_hash = []
+ sq_hashfn = []
+ sq_fn = []
+ sq_taskname = []
+ sq_task = []
+ noexec = []
+ stamppresent = []
+ for tid in self.sq_revdeps:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+
+ if 'noexec' in taskdep and taskname in taskdep['noexec']:
+ noexec.append(tid)
+ self.task_skip(tid)
+ bb.build.make_stamp(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn)
+ continue
+
+ if self.rq.check_stamp_task(tid, taskname + "_setscene", cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current for task %s', tid)
+ stamppresent.append(tid)
+ self.task_skip(tid)
+ continue
+
+ if self.rq.check_stamp_task(tid, taskname, recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Normal stamp current for task %s', tid)
+ stamppresent.append(tid)
+ self.task_skip(tid)
+ continue
+
+ sq_fn.append(fn)
+ sq_hashfn.append(self.rqdata.dataCaches[mc].hashfn[taskfn])
+ sq_hash.append(self.rqdata.runtaskentries[tid].hash)
+ sq_taskname.append(taskname)
+ sq_task.append(tid)
+ call = self.rq.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)"
+ locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data }
+ valid = bb.utils.better_eval(call, locs)
+
+ valid_new = stamppresent
+ for v in valid:
+ valid_new.append(sq_task[v])
+
+ for tid in self.sq_revdeps:
+ if tid not in valid_new and tid not in noexec:
+ logger.debug(2, 'No package found, so skipping setscene task %s', tid)
+ self.outrightfail.append(tid)
+
+ logger.info('Executing SetScene Tasks')
+
+ self.rq.state = runQueueSceneRun
+
+ def scenequeue_updatecounters(self, task, fail = False):
+ for dep in self.sq_deps[task]:
+ if fail and task in self.sq_harddeps and dep in self.sq_harddeps[task]:
+ logger.debug(2, "%s was unavailable and is a hard dependency of %s so skipping" % (task, dep))
+ self.scenequeue_updatecounters(dep, fail)
+ continue
+ if task not in self.sq_revdeps2[dep]:
+ # May already have been removed by the fail case above
+ continue
+ self.sq_revdeps2[dep].remove(task)
+ if len(self.sq_revdeps2[dep]) == 0:
+ self.runq_buildable.add(dep)
+
+ def task_completeoutright(self, task):
+ """
+ Mark a task as completed
+ Look at the reverse dependencies and mark any task with
+ completed dependencies as buildable
+ """
+
+ logger.debug(1, 'Found task %s which could be accelerated', task)
+ self.scenequeue_covered.add(task)
+ self.scenequeue_updatecounters(task)
+
+ def check_taskfail(self, task):
+ if self.rqdata.setscenewhitelist is not None:
+ realtask = task.split('_setscene')[0]
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(realtask)
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ if not check_setscene_enforce_whitelist(pn, taskname, self.rqdata.setscenewhitelist):
+ logger.error('Task %s.%s failed' % (pn, taskname + "_setscene"))
+ self.rq.state = runQueueCleanUp
+
+ def task_complete(self, task):
+ self.stats.taskCompleted()
+ bb.event.fire(sceneQueueTaskCompleted(task, self.stats, self.rq), self.cfgData)
+ self.task_completeoutright(task)
+
+ def task_fail(self, task, result):
+ self.stats.taskFailed()
+ bb.event.fire(sceneQueueTaskFailed(task, self.stats, result, self), self.cfgData)
+ self.scenequeue_notcovered.add(task)
+ self.scenequeue_updatecounters(task, True)
+ self.check_taskfail(task)
+
+ def task_failoutright(self, task):
+ self.runq_running.add(task)
+ self.runq_buildable.add(task)
+ self.stats.taskCompleted()
+ self.stats.taskSkipped()
+ self.scenequeue_notcovered.add(task)
+ self.scenequeue_updatecounters(task, True)
+
+ def task_skip(self, task):
+ self.runq_running.add(task)
+ self.runq_buildable.add(task)
+ self.task_completeoutright(task)
+ self.stats.taskCompleted()
+ self.stats.taskSkipped()
+
+ def execute(self):
+ """
+ Run the tasks in a queue prepared by prepare_runqueue
+ """
+
+ self.rq.read_workers()
+
+ task = None
+ if self.stats.active < self.number_tasks:
+ # Find the next setscene to run
+ for nexttask in self.rqdata.runq_setscene_tids:
+ if nexttask in self.runq_buildable and nexttask not in self.runq_running and self.stamps[nexttask] not in self.build_stamps.values():
+ if nexttask in self.unskippable:
+ logger.debug(2, "Setscene task %s is unskippable" % nexttask)
+ if nexttask not in self.unskippable and len(self.sq_revdeps[nexttask]) > 0 and self.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and self.check_dependencies(nexttask, self.sq_revdeps[nexttask], True):
+ fn = fn_from_tid(nexttask)
+ foundtarget = False
+
+ if nexttask in self.rqdata.target_tids:
+ foundtarget = True
+ if not foundtarget:
+ logger.debug(2, "Skipping setscene for task %s" % nexttask)
+ self.task_skip(nexttask)
+ self.scenequeue_notneeded.add(nexttask)
+ return True
+ if nexttask in self.outrightfail:
+ self.task_failoutright(nexttask)
+ return True
+ task = nexttask
+ break
+ if task is not None:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(task)
+ taskname = taskname + "_setscene"
+ if self.rq.check_stamp_task(task, taskname_from_tid(task), recurse = True, cache=self.stampcache):
+ logger.debug(2, 'Stamp for underlying task %s is current, so skipping setscene variant', task)
+ self.task_failoutright(task)
+ return True
+
+ if self.cooker.configuration.force:
+ if task in self.rqdata.target_tids:
+ self.task_failoutright(task)
+ return True
+
+ if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
+ logger.debug(2, 'Setscene stamp current task %s, so skip it and its dependencies', task)
+ self.task_skip(task)
+ return True
+
+ startevent = sceneQueueTaskStarted(task, self.stats, self.rq)
+ bb.event.fire(startevent, self.cfgData)
+
+ taskdepdata = self.build_taskdepdata(task)
+
+ taskdep = self.rqdata.dataCaches[mc].task_deps[taskfn]
+ if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not self.cooker.configuration.dry_run:
+ if not mc in self.rq.fakeworker:
+ self.rq.start_fakeworker(self, mc)
+ self.rq.fakeworker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>")
+ self.rq.fakeworker[mc].process.stdin.flush()
+ else:
+ self.rq.worker[mc].process.stdin.write(b"<runtask>" + pickle.dumps((taskfn, task, taskname, True, self.cooker.collection.get_file_appends(taskfn), taskdepdata, False)) + b"</runtask>")
+ self.rq.worker[mc].process.stdin.flush()
+
+ self.build_stamps[task] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
+ self.build_stamps2.append(self.build_stamps[task])
+ self.runq_running.add(task)
+ self.stats.taskActive()
+ if self.stats.active < self.number_tasks:
+ return True
+
+ if self.stats.active > 0:
+ self.rq.read_workers()
+ return self.rq.active_fds()
+
+ #for tid in self.sq_revdeps:
+ # if tid not in self.runq_running:
+ # buildable = tid in self.runq_buildable
+ # revdeps = self.sq_revdeps[tid]
+ # bb.warn("Found we didn't run %s %s %s" % (tid, buildable, str(revdeps)))
+
+ self.rq.scenequeue_covered = self.scenequeue_covered
+ self.rq.scenequeue_notcovered = self.scenequeue_notcovered
+
+ logger.debug(1, 'We can skip tasks %s', "\n".join(sorted(self.rq.scenequeue_covered)))
+
+ self.rq.state = runQueueRunInit
+
+ completeevent = sceneQueueComplete(self.stats, self.rq)
+ bb.event.fire(completeevent, self.cfgData)
+
+ return True
+
+ def runqueue_process_waitpid(self, task, status):
+ RunQueueExecute.runqueue_process_waitpid(self, task, status)
+
+
+ def build_taskdepdata(self, task):
+ def getsetscenedeps(tid):
+ deps = set()
+ (mc, fn, taskname, _) = split_tid_mcfn(tid)
+ realtid = tid + "_setscene"
+ idepends = self.rqdata.taskData[mc].taskentries[realtid].idepends
+ for (depname, idependtask) in idepends:
+ if depname not in self.rqdata.taskData[mc].build_targets:
+ continue
+
+ depfn = self.rqdata.taskData[mc].build_targets[depname][0]
+ if depfn is None:
+ continue
+ deptid = depfn + ":" + idependtask.replace("_setscene", "")
+ deps.add(deptid)
+ return deps
+
+ taskdepdata = {}
+ next = getsetscenedeps(task)
+ next.add(task)
+ while next:
+ additional = []
+ for revdep in next:
+ (mc, fn, taskname, taskfn) = split_tid_mcfn(revdep)
+ pn = self.rqdata.dataCaches[mc].pkg_fn[taskfn]
+ deps = getsetscenedeps(revdep)
+ provides = self.rqdata.dataCaches[mc].fn_provides[taskfn]
+ taskhash = self.rqdata.runtaskentries[revdep].hash
+ taskdepdata[revdep] = [pn, taskname, fn, deps, provides, taskhash]
+ for revdep2 in deps:
+ if revdep2 not in taskdepdata:
+ additional.append(revdep2)
+ next = additional
+
+ #bb.note("Task %s: " % task + str(taskdepdata).replace("], ", "],\n"))
+ return taskdepdata
+
+class TaskFailure(Exception):
+ """
+ Exception raised when a task in a runqueue fails
+ """
+ def __init__(self, x):
+ self.args = x
+
+
+class runQueueExitWait(bb.event.Event):
+ """
+ Event when waiting for task processes to exit
+ """
+
+ def __init__(self, remain):
+ self.remain = remain
+ self.message = "Waiting for %s active tasks to finish" % remain
+ bb.event.Event.__init__(self)
+
+class runQueueEvent(bb.event.Event):
+ """
+ Base runQueue event class
+ """
+ def __init__(self, task, stats, rq):
+ self.taskid = task
+ self.taskstring = task
+ self.taskname = taskname_from_tid(task)
+ self.taskfile = fn_from_tid(task)
+ self.taskhash = rq.rqdata.get_task_hash(task)
+ self.stats = stats.copy()
+ bb.event.Event.__init__(self)
+
+class sceneQueueEvent(runQueueEvent):
+ """
+ Base sceneQueue event class
+ """
+ def __init__(self, task, stats, rq, noexec=False):
+ runQueueEvent.__init__(self, task, stats, rq)
+ self.taskstring = task + "_setscene"
+ self.taskname = taskname_from_tid(task) + "_setscene"
+ self.taskfile = fn_from_tid(task)
+ self.taskhash = rq.rqdata.get_task_hash(task)
+
+class runQueueTaskStarted(runQueueEvent):
+ """
+ Event notifying a task was started
+ """
+ def __init__(self, task, stats, rq, noexec=False):
+ runQueueEvent.__init__(self, task, stats, rq)
+ self.noexec = noexec
+
+class sceneQueueTaskStarted(sceneQueueEvent):
+ """
+ Event notifying a setscene task was started
+ """
+ def __init__(self, task, stats, rq, noexec=False):
+ sceneQueueEvent.__init__(self, task, stats, rq)
+ self.noexec = noexec
+
+class runQueueTaskFailed(runQueueEvent):
+ """
+ Event notifying a task failed
+ """
+ def __init__(self, task, stats, exitcode, rq):
+ runQueueEvent.__init__(self, task, stats, rq)
+ self.exitcode = exitcode
+
+ def __str__(self):
+ return "Task (%s) failed with exit code '%s'" % (self.taskstring, self.exitcode)
+
+class sceneQueueTaskFailed(sceneQueueEvent):
+ """
+ Event notifying a setscene task failed
+ """
+ def __init__(self, task, stats, exitcode, rq):
+ sceneQueueEvent.__init__(self, task, stats, rq)
+ self.exitcode = exitcode
+
+ def __str__(self):
+ return "Setscene task (%s) failed with exit code '%s' - real task will be run instead" % (self.taskstring, self.exitcode)
+
+class sceneQueueComplete(sceneQueueEvent):
+ """
+ Event when all the sceneQueue tasks are complete
+ """
+ def __init__(self, stats, rq):
+ self.stats = stats.copy()
+ bb.event.Event.__init__(self)
+
+class runQueueTaskCompleted(runQueueEvent):
+ """
+ Event notifying a task completed
+ """
+
+class sceneQueueTaskCompleted(sceneQueueEvent):
+ """
+ Event notifying a setscene task completed
+ """
+
+class runQueueTaskSkipped(runQueueEvent):
+ """
+ Event notifying a task was skipped
+ """
+ def __init__(self, task, stats, rq, reason):
+ runQueueEvent.__init__(self, task, stats, rq)
+ self.reason = reason
+
+class runQueuePipe():
+ """
+ Abstraction for a pipe between a worker thread and the server
+ """
+ def __init__(self, pipein, pipeout, d, rq, rqexec):
+ self.input = pipein
+ if pipeout:
+ pipeout.close()
+ bb.utils.nonblockingfd(self.input)
+ self.queue = b""
+ self.d = d
+ self.rq = rq
+ self.rqexec = rqexec
+
+ def setrunqueueexec(self, rqexec):
+ self.rqexec = rqexec
+
+ def read(self):
+ for workers, name in [(self.rq.worker, "Worker"), (self.rq.fakeworker, "Fakeroot")]:
+ for worker in workers.values():
+ worker.process.poll()
+ if worker.process.returncode is not None and not self.rq.teardown:
+ bb.error("%s process (%s) exited unexpectedly (%s), shutting down..." % (name, worker.process.pid, str(worker.process.returncode)))
+ self.rq.finish_runqueue(True)
+
+ start = len(self.queue)
+ try:
+ self.queue = self.queue + (self.input.read(102400) or b"")
+ except (OSError, IOError) as e:
+ if e.errno != errno.EAGAIN:
+ raise
+ end = len(self.queue)
+ found = True
+ while found and len(self.queue):
+ found = False
+ index = self.queue.find(b"</event>")
+ while index != -1 and self.queue.startswith(b"<event>"):
+ try:
+ event = pickle.loads(self.queue[7:index])
+ except ValueError as e:
+ bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[7:index]))
+ bb.event.fire_from_worker(event, self.d)
+ found = True
+ self.queue = self.queue[index+8:]
+ index = self.queue.find(b"</event>")
+ index = self.queue.find(b"</exitcode>")
+ while index != -1 and self.queue.startswith(b"<exitcode>"):
+ try:
+ task, status = pickle.loads(self.queue[10:index])
+ except ValueError as e:
+ bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[10:index]))
+ self.rqexec.runqueue_process_waitpid(task, status)
+ found = True
+ self.queue = self.queue[index+11:]
+ index = self.queue.find(b"</exitcode>")
+ return (end > start)
+
+ def close(self):
+ while self.read():
+ continue
+ if len(self.queue) > 0:
+ print("Warning, worker left partial message: %s" % self.queue)
+ self.input.close()
+
+def get_setscene_enforce_whitelist(d):
+ if d.getVar('BB_SETSCENE_ENFORCE') != '1':
+ return None
+ whitelist = (d.getVar("BB_SETSCENE_ENFORCE_WHITELIST") or "").split()
+ outlist = []
+ for item in whitelist[:]:
+ if item.startswith('%:'):
+ for target in sys.argv[1:]:
+ if not target.startswith('-'):
+ outlist.append(target.split(':')[0] + ':' + item.split(':')[1])
+ else:
+ outlist.append(item)
+ return outlist
+
+def check_setscene_enforce_whitelist(pn, taskname, whitelist):
+ import fnmatch
+ if whitelist is not None:
+ item = '%s:%s' % (pn, taskname)
+ for whitelist_item in whitelist:
+ if fnmatch.fnmatch(item, whitelist_item):
+ return True
+ return False
+ return True
diff --git a/poky/bitbake/lib/bb/server/__init__.py b/poky/bitbake/lib/bb/server/__init__.py
new file mode 100644
index 000000000..5a3fba968
--- /dev/null
+++ b/poky/bitbake/lib/bb/server/__init__.py
@@ -0,0 +1,21 @@
+#
+# BitBake Base Server Code
+#
+# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008 Richard Purdie
+# Copyright (C) 2013 Alexandru Damian
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
diff --git a/poky/bitbake/lib/bb/server/process.py b/poky/bitbake/lib/bb/server/process.py
new file mode 100644
index 000000000..828159ed7
--- /dev/null
+++ b/poky/bitbake/lib/bb/server/process.py
@@ -0,0 +1,624 @@
+#
+# BitBake Process based server.
+#
+# Copyright (C) 2010 Bob Foerster <robert@erafx.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+ This module implements a multiprocessing.Process based server for bitbake.
+"""
+
+import bb
+import bb.event
+import logging
+import multiprocessing
+import threading
+import array
+import os
+import sys
+import time
+import select
+import socket
+import subprocess
+import errno
+import re
+import datetime
+import bb.server.xmlrpcserver
+from bb import daemonize
+from multiprocessing import queues
+
+logger = logging.getLogger('BitBake')
+
+class ProcessTimeout(SystemExit):
+ pass
+
+class ProcessServer(multiprocessing.Process):
+ profile_filename = "profile.log"
+ profile_processed_filename = "profile.log.processed"
+
+ def __init__(self, lock, sock, sockname):
+ multiprocessing.Process.__init__(self)
+ self.command_channel = False
+ self.command_channel_reply = False
+ self.quit = False
+ self.heartbeat_seconds = 1 # default, BB_HEARTBEAT_EVENT will be checked once we have a datastore.
+ self.next_heartbeat = time.time()
+
+ self.event_handle = None
+ self.haveui = False
+ self.lastui = False
+ self.xmlrpc = False
+
+ self._idlefuns = {}
+
+ self.bitbake_lock = lock
+ self.sock = sock
+ self.sockname = sockname
+
+ def register_idle_function(self, function, data):
+ """Register a function to be called while the server is idle"""
+ assert hasattr(function, '__call__')
+ self._idlefuns[function] = data
+
+ def run(self):
+
+ if self.xmlrpcinterface[0]:
+ self.xmlrpc = bb.server.xmlrpcserver.BitBakeXMLRPCServer(self.xmlrpcinterface, self.cooker, self)
+
+ print("Bitbake XMLRPC server address: %s, server port: %s" % (self.xmlrpc.host, self.xmlrpc.port))
+
+ heartbeat_event = self.cooker.data.getVar('BB_HEARTBEAT_EVENT')
+ if heartbeat_event:
+ try:
+ self.heartbeat_seconds = float(heartbeat_event)
+ except:
+ bb.warn('Ignoring invalid BB_HEARTBEAT_EVENT=%s, must be a float specifying seconds.' % heartbeat_event)
+
+ self.timeout = self.server_timeout or self.cooker.data.getVar('BB_SERVER_TIMEOUT')
+ try:
+ if self.timeout:
+ self.timeout = float(self.timeout)
+ except:
+ bb.warn('Ignoring invalid BB_SERVER_TIMEOUT=%s, must be a float specifying seconds.' % self.timeout)
+
+
+ try:
+ self.bitbake_lock.seek(0)
+ self.bitbake_lock.truncate()
+ if self.xmlrpc:
+ self.bitbake_lock.write("%s %s:%s\n" % (os.getpid(), self.xmlrpc.host, self.xmlrpc.port))
+ else:
+ self.bitbake_lock.write("%s\n" % (os.getpid()))
+ self.bitbake_lock.flush()
+ except Exception as e:
+ print("Error writing to lock file: %s" % str(e))
+ pass
+
+ if self.cooker.configuration.profile:
+ try:
+ import cProfile as profile
+ except:
+ import profile
+ prof = profile.Profile()
+
+ ret = profile.Profile.runcall(prof, self.main)
+
+ prof.dump_stats("profile.log")
+ bb.utils.process_profilelog("profile.log")
+ print("Raw profiling information saved to profile.log and processed statistics to profile.log.processed")
+
+ else:
+ ret = self.main()
+
+ return ret
+
+ def main(self):
+ self.cooker.pre_serve()
+
+ bb.utils.set_process_name("Cooker")
+
+ ready = []
+
+ self.controllersock = False
+ fds = [self.sock]
+ if self.xmlrpc:
+ fds.append(self.xmlrpc)
+ print("Entering server connection loop")
+
+ def disconnect_client(self, fds):
+ if not self.haveui:
+ return
+ print("Disconnecting Client")
+ fds.remove(self.controllersock)
+ fds.remove(self.command_channel)
+ bb.event.unregister_UIHhandler(self.event_handle, True)
+ self.command_channel_reply.writer.close()
+ self.event_writer.writer.close()
+ del self.event_writer
+ self.controllersock.close()
+ self.controllersock = False
+ self.haveui = False
+ self.lastui = time.time()
+ self.cooker.clientComplete()
+ if self.timeout is None:
+ print("No timeout, exiting.")
+ self.quit = True
+
+ while not self.quit:
+ if self.sock in ready:
+ self.controllersock, address = self.sock.accept()
+ if self.haveui:
+ print("Dropping connection attempt as we have a UI %s" % (str(ready)))
+ self.controllersock.close()
+ else:
+ print("Accepting %s" % (str(ready)))
+ fds.append(self.controllersock)
+ if self.controllersock in ready:
+ try:
+ print("Connecting Client")
+ ui_fds = recvfds(self.controllersock, 3)
+
+ # Where to write events to
+ writer = ConnectionWriter(ui_fds[0])
+ self.event_handle = bb.event.register_UIHhandler(writer, True)
+ self.event_writer = writer
+
+ # Where to read commands from
+ reader = ConnectionReader(ui_fds[1])
+ fds.append(reader)
+ self.command_channel = reader
+
+ # Where to send command return values to
+ writer = ConnectionWriter(ui_fds[2])
+ self.command_channel_reply = writer
+
+ self.haveui = True
+
+ except (EOFError, OSError):
+ disconnect_client(self, fds)
+
+ if not self.timeout == -1.0 and not self.haveui and self.lastui and self.timeout and \
+ (self.lastui + self.timeout) < time.time():
+ print("Server timeout, exiting.")
+ self.quit = True
+
+ if self.command_channel in ready:
+ try:
+ command = self.command_channel.get()
+ except EOFError:
+ # Client connection shutting down
+ ready = []
+ disconnect_client(self, fds)
+ continue
+ if command[0] == "terminateServer":
+ self.quit = True
+ continue
+ try:
+ print("Running command %s" % command)
+ self.command_channel_reply.send(self.cooker.command.runCommand(command))
+ except Exception as e:
+ logger.exception('Exception in server main event loop running command %s (%s)' % (command, str(e)))
+
+ if self.xmlrpc in ready:
+ self.xmlrpc.handle_requests()
+
+ ready = self.idle_commands(.1, fds)
+
+ print("Exiting")
+ # Remove the socket file so we don't get any more connections to avoid races
+ os.unlink(self.sockname)
+ self.sock.close()
+
+ try:
+ self.cooker.shutdown(True)
+ self.cooker.notifier.stop()
+ self.cooker.confignotifier.stop()
+ except:
+ pass
+
+ self.cooker.post_serve()
+
+ # Finally release the lockfile but warn about other processes holding it open
+ lock = self.bitbake_lock
+ lockfile = lock.name
+ lock.close()
+ lock = None
+
+ while not lock:
+ with bb.utils.timeout(3):
+ lock = bb.utils.lockfile(lockfile, shared=False, retry=False, block=True)
+ if not lock:
+ # Some systems may not have lsof available
+ procs = None
+ try:
+ procs = subprocess.check_output(["lsof", '-w', lockfile], stderr=subprocess.STDOUT)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ if procs is None:
+ # Fall back to fuser if lsof is unavailable
+ try:
+ procs = subprocess.check_output(["fuser", '-v', lockfile], stderr=subprocess.STDOUT)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+
+ msg = "Delaying shutdown due to active processes which appear to be holding bitbake.lock"
+ if procs:
+ msg += ":\n%s" % str(procs)
+ print(msg)
+ return
+ # We hold the lock so we can remove the file (hide stale pid data)
+ bb.utils.remove(lockfile)
+ bb.utils.unlockfile(lock)
+
+ def idle_commands(self, delay, fds=None):
+ nextsleep = delay
+ if not fds:
+ fds = []
+
+ for function, data in list(self._idlefuns.items()):
+ try:
+ retval = function(self, data, False)
+ if retval is False:
+ del self._idlefuns[function]
+ nextsleep = None
+ elif retval is True:
+ nextsleep = None
+ elif isinstance(retval, float) and nextsleep:
+ if (retval < nextsleep):
+ nextsleep = retval
+ elif nextsleep is None:
+ continue
+ else:
+ fds = fds + retval
+ except SystemExit:
+ raise
+ except Exception as exc:
+ if not isinstance(exc, bb.BBHandledException):
+ logger.exception('Running idle function')
+ del self._idlefuns[function]
+ self.quit = True
+
+ # Create new heartbeat event?
+ now = time.time()
+ if now >= self.next_heartbeat:
+ # We might have missed heartbeats. Just trigger once in
+ # that case and continue after the usual delay.
+ self.next_heartbeat += self.heartbeat_seconds
+ if self.next_heartbeat <= now:
+ self.next_heartbeat = now + self.heartbeat_seconds
+ heartbeat = bb.event.HeartbeatEvent(now)
+ bb.event.fire(heartbeat, self.cooker.data)
+ if nextsleep and now + nextsleep > self.next_heartbeat:
+ # Shorten timeout so that we we wake up in time for
+ # the heartbeat.
+ nextsleep = self.next_heartbeat - now
+
+ if nextsleep is not None:
+ if self.xmlrpc:
+ nextsleep = self.xmlrpc.get_timeout(nextsleep)
+ try:
+ return select.select(fds,[],[],nextsleep)[0]
+ except InterruptedError:
+ # Ignore EINTR
+ return []
+ else:
+ return select.select(fds,[],[],0)[0]
+
+
+class ServerCommunicator():
+ def __init__(self, connection, recv):
+ self.connection = connection
+ self.recv = recv
+
+ def runCommand(self, command):
+ self.connection.send(command)
+ if not self.recv.poll(30):
+ raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server")
+ return self.recv.get()
+
+ def updateFeatureSet(self, featureset):
+ _, error = self.runCommand(["setFeatures", featureset])
+ if error:
+ logger.error("Unable to set the cooker to the correct featureset: %s" % error)
+ raise BaseException(error)
+
+ def getEventHandle(self):
+ handle, error = self.runCommand(["getUIHandlerNum"])
+ if error:
+ logger.error("Unable to get UI Handler Number: %s" % error)
+ raise BaseException(error)
+
+ return handle
+
+ def terminateServer(self):
+ self.connection.send(['terminateServer'])
+ return
+
+class BitBakeProcessServerConnection(object):
+ def __init__(self, ui_channel, recv, eq, sock):
+ self.connection = ServerCommunicator(ui_channel, recv)
+ self.events = eq
+ # Save sock so it doesn't get gc'd for the life of our connection
+ self.socket_connection = sock
+
+ def terminate(self):
+ self.socket_connection.close()
+ self.connection.connection.close()
+ self.connection.recv.close()
+ return
+
+class BitBakeServer(object):
+ start_log_format = '--- Starting bitbake server pid %s at %s ---'
+ start_log_datetime_format = '%Y-%m-%d %H:%M:%S.%f'
+
+ def __init__(self, lock, sockname, configuration, featureset):
+
+ self.configuration = configuration
+ self.featureset = featureset
+ self.sockname = sockname
+ self.bitbake_lock = lock
+ self.readypipe, self.readypipein = os.pipe()
+
+ # Create server control socket
+ if os.path.exists(sockname):
+ os.unlink(sockname)
+
+ self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ # AF_UNIX has path length issues so chdir here to workaround
+ cwd = os.getcwd()
+ logfile = os.path.join(cwd, "bitbake-cookerdaemon.log")
+
+ try:
+ os.chdir(os.path.dirname(sockname))
+ self.sock.bind(os.path.basename(sockname))
+ finally:
+ os.chdir(cwd)
+ self.sock.listen(1)
+
+ os.set_inheritable(self.sock.fileno(), True)
+ startdatetime = datetime.datetime.now()
+ bb.daemonize.createDaemon(self._startServer, logfile)
+ self.sock.close()
+ self.bitbake_lock.close()
+
+ ready = ConnectionReader(self.readypipe)
+ r = ready.poll(30)
+ if r:
+ r = ready.get()
+ if not r or r != "ready":
+ ready.close()
+ bb.error("Unable to start bitbake server")
+ if os.path.exists(logfile):
+ logstart_re = re.compile(self.start_log_format % ('([0-9]+)', '([0-9-]+ [0-9:.]+)'))
+ started = False
+ lines = []
+ with open(logfile, "r") as f:
+ for line in f:
+ if started:
+ lines.append(line)
+ else:
+ res = logstart_re.match(line.rstrip())
+ if res:
+ ldatetime = datetime.datetime.strptime(res.group(2), self.start_log_datetime_format)
+ if ldatetime >= startdatetime:
+ started = True
+ lines.append(line)
+ if lines:
+ if len(lines) > 10:
+ bb.error("Last 10 lines of server log for this session (%s):\n%s" % (logfile, "".join(lines[-10:])))
+ else:
+ bb.error("Server log for this session (%s):\n%s" % (logfile, "".join(lines)))
+ raise SystemExit(1)
+ ready.close()
+ os.close(self.readypipein)
+
+ def _startServer(self):
+ print(self.start_log_format % (os.getpid(), datetime.datetime.now().strftime(self.start_log_datetime_format)))
+ server = ProcessServer(self.bitbake_lock, self.sock, self.sockname)
+ self.configuration.setServerRegIdleCallback(server.register_idle_function)
+ writer = ConnectionWriter(self.readypipein)
+ try:
+ self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
+ writer.send("ready")
+ except:
+ writer.send("fail")
+ raise
+ finally:
+ os.close(self.readypipein)
+ server.cooker = self.cooker
+ server.server_timeout = self.configuration.server_timeout
+ server.xmlrpcinterface = self.configuration.xmlrpcinterface
+ print("Started bitbake server pid %d" % os.getpid())
+ server.start()
+
+def connectProcessServer(sockname, featureset):
+ # Connect to socket
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ # AF_UNIX has path length issues so chdir here to workaround
+ cwd = os.getcwd()
+
+ try:
+ os.chdir(os.path.dirname(sockname))
+ sock.connect(os.path.basename(sockname))
+ finally:
+ os.chdir(cwd)
+
+ readfd = writefd = readfd1 = writefd1 = readfd2 = writefd2 = None
+ eq = command_chan_recv = command_chan = None
+
+ try:
+
+ # Send an fd for the remote to write events to
+ readfd, writefd = os.pipe()
+ eq = BBUIEventQueue(readfd)
+ # Send an fd for the remote to recieve commands from
+ readfd1, writefd1 = os.pipe()
+ command_chan = ConnectionWriter(writefd1)
+ # Send an fd for the remote to write commands results to
+ readfd2, writefd2 = os.pipe()
+ command_chan_recv = ConnectionReader(readfd2)
+
+ sendfds(sock, [writefd, readfd1, writefd2])
+
+ server_connection = BitBakeProcessServerConnection(command_chan, command_chan_recv, eq, sock)
+
+ # Close the ends of the pipes we won't use
+ for i in [writefd, readfd1, writefd2]:
+ os.close(i)
+
+ server_connection.connection.updateFeatureSet(featureset)
+
+ except (Exception, SystemExit) as e:
+ if command_chan_recv:
+ command_chan_recv.close()
+ if command_chan:
+ command_chan.close()
+ for i in [writefd, readfd1, writefd2]:
+ try:
+ os.close(i)
+ except OSError:
+ pass
+ sock.close()
+ raise
+
+ return server_connection
+
+def sendfds(sock, fds):
+ '''Send an array of fds over an AF_UNIX socket.'''
+ fds = array.array('i', fds)
+ msg = bytes([len(fds) % 256])
+ sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)])
+
+def recvfds(sock, size):
+ '''Receive an array of fds over an AF_UNIX socket.'''
+ a = array.array('i')
+ bytes_size = a.itemsize * size
+ msg, ancdata, flags, addr = sock.recvmsg(1, socket.CMSG_LEN(bytes_size))
+ if not msg and not ancdata:
+ raise EOFError
+ try:
+ if len(ancdata) != 1:
+ raise RuntimeError('received %d items of ancdata' %
+ len(ancdata))
+ cmsg_level, cmsg_type, cmsg_data = ancdata[0]
+ if (cmsg_level == socket.SOL_SOCKET and
+ cmsg_type == socket.SCM_RIGHTS):
+ if len(cmsg_data) % a.itemsize != 0:
+ raise ValueError
+ a.frombytes(cmsg_data)
+ assert len(a) % 256 == msg[0]
+ return list(a)
+ except (ValueError, IndexError):
+ pass
+ raise RuntimeError('Invalid data received')
+
+class BBUIEventQueue:
+ def __init__(self, readfd):
+
+ self.eventQueue = []
+ self.eventQueueLock = threading.Lock()
+ self.eventQueueNotify = threading.Event()
+
+ self.reader = ConnectionReader(readfd)
+
+ self.t = threading.Thread()
+ self.t.setDaemon(True)
+ self.t.run = self.startCallbackHandler
+ self.t.start()
+
+ def getEvent(self):
+ self.eventQueueLock.acquire()
+
+ if len(self.eventQueue) == 0:
+ self.eventQueueLock.release()
+ return None
+
+ item = self.eventQueue.pop(0)
+
+ if len(self.eventQueue) == 0:
+ self.eventQueueNotify.clear()
+
+ self.eventQueueLock.release()
+ return item
+
+ def waitEvent(self, delay):
+ self.eventQueueNotify.wait(delay)
+ return self.getEvent()
+
+ def queue_event(self, event):
+ self.eventQueueLock.acquire()
+ self.eventQueue.append(event)
+ self.eventQueueNotify.set()
+ self.eventQueueLock.release()
+
+ def send_event(self, event):
+ self.queue_event(pickle.loads(event))
+
+ def startCallbackHandler(self):
+ bb.utils.set_process_name("UIEventQueue")
+ while True:
+ try:
+ self.reader.wait()
+ event = self.reader.get()
+ self.queue_event(event)
+ except EOFError:
+ # Easiest way to exit is to close the file descriptor to cause an exit
+ break
+ self.reader.close()
+
+class ConnectionReader(object):
+
+ def __init__(self, fd):
+ self.reader = multiprocessing.connection.Connection(fd, writable=False)
+ self.rlock = multiprocessing.Lock()
+
+ def wait(self, timeout=None):
+ return multiprocessing.connection.wait([self.reader], timeout)
+
+ def poll(self, timeout=None):
+ return self.reader.poll(timeout)
+
+ def get(self):
+ with self.rlock:
+ res = self.reader.recv_bytes()
+ return multiprocessing.reduction.ForkingPickler.loads(res)
+
+ def fileno(self):
+ return self.reader.fileno()
+
+ def close(self):
+ return self.reader.close()
+
+
+class ConnectionWriter(object):
+
+ def __init__(self, fd):
+ self.writer = multiprocessing.connection.Connection(fd, readable=False)
+ self.wlock = multiprocessing.Lock()
+ # Why bb.event needs this I have no idea
+ self.event = self
+
+ def send(self, obj):
+ obj = multiprocessing.reduction.ForkingPickler.dumps(obj)
+ with self.wlock:
+ self.writer.send_bytes(obj)
+
+ def fileno(self):
+ return self.writer.fileno()
+
+ def close(self):
+ return self.writer.close()
diff --git a/poky/bitbake/lib/bb/server/xmlrpcclient.py b/poky/bitbake/lib/bb/server/xmlrpcclient.py
new file mode 100644
index 000000000..4661a9e5a
--- /dev/null
+++ b/poky/bitbake/lib/bb/server/xmlrpcclient.py
@@ -0,0 +1,154 @@
+#
+# BitBake XMLRPC Client Interface
+#
+# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+
+import socket
+import http.client
+import xmlrpc.client
+
+import bb
+from bb.ui import uievent
+
+class BBTransport(xmlrpc.client.Transport):
+ def __init__(self, timeout):
+ self.timeout = timeout
+ self.connection_token = None
+ xmlrpc.client.Transport.__init__(self)
+
+ # Modified from default to pass timeout to HTTPConnection
+ def make_connection(self, host):
+ #return an existing connection if possible. This allows
+ #HTTP/1.1 keep-alive.
+ if self._connection and host == self._connection[0]:
+ return self._connection[1]
+
+ # create a HTTP connection object from a host descriptor
+ chost, self._extra_headers, x509 = self.get_host_info(host)
+ #store the host argument along with the connection object
+ self._connection = host, http.client.HTTPConnection(chost, timeout=self.timeout)
+ return self._connection[1]
+
+ def set_connection_token(self, token):
+ self.connection_token = token
+
+ def send_content(self, h, body):
+ if self.connection_token:
+ h.putheader("Bitbake-token", self.connection_token)
+ xmlrpc.client.Transport.send_content(self, h, body)
+
+def _create_server(host, port, timeout = 60):
+ t = BBTransport(timeout)
+ s = xmlrpc.client.ServerProxy("http://%s:%d/" % (host, port), transport=t, allow_none=True, use_builtin_types=True)
+ return s, t
+
+def check_connection(remote, timeout):
+ try:
+ host, port = remote.split(":")
+ port = int(port)
+ except Exception as e:
+ bb.warn("Failed to read remote definition (%s)" % str(e))
+ raise e
+
+ server, _transport = _create_server(host, port, timeout)
+ try:
+ ret, err = server.runCommand(['getVariable', 'TOPDIR'])
+ if err or not ret:
+ return False
+ except ConnectionError:
+ return False
+ return True
+
+class BitBakeXMLRPCServerConnection(object):
+ def __init__(self, host, port, clientinfo=("localhost", 0), observer_only = False, featureset = None):
+ self.connection, self.transport = _create_server(host, port)
+ self.clientinfo = clientinfo
+ self.observer_only = observer_only
+ if featureset:
+ self.featureset = featureset
+ else:
+ self.featureset = []
+
+ self.events = uievent.BBUIEventQueue(self.connection, self.clientinfo)
+
+ _, error = self.connection.runCommand(["setFeatures", self.featureset])
+ if error:
+ # disconnect the client, we can't make the setFeature work
+ self.connection.removeClient()
+ # no need to log it here, the error shall be sent to the client
+ raise BaseException(error)
+
+ def connect(self, token = None):
+ if token is None:
+ if self.observer_only:
+ token = "observer"
+ else:
+ token = self.connection.addClient()
+
+ if token is None:
+ return None
+
+ self.transport.set_connection_token(token)
+ return self
+
+ def removeClient(self):
+ if not self.observer_only:
+ self.connection.removeClient()
+
+ def terminate(self):
+ # Don't wait for server indefinitely
+ socket.setdefaulttimeout(2)
+ try:
+ self.events.system_quit()
+ except:
+ pass
+ try:
+ self.connection.removeClient()
+ except:
+ pass
+
+def connectXMLRPC(remote, featureset, observer_only = False, token = None):
+ # The format of "remote" must be "server:port"
+ try:
+ [host, port] = remote.split(":")
+ port = int(port)
+ except Exception as e:
+ bb.warn("Failed to parse remote definition %s (%s)" % (remote, str(e)))
+ raise e
+
+ # We need our IP for the server connection. We get the IP
+ # by trying to connect with the server
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ s.connect((host, port))
+ ip = s.getsockname()[0]
+ s.close()
+ except Exception as e:
+ bb.warn("Could not create socket for %s:%s (%s)" % (host, port, str(e)))
+ raise e
+ try:
+ connection = BitBakeXMLRPCServerConnection(host, port, (ip, 0), observer_only, featureset)
+ return connection.connect(token)
+ except Exception as e:
+ bb.warn("Could not connect to server at %s:%s (%s)" % (host, port, str(e)))
+ raise e
+
+
+
diff --git a/poky/bitbake/lib/bb/server/xmlrpcserver.py b/poky/bitbake/lib/bb/server/xmlrpcserver.py
new file mode 100644
index 000000000..875b1282e
--- /dev/null
+++ b/poky/bitbake/lib/bb/server/xmlrpcserver.py
@@ -0,0 +1,158 @@
+#
+# BitBake XMLRPC Server Interface
+#
+# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+
+import hashlib
+import time
+import inspect
+from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+
+import bb
+
+# This request handler checks if the request has a "Bitbake-token" header
+# field (this comes from the client side) and compares it with its internal
+# "Bitbake-token" field (this comes from the server). If the two are not
+# equal, it is assumed that a client is trying to connect to the server
+# while another client is connected to the server. In this case, a 503 error
+# ("service unavailable") is returned to the client.
+class BitBakeXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
+ def __init__(self, request, client_address, server):
+ self.server = server
+ SimpleXMLRPCRequestHandler.__init__(self, request, client_address, server)
+
+ def do_POST(self):
+ try:
+ remote_token = self.headers["Bitbake-token"]
+ except:
+ remote_token = None
+ if 0 and remote_token != self.server.connection_token and remote_token != "observer":
+ self.report_503()
+ else:
+ if remote_token == "observer":
+ self.server.readonly = True
+ else:
+ self.server.readonly = False
+ SimpleXMLRPCRequestHandler.do_POST(self)
+
+ def report_503(self):
+ self.send_response(503)
+ response = 'No more client allowed'
+ self.send_header("Content-type", "text/plain")
+ self.send_header("Content-length", str(len(response)))
+ self.end_headers()
+ self.wfile.write(bytes(response, 'utf-8'))
+
+class BitBakeXMLRPCServer(SimpleXMLRPCServer):
+ # remove this when you're done with debugging
+ # allow_reuse_address = True
+
+ def __init__(self, interface, cooker, parent):
+ # Use auto port configuration
+ if (interface[1] == -1):
+ interface = (interface[0], 0)
+ SimpleXMLRPCServer.__init__(self, interface,
+ requestHandler=BitBakeXMLRPCRequestHandler,
+ logRequests=False, allow_none=True)
+ self.host, self.port = self.socket.getsockname()
+ self.interface = interface
+
+ self.connection_token = None
+ self.commands = BitBakeXMLRPCServerCommands(self)
+ self.register_functions(self.commands, "")
+
+ self.cooker = cooker
+ self.parent = parent
+
+
+ def register_functions(self, context, prefix):
+ """
+ Convenience method for registering all functions in the scope
+ of this class that start with a common prefix
+ """
+ methodlist = inspect.getmembers(context, inspect.ismethod)
+ for name, method in methodlist:
+ if name.startswith(prefix):
+ self.register_function(method, name[len(prefix):])
+
+ def get_timeout(self, delay):
+ socktimeout = self.socket.gettimeout() or delay
+ return min(socktimeout, delay)
+
+ def handle_requests(self):
+ self._handle_request_noblock()
+
+class BitBakeXMLRPCServerCommands():
+
+ def __init__(self, server):
+ self.server = server
+ self.has_client = False
+
+ def registerEventHandler(self, host, port):
+ """
+ Register a remote UI Event Handler
+ """
+ s, t = bb.server.xmlrpcclient._create_server(host, port)
+
+ # we don't allow connections if the cooker is running
+ if (self.server.cooker.state in [bb.cooker.state.parsing, bb.cooker.state.running]):
+ return None, "Cooker is busy: %s" % bb.cooker.state.get_name(self.server.cooker.state)
+
+ self.event_handle = bb.event.register_UIHhandler(s, True)
+ return self.event_handle, 'OK'
+
+ def unregisterEventHandler(self, handlerNum):
+ """
+ Unregister a remote UI Event Handler
+ """
+ ret = bb.event.unregister_UIHhandler(handlerNum, True)
+ self.event_handle = None
+ return ret
+
+ def runCommand(self, command):
+ """
+ Run a cooker command on the server
+ """
+ return self.server.cooker.command.runCommand(command, self.server.readonly)
+
+ def getEventHandle(self):
+ return self.event_handle
+
+ def terminateServer(self):
+ """
+ Trigger the server to quit
+ """
+ self.server.parent.quit = True
+ print("XMLRPC Server triggering exit")
+ return
+
+ def addClient(self):
+ if self.server.parent.haveui:
+ return None
+ token = hashlib.md5(str(time.time()).encode("utf-8")).hexdigest()
+ self.server.connection_token = token
+ self.server.parent.haveui = True
+ return token
+
+ def removeClient(self):
+ if self.server.parent.haveui:
+ self.server.connection_token = None
+ self.server.parent.haveui = False
+
diff --git a/poky/bitbake/lib/bb/siggen.py b/poky/bitbake/lib/bb/siggen.py
new file mode 100644
index 000000000..5ef82d7be
--- /dev/null
+++ b/poky/bitbake/lib/bb/siggen.py
@@ -0,0 +1,729 @@
+import hashlib
+import logging
+import os
+import re
+import tempfile
+import pickle
+import bb.data
+import difflib
+import simplediff
+from bb.checksum import FileChecksumCache
+
+logger = logging.getLogger('BitBake.SigGen')
+
+def init(d):
+ siggens = [obj for obj in globals().values()
+ if type(obj) is type and issubclass(obj, SignatureGenerator)]
+
+ desired = d.getVar("BB_SIGNATURE_HANDLER") or "noop"
+ for sg in siggens:
+ if desired == sg.name:
+ return sg(d)
+ break
+ else:
+ logger.error("Invalid signature generator '%s', using default 'noop'\n"
+ "Available generators: %s", desired,
+ ', '.join(obj.name for obj in siggens))
+ return SignatureGenerator(d)
+
+class SignatureGenerator(object):
+ """
+ """
+ name = "noop"
+
+ def __init__(self, data):
+ self.basehash = {}
+ self.taskhash = {}
+ self.runtaskdeps = {}
+ self.file_checksum_values = {}
+ self.taints = {}
+
+ def finalise(self, fn, d, varient):
+ return
+
+ def get_taskhash(self, fn, task, deps, dataCache):
+ return "0"
+
+ def writeout_file_checksum_cache(self):
+ """Write/update the file checksum cache onto disk"""
+ return
+
+ def stampfile(self, stampbase, file_name, taskname, extrainfo):
+ return ("%s.%s.%s" % (stampbase, taskname, extrainfo)).rstrip('.')
+
+ def stampcleanmask(self, stampbase, file_name, taskname, extrainfo):
+ return ("%s.%s.%s" % (stampbase, taskname, extrainfo)).rstrip('.')
+
+ def dump_sigtask(self, fn, task, stampbase, runtime):
+ return
+
+ def invalidate_task(self, task, d, fn):
+ bb.build.del_stamp(task, d, fn)
+
+ def dump_sigs(self, dataCache, options):
+ return
+
+ def get_taskdata(self):
+ return (self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash)
+
+ def set_taskdata(self, data):
+ self.runtaskdeps, self.taskhash, self.file_checksum_values, self.taints, self.basehash = data
+
+ def reset(self, data):
+ self.__init__(data)
+
+
+class SignatureGeneratorBasic(SignatureGenerator):
+ """
+ """
+ name = "basic"
+
+ def __init__(self, data):
+ self.basehash = {}
+ self.taskhash = {}
+ self.taskdeps = {}
+ self.runtaskdeps = {}
+ self.file_checksum_values = {}
+ self.taints = {}
+ self.gendeps = {}
+ self.lookupcache = {}
+ self.pkgnameextract = re.compile("(?P<fn>.*)\..*")
+ self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST") or "").split())
+ self.taskwhitelist = None
+ self.init_rundepcheck(data)
+ checksum_cache_file = data.getVar("BB_HASH_CHECKSUM_CACHE_FILE")
+ if checksum_cache_file:
+ self.checksum_cache = FileChecksumCache()
+ self.checksum_cache.init_cache(data, checksum_cache_file)
+ else:
+ self.checksum_cache = None
+
+ def init_rundepcheck(self, data):
+ self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST") or None
+ if self.taskwhitelist:
+ self.twl = re.compile(self.taskwhitelist)
+ else:
+ self.twl = None
+
+ def _build_data(self, fn, d):
+
+ ignore_mismatch = ((d.getVar("BB_HASH_IGNORE_MISMATCH") or '') == '1')
+ tasklist, gendeps, lookupcache = bb.data.generate_dependencies(d)
+
+ taskdeps = {}
+ basehash = {}
+
+ for task in tasklist:
+ data = lookupcache[task]
+
+ if data is None:
+ bb.error("Task %s from %s seems to be empty?!" % (task, fn))
+ data = ''
+
+ gendeps[task] -= self.basewhitelist
+ newdeps = gendeps[task]
+ seen = set()
+ while newdeps:
+ nextdeps = newdeps
+ seen |= nextdeps
+ newdeps = set()
+ for dep in nextdeps:
+ if dep in self.basewhitelist:
+ continue
+ gendeps[dep] -= self.basewhitelist
+ newdeps |= gendeps[dep]
+ newdeps -= seen
+
+ alldeps = sorted(seen)
+ for dep in alldeps:
+ data = data + dep
+ var = lookupcache[dep]
+ if var is not None:
+ data = data + str(var)
+ datahash = hashlib.md5(data.encode("utf-8")).hexdigest()
+ k = fn + "." + task
+ if not ignore_mismatch and k in self.basehash and self.basehash[k] != datahash:
+ bb.error("When reparsing %s, the basehash value changed from %s to %s. The metadata is not deterministic and this needs to be fixed." % (k, self.basehash[k], datahash))
+ self.basehash[k] = datahash
+ taskdeps[task] = alldeps
+
+ self.taskdeps[fn] = taskdeps
+ self.gendeps[fn] = gendeps
+ self.lookupcache[fn] = lookupcache
+
+ return taskdeps
+
+ def finalise(self, fn, d, variant):
+
+ mc = d.getVar("__BBMULTICONFIG", False) or ""
+ if variant or mc:
+ fn = bb.cache.realfn2virtual(fn, variant, mc)
+
+ try:
+ taskdeps = self._build_data(fn, d)
+ except bb.parse.SkipRecipe:
+ raise
+ except:
+ bb.warn("Error during finalise of %s" % fn)
+ raise
+
+ #Slow but can be useful for debugging mismatched basehashes
+ #for task in self.taskdeps[fn]:
+ # self.dump_sigtask(fn, task, d.getVar("STAMP"), False)
+
+ for task in taskdeps:
+ d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task])
+
+ def rundep_check(self, fn, recipename, task, dep, depname, dataCache):
+ # Return True if we should keep the dependency, False to drop it
+ # We only manipulate the dependencies for packages not in the whitelist
+ if self.twl and not self.twl.search(recipename):
+ # then process the actual dependencies
+ if self.twl.search(depname):
+ return False
+ return True
+
+ def read_taint(self, fn, task, stampbase):
+ taint = None
+ try:
+ with open(stampbase + '.' + task + '.taint', 'r') as taintf:
+ taint = taintf.read()
+ except IOError:
+ pass
+ return taint
+
+ def get_taskhash(self, fn, task, deps, dataCache):
+ k = fn + "." + task
+ data = dataCache.basetaskhash[k]
+ self.basehash[k] = data
+ self.runtaskdeps[k] = []
+ self.file_checksum_values[k] = []
+ recipename = dataCache.pkg_fn[fn]
+
+ for dep in sorted(deps, key=clean_basepath):
+ depname = dataCache.pkg_fn[self.pkgnameextract.search(dep).group('fn')]
+ if not self.rundep_check(fn, recipename, task, dep, depname, dataCache):
+ continue
+ if dep not in self.taskhash:
+ bb.fatal("%s is not in taskhash, caller isn't calling in dependency order?", dep)
+ data = data + self.taskhash[dep]
+ self.runtaskdeps[k].append(dep)
+
+ if task in dataCache.file_checksums[fn]:
+ if self.checksum_cache:
+ checksums = self.checksum_cache.get_checksums(dataCache.file_checksums[fn][task], recipename)
+ else:
+ checksums = bb.fetch2.get_file_checksums(dataCache.file_checksums[fn][task], recipename)
+ for (f,cs) in checksums:
+ self.file_checksum_values[k].append((f,cs))
+ if cs:
+ data = data + cs
+
+ taskdep = dataCache.task_deps[fn]
+ if 'nostamp' in taskdep and task in taskdep['nostamp']:
+ # Nostamp tasks need an implicit taint so that they force any dependent tasks to run
+ import uuid
+ taint = str(uuid.uuid4())
+ data = data + taint
+ self.taints[k] = "nostamp:" + taint
+
+ taint = self.read_taint(fn, task, dataCache.stamp[fn])
+ if taint:
+ data = data + taint
+ self.taints[k] = taint
+ logger.warning("%s is tainted from a forced run" % k)
+
+ h = hashlib.md5(data.encode("utf-8")).hexdigest()
+ self.taskhash[k] = h
+ #d.setVar("BB_TASKHASH_task-%s" % task, taskhash[task])
+ return h
+
+ def writeout_file_checksum_cache(self):
+ """Write/update the file checksum cache onto disk"""
+ if self.checksum_cache:
+ self.checksum_cache.save_extras()
+ self.checksum_cache.save_merge()
+ else:
+ bb.fetch2.fetcher_parse_save()
+ bb.fetch2.fetcher_parse_done()
+
+ def dump_sigtask(self, fn, task, stampbase, runtime):
+
+ k = fn + "." + task
+ referencestamp = stampbase
+ if isinstance(runtime, str) and runtime.startswith("customfile"):
+ sigfile = stampbase
+ referencestamp = runtime[11:]
+ elif runtime and k in self.taskhash:
+ sigfile = stampbase + "." + task + ".sigdata" + "." + self.taskhash[k]
+ else:
+ sigfile = stampbase + "." + task + ".sigbasedata" + "." + self.basehash[k]
+
+ bb.utils.mkdirhier(os.path.dirname(sigfile))
+
+ data = {}
+ data['task'] = task
+ data['basewhitelist'] = self.basewhitelist
+ data['taskwhitelist'] = self.taskwhitelist
+ data['taskdeps'] = self.taskdeps[fn][task]
+ data['basehash'] = self.basehash[k]
+ data['gendeps'] = {}
+ data['varvals'] = {}
+ data['varvals'][task] = self.lookupcache[fn][task]
+ for dep in self.taskdeps[fn][task]:
+ if dep in self.basewhitelist:
+ continue
+ data['gendeps'][dep] = self.gendeps[fn][dep]
+ data['varvals'][dep] = self.lookupcache[fn][dep]
+
+ if runtime and k in self.taskhash:
+ data['runtaskdeps'] = self.runtaskdeps[k]
+ data['file_checksum_values'] = [(os.path.basename(f), cs) for f,cs in self.file_checksum_values[k]]
+ data['runtaskhashes'] = {}
+ for dep in data['runtaskdeps']:
+ data['runtaskhashes'][dep] = self.taskhash[dep]
+ data['taskhash'] = self.taskhash[k]
+
+ taint = self.read_taint(fn, task, referencestamp)
+ if taint:
+ data['taint'] = taint
+
+ if runtime and k in self.taints:
+ if 'nostamp:' in self.taints[k]:
+ data['taint'] = self.taints[k]
+
+ computed_basehash = calc_basehash(data)
+ if computed_basehash != self.basehash[k]:
+ bb.error("Basehash mismatch %s versus %s for %s" % (computed_basehash, self.basehash[k], k))
+ if runtime and k in self.taskhash:
+ computed_taskhash = calc_taskhash(data)
+ if computed_taskhash != self.taskhash[k]:
+ bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k))
+ sigfile = sigfile.replace(self.taskhash[k], computed_taskhash)
+
+ fd, tmpfile = tempfile.mkstemp(dir=os.path.dirname(sigfile), prefix="sigtask.")
+ try:
+ with os.fdopen(fd, "wb") as stream:
+ p = pickle.dump(data, stream, -1)
+ stream.flush()
+ os.chmod(tmpfile, 0o664)
+ os.rename(tmpfile, sigfile)
+ except (OSError, IOError) as err:
+ try:
+ os.unlink(tmpfile)
+ except OSError:
+ pass
+ raise err
+
+ def dump_sigfn(self, fn, dataCaches, options):
+ if fn in self.taskdeps:
+ for task in self.taskdeps[fn]:
+ tid = fn + ":" + task
+ (mc, _, _) = bb.runqueue.split_tid(tid)
+ k = fn + "." + task
+ if k not in self.taskhash:
+ continue
+ if dataCaches[mc].basetaskhash[k] != self.basehash[k]:
+ bb.error("Bitbake's cached basehash does not match the one we just generated (%s)!" % k)
+ bb.error("The mismatched hashes were %s and %s" % (dataCaches[mc].basetaskhash[k], self.basehash[k]))
+ self.dump_sigtask(fn, task, dataCaches[mc].stamp[fn], True)
+
+class SignatureGeneratorBasicHash(SignatureGeneratorBasic):
+ name = "basichash"
+
+ def stampfile(self, stampbase, fn, taskname, extrainfo, clean=False):
+ if taskname != "do_setscene" and taskname.endswith("_setscene"):
+ k = fn + "." + taskname[:-9]
+ else:
+ k = fn + "." + taskname
+ if clean:
+ h = "*"
+ elif k in self.taskhash:
+ h = self.taskhash[k]
+ else:
+ # If k is not in basehash, then error
+ h = self.basehash[k]
+ return ("%s.%s.%s.%s" % (stampbase, taskname, h, extrainfo)).rstrip('.')
+
+ def stampcleanmask(self, stampbase, fn, taskname, extrainfo):
+ return self.stampfile(stampbase, fn, taskname, extrainfo, clean=True)
+
+ def invalidate_task(self, task, d, fn):
+ bb.note("Tainting hash to force rebuild of task %s, %s" % (fn, task))
+ bb.build.write_taint(task, d, fn)
+
+def dump_this_task(outfile, d):
+ import bb.parse
+ fn = d.getVar("BB_FILENAME")
+ task = "do_" + d.getVar("BB_CURRENTTASK")
+ referencestamp = bb.build.stamp_internal(task, d, None, True)
+ bb.parse.siggen.dump_sigtask(fn, task, outfile, "customfile:" + referencestamp)
+
+def init_colors(enable_color):
+ """Initialise colour dict for passing to compare_sigfiles()"""
+ # First set up the colours
+ colors = {'color_title': '\033[1;37;40m',
+ 'color_default': '\033[0;37;40m',
+ 'color_add': '\033[1;32;40m',
+ 'color_remove': '\033[1;31;40m',
+ }
+ # Leave all keys present but clear the values
+ if not enable_color:
+ for k in colors.keys():
+ colors[k] = ''
+ return colors
+
+def worddiff_str(oldstr, newstr, colors=None):
+ if not colors:
+ colors = init_colors(False)
+ diff = simplediff.diff(oldstr.split(' '), newstr.split(' '))
+ ret = []
+ for change, value in diff:
+ value = ' '.join(value)
+ if change == '=':
+ ret.append(value)
+ elif change == '+':
+ item = '{color_add}{{+{value}+}}{color_default}'.format(value=value, **colors)
+ ret.append(item)
+ elif change == '-':
+ item = '{color_remove}[-{value}-]{color_default}'.format(value=value, **colors)
+ ret.append(item)
+ whitespace_note = ''
+ if oldstr != newstr and ' '.join(oldstr.split()) == ' '.join(newstr.split()):
+ whitespace_note = ' (whitespace changed)'
+ return '"%s"%s' % (' '.join(ret), whitespace_note)
+
+def list_inline_diff(oldlist, newlist, colors=None):
+ if not colors:
+ colors = init_colors(False)
+ diff = simplediff.diff(oldlist, newlist)
+ ret = []
+ for change, value in diff:
+ value = ' '.join(value)
+ if change == '=':
+ ret.append("'%s'" % value)
+ elif change == '+':
+ item = '{color_add}+{value}{color_default}'.format(value=value, **colors)
+ ret.append(item)
+ elif change == '-':
+ item = '{color_remove}-{value}{color_default}'.format(value=value, **colors)
+ ret.append(item)
+ return '[%s]' % (', '.join(ret))
+
+def clean_basepath(a):
+ mc = None
+ if a.startswith("multiconfig:"):
+ _, mc, a = a.split(":", 2)
+ b = a.rsplit("/", 2)[1] + '/' + a.rsplit("/", 2)[2]
+ if a.startswith("virtual:"):
+ b = b + ":" + a.rsplit(":", 1)[0]
+ if mc:
+ b = b + ":multiconfig:" + mc
+ return b
+
+def clean_basepaths(a):
+ b = {}
+ for x in a:
+ b[clean_basepath(x)] = a[x]
+ return b
+
+def clean_basepaths_list(a):
+ b = []
+ for x in a:
+ b.append(clean_basepath(x))
+ return b
+
+def compare_sigfiles(a, b, recursecb=None, color=False, collapsed=False):
+ output = []
+
+ colors = init_colors(color)
+ def color_format(formatstr, **values):
+ """
+ Return colour formatted string.
+ NOTE: call with the format string, not an already formatted string
+ containing values (otherwise you could have trouble with { and }
+ characters)
+ """
+ if not formatstr.endswith('{color_default}'):
+ formatstr += '{color_default}'
+ # In newer python 3 versions you can pass both of these directly,
+ # but we only require 3.4 at the moment
+ formatparams = {}
+ formatparams.update(colors)
+ formatparams.update(values)
+ return formatstr.format(**formatparams)
+
+ with open(a, 'rb') as f:
+ p1 = pickle.Unpickler(f)
+ a_data = p1.load()
+ with open(b, 'rb') as f:
+ p2 = pickle.Unpickler(f)
+ b_data = p2.load()
+
+ def dict_diff(a, b, whitelist=set()):
+ sa = set(a.keys())
+ sb = set(b.keys())
+ common = sa & sb
+ changed = set()
+ for i in common:
+ if a[i] != b[i] and i not in whitelist:
+ changed.add(i)
+ added = sb - sa
+ removed = sa - sb
+ return changed, added, removed
+
+ def file_checksums_diff(a, b):
+ from collections import Counter
+ # Handle old siginfo format
+ if isinstance(a, dict):
+ a = [(os.path.basename(f), cs) for f, cs in a.items()]
+ if isinstance(b, dict):
+ b = [(os.path.basename(f), cs) for f, cs in b.items()]
+ # Compare lists, ensuring we can handle duplicate filenames if they exist
+ removedcount = Counter(a)
+ removedcount.subtract(b)
+ addedcount = Counter(b)
+ addedcount.subtract(a)
+ added = []
+ for x in b:
+ if addedcount[x] > 0:
+ addedcount[x] -= 1
+ added.append(x)
+ removed = []
+ changed = []
+ for x in a:
+ if removedcount[x] > 0:
+ removedcount[x] -= 1
+ for y in added:
+ if y[0] == x[0]:
+ changed.append((x[0], x[1], y[1]))
+ added.remove(y)
+ break
+ else:
+ removed.append(x)
+ added = [x[0] for x in added]
+ removed = [x[0] for x in removed]
+ return changed, added, removed
+
+ if 'basewhitelist' in a_data and a_data['basewhitelist'] != b_data['basewhitelist']:
+ output.append(color_format("{color_title}basewhitelist changed{color_default} from '%s' to '%s'") % (a_data['basewhitelist'], b_data['basewhitelist']))
+ if a_data['basewhitelist'] and b_data['basewhitelist']:
+ output.append("changed items: %s" % a_data['basewhitelist'].symmetric_difference(b_data['basewhitelist']))
+
+ if 'taskwhitelist' in a_data and a_data['taskwhitelist'] != b_data['taskwhitelist']:
+ output.append(color_format("{color_title}taskwhitelist changed{color_default} from '%s' to '%s'") % (a_data['taskwhitelist'], b_data['taskwhitelist']))
+ if a_data['taskwhitelist'] and b_data['taskwhitelist']:
+ output.append("changed items: %s" % a_data['taskwhitelist'].symmetric_difference(b_data['taskwhitelist']))
+
+ if a_data['taskdeps'] != b_data['taskdeps']:
+ output.append(color_format("{color_title}Task dependencies changed{color_default} from:\n%s\nto:\n%s") % (sorted(a_data['taskdeps']), sorted(b_data['taskdeps'])))
+
+ if a_data['basehash'] != b_data['basehash'] and not collapsed:
+ output.append(color_format("{color_title}basehash changed{color_default} from %s to %s") % (a_data['basehash'], b_data['basehash']))
+
+ changed, added, removed = dict_diff(a_data['gendeps'], b_data['gendeps'], a_data['basewhitelist'] & b_data['basewhitelist'])
+ if changed:
+ for dep in changed:
+ output.append(color_format("{color_title}List of dependencies for variable %s changed from '{color_default}%s{color_title}' to '{color_default}%s{color_title}'") % (dep, a_data['gendeps'][dep], b_data['gendeps'][dep]))
+ if a_data['gendeps'][dep] and b_data['gendeps'][dep]:
+ output.append("changed items: %s" % a_data['gendeps'][dep].symmetric_difference(b_data['gendeps'][dep]))
+ if added:
+ for dep in added:
+ output.append(color_format("{color_title}Dependency on variable %s was added") % (dep))
+ if removed:
+ for dep in removed:
+ output.append(color_format("{color_title}Dependency on Variable %s was removed") % (dep))
+
+
+ changed, added, removed = dict_diff(a_data['varvals'], b_data['varvals'])
+ if changed:
+ for dep in changed:
+ oldval = a_data['varvals'][dep]
+ newval = b_data['varvals'][dep]
+ if newval and oldval and ('\n' in oldval or '\n' in newval):
+ diff = difflib.unified_diff(oldval.splitlines(), newval.splitlines(), lineterm='')
+ # Cut off the first two lines, since we aren't interested in
+ # the old/new filename (they are blank anyway in this case)
+ difflines = list(diff)[2:]
+ if color:
+ # Add colour to diff output
+ for i, line in enumerate(difflines):
+ if line.startswith('+'):
+ line = color_format('{color_add}{line}', line=line)
+ difflines[i] = line
+ elif line.startswith('-'):
+ line = color_format('{color_remove}{line}', line=line)
+ difflines[i] = line
+ output.append(color_format("{color_title}Variable {var} value changed:{color_default}\n{diff}", var=dep, diff='\n'.join(difflines)))
+ elif newval and oldval and (' ' in oldval or ' ' in newval):
+ output.append(color_format("{color_title}Variable {var} value changed:{color_default}\n{diff}", var=dep, diff=worddiff_str(oldval, newval, colors)))
+ else:
+ output.append(color_format("{color_title}Variable {var} value changed from '{color_default}{oldval}{color_title}' to '{color_default}{newval}{color_title}'{color_default}", var=dep, oldval=oldval, newval=newval))
+
+ if not 'file_checksum_values' in a_data:
+ a_data['file_checksum_values'] = {}
+ if not 'file_checksum_values' in b_data:
+ b_data['file_checksum_values'] = {}
+
+ changed, added, removed = file_checksums_diff(a_data['file_checksum_values'], b_data['file_checksum_values'])
+ if changed:
+ for f, old, new in changed:
+ output.append(color_format("{color_title}Checksum for file %s changed{color_default} from %s to %s") % (f, old, new))
+ if added:
+ for f in added:
+ output.append(color_format("{color_title}Dependency on checksum of file %s was added") % (f))
+ if removed:
+ for f in removed:
+ output.append(color_format("{color_title}Dependency on checksum of file %s was removed") % (f))
+
+ if not 'runtaskdeps' in a_data:
+ a_data['runtaskdeps'] = {}
+ if not 'runtaskdeps' in b_data:
+ b_data['runtaskdeps'] = {}
+
+ if not collapsed:
+ if len(a_data['runtaskdeps']) != len(b_data['runtaskdeps']):
+ changed = ["Number of task dependencies changed"]
+ else:
+ changed = []
+ for idx, task in enumerate(a_data['runtaskdeps']):
+ a = a_data['runtaskdeps'][idx]
+ b = b_data['runtaskdeps'][idx]
+ if a_data['runtaskhashes'][a] != b_data['runtaskhashes'][b] and not collapsed:
+ changed.append("%s with hash %s\n changed to\n%s with hash %s" % (clean_basepath(a), a_data['runtaskhashes'][a], clean_basepath(b), b_data['runtaskhashes'][b]))
+
+ if changed:
+ clean_a = clean_basepaths_list(a_data['runtaskdeps'])
+ clean_b = clean_basepaths_list(b_data['runtaskdeps'])
+ if clean_a != clean_b:
+ output.append(color_format("{color_title}runtaskdeps changed:{color_default}\n%s") % list_inline_diff(clean_a, clean_b, colors))
+ else:
+ output.append(color_format("{color_title}runtaskdeps changed:"))
+ output.append("\n".join(changed))
+
+
+ if 'runtaskhashes' in a_data and 'runtaskhashes' in b_data:
+ a = a_data['runtaskhashes']
+ b = b_data['runtaskhashes']
+ changed, added, removed = dict_diff(a, b)
+ if added:
+ for dep in added:
+ bdep_found = False
+ if removed:
+ for bdep in removed:
+ if b[dep] == a[bdep]:
+ #output.append("Dependency on task %s was replaced by %s with same hash" % (dep, bdep))
+ bdep_found = True
+ if not bdep_found:
+ output.append(color_format("{color_title}Dependency on task %s was added{color_default} with hash %s") % (clean_basepath(dep), b[dep]))
+ if removed:
+ for dep in removed:
+ adep_found = False
+ if added:
+ for adep in added:
+ if b[adep] == a[dep]:
+ #output.append("Dependency on task %s was replaced by %s with same hash" % (adep, dep))
+ adep_found = True
+ if not adep_found:
+ output.append(color_format("{color_title}Dependency on task %s was removed{color_default} with hash %s") % (clean_basepath(dep), a[dep]))
+ if changed:
+ for dep in changed:
+ if not collapsed:
+ output.append(color_format("{color_title}Hash for dependent task %s changed{color_default} from %s to %s") % (clean_basepath(dep), a[dep], b[dep]))
+ if callable(recursecb):
+ recout = recursecb(dep, a[dep], b[dep])
+ if recout:
+ if collapsed:
+ output.extend(recout)
+ else:
+ # If a dependent hash changed, might as well print the line above and then defer to the changes in
+ # that hash since in all likelyhood, they're the same changes this task also saw.
+ output = [output[-1]] + recout
+
+ a_taint = a_data.get('taint', None)
+ b_taint = b_data.get('taint', None)
+ if a_taint != b_taint:
+ output.append(color_format("{color_title}Taint (by forced/invalidated task) changed{color_default} from %s to %s") % (a_taint, b_taint))
+
+ return output
+
+
+def calc_basehash(sigdata):
+ task = sigdata['task']
+ basedata = sigdata['varvals'][task]
+
+ if basedata is None:
+ basedata = ''
+
+ alldeps = sigdata['taskdeps']
+ for dep in alldeps:
+ basedata = basedata + dep
+ val = sigdata['varvals'][dep]
+ if val is not None:
+ basedata = basedata + str(val)
+
+ return hashlib.md5(basedata.encode("utf-8")).hexdigest()
+
+def calc_taskhash(sigdata):
+ data = sigdata['basehash']
+
+ for dep in sigdata['runtaskdeps']:
+ data = data + sigdata['runtaskhashes'][dep]
+
+ for c in sigdata['file_checksum_values']:
+ if c[1]:
+ data = data + c[1]
+
+ if 'taint' in sigdata:
+ if 'nostamp:' in sigdata['taint']:
+ data = data + sigdata['taint'][8:]
+ else:
+ data = data + sigdata['taint']
+
+ return hashlib.md5(data.encode("utf-8")).hexdigest()
+
+
+def dump_sigfile(a):
+ output = []
+
+ with open(a, 'rb') as f:
+ p1 = pickle.Unpickler(f)
+ a_data = p1.load()
+
+ output.append("basewhitelist: %s" % (a_data['basewhitelist']))
+
+ output.append("taskwhitelist: %s" % (a_data['taskwhitelist']))
+
+ output.append("Task dependencies: %s" % (sorted(a_data['taskdeps'])))
+
+ output.append("basehash: %s" % (a_data['basehash']))
+
+ for dep in a_data['gendeps']:
+ output.append("List of dependencies for variable %s is %s" % (dep, a_data['gendeps'][dep]))
+
+ for dep in a_data['varvals']:
+ output.append("Variable %s value is %s" % (dep, a_data['varvals'][dep]))
+
+ if 'runtaskdeps' in a_data:
+ output.append("Tasks this task depends on: %s" % (a_data['runtaskdeps']))
+
+ if 'file_checksum_values' in a_data:
+ output.append("This task depends on the checksums of files: %s" % (a_data['file_checksum_values']))
+
+ if 'runtaskhashes' in a_data:
+ for dep in a_data['runtaskhashes']:
+ output.append("Hash for dependent task %s is %s" % (dep, a_data['runtaskhashes'][dep]))
+
+ if 'taint' in a_data:
+ output.append("Tainted (by forced/invalidated task): %s" % a_data['taint'])
+
+ if 'task' in a_data:
+ computed_basehash = calc_basehash(a_data)
+ output.append("Computed base hash is %s and from file %s" % (computed_basehash, a_data['basehash']))
+ else:
+ output.append("Unable to compute base hash")
+
+ computed_taskhash = calc_taskhash(a_data)
+ output.append("Computed task hash is %s" % computed_taskhash)
+
+ return output
diff --git a/poky/bitbake/lib/bb/taskdata.py b/poky/bitbake/lib/bb/taskdata.py
new file mode 100644
index 000000000..0ea6c0bfd
--- /dev/null
+++ b/poky/bitbake/lib/bb/taskdata.py
@@ -0,0 +1,578 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake 'TaskData' implementation
+
+Task data collection and handling
+
+"""
+
+# Copyright (C) 2006 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import logging
+import re
+import bb
+
+logger = logging.getLogger("BitBake.TaskData")
+
+def re_match_strings(target, strings):
+ """
+ Whether or not the string 'target' matches
+ any one string of the strings which can be regular expression string
+ """
+ return any(name == target or re.match(name, target)
+ for name in strings)
+
+class TaskEntry:
+ def __init__(self):
+ self.tdepends = []
+ self.idepends = []
+ self.irdepends = []
+
+class TaskData:
+ """
+ BitBake Task Data implementation
+ """
+ def __init__(self, abort = True, skiplist = None, allowincomplete = False):
+ self.build_targets = {}
+ self.run_targets = {}
+
+ self.external_targets = []
+
+ self.seenfns = []
+ self.taskentries = {}
+
+ self.depids = {}
+ self.rdepids = {}
+
+ self.consider_msgs_cache = []
+
+ self.failed_deps = []
+ self.failed_rdeps = []
+ self.failed_fns = []
+
+ self.abort = abort
+ self.allowincomplete = allowincomplete
+
+ self.skiplist = skiplist
+
+ def add_tasks(self, fn, dataCache):
+ """
+ Add tasks for a given fn to the database
+ """
+
+ task_deps = dataCache.task_deps[fn]
+
+ if fn in self.failed_fns:
+ bb.msg.fatal("TaskData", "Trying to re-add a failed file? Something is broken...")
+
+ # Check if we've already seen this fn
+ if fn in self.seenfns:
+ return
+
+ self.seenfns.append(fn)
+
+ self.add_extra_deps(fn, dataCache)
+
+ # Common code for dep_name/depends = 'depends'/idepends and 'rdepends'/irdepends
+ def handle_deps(task, dep_name, depends, seen):
+ if dep_name in task_deps and task in task_deps[dep_name]:
+ ids = []
+ for dep in task_deps[dep_name][task].split():
+ if dep:
+ parts = dep.split(":")
+ if len(parts) != 2:
+ bb.msg.fatal("TaskData", "Error for %s:%s[%s], dependency %s in '%s' does not contain exactly one ':' character.\n Task '%s' should be specified in the form 'packagename:task'" % (fn, task, dep_name, dep, task_deps[dep_name][task], dep_name))
+ ids.append((parts[0], parts[1]))
+ seen(parts[0])
+ depends.extend(ids)
+
+ for task in task_deps['tasks']:
+
+ tid = "%s:%s" % (fn, task)
+ self.taskentries[tid] = TaskEntry()
+
+ # Work out task dependencies
+ parentids = []
+ for dep in task_deps['parents'][task]:
+ if dep not in task_deps['tasks']:
+ bb.debug(2, "Not adding dependeny of %s on %s since %s does not exist" % (task, dep, dep))
+ continue
+ parentid = "%s:%s" % (fn, dep)
+ parentids.append(parentid)
+ self.taskentries[tid].tdepends.extend(parentids)
+
+ # Touch all intertask dependencies
+ handle_deps(task, 'depends', self.taskentries[tid].idepends, self.seen_build_target)
+ handle_deps(task, 'rdepends', self.taskentries[tid].irdepends, self.seen_run_target)
+
+ # Work out build dependencies
+ if not fn in self.depids:
+ dependids = set()
+ for depend in dataCache.deps[fn]:
+ dependids.add(depend)
+ self.depids[fn] = list(dependids)
+ logger.debug(2, "Added dependencies %s for %s", str(dataCache.deps[fn]), fn)
+
+ # Work out runtime dependencies
+ if not fn in self.rdepids:
+ rdependids = set()
+ rdepends = dataCache.rundeps[fn]
+ rrecs = dataCache.runrecs[fn]
+ rdependlist = []
+ rreclist = []
+ for package in rdepends:
+ for rdepend in rdepends[package]:
+ rdependlist.append(rdepend)
+ rdependids.add(rdepend)
+ for package in rrecs:
+ for rdepend in rrecs[package]:
+ rreclist.append(rdepend)
+ rdependids.add(rdepend)
+ if rdependlist:
+ logger.debug(2, "Added runtime dependencies %s for %s", str(rdependlist), fn)
+ if rreclist:
+ logger.debug(2, "Added runtime recommendations %s for %s", str(rreclist), fn)
+ self.rdepids[fn] = list(rdependids)
+
+ for dep in self.depids[fn]:
+ self.seen_build_target(dep)
+ if dep in self.failed_deps:
+ self.fail_fn(fn)
+ return
+ for dep in self.rdepids[fn]:
+ self.seen_run_target(dep)
+ if dep in self.failed_rdeps:
+ self.fail_fn(fn)
+ return
+
+ def add_extra_deps(self, fn, dataCache):
+ func = dataCache.extradepsfunc.get(fn, None)
+ if func:
+ bb.providers.buildWorldTargetList(dataCache)
+ pn = dataCache.pkg_fn[fn]
+ params = {'deps': dataCache.deps[fn],
+ 'world_target': dataCache.world_target,
+ 'pkg_pn': dataCache.pkg_pn,
+ 'self_pn': pn}
+ funcname = '_%s_calculate_extra_depends' % pn.replace('-', '_')
+ paramlist = ','.join(params.keys())
+ func = 'def %s(%s):\n%s\n\n%s(%s)' % (funcname, paramlist, func, funcname, paramlist)
+ bb.utils.better_exec(func, params)
+
+
+ def have_build_target(self, target):
+ """
+ Have we a build target matching this name?
+ """
+ if target in self.build_targets and self.build_targets[target]:
+ return True
+ return False
+
+ def have_runtime_target(self, target):
+ """
+ Have we a runtime target matching this name?
+ """
+ if target in self.run_targets and self.run_targets[target]:
+ return True
+ return False
+
+ def seen_build_target(self, name):
+ """
+ Maintain a list of build targets
+ """
+ if name not in self.build_targets:
+ self.build_targets[name] = []
+
+ def add_build_target(self, fn, item):
+ """
+ Add a build target.
+ If already present, append the provider fn to the list
+ """
+ if item in self.build_targets:
+ if fn in self.build_targets[item]:
+ return
+ self.build_targets[item].append(fn)
+ return
+ self.build_targets[item] = [fn]
+
+ def seen_run_target(self, name):
+ """
+ Maintain a list of runtime build targets
+ """
+ if name not in self.run_targets:
+ self.run_targets[name] = []
+
+ def add_runtime_target(self, fn, item):
+ """
+ Add a runtime target.
+ If already present, append the provider fn to the list
+ """
+ if item in self.run_targets:
+ if fn in self.run_targets[item]:
+ return
+ self.run_targets[item].append(fn)
+ return
+ self.run_targets[item] = [fn]
+
+ def mark_external_target(self, target):
+ """
+ Mark a build target as being externally requested
+ """
+ if target not in self.external_targets:
+ self.external_targets.append(target)
+
+ def get_unresolved_build_targets(self, dataCache):
+ """
+ Return a list of build targets who's providers
+ are unknown.
+ """
+ unresolved = []
+ for target in self.build_targets:
+ if re_match_strings(target, dataCache.ignored_dependencies):
+ continue
+ if target in self.failed_deps:
+ continue
+ if not self.build_targets[target]:
+ unresolved.append(target)
+ return unresolved
+
+ def get_unresolved_run_targets(self, dataCache):
+ """
+ Return a list of runtime targets who's providers
+ are unknown.
+ """
+ unresolved = []
+ for target in self.run_targets:
+ if re_match_strings(target, dataCache.ignored_dependencies):
+ continue
+ if target in self.failed_rdeps:
+ continue
+ if not self.run_targets[target]:
+ unresolved.append(target)
+ return unresolved
+
+ def get_provider(self, item):
+ """
+ Return a list of providers of item
+ """
+ return self.build_targets[item]
+
+ def get_dependees(self, item):
+ """
+ Return a list of targets which depend on item
+ """
+ dependees = []
+ for fn in self.depids:
+ if item in self.depids[fn]:
+ dependees.append(fn)
+ return dependees
+
+ def get_rdependees(self, item):
+ """
+ Return a list of targets which depend on runtime item
+ """
+ dependees = []
+ for fn in self.rdepids:
+ if item in self.rdepids[fn]:
+ dependees.append(fn)
+ return dependees
+
+ def get_reasons(self, item, runtime=False):
+ """
+ Get the reason(s) for an item not being provided, if any
+ """
+ reasons = []
+ if self.skiplist:
+ for fn in self.skiplist:
+ skipitem = self.skiplist[fn]
+ if skipitem.pn == item:
+ reasons.append("%s was skipped: %s" % (skipitem.pn, skipitem.skipreason))
+ elif runtime and item in skipitem.rprovides:
+ reasons.append("%s RPROVIDES %s but was skipped: %s" % (skipitem.pn, item, skipitem.skipreason))
+ elif not runtime and item in skipitem.provides:
+ reasons.append("%s PROVIDES %s but was skipped: %s" % (skipitem.pn, item, skipitem.skipreason))
+ return reasons
+
+ def get_close_matches(self, item, provider_list):
+ import difflib
+ if self.skiplist:
+ skipped = []
+ for fn in self.skiplist:
+ skipped.append(self.skiplist[fn].pn)
+ full_list = provider_list + skipped
+ else:
+ full_list = provider_list
+ return difflib.get_close_matches(item, full_list, cutoff=0.7)
+
+ def add_provider(self, cfgData, dataCache, item):
+ try:
+ self.add_provider_internal(cfgData, dataCache, item)
+ except bb.providers.NoProvider:
+ if self.abort:
+ raise
+ self.remove_buildtarget(item)
+
+ self.mark_external_target(item)
+
+ def add_provider_internal(self, cfgData, dataCache, item):
+ """
+ Add the providers of item to the task data
+ Mark entries were specifically added externally as against dependencies
+ added internally during dependency resolution
+ """
+
+ if re_match_strings(item, dataCache.ignored_dependencies):
+ return
+
+ if not item in dataCache.providers:
+ close_matches = self.get_close_matches(item, list(dataCache.providers.keys()))
+ # Is it in RuntimeProviders ?
+ all_p = bb.providers.getRuntimeProviders(dataCache, item)
+ for fn in all_p:
+ new = dataCache.pkg_fn[fn] + " RPROVIDES " + item
+ if new not in close_matches:
+ close_matches.append(new)
+ bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees(item), reasons=self.get_reasons(item), close_matches=close_matches), cfgData)
+ raise bb.providers.NoProvider(item)
+
+ if self.have_build_target(item):
+ return
+
+ all_p = dataCache.providers[item]
+
+ eligible, foundUnique = bb.providers.filterProviders(all_p, item, cfgData, dataCache)
+ eligible = [p for p in eligible if not p in self.failed_fns]
+
+ if not eligible:
+ bb.event.fire(bb.event.NoProvider(item, dependees=self.get_dependees(item), reasons=["No eligible PROVIDERs exist for '%s'" % item]), cfgData)
+ raise bb.providers.NoProvider(item)
+
+ if len(eligible) > 1 and foundUnique == False:
+ if item not in self.consider_msgs_cache:
+ providers_list = []
+ for fn in eligible:
+ providers_list.append(dataCache.pkg_fn[fn])
+ bb.event.fire(bb.event.MultipleProviders(item, providers_list), cfgData)
+ self.consider_msgs_cache.append(item)
+
+ for fn in eligible:
+ if fn in self.failed_fns:
+ continue
+ logger.debug(2, "adding %s to satisfy %s", fn, item)
+ self.add_build_target(fn, item)
+ self.add_tasks(fn, dataCache)
+
+
+ #item = dataCache.pkg_fn[fn]
+
+ def add_rprovider(self, cfgData, dataCache, item):
+ """
+ Add the runtime providers of item to the task data
+ (takes item names from RDEPENDS/PACKAGES namespace)
+ """
+
+ if re_match_strings(item, dataCache.ignored_dependencies):
+ return
+
+ if self.have_runtime_target(item):
+ return
+
+ all_p = bb.providers.getRuntimeProviders(dataCache, item)
+
+ if not all_p:
+ bb.event.fire(bb.event.NoProvider(item, runtime=True, dependees=self.get_rdependees(item), reasons=self.get_reasons(item, True)), cfgData)
+ raise bb.providers.NoRProvider(item)
+
+ eligible, numberPreferred = bb.providers.filterProvidersRunTime(all_p, item, cfgData, dataCache)
+ eligible = [p for p in eligible if not p in self.failed_fns]
+
+ if not eligible:
+ bb.event.fire(bb.event.NoProvider(item, runtime=True, dependees=self.get_rdependees(item), reasons=["No eligible RPROVIDERs exist for '%s'" % item]), cfgData)
+ raise bb.providers.NoRProvider(item)
+
+ if len(eligible) > 1 and numberPreferred == 0:
+ if item not in self.consider_msgs_cache:
+ providers_list = []
+ for fn in eligible:
+ providers_list.append(dataCache.pkg_fn[fn])
+ bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData)
+ self.consider_msgs_cache.append(item)
+
+ if numberPreferred > 1:
+ if item not in self.consider_msgs_cache:
+ providers_list = []
+ for fn in eligible:
+ providers_list.append(dataCache.pkg_fn[fn])
+ bb.event.fire(bb.event.MultipleProviders(item, providers_list, runtime=True), cfgData)
+ self.consider_msgs_cache.append(item)
+ raise bb.providers.MultipleRProvider(item)
+
+ # run through the list until we find one that we can build
+ for fn in eligible:
+ if fn in self.failed_fns:
+ continue
+ logger.debug(2, "adding '%s' to satisfy runtime '%s'", fn, item)
+ self.add_runtime_target(fn, item)
+ self.add_tasks(fn, dataCache)
+
+ def fail_fn(self, fn, missing_list=None):
+ """
+ Mark a file as failed (unbuildable)
+ Remove any references from build and runtime provider lists
+
+ missing_list, A list of missing requirements for this target
+ """
+ if fn in self.failed_fns:
+ return
+ if not missing_list:
+ missing_list = []
+ logger.debug(1, "File '%s' is unbuildable, removing...", fn)
+ self.failed_fns.append(fn)
+ for target in self.build_targets:
+ if fn in self.build_targets[target]:
+ self.build_targets[target].remove(fn)
+ if len(self.build_targets[target]) == 0:
+ self.remove_buildtarget(target, missing_list)
+ for target in self.run_targets:
+ if fn in self.run_targets[target]:
+ self.run_targets[target].remove(fn)
+ if len(self.run_targets[target]) == 0:
+ self.remove_runtarget(target, missing_list)
+
+ def remove_buildtarget(self, target, missing_list=None):
+ """
+ Mark a build target as failed (unbuildable)
+ Trigger removal of any files that have this as a dependency
+ """
+ if not missing_list:
+ missing_list = [target]
+ else:
+ missing_list = [target] + missing_list
+ logger.verbose("Target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s", target, missing_list)
+ self.failed_deps.append(target)
+ dependees = self.get_dependees(target)
+ for fn in dependees:
+ self.fail_fn(fn, missing_list)
+ for tid in self.taskentries:
+ for (idepend, idependtask) in self.taskentries[tid].idepends:
+ if idepend == target:
+ fn = tid.rsplit(":",1)[0]
+ self.fail_fn(fn, missing_list)
+
+ if self.abort and target in self.external_targets:
+ logger.error("Required build target '%s' has no buildable providers.\nMissing or unbuildable dependency chain was: %s", target, missing_list)
+ raise bb.providers.NoProvider(target)
+
+ def remove_runtarget(self, target, missing_list=None):
+ """
+ Mark a run target as failed (unbuildable)
+ Trigger removal of any files that have this as a dependency
+ """
+ if not missing_list:
+ missing_list = [target]
+ else:
+ missing_list = [target] + missing_list
+
+ logger.info("Runtime target '%s' is unbuildable, removing...\nMissing or unbuildable dependency chain was: %s", target, missing_list)
+ self.failed_rdeps.append(target)
+ dependees = self.get_rdependees(target)
+ for fn in dependees:
+ self.fail_fn(fn, missing_list)
+ for tid in self.taskentries:
+ for (idepend, idependtask) in self.taskentries[tid].irdepends:
+ if idepend == target:
+ fn = tid.rsplit(":",1)[0]
+ self.fail_fn(fn, missing_list)
+
+ def add_unresolved(self, cfgData, dataCache):
+ """
+ Resolve all unresolved build and runtime targets
+ """
+ logger.info("Resolving any missing task queue dependencies")
+ while True:
+ added = 0
+ for target in self.get_unresolved_build_targets(dataCache):
+ try:
+ self.add_provider_internal(cfgData, dataCache, target)
+ added = added + 1
+ except bb.providers.NoProvider:
+ if self.abort and target in self.external_targets and not self.allowincomplete:
+ raise
+ if not self.allowincomplete:
+ self.remove_buildtarget(target)
+ for target in self.get_unresolved_run_targets(dataCache):
+ try:
+ self.add_rprovider(cfgData, dataCache, target)
+ added = added + 1
+ except (bb.providers.NoRProvider, bb.providers.MultipleRProvider):
+ self.remove_runtarget(target)
+ logger.debug(1, "Resolved " + str(added) + " extra dependencies")
+ if added == 0:
+ break
+ # self.dump_data()
+
+ def get_providermap(self, prefix=None):
+ provmap = {}
+ for name in self.build_targets:
+ if prefix and not name.startswith(prefix):
+ continue
+ if self.have_build_target(name):
+ provider = self.get_provider(name)
+ if provider:
+ provmap[name] = provider[0]
+ return provmap
+
+ def dump_data(self):
+ """
+ Dump some debug information on the internal data structures
+ """
+ logger.debug(3, "build_names:")
+ logger.debug(3, ", ".join(self.build_targets))
+
+ logger.debug(3, "run_names:")
+ logger.debug(3, ", ".join(self.run_targets))
+
+ logger.debug(3, "build_targets:")
+ for target in self.build_targets:
+ targets = "None"
+ if target in self.build_targets:
+ targets = self.build_targets[target]
+ logger.debug(3, " %s: %s", target, targets)
+
+ logger.debug(3, "run_targets:")
+ for target in self.run_targets:
+ targets = "None"
+ if target in self.run_targets:
+ targets = self.run_targets[target]
+ logger.debug(3, " %s: %s", target, targets)
+
+ logger.debug(3, "tasks:")
+ for tid in self.taskentries:
+ logger.debug(3, " %s: %s %s %s",
+ tid,
+ self.taskentries[tid].idepends,
+ self.taskentries[tid].irdepends,
+ self.taskentries[tid].tdepends)
+
+ logger.debug(3, "dependency ids (per fn):")
+ for fn in self.depids:
+ logger.debug(3, " %s: %s", fn, self.depids[fn])
+
+ logger.debug(3, "runtime dependency ids (per fn):")
+ for fn in self.rdepids:
+ logger.debug(3, " %s: %s", fn, self.rdepids[fn])
diff --git a/poky/bitbake/lib/bb/tests/__init__.py b/poky/bitbake/lib/bb/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/__init__.py
diff --git a/poky/bitbake/lib/bb/tests/codeparser.py b/poky/bitbake/lib/bb/tests/codeparser.py
new file mode 100644
index 000000000..e30e78c15
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/codeparser.py
@@ -0,0 +1,428 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Test for codeparser.py
+#
+# Copyright (C) 2010 Chris Larson
+# Copyright (C) 2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import logging
+import bb
+
+logger = logging.getLogger('BitBake.TestCodeParser')
+
+# bb.data references bb.parse but can't directly import due to circular dependencies.
+# Hack around it for now :(
+import bb.parse
+import bb.data
+
+class ReferenceTest(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+
+ def setEmptyVars(self, varlist):
+ for k in varlist:
+ self.d.setVar(k, "")
+
+ def setValues(self, values):
+ for k, v in values.items():
+ self.d.setVar(k, v)
+
+ def assertReferences(self, refs):
+ self.assertEqual(self.references, refs)
+
+ def assertExecs(self, execs):
+ self.assertEqual(self.execs, execs)
+
+ def assertContains(self, contains):
+ self.assertEqual(self.contains, contains)
+
+class VariableReferenceTest(ReferenceTest):
+
+ def parseExpression(self, exp):
+ parsedvar = self.d.expandWithRefs(exp, None)
+ self.references = parsedvar.references
+
+ def test_simple_reference(self):
+ self.setEmptyVars(["FOO"])
+ self.parseExpression("${FOO}")
+ self.assertReferences(set(["FOO"]))
+
+ def test_nested_reference(self):
+ self.setEmptyVars(["BAR"])
+ self.d.setVar("FOO", "BAR")
+ self.parseExpression("${${FOO}}")
+ self.assertReferences(set(["FOO", "BAR"]))
+
+ def test_python_reference(self):
+ self.setEmptyVars(["BAR"])
+ self.parseExpression("${@d.getVar('BAR') + 'foo'}")
+ self.assertReferences(set(["BAR"]))
+
+class ShellReferenceTest(ReferenceTest):
+
+ def parseExpression(self, exp):
+ parsedvar = self.d.expandWithRefs(exp, None)
+ parser = bb.codeparser.ShellParser("ParserTest", logger)
+ parser.parse_shell(parsedvar.value)
+
+ self.references = parsedvar.references
+ self.execs = parser.execs
+
+ def test_quotes_inside_assign(self):
+ self.parseExpression('foo=foo"bar"baz')
+ self.assertReferences(set([]))
+
+ def test_quotes_inside_arg(self):
+ self.parseExpression('sed s#"bar baz"#"alpha beta"#g')
+ self.assertExecs(set(["sed"]))
+
+ def test_arg_continuation(self):
+ self.parseExpression("sed -i -e s,foo,bar,g \\\n *.pc")
+ self.assertExecs(set(["sed"]))
+
+ def test_dollar_in_quoted(self):
+ self.parseExpression('sed -i -e "foo$" *.pc')
+ self.assertExecs(set(["sed"]))
+
+ def test_quotes_inside_arg_continuation(self):
+ self.setEmptyVars(["bindir", "D", "libdir"])
+ self.parseExpression("""
+sed -i -e s#"moc_location=.*$"#"moc_location=${bindir}/moc4"# \\
+-e s#"uic_location=.*$"#"uic_location=${bindir}/uic4"# \\
+${D}${libdir}/pkgconfig/*.pc
+""")
+ self.assertReferences(set(["bindir", "D", "libdir"]))
+
+ def test_assign_subshell_expansion(self):
+ self.parseExpression("foo=$(echo bar)")
+ self.assertExecs(set(["echo"]))
+
+ def test_shell_unexpanded(self):
+ self.setEmptyVars(["QT_BASE_NAME"])
+ self.parseExpression('echo "${QT_BASE_NAME}"')
+ self.assertExecs(set(["echo"]))
+ self.assertReferences(set(["QT_BASE_NAME"]))
+
+ def test_incomplete_varexp_single_quotes(self):
+ self.parseExpression("sed -i -e 's:IP{:I${:g' $pc")
+ self.assertExecs(set(["sed"]))
+
+
+ def test_until(self):
+ self.parseExpression("until false; do echo true; done")
+ self.assertExecs(set(["false", "echo"]))
+ self.assertReferences(set())
+
+ def test_case(self):
+ self.parseExpression("""
+case $foo in
+*)
+bar
+;;
+esac
+""")
+ self.assertExecs(set(["bar"]))
+ self.assertReferences(set())
+
+ def test_assign_exec(self):
+ self.parseExpression("a=b c='foo bar' alpha 1 2 3")
+ self.assertExecs(set(["alpha"]))
+
+ def test_redirect_to_file(self):
+ self.setEmptyVars(["foo"])
+ self.parseExpression("echo foo >${foo}/bar")
+ self.assertExecs(set(["echo"]))
+ self.assertReferences(set(["foo"]))
+
+ def test_heredoc(self):
+ self.setEmptyVars(["theta"])
+ self.parseExpression("""
+cat <<END
+alpha
+beta
+${theta}
+END
+""")
+ self.assertReferences(set(["theta"]))
+
+ def test_redirect_from_heredoc(self):
+ v = ["B", "SHADOW_MAILDIR", "SHADOW_MAILFILE", "SHADOW_UTMPDIR", "SHADOW_LOGDIR", "bindir"]
+ self.setEmptyVars(v)
+ self.parseExpression("""
+cat <<END >${B}/cachedpaths
+shadow_cv_maildir=${SHADOW_MAILDIR}
+shadow_cv_mailfile=${SHADOW_MAILFILE}
+shadow_cv_utmpdir=${SHADOW_UTMPDIR}
+shadow_cv_logdir=${SHADOW_LOGDIR}
+shadow_cv_passwd_dir=${bindir}
+END
+""")
+ self.assertReferences(set(v))
+ self.assertExecs(set(["cat"]))
+
+# def test_incomplete_command_expansion(self):
+# self.assertRaises(reftracker.ShellSyntaxError, reftracker.execs,
+# bbvalue.shparse("cp foo`", self.d), self.d)
+
+# def test_rogue_dollarsign(self):
+# self.setValues({"D" : "/tmp"})
+# self.parseExpression("install -d ${D}$")
+# self.assertReferences(set(["D"]))
+# self.assertExecs(set(["install"]))
+
+
+class PythonReferenceTest(ReferenceTest):
+
+ def setUp(self):
+ self.d = bb.data.init()
+ if hasattr(bb.utils, "_context"):
+ self.context = bb.utils._context
+ else:
+ import builtins
+ self.context = builtins.__dict__
+
+ def parseExpression(self, exp):
+ parsedvar = self.d.expandWithRefs(exp, None)
+ parser = bb.codeparser.PythonParser("ParserTest", logger)
+ parser.parse_python(parsedvar.value)
+
+ self.references = parsedvar.references | parser.references
+ self.execs = parser.execs
+ self.contains = parser.contains
+
+ @staticmethod
+ def indent(value):
+ """Python Snippets have to be indented, python values don't have to
+be. These unit tests are testing snippets."""
+ return " " + value
+
+ def test_getvar_reference(self):
+ self.parseExpression("d.getVar('foo')")
+ self.assertReferences(set(["foo"]))
+ self.assertExecs(set())
+
+ def test_getvar_computed_reference(self):
+ self.parseExpression("d.getVar('f' + 'o' + 'o')")
+ self.assertReferences(set())
+ self.assertExecs(set())
+
+ def test_getvar_exec_reference(self):
+ self.parseExpression("eval('d.getVar(\"foo\")')")
+ self.assertReferences(set())
+ self.assertExecs(set(["eval"]))
+
+ def test_var_reference(self):
+ self.context["foo"] = lambda x: x
+ self.setEmptyVars(["FOO"])
+ self.parseExpression("foo('${FOO}')")
+ self.assertReferences(set(["FOO"]))
+ self.assertExecs(set(["foo"]))
+ del self.context["foo"]
+
+ def test_var_exec(self):
+ for etype in ("func", "task"):
+ self.d.setVar("do_something", "echo 'hi mom! ${FOO}'")
+ self.d.setVarFlag("do_something", etype, True)
+ self.parseExpression("bb.build.exec_func('do_something', d)")
+ self.assertReferences(set([]))
+ self.assertExecs(set(["do_something"]))
+
+ def test_function_reference(self):
+ self.context["testfunc"] = lambda msg: bb.msg.note(1, None, msg)
+ self.d.setVar("FOO", "Hello, World!")
+ self.parseExpression("testfunc('${FOO}')")
+ self.assertReferences(set(["FOO"]))
+ self.assertExecs(set(["testfunc"]))
+ del self.context["testfunc"]
+
+ def test_qualified_function_reference(self):
+ self.parseExpression("time.time()")
+ self.assertExecs(set(["time.time"]))
+
+ def test_qualified_function_reference_2(self):
+ self.parseExpression("os.path.dirname('/foo/bar')")
+ self.assertExecs(set(["os.path.dirname"]))
+
+ def test_qualified_function_reference_nested(self):
+ self.parseExpression("time.strftime('%Y%m%d',time.gmtime())")
+ self.assertExecs(set(["time.strftime", "time.gmtime"]))
+
+ def test_function_reference_chained(self):
+ self.context["testget"] = lambda: "\tstrip me "
+ self.parseExpression("testget().strip()")
+ self.assertExecs(set(["testget"]))
+ del self.context["testget"]
+
+ def test_contains(self):
+ self.parseExpression('bb.utils.contains("TESTVAR", "one", "true", "false", d)')
+ self.assertContains({'TESTVAR': {'one'}})
+
+ def test_contains_multi(self):
+ self.parseExpression('bb.utils.contains("TESTVAR", "one two", "true", "false", d)')
+ self.assertContains({'TESTVAR': {'one two'}})
+
+ def test_contains_any(self):
+ self.parseExpression('bb.utils.contains_any("TESTVAR", "hello", "true", "false", d)')
+ self.assertContains({'TESTVAR': {'hello'}})
+
+ def test_contains_any_multi(self):
+ self.parseExpression('bb.utils.contains_any("TESTVAR", "one two three", "true", "false", d)')
+ self.assertContains({'TESTVAR': {'one', 'two', 'three'}})
+
+ def test_contains_filter(self):
+ self.parseExpression('bb.utils.filter("TESTVAR", "hello there world", d)')
+ self.assertContains({'TESTVAR': {'hello', 'there', 'world'}})
+
+
+class DependencyReferenceTest(ReferenceTest):
+
+ pydata = """
+d.getVar('somevar')
+def test(d):
+ foo = 'bar %s' % 'foo'
+def test2(d):
+ d.getVar(foo)
+ d.getVar('bar', False)
+ test2(d)
+
+def a():
+ \"\"\"some
+ stuff
+ \"\"\"
+ return "heh"
+
+test(d)
+
+d.expand(d.getVar("something", False))
+d.expand("${inexpand} somethingelse")
+d.getVar(a(), False)
+"""
+
+ def test_python(self):
+ self.d.setVar("FOO", self.pydata)
+ self.setEmptyVars(["inexpand", "a", "test2", "test"])
+ self.d.setVarFlags("FOO", {
+ "func": True,
+ "python": True,
+ "lineno": 1,
+ "filename": "example.bb",
+ })
+
+ deps, values = bb.data.build_dependencies("FOO", set(self.d.keys()), set(), set(), self.d)
+
+ self.assertEqual(deps, set(["somevar", "bar", "something", "inexpand", "test", "test2", "a"]))
+
+
+ shelldata = """
+foo () {
+bar
+}
+{
+echo baz
+$(heh)
+eval `moo`
+}
+a=b
+c=d
+(
+true && false
+test -f foo
+testval=something
+$testval
+) || aiee
+! inverted
+echo ${somevar}
+
+case foo in
+bar)
+echo bar
+;;
+baz)
+echo baz
+;;
+foo*)
+echo foo
+;;
+esac
+"""
+
+ def test_shell(self):
+ execs = ["bar", "echo", "heh", "moo", "true", "aiee"]
+ self.d.setVar("somevar", "heh")
+ self.d.setVar("inverted", "echo inverted...")
+ self.d.setVarFlag("inverted", "func", True)
+ self.d.setVar("FOO", self.shelldata)
+ self.d.setVarFlags("FOO", {"func": True})
+ self.setEmptyVars(execs)
+
+ deps, values = bb.data.build_dependencies("FOO", set(self.d.keys()), set(), set(), self.d)
+
+ self.assertEqual(deps, set(["somevar", "inverted"] + execs))
+
+
+ def test_vardeps(self):
+ self.d.setVar("oe_libinstall", "echo test")
+ self.d.setVar("FOO", "foo=oe_libinstall; eval $foo")
+ self.d.setVarFlag("FOO", "vardeps", "oe_libinstall")
+
+ deps, values = bb.data.build_dependencies("FOO", set(self.d.keys()), set(), set(), self.d)
+
+ self.assertEqual(deps, set(["oe_libinstall"]))
+
+ def test_vardeps_expand(self):
+ self.d.setVar("oe_libinstall", "echo test")
+ self.d.setVar("FOO", "foo=oe_libinstall; eval $foo")
+ self.d.setVarFlag("FOO", "vardeps", "${@'oe_libinstall'}")
+
+ deps, values = bb.data.build_dependencies("FOO", set(self.d.keys()), set(), set(), self.d)
+
+ self.assertEqual(deps, set(["oe_libinstall"]))
+
+ def test_contains_vardeps(self):
+ expr = '${@bb.utils.filter("TESTVAR", "somevalue anothervalue", d)} \
+ ${@bb.utils.contains("TESTVAR", "testval testval2", "yetanothervalue", "", d)} \
+ ${@bb.utils.contains("TESTVAR", "testval2 testval3", "blah", "", d)} \
+ ${@bb.utils.contains_any("TESTVAR", "testval2 testval3", "lastone", "", d)}'
+ parsedvar = self.d.expandWithRefs(expr, None)
+ # Check contains
+ self.assertEqual(parsedvar.contains, {'TESTVAR': {'testval2 testval3', 'anothervalue', 'somevalue', 'testval testval2', 'testval2', 'testval3'}})
+ # Check dependencies
+ self.d.setVar('ANOTHERVAR', expr)
+ self.d.setVar('TESTVAR', 'anothervalue testval testval2')
+ deps, values = bb.data.build_dependencies("ANOTHERVAR", set(self.d.keys()), set(), set(), self.d)
+ self.assertEqual(sorted(values.splitlines()),
+ sorted([expr,
+ 'TESTVAR{anothervalue} = Set',
+ 'TESTVAR{somevalue} = Unset',
+ 'TESTVAR{testval testval2} = Set',
+ 'TESTVAR{testval2 testval3} = Unset',
+ 'TESTVAR{testval2} = Set',
+ 'TESTVAR{testval3} = Unset'
+ ]))
+ # Check final value
+ self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['anothervalue', 'yetanothervalue', 'lastone'])
+
+ #Currently no wildcard support
+ #def test_vardeps_wildcards(self):
+ # self.d.setVar("oe_libinstall", "echo test")
+ # self.d.setVar("FOO", "foo=oe_libinstall; eval $foo")
+ # self.d.setVarFlag("FOO", "vardeps", "oe_*")
+ # self.assertEquals(deps, set(["oe_libinstall"]))
+
+
diff --git a/poky/bitbake/lib/bb/tests/cow.py b/poky/bitbake/lib/bb/tests/cow.py
new file mode 100644
index 000000000..d149d84d0
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/cow.py
@@ -0,0 +1,136 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Tests for Copy-on-Write (cow.py)
+#
+# Copyright 2006 Holger Freyther <freyther@handhelds.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import os
+
+class COWTestCase(unittest.TestCase):
+ """
+ Test case for the COW module from mithro
+ """
+
+ def testGetSet(self):
+ """
+ Test and set
+ """
+ from bb.COW import COWDictBase
+ a = COWDictBase.copy()
+
+ self.assertEqual(False, 'a' in a)
+
+ a['a'] = 'a'
+ a['b'] = 'b'
+ self.assertEqual(True, 'a' in a)
+ self.assertEqual(True, 'b' in a)
+ self.assertEqual('a', a['a'] )
+ self.assertEqual('b', a['b'] )
+
+ def testCopyCopy(self):
+ """
+ Test the copy of copies
+ """
+
+ from bb.COW import COWDictBase
+
+ # create two COW dict 'instances'
+ b = COWDictBase.copy()
+ c = COWDictBase.copy()
+
+ # assign some keys to one instance, some keys to another
+ b['a'] = 10
+ b['c'] = 20
+ c['a'] = 30
+
+ # test separation of the two instances
+ self.assertEqual(False, 'c' in c)
+ self.assertEqual(30, c['a'])
+ self.assertEqual(10, b['a'])
+
+ # test copy
+ b_2 = b.copy()
+ c_2 = c.copy()
+
+ self.assertEqual(False, 'c' in c_2)
+ self.assertEqual(10, b_2['a'])
+
+ b_2['d'] = 40
+ self.assertEqual(False, 'd' in c_2)
+ self.assertEqual(True, 'd' in b_2)
+ self.assertEqual(40, b_2['d'])
+ self.assertEqual(False, 'd' in b)
+ self.assertEqual(False, 'd' in c)
+
+ c_2['d'] = 30
+ self.assertEqual(True, 'd' in c_2)
+ self.assertEqual(True, 'd' in b_2)
+ self.assertEqual(30, c_2['d'])
+ self.assertEqual(40, b_2['d'])
+ self.assertEqual(False, 'd' in b)
+ self.assertEqual(False, 'd' in c)
+
+ # test copy of the copy
+ c_3 = c_2.copy()
+ b_3 = b_2.copy()
+ b_3_2 = b_2.copy()
+
+ c_3['e'] = 4711
+ self.assertEqual(4711, c_3['e'])
+ self.assertEqual(False, 'e' in c_2)
+ self.assertEqual(False, 'e' in b_3)
+ self.assertEqual(False, 'e' in b_3_2)
+ self.assertEqual(False, 'e' in b_2)
+
+ b_3['e'] = 'viel'
+ self.assertEqual('viel', b_3['e'])
+ self.assertEqual(4711, c_3['e'])
+ self.assertEqual(False, 'e' in c_2)
+ self.assertEqual(True, 'e' in b_3)
+ self.assertEqual(False, 'e' in b_3_2)
+ self.assertEqual(False, 'e' in b_2)
+
+ def testCow(self):
+ from bb.COW import COWDictBase
+ c = COWDictBase.copy()
+ c['123'] = 1027
+ c['other'] = 4711
+ c['d'] = { 'abc' : 10, 'bcd' : 20 }
+
+ copy = c.copy()
+
+ self.assertEqual(1027, c['123'])
+ self.assertEqual(4711, c['other'])
+ self.assertEqual({'abc':10, 'bcd':20}, c['d'])
+ self.assertEqual(1027, copy['123'])
+ self.assertEqual(4711, copy['other'])
+ self.assertEqual({'abc':10, 'bcd':20}, copy['d'])
+
+ # cow it now
+ copy['123'] = 1028
+ copy['other'] = 4712
+ copy['d']['abc'] = 20
+
+
+ self.assertEqual(1027, c['123'])
+ self.assertEqual(4711, c['other'])
+ self.assertEqual({'abc':10, 'bcd':20}, c['d'])
+ self.assertEqual(1028, copy['123'])
+ self.assertEqual(4712, copy['other'])
+ self.assertEqual({'abc':20, 'bcd':20}, copy['d'])
diff --git a/poky/bitbake/lib/bb/tests/data.py b/poky/bitbake/lib/bb/tests/data.py
new file mode 100644
index 000000000..a4a9dd30f
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/data.py
@@ -0,0 +1,607 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Tests for the Data Store (data.py/data_smart.py)
+#
+# Copyright (C) 2010 Chris Larson
+# Copyright (C) 2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import bb
+import bb.data
+import bb.parse
+import logging
+
+class LogRecord():
+ def __enter__(self):
+ logs = []
+ class LogHandler(logging.Handler):
+ def emit(self, record):
+ logs.append(record)
+ logger = logging.getLogger("BitBake")
+ handler = LogHandler()
+ self.handler = handler
+ logger.addHandler(handler)
+ return logs
+ def __exit__(self, type, value, traceback):
+ logger = logging.getLogger("BitBake")
+ logger.removeHandler(self.handler)
+ return
+
+def logContains(item, logs):
+ for l in logs:
+ m = l.getMessage()
+ if item in m:
+ return True
+ return False
+
+class DataExpansions(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d["foo"] = "value_of_foo"
+ self.d["bar"] = "value_of_bar"
+ self.d["value_of_foo"] = "value_of_'value_of_foo'"
+
+ def test_one_var(self):
+ val = self.d.expand("${foo}")
+ self.assertEqual(str(val), "value_of_foo")
+
+ def test_indirect_one_var(self):
+ val = self.d.expand("${${foo}}")
+ self.assertEqual(str(val), "value_of_'value_of_foo'")
+
+ def test_indirect_and_another(self):
+ val = self.d.expand("${${foo}} ${bar}")
+ self.assertEqual(str(val), "value_of_'value_of_foo' value_of_bar")
+
+ def test_python_snippet(self):
+ val = self.d.expand("${@5*12}")
+ self.assertEqual(str(val), "60")
+
+ def test_expand_in_python_snippet(self):
+ val = self.d.expand("${@'boo ' + '${foo}'}")
+ self.assertEqual(str(val), "boo value_of_foo")
+
+ def test_python_snippet_getvar(self):
+ val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
+ self.assertEqual(str(val), "value_of_foo value_of_bar")
+
+ def test_python_unexpanded(self):
+ self.d.setVar("bar", "${unsetvar}")
+ val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
+ self.assertEqual(str(val), "${@d.getVar('foo') + ' ${unsetvar}'}")
+
+ def test_python_snippet_syntax_error(self):
+ self.d.setVar("FOO", "${@foo = 5}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_python_snippet_runtime_error(self):
+ self.d.setVar("FOO", "${@int('test')}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_python_snippet_error_path(self):
+ self.d.setVar("FOO", "foo value ${BAR}")
+ self.d.setVar("BAR", "bar value ${@int('test')}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_value_containing_value(self):
+ val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")
+ self.assertEqual(str(val), "value_of_foo value_of_bar")
+
+ def test_reference_undefined_var(self):
+ val = self.d.expand("${undefinedvar} meh")
+ self.assertEqual(str(val), "${undefinedvar} meh")
+
+ def test_double_reference(self):
+ self.d.setVar("BAR", "bar value")
+ self.d.setVar("FOO", "${BAR} foo ${BAR}")
+ val = self.d.getVar("FOO")
+ self.assertEqual(str(val), "bar value foo bar value")
+
+ def test_direct_recursion(self):
+ self.d.setVar("FOO", "${FOO}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_indirect_recursion(self):
+ self.d.setVar("FOO", "${BAR}")
+ self.d.setVar("BAR", "${BAZ}")
+ self.d.setVar("BAZ", "${FOO}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_recursion_exception(self):
+ self.d.setVar("FOO", "${BAR}")
+ self.d.setVar("BAR", "${${@'FOO'}}")
+ self.assertRaises(bb.data_smart.ExpansionError, self.d.getVar, "FOO", True)
+
+ def test_incomplete_varexp_single_quotes(self):
+ self.d.setVar("FOO", "sed -i -e 's:IP{:I${:g' $pc")
+ val = self.d.getVar("FOO")
+ self.assertEqual(str(val), "sed -i -e 's:IP{:I${:g' $pc")
+
+ def test_nonstring(self):
+ self.d.setVar("TEST", 5)
+ val = self.d.getVar("TEST")
+ self.assertEqual(str(val), "5")
+
+ def test_rename(self):
+ self.d.renameVar("foo", "newfoo")
+ self.assertEqual(self.d.getVar("newfoo", False), "value_of_foo")
+ self.assertEqual(self.d.getVar("foo", False), None)
+
+ def test_deletion(self):
+ self.d.delVar("foo")
+ self.assertEqual(self.d.getVar("foo", False), None)
+
+ def test_keys(self):
+ keys = list(self.d.keys())
+ self.assertCountEqual(keys, ['value_of_foo', 'foo', 'bar'])
+
+ def test_keys_deletion(self):
+ newd = bb.data.createCopy(self.d)
+ newd.delVar("bar")
+ keys = list(newd.keys())
+ self.assertCountEqual(keys, ['value_of_foo', 'foo'])
+
+class TestNestedExpansions(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d["foo"] = "foo"
+ self.d["bar"] = "bar"
+ self.d["value_of_foobar"] = "187"
+
+ def test_refs(self):
+ val = self.d.expand("${value_of_${foo}${bar}}")
+ self.assertEqual(str(val), "187")
+
+ #def test_python_refs(self):
+ # val = self.d.expand("${@${@3}**2 + ${@4}**2}")
+ # self.assertEqual(str(val), "25")
+
+ def test_ref_in_python_ref(self):
+ val = self.d.expand("${@'${foo}' + 'bar'}")
+ self.assertEqual(str(val), "foobar")
+
+ def test_python_ref_in_ref(self):
+ val = self.d.expand("${${@'f'+'o'+'o'}}")
+ self.assertEqual(str(val), "foo")
+
+ def test_deep_nesting(self):
+ depth = 100
+ val = self.d.expand("${" * depth + "foo" + "}" * depth)
+ self.assertEqual(str(val), "foo")
+
+ #def test_deep_python_nesting(self):
+ # depth = 50
+ # val = self.d.expand("${@" * depth + "1" + "+1}" * depth)
+ # self.assertEqual(str(val), str(depth + 1))
+
+ def test_mixed(self):
+ val = self.d.expand("${value_of_${@('${foo}'+'bar')[0:3]}${${@'BAR'.lower()}}}")
+ self.assertEqual(str(val), "187")
+
+ def test_runtime(self):
+ val = self.d.expand("${${@'value_of' + '_f'+'o'+'o'+'b'+'a'+'r'}}")
+ self.assertEqual(str(val), "187")
+
+class TestMemoize(unittest.TestCase):
+ def test_memoized(self):
+ d = bb.data.init()
+ d.setVar("FOO", "bar")
+ self.assertTrue(d.getVar("FOO", False) is d.getVar("FOO", False))
+
+ def test_not_memoized(self):
+ d1 = bb.data.init()
+ d2 = bb.data.init()
+ d1.setVar("FOO", "bar")
+ d2.setVar("FOO", "bar2")
+ self.assertTrue(d1.getVar("FOO", False) is not d2.getVar("FOO", False))
+
+ def test_changed_after_memoized(self):
+ d = bb.data.init()
+ d.setVar("foo", "value of foo")
+ self.assertEqual(str(d.getVar("foo", False)), "value of foo")
+ d.setVar("foo", "second value of foo")
+ self.assertEqual(str(d.getVar("foo", False)), "second value of foo")
+
+ def test_same_value(self):
+ d = bb.data.init()
+ d.setVar("foo", "value of")
+ d.setVar("bar", "value of")
+ self.assertEqual(d.getVar("foo", False),
+ d.getVar("bar", False))
+
+class TestConcat(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("FOO", "foo")
+ self.d.setVar("VAL", "val")
+ self.d.setVar("BAR", "bar")
+
+ def test_prepend(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.prependVar("TEST", "${FOO}:")
+ self.assertEqual(self.d.getVar("TEST"), "foo:val")
+
+ def test_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.appendVar("TEST", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "val:bar")
+
+ def test_multiple_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.prependVar("TEST", "${FOO}:")
+ self.d.appendVar("TEST", ":val2")
+ self.d.appendVar("TEST", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
+
+class TestConcatOverride(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("FOO", "foo")
+ self.d.setVar("VAL", "val")
+ self.d.setVar("BAR", "bar")
+
+ def test_prepend(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.setVar("TEST_prepend", "${FOO}:")
+ self.assertEqual(self.d.getVar("TEST"), "foo:val")
+
+ def test_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.setVar("TEST_append", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "val:bar")
+
+ def test_multiple_append(self):
+ self.d.setVar("TEST", "${VAL}")
+ self.d.setVar("TEST_prepend", "${FOO}:")
+ self.d.setVar("TEST_append", ":val2")
+ self.d.setVar("TEST_append", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "foo:val:val2:bar")
+
+ def test_append_unset(self):
+ self.d.setVar("TEST_prepend", "${FOO}:")
+ self.d.setVar("TEST_append", ":val2")
+ self.d.setVar("TEST_append", ":${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "foo::val2:bar")
+
+ def test_remove(self):
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.d.setVar("TEST_remove", "val")
+ self.assertEqual(self.d.getVar("TEST"), "bar")
+
+ def test_remove_cleared(self):
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.d.setVar("TEST_remove", "val")
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "val bar")
+
+ # Ensure the value is unchanged if we have an inactive remove override
+ # (including that whitespace is preserved)
+ def test_remove_inactive_override(self):
+ self.d.setVar("TEST", "${VAL} ${BAR} 123")
+ self.d.setVar("TEST_remove_inactiveoverride", "val")
+ self.assertEqual(self.d.getVar("TEST"), "val bar 123")
+
+ def test_doubleref_remove(self):
+ self.d.setVar("TEST", "${VAL} ${BAR}")
+ self.d.setVar("TEST_remove", "val")
+ self.d.setVar("TEST_TEST", "${TEST} ${TEST}")
+ self.assertEqual(self.d.getVar("TEST_TEST"), "bar bar")
+
+ def test_empty_remove(self):
+ self.d.setVar("TEST", "")
+ self.d.setVar("TEST_remove", "val")
+ self.assertEqual(self.d.getVar("TEST"), "")
+
+ def test_remove_expansion(self):
+ self.d.setVar("BAR", "Z")
+ self.d.setVar("TEST", "${BAR}/X Y")
+ self.d.setVar("TEST_remove", "${BAR}/X")
+ self.assertEqual(self.d.getVar("TEST"), "Y")
+
+ def test_remove_expansion_items(self):
+ self.d.setVar("TEST", "A B C D")
+ self.d.setVar("BAR", "B D")
+ self.d.setVar("TEST_remove", "${BAR}")
+ self.assertEqual(self.d.getVar("TEST"), "A C")
+
+class TestOverrides(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("OVERRIDES", "foo:bar:local")
+ self.d.setVar("TEST", "testvalue")
+
+ def test_no_override(self):
+ self.assertEqual(self.d.getVar("TEST"), "testvalue")
+
+ def test_one_override(self):
+ self.d.setVar("TEST_bar", "testvalue2")
+ self.assertEqual(self.d.getVar("TEST"), "testvalue2")
+
+ def test_one_override_unset(self):
+ self.d.setVar("TEST2_bar", "testvalue2")
+
+ self.assertEqual(self.d.getVar("TEST2"), "testvalue2")
+ self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST2', 'OVERRIDES', 'TEST2_bar'])
+
+ def test_multiple_override(self):
+ self.d.setVar("TEST_bar", "testvalue2")
+ self.d.setVar("TEST_local", "testvalue3")
+ self.d.setVar("TEST_foo", "testvalue4")
+ self.assertEqual(self.d.getVar("TEST"), "testvalue3")
+ self.assertCountEqual(list(self.d.keys()), ['TEST', 'TEST_foo', 'OVERRIDES', 'TEST_bar', 'TEST_local'])
+
+ def test_multiple_combined_overrides(self):
+ self.d.setVar("TEST_local_foo_bar", "testvalue3")
+ self.assertEqual(self.d.getVar("TEST"), "testvalue3")
+
+ def test_multiple_overrides_unset(self):
+ self.d.setVar("TEST2_local_foo_bar", "testvalue3")
+ self.assertEqual(self.d.getVar("TEST2"), "testvalue3")
+
+ def test_keyexpansion_override(self):
+ self.d.setVar("LOCAL", "local")
+ self.d.setVar("TEST_bar", "testvalue2")
+ self.d.setVar("TEST_${LOCAL}", "testvalue3")
+ self.d.setVar("TEST_foo", "testvalue4")
+ bb.data.expandKeys(self.d)
+ self.assertEqual(self.d.getVar("TEST"), "testvalue3")
+
+ def test_rename_override(self):
+ self.d.setVar("ALTERNATIVE_ncurses-tools_class-target", "a")
+ self.d.setVar("OVERRIDES", "class-target")
+ self.d.renameVar("ALTERNATIVE_ncurses-tools", "ALTERNATIVE_lib32-ncurses-tools")
+ self.assertEqual(self.d.getVar("ALTERNATIVE_lib32-ncurses-tools"), "a")
+
+ def test_underscore_override(self):
+ self.d.setVar("TEST_bar", "testvalue2")
+ self.d.setVar("TEST_some_val", "testvalue3")
+ self.d.setVar("TEST_foo", "testvalue4")
+ self.d.setVar("OVERRIDES", "foo:bar:some_val")
+ self.assertEqual(self.d.getVar("TEST"), "testvalue3")
+
+class TestKeyExpansion(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("FOO", "foo")
+ self.d.setVar("BAR", "foo")
+
+ def test_keyexpand(self):
+ self.d.setVar("VAL_${FOO}", "A")
+ self.d.setVar("VAL_${BAR}", "B")
+ with LogRecord() as logs:
+ bb.data.expandKeys(self.d)
+ self.assertTrue(logContains("Variable key VAL_${FOO} (A) replaces original key VAL_foo (B)", logs))
+ self.assertEqual(self.d.getVar("VAL_foo"), "A")
+
+class TestFlags(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("foo", "value of foo")
+ self.d.setVarFlag("foo", "flag1", "value of flag1")
+ self.d.setVarFlag("foo", "flag2", "value of flag2")
+
+ def test_setflag(self):
+ self.assertEqual(self.d.getVarFlag("foo", "flag1", False), "value of flag1")
+ self.assertEqual(self.d.getVarFlag("foo", "flag2", False), "value of flag2")
+
+ def test_delflag(self):
+ self.d.delVarFlag("foo", "flag2")
+ self.assertEqual(self.d.getVarFlag("foo", "flag1", False), "value of flag1")
+ self.assertEqual(self.d.getVarFlag("foo", "flag2", False), None)
+
+
+class Contains(unittest.TestCase):
+ def setUp(self):
+ self.d = bb.data.init()
+ self.d.setVar("SOMEFLAG", "a b c")
+
+ def test_contains(self):
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "a", True, False, self.d))
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "b", True, False, self.d))
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "c", True, False, self.d))
+
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "a b", True, False, self.d))
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "b c", True, False, self.d))
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "c a", True, False, self.d))
+
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "a b c", True, False, self.d))
+ self.assertTrue(bb.utils.contains("SOMEFLAG", "c b a", True, False, self.d))
+
+ self.assertFalse(bb.utils.contains("SOMEFLAG", "x", True, False, self.d))
+ self.assertFalse(bb.utils.contains("SOMEFLAG", "a x", True, False, self.d))
+ self.assertFalse(bb.utils.contains("SOMEFLAG", "x c b", True, False, self.d))
+ self.assertFalse(bb.utils.contains("SOMEFLAG", "x c b a", True, False, self.d))
+
+ def test_contains_any(self):
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "a", True, False, self.d))
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "b", True, False, self.d))
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "c", True, False, self.d))
+
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "a b", True, False, self.d))
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "b c", True, False, self.d))
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "c a", True, False, self.d))
+
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "a x", True, False, self.d))
+ self.assertTrue(bb.utils.contains_any("SOMEFLAG", "x c", True, False, self.d))
+
+ self.assertFalse(bb.utils.contains_any("SOMEFLAG", "x", True, False, self.d))
+ self.assertFalse(bb.utils.contains_any("SOMEFLAG", "x y z", True, False, self.d))
+
+
+class Serialize(unittest.TestCase):
+
+ def test_serialize(self):
+ import tempfile
+ import pickle
+ d = bb.data.init()
+ d.enableTracking()
+ d.setVar('HELLO', 'world')
+ d.setVarFlag('HELLO', 'other', 'planet')
+ with tempfile.NamedTemporaryFile(delete=False) as tmpfile:
+ tmpfilename = tmpfile.name
+ pickle.dump(d, tmpfile)
+
+ with open(tmpfilename, 'rb') as f:
+ newd = pickle.load(f)
+
+ os.remove(tmpfilename)
+
+ self.assertEqual(d, newd)
+ self.assertEqual(newd.getVar('HELLO'), 'world')
+ self.assertEqual(newd.getVarFlag('HELLO', 'other'), 'planet')
+
+
+# Remote datastore tests
+# These really only test the interface, since in actual usage we have a
+# tinfoil connector that does everything over RPC, and this doesn't test
+# that.
+
+class TestConnector:
+ d = None
+ def __init__(self, d):
+ self.d = d
+ def getVar(self, name):
+ return self.d._findVar(name)
+ def getKeys(self):
+ return set(self.d.keys())
+ def getVarHistory(self, name):
+ return self.d.varhistory.variable(name)
+ def expandPythonRef(self, varname, expr, d):
+ localdata = self.d.createCopy()
+ for key in d.localkeys():
+ localdata.setVar(d.getVar(key))
+ varparse = bb.data_smart.VariableParse(varname, localdata)
+ return varparse.python_sub(expr)
+ def setVar(self, name, value):
+ self.d.setVar(name, value)
+ def setVarFlag(self, name, flag, value):
+ self.d.setVarFlag(name, flag, value)
+ def delVar(self, name):
+ self.d.delVar(name)
+ return False
+ def delVarFlag(self, name, flag):
+ self.d.delVarFlag(name, flag)
+ return False
+ def renameVar(self, name, newname):
+ self.d.renameVar(name, newname)
+ return False
+
+class Remote(unittest.TestCase):
+ def test_remote(self):
+
+ d1 = bb.data.init()
+ d1.enableTracking()
+ d2 = bb.data.init()
+ d2.enableTracking()
+ connector = TestConnector(d1)
+
+ d2.setVar('_remote_data', connector)
+
+ d1.setVar('HELLO', 'world')
+ d1.setVarFlag('OTHER', 'flagname', 'flagvalue')
+ self.assertEqual(d2.getVar('HELLO'), 'world')
+ self.assertEqual(d2.expand('${HELLO}'), 'world')
+ self.assertEqual(d2.expand('${@d.getVar("HELLO")}'), 'world')
+ self.assertIn('flagname', d2.getVarFlags('OTHER'))
+ self.assertEqual(d2.getVarFlag('OTHER', 'flagname'), 'flagvalue')
+ self.assertEqual(d1.varhistory.variable('HELLO'), d2.varhistory.variable('HELLO'))
+ # Test setVar on client side affects server
+ d2.setVar('HELLO', 'other-world')
+ self.assertEqual(d1.getVar('HELLO'), 'other-world')
+ # Test setVarFlag on client side affects server
+ d2.setVarFlag('HELLO', 'flagname', 'flagvalue')
+ self.assertEqual(d1.getVarFlag('HELLO', 'flagname'), 'flagvalue')
+ # Test client side data is incorporated in python expansion (which is done on server)
+ d2.setVar('FOO', 'bar')
+ self.assertEqual(d2.expand('${@d.getVar("FOO")}'), 'bar')
+ # Test overrides work
+ d1.setVar('FOO_test', 'baz')
+ d1.appendVar('OVERRIDES', ':test')
+ self.assertEqual(d2.getVar('FOO'), 'baz')
+
+
+# Remote equivalents of local test classes
+# Note that these aren't perfect since we only test in one direction
+
+class RemoteDataExpansions(DataExpansions):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1["foo"] = "value_of_foo"
+ self.d1["bar"] = "value_of_bar"
+ self.d1["value_of_foo"] = "value_of_'value_of_foo'"
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteNestedExpansions(TestNestedExpansions):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1["foo"] = "foo"
+ self.d1["bar"] = "bar"
+ self.d1["value_of_foobar"] = "187"
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteConcat(TestConcat):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1.setVar("FOO", "foo")
+ self.d1.setVar("VAL", "val")
+ self.d1.setVar("BAR", "bar")
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteConcatOverride(TestConcatOverride):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1.setVar("FOO", "foo")
+ self.d1.setVar("VAL", "val")
+ self.d1.setVar("BAR", "bar")
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteOverrides(TestOverrides):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1.setVar("OVERRIDES", "foo:bar:local")
+ self.d1.setVar("TEST", "testvalue")
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteKeyExpansion(TestKeyExpansion):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1.setVar("FOO", "foo")
+ self.d1.setVar("BAR", "foo")
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
+
+class TestRemoteFlags(TestFlags):
+ def setUp(self):
+ self.d1 = bb.data.init()
+ self.d = bb.data.init()
+ self.d1.setVar("foo", "value of foo")
+ self.d1.setVarFlag("foo", "flag1", "value of flag1")
+ self.d1.setVarFlag("foo", "flag2", "value of flag2")
+ connector = TestConnector(self.d1)
+ self.d.setVar('_remote_data', connector)
diff --git a/poky/bitbake/lib/bb/tests/event.py b/poky/bitbake/lib/bb/tests/event.py
new file mode 100644
index 000000000..d3a5f6269
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/event.py
@@ -0,0 +1,986 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Tests for the Event implementation (event.py)
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import bb
+import logging
+import bb.compat
+import bb.event
+import importlib
+import threading
+import time
+import pickle
+from unittest.mock import Mock
+from unittest.mock import call
+from bb.msg import BBLogFormatter
+
+
+class EventQueueStubBase(object):
+ """ Base class for EventQueueStub classes """
+ def __init__(self):
+ self.event_calls = []
+ return
+
+ def _store_event_data_string(self, event):
+ if isinstance(event, logging.LogRecord):
+ formatter = BBLogFormatter("%(levelname)s: %(message)s")
+ self.event_calls.append(formatter.format(event))
+ else:
+ self.event_calls.append(bb.event.getName(event))
+ return
+
+
+class EventQueueStub(EventQueueStubBase):
+ """ Class used as specification for UI event handler queue stub objects """
+ def __init__(self):
+ super(EventQueueStub, self).__init__()
+
+ def send(self, event):
+ super(EventQueueStub, self)._store_event_data_string(event)
+
+
+class PickleEventQueueStub(EventQueueStubBase):
+ """ Class used as specification for UI event handler queue stub objects
+ with sendpickle method """
+ def __init__(self):
+ super(PickleEventQueueStub, self).__init__()
+
+ def sendpickle(self, pickled_event):
+ event = pickle.loads(pickled_event)
+ super(PickleEventQueueStub, self)._store_event_data_string(event)
+
+
+class UIClientStub(object):
+ """ Class used as specification for UI event handler stub objects """
+ def __init__(self):
+ self.event = None
+
+
+class EventHandlingTest(unittest.TestCase):
+ """ Event handling test class """
+
+
+ def setUp(self):
+ self._test_process = Mock()
+ ui_client1 = UIClientStub()
+ ui_client2 = UIClientStub()
+ self._test_ui1 = Mock(wraps=ui_client1)
+ self._test_ui2 = Mock(wraps=ui_client2)
+ importlib.reload(bb.event)
+
+ def _create_test_handlers(self):
+ """ Method used to create a test handler ordered dictionary """
+ test_handlers = bb.compat.OrderedDict()
+ test_handlers["handler1"] = self._test_process.handler1
+ test_handlers["handler2"] = self._test_process.handler2
+ return test_handlers
+
+ def test_class_handlers(self):
+ """ Test set_class_handlers and get_class_handlers methods """
+ test_handlers = self._create_test_handlers()
+ bb.event.set_class_handlers(test_handlers)
+ self.assertEqual(test_handlers,
+ bb.event.get_class_handlers())
+
+ def test_handlers(self):
+ """ Test set_handlers and get_handlers """
+ test_handlers = self._create_test_handlers()
+ bb.event.set_handlers(test_handlers)
+ self.assertEqual(test_handlers,
+ bb.event.get_handlers())
+
+ def test_clean_class_handlers(self):
+ """ Test clean_class_handlers method """
+ cleanDict = bb.compat.OrderedDict()
+ self.assertEqual(cleanDict,
+ bb.event.clean_class_handlers())
+
+ def test_register(self):
+ """ Test register method for class handlers """
+ result = bb.event.register("handler", self._test_process.handler)
+ self.assertEqual(result, bb.event.Registered)
+ handlers_dict = bb.event.get_class_handlers()
+ self.assertIn("handler", handlers_dict)
+
+ def test_already_registered(self):
+ """ Test detection of an already registed class handler """
+ bb.event.register("handler", self._test_process.handler)
+ handlers_dict = bb.event.get_class_handlers()
+ self.assertIn("handler", handlers_dict)
+ result = bb.event.register("handler", self._test_process.handler)
+ self.assertEqual(result, bb.event.AlreadyRegistered)
+
+ def test_register_from_string(self):
+ """ Test register method receiving code in string """
+ result = bb.event.register("string_handler", " return True")
+ self.assertEqual(result, bb.event.Registered)
+ handlers_dict = bb.event.get_class_handlers()
+ self.assertIn("string_handler", handlers_dict)
+
+ def test_register_with_mask(self):
+ """ Test register method with event masking """
+ mask = ["bb.event.OperationStarted",
+ "bb.event.OperationCompleted"]
+ result = bb.event.register("event_handler",
+ self._test_process.event_handler,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ handlers_dict = bb.event.get_class_handlers()
+ self.assertIn("event_handler", handlers_dict)
+
+ def test_remove(self):
+ """ Test remove method for class handlers """
+ test_handlers = self._create_test_handlers()
+ bb.event.set_class_handlers(test_handlers)
+ count = len(test_handlers)
+ bb.event.remove("handler1", None)
+ test_handlers = bb.event.get_class_handlers()
+ self.assertEqual(len(test_handlers), count - 1)
+ with self.assertRaises(KeyError):
+ bb.event.remove("handler1", None)
+
+ def test_execute_handler(self):
+ """ Test execute_handler method for class handlers """
+ mask = ["bb.event.OperationProgress"]
+ result = bb.event.register("event_handler",
+ self._test_process.event_handler,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ event = bb.event.OperationProgress(current=10, total=100)
+ bb.event.execute_handler("event_handler",
+ self._test_process.event_handler,
+ event,
+ None)
+ self._test_process.event_handler.assert_called_once_with(event)
+
+ def test_fire_class_handlers(self):
+ """ Test fire_class_handlers method """
+ mask = ["bb.event.OperationStarted"]
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ result = bb.event.register("event_handler2",
+ self._test_process.event_handler2,
+ "*")
+ self.assertEqual(result, bb.event.Registered)
+ event1 = bb.event.OperationStarted()
+ event2 = bb.event.OperationCompleted(total=123)
+ bb.event.fire_class_handlers(event1, None)
+ bb.event.fire_class_handlers(event2, None)
+ bb.event.fire_class_handlers(event2, None)
+ expected_event_handler1 = [call(event1)]
+ expected_event_handler2 = [call(event1),
+ call(event2),
+ call(event2)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected_event_handler1)
+ self.assertEqual(self._test_process.event_handler2.call_args_list,
+ expected_event_handler2)
+
+ def test_class_handler_filters(self):
+ """ Test filters for class handlers """
+ mask = ["bb.event.OperationStarted"]
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ result = bb.event.register("event_handler2",
+ self._test_process.event_handler2,
+ "*")
+ self.assertEqual(result, bb.event.Registered)
+ bb.event.set_eventfilter(
+ lambda name, handler, event, d :
+ name == 'event_handler2' and
+ bb.event.getName(event) == "OperationStarted")
+ event1 = bb.event.OperationStarted()
+ event2 = bb.event.OperationCompleted(total=123)
+ bb.event.fire_class_handlers(event1, None)
+ bb.event.fire_class_handlers(event2, None)
+ bb.event.fire_class_handlers(event2, None)
+ expected_event_handler1 = []
+ expected_event_handler2 = [call(event1)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected_event_handler1)
+ self.assertEqual(self._test_process.event_handler2.call_args_list,
+ expected_event_handler2)
+
+ def test_change_handler_event_mapping(self):
+ """ Test changing the event mapping for class handlers """
+ event1 = bb.event.OperationStarted()
+ event2 = bb.event.OperationCompleted(total=123)
+
+ # register handler for all events
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ "*")
+ self.assertEqual(result, bb.event.Registered)
+ bb.event.fire_class_handlers(event1, None)
+ bb.event.fire_class_handlers(event2, None)
+ expected = [call(event1), call(event2)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected)
+
+ # unregister handler and register it only for OperationStarted
+ bb.event.remove("event_handler1",
+ self._test_process.event_handler1)
+ mask = ["bb.event.OperationStarted"]
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ bb.event.fire_class_handlers(event1, None)
+ bb.event.fire_class_handlers(event2, None)
+ expected = [call(event1), call(event2), call(event1)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected)
+
+ # unregister handler and register it only for OperationCompleted
+ bb.event.remove("event_handler1",
+ self._test_process.event_handler1)
+ mask = ["bb.event.OperationCompleted"]
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ mask)
+ self.assertEqual(result, bb.event.Registered)
+ bb.event.fire_class_handlers(event1, None)
+ bb.event.fire_class_handlers(event2, None)
+ expected = [call(event1), call(event2), call(event1), call(event2)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected)
+
+ def test_register_UIHhandler(self):
+ """ Test register_UIHhandler method """
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+
+ def test_UIHhandler_already_registered(self):
+ """ Test registering an UIHhandler already existing """
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 2)
+
+ def test_unregister_UIHhandler(self):
+ """ Test unregister_UIHhandler method """
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+ result = bb.event.unregister_UIHhandler(1)
+ self.assertIs(result, None)
+
+ def test_fire_ui_handlers(self):
+ """ Test fire_ui_handlers method """
+ self._test_ui1.event = Mock(spec_set=EventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+ self._test_ui2.event = Mock(spec_set=PickleEventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui2, mainui=True)
+ self.assertEqual(result, 2)
+ event1 = bb.event.OperationStarted()
+ bb.event.fire_ui_handlers(event1, None)
+ expected = [call(event1)]
+ self.assertEqual(self._test_ui1.event.send.call_args_list,
+ expected)
+ expected = [call(pickle.dumps(event1))]
+ self.assertEqual(self._test_ui2.event.sendpickle.call_args_list,
+ expected)
+
+ def test_ui_handler_mask_filter(self):
+ """ Test filters for UI handlers """
+ mask = ["bb.event.OperationStarted"]
+ debug_domains = {}
+ self._test_ui1.event = Mock(spec_set=EventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ bb.event.set_UIHmask(result, logging.INFO, debug_domains, mask)
+ self._test_ui2.event = Mock(spec_set=PickleEventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui2, mainui=True)
+ bb.event.set_UIHmask(result, logging.INFO, debug_domains, mask)
+
+ event1 = bb.event.OperationStarted()
+ event2 = bb.event.OperationCompleted(total=1)
+
+ bb.event.fire_ui_handlers(event1, None)
+ bb.event.fire_ui_handlers(event2, None)
+ expected = [call(event1)]
+ self.assertEqual(self._test_ui1.event.send.call_args_list,
+ expected)
+ expected = [call(pickle.dumps(event1))]
+ self.assertEqual(self._test_ui2.event.sendpickle.call_args_list,
+ expected)
+
+ def test_ui_handler_log_filter(self):
+ """ Test log filters for UI handlers """
+ mask = ["*"]
+ debug_domains = {'BitBake.Foo': logging.WARNING}
+
+ self._test_ui1.event = EventQueueStub()
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ bb.event.set_UIHmask(result, logging.ERROR, debug_domains, mask)
+ self._test_ui2.event = PickleEventQueueStub()
+ result = bb.event.register_UIHhandler(self._test_ui2, mainui=True)
+ bb.event.set_UIHmask(result, logging.ERROR, debug_domains, mask)
+
+ event1 = bb.event.OperationStarted()
+ bb.event.fire_ui_handlers(event1, None) # All events match
+
+ event_log_handler = bb.event.LogHandler()
+ logger = logging.getLogger("BitBake")
+ logger.addHandler(event_log_handler)
+ logger1 = logging.getLogger("BitBake.Foo")
+ logger1.warning("Test warning LogRecord1") # Matches debug_domains level
+ logger1.info("Test info LogRecord") # Filtered out
+ logger2 = logging.getLogger("BitBake.Bar")
+ logger2.error("Test error LogRecord") # Matches filter base level
+ logger2.warning("Test warning LogRecord2") # Filtered out
+ logger.removeHandler(event_log_handler)
+
+ expected = ['OperationStarted',
+ 'WARNING: Test warning LogRecord1',
+ 'ERROR: Test error LogRecord']
+ self.assertEqual(self._test_ui1.event.event_calls, expected)
+ self.assertEqual(self._test_ui2.event.event_calls, expected)
+
+ def test_fire(self):
+ """ Test fire method used to trigger class and ui event handlers """
+ mask = ["bb.event.ConfigParsed"]
+ result = bb.event.register("event_handler1",
+ self._test_process.event_handler1,
+ mask)
+
+ self._test_ui1.event = Mock(spec_set=EventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+
+ event1 = bb.event.ConfigParsed()
+ bb.event.fire(event1, None)
+ expected = [call(event1)]
+ self.assertEqual(self._test_process.event_handler1.call_args_list,
+ expected)
+ self.assertEqual(self._test_ui1.event.send.call_args_list,
+ expected)
+
+ def test_fire_from_worker(self):
+ """ Test fire_from_worker method """
+ self._test_ui1.event = Mock(spec_set=EventQueueStub)
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+ event1 = bb.event.ConfigParsed()
+ bb.event.fire_from_worker(event1, None)
+ expected = [call(event1)]
+ self.assertEqual(self._test_ui1.event.send.call_args_list,
+ expected)
+
+ def test_worker_fire(self):
+ """ Test the triggering of bb.event.worker_fire callback """
+ bb.event.worker_fire = Mock()
+ event = bb.event.Event()
+ bb.event.fire(event, None)
+ expected = [call(event, None)]
+ self.assertEqual(bb.event.worker_fire.call_args_list, expected)
+
+ def test_print_ui_queue(self):
+ """ Test print_ui_queue method """
+ event1 = bb.event.OperationStarted()
+ event2 = bb.event.OperationCompleted(total=123)
+ bb.event.fire(event1, None)
+ bb.event.fire(event2, None)
+ event_log_handler = bb.event.LogHandler()
+ logger = logging.getLogger("BitBake")
+ logger.addHandler(event_log_handler)
+ logger.info("Test info LogRecord")
+ logger.warning("Test warning LogRecord")
+ with self.assertLogs("BitBake", level="INFO") as cm:
+ bb.event.print_ui_queue()
+ logger.removeHandler(event_log_handler)
+ self.assertEqual(cm.output,
+ ["INFO:BitBake:Test info LogRecord",
+ "WARNING:BitBake:Test warning LogRecord"])
+
+ def _set_threadlock_test_mockups(self):
+ """ Create UI event handler mockups used in enable and disable
+ threadlock tests """
+ def ui1_event_send(event):
+ if type(event) is bb.event.ConfigParsed:
+ self._threadlock_test_calls.append("w1_ui1")
+ if type(event) is bb.event.OperationStarted:
+ self._threadlock_test_calls.append("w2_ui1")
+ time.sleep(2)
+
+ def ui2_event_send(event):
+ if type(event) is bb.event.ConfigParsed:
+ self._threadlock_test_calls.append("w1_ui2")
+ if type(event) is bb.event.OperationStarted:
+ self._threadlock_test_calls.append("w2_ui2")
+ time.sleep(2)
+
+ self._threadlock_test_calls = []
+ self._test_ui1.event = EventQueueStub()
+ self._test_ui1.event.send = ui1_event_send
+ result = bb.event.register_UIHhandler(self._test_ui1, mainui=True)
+ self.assertEqual(result, 1)
+ self._test_ui2.event = EventQueueStub()
+ self._test_ui2.event.send = ui2_event_send
+ result = bb.event.register_UIHhandler(self._test_ui2, mainui=True)
+ self.assertEqual(result, 2)
+
+ def _set_and_run_threadlock_test_workers(self):
+ """ Create and run the workers used to trigger events in enable and
+ disable threadlock tests """
+ worker1 = threading.Thread(target=self._thread_lock_test_worker1)
+ worker2 = threading.Thread(target=self._thread_lock_test_worker2)
+ worker1.start()
+ time.sleep(1)
+ worker2.start()
+ worker1.join()
+ worker2.join()
+
+ def _thread_lock_test_worker1(self):
+ """ First worker used to fire the ConfigParsed event for enable and
+ disable threadlocks tests """
+ bb.event.fire(bb.event.ConfigParsed(), None)
+
+ def _thread_lock_test_worker2(self):
+ """ Second worker used to fire the OperationStarted event for enable
+ and disable threadlocks tests """
+ bb.event.fire(bb.event.OperationStarted(), None)
+
+ def test_enable_threadlock(self):
+ """ Test enable_threadlock method """
+ self._set_threadlock_test_mockups()
+ bb.event.enable_threadlock()
+ self._set_and_run_threadlock_test_workers()
+ # Calls to UI handlers should be in order as all the registered
+ # handlers for the event coming from the first worker should be
+ # called before processing the event from the second worker.
+ self.assertEqual(self._threadlock_test_calls,
+ ["w1_ui1", "w1_ui2", "w2_ui1", "w2_ui2"])
+
+
+ def test_disable_threadlock(self):
+ """ Test disable_threadlock method """
+ self._set_threadlock_test_mockups()
+ bb.event.disable_threadlock()
+ self._set_and_run_threadlock_test_workers()
+ # Calls to UI handlers should be intertwined together. Thanks to the
+ # delay in the registered handlers for the event coming from the first
+ # worker, the event coming from the second worker starts being
+ # processed before finishing handling the first worker event.
+ self.assertEqual(self._threadlock_test_calls,
+ ["w1_ui1", "w2_ui1", "w1_ui2", "w2_ui2"])
+
+
+class EventClassesTest(unittest.TestCase):
+ """ Event classes test class """
+
+ _worker_pid = 54321
+
+ def setUp(self):
+ bb.event.worker_pid = EventClassesTest._worker_pid
+
+ def test_Event(self):
+ """ Test the Event base class """
+ event = bb.event.Event()
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_HeartbeatEvent(self):
+ """ Test the HeartbeatEvent class """
+ time = 10
+ event = bb.event.HeartbeatEvent(time)
+ self.assertEqual(event.time, time)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_OperationStarted(self):
+ """ Test OperationStarted event class """
+ msg = "Foo Bar"
+ event = bb.event.OperationStarted(msg)
+ self.assertEqual(event.msg, msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_OperationCompleted(self):
+ """ Test OperationCompleted event class """
+ msg = "Foo Bar"
+ total = 123
+ event = bb.event.OperationCompleted(total, msg)
+ self.assertEqual(event.msg, msg)
+ self.assertEqual(event.total, total)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_OperationProgress(self):
+ """ Test OperationProgress event class """
+ msg = "Foo Bar"
+ total = 123
+ current = 111
+ event = bb.event.OperationProgress(current, total, msg)
+ self.assertEqual(event.msg, msg + ": %s/%s" % (current, total))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ConfigParsed(self):
+ """ Test the ConfigParsed class """
+ event = bb.event.ConfigParsed()
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_MultiConfigParsed(self):
+ """ Test MultiConfigParsed event class """
+ mcdata = {"foobar": "Foo Bar"}
+ event = bb.event.MultiConfigParsed(mcdata)
+ self.assertEqual(event.mcdata, mcdata)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_RecipeEvent(self):
+ """ Test RecipeEvent event base class """
+ callback = lambda a: 2 * a
+ event = bb.event.RecipeEvent(callback)
+ self.assertEqual(event.fn(1), callback(1))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_RecipePreFinalise(self):
+ """ Test RecipePreFinalise event class """
+ callback = lambda a: 2 * a
+ event = bb.event.RecipePreFinalise(callback)
+ self.assertEqual(event.fn(1), callback(1))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_RecipeTaskPreProcess(self):
+ """ Test RecipeTaskPreProcess event class """
+ callback = lambda a: 2 * a
+ tasklist = [("foobar", callback)]
+ event = bb.event.RecipeTaskPreProcess(callback, tasklist)
+ self.assertEqual(event.fn(1), callback(1))
+ self.assertEqual(event.tasklist, tasklist)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_RecipeParsed(self):
+ """ Test RecipeParsed event base class """
+ callback = lambda a: 2 * a
+ event = bb.event.RecipeParsed(callback)
+ self.assertEqual(event.fn(1), callback(1))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_StampUpdate(self):
+ targets = ["foo", "bar"]
+ stampfns = [lambda:"foobar"]
+ event = bb.event.StampUpdate(targets, stampfns)
+ self.assertEqual(event.targets, targets)
+ self.assertEqual(event.stampPrefix, stampfns)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_BuildBase(self):
+ """ Test base class for bitbake build events """
+ name = "foo"
+ pkgs = ["bar"]
+ failures = 123
+ event = bb.event.BuildBase(name, pkgs, failures)
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), failures)
+ name = event.name = "bar"
+ pkgs = event.pkgs = ["foo"]
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), failures)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_BuildInit(self):
+ """ Test class for bitbake build invocation events """
+ event = bb.event.BuildInit()
+ self.assertEqual(event.name, None)
+ self.assertEqual(event.pkgs, [])
+ self.assertEqual(event.getFailures(), 0)
+ name = event.name = "bar"
+ pkgs = event.pkgs = ["foo"]
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), 0)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_BuildStarted(self):
+ """ Test class for build started events """
+ name = "foo"
+ pkgs = ["bar"]
+ failures = 123
+ event = bb.event.BuildStarted(name, pkgs, failures)
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), failures)
+ self.assertEqual(event.msg, "Building Started")
+ name = event.name = "bar"
+ pkgs = event.pkgs = ["foo"]
+ msg = event.msg = "foobar"
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), failures)
+ self.assertEqual(event.msg, msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_BuildCompleted(self):
+ """ Test class for build completed events """
+ total = 1000
+ name = "foo"
+ pkgs = ["bar"]
+ failures = 123
+ interrupted = 1
+ event = bb.event.BuildCompleted(total, name, pkgs, failures,
+ interrupted)
+ self.assertEqual(event.name, name)
+ self.assertEqual(event.pkgs, pkgs)
+ self.assertEqual(event.getFailures(), failures)
+ self.assertEqual(event.msg, "Building Failed")
+ event2 = bb.event.BuildCompleted(total, name, pkgs)
+ self.assertEqual(event2.name, name)
+ self.assertEqual(event2.pkgs, pkgs)
+ self.assertEqual(event2.getFailures(), 0)
+ self.assertEqual(event2.msg, "Building Succeeded")
+ self.assertEqual(event2.pid, EventClassesTest._worker_pid)
+
+ def test_DiskFull(self):
+ """ Test DiskFull event class """
+ dev = "/dev/foo"
+ type = "ext4"
+ freespace = "104M"
+ mountpoint = "/"
+ event = bb.event.DiskFull(dev, type, freespace, mountpoint)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_MonitorDiskEvent(self):
+ """ Test MonitorDiskEvent class """
+ available_bytes = 10000000
+ free_bytes = 90000000
+ total_bytes = 1000000000
+ du = bb.event.DiskUsageSample(available_bytes, free_bytes,
+ total_bytes)
+ event = bb.event.MonitorDiskEvent(du)
+ self.assertEqual(event.disk_usage.available_bytes, available_bytes)
+ self.assertEqual(event.disk_usage.free_bytes, free_bytes)
+ self.assertEqual(event.disk_usage.total_bytes, total_bytes)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_NoProvider(self):
+ """ Test NoProvider event class """
+ item = "foobar"
+ event1 = bb.event.NoProvider(item)
+ self.assertEqual(event1.getItem(), item)
+ self.assertEqual(event1.isRuntime(), False)
+ self.assertEqual(str(event1), "Nothing PROVIDES 'foobar'")
+ runtime = True
+ dependees = ["foo", "bar"]
+ reasons = None
+ close_matches = ["foibar", "footbar"]
+ event2 = bb.event.NoProvider(item, runtime, dependees, reasons,
+ close_matches)
+ self.assertEqual(event2.isRuntime(), True)
+ expected = ("Nothing RPROVIDES 'foobar' (but foo, bar RDEPENDS"
+ " on or otherwise requires it). Close matches:\n"
+ " foibar\n"
+ " footbar")
+ self.assertEqual(str(event2), expected)
+ reasons = ["Item does not exist on database"]
+ close_matches = ["foibar", "footbar"]
+ event3 = bb.event.NoProvider(item, runtime, dependees, reasons,
+ close_matches)
+ expected = ("Nothing RPROVIDES 'foobar' (but foo, bar RDEPENDS"
+ " on or otherwise requires it)\n"
+ "Item does not exist on database")
+ self.assertEqual(str(event3), expected)
+ self.assertEqual(event3.pid, EventClassesTest._worker_pid)
+
+ def test_MultipleProviders(self):
+ """ Test MultipleProviders event class """
+ item = "foobar"
+ candidates = ["foobarv1", "foobars"]
+ event1 = bb.event.MultipleProviders(item, candidates)
+ self.assertEqual(event1.isRuntime(), False)
+ self.assertEqual(event1.getItem(), item)
+ self.assertEqual(event1.getCandidates(), candidates)
+ expected = ("Multiple providers are available for foobar (foobarv1,"
+ " foobars)\n"
+ "Consider defining a PREFERRED_PROVIDER entry to match "
+ "foobar")
+ self.assertEqual(str(event1), expected)
+ runtime = True
+ event2 = bb.event.MultipleProviders(item, candidates, runtime)
+ self.assertEqual(event2.isRuntime(), runtime)
+ expected = ("Multiple providers are available for runtime foobar "
+ "(foobarv1, foobars)\n"
+ "Consider defining a PREFERRED_RPROVIDER entry to match "
+ "foobar")
+ self.assertEqual(str(event2), expected)
+ self.assertEqual(event2.pid, EventClassesTest._worker_pid)
+
+ def test_ParseStarted(self):
+ """ Test ParseStarted event class """
+ total = 123
+ event = bb.event.ParseStarted(total)
+ self.assertEqual(event.msg, "Recipe parsing Started")
+ self.assertEqual(event.total, total)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ParseCompleted(self):
+ """ Test ParseCompleted event class """
+ cached = 10
+ parsed = 13
+ skipped = 7
+ virtuals = 2
+ masked = 1
+ errors = 0
+ total = 23
+ event = bb.event.ParseCompleted(cached, parsed, skipped, masked,
+ virtuals, errors, total)
+ self.assertEqual(event.msg, "Recipe parsing Completed")
+ expected = [cached, parsed, skipped, virtuals, masked, errors,
+ cached + parsed, total]
+ actual = [event.cached, event.parsed, event.skipped, event.virtuals,
+ event.masked, event.errors, event.sofar, event.total]
+ self.assertEqual(str(actual), str(expected))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ParseProgress(self):
+ """ Test ParseProgress event class """
+ current = 10
+ total = 100
+ event = bb.event.ParseProgress(current, total)
+ self.assertEqual(event.msg,
+ "Recipe parsing" + ": %s/%s" % (current, total))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_CacheLoadStarted(self):
+ """ Test CacheLoadStarted event class """
+ total = 123
+ event = bb.event.CacheLoadStarted(total)
+ self.assertEqual(event.msg, "Loading cache Started")
+ self.assertEqual(event.total, total)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_CacheLoadProgress(self):
+ """ Test CacheLoadProgress event class """
+ current = 10
+ total = 100
+ event = bb.event.CacheLoadProgress(current, total)
+ self.assertEqual(event.msg,
+ "Loading cache" + ": %s/%s" % (current, total))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_CacheLoadCompleted(self):
+ """ Test CacheLoadCompleted event class """
+ total = 23
+ num_entries = 12
+ event = bb.event.CacheLoadCompleted(total, num_entries)
+ self.assertEqual(event.msg, "Loading cache Completed")
+ expected = [total, num_entries]
+ actual = [event.total, event.num_entries]
+ self.assertEqual(str(actual), str(expected))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_TreeDataPreparationStarted(self):
+ """ Test TreeDataPreparationStarted event class """
+ event = bb.event.TreeDataPreparationStarted()
+ self.assertEqual(event.msg, "Preparing tree data Started")
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_TreeDataPreparationProgress(self):
+ """ Test TreeDataPreparationProgress event class """
+ current = 10
+ total = 100
+ event = bb.event.TreeDataPreparationProgress(current, total)
+ self.assertEqual(event.msg,
+ "Preparing tree data" + ": %s/%s" % (current, total))
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_TreeDataPreparationCompleted(self):
+ """ Test TreeDataPreparationCompleted event class """
+ total = 23
+ event = bb.event.TreeDataPreparationCompleted(total)
+ self.assertEqual(event.msg, "Preparing tree data Completed")
+ self.assertEqual(event.total, total)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_DepTreeGenerated(self):
+ """ Test DepTreeGenerated event class """
+ depgraph = Mock()
+ event = bb.event.DepTreeGenerated(depgraph)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_TargetsTreeGenerated(self):
+ """ Test TargetsTreeGenerated event class """
+ model = Mock()
+ event = bb.event.TargetsTreeGenerated(model)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ReachableStamps(self):
+ """ Test ReachableStamps event class """
+ stamps = [Mock(), Mock()]
+ event = bb.event.ReachableStamps(stamps)
+ self.assertEqual(event.stamps, stamps)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_FilesMatchingFound(self):
+ """ Test FilesMatchingFound event class """
+ pattern = "foo.*bar"
+ matches = ["foobar"]
+ event = bb.event.FilesMatchingFound(pattern, matches)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ConfigFilesFound(self):
+ """ Test ConfigFilesFound event class """
+ variable = "FOO_BAR"
+ values = ["foo", "bar"]
+ event = bb.event.ConfigFilesFound(variable, values)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ConfigFilePathFound(self):
+ """ Test ConfigFilePathFound event class """
+ path = "/foo/bar"
+ event = bb.event.ConfigFilePathFound(path)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_message_classes(self):
+ """ Test message event classes """
+ msg = "foobar foo bar"
+ event = bb.event.MsgBase(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgDebug(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgNote(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgWarn(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgError(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgFatal(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+ event = bb.event.MsgPlain(msg)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_LogExecTTY(self):
+ """ Test LogExecTTY event class """
+ msg = "foo bar"
+ prog = "foo.sh"
+ sleep_delay = 10
+ retries = 3
+ event = bb.event.LogExecTTY(msg, prog, sleep_delay, retries)
+ self.assertEqual(event.msg, msg)
+ self.assertEqual(event.prog, prog)
+ self.assertEqual(event.sleep_delay, sleep_delay)
+ self.assertEqual(event.retries, retries)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def _throw_zero_division_exception(self):
+ a = 1 / 0
+ return
+
+ def _worker_handler(self, event, d):
+ self._returned_event = event
+ return
+
+ def test_LogHandler(self):
+ """ Test LogHandler class """
+ logger = logging.getLogger("TestEventClasses")
+ logger.propagate = False
+ handler = bb.event.LogHandler(logging.INFO)
+ logger.addHandler(handler)
+ bb.event.worker_fire = self._worker_handler
+ try:
+ self._throw_zero_division_exception()
+ except ZeroDivisionError as ex:
+ logger.exception(ex)
+ event = self._returned_event
+ try:
+ pe = pickle.dumps(event)
+ newevent = pickle.loads(pe)
+ except:
+ self.fail('Logged event is not serializable')
+ self.assertEqual(event.taskpid, EventClassesTest._worker_pid)
+
+ def test_MetadataEvent(self):
+ """ Test MetadataEvent class """
+ eventtype = "footype"
+ eventdata = {"foo": "bar"}
+ event = bb.event.MetadataEvent(eventtype, eventdata)
+ self.assertEqual(event.type, eventtype)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ProcessStarted(self):
+ """ Test ProcessStarted class """
+ processname = "foo"
+ total = 9783128974
+ event = bb.event.ProcessStarted(processname, total)
+ self.assertEqual(event.processname, processname)
+ self.assertEqual(event.total, total)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ProcessProgress(self):
+ """ Test ProcessProgress class """
+ processname = "foo"
+ progress = 243224
+ event = bb.event.ProcessProgress(processname, progress)
+ self.assertEqual(event.processname, processname)
+ self.assertEqual(event.progress, progress)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_ProcessFinished(self):
+ """ Test ProcessFinished class """
+ processname = "foo"
+ total = 1242342344
+ event = bb.event.ProcessFinished(processname)
+ self.assertEqual(event.processname, processname)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_SanityCheck(self):
+ """ Test SanityCheck class """
+ event1 = bb.event.SanityCheck()
+ self.assertEqual(event1.generateevents, True)
+ self.assertEqual(event1.pid, EventClassesTest._worker_pid)
+ generateevents = False
+ event2 = bb.event.SanityCheck(generateevents)
+ self.assertEqual(event2.generateevents, generateevents)
+ self.assertEqual(event2.pid, EventClassesTest._worker_pid)
+
+ def test_SanityCheckPassed(self):
+ """ Test SanityCheckPassed class """
+ event = bb.event.SanityCheckPassed()
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
+
+ def test_SanityCheckFailed(self):
+ """ Test SanityCheckFailed class """
+ msg = "The sanity test failed."
+ event1 = bb.event.SanityCheckFailed(msg)
+ self.assertEqual(event1.pid, EventClassesTest._worker_pid)
+ network_error = True
+ event2 = bb.event.SanityCheckFailed(msg, network_error)
+ self.assertEqual(event2.pid, EventClassesTest._worker_pid)
+
+ def test_network_event_classes(self):
+ """ Test network event classes """
+ event1 = bb.event.NetworkTest()
+ generateevents = False
+ self.assertEqual(event1.pid, EventClassesTest._worker_pid)
+ event2 = bb.event.NetworkTest(generateevents)
+ self.assertEqual(event2.pid, EventClassesTest._worker_pid)
+ event3 = bb.event.NetworkTestPassed()
+ self.assertEqual(event3.pid, EventClassesTest._worker_pid)
+ event4 = bb.event.NetworkTestFailed()
+ self.assertEqual(event4.pid, EventClassesTest._worker_pid)
+
+ def test_FindSigInfoResult(self):
+ """ Test FindSigInfoResult event class """
+ result = [Mock()]
+ event = bb.event.FindSigInfoResult(result)
+ self.assertEqual(event.result, result)
+ self.assertEqual(event.pid, EventClassesTest._worker_pid)
diff --git a/poky/bitbake/lib/bb/tests/fetch.py b/poky/bitbake/lib/bb/tests/fetch.py
new file mode 100644
index 000000000..74859f9d3
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/fetch.py
@@ -0,0 +1,1573 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Tests for the Fetcher (fetch2/)
+#
+# Copyright (C) 2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import hashlib
+import tempfile
+import subprocess
+import collections
+import os
+from bb.fetch2 import URI
+from bb.fetch2 import FetchMethod
+import bb
+
+def skipIfNoNetwork():
+ if os.environ.get("BB_SKIP_NETTESTS") == "yes":
+ return unittest.skip("Network tests being skipped")
+ return lambda f: f
+
+class URITest(unittest.TestCase):
+ test_uris = {
+ "http://www.google.com/index.html" : {
+ 'uri': 'http://www.google.com/index.html',
+ 'scheme': 'http',
+ 'hostname': 'www.google.com',
+ 'port': None,
+ 'hostport': 'www.google.com',
+ 'path': '/index.html',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': False
+ },
+ "http://www.google.com/index.html;param1=value1" : {
+ 'uri': 'http://www.google.com/index.html;param1=value1',
+ 'scheme': 'http',
+ 'hostname': 'www.google.com',
+ 'port': None,
+ 'hostport': 'www.google.com',
+ 'path': '/index.html',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {
+ 'param1': 'value1'
+ },
+ 'query': {},
+ 'relative': False
+ },
+ "http://www.example.org/index.html?param1=value1" : {
+ 'uri': 'http://www.example.org/index.html?param1=value1',
+ 'scheme': 'http',
+ 'hostname': 'www.example.org',
+ 'port': None,
+ 'hostport': 'www.example.org',
+ 'path': '/index.html',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {
+ 'param1': 'value1'
+ },
+ 'relative': False
+ },
+ "http://www.example.org/index.html?qparam1=qvalue1;param2=value2" : {
+ 'uri': 'http://www.example.org/index.html?qparam1=qvalue1;param2=value2',
+ 'scheme': 'http',
+ 'hostname': 'www.example.org',
+ 'port': None,
+ 'hostport': 'www.example.org',
+ 'path': '/index.html',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {
+ 'param2': 'value2'
+ },
+ 'query': {
+ 'qparam1': 'qvalue1'
+ },
+ 'relative': False
+ },
+ "http://www.example.com:8080/index.html" : {
+ 'uri': 'http://www.example.com:8080/index.html',
+ 'scheme': 'http',
+ 'hostname': 'www.example.com',
+ 'port': 8080,
+ 'hostport': 'www.example.com:8080',
+ 'path': '/index.html',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': False
+ },
+ "cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg" : {
+ 'uri': 'cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg',
+ 'scheme': 'cvs',
+ 'hostname': 'cvs.handhelds.org',
+ 'port': None,
+ 'hostport': 'cvs.handhelds.org',
+ 'path': '/cvs',
+ 'userinfo': 'anoncvs',
+ 'username': 'anoncvs',
+ 'password': '',
+ 'params': {
+ 'module': 'familiar/dist/ipkg'
+ },
+ 'query': {},
+ 'relative': False
+ },
+ "cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg": {
+ 'uri': 'cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg',
+ 'scheme': 'cvs',
+ 'hostname': 'cvs.handhelds.org',
+ 'port': None,
+ 'hostport': 'cvs.handhelds.org',
+ 'path': '/cvs',
+ 'userinfo': 'anoncvs:anonymous',
+ 'username': 'anoncvs',
+ 'password': 'anonymous',
+ 'params': collections.OrderedDict([
+ ('tag', 'V0-99-81'),
+ ('module', 'familiar/dist/ipkg')
+ ]),
+ 'query': {},
+ 'relative': False
+ },
+ "file://example.diff": { # NOTE: Not RFC compliant!
+ 'uri': 'file:example.diff',
+ 'scheme': 'file',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': 'example.diff',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': True
+ },
+ "file:example.diff": { # NOTE: RFC compliant version of the former
+ 'uri': 'file:example.diff',
+ 'scheme': 'file',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': 'example.diff',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': True
+ },
+ "file:///tmp/example.diff": {
+ 'uri': 'file:///tmp/example.diff',
+ 'scheme': 'file',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': '/tmp/example.diff',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': False
+ },
+ "git:///path/example.git": {
+ 'uri': 'git:///path/example.git',
+ 'scheme': 'git',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': '/path/example.git',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': False
+ },
+ "git:path/example.git": {
+ 'uri': 'git:path/example.git',
+ 'scheme': 'git',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': 'path/example.git',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': True
+ },
+ "git://example.net/path/example.git": {
+ 'uri': 'git://example.net/path/example.git',
+ 'scheme': 'git',
+ 'hostname': 'example.net',
+ 'port': None,
+ 'hostport': 'example.net',
+ 'path': '/path/example.git',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {},
+ 'query': {},
+ 'relative': False
+ },
+ "http://somesite.net;someparam=1": {
+ 'uri': 'http://somesite.net;someparam=1',
+ 'scheme': 'http',
+ 'hostname': 'somesite.net',
+ 'port': None,
+ 'hostport': 'somesite.net',
+ 'path': '',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {"someparam" : "1"},
+ 'query': {},
+ 'relative': False
+ },
+ "file://somelocation;someparam=1": {
+ 'uri': 'file:somelocation;someparam=1',
+ 'scheme': 'file',
+ 'hostname': '',
+ 'port': None,
+ 'hostport': '',
+ 'path': 'somelocation',
+ 'userinfo': '',
+ 'userinfo': '',
+ 'username': '',
+ 'password': '',
+ 'params': {"someparam" : "1"},
+ 'query': {},
+ 'relative': True
+ }
+
+ }
+
+ def test_uri(self):
+ for test_uri, ref in self.test_uris.items():
+ uri = URI(test_uri)
+
+ self.assertEqual(str(uri), ref['uri'])
+
+ # expected attributes
+ self.assertEqual(uri.scheme, ref['scheme'])
+
+ self.assertEqual(uri.userinfo, ref['userinfo'])
+ self.assertEqual(uri.username, ref['username'])
+ self.assertEqual(uri.password, ref['password'])
+
+ self.assertEqual(uri.hostname, ref['hostname'])
+ self.assertEqual(uri.port, ref['port'])
+ self.assertEqual(uri.hostport, ref['hostport'])
+
+ self.assertEqual(uri.path, ref['path'])
+ self.assertEqual(uri.params, ref['params'])
+
+ self.assertEqual(uri.relative, ref['relative'])
+
+ def test_dict(self):
+ for test in self.test_uris.values():
+ uri = URI()
+
+ self.assertEqual(uri.scheme, '')
+ self.assertEqual(uri.userinfo, '')
+ self.assertEqual(uri.username, '')
+ self.assertEqual(uri.password, '')
+ self.assertEqual(uri.hostname, '')
+ self.assertEqual(uri.port, None)
+ self.assertEqual(uri.path, '')
+ self.assertEqual(uri.params, {})
+
+
+ uri.scheme = test['scheme']
+ self.assertEqual(uri.scheme, test['scheme'])
+
+ uri.userinfo = test['userinfo']
+ self.assertEqual(uri.userinfo, test['userinfo'])
+ self.assertEqual(uri.username, test['username'])
+ self.assertEqual(uri.password, test['password'])
+
+ # make sure changing the values doesn't do anything unexpected
+ uri.username = 'changeme'
+ self.assertEqual(uri.username, 'changeme')
+ self.assertEqual(uri.password, test['password'])
+ uri.password = 'insecure'
+ self.assertEqual(uri.username, 'changeme')
+ self.assertEqual(uri.password, 'insecure')
+
+ # reset back after our trickery
+ uri.userinfo = test['userinfo']
+ self.assertEqual(uri.userinfo, test['userinfo'])
+ self.assertEqual(uri.username, test['username'])
+ self.assertEqual(uri.password, test['password'])
+
+ uri.hostname = test['hostname']
+ self.assertEqual(uri.hostname, test['hostname'])
+ self.assertEqual(uri.hostport, test['hostname'])
+
+ uri.port = test['port']
+ self.assertEqual(uri.port, test['port'])
+ self.assertEqual(uri.hostport, test['hostport'])
+
+ uri.path = test['path']
+ self.assertEqual(uri.path, test['path'])
+
+ uri.params = test['params']
+ self.assertEqual(uri.params, test['params'])
+
+ uri.query = test['query']
+ self.assertEqual(uri.query, test['query'])
+
+ self.assertEqual(str(uri), test['uri'])
+
+ uri.params = {}
+ self.assertEqual(uri.params, {})
+ self.assertEqual(str(uri), (str(uri).split(";"))[0])
+
+class FetcherTest(unittest.TestCase):
+
+ def setUp(self):
+ self.origdir = os.getcwd()
+ self.d = bb.data.init()
+ self.tempdir = tempfile.mkdtemp()
+ self.dldir = os.path.join(self.tempdir, "download")
+ os.mkdir(self.dldir)
+ self.d.setVar("DL_DIR", self.dldir)
+ self.unpackdir = os.path.join(self.tempdir, "unpacked")
+ os.mkdir(self.unpackdir)
+ persistdir = os.path.join(self.tempdir, "persistdata")
+ self.d.setVar("PERSISTENT_DIR", persistdir)
+
+ def tearDown(self):
+ os.chdir(self.origdir)
+ if os.environ.get("BB_TMPDIR_NOCLEAN") == "yes":
+ print("Not cleaning up %s. Please remove manually." % self.tempdir)
+ else:
+ bb.utils.prunedir(self.tempdir)
+
+class MirrorUriTest(FetcherTest):
+
+ replaceuris = {
+ ("git://git.invalid.infradead.org/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/.*", "http://somewhere.org/somedir/")
+ : "http://somewhere.org/somedir/git2_git.invalid.infradead.org.mtd-utils.git.tar.gz",
+ ("git://git.invalid.infradead.org/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/([^/]+/)*([^/]*)", "git://somewhere.org/somedir/\\2;protocol=http")
+ : "git://somewhere.org/somedir/mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+ ("git://git.invalid.infradead.org/foo/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/([^/]+/)*([^/]*)", "git://somewhere.org/somedir/\\2;protocol=http")
+ : "git://somewhere.org/somedir/mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+ ("git://git.invalid.infradead.org/foo/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/([^/]+/)*([^/]*)", "git://somewhere.org/\\2;protocol=http")
+ : "git://somewhere.org/mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+ ("git://someserver.org/bitbake;tag=1234567890123456789012345678901234567890", "git://someserver.org/bitbake", "git://git.openembedded.org/bitbake")
+ : "git://git.openembedded.org/bitbake;tag=1234567890123456789012345678901234567890",
+ ("file://sstate-xyz.tgz", "file://.*", "file:///somewhere/1234/sstate-cache")
+ : "file:///somewhere/1234/sstate-cache/sstate-xyz.tgz",
+ ("file://sstate-xyz.tgz", "file://.*", "file:///somewhere/1234/sstate-cache/")
+ : "file:///somewhere/1234/sstate-cache/sstate-xyz.tgz",
+ ("http://somewhere.org/somedir1/somedir2/somefile_1.2.3.tar.gz", "http://.*/.*", "http://somewhere2.org/somedir3")
+ : "http://somewhere2.org/somedir3/somefile_1.2.3.tar.gz",
+ ("http://somewhere.org/somedir1/somefile_1.2.3.tar.gz", "http://somewhere.org/somedir1/somefile_1.2.3.tar.gz", "http://somewhere2.org/somedir3/somefile_1.2.3.tar.gz")
+ : "http://somewhere2.org/somedir3/somefile_1.2.3.tar.gz",
+ ("http://www.apache.org/dist/subversion/subversion-1.7.1.tar.bz2", "http://www.apache.org/dist", "http://archive.apache.org/dist")
+ : "http://archive.apache.org/dist/subversion/subversion-1.7.1.tar.bz2",
+ ("http://www.apache.org/dist/subversion/subversion-1.7.1.tar.bz2", "http://.*/.*", "file:///somepath/downloads/")
+ : "file:///somepath/downloads/subversion-1.7.1.tar.bz2",
+ ("git://git.invalid.infradead.org/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/.*", "git://somewhere.org/somedir/BASENAME;protocol=http")
+ : "git://somewhere.org/somedir/mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+ ("git://git.invalid.infradead.org/foo/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/.*", "git://somewhere.org/somedir/BASENAME;protocol=http")
+ : "git://somewhere.org/somedir/mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+ ("git://git.invalid.infradead.org/foo/mtd-utils.git;tag=1234567890123456789012345678901234567890", "git://.*/.*", "git://somewhere.org/somedir/MIRRORNAME;protocol=http")
+ : "git://somewhere.org/somedir/git.invalid.infradead.org.foo.mtd-utils.git;tag=1234567890123456789012345678901234567890;protocol=http",
+
+ #Renaming files doesn't work
+ #("http://somewhere.org/somedir1/somefile_1.2.3.tar.gz", "http://somewhere.org/somedir1/somefile_1.2.3.tar.gz", "http://somewhere2.org/somedir3/somefile_2.3.4.tar.gz") : "http://somewhere2.org/somedir3/somefile_2.3.4.tar.gz"
+ #("file://sstate-xyz.tgz", "file://.*/.*", "file:///somewhere/1234/sstate-cache") : "file:///somewhere/1234/sstate-cache/sstate-xyz.tgz",
+ }
+
+ mirrorvar = "http://.*/.* file:///somepath/downloads/ \n" \
+ "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n" \
+ "https://.*/.* file:///someotherpath/downloads/ \n" \
+ "http://.*/.* file:///someotherpath/downloads/ \n"
+
+ def test_urireplace(self):
+ for k, v in self.replaceuris.items():
+ ud = bb.fetch.FetchData(k[0], self.d)
+ ud.setup_localpath(self.d)
+ mirrors = bb.fetch2.mirror_from_string("%s %s" % (k[1], k[2]))
+ newuris, uds = bb.fetch2.build_mirroruris(ud, mirrors, self.d)
+ self.assertEqual([v], newuris)
+
+ def test_urilist1(self):
+ fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+ mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
+ uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+ self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz', 'file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
+
+ def test_urilist2(self):
+ # Catch https:// -> files:// bug
+ fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+ mirrors = bb.fetch2.mirror_from_string(self.mirrorvar)
+ uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+ self.assertEqual(uris, ['file:///someotherpath/downloads/bitbake-1.0.tar.gz'])
+
+ def test_mirror_of_mirror(self):
+ # Test if mirror of a mirror works
+ mirrorvar = self.mirrorvar + " http://.*/.* http://otherdownloads.yoctoproject.org/downloads/ \n"
+ mirrorvar = mirrorvar + " http://otherdownloads.yoctoproject.org/.* http://downloads2.yoctoproject.org/downloads/ \n"
+ fetcher = bb.fetch.FetchData("http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+ mirrors = bb.fetch2.mirror_from_string(mirrorvar)
+ uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+ self.assertEqual(uris, ['file:///somepath/downloads/bitbake-1.0.tar.gz',
+ 'file:///someotherpath/downloads/bitbake-1.0.tar.gz',
+ 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz',
+ 'http://downloads2.yoctoproject.org/downloads/bitbake-1.0.tar.gz'])
+
+ recmirrorvar = "https://.*/[^/]* http://AAAA/A/A/A/ \n" \
+ "https://.*/[^/]* https://BBBB/B/B/B/ \n"
+
+ def test_recursive(self):
+ fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d)
+ mirrors = bb.fetch2.mirror_from_string(self.recmirrorvar)
+ uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d)
+ self.assertEqual(uris, ['http://AAAA/A/A/A/bitbake/bitbake-1.0.tar.gz',
+ 'https://BBBB/B/B/B/bitbake/bitbake-1.0.tar.gz',
+ 'http://AAAA/A/A/A/B/B/bitbake/bitbake-1.0.tar.gz'])
+
+class FetcherLocalTest(FetcherTest):
+ def setUp(self):
+ def touch(fn):
+ with open(fn, 'a'):
+ os.utime(fn, None)
+
+ super(FetcherLocalTest, self).setUp()
+ self.localsrcdir = os.path.join(self.tempdir, 'localsrc')
+ os.makedirs(self.localsrcdir)
+ touch(os.path.join(self.localsrcdir, 'a'))
+ touch(os.path.join(self.localsrcdir, 'b'))
+ os.makedirs(os.path.join(self.localsrcdir, 'dir'))
+ touch(os.path.join(self.localsrcdir, 'dir', 'c'))
+ touch(os.path.join(self.localsrcdir, 'dir', 'd'))
+ os.makedirs(os.path.join(self.localsrcdir, 'dir', 'subdir'))
+ touch(os.path.join(self.localsrcdir, 'dir', 'subdir', 'e'))
+ self.d.setVar("FILESPATH", self.localsrcdir)
+
+ def fetchUnpack(self, uris):
+ fetcher = bb.fetch.Fetch(uris, self.d)
+ fetcher.download()
+ fetcher.unpack(self.unpackdir)
+ flst = []
+ for root, dirs, files in os.walk(self.unpackdir):
+ for f in files:
+ flst.append(os.path.relpath(os.path.join(root, f), self.unpackdir))
+ flst.sort()
+ return flst
+
+ def test_local(self):
+ tree = self.fetchUnpack(['file://a', 'file://dir/c'])
+ self.assertEqual(tree, ['a', 'dir/c'])
+
+ def test_local_wildcard(self):
+ tree = self.fetchUnpack(['file://a', 'file://dir/*'])
+ self.assertEqual(tree, ['a', 'dir/c', 'dir/d', 'dir/subdir/e'])
+
+ def test_local_dir(self):
+ tree = self.fetchUnpack(['file://a', 'file://dir'])
+ self.assertEqual(tree, ['a', 'dir/c', 'dir/d', 'dir/subdir/e'])
+
+ def test_local_subdir(self):
+ tree = self.fetchUnpack(['file://dir/subdir'])
+ self.assertEqual(tree, ['dir/subdir/e'])
+
+ def test_local_subdir_file(self):
+ tree = self.fetchUnpack(['file://dir/subdir/e'])
+ self.assertEqual(tree, ['dir/subdir/e'])
+
+ def test_local_subdirparam(self):
+ tree = self.fetchUnpack(['file://a;subdir=bar', 'file://dir;subdir=foo/moo'])
+ self.assertEqual(tree, ['bar/a', 'foo/moo/dir/c', 'foo/moo/dir/d', 'foo/moo/dir/subdir/e'])
+
+ def test_local_deepsubdirparam(self):
+ tree = self.fetchUnpack(['file://dir/subdir/e;subdir=bar'])
+ self.assertEqual(tree, ['bar/dir/subdir/e'])
+
+ def test_local_absolutedir(self):
+ # Unpacking to an absolute path that is a subdirectory of the root
+ # should work
+ tree = self.fetchUnpack(['file://a;subdir=%s' % os.path.join(self.unpackdir, 'bar')])
+
+ # Unpacking to an absolute path outside of the root should fail
+ with self.assertRaises(bb.fetch2.UnpackError):
+ self.fetchUnpack(['file://a;subdir=/bin/sh'])
+
+class FetcherNoNetworkTest(FetcherTest):
+ def setUp(self):
+ super().setUp()
+ # all test cases are based on not having network
+ self.d.setVar("BB_NO_NETWORK", "1")
+
+ def test_missing(self):
+ string = "this is a test file\n".encode("utf-8")
+ self.d.setVarFlag("SRC_URI", "md5sum", hashlib.md5(string).hexdigest())
+ self.d.setVarFlag("SRC_URI", "sha256sum", hashlib.sha256(string).hexdigest())
+
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ with self.assertRaises(bb.fetch2.NetworkAccess):
+ fetcher.download()
+
+ def test_valid_missing_donestamp(self):
+ # create the file in the download directory with correct hash
+ string = "this is a test file\n".encode("utf-8")
+ with open(os.path.join(self.dldir, "test-file.tar.gz"), "wb") as f:
+ f.write(string)
+
+ self.d.setVarFlag("SRC_URI", "md5sum", hashlib.md5(string).hexdigest())
+ self.d.setVarFlag("SRC_URI", "sha256sum", hashlib.sha256(string).hexdigest())
+
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ fetcher.download()
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+
+ def test_invalid_missing_donestamp(self):
+ # create an invalid file in the download directory with incorrect hash
+ string = "this is a test file\n".encode("utf-8")
+ with open(os.path.join(self.dldir, "test-file.tar.gz"), "wb"):
+ pass
+
+ self.d.setVarFlag("SRC_URI", "md5sum", hashlib.md5(string).hexdigest())
+ self.d.setVarFlag("SRC_URI", "sha256sum", hashlib.sha256(string).hexdigest())
+
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ with self.assertRaises(bb.fetch2.NetworkAccess):
+ fetcher.download()
+ # the existing file should not exist or should have be moved to "bad-checksum"
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+
+ def test_nochecksums_missing(self):
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ # ssh fetch does not support checksums
+ fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ # attempts to download with missing donestamp
+ with self.assertRaises(bb.fetch2.NetworkAccess):
+ fetcher.download()
+
+ def test_nochecksums_missing_donestamp(self):
+ # create a file in the download directory
+ with open(os.path.join(self.dldir, "test-file.tar.gz"), "wb"):
+ pass
+
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ # ssh fetch does not support checksums
+ fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ # attempts to download with missing donestamp
+ with self.assertRaises(bb.fetch2.NetworkAccess):
+ fetcher.download()
+
+ def test_nochecksums_has_donestamp(self):
+ # create a file in the download directory with the donestamp
+ with open(os.path.join(self.dldir, "test-file.tar.gz"), "wb"):
+ pass
+ with open(os.path.join(self.dldir, "test-file.tar.gz.done"), "wb"):
+ pass
+
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ # ssh fetch does not support checksums
+ fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ # should not fetch
+ fetcher.download()
+ # both files should still exist
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+
+ def test_nochecksums_missing_has_donestamp(self):
+ # create a file in the download directory with the donestamp
+ with open(os.path.join(self.dldir, "test-file.tar.gz.done"), "wb"):
+ pass
+
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertTrue(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+ # ssh fetch does not support checksums
+ fetcher = bb.fetch.Fetch(["ssh://invalid@invalid.yoctoproject.org/test-file.tar.gz"], self.d)
+ with self.assertRaises(bb.fetch2.NetworkAccess):
+ fetcher.download()
+ # both files should still exist
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz")))
+ self.assertFalse(os.path.exists(os.path.join(self.dldir, "test-file.tar.gz.done")))
+
+class FetcherNetworkTest(FetcherTest):
+ @skipIfNoNetwork()
+ def test_fetch(self):
+ fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
+ fetcher.download()
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.1.tar.gz"), 57892)
+ self.d.setVar("BB_NO_NETWORK", "1")
+ fetcher = bb.fetch.Fetch(["http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", "http://downloads.yoctoproject.org/releases/bitbake/bitbake-1.1.tar.gz"], self.d)
+ fetcher.download()
+ fetcher.unpack(self.unpackdir)
+ self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.0/")), 9)
+ self.assertEqual(len(os.listdir(self.unpackdir + "/bitbake-1.1/")), 9)
+
+ @skipIfNoNetwork()
+ def test_fetch_mirror(self):
+ self.d.setVar("MIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
+ fetcher.download()
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+
+ @skipIfNoNetwork()
+ def test_fetch_mirror_of_mirror(self):
+ self.d.setVar("MIRRORS", "http://.*/.* http://invalid2.yoctoproject.org/ \n http://invalid2.yoctoproject.org/.* http://downloads.yoctoproject.org/releases/bitbake")
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
+ fetcher.download()
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+
+ @skipIfNoNetwork()
+ def test_fetch_file_mirror_of_mirror(self):
+ self.d.setVar("MIRRORS", "http://.*/.* file:///some1where/ \n file:///some1where/.* file://some2where/ \n file://some2where/.* http://downloads.yoctoproject.org/releases/bitbake")
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
+ os.mkdir(self.dldir + "/some2where")
+ fetcher.download()
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+
+ @skipIfNoNetwork()
+ def test_fetch_premirror(self):
+ self.d.setVar("PREMIRRORS", "http://.*/.* http://downloads.yoctoproject.org/releases/bitbake")
+ fetcher = bb.fetch.Fetch(["http://invalid.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz"], self.d)
+ fetcher.download()
+ self.assertEqual(os.path.getsize(self.dldir + "/bitbake-1.0.tar.gz"), 57749)
+
+ @skipIfNoNetwork()
+ def gitfetcher(self, url1, url2):
+ def checkrevision(self, fetcher):
+ fetcher.unpack(self.unpackdir)
+ revision = bb.process.run("git rev-parse HEAD", shell=True, cwd=self.unpackdir + "/git")[0].strip()
+ self.assertEqual(revision, "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
+
+ self.d.setVar("BB_GENERATE_MIRROR_TARBALLS", "1")
+ self.d.setVar("SRCREV", "270a05b0b4ba0959fe0624d2a4885d7b70426da5")
+ fetcher = bb.fetch.Fetch([url1], self.d)
+ fetcher.download()
+ checkrevision(self, fetcher)
+ # Wipe out the dldir clone and the unpacked source, turn off the network and check mirror tarball works
+ bb.utils.prunedir(self.dldir + "/git2/")
+ bb.utils.prunedir(self.unpackdir)
+ self.d.setVar("BB_NO_NETWORK", "1")
+ fetcher = bb.fetch.Fetch([url2], self.d)
+ fetcher.download()
+ checkrevision(self, fetcher)
+
+ @skipIfNoNetwork()
+ def test_gitfetch(self):
+ url1 = url2 = "git://git.openembedded.org/bitbake"
+ self.gitfetcher(url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_goodsrcrev(self):
+ # SRCREV is set but matches rev= parameter
+ url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
+ self.gitfetcher(url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_badsrcrev(self):
+ # SRCREV is set but does not match rev= parameter
+ url1 = url2 = "git://git.openembedded.org/bitbake;rev=dead05b0b4ba0959fe0624d2a4885d7b70426da5"
+ self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_tagandrev(self):
+ # SRCREV is set but does not match rev= parameter
+ url1 = url2 = "git://git.openembedded.org/bitbake;rev=270a05b0b4ba0959fe0624d2a4885d7b70426da5;tag=270a05b0b4ba0959fe0624d2a4885d7b70426da5"
+ self.assertRaises(bb.fetch.FetchError, self.gitfetcher, url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_localusehead(self):
+ # Create dummy local Git repo
+ src_dir = tempfile.mkdtemp(dir=self.tempdir,
+ prefix='gitfetch_localusehead_')
+ src_dir = os.path.abspath(src_dir)
+ bb.process.run("git init", cwd=src_dir)
+ bb.process.run("git commit --allow-empty -m'Dummy commit'",
+ cwd=src_dir)
+ # Use other branch than master
+ bb.process.run("git checkout -b my-devel", cwd=src_dir)
+ bb.process.run("git commit --allow-empty -m'Dummy commit 2'",
+ cwd=src_dir)
+ stdout = bb.process.run("git rev-parse HEAD", cwd=src_dir)
+ orig_rev = stdout[0].strip()
+
+ # Fetch and check revision
+ self.d.setVar("SRCREV", "AUTOINC")
+ url = "git://" + src_dir + ";protocol=file;usehead=1"
+ fetcher = bb.fetch.Fetch([url], self.d)
+ fetcher.download()
+ fetcher.unpack(self.unpackdir)
+ stdout = bb.process.run("git rev-parse HEAD",
+ cwd=os.path.join(self.unpackdir, 'git'))
+ unpack_rev = stdout[0].strip()
+ self.assertEqual(orig_rev, unpack_rev)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_remoteusehead(self):
+ url = "git://git.openembedded.org/bitbake;usehead=1"
+ self.assertRaises(bb.fetch.ParameterError, self.gitfetcher, url, url)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_premirror(self):
+ url1 = "git://git.openembedded.org/bitbake"
+ url2 = "git://someserver.org/bitbake"
+ self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
+ self.gitfetcher(url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_premirror2(self):
+ url1 = url2 = "git://someserver.org/bitbake"
+ self.d.setVar("PREMIRRORS", "git://someserver.org/bitbake git://git.openembedded.org/bitbake \n")
+ self.gitfetcher(url1, url2)
+
+ @skipIfNoNetwork()
+ def test_gitfetch_premirror3(self):
+ realurl = "git://git.openembedded.org/bitbake"
+ dummyurl = "git://someserver.org/bitbake"
+ self.sourcedir = self.unpackdir.replace("unpacked", "sourcemirror.git")
+ os.chdir(self.tempdir)
+ bb.process.run("git clone %s %s 2> /dev/null" % (realurl, self.sourcedir), shell=True)
+ self.d.setVar("PREMIRRORS", "%s git://%s;protocol=file \n" % (dummyurl, self.sourcedir))
+ self.gitfetcher(dummyurl, dummyurl)
+
+ @skipIfNoNetwork()
+ def test_git_submodule(self):
+ fetcher = bb.fetch.Fetch(["gitsm://git.yoctoproject.org/git-submodule-test;rev=f12e57f2edf0aa534cf1616fa983d165a92b0842"], self.d)
+ fetcher.download()
+ # Previous cwd has been deleted
+ os.chdir(os.path.dirname(self.unpackdir))
+ fetcher.unpack(self.unpackdir)
+
+
+class TrustedNetworksTest(FetcherTest):
+ def test_trusted_network(self):
+ # Ensure trusted_network returns False when the host IS in the list.
+ url = "git://Someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org someserver.org server2.org server3.org")
+ self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+ def test_wild_trusted_network(self):
+ # Ensure trusted_network returns true when the *.host IS in the list.
+ url = "git://Someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org *.someserver.org server2.org server3.org")
+ self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+ def test_prefix_wild_trusted_network(self):
+ # Ensure trusted_network returns true when the prefix matches *.host.
+ url = "git://git.Someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org *.someserver.org server2.org server3.org")
+ self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+ def test_two_prefix_wild_trusted_network(self):
+ # Ensure trusted_network returns true when the prefix matches *.host.
+ url = "git://something.git.Someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org *.someserver.org server2.org server3.org")
+ self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+ def test_port_trusted_network(self):
+ # Ensure trusted_network returns True, even if the url specifies a port.
+ url = "git://someserver.org:8080/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "someserver.org")
+ self.assertTrue(bb.fetch.trusted_network(self.d, url))
+
+ def test_untrusted_network(self):
+ # Ensure trusted_network returns False when the host is NOT in the list.
+ url = "git://someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org server2.org server3.org")
+ self.assertFalse(bb.fetch.trusted_network(self.d, url))
+
+ def test_wild_untrusted_network(self):
+ # Ensure trusted_network returns False when the host is NOT in the list.
+ url = "git://*.someserver.org/foo;rev=1"
+ self.d.setVar("BB_ALLOWED_NETWORKS", "server1.org server2.org server3.org")
+ self.assertFalse(bb.fetch.trusted_network(self.d, url))
+
+class URLHandle(unittest.TestCase):
+
+ datatable = {
+ "http://www.google.com/index.html" : ('http', 'www.google.com', '/index.html', '', '', {}),
+ "cvs://anoncvs@cvs.handhelds.org/cvs;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', '', {'module': 'familiar/dist/ipkg'}),
+ "cvs://anoncvs:anonymous@cvs.handhelds.org/cvs;tag=V0-99-81;module=familiar/dist/ipkg" : ('cvs', 'cvs.handhelds.org', '/cvs', 'anoncvs', 'anonymous', collections.OrderedDict([('tag', 'V0-99-81'), ('module', 'familiar/dist/ipkg')])),
+ "git://git.openembedded.org/bitbake;branch=@foo" : ('git', 'git.openembedded.org', '/bitbake', '', '', {'branch': '@foo'}),
+ "file://somelocation;someparam=1": ('file', '', 'somelocation', '', '', {'someparam': '1'}),
+ }
+ # we require a pathname to encodeurl but users can still pass such urls to
+ # decodeurl and we need to handle them
+ decodedata = datatable.copy()
+ decodedata.update({
+ "http://somesite.net;someparam=1": ('http', 'somesite.net', '', '', '', {'someparam': '1'}),
+ })
+
+ def test_decodeurl(self):
+ for k, v in self.decodedata.items():
+ result = bb.fetch.decodeurl(k)
+ self.assertEqual(result, v)
+
+ def test_encodeurl(self):
+ for k, v in self.datatable.items():
+ result = bb.fetch.encodeurl(v)
+ self.assertEqual(result, k)
+
+class FetchLatestVersionTest(FetcherTest):
+
+ test_git_uris = {
+ # version pattern "X.Y.Z"
+ ("mx-1.0", "git://github.com/clutter-project/mx.git;branch=mx-1.4", "9b1db6b8060bd00b121a692f942404a24ae2960f", "")
+ : "1.99.4",
+ # version pattern "vX.Y"
+ ("mtd-utils", "git://git.infradead.org/mtd-utils.git", "ca39eb1d98e736109c64ff9c1aa2a6ecca222d8f", "")
+ : "1.5.0",
+ # version pattern "pkg_name-X.Y"
+ ("presentproto", "git://anongit.freedesktop.org/git/xorg/proto/presentproto", "24f3a56e541b0a9e6c6ee76081f441221a120ef9", "")
+ : "1.0",
+ # version pattern "pkg_name-vX.Y.Z"
+ ("dtc", "git://git.qemu.org/dtc.git", "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf", "")
+ : "1.4.0",
+ # combination version pattern
+ ("sysprof", "git://git.gnome.org/sysprof", "cd44ee6644c3641507fb53b8a2a69137f2971219", "")
+ : "1.2.0",
+ ("u-boot-mkimage", "git://git.denx.de/u-boot.git;branch=master;protocol=git", "62c175fbb8a0f9a926c88294ea9f7e88eb898f6c", "")
+ : "2014.01",
+ # version pattern "yyyymmdd"
+ ("mobile-broadband-provider-info", "git://git.gnome.org/mobile-broadband-provider-info", "4ed19e11c2975105b71b956440acdb25d46a347d", "")
+ : "20120614",
+ # packages with a valid UPSTREAM_CHECK_GITTAGREGEX
+ ("xf86-video-omap", "git://anongit.freedesktop.org/xorg/driver/xf86-video-omap", "ae0394e687f1a77e966cf72f895da91840dffb8f", "(?P<pver>(\d+\.(\d\.?)*))")
+ : "0.4.3",
+ ("build-appliance-image", "git://git.yoctoproject.org/poky", "b37dd451a52622d5b570183a81583cc34c2ff555", "(?P<pver>(([0-9][\.|_]?)+[0-9]))")
+ : "11.0.0",
+ ("chkconfig-alternatives-native", "git://github.com/kergoth/chkconfig;branch=sysroot", "cd437ecbd8986c894442f8fce1e0061e20f04dee", "chkconfig\-(?P<pver>((\d+[\.\-_]*)+))")
+ : "1.3.59",
+ ("remake", "git://github.com/rocky/remake.git", "f05508e521987c8494c92d9c2871aec46307d51d", "(?P<pver>(\d+\.(\d+\.)*\d*(\+dbg\d+(\.\d+)*)*))")
+ : "3.82+dbg0.9",
+ }
+
+ test_wget_uris = {
+ # packages with versions inside directory name
+ ("util-linux", "http://kernel.org/pub/linux/utils/util-linux/v2.23/util-linux-2.24.2.tar.bz2", "", "")
+ : "2.24.2",
+ ("enchant", "http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz", "", "")
+ : "1.6.0",
+ ("cmake", "http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz", "", "")
+ : "2.8.12.1",
+ # packages with versions only in current directory
+ ("eglic", "http://downloads.yoctoproject.org/releases/eglibc/eglibc-2.18-svnr23787.tar.bz2", "", "")
+ : "2.19",
+ ("gnu-config", "http://downloads.yoctoproject.org/releases/gnu-config/gnu-config-20120814.tar.bz2", "", "")
+ : "20120814",
+ # packages with "99" in the name of possible version
+ ("pulseaudio", "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-4.0.tar.xz", "", "")
+ : "5.0",
+ ("xserver-xorg", "http://xorg.freedesktop.org/releases/individual/xserver/xorg-server-1.15.1.tar.bz2", "", "")
+ : "1.15.1",
+ # packages with valid UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX
+ ("cups", "http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2", "https://github.com/apple/cups/releases", "(?P<name>cups\-)(?P<pver>((\d+[\.\-_]*)+))\-source\.tar\.gz")
+ : "2.0.0",
+ ("db", "http://download.oracle.com/berkeley-db/db-5.3.21.tar.gz", "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html", "http://download.oracle.com/otn/berkeley-db/(?P<name>db-)(?P<pver>((\d+[\.\-_]*)+))\.tar\.gz")
+ : "6.1.19",
+ }
+
+ @skipIfNoNetwork()
+ def test_git_latest_versionstring(self):
+ for k, v in self.test_git_uris.items():
+ self.d.setVar("PN", k[0])
+ self.d.setVar("SRCREV", k[2])
+ self.d.setVar("UPSTREAM_CHECK_GITTAGREGEX", k[3])
+ ud = bb.fetch2.FetchData(k[1], self.d)
+ pupver= ud.method.latest_versionstring(ud, self.d)
+ verstring = pupver[0]
+ self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
+ r = bb.utils.vercmp_string(v, verstring)
+ self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
+
+ @skipIfNoNetwork()
+ def test_wget_latest_versionstring(self):
+ for k, v in self.test_wget_uris.items():
+ self.d.setVar("PN", k[0])
+ self.d.setVar("UPSTREAM_CHECK_URI", k[2])
+ self.d.setVar("UPSTREAM_CHECK_REGEX", k[3])
+ ud = bb.fetch2.FetchData(k[1], self.d)
+ pupver = ud.method.latest_versionstring(ud, self.d)
+ verstring = pupver[0]
+ self.assertTrue(verstring, msg="Could not find upstream version for %s" % k[0])
+ r = bb.utils.vercmp_string(v, verstring)
+ self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))
+
+
+class FetchCheckStatusTest(FetcherTest):
+ test_wget_uris = ["http://www.cups.org/software/1.7.2/cups-1.7.2-source.tar.bz2",
+ "http://www.cups.org/",
+ "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.1.tar.gz",
+ "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.2.tar.gz",
+ "http://downloads.yoctoproject.org/releases/sato/sato-engine-0.3.tar.gz",
+ "https://yoctoproject.org/",
+ "https://yoctoproject.org/documentation",
+ "http://downloads.yoctoproject.org/releases/opkg/opkg-0.1.7.tar.gz",
+ "http://downloads.yoctoproject.org/releases/opkg/opkg-0.3.0.tar.gz",
+ "ftp://sourceware.org/pub/libffi/libffi-1.20.tar.gz",
+ "http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz",
+ "https://ftp.gnu.org/gnu/chess/gnuchess-5.08.tar.gz",
+ "https://ftp.gnu.org/gnu/gmp/gmp-4.0.tar.gz",
+ # GitHub releases are hosted on Amazon S3, which doesn't support HEAD
+ "https://github.com/kergoth/tslib/releases/download/1.1/tslib-1.1.tar.xz"
+ ]
+
+ @skipIfNoNetwork()
+ def test_wget_checkstatus(self):
+ fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d)
+ for u in self.test_wget_uris:
+ with self.subTest(url=u):
+ ud = fetch.ud[u]
+ m = ud.method
+ ret = m.checkstatus(fetch, ud, self.d)
+ self.assertTrue(ret, msg="URI %s, can't check status" % (u))
+
+ @skipIfNoNetwork()
+ def test_wget_checkstatus_connection_cache(self):
+ from bb.fetch2 import FetchConnectionCache
+
+ connection_cache = FetchConnectionCache()
+ fetch = bb.fetch2.Fetch(self.test_wget_uris, self.d,
+ connection_cache = connection_cache)
+
+ for u in self.test_wget_uris:
+ with self.subTest(url=u):
+ ud = fetch.ud[u]
+ m = ud.method
+ ret = m.checkstatus(fetch, ud, self.d)
+ self.assertTrue(ret, msg="URI %s, can't check status" % (u))
+
+ connection_cache.close_connections()
+
+
+class GitMakeShallowTest(FetcherTest):
+ def setUp(self):
+ FetcherTest.setUp(self)
+ self.gitdir = os.path.join(self.tempdir, 'gitshallow')
+ bb.utils.mkdirhier(self.gitdir)
+ bb.process.run('git init', cwd=self.gitdir)
+
+ def assertRefs(self, expected_refs):
+ actual_refs = self.git(['for-each-ref', '--format=%(refname)']).splitlines()
+ full_expected = self.git(['rev-parse', '--symbolic-full-name'] + expected_refs).splitlines()
+ self.assertEqual(sorted(full_expected), sorted(actual_refs))
+
+ def assertRevCount(self, expected_count, args=None):
+ if args is None:
+ args = ['HEAD']
+ revs = self.git(['rev-list'] + args)
+ actual_count = len(revs.splitlines())
+ self.assertEqual(expected_count, actual_count, msg='Object count `%d` is not the expected `%d`' % (actual_count, expected_count))
+
+ def git(self, cmd):
+ if isinstance(cmd, str):
+ cmd = 'git ' + cmd
+ else:
+ cmd = ['git'] + cmd
+ return bb.process.run(cmd, cwd=self.gitdir)[0]
+
+ def make_shallow(self, args=None):
+ if args is None:
+ args = ['HEAD']
+ return bb.process.run([bb.fetch2.git.Git.make_shallow_path] + args, cwd=self.gitdir)
+
+ def add_empty_file(self, path, msg=None):
+ if msg is None:
+ msg = path
+ open(os.path.join(self.gitdir, path), 'w').close()
+ self.git(['add', path])
+ self.git(['commit', '-m', msg, path])
+
+ def test_make_shallow_single_branch_no_merge(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2)
+ self.make_shallow()
+ self.assertRevCount(1)
+
+ def test_make_shallow_single_branch_one_merge(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('checkout -b a_branch')
+ self.add_empty_file('c')
+ self.git('checkout master')
+ self.add_empty_file('d')
+ self.git('merge --no-ff --no-edit a_branch')
+ self.git('branch -d a_branch')
+ self.add_empty_file('e')
+ self.assertRevCount(6)
+ self.make_shallow(['HEAD~2'])
+ self.assertRevCount(5)
+
+ def test_make_shallow_at_merge(self):
+ self.add_empty_file('a')
+ self.git('checkout -b a_branch')
+ self.add_empty_file('b')
+ self.git('checkout master')
+ self.git('merge --no-ff --no-edit a_branch')
+ self.git('branch -d a_branch')
+ self.assertRevCount(3)
+ self.make_shallow()
+ self.assertRevCount(1)
+
+ def test_make_shallow_annotated_tag(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('tag -a -m a_tag a_tag')
+ self.assertRevCount(2)
+ self.make_shallow(['a_tag'])
+ self.assertRevCount(1)
+
+ def test_make_shallow_multi_ref(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('checkout -b a_branch')
+ self.add_empty_file('c')
+ self.git('checkout master')
+ self.add_empty_file('d')
+ self.git('checkout -b a_branch_2')
+ self.add_empty_file('a_tag')
+ self.git('tag a_tag')
+ self.git('checkout master')
+ self.git('branch -D a_branch_2')
+ self.add_empty_file('e')
+ self.assertRevCount(6, ['--all'])
+ self.make_shallow()
+ self.assertRevCount(5, ['--all'])
+
+ def test_make_shallow_multi_ref_trim(self):
+ self.add_empty_file('a')
+ self.git('checkout -b a_branch')
+ self.add_empty_file('c')
+ self.git('checkout master')
+ self.assertRevCount(1)
+ self.assertRevCount(2, ['--all'])
+ self.assertRefs(['master', 'a_branch'])
+ self.make_shallow(['-r', 'master', 'HEAD'])
+ self.assertRevCount(1, ['--all'])
+ self.assertRefs(['master'])
+
+ def test_make_shallow_noop(self):
+ self.add_empty_file('a')
+ self.assertRevCount(1)
+ self.make_shallow()
+ self.assertRevCount(1)
+
+ @skipIfNoNetwork()
+ def test_make_shallow_bitbake(self):
+ self.git('remote add origin https://github.com/openembedded/bitbake')
+ self.git('fetch --tags origin')
+ orig_revs = len(self.git('rev-list --all').splitlines())
+ self.make_shallow(['refs/tags/1.10.0'])
+ self.assertRevCount(orig_revs - 1746, ['--all'])
+
+class GitShallowTest(FetcherTest):
+ def setUp(self):
+ FetcherTest.setUp(self)
+ self.gitdir = os.path.join(self.tempdir, 'git')
+ self.srcdir = os.path.join(self.tempdir, 'gitsource')
+
+ bb.utils.mkdirhier(self.srcdir)
+ self.git('init', cwd=self.srcdir)
+ self.d.setVar('WORKDIR', self.tempdir)
+ self.d.setVar('S', self.gitdir)
+ self.d.delVar('PREMIRRORS')
+ self.d.delVar('MIRRORS')
+
+ uri = 'git://%s;protocol=file;subdir=${S}' % self.srcdir
+ self.d.setVar('SRC_URI', uri)
+ self.d.setVar('SRCREV', '${AUTOREV}')
+ self.d.setVar('AUTOREV', '${@bb.fetch2.get_autorev(d)}')
+
+ self.d.setVar('BB_GIT_SHALLOW', '1')
+ self.d.setVar('BB_GENERATE_MIRROR_TARBALLS', '0')
+ self.d.setVar('BB_GENERATE_SHALLOW_TARBALLS', '1')
+
+ def assertRefs(self, expected_refs, cwd=None):
+ if cwd is None:
+ cwd = self.gitdir
+ actual_refs = self.git(['for-each-ref', '--format=%(refname)'], cwd=cwd).splitlines()
+ full_expected = self.git(['rev-parse', '--symbolic-full-name'] + expected_refs, cwd=cwd).splitlines()
+ self.assertEqual(sorted(set(full_expected)), sorted(set(actual_refs)))
+
+ def assertRevCount(self, expected_count, args=None, cwd=None):
+ if args is None:
+ args = ['HEAD']
+ if cwd is None:
+ cwd = self.gitdir
+ revs = self.git(['rev-list'] + args, cwd=cwd)
+ actual_count = len(revs.splitlines())
+ self.assertEqual(expected_count, actual_count, msg='Object count `%d` is not the expected `%d`' % (actual_count, expected_count))
+
+ def git(self, cmd, cwd=None):
+ if isinstance(cmd, str):
+ cmd = 'git ' + cmd
+ else:
+ cmd = ['git'] + cmd
+ if cwd is None:
+ cwd = self.gitdir
+ return bb.process.run(cmd, cwd=cwd)[0]
+
+ def add_empty_file(self, path, cwd=None, msg=None):
+ if msg is None:
+ msg = path
+ if cwd is None:
+ cwd = self.srcdir
+ open(os.path.join(cwd, path), 'w').close()
+ self.git(['add', path], cwd)
+ self.git(['commit', '-m', msg, path], cwd)
+
+ def fetch(self, uri=None):
+ if uri is None:
+ uris = self.d.getVar('SRC_URI', True).split()
+ uri = uris[0]
+ d = self.d
+ else:
+ d = self.d.createCopy()
+ d.setVar('SRC_URI', uri)
+ uri = d.expand(uri)
+ uris = [uri]
+
+ fetcher = bb.fetch2.Fetch(uris, d)
+ fetcher.download()
+ ud = fetcher.ud[uri]
+ return fetcher, ud
+
+ def fetch_and_unpack(self, uri=None):
+ fetcher, ud = self.fetch(uri)
+ fetcher.unpack(self.d.getVar('WORKDIR'))
+ assert os.path.exists(self.d.getVar('S'))
+ return fetcher, ud
+
+ def fetch_shallow(self, uri=None, disabled=False, keepclone=False):
+ """Fetch a uri, generating a shallow tarball, then unpack using it"""
+ fetcher, ud = self.fetch_and_unpack(uri)
+ assert os.path.exists(ud.clonedir), 'Git clone in DLDIR (%s) does not exist for uri %s' % (ud.clonedir, uri)
+
+ # Confirm that the unpacked repo is unshallow
+ if not disabled:
+ assert os.path.exists(os.path.join(self.dldir, ud.mirrortarballs[0]))
+
+ # fetch and unpack, from the shallow tarball
+ bb.utils.remove(self.gitdir, recurse=True)
+ bb.utils.remove(ud.clonedir, recurse=True)
+
+ # confirm that the unpacked repo is used when no git clone or git
+ # mirror tarball is available
+ fetcher, ud = self.fetch_and_unpack(uri)
+ if not disabled:
+ assert os.path.exists(os.path.join(self.gitdir, '.git', 'shallow')), 'Unpacked git repository at %s is not shallow' % self.gitdir
+ else:
+ assert not os.path.exists(os.path.join(self.gitdir, '.git', 'shallow')), 'Unpacked git repository at %s is shallow' % self.gitdir
+ return fetcher, ud
+
+ def test_shallow_disabled(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW', '0')
+ self.fetch_shallow(disabled=True)
+ self.assertRevCount(2)
+
+ def test_shallow_nobranch(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ srcrev = self.git('rev-parse HEAD', cwd=self.srcdir).strip()
+ self.d.setVar('SRCREV', srcrev)
+ uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = '%s;nobranch=1;bare=1' % uri
+
+ self.fetch_shallow(uri)
+ self.assertRevCount(1)
+
+ # shallow refs are used to ensure the srcrev sticks around when we
+ # have no other branches referencing it
+ self.assertRefs(['refs/shallow/default'])
+
+ def test_shallow_default_depth_1(self):
+ # Create initial git repo
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.fetch_shallow()
+ self.assertRevCount(1)
+
+ def test_shallow_depth_0_disables(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.fetch_shallow(disabled=True)
+ self.assertRevCount(2)
+
+ def test_shallow_depth_default_override(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '2')
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH_default', '1')
+ self.fetch_shallow()
+ self.assertRevCount(1)
+
+ def test_shallow_depth_default_override_disable(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.add_empty_file('c')
+ self.assertRevCount(3, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH_default', '2')
+ self.fetch_shallow()
+ self.assertRevCount(2)
+
+ def test_current_shallow_out_of_date_clone(self):
+ # Create initial git repo
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.add_empty_file('c')
+ self.assertRevCount(3, cwd=self.srcdir)
+
+ # Clone and generate mirror tarball
+ fetcher, ud = self.fetch()
+
+ # Ensure we have a current mirror tarball, but an out of date clone
+ self.git('update-ref refs/heads/master refs/heads/master~1', cwd=ud.clonedir)
+ self.assertRevCount(2, cwd=ud.clonedir)
+
+ # Fetch and unpack, from the current tarball, not the out of date clone
+ bb.utils.remove(self.gitdir, recurse=True)
+ fetcher, ud = self.fetch()
+ fetcher.unpack(self.d.getVar('WORKDIR'))
+ self.assertRevCount(1)
+
+ def test_shallow_single_branch_no_merge(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.fetch_shallow()
+ self.assertRevCount(1)
+ assert os.path.exists(os.path.join(self.gitdir, 'a'))
+ assert os.path.exists(os.path.join(self.gitdir, 'b'))
+
+ def test_shallow_no_dangling(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.fetch_shallow()
+ self.assertRevCount(1)
+ assert not self.git('fsck --dangling')
+
+ def test_shallow_srcrev_branch_truncation(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ b_commit = self.git('rev-parse HEAD', cwd=self.srcdir).rstrip()
+ self.add_empty_file('c')
+ self.assertRevCount(3, cwd=self.srcdir)
+
+ self.d.setVar('SRCREV', b_commit)
+ self.fetch_shallow()
+
+ # The 'c' commit was removed entirely, and 'a' was removed from history
+ self.assertRevCount(1, ['--all'])
+ self.assertEqual(self.git('rev-parse HEAD').strip(), b_commit)
+ assert os.path.exists(os.path.join(self.gitdir, 'a'))
+ assert os.path.exists(os.path.join(self.gitdir, 'b'))
+ assert not os.path.exists(os.path.join(self.gitdir, 'c'))
+
+ def test_shallow_ref_pruning(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('branch a_branch', cwd=self.srcdir)
+ self.assertRefs(['master', 'a_branch'], cwd=self.srcdir)
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.fetch_shallow()
+
+ self.assertRefs(['master', 'origin/master'])
+ self.assertRevCount(1)
+
+ def test_shallow_submodules(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ smdir = os.path.join(self.tempdir, 'gitsubmodule')
+ bb.utils.mkdirhier(smdir)
+ self.git('init', cwd=smdir)
+ self.add_empty_file('asub', cwd=smdir)
+
+ self.git('submodule init', cwd=self.srcdir)
+ self.git('submodule add file://%s' % smdir, cwd=self.srcdir)
+ self.git('submodule update', cwd=self.srcdir)
+ self.git('commit -m submodule -a', cwd=self.srcdir)
+
+ uri = 'gitsm://%s;protocol=file;subdir=${S}' % self.srcdir
+ fetcher, ud = self.fetch_shallow(uri)
+
+ self.assertRevCount(1)
+ assert './.git/modules/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
+ assert os.listdir(os.path.join(self.gitdir, 'gitsubmodule'))
+
+ if any(os.path.exists(os.path.join(p, 'git-annex')) for p in os.environ.get('PATH').split(':')):
+ def test_shallow_annex(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('annex init', cwd=self.srcdir)
+ open(os.path.join(self.srcdir, 'c'), 'w').close()
+ self.git('annex add c', cwd=self.srcdir)
+ self.git('commit -m annex-c -a', cwd=self.srcdir)
+ bb.process.run('chmod u+w -R %s' % os.path.join(self.srcdir, '.git', 'annex'))
+
+ uri = 'gitannex://%s;protocol=file;subdir=${S}' % self.srcdir
+ fetcher, ud = self.fetch_shallow(uri)
+
+ self.assertRevCount(1)
+ assert './.git/annex/' in bb.process.run('tar -tzf %s' % os.path.join(self.dldir, ud.mirrortarballs[0]))[0]
+ assert os.path.exists(os.path.join(self.gitdir, 'c'))
+
+ def test_shallow_multi_one_uri(self):
+ # Create initial git repo
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('checkout -b a_branch', cwd=self.srcdir)
+ self.add_empty_file('c')
+ self.add_empty_file('d')
+ self.git('checkout master', cwd=self.srcdir)
+ self.git('tag v0.0 a_branch', cwd=self.srcdir)
+ self.add_empty_file('e')
+ self.git('merge --no-ff --no-edit a_branch', cwd=self.srcdir)
+ self.add_empty_file('f')
+ self.assertRevCount(7, cwd=self.srcdir)
+
+ uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
+ self.d.setVar('SRCREV_master', '${AUTOREV}')
+ self.d.setVar('SRCREV_a_branch', '${AUTOREV}')
+
+ self.fetch_shallow(uri)
+
+ self.assertRevCount(5)
+ self.assertRefs(['master', 'origin/master', 'origin/a_branch'])
+
+ def test_shallow_multi_one_uri_depths(self):
+ # Create initial git repo
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('checkout -b a_branch', cwd=self.srcdir)
+ self.add_empty_file('c')
+ self.add_empty_file('d')
+ self.git('checkout master', cwd=self.srcdir)
+ self.add_empty_file('e')
+ self.git('merge --no-ff --no-edit a_branch', cwd=self.srcdir)
+ self.add_empty_file('f')
+ self.assertRevCount(7, cwd=self.srcdir)
+
+ uri = self.d.getVar('SRC_URI', True).split()[0]
+ uri = '%s;branch=master,a_branch;name=master,a_branch' % uri
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH_master', '3')
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH_a_branch', '1')
+ self.d.setVar('SRCREV_master', '${AUTOREV}')
+ self.d.setVar('SRCREV_a_branch', '${AUTOREV}')
+
+ self.fetch_shallow(uri)
+
+ self.assertRevCount(4, ['--all'])
+ self.assertRefs(['master', 'origin/master', 'origin/a_branch'])
+
+ def test_shallow_clone_preferred_over_shallow(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ # Fetch once to generate the shallow tarball
+ fetcher, ud = self.fetch()
+ assert os.path.exists(os.path.join(self.dldir, ud.mirrortarballs[0]))
+
+ # Fetch and unpack with both the clonedir and shallow tarball available
+ bb.utils.remove(self.gitdir, recurse=True)
+ fetcher, ud = self.fetch_and_unpack()
+
+ # The unpacked tree should *not* be shallow
+ self.assertRevCount(2)
+ assert not os.path.exists(os.path.join(self.gitdir, '.git', 'shallow'))
+
+ def test_shallow_mirrors(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ # Fetch once to generate the shallow tarball
+ fetcher, ud = self.fetch()
+ mirrortarball = ud.mirrortarballs[0]
+ assert os.path.exists(os.path.join(self.dldir, mirrortarball))
+
+ # Set up the mirror
+ mirrordir = os.path.join(self.tempdir, 'mirror')
+ bb.utils.mkdirhier(mirrordir)
+ self.d.setVar('PREMIRRORS', 'git://.*/.* file://%s/\n' % mirrordir)
+
+ os.rename(os.path.join(self.dldir, mirrortarball),
+ os.path.join(mirrordir, mirrortarball))
+
+ # Fetch from the mirror
+ bb.utils.remove(self.dldir, recurse=True)
+ bb.utils.remove(self.gitdir, recurse=True)
+ self.fetch_and_unpack()
+ self.assertRevCount(1)
+
+ def test_shallow_invalid_depth(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '-12')
+ with self.assertRaises(bb.fetch2.FetchError):
+ self.fetch()
+
+ def test_shallow_invalid_depth_default(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH_default', '-12')
+ with self.assertRaises(bb.fetch2.FetchError):
+ self.fetch()
+
+ def test_shallow_extra_refs(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('branch a_branch', cwd=self.srcdir)
+ self.assertRefs(['master', 'a_branch'], cwd=self.srcdir)
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_EXTRA_REFS', 'refs/heads/a_branch')
+ self.fetch_shallow()
+
+ self.assertRefs(['master', 'origin/master', 'origin/a_branch'])
+ self.assertRevCount(1)
+
+ def test_shallow_extra_refs_wildcard(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('branch a_branch', cwd=self.srcdir)
+ self.git('tag v1.0', cwd=self.srcdir)
+ self.assertRefs(['master', 'a_branch', 'v1.0'], cwd=self.srcdir)
+ self.assertRevCount(2, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_EXTRA_REFS', 'refs/tags/*')
+ self.fetch_shallow()
+
+ self.assertRefs(['master', 'origin/master', 'v1.0'])
+ self.assertRevCount(1)
+
+ def test_shallow_missing_extra_refs(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ self.d.setVar('BB_GIT_SHALLOW_EXTRA_REFS', 'refs/heads/foo')
+ with self.assertRaises(bb.fetch2.FetchError):
+ self.fetch()
+
+ def test_shallow_missing_extra_refs_wildcard(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ self.d.setVar('BB_GIT_SHALLOW_EXTRA_REFS', 'refs/tags/*')
+ self.fetch()
+
+ def test_shallow_remove_revs(self):
+ # Create initial git repo
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+ self.git('checkout -b a_branch', cwd=self.srcdir)
+ self.add_empty_file('c')
+ self.add_empty_file('d')
+ self.git('checkout master', cwd=self.srcdir)
+ self.git('tag v0.0 a_branch', cwd=self.srcdir)
+ self.add_empty_file('e')
+ self.git('merge --no-ff --no-edit a_branch', cwd=self.srcdir)
+ self.git('branch -d a_branch', cwd=self.srcdir)
+ self.add_empty_file('f')
+ self.assertRevCount(7, cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
+
+ self.fetch_shallow()
+
+ self.assertRevCount(5)
+
+ def test_shallow_invalid_revs(self):
+ self.add_empty_file('a')
+ self.add_empty_file('b')
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ self.d.setVar('BB_GIT_SHALLOW_REVS', 'v0.0')
+
+ with self.assertRaises(bb.fetch2.FetchError):
+ self.fetch()
+
+ @skipIfNoNetwork()
+ def test_bitbake(self):
+ self.git('remote add --mirror=fetch origin git://github.com/openembedded/bitbake', cwd=self.srcdir)
+ self.git('config core.bare true', cwd=self.srcdir)
+ self.git('fetch', cwd=self.srcdir)
+
+ self.d.setVar('BB_GIT_SHALLOW_DEPTH', '0')
+ # Note that the 1.10.0 tag is annotated, so this also tests
+ # reference of an annotated vs unannotated tag
+ self.d.setVar('BB_GIT_SHALLOW_REVS', '1.10.0')
+
+ self.fetch_shallow()
+
+ # Confirm that the history of 1.10.0 was removed
+ orig_revs = len(self.git('rev-list master', cwd=self.srcdir).splitlines())
+ revs = len(self.git('rev-list master').splitlines())
+ self.assertNotEqual(orig_revs, revs)
+ self.assertRefs(['master', 'origin/master'])
+ self.assertRevCount(orig_revs - 1758)
diff --git a/poky/bitbake/lib/bb/tests/parse.py b/poky/bitbake/lib/bb/tests/parse.py
new file mode 100644
index 000000000..8f16ba4f4
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/parse.py
@@ -0,0 +1,185 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Test for lib/bb/parse/
+#
+# Copyright (C) 2015 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import tempfile
+import logging
+import bb
+import os
+
+logger = logging.getLogger('BitBake.TestParse')
+
+import bb.parse
+import bb.data
+import bb.siggen
+
+class ParseTest(unittest.TestCase):
+
+ testfile = """
+A = "1"
+B = "2"
+do_install() {
+ echo "hello"
+}
+
+C = "3"
+"""
+
+ def setUp(self):
+ self.d = bb.data.init()
+ bb.parse.siggen = bb.siggen.init(self.d)
+
+ def parsehelper(self, content, suffix = ".bb"):
+
+ f = tempfile.NamedTemporaryFile(suffix = suffix)
+ f.write(bytes(content, "utf-8"))
+ f.flush()
+ os.chdir(os.path.dirname(f.name))
+ return f
+
+ def test_parse_simple(self):
+ f = self.parsehelper(self.testfile)
+ d = bb.parse.handle(f.name, self.d)['']
+ self.assertEqual(d.getVar("A"), "1")
+ self.assertEqual(d.getVar("B"), "2")
+ self.assertEqual(d.getVar("C"), "3")
+
+ def test_parse_incomplete_function(self):
+ testfileB = self.testfile.replace("}", "")
+ f = self.parsehelper(testfileB)
+ with self.assertRaises(bb.parse.ParseError):
+ d = bb.parse.handle(f.name, self.d)['']
+
+ unsettest = """
+A = "1"
+B = "2"
+B[flag] = "3"
+
+unset A
+unset B[flag]
+"""
+
+ def test_parse_unset(self):
+ f = self.parsehelper(self.unsettest)
+ d = bb.parse.handle(f.name, self.d)['']
+ self.assertEqual(d.getVar("A"), None)
+ self.assertEqual(d.getVarFlag("A","flag"), None)
+ self.assertEqual(d.getVar("B"), "2")
+
+ exporttest = """
+A = "a"
+export B = "b"
+export C
+exportD = "d"
+"""
+
+ def test_parse_exports(self):
+ f = self.parsehelper(self.exporttest)
+ d = bb.parse.handle(f.name, self.d)['']
+ self.assertEqual(d.getVar("A"), "a")
+ self.assertIsNone(d.getVarFlag("A", "export"))
+ self.assertEqual(d.getVar("B"), "b")
+ self.assertEqual(d.getVarFlag("B", "export"), 1)
+ self.assertIsNone(d.getVar("C"))
+ self.assertEqual(d.getVarFlag("C", "export"), 1)
+ self.assertIsNone(d.getVar("D"))
+ self.assertIsNone(d.getVarFlag("D", "export"))
+ self.assertEqual(d.getVar("exportD"), "d")
+ self.assertIsNone(d.getVarFlag("exportD", "export"))
+
+
+ overridetest = """
+RRECOMMENDS_${PN} = "a"
+RRECOMMENDS_${PN}_libc = "b"
+OVERRIDES = "libc:${PN}"
+PN = "gtk+"
+"""
+
+ def test_parse_overrides(self):
+ f = self.parsehelper(self.overridetest)
+ d = bb.parse.handle(f.name, self.d)['']
+ self.assertEqual(d.getVar("RRECOMMENDS"), "b")
+ bb.data.expandKeys(d)
+ self.assertEqual(d.getVar("RRECOMMENDS"), "b")
+ d.setVar("RRECOMMENDS_gtk+", "c")
+ self.assertEqual(d.getVar("RRECOMMENDS"), "c")
+
+ overridetest2 = """
+EXTRA_OECONF = ""
+EXTRA_OECONF_class-target = "b"
+EXTRA_OECONF_append = " c"
+"""
+
+ def test_parse_overrides(self):
+ f = self.parsehelper(self.overridetest2)
+ d = bb.parse.handle(f.name, self.d)['']
+ d.appendVar("EXTRA_OECONF", " d")
+ d.setVar("OVERRIDES", "class-target")
+ self.assertEqual(d.getVar("EXTRA_OECONF"), "b c d")
+
+ overridetest3 = """
+DESCRIPTION = "A"
+DESCRIPTION_${PN}-dev = "${DESCRIPTION} B"
+PN = "bc"
+"""
+
+ def test_parse_combinations(self):
+ f = self.parsehelper(self.overridetest3)
+ d = bb.parse.handle(f.name, self.d)['']
+ bb.data.expandKeys(d)
+ self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B")
+ d.setVar("DESCRIPTION", "E")
+ d.setVar("DESCRIPTION_bc-dev", "C D")
+ d.setVar("OVERRIDES", "bc-dev")
+ self.assertEqual(d.getVar("DESCRIPTION"), "C D")
+
+
+ classextend = """
+VAR_var_override1 = "B"
+EXTRA = ":override1"
+OVERRIDES = "nothing${EXTRA}"
+
+BBCLASSEXTEND = "###CLASS###"
+"""
+ classextend_bbclass = """
+EXTRA = ""
+python () {
+ d.renameVar("VAR_var", "VAR_var2")
+}
+"""
+
+ #
+ # Test based upon a real world data corruption issue. One
+ # data store changing a variable poked through into a different data
+ # store. This test case replicates that issue where the value 'B' would
+ # become unset/disappear.
+ #
+ def test_parse_classextend_contamination(self):
+ cls = self.parsehelper(self.classextend_bbclass, suffix=".bbclass")
+ #clsname = os.path.basename(cls.name).replace(".bbclass", "")
+ self.classextend = self.classextend.replace("###CLASS###", cls.name)
+ f = self.parsehelper(self.classextend)
+ alldata = bb.parse.handle(f.name, self.d)
+ d1 = alldata['']
+ d2 = alldata[cls.name]
+ self.assertEqual(d1.getVar("VAR_var"), "B")
+ self.assertEqual(d2.getVar("VAR_var"), None)
+
diff --git a/poky/bitbake/lib/bb/tests/utils.py b/poky/bitbake/lib/bb/tests/utils.py
new file mode 100644
index 000000000..2f4ccf3c6
--- /dev/null
+++ b/poky/bitbake/lib/bb/tests/utils.py
@@ -0,0 +1,603 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Tests for utils.py
+#
+# Copyright (C) 2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import unittest
+import bb
+import os
+import tempfile
+import re
+
+class VerCmpString(unittest.TestCase):
+
+ def test_vercmpstring(self):
+ result = bb.utils.vercmp_string('1', '2')
+ self.assertTrue(result < 0)
+ result = bb.utils.vercmp_string('2', '1')
+ self.assertTrue(result > 0)
+ result = bb.utils.vercmp_string('1', '1.0')
+ self.assertTrue(result < 0)
+ result = bb.utils.vercmp_string('1', '1.1')
+ self.assertTrue(result < 0)
+ result = bb.utils.vercmp_string('1.1', '1_p2')
+ self.assertTrue(result < 0)
+ result = bb.utils.vercmp_string('1.0', '1.0+1.1-beta1')
+ self.assertTrue(result < 0)
+ result = bb.utils.vercmp_string('1.1', '1.0+1.1-beta1')
+ self.assertTrue(result > 0)
+
+ def test_explode_dep_versions(self):
+ correctresult = {"foo" : ["= 1.10"]}
+ result = bb.utils.explode_dep_versions2("foo (= 1.10)")
+ self.assertEqual(result, correctresult)
+ result = bb.utils.explode_dep_versions2("foo (=1.10)")
+ self.assertEqual(result, correctresult)
+ result = bb.utils.explode_dep_versions2("foo ( = 1.10)")
+ self.assertEqual(result, correctresult)
+ result = bb.utils.explode_dep_versions2("foo ( =1.10)")
+ self.assertEqual(result, correctresult)
+ result = bb.utils.explode_dep_versions2("foo ( = 1.10 )")
+ self.assertEqual(result, correctresult)
+ result = bb.utils.explode_dep_versions2("foo ( =1.10 )")
+ self.assertEqual(result, correctresult)
+
+ def test_vercmp_string_op(self):
+ compareops = [('1', '1', '=', True),
+ ('1', '1', '==', True),
+ ('1', '1', '!=', False),
+ ('1', '1', '>', False),
+ ('1', '1', '<', False),
+ ('1', '1', '>=', True),
+ ('1', '1', '<=', True),
+ ('1', '0', '=', False),
+ ('1', '0', '==', False),
+ ('1', '0', '!=', True),
+ ('1', '0', '>', True),
+ ('1', '0', '<', False),
+ ('1', '0', '>>', True),
+ ('1', '0', '<<', False),
+ ('1', '0', '>=', True),
+ ('1', '0', '<=', False),
+ ('0', '1', '=', False),
+ ('0', '1', '==', False),
+ ('0', '1', '!=', True),
+ ('0', '1', '>', False),
+ ('0', '1', '<', True),
+ ('0', '1', '>>', False),
+ ('0', '1', '<<', True),
+ ('0', '1', '>=', False),
+ ('0', '1', '<=', True)]
+
+ for arg1, arg2, op, correctresult in compareops:
+ result = bb.utils.vercmp_string_op(arg1, arg2, op)
+ self.assertEqual(result, correctresult, 'vercmp_string_op("%s", "%s", "%s") != %s' % (arg1, arg2, op, correctresult))
+
+ # Check that clearly invalid operator raises an exception
+ self.assertRaises(bb.utils.VersionStringException, bb.utils.vercmp_string_op, '0', '0', '$')
+
+
+class Path(unittest.TestCase):
+ def test_unsafe_delete_path(self):
+ checkitems = [('/', True),
+ ('//', True),
+ ('///', True),
+ (os.getcwd().count(os.sep) * ('..' + os.sep), True),
+ (os.environ.get('HOME', '/home/test'), True),
+ ('/home/someone', True),
+ ('/home/other/', True),
+ ('/home/other/subdir', False),
+ ('', False)]
+ for arg1, correctresult in checkitems:
+ result = bb.utils._check_unsafe_delete_path(arg1)
+ self.assertEqual(result, correctresult, '_check_unsafe_delete_path("%s") != %s' % (arg1, correctresult))
+
+
+class EditMetadataFile(unittest.TestCase):
+ _origfile = """
+# A comment
+HELLO = "oldvalue"
+
+THIS = "that"
+
+# Another comment
+NOCHANGE = "samevalue"
+OTHER = 'anothervalue'
+
+MULTILINE = "a1 \\
+ a2 \\
+ a3"
+
+MULTILINE2 := " \\
+ b1 \\
+ b2 \\
+ b3 \\
+ "
+
+
+MULTILINE3 = " \\
+ c1 \\
+ c2 \\
+ c3 \\
+"
+
+do_functionname() {
+ command1 ${VAL1} ${VAL2}
+ command2 ${VAL3} ${VAL4}
+}
+"""
+ def _testeditfile(self, varvalues, compareto, dummyvars=None):
+ if dummyvars is None:
+ dummyvars = []
+ with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+ tf.write(self._origfile)
+ tf.close()
+ try:
+ varcalls = []
+ def handle_file(varname, origvalue, op, newlines):
+ self.assertIn(varname, varvalues, 'Callback called for variable %s not in the list!' % varname)
+ self.assertNotIn(varname, dummyvars, 'Callback called for variable %s in dummy list!' % varname)
+ varcalls.append(varname)
+ return varvalues[varname]
+
+ bb.utils.edit_metadata_file(tf.name, varvalues.keys(), handle_file)
+ with open(tf.name) as f:
+ modfile = f.readlines()
+ # Ensure the output matches the expected output
+ self.assertEqual(compareto.splitlines(True), modfile)
+ # Ensure the callback function was called for every variable we asked for
+ # (plus allow testing behaviour when a requested variable is not present)
+ self.assertEqual(sorted(varvalues.keys()), sorted(varcalls + dummyvars))
+ finally:
+ os.remove(tf.name)
+
+
+ def test_edit_metadata_file_nochange(self):
+ # Test file doesn't get modified with nothing to do
+ self._testeditfile({}, self._origfile)
+ # Test file doesn't get modified with only dummy variables
+ self._testeditfile({'DUMMY1': ('should_not_set', None, 0, True),
+ 'DUMMY2': ('should_not_set_again', None, 0, True)}, self._origfile, dummyvars=['DUMMY1', 'DUMMY2'])
+ # Test file doesn't get modified with some the same values
+ self._testeditfile({'THIS': ('that', None, 0, True),
+ 'OTHER': ('anothervalue', None, 0, True),
+ 'MULTILINE3': (' c1 c2 c3 ', None, 4, False)}, self._origfile)
+
+ def test_edit_metadata_file_1(self):
+
+ newfile1 = """
+# A comment
+HELLO = "newvalue"
+
+THIS = "that"
+
+# Another comment
+NOCHANGE = "samevalue"
+OTHER = 'anothervalue'
+
+MULTILINE = "a1 \\
+ a2 \\
+ a3"
+
+MULTILINE2 := " \\
+ b1 \\
+ b2 \\
+ b3 \\
+ "
+
+
+MULTILINE3 = " \\
+ c1 \\
+ c2 \\
+ c3 \\
+"
+
+do_functionname() {
+ command1 ${VAL1} ${VAL2}
+ command2 ${VAL3} ${VAL4}
+}
+"""
+ self._testeditfile({'HELLO': ('newvalue', None, 4, True)}, newfile1)
+
+
+ def test_edit_metadata_file_2(self):
+
+ newfile2 = """
+# A comment
+HELLO = "oldvalue"
+
+THIS = "that"
+
+# Another comment
+NOCHANGE = "samevalue"
+OTHER = 'anothervalue'
+
+MULTILINE = " \\
+ d1 \\
+ d2 \\
+ d3 \\
+ "
+
+MULTILINE2 := " \\
+ b1 \\
+ b2 \\
+ b3 \\
+ "
+
+
+MULTILINE3 = "nowsingle"
+
+do_functionname() {
+ command1 ${VAL1} ${VAL2}
+ command2 ${VAL3} ${VAL4}
+}
+"""
+ self._testeditfile({'MULTILINE': (['d1','d2','d3'], None, 4, False),
+ 'MULTILINE3': ('nowsingle', None, 4, True),
+ 'NOTPRESENT': (['a', 'b'], None, 4, False)}, newfile2, dummyvars=['NOTPRESENT'])
+
+
+ def test_edit_metadata_file_3(self):
+
+ newfile3 = """
+# A comment
+HELLO = "oldvalue"
+
+# Another comment
+NOCHANGE = "samevalue"
+OTHER = "yetanothervalue"
+
+MULTILINE = "e1 \\
+ e2 \\
+ e3 \\
+ "
+
+MULTILINE2 := "f1 \\
+\tf2 \\
+\t"
+
+
+MULTILINE3 = " \\
+ c1 \\
+ c2 \\
+ c3 \\
+"
+
+do_functionname() {
+ othercommand_one a b c
+ othercommand_two d e f
+}
+"""
+
+ self._testeditfile({'do_functionname()': (['othercommand_one a b c', 'othercommand_two d e f'], None, 4, False),
+ 'MULTILINE2': (['f1', 'f2'], None, '\t', True),
+ 'MULTILINE': (['e1', 'e2', 'e3'], None, -1, True),
+ 'THIS': (None, None, 0, False),
+ 'OTHER': ('yetanothervalue', None, 0, True)}, newfile3)
+
+
+ def test_edit_metadata_file_4(self):
+
+ newfile4 = """
+# A comment
+HELLO = "oldvalue"
+
+THIS = "that"
+
+# Another comment
+OTHER = 'anothervalue'
+
+MULTILINE = "a1 \\
+ a2 \\
+ a3"
+
+MULTILINE2 := " \\
+ b1 \\
+ b2 \\
+ b3 \\
+ "
+
+
+"""
+
+ self._testeditfile({'NOCHANGE': (None, None, 0, False),
+ 'MULTILINE3': (None, None, 0, False),
+ 'THIS': ('that', None, 0, False),
+ 'do_functionname()': (None, None, 0, False)}, newfile4)
+
+
+ def test_edit_metadata(self):
+ newfile5 = """
+# A comment
+HELLO = "hithere"
+
+# A new comment
+THIS += "that"
+
+# Another comment
+NOCHANGE = "samevalue"
+OTHER = 'anothervalue'
+
+MULTILINE = "a1 \\
+ a2 \\
+ a3"
+
+MULTILINE2 := " \\
+ b1 \\
+ b2 \\
+ b3 \\
+ "
+
+
+MULTILINE3 = " \\
+ c1 \\
+ c2 \\
+ c3 \\
+"
+
+NEWVAR = "value"
+
+do_functionname() {
+ command1 ${VAL1} ${VAL2}
+ command2 ${VAL3} ${VAL4}
+}
+"""
+
+
+ def handle_var(varname, origvalue, op, newlines):
+ if varname == 'THIS':
+ newlines.append('# A new comment\n')
+ elif varname == 'do_functionname()':
+ newlines.append('NEWVAR = "value"\n')
+ newlines.append('\n')
+ valueitem = varvalues.get(varname, None)
+ if valueitem:
+ return valueitem
+ else:
+ return (origvalue, op, 0, True)
+
+ varvalues = {'HELLO': ('hithere', None, 0, True), 'THIS': ('that', '+=', 0, True)}
+ varlist = ['HELLO', 'THIS', 'do_functionname()']
+ (updated, newlines) = bb.utils.edit_metadata(self._origfile.splitlines(True), varlist, handle_var)
+ self.assertTrue(updated, 'List should be updated but isn\'t')
+ self.assertEqual(newlines, newfile5.splitlines(True))
+
+ # Make sure the orig value matches what we expect it to be
+ def test_edit_metadata_origvalue(self):
+ origfile = """
+MULTILINE = " stuff \\
+ morestuff"
+"""
+ expected_value = "stuff morestuff"
+ global value_in_callback
+ value_in_callback = ""
+
+ def handle_var(varname, origvalue, op, newlines):
+ global value_in_callback
+ value_in_callback = origvalue
+ return (origvalue, op, -1, False)
+
+ bb.utils.edit_metadata(origfile.splitlines(True),
+ ['MULTILINE'],
+ handle_var)
+
+ testvalue = re.sub('\s+', ' ', value_in_callback.strip())
+ self.assertEqual(expected_value, testvalue)
+
+class EditBbLayersConf(unittest.TestCase):
+
+ def _test_bblayers_edit(self, before, after, add, remove, notadded, notremoved):
+ with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+ tf.write(before)
+ tf.close()
+ try:
+ actual_notadded, actual_notremoved = bb.utils.edit_bblayers_conf(tf.name, add, remove)
+ with open(tf.name) as f:
+ actual_after = f.readlines()
+ self.assertEqual(after.splitlines(True), actual_after)
+ self.assertEqual(notadded, actual_notadded)
+ self.assertEqual(notremoved, actual_notremoved)
+ finally:
+ os.remove(tf.name)
+
+
+ def test_bblayers_remove(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/subpath/layer3 \
+ /home/user/path/layer4 \
+ "
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/subpath/layer3 \
+ /home/user/path/layer4 \
+ "
+"""
+ self._test_bblayers_edit(before, after,
+ None,
+ '/home/user/path/layer2',
+ [],
+ [])
+
+
+ def test_bblayers_add(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/subpath/layer3 \
+ /home/user/path/layer4 \
+ "
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/subpath/layer3 \
+ /home/user/path/layer4 \
+ /other/path/to/layer5 \
+ "
+"""
+ self._test_bblayers_edit(before, after,
+ '/other/path/to/layer5/',
+ None,
+ [],
+ [])
+
+
+ def test_bblayers_add_remove(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/subpath/layer3 \
+ /home/user/path/layer4 \
+ "
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/layer4 \
+ /other/path/to/layer5 \
+ "
+"""
+ self._test_bblayers_edit(before, after,
+ ['/other/path/to/layer5', '/home/user/path/layer2/'], '/home/user/path/subpath/layer3/',
+ ['/home/user/path/layer2'],
+ [])
+
+
+ def test_bblayers_add_remove_home(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ ~/path/layer1 \
+ ~/path/layer2 \
+ ~/otherpath/layer3 \
+ ~/path/layer4 \
+ "
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS = " \
+ ~/path/layer2 \
+ ~/path/layer4 \
+ ~/path2/layer5 \
+ "
+"""
+ self._test_bblayers_edit(before, after,
+ [os.environ['HOME'] + '/path/layer4', '~/path2/layer5'],
+ [os.environ['HOME'] + '/otherpath/layer3', '~/path/layer1', '~/path/notinlist'],
+ [os.environ['HOME'] + '/path/layer4'],
+ ['~/path/notinlist'])
+
+
+ def test_bblayers_add_remove_plusequals(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS += " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ "
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS += " \
+ /home/user/path/layer2 \
+ /home/user/path/layer3 \
+ "
+"""
+ self._test_bblayers_edit(before, after,
+ '/home/user/path/layer3',
+ '/home/user/path/layer1',
+ [],
+ [])
+
+
+ def test_bblayers_add_remove_plusequals2(self):
+ before = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS += " \
+ /home/user/path/layer1 \
+ /home/user/path/layer2 \
+ /home/user/path/layer3 \
+ "
+BBLAYERS += "/home/user/path/layer4"
+BBLAYERS += "/home/user/path/layer5"
+"""
+ after = r"""
+# A comment
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+BBLAYERS += " \
+ /home/user/path/layer2 \
+ /home/user/path/layer3 \
+ "
+BBLAYERS += "/home/user/path/layer5"
+BBLAYERS += "/home/user/otherpath/layer6"
+"""
+ self._test_bblayers_edit(before, after,
+ ['/home/user/otherpath/layer6', '/home/user/path/layer3'], ['/home/user/path/layer1', '/home/user/path/layer4', '/home/user/path/layer7'],
+ ['/home/user/path/layer3'],
+ ['/home/user/path/layer7'])
diff --git a/poky/bitbake/lib/bb/tinfoil.py b/poky/bitbake/lib/bb/tinfoil.py
new file mode 100644
index 000000000..368264f39
--- /dev/null
+++ b/poky/bitbake/lib/bb/tinfoil.py
@@ -0,0 +1,900 @@
+# tinfoil: a simple wrapper around cooker for bitbake-based command-line utilities
+#
+# Copyright (C) 2012-2017 Intel Corporation
+# Copyright (C) 2011 Mentor Graphics Corporation
+# Copyright (C) 2006-2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import logging
+import os
+import sys
+import atexit
+import re
+from collections import OrderedDict, defaultdict
+
+import bb.cache
+import bb.cooker
+import bb.providers
+import bb.taskdata
+import bb.utils
+import bb.command
+import bb.remotedata
+from bb.cookerdata import CookerConfiguration, ConfigParameters
+from bb.main import setup_bitbake, BitBakeConfigParameters, BBMainException
+import bb.fetch2
+
+
+# We need this in order to shut down the connection to the bitbake server,
+# otherwise the process will never properly exit
+_server_connections = []
+def _terminate_connections():
+ for connection in _server_connections:
+ connection.terminate()
+atexit.register(_terminate_connections)
+
+class TinfoilUIException(Exception):
+ """Exception raised when the UI returns non-zero from its main function"""
+ def __init__(self, returncode):
+ self.returncode = returncode
+ def __repr__(self):
+ return 'UI module main returned %d' % self.returncode
+
+class TinfoilCommandFailed(Exception):
+ """Exception raised when run_command fails"""
+
+class TinfoilDataStoreConnector:
+ """Connector object used to enable access to datastore objects via tinfoil"""
+
+ def __init__(self, tinfoil, dsindex):
+ self.tinfoil = tinfoil
+ self.dsindex = dsindex
+ def getVar(self, name):
+ value = self.tinfoil.run_command('dataStoreConnectorFindVar', self.dsindex, name)
+ overrides = None
+ if isinstance(value, dict):
+ if '_connector_origtype' in value:
+ value['_content'] = self.tinfoil._reconvert_type(value['_content'], value['_connector_origtype'])
+ del value['_connector_origtype']
+ if '_connector_overrides' in value:
+ overrides = value['_connector_overrides']
+ del value['_connector_overrides']
+ return value, overrides
+ def getKeys(self):
+ return set(self.tinfoil.run_command('dataStoreConnectorGetKeys', self.dsindex))
+ def getVarHistory(self, name):
+ return self.tinfoil.run_command('dataStoreConnectorGetVarHistory', self.dsindex, name)
+ def expandPythonRef(self, varname, expr, d):
+ ds = bb.remotedata.RemoteDatastores.transmit_datastore(d)
+ ret = self.tinfoil.run_command('dataStoreConnectorExpandPythonRef', ds, varname, expr)
+ return ret
+ def setVar(self, varname, value):
+ if self.dsindex is None:
+ self.tinfoil.run_command('setVariable', varname, value)
+ else:
+ # Not currently implemented - indicate that setting should
+ # be redirected to local side
+ return True
+ def setVarFlag(self, varname, flagname, value):
+ if self.dsindex is None:
+ self.tinfoil.run_command('dataStoreConnectorSetVarFlag', self.dsindex, varname, flagname, value)
+ else:
+ # Not currently implemented - indicate that setting should
+ # be redirected to local side
+ return True
+ def delVar(self, varname):
+ if self.dsindex is None:
+ self.tinfoil.run_command('dataStoreConnectorDelVar', self.dsindex, varname)
+ else:
+ # Not currently implemented - indicate that setting should
+ # be redirected to local side
+ return True
+ def delVarFlag(self, varname, flagname):
+ if self.dsindex is None:
+ self.tinfoil.run_command('dataStoreConnectorDelVar', self.dsindex, varname, flagname)
+ else:
+ # Not currently implemented - indicate that setting should
+ # be redirected to local side
+ return True
+ def renameVar(self, name, newname):
+ if self.dsindex is None:
+ self.tinfoil.run_command('dataStoreConnectorRenameVar', self.dsindex, name, newname)
+ else:
+ # Not currently implemented - indicate that setting should
+ # be redirected to local side
+ return True
+
+class TinfoilCookerAdapter:
+ """
+ Provide an adapter for existing code that expects to access a cooker object via Tinfoil,
+ since now Tinfoil is on the client side it no longer has direct access.
+ """
+
+ class TinfoilCookerCollectionAdapter:
+ """ cooker.collection adapter """
+ def __init__(self, tinfoil):
+ self.tinfoil = tinfoil
+ def get_file_appends(self, fn):
+ return self.tinfoil.get_file_appends(fn)
+ def __getattr__(self, name):
+ if name == 'overlayed':
+ return self.tinfoil.get_overlayed_recipes()
+ elif name == 'bbappends':
+ return self.tinfoil.run_command('getAllAppends')
+ else:
+ raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+ class TinfoilRecipeCacheAdapter:
+ """ cooker.recipecache adapter """
+ def __init__(self, tinfoil):
+ self.tinfoil = tinfoil
+ self._cache = {}
+
+ def get_pkg_pn_fn(self):
+ pkg_pn = defaultdict(list, self.tinfoil.run_command('getRecipes') or [])
+ pkg_fn = {}
+ for pn, fnlist in pkg_pn.items():
+ for fn in fnlist:
+ pkg_fn[fn] = pn
+ self._cache['pkg_pn'] = pkg_pn
+ self._cache['pkg_fn'] = pkg_fn
+
+ def __getattr__(self, name):
+ # Grab these only when they are requested since they aren't always used
+ if name in self._cache:
+ return self._cache[name]
+ elif name == 'pkg_pn':
+ self.get_pkg_pn_fn()
+ return self._cache[name]
+ elif name == 'pkg_fn':
+ self.get_pkg_pn_fn()
+ return self._cache[name]
+ elif name == 'deps':
+ attrvalue = defaultdict(list, self.tinfoil.run_command('getRecipeDepends') or [])
+ elif name == 'rundeps':
+ attrvalue = defaultdict(lambda: defaultdict(list), self.tinfoil.run_command('getRuntimeDepends') or [])
+ elif name == 'runrecs':
+ attrvalue = defaultdict(lambda: defaultdict(list), self.tinfoil.run_command('getRuntimeRecommends') or [])
+ elif name == 'pkg_pepvpr':
+ attrvalue = self.tinfoil.run_command('getRecipeVersions') or {}
+ elif name == 'inherits':
+ attrvalue = self.tinfoil.run_command('getRecipeInherits') or {}
+ elif name == 'bbfile_priority':
+ attrvalue = self.tinfoil.run_command('getBbFilePriority') or {}
+ elif name == 'pkg_dp':
+ attrvalue = self.tinfoil.run_command('getDefaultPreference') or {}
+ elif name == 'fn_provides':
+ attrvalue = self.tinfoil.run_command('getRecipeProvides') or {}
+ elif name == 'packages':
+ attrvalue = self.tinfoil.run_command('getRecipePackages') or {}
+ elif name == 'packages_dynamic':
+ attrvalue = self.tinfoil.run_command('getRecipePackagesDynamic') or {}
+ elif name == 'rproviders':
+ attrvalue = self.tinfoil.run_command('getRProviders') or {}
+ else:
+ raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+ self._cache[name] = attrvalue
+ return attrvalue
+
+ def __init__(self, tinfoil):
+ self.tinfoil = tinfoil
+ self.collection = self.TinfoilCookerCollectionAdapter(tinfoil)
+ self.recipecaches = {}
+ # FIXME all machines
+ self.recipecaches[''] = self.TinfoilRecipeCacheAdapter(tinfoil)
+ self._cache = {}
+ def __getattr__(self, name):
+ # Grab these only when they are requested since they aren't always used
+ if name in self._cache:
+ return self._cache[name]
+ elif name == 'skiplist':
+ attrvalue = self.tinfoil.get_skipped_recipes()
+ elif name == 'bbfile_config_priorities':
+ ret = self.tinfoil.run_command('getLayerPriorities')
+ bbfile_config_priorities = []
+ for collection, pattern, regex, pri in ret:
+ bbfile_config_priorities.append((collection, pattern, re.compile(regex), pri))
+
+ attrvalue = bbfile_config_priorities
+ else:
+ raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+
+ self._cache[name] = attrvalue
+ return attrvalue
+
+ def findBestProvider(self, pn):
+ return self.tinfoil.find_best_provider(pn)
+
+
+class TinfoilRecipeInfo:
+ """
+ Provides a convenient representation of the cached information for a single recipe.
+ Some attributes are set on construction, others are read on-demand (which internally
+ may result in a remote procedure call to the bitbake server the first time).
+ Note that only information which is cached is available through this object - if
+ you need other variable values you will need to parse the recipe using
+ Tinfoil.parse_recipe().
+ """
+ def __init__(self, recipecache, d, pn, fn, fns):
+ self._recipecache = recipecache
+ self._d = d
+ self.pn = pn
+ self.fn = fn
+ self.fns = fns
+ self.inherit_files = recipecache.inherits[fn]
+ self.depends = recipecache.deps[fn]
+ (self.pe, self.pv, self.pr) = recipecache.pkg_pepvpr[fn]
+ self._cached_packages = None
+ self._cached_rprovides = None
+ self._cached_packages_dynamic = None
+
+ def __getattr__(self, name):
+ if name == 'alternates':
+ return [x for x in self.fns if x != self.fn]
+ elif name == 'rdepends':
+ return self._recipecache.rundeps[self.fn]
+ elif name == 'rrecommends':
+ return self._recipecache.runrecs[self.fn]
+ elif name == 'provides':
+ return self._recipecache.fn_provides[self.fn]
+ elif name == 'packages':
+ if self._cached_packages is None:
+ self._cached_packages = []
+ for pkg, fns in self._recipecache.packages.items():
+ if self.fn in fns:
+ self._cached_packages.append(pkg)
+ return self._cached_packages
+ elif name == 'packages_dynamic':
+ if self._cached_packages_dynamic is None:
+ self._cached_packages_dynamic = []
+ for pkg, fns in self._recipecache.packages_dynamic.items():
+ if self.fn in fns:
+ self._cached_packages_dynamic.append(pkg)
+ return self._cached_packages_dynamic
+ elif name == 'rprovides':
+ if self._cached_rprovides is None:
+ self._cached_rprovides = []
+ for pkg, fns in self._recipecache.rproviders.items():
+ if self.fn in fns:
+ self._cached_rprovides.append(pkg)
+ return self._cached_rprovides
+ else:
+ raise AttributeError("%s instance has no attribute '%s'" % (self.__class__.__name__, name))
+ def inherits(self, only_recipe=False):
+ """
+ Get the inherited classes for a recipe. Returns the class names only.
+ Parameters:
+ only_recipe: True to return only the classes inherited by the recipe
+ itself, False to return all classes inherited within
+ the context for the recipe (which includes globally
+ inherited classes).
+ """
+ if only_recipe:
+ global_inherit = [x for x in (self._d.getVar('BBINCLUDED') or '').split() if x.endswith('.bbclass')]
+ else:
+ global_inherit = []
+ for clsfile in self.inherit_files:
+ if only_recipe and clsfile in global_inherit:
+ continue
+ clsname = os.path.splitext(os.path.basename(clsfile))[0]
+ yield clsname
+ def __str__(self):
+ return '%s' % self.pn
+
+
+class Tinfoil:
+ """
+ Tinfoil - an API for scripts and utilities to query
+ BitBake internals and perform build operations.
+ """
+
+ def __init__(self, output=sys.stdout, tracking=False, setup_logging=True):
+ """
+ Create a new tinfoil object.
+ Parameters:
+ output: specifies where console output should be sent. Defaults
+ to sys.stdout.
+ tracking: True to enable variable history tracking, False to
+ disable it (default). Enabling this has a minor
+ performance impact so typically it isn't enabled
+ unless you need to query variable history.
+ setup_logging: True to setup a logger so that things like
+ bb.warn() will work immediately and timeout warnings
+ are visible; False to let BitBake do this itself.
+ """
+ self.logger = logging.getLogger('BitBake')
+ self.config_data = None
+ self.cooker = None
+ self.tracking = tracking
+ self.ui_module = None
+ self.server_connection = None
+ self.recipes_parsed = False
+ self.quiet = 0
+ self.oldhandlers = self.logger.handlers[:]
+ if setup_logging:
+ # This is the *client-side* logger, nothing to do with
+ # logging messages from the server
+ bb.msg.logger_create('BitBake', output)
+ self.localhandlers = []
+ for handler in self.logger.handlers:
+ if handler not in self.oldhandlers:
+ self.localhandlers.append(handler)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ self.shutdown()
+
+ def prepare(self, config_only=False, config_params=None, quiet=0, extra_features=None):
+ """
+ Prepares the underlying BitBake system to be used via tinfoil.
+ This function must be called prior to calling any of the other
+ functions in the API.
+ NOTE: if you call prepare() you must absolutely call shutdown()
+ before your code terminates. You can use a "with" block to ensure
+ this happens e.g.
+
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare()
+ ...
+
+ Parameters:
+ config_only: True to read only the configuration and not load
+ the cache / parse recipes. This is useful if you just
+ want to query the value of a variable at the global
+ level or you want to do anything else that doesn't
+ involve knowing anything about the recipes in the
+ current configuration. False loads the cache / parses
+ recipes.
+ config_params: optionally specify your own configuration
+ parameters. If not specified an instance of
+ TinfoilConfigParameters will be created internally.
+ quiet: quiet level controlling console output - equivalent
+ to bitbake's -q/--quiet option. Default of 0 gives
+ the same output level as normal bitbake execution.
+ extra_features: extra features to be added to the feature
+ set requested from the server. See
+ CookerFeatures._feature_list for possible
+ features.
+ """
+ self.quiet = quiet
+
+ if self.tracking:
+ extrafeatures = [bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING]
+ else:
+ extrafeatures = []
+
+ if extra_features:
+ extrafeatures += extra_features
+
+ if not config_params:
+ config_params = TinfoilConfigParameters(config_only=config_only, quiet=quiet)
+
+ cookerconfig = CookerConfiguration()
+ cookerconfig.setConfigParameters(config_params)
+
+ if not config_only:
+ # Disable local loggers because the UI module is going to set up its own
+ for handler in self.localhandlers:
+ self.logger.handlers.remove(handler)
+ self.localhandlers = []
+
+ self.server_connection, ui_module = setup_bitbake(config_params,
+ cookerconfig,
+ extrafeatures)
+
+ self.ui_module = ui_module
+
+ # Ensure the path to bitbake's bin directory is in PATH so that things like
+ # bitbake-worker can be run (usually this is the case, but it doesn't have to be)
+ path = os.getenv('PATH').split(':')
+ bitbakebinpath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', 'bin'))
+ for entry in path:
+ if entry.endswith(os.sep):
+ entry = entry[:-1]
+ if os.path.abspath(entry) == bitbakebinpath:
+ break
+ else:
+ path.insert(0, bitbakebinpath)
+ os.environ['PATH'] = ':'.join(path)
+
+ if self.server_connection:
+ _server_connections.append(self.server_connection)
+ if config_only:
+ config_params.updateToServer(self.server_connection.connection, os.environ.copy())
+ self.run_command('parseConfiguration')
+ else:
+ self.run_actions(config_params)
+ self.recipes_parsed = True
+
+ self.config_data = bb.data.init()
+ connector = TinfoilDataStoreConnector(self, None)
+ self.config_data.setVar('_remote_data', connector)
+ self.cooker = TinfoilCookerAdapter(self)
+ self.cooker_data = self.cooker.recipecaches['']
+ else:
+ raise Exception('Failed to start bitbake server')
+
+ def run_actions(self, config_params):
+ """
+ Run the actions specified in config_params through the UI.
+ """
+ ret = self.ui_module.main(self.server_connection.connection, self.server_connection.events, config_params)
+ if ret:
+ raise TinfoilUIException(ret)
+
+ def parseRecipes(self):
+ """
+ Legacy function - use parse_recipes() instead.
+ """
+ self.parse_recipes()
+
+ def parse_recipes(self):
+ """
+ Load information on all recipes. Normally you should specify
+ config_only=False when calling prepare() instead of using this
+ function; this function is designed for situations where you need
+ to initialise Tinfoil and use it with config_only=True first and
+ then conditionally call this function to parse recipes later.
+ """
+ config_params = TinfoilConfigParameters(config_only=False)
+ self.run_actions(config_params)
+ self.recipes_parsed = True
+
+ def run_command(self, command, *params):
+ """
+ Run a command on the server (as implemented in bb.command).
+ Note that there are two types of command - synchronous and
+ asynchronous; in order to receive the results of asynchronous
+ commands you will need to set an appropriate event mask
+ using set_event_mask() and listen for the result using
+ wait_event() - with the correct event mask you'll at least get
+ bb.command.CommandCompleted and possibly other events before
+ that depending on the command.
+ """
+ if not self.server_connection:
+ raise Exception('Not connected to server (did you call .prepare()?)')
+
+ commandline = [command]
+ if params:
+ commandline.extend(params)
+ result = self.server_connection.connection.runCommand(commandline)
+ if result[1]:
+ raise TinfoilCommandFailed(result[1])
+ return result[0]
+
+ def set_event_mask(self, eventlist):
+ """Set the event mask which will be applied within wait_event()"""
+ if not self.server_connection:
+ raise Exception('Not connected to server (did you call .prepare()?)')
+ llevel, debug_domains = bb.msg.constructLogOptions()
+ ret = self.run_command('setEventMask', self.server_connection.connection.getEventHandle(), llevel, debug_domains, eventlist)
+ if not ret:
+ raise Exception('setEventMask failed')
+
+ def wait_event(self, timeout=0):
+ """
+ Wait for an event from the server for the specified time.
+ A timeout of 0 means don't wait if there are no events in the queue.
+ Returns the next event in the queue or None if the timeout was
+ reached. Note that in order to recieve any events you will
+ first need to set the internal event mask using set_event_mask()
+ (otherwise whatever event mask the UI set up will be in effect).
+ """
+ if not self.server_connection:
+ raise Exception('Not connected to server (did you call .prepare()?)')
+ return self.server_connection.events.waitEvent(timeout)
+
+ def get_overlayed_recipes(self):
+ """
+ Find recipes which are overlayed (i.e. where recipes exist in multiple layers)
+ """
+ return defaultdict(list, self.run_command('getOverlayedRecipes'))
+
+ def get_skipped_recipes(self):
+ """
+ Find recipes which were skipped (i.e. SkipRecipe was raised
+ during parsing).
+ """
+ return OrderedDict(self.run_command('getSkippedRecipes'))
+
+ def get_all_providers(self):
+ return defaultdict(list, self.run_command('allProviders'))
+
+ def find_providers(self):
+ return self.run_command('findProviders')
+
+ def find_best_provider(self, pn):
+ return self.run_command('findBestProvider', pn)
+
+ def get_runtime_providers(self, rdep):
+ return self.run_command('getRuntimeProviders', rdep)
+
+ def get_recipe_file(self, pn):
+ """
+ Get the file name for the specified recipe/target. Raises
+ bb.providers.NoProvider if there is no match or the recipe was
+ skipped.
+ """
+ best = self.find_best_provider(pn)
+ if not best or (len(best) > 3 and not best[3]):
+ skiplist = self.get_skipped_recipes()
+ taskdata = bb.taskdata.TaskData(None, skiplist=skiplist)
+ skipreasons = taskdata.get_reasons(pn)
+ if skipreasons:
+ raise bb.providers.NoProvider('%s is unavailable:\n %s' % (pn, ' \n'.join(skipreasons)))
+ else:
+ raise bb.providers.NoProvider('Unable to find any recipe file matching "%s"' % pn)
+ return best[3]
+
+ def get_file_appends(self, fn):
+ """
+ Find the bbappends for a recipe file
+ """
+ return self.run_command('getFileAppends', fn)
+
+ def all_recipes(self, mc='', sort=True):
+ """
+ Enable iterating over all recipes in the current configuration.
+ Returns an iterator over TinfoilRecipeInfo objects created on demand.
+ Parameters:
+ mc: The multiconfig, default of '' uses the main configuration.
+ sort: True to sort recipes alphabetically (default), False otherwise
+ """
+ recipecache = self.cooker.recipecaches[mc]
+ if sort:
+ recipes = sorted(recipecache.pkg_pn.items())
+ else:
+ recipes = recipecache.pkg_pn.items()
+ for pn, fns in recipes:
+ prov = self.find_best_provider(pn)
+ recipe = TinfoilRecipeInfo(recipecache,
+ self.config_data,
+ pn=pn,
+ fn=prov[3],
+ fns=fns)
+ yield recipe
+
+ def all_recipe_files(self, mc='', variants=True, preferred_only=False):
+ """
+ Enable iterating over all recipe files in the current configuration.
+ Returns an iterator over file paths.
+ Parameters:
+ mc: The multiconfig, default of '' uses the main configuration.
+ variants: True to include variants of recipes created through
+ BBCLASSEXTEND (default) or False to exclude them
+ preferred_only: True to include only the preferred recipe where
+ multiple exist providing the same PN, False to list
+ all recipes
+ """
+ recipecache = self.cooker.recipecaches[mc]
+ if preferred_only:
+ files = []
+ for pn in recipecache.pkg_pn.keys():
+ prov = self.find_best_provider(pn)
+ files.append(prov[3])
+ else:
+ files = recipecache.pkg_fn.keys()
+ for fn in sorted(files):
+ if not variants and fn.startswith('virtual:'):
+ continue
+ yield fn
+
+
+ def get_recipe_info(self, pn, mc=''):
+ """
+ Get information on a specific recipe in the current configuration by name (PN).
+ Returns a TinfoilRecipeInfo object created on demand.
+ Parameters:
+ mc: The multiconfig, default of '' uses the main configuration.
+ """
+ recipecache = self.cooker.recipecaches[mc]
+ prov = self.find_best_provider(pn)
+ fn = prov[3]
+ if fn:
+ actual_pn = recipecache.pkg_fn[fn]
+ recipe = TinfoilRecipeInfo(recipecache,
+ self.config_data,
+ pn=actual_pn,
+ fn=fn,
+ fns=recipecache.pkg_pn[actual_pn])
+ return recipe
+ else:
+ return None
+
+ def parse_recipe(self, pn):
+ """
+ Parse the specified recipe and return a datastore object
+ representing the environment for the recipe.
+ """
+ fn = self.get_recipe_file(pn)
+ return self.parse_recipe_file(fn)
+
+ def parse_recipe_file(self, fn, appends=True, appendlist=None, config_data=None):
+ """
+ Parse the specified recipe file (with or without bbappends)
+ and return a datastore object representing the environment
+ for the recipe.
+ Parameters:
+ fn: recipe file to parse - can be a file path or virtual
+ specification
+ appends: True to apply bbappends, False otherwise
+ appendlist: optional list of bbappend files to apply, if you
+ want to filter them
+ config_data: custom config datastore to use. NOTE: if you
+ specify config_data then you cannot use a virtual
+ specification for fn.
+ """
+ if self.tracking:
+ # Enable history tracking just for the parse operation
+ self.run_command('enableDataTracking')
+ try:
+ if appends and appendlist == []:
+ appends = False
+ if config_data:
+ dctr = bb.remotedata.RemoteDatastores.transmit_datastore(config_data)
+ dscon = self.run_command('parseRecipeFile', fn, appends, appendlist, dctr)
+ else:
+ dscon = self.run_command('parseRecipeFile', fn, appends, appendlist)
+ if dscon:
+ return self._reconvert_type(dscon, 'DataStoreConnectionHandle')
+ else:
+ return None
+ finally:
+ if self.tracking:
+ self.run_command('disableDataTracking')
+
+ def build_file(self, buildfile, task, internal=True):
+ """
+ Runs the specified task for just a single recipe (i.e. no dependencies).
+ This is equivalent to bitbake -b, except with the default internal=True
+ no warning about dependencies will be produced, normal info messages
+ from the runqueue will be silenced and BuildInit, BuildStarted and
+ BuildCompleted events will not be fired.
+ """
+ return self.run_command('buildFile', buildfile, task, internal)
+
+ def build_targets(self, targets, task=None, handle_events=True, extra_events=None, event_callback=None):
+ """
+ Builds the specified targets. This is equivalent to a normal invocation
+ of bitbake. Has built-in event handling which is enabled by default and
+ can be extended if needed.
+ Parameters:
+ targets:
+ One or more targets to build. Can be a list or a
+ space-separated string.
+ task:
+ The task to run; if None then the value of BB_DEFAULT_TASK
+ will be used. Default None.
+ handle_events:
+ True to handle events in a similar way to normal bitbake
+ invocation with knotty; False to return immediately (on the
+ assumption that the caller will handle the events instead).
+ Default True.
+ extra_events:
+ An optional list of events to add to the event mask (if
+ handle_events=True). If you add events here you also need
+ to specify a callback function in event_callback that will
+ handle the additional events. Default None.
+ event_callback:
+ An optional function taking a single parameter which
+ will be called first upon receiving any event (if
+ handle_events=True) so that the caller can override or
+ extend the event handling. Default None.
+ """
+ if isinstance(targets, str):
+ targets = targets.split()
+ if not task:
+ task = self.config_data.getVar('BB_DEFAULT_TASK')
+
+ if handle_events:
+ # A reasonable set of default events matching up with those we handle below
+ eventmask = [
+ 'bb.event.BuildStarted',
+ 'bb.event.BuildCompleted',
+ 'logging.LogRecord',
+ 'bb.event.NoProvider',
+ 'bb.command.CommandCompleted',
+ 'bb.command.CommandFailed',
+ 'bb.build.TaskStarted',
+ 'bb.build.TaskFailed',
+ 'bb.build.TaskSucceeded',
+ 'bb.build.TaskFailedSilent',
+ 'bb.build.TaskProgress',
+ 'bb.runqueue.runQueueTaskStarted',
+ 'bb.runqueue.sceneQueueTaskStarted',
+ 'bb.event.ProcessStarted',
+ 'bb.event.ProcessProgress',
+ 'bb.event.ProcessFinished',
+ ]
+ if extra_events:
+ eventmask.extend(extra_events)
+ ret = self.set_event_mask(eventmask)
+
+ includelogs = self.config_data.getVar('BBINCLUDELOGS')
+ loglines = self.config_data.getVar('BBINCLUDELOGS_LINES')
+
+ ret = self.run_command('buildTargets', targets, task)
+ if handle_events:
+ result = False
+ # Borrowed from knotty, instead somewhat hackily we use the helper
+ # as the object to store "shutdown" on
+ helper = bb.ui.uihelper.BBUIHelper()
+ # We set up logging optionally in the constructor so now we need to
+ # grab the handlers to pass to TerminalFilter
+ console = None
+ errconsole = None
+ for handler in self.logger.handlers:
+ if isinstance(handler, logging.StreamHandler):
+ if handler.stream == sys.stdout:
+ console = handler
+ elif handler.stream == sys.stderr:
+ errconsole = handler
+ format_str = "%(levelname)s: %(message)s"
+ format = bb.msg.BBLogFormatter(format_str)
+ helper.shutdown = 0
+ parseprogress = None
+ termfilter = bb.ui.knotty.TerminalFilter(helper, helper, console, errconsole, format, quiet=self.quiet)
+ try:
+ while True:
+ try:
+ event = self.wait_event(0.25)
+ if event:
+ if event_callback and event_callback(event):
+ continue
+ if helper.eventHandler(event):
+ if isinstance(event, bb.build.TaskFailedSilent):
+ logger.warning("Logfile for failed setscene task is %s" % event.logfile)
+ elif isinstance(event, bb.build.TaskFailed):
+ bb.ui.knotty.print_event_log(event, includelogs, loglines, termfilter)
+ continue
+ if isinstance(event, bb.event.ProcessStarted):
+ if self.quiet > 1:
+ continue
+ parseprogress = bb.ui.knotty.new_progress(event.processname, event.total)
+ parseprogress.start(False)
+ continue
+ if isinstance(event, bb.event.ProcessProgress):
+ if self.quiet > 1:
+ continue
+ if parseprogress:
+ parseprogress.update(event.progress)
+ else:
+ bb.warn("Got ProcessProgress event for someting that never started?")
+ continue
+ if isinstance(event, bb.event.ProcessFinished):
+ if self.quiet > 1:
+ continue
+ if parseprogress:
+ parseprogress.finish()
+ parseprogress = None
+ continue
+ if isinstance(event, bb.command.CommandCompleted):
+ result = True
+ break
+ if isinstance(event, bb.command.CommandFailed):
+ self.logger.error(str(event))
+ result = False
+ break
+ if isinstance(event, logging.LogRecord):
+ if event.taskpid == 0 or event.levelno > logging.INFO:
+ self.logger.handle(event)
+ continue
+ if isinstance(event, bb.event.NoProvider):
+ self.logger.error(str(event))
+ result = False
+ break
+
+ elif helper.shutdown > 1:
+ break
+ termfilter.updateFooter()
+ except KeyboardInterrupt:
+ termfilter.clearFooter()
+ if helper.shutdown == 1:
+ print("\nSecond Keyboard Interrupt, stopping...\n")
+ ret = self.run_command("stateForceShutdown")
+ if ret and ret[2]:
+ self.logger.error("Unable to cleanly stop: %s" % ret[2])
+ elif helper.shutdown == 0:
+ print("\nKeyboard Interrupt, closing down...\n")
+ interrupted = True
+ ret = self.run_command("stateShutdown")
+ if ret and ret[2]:
+ self.logger.error("Unable to cleanly shutdown: %s" % ret[2])
+ helper.shutdown = helper.shutdown + 1
+ termfilter.clearFooter()
+ finally:
+ termfilter.finish()
+ if helper.failed_tasks:
+ result = False
+ return result
+ else:
+ return ret
+
+ def shutdown(self):
+ """
+ Shut down tinfoil. Disconnects from the server and gracefully
+ releases any associated resources. You must call this function if
+ prepare() has been called, or use a with... block when you create
+ the tinfoil object which will ensure that it gets called.
+ """
+ if self.server_connection:
+ self.run_command('clientComplete')
+ _server_connections.remove(self.server_connection)
+ bb.event.ui_queue = []
+ self.server_connection.terminate()
+ self.server_connection = None
+
+ # Restore logging handlers to how it looked when we started
+ if self.oldhandlers:
+ for handler in self.logger.handlers:
+ if handler not in self.oldhandlers:
+ self.logger.handlers.remove(handler)
+
+ def _reconvert_type(self, obj, origtypename):
+ """
+ Convert an object back to the right type, in the case
+ that marshalling has changed it (especially with xmlrpc)
+ """
+ supported_types = {
+ 'set': set,
+ 'DataStoreConnectionHandle': bb.command.DataStoreConnectionHandle,
+ }
+
+ origtype = supported_types.get(origtypename, None)
+ if origtype is None:
+ raise Exception('Unsupported type "%s"' % origtypename)
+ if type(obj) == origtype:
+ newobj = obj
+ elif isinstance(obj, dict):
+ # New style class
+ newobj = origtype()
+ for k,v in obj.items():
+ setattr(newobj, k, v)
+ else:
+ # Assume we can coerce the type
+ newobj = origtype(obj)
+
+ if isinstance(newobj, bb.command.DataStoreConnectionHandle):
+ connector = TinfoilDataStoreConnector(self, newobj.dsindex)
+ newobj = bb.data.init()
+ newobj.setVar('_remote_data', connector)
+
+ return newobj
+
+
+class TinfoilConfigParameters(BitBakeConfigParameters):
+
+ def __init__(self, config_only, **options):
+ self.initial_options = options
+ # Apply some sane defaults
+ if not 'parse_only' in options:
+ self.initial_options['parse_only'] = not config_only
+ #if not 'status_only' in options:
+ # self.initial_options['status_only'] = config_only
+ if not 'ui' in options:
+ self.initial_options['ui'] = 'knotty'
+ if not 'argv' in options:
+ self.initial_options['argv'] = []
+
+ super(TinfoilConfigParameters, self).__init__()
+
+ def parseCommandLine(self, argv=None):
+ # We don't want any parameters parsed from the command line
+ opts = super(TinfoilConfigParameters, self).parseCommandLine([])
+ for key, val in self.initial_options.items():
+ setattr(opts[0], key, val)
+ return opts
diff --git a/poky/bitbake/lib/bb/ui/__init__.py b/poky/bitbake/lib/bb/ui/__init__.py
new file mode 100644
index 000000000..a4805ed02
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/__init__.py
@@ -0,0 +1,17 @@
+#
+# BitBake UI Implementation
+#
+# Copyright (C) 2006-2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
diff --git a/poky/bitbake/lib/bb/ui/buildinfohelper.py b/poky/bitbake/lib/bb/ui/buildinfohelper.py
new file mode 100644
index 000000000..524a5b094
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/buildinfohelper.py
@@ -0,0 +1,2002 @@
+#
+# BitBake ToasterUI Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import bb
+import re
+import os
+
+import django
+from django.utils import timezone
+
+import toaster
+# Add toaster module to the search path to help django.setup() find the right
+# modules
+sys.path.insert(0, os.path.dirname(toaster.__file__))
+
+#Set the DJANGO_SETTINGS_MODULE if it's not already set
+os.environ["DJANGO_SETTINGS_MODULE"] =\
+ os.environ.get("DJANGO_SETTINGS_MODULE",
+ "toaster.toastermain.settings")
+# Setup django framework (needs to be done before importing modules)
+django.setup()
+
+from orm.models import Build, Task, Recipe, Layer_Version, Layer, Target, LogMessage, HelpText
+from orm.models import Target_Image_File, TargetKernelFile, TargetSDKFile
+from orm.models import Variable, VariableHistory
+from orm.models import Package, Package_File, Target_Installed_Package, Target_File
+from orm.models import Task_Dependency, Package_Dependency
+from orm.models import Recipe_Dependency, Provides
+from orm.models import Project, CustomImagePackage
+from orm.models import signal_runbuilds
+
+from bldcontrol.models import BuildEnvironment, BuildRequest
+from bldcontrol.models import BRLayer
+from bldcontrol import bbcontroller
+
+from bb.msg import BBLogFormatter as formatter
+from django.db import models
+from pprint import pformat
+import logging
+from datetime import datetime, timedelta
+
+from django.db import transaction, connection
+
+
+# pylint: disable=invalid-name
+# the logger name is standard throughout BitBake
+logger = logging.getLogger("ToasterLogger")
+
+class NotExisting(Exception):
+ pass
+
+class ORMWrapper(object):
+ """ This class creates the dictionaries needed to store information in the database
+ following the format defined by the Django models. It is also used to save this
+ information in the database.
+ """
+
+ def __init__(self):
+ self.layer_version_objects = []
+ self.layer_version_built = []
+ self.task_objects = {}
+ self.recipe_objects = {}
+
+ @staticmethod
+ def _build_key(**kwargs):
+ key = "0"
+ for k in sorted(kwargs.keys()):
+ if isinstance(kwargs[k], models.Model):
+ key += "-%d" % kwargs[k].id
+ else:
+ key += "-%s" % str(kwargs[k])
+ return key
+
+
+ def _cached_get_or_create(self, clazz, **kwargs):
+ """ This is a memory-cached get_or_create. We assume that the objects will not be created in the
+ database through any other means.
+ """
+
+ assert issubclass(clazz, models.Model), "_cached_get_or_create needs to get the class as first argument"
+
+ key = ORMWrapper._build_key(**kwargs)
+ dictname = "objects_%s" % clazz.__name__
+ if not dictname in vars(self).keys():
+ vars(self)[dictname] = {}
+
+ created = False
+ if not key in vars(self)[dictname].keys():
+ vars(self)[dictname][key], created = \
+ clazz.objects.get_or_create(**kwargs)
+
+ return (vars(self)[dictname][key], created)
+
+
+ def _cached_get(self, clazz, **kwargs):
+ """ This is a memory-cached get. We assume that the objects will not change in the database between gets.
+ """
+ assert issubclass(clazz, models.Model), "_cached_get needs to get the class as first argument"
+
+ key = ORMWrapper._build_key(**kwargs)
+ dictname = "objects_%s" % clazz.__name__
+
+ if not dictname in vars(self).keys():
+ vars(self)[dictname] = {}
+
+ if not key in vars(self)[dictname].keys():
+ vars(self)[dictname][key] = clazz.objects.get(**kwargs)
+
+ return vars(self)[dictname][key]
+
+ def get_similar_target_with_image_files(self, target):
+ """
+ Get a Target object "similar" to target; i.e. with the same target
+ name ('core-image-minimal' etc.) and machine.
+ """
+ return target.get_similar_target_with_image_files()
+
+ def get_similar_target_with_sdk_files(self, target):
+ return target.get_similar_target_with_sdk_files()
+
+ def clone_image_artifacts(self, target_from, target_to):
+ target_to.clone_image_artifacts_from(target_from)
+
+ def clone_sdk_artifacts(self, target_from, target_to):
+ target_to.clone_sdk_artifacts_from(target_from)
+
+ def _timestamp_to_datetime(self, secs):
+ """
+ Convert timestamp in seconds to Python datetime
+ """
+ return timezone.make_aware(datetime(1970, 1, 1) + timedelta(seconds=secs))
+
+ # pylint: disable=no-self-use
+ # we disable detection of no self use in functions because the methods actually work on the object
+ # even if they don't touch self anywhere
+
+ # pylint: disable=bad-continuation
+ # we do not follow the python conventions for continuation indentation due to long lines here
+
+ def get_or_create_build_object(self, brbe):
+ prj = None
+ buildrequest = None
+ if brbe is not None:
+ # Toaster-triggered build
+ logger.debug(1, "buildinfohelper: brbe is %s" % brbe)
+ br, _ = brbe.split(":")
+ buildrequest = BuildRequest.objects.get(pk=br)
+ prj = buildrequest.project
+ else:
+ # CLI build
+ prj = Project.objects.get_or_create_default_project()
+ logger.debug(1, "buildinfohelper: project is not specified, defaulting to %s" % prj)
+
+ if buildrequest is not None:
+ # reuse existing Build object
+ build = buildrequest.build
+ build.project = prj
+ build.save()
+ else:
+ # create new Build object
+ now = timezone.now()
+ build = Build.objects.create(
+ project=prj,
+ started_on=now,
+ completed_on=now,
+ build_name='')
+
+ logger.debug(1, "buildinfohelper: build is created %s" % build)
+
+ if buildrequest is not None:
+ buildrequest.build = build
+ buildrequest.save()
+
+ return build
+
+ def update_build(self, build, data_dict):
+ for key in data_dict:
+ setattr(build, key, data_dict[key])
+ build.save()
+
+ @staticmethod
+ def get_or_create_targets(target_info):
+ """
+ NB get_or_create() is used here because for Toaster-triggered builds,
+ we already created the targets when the build was triggered.
+ """
+ result = []
+ for target in target_info['targets']:
+ task = ''
+ if ':' in target:
+ target, task = target.split(':', 1)
+ if task.startswith('do_'):
+ task = task[3:]
+ if task == 'build':
+ task = ''
+
+ obj, _ = Target.objects.get_or_create(build=target_info['build'],
+ target=target,
+ task=task)
+ result.append(obj)
+ return result
+
+ def update_build_stats_and_outcome(self, build, errors, warnings, taskfailures):
+ assert isinstance(build,Build)
+ assert isinstance(errors, int)
+ assert isinstance(warnings, int)
+
+ if build.outcome == Build.CANCELLED:
+ return
+ try:
+ if build.buildrequest.state == BuildRequest.REQ_CANCELLING:
+ return
+ except AttributeError:
+ # We may not have a buildrequest if this is a command line build
+ pass
+
+ outcome = Build.SUCCEEDED
+ if errors or taskfailures:
+ outcome = Build.FAILED
+
+ build.completed_on = timezone.now()
+ build.outcome = outcome
+ build.save()
+ signal_runbuilds()
+
+ def update_target_set_license_manifest(self, target, license_manifest_path):
+ target.license_manifest_path = license_manifest_path
+ target.save()
+
+ def update_target_set_package_manifest(self, target, package_manifest_path):
+ target.package_manifest_path = package_manifest_path
+ target.save()
+
+ def update_task_object(self, build, task_name, recipe_name, task_stats):
+ """
+ Find the task for build which matches the recipe and task name
+ to be stored
+ """
+ task_to_update = Task.objects.get(
+ build = build,
+ task_name = task_name,
+ recipe__name = recipe_name
+ )
+
+ if 'started' in task_stats and 'ended' in task_stats:
+ task_to_update.started = self._timestamp_to_datetime(task_stats['started'])
+ task_to_update.ended = self._timestamp_to_datetime(task_stats['ended'])
+ task_to_update.elapsed_time = (task_stats['ended'] - task_stats['started'])
+ task_to_update.cpu_time_user = task_stats.get('cpu_time_user')
+ task_to_update.cpu_time_system = task_stats.get('cpu_time_system')
+ if 'disk_io_read' in task_stats and 'disk_io_write' in task_stats:
+ task_to_update.disk_io_read = task_stats['disk_io_read']
+ task_to_update.disk_io_write = task_stats['disk_io_write']
+ task_to_update.disk_io = task_stats['disk_io_read'] + task_stats['disk_io_write']
+
+ task_to_update.save()
+
+ def get_update_task_object(self, task_information, must_exist = False):
+ assert 'build' in task_information
+ assert 'recipe' in task_information
+ assert 'task_name' in task_information
+
+ # we use must_exist info for database look-up optimization
+ task_object, created = self._cached_get_or_create(Task,
+ build=task_information['build'],
+ recipe=task_information['recipe'],
+ task_name=task_information['task_name']
+ )
+ if created and must_exist:
+ task_information['debug'] = "build id %d, recipe id %d" % (task_information['build'].pk, task_information['recipe'].pk)
+ raise NotExisting("Task object created when expected to exist", task_information)
+
+ object_changed = False
+ for v in vars(task_object):
+ if v in task_information.keys():
+ if vars(task_object)[v] != task_information[v]:
+ vars(task_object)[v] = task_information[v]
+ object_changed = True
+
+ # update setscene-related information if the task has a setscene
+ if task_object.outcome == Task.OUTCOME_COVERED and 1 == task_object.get_related_setscene().count():
+ task_object.outcome = Task.OUTCOME_CACHED
+ object_changed = True
+
+ outcome_task_setscene = Task.objects.get(task_executed=True, build = task_object.build,
+ recipe = task_object.recipe, task_name=task_object.task_name+"_setscene").outcome
+ if outcome_task_setscene == Task.OUTCOME_SUCCESS:
+ task_object.sstate_result = Task.SSTATE_RESTORED
+ object_changed = True
+ elif outcome_task_setscene == Task.OUTCOME_FAILED:
+ task_object.sstate_result = Task.SSTATE_FAILED
+ object_changed = True
+
+ if object_changed:
+ task_object.save()
+ return task_object
+
+
+ def get_update_recipe_object(self, recipe_information, must_exist = False):
+ assert 'layer_version' in recipe_information
+ assert 'file_path' in recipe_information
+ assert 'pathflags' in recipe_information
+
+ assert not recipe_information['file_path'].startswith("/") # we should have layer-relative paths at all times
+
+
+ def update_recipe_obj(recipe_object):
+ object_changed = False
+ for v in vars(recipe_object):
+ if v in recipe_information.keys():
+ object_changed = True
+ vars(recipe_object)[v] = recipe_information[v]
+
+ if object_changed:
+ recipe_object.save()
+
+ recipe, created = self._cached_get_or_create(Recipe, layer_version=recipe_information['layer_version'],
+ file_path=recipe_information['file_path'], pathflags = recipe_information['pathflags'])
+
+ update_recipe_obj(recipe)
+
+ built_recipe = None
+ # Create a copy of the recipe for historical puposes and update it
+ for built_layer in self.layer_version_built:
+ if built_layer.layer == recipe_information['layer_version'].layer:
+ built_recipe, c = self._cached_get_or_create(Recipe,
+ layer_version=built_layer,
+ file_path=recipe_information['file_path'],
+ pathflags = recipe_information['pathflags'])
+ update_recipe_obj(built_recipe)
+ break
+
+
+ # If we're in analysis mode or if this is a custom recipe
+ # then we are wholly responsible for the data
+ # and therefore we return the 'real' recipe rather than the build
+ # history copy of the recipe.
+ if recipe_information['layer_version'].build is not None and \
+ recipe_information['layer_version'].build.project == \
+ Project.objects.get_or_create_default_project():
+ return recipe
+
+ if built_recipe is None:
+ return recipe
+
+ return built_recipe
+
+ def get_update_layer_version_object(self, build_obj, layer_obj, layer_version_information):
+ if isinstance(layer_obj, Layer_Version):
+ # We already found our layer version for this build so just
+ # update it with the new build information
+ logger.debug("We found our layer from toaster")
+ layer_obj.local_path = layer_version_information['local_path']
+ layer_obj.save()
+ self.layer_version_objects.append(layer_obj)
+
+ # create a new copy of this layer version as a snapshot for
+ # historical purposes
+ layer_copy, c = Layer_Version.objects.get_or_create(
+ build=build_obj,
+ layer=layer_obj.layer,
+ release=layer_obj.release,
+ branch=layer_version_information['branch'],
+ commit=layer_version_information['commit'],
+ local_path=layer_version_information['local_path'],
+ )
+
+ logger.debug("Created new layer version %s for build history",
+ layer_copy.layer.name)
+
+ self.layer_version_built.append(layer_copy)
+
+ return layer_obj
+
+ assert isinstance(build_obj, Build)
+ assert isinstance(layer_obj, Layer)
+ assert 'branch' in layer_version_information
+ assert 'commit' in layer_version_information
+ assert 'priority' in layer_version_information
+ assert 'local_path' in layer_version_information
+
+ # If we're doing a command line build then associate this new layer with the
+ # project to avoid it 'contaminating' toaster data
+ project = None
+ if build_obj.project == Project.objects.get_or_create_default_project():
+ project = build_obj.project
+
+ layer_version_object, _ = Layer_Version.objects.get_or_create(
+ build = build_obj,
+ layer = layer_obj,
+ branch = layer_version_information['branch'],
+ commit = layer_version_information['commit'],
+ priority = layer_version_information['priority'],
+ local_path = layer_version_information['local_path'],
+ project=project)
+
+ self.layer_version_objects.append(layer_version_object)
+
+ return layer_version_object
+
+ def get_update_layer_object(self, layer_information, brbe):
+ assert 'name' in layer_information
+ assert 'layer_index_url' in layer_information
+
+ # From command line builds we have no brbe as the request is directly
+ # from bitbake
+ if brbe is None:
+ # If we don't have git commit sha then we're using a non-git
+ # layer so set the layer_source_dir to identify it as such
+ if not layer_information['version']['commit']:
+ local_source_dir = layer_information["local_path"]
+ else:
+ local_source_dir = None
+
+ layer_object, _ = \
+ Layer.objects.get_or_create(
+ name=layer_information['name'],
+ local_source_dir=local_source_dir,
+ layer_index_url=layer_information['layer_index_url'])
+
+ return layer_object
+ else:
+ br_id, be_id = brbe.split(":")
+
+ # Find the layer version by matching the layer event information
+ # against the metadata we have in Toaster
+
+ try:
+ br_layer = BRLayer.objects.get(req=br_id,
+ name=layer_information['name'])
+ return br_layer.layer_version
+ except (BRLayer.MultipleObjectsReturned, BRLayer.DoesNotExist):
+ # There are multiple of the same layer name or the name
+ # hasn't been determined by the toaster.bbclass layer
+ # so let's filter by the local_path
+ bc = bbcontroller.getBuildEnvironmentController(pk=be_id)
+ for br_layer in BRLayer.objects.filter(req=br_id):
+ if br_layer.giturl and \
+ layer_information['local_path'].endswith(
+ bc.getGitCloneDirectory(br_layer.giturl,
+ br_layer.commit)):
+ return br_layer.layer_version
+
+ if br_layer.local_source_dir == \
+ layer_information['local_path']:
+ return br_layer.layer_version
+
+ # We've reached the end of our search and couldn't find the layer
+ # we can continue but some data may be missing
+ raise NotExisting("Unidentified layer %s" %
+ pformat(layer_information))
+
+ def save_target_file_information(self, build_obj, target_obj, filedata):
+ assert isinstance(build_obj, Build)
+ assert isinstance(target_obj, Target)
+ dirs = filedata['dirs']
+ files = filedata['files']
+ syms = filedata['syms']
+
+ # always create the root directory as a special case;
+ # note that this is never displayed, so the owner, group,
+ # size, permission are irrelevant
+ tf_obj = Target_File.objects.create(target = target_obj,
+ path = '/',
+ size = 0,
+ owner = '',
+ group = '',
+ permission = '',
+ inodetype = Target_File.ITYPE_DIRECTORY)
+ tf_obj.save()
+
+ # insert directories, ordered by name depth
+ for d in sorted(dirs, key=lambda x:len(x[-1].split("/"))):
+ (user, group, size) = d[1:4]
+ permission = d[0][1:]
+ path = d[4].lstrip(".")
+
+ # we already created the root directory, so ignore any
+ # entry for it
+ if len(path) == 0:
+ continue
+
+ parent_path = "/".join(path.split("/")[:len(path.split("/")) - 1])
+ if len(parent_path) == 0:
+ parent_path = "/"
+ parent_obj = self._cached_get(Target_File, target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY)
+ tf_obj = Target_File.objects.create(
+ target = target_obj,
+ path = path,
+ size = size,
+ inodetype = Target_File.ITYPE_DIRECTORY,
+ permission = permission,
+ owner = user,
+ group = group,
+ directory = parent_obj)
+
+
+ # we insert files
+ for d in files:
+ (user, group, size) = d[1:4]
+ permission = d[0][1:]
+ path = d[4].lstrip(".")
+ parent_path = "/".join(path.split("/")[:len(path.split("/")) - 1])
+ inodetype = Target_File.ITYPE_REGULAR
+ if d[0].startswith('b'):
+ inodetype = Target_File.ITYPE_BLOCK
+ if d[0].startswith('c'):
+ inodetype = Target_File.ITYPE_CHARACTER
+ if d[0].startswith('p'):
+ inodetype = Target_File.ITYPE_FIFO
+
+ tf_obj = Target_File.objects.create(
+ target = target_obj,
+ path = path,
+ size = size,
+ inodetype = inodetype,
+ permission = permission,
+ owner = user,
+ group = group)
+ parent_obj = self._cached_get(Target_File, target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY)
+ tf_obj.directory = parent_obj
+ tf_obj.save()
+
+ # we insert symlinks
+ for d in syms:
+ (user, group, size) = d[1:4]
+ permission = d[0][1:]
+ path = d[4].lstrip(".")
+ filetarget_path = d[6]
+
+ parent_path = "/".join(path.split("/")[:len(path.split("/")) - 1])
+ if not filetarget_path.startswith("/"):
+ # we have a relative path, get a normalized absolute one
+ filetarget_path = parent_path + "/" + filetarget_path
+ fcp = filetarget_path.split("/")
+ fcpl = []
+ for i in fcp:
+ if i == "..":
+ fcpl.pop()
+ else:
+ fcpl.append(i)
+ filetarget_path = "/".join(fcpl)
+
+ try:
+ filetarget_obj = Target_File.objects.get(target = target_obj, path = filetarget_path)
+ except Target_File.DoesNotExist:
+ # we might have an invalid link; no way to detect this. just set it to None
+ filetarget_obj = None
+
+ parent_obj = Target_File.objects.get(target = target_obj, path = parent_path, inodetype = Target_File.ITYPE_DIRECTORY)
+
+ tf_obj = Target_File.objects.create(
+ target = target_obj,
+ path = path,
+ size = size,
+ inodetype = Target_File.ITYPE_SYMLINK,
+ permission = permission,
+ owner = user,
+ group = group,
+ directory = parent_obj,
+ sym_target = filetarget_obj)
+
+
+ def save_target_package_information(self, build_obj, target_obj, packagedict, pkgpnmap, recipes, built_package=False):
+ assert isinstance(build_obj, Build)
+ assert isinstance(target_obj, Target)
+
+ errormsg = ""
+ for p in packagedict:
+ # Search name swtiches round the installed name vs package name
+ # by default installed name == package name
+ searchname = p
+ if p not in pkgpnmap:
+ logger.warning("Image packages list contains %p, but is"
+ " missing from all packages list where the"
+ " metadata comes from. Skipping...", p)
+ continue
+
+ if 'OPKGN' in pkgpnmap[p].keys():
+ searchname = pkgpnmap[p]['OPKGN']
+
+ built_recipe = recipes[pkgpnmap[p]['PN']]
+
+ if built_package:
+ packagedict[p]['object'], created = Package.objects.get_or_create( build = build_obj, name = searchname )
+ recipe = built_recipe
+ else:
+ packagedict[p]['object'], created = \
+ CustomImagePackage.objects.get_or_create(name=searchname)
+ # Clear the Package_Dependency objects as we're going to update
+ # the CustomImagePackage with the latest dependency information
+ packagedict[p]['object'].package_dependencies_target.all().delete()
+ packagedict[p]['object'].package_dependencies_source.all().delete()
+ try:
+ recipe = self._cached_get(
+ Recipe,
+ name=built_recipe.name,
+ layer_version__build=None,
+ layer_version__release=
+ built_recipe.layer_version.release,
+ file_path=built_recipe.file_path,
+ version=built_recipe.version
+ )
+ except (Recipe.DoesNotExist,
+ Recipe.MultipleObjectsReturned) as e:
+ logger.info("We did not find one recipe for the"
+ "configuration data package %s %s" % (p, e))
+ continue
+
+ if created or packagedict[p]['object'].size == -1: # save the data anyway we can, not just if it was not created here; bug [YOCTO #6887]
+ # fill in everything we can from the runtime-reverse package data
+ try:
+ packagedict[p]['object'].recipe = recipe
+ packagedict[p]['object'].version = pkgpnmap[p]['PV']
+ packagedict[p]['object'].installed_name = p
+ packagedict[p]['object'].revision = pkgpnmap[p]['PR']
+ packagedict[p]['object'].license = pkgpnmap[p]['LICENSE']
+ packagedict[p]['object'].section = pkgpnmap[p]['SECTION']
+ packagedict[p]['object'].summary = pkgpnmap[p]['SUMMARY']
+ packagedict[p]['object'].description = pkgpnmap[p]['DESCRIPTION']
+ packagedict[p]['object'].size = int(pkgpnmap[p]['PKGSIZE'])
+
+ # no files recorded for this package, so save files info
+ packagefile_objects = []
+ for targetpath in pkgpnmap[p]['FILES_INFO']:
+ targetfilesize = pkgpnmap[p]['FILES_INFO'][targetpath]
+ packagefile_objects.append(Package_File( package = packagedict[p]['object'],
+ path = targetpath,
+ size = targetfilesize))
+ if len(packagefile_objects):
+ Package_File.objects.bulk_create(packagefile_objects)
+ except KeyError as e:
+ errormsg += " stpi: Key error, package %s key %s \n" % ( p, e )
+
+ # save disk installed size
+ packagedict[p]['object'].installed_size = packagedict[p]['size']
+ packagedict[p]['object'].save()
+
+ if built_package:
+ Target_Installed_Package.objects.create(target = target_obj, package = packagedict[p]['object'])
+
+ packagedeps_objs = []
+ for p in packagedict:
+ for (px,deptype) in packagedict[p]['depends']:
+ if deptype == 'depends':
+ tdeptype = Package_Dependency.TYPE_TRDEPENDS
+ elif deptype == 'recommends':
+ tdeptype = Package_Dependency.TYPE_TRECOMMENDS
+
+ try:
+ packagedeps_objs.append(Package_Dependency(
+ package = packagedict[p]['object'],
+ depends_on = packagedict[px]['object'],
+ dep_type = tdeptype,
+ target = target_obj))
+ except KeyError as e:
+ logger.warning("Could not add dependency to the package %s "
+ "because %s is an unknown package", p, px)
+
+ if len(packagedeps_objs) > 0:
+ Package_Dependency.objects.bulk_create(packagedeps_objs)
+ else:
+ logger.info("No package dependencies created")
+
+ if len(errormsg) > 0:
+ logger.warning("buildinfohelper: target_package_info could not identify recipes: \n%s", errormsg)
+
+ def save_target_image_file_information(self, target_obj, file_name, file_size):
+ Target_Image_File.objects.create(target=target_obj,
+ file_name=file_name, file_size=file_size)
+
+ def save_target_kernel_file(self, target_obj, file_name, file_size):
+ """
+ Save kernel file (bzImage, modules*) information for a Target target_obj.
+ """
+ TargetKernelFile.objects.create(target=target_obj,
+ file_name=file_name, file_size=file_size)
+
+ def save_target_sdk_file(self, target_obj, file_name, file_size):
+ """
+ Save SDK artifacts to the database, associating them with a
+ Target object.
+ """
+ TargetSDKFile.objects.create(target=target_obj, file_name=file_name,
+ file_size=file_size)
+
+ def create_logmessage(self, log_information):
+ assert 'build' in log_information
+ assert 'level' in log_information
+ assert 'message' in log_information
+
+ log_object = LogMessage.objects.create(
+ build = log_information['build'],
+ level = log_information['level'],
+ message = log_information['message'])
+
+ for v in vars(log_object):
+ if v in log_information.keys():
+ vars(log_object)[v] = log_information[v]
+
+ return log_object.save()
+
+
+ def save_build_package_information(self, build_obj, package_info, recipes,
+ built_package):
+ # assert isinstance(build_obj, Build)
+
+ if not 'PN' in package_info.keys():
+ # no package data to save (e.g. 'OPKGN'="lib64-*"|"lib32-*")
+ return None
+
+ # create and save the object
+ pname = package_info['PKG']
+ built_recipe = recipes[package_info['PN']]
+ if 'OPKGN' in package_info.keys():
+ pname = package_info['OPKGN']
+
+ if built_package:
+ bp_object, _ = Package.objects.get_or_create( build = build_obj,
+ name = pname )
+ recipe = built_recipe
+ else:
+ bp_object, created = \
+ CustomImagePackage.objects.get_or_create(name=pname)
+ try:
+ recipe = self._cached_get(Recipe,
+ name=built_recipe.name,
+ layer_version__build=None,
+ file_path=built_recipe.file_path,
+ version=built_recipe.version)
+
+ except (Recipe.DoesNotExist, Recipe.MultipleObjectsReturned):
+ logger.debug("We did not find one recipe for the configuration"
+ "data package %s" % pname)
+ return
+
+ bp_object.installed_name = package_info['PKG']
+ bp_object.recipe = recipe
+ bp_object.version = package_info['PKGV']
+ bp_object.revision = package_info['PKGR']
+ bp_object.summary = package_info['SUMMARY']
+ bp_object.description = package_info['DESCRIPTION']
+ bp_object.size = int(package_info['PKGSIZE'])
+ bp_object.section = package_info['SECTION']
+ bp_object.license = package_info['LICENSE']
+ bp_object.save()
+
+ # save any attached file information
+ packagefile_objects = []
+ for path in package_info['FILES_INFO']:
+ packagefile_objects.append(Package_File( package = bp_object,
+ path = path,
+ size = package_info['FILES_INFO'][path] ))
+ if len(packagefile_objects):
+ Package_File.objects.bulk_create(packagefile_objects)
+
+ def _po_byname(p):
+ if built_package:
+ pkg, created = Package.objects.get_or_create(build=build_obj,
+ name=p)
+ else:
+ pkg, created = CustomImagePackage.objects.get_or_create(name=p)
+
+ if created:
+ pkg.size = -1
+ pkg.save()
+ return pkg
+
+ packagedeps_objs = []
+ # save soft dependency information
+ if 'RDEPENDS' in package_info and package_info['RDEPENDS']:
+ for p in bb.utils.explode_deps(package_info['RDEPENDS']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RDEPENDS))
+ if 'RPROVIDES' in package_info and package_info['RPROVIDES']:
+ for p in bb.utils.explode_deps(package_info['RPROVIDES']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RPROVIDES))
+ if 'RRECOMMENDS' in package_info and package_info['RRECOMMENDS']:
+ for p in bb.utils.explode_deps(package_info['RRECOMMENDS']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RRECOMMENDS))
+ if 'RSUGGESTS' in package_info and package_info['RSUGGESTS']:
+ for p in bb.utils.explode_deps(package_info['RSUGGESTS']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RSUGGESTS))
+ if 'RREPLACES' in package_info and package_info['RREPLACES']:
+ for p in bb.utils.explode_deps(package_info['RREPLACES']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RREPLACES))
+ if 'RCONFLICTS' in package_info and package_info['RCONFLICTS']:
+ for p in bb.utils.explode_deps(package_info['RCONFLICTS']):
+ packagedeps_objs.append(Package_Dependency( package = bp_object,
+ depends_on = _po_byname(p), dep_type = Package_Dependency.TYPE_RCONFLICTS))
+
+ if len(packagedeps_objs) > 0:
+ Package_Dependency.objects.bulk_create(packagedeps_objs)
+
+ return bp_object
+
+ def save_build_variables(self, build_obj, vardump):
+ assert isinstance(build_obj, Build)
+
+ for k in vardump:
+ desc = vardump[k]['doc']
+ if desc is None:
+ var_words = [word for word in k.split('_')]
+ root_var = "_".join([word for word in var_words if word.isupper()])
+ if root_var and root_var != k and root_var in vardump:
+ desc = vardump[root_var]['doc']
+ if desc is None:
+ desc = ''
+ if len(desc):
+ HelpText.objects.get_or_create(build=build_obj,
+ area=HelpText.VARIABLE,
+ key=k, text=desc)
+ if not bool(vardump[k]['func']):
+ value = vardump[k]['v']
+ if value is None:
+ value = ''
+ variable_obj = Variable.objects.create( build = build_obj,
+ variable_name = k,
+ variable_value = value,
+ description = desc)
+
+ varhist_objects = []
+ for vh in vardump[k]['history']:
+ if not 'documentation.conf' in vh['file']:
+ varhist_objects.append(VariableHistory( variable = variable_obj,
+ file_name = vh['file'],
+ line_number = vh['line'],
+ operation = vh['op']))
+ if len(varhist_objects):
+ VariableHistory.objects.bulk_create(varhist_objects)
+
+
+class MockEvent(object):
+ """ This object is used to create event, for which normal event-processing methods can
+ be used, out of data that is not coming via an actual event
+ """
+ def __init__(self):
+ self.msg = None
+ self.levelno = None
+ self.taskname = None
+ self.taskhash = None
+ self.pathname = None
+ self.lineno = None
+
+ def getMessage(self):
+ """
+ Simulate LogRecord message return
+ """
+ return self.msg
+
+
+class BuildInfoHelper(object):
+ """ This class gathers the build information from the server and sends it
+ towards the ORM wrapper for storing in the database
+ It is instantiated once per build
+ Keeps in memory all data that needs matching before writing it to the database
+ """
+
+ # tasks which produce image files; note we include '', as we set
+ # the task for a target to '' (i.e. 'build') if no target is
+ # explicitly defined
+ IMAGE_GENERATING_TASKS = ['', 'build', 'image', 'populate_sdk_ext']
+
+ # pylint: disable=protected-access
+ # the code will look into the protected variables of the event; no easy way around this
+ # pylint: disable=bad-continuation
+ # we do not follow the python conventions for continuation indentation due to long lines here
+
+ def __init__(self, server, has_build_history = False, brbe = None):
+ self.internal_state = {}
+ self.internal_state['taskdata'] = {}
+ self.internal_state['targets'] = []
+ self.task_order = 0
+ self.autocommit_step = 1
+ self.server = server
+ # we use manual transactions if the database doesn't autocommit on us
+ if not connection.features.autocommits_when_autocommit_is_off:
+ transaction.set_autocommit(False)
+ self.orm_wrapper = ORMWrapper()
+ self.has_build_history = has_build_history
+ self.tmp_dir = self.server.runCommand(["getVariable", "TMPDIR"])[0]
+
+ # this is set for Toaster-triggered builds by localhostbecontroller
+ # via toasterui
+ self.brbe = brbe
+
+ self.project = None
+
+ logger.debug(1, "buildinfohelper: Build info helper inited %s" % vars(self))
+
+
+ ###################
+ ## methods to convert event/external info into objects that the ORM layer uses
+
+ def _ensure_build(self):
+ """
+ Ensure the current build object exists and is up to date with
+ data on the bitbake server
+ """
+ if not 'build' in self.internal_state or not self.internal_state['build']:
+ # create the Build object
+ self.internal_state['build'] = \
+ self.orm_wrapper.get_or_create_build_object(self.brbe)
+
+ build = self.internal_state['build']
+
+ # update missing fields on the Build object with found data
+ build_info = {}
+
+ # set to True if at least one field is going to be set
+ changed = False
+
+ if not build.build_name:
+ build_name = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
+
+ # only reset the build name if the one on the server is actually
+ # a valid value for the build_name field
+ if build_name != None:
+ build_info['build_name'] = build_name
+ changed = True
+
+ if not build.machine:
+ build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
+ changed = True
+
+ if not build.distro:
+ build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
+ changed = True
+
+ if not build.distro_version:
+ build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
+ changed = True
+
+ if not build.bitbake_version:
+ build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
+ changed = True
+
+ if changed:
+ self.orm_wrapper.update_build(self.internal_state['build'], build_info)
+
+ def _get_task_information(self, event, recipe):
+ assert 'taskname' in vars(event)
+ self._ensure_build()
+
+ task_information = {}
+ task_information['build'] = self.internal_state['build']
+ task_information['outcome'] = Task.OUTCOME_NA
+ task_information['recipe'] = recipe
+ task_information['task_name'] = event.taskname
+ try:
+ # some tasks don't come with a hash. and that's ok
+ task_information['sstate_checksum'] = event.taskhash
+ except AttributeError:
+ pass
+ return task_information
+
+ def _get_layer_version_for_dependency(self, pathRE):
+ """ Returns the layer in the toaster db that has a full regex
+ match to the pathRE. pathRE - the layer path passed as a regex in the
+ event. It is created in cooker.py as a collection for the layer
+ priorities.
+ """
+ self._ensure_build()
+
+ def _sort_longest_path(layer_version):
+ assert isinstance(layer_version, Layer_Version)
+ return len(layer_version.local_path)
+
+ # Our paths don't append a trailing slash
+ if pathRE.endswith("/"):
+ pathRE = pathRE[:-1]
+
+ p = re.compile(pathRE)
+ path=re.sub(r'[$^]',r'',pathRE)
+ # Heuristics: we always match recipe to the deepest layer path in
+ # the discovered layers
+ for lvo in sorted(self.orm_wrapper.layer_version_objects,
+ reverse=True, key=_sort_longest_path):
+ if p.fullmatch(os.path.abspath(lvo.local_path)):
+ return lvo
+ if lvo.layer.local_source_dir:
+ if p.fullmatch(os.path.abspath(lvo.layer.local_source_dir)):
+ return lvo
+ if 0 == path.find(lvo.local_path):
+ # sub-layer path inside existing layer
+ return lvo
+
+ # if we get here, we didn't read layers correctly;
+ # dump whatever information we have on the error log
+ logger.warning("Could not match layer dependency for path %s : %s",
+ pathRE,
+ self.orm_wrapper.layer_version_objects)
+ return None
+
+ def _get_layer_version_for_path(self, path):
+ self._ensure_build()
+
+ def _slkey_interactive(layer_version):
+ assert isinstance(layer_version, Layer_Version)
+ return len(layer_version.local_path)
+
+ # Heuristics: we always match recipe to the deepest layer path in the discovered layers
+ for lvo in sorted(self.orm_wrapper.layer_version_objects, reverse=True, key=_slkey_interactive):
+ # we can match to the recipe file path
+ if path.startswith(lvo.local_path):
+ return lvo
+ if lvo.layer.local_source_dir and \
+ path.startswith(lvo.layer.local_source_dir):
+ return lvo
+
+ #if we get here, we didn't read layers correctly; dump whatever information we have on the error log
+ logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
+
+ #mockup the new layer
+ unknown_layer, _ = Layer.objects.get_or_create(name="Unidentified layer", layer_index_url="")
+ unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build'])
+
+ # append it so we don't run into this error again and again
+ self.orm_wrapper.layer_version_objects.append(unknown_layer_version_obj)
+
+ return unknown_layer_version_obj
+
+ def _get_recipe_information_from_taskfile(self, taskfile):
+ localfilepath = taskfile.split(":")[-1]
+ filepath_flags = ":".join(sorted(taskfile.split(":")[:-1]))
+ layer_version_obj = self._get_layer_version_for_path(localfilepath)
+
+
+
+ recipe_info = {}
+ recipe_info['layer_version'] = layer_version_obj
+ recipe_info['file_path'] = localfilepath
+ recipe_info['pathflags'] = filepath_flags
+
+ if recipe_info['file_path'].startswith(recipe_info['layer_version'].local_path):
+ recipe_info['file_path'] = recipe_info['file_path'][len(recipe_info['layer_version'].local_path):].lstrip("/")
+ else:
+ raise RuntimeError("Recipe file path %s is not under layer version at %s" % (recipe_info['file_path'], recipe_info['layer_version'].local_path))
+
+ return recipe_info
+
+ def _get_path_information(self, task_object):
+ self._ensure_build()
+
+ assert isinstance(task_object, Task)
+ build_stats_format = "{tmpdir}/buildstats/{buildname}/{package}/"
+ build_stats_path = []
+
+ for t in self.internal_state['targets']:
+ buildname = self.internal_state['build'].build_name
+ pe, pv = task_object.recipe.version.split(":",1)
+ if len(pe) > 0:
+ package = task_object.recipe.name + "-" + pe + "_" + pv
+ else:
+ package = task_object.recipe.name + "-" + pv
+
+ build_stats_path.append(build_stats_format.format(tmpdir=self.tmp_dir,
+ buildname=buildname,
+ package=package))
+
+ return build_stats_path
+
+
+ ################################
+ ## external available methods to store information
+ @staticmethod
+ def _get_data_from_event(event):
+ evdata = None
+ if '_localdata' in vars(event):
+ evdata = event._localdata
+ elif 'data' in vars(event):
+ evdata = event.data
+ else:
+ raise Exception("Event with neither _localdata or data properties")
+ return evdata
+
+ def store_layer_info(self, event):
+ layerinfos = BuildInfoHelper._get_data_from_event(event)
+ self.internal_state['lvs'] = {}
+ for layer in layerinfos:
+ try:
+ self.internal_state['lvs'][self.orm_wrapper.get_update_layer_object(layerinfos[layer], self.brbe)] = layerinfos[layer]['version']
+ self.internal_state['lvs'][self.orm_wrapper.get_update_layer_object(layerinfos[layer], self.brbe)]['local_path'] = layerinfos[layer]['local_path']
+ except NotExisting as nee:
+ logger.warning("buildinfohelper: cannot identify layer exception:%s ", nee)
+
+ def store_started_build(self):
+ self._ensure_build()
+
+ def save_build_log_file_path(self, build_log_path):
+ self._ensure_build()
+
+ if not self.internal_state['build'].cooker_log_path:
+ data_dict = {'cooker_log_path': build_log_path}
+ self.orm_wrapper.update_build(self.internal_state['build'], data_dict)
+
+ def save_build_targets(self, event):
+ self._ensure_build()
+
+ # create target information
+ assert '_pkgs' in vars(event)
+ target_information = {}
+ target_information['targets'] = event._pkgs
+ target_information['build'] = self.internal_state['build']
+
+ self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
+
+ def save_build_layers_and_variables(self):
+ self._ensure_build()
+
+ build_obj = self.internal_state['build']
+
+ # save layer version information for this build
+ if not 'lvs' in self.internal_state:
+ logger.error("Layer version information not found; Check if the bitbake server was configured to inherit toaster.bbclass.")
+ else:
+ for layer_obj in self.internal_state['lvs']:
+ self.orm_wrapper.get_update_layer_version_object(build_obj, layer_obj, self.internal_state['lvs'][layer_obj])
+
+ del self.internal_state['lvs']
+
+ # Save build configuration
+ data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]
+
+ # convert the paths from absolute to relative to either the build directory or layer checkouts
+ path_prefixes = []
+
+ if self.brbe is not None:
+ _, be_id = self.brbe.split(":")
+ be = BuildEnvironment.objects.get(pk = be_id)
+ path_prefixes.append(be.builddir)
+
+ for layer in sorted(self.orm_wrapper.layer_version_objects, key = lambda x:len(x.local_path), reverse=True):
+ path_prefixes.append(layer.local_path)
+
+ # we strip the prefixes
+ for k in data:
+ if not bool(data[k]['func']):
+ for vh in data[k]['history']:
+ if not 'documentation.conf' in vh['file']:
+ abs_file_name = vh['file']
+ for pp in path_prefixes:
+ if abs_file_name.startswith(pp + "/"):
+ # preserve layer name in relative path
+ vh['file']=abs_file_name[pp.rfind("/")+1:]
+ break
+
+ # save the variables
+ self.orm_wrapper.save_build_variables(build_obj, data)
+
+ return self.brbe
+
+ def set_recipes_to_parse(self, num_recipes):
+ """
+ Set the number of recipes which need to be parsed for this build.
+ This is set the first time ParseStarted is received by toasterui.
+ """
+ self._ensure_build()
+ self.internal_state['build'].recipes_to_parse = num_recipes
+ self.internal_state['build'].save()
+
+ def set_recipes_parsed(self, num_recipes):
+ """
+ Set the number of recipes parsed so far for this build; this is updated
+ each time a ParseProgress or ParseCompleted event is received by
+ toasterui.
+ """
+ self._ensure_build()
+ if num_recipes <= self.internal_state['build'].recipes_to_parse:
+ self.internal_state['build'].recipes_parsed = num_recipes
+ self.internal_state['build'].save()
+
+ def update_target_image_file(self, event):
+ evdata = BuildInfoHelper._get_data_from_event(event)
+
+ for t in self.internal_state['targets']:
+ if t.is_image == True:
+ output_files = list(evdata.keys())
+ for output in output_files:
+ if t.target in output and 'rootfs' in output and not output.endswith(".manifest"):
+ self.orm_wrapper.save_target_image_file_information(t, output, evdata[output])
+
+ def update_artifact_image_file(self, event):
+ self._ensure_build()
+ evdata = BuildInfoHelper._get_data_from_event(event)
+ for artifact_path in evdata.keys():
+ self.orm_wrapper.save_artifact_information(
+ self.internal_state['build'], artifact_path,
+ evdata[artifact_path])
+
+ def update_build_information(self, event, errors, warnings, taskfailures):
+ self._ensure_build()
+ self.orm_wrapper.update_build_stats_and_outcome(
+ self.internal_state['build'], errors, warnings, taskfailures)
+
+ def store_started_task(self, event):
+ assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
+ assert 'taskfile' in vars(event)
+ localfilepath = event.taskfile.split(":")[-1]
+ assert localfilepath.startswith("/")
+
+ identifier = event.taskfile + ":" + event.taskname
+
+ recipe_information = self._get_recipe_information_from_taskfile(event.taskfile)
+ recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True)
+
+ task_information = self._get_task_information(event, recipe)
+ task_information['outcome'] = Task.OUTCOME_NA
+
+ if isinstance(event, bb.runqueue.runQueueTaskSkipped):
+ assert 'reason' in vars(event)
+ task_information['task_executed'] = False
+ if event.reason == "covered":
+ task_information['outcome'] = Task.OUTCOME_COVERED
+ if event.reason == "existing":
+ task_information['outcome'] = Task.OUTCOME_PREBUILT
+ else:
+ task_information['task_executed'] = True
+ if 'noexec' in vars(event) and event.noexec == True:
+ task_information['task_executed'] = False
+ task_information['outcome'] = Task.OUTCOME_EMPTY
+ task_information['script_type'] = Task.CODING_NA
+
+ # do not assign order numbers to scene tasks
+ if not isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+ self.task_order += 1
+ task_information['order'] = self.task_order
+
+ self.orm_wrapper.get_update_task_object(task_information)
+
+ self.internal_state['taskdata'][identifier] = {
+ 'outcome': task_information['outcome'],
+ }
+
+
+ def store_tasks_stats(self, event):
+ self._ensure_build()
+ task_data = BuildInfoHelper._get_data_from_event(event)
+
+ for (task_file, task_name, task_stats, recipe_name) in task_data:
+ build = self.internal_state['build']
+ self.orm_wrapper.update_task_object(build, task_name, recipe_name, task_stats)
+
+ def update_and_store_task(self, event):
+ assert 'taskfile' in vars(event)
+ localfilepath = event.taskfile.split(":")[-1]
+ assert localfilepath.startswith("/")
+
+ identifier = event.taskfile + ":" + event.taskname
+ if not identifier in self.internal_state['taskdata']:
+ if isinstance(event, bb.build.TaskBase):
+ # we do a bit of guessing
+ candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
+ if len(candidates) == 1:
+ identifier = candidates[0]
+ elif len(candidates) > 1 and hasattr(event,'_package'):
+ if 'native-' in event._package:
+ identifier = 'native:' + identifier
+ if 'nativesdk-' in event._package:
+ identifier = 'nativesdk:' + identifier
+ candidates = [x for x in self.internal_state['taskdata'].keys() if x.endswith(identifier)]
+ if len(candidates) == 1:
+ identifier = candidates[0]
+
+ assert identifier in self.internal_state['taskdata']
+ identifierlist = identifier.split(":")
+ realtaskfile = ":".join(identifierlist[0:len(identifierlist)-1])
+ recipe_information = self._get_recipe_information_from_taskfile(realtaskfile)
+ recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True)
+ task_information = self._get_task_information(event,recipe)
+
+ task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome']
+
+ if 'logfile' in vars(event):
+ task_information['logfile'] = event.logfile
+
+ if '_message' in vars(event):
+ task_information['message'] = event._message
+
+ if 'taskflags' in vars(event):
+ # with TaskStarted, we get even more information
+ if 'python' in event.taskflags.keys() and event.taskflags['python'] == '1':
+ task_information['script_type'] = Task.CODING_PYTHON
+ else:
+ task_information['script_type'] = Task.CODING_SHELL
+
+ if task_information['outcome'] == Task.OUTCOME_NA:
+ if isinstance(event, (bb.runqueue.runQueueTaskCompleted, bb.runqueue.sceneQueueTaskCompleted)):
+ task_information['outcome'] = Task.OUTCOME_SUCCESS
+ del self.internal_state['taskdata'][identifier]
+
+ if isinstance(event, (bb.runqueue.runQueueTaskFailed, bb.runqueue.sceneQueueTaskFailed)):
+ task_information['outcome'] = Task.OUTCOME_FAILED
+ del self.internal_state['taskdata'][identifier]
+
+ if not connection.features.autocommits_when_autocommit_is_off:
+ # we force a sync point here, to get the progress bar to show
+ if self.autocommit_step % 3 == 0:
+ transaction.set_autocommit(True)
+ transaction.set_autocommit(False)
+ self.autocommit_step += 1
+
+ self.orm_wrapper.get_update_task_object(task_information, True) # must exist
+
+
+ def store_missed_state_tasks(self, event):
+ for (fn, taskname, taskhash, sstatefile) in BuildInfoHelper._get_data_from_event(event)['missed']:
+
+ # identifier = fn + taskname + "_setscene"
+ recipe_information = self._get_recipe_information_from_taskfile(fn)
+ recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
+ mevent = MockEvent()
+ mevent.taskname = taskname
+ mevent.taskhash = taskhash
+ task_information = self._get_task_information(mevent,recipe)
+
+ task_information['start_time'] = timezone.now()
+ task_information['outcome'] = Task.OUTCOME_NA
+ task_information['sstate_checksum'] = taskhash
+ task_information['sstate_result'] = Task.SSTATE_MISS
+ task_information['path_to_sstate_obj'] = sstatefile
+
+ self.orm_wrapper.get_update_task_object(task_information)
+
+ for (fn, taskname, taskhash, sstatefile) in BuildInfoHelper._get_data_from_event(event)['found']:
+
+ # identifier = fn + taskname + "_setscene"
+ recipe_information = self._get_recipe_information_from_taskfile(fn)
+ recipe = self.orm_wrapper.get_update_recipe_object(recipe_information)
+ mevent = MockEvent()
+ mevent.taskname = taskname
+ mevent.taskhash = taskhash
+ task_information = self._get_task_information(mevent,recipe)
+
+ task_information['path_to_sstate_obj'] = sstatefile
+
+ self.orm_wrapper.get_update_task_object(task_information)
+
+
+ def store_target_package_data(self, event):
+ self._ensure_build()
+
+ # for all image targets
+ for target in self.internal_state['targets']:
+ if target.is_image:
+ pkgdata = BuildInfoHelper._get_data_from_event(event)['pkgdata']
+ imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'].get(target.target, {})
+ filedata = BuildInfoHelper._get_data_from_event(event)['filedata'].get(target.target, {})
+
+ try:
+ self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes'], built_package=True)
+ self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata.copy(), pkgdata, self.internal_state['recipes'], built_package=False)
+ except KeyError as e:
+ logger.warning("KeyError in save_target_package_information"
+ "%s ", e)
+
+ # only try to find files in the image if the task for this
+ # target is one which produces image files; otherwise, the old
+ # list of files in the files-in-image.txt file will be
+ # appended to the target even if it didn't produce any images
+ if target.task in BuildInfoHelper.IMAGE_GENERATING_TASKS:
+ try:
+ self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
+ except KeyError as e:
+ logger.warning("KeyError in save_target_file_information"
+ "%s ", e)
+
+
+
+ def cancel_cli_build(self):
+ """
+ If a build is currently underway, set its state to CANCELLED;
+ note that this only gets called for command line builds which are
+ interrupted, so it doesn't touch any BuildRequest objects
+ """
+ self._ensure_build()
+ self.internal_state['build'].outcome = Build.CANCELLED
+ self.internal_state['build'].save()
+ signal_runbuilds()
+
+ def store_dependency_information(self, event):
+ assert '_depgraph' in vars(event)
+ assert 'layer-priorities' in event._depgraph
+ assert 'pn' in event._depgraph
+ assert 'tdepends' in event._depgraph
+
+ errormsg = ""
+
+ # save layer version priorities
+ if 'layer-priorities' in event._depgraph.keys():
+ for lv in event._depgraph['layer-priorities']:
+ (_, path, _, priority) = lv
+ layer_version_obj = self._get_layer_version_for_dependency(path)
+ if layer_version_obj:
+ layer_version_obj.priority = priority
+ layer_version_obj.save()
+
+ # save recipe information
+ self.internal_state['recipes'] = {}
+ for pn in event._depgraph['pn']:
+
+ file_name = event._depgraph['pn'][pn]['filename'].split(":")[-1]
+ pathflags = ":".join(sorted(event._depgraph['pn'][pn]['filename'].split(":")[:-1]))
+ layer_version_obj = self._get_layer_version_for_path(file_name)
+
+ assert layer_version_obj is not None
+
+ recipe_info = {}
+ recipe_info['name'] = pn
+ recipe_info['layer_version'] = layer_version_obj
+
+ if 'version' in event._depgraph['pn'][pn]:
+ recipe_info['version'] = event._depgraph['pn'][pn]['version'].lstrip(":")
+
+ if 'summary' in event._depgraph['pn'][pn]:
+ recipe_info['summary'] = event._depgraph['pn'][pn]['summary']
+
+ if 'license' in event._depgraph['pn'][pn]:
+ recipe_info['license'] = event._depgraph['pn'][pn]['license']
+
+ if 'description' in event._depgraph['pn'][pn]:
+ recipe_info['description'] = event._depgraph['pn'][pn]['description']
+
+ if 'section' in event._depgraph['pn'][pn]:
+ recipe_info['section'] = event._depgraph['pn'][pn]['section']
+
+ if 'homepage' in event._depgraph['pn'][pn]:
+ recipe_info['homepage'] = event._depgraph['pn'][pn]['homepage']
+
+ if 'bugtracker' in event._depgraph['pn'][pn]:
+ recipe_info['bugtracker'] = event._depgraph['pn'][pn]['bugtracker']
+
+ recipe_info['file_path'] = file_name
+ recipe_info['pathflags'] = pathflags
+
+ if recipe_info['file_path'].startswith(recipe_info['layer_version'].local_path):
+ recipe_info['file_path'] = recipe_info['file_path'][len(recipe_info['layer_version'].local_path):].lstrip("/")
+ else:
+ raise RuntimeError("Recipe file path %s is not under layer version at %s" % (recipe_info['file_path'], recipe_info['layer_version'].local_path))
+
+ recipe = self.orm_wrapper.get_update_recipe_object(recipe_info)
+ recipe.is_image = False
+ if 'inherits' in event._depgraph['pn'][pn].keys():
+ for cls in event._depgraph['pn'][pn]['inherits']:
+ if cls.endswith('/image.bbclass'):
+ recipe.is_image = True
+ recipe_info['is_image'] = True
+ # Save the is_image state to the relevant recipe objects
+ self.orm_wrapper.get_update_recipe_object(recipe_info)
+ break
+ if recipe.is_image:
+ for t in self.internal_state['targets']:
+ if pn == t.target:
+ t.is_image = True
+ t.save()
+ self.internal_state['recipes'][pn] = recipe
+
+ # we'll not get recipes for key w/ values listed in ASSUME_PROVIDED
+
+ assume_provided = self.server.runCommand(["getVariable", "ASSUME_PROVIDED"])[0].split()
+
+ # save recipe dependency
+ # buildtime
+ recipedeps_objects = []
+ for recipe in event._depgraph['depends']:
+ target = self.internal_state['recipes'][recipe]
+ for dep in event._depgraph['depends'][recipe]:
+ if dep in assume_provided:
+ continue
+ via = None
+ if 'providermap' in event._depgraph and dep in event._depgraph['providermap']:
+ deprecipe = event._depgraph['providermap'][dep][0]
+ dependency = self.internal_state['recipes'][deprecipe]
+ via = Provides.objects.get_or_create(name=dep,
+ recipe=dependency)[0]
+ elif dep in self.internal_state['recipes']:
+ dependency = self.internal_state['recipes'][dep]
+ else:
+ errormsg += " stpd: KeyError saving recipe dependency for %s, %s \n" % (recipe, dep)
+ continue
+ recipe_dep = Recipe_Dependency(recipe=target,
+ depends_on=dependency,
+ via=via,
+ dep_type=Recipe_Dependency.TYPE_DEPENDS)
+ recipedeps_objects.append(recipe_dep)
+
+ Recipe_Dependency.objects.bulk_create(recipedeps_objects)
+
+ # save all task information
+ def _save_a_task(taskdesc):
+ spec = re.split(r'\.', taskdesc)
+ pn = ".".join(spec[0:-1])
+ taskname = spec[-1]
+ e = event
+ e.taskname = pn
+ recipe = self.internal_state['recipes'][pn]
+ task_info = self._get_task_information(e, recipe)
+ task_info['task_name'] = taskname
+ task_obj = self.orm_wrapper.get_update_task_object(task_info)
+ return task_obj
+
+ # create tasks
+ tasks = {}
+ for taskdesc in event._depgraph['tdepends']:
+ tasks[taskdesc] = _save_a_task(taskdesc)
+
+ # create dependencies between tasks
+ taskdeps_objects = []
+ for taskdesc in event._depgraph['tdepends']:
+ target = tasks[taskdesc]
+ for taskdep in event._depgraph['tdepends'][taskdesc]:
+ if taskdep not in tasks:
+ # Fetch tasks info is not collected previously
+ dep = _save_a_task(taskdep)
+ else:
+ dep = tasks[taskdep]
+ taskdeps_objects.append(Task_Dependency( task = target, depends_on = dep ))
+ Task_Dependency.objects.bulk_create(taskdeps_objects)
+
+ if len(errormsg) > 0:
+ logger.warning("buildinfohelper: dependency info not identify recipes: \n%s", errormsg)
+
+
+ def store_build_package_information(self, event):
+ self._ensure_build()
+
+ package_info = BuildInfoHelper._get_data_from_event(event)
+ self.orm_wrapper.save_build_package_information(
+ self.internal_state['build'],
+ package_info,
+ self.internal_state['recipes'],
+ built_package=True)
+
+ self.orm_wrapper.save_build_package_information(
+ self.internal_state['build'],
+ package_info,
+ self.internal_state['recipes'],
+ built_package=False)
+
+ def _store_build_done(self, errorcode):
+ logger.info("Build exited with errorcode %d", errorcode)
+
+ if not self.brbe:
+ return
+
+ br_id, be_id = self.brbe.split(":")
+
+ br = BuildRequest.objects.get(pk = br_id)
+
+ # if we're 'done' because we got cancelled update the build outcome
+ if br.state == BuildRequest.REQ_CANCELLING:
+ logger.info("Build cancelled")
+ br.build.outcome = Build.CANCELLED
+ br.build.save()
+ self.internal_state['build'] = br.build
+ errorcode = 0
+
+ if errorcode == 0:
+ # request archival of the project artifacts
+ br.state = BuildRequest.REQ_COMPLETED
+ else:
+ br.state = BuildRequest.REQ_FAILED
+ br.save()
+
+ be = BuildEnvironment.objects.get(pk = be_id)
+ be.lock = BuildEnvironment.LOCK_FREE
+ be.save()
+ signal_runbuilds()
+
+ def store_log_error(self, text):
+ mockevent = MockEvent()
+ mockevent.levelno = formatter.ERROR
+ mockevent.msg = text
+ mockevent.pathname = '-- None'
+ mockevent.lineno = LogMessage.ERROR
+ self.store_log_event(mockevent)
+
+ def store_log_exception(self, text, backtrace = ""):
+ mockevent = MockEvent()
+ mockevent.levelno = -1
+ mockevent.msg = text
+ mockevent.pathname = backtrace
+ mockevent.lineno = -1
+ self.store_log_event(mockevent)
+
+ def store_log_event(self, event):
+ self._ensure_build()
+
+ if event.levelno < formatter.WARNING:
+ return
+
+ # early return for CLI builds
+ if self.brbe is None:
+ if not 'backlog' in self.internal_state:
+ self.internal_state['backlog'] = []
+ self.internal_state['backlog'].append(event)
+ return
+
+ if 'backlog' in self.internal_state:
+ # if we have a backlog of events, do our best to save them here
+ if len(self.internal_state['backlog']):
+ tempevent = self.internal_state['backlog'].pop()
+ logger.debug(1, "buildinfohelper: Saving stored event %s "
+ % tempevent)
+ self.store_log_event(tempevent)
+ else:
+ logger.info("buildinfohelper: All events saved")
+ del self.internal_state['backlog']
+
+ log_information = {}
+ log_information['build'] = self.internal_state['build']
+ if event.levelno == formatter.CRITICAL:
+ log_information['level'] = LogMessage.CRITICAL
+ elif event.levelno == formatter.ERROR:
+ log_information['level'] = LogMessage.ERROR
+ elif event.levelno == formatter.WARNING:
+ log_information['level'] = LogMessage.WARNING
+ elif event.levelno == -2: # toaster self-logging
+ log_information['level'] = -2
+ else:
+ log_information['level'] = LogMessage.INFO
+
+ log_information['message'] = event.getMessage()
+ log_information['pathname'] = event.pathname
+ log_information['lineno'] = event.lineno
+ logger.info("Logging error 2: %s", log_information)
+
+ self.orm_wrapper.create_logmessage(log_information)
+
+ def _get_filenames_from_image_license(self, image_license_manifest_path):
+ """
+ Find the FILES line in the image_license.manifest file,
+ which has the basenames of the bzImage and modules files
+ in this format:
+ FILES: bzImage--4.4.11+git0+3a5f494784_53e84104c5-r0-qemux86-20160603165040.bin modules--4.4.11+git0+3a5f494784_53e84104c5-r0-qemux86-20160603165040.tgz
+ """
+ files = []
+ with open(image_license_manifest_path) as image_license:
+ for line in image_license:
+ if line.startswith('FILES'):
+ files_str = line.split(':')[1].strip()
+ files_str = re.sub(r' {2,}', ' ', files_str)
+
+ # ignore lines like "FILES:" with no filenames
+ if files_str:
+ files += files_str.split(' ')
+ return files
+
+ def _endswith(self, str_to_test, endings):
+ """
+ Returns True if str ends with one of the strings in the list
+ endings, False otherwise
+ """
+ endswith = False
+ for ending in endings:
+ if str_to_test.endswith(ending):
+ endswith = True
+ break
+ return endswith
+
+ def scan_task_artifacts(self, event):
+ """
+ The 'TaskArtifacts' event passes the manifest file content for the
+ tasks 'do_deploy', 'do_image_complete', 'do_populate_sdk', and
+ 'do_populate_sdk_ext'. The first two will be implemented later.
+ """
+ task_vars = BuildInfoHelper._get_data_from_event(event)
+ task_name = task_vars['task'][task_vars['task'].find(':')+1:]
+ task_artifacts = task_vars['artifacts']
+
+ if task_name in ['do_populate_sdk', 'do_populate_sdk_ext']:
+ targets = [target for target in self.internal_state['targets'] \
+ if target.task == task_name[3:]]
+ if not targets:
+ logger.warning("scan_task_artifacts: SDK targets not found: %s\n", task_name)
+ return
+ for artifact_path in task_artifacts:
+ if not os.path.isfile(artifact_path):
+ logger.warning("scan_task_artifacts: artifact file not found: %s\n", artifact_path)
+ continue
+ for target in targets:
+ # don't record the file if it's already been added
+ # to this target
+ matching_files = TargetSDKFile.objects.filter(
+ target=target, file_name=artifact_path)
+ if matching_files.count() == 0:
+ artifact_size = os.stat(artifact_path).st_size
+ self.orm_wrapper.save_target_sdk_file(
+ target, artifact_path, artifact_size)
+
+ def _get_image_files(self, deploy_dir_image, image_name, image_file_extensions):
+ """
+ Find files in deploy_dir_image whose basename starts with the
+ string image_name and ends with one of the strings in
+ image_file_extensions.
+
+ Returns a list of file dictionaries like
+
+ [
+ {
+ 'path': '/path/to/image/file',
+ 'size': <file size in bytes>
+ }
+ ]
+ """
+ image_files = []
+
+ for dirpath, _, filenames in os.walk(deploy_dir_image):
+ for filename in filenames:
+ if filename.startswith(image_name) and \
+ self._endswith(filename, image_file_extensions):
+ image_file_path = os.path.join(dirpath, filename)
+ image_file_size = os.stat(image_file_path).st_size
+
+ image_files.append({
+ 'path': image_file_path,
+ 'size': image_file_size
+ })
+
+ return image_files
+
+ def scan_image_artifacts(self):
+ """
+ Scan for built image artifacts in DEPLOY_DIR_IMAGE and associate them
+ with a Target object in self.internal_state['targets'].
+
+ We have two situations to handle:
+
+ 1. This is the first time a target + machine has been built, so
+ add files from the DEPLOY_DIR_IMAGE to the target.
+
+ OR
+
+ 2. There are no new files for the target (they were already produced by
+ a previous build), so copy them from the most recent previous build with
+ the same target, task and machine.
+ """
+ deploy_dir_image = \
+ self.server.runCommand(['getVariable', 'DEPLOY_DIR_IMAGE'])[0]
+
+ # if there's no DEPLOY_DIR_IMAGE, there aren't going to be
+ # any image artifacts, so we can return immediately
+ if not deploy_dir_image:
+ return
+
+ buildname = self.server.runCommand(['getVariable', 'BUILDNAME'])[0]
+ machine = self.server.runCommand(['getVariable', 'MACHINE'])[0]
+ image_name = self.server.runCommand(['getVariable', 'IMAGE_NAME'])[0]
+
+ # location of the manifest files for this build;
+ # note that this file is only produced if an image is produced
+ license_directory = \
+ self.server.runCommand(['getVariable', 'LICENSE_DIRECTORY'])[0]
+
+ # file name extensions for image files
+ image_file_extensions_unique = {}
+ image_fstypes = self.server.runCommand(
+ ['getVariable', 'IMAGE_FSTYPES'])[0]
+ if image_fstypes != None:
+ image_types_str = image_fstypes.strip()
+ image_file_extensions = re.sub(r' {2,}', ' ', image_types_str)
+ image_file_extensions_unique = set(image_file_extensions.split(' '))
+
+ targets = self.internal_state['targets']
+
+ # filter out anything which isn't an image target
+ image_targets = [target for target in targets if target.is_image]
+
+ for image_target in image_targets:
+ # this is set to True if we find at least one file relating to
+ # this target; if this remains False after the scan, we copy the
+ # files from the most-recent Target with the same target + machine
+ # onto this Target instead
+ has_files = False
+
+ # we construct this because by the time we reach
+ # BuildCompleted, this has reset to
+ # 'defaultpkgname-<MACHINE>-<BUILDNAME>';
+ # we need to change it to
+ # <TARGET>-<MACHINE>-<BUILDNAME>
+ real_image_name = re.sub(r'^defaultpkgname', image_target.target,
+ image_name)
+
+ image_license_manifest_path = os.path.join(
+ license_directory,
+ real_image_name,
+ 'image_license.manifest')
+
+ image_package_manifest_path = os.path.join(
+ license_directory,
+ real_image_name,
+ 'image_license.manifest')
+
+ # if image_license.manifest exists, we can read the names of
+ # bzImage, modules etc. files for this build from it, then look for
+ # them in the DEPLOY_DIR_IMAGE; note that this file is only produced
+ # if an image file was produced
+ if os.path.isfile(image_license_manifest_path):
+ has_files = True
+
+ basenames = self._get_filenames_from_image_license(
+ image_license_manifest_path)
+
+ for basename in basenames:
+ artifact_path = os.path.join(deploy_dir_image, basename)
+ if not os.path.exists(artifact_path):
+ logger.warning("artifact %s doesn't exist, skipping" % artifact_path)
+ continue
+ artifact_size = os.stat(artifact_path).st_size
+
+ # note that the artifact will only be saved against this
+ # build if it hasn't been already
+ self.orm_wrapper.save_target_kernel_file(image_target,
+ artifact_path, artifact_size)
+
+ # store the license manifest path on the target
+ # (this file is also created any time an image file is created)
+ license_manifest_path = os.path.join(license_directory,
+ real_image_name, 'license.manifest')
+
+ self.orm_wrapper.update_target_set_license_manifest(
+ image_target, license_manifest_path)
+
+ # store the package manifest path on the target (this file
+ # is created any time an image file is created)
+ package_manifest_path = os.path.join(deploy_dir_image,
+ real_image_name + '.rootfs.manifest')
+
+ if os.path.exists(package_manifest_path):
+ self.orm_wrapper.update_target_set_package_manifest(
+ image_target, package_manifest_path)
+
+ # scan the directory for image files relating to this build
+ # (via real_image_name); note that we don't have to set
+ # has_files = True, as searching for the license manifest file
+ # will already have set it to true if at least one image file was
+ # produced; note that the real_image_name includes BUILDNAME, which
+ # in turn includes a timestamp; so if no files were produced for
+ # this timestamp (i.e. the build reused existing image files already
+ # in the directory), no files will be recorded against this target
+ image_files = self._get_image_files(deploy_dir_image,
+ real_image_name, image_file_extensions_unique)
+
+ for image_file in image_files:
+ self.orm_wrapper.save_target_image_file_information(
+ image_target, image_file['path'], image_file['size'])
+
+ if not has_files:
+ # copy image files and build artifacts from the
+ # most-recently-built Target with the
+ # same target + machine as this Target; also copy the license
+ # manifest path, as that is not treated as an artifact and needs
+ # to be set separately
+ similar_target = \
+ self.orm_wrapper.get_similar_target_with_image_files(
+ image_target)
+
+ if similar_target:
+ logger.info('image artifacts for target %s cloned from ' \
+ 'target %s' % (image_target.pk, similar_target.pk))
+ self.orm_wrapper.clone_image_artifacts(similar_target,
+ image_target)
+
+ def _get_sdk_targets(self):
+ """
+ Return targets which could generate SDK artifacts, i.e.
+ "do_populate_sdk" and "do_populate_sdk_ext".
+ """
+ return [target for target in self.internal_state['targets'] \
+ if target.task in ['populate_sdk', 'populate_sdk_ext']]
+
+ def scan_sdk_artifacts(self, event):
+ """
+ Note that we have to intercept an SDKArtifactInfo event from
+ toaster.bbclass (via toasterui) to get hold of the SDK variables we
+ need to be able to scan for files accurately: this is because
+ variables like TOOLCHAIN_OUTPUTNAME have reset to None by the time
+ BuildCompleted is fired by bitbake, so we have to get those values
+ while the build is still in progress.
+
+ For populate_sdk_ext, this runs twice, with two different
+ TOOLCHAIN_OUTPUTNAME settings, each of which will capture some of the
+ files in the SDK output directory.
+ """
+ sdk_vars = BuildInfoHelper._get_data_from_event(event)
+ toolchain_outputname = sdk_vars['TOOLCHAIN_OUTPUTNAME']
+
+ # targets which might have created SDK artifacts
+ sdk_targets = self._get_sdk_targets()
+
+ # location of SDK artifacts
+ tmpdir = self.server.runCommand(['getVariable', 'TMPDIR'])[0]
+ sdk_dir = os.path.join(tmpdir, 'deploy', 'sdk')
+
+ # all files in the SDK directory
+ artifacts = []
+ for dir_path, _, filenames in os.walk(sdk_dir):
+ for filename in filenames:
+ full_path = os.path.join(dir_path, filename)
+ if not os.path.islink(full_path):
+ artifacts.append(full_path)
+
+ for sdk_target in sdk_targets:
+ # find files in the SDK directory which haven't already been
+ # recorded against a Target and whose basename matches
+ # TOOLCHAIN_OUTPUTNAME
+ for artifact_path in artifacts:
+ basename = os.path.basename(artifact_path)
+
+ toolchain_match = basename.startswith(toolchain_outputname)
+
+ # files which match the name of the target which produced them;
+ # for example,
+ # poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-2.1+snapshot.sh
+ target_match = re.search(sdk_target.target, basename)
+
+ # targets which produce "*-nativesdk-*" files
+ is_ext_sdk_target = sdk_target.task in \
+ ['do_populate_sdk_ext', 'populate_sdk_ext']
+
+ # SDK files which don't match the target name, i.e.
+ # x86_64-nativesdk-libc.*
+ # poky-glibc-x86_64-buildtools-tarball-i586-buildtools-nativesdk-standalone-2.1+snapshot*
+ is_ext_sdk_file = re.search('-nativesdk-', basename)
+
+ file_from_target = (toolchain_match and target_match) or \
+ (is_ext_sdk_target and is_ext_sdk_file)
+
+ if file_from_target:
+ # don't record the file if it's already been added to this
+ # target
+ matching_files = TargetSDKFile.objects.filter(
+ target=sdk_target, file_name=artifact_path)
+
+ if matching_files.count() == 0:
+ artifact_size = os.stat(artifact_path).st_size
+
+ self.orm_wrapper.save_target_sdk_file(
+ sdk_target, artifact_path, artifact_size)
+
+ def clone_required_sdk_artifacts(self):
+ """
+ If an SDK target doesn't have any SDK artifacts, this means that
+ the postfuncs of populate_sdk or populate_sdk_ext didn't fire, which
+ in turn means that the targets of this build didn't generate any new
+ artifacts.
+
+ In this case, clone SDK artifacts for targets in the current build
+ from existing targets for this build.
+ """
+ sdk_targets = self._get_sdk_targets()
+ for sdk_target in sdk_targets:
+ # only clone for SDK targets which have no TargetSDKFiles yet
+ if sdk_target.targetsdkfile_set.all().count() == 0:
+ similar_target = \
+ self.orm_wrapper.get_similar_target_with_sdk_files(
+ sdk_target)
+ if similar_target:
+ logger.info('SDK artifacts for target %s cloned from ' \
+ 'target %s' % (sdk_target.pk, similar_target.pk))
+ self.orm_wrapper.clone_sdk_artifacts(similar_target,
+ sdk_target)
+
+ def close(self, errorcode):
+ self._store_build_done(errorcode)
+
+ if 'backlog' in self.internal_state:
+ # we save missed events in the database for the current build
+ tempevent = self.internal_state['backlog'].pop()
+ self.store_log_event(tempevent)
+
+ if not connection.features.autocommits_when_autocommit_is_off:
+ transaction.set_autocommit(True)
+
+ # unset the brbe; this is to prevent subsequent command-line builds
+ # being incorrectly attached to the previous Toaster-triggered build;
+ # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
+ self.brbe = None
+
+ # unset the internal Build object to prevent it being reused for the
+ # next build
+ self.internal_state['build'] = None
diff --git a/poky/bitbake/lib/bb/ui/icons/images/images_display.png b/poky/bitbake/lib/bb/ui/icons/images/images_display.png
new file mode 100644
index 000000000..a7f87101a
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/images/images_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/images/images_hover.png b/poky/bitbake/lib/bb/ui/icons/images/images_hover.png
new file mode 100644
index 000000000..2d9cd99b8
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/images/images_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png b/poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png
new file mode 100644
index 000000000..526df770d
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/add-hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/add.png b/poky/bitbake/lib/bb/ui/icons/indicators/add.png
new file mode 100644
index 000000000..31e7090d6
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/add.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/alert.png b/poky/bitbake/lib/bb/ui/icons/indicators/alert.png
new file mode 100644
index 000000000..d1c6f55a2
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/alert.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png b/poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png
new file mode 100644
index 000000000..3a5402d1e
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/confirmation.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/denied.png b/poky/bitbake/lib/bb/ui/icons/indicators/denied.png
new file mode 100644
index 000000000..ee35c7def
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/denied.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/error.png b/poky/bitbake/lib/bb/ui/icons/indicators/error.png
new file mode 100644
index 000000000..d06a8c151
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/error.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/info.png b/poky/bitbake/lib/bb/ui/icons/indicators/info.png
new file mode 100644
index 000000000..ee8e8d846
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/info.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/issues.png b/poky/bitbake/lib/bb/ui/icons/indicators/issues.png
new file mode 100644
index 000000000..b0c746133
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/issues.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/refresh.png b/poky/bitbake/lib/bb/ui/icons/indicators/refresh.png
new file mode 100644
index 000000000..eb6c419db
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/refresh.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png b/poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png
new file mode 100644
index 000000000..aa57c6998
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/remove-hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/remove.png b/poky/bitbake/lib/bb/ui/icons/indicators/remove.png
new file mode 100644
index 000000000..05c3c293d
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/remove.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/indicators/tick.png b/poky/bitbake/lib/bb/ui/icons/indicators/tick.png
new file mode 100644
index 000000000..beaad361c
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/indicators/tick.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/info/info_display.png b/poky/bitbake/lib/bb/ui/icons/info/info_display.png
new file mode 100644
index 000000000..5afbba29f
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/info/info_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/info/info_hover.png b/poky/bitbake/lib/bb/ui/icons/info/info_hover.png
new file mode 100644
index 000000000..f9d294dfa
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/info/info_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/layers/layers_display.png b/poky/bitbake/lib/bb/ui/icons/layers/layers_display.png
new file mode 100644
index 000000000..b7f9053a9
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/layers/layers_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png b/poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png
new file mode 100644
index 000000000..0bf3ce0db
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/layers/layers_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/packages/packages_display.png b/poky/bitbake/lib/bb/ui/icons/packages/packages_display.png
new file mode 100644
index 000000000..f5d0a5064
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/packages/packages_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png b/poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png
new file mode 100644
index 000000000..c081165f3
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/packages/packages_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png b/poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png
new file mode 100644
index 000000000..e9809bc7d
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/recipe/recipe_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png b/poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png
new file mode 100644
index 000000000..7e48da9af
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/recipe/recipe_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/settings/settings_display.png b/poky/bitbake/lib/bb/ui/icons/settings/settings_display.png
new file mode 100644
index 000000000..88c464db0
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/settings/settings_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png b/poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png
new file mode 100644
index 000000000..d92a0bf2c
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/settings/settings_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/templates/templates_display.png b/poky/bitbake/lib/bb/ui/icons/templates/templates_display.png
new file mode 100644
index 000000000..153c7afb6
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/templates/templates_display.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png b/poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png
new file mode 100644
index 000000000..afb7165fe
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/icons/templates/templates_hover.png
Binary files differ
diff --git a/poky/bitbake/lib/bb/ui/knotty.py b/poky/bitbake/lib/bb/ui/knotty.py
new file mode 100644
index 000000000..fa88e6ccd
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/knotty.py
@@ -0,0 +1,728 @@
+#
+# BitBake (No)TTY UI Implementation
+#
+# Handling output to TTYs or files (no TTY)
+#
+# Copyright (C) 2006-2012 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from __future__ import division
+
+import os
+import sys
+import xmlrpc.client as xmlrpclib
+import logging
+import progressbar
+import signal
+import bb.msg
+import time
+import fcntl
+import struct
+import copy
+import atexit
+
+from bb.ui import uihelper
+
+featureSet = [bb.cooker.CookerFeatures.SEND_SANITYEVENTS]
+
+logger = logging.getLogger("BitBake")
+interactive = sys.stdout.isatty()
+
+class BBProgress(progressbar.ProgressBar):
+ def __init__(self, msg, maxval, widgets=None, extrapos=-1, resize_handler=None):
+ self.msg = msg
+ self.extrapos = extrapos
+ if not widgets:
+ widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
+ progressbar.ETA()]
+ self.extrapos = 4
+
+ if resize_handler:
+ self._resize_default = resize_handler
+ else:
+ self._resize_default = signal.getsignal(signal.SIGWINCH)
+ progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets, fd=sys.stdout)
+
+ def _handle_resize(self, signum=None, frame=None):
+ progressbar.ProgressBar._handle_resize(self, signum, frame)
+ if self._resize_default:
+ self._resize_default(signum, frame)
+
+ def finish(self):
+ progressbar.ProgressBar.finish(self)
+ if self._resize_default:
+ signal.signal(signal.SIGWINCH, self._resize_default)
+
+ def setmessage(self, msg):
+ self.msg = msg
+ self.widgets[0] = msg
+
+ def setextra(self, extra):
+ if self.extrapos > -1:
+ if extra:
+ extrastr = str(extra)
+ if extrastr[0] != ' ':
+ extrastr = ' ' + extrastr
+ else:
+ extrastr = ''
+ self.widgets[self.extrapos] = extrastr
+
+ def _need_update(self):
+ # We always want the bar to print when update() is called
+ return True
+
+class NonInteractiveProgress(object):
+ fobj = sys.stdout
+
+ def __init__(self, msg, maxval):
+ self.msg = msg
+ self.maxval = maxval
+ self.finished = False
+
+ def start(self, update=True):
+ self.fobj.write("%s..." % self.msg)
+ self.fobj.flush()
+ return self
+
+ def update(self, value):
+ pass
+
+ def finish(self):
+ if self.finished:
+ return
+ self.fobj.write("done.\n")
+ self.fobj.flush()
+ self.finished = True
+
+def new_progress(msg, maxval):
+ if interactive:
+ return BBProgress(msg, maxval)
+ else:
+ return NonInteractiveProgress(msg, maxval)
+
+def pluralise(singular, plural, qty):
+ if(qty == 1):
+ return singular % qty
+ else:
+ return plural % qty
+
+
+class InteractConsoleLogFilter(logging.Filter):
+ def __init__(self, tf, format):
+ self.tf = tf
+ self.format = format
+
+ def filter(self, record):
+ if record.levelno == self.format.NOTE and (record.msg.startswith("Running") or record.msg.startswith("recipe ")):
+ return False
+ self.tf.clearFooter()
+ return True
+
+class TerminalFilter(object):
+ rows = 25
+ columns = 80
+
+ def sigwinch_handle(self, signum, frame):
+ self.rows, self.columns = self.getTerminalColumns()
+ if self._sigwinch_default:
+ self._sigwinch_default(signum, frame)
+
+ def getTerminalColumns(self):
+ def ioctl_GWINSZ(fd):
+ try:
+ cr = struct.unpack('hh', fcntl.ioctl(fd, self.termios.TIOCGWINSZ, '1234'))
+ except:
+ return None
+ return cr
+ cr = ioctl_GWINSZ(sys.stdout.fileno())
+ if not cr:
+ try:
+ fd = os.open(os.ctermid(), os.O_RDONLY)
+ cr = ioctl_GWINSZ(fd)
+ os.close(fd)
+ except:
+ pass
+ if not cr:
+ try:
+ cr = (env['LINES'], env['COLUMNS'])
+ except:
+ cr = (25, 80)
+ return cr
+
+ def __init__(self, main, helper, console, errconsole, format, quiet):
+ self.main = main
+ self.helper = helper
+ self.cuu = None
+ self.stdinbackup = None
+ self.interactive = sys.stdout.isatty()
+ self.footer_present = False
+ self.lastpids = []
+ self.lasttime = None
+ self.quiet = quiet
+
+ if not self.interactive:
+ return
+
+ try:
+ import curses
+ except ImportError:
+ sys.exit("FATAL: The knotty ui could not load the required curses python module.")
+
+ import termios
+ self.curses = curses
+ self.termios = termios
+ try:
+ fd = sys.stdin.fileno()
+ self.stdinbackup = termios.tcgetattr(fd)
+ new = copy.deepcopy(self.stdinbackup)
+ new[3] = new[3] & ~termios.ECHO
+ termios.tcsetattr(fd, termios.TCSADRAIN, new)
+ curses.setupterm()
+ if curses.tigetnum("colors") > 2:
+ format.enable_color()
+ self.ed = curses.tigetstr("ed")
+ if self.ed:
+ self.cuu = curses.tigetstr("cuu")
+ try:
+ self._sigwinch_default = signal.getsignal(signal.SIGWINCH)
+ signal.signal(signal.SIGWINCH, self.sigwinch_handle)
+ except:
+ pass
+ self.rows, self.columns = self.getTerminalColumns()
+ except:
+ self.cuu = None
+ if not self.cuu:
+ self.interactive = False
+ bb.note("Unable to use interactive mode for this terminal, using fallback")
+ return
+ if console:
+ console.addFilter(InteractConsoleLogFilter(self, format))
+ if errconsole:
+ errconsole.addFilter(InteractConsoleLogFilter(self, format))
+
+ self.main_progress = None
+
+ def clearFooter(self):
+ if self.footer_present:
+ lines = self.footer_present
+ sys.stdout.buffer.write(self.curses.tparm(self.cuu, lines))
+ sys.stdout.buffer.write(self.curses.tparm(self.ed))
+ sys.stdout.flush()
+ self.footer_present = False
+
+ def updateFooter(self):
+ if not self.cuu:
+ return
+ activetasks = self.helper.running_tasks
+ failedtasks = self.helper.failed_tasks
+ runningpids = self.helper.running_pids
+ currenttime = time.time()
+ if not self.lasttime or (currenttime - self.lasttime > 5):
+ self.helper.needUpdate = True
+ self.lasttime = currenttime
+ if self.footer_present and not self.helper.needUpdate:
+ return
+ self.helper.needUpdate = False
+ if self.footer_present:
+ self.clearFooter()
+ if (not self.helper.tasknumber_total or self.helper.tasknumber_current == self.helper.tasknumber_total) and not len(activetasks):
+ return
+ tasks = []
+ for t in runningpids:
+ progress = activetasks[t].get("progress", None)
+ if progress is not None:
+ pbar = activetasks[t].get("progressbar", None)
+ rate = activetasks[t].get("rate", None)
+ start_time = activetasks[t].get("starttime", None)
+ if not pbar or pbar.bouncing != (progress < 0):
+ if progress < 0:
+ pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2, resize_handler=self.sigwinch_handle)
+ pbar.bouncing = True
+ else:
+ pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=4, resize_handler=self.sigwinch_handle)
+ pbar.bouncing = False
+ activetasks[t]["progressbar"] = pbar
+ tasks.append((pbar, progress, rate, start_time))
+ else:
+ start_time = activetasks[t].get("starttime", None)
+ if start_time:
+ tasks.append("%s - %ds (pid %s)" % (activetasks[t]["title"], currenttime - start_time, t))
+ else:
+ tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
+
+ if self.main.shutdown:
+ content = "Waiting for %s running tasks to finish:" % len(activetasks)
+ print(content)
+ else:
+ if self.quiet:
+ content = "Running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
+ elif not len(activetasks):
+ content = "No currently running tasks (%s of %s)" % (self.helper.tasknumber_current, self.helper.tasknumber_total)
+ else:
+ content = "Currently %2s running tasks (%s of %s)" % (len(activetasks), self.helper.tasknumber_current, self.helper.tasknumber_total)
+ maxtask = self.helper.tasknumber_total
+ if not self.main_progress or self.main_progress.maxval != maxtask:
+ widgets = [' ', progressbar.Percentage(), ' ', progressbar.Bar()]
+ self.main_progress = BBProgress("Running tasks", maxtask, widgets=widgets, resize_handler=self.sigwinch_handle)
+ self.main_progress.start(False)
+ self.main_progress.setmessage(content)
+ progress = self.helper.tasknumber_current - 1
+ if progress < 0:
+ progress = 0
+ content = self.main_progress.update(progress)
+ print('')
+ lines = 1 + int(len(content) / (self.columns + 1))
+ if self.quiet == 0:
+ for tasknum, task in enumerate(tasks[:(self.rows - 2)]):
+ if isinstance(task, tuple):
+ pbar, progress, rate, start_time = task
+ if not pbar.start_time:
+ pbar.start(False)
+ if start_time:
+ pbar.start_time = start_time
+ pbar.setmessage('%s:%s' % (tasknum, pbar.msg.split(':', 1)[1]))
+ if progress > -1:
+ pbar.setextra(rate)
+ content = pbar.update(progress)
+ else:
+ content = pbar.update(1)
+ print('')
+ else:
+ content = "%s: %s" % (tasknum, task)
+ print(content)
+ lines = lines + 1 + int(len(content) / (self.columns + 1))
+ self.footer_present = lines
+ self.lastpids = runningpids[:]
+ self.lastcount = self.helper.tasknumber_current
+
+ def finish(self):
+ if self.stdinbackup:
+ fd = sys.stdin.fileno()
+ self.termios.tcsetattr(fd, self.termios.TCSADRAIN, self.stdinbackup)
+
+def print_event_log(event, includelogs, loglines, termfilter):
+ # FIXME refactor this out further
+ logfile = event.logfile
+ if logfile and os.path.exists(logfile):
+ termfilter.clearFooter()
+ bb.error("Logfile of failure stored in: %s" % logfile)
+ if includelogs and not event.errprinted:
+ print("Log data follows:")
+ f = open(logfile, "r")
+ lines = []
+ while True:
+ l = f.readline()
+ if l == '':
+ break
+ l = l.rstrip()
+ if loglines:
+ lines.append(' | %s' % l)
+ if len(lines) > int(loglines):
+ lines.pop(0)
+ else:
+ print('| %s' % l)
+ f.close()
+ if lines:
+ for line in lines:
+ print(line)
+
+def _log_settings_from_server(server, observe_only):
+ # Get values of variables which control our output
+ includelogs, error = server.runCommand(["getVariable", "BBINCLUDELOGS"])
+ if error:
+ logger.error("Unable to get the value of BBINCLUDELOGS variable: %s" % error)
+ raise BaseException(error)
+ loglines, error = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"])
+ if error:
+ logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s" % error)
+ raise BaseException(error)
+ if observe_only:
+ cmd = 'getVariable'
+ else:
+ cmd = 'getSetVariable'
+ consolelogfile, error = server.runCommand([cmd, "BB_CONSOLELOG"])
+ if error:
+ logger.error("Unable to get the value of BB_CONSOLELOG variable: %s" % error)
+ raise BaseException(error)
+ return includelogs, loglines, consolelogfile
+
+_evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.LogRecord",
+ "bb.build.TaskFailed", "bb.build.TaskBase", "bb.event.ParseStarted",
+ "bb.event.ParseProgress", "bb.event.ParseCompleted", "bb.event.CacheLoadStarted",
+ "bb.event.CacheLoadProgress", "bb.event.CacheLoadCompleted", "bb.command.CommandFailed",
+ "bb.command.CommandExit", "bb.command.CommandCompleted", "bb.cooker.CookerExit",
+ "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted",
+ "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed",
+ "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent",
+ "bb.build.TaskProgress", "bb.event.ProcessStarted", "bb.event.ProcessProgress", "bb.event.ProcessFinished"]
+
+def main(server, eventHandler, params, tf = TerminalFilter):
+
+ if not params.observe_only:
+ params.updateToServer(server, os.environ.copy())
+
+ includelogs, loglines, consolelogfile = _log_settings_from_server(server, params.observe_only)
+
+ if sys.stdin.isatty() and sys.stdout.isatty():
+ log_exec_tty = True
+ else:
+ log_exec_tty = False
+
+ helper = uihelper.BBUIHelper()
+
+ console = logging.StreamHandler(sys.stdout)
+ errconsole = logging.StreamHandler(sys.stderr)
+ format_str = "%(levelname)s: %(message)s"
+ format = bb.msg.BBLogFormatter(format_str)
+ if params.options.quiet == 0:
+ forcelevel = None
+ elif params.options.quiet > 2:
+ forcelevel = bb.msg.BBLogFormatter.ERROR
+ else:
+ forcelevel = bb.msg.BBLogFormatter.WARNING
+ bb.msg.addDefaultlogFilter(console, bb.msg.BBLogFilterStdOut, forcelevel)
+ bb.msg.addDefaultlogFilter(errconsole, bb.msg.BBLogFilterStdErr)
+ console.setFormatter(format)
+ errconsole.setFormatter(format)
+ if not bb.msg.has_console_handler(logger):
+ logger.addHandler(console)
+ logger.addHandler(errconsole)
+
+ bb.utils.set_process_name("KnottyUI")
+
+ if params.options.remote_server and params.options.kill_server:
+ server.terminateServer()
+ return
+
+ consolelog = None
+ if consolelogfile and not params.options.show_environment and not params.options.show_versions:
+ bb.utils.mkdirhier(os.path.dirname(consolelogfile))
+ conlogformat = bb.msg.BBLogFormatter(format_str)
+ consolelog = logging.FileHandler(consolelogfile)
+ bb.msg.addDefaultlogFilter(consolelog)
+ consolelog.setFormatter(conlogformat)
+ logger.addHandler(consolelog)
+ loglink = os.path.join(os.path.dirname(consolelogfile), 'console-latest.log')
+ bb.utils.remove(loglink)
+ try:
+ os.symlink(os.path.basename(consolelogfile), loglink)
+ except OSError:
+ pass
+
+ llevel, debug_domains = bb.msg.constructLogOptions()
+ server.runCommand(["setEventMask", server.getEventHandle(), llevel, debug_domains, _evt_list])
+
+ universe = False
+ if not params.observe_only:
+ params.updateFromServer(server)
+ cmdline = params.parseActions()
+ if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
+ return 1
+ if 'msg' in cmdline and cmdline['msg']:
+ logger.error(cmdline['msg'])
+ return 1
+ if cmdline['action'][0] == "buildTargets" and "universe" in cmdline['action'][1]:
+ universe = True
+
+ ret, error = server.runCommand(cmdline['action'])
+ if error:
+ logger.error("Command '%s' failed: %s" % (cmdline, error))
+ return 1
+ elif ret != True:
+ logger.error("Command '%s' failed: returned %s" % (cmdline, ret))
+ return 1
+
+
+ parseprogress = None
+ cacheprogress = None
+ main.shutdown = 0
+ interrupted = False
+ return_value = 0
+ errors = 0
+ warnings = 0
+ taskfailures = []
+
+ termfilter = tf(main, helper, console, errconsole, format, params.options.quiet)
+ atexit.register(termfilter.finish)
+
+ while True:
+ try:
+ event = eventHandler.waitEvent(0)
+ if event is None:
+ if main.shutdown > 1:
+ break
+ termfilter.updateFooter()
+ event = eventHandler.waitEvent(0.25)
+ if event is None:
+ continue
+ helper.eventHandler(event)
+ if isinstance(event, bb.runqueue.runQueueExitWait):
+ if not main.shutdown:
+ main.shutdown = 1
+ continue
+ if isinstance(event, bb.event.LogExecTTY):
+ if log_exec_tty:
+ tries = event.retries
+ while tries:
+ print("Trying to run: %s" % event.prog)
+ if os.system(event.prog) == 0:
+ break
+ time.sleep(event.sleep_delay)
+ tries -= 1
+ if tries:
+ continue
+ logger.warning(event.msg)
+ continue
+
+ if isinstance(event, logging.LogRecord):
+ if event.levelno >= format.ERROR:
+ errors = errors + 1
+ return_value = 1
+ elif event.levelno == format.WARNING:
+ warnings = warnings + 1
+
+ if event.taskpid != 0:
+ # For "normal" logging conditions, don't show note logs from tasks
+ # but do show them if the user has changed the default log level to
+ # include verbose/debug messages
+ if event.levelno <= format.NOTE and (event.levelno < llevel or (event.levelno == format.NOTE and llevel != format.VERBOSE)):
+ continue
+
+ # Prefix task messages with recipe/task
+ if event.taskpid in helper.running_tasks and event.levelno != format.PLAIN:
+ taskinfo = helper.running_tasks[event.taskpid]
+ event.msg = taskinfo['title'] + ': ' + event.msg
+ if hasattr(event, 'fn'):
+ event.msg = event.fn + ': ' + event.msg
+ logger.handle(event)
+ continue
+
+ if isinstance(event, bb.build.TaskFailedSilent):
+ logger.warning("Logfile for failed setscene task is %s" % event.logfile)
+ continue
+ if isinstance(event, bb.build.TaskFailed):
+ return_value = 1
+ print_event_log(event, includelogs, loglines, termfilter)
+ if isinstance(event, bb.build.TaskBase):
+ logger.info(event._message)
+ continue
+ if isinstance(event, bb.event.ParseStarted):
+ if params.options.quiet > 1:
+ continue
+ if event.total == 0:
+ continue
+ parseprogress = new_progress("Parsing recipes", event.total).start()
+ continue
+ if isinstance(event, bb.event.ParseProgress):
+ if params.options.quiet > 1:
+ continue
+ if parseprogress:
+ parseprogress.update(event.current)
+ else:
+ bb.warn("Got ParseProgress event for parsing that never started?")
+ continue
+ if isinstance(event, bb.event.ParseCompleted):
+ if params.options.quiet > 1:
+ continue
+ if not parseprogress:
+ continue
+ parseprogress.finish()
+ pasreprogress = None
+ if params.options.quiet == 0:
+ print(("Parsing of %d .bb files complete (%d cached, %d parsed). %d targets, %d skipped, %d masked, %d errors."
+ % ( event.total, event.cached, event.parsed, event.virtuals, event.skipped, event.masked, event.errors)))
+ continue
+
+ if isinstance(event, bb.event.CacheLoadStarted):
+ if params.options.quiet > 1:
+ continue
+ cacheprogress = new_progress("Loading cache", event.total).start()
+ continue
+ if isinstance(event, bb.event.CacheLoadProgress):
+ if params.options.quiet > 1:
+ continue
+ cacheprogress.update(event.current)
+ continue
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ if params.options.quiet > 1:
+ continue
+ cacheprogress.finish()
+ if params.options.quiet == 0:
+ print("Loaded %d entries from dependency cache." % event.num_entries)
+ continue
+
+ if isinstance(event, bb.command.CommandFailed):
+ return_value = event.exitcode
+ if event.error:
+ errors = errors + 1
+ logger.error(str(event))
+ main.shutdown = 2
+ continue
+ if isinstance(event, bb.command.CommandExit):
+ if not return_value:
+ return_value = event.exitcode
+ continue
+ if isinstance(event, (bb.command.CommandCompleted, bb.cooker.CookerExit)):
+ main.shutdown = 2
+ continue
+ if isinstance(event, bb.event.MultipleProviders):
+ logger.info(str(event))
+ continue
+ if isinstance(event, bb.event.NoProvider):
+ # For universe builds, only show these as warnings, not errors
+ if not universe:
+ return_value = 1
+ errors = errors + 1
+ logger.error(str(event))
+ else:
+ logger.warning(str(event))
+ continue
+
+ if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+ logger.info("Running setscene task %d of %d (%s)" % (event.stats.completed + event.stats.active + event.stats.failed + 1, event.stats.total, event.taskstring))
+ continue
+
+ if isinstance(event, bb.runqueue.runQueueTaskStarted):
+ if event.noexec:
+ tasktype = 'noexec task'
+ else:
+ tasktype = 'task'
+ logger.info("Running %s %d of %d (%s)",
+ tasktype,
+ event.stats.completed + event.stats.active +
+ event.stats.failed + 1,
+ event.stats.total, event.taskstring)
+ continue
+
+ if isinstance(event, bb.runqueue.runQueueTaskFailed):
+ return_value = 1
+ taskfailures.append(event.taskstring)
+ logger.error(str(event))
+ continue
+
+ if isinstance(event, bb.runqueue.sceneQueueTaskFailed):
+ logger.warning(str(event))
+ continue
+
+ if isinstance(event, bb.event.DepTreeGenerated):
+ continue
+
+ if isinstance(event, bb.event.ProcessStarted):
+ if params.options.quiet > 1:
+ continue
+ parseprogress = new_progress(event.processname, event.total)
+ parseprogress.start(False)
+ continue
+ if isinstance(event, bb.event.ProcessProgress):
+ if params.options.quiet > 1:
+ continue
+ if parseprogress:
+ parseprogress.update(event.progress)
+ else:
+ bb.warn("Got ProcessProgress event for someting that never started?")
+ continue
+ if isinstance(event, bb.event.ProcessFinished):
+ if params.options.quiet > 1:
+ continue
+ if parseprogress:
+ parseprogress.finish()
+ parseprogress = None
+ continue
+
+ # ignore
+ if isinstance(event, (bb.event.BuildBase,
+ bb.event.MetadataEvent,
+ bb.event.StampUpdate,
+ bb.event.ConfigParsed,
+ bb.event.MultiConfigParsed,
+ bb.event.RecipeParsed,
+ bb.event.RecipePreFinalise,
+ bb.runqueue.runQueueEvent,
+ bb.event.OperationStarted,
+ bb.event.OperationCompleted,
+ bb.event.OperationProgress,
+ bb.event.DiskFull,
+ bb.event.HeartbeatEvent,
+ bb.build.TaskProgress)):
+ continue
+
+ logger.error("Unknown event: %s", event)
+
+ except EnvironmentError as ioerror:
+ termfilter.clearFooter()
+ # ignore interrupted io
+ if ioerror.args[0] == 4:
+ continue
+ sys.stderr.write(str(ioerror))
+ if not params.observe_only:
+ _, error = server.runCommand(["stateForceShutdown"])
+ main.shutdown = 2
+ except KeyboardInterrupt:
+ termfilter.clearFooter()
+ if params.observe_only:
+ print("\nKeyboard Interrupt, exiting observer...")
+ main.shutdown = 2
+ if not params.observe_only and main.shutdown == 1:
+ print("\nSecond Keyboard Interrupt, stopping...\n")
+ _, error = server.runCommand(["stateForceShutdown"])
+ if error:
+ logger.error("Unable to cleanly stop: %s" % error)
+ if not params.observe_only and main.shutdown == 0:
+ print("\nKeyboard Interrupt, closing down...\n")
+ interrupted = True
+ _, error = server.runCommand(["stateShutdown"])
+ if error:
+ logger.error("Unable to cleanly shutdown: %s" % error)
+ main.shutdown = main.shutdown + 1
+ pass
+ except Exception as e:
+ import traceback
+ sys.stderr.write(traceback.format_exc())
+ if not params.observe_only:
+ _, error = server.runCommand(["stateForceShutdown"])
+ main.shutdown = 2
+ return_value = 1
+ try:
+ termfilter.clearFooter()
+ summary = ""
+ if taskfailures:
+ summary += pluralise("\nSummary: %s task failed:",
+ "\nSummary: %s tasks failed:", len(taskfailures))
+ for failure in taskfailures:
+ summary += "\n %s" % failure
+ if warnings:
+ summary += pluralise("\nSummary: There was %s WARNING message shown.",
+ "\nSummary: There were %s WARNING messages shown.", warnings)
+ if return_value and errors:
+ summary += pluralise("\nSummary: There was %s ERROR message shown, returning a non-zero exit code.",
+ "\nSummary: There were %s ERROR messages shown, returning a non-zero exit code.", errors)
+ if summary and params.options.quiet == 0:
+ print(summary)
+
+ if interrupted:
+ print("Execution was interrupted, returning a non-zero exit code.")
+ if return_value == 0:
+ return_value = 1
+ except IOError as e:
+ import errno
+ if e.errno == errno.EPIPE:
+ pass
+
+ if consolelog:
+ logger.removeHandler(consolelog)
+ consolelog.close()
+
+ return return_value
diff --git a/poky/bitbake/lib/bb/ui/ncurses.py b/poky/bitbake/lib/bb/ui/ncurses.py
new file mode 100644
index 000000000..8690c529c
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/ncurses.py
@@ -0,0 +1,373 @@
+#
+# BitBake Curses UI Implementation
+#
+# Implements an ncurses frontend for the BitBake utility.
+#
+# Copyright (C) 2006 Michael 'Mickey' Lauer
+# Copyright (C) 2006-2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+ We have the following windows:
+
+ 1.) Main Window: Shows what we are ultimately building and how far we are. Includes status bar
+ 2.) Thread Activity Window: Shows one status line for every concurrent bitbake thread.
+ 3.) Command Line Window: Contains an interactive command line where you can interact w/ Bitbake.
+
+ Basic window layout is like that:
+
+ |---------------------------------------------------------|
+ | <Main Window> | <Thread Activity Window> |
+ | | 0: foo do_compile complete|
+ | Building Gtk+-2.6.10 | 1: bar do_patch complete |
+ | Status: 60% | ... |
+ | | ... |
+ | | ... |
+ |---------------------------------------------------------|
+ |<Command Line Window> |
+ |>>> which virtual/kernel |
+ |openzaurus-kernel |
+ |>>> _ |
+ |---------------------------------------------------------|
+
+"""
+
+
+
+import logging
+import os, sys, itertools, time, subprocess
+
+try:
+ import curses
+except ImportError:
+ sys.exit("FATAL: The ncurses ui could not load the required curses python module.")
+
+import bb
+import xmlrpc.client
+from bb import ui
+from bb.ui import uihelper
+
+parsespin = itertools.cycle( r'|/-\\' )
+
+X = 0
+Y = 1
+WIDTH = 2
+HEIGHT = 3
+
+MAXSTATUSLENGTH = 32
+
+class NCursesUI:
+ """
+ NCurses UI Class
+ """
+ class Window:
+ """Base Window Class"""
+ def __init__( self, x, y, width, height, fg=curses.COLOR_BLACK, bg=curses.COLOR_WHITE ):
+ self.win = curses.newwin( height, width, y, x )
+ self.dimensions = ( x, y, width, height )
+ """
+ if curses.has_colors():
+ color = 1
+ curses.init_pair( color, fg, bg )
+ self.win.bkgdset( ord(' '), curses.color_pair(color) )
+ else:
+ self.win.bkgdset( ord(' '), curses.A_BOLD )
+ """
+ self.erase()
+ self.setScrolling()
+ self.win.noutrefresh()
+
+ def erase( self ):
+ self.win.erase()
+
+ def setScrolling( self, b = True ):
+ self.win.scrollok( b )
+ self.win.idlok( b )
+
+ def setBoxed( self ):
+ self.boxed = True
+ self.win.box()
+ self.win.noutrefresh()
+
+ def setText( self, x, y, text, *args ):
+ self.win.addstr( y, x, text, *args )
+ self.win.noutrefresh()
+
+ def appendText( self, text, *args ):
+ self.win.addstr( text, *args )
+ self.win.noutrefresh()
+
+ def drawHline( self, y ):
+ self.win.hline( y, 0, curses.ACS_HLINE, self.dimensions[WIDTH] )
+ self.win.noutrefresh()
+
+ class DecoratedWindow( Window ):
+ """Base class for windows with a box and a title bar"""
+ def __init__( self, title, x, y, width, height, fg=curses.COLOR_BLACK, bg=curses.COLOR_WHITE ):
+ NCursesUI.Window.__init__( self, x+1, y+3, width-2, height-4, fg, bg )
+ self.decoration = NCursesUI.Window( x, y, width, height, fg, bg )
+ self.decoration.setBoxed()
+ self.decoration.win.hline( 2, 1, curses.ACS_HLINE, width-2 )
+ self.setTitle( title )
+
+ def setTitle( self, title ):
+ self.decoration.setText( 1, 1, title.center( self.dimensions[WIDTH]-2 ), curses.A_BOLD )
+
+ #-------------------------------------------------------------------------#
+# class TitleWindow( Window ):
+ #-------------------------------------------------------------------------#
+# """Title Window"""
+# def __init__( self, x, y, width, height ):
+# NCursesUI.Window.__init__( self, x, y, width, height )
+# version = bb.__version__
+# title = "BitBake %s" % version
+# credit = "(C) 2003-2007 Team BitBake"
+# #self.win.hline( 2, 1, curses.ACS_HLINE, width-2 )
+# self.win.border()
+# self.setText( 1, 1, title.center( self.dimensions[WIDTH]-2 ), curses.A_BOLD )
+# self.setText( 1, 2, credit.center( self.dimensions[WIDTH]-2 ), curses.A_BOLD )
+
+ #-------------------------------------------------------------------------#
+ class ThreadActivityWindow( DecoratedWindow ):
+ #-------------------------------------------------------------------------#
+ """Thread Activity Window"""
+ def __init__( self, x, y, width, height ):
+ NCursesUI.DecoratedWindow.__init__( self, "Thread Activity", x, y, width, height )
+
+ def setStatus( self, thread, text ):
+ line = "%02d: %s" % ( thread, text )
+ width = self.dimensions[WIDTH]
+ if ( len(line) > width ):
+ line = line[:width-3] + "..."
+ else:
+ line = line.ljust( width )
+ self.setText( 0, thread, line )
+
+ #-------------------------------------------------------------------------#
+ class MainWindow( DecoratedWindow ):
+ #-------------------------------------------------------------------------#
+ """Main Window"""
+ def __init__( self, x, y, width, height ):
+ self.StatusPosition = width - MAXSTATUSLENGTH
+ NCursesUI.DecoratedWindow.__init__( self, None, x, y, width, height )
+ curses.nl()
+
+ def setTitle( self, title ):
+ title = "BitBake %s" % bb.__version__
+ self.decoration.setText( 2, 1, title, curses.A_BOLD )
+ self.decoration.setText( self.StatusPosition - 8, 1, "Status:", curses.A_BOLD )
+
+ def setStatus(self, status):
+ while len(status) < MAXSTATUSLENGTH:
+ status = status + " "
+ self.decoration.setText( self.StatusPosition, 1, status, curses.A_BOLD )
+
+
+ #-------------------------------------------------------------------------#
+ class ShellOutputWindow( DecoratedWindow ):
+ #-------------------------------------------------------------------------#
+ """Interactive Command Line Output"""
+ def __init__( self, x, y, width, height ):
+ NCursesUI.DecoratedWindow.__init__( self, "Command Line Window", x, y, width, height )
+
+ #-------------------------------------------------------------------------#
+ class ShellInputWindow( Window ):
+ #-------------------------------------------------------------------------#
+ """Interactive Command Line Input"""
+ def __init__( self, x, y, width, height ):
+ NCursesUI.Window.__init__( self, x, y, width, height )
+
+# put that to the top again from curses.textpad import Textbox
+# self.textbox = Textbox( self.win )
+# t = threading.Thread()
+# t.run = self.textbox.edit
+# t.start()
+
+ #-------------------------------------------------------------------------#
+ def main(self, stdscr, server, eventHandler, params):
+ #-------------------------------------------------------------------------#
+ height, width = stdscr.getmaxyx()
+
+ # for now split it like that:
+ # MAIN_y + THREAD_y = 2/3 screen at the top
+ # MAIN_x = 2/3 left, THREAD_y = 1/3 right
+ # CLI_y = 1/3 of screen at the bottom
+ # CLI_x = full
+
+ main_left = 0
+ main_top = 0
+ main_height = ( height // 3 * 2 )
+ main_width = ( width // 3 ) * 2
+ clo_left = main_left
+ clo_top = main_top + main_height
+ clo_height = height - main_height - main_top - 1
+ clo_width = width
+ cli_left = main_left
+ cli_top = clo_top + clo_height
+ cli_height = 1
+ cli_width = width
+ thread_left = main_left + main_width
+ thread_top = main_top
+ thread_height = main_height
+ thread_width = width - main_width
+
+ #tw = self.TitleWindow( 0, 0, width, main_top )
+ mw = self.MainWindow( main_left, main_top, main_width, main_height )
+ taw = self.ThreadActivityWindow( thread_left, thread_top, thread_width, thread_height )
+ clo = self.ShellOutputWindow( clo_left, clo_top, clo_width, clo_height )
+ cli = self.ShellInputWindow( cli_left, cli_top, cli_width, cli_height )
+ cli.setText( 0, 0, "BB>" )
+
+ mw.setStatus("Idle")
+
+ helper = uihelper.BBUIHelper()
+ shutdown = 0
+
+ try:
+ params.updateFromServer(server)
+ cmdline = params.parseActions()
+ if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
+ return 1
+ if 'msg' in cmdline and cmdline['msg']:
+ logger.error(cmdline['msg'])
+ return 1
+ cmdline = cmdline['action']
+ ret, error = server.runCommand(cmdline)
+ if error:
+ print("Error running command '%s': %s" % (cmdline, error))
+ return
+ elif ret != True:
+ print("Couldn't get default commandlind! %s" % ret)
+ return
+ except xmlrpc.client.Fault as x:
+ print("XMLRPC Fault getting commandline:\n %s" % x)
+ return
+
+ exitflag = False
+ while not exitflag:
+ try:
+ event = eventHandler.waitEvent(0.25)
+ if not event:
+ continue
+
+ helper.eventHandler(event)
+ if isinstance(event, bb.build.TaskBase):
+ mw.appendText("NOTE: %s\n" % event._message)
+ if isinstance(event, logging.LogRecord):
+ mw.appendText(logging.getLevelName(event.levelno) + ': ' + event.getMessage() + '\n')
+
+ if isinstance(event, bb.event.CacheLoadStarted):
+ self.parse_total = event.total
+ if isinstance(event, bb.event.CacheLoadProgress):
+ x = event.current
+ y = self.parse_total
+ mw.setStatus("Loading Cache: %s [%2d %%]" % ( next(parsespin), x*100/y ) )
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ mw.setStatus("Idle")
+ mw.appendText("Loaded %d entries from dependency cache.\n"
+ % ( event.num_entries))
+
+ if isinstance(event, bb.event.ParseStarted):
+ self.parse_total = event.total
+ if isinstance(event, bb.event.ParseProgress):
+ x = event.current
+ y = self.parse_total
+ mw.setStatus("Parsing Recipes: %s [%2d %%]" % ( next(parsespin), x*100/y ) )
+ if isinstance(event, bb.event.ParseCompleted):
+ mw.setStatus("Idle")
+ mw.appendText("Parsing finished. %d cached, %d parsed, %d skipped, %d masked.\n"
+ % ( event.cached, event.parsed, event.skipped, event.masked ))
+
+# if isinstance(event, bb.build.TaskFailed):
+# if event.logfile:
+# if data.getVar("BBINCLUDELOGS", d):
+# bb.error("log data follows (%s)" % logfile)
+# number_of_lines = data.getVar("BBINCLUDELOGS_LINES", d)
+# if number_of_lines:
+# subprocess.check_call('tail -n%s %s' % (number_of_lines, logfile), shell=True)
+# else:
+# f = open(logfile, "r")
+# while True:
+# l = f.readline()
+# if l == '':
+# break
+# l = l.rstrip()
+# print '| %s' % l
+# f.close()
+# else:
+# bb.error("see log in %s" % logfile)
+
+ if isinstance(event, bb.command.CommandCompleted):
+ # stop so the user can see the result of the build, but
+ # also allow them to now exit with a single ^C
+ shutdown = 2
+ if isinstance(event, bb.command.CommandFailed):
+ mw.appendText(str(event))
+ time.sleep(2)
+ exitflag = True
+ if isinstance(event, bb.command.CommandExit):
+ exitflag = True
+ if isinstance(event, bb.cooker.CookerExit):
+ exitflag = True
+
+ if isinstance(event, bb.event.LogExecTTY):
+ mw.appendText('WARN: ' + event.msg + '\n')
+ if helper.needUpdate:
+ activetasks, failedtasks = helper.getTasks()
+ taw.erase()
+ taw.setText(0, 0, "")
+ if activetasks:
+ taw.appendText("Active Tasks:\n")
+ for task in activetasks.values():
+ taw.appendText(task["title"] + '\n')
+ if failedtasks:
+ taw.appendText("Failed Tasks:\n")
+ for task in failedtasks:
+ taw.appendText(task["title"] + '\n')
+
+ curses.doupdate()
+ except EnvironmentError as ioerror:
+ # ignore interrupted io
+ if ioerror.args[0] == 4:
+ pass
+
+ except KeyboardInterrupt:
+ if shutdown == 2:
+ mw.appendText("Third Keyboard Interrupt, exit.\n")
+ exitflag = True
+ if shutdown == 1:
+ mw.appendText("Second Keyboard Interrupt, stopping...\n")
+ _, error = server.runCommand(["stateForceShutdown"])
+ if error:
+ print("Unable to cleanly stop: %s" % error)
+ if shutdown == 0:
+ mw.appendText("Keyboard Interrupt, closing down...\n")
+ _, error = server.runCommand(["stateShutdown"])
+ if error:
+ print("Unable to cleanly shutdown: %s" % error)
+ shutdown = shutdown + 1
+ pass
+
+def main(server, eventHandler, params):
+ if not os.isatty(sys.stdout.fileno()):
+ print("FATAL: Unable to run 'ncurses' UI without a TTY.")
+ return
+ ui = NCursesUI()
+ try:
+ curses.wrapper(ui.main, server, eventHandler, params)
+ except:
+ import traceback
+ traceback.print_exc()
diff --git a/poky/bitbake/lib/bb/ui/taskexp.py b/poky/bitbake/lib/bb/ui/taskexp.py
new file mode 100644
index 000000000..0e8e9d4cf
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/taskexp.py
@@ -0,0 +1,328 @@
+#
+# BitBake Graphical GTK based Dependency Explorer
+#
+# Copyright (C) 2007 Ross Burton
+# Copyright (C) 2007 - 2008 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import gi
+gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk, Gdk, GObject
+from multiprocessing import Queue
+import threading
+from xmlrpc import client
+import time
+import bb
+import bb.event
+
+# Package Model
+(COL_PKG_NAME) = (0)
+
+# Dependency Model
+(TYPE_DEP, TYPE_RDEP) = (0, 1)
+(COL_DEP_TYPE, COL_DEP_PARENT, COL_DEP_PACKAGE) = (0, 1, 2)
+
+
+class PackageDepView(Gtk.TreeView):
+ def __init__(self, model, dep_type, label):
+ Gtk.TreeView.__init__(self)
+ self.current = None
+ self.dep_type = dep_type
+ self.filter_model = model.filter_new()
+ self.filter_model.set_visible_func(self._filter, data=None)
+ self.set_model(self.filter_model)
+ self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PACKAGE))
+
+ def _filter(self, model, iter, data):
+ this_type = model[iter][COL_DEP_TYPE]
+ package = model[iter][COL_DEP_PARENT]
+ if this_type != self.dep_type: return False
+ return package == self.current
+
+ def set_current_package(self, package):
+ self.current = package
+ self.filter_model.refilter()
+
+
+class PackageReverseDepView(Gtk.TreeView):
+ def __init__(self, model, label):
+ Gtk.TreeView.__init__(self)
+ self.current = None
+ self.filter_model = model.filter_new()
+ self.filter_model.set_visible_func(self._filter)
+ self.sort_model = self.filter_model.sort_new_with_model()
+ self.sort_model.set_sort_column_id(COL_DEP_PARENT, Gtk.SortType.ASCENDING)
+ self.set_model(self.sort_model)
+ self.append_column(Gtk.TreeViewColumn(label, Gtk.CellRendererText(), text=COL_DEP_PARENT))
+
+ def _filter(self, model, iter, data):
+ package = model[iter][COL_DEP_PACKAGE]
+ return package == self.current
+
+ def set_current_package(self, package):
+ self.current = package
+ self.filter_model.refilter()
+
+
+class DepExplorer(Gtk.Window):
+ def __init__(self):
+ Gtk.Window.__init__(self)
+ self.set_title("Task Dependency Explorer")
+ self.set_default_size(500, 500)
+ self.connect("delete-event", Gtk.main_quit)
+
+ # Create the data models
+ self.pkg_model = Gtk.ListStore(GObject.TYPE_STRING)
+ self.pkg_model.set_sort_column_id(COL_PKG_NAME, Gtk.SortType.ASCENDING)
+ self.depends_model = Gtk.ListStore(GObject.TYPE_INT, GObject.TYPE_STRING, GObject.TYPE_STRING)
+ self.depends_model.set_sort_column_id(COL_DEP_PACKAGE, Gtk.SortType.ASCENDING)
+
+ pane = Gtk.HPaned()
+ pane.set_position(250)
+ self.add(pane)
+
+ # The master list of packages
+ scrolled = Gtk.ScrolledWindow()
+ scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+ scrolled.set_shadow_type(Gtk.ShadowType.IN)
+
+ self.pkg_treeview = Gtk.TreeView(self.pkg_model)
+ self.pkg_treeview.get_selection().connect("changed", self.on_cursor_changed)
+ column = Gtk.TreeViewColumn("Package", Gtk.CellRendererText(), text=COL_PKG_NAME)
+ self.pkg_treeview.append_column(column)
+ pane.add1(scrolled)
+ scrolled.add(self.pkg_treeview)
+
+ box = Gtk.VBox(homogeneous=True, spacing=4)
+
+ # Task Depends
+ scrolled = Gtk.ScrolledWindow()
+ scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+ scrolled.set_shadow_type(Gtk.ShadowType.IN)
+ self.dep_treeview = PackageDepView(self.depends_model, TYPE_DEP, "Dependencies")
+ self.dep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PACKAGE)
+ scrolled.add(self.dep_treeview)
+ box.add(scrolled)
+ pane.add2(box)
+
+ # Reverse Task Depends
+ scrolled = Gtk.ScrolledWindow()
+ scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
+ scrolled.set_shadow_type(Gtk.ShadowType.IN)
+ self.revdep_treeview = PackageReverseDepView(self.depends_model, "Dependent Tasks")
+ self.revdep_treeview.connect("row-activated", self.on_package_activated, COL_DEP_PARENT)
+ scrolled.add(self.revdep_treeview)
+ box.add(scrolled)
+ pane.add2(box)
+
+ self.show_all()
+
+ def on_package_activated(self, treeview, path, column, data_col):
+ model = treeview.get_model()
+ package = model.get_value(model.get_iter(path), data_col)
+
+ pkg_path = []
+ def finder(model, path, iter, needle):
+ package = model.get_value(iter, COL_PKG_NAME)
+ if package == needle:
+ pkg_path.append(path)
+ return True
+ else:
+ return False
+ self.pkg_model.foreach(finder, package)
+ if pkg_path:
+ self.pkg_treeview.get_selection().select_path(pkg_path[0])
+ self.pkg_treeview.scroll_to_cell(pkg_path[0])
+
+ def on_cursor_changed(self, selection):
+ (model, it) = selection.get_selected()
+ if it is None:
+ current_package = None
+ else:
+ current_package = model.get_value(it, COL_PKG_NAME)
+ self.dep_treeview.set_current_package(current_package)
+ self.revdep_treeview.set_current_package(current_package)
+
+
+ def parse(self, depgraph):
+ for task in depgraph["tdepends"]:
+ self.pkg_model.insert(0, (task,))
+ for depend in depgraph["tdepends"][task]:
+ self.depends_model.insert (0, (TYPE_DEP, task, depend))
+
+
+class gtkthread(threading.Thread):
+ quit = threading.Event()
+ def __init__(self, shutdown):
+ threading.Thread.__init__(self)
+ self.setDaemon(True)
+ self.shutdown = shutdown
+ if not Gtk.init_check()[0]:
+ sys.stderr.write("Gtk+ init failed. Make sure DISPLAY variable is set.\n")
+ gtkthread.quit.set()
+
+ def run(self):
+ GObject.threads_init()
+ Gdk.threads_init()
+ Gtk.main()
+ gtkthread.quit.set()
+
+
+def main(server, eventHandler, params):
+ shutdown = 0
+
+ gtkgui = gtkthread(shutdown)
+ gtkgui.start()
+
+ try:
+ params.updateFromServer(server)
+ cmdline = params.parseActions()
+ if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
+ return 1
+ if 'msg' in cmdline and cmdline['msg']:
+ print(cmdline['msg'])
+ return 1
+ cmdline = cmdline['action']
+ if not cmdline or cmdline[0] != "generateDotGraph":
+ print("This UI requires the -g option")
+ return 1
+ ret, error = server.runCommand(["generateDepTreeEvent", cmdline[1], cmdline[2]])
+ if error:
+ print("Error running command '%s': %s" % (cmdline, error))
+ return 1
+ elif ret != True:
+ print("Error running command '%s': returned %s" % (cmdline, ret))
+ return 1
+ except client.Fault as x:
+ print("XMLRPC Fault getting commandline:\n %s" % x)
+ return
+
+ if gtkthread.quit.isSet():
+ return
+
+ Gdk.threads_enter()
+ dep = DepExplorer()
+ bardialog = Gtk.Dialog(parent=dep,
+ flags=Gtk.DialogFlags.MODAL|Gtk.DialogFlags.DESTROY_WITH_PARENT)
+ bardialog.set_default_size(400, 50)
+ box = bardialog.get_content_area()
+ pbar = Gtk.ProgressBar()
+ box.pack_start(pbar, True, True, 0)
+ bardialog.show_all()
+ bardialog.connect("delete-event", Gtk.main_quit)
+ Gdk.threads_leave()
+
+ progress_total = 0
+ while True:
+ try:
+ event = eventHandler.waitEvent(0.25)
+ if gtkthread.quit.isSet():
+ _, error = server.runCommand(["stateForceShutdown"])
+ if error:
+ print('Unable to cleanly stop: %s' % error)
+ break
+
+ if event is None:
+ continue
+
+ if isinstance(event, bb.event.CacheLoadStarted):
+ progress_total = event.total
+ Gdk.threads_enter()
+ bardialog.set_title("Loading Cache")
+ pbar.set_fraction(0.0)
+ Gdk.threads_leave()
+
+ if isinstance(event, bb.event.CacheLoadProgress):
+ x = event.current
+ Gdk.threads_enter()
+ pbar.set_fraction(x * 1.0 / progress_total)
+ Gdk.threads_leave()
+ continue
+
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ continue
+
+ if isinstance(event, bb.event.ParseStarted):
+ progress_total = event.total
+ if progress_total == 0:
+ continue
+ Gdk.threads_enter()
+ pbar.set_fraction(0.0)
+ bardialog.set_title("Processing recipes")
+ Gdk.threads_leave()
+
+ if isinstance(event, bb.event.ParseProgress):
+ x = event.current
+ Gdk.threads_enter()
+ pbar.set_fraction(x * 1.0 / progress_total)
+ Gdk.threads_leave()
+ continue
+
+ if isinstance(event, bb.event.ParseCompleted):
+ Gdk.threads_enter()
+ bardialog.set_title("Generating dependency tree")
+ Gdk.threads_leave()
+ continue
+
+ if isinstance(event, bb.event.DepTreeGenerated):
+ Gdk.threads_enter()
+ bardialog.hide()
+ dep.parse(event._depgraph)
+ Gdk.threads_leave()
+
+ if isinstance(event, bb.command.CommandCompleted):
+ continue
+
+ if isinstance(event, bb.event.NoProvider):
+ print(str(event))
+
+ _, error = server.runCommand(["stateShutdown"])
+ if error:
+ print('Unable to cleanly shutdown: %s' % error)
+ break
+
+ if isinstance(event, bb.command.CommandFailed):
+ print(str(event))
+ return event.exitcode
+
+ if isinstance(event, bb.command.CommandExit):
+ return event.exitcode
+
+ if isinstance(event, bb.cooker.CookerExit):
+ break
+
+ continue
+ except EnvironmentError as ioerror:
+ # ignore interrupted io
+ if ioerror.args[0] == 4:
+ pass
+ except KeyboardInterrupt:
+ if shutdown == 2:
+ print("\nThird Keyboard Interrupt, exit.\n")
+ break
+ if shutdown == 1:
+ print("\nSecond Keyboard Interrupt, stopping...\n")
+ _, error = server.runCommand(["stateForceShutdown"])
+ if error:
+ print('Unable to cleanly stop: %s' % error)
+ if shutdown == 0:
+ print("\nKeyboard Interrupt, closing down...\n")
+ _, error = server.runCommand(["stateShutdown"])
+ if error:
+ print('Unable to cleanly shutdown: %s' % error)
+ shutdown = shutdown + 1
+ pass
diff --git a/poky/bitbake/lib/bb/ui/toasterui.py b/poky/bitbake/lib/bb/ui/toasterui.py
new file mode 100644
index 000000000..88cec3759
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/toasterui.py
@@ -0,0 +1,487 @@
+#
+# BitBake ToasterUI Implementation
+# based on (No)TTY UI Implementation by Richard Purdie
+#
+# Handling output to TTYs or files (no TTY)
+#
+# Copyright (C) 2006-2012 Richard Purdie
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from __future__ import division
+import time
+import sys
+try:
+ import bb
+except RuntimeError as exc:
+ sys.exit(str(exc))
+
+from bb.ui import uihelper
+from bb.ui.buildinfohelper import BuildInfoHelper
+
+import bb.msg
+import logging
+import os
+
+# pylint: disable=invalid-name
+# module properties for UI modules are read by bitbake and the contract should not be broken
+
+
+featureSet = [bb.cooker.CookerFeatures.HOB_EXTRA_CACHES, bb.cooker.CookerFeatures.BASEDATASTORE_TRACKING, bb.cooker.CookerFeatures.SEND_SANITYEVENTS]
+
+logger = logging.getLogger("ToasterLogger")
+interactive = sys.stdout.isatty()
+
+def _log_settings_from_server(server):
+ # Get values of variables which control our output
+ includelogs, error = server.runCommand(["getVariable", "BBINCLUDELOGS"])
+ if error:
+ logger.error("Unable to get the value of BBINCLUDELOGS variable: %s", error)
+ raise BaseException(error)
+ loglines, error = server.runCommand(["getVariable", "BBINCLUDELOGS_LINES"])
+ if error:
+ logger.error("Unable to get the value of BBINCLUDELOGS_LINES variable: %s", error)
+ raise BaseException(error)
+ consolelogfile, error = server.runCommand(["getVariable", "BB_CONSOLELOG"])
+ if error:
+ logger.error("Unable to get the value of BB_CONSOLELOG variable: %s", error)
+ raise BaseException(error)
+ return consolelogfile
+
+# create a log file for a single build and direct the logger at it;
+# log file name is timestamped to the millisecond (depending
+# on system clock accuracy) to ensure it doesn't overlap with
+# other log file names
+#
+# returns (log file, path to log file) for a build
+def _open_build_log(log_dir):
+ format_str = "%(levelname)s: %(message)s"
+
+ now = time.time()
+ now_ms = int((now - int(now)) * 1000)
+ time_str = time.strftime('build_%Y%m%d_%H%M%S', time.localtime(now))
+ log_file_name = time_str + ('.%d.log' % now_ms)
+ build_log_file_path = os.path.join(log_dir, log_file_name)
+
+ build_log = logging.FileHandler(build_log_file_path)
+
+ logformat = bb.msg.BBLogFormatter(format_str)
+ build_log.setFormatter(logformat)
+
+ bb.msg.addDefaultlogFilter(build_log)
+ logger.addHandler(build_log)
+
+ return (build_log, build_log_file_path)
+
+# stop logging to the build log if it exists
+def _close_build_log(build_log):
+ if build_log:
+ build_log.flush()
+ build_log.close()
+ logger.removeHandler(build_log)
+
+_evt_list = [
+ "bb.build.TaskBase",
+ "bb.build.TaskFailed",
+ "bb.build.TaskFailedSilent",
+ "bb.build.TaskStarted",
+ "bb.build.TaskSucceeded",
+ "bb.command.CommandCompleted",
+ "bb.command.CommandExit",
+ "bb.command.CommandFailed",
+ "bb.cooker.CookerExit",
+ "bb.event.BuildInit",
+ "bb.event.BuildCompleted",
+ "bb.event.BuildStarted",
+ "bb.event.CacheLoadCompleted",
+ "bb.event.CacheLoadProgress",
+ "bb.event.CacheLoadStarted",
+ "bb.event.ConfigParsed",
+ "bb.event.DepTreeGenerated",
+ "bb.event.LogExecTTY",
+ "bb.event.MetadataEvent",
+ "bb.event.MultipleProviders",
+ "bb.event.NoProvider",
+ "bb.event.ParseCompleted",
+ "bb.event.ParseProgress",
+ "bb.event.ParseStarted",
+ "bb.event.RecipeParsed",
+ "bb.event.SanityCheck",
+ "bb.event.SanityCheckPassed",
+ "bb.event.TreeDataPreparationCompleted",
+ "bb.event.TreeDataPreparationStarted",
+ "bb.runqueue.runQueueTaskCompleted",
+ "bb.runqueue.runQueueTaskFailed",
+ "bb.runqueue.runQueueTaskSkipped",
+ "bb.runqueue.runQueueTaskStarted",
+ "bb.runqueue.sceneQueueTaskCompleted",
+ "bb.runqueue.sceneQueueTaskFailed",
+ "bb.runqueue.sceneQueueTaskStarted",
+ "logging.LogRecord"]
+
+def main(server, eventHandler, params):
+ # set to a logging.FileHandler instance when a build starts;
+ # see _open_build_log()
+ build_log = None
+
+ # set to the log path when a build starts
+ build_log_file_path = None
+
+ helper = uihelper.BBUIHelper()
+
+ # TODO don't use log output to determine when bitbake has started
+ #
+ # WARNING: this log handler cannot be removed, as localhostbecontroller
+ # relies on output in the toaster_ui.log file to determine whether
+ # the bitbake server has started, which only happens if
+ # this logger is setup here (see the TODO in the loop below)
+ console = logging.StreamHandler(sys.stdout)
+ format_str = "%(levelname)s: %(message)s"
+ formatter = bb.msg.BBLogFormatter(format_str)
+ bb.msg.addDefaultlogFilter(console)
+ console.setFormatter(formatter)
+ logger.addHandler(console)
+ logger.setLevel(logging.INFO)
+ llevel, debug_domains = bb.msg.constructLogOptions()
+ result, error = server.runCommand(["setEventMask", server.getEventHandle(), llevel, debug_domains, _evt_list])
+ if not result or error:
+ logger.error("can't set event mask: %s", error)
+ return 1
+
+ # verify and warn
+ build_history_enabled = True
+ inheritlist, _ = server.runCommand(["getVariable", "INHERIT"])
+
+ if not "buildhistory" in inheritlist.split(" "):
+ logger.warning("buildhistory is not enabled. Please enable INHERIT += \"buildhistory\" to see image details.")
+ build_history_enabled = False
+
+ if not "buildstats" in inheritlist.split(" "):
+ logger.warning("buildstats is not enabled. Please enable INHERIT += \"buildstats\" to generate build statistics.")
+
+ if not params.observe_only:
+ params.updateFromServer(server)
+ params.updateToServer(server, os.environ.copy())
+ cmdline = params.parseActions()
+ if not cmdline:
+ print("Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help' for usage information.")
+ return 1
+ if 'msg' in cmdline and cmdline['msg']:
+ logger.error(cmdline['msg'])
+ return 1
+
+ ret, error = server.runCommand(cmdline['action'])
+ if error:
+ logger.error("Command '%s' failed: %s" % (cmdline, error))
+ return 1
+ elif ret != True:
+ logger.error("Command '%s' failed: returned %s" % (cmdline, ret))
+ return 1
+
+ # set to 1 when toasterui needs to shut down
+ main.shutdown = 0
+
+ interrupted = False
+ return_value = 0
+ errors = 0
+ warnings = 0
+ taskfailures = []
+ first = True
+
+ buildinfohelper = BuildInfoHelper(server, build_history_enabled,
+ os.getenv('TOASTER_BRBE'))
+
+ # write our own log files into bitbake's log directory;
+ # we're only interested in the path to the parent directory of
+ # this file, as we're writing our own logs into the same directory
+ consolelogfile = _log_settings_from_server(server)
+ log_dir = os.path.dirname(consolelogfile)
+ bb.utils.mkdirhier(log_dir)
+
+ while True:
+ try:
+ event = eventHandler.waitEvent(0.25)
+ if first:
+ first = False
+
+ # TODO don't use log output to determine when bitbake has started
+ #
+ # this is the line localhostbecontroller needs to
+ # see in toaster_ui.log which it uses to decide whether
+ # the bitbake server has started...
+ logger.info("ToasterUI waiting for events")
+
+ if event is None:
+ if main.shutdown > 0:
+ # if shutting down, close any open build log first
+ _close_build_log(build_log)
+
+ break
+ continue
+
+ helper.eventHandler(event)
+
+ # pylint: disable=protected-access
+ # the code will look into the protected variables of the event; no easy way around this
+
+ if isinstance(event, bb.event.HeartbeatEvent):
+ continue
+
+ if isinstance(event, bb.event.ParseStarted):
+ if not (build_log and build_log_file_path):
+ build_log, build_log_file_path = _open_build_log(log_dir)
+
+ buildinfohelper.store_started_build()
+ buildinfohelper.save_build_log_file_path(build_log_file_path)
+ buildinfohelper.set_recipes_to_parse(event.total)
+ continue
+
+ # create a build object in buildinfohelper from either BuildInit
+ # (if available) or BuildStarted (for jethro and previous versions)
+ if isinstance(event, (bb.event.BuildStarted, bb.event.BuildInit)):
+ if not (build_log and build_log_file_path):
+ build_log, build_log_file_path = _open_build_log(log_dir)
+
+ buildinfohelper.save_build_targets(event)
+ buildinfohelper.save_build_log_file_path(build_log_file_path)
+
+ # get additional data from BuildStarted
+ if isinstance(event, bb.event.BuildStarted):
+ buildinfohelper.save_build_layers_and_variables()
+ continue
+
+ if isinstance(event, bb.event.ParseProgress):
+ buildinfohelper.set_recipes_parsed(event.current)
+ continue
+
+ if isinstance(event, bb.event.ParseCompleted):
+ buildinfohelper.set_recipes_parsed(event.total)
+ continue
+
+ if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
+ buildinfohelper.update_and_store_task(event)
+ logger.info("Logfile for task %s", event.logfile)
+ continue
+
+ if isinstance(event, bb.build.TaskBase):
+ logger.info(event._message)
+
+ if isinstance(event, bb.event.LogExecTTY):
+ logger.info(event.msg)
+ continue
+
+ if isinstance(event, logging.LogRecord):
+ if event.levelno == -1:
+ event.levelno = formatter.ERROR
+
+ buildinfohelper.store_log_event(event)
+
+ if event.levelno >= formatter.ERROR:
+ errors = errors + 1
+ elif event.levelno == formatter.WARNING:
+ warnings = warnings + 1
+
+ # For "normal" logging conditions, don't show note logs from tasks
+ # but do show them if the user has changed the default log level to
+ # include verbose/debug messages
+ if event.taskpid != 0 and event.levelno <= formatter.NOTE:
+ continue
+
+ logger.handle(event)
+ continue
+
+ if isinstance(event, bb.build.TaskFailed):
+ buildinfohelper.update_and_store_task(event)
+ logfile = event.logfile
+ if logfile and os.path.exists(logfile):
+ bb.error("Logfile of failure stored in: %s" % logfile)
+ continue
+
+ # these events are unprocessed now, but may be used in the future to log
+ # timing and error informations from the parsing phase in Toaster
+ if isinstance(event, (bb.event.SanityCheckPassed, bb.event.SanityCheck)):
+ continue
+ if isinstance(event, bb.event.CacheLoadStarted):
+ continue
+ if isinstance(event, bb.event.CacheLoadProgress):
+ continue
+ if isinstance(event, bb.event.CacheLoadCompleted):
+ continue
+ if isinstance(event, bb.event.MultipleProviders):
+ logger.info(str(event))
+ continue
+
+ if isinstance(event, bb.event.NoProvider):
+ errors = errors + 1
+ text = str(event)
+ logger.error(text)
+ buildinfohelper.store_log_error(text)
+ continue
+
+ if isinstance(event, bb.event.ConfigParsed):
+ continue
+ if isinstance(event, bb.event.RecipeParsed):
+ continue
+
+ # end of saved events
+
+ if isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped)):
+ buildinfohelper.store_started_task(event)
+ continue
+
+ if isinstance(event, bb.runqueue.runQueueTaskCompleted):
+ buildinfohelper.update_and_store_task(event)
+ continue
+
+ if isinstance(event, bb.runqueue.runQueueTaskFailed):
+ buildinfohelper.update_and_store_task(event)
+ taskfailures.append(event.taskstring)
+ logger.error(str(event))
+ continue
+
+ if isinstance(event, (bb.runqueue.sceneQueueTaskCompleted, bb.runqueue.sceneQueueTaskFailed)):
+ buildinfohelper.update_and_store_task(event)
+ continue
+
+
+ if isinstance(event, (bb.event.TreeDataPreparationStarted, bb.event.TreeDataPreparationCompleted)):
+ continue
+
+ if isinstance(event, (bb.event.BuildCompleted, bb.command.CommandFailed)):
+
+ errorcode = 0
+ if isinstance(event, bb.command.CommandFailed):
+ errors += 1
+ errorcode = 1
+ logger.error(str(event))
+ elif isinstance(event, bb.event.BuildCompleted):
+ buildinfohelper.scan_image_artifacts()
+ buildinfohelper.clone_required_sdk_artifacts()
+
+ # turn off logging to the current build log
+ _close_build_log(build_log)
+
+ # reset ready for next BuildStarted
+ build_log = None
+
+ # update the build info helper on BuildCompleted, not on CommandXXX
+ buildinfohelper.update_build_information(event, errors, warnings, taskfailures)
+
+ brbe = buildinfohelper.brbe
+ buildinfohelper.close(errorcode)
+
+ # we start a new build info
+ if params.observe_only:
+ logger.debug("ToasterUI prepared for new build")
+ errors = 0
+ warnings = 0
+ taskfailures = []
+ buildinfohelper = BuildInfoHelper(server, build_history_enabled)
+ else:
+ main.shutdown = 1
+
+ logger.info("ToasterUI build done, brbe: %s", brbe)
+ continue
+
+ if isinstance(event, (bb.command.CommandCompleted,
+ bb.command.CommandFailed,
+ bb.command.CommandExit)):
+ if params.observe_only:
+ errorcode = 0
+ else:
+ main.shutdown = 1
+
+ continue
+
+ if isinstance(event, bb.event.MetadataEvent):
+ if event.type == "SinglePackageInfo":
+ buildinfohelper.store_build_package_information(event)
+ elif event.type == "LayerInfo":
+ buildinfohelper.store_layer_info(event)
+ elif event.type == "BuildStatsList":
+ buildinfohelper.store_tasks_stats(event)
+ elif event.type == "ImagePkgList":
+ buildinfohelper.store_target_package_data(event)
+ elif event.type == "MissedSstate":
+ buildinfohelper.store_missed_state_tasks(event)
+ elif event.type == "SDKArtifactInfo":
+ buildinfohelper.scan_sdk_artifacts(event)
+ elif event.type == "SetBRBE":
+ buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
+ elif event.type == "TaskArtifacts":
+ buildinfohelper.scan_task_artifacts(event)
+ elif event.type == "OSErrorException":
+ logger.error(event)
+ else:
+ logger.error("Unprocessed MetadataEvent %s", event.type)
+ continue
+
+ if isinstance(event, bb.cooker.CookerExit):
+ # shutdown when bitbake server shuts down
+ main.shutdown = 1
+ continue
+
+ if isinstance(event, bb.event.DepTreeGenerated):
+ buildinfohelper.store_dependency_information(event)
+ continue
+
+ logger.warning("Unknown event: %s", event)
+ return_value += 1
+
+ except EnvironmentError as ioerror:
+ logger.warning("EnvironmentError: %s" % ioerror)
+ # ignore interrupted io system calls
+ if ioerror.args[0] == 4: # errno 4 is EINTR
+ logger.warning("Skipped EINTR: %s" % ioerror)
+ else:
+ raise
+ except KeyboardInterrupt:
+ if params.observe_only:
+ print("\nKeyboard Interrupt, exiting observer...")
+ main.shutdown = 2
+ if not params.observe_only and main.shutdown == 1:
+ print("\nSecond Keyboard Interrupt, stopping...\n")
+ _, error = server.runCommand(["stateForceShutdown"])
+ if error:
+ logger.error("Unable to cleanly stop: %s" % error)
+ if not params.observe_only and main.shutdown == 0:
+ print("\nKeyboard Interrupt, closing down...\n")
+ interrupted = True
+ _, error = server.runCommand(["stateShutdown"])
+ if error:
+ logger.error("Unable to cleanly shutdown: %s" % error)
+ buildinfohelper.cancel_cli_build()
+ main.shutdown = main.shutdown + 1
+ except Exception as e:
+ # print errors to log
+ import traceback
+ from pprint import pformat
+ exception_data = traceback.format_exc()
+ logger.error("%s\n%s" , e, exception_data)
+
+ # save them to database, if possible; if it fails, we already logged to console.
+ try:
+ buildinfohelper.store_log_exception("%s\n%s" % (str(e), exception_data))
+ except Exception as ce:
+ logger.error("CRITICAL - Failed to to save toaster exception to the database: %s", str(ce))
+
+ # make sure we return with an error
+ return_value += 1
+
+ if interrupted and return_value == 0:
+ return_value += 1
+
+ logger.warning("Return value is %d", return_value)
+ return return_value
diff --git a/poky/bitbake/lib/bb/ui/uievent.py b/poky/bitbake/lib/bb/ui/uievent.py
new file mode 100644
index 000000000..9542b911c
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/uievent.py
@@ -0,0 +1,161 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+"""
+Use this class to fork off a thread to recieve event callbacks from the bitbake
+server and queue them for the UI to process. This process must be used to avoid
+client/server deadlocks.
+"""
+
+import socket, threading, pickle, collections
+from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+
+class BBUIEventQueue:
+ def __init__(self, BBServer, clientinfo=("localhost, 0")):
+
+ self.eventQueue = []
+ self.eventQueueLock = threading.Lock()
+ self.eventQueueNotify = threading.Event()
+
+ self.BBServer = BBServer
+ self.clientinfo = clientinfo
+
+ server = UIXMLRPCServer(self.clientinfo)
+ self.host, self.port = server.socket.getsockname()
+
+ server.register_function( self.system_quit, "event.quit" )
+ server.register_function( self.send_event, "event.sendpickle" )
+ server.socket.settimeout(1)
+
+ self.EventHandle = None
+
+ # the event handler registration may fail here due to cooker being in invalid state
+ # this is a transient situation, and we should retry a couple of times before
+ # giving up
+
+ for count_tries in range(5):
+ ret = self.BBServer.registerEventHandler(self.host, self.port)
+
+ if isinstance(ret, collections.Iterable):
+ self.EventHandle, error = ret
+ else:
+ self.EventHandle = ret
+ error = ""
+
+ if self.EventHandle != None:
+ break
+
+ errmsg = "Could not register UI event handler. Error: %s, host %s, "\
+ "port %d" % (error, self.host, self.port)
+ bb.warn("%s, retry" % errmsg)
+
+ import time
+ time.sleep(1)
+ else:
+ raise Exception(errmsg)
+
+ self.server = server
+
+ self.t = threading.Thread()
+ self.t.setDaemon(True)
+ self.t.run = self.startCallbackHandler
+ self.t.start()
+
+ def getEvent(self):
+
+ self.eventQueueLock.acquire()
+
+ if len(self.eventQueue) == 0:
+ self.eventQueueLock.release()
+ return None
+
+ item = self.eventQueue.pop(0)
+
+ if len(self.eventQueue) == 0:
+ self.eventQueueNotify.clear()
+
+ self.eventQueueLock.release()
+ return item
+
+ def waitEvent(self, delay):
+ self.eventQueueNotify.wait(delay)
+ return self.getEvent()
+
+ def queue_event(self, event):
+ self.eventQueueLock.acquire()
+ self.eventQueue.append(event)
+ self.eventQueueNotify.set()
+ self.eventQueueLock.release()
+
+ def send_event(self, event):
+ self.queue_event(pickle.loads(event))
+
+ def startCallbackHandler(self):
+
+ self.server.timeout = 1
+ bb.utils.set_process_name("UIEventQueue")
+ while not self.server.quit:
+ try:
+ self.server.handle_request()
+ except Exception as e:
+ import traceback
+ logger.error("BBUIEventQueue.startCallbackHandler: Exception while trying to handle request: %s\n%s" % (e, traceback.format_exc()))
+
+ self.server.server_close()
+
+ def system_quit( self ):
+ """
+ Shut down the callback thread
+ """
+ try:
+ self.BBServer.unregisterEventHandler(self.EventHandle)
+ except:
+ pass
+ self.server.quit = True
+
+class UIXMLRPCServer (SimpleXMLRPCServer):
+
+ def __init__( self, interface ):
+ self.quit = False
+ SimpleXMLRPCServer.__init__( self,
+ interface,
+ requestHandler=SimpleXMLRPCRequestHandler,
+ logRequests=False, allow_none=True, use_builtin_types=True)
+
+ def get_request(self):
+ while not self.quit:
+ try:
+ sock, addr = self.socket.accept()
+ sock.settimeout(1)
+ return (sock, addr)
+ except socket.timeout:
+ pass
+ return (None, None)
+
+ def close_request(self, request):
+ if request is None:
+ return
+ SimpleXMLRPCServer.close_request(self, request)
+
+ def process_request(self, request, client_address):
+ if request is None:
+ return
+ SimpleXMLRPCServer.process_request(self, request, client_address)
+
diff --git a/poky/bitbake/lib/bb/ui/uihelper.py b/poky/bitbake/lib/bb/ui/uihelper.py
new file mode 100644
index 000000000..963c1ea2d
--- /dev/null
+++ b/poky/bitbake/lib/bb/ui/uihelper.py
@@ -0,0 +1,70 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2007 Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import bb.build
+import time
+
+class BBUIHelper:
+ def __init__(self):
+ self.needUpdate = False
+ self.running_tasks = {}
+ # Running PIDs preserves the order tasks were executed in
+ self.running_pids = []
+ self.failed_tasks = []
+ self.tasknumber_current = 0
+ self.tasknumber_total = 0
+
+ def eventHandler(self, event):
+ if isinstance(event, bb.build.TaskStarted):
+ if event._mc != "default":
+ self.running_tasks[event.pid] = { 'title' : "mc:%s:%s %s" % (event._mc, event._package, event._task), 'starttime' : time.time() }
+ else:
+ self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time() }
+ self.running_pids.append(event.pid)
+ self.needUpdate = True
+ elif isinstance(event, bb.build.TaskSucceeded):
+ del self.running_tasks[event.pid]
+ self.running_pids.remove(event.pid)
+ self.needUpdate = True
+ elif isinstance(event, bb.build.TaskFailedSilent):
+ del self.running_tasks[event.pid]
+ self.running_pids.remove(event.pid)
+ # Don't add to the failed tasks list since this is e.g. a setscene task failure
+ self.needUpdate = True
+ elif isinstance(event, bb.build.TaskFailed):
+ del self.running_tasks[event.pid]
+ self.running_pids.remove(event.pid)
+ self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
+ self.needUpdate = True
+ elif isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted):
+ self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1
+ self.tasknumber_total = event.stats.total
+ self.needUpdate = True
+ elif isinstance(event, bb.build.TaskProgress):
+ if event.pid > 0:
+ self.running_tasks[event.pid]['progress'] = event.progress
+ self.running_tasks[event.pid]['rate'] = event.rate
+ self.needUpdate = True
+ else:
+ return False
+ return True
+
+ def getTasks(self):
+ self.needUpdate = False
+ return (self.running_tasks, self.failed_tasks)
diff --git a/poky/bitbake/lib/bb/utils.py b/poky/bitbake/lib/bb/utils.py
new file mode 100644
index 000000000..378e699e0
--- /dev/null
+++ b/poky/bitbake/lib/bb/utils.py
@@ -0,0 +1,1539 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+"""
+BitBake Utility Functions
+"""
+
+# Copyright (C) 2004 Michael Lauer
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re, fcntl, os, string, stat, shutil, time
+import sys
+import errno
+import logging
+import bb
+import bb.msg
+import multiprocessing
+import fcntl
+import imp
+import itertools
+import subprocess
+import glob
+import fnmatch
+import traceback
+import errno
+import signal
+import ast
+import collections
+import copy
+from subprocess import getstatusoutput
+from contextlib import contextmanager
+from ctypes import cdll
+
+logger = logging.getLogger("BitBake.Util")
+python_extensions = [e for e, _, _ in imp.get_suffixes()]
+
+
+def clean_context():
+ return {
+ "os": os,
+ "bb": bb,
+ "time": time,
+ }
+
+def get_context():
+ return _context
+
+
+def set_context(ctx):
+ _context = ctx
+
+# Context used in better_exec, eval
+_context = clean_context()
+
+class VersionStringException(Exception):
+ """Exception raised when an invalid version specification is found"""
+
+def explode_version(s):
+ r = []
+ alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$')
+ numeric_regexp = re.compile('^(\d+)(.*)$')
+ while (s != ''):
+ if s[0] in string.digits:
+ m = numeric_regexp.match(s)
+ r.append((0, int(m.group(1))))
+ s = m.group(2)
+ continue
+ if s[0] in string.ascii_letters:
+ m = alpha_regexp.match(s)
+ r.append((1, m.group(1)))
+ s = m.group(2)
+ continue
+ if s[0] == '~':
+ r.append((-1, s[0]))
+ else:
+ r.append((2, s[0]))
+ s = s[1:]
+ return r
+
+def split_version(s):
+ """Split a version string into its constituent parts (PE, PV, PR)"""
+ s = s.strip(" <>=")
+ e = 0
+ if s.count(':'):
+ e = int(s.split(":")[0])
+ s = s.split(":")[1]
+ r = ""
+ if s.count('-'):
+ r = s.rsplit("-", 1)[1]
+ s = s.rsplit("-", 1)[0]
+ v = s
+ return (e, v, r)
+
+def vercmp_part(a, b):
+ va = explode_version(a)
+ vb = explode_version(b)
+ while True:
+ if va == []:
+ (oa, ca) = (0, None)
+ else:
+ (oa, ca) = va.pop(0)
+ if vb == []:
+ (ob, cb) = (0, None)
+ else:
+ (ob, cb) = vb.pop(0)
+ if (oa, ca) == (0, None) and (ob, cb) == (0, None):
+ return 0
+ if oa < ob:
+ return -1
+ elif oa > ob:
+ return 1
+ elif ca < cb:
+ return -1
+ elif ca > cb:
+ return 1
+
+def vercmp(ta, tb):
+ (ea, va, ra) = ta
+ (eb, vb, rb) = tb
+
+ r = int(ea or 0) - int(eb or 0)
+ if (r == 0):
+ r = vercmp_part(va, vb)
+ if (r == 0):
+ r = vercmp_part(ra, rb)
+ return r
+
+def vercmp_string(a, b):
+ ta = split_version(a)
+ tb = split_version(b)
+ return vercmp(ta, tb)
+
+def vercmp_string_op(a, b, op):
+ """
+ Compare two versions and check if the specified comparison operator matches the result of the comparison.
+ This function is fairly liberal about what operators it will accept since there are a variety of styles
+ depending on the context.
+ """
+ res = vercmp_string(a, b)
+ if op in ('=', '=='):
+ return res == 0
+ elif op == '<=':
+ return res <= 0
+ elif op == '>=':
+ return res >= 0
+ elif op in ('>', '>>'):
+ return res > 0
+ elif op in ('<', '<<'):
+ return res < 0
+ elif op == '!=':
+ return res != 0
+ else:
+ raise VersionStringException('Unsupported comparison operator "%s"' % op)
+
+def explode_deps(s):
+ """
+ Take an RDEPENDS style string of format:
+ "DEPEND1 (optional version) DEPEND2 (optional version) ..."
+ and return a list of dependencies.
+ Version information is ignored.
+ """
+ r = []
+ l = s.split()
+ flag = False
+ for i in l:
+ if i[0] == '(':
+ flag = True
+ #j = []
+ if not flag:
+ r.append(i)
+ #else:
+ # j.append(i)
+ if flag and i.endswith(')'):
+ flag = False
+ # Ignore version
+ #r[-1] += ' ' + ' '.join(j)
+ return r
+
+def explode_dep_versions2(s, *, sort=True):
+ """
+ Take an RDEPENDS style string of format:
+ "DEPEND1 (optional version) DEPEND2 (optional version) ..."
+ and return a dictionary of dependencies and versions.
+ """
+ r = collections.OrderedDict()
+ l = s.replace(",", "").split()
+ lastdep = None
+ lastcmp = ""
+ lastver = ""
+ incmp = False
+ inversion = False
+ for i in l:
+ if i[0] == '(':
+ incmp = True
+ i = i[1:].strip()
+ if not i:
+ continue
+
+ if incmp:
+ incmp = False
+ inversion = True
+ # This list is based on behavior and supported comparisons from deb, opkg and rpm.
+ #
+ # Even though =<, <<, ==, !=, =>, and >> may not be supported,
+ # we list each possibly valid item.
+ # The build system is responsible for validation of what it supports.
+ if i.startswith(('<=', '=<', '<<', '==', '!=', '>=', '=>', '>>')):
+ lastcmp = i[0:2]
+ i = i[2:]
+ elif i.startswith(('<', '>', '=')):
+ lastcmp = i[0:1]
+ i = i[1:]
+ else:
+ # This is an unsupported case!
+ raise VersionStringException('Invalid version specification in "(%s" - invalid or missing operator' % i)
+ lastcmp = (i or "")
+ i = ""
+ i.strip()
+ if not i:
+ continue
+
+ if inversion:
+ if i.endswith(')'):
+ i = i[:-1] or ""
+ inversion = False
+ if lastver and i:
+ lastver += " "
+ if i:
+ lastver += i
+ if lastdep not in r:
+ r[lastdep] = []
+ r[lastdep].append(lastcmp + " " + lastver)
+ continue
+
+ #if not inversion:
+ lastdep = i
+ lastver = ""
+ lastcmp = ""
+ if not (i in r and r[i]):
+ r[lastdep] = []
+
+ if sort:
+ r = collections.OrderedDict(sorted(r.items(), key=lambda x: x[0]))
+ return r
+
+def explode_dep_versions(s):
+ r = explode_dep_versions2(s)
+ for d in r:
+ if not r[d]:
+ r[d] = None
+ continue
+ if len(r[d]) > 1:
+ bb.warn("explode_dep_versions(): Item %s appeared in dependency string '%s' multiple times with different values. explode_dep_versions cannot cope with this." % (d, s))
+ r[d] = r[d][0]
+ return r
+
+def join_deps(deps, commasep=True):
+ """
+ Take the result from explode_dep_versions and generate a dependency string
+ """
+ result = []
+ for dep in deps:
+ if deps[dep]:
+ if isinstance(deps[dep], list):
+ for v in deps[dep]:
+ result.append(dep + " (" + v + ")")
+ else:
+ result.append(dep + " (" + deps[dep] + ")")
+ else:
+ result.append(dep)
+ if commasep:
+ return ", ".join(result)
+ else:
+ return " ".join(result)
+
+def _print_trace(body, line):
+ """
+ Print the Environment of a Text Body
+ """
+ error = []
+ # print the environment of the method
+ min_line = max(1, line-4)
+ max_line = min(line + 4, len(body))
+ for i in range(min_line, max_line + 1):
+ if line == i:
+ error.append(' *** %.4d:%s' % (i, body[i-1].rstrip()))
+ else:
+ error.append(' %.4d:%s' % (i, body[i-1].rstrip()))
+ return error
+
+def better_compile(text, file, realfile, mode = "exec", lineno = 0):
+ """
+ A better compile method. This method
+ will print the offending lines.
+ """
+ try:
+ cache = bb.methodpool.compile_cache(text)
+ if cache:
+ return cache
+ # We can't add to the linenumbers for compile, we can pad to the correct number of blank lines though
+ text2 = "\n" * int(lineno) + text
+ code = compile(text2, realfile, mode)
+ bb.methodpool.compile_cache_add(text, code)
+ return code
+ except Exception as e:
+ error = []
+ # split the text into lines again
+ body = text.split('\n')
+ error.append("Error in compiling python function in %s, line %s:\n" % (realfile, lineno))
+ if hasattr(e, "lineno"):
+ error.append("The code lines resulting in this error were:")
+ error.extend(_print_trace(body, e.lineno))
+ else:
+ error.append("The function causing this error was:")
+ for line in body:
+ error.append(line)
+ error.append("%s: %s" % (e.__class__.__name__, str(e)))
+
+ logger.error("\n".join(error))
+
+ e = bb.BBHandledException(e)
+ raise e
+
+def _print_exception(t, value, tb, realfile, text, context):
+ error = []
+ try:
+ exception = traceback.format_exception_only(t, value)
+ error.append('Error executing a python function in %s:\n' % realfile)
+
+ # Strip 'us' from the stack (better_exec call) unless that was where the
+ # error came from
+ if tb.tb_next is not None:
+ tb = tb.tb_next
+
+ textarray = text.split('\n')
+
+ linefailed = tb.tb_lineno
+
+ tbextract = traceback.extract_tb(tb)
+ tbformat = traceback.format_list(tbextract)
+ error.append("The stack trace of python calls that resulted in this exception/failure was:")
+ error.append("File: '%s', lineno: %s, function: %s" % (tbextract[0][0], tbextract[0][1], tbextract[0][2]))
+ error.extend(_print_trace(textarray, linefailed))
+
+ # See if this is a function we constructed and has calls back into other functions in
+ # "text". If so, try and improve the context of the error by diving down the trace
+ level = 0
+ nexttb = tb.tb_next
+ while nexttb is not None and (level+1) < len(tbextract):
+ error.append("File: '%s', lineno: %s, function: %s" % (tbextract[level+1][0], tbextract[level+1][1], tbextract[level+1][2]))
+ if tbextract[level][0] == tbextract[level+1][0] and tbextract[level+1][2] == tbextract[level][0]:
+ # The code was possibly in the string we compiled ourselves
+ error.extend(_print_trace(textarray, tbextract[level+1][1]))
+ elif tbextract[level+1][0].startswith("/"):
+ # The code looks like it might be in a file, try and load it
+ try:
+ with open(tbextract[level+1][0], "r") as f:
+ text = f.readlines()
+ error.extend(_print_trace(text, tbextract[level+1][1]))
+ except:
+ error.append(tbformat[level+1])
+ else:
+ error.append(tbformat[level+1])
+ nexttb = tb.tb_next
+ level = level + 1
+
+ error.append("Exception: %s" % ''.join(exception))
+
+ # If the exception is from spwaning a task, let's be helpful and display
+ # the output (which hopefully includes stderr).
+ if isinstance(value, subprocess.CalledProcessError) and value.output:
+ error.append("Subprocess output:")
+ error.append(value.output.decode("utf-8", errors="ignore"))
+ finally:
+ logger.error("\n".join(error))
+
+def better_exec(code, context, text = None, realfile = "<code>", pythonexception=False):
+ """
+ Similiar to better_compile, better_exec will
+ print the lines that are responsible for the
+ error.
+ """
+ import bb.parse
+ if not text:
+ text = code
+ if not hasattr(code, "co_filename"):
+ code = better_compile(code, realfile, realfile)
+ try:
+ exec(code, get_context(), context)
+ except (bb.BBHandledException, bb.parse.SkipRecipe, bb.build.FuncFailed, bb.data_smart.ExpansionError):
+ # Error already shown so passthrough, no need for traceback
+ raise
+ except Exception as e:
+ if pythonexception:
+ raise
+ (t, value, tb) = sys.exc_info()
+ try:
+ _print_exception(t, value, tb, realfile, text, context)
+ except Exception as e:
+ logger.error("Exception handler error: %s" % str(e))
+
+ e = bb.BBHandledException(e)
+ raise e
+
+def simple_exec(code, context):
+ exec(code, get_context(), context)
+
+def better_eval(source, locals, extraglobals = None):
+ ctx = get_context()
+ if extraglobals:
+ ctx = copy.copy(ctx)
+ for g in extraglobals:
+ ctx[g] = extraglobals[g]
+ return eval(source, ctx, locals)
+
+@contextmanager
+def fileslocked(files):
+ """Context manager for locking and unlocking file locks."""
+ locks = []
+ if files:
+ for lockfile in files:
+ locks.append(bb.utils.lockfile(lockfile))
+
+ yield
+
+ for lock in locks:
+ bb.utils.unlockfile(lock)
+
+@contextmanager
+def timeout(seconds):
+ def timeout_handler(signum, frame):
+ pass
+
+ original_handler = signal.signal(signal.SIGALRM, timeout_handler)
+
+ try:
+ signal.alarm(seconds)
+ yield
+ finally:
+ signal.alarm(0)
+ signal.signal(signal.SIGALRM, original_handler)
+
+def lockfile(name, shared=False, retry=True, block=False):
+ """
+ Use the specified file as a lock file, return when the lock has
+ been acquired. Returns a variable to pass to unlockfile().
+ Parameters:
+ retry: True to re-try locking if it fails, False otherwise
+ block: True to block until the lock succeeds, False otherwise
+ The retry and block parameters are kind of equivalent unless you
+ consider the possibility of sending a signal to the process to break
+ out - at which point you want block=True rather than retry=True.
+ """
+ dirname = os.path.dirname(name)
+ mkdirhier(dirname)
+
+ if not os.access(dirname, os.W_OK):
+ logger.error("Unable to acquire lock '%s', directory is not writable",
+ name)
+ sys.exit(1)
+
+ op = fcntl.LOCK_EX
+ if shared:
+ op = fcntl.LOCK_SH
+ if not retry and not block:
+ op = op | fcntl.LOCK_NB
+
+ while True:
+ # If we leave the lockfiles lying around there is no problem
+ # but we should clean up after ourselves. This gives potential
+ # for races though. To work around this, when we acquire the lock
+ # we check the file we locked was still the lock file on disk.
+ # by comparing inode numbers. If they don't match or the lockfile
+ # no longer exists, we start again.
+
+ # This implementation is unfair since the last person to request the
+ # lock is the most likely to win it.
+
+ try:
+ lf = open(name, 'a+')
+ fileno = lf.fileno()
+ fcntl.flock(fileno, op)
+ statinfo = os.fstat(fileno)
+ if os.path.exists(lf.name):
+ statinfo2 = os.stat(lf.name)
+ if statinfo.st_ino == statinfo2.st_ino:
+ return lf
+ lf.close()
+ except Exception:
+ try:
+ lf.close()
+ except Exception:
+ pass
+ pass
+ if not retry:
+ return None
+
+def unlockfile(lf):
+ """
+ Unlock a file locked using lockfile()
+ """
+ try:
+ # If we had a shared lock, we need to promote to exclusive before
+ # removing the lockfile. Attempt this, ignore failures.
+ fcntl.flock(lf.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB)
+ os.unlink(lf.name)
+ except (IOError, OSError):
+ pass
+ fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
+ lf.close()
+
+def md5_file(filename):
+ """
+ Return the hex string representation of the MD5 checksum of filename.
+ """
+ import hashlib
+ m = hashlib.md5()
+
+ with open(filename, "rb") as f:
+ for line in f:
+ m.update(line)
+ return m.hexdigest()
+
+def sha256_file(filename):
+ """
+ Return the hex string representation of the 256-bit SHA checksum of
+ filename.
+ """
+ import hashlib
+
+ s = hashlib.sha256()
+ with open(filename, "rb") as f:
+ for line in f:
+ s.update(line)
+ return s.hexdigest()
+
+def sha1_file(filename):
+ """
+ Return the hex string representation of the SHA1 checksum of the filename
+ """
+ import hashlib
+
+ s = hashlib.sha1()
+ with open(filename, "rb") as f:
+ for line in f:
+ s.update(line)
+ return s.hexdigest()
+
+def preserved_envvars_exported():
+ """Variables which are taken from the environment and placed in and exported
+ from the metadata"""
+ return [
+ 'BB_TASKHASH',
+ 'HOME',
+ 'LOGNAME',
+ 'PATH',
+ 'PWD',
+ 'SHELL',
+ 'TERM',
+ 'USER',
+ 'LC_ALL',
+ 'BBSERVER',
+ ]
+
+def preserved_envvars():
+ """Variables which are taken from the environment and placed in the metadata"""
+ v = [
+ 'BBPATH',
+ 'BB_PRESERVE_ENV',
+ 'BB_ENV_WHITELIST',
+ 'BB_ENV_EXTRAWHITE',
+ ]
+ return v + preserved_envvars_exported()
+
+def filter_environment(good_vars):
+ """
+ Create a pristine environment for bitbake. This will remove variables that
+ are not known and may influence the build in a negative way.
+ """
+
+ removed_vars = {}
+ for key in list(os.environ):
+ if key in good_vars:
+ continue
+
+ removed_vars[key] = os.environ[key]
+ del os.environ[key]
+
+ # If we spawn a python process, we need to have a UTF-8 locale, else python's file
+ # access methods will use ascii. You can't change that mode once the interpreter is
+ # started so we have to ensure a locale is set. Ideally we'd use C.UTF-8 but not all
+ # distros support that and we need to set something.
+ os.environ["LC_ALL"] = "en_US.UTF-8"
+
+ if removed_vars:
+ logger.debug(1, "Removed the following variables from the environment: %s", ", ".join(removed_vars.keys()))
+
+ return removed_vars
+
+def approved_variables():
+ """
+ Determine and return the list of whitelisted variables which are approved
+ to remain in the environment.
+ """
+ if 'BB_PRESERVE_ENV' in os.environ:
+ return os.environ.keys()
+ approved = []
+ if 'BB_ENV_WHITELIST' in os.environ:
+ approved = os.environ['BB_ENV_WHITELIST'].split()
+ approved.extend(['BB_ENV_WHITELIST'])
+ else:
+ approved = preserved_envvars()
+ if 'BB_ENV_EXTRAWHITE' in os.environ:
+ approved.extend(os.environ['BB_ENV_EXTRAWHITE'].split())
+ if 'BB_ENV_EXTRAWHITE' not in approved:
+ approved.extend(['BB_ENV_EXTRAWHITE'])
+ return approved
+
+def clean_environment():
+ """
+ Clean up any spurious environment variables. This will remove any
+ variables the user hasn't chosen to preserve.
+ """
+ if 'BB_PRESERVE_ENV' not in os.environ:
+ good_vars = approved_variables()
+ return filter_environment(good_vars)
+
+ return {}
+
+def empty_environment():
+ """
+ Remove all variables from the environment.
+ """
+ for s in list(os.environ.keys()):
+ os.unsetenv(s)
+ del os.environ[s]
+
+def build_environment(d):
+ """
+ Build an environment from all exported variables.
+ """
+ import bb.data
+ for var in bb.data.keys(d):
+ export = d.getVarFlag(var, "export", False)
+ if export:
+ os.environ[var] = d.getVar(var) or ""
+
+def _check_unsafe_delete_path(path):
+ """
+ Basic safeguard against recursively deleting something we shouldn't. If it returns True,
+ the caller should raise an exception with an appropriate message.
+ NOTE: This is NOT meant to be a security mechanism - just a guard against silly mistakes
+ with potentially disastrous results.
+ """
+ extra = ''
+ # HOME might not be /home/something, so in case we can get it, check against it
+ homedir = os.environ.get('HOME', '')
+ if homedir:
+ extra = '|%s' % homedir
+ if re.match('(/|//|/home|/home/[^/]*%s)$' % extra, os.path.abspath(path)):
+ return True
+ return False
+
+def remove(path, recurse=False):
+ """Equivalent to rm -f or rm -rf"""
+ if not path:
+ return
+ if recurse:
+ for name in glob.glob(path):
+ if _check_unsafe_delete_path(path):
+ raise Exception('bb.utils.remove: called with dangerous path "%s" and recurse=True, refusing to delete!' % path)
+ # shutil.rmtree(name) would be ideal but its too slow
+ subprocess.check_call(['rm', '-rf'] + glob.glob(path))
+ return
+ for name in glob.glob(path):
+ try:
+ os.unlink(name)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+
+def prunedir(topdir):
+ # Delete everything reachable from the directory named in 'topdir'.
+ # CAUTION: This is dangerous!
+ if _check_unsafe_delete_path(topdir):
+ raise Exception('bb.utils.prunedir: called with dangerous path "%s", refusing to delete!' % topdir)
+ for root, dirs, files in os.walk(topdir, topdown = False):
+ for name in files:
+ os.remove(os.path.join(root, name))
+ for name in dirs:
+ if os.path.islink(os.path.join(root, name)):
+ os.remove(os.path.join(root, name))
+ else:
+ os.rmdir(os.path.join(root, name))
+ os.rmdir(topdir)
+
+#
+# Could also use return re.compile("(%s)" % "|".join(map(re.escape, suffixes))).sub(lambda mo: "", var)
+# but thats possibly insane and suffixes is probably going to be small
+#
+def prune_suffix(var, suffixes, d):
+ # See if var ends with any of the suffixes listed and
+ # remove it if found
+ for suffix in suffixes:
+ if var.endswith(suffix):
+ return var.replace(suffix, "")
+ return var
+
+def mkdirhier(directory):
+ """Create a directory like 'mkdir -p', but does not complain if
+ directory already exists like os.makedirs
+ """
+
+ try:
+ os.makedirs(directory)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+
+def movefile(src, dest, newmtime = None, sstat = None):
+ """Moves a file from src to dest, preserving all permissions and
+ attributes; mtime will be preserved even when moving across
+ filesystems. Returns true on success and false on failure. Move is
+ atomic.
+ """
+
+ #print "movefile(" + src + "," + dest + "," + str(newmtime) + "," + str(sstat) + ")"
+ try:
+ if not sstat:
+ sstat = os.lstat(src)
+ except Exception as e:
+ print("movefile: Stating source file failed...", e)
+ return None
+
+ destexists = 1
+ try:
+ dstat = os.lstat(dest)
+ except:
+ dstat = os.lstat(os.path.dirname(dest))
+ destexists = 0
+
+ if destexists:
+ if stat.S_ISLNK(dstat[stat.ST_MODE]):
+ try:
+ os.unlink(dest)
+ destexists = 0
+ except Exception as e:
+ pass
+
+ if stat.S_ISLNK(sstat[stat.ST_MODE]):
+ try:
+ target = os.readlink(src)
+ if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
+ os.unlink(dest)
+ os.symlink(target, dest)
+ #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+ os.unlink(src)
+ return os.lstat(dest)
+ except Exception as e:
+ print("movefile: failed to properly create symlink:", dest, "->", target, e)
+ return None
+
+ renamefailed = 1
+ # os.rename needs to know the dest path ending with file name
+ # so append the file name to a path only if it's a dir specified
+ srcfname = os.path.basename(src)
+ destpath = os.path.join(dest, srcfname) if os.path.isdir(dest) \
+ else dest
+
+ if sstat[stat.ST_DEV] == dstat[stat.ST_DEV]:
+ try:
+ os.rename(src, destpath)
+ renamefailed = 0
+ except Exception as e:
+ if e[0] != errno.EXDEV:
+ # Some random error.
+ print("movefile: Failed to move", src, "to", dest, e)
+ return None
+ # Invalid cross-device-link 'bind' mounted or actually Cross-Device
+
+ if renamefailed:
+ didcopy = 0
+ if stat.S_ISREG(sstat[stat.ST_MODE]):
+ try: # For safety copy then move it over.
+ shutil.copyfile(src, destpath + "#new")
+ os.rename(destpath + "#new", destpath)
+ didcopy = 1
+ except Exception as e:
+ print('movefile: copy', src, '->', dest, 'failed.', e)
+ return None
+ else:
+ #we don't yet handle special, so we need to fall back to /bin/mv
+ a = getstatusoutput("/bin/mv -f " + "'" + src + "' '" + dest + "'")
+ if a[0] != 0:
+ print("movefile: Failed to move special file:" + src + "' to '" + dest + "'", a)
+ return None # failure
+ try:
+ if didcopy:
+ os.lchown(destpath, sstat[stat.ST_UID], sstat[stat.ST_GID])
+ os.chmod(destpath, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
+ os.unlink(src)
+ except Exception as e:
+ print("movefile: Failed to chown/chmod/unlink", dest, e)
+ return None
+
+ if newmtime:
+ os.utime(destpath, (newmtime, newmtime))
+ else:
+ os.utime(destpath, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
+ newmtime = sstat[stat.ST_MTIME]
+ return newmtime
+
+def copyfile(src, dest, newmtime = None, sstat = None):
+ """
+ Copies a file from src to dest, preserving all permissions and
+ attributes; mtime will be preserved even when moving across
+ filesystems. Returns true on success and false on failure.
+ """
+ #print "copyfile(" + src + "," + dest + "," + str(newmtime) + "," + str(sstat) + ")"
+ try:
+ if not sstat:
+ sstat = os.lstat(src)
+ except Exception as e:
+ logger.warning("copyfile: stat of %s failed (%s)" % (src, e))
+ return False
+
+ destexists = 1
+ try:
+ dstat = os.lstat(dest)
+ except:
+ dstat = os.lstat(os.path.dirname(dest))
+ destexists = 0
+
+ if destexists:
+ if stat.S_ISLNK(dstat[stat.ST_MODE]):
+ try:
+ os.unlink(dest)
+ destexists = 0
+ except Exception as e:
+ pass
+
+ if stat.S_ISLNK(sstat[stat.ST_MODE]):
+ try:
+ target = os.readlink(src)
+ if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
+ os.unlink(dest)
+ os.symlink(target, dest)
+ #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
+ return os.lstat(dest)
+ except Exception as e:
+ logger.warning("copyfile: failed to create symlink %s to %s (%s)" % (dest, target, e))
+ return False
+
+ if stat.S_ISREG(sstat[stat.ST_MODE]):
+ try:
+ srcchown = False
+ if not os.access(src, os.R_OK):
+ # Make sure we can read it
+ srcchown = True
+ os.chmod(src, sstat[stat.ST_MODE] | stat.S_IRUSR)
+
+ # For safety copy then move it over.
+ shutil.copyfile(src, dest + "#new")
+ os.rename(dest + "#new", dest)
+ except Exception as e:
+ logger.warning("copyfile: copy %s to %s failed (%s)" % (src, dest, e))
+ return False
+ finally:
+ if srcchown:
+ os.chmod(src, sstat[stat.ST_MODE])
+ os.utime(src, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
+
+ else:
+ #we don't yet handle special, so we need to fall back to /bin/mv
+ a = getstatusoutput("/bin/cp -f " + "'" + src + "' '" + dest + "'")
+ if a[0] != 0:
+ logger.warning("copyfile: failed to copy special file %s to %s (%s)" % (src, dest, a))
+ return False # failure
+ try:
+ os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
+ os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
+ except Exception as e:
+ logger.warning("copyfile: failed to chown/chmod %s (%s)" % (dest, e))
+ return False
+
+ if newmtime:
+ os.utime(dest, (newmtime, newmtime))
+ else:
+ os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME]))
+ newmtime = sstat[stat.ST_MTIME]
+ return newmtime
+
+def which(path, item, direction = 0, history = False, executable=False):
+ """
+ Locate `item` in the list of paths `path` (colon separated string like $PATH).
+ If `direction` is non-zero then the list is reversed.
+ If `history` is True then the list of candidates also returned as result,history.
+ If `executable` is True then the candidate has to be an executable file,
+ otherwise the candidate simply has to exist.
+ """
+
+ if executable:
+ is_candidate = lambda p: os.path.isfile(p) and os.access(p, os.X_OK)
+ else:
+ is_candidate = lambda p: os.path.exists(p)
+
+ hist = []
+ paths = (path or "").split(':')
+ if direction != 0:
+ paths.reverse()
+
+ for p in paths:
+ next = os.path.join(p, item)
+ hist.append(next)
+ if is_candidate(next):
+ if not os.path.isabs(next):
+ next = os.path.abspath(next)
+ if history:
+ return next, hist
+ return next
+
+ if history:
+ return "", hist
+ return ""
+
+def to_boolean(string, default=None):
+ if not string:
+ return default
+
+ normalized = string.lower()
+ if normalized in ("y", "yes", "1", "true"):
+ return True
+ elif normalized in ("n", "no", "0", "false"):
+ return False
+ else:
+ raise ValueError("Invalid value for to_boolean: %s" % string)
+
+def contains(variable, checkvalues, truevalue, falsevalue, d):
+ """Check if a variable contains all the values specified.
+
+ Arguments:
+
+ variable -- the variable name. This will be fetched and expanded (using
+ d.getVar(variable)) and then split into a set().
+
+ checkvalues -- if this is a string it is split on whitespace into a set(),
+ otherwise coerced directly into a set().
+
+ truevalue -- the value to return if checkvalues is a subset of variable.
+
+ falsevalue -- the value to return if variable is empty or if checkvalues is
+ not a subset of variable.
+
+ d -- the data store.
+ """
+
+ val = d.getVar(variable)
+ if not val:
+ return falsevalue
+ val = set(val.split())
+ if isinstance(checkvalues, str):
+ checkvalues = set(checkvalues.split())
+ else:
+ checkvalues = set(checkvalues)
+ if checkvalues.issubset(val):
+ return truevalue
+ return falsevalue
+
+def contains_any(variable, checkvalues, truevalue, falsevalue, d):
+ val = d.getVar(variable)
+ if not val:
+ return falsevalue
+ val = set(val.split())
+ if isinstance(checkvalues, str):
+ checkvalues = set(checkvalues.split())
+ else:
+ checkvalues = set(checkvalues)
+ if checkvalues & val:
+ return truevalue
+ return falsevalue
+
+def filter(variable, checkvalues, d):
+ """Return all words in the variable that are present in the checkvalues.
+
+ Arguments:
+
+ variable -- the variable name. This will be fetched and expanded (using
+ d.getVar(variable)) and then split into a set().
+
+ checkvalues -- if this is a string it is split on whitespace into a set(),
+ otherwise coerced directly into a set().
+
+ d -- the data store.
+ """
+
+ val = d.getVar(variable)
+ if not val:
+ return ''
+ val = set(val.split())
+ if isinstance(checkvalues, str):
+ checkvalues = set(checkvalues.split())
+ else:
+ checkvalues = set(checkvalues)
+ return ' '.join(sorted(checkvalues & val))
+
+def cpu_count():
+ return multiprocessing.cpu_count()
+
+def nonblockingfd(fd):
+ fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
+
+def process_profilelog(fn, pout = None):
+ # Either call with a list of filenames and set pout or a filename and optionally pout.
+ if not pout:
+ pout = fn + '.processed'
+ pout = open(pout, 'w')
+
+ import pstats
+ if isinstance(fn, list):
+ p = pstats.Stats(*fn, stream=pout)
+ else:
+ p = pstats.Stats(fn, stream=pout)
+ p.sort_stats('time')
+ p.print_stats()
+ p.print_callers()
+ p.sort_stats('cumulative')
+ p.print_stats()
+
+ pout.flush()
+ pout.close()
+
+#
+# Was present to work around multiprocessing pool bugs in python < 2.7.3
+#
+def multiprocessingpool(*args, **kwargs):
+
+ import multiprocessing.pool
+ #import multiprocessing.util
+ #multiprocessing.util.log_to_stderr(10)
+ # Deal with a multiprocessing bug where signals to the processes would be delayed until the work
+ # completes. Putting in a timeout means the signals (like SIGINT/SIGTERM) get processed.
+ def wrapper(func):
+ def wrap(self, timeout=None):
+ return func(self, timeout=timeout if timeout is not None else 1e100)
+ return wrap
+ multiprocessing.pool.IMapIterator.next = wrapper(multiprocessing.pool.IMapIterator.next)
+
+ return multiprocessing.Pool(*args, **kwargs)
+
+def exec_flat_python_func(func, *args, **kwargs):
+ """Execute a flat python function (defined with def funcname(args):...)"""
+ # Prepare a small piece of python code which calls the requested function
+ # To do this we need to prepare two things - a set of variables we can use to pass
+ # the values of arguments into the calling function, and the list of arguments for
+ # the function being called
+ context = {}
+ funcargs = []
+ # Handle unnamed arguments
+ aidx = 1
+ for arg in args:
+ argname = 'arg_%s' % aidx
+ context[argname] = arg
+ funcargs.append(argname)
+ aidx += 1
+ # Handle keyword arguments
+ context.update(kwargs)
+ funcargs.extend(['%s=%s' % (arg, arg) for arg in kwargs.keys()])
+ code = 'retval = %s(%s)' % (func, ', '.join(funcargs))
+ comp = bb.utils.better_compile(code, '<string>', '<string>')
+ bb.utils.better_exec(comp, context, code, '<string>')
+ return context['retval']
+
+def edit_metadata(meta_lines, variables, varfunc, match_overrides=False):
+ """Edit lines from a recipe or config file and modify one or more
+ specified variable values set in the file using a specified callback
+ function. Lines are expected to have trailing newlines.
+ Parameters:
+ meta_lines: lines from the file; can be a list or an iterable
+ (e.g. file pointer)
+ variables: a list of variable names to look for. Functions
+ may also be specified, but must be specified with '()' at
+ the end of the name. Note that the function doesn't have
+ any intrinsic understanding of _append, _prepend, _remove,
+ or overrides, so these are considered as part of the name.
+ These values go into a regular expression, so regular
+ expression syntax is allowed.
+ varfunc: callback function called for every variable matching
+ one of the entries in the variables parameter. The function
+ should take four arguments:
+ varname: name of variable matched
+ origvalue: current value in file
+ op: the operator (e.g. '+=')
+ newlines: list of lines up to this point. You can use
+ this to prepend lines before this variable setting
+ if you wish.
+ and should return a four-element tuple:
+ newvalue: new value to substitute in, or None to drop
+ the variable setting entirely. (If the removal
+ results in two consecutive blank lines, one of the
+ blank lines will also be dropped).
+ newop: the operator to use - if you specify None here,
+ the original operation will be used.
+ indent: number of spaces to indent multi-line entries,
+ or -1 to indent up to the level of the assignment
+ and opening quote, or a string to use as the indent.
+ minbreak: True to allow the first element of a
+ multi-line value to continue on the same line as
+ the assignment, False to indent before the first
+ element.
+ To clarify, if you wish not to change the value, then you
+ would return like this: return origvalue, None, 0, True
+ match_overrides: True to match items with _overrides on the end,
+ False otherwise
+ Returns a tuple:
+ updated:
+ True if changes were made, False otherwise.
+ newlines:
+ Lines after processing
+ """
+
+ var_res = {}
+ if match_overrides:
+ override_re = '(_[a-zA-Z0-9-_$(){}]+)?'
+ else:
+ override_re = ''
+ for var in variables:
+ if var.endswith('()'):
+ var_res[var] = re.compile('^(%s%s)[ \\t]*\([ \\t]*\)[ \\t]*{' % (var[:-2].rstrip(), override_re))
+ else:
+ var_res[var] = re.compile('^(%s%s)[ \\t]*[?+:.]*=[+.]*[ \\t]*(["\'])' % (var, override_re))
+
+ updated = False
+ varset_start = ''
+ varlines = []
+ newlines = []
+ in_var = None
+ full_value = ''
+ var_end = ''
+
+ def handle_var_end():
+ prerun_newlines = newlines[:]
+ op = varset_start[len(in_var):].strip()
+ (newvalue, newop, indent, minbreak) = varfunc(in_var, full_value, op, newlines)
+ changed = (prerun_newlines != newlines)
+
+ if newvalue is None:
+ # Drop the value
+ return True
+ elif newvalue != full_value or (newop not in [None, op]):
+ if newop not in [None, op]:
+ # Callback changed the operator
+ varset_new = "%s %s" % (in_var, newop)
+ else:
+ varset_new = varset_start
+
+ if isinstance(indent, int):
+ if indent == -1:
+ indentspc = ' ' * (len(varset_new) + 2)
+ else:
+ indentspc = ' ' * indent
+ else:
+ indentspc = indent
+ if in_var.endswith('()'):
+ # A function definition
+ if isinstance(newvalue, list):
+ newlines.append('%s {\n%s%s\n}\n' % (varset_new, indentspc, ('\n%s' % indentspc).join(newvalue)))
+ else:
+ if not newvalue.startswith('\n'):
+ newvalue = '\n' + newvalue
+ if not newvalue.endswith('\n'):
+ newvalue = newvalue + '\n'
+ newlines.append('%s {%s}\n' % (varset_new, newvalue))
+ else:
+ # Normal variable
+ if isinstance(newvalue, list):
+ if not newvalue:
+ # Empty list -> empty string
+ newlines.append('%s ""\n' % varset_new)
+ elif minbreak:
+ # First item on first line
+ if len(newvalue) == 1:
+ newlines.append('%s "%s"\n' % (varset_new, newvalue[0]))
+ else:
+ newlines.append('%s "%s \\\n' % (varset_new, newvalue[0]))
+ for item in newvalue[1:]:
+ newlines.append('%s%s \\\n' % (indentspc, item))
+ newlines.append('%s"\n' % indentspc)
+ else:
+ # No item on first line
+ newlines.append('%s " \\\n' % varset_new)
+ for item in newvalue:
+ newlines.append('%s%s \\\n' % (indentspc, item))
+ newlines.append('%s"\n' % indentspc)
+ else:
+ newlines.append('%s "%s"\n' % (varset_new, newvalue))
+ return True
+ else:
+ # Put the old lines back where they were
+ newlines.extend(varlines)
+ # If newlines was touched by the function, we'll need to return True
+ return changed
+
+ checkspc = False
+
+ for line in meta_lines:
+ if in_var:
+ value = line.rstrip()
+ varlines.append(line)
+ if in_var.endswith('()'):
+ full_value += '\n' + value
+ else:
+ full_value += value[:-1]
+ if value.endswith(var_end):
+ if in_var.endswith('()'):
+ if full_value.count('{') - full_value.count('}') >= 0:
+ continue
+ full_value = full_value[:-1]
+ if handle_var_end():
+ updated = True
+ checkspc = True
+ in_var = None
+ else:
+ skip = False
+ for (varname, var_re) in var_res.items():
+ res = var_re.match(line)
+ if res:
+ isfunc = varname.endswith('()')
+ if isfunc:
+ splitvalue = line.split('{', 1)
+ var_end = '}'
+ else:
+ var_end = res.groups()[-1]
+ splitvalue = line.split(var_end, 1)
+ varset_start = splitvalue[0].rstrip()
+ value = splitvalue[1].rstrip()
+ if not isfunc and value.endswith('\\'):
+ value = value[:-1]
+ full_value = value
+ varlines = [line]
+ in_var = res.group(1)
+ if isfunc:
+ in_var += '()'
+ if value.endswith(var_end):
+ full_value = full_value[:-1]
+ if handle_var_end():
+ updated = True
+ checkspc = True
+ in_var = None
+ skip = True
+ break
+ if not skip:
+ if checkspc:
+ checkspc = False
+ if newlines and newlines[-1] == '\n' and line == '\n':
+ # Squash blank line if there are two consecutive blanks after a removal
+ continue
+ newlines.append(line)
+ return (updated, newlines)
+
+
+def edit_metadata_file(meta_file, variables, varfunc):
+ """Edit a recipe or config file and modify one or more specified
+ variable values set in the file using a specified callback function.
+ The file is only written to if the value(s) actually change.
+ This is basically the file version of edit_metadata(), see that
+ function's description for parameter/usage information.
+ Returns True if the file was written to, False otherwise.
+ """
+ with open(meta_file, 'r') as f:
+ (updated, newlines) = edit_metadata(f, variables, varfunc)
+ if updated:
+ with open(meta_file, 'w') as f:
+ f.writelines(newlines)
+ return updated
+
+
+def edit_bblayers_conf(bblayers_conf, add, remove):
+ """Edit bblayers.conf, adding and/or removing layers
+ Parameters:
+ bblayers_conf: path to bblayers.conf file to edit
+ add: layer path (or list of layer paths) to add; None or empty
+ list to add nothing
+ remove: layer path (or list of layer paths) to remove; None or
+ empty list to remove nothing
+ Returns a tuple:
+ notadded: list of layers specified to be added but weren't
+ (because they were already in the list)
+ notremoved: list of layers that were specified to be removed
+ but weren't (because they weren't in the list)
+ """
+
+ import fnmatch
+
+ def remove_trailing_sep(pth):
+ if pth and pth[-1] == os.sep:
+ pth = pth[:-1]
+ return pth
+
+ approved = bb.utils.approved_variables()
+ def canonicalise_path(pth):
+ pth = remove_trailing_sep(pth)
+ if 'HOME' in approved and '~' in pth:
+ pth = os.path.expanduser(pth)
+ return pth
+
+ def layerlist_param(value):
+ if not value:
+ return []
+ elif isinstance(value, list):
+ return [remove_trailing_sep(x) for x in value]
+ else:
+ return [remove_trailing_sep(value)]
+
+ addlayers = layerlist_param(add)
+ removelayers = layerlist_param(remove)
+
+ # Need to use a list here because we can't set non-local variables from a callback in python 2.x
+ bblayercalls = []
+ removed = []
+ plusequals = False
+ orig_bblayers = []
+
+ def handle_bblayers_firstpass(varname, origvalue, op, newlines):
+ bblayercalls.append(op)
+ if op == '=':
+ del orig_bblayers[:]
+ orig_bblayers.extend([canonicalise_path(x) for x in origvalue.split()])
+ return (origvalue, None, 2, False)
+
+ def handle_bblayers(varname, origvalue, op, newlines):
+ updated = False
+ bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
+ if removelayers:
+ for removelayer in removelayers:
+ for layer in bblayers:
+ if fnmatch.fnmatch(canonicalise_path(layer), canonicalise_path(removelayer)):
+ updated = True
+ bblayers.remove(layer)
+ removed.append(removelayer)
+ break
+ if addlayers and not plusequals:
+ for addlayer in addlayers:
+ if addlayer not in bblayers:
+ updated = True
+ bblayers.append(addlayer)
+ del addlayers[:]
+
+ if updated:
+ if op == '+=' and not bblayers:
+ bblayers = None
+ return (bblayers, None, 2, False)
+ else:
+ return (origvalue, None, 2, False)
+
+ with open(bblayers_conf, 'r') as f:
+ (_, newlines) = edit_metadata(f, ['BBLAYERS'], handle_bblayers_firstpass)
+
+ if not bblayercalls:
+ raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf)
+
+ # Try to do the "smart" thing depending on how the user has laid out
+ # their bblayers.conf file
+ if bblayercalls.count('+=') > 1:
+ plusequals = True
+
+ removelayers_canon = [canonicalise_path(layer) for layer in removelayers]
+ notadded = []
+ for layer in addlayers:
+ layer_canon = canonicalise_path(layer)
+ if layer_canon in orig_bblayers and not layer_canon in removelayers_canon:
+ notadded.append(layer)
+ notadded_canon = [canonicalise_path(layer) for layer in notadded]
+ addlayers[:] = [layer for layer in addlayers if canonicalise_path(layer) not in notadded_canon]
+
+ (updated, newlines) = edit_metadata(newlines, ['BBLAYERS'], handle_bblayers)
+ if addlayers:
+ # Still need to add these
+ for addlayer in addlayers:
+ newlines.append('BBLAYERS += "%s"\n' % addlayer)
+ updated = True
+
+ if updated:
+ with open(bblayers_conf, 'w') as f:
+ f.writelines(newlines)
+
+ notremoved = list(set(removelayers) - set(removed))
+
+ return (notadded, notremoved)
+
+
+def get_file_layer(filename, d):
+ """Determine the collection (as defined by a layer's layer.conf file) containing the specified file"""
+ collections = (d.getVar('BBFILE_COLLECTIONS') or '').split()
+ collection_res = {}
+ for collection in collections:
+ collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or ''
+
+ def path_to_layer(path):
+ # Use longest path so we handle nested layers
+ matchlen = 0
+ match = None
+ for collection, regex in collection_res.items():
+ if len(regex) > matchlen and re.match(regex, path):
+ matchlen = len(regex)
+ match = collection
+ return match
+
+ result = None
+ bbfiles = (d.getVar('BBFILES') or '').split()
+ bbfilesmatch = False
+ for bbfilesentry in bbfiles:
+ if fnmatch.fnmatch(filename, bbfilesentry):
+ bbfilesmatch = True
+ result = path_to_layer(bbfilesentry)
+
+ if not bbfilesmatch:
+ # Probably a bbclass
+ result = path_to_layer(filename)
+
+ return result
+
+
+# Constant taken from http://linux.die.net/include/linux/prctl.h
+PR_SET_PDEATHSIG = 1
+
+class PrCtlError(Exception):
+ pass
+
+def signal_on_parent_exit(signame):
+ """
+ Trigger signame to be sent when the parent process dies
+ """
+ signum = getattr(signal, signame)
+ # http://linux.die.net/man/2/prctl
+ result = cdll['libc.so.6'].prctl(PR_SET_PDEATHSIG, signum)
+ if result != 0:
+ raise PrCtlError('prctl failed with error code %s' % result)
+
+#
+# Manually call the ioprio syscall. We could depend on other libs like psutil
+# however this gets us enough of what we need to bitbake for now without the
+# dependency
+#
+_unamearch = os.uname()[4]
+IOPRIO_WHO_PROCESS = 1
+IOPRIO_CLASS_SHIFT = 13
+
+def ioprio_set(who, cls, value):
+ NR_ioprio_set = None
+ if _unamearch == "x86_64":
+ NR_ioprio_set = 251
+ elif _unamearch[0] == "i" and _unamearch[2:3] == "86":
+ NR_ioprio_set = 289
+
+ if NR_ioprio_set:
+ ioprio = value | (cls << IOPRIO_CLASS_SHIFT)
+ rc = cdll['libc.so.6'].syscall(NR_ioprio_set, IOPRIO_WHO_PROCESS, who, ioprio)
+ if rc != 0:
+ raise ValueError("Unable to set ioprio, syscall returned %s" % rc)
+ else:
+ bb.warn("Unable to set IO Prio for arch %s" % _unamearch)
+
+def set_process_name(name):
+ from ctypes import cdll, byref, create_string_buffer
+ # This is nice to have for debugging, not essential
+ try:
+ libc = cdll.LoadLibrary('libc.so.6')
+ buf = create_string_buffer(bytes(name, 'utf-8'))
+ libc.prctl(15, byref(buf), 0, 0, 0)
+ except:
+ pass
+
+# export common proxies variables from datastore to environment
+def export_proxies(d):
+ import os
+
+ variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY',
+ 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY',
+ 'GIT_PROXY_COMMAND']
+ exported = False
+
+ for v in variables:
+ if v in os.environ.keys():
+ exported = True
+ else:
+ v_proxy = d.getVar(v)
+ if v_proxy is not None:
+ os.environ[v] = v_proxy
+ exported = True
+
+ return exported
+
+
+def load_plugins(logger, plugins, pluginpath):
+ def load_plugin(name):
+ logger.debug(1, 'Loading plugin %s' % name)
+ fp, pathname, description = imp.find_module(name, [pluginpath])
+ try:
+ return imp.load_module(name, fp, pathname, description)
+ finally:
+ if fp:
+ fp.close()
+
+ logger.debug(1, 'Loading plugins from %s...' % pluginpath)
+
+ expanded = (glob.glob(os.path.join(pluginpath, '*' + ext))
+ for ext in python_extensions)
+ files = itertools.chain.from_iterable(expanded)
+ names = set(os.path.splitext(os.path.basename(fn))[0] for fn in files)
+ for name in names:
+ if name != '__init__':
+ plugin = load_plugin(name)
+ if hasattr(plugin, 'plugin_init'):
+ obj = plugin.plugin_init(plugins)
+ plugins.append(obj or plugin)
+ else:
+ plugins.append(plugin)
+
+
+class LogCatcher(logging.Handler):
+ """Logging handler for collecting logged messages so you can check them later"""
+ def __init__(self):
+ self.messages = []
+ logging.Handler.__init__(self, logging.WARNING)
+ def emit(self, record):
+ self.messages.append(bb.build.logformatter.format(record))
+ def contains(self, message):
+ return (message in self.messages)
diff --git a/poky/bitbake/lib/bblayers/__init__.py b/poky/bitbake/lib/bblayers/__init__.py
new file mode 100644
index 000000000..3ad9513f4
--- /dev/null
+++ b/poky/bitbake/lib/bblayers/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/poky/bitbake/lib/bblayers/action.py b/poky/bitbake/lib/bblayers/action.py
new file mode 100644
index 000000000..aa575d1c0
--- /dev/null
+++ b/poky/bitbake/lib/bblayers/action.py
@@ -0,0 +1,256 @@
+import fnmatch
+import logging
+import os
+import shutil
+import sys
+import tempfile
+
+import bb.utils
+
+from bblayers.common import LayerPlugin
+
+logger = logging.getLogger('bitbake-layers')
+
+
+def plugin_init(plugins):
+ return ActionPlugin()
+
+
+class ActionPlugin(LayerPlugin):
+ def do_add_layer(self, args):
+ """Add one or more layers to bblayers.conf."""
+ layerdirs = [os.path.abspath(ldir) for ldir in args.layerdir]
+
+ for layerdir in layerdirs:
+ if not os.path.exists(layerdir):
+ sys.stderr.write("Specified layer directory %s doesn't exist\n" % layerdir)
+ return 1
+
+ layer_conf = os.path.join(layerdir, 'conf', 'layer.conf')
+ if not os.path.exists(layer_conf):
+ sys.stderr.write("Specified layer directory %s doesn't contain a conf/layer.conf file\n" % layerdir)
+ return 1
+
+ bblayers_conf = os.path.join('conf', 'bblayers.conf')
+ if not os.path.exists(bblayers_conf):
+ sys.stderr.write("Unable to find bblayers.conf\n")
+ return 1
+
+ # Back up bblayers.conf to tempdir before we add layers
+ tempdir = tempfile.mkdtemp()
+ backup = tempdir + "/bblayers.conf.bak"
+ shutil.copy2(bblayers_conf, backup)
+
+ try:
+ notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf, layerdirs, None)
+ if not (args.force or notadded):
+ try:
+ self.tinfoil.parseRecipes()
+ except bb.tinfoil.TinfoilUIException:
+ # Restore the back up copy of bblayers.conf
+ shutil.copy2(backup, bblayers_conf)
+ bb.fatal("Parse failure with the specified layer added")
+ else:
+ for item in notadded:
+ sys.stderr.write("Specified layer %s is already in BBLAYERS\n" % item)
+ finally:
+ # Remove the back up copy of bblayers.conf
+ shutil.rmtree(tempdir)
+
+ def do_remove_layer(self, args):
+ """Remove one or more layers from bblayers.conf."""
+ bblayers_conf = os.path.join('conf', 'bblayers.conf')
+ if not os.path.exists(bblayers_conf):
+ sys.stderr.write("Unable to find bblayers.conf\n")
+ return 1
+
+ layerdirs = []
+ for item in args.layerdir:
+ if item.startswith('*'):
+ layerdir = item
+ elif not '/' in item:
+ layerdir = '*/%s' % item
+ else:
+ layerdir = os.path.abspath(item)
+ layerdirs.append(layerdir)
+ (_, notremoved) = bb.utils.edit_bblayers_conf(bblayers_conf, None, layerdirs)
+ if notremoved:
+ for item in notremoved:
+ sys.stderr.write("No layers matching %s found in BBLAYERS\n" % item)
+ return 1
+
+ def do_flatten(self, args):
+ """flatten layer configuration into a separate output directory.
+
+Takes the specified layers (or all layers in the current layer
+configuration if none are specified) and builds a "flattened" directory
+containing the contents of all layers, with any overlayed recipes removed
+and bbappends appended to the corresponding recipes. Note that some manual
+cleanup may still be necessary afterwards, in particular:
+
+* where non-recipe files (such as patches) are overwritten (the flatten
+ command will show a warning for these)
+* where anything beyond the normal layer setup has been added to
+ layer.conf (only the lowest priority number layer's layer.conf is used)
+* overridden/appended items from bbappends will need to be tidied up
+* when the flattened layers do not have the same directory structure (the
+ flatten command should show a warning when this will cause a problem)
+
+Warning: if you flatten several layers where another layer is intended to
+be used "inbetween" them (in layer priority order) such that recipes /
+bbappends in the layers interact, and then attempt to use the new output
+layer together with that other layer, you may no longer get the same
+build results (as the layer priority order has effectively changed).
+"""
+ if len(args.layer) == 1:
+ logger.error('If you specify layers to flatten you must specify at least two')
+ return 1
+
+ outputdir = args.outputdir
+ if os.path.exists(outputdir) and os.listdir(outputdir):
+ logger.error('Directory %s exists and is non-empty, please clear it out first' % outputdir)
+ return 1
+
+ layers = self.bblayers
+ if len(args.layer) > 2:
+ layernames = args.layer
+ found_layernames = []
+ found_layerdirs = []
+ for layerdir in layers:
+ layername = self.get_layer_name(layerdir)
+ if layername in layernames:
+ found_layerdirs.append(layerdir)
+ found_layernames.append(layername)
+
+ for layername in layernames:
+ if not layername in found_layernames:
+ logger.error('Unable to find layer %s in current configuration, please run "%s show-layers" to list configured layers' % (layername, os.path.basename(sys.argv[0])))
+ return
+ layers = found_layerdirs
+ else:
+ layernames = []
+
+ # Ensure a specified path matches our list of layers
+ def layer_path_match(path):
+ for layerdir in layers:
+ if path.startswith(os.path.join(layerdir, '')):
+ return layerdir
+ return None
+
+ applied_appends = []
+ for layer in layers:
+ overlayed = []
+ for f in self.tinfoil.cooker.collection.overlayed.keys():
+ for of in self.tinfoil.cooker.collection.overlayed[f]:
+ if of.startswith(layer):
+ overlayed.append(of)
+
+ logger.plain('Copying files from %s...' % layer )
+ for root, dirs, files in os.walk(layer):
+ if '.git' in dirs:
+ dirs.remove('.git')
+ if '.hg' in dirs:
+ dirs.remove('.hg')
+
+ for f1 in files:
+ f1full = os.sep.join([root, f1])
+ if f1full in overlayed:
+ logger.plain(' Skipping overlayed file %s' % f1full )
+ else:
+ ext = os.path.splitext(f1)[1]
+ if ext != '.bbappend':
+ fdest = f1full[len(layer):]
+ fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
+ bb.utils.mkdirhier(os.path.dirname(fdest))
+ if os.path.exists(fdest):
+ if f1 == 'layer.conf' and root.endswith('/conf'):
+ logger.plain(' Skipping layer config file %s' % f1full )
+ continue
+ else:
+ logger.warning('Overwriting file %s', fdest)
+ bb.utils.copyfile(f1full, fdest)
+ if ext == '.bb':
+ for append in self.tinfoil.cooker.collection.get_file_appends(f1full):
+ if layer_path_match(append):
+ logger.plain(' Applying append %s to %s' % (append, fdest))
+ self.apply_append(append, fdest)
+ applied_appends.append(append)
+
+ # Take care of when some layers are excluded and yet we have included bbappends for those recipes
+ for b in self.tinfoil.cooker.collection.bbappends:
+ (recipename, appendname) = b
+ if appendname not in applied_appends:
+ first_append = None
+ layer = layer_path_match(appendname)
+ if layer:
+ if first_append:
+ self.apply_append(appendname, first_append)
+ else:
+ fdest = appendname[len(layer):]
+ fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
+ bb.utils.mkdirhier(os.path.dirname(fdest))
+ bb.utils.copyfile(appendname, fdest)
+ first_append = fdest
+
+ # Get the regex for the first layer in our list (which is where the conf/layer.conf file will
+ # have come from)
+ first_regex = None
+ layerdir = layers[0]
+ for layername, pattern, regex, _ in self.tinfoil.cooker.bbfile_config_priorities:
+ if regex.match(os.path.join(layerdir, 'test')):
+ first_regex = regex
+ break
+
+ if first_regex:
+ # Find the BBFILES entries that match (which will have come from this conf/layer.conf file)
+ bbfiles = str(self.tinfoil.config_data.getVar('BBFILES')).split()
+ bbfiles_layer = []
+ for item in bbfiles:
+ if first_regex.match(item):
+ newpath = os.path.join(outputdir, item[len(layerdir)+1:])
+ bbfiles_layer.append(newpath)
+
+ if bbfiles_layer:
+ # Check that all important layer files match BBFILES
+ for root, dirs, files in os.walk(outputdir):
+ for f1 in files:
+ ext = os.path.splitext(f1)[1]
+ if ext in ['.bb', '.bbappend']:
+ f1full = os.sep.join([root, f1])
+ entry_found = False
+ for item in bbfiles_layer:
+ if fnmatch.fnmatch(f1full, item):
+ entry_found = True
+ break
+ if not entry_found:
+ logger.warning("File %s does not match the flattened layer's BBFILES setting, you may need to edit conf/layer.conf or move the file elsewhere" % f1full)
+
+ def get_file_layer(self, filename):
+ layerdir = self.get_file_layerdir(filename)
+ if layerdir:
+ return self.get_layer_name(layerdir)
+ else:
+ return '?'
+
+ def get_file_layerdir(self, filename):
+ layer = bb.utils.get_file_layer(filename, self.tinfoil.config_data)
+ return self.bbfile_collections.get(layer, None)
+
+ def apply_append(self, appendname, recipename):
+ with open(appendname, 'r') as appendfile:
+ with open(recipename, 'a') as recipefile:
+ recipefile.write('\n')
+ recipefile.write('##### bbappended from %s #####\n' % self.get_file_layer(appendname))
+ recipefile.writelines(appendfile.readlines())
+
+ def register_commands(self, sp):
+ parser_add_layer = self.add_command(sp, 'add-layer', self.do_add_layer, parserecipes=False)
+ parser_add_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to add')
+
+ parser_remove_layer = self.add_command(sp, 'remove-layer', self.do_remove_layer, parserecipes=False)
+ parser_remove_layer.add_argument('layerdir', nargs='+', help='Layer directory/directories to remove (wildcards allowed, enclose in quotes to avoid shell expansion)')
+ parser_remove_layer.set_defaults(func=self.do_remove_layer)
+
+ parser_flatten = self.add_command(sp, 'flatten', self.do_flatten)
+ parser_flatten.add_argument('layer', nargs='*', help='Optional layer(s) to flatten (otherwise all are flattened)')
+ parser_flatten.add_argument('outputdir', help='Output directory')
diff --git a/poky/bitbake/lib/bblayers/common.py b/poky/bitbake/lib/bblayers/common.py
new file mode 100644
index 000000000..98515ced4
--- /dev/null
+++ b/poky/bitbake/lib/bblayers/common.py
@@ -0,0 +1,33 @@
+import argparse
+import logging
+import os
+
+logger = logging.getLogger('bitbake-layers')
+
+
+class LayerPlugin():
+ def __init__(self):
+ self.tinfoil = None
+ self.bblayers = []
+
+ def tinfoil_init(self, tinfoil):
+ self.tinfoil = tinfoil
+ self.bblayers = (self.tinfoil.config_data.getVar('BBLAYERS') or "").split()
+ layerconfs = self.tinfoil.config_data.varhistory.get_variable_items_files('BBFILE_COLLECTIONS', self.tinfoil.config_data)
+ self.bbfile_collections = {layer: os.path.dirname(os.path.dirname(path)) for layer, path in layerconfs.items()}
+
+ @staticmethod
+ def add_command(subparsers, cmdname, function, parserecipes=True, *args, **kwargs):
+ """Convert docstring for function to help."""
+ docsplit = function.__doc__.splitlines()
+ help = docsplit[0]
+ if len(docsplit) > 1:
+ desc = '\n'.join(docsplit[1:])
+ else:
+ desc = help
+ subparser = subparsers.add_parser(cmdname, *args, help=help, description=desc, formatter_class=argparse.RawTextHelpFormatter, **kwargs)
+ subparser.set_defaults(func=function, parserecipes=parserecipes)
+ return subparser
+
+ def get_layer_name(self, layerdir):
+ return os.path.basename(layerdir.rstrip(os.sep))
diff --git a/poky/bitbake/lib/bblayers/layerindex.py b/poky/bitbake/lib/bblayers/layerindex.py
new file mode 100644
index 000000000..9af385db5
--- /dev/null
+++ b/poky/bitbake/lib/bblayers/layerindex.py
@@ -0,0 +1,271 @@
+import argparse
+import http.client
+import json
+import logging
+import os
+import subprocess
+import urllib.parse
+
+from bblayers.action import ActionPlugin
+
+logger = logging.getLogger('bitbake-layers')
+
+
+def plugin_init(plugins):
+ return LayerIndexPlugin()
+
+
+class LayerIndexPlugin(ActionPlugin):
+ """Subcommands for interacting with the layer index.
+
+ This class inherits ActionPlugin to get do_add_layer.
+ """
+
+ def get_json_data(self, apiurl):
+ proxy_settings = os.environ.get("http_proxy", None)
+ conn = None
+ _parsedurl = urllib.parse.urlparse(apiurl)
+ path = _parsedurl.path
+ query = _parsedurl.query
+
+ def parse_url(url):
+ parsedurl = urllib.parse.urlparse(url)
+ if parsedurl.netloc[0] == '[':
+ host, port = parsedurl.netloc[1:].split(']', 1)
+ if ':' in port:
+ port = port.rsplit(':', 1)[1]
+ else:
+ port = None
+ else:
+ if parsedurl.netloc.count(':') == 1:
+ (host, port) = parsedurl.netloc.split(":")
+ else:
+ host = parsedurl.netloc
+ port = None
+ return (host, 80 if port is None else int(port))
+
+ if proxy_settings is None:
+ host, port = parse_url(apiurl)
+ conn = http.client.HTTPConnection(host, port)
+ conn.request("GET", path + "?" + query)
+ else:
+ host, port = parse_url(proxy_settings)
+ conn = http.client.HTTPConnection(host, port)
+ conn.request("GET", apiurl)
+
+ r = conn.getresponse()
+ if r.status != 200:
+ raise Exception("Failed to read " + path + ": %d %s" % (r.status, r.reason))
+ return json.loads(r.read().decode())
+
+ def get_layer_deps(self, layername, layeritems, layerbranches, layerdependencies, branchnum, selfname=False):
+ def layeritems_info_id(items_name, layeritems):
+ litems_id = None
+ for li in layeritems:
+ if li['name'] == items_name:
+ litems_id = li['id']
+ break
+ return litems_id
+
+ def layerbranches_info(items_id, layerbranches):
+ lbranch = {}
+ for lb in layerbranches:
+ if lb['layer'] == items_id and lb['branch'] == branchnum:
+ lbranch['id'] = lb['id']
+ lbranch['vcs_subdir'] = lb['vcs_subdir']
+ break
+ return lbranch
+
+ def layerdependencies_info(lb_id, layerdependencies):
+ ld_deps = []
+ for ld in layerdependencies:
+ if ld['layerbranch'] == lb_id and not ld['dependency'] in ld_deps:
+ ld_deps.append(ld['dependency'])
+ if not ld_deps:
+ logger.error("The dependency of layerDependencies is not found.")
+ return ld_deps
+
+ def layeritems_info_name_subdir(items_id, layeritems):
+ litems = {}
+ for li in layeritems:
+ if li['id'] == items_id:
+ litems['vcs_url'] = li['vcs_url']
+ litems['name'] = li['name']
+ break
+ return litems
+
+ if selfname:
+ selfid = layeritems_info_id(layername, layeritems)
+ lbinfo = layerbranches_info(selfid, layerbranches)
+ if lbinfo:
+ selfsubdir = lbinfo['vcs_subdir']
+ else:
+ logger.error("%s is not found in the specified branch" % layername)
+ return
+ selfurl = layeritems_info_name_subdir(selfid, layeritems)['vcs_url']
+ if selfurl:
+ return selfurl, selfsubdir
+ else:
+ logger.error("Cannot get layer %s git repo and subdir" % layername)
+ return
+ ldict = {}
+ itemsid = layeritems_info_id(layername, layeritems)
+ if not itemsid:
+ return layername, None
+ lbid = layerbranches_info(itemsid, layerbranches)
+ if lbid:
+ lbid = layerbranches_info(itemsid, layerbranches)['id']
+ else:
+ logger.error("%s is not found in the specified branch" % layername)
+ return None, None
+ for dependency in layerdependencies_info(lbid, layerdependencies):
+ lname = layeritems_info_name_subdir(dependency, layeritems)['name']
+ lurl = layeritems_info_name_subdir(dependency, layeritems)['vcs_url']
+ lsubdir = layerbranches_info(dependency, layerbranches)['vcs_subdir']
+ ldict[lname] = lurl, lsubdir
+ return None, ldict
+
+ def get_fetch_layer(self, fetchdir, url, subdir, fetch_layer):
+ layername = self.get_layer_name(url)
+ if os.path.splitext(layername)[1] == '.git':
+ layername = os.path.splitext(layername)[0]
+ repodir = os.path.join(fetchdir, layername)
+ layerdir = os.path.join(repodir, subdir)
+ if not os.path.exists(repodir):
+ if fetch_layer:
+ result = subprocess.call('git clone %s %s' % (url, repodir), shell = True)
+ if result:
+ logger.error("Failed to download %s" % url)
+ return None, None
+ else:
+ return layername, layerdir
+ else:
+ logger.plain("Repository %s needs to be fetched" % url)
+ return layername, layerdir
+ elif os.path.exists(layerdir):
+ return layername, layerdir
+ else:
+ logger.error("%s is not in %s" % (url, subdir))
+ return None, None
+
+ def do_layerindex_fetch(self, args):
+ """Fetches a layer from a layer index along with its dependent layers, and adds them to conf/bblayers.conf.
+"""
+ apiurl = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_URL')
+ if not apiurl:
+ logger.error("Cannot get BBLAYERS_LAYERINDEX_URL")
+ return 1
+ else:
+ if apiurl[-1] != '/':
+ apiurl += '/'
+ apiurl += "api/"
+ apilinks = self.get_json_data(apiurl)
+ branches = self.get_json_data(apilinks['branches'])
+
+ branchnum = 0
+ for branch in branches:
+ if branch['name'] == args.branch:
+ branchnum = branch['id']
+ break
+ if branchnum == 0:
+ validbranches = ', '.join([branch['name'] for branch in branches])
+ logger.error('Invalid layer branch name "%s". Valid branches: %s' % (args.branch, validbranches))
+ return 1
+
+ ignore_layers = []
+ for collection in self.tinfoil.config_data.getVar('BBFILE_COLLECTIONS').split():
+ lname = self.tinfoil.config_data.getVar('BBLAYERS_LAYERINDEX_NAME_%s' % collection)
+ if lname:
+ ignore_layers.append(lname)
+
+ if args.ignore:
+ ignore_layers.extend(args.ignore.split(','))
+
+ layeritems = self.get_json_data(apilinks['layerItems'])
+ layerbranches = self.get_json_data(apilinks['layerBranches'])
+ layerdependencies = self.get_json_data(apilinks['layerDependencies'])
+ invaluenames = []
+ repourls = {}
+ printlayers = []
+
+ def query_dependencies(layers, layeritems, layerbranches, layerdependencies, branchnum):
+ depslayer = []
+ for layername in layers:
+ invaluename, layerdict = self.get_layer_deps(layername, layeritems, layerbranches, layerdependencies, branchnum)
+ if layerdict:
+ repourls[layername] = self.get_layer_deps(layername, layeritems, layerbranches, layerdependencies, branchnum, selfname=True)
+ for layer in layerdict:
+ if not layer in ignore_layers:
+ depslayer.append(layer)
+ printlayers.append((layername, layer, layerdict[layer][0], layerdict[layer][1]))
+ if not layer in ignore_layers and not layer in repourls:
+ repourls[layer] = (layerdict[layer][0], layerdict[layer][1])
+ if invaluename and not invaluename in invaluenames:
+ invaluenames.append(invaluename)
+ return depslayer
+
+ depslayers = query_dependencies(args.layername, layeritems, layerbranches, layerdependencies, branchnum)
+ while depslayers:
+ depslayer = query_dependencies(depslayers, layeritems, layerbranches, layerdependencies, branchnum)
+ depslayers = depslayer
+ if invaluenames:
+ for invaluename in invaluenames:
+ logger.error('Layer "%s" not found in layer index' % invaluename)
+ return 1
+ logger.plain("%s %s %s %s" % ("Layer".ljust(19), "Required by".ljust(19), "Git repository".ljust(54), "Subdirectory"))
+ logger.plain('=' * 115)
+ for layername in args.layername:
+ layerurl = repourls[layername]
+ logger.plain("%s %s %s %s" % (layername.ljust(20), '-'.ljust(20), layerurl[0].ljust(55), layerurl[1]))
+ printedlayers = []
+ for layer, dependency, gitrepo, subdirectory in printlayers:
+ if dependency in printedlayers:
+ continue
+ logger.plain("%s %s %s %s" % (dependency.ljust(20), layer.ljust(20), gitrepo.ljust(55), subdirectory))
+ printedlayers.append(dependency)
+
+ if repourls:
+ fetchdir = self.tinfoil.config_data.getVar('BBLAYERS_FETCH_DIR')
+ if not fetchdir:
+ logger.error("Cannot get BBLAYERS_FETCH_DIR")
+ return 1
+ if not os.path.exists(fetchdir):
+ os.makedirs(fetchdir)
+ addlayers = []
+ for repourl, subdir in repourls.values():
+ name, layerdir = self.get_fetch_layer(fetchdir, repourl, subdir, not args.show_only)
+ if not name:
+ # Error already shown
+ return 1
+ addlayers.append((subdir, name, layerdir))
+ if not args.show_only:
+ for subdir, name, layerdir in set(addlayers):
+ if os.path.exists(layerdir):
+ if subdir:
+ logger.plain("Adding layer \"%s\" to conf/bblayers.conf" % subdir)
+ else:
+ logger.plain("Adding layer \"%s\" to conf/bblayers.conf" % name)
+ localargs = argparse.Namespace()
+ localargs.layerdir = layerdir
+ localargs.force = args.force
+ self.do_add_layer(localargs)
+ else:
+ break
+
+ def do_layerindex_show_depends(self, args):
+ """Find layer dependencies from layer index.
+"""
+ args.show_only = True
+ args.ignore = []
+ self.do_layerindex_fetch(args)
+
+ def register_commands(self, sp):
+ parser_layerindex_fetch = self.add_command(sp, 'layerindex-fetch', self.do_layerindex_fetch)
+ parser_layerindex_fetch.add_argument('-n', '--show-only', help='show dependencies and do nothing else', action='store_true')
+ parser_layerindex_fetch.add_argument('-b', '--branch', help='branch name to fetch (default %(default)s)', default='master')
+ parser_layerindex_fetch.add_argument('-i', '--ignore', help='assume the specified layers do not need to be fetched/added (separate multiple layers with commas, no spaces)', metavar='LAYER')
+ parser_layerindex_fetch.add_argument('layername', nargs='+', help='layer to fetch')
+
+ parser_layerindex_show_depends = self.add_command(sp, 'layerindex-show-depends', self.do_layerindex_show_depends)
+ parser_layerindex_show_depends.add_argument('-b', '--branch', help='branch name to fetch (default %(default)s)', default='master')
+ parser_layerindex_show_depends.add_argument('layername', nargs='+', help='layer to query')
diff --git a/poky/bitbake/lib/bblayers/query.py b/poky/bitbake/lib/bblayers/query.py
new file mode 100644
index 000000000..9294dfa88
--- /dev/null
+++ b/poky/bitbake/lib/bblayers/query.py
@@ -0,0 +1,501 @@
+import collections
+import fnmatch
+import logging
+import sys
+import os
+import re
+
+import bb.utils
+
+from bblayers.common import LayerPlugin
+
+logger = logging.getLogger('bitbake-layers')
+
+
+def plugin_init(plugins):
+ return QueryPlugin()
+
+
+class QueryPlugin(LayerPlugin):
+ def do_show_layers(self, args):
+ """show current configured layers."""
+ logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
+ logger.plain('=' * 74)
+ for layer, _, regex, pri in self.tinfoil.cooker.bbfile_config_priorities:
+ layerdir = self.bbfile_collections.get(layer, None)
+ layername = self.get_layer_name(layerdir)
+ logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), pri))
+
+ def version_str(self, pe, pv, pr = None):
+ verstr = "%s" % pv
+ if pr:
+ verstr = "%s-%s" % (verstr, pr)
+ if pe:
+ verstr = "%s:%s" % (pe, verstr)
+ return verstr
+
+ def do_show_overlayed(self, args):
+ """list overlayed recipes (where the same recipe exists in another layer)
+
+Lists the names of overlayed recipes and the available versions in each
+layer, with the preferred version first. Note that skipped recipes that
+are overlayed will also be listed, with a " (skipped)" suffix.
+"""
+
+ items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, True, None)
+
+ # Check for overlayed .bbclass files
+ classes = collections.defaultdict(list)
+ for layerdir in self.bblayers:
+ classdir = os.path.join(layerdir, 'classes')
+ if os.path.exists(classdir):
+ for classfile in os.listdir(classdir):
+ if os.path.splitext(classfile)[1] == '.bbclass':
+ classes[classfile].append(classdir)
+
+ # Locating classes and other files is a bit more complicated than recipes -
+ # layer priority is not a factor; instead BitBake uses the first matching
+ # file in BBPATH, which is manipulated directly by each layer's
+ # conf/layer.conf in turn, thus the order of layers in bblayers.conf is a
+ # factor - however, each layer.conf is free to either prepend or append to
+ # BBPATH (or indeed do crazy stuff with it). Thus the order in BBPATH might
+ # not be exactly the order present in bblayers.conf either.
+ bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
+ overlayed_class_found = False
+ for (classfile, classdirs) in classes.items():
+ if len(classdirs) > 1:
+ if not overlayed_class_found:
+ logger.plain('=== Overlayed classes ===')
+ overlayed_class_found = True
+
+ mainfile = bb.utils.which(bbpath, os.path.join('classes', classfile))
+ if args.filenames:
+ logger.plain('%s' % mainfile)
+ else:
+ # We effectively have to guess the layer here
+ logger.plain('%s:' % classfile)
+ mainlayername = '?'
+ for layerdir in self.bblayers:
+ classdir = os.path.join(layerdir, 'classes')
+ if mainfile.startswith(classdir):
+ mainlayername = self.get_layer_name(layerdir)
+ logger.plain(' %s' % mainlayername)
+ for classdir in classdirs:
+ fullpath = os.path.join(classdir, classfile)
+ if fullpath != mainfile:
+ if args.filenames:
+ print(' %s' % fullpath)
+ else:
+ print(' %s' % self.get_layer_name(os.path.dirname(classdir)))
+
+ if overlayed_class_found:
+ items_listed = True;
+
+ if not items_listed:
+ logger.plain('No overlayed files found.')
+
+ def do_show_recipes(self, args):
+ """list available recipes, showing the layer they are provided by
+
+Lists the names of recipes and the available versions in each
+layer, with the preferred version first. Optionally you may specify
+pnspec to match a specified recipe name (supports wildcards). Note that
+skipped recipes will also be listed, with a " (skipped)" suffix.
+"""
+
+ inheritlist = args.inherits.split(',') if args.inherits else []
+ if inheritlist or args.pnspec or args.multiple:
+ title = 'Matching recipes:'
+ else:
+ title = 'Available recipes:'
+ self.list_recipes(title, args.pnspec, False, False, args.filenames, args.multiple, inheritlist)
+
+ def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only, inherits):
+ if inherits:
+ bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
+ for classname in inherits:
+ classfile = 'classes/%s.bbclass' % classname
+ if not bb.utils.which(bbpath, classfile, history=False):
+ logger.error('No class named %s found in BBPATH', classfile)
+ sys.exit(1)
+
+ pkg_pn = self.tinfoil.cooker.recipecaches[''].pkg_pn
+ (latest_versions, preferred_versions) = self.tinfoil.find_providers()
+ allproviders = self.tinfoil.get_all_providers()
+
+ # Ensure we list skipped recipes
+ # We are largely guessing about PN, PV and the preferred version here,
+ # but we have no choice since skipped recipes are not fully parsed
+ skiplist = list(self.tinfoil.cooker.skiplist.keys())
+ for fn in skiplist:
+ recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')
+ p = recipe_parts[0]
+ if len(recipe_parts) > 1:
+ ver = (None, recipe_parts[1], None)
+ else:
+ ver = (None, 'unknown', None)
+ allproviders[p].append((ver, fn))
+ if not p in pkg_pn:
+ pkg_pn[p] = 'dummy'
+ preferred_versions[p] = (ver, fn)
+
+ def print_item(f, pn, ver, layer, ispref):
+ if f in skiplist:
+ skipped = ' (skipped)'
+ else:
+ skipped = ''
+ if show_filenames:
+ if ispref:
+ logger.plain("%s%s", f, skipped)
+ else:
+ logger.plain(" %s%s", f, skipped)
+ else:
+ if ispref:
+ logger.plain("%s:", pn)
+ logger.plain(" %s %s%s", layer.ljust(20), ver, skipped)
+
+ global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
+ cls_re = re.compile('classes/')
+
+ preffiles = []
+ items_listed = False
+ for p in sorted(pkg_pn):
+ if pnspec:
+ found=False
+ for pnm in pnspec:
+ if fnmatch.fnmatch(p, pnm):
+ found=True
+ break
+ if not found:
+ continue
+
+ if len(allproviders[p]) > 1 or not show_multi_provider_only:
+ pref = preferred_versions[p]
+ realfn = bb.cache.virtualfn2realfn(pref[1])
+ preffile = realfn[0]
+
+ # We only display once per recipe, we should prefer non extended versions of the
+ # recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl
+ # which would otherwise sort first).
+ if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[''].pkg_fn:
+ continue
+
+ if inherits:
+ matchcount = 0
+ recipe_inherits = self.tinfoil.cooker_data.inherits.get(preffile, [])
+ for cls in recipe_inherits:
+ if cls_re.match(cls):
+ continue
+ classname = os.path.splitext(os.path.basename(cls))[0]
+ if classname in global_inherit:
+ continue
+ elif classname in inherits:
+ matchcount += 1
+ if matchcount != len(inherits):
+ # No match - skip this recipe
+ continue
+
+ if preffile not in preffiles:
+ preflayer = self.get_file_layer(preffile)
+ multilayer = False
+ same_ver = True
+ provs = []
+ for prov in allproviders[p]:
+ provfile = bb.cache.virtualfn2realfn(prov[1])[0]
+ provlayer = self.get_file_layer(provfile)
+ provs.append((provfile, provlayer, prov[0]))
+ if provlayer != preflayer:
+ multilayer = True
+ if prov[0] != pref[0]:
+ same_ver = False
+
+ if (multilayer or not show_overlayed_only) and (same_ver or not show_same_ver_only):
+ if not items_listed:
+ logger.plain('=== %s ===' % title)
+ items_listed = True
+ print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True)
+ for (provfile, provlayer, provver) in provs:
+ if provfile != preffile:
+ print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False)
+ # Ensure we don't show two entries for BBCLASSEXTENDed recipes
+ preffiles.append(preffile)
+
+ return items_listed
+
+ def get_file_layer(self, filename):
+ layerdir = self.get_file_layerdir(filename)
+ if layerdir:
+ return self.get_layer_name(layerdir)
+ else:
+ return '?'
+
+ def get_file_layerdir(self, filename):
+ layer = bb.utils.get_file_layer(filename, self.tinfoil.config_data)
+ return self.bbfile_collections.get(layer, None)
+
+ def remove_layer_prefix(self, f):
+ """Remove the layer_dir prefix, e.g., f = /path/to/layer_dir/foo/blah, the
+ return value will be: layer_dir/foo/blah"""
+ f_layerdir = self.get_file_layerdir(f)
+ if not f_layerdir:
+ return f
+ prefix = os.path.join(os.path.dirname(f_layerdir), '')
+ return f[len(prefix):] if f.startswith(prefix) else f
+
+ def do_show_appends(self, args):
+ """list bbappend files and recipe files they apply to
+
+Lists recipes with the bbappends that apply to them as subitems.
+"""
+ if args.pnspec:
+ logger.plain('=== Matched appended recipes ===')
+ else:
+ logger.plain('=== Appended recipes ===')
+
+ pnlist = list(self.tinfoil.cooker_data.pkg_pn.keys())
+ pnlist.sort()
+ appends = False
+ for pn in pnlist:
+ if args.pnspec:
+ found=False
+ for pnm in args.pnspec:
+ if fnmatch.fnmatch(pn, pnm):
+ found=True
+ break
+ if not found:
+ continue
+
+ if self.show_appends_for_pn(pn):
+ appends = True
+
+ if not args.pnspec and self.show_appends_for_skipped():
+ appends = True
+
+ if not appends:
+ logger.plain('No append files found')
+
+ def show_appends_for_pn(self, pn):
+ filenames = self.tinfoil.cooker_data.pkg_pn[pn]
+
+ best = self.tinfoil.find_best_provider(pn)
+ best_filename = os.path.basename(best[3])
+
+ return self.show_appends_output(filenames, best_filename)
+
+ def show_appends_for_skipped(self):
+ filenames = [os.path.basename(f)
+ for f in self.tinfoil.cooker.skiplist.keys()]
+ return self.show_appends_output(filenames, None, " (skipped)")
+
+ def show_appends_output(self, filenames, best_filename, name_suffix = ''):
+ appended, missing = self.get_appends_for_files(filenames)
+ if appended:
+ for basename, appends in appended:
+ logger.plain('%s%s:', basename, name_suffix)
+ for append in appends:
+ logger.plain(' %s', append)
+
+ if best_filename:
+ if best_filename in missing:
+ logger.warning('%s: missing append for preferred version',
+ best_filename)
+ return True
+ else:
+ return False
+
+ def get_appends_for_files(self, filenames):
+ appended, notappended = [], []
+ for filename in filenames:
+ _, cls, _ = bb.cache.virtualfn2realfn(filename)
+ if cls:
+ continue
+
+ basename = os.path.basename(filename)
+ appends = self.tinfoil.cooker.collection.get_file_appends(basename)
+ if appends:
+ appended.append((basename, list(appends)))
+ else:
+ notappended.append(basename)
+ return appended, notappended
+
+ def do_show_cross_depends(self, args):
+ """Show dependencies between recipes that cross layer boundaries.
+
+Figure out the dependencies between recipes that cross layer boundaries.
+
+NOTE: .bbappend files can impact the dependencies.
+"""
+ ignore_layers = (args.ignore or '').split(',')
+
+ pkg_fn = self.tinfoil.cooker_data.pkg_fn
+ bbpath = str(self.tinfoil.config_data.getVar('BBPATH'))
+ self.require_re = re.compile(r"require\s+(.+)")
+ self.include_re = re.compile(r"include\s+(.+)")
+ self.inherit_re = re.compile(r"inherit\s+(.+)")
+
+ global_inherit = (self.tinfoil.config_data.getVar('INHERIT') or "").split()
+
+ # The bb's DEPENDS and RDEPENDS
+ for f in pkg_fn:
+ f = bb.cache.virtualfn2realfn(f)[0]
+ # Get the layername that the file is in
+ layername = self.get_file_layer(f)
+
+ # The DEPENDS
+ deps = self.tinfoil.cooker_data.deps[f]
+ for pn in deps:
+ if pn in self.tinfoil.cooker_data.pkg_pn:
+ best = self.tinfoil.find_best_provider(pn)
+ self.check_cross_depends("DEPENDS", layername, f, best[3], args.filenames, ignore_layers)
+
+ # The RDPENDS
+ all_rdeps = self.tinfoil.cooker_data.rundeps[f].values()
+ # Remove the duplicated or null one.
+ sorted_rdeps = {}
+ # The all_rdeps is the list in list, so we need two for loops
+ for k1 in all_rdeps:
+ for k2 in k1:
+ sorted_rdeps[k2] = 1
+ all_rdeps = sorted_rdeps.keys()
+ for rdep in all_rdeps:
+ all_p, best = self.tinfoil.get_runtime_providers(rdep)
+ if all_p:
+ if f in all_p:
+ # The recipe provides this one itself, ignore
+ continue
+ self.check_cross_depends("RDEPENDS", layername, f, best, args.filenames, ignore_layers)
+
+ # The RRECOMMENDS
+ all_rrecs = self.tinfoil.cooker_data.runrecs[f].values()
+ # Remove the duplicated or null one.
+ sorted_rrecs = {}
+ # The all_rrecs is the list in list, so we need two for loops
+ for k1 in all_rrecs:
+ for k2 in k1:
+ sorted_rrecs[k2] = 1
+ all_rrecs = sorted_rrecs.keys()
+ for rrec in all_rrecs:
+ all_p, best = self.tinfoil.get_runtime_providers(rrec)
+ if all_p:
+ if f in all_p:
+ # The recipe provides this one itself, ignore
+ continue
+ self.check_cross_depends("RRECOMMENDS", layername, f, best, args.filenames, ignore_layers)
+
+ # The inherit class
+ cls_re = re.compile('classes/')
+ if f in self.tinfoil.cooker_data.inherits:
+ inherits = self.tinfoil.cooker_data.inherits[f]
+ for cls in inherits:
+ # The inherits' format is [classes/cls, /path/to/classes/cls]
+ # ignore the classes/cls.
+ if not cls_re.match(cls):
+ classname = os.path.splitext(os.path.basename(cls))[0]
+ if classname in global_inherit:
+ continue
+ inherit_layername = self.get_file_layer(cls)
+ if inherit_layername != layername and not inherit_layername in ignore_layers:
+ if not args.filenames:
+ f_short = self.remove_layer_prefix(f)
+ cls = self.remove_layer_prefix(cls)
+ else:
+ f_short = f
+ logger.plain("%s inherits %s" % (f_short, cls))
+
+ # The 'require/include xxx' in the bb file
+ pv_re = re.compile(r"\${PV}")
+ with open(f, 'r') as fnfile:
+ line = fnfile.readline()
+ while line:
+ m, keyword = self.match_require_include(line)
+ # Found the 'require/include xxxx'
+ if m:
+ needed_file = m.group(1)
+ # Replace the ${PV} with the real PV
+ if pv_re.search(needed_file) and f in self.tinfoil.cooker_data.pkg_pepvpr:
+ pv = self.tinfoil.cooker_data.pkg_pepvpr[f][1]
+ needed_file = re.sub(r"\${PV}", pv, needed_file)
+ self.print_cross_files(bbpath, keyword, layername, f, needed_file, args.filenames, ignore_layers)
+ line = fnfile.readline()
+
+ # The "require/include xxx" in conf/machine/*.conf, .inc and .bbclass
+ conf_re = re.compile(".*/conf/machine/[^\/]*\.conf$")
+ inc_re = re.compile(".*\.inc$")
+ # The "inherit xxx" in .bbclass
+ bbclass_re = re.compile(".*\.bbclass$")
+ for layerdir in self.bblayers:
+ layername = self.get_layer_name(layerdir)
+ for dirpath, dirnames, filenames in os.walk(layerdir):
+ for name in filenames:
+ f = os.path.join(dirpath, name)
+ s = conf_re.match(f) or inc_re.match(f) or bbclass_re.match(f)
+ if s:
+ with open(f, 'r') as ffile:
+ line = ffile.readline()
+ while line:
+ m, keyword = self.match_require_include(line)
+ # Only bbclass has the "inherit xxx" here.
+ bbclass=""
+ if not m and f.endswith(".bbclass"):
+ m, keyword = self.match_inherit(line)
+ bbclass=".bbclass"
+ # Find a 'require/include xxxx'
+ if m:
+ self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, args.filenames, ignore_layers)
+ line = ffile.readline()
+
+ def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames, ignore_layers):
+ """Print the depends that crosses a layer boundary"""
+ needed_file = bb.utils.which(bbpath, needed_filename)
+ if needed_file:
+ # Which layer is this file from
+ needed_layername = self.get_file_layer(needed_file)
+ if needed_layername != layername and not needed_layername in ignore_layers:
+ if not show_filenames:
+ f = self.remove_layer_prefix(f)
+ needed_file = self.remove_layer_prefix(needed_file)
+ logger.plain("%s %s %s" %(f, keyword, needed_file))
+
+ def match_inherit(self, line):
+ """Match the inherit xxx line"""
+ return (self.inherit_re.match(line), "inherits")
+
+ def match_require_include(self, line):
+ """Match the require/include xxx line"""
+ m = self.require_re.match(line)
+ keyword = "requires"
+ if not m:
+ m = self.include_re.match(line)
+ keyword = "includes"
+ return (m, keyword)
+
+ def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames, ignore_layers):
+ """Print the DEPENDS/RDEPENDS file that crosses a layer boundary"""
+ best_realfn = bb.cache.virtualfn2realfn(needed_file)[0]
+ needed_layername = self.get_file_layer(best_realfn)
+ if needed_layername != layername and not needed_layername in ignore_layers:
+ if not show_filenames:
+ f = self.remove_layer_prefix(f)
+ best_realfn = self.remove_layer_prefix(best_realfn)
+
+ logger.plain("%s %s %s" % (f, keyword, best_realfn))
+
+ def register_commands(self, sp):
+ self.add_command(sp, 'show-layers', self.do_show_layers, parserecipes=False)
+
+ parser_show_overlayed = self.add_command(sp, 'show-overlayed', self.do_show_overlayed)
+ parser_show_overlayed.add_argument('-f', '--filenames', help='instead of the default formatting, list filenames of higher priority recipes with the ones they overlay indented underneath', action='store_true')
+ parser_show_overlayed.add_argument('-s', '--same-version', help='only list overlayed recipes where the version is the same', action='store_true')
+
+ parser_show_recipes = self.add_command(sp, 'show-recipes', self.do_show_recipes)
+ parser_show_recipes.add_argument('-f', '--filenames', help='instead of the default formatting, list filenames of higher priority recipes with the ones they overlay indented underneath', action='store_true')
+ parser_show_recipes.add_argument('-m', '--multiple', help='only list where multiple recipes (in the same layer or different layers) exist for the same recipe name', action='store_true')
+ parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
+ parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
+
+ parser_show_appends = self.add_command(sp, 'show-appends', self.do_show_appends)
+ parser_show_appends.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
+
+ parser_show_cross_depends = self.add_command(sp, 'show-cross-depends', self.do_show_cross_depends)
+ parser_show_cross_depends.add_argument('-f', '--filenames', help='show full file path', action='store_true')
+ parser_show_cross_depends.add_argument('-i', '--ignore', help='ignore dependencies on items in the specified layer(s) (split multiple layer names with commas, no spaces)', metavar='LAYERNAME')
diff --git a/poky/bitbake/lib/bs4/AUTHORS.txt b/poky/bitbake/lib/bs4/AUTHORS.txt
new file mode 100644
index 000000000..2ac8fcc8c
--- /dev/null
+++ b/poky/bitbake/lib/bs4/AUTHORS.txt
@@ -0,0 +1,43 @@
+Behold, mortal, the origins of Beautiful Soup...
+================================================
+
+Leonard Richardson is the primary programmer.
+
+Aaron DeVore is awesome.
+
+Mark Pilgrim provided the encoding detection code that forms the base
+of UnicodeDammit.
+
+Thomas Kluyver and Ezio Melotti finished the work of getting Beautiful
+Soup 4 working under Python 3.
+
+Simon Willison wrote soupselect, which was used to make Beautiful Soup
+support CSS selectors.
+
+Sam Ruby helped with a lot of edge cases.
+
+Jonathan Ellis was awarded the prestigous Beau Potage D'Or for his
+work in solving the nestable tags conundrum.
+
+An incomplete list of people have contributed patches to Beautiful
+Soup:
+
+ Istvan Albert, Andrew Lin, Anthony Baxter, Andrew Boyko, Tony Chang,
+ Zephyr Fang, Fuzzy, Roman Gaufman, Yoni Gilad, Richie Hindle, Peteris
+ Krumins, Kent Johnson, Ben Last, Robert Leftwich, Staffan Malmgren,
+ Ksenia Marasanova, JP Moins, Adam Monsen, John Nagle, "Jon", Ed
+ Oskiewicz, Greg Phillips, Giles Radford, Arthur Rudolph, Marko
+ Samastur, Jouni Seppänen, Alexander Schmolck, Andy Theyers, Glyn
+ Webster, Paul Wright, Danny Yoo
+
+An incomplete list of people who made suggestions or found bugs or
+found ways to break Beautiful Soup:
+
+ Hanno Böck, Matteo Bertini, Chris Curvey, Simon Cusack, Bruce Eckel,
+ Matt Ernst, Michael Foord, Tom Harris, Bill de hOra, Donald Howes,
+ Matt Patterson, Scott Roberts, Steve Strassmann, Mike Williams,
+ warchild at redho dot com, Sami Kuisma, Carlos Rocha, Bob Hutchison,
+ Joren Mc, Michal Migurski, John Kleven, Tim Heaney, Tripp Lilley, Ed
+ Summers, Dennis Sutch, Chris Smith, Aaron Sweep^W Swartz, Stuart
+ Turner, Greg Edwards, Kevin J Kalupson, Nikos Kouremenos, Artur de
+ Sousa Rocha, Yichun Wei, Per Vognsen
diff --git a/poky/bitbake/lib/bs4/COPYING.txt b/poky/bitbake/lib/bs4/COPYING.txt
new file mode 100644
index 000000000..d668d13f0
--- /dev/null
+++ b/poky/bitbake/lib/bs4/COPYING.txt
@@ -0,0 +1,26 @@
+Beautiful Soup is made available under the MIT license:
+
+ Copyright (c) 2004-2012 Leonard Richardson
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE, DAMMIT.
+
+Beautiful Soup incorporates code from the html5lib library, which is
+also made available under the MIT license.
diff --git a/poky/bitbake/lib/bs4/NEWS.txt b/poky/bitbake/lib/bs4/NEWS.txt
new file mode 100644
index 000000000..88a60a245
--- /dev/null
+++ b/poky/bitbake/lib/bs4/NEWS.txt
@@ -0,0 +1,1066 @@
+= 4.3.2 (20131002) =
+
+* Fixed a bug in which short Unicode input was improperly encoded to
+ ASCII when checking whether or not it was the name of a file on
+ disk. [bug=1227016]
+
+* Fixed a crash when a short input contains data not valid in
+ filenames. [bug=1232604]
+
+* Fixed a bug that caused Unicode data put into UnicodeDammit to
+ return None instead of the original data. [bug=1214983]
+
+* Combined two tests to stop a spurious test failure when tests are
+ run by nosetests. [bug=1212445]
+
+= 4.3.1 (20130815) =
+
+* Fixed yet another problem with the html5lib tree builder, caused by
+ html5lib's tendency to rearrange the tree during
+ parsing. [bug=1189267]
+
+* Fixed a bug that caused the optimized version of find_all() to
+ return nothing. [bug=1212655]
+
+= 4.3.0 (20130812) =
+
+* Instead of converting incoming data to Unicode and feeding it to the
+ lxml tree builder in chunks, Beautiful Soup now makes successive
+ guesses at the encoding of the incoming data, and tells lxml to
+ parse the data as that encoding. Giving lxml more control over the
+ parsing process improves performance and avoids a number of bugs and
+ issues with the lxml parser which had previously required elaborate
+ workarounds:
+
+ - An issue in which lxml refuses to parse Unicode strings on some
+ systems. [bug=1180527]
+
+ - A returning bug that truncated documents longer than a (very
+ small) size. [bug=963880]
+
+ - A returning bug in which extra spaces were added to a document if
+ the document defined a charset other than UTF-8. [bug=972466]
+
+ This required a major overhaul of the tree builder architecture. If
+ you wrote your own tree builder and didn't tell me, you'll need to
+ modify your prepare_markup() method.
+
+* The UnicodeDammit code that makes guesses at encodings has been
+ split into its own class, EncodingDetector. A lot of apparently
+ redundant code has been removed from Unicode, Dammit, and some
+ undocumented features have also been removed.
+
+* Beautiful Soup will issue a warning if instead of markup you pass it
+ a URL or the name of a file on disk (a common beginner's mistake).
+
+* A number of optimizations improve the performance of the lxml tree
+ builder by about 33%, the html.parser tree builder by about 20%, and
+ the html5lib tree builder by about 15%.
+
+* All find_all calls should now return a ResultSet object. Patch by
+ Aaron DeVore. [bug=1194034]
+
+= 4.2.1 (20130531) =
+
+* The default XML formatter will now replace ampersands even if they
+ appear to be part of entities. That is, "&lt;" will become
+ "&amp;lt;". The old code was left over from Beautiful Soup 3, which
+ didn't always turn entities into Unicode characters.
+
+ If you really want the old behavior (maybe because you add new
+ strings to the tree, those strings include entities, and you want
+ the formatter to leave them alone on output), it can be found in
+ EntitySubstitution.substitute_xml_containing_entities(). [bug=1182183]
+
+* Gave new_string() the ability to create subclasses of
+ NavigableString. [bug=1181986]
+
+* Fixed another bug by which the html5lib tree builder could create a
+ disconnected tree. [bug=1182089]
+
+* The .previous_element of a BeautifulSoup object is now always None,
+ not the last element to be parsed. [bug=1182089]
+
+* Fixed test failures when lxml is not installed. [bug=1181589]
+
+* html5lib now supports Python 3. Fixed some Python 2-specific
+ code in the html5lib test suite. [bug=1181624]
+
+* The html.parser treebuilder can now handle numeric attributes in
+ text when the hexidecimal name of the attribute starts with a
+ capital X. Patch by Tim Shirley. [bug=1186242]
+
+= 4.2.0 (20130514) =
+
+* The Tag.select() method now supports a much wider variety of CSS
+ selectors.
+
+ - Added support for the adjacent sibling combinator (+) and the
+ general sibling combinator (~). Tests by "liquider". [bug=1082144]
+
+ - The combinators (>, +, and ~) can now combine with any supported
+ selector, not just one that selects based on tag name.
+
+ - Added limited support for the "nth-of-type" pseudo-class. Code
+ by Sven Slootweg. [bug=1109952]
+
+* The BeautifulSoup class is now aliased to "_s" and "_soup", making
+ it quicker to type the import statement in an interactive session:
+
+ from bs4 import _s
+ or
+ from bs4 import _soup
+
+ The alias may change in the future, so don't use this in code you're
+ going to run more than once.
+
+* Added the 'diagnose' submodule, which includes several useful
+ functions for reporting problems and doing tech support.
+
+ - diagnose(data) tries the given markup on every installed parser,
+ reporting exceptions and displaying successes. If a parser is not
+ installed, diagnose() mentions this fact.
+
+ - lxml_trace(data, html=True) runs the given markup through lxml's
+ XML parser or HTML parser, and prints out the parser events as
+ they happen. This helps you quickly determine whether a given
+ problem occurs in lxml code or Beautiful Soup code.
+
+ - htmlparser_trace(data) is the same thing, but for Python's
+ built-in HTMLParser class.
+
+* In an HTML document, the contents of a <script> or <style> tag will
+ no longer undergo entity substitution by default. XML documents work
+ the same way they did before. [bug=1085953]
+
+* Methods like get_text() and properties like .strings now only give
+ you strings that are visible in the document--no comments or
+ processing commands. [bug=1050164]
+
+* The prettify() method now leaves the contents of <pre> tags
+ alone. [bug=1095654]
+
+* Fix a bug in the html5lib treebuilder which sometimes created
+ disconnected trees. [bug=1039527]
+
+* Fix a bug in the lxml treebuilder which crashed when a tag included
+ an attribute from the predefined "xml:" namespace. [bug=1065617]
+
+* Fix a bug by which keyword arguments to find_parent() were not
+ being passed on. [bug=1126734]
+
+* Stop a crash when unwisely messing with a tag that's been
+ decomposed. [bug=1097699]
+
+* Now that lxml's segfault on invalid doctype has been fixed, fixed a
+ corresponding problem on the Beautiful Soup end that was previously
+ invisible. [bug=984936]
+
+* Fixed an exception when an overspecified CSS selector didn't match
+ anything. Code by Stefaan Lippens. [bug=1168167]
+
+= 4.1.3 (20120820) =
+
+* Skipped a test under Python 2.6 and Python 3.1 to avoid a spurious
+ test failure caused by the lousy HTMLParser in those
+ versions. [bug=1038503]
+
+* Raise a more specific error (FeatureNotFound) when a requested
+ parser or parser feature is not installed. Raise NotImplementedError
+ instead of ValueError when the user calls insert_before() or
+ insert_after() on the BeautifulSoup object itself. Patch by Aaron
+ Devore. [bug=1038301]
+
+= 4.1.2 (20120817) =
+
+* As per PEP-8, allow searching by CSS class using the 'class_'
+ keyword argument. [bug=1037624]
+
+* Display namespace prefixes for namespaced attribute names, instead of
+ the fully-qualified names given by the lxml parser. [bug=1037597]
+
+* Fixed a crash on encoding when an attribute name contained
+ non-ASCII characters.
+
+* When sniffing encodings, if the cchardet library is installed,
+ Beautiful Soup uses it instead of chardet. cchardet is much
+ faster. [bug=1020748]
+
+* Use logging.warning() instead of warning.warn() to notify the user
+ that characters were replaced with REPLACEMENT
+ CHARACTER. [bug=1013862]
+
+= 4.1.1 (20120703) =
+
+* Fixed an html5lib tree builder crash which happened when html5lib
+ moved a tag with a multivalued attribute from one part of the tree
+ to another. [bug=1019603]
+
+* Correctly display closing tags with an XML namespace declared. Patch
+ by Andreas Kostyrka. [bug=1019635]
+
+* Fixed a typo that made parsing significantly slower than it should
+ have been, and also waited too long to close tags with XML
+ namespaces. [bug=1020268]
+
+* get_text() now returns an empty Unicode string if there is no text,
+ rather than an empty bytestring. [bug=1020387]
+
+= 4.1.0 (20120529) =
+
+* Added experimental support for fixing Windows-1252 characters
+ embedded in UTF-8 documents. (UnicodeDammit.detwingle())
+
+* Fixed the handling of &quot; with the built-in parser. [bug=993871]
+
+* Comments, processing instructions, document type declarations, and
+ markup declarations are now treated as preformatted strings, the way
+ CData blocks are. [bug=1001025]
+
+* Fixed a bug with the lxml treebuilder that prevented the user from
+ adding attributes to a tag that didn't originally have
+ attributes. [bug=1002378] Thanks to Oliver Beattie for the patch.
+
+* Fixed some edge-case bugs having to do with inserting an element
+ into a tag it's already inside, and replacing one of a tag's
+ children with another. [bug=997529]
+
+* Added the ability to search for attribute values specified in UTF-8. [bug=1003974]
+
+ This caused a major refactoring of the search code. All the tests
+ pass, but it's possible that some searches will behave differently.
+
+= 4.0.5 (20120427) =
+
+* Added a new method, wrap(), which wraps an element in a tag.
+
+* Renamed replace_with_children() to unwrap(), which is easier to
+ understand and also the jQuery name of the function.
+
+* Made encoding substitution in <meta> tags completely transparent (no
+ more %SOUP-ENCODING%).
+
+* Fixed a bug in decoding data that contained a byte-order mark, such
+ as data encoded in UTF-16LE. [bug=988980]
+
+* Fixed a bug that made the HTMLParser treebuilder generate XML
+ definitions ending with two question marks instead of
+ one. [bug=984258]
+
+* Upon document generation, CData objects are no longer run through
+ the formatter. [bug=988905]
+
+* The test suite now passes when lxml is not installed, whether or not
+ html5lib is installed. [bug=987004]
+
+* Print a warning on HTMLParseErrors to let people know they should
+ install a better parser library.
+
+= 4.0.4 (20120416) =
+
+* Fixed a bug that sometimes created disconnected trees.
+
+* Fixed a bug with the string setter that moved a string around the
+ tree instead of copying it. [bug=983050]
+
+* Attribute values are now run through the provided output formatter.
+ Previously they were always run through the 'minimal' formatter. In
+ the future I may make it possible to specify different formatters
+ for attribute values and strings, but for now, consistent behavior
+ is better than inconsistent behavior. [bug=980237]
+
+* Added the missing renderContents method from Beautiful Soup 3. Also
+ added an encode_contents() method to go along with decode_contents().
+
+* Give a more useful error when the user tries to run the Python 2
+ version of BS under Python 3.
+
+* UnicodeDammit can now convert Microsoft smart quotes to ASCII with
+ UnicodeDammit(markup, smart_quotes_to="ascii").
+
+= 4.0.3 (20120403) =
+
+* Fixed a typo that caused some versions of Python 3 to convert the
+ Beautiful Soup codebase incorrectly.
+
+* Got rid of the 4.0.2 workaround for HTML documents--it was
+ unnecessary and the workaround was triggering a (possibly different,
+ but related) bug in lxml. [bug=972466]
+
+= 4.0.2 (20120326) =
+
+* Worked around a possible bug in lxml that prevents non-tiny XML
+ documents from being parsed. [bug=963880, bug=963936]
+
+* Fixed a bug where specifying `text` while also searching for a tag
+ only worked if `text` wanted an exact string match. [bug=955942]
+
+= 4.0.1 (20120314) =
+
+* This is the first official release of Beautiful Soup 4. There is no
+ 4.0.0 release, to eliminate any possibility that packaging software
+ might treat "4.0.0" as being an earlier version than "4.0.0b10".
+
+* Brought BS up to date with the latest release of soupselect, adding
+ CSS selector support for direct descendant matches and multiple CSS
+ class matches.
+
+= 4.0.0b10 (20120302) =
+
+* Added support for simple CSS selectors, taken from the soupselect project.
+
+* Fixed a crash when using html5lib. [bug=943246]
+
+* In HTML5-style <meta charset="foo"> tags, the value of the "charset"
+ attribute is now replaced with the appropriate encoding on
+ output. [bug=942714]
+
+* Fixed a bug that caused calling a tag to sometimes call find_all()
+ with the wrong arguments. [bug=944426]
+
+* For backwards compatibility, brought back the BeautifulStoneSoup
+ class as a deprecated wrapper around BeautifulSoup.
+
+= 4.0.0b9 (20120228) =
+
+* Fixed the string representation of DOCTYPEs that have both a public
+ ID and a system ID.
+
+* Fixed the generated XML declaration.
+
+* Renamed Tag.nsprefix to Tag.prefix, for consistency with
+ NamespacedAttribute.
+
+* Fixed a test failure that occured on Python 3.x when chardet was
+ installed.
+
+* Made prettify() return Unicode by default, so it will look nice on
+ Python 3 when passed into print().
+
+= 4.0.0b8 (20120224) =
+
+* All tree builders now preserve namespace information in the
+ documents they parse. If you use the html5lib parser or lxml's XML
+ parser, you can access the namespace URL for a tag as tag.namespace.
+
+ However, there is no special support for namespace-oriented
+ searching or tree manipulation. When you search the tree, you need
+ to use namespace prefixes exactly as they're used in the original
+ document.
+
+* The string representation of a DOCTYPE always ends in a newline.
+
+* Issue a warning if the user tries to use a SoupStrainer in
+ conjunction with the html5lib tree builder, which doesn't support
+ them.
+
+= 4.0.0b7 (20120223) =
+
+* Upon decoding to string, any characters that can't be represented in
+ your chosen encoding will be converted into numeric XML entity
+ references.
+
+* Issue a warning if characters were replaced with REPLACEMENT
+ CHARACTER during Unicode conversion.
+
+* Restored compatibility with Python 2.6.
+
+* The install process no longer installs docs or auxillary text files.
+
+* It's now possible to deepcopy a BeautifulSoup object created with
+ Python's built-in HTML parser.
+
+* About 100 unit tests that "test" the behavior of various parsers on
+ invalid markup have been removed. Legitimate changes to those
+ parsers caused these tests to fail, indicating that perhaps
+ Beautiful Soup should not test the behavior of foreign
+ libraries.
+
+ The problematic unit tests have been reformulated as informational
+ comparisons generated by the script
+ scripts/demonstrate_parser_differences.py.
+
+ This makes Beautiful Soup compatible with html5lib version 0.95 and
+ future versions of HTMLParser.
+
+= 4.0.0b6 (20120216) =
+
+* Multi-valued attributes like "class" always have a list of values,
+ even if there's only one value in the list.
+
+* Added a number of multi-valued attributes defined in HTML5.
+
+* Stopped generating a space before the slash that closes an
+ empty-element tag. This may come back if I add a special XHTML mode
+ (http://www.w3.org/TR/xhtml1/#C_2), but right now it's pretty
+ useless.
+
+* Passing text along with tag-specific arguments to a find* method:
+
+ find("a", text="Click here")
+
+ will find tags that contain the given text as their
+ .string. Previously, the tag-specific arguments were ignored and
+ only strings were searched.
+
+* Fixed a bug that caused the html5lib tree builder to build a
+ partially disconnected tree. Generally cleaned up the html5lib tree
+ builder.
+
+* If you restrict a multi-valued attribute like "class" to a string
+ that contains spaces, Beautiful Soup will only consider it a match
+ if the values correspond to that specific string.
+
+= 4.0.0b5 (20120209) =
+
+* Rationalized Beautiful Soup's treatment of CSS class. A tag
+ belonging to multiple CSS classes is treated as having a list of
+ values for the 'class' attribute. Searching for a CSS class will
+ match *any* of the CSS classes.
+
+ This actually affects all attributes that the HTML standard defines
+ as taking multiple values (class, rel, rev, archive, accept-charset,
+ and headers), but 'class' is by far the most common. [bug=41034]
+
+* If you pass anything other than a dictionary as the second argument
+ to one of the find* methods, it'll assume you want to use that
+ object to search against a tag's CSS classes. Previously this only
+ worked if you passed in a string.
+
+* Fixed a bug that caused a crash when you passed a dictionary as an
+ attribute value (possibly because you mistyped "attrs"). [bug=842419]
+
+* Unicode, Dammit now detects the encoding in HTML 5-style <meta> tags
+ like <meta charset="utf-8" />. [bug=837268]
+
+* If Unicode, Dammit can't figure out a consistent encoding for a
+ page, it will try each of its guesses again, with errors="replace"
+ instead of errors="strict". This may mean that some data gets
+ replaced with REPLACEMENT CHARACTER, but at least most of it will
+ get turned into Unicode. [bug=754903]
+
+* Patched over a bug in html5lib (?) that was crashing Beautiful Soup
+ on certain kinds of markup. [bug=838800]
+
+* Fixed a bug that wrecked the tree if you replaced an element with an
+ empty string. [bug=728697]
+
+* Improved Unicode, Dammit's behavior when you give it Unicode to
+ begin with.
+
+= 4.0.0b4 (20120208) =
+
+* Added BeautifulSoup.new_string() to go along with BeautifulSoup.new_tag()
+
+* BeautifulSoup.new_tag() will follow the rules of whatever
+ tree-builder was used to create the original BeautifulSoup object. A
+ new <p> tag will look like "<p />" if the soup object was created to
+ parse XML, but it will look like "<p></p>" if the soup object was
+ created to parse HTML.
+
+* We pass in strict=False to html.parser on Python 3, greatly
+ improving html.parser's ability to handle bad HTML.
+
+* We also monkeypatch a serious bug in html.parser that made
+ strict=False disastrous on Python 3.2.2.
+
+* Replaced the "substitute_html_entities" argument with the
+ more general "formatter" argument.
+
+* Bare ampersands and angle brackets are always converted to XML
+ entities unless the user prevents it.
+
+* Added PageElement.insert_before() and PageElement.insert_after(),
+ which let you put an element into the parse tree with respect to
+ some other element.
+
+* Raise an exception when the user tries to do something nonsensical
+ like insert a tag into itself.
+
+
+= 4.0.0b3 (20120203) =
+
+Beautiful Soup 4 is a nearly-complete rewrite that removes Beautiful
+Soup's custom HTML parser in favor of a system that lets you write a
+little glue code and plug in any HTML or XML parser you want.
+
+Beautiful Soup 4.0 comes with glue code for four parsers:
+
+ * Python's standard HTMLParser (html.parser in Python 3)
+ * lxml's HTML and XML parsers
+ * html5lib's HTML parser
+
+HTMLParser is the default, but I recommend you install lxml if you
+can.
+
+For complete documentation, see the Sphinx documentation in
+bs4/doc/source/. What follows is a summary of the changes from
+Beautiful Soup 3.
+
+=== The module name has changed ===
+
+Previously you imported the BeautifulSoup class from a module also
+called BeautifulSoup. To save keystrokes and make it clear which
+version of the API is in use, the module is now called 'bs4':
+
+ >>> from bs4 import BeautifulSoup
+
+=== It works with Python 3 ===
+
+Beautiful Soup 3.1.0 worked with Python 3, but the parser it used was
+so bad that it barely worked at all. Beautiful Soup 4 works with
+Python 3, and since its parser is pluggable, you don't sacrifice
+quality.
+
+Special thanks to Thomas Kluyver and Ezio Melotti for getting Python 3
+support to the finish line. Ezio Melotti is also to thank for greatly
+improving the HTML parser that comes with Python 3.2.
+
+=== CDATA sections are normal text, if they're understood at all. ===
+
+Currently, the lxml and html5lib HTML parsers ignore CDATA sections in
+markup:
+
+ <p><![CDATA[foo]]></p> => <p></p>
+
+A future version of html5lib will turn CDATA sections into text nodes,
+but only within tags like <svg> and <math>:
+
+ <svg><![CDATA[foo]]></svg> => <p>foo</p>
+
+The default XML parser (which uses lxml behind the scenes) turns CDATA
+sections into ordinary text elements:
+
+ <p><![CDATA[foo]]></p> => <p>foo</p>
+
+In theory it's possible to preserve the CDATA sections when using the
+XML parser, but I don't see how to get it to work in practice.
+
+=== Miscellaneous other stuff ===
+
+If the BeautifulSoup instance has .is_xml set to True, an appropriate
+XML declaration will be emitted when the tree is transformed into a
+string:
+
+ <?xml version="1.0" encoding="utf-8">
+ <markup>
+ ...
+ </markup>
+
+The ['lxml', 'xml'] tree builder sets .is_xml to True; the other tree
+builders set it to False. If you want to parse XHTML with an HTML
+parser, you can set it manually.
+
+
+= 3.2.0 =
+
+The 3.1 series wasn't very useful, so I renamed the 3.0 series to 3.2
+to make it obvious which one you should use.
+
+= 3.1.0 =
+
+A hybrid version that supports 2.4 and can be automatically converted
+to run under Python 3.0. There are three backwards-incompatible
+changes you should be aware of, but no new features or deliberate
+behavior changes.
+
+1. str() may no longer do what you want. This is because the meaning
+of str() inverts between Python 2 and 3; in Python 2 it gives you a
+byte string, in Python 3 it gives you a Unicode string.
+
+The effect of this is that you can't pass an encoding to .__str__
+anymore. Use encode() to get a string and decode() to get Unicode, and
+you'll be ready (well, readier) for Python 3.
+
+2. Beautiful Soup is now based on HTMLParser rather than SGMLParser,
+which is gone in Python 3. There's some bad HTML that SGMLParser
+handled but HTMLParser doesn't, usually to do with attribute values
+that aren't closed or have brackets inside them:
+
+ <a href="foo</a>, </a><a href="bar">baz</a>
+ <a b="<a>">', '<a b="&lt;a&gt;"></a><a>"></a>
+
+A later version of Beautiful Soup will allow you to plug in different
+parsers to make tradeoffs between speed and the ability to handle bad
+HTML.
+
+3. In Python 3 (but not Python 2), HTMLParser converts entities within
+attributes to the corresponding Unicode characters. In Python 2 it's
+possible to parse this string and leave the &eacute; intact.
+
+ <a href="http://crummy.com?sacr&eacute;&bleu">
+
+In Python 3, the &eacute; is always converted to \xe9 during
+parsing.
+
+
+= 3.0.7a =
+
+Added an import that makes BS work in Python 2.3.
+
+
+= 3.0.7 =
+
+Fixed a UnicodeDecodeError when unpickling documents that contain
+non-ASCII characters.
+
+Fixed a TypeError that occured in some circumstances when a tag
+contained no text.
+
+Jump through hoops to avoid the use of chardet, which can be extremely
+slow in some circumstances. UTF-8 documents should never trigger the
+use of chardet.
+
+Whitespace is preserved inside <pre> and <textarea> tags that contain
+nothing but whitespace.
+
+Beautiful Soup can now parse a doctype that's scoped to an XML namespace.
+
+
+= 3.0.6 =
+
+Got rid of a very old debug line that prevented chardet from working.
+
+Added a Tag.decompose() method that completely disconnects a tree or a
+subset of a tree, breaking it up into bite-sized pieces that are
+easy for the garbage collecter to collect.
+
+Tag.extract() now returns the tag that was extracted.
+
+Tag.findNext() now does something with the keyword arguments you pass
+it instead of dropping them on the floor.
+
+Fixed a Unicode conversion bug.
+
+Fixed a bug that garbled some <meta> tags when rewriting them.
+
+
+= 3.0.5 =
+
+Soup objects can now be pickled, and copied with copy.deepcopy.
+
+Tag.append now works properly on existing BS objects. (It wasn't
+originally intended for outside use, but it can be now.) (Giles
+Radford)
+
+Passing in a nonexistent encoding will no longer crash the parser on
+Python 2.4 (John Nagle).
+
+Fixed an underlying bug in SGMLParser that thinks ASCII has 255
+characters instead of 127 (John Nagle).
+
+Entities are converted more consistently to Unicode characters.
+
+Entity references in attribute values are now converted to Unicode
+characters when appropriate. Numeric entities are always converted,
+because SGMLParser always converts them outside of attribute values.
+
+ALL_ENTITIES happens to just be the XHTML entities, so I renamed it to
+XHTML_ENTITIES.
+
+The regular expression for bare ampersands was too loose. In some
+cases ampersands were not being escaped. (Sam Ruby?)
+
+Non-breaking spaces and other special Unicode space characters are no
+longer folded to ASCII spaces. (Robert Leftwich)
+
+Information inside a TEXTAREA tag is now parsed literally, not as HTML
+tags. TEXTAREA now works exactly the same way as SCRIPT. (Zephyr Fang)
+
+= 3.0.4 =
+
+Fixed a bug that crashed Unicode conversion in some cases.
+
+Fixed a bug that prevented UnicodeDammit from being used as a
+general-purpose data scrubber.
+
+Fixed some unit test failures when running against Python 2.5.
+
+When considering whether to convert smart quotes, UnicodeDammit now
+looks at the original encoding in a case-insensitive way.
+
+= 3.0.3 (20060606) =
+
+Beautiful Soup is now usable as a way to clean up invalid XML/HTML (be
+sure to pass in an appropriate value for convertEntities, or XML/HTML
+entities might stick around that aren't valid in HTML/XML). The result
+may not validate, but it should be good enough to not choke a
+real-world XML parser. Specifically, the output of a properly
+constructed soup object should always be valid as part of an XML
+document, but parts may be missing if they were missing in the
+original. As always, if the input is valid XML, the output will also
+be valid.
+
+= 3.0.2 (20060602) =
+
+Previously, Beautiful Soup correctly handled attribute values that
+contained embedded quotes (sometimes by escaping), but not other kinds
+of XML character. Now, it correctly handles or escapes all special XML
+characters in attribute values.
+
+I aliased methods to the 2.x names (fetch, find, findText, etc.) for
+backwards compatibility purposes. Those names are deprecated and if I
+ever do a 4.0 I will remove them. I will, I tell you!
+
+Fixed a bug where the findAll method wasn't passing along any keyword
+arguments.
+
+When run from the command line, Beautiful Soup now acts as an HTML
+pretty-printer, not an XML pretty-printer.
+
+= 3.0.1 (20060530) =
+
+Reintroduced the "fetch by CSS class" shortcut. I thought keyword
+arguments would replace it, but they don't. You can't call soup('a',
+class='foo') because class is a Python keyword.
+
+If Beautiful Soup encounters a meta tag that declares the encoding,
+but a SoupStrainer tells it not to parse that tag, Beautiful Soup will
+no longer try to rewrite the meta tag to mention the new
+encoding. Basically, this makes SoupStrainers work in real-world
+applications instead of crashing the parser.
+
+= 3.0.0 "Who would not give all else for two p" (20060528) =
+
+This release is not backward-compatible with previous releases. If
+you've got code written with a previous version of the library, go
+ahead and keep using it, unless one of the features mentioned here
+really makes your life easier. Since the library is self-contained,
+you can include an old copy of the library in your old applications,
+and use the new version for everything else.
+
+The documentation has been rewritten and greatly expanded with many
+more examples.
+
+Beautiful Soup autodetects the encoding of a document (or uses the one
+you specify), and converts it from its native encoding to
+Unicode. Internally, it only deals with Unicode strings. When you
+print out the document, it converts to UTF-8 (or another encoding you
+specify). [Doc reference]
+
+It's now easy to make large-scale changes to the parse tree without
+screwing up the navigation members. The methods are extract,
+replaceWith, and insert. [Doc reference. See also Improving Memory
+Usage with extract]
+
+Passing True in as an attribute value gives you tags that have any
+value for that attribute. You don't have to create a regular
+expression. Passing None for an attribute value gives you tags that
+don't have that attribute at all.
+
+Tag objects now know whether or not they're self-closing. This avoids
+the problem where Beautiful Soup thought that tags like <BR /> were
+self-closing even in XML documents. You can customize the self-closing
+tags for a parser object by passing them in as a list of
+selfClosingTags: you don't have to subclass anymore.
+
+There's a new built-in parser, MinimalSoup, which has most of
+BeautifulSoup's HTML-specific rules, but no tag nesting rules. [Doc
+reference]
+
+You can use a SoupStrainer to tell Beautiful Soup to parse only part
+of a document. This saves time and memory, often making Beautiful Soup
+about as fast as a custom-built SGMLParser subclass. [Doc reference,
+SoupStrainer reference]
+
+You can (usually) use keyword arguments instead of passing a
+dictionary of attributes to a search method. That is, you can replace
+soup(args={"id" : "5"}) with soup(id="5"). You can still use args if
+(for instance) you need to find an attribute whose name clashes with
+the name of an argument to findAll. [Doc reference: **kwargs attrs]
+
+The method names have changed to the better method names used in
+Rubyful Soup. Instead of find methods and fetch methods, there are
+only find methods. Instead of a scheme where you can't remember which
+method finds one element and which one finds them all, we have find
+and findAll. In general, if the method name mentions All or a plural
+noun (eg. findNextSiblings), then it finds many elements
+method. Otherwise, it only finds one element. [Doc reference]
+
+Some of the argument names have been renamed for clarity. For instance
+avoidParserProblems is now parserMassage.
+
+Beautiful Soup no longer implements a feed method. You need to pass a
+string or a filehandle into the soup constructor, not with feed after
+the soup has been created. There is still a feed method, but it's the
+feed method implemented by SGMLParser and calling it will bypass
+Beautiful Soup and cause problems.
+
+The NavigableText class has been renamed to NavigableString. There is
+no NavigableUnicodeString anymore, because every string inside a
+Beautiful Soup parse tree is a Unicode string.
+
+findText and fetchText are gone. Just pass a text argument into find
+or findAll.
+
+Null was more trouble than it was worth, so I got rid of it. Anything
+that used to return Null now returns None.
+
+Special XML constructs like comments and CDATA now have their own
+NavigableString subclasses, instead of being treated as oddly-formed
+data. If you parse a document that contains CDATA and write it back
+out, the CDATA will still be there.
+
+When you're parsing a document, you can get Beautiful Soup to convert
+XML or HTML entities into the corresponding Unicode characters. [Doc
+reference]
+
+= 2.1.1 (20050918) =
+
+Fixed a serious performance bug in BeautifulStoneSoup which was
+causing parsing to be incredibly slow.
+
+Corrected several entities that were previously being incorrectly
+translated from Microsoft smart-quote-like characters.
+
+Fixed a bug that was breaking text fetch.
+
+Fixed a bug that crashed the parser when text chunks that look like
+HTML tag names showed up within a SCRIPT tag.
+
+THEAD, TBODY, and TFOOT tags are now nestable within TABLE
+tags. Nested tables should parse more sensibly now.
+
+BASE is now considered a self-closing tag.
+
+= 2.1.0 "Game, or any other dish?" (20050504) =
+
+Added a wide variety of new search methods which, given a starting
+point inside the tree, follow a particular navigation member (like
+nextSibling) over and over again, looking for Tag and NavigableText
+objects that match certain criteria. The new methods are findNext,
+fetchNext, findPrevious, fetchPrevious, findNextSibling,
+fetchNextSiblings, findPreviousSibling, fetchPreviousSiblings,
+findParent, and fetchParents. All of these use the same basic code
+used by first and fetch, so you can pass your weird ways of matching
+things into these methods.
+
+The fetch method and its derivatives now accept a limit argument.
+
+You can now pass keyword arguments when calling a Tag object as though
+it were a method.
+
+Fixed a bug that caused all hand-created tags to share a single set of
+attributes.
+
+= 2.0.3 (20050501) =
+
+Fixed Python 2.2 support for iterators.
+
+Fixed a bug that gave the wrong representation to tags within quote
+tags like <script>.
+
+Took some code from Mark Pilgrim that treats CDATA declarations as
+data instead of ignoring them.
+
+Beautiful Soup's setup.py will now do an install even if the unit
+tests fail. It won't build a source distribution if the unit tests
+fail, so I can't release a new version unless they pass.
+
+= 2.0.2 (20050416) =
+
+Added the unit tests in a separate module, and packaged it with
+distutils.
+
+Fixed a bug that sometimes caused renderContents() to return a Unicode
+string even if there was no Unicode in the original string.
+
+Added the done() method, which closes all of the parser's open
+tags. It gets called automatically when you pass in some text to the
+constructor of a parser class; otherwise you must call it yourself.
+
+Reinstated some backwards compatibility with 1.x versions: referencing
+the string member of a NavigableText object returns the NavigableText
+object instead of throwing an error.
+
+= 2.0.1 (20050412) =
+
+Fixed a bug that caused bad results when you tried to reference a tag
+name shorter than 3 characters as a member of a Tag, eg. tag.table.td.
+
+Made sure all Tags have the 'hidden' attribute so that an attempt to
+access tag.hidden doesn't spawn an attempt to find a tag named
+'hidden'.
+
+Fixed a bug in the comparison operator.
+
+= 2.0.0 "Who cares for fish?" (20050410)
+
+Beautiful Soup version 1 was very useful but also pretty stupid. I
+originally wrote it without noticing any of the problems inherent in
+trying to build a parse tree out of ambiguous HTML tags. This version
+solves all of those problems to my satisfaction. It also adds many new
+clever things to make up for the removal of the stupid things.
+
+== Parsing ==
+
+The parser logic has been greatly improved, and the BeautifulSoup
+class should much more reliably yield a parse tree that looks like
+what the page author intended. For a particular class of odd edge
+cases that now causes problems, there is a new class,
+ICantBelieveItsBeautifulSoup.
+
+By default, Beautiful Soup now performs some cleanup operations on
+text before parsing it. This is to avoid common problems with bad
+definitions and self-closing tags that crash SGMLParser. You can
+provide your own set of cleanup operations, or turn it off
+altogether. The cleanup operations include fixing self-closing tags
+that don't close, and replacing Microsoft smart quotes and similar
+characters with their HTML entity equivalents.
+
+You can now get a pretty-print version of parsed HTML to get a visual
+picture of how Beautiful Soup parses it, with the Tag.prettify()
+method.
+
+== Strings and Unicode ==
+
+There are separate NavigableText subclasses for ASCII and Unicode
+strings. These classes directly subclass the corresponding base data
+types. This means you can treat NavigableText objects as strings
+instead of having to call methods on them to get the strings.
+
+str() on a Tag always returns a string, and unicode() always returns
+Unicode. Previously it was inconsistent.
+
+== Tree traversal ==
+
+In a first() or fetch() call, the tag name or the desired value of an
+attribute can now be any of the following:
+
+ * A string (matches that specific tag or that specific attribute value)
+ * A list of strings (matches any tag or attribute value in the list)
+ * A compiled regular expression object (matches any tag or attribute
+ value that matches the regular expression)
+ * A callable object that takes the Tag object or attribute value as a
+ string. It returns None/false/empty string if the given string
+ doesn't match, and any other value if it does.
+
+This is much easier to use than SQL-style wildcards (see, regular
+expressions are good for something). Because of this, I took out
+SQL-style wildcards. I'll put them back if someone complains, but
+their removal simplifies the code a lot.
+
+You can use fetch() and first() to search for text in the parse tree,
+not just tags. There are new alias methods fetchText() and firstText()
+designed for this purpose. As with searching for tags, you can pass in
+a string, a regular expression object, or a method to match your text.
+
+If you pass in something besides a map to the attrs argument of
+fetch() or first(), Beautiful Soup will assume you want to match that
+thing against the "class" attribute. When you're scraping
+well-structured HTML, this makes your code a lot cleaner.
+
+1.x and 2.x both let you call a Tag object as a shorthand for
+fetch(). For instance, foo("bar") is a shorthand for
+foo.fetch("bar"). In 2.x, you can also access a specially-named member
+of a Tag object as a shorthand for first(). For instance, foo.barTag
+is a shorthand for foo.first("bar"). By chaining these shortcuts you
+traverse a tree in very little code: for header in
+soup.bodyTag.pTag.tableTag('th'):
+
+If an element relationship (like parent or next) doesn't apply to a
+tag, it'll now show up Null instead of None. first() will also return
+Null if you ask it for a nonexistent tag. Null is an object that's
+just like None, except you can do whatever you want to it and it'll
+give you Null instead of throwing an error.
+
+This lets you do tree traversals like soup.htmlTag.headTag.titleTag
+without having to worry if the intermediate stages are actually
+there. Previously, if there was no 'head' tag in the document, headTag
+in that instance would have been None, and accessing its 'titleTag'
+member would have thrown an AttributeError. Now, you can get what you
+want when it exists, and get Null when it doesn't, without having to
+do a lot of conditionals checking to see if every stage is None.
+
+There are two new relations between page elements: previousSibling and
+nextSibling. They reference the previous and next element at the same
+level of the parse tree. For instance, if you have HTML like this:
+
+ <p><ul><li>Foo<br /><li>Bar</ul>
+
+The first 'li' tag has a previousSibling of Null and its nextSibling
+is the second 'li' tag. The second 'li' tag has a nextSibling of Null
+and its previousSibling is the first 'li' tag. The previousSibling of
+the 'ul' tag is the first 'p' tag. The nextSibling of 'Foo' is the
+'br' tag.
+
+I took out the ability to use fetch() to find tags that have a
+specific list of contents. See, I can't even explain it well. It was
+really difficult to use, I never used it, and I don't think anyone
+else ever used it. To the extent anyone did, they can probably use
+fetchText() instead. If it turns out someone needs it I'll think of
+another solution.
+
+== Tree manipulation ==
+
+You can add new attributes to a tag, and delete attributes from a
+tag. In 1.x you could only change a tag's existing attributes.
+
+== Porting Considerations ==
+
+There are three changes in 2.0 that break old code:
+
+In the post-1.2 release you could pass in a function into fetch(). The
+function took a string, the tag name. In 2.0, the function takes the
+actual Tag object.
+
+It's no longer to pass in SQL-style wildcards to fetch(). Use a
+regular expression instead.
+
+The different parsing algorithm means the parse tree may not be shaped
+like you expect. This will only actually affect you if your code uses
+one of the affected parts. I haven't run into this problem yet while
+porting my code.
+
+= Between 1.2 and 2.0 =
+
+This is the release to get if you want Python 1.5 compatibility.
+
+The desired value of an attribute can now be any of the following:
+
+ * A string
+ * A string with SQL-style wildcards
+ * A compiled RE object
+ * A callable that returns None/false/empty string if the given value
+ doesn't match, and any other value otherwise.
+
+This is much easier to use than SQL-style wildcards (see, regular
+expressions are good for something). Because of this, I no longer
+recommend you use SQL-style wildcards. They may go away in a future
+release to clean up the code.
+
+Made Beautiful Soup handle processing instructions as text instead of
+ignoring them.
+
+Applied patch from Richie Hindle (richie at entrian dot com) that
+makes tag.string a shorthand for tag.contents[0].string when the tag
+has only one string-owning child.
+
+Added still more nestable tags. The nestable tags thing won't work in
+a lot of cases and needs to be rethought.
+
+Fixed an edge case where searching for "%foo" would match any string
+shorter than "foo".
+
+= 1.2 "Who for such dainties would not stoop?" (20040708) =
+
+Applied patch from Ben Last (ben at benlast dot com) that made
+Tag.renderContents() correctly handle Unicode.
+
+Made BeautifulStoneSoup even dumber by making it not implicitly close
+a tag when another tag of the same type is encountered; only when an
+actual closing tag is encountered. This change courtesy of Fuzzy (mike
+at pcblokes dot com). BeautifulSoup still works as before.
+
+= 1.1 "Swimming in a hot tureen" =
+
+Added more 'nestable' tags. Changed popping semantics so that when a
+nestable tag is encountered, tags are popped up to the previously
+encountered nestable tag (of whatever kind). I will revert this if
+enough people complain, but it should make more people's lives easier
+than harder. This enhancement was suggested by Anthony Baxter (anthony
+at interlink dot com dot au).
+
+= 1.0 "So rich and green" (20040420) =
+
+Initial release.
diff --git a/poky/bitbake/lib/bs4/__init__.py b/poky/bitbake/lib/bs4/__init__.py
new file mode 100644
index 000000000..f6fdfd50b
--- /dev/null
+++ b/poky/bitbake/lib/bs4/__init__.py
@@ -0,0 +1,468 @@
+"""Beautiful Soup
+Elixir and Tonic
+"The Screen-Scraper's Friend"
+http://www.crummy.com/software/BeautifulSoup/
+
+Beautiful Soup uses a pluggable XML or HTML parser to parse a
+(possibly invalid) document into a tree representation. Beautiful Soup
+provides provides methods and Pythonic idioms that make it easy to
+navigate, search, and modify the parse tree.
+
+Beautiful Soup works with Python 2.6 and up. It works better if lxml
+and/or html5lib is installed.
+
+For more than you ever wanted to know about Beautiful Soup, see the
+documentation:
+http://www.crummy.com/software/BeautifulSoup/bs4/doc/
+"""
+
+__author__ = "Leonard Richardson (leonardr@segfault.org)"
+__version__ = "4.4.1"
+__copyright__ = "Copyright (c) 2004-2015 Leonard Richardson"
+__license__ = "MIT"
+
+__all__ = ['BeautifulSoup']
+
+import os
+import re
+import warnings
+
+from .builder import builder_registry, ParserRejectedMarkup
+from .dammit import UnicodeDammit
+from .element import (
+ CData,
+ Comment,
+ DEFAULT_OUTPUT_ENCODING,
+ Declaration,
+ Doctype,
+ NavigableString,
+ PageElement,
+ ProcessingInstruction,
+ ResultSet,
+ SoupStrainer,
+ Tag,
+ )
+
+# The very first thing we do is give a useful error if someone is
+# running this code under Python 3 without converting it.
+'You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.'!='You need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).'
+
+class BeautifulSoup(Tag):
+ """
+ This class defines the basic interface called by the tree builders.
+
+ These methods will be called by the parser:
+ reset()
+ feed(markup)
+
+ The tree builder may call these methods from its feed() implementation:
+ handle_starttag(name, attrs) # See note about return value
+ handle_endtag(name)
+ handle_data(data) # Appends to the current data node
+ endData(containerClass=NavigableString) # Ends the current data node
+
+ No matter how complicated the underlying parser is, you should be
+ able to build a tree using 'start tag' events, 'end tag' events,
+ 'data' events, and "done with data" events.
+
+ If you encounter an empty-element tag (aka a self-closing tag,
+ like HTML's <br> tag), call handle_starttag and then
+ handle_endtag.
+ """
+ ROOT_TAG_NAME = '[document]'
+
+ # If the end-user gives no indication which tree builder they
+ # want, look for one with these features.
+ DEFAULT_BUILDER_FEATURES = ['html', 'fast']
+
+ ASCII_SPACES = '\x20\x0a\x09\x0c\x0d'
+
+ NO_PARSER_SPECIFIED_WARNING = "No parser was explicitly specified, so I'm using the best available %(markup_type)s parser for this system (\"%(parser)s\"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.\n\nTo get rid of this warning, change this:\n\n BeautifulSoup([your markup])\n\nto this:\n\n BeautifulSoup([your markup], \"%(parser)s\")\n"
+
+ def __init__(self, markup="", features=None, builder=None,
+ parse_only=None, from_encoding=None, exclude_encodings=None,
+ **kwargs):
+ """The Soup object is initialized as the 'root tag', and the
+ provided markup (which can be a string or a file-like object)
+ is fed into the underlying parser."""
+
+ if 'convertEntities' in kwargs:
+ warnings.warn(
+ "BS4 does not respect the convertEntities argument to the "
+ "BeautifulSoup constructor. Entities are always converted "
+ "to Unicode characters.")
+
+ if 'markupMassage' in kwargs:
+ del kwargs['markupMassage']
+ warnings.warn(
+ "BS4 does not respect the markupMassage argument to the "
+ "BeautifulSoup constructor. The tree builder is responsible "
+ "for any necessary markup massage.")
+
+ if 'smartQuotesTo' in kwargs:
+ del kwargs['smartQuotesTo']
+ warnings.warn(
+ "BS4 does not respect the smartQuotesTo argument to the "
+ "BeautifulSoup constructor. Smart quotes are always converted "
+ "to Unicode characters.")
+
+ if 'selfClosingTags' in kwargs:
+ del kwargs['selfClosingTags']
+ warnings.warn(
+ "BS4 does not respect the selfClosingTags argument to the "
+ "BeautifulSoup constructor. The tree builder is responsible "
+ "for understanding self-closing tags.")
+
+ if 'isHTML' in kwargs:
+ del kwargs['isHTML']
+ warnings.warn(
+ "BS4 does not respect the isHTML argument to the "
+ "BeautifulSoup constructor. Suggest you use "
+ "features='lxml' for HTML and features='lxml-xml' for "
+ "XML.")
+
+ def deprecated_argument(old_name, new_name):
+ if old_name in kwargs:
+ warnings.warn(
+ 'The "%s" argument to the BeautifulSoup constructor '
+ 'has been renamed to "%s."' % (old_name, new_name))
+ value = kwargs[old_name]
+ del kwargs[old_name]
+ return value
+ return None
+
+ parse_only = parse_only or deprecated_argument(
+ "parseOnlyThese", "parse_only")
+
+ from_encoding = from_encoding or deprecated_argument(
+ "fromEncoding", "from_encoding")
+
+ if len(kwargs) > 0:
+ arg = list(kwargs.keys()).pop()
+ raise TypeError(
+ "__init__() got an unexpected keyword argument '%s'" % arg)
+
+ if builder is None:
+ original_features = features
+ if isinstance(features, str):
+ features = [features]
+ if features is None or len(features) == 0:
+ features = self.DEFAULT_BUILDER_FEATURES
+ builder_class = builder_registry.lookup(*features)
+ if builder_class is None:
+ raise FeatureNotFound(
+ "Couldn't find a tree builder with the features you "
+ "requested: %s. Do you need to install a parser library?"
+ % ",".join(features))
+ builder = builder_class()
+ if not (original_features == builder.NAME or
+ original_features in builder.ALTERNATE_NAMES):
+ if builder.is_xml:
+ markup_type = "XML"
+ else:
+ markup_type = "HTML"
+ warnings.warn(self.NO_PARSER_SPECIFIED_WARNING % dict(
+ parser=builder.NAME,
+ markup_type=markup_type))
+
+ self.builder = builder
+ self.is_xml = builder.is_xml
+ self.builder.soup = self
+
+ self.parse_only = parse_only
+
+ if hasattr(markup, 'read'): # It's a file-type object.
+ markup = markup.read()
+ elif len(markup) <= 256:
+ # Print out warnings for a couple beginner problems
+ # involving passing non-markup to Beautiful Soup.
+ # Beautiful Soup will still parse the input as markup,
+ # just in case that's what the user really wants.
+ if (isinstance(markup, str)
+ and not os.path.supports_unicode_filenames):
+ possible_filename = markup.encode("utf8")
+ else:
+ possible_filename = markup
+ is_file = False
+ try:
+ is_file = os.path.exists(possible_filename)
+ except Exception as e:
+ # This is almost certainly a problem involving
+ # characters not valid in filenames on this
+ # system. Just let it go.
+ pass
+ if is_file:
+ if isinstance(markup, str):
+ markup = markup.encode("utf8")
+ warnings.warn(
+ '"%s" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.' % markup)
+ if markup[:5] == "http:" or markup[:6] == "https:":
+ # TODO: This is ugly but I couldn't get it to work in
+ # Python 3 otherwise.
+ if ((isinstance(markup, bytes) and not b' ' in markup)
+ or (isinstance(markup, str) and not ' ' in markup)):
+ if isinstance(markup, str):
+ markup = markup.encode("utf8")
+ warnings.warn(
+ '"%s" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client to get the document behind the URL, and feed that document to Beautiful Soup.' % markup)
+
+ for (self.markup, self.original_encoding, self.declared_html_encoding,
+ self.contains_replacement_characters) in (
+ self.builder.prepare_markup(
+ markup, from_encoding, exclude_encodings=exclude_encodings)):
+ self.reset()
+ try:
+ self._feed()
+ break
+ except ParserRejectedMarkup:
+ pass
+
+ # Clear out the markup and remove the builder's circular
+ # reference to this object.
+ self.markup = None
+ self.builder.soup = None
+
+ def __copy__(self):
+ return type(self)(self.encode(), builder=self.builder)
+
+ def __getstate__(self):
+ # Frequently a tree builder can't be pickled.
+ d = dict(self.__dict__)
+ if 'builder' in d and not self.builder.picklable:
+ del d['builder']
+ return d
+
+ def _feed(self):
+ # Convert the document to Unicode.
+ self.builder.reset()
+
+ self.builder.feed(self.markup)
+ # Close out any unfinished strings and close all the open tags.
+ self.endData()
+ while self.currentTag.name != self.ROOT_TAG_NAME:
+ self.popTag()
+
+ def reset(self):
+ Tag.__init__(self, self, self.builder, self.ROOT_TAG_NAME)
+ self.hidden = 1
+ self.builder.reset()
+ self.current_data = []
+ self.currentTag = None
+ self.tagStack = []
+ self.preserve_whitespace_tag_stack = []
+ self.pushTag(self)
+
+ def new_tag(self, name, namespace=None, nsprefix=None, **attrs):
+ """Create a new tag associated with this soup."""
+ return Tag(None, self.builder, name, namespace, nsprefix, attrs)
+
+ def new_string(self, s, subclass=NavigableString):
+ """Create a new NavigableString associated with this soup."""
+ return subclass(s)
+
+ def insert_before(self, successor):
+ raise NotImplementedError("BeautifulSoup objects don't support insert_before().")
+
+ def insert_after(self, successor):
+ raise NotImplementedError("BeautifulSoup objects don't support insert_after().")
+
+ def popTag(self):
+ tag = self.tagStack.pop()
+ if self.preserve_whitespace_tag_stack and tag == self.preserve_whitespace_tag_stack[-1]:
+ self.preserve_whitespace_tag_stack.pop()
+ #print "Pop", tag.name
+ if self.tagStack:
+ self.currentTag = self.tagStack[-1]
+ return self.currentTag
+
+ def pushTag(self, tag):
+ #print "Push", tag.name
+ if self.currentTag:
+ self.currentTag.contents.append(tag)
+ self.tagStack.append(tag)
+ self.currentTag = self.tagStack[-1]
+ if tag.name in self.builder.preserve_whitespace_tags:
+ self.preserve_whitespace_tag_stack.append(tag)
+
+ def endData(self, containerClass=NavigableString):
+ if self.current_data:
+ current_data = ''.join(self.current_data)
+ # If whitespace is not preserved, and this string contains
+ # nothing but ASCII spaces, replace it with a single space
+ # or newline.
+ if not self.preserve_whitespace_tag_stack:
+ strippable = True
+ for i in current_data:
+ if i not in self.ASCII_SPACES:
+ strippable = False
+ break
+ if strippable:
+ if '\n' in current_data:
+ current_data = '\n'
+ else:
+ current_data = ' '
+
+ # Reset the data collector.
+ self.current_data = []
+
+ # Should we add this string to the tree at all?
+ if self.parse_only and len(self.tagStack) <= 1 and \
+ (not self.parse_only.text or \
+ not self.parse_only.search(current_data)):
+ return
+
+ o = containerClass(current_data)
+ self.object_was_parsed(o)
+
+ def object_was_parsed(self, o, parent=None, most_recent_element=None):
+ """Add an object to the parse tree."""
+ parent = parent or self.currentTag
+ previous_element = most_recent_element or self._most_recent_element
+
+ next_element = previous_sibling = next_sibling = None
+ if isinstance(o, Tag):
+ next_element = o.next_element
+ next_sibling = o.next_sibling
+ previous_sibling = o.previous_sibling
+ if not previous_element:
+ previous_element = o.previous_element
+
+ o.setup(parent, previous_element, next_element, previous_sibling, next_sibling)
+
+ self._most_recent_element = o
+ parent.contents.append(o)
+
+ if parent.next_sibling:
+ # This node is being inserted into an element that has
+ # already been parsed. Deal with any dangling references.
+ index = parent.contents.index(o)
+ if index == 0:
+ previous_element = parent
+ previous_sibling = None
+ else:
+ previous_element = previous_sibling = parent.contents[index-1]
+ if index == len(parent.contents)-1:
+ next_element = parent.next_sibling
+ next_sibling = None
+ else:
+ next_element = next_sibling = parent.contents[index+1]
+
+ o.previous_element = previous_element
+ if previous_element:
+ previous_element.next_element = o
+ o.next_element = next_element
+ if next_element:
+ next_element.previous_element = o
+ o.next_sibling = next_sibling
+ if next_sibling:
+ next_sibling.previous_sibling = o
+ o.previous_sibling = previous_sibling
+ if previous_sibling:
+ previous_sibling.next_sibling = o
+
+ def _popToTag(self, name, nsprefix=None, inclusivePop=True):
+ """Pops the tag stack up to and including the most recent
+ instance of the given tag. If inclusivePop is false, pops the tag
+ stack up to but *not* including the most recent instqance of
+ the given tag."""
+ #print "Popping to %s" % name
+ if name == self.ROOT_TAG_NAME:
+ # The BeautifulSoup object itself can never be popped.
+ return
+
+ most_recently_popped = None
+
+ stack_size = len(self.tagStack)
+ for i in range(stack_size - 1, 0, -1):
+ t = self.tagStack[i]
+ if (name == t.name and nsprefix == t.prefix):
+ if inclusivePop:
+ most_recently_popped = self.popTag()
+ break
+ most_recently_popped = self.popTag()
+
+ return most_recently_popped
+
+ def handle_starttag(self, name, namespace, nsprefix, attrs):
+ """Push a start tag on to the stack.
+
+ If this method returns None, the tag was rejected by the
+ SoupStrainer. You should proceed as if the tag had not occured
+ in the document. For instance, if this was a self-closing tag,
+ don't call handle_endtag.
+ """
+
+ # print "Start tag %s: %s" % (name, attrs)
+ self.endData()
+
+ if (self.parse_only and len(self.tagStack) <= 1
+ and (self.parse_only.text
+ or not self.parse_only.search_tag(name, attrs))):
+ return None
+
+ tag = Tag(self, self.builder, name, namespace, nsprefix, attrs,
+ self.currentTag, self._most_recent_element)
+ if tag is None:
+ return tag
+ if self._most_recent_element:
+ self._most_recent_element.next_element = tag
+ self._most_recent_element = tag
+ self.pushTag(tag)
+ return tag
+
+ def handle_endtag(self, name, nsprefix=None):
+ #print "End tag: " + name
+ self.endData()
+ self._popToTag(name, nsprefix)
+
+ def handle_data(self, data):
+ self.current_data.append(data)
+
+ def decode(self, pretty_print=False,
+ eventual_encoding=DEFAULT_OUTPUT_ENCODING,
+ formatter="minimal"):
+ """Returns a string or Unicode representation of this document.
+ To get Unicode, pass None for encoding."""
+
+ if self.is_xml:
+ # Print the XML declaration
+ encoding_part = ''
+ if eventual_encoding != None:
+ encoding_part = ' encoding="%s"' % eventual_encoding
+ prefix = '<?xml version="1.0"%s?>\n' % encoding_part
+ else:
+ prefix = ''
+ if not pretty_print:
+ indent_level = None
+ else:
+ indent_level = 0
+ return prefix + super(BeautifulSoup, self).decode(
+ indent_level, eventual_encoding, formatter)
+
+# Alias to make it easier to type import: 'from bs4 import _soup'
+_s = BeautifulSoup
+_soup = BeautifulSoup
+
+class BeautifulStoneSoup(BeautifulSoup):
+ """Deprecated interface to an XML parser."""
+
+ def __init__(self, *args, **kwargs):
+ kwargs['features'] = 'xml'
+ warnings.warn(
+ 'The BeautifulStoneSoup class is deprecated. Instead of using '
+ 'it, pass features="xml" into the BeautifulSoup constructor.')
+ super(BeautifulStoneSoup, self).__init__(*args, **kwargs)
+
+
+class StopParsing(Exception):
+ pass
+
+class FeatureNotFound(ValueError):
+ pass
+
+
+#By default, act as an HTML pretty-printer.
+if __name__ == '__main__':
+ import sys
+ soup = BeautifulSoup(sys.stdin)
+ print(soup.prettify())
diff --git a/poky/bitbake/lib/bs4/builder/__init__.py b/poky/bitbake/lib/bs4/builder/__init__.py
new file mode 100644
index 000000000..6ccd4d23d
--- /dev/null
+++ b/poky/bitbake/lib/bs4/builder/__init__.py
@@ -0,0 +1,324 @@
+from collections import defaultdict
+import itertools
+import sys
+from bs4.element import (
+ CharsetMetaAttributeValue,
+ ContentMetaAttributeValue,
+ whitespace_re
+ )
+
+__all__ = [
+ 'HTMLTreeBuilder',
+ 'SAXTreeBuilder',
+ 'TreeBuilder',
+ 'TreeBuilderRegistry',
+ ]
+
+# Some useful features for a TreeBuilder to have.
+FAST = 'fast'
+PERMISSIVE = 'permissive'
+STRICT = 'strict'
+XML = 'xml'
+HTML = 'html'
+HTML_5 = 'html5'
+
+
+class TreeBuilderRegistry(object):
+
+ def __init__(self):
+ self.builders_for_feature = defaultdict(list)
+ self.builders = []
+
+ def register(self, treebuilder_class):
+ """Register a treebuilder based on its advertised features."""
+ for feature in treebuilder_class.features:
+ self.builders_for_feature[feature].insert(0, treebuilder_class)
+ self.builders.insert(0, treebuilder_class)
+
+ def lookup(self, *features):
+ if len(self.builders) == 0:
+ # There are no builders at all.
+ return None
+
+ if len(features) == 0:
+ # They didn't ask for any features. Give them the most
+ # recently registered builder.
+ return self.builders[0]
+
+ # Go down the list of features in order, and eliminate any builders
+ # that don't match every feature.
+ features = list(features)
+ features.reverse()
+ candidates = None
+ candidate_set = None
+ while len(features) > 0:
+ feature = features.pop()
+ we_have_the_feature = self.builders_for_feature.get(feature, [])
+ if len(we_have_the_feature) > 0:
+ if candidates is None:
+ candidates = we_have_the_feature
+ candidate_set = set(candidates)
+ else:
+ # Eliminate any candidates that don't have this feature.
+ candidate_set = candidate_set.intersection(
+ set(we_have_the_feature))
+
+ # The only valid candidates are the ones in candidate_set.
+ # Go through the original list of candidates and pick the first one
+ # that's in candidate_set.
+ if candidate_set is None:
+ return None
+ for candidate in candidates:
+ if candidate in candidate_set:
+ return candidate
+ return None
+
+# The BeautifulSoup class will take feature lists from developers and use them
+# to look up builders in this registry.
+builder_registry = TreeBuilderRegistry()
+
+class TreeBuilder(object):
+ """Turn a document into a Beautiful Soup object tree."""
+
+ NAME = "[Unknown tree builder]"
+ ALTERNATE_NAMES = []
+ features = []
+
+ is_xml = False
+ picklable = False
+ preserve_whitespace_tags = set()
+ empty_element_tags = None # A tag will be considered an empty-element
+ # tag when and only when it has no contents.
+
+ # A value for these tag/attribute combinations is a space- or
+ # comma-separated list of CDATA, rather than a single CDATA.
+ cdata_list_attributes = {}
+
+
+ def __init__(self):
+ self.soup = None
+
+ def reset(self):
+ pass
+
+ def can_be_empty_element(self, tag_name):
+ """Might a tag with this name be an empty-element tag?
+
+ The final markup may or may not actually present this tag as
+ self-closing.
+
+ For instance: an HTMLBuilder does not consider a <p> tag to be
+ an empty-element tag (it's not in
+ HTMLBuilder.empty_element_tags). This means an empty <p> tag
+ will be presented as "<p></p>", not "<p />".
+
+ The default implementation has no opinion about which tags are
+ empty-element tags, so a tag will be presented as an
+ empty-element tag if and only if it has no contents.
+ "<foo></foo>" will become "<foo />", and "<foo>bar</foo>" will
+ be left alone.
+ """
+ if self.empty_element_tags is None:
+ return True
+ return tag_name in self.empty_element_tags
+
+ def feed(self, markup):
+ raise NotImplementedError()
+
+ def prepare_markup(self, markup, user_specified_encoding=None,
+ document_declared_encoding=None):
+ return markup, None, None, False
+
+ def test_fragment_to_document(self, fragment):
+ """Wrap an HTML fragment to make it look like a document.
+
+ Different parsers do this differently. For instance, lxml
+ introduces an empty <head> tag, and html5lib
+ doesn't. Abstracting this away lets us write simple tests
+ which run HTML fragments through the parser and compare the
+ results against other HTML fragments.
+
+ This method should not be used outside of tests.
+ """
+ return fragment
+
+ def set_up_substitutions(self, tag):
+ return False
+
+ def _replace_cdata_list_attribute_values(self, tag_name, attrs):
+ """Replaces class="foo bar" with class=["foo", "bar"]
+
+ Modifies its input in place.
+ """
+ if not attrs:
+ return attrs
+ if self.cdata_list_attributes:
+ universal = self.cdata_list_attributes.get('*', [])
+ tag_specific = self.cdata_list_attributes.get(
+ tag_name.lower(), None)
+ for attr in list(attrs.keys()):
+ if attr in universal or (tag_specific and attr in tag_specific):
+ # We have a "class"-type attribute whose string
+ # value is a whitespace-separated list of
+ # values. Split it into a list.
+ value = attrs[attr]
+ if isinstance(value, str):
+ values = whitespace_re.split(value)
+ else:
+ # html5lib sometimes calls setAttributes twice
+ # for the same tag when rearranging the parse
+ # tree. On the second call the attribute value
+ # here is already a list. If this happens,
+ # leave the value alone rather than trying to
+ # split it again.
+ values = value
+ attrs[attr] = values
+ return attrs
+
+class SAXTreeBuilder(TreeBuilder):
+ """A Beautiful Soup treebuilder that listens for SAX events."""
+
+ def feed(self, markup):
+ raise NotImplementedError()
+
+ def close(self):
+ pass
+
+ def startElement(self, name, attrs):
+ attrs = dict((key[1], value) for key, value in list(attrs.items()))
+ #print "Start %s, %r" % (name, attrs)
+ self.soup.handle_starttag(name, attrs)
+
+ def endElement(self, name):
+ #print "End %s" % name
+ self.soup.handle_endtag(name)
+
+ def startElementNS(self, nsTuple, nodeName, attrs):
+ # Throw away (ns, nodeName) for now.
+ self.startElement(nodeName, attrs)
+
+ def endElementNS(self, nsTuple, nodeName):
+ # Throw away (ns, nodeName) for now.
+ self.endElement(nodeName)
+ #handler.endElementNS((ns, node.nodeName), node.nodeName)
+
+ def startPrefixMapping(self, prefix, nodeValue):
+ # Ignore the prefix for now.
+ pass
+
+ def endPrefixMapping(self, prefix):
+ # Ignore the prefix for now.
+ # handler.endPrefixMapping(prefix)
+ pass
+
+ def characters(self, content):
+ self.soup.handle_data(content)
+
+ def startDocument(self):
+ pass
+
+ def endDocument(self):
+ pass
+
+
+class HTMLTreeBuilder(TreeBuilder):
+ """This TreeBuilder knows facts about HTML.
+
+ Such as which tags are empty-element tags.
+ """
+
+ preserve_whitespace_tags = set(['pre', 'textarea'])
+ empty_element_tags = set(['br' , 'hr', 'input', 'img', 'meta',
+ 'spacer', 'link', 'frame', 'base'])
+
+ # The HTML standard defines these attributes as containing a
+ # space-separated list of values, not a single value. That is,
+ # class="foo bar" means that the 'class' attribute has two values,
+ # 'foo' and 'bar', not the single value 'foo bar'. When we
+ # encounter one of these attributes, we will parse its value into
+ # a list of values if possible. Upon output, the list will be
+ # converted back into a string.
+ cdata_list_attributes = {
+ "*" : ['class', 'accesskey', 'dropzone'],
+ "a" : ['rel', 'rev'],
+ "link" : ['rel', 'rev'],
+ "td" : ["headers"],
+ "th" : ["headers"],
+ "td" : ["headers"],
+ "form" : ["accept-charset"],
+ "object" : ["archive"],
+
+ # These are HTML5 specific, as are *.accesskey and *.dropzone above.
+ "area" : ["rel"],
+ "icon" : ["sizes"],
+ "iframe" : ["sandbox"],
+ "output" : ["for"],
+ }
+
+ def set_up_substitutions(self, tag):
+ # We are only interested in <meta> tags
+ if tag.name != 'meta':
+ return False
+
+ http_equiv = tag.get('http-equiv')
+ content = tag.get('content')
+ charset = tag.get('charset')
+
+ # We are interested in <meta> tags that say what encoding the
+ # document was originally in. This means HTML 5-style <meta>
+ # tags that provide the "charset" attribute. It also means
+ # HTML 4-style <meta> tags that provide the "content"
+ # attribute and have "http-equiv" set to "content-type".
+ #
+ # In both cases we will replace the value of the appropriate
+ # attribute with a standin object that can take on any
+ # encoding.
+ meta_encoding = None
+ if charset is not None:
+ # HTML 5 style:
+ # <meta charset="utf8">
+ meta_encoding = charset
+ tag['charset'] = CharsetMetaAttributeValue(charset)
+
+ elif (content is not None and http_equiv is not None
+ and http_equiv.lower() == 'content-type'):
+ # HTML 4 style:
+ # <meta http-equiv="content-type" content="text/html; charset=utf8">
+ tag['content'] = ContentMetaAttributeValue(content)
+
+ return (meta_encoding is not None)
+
+def register_treebuilders_from(module):
+ """Copy TreeBuilders from the given module into this module."""
+ # I'm fairly sure this is not the best way to do this.
+ this_module = sys.modules['bs4.builder']
+ for name in module.__all__:
+ obj = getattr(module, name)
+
+ if issubclass(obj, TreeBuilder):
+ setattr(this_module, name, obj)
+ this_module.__all__.append(name)
+ # Register the builder while we're at it.
+ this_module.builder_registry.register(obj)
+
+class ParserRejectedMarkup(Exception):
+ pass
+
+# Builders are registered in reverse order of priority, so that custom
+# builder registrations will take precedence. In general, we want lxml
+# to take precedence over html5lib, because it's faster. And we only
+# want to use HTMLParser as a last result.
+from . import _htmlparser
+register_treebuilders_from(_htmlparser)
+try:
+ from . import _html5lib
+ register_treebuilders_from(_html5lib)
+except ImportError:
+ # They don't have html5lib installed.
+ pass
+try:
+ from . import _lxml
+ register_treebuilders_from(_lxml)
+except ImportError:
+ # They don't have lxml installed.
+ pass
diff --git a/poky/bitbake/lib/bs4/builder/_html5lib.py b/poky/bitbake/lib/bs4/builder/_html5lib.py
new file mode 100644
index 000000000..2b7a70aa1
--- /dev/null
+++ b/poky/bitbake/lib/bs4/builder/_html5lib.py
@@ -0,0 +1,339 @@
+__all__ = [
+ 'HTML5TreeBuilder',
+ ]
+
+from pdb import set_trace
+import warnings
+from bs4.builder import (
+ PERMISSIVE,
+ HTML,
+ HTML_5,
+ HTMLTreeBuilder,
+ )
+from bs4.element import (
+ NamespacedAttribute,
+ whitespace_re,
+)
+import html5lib
+try:
+ # html5lib >= 0.99999999/1.0b9
+ from html5lib.treebuilders import base as treebuildersbase
+except ImportError:
+ # html5lib <= 0.9999999/1.0b8
+ from html5lib.treebuilders import _base as treebuildersbase
+from html5lib.constants import namespaces
+
+from bs4.element import (
+ Comment,
+ Doctype,
+ NavigableString,
+ Tag,
+ )
+
+class HTML5TreeBuilder(HTMLTreeBuilder):
+ """Use html5lib to build a tree."""
+
+ NAME = "html5lib"
+
+ features = [NAME, PERMISSIVE, HTML_5, HTML]
+
+ def prepare_markup(self, markup, user_specified_encoding,
+ document_declared_encoding=None, exclude_encodings=None):
+ # Store the user-specified encoding for use later on.
+ self.user_specified_encoding = user_specified_encoding
+
+ # document_declared_encoding and exclude_encodings aren't used
+ # ATM because the html5lib TreeBuilder doesn't use
+ # UnicodeDammit.
+ if exclude_encodings:
+ warnings.warn("You provided a value for exclude_encoding, but the html5lib tree builder doesn't support exclude_encoding.")
+ yield (markup, None, None, False)
+
+ # These methods are defined by Beautiful Soup.
+ def feed(self, markup):
+ if self.soup.parse_only is not None:
+ warnings.warn("You provided a value for parse_only, but the html5lib tree builder doesn't support parse_only. The entire document will be parsed.")
+ parser = html5lib.HTMLParser(tree=self.create_treebuilder)
+ doc = parser.parse(markup, encoding=self.user_specified_encoding)
+
+ # Set the character encoding detected by the tokenizer.
+ if isinstance(markup, str):
+ # We need to special-case this because html5lib sets
+ # charEncoding to UTF-8 if it gets Unicode input.
+ doc.original_encoding = None
+ else:
+ doc.original_encoding = parser.tokenizer.stream.charEncoding[0]
+
+ def create_treebuilder(self, namespaceHTMLElements):
+ self.underlying_builder = TreeBuilderForHtml5lib(
+ self.soup, namespaceHTMLElements)
+ return self.underlying_builder
+
+ def test_fragment_to_document(self, fragment):
+ """See `TreeBuilder`."""
+ return '<html><head></head><body>%s</body></html>' % fragment
+
+
+class TreeBuilderForHtml5lib(treebuildersbase.TreeBuilder):
+
+ def __init__(self, soup, namespaceHTMLElements):
+ self.soup = soup
+ super(TreeBuilderForHtml5lib, self).__init__(namespaceHTMLElements)
+
+ def documentClass(self):
+ self.soup.reset()
+ return Element(self.soup, self.soup, None)
+
+ def insertDoctype(self, token):
+ name = token["name"]
+ publicId = token["publicId"]
+ systemId = token["systemId"]
+
+ doctype = Doctype.for_name_and_ids(name, publicId, systemId)
+ self.soup.object_was_parsed(doctype)
+
+ def elementClass(self, name, namespace):
+ tag = self.soup.new_tag(name, namespace)
+ return Element(tag, self.soup, namespace)
+
+ def commentClass(self, data):
+ return TextNode(Comment(data), self.soup)
+
+ def fragmentClass(self):
+ self.soup = BeautifulSoup("")
+ self.soup.name = "[document_fragment]"
+ return Element(self.soup, self.soup, None)
+
+ def appendChild(self, node):
+ # XXX This code is not covered by the BS4 tests.
+ self.soup.append(node.element)
+
+ def getDocument(self):
+ return self.soup
+
+ def getFragment(self):
+ return treebuildersbase.TreeBuilder.getFragment(self).element
+
+class AttrList(object):
+ def __init__(self, element):
+ self.element = element
+ self.attrs = dict(self.element.attrs)
+ def __iter__(self):
+ return list(self.attrs.items()).__iter__()
+ def __setitem__(self, name, value):
+ # If this attribute is a multi-valued attribute for this element,
+ # turn its value into a list.
+ list_attr = HTML5TreeBuilder.cdata_list_attributes
+ if (name in list_attr['*']
+ or (self.element.name in list_attr
+ and name in list_attr[self.element.name])):
+ # A node that is being cloned may have already undergone
+ # this procedure.
+ if not isinstance(value, list):
+ value = whitespace_re.split(value)
+ self.element[name] = value
+ def items(self):
+ return list(self.attrs.items())
+ def keys(self):
+ return list(self.attrs.keys())
+ def __len__(self):
+ return len(self.attrs)
+ def __getitem__(self, name):
+ return self.attrs[name]
+ def __contains__(self, name):
+ return name in list(self.attrs.keys())
+
+
+class Element(treebuildersbase.Node):
+ def __init__(self, element, soup, namespace):
+ treebuildersbase.Node.__init__(self, element.name)
+ self.element = element
+ self.soup = soup
+ self.namespace = namespace
+
+ def appendChild(self, node):
+ string_child = child = None
+ if isinstance(node, str):
+ # Some other piece of code decided to pass in a string
+ # instead of creating a TextElement object to contain the
+ # string.
+ string_child = child = node
+ elif isinstance(node, Tag):
+ # Some other piece of code decided to pass in a Tag
+ # instead of creating an Element object to contain the
+ # Tag.
+ child = node
+ elif node.element.__class__ == NavigableString:
+ string_child = child = node.element
+ else:
+ child = node.element
+
+ if not isinstance(child, str) and child.parent is not None:
+ node.element.extract()
+
+ if (string_child and self.element.contents
+ and self.element.contents[-1].__class__ == NavigableString):
+ # We are appending a string onto another string.
+ # TODO This has O(n^2) performance, for input like
+ # "a</a>a</a>a</a>..."
+ old_element = self.element.contents[-1]
+ new_element = self.soup.new_string(old_element + string_child)
+ old_element.replace_with(new_element)
+ self.soup._most_recent_element = new_element
+ else:
+ if isinstance(node, str):
+ # Create a brand new NavigableString from this string.
+ child = self.soup.new_string(node)
+
+ # Tell Beautiful Soup to act as if it parsed this element
+ # immediately after the parent's last descendant. (Or
+ # immediately after the parent, if it has no children.)
+ if self.element.contents:
+ most_recent_element = self.element._last_descendant(False)
+ elif self.element.next_element is not None:
+ # Something from further ahead in the parse tree is
+ # being inserted into this earlier element. This is
+ # very annoying because it means an expensive search
+ # for the last element in the tree.
+ most_recent_element = self.soup._last_descendant()
+ else:
+ most_recent_element = self.element
+
+ self.soup.object_was_parsed(
+ child, parent=self.element,
+ most_recent_element=most_recent_element)
+
+ def getAttributes(self):
+ return AttrList(self.element)
+
+ def setAttributes(self, attributes):
+
+ if attributes is not None and len(attributes) > 0:
+
+ converted_attributes = []
+ for name, value in list(attributes.items()):
+ if isinstance(name, tuple):
+ new_name = NamespacedAttribute(*name)
+ del attributes[name]
+ attributes[new_name] = value
+
+ self.soup.builder._replace_cdata_list_attribute_values(
+ self.name, attributes)
+ for name, value in list(attributes.items()):
+ self.element[name] = value
+
+ # The attributes may contain variables that need substitution.
+ # Call set_up_substitutions manually.
+ #
+ # The Tag constructor called this method when the Tag was created,
+ # but we just set/changed the attributes, so call it again.
+ self.soup.builder.set_up_substitutions(self.element)
+ attributes = property(getAttributes, setAttributes)
+
+ def insertText(self, data, insertBefore=None):
+ if insertBefore:
+ text = TextNode(self.soup.new_string(data), self.soup)
+ self.insertBefore(data, insertBefore)
+ else:
+ self.appendChild(data)
+
+ def insertBefore(self, node, refNode):
+ index = self.element.index(refNode.element)
+ if (node.element.__class__ == NavigableString and self.element.contents
+ and self.element.contents[index-1].__class__ == NavigableString):
+ # (See comments in appendChild)
+ old_node = self.element.contents[index-1]
+ new_str = self.soup.new_string(old_node + node.element)
+ old_node.replace_with(new_str)
+ else:
+ self.element.insert(index, node.element)
+ node.parent = self
+
+ def removeChild(self, node):
+ node.element.extract()
+
+ def reparentChildren(self, new_parent):
+ """Move all of this tag's children into another tag."""
+ # print "MOVE", self.element.contents
+ # print "FROM", self.element
+ # print "TO", new_parent.element
+ element = self.element
+ new_parent_element = new_parent.element
+ # Determine what this tag's next_element will be once all the children
+ # are removed.
+ final_next_element = element.next_sibling
+
+ new_parents_last_descendant = new_parent_element._last_descendant(False, False)
+ if len(new_parent_element.contents) > 0:
+ # The new parent already contains children. We will be
+ # appending this tag's children to the end.
+ new_parents_last_child = new_parent_element.contents[-1]
+ new_parents_last_descendant_next_element = new_parents_last_descendant.next_element
+ else:
+ # The new parent contains no children.
+ new_parents_last_child = None
+ new_parents_last_descendant_next_element = new_parent_element.next_element
+
+ to_append = element.contents
+ append_after = new_parent_element.contents
+ if len(to_append) > 0:
+ # Set the first child's previous_element and previous_sibling
+ # to elements within the new parent
+ first_child = to_append[0]
+ if new_parents_last_descendant:
+ first_child.previous_element = new_parents_last_descendant
+ else:
+ first_child.previous_element = new_parent_element
+ first_child.previous_sibling = new_parents_last_child
+ if new_parents_last_descendant:
+ new_parents_last_descendant.next_element = first_child
+ else:
+ new_parent_element.next_element = first_child
+ if new_parents_last_child:
+ new_parents_last_child.next_sibling = first_child
+
+ # Fix the last child's next_element and next_sibling
+ last_child = to_append[-1]
+ last_child.next_element = new_parents_last_descendant_next_element
+ if new_parents_last_descendant_next_element:
+ new_parents_last_descendant_next_element.previous_element = last_child
+ last_child.next_sibling = None
+
+ for child in to_append:
+ child.parent = new_parent_element
+ new_parent_element.contents.append(child)
+
+ # Now that this element has no children, change its .next_element.
+ element.contents = []
+ element.next_element = final_next_element
+
+ # print "DONE WITH MOVE"
+ # print "FROM", self.element
+ # print "TO", new_parent_element
+
+ def cloneNode(self):
+ tag = self.soup.new_tag(self.element.name, self.namespace)
+ node = Element(tag, self.soup, self.namespace)
+ for key,value in self.attributes:
+ node.attributes[key] = value
+ return node
+
+ def hasContent(self):
+ return self.element.contents
+
+ def getNameTuple(self):
+ if self.namespace == None:
+ return namespaces["html"], self.name
+ else:
+ return self.namespace, self.name
+
+ nameTuple = property(getNameTuple)
+
+class TextNode(Element):
+ def __init__(self, element, soup):
+ treebuildersbase.Node.__init__(self, None)
+ self.element = element
+ self.soup = soup
+
+ def cloneNode(self):
+ raise NotImplementedError
diff --git a/poky/bitbake/lib/bs4/builder/_htmlparser.py b/poky/bitbake/lib/bs4/builder/_htmlparser.py
new file mode 100644
index 000000000..bb0a63f2f
--- /dev/null
+++ b/poky/bitbake/lib/bs4/builder/_htmlparser.py
@@ -0,0 +1,262 @@
+"""Use the HTMLParser library to parse HTML files that aren't too bad."""
+
+__all__ = [
+ 'HTMLParserTreeBuilder',
+ ]
+
+from html.parser import HTMLParser
+
+try:
+ from html.parser import HTMLParseError
+except ImportError as e:
+ # HTMLParseError is removed in Python 3.5. Since it can never be
+ # thrown in 3.5, we can just define our own class as a placeholder.
+ class HTMLParseError(Exception):
+ pass
+
+import sys
+import warnings
+
+# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
+# argument, which we'd like to set to False. Unfortunately,
+# http://bugs.python.org/issue13273 makes strict=True a better bet
+# before Python 3.2.3.
+#
+# At the end of this file, we monkeypatch HTMLParser so that
+# strict=True works well on Python 3.2.2.
+major, minor, release = sys.version_info[:3]
+CONSTRUCTOR_TAKES_STRICT = major == 3 and minor == 2 and release >= 3
+CONSTRUCTOR_STRICT_IS_DEPRECATED = major == 3 and minor == 3
+CONSTRUCTOR_TAKES_CONVERT_CHARREFS = major == 3 and minor >= 4
+
+
+from bs4.element import (
+ CData,
+ Comment,
+ Declaration,
+ Doctype,
+ ProcessingInstruction,
+ )
+from bs4.dammit import EntitySubstitution, UnicodeDammit
+
+from bs4.builder import (
+ HTML,
+ HTMLTreeBuilder,
+ STRICT,
+ )
+
+
+HTMLPARSER = 'html.parser'
+
+class BeautifulSoupHTMLParser(HTMLParser):
+ def handle_starttag(self, name, attrs):
+ # XXX namespace
+ attr_dict = {}
+ for key, value in attrs:
+ # Change None attribute values to the empty string
+ # for consistency with the other tree builders.
+ if value is None:
+ value = ''
+ attr_dict[key] = value
+ attrvalue = '""'
+ self.soup.handle_starttag(name, None, None, attr_dict)
+
+ def handle_endtag(self, name):
+ self.soup.handle_endtag(name)
+
+ def handle_data(self, data):
+ self.soup.handle_data(data)
+
+ def handle_charref(self, name):
+ # XXX workaround for a bug in HTMLParser. Remove this once
+ # it's fixed in all supported versions.
+ # http://bugs.python.org/issue13633
+ if name.startswith('x'):
+ real_name = int(name.lstrip('x'), 16)
+ elif name.startswith('X'):
+ real_name = int(name.lstrip('X'), 16)
+ else:
+ real_name = int(name)
+
+ try:
+ data = chr(real_name)
+ except (ValueError, OverflowError) as e:
+ data = "\N{REPLACEMENT CHARACTER}"
+
+ self.handle_data(data)
+
+ def handle_entityref(self, name):
+ character = EntitySubstitution.HTML_ENTITY_TO_CHARACTER.get(name)
+ if character is not None:
+ data = character
+ else:
+ data = "&%s;" % name
+ self.handle_data(data)
+
+ def handle_comment(self, data):
+ self.soup.endData()
+ self.soup.handle_data(data)
+ self.soup.endData(Comment)
+
+ def handle_decl(self, data):
+ self.soup.endData()
+ if data.startswith("DOCTYPE "):
+ data = data[len("DOCTYPE "):]
+ elif data == 'DOCTYPE':
+ # i.e. "<!DOCTYPE>"
+ data = ''
+ self.soup.handle_data(data)
+ self.soup.endData(Doctype)
+
+ def unknown_decl(self, data):
+ if data.upper().startswith('CDATA['):
+ cls = CData
+ data = data[len('CDATA['):]
+ else:
+ cls = Declaration
+ self.soup.endData()
+ self.soup.handle_data(data)
+ self.soup.endData(cls)
+
+ def handle_pi(self, data):
+ self.soup.endData()
+ self.soup.handle_data(data)
+ self.soup.endData(ProcessingInstruction)
+
+
+class HTMLParserTreeBuilder(HTMLTreeBuilder):
+
+ is_xml = False
+ picklable = True
+ NAME = HTMLPARSER
+ features = [NAME, HTML, STRICT]
+
+ def __init__(self, *args, **kwargs):
+ if CONSTRUCTOR_TAKES_STRICT and not CONSTRUCTOR_STRICT_IS_DEPRECATED:
+ kwargs['strict'] = False
+ if CONSTRUCTOR_TAKES_CONVERT_CHARREFS:
+ kwargs['convert_charrefs'] = False
+ self.parser_args = (args, kwargs)
+
+ def prepare_markup(self, markup, user_specified_encoding=None,
+ document_declared_encoding=None, exclude_encodings=None):
+ """
+ :return: A 4-tuple (markup, original encoding, encoding
+ declared within markup, whether any characters had to be
+ replaced with REPLACEMENT CHARACTER).
+ """
+ if isinstance(markup, str):
+ yield (markup, None, None, False)
+ return
+
+ try_encodings = [user_specified_encoding, document_declared_encoding]
+ dammit = UnicodeDammit(markup, try_encodings, is_html=True,
+ exclude_encodings=exclude_encodings)
+ yield (dammit.markup, dammit.original_encoding,
+ dammit.declared_html_encoding,
+ dammit.contains_replacement_characters)
+
+ def feed(self, markup):
+ args, kwargs = self.parser_args
+ parser = BeautifulSoupHTMLParser(*args, **kwargs)
+ parser.soup = self.soup
+ try:
+ parser.feed(markup)
+ except HTMLParseError as e:
+ warnings.warn(RuntimeWarning(
+ "Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help."))
+ raise e
+
+# Patch 3.2 versions of HTMLParser earlier than 3.2.3 to use some
+# 3.2.3 code. This ensures they don't treat markup like <p></p> as a
+# string.
+#
+# XXX This code can be removed once most Python 3 users are on 3.2.3.
+if major == 3 and minor == 2 and not CONSTRUCTOR_TAKES_STRICT:
+ import re
+ attrfind_tolerant = re.compile(
+ r'\s*((?<=[\'"\s])[^\s/>][^\s/=>]*)(\s*=+\s*'
+ r'(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?')
+ HTMLParserTreeBuilder.attrfind_tolerant = attrfind_tolerant
+
+ locatestarttagend = re.compile(r"""
+ <[a-zA-Z][-.a-zA-Z0-9:_]* # tag name
+ (?:\s+ # whitespace before attribute name
+ (?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name
+ (?:\s*=\s* # value indicator
+ (?:'[^']*' # LITA-enclosed value
+ |\"[^\"]*\" # LIT-enclosed value
+ |[^'\">\s]+ # bare value
+ )
+ )?
+ )
+ )*
+ \s* # trailing whitespace
+""", re.VERBOSE)
+ BeautifulSoupHTMLParser.locatestarttagend = locatestarttagend
+
+ from html.parser import tagfind, attrfind
+
+ def parse_starttag(self, i):
+ self.__starttag_text = None
+ endpos = self.check_for_whole_start_tag(i)
+ if endpos < 0:
+ return endpos
+ rawdata = self.rawdata
+ self.__starttag_text = rawdata[i:endpos]
+
+ # Now parse the data between i+1 and j into a tag and attrs
+ attrs = []
+ match = tagfind.match(rawdata, i+1)
+ assert match, 'unexpected call to parse_starttag()'
+ k = match.end()
+ self.lasttag = tag = rawdata[i+1:k].lower()
+ while k < endpos:
+ if self.strict:
+ m = attrfind.match(rawdata, k)
+ else:
+ m = attrfind_tolerant.match(rawdata, k)
+ if not m:
+ break
+ attrname, rest, attrvalue = m.group(1, 2, 3)
+ if not rest:
+ attrvalue = None
+ elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
+ attrvalue[:1] == '"' == attrvalue[-1:]:
+ attrvalue = attrvalue[1:-1]
+ if attrvalue:
+ attrvalue = self.unescape(attrvalue)
+ attrs.append((attrname.lower(), attrvalue))
+ k = m.end()
+
+ end = rawdata[k:endpos].strip()
+ if end not in (">", "/>"):
+ lineno, offset = self.getpos()
+ if "\n" in self.__starttag_text:
+ lineno = lineno + self.__starttag_text.count("\n")
+ offset = len(self.__starttag_text) \
+ - self.__starttag_text.rfind("\n")
+ else:
+ offset = offset + len(self.__starttag_text)
+ if self.strict:
+ self.error("junk characters in start tag: %r"
+ % (rawdata[k:endpos][:20],))
+ self.handle_data(rawdata[i:endpos])
+ return endpos
+ if end.endswith('/>'):
+ # XHTML-style empty tag: <span attr="value" />
+ self.handle_startendtag(tag, attrs)
+ else:
+ self.handle_starttag(tag, attrs)
+ if tag in self.CDATA_CONTENT_ELEMENTS:
+ self.set_cdata_mode(tag)
+ return endpos
+
+ def set_cdata_mode(self, elem):
+ self.cdata_elem = elem.lower()
+ self.interesting = re.compile(r'</\s*%s\s*>' % self.cdata_elem, re.I)
+
+ BeautifulSoupHTMLParser.parse_starttag = parse_starttag
+ BeautifulSoupHTMLParser.set_cdata_mode = set_cdata_mode
+
+ CONSTRUCTOR_TAKES_STRICT = True
diff --git a/poky/bitbake/lib/bs4/builder/_lxml.py b/poky/bitbake/lib/bs4/builder/_lxml.py
new file mode 100644
index 000000000..9c6c14ee6
--- /dev/null
+++ b/poky/bitbake/lib/bs4/builder/_lxml.py
@@ -0,0 +1,248 @@
+__all__ = [
+ 'LXMLTreeBuilderForXML',
+ 'LXMLTreeBuilder',
+ ]
+
+from io import BytesIO
+from io import StringIO
+import collections
+from lxml import etree
+from bs4.element import (
+ Comment,
+ Doctype,
+ NamespacedAttribute,
+ ProcessingInstruction,
+)
+from bs4.builder import (
+ FAST,
+ HTML,
+ HTMLTreeBuilder,
+ PERMISSIVE,
+ ParserRejectedMarkup,
+ TreeBuilder,
+ XML)
+from bs4.dammit import EncodingDetector
+
+LXML = 'lxml'
+
+class LXMLTreeBuilderForXML(TreeBuilder):
+ DEFAULT_PARSER_CLASS = etree.XMLParser
+
+ is_xml = True
+
+ NAME = "lxml-xml"
+ ALTERNATE_NAMES = ["xml"]
+
+ # Well, it's permissive by XML parser standards.
+ features = [NAME, LXML, XML, FAST, PERMISSIVE]
+
+ CHUNK_SIZE = 512
+
+ # This namespace mapping is specified in the XML Namespace
+ # standard.
+ DEFAULT_NSMAPS = {'http://www.w3.org/XML/1998/namespace' : "xml"}
+
+ def default_parser(self, encoding):
+ # This can either return a parser object or a class, which
+ # will be instantiated with default arguments.
+ if self._default_parser is not None:
+ return self._default_parser
+ return etree.XMLParser(
+ target=self, strip_cdata=False, recover=True, encoding=encoding)
+
+ def parser_for(self, encoding):
+ # Use the default parser.
+ parser = self.default_parser(encoding)
+
+ if isinstance(parser, collections.Callable):
+ # Instantiate the parser with default arguments
+ parser = parser(target=self, strip_cdata=False, encoding=encoding)
+ return parser
+
+ def __init__(self, parser=None, empty_element_tags=None):
+ # TODO: Issue a warning if parser is present but not a
+ # callable, since that means there's no way to create new
+ # parsers for different encodings.
+ self._default_parser = parser
+ if empty_element_tags is not None:
+ self.empty_element_tags = set(empty_element_tags)
+ self.soup = None
+ self.nsmaps = [self.DEFAULT_NSMAPS]
+
+ def _getNsTag(self, tag):
+ # Split the namespace URL out of a fully-qualified lxml tag
+ # name. Copied from lxml's src/lxml/sax.py.
+ if tag[0] == '{':
+ return tuple(tag[1:].split('}', 1))
+ else:
+ return (None, tag)
+
+ def prepare_markup(self, markup, user_specified_encoding=None,
+ exclude_encodings=None,
+ document_declared_encoding=None):
+ """
+ :yield: A series of 4-tuples.
+ (markup, encoding, declared encoding,
+ has undergone character replacement)
+
+ Each 4-tuple represents a strategy for parsing the document.
+ """
+ if isinstance(markup, str):
+ # We were given Unicode. Maybe lxml can parse Unicode on
+ # this system?
+ yield markup, None, document_declared_encoding, False
+
+ if isinstance(markup, str):
+ # No, apparently not. Convert the Unicode to UTF-8 and
+ # tell lxml to parse it as UTF-8.
+ yield (markup.encode("utf8"), "utf8",
+ document_declared_encoding, False)
+
+ # Instead of using UnicodeDammit to convert the bytestring to
+ # Unicode using different encodings, use EncodingDetector to
+ # iterate over the encodings, and tell lxml to try to parse
+ # the document as each one in turn.
+ is_html = not self.is_xml
+ try_encodings = [user_specified_encoding, document_declared_encoding]
+ detector = EncodingDetector(
+ markup, try_encodings, is_html, exclude_encodings)
+ for encoding in detector.encodings:
+ yield (detector.markup, encoding, document_declared_encoding, False)
+
+ def feed(self, markup):
+ if isinstance(markup, bytes):
+ markup = BytesIO(markup)
+ elif isinstance(markup, str):
+ markup = StringIO(markup)
+
+ # Call feed() at least once, even if the markup is empty,
+ # or the parser won't be initialized.
+ data = markup.read(self.CHUNK_SIZE)
+ try:
+ self.parser = self.parser_for(self.soup.original_encoding)
+ self.parser.feed(data)
+ while len(data) != 0:
+ # Now call feed() on the rest of the data, chunk by chunk.
+ data = markup.read(self.CHUNK_SIZE)
+ if len(data) != 0:
+ self.parser.feed(data)
+ self.parser.close()
+ except (UnicodeDecodeError, LookupError, etree.ParserError) as e:
+ raise ParserRejectedMarkup(str(e))
+
+ def close(self):
+ self.nsmaps = [self.DEFAULT_NSMAPS]
+
+ def start(self, name, attrs, nsmap={}):
+ # Make sure attrs is a mutable dict--lxml may send an immutable dictproxy.
+ attrs = dict(attrs)
+ nsprefix = None
+ # Invert each namespace map as it comes in.
+ if len(self.nsmaps) > 1:
+ # There are no new namespaces for this tag, but
+ # non-default namespaces are in play, so we need a
+ # separate tag stack to know when they end.
+ self.nsmaps.append(None)
+ elif len(nsmap) > 0:
+ # A new namespace mapping has come into play.
+ inverted_nsmap = dict((value, key) for key, value in list(nsmap.items()))
+ self.nsmaps.append(inverted_nsmap)
+ # Also treat the namespace mapping as a set of attributes on the
+ # tag, so we can recreate it later.
+ attrs = attrs.copy()
+ for prefix, namespace in list(nsmap.items()):
+ attribute = NamespacedAttribute(
+ "xmlns", prefix, "http://www.w3.org/2000/xmlns/")
+ attrs[attribute] = namespace
+
+ # Namespaces are in play. Find any attributes that came in
+ # from lxml with namespaces attached to their names, and
+ # turn then into NamespacedAttribute objects.
+ new_attrs = {}
+ for attr, value in list(attrs.items()):
+ namespace, attr = self._getNsTag(attr)
+ if namespace is None:
+ new_attrs[attr] = value
+ else:
+ nsprefix = self._prefix_for_namespace(namespace)
+ attr = NamespacedAttribute(nsprefix, attr, namespace)
+ new_attrs[attr] = value
+ attrs = new_attrs
+
+ namespace, name = self._getNsTag(name)
+ nsprefix = self._prefix_for_namespace(namespace)
+ self.soup.handle_starttag(name, namespace, nsprefix, attrs)
+
+ def _prefix_for_namespace(self, namespace):
+ """Find the currently active prefix for the given namespace."""
+ if namespace is None:
+ return None
+ for inverted_nsmap in reversed(self.nsmaps):
+ if inverted_nsmap is not None and namespace in inverted_nsmap:
+ return inverted_nsmap[namespace]
+ return None
+
+ def end(self, name):
+ self.soup.endData()
+ completed_tag = self.soup.tagStack[-1]
+ namespace, name = self._getNsTag(name)
+ nsprefix = None
+ if namespace is not None:
+ for inverted_nsmap in reversed(self.nsmaps):
+ if inverted_nsmap is not None and namespace in inverted_nsmap:
+ nsprefix = inverted_nsmap[namespace]
+ break
+ self.soup.handle_endtag(name, nsprefix)
+ if len(self.nsmaps) > 1:
+ # This tag, or one of its parents, introduced a namespace
+ # mapping, so pop it off the stack.
+ self.nsmaps.pop()
+
+ def pi(self, target, data):
+ self.soup.endData()
+ self.soup.handle_data(target + ' ' + data)
+ self.soup.endData(ProcessingInstruction)
+
+ def data(self, content):
+ self.soup.handle_data(content)
+
+ def doctype(self, name, pubid, system):
+ self.soup.endData()
+ doctype = Doctype.for_name_and_ids(name, pubid, system)
+ self.soup.object_was_parsed(doctype)
+
+ def comment(self, content):
+ "Handle comments as Comment objects."
+ self.soup.endData()
+ self.soup.handle_data(content)
+ self.soup.endData(Comment)
+
+ def test_fragment_to_document(self, fragment):
+ """See `TreeBuilder`."""
+ return '<?xml version="1.0" encoding="utf-8"?>\n%s' % fragment
+
+
+class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML):
+
+ NAME = LXML
+ ALTERNATE_NAMES = ["lxml-html"]
+
+ features = ALTERNATE_NAMES + [NAME, HTML, FAST, PERMISSIVE]
+ is_xml = False
+
+ def default_parser(self, encoding):
+ return etree.HTMLParser
+
+ def feed(self, markup):
+ encoding = self.soup.original_encoding
+ try:
+ self.parser = self.parser_for(encoding)
+ self.parser.feed(markup)
+ self.parser.close()
+ except (UnicodeDecodeError, LookupError, etree.ParserError) as e:
+ raise ParserRejectedMarkup(str(e))
+
+
+ def test_fragment_to_document(self, fragment):
+ """See `TreeBuilder`."""
+ return '<html><body>%s</body></html>' % fragment
diff --git a/poky/bitbake/lib/bs4/dammit.py b/poky/bitbake/lib/bs4/dammit.py
new file mode 100644
index 000000000..68d419feb
--- /dev/null
+++ b/poky/bitbake/lib/bs4/dammit.py
@@ -0,0 +1,840 @@
+# -*- coding: utf-8 -*-
+"""Beautiful Soup bonus library: Unicode, Dammit
+
+This library converts a bytestream to Unicode through any means
+necessary. It is heavily based on code from Mark Pilgrim's Universal
+Feed Parser. It works best on XML and HTML, but it does not rewrite the
+XML or HTML to reflect a new encoding; that's the tree builder's job.
+"""
+__license__ = "MIT"
+
+from pdb import set_trace
+import codecs
+from html.entities import codepoint2name
+import re
+import logging
+import string
+
+# Import a library to autodetect character encodings.
+chardet_type = None
+try:
+ # First try the fast C implementation.
+ # PyPI package: cchardet
+ import cchardet
+ def chardet_dammit(s):
+ return cchardet.detect(s)['encoding']
+except ImportError:
+ try:
+ # Fall back to the pure Python implementation
+ # Debian package: python-chardet
+ # PyPI package: chardet
+ import chardet
+ def chardet_dammit(s):
+ return chardet.detect(s)['encoding']
+ #import chardet.constants
+ #chardet.constants._debug = 1
+ except ImportError:
+ # No chardet available.
+ def chardet_dammit(s):
+ return None
+
+# Available from http://cjkpython.i18n.org/.
+try:
+ import iconv_codec
+except ImportError:
+ pass
+
+xml_encoding_re = re.compile(
+ '^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode(), re.I)
+html_meta_re = re.compile(
+ '<\s*meta[^>]+charset\s*=\s*["\']?([^>]*?)[ /;\'">]'.encode(), re.I)
+
+class EntitySubstitution(object):
+
+ """Substitute XML or HTML entities for the corresponding characters."""
+
+ def _populate_class_variables():
+ lookup = {}
+ reverse_lookup = {}
+ characters_for_re = []
+ for codepoint, name in list(codepoint2name.items()):
+ character = chr(codepoint)
+ if codepoint != 34:
+ # There's no point in turning the quotation mark into
+ # &quot;, unless it happens within an attribute value, which
+ # is handled elsewhere.
+ characters_for_re.append(character)
+ lookup[character] = name
+ # But we do want to turn &quot; into the quotation mark.
+ reverse_lookup[name] = character
+ re_definition = "[%s]" % "".join(characters_for_re)
+ return lookup, reverse_lookup, re.compile(re_definition)
+ (CHARACTER_TO_HTML_ENTITY, HTML_ENTITY_TO_CHARACTER,
+ CHARACTER_TO_HTML_ENTITY_RE) = _populate_class_variables()
+
+ CHARACTER_TO_XML_ENTITY = {
+ "'": "apos",
+ '"': "quot",
+ "&": "amp",
+ "<": "lt",
+ ">": "gt",
+ }
+
+ BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|"
+ "&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)"
+ ")")
+
+ AMPERSAND_OR_BRACKET = re.compile("([<>&])")
+
+ @classmethod
+ def _substitute_html_entity(cls, matchobj):
+ entity = cls.CHARACTER_TO_HTML_ENTITY.get(matchobj.group(0))
+ return "&%s;" % entity
+
+ @classmethod
+ def _substitute_xml_entity(cls, matchobj):
+ """Used with a regular expression to substitute the
+ appropriate XML entity for an XML special character."""
+ entity = cls.CHARACTER_TO_XML_ENTITY[matchobj.group(0)]
+ return "&%s;" % entity
+
+ @classmethod
+ def quoted_attribute_value(self, value):
+ """Make a value into a quoted XML attribute, possibly escaping it.
+
+ Most strings will be quoted using double quotes.
+
+ Bob's Bar -> "Bob's Bar"
+
+ If a string contains double quotes, it will be quoted using
+ single quotes.
+
+ Welcome to "my bar" -> 'Welcome to "my bar"'
+
+ If a string contains both single and double quotes, the
+ double quotes will be escaped, and the string will be quoted
+ using double quotes.
+
+ Welcome to "Bob's Bar" -> "Welcome to &quot;Bob's bar&quot;
+ """
+ quote_with = '"'
+ if '"' in value:
+ if "'" in value:
+ # The string contains both single and double
+ # quotes. Turn the double quotes into
+ # entities. We quote the double quotes rather than
+ # the single quotes because the entity name is
+ # "&quot;" whether this is HTML or XML. If we
+ # quoted the single quotes, we'd have to decide
+ # between &apos; and &squot;.
+ replace_with = "&quot;"
+ value = value.replace('"', replace_with)
+ else:
+ # There are double quotes but no single quotes.
+ # We can use single quotes to quote the attribute.
+ quote_with = "'"
+ return quote_with + value + quote_with
+
+ @classmethod
+ def substitute_xml(cls, value, make_quoted_attribute=False):
+ """Substitute XML entities for special XML characters.
+
+ :param value: A string to be substituted. The less-than sign
+ will become &lt;, the greater-than sign will become &gt;,
+ and any ampersands will become &amp;. If you want ampersands
+ that appear to be part of an entity definition to be left
+ alone, use substitute_xml_containing_entities() instead.
+
+ :param make_quoted_attribute: If True, then the string will be
+ quoted, as befits an attribute value.
+ """
+ # Escape angle brackets and ampersands.
+ value = cls.AMPERSAND_OR_BRACKET.sub(
+ cls._substitute_xml_entity, value)
+
+ if make_quoted_attribute:
+ value = cls.quoted_attribute_value(value)
+ return value
+
+ @classmethod
+ def substitute_xml_containing_entities(
+ cls, value, make_quoted_attribute=False):
+ """Substitute XML entities for special XML characters.
+
+ :param value: A string to be substituted. The less-than sign will
+ become &lt;, the greater-than sign will become &gt;, and any
+ ampersands that are not part of an entity defition will
+ become &amp;.
+
+ :param make_quoted_attribute: If True, then the string will be
+ quoted, as befits an attribute value.
+ """
+ # Escape angle brackets, and ampersands that aren't part of
+ # entities.
+ value = cls.BARE_AMPERSAND_OR_BRACKET.sub(
+ cls._substitute_xml_entity, value)
+
+ if make_quoted_attribute:
+ value = cls.quoted_attribute_value(value)
+ return value
+
+ @classmethod
+ def substitute_html(cls, s):
+ """Replace certain Unicode characters with named HTML entities.
+
+ This differs from data.encode(encoding, 'xmlcharrefreplace')
+ in that the goal is to make the result more readable (to those
+ with ASCII displays) rather than to recover from
+ errors. There's absolutely nothing wrong with a UTF-8 string
+ containg a LATIN SMALL LETTER E WITH ACUTE, but replacing that
+ character with "&eacute;" will make it more readable to some
+ people.
+ """
+ return cls.CHARACTER_TO_HTML_ENTITY_RE.sub(
+ cls._substitute_html_entity, s)
+
+
+class EncodingDetector:
+ """Suggests a number of possible encodings for a bytestring.
+
+ Order of precedence:
+
+ 1. Encodings you specifically tell EncodingDetector to try first
+ (the override_encodings argument to the constructor).
+
+ 2. An encoding declared within the bytestring itself, either in an
+ XML declaration (if the bytestring is to be interpreted as an XML
+ document), or in a <meta> tag (if the bytestring is to be
+ interpreted as an HTML document.)
+
+ 3. An encoding detected through textual analysis by chardet,
+ cchardet, or a similar external library.
+
+ 4. UTF-8.
+
+ 5. Windows-1252.
+ """
+ def __init__(self, markup, override_encodings=None, is_html=False,
+ exclude_encodings=None):
+ self.override_encodings = override_encodings or []
+ exclude_encodings = exclude_encodings or []
+ self.exclude_encodings = set([x.lower() for x in exclude_encodings])
+ self.chardet_encoding = None
+ self.is_html = is_html
+ self.declared_encoding = None
+
+ # First order of business: strip a byte-order mark.
+ self.markup, self.sniffed_encoding = self.strip_byte_order_mark(markup)
+
+ def _usable(self, encoding, tried):
+ if encoding is not None:
+ encoding = encoding.lower()
+ if encoding in self.exclude_encodings:
+ return False
+ if encoding not in tried:
+ tried.add(encoding)
+ return True
+ return False
+
+ @property
+ def encodings(self):
+ """Yield a number of encodings that might work for this markup."""
+ tried = set()
+ for e in self.override_encodings:
+ if self._usable(e, tried):
+ yield e
+
+ # Did the document originally start with a byte-order mark
+ # that indicated its encoding?
+ if self._usable(self.sniffed_encoding, tried):
+ yield self.sniffed_encoding
+
+ # Look within the document for an XML or HTML encoding
+ # declaration.
+ if self.declared_encoding is None:
+ self.declared_encoding = self.find_declared_encoding(
+ self.markup, self.is_html)
+ if self._usable(self.declared_encoding, tried):
+ yield self.declared_encoding
+
+ # Use third-party character set detection to guess at the
+ # encoding.
+ if self.chardet_encoding is None:
+ self.chardet_encoding = chardet_dammit(self.markup)
+ if self._usable(self.chardet_encoding, tried):
+ yield self.chardet_encoding
+
+ # As a last-ditch effort, try utf-8 and windows-1252.
+ for e in ('utf-8', 'windows-1252'):
+ if self._usable(e, tried):
+ yield e
+
+ @classmethod
+ def strip_byte_order_mark(cls, data):
+ """If a byte-order mark is present, strip it and return the encoding it implies."""
+ encoding = None
+ if isinstance(data, str):
+ # Unicode data cannot have a byte-order mark.
+ return data, encoding
+ if (len(data) >= 4) and (data[:2] == b'\xfe\xff') \
+ and (data[2:4] != '\x00\x00'):
+ encoding = 'utf-16be'
+ data = data[2:]
+ elif (len(data) >= 4) and (data[:2] == b'\xff\xfe') \
+ and (data[2:4] != '\x00\x00'):
+ encoding = 'utf-16le'
+ data = data[2:]
+ elif data[:3] == b'\xef\xbb\xbf':
+ encoding = 'utf-8'
+ data = data[3:]
+ elif data[:4] == b'\x00\x00\xfe\xff':
+ encoding = 'utf-32be'
+ data = data[4:]
+ elif data[:4] == b'\xff\xfe\x00\x00':
+ encoding = 'utf-32le'
+ data = data[4:]
+ return data, encoding
+
+ @classmethod
+ def find_declared_encoding(cls, markup, is_html=False, search_entire_document=False):
+ """Given a document, tries to find its declared encoding.
+
+ An XML encoding is declared at the beginning of the document.
+
+ An HTML encoding is declared in a <meta> tag, hopefully near the
+ beginning of the document.
+ """
+ if search_entire_document:
+ xml_endpos = html_endpos = len(markup)
+ else:
+ xml_endpos = 1024
+ html_endpos = max(2048, int(len(markup) * 0.05))
+
+ declared_encoding = None
+ declared_encoding_match = xml_encoding_re.search(markup, endpos=xml_endpos)
+ if not declared_encoding_match and is_html:
+ declared_encoding_match = html_meta_re.search(markup, endpos=html_endpos)
+ if declared_encoding_match is not None:
+ declared_encoding = declared_encoding_match.groups()[0].decode(
+ 'ascii', 'replace')
+ if declared_encoding:
+ return declared_encoding.lower()
+ return None
+
+class UnicodeDammit:
+ """A class for detecting the encoding of a *ML document and
+ converting it to a Unicode string. If the source encoding is
+ windows-1252, can replace MS smart quotes with their HTML or XML
+ equivalents."""
+
+ # This dictionary maps commonly seen values for "charset" in HTML
+ # meta tags to the corresponding Python codec names. It only covers
+ # values that aren't in Python's aliases and can't be determined
+ # by the heuristics in find_codec.
+ CHARSET_ALIASES = {"macintosh": "mac-roman",
+ "x-sjis": "shift-jis"}
+
+ ENCODINGS_WITH_SMART_QUOTES = [
+ "windows-1252",
+ "iso-8859-1",
+ "iso-8859-2",
+ ]
+
+ def __init__(self, markup, override_encodings=[],
+ smart_quotes_to=None, is_html=False, exclude_encodings=[]):
+ self.smart_quotes_to = smart_quotes_to
+ self.tried_encodings = []
+ self.contains_replacement_characters = False
+ self.is_html = is_html
+
+ self.detector = EncodingDetector(
+ markup, override_encodings, is_html, exclude_encodings)
+
+ # Short-circuit if the data is in Unicode to begin with.
+ if isinstance(markup, str) or markup == '':
+ self.markup = markup
+ self.unicode_markup = str(markup)
+ self.original_encoding = None
+ return
+
+ # The encoding detector may have stripped a byte-order mark.
+ # Use the stripped markup from this point on.
+ self.markup = self.detector.markup
+
+ u = None
+ for encoding in self.detector.encodings:
+ markup = self.detector.markup
+ u = self._convert_from(encoding)
+ if u is not None:
+ break
+
+ if not u:
+ # None of the encodings worked. As an absolute last resort,
+ # try them again with character replacement.
+
+ for encoding in self.detector.encodings:
+ if encoding != "ascii":
+ u = self._convert_from(encoding, "replace")
+ if u is not None:
+ logging.warning(
+ "Some characters could not be decoded, and were "
+ "replaced with REPLACEMENT CHARACTER.")
+ self.contains_replacement_characters = True
+ break
+
+ # If none of that worked, we could at this point force it to
+ # ASCII, but that would destroy so much data that I think
+ # giving up is better.
+ self.unicode_markup = u
+ if not u:
+ self.original_encoding = None
+
+ def _sub_ms_char(self, match):
+ """Changes a MS smart quote character to an XML or HTML
+ entity, or an ASCII character."""
+ orig = match.group(1)
+ if self.smart_quotes_to == 'ascii':
+ sub = self.MS_CHARS_TO_ASCII.get(orig).encode()
+ else:
+ sub = self.MS_CHARS.get(orig)
+ if type(sub) == tuple:
+ if self.smart_quotes_to == 'xml':
+ sub = '&#x'.encode() + sub[1].encode() + ';'.encode()
+ else:
+ sub = '&'.encode() + sub[0].encode() + ';'.encode()
+ else:
+ sub = sub.encode()
+ return sub
+
+ def _convert_from(self, proposed, errors="strict"):
+ proposed = self.find_codec(proposed)
+ if not proposed or (proposed, errors) in self.tried_encodings:
+ return None
+ self.tried_encodings.append((proposed, errors))
+ markup = self.markup
+ # Convert smart quotes to HTML if coming from an encoding
+ # that might have them.
+ if (self.smart_quotes_to is not None
+ and proposed in self.ENCODINGS_WITH_SMART_QUOTES):
+ smart_quotes_re = b"([\x80-\x9f])"
+ smart_quotes_compiled = re.compile(smart_quotes_re)
+ markup = smart_quotes_compiled.sub(self._sub_ms_char, markup)
+
+ try:
+ #print "Trying to convert document to %s (errors=%s)" % (
+ # proposed, errors)
+ u = self._to_unicode(markup, proposed, errors)
+ self.markup = u
+ self.original_encoding = proposed
+ except Exception as e:
+ #print "That didn't work!"
+ #print e
+ return None
+ #print "Correct encoding: %s" % proposed
+ return self.markup
+
+ def _to_unicode(self, data, encoding, errors="strict"):
+ '''Given a string and its encoding, decodes the string into Unicode.
+ %encoding is a string recognized by encodings.aliases'''
+ return str(data, encoding, errors)
+
+ @property
+ def declared_html_encoding(self):
+ if not self.is_html:
+ return None
+ return self.detector.declared_encoding
+
+ def find_codec(self, charset):
+ value = (self._codec(self.CHARSET_ALIASES.get(charset, charset))
+ or (charset and self._codec(charset.replace("-", "")))
+ or (charset and self._codec(charset.replace("-", "_")))
+ or (charset and charset.lower())
+ or charset
+ )
+ if value:
+ return value.lower()
+ return None
+
+ def _codec(self, charset):
+ if not charset:
+ return charset
+ codec = None
+ try:
+ codecs.lookup(charset)
+ codec = charset
+ except (LookupError, ValueError):
+ pass
+ return codec
+
+
+ # A partial mapping of ISO-Latin-1 to HTML entities/XML numeric entities.
+ MS_CHARS = {b'\x80': ('euro', '20AC'),
+ b'\x81': ' ',
+ b'\x82': ('sbquo', '201A'),
+ b'\x83': ('fnof', '192'),
+ b'\x84': ('bdquo', '201E'),
+ b'\x85': ('hellip', '2026'),
+ b'\x86': ('dagger', '2020'),
+ b'\x87': ('Dagger', '2021'),
+ b'\x88': ('circ', '2C6'),
+ b'\x89': ('permil', '2030'),
+ b'\x8A': ('Scaron', '160'),
+ b'\x8B': ('lsaquo', '2039'),
+ b'\x8C': ('OElig', '152'),
+ b'\x8D': '?',
+ b'\x8E': ('#x17D', '17D'),
+ b'\x8F': '?',
+ b'\x90': '?',
+ b'\x91': ('lsquo', '2018'),
+ b'\x92': ('rsquo', '2019'),
+ b'\x93': ('ldquo', '201C'),
+ b'\x94': ('rdquo', '201D'),
+ b'\x95': ('bull', '2022'),
+ b'\x96': ('ndash', '2013'),
+ b'\x97': ('mdash', '2014'),
+ b'\x98': ('tilde', '2DC'),
+ b'\x99': ('trade', '2122'),
+ b'\x9a': ('scaron', '161'),
+ b'\x9b': ('rsaquo', '203A'),
+ b'\x9c': ('oelig', '153'),
+ b'\x9d': '?',
+ b'\x9e': ('#x17E', '17E'),
+ b'\x9f': ('Yuml', ''),}
+
+ # A parochial partial mapping of ISO-Latin-1 to ASCII. Contains
+ # horrors like stripping diacritical marks to turn á into a, but also
+ # contains non-horrors like turning “ into ".
+ MS_CHARS_TO_ASCII = {
+ b'\x80' : 'EUR',
+ b'\x81' : ' ',
+ b'\x82' : ',',
+ b'\x83' : 'f',
+ b'\x84' : ',,',
+ b'\x85' : '...',
+ b'\x86' : '+',
+ b'\x87' : '++',
+ b'\x88' : '^',
+ b'\x89' : '%',
+ b'\x8a' : 'S',
+ b'\x8b' : '<',
+ b'\x8c' : 'OE',
+ b'\x8d' : '?',
+ b'\x8e' : 'Z',
+ b'\x8f' : '?',
+ b'\x90' : '?',
+ b'\x91' : "'",
+ b'\x92' : "'",
+ b'\x93' : '"',
+ b'\x94' : '"',
+ b'\x95' : '*',
+ b'\x96' : '-',
+ b'\x97' : '--',
+ b'\x98' : '~',
+ b'\x99' : '(TM)',
+ b'\x9a' : 's',
+ b'\x9b' : '>',
+ b'\x9c' : 'oe',
+ b'\x9d' : '?',
+ b'\x9e' : 'z',
+ b'\x9f' : 'Y',
+ b'\xa0' : ' ',
+ b'\xa1' : '!',
+ b'\xa2' : 'c',
+ b'\xa3' : 'GBP',
+ b'\xa4' : '$', #This approximation is especially parochial--this is the
+ #generic currency symbol.
+ b'\xa5' : 'YEN',
+ b'\xa6' : '|',
+ b'\xa7' : 'S',
+ b'\xa8' : '..',
+ b'\xa9' : '',
+ b'\xaa' : '(th)',
+ b'\xab' : '<<',
+ b'\xac' : '!',
+ b'\xad' : ' ',
+ b'\xae' : '(R)',
+ b'\xaf' : '-',
+ b'\xb0' : 'o',
+ b'\xb1' : '+-',
+ b'\xb2' : '2',
+ b'\xb3' : '3',
+ b'\xb4' : ("'", 'acute'),
+ b'\xb5' : 'u',
+ b'\xb6' : 'P',
+ b'\xb7' : '*',
+ b'\xb8' : ',',
+ b'\xb9' : '1',
+ b'\xba' : '(th)',
+ b'\xbb' : '>>',
+ b'\xbc' : '1/4',
+ b'\xbd' : '1/2',
+ b'\xbe' : '3/4',
+ b'\xbf' : '?',
+ b'\xc0' : 'A',
+ b'\xc1' : 'A',
+ b'\xc2' : 'A',
+ b'\xc3' : 'A',
+ b'\xc4' : 'A',
+ b'\xc5' : 'A',
+ b'\xc6' : 'AE',
+ b'\xc7' : 'C',
+ b'\xc8' : 'E',
+ b'\xc9' : 'E',
+ b'\xca' : 'E',
+ b'\xcb' : 'E',
+ b'\xcc' : 'I',
+ b'\xcd' : 'I',
+ b'\xce' : 'I',
+ b'\xcf' : 'I',
+ b'\xd0' : 'D',
+ b'\xd1' : 'N',
+ b'\xd2' : 'O',
+ b'\xd3' : 'O',
+ b'\xd4' : 'O',
+ b'\xd5' : 'O',
+ b'\xd6' : 'O',
+ b'\xd7' : '*',
+ b'\xd8' : 'O',
+ b'\xd9' : 'U',
+ b'\xda' : 'U',
+ b'\xdb' : 'U',
+ b'\xdc' : 'U',
+ b'\xdd' : 'Y',
+ b'\xde' : 'b',
+ b'\xdf' : 'B',
+ b'\xe0' : 'a',
+ b'\xe1' : 'a',
+ b'\xe2' : 'a',
+ b'\xe3' : 'a',
+ b'\xe4' : 'a',
+ b'\xe5' : 'a',
+ b'\xe6' : 'ae',
+ b'\xe7' : 'c',
+ b'\xe8' : 'e',
+ b'\xe9' : 'e',
+ b'\xea' : 'e',
+ b'\xeb' : 'e',
+ b'\xec' : 'i',
+ b'\xed' : 'i',
+ b'\xee' : 'i',
+ b'\xef' : 'i',
+ b'\xf0' : 'o',
+ b'\xf1' : 'n',
+ b'\xf2' : 'o',
+ b'\xf3' : 'o',
+ b'\xf4' : 'o',
+ b'\xf5' : 'o',
+ b'\xf6' : 'o',
+ b'\xf7' : '/',
+ b'\xf8' : 'o',
+ b'\xf9' : 'u',
+ b'\xfa' : 'u',
+ b'\xfb' : 'u',
+ b'\xfc' : 'u',
+ b'\xfd' : 'y',
+ b'\xfe' : 'b',
+ b'\xff' : 'y',
+ }
+
+ # A map used when removing rogue Windows-1252/ISO-8859-1
+ # characters in otherwise UTF-8 documents.
+ #
+ # Note that \x81, \x8d, \x8f, \x90, and \x9d are undefined in
+ # Windows-1252.
+ WINDOWS_1252_TO_UTF8 = {
+ 0x80 : b'\xe2\x82\xac', # €
+ 0x82 : b'\xe2\x80\x9a', # ‚
+ 0x83 : b'\xc6\x92', # Æ’
+ 0x84 : b'\xe2\x80\x9e', # „
+ 0x85 : b'\xe2\x80\xa6', # …
+ 0x86 : b'\xe2\x80\xa0', # †
+ 0x87 : b'\xe2\x80\xa1', # ‡
+ 0x88 : b'\xcb\x86', # ˆ
+ 0x89 : b'\xe2\x80\xb0', # ‰
+ 0x8a : b'\xc5\xa0', # Å 
+ 0x8b : b'\xe2\x80\xb9', # ‹
+ 0x8c : b'\xc5\x92', # Å’
+ 0x8e : b'\xc5\xbd', # Ž
+ 0x91 : b'\xe2\x80\x98', # ‘
+ 0x92 : b'\xe2\x80\x99', # ’
+ 0x93 : b'\xe2\x80\x9c', # “
+ 0x94 : b'\xe2\x80\x9d', # â€
+ 0x95 : b'\xe2\x80\xa2', # •
+ 0x96 : b'\xe2\x80\x93', # –
+ 0x97 : b'\xe2\x80\x94', # —
+ 0x98 : b'\xcb\x9c', # ˜
+ 0x99 : b'\xe2\x84\xa2', # â„¢
+ 0x9a : b'\xc5\xa1', # Å¡
+ 0x9b : b'\xe2\x80\xba', # ›
+ 0x9c : b'\xc5\x93', # Å“
+ 0x9e : b'\xc5\xbe', # ž
+ 0x9f : b'\xc5\xb8', # Ÿ
+ 0xa0 : b'\xc2\xa0', #  
+ 0xa1 : b'\xc2\xa1', # ¡
+ 0xa2 : b'\xc2\xa2', # ¢
+ 0xa3 : b'\xc2\xa3', # £
+ 0xa4 : b'\xc2\xa4', # ¤
+ 0xa5 : b'\xc2\xa5', # ¥
+ 0xa6 : b'\xc2\xa6', # ¦
+ 0xa7 : b'\xc2\xa7', # §
+ 0xa8 : b'\xc2\xa8', # ¨
+ 0xa9 : b'\xc2\xa9', # ©
+ 0xaa : b'\xc2\xaa', # ª
+ 0xab : b'\xc2\xab', # «
+ 0xac : b'\xc2\xac', # ¬
+ 0xad : b'\xc2\xad', # ­
+ 0xae : b'\xc2\xae', # ®
+ 0xaf : b'\xc2\xaf', # ¯
+ 0xb0 : b'\xc2\xb0', # °
+ 0xb1 : b'\xc2\xb1', # ±
+ 0xb2 : b'\xc2\xb2', # ²
+ 0xb3 : b'\xc2\xb3', # ³
+ 0xb4 : b'\xc2\xb4', # ´
+ 0xb5 : b'\xc2\xb5', # µ
+ 0xb6 : b'\xc2\xb6', # ¶
+ 0xb7 : b'\xc2\xb7', # ·
+ 0xb8 : b'\xc2\xb8', # ¸
+ 0xb9 : b'\xc2\xb9', # ¹
+ 0xba : b'\xc2\xba', # º
+ 0xbb : b'\xc2\xbb', # »
+ 0xbc : b'\xc2\xbc', # ¼
+ 0xbd : b'\xc2\xbd', # ½
+ 0xbe : b'\xc2\xbe', # ¾
+ 0xbf : b'\xc2\xbf', # ¿
+ 0xc0 : b'\xc3\x80', # À
+ 0xc1 : b'\xc3\x81', # Ã
+ 0xc2 : b'\xc3\x82', # Â
+ 0xc3 : b'\xc3\x83', # Ã
+ 0xc4 : b'\xc3\x84', # Ä
+ 0xc5 : b'\xc3\x85', # Ã…
+ 0xc6 : b'\xc3\x86', # Æ
+ 0xc7 : b'\xc3\x87', # Ç
+ 0xc8 : b'\xc3\x88', # È
+ 0xc9 : b'\xc3\x89', # É
+ 0xca : b'\xc3\x8a', # Ê
+ 0xcb : b'\xc3\x8b', # Ë
+ 0xcc : b'\xc3\x8c', # Ì
+ 0xcd : b'\xc3\x8d', # Ã
+ 0xce : b'\xc3\x8e', # ÃŽ
+ 0xcf : b'\xc3\x8f', # Ã
+ 0xd0 : b'\xc3\x90', # Ã
+ 0xd1 : b'\xc3\x91', # Ñ
+ 0xd2 : b'\xc3\x92', # Ã’
+ 0xd3 : b'\xc3\x93', # Ó
+ 0xd4 : b'\xc3\x94', # Ô
+ 0xd5 : b'\xc3\x95', # Õ
+ 0xd6 : b'\xc3\x96', # Ö
+ 0xd7 : b'\xc3\x97', # ×
+ 0xd8 : b'\xc3\x98', # Ø
+ 0xd9 : b'\xc3\x99', # Ù
+ 0xda : b'\xc3\x9a', # Ú
+ 0xdb : b'\xc3\x9b', # Û
+ 0xdc : b'\xc3\x9c', # Ü
+ 0xdd : b'\xc3\x9d', # Ã
+ 0xde : b'\xc3\x9e', # Þ
+ 0xdf : b'\xc3\x9f', # ß
+ 0xe0 : b'\xc3\xa0', # à
+ 0xe1 : b'\xa1', # á
+ 0xe2 : b'\xc3\xa2', # â
+ 0xe3 : b'\xc3\xa3', # ã
+ 0xe4 : b'\xc3\xa4', # ä
+ 0xe5 : b'\xc3\xa5', # å
+ 0xe6 : b'\xc3\xa6', # æ
+ 0xe7 : b'\xc3\xa7', # ç
+ 0xe8 : b'\xc3\xa8', # è
+ 0xe9 : b'\xc3\xa9', # é
+ 0xea : b'\xc3\xaa', # ê
+ 0xeb : b'\xc3\xab', # ë
+ 0xec : b'\xc3\xac', # ì
+ 0xed : b'\xc3\xad', # í
+ 0xee : b'\xc3\xae', # î
+ 0xef : b'\xc3\xaf', # ï
+ 0xf0 : b'\xc3\xb0', # ð
+ 0xf1 : b'\xc3\xb1', # ñ
+ 0xf2 : b'\xc3\xb2', # ò
+ 0xf3 : b'\xc3\xb3', # ó
+ 0xf4 : b'\xc3\xb4', # ô
+ 0xf5 : b'\xc3\xb5', # õ
+ 0xf6 : b'\xc3\xb6', # ö
+ 0xf7 : b'\xc3\xb7', # ÷
+ 0xf8 : b'\xc3\xb8', # ø
+ 0xf9 : b'\xc3\xb9', # ù
+ 0xfa : b'\xc3\xba', # ú
+ 0xfb : b'\xc3\xbb', # û
+ 0xfc : b'\xc3\xbc', # ü
+ 0xfd : b'\xc3\xbd', # ý
+ 0xfe : b'\xc3\xbe', # þ
+ }
+
+ MULTIBYTE_MARKERS_AND_SIZES = [
+ (0xc2, 0xdf, 2), # 2-byte characters start with a byte C2-DF
+ (0xe0, 0xef, 3), # 3-byte characters start with E0-EF
+ (0xf0, 0xf4, 4), # 4-byte characters start with F0-F4
+ ]
+
+ FIRST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[0][0]
+ LAST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[-1][1]
+
+ @classmethod
+ def detwingle(cls, in_bytes, main_encoding="utf8",
+ embedded_encoding="windows-1252"):
+ """Fix characters from one encoding embedded in some other encoding.
+
+ Currently the only situation supported is Windows-1252 (or its
+ subset ISO-8859-1), embedded in UTF-8.
+
+ The input must be a bytestring. If you've already converted
+ the document to Unicode, you're too late.
+
+ The output is a bytestring in which `embedded_encoding`
+ characters have been converted to their `main_encoding`
+ equivalents.
+ """
+ if embedded_encoding.replace('_', '-').lower() not in (
+ 'windows-1252', 'windows_1252'):
+ raise NotImplementedError(
+ "Windows-1252 and ISO-8859-1 are the only currently supported "
+ "embedded encodings.")
+
+ if main_encoding.lower() not in ('utf8', 'utf-8'):
+ raise NotImplementedError(
+ "UTF-8 is the only currently supported main encoding.")
+
+ byte_chunks = []
+
+ chunk_start = 0
+ pos = 0
+ while pos < len(in_bytes):
+ byte = in_bytes[pos]
+ if not isinstance(byte, int):
+ # Python 2.x
+ byte = ord(byte)
+ if (byte >= cls.FIRST_MULTIBYTE_MARKER
+ and byte <= cls.LAST_MULTIBYTE_MARKER):
+ # This is the start of a UTF-8 multibyte character. Skip
+ # to the end.
+ for start, end, size in cls.MULTIBYTE_MARKERS_AND_SIZES:
+ if byte >= start and byte <= end:
+ pos += size
+ break
+ elif byte >= 0x80 and byte in cls.WINDOWS_1252_TO_UTF8:
+ # We found a Windows-1252 character!
+ # Save the string up to this point as a chunk.
+ byte_chunks.append(in_bytes[chunk_start:pos])
+
+ # Now translate the Windows-1252 character into UTF-8
+ # and add it as another, one-byte chunk.
+ byte_chunks.append(cls.WINDOWS_1252_TO_UTF8[byte])
+ pos += 1
+ chunk_start = pos
+ else:
+ # Go on to the next character.
+ pos += 1
+ if chunk_start == 0:
+ # The string is unchanged.
+ return in_bytes
+ else:
+ # Store the final chunk.
+ byte_chunks.append(in_bytes[chunk_start:])
+ return b''.join(byte_chunks)
+
diff --git a/poky/bitbake/lib/bs4/diagnose.py b/poky/bitbake/lib/bs4/diagnose.py
new file mode 100644
index 000000000..083395fb4
--- /dev/null
+++ b/poky/bitbake/lib/bs4/diagnose.py
@@ -0,0 +1,216 @@
+"""Diagnostic functions, mainly for use when doing tech support."""
+
+__license__ = "MIT"
+
+import cProfile
+from io import StringIO
+from html.parser import HTMLParser
+import bs4
+from bs4 import BeautifulSoup, __version__
+from bs4.builder import builder_registry
+
+import os
+import pstats
+import random
+import tempfile
+import time
+import traceback
+import sys
+import cProfile
+
+def diagnose(data):
+ """Diagnostic suite for isolating common problems."""
+ print("Diagnostic running on Beautiful Soup %s" % __version__)
+ print("Python version %s" % sys.version)
+
+ basic_parsers = ["html.parser", "html5lib", "lxml"]
+ for name in basic_parsers:
+ for builder in builder_registry.builders:
+ if name in builder.features:
+ break
+ else:
+ basic_parsers.remove(name)
+ print((
+ "I noticed that %s is not installed. Installing it may help." %
+ name))
+
+ if 'lxml' in basic_parsers:
+ basic_parsers.append(["lxml", "xml"])
+ try:
+ from lxml import etree
+ print("Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION)))
+ except ImportError as e:
+ print (
+ "lxml is not installed or couldn't be imported.")
+
+
+ if 'html5lib' in basic_parsers:
+ try:
+ import html5lib
+ print("Found html5lib version %s" % html5lib.__version__)
+ except ImportError as e:
+ print (
+ "html5lib is not installed or couldn't be imported.")
+
+ if hasattr(data, 'read'):
+ data = data.read()
+ elif os.path.exists(data):
+ print('"%s" looks like a filename. Reading data from the file.' % data)
+ data = open(data).read()
+ elif data.startswith("http:") or data.startswith("https:"):
+ print('"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data)
+ print("You need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.")
+ return
+ print()
+
+ for parser in basic_parsers:
+ print("Trying to parse your markup with %s" % parser)
+ success = False
+ try:
+ soup = BeautifulSoup(data, parser)
+ success = True
+ except Exception as e:
+ print("%s could not parse the markup." % parser)
+ traceback.print_exc()
+ if success:
+ print("Here's what %s did with the markup:" % parser)
+ print(soup.prettify())
+
+ print("-" * 80)
+
+def lxml_trace(data, html=True, **kwargs):
+ """Print out the lxml events that occur during parsing.
+
+ This lets you see how lxml parses a document when no Beautiful
+ Soup code is running.
+ """
+ from lxml import etree
+ for event, element in etree.iterparse(StringIO(data), html=html, **kwargs):
+ print(("%s, %4s, %s" % (event, element.tag, element.text)))
+
+class AnnouncingParser(HTMLParser):
+ """Announces HTMLParser parse events, without doing anything else."""
+
+ def _p(self, s):
+ print(s)
+
+ def handle_starttag(self, name, attrs):
+ self._p("%s START" % name)
+
+ def handle_endtag(self, name):
+ self._p("%s END" % name)
+
+ def handle_data(self, data):
+ self._p("%s DATA" % data)
+
+ def handle_charref(self, name):
+ self._p("%s CHARREF" % name)
+
+ def handle_entityref(self, name):
+ self._p("%s ENTITYREF" % name)
+
+ def handle_comment(self, data):
+ self._p("%s COMMENT" % data)
+
+ def handle_decl(self, data):
+ self._p("%s DECL" % data)
+
+ def unknown_decl(self, data):
+ self._p("%s UNKNOWN-DECL" % data)
+
+ def handle_pi(self, data):
+ self._p("%s PI" % data)
+
+def htmlparser_trace(data):
+ """Print out the HTMLParser events that occur during parsing.
+
+ This lets you see how HTMLParser parses a document when no
+ Beautiful Soup code is running.
+ """
+ parser = AnnouncingParser()
+ parser.feed(data)
+
+_vowels = "aeiou"
+_consonants = "bcdfghjklmnpqrstvwxyz"
+
+def rword(length=5):
+ "Generate a random word-like string."
+ s = ''
+ for i in range(length):
+ if i % 2 == 0:
+ t = _consonants
+ else:
+ t = _vowels
+ s += random.choice(t)
+ return s
+
+def rsentence(length=4):
+ "Generate a random sentence-like string."
+ return " ".join(rword(random.randint(4,9)) for i in range(length))
+
+def rdoc(num_elements=1000):
+ """Randomly generate an invalid HTML document."""
+ tag_names = ['p', 'div', 'span', 'i', 'b', 'script', 'table']
+ elements = []
+ for i in range(num_elements):
+ choice = random.randint(0,3)
+ if choice == 0:
+ # New tag.
+ tag_name = random.choice(tag_names)
+ elements.append("<%s>" % tag_name)
+ elif choice == 1:
+ elements.append(rsentence(random.randint(1,4)))
+ elif choice == 2:
+ # Close a tag.
+ tag_name = random.choice(tag_names)
+ elements.append("</%s>" % tag_name)
+ return "<html>" + "\n".join(elements) + "</html>"
+
+def benchmark_parsers(num_elements=100000):
+ """Very basic head-to-head performance benchmark."""
+ print("Comparative parser benchmark on Beautiful Soup %s" % __version__)
+ data = rdoc(num_elements)
+ print("Generated a large invalid HTML document (%d bytes)." % len(data))
+
+ for parser in ["lxml", ["lxml", "html"], "html5lib", "html.parser"]:
+ success = False
+ try:
+ a = time.time()
+ soup = BeautifulSoup(data, parser)
+ b = time.time()
+ success = True
+ except Exception as e:
+ print("%s could not parse the markup." % parser)
+ traceback.print_exc()
+ if success:
+ print("BS4+%s parsed the markup in %.2fs." % (parser, b-a))
+
+ from lxml import etree
+ a = time.time()
+ etree.HTML(data)
+ b = time.time()
+ print("Raw lxml parsed the markup in %.2fs." % (b-a))
+
+ import html5lib
+ parser = html5lib.HTMLParser()
+ a = time.time()
+ parser.parse(data)
+ b = time.time()
+ print("Raw html5lib parsed the markup in %.2fs." % (b-a))
+
+def profile(num_elements=100000, parser="lxml"):
+
+ filehandle = tempfile.NamedTemporaryFile()
+ filename = filehandle.name
+
+ data = rdoc(num_elements)
+ vars = dict(bs4=bs4, data=data, parser=parser)
+ cProfile.runctx('bs4.BeautifulSoup(data, parser)' , vars, vars, filename)
+
+ stats = pstats.Stats(filename)
+ # stats.strip_dirs()
+ stats.sort_stats("cumulative")
+ stats.print_stats('_html5lib|bs4', 50)
+
+if __name__ == '__main__':
+ diagnose(sys.stdin.read())
diff --git a/poky/bitbake/lib/bs4/element.py b/poky/bitbake/lib/bs4/element.py
new file mode 100644
index 000000000..0e62c2e10
--- /dev/null
+++ b/poky/bitbake/lib/bs4/element.py
@@ -0,0 +1,1725 @@
+__license__ = "MIT"
+
+from pdb import set_trace
+import collections
+import re
+import sys
+import warnings
+from bs4.dammit import EntitySubstitution
+
+DEFAULT_OUTPUT_ENCODING = "utf-8"
+PY3K = (sys.version_info[0] > 2)
+
+whitespace_re = re.compile("\s+")
+
+def _alias(attr):
+ """Alias one attribute name to another for backward compatibility"""
+ @property
+ def alias(self):
+ return getattr(self, attr)
+
+ @alias.setter
+ def alias(self):
+ return setattr(self, attr)
+ return alias
+
+
+class NamespacedAttribute(str):
+
+ def __new__(cls, prefix, name, namespace=None):
+ if name is None:
+ obj = str.__new__(cls, prefix)
+ elif prefix is None:
+ # Not really namespaced.
+ obj = str.__new__(cls, name)
+ else:
+ obj = str.__new__(cls, prefix + ":" + name)
+ obj.prefix = prefix
+ obj.name = name
+ obj.namespace = namespace
+ return obj
+
+class AttributeValueWithCharsetSubstitution(str):
+ """A stand-in object for a character encoding specified in HTML."""
+
+class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution):
+ """A generic stand-in for the value of a meta tag's 'charset' attribute.
+
+ When Beautiful Soup parses the markup '<meta charset="utf8">', the
+ value of the 'charset' attribute will be one of these objects.
+ """
+
+ def __new__(cls, original_value):
+ obj = str.__new__(cls, original_value)
+ obj.original_value = original_value
+ return obj
+
+ def encode(self, encoding):
+ return encoding
+
+
+class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution):
+ """A generic stand-in for the value of a meta tag's 'content' attribute.
+
+ When Beautiful Soup parses the markup:
+ <meta http-equiv="content-type" content="text/html; charset=utf8">
+
+ The value of the 'content' attribute will be one of these objects.
+ """
+
+ CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M)
+
+ def __new__(cls, original_value):
+ match = cls.CHARSET_RE.search(original_value)
+ if match is None:
+ # No substitution necessary.
+ return str.__new__(str, original_value)
+
+ obj = str.__new__(cls, original_value)
+ obj.original_value = original_value
+ return obj
+
+ def encode(self, encoding):
+ def rewrite(match):
+ return match.group(1) + encoding
+ return self.CHARSET_RE.sub(rewrite, self.original_value)
+
+class HTMLAwareEntitySubstitution(EntitySubstitution):
+
+ """Entity substitution rules that are aware of some HTML quirks.
+
+ Specifically, the contents of <script> and <style> tags should not
+ undergo entity substitution.
+
+ Incoming NavigableString objects are checked to see if they're the
+ direct children of a <script> or <style> tag.
+ """
+
+ cdata_containing_tags = set(["script", "style"])
+
+ preformatted_tags = set(["pre"])
+
+ @classmethod
+ def _substitute_if_appropriate(cls, ns, f):
+ if (isinstance(ns, NavigableString)
+ and ns.parent is not None
+ and ns.parent.name in cls.cdata_containing_tags):
+ # Do nothing.
+ return ns
+ # Substitute.
+ return f(ns)
+
+ @classmethod
+ def substitute_html(cls, ns):
+ return cls._substitute_if_appropriate(
+ ns, EntitySubstitution.substitute_html)
+
+ @classmethod
+ def substitute_xml(cls, ns):
+ return cls._substitute_if_appropriate(
+ ns, EntitySubstitution.substitute_xml)
+
+class PageElement(object):
+ """Contains the navigational information for some part of the page
+ (either a tag or a piece of text)"""
+
+ # There are five possible values for the "formatter" argument passed in
+ # to methods like encode() and prettify():
+ #
+ # "html" - All Unicode characters with corresponding HTML entities
+ # are converted to those entities on output.
+ # "minimal" - Bare ampersands and angle brackets are converted to
+ # XML entities: &amp; &lt; &gt;
+ # None - The null formatter. Unicode characters are never
+ # converted to entities. This is not recommended, but it's
+ # faster than "minimal".
+ # A function - This function will be called on every string that
+ # needs to undergo entity substitution.
+ #
+
+ # In an HTML document, the default "html" and "minimal" functions
+ # will leave the contents of <script> and <style> tags alone. For
+ # an XML document, all tags will be given the same treatment.
+
+ HTML_FORMATTERS = {
+ "html" : HTMLAwareEntitySubstitution.substitute_html,
+ "minimal" : HTMLAwareEntitySubstitution.substitute_xml,
+ None : None
+ }
+
+ XML_FORMATTERS = {
+ "html" : EntitySubstitution.substitute_html,
+ "minimal" : EntitySubstitution.substitute_xml,
+ None : None
+ }
+
+ def format_string(self, s, formatter='minimal'):
+ """Format the given string using the given formatter."""
+ if not isinstance(formatter, collections.Callable):
+ formatter = self._formatter_for_name(formatter)
+ if formatter is None:
+ output = s
+ else:
+ output = formatter(s)
+ return output
+
+ @property
+ def _is_xml(self):
+ """Is this element part of an XML tree or an HTML tree?
+
+ This is used when mapping a formatter name ("minimal") to an
+ appropriate function (one that performs entity-substitution on
+ the contents of <script> and <style> tags, or not). It's
+ inefficient, but it should be called very rarely.
+ """
+ if self.parent is None:
+ # This is the top-level object. It should have .is_xml set
+ # from tree creation. If not, take a guess--BS is usually
+ # used on HTML markup.
+ return getattr(self, 'is_xml', False)
+ return self.parent._is_xml
+
+ def _formatter_for_name(self, name):
+ "Look up a formatter function based on its name and the tree."
+ if self._is_xml:
+ return self.XML_FORMATTERS.get(
+ name, EntitySubstitution.substitute_xml)
+ else:
+ return self.HTML_FORMATTERS.get(
+ name, HTMLAwareEntitySubstitution.substitute_xml)
+
+ def setup(self, parent=None, previous_element=None, next_element=None,
+ previous_sibling=None, next_sibling=None):
+ """Sets up the initial relations between this element and
+ other elements."""
+ self.parent = parent
+
+ self.previous_element = previous_element
+ if previous_element is not None:
+ self.previous_element.next_element = self
+
+ self.next_element = next_element
+ if self.next_element:
+ self.next_element.previous_element = self
+
+ self.next_sibling = next_sibling
+ if self.next_sibling:
+ self.next_sibling.previous_sibling = self
+
+ if (not previous_sibling
+ and self.parent is not None and self.parent.contents):
+ previous_sibling = self.parent.contents[-1]
+
+ self.previous_sibling = previous_sibling
+ if previous_sibling:
+ self.previous_sibling.next_sibling = self
+
+ nextSibling = _alias("next_sibling") # BS3
+ previousSibling = _alias("previous_sibling") # BS3
+
+ def replace_with(self, replace_with):
+ if not self.parent:
+ raise ValueError(
+ "Cannot replace one element with another when the"
+ "element to be replaced is not part of a tree.")
+ if replace_with is self:
+ return
+ if replace_with is self.parent:
+ raise ValueError("Cannot replace a Tag with its parent.")
+ old_parent = self.parent
+ my_index = self.parent.index(self)
+ self.extract()
+ old_parent.insert(my_index, replace_with)
+ return self
+ replaceWith = replace_with # BS3
+
+ def unwrap(self):
+ my_parent = self.parent
+ if not self.parent:
+ raise ValueError(
+ "Cannot replace an element with its contents when that"
+ "element is not part of a tree.")
+ my_index = self.parent.index(self)
+ self.extract()
+ for child in reversed(self.contents[:]):
+ my_parent.insert(my_index, child)
+ return self
+ replace_with_children = unwrap
+ replaceWithChildren = unwrap # BS3
+
+ def wrap(self, wrap_inside):
+ me = self.replace_with(wrap_inside)
+ wrap_inside.append(me)
+ return wrap_inside
+
+ def extract(self):
+ """Destructively rips this element out of the tree."""
+ if self.parent is not None:
+ del self.parent.contents[self.parent.index(self)]
+
+ #Find the two elements that would be next to each other if
+ #this element (and any children) hadn't been parsed. Connect
+ #the two.
+ last_child = self._last_descendant()
+ next_element = last_child.next_element
+
+ if (self.previous_element is not None and
+ self.previous_element is not next_element):
+ self.previous_element.next_element = next_element
+ if next_element is not None and next_element is not self.previous_element:
+ next_element.previous_element = self.previous_element
+ self.previous_element = None
+ last_child.next_element = None
+
+ self.parent = None
+ if (self.previous_sibling is not None
+ and self.previous_sibling is not self.next_sibling):
+ self.previous_sibling.next_sibling = self.next_sibling
+ if (self.next_sibling is not None
+ and self.next_sibling is not self.previous_sibling):
+ self.next_sibling.previous_sibling = self.previous_sibling
+ self.previous_sibling = self.next_sibling = None
+ return self
+
+ def _last_descendant(self, is_initialized=True, accept_self=True):
+ "Finds the last element beneath this object to be parsed."
+ if is_initialized and self.next_sibling:
+ last_child = self.next_sibling.previous_element
+ else:
+ last_child = self
+ while isinstance(last_child, Tag) and last_child.contents:
+ last_child = last_child.contents[-1]
+ if not accept_self and last_child is self:
+ last_child = None
+ return last_child
+ # BS3: Not part of the API!
+ _lastRecursiveChild = _last_descendant
+
+ def insert(self, position, new_child):
+ if new_child is None:
+ raise ValueError("Cannot insert None into a tag.")
+ if new_child is self:
+ raise ValueError("Cannot insert a tag into itself.")
+ if (isinstance(new_child, str)
+ and not isinstance(new_child, NavigableString)):
+ new_child = NavigableString(new_child)
+
+ position = min(position, len(self.contents))
+ if hasattr(new_child, 'parent') and new_child.parent is not None:
+ # We're 'inserting' an element that's already one
+ # of this object's children.
+ if new_child.parent is self:
+ current_index = self.index(new_child)
+ if current_index < position:
+ # We're moving this element further down the list
+ # of this object's children. That means that when
+ # we extract this element, our target index will
+ # jump down one.
+ position -= 1
+ new_child.extract()
+
+ new_child.parent = self
+ previous_child = None
+ if position == 0:
+ new_child.previous_sibling = None
+ new_child.previous_element = self
+ else:
+ previous_child = self.contents[position - 1]
+ new_child.previous_sibling = previous_child
+ new_child.previous_sibling.next_sibling = new_child
+ new_child.previous_element = previous_child._last_descendant(False)
+ if new_child.previous_element is not None:
+ new_child.previous_element.next_element = new_child
+
+ new_childs_last_element = new_child._last_descendant(False)
+
+ if position >= len(self.contents):
+ new_child.next_sibling = None
+
+ parent = self
+ parents_next_sibling = None
+ while parents_next_sibling is None and parent is not None:
+ parents_next_sibling = parent.next_sibling
+ parent = parent.parent
+ if parents_next_sibling is not None:
+ # We found the element that comes next in the document.
+ break
+ if parents_next_sibling is not None:
+ new_childs_last_element.next_element = parents_next_sibling
+ else:
+ # The last element of this tag is the last element in
+ # the document.
+ new_childs_last_element.next_element = None
+ else:
+ next_child = self.contents[position]
+ new_child.next_sibling = next_child
+ if new_child.next_sibling is not None:
+ new_child.next_sibling.previous_sibling = new_child
+ new_childs_last_element.next_element = next_child
+
+ if new_childs_last_element.next_element is not None:
+ new_childs_last_element.next_element.previous_element = new_childs_last_element
+ self.contents.insert(position, new_child)
+
+ def append(self, tag):
+ """Appends the given tag to the contents of this tag."""
+ self.insert(len(self.contents), tag)
+
+ def insert_before(self, predecessor):
+ """Makes the given element the immediate predecessor of this one.
+
+ The two elements will have the same parent, and the given element
+ will be immediately before this one.
+ """
+ if self is predecessor:
+ raise ValueError("Can't insert an element before itself.")
+ parent = self.parent
+ if parent is None:
+ raise ValueError(
+ "Element has no parent, so 'before' has no meaning.")
+ # Extract first so that the index won't be screwed up if they
+ # are siblings.
+ if isinstance(predecessor, PageElement):
+ predecessor.extract()
+ index = parent.index(self)
+ parent.insert(index, predecessor)
+
+ def insert_after(self, successor):
+ """Makes the given element the immediate successor of this one.
+
+ The two elements will have the same parent, and the given element
+ will be immediately after this one.
+ """
+ if self is successor:
+ raise ValueError("Can't insert an element after itself.")
+ parent = self.parent
+ if parent is None:
+ raise ValueError(
+ "Element has no parent, so 'after' has no meaning.")
+ # Extract first so that the index won't be screwed up if they
+ # are siblings.
+ if isinstance(successor, PageElement):
+ successor.extract()
+ index = parent.index(self)
+ parent.insert(index+1, successor)
+
+ def find_next(self, name=None, attrs={}, text=None, **kwargs):
+ """Returns the first item that matches the given criteria and
+ appears after this Tag in the document."""
+ return self._find_one(self.find_all_next, name, attrs, text, **kwargs)
+ findNext = find_next # BS3
+
+ def find_all_next(self, name=None, attrs={}, text=None, limit=None,
+ **kwargs):
+ """Returns all items that match the given criteria and appear
+ after this Tag in the document."""
+ return self._find_all(name, attrs, text, limit, self.next_elements,
+ **kwargs)
+ findAllNext = find_all_next # BS3
+
+ def find_next_sibling(self, name=None, attrs={}, text=None, **kwargs):
+ """Returns the closest sibling to this Tag that matches the
+ given criteria and appears after this Tag in the document."""
+ return self._find_one(self.find_next_siblings, name, attrs, text,
+ **kwargs)
+ findNextSibling = find_next_sibling # BS3
+
+ def find_next_siblings(self, name=None, attrs={}, text=None, limit=None,
+ **kwargs):
+ """Returns the siblings of this Tag that match the given
+ criteria and appear after this Tag in the document."""
+ return self._find_all(name, attrs, text, limit,
+ self.next_siblings, **kwargs)
+ findNextSiblings = find_next_siblings # BS3
+ fetchNextSiblings = find_next_siblings # BS2
+
+ def find_previous(self, name=None, attrs={}, text=None, **kwargs):
+ """Returns the first item that matches the given criteria and
+ appears before this Tag in the document."""
+ return self._find_one(
+ self.find_all_previous, name, attrs, text, **kwargs)
+ findPrevious = find_previous # BS3
+
+ def find_all_previous(self, name=None, attrs={}, text=None, limit=None,
+ **kwargs):
+ """Returns all items that match the given criteria and appear
+ before this Tag in the document."""
+ return self._find_all(name, attrs, text, limit, self.previous_elements,
+ **kwargs)
+ findAllPrevious = find_all_previous # BS3
+ fetchPrevious = find_all_previous # BS2
+
+ def find_previous_sibling(self, name=None, attrs={}, text=None, **kwargs):
+ """Returns the closest sibling to this Tag that matches the
+ given criteria and appears before this Tag in the document."""
+ return self._find_one(self.find_previous_siblings, name, attrs, text,
+ **kwargs)
+ findPreviousSibling = find_previous_sibling # BS3
+
+ def find_previous_siblings(self, name=None, attrs={}, text=None,
+ limit=None, **kwargs):
+ """Returns the siblings of this Tag that match the given
+ criteria and appear before this Tag in the document."""
+ return self._find_all(name, attrs, text, limit,
+ self.previous_siblings, **kwargs)
+ findPreviousSiblings = find_previous_siblings # BS3
+ fetchPreviousSiblings = find_previous_siblings # BS2
+
+ def find_parent(self, name=None, attrs={}, **kwargs):
+ """Returns the closest parent of this Tag that matches the given
+ criteria."""
+ # NOTE: We can't use _find_one because findParents takes a different
+ # set of arguments.
+ r = None
+ l = self.find_parents(name, attrs, 1, **kwargs)
+ if l:
+ r = l[0]
+ return r
+ findParent = find_parent # BS3
+
+ def find_parents(self, name=None, attrs={}, limit=None, **kwargs):
+ """Returns the parents of this Tag that match the given
+ criteria."""
+
+ return self._find_all(name, attrs, None, limit, self.parents,
+ **kwargs)
+ findParents = find_parents # BS3
+ fetchParents = find_parents # BS2
+
+ @property
+ def next(self):
+ return self.next_element
+
+ @property
+ def previous(self):
+ return self.previous_element
+
+ #These methods do the real heavy lifting.
+
+ def _find_one(self, method, name, attrs, text, **kwargs):
+ r = None
+ l = method(name, attrs, text, 1, **kwargs)
+ if l:
+ r = l[0]
+ return r
+
+ def _find_all(self, name, attrs, text, limit, generator, **kwargs):
+ "Iterates over a generator looking for things that match."
+
+ if text is None and 'string' in kwargs:
+ text = kwargs['string']
+ del kwargs['string']
+
+ if isinstance(name, SoupStrainer):
+ strainer = name
+ else:
+ strainer = SoupStrainer(name, attrs, text, **kwargs)
+
+ if text is None and not limit and not attrs and not kwargs:
+ if name is True or name is None:
+ # Optimization to find all tags.
+ result = (element for element in generator
+ if isinstance(element, Tag))
+ return ResultSet(strainer, result)
+ elif isinstance(name, str):
+ # Optimization to find all tags with a given name.
+ result = (element for element in generator
+ if isinstance(element, Tag)
+ and element.name == name)
+ return ResultSet(strainer, result)
+ results = ResultSet(strainer)
+ while True:
+ try:
+ i = next(generator)
+ except StopIteration:
+ break
+ if i:
+ found = strainer.search(i)
+ if found:
+ results.append(found)
+ if limit and len(results) >= limit:
+ break
+ return results
+
+ #These generators can be used to navigate starting from both
+ #NavigableStrings and Tags.
+ @property
+ def next_elements(self):
+ i = self.next_element
+ while i is not None:
+ yield i
+ i = i.next_element
+
+ @property
+ def next_siblings(self):
+ i = self.next_sibling
+ while i is not None:
+ yield i
+ i = i.next_sibling
+
+ @property
+ def previous_elements(self):
+ i = self.previous_element
+ while i is not None:
+ yield i
+ i = i.previous_element
+
+ @property
+ def previous_siblings(self):
+ i = self.previous_sibling
+ while i is not None:
+ yield i
+ i = i.previous_sibling
+
+ @property
+ def parents(self):
+ i = self.parent
+ while i is not None:
+ yield i
+ i = i.parent
+
+ # Methods for supporting CSS selectors.
+
+ tag_name_re = re.compile('^[a-zA-Z0-9][-.a-zA-Z0-9:_]*$')
+
+ # /^([a-zA-Z0-9][-.a-zA-Z0-9:_]*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
+ # \---------------------------/ \---/\-------------/ \-------/
+ # | | | |
+ # | | | The value
+ # | | ~,|,^,$,* or =
+ # | Attribute
+ # Tag
+ attribselect_re = re.compile(
+ r'^(?P<tag>[a-zA-Z0-9][-.a-zA-Z0-9:_]*)?\[(?P<attribute>[\w-]+)(?P<operator>[=~\|\^\$\*]?)' +
+ r'=?"?(?P<value>[^\]"]*)"?\]$'
+ )
+
+ def _attr_value_as_string(self, value, default=None):
+ """Force an attribute value into a string representation.
+
+ A multi-valued attribute will be converted into a
+ space-separated stirng.
+ """
+ value = self.get(value, default)
+ if isinstance(value, list) or isinstance(value, tuple):
+ value =" ".join(value)
+ return value
+
+ def _tag_name_matches_and(self, function, tag_name):
+ if not tag_name:
+ return function
+ else:
+ def _match(tag):
+ return tag.name == tag_name and function(tag)
+ return _match
+
+ def _attribute_checker(self, operator, attribute, value=''):
+ """Create a function that performs a CSS selector operation.
+
+ Takes an operator, attribute and optional value. Returns a
+ function that will return True for elements that match that
+ combination.
+ """
+ if operator == '=':
+ # string representation of `attribute` is equal to `value`
+ return lambda el: el._attr_value_as_string(attribute) == value
+ elif operator == '~':
+ # space-separated list representation of `attribute`
+ # contains `value`
+ def _includes_value(element):
+ attribute_value = element.get(attribute, [])
+ if not isinstance(attribute_value, list):
+ attribute_value = attribute_value.split()
+ return value in attribute_value
+ return _includes_value
+ elif operator == '^':
+ # string representation of `attribute` starts with `value`
+ return lambda el: el._attr_value_as_string(
+ attribute, '').startswith(value)
+ elif operator == '$':
+ # string represenation of `attribute` ends with `value`
+ return lambda el: el._attr_value_as_string(
+ attribute, '').endswith(value)
+ elif operator == '*':
+ # string representation of `attribute` contains `value`
+ return lambda el: value in el._attr_value_as_string(attribute, '')
+ elif operator == '|':
+ # string representation of `attribute` is either exactly
+ # `value` or starts with `value` and then a dash.
+ def _is_or_starts_with_dash(element):
+ attribute_value = element._attr_value_as_string(attribute, '')
+ return (attribute_value == value or attribute_value.startswith(
+ value + '-'))
+ return _is_or_starts_with_dash
+ else:
+ return lambda el: el.has_attr(attribute)
+
+ # Old non-property versions of the generators, for backwards
+ # compatibility with BS3.
+ def nextGenerator(self):
+ return self.next_elements
+
+ def nextSiblingGenerator(self):
+ return self.next_siblings
+
+ def previousGenerator(self):
+ return self.previous_elements
+
+ def previousSiblingGenerator(self):
+ return self.previous_siblings
+
+ def parentGenerator(self):
+ return self.parents
+
+
+class NavigableString(str, PageElement):
+
+ PREFIX = ''
+ SUFFIX = ''
+
+ def __new__(cls, value):
+ """Create a new NavigableString.
+
+ When unpickling a NavigableString, this method is called with
+ the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be
+ passed in to the superclass's __new__ or the superclass won't know
+ how to handle non-ASCII characters.
+ """
+ if isinstance(value, str):
+ u = str.__new__(cls, value)
+ else:
+ u = str.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
+ u.setup()
+ return u
+
+ def __copy__(self):
+ """A copy of a NavigableString has the same contents and class
+ as the original, but it is not connected to the parse tree.
+ """
+ return type(self)(self)
+
+ def __getnewargs__(self):
+ return (str(self),)
+
+ def __getattr__(self, attr):
+ """text.string gives you text. This is for backwards
+ compatibility for Navigable*String, but for CData* it lets you
+ get the string without the CData wrapper."""
+ if attr == 'string':
+ return self
+ else:
+ raise AttributeError(
+ "'%s' object has no attribute '%s'" % (
+ self.__class__.__name__, attr))
+
+ def output_ready(self, formatter="minimal"):
+ output = self.format_string(self, formatter)
+ return self.PREFIX + output + self.SUFFIX
+
+ @property
+ def name(self):
+ return None
+
+ @name.setter
+ def name(self, name):
+ raise AttributeError("A NavigableString cannot be given a name.")
+
+class PreformattedString(NavigableString):
+ """A NavigableString not subject to the normal formatting rules.
+
+ The string will be passed into the formatter (to trigger side effects),
+ but the return value will be ignored.
+ """
+
+ def output_ready(self, formatter="minimal"):
+ """CData strings are passed into the formatter.
+ But the return value is ignored."""
+ self.format_string(self, formatter)
+ return self.PREFIX + self + self.SUFFIX
+
+class CData(PreformattedString):
+
+ PREFIX = '<![CDATA['
+ SUFFIX = ']]>'
+
+class ProcessingInstruction(PreformattedString):
+
+ PREFIX = '<?'
+ SUFFIX = '>'
+
+class Comment(PreformattedString):
+
+ PREFIX = '<!--'
+ SUFFIX = '-->'
+
+
+class Declaration(PreformattedString):
+ PREFIX = '<?'
+ SUFFIX = '?>'
+
+
+class Doctype(PreformattedString):
+
+ @classmethod
+ def for_name_and_ids(cls, name, pub_id, system_id):
+ value = name or ''
+ if pub_id is not None:
+ value += ' PUBLIC "%s"' % pub_id
+ if system_id is not None:
+ value += ' "%s"' % system_id
+ elif system_id is not None:
+ value += ' SYSTEM "%s"' % system_id
+
+ return Doctype(value)
+
+ PREFIX = '<!DOCTYPE '
+ SUFFIX = '>\n'
+
+
+class Tag(PageElement):
+
+ """Represents a found HTML tag with its attributes and contents."""
+
+ def __init__(self, parser=None, builder=None, name=None, namespace=None,
+ prefix=None, attrs=None, parent=None, previous=None):
+ "Basic constructor."
+
+ if parser is None:
+ self.parser_class = None
+ else:
+ # We don't actually store the parser object: that lets extracted
+ # chunks be garbage-collected.
+ self.parser_class = parser.__class__
+ if name is None:
+ raise ValueError("No value provided for new tag's name.")
+ self.name = name
+ self.namespace = namespace
+ self.prefix = prefix
+ if attrs is None:
+ attrs = {}
+ elif attrs:
+ if builder is not None and builder.cdata_list_attributes:
+ attrs = builder._replace_cdata_list_attribute_values(
+ self.name, attrs)
+ else:
+ attrs = dict(attrs)
+ else:
+ attrs = dict(attrs)
+ self.attrs = attrs
+ self.contents = []
+ self.setup(parent, previous)
+ self.hidden = False
+
+ # Set up any substitutions, such as the charset in a META tag.
+ if builder is not None:
+ builder.set_up_substitutions(self)
+ self.can_be_empty_element = builder.can_be_empty_element(name)
+ else:
+ self.can_be_empty_element = False
+
+ parserClass = _alias("parser_class") # BS3
+
+ def __copy__(self):
+ """A copy of a Tag is a new Tag, unconnected to the parse tree.
+ Its contents are a copy of the old Tag's contents.
+ """
+ clone = type(self)(None, self.builder, self.name, self.namespace,
+ self.nsprefix, self.attrs)
+ for attr in ('can_be_empty_element', 'hidden'):
+ setattr(clone, attr, getattr(self, attr))
+ for child in self.contents:
+ clone.append(child.__copy__())
+ return clone
+
+ @property
+ def is_empty_element(self):
+ """Is this tag an empty-element tag? (aka a self-closing tag)
+
+ A tag that has contents is never an empty-element tag.
+
+ A tag that has no contents may or may not be an empty-element
+ tag. It depends on the builder used to create the tag. If the
+ builder has a designated list of empty-element tags, then only
+ a tag whose name shows up in that list is considered an
+ empty-element tag.
+
+ If the builder has no designated list of empty-element tags,
+ then any tag with no contents is an empty-element tag.
+ """
+ return len(self.contents) == 0 and self.can_be_empty_element
+ isSelfClosing = is_empty_element # BS3
+
+ @property
+ def string(self):
+ """Convenience property to get the single string within this tag.
+
+ :Return: If this tag has a single string child, return value
+ is that string. If this tag has no children, or more than one
+ child, return value is None. If this tag has one child tag,
+ return value is the 'string' attribute of the child tag,
+ recursively.
+ """
+ if len(self.contents) != 1:
+ return None
+ child = self.contents[0]
+ if isinstance(child, NavigableString):
+ return child
+ return child.string
+
+ @string.setter
+ def string(self, string):
+ self.clear()
+ self.append(string.__class__(string))
+
+ def _all_strings(self, strip=False, types=(NavigableString, CData)):
+ """Yield all strings of certain classes, possibly stripping them.
+
+ By default, yields only NavigableString and CData objects. So
+ no comments, processing instructions, etc.
+ """
+ for descendant in self.descendants:
+ if (
+ (types is None and not isinstance(descendant, NavigableString))
+ or
+ (types is not None and type(descendant) not in types)):
+ continue
+ if strip:
+ descendant = descendant.strip()
+ if len(descendant) == 0:
+ continue
+ yield descendant
+
+ strings = property(_all_strings)
+
+ @property
+ def stripped_strings(self):
+ for string in self._all_strings(True):
+ yield string
+
+ def get_text(self, separator="", strip=False,
+ types=(NavigableString, CData)):
+ """
+ Get all child strings, concatenated using the given separator.
+ """
+ return separator.join([s for s in self._all_strings(
+ strip, types=types)])
+ getText = get_text
+ text = property(get_text)
+
+ def decompose(self):
+ """Recursively destroys the contents of this tree."""
+ self.extract()
+ i = self
+ while i is not None:
+ next = i.next_element
+ i.__dict__.clear()
+ i.contents = []
+ i = next
+
+ def clear(self, decompose=False):
+ """
+ Extract all children. If decompose is True, decompose instead.
+ """
+ if decompose:
+ for element in self.contents[:]:
+ if isinstance(element, Tag):
+ element.decompose()
+ else:
+ element.extract()
+ else:
+ for element in self.contents[:]:
+ element.extract()
+
+ def index(self, element):
+ """
+ Find the index of a child by identity, not value. Avoids issues with
+ tag.contents.index(element) getting the index of equal elements.
+ """
+ for i, child in enumerate(self.contents):
+ if child is element:
+ return i
+ raise ValueError("Tag.index: element not in tag")
+
+ def get(self, key, default=None):
+ """Returns the value of the 'key' attribute for the tag, or
+ the value given for 'default' if it doesn't have that
+ attribute."""
+ return self.attrs.get(key, default)
+
+ def has_attr(self, key):
+ return key in self.attrs
+
+ def __hash__(self):
+ return str(self).__hash__()
+
+ def __getitem__(self, key):
+ """tag[key] returns the value of the 'key' attribute for the tag,
+ and throws an exception if it's not there."""
+ return self.attrs[key]
+
+ def __iter__(self):
+ "Iterating over a tag iterates over its contents."
+ return iter(self.contents)
+
+ def __len__(self):
+ "The length of a tag is the length of its list of contents."
+ return len(self.contents)
+
+ def __contains__(self, x):
+ return x in self.contents
+
+ def __bool__(self):
+ "A tag is non-None even if it has no contents."
+ return True
+
+ def __setitem__(self, key, value):
+ """Setting tag[key] sets the value of the 'key' attribute for the
+ tag."""
+ self.attrs[key] = value
+
+ def __delitem__(self, key):
+ "Deleting tag[key] deletes all 'key' attributes for the tag."
+ self.attrs.pop(key, None)
+
+ def __call__(self, *args, **kwargs):
+ """Calling a tag like a function is the same as calling its
+ find_all() method. Eg. tag('a') returns a list of all the A tags
+ found within this tag."""
+ return self.find_all(*args, **kwargs)
+
+ def __getattr__(self, tag):
+ #print "Getattr %s.%s" % (self.__class__, tag)
+ if len(tag) > 3 and tag.endswith('Tag'):
+ # BS3: soup.aTag -> "soup.find("a")
+ tag_name = tag[:-3]
+ warnings.warn(
+ '.%sTag is deprecated, use .find("%s") instead.' % (
+ tag_name, tag_name))
+ return self.find(tag_name)
+ # We special case contents to avoid recursion.
+ elif not tag.startswith("__") and not tag=="contents":
+ return self.find(tag)
+ raise AttributeError(
+ "'%s' object has no attribute '%s'" % (self.__class__, tag))
+
+ def __eq__(self, other):
+ """Returns true iff this tag has the same name, the same attributes,
+ and the same contents (recursively) as the given tag."""
+ if self is other:
+ return True
+ if (not hasattr(other, 'name') or
+ not hasattr(other, 'attrs') or
+ not hasattr(other, 'contents') or
+ self.name != other.name or
+ self.attrs != other.attrs or
+ len(self) != len(other)):
+ return False
+ for i, my_child in enumerate(self.contents):
+ if my_child != other.contents[i]:
+ return False
+ return True
+
+ def __ne__(self, other):
+ """Returns true iff this tag is not identical to the other tag,
+ as defined in __eq__."""
+ return not self == other
+
+ def __repr__(self, encoding="unicode-escape"):
+ """Renders this tag as a string."""
+ if PY3K:
+ # "The return value must be a string object", i.e. Unicode
+ return self.decode()
+ else:
+ # "The return value must be a string object", i.e. a bytestring.
+ # By convention, the return value of __repr__ should also be
+ # an ASCII string.
+ return self.encode(encoding)
+
+ def __unicode__(self):
+ return self.decode()
+
+ def __str__(self):
+ if PY3K:
+ return self.decode()
+ else:
+ return self.encode()
+
+ if PY3K:
+ __str__ = __repr__ = __unicode__
+
+ def encode(self, encoding=DEFAULT_OUTPUT_ENCODING,
+ indent_level=None, formatter="minimal",
+ errors="xmlcharrefreplace"):
+ # Turn the data structure into Unicode, then encode the
+ # Unicode.
+ u = self.decode(indent_level, encoding, formatter)
+ return u.encode(encoding, errors)
+
+ def _should_pretty_print(self, indent_level):
+ """Should this tag be pretty-printed?"""
+ return (
+ indent_level is not None and
+ (self.name not in HTMLAwareEntitySubstitution.preformatted_tags
+ or self._is_xml))
+
+ def decode(self, indent_level=None,
+ eventual_encoding=DEFAULT_OUTPUT_ENCODING,
+ formatter="minimal"):
+ """Returns a Unicode representation of this tag and its contents.
+
+ :param eventual_encoding: The tag is destined to be
+ encoded into this encoding. This method is _not_
+ responsible for performing that encoding. This information
+ is passed in so that it can be substituted in if the
+ document contains a <META> tag that mentions the document's
+ encoding.
+ """
+
+ # First off, turn a string formatter into a function. This
+ # will stop the lookup from happening over and over again.
+ if not isinstance(formatter, collections.Callable):
+ formatter = self._formatter_for_name(formatter)
+
+ attrs = []
+ if self.attrs:
+ for key, val in sorted(self.attrs.items()):
+ if val is None:
+ decoded = key
+ else:
+ if isinstance(val, list) or isinstance(val, tuple):
+ val = ' '.join(val)
+ elif not isinstance(val, str):
+ val = str(val)
+ elif (
+ isinstance(val, AttributeValueWithCharsetSubstitution)
+ and eventual_encoding is not None):
+ val = val.encode(eventual_encoding)
+
+ text = self.format_string(val, formatter)
+ decoded = (
+ str(key) + '='
+ + EntitySubstitution.quoted_attribute_value(text))
+ attrs.append(decoded)
+ close = ''
+ closeTag = ''
+
+ prefix = ''
+ if self.prefix:
+ prefix = self.prefix + ":"
+
+ if self.is_empty_element:
+ close = '/'
+ else:
+ closeTag = '</%s%s>' % (prefix, self.name)
+
+ pretty_print = self._should_pretty_print(indent_level)
+ space = ''
+ indent_space = ''
+ if indent_level is not None:
+ indent_space = (' ' * (indent_level - 1))
+ if pretty_print:
+ space = indent_space
+ indent_contents = indent_level + 1
+ else:
+ indent_contents = None
+ contents = self.decode_contents(
+ indent_contents, eventual_encoding, formatter)
+
+ if self.hidden:
+ # This is the 'document root' object.
+ s = contents
+ else:
+ s = []
+ attribute_string = ''
+ if attrs:
+ attribute_string = ' ' + ' '.join(attrs)
+ if indent_level is not None:
+ # Even if this particular tag is not pretty-printed,
+ # we should indent up to the start of the tag.
+ s.append(indent_space)
+ s.append('<%s%s%s%s>' % (
+ prefix, self.name, attribute_string, close))
+ if pretty_print:
+ s.append("\n")
+ s.append(contents)
+ if pretty_print and contents and contents[-1] != "\n":
+ s.append("\n")
+ if pretty_print and closeTag:
+ s.append(space)
+ s.append(closeTag)
+ if indent_level is not None and closeTag and self.next_sibling:
+ # Even if this particular tag is not pretty-printed,
+ # we're now done with the tag, and we should add a
+ # newline if appropriate.
+ s.append("\n")
+ s = ''.join(s)
+ return s
+
+ def prettify(self, encoding=None, formatter="minimal"):
+ if encoding is None:
+ return self.decode(True, formatter=formatter)
+ else:
+ return self.encode(encoding, True, formatter=formatter)
+
+ def decode_contents(self, indent_level=None,
+ eventual_encoding=DEFAULT_OUTPUT_ENCODING,
+ formatter="minimal"):
+ """Renders the contents of this tag as a Unicode string.
+
+ :param indent_level: Each line of the rendering will be
+ indented this many spaces.
+
+ :param eventual_encoding: The tag is destined to be
+ encoded into this encoding. This method is _not_
+ responsible for performing that encoding. This information
+ is passed in so that it can be substituted in if the
+ document contains a <META> tag that mentions the document's
+ encoding.
+
+ :param formatter: The output formatter responsible for converting
+ entities to Unicode characters.
+ """
+ # First off, turn a string formatter into a function. This
+ # will stop the lookup from happening over and over again.
+ if not isinstance(formatter, collections.Callable):
+ formatter = self._formatter_for_name(formatter)
+
+ pretty_print = (indent_level is not None)
+ s = []
+ for c in self:
+ text = None
+ if isinstance(c, NavigableString):
+ text = c.output_ready(formatter)
+ elif isinstance(c, Tag):
+ s.append(c.decode(indent_level, eventual_encoding,
+ formatter))
+ if text and indent_level and not self.name == 'pre':
+ text = text.strip()
+ if text:
+ if pretty_print and not self.name == 'pre':
+ s.append(" " * (indent_level - 1))
+ s.append(text)
+ if pretty_print and not self.name == 'pre':
+ s.append("\n")
+ return ''.join(s)
+
+ def encode_contents(
+ self, indent_level=None, encoding=DEFAULT_OUTPUT_ENCODING,
+ formatter="minimal"):
+ """Renders the contents of this tag as a bytestring.
+
+ :param indent_level: Each line of the rendering will be
+ indented this many spaces.
+
+ :param eventual_encoding: The bytestring will be in this encoding.
+
+ :param formatter: The output formatter responsible for converting
+ entities to Unicode characters.
+ """
+
+ contents = self.decode_contents(indent_level, encoding, formatter)
+ return contents.encode(encoding)
+
+ # Old method for BS3 compatibility
+ def renderContents(self, encoding=DEFAULT_OUTPUT_ENCODING,
+ prettyPrint=False, indentLevel=0):
+ if not prettyPrint:
+ indentLevel = None
+ return self.encode_contents(
+ indent_level=indentLevel, encoding=encoding)
+
+ #Soup methods
+
+ def find(self, name=None, attrs={}, recursive=True, text=None,
+ **kwargs):
+ """Return only the first child of this Tag matching the given
+ criteria."""
+ r = None
+ l = self.find_all(name, attrs, recursive, text, 1, **kwargs)
+ if l:
+ r = l[0]
+ return r
+ findChild = find
+
+ def find_all(self, name=None, attrs={}, recursive=True, text=None,
+ limit=None, **kwargs):
+ """Extracts a list of Tag objects that match the given
+ criteria. You can specify the name of the Tag and any
+ attributes you want the Tag to have.
+
+ The value of a key-value pair in the 'attrs' map can be a
+ string, a list of strings, a regular expression object, or a
+ callable that takes a string and returns whether or not the
+ string matches for some custom definition of 'matches'. The
+ same is true of the tag name."""
+
+ generator = self.descendants
+ if not recursive:
+ generator = self.children
+ return self._find_all(name, attrs, text, limit, generator, **kwargs)
+ findAll = find_all # BS3
+ findChildren = find_all # BS2
+
+ #Generator methods
+ @property
+ def children(self):
+ # return iter() to make the purpose of the method clear
+ return iter(self.contents) # XXX This seems to be untested.
+
+ @property
+ def descendants(self):
+ if not len(self.contents):
+ return
+ stopNode = self._last_descendant().next_element
+ current = self.contents[0]
+ while current is not stopNode:
+ yield current
+ current = current.next_element
+
+ # CSS selector code
+
+ _selector_combinators = ['>', '+', '~']
+ _select_debug = False
+ def select_one(self, selector):
+ """Perform a CSS selection operation on the current element."""
+ value = self.select(selector, limit=1)
+ if value:
+ return value[0]
+ return None
+
+ def select(self, selector, _candidate_generator=None, limit=None):
+ """Perform a CSS selection operation on the current element."""
+
+ # Handle grouping selectors if ',' exists, ie: p,a
+ if ',' in selector:
+ context = []
+ for partial_selector in selector.split(','):
+ partial_selector = partial_selector.strip()
+ if partial_selector == '':
+ raise ValueError('Invalid group selection syntax: %s' % selector)
+ candidates = self.select(partial_selector, limit=limit)
+ for candidate in candidates:
+ if candidate not in context:
+ context.append(candidate)
+
+ if limit and len(context) >= limit:
+ break
+ return context
+
+ tokens = selector.split()
+ current_context = [self]
+
+ if tokens[-1] in self._selector_combinators:
+ raise ValueError(
+ 'Final combinator "%s" is missing an argument.' % tokens[-1])
+
+ if self._select_debug:
+ print('Running CSS selector "%s"' % selector)
+
+ for index, token in enumerate(tokens):
+ new_context = []
+ new_context_ids = set([])
+
+ if tokens[index-1] in self._selector_combinators:
+ # This token was consumed by the previous combinator. Skip it.
+ if self._select_debug:
+ print(' Token was consumed by the previous combinator.')
+ continue
+
+ if self._select_debug:
+ print(' Considering token "%s"' % token)
+ recursive_candidate_generator = None
+ tag_name = None
+
+ # Each operation corresponds to a checker function, a rule
+ # for determining whether a candidate matches the
+ # selector. Candidates are generated by the active
+ # iterator.
+ checker = None
+
+ m = self.attribselect_re.match(token)
+ if m is not None:
+ # Attribute selector
+ tag_name, attribute, operator, value = m.groups()
+ checker = self._attribute_checker(operator, attribute, value)
+
+ elif '#' in token:
+ # ID selector
+ tag_name, tag_id = token.split('#', 1)
+ def id_matches(tag):
+ return tag.get('id', None) == tag_id
+ checker = id_matches
+
+ elif '.' in token:
+ # Class selector
+ tag_name, klass = token.split('.', 1)
+ classes = set(klass.split('.'))
+ def classes_match(candidate):
+ return classes.issubset(candidate.get('class', []))
+ checker = classes_match
+
+ elif ':' in token:
+ # Pseudo-class
+ tag_name, pseudo = token.split(':', 1)
+ if tag_name == '':
+ raise ValueError(
+ "A pseudo-class must be prefixed with a tag name.")
+ pseudo_attributes = re.match('([a-zA-Z\d-]+)\(([a-zA-Z\d]+)\)', pseudo)
+ found = []
+ if pseudo_attributes is None:
+ pseudo_type = pseudo
+ pseudo_value = None
+ else:
+ pseudo_type, pseudo_value = pseudo_attributes.groups()
+ if pseudo_type == 'nth-of-type':
+ try:
+ pseudo_value = int(pseudo_value)
+ except:
+ raise NotImplementedError(
+ 'Only numeric values are currently supported for the nth-of-type pseudo-class.')
+ if pseudo_value < 1:
+ raise ValueError(
+ 'nth-of-type pseudo-class value must be at least 1.')
+ class Counter(object):
+ def __init__(self, destination):
+ self.count = 0
+ self.destination = destination
+
+ def nth_child_of_type(self, tag):
+ self.count += 1
+ if self.count == self.destination:
+ return True
+ if self.count > self.destination:
+ # Stop the generator that's sending us
+ # these things.
+ raise StopIteration()
+ return False
+ checker = Counter(pseudo_value).nth_child_of_type
+ else:
+ raise NotImplementedError(
+ 'Only the following pseudo-classes are implemented: nth-of-type.')
+
+ elif token == '*':
+ # Star selector -- matches everything
+ pass
+ elif token == '>':
+ # Run the next token as a CSS selector against the
+ # direct children of each tag in the current context.
+ recursive_candidate_generator = lambda tag: tag.children
+ elif token == '~':
+ # Run the next token as a CSS selector against the
+ # siblings of each tag in the current context.
+ recursive_candidate_generator = lambda tag: tag.next_siblings
+ elif token == '+':
+ # For each tag in the current context, run the next
+ # token as a CSS selector against the tag's next
+ # sibling that's a tag.
+ def next_tag_sibling(tag):
+ yield tag.find_next_sibling(True)
+ recursive_candidate_generator = next_tag_sibling
+
+ elif self.tag_name_re.match(token):
+ # Just a tag name.
+ tag_name = token
+ else:
+ raise ValueError(
+ 'Unsupported or invalid CSS selector: "%s"' % token)
+ if recursive_candidate_generator:
+ # This happens when the selector looks like "> foo".
+ #
+ # The generator calls select() recursively on every
+ # member of the current context, passing in a different
+ # candidate generator and a different selector.
+ #
+ # In the case of "> foo", the candidate generator is
+ # one that yields a tag's direct children (">"), and
+ # the selector is "foo".
+ next_token = tokens[index+1]
+ def recursive_select(tag):
+ if self._select_debug:
+ print(' Calling select("%s") recursively on %s %s' % (next_token, tag.name, tag.attrs))
+ print('-' * 40)
+ for i in tag.select(next_token, recursive_candidate_generator):
+ if self._select_debug:
+ print('(Recursive select picked up candidate %s %s)' % (i.name, i.attrs))
+ yield i
+ if self._select_debug:
+ print('-' * 40)
+ _use_candidate_generator = recursive_select
+ elif _candidate_generator is None:
+ # By default, a tag's candidates are all of its
+ # children. If tag_name is defined, only yield tags
+ # with that name.
+ if self._select_debug:
+ if tag_name:
+ check = "[any]"
+ else:
+ check = tag_name
+ print(' Default candidate generator, tag name="%s"' % check)
+ if self._select_debug:
+ # This is redundant with later code, but it stops
+ # a bunch of bogus tags from cluttering up the
+ # debug log.
+ def default_candidate_generator(tag):
+ for child in tag.descendants:
+ if not isinstance(child, Tag):
+ continue
+ if tag_name and not child.name == tag_name:
+ continue
+ yield child
+ _use_candidate_generator = default_candidate_generator
+ else:
+ _use_candidate_generator = lambda tag: tag.descendants
+ else:
+ _use_candidate_generator = _candidate_generator
+
+ count = 0
+ for tag in current_context:
+ if self._select_debug:
+ print(" Running candidate generator on %s %s" % (
+ tag.name, repr(tag.attrs)))
+ for candidate in _use_candidate_generator(tag):
+ if not isinstance(candidate, Tag):
+ continue
+ if tag_name and candidate.name != tag_name:
+ continue
+ if checker is not None:
+ try:
+ result = checker(candidate)
+ except StopIteration:
+ # The checker has decided we should no longer
+ # run the generator.
+ break
+ if checker is None or result:
+ if self._select_debug:
+ print(" SUCCESS %s %s" % (candidate.name, repr(candidate.attrs)))
+ if id(candidate) not in new_context_ids:
+ # If a tag matches a selector more than once,
+ # don't include it in the context more than once.
+ new_context.append(candidate)
+ new_context_ids.add(id(candidate))
+ if limit and len(new_context) >= limit:
+ break
+ elif self._select_debug:
+ print(" FAILURE %s %s" % (candidate.name, repr(candidate.attrs)))
+
+
+ current_context = new_context
+
+ if self._select_debug:
+ print("Final verdict:")
+ for i in current_context:
+ print(" %s %s" % (i.name, i.attrs))
+ return current_context
+
+ # Old names for backwards compatibility
+ def childGenerator(self):
+ return self.children
+
+ def recursiveChildGenerator(self):
+ return self.descendants
+
+ def has_key(self, key):
+ """This was kind of misleading because has_key() (attributes)
+ was different from __in__ (contents). has_key() is gone in
+ Python 3, anyway."""
+ warnings.warn('has_key is deprecated. Use has_attr("%s") instead.' % (
+ key))
+ return self.has_attr(key)
+
+# Next, a couple classes to represent queries and their results.
+class SoupStrainer(object):
+ """Encapsulates a number of ways of matching a markup element (tag or
+ text)."""
+
+ def __init__(self, name=None, attrs={}, text=None, **kwargs):
+ self.name = self._normalize_search_value(name)
+ if not isinstance(attrs, dict):
+ # Treat a non-dict value for attrs as a search for the 'class'
+ # attribute.
+ kwargs['class'] = attrs
+ attrs = None
+
+ if 'class_' in kwargs:
+ # Treat class_="foo" as a search for the 'class'
+ # attribute, overriding any non-dict value for attrs.
+ kwargs['class'] = kwargs['class_']
+ del kwargs['class_']
+
+ if kwargs:
+ if attrs:
+ attrs = attrs.copy()
+ attrs.update(kwargs)
+ else:
+ attrs = kwargs
+ normalized_attrs = {}
+ for key, value in list(attrs.items()):
+ normalized_attrs[key] = self._normalize_search_value(value)
+
+ self.attrs = normalized_attrs
+ self.text = self._normalize_search_value(text)
+
+ def _normalize_search_value(self, value):
+ # Leave it alone if it's a Unicode string, a callable, a
+ # regular expression, a boolean, or None.
+ if (isinstance(value, str) or isinstance(value, collections.Callable) or hasattr(value, 'match')
+ or isinstance(value, bool) or value is None):
+ return value
+
+ # If it's a bytestring, convert it to Unicode, treating it as UTF-8.
+ if isinstance(value, bytes):
+ return value.decode("utf8")
+
+ # If it's listlike, convert it into a list of strings.
+ if hasattr(value, '__iter__'):
+ new_value = []
+ for v in value:
+ if (hasattr(v, '__iter__') and not isinstance(v, bytes)
+ and not isinstance(v, str)):
+ # This is almost certainly the user's mistake. In the
+ # interests of avoiding infinite loops, we'll let
+ # it through as-is rather than doing a recursive call.
+ new_value.append(v)
+ else:
+ new_value.append(self._normalize_search_value(v))
+ return new_value
+
+ # Otherwise, convert it into a Unicode string.
+ # The unicode(str()) thing is so this will do the same thing on Python 2
+ # and Python 3.
+ return str(str(value))
+
+ def __str__(self):
+ if self.text:
+ return self.text
+ else:
+ return "%s|%s" % (self.name, self.attrs)
+
+ def search_tag(self, markup_name=None, markup_attrs={}):
+ found = None
+ markup = None
+ if isinstance(markup_name, Tag):
+ markup = markup_name
+ markup_attrs = markup
+ call_function_with_tag_data = (
+ isinstance(self.name, collections.Callable)
+ and not isinstance(markup_name, Tag))
+
+ if ((not self.name)
+ or call_function_with_tag_data
+ or (markup and self._matches(markup, self.name))
+ or (not markup and self._matches(markup_name, self.name))):
+ if call_function_with_tag_data:
+ match = self.name(markup_name, markup_attrs)
+ else:
+ match = True
+ markup_attr_map = None
+ for attr, match_against in list(self.attrs.items()):
+ if not markup_attr_map:
+ if hasattr(markup_attrs, 'get'):
+ markup_attr_map = markup_attrs
+ else:
+ markup_attr_map = {}
+ for k, v in markup_attrs:
+ markup_attr_map[k] = v
+ attr_value = markup_attr_map.get(attr)
+ if not self._matches(attr_value, match_against):
+ match = False
+ break
+ if match:
+ if markup:
+ found = markup
+ else:
+ found = markup_name
+ if found and self.text and not self._matches(found.string, self.text):
+ found = None
+ return found
+ searchTag = search_tag
+
+ def search(self, markup):
+ # print 'looking for %s in %s' % (self, markup)
+ found = None
+ # If given a list of items, scan it for a text element that
+ # matches.
+ if hasattr(markup, '__iter__') and not isinstance(markup, (Tag, str)):
+ for element in markup:
+ if isinstance(element, NavigableString) \
+ and self.search(element):
+ found = element
+ break
+ # If it's a Tag, make sure its name or attributes match.
+ # Don't bother with Tags if we're searching for text.
+ elif isinstance(markup, Tag):
+ if not self.text or self.name or self.attrs:
+ found = self.search_tag(markup)
+ # If it's text, make sure the text matches.
+ elif isinstance(markup, NavigableString) or \
+ isinstance(markup, str):
+ if not self.name and not self.attrs and self._matches(markup, self.text):
+ found = markup
+ else:
+ raise Exception(
+ "I don't know how to match against a %s" % markup.__class__)
+ return found
+
+ def _matches(self, markup, match_against):
+ # print u"Matching %s against %s" % (markup, match_against)
+ result = False
+ if isinstance(markup, list) or isinstance(markup, tuple):
+ # This should only happen when searching a multi-valued attribute
+ # like 'class'.
+ if (isinstance(match_against, str)
+ and ' ' in match_against):
+ # A bit of a special case. If they try to match "foo
+ # bar" on a multivalue attribute's value, only accept
+ # the literal value "foo bar"
+ #
+ # XXX This is going to be pretty slow because we keep
+ # splitting match_against. But it shouldn't come up
+ # too often.
+ return (whitespace_re.split(match_against) == markup)
+ else:
+ for item in markup:
+ if self._matches(item, match_against):
+ return True
+ return False
+
+ if match_against is True:
+ # True matches any non-None value.
+ return markup is not None
+
+ if isinstance(match_against, collections.Callable):
+ return match_against(markup)
+
+ # Custom callables take the tag as an argument, but all
+ # other ways of matching match the tag name as a string.
+ if isinstance(markup, Tag):
+ markup = markup.name
+
+ # Ensure that `markup` is either a Unicode string, or None.
+ markup = self._normalize_search_value(markup)
+
+ if markup is None:
+ # None matches None, False, an empty string, an empty list, and so on.
+ return not match_against
+
+ if isinstance(match_against, str):
+ # Exact string match
+ return markup == match_against
+
+ if hasattr(match_against, 'match'):
+ # Regexp match
+ return match_against.search(markup)
+
+ if hasattr(match_against, '__iter__'):
+ # The markup must be an exact match against something
+ # in the iterable.
+ return markup in match_against
+
+
+class ResultSet(list):
+ """A ResultSet is just a list that keeps track of the SoupStrainer
+ that created it."""
+ def __init__(self, source, result=()):
+ super(ResultSet, self).__init__(result)
+ self.source = source
diff --git a/poky/bitbake/lib/bs4/testing.py b/poky/bitbake/lib/bs4/testing.py
new file mode 100644
index 000000000..3a2f260e2
--- /dev/null
+++ b/poky/bitbake/lib/bs4/testing.py
@@ -0,0 +1,687 @@
+"""Helper classes for tests."""
+
+__license__ = "MIT"
+
+import pickle
+import copy
+import functools
+import unittest
+from unittest import TestCase
+from bs4 import BeautifulSoup
+from bs4.element import (
+ CharsetMetaAttributeValue,
+ Comment,
+ ContentMetaAttributeValue,
+ Doctype,
+ SoupStrainer,
+)
+
+from bs4.builder import HTMLParserTreeBuilder
+default_builder = HTMLParserTreeBuilder
+
+
+class SoupTest(unittest.TestCase):
+
+ @property
+ def default_builder(self):
+ return default_builder()
+
+ def soup(self, markup, **kwargs):
+ """Build a Beautiful Soup object from markup."""
+ builder = kwargs.pop('builder', self.default_builder)
+ return BeautifulSoup(markup, builder=builder, **kwargs)
+
+ def document_for(self, markup):
+ """Turn an HTML fragment into a document.
+
+ The details depend on the builder.
+ """
+ return self.default_builder.test_fragment_to_document(markup)
+
+ def assertSoupEquals(self, to_parse, compare_parsed_to=None):
+ builder = self.default_builder
+ obj = BeautifulSoup(to_parse, builder=builder)
+ if compare_parsed_to is None:
+ compare_parsed_to = to_parse
+
+ self.assertEqual(obj.decode(), self.document_for(compare_parsed_to))
+
+ def assertConnectedness(self, element):
+ """Ensure that next_element and previous_element are properly
+ set for all descendants of the given element.
+ """
+ earlier = None
+ for e in element.descendants:
+ if earlier:
+ self.assertEqual(e, earlier.next_element)
+ self.assertEqual(earlier, e.previous_element)
+ earlier = e
+
+class HTMLTreeBuilderSmokeTest(object):
+
+ """A basic test of a treebuilder's competence.
+
+ Any HTML treebuilder, present or future, should be able to pass
+ these tests. With invalid markup, there's room for interpretation,
+ and different parsers can handle it differently. But with the
+ markup in these tests, there's not much room for interpretation.
+ """
+
+ def test_pickle_and_unpickle_identity(self):
+ # Pickling a tree, then unpickling it, yields a tree identical
+ # to the original.
+ tree = self.soup("<a><b>foo</a>")
+ dumped = pickle.dumps(tree, 2)
+ loaded = pickle.loads(dumped)
+ self.assertEqual(loaded.__class__, BeautifulSoup)
+ self.assertEqual(loaded.decode(), tree.decode())
+
+ def assertDoctypeHandled(self, doctype_fragment):
+ """Assert that a given doctype string is handled correctly."""
+ doctype_str, soup = self._document_with_doctype(doctype_fragment)
+
+ # Make sure a Doctype object was created.
+ doctype = soup.contents[0]
+ self.assertEqual(doctype.__class__, Doctype)
+ self.assertEqual(doctype, doctype_fragment)
+ self.assertEqual(str(soup)[:len(doctype_str)], doctype_str)
+
+ # Make sure that the doctype was correctly associated with the
+ # parse tree and that the rest of the document parsed.
+ self.assertEqual(soup.p.contents[0], 'foo')
+
+ def _document_with_doctype(self, doctype_fragment):
+ """Generate and parse a document with the given doctype."""
+ doctype = '<!DOCTYPE %s>' % doctype_fragment
+ markup = doctype + '\n<p>foo</p>'
+ soup = self.soup(markup)
+ return doctype, soup
+
+ def test_normal_doctypes(self):
+ """Make sure normal, everyday HTML doctypes are handled correctly."""
+ self.assertDoctypeHandled("html")
+ self.assertDoctypeHandled(
+ 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"')
+
+ def test_empty_doctype(self):
+ soup = self.soup("<!DOCTYPE>")
+ doctype = soup.contents[0]
+ self.assertEqual("", doctype.strip())
+
+ def test_public_doctype_with_url(self):
+ doctype = 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"'
+ self.assertDoctypeHandled(doctype)
+
+ def test_system_doctype(self):
+ self.assertDoctypeHandled('foo SYSTEM "http://www.example.com/"')
+
+ def test_namespaced_system_doctype(self):
+ # We can handle a namespaced doctype with a system ID.
+ self.assertDoctypeHandled('xsl:stylesheet SYSTEM "htmlent.dtd"')
+
+ def test_namespaced_public_doctype(self):
+ # Test a namespaced doctype with a public id.
+ self.assertDoctypeHandled('xsl:stylesheet PUBLIC "htmlent.dtd"')
+
+ def test_real_xhtml_document(self):
+ """A real XHTML document should come out more or less the same as it went in."""
+ markup = b"""<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hello.</title></head>
+<body>Goodbye.</body>
+</html>"""
+ soup = self.soup(markup)
+ self.assertEqual(
+ soup.encode("utf-8").replace(b"\n", b""),
+ markup.replace(b"\n", b""))
+
+ def test_processing_instruction(self):
+ markup = b"""<?PITarget PIContent?>"""
+ soup = self.soup(markup)
+ self.assertEqual(markup, soup.encode("utf8"))
+
+ def test_deepcopy(self):
+ """Make sure you can copy the tree builder.
+
+ This is important because the builder is part of a
+ BeautifulSoup object, and we want to be able to copy that.
+ """
+ copy.deepcopy(self.default_builder)
+
+ def test_p_tag_is_never_empty_element(self):
+ """A <p> tag is never designated as an empty-element tag.
+
+ Even if the markup shows it as an empty-element tag, it
+ shouldn't be presented that way.
+ """
+ soup = self.soup("<p/>")
+ self.assertFalse(soup.p.is_empty_element)
+ self.assertEqual(str(soup.p), "<p></p>")
+
+ def test_unclosed_tags_get_closed(self):
+ """A tag that's not closed by the end of the document should be closed.
+
+ This applies to all tags except empty-element tags.
+ """
+ self.assertSoupEquals("<p>", "<p></p>")
+ self.assertSoupEquals("<b>", "<b></b>")
+
+ self.assertSoupEquals("<br>", "<br/>")
+
+ def test_br_is_always_empty_element_tag(self):
+ """A <br> tag is designated as an empty-element tag.
+
+ Some parsers treat <br></br> as one <br/> tag, some parsers as
+ two tags, but it should always be an empty-element tag.
+ """
+ soup = self.soup("<br></br>")
+ self.assertTrue(soup.br.is_empty_element)
+ self.assertEqual(str(soup.br), "<br/>")
+
+ def test_nested_formatting_elements(self):
+ self.assertSoupEquals("<em><em></em></em>")
+
+ def test_double_head(self):
+ html = '''<!DOCTYPE html>
+<html>
+<head>
+<title>Ordinary HEAD element test</title>
+</head>
+<script type="text/javascript">
+alert("Help!");
+</script>
+<body>
+Hello, world!
+</body>
+</html>
+'''
+ soup = self.soup(html)
+ self.assertEqual("text/javascript", soup.find('script')['type'])
+
+ def test_comment(self):
+ # Comments are represented as Comment objects.
+ markup = "<p>foo<!--foobar-->baz</p>"
+ self.assertSoupEquals(markup)
+
+ soup = self.soup(markup)
+ comment = soup.find(text="foobar")
+ self.assertEqual(comment.__class__, Comment)
+
+ # The comment is properly integrated into the tree.
+ foo = soup.find(text="foo")
+ self.assertEqual(comment, foo.next_element)
+ baz = soup.find(text="baz")
+ self.assertEqual(comment, baz.previous_element)
+
+ def test_preserved_whitespace_in_pre_and_textarea(self):
+ """Whitespace must be preserved in <pre> and <textarea> tags."""
+ self.assertSoupEquals("<pre> </pre>")
+ self.assertSoupEquals("<textarea> woo </textarea>")
+
+ def test_nested_inline_elements(self):
+ """Inline elements can be nested indefinitely."""
+ b_tag = "<b>Inside a B tag</b>"
+ self.assertSoupEquals(b_tag)
+
+ nested_b_tag = "<p>A <i>nested <b>tag</b></i></p>"
+ self.assertSoupEquals(nested_b_tag)
+
+ double_nested_b_tag = "<p>A <a>doubly <i>nested <b>tag</b></i></a></p>"
+ self.assertSoupEquals(nested_b_tag)
+
+ def test_nested_block_level_elements(self):
+ """Block elements can be nested."""
+ soup = self.soup('<blockquote><p><b>Foo</b></p></blockquote>')
+ blockquote = soup.blockquote
+ self.assertEqual(blockquote.p.b.string, 'Foo')
+ self.assertEqual(blockquote.b.string, 'Foo')
+
+ def test_correctly_nested_tables(self):
+ """One table can go inside another one."""
+ markup = ('<table id="1">'
+ '<tr>'
+ "<td>Here's another table:"
+ '<table id="2">'
+ '<tr><td>foo</td></tr>'
+ '</table></td>')
+
+ self.assertSoupEquals(
+ markup,
+ '<table id="1"><tr><td>Here\'s another table:'
+ '<table id="2"><tr><td>foo</td></tr></table>'
+ '</td></tr></table>')
+
+ self.assertSoupEquals(
+ "<table><thead><tr><td>Foo</td></tr></thead>"
+ "<tbody><tr><td>Bar</td></tr></tbody>"
+ "<tfoot><tr><td>Baz</td></tr></tfoot></table>")
+
+ def test_deeply_nested_multivalued_attribute(self):
+ # html5lib can set the attributes of the same tag many times
+ # as it rearranges the tree. This has caused problems with
+ # multivalued attributes.
+ markup = '<table><div><div class="css"></div></div></table>'
+ soup = self.soup(markup)
+ self.assertEqual(["css"], soup.div.div['class'])
+
+ def test_multivalued_attribute_on_html(self):
+ # html5lib uses a different API to set the attributes ot the
+ # <html> tag. This has caused problems with multivalued
+ # attributes.
+ markup = '<html class="a b"></html>'
+ soup = self.soup(markup)
+ self.assertEqual(["a", "b"], soup.html['class'])
+
+ def test_angle_brackets_in_attribute_values_are_escaped(self):
+ self.assertSoupEquals('<a b="<a>"></a>', '<a b="&lt;a&gt;"></a>')
+
+ def test_entities_in_attributes_converted_to_unicode(self):
+ expect = '<p id="pi\N{LATIN SMALL LETTER N WITH TILDE}ata"></p>'
+ self.assertSoupEquals('<p id="pi&#241;ata"></p>', expect)
+ self.assertSoupEquals('<p id="pi&#xf1;ata"></p>', expect)
+ self.assertSoupEquals('<p id="pi&#Xf1;ata"></p>', expect)
+ self.assertSoupEquals('<p id="pi&ntilde;ata"></p>', expect)
+
+ def test_entities_in_text_converted_to_unicode(self):
+ expect = '<p>pi\N{LATIN SMALL LETTER N WITH TILDE}ata</p>'
+ self.assertSoupEquals("<p>pi&#241;ata</p>", expect)
+ self.assertSoupEquals("<p>pi&#xf1;ata</p>", expect)
+ self.assertSoupEquals("<p>pi&#Xf1;ata</p>", expect)
+ self.assertSoupEquals("<p>pi&ntilde;ata</p>", expect)
+
+ def test_quot_entity_converted_to_quotation_mark(self):
+ self.assertSoupEquals("<p>I said &quot;good day!&quot;</p>",
+ '<p>I said "good day!"</p>')
+
+ def test_out_of_range_entity(self):
+ expect = "\N{REPLACEMENT CHARACTER}"
+ self.assertSoupEquals("&#10000000000000;", expect)
+ self.assertSoupEquals("&#x10000000000000;", expect)
+ self.assertSoupEquals("&#1000000000;", expect)
+
+ def test_multipart_strings(self):
+ "Mostly to prevent a recurrence of a bug in the html5lib treebuilder."
+ soup = self.soup("<html><h2>\nfoo</h2><p></p></html>")
+ self.assertEqual("p", soup.h2.string.next_element.name)
+ self.assertEqual("p", soup.p.name)
+ self.assertConnectedness(soup)
+
+ def test_head_tag_between_head_and_body(self):
+ "Prevent recurrence of a bug in the html5lib treebuilder."
+ content = """<html><head></head>
+ <link></link>
+ <body>foo</body>
+</html>
+"""
+ soup = self.soup(content)
+ self.assertNotEqual(None, soup.html.body)
+ self.assertConnectedness(soup)
+
+ def test_multiple_copies_of_a_tag(self):
+ "Prevent recurrence of a bug in the html5lib treebuilder."
+ content = """<!DOCTYPE html>
+<html>
+ <body>
+ <article id="a" >
+ <div><a href="1"></div>
+ <footer>
+ <a href="2"></a>
+ </footer>
+ </article>
+ </body>
+</html>
+"""
+ soup = self.soup(content)
+ self.assertConnectedness(soup.article)
+
+ def test_basic_namespaces(self):
+ """Parsers don't need to *understand* namespaces, but at the
+ very least they should not choke on namespaces or lose
+ data."""
+
+ markup = b'<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg"><head></head><body><mathml:msqrt>4</mathml:msqrt><b svg:fill="red"></b></body></html>'
+ soup = self.soup(markup)
+ self.assertEqual(markup, soup.encode())
+ html = soup.html
+ self.assertEqual('http://www.w3.org/1999/xhtml', soup.html['xmlns'])
+ self.assertEqual(
+ 'http://www.w3.org/1998/Math/MathML', soup.html['xmlns:mathml'])
+ self.assertEqual(
+ 'http://www.w3.org/2000/svg', soup.html['xmlns:svg'])
+
+ def test_multivalued_attribute_value_becomes_list(self):
+ markup = b'<a class="foo bar">'
+ soup = self.soup(markup)
+ self.assertEqual(['foo', 'bar'], soup.a['class'])
+
+ #
+ # Generally speaking, tests below this point are more tests of
+ # Beautiful Soup than tests of the tree builders. But parsers are
+ # weird, so we run these tests separately for every tree builder
+ # to detect any differences between them.
+ #
+
+ def test_can_parse_unicode_document(self):
+ # A seemingly innocuous document... but it's in Unicode! And
+ # it contains characters that can't be represented in the
+ # encoding found in the declaration! The horror!
+ markup = '<html><head><meta encoding="euc-jp"></head><body>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</body>'
+ soup = self.soup(markup)
+ self.assertEqual('Sacr\xe9 bleu!', soup.body.string)
+
+ def test_soupstrainer(self):
+ """Parsers should be able to work with SoupStrainers."""
+ strainer = SoupStrainer("b")
+ soup = self.soup("A <b>bold</b> <meta/> <i>statement</i>",
+ parse_only=strainer)
+ self.assertEqual(soup.decode(), "<b>bold</b>")
+
+ def test_single_quote_attribute_values_become_double_quotes(self):
+ self.assertSoupEquals("<foo attr='bar'></foo>",
+ '<foo attr="bar"></foo>')
+
+ def test_attribute_values_with_nested_quotes_are_left_alone(self):
+ text = """<foo attr='bar "brawls" happen'>a</foo>"""
+ self.assertSoupEquals(text)
+
+ def test_attribute_values_with_double_nested_quotes_get_quoted(self):
+ text = """<foo attr='bar "brawls" happen'>a</foo>"""
+ soup = self.soup(text)
+ soup.foo['attr'] = 'Brawls happen at "Bob\'s Bar"'
+ self.assertSoupEquals(
+ soup.foo.decode(),
+ """<foo attr="Brawls happen at &quot;Bob\'s Bar&quot;">a</foo>""")
+
+ def test_ampersand_in_attribute_value_gets_escaped(self):
+ self.assertSoupEquals('<this is="really messed up & stuff"></this>',
+ '<this is="really messed up &amp; stuff"></this>')
+
+ self.assertSoupEquals(
+ '<a href="http://example.org?a=1&b=2;3">foo</a>',
+ '<a href="http://example.org?a=1&amp;b=2;3">foo</a>')
+
+ def test_escaped_ampersand_in_attribute_value_is_left_alone(self):
+ self.assertSoupEquals('<a href="http://example.org?a=1&amp;b=2;3"></a>')
+
+ def test_entities_in_strings_converted_during_parsing(self):
+ # Both XML and HTML entities are converted to Unicode characters
+ # during parsing.
+ text = "<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>"
+ expected = "<p>&lt;&lt;sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</p>"
+ self.assertSoupEquals(text, expected)
+
+ def test_smart_quotes_converted_on_the_way_in(self):
+ # Microsoft smart quotes are converted to Unicode characters during
+ # parsing.
+ quote = b"<p>\x91Foo\x92</p>"
+ soup = self.soup(quote)
+ self.assertEqual(
+ soup.p.string,
+ "\N{LEFT SINGLE QUOTATION MARK}Foo\N{RIGHT SINGLE QUOTATION MARK}")
+
+ def test_non_breaking_spaces_converted_on_the_way_in(self):
+ soup = self.soup("<a>&nbsp;&nbsp;</a>")
+ self.assertEqual(soup.a.string, "\N{NO-BREAK SPACE}" * 2)
+
+ def test_entities_converted_on_the_way_out(self):
+ text = "<p>&lt;&lt;sacr&eacute;&#32;bleu!&gt;&gt;</p>"
+ expected = "<p>&lt;&lt;sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</p>".encode("utf-8")
+ soup = self.soup(text)
+ self.assertEqual(soup.p.encode("utf-8"), expected)
+
+ def test_real_iso_latin_document(self):
+ # Smoke test of interrelated functionality, using an
+ # easy-to-understand document.
+
+ # Here it is in Unicode. Note that it claims to be in ISO-Latin-1.
+ unicode_html = '<html><head><meta content="text/html; charset=ISO-Latin-1" http-equiv="Content-type"/></head><body><p>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</p></body></html>'
+
+ # That's because we're going to encode it into ISO-Latin-1, and use
+ # that to test.
+ iso_latin_html = unicode_html.encode("iso-8859-1")
+
+ # Parse the ISO-Latin-1 HTML.
+ soup = self.soup(iso_latin_html)
+ # Encode it to UTF-8.
+ result = soup.encode("utf-8")
+
+ # What do we expect the result to look like? Well, it would
+ # look like unicode_html, except that the META tag would say
+ # UTF-8 instead of ISO-Latin-1.
+ expected = unicode_html.replace("ISO-Latin-1", "utf-8")
+
+ # And, of course, it would be in UTF-8, not Unicode.
+ expected = expected.encode("utf-8")
+
+ # Ta-da!
+ self.assertEqual(result, expected)
+
+ def test_real_shift_jis_document(self):
+ # Smoke test to make sure the parser can handle a document in
+ # Shift-JIS encoding, without choking.
+ shift_jis_html = (
+ b'<html><head></head><body><pre>'
+ b'\x82\xb1\x82\xea\x82\xcdShift-JIS\x82\xc5\x83R\x81[\x83f'
+ b'\x83B\x83\x93\x83O\x82\xb3\x82\xea\x82\xbd\x93\xfa\x96{\x8c'
+ b'\xea\x82\xcc\x83t\x83@\x83C\x83\x8b\x82\xc5\x82\xb7\x81B'
+ b'</pre></body></html>')
+ unicode_html = shift_jis_html.decode("shift-jis")
+ soup = self.soup(unicode_html)
+
+ # Make sure the parse tree is correctly encoded to various
+ # encodings.
+ self.assertEqual(soup.encode("utf-8"), unicode_html.encode("utf-8"))
+ self.assertEqual(soup.encode("euc_jp"), unicode_html.encode("euc_jp"))
+
+ def test_real_hebrew_document(self):
+ # A real-world test to make sure we can convert ISO-8859-9 (a
+ # Hebrew encoding) to UTF-8.
+ hebrew_document = b'<html><head><title>Hebrew (ISO 8859-8) in Visual Directionality</title></head><body><h1>Hebrew (ISO 8859-8) in Visual Directionality</h1>\xed\xe5\xec\xf9</body></html>'
+ soup = self.soup(
+ hebrew_document, from_encoding="iso8859-8")
+ self.assertEqual(soup.original_encoding, 'iso8859-8')
+ self.assertEqual(
+ soup.encode('utf-8'),
+ hebrew_document.decode("iso8859-8").encode("utf-8"))
+
+ def test_meta_tag_reflects_current_encoding(self):
+ # Here's the <meta> tag saying that a document is
+ # encoded in Shift-JIS.
+ meta_tag = ('<meta content="text/html; charset=x-sjis" '
+ 'http-equiv="Content-type"/>')
+
+ # Here's a document incorporating that meta tag.
+ shift_jis_html = (
+ '<html><head>\n%s\n'
+ '<meta http-equiv="Content-language" content="ja"/>'
+ '</head><body>Shift-JIS markup goes here.') % meta_tag
+ soup = self.soup(shift_jis_html)
+
+ # Parse the document, and the charset is seemingly unaffected.
+ parsed_meta = soup.find('meta', {'http-equiv': 'Content-type'})
+ content = parsed_meta['content']
+ self.assertEqual('text/html; charset=x-sjis', content)
+
+ # But that value is actually a ContentMetaAttributeValue object.
+ self.assertTrue(isinstance(content, ContentMetaAttributeValue))
+
+ # And it will take on a value that reflects its current
+ # encoding.
+ self.assertEqual('text/html; charset=utf8', content.encode("utf8"))
+
+ # For the rest of the story, see TestSubstitutions in
+ # test_tree.py.
+
+ def test_html5_style_meta_tag_reflects_current_encoding(self):
+ # Here's the <meta> tag saying that a document is
+ # encoded in Shift-JIS.
+ meta_tag = ('<meta id="encoding" charset="x-sjis" />')
+
+ # Here's a document incorporating that meta tag.
+ shift_jis_html = (
+ '<html><head>\n%s\n'
+ '<meta http-equiv="Content-language" content="ja"/>'
+ '</head><body>Shift-JIS markup goes here.') % meta_tag
+ soup = self.soup(shift_jis_html)
+
+ # Parse the document, and the charset is seemingly unaffected.
+ parsed_meta = soup.find('meta', id="encoding")
+ charset = parsed_meta['charset']
+ self.assertEqual('x-sjis', charset)
+
+ # But that value is actually a CharsetMetaAttributeValue object.
+ self.assertTrue(isinstance(charset, CharsetMetaAttributeValue))
+
+ # And it will take on a value that reflects its current
+ # encoding.
+ self.assertEqual('utf8', charset.encode("utf8"))
+
+ def test_tag_with_no_attributes_can_have_attributes_added(self):
+ data = self.soup("<a>text</a>")
+ data.a['foo'] = 'bar'
+ self.assertEqual('<a foo="bar">text</a>', data.a.decode())
+
+class XMLTreeBuilderSmokeTest(object):
+
+ def test_pickle_and_unpickle_identity(self):
+ # Pickling a tree, then unpickling it, yields a tree identical
+ # to the original.
+ tree = self.soup("<a><b>foo</a>")
+ dumped = pickle.dumps(tree, 2)
+ loaded = pickle.loads(dumped)
+ self.assertEqual(loaded.__class__, BeautifulSoup)
+ self.assertEqual(loaded.decode(), tree.decode())
+
+ def test_docstring_generated(self):
+ soup = self.soup("<root/>")
+ self.assertEqual(
+ soup.encode(), b'<?xml version="1.0" encoding="utf-8"?>\n<root/>')
+
+ def test_xml_declaration(self):
+ markup = b"""<?xml version="1.0" encoding="utf8"?>\n<foo/>"""
+ soup = self.soup(markup)
+ self.assertEqual(markup, soup.encode("utf8"))
+
+ def test_real_xhtml_document(self):
+ """A real XHTML document should come out *exactly* the same as it went in."""
+ markup = b"""<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hello.</title></head>
+<body>Goodbye.</body>
+</html>"""
+ soup = self.soup(markup)
+ self.assertEqual(
+ soup.encode("utf-8"), markup)
+
+ def test_formatter_processes_script_tag_for_xml_documents(self):
+ doc = """
+ <script type="text/javascript">
+ </script>
+"""
+ soup = BeautifulSoup(doc, "lxml-xml")
+ # lxml would have stripped this while parsing, but we can add
+ # it later.
+ soup.script.string = 'console.log("< < hey > > ");'
+ encoded = soup.encode()
+ self.assertTrue(b"&lt; &lt; hey &gt; &gt;" in encoded)
+
+ def test_can_parse_unicode_document(self):
+ markup = '<?xml version="1.0" encoding="euc-jp"><root>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</root>'
+ soup = self.soup(markup)
+ self.assertEqual('Sacr\xe9 bleu!', soup.root.string)
+
+ def test_popping_namespaced_tag(self):
+ markup = '<rss xmlns:dc="foo"><dc:creator>b</dc:creator><dc:date>2012-07-02T20:33:42Z</dc:date><dc:rights>c</dc:rights><image>d</image></rss>'
+ soup = self.soup(markup)
+ self.assertEqual(
+ str(soup.rss), markup)
+
+ def test_docstring_includes_correct_encoding(self):
+ soup = self.soup("<root/>")
+ self.assertEqual(
+ soup.encode("latin1"),
+ b'<?xml version="1.0" encoding="latin1"?>\n<root/>')
+
+ def test_large_xml_document(self):
+ """A large XML document should come out the same as it went in."""
+ markup = (b'<?xml version="1.0" encoding="utf-8"?>\n<root>'
+ + b'0' * (2**12)
+ + b'</root>')
+ soup = self.soup(markup)
+ self.assertEqual(soup.encode("utf-8"), markup)
+
+
+ def test_tags_are_empty_element_if_and_only_if_they_are_empty(self):
+ self.assertSoupEquals("<p>", "<p/>")
+ self.assertSoupEquals("<p>foo</p>")
+
+ def test_namespaces_are_preserved(self):
+ markup = '<root xmlns:a="http://example.com/" xmlns:b="http://example.net/"><a:foo>This tag is in the a namespace</a:foo><b:foo>This tag is in the b namespace</b:foo></root>'
+ soup = self.soup(markup)
+ root = soup.root
+ self.assertEqual("http://example.com/", root['xmlns:a'])
+ self.assertEqual("http://example.net/", root['xmlns:b'])
+
+ def test_closing_namespaced_tag(self):
+ markup = '<p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>'
+ soup = self.soup(markup)
+ self.assertEqual(str(soup.p), markup)
+
+ def test_namespaced_attributes(self):
+ markup = '<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><bar xsi:schemaLocation="http://www.example.com"/></foo>'
+ soup = self.soup(markup)
+ self.assertEqual(str(soup.foo), markup)
+
+ def test_namespaced_attributes_xml_namespace(self):
+ markup = '<foo xml:lang="fr">bar</foo>'
+ soup = self.soup(markup)
+ self.assertEqual(str(soup.foo), markup)
+
+class HTML5TreeBuilderSmokeTest(HTMLTreeBuilderSmokeTest):
+ """Smoke test for a tree builder that supports HTML5."""
+
+ def test_real_xhtml_document(self):
+ # Since XHTML is not HTML5, HTML5 parsers are not tested to handle
+ # XHTML documents in any particular way.
+ pass
+
+ def test_html_tags_have_namespace(self):
+ markup = "<a>"
+ soup = self.soup(markup)
+ self.assertEqual("http://www.w3.org/1999/xhtml", soup.a.namespace)
+
+ def test_svg_tags_have_namespace(self):
+ markup = '<svg><circle/></svg>'
+ soup = self.soup(markup)
+ namespace = "http://www.w3.org/2000/svg"
+ self.assertEqual(namespace, soup.svg.namespace)
+ self.assertEqual(namespace, soup.circle.namespace)
+
+
+ def test_mathml_tags_have_namespace(self):
+ markup = '<math><msqrt>5</msqrt></math>'
+ soup = self.soup(markup)
+ namespace = 'http://www.w3.org/1998/Math/MathML'
+ self.assertEqual(namespace, soup.math.namespace)
+ self.assertEqual(namespace, soup.msqrt.namespace)
+
+ def test_xml_declaration_becomes_comment(self):
+ markup = '<?xml version="1.0" encoding="utf-8"?><html></html>'
+ soup = self.soup(markup)
+ self.assertTrue(isinstance(soup.contents[0], Comment))
+ self.assertEqual(soup.contents[0], '?xml version="1.0" encoding="utf-8"?')
+ self.assertEqual("html", soup.contents[0].next_element.name)
+
+def skipIf(condition, reason):
+ def nothing(test, *args, **kwargs):
+ return None
+
+ def decorator(test_item):
+ if condition:
+ return nothing
+ else:
+ return test_item
+
+ return decorator
diff --git a/poky/bitbake/lib/bs4/tests/__init__.py b/poky/bitbake/lib/bs4/tests/__init__.py
new file mode 100644
index 000000000..142c8cc3f
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/__init__.py
@@ -0,0 +1 @@
+"The beautifulsoup tests."
diff --git a/poky/bitbake/lib/bs4/tests/test_builder_registry.py b/poky/bitbake/lib/bs4/tests/test_builder_registry.py
new file mode 100644
index 000000000..90cad8293
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_builder_registry.py
@@ -0,0 +1,147 @@
+"""Tests of the builder registry."""
+
+import unittest
+import warnings
+
+from bs4 import BeautifulSoup
+from bs4.builder import (
+ builder_registry as registry,
+ HTMLParserTreeBuilder,
+ TreeBuilderRegistry,
+)
+
+try:
+ from bs4.builder import HTML5TreeBuilder
+ HTML5LIB_PRESENT = True
+except ImportError:
+ HTML5LIB_PRESENT = False
+
+try:
+ from bs4.builder import (
+ LXMLTreeBuilderForXML,
+ LXMLTreeBuilder,
+ )
+ LXML_PRESENT = True
+except ImportError:
+ LXML_PRESENT = False
+
+
+class BuiltInRegistryTest(unittest.TestCase):
+ """Test the built-in registry with the default builders registered."""
+
+ def test_combination(self):
+ if LXML_PRESENT:
+ self.assertEqual(registry.lookup('fast', 'html'),
+ LXMLTreeBuilder)
+
+ if LXML_PRESENT:
+ self.assertEqual(registry.lookup('permissive', 'xml'),
+ LXMLTreeBuilderForXML)
+ self.assertEqual(registry.lookup('strict', 'html'),
+ HTMLParserTreeBuilder)
+ if HTML5LIB_PRESENT:
+ self.assertEqual(registry.lookup('html5lib', 'html'),
+ HTML5TreeBuilder)
+
+ def test_lookup_by_markup_type(self):
+ if LXML_PRESENT:
+ self.assertEqual(registry.lookup('html'), LXMLTreeBuilder)
+ self.assertEqual(registry.lookup('xml'), LXMLTreeBuilderForXML)
+ else:
+ self.assertEqual(registry.lookup('xml'), None)
+ if HTML5LIB_PRESENT:
+ self.assertEqual(registry.lookup('html'), HTML5TreeBuilder)
+ else:
+ self.assertEqual(registry.lookup('html'), HTMLParserTreeBuilder)
+
+ def test_named_library(self):
+ if LXML_PRESENT:
+ self.assertEqual(registry.lookup('lxml', 'xml'),
+ LXMLTreeBuilderForXML)
+ self.assertEqual(registry.lookup('lxml', 'html'),
+ LXMLTreeBuilder)
+ if HTML5LIB_PRESENT:
+ self.assertEqual(registry.lookup('html5lib'),
+ HTML5TreeBuilder)
+
+ self.assertEqual(registry.lookup('html.parser'),
+ HTMLParserTreeBuilder)
+
+ def test_beautifulsoup_constructor_does_lookup(self):
+
+ with warnings.catch_warnings(record=True) as w:
+ # This will create a warning about not explicitly
+ # specifying a parser, but we'll ignore it.
+
+ # You can pass in a string.
+ BeautifulSoup("", features="html")
+ # Or a list of strings.
+ BeautifulSoup("", features=["html", "fast"])
+
+ # You'll get an exception if BS can't find an appropriate
+ # builder.
+ self.assertRaises(ValueError, BeautifulSoup,
+ "", features="no-such-feature")
+
+class RegistryTest(unittest.TestCase):
+ """Test the TreeBuilderRegistry class in general."""
+
+ def setUp(self):
+ self.registry = TreeBuilderRegistry()
+
+ def builder_for_features(self, *feature_list):
+ cls = type('Builder_' + '_'.join(feature_list),
+ (object,), {'features' : feature_list})
+
+ self.registry.register(cls)
+ return cls
+
+ def test_register_with_no_features(self):
+ builder = self.builder_for_features()
+
+ # Since the builder advertises no features, you can't find it
+ # by looking up features.
+ self.assertEqual(self.registry.lookup('foo'), None)
+
+ # But you can find it by doing a lookup with no features, if
+ # this happens to be the only registered builder.
+ self.assertEqual(self.registry.lookup(), builder)
+
+ def test_register_with_features_makes_lookup_succeed(self):
+ builder = self.builder_for_features('foo', 'bar')
+ self.assertEqual(self.registry.lookup('foo'), builder)
+ self.assertEqual(self.registry.lookup('bar'), builder)
+
+ def test_lookup_fails_when_no_builder_implements_feature(self):
+ builder = self.builder_for_features('foo', 'bar')
+ self.assertEqual(self.registry.lookup('baz'), None)
+
+ def test_lookup_gets_most_recent_registration_when_no_feature_specified(self):
+ builder1 = self.builder_for_features('foo')
+ builder2 = self.builder_for_features('bar')
+ self.assertEqual(self.registry.lookup(), builder2)
+
+ def test_lookup_fails_when_no_tree_builders_registered(self):
+ self.assertEqual(self.registry.lookup(), None)
+
+ def test_lookup_gets_most_recent_builder_supporting_all_features(self):
+ has_one = self.builder_for_features('foo')
+ has_the_other = self.builder_for_features('bar')
+ has_both_early = self.builder_for_features('foo', 'bar', 'baz')
+ has_both_late = self.builder_for_features('foo', 'bar', 'quux')
+ lacks_one = self.builder_for_features('bar')
+ has_the_other = self.builder_for_features('foo')
+
+ # There are two builders featuring 'foo' and 'bar', but
+ # the one that also features 'quux' was registered later.
+ self.assertEqual(self.registry.lookup('foo', 'bar'),
+ has_both_late)
+
+ # There is only one builder featuring 'foo', 'bar', and 'baz'.
+ self.assertEqual(self.registry.lookup('foo', 'bar', 'baz'),
+ has_both_early)
+
+ def test_lookup_fails_when_cannot_reconcile_requested_features(self):
+ builder1 = self.builder_for_features('foo', 'bar')
+ builder2 = self.builder_for_features('foo', 'baz')
+ self.assertEqual(self.registry.lookup('bar', 'baz'), None)
diff --git a/poky/bitbake/lib/bs4/tests/test_docs.py b/poky/bitbake/lib/bs4/tests/test_docs.py
new file mode 100644
index 000000000..5b9f67709
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_docs.py
@@ -0,0 +1,36 @@
+"Test harness for doctests."
+
+# pylint: disable-msg=E0611,W0142
+
+__metaclass__ = type
+__all__ = [
+ 'additional_tests',
+ ]
+
+import atexit
+import doctest
+import os
+#from pkg_resources import (
+# resource_filename, resource_exists, resource_listdir, cleanup_resources)
+import unittest
+
+DOCTEST_FLAGS = (
+ doctest.ELLIPSIS |
+ doctest.NORMALIZE_WHITESPACE |
+ doctest.REPORT_NDIFF)
+
+
+# def additional_tests():
+# "Run the doc tests (README.txt and docs/*, if any exist)"
+# doctest_files = [
+# os.path.abspath(resource_filename('bs4', 'README.txt'))]
+# if resource_exists('bs4', 'docs'):
+# for name in resource_listdir('bs4', 'docs'):
+# if name.endswith('.txt'):
+# doctest_files.append(
+# os.path.abspath(
+# resource_filename('bs4', 'docs/%s' % name)))
+# kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS)
+# atexit.register(cleanup_resources)
+# return unittest.TestSuite((
+# doctest.DocFileSuite(*doctest_files, **kwargs)))
diff --git a/poky/bitbake/lib/bs4/tests/test_html5lib.py b/poky/bitbake/lib/bs4/tests/test_html5lib.py
new file mode 100644
index 000000000..a7494ca5b
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_html5lib.py
@@ -0,0 +1,98 @@
+"""Tests to ensure that the html5lib tree builder generates good trees."""
+
+import warnings
+
+try:
+ from bs4.builder import HTML5TreeBuilder
+ HTML5LIB_PRESENT = True
+except ImportError as e:
+ HTML5LIB_PRESENT = False
+from bs4.element import SoupStrainer
+from bs4.testing import (
+ HTML5TreeBuilderSmokeTest,
+ SoupTest,
+ skipIf,
+)
+
+@skipIf(
+ not HTML5LIB_PRESENT,
+ "html5lib seems not to be present, not testing its tree builder.")
+class HTML5LibBuilderSmokeTest(SoupTest, HTML5TreeBuilderSmokeTest):
+ """See ``HTML5TreeBuilderSmokeTest``."""
+
+ @property
+ def default_builder(self):
+ return HTML5TreeBuilder()
+
+ def test_soupstrainer(self):
+ # The html5lib tree builder does not support SoupStrainers.
+ strainer = SoupStrainer("b")
+ markup = "<p>A <b>bold</b> statement.</p>"
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup(markup, parse_only=strainer)
+ self.assertEqual(
+ soup.decode(), self.document_for(markup))
+
+ self.assertTrue(
+ "the html5lib tree builder doesn't support parse_only" in
+ str(w[0].message))
+
+ def test_correctly_nested_tables(self):
+ """html5lib inserts <tbody> tags where other parsers don't."""
+ markup = ('<table id="1">'
+ '<tr>'
+ "<td>Here's another table:"
+ '<table id="2">'
+ '<tr><td>foo</td></tr>'
+ '</table></td>')
+
+ self.assertSoupEquals(
+ markup,
+ '<table id="1"><tbody><tr><td>Here\'s another table:'
+ '<table id="2"><tbody><tr><td>foo</td></tr></tbody></table>'
+ '</td></tr></tbody></table>')
+
+ self.assertSoupEquals(
+ "<table><thead><tr><td>Foo</td></tr></thead>"
+ "<tbody><tr><td>Bar</td></tr></tbody>"
+ "<tfoot><tr><td>Baz</td></tr></tfoot></table>")
+
+ def test_xml_declaration_followed_by_doctype(self):
+ markup = '''<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html>
+<html>
+ <head>
+ </head>
+ <body>
+ <p>foo</p>
+ </body>
+</html>'''
+ soup = self.soup(markup)
+ # Verify that we can reach the <p> tag; this means the tree is connected.
+ self.assertEqual(b"<p>foo</p>", soup.p.encode())
+
+ def test_reparented_markup(self):
+ markup = '<p><em>foo</p>\n<p>bar<a></a></em></p>'
+ soup = self.soup(markup)
+ self.assertEqual("<body><p><em>foo</em></p><em>\n</em><p><em>bar<a></a></em></p></body>", soup.body.decode())
+ self.assertEqual(2, len(soup.find_all('p')))
+
+
+ def test_reparented_markup_ends_with_whitespace(self):
+ markup = '<p><em>foo</p>\n<p>bar<a></a></em></p>\n'
+ soup = self.soup(markup)
+ self.assertEqual("<body><p><em>foo</em></p><em>\n</em><p><em>bar<a></a></em></p>\n</body>", soup.body.decode())
+ self.assertEqual(2, len(soup.find_all('p')))
+
+ def test_processing_instruction(self):
+ """Processing instructions become comments."""
+ markup = b"""<?PITarget PIContent?>"""
+ soup = self.soup(markup)
+ assert str(soup).startswith("<!--?PITarget PIContent?-->")
+
+ def test_cloned_multivalue_node(self):
+ markup = b"""<a class="my_class"><p></a>"""
+ soup = self.soup(markup)
+ a1, a2 = soup.find_all('a')
+ self.assertEqual(a1, a2)
+ assert a1 is not a2
diff --git a/poky/bitbake/lib/bs4/tests/test_htmlparser.py b/poky/bitbake/lib/bs4/tests/test_htmlparser.py
new file mode 100644
index 000000000..b45e35f99
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_htmlparser.py
@@ -0,0 +1,32 @@
+"""Tests to ensure that the html.parser tree builder generates good
+trees."""
+
+from pdb import set_trace
+import pickle
+from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
+from bs4.builder import HTMLParserTreeBuilder
+
+class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
+
+ @property
+ def default_builder(self):
+ return HTMLParserTreeBuilder()
+
+ def test_namespaced_system_doctype(self):
+ # html.parser can't handle namespaced doctypes, so skip this one.
+ pass
+
+ def test_namespaced_public_doctype(self):
+ # html.parser can't handle namespaced doctypes, so skip this one.
+ pass
+
+ def test_builder_is_pickled(self):
+ """Unlike most tree builders, HTMLParserTreeBuilder and will
+ be restored after pickling.
+ """
+ tree = self.soup("<a><b>foo</a>")
+ dumped = pickle.dumps(tree, 2)
+ loaded = pickle.loads(dumped)
+ self.assertTrue(isinstance(loaded.builder, type(tree.builder)))
+
+
diff --git a/poky/bitbake/lib/bs4/tests/test_lxml.py b/poky/bitbake/lib/bs4/tests/test_lxml.py
new file mode 100644
index 000000000..6c2a1d73e
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_lxml.py
@@ -0,0 +1,76 @@
+"""Tests to ensure that the lxml tree builder generates good trees."""
+
+import re
+import warnings
+
+try:
+ import lxml.etree
+ LXML_PRESENT = True
+ LXML_VERSION = lxml.etree.LXML_VERSION
+except ImportError as e:
+ LXML_PRESENT = False
+ LXML_VERSION = (0,)
+
+if LXML_PRESENT:
+ from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
+
+from bs4 import (
+ BeautifulSoup,
+ BeautifulStoneSoup,
+ )
+from bs4.element import Comment, Doctype, SoupStrainer
+from bs4.testing import skipIf
+from bs4.tests import test_htmlparser
+from bs4.testing import (
+ HTMLTreeBuilderSmokeTest,
+ XMLTreeBuilderSmokeTest,
+ SoupTest,
+ skipIf,
+)
+
+@skipIf(
+ not LXML_PRESENT,
+ "lxml seems not to be present, not testing its tree builder.")
+class LXMLTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
+ """See ``HTMLTreeBuilderSmokeTest``."""
+
+ @property
+ def default_builder(self):
+ return LXMLTreeBuilder()
+
+ def test_out_of_range_entity(self):
+ self.assertSoupEquals(
+ "<p>foo&#10000000000000;bar</p>", "<p>foobar</p>")
+ self.assertSoupEquals(
+ "<p>foo&#x10000000000000;bar</p>", "<p>foobar</p>")
+ self.assertSoupEquals(
+ "<p>foo&#1000000000;bar</p>", "<p>foobar</p>")
+
+ # In lxml < 2.3.5, an empty doctype causes a segfault. Skip this
+ # test if an old version of lxml is installed.
+
+ @skipIf(
+ not LXML_PRESENT or LXML_VERSION < (2,3,5,0),
+ "Skipping doctype test for old version of lxml to avoid segfault.")
+ def test_empty_doctype(self):
+ soup = self.soup("<!DOCTYPE>")
+ doctype = soup.contents[0]
+ self.assertEqual("", doctype.strip())
+
+ def test_beautifulstonesoup_is_xml_parser(self):
+ # Make sure that the deprecated BSS class uses an xml builder
+ # if one is installed.
+ with warnings.catch_warnings(record=True) as w:
+ soup = BeautifulStoneSoup("<b />")
+ self.assertEqual("<b/>", str(soup.b))
+ self.assertTrue("BeautifulStoneSoup class is deprecated" in str(w[0].message))
+
+@skipIf(
+ not LXML_PRESENT,
+ "lxml seems not to be present, not testing its XML tree builder.")
+class LXMLXMLTreeBuilderSmokeTest(SoupTest, XMLTreeBuilderSmokeTest):
+ """See ``HTMLTreeBuilderSmokeTest``."""
+
+ @property
+ def default_builder(self):
+ return LXMLTreeBuilderForXML()
diff --git a/poky/bitbake/lib/bs4/tests/test_soup.py b/poky/bitbake/lib/bs4/tests/test_soup.py
new file mode 100644
index 000000000..f87949e3d
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_soup.py
@@ -0,0 +1,483 @@
+# -*- coding: utf-8 -*-
+"""Tests of Beautiful Soup as a whole."""
+
+from pdb import set_trace
+import logging
+import unittest
+import sys
+import tempfile
+
+from bs4 import (
+ BeautifulSoup,
+ BeautifulStoneSoup,
+)
+from bs4.element import (
+ CharsetMetaAttributeValue,
+ ContentMetaAttributeValue,
+ SoupStrainer,
+ NamespacedAttribute,
+ )
+import bs4.dammit
+from bs4.dammit import (
+ EntitySubstitution,
+ UnicodeDammit,
+ EncodingDetector,
+)
+from bs4.testing import (
+ SoupTest,
+ skipIf,
+)
+import warnings
+
+try:
+ from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML
+ LXML_PRESENT = True
+except ImportError as e:
+ LXML_PRESENT = False
+
+PYTHON_2_PRE_2_7 = (sys.version_info < (2,7))
+PYTHON_3_PRE_3_2 = (sys.version_info[0] == 3 and sys.version_info < (3,2))
+
+class TestConstructor(SoupTest):
+
+ def test_short_unicode_input(self):
+ data = "<h1>éé</h1>"
+ soup = self.soup(data)
+ self.assertEqual("éé", soup.h1.string)
+
+ def test_embedded_null(self):
+ data = "<h1>foo\0bar</h1>"
+ soup = self.soup(data)
+ self.assertEqual("foo\0bar", soup.h1.string)
+
+ def test_exclude_encodings(self):
+ utf8_data = "Räksmörgås".encode("utf-8")
+ soup = self.soup(utf8_data, exclude_encodings=["utf-8"])
+ self.assertEqual("windows-1252", soup.original_encoding)
+
+
+class TestWarnings(SoupTest):
+
+ def _no_parser_specified(self, s, is_there=True):
+ v = s.startswith(BeautifulSoup.NO_PARSER_SPECIFIED_WARNING[:80])
+ self.assertTrue(v)
+
+ def test_warning_if_no_parser_specified(self):
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("<a><b></b></a>")
+ msg = str(w[0].message)
+ self._assert_no_parser_specified(msg)
+
+ def test_warning_if_parser_specified_too_vague(self):
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("<a><b></b></a>", "html")
+ msg = str(w[0].message)
+ self._assert_no_parser_specified(msg)
+
+ def test_no_warning_if_explicit_parser_specified(self):
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("<a><b></b></a>", "html.parser")
+ self.assertEqual([], w)
+
+ def test_parseOnlyThese_renamed_to_parse_only(self):
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("<a><b></b></a>", parseOnlyThese=SoupStrainer("b"))
+ msg = str(w[0].message)
+ self.assertTrue("parseOnlyThese" in msg)
+ self.assertTrue("parse_only" in msg)
+ self.assertEqual(b"<b></b>", soup.encode())
+
+ def test_fromEncoding_renamed_to_from_encoding(self):
+ with warnings.catch_warnings(record=True) as w:
+ utf8 = b"\xc3\xa9"
+ soup = self.soup(utf8, fromEncoding="utf8")
+ msg = str(w[0].message)
+ self.assertTrue("fromEncoding" in msg)
+ self.assertTrue("from_encoding" in msg)
+ self.assertEqual("utf8", soup.original_encoding)
+
+ def test_unrecognized_keyword_argument(self):
+ self.assertRaises(
+ TypeError, self.soup, "<a>", no_such_argument=True)
+
+class TestWarnings(SoupTest):
+
+ def test_disk_file_warning(self):
+ filehandle = tempfile.NamedTemporaryFile()
+ filename = filehandle.name
+ try:
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup(filename)
+ msg = str(w[0].message)
+ self.assertTrue("looks like a filename" in msg)
+ finally:
+ filehandle.close()
+
+ # The file no longer exists, so Beautiful Soup will no longer issue the warning.
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup(filename)
+ self.assertEqual(0, len(w))
+
+ def test_url_warning(self):
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("http://www.crummy.com/")
+ msg = str(w[0].message)
+ self.assertTrue("looks like a URL" in msg)
+
+ with warnings.catch_warnings(record=True) as w:
+ soup = self.soup("http://www.crummy.com/ is great")
+ self.assertEqual(0, len(w))
+
+class TestSelectiveParsing(SoupTest):
+
+ def test_parse_with_soupstrainer(self):
+ markup = "No<b>Yes</b><a>No<b>Yes <c>Yes</c></b>"
+ strainer = SoupStrainer("b")
+ soup = self.soup(markup, parse_only=strainer)
+ self.assertEqual(soup.encode(), b"<b>Yes</b><b>Yes <c>Yes</c></b>")
+
+
+class TestEntitySubstitution(unittest.TestCase):
+ """Standalone tests of the EntitySubstitution class."""
+ def setUp(self):
+ self.sub = EntitySubstitution
+
+ def test_simple_html_substitution(self):
+ # Unicode characters corresponding to named HTML entites
+ # are substituted, and no others.
+ s = "foo\u2200\N{SNOWMAN}\u00f5bar"
+ self.assertEqual(self.sub.substitute_html(s),
+ "foo&forall;\N{SNOWMAN}&otilde;bar")
+
+ def test_smart_quote_substitution(self):
+ # MS smart quotes are a common source of frustration, so we
+ # give them a special test.
+ quotes = b"\x91\x92foo\x93\x94"
+ dammit = UnicodeDammit(quotes)
+ self.assertEqual(self.sub.substitute_html(dammit.markup),
+ "&lsquo;&rsquo;foo&ldquo;&rdquo;")
+
+ def test_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_false(self):
+ s = 'Welcome to "my bar"'
+ self.assertEqual(self.sub.substitute_xml(s, False), s)
+
+ def test_xml_attribute_quoting_normally_uses_double_quotes(self):
+ self.assertEqual(self.sub.substitute_xml("Welcome", True),
+ '"Welcome"')
+ self.assertEqual(self.sub.substitute_xml("Bob's Bar", True),
+ '"Bob\'s Bar"')
+
+ def test_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotes(self):
+ s = 'Welcome to "my bar"'
+ self.assertEqual(self.sub.substitute_xml(s, True),
+ "'Welcome to \"my bar\"'")
+
+ def test_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotes(self):
+ s = 'Welcome to "Bob\'s Bar"'
+ self.assertEqual(
+ self.sub.substitute_xml(s, True),
+ '"Welcome to &quot;Bob\'s Bar&quot;"')
+
+ def test_xml_quotes_arent_escaped_when_value_is_not_being_quoted(self):
+ quoted = 'Welcome to "Bob\'s Bar"'
+ self.assertEqual(self.sub.substitute_xml(quoted), quoted)
+
+ def test_xml_quoting_handles_angle_brackets(self):
+ self.assertEqual(
+ self.sub.substitute_xml("foo<bar>"),
+ "foo&lt;bar&gt;")
+
+ def test_xml_quoting_handles_ampersands(self):
+ self.assertEqual(self.sub.substitute_xml("AT&T"), "AT&amp;T")
+
+ def test_xml_quoting_including_ampersands_when_they_are_part_of_an_entity(self):
+ self.assertEqual(
+ self.sub.substitute_xml("&Aacute;T&T"),
+ "&amp;Aacute;T&amp;T")
+
+ def test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entity(self):
+ self.assertEqual(
+ self.sub.substitute_xml_containing_entities("&Aacute;T&T"),
+ "&Aacute;T&amp;T")
+
+ def test_quotes_not_html_substituted(self):
+ """There's no need to do this except inside attribute values."""
+ text = 'Bob\'s "bar"'
+ self.assertEqual(self.sub.substitute_html(text), text)
+
+
+class TestEncodingConversion(SoupTest):
+ # Test Beautiful Soup's ability to decode and encode from various
+ # encodings.
+
+ def setUp(self):
+ super(TestEncodingConversion, self).setUp()
+ self.unicode_data = '<html><head><meta charset="utf-8"/></head><body><foo>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</foo></body></html>'
+ self.utf8_data = self.unicode_data.encode("utf-8")
+ # Just so you know what it looks like.
+ self.assertEqual(
+ self.utf8_data,
+ b'<html><head><meta charset="utf-8"/></head><body><foo>Sacr\xc3\xa9 bleu!</foo></body></html>')
+
+ def test_ascii_in_unicode_out(self):
+ # ASCII input is converted to Unicode. The original_encoding
+ # attribute is set to 'utf-8', a superset of ASCII.
+ chardet = bs4.dammit.chardet_dammit
+ logging.disable(logging.WARNING)
+ try:
+ def noop(str):
+ return None
+ # Disable chardet, which will realize that the ASCII is ASCII.
+ bs4.dammit.chardet_dammit = noop
+ ascii = b"<foo>a</foo>"
+ soup_from_ascii = self.soup(ascii)
+ unicode_output = soup_from_ascii.decode()
+ self.assertTrue(isinstance(unicode_output, str))
+ self.assertEqual(unicode_output, self.document_for(ascii.decode()))
+ self.assertEqual(soup_from_ascii.original_encoding.lower(), "utf-8")
+ finally:
+ logging.disable(logging.NOTSET)
+ bs4.dammit.chardet_dammit = chardet
+
+ def test_unicode_in_unicode_out(self):
+ # Unicode input is left alone. The original_encoding attribute
+ # is not set.
+ soup_from_unicode = self.soup(self.unicode_data)
+ self.assertEqual(soup_from_unicode.decode(), self.unicode_data)
+ self.assertEqual(soup_from_unicode.foo.string, 'Sacr\xe9 bleu!')
+ self.assertEqual(soup_from_unicode.original_encoding, None)
+
+ def test_utf8_in_unicode_out(self):
+ # UTF-8 input is converted to Unicode. The original_encoding
+ # attribute is set.
+ soup_from_utf8 = self.soup(self.utf8_data)
+ self.assertEqual(soup_from_utf8.decode(), self.unicode_data)
+ self.assertEqual(soup_from_utf8.foo.string, 'Sacr\xe9 bleu!')
+
+ def test_utf8_out(self):
+ # The internal data structures can be encoded as UTF-8.
+ soup_from_unicode = self.soup(self.unicode_data)
+ self.assertEqual(soup_from_unicode.encode('utf-8'), self.utf8_data)
+
+ @skipIf(
+ PYTHON_2_PRE_2_7 or PYTHON_3_PRE_3_2,
+ "Bad HTMLParser detected; skipping test of non-ASCII characters in attribute name.")
+ def test_attribute_name_containing_unicode_characters(self):
+ markup = '<div><a \N{SNOWMAN}="snowman"></a></div>'
+ self.assertEqual(self.soup(markup).div.encode("utf8"), markup.encode("utf8"))
+
+class TestUnicodeDammit(unittest.TestCase):
+ """Standalone tests of UnicodeDammit."""
+
+ def test_unicode_input(self):
+ markup = "I'm already Unicode! \N{SNOWMAN}"
+ dammit = UnicodeDammit(markup)
+ self.assertEqual(dammit.unicode_markup, markup)
+
+ def test_smart_quotes_to_unicode(self):
+ markup = b"<foo>\x91\x92\x93\x94</foo>"
+ dammit = UnicodeDammit(markup)
+ self.assertEqual(
+ dammit.unicode_markup, "<foo>\u2018\u2019\u201c\u201d</foo>")
+
+ def test_smart_quotes_to_xml_entities(self):
+ markup = b"<foo>\x91\x92\x93\x94</foo>"
+ dammit = UnicodeDammit(markup, smart_quotes_to="xml")
+ self.assertEqual(
+ dammit.unicode_markup, "<foo>&#x2018;&#x2019;&#x201C;&#x201D;</foo>")
+
+ def test_smart_quotes_to_html_entities(self):
+ markup = b"<foo>\x91\x92\x93\x94</foo>"
+ dammit = UnicodeDammit(markup, smart_quotes_to="html")
+ self.assertEqual(
+ dammit.unicode_markup, "<foo>&lsquo;&rsquo;&ldquo;&rdquo;</foo>")
+
+ def test_smart_quotes_to_ascii(self):
+ markup = b"<foo>\x91\x92\x93\x94</foo>"
+ dammit = UnicodeDammit(markup, smart_quotes_to="ascii")
+ self.assertEqual(
+ dammit.unicode_markup, """<foo>''""</foo>""")
+
+ def test_detect_utf8(self):
+ utf8 = b"Sacr\xc3\xa9 bleu! \xe2\x98\x83"
+ dammit = UnicodeDammit(utf8)
+ self.assertEqual(dammit.original_encoding.lower(), 'utf-8')
+ self.assertEqual(dammit.unicode_markup, 'Sacr\xe9 bleu! \N{SNOWMAN}')
+
+
+ def test_convert_hebrew(self):
+ hebrew = b"\xed\xe5\xec\xf9"
+ dammit = UnicodeDammit(hebrew, ["iso-8859-8"])
+ self.assertEqual(dammit.original_encoding.lower(), 'iso-8859-8')
+ self.assertEqual(dammit.unicode_markup, '\u05dd\u05d5\u05dc\u05e9')
+
+ def test_dont_see_smart_quotes_where_there_are_none(self):
+ utf_8 = b"\343\202\261\343\203\274\343\202\277\343\202\244 Watch"
+ dammit = UnicodeDammit(utf_8)
+ self.assertEqual(dammit.original_encoding.lower(), 'utf-8')
+ self.assertEqual(dammit.unicode_markup.encode("utf-8"), utf_8)
+
+ def test_ignore_inappropriate_codecs(self):
+ utf8_data = "Räksmörgås".encode("utf-8")
+ dammit = UnicodeDammit(utf8_data, ["iso-8859-8"])
+ self.assertEqual(dammit.original_encoding.lower(), 'utf-8')
+
+ def test_ignore_invalid_codecs(self):
+ utf8_data = "Räksmörgås".encode("utf-8")
+ for bad_encoding in ['.utf8', '...', 'utF---16.!']:
+ dammit = UnicodeDammit(utf8_data, [bad_encoding])
+ self.assertEqual(dammit.original_encoding.lower(), 'utf-8')
+
+ def test_exclude_encodings(self):
+ # This is UTF-8.
+ utf8_data = "Räksmörgås".encode("utf-8")
+
+ # But if we exclude UTF-8 from consideration, the guess is
+ # Windows-1252.
+ dammit = UnicodeDammit(utf8_data, exclude_encodings=["utf-8"])
+ self.assertEqual(dammit.original_encoding.lower(), 'windows-1252')
+
+ # And if we exclude that, there is no valid guess at all.
+ dammit = UnicodeDammit(
+ utf8_data, exclude_encodings=["utf-8", "windows-1252"])
+ self.assertEqual(dammit.original_encoding, None)
+
+ def test_encoding_detector_replaces_junk_in_encoding_name_with_replacement_character(self):
+ detected = EncodingDetector(
+ b'<?xml version="1.0" encoding="UTF-\xdb" ?>')
+ encodings = list(detected.encodings)
+ assert 'utf-\N{REPLACEMENT CHARACTER}' in encodings
+
+ def test_detect_html5_style_meta_tag(self):
+
+ for data in (
+ b'<html><meta charset="euc-jp" /></html>',
+ b"<html><meta charset='euc-jp' /></html>",
+ b"<html><meta charset=euc-jp /></html>",
+ b"<html><meta charset=euc-jp/></html>"):
+ dammit = UnicodeDammit(data, is_html=True)
+ self.assertEqual(
+ "euc-jp", dammit.original_encoding)
+
+ def test_last_ditch_entity_replacement(self):
+ # This is a UTF-8 document that contains bytestrings
+ # completely incompatible with UTF-8 (ie. encoded with some other
+ # encoding).
+ #
+ # Since there is no consistent encoding for the document,
+ # Unicode, Dammit will eventually encode the document as UTF-8
+ # and encode the incompatible characters as REPLACEMENT
+ # CHARACTER.
+ #
+ # If chardet is installed, it will detect that the document
+ # can be converted into ISO-8859-1 without errors. This happens
+ # to be the wrong encoding, but it is a consistent encoding, so the
+ # code we're testing here won't run.
+ #
+ # So we temporarily disable chardet if it's present.
+ doc = b"""\357\273\277<?xml version="1.0" encoding="UTF-8"?>
+<html><b>\330\250\330\252\330\261</b>
+<i>\310\322\321\220\312\321\355\344</i></html>"""
+ chardet = bs4.dammit.chardet_dammit
+ logging.disable(logging.WARNING)
+ try:
+ def noop(str):
+ return None
+ bs4.dammit.chardet_dammit = noop
+ dammit = UnicodeDammit(doc)
+ self.assertEqual(True, dammit.contains_replacement_characters)
+ self.assertTrue("\ufffd" in dammit.unicode_markup)
+
+ soup = BeautifulSoup(doc, "html.parser")
+ self.assertTrue(soup.contains_replacement_characters)
+ finally:
+ logging.disable(logging.NOTSET)
+ bs4.dammit.chardet_dammit = chardet
+
+ def test_byte_order_mark_removed(self):
+ # A document written in UTF-16LE will have its byte order marker stripped.
+ data = b'\xff\xfe<\x00a\x00>\x00\xe1\x00\xe9\x00<\x00/\x00a\x00>\x00'
+ dammit = UnicodeDammit(data)
+ self.assertEqual("<a>áé</a>", dammit.unicode_markup)
+ self.assertEqual("utf-16le", dammit.original_encoding)
+
+ def test_detwingle(self):
+ # Here's a UTF8 document.
+ utf8 = ("\N{SNOWMAN}" * 3).encode("utf8")
+
+ # Here's a Windows-1252 document.
+ windows_1252 = (
+ "\N{LEFT DOUBLE QUOTATION MARK}Hi, I like Windows!"
+ "\N{RIGHT DOUBLE QUOTATION MARK}").encode("windows_1252")
+
+ # Through some unholy alchemy, they've been stuck together.
+ doc = utf8 + windows_1252 + utf8
+
+ # The document can't be turned into UTF-8:
+ self.assertRaises(UnicodeDecodeError, doc.decode, "utf8")
+
+ # Unicode, Dammit thinks the whole document is Windows-1252,
+ # and decodes it into "☃☃☃“Hi, I like Windows!â€Ã¢ËœÆ’☃☃"
+
+ # But if we run it through fix_embedded_windows_1252, it's fixed:
+
+ fixed = UnicodeDammit.detwingle(doc)
+ self.assertEqual(
+ "☃☃☃“Hi, I like Windows!â€â˜ƒâ˜ƒâ˜ƒ", fixed.decode("utf8"))
+
+ def test_detwingle_ignores_multibyte_characters(self):
+ # Each of these characters has a UTF-8 representation ending
+ # in \x93. \x93 is a smart quote if interpreted as
+ # Windows-1252. But our code knows to skip over multibyte
+ # UTF-8 characters, so they'll survive the process unscathed.
+ for tricky_unicode_char in (
+ "\N{LATIN SMALL LIGATURE OE}", # 2-byte char '\xc5\x93'
+ "\N{LATIN SUBSCRIPT SMALL LETTER X}", # 3-byte char '\xe2\x82\x93'
+ "\xf0\x90\x90\x93", # This is a CJK character, not sure which one.
+ ):
+ input = tricky_unicode_char.encode("utf8")
+ self.assertTrue(input.endswith(b'\x93'))
+ output = UnicodeDammit.detwingle(input)
+ self.assertEqual(output, input)
+
+class TestNamedspacedAttribute(SoupTest):
+
+ def test_name_may_be_none(self):
+ a = NamespacedAttribute("xmlns", None)
+ self.assertEqual(a, "xmlns")
+
+ def test_attribute_is_equivalent_to_colon_separated_string(self):
+ a = NamespacedAttribute("a", "b")
+ self.assertEqual("a:b", a)
+
+ def test_attributes_are_equivalent_if_prefix_and_name_identical(self):
+ a = NamespacedAttribute("a", "b", "c")
+ b = NamespacedAttribute("a", "b", "c")
+ self.assertEqual(a, b)
+
+ # The actual namespace is not considered.
+ c = NamespacedAttribute("a", "b", None)
+ self.assertEqual(a, c)
+
+ # But name and prefix are important.
+ d = NamespacedAttribute("a", "z", "c")
+ self.assertNotEqual(a, d)
+
+ e = NamespacedAttribute("z", "b", "c")
+ self.assertNotEqual(a, e)
+
+
+class TestAttributeValueWithCharsetSubstitution(unittest.TestCase):
+
+ def test_content_meta_attribute_value(self):
+ value = CharsetMetaAttributeValue("euc-jp")
+ self.assertEqual("euc-jp", value)
+ self.assertEqual("euc-jp", value.original_value)
+ self.assertEqual("utf8", value.encode("utf8"))
+
+
+ def test_content_meta_attribute_value(self):
+ value = ContentMetaAttributeValue("text/html; charset=euc-jp")
+ self.assertEqual("text/html; charset=euc-jp", value)
+ self.assertEqual("text/html; charset=euc-jp", value.original_value)
+ self.assertEqual("text/html; charset=utf8", value.encode("utf8"))
diff --git a/poky/bitbake/lib/bs4/tests/test_tree.py b/poky/bitbake/lib/bs4/tests/test_tree.py
new file mode 100644
index 000000000..6d3e67f31
--- /dev/null
+++ b/poky/bitbake/lib/bs4/tests/test_tree.py
@@ -0,0 +1,2011 @@
+# -*- coding: utf-8 -*-
+"""Tests for Beautiful Soup's tree traversal methods.
+
+The tree traversal methods are the main advantage of using Beautiful
+Soup over just using a parser.
+
+Different parsers will build different Beautiful Soup trees given the
+same markup, but all Beautiful Soup trees can be traversed with the
+methods tested here.
+"""
+
+from pdb import set_trace
+import copy
+import pickle
+import re
+import warnings
+from bs4 import BeautifulSoup
+from bs4.builder import (
+ builder_registry,
+ HTMLParserTreeBuilder,
+)
+from bs4.element import (
+ PY3K,
+ CData,
+ Comment,
+ Declaration,
+ Doctype,
+ NavigableString,
+ SoupStrainer,
+ Tag,
+)
+from bs4.testing import (
+ SoupTest,
+ skipIf,
+)
+
+XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None)
+LXML_PRESENT = (builder_registry.lookup("lxml") is not None)
+
+class TreeTest(SoupTest):
+
+ def assertSelects(self, tags, should_match):
+ """Make sure that the given tags have the correct text.
+
+ This is used in tests that define a bunch of tags, each
+ containing a single string, and then select certain strings by
+ some mechanism.
+ """
+ self.assertEqual([tag.string for tag in tags], should_match)
+
+ def assertSelectsIDs(self, tags, should_match):
+ """Make sure that the given tags have the correct IDs.
+
+ This is used in tests that define a bunch of tags, each
+ containing a single string, and then select certain strings by
+ some mechanism.
+ """
+ self.assertEqual([tag['id'] for tag in tags], should_match)
+
+
+class TestFind(TreeTest):
+ """Basic tests of the find() method.
+
+ find() just calls find_all() with limit=1, so it's not tested all
+ that thouroughly here.
+ """
+
+ def test_find_tag(self):
+ soup = self.soup("<a>1</a><b>2</b><a>3</a><b>4</b>")
+ self.assertEqual(soup.find("b").string, "2")
+
+ def test_unicode_text_find(self):
+ soup = self.soup('<h1>Räksmörgås</h1>')
+ self.assertEqual(soup.find(string='Räksmörgås'), 'Räksmörgås')
+
+ def test_unicode_attribute_find(self):
+ soup = self.soup('<h1 id="Räksmörgås">here it is</h1>')
+ str(soup)
+ self.assertEqual("here it is", soup.find(id='Räksmörgås').text)
+
+
+ def test_find_everything(self):
+ """Test an optimization that finds all tags."""
+ soup = self.soup("<a>foo</a><b>bar</b>")
+ self.assertEqual(2, len(soup.find_all()))
+
+ def test_find_everything_with_name(self):
+ """Test an optimization that finds all tags with a given name."""
+ soup = self.soup("<a>foo</a><b>bar</b><a>baz</a>")
+ self.assertEqual(2, len(soup.find_all('a')))
+
+class TestFindAll(TreeTest):
+ """Basic tests of the find_all() method."""
+
+ def test_find_all_text_nodes(self):
+ """You can search the tree for text nodes."""
+ soup = self.soup("<html>Foo<b>bar</b>\xbb</html>")
+ # Exact match.
+ self.assertEqual(soup.find_all(string="bar"), ["bar"])
+ self.assertEqual(soup.find_all(text="bar"), ["bar"])
+ # Match any of a number of strings.
+ self.assertEqual(
+ soup.find_all(text=["Foo", "bar"]), ["Foo", "bar"])
+ # Match a regular expression.
+ self.assertEqual(soup.find_all(text=re.compile('.*')),
+ ["Foo", "bar", '\xbb'])
+ # Match anything.
+ self.assertEqual(soup.find_all(text=True),
+ ["Foo", "bar", '\xbb'])
+
+ def test_find_all_limit(self):
+ """You can limit the number of items returned by find_all."""
+ soup = self.soup("<a>1</a><a>2</a><a>3</a><a>4</a><a>5</a>")
+ self.assertSelects(soup.find_all('a', limit=3), ["1", "2", "3"])
+ self.assertSelects(soup.find_all('a', limit=1), ["1"])
+ self.assertSelects(
+ soup.find_all('a', limit=10), ["1", "2", "3", "4", "5"])
+
+ # A limit of 0 means no limit.
+ self.assertSelects(
+ soup.find_all('a', limit=0), ["1", "2", "3", "4", "5"])
+
+ def test_calling_a_tag_is_calling_findall(self):
+ soup = self.soup("<a>1</a><b>2<a id='foo'>3</a></b>")
+ self.assertSelects(soup('a', limit=1), ["1"])
+ self.assertSelects(soup.b(id="foo"), ["3"])
+
+ def test_find_all_with_self_referential_data_structure_does_not_cause_infinite_recursion(self):
+ soup = self.soup("<a></a>")
+ # Create a self-referential list.
+ l = []
+ l.append(l)
+
+ # Without special code in _normalize_search_value, this would cause infinite
+ # recursion.
+ self.assertEqual([], soup.find_all(l))
+
+ def test_find_all_resultset(self):
+ """All find_all calls return a ResultSet"""
+ soup = self.soup("<a></a>")
+ result = soup.find_all("a")
+ self.assertTrue(hasattr(result, "source"))
+
+ result = soup.find_all(True)
+ self.assertTrue(hasattr(result, "source"))
+
+ result = soup.find_all(text="foo")
+ self.assertTrue(hasattr(result, "source"))
+
+
+class TestFindAllBasicNamespaces(TreeTest):
+
+ def test_find_by_namespaced_name(self):
+ soup = self.soup('<mathml:msqrt>4</mathml:msqrt><a svg:fill="red">')
+ self.assertEqual("4", soup.find("mathml:msqrt").string)
+ self.assertEqual("a", soup.find(attrs= { "svg:fill" : "red" }).name)
+
+
+class TestFindAllByName(TreeTest):
+ """Test ways of finding tags by tag name."""
+
+ def setUp(self):
+ super(TreeTest, self).setUp()
+ self.tree = self.soup("""<a>First tag.</a>
+ <b>Second tag.</b>
+ <c>Third <a>Nested tag.</a> tag.</c>""")
+
+ def test_find_all_by_tag_name(self):
+ # Find all the <a> tags.
+ self.assertSelects(
+ self.tree.find_all('a'), ['First tag.', 'Nested tag.'])
+
+ def test_find_all_by_name_and_text(self):
+ self.assertSelects(
+ self.tree.find_all('a', text='First tag.'), ['First tag.'])
+
+ self.assertSelects(
+ self.tree.find_all('a', text=True), ['First tag.', 'Nested tag.'])
+
+ self.assertSelects(
+ self.tree.find_all('a', text=re.compile("tag")),
+ ['First tag.', 'Nested tag.'])
+
+
+ def test_find_all_on_non_root_element(self):
+ # You can call find_all on any node, not just the root.
+ self.assertSelects(self.tree.c.find_all('a'), ['Nested tag.'])
+
+ def test_calling_element_invokes_find_all(self):
+ self.assertSelects(self.tree('a'), ['First tag.', 'Nested tag.'])
+
+ def test_find_all_by_tag_strainer(self):
+ self.assertSelects(
+ self.tree.find_all(SoupStrainer('a')),
+ ['First tag.', 'Nested tag.'])
+
+ def test_find_all_by_tag_names(self):
+ self.assertSelects(
+ self.tree.find_all(['a', 'b']),
+ ['First tag.', 'Second tag.', 'Nested tag.'])
+
+ def test_find_all_by_tag_dict(self):
+ self.assertSelects(
+ self.tree.find_all({'a' : True, 'b' : True}),
+ ['First tag.', 'Second tag.', 'Nested tag.'])
+
+ def test_find_all_by_tag_re(self):
+ self.assertSelects(
+ self.tree.find_all(re.compile('^[ab]$')),
+ ['First tag.', 'Second tag.', 'Nested tag.'])
+
+ def test_find_all_with_tags_matching_method(self):
+ # You can define an oracle method that determines whether
+ # a tag matches the search.
+ def id_matches_name(tag):
+ return tag.name == tag.get('id')
+
+ tree = self.soup("""<a id="a">Match 1.</a>
+ <a id="1">Does not match.</a>
+ <b id="b">Match 2.</a>""")
+
+ self.assertSelects(
+ tree.find_all(id_matches_name), ["Match 1.", "Match 2."])
+
+
+class TestFindAllByAttribute(TreeTest):
+
+ def test_find_all_by_attribute_name(self):
+ # You can pass in keyword arguments to find_all to search by
+ # attribute.
+ tree = self.soup("""
+ <a id="first">Matching a.</a>
+ <a id="second">
+ Non-matching <b id="first">Matching b.</b>a.
+ </a>""")
+ self.assertSelects(tree.find_all(id='first'),
+ ["Matching a.", "Matching b."])
+
+ def test_find_all_by_utf8_attribute_value(self):
+ peace = "×ולש".encode("utf8")
+ data = '<a title="×ולש"></a>'.encode("utf8")
+ soup = self.soup(data)
+ self.assertEqual([soup.a], soup.find_all(title=peace))
+ self.assertEqual([soup.a], soup.find_all(title=peace.decode("utf8")))
+ self.assertEqual([soup.a], soup.find_all(title=[peace, "something else"]))
+
+ def test_find_all_by_attribute_dict(self):
+ # You can pass in a dictionary as the argument 'attrs'. This
+ # lets you search for attributes like 'name' (a fixed argument
+ # to find_all) and 'class' (a reserved word in Python.)
+ tree = self.soup("""
+ <a name="name1" class="class1">Name match.</a>
+ <a name="name2" class="class2">Class match.</a>
+ <a name="name3" class="class3">Non-match.</a>
+ <name1>A tag called 'name1'.</name1>
+ """)
+
+ # This doesn't do what you want.
+ self.assertSelects(tree.find_all(name='name1'),
+ ["A tag called 'name1'."])
+ # This does what you want.
+ self.assertSelects(tree.find_all(attrs={'name' : 'name1'}),
+ ["Name match."])
+
+ self.assertSelects(tree.find_all(attrs={'class' : 'class2'}),
+ ["Class match."])
+
+ def test_find_all_by_class(self):
+ tree = self.soup("""
+ <a class="1">Class 1.</a>
+ <a class="2">Class 2.</a>
+ <b class="1">Class 1.</b>
+ <c class="3 4">Class 3 and 4.</c>
+ """)
+
+ # Passing in the class_ keyword argument will search against
+ # the 'class' attribute.
+ self.assertSelects(tree.find_all('a', class_='1'), ['Class 1.'])
+ self.assertSelects(tree.find_all('c', class_='3'), ['Class 3 and 4.'])
+ self.assertSelects(tree.find_all('c', class_='4'), ['Class 3 and 4.'])
+
+ # Passing in a string to 'attrs' will also search the CSS class.
+ self.assertSelects(tree.find_all('a', '1'), ['Class 1.'])
+ self.assertSelects(tree.find_all(attrs='1'), ['Class 1.', 'Class 1.'])
+ self.assertSelects(tree.find_all('c', '3'), ['Class 3 and 4.'])
+ self.assertSelects(tree.find_all('c', '4'), ['Class 3 and 4.'])
+
+ def test_find_by_class_when_multiple_classes_present(self):
+ tree = self.soup("<gar class='foo bar'>Found it</gar>")
+
+ f = tree.find_all("gar", class_=re.compile("o"))
+ self.assertSelects(f, ["Found it"])
+
+ f = tree.find_all("gar", class_=re.compile("a"))
+ self.assertSelects(f, ["Found it"])
+
+ # Since the class is not the string "foo bar", but the two
+ # strings "foo" and "bar", this will not find anything.
+ f = tree.find_all("gar", class_=re.compile("o b"))
+ self.assertSelects(f, [])
+
+ def test_find_all_with_non_dictionary_for_attrs_finds_by_class(self):
+ soup = self.soup("<a class='bar'>Found it</a>")
+
+ self.assertSelects(soup.find_all("a", re.compile("ba")), ["Found it"])
+
+ def big_attribute_value(value):
+ return len(value) > 3
+
+ self.assertSelects(soup.find_all("a", big_attribute_value), [])
+
+ def small_attribute_value(value):
+ return len(value) <= 3
+
+ self.assertSelects(
+ soup.find_all("a", small_attribute_value), ["Found it"])
+
+ def test_find_all_with_string_for_attrs_finds_multiple_classes(self):
+ soup = self.soup('<a class="foo bar"></a><a class="foo"></a>')
+ a, a2 = soup.find_all("a")
+ self.assertEqual([a, a2], soup.find_all("a", "foo"))
+ self.assertEqual([a], soup.find_all("a", "bar"))
+
+ # If you specify the class as a string that contains a
+ # space, only that specific value will be found.
+ self.assertEqual([a], soup.find_all("a", class_="foo bar"))
+ self.assertEqual([a], soup.find_all("a", "foo bar"))
+ self.assertEqual([], soup.find_all("a", "bar foo"))
+
+ def test_find_all_by_attribute_soupstrainer(self):
+ tree = self.soup("""
+ <a id="first">Match.</a>
+ <a id="second">Non-match.</a>""")
+
+ strainer = SoupStrainer(attrs={'id' : 'first'})
+ self.assertSelects(tree.find_all(strainer), ['Match.'])
+
+ def test_find_all_with_missing_atribute(self):
+ # You can pass in None as the value of an attribute to find_all.
+ # This will match tags that do not have that attribute set.
+ tree = self.soup("""<a id="1">ID present.</a>
+ <a>No ID present.</a>
+ <a id="">ID is empty.</a>""")
+ self.assertSelects(tree.find_all('a', id=None), ["No ID present."])
+
+ def test_find_all_with_defined_attribute(self):
+ # You can pass in None as the value of an attribute to find_all.
+ # This will match tags that have that attribute set to any value.
+ tree = self.soup("""<a id="1">ID present.</a>
+ <a>No ID present.</a>
+ <a id="">ID is empty.</a>""")
+ self.assertSelects(
+ tree.find_all(id=True), ["ID present.", "ID is empty."])
+
+ def test_find_all_with_numeric_attribute(self):
+ # If you search for a number, it's treated as a string.
+ tree = self.soup("""<a id=1>Unquoted attribute.</a>
+ <a id="1">Quoted attribute.</a>""")
+
+ expected = ["Unquoted attribute.", "Quoted attribute."]
+ self.assertSelects(tree.find_all(id=1), expected)
+ self.assertSelects(tree.find_all(id="1"), expected)
+
+ def test_find_all_with_list_attribute_values(self):
+ # You can pass a list of attribute values instead of just one,
+ # and you'll get tags that match any of the values.
+ tree = self.soup("""<a id="1">1</a>
+ <a id="2">2</a>
+ <a id="3">3</a>
+ <a>No ID.</a>""")
+ self.assertSelects(tree.find_all(id=["1", "3", "4"]),
+ ["1", "3"])
+
+ def test_find_all_with_regular_expression_attribute_value(self):
+ # You can pass a regular expression as an attribute value, and
+ # you'll get tags whose values for that attribute match the
+ # regular expression.
+ tree = self.soup("""<a id="a">One a.</a>
+ <a id="aa">Two as.</a>
+ <a id="ab">Mixed as and bs.</a>
+ <a id="b">One b.</a>
+ <a>No ID.</a>""")
+
+ self.assertSelects(tree.find_all(id=re.compile("^a+$")),
+ ["One a.", "Two as."])
+
+ def test_find_by_name_and_containing_string(self):
+ soup = self.soup("<b>foo</b><b>bar</b><a>foo</a>")
+ a = soup.a
+
+ self.assertEqual([a], soup.find_all("a", text="foo"))
+ self.assertEqual([], soup.find_all("a", text="bar"))
+ self.assertEqual([], soup.find_all("a", text="bar"))
+
+ def test_find_by_name_and_containing_string_when_string_is_buried(self):
+ soup = self.soup("<a>foo</a><a><b><c>foo</c></b></a>")
+ self.assertEqual(soup.find_all("a"), soup.find_all("a", text="foo"))
+
+ def test_find_by_attribute_and_containing_string(self):
+ soup = self.soup('<b id="1">foo</b><a id="2">foo</a>')
+ a = soup.a
+
+ self.assertEqual([a], soup.find_all(id=2, text="foo"))
+ self.assertEqual([], soup.find_all(id=1, text="bar"))
+
+
+
+
+class TestIndex(TreeTest):
+ """Test Tag.index"""
+ def test_index(self):
+ tree = self.soup("""<div>
+ <a>Identical</a>
+ <b>Not identical</b>
+ <a>Identical</a>
+
+ <c><d>Identical with child</d></c>
+ <b>Also not identical</b>
+ <c><d>Identical with child</d></c>
+ </div>""")
+ div = tree.div
+ for i, element in enumerate(div.contents):
+ self.assertEqual(i, div.index(element))
+ self.assertRaises(ValueError, tree.index, 1)
+
+
+class TestParentOperations(TreeTest):
+ """Test navigation and searching through an element's parents."""
+
+ def setUp(self):
+ super(TestParentOperations, self).setUp()
+ self.tree = self.soup('''<ul id="empty"></ul>
+ <ul id="top">
+ <ul id="middle">
+ <ul id="bottom">
+ <b>Start here</b>
+ </ul>
+ </ul>''')
+ self.start = self.tree.b
+
+
+ def test_parent(self):
+ self.assertEqual(self.start.parent['id'], 'bottom')
+ self.assertEqual(self.start.parent.parent['id'], 'middle')
+ self.assertEqual(self.start.parent.parent.parent['id'], 'top')
+
+ def test_parent_of_top_tag_is_soup_object(self):
+ top_tag = self.tree.contents[0]
+ self.assertEqual(top_tag.parent, self.tree)
+
+ def test_soup_object_has_no_parent(self):
+ self.assertEqual(None, self.tree.parent)
+
+ def test_find_parents(self):
+ self.assertSelectsIDs(
+ self.start.find_parents('ul'), ['bottom', 'middle', 'top'])
+ self.assertSelectsIDs(
+ self.start.find_parents('ul', id="middle"), ['middle'])
+
+ def test_find_parent(self):
+ self.assertEqual(self.start.find_parent('ul')['id'], 'bottom')
+ self.assertEqual(self.start.find_parent('ul', id='top')['id'], 'top')
+
+ def test_parent_of_text_element(self):
+ text = self.tree.find(text="Start here")
+ self.assertEqual(text.parent.name, 'b')
+
+ def test_text_element_find_parent(self):
+ text = self.tree.find(text="Start here")
+ self.assertEqual(text.find_parent('ul')['id'], 'bottom')
+
+ def test_parent_generator(self):
+ parents = [parent['id'] for parent in self.start.parents
+ if parent is not None and 'id' in parent.attrs]
+ self.assertEqual(parents, ['bottom', 'middle', 'top'])
+
+
+class ProximityTest(TreeTest):
+
+ def setUp(self):
+ super(TreeTest, self).setUp()
+ self.tree = self.soup(
+ '<html id="start"><head></head><body><b id="1">One</b><b id="2">Two</b><b id="3">Three</b></body></html>')
+
+
+class TestNextOperations(ProximityTest):
+
+ def setUp(self):
+ super(TestNextOperations, self).setUp()
+ self.start = self.tree.b
+
+ def test_next(self):
+ self.assertEqual(self.start.next_element, "One")
+ self.assertEqual(self.start.next_element.next_element['id'], "2")
+
+ def test_next_of_last_item_is_none(self):
+ last = self.tree.find(text="Three")
+ self.assertEqual(last.next_element, None)
+
+ def test_next_of_root_is_none(self):
+ # The document root is outside the next/previous chain.
+ self.assertEqual(self.tree.next_element, None)
+
+ def test_find_all_next(self):
+ self.assertSelects(self.start.find_all_next('b'), ["Two", "Three"])
+ self.start.find_all_next(id=3)
+ self.assertSelects(self.start.find_all_next(id=3), ["Three"])
+
+ def test_find_next(self):
+ self.assertEqual(self.start.find_next('b')['id'], '2')
+ self.assertEqual(self.start.find_next(text="Three"), "Three")
+
+ def test_find_next_for_text_element(self):
+ text = self.tree.find(text="One")
+ self.assertEqual(text.find_next("b").string, "Two")
+ self.assertSelects(text.find_all_next("b"), ["Two", "Three"])
+
+ def test_next_generator(self):
+ start = self.tree.find(text="Two")
+ successors = [node for node in start.next_elements]
+ # There are two successors: the final <b> tag and its text contents.
+ tag, contents = successors
+ self.assertEqual(tag['id'], '3')
+ self.assertEqual(contents, "Three")
+
+class TestPreviousOperations(ProximityTest):
+
+ def setUp(self):
+ super(TestPreviousOperations, self).setUp()
+ self.end = self.tree.find(text="Three")
+
+ def test_previous(self):
+ self.assertEqual(self.end.previous_element['id'], "3")
+ self.assertEqual(self.end.previous_element.previous_element, "Two")
+
+ def test_previous_of_first_item_is_none(self):
+ first = self.tree.find('html')
+ self.assertEqual(first.previous_element, None)
+
+ def test_previous_of_root_is_none(self):
+ # The document root is outside the next/previous chain.
+ # XXX This is broken!
+ #self.assertEqual(self.tree.previous_element, None)
+ pass
+
+ def test_find_all_previous(self):
+ # The <b> tag containing the "Three" node is the predecessor
+ # of the "Three" node itself, which is why "Three" shows up
+ # here.
+ self.assertSelects(
+ self.end.find_all_previous('b'), ["Three", "Two", "One"])
+ self.assertSelects(self.end.find_all_previous(id=1), ["One"])
+
+ def test_find_previous(self):
+ self.assertEqual(self.end.find_previous('b')['id'], '3')
+ self.assertEqual(self.end.find_previous(text="One"), "One")
+
+ def test_find_previous_for_text_element(self):
+ text = self.tree.find(text="Three")
+ self.assertEqual(text.find_previous("b").string, "Three")
+ self.assertSelects(
+ text.find_all_previous("b"), ["Three", "Two", "One"])
+
+ def test_previous_generator(self):
+ start = self.tree.find(text="One")
+ predecessors = [node for node in start.previous_elements]
+
+ # There are four predecessors: the <b> tag containing "One"
+ # the <body> tag, the <head> tag, and the <html> tag.
+ b, body, head, html = predecessors
+ self.assertEqual(b['id'], '1')
+ self.assertEqual(body.name, "body")
+ self.assertEqual(head.name, "head")
+ self.assertEqual(html.name, "html")
+
+
+class SiblingTest(TreeTest):
+
+ def setUp(self):
+ super(SiblingTest, self).setUp()
+ markup = '''<html>
+ <span id="1">
+ <span id="1.1"></span>
+ </span>
+ <span id="2">
+ <span id="2.1"></span>
+ </span>
+ <span id="3">
+ <span id="3.1"></span>
+ </span>
+ <span id="4"></span>
+ </html>'''
+ # All that whitespace looks good but makes the tests more
+ # difficult. Get rid of it.
+ markup = re.compile("\n\s*").sub("", markup)
+ self.tree = self.soup(markup)
+
+
+class TestNextSibling(SiblingTest):
+
+ def setUp(self):
+ super(TestNextSibling, self).setUp()
+ self.start = self.tree.find(id="1")
+
+ def test_next_sibling_of_root_is_none(self):
+ self.assertEqual(self.tree.next_sibling, None)
+
+ def test_next_sibling(self):
+ self.assertEqual(self.start.next_sibling['id'], '2')
+ self.assertEqual(self.start.next_sibling.next_sibling['id'], '3')
+
+ # Note the difference between next_sibling and next_element.
+ self.assertEqual(self.start.next_element['id'], '1.1')
+
+ def test_next_sibling_may_not_exist(self):
+ self.assertEqual(self.tree.html.next_sibling, None)
+
+ nested_span = self.tree.find(id="1.1")
+ self.assertEqual(nested_span.next_sibling, None)
+
+ last_span = self.tree.find(id="4")
+ self.assertEqual(last_span.next_sibling, None)
+
+ def test_find_next_sibling(self):
+ self.assertEqual(self.start.find_next_sibling('span')['id'], '2')
+
+ def test_next_siblings(self):
+ self.assertSelectsIDs(self.start.find_next_siblings("span"),
+ ['2', '3', '4'])
+
+ self.assertSelectsIDs(self.start.find_next_siblings(id='3'), ['3'])
+
+ def test_next_sibling_for_text_element(self):
+ soup = self.soup("Foo<b>bar</b>baz")
+ start = soup.find(text="Foo")
+ self.assertEqual(start.next_sibling.name, 'b')
+ self.assertEqual(start.next_sibling.next_sibling, 'baz')
+
+ self.assertSelects(start.find_next_siblings('b'), ['bar'])
+ self.assertEqual(start.find_next_sibling(text="baz"), "baz")
+ self.assertEqual(start.find_next_sibling(text="nonesuch"), None)
+
+
+class TestPreviousSibling(SiblingTest):
+
+ def setUp(self):
+ super(TestPreviousSibling, self).setUp()
+ self.end = self.tree.find(id="4")
+
+ def test_previous_sibling_of_root_is_none(self):
+ self.assertEqual(self.tree.previous_sibling, None)
+
+ def test_previous_sibling(self):
+ self.assertEqual(self.end.previous_sibling['id'], '3')
+ self.assertEqual(self.end.previous_sibling.previous_sibling['id'], '2')
+
+ # Note the difference between previous_sibling and previous_element.
+ self.assertEqual(self.end.previous_element['id'], '3.1')
+
+ def test_previous_sibling_may_not_exist(self):
+ self.assertEqual(self.tree.html.previous_sibling, None)
+
+ nested_span = self.tree.find(id="1.1")
+ self.assertEqual(nested_span.previous_sibling, None)
+
+ first_span = self.tree.find(id="1")
+ self.assertEqual(first_span.previous_sibling, None)
+
+ def test_find_previous_sibling(self):
+ self.assertEqual(self.end.find_previous_sibling('span')['id'], '3')
+
+ def test_previous_siblings(self):
+ self.assertSelectsIDs(self.end.find_previous_siblings("span"),
+ ['3', '2', '1'])
+
+ self.assertSelectsIDs(self.end.find_previous_siblings(id='1'), ['1'])
+
+ def test_previous_sibling_for_text_element(self):
+ soup = self.soup("Foo<b>bar</b>baz")
+ start = soup.find(text="baz")
+ self.assertEqual(start.previous_sibling.name, 'b')
+ self.assertEqual(start.previous_sibling.previous_sibling, 'Foo')
+
+ self.assertSelects(start.find_previous_siblings('b'), ['bar'])
+ self.assertEqual(start.find_previous_sibling(text="Foo"), "Foo")
+ self.assertEqual(start.find_previous_sibling(text="nonesuch"), None)
+
+
+class TestTagCreation(SoupTest):
+ """Test the ability to create new tags."""
+ def test_new_tag(self):
+ soup = self.soup("")
+ new_tag = soup.new_tag("foo", bar="baz")
+ self.assertTrue(isinstance(new_tag, Tag))
+ self.assertEqual("foo", new_tag.name)
+ self.assertEqual(dict(bar="baz"), new_tag.attrs)
+ self.assertEqual(None, new_tag.parent)
+
+ def test_tag_inherits_self_closing_rules_from_builder(self):
+ if XML_BUILDER_PRESENT:
+ xml_soup = BeautifulSoup("", "lxml-xml")
+ xml_br = xml_soup.new_tag("br")
+ xml_p = xml_soup.new_tag("p")
+
+ # Both the <br> and <p> tag are empty-element, just because
+ # they have no contents.
+ self.assertEqual(b"<br/>", xml_br.encode())
+ self.assertEqual(b"<p/>", xml_p.encode())
+
+ html_soup = BeautifulSoup("", "html.parser")
+ html_br = html_soup.new_tag("br")
+ html_p = html_soup.new_tag("p")
+
+ # The HTML builder users HTML's rules about which tags are
+ # empty-element tags, and the new tags reflect these rules.
+ self.assertEqual(b"<br/>", html_br.encode())
+ self.assertEqual(b"<p></p>", html_p.encode())
+
+ def test_new_string_creates_navigablestring(self):
+ soup = self.soup("")
+ s = soup.new_string("foo")
+ self.assertEqual("foo", s)
+ self.assertTrue(isinstance(s, NavigableString))
+
+ def test_new_string_can_create_navigablestring_subclass(self):
+ soup = self.soup("")
+ s = soup.new_string("foo", Comment)
+ self.assertEqual("foo", s)
+ self.assertTrue(isinstance(s, Comment))
+
+class TestTreeModification(SoupTest):
+
+ def test_attribute_modification(self):
+ soup = self.soup('<a id="1"></a>')
+ soup.a['id'] = 2
+ self.assertEqual(soup.decode(), self.document_for('<a id="2"></a>'))
+ del(soup.a['id'])
+ self.assertEqual(soup.decode(), self.document_for('<a></a>'))
+ soup.a['id2'] = 'foo'
+ self.assertEqual(soup.decode(), self.document_for('<a id2="foo"></a>'))
+
+ def test_new_tag_creation(self):
+ builder = builder_registry.lookup('html')()
+ soup = self.soup("<body></body>", builder=builder)
+ a = Tag(soup, builder, 'a')
+ ol = Tag(soup, builder, 'ol')
+ a['href'] = 'http://foo.com/'
+ soup.body.insert(0, a)
+ soup.body.insert(1, ol)
+ self.assertEqual(
+ soup.body.encode(),
+ b'<body><a href="http://foo.com/"></a><ol></ol></body>')
+
+ def test_append_to_contents_moves_tag(self):
+ doc = """<p id="1">Don't leave me <b>here</b>.</p>
+ <p id="2">Don\'t leave!</p>"""
+ soup = self.soup(doc)
+ second_para = soup.find(id='2')
+ bold = soup.b
+
+ # Move the <b> tag to the end of the second paragraph.
+ soup.find(id='2').append(soup.b)
+
+ # The <b> tag is now a child of the second paragraph.
+ self.assertEqual(bold.parent, second_para)
+
+ self.assertEqual(
+ soup.decode(), self.document_for(
+ '<p id="1">Don\'t leave me .</p>\n'
+ '<p id="2">Don\'t leave!<b>here</b></p>'))
+
+ def test_replace_with_returns_thing_that_was_replaced(self):
+ text = "<a></a><b><c></c></b>"
+ soup = self.soup(text)
+ a = soup.a
+ new_a = a.replace_with(soup.c)
+ self.assertEqual(a, new_a)
+
+ def test_unwrap_returns_thing_that_was_replaced(self):
+ text = "<a><b></b><c></c></a>"
+ soup = self.soup(text)
+ a = soup.a
+ new_a = a.unwrap()
+ self.assertEqual(a, new_a)
+
+ def test_replace_with_and_unwrap_give_useful_exception_when_tag_has_no_parent(self):
+ soup = self.soup("<a><b>Foo</b></a><c>Bar</c>")
+ a = soup.a
+ a.extract()
+ self.assertEqual(None, a.parent)
+ self.assertRaises(ValueError, a.unwrap)
+ self.assertRaises(ValueError, a.replace_with, soup.c)
+
+ def test_replace_tag_with_itself(self):
+ text = "<a><b></b><c>Foo<d></d></c></a><a><e></e></a>"
+ soup = self.soup(text)
+ c = soup.c
+ soup.c.replace_with(c)
+ self.assertEqual(soup.decode(), self.document_for(text))
+
+ def test_replace_tag_with_its_parent_raises_exception(self):
+ text = "<a><b></b></a>"
+ soup = self.soup(text)
+ self.assertRaises(ValueError, soup.b.replace_with, soup.a)
+
+ def test_insert_tag_into_itself_raises_exception(self):
+ text = "<a><b></b></a>"
+ soup = self.soup(text)
+ self.assertRaises(ValueError, soup.a.insert, 0, soup.a)
+
+ def test_replace_with_maintains_next_element_throughout(self):
+ soup = self.soup('<p><a>one</a><b>three</b></p>')
+ a = soup.a
+ b = a.contents[0]
+ # Make it so the <a> tag has two text children.
+ a.insert(1, "two")
+
+ # Now replace each one with the empty string.
+ left, right = a.contents
+ left.replaceWith('')
+ right.replaceWith('')
+
+ # The <b> tag is still connected to the tree.
+ self.assertEqual("three", soup.b.string)
+
+ def test_replace_final_node(self):
+ soup = self.soup("<b>Argh!</b>")
+ soup.find(text="Argh!").replace_with("Hooray!")
+ new_text = soup.find(text="Hooray!")
+ b = soup.b
+ self.assertEqual(new_text.previous_element, b)
+ self.assertEqual(new_text.parent, b)
+ self.assertEqual(new_text.previous_element.next_element, new_text)
+ self.assertEqual(new_text.next_element, None)
+
+ def test_consecutive_text_nodes(self):
+ # A builder should never create two consecutive text nodes,
+ # but if you insert one next to another, Beautiful Soup will
+ # handle it correctly.
+ soup = self.soup("<a><b>Argh!</b><c></c></a>")
+ soup.b.insert(1, "Hooray!")
+
+ self.assertEqual(
+ soup.decode(), self.document_for(
+ "<a><b>Argh!Hooray!</b><c></c></a>"))
+
+ new_text = soup.find(text="Hooray!")
+ self.assertEqual(new_text.previous_element, "Argh!")
+ self.assertEqual(new_text.previous_element.next_element, new_text)
+
+ self.assertEqual(new_text.previous_sibling, "Argh!")
+ self.assertEqual(new_text.previous_sibling.next_sibling, new_text)
+
+ self.assertEqual(new_text.next_sibling, None)
+ self.assertEqual(new_text.next_element, soup.c)
+
+ def test_insert_string(self):
+ soup = self.soup("<a></a>")
+ soup.a.insert(0, "bar")
+ soup.a.insert(0, "foo")
+ # The string were added to the tag.
+ self.assertEqual(["foo", "bar"], soup.a.contents)
+ # And they were converted to NavigableStrings.
+ self.assertEqual(soup.a.contents[0].next_element, "bar")
+
+ def test_insert_tag(self):
+ builder = self.default_builder
+ soup = self.soup(
+ "<a><b>Find</b><c>lady!</c><d></d></a>", builder=builder)
+ magic_tag = Tag(soup, builder, 'magictag')
+ magic_tag.insert(0, "the")
+ soup.a.insert(1, magic_tag)
+
+ self.assertEqual(
+ soup.decode(), self.document_for(
+ "<a><b>Find</b><magictag>the</magictag><c>lady!</c><d></d></a>"))
+
+ # Make sure all the relationships are hooked up correctly.
+ b_tag = soup.b
+ self.assertEqual(b_tag.next_sibling, magic_tag)
+ self.assertEqual(magic_tag.previous_sibling, b_tag)
+
+ find = b_tag.find(text="Find")
+ self.assertEqual(find.next_element, magic_tag)
+ self.assertEqual(magic_tag.previous_element, find)
+
+ c_tag = soup.c
+ self.assertEqual(magic_tag.next_sibling, c_tag)
+ self.assertEqual(c_tag.previous_sibling, magic_tag)
+
+ the = magic_tag.find(text="the")
+ self.assertEqual(the.parent, magic_tag)
+ self.assertEqual(the.next_element, c_tag)
+ self.assertEqual(c_tag.previous_element, the)
+
+ def test_append_child_thats_already_at_the_end(self):
+ data = "<a><b></b></a>"
+ soup = self.soup(data)
+ soup.a.append(soup.b)
+ self.assertEqual(data, soup.decode())
+
+ def test_move_tag_to_beginning_of_parent(self):
+ data = "<a><b></b><c></c><d></d></a>"
+ soup = self.soup(data)
+ soup.a.insert(0, soup.d)
+ self.assertEqual("<a><d></d><b></b><c></c></a>", soup.decode())
+
+ def test_insert_works_on_empty_element_tag(self):
+ # This is a little strange, since most HTML parsers don't allow
+ # markup like this to come through. But in general, we don't
+ # know what the parser would or wouldn't have allowed, so
+ # I'm letting this succeed for now.
+ soup = self.soup("<br/>")
+ soup.br.insert(1, "Contents")
+ self.assertEqual(str(soup.br), "<br>Contents</br>")
+
+ def test_insert_before(self):
+ soup = self.soup("<a>foo</a><b>bar</b>")
+ soup.b.insert_before("BAZ")
+ soup.a.insert_before("QUUX")
+ self.assertEqual(
+ soup.decode(), self.document_for("QUUX<a>foo</a>BAZ<b>bar</b>"))
+
+ soup.a.insert_before(soup.b)
+ self.assertEqual(
+ soup.decode(), self.document_for("QUUX<b>bar</b><a>foo</a>BAZ"))
+
+ def test_insert_after(self):
+ soup = self.soup("<a>foo</a><b>bar</b>")
+ soup.b.insert_after("BAZ")
+ soup.a.insert_after("QUUX")
+ self.assertEqual(
+ soup.decode(), self.document_for("<a>foo</a>QUUX<b>bar</b>BAZ"))
+ soup.b.insert_after(soup.a)
+ self.assertEqual(
+ soup.decode(), self.document_for("QUUX<b>bar</b><a>foo</a>BAZ"))
+
+ def test_insert_after_raises_exception_if_after_has_no_meaning(self):
+ soup = self.soup("")
+ tag = soup.new_tag("a")
+ string = soup.new_string("")
+ self.assertRaises(ValueError, string.insert_after, tag)
+ self.assertRaises(NotImplementedError, soup.insert_after, tag)
+ self.assertRaises(ValueError, tag.insert_after, tag)
+
+ def test_insert_before_raises_notimplementederror_if_before_has_no_meaning(self):
+ soup = self.soup("")
+ tag = soup.new_tag("a")
+ string = soup.new_string("")
+ self.assertRaises(ValueError, string.insert_before, tag)
+ self.assertRaises(NotImplementedError, soup.insert_before, tag)
+ self.assertRaises(ValueError, tag.insert_before, tag)
+
+ def test_replace_with(self):
+ soup = self.soup(
+ "<p>There's <b>no</b> business like <b>show</b> business</p>")
+ no, show = soup.find_all('b')
+ show.replace_with(no)
+ self.assertEqual(
+ soup.decode(),
+ self.document_for(
+ "<p>There's business like <b>no</b> business</p>"))
+
+ self.assertEqual(show.parent, None)
+ self.assertEqual(no.parent, soup.p)
+ self.assertEqual(no.next_element, "no")
+ self.assertEqual(no.next_sibling, " business")
+
+ def test_replace_first_child(self):
+ data = "<a><b></b><c></c></a>"
+ soup = self.soup(data)
+ soup.b.replace_with(soup.c)
+ self.assertEqual("<a><c></c></a>", soup.decode())
+
+ def test_replace_last_child(self):
+ data = "<a><b></b><c></c></a>"
+ soup = self.soup(data)
+ soup.c.replace_with(soup.b)
+ self.assertEqual("<a><b></b></a>", soup.decode())
+
+ def test_nested_tag_replace_with(self):
+ soup = self.soup(
+ """<a>We<b>reserve<c>the</c><d>right</d></b></a><e>to<f>refuse</f><g>service</g></e>""")
+
+ # Replace the entire <b> tag and its contents ("reserve the
+ # right") with the <f> tag ("refuse").
+ remove_tag = soup.b
+ move_tag = soup.f
+ remove_tag.replace_with(move_tag)
+
+ self.assertEqual(
+ soup.decode(), self.document_for(
+ "<a>We<f>refuse</f></a><e>to<g>service</g></e>"))
+
+ # The <b> tag is now an orphan.
+ self.assertEqual(remove_tag.parent, None)
+ self.assertEqual(remove_tag.find(text="right").next_element, None)
+ self.assertEqual(remove_tag.previous_element, None)
+ self.assertEqual(remove_tag.next_sibling, None)
+ self.assertEqual(remove_tag.previous_sibling, None)
+
+ # The <f> tag is now connected to the <a> tag.
+ self.assertEqual(move_tag.parent, soup.a)
+ self.assertEqual(move_tag.previous_element, "We")
+ self.assertEqual(move_tag.next_element.next_element, soup.e)
+ self.assertEqual(move_tag.next_sibling, None)
+
+ # The gap where the <f> tag used to be has been mended, and
+ # the word "to" is now connected to the <g> tag.
+ to_text = soup.find(text="to")
+ g_tag = soup.g
+ self.assertEqual(to_text.next_element, g_tag)
+ self.assertEqual(to_text.next_sibling, g_tag)
+ self.assertEqual(g_tag.previous_element, to_text)
+ self.assertEqual(g_tag.previous_sibling, to_text)
+
+ def test_unwrap(self):
+ tree = self.soup("""
+ <p>Unneeded <em>formatting</em> is unneeded</p>
+ """)
+ tree.em.unwrap()
+ self.assertEqual(tree.em, None)
+ self.assertEqual(tree.p.text, "Unneeded formatting is unneeded")
+
+ def test_wrap(self):
+ soup = self.soup("I wish I was bold.")
+ value = soup.string.wrap(soup.new_tag("b"))
+ self.assertEqual(value.decode(), "<b>I wish I was bold.</b>")
+ self.assertEqual(
+ soup.decode(), self.document_for("<b>I wish I was bold.</b>"))
+
+ def test_wrap_extracts_tag_from_elsewhere(self):
+ soup = self.soup("<b></b>I wish I was bold.")
+ soup.b.next_sibling.wrap(soup.b)
+ self.assertEqual(
+ soup.decode(), self.document_for("<b>I wish I was bold.</b>"))
+
+ def test_wrap_puts_new_contents_at_the_end(self):
+ soup = self.soup("<b>I like being bold.</b>I wish I was bold.")
+ soup.b.next_sibling.wrap(soup.b)
+ self.assertEqual(2, len(soup.b.contents))
+ self.assertEqual(
+ soup.decode(), self.document_for(
+ "<b>I like being bold.I wish I was bold.</b>"))
+
+ def test_extract(self):
+ soup = self.soup(
+ '<html><body>Some content. <div id="nav">Nav crap</div> More content.</body></html>')
+
+ self.assertEqual(len(soup.body.contents), 3)
+ extracted = soup.find(id="nav").extract()
+
+ self.assertEqual(
+ soup.decode(), "<html><body>Some content. More content.</body></html>")
+ self.assertEqual(extracted.decode(), '<div id="nav">Nav crap</div>')
+
+ # The extracted tag is now an orphan.
+ self.assertEqual(len(soup.body.contents), 2)
+ self.assertEqual(extracted.parent, None)
+ self.assertEqual(extracted.previous_element, None)
+ self.assertEqual(extracted.next_element.next_element, None)
+
+ # The gap where the extracted tag used to be has been mended.
+ content_1 = soup.find(text="Some content. ")
+ content_2 = soup.find(text=" More content.")
+ self.assertEqual(content_1.next_element, content_2)
+ self.assertEqual(content_1.next_sibling, content_2)
+ self.assertEqual(content_2.previous_element, content_1)
+ self.assertEqual(content_2.previous_sibling, content_1)
+
+ def test_extract_distinguishes_between_identical_strings(self):
+ soup = self.soup("<a>foo</a><b>bar</b>")
+ foo_1 = soup.a.string
+ bar_1 = soup.b.string
+ foo_2 = soup.new_string("foo")
+ bar_2 = soup.new_string("bar")
+ soup.a.append(foo_2)
+ soup.b.append(bar_2)
+
+ # Now there are two identical strings in the <a> tag, and two
+ # in the <b> tag. Let's remove the first "foo" and the second
+ # "bar".
+ foo_1.extract()
+ bar_2.extract()
+ self.assertEqual(foo_2, soup.a.string)
+ self.assertEqual(bar_2, soup.b.string)
+
+ def test_extract_multiples_of_same_tag(self):
+ soup = self.soup("""
+<html>
+<head>
+<script>foo</script>
+</head>
+<body>
+ <script>bar</script>
+ <a></a>
+</body>
+<script>baz</script>
+</html>""")
+ [soup.script.extract() for i in soup.find_all("script")]
+ self.assertEqual("<body>\n\n<a></a>\n</body>", str(soup.body))
+
+
+ def test_extract_works_when_element_is_surrounded_by_identical_strings(self):
+ soup = self.soup(
+ '<html>\n'
+ '<body>hi</body>\n'
+ '</html>')
+ soup.find('body').extract()
+ self.assertEqual(None, soup.find('body'))
+
+
+ def test_clear(self):
+ """Tag.clear()"""
+ soup = self.soup("<p><a>String <em>Italicized</em></a> and another</p>")
+ # clear using extract()
+ a = soup.a
+ soup.p.clear()
+ self.assertEqual(len(soup.p.contents), 0)
+ self.assertTrue(hasattr(a, "contents"))
+
+ # clear using decompose()
+ em = a.em
+ a.clear(decompose=True)
+ self.assertEqual(0, len(em.contents))
+
+ def test_string_set(self):
+ """Tag.string = 'string'"""
+ soup = self.soup("<a></a> <b><c></c></b>")
+ soup.a.string = "foo"
+ self.assertEqual(soup.a.contents, ["foo"])
+ soup.b.string = "bar"
+ self.assertEqual(soup.b.contents, ["bar"])
+
+ def test_string_set_does_not_affect_original_string(self):
+ soup = self.soup("<a><b>foo</b><c>bar</c>")
+ soup.b.string = soup.c.string
+ self.assertEqual(soup.a.encode(), b"<a><b>bar</b><c>bar</c></a>")
+
+ def test_set_string_preserves_class_of_string(self):
+ soup = self.soup("<a></a>")
+ cdata = CData("foo")
+ soup.a.string = cdata
+ self.assertTrue(isinstance(soup.a.string, CData))
+
+class TestElementObjects(SoupTest):
+ """Test various features of element objects."""
+
+ def test_len(self):
+ """The length of an element is its number of children."""
+ soup = self.soup("<top>1<b>2</b>3</top>")
+
+ # The BeautifulSoup object itself contains one element: the
+ # <top> tag.
+ self.assertEqual(len(soup.contents), 1)
+ self.assertEqual(len(soup), 1)
+
+ # The <top> tag contains three elements: the text node "1", the
+ # <b> tag, and the text node "3".
+ self.assertEqual(len(soup.top), 3)
+ self.assertEqual(len(soup.top.contents), 3)
+
+ def test_member_access_invokes_find(self):
+ """Accessing a Python member .foo invokes find('foo')"""
+ soup = self.soup('<b><i></i></b>')
+ self.assertEqual(soup.b, soup.find('b'))
+ self.assertEqual(soup.b.i, soup.find('b').find('i'))
+ self.assertEqual(soup.a, None)
+
+ def test_deprecated_member_access(self):
+ soup = self.soup('<b><i></i></b>')
+ with warnings.catch_warnings(record=True) as w:
+ tag = soup.bTag
+ self.assertEqual(soup.b, tag)
+ self.assertEqual(
+ '.bTag is deprecated, use .find("b") instead.',
+ str(w[0].message))
+
+ def test_has_attr(self):
+ """has_attr() checks for the presence of an attribute.
+
+ Please note note: has_attr() is different from
+ __in__. has_attr() checks the tag's attributes and __in__
+ checks the tag's chidlren.
+ """
+ soup = self.soup("<foo attr='bar'>")
+ self.assertTrue(soup.foo.has_attr('attr'))
+ self.assertFalse(soup.foo.has_attr('attr2'))
+
+
+ def test_attributes_come_out_in_alphabetical_order(self):
+ markup = '<b a="1" z="5" m="3" f="2" y="4"></b>'
+ self.assertSoupEquals(markup, '<b a="1" f="2" m="3" y="4" z="5"></b>')
+
+ def test_string(self):
+ # A tag that contains only a text node makes that node
+ # available as .string.
+ soup = self.soup("<b>foo</b>")
+ self.assertEqual(soup.b.string, 'foo')
+
+ def test_empty_tag_has_no_string(self):
+ # A tag with no children has no .stirng.
+ soup = self.soup("<b></b>")
+ self.assertEqual(soup.b.string, None)
+
+ def test_tag_with_multiple_children_has_no_string(self):
+ # A tag with no children has no .string.
+ soup = self.soup("<a>foo<b></b><b></b></b>")
+ self.assertEqual(soup.b.string, None)
+
+ soup = self.soup("<a>foo<b></b>bar</b>")
+ self.assertEqual(soup.b.string, None)
+
+ # Even if all the children are strings, due to trickery,
+ # it won't work--but this would be a good optimization.
+ soup = self.soup("<a>foo</b>")
+ soup.a.insert(1, "bar")
+ self.assertEqual(soup.a.string, None)
+
+ def test_tag_with_recursive_string_has_string(self):
+ # A tag with a single child which has a .string inherits that
+ # .string.
+ soup = self.soup("<a><b>foo</b></a>")
+ self.assertEqual(soup.a.string, "foo")
+ self.assertEqual(soup.string, "foo")
+
+ def test_lack_of_string(self):
+ """Only a tag containing a single text node has a .string."""
+ soup = self.soup("<b>f<i>e</i>o</b>")
+ self.assertFalse(soup.b.string)
+
+ soup = self.soup("<b></b>")
+ self.assertFalse(soup.b.string)
+
+ def test_all_text(self):
+ """Tag.text and Tag.get_text(sep=u"") -> all child text, concatenated"""
+ soup = self.soup("<a>a<b>r</b> <r> t </r></a>")
+ self.assertEqual(soup.a.text, "ar t ")
+ self.assertEqual(soup.a.get_text(strip=True), "art")
+ self.assertEqual(soup.a.get_text(","), "a,r, , t ")
+ self.assertEqual(soup.a.get_text(",", strip=True), "a,r,t")
+
+ def test_get_text_ignores_comments(self):
+ soup = self.soup("foo<!--IGNORE-->bar")
+ self.assertEqual(soup.get_text(), "foobar")
+
+ self.assertEqual(
+ soup.get_text(types=(NavigableString, Comment)), "fooIGNOREbar")
+ self.assertEqual(
+ soup.get_text(types=None), "fooIGNOREbar")
+
+ def test_all_strings_ignores_comments(self):
+ soup = self.soup("foo<!--IGNORE-->bar")
+ self.assertEqual(['foo', 'bar'], list(soup.strings))
+
+class TestCDAtaListAttributes(SoupTest):
+
+ """Testing cdata-list attributes like 'class'.
+ """
+ def test_single_value_becomes_list(self):
+ soup = self.soup("<a class='foo'>")
+ self.assertEqual(["foo"],soup.a['class'])
+
+ def test_multiple_values_becomes_list(self):
+ soup = self.soup("<a class='foo bar'>")
+ self.assertEqual(["foo", "bar"], soup.a['class'])
+
+ def test_multiple_values_separated_by_weird_whitespace(self):
+ soup = self.soup("<a class='foo\tbar\nbaz'>")
+ self.assertEqual(["foo", "bar", "baz"],soup.a['class'])
+
+ def test_attributes_joined_into_string_on_output(self):
+ soup = self.soup("<a class='foo\tbar'>")
+ self.assertEqual(b'<a class="foo bar"></a>', soup.a.encode())
+
+ def test_accept_charset(self):
+ soup = self.soup('<form accept-charset="ISO-8859-1 UTF-8">')
+ self.assertEqual(['ISO-8859-1', 'UTF-8'], soup.form['accept-charset'])
+
+ def test_cdata_attribute_applying_only_to_one_tag(self):
+ data = '<a accept-charset="ISO-8859-1 UTF-8"></a>'
+ soup = self.soup(data)
+ # We saw in another test that accept-charset is a cdata-list
+ # attribute for the <form> tag. But it's not a cdata-list
+ # attribute for any other tag.
+ self.assertEqual('ISO-8859-1 UTF-8', soup.a['accept-charset'])
+
+ def test_string_has_immutable_name_property(self):
+ string = self.soup("s").string
+ self.assertEqual(None, string.name)
+ def t():
+ string.name = 'foo'
+ self.assertRaises(AttributeError, t)
+
+class TestPersistence(SoupTest):
+ "Testing features like pickle and deepcopy."
+
+ def setUp(self):
+ super(TestPersistence, self).setUp()
+ self.page = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/transitional.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Beautiful Soup: We called him Tortoise because he taught us.</title>
+<link rev="made" href="mailto:leonardr@segfault.org">
+<meta name="Description" content="Beautiful Soup: an HTML parser optimized for screen-scraping.">
+<meta name="generator" content="Markov Approximation 1.4 (module: leonardr)">
+<meta name="author" content="Leonard Richardson">
+</head>
+<body>
+<a href="foo">foo</a>
+<a href="foo"><b>bar</b></a>
+</body>
+</html>"""
+ self.tree = self.soup(self.page)
+
+ def test_pickle_and_unpickle_identity(self):
+ # Pickling a tree, then unpickling it, yields a tree identical
+ # to the original.
+ dumped = pickle.dumps(self.tree, 2)
+ loaded = pickle.loads(dumped)
+ self.assertEqual(loaded.__class__, BeautifulSoup)
+ self.assertEqual(loaded.decode(), self.tree.decode())
+
+ def test_deepcopy_identity(self):
+ # Making a deepcopy of a tree yields an identical tree.
+ copied = copy.deepcopy(self.tree)
+ self.assertEqual(copied.decode(), self.tree.decode())
+
+ def test_unicode_pickle(self):
+ # A tree containing Unicode characters can be pickled.
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ dumped = pickle.dumps(soup, pickle.HIGHEST_PROTOCOL)
+ loaded = pickle.loads(dumped)
+ self.assertEqual(loaded.decode(), soup.decode())
+
+ def test_copy_navigablestring_is_not_attached_to_tree(self):
+ html = "<b>Foo<a></a></b><b>Bar</b>"
+ soup = self.soup(html)
+ s1 = soup.find(string="Foo")
+ s2 = copy.copy(s1)
+ self.assertEqual(s1, s2)
+ self.assertEqual(None, s2.parent)
+ self.assertEqual(None, s2.next_element)
+ self.assertNotEqual(None, s1.next_sibling)
+ self.assertEqual(None, s2.next_sibling)
+ self.assertEqual(None, s2.previous_element)
+
+ def test_copy_navigablestring_subclass_has_same_type(self):
+ html = "<b><!--Foo--></b>"
+ soup = self.soup(html)
+ s1 = soup.string
+ s2 = copy.copy(s1)
+ self.assertEqual(s1, s2)
+ self.assertTrue(isinstance(s2, Comment))
+
+ def test_copy_entire_soup(self):
+ html = "<div><b>Foo<a></a></b><b>Bar</b></div>end"
+ soup = self.soup(html)
+ soup_copy = copy.copy(soup)
+ self.assertEqual(soup, soup_copy)
+
+ def test_copy_tag_copies_contents(self):
+ html = "<div><b>Foo<a></a></b><b>Bar</b></div>end"
+ soup = self.soup(html)
+ div = soup.div
+ div_copy = copy.copy(div)
+
+ # The two tags look the same, and evaluate to equal.
+ self.assertEqual(str(div), str(div_copy))
+ self.assertEqual(div, div_copy)
+
+ # But they're not the same object.
+ self.assertFalse(div is div_copy)
+
+ # And they don't have the same relation to the parse tree. The
+ # copy is not associated with a parse tree at all.
+ self.assertEqual(None, div_copy.parent)
+ self.assertEqual(None, div_copy.previous_element)
+ self.assertEqual(None, div_copy.find(string='Bar').next_element)
+ self.assertNotEqual(None, div.find(string='Bar').next_element)
+
+class TestSubstitutions(SoupTest):
+
+ def test_default_formatter_is_minimal(self):
+ markup = "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"
+ soup = self.soup(markup)
+ decoded = soup.decode(formatter="minimal")
+ # The < is converted back into &lt; but the e-with-acute is left alone.
+ self.assertEqual(
+ decoded,
+ self.document_for(
+ "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"))
+
+ def test_formatter_html(self):
+ markup = "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"
+ soup = self.soup(markup)
+ decoded = soup.decode(formatter="html")
+ self.assertEqual(
+ decoded,
+ self.document_for("<b>&lt;&lt;Sacr&eacute; bleu!&gt;&gt;</b>"))
+
+ def test_formatter_minimal(self):
+ markup = "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"
+ soup = self.soup(markup)
+ decoded = soup.decode(formatter="minimal")
+ # The < is converted back into &lt; but the e-with-acute is left alone.
+ self.assertEqual(
+ decoded,
+ self.document_for(
+ "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"))
+
+ def test_formatter_null(self):
+ markup = "<b>&lt;&lt;Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!&gt;&gt;</b>"
+ soup = self.soup(markup)
+ decoded = soup.decode(formatter=None)
+ # Neither the angle brackets nor the e-with-acute are converted.
+ # This is not valid HTML, but it's what the user wanted.
+ self.assertEqual(decoded,
+ self.document_for("<b><<Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!>></b>"))
+
+ def test_formatter_custom(self):
+ markup = "<b>&lt;foo&gt;</b><b>bar</b>"
+ soup = self.soup(markup)
+ decoded = soup.decode(formatter = lambda x: x.upper())
+ # Instead of normal entity conversion code, the custom
+ # callable is called on every string.
+ self.assertEqual(
+ decoded,
+ self.document_for("<b><FOO></b><b>BAR</b>"))
+
+ def test_formatter_is_run_on_attribute_values(self):
+ markup = '<a href="http://a.com?a=b&c=é">e</a>'
+ soup = self.soup(markup)
+ a = soup.a
+
+ expect_minimal = '<a href="http://a.com?a=b&amp;c=é">e</a>'
+
+ self.assertEqual(expect_minimal, a.decode())
+ self.assertEqual(expect_minimal, a.decode(formatter="minimal"))
+
+ expect_html = '<a href="http://a.com?a=b&amp;c=&eacute;">e</a>'
+ self.assertEqual(expect_html, a.decode(formatter="html"))
+
+ self.assertEqual(markup, a.decode(formatter=None))
+ expect_upper = '<a href="HTTP://A.COM?A=B&C=É">E</a>'
+ self.assertEqual(expect_upper, a.decode(formatter=lambda x: x.upper()))
+
+ def test_formatter_skips_script_tag_for_html_documents(self):
+ doc = """
+ <script type="text/javascript">
+ console.log("< < hey > > ");
+ </script>
+"""
+ encoded = BeautifulSoup(doc, 'html.parser').encode()
+ self.assertTrue(b"< < hey > >" in encoded)
+
+ def test_formatter_skips_style_tag_for_html_documents(self):
+ doc = """
+ <style type="text/css">
+ console.log("< < hey > > ");
+ </style>
+"""
+ encoded = BeautifulSoup(doc, 'html.parser').encode()
+ self.assertTrue(b"< < hey > >" in encoded)
+
+ def test_prettify_leaves_preformatted_text_alone(self):
+ soup = self.soup("<div> foo <pre> \tbar\n \n </pre> baz ")
+ # Everything outside the <pre> tag is reformatted, but everything
+ # inside is left alone.
+ self.assertEqual(
+ '<div>\n foo\n <pre> \tbar\n \n </pre>\n baz\n</div>',
+ soup.div.prettify())
+
+ def test_prettify_accepts_formatter(self):
+ soup = BeautifulSoup("<html><body>foo</body></html>", 'html.parser')
+ pretty = soup.prettify(formatter = lambda x: x.upper())
+ self.assertTrue("FOO" in pretty)
+
+ def test_prettify_outputs_unicode_by_default(self):
+ soup = self.soup("<a></a>")
+ self.assertEqual(str, type(soup.prettify()))
+
+ def test_prettify_can_encode_data(self):
+ soup = self.soup("<a></a>")
+ self.assertEqual(bytes, type(soup.prettify("utf-8")))
+
+ def test_html_entity_substitution_off_by_default(self):
+ markup = "<b>Sacr\N{LATIN SMALL LETTER E WITH ACUTE} bleu!</b>"
+ soup = self.soup(markup)
+ encoded = soup.b.encode("utf-8")
+ self.assertEqual(encoded, markup.encode('utf-8'))
+
+ def test_encoding_substitution(self):
+ # Here's the <meta> tag saying that a document is
+ # encoded in Shift-JIS.
+ meta_tag = ('<meta content="text/html; charset=x-sjis" '
+ 'http-equiv="Content-type"/>')
+ soup = self.soup(meta_tag)
+
+ # Parse the document, and the charset apprears unchanged.
+ self.assertEqual(soup.meta['content'], 'text/html; charset=x-sjis')
+
+ # Encode the document into some encoding, and the encoding is
+ # substituted into the meta tag.
+ utf_8 = soup.encode("utf-8")
+ self.assertTrue(b"charset=utf-8" in utf_8)
+
+ euc_jp = soup.encode("euc_jp")
+ self.assertTrue(b"charset=euc_jp" in euc_jp)
+
+ shift_jis = soup.encode("shift-jis")
+ self.assertTrue(b"charset=shift-jis" in shift_jis)
+
+ utf_16_u = soup.encode("utf-16").decode("utf-16")
+ self.assertTrue("charset=utf-16" in utf_16_u)
+
+ def test_encoding_substitution_doesnt_happen_if_tag_is_strained(self):
+ markup = ('<head><meta content="text/html; charset=x-sjis" '
+ 'http-equiv="Content-type"/></head><pre>foo</pre>')
+
+ # Beautiful Soup used to try to rewrite the meta tag even if the
+ # meta tag got filtered out by the strainer. This test makes
+ # sure that doesn't happen.
+ strainer = SoupStrainer('pre')
+ soup = self.soup(markup, parse_only=strainer)
+ self.assertEqual(soup.contents[0].name, 'pre')
+
+class TestEncoding(SoupTest):
+ """Test the ability to encode objects into strings."""
+
+ def test_unicode_string_can_be_encoded(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(soup.b.string.encode("utf-8"),
+ "\N{SNOWMAN}".encode("utf-8"))
+
+ def test_tag_containing_unicode_string_can_be_encoded(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(
+ soup.b.encode("utf-8"), html.encode("utf-8"))
+
+ def test_encoding_substitutes_unrecognized_characters_by_default(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(soup.b.encode("ascii"), b"<b>&#9731;</b>")
+
+ def test_encoding_can_be_made_strict(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertRaises(
+ UnicodeEncodeError, soup.encode, "ascii", errors="strict")
+
+ def test_decode_contents(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual("\N{SNOWMAN}", soup.b.decode_contents())
+
+ def test_encode_contents(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(
+ "\N{SNOWMAN}".encode("utf8"), soup.b.encode_contents(
+ encoding="utf8"))
+
+ def test_deprecated_renderContents(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ self.assertEqual(
+ "\N{SNOWMAN}".encode("utf8"), soup.b.renderContents())
+
+ def test_repr(self):
+ html = "<b>\N{SNOWMAN}</b>"
+ soup = self.soup(html)
+ if PY3K:
+ self.assertEqual(html, repr(soup))
+ else:
+ self.assertEqual(b'<b>\\u2603</b>', repr(soup))
+
+class TestNavigableStringSubclasses(SoupTest):
+
+ def test_cdata(self):
+ # None of the current builders turn CDATA sections into CData
+ # objects, but you can create them manually.
+ soup = self.soup("")
+ cdata = CData("foo")
+ soup.insert(1, cdata)
+ self.assertEqual(str(soup), "<![CDATA[foo]]>")
+ self.assertEqual(soup.find(text="foo"), "foo")
+ self.assertEqual(soup.contents[0], "foo")
+
+ def test_cdata_is_never_formatted(self):
+ """Text inside a CData object is passed into the formatter.
+
+ But the return value is ignored.
+ """
+
+ self.count = 0
+ def increment(*args):
+ self.count += 1
+ return "BITTER FAILURE"
+
+ soup = self.soup("")
+ cdata = CData("<><><>")
+ soup.insert(1, cdata)
+ self.assertEqual(
+ b"<![CDATA[<><><>]]>", soup.encode(formatter=increment))
+ self.assertEqual(1, self.count)
+
+ def test_doctype_ends_in_newline(self):
+ # Unlike other NavigableString subclasses, a DOCTYPE always ends
+ # in a newline.
+ doctype = Doctype("foo")
+ soup = self.soup("")
+ soup.insert(1, doctype)
+ self.assertEqual(soup.encode(), b"<!DOCTYPE foo>\n")
+
+ def test_declaration(self):
+ d = Declaration("foo")
+ self.assertEqual("<?foo?>", d.output_ready())
+
+class TestSoupSelector(TreeTest):
+
+ HTML = """
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>The title</title>
+<link rel="stylesheet" href="blah.css" type="text/css" id="l1">
+</head>
+<body>
+<custom-dashed-tag class="dashed" id="dash1">Hello there.</custom-dashed-tag>
+<div id="main" class="fancy">
+<div id="inner">
+<h1 id="header1">An H1</h1>
+<p>Some text</p>
+<p class="onep" id="p1">Some more text</p>
+<h2 id="header2">An H2</h2>
+<p class="class1 class2 class3" id="pmulti">Another</p>
+<a href="http://bob.example.org/" rel="friend met" id="bob">Bob</a>
+<h2 id="header3">Another H2</h2>
+<a id="me" href="http://simonwillison.net/" rel="me">me</a>
+<span class="s1">
+<a href="#" id="s1a1">span1a1</a>
+<a href="#" id="s1a2">span1a2 <span id="s1a2s1">test</span></a>
+<span class="span2">
+<a href="#" id="s2a1">span2a1</a>
+</span>
+<span class="span3"></span>
+<custom-dashed-tag class="dashed" id="dash2"/>
+<div data-tag="dashedvalue" id="data1"/>
+</span>
+</div>
+<x id="xid">
+<z id="zida"/>
+<z id="zidab"/>
+<z id="zidac"/>
+</x>
+<y id="yid">
+<z id="zidb"/>
+</y>
+<p lang="en" id="lang-en">English</p>
+<p lang="en-gb" id="lang-en-gb">English UK</p>
+<p lang="en-us" id="lang-en-us">English US</p>
+<p lang="fr" id="lang-fr">French</p>
+</div>
+
+<div id="footer">
+</div>
+"""
+
+ def setUp(self):
+ self.soup = BeautifulSoup(self.HTML, 'html.parser')
+
+ def assertSelects(self, selector, expected_ids):
+ el_ids = [el['id'] for el in self.soup.select(selector)]
+ el_ids.sort()
+ expected_ids.sort()
+ self.assertEqual(expected_ids, el_ids,
+ "Selector %s, expected [%s], got [%s]" % (
+ selector, ', '.join(expected_ids), ', '.join(el_ids)
+ )
+ )
+
+ assertSelect = assertSelects
+
+ def assertSelectMultiple(self, *tests):
+ for selector, expected_ids in tests:
+ self.assertSelect(selector, expected_ids)
+
+ def test_one_tag_one(self):
+ els = self.soup.select('title')
+ self.assertEqual(len(els), 1)
+ self.assertEqual(els[0].name, 'title')
+ self.assertEqual(els[0].contents, ['The title'])
+
+ def test_one_tag_many(self):
+ els = self.soup.select('div')
+ self.assertEqual(len(els), 4)
+ for div in els:
+ self.assertEqual(div.name, 'div')
+
+ el = self.soup.select_one('div')
+ self.assertEqual('main', el['id'])
+
+ def test_select_one_returns_none_if_no_match(self):
+ match = self.soup.select_one('nonexistenttag')
+ self.assertEqual(None, match)
+
+
+ def test_tag_in_tag_one(self):
+ els = self.soup.select('div div')
+ self.assertSelects('div div', ['inner', 'data1'])
+
+ def test_tag_in_tag_many(self):
+ for selector in ('html div', 'html body div', 'body div'):
+ self.assertSelects(selector, ['data1', 'main', 'inner', 'footer'])
+
+ def test_tag_no_match(self):
+ self.assertEqual(len(self.soup.select('del')), 0)
+
+ def test_invalid_tag(self):
+ self.assertRaises(ValueError, self.soup.select, 'tag%t')
+
+ def test_select_dashed_tag_ids(self):
+ self.assertSelects('custom-dashed-tag', ['dash1', 'dash2'])
+
+ def test_select_dashed_by_id(self):
+ dashed = self.soup.select('custom-dashed-tag[id=\"dash2\"]')
+ self.assertEqual(dashed[0].name, 'custom-dashed-tag')
+ self.assertEqual(dashed[0]['id'], 'dash2')
+
+ def test_dashed_tag_text(self):
+ self.assertEqual(self.soup.select('body > custom-dashed-tag')[0].text, 'Hello there.')
+
+ def test_select_dashed_matches_find_all(self):
+ self.assertEqual(self.soup.select('custom-dashed-tag'), self.soup.find_all('custom-dashed-tag'))
+
+ def test_header_tags(self):
+ self.assertSelectMultiple(
+ ('h1', ['header1']),
+ ('h2', ['header2', 'header3']),
+ )
+
+ def test_class_one(self):
+ for selector in ('.onep', 'p.onep', 'html p.onep'):
+ els = self.soup.select(selector)
+ self.assertEqual(len(els), 1)
+ self.assertEqual(els[0].name, 'p')
+ self.assertEqual(els[0]['class'], ['onep'])
+
+ def test_class_mismatched_tag(self):
+ els = self.soup.select('div.onep')
+ self.assertEqual(len(els), 0)
+
+ def test_one_id(self):
+ for selector in ('div#inner', '#inner', 'div div#inner'):
+ self.assertSelects(selector, ['inner'])
+
+ def test_bad_id(self):
+ els = self.soup.select('#doesnotexist')
+ self.assertEqual(len(els), 0)
+
+ def test_items_in_id(self):
+ els = self.soup.select('div#inner p')
+ self.assertEqual(len(els), 3)
+ for el in els:
+ self.assertEqual(el.name, 'p')
+ self.assertEqual(els[1]['class'], ['onep'])
+ self.assertFalse(els[0].has_attr('class'))
+
+ def test_a_bunch_of_emptys(self):
+ for selector in ('div#main del', 'div#main div.oops', 'div div#main'):
+ self.assertEqual(len(self.soup.select(selector)), 0)
+
+ def test_multi_class_support(self):
+ for selector in ('.class1', 'p.class1', '.class2', 'p.class2',
+ '.class3', 'p.class3', 'html p.class2', 'div#inner .class2'):
+ self.assertSelects(selector, ['pmulti'])
+
+ def test_multi_class_selection(self):
+ for selector in ('.class1.class3', '.class3.class2',
+ '.class1.class2.class3'):
+ self.assertSelects(selector, ['pmulti'])
+
+ def test_child_selector(self):
+ self.assertSelects('.s1 > a', ['s1a1', 's1a2'])
+ self.assertSelects('.s1 > a span', ['s1a2s1'])
+
+ def test_child_selector_id(self):
+ self.assertSelects('.s1 > a#s1a2 span', ['s1a2s1'])
+
+ def test_attribute_equals(self):
+ self.assertSelectMultiple(
+ ('p[class="onep"]', ['p1']),
+ ('p[id="p1"]', ['p1']),
+ ('[class="onep"]', ['p1']),
+ ('[id="p1"]', ['p1']),
+ ('link[rel="stylesheet"]', ['l1']),
+ ('link[type="text/css"]', ['l1']),
+ ('link[href="blah.css"]', ['l1']),
+ ('link[href="no-blah.css"]', []),
+ ('[rel="stylesheet"]', ['l1']),
+ ('[type="text/css"]', ['l1']),
+ ('[href="blah.css"]', ['l1']),
+ ('[href="no-blah.css"]', []),
+ ('p[href="no-blah.css"]', []),
+ ('[href="no-blah.css"]', []),
+ )
+
+ def test_attribute_tilde(self):
+ self.assertSelectMultiple(
+ ('p[class~="class1"]', ['pmulti']),
+ ('p[class~="class2"]', ['pmulti']),
+ ('p[class~="class3"]', ['pmulti']),
+ ('[class~="class1"]', ['pmulti']),
+ ('[class~="class2"]', ['pmulti']),
+ ('[class~="class3"]', ['pmulti']),
+ ('a[rel~="friend"]', ['bob']),
+ ('a[rel~="met"]', ['bob']),
+ ('[rel~="friend"]', ['bob']),
+ ('[rel~="met"]', ['bob']),
+ )
+
+ def test_attribute_startswith(self):
+ self.assertSelectMultiple(
+ ('[rel^="style"]', ['l1']),
+ ('link[rel^="style"]', ['l1']),
+ ('notlink[rel^="notstyle"]', []),
+ ('[rel^="notstyle"]', []),
+ ('link[rel^="notstyle"]', []),
+ ('link[href^="bla"]', ['l1']),
+ ('a[href^="http://"]', ['bob', 'me']),
+ ('[href^="http://"]', ['bob', 'me']),
+ ('[id^="p"]', ['pmulti', 'p1']),
+ ('[id^="m"]', ['me', 'main']),
+ ('div[id^="m"]', ['main']),
+ ('a[id^="m"]', ['me']),
+ ('div[data-tag^="dashed"]', ['data1'])
+ )
+
+ def test_attribute_endswith(self):
+ self.assertSelectMultiple(
+ ('[href$=".css"]', ['l1']),
+ ('link[href$=".css"]', ['l1']),
+ ('link[id$="1"]', ['l1']),
+ ('[id$="1"]', ['data1', 'l1', 'p1', 'header1', 's1a1', 's2a1', 's1a2s1', 'dash1']),
+ ('div[id$="1"]', ['data1']),
+ ('[id$="noending"]', []),
+ )
+
+ def test_attribute_contains(self):
+ self.assertSelectMultiple(
+ # From test_attribute_startswith
+ ('[rel*="style"]', ['l1']),
+ ('link[rel*="style"]', ['l1']),
+ ('notlink[rel*="notstyle"]', []),
+ ('[rel*="notstyle"]', []),
+ ('link[rel*="notstyle"]', []),
+ ('link[href*="bla"]', ['l1']),
+ ('[href*="http://"]', ['bob', 'me']),
+ ('[id*="p"]', ['pmulti', 'p1']),
+ ('div[id*="m"]', ['main']),
+ ('a[id*="m"]', ['me']),
+ # From test_attribute_endswith
+ ('[href*=".css"]', ['l1']),
+ ('link[href*=".css"]', ['l1']),
+ ('link[id*="1"]', ['l1']),
+ ('[id*="1"]', ['data1', 'l1', 'p1', 'header1', 's1a1', 's1a2', 's2a1', 's1a2s1', 'dash1']),
+ ('div[id*="1"]', ['data1']),
+ ('[id*="noending"]', []),
+ # New for this test
+ ('[href*="."]', ['bob', 'me', 'l1']),
+ ('a[href*="."]', ['bob', 'me']),
+ ('link[href*="."]', ['l1']),
+ ('div[id*="n"]', ['main', 'inner']),
+ ('div[id*="nn"]', ['inner']),
+ ('div[data-tag*="edval"]', ['data1'])
+ )
+
+ def test_attribute_exact_or_hypen(self):
+ self.assertSelectMultiple(
+ ('p[lang|="en"]', ['lang-en', 'lang-en-gb', 'lang-en-us']),
+ ('[lang|="en"]', ['lang-en', 'lang-en-gb', 'lang-en-us']),
+ ('p[lang|="fr"]', ['lang-fr']),
+ ('p[lang|="gb"]', []),
+ )
+
+ def test_attribute_exists(self):
+ self.assertSelectMultiple(
+ ('[rel]', ['l1', 'bob', 'me']),
+ ('link[rel]', ['l1']),
+ ('a[rel]', ['bob', 'me']),
+ ('[lang]', ['lang-en', 'lang-en-gb', 'lang-en-us', 'lang-fr']),
+ ('p[class]', ['p1', 'pmulti']),
+ ('[blah]', []),
+ ('p[blah]', []),
+ ('div[data-tag]', ['data1'])
+ )
+
+ def test_unsupported_pseudoclass(self):
+ self.assertRaises(
+ NotImplementedError, self.soup.select, "a:no-such-pseudoclass")
+
+ self.assertRaises(
+ NotImplementedError, self.soup.select, "a:nth-of-type(a)")
+
+
+ def test_nth_of_type(self):
+ # Try to select first paragraph
+ els = self.soup.select('div#inner p:nth-of-type(1)')
+ self.assertEqual(len(els), 1)
+ self.assertEqual(els[0].string, 'Some text')
+
+ # Try to select third paragraph
+ els = self.soup.select('div#inner p:nth-of-type(3)')
+ self.assertEqual(len(els), 1)
+ self.assertEqual(els[0].string, 'Another')
+
+ # Try to select (non-existent!) fourth paragraph
+ els = self.soup.select('div#inner p:nth-of-type(4)')
+ self.assertEqual(len(els), 0)
+
+ # Pass in an invalid value.
+ self.assertRaises(
+ ValueError, self.soup.select, 'div p:nth-of-type(0)')
+
+ def test_nth_of_type_direct_descendant(self):
+ els = self.soup.select('div#inner > p:nth-of-type(1)')
+ self.assertEqual(len(els), 1)
+ self.assertEqual(els[0].string, 'Some text')
+
+ def test_id_child_selector_nth_of_type(self):
+ self.assertSelects('#inner > p:nth-of-type(2)', ['p1'])
+
+ def test_select_on_element(self):
+ # Other tests operate on the tree; this operates on an element
+ # within the tree.
+ inner = self.soup.find("div", id="main")
+ selected = inner.select("div")
+ # The <div id="inner"> tag was selected. The <div id="footer">
+ # tag was not.
+ self.assertSelectsIDs(selected, ['inner', 'data1'])
+
+ def test_overspecified_child_id(self):
+ self.assertSelects(".fancy #inner", ['inner'])
+ self.assertSelects(".normal #inner", [])
+
+ def test_adjacent_sibling_selector(self):
+ self.assertSelects('#p1 + h2', ['header2'])
+ self.assertSelects('#p1 + h2 + p', ['pmulti'])
+ self.assertSelects('#p1 + #header2 + .class1', ['pmulti'])
+ self.assertEqual([], self.soup.select('#p1 + p'))
+
+ def test_general_sibling_selector(self):
+ self.assertSelects('#p1 ~ h2', ['header2', 'header3'])
+ self.assertSelects('#p1 ~ #header2', ['header2'])
+ self.assertSelects('#p1 ~ h2 + a', ['me'])
+ self.assertSelects('#p1 ~ h2 + [rel="me"]', ['me'])
+ self.assertEqual([], self.soup.select('#inner ~ h2'))
+
+ def test_dangling_combinator(self):
+ self.assertRaises(ValueError, self.soup.select, 'h1 >')
+
+ def test_sibling_combinator_wont_select_same_tag_twice(self):
+ self.assertSelects('p[lang] ~ p', ['lang-en-gb', 'lang-en-us', 'lang-fr'])
+
+ # Test the selector grouping operator (the comma)
+ def test_multiple_select(self):
+ self.assertSelects('x, y', ['xid', 'yid'])
+
+ def test_multiple_select_with_no_space(self):
+ self.assertSelects('x,y', ['xid', 'yid'])
+
+ def test_multiple_select_with_more_space(self):
+ self.assertSelects('x, y', ['xid', 'yid'])
+
+ def test_multiple_select_duplicated(self):
+ self.assertSelects('x, x', ['xid'])
+
+ def test_multiple_select_sibling(self):
+ self.assertSelects('x, y ~ p[lang=fr]', ['xid', 'lang-fr'])
+
+ def test_multiple_select_tag_and_direct_descendant(self):
+ self.assertSelects('x, y > z', ['xid', 'zidb'])
+
+ def test_multiple_select_direct_descendant_and_tags(self):
+ self.assertSelects('div > x, y, z', ['xid', 'yid', 'zida', 'zidb', 'zidab', 'zidac'])
+
+ def test_multiple_select_indirect_descendant(self):
+ self.assertSelects('div x,y, z', ['xid', 'yid', 'zida', 'zidb', 'zidab', 'zidac'])
+
+ def test_invalid_multiple_select(self):
+ self.assertRaises(ValueError, self.soup.select, ',x, y')
+ self.assertRaises(ValueError, self.soup.select, 'x,,y')
+
+ def test_multiple_select_attrs(self):
+ self.assertSelects('p[lang=en], p[lang=en-gb]', ['lang-en', 'lang-en-gb'])
+
+ def test_multiple_select_ids(self):
+ self.assertSelects('x, y > z[id=zida], z[id=zidab], z[id=zidb]', ['xid', 'zidb', 'zidab'])
+
+ def test_multiple_select_nested(self):
+ self.assertSelects('body > div > x, y > z', ['xid', 'zidb'])
+
+
+
diff --git a/poky/bitbake/lib/codegen.py b/poky/bitbake/lib/codegen.py
new file mode 100644
index 000000000..62a6748c4
--- /dev/null
+++ b/poky/bitbake/lib/codegen.py
@@ -0,0 +1,570 @@
+# -*- coding: utf-8 -*-
+"""
+ codegen
+ ~~~~~~~
+
+ Extension to ast that allow ast -> python code generation.
+
+ :copyright: Copyright 2008 by Armin Ronacher.
+ :license: BSD.
+"""
+from ast import *
+
+BOOLOP_SYMBOLS = {
+ And: 'and',
+ Or: 'or'
+}
+
+BINOP_SYMBOLS = {
+ Add: '+',
+ Sub: '-',
+ Mult: '*',
+ Div: '/',
+ FloorDiv: '//',
+ Mod: '%',
+ LShift: '<<',
+ RShift: '>>',
+ BitOr: '|',
+ BitAnd: '&',
+ BitXor: '^'
+}
+
+CMPOP_SYMBOLS = {
+ Eq: '==',
+ Gt: '>',
+ GtE: '>=',
+ In: 'in',
+ Is: 'is',
+ IsNot: 'is not',
+ Lt: '<',
+ LtE: '<=',
+ NotEq: '!=',
+ NotIn: 'not in'
+}
+
+UNARYOP_SYMBOLS = {
+ Invert: '~',
+ Not: 'not',
+ UAdd: '+',
+ USub: '-'
+}
+
+ALL_SYMBOLS = {}
+ALL_SYMBOLS.update(BOOLOP_SYMBOLS)
+ALL_SYMBOLS.update(BINOP_SYMBOLS)
+ALL_SYMBOLS.update(CMPOP_SYMBOLS)
+ALL_SYMBOLS.update(UNARYOP_SYMBOLS)
+
+def to_source(node, indent_with=' ' * 4, add_line_information=False):
+ """This function can convert a node tree back into python sourcecode.
+ This is useful for debugging purposes, especially if you're dealing with
+ custom asts not generated by python itself.
+
+ It could be that the sourcecode is evaluable when the AST itself is not
+ compilable / evaluable. The reason for this is that the AST contains some
+ more data than regular sourcecode does, which is dropped during
+ conversion.
+
+ Each level of indentation is replaced with `indent_with`. Per default this
+ parameter is equal to four spaces as suggested by PEP 8, but it might be
+ adjusted to match the application's styleguide.
+
+ If `add_line_information` is set to `True` comments for the line numbers
+ of the nodes are added to the output. This can be used to spot wrong line
+ number information of statement nodes.
+ """
+ generator = SourceGenerator(indent_with, add_line_information)
+ generator.visit(node)
+ return ''.join(generator.result)
+
+
+class SourceGenerator(NodeVisitor):
+ """This visitor is able to transform a well formed syntax tree into python
+ sourcecode. For more details have a look at the docstring of the
+ `node_to_source` function.
+ """
+
+ def __init__(self, indent_with, add_line_information=False):
+ self.result = []
+ self.indent_with = indent_with
+ self.add_line_information = add_line_information
+ self.indentation = 0
+ self.new_lines = 0
+
+ def write(self, x):
+ if self.new_lines:
+ if self.result:
+ self.result.append('\n' * self.new_lines)
+ self.result.append(self.indent_with * self.indentation)
+ self.new_lines = 0
+ self.result.append(x)
+
+ def newline(self, node=None, extra=0):
+ self.new_lines = max(self.new_lines, 1 + extra)
+ if node is not None and self.add_line_information:
+ self.write('# line: %s' % node.lineno)
+ self.new_lines = 1
+
+ def body(self, statements):
+ self.new_line = True
+ self.indentation += 1
+ for stmt in statements:
+ self.visit(stmt)
+ self.indentation -= 1
+
+ def body_or_else(self, node):
+ self.body(node.body)
+ if node.orelse:
+ self.newline()
+ self.write('else:')
+ self.body(node.orelse)
+
+ def signature(self, node):
+ want_comma = []
+ def write_comma():
+ if want_comma:
+ self.write(', ')
+ else:
+ want_comma.append(True)
+
+ padding = [None] * (len(node.args) - len(node.defaults))
+ for arg, default in zip(node.args, padding + node.defaults):
+ write_comma()
+ self.visit(arg)
+ if default is not None:
+ self.write('=')
+ self.visit(default)
+ if node.vararg is not None:
+ write_comma()
+ self.write('*' + node.vararg)
+ if node.kwarg is not None:
+ write_comma()
+ self.write('**' + node.kwarg)
+
+ def decorators(self, node):
+ for decorator in node.decorator_list:
+ self.newline(decorator)
+ self.write('@')
+ self.visit(decorator)
+
+ # Statements
+
+ def visit_Assign(self, node):
+ self.newline(node)
+ for idx, target in enumerate(node.targets):
+ if idx:
+ self.write(', ')
+ self.visit(target)
+ self.write(' = ')
+ self.visit(node.value)
+
+ def visit_AugAssign(self, node):
+ self.newline(node)
+ self.visit(node.target)
+ self.write(BINOP_SYMBOLS[type(node.op)] + '=')
+ self.visit(node.value)
+
+ def visit_ImportFrom(self, node):
+ self.newline(node)
+ self.write('from %s%s import ' % ('.' * node.level, node.module))
+ for idx, item in enumerate(node.names):
+ if idx:
+ self.write(', ')
+ self.write(item)
+
+ def visit_Import(self, node):
+ self.newline(node)
+ for item in node.names:
+ self.write('import ')
+ self.visit(item)
+
+ def visit_Expr(self, node):
+ self.newline(node)
+ self.generic_visit(node)
+
+ def visit_FunctionDef(self, node):
+ self.newline(extra=1)
+ self.decorators(node)
+ self.newline(node)
+ self.write('def %s(' % node.name)
+ self.signature(node.args)
+ self.write('):')
+ self.body(node.body)
+
+ def visit_ClassDef(self, node):
+ have_args = []
+ def paren_or_comma():
+ if have_args:
+ self.write(', ')
+ else:
+ have_args.append(True)
+ self.write('(')
+
+ self.newline(extra=2)
+ self.decorators(node)
+ self.newline(node)
+ self.write('class %s' % node.name)
+ for base in node.bases:
+ paren_or_comma()
+ self.visit(base)
+ # XXX: the if here is used to keep this module compatible
+ # with python 2.6.
+ if hasattr(node, 'keywords'):
+ for keyword in node.keywords:
+ paren_or_comma()
+ self.write(keyword.arg + '=')
+ self.visit(keyword.value)
+ if hasattr(node, 'starargs') and node.starargs is not None:
+ paren_or_comma()
+ self.write('*')
+ self.visit(node.starargs)
+ if hasattr(node, 'kwargs') and node.kwargs is not None:
+ paren_or_comma()
+ self.write('**')
+ self.visit(node.kwargs)
+ self.write(have_args and '):' or ':')
+ self.body(node.body)
+
+ def visit_If(self, node):
+ self.newline(node)
+ self.write('if ')
+ self.visit(node.test)
+ self.write(':')
+ self.body(node.body)
+ while True:
+ else_ = node.orelse
+ if len(else_) == 1 and isinstance(else_[0], If):
+ node = else_[0]
+ self.newline()
+ self.write('elif ')
+ self.visit(node.test)
+ self.write(':')
+ self.body(node.body)
+ else:
+ self.newline()
+ self.write('else:')
+ self.body(else_)
+ break
+
+ def visit_For(self, node):
+ self.newline(node)
+ self.write('for ')
+ self.visit(node.target)
+ self.write(' in ')
+ self.visit(node.iter)
+ self.write(':')
+ self.body_or_else(node)
+
+ def visit_While(self, node):
+ self.newline(node)
+ self.write('while ')
+ self.visit(node.test)
+ self.write(':')
+ self.body_or_else(node)
+
+ def visit_With(self, node):
+ self.newline(node)
+ self.write('with ')
+ self.visit(node.context_expr)
+ if node.optional_vars is not None:
+ self.write(' as ')
+ self.visit(node.optional_vars)
+ self.write(':')
+ self.body(node.body)
+
+ def visit_Pass(self, node):
+ self.newline(node)
+ self.write('pass')
+
+ def visit_Print(self, node):
+ # XXX: python 2.6 only
+ self.newline(node)
+ self.write('print ')
+ want_comma = False
+ if node.dest is not None:
+ self.write(' >> ')
+ self.visit(node.dest)
+ want_comma = True
+ for value in node.values:
+ if want_comma:
+ self.write(', ')
+ self.visit(value)
+ want_comma = True
+ if not node.nl:
+ self.write(',')
+
+ def visit_Delete(self, node):
+ self.newline(node)
+ self.write('del ')
+ for idx, target in enumerate(node):
+ if idx:
+ self.write(', ')
+ self.visit(target)
+
+ def visit_TryExcept(self, node):
+ self.newline(node)
+ self.write('try:')
+ self.body(node.body)
+ for handler in node.handlers:
+ self.visit(handler)
+
+ def visit_TryFinally(self, node):
+ self.newline(node)
+ self.write('try:')
+ self.body(node.body)
+ self.newline(node)
+ self.write('finally:')
+ self.body(node.finalbody)
+
+ def visit_Global(self, node):
+ self.newline(node)
+ self.write('global ' + ', '.join(node.names))
+
+ def visit_Nonlocal(self, node):
+ self.newline(node)
+ self.write('nonlocal ' + ', '.join(node.names))
+
+ def visit_Return(self, node):
+ self.newline(node)
+ self.write('return ')
+ self.visit(node.value)
+
+ def visit_Break(self, node):
+ self.newline(node)
+ self.write('break')
+
+ def visit_Continue(self, node):
+ self.newline(node)
+ self.write('continue')
+
+ def visit_Raise(self, node):
+ # XXX: Python 2.6 / 3.0 compatibility
+ self.newline(node)
+ self.write('raise')
+ if hasattr(node, 'exc') and node.exc is not None:
+ self.write(' ')
+ self.visit(node.exc)
+ if node.cause is not None:
+ self.write(' from ')
+ self.visit(node.cause)
+ elif hasattr(node, 'type') and node.type is not None:
+ self.visit(node.type)
+ if node.inst is not None:
+ self.write(', ')
+ self.visit(node.inst)
+ if node.tback is not None:
+ self.write(', ')
+ self.visit(node.tback)
+
+ # Expressions
+
+ def visit_Attribute(self, node):
+ self.visit(node.value)
+ self.write('.' + node.attr)
+
+ def visit_Call(self, node):
+ want_comma = []
+ def write_comma():
+ if want_comma:
+ self.write(', ')
+ else:
+ want_comma.append(True)
+
+ self.visit(node.func)
+ self.write('(')
+ for arg in node.args:
+ write_comma()
+ self.visit(arg)
+ for keyword in node.keywords:
+ write_comma()
+ self.write(keyword.arg + '=')
+ self.visit(keyword.value)
+ if hasattr(node, 'starargs') and node.starargs is not None:
+ write_comma()
+ self.write('*')
+ self.visit(node.starargs)
+ if hasattr(node, 'kwargs') and node.kwargs is not None:
+ write_comma()
+ self.write('**')
+ self.visit(node.kwargs)
+ self.write(')')
+
+ def visit_Name(self, node):
+ self.write(node.id)
+
+ def visit_Str(self, node):
+ self.write(repr(node.s))
+
+ def visit_Bytes(self, node):
+ self.write(repr(node.s))
+
+ def visit_Num(self, node):
+ self.write(repr(node.n))
+
+ def visit_Tuple(self, node):
+ self.write('(')
+ idx = -1
+ for idx, item in enumerate(node.elts):
+ if idx:
+ self.write(', ')
+ self.visit(item)
+ self.write(idx and ')' or ',)')
+
+ def sequence_visit(left, right):
+ def visit(self, node):
+ self.write(left)
+ for idx, item in enumerate(node.elts):
+ if idx:
+ self.write(', ')
+ self.visit(item)
+ self.write(right)
+ return visit
+
+ visit_List = sequence_visit('[', ']')
+ visit_Set = sequence_visit('{', '}')
+ del sequence_visit
+
+ def visit_Dict(self, node):
+ self.write('{')
+ for idx, (key, value) in enumerate(zip(node.keys, node.values)):
+ if idx:
+ self.write(', ')
+ self.visit(key)
+ self.write(': ')
+ self.visit(value)
+ self.write('}')
+
+ def visit_BinOp(self, node):
+ self.visit(node.left)
+ self.write(' %s ' % BINOP_SYMBOLS[type(node.op)])
+ self.visit(node.right)
+
+ def visit_BoolOp(self, node):
+ self.write('(')
+ for idx, value in enumerate(node.values):
+ if idx:
+ self.write(' %s ' % BOOLOP_SYMBOLS[type(node.op)])
+ self.visit(value)
+ self.write(')')
+
+ def visit_Compare(self, node):
+ self.write('(')
+ self.write(node.left)
+ for op, right in zip(node.ops, node.comparators):
+ self.write(' %s %%' % CMPOP_SYMBOLS[type(op)])
+ self.visit(right)
+ self.write(')')
+
+ def visit_UnaryOp(self, node):
+ self.write('(')
+ op = UNARYOP_SYMBOLS[type(node.op)]
+ self.write(op)
+ if op == 'not':
+ self.write(' ')
+ self.visit(node.operand)
+ self.write(')')
+
+ def visit_Subscript(self, node):
+ self.visit(node.value)
+ self.write('[')
+ self.visit(node.slice)
+ self.write(']')
+
+ def visit_Slice(self, node):
+ if node.lower is not None:
+ self.visit(node.lower)
+ self.write(':')
+ if node.upper is not None:
+ self.visit(node.upper)
+ if node.step is not None:
+ self.write(':')
+ if not (isinstance(node.step, Name) and node.step.id == 'None'):
+ self.visit(node.step)
+
+ def visit_ExtSlice(self, node):
+ for idx, item in node.dims:
+ if idx:
+ self.write(', ')
+ self.visit(item)
+
+ def visit_Yield(self, node):
+ self.write('yield ')
+ self.visit(node.value)
+
+ def visit_Lambda(self, node):
+ self.write('lambda ')
+ self.signature(node.args)
+ self.write(': ')
+ self.visit(node.body)
+
+ def visit_Ellipsis(self, node):
+ self.write('Ellipsis')
+
+ def generator_visit(left, right):
+ def visit(self, node):
+ self.write(left)
+ self.visit(node.elt)
+ for comprehension in node.generators:
+ self.visit(comprehension)
+ self.write(right)
+ return visit
+
+ visit_ListComp = generator_visit('[', ']')
+ visit_GeneratorExp = generator_visit('(', ')')
+ visit_SetComp = generator_visit('{', '}')
+ del generator_visit
+
+ def visit_DictComp(self, node):
+ self.write('{')
+ self.visit(node.key)
+ self.write(': ')
+ self.visit(node.value)
+ for comprehension in node.generators:
+ self.visit(comprehension)
+ self.write('}')
+
+ def visit_IfExp(self, node):
+ self.visit(node.body)
+ self.write(' if ')
+ self.visit(node.test)
+ self.write(' else ')
+ self.visit(node.orelse)
+
+ def visit_Starred(self, node):
+ self.write('*')
+ self.visit(node.value)
+
+ def visit_Repr(self, node):
+ # XXX: python 2.6 only
+ self.write('`')
+ self.visit(node.value)
+ self.write('`')
+
+ # Helper Nodes
+
+ def visit_alias(self, node):
+ self.write(node.name)
+ if node.asname is not None:
+ self.write(' as ' + node.asname)
+
+ def visit_comprehension(self, node):
+ self.write(' for ')
+ self.visit(node.target)
+ self.write(' in ')
+ self.visit(node.iter)
+ if node.ifs:
+ for if_ in node.ifs:
+ self.write(' if ')
+ self.visit(if_)
+
+ def visit_excepthandler(self, node):
+ self.newline(node)
+ self.write('except')
+ if node.type is not None:
+ self.write(' ')
+ self.visit(node.type)
+ if node.name is not None:
+ self.write(' as ')
+ self.visit(node.name)
+ self.write(':')
+ self.body(node.body)
diff --git a/poky/bitbake/lib/ply/__init__.py b/poky/bitbake/lib/ply/__init__.py
new file mode 100644
index 000000000..853a98554
--- /dev/null
+++ b/poky/bitbake/lib/ply/__init__.py
@@ -0,0 +1,4 @@
+# PLY package
+# Author: David Beazley (dave@dabeaz.com)
+
+__all__ = ['lex','yacc']
diff --git a/poky/bitbake/lib/ply/lex.py b/poky/bitbake/lib/ply/lex.py
new file mode 100644
index 000000000..267ec100f
--- /dev/null
+++ b/poky/bitbake/lib/ply/lex.py
@@ -0,0 +1,1058 @@
+# -----------------------------------------------------------------------------
+# ply: lex.py
+#
+# Copyright (C) 2001-2009,
+# David M. Beazley (Dabeaz LLC)
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of the David Beazley or Dabeaz LLC may be used to
+# endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# -----------------------------------------------------------------------------
+
+__version__ = "3.3"
+__tabversion__ = "3.2" # Version of table file used
+
+import re, sys, types, copy, os
+
+# This tuple contains known string types
+try:
+ # Python 2.6
+ StringTypes = (types.StringType, types.UnicodeType)
+except AttributeError:
+ # Python 3.0
+ StringTypes = (str, bytes)
+
+# Extract the code attribute of a function. Different implementations
+# are for Python 2/3 compatibility.
+
+if sys.version_info[0] < 3:
+ def func_code(f):
+ return f.func_code
+else:
+ def func_code(f):
+ return f.__code__
+
+# This regular expression is used to match valid token names
+_is_identifier = re.compile(r'^[a-zA-Z0-9_]+$')
+
+# Exception thrown when invalid token encountered and no default error
+# handler is defined.
+
+class LexError(Exception):
+ def __init__(self,message,s):
+ self.args = (message,)
+ self.text = s
+
+# Token class. This class is used to represent the tokens produced.
+class LexToken(object):
+ def __str__(self):
+ return "LexToken(%s,%r,%d,%d)" % (self.type,self.value,self.lineno,self.lexpos)
+ def __repr__(self):
+ return str(self)
+
+# This object is a stand-in for a logging object created by the
+# logging module.
+
+class PlyLogger(object):
+ def __init__(self,f):
+ self.f = f
+ def critical(self,msg,*args,**kwargs):
+ self.f.write((msg % args) + "\n")
+
+ def warning(self,msg,*args,**kwargs):
+ self.f.write("WARNING: "+ (msg % args) + "\n")
+
+ def error(self,msg,*args,**kwargs):
+ self.f.write("ERROR: " + (msg % args) + "\n")
+
+ info = critical
+ debug = critical
+
+# Null logger is used when no output is generated. Does nothing.
+class NullLogger(object):
+ def __getattribute__(self,name):
+ return self
+ def __call__(self,*args,**kwargs):
+ return self
+
+# -----------------------------------------------------------------------------
+# === Lexing Engine ===
+#
+# The following Lexer class implements the lexer runtime. There are only
+# a few public methods and attributes:
+#
+# input() - Store a new string in the lexer
+# token() - Get the next token
+# clone() - Clone the lexer
+#
+# lineno - Current line number
+# lexpos - Current position in the input string
+# -----------------------------------------------------------------------------
+
+class Lexer:
+ def __init__(self):
+ self.lexre = None # Master regular expression. This is a list of
+ # tuples (re,findex) where re is a compiled
+ # regular expression and findex is a list
+ # mapping regex group numbers to rules
+ self.lexretext = None # Current regular expression strings
+ self.lexstatere = {} # Dictionary mapping lexer states to master regexs
+ self.lexstateretext = {} # Dictionary mapping lexer states to regex strings
+ self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names
+ self.lexstate = "INITIAL" # Current lexer state
+ self.lexstatestack = [] # Stack of lexer states
+ self.lexstateinfo = None # State information
+ self.lexstateignore = {} # Dictionary of ignored characters for each state
+ self.lexstateerrorf = {} # Dictionary of error functions for each state
+ self.lexreflags = 0 # Optional re compile flags
+ self.lexdata = None # Actual input data (as a string)
+ self.lexpos = 0 # Current position in input text
+ self.lexlen = 0 # Length of the input text
+ self.lexerrorf = None # Error rule (if any)
+ self.lextokens = None # List of valid tokens
+ self.lexignore = "" # Ignored characters
+ self.lexliterals = "" # Literal characters that can be passed through
+ self.lexmodule = None # Module
+ self.lineno = 1 # Current line number
+ self.lexoptimize = 0 # Optimized mode
+
+ def clone(self,object=None):
+ c = copy.copy(self)
+
+ # If the object parameter has been supplied, it means we are attaching the
+ # lexer to a new object. In this case, we have to rebind all methods in
+ # the lexstatere and lexstateerrorf tables.
+
+ if object:
+ newtab = { }
+ for key, ritem in self.lexstatere.items():
+ newre = []
+ for cre, findex in ritem:
+ newfindex = []
+ for f in findex:
+ if not f or not f[0]:
+ newfindex.append(f)
+ continue
+ newfindex.append((getattr(object,f[0].__name__),f[1]))
+ newre.append((cre,newfindex))
+ newtab[key] = newre
+ c.lexstatere = newtab
+ c.lexstateerrorf = { }
+ for key, ef in self.lexstateerrorf.items():
+ c.lexstateerrorf[key] = getattr(object,ef.__name__)
+ c.lexmodule = object
+ return c
+
+ # ------------------------------------------------------------
+ # writetab() - Write lexer information to a table file
+ # ------------------------------------------------------------
+ def writetab(self,tabfile,outputdir=""):
+ if isinstance(tabfile,types.ModuleType):
+ return
+ basetabfilename = tabfile.split(".")[-1]
+ filename = os.path.join(outputdir,basetabfilename)+".py"
+ tf = open(filename,"w")
+ tf.write("# %s.py. This file automatically created by PLY (version %s). Don't edit!\n" % (tabfile,__version__))
+ tf.write("_tabversion = %s\n" % repr(__version__))
+ tf.write("_lextokens = %s\n" % repr(self.lextokens))
+ tf.write("_lexreflags = %s\n" % repr(self.lexreflags))
+ tf.write("_lexliterals = %s\n" % repr(self.lexliterals))
+ tf.write("_lexstateinfo = %s\n" % repr(self.lexstateinfo))
+
+ tabre = { }
+ # Collect all functions in the initial state
+ initial = self.lexstatere["INITIAL"]
+ initialfuncs = []
+ for part in initial:
+ for f in part[1]:
+ if f and f[0]:
+ initialfuncs.append(f)
+
+ for key, lre in self.lexstatere.items():
+ titem = []
+ for i in range(len(lre)):
+ titem.append((self.lexstateretext[key][i],_funcs_to_names(lre[i][1],self.lexstaterenames[key][i])))
+ tabre[key] = titem
+
+ tf.write("_lexstatere = %s\n" % repr(tabre))
+ tf.write("_lexstateignore = %s\n" % repr(self.lexstateignore))
+
+ taberr = { }
+ for key, ef in self.lexstateerrorf.items():
+ if ef:
+ taberr[key] = ef.__name__
+ else:
+ taberr[key] = None
+ tf.write("_lexstateerrorf = %s\n" % repr(taberr))
+ tf.close()
+
+ # ------------------------------------------------------------
+ # readtab() - Read lexer information from a tab file
+ # ------------------------------------------------------------
+ def readtab(self,tabfile,fdict):
+ if isinstance(tabfile,types.ModuleType):
+ lextab = tabfile
+ else:
+ if sys.version_info[0] < 3:
+ exec("import %s as lextab" % tabfile)
+ else:
+ env = { }
+ exec("import %s as lextab" % tabfile, env,env)
+ lextab = env['lextab']
+
+ if getattr(lextab,"_tabversion","0.0") != __version__:
+ raise ImportError("Inconsistent PLY version")
+
+ self.lextokens = lextab._lextokens
+ self.lexreflags = lextab._lexreflags
+ self.lexliterals = lextab._lexliterals
+ self.lexstateinfo = lextab._lexstateinfo
+ self.lexstateignore = lextab._lexstateignore
+ self.lexstatere = { }
+ self.lexstateretext = { }
+ for key,lre in lextab._lexstatere.items():
+ titem = []
+ txtitem = []
+ for i in range(len(lre)):
+ titem.append((re.compile(lre[i][0],lextab._lexreflags | re.VERBOSE),_names_to_funcs(lre[i][1],fdict)))
+ txtitem.append(lre[i][0])
+ self.lexstatere[key] = titem
+ self.lexstateretext[key] = txtitem
+ self.lexstateerrorf = { }
+ for key,ef in lextab._lexstateerrorf.items():
+ self.lexstateerrorf[key] = fdict[ef]
+ self.begin('INITIAL')
+
+ # ------------------------------------------------------------
+ # input() - Push a new string into the lexer
+ # ------------------------------------------------------------
+ def input(self,s):
+ # Pull off the first character to see if s looks like a string
+ c = s[:1]
+ if not isinstance(c,StringTypes):
+ raise ValueError("Expected a string")
+ self.lexdata = s
+ self.lexpos = 0
+ self.lexlen = len(s)
+
+ # ------------------------------------------------------------
+ # begin() - Changes the lexing state
+ # ------------------------------------------------------------
+ def begin(self,state):
+ if not state in self.lexstatere:
+ raise ValueError("Undefined state")
+ self.lexre = self.lexstatere[state]
+ self.lexretext = self.lexstateretext[state]
+ self.lexignore = self.lexstateignore.get(state,"")
+ self.lexerrorf = self.lexstateerrorf.get(state,None)
+ self.lexstate = state
+
+ # ------------------------------------------------------------
+ # push_state() - Changes the lexing state and saves old on stack
+ # ------------------------------------------------------------
+ def push_state(self,state):
+ self.lexstatestack.append(self.lexstate)
+ self.begin(state)
+
+ # ------------------------------------------------------------
+ # pop_state() - Restores the previous state
+ # ------------------------------------------------------------
+ def pop_state(self):
+ self.begin(self.lexstatestack.pop())
+
+ # ------------------------------------------------------------
+ # current_state() - Returns the current lexing state
+ # ------------------------------------------------------------
+ def current_state(self):
+ return self.lexstate
+
+ # ------------------------------------------------------------
+ # skip() - Skip ahead n characters
+ # ------------------------------------------------------------
+ def skip(self,n):
+ self.lexpos += n
+
+ # ------------------------------------------------------------
+ # opttoken() - Return the next token from the Lexer
+ #
+ # Note: This function has been carefully implemented to be as fast
+ # as possible. Don't make changes unless you really know what
+ # you are doing
+ # ------------------------------------------------------------
+ def token(self):
+ # Make local copies of frequently referenced attributes
+ lexpos = self.lexpos
+ lexlen = self.lexlen
+ lexignore = self.lexignore
+ lexdata = self.lexdata
+
+ while lexpos < lexlen:
+ # This code provides some short-circuit code for whitespace, tabs, and other ignored characters
+ if lexdata[lexpos] in lexignore:
+ lexpos += 1
+ continue
+
+ # Look for a regular expression match
+ for lexre,lexindexfunc in self.lexre:
+ m = lexre.match(lexdata,lexpos)
+ if not m: continue
+
+ # Create a token for return
+ tok = LexToken()
+ tok.value = m.group()
+ tok.lineno = self.lineno
+ tok.lexpos = lexpos
+
+ i = m.lastindex
+ func,tok.type = lexindexfunc[i]
+
+ if not func:
+ # If no token type was set, it's an ignored token
+ if tok.type:
+ self.lexpos = m.end()
+ return tok
+ else:
+ lexpos = m.end()
+ break
+
+ lexpos = m.end()
+
+ # If token is processed by a function, call it
+
+ tok.lexer = self # Set additional attributes useful in token rules
+ self.lexmatch = m
+ self.lexpos = lexpos
+
+ newtok = func(tok)
+
+ # Every function must return a token, if nothing, we just move to next token
+ if not newtok:
+ lexpos = self.lexpos # This is here in case user has updated lexpos.
+ lexignore = self.lexignore # This is here in case there was a state change
+ break
+
+ # Verify type of the token. If not in the token map, raise an error
+ if not self.lexoptimize:
+ if not newtok.type in self.lextokens:
+ raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % (
+ func_code(func).co_filename, func_code(func).co_firstlineno,
+ func.__name__, newtok.type),lexdata[lexpos:])
+
+ return newtok
+ else:
+ # No match, see if in literals
+ if lexdata[lexpos] in self.lexliterals:
+ tok = LexToken()
+ tok.value = lexdata[lexpos]
+ tok.lineno = self.lineno
+ tok.type = tok.value
+ tok.lexpos = lexpos
+ self.lexpos = lexpos + 1
+ return tok
+
+ # No match. Call t_error() if defined.
+ if self.lexerrorf:
+ tok = LexToken()
+ tok.value = self.lexdata[lexpos:]
+ tok.lineno = self.lineno
+ tok.type = "error"
+ tok.lexer = self
+ tok.lexpos = lexpos
+ self.lexpos = lexpos
+ newtok = self.lexerrorf(tok)
+ if lexpos == self.lexpos:
+ # Error method didn't change text position at all. This is an error.
+ raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:])
+ lexpos = self.lexpos
+ if not newtok: continue
+ return newtok
+
+ self.lexpos = lexpos
+ raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos],lexpos), lexdata[lexpos:])
+
+ self.lexpos = lexpos + 1
+ if self.lexdata is None:
+ raise RuntimeError("No input string given with input()")
+ return None
+
+ # Iterator interface
+ def __iter__(self):
+ return self
+
+ def next(self):
+ t = self.token()
+ if t is None:
+ raise StopIteration
+ return t
+
+ __next__ = next
+
+# -----------------------------------------------------------------------------
+# ==== Lex Builder ===
+#
+# The functions and classes below are used to collect lexing information
+# and build a Lexer object from it.
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# get_caller_module_dict()
+#
+# This function returns a dictionary containing all of the symbols defined within
+# a caller further down the call stack. This is used to get the environment
+# associated with the yacc() call if none was provided.
+# -----------------------------------------------------------------------------
+
+def get_caller_module_dict(levels):
+ try:
+ raise RuntimeError
+ except RuntimeError:
+ e,b,t = sys.exc_info()
+ f = t.tb_frame
+ while levels > 0:
+ f = f.f_back
+ levels -= 1
+ ldict = f.f_globals.copy()
+ if f.f_globals != f.f_locals:
+ ldict.update(f.f_locals)
+
+ return ldict
+
+# -----------------------------------------------------------------------------
+# _funcs_to_names()
+#
+# Given a list of regular expression functions, this converts it to a list
+# suitable for output to a table file
+# -----------------------------------------------------------------------------
+
+def _funcs_to_names(funclist,namelist):
+ result = []
+ for f,name in zip(funclist,namelist):
+ if f and f[0]:
+ result.append((name, f[1]))
+ else:
+ result.append(f)
+ return result
+
+# -----------------------------------------------------------------------------
+# _names_to_funcs()
+#
+# Given a list of regular expression function names, this converts it back to
+# functions.
+# -----------------------------------------------------------------------------
+
+def _names_to_funcs(namelist,fdict):
+ result = []
+ for n in namelist:
+ if n and n[0]:
+ result.append((fdict[n[0]],n[1]))
+ else:
+ result.append(n)
+ return result
+
+# -----------------------------------------------------------------------------
+# _form_master_re()
+#
+# This function takes a list of all of the regex components and attempts to
+# form the master regular expression. Given limitations in the Python re
+# module, it may be necessary to break the master regex into separate expressions.
+# -----------------------------------------------------------------------------
+
+def _form_master_re(relist,reflags,ldict,toknames):
+ if not relist: return []
+ regex = "|".join(relist)
+ try:
+ lexre = re.compile(regex,re.VERBOSE | reflags)
+
+ # Build the index to function map for the matching engine
+ lexindexfunc = [ None ] * (max(lexre.groupindex.values())+1)
+ lexindexnames = lexindexfunc[:]
+
+ for f,i in lexre.groupindex.items():
+ handle = ldict.get(f,None)
+ if type(handle) in (types.FunctionType, types.MethodType):
+ lexindexfunc[i] = (handle,toknames[f])
+ lexindexnames[i] = f
+ elif handle is not None:
+ lexindexnames[i] = f
+ if f.find("ignore_") > 0:
+ lexindexfunc[i] = (None,None)
+ else:
+ lexindexfunc[i] = (None, toknames[f])
+
+ return [(lexre,lexindexfunc)],[regex],[lexindexnames]
+ except Exception:
+ m = int(len(relist)/2)
+ if m == 0: m = 1
+ llist, lre, lnames = _form_master_re(relist[:m],reflags,ldict,toknames)
+ rlist, rre, rnames = _form_master_re(relist[m:],reflags,ldict,toknames)
+ return llist+rlist, lre+rre, lnames+rnames
+
+# -----------------------------------------------------------------------------
+# def _statetoken(s,names)
+#
+# Given a declaration name s of the form "t_" and a dictionary whose keys are
+# state names, this function returns a tuple (states,tokenname) where states
+# is a tuple of state names and tokenname is the name of the token. For example,
+# calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM')
+# -----------------------------------------------------------------------------
+
+def _statetoken(s,names):
+ nonstate = 1
+ parts = s.split("_")
+ for i in range(1,len(parts)):
+ if not parts[i] in names and parts[i] != 'ANY': break
+ if i > 1:
+ states = tuple(parts[1:i])
+ else:
+ states = ('INITIAL',)
+
+ if 'ANY' in states:
+ states = tuple(names)
+
+ tokenname = "_".join(parts[i:])
+ return (states,tokenname)
+
+
+# -----------------------------------------------------------------------------
+# LexerReflect()
+#
+# This class represents information needed to build a lexer as extracted from a
+# user's input file.
+# -----------------------------------------------------------------------------
+class LexerReflect(object):
+ def __init__(self,ldict,log=None,reflags=0):
+ self.ldict = ldict
+ self.error_func = None
+ self.tokens = []
+ self.reflags = reflags
+ self.stateinfo = { 'INITIAL' : 'inclusive'}
+ self.files = {}
+ self.error = 0
+
+ if log is None:
+ self.log = PlyLogger(sys.stderr)
+ else:
+ self.log = log
+
+ # Get all of the basic information
+ def get_all(self):
+ self.get_tokens()
+ self.get_literals()
+ self.get_states()
+ self.get_rules()
+
+ # Validate all of the information
+ def validate_all(self):
+ self.validate_tokens()
+ self.validate_literals()
+ self.validate_rules()
+ return self.error
+
+ # Get the tokens map
+ def get_tokens(self):
+ tokens = self.ldict.get("tokens",None)
+ if not tokens:
+ self.log.error("No token list is defined")
+ self.error = 1
+ return
+
+ if not isinstance(tokens,(list, tuple)):
+ self.log.error("tokens must be a list or tuple")
+ self.error = 1
+ return
+
+ if not tokens:
+ self.log.error("tokens is empty")
+ self.error = 1
+ return
+
+ self.tokens = tokens
+
+ # Validate the tokens
+ def validate_tokens(self):
+ terminals = {}
+ for n in self.tokens:
+ if not _is_identifier.match(n):
+ self.log.error("Bad token name '%s'",n)
+ self.error = 1
+ if n in terminals:
+ self.log.warning("Token '%s' multiply defined", n)
+ terminals[n] = 1
+
+ # Get the literals specifier
+ def get_literals(self):
+ self.literals = self.ldict.get("literals","")
+
+ # Validate literals
+ def validate_literals(self):
+ try:
+ for c in self.literals:
+ if not isinstance(c,StringTypes) or len(c) > 1:
+ self.log.error("Invalid literal %s. Must be a single character", repr(c))
+ self.error = 1
+ continue
+
+ except TypeError:
+ self.log.error("Invalid literals specification. literals must be a sequence of characters")
+ self.error = 1
+
+ def get_states(self):
+ self.states = self.ldict.get("states",None)
+ # Build statemap
+ if self.states:
+ if not isinstance(self.states,(tuple,list)):
+ self.log.error("states must be defined as a tuple or list")
+ self.error = 1
+ else:
+ for s in self.states:
+ if not isinstance(s,tuple) or len(s) != 2:
+ self.log.error("Invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')",repr(s))
+ self.error = 1
+ continue
+ name, statetype = s
+ if not isinstance(name,StringTypes):
+ self.log.error("State name %s must be a string", repr(name))
+ self.error = 1
+ continue
+ if not (statetype == 'inclusive' or statetype == 'exclusive'):
+ self.log.error("State type for state %s must be 'inclusive' or 'exclusive'",name)
+ self.error = 1
+ continue
+ if name in self.stateinfo:
+ self.log.error("State '%s' already defined",name)
+ self.error = 1
+ continue
+ self.stateinfo[name] = statetype
+
+ # Get all of the symbols with a t_ prefix and sort them into various
+ # categories (functions, strings, error functions, and ignore characters)
+
+ def get_rules(self):
+ tsymbols = [f for f in self.ldict if f[:2] == 't_' ]
+
+ # Now build up a list of functions and a list of strings
+
+ self.toknames = { } # Mapping of symbols to token names
+ self.funcsym = { } # Symbols defined as functions
+ self.strsym = { } # Symbols defined as strings
+ self.ignore = { } # Ignore strings by state
+ self.errorf = { } # Error functions by state
+
+ for s in self.stateinfo:
+ self.funcsym[s] = []
+ self.strsym[s] = []
+
+ if len(tsymbols) == 0:
+ self.log.error("No rules of the form t_rulename are defined")
+ self.error = 1
+ return
+
+ for f in tsymbols:
+ t = self.ldict[f]
+ states, tokname = _statetoken(f,self.stateinfo)
+ self.toknames[f] = tokname
+
+ if hasattr(t,"__call__"):
+ if tokname == 'error':
+ for s in states:
+ self.errorf[s] = t
+ elif tokname == 'ignore':
+ line = func_code(t).co_firstlineno
+ file = func_code(t).co_filename
+ self.log.error("%s:%d: Rule '%s' must be defined as a string",file,line,t.__name__)
+ self.error = 1
+ else:
+ for s in states:
+ self.funcsym[s].append((f,t))
+ elif isinstance(t, StringTypes):
+ if tokname == 'ignore':
+ for s in states:
+ self.ignore[s] = t
+ if "\\" in t:
+ self.log.warning("%s contains a literal backslash '\\'",f)
+
+ elif tokname == 'error':
+ self.log.error("Rule '%s' must be defined as a function", f)
+ self.error = 1
+ else:
+ for s in states:
+ self.strsym[s].append((f,t))
+ else:
+ self.log.error("%s not defined as a function or string", f)
+ self.error = 1
+
+ # Sort the functions by line number
+ for f in self.funcsym.values():
+ if sys.version_info[0] < 3:
+ f.sort(lambda x,y: cmp(func_code(x[1]).co_firstlineno,func_code(y[1]).co_firstlineno))
+ else:
+ # Python 3.0
+ f.sort(key=lambda x: func_code(x[1]).co_firstlineno)
+
+ # Sort the strings by regular expression length
+ for s in self.strsym.values():
+ if sys.version_info[0] < 3:
+ s.sort(lambda x,y: (len(x[1]) < len(y[1])) - (len(x[1]) > len(y[1])))
+ else:
+ # Python 3.0
+ s.sort(key=lambda x: len(x[1]),reverse=True)
+
+ # Validate all of the t_rules collected
+ def validate_rules(self):
+ for state in self.stateinfo:
+ # Validate all rules defined by functions
+
+
+
+ for fname, f in self.funcsym[state]:
+ line = func_code(f).co_firstlineno
+ file = func_code(f).co_filename
+ self.files[file] = 1
+
+ tokname = self.toknames[fname]
+ if isinstance(f, types.MethodType):
+ reqargs = 2
+ else:
+ reqargs = 1
+ nargs = func_code(f).co_argcount
+ if nargs > reqargs:
+ self.log.error("%s:%d: Rule '%s' has too many arguments",file,line,f.__name__)
+ self.error = 1
+ continue
+
+ if nargs < reqargs:
+ self.log.error("%s:%d: Rule '%s' requires an argument", file,line,f.__name__)
+ self.error = 1
+ continue
+
+ if not f.__doc__:
+ self.log.error("%s:%d: No regular expression defined for rule '%s'",file,line,f.__name__)
+ self.error = 1
+ continue
+
+ try:
+ c = re.compile("(?P<%s>%s)" % (fname,f.__doc__), re.VERBOSE | self.reflags)
+ if c.match(""):
+ self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file,line,f.__name__)
+ self.error = 1
+ except re.error:
+ _etype, e, _etrace = sys.exc_info()
+ self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file,line,f.__name__,e)
+ if '#' in f.__doc__:
+ self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'",file,line, f.__name__)
+ self.error = 1
+
+ # Validate all rules defined by strings
+ for name,r in self.strsym[state]:
+ tokname = self.toknames[name]
+ if tokname == 'error':
+ self.log.error("Rule '%s' must be defined as a function", name)
+ self.error = 1
+ continue
+
+ if not tokname in self.tokens and tokname.find("ignore_") < 0:
+ self.log.error("Rule '%s' defined for an unspecified token %s",name,tokname)
+ self.error = 1
+ continue
+
+ try:
+ c = re.compile("(?P<%s>%s)" % (name,r),re.VERBOSE | self.reflags)
+ if (c.match("")):
+ self.log.error("Regular expression for rule '%s' matches empty string",name)
+ self.error = 1
+ except re.error:
+ _etype, e, _etrace = sys.exc_info()
+ self.log.error("Invalid regular expression for rule '%s'. %s",name,e)
+ if '#' in r:
+ self.log.error("Make sure '#' in rule '%s' is escaped with '\\#'",name)
+ self.error = 1
+
+ if not self.funcsym[state] and not self.strsym[state]:
+ self.log.error("No rules defined for state '%s'",state)
+ self.error = 1
+
+ # Validate the error function
+ efunc = self.errorf.get(state,None)
+ if efunc:
+ f = efunc
+ line = func_code(f).co_firstlineno
+ file = func_code(f).co_filename
+ self.files[file] = 1
+
+ if isinstance(f, types.MethodType):
+ reqargs = 2
+ else:
+ reqargs = 1
+ nargs = func_code(f).co_argcount
+ if nargs > reqargs:
+ self.log.error("%s:%d: Rule '%s' has too many arguments",file,line,f.__name__)
+ self.error = 1
+
+ if nargs < reqargs:
+ self.log.error("%s:%d: Rule '%s' requires an argument", file,line,f.__name__)
+ self.error = 1
+
+ for f in self.files:
+ self.validate_file(f)
+
+
+ # -----------------------------------------------------------------------------
+ # validate_file()
+ #
+ # This checks to see if there are duplicated t_rulename() functions or strings
+ # in the parser input file. This is done using a simple regular expression
+ # match on each line in the given file.
+ # -----------------------------------------------------------------------------
+
+ def validate_file(self,filename):
+ import os.path
+ base,ext = os.path.splitext(filename)
+ if ext != '.py': return # No idea what the file is. Return OK
+
+ try:
+ f = open(filename)
+ lines = f.readlines()
+ f.close()
+ except IOError:
+ return # Couldn't find the file. Don't worry about it
+
+ fre = re.compile(r'\s*def\s+(t_[a-zA-Z_0-9]*)\(')
+ sre = re.compile(r'\s*(t_[a-zA-Z_0-9]*)\s*=')
+
+ counthash = { }
+ linen = 1
+ for l in lines:
+ m = fre.match(l)
+ if not m:
+ m = sre.match(l)
+ if m:
+ name = m.group(1)
+ prev = counthash.get(name)
+ if not prev:
+ counthash[name] = linen
+ else:
+ self.log.error("%s:%d: Rule %s redefined. Previously defined on line %d",filename,linen,name,prev)
+ self.error = 1
+ linen += 1
+
+# -----------------------------------------------------------------------------
+# lex(module)
+#
+# Build all of the regular expression rules from definitions in the supplied module
+# -----------------------------------------------------------------------------
+def lex(module=None,object=None,debug=0,optimize=0,lextab="lextab",reflags=0,nowarn=0,outputdir="", debuglog=None, errorlog=None):
+ global lexer
+ ldict = None
+ stateinfo = { 'INITIAL' : 'inclusive'}
+ lexobj = Lexer()
+ lexobj.lexoptimize = optimize
+ global token,input
+
+ if errorlog is None:
+ errorlog = PlyLogger(sys.stderr)
+
+ if debug:
+ if debuglog is None:
+ debuglog = PlyLogger(sys.stderr)
+
+ # Get the module dictionary used for the lexer
+ if object: module = object
+
+ if module:
+ _items = [(k,getattr(module,k)) for k in dir(module)]
+ ldict = dict(_items)
+ else:
+ ldict = get_caller_module_dict(2)
+
+ # Collect parser information from the dictionary
+ linfo = LexerReflect(ldict,log=errorlog,reflags=reflags)
+ linfo.get_all()
+ if not optimize:
+ if linfo.validate_all():
+ raise SyntaxError("Can't build lexer")
+
+ if optimize and lextab:
+ try:
+ lexobj.readtab(lextab,ldict)
+ token = lexobj.token
+ input = lexobj.input
+ lexer = lexobj
+ return lexobj
+
+ except ImportError:
+ pass
+
+ # Dump some basic debugging information
+ if debug:
+ debuglog.info("lex: tokens = %r", linfo.tokens)
+ debuglog.info("lex: literals = %r", linfo.literals)
+ debuglog.info("lex: states = %r", linfo.stateinfo)
+
+ # Build a dictionary of valid token names
+ lexobj.lextokens = { }
+ for n in linfo.tokens:
+ lexobj.lextokens[n] = 1
+
+ # Get literals specification
+ if isinstance(linfo.literals,(list,tuple)):
+ lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals)
+ else:
+ lexobj.lexliterals = linfo.literals
+
+ # Get the stateinfo dictionary
+ stateinfo = linfo.stateinfo
+
+ regexs = { }
+ # Build the master regular expressions
+ for state in stateinfo:
+ regex_list = []
+
+ # Add rules defined by functions first
+ for fname, f in linfo.funcsym[state]:
+ line = func_code(f).co_firstlineno
+ file = func_code(f).co_filename
+ regex_list.append("(?P<%s>%s)" % (fname,f.__doc__))
+ if debug:
+ debuglog.info("lex: Adding rule %s -> '%s' (state '%s')",fname,f.__doc__, state)
+
+ # Now add all of the simple rules
+ for name,r in linfo.strsym[state]:
+ regex_list.append("(?P<%s>%s)" % (name,r))
+ if debug:
+ debuglog.info("lex: Adding rule %s -> '%s' (state '%s')",name,r, state)
+
+ regexs[state] = regex_list
+
+ # Build the master regular expressions
+
+ if debug:
+ debuglog.info("lex: ==== MASTER REGEXS FOLLOW ====")
+
+ for state in regexs:
+ lexre, re_text, re_names = _form_master_re(regexs[state],reflags,ldict,linfo.toknames)
+ lexobj.lexstatere[state] = lexre
+ lexobj.lexstateretext[state] = re_text
+ lexobj.lexstaterenames[state] = re_names
+ if debug:
+ for i in range(len(re_text)):
+ debuglog.info("lex: state '%s' : regex[%d] = '%s'",state, i, re_text[i])
+
+ # For inclusive states, we need to add the regular expressions from the INITIAL state
+ for state,stype in stateinfo.items():
+ if state != "INITIAL" and stype == 'inclusive':
+ lexobj.lexstatere[state].extend(lexobj.lexstatere['INITIAL'])
+ lexobj.lexstateretext[state].extend(lexobj.lexstateretext['INITIAL'])
+ lexobj.lexstaterenames[state].extend(lexobj.lexstaterenames['INITIAL'])
+
+ lexobj.lexstateinfo = stateinfo
+ lexobj.lexre = lexobj.lexstatere["INITIAL"]
+ lexobj.lexretext = lexobj.lexstateretext["INITIAL"]
+ lexobj.lexreflags = reflags
+
+ # Set up ignore variables
+ lexobj.lexstateignore = linfo.ignore
+ lexobj.lexignore = lexobj.lexstateignore.get("INITIAL","")
+
+ # Set up error functions
+ lexobj.lexstateerrorf = linfo.errorf
+ lexobj.lexerrorf = linfo.errorf.get("INITIAL",None)
+ if not lexobj.lexerrorf:
+ errorlog.warning("No t_error rule is defined")
+
+ # Check state information for ignore and error rules
+ for s,stype in stateinfo.items():
+ if stype == 'exclusive':
+ if not s in linfo.errorf:
+ errorlog.warning("No error rule is defined for exclusive state '%s'", s)
+ if not s in linfo.ignore and lexobj.lexignore:
+ errorlog.warning("No ignore rule is defined for exclusive state '%s'", s)
+ elif stype == 'inclusive':
+ if not s in linfo.errorf:
+ linfo.errorf[s] = linfo.errorf.get("INITIAL",None)
+ if not s in linfo.ignore:
+ linfo.ignore[s] = linfo.ignore.get("INITIAL","")
+
+ # Create global versions of the token() and input() functions
+ token = lexobj.token
+ input = lexobj.input
+ lexer = lexobj
+
+ # If in optimize mode, we write the lextab
+ if lextab and optimize:
+ lexobj.writetab(lextab,outputdir)
+
+ return lexobj
+
+# -----------------------------------------------------------------------------
+# runmain()
+#
+# This runs the lexer as a main program
+# -----------------------------------------------------------------------------
+
+def runmain(lexer=None,data=None):
+ if not data:
+ try:
+ filename = sys.argv[1]
+ f = open(filename)
+ data = f.read()
+ f.close()
+ except IndexError:
+ sys.stdout.write("Reading from standard input (type EOF to end):\n")
+ data = sys.stdin.read()
+
+ if lexer:
+ _input = lexer.input
+ else:
+ _input = input
+ _input(data)
+ if lexer:
+ _token = lexer.token
+ else:
+ _token = token
+
+ while 1:
+ tok = _token()
+ if not tok: break
+ sys.stdout.write("(%s,%r,%d,%d)\n" % (tok.type, tok.value, tok.lineno,tok.lexpos))
+
+# -----------------------------------------------------------------------------
+# @TOKEN(regex)
+#
+# This decorator function can be used to set the regex expression on a function
+# when its docstring might need to be set in an alternative way
+# -----------------------------------------------------------------------------
+
+def TOKEN(r):
+ def set_doc(f):
+ if hasattr(r,"__call__"):
+ f.__doc__ = r.__doc__
+ else:
+ f.__doc__ = r
+ return f
+ return set_doc
+
+# Alternative spelling of the TOKEN decorator
+Token = TOKEN
+
diff --git a/poky/bitbake/lib/ply/yacc.py b/poky/bitbake/lib/ply/yacc.py
new file mode 100644
index 000000000..d50886ed2
--- /dev/null
+++ b/poky/bitbake/lib/ply/yacc.py
@@ -0,0 +1,3278 @@
+# -----------------------------------------------------------------------------
+# ply: yacc.py
+#
+# Copyright (C) 2001-2009,
+# David M. Beazley (Dabeaz LLC)
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of the David Beazley or Dabeaz LLC may be used to
+# endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# -----------------------------------------------------------------------------
+#
+# This implements an LR parser that is constructed from grammar rules defined
+# as Python functions. The grammer is specified by supplying the BNF inside
+# Python documentation strings. The inspiration for this technique was borrowed
+# from John Aycock's Spark parsing system. PLY might be viewed as cross between
+# Spark and the GNU bison utility.
+#
+# The current implementation is only somewhat object-oriented. The
+# LR parser itself is defined in terms of an object (which allows multiple
+# parsers to co-exist). However, most of the variables used during table
+# construction are defined in terms of global variables. Users shouldn't
+# notice unless they are trying to define multiple parsers at the same
+# time using threads (in which case they should have their head examined).
+#
+# This implementation supports both SLR and LALR(1) parsing. LALR(1)
+# support was originally implemented by Elias Ioup (ezioup@alumni.uchicago.edu),
+# using the algorithm found in Aho, Sethi, and Ullman "Compilers: Principles,
+# Techniques, and Tools" (The Dragon Book). LALR(1) has since been replaced
+# by the more efficient DeRemer and Pennello algorithm.
+#
+# :::::::: WARNING :::::::
+#
+# Construction of LR parsing tables is fairly complicated and expensive.
+# To make this module run fast, a *LOT* of work has been put into
+# optimization---often at the expensive of readability and what might
+# consider to be good Python "coding style." Modify the code at your
+# own risk!
+# ----------------------------------------------------------------------------
+
+__version__ = "3.3"
+__tabversion__ = "3.2" # Table version
+
+#-----------------------------------------------------------------------------
+# === User configurable parameters ===
+#
+# Change these to modify the default behavior of yacc (if you wish)
+#-----------------------------------------------------------------------------
+
+yaccdebug = 0 # Debugging mode. If set, yacc generates a
+ # a 'parser.out' file in the current directory
+
+debug_file = 'parser.out' # Default name of the debugging file
+tab_module = 'parsetab' # Default name of the table module
+default_lr = 'LALR' # Default LR table generation method
+
+error_count = 3 # Number of symbols that must be shifted to leave recovery mode
+
+yaccdevel = 0 # Set to True if developing yacc. This turns off optimized
+ # implementations of certain functions.
+
+resultlimit = 40 # Size limit of results when running in debug mode.
+
+pickle_protocol = 0 # Protocol to use when writing pickle files
+
+import re, types, sys, os.path
+
+# Compatibility function for python 2.6/3.0
+if sys.version_info[0] < 3:
+ def func_code(f):
+ return f.func_code
+else:
+ def func_code(f):
+ return f.__code__
+
+# Compatibility
+try:
+ MAXINT = sys.maxint
+except AttributeError:
+ MAXINT = sys.maxsize
+
+# Python 2.x/3.0 compatibility.
+def load_ply_lex():
+ if sys.version_info[0] < 3:
+ import lex
+ else:
+ import ply.lex as lex
+ return lex
+
+# This object is a stand-in for a logging object created by the
+# logging module. PLY will use this by default to create things
+# such as the parser.out file. If a user wants more detailed
+# information, they can create their own logging object and pass
+# it into PLY.
+
+class PlyLogger(object):
+ def __init__(self,f):
+ self.f = f
+ def debug(self,msg,*args,**kwargs):
+ self.f.write((msg % args) + "\n")
+ info = debug
+
+ def warning(self,msg,*args,**kwargs):
+ self.f.write("WARNING: "+ (msg % args) + "\n")
+
+ def error(self,msg,*args,**kwargs):
+ self.f.write("ERROR: " + (msg % args) + "\n")
+
+ critical = debug
+
+# Null logger is used when no output is generated. Does nothing.
+class NullLogger(object):
+ def __getattribute__(self,name):
+ return self
+ def __call__(self,*args,**kwargs):
+ return self
+
+# Exception raised for yacc-related errors
+class YaccError(Exception): pass
+
+# Format the result message that the parser produces when running in debug mode.
+def format_result(r):
+ repr_str = repr(r)
+ if '\n' in repr_str: repr_str = repr(repr_str)
+ if len(repr_str) > resultlimit:
+ repr_str = repr_str[:resultlimit]+" ..."
+ result = "<%s @ 0x%x> (%s)" % (type(r).__name__,id(r),repr_str)
+ return result
+
+
+# Format stack entries when the parser is running in debug mode
+def format_stack_entry(r):
+ repr_str = repr(r)
+ if '\n' in repr_str: repr_str = repr(repr_str)
+ if len(repr_str) < 16:
+ return repr_str
+ else:
+ return "<%s @ 0x%x>" % (type(r).__name__,id(r))
+
+#-----------------------------------------------------------------------------
+# === LR Parsing Engine ===
+#
+# The following classes are used for the LR parser itself. These are not
+# used during table construction and are independent of the actual LR
+# table generation algorithm
+#-----------------------------------------------------------------------------
+
+# This class is used to hold non-terminal grammar symbols during parsing.
+# It normally has the following attributes set:
+# .type = Grammar symbol type
+# .value = Symbol value
+# .lineno = Starting line number
+# .endlineno = Ending line number (optional, set automatically)
+# .lexpos = Starting lex position
+# .endlexpos = Ending lex position (optional, set automatically)
+
+class YaccSymbol:
+ def __str__(self): return self.type
+ def __repr__(self): return str(self)
+
+# This class is a wrapper around the objects actually passed to each
+# grammar rule. Index lookup and assignment actually assign the
+# .value attribute of the underlying YaccSymbol object.
+# The lineno() method returns the line number of a given
+# item (or 0 if not defined). The linespan() method returns
+# a tuple of (startline,endline) representing the range of lines
+# for a symbol. The lexspan() method returns a tuple (lexpos,endlexpos)
+# representing the range of positional information for a symbol.
+
+class YaccProduction:
+ def __init__(self,s,stack=None):
+ self.slice = s
+ self.stack = stack
+ self.lexer = None
+ self.parser= None
+ def __getitem__(self,n):
+ if isinstance(n,slice):
+ return [self[i] for i in range(*(n.indices(len(self.slice))))]
+ if n >= 0: return self.slice[n].value
+ else: return self.stack[n].value
+
+ def __setitem__(self,n,v):
+ self.slice[n].value = v
+
+ def __getslice__(self,i,j):
+ return [s.value for s in self.slice[i:j]]
+
+ def __len__(self):
+ return len(self.slice)
+
+ def lineno(self,n):
+ return getattr(self.slice[n],"lineno",0)
+
+ def set_lineno(self,n,lineno):
+ self.slice[n].lineno = lineno
+
+ def linespan(self,n):
+ startline = getattr(self.slice[n],"lineno",0)
+ endline = getattr(self.slice[n],"endlineno",startline)
+ return startline,endline
+
+ def lexpos(self,n):
+ return getattr(self.slice[n],"lexpos",0)
+
+ def lexspan(self,n):
+ startpos = getattr(self.slice[n],"lexpos",0)
+ endpos = getattr(self.slice[n],"endlexpos",startpos)
+ return startpos,endpos
+
+ def error(self):
+ raise SyntaxError
+
+
+# -----------------------------------------------------------------------------
+# == LRParser ==
+#
+# The LR Parsing engine.
+# -----------------------------------------------------------------------------
+
+class LRParser:
+ def __init__(self,lrtab,errorf):
+ self.productions = lrtab.lr_productions
+ self.action = lrtab.lr_action
+ self.goto = lrtab.lr_goto
+ self.errorfunc = errorf
+
+ def errok(self):
+ self.errorok = 1
+
+ def restart(self):
+ del self.statestack[:]
+ del self.symstack[:]
+ sym = YaccSymbol()
+ sym.type = '$end'
+ self.symstack.append(sym)
+ self.statestack.append(0)
+
+ def parse(self,input=None,lexer=None,debug=0,tracking=0,tokenfunc=None):
+ if debug or yaccdevel:
+ if isinstance(debug,int):
+ debug = PlyLogger(sys.stderr)
+ return self.parsedebug(input,lexer,debug,tracking,tokenfunc)
+ elif tracking:
+ return self.parseopt(input,lexer,debug,tracking,tokenfunc)
+ else:
+ return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
+
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # parsedebug().
+ #
+ # This is the debugging enabled version of parse(). All changes made to the
+ # parsing engine should be made here. For the non-debugging version,
+ # copy this code to a method parseopt() and delete all of the sections
+ # enclosed in:
+ #
+ # #--! DEBUG
+ # statements
+ # #--! DEBUG
+ #
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ def parsedebug(self,input=None,lexer=None,debug=None,tracking=0,tokenfunc=None):
+ lookahead = None # Current lookahead symbol
+ lookaheadstack = [ ] # Stack of lookahead symbols
+ actions = self.action # Local reference to action table (to avoid lookup on self.)
+ goto = self.goto # Local reference to goto table (to avoid lookup on self.)
+ prod = self.productions # Local reference to production list (to avoid lookup on self.)
+ pslice = YaccProduction(None) # Production object passed to grammar rules
+ errorcount = 0 # Used during error recovery
+
+ # --! DEBUG
+ debug.info("PLY: PARSE DEBUG START")
+ # --! DEBUG
+
+ # If no lexer was given, we will try to use the lex module
+ if not lexer:
+ lex = load_ply_lex()
+ lexer = lex.lexer
+
+ # Set up the lexer and parser objects on pslice
+ pslice.lexer = lexer
+ pslice.parser = self
+
+ # If input was supplied, pass to lexer
+ if input is not None:
+ lexer.input(input)
+
+ if tokenfunc is None:
+ # Tokenize function
+ get_token = lexer.token
+ else:
+ get_token = tokenfunc
+
+ # Set up the state and symbol stacks
+
+ statestack = [ ] # Stack of parsing states
+ self.statestack = statestack
+ symstack = [ ] # Stack of grammar symbols
+ self.symstack = symstack
+
+ pslice.stack = symstack # Put in the production
+ errtoken = None # Err token
+
+ # The start state is assumed to be (0,$end)
+
+ statestack.append(0)
+ sym = YaccSymbol()
+ sym.type = "$end"
+ symstack.append(sym)
+ state = 0
+ while 1:
+ # Get the next symbol on the input. If a lookahead symbol
+ # is already set, we just use that. Otherwise, we'll pull
+ # the next token off of the lookaheadstack or from the lexer
+
+ # --! DEBUG
+ debug.debug('')
+ debug.debug('State : %s', state)
+ # --! DEBUG
+
+ if not lookahead:
+ if not lookaheadstack:
+ lookahead = get_token() # Get the next token
+ else:
+ lookahead = lookaheadstack.pop()
+ if not lookahead:
+ lookahead = YaccSymbol()
+ lookahead.type = "$end"
+
+ # --! DEBUG
+ debug.debug('Stack : %s',
+ ("%s . %s" % (" ".join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip())
+ # --! DEBUG
+
+ # Check the action table
+ ltype = lookahead.type
+ t = actions[state].get(ltype)
+
+ if t is not None:
+ if t > 0:
+ # shift a symbol on the stack
+ statestack.append(t)
+ state = t
+
+ # --! DEBUG
+ debug.debug("Action : Shift and goto state %s", t)
+ # --! DEBUG
+
+ symstack.append(lookahead)
+ lookahead = None
+
+ # Decrease error count on successful shift
+ if errorcount: errorcount -=1
+ continue
+
+ if t < 0:
+ # reduce a symbol on the stack, emit a production
+ p = prod[-t]
+ pname = p.name
+ plen = p.len
+
+ # Get production function
+ sym = YaccSymbol()
+ sym.type = pname # Production name
+ sym.value = None
+
+ # --! DEBUG
+ if plen:
+ debug.info("Action : Reduce rule [%s] with %s and goto state %d", p.str, "["+",".join([format_stack_entry(_v.value) for _v in symstack[-plen:]])+"]",-t)
+ else:
+ debug.info("Action : Reduce rule [%s] with %s and goto state %d", p.str, [],-t)
+
+ # --! DEBUG
+
+ if plen:
+ targ = symstack[-plen-1:]
+ targ[0] = sym
+
+ # --! TRACKING
+ if tracking:
+ t1 = targ[1]
+ sym.lineno = t1.lineno
+ sym.lexpos = t1.lexpos
+ t1 = targ[-1]
+ sym.endlineno = getattr(t1,"endlineno",t1.lineno)
+ sym.endlexpos = getattr(t1,"endlexpos",t1.lexpos)
+
+ # --! TRACKING
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # below as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ del symstack[-plen:]
+ del statestack[-plen:]
+ p.callable(pslice)
+ # --! DEBUG
+ debug.info("Result : %s", format_result(pslice[0]))
+ # --! DEBUG
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ else:
+
+ # --! TRACKING
+ if tracking:
+ sym.lineno = lexer.lineno
+ sym.lexpos = lexer.lexpos
+ # --! TRACKING
+
+ targ = [ sym ]
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # above as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ p.callable(pslice)
+ # --! DEBUG
+ debug.info("Result : %s", format_result(pslice[0]))
+ # --! DEBUG
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ if t == 0:
+ n = symstack[-1]
+ result = getattr(n,"value",None)
+ # --! DEBUG
+ debug.info("Done : Returning %s", format_result(result))
+ debug.info("PLY: PARSE DEBUG END")
+ # --! DEBUG
+ return result
+
+ if t == None:
+
+ # --! DEBUG
+ debug.error('Error : %s',
+ ("%s . %s" % (" ".join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip())
+ # --! DEBUG
+
+ # We have some kind of parsing error here. To handle
+ # this, we are going to push the current token onto
+ # the tokenstack and replace it with an 'error' token.
+ # If there are any synchronization rules, they may
+ # catch it.
+ #
+ # In addition to pushing the error token, we call call
+ # the user defined p_error() function if this is the
+ # first syntax error. This function is only called if
+ # errorcount == 0.
+ if errorcount == 0 or self.errorok:
+ errorcount = error_count
+ self.errorok = 0
+ errtoken = lookahead
+ if errtoken.type == "$end":
+ errtoken = None # End of file!
+ if self.errorfunc:
+ global errok,token,restart
+ errok = self.errok # Set some special functions available in error recovery
+ token = get_token
+ restart = self.restart
+ if errtoken and not hasattr(errtoken,'lexer'):
+ errtoken.lexer = lexer
+ tok = self.errorfunc(errtoken)
+ del errok, token, restart # Delete special functions
+
+ if self.errorok:
+ # User must have done some kind of panic
+ # mode recovery on their own. The
+ # returned token is the next lookahead
+ lookahead = tok
+ errtoken = None
+ continue
+ else:
+ if errtoken:
+ if hasattr(errtoken,"lineno"): lineno = lookahead.lineno
+ else: lineno = 0
+ if lineno:
+ sys.stderr.write("yacc: Syntax error at line %d, token=%s\n" % (lineno, errtoken.type))
+ else:
+ sys.stderr.write("yacc: Syntax error, token=%s" % errtoken.type)
+ else:
+ sys.stderr.write("yacc: Parse error in input. EOF\n")
+ return
+
+ else:
+ errorcount = error_count
+
+ # case 1: the statestack only has 1 entry on it. If we're in this state, the
+ # entire parse has been rolled back and we're completely hosed. The token is
+ # discarded and we just keep going.
+
+ if len(statestack) <= 1 and lookahead.type != "$end":
+ lookahead = None
+ errtoken = None
+ state = 0
+ # Nuke the pushback stack
+ del lookaheadstack[:]
+ continue
+
+ # case 2: the statestack has a couple of entries on it, but we're
+ # at the end of the file. nuke the top entry and generate an error token
+
+ # Start nuking entries on the stack
+ if lookahead.type == "$end":
+ # Whoa. We're really hosed here. Bail out
+ return
+
+ if lookahead.type != 'error':
+ sym = symstack[-1]
+ if sym.type == 'error':
+ # Hmmm. Error is on top of stack, we'll just nuke input
+ # symbol and continue
+ lookahead = None
+ continue
+ t = YaccSymbol()
+ t.type = 'error'
+ if hasattr(lookahead,"lineno"):
+ t.lineno = lookahead.lineno
+ t.value = lookahead
+ lookaheadstack.append(lookahead)
+ lookahead = t
+ else:
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1] # Potential bug fix
+
+ continue
+
+ # Call an error function here
+ raise RuntimeError("yacc: internal parser error!!!\n")
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # parseopt().
+ #
+ # Optimized version of parse() method. DO NOT EDIT THIS CODE DIRECTLY.
+ # Edit the debug version above, then copy any modifications to the method
+ # below while removing #--! DEBUG sections.
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+
+ def parseopt(self,input=None,lexer=None,debug=0,tracking=0,tokenfunc=None):
+ lookahead = None # Current lookahead symbol
+ lookaheadstack = [ ] # Stack of lookahead symbols
+ actions = self.action # Local reference to action table (to avoid lookup on self.)
+ goto = self.goto # Local reference to goto table (to avoid lookup on self.)
+ prod = self.productions # Local reference to production list (to avoid lookup on self.)
+ pslice = YaccProduction(None) # Production object passed to grammar rules
+ errorcount = 0 # Used during error recovery
+
+ # If no lexer was given, we will try to use the lex module
+ if not lexer:
+ lex = load_ply_lex()
+ lexer = lex.lexer
+
+ # Set up the lexer and parser objects on pslice
+ pslice.lexer = lexer
+ pslice.parser = self
+
+ # If input was supplied, pass to lexer
+ if input is not None:
+ lexer.input(input)
+
+ if tokenfunc is None:
+ # Tokenize function
+ get_token = lexer.token
+ else:
+ get_token = tokenfunc
+
+ # Set up the state and symbol stacks
+
+ statestack = [ ] # Stack of parsing states
+ self.statestack = statestack
+ symstack = [ ] # Stack of grammar symbols
+ self.symstack = symstack
+
+ pslice.stack = symstack # Put in the production
+ errtoken = None # Err token
+
+ # The start state is assumed to be (0,$end)
+
+ statestack.append(0)
+ sym = YaccSymbol()
+ sym.type = '$end'
+ symstack.append(sym)
+ state = 0
+ while 1:
+ # Get the next symbol on the input. If a lookahead symbol
+ # is already set, we just use that. Otherwise, we'll pull
+ # the next token off of the lookaheadstack or from the lexer
+
+ if not lookahead:
+ if not lookaheadstack:
+ lookahead = get_token() # Get the next token
+ else:
+ lookahead = lookaheadstack.pop()
+ if not lookahead:
+ lookahead = YaccSymbol()
+ lookahead.type = '$end'
+
+ # Check the action table
+ ltype = lookahead.type
+ t = actions[state].get(ltype)
+
+ if t is not None:
+ if t > 0:
+ # shift a symbol on the stack
+ statestack.append(t)
+ state = t
+
+ symstack.append(lookahead)
+ lookahead = None
+
+ # Decrease error count on successful shift
+ if errorcount: errorcount -=1
+ continue
+
+ if t < 0:
+ # reduce a symbol on the stack, emit a production
+ p = prod[-t]
+ pname = p.name
+ plen = p.len
+
+ # Get production function
+ sym = YaccSymbol()
+ sym.type = pname # Production name
+ sym.value = None
+
+ if plen:
+ targ = symstack[-plen-1:]
+ targ[0] = sym
+
+ # --! TRACKING
+ if tracking:
+ t1 = targ[1]
+ sym.lineno = t1.lineno
+ sym.lexpos = t1.lexpos
+ t1 = targ[-1]
+ sym.endlineno = getattr(t1,"endlineno",t1.lineno)
+ sym.endlexpos = getattr(t1,"endlexpos",t1.lexpos)
+
+ # --! TRACKING
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # below as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ del symstack[-plen:]
+ del statestack[-plen:]
+ p.callable(pslice)
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ else:
+
+ # --! TRACKING
+ if tracking:
+ sym.lineno = lexer.lineno
+ sym.lexpos = lexer.lexpos
+ # --! TRACKING
+
+ targ = [ sym ]
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # above as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ p.callable(pslice)
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ if t == 0:
+ n = symstack[-1]
+ return getattr(n,"value",None)
+
+ if t == None:
+
+ # We have some kind of parsing error here. To handle
+ # this, we are going to push the current token onto
+ # the tokenstack and replace it with an 'error' token.
+ # If there are any synchronization rules, they may
+ # catch it.
+ #
+ # In addition to pushing the error token, we call call
+ # the user defined p_error() function if this is the
+ # first syntax error. This function is only called if
+ # errorcount == 0.
+ if errorcount == 0 or self.errorok:
+ errorcount = error_count
+ self.errorok = 0
+ errtoken = lookahead
+ if errtoken.type == '$end':
+ errtoken = None # End of file!
+ if self.errorfunc:
+ global errok,token,restart
+ errok = self.errok # Set some special functions available in error recovery
+ token = get_token
+ restart = self.restart
+ if errtoken and not hasattr(errtoken,'lexer'):
+ errtoken.lexer = lexer
+ tok = self.errorfunc(errtoken)
+ del errok, token, restart # Delete special functions
+
+ if self.errorok:
+ # User must have done some kind of panic
+ # mode recovery on their own. The
+ # returned token is the next lookahead
+ lookahead = tok
+ errtoken = None
+ continue
+ else:
+ if errtoken:
+ if hasattr(errtoken,"lineno"): lineno = lookahead.lineno
+ else: lineno = 0
+ if lineno:
+ sys.stderr.write("yacc: Syntax error at line %d, token=%s\n" % (lineno, errtoken.type))
+ else:
+ sys.stderr.write("yacc: Syntax error, token=%s" % errtoken.type)
+ else:
+ sys.stderr.write("yacc: Parse error in input. EOF\n")
+ return
+
+ else:
+ errorcount = error_count
+
+ # case 1: the statestack only has 1 entry on it. If we're in this state, the
+ # entire parse has been rolled back and we're completely hosed. The token is
+ # discarded and we just keep going.
+
+ if len(statestack) <= 1 and lookahead.type != '$end':
+ lookahead = None
+ errtoken = None
+ state = 0
+ # Nuke the pushback stack
+ del lookaheadstack[:]
+ continue
+
+ # case 2: the statestack has a couple of entries on it, but we're
+ # at the end of the file. nuke the top entry and generate an error token
+
+ # Start nuking entries on the stack
+ if lookahead.type == '$end':
+ # Whoa. We're really hosed here. Bail out
+ return
+
+ if lookahead.type != 'error':
+ sym = symstack[-1]
+ if sym.type == 'error':
+ # Hmmm. Error is on top of stack, we'll just nuke input
+ # symbol and continue
+ lookahead = None
+ continue
+ t = YaccSymbol()
+ t.type = 'error'
+ if hasattr(lookahead,"lineno"):
+ t.lineno = lookahead.lineno
+ t.value = lookahead
+ lookaheadstack.append(lookahead)
+ lookahead = t
+ else:
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1] # Potential bug fix
+
+ continue
+
+ # Call an error function here
+ raise RuntimeError("yacc: internal parser error!!!\n")
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # parseopt_notrack().
+ #
+ # Optimized version of parseopt() with line number tracking removed.
+ # DO NOT EDIT THIS CODE DIRECTLY. Copy the optimized version and remove
+ # code in the #--! TRACKING sections
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ def parseopt_notrack(self,input=None,lexer=None,debug=0,tracking=0,tokenfunc=None):
+ lookahead = None # Current lookahead symbol
+ lookaheadstack = [ ] # Stack of lookahead symbols
+ actions = self.action # Local reference to action table (to avoid lookup on self.)
+ goto = self.goto # Local reference to goto table (to avoid lookup on self.)
+ prod = self.productions # Local reference to production list (to avoid lookup on self.)
+ pslice = YaccProduction(None) # Production object passed to grammar rules
+ errorcount = 0 # Used during error recovery
+
+ # If no lexer was given, we will try to use the lex module
+ if not lexer:
+ lex = load_ply_lex()
+ lexer = lex.lexer
+
+ # Set up the lexer and parser objects on pslice
+ pslice.lexer = lexer
+ pslice.parser = self
+
+ # If input was supplied, pass to lexer
+ if input is not None:
+ lexer.input(input)
+
+ if tokenfunc is None:
+ # Tokenize function
+ get_token = lexer.token
+ else:
+ get_token = tokenfunc
+
+ # Set up the state and symbol stacks
+
+ statestack = [ ] # Stack of parsing states
+ self.statestack = statestack
+ symstack = [ ] # Stack of grammar symbols
+ self.symstack = symstack
+
+ pslice.stack = symstack # Put in the production
+ errtoken = None # Err token
+
+ # The start state is assumed to be (0,$end)
+
+ statestack.append(0)
+ sym = YaccSymbol()
+ sym.type = '$end'
+ symstack.append(sym)
+ state = 0
+ while 1:
+ # Get the next symbol on the input. If a lookahead symbol
+ # is already set, we just use that. Otherwise, we'll pull
+ # the next token off of the lookaheadstack or from the lexer
+
+ if not lookahead:
+ if not lookaheadstack:
+ lookahead = get_token() # Get the next token
+ else:
+ lookahead = lookaheadstack.pop()
+ if not lookahead:
+ lookahead = YaccSymbol()
+ lookahead.type = '$end'
+
+ # Check the action table
+ ltype = lookahead.type
+ t = actions[state].get(ltype)
+
+ if t is not None:
+ if t > 0:
+ # shift a symbol on the stack
+ statestack.append(t)
+ state = t
+
+ symstack.append(lookahead)
+ lookahead = None
+
+ # Decrease error count on successful shift
+ if errorcount: errorcount -=1
+ continue
+
+ if t < 0:
+ # reduce a symbol on the stack, emit a production
+ p = prod[-t]
+ pname = p.name
+ plen = p.len
+
+ # Get production function
+ sym = YaccSymbol()
+ sym.type = pname # Production name
+ sym.value = None
+
+ if plen:
+ targ = symstack[-plen-1:]
+ targ[0] = sym
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # below as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ del symstack[-plen:]
+ del statestack[-plen:]
+ p.callable(pslice)
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ else:
+
+ targ = [ sym ]
+
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ # The code enclosed in this section is duplicated
+ # above as a performance optimization. Make sure
+ # changes get made in both locations.
+
+ pslice.slice = targ
+
+ try:
+ # Call the grammar rule with our special slice object
+ p.callable(pslice)
+ symstack.append(sym)
+ state = goto[statestack[-1]][pname]
+ statestack.append(state)
+ except SyntaxError:
+ # If an error was set. Enter error recovery state
+ lookaheadstack.append(lookahead)
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1]
+ sym.type = 'error'
+ lookahead = sym
+ errorcount = error_count
+ self.errorok = 0
+ continue
+ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+ if t == 0:
+ n = symstack[-1]
+ return getattr(n,"value",None)
+
+ if t == None:
+
+ # We have some kind of parsing error here. To handle
+ # this, we are going to push the current token onto
+ # the tokenstack and replace it with an 'error' token.
+ # If there are any synchronization rules, they may
+ # catch it.
+ #
+ # In addition to pushing the error token, we call call
+ # the user defined p_error() function if this is the
+ # first syntax error. This function is only called if
+ # errorcount == 0.
+ if errorcount == 0 or self.errorok:
+ errorcount = error_count
+ self.errorok = 0
+ errtoken = lookahead
+ if errtoken.type == '$end':
+ errtoken = None # End of file!
+ if self.errorfunc:
+ global errok,token,restart
+ errok = self.errok # Set some special functions available in error recovery
+ token = get_token
+ restart = self.restart
+ if errtoken and not hasattr(errtoken,'lexer'):
+ errtoken.lexer = lexer
+ tok = self.errorfunc(errtoken)
+ del errok, token, restart # Delete special functions
+
+ if self.errorok:
+ # User must have done some kind of panic
+ # mode recovery on their own. The
+ # returned token is the next lookahead
+ lookahead = tok
+ errtoken = None
+ continue
+ else:
+ if errtoken:
+ if hasattr(errtoken,"lineno"): lineno = lookahead.lineno
+ else: lineno = 0
+ if lineno:
+ sys.stderr.write("yacc: Syntax error at line %d, token=%s\n" % (lineno, errtoken.type))
+ else:
+ sys.stderr.write("yacc: Syntax error, token=%s" % errtoken.type)
+ else:
+ sys.stderr.write("yacc: Parse error in input. EOF\n")
+ return
+
+ else:
+ errorcount = error_count
+
+ # case 1: the statestack only has 1 entry on it. If we're in this state, the
+ # entire parse has been rolled back and we're completely hosed. The token is
+ # discarded and we just keep going.
+
+ if len(statestack) <= 1 and lookahead.type != '$end':
+ lookahead = None
+ errtoken = None
+ state = 0
+ # Nuke the pushback stack
+ del lookaheadstack[:]
+ continue
+
+ # case 2: the statestack has a couple of entries on it, but we're
+ # at the end of the file. nuke the top entry and generate an error token
+
+ # Start nuking entries on the stack
+ if lookahead.type == '$end':
+ # Whoa. We're really hosed here. Bail out
+ return
+
+ if lookahead.type != 'error':
+ sym = symstack[-1]
+ if sym.type == 'error':
+ # Hmmm. Error is on top of stack, we'll just nuke input
+ # symbol and continue
+ lookahead = None
+ continue
+ t = YaccSymbol()
+ t.type = 'error'
+ if hasattr(lookahead,"lineno"):
+ t.lineno = lookahead.lineno
+ t.value = lookahead
+ lookaheadstack.append(lookahead)
+ lookahead = t
+ else:
+ symstack.pop()
+ statestack.pop()
+ state = statestack[-1] # Potential bug fix
+
+ continue
+
+ # Call an error function here
+ raise RuntimeError("yacc: internal parser error!!!\n")
+
+# -----------------------------------------------------------------------------
+# === Grammar Representation ===
+#
+# The following functions, classes, and variables are used to represent and
+# manipulate the rules that make up a grammar.
+# -----------------------------------------------------------------------------
+
+import re
+
+# regex matching identifiers
+_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$')
+
+# -----------------------------------------------------------------------------
+# class Production:
+#
+# This class stores the raw information about a single production or grammar rule.
+# A grammar rule refers to a specification such as this:
+#
+# expr : expr PLUS term
+#
+# Here are the basic attributes defined on all productions
+#
+# name - Name of the production. For example 'expr'
+# prod - A list of symbols on the right side ['expr','PLUS','term']
+# prec - Production precedence level
+# number - Production number.
+# func - Function that executes on reduce
+# file - File where production function is defined
+# lineno - Line number where production function is defined
+#
+# The following attributes are defined or optional.
+#
+# len - Length of the production (number of symbols on right hand side)
+# usyms - Set of unique symbols found in the production
+# -----------------------------------------------------------------------------
+
+class Production(object):
+ reduced = 0
+ def __init__(self,number,name,prod,precedence=('right',0),func=None,file='',line=0):
+ self.name = name
+ self.prod = tuple(prod)
+ self.number = number
+ self.func = func
+ self.callable = None
+ self.file = file
+ self.line = line
+ self.prec = precedence
+
+ # Internal settings used during table construction
+
+ self.len = len(self.prod) # Length of the production
+
+ # Create a list of unique production symbols used in the production
+ self.usyms = [ ]
+ for s in self.prod:
+ if s not in self.usyms:
+ self.usyms.append(s)
+
+ # List of all LR items for the production
+ self.lr_items = []
+ self.lr_next = None
+
+ # Create a string representation
+ if self.prod:
+ self.str = "%s -> %s" % (self.name," ".join(self.prod))
+ else:
+ self.str = "%s -> <empty>" % self.name
+
+ def __str__(self):
+ return self.str
+
+ def __repr__(self):
+ return "Production("+str(self)+")"
+
+ def __len__(self):
+ return len(self.prod)
+
+ def __nonzero__(self):
+ return 1
+
+ def __getitem__(self,index):
+ return self.prod[index]
+
+ # Return the nth lr_item from the production (or None if at the end)
+ def lr_item(self,n):
+ if n > len(self.prod): return None
+ p = LRItem(self,n)
+
+ # Precompute the list of productions immediately following. Hack. Remove later
+ try:
+ p.lr_after = Prodnames[p.prod[n+1]]
+ except (IndexError,KeyError):
+ p.lr_after = []
+ try:
+ p.lr_before = p.prod[n-1]
+ except IndexError:
+ p.lr_before = None
+
+ return p
+
+ # Bind the production function name to a callable
+ def bind(self,pdict):
+ if self.func:
+ self.callable = pdict[self.func]
+
+# This class serves as a minimal standin for Production objects when
+# reading table data from files. It only contains information
+# actually used by the LR parsing engine, plus some additional
+# debugging information.
+class MiniProduction(object):
+ def __init__(self,str,name,len,func,file,line):
+ self.name = name
+ self.len = len
+ self.func = func
+ self.callable = None
+ self.file = file
+ self.line = line
+ self.str = str
+ def __str__(self):
+ return self.str
+ def __repr__(self):
+ return "MiniProduction(%s)" % self.str
+
+ # Bind the production function name to a callable
+ def bind(self,pdict):
+ if self.func:
+ self.callable = pdict[self.func]
+
+
+# -----------------------------------------------------------------------------
+# class LRItem
+#
+# This class represents a specific stage of parsing a production rule. For
+# example:
+#
+# expr : expr . PLUS term
+#
+# In the above, the "." represents the current location of the parse. Here
+# basic attributes:
+#
+# name - Name of the production. For example 'expr'
+# prod - A list of symbols on the right side ['expr','.', 'PLUS','term']
+# number - Production number.
+#
+# lr_next Next LR item. Example, if we are ' expr -> expr . PLUS term'
+# then lr_next refers to 'expr -> expr PLUS . term'
+# lr_index - LR item index (location of the ".") in the prod list.
+# lookaheads - LALR lookahead symbols for this item
+# len - Length of the production (number of symbols on right hand side)
+# lr_after - List of all productions that immediately follow
+# lr_before - Grammar symbol immediately before
+# -----------------------------------------------------------------------------
+
+class LRItem(object):
+ def __init__(self,p,n):
+ self.name = p.name
+ self.prod = list(p.prod)
+ self.number = p.number
+ self.lr_index = n
+ self.lookaheads = { }
+ self.prod.insert(n,".")
+ self.prod = tuple(self.prod)
+ self.len = len(self.prod)
+ self.usyms = p.usyms
+
+ def __str__(self):
+ if self.prod:
+ s = "%s -> %s" % (self.name," ".join(self.prod))
+ else:
+ s = "%s -> <empty>" % self.name
+ return s
+
+ def __repr__(self):
+ return "LRItem("+str(self)+")"
+
+# -----------------------------------------------------------------------------
+# rightmost_terminal()
+#
+# Return the rightmost terminal from a list of symbols. Used in add_production()
+# -----------------------------------------------------------------------------
+def rightmost_terminal(symbols, terminals):
+ i = len(symbols) - 1
+ while i >= 0:
+ if symbols[i] in terminals:
+ return symbols[i]
+ i -= 1
+ return None
+
+# -----------------------------------------------------------------------------
+# === GRAMMAR CLASS ===
+#
+# The following class represents the contents of the specified grammar along
+# with various computed properties such as first sets, follow sets, LR items, etc.
+# This data is used for critical parts of the table generation process later.
+# -----------------------------------------------------------------------------
+
+class GrammarError(YaccError): pass
+
+class Grammar(object):
+ def __init__(self,terminals):
+ self.Productions = [None] # A list of all of the productions. The first
+ # entry is always reserved for the purpose of
+ # building an augmented grammar
+
+ self.Prodnames = { } # A dictionary mapping the names of nonterminals to a list of all
+ # productions of that nonterminal.
+
+ self.Prodmap = { } # A dictionary that is only used to detect duplicate
+ # productions.
+
+ self.Terminals = { } # A dictionary mapping the names of terminal symbols to a
+ # list of the rules where they are used.
+
+ for term in terminals:
+ self.Terminals[term] = []
+
+ self.Terminals['error'] = []
+
+ self.Nonterminals = { } # A dictionary mapping names of nonterminals to a list
+ # of rule numbers where they are used.
+
+ self.First = { } # A dictionary of precomputed FIRST(x) symbols
+
+ self.Follow = { } # A dictionary of precomputed FOLLOW(x) symbols
+
+ self.Precedence = { } # Precedence rules for each terminal. Contains tuples of the
+ # form ('right',level) or ('nonassoc', level) or ('left',level)
+
+ self.UsedPrecedence = { } # Precedence rules that were actually used by the grammer.
+ # This is only used to provide error checking and to generate
+ # a warning about unused precedence rules.
+
+ self.Start = None # Starting symbol for the grammar
+
+
+ def __len__(self):
+ return len(self.Productions)
+
+ def __getitem__(self,index):
+ return self.Productions[index]
+
+ # -----------------------------------------------------------------------------
+ # set_precedence()
+ #
+ # Sets the precedence for a given terminal. assoc is the associativity such as
+ # 'left','right', or 'nonassoc'. level is a numeric level.
+ #
+ # -----------------------------------------------------------------------------
+
+ def set_precedence(self,term,assoc,level):
+ assert self.Productions == [None],"Must call set_precedence() before add_production()"
+ if term in self.Precedence:
+ raise GrammarError("Precedence already specified for terminal '%s'" % term)
+ if assoc not in ['left','right','nonassoc']:
+ raise GrammarError("Associativity must be one of 'left','right', or 'nonassoc'")
+ self.Precedence[term] = (assoc,level)
+
+ # -----------------------------------------------------------------------------
+ # add_production()
+ #
+ # Given an action function, this function assembles a production rule and
+ # computes its precedence level.
+ #
+ # The production rule is supplied as a list of symbols. For example,
+ # a rule such as 'expr : expr PLUS term' has a production name of 'expr' and
+ # symbols ['expr','PLUS','term'].
+ #
+ # Precedence is determined by the precedence of the right-most non-terminal
+ # or the precedence of a terminal specified by %prec.
+ #
+ # A variety of error checks are performed to make sure production symbols
+ # are valid and that %prec is used correctly.
+ # -----------------------------------------------------------------------------
+
+ def add_production(self,prodname,syms,func=None,file='',line=0):
+
+ if prodname in self.Terminals:
+ raise GrammarError("%s:%d: Illegal rule name '%s'. Already defined as a token" % (file,line,prodname))
+ if prodname == 'error':
+ raise GrammarError("%s:%d: Illegal rule name '%s'. error is a reserved word" % (file,line,prodname))
+ if not _is_identifier.match(prodname):
+ raise GrammarError("%s:%d: Illegal rule name '%s'" % (file,line,prodname))
+
+ # Look for literal tokens
+ for n,s in enumerate(syms):
+ if s[0] in "'\"":
+ try:
+ c = eval(s)
+ if (len(c) > 1):
+ raise GrammarError("%s:%d: Literal token %s in rule '%s' may only be a single character" % (file,line,s, prodname))
+ if not c in self.Terminals:
+ self.Terminals[c] = []
+ syms[n] = c
+ continue
+ except SyntaxError:
+ pass
+ if not _is_identifier.match(s) and s != '%prec':
+ raise GrammarError("%s:%d: Illegal name '%s' in rule '%s'" % (file,line,s, prodname))
+
+ # Determine the precedence level
+ if '%prec' in syms:
+ if syms[-1] == '%prec':
+ raise GrammarError("%s:%d: Syntax error. Nothing follows %%prec" % (file,line))
+ if syms[-2] != '%prec':
+ raise GrammarError("%s:%d: Syntax error. %%prec can only appear at the end of a grammar rule" % (file,line))
+ precname = syms[-1]
+ prodprec = self.Precedence.get(precname,None)
+ if not prodprec:
+ raise GrammarError("%s:%d: Nothing known about the precedence of '%s'" % (file,line,precname))
+ else:
+ self.UsedPrecedence[precname] = 1
+ del syms[-2:] # Drop %prec from the rule
+ else:
+ # If no %prec, precedence is determined by the rightmost terminal symbol
+ precname = rightmost_terminal(syms,self.Terminals)
+ prodprec = self.Precedence.get(precname,('right',0))
+
+ # See if the rule is already in the rulemap
+ map = "%s -> %s" % (prodname,syms)
+ if map in self.Prodmap:
+ m = self.Prodmap[map]
+ raise GrammarError("%s:%d: Duplicate rule %s. " % (file,line, m) +
+ "Previous definition at %s:%d" % (m.file, m.line))
+
+ # From this point on, everything is valid. Create a new Production instance
+ pnumber = len(self.Productions)
+ if not prodname in self.Nonterminals:
+ self.Nonterminals[prodname] = [ ]
+
+ # Add the production number to Terminals and Nonterminals
+ for t in syms:
+ if t in self.Terminals:
+ self.Terminals[t].append(pnumber)
+ else:
+ if not t in self.Nonterminals:
+ self.Nonterminals[t] = [ ]
+ self.Nonterminals[t].append(pnumber)
+
+ # Create a production and add it to the list of productions
+ p = Production(pnumber,prodname,syms,prodprec,func,file,line)
+ self.Productions.append(p)
+ self.Prodmap[map] = p
+
+ # Add to the global productions list
+ try:
+ self.Prodnames[prodname].append(p)
+ except KeyError:
+ self.Prodnames[prodname] = [ p ]
+ return 0
+
+ # -----------------------------------------------------------------------------
+ # set_start()
+ #
+ # Sets the starting symbol and creates the augmented grammar. Production
+ # rule 0 is S' -> start where start is the start symbol.
+ # -----------------------------------------------------------------------------
+
+ def set_start(self,start=None):
+ if not start:
+ start = self.Productions[1].name
+ if start not in self.Nonterminals:
+ raise GrammarError("start symbol %s undefined" % start)
+ self.Productions[0] = Production(0,"S'",[start])
+ self.Nonterminals[start].append(0)
+ self.Start = start
+
+ # -----------------------------------------------------------------------------
+ # find_unreachable()
+ #
+ # Find all of the nonterminal symbols that can't be reached from the starting
+ # symbol. Returns a list of nonterminals that can't be reached.
+ # -----------------------------------------------------------------------------
+
+ def find_unreachable(self):
+
+ # Mark all symbols that are reachable from a symbol s
+ def mark_reachable_from(s):
+ if reachable[s]:
+ # We've already reached symbol s.
+ return
+ reachable[s] = 1
+ for p in self.Prodnames.get(s,[]):
+ for r in p.prod:
+ mark_reachable_from(r)
+
+ reachable = { }
+ for s in list(self.Terminals) + list(self.Nonterminals):
+ reachable[s] = 0
+
+ mark_reachable_from( self.Productions[0].prod[0] )
+
+ return [s for s in list(self.Nonterminals)
+ if not reachable[s]]
+
+ # -----------------------------------------------------------------------------
+ # infinite_cycles()
+ #
+ # This function looks at the various parsing rules and tries to detect
+ # infinite recursion cycles (grammar rules where there is no possible way
+ # to derive a string of only terminals).
+ # -----------------------------------------------------------------------------
+
+ def infinite_cycles(self):
+ terminates = {}
+
+ # Terminals:
+ for t in self.Terminals:
+ terminates[t] = 1
+
+ terminates['$end'] = 1
+
+ # Nonterminals:
+
+ # Initialize to false:
+ for n in self.Nonterminals:
+ terminates[n] = 0
+
+ # Then propagate termination until no change:
+ while 1:
+ some_change = 0
+ for (n,pl) in self.Prodnames.items():
+ # Nonterminal n terminates iff any of its productions terminates.
+ for p in pl:
+ # Production p terminates iff all of its rhs symbols terminate.
+ for s in p.prod:
+ if not terminates[s]:
+ # The symbol s does not terminate,
+ # so production p does not terminate.
+ p_terminates = 0
+ break
+ else:
+ # didn't break from the loop,
+ # so every symbol s terminates
+ # so production p terminates.
+ p_terminates = 1
+
+ if p_terminates:
+ # symbol n terminates!
+ if not terminates[n]:
+ terminates[n] = 1
+ some_change = 1
+ # Don't need to consider any more productions for this n.
+ break
+
+ if not some_change:
+ break
+
+ infinite = []
+ for (s,term) in terminates.items():
+ if not term:
+ if not s in self.Prodnames and not s in self.Terminals and s != 'error':
+ # s is used-but-not-defined, and we've already warned of that,
+ # so it would be overkill to say that it's also non-terminating.
+ pass
+ else:
+ infinite.append(s)
+
+ return infinite
+
+
+ # -----------------------------------------------------------------------------
+ # undefined_symbols()
+ #
+ # Find all symbols that were used the grammar, but not defined as tokens or
+ # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol
+ # and prod is the production where the symbol was used.
+ # -----------------------------------------------------------------------------
+ def undefined_symbols(self):
+ result = []
+ for p in self.Productions:
+ if not p: continue
+
+ for s in p.prod:
+ if not s in self.Prodnames and not s in self.Terminals and s != 'error':
+ result.append((s,p))
+ return result
+
+ # -----------------------------------------------------------------------------
+ # unused_terminals()
+ #
+ # Find all terminals that were defined, but not used by the grammar. Returns
+ # a list of all symbols.
+ # -----------------------------------------------------------------------------
+ def unused_terminals(self):
+ unused_tok = []
+ for s,v in self.Terminals.items():
+ if s != 'error' and not v:
+ unused_tok.append(s)
+
+ return unused_tok
+
+ # ------------------------------------------------------------------------------
+ # unused_rules()
+ #
+ # Find all grammar rules that were defined, but not used (maybe not reachable)
+ # Returns a list of productions.
+ # ------------------------------------------------------------------------------
+
+ def unused_rules(self):
+ unused_prod = []
+ for s,v in self.Nonterminals.items():
+ if not v:
+ p = self.Prodnames[s][0]
+ unused_prod.append(p)
+ return unused_prod
+
+ # -----------------------------------------------------------------------------
+ # unused_precedence()
+ #
+ # Returns a list of tuples (term,precedence) corresponding to precedence
+ # rules that were never used by the grammar. term is the name of the terminal
+ # on which precedence was applied and precedence is a string such as 'left' or
+ # 'right' corresponding to the type of precedence.
+ # -----------------------------------------------------------------------------
+
+ def unused_precedence(self):
+ unused = []
+ for termname in self.Precedence:
+ if not (termname in self.Terminals or termname in self.UsedPrecedence):
+ unused.append((termname,self.Precedence[termname][0]))
+
+ return unused
+
+ # -------------------------------------------------------------------------
+ # _first()
+ #
+ # Compute the value of FIRST1(beta) where beta is a tuple of symbols.
+ #
+ # During execution of compute_first1, the result may be incomplete.
+ # Afterward (e.g., when called from compute_follow()), it will be complete.
+ # -------------------------------------------------------------------------
+ def _first(self,beta):
+
+ # We are computing First(x1,x2,x3,...,xn)
+ result = [ ]
+ for x in beta:
+ x_produces_empty = 0
+
+ # Add all the non-<empty> symbols of First[x] to the result.
+ for f in self.First[x]:
+ if f == '<empty>':
+ x_produces_empty = 1
+ else:
+ if f not in result: result.append(f)
+
+ if x_produces_empty:
+ # We have to consider the next x in beta,
+ # i.e. stay in the loop.
+ pass
+ else:
+ # We don't have to consider any further symbols in beta.
+ break
+ else:
+ # There was no 'break' from the loop,
+ # so x_produces_empty was true for all x in beta,
+ # so beta produces empty as well.
+ result.append('<empty>')
+
+ return result
+
+ # -------------------------------------------------------------------------
+ # compute_first()
+ #
+ # Compute the value of FIRST1(X) for all symbols
+ # -------------------------------------------------------------------------
+ def compute_first(self):
+ if self.First:
+ return self.First
+
+ # Terminals:
+ for t in self.Terminals:
+ self.First[t] = [t]
+
+ self.First['$end'] = ['$end']
+
+ # Nonterminals:
+
+ # Initialize to the empty set:
+ for n in self.Nonterminals:
+ self.First[n] = []
+
+ # Then propagate symbols until no change:
+ while 1:
+ some_change = 0
+ for n in self.Nonterminals:
+ for p in self.Prodnames[n]:
+ for f in self._first(p.prod):
+ if f not in self.First[n]:
+ self.First[n].append( f )
+ some_change = 1
+ if not some_change:
+ break
+
+ return self.First
+
+ # ---------------------------------------------------------------------
+ # compute_follow()
+ #
+ # Computes all of the follow sets for every non-terminal symbol. The
+ # follow set is the set of all symbols that might follow a given
+ # non-terminal. See the Dragon book, 2nd Ed. p. 189.
+ # ---------------------------------------------------------------------
+ def compute_follow(self,start=None):
+ # If already computed, return the result
+ if self.Follow:
+ return self.Follow
+
+ # If first sets not computed yet, do that first.
+ if not self.First:
+ self.compute_first()
+
+ # Add '$end' to the follow list of the start symbol
+ for k in self.Nonterminals:
+ self.Follow[k] = [ ]
+
+ if not start:
+ start = self.Productions[1].name
+
+ self.Follow[start] = [ '$end' ]
+
+ while 1:
+ didadd = 0
+ for p in self.Productions[1:]:
+ # Here is the production set
+ for i in range(len(p.prod)):
+ B = p.prod[i]
+ if B in self.Nonterminals:
+ # Okay. We got a non-terminal in a production
+ fst = self._first(p.prod[i+1:])
+ hasempty = 0
+ for f in fst:
+ if f != '<empty>' and f not in self.Follow[B]:
+ self.Follow[B].append(f)
+ didadd = 1
+ if f == '<empty>':
+ hasempty = 1
+ if hasempty or i == (len(p.prod)-1):
+ # Add elements of follow(a) to follow(b)
+ for f in self.Follow[p.name]:
+ if f not in self.Follow[B]:
+ self.Follow[B].append(f)
+ didadd = 1
+ if not didadd: break
+ return self.Follow
+
+
+ # -----------------------------------------------------------------------------
+ # build_lritems()
+ #
+ # This function walks the list of productions and builds a complete set of the
+ # LR items. The LR items are stored in two ways: First, they are uniquely
+ # numbered and placed in the list _lritems. Second, a linked list of LR items
+ # is built for each production. For example:
+ #
+ # E -> E PLUS E
+ #
+ # Creates the list
+ #
+ # [E -> . E PLUS E, E -> E . PLUS E, E -> E PLUS . E, E -> E PLUS E . ]
+ # -----------------------------------------------------------------------------
+
+ def build_lritems(self):
+ for p in self.Productions:
+ lastlri = p
+ i = 0
+ lr_items = []
+ while 1:
+ if i > len(p):
+ lri = None
+ else:
+ lri = LRItem(p,i)
+ # Precompute the list of productions immediately following
+ try:
+ lri.lr_after = self.Prodnames[lri.prod[i+1]]
+ except (IndexError,KeyError):
+ lri.lr_after = []
+ try:
+ lri.lr_before = lri.prod[i-1]
+ except IndexError:
+ lri.lr_before = None
+
+ lastlri.lr_next = lri
+ if not lri: break
+ lr_items.append(lri)
+ lastlri = lri
+ i += 1
+ p.lr_items = lr_items
+
+# -----------------------------------------------------------------------------
+# == Class LRTable ==
+#
+# This basic class represents a basic table of LR parsing information.
+# Methods for generating the tables are not defined here. They are defined
+# in the derived class LRGeneratedTable.
+# -----------------------------------------------------------------------------
+
+class VersionError(YaccError): pass
+
+class LRTable(object):
+ def __init__(self):
+ self.lr_action = None
+ self.lr_goto = None
+ self.lr_productions = None
+ self.lr_method = None
+
+ def read_table(self,module):
+ if isinstance(module,types.ModuleType):
+ parsetab = module
+ else:
+ if sys.version_info[0] < 3:
+ exec("import %s as parsetab" % module)
+ else:
+ env = { }
+ exec("import %s as parsetab" % module, env, env)
+ parsetab = env['parsetab']
+
+ if parsetab._tabversion != __tabversion__:
+ raise VersionError("yacc table file version is out of date")
+
+ self.lr_action = parsetab._lr_action
+ self.lr_goto = parsetab._lr_goto
+
+ self.lr_productions = []
+ for p in parsetab._lr_productions:
+ self.lr_productions.append(MiniProduction(*p))
+
+ self.lr_method = parsetab._lr_method
+ return parsetab._lr_signature
+
+ def read_pickle(self,filename):
+ try:
+ import cPickle as pickle
+ except ImportError:
+ import pickle
+
+ in_f = open(filename,"rb")
+
+ tabversion = pickle.load(in_f)
+ if tabversion != __tabversion__:
+ raise VersionError("yacc table file version is out of date")
+ self.lr_method = pickle.load(in_f)
+ signature = pickle.load(in_f)
+ self.lr_action = pickle.load(in_f)
+ self.lr_goto = pickle.load(in_f)
+ productions = pickle.load(in_f)
+
+ self.lr_productions = []
+ for p in productions:
+ self.lr_productions.append(MiniProduction(*p))
+
+ in_f.close()
+ return signature
+
+ # Bind all production function names to callable objects in pdict
+ def bind_callables(self,pdict):
+ for p in self.lr_productions:
+ p.bind(pdict)
+
+# -----------------------------------------------------------------------------
+# === LR Generator ===
+#
+# The following classes and functions are used to generate LR parsing tables on
+# a grammar.
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# digraph()
+# traverse()
+#
+# The following two functions are used to compute set valued functions
+# of the form:
+#
+# F(x) = F'(x) U U{F(y) | x R y}
+#
+# This is used to compute the values of Read() sets as well as FOLLOW sets
+# in LALR(1) generation.
+#
+# Inputs: X - An input set
+# R - A relation
+# FP - Set-valued function
+# ------------------------------------------------------------------------------
+
+def digraph(X,R,FP):
+ N = { }
+ for x in X:
+ N[x] = 0
+ stack = []
+ F = { }
+ for x in X:
+ if N[x] == 0: traverse(x,N,stack,F,X,R,FP)
+ return F
+
+def traverse(x,N,stack,F,X,R,FP):
+ stack.append(x)
+ d = len(stack)
+ N[x] = d
+ F[x] = FP(x) # F(X) <- F'(x)
+
+ rel = R(x) # Get y's related to x
+ for y in rel:
+ if N[y] == 0:
+ traverse(y,N,stack,F,X,R,FP)
+ N[x] = min(N[x],N[y])
+ for a in F.get(y,[]):
+ if a not in F[x]: F[x].append(a)
+ if N[x] == d:
+ N[stack[-1]] = MAXINT
+ F[stack[-1]] = F[x]
+ element = stack.pop()
+ while element != x:
+ N[stack[-1]] = MAXINT
+ F[stack[-1]] = F[x]
+ element = stack.pop()
+
+class LALRError(YaccError): pass
+
+# -----------------------------------------------------------------------------
+# == LRGeneratedTable ==
+#
+# This class implements the LR table generation algorithm. There are no
+# public methods except for write()
+# -----------------------------------------------------------------------------
+
+class LRGeneratedTable(LRTable):
+ def __init__(self,grammar,method='LALR',log=None):
+ if method not in ['SLR','LALR']:
+ raise LALRError("Unsupported method %s" % method)
+
+ self.grammar = grammar
+ self.lr_method = method
+
+ # Set up the logger
+ if not log:
+ log = NullLogger()
+ self.log = log
+
+ # Internal attributes
+ self.lr_action = {} # Action table
+ self.lr_goto = {} # Goto table
+ self.lr_productions = grammar.Productions # Copy of grammar Production array
+ self.lr_goto_cache = {} # Cache of computed gotos
+ self.lr0_cidhash = {} # Cache of closures
+
+ self._add_count = 0 # Internal counter used to detect cycles
+
+ # Diagonistic information filled in by the table generator
+ self.sr_conflict = 0
+ self.rr_conflict = 0
+ self.conflicts = [] # List of conflicts
+
+ self.sr_conflicts = []
+ self.rr_conflicts = []
+
+ # Build the tables
+ self.grammar.build_lritems()
+ self.grammar.compute_first()
+ self.grammar.compute_follow()
+ self.lr_parse_table()
+
+ # Compute the LR(0) closure operation on I, where I is a set of LR(0) items.
+
+ def lr0_closure(self,I):
+ self._add_count += 1
+
+ # Add everything in I to J
+ J = I[:]
+ didadd = 1
+ while didadd:
+ didadd = 0
+ for j in J:
+ for x in j.lr_after:
+ if getattr(x,"lr0_added",0) == self._add_count: continue
+ # Add B --> .G to J
+ J.append(x.lr_next)
+ x.lr0_added = self._add_count
+ didadd = 1
+
+ return J
+
+ # Compute the LR(0) goto function goto(I,X) where I is a set
+ # of LR(0) items and X is a grammar symbol. This function is written
+ # in a way that guarantees uniqueness of the generated goto sets
+ # (i.e. the same goto set will never be returned as two different Python
+ # objects). With uniqueness, we can later do fast set comparisons using
+ # id(obj) instead of element-wise comparison.
+
+ def lr0_goto(self,I,x):
+ # First we look for a previously cached entry
+ g = self.lr_goto_cache.get((id(I),x),None)
+ if g: return g
+
+ # Now we generate the goto set in a way that guarantees uniqueness
+ # of the result
+
+ s = self.lr_goto_cache.get(x,None)
+ if not s:
+ s = { }
+ self.lr_goto_cache[x] = s
+
+ gs = [ ]
+ for p in I:
+ n = p.lr_next
+ if n and n.lr_before == x:
+ s1 = s.get(id(n),None)
+ if not s1:
+ s1 = { }
+ s[id(n)] = s1
+ gs.append(n)
+ s = s1
+ g = s.get('$end',None)
+ if not g:
+ if gs:
+ g = self.lr0_closure(gs)
+ s['$end'] = g
+ else:
+ s['$end'] = gs
+ self.lr_goto_cache[(id(I),x)] = g
+ return g
+
+ # Compute the LR(0) sets of item function
+ def lr0_items(self):
+
+ C = [ self.lr0_closure([self.grammar.Productions[0].lr_next]) ]
+ i = 0
+ for I in C:
+ self.lr0_cidhash[id(I)] = i
+ i += 1
+
+ # Loop over the items in C and each grammar symbols
+ i = 0
+ while i < len(C):
+ I = C[i]
+ i += 1
+
+ # Collect all of the symbols that could possibly be in the goto(I,X) sets
+ asyms = { }
+ for ii in I:
+ for s in ii.usyms:
+ asyms[s] = None
+
+ for x in asyms:
+ g = self.lr0_goto(I,x)
+ if not g: continue
+ if id(g) in self.lr0_cidhash: continue
+ self.lr0_cidhash[id(g)] = len(C)
+ C.append(g)
+
+ return C
+
+ # -----------------------------------------------------------------------------
+ # ==== LALR(1) Parsing ====
+ #
+ # LALR(1) parsing is almost exactly the same as SLR except that instead of
+ # relying upon Follow() sets when performing reductions, a more selective
+ # lookahead set that incorporates the state of the LR(0) machine is utilized.
+ # Thus, we mainly just have to focus on calculating the lookahead sets.
+ #
+ # The method used here is due to DeRemer and Pennelo (1982).
+ #
+ # DeRemer, F. L., and T. J. Pennelo: "Efficient Computation of LALR(1)
+ # Lookahead Sets", ACM Transactions on Programming Languages and Systems,
+ # Vol. 4, No. 4, Oct. 1982, pp. 615-649
+ #
+ # Further details can also be found in:
+ #
+ # J. Tremblay and P. Sorenson, "The Theory and Practice of Compiler Writing",
+ # McGraw-Hill Book Company, (1985).
+ #
+ # -----------------------------------------------------------------------------
+
+ # -----------------------------------------------------------------------------
+ # compute_nullable_nonterminals()
+ #
+ # Creates a dictionary containing all of the non-terminals that might produce
+ # an empty production.
+ # -----------------------------------------------------------------------------
+
+ def compute_nullable_nonterminals(self):
+ nullable = {}
+ num_nullable = 0
+ while 1:
+ for p in self.grammar.Productions[1:]:
+ if p.len == 0:
+ nullable[p.name] = 1
+ continue
+ for t in p.prod:
+ if not t in nullable: break
+ else:
+ nullable[p.name] = 1
+ if len(nullable) == num_nullable: break
+ num_nullable = len(nullable)
+ return nullable
+
+ # -----------------------------------------------------------------------------
+ # find_nonterminal_trans(C)
+ #
+ # Given a set of LR(0) items, this functions finds all of the non-terminal
+ # transitions. These are transitions in which a dot appears immediately before
+ # a non-terminal. Returns a list of tuples of the form (state,N) where state
+ # is the state number and N is the nonterminal symbol.
+ #
+ # The input C is the set of LR(0) items.
+ # -----------------------------------------------------------------------------
+
+ def find_nonterminal_transitions(self,C):
+ trans = []
+ for state in range(len(C)):
+ for p in C[state]:
+ if p.lr_index < p.len - 1:
+ t = (state,p.prod[p.lr_index+1])
+ if t[1] in self.grammar.Nonterminals:
+ if t not in trans: trans.append(t)
+ state = state + 1
+ return trans
+
+ # -----------------------------------------------------------------------------
+ # dr_relation()
+ #
+ # Computes the DR(p,A) relationships for non-terminal transitions. The input
+ # is a tuple (state,N) where state is a number and N is a nonterminal symbol.
+ #
+ # Returns a list of terminals.
+ # -----------------------------------------------------------------------------
+
+ def dr_relation(self,C,trans,nullable):
+ dr_set = { }
+ state,N = trans
+ terms = []
+
+ g = self.lr0_goto(C[state],N)
+ for p in g:
+ if p.lr_index < p.len - 1:
+ a = p.prod[p.lr_index+1]
+ if a in self.grammar.Terminals:
+ if a not in terms: terms.append(a)
+
+ # This extra bit is to handle the start state
+ if state == 0 and N == self.grammar.Productions[0].prod[0]:
+ terms.append('$end')
+
+ return terms
+
+ # -----------------------------------------------------------------------------
+ # reads_relation()
+ #
+ # Computes the READS() relation (p,A) READS (t,C).
+ # -----------------------------------------------------------------------------
+
+ def reads_relation(self,C, trans, empty):
+ # Look for empty transitions
+ rel = []
+ state, N = trans
+
+ g = self.lr0_goto(C[state],N)
+ j = self.lr0_cidhash.get(id(g),-1)
+ for p in g:
+ if p.lr_index < p.len - 1:
+ a = p.prod[p.lr_index + 1]
+ if a in empty:
+ rel.append((j,a))
+
+ return rel
+
+ # -----------------------------------------------------------------------------
+ # compute_lookback_includes()
+ #
+ # Determines the lookback and includes relations
+ #
+ # LOOKBACK:
+ #
+ # This relation is determined by running the LR(0) state machine forward.
+ # For example, starting with a production "N : . A B C", we run it forward
+ # to obtain "N : A B C ." We then build a relationship between this final
+ # state and the starting state. These relationships are stored in a dictionary
+ # lookdict.
+ #
+ # INCLUDES:
+ #
+ # Computes the INCLUDE() relation (p,A) INCLUDES (p',B).
+ #
+ # This relation is used to determine non-terminal transitions that occur
+ # inside of other non-terminal transition states. (p,A) INCLUDES (p', B)
+ # if the following holds:
+ #
+ # B -> LAT, where T -> epsilon and p' -L-> p
+ #
+ # L is essentially a prefix (which may be empty), T is a suffix that must be
+ # able to derive an empty string. State p' must lead to state p with the string L.
+ #
+ # -----------------------------------------------------------------------------
+
+ def compute_lookback_includes(self,C,trans,nullable):
+
+ lookdict = {} # Dictionary of lookback relations
+ includedict = {} # Dictionary of include relations
+
+ # Make a dictionary of non-terminal transitions
+ dtrans = {}
+ for t in trans:
+ dtrans[t] = 1
+
+ # Loop over all transitions and compute lookbacks and includes
+ for state,N in trans:
+ lookb = []
+ includes = []
+ for p in C[state]:
+ if p.name != N: continue
+
+ # Okay, we have a name match. We now follow the production all the way
+ # through the state machine until we get the . on the right hand side
+
+ lr_index = p.lr_index
+ j = state
+ while lr_index < p.len - 1:
+ lr_index = lr_index + 1
+ t = p.prod[lr_index]
+
+ # Check to see if this symbol and state are a non-terminal transition
+ if (j,t) in dtrans:
+ # Yes. Okay, there is some chance that this is an includes relation
+ # the only way to know for certain is whether the rest of the
+ # production derives empty
+
+ li = lr_index + 1
+ while li < p.len:
+ if p.prod[li] in self.grammar.Terminals: break # No forget it
+ if not p.prod[li] in nullable: break
+ li = li + 1
+ else:
+ # Appears to be a relation between (j,t) and (state,N)
+ includes.append((j,t))
+
+ g = self.lr0_goto(C[j],t) # Go to next set
+ j = self.lr0_cidhash.get(id(g),-1) # Go to next state
+
+ # When we get here, j is the final state, now we have to locate the production
+ for r in C[j]:
+ if r.name != p.name: continue
+ if r.len != p.len: continue
+ i = 0
+ # This look is comparing a production ". A B C" with "A B C ."
+ while i < r.lr_index:
+ if r.prod[i] != p.prod[i+1]: break
+ i = i + 1
+ else:
+ lookb.append((j,r))
+ for i in includes:
+ if not i in includedict: includedict[i] = []
+ includedict[i].append((state,N))
+ lookdict[(state,N)] = lookb
+
+ return lookdict,includedict
+
+ # -----------------------------------------------------------------------------
+ # compute_read_sets()
+ #
+ # Given a set of LR(0) items, this function computes the read sets.
+ #
+ # Inputs: C = Set of LR(0) items
+ # ntrans = Set of nonterminal transitions
+ # nullable = Set of empty transitions
+ #
+ # Returns a set containing the read sets
+ # -----------------------------------------------------------------------------
+
+ def compute_read_sets(self,C, ntrans, nullable):
+ FP = lambda x: self.dr_relation(C,x,nullable)
+ R = lambda x: self.reads_relation(C,x,nullable)
+ F = digraph(ntrans,R,FP)
+ return F
+
+ # -----------------------------------------------------------------------------
+ # compute_follow_sets()
+ #
+ # Given a set of LR(0) items, a set of non-terminal transitions, a readset,
+ # and an include set, this function computes the follow sets
+ #
+ # Follow(p,A) = Read(p,A) U U {Follow(p',B) | (p,A) INCLUDES (p',B)}
+ #
+ # Inputs:
+ # ntrans = Set of nonterminal transitions
+ # readsets = Readset (previously computed)
+ # inclsets = Include sets (previously computed)
+ #
+ # Returns a set containing the follow sets
+ # -----------------------------------------------------------------------------
+
+ def compute_follow_sets(self,ntrans,readsets,inclsets):
+ FP = lambda x: readsets[x]
+ R = lambda x: inclsets.get(x,[])
+ F = digraph(ntrans,R,FP)
+ return F
+
+ # -----------------------------------------------------------------------------
+ # add_lookaheads()
+ #
+ # Attaches the lookahead symbols to grammar rules.
+ #
+ # Inputs: lookbacks - Set of lookback relations
+ # followset - Computed follow set
+ #
+ # This function directly attaches the lookaheads to productions contained
+ # in the lookbacks set
+ # -----------------------------------------------------------------------------
+
+ def add_lookaheads(self,lookbacks,followset):
+ for trans,lb in lookbacks.items():
+ # Loop over productions in lookback
+ for state,p in lb:
+ if not state in p.lookaheads:
+ p.lookaheads[state] = []
+ f = followset.get(trans,[])
+ for a in f:
+ if a not in p.lookaheads[state]: p.lookaheads[state].append(a)
+
+ # -----------------------------------------------------------------------------
+ # add_lalr_lookaheads()
+ #
+ # This function does all of the work of adding lookahead information for use
+ # with LALR parsing
+ # -----------------------------------------------------------------------------
+
+ def add_lalr_lookaheads(self,C):
+ # Determine all of the nullable nonterminals
+ nullable = self.compute_nullable_nonterminals()
+
+ # Find all non-terminal transitions
+ trans = self.find_nonterminal_transitions(C)
+
+ # Compute read sets
+ readsets = self.compute_read_sets(C,trans,nullable)
+
+ # Compute lookback/includes relations
+ lookd, included = self.compute_lookback_includes(C,trans,nullable)
+
+ # Compute LALR FOLLOW sets
+ followsets = self.compute_follow_sets(trans,readsets,included)
+
+ # Add all of the lookaheads
+ self.add_lookaheads(lookd,followsets)
+
+ # -----------------------------------------------------------------------------
+ # lr_parse_table()
+ #
+ # This function constructs the parse tables for SLR or LALR
+ # -----------------------------------------------------------------------------
+ def lr_parse_table(self):
+ Productions = self.grammar.Productions
+ Precedence = self.grammar.Precedence
+ goto = self.lr_goto # Goto array
+ action = self.lr_action # Action array
+ log = self.log # Logger for output
+
+ actionp = { } # Action production array (temporary)
+
+ log.info("Parsing method: %s", self.lr_method)
+
+ # Step 1: Construct C = { I0, I1, ... IN}, collection of LR(0) items
+ # This determines the number of states
+
+ C = self.lr0_items()
+
+ if self.lr_method == 'LALR':
+ self.add_lalr_lookaheads(C)
+
+ # Build the parser table, state by state
+ st = 0
+ for I in C:
+ # Loop over each production in I
+ actlist = [ ] # List of actions
+ st_action = { }
+ st_actionp = { }
+ st_goto = { }
+ log.info("")
+ log.info("state %d", st)
+ log.info("")
+ for p in I:
+ log.info(" (%d) %s", p.number, str(p))
+ log.info("")
+
+ for p in I:
+ if p.len == p.lr_index + 1:
+ if p.name == "S'":
+ # Start symbol. Accept!
+ st_action["$end"] = 0
+ st_actionp["$end"] = p
+ else:
+ # We are at the end of a production. Reduce!
+ if self.lr_method == 'LALR':
+ laheads = p.lookaheads[st]
+ else:
+ laheads = self.grammar.Follow[p.name]
+ for a in laheads:
+ actlist.append((a,p,"reduce using rule %d (%s)" % (p.number,p)))
+ r = st_action.get(a,None)
+ if r is not None:
+ # Whoa. Have a shift/reduce or reduce/reduce conflict
+ if r > 0:
+ # Need to decide on shift or reduce here
+ # By default we favor shifting. Need to add
+ # some precedence rules here.
+ sprec,slevel = Productions[st_actionp[a].number].prec
+ rprec,rlevel = Precedence.get(a,('right',0))
+ if (slevel < rlevel) or ((slevel == rlevel) and (rprec == 'left')):
+ # We really need to reduce here.
+ st_action[a] = -p.number
+ st_actionp[a] = p
+ if not slevel and not rlevel:
+ log.info(" ! shift/reduce conflict for %s resolved as reduce",a)
+ self.sr_conflicts.append((st,a,'reduce'))
+ Productions[p.number].reduced += 1
+ elif (slevel == rlevel) and (rprec == 'nonassoc'):
+ st_action[a] = None
+ else:
+ # Hmmm. Guess we'll keep the shift
+ if not rlevel:
+ log.info(" ! shift/reduce conflict for %s resolved as shift",a)
+ self.sr_conflicts.append((st,a,'shift'))
+ elif r < 0:
+ # Reduce/reduce conflict. In this case, we favor the rule
+ # that was defined first in the grammar file
+ oldp = Productions[-r]
+ pp = Productions[p.number]
+ if oldp.line > pp.line:
+ st_action[a] = -p.number
+ st_actionp[a] = p
+ chosenp,rejectp = pp,oldp
+ Productions[p.number].reduced += 1
+ Productions[oldp.number].reduced -= 1
+ else:
+ chosenp,rejectp = oldp,pp
+ self.rr_conflicts.append((st,chosenp,rejectp))
+ log.info(" ! reduce/reduce conflict for %s resolved using rule %d (%s)", a,st_actionp[a].number, st_actionp[a])
+ else:
+ raise LALRError("Unknown conflict in state %d" % st)
+ else:
+ st_action[a] = -p.number
+ st_actionp[a] = p
+ Productions[p.number].reduced += 1
+ else:
+ i = p.lr_index
+ a = p.prod[i+1] # Get symbol right after the "."
+ if a in self.grammar.Terminals:
+ g = self.lr0_goto(I,a)
+ j = self.lr0_cidhash.get(id(g),-1)
+ if j >= 0:
+ # We are in a shift state
+ actlist.append((a,p,"shift and go to state %d" % j))
+ r = st_action.get(a,None)
+ if r is not None:
+ # Whoa have a shift/reduce or shift/shift conflict
+ if r > 0:
+ if r != j:
+ raise LALRError("Shift/shift conflict in state %d" % st)
+ elif r < 0:
+ # Do a precedence check.
+ # - if precedence of reduce rule is higher, we reduce.
+ # - if precedence of reduce is same and left assoc, we reduce.
+ # - otherwise we shift
+ rprec,rlevel = Productions[st_actionp[a].number].prec
+ sprec,slevel = Precedence.get(a,('right',0))
+ if (slevel > rlevel) or ((slevel == rlevel) and (rprec == 'right')):
+ # We decide to shift here... highest precedence to shift
+ Productions[st_actionp[a].number].reduced -= 1
+ st_action[a] = j
+ st_actionp[a] = p
+ if not rlevel:
+ log.info(" ! shift/reduce conflict for %s resolved as shift",a)
+ self.sr_conflicts.append((st,a,'shift'))
+ elif (slevel == rlevel) and (rprec == 'nonassoc'):
+ st_action[a] = None
+ else:
+ # Hmmm. Guess we'll keep the reduce
+ if not slevel and not rlevel:
+ log.info(" ! shift/reduce conflict for %s resolved as reduce",a)
+ self.sr_conflicts.append((st,a,'reduce'))
+
+ else:
+ raise LALRError("Unknown conflict in state %d" % st)
+ else:
+ st_action[a] = j
+ st_actionp[a] = p
+
+ # Print the actions associated with each terminal
+ _actprint = { }
+ for a,p,m in actlist:
+ if a in st_action:
+ if p is st_actionp[a]:
+ log.info(" %-15s %s",a,m)
+ _actprint[(a,m)] = 1
+ log.info("")
+ # Print the actions that were not used. (debugging)
+ not_used = 0
+ for a,p,m in actlist:
+ if a in st_action:
+ if p is not st_actionp[a]:
+ if not (a,m) in _actprint:
+ log.debug(" ! %-15s [ %s ]",a,m)
+ not_used = 1
+ _actprint[(a,m)] = 1
+ if not_used:
+ log.debug("")
+
+ # Construct the goto table for this state
+
+ nkeys = { }
+ for ii in I:
+ for s in ii.usyms:
+ if s in self.grammar.Nonterminals:
+ nkeys[s] = None
+ for n in nkeys:
+ g = self.lr0_goto(I,n)
+ j = self.lr0_cidhash.get(id(g),-1)
+ if j >= 0:
+ st_goto[n] = j
+ log.info(" %-30s shift and go to state %d",n,j)
+
+ action[st] = st_action
+ actionp[st] = st_actionp
+ goto[st] = st_goto
+ st += 1
+
+
+ # -----------------------------------------------------------------------------
+ # write()
+ #
+ # This function writes the LR parsing tables to a file
+ # -----------------------------------------------------------------------------
+
+ def write_table(self,modulename,outputdir='',signature=""):
+ basemodulename = modulename.split(".")[-1]
+ filename = os.path.join(outputdir,basemodulename) + ".py"
+ try:
+ f = open(filename,"w")
+
+ f.write("""
+# %s
+# This file is automatically generated. Do not edit.
+_tabversion = %r
+
+_lr_method = %r
+
+_lr_signature = %r
+ """ % (filename, __tabversion__, self.lr_method, signature))
+
+ # Change smaller to 0 to go back to original tables
+ smaller = 1
+
+ # Factor out names to try and make smaller
+ if smaller:
+ items = { }
+
+ for s,nd in self.lr_action.items():
+ for name,v in nd.items():
+ i = items.get(name)
+ if not i:
+ i = ([],[])
+ items[name] = i
+ i[0].append(s)
+ i[1].append(v)
+
+ f.write("\n_lr_action_items = {")
+ for k,v in items.items():
+ f.write("%r:([" % k)
+ for i in v[0]:
+ f.write("%r," % i)
+ f.write("],[")
+ for i in v[1]:
+ f.write("%r," % i)
+
+ f.write("]),")
+ f.write("}\n")
+
+ f.write("""
+_lr_action = { }
+for _k, _v in _lr_action_items.items():
+ for _x,_y in zip(_v[0],_v[1]):
+ if not _x in _lr_action: _lr_action[_x] = { }
+ _lr_action[_x][_k] = _y
+del _lr_action_items
+""")
+
+ else:
+ f.write("\n_lr_action = { ");
+ for k,v in self.lr_action.items():
+ f.write("(%r,%r):%r," % (k[0],k[1],v))
+ f.write("}\n");
+
+ if smaller:
+ # Factor out names to try and make smaller
+ items = { }
+
+ for s,nd in self.lr_goto.items():
+ for name,v in nd.items():
+ i = items.get(name)
+ if not i:
+ i = ([],[])
+ items[name] = i
+ i[0].append(s)
+ i[1].append(v)
+
+ f.write("\n_lr_goto_items = {")
+ for k,v in items.items():
+ f.write("%r:([" % k)
+ for i in v[0]:
+ f.write("%r," % i)
+ f.write("],[")
+ for i in v[1]:
+ f.write("%r," % i)
+
+ f.write("]),")
+ f.write("}\n")
+
+ f.write("""
+_lr_goto = { }
+for _k, _v in _lr_goto_items.items():
+ for _x,_y in zip(_v[0],_v[1]):
+ if not _x in _lr_goto: _lr_goto[_x] = { }
+ _lr_goto[_x][_k] = _y
+del _lr_goto_items
+""")
+ else:
+ f.write("\n_lr_goto = { ");
+ for k,v in self.lr_goto.items():
+ f.write("(%r,%r):%r," % (k[0],k[1],v))
+ f.write("}\n");
+
+ # Write production table
+ f.write("_lr_productions = [\n")
+ for p in self.lr_productions:
+ if p.func:
+ f.write(" (%r,%r,%d,%r,%r,%d),\n" % (p.str,p.name, p.len, p.func,p.file,p.line))
+ else:
+ f.write(" (%r,%r,%d,None,None,None),\n" % (str(p),p.name, p.len))
+ f.write("]\n")
+ f.close()
+
+ except IOError:
+ e = sys.exc_info()[1]
+ sys.stderr.write("Unable to create '%s'\n" % filename)
+ sys.stderr.write(str(e)+"\n")
+ return
+
+
+ # -----------------------------------------------------------------------------
+ # pickle_table()
+ #
+ # This function pickles the LR parsing tables to a supplied file object
+ # -----------------------------------------------------------------------------
+
+ def pickle_table(self,filename,signature=""):
+ try:
+ import cPickle as pickle
+ except ImportError:
+ import pickle
+ outf = open(filename,"wb")
+ pickle.dump(__tabversion__,outf,pickle_protocol)
+ pickle.dump(self.lr_method,outf,pickle_protocol)
+ pickle.dump(signature,outf,pickle_protocol)
+ pickle.dump(self.lr_action,outf,pickle_protocol)
+ pickle.dump(self.lr_goto,outf,pickle_protocol)
+
+ outp = []
+ for p in self.lr_productions:
+ if p.func:
+ outp.append((p.str,p.name, p.len, p.func,p.file,p.line))
+ else:
+ outp.append((str(p),p.name,p.len,None,None,None))
+ pickle.dump(outp,outf,pickle_protocol)
+ outf.close()
+
+# -----------------------------------------------------------------------------
+# === INTROSPECTION ===
+#
+# The following functions and classes are used to implement the PLY
+# introspection features followed by the yacc() function itself.
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# get_caller_module_dict()
+#
+# This function returns a dictionary containing all of the symbols defined within
+# a caller further down the call stack. This is used to get the environment
+# associated with the yacc() call if none was provided.
+# -----------------------------------------------------------------------------
+
+def get_caller_module_dict(levels):
+ try:
+ raise RuntimeError
+ except RuntimeError:
+ e,b,t = sys.exc_info()
+ f = t.tb_frame
+ while levels > 0:
+ f = f.f_back
+ levels -= 1
+ ldict = f.f_globals.copy()
+ if f.f_globals != f.f_locals:
+ ldict.update(f.f_locals)
+
+ return ldict
+
+# -----------------------------------------------------------------------------
+# parse_grammar()
+#
+# This takes a raw grammar rule string and parses it into production data
+# -----------------------------------------------------------------------------
+def parse_grammar(doc,file,line):
+ grammar = []
+ # Split the doc string into lines
+ pstrings = doc.splitlines()
+ lastp = None
+ dline = line
+ for ps in pstrings:
+ dline += 1
+ p = ps.split()
+ if not p: continue
+ try:
+ if p[0] == '|':
+ # This is a continuation of a previous rule
+ if not lastp:
+ raise SyntaxError("%s:%d: Misplaced '|'" % (file,dline))
+ prodname = lastp
+ syms = p[1:]
+ else:
+ prodname = p[0]
+ lastp = prodname
+ syms = p[2:]
+ assign = p[1]
+ if assign != ':' and assign != '::=':
+ raise SyntaxError("%s:%d: Syntax error. Expected ':'" % (file,dline))
+
+ grammar.append((file,dline,prodname,syms))
+ except SyntaxError:
+ raise
+ except Exception:
+ raise SyntaxError("%s:%d: Syntax error in rule '%s'" % (file,dline,ps.strip()))
+
+ return grammar
+
+# -----------------------------------------------------------------------------
+# ParserReflect()
+#
+# This class represents information extracted for building a parser including
+# start symbol, error function, tokens, precedence list, action functions,
+# etc.
+# -----------------------------------------------------------------------------
+class ParserReflect(object):
+ def __init__(self,pdict,log=None):
+ self.pdict = pdict
+ self.start = None
+ self.error_func = None
+ self.tokens = None
+ self.files = {}
+ self.grammar = []
+ self.error = 0
+
+ if log is None:
+ self.log = PlyLogger(sys.stderr)
+ else:
+ self.log = log
+
+ # Get all of the basic information
+ def get_all(self):
+ self.get_start()
+ self.get_error_func()
+ self.get_tokens()
+ self.get_precedence()
+ self.get_pfunctions()
+
+ # Validate all of the information
+ def validate_all(self):
+ self.validate_start()
+ self.validate_error_func()
+ self.validate_tokens()
+ self.validate_precedence()
+ self.validate_pfunctions()
+ self.validate_files()
+ return self.error
+
+ # Compute a signature over the grammar
+ def signature(self):
+ try:
+ from hashlib import md5
+ except ImportError:
+ from md5 import md5
+ try:
+ sig = md5()
+ if self.start:
+ sig.update(self.start.encode('latin-1'))
+ if self.prec:
+ sig.update("".join(["".join(p) for p in self.prec]).encode('latin-1'))
+ if self.tokens:
+ sig.update(" ".join(self.tokens).encode('latin-1'))
+ for f in self.pfuncs:
+ if f[3]:
+ sig.update(f[3].encode('latin-1'))
+ except (TypeError,ValueError):
+ pass
+ return sig.digest()
+
+ # -----------------------------------------------------------------------------
+ # validate_file()
+ #
+ # This method checks to see if there are duplicated p_rulename() functions
+ # in the parser module file. Without this function, it is really easy for
+ # users to make mistakes by cutting and pasting code fragments (and it's a real
+ # bugger to try and figure out why the resulting parser doesn't work). Therefore,
+ # we just do a little regular expression pattern matching of def statements
+ # to try and detect duplicates.
+ # -----------------------------------------------------------------------------
+
+ def validate_files(self):
+ # Match def p_funcname(
+ fre = re.compile(r'\s*def\s+(p_[a-zA-Z_0-9]*)\(')
+
+ for filename in self.files.keys():
+ base,ext = os.path.splitext(filename)
+ if ext != '.py': return 1 # No idea. Assume it's okay.
+
+ try:
+ f = open(filename)
+ lines = f.readlines()
+ f.close()
+ except IOError:
+ continue
+
+ counthash = { }
+ for linen,l in enumerate(lines):
+ linen += 1
+ m = fre.match(l)
+ if m:
+ name = m.group(1)
+ prev = counthash.get(name)
+ if not prev:
+ counthash[name] = linen
+ else:
+ self.log.warning("%s:%d: Function %s redefined. Previously defined on line %d", filename,linen,name,prev)
+
+ # Get the start symbol
+ def get_start(self):
+ self.start = self.pdict.get('start')
+
+ # Validate the start symbol
+ def validate_start(self):
+ if self.start is not None:
+ if not isinstance(self.start,str):
+ self.log.error("'start' must be a string")
+
+ # Look for error handler
+ def get_error_func(self):
+ self.error_func = self.pdict.get('p_error')
+
+ # Validate the error function
+ def validate_error_func(self):
+ if self.error_func:
+ if isinstance(self.error_func,types.FunctionType):
+ ismethod = 0
+ elif isinstance(self.error_func, types.MethodType):
+ ismethod = 1
+ else:
+ self.log.error("'p_error' defined, but is not a function or method")
+ self.error = 1
+ return
+
+ eline = func_code(self.error_func).co_firstlineno
+ efile = func_code(self.error_func).co_filename
+ self.files[efile] = 1
+
+ if (func_code(self.error_func).co_argcount != 1+ismethod):
+ self.log.error("%s:%d: p_error() requires 1 argument",efile,eline)
+ self.error = 1
+
+ # Get the tokens map
+ def get_tokens(self):
+ tokens = self.pdict.get("tokens",None)
+ if not tokens:
+ self.log.error("No token list is defined")
+ self.error = 1
+ return
+
+ if not isinstance(tokens,(list, tuple)):
+ self.log.error("tokens must be a list or tuple")
+ self.error = 1
+ return
+
+ if not tokens:
+ self.log.error("tokens is empty")
+ self.error = 1
+ return
+
+ self.tokens = tokens
+
+ # Validate the tokens
+ def validate_tokens(self):
+ # Validate the tokens.
+ if 'error' in self.tokens:
+ self.log.error("Illegal token name 'error'. Is a reserved word")
+ self.error = 1
+ return
+
+ terminals = {}
+ for n in self.tokens:
+ if n in terminals:
+ self.log.warning("Token '%s' multiply defined", n)
+ terminals[n] = 1
+
+ # Get the precedence map (if any)
+ def get_precedence(self):
+ self.prec = self.pdict.get("precedence",None)
+
+ # Validate and parse the precedence map
+ def validate_precedence(self):
+ preclist = []
+ if self.prec:
+ if not isinstance(self.prec,(list,tuple)):
+ self.log.error("precedence must be a list or tuple")
+ self.error = 1
+ return
+ for level,p in enumerate(self.prec):
+ if not isinstance(p,(list,tuple)):
+ self.log.error("Bad precedence table")
+ self.error = 1
+ return
+
+ if len(p) < 2:
+ self.log.error("Malformed precedence entry %s. Must be (assoc, term, ..., term)",p)
+ self.error = 1
+ return
+ assoc = p[0]
+ if not isinstance(assoc,str):
+ self.log.error("precedence associativity must be a string")
+ self.error = 1
+ return
+ for term in p[1:]:
+ if not isinstance(term,str):
+ self.log.error("precedence items must be strings")
+ self.error = 1
+ return
+ preclist.append((term,assoc,level+1))
+ self.preclist = preclist
+
+ # Get all p_functions from the grammar
+ def get_pfunctions(self):
+ p_functions = []
+ for name, item in self.pdict.items():
+ if name[:2] != 'p_': continue
+ if name == 'p_error': continue
+ if isinstance(item,(types.FunctionType,types.MethodType)):
+ line = func_code(item).co_firstlineno
+ file = func_code(item).co_filename
+ p_functions.append((line,file,name,item.__doc__))
+
+ # Sort all of the actions by line number
+ p_functions.sort()
+ self.pfuncs = p_functions
+
+
+ # Validate all of the p_functions
+ def validate_pfunctions(self):
+ grammar = []
+ # Check for non-empty symbols
+ if len(self.pfuncs) == 0:
+ self.log.error("no rules of the form p_rulename are defined")
+ self.error = 1
+ return
+
+ for line, file, name, doc in self.pfuncs:
+ func = self.pdict[name]
+ if isinstance(func, types.MethodType):
+ reqargs = 2
+ else:
+ reqargs = 1
+ if func_code(func).co_argcount > reqargs:
+ self.log.error("%s:%d: Rule '%s' has too many arguments",file,line,func.__name__)
+ self.error = 1
+ elif func_code(func).co_argcount < reqargs:
+ self.log.error("%s:%d: Rule '%s' requires an argument",file,line,func.__name__)
+ self.error = 1
+ elif not func.__doc__:
+ self.log.warning("%s:%d: No documentation string specified in function '%s' (ignored)",file,line,func.__name__)
+ else:
+ try:
+ parsed_g = parse_grammar(doc,file,line)
+ for g in parsed_g:
+ grammar.append((name, g))
+ except SyntaxError:
+ e = sys.exc_info()[1]
+ self.log.error(str(e))
+ self.error = 1
+
+ # Looks like a valid grammar rule
+ # Mark the file in which defined.
+ self.files[file] = 1
+
+ # Secondary validation step that looks for p_ definitions that are not functions
+ # or functions that look like they might be grammar rules.
+
+ for n,v in self.pdict.items():
+ if n[0:2] == 'p_' and isinstance(v, (types.FunctionType, types.MethodType)): continue
+ if n[0:2] == 't_': continue
+ if n[0:2] == 'p_' and n != 'p_error':
+ self.log.warning("'%s' not defined as a function", n)
+ if ((isinstance(v,types.FunctionType) and func_code(v).co_argcount == 1) or
+ (isinstance(v,types.MethodType) and func_code(v).co_argcount == 2)):
+ try:
+ doc = v.__doc__.split(" ")
+ if doc[1] == ':':
+ self.log.warning("%s:%d: Possible grammar rule '%s' defined without p_ prefix",
+ func_code(v).co_filename, func_code(v).co_firstlineno,n)
+ except Exception:
+ pass
+
+ self.grammar = grammar
+
+# -----------------------------------------------------------------------------
+# yacc(module)
+#
+# Build a parser
+# -----------------------------------------------------------------------------
+
+def yacc(method='LALR', debug=yaccdebug, module=None, tabmodule=tab_module, start=None,
+ check_recursion=1, optimize=0, write_tables=1, debugfile=debug_file,outputdir='',
+ debuglog=None, errorlog = None, picklefile=None):
+
+ global parse # Reference to the parsing method of the last built parser
+
+ # If pickling is enabled, table files are not created
+
+ if picklefile:
+ write_tables = 0
+
+ if errorlog is None:
+ errorlog = PlyLogger(sys.stderr)
+
+ # Get the module dictionary used for the parser
+ if module:
+ _items = [(k,getattr(module,k)) for k in dir(module)]
+ pdict = dict(_items)
+ else:
+ pdict = get_caller_module_dict(2)
+
+ # Collect parser information from the dictionary
+ pinfo = ParserReflect(pdict,log=errorlog)
+ pinfo.get_all()
+
+ if pinfo.error:
+ raise YaccError("Unable to build parser")
+
+ # Check signature against table files (if any)
+ signature = pinfo.signature()
+
+ # Read the tables
+ try:
+ lr = LRTable()
+ if picklefile:
+ read_signature = lr.read_pickle(picklefile)
+ else:
+ read_signature = lr.read_table(tabmodule)
+ if optimize or (read_signature == signature):
+ try:
+ lr.bind_callables(pinfo.pdict)
+ parser = LRParser(lr,pinfo.error_func)
+ parse = parser.parse
+ return parser
+ except Exception:
+ e = sys.exc_info()[1]
+ errorlog.warning("There was a problem loading the table file: %s", repr(e))
+ except VersionError:
+ e = sys.exc_info()
+ errorlog.warning(str(e))
+ except Exception:
+ pass
+
+ if debuglog is None:
+ if debug:
+ debuglog = PlyLogger(open(debugfile,"w"))
+ else:
+ debuglog = NullLogger()
+
+ debuglog.info("Created by PLY version %s (http://www.dabeaz.com/ply)", __version__)
+
+
+ errors = 0
+
+ # Validate the parser information
+ if pinfo.validate_all():
+ raise YaccError("Unable to build parser")
+
+ if not pinfo.error_func:
+ errorlog.warning("no p_error() function is defined")
+
+ # Create a grammar object
+ grammar = Grammar(pinfo.tokens)
+
+ # Set precedence level for terminals
+ for term, assoc, level in pinfo.preclist:
+ try:
+ grammar.set_precedence(term,assoc,level)
+ except GrammarError:
+ e = sys.exc_info()[1]
+ errorlog.warning("%s",str(e))
+
+ # Add productions to the grammar
+ for funcname, gram in pinfo.grammar:
+ file, line, prodname, syms = gram
+ try:
+ grammar.add_production(prodname,syms,funcname,file,line)
+ except GrammarError:
+ e = sys.exc_info()[1]
+ errorlog.error("%s",str(e))
+ errors = 1
+
+ # Set the grammar start symbols
+ try:
+ if start is None:
+ grammar.set_start(pinfo.start)
+ else:
+ grammar.set_start(start)
+ except GrammarError:
+ e = sys.exc_info()[1]
+ errorlog.error(str(e))
+ errors = 1
+
+ if errors:
+ raise YaccError("Unable to build parser")
+
+ # Verify the grammar structure
+ undefined_symbols = grammar.undefined_symbols()
+ for sym, prod in undefined_symbols:
+ errorlog.error("%s:%d: Symbol '%s' used, but not defined as a token or a rule",prod.file,prod.line,sym)
+ errors = 1
+
+ unused_terminals = grammar.unused_terminals()
+ if unused_terminals:
+ debuglog.info("")
+ debuglog.info("Unused terminals:")
+ debuglog.info("")
+ for term in unused_terminals:
+ errorlog.warning("Token '%s' defined, but not used", term)
+ debuglog.info(" %s", term)
+
+ # Print out all productions to the debug log
+ if debug:
+ debuglog.info("")
+ debuglog.info("Grammar")
+ debuglog.info("")
+ for n,p in enumerate(grammar.Productions):
+ debuglog.info("Rule %-5d %s", n, p)
+
+ # Find unused non-terminals
+ unused_rules = grammar.unused_rules()
+ for prod in unused_rules:
+ errorlog.warning("%s:%d: Rule '%s' defined, but not used", prod.file, prod.line, prod.name)
+
+ if len(unused_terminals) == 1:
+ errorlog.warning("There is 1 unused token")
+ if len(unused_terminals) > 1:
+ errorlog.warning("There are %d unused tokens", len(unused_terminals))
+
+ if len(unused_rules) == 1:
+ errorlog.warning("There is 1 unused rule")
+ if len(unused_rules) > 1:
+ errorlog.warning("There are %d unused rules", len(unused_rules))
+
+ if debug:
+ debuglog.info("")
+ debuglog.info("Terminals, with rules where they appear")
+ debuglog.info("")
+ terms = list(grammar.Terminals)
+ terms.sort()
+ for term in terms:
+ debuglog.info("%-20s : %s", term, " ".join([str(s) for s in grammar.Terminals[term]]))
+
+ debuglog.info("")
+ debuglog.info("Nonterminals, with rules where they appear")
+ debuglog.info("")
+ nonterms = list(grammar.Nonterminals)
+ nonterms.sort()
+ for nonterm in nonterms:
+ debuglog.info("%-20s : %s", nonterm, " ".join([str(s) for s in grammar.Nonterminals[nonterm]]))
+ debuglog.info("")
+
+ if check_recursion:
+ unreachable = grammar.find_unreachable()
+ for u in unreachable:
+ errorlog.warning("Symbol '%s' is unreachable",u)
+
+ infinite = grammar.infinite_cycles()
+ for inf in infinite:
+ errorlog.error("Infinite recursion detected for symbol '%s'", inf)
+ errors = 1
+
+ unused_prec = grammar.unused_precedence()
+ for term, assoc in unused_prec:
+ errorlog.error("Precedence rule '%s' defined for unknown symbol '%s'", assoc, term)
+ errors = 1
+
+ if errors:
+ raise YaccError("Unable to build parser")
+
+ # Run the LRGeneratedTable on the grammar
+ if debug:
+ errorlog.debug("Generating %s tables", method)
+
+ lr = LRGeneratedTable(grammar,method,debuglog)
+
+ if debug:
+ num_sr = len(lr.sr_conflicts)
+
+ # Report shift/reduce and reduce/reduce conflicts
+ if num_sr == 1:
+ errorlog.warning("1 shift/reduce conflict")
+ elif num_sr > 1:
+ errorlog.warning("%d shift/reduce conflicts", num_sr)
+
+ num_rr = len(lr.rr_conflicts)
+ if num_rr == 1:
+ errorlog.warning("1 reduce/reduce conflict")
+ elif num_rr > 1:
+ errorlog.warning("%d reduce/reduce conflicts", num_rr)
+
+ # Write out conflicts to the output file
+ if debug and (lr.sr_conflicts or lr.rr_conflicts):
+ debuglog.warning("")
+ debuglog.warning("Conflicts:")
+ debuglog.warning("")
+
+ for state, tok, resolution in lr.sr_conflicts:
+ debuglog.warning("shift/reduce conflict for %s in state %d resolved as %s", tok, state, resolution)
+
+ already_reported = {}
+ for state, rule, rejected in lr.rr_conflicts:
+ if (state,id(rule),id(rejected)) in already_reported:
+ continue
+ debuglog.warning("reduce/reduce conflict in state %d resolved using rule (%s)", state, rule)
+ debuglog.warning("rejected rule (%s) in state %d", rejected,state)
+ errorlog.warning("reduce/reduce conflict in state %d resolved using rule (%s)", state, rule)
+ errorlog.warning("rejected rule (%s) in state %d", rejected, state)
+ already_reported[state,id(rule),id(rejected)] = 1
+
+ warned_never = []
+ for state, rule, rejected in lr.rr_conflicts:
+ if not rejected.reduced and (rejected not in warned_never):
+ debuglog.warning("Rule (%s) is never reduced", rejected)
+ errorlog.warning("Rule (%s) is never reduced", rejected)
+ warned_never.append(rejected)
+
+ # Write the table file if requested
+ if write_tables:
+ lr.write_table(tabmodule,outputdir,signature)
+
+ # Write a pickled version of the tables
+ if picklefile:
+ lr.pickle_table(picklefile,signature)
+
+ # Build the parser
+ lr.bind_callables(pinfo.pdict)
+ parser = LRParser(lr,pinfo.error_func)
+
+ parse = parser.parse
+ return parser
diff --git a/poky/bitbake/lib/progressbar/LICENSE.txt b/poky/bitbake/lib/progressbar/LICENSE.txt
new file mode 100644
index 000000000..fc8ccdc1c
--- /dev/null
+++ b/poky/bitbake/lib/progressbar/LICENSE.txt
@@ -0,0 +1,52 @@
+You can redistribute and/or modify this library under the terms of the
+GNU LGPL license or BSD license (or both).
+
+---
+
+progressbar - Text progress bar library for python.
+Copyright (C) 2005 Nilton Volpato
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+---
+
+progressbar - Text progress bar library for python
+Copyright (c) 2008 Nilton Volpato
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ a. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ b. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ c. Neither the name of the author nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
diff --git a/poky/bitbake/lib/progressbar/__init__.py b/poky/bitbake/lib/progressbar/__init__.py
new file mode 100644
index 000000000..fbab744ee
--- /dev/null
+++ b/poky/bitbake/lib/progressbar/__init__.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# progressbar - Text progress bar library for Python.
+# Copyright (c) 2005 Nilton Volpato
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Text progress bar library for Python.
+
+A text progress bar is typically used to display the progress of a long
+running operation, providing a visual cue that processing is underway.
+
+The ProgressBar class manages the current progress, and the format of the line
+is given by a number of widgets. A widget is an object that may display
+differently depending on the state of the progress bar. There are three types
+of widgets:
+ - a string, which always shows itself
+
+ - a ProgressBarWidget, which may return a different value every time its
+ update method is called
+
+ - a ProgressBarWidgetHFill, which is like ProgressBarWidget, except it
+ expands to fill the remaining width of the line.
+
+The progressbar module is very easy to use, yet very powerful. It will also
+automatically enable features like auto-resizing when the system supports it.
+"""
+
+__author__ = 'Nilton Volpato'
+__author_email__ = 'first-name dot last-name @ gmail.com'
+__date__ = '2011-05-14'
+__version__ = '2.3'
+
+from .compat import *
+from .widgets import *
+from .progressbar import *
diff --git a/poky/bitbake/lib/progressbar/compat.py b/poky/bitbake/lib/progressbar/compat.py
new file mode 100644
index 000000000..a39f4a1f4
--- /dev/null
+++ b/poky/bitbake/lib/progressbar/compat.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+#
+# progressbar - Text progress bar library for Python.
+# Copyright (c) 2005 Nilton Volpato
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Compatibility methods and classes for the progressbar module."""
+
+
+# Python 3.x (and backports) use a modified iterator syntax
+# This will allow 2.x to behave with 3.x iterators
+try:
+ next
+except NameError:
+ def next(iter):
+ try:
+ # Try new style iterators
+ return iter.__next__()
+ except AttributeError:
+ # Fallback in case of a "native" iterator
+ return iter.next()
+
+
+# Python < 2.5 does not have "any"
+try:
+ any
+except NameError:
+ def any(iterator):
+ for item in iterator:
+ if item: return True
+ return False
diff --git a/poky/bitbake/lib/progressbar/progressbar.py b/poky/bitbake/lib/progressbar/progressbar.py
new file mode 100644
index 000000000..2873ad6ca
--- /dev/null
+++ b/poky/bitbake/lib/progressbar/progressbar.py
@@ -0,0 +1,315 @@
+# -*- coding: utf-8 -*-
+#
+# progressbar - Text progress bar library for Python.
+# Copyright (c) 2005 Nilton Volpato
+#
+# (With some small changes after importing into BitBake)
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Main ProgressBar class."""
+
+from __future__ import division
+
+import math
+import os
+import signal
+import sys
+import time
+
+try:
+ from fcntl import ioctl
+ from array import array
+ import termios
+except ImportError:
+ pass
+
+from .compat import * # for: any, next
+from . import widgets
+
+
+class UnknownLength: pass
+
+
+class ProgressBar(object):
+ """The ProgressBar class which updates and prints the bar.
+
+ A common way of using it is like:
+ >>> pbar = ProgressBar().start()
+ >>> for i in range(100):
+ ... # do something
+ ... pbar.update(i+1)
+ ...
+ >>> pbar.finish()
+
+ You can also use a ProgressBar as an iterator:
+ >>> progress = ProgressBar()
+ >>> for i in progress(some_iterable):
+ ... # do something
+ ...
+
+ Since the progress bar is incredibly customizable you can specify
+ different widgets of any type in any order. You can even write your own
+ widgets! However, since there are already a good number of widgets you
+ should probably play around with them before moving on to create your own
+ widgets.
+
+ The term_width parameter represents the current terminal width. If the
+ parameter is set to an integer then the progress bar will use that,
+ otherwise it will attempt to determine the terminal width falling back to
+ 80 columns if the width cannot be determined.
+
+ When implementing a widget's update method you are passed a reference to
+ the current progress bar. As a result, you have access to the
+ ProgressBar's methods and attributes. Although there is nothing preventing
+ you from changing the ProgressBar you should treat it as read only.
+
+ Useful methods and attributes include (Public API):
+ - currval: current progress (0 <= currval <= maxval)
+ - maxval: maximum (and final) value
+ - finished: True if the bar has finished (reached 100%)
+ - start_time: the time when start() method of ProgressBar was called
+ - seconds_elapsed: seconds elapsed since start_time and last call to
+ update
+ - percentage(): progress in percent [0..100]
+ """
+
+ __slots__ = ('currval', 'fd', 'finished', 'last_update_time',
+ 'left_justify', 'maxval', 'next_update', 'num_intervals',
+ 'poll', 'seconds_elapsed', 'signal_set', 'start_time',
+ 'term_width', 'update_interval', 'widgets', '_time_sensitive',
+ '__iterable')
+
+ _DEFAULT_MAXVAL = 100
+ _DEFAULT_TERMSIZE = 80
+ _DEFAULT_WIDGETS = [widgets.Percentage(), ' ', widgets.Bar()]
+
+ def __init__(self, maxval=None, widgets=None, term_width=None, poll=1,
+ left_justify=True, fd=sys.stderr):
+ """Initializes a progress bar with sane defaults."""
+
+ # Don't share a reference with any other progress bars
+ if widgets is None:
+ widgets = list(self._DEFAULT_WIDGETS)
+
+ self.maxval = maxval
+ self.widgets = widgets
+ self.fd = fd
+ self.left_justify = left_justify
+
+ self.signal_set = False
+ if term_width is not None:
+ self.term_width = term_width
+ else:
+ try:
+ self._handle_resize(None, None)
+ signal.signal(signal.SIGWINCH, self._handle_resize)
+ self.signal_set = True
+ except (SystemExit, KeyboardInterrupt): raise
+ except Exception as e:
+ print("DEBUG 5 %s" % e)
+ self.term_width = self._env_size()
+
+ self.__iterable = None
+ self._update_widgets()
+ self.currval = 0
+ self.finished = False
+ self.last_update_time = None
+ self.poll = poll
+ self.seconds_elapsed = 0
+ self.start_time = None
+ self.update_interval = 1
+ self.next_update = 0
+
+
+ def __call__(self, iterable):
+ """Use a ProgressBar to iterate through an iterable."""
+
+ try:
+ self.maxval = len(iterable)
+ except:
+ if self.maxval is None:
+ self.maxval = UnknownLength
+
+ self.__iterable = iter(iterable)
+ return self
+
+
+ def __iter__(self):
+ return self
+
+
+ def __next__(self):
+ try:
+ value = next(self.__iterable)
+ if self.start_time is None:
+ self.start()
+ else:
+ self.update(self.currval + 1)
+ return value
+ except StopIteration:
+ if self.start_time is None:
+ self.start()
+ self.finish()
+ raise
+
+
+ # Create an alias so that Python 2.x won't complain about not being
+ # an iterator.
+ next = __next__
+
+
+ def _env_size(self):
+ """Tries to find the term_width from the environment."""
+
+ return int(os.environ.get('COLUMNS', self._DEFAULT_TERMSIZE)) - 1
+
+
+ def _handle_resize(self, signum=None, frame=None):
+ """Tries to catch resize signals sent from the terminal."""
+
+ h, w = array('h', ioctl(self.fd, termios.TIOCGWINSZ, '\0' * 8))[:2]
+ self.term_width = w
+
+
+ def percentage(self):
+ """Returns the progress as a percentage."""
+ if self.currval >= self.maxval:
+ return 100.0
+ return (self.currval * 100.0 / self.maxval) if self.maxval else 100.00
+
+ percent = property(percentage)
+
+
+ def _format_widgets(self):
+ result = []
+ expanding = []
+ width = self.term_width
+
+ for index, widget in enumerate(self.widgets):
+ if isinstance(widget, widgets.WidgetHFill):
+ result.append(widget)
+ expanding.insert(0, index)
+ else:
+ widget = widgets.format_updatable(widget, self)
+ result.append(widget)
+ width -= len(widget)
+
+ count = len(expanding)
+ while count:
+ portion = max(int(math.ceil(width * 1. / count)), 0)
+ index = expanding.pop()
+ count -= 1
+
+ widget = result[index].update(self, portion)
+ width -= len(widget)
+ result[index] = widget
+
+ return result
+
+
+ def _format_line(self):
+ """Joins the widgets and justifies the line."""
+
+ widgets = ''.join(self._format_widgets())
+
+ if self.left_justify: return widgets.ljust(self.term_width)
+ else: return widgets.rjust(self.term_width)
+
+
+ def _need_update(self):
+ """Returns whether the ProgressBar should redraw the line."""
+ if self.currval >= self.next_update or self.finished: return True
+
+ delta = time.time() - self.last_update_time
+ return self._time_sensitive and delta > self.poll
+
+
+ def _update_widgets(self):
+ """Checks all widgets for the time sensitive bit."""
+
+ self._time_sensitive = any(getattr(w, 'TIME_SENSITIVE', False)
+ for w in self.widgets)
+
+
+ def update(self, value=None):
+ """Updates the ProgressBar to a new value."""
+
+ if value is not None and value is not UnknownLength:
+ if (self.maxval is not UnknownLength
+ and not 0 <= value <= self.maxval):
+
+ raise ValueError('Value out of range')
+
+ self.currval = value
+
+
+ if not self._need_update(): return
+ if self.start_time is None:
+ raise RuntimeError('You must call "start" before calling "update"')
+
+ now = time.time()
+ self.seconds_elapsed = now - self.start_time
+ self.next_update = self.currval + self.update_interval
+ output = self._format_line()
+ self.fd.write(output + '\r')
+ self.fd.flush()
+ self.last_update_time = now
+ return output
+
+
+ def start(self, update=True):
+ """Starts measuring time, and prints the bar at 0%.
+
+ It returns self so you can use it like this:
+ >>> pbar = ProgressBar().start()
+ >>> for i in range(100):
+ ... # do something
+ ... pbar.update(i+1)
+ ...
+ >>> pbar.finish()
+ """
+
+ if self.maxval is None:
+ self.maxval = self._DEFAULT_MAXVAL
+
+ self.num_intervals = max(100, self.term_width)
+ self.next_update = 0
+
+ if self.maxval is not UnknownLength:
+ if self.maxval < 0: raise ValueError('Value out of range')
+ self.update_interval = self.maxval / self.num_intervals
+
+
+ self.start_time = time.time()
+ if update:
+ self.last_update_time = self.start_time
+ self.update(0)
+ else:
+ self.last_update_time = 0
+
+ return self
+
+
+ def finish(self):
+ """Puts the ProgressBar bar in the finished state."""
+
+ if self.finished:
+ return
+ self.finished = True
+ self.update(self.maxval)
+ self.fd.write('\n')
+ if self.signal_set:
+ signal.signal(signal.SIGWINCH, signal.SIG_DFL)
diff --git a/poky/bitbake/lib/progressbar/widgets.py b/poky/bitbake/lib/progressbar/widgets.py
new file mode 100644
index 000000000..77285ca7a
--- /dev/null
+++ b/poky/bitbake/lib/progressbar/widgets.py
@@ -0,0 +1,391 @@
+# -*- coding: utf-8 -*-
+#
+# progressbar - Text progress bar library for Python.
+# Copyright (c) 2005 Nilton Volpato
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Default ProgressBar widgets."""
+
+from __future__ import division
+
+import datetime
+import math
+
+try:
+ from abc import ABCMeta, abstractmethod
+except ImportError:
+ AbstractWidget = object
+ abstractmethod = lambda fn: fn
+else:
+ AbstractWidget = ABCMeta('AbstractWidget', (object,), {})
+
+
+def format_updatable(updatable, pbar):
+ if hasattr(updatable, 'update'): return updatable.update(pbar)
+ else: return updatable
+
+
+class Widget(AbstractWidget):
+ """The base class for all widgets.
+
+ The ProgressBar will call the widget's update value when the widget should
+ be updated. The widget's size may change between calls, but the widget may
+ display incorrectly if the size changes drastically and repeatedly.
+
+ The boolean TIME_SENSITIVE informs the ProgressBar that it should be
+ updated more often because it is time sensitive.
+ """
+
+ TIME_SENSITIVE = False
+ __slots__ = ()
+
+ @abstractmethod
+ def update(self, pbar):
+ """Updates the widget.
+
+ pbar - a reference to the calling ProgressBar
+ """
+
+
+class WidgetHFill(Widget):
+ """The base class for all variable width widgets.
+
+ This widget is much like the \\hfill command in TeX, it will expand to
+ fill the line. You can use more than one in the same line, and they will
+ all have the same width, and together will fill the line.
+ """
+
+ @abstractmethod
+ def update(self, pbar, width):
+ """Updates the widget providing the total width the widget must fill.
+
+ pbar - a reference to the calling ProgressBar
+ width - The total width the widget must fill
+ """
+
+
+class Timer(Widget):
+ """Widget which displays the elapsed seconds."""
+
+ __slots__ = ('format_string',)
+ TIME_SENSITIVE = True
+
+ def __init__(self, format='Elapsed Time: %s'):
+ self.format_string = format
+
+ @staticmethod
+ def format_time(seconds):
+ """Formats time as the string "HH:MM:SS"."""
+
+ return str(datetime.timedelta(seconds=int(seconds)))
+
+
+ def update(self, pbar):
+ """Updates the widget to show the elapsed time."""
+
+ return self.format_string % self.format_time(pbar.seconds_elapsed)
+
+
+class ETA(Timer):
+ """Widget which attempts to estimate the time of arrival."""
+
+ TIME_SENSITIVE = True
+
+ def update(self, pbar):
+ """Updates the widget to show the ETA or total time when finished."""
+
+ if pbar.currval == 0:
+ return 'ETA: --:--:--'
+ elif pbar.finished:
+ return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
+ else:
+ elapsed = pbar.seconds_elapsed
+ eta = elapsed * pbar.maxval / pbar.currval - elapsed
+ return 'ETA: %s' % self.format_time(eta)
+
+
+class AdaptiveETA(Timer):
+ """Widget which attempts to estimate the time of arrival.
+
+ Uses a weighted average of two estimates:
+ 1) ETA based on the total progress and time elapsed so far
+ 2) ETA based on the progress as per the last 10 update reports
+
+ The weight depends on the current progress so that to begin with the
+ total progress is used and at the end only the most recent progress is
+ used.
+ """
+
+ TIME_SENSITIVE = True
+ NUM_SAMPLES = 10
+
+ def _update_samples(self, currval, elapsed):
+ sample = (currval, elapsed)
+ if not hasattr(self, 'samples'):
+ self.samples = [sample] * (self.NUM_SAMPLES + 1)
+ else:
+ self.samples.append(sample)
+ return self.samples.pop(0)
+
+ def _eta(self, maxval, currval, elapsed):
+ return elapsed * maxval / float(currval) - elapsed
+
+ def update(self, pbar):
+ """Updates the widget to show the ETA or total time when finished."""
+ if pbar.currval == 0:
+ return 'ETA: --:--:--'
+ elif pbar.finished:
+ return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
+ else:
+ elapsed = pbar.seconds_elapsed
+ currval1, elapsed1 = self._update_samples(pbar.currval, elapsed)
+ eta = self._eta(pbar.maxval, pbar.currval, elapsed)
+ if pbar.currval > currval1:
+ etasamp = self._eta(pbar.maxval - currval1,
+ pbar.currval - currval1,
+ elapsed - elapsed1)
+ weight = (pbar.currval / float(pbar.maxval)) ** 0.5
+ eta = (1 - weight) * eta + weight * etasamp
+ return 'ETA: %s' % self.format_time(eta)
+
+
+class FileTransferSpeed(Widget):
+ """Widget for showing the transfer speed (useful for file transfers)."""
+
+ FORMAT = '%6.2f %s%s/s'
+ PREFIXES = ' kMGTPEZY'
+ __slots__ = ('unit',)
+
+ def __init__(self, unit='B'):
+ self.unit = unit
+
+ def update(self, pbar):
+ """Updates the widget with the current SI prefixed speed."""
+
+ if pbar.seconds_elapsed < 2e-6 or pbar.currval < 2e-6: # =~ 0
+ scaled = power = 0
+ else:
+ speed = pbar.currval / pbar.seconds_elapsed
+ power = int(math.log(speed, 1000))
+ scaled = speed / 1000.**power
+
+ return self.FORMAT % (scaled, self.PREFIXES[power], self.unit)
+
+
+class AnimatedMarker(Widget):
+ """An animated marker for the progress bar which defaults to appear as if
+ it were rotating.
+ """
+
+ __slots__ = ('markers', 'curmark')
+
+ def __init__(self, markers='|/-\\'):
+ self.markers = markers
+ self.curmark = -1
+
+ def update(self, pbar):
+ """Updates the widget to show the next marker or the first marker when
+ finished"""
+
+ if pbar.finished: return self.markers[0]
+
+ self.curmark = (self.curmark + 1) % len(self.markers)
+ return self.markers[self.curmark]
+
+# Alias for backwards compatibility
+RotatingMarker = AnimatedMarker
+
+
+class Counter(Widget):
+ """Displays the current count."""
+
+ __slots__ = ('format_string',)
+
+ def __init__(self, format='%d'):
+ self.format_string = format
+
+ def update(self, pbar):
+ return self.format_string % pbar.currval
+
+
+class Percentage(Widget):
+ """Displays the current percentage as a number with a percent sign."""
+
+ def update(self, pbar):
+ return '%3d%%' % pbar.percentage()
+
+
+class FormatLabel(Timer):
+ """Displays a formatted label."""
+
+ mapping = {
+ 'elapsed': ('seconds_elapsed', Timer.format_time),
+ 'finished': ('finished', None),
+ 'last_update': ('last_update_time', None),
+ 'max': ('maxval', None),
+ 'seconds': ('seconds_elapsed', None),
+ 'start': ('start_time', None),
+ 'value': ('currval', None)
+ }
+
+ __slots__ = ('format_string',)
+ def __init__(self, format):
+ self.format_string = format
+
+ def update(self, pbar):
+ context = {}
+ for name, (key, transform) in self.mapping.items():
+ try:
+ value = getattr(pbar, key)
+
+ if transform is None:
+ context[name] = value
+ else:
+ context[name] = transform(value)
+ except: pass
+
+ return self.format_string % context
+
+
+class SimpleProgress(Widget):
+ """Returns progress as a count of the total (e.g.: "5 of 47")."""
+
+ __slots__ = ('sep',)
+
+ def __init__(self, sep=' of '):
+ self.sep = sep
+
+ def update(self, pbar):
+ return '%d%s%d' % (pbar.currval, self.sep, pbar.maxval)
+
+
+class Bar(WidgetHFill):
+ """A progress bar which stretches to fill the line."""
+
+ __slots__ = ('marker', 'left', 'right', 'fill', 'fill_left')
+
+ def __init__(self, marker='#', left='|', right='|', fill=' ',
+ fill_left=True):
+ """Creates a customizable progress bar.
+
+ marker - string or updatable object to use as a marker
+ left - string or updatable object to use as a left border
+ right - string or updatable object to use as a right border
+ fill - character to use for the empty part of the progress bar
+ fill_left - whether to fill from the left or the right
+ """
+ self.marker = marker
+ self.left = left
+ self.right = right
+ self.fill = fill
+ self.fill_left = fill_left
+
+
+ def update(self, pbar, width):
+ """Updates the progress bar and its subcomponents."""
+
+ left, marked, right = (format_updatable(i, pbar) for i in
+ (self.left, self.marker, self.right))
+
+ width -= len(left) + len(right)
+ # Marked must *always* have length of 1
+ if pbar.maxval:
+ marked *= int(pbar.currval / pbar.maxval * width)
+ else:
+ marked = ''
+
+ if self.fill_left:
+ return '%s%s%s' % (left, marked.ljust(width, self.fill), right)
+ else:
+ return '%s%s%s' % (left, marked.rjust(width, self.fill), right)
+
+
+class ReverseBar(Bar):
+ """A bar which has a marker which bounces from side to side."""
+
+ def __init__(self, marker='#', left='|', right='|', fill=' ',
+ fill_left=False):
+ """Creates a customizable progress bar.
+
+ marker - string or updatable object to use as a marker
+ left - string or updatable object to use as a left border
+ right - string or updatable object to use as a right border
+ fill - character to use for the empty part of the progress bar
+ fill_left - whether to fill from the left or the right
+ """
+ self.marker = marker
+ self.left = left
+ self.right = right
+ self.fill = fill
+ self.fill_left = fill_left
+
+
+class BouncingBar(Bar):
+ def update(self, pbar, width):
+ """Updates the progress bar and its subcomponents."""
+
+ left, marker, right = (format_updatable(i, pbar) for i in
+ (self.left, self.marker, self.right))
+
+ width -= len(left) + len(right)
+
+ if pbar.finished: return '%s%s%s' % (left, width * marker, right)
+
+ position = int(pbar.currval % (width * 2 - 1))
+ if position > width: position = width * 2 - position
+ lpad = self.fill * (position - 1)
+ rpad = self.fill * (width - len(marker) - len(lpad))
+
+ # Swap if we want to bounce the other way
+ if not self.fill_left: rpad, lpad = lpad, rpad
+
+ return '%s%s%s%s%s' % (left, lpad, marker, rpad, right)
+
+
+class BouncingSlider(Bar):
+ """
+ A slider that bounces back and forth in response to update() calls
+ without reference to the actual value. Based on a combination of
+ BouncingBar from a newer version of this module and RotatingMarker.
+ """
+ def __init__(self, marker='<=>'):
+ self.curmark = -1
+ self.forward = True
+ Bar.__init__(self, marker=marker)
+ def update(self, pbar, width):
+ left, marker, right = (format_updatable(i, pbar) for i in
+ (self.left, self.marker, self.right))
+
+ width -= len(left) + len(right)
+ if width < 0:
+ return ''
+
+ if pbar.finished: return '%s%s%s' % (left, width * '=', right)
+
+ self.curmark = self.curmark + 1
+ position = int(self.curmark % (width * 2 - 1))
+ if position + len(marker) > width:
+ self.forward = not self.forward
+ self.curmark = 1
+ position = 1
+ lpad = ' ' * (position - 1)
+ rpad = ' ' * (width - len(marker) - len(lpad))
+
+ if not self.forward:
+ temp = lpad
+ lpad = rpad
+ rpad = temp
+ return '%s%s%s%s%s' % (left, lpad, marker, rpad, right)
diff --git a/poky/bitbake/lib/prserv/__init__.py b/poky/bitbake/lib/prserv/__init__.py
new file mode 100644
index 000000000..c3cb73ad9
--- /dev/null
+++ b/poky/bitbake/lib/prserv/__init__.py
@@ -0,0 +1,14 @@
+__version__ = "1.0.0"
+
+import os, time
+import sys,logging
+
+def init_logger(logfile, loglevel):
+ numeric_level = getattr(logging, loglevel.upper(), None)
+ if not isinstance(numeric_level, int):
+ raise ValueError('Invalid log level: %s' % loglevel)
+ FORMAT = '%(asctime)-15s %(message)s'
+ logging.basicConfig(level=numeric_level, filename=logfile, format=FORMAT)
+
+class NotFoundError(Exception):
+ pass
diff --git a/poky/bitbake/lib/prserv/db.py b/poky/bitbake/lib/prserv/db.py
new file mode 100644
index 000000000..495d09f39
--- /dev/null
+++ b/poky/bitbake/lib/prserv/db.py
@@ -0,0 +1,276 @@
+import logging
+import os.path
+import errno
+import prserv
+import time
+
+try:
+ import sqlite3
+except ImportError:
+ from pysqlite2 import dbapi2 as sqlite3
+
+logger = logging.getLogger("BitBake.PRserv")
+
+sqlversion = sqlite3.sqlite_version_info
+if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
+ raise Exception("sqlite3 version 3.3.0 or later is required.")
+
+#
+# "No History" mode - for a given query tuple (version, pkgarch, checksum),
+# the returned value will be the largest among all the values of the same
+# (version, pkgarch). This means the PR value returned can NOT be decremented.
+#
+# "History" mode - Return a new higher value for previously unseen query
+# tuple (version, pkgarch, checksum), otherwise return historical value.
+# Value can decrement if returning to a previous build.
+#
+
+class PRTable(object):
+ def __init__(self, conn, table, nohist):
+ self.conn = conn
+ self.nohist = nohist
+ self.dirty = False
+ if nohist:
+ self.table = "%s_nohist" % table
+ else:
+ self.table = "%s_hist" % table
+
+ self._execute("CREATE TABLE IF NOT EXISTS %s \
+ (version TEXT NOT NULL, \
+ pkgarch TEXT NOT NULL, \
+ checksum TEXT NOT NULL, \
+ value INTEGER, \
+ PRIMARY KEY (version, pkgarch, checksum));" % self.table)
+
+ def _execute(self, *query):
+ """Execute a query, waiting to acquire a lock if necessary"""
+ start = time.time()
+ end = start + 20
+ while True:
+ try:
+ return self.conn.execute(*query)
+ except sqlite3.OperationalError as exc:
+ if 'is locked' in str(exc) and end > time.time():
+ continue
+ raise exc
+
+ def sync(self):
+ self.conn.commit()
+ self._execute("BEGIN EXCLUSIVE TRANSACTION")
+
+ def sync_if_dirty(self):
+ if self.dirty:
+ self.sync()
+ self.dirty = False
+
+ def _getValueHist(self, version, pkgarch, checksum):
+ data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
+ (version, pkgarch, checksum))
+ row=data.fetchone()
+ if row != None:
+ return row[0]
+ else:
+ #no value found, try to insert
+ try:
+ self._execute("INSERT INTO %s VALUES (?, ?, ?, (select ifnull(max(value)+1,0) from %s where version=? AND pkgarch=?));"
+ % (self.table,self.table),
+ (version,pkgarch, checksum,version, pkgarch))
+ except sqlite3.IntegrityError as exc:
+ logger.error(str(exc))
+
+ self.dirty = True
+
+ data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
+ (version, pkgarch, checksum))
+ row=data.fetchone()
+ if row != None:
+ return row[0]
+ else:
+ raise prserv.NotFoundError
+
+ def _getValueNohist(self, version, pkgarch, checksum):
+ data=self._execute("SELECT value FROM %s \
+ WHERE version=? AND pkgarch=? AND checksum=? AND \
+ value >= (select max(value) from %s where version=? AND pkgarch=?);"
+ % (self.table, self.table),
+ (version, pkgarch, checksum, version, pkgarch))
+ row=data.fetchone()
+ if row != None:
+ return row[0]
+ else:
+ #no value found, try to insert
+ try:
+ self._execute("INSERT OR REPLACE INTO %s VALUES (?, ?, ?, (select ifnull(max(value)+1,0) from %s where version=? AND pkgarch=?));"
+ % (self.table,self.table),
+ (version, pkgarch, checksum, version, pkgarch))
+ except sqlite3.IntegrityError as exc:
+ logger.error(str(exc))
+ self.conn.rollback()
+
+ self.dirty = True
+
+ data=self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
+ (version, pkgarch, checksum))
+ row=data.fetchone()
+ if row != None:
+ return row[0]
+ else:
+ raise prserv.NotFoundError
+
+ def getValue(self, version, pkgarch, checksum):
+ if self.nohist:
+ return self._getValueNohist(version, pkgarch, checksum)
+ else:
+ return self._getValueHist(version, pkgarch, checksum)
+
+ def _importHist(self, version, pkgarch, checksum, value):
+ val = None
+ data = self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
+ (version, pkgarch, checksum))
+ row = data.fetchone()
+ if row != None:
+ val=row[0]
+ else:
+ #no value found, try to insert
+ try:
+ self._execute("INSERT INTO %s VALUES (?, ?, ?, ?);" % (self.table),
+ (version, pkgarch, checksum, value))
+ except sqlite3.IntegrityError as exc:
+ logger.error(str(exc))
+
+ self.dirty = True
+
+ data = self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=?;" % self.table,
+ (version, pkgarch, checksum))
+ row = data.fetchone()
+ if row != None:
+ val = row[0]
+ return val
+
+ def _importNohist(self, version, pkgarch, checksum, value):
+ try:
+ #try to insert
+ self._execute("INSERT INTO %s VALUES (?, ?, ?, ?);" % (self.table),
+ (version, pkgarch, checksum,value))
+ except sqlite3.IntegrityError as exc:
+ #already have the record, try to update
+ try:
+ self._execute("UPDATE %s SET value=? WHERE version=? AND pkgarch=? AND checksum=? AND value<?"
+ % (self.table),
+ (value,version,pkgarch,checksum,value))
+ except sqlite3.IntegrityError as exc:
+ logger.error(str(exc))
+
+ self.dirty = True
+
+ data = self._execute("SELECT value FROM %s WHERE version=? AND pkgarch=? AND checksum=? AND value>=?;" % self.table,
+ (version,pkgarch,checksum,value))
+ row=data.fetchone()
+ if row != None:
+ return row[0]
+ else:
+ return None
+
+ def importone(self, version, pkgarch, checksum, value):
+ if self.nohist:
+ return self._importNohist(version, pkgarch, checksum, value)
+ else:
+ return self._importHist(version, pkgarch, checksum, value)
+
+ def export(self, version, pkgarch, checksum, colinfo):
+ metainfo = {}
+ #column info
+ if colinfo:
+ metainfo['tbl_name'] = self.table
+ metainfo['core_ver'] = prserv.__version__
+ metainfo['col_info'] = []
+ data = self._execute("PRAGMA table_info(%s);" % self.table)
+ for row in data:
+ col = {}
+ col['name'] = row['name']
+ col['type'] = row['type']
+ col['notnull'] = row['notnull']
+ col['dflt_value'] = row['dflt_value']
+ col['pk'] = row['pk']
+ metainfo['col_info'].append(col)
+
+ #data info
+ datainfo = []
+
+ if self.nohist:
+ sqlstmt = "SELECT T1.version, T1.pkgarch, T1.checksum, T1.value FROM %s as T1, \
+ (SELECT version,pkgarch,max(value) as maxvalue FROM %s GROUP BY version,pkgarch) as T2 \
+ WHERE T1.version=T2.version AND T1.pkgarch=T2.pkgarch AND T1.value=T2.maxvalue " % (self.table, self.table)
+ else:
+ sqlstmt = "SELECT * FROM %s as T1 WHERE 1=1 " % self.table
+ sqlarg = []
+ where = ""
+ if version:
+ where += "AND T1.version=? "
+ sqlarg.append(str(version))
+ if pkgarch:
+ where += "AND T1.pkgarch=? "
+ sqlarg.append(str(pkgarch))
+ if checksum:
+ where += "AND T1.checksum=? "
+ sqlarg.append(str(checksum))
+
+ sqlstmt += where + ";"
+
+ if len(sqlarg):
+ data = self._execute(sqlstmt, tuple(sqlarg))
+ else:
+ data = self._execute(sqlstmt)
+ for row in data:
+ if row['version']:
+ col = {}
+ col['version'] = row['version']
+ col['pkgarch'] = row['pkgarch']
+ col['checksum'] = row['checksum']
+ col['value'] = row['value']
+ datainfo.append(col)
+ return (metainfo, datainfo)
+
+ def dump_db(self, fd):
+ writeCount = 0
+ for line in self.conn.iterdump():
+ writeCount = writeCount + len(line) + 1
+ fd.write(line)
+ fd.write('\n')
+ return writeCount
+
+class PRData(object):
+ """Object representing the PR database"""
+ def __init__(self, filename, nohist=True):
+ self.filename=os.path.abspath(filename)
+ self.nohist=nohist
+ #build directory hierarchy
+ try:
+ os.makedirs(os.path.dirname(self.filename))
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+ self.connection=sqlite3.connect(self.filename, isolation_level="EXCLUSIVE", check_same_thread = False)
+ self.connection.row_factory=sqlite3.Row
+ self.connection.execute("pragma synchronous = off;")
+ self.connection.execute("PRAGMA journal_mode = WAL;")
+ self._tables={}
+
+ def disconnect(self):
+ self.connection.close()
+
+ def __getitem__(self,tblname):
+ if not isinstance(tblname, str):
+ raise TypeError("tblname argument must be a string, not '%s'" %
+ type(tblname))
+ if tblname in self._tables:
+ return self._tables[tblname]
+ else:
+ tableobj = self._tables[tblname] = PRTable(self.connection, tblname, self.nohist)
+ return tableobj
+
+ def __delitem__(self, tblname):
+ if tblname in self._tables:
+ del self._tables[tblname]
+ logger.info("drop table %s" % (tblname))
+ self.connection.execute("DROP TABLE IF EXISTS %s;" % tblname)
diff --git a/poky/bitbake/lib/prserv/serv.py b/poky/bitbake/lib/prserv/serv.py
new file mode 100644
index 000000000..6a99728c4
--- /dev/null
+++ b/poky/bitbake/lib/prserv/serv.py
@@ -0,0 +1,504 @@
+import os,sys,logging
+import signal, time
+from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+import threading
+import queue
+import socket
+import io
+import sqlite3
+import bb.server.xmlrpcclient
+import prserv
+import prserv.db
+import errno
+import select
+
+logger = logging.getLogger("BitBake.PRserv")
+
+if sys.hexversion < 0x020600F0:
+ print("Sorry, python 2.6 or later is required.")
+ sys.exit(1)
+
+class Handler(SimpleXMLRPCRequestHandler):
+ def _dispatch(self,method,params):
+ try:
+ value=self.server.funcs[method](*params)
+ except:
+ import traceback
+ traceback.print_exc()
+ raise
+ return value
+
+PIDPREFIX = "/tmp/PRServer_%s_%s.pid"
+singleton = None
+
+
+class PRServer(SimpleXMLRPCServer):
+ def __init__(self, dbfile, logfile, interface, daemon=True):
+ ''' constructor '''
+ try:
+ SimpleXMLRPCServer.__init__(self, interface,
+ logRequests=False, allow_none=True)
+ except socket.error:
+ ip=socket.gethostbyname(interface[0])
+ port=interface[1]
+ msg="PR Server unable to bind to %s:%s\n" % (ip, port)
+ sys.stderr.write(msg)
+ raise PRServiceConfigError
+
+ self.dbfile=dbfile
+ self.daemon=daemon
+ self.logfile=logfile
+ self.working_thread=None
+ self.host, self.port = self.socket.getsockname()
+ self.pidfile=PIDPREFIX % (self.host, self.port)
+
+ self.register_function(self.getPR, "getPR")
+ self.register_function(self.quit, "quit")
+ self.register_function(self.ping, "ping")
+ self.register_function(self.export, "export")
+ self.register_function(self.dump_db, "dump_db")
+ self.register_function(self.importone, "importone")
+ self.register_introspection_functions()
+
+ self.quitpipein, self.quitpipeout = os.pipe()
+
+ self.requestqueue = queue.Queue()
+ self.handlerthread = threading.Thread(target = self.process_request_thread)
+ self.handlerthread.daemon = False
+
+ def process_request_thread(self):
+ """Same as in BaseServer but as a thread.
+
+ In addition, exception handling is done here.
+
+ """
+ iter_count = 1
+ # 60 iterations between syncs or sync if dirty every ~30 seconds
+ iterations_between_sync = 60
+
+ bb.utils.set_process_name("PRServ Handler")
+
+ while not self.quitflag:
+ try:
+ (request, client_address) = self.requestqueue.get(True, 30)
+ except queue.Empty:
+ self.table.sync_if_dirty()
+ continue
+ if request is None:
+ continue
+ try:
+ self.finish_request(request, client_address)
+ self.shutdown_request(request)
+ iter_count = (iter_count + 1) % iterations_between_sync
+ if iter_count == 0:
+ self.table.sync_if_dirty()
+ except:
+ self.handle_error(request, client_address)
+ self.shutdown_request(request)
+ self.table.sync()
+ self.table.sync_if_dirty()
+
+ def sigint_handler(self, signum, stack):
+ if self.table:
+ self.table.sync()
+
+ def sigterm_handler(self, signum, stack):
+ if self.table:
+ self.table.sync()
+ self.quit()
+ self.requestqueue.put((None, None))
+
+ def process_request(self, request, client_address):
+ self.requestqueue.put((request, client_address))
+
+ def export(self, version=None, pkgarch=None, checksum=None, colinfo=True):
+ try:
+ return self.table.export(version, pkgarch, checksum, colinfo)
+ except sqlite3.Error as exc:
+ logger.error(str(exc))
+ return None
+
+ def dump_db(self):
+ """
+ Returns a script (string) that reconstructs the state of the
+ entire database at the time this function is called. The script
+ language is defined by the backing database engine, which is a
+ function of server configuration.
+ Returns None if the database engine does not support dumping to
+ script or if some other error is encountered in processing.
+ """
+ buff = io.StringIO()
+ try:
+ self.table.sync()
+ self.table.dump_db(buff)
+ return buff.getvalue()
+ except Exception as exc:
+ logger.error(str(exc))
+ return None
+ finally:
+ buff.close()
+
+ def importone(self, version, pkgarch, checksum, value):
+ return self.table.importone(version, pkgarch, checksum, value)
+
+ def ping(self):
+ return not self.quitflag
+
+ def getinfo(self):
+ return (self.host, self.port)
+
+ def getPR(self, version, pkgarch, checksum):
+ try:
+ return self.table.getValue(version, pkgarch, checksum)
+ except prserv.NotFoundError:
+ logger.error("can not find value for (%s, %s)",version, checksum)
+ return None
+ except sqlite3.Error as exc:
+ logger.error(str(exc))
+ return None
+
+ def quit(self):
+ self.quitflag=True
+ os.write(self.quitpipeout, b"q")
+ os.close(self.quitpipeout)
+ return
+
+ def work_forever(self,):
+ self.quitflag = False
+ # This timeout applies to the poll in TCPServer, we need the select
+ # below to wake on our quit pipe closing. We only ever call into handle_request
+ # if there is data there.
+ self.timeout = 0.01
+
+ bb.utils.set_process_name("PRServ")
+
+ # DB connection must be created after all forks
+ self.db = prserv.db.PRData(self.dbfile)
+ self.table = self.db["PRMAIN"]
+
+ logger.info("Started PRServer with DBfile: %s, IP: %s, PORT: %s, PID: %s" %
+ (self.dbfile, self.host, self.port, str(os.getpid())))
+
+ self.handlerthread.start()
+ while not self.quitflag:
+ ready = select.select([self.fileno(), self.quitpipein], [], [], 30)
+ if self.quitflag:
+ break
+ if self.fileno() in ready[0]:
+ self.handle_request()
+ self.handlerthread.join()
+ self.db.disconnect()
+ logger.info("PRServer: stopping...")
+ self.server_close()
+ os.close(self.quitpipein)
+ return
+
+ def start(self):
+ if self.daemon:
+ pid = self.daemonize()
+ else:
+ pid = self.fork()
+ self.pid = pid
+
+ # Ensure both the parent sees this and the child from the work_forever log entry above
+ logger.info("Started PRServer with DBfile: %s, IP: %s, PORT: %s, PID: %s" %
+ (self.dbfile, self.host, self.port, str(pid)))
+
+ def delpid(self):
+ os.remove(self.pidfile)
+
+ def daemonize(self):
+ """
+ See Advanced Programming in the UNIX, Sec 13.3
+ """
+ try:
+ pid = os.fork()
+ if pid > 0:
+ os.waitpid(pid, 0)
+ #parent return instead of exit to give control
+ return pid
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
+
+ os.setsid()
+ """
+ fork again to make sure the daemon is not session leader,
+ which prevents it from acquiring controlling terminal
+ """
+ try:
+ pid = os.fork()
+ if pid > 0: #parent
+ os._exit(0)
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
+
+ self.cleanup_handles()
+ os._exit(0)
+
+ def fork(self):
+ try:
+ pid = os.fork()
+ if pid > 0:
+ return pid
+ except OSError as e:
+ raise Exception("%s [%d]" % (e.strerror, e.errno))
+
+ bb.utils.signal_on_parent_exit("SIGTERM")
+ self.cleanup_handles()
+ os._exit(0)
+
+ def cleanup_handles(self):
+ signal.signal(signal.SIGINT, self.sigint_handler)
+ signal.signal(signal.SIGTERM, self.sigterm_handler)
+ os.chdir("/")
+
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ # We could be called from a python thread with io.StringIO as
+ # stdout/stderr or it could be 'real' unix fd forking where we need
+ # to physically close the fds to prevent the program launching us from
+ # potentially hanging on a pipe. Handle both cases.
+ si = open('/dev/null', 'r')
+ try:
+ os.dup2(si.fileno(),sys.stdin.fileno())
+ except (AttributeError, io.UnsupportedOperation):
+ sys.stdin = si
+ so = open(self.logfile, 'a+')
+ try:
+ os.dup2(so.fileno(),sys.stdout.fileno())
+ except (AttributeError, io.UnsupportedOperation):
+ sys.stdout = so
+ try:
+ os.dup2(so.fileno(),sys.stderr.fileno())
+ except (AttributeError, io.UnsupportedOperation):
+ sys.stderr = so
+
+ # Clear out all log handlers prior to the fork() to avoid calling
+ # event handlers not part of the PRserver
+ for logger_iter in logging.Logger.manager.loggerDict.keys():
+ logging.getLogger(logger_iter).handlers = []
+
+ # Ensure logging makes it to the logfile
+ streamhandler = logging.StreamHandler()
+ streamhandler.setLevel(logging.DEBUG)
+ formatter = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
+ streamhandler.setFormatter(formatter)
+ logger.addHandler(streamhandler)
+
+ # write pidfile
+ pid = str(os.getpid())
+ pf = open(self.pidfile, 'w')
+ pf.write("%s\n" % pid)
+ pf.close()
+
+ self.work_forever()
+ self.delpid()
+
+class PRServSingleton(object):
+ def __init__(self, dbfile, logfile, interface):
+ self.dbfile = dbfile
+ self.logfile = logfile
+ self.interface = interface
+ self.host = None
+ self.port = None
+
+ def start(self):
+ self.prserv = PRServer(self.dbfile, self.logfile, self.interface, daemon=False)
+ self.prserv.start()
+ self.host, self.port = self.prserv.getinfo()
+
+ def getinfo(self):
+ return (self.host, self.port)
+
+class PRServerConnection(object):
+ def __init__(self, host, port):
+ if is_local_special(host, port):
+ host, port = singleton.getinfo()
+ self.host = host
+ self.port = port
+ self.connection, self.transport = bb.server.xmlrpcclient._create_server(self.host, self.port)
+
+ def terminate(self):
+ try:
+ logger.info("Terminating PRServer...")
+ self.connection.quit()
+ except Exception as exc:
+ sys.stderr.write("%s\n" % str(exc))
+
+ def getPR(self, version, pkgarch, checksum):
+ return self.connection.getPR(version, pkgarch, checksum)
+
+ def ping(self):
+ return self.connection.ping()
+
+ def export(self,version=None, pkgarch=None, checksum=None, colinfo=True):
+ return self.connection.export(version, pkgarch, checksum, colinfo)
+
+ def dump_db(self):
+ return self.connection.dump_db()
+
+ def importone(self, version, pkgarch, checksum, value):
+ return self.connection.importone(version, pkgarch, checksum, value)
+
+ def getinfo(self):
+ return self.host, self.port
+
+def start_daemon(dbfile, host, port, logfile):
+ ip = socket.gethostbyname(host)
+ pidfile = PIDPREFIX % (ip, port)
+ try:
+ pf = open(pidfile,'r')
+ pid = int(pf.readline().strip())
+ pf.close()
+ except IOError:
+ pid = None
+
+ if pid:
+ sys.stderr.write("pidfile %s already exist. Daemon already running?\n"
+ % pidfile)
+ return 1
+
+ server = PRServer(os.path.abspath(dbfile), os.path.abspath(logfile), (ip,port))
+ server.start()
+
+ # Sometimes, the port (i.e. localhost:0) indicated by the user does not match with
+ # the one the server actually is listening, so at least warn the user about it
+ _,rport = server.getinfo()
+ if port != rport:
+ sys.stdout.write("Server is listening at port %s instead of %s\n"
+ % (rport,port))
+ return 0
+
+def stop_daemon(host, port):
+ import glob
+ ip = socket.gethostbyname(host)
+ pidfile = PIDPREFIX % (ip, port)
+ try:
+ pf = open(pidfile,'r')
+ pid = int(pf.readline().strip())
+ pf.close()
+ except IOError:
+ pid = None
+
+ if not pid:
+ # when server starts at port=0 (i.e. localhost:0), server actually takes another port,
+ # so at least advise the user which ports the corresponding server is listening
+ ports = []
+ portstr = ""
+ for pf in glob.glob(PIDPREFIX % (ip,'*')):
+ bn = os.path.basename(pf)
+ root, _ = os.path.splitext(bn)
+ ports.append(root.split('_')[-1])
+ if len(ports):
+ portstr = "Wrong port? Other ports listening at %s: %s" % (host, ' '.join(ports))
+
+ sys.stderr.write("pidfile %s does not exist. Daemon not running? %s\n"
+ % (pidfile,portstr))
+ return 1
+
+ try:
+ PRServerConnection(ip, port).terminate()
+ except:
+ logger.critical("Stop PRService %s:%d failed" % (host,port))
+
+ try:
+ if pid:
+ wait_timeout = 0
+ print("Waiting for pr-server to exit.")
+ while is_running(pid) and wait_timeout < 50:
+ time.sleep(0.1)
+ wait_timeout += 1
+
+ if is_running(pid):
+ print("Sending SIGTERM to pr-server.")
+ os.kill(pid,signal.SIGTERM)
+ time.sleep(0.1)
+
+ if os.path.exists(pidfile):
+ os.remove(pidfile)
+
+ except OSError as e:
+ err = str(e)
+ if err.find("No such process") <= 0:
+ raise e
+
+ return 0
+
+def is_running(pid):
+ try:
+ os.kill(pid, 0)
+ except OSError as err:
+ if err.errno == errno.ESRCH:
+ return False
+ return True
+
+def is_local_special(host, port):
+ if host.strip().upper() == 'localhost'.upper() and (not port):
+ return True
+ else:
+ return False
+
+class PRServiceConfigError(Exception):
+ pass
+
+def auto_start(d):
+ global singleton
+
+ # Shutdown any existing PR Server
+ auto_shutdown()
+
+ host_params = list(filter(None, (d.getVar('PRSERV_HOST') or '').split(':')))
+ if not host_params:
+ return None
+
+ if len(host_params) != 2:
+ logger.critical('\n'.join(['PRSERV_HOST: incorrect format',
+ 'Usage: PRSERV_HOST = "<hostname>:<port>"']))
+ raise PRServiceConfigError
+
+ if is_local_special(host_params[0], int(host_params[1])) and not singleton:
+ import bb.utils
+ cachedir = (d.getVar("PERSISTENT_DIR") or d.getVar("CACHE"))
+ if not cachedir:
+ logger.critical("Please set the 'PERSISTENT_DIR' or 'CACHE' variable")
+ raise PRServiceConfigError
+ bb.utils.mkdirhier(cachedir)
+ dbfile = os.path.join(cachedir, "prserv.sqlite3")
+ logfile = os.path.join(cachedir, "prserv.log")
+ singleton = PRServSingleton(os.path.abspath(dbfile), os.path.abspath(logfile), ("localhost",0))
+ singleton.start()
+ if singleton:
+ host, port = singleton.getinfo()
+ else:
+ host = host_params[0]
+ port = int(host_params[1])
+
+ try:
+ connection = PRServerConnection(host,port)
+ connection.ping()
+ realhost, realport = connection.getinfo()
+ return str(realhost) + ":" + str(realport)
+
+ except Exception:
+ logger.critical("PRservice %s:%d not available" % (host, port))
+ raise PRServiceConfigError
+
+def auto_shutdown():
+ global singleton
+ if singleton:
+ host, port = singleton.getinfo()
+ try:
+ PRServerConnection(host, port).terminate()
+ except:
+ logger.critical("Stop PRService %s:%d failed" % (host,port))
+
+ try:
+ os.waitpid(singleton.prserv.pid, 0)
+ except ChildProcessError:
+ pass
+ singleton = None
+
+def ping(host, port):
+ conn=PRServerConnection(host, port)
+ return conn.ping()
diff --git a/poky/bitbake/lib/pyinotify.py b/poky/bitbake/lib/pyinotify.py
new file mode 100644
index 000000000..4eb03b092
--- /dev/null
+++ b/poky/bitbake/lib/pyinotify.py
@@ -0,0 +1,2362 @@
+#!/usr/bin/env python
+
+# pyinotify.py - python interface to inotify
+# Copyright (c) 2005-2015 Sebastien Martini <seb@dbzteam.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+"""
+pyinotify
+
+@author: Sebastien Martini
+@license: MIT License
+@contact: seb@dbzteam.org
+"""
+
+class PyinotifyError(Exception):
+ """Indicates exceptions raised by a Pyinotify class."""
+ pass
+
+
+class UnsupportedPythonVersionError(PyinotifyError):
+ """
+ Raised on unsupported Python versions.
+ """
+ def __init__(self, version):
+ """
+ @param version: Current Python version
+ @type version: string
+ """
+ PyinotifyError.__init__(self,
+ ('Python %s is unsupported, requires '
+ 'at least Python 3.0') % version)
+
+
+# Check Python version
+import sys
+if sys.version_info < (3, 0):
+ raise UnsupportedPythonVersionError(sys.version)
+
+
+# Import directives
+import threading
+import os
+import select
+import struct
+import fcntl
+import errno
+import termios
+import array
+import logging
+import atexit
+from collections import deque
+from datetime import datetime, timedelta
+import time
+import re
+import asyncore
+import glob
+import locale
+import subprocess
+
+try:
+ from functools import reduce
+except ImportError:
+ pass # Will fail on Python 2.4 which has reduce() builtin anyway.
+
+try:
+ import ctypes
+ import ctypes.util
+except ImportError:
+ ctypes = None
+
+try:
+ import inotify_syscalls
+except ImportError:
+ inotify_syscalls = None
+
+
+__author__ = "seb@dbzteam.org (Sebastien Martini)"
+
+__version__ = "0.9.6"
+
+
+# Compatibity mode: set to True to improve compatibility with
+# Pyinotify 0.7.1. Do not set this variable yourself, call the
+# function compatibility_mode() instead.
+COMPATIBILITY_MODE = False
+
+
+class InotifyBindingNotFoundError(PyinotifyError):
+ """
+ Raised when no inotify support couldn't be found.
+ """
+ def __init__(self):
+ err = "Couldn't find any inotify binding"
+ PyinotifyError.__init__(self, err)
+
+
+class INotifyWrapper:
+ """
+ Abstract class wrapping access to inotify's functions. This is an
+ internal class.
+ """
+ @staticmethod
+ def create():
+ """
+ Factory method instanciating and returning the right wrapper.
+ """
+ # First, try to use ctypes.
+ if ctypes:
+ inotify = _CtypesLibcINotifyWrapper()
+ if inotify.init():
+ return inotify
+ # Second, see if C extension is compiled.
+ if inotify_syscalls:
+ inotify = _INotifySyscallsWrapper()
+ if inotify.init():
+ return inotify
+
+ def get_errno(self):
+ """
+ Return None is no errno code is available.
+ """
+ return self._get_errno()
+
+ def str_errno(self):
+ code = self.get_errno()
+ if code is None:
+ return 'Errno: no errno support'
+ return 'Errno=%s (%s)' % (os.strerror(code), errno.errorcode[code])
+
+ def inotify_init(self):
+ return self._inotify_init()
+
+ def inotify_add_watch(self, fd, pathname, mask):
+ # Unicode strings must be encoded to string prior to calling this
+ # method.
+ assert isinstance(pathname, str)
+ return self._inotify_add_watch(fd, pathname, mask)
+
+ def inotify_rm_watch(self, fd, wd):
+ return self._inotify_rm_watch(fd, wd)
+
+
+class _INotifySyscallsWrapper(INotifyWrapper):
+ def __init__(self):
+ # Stores the last errno value.
+ self._last_errno = None
+
+ def init(self):
+ assert inotify_syscalls
+ return True
+
+ def _get_errno(self):
+ return self._last_errno
+
+ def _inotify_init(self):
+ try:
+ fd = inotify_syscalls.inotify_init()
+ except IOError as err:
+ self._last_errno = err.errno
+ return -1
+ return fd
+
+ def _inotify_add_watch(self, fd, pathname, mask):
+ try:
+ wd = inotify_syscalls.inotify_add_watch(fd, pathname, mask)
+ except IOError as err:
+ self._last_errno = err.errno
+ return -1
+ return wd
+
+ def _inotify_rm_watch(self, fd, wd):
+ try:
+ ret = inotify_syscalls.inotify_rm_watch(fd, wd)
+ except IOError as err:
+ self._last_errno = err.errno
+ return -1
+ return ret
+
+
+class _CtypesLibcINotifyWrapper(INotifyWrapper):
+ def __init__(self):
+ self._libc = None
+ self._get_errno_func = None
+
+ def init(self):
+ assert ctypes
+
+ try_libc_name = 'c'
+ if sys.platform.startswith('freebsd'):
+ try_libc_name = 'inotify'
+
+ libc_name = None
+ try:
+ libc_name = ctypes.util.find_library(try_libc_name)
+ except (OSError, IOError):
+ pass # Will attemp to load it with None anyway.
+
+ self._libc = ctypes.CDLL(libc_name, use_errno=True)
+ self._get_errno_func = ctypes.get_errno
+
+ # Eventually check that libc has needed inotify bindings.
+ if (not hasattr(self._libc, 'inotify_init') or
+ not hasattr(self._libc, 'inotify_add_watch') or
+ not hasattr(self._libc, 'inotify_rm_watch')):
+ return False
+
+ self._libc.inotify_init.argtypes = []
+ self._libc.inotify_init.restype = ctypes.c_int
+ self._libc.inotify_add_watch.argtypes = [ctypes.c_int, ctypes.c_char_p,
+ ctypes.c_uint32]
+ self._libc.inotify_add_watch.restype = ctypes.c_int
+ self._libc.inotify_rm_watch.argtypes = [ctypes.c_int, ctypes.c_int]
+ self._libc.inotify_rm_watch.restype = ctypes.c_int
+ return True
+
+ def _get_errno(self):
+ assert self._get_errno_func
+ return self._get_errno_func()
+
+ def _inotify_init(self):
+ assert self._libc is not None
+ return self._libc.inotify_init()
+
+ def _inotify_add_watch(self, fd, pathname, mask):
+ assert self._libc is not None
+ # Encodes path to a bytes string. This conversion seems required because
+ # ctypes.create_string_buffer seems to manipulate bytes internally.
+ # Moreover it seems that inotify_add_watch does not work very well when
+ # it receives an ctypes.create_unicode_buffer instance as argument.
+ pathname = pathname.encode(sys.getfilesystemencoding())
+ pathname = ctypes.create_string_buffer(pathname)
+ return self._libc.inotify_add_watch(fd, pathname, mask)
+
+ def _inotify_rm_watch(self, fd, wd):
+ assert self._libc is not None
+ return self._libc.inotify_rm_watch(fd, wd)
+
+
+# Logging
+def logger_init():
+ """Initialize logger instance."""
+ log = logging.getLogger("pyinotify")
+ console_handler = logging.StreamHandler()
+ console_handler.setFormatter(
+ logging.Formatter("[%(asctime)s %(name)s %(levelname)s] %(message)s"))
+ log.addHandler(console_handler)
+ log.setLevel(20)
+ return log
+
+log = logger_init()
+
+
+# inotify's variables
+class ProcINotify:
+ """
+ Access (read, write) inotify's variables through /proc/sys/. Note that
+ usually it requires administrator rights to update them.
+
+ Examples:
+ - Read max_queued_events attribute: myvar = max_queued_events.value
+ - Update max_queued_events attribute: max_queued_events.value = 42
+ """
+ def __init__(self, attr):
+ self._base = "/proc/sys/fs/inotify"
+ self._attr = attr
+
+ def get_val(self):
+ """
+ Gets attribute's value.
+
+ @return: stored value.
+ @rtype: int
+ @raise IOError: if corresponding file in /proc/sys cannot be read.
+ """
+ with open(os.path.join(self._base, self._attr), 'r') as file_obj:
+ return int(file_obj.readline())
+
+ def set_val(self, nval):
+ """
+ Sets new attribute's value.
+
+ @param nval: replaces current value by nval.
+ @type nval: int
+ @raise IOError: if corresponding file in /proc/sys cannot be written.
+ """
+ with open(os.path.join(self._base, self._attr), 'w') as file_obj:
+ file_obj.write(str(nval) + '\n')
+
+ value = property(get_val, set_val)
+
+ def __repr__(self):
+ return '<%s=%d>' % (self._attr, self.get_val())
+
+
+# Inotify's variables
+#
+# Note: may raise IOError if the corresponding value in /proc/sys
+# cannot be accessed.
+#
+# Examples:
+# - read: myvar = max_queued_events.value
+# - update: max_queued_events.value = 42
+#
+for attrname in ('max_queued_events', 'max_user_instances', 'max_user_watches'):
+ globals()[attrname] = ProcINotify(attrname)
+
+
+class EventsCodes:
+ """
+ Set of codes corresponding to each kind of events.
+ Some of these flags are used to communicate with inotify, whereas
+ the others are sent to userspace by inotify notifying some events.
+
+ @cvar IN_ACCESS: File was accessed.
+ @type IN_ACCESS: int
+ @cvar IN_MODIFY: File was modified.
+ @type IN_MODIFY: int
+ @cvar IN_ATTRIB: Metadata changed.
+ @type IN_ATTRIB: int
+ @cvar IN_CLOSE_WRITE: Writtable file was closed.
+ @type IN_CLOSE_WRITE: int
+ @cvar IN_CLOSE_NOWRITE: Unwrittable file closed.
+ @type IN_CLOSE_NOWRITE: int
+ @cvar IN_OPEN: File was opened.
+ @type IN_OPEN: int
+ @cvar IN_MOVED_FROM: File was moved from X.
+ @type IN_MOVED_FROM: int
+ @cvar IN_MOVED_TO: File was moved to Y.
+ @type IN_MOVED_TO: int
+ @cvar IN_CREATE: Subfile was created.
+ @type IN_CREATE: int
+ @cvar IN_DELETE: Subfile was deleted.
+ @type IN_DELETE: int
+ @cvar IN_DELETE_SELF: Self (watched item itself) was deleted.
+ @type IN_DELETE_SELF: int
+ @cvar IN_MOVE_SELF: Self (watched item itself) was moved.
+ @type IN_MOVE_SELF: int
+ @cvar IN_UNMOUNT: Backing fs was unmounted.
+ @type IN_UNMOUNT: int
+ @cvar IN_Q_OVERFLOW: Event queued overflowed.
+ @type IN_Q_OVERFLOW: int
+ @cvar IN_IGNORED: File was ignored.
+ @type IN_IGNORED: int
+ @cvar IN_ONLYDIR: only watch the path if it is a directory (new
+ in kernel 2.6.15).
+ @type IN_ONLYDIR: int
+ @cvar IN_DONT_FOLLOW: don't follow a symlink (new in kernel 2.6.15).
+ IN_ONLYDIR we can make sure that we don't watch
+ the target of symlinks.
+ @type IN_DONT_FOLLOW: int
+ @cvar IN_EXCL_UNLINK: Events are not generated for children after they
+ have been unlinked from the watched directory.
+ (new in kernel 2.6.36).
+ @type IN_EXCL_UNLINK: int
+ @cvar IN_MASK_ADD: add to the mask of an already existing watch (new
+ in kernel 2.6.14).
+ @type IN_MASK_ADD: int
+ @cvar IN_ISDIR: Event occurred against dir.
+ @type IN_ISDIR: int
+ @cvar IN_ONESHOT: Only send event once.
+ @type IN_ONESHOT: int
+ @cvar ALL_EVENTS: Alias for considering all of the events.
+ @type ALL_EVENTS: int
+ """
+
+ # The idea here is 'configuration-as-code' - this way, we get our nice class
+ # constants, but we also get nice human-friendly text mappings to do lookups
+ # against as well, for free:
+ FLAG_COLLECTIONS = {'OP_FLAGS': {
+ 'IN_ACCESS' : 0x00000001, # File was accessed
+ 'IN_MODIFY' : 0x00000002, # File was modified
+ 'IN_ATTRIB' : 0x00000004, # Metadata changed
+ 'IN_CLOSE_WRITE' : 0x00000008, # Writable file was closed
+ 'IN_CLOSE_NOWRITE' : 0x00000010, # Unwritable file closed
+ 'IN_OPEN' : 0x00000020, # File was opened
+ 'IN_MOVED_FROM' : 0x00000040, # File was moved from X
+ 'IN_MOVED_TO' : 0x00000080, # File was moved to Y
+ 'IN_CREATE' : 0x00000100, # Subfile was created
+ 'IN_DELETE' : 0x00000200, # Subfile was deleted
+ 'IN_DELETE_SELF' : 0x00000400, # Self (watched item itself)
+ # was deleted
+ 'IN_MOVE_SELF' : 0x00000800, # Self (watched item itself) was moved
+ },
+ 'EVENT_FLAGS': {
+ 'IN_UNMOUNT' : 0x00002000, # Backing fs was unmounted
+ 'IN_Q_OVERFLOW' : 0x00004000, # Event queued overflowed
+ 'IN_IGNORED' : 0x00008000, # File was ignored
+ },
+ 'SPECIAL_FLAGS': {
+ 'IN_ONLYDIR' : 0x01000000, # only watch the path if it is a
+ # directory
+ 'IN_DONT_FOLLOW' : 0x02000000, # don't follow a symlink
+ 'IN_EXCL_UNLINK' : 0x04000000, # exclude events on unlinked objects
+ 'IN_MASK_ADD' : 0x20000000, # add to the mask of an already
+ # existing watch
+ 'IN_ISDIR' : 0x40000000, # event occurred against dir
+ 'IN_ONESHOT' : 0x80000000, # only send event once
+ },
+ }
+
+ def maskname(mask):
+ """
+ Returns the event name associated to mask. IN_ISDIR is appended to
+ the result when appropriate. Note: only one event is returned, because
+ only one event can be raised at a given time.
+
+ @param mask: mask.
+ @type mask: int
+ @return: event name.
+ @rtype: str
+ """
+ ms = mask
+ name = '%s'
+ if mask & IN_ISDIR:
+ ms = mask - IN_ISDIR
+ name = '%s|IN_ISDIR'
+ return name % EventsCodes.ALL_VALUES[ms]
+
+ maskname = staticmethod(maskname)
+
+
+# So let's now turn the configuration into code
+EventsCodes.ALL_FLAGS = {}
+EventsCodes.ALL_VALUES = {}
+for flagc, valc in EventsCodes.FLAG_COLLECTIONS.items():
+ # Make the collections' members directly accessible through the
+ # class dictionary
+ setattr(EventsCodes, flagc, valc)
+
+ # Collect all the flags under a common umbrella
+ EventsCodes.ALL_FLAGS.update(valc)
+
+ # Make the individual masks accessible as 'constants' at globals() scope
+ # and masknames accessible by values.
+ for name, val in valc.items():
+ globals()[name] = val
+ EventsCodes.ALL_VALUES[val] = name
+
+
+# all 'normal' events
+ALL_EVENTS = reduce(lambda x, y: x | y, EventsCodes.OP_FLAGS.values())
+EventsCodes.ALL_FLAGS['ALL_EVENTS'] = ALL_EVENTS
+EventsCodes.ALL_VALUES[ALL_EVENTS] = 'ALL_EVENTS'
+
+
+class _Event:
+ """
+ Event structure, represent events raised by the system. This
+ is the base class and should be subclassed.
+
+ """
+ def __init__(self, dict_):
+ """
+ Attach attributes (contained in dict_) to self.
+
+ @param dict_: Set of attributes.
+ @type dict_: dictionary
+ """
+ for tpl in dict_.items():
+ setattr(self, *tpl)
+
+ def __repr__(self):
+ """
+ @return: Generic event string representation.
+ @rtype: str
+ """
+ s = ''
+ for attr, value in sorted(self.__dict__.items(), key=lambda x: x[0]):
+ if attr.startswith('_'):
+ continue
+ if attr == 'mask':
+ value = hex(getattr(self, attr))
+ elif isinstance(value, str) and not value:
+ value = "''"
+ s += ' %s%s%s' % (output_format.field_name(attr),
+ output_format.punctuation('='),
+ output_format.field_value(value))
+
+ s = '%s%s%s %s' % (output_format.punctuation('<'),
+ output_format.class_name(self.__class__.__name__),
+ s,
+ output_format.punctuation('>'))
+ return s
+
+ def __str__(self):
+ return repr(self)
+
+
+class _RawEvent(_Event):
+ """
+ Raw event, it contains only the informations provided by the system.
+ It doesn't infer anything.
+ """
+ def __init__(self, wd, mask, cookie, name):
+ """
+ @param wd: Watch Descriptor.
+ @type wd: int
+ @param mask: Bitmask of events.
+ @type mask: int
+ @param cookie: Cookie.
+ @type cookie: int
+ @param name: Basename of the file or directory against which the
+ event was raised in case where the watched directory
+ is the parent directory. None if the event was raised
+ on the watched item itself.
+ @type name: string or None
+ """
+ # Use this variable to cache the result of str(self), this object
+ # is immutable.
+ self._str = None
+ # name: remove trailing '\0'
+ d = {'wd': wd,
+ 'mask': mask,
+ 'cookie': cookie,
+ 'name': name.rstrip('\0')}
+ _Event.__init__(self, d)
+ log.debug(str(self))
+
+ def __str__(self):
+ if self._str is None:
+ self._str = _Event.__str__(self)
+ return self._str
+
+
+class Event(_Event):
+ """
+ This class contains all the useful informations about the observed
+ event. However, the presence of each field is not guaranteed and
+ depends on the type of event. In effect, some fields are irrelevant
+ for some kind of event (for example 'cookie' is meaningless for
+ IN_CREATE whereas it is mandatory for IN_MOVE_TO).
+
+ The possible fields are:
+ - wd (int): Watch Descriptor.
+ - mask (int): Mask.
+ - maskname (str): Readable event name.
+ - path (str): path of the file or directory being watched.
+ - name (str): Basename of the file or directory against which the
+ event was raised in case where the watched directory
+ is the parent directory. None if the event was raised
+ on the watched item itself. This field is always provided
+ even if the string is ''.
+ - pathname (str): Concatenation of 'path' and 'name'.
+ - src_pathname (str): Only present for IN_MOVED_TO events and only in
+ the case where IN_MOVED_FROM events are watched too. Holds the
+ source pathname from where pathname was moved from.
+ - cookie (int): Cookie.
+ - dir (bool): True if the event was raised against a directory.
+
+ """
+ def __init__(self, raw):
+ """
+ Concretely, this is the raw event plus inferred infos.
+ """
+ _Event.__init__(self, raw)
+ self.maskname = EventsCodes.maskname(self.mask)
+ if COMPATIBILITY_MODE:
+ self.event_name = self.maskname
+ try:
+ if self.name:
+ self.pathname = os.path.abspath(os.path.join(self.path,
+ self.name))
+ else:
+ self.pathname = os.path.abspath(self.path)
+ except AttributeError as err:
+ # Usually it is not an error some events are perfectly valids
+ # despite the lack of these attributes.
+ log.debug(err)
+
+
+class ProcessEventError(PyinotifyError):
+ """
+ ProcessEventError Exception. Raised on ProcessEvent error.
+ """
+ def __init__(self, err):
+ """
+ @param err: Exception error description.
+ @type err: string
+ """
+ PyinotifyError.__init__(self, err)
+
+
+class _ProcessEvent:
+ """
+ Abstract processing event class.
+ """
+ def __call__(self, event):
+ """
+ To behave like a functor the object must be callable.
+ This method is a dispatch method. Its lookup order is:
+ 1. process_MASKNAME method
+ 2. process_FAMILY_NAME method
+ 3. otherwise calls process_default
+
+ @param event: Event to be processed.
+ @type event: Event object
+ @return: By convention when used from the ProcessEvent class:
+ - Returning False or None (default value) means keep on
+ executing next chained functors (see chain.py example).
+ - Returning True instead means do not execute next
+ processing functions.
+ @rtype: bool
+ @raise ProcessEventError: Event object undispatchable,
+ unknown event.
+ """
+ stripped_mask = event.mask - (event.mask & IN_ISDIR)
+ maskname = EventsCodes.ALL_VALUES.get(stripped_mask)
+ if maskname is None:
+ raise ProcessEventError("Unknown mask 0x%08x" % stripped_mask)
+
+ # 1- look for process_MASKNAME
+ meth = getattr(self, 'process_' + maskname, None)
+ if meth is not None:
+ return meth(event)
+ # 2- look for process_FAMILY_NAME
+ meth = getattr(self, 'process_IN_' + maskname.split('_')[1], None)
+ if meth is not None:
+ return meth(event)
+ # 3- default call method process_default
+ return self.process_default(event)
+
+ def __repr__(self):
+ return '<%s>' % self.__class__.__name__
+
+
+class _SysProcessEvent(_ProcessEvent):
+ """
+ There is three kind of processing according to each event:
+
+ 1. special handling (deletion from internal container, bug, ...).
+ 2. default treatment: which is applied to the majority of events.
+ 3. IN_ISDIR is never sent alone, he is piggybacked with a standard
+ event, he is not processed as the others events, instead, its
+ value is captured and appropriately aggregated to dst event.
+ """
+ def __init__(self, wm, notifier):
+ """
+
+ @param wm: Watch Manager.
+ @type wm: WatchManager instance
+ @param notifier: Notifier.
+ @type notifier: Notifier instance
+ """
+ self._watch_manager = wm # watch manager
+ self._notifier = notifier # notifier
+ self._mv_cookie = {} # {cookie(int): (src_path(str), date), ...}
+ self._mv = {} # {src_path(str): (dst_path(str), date), ...}
+
+ def cleanup(self):
+ """
+ Cleanup (delete) old (>1mn) records contained in self._mv_cookie
+ and self._mv.
+ """
+ date_cur_ = datetime.now()
+ for seq in (self._mv_cookie, self._mv):
+ for k in list(seq.keys()):
+ if (date_cur_ - seq[k][1]) > timedelta(minutes=1):
+ log.debug('Cleanup: deleting entry %s', seq[k][0])
+ del seq[k]
+
+ def process_IN_CREATE(self, raw_event):
+ """
+ If the event affects a directory and the auto_add flag of the
+ targetted watch is set to True, a new watch is added on this
+ new directory, with the same attribute values than those of
+ this watch.
+ """
+ if raw_event.mask & IN_ISDIR:
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ created_dir = os.path.join(watch_.path, raw_event.name)
+ if watch_.auto_add and not watch_.exclude_filter(created_dir):
+ addw = self._watch_manager.add_watch
+ # The newly monitored directory inherits attributes from its
+ # parent directory.
+ addw_ret = addw(created_dir, watch_.mask,
+ proc_fun=watch_.proc_fun,
+ rec=False, auto_add=watch_.auto_add,
+ exclude_filter=watch_.exclude_filter)
+
+ # Trick to handle mkdir -p /d1/d2/t3 where d1 is watched and
+ # d2 and t3 (directory or file) are created.
+ # Since the directory d2 is new, then everything inside it must
+ # also be new.
+ created_dir_wd = addw_ret.get(created_dir)
+ if ((created_dir_wd is not None) and (created_dir_wd > 0) and
+ os.path.isdir(created_dir)):
+ try:
+ for name in os.listdir(created_dir):
+ inner = os.path.join(created_dir, name)
+ if self._watch_manager.get_wd(inner) is not None:
+ continue
+ # Generate (simulate) creation events for sub-
+ # directories and files.
+ if os.path.isfile(inner):
+ # symlinks are handled as files.
+ flags = IN_CREATE
+ elif os.path.isdir(inner):
+ flags = IN_CREATE | IN_ISDIR
+ else:
+ # This path should not be taken.
+ continue
+ rawevent = _RawEvent(created_dir_wd, flags, 0, name)
+ self._notifier.append_event(rawevent)
+ except OSError as err:
+ msg = "process_IN_CREATE, invalid directory: %s"
+ log.debug(msg % str(err))
+ return self.process_default(raw_event)
+
+ def process_IN_MOVED_FROM(self, raw_event):
+ """
+ Map the cookie with the source path (+ date for cleaning).
+ """
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ path_ = watch_.path
+ src_path = os.path.normpath(os.path.join(path_, raw_event.name))
+ self._mv_cookie[raw_event.cookie] = (src_path, datetime.now())
+ return self.process_default(raw_event, {'cookie': raw_event.cookie})
+
+ def process_IN_MOVED_TO(self, raw_event):
+ """
+ Map the source path with the destination path (+ date for
+ cleaning).
+ """
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ path_ = watch_.path
+ dst_path = os.path.normpath(os.path.join(path_, raw_event.name))
+ mv_ = self._mv_cookie.get(raw_event.cookie)
+ to_append = {'cookie': raw_event.cookie}
+ if mv_ is not None:
+ self._mv[mv_[0]] = (dst_path, datetime.now())
+ # Let's assume that IN_MOVED_FROM event is always queued before
+ # that its associated (they share a common cookie) IN_MOVED_TO
+ # event is queued itself. It is then possible in that scenario
+ # to provide as additional information to the IN_MOVED_TO event
+ # the original pathname of the moved file/directory.
+ to_append['src_pathname'] = mv_[0]
+ elif (raw_event.mask & IN_ISDIR and watch_.auto_add and
+ not watch_.exclude_filter(dst_path)):
+ # We got a diretory that's "moved in" from an unknown source and
+ # auto_add is enabled. Manually add watches to the inner subtrees.
+ # The newly monitored directory inherits attributes from its
+ # parent directory.
+ self._watch_manager.add_watch(dst_path, watch_.mask,
+ proc_fun=watch_.proc_fun,
+ rec=True, auto_add=True,
+ exclude_filter=watch_.exclude_filter)
+ return self.process_default(raw_event, to_append)
+
+ def process_IN_MOVE_SELF(self, raw_event):
+ """
+ STATUS: the following bug has been fixed in recent kernels (FIXME:
+ which version ?). Now it raises IN_DELETE_SELF instead.
+
+ Old kernels were bugged, this event raised when the watched item
+ were moved, so we had to update its path, but under some circumstances
+ it was impossible: if its parent directory and its destination
+ directory wasn't watched. The kernel (see include/linux/fsnotify.h)
+ doesn't bring us enough informations like the destination path of
+ moved items.
+ """
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ src_path = watch_.path
+ mv_ = self._mv.get(src_path)
+ if mv_:
+ dest_path = mv_[0]
+ watch_.path = dest_path
+ # add the separator to the source path to avoid overlapping
+ # path issue when testing with startswith()
+ src_path += os.path.sep
+ src_path_len = len(src_path)
+ # The next loop renames all watches with src_path as base path.
+ # It seems that IN_MOVE_SELF does not provide IN_ISDIR information
+ # therefore the next loop is iterated even if raw_event is a file.
+ for w in self._watch_manager.watches.values():
+ if w.path.startswith(src_path):
+ # Note that dest_path is a normalized path.
+ w.path = os.path.join(dest_path, w.path[src_path_len:])
+ else:
+ log.error("The pathname '%s' of this watch %s has probably changed "
+ "and couldn't be updated, so it cannot be trusted "
+ "anymore. To fix this error move directories/files only "
+ "between watched parents directories, in this case e.g. "
+ "put a watch on '%s'.",
+ watch_.path, watch_,
+ os.path.normpath(os.path.join(watch_.path,
+ os.path.pardir)))
+ if not watch_.path.endswith('-unknown-path'):
+ watch_.path += '-unknown-path'
+ return self.process_default(raw_event)
+
+ def process_IN_Q_OVERFLOW(self, raw_event):
+ """
+ Only signal an overflow, most of the common flags are irrelevant
+ for this event (path, wd, name).
+ """
+ return Event({'mask': raw_event.mask})
+
+ def process_IN_IGNORED(self, raw_event):
+ """
+ The watch descriptor raised by this event is now ignored (forever),
+ it can be safely deleted from the watch manager dictionary.
+ After this event we can be sure that neither the event queue nor
+ the system will raise an event associated to this wd again.
+ """
+ event_ = self.process_default(raw_event)
+ self._watch_manager.del_watch(raw_event.wd)
+ return event_
+
+ def process_default(self, raw_event, to_append=None):
+ """
+ Commons handling for the followings events:
+
+ IN_ACCESS, IN_MODIFY, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE,
+ IN_OPEN, IN_DELETE, IN_DELETE_SELF, IN_UNMOUNT.
+ """
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ if raw_event.mask & (IN_DELETE_SELF | IN_MOVE_SELF):
+ # Unfornulately this information is not provided by the kernel
+ dir_ = watch_.dir
+ else:
+ dir_ = bool(raw_event.mask & IN_ISDIR)
+ dict_ = {'wd': raw_event.wd,
+ 'mask': raw_event.mask,
+ 'path': watch_.path,
+ 'name': raw_event.name,
+ 'dir': dir_}
+ if COMPATIBILITY_MODE:
+ dict_['is_dir'] = dir_
+ if to_append is not None:
+ dict_.update(to_append)
+ return Event(dict_)
+
+
+class ProcessEvent(_ProcessEvent):
+ """
+ Process events objects, can be specialized via subclassing, thus its
+ behavior can be overriden:
+
+ Note: you should not override __init__ in your subclass instead define
+ a my_init() method, this method will be called automatically from the
+ constructor of this class with its optionals parameters.
+
+ 1. Provide specialized individual methods, e.g. process_IN_DELETE for
+ processing a precise type of event (e.g. IN_DELETE in this case).
+ 2. Or/and provide methods for processing events by 'family', e.g.
+ process_IN_CLOSE method will process both IN_CLOSE_WRITE and
+ IN_CLOSE_NOWRITE events (if process_IN_CLOSE_WRITE and
+ process_IN_CLOSE_NOWRITE aren't defined though).
+ 3. Or/and override process_default for catching and processing all
+ the remaining types of events.
+ """
+ pevent = None
+
+ def __init__(self, pevent=None, **kargs):
+ """
+ Enable chaining of ProcessEvent instances.
+
+ @param pevent: Optional callable object, will be called on event
+ processing (before self).
+ @type pevent: callable
+ @param kargs: This constructor is implemented as a template method
+ delegating its optionals keyworded arguments to the
+ method my_init().
+ @type kargs: dict
+ """
+ self.pevent = pevent
+ self.my_init(**kargs)
+
+ def my_init(self, **kargs):
+ """
+ This method is called from ProcessEvent.__init__(). This method is
+ empty here and must be redefined to be useful. In effect, if you
+ need to specifically initialize your subclass' instance then you
+ just have to override this method in your subclass. Then all the
+ keyworded arguments passed to ProcessEvent.__init__() will be
+ transmitted as parameters to this method. Beware you MUST pass
+ keyword arguments though.
+
+ @param kargs: optional delegated arguments from __init__().
+ @type kargs: dict
+ """
+ pass
+
+ def __call__(self, event):
+ stop_chaining = False
+ if self.pevent is not None:
+ # By default methods return None so we set as guideline
+ # that methods asking for stop chaining must explicitely
+ # return non None or non False values, otherwise the default
+ # behavior will be to accept chain call to the corresponding
+ # local method.
+ stop_chaining = self.pevent(event)
+ if not stop_chaining:
+ return _ProcessEvent.__call__(self, event)
+
+ def nested_pevent(self):
+ return self.pevent
+
+ def process_IN_Q_OVERFLOW(self, event):
+ """
+ By default this method only reports warning messages, you can overredide
+ it by subclassing ProcessEvent and implement your own
+ process_IN_Q_OVERFLOW method. The actions you can take on receiving this
+ event is either to update the variable max_queued_events in order to
+ handle more simultaneous events or to modify your code in order to
+ accomplish a better filtering diminishing the number of raised events.
+ Because this method is defined, IN_Q_OVERFLOW will never get
+ transmitted as arguments to process_default calls.
+
+ @param event: IN_Q_OVERFLOW event.
+ @type event: dict
+ """
+ log.warning('Event queue overflowed.')
+
+ def process_default(self, event):
+ """
+ Default processing event method. By default does nothing. Subclass
+ ProcessEvent and redefine this method in order to modify its behavior.
+
+ @param event: Event to be processed. Can be of any type of events but
+ IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW).
+ @type event: Event instance
+ """
+ pass
+
+
+class PrintAllEvents(ProcessEvent):
+ """
+ Dummy class used to print events strings representations. For instance this
+ class is used from command line to print all received events to stdout.
+ """
+ def my_init(self, out=None):
+ """
+ @param out: Where events will be written.
+ @type out: Object providing a valid file object interface.
+ """
+ if out is None:
+ out = sys.stdout
+ self._out = out
+
+ def process_default(self, event):
+ """
+ Writes event string representation to file object provided to
+ my_init().
+
+ @param event: Event to be processed. Can be of any type of events but
+ IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW).
+ @type event: Event instance
+ """
+ self._out.write(str(event))
+ self._out.write('\n')
+ self._out.flush()
+
+
+class ChainIfTrue(ProcessEvent):
+ """
+ Makes conditional chaining depending on the result of the nested
+ processing instance.
+ """
+ def my_init(self, func):
+ """
+ Method automatically called from base class constructor.
+ """
+ self._func = func
+
+ def process_default(self, event):
+ return not self._func(event)
+
+
+class Stats(ProcessEvent):
+ """
+ Compute and display trivial statistics about processed events.
+ """
+ def my_init(self):
+ """
+ Method automatically called from base class constructor.
+ """
+ self._start_time = time.time()
+ self._stats = {}
+ self._stats_lock = threading.Lock()
+
+ def process_default(self, event):
+ """
+ Processes |event|.
+ """
+ self._stats_lock.acquire()
+ try:
+ events = event.maskname.split('|')
+ for event_name in events:
+ count = self._stats.get(event_name, 0)
+ self._stats[event_name] = count + 1
+ finally:
+ self._stats_lock.release()
+
+ def _stats_copy(self):
+ self._stats_lock.acquire()
+ try:
+ return self._stats.copy()
+ finally:
+ self._stats_lock.release()
+
+ def __repr__(self):
+ stats = self._stats_copy()
+
+ elapsed = int(time.time() - self._start_time)
+ elapsed_str = ''
+ if elapsed < 60:
+ elapsed_str = str(elapsed) + 'sec'
+ elif 60 <= elapsed < 3600:
+ elapsed_str = '%dmn%dsec' % (elapsed / 60, elapsed % 60)
+ elif 3600 <= elapsed < 86400:
+ elapsed_str = '%dh%dmn' % (elapsed / 3600, (elapsed % 3600) / 60)
+ elif elapsed >= 86400:
+ elapsed_str = '%dd%dh' % (elapsed / 86400, (elapsed % 86400) / 3600)
+ stats['ElapsedTime'] = elapsed_str
+
+ l = []
+ for ev, value in sorted(stats.items(), key=lambda x: x[0]):
+ l.append(' %s=%s' % (output_format.field_name(ev),
+ output_format.field_value(value)))
+ s = '<%s%s >' % (output_format.class_name(self.__class__.__name__),
+ ''.join(l))
+ return s
+
+ def dump(self, filename):
+ """
+ Dumps statistics.
+
+ @param filename: filename where stats will be dumped, filename is
+ created and must not exist prior to this call.
+ @type filename: string
+ """
+ flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL
+ fd = os.open(filename, flags, 0o0600)
+ os.write(fd, bytes(self.__str__(), locale.getpreferredencoding()))
+ os.close(fd)
+
+ def __str__(self, scale=45):
+ stats = self._stats_copy()
+ if not stats:
+ return ''
+
+ m = max(stats.values())
+ unity = scale / m
+ fmt = '%%-26s%%-%ds%%s' % (len(output_format.field_value('@' * scale))
+ + 1)
+ def func(x):
+ return fmt % (output_format.field_name(x[0]),
+ output_format.field_value('@' * int(x[1] * unity)),
+ output_format.simple('%d' % x[1], 'yellow'))
+ s = '\n'.join(map(func, sorted(stats.items(), key=lambda x: x[0])))
+ return s
+
+
+class NotifierError(PyinotifyError):
+ """
+ Notifier Exception. Raised on Notifier error.
+
+ """
+ def __init__(self, err):
+ """
+ @param err: Exception string's description.
+ @type err: string
+ """
+ PyinotifyError.__init__(self, err)
+
+
+class Notifier:
+ """
+ Read notifications, process events.
+
+ """
+ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
+ threshold=0, timeout=None):
+ """
+ Initialization. read_freq, threshold and timeout parameters are used
+ when looping.
+
+ @param watch_manager: Watch Manager.
+ @type watch_manager: WatchManager instance
+ @param default_proc_fun: Default processing method. If None, a new
+ instance of PrintAllEvents will be assigned.
+ @type default_proc_fun: instance of ProcessEvent
+ @param read_freq: if read_freq == 0, events are read asap,
+ if read_freq is > 0, this thread sleeps
+ max(0, read_freq - (timeout / 1000)) seconds. But if
+ timeout is None it may be different because
+ poll is blocking waiting for something to read.
+ @type read_freq: int
+ @param threshold: File descriptor will be read only if the accumulated
+ size to read becomes >= threshold. If != 0, you likely
+ want to use it in combination with an appropriate
+ value for read_freq because without that you would
+ keep looping without really reading anything and that
+ until the amount of events to read is >= threshold.
+ At least with read_freq set you might sleep.
+ @type threshold: int
+ @param timeout: see read_freq above. If provided, it must be set in
+ milliseconds. See
+ https://docs.python.org/3/library/select.html#select.poll.poll
+ @type timeout: int
+ """
+ # Watch Manager instance
+ self._watch_manager = watch_manager
+ # File descriptor
+ self._fd = self._watch_manager.get_fd()
+ # Poll object and registration
+ self._pollobj = select.poll()
+ self._pollobj.register(self._fd, select.POLLIN)
+ # This pipe is correctely initialized and used by ThreadedNotifier
+ self._pipe = (-1, -1)
+ # Event queue
+ self._eventq = deque()
+ # System processing functor, common to all events
+ self._sys_proc_fun = _SysProcessEvent(self._watch_manager, self)
+ # Default processing method
+ self._default_proc_fun = default_proc_fun
+ if default_proc_fun is None:
+ self._default_proc_fun = PrintAllEvents()
+ # Loop parameters
+ self._read_freq = read_freq
+ self._threshold = threshold
+ self._timeout = timeout
+ # Coalesce events option
+ self._coalesce = False
+ # set of str(raw_event), only used when coalesce option is True
+ self._eventset = set()
+
+ def append_event(self, event):
+ """
+ Append a raw event to the event queue.
+
+ @param event: An event.
+ @type event: _RawEvent instance.
+ """
+ self._eventq.append(event)
+
+ def proc_fun(self):
+ return self._default_proc_fun
+
+ def coalesce_events(self, coalesce=True):
+ """
+ Coalescing events. Events are usually processed by batchs, their size
+ depend on various factors. Thus, before processing them, events received
+ from inotify are aggregated in a fifo queue. If this coalescing
+ option is enabled events are filtered based on their unicity, only
+ unique events are enqueued, doublons are discarded. An event is unique
+ when the combination of its fields (wd, mask, cookie, name) is unique
+ among events of a same batch. After a batch of events is processed any
+ events is accepted again. By default this option is disabled, you have
+ to explictly call this function to turn it on.
+
+ @param coalesce: Optional new coalescing value. True by default.
+ @type coalesce: Bool
+ """
+ self._coalesce = coalesce
+ if not coalesce:
+ self._eventset.clear()
+
+ def check_events(self, timeout=None):
+ """
+ Check for new events available to read, blocks up to timeout
+ milliseconds.
+
+ @param timeout: If specified it overrides the corresponding instance
+ attribute _timeout. timeout must be sepcified in
+ milliseconds.
+ @type timeout: int
+
+ @return: New events to read.
+ @rtype: bool
+ """
+ while True:
+ try:
+ # blocks up to 'timeout' milliseconds
+ if timeout is None:
+ timeout = self._timeout
+ ret = self._pollobj.poll(timeout)
+ except select.error as err:
+ if err.args[0] == errno.EINTR:
+ continue # interrupted, retry
+ else:
+ raise
+ else:
+ break
+
+ if not ret or (self._pipe[0] == ret[0][0]):
+ return False
+ # only one fd is polled
+ return ret[0][1] & select.POLLIN
+
+ def read_events(self):
+ """
+ Read events from device, build _RawEvents, and enqueue them.
+ """
+ buf_ = array.array('i', [0])
+ # get event queue size
+ if fcntl.ioctl(self._fd, termios.FIONREAD, buf_, 1) == -1:
+ return
+ queue_size = buf_[0]
+ if queue_size < self._threshold:
+ log.debug('(fd: %d) %d bytes available to read but threshold is '
+ 'fixed to %d bytes', self._fd, queue_size,
+ self._threshold)
+ return
+
+ try:
+ # Read content from file
+ r = os.read(self._fd, queue_size)
+ except Exception as msg:
+ raise NotifierError(msg)
+ log.debug('Event queue size: %d', queue_size)
+ rsum = 0 # counter
+ while rsum < queue_size:
+ s_size = 16
+ # Retrieve wd, mask, cookie and fname_len
+ wd, mask, cookie, fname_len = struct.unpack('iIII',
+ r[rsum:rsum+s_size])
+ # Retrieve name
+ bname, = struct.unpack('%ds' % fname_len,
+ r[rsum + s_size:rsum + s_size + fname_len])
+ # FIXME: should we explictly call sys.getdefaultencoding() here ??
+ uname = bname.decode()
+ rawevent = _RawEvent(wd, mask, cookie, uname)
+ if self._coalesce:
+ # Only enqueue new (unique) events.
+ raweventstr = str(rawevent)
+ if raweventstr not in self._eventset:
+ self._eventset.add(raweventstr)
+ self._eventq.append(rawevent)
+ else:
+ self._eventq.append(rawevent)
+ rsum += s_size + fname_len
+
+ def process_events(self):
+ """
+ Routine for processing events from queue by calling their
+ associated proccessing method (an instance of ProcessEvent).
+ It also does internal processings, to keep the system updated.
+ """
+ while self._eventq:
+ raw_event = self._eventq.popleft() # pop next event
+ if self._watch_manager.ignore_events:
+ log.debug("Event ignored: %s" % repr(raw_event))
+ continue
+ watch_ = self._watch_manager.get_watch(raw_event.wd)
+ if (watch_ is None) and not (raw_event.mask & IN_Q_OVERFLOW):
+ if not (raw_event.mask & IN_IGNORED):
+ # Not really sure how we ended up here, nor how we should
+ # handle these types of events and if it is appropriate to
+ # completly skip them (like we are doing here).
+ log.warning("Unable to retrieve Watch object associated to %s",
+ repr(raw_event))
+ continue
+ revent = self._sys_proc_fun(raw_event) # system processings
+ if watch_ and watch_.proc_fun:
+ watch_.proc_fun(revent) # user processings
+ else:
+ self._default_proc_fun(revent)
+ self._sys_proc_fun.cleanup() # remove olds MOVED_* events records
+ if self._coalesce:
+ self._eventset.clear()
+
+ def __daemonize(self, pid_file=None, stdin=os.devnull, stdout=os.devnull,
+ stderr=os.devnull):
+ """
+ pid_file: file where the pid will be written. If pid_file=None the pid
+ is written to /var/run/<sys.argv[0]|pyinotify>.pid, if
+ pid_file=False no pid_file is written.
+ stdin, stdout, stderr: files associated to common streams.
+ """
+ if pid_file is None:
+ dirname = '/var/run/'
+ basename = os.path.basename(sys.argv[0]) or 'pyinotify'
+ pid_file = os.path.join(dirname, basename + '.pid')
+
+ if pid_file != False and os.path.lexists(pid_file):
+ err = 'Cannot daemonize: pid file %s already exists.' % pid_file
+ raise NotifierError(err)
+
+ def fork_daemon():
+ # Adapted from Chad J. Schroeder's recipe
+ # @see http://code.activestate.com/recipes/278731/
+ pid = os.fork()
+ if (pid == 0):
+ # parent 2
+ os.setsid()
+ pid = os.fork()
+ if (pid == 0):
+ # child
+ os.chdir('/')
+ os.umask(0o022)
+ else:
+ # parent 2
+ os._exit(0)
+ else:
+ # parent 1
+ os._exit(0)
+
+ fd_inp = os.open(stdin, os.O_RDONLY)
+ os.dup2(fd_inp, 0)
+ fd_out = os.open(stdout, os.O_WRONLY|os.O_CREAT, 0o0600)
+ os.dup2(fd_out, 1)
+ fd_err = os.open(stderr, os.O_WRONLY|os.O_CREAT, 0o0600)
+ os.dup2(fd_err, 2)
+
+ # Detach task
+ fork_daemon()
+
+ # Write pid
+ if pid_file != False:
+ flags = os.O_WRONLY|os.O_CREAT|os.O_NOFOLLOW|os.O_EXCL
+ fd_pid = os.open(pid_file, flags, 0o0600)
+ os.write(fd_pid, bytes(str(os.getpid()) + '\n',
+ locale.getpreferredencoding()))
+ os.close(fd_pid)
+ # Register unlink function
+ atexit.register(lambda : os.unlink(pid_file))
+
+ def _sleep(self, ref_time):
+ # Only consider sleeping if read_freq is > 0
+ if self._read_freq > 0:
+ cur_time = time.time()
+ sleep_amount = self._read_freq - (cur_time - ref_time)
+ if sleep_amount > 0:
+ log.debug('Now sleeping %d seconds', sleep_amount)
+ time.sleep(sleep_amount)
+
+ def loop(self, callback=None, daemonize=False, **args):
+ """
+ Events are read only one time every min(read_freq, timeout)
+ seconds at best and only if the size to read is >= threshold.
+ After this method returns it must not be called again for the same
+ instance.
+
+ @param callback: Functor called after each event processing iteration.
+ Expects to receive the notifier object (self) as first
+ parameter. If this function returns True the loop is
+ immediately terminated otherwise the loop method keeps
+ looping.
+ @type callback: callable object or function
+ @param daemonize: This thread is daemonized if set to True.
+ @type daemonize: boolean
+ @param args: Optional and relevant only if daemonize is True. Remaining
+ keyworded arguments are directly passed to daemonize see
+ __daemonize() method. If pid_file=None or is set to a
+ pathname the caller must ensure the file does not exist
+ before this method is called otherwise an exception
+ pyinotify.NotifierError will be raised. If pid_file=False
+ it is still daemonized but the pid is not written in any
+ file.
+ @type args: various
+ """
+ if daemonize:
+ self.__daemonize(**args)
+
+ # Read and process events forever
+ while 1:
+ try:
+ self.process_events()
+ if (callback is not None) and (callback(self) is True):
+ break
+ ref_time = time.time()
+ # check_events is blocking
+ if self.check_events():
+ self._sleep(ref_time)
+ self.read_events()
+ except KeyboardInterrupt:
+ # Stop monitoring if sigint is caught (Control-C).
+ log.debug('Pyinotify stops monitoring.')
+ break
+ # Close internals
+ self.stop()
+
+ def stop(self):
+ """
+ Close inotify's instance (close its file descriptor).
+ It destroys all existing watches, pending events,...
+ This method is automatically called at the end of loop().
+ Afterward it is invalid to access this instance.
+ """
+ if self._fd is not None:
+ self._pollobj.unregister(self._fd)
+ os.close(self._fd)
+ self._fd = None
+ self._sys_proc_fun = None
+
+
+class ThreadedNotifier(threading.Thread, Notifier):
+ """
+ This notifier inherits from threading.Thread for instanciating a separate
+ thread, and also inherits from Notifier, because it is a threaded notifier.
+
+ Note that every functionality provided by this class is also provided
+ through Notifier class. Moreover Notifier should be considered first because
+ it is not threaded and could be easily daemonized.
+ """
+ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
+ threshold=0, timeout=None):
+ """
+ Initialization, initialize base classes. read_freq, threshold and
+ timeout parameters are used when looping.
+
+ @param watch_manager: Watch Manager.
+ @type watch_manager: WatchManager instance
+ @param default_proc_fun: Default processing method. See base class.
+ @type default_proc_fun: instance of ProcessEvent
+ @param read_freq: if read_freq == 0, events are read asap,
+ if read_freq is > 0, this thread sleeps
+ max(0, read_freq - (timeout / 1000)) seconds.
+ @type read_freq: int
+ @param threshold: File descriptor will be read only if the accumulated
+ size to read becomes >= threshold. If != 0, you likely
+ want to use it in combination with an appropriate
+ value set for read_freq because without that you would
+ keep looping without really reading anything and that
+ until the amount of events to read is >= threshold. At
+ least with read_freq you might sleep.
+ @type threshold: int
+ @param timeout: see read_freq above. If provided, it must be set in
+ milliseconds. See
+ https://docs.python.org/3/library/select.html#select.poll.poll
+ @type timeout: int
+ """
+ # Init threading base class
+ threading.Thread.__init__(self)
+ # Stop condition
+ self._stop_event = threading.Event()
+ # Init Notifier base class
+ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+ threshold, timeout)
+ # Create a new pipe used for thread termination
+ self._pipe = os.pipe()
+ self._pollobj.register(self._pipe[0], select.POLLIN)
+
+ def stop(self):
+ """
+ Stop notifier's loop. Stop notification. Join the thread.
+ """
+ self._stop_event.set()
+ os.write(self._pipe[1], b'stop')
+ threading.Thread.join(self)
+ Notifier.stop(self)
+ self._pollobj.unregister(self._pipe[0])
+ os.close(self._pipe[0])
+ os.close(self._pipe[1])
+
+ def loop(self):
+ """
+ Thread's main loop. Don't meant to be called by user directly.
+ Call inherited start() method instead.
+
+ Events are read only once time every min(read_freq, timeout)
+ seconds at best and only if the size of events to read is >= threshold.
+ """
+ # When the loop must be terminated .stop() is called, 'stop'
+ # is written to pipe fd so poll() returns and .check_events()
+ # returns False which make evaluate the While's stop condition
+ # ._stop_event.isSet() wich put an end to the thread's execution.
+ while not self._stop_event.isSet():
+ self.process_events()
+ ref_time = time.time()
+ if self.check_events():
+ self._sleep(ref_time)
+ self.read_events()
+
+ def run(self):
+ """
+ Start thread's loop: read and process events until the method
+ stop() is called.
+ Never call this method directly, instead call the start() method
+ inherited from threading.Thread, which then will call run() in
+ its turn.
+ """
+ self.loop()
+
+
+class AsyncNotifier(asyncore.file_dispatcher, Notifier):
+ """
+ This notifier inherits from asyncore.file_dispatcher in order to be able to
+ use pyinotify along with the asyncore framework.
+
+ """
+ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
+ threshold=0, timeout=None, channel_map=None):
+ """
+ Initializes the async notifier. The only additional parameter is
+ 'channel_map' which is the optional asyncore private map. See
+ Notifier class for the meaning of the others parameters.
+
+ """
+ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+ threshold, timeout)
+ asyncore.file_dispatcher.__init__(self, self._fd, channel_map)
+
+ def handle_read(self):
+ """
+ When asyncore tells us we can read from the fd, we proceed processing
+ events. This method can be overridden for handling a notification
+ differently.
+
+ """
+ self.read_events()
+ self.process_events()
+
+
+class TornadoAsyncNotifier(Notifier):
+ """
+ Tornado ioloop adapter.
+
+ """
+ def __init__(self, watch_manager, ioloop, callback=None,
+ default_proc_fun=None, read_freq=0, threshold=0, timeout=None,
+ channel_map=None):
+ """
+ Note that if later you must call ioloop.close() be sure to let the
+ default parameter to all_fds=False.
+
+ See example tornado_notifier.py for an example using this notifier.
+
+ @param ioloop: Tornado's IO loop.
+ @type ioloop: tornado.ioloop.IOLoop instance.
+ @param callback: Functor called at the end of each call to handle_read
+ (IOLoop's read handler). Expects to receive the
+ notifier object (self) as single parameter.
+ @type callback: callable object or function
+ """
+ self.io_loop = ioloop
+ self.handle_read_callback = callback
+ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+ threshold, timeout)
+ ioloop.add_handler(self._fd, self.handle_read, ioloop.READ)
+
+ def stop(self):
+ self.io_loop.remove_handler(self._fd)
+ Notifier.stop(self)
+
+ def handle_read(self, *args, **kwargs):
+ """
+ See comment in AsyncNotifier.
+
+ """
+ self.read_events()
+ self.process_events()
+ if self.handle_read_callback is not None:
+ self.handle_read_callback(self)
+
+
+class AsyncioNotifier(Notifier):
+ """
+
+ asyncio/trollius event loop adapter.
+
+ """
+ def __init__(self, watch_manager, loop, callback=None,
+ default_proc_fun=None, read_freq=0, threshold=0, timeout=None):
+ """
+
+ See examples/asyncio_notifier.py for an example usage.
+
+ @param loop: asyncio or trollius event loop instance.
+ @type loop: asyncio.BaseEventLoop or trollius.BaseEventLoop instance.
+ @param callback: Functor called at the end of each call to handle_read.
+ Expects to receive the notifier object (self) as
+ single parameter.
+ @type callback: callable object or function
+
+ """
+ self.loop = loop
+ self.handle_read_callback = callback
+ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
+ threshold, timeout)
+ loop.add_reader(self._fd, self.handle_read)
+
+ def stop(self):
+ self.loop.remove_reader(self._fd)
+ Notifier.stop(self)
+
+ def handle_read(self, *args, **kwargs):
+ self.read_events()
+ self.process_events()
+ if self.handle_read_callback is not None:
+ self.handle_read_callback(self)
+
+
+class Watch:
+ """
+ Represent a watch, i.e. a file or directory being watched.
+
+ """
+ __slots__ = ('wd', 'path', 'mask', 'proc_fun', 'auto_add',
+ 'exclude_filter', 'dir')
+
+ def __init__(self, wd, path, mask, proc_fun, auto_add, exclude_filter):
+ """
+ Initializations.
+
+ @param wd: Watch descriptor.
+ @type wd: int
+ @param path: Path of the file or directory being watched.
+ @type path: str
+ @param mask: Mask.
+ @type mask: int
+ @param proc_fun: Processing callable object.
+ @type proc_fun:
+ @param auto_add: Automatically add watches on new directories.
+ @type auto_add: bool
+ @param exclude_filter: Boolean function, used to exclude new
+ directories from being automatically watched.
+ See WatchManager.__init__
+ @type exclude_filter: callable object
+ """
+ self.wd = wd
+ self.path = path
+ self.mask = mask
+ self.proc_fun = proc_fun
+ self.auto_add = auto_add
+ self.exclude_filter = exclude_filter
+ self.dir = os.path.isdir(self.path)
+
+ def __repr__(self):
+ """
+ @return: String representation.
+ @rtype: str
+ """
+ s = ' '.join(['%s%s%s' % (output_format.field_name(attr),
+ output_format.punctuation('='),
+ output_format.field_value(getattr(self,
+ attr))) \
+ for attr in self.__slots__ if not attr.startswith('_')])
+
+ s = '%s%s %s %s' % (output_format.punctuation('<'),
+ output_format.class_name(self.__class__.__name__),
+ s,
+ output_format.punctuation('>'))
+ return s
+
+
+class ExcludeFilter:
+ """
+ ExcludeFilter is an exclusion filter.
+ """
+ def __init__(self, arg_lst):
+ """
+ Examples:
+ ef1 = ExcludeFilter(["/etc/rc.*", "/etc/hostname"])
+ ef2 = ExcludeFilter("/my/path/exclude.lst")
+ Where exclude.lst contains:
+ /etc/rc.*
+ /etc/hostname
+
+ Note: it is not possible to exclude a file if its encapsulating
+ directory is itself watched. See this issue for more details
+ https://github.com/seb-m/pyinotify/issues/31
+
+ @param arg_lst: is either a list of patterns or a filename from which
+ patterns will be loaded.
+ @type arg_lst: list of str or str
+ """
+ if isinstance(arg_lst, str):
+ lst = self._load_patterns_from_file(arg_lst)
+ elif isinstance(arg_lst, list):
+ lst = arg_lst
+ else:
+ raise TypeError
+
+ self._lregex = []
+ for regex in lst:
+ self._lregex.append(re.compile(regex, re.UNICODE))
+
+ def _load_patterns_from_file(self, filename):
+ lst = []
+ with open(filename, 'r') as file_obj:
+ for line in file_obj.readlines():
+ # Trim leading an trailing whitespaces
+ pattern = line.strip()
+ if not pattern or pattern.startswith('#'):
+ continue
+ lst.append(pattern)
+ return lst
+
+ def _match(self, regex, path):
+ return regex.match(path) is not None
+
+ def __call__(self, path):
+ """
+ @param path: Path to match against provided regexps.
+ @type path: str
+ @return: Return True if path has been matched and should
+ be excluded, False otherwise.
+ @rtype: bool
+ """
+ for regex in self._lregex:
+ if self._match(regex, path):
+ return True
+ return False
+
+
+class WatchManagerError(Exception):
+ """
+ WatchManager Exception. Raised on error encountered on watches
+ operations.
+ """
+ def __init__(self, msg, wmd):
+ """
+ @param msg: Exception string's description.
+ @type msg: string
+ @param wmd: This dictionary contains the wd assigned to paths of the
+ same call for which watches were successfully added.
+ @type wmd: dict
+ """
+ self.wmd = wmd
+ Exception.__init__(self, msg)
+
+
+class WatchManager:
+ """
+ Provide operations for watching files and directories. Its internal
+ dictionary is used to reference watched items. When used inside
+ threaded code, one must instanciate as many WatchManager instances as
+ there are ThreadedNotifier instances.
+
+ """
+ def __init__(self, exclude_filter=lambda path: False):
+ """
+ Initialization: init inotify, init watch manager dictionary.
+ Raise OSError if initialization fails, raise InotifyBindingNotFoundError
+ if no inotify binding was found (through ctypes or from direct access to
+ syscalls).
+
+ @param exclude_filter: boolean function, returns True if current
+ path must be excluded from being watched.
+ Convenient for providing a common exclusion
+ filter for every call to add_watch.
+ @type exclude_filter: callable object
+ """
+ self._ignore_events = False
+ self._exclude_filter = exclude_filter
+ self._wmd = {} # watch dict key: watch descriptor, value: watch
+
+ self._inotify_wrapper = INotifyWrapper.create()
+ if self._inotify_wrapper is None:
+ raise InotifyBindingNotFoundError()
+
+ self._fd = self._inotify_wrapper.inotify_init() # file descriptor
+ if self._fd < 0:
+ err = 'Cannot initialize new instance of inotify, %s'
+ raise OSError(err % self._inotify_wrapper.str_errno())
+
+ def close(self):
+ """
+ Close inotify's file descriptor, this action will also automatically
+ remove (i.e. stop watching) all its associated watch descriptors.
+ After a call to this method the WatchManager's instance become useless
+ and cannot be reused, a new instance must then be instanciated. It
+ makes sense to call this method in few situations for instance if
+ several independant WatchManager must be instanciated or if all watches
+ must be removed and no other watches need to be added.
+ """
+ os.close(self._fd)
+
+ def get_fd(self):
+ """
+ Return assigned inotify's file descriptor.
+
+ @return: File descriptor.
+ @rtype: int
+ """
+ return self._fd
+
+ def get_watch(self, wd):
+ """
+ Get watch from provided watch descriptor wd.
+
+ @param wd: Watch descriptor.
+ @type wd: int
+ """
+ return self._wmd.get(wd)
+
+ def del_watch(self, wd):
+ """
+ Remove watch entry associated to watch descriptor wd.
+
+ @param wd: Watch descriptor.
+ @type wd: int
+ """
+ try:
+ del self._wmd[wd]
+ except KeyError as err:
+ log.error('Cannot delete unknown watch descriptor %s' % str(err))
+
+ @property
+ def watches(self):
+ """
+ Get a reference on the internal watch manager dictionary.
+
+ @return: Internal watch manager dictionary.
+ @rtype: dict
+ """
+ return self._wmd
+
+ def __format_path(self, path):
+ """
+ Format path to its internal (stored in watch manager) representation.
+ """
+ # path must be a unicode string (str) and is just normalized.
+ return os.path.normpath(path)
+
+ def __add_watch(self, path, mask, proc_fun, auto_add, exclude_filter):
+ """
+ Add a watch on path, build a Watch object and insert it in the
+ watch manager dictionary. Return the wd value.
+ """
+ path = self.__format_path(path)
+ if auto_add and not mask & IN_CREATE:
+ mask |= IN_CREATE
+ wd = self._inotify_wrapper.inotify_add_watch(self._fd, path, mask)
+ if wd < 0:
+ return wd
+ watch = Watch(wd=wd, path=path, mask=mask, proc_fun=proc_fun,
+ auto_add=auto_add, exclude_filter=exclude_filter)
+ # wd are _always_ indexed with their original unicode paths in wmd.
+ self._wmd[wd] = watch
+ log.debug('New %s', watch)
+ return wd
+
+ def __glob(self, path, do_glob):
+ if do_glob:
+ return glob.iglob(path)
+ else:
+ return [path]
+
+ def add_watch(self, path, mask, proc_fun=None, rec=False,
+ auto_add=False, do_glob=False, quiet=True,
+ exclude_filter=None):
+ """
+ Add watch(s) on the provided |path|(s) with associated |mask| flag
+ value and optionally with a processing |proc_fun| function and
+ recursive flag |rec| set to True.
+ All |path| components _must_ be str (i.e. unicode) objects.
+ If |path| is already watched it is ignored, but if it is called with
+ option rec=True a watch is put on each one of its not-watched
+ subdirectory.
+
+ @param path: Path to watch, the path can either be a file or a
+ directory. Also accepts a sequence (list) of paths.
+ @type path: string or list of strings
+ @param mask: Bitmask of events.
+ @type mask: int
+ @param proc_fun: Processing object.
+ @type proc_fun: function or ProcessEvent instance or instance of
+ one of its subclasses or callable object.
+ @param rec: Recursively add watches from path on all its
+ subdirectories, set to False by default (doesn't
+ follows symlinks in any case).
+ @type rec: bool
+ @param auto_add: Automatically add watches on newly created
+ directories in watched parent |path| directory.
+ If |auto_add| is True, IN_CREATE is ored with |mask|
+ when the watch is added.
+ @type auto_add: bool
+ @param do_glob: Do globbing on pathname (see standard globbing
+ module for more informations).
+ @type do_glob: bool
+ @param quiet: if False raises a WatchManagerError exception on
+ error. See example not_quiet.py.
+ @type quiet: bool
+ @param exclude_filter: predicate (boolean function), which returns
+ True if the current path must be excluded
+ from being watched. This argument has
+ precedence over exclude_filter passed to
+ the class' constructor.
+ @type exclude_filter: callable object
+ @return: dict of paths associated to watch descriptors. A wd value
+ is positive if the watch was added sucessfully, otherwise
+ the value is negative. If the path was invalid or was already
+ watched it is not included into this returned dictionary.
+ @rtype: dict of {str: int}
+ """
+ ret_ = {} # return {path: wd, ...}
+
+ if exclude_filter is None:
+ exclude_filter = self._exclude_filter
+
+ # normalize args as list elements
+ for npath in self.__format_param(path):
+ # Require that path be a unicode string
+ if not isinstance(npath, str):
+ ret_[path] = -3
+ continue
+
+ # unix pathname pattern expansion
+ for apath in self.__glob(npath, do_glob):
+ # recursively list subdirs according to rec param
+ for rpath in self.__walk_rec(apath, rec):
+ if not exclude_filter(rpath):
+ wd = ret_[rpath] = self.__add_watch(rpath, mask,
+ proc_fun,
+ auto_add,
+ exclude_filter)
+ if wd < 0:
+ err = ('add_watch: cannot watch %s WD=%d, %s' % \
+ (rpath, wd,
+ self._inotify_wrapper.str_errno()))
+ if quiet:
+ log.error(err)
+ else:
+ raise WatchManagerError(err, ret_)
+ else:
+ # Let's say -2 means 'explicitely excluded
+ # from watching'.
+ ret_[rpath] = -2
+ return ret_
+
+ def __get_sub_rec(self, lpath):
+ """
+ Get every wd from self._wmd if its path is under the path of
+ one (at least) of those in lpath. Doesn't follow symlinks.
+
+ @param lpath: list of watch descriptor
+ @type lpath: list of int
+ @return: list of watch descriptor
+ @rtype: list of int
+ """
+ for d in lpath:
+ root = self.get_path(d)
+ if root is not None:
+ # always keep root
+ yield d
+ else:
+ # if invalid
+ continue
+
+ # nothing else to expect
+ if not os.path.isdir(root):
+ continue
+
+ # normalization
+ root = os.path.normpath(root)
+ # recursion
+ lend = len(root)
+ for iwd in self._wmd.items():
+ cur = iwd[1].path
+ pref = os.path.commonprefix([root, cur])
+ if root == os.sep or (len(pref) == lend and \
+ len(cur) > lend and \
+ cur[lend] == os.sep):
+ yield iwd[1].wd
+
+ def update_watch(self, wd, mask=None, proc_fun=None, rec=False,
+ auto_add=False, quiet=True):
+ """
+ Update existing watch descriptors |wd|. The |mask| value, the
+ processing object |proc_fun|, the recursive param |rec| and the
+ |auto_add| and |quiet| flags can all be updated.
+
+ @param wd: Watch Descriptor to update. Also accepts a list of
+ watch descriptors.
+ @type wd: int or list of int
+ @param mask: Optional new bitmask of events.
+ @type mask: int
+ @param proc_fun: Optional new processing function.
+ @type proc_fun: function or ProcessEvent instance or instance of
+ one of its subclasses or callable object.
+ @param rec: Optionally adds watches recursively on all
+ subdirectories contained into |wd| directory.
+ @type rec: bool
+ @param auto_add: Automatically adds watches on newly created
+ directories in the watch's path corresponding to |wd|.
+ If |auto_add| is True, IN_CREATE is ored with |mask|
+ when the watch is updated.
+ @type auto_add: bool
+ @param quiet: If False raises a WatchManagerError exception on
+ error. See example not_quiet.py
+ @type quiet: bool
+ @return: dict of watch descriptors associated to booleans values.
+ True if the corresponding wd has been successfully
+ updated, False otherwise.
+ @rtype: dict of {int: bool}
+ """
+ lwd = self.__format_param(wd)
+ if rec:
+ lwd = self.__get_sub_rec(lwd)
+
+ ret_ = {} # return {wd: bool, ...}
+ for awd in lwd:
+ apath = self.get_path(awd)
+ if not apath or awd < 0:
+ err = 'update_watch: invalid WD=%d' % awd
+ if quiet:
+ log.error(err)
+ continue
+ raise WatchManagerError(err, ret_)
+
+ if mask:
+ wd_ = self._inotify_wrapper.inotify_add_watch(self._fd, apath,
+ mask)
+ if wd_ < 0:
+ ret_[awd] = False
+ err = ('update_watch: cannot update %s WD=%d, %s' % \
+ (apath, wd_, self._inotify_wrapper.str_errno()))
+ if quiet:
+ log.error(err)
+ continue
+ raise WatchManagerError(err, ret_)
+
+ assert(awd == wd_)
+
+ if proc_fun or auto_add:
+ watch_ = self._wmd[awd]
+
+ if proc_fun:
+ watch_.proc_fun = proc_fun
+
+ if auto_add:
+ watch_.auto_add = auto_add
+
+ ret_[awd] = True
+ log.debug('Updated watch - %s', self._wmd[awd])
+ return ret_
+
+ def __format_param(self, param):
+ """
+ @param param: Parameter.
+ @type param: string or int
+ @return: wrap param.
+ @rtype: list of type(param)
+ """
+ if isinstance(param, list):
+ for p_ in param:
+ yield p_
+ else:
+ yield param
+
+ def get_wd(self, path):
+ """
+ Returns the watch descriptor associated to path. This method
+ presents a prohibitive cost, always prefer to keep the WD
+ returned by add_watch(). If the path is unknown it returns None.
+
+ @param path: Path.
+ @type path: str
+ @return: WD or None.
+ @rtype: int or None
+ """
+ path = self.__format_path(path)
+ for iwd in self._wmd.items():
+ if iwd[1].path == path:
+ return iwd[0]
+
+ def get_path(self, wd):
+ """
+ Returns the path associated to WD, if WD is unknown it returns None.
+
+ @param wd: Watch descriptor.
+ @type wd: int
+ @return: Path or None.
+ @rtype: string or None
+ """
+ watch_ = self._wmd.get(wd)
+ if watch_ is not None:
+ return watch_.path
+
+ def __walk_rec(self, top, rec):
+ """
+ Yields each subdirectories of top, doesn't follow symlinks.
+ If rec is false, only yield top.
+
+ @param top: root directory.
+ @type top: string
+ @param rec: recursive flag.
+ @type rec: bool
+ @return: path of one subdirectory.
+ @rtype: string
+ """
+ if not rec or os.path.islink(top) or not os.path.isdir(top):
+ yield top
+ else:
+ for root, dirs, files in os.walk(top):
+ yield root
+
+ def rm_watch(self, wd, rec=False, quiet=True):
+ """
+ Removes watch(s).
+
+ @param wd: Watch Descriptor of the file or directory to unwatch.
+ Also accepts a list of WDs.
+ @type wd: int or list of int.
+ @param rec: Recursively removes watches on every already watched
+ subdirectories and subfiles.
+ @type rec: bool
+ @param quiet: If False raises a WatchManagerError exception on
+ error. See example not_quiet.py
+ @type quiet: bool
+ @return: dict of watch descriptors associated to booleans values.
+ True if the corresponding wd has been successfully
+ removed, False otherwise.
+ @rtype: dict of {int: bool}
+ """
+ lwd = self.__format_param(wd)
+ if rec:
+ lwd = self.__get_sub_rec(lwd)
+
+ ret_ = {} # return {wd: bool, ...}
+ for awd in lwd:
+ # remove watch
+ wd_ = self._inotify_wrapper.inotify_rm_watch(self._fd, awd)
+ if wd_ < 0:
+ ret_[awd] = False
+ err = ('rm_watch: cannot remove WD=%d, %s' % \
+ (awd, self._inotify_wrapper.str_errno()))
+ if quiet:
+ log.error(err)
+ continue
+ raise WatchManagerError(err, ret_)
+
+ # Remove watch from our dictionary
+ if awd in self._wmd:
+ del self._wmd[awd]
+ ret_[awd] = True
+ log.debug('Watch WD=%d (%s) removed', awd, self.get_path(awd))
+ return ret_
+
+
+ def watch_transient_file(self, filename, mask, proc_class):
+ """
+ Watch a transient file, which will be created and deleted frequently
+ over time (e.g. pid file).
+
+ @attention: Currently under the call to this function it is not
+ possible to correctly watch the events triggered into the same
+ base directory than the directory where is located this watched
+ transient file. For instance it would be wrong to make these
+ two successive calls: wm.watch_transient_file('/var/run/foo.pid', ...)
+ and wm.add_watch('/var/run/', ...)
+
+ @param filename: Filename.
+ @type filename: string
+ @param mask: Bitmask of events, should contain IN_CREATE and IN_DELETE.
+ @type mask: int
+ @param proc_class: ProcessEvent (or of one of its subclass), beware of
+ accepting a ProcessEvent's instance as argument into
+ __init__, see transient_file.py example for more
+ details.
+ @type proc_class: ProcessEvent's instance or of one of its subclasses.
+ @return: Same as add_watch().
+ @rtype: Same as add_watch().
+ """
+ dirname = os.path.dirname(filename)
+ if dirname == '':
+ return {} # Maintains coherence with add_watch()
+ basename = os.path.basename(filename)
+ # Assuming we are watching at least for IN_CREATE and IN_DELETE
+ mask |= IN_CREATE | IN_DELETE
+
+ def cmp_name(event):
+ if getattr(event, 'name') is None:
+ return False
+ return basename == event.name
+ return self.add_watch(dirname, mask,
+ proc_fun=proc_class(ChainIfTrue(func=cmp_name)),
+ rec=False,
+ auto_add=False, do_glob=False,
+ exclude_filter=lambda path: False)
+
+ def get_ignore_events(self):
+ return self._ignore_events
+
+ def set_ignore_events(self, nval):
+ self._ignore_events = nval
+
+ ignore_events = property(get_ignore_events, set_ignore_events,
+ "Make watch manager ignoring new events.")
+
+
+class RawOutputFormat:
+ """
+ Format string representations.
+ """
+ def __init__(self, format=None):
+ self.format = format or {}
+
+ def simple(self, s, attribute):
+ if not isinstance(s, str):
+ s = str(s)
+ return (self.format.get(attribute, '') + s +
+ self.format.get('normal', ''))
+
+ def punctuation(self, s):
+ """Punctuation color."""
+ return self.simple(s, 'normal')
+
+ def field_value(self, s):
+ """Field value color."""
+ return self.simple(s, 'purple')
+
+ def field_name(self, s):
+ """Field name color."""
+ return self.simple(s, 'blue')
+
+ def class_name(self, s):
+ """Class name color."""
+ return self.format.get('red', '') + self.simple(s, 'bold')
+
+output_format = RawOutputFormat()
+
+class ColoredOutputFormat(RawOutputFormat):
+ """
+ Format colored string representations.
+ """
+ def __init__(self):
+ f = {'normal': '\033[0m',
+ 'black': '\033[30m',
+ 'red': '\033[31m',
+ 'green': '\033[32m',
+ 'yellow': '\033[33m',
+ 'blue': '\033[34m',
+ 'purple': '\033[35m',
+ 'cyan': '\033[36m',
+ 'bold': '\033[1m',
+ 'uline': '\033[4m',
+ 'blink': '\033[5m',
+ 'invert': '\033[7m'}
+ RawOutputFormat.__init__(self, f)
+
+
+def compatibility_mode():
+ """
+ Use this function to turn on the compatibility mode. The compatibility
+ mode is used to improve compatibility with Pyinotify 0.7.1 (or older)
+ programs. The compatibility mode provides additional variables 'is_dir',
+ 'event_name', 'EventsCodes.IN_*' and 'EventsCodes.ALL_EVENTS' as
+ Pyinotify 0.7.1 provided. Do not call this function from new programs!!
+ Especially if there are developped for Pyinotify >= 0.8.x.
+ """
+ setattr(EventsCodes, 'ALL_EVENTS', ALL_EVENTS)
+ for evname in globals():
+ if evname.startswith('IN_'):
+ setattr(EventsCodes, evname, globals()[evname])
+ global COMPATIBILITY_MODE
+ COMPATIBILITY_MODE = True
+
+
+def command_line():
+ """
+ By default the watched path is '/tmp' and all types of events are
+ monitored. Events monitoring serves forever, type c^c to stop it.
+ """
+ from optparse import OptionParser
+
+ usage = "usage: %prog [options] [path1] [path2] [pathn]"
+
+ parser = OptionParser(usage=usage)
+ parser.add_option("-v", "--verbose", action="store_true",
+ dest="verbose", help="Verbose mode")
+ parser.add_option("-r", "--recursive", action="store_true",
+ dest="recursive",
+ help="Add watches recursively on paths")
+ parser.add_option("-a", "--auto_add", action="store_true",
+ dest="auto_add",
+ help="Automatically add watches on new directories")
+ parser.add_option("-g", "--glob", action="store_true",
+ dest="glob",
+ help="Treat paths as globs")
+ parser.add_option("-e", "--events-list", metavar="EVENT[,...]",
+ dest="events_list",
+ help=("A comma-separated list of events to watch for - "
+ "see the documentation for valid options (defaults"
+ " to everything)"))
+ parser.add_option("-s", "--stats", action="store_true",
+ dest="stats",
+ help="Display dummy statistics")
+ parser.add_option("-V", "--version", action="store_true",
+ dest="version", help="Pyinotify version")
+ parser.add_option("-f", "--raw-format", action="store_true",
+ dest="raw_format",
+ help="Disable enhanced output format.")
+ parser.add_option("-c", "--command", action="store",
+ dest="command",
+ help="Shell command to run upon event")
+
+ (options, args) = parser.parse_args()
+
+ if options.verbose:
+ log.setLevel(10)
+
+ if options.version:
+ print(__version__)
+
+ if not options.raw_format:
+ global output_format
+ output_format = ColoredOutputFormat()
+
+ if len(args) < 1:
+ path = '/tmp' # default watched path
+ else:
+ path = args
+
+ # watch manager instance
+ wm = WatchManager()
+ # notifier instance and init
+ if options.stats:
+ notifier = Notifier(wm, default_proc_fun=Stats(), read_freq=5)
+ else:
+ notifier = Notifier(wm, default_proc_fun=PrintAllEvents())
+
+ # What mask to apply
+ mask = 0
+ if options.events_list:
+ events_list = options.events_list.split(',')
+ for ev in events_list:
+ evcode = EventsCodes.ALL_FLAGS.get(ev, 0)
+ if evcode:
+ mask |= evcode
+ else:
+ parser.error("The event '%s' specified with option -e"
+ " is not valid" % ev)
+ else:
+ mask = ALL_EVENTS
+
+ # stats
+ cb_fun = None
+ if options.stats:
+ def cb(s):
+ sys.stdout.write(repr(s.proc_fun()))
+ sys.stdout.write('\n')
+ sys.stdout.write(str(s.proc_fun()))
+ sys.stdout.write('\n')
+ sys.stdout.flush()
+ cb_fun = cb
+
+ # External command
+ if options.command:
+ def cb(s):
+ subprocess.Popen(options.command, shell=True)
+ cb_fun = cb
+
+ log.debug('Start monitoring %s, (press c^c to halt pyinotify)' % path)
+
+ wm.add_watch(path, mask, rec=options.recursive, auto_add=options.auto_add, do_glob=options.glob)
+ # Loop forever (until sigint signal get caught)
+ notifier.loop(callback=cb_fun)
+
+
+if __name__ == '__main__':
+ command_line()
diff --git a/poky/bitbake/lib/simplediff/LICENSE b/poky/bitbake/lib/simplediff/LICENSE
new file mode 100644
index 000000000..8242dde97
--- /dev/null
+++ b/poky/bitbake/lib/simplediff/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2008 - 2013 Paul Butler and contributors
+
+This sofware may be used under a zlib/libpng-style license:
+
+This software is provided 'as-is', without any express or implied warranty. In
+no event will the authors be held liable for any damages arising from the use
+of this software.
+
+Permission is granted to anyone to use this software for any purpose, including
+commercial applications, and to alter it and redistribute it freely, subject to
+the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim
+that you wrote the original software. If you use this software in a product, an
+acknowledgment in the product documentation would be appreciated but is not
+required.
+
+2. Altered source versions must be plainly marked as such, and must not be
+misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.
+
diff --git a/poky/bitbake/lib/simplediff/__init__.py b/poky/bitbake/lib/simplediff/__init__.py
new file mode 100644
index 000000000..57ee3c5c4
--- /dev/null
+++ b/poky/bitbake/lib/simplediff/__init__.py
@@ -0,0 +1,198 @@
+'''
+Simple Diff for Python version 1.0
+
+Annotate two versions of a list with the values that have been
+changed between the versions, similar to unix's `diff` but with
+a dead-simple Python interface.
+
+(C) Paul Butler 2008-2012 <http://www.paulbutler.org/>
+May be used and distributed under the zlib/libpng license
+<http://www.opensource.org/licenses/zlib-license.php>
+'''
+
+__all__ = ['diff', 'string_diff', 'html_diff']
+__version__ = '1.0'
+
+
+def diff(old, new):
+ '''
+ Find the differences between two lists. Returns a list of pairs, where the
+ first value is in ['+','-','='] and represents an insertion, deletion, or
+ no change for that list. The second value of the pair is the list
+ of elements.
+
+ Params:
+ old the old list of immutable, comparable values (ie. a list
+ of strings)
+ new the new list of immutable, comparable values
+
+ Returns:
+ A list of pairs, with the first part of the pair being one of three
+ strings ('-', '+', '=') and the second part being a list of values from
+ the original old and/or new lists. The first part of the pair
+ corresponds to whether the list of values is a deletion, insertion, or
+ unchanged, respectively.
+
+ Examples:
+ >>> diff([1,2,3,4],[1,3,4])
+ [('=', [1]), ('-', [2]), ('=', [3, 4])]
+
+ >>> diff([1,2,3,4],[2,3,4,1])
+ [('-', [1]), ('=', [2, 3, 4]), ('+', [1])]
+
+ >>> diff('The quick brown fox jumps over the lazy dog'.split(),
+ ... 'The slow blue cheese drips over the lazy carrot'.split())
+ ... # doctest: +NORMALIZE_WHITESPACE
+ [('=', ['The']),
+ ('-', ['quick', 'brown', 'fox', 'jumps']),
+ ('+', ['slow', 'blue', 'cheese', 'drips']),
+ ('=', ['over', 'the', 'lazy']),
+ ('-', ['dog']),
+ ('+', ['carrot'])]
+
+ '''
+
+ # Create a map from old values to their indices
+ old_index_map = dict()
+ for i, val in enumerate(old):
+ old_index_map.setdefault(val,list()).append(i)
+
+ # Find the largest substring common to old and new.
+ # We use a dynamic programming approach here.
+ #
+ # We iterate over each value in the `new` list, calling the
+ # index `inew`. At each iteration, `overlap[i]` is the
+ # length of the largest suffix of `old[:i]` equal to a suffix
+ # of `new[:inew]` (or unset when `old[i]` != `new[inew]`).
+ #
+ # At each stage of iteration, the new `overlap` (called
+ # `_overlap` until the original `overlap` is no longer needed)
+ # is built from the old one.
+ #
+ # If the length of overlap exceeds the largest substring
+ # seen so far (`sub_length`), we update the largest substring
+ # to the overlapping strings.
+
+ overlap = dict()
+ # `sub_start_old` is the index of the beginning of the largest overlapping
+ # substring in the old list. `sub_start_new` is the index of the beginning
+ # of the same substring in the new list. `sub_length` is the length that
+ # overlaps in both.
+ # These track the largest overlapping substring seen so far, so naturally
+ # we start with a 0-length substring.
+ sub_start_old = 0
+ sub_start_new = 0
+ sub_length = 0
+
+ for inew, val in enumerate(new):
+ _overlap = dict()
+ for iold in old_index_map.get(val,list()):
+ # now we are considering all values of iold such that
+ # `old[iold] == new[inew]`.
+ _overlap[iold] = (iold and overlap.get(iold - 1, 0)) + 1
+ if(_overlap[iold] > sub_length):
+ # this is the largest substring seen so far, so store its
+ # indices
+ sub_length = _overlap[iold]
+ sub_start_old = iold - sub_length + 1
+ sub_start_new = inew - sub_length + 1
+ overlap = _overlap
+
+ if sub_length == 0:
+ # If no common substring is found, we return an insert and delete...
+ return (old and [('-', old)] or []) + (new and [('+', new)] or [])
+ else:
+ # ...otherwise, the common substring is unchanged and we recursively
+ # diff the text before and after that substring
+ return diff(old[ : sub_start_old], new[ : sub_start_new]) + \
+ [('=', new[sub_start_new : sub_start_new + sub_length])] + \
+ diff(old[sub_start_old + sub_length : ],
+ new[sub_start_new + sub_length : ])
+
+
+def string_diff(old, new):
+ '''
+ Returns the difference between the old and new strings when split on
+ whitespace. Considers punctuation a part of the word
+
+ This function is intended as an example; you'll probably want
+ a more sophisticated wrapper in practice.
+
+ Params:
+ old the old string
+ new the new string
+
+ Returns:
+ the output of `diff` on the two strings after splitting them
+ on whitespace (a list of change instructions; see the docstring
+ of `diff`)
+
+ Examples:
+ >>> string_diff('The quick brown fox', 'The fast blue fox')
+ ... # doctest: +NORMALIZE_WHITESPACE
+ [('=', ['The']),
+ ('-', ['quick', 'brown']),
+ ('+', ['fast', 'blue']),
+ ('=', ['fox'])]
+
+ '''
+ return diff(old.split(), new.split())
+
+
+def html_diff(old, new):
+ '''
+ Returns the difference between two strings (as in stringDiff) in
+ HTML format. HTML code in the strings is NOT escaped, so you
+ will get weird results if the strings contain HTML.
+
+ This function is intended as an example; you'll probably want
+ a more sophisticated wrapper in practice.
+
+ Params:
+ old the old string
+ new the new string
+
+ Returns:
+ the output of the diff expressed with HTML <ins> and <del>
+ tags.
+
+ Examples:
+ >>> html_diff('The quick brown fox', 'The fast blue fox')
+ 'The <del>quick brown</del> <ins>fast blue</ins> fox'
+ '''
+ con = {'=': (lambda x: x),
+ '+': (lambda x: "<ins>" + x + "</ins>"),
+ '-': (lambda x: "<del>" + x + "</del>")}
+ return " ".join([(con[a])(" ".join(b)) for a, b in string_diff(old, new)])
+
+
+def check_diff(old, new):
+ '''
+ This tests that diffs returned by `diff` are valid. You probably won't
+ want to use this function, but it's provided for documentation and
+ testing.
+
+ A diff should satisfy the property that the old input is equal to the
+ elements of the result annotated with '-' or '=' concatenated together.
+ Likewise, the new input is equal to the elements of the result annotated
+ with '+' or '=' concatenated together. This function compares `old`,
+ `new`, and the results of `diff(old, new)` to ensure this is true.
+
+ Tests:
+ >>> check_diff('ABCBA', 'CBABA')
+ >>> check_diff('Foobarbaz', 'Foobarbaz')
+ >>> check_diff('Foobarbaz', 'Boobazbam')
+ >>> check_diff('The quick brown fox', 'Some quick brown car')
+ >>> check_diff('A thick red book', 'A quick blue book')
+ >>> check_diff('dafhjkdashfkhasfjsdafdasfsda', 'asdfaskjfhksahkfjsdha')
+ >>> check_diff('88288822828828288282828', '88288882882828282882828')
+ >>> check_diff('1234567890', '24689')
+ '''
+ old = list(old)
+ new = list(new)
+ result = diff(old, new)
+ _old = [val for (a, vals) in result if (a in '=-') for val in vals]
+ assert old == _old, 'Expected %s, got %s' % (old, _old)
+ _new = [val for (a, vals) in result if (a in '=+') for val in vals]
+ assert new == _new, 'Expected %s, got %s' % (new, _new)
+
diff --git a/poky/bitbake/lib/toaster/__init__.py b/poky/bitbake/lib/toaster/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcollector/__init__.py b/poky/bitbake/lib/toaster/bldcollector/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcollector/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcollector/admin.py b/poky/bitbake/lib/toaster/bldcollector/admin.py
new file mode 100644
index 000000000..1f2e07f50
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcollector/admin.py
@@ -0,0 +1,33 @@
+from django.contrib import admin
+from orm.models import BitbakeVersion, Release, ToasterSetting, Layer_Version
+from django import forms
+import django.db.models as models
+
+
+class BitbakeVersionAdmin(admin.ModelAdmin):
+
+ # we override the formfield for db URLField
+ # because of broken URL validation
+
+ def formfield_for_dbfield(self, db_field, **kwargs):
+ if isinstance(db_field, models.fields.URLField):
+ return forms.fields.CharField()
+ return super(BitbakeVersionAdmin, self).formfield_for_dbfield(
+ db_field, **kwargs)
+
+
+class ReleaseAdmin(admin.ModelAdmin):
+ pass
+
+
+class ToasterSettingAdmin(admin.ModelAdmin):
+ pass
+
+
+class LayerVersionsAdmin(admin.ModelAdmin):
+ pass
+
+admin.site.register(Layer_Version, LayerVersionsAdmin)
+admin.site.register(BitbakeVersion, BitbakeVersionAdmin)
+admin.site.register(Release, ReleaseAdmin)
+admin.site.register(ToasterSetting, ToasterSettingAdmin)
diff --git a/poky/bitbake/lib/toaster/bldcollector/urls.py b/poky/bitbake/lib/toaster/bldcollector/urls.py
new file mode 100644
index 000000000..888175d0a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcollector/urls.py
@@ -0,0 +1,27 @@
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+from django.conf.urls import include, url
+
+import bldcollector.views
+
+urlpatterns = [
+ # landing point for pushing a bitbake_eventlog.json file to this toaster instace
+ url(r'^eventfile$', bldcollector.views.eventfile, name='eventfile'),
+]
diff --git a/poky/bitbake/lib/toaster/bldcollector/views.py b/poky/bitbake/lib/toaster/bldcollector/views.py
new file mode 100644
index 000000000..f32fa4d22
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcollector/views.py
@@ -0,0 +1,62 @@
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.views.decorators.cache import cache_control
+from django.core.urlresolvers import reverse
+from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
+from django.http import HttpResponseBadRequest, HttpResponse
+from django.utils import timezone
+from django.utils.html import escape
+from datetime import timedelta
+from django.utils import formats
+from toastergui.templatetags.projecttags import json as jsonfilter
+import json
+import os
+import tempfile
+import subprocess
+import toastermain
+from django.views.decorators.csrf import csrf_exempt
+
+
+@csrf_exempt
+def eventfile(request):
+ """ Receives a file by POST, and runs toaster-eventreply on this file """
+ if request.method != "POST":
+ return HttpResponseBadRequest("This API only accepts POST requests. Post a file with:\n\ncurl -F eventlog=@bitbake_eventlog.json %s\n" % request.build_absolute_uri(reverse('eventfile')), content_type="text/plain;utf8")
+
+ # write temporary file
+ (handle, abstemppath) = tempfile.mkstemp(dir="/tmp/")
+ with os.fdopen(handle, "w") as tmpfile:
+ for chunk in request.FILES['eventlog'].chunks():
+ tmpfile.write(chunk)
+ tmpfile.close()
+
+ # compute the path to "bitbake/bin/toaster-eventreplay"
+ from os.path import dirname as DN
+ import_script = os.path.join(DN(DN(DN(DN(os.path.abspath(__file__))))), "bin/toaster-eventreplay")
+ if not os.path.exists(import_script):
+ raise Exception("script missing %s" % import_script)
+ scriptenv = os.environ.copy()
+ scriptenv["DATABASE_URL"] = toastermain.settings.getDATABASE_URL()
+
+ # run the data loading process and return the results
+ importer = subprocess.Popen([import_script, abstemppath], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=scriptenv)
+ (out, err) = importer.communicate()
+ if importer.returncode == 0:
+ os.remove(abstemppath)
+ return HttpResponse("== Retval %d\n== STDOUT\n%s\n\n== STDERR\n%s" % (importer.returncode, out, err), content_type="text/plain;utf8")
diff --git a/poky/bitbake/lib/toaster/bldcontrol/__init__.py b/poky/bitbake/lib/toaster/bldcontrol/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcontrol/admin.py b/poky/bitbake/lib/toaster/bldcontrol/admin.py
new file mode 100644
index 000000000..fcbe5f593
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/admin.py
@@ -0,0 +1,8 @@
+from django.contrib import admin
+from django.contrib.admin.filters import RelatedFieldListFilter
+from .models import BuildEnvironment
+
+class BuildEnvironmentAdmin(admin.ModelAdmin):
+ pass
+
+admin.site.register(BuildEnvironment, BuildEnvironmentAdmin)
diff --git a/poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py b/poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py
new file mode 100644
index 000000000..5195600d9
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/bbcontroller.py
@@ -0,0 +1,142 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import os
+import sys
+import re
+from django.db import transaction
+from django.db.models import Q
+from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake
+
+# load Bitbake components
+path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
+sys.path.insert(0, path)
+
+class BitbakeController(object):
+ """ This is the basic class that controlls a bitbake server.
+ It is outside the scope of this class on how the server is started and aquired
+ """
+
+ def __init__(self, be):
+ import bb.server.xmlrpcclient
+ self.connection = bb.server.xmlrpcclient._create_server(be.bbaddress,
+ int(be.bbport))[0]
+
+ def _runCommand(self, command):
+ result, error = self.connection.runCommand(command)
+ if error:
+ raise Exception(error)
+ return result
+
+ def disconnect(self):
+ return self.connection.removeClient()
+
+ def setVariable(self, name, value):
+ return self._runCommand(["setVariable", name, value])
+
+ def getVariable(self, name):
+ return self._runCommand(["getVariable", name])
+
+ def triggerEvent(self, event):
+ return self._runCommand(["triggerEvent", event])
+
+ def build(self, targets, task = None):
+ if task is None:
+ task = "build"
+ return self._runCommand(["buildTargets", targets, task])
+
+ def forceShutDown(self):
+ return self._runCommand(["stateForceShutdown"])
+
+
+
+def getBuildEnvironmentController(**kwargs):
+ """ Gets you a BuildEnvironmentController that encapsulates a build environment,
+ based on the query dictionary sent in.
+
+ This is used to retrieve, for example, the currently running BE from inside
+ the toaster UI, or find a new BE to start a new build in it.
+
+ The return object MUST always be a BuildEnvironmentController.
+ """
+
+ from bldcontrol.localhostbecontroller import LocalhostBEController
+
+ be = BuildEnvironment.objects.filter(Q(**kwargs))[0]
+ if be.betype == BuildEnvironment.TYPE_LOCAL:
+ return LocalhostBEController(be)
+ else:
+ raise Exception("FIXME: Implement BEC for type %s" % str(be.betype))
+
+
+class BuildEnvironmentController(object):
+ """ BuildEnvironmentController (BEC) is the abstract class that defines the operations that MUST
+ or SHOULD be supported by a Build Environment. It is used to establish the framework, and must
+ not be instantiated directly by the user.
+
+ Use the "getBuildEnvironmentController()" function to get a working BEC for your remote.
+
+ How the BuildEnvironments are discovered is outside the scope of this class.
+
+ You must derive this class to teach Toaster how to operate in your own infrastructure.
+ We provide some specific BuildEnvironmentController classes that can be used either to
+ directly set-up Toaster infrastructure, or as a model for your own infrastructure set:
+
+ * Localhost controller will run the Toaster BE on the same account as the web server
+ (current user if you are using the the Django development web server)
+ on the local machine, with the "build/" directory under the "poky/" source checkout directory.
+ Bash is expected to be available.
+
+ """
+ def __init__(self, be):
+ """ Takes a BuildEnvironment object as parameter that points to the settings of the BE.
+ """
+ self.be = be
+ self.connection = None
+
+ def setLayers(self, bitbake, ls):
+ """ Checks-out bitbake executor and layers from git repositories.
+ Sets the layer variables in the config file, after validating local layer paths.
+ bitbake must be a single BRBitbake instance
+ The layer paths must be in a list of BRLayer object
+
+ a word of attention: by convention, the first layer for any build will be poky!
+ """
+ raise NotImplementedError("FIXME: Must override setLayers")
+
+ def getArtifact(self, path):
+ """ This call returns an artifact identified by the 'path'. How 'path' is interpreted as
+ up to the implementing BEC. The return MUST be a REST URL where a GET will actually return
+ the content of the artifact, e.g. for use as a "download link" in a web UI.
+ """
+ raise NotImplementedError("Must return the REST URL of the artifact")
+
+ def triggerBuild(self, bitbake, layers, variables, targets):
+ raise NotImplementedError("Must override BE release")
+
+class ShellCmdException(Exception):
+ pass
+
+
+class BuildSetupException(Exception):
+ pass
+
diff --git a/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
new file mode 100644
index 000000000..16c7c8044
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py
@@ -0,0 +1,401 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import os
+import sys
+import re
+import shutil
+import time
+from django.db import transaction
+from django.db.models import Q
+from bldcontrol.models import BuildEnvironment, BRLayer, BRVariable, BRTarget, BRBitbake
+from orm.models import CustomImageRecipe, Layer, Layer_Version, ProjectLayer, ToasterSetting
+import subprocess
+
+from toastermain import settings
+
+from bldcontrol.bbcontroller import BuildEnvironmentController, ShellCmdException, BuildSetupException, BitbakeController
+
+import logging
+logger = logging.getLogger("toaster")
+
+from pprint import pprint, pformat
+
+class LocalhostBEController(BuildEnvironmentController):
+ """ Implementation of the BuildEnvironmentController for the localhost;
+ this controller manages the default build directory,
+ the server setup and system start and stop for the localhost-type build environment
+
+ """
+
+ def __init__(self, be):
+ super(LocalhostBEController, self).__init__(be)
+ self.pokydirname = None
+ self.islayerset = False
+
+ def _shellcmd(self, command, cwd=None, nowait=False,env=None):
+ if cwd is None:
+ cwd = self.be.sourcedir
+ if env is None:
+ env=os.environ.copy()
+
+ logger.debug("lbc_shellcmd: (%s) %s" % (cwd, command))
+ p = subprocess.Popen(command, cwd = cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
+ if nowait:
+ return
+ (out,err) = p.communicate()
+ p.wait()
+ if p.returncode:
+ if len(err) == 0:
+ err = "command: %s \n%s" % (command, out)
+ else:
+ err = "command: %s \n%s" % (command, err)
+ logger.warning("localhostbecontroller: shellcmd error %s" % err)
+ raise ShellCmdException(err)
+ else:
+ logger.debug("localhostbecontroller: shellcmd success")
+ return out.decode('utf-8')
+
+ def getGitCloneDirectory(self, url, branch):
+ """Construct unique clone directory name out of url and branch."""
+ if branch != "HEAD":
+ return "_toaster_clones/_%s_%s" % (re.sub('[:/@+%]', '_', url), branch)
+
+ # word of attention; this is a localhost-specific issue; only on the localhost we expect to have "HEAD" releases
+ # which _ALWAYS_ means the current poky checkout
+ from os.path import dirname as DN
+ local_checkout_path = DN(DN(DN(DN(DN(os.path.abspath(__file__))))))
+ #logger.debug("localhostbecontroller: using HEAD checkout in %s" % local_checkout_path)
+ return local_checkout_path
+
+
+ def setCloneStatus(self,bitbake,status,total,current):
+ bitbake.req.build.repos_cloned=current
+ bitbake.req.build.repos_to_clone=total
+ bitbake.req.build.save()
+
+ def setLayers(self, bitbake, layers, targets):
+ """ a word of attention: by convention, the first layer for any build will be poky! """
+
+ assert self.be.sourcedir is not None
+
+ layerlist = []
+ nongitlayerlist = []
+ git_env = os.environ.copy()
+ # (note: add custom environment settings here)
+
+ # set layers in the layersource
+
+ # 1. get a list of repos with branches, and map dirpaths for each layer
+ gitrepos = {}
+
+ # if we're using a remotely fetched version of bitbake add its git
+ # details to the list of repos to clone
+ if bitbake.giturl and bitbake.commit:
+ gitrepos[(bitbake.giturl, bitbake.commit)] = []
+ gitrepos[(bitbake.giturl, bitbake.commit)].append(
+ ("bitbake", bitbake.dirpath))
+
+ for layer in layers:
+ # We don't need to git clone the layer for the CustomImageRecipe
+ # as it's generated by us layer on if needed
+ if CustomImageRecipe.LAYER_NAME in layer.name:
+ continue
+
+ # If we have local layers then we don't need clone them
+ # For local layers giturl will be empty
+ if not layer.giturl:
+ nongitlayerlist.append(layer.layer_version.layer.local_source_dir)
+ continue
+
+ if not (layer.giturl, layer.commit) in gitrepos:
+ gitrepos[(layer.giturl, layer.commit)] = []
+ gitrepos[(layer.giturl, layer.commit)].append( (layer.name, layer.dirpath) )
+
+
+ logger.debug("localhostbecontroller, our git repos are %s" % pformat(gitrepos))
+
+
+ # 2. Note for future use if the current source directory is a
+ # checked-out git repos that could match a layer's vcs_url and therefore
+ # be used to speed up cloning (rather than fetching it again).
+
+ cached_layers = {}
+
+ try:
+ for remotes in self._shellcmd("git remote -v", self.be.sourcedir,env=git_env).split("\n"):
+ try:
+ remote = remotes.split("\t")[1].split(" ")[0]
+ if remote not in cached_layers:
+ cached_layers[remote] = self.be.sourcedir
+ except IndexError:
+ pass
+ except ShellCmdException:
+ # ignore any errors in collecting git remotes this is an optional
+ # step
+ pass
+
+ logger.info("Using pre-checked out source for layer %s", cached_layers)
+
+ # 3. checkout the repositories
+ clone_count=0
+ clone_total=len(gitrepos.keys())
+ self.setCloneStatus(bitbake,'Started',clone_total,clone_count)
+ for giturl, commit in gitrepos.keys():
+ self.setCloneStatus(bitbake,'progress',clone_total,clone_count)
+ clone_count += 1
+
+ localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit))
+ logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname))
+
+ # see if our directory is a git repository
+ if os.path.exists(localdirname):
+ try:
+ localremotes = self._shellcmd("git remote -v",
+ localdirname,env=git_env)
+ if not giturl in localremotes and commit != 'HEAD':
+ raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl))
+ except ShellCmdException:
+ # our localdirname might not be a git repository
+ #- that's fine
+ pass
+ else:
+ if giturl in cached_layers:
+ logger.debug("localhostbecontroller git-copying %s to %s" % (cached_layers[giturl], localdirname))
+ self._shellcmd("git clone \"%s\" \"%s\"" % (cached_layers[giturl], localdirname),env=git_env)
+ self._shellcmd("git remote remove origin", localdirname,env=git_env)
+ self._shellcmd("git remote add origin \"%s\"" % giturl, localdirname,env=git_env)
+ else:
+ logger.debug("localhostbecontroller: cloning %s in %s" % (giturl, localdirname))
+ self._shellcmd('git clone "%s" "%s"' % (giturl, localdirname),env=git_env)
+
+ # branch magic name "HEAD" will inhibit checkout
+ if commit != "HEAD":
+ logger.debug("localhostbecontroller: checking out commit %s to %s " % (commit, localdirname))
+ ref = commit if re.match('^[a-fA-F0-9]+$', commit) else 'origin/%s' % commit
+ self._shellcmd('git fetch && git reset --hard "%s"' % ref, localdirname,env=git_env)
+
+ # take the localdirname as poky dir if we can find the oe-init-build-env
+ if self.pokydirname is None and os.path.exists(os.path.join(localdirname, "oe-init-build-env")):
+ logger.debug("localhostbecontroller: selected poky dir name %s" % localdirname)
+ self.pokydirname = localdirname
+
+ # make sure we have a working bitbake
+ if not os.path.exists(os.path.join(self.pokydirname, 'bitbake')):
+ logger.debug("localhostbecontroller: checking bitbake into the poky dirname %s " % self.pokydirname)
+ self._shellcmd("git clone -b \"%s\" \"%s\" \"%s\" " % (bitbake.commit, bitbake.giturl, os.path.join(self.pokydirname, 'bitbake')),env=git_env)
+
+ # verify our repositories
+ for name, dirpath in gitrepos[(giturl, commit)]:
+ localdirpath = os.path.join(localdirname, dirpath)
+ logger.debug("localhostbecontroller: localdirpath expected '%s'" % localdirpath)
+ if not os.path.exists(localdirpath):
+ raise BuildSetupException("Cannot find layer git path '%s' in checked out repository '%s:%s'. Aborting." % (localdirpath, giturl, commit))
+
+ if name != "bitbake":
+ layerlist.append(localdirpath.rstrip("/"))
+
+ self.setCloneStatus(bitbake,'complete',clone_total,clone_count)
+ logger.debug("localhostbecontroller: current layer list %s " % pformat(layerlist))
+
+ if self.pokydirname is None and os.path.exists(os.path.join(self.be.sourcedir, "oe-init-build-env")):
+ logger.debug("localhostbecontroller: selected poky dir name %s" % self.be.sourcedir)
+ self.pokydirname = self.be.sourcedir
+
+ # 5. create custom layer and add custom recipes to it
+ for target in targets:
+ try:
+ customrecipe = CustomImageRecipe.objects.get(
+ name=target.target,
+ project=bitbake.req.project)
+
+ custom_layer_path = self.setup_custom_image_recipe(
+ customrecipe, layers)
+
+ if os.path.isdir(custom_layer_path):
+ layerlist.append(custom_layer_path)
+
+ except CustomImageRecipe.DoesNotExist:
+ continue # not a custom recipe, skip
+
+ layerlist.extend(nongitlayerlist)
+ logger.debug("\n\nset layers gives this list %s" % pformat(layerlist))
+ self.islayerset = True
+ return layerlist
+
+ def setup_custom_image_recipe(self, customrecipe, layers):
+ """ Set up toaster-custom-images layer and recipe files """
+ layerpath = os.path.join(self.be.builddir,
+ CustomImageRecipe.LAYER_NAME)
+
+ # create directory structure
+ for name in ("conf", "recipes"):
+ path = os.path.join(layerpath, name)
+ if not os.path.isdir(path):
+ os.makedirs(path)
+
+ # create layer.conf
+ config = os.path.join(layerpath, "conf", "layer.conf")
+ if not os.path.isfile(config):
+ with open(config, "w") as conf:
+ conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n')
+
+ # Update the Layer_Version dirpath that has our base_recipe in
+ # to be able to read the base recipe to then generate the
+ # custom recipe.
+ br_layer_base_recipe = layers.get(
+ layer_version=customrecipe.base_recipe.layer_version)
+
+ # If the layer is one that we've cloned we know where it lives
+ if br_layer_base_recipe.giturl and br_layer_base_recipe.commit:
+ layer_path = self.getGitCloneDirectory(
+ br_layer_base_recipe.giturl,
+ br_layer_base_recipe.commit)
+ # Otherwise it's a local layer
+ elif br_layer_base_recipe.local_source_dir:
+ layer_path = br_layer_base_recipe.local_source_dir
+ else:
+ logger.error("Unable to workout the dir path for the custom"
+ " image recipe")
+
+ br_layer_base_dirpath = os.path.join(
+ self.be.sourcedir,
+ layer_path,
+ customrecipe.base_recipe.layer_version.dirpath)
+
+ customrecipe.base_recipe.layer_version.dirpath = br_layer_base_dirpath
+
+ customrecipe.base_recipe.layer_version.save()
+
+ # create recipe
+ recipe_path = os.path.join(layerpath, "recipes", "%s.bb" %
+ customrecipe.name)
+ with open(recipe_path, "w") as recipef:
+ recipef.write(customrecipe.generate_recipe_file_contents())
+
+ # Update the layer and recipe objects
+ customrecipe.layer_version.dirpath = layerpath
+ customrecipe.layer_version.layer.local_source_dir = layerpath
+ customrecipe.layer_version.layer.save()
+ customrecipe.layer_version.save()
+
+ customrecipe.file_path = recipe_path
+ customrecipe.save()
+
+ return layerpath
+
+
+ def readServerLogFile(self):
+ return open(os.path.join(self.be.builddir, "toaster_server.log"), "r").read()
+
+
+ def triggerBuild(self, bitbake, layers, variables, targets, brbe):
+ layers = self.setLayers(bitbake, layers, targets)
+
+ # init build environment from the clone
+ builddir = '%s-toaster-%d' % (self.be.builddir, bitbake.req.project.id)
+ oe_init = os.path.join(self.pokydirname, 'oe-init-build-env')
+ # init build environment
+ try:
+ custom_script = ToasterSetting.objects.get(name="CUSTOM_BUILD_INIT_SCRIPT").value
+ custom_script = custom_script.replace("%BUILDDIR%" ,builddir)
+ self._shellcmd("bash -c 'source %s'" % (custom_script))
+ except ToasterSetting.DoesNotExist:
+ self._shellcmd("bash -c 'source %s %s'" % (oe_init, builddir),
+ self.be.sourcedir)
+
+ # update bblayers.conf
+ bblconfpath = os.path.join(builddir, "conf/toaster-bblayers.conf")
+ with open(bblconfpath, 'w') as bblayers:
+ bblayers.write('# line added by toaster build control\n'
+ 'BBLAYERS = "%s"' % ' '.join(layers))
+
+ # write configuration file
+ confpath = os.path.join(builddir, 'conf/toaster.conf')
+ with open(confpath, 'w') as conf:
+ for var in variables:
+ conf.write('%s="%s"\n' % (var.name, var.value))
+ conf.write('INHERIT+="toaster buildhistory"')
+
+ # clean the Toaster to build environment
+ env_clean = 'unset BBPATH;' # clean BBPATH for <= YP-2.4.0
+
+ # run bitbake server from the clone
+ bitbake = os.path.join(self.pokydirname, 'bitbake', 'bin', 'bitbake')
+ toasterlayers = os.path.join(builddir,"conf/toaster-bblayers.conf")
+ self._shellcmd('%s bash -c \"source %s %s; BITBAKE_UI="knotty" %s --read %s --read %s '
+ '--server-only -B 0.0.0.0:0\"' % (env_clean, oe_init,
+ builddir, bitbake, confpath, toasterlayers), self.be.sourcedir)
+
+ # read port number from bitbake.lock
+ self.be.bbport = -1
+ bblock = os.path.join(builddir, 'bitbake.lock')
+ # allow 10 seconds for bb lock file to appear but also be populated
+ for lock_check in range(10):
+ if not os.path.exists(bblock):
+ logger.debug("localhostbecontroller: waiting for bblock file to appear")
+ time.sleep(1)
+ continue
+ if 10 < os.stat(bblock).st_size:
+ break
+ logger.debug("localhostbecontroller: waiting for bblock content to appear")
+ time.sleep(1)
+ else:
+ raise BuildSetupException("Cannot find bitbake server lock file '%s'. Aborting." % bblock)
+
+ with open(bblock) as fplock:
+ for line in fplock:
+ if ":" in line:
+ self.be.bbport = line.split(":")[-1].strip()
+ logger.debug("localhostbecontroller: bitbake port %s", self.be.bbport)
+ break
+
+ if -1 == self.be.bbport:
+ raise BuildSetupException("localhostbecontroller: can't read bitbake port from %s" % bblock)
+
+ self.be.bbaddress = "localhost"
+ self.be.bbstate = BuildEnvironment.SERVER_STARTED
+ self.be.lock = BuildEnvironment.LOCK_RUNNING
+ self.be.save()
+
+ bbtargets = ''
+ for target in targets:
+ task = target.task
+ if task:
+ if not task.startswith('do_'):
+ task = 'do_' + task
+ task = ':%s' % task
+ bbtargets += '%s%s ' % (target.target, task)
+
+ # run build with local bitbake. stop the server after the build.
+ log = os.path.join(builddir, 'toaster_ui.log')
+ local_bitbake = os.path.join(os.path.dirname(os.getenv('BBBASEDIR')),
+ 'bitbake')
+ self._shellcmd(['%s bash -c \"(TOASTER_BRBE="%s" BBSERVER="0.0.0.0:%s" '
+ '%s %s -u toasterui --read %s --read %s --token="" >>%s 2>&1;'
+ 'BITBAKE_UI="knotty" BBSERVER=0.0.0.0:%s %s -m)&\"' \
+ % (env_clean, brbe, self.be.bbport, local_bitbake, bbtargets, confpath, toasterlayers, log,
+ self.be.bbport, bitbake,)],
+ builddir, nowait=True)
+
+ logger.debug('localhostbecontroller: Build launched, exiting. '
+ 'Follow build logs at %s' % log)
diff --git a/poky/bitbake/lib/toaster/bldcontrol/management/__init__.py b/poky/bitbake/lib/toaster/bldcontrol/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/management/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py b/poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/management/commands/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py b/poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
new file mode 100644
index 000000000..823c6f154
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py
@@ -0,0 +1,167 @@
+from django.core.management.base import BaseCommand, CommandError
+from django.db import transaction
+
+from django.core.management import call_command
+from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException
+from bldcontrol.models import BuildRequest, BuildEnvironment, BRError
+from orm.models import ToasterSetting, Build, Layer
+
+import os
+import traceback
+import warnings
+
+
+def DN(path):
+ if path is None:
+ return ""
+ else:
+ return os.path.dirname(path)
+
+
+class Command(BaseCommand):
+ args = ""
+ help = "Verifies that the configured settings are valid and usable, or prompts the user to fix the settings."
+
+ def __init__(self, *args, **kwargs):
+ super(Command, self).__init__(*args, **kwargs)
+ self.guesspath = DN(DN(DN(DN(DN(DN(DN(__file__)))))))
+
+ def _verify_build_environment(self):
+ # provide a local build env. This will be extended later to include non local
+ if BuildEnvironment.objects.count() == 0:
+ BuildEnvironment.objects.create(betype=BuildEnvironment.TYPE_LOCAL)
+
+ # we make sure we have builddir and sourcedir for all defined build envionments
+ for be in BuildEnvironment.objects.all():
+ be.needs_import = False
+ def _verify_be():
+ is_changed = False
+
+ def _update_sourcedir():
+ be.sourcedir = os.environ.get('TOASTER_DIR')
+ return True
+
+ if len(be.sourcedir) == 0:
+ is_changed = _update_sourcedir()
+
+ if not be.sourcedir.startswith("/"):
+ print("\n -- Validation: The layers checkout directory must be set to an absolute path.")
+ is_changed = _update_sourcedir()
+
+ if is_changed:
+ if be.betype == BuildEnvironment.TYPE_LOCAL:
+ be.needs_import = True
+ return True
+
+ def _update_builddir():
+ be.builddir = os.environ.get('TOASTER_DIR')+"/build"
+ return True
+
+ if len(be.builddir) == 0:
+ is_changed = _update_builddir()
+
+ if not be.builddir.startswith("/"):
+ print("\n -- Validation: The build directory must to be set to an absolute path.")
+ is_changed = _update_builddir()
+
+ if is_changed:
+ print("\nBuild configuration saved")
+ be.save()
+ return True
+
+ if be.needs_import:
+ try:
+ print("Loading default settings")
+ call_command("loaddata", "settings")
+ template_conf = os.environ.get("TEMPLATECONF", "")
+
+ if ToasterSetting.objects.filter(name='CUSTOM_XML_ONLY').count() > 0:
+ # only use the custom settings
+ pass
+ elif "poky" in template_conf:
+ print("Loading poky configuration")
+ call_command("loaddata", "poky")
+ else:
+ print("Loading OE-Core configuration")
+ call_command("loaddata", "oe-core")
+ if template_conf:
+ oe_core_path = os.path.realpath(
+ template_conf +
+ "/../")
+ else:
+ print("TEMPLATECONF not found. You may have to"
+ " manually configure layer paths")
+ oe_core_path = input("Please enter the path of"
+ " your openembedded-core "
+ "layer: ")
+ # Update the layer instances of openemebedded-core
+ for layer in Layer.objects.filter(
+ name="openembedded-core",
+ local_source_dir="OE-CORE-LAYER-DIR"):
+ layer.local_path = oe_core_path
+ layer.save()
+
+ # Import the custom fixture if it's present
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ action="ignore",
+ message="^.*No fixture named.*$")
+ print("Importing custom settings if present")
+ try:
+ call_command("loaddata", "custom")
+ except:
+ print("NOTE: optional fixture 'custom' not found")
+
+ # we run lsupdates after config update
+ print("\nFetching information from the layer index, "
+ "please wait.\nYou can re-update any time later "
+ "by running bitbake/lib/toaster/manage.py "
+ "lsupdates\n")
+ call_command("lsupdates")
+
+ # we don't look for any other config files
+ return is_changed
+ except Exception as e:
+ print("Failure while trying to setup toaster: %s"
+ % e)
+ traceback.print_exc()
+
+ return is_changed
+
+ while _verify_be():
+ pass
+ return 0
+
+ def _verify_default_settings(self):
+ # verify that default settings are there
+ if ToasterSetting.objects.filter(name='DEFAULT_RELEASE').count() != 1:
+ ToasterSetting.objects.filter(name='DEFAULT_RELEASE').delete()
+ ToasterSetting.objects.get_or_create(name='DEFAULT_RELEASE', value='')
+ return 0
+
+ def _verify_builds_in_progress(self):
+ # we are just starting up. we must not have any builds in progress, or build environments taken
+ for b in BuildRequest.objects.filter(state=BuildRequest.REQ_INPROGRESS):
+ BRError.objects.create(req=b, errtype="toaster",
+ errmsg=
+ "Toaster found this build IN PROGRESS while Toaster started up. This is an inconsistent state, and the build was marked as failed")
+
+ BuildRequest.objects.filter(state=BuildRequest.REQ_INPROGRESS).update(state=BuildRequest.REQ_FAILED)
+
+ BuildEnvironment.objects.update(lock=BuildEnvironment.LOCK_FREE)
+
+ # also mark "In Progress builds as failures"
+ from django.utils import timezone
+ Build.objects.filter(outcome=Build.IN_PROGRESS).update(outcome=Build.FAILED, completed_on=timezone.now())
+
+ return 0
+
+
+
+ def handle(self, **options):
+ retval = 0
+ retval += self._verify_build_environment()
+ retval += self._verify_default_settings()
+ retval += self._verify_builds_in_progress()
+
+ return retval
diff --git a/poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
new file mode 100644
index 000000000..791e53eab
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -0,0 +1,192 @@
+from django.core.management.base import BaseCommand
+from django.db import transaction
+from django.db.models import Q
+
+from bldcontrol.bbcontroller import getBuildEnvironmentController
+from bldcontrol.models import BuildRequest, BuildEnvironment
+from bldcontrol.models import BRError, BRVariable
+
+from orm.models import Build, LogMessage, Target
+
+import logging
+import traceback
+import signal
+import os
+
+logger = logging.getLogger("toaster")
+
+
+class Command(BaseCommand):
+ args = ""
+ help = "Schedules and executes build requests as possible. "\
+ "Does not return (interrupt with Ctrl-C)"
+
+ @transaction.atomic
+ def _selectBuildEnvironment(self):
+ bec = getBuildEnvironmentController(lock=BuildEnvironment.LOCK_FREE)
+ bec.be.lock = BuildEnvironment.LOCK_LOCK
+ bec.be.save()
+ return bec
+
+ @transaction.atomic
+ def _selectBuildRequest(self):
+ br = BuildRequest.objects.filter(state=BuildRequest.REQ_QUEUED).first()
+ return br
+
+ def schedule(self):
+ try:
+ # select the build environment and the request to build
+ br = self._selectBuildRequest()
+ if br:
+ br.state = BuildRequest.REQ_INPROGRESS
+ br.save()
+ else:
+ return
+
+ try:
+ bec = self._selectBuildEnvironment()
+ except IndexError as e:
+ # we could not find a BEC; postpone the BR
+ br.state = BuildRequest.REQ_QUEUED
+ br.save()
+ logger.debug("runbuilds: No build env")
+ return
+
+ logger.info("runbuilds: starting build %s, environment %s" %
+ (br, bec.be))
+
+ # let the build request know where it is being executed
+ br.environment = bec.be
+ br.save()
+
+ # this triggers an async build
+ bec.triggerBuild(br.brbitbake, br.brlayer_set.all(),
+ br.brvariable_set.all(), br.brtarget_set.all(),
+ "%d:%d" % (br.pk, bec.be.pk))
+
+ except Exception as e:
+ logger.error("runbuilds: Error launching build %s" % e)
+ traceback.print_exc()
+ if "[Errno 111] Connection refused" in str(e):
+ # Connection refused, read toaster_server.out
+ errmsg = bec.readServerLogFile()
+ else:
+ errmsg = str(e)
+
+ BRError.objects.create(req=br, errtype=str(type(e)), errmsg=errmsg,
+ traceback=traceback.format_exc())
+ br.state = BuildRequest.REQ_FAILED
+ br.save()
+ bec.be.lock = BuildEnvironment.LOCK_FREE
+ bec.be.save()
+ # Cancel the pending build and report the exception to the UI
+ log_object = LogMessage.objects.create(
+ build = br.build,
+ level = LogMessage.EXCEPTION,
+ message = errmsg)
+ log_object.save()
+ br.build.outcome = Build.FAILED
+ br.build.save()
+
+ def archive(self):
+ for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE):
+ if br.build is None:
+ br.state = BuildRequest.REQ_FAILED
+ else:
+ br.state = BuildRequest.REQ_COMPLETED
+ br.save()
+
+ def cleanup(self):
+ from django.utils import timezone
+ from datetime import timedelta
+ # environments locked for more than 30 seconds
+ # they should be unlocked
+ BuildEnvironment.objects.filter(
+ Q(buildrequest__state__in=[BuildRequest.REQ_FAILED,
+ BuildRequest.REQ_COMPLETED,
+ BuildRequest.REQ_CANCELLING]) &
+ Q(lock=BuildEnvironment.LOCK_LOCK) &
+ Q(updated__lt=timezone.now() - timedelta(seconds=30))
+ ).update(lock=BuildEnvironment.LOCK_FREE)
+
+ # update all Builds that were in progress and failed to start
+ for br in BuildRequest.objects.filter(
+ state=BuildRequest.REQ_FAILED,
+ build__outcome=Build.IN_PROGRESS):
+ # transpose the launch errors in ToasterExceptions
+ br.build.outcome = Build.FAILED
+ for brerror in br.brerror_set.all():
+ logger.debug("Saving error %s" % brerror)
+ LogMessage.objects.create(build=br.build,
+ level=LogMessage.EXCEPTION,
+ message=brerror.errmsg)
+ br.build.save()
+
+ # we don't have a true build object here; hence, toasterui
+ # didn't have a change to release the BE lock
+ br.environment.lock = BuildEnvironment.LOCK_FREE
+ br.environment.save()
+
+ # update all BuildRequests without a build created
+ for br in BuildRequest.objects.filter(build=None):
+ br.build = Build.objects.create(project=br.project,
+ completed_on=br.updated,
+ started_on=br.created)
+ br.build.outcome = Build.FAILED
+ try:
+ br.build.machine = br.brvariable_set.get(name='MACHINE').value
+ except BRVariable.DoesNotExist:
+ pass
+ br.save()
+ # transpose target information
+ for brtarget in br.brtarget_set.all():
+ Target.objects.create(build=br.build,
+ target=brtarget.target,
+ task=brtarget.task)
+ # transpose the launch errors in ToasterExceptions
+ for brerror in br.brerror_set.all():
+ LogMessage.objects.create(build=br.build,
+ level=LogMessage.EXCEPTION,
+ message=brerror.errmsg)
+
+ br.build.save()
+
+ # Make sure the LOCK is removed for builds which have been fully
+ # cancelled
+ for br in BuildRequest.objects.filter(
+ Q(build__outcome=Build.CANCELLED) &
+ Q(state=BuildRequest.REQ_CANCELLING) &
+ ~Q(environment=None)):
+ br.environment.lock = BuildEnvironment.LOCK_FREE
+ br.environment.save()
+
+ def runbuild(self):
+ try:
+ self.cleanup()
+ except Exception as e:
+ logger.warn("runbuilds: cleanup exception %s" % str(e))
+
+ try:
+ self.archive()
+ except Exception as e:
+ logger.warn("runbuilds: archive exception %s" % str(e))
+
+ try:
+ self.schedule()
+ except Exception as e:
+ logger.warn("runbuilds: schedule exception %s" % str(e))
+
+ def handle(self, **options):
+ pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
+ ".runbuilds.pid")
+
+ with open(pidfile_path, 'w') as pidfile:
+ pidfile.write("%s" % os.getpid())
+
+ self.runbuild()
+
+ signal.signal(signal.SIGUSR1, lambda sig, frame: None)
+
+ while True:
+ signal.pause()
+ self.runbuild()
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py
new file mode 100644
index 000000000..67db37856
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0001_initial.py
@@ -0,0 +1,113 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='BRBitbake',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('giturl', models.CharField(max_length=254)),
+ ('commit', models.CharField(max_length=254)),
+ ('dirpath', models.CharField(max_length=254)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BRError',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('errtype', models.CharField(max_length=100)),
+ ('errmsg', models.TextField()),
+ ('traceback', models.TextField()),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BRLayer',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('giturl', models.CharField(max_length=254)),
+ ('commit', models.CharField(max_length=254)),
+ ('dirpath', models.CharField(max_length=254)),
+ ('layer_version', models.ForeignKey(to='orm.Layer_Version', null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BRTarget',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('target', models.CharField(max_length=100)),
+ ('task', models.CharField(max_length=100, null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BRVariable',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('value', models.TextField(blank=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BuildEnvironment',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('address', models.CharField(max_length=254)),
+ ('betype', models.IntegerField(choices=[(0, b'local'), (1, b'ssh')])),
+ ('bbaddress', models.CharField(max_length=254, blank=True)),
+ ('bbport', models.IntegerField(default=-1)),
+ ('bbtoken', models.CharField(max_length=126, blank=True)),
+ ('bbstate', models.IntegerField(default=0, choices=[(0, b'stopped'), (1, b'started')])),
+ ('sourcedir', models.CharField(max_length=512, blank=True)),
+ ('builddir', models.CharField(max_length=512, blank=True)),
+ ('lock', models.IntegerField(default=0, choices=[(0, b'free'), (1, b'lock'), (2, b'running')])),
+ ('created', models.DateTimeField(auto_now_add=True)),
+ ('updated', models.DateTimeField(auto_now=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BuildRequest',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('state', models.IntegerField(default=0, choices=[(0, b'created'), (1, b'queued'), (2, b'in progress'), (3, b'completed'), (4, b'failed'), (5, b'deleted'), (6, b'archive')])),
+ ('created', models.DateTimeField(auto_now_add=True)),
+ ('updated', models.DateTimeField(auto_now=True)),
+ ('build', models.OneToOneField(null=True, to='orm.Build')),
+ ('environment', models.ForeignKey(to='bldcontrol.BuildEnvironment', null=True)),
+ ('project', models.ForeignKey(to='orm.Project')),
+ ],
+ ),
+ migrations.AddField(
+ model_name='brvariable',
+ name='req',
+ field=models.ForeignKey(to='bldcontrol.BuildRequest'),
+ ),
+ migrations.AddField(
+ model_name='brtarget',
+ name='req',
+ field=models.ForeignKey(to='bldcontrol.BuildRequest'),
+ ),
+ migrations.AddField(
+ model_name='brlayer',
+ name='req',
+ field=models.ForeignKey(to='bldcontrol.BuildRequest'),
+ ),
+ migrations.AddField(
+ model_name='brerror',
+ name='req',
+ field=models.ForeignKey(to='bldcontrol.BuildRequest'),
+ ),
+ migrations.AddField(
+ model_name='brbitbake',
+ name='req',
+ field=models.OneToOneField(to='bldcontrol.BuildRequest'),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py
new file mode 100644
index 000000000..0c2475aba
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0002_auto_20160120_1250.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='buildenvironment',
+ name='betype',
+ field=models.IntegerField(choices=[(0, b'local')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py
new file mode 100644
index 000000000..eec9216ca
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0003_add_cancelling_state.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0002_auto_20160120_1250'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='buildrequest',
+ name='state',
+ field=models.IntegerField(default=0, choices=[(0, b'created'), (1, b'queued'), (2, b'in progress'), (3, b'completed'), (4, b'failed'), (5, b'deleted'), (6, b'cancelling'), (7, b'archive')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0004_auto_20160523_1446.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0004_auto_20160523_1446.py
new file mode 100644
index 000000000..3d9062954
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0004_auto_20160523_1446.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0003_add_cancelling_state'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='buildenvironment',
+ name='bbstate',
+ field=models.IntegerField(default=0, choices=[(0, 'stopped'), (1, 'started')]),
+ ),
+ migrations.AlterField(
+ model_name='buildenvironment',
+ name='betype',
+ field=models.IntegerField(choices=[(0, 'local')]),
+ ),
+ migrations.AlterField(
+ model_name='buildenvironment',
+ name='lock',
+ field=models.IntegerField(default=0, choices=[(0, 'free'), (1, 'lock'), (2, 'running')]),
+ ),
+ migrations.AlterField(
+ model_name='buildrequest',
+ name='state',
+ field=models.IntegerField(default=0, choices=[(0, 'created'), (1, 'queued'), (2, 'in progress'), (3, 'completed'), (4, 'failed'), (5, 'deleted'), (6, 'cancelling'), (7, 'archive')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0005_reorder_buildrequest_states.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0005_reorder_buildrequest_states.py
new file mode 100644
index 000000000..4bb951776
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0005_reorder_buildrequest_states.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0004_auto_20160523_1446'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='buildrequest',
+ name='state',
+ field=models.IntegerField(choices=[(0, 'created'), (1, 'queued'), (2, 'in progress'), (3, 'failed'), (4, 'deleted'), (5, 'cancelling'), (6, 'completed'), (7, 'archive')], default=0),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
new file mode 100644
index 000000000..2460002f0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0006_brlayer_local_source_dir.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0005_reorder_buildrequest_states'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='brlayer',
+ name='local_source_dir',
+ field=models.CharField(max_length=254, null=True),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py
new file mode 100644
index 000000000..4be42a4cf
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bldcontrol', '0006_brlayer_local_source_dir'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='brlayer',
+ name='commit',
+ field=models.CharField(max_length=254, null=True),
+ ),
+ migrations.AlterField(
+ model_name='brlayer',
+ name='dirpath',
+ field=models.CharField(max_length=254, null=True),
+ ),
+ migrations.AlterField(
+ model_name='brlayer',
+ name='giturl',
+ field=models.CharField(max_length=254, null=True),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py b/poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/migrations/__init__.py
diff --git a/poky/bitbake/lib/toaster/bldcontrol/models.py b/poky/bitbake/lib/toaster/bldcontrol/models.py
new file mode 100644
index 000000000..409614b9e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/models.py
@@ -0,0 +1,162 @@
+from __future__ import unicode_literals
+from django.db import models
+from django.core.validators import MaxValueValidator, MinValueValidator
+from django.utils.encoding import force_text
+from orm.models import Project, ProjectLayer, ProjectVariable, ProjectTarget, Build, Layer_Version
+
+import logging
+logger = logging.getLogger("toaster")
+# a BuildEnvironment is the equivalent of the "build/" directory on the localhost
+class BuildEnvironment(models.Model):
+ SERVER_STOPPED = 0
+ SERVER_STARTED = 1
+ SERVER_STATE = (
+ (SERVER_STOPPED, "stopped"),
+ (SERVER_STARTED, "started"),
+ )
+
+ TYPE_LOCAL = 0
+ TYPE = (
+ (TYPE_LOCAL, "local"),
+ )
+
+ LOCK_FREE = 0
+ LOCK_LOCK = 1
+ LOCK_RUNNING = 2
+ LOCK_STATE = (
+ (LOCK_FREE, "free"),
+ (LOCK_LOCK, "lock"),
+ (LOCK_RUNNING, "running"),
+ )
+
+ address = models.CharField(max_length = 254)
+ betype = models.IntegerField(choices = TYPE)
+ bbaddress = models.CharField(max_length = 254, blank = True)
+ bbport = models.IntegerField(default = -1)
+ bbtoken = models.CharField(max_length = 126, blank = True)
+ bbstate = models.IntegerField(choices = SERVER_STATE, default = SERVER_STOPPED)
+ sourcedir = models.CharField(max_length = 512, blank = True)
+ builddir = models.CharField(max_length = 512, blank = True)
+ lock = models.IntegerField(choices = LOCK_STATE, default = LOCK_FREE)
+ created = models.DateTimeField(auto_now_add = True)
+ updated = models.DateTimeField(auto_now = True)
+
+ def get_artifact(self, path):
+ if self.betype == BuildEnvironment.TYPE_LOCAL:
+ return open(path, "r")
+ raise NotImplementedError("FIXME: artifact download not implemented "\
+ "for build environment type %s" % \
+ self.get_betype_display())
+
+ def has_artifact(self, path):
+ import os
+ if self.betype == BuildEnvironment.TYPE_LOCAL:
+ return os.path.exists(path)
+ raise NotImplementedError("FIXME: has artifact not implemented for "\
+ "build environment type %s" % \
+ self.get_betype_display())
+
+# a BuildRequest is a request that the scheduler will build using a BuildEnvironment
+# the build request queue is the table itself, ordered by state
+
+class BuildRequest(models.Model):
+ REQ_CREATED = 0
+ REQ_QUEUED = 1
+ REQ_INPROGRESS = 2
+ REQ_FAILED = 3
+ REQ_DELETED = 4
+ REQ_CANCELLING = 5
+ REQ_COMPLETED = 6
+ REQ_ARCHIVE = 7
+
+ REQUEST_STATE = (
+ (REQ_CREATED, "created"),
+ (REQ_QUEUED, "queued"),
+ (REQ_INPROGRESS, "in progress"),
+ (REQ_FAILED, "failed"),
+ (REQ_DELETED, "deleted"),
+ (REQ_CANCELLING, "cancelling"),
+ (REQ_COMPLETED, "completed"),
+ (REQ_ARCHIVE, "archive"),
+ )
+
+ search_allowed_fields = ("brtarget__target", "build__project__name")
+
+ project = models.ForeignKey(Project)
+ build = models.OneToOneField(Build, null = True) # TODO: toasterui should set this when Build is created
+ environment = models.ForeignKey(BuildEnvironment, null = True)
+ state = models.IntegerField(choices = REQUEST_STATE, default = REQ_CREATED)
+ created = models.DateTimeField(auto_now_add = True)
+ updated = models.DateTimeField(auto_now = True)
+
+ def __init__(self, *args, **kwargs):
+ super(BuildRequest, self).__init__(*args, **kwargs)
+ # Save the old state in case it's about to be modified
+ self.old_state = self.state
+
+ def save(self, *args, **kwargs):
+ # Check that the state we're trying to set is not going backwards
+ # e.g. from REQ_FAILED to REQ_INPROGRESS
+ if self.old_state != self.state and self.old_state > self.state:
+ logger.warning("Invalid state change requested: "
+ "Cannot go from %s to %s - ignoring request" %
+ (BuildRequest.REQUEST_STATE[self.old_state][1],
+ BuildRequest.REQUEST_STATE[self.state][1])
+ )
+ # Set property back to the old value
+ self.state = self.old_state
+ return
+
+ super(BuildRequest, self).save(*args, **kwargs)
+
+
+ def get_duration(self):
+ return (self.updated - self.created).total_seconds()
+
+ def get_sorted_target_list(self):
+ tgts = self.brtarget_set.order_by( 'target' );
+ return( tgts );
+
+ def get_machine(self):
+ return self.brvariable_set.get(name="MACHINE").value
+
+ def __str__(self):
+ return force_text('%s %s' % (self.project, self.get_state_display()))
+
+# These tables specify the settings for running an actual build.
+# They MUST be kept in sync with the tables in orm.models.Project*
+
+
+class BRLayer(models.Model):
+ req = models.ForeignKey(BuildRequest)
+ name = models.CharField(max_length=100)
+ giturl = models.CharField(max_length=254, null=True)
+ local_source_dir = models.CharField(max_length=254, null=True)
+ commit = models.CharField(max_length=254, null=True)
+ dirpath = models.CharField(max_length=254, null=True)
+ layer_version = models.ForeignKey(Layer_Version, null=True)
+
+class BRBitbake(models.Model):
+ req = models.OneToOneField(BuildRequest) # only one bitbake for a request
+ giturl = models.CharField(max_length =254)
+ commit = models.CharField(max_length = 254)
+ dirpath = models.CharField(max_length = 254)
+
+class BRVariable(models.Model):
+ req = models.ForeignKey(BuildRequest)
+ name = models.CharField(max_length=100)
+ value = models.TextField(blank = True)
+
+class BRTarget(models.Model):
+ req = models.ForeignKey(BuildRequest)
+ target = models.CharField(max_length=100)
+ task = models.CharField(max_length=100, null=True)
+
+class BRError(models.Model):
+ req = models.ForeignKey(BuildRequest)
+ errtype = models.CharField(max_length=100)
+ errmsg = models.TextField()
+ traceback = models.TextField()
+
+ def __str__(self):
+ return "%s (%s)" % (self.errmsg, self.req)
diff --git a/poky/bitbake/lib/toaster/bldcontrol/views.py b/poky/bitbake/lib/toaster/bldcontrol/views.py
new file mode 100644
index 000000000..60f00ef0e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/bldcontrol/views.py
@@ -0,0 +1 @@
+# Create your views here.
diff --git a/poky/bitbake/lib/toaster/manage.py b/poky/bitbake/lib/toaster/manage.py
new file mode 100755
index 000000000..0c7ea5088
--- /dev/null
+++ b/poky/bitbake/lib/toaster/manage.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python3
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
diff --git a/poky/bitbake/lib/toaster/orm/__init__.py b/poky/bitbake/lib/toaster/orm/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/__init__.py
diff --git a/poky/bitbake/lib/toaster/orm/fixtures/README b/poky/bitbake/lib/toaster/orm/fixtures/README
new file mode 100644
index 000000000..1b1c660aa
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/fixtures/README
@@ -0,0 +1,30 @@
+# Fixtures directory
+
+Fixtures are data dumps that can be loaded into Toaster's database to provide
+configuration and data.
+
+In this directory we have the fixtures which are loaded the first time you start Toaster.
+This is to provide useful default values and metadata to Toaster.
+
+ - settings.xml This Contains Toaster wide settings, such as the default values for
+ certain bitbake variables.
+
+ - poky.xml This is the default release data for supported poky based setup
+
+ - oe-core.xml This is the default release data for supported oe-core based setups
+
+# Custom data/configuration
+
+ - custom.xml
+
+To add custom initial data/configuration to Toaster place a file called
+"custom.xml" in this directory. If present it will be loaded into the database.
+We suggest that this is used to overlay any configuration already done.
+All objects loaded with the same primary keys overwrite the existing data.
+Data can be provided in XML, JSON and if installed YAML formats.
+
+# To load data at any point in time
+
+Use the django management command manage.py loaddata <your fixture file>
+For further information see the Django command documentation at:
+https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-loaddata
diff --git a/poky/bitbake/lib/toaster/orm/fixtures/custom_toaster_append.sh_sample b/poky/bitbake/lib/toaster/orm/fixtures/custom_toaster_append.sh_sample
new file mode 100755
index 000000000..8c4e16316
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/fixtures/custom_toaster_append.sh_sample
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# Copyright (C) 2017 Intel Corp.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# This is sample software. Rename it to 'custom_toaster_append.sh' and
+# enable the respective custom sections.
+
+verbose=0
+if [ $verbose -ne 0 ] ; then
+ echo "custom_toaster_append.sh:$*"
+fi
+
+if [ "toaster_prepend" = "$1" ] ; then
+ echo "Add custom actions here when Toaster script is started"
+fi
+
+if [ "web_start_postpend" = "$1" ] ; then
+ echo "Add custom actions here after Toaster web service is started"
+fi
+
+if [ "web_stop_postpend" = "$1" ] ; then
+ echo "Add custom actions here after Toaster web service is stopped"
+fi
+
+if [ "noweb_start_postpend" = "$1" ] ; then
+ echo "Add custom actions here after Toaster (no web) service is started"
+fi
+
+if [ "noweb_stop_postpend" = "$1" ] ; then
+ echo "Add custom actions here after Toaster (no web) service is stopped"
+fi
+
+if [ "toaster_postpend" = "$1" ] ; then
+ echo "Add custom actions here after Toaster script is done"
+fi
+
diff --git a/poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml b/poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml
new file mode 100644
index 000000000..d7ea78dc2
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/fixtures/oe-core.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+ <!-- Set the project default value for DISTRO -->
+ <object model="orm.toastersetting" pk="1">
+ <field type="CharField" name="name">DEFCONF_DISTRO</field>
+ <field type="CharField" name="value">nodistro</field>
+ </object>
+
+ <!-- Bitbake versions which correspond to the metadata release -->
+ <object model="orm.bitbakeversion" pk="1">
+ <field type="CharField" name="name">sumo</field>
+ <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+ <field type="CharField" name="branch">1.38</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="2">
+ <field type="CharField" name="name">HEAD</field>
+ <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+ <field type="CharField" name="branch">HEAD</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="3">
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+ <field type="CharField" name="branch">master</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="4">
+ <field type="CharField" name="name">rocko</field>
+ <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
+ <field type="CharField" name="branch">1.36</field>
+ </object>
+
+ <!-- Releases available -->
+ <object model="orm.release" pk="1">
+ <field type="CharField" name="name">rocko</field>
+ <field type="CharField" name="description">Openembedded Sumo</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
+ <field type="CharField" name="branch_name">sumo</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=sumo\"&gt;OpenEmbedded Sumo&lt;/a&gt; branch.</field>
+ </object>
+ <object model="orm.release" pk="2">
+ <field type="CharField" name="name">local</field>
+ <field type="CharField" name="description">Local Openembedded</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">2</field>
+ <field type="CharField" name="branch_name">HEAD</field>
+ <field type="TextField" name="helptext">Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer.</field>
+ </object>
+ <object model="orm.release" pk="3">
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="description">OpenEmbedded core master</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">3</field>
+ <field type="CharField" name="branch_name">master</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/\"&gt;OpenEmbedded master&lt;/a&gt; branch.</field>
+ </object>
+ <object model="orm.release" pk="4">
+ <field type="CharField" name="name">rocko</field>
+ <field type="CharField" name="description">Openembedded Rocko</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
+ <field type="CharField" name="branch_name">rocko</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=rocko\"&gt;OpenEmbedded Rocko&lt;/a&gt; branch.</field>
+ </object>
+
+ <!-- Default layers for each release -->
+ <object model="orm.releasedefaultlayer" pk="1">
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="2">
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="3">
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="4">
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+
+
+ <!-- Layer for the Local release -->
+ <object model="orm.layer" pk="1">
+ <field type="CharField" name="name">openembedded-core</field>
+ <field type="CharField" name="vcs_url">git://git.openembedded.org/openembedded-core</field>
+ <field type="CharField" name="vcs_web_url">http://cgit.openembedded.org/openembedded-core</field>
+ <field type="CharField" name="vcs_web_tree_base_url">http://cgit.openembedded.org/openembedded-core/tree/%path%?h=%branch%</field>
+ <field type="CharField" name="vcs_web_file_base_url">http://cgit.openembedded.org/openembedded-core/tree/%path%?h=%branch%</field>
+ </object>
+ <object model="orm.layer_version" pk="1">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="local_path">OE-CORE-LAYER-DIR</field>
+ <field type="CharField" name="branch">HEAD</field>
+ <field type="CharField" name="dirpath">meta</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ </object>
+
+</django-objects>
diff --git a/poky/bitbake/lib/toaster/orm/fixtures/poky.xml b/poky/bitbake/lib/toaster/orm/fixtures/poky.xml
new file mode 100644
index 000000000..6c966da4a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/fixtures/poky.xml
@@ -0,0 +1,234 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+ <!-- Set the project default value for DISTRO -->
+ <object model="orm.toastersetting" pk="1">
+ <field type="CharField" name="name">DEFCONF_DISTRO</field>
+ <field type="CharField" name="value">poky</field>
+ </object>
+
+ <!-- Bitbake versions which correspond to the metadata release -->
+ <object model="orm.bitbakeversion" pk="1">
+ <field type="CharField" name="name">sumo</field>
+ <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="branch">sumo</field>
+ <field type="CharField" name="dirpath">bitbake</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="2">
+ <field type="CharField" name="name">HEAD</field>
+ <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="branch">HEAD</field>
+ <field type="CharField" name="dirpath">bitbake</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="3">
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="dirpath">bitbake</field>
+ </object>
+ <object model="orm.bitbakeversion" pk="4">
+ <field type="CharField" name="name">rocko</field>
+ <field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="branch">rocko</field>
+ <field type="CharField" name="dirpath">bitbake</field>
+ </object>
+
+
+ <!-- Releases available -->
+ <object model="orm.release" pk="1">
+ <field type="CharField" name="name">sumo</field>
+ <field type="CharField" name="description">Yocto Project 2.5 "Sumo"</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
+ <field type="CharField" name="branch_name">sumo</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=sumo"&gt;Yocto Project Sumo branch&lt;/a&gt;.</field>
+ </object>
+ <object model="orm.release" pk="2">
+ <field type="CharField" name="name">local</field>
+ <field type="CharField" name="description">Local Yocto Project</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">2</field>
+ <field type="CharField" name="branch_name">HEAD</field>
+ <field type="TextField" name="helptext">Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer.</field>
+ </object>
+ <object model="orm.release" pk="3">
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="description">Yocto Project master</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">3</field>
+ <field type="CharField" name="branch_name">master</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/"&gt;Yocto Project Master branch&lt;/a&gt;.</field>
+ </object>
+ <object model="orm.release" pk="4">
+ <field type="CharField" name="name">rocko</field>
+ <field type="CharField" name="description">Yocto Project 2.4 "Rocko"</field>
+ <field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
+ <field type="CharField" name="branch_name">rocko</field>
+ <field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=rocko"&gt;Yocto Project Rocko branch&lt;/a&gt;.</field>
+ </object>
+
+ <!-- Default project layers for each release -->
+ <object model="orm.releasedefaultlayer" pk="1">
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="2">
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="layer_name">meta-poky</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="3">
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="layer_name">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="4">
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="5">
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="layer_name">meta-poky</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="6">
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="layer_name">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="7">
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="8">
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="layer_name">meta-poky</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="9">
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="layer_name">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="10">
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="layer_name">openembedded-core</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="11">
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="layer_name">meta-poky</field>
+ </object>
+ <object model="orm.releasedefaultlayer" pk="12">
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="layer_name">meta-yocto-bsp</field>
+ </object>
+
+ <!-- Default layers provided by poky
+ openembedded-core
+ meta-poky
+ meta-yocto-bsp
+ -->
+ <object model="orm.layer" pk="1">
+ <field type="CharField" name="name">openembedded-core</field>
+ <field type="CharField" name="layer_index_url"></field>
+ <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+ <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ </object>
+ <object model="orm.layer_version" pk="1">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="branch">sumo</field>
+ <field type="CharField" name="dirpath">meta</field>
+ </object>
+ <object model="orm.layer_version" pk="2">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="branch">HEAD</field>
+ <field type="CharField" name="commit">HEAD</field>
+ <field type="CharField" name="dirpath">meta</field>
+ </object>
+ <object model="orm.layer_version" pk="3">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="dirpath">meta</field>
+ </object>
+ <object model="orm.layer_version" pk="4">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="branch">rocko</field>
+ <field type="CharField" name="dirpath">meta</field>
+ </object>
+
+ <object model="orm.layer" pk="2">
+ <field type="CharField" name="name">meta-poky</field>
+ <field type="CharField" name="layer_index_url"></field>
+ <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+ <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ </object>
+ <object model="orm.layer_version" pk="5">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="branch">sumo</field>
+ <field type="CharField" name="dirpath">meta-poky</field>
+ </object>
+ <object model="orm.layer_version" pk="6">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="branch">HEAD</field>
+ <field type="CharField" name="commit">HEAD</field>
+ <field type="CharField" name="dirpath">meta-poky</field>
+ </object>
+ <object model="orm.layer_version" pk="7">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="dirpath">meta-poky</field>
+ </object>
+ <object model="orm.layer_version" pk="8">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="branch">rocko</field>
+ <field type="CharField" name="dirpath">meta-poky</field>
+ </object>
+
+ <object model="orm.layer" pk="3">
+ <field type="CharField" name="name">meta-yocto-bsp</field>
+ <field type="CharField" name="layer_index_url"></field>
+ <field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
+ <field type="CharField" name="vcs_web_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky</field>
+ <field type="CharField" name="vcs_web_tree_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ <field type="CharField" name="vcs_web_file_base_url">http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%</field>
+ </object>
+ <object model="orm.layer_version" pk="9">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">1</field>
+ <field type="CharField" name="branch">sumo</field>
+ <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.layer_version" pk="10">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">2</field>
+ <field type="CharField" name="branch">HEAD</field>
+ <field type="CharField" name="commit">HEAD</field>
+ <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.layer_version" pk="11">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">3</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+ </object>
+ <object model="orm.layer_version" pk="12">
+ <field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
+ <field type="IntegerField" name="layer_source">0</field>
+ <field rel="ManyToOneRel" to="orm.release" name="release">4</field>
+ <field type="CharField" name="branch">rocko</field>
+ <field type="CharField" name="dirpath">meta-yocto-bsp</field>
+ </object>
+</django-objects>
diff --git a/poky/bitbake/lib/toaster/orm/fixtures/settings.xml b/poky/bitbake/lib/toaster/orm/fixtures/settings.xml
new file mode 100644
index 000000000..78c0fdca7
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/fixtures/settings.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+ <!-- Default project settings -->
+ <!-- pk=1 is DISTRO -->
+ <object model="orm.toastersetting" pk="2">
+ <field type="CharField" name="name">DEFAULT_RELEASE</field>
+ <field type="CharField" name="value">master</field>
+ </object>
+ <object model="orm.toastersetting" pk="3">
+ <field type="CharField" name="name">DEFCONF_PACKAGE_CLASSES</field>
+ <field type="CharField" name="value">package_rpm</field>
+ </object>
+ <object model="orm.toastersetting" pk="4">
+ <field type="CharField" name="name">DEFCONF_MACHINE</field>
+ <field type="CharField" name="value">qemux86</field>
+ </object>
+ <object model="orm.toastersetting" pk="5">
+ <field type="CharField" name="name">DEFCONF_SSTATE_DIR</field>
+ <field type="CharField" name="value">${TOPDIR}/../sstate-cache</field>
+ </object>
+ <object model="orm.toastersetting" pk="6">
+ <field type="CharField" name="name">DEFCONF_IMAGE_INSTALL_append</field>
+ <field type="CharField" name="value"></field>
+ </object>
+ <object model="orm.toastersetting" pk="7">
+ <field type="CharField" name="name">DEFCONF_IMAGE_FSTYPES</field>
+ <field type="CharField" name="value">ext3 jffs2 tar.bz2</field>
+ </object>
+ <object model="orm.toastersetting" pk="8">
+ <field type="CharField" name="name">DEFCONF_DL_DIR</field>
+ <field type="CharField" name="value">${TOPDIR}/../downloads</field>
+ </object>
+</django-objects>
diff --git a/poky/bitbake/lib/toaster/orm/management/__init__.py b/poky/bitbake/lib/toaster/orm/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/management/__init__.py
diff --git a/poky/bitbake/lib/toaster/orm/management/commands/__init__.py b/poky/bitbake/lib/toaster/orm/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/management/commands/__init__.py
diff --git a/poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
new file mode 100644
index 000000000..efc6b3a94
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/management/commands/lsupdates.py
@@ -0,0 +1,337 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.management.base import BaseCommand
+
+from orm.models import LayerSource, Layer, Release, Layer_Version
+from orm.models import LayerVersionDependency, Machine, Recipe
+from orm.models import Distro
+from orm.models import ToasterSetting
+
+import os
+import sys
+
+import json
+import logging
+import threading
+import time
+logger = logging.getLogger("toaster")
+
+DEFAULT_LAYERINDEX_SERVER = "http://layers.openembedded.org/layerindex/api/"
+
+
+class Spinner(threading.Thread):
+ """ A simple progress spinner to indicate download/parsing is happening"""
+ def __init__(self, *args, **kwargs):
+ super(Spinner, self).__init__(*args, **kwargs)
+ self.setDaemon(True)
+ self.signal = True
+
+ def run(self):
+ os.system('setterm -cursor off')
+ while self.signal:
+ for char in ["/", "-", "\\", "|"]:
+ sys.stdout.write("\r" + char)
+ sys.stdout.flush()
+ time.sleep(0.25)
+ os.system('setterm -cursor on')
+
+ def stop(self):
+ self.signal = False
+
+
+class Command(BaseCommand):
+ args = ""
+ help = "Updates locally cached information from a layerindex server"
+
+ def mini_progress(self, what, i, total):
+ i = i + 1
+ pec = (float(i)/float(total))*100
+
+ sys.stdout.write("\rUpdating %s %d%%" %
+ (what,
+ pec))
+ sys.stdout.flush()
+ if int(pec) is 100:
+ sys.stdout.write("\n")
+ sys.stdout.flush()
+
+ def update(self):
+ """
+ Fetches layer, recipe and machine information from a layerindex
+ server
+ """
+ os.system('setterm -cursor off')
+
+ self.apiurl = DEFAULT_LAYERINDEX_SERVER
+ if ToasterSetting.objects.filter(name='CUSTOM_LAYERINDEX_SERVER').count() == 1:
+ self.apiurl = ToasterSetting.objects.get(name = 'CUSTOM_LAYERINDEX_SERVER').value
+
+ assert self.apiurl is not None
+ try:
+ from urllib.request import urlopen, URLError
+ from urllib.parse import urlparse
+ except ImportError:
+ from urllib2 import urlopen, URLError
+ from urlparse import urlparse
+
+ proxy_settings = os.environ.get("http_proxy", None)
+
+ def _get_json_response(apiurl=None):
+ if None == apiurl:
+ apiurl=self.apiurl
+ http_progress = Spinner()
+ http_progress.start()
+
+ _parsedurl = urlparse(apiurl)
+ path = _parsedurl.path
+
+ # logger.debug("Fetching %s", apiurl)
+ try:
+ res = urlopen(apiurl)
+ except URLError as e:
+ raise Exception("Failed to read %s: %s" % (path, e.reason))
+
+ parsed = json.loads(res.read().decode('utf-8'))
+
+ http_progress.stop()
+ return parsed
+
+ # verify we can get the basic api
+ try:
+ apilinks = _get_json_response()
+ except Exception as e:
+ import traceback
+ if proxy_settings is not None:
+ logger.info("EE: Using proxy %s" % proxy_settings)
+ logger.warning("EE: could not connect to %s, skipping update:"
+ "%s\n%s" % (self.apiurl, e, traceback.format_exc()))
+ return
+
+ # update branches; only those that we already have names listed in the
+ # Releases table
+ whitelist_branch_names = [rel.branch_name
+ for rel in Release.objects.all()]
+ if len(whitelist_branch_names) == 0:
+ raise Exception("Failed to make list of branches to fetch")
+
+ logger.info("Fetching metadata releases for %s",
+ " ".join(whitelist_branch_names))
+
+ branches_info = _get_json_response(apilinks['branches'] +
+ "?filter=name:%s"
+ % "OR".join(whitelist_branch_names))
+
+ # Map the layer index branches to toaster releases
+ li_branch_id_to_toaster_release = {}
+
+ total = len(branches_info)
+ for i, branch in enumerate(branches_info):
+ li_branch_id_to_toaster_release[branch['id']] = \
+ Release.objects.get(name=branch['name'])
+ self.mini_progress("Releases", i, total)
+
+ # keep a track of the layerindex (li) id mappings so that
+ # layer_versions can be created for these layers later on
+ li_layer_id_to_toaster_layer_id = {}
+
+ logger.info("Fetching layers")
+
+ layers_info = _get_json_response(apilinks['layerItems'])
+
+ total = len(layers_info)
+ for i, li in enumerate(layers_info):
+ try:
+ l, created = Layer.objects.get_or_create(name=li['name'])
+ l.up_date = li['updated']
+ l.summary = li['summary']
+ l.description = li['description']
+
+ if created:
+ # predefined layers in the fixtures (for example poky.xml)
+ # always preempt the Layer Index for these values
+ l.vcs_url = li['vcs_url']
+ l.vcs_web_url = li['vcs_web_url']
+ l.vcs_web_tree_base_url = li['vcs_web_tree_base_url']
+ l.vcs_web_file_base_url = li['vcs_web_file_base_url']
+ l.save()
+ except Layer.MultipleObjectsReturned:
+ logger.info("Skipped %s as we found multiple layers and "
+ "don't know which to update" %
+ li['name'])
+
+ li_layer_id_to_toaster_layer_id[li['id']] = l.pk
+
+ self.mini_progress("layers", i, total)
+
+ # update layer_versions
+ logger.info("Fetching layer versions")
+ layerbranches_info = _get_json_response(
+ apilinks['layerBranches'] + "?filter=branch__name:%s" %
+ "OR".join(whitelist_branch_names))
+
+ # Map Layer index layer_branch object id to
+ # layer_version toaster object id
+ li_layer_branch_id_to_toaster_lv_id = {}
+
+ total = len(layerbranches_info)
+ for i, lbi in enumerate(layerbranches_info):
+ # release as defined by toaster map to layerindex branch
+ release = li_branch_id_to_toaster_release[lbi['branch']]
+
+ try:
+ lv, created = Layer_Version.objects.get_or_create(
+ layer=Layer.objects.get(
+ pk=li_layer_id_to_toaster_layer_id[lbi['layer']]),
+ release=release
+ )
+ except KeyError:
+ logger.warning(
+ "No such layerindex layer referenced by layerbranch %d" %
+ lbi['layer'])
+ continue
+
+ if created:
+ lv.release = li_branch_id_to_toaster_release[lbi['branch']]
+ lv.up_date = lbi['updated']
+ lv.commit = lbi['actual_branch']
+ lv.dirpath = lbi['vcs_subdir']
+ lv.save()
+
+ li_layer_branch_id_to_toaster_lv_id[lbi['id']] =\
+ lv.pk
+ self.mini_progress("layer versions", i, total)
+
+ logger.info("Fetching layer version dependencies")
+ # update layer dependencies
+ layerdependencies_info = _get_json_response(
+ apilinks['layerDependencies'] +
+ "?filter=layerbranch__branch__name:%s" %
+ "OR".join(whitelist_branch_names))
+
+ dependlist = {}
+ for ldi in layerdependencies_info:
+ try:
+ lv = Layer_Version.objects.get(
+ pk=li_layer_branch_id_to_toaster_lv_id[ldi['layerbranch']])
+ except Layer_Version.DoesNotExist as e:
+ continue
+
+ if lv not in dependlist:
+ dependlist[lv] = []
+ try:
+ layer_id = li_layer_id_to_toaster_layer_id[ldi['dependency']]
+
+ dependlist[lv].append(
+ Layer_Version.objects.get(layer__pk=layer_id,
+ release=lv.release))
+
+ except Layer_Version.DoesNotExist:
+ logger.warning("Cannot find layer version (ls:%s),"
+ "up_id:%s lv:%s" %
+ (self, ldi['dependency'], lv))
+
+ total = len(dependlist)
+ for i, lv in enumerate(dependlist):
+ LayerVersionDependency.objects.filter(layer_version=lv).delete()
+ for lvd in dependlist[lv]:
+ LayerVersionDependency.objects.get_or_create(layer_version=lv,
+ depends_on=lvd)
+ self.mini_progress("Layer version dependencies", i, total)
+
+ # update Distros
+ logger.info("Fetching distro information")
+ distros_info = _get_json_response(
+ apilinks['distros'] + "?filter=layerbranch__branch__name:%s" %
+ "OR".join(whitelist_branch_names))
+
+ total = len(distros_info)
+ for i, di in enumerate(distros_info):
+ distro, created = Distro.objects.get_or_create(
+ name=di['name'],
+ layer_version=Layer_Version.objects.get(
+ pk=li_layer_branch_id_to_toaster_lv_id[di['layerbranch']]))
+ distro.up_date = di['updated']
+ distro.name = di['name']
+ distro.description = di['description']
+ distro.save()
+ self.mini_progress("distros", i, total)
+
+ # update machines
+ logger.info("Fetching machine information")
+ machines_info = _get_json_response(
+ apilinks['machines'] + "?filter=layerbranch__branch__name:%s" %
+ "OR".join(whitelist_branch_names))
+
+ total = len(machines_info)
+ for i, mi in enumerate(machines_info):
+ mo, created = Machine.objects.get_or_create(
+ name=mi['name'],
+ layer_version=Layer_Version.objects.get(
+ pk=li_layer_branch_id_to_toaster_lv_id[mi['layerbranch']]))
+ mo.up_date = mi['updated']
+ mo.name = mi['name']
+ mo.description = mi['description']
+ mo.save()
+ self.mini_progress("machines", i, total)
+
+ # update recipes; paginate by layer version / layer branch
+ logger.info("Fetching recipe information")
+ recipes_info = _get_json_response(
+ apilinks['recipes'] + "?filter=layerbranch__branch__name:%s" %
+ "OR".join(whitelist_branch_names))
+
+ total = len(recipes_info)
+ for i, ri in enumerate(recipes_info):
+ try:
+ lv_id = li_layer_branch_id_to_toaster_lv_id[ri['layerbranch']]
+ lv = Layer_Version.objects.get(pk=lv_id)
+
+ ro, created = Recipe.objects.get_or_create(
+ layer_version=lv,
+ name=ri['pn']
+ )
+
+ ro.layer_version = lv
+ ro.up_date = ri['updated']
+ ro.name = ri['pn']
+ ro.version = ri['pv']
+ ro.summary = ri['summary']
+ ro.description = ri['description']
+ ro.section = ri['section']
+ ro.license = ri['license']
+ ro.homepage = ri['homepage']
+ ro.bugtracker = ri['bugtracker']
+ ro.file_path = ri['filepath'] + "/" + ri['filename']
+ if 'inherits' in ri:
+ ro.is_image = 'image' in ri['inherits'].split()
+ else: # workaround for old style layer index
+ ro.is_image = "-image-" in ri['pn']
+ ro.save()
+ except Exception as e:
+ logger.warning("Failed saving recipe %s", e)
+
+ self.mini_progress("recipes", i, total)
+
+ os.system('setterm -cursor on')
+
+ def handle(self, **options):
+ self.update()
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0001_initial.py b/poky/bitbake/lib/toaster/orm/migrations/0001_initial.py
new file mode 100644
index 000000000..760462f6b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0001_initial.py
@@ -0,0 +1,504 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='BitbakeVersion',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(unique=True, max_length=32)),
+ ('giturl', models.URLField()),
+ ('branch', models.CharField(max_length=32)),
+ ('dirpath', models.CharField(max_length=255)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Branch',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('name', models.CharField(max_length=50)),
+ ('short_description', models.CharField(max_length=50, blank=True)),
+ ],
+ options={
+ 'verbose_name_plural': 'Branches',
+ },
+ ),
+ migrations.CreateModel(
+ name='Build',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('machine', models.CharField(max_length=100)),
+ ('distro', models.CharField(max_length=100)),
+ ('distro_version', models.CharField(max_length=100)),
+ ('started_on', models.DateTimeField()),
+ ('completed_on', models.DateTimeField()),
+ ('outcome', models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress')])),
+ ('cooker_log_path', models.CharField(max_length=500)),
+ ('build_name', models.CharField(max_length=100)),
+ ('bitbake_version', models.CharField(max_length=50)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='BuildArtifact',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('file_name', models.FilePathField()),
+ ('file_size', models.IntegerField()),
+ ('build', models.ForeignKey(to='orm.Build')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='HelpText',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('area', models.IntegerField(choices=[(0, b'variable')])),
+ ('key', models.CharField(max_length=100)),
+ ('text', models.TextField()),
+ ('build', models.ForeignKey(related_name='helptext_build', to='orm.Build')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Layer',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('name', models.CharField(max_length=100)),
+ ('layer_index_url', models.URLField()),
+ ('vcs_url', models.URLField(default=None, null=True)),
+ ('vcs_web_url', models.URLField(default=None, null=True)),
+ ('vcs_web_tree_base_url', models.URLField(default=None, null=True)),
+ ('vcs_web_file_base_url', models.URLField(default=None, null=True)),
+ ('summary', models.TextField(default=None, help_text=b'One-line description of the layer', null=True)),
+ ('description', models.TextField(default=None, null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Layer_Version',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('branch', models.CharField(max_length=80)),
+ ('commit', models.CharField(max_length=100)),
+ ('dirpath', models.CharField(default=None, max_length=255, null=True)),
+ ('priority', models.IntegerField(default=0)),
+ ('local_path', models.FilePathField(default=b'/', max_length=1024)),
+ ('build', models.ForeignKey(related_name='layer_version_build', default=None, to='orm.Build', null=True)),
+ ('layer', models.ForeignKey(related_name='layer_version_layer', to='orm.Layer')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='LayerSource',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(unique=True, max_length=63)),
+ ('sourcetype', models.IntegerField(choices=[(0, b'local'), (1, b'layerindex'), (2, b'imported')])),
+ ('apiurl', models.CharField(default=None, max_length=255, null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='LayerVersionDependency',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('depends_on', models.ForeignKey(related_name='dependees', to='orm.Layer_Version')),
+ ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)),
+ ('layer_version', models.ForeignKey(related_name='dependencies', to='orm.Layer_Version')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='LogMessage',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('level', models.IntegerField(default=0, choices=[(0, b'info'), (1, b'warn'), (2, b'error'), (3, b'critical'), (-1, b'toaster exception')])),
+ ('message', models.TextField(null=True, blank=True)),
+ ('pathname', models.FilePathField(max_length=255, blank=True)),
+ ('lineno', models.IntegerField(null=True)),
+ ('build', models.ForeignKey(to='orm.Build')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Machine',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('name', models.CharField(max_length=255)),
+ ('description', models.CharField(max_length=255)),
+ ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)),
+ ('layer_version', models.ForeignKey(to='orm.Layer_Version')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Package',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('installed_name', models.CharField(default=b'', max_length=100)),
+ ('version', models.CharField(max_length=100, blank=True)),
+ ('revision', models.CharField(max_length=32, blank=True)),
+ ('summary', models.TextField(blank=True)),
+ ('description', models.TextField(blank=True)),
+ ('size', models.IntegerField(default=0)),
+ ('installed_size', models.IntegerField(default=0)),
+ ('section', models.CharField(max_length=80, blank=True)),
+ ('license', models.CharField(max_length=80, blank=True)),
+ ('build', models.ForeignKey(to='orm.Build', null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Package_Dependency',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'depends'), (3, b'recommends'), (2, b'recommends'), (4, b'suggests'), (5, b'provides'), (6, b'replaces'), (7, b'conflicts')])),
+ ('depends_on', models.ForeignKey(related_name='package_dependencies_target', to='orm.Package')),
+ ('package', models.ForeignKey(related_name='package_dependencies_source', to='orm.Package')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Package_File',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('path', models.FilePathField(max_length=255, blank=True)),
+ ('size', models.IntegerField()),
+ ('package', models.ForeignKey(related_name='buildfilelist_package', to='orm.Package')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Project',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('short_description', models.CharField(max_length=50, blank=True)),
+ ('created', models.DateTimeField(auto_now_add=True)),
+ ('updated', models.DateTimeField(auto_now=True)),
+ ('user_id', models.IntegerField(null=True)),
+ ('is_default', models.BooleanField(default=False)),
+ ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion', null=True)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ProjectLayer',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('optional', models.BooleanField(default=True)),
+ ('layercommit', models.ForeignKey(to='orm.Layer_Version', null=True)),
+ ('project', models.ForeignKey(to='orm.Project')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ProjectTarget',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('target', models.CharField(max_length=100)),
+ ('task', models.CharField(max_length=100, null=True)),
+ ('project', models.ForeignKey(to='orm.Project')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ProjectVariable',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('value', models.TextField(blank=True)),
+ ('project', models.ForeignKey(to='orm.Project')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Recipe',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('name', models.CharField(max_length=100, blank=True)),
+ ('version', models.CharField(max_length=100, blank=True)),
+ ('summary', models.TextField(blank=True)),
+ ('description', models.TextField(blank=True)),
+ ('section', models.CharField(max_length=100, blank=True)),
+ ('license', models.CharField(max_length=200, blank=True)),
+ ('homepage', models.URLField(blank=True)),
+ ('bugtracker', models.URLField(blank=True)),
+ ('file_path', models.FilePathField(max_length=255)),
+ ('pathflags', models.CharField(max_length=200, blank=True)),
+ ('is_image', models.BooleanField(default=False)),
+ ('layer_source', models.ForeignKey(default=None, to='orm.LayerSource', null=True)),
+ ('layer_version', models.ForeignKey(related_name='recipe_layer_version', to='orm.Layer_Version')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Recipe_Dependency',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('dep_type', models.IntegerField(choices=[(0, b'depends'), (1, b'rdepends')])),
+ ('depends_on', models.ForeignKey(related_name='r_dependencies_depends', to='orm.Recipe')),
+ ('recipe', models.ForeignKey(related_name='r_dependencies_recipe', to='orm.Recipe')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Release',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(unique=True, max_length=32)),
+ ('description', models.CharField(max_length=255)),
+ ('branch_name', models.CharField(default=b'', max_length=50)),
+ ('helptext', models.TextField(null=True)),
+ ('bitbake_version', models.ForeignKey(to='orm.BitbakeVersion')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ReleaseDefaultLayer',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('layer_name', models.CharField(default=b'', max_length=100)),
+ ('release', models.ForeignKey(to='orm.Release')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ReleaseLayerSourcePriority',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('priority', models.IntegerField(default=0)),
+ ('layer_source', models.ForeignKey(to='orm.LayerSource')),
+ ('release', models.ForeignKey(to='orm.Release')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Target',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('target', models.CharField(max_length=100)),
+ ('task', models.CharField(max_length=100, null=True)),
+ ('is_image', models.BooleanField(default=False)),
+ ('image_size', models.IntegerField(default=0)),
+ ('license_manifest_path', models.CharField(max_length=500, null=True)),
+ ('build', models.ForeignKey(to='orm.Build')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Target_File',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('path', models.FilePathField()),
+ ('size', models.IntegerField()),
+ ('inodetype', models.IntegerField(choices=[(1, b'regular'), (2, b'directory'), (3, b'symlink'), (4, b'socket'), (5, b'fifo'), (6, b'character'), (7, b'block')])),
+ ('permission', models.CharField(max_length=16)),
+ ('owner', models.CharField(max_length=128)),
+ ('group', models.CharField(max_length=128)),
+ ('directory', models.ForeignKey(related_name='directory_set', to='orm.Target_File', null=True)),
+ ('sym_target', models.ForeignKey(related_name='symlink_set', to='orm.Target_File', null=True)),
+ ('target', models.ForeignKey(to='orm.Target')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Target_Image_File',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('file_name', models.FilePathField(max_length=254)),
+ ('file_size', models.IntegerField()),
+ ('target', models.ForeignKey(to='orm.Target')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Target_Installed_Package',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('package', models.ForeignKey(related_name='buildtargetlist_package', to='orm.Package')),
+ ('target', models.ForeignKey(to='orm.Target')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Task',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('order', models.IntegerField(null=True)),
+ ('task_executed', models.BooleanField(default=False)),
+ ('outcome', models.IntegerField(default=-1, choices=[(-1, b'Not Available'), (0, b'Succeeded'), (1, b'Covered'), (2, b'Cached'), (3, b'Prebuilt'), (4, b'Failed'), (5, b'Empty')])),
+ ('sstate_checksum', models.CharField(max_length=100, blank=True)),
+ ('path_to_sstate_obj', models.FilePathField(max_length=500, blank=True)),
+ ('task_name', models.CharField(max_length=100)),
+ ('source_url', models.FilePathField(max_length=255, blank=True)),
+ ('work_directory', models.FilePathField(max_length=255, blank=True)),
+ ('script_type', models.IntegerField(default=0, choices=[(0, b'N/A'), (2, b'Python'), (3, b'Shell')])),
+ ('line_number', models.IntegerField(default=0)),
+ ('disk_io', models.IntegerField(null=True)),
+ ('cpu_usage', models.DecimalField(null=True, max_digits=8, decimal_places=2)),
+ ('elapsed_time', models.DecimalField(null=True, max_digits=8, decimal_places=2)),
+ ('sstate_result', models.IntegerField(default=0, choices=[(0, b'Not Applicable'), (1, b'File not in cache'), (2, b'Failed'), (3, b'Succeeded')])),
+ ('message', models.CharField(max_length=240)),
+ ('logfile', models.FilePathField(max_length=255, blank=True)),
+ ('build', models.ForeignKey(related_name='task_build', to='orm.Build')),
+ ('recipe', models.ForeignKey(related_name='tasks', to='orm.Recipe')),
+ ],
+ options={
+ 'ordering': ('order', 'recipe'),
+ },
+ ),
+ migrations.CreateModel(
+ name='Task_Dependency',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('depends_on', models.ForeignKey(related_name='task_dependencies_depends', to='orm.Task')),
+ ('task', models.ForeignKey(related_name='task_dependencies_task', to='orm.Task')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='ToasterSetting',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=63)),
+ ('helptext', models.TextField()),
+ ('value', models.CharField(max_length=255)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Variable',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('variable_name', models.CharField(max_length=100)),
+ ('variable_value', models.TextField(blank=True)),
+ ('changed', models.BooleanField(default=False)),
+ ('human_readable_name', models.CharField(max_length=200)),
+ ('description', models.TextField(blank=True)),
+ ('build', models.ForeignKey(related_name='variable_build', to='orm.Build')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='VariableHistory',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('value', models.TextField(blank=True)),
+ ('file_name', models.FilePathField(max_length=255)),
+ ('line_number', models.IntegerField(null=True)),
+ ('operation', models.CharField(max_length=64)),
+ ('variable', models.ForeignKey(related_name='vhistory', to='orm.Variable')),
+ ],
+ ),
+ migrations.AddField(
+ model_name='project',
+ name='release',
+ field=models.ForeignKey(to='orm.Release', null=True),
+ ),
+ migrations.AddField(
+ model_name='package_dependency',
+ name='target',
+ field=models.ForeignKey(to='orm.Target', null=True),
+ ),
+ migrations.AddField(
+ model_name='package',
+ name='recipe',
+ field=models.ForeignKey(to='orm.Recipe', null=True),
+ ),
+ migrations.AddField(
+ model_name='logmessage',
+ name='task',
+ field=models.ForeignKey(blank=True, to='orm.Task', null=True),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layersource',
+ unique_together=set([('sourcetype', 'apiurl')]),
+ ),
+ migrations.AddField(
+ model_name='layer_version',
+ name='layer_source',
+ field=models.ForeignKey(default=None, to='orm.LayerSource', null=True),
+ ),
+ migrations.AddField(
+ model_name='layer_version',
+ name='project',
+ field=models.ForeignKey(default=None, to='orm.Project', null=True),
+ ),
+ migrations.AddField(
+ model_name='layer_version',
+ name='up_branch',
+ field=models.ForeignKey(default=None, to='orm.Branch', null=True),
+ ),
+ migrations.AddField(
+ model_name='layer',
+ name='layer_source',
+ field=models.ForeignKey(default=None, to='orm.LayerSource', null=True),
+ ),
+ migrations.AddField(
+ model_name='build',
+ name='project',
+ field=models.ForeignKey(to='orm.Project'),
+ ),
+ migrations.AddField(
+ model_name='branch',
+ name='layer_source',
+ field=models.ForeignKey(default=True, to='orm.LayerSource', null=True),
+ ),
+ migrations.CreateModel(
+ name='ImportedLayerSource',
+ fields=[
+ ],
+ options={
+ 'proxy': True,
+ },
+ bases=('orm.layersource',),
+ ),
+ migrations.CreateModel(
+ name='LayerIndexLayerSource',
+ fields=[
+ ],
+ options={
+ 'proxy': True,
+ },
+ bases=('orm.layersource',),
+ ),
+ migrations.CreateModel(
+ name='LocalLayerSource',
+ fields=[
+ ],
+ options={
+ 'proxy': True,
+ },
+ bases=('orm.layersource',),
+ ),
+ migrations.AlterUniqueTogether(
+ name='task',
+ unique_together=set([('build', 'recipe', 'task_name')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='releaselayersourcepriority',
+ unique_together=set([('release', 'layer_source')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='recipe',
+ unique_together=set([('layer_version', 'file_path', 'pathflags')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='projectlayer',
+ unique_together=set([('project', 'layercommit')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='machine',
+ unique_together=set([('layer_source', 'up_id')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layerversiondependency',
+ unique_together=set([('layer_source', 'up_id')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layer_version',
+ unique_together=set([('layer_source', 'up_id')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layer',
+ unique_together=set([('layer_source', 'up_id'), ('layer_source', 'name')]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='branch',
+ unique_together=set([('layer_source', 'up_id'), ('layer_source', 'name')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py b/poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py
new file mode 100644
index 000000000..9cec82e8d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0002_customimagerecipe.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='CustomImageRecipe',
+ fields=[
+ ('recipe_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Recipe')),
+ ('last_updated', models.DateTimeField(default=None, null=True)),
+ ('base_recipe', models.ForeignKey(related_name='based_on_recipe', to='orm.Recipe')),
+ ('project', models.ForeignKey(to='orm.Project')),
+ ],
+ bases=('orm.recipe',),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py b/poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py
new file mode 100644
index 000000000..b027f6613
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0003_customimagepackage.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0002_customimagerecipe'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='CustomImagePackage',
+ fields=[
+ ('package_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='orm.Package')),
+ ('recipe_appends', models.ManyToManyField(related_name='appends_set', to='orm.CustomImageRecipe')),
+ ('recipe_excludes', models.ManyToManyField(related_name='excludes_set', to='orm.CustomImageRecipe')),
+ ('recipe_includes', models.ManyToManyField(related_name='includes_set', to='orm.CustomImageRecipe')),
+ ],
+ bases=('orm.package',),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0004_provides.py b/poky/bitbake/lib/toaster/orm/migrations/0004_provides.py
new file mode 100644
index 000000000..dfde2d136
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0004_provides.py
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0003_customimagepackage'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Provides',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('name', models.CharField(max_length=100)),
+ ('recipe', models.ForeignKey(to='orm.Recipe')),
+ ],
+ ),
+ migrations.AddField(
+ model_name='recipe_dependency',
+ name='via',
+ field=models.ForeignKey(null=True, default=None, to='orm.Provides'),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py b/poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py
new file mode 100644
index 000000000..fb1196b56
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0005_task_field_separation.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0004_provides'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='task',
+ name='cpu_usage',
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='cpu_time_system',
+ field=models.DecimalField(null=True, max_digits=8, decimal_places=2),
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='cpu_time_user',
+ field=models.DecimalField(null=True, max_digits=8, decimal_places=2),
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='disk_io_read',
+ field=models.IntegerField(null=True),
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='disk_io_write',
+ field=models.IntegerField(null=True),
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='ended',
+ field=models.DateTimeField(null=True),
+ ),
+ migrations.AddField(
+ model_name='task',
+ name='started',
+ field=models.DateTimeField(null=True),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py b/poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py
new file mode 100644
index 000000000..91a32a9e0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0006_add_cancelled_state.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0005_task_field_separation'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='build',
+ name='outcome',
+ field=models.IntegerField(default=2, choices=[(0, b'Succeeded'), (1, b'Failed'), (2, b'In Progress'), (3, b'Cancelled')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0007_auto_20160523_1446.py b/poky/bitbake/lib/toaster/orm/migrations/0007_auto_20160523_1446.py
new file mode 100644
index 000000000..b472e7cf0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0007_auto_20160523_1446.py
@@ -0,0 +1,89 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0006_add_cancelled_state'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='build',
+ name='outcome',
+ field=models.IntegerField(default=2, choices=[(0, 'Succeeded'), (1, 'Failed'), (2, 'In Progress'), (3, 'Cancelled')]),
+ ),
+ migrations.AlterField(
+ model_name='helptext',
+ name='area',
+ field=models.IntegerField(choices=[(0, 'variable')]),
+ ),
+ migrations.AlterField(
+ model_name='layer',
+ name='summary',
+ field=models.TextField(default=None, null=True, help_text='One-line description of the layer'),
+ ),
+ migrations.AlterField(
+ model_name='layer_version',
+ name='local_path',
+ field=models.FilePathField(default='/', max_length=1024),
+ ),
+ migrations.AlterField(
+ model_name='layersource',
+ name='sourcetype',
+ field=models.IntegerField(choices=[(0, 'local'), (1, 'layerindex'), (2, 'imported')]),
+ ),
+ migrations.AlterField(
+ model_name='logmessage',
+ name='level',
+ field=models.IntegerField(default=0, choices=[(0, 'info'), (1, 'warn'), (2, 'error'), (3, 'critical'), (-1, 'toaster exception')]),
+ ),
+ migrations.AlterField(
+ model_name='package',
+ name='installed_name',
+ field=models.CharField(default='', max_length=100),
+ ),
+ migrations.AlterField(
+ model_name='package_dependency',
+ name='dep_type',
+ field=models.IntegerField(choices=[(0, 'depends'), (1, 'depends'), (3, 'recommends'), (2, 'recommends'), (4, 'suggests'), (5, 'provides'), (6, 'replaces'), (7, 'conflicts')]),
+ ),
+ migrations.AlterField(
+ model_name='recipe_dependency',
+ name='dep_type',
+ field=models.IntegerField(choices=[(0, 'depends'), (1, 'rdepends')]),
+ ),
+ migrations.AlterField(
+ model_name='release',
+ name='branch_name',
+ field=models.CharField(default='', max_length=50),
+ ),
+ migrations.AlterField(
+ model_name='releasedefaultlayer',
+ name='layer_name',
+ field=models.CharField(default='', max_length=100),
+ ),
+ migrations.AlterField(
+ model_name='target_file',
+ name='inodetype',
+ field=models.IntegerField(choices=[(1, 'regular'), (2, 'directory'), (3, 'symlink'), (4, 'socket'), (5, 'fifo'), (6, 'character'), (7, 'block')]),
+ ),
+ migrations.AlterField(
+ model_name='task',
+ name='outcome',
+ field=models.IntegerField(default=-1, choices=[(-1, 'Not Available'), (0, 'Succeeded'), (1, 'Covered'), (2, 'Cached'), (3, 'Prebuilt'), (4, 'Failed'), (5, 'Empty')]),
+ ),
+ migrations.AlterField(
+ model_name='task',
+ name='script_type',
+ field=models.IntegerField(default=0, choices=[(0, 'N/A'), (2, 'Python'), (3, 'Shell')]),
+ ),
+ migrations.AlterField(
+ model_name='task',
+ name='sstate_result',
+ field=models.IntegerField(default=0, choices=[(0, 'Not Applicable'), (1, 'File not in cache'), (2, 'Failed'), (3, 'Succeeded')]),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py b/poky/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py
new file mode 100644
index 000000000..3367582a8
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0008_refactor_artifact_models.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0007_auto_20160523_1446'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='TargetKernelFile',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
+ ('file_name', models.FilePathField()),
+ ('file_size', models.IntegerField()),
+ ('target', models.ForeignKey(to='orm.Target')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='TargetSDKFile',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
+ ('file_name', models.FilePathField()),
+ ('file_size', models.IntegerField()),
+ ('target', models.ForeignKey(to='orm.Target')),
+ ],
+ ),
+ migrations.RemoveField(
+ model_name='buildartifact',
+ name='build',
+ ),
+ migrations.DeleteModel(
+ name='BuildArtifact',
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py b/poky/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py
new file mode 100644
index 000000000..c958f3070
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0009_target_package_manifest_path.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0008_refactor_artifact_models'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='target',
+ name='package_manifest_path',
+ field=models.CharField(null=True, max_length=500),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0010_delete_layer_source_references.py b/poky/bitbake/lib/toaster/orm/migrations/0010_delete_layer_source_references.py
new file mode 100644
index 000000000..f67388e99
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0010_delete_layer_source_references.py
@@ -0,0 +1,118 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.utils.timezone
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0009_target_package_manifest_path'),
+ ]
+
+ operations = [
+ migrations.AlterUniqueTogether(
+ name='releaselayersourcepriority',
+ unique_together=set([]),
+ ),
+ migrations.RemoveField(
+ model_name='releaselayersourcepriority',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='releaselayersourcepriority',
+ name='release',
+ ),
+ migrations.DeleteModel(
+ name='ImportedLayerSource',
+ ),
+ migrations.DeleteModel(
+ name='LayerIndexLayerSource',
+ ),
+ migrations.DeleteModel(
+ name='LocalLayerSource',
+ ),
+ migrations.RemoveField(
+ model_name='recipe',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='recipe',
+ name='up_id',
+ ),
+ migrations.AlterField(
+ model_name='layer',
+ name='up_date',
+ field=models.DateTimeField(default=django.utils.timezone.now, null=True),
+ ),
+ migrations.AlterField(
+ model_name='layer_version',
+ name='layer_source',
+ field=models.IntegerField(default=0, choices=[(0, 'local'), (1, 'layerindex'), (2, 'imported'), (3, 'build')]),
+ ),
+ migrations.AlterField(
+ model_name='layer_version',
+ name='up_date',
+ field=models.DateTimeField(default=django.utils.timezone.now, null=True),
+ ),
+ migrations.AlterUniqueTogether(
+ name='branch',
+ unique_together=set([]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layer',
+ unique_together=set([]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layer_version',
+ unique_together=set([]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='layerversiondependency',
+ unique_together=set([]),
+ ),
+ migrations.AlterUniqueTogether(
+ name='machine',
+ unique_together=set([]),
+ ),
+ migrations.DeleteModel(
+ name='ReleaseLayerSourcePriority',
+ ),
+ migrations.RemoveField(
+ model_name='branch',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='branch',
+ name='up_id',
+ ),
+ migrations.RemoveField(
+ model_name='layer',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='layer',
+ name='up_id',
+ ),
+ migrations.RemoveField(
+ model_name='layer_version',
+ name='up_id',
+ ),
+ migrations.RemoveField(
+ model_name='layerversiondependency',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='layerversiondependency',
+ name='up_id',
+ ),
+ migrations.RemoveField(
+ model_name='machine',
+ name='layer_source',
+ ),
+ migrations.RemoveField(
+ model_name='machine',
+ name='up_id',
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py b/poky/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py
new file mode 100644
index 000000000..75506961a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0011_delete_layersource.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0010_delete_layer_source_references'),
+ ]
+
+ operations = [
+ migrations.DeleteModel(
+ name='LayerSource',
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py b/poky/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py
new file mode 100644
index 000000000..0e6bb8331
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0012_use_release_instead_of_up_branch.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+from django.db.models import Q
+
+
+def branch_to_release(apps, schema_editor):
+ Layer_Version = apps.get_model('orm', 'Layer_Version')
+ Release = apps.get_model('orm', 'Release')
+
+ print("Converting all layer version up_branches to releases")
+ # Find all the layer versions which have an upbranch and convert them to
+ # the release that they're for.
+ for layer_version in Layer_Version.objects.filter(
+ Q(release=None) & ~Q(up_branch=None)):
+ try:
+ # HEAD and local are equivalent
+ if "HEAD" in layer_version.up_branch.name:
+ release = Release.objects.get(name="local")
+ layer_version.commit = "HEAD"
+ layer_version.branch = "HEAD"
+ else:
+ release = Release.objects.get(
+ name=layer_version.up_branch.name)
+
+ layer_version.release = release
+ layer_version.save()
+ except Exception as e:
+ print("Couldn't work out an appropriate release for %s "
+ "the up_branch was %s "
+ "user the django admin interface to correct it" %
+ (layer_version.layer.name, layer_version.up_branch.name))
+ print(e)
+
+ continue
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0011_delete_layersource'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='layer_version',
+ name='release',
+ field=models.ForeignKey(to='orm.Release', default=None, null=True),
+ ),
+ migrations.RunPython(branch_to_release,
+ reverse_code=migrations.RunPython.noop),
+
+ migrations.RemoveField(
+ model_name='layer_version',
+ name='up_branch',
+ ),
+
+ migrations.DeleteModel(
+ name='Branch',
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0013_recipe_parse_progress_fields.py b/poky/bitbake/lib/toaster/orm/migrations/0013_recipe_parse_progress_fields.py
new file mode 100644
index 000000000..cc5c96d2d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0013_recipe_parse_progress_fields.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0012_use_release_instead_of_up_branch'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='build',
+ name='recipes_parsed',
+ field=models.IntegerField(default=0),
+ ),
+ migrations.AddField(
+ model_name='build',
+ name='recipes_to_parse',
+ field=models.IntegerField(default=1),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0014_allow_empty_buildname.py b/poky/bitbake/lib/toaster/orm/migrations/0014_allow_empty_buildname.py
new file mode 100644
index 000000000..4749a14b2
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0014_allow_empty_buildname.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0013_recipe_parse_progress_fields'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='build',
+ name='build_name',
+ field=models.CharField(default='', max_length=100),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0015_layer_local_source_dir.py b/poky/bitbake/lib/toaster/orm/migrations/0015_layer_local_source_dir.py
new file mode 100644
index 000000000..9539cd72a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0015_layer_local_source_dir.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0014_allow_empty_buildname'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='layer',
+ name='local_source_dir',
+ field=models.TextField(null=True, default=None),
+ ),
+ ]
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py b/poky/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py
new file mode 100644
index 000000000..cd4023b6f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0016_clone_progress.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0015_layer_local_source_dir'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='build',
+ name='repos_cloned',
+ field=models.IntegerField(default=1),
+ ),
+ migrations.AddField(
+ model_name='build',
+ name='repos_to_clone',
+ field=models.IntegerField(default=1), # (default off)
+ ),
+ ]
+
diff --git a/poky/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py b/poky/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py
new file mode 100644
index 000000000..d3c590127
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/0017_distro_clone.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('orm', '0016_clone_progress'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Distro',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('up_id', models.IntegerField(default=None, null=True)),
+ ('up_date', models.DateTimeField(default=None, null=True)),
+ ('name', models.CharField(max_length=255)),
+ ('description', models.CharField(max_length=255)),
+ ('layer_version', models.ForeignKey(to='orm.Layer_Version')),
+ ],
+ ),
+ ]
+
diff --git a/poky/bitbake/lib/toaster/orm/migrations/__init__.py b/poky/bitbake/lib/toaster/orm/migrations/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/migrations/__init__.py
diff --git a/poky/bitbake/lib/toaster/orm/models.py b/poky/bitbake/lib/toaster/orm/models.py
new file mode 100644
index 000000000..3a7dff8ca
--- /dev/null
+++ b/poky/bitbake/lib/toaster/orm/models.py
@@ -0,0 +1,1832 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from __future__ import unicode_literals
+
+from django.db import models, IntegrityError, DataError
+from django.db.models import F, Q, Sum, Count
+from django.utils import timezone
+from django.utils.encoding import force_bytes
+
+from django.core.urlresolvers import reverse
+
+from django.core import validators
+from django.conf import settings
+import django.db.models.signals
+
+import sys
+import os
+import re
+import itertools
+from signal import SIGUSR1
+
+
+import logging
+logger = logging.getLogger("toaster")
+
+if 'sqlite' in settings.DATABASES['default']['ENGINE']:
+ from django.db import transaction, OperationalError
+ from time import sleep
+
+ _base_save = models.Model.save
+ def save(self, *args, **kwargs):
+ while True:
+ try:
+ with transaction.atomic():
+ return _base_save(self, *args, **kwargs)
+ except OperationalError as err:
+ if 'database is locked' in str(err):
+ logger.warning("%s, model: %s, args: %s, kwargs: %s",
+ err, self.__class__, args, kwargs)
+ sleep(0.5)
+ continue
+ raise
+
+ models.Model.save = save
+
+ # HACK: Monkey patch Django to fix 'database is locked' issue
+
+ from django.db.models.query import QuerySet
+ _base_insert = QuerySet._insert
+ def _insert(self, *args, **kwargs):
+ with transaction.atomic(using=self.db, savepoint=False):
+ return _base_insert(self, *args, **kwargs)
+ QuerySet._insert = _insert
+
+ from django.utils import six
+ def _create_object_from_params(self, lookup, params):
+ """
+ Tries to create an object using passed params.
+ Used by get_or_create and update_or_create
+ """
+ try:
+ obj = self.create(**params)
+ return obj, True
+ except (IntegrityError, DataError):
+ exc_info = sys.exc_info()
+ try:
+ return self.get(**lookup), False
+ except self.model.DoesNotExist:
+ pass
+ six.reraise(*exc_info)
+
+ QuerySet._create_object_from_params = _create_object_from_params
+
+ # end of HACK
+
+class GitURLValidator(validators.URLValidator):
+ import re
+ regex = re.compile(
+ r'^(?:ssh|git|http|ftp)s?://' # http:// or https://
+ r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
+ r'localhost|' # localhost...
+ r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|' # ...or ipv4
+ r'\[?[A-F0-9]*:[A-F0-9:]+\]?)' # ...or ipv6
+ r'(?::\d+)?' # optional port
+ r'(?:/?|[/?]\S+)$', re.IGNORECASE)
+
+def GitURLField(**kwargs):
+ r = models.URLField(**kwargs)
+ for i in range(len(r.validators)):
+ if isinstance(r.validators[i], validators.URLValidator):
+ r.validators[i] = GitURLValidator()
+ return r
+
+
+class ToasterSetting(models.Model):
+ name = models.CharField(max_length=63)
+ helptext = models.TextField()
+ value = models.CharField(max_length=255)
+
+ def __unicode__(self):
+ return "Setting %s = %s" % (self.name, self.value)
+
+
+class ProjectManager(models.Manager):
+ def create_project(self, name, release):
+ if release is not None:
+ prj = self.model(name=name,
+ bitbake_version=release.bitbake_version,
+ release=release)
+ else:
+ prj = self.model(name=name,
+ bitbake_version=None,
+ release=None)
+
+ prj.save()
+
+ for defaultconf in ToasterSetting.objects.filter(
+ name__startswith="DEFCONF_"):
+ name = defaultconf.name[8:]
+ ProjectVariable.objects.create(project=prj,
+ name=name,
+ value=defaultconf.value)
+
+ if release is None:
+ return prj
+
+ for rdl in release.releasedefaultlayer_set.all():
+ lv = Layer_Version.objects.filter(
+ layer__name=rdl.layer_name,
+ release=release).first()
+
+ if lv:
+ ProjectLayer.objects.create(project=prj,
+ layercommit=lv,
+ optional=False)
+ else:
+ logger.warning("Default project layer %s not found" %
+ rdl.layer_name)
+
+ return prj
+
+ # return single object with is_default = True
+ def get_or_create_default_project(self):
+ projects = super(ProjectManager, self).filter(is_default=True)
+
+ if len(projects) > 1:
+ raise Exception('Inconsistent project data: multiple ' +
+ 'default projects (i.e. with is_default=True)')
+ elif len(projects) < 1:
+ options = {
+ 'name': 'Command line builds',
+ 'short_description':
+ 'Project for builds started outside Toaster',
+ 'is_default': True
+ }
+ project = Project.objects.create(**options)
+ project.save()
+
+ return project
+ else:
+ return projects[0]
+
+
+class Project(models.Model):
+ search_allowed_fields = ['name', 'short_description', 'release__name',
+ 'release__branch_name']
+ name = models.CharField(max_length=100)
+ short_description = models.CharField(max_length=50, blank=True)
+ bitbake_version = models.ForeignKey('BitbakeVersion', null=True)
+ release = models.ForeignKey("Release", null=True)
+ created = models.DateTimeField(auto_now_add=True)
+ updated = models.DateTimeField(auto_now=True)
+ # This is a horrible hack; since Toaster has no "User" model available when
+ # running in interactive mode, we can't reference the field here directly
+ # Instead, we keep a possible null reference to the User id,
+ # as not to force
+ # hard links to possibly missing models
+ user_id = models.IntegerField(null=True)
+ objects = ProjectManager()
+
+ # set to True for the project which is the default container
+ # for builds initiated by the command line etc.
+ is_default= models.BooleanField(default=False)
+
+ def __unicode__(self):
+ return "%s (Release %s, BBV %s)" % (self.name, self.release, self.bitbake_version)
+
+ def get_current_machine_name(self):
+ try:
+ return self.projectvariable_set.get(name="MACHINE").value
+ except (ProjectVariable.DoesNotExist,IndexError):
+ return None;
+
+ def get_number_of_builds(self):
+ """Return the number of builds which have ended"""
+
+ return self.build_set.exclude(
+ Q(outcome=Build.IN_PROGRESS) |
+ Q(outcome=Build.CANCELLED)
+ ).count()
+
+ def get_last_build_id(self):
+ try:
+ return Build.objects.filter( project = self.id ).order_by('-completed_on')[0].id
+ except (Build.DoesNotExist,IndexError):
+ return( -1 )
+
+ def get_last_outcome(self):
+ build_id = self.get_last_build_id()
+ if (-1 == build_id):
+ return( "" )
+ try:
+ return Build.objects.filter( id = build_id )[ 0 ].outcome
+ except (Build.DoesNotExist,IndexError):
+ return( "not_found" )
+
+ def get_last_target(self):
+ build_id = self.get_last_build_id()
+ if (-1 == build_id):
+ return( "" )
+ try:
+ return Target.objects.filter(build = build_id)[0].target
+ except (Target.DoesNotExist,IndexError):
+ return( "not_found" )
+
+ def get_last_errors(self):
+ build_id = self.get_last_build_id()
+ if (-1 == build_id):
+ return( 0 )
+ try:
+ return Build.objects.filter(id = build_id)[ 0 ].errors.count()
+ except (Build.DoesNotExist,IndexError):
+ return( "not_found" )
+
+ def get_last_warnings(self):
+ build_id = self.get_last_build_id()
+ if (-1 == build_id):
+ return( 0 )
+ try:
+ return Build.objects.filter(id = build_id)[ 0 ].warnings.count()
+ except (Build.DoesNotExist,IndexError):
+ return( "not_found" )
+
+ def get_last_build_extensions(self):
+ """
+ Get list of file name extensions for images produced by the most
+ recent build
+ """
+ last_build = Build.objects.get(pk = self.get_last_build_id())
+ return last_build.get_image_file_extensions()
+
+ def get_last_imgfiles(self):
+ build_id = self.get_last_build_id()
+ if (-1 == build_id):
+ return( "" )
+ try:
+ return Variable.objects.filter(build = build_id, variable_name = "IMAGE_FSTYPES")[ 0 ].variable_value
+ except (Variable.DoesNotExist,IndexError):
+ return( "not_found" )
+
+ def get_all_compatible_layer_versions(self):
+ """ Returns Queryset of all Layer_Versions which are compatible with
+ this project"""
+ queryset = None
+
+ # guard on release, as it can be null
+ if self.release:
+ queryset = Layer_Version.objects.filter(
+ (Q(release=self.release) &
+ Q(build=None) &
+ Q(project=None)) |
+ Q(project=self))
+ else:
+ queryset = Layer_Version.objects.none()
+
+ return queryset
+
+ def get_project_layer_versions(self, pk=False):
+ """ Returns the Layer_Versions currently added to this project """
+ layer_versions = self.projectlayer_set.all().values_list('layercommit',
+ flat=True)
+
+ if pk is False:
+ return Layer_Version.objects.filter(pk__in=layer_versions)
+ else:
+ return layer_versions
+
+
+ def get_available_machines(self):
+ """ Returns QuerySet of all Machines which are provided by the
+ Layers currently added to the Project """
+ queryset = Machine.objects.filter(
+ layer_version__in=self.get_project_layer_versions())
+
+ return queryset
+
+ def get_all_compatible_machines(self):
+ """ Returns QuerySet of all the compatible machines available to the
+ project including ones from Layers not currently added """
+ queryset = Machine.objects.filter(
+ layer_version__in=self.get_all_compatible_layer_versions())
+
+ return queryset
+
+ def get_available_distros(self):
+ """ Returns QuerySet of all Distros which are provided by the
+ Layers currently added to the Project """
+ queryset = Distro.objects.filter(
+ layer_version__in=self.get_project_layer_versions())
+
+ return queryset
+
+ def get_all_compatible_distros(self):
+ """ Returns QuerySet of all the compatible Wind River distros available to the
+ project including ones from Layers not currently added """
+ queryset = Distro.objects.filter(
+ layer_version__in=self.get_all_compatible_layer_versions())
+
+ return queryset
+
+ def get_available_recipes(self):
+ """ Returns QuerySet of all the recipes that are provided by layers
+ added to this project """
+ queryset = Recipe.objects.filter(
+ layer_version__in=self.get_project_layer_versions())
+
+ return queryset
+
+ def get_all_compatible_recipes(self):
+ """ Returns QuerySet of all the compatible Recipes available to the
+ project including ones from Layers not currently added """
+ queryset = Recipe.objects.filter(
+ layer_version__in=self.get_all_compatible_layer_versions()).exclude(name__exact='')
+
+ return queryset
+
+ def schedule_build(self):
+
+ from bldcontrol.models import BuildRequest, BRTarget, BRLayer
+ from bldcontrol.models import BRBitbake, BRVariable
+
+ try:
+ now = timezone.now()
+ build = Build.objects.create(project=self,
+ completed_on=now,
+ started_on=now)
+
+ br = BuildRequest.objects.create(project=self,
+ state=BuildRequest.REQ_QUEUED,
+ build=build)
+ BRBitbake.objects.create(req=br,
+ giturl=self.bitbake_version.giturl,
+ commit=self.bitbake_version.branch,
+ dirpath=self.bitbake_version.dirpath)
+
+ for t in self.projecttarget_set.all():
+ BRTarget.objects.create(req=br, target=t.target, task=t.task)
+ Target.objects.create(build=br.build, target=t.target,
+ task=t.task)
+ # If we're about to build a custom image recipe make sure
+ # that layer is currently in the project before we create the
+ # BRLayer objects
+ customrecipe = CustomImageRecipe.objects.filter(
+ name=t.target,
+ project=self).first()
+ if customrecipe:
+ ProjectLayer.objects.get_or_create(
+ project=self,
+ layercommit=customrecipe.layer_version,
+ optional=False)
+
+ for l in self.projectlayer_set.all().order_by("pk"):
+ commit = l.layercommit.get_vcs_reference()
+ logger.debug("Adding layer to build %s" %
+ l.layercommit.layer.name)
+ BRLayer.objects.create(
+ req=br,
+ name=l.layercommit.layer.name,
+ giturl=l.layercommit.layer.vcs_url,
+ commit=commit,
+ dirpath=l.layercommit.dirpath,
+ layer_version=l.layercommit,
+ local_source_dir=l.layercommit.layer.local_source_dir
+ )
+
+ for v in self.projectvariable_set.all():
+ BRVariable.objects.create(req=br, name=v.name, value=v.value)
+
+ try:
+ br.build.machine = self.projectvariable_set.get(
+ name='MACHINE').value
+ br.build.save()
+ except ProjectVariable.DoesNotExist:
+ pass
+
+ br.save()
+ signal_runbuilds()
+
+ except Exception:
+ # revert the build request creation since we're not done cleanly
+ br.delete()
+ raise
+ return br
+
+class Build(models.Model):
+ SUCCEEDED = 0
+ FAILED = 1
+ IN_PROGRESS = 2
+ CANCELLED = 3
+
+ BUILD_OUTCOME = (
+ (SUCCEEDED, 'Succeeded'),
+ (FAILED, 'Failed'),
+ (IN_PROGRESS, 'In Progress'),
+ (CANCELLED, 'Cancelled'),
+ )
+
+ search_allowed_fields = ['machine', 'cooker_log_path', "target__target", "target__target_image_file__file_name"]
+
+ project = models.ForeignKey(Project) # must have a project
+ machine = models.CharField(max_length=100)
+ distro = models.CharField(max_length=100)
+ distro_version = models.CharField(max_length=100)
+ started_on = models.DateTimeField()
+ completed_on = models.DateTimeField()
+ outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS)
+ cooker_log_path = models.CharField(max_length=500)
+ build_name = models.CharField(max_length=100, default='')
+ bitbake_version = models.CharField(max_length=50)
+
+ # number of recipes to parse for this build
+ recipes_to_parse = models.IntegerField(default=1)
+
+ # number of recipes parsed so far for this build
+ recipes_parsed = models.IntegerField(default=1)
+
+ # number of repos to clone for this build
+ repos_to_clone = models.IntegerField(default=1)
+
+ # number of repos cloned so far for this build (default off)
+ repos_cloned = models.IntegerField(default=1)
+
+ @staticmethod
+ def get_recent(project=None):
+ """
+ Return recent builds as a list; if project is set, only return
+ builds for that project
+ """
+
+ builds = Build.objects.all()
+
+ if project:
+ builds = builds.filter(project=project)
+
+ finished_criteria = \
+ Q(outcome=Build.SUCCEEDED) | \
+ Q(outcome=Build.FAILED) | \
+ Q(outcome=Build.CANCELLED)
+
+ recent_builds = list(itertools.chain(
+ builds.filter(outcome=Build.IN_PROGRESS).order_by("-started_on"),
+ builds.filter(finished_criteria).order_by("-completed_on")[:3]
+ ))
+
+ # add percentage done property to each build; this is used
+ # to show build progress in mrb_section.html
+ for build in recent_builds:
+ build.percentDone = build.completeper()
+ build.outcomeText = build.get_outcome_text()
+
+ return recent_builds
+
+ def started(self):
+ """
+ As build variables are only added for a build when its BuildStarted event
+ is received, a build with no build variables is counted as
+ "in preparation" and not properly started yet. This method
+ will return False if a build has no build variables (it never properly
+ started), or True otherwise.
+
+ Note that this is a temporary workaround for the fact that we don't
+ have a fine-grained state variable on a build which would allow us
+ to record "in progress" (BuildStarted received) vs. "in preparation".
+ """
+ variables = Variable.objects.filter(build=self)
+ return len(variables) > 0
+
+ def completeper(self):
+ tf = Task.objects.filter(build = self)
+ tfc = tf.count()
+ if tfc > 0:
+ completeper = tf.exclude(outcome=Task.OUTCOME_NA).count()*100 // tfc
+ else:
+ completeper = 0
+ return completeper
+
+ def eta(self):
+ eta = timezone.now()
+ completeper = self.completeper()
+ if self.completeper() > 0:
+ eta += ((eta - self.started_on)*(100-completeper))/completeper
+ return eta
+
+ def has_images(self):
+ """
+ Returns True if at least one of the targets for this build has an
+ image file associated with it, False otherwise
+ """
+ targets = Target.objects.filter(build_id=self.id)
+ has_images = False
+ for target in targets:
+ if target.has_images():
+ has_images = True
+ break
+ return has_images
+
+ def has_image_recipes(self):
+ """
+ Returns True if a build has any targets which were built from
+ image recipes.
+ """
+ image_recipes = self.get_image_recipes()
+ return len(image_recipes) > 0
+
+ def get_image_file_extensions(self):
+ """
+ Get string of file name extensions for images produced by this build;
+ note that this is the actual list of extensions stored on Target objects
+ for this build, and not the value of IMAGE_FSTYPES.
+
+ Returns comma-separated string, e.g. "vmdk, ext4"
+ """
+ extensions = []
+
+ targets = Target.objects.filter(build_id = self.id)
+ for target in targets:
+ if not target.is_image:
+ continue
+
+ target_image_files = Target_Image_File.objects.filter(
+ target_id=target.id)
+
+ for target_image_file in target_image_files:
+ extensions.append(target_image_file.suffix)
+
+ extensions = list(set(extensions))
+ extensions.sort()
+
+ return ', '.join(extensions)
+
+ def get_image_fstypes(self):
+ """
+ Get the IMAGE_FSTYPES variable value for this build as a de-duplicated
+ list of image file suffixes.
+ """
+ image_fstypes = Variable.objects.get(
+ build=self, variable_name='IMAGE_FSTYPES').variable_value
+ return list(set(re.split(r' {1,}', image_fstypes)))
+
+ def get_sorted_target_list(self):
+ tgts = Target.objects.filter(build_id = self.id).order_by( 'target' );
+ return( tgts );
+
+ def get_recipes(self):
+ """
+ Get the recipes related to this build;
+ note that the related layer versions and layers are also prefetched
+ by this query, as this queryset can be sorted by these objects in the
+ build recipes view; prefetching them here removes the need
+ for another query in that view
+ """
+ layer_versions = Layer_Version.objects.filter(build=self)
+ criteria = Q(layer_version__id__in=layer_versions)
+ return Recipe.objects.filter(criteria) \
+ .select_related('layer_version', 'layer_version__layer')
+
+ def get_image_recipes(self):
+ """
+ Returns a list of image Recipes (custom and built-in) related to this
+ build, sorted by name; note that this has to be done in two steps, as
+ there's no way to get all the custom image recipes and image recipes
+ in one query
+ """
+ custom_image_recipes = self.get_custom_image_recipes()
+ custom_image_recipe_names = custom_image_recipes.values_list('name', flat=True)
+
+ not_custom_image_recipes = ~Q(name__in=custom_image_recipe_names) & \
+ Q(is_image=True)
+
+ built_image_recipes = self.get_recipes().filter(not_custom_image_recipes)
+
+ # append to the custom image recipes and sort
+ customisable_image_recipes = list(
+ itertools.chain(custom_image_recipes, built_image_recipes)
+ )
+
+ return sorted(customisable_image_recipes, key=lambda recipe: recipe.name)
+
+ def get_custom_image_recipes(self):
+ """
+ Returns a queryset of CustomImageRecipes related to this build,
+ sorted by name
+ """
+ built_recipe_names = self.get_recipes().values_list('name', flat=True)
+ criteria = Q(name__in=built_recipe_names) & Q(project=self.project)
+ queryset = CustomImageRecipe.objects.filter(criteria).order_by('name')
+ return queryset
+
+ def get_outcome_text(self):
+ return Build.BUILD_OUTCOME[int(self.outcome)][1]
+
+ @property
+ def failed_tasks(self):
+ """ Get failed tasks for the build """
+ tasks = self.task_build.all()
+ return tasks.filter(order__gt=0, outcome=Task.OUTCOME_FAILED)
+
+ @property
+ def errors(self):
+ return (self.logmessage_set.filter(level=LogMessage.ERROR) |
+ self.logmessage_set.filter(level=LogMessage.EXCEPTION) |
+ self.logmessage_set.filter(level=LogMessage.CRITICAL))
+
+ @property
+ def warnings(self):
+ return self.logmessage_set.filter(level=LogMessage.WARNING)
+
+ @property
+ def timespent(self):
+ return self.completed_on - self.started_on
+
+ @property
+ def timespent_seconds(self):
+ return self.timespent.total_seconds()
+
+ @property
+ def target_labels(self):
+ """
+ Sorted (a-z) "target1:task, target2, target3" etc. string for all
+ targets in this build
+ """
+ targets = self.target_set.all()
+ target_labels = [target.target +
+ (':' + target.task if target.task else '')
+ for target in targets]
+ target_labels.sort()
+
+ return target_labels
+
+ def get_buildrequest(self):
+ buildrequest = None
+ if hasattr(self, 'buildrequest'):
+ buildrequest = self.buildrequest
+ return buildrequest
+
+ def is_queued(self):
+ from bldcontrol.models import BuildRequest
+ buildrequest = self.get_buildrequest()
+ if buildrequest:
+ return buildrequest.state == BuildRequest.REQ_QUEUED
+ else:
+ return False
+
+ def is_cancelling(self):
+ from bldcontrol.models import BuildRequest
+ buildrequest = self.get_buildrequest()
+ if buildrequest:
+ return self.outcome == Build.IN_PROGRESS and \
+ buildrequest.state == BuildRequest.REQ_CANCELLING
+ else:
+ return False
+
+ def is_cloning(self):
+ """
+ True if the build is still cloning repos
+ """
+ return self.outcome == Build.IN_PROGRESS and \
+ self.repos_cloned < self.repos_to_clone
+
+ def is_parsing(self):
+ """
+ True if the build is still parsing recipes
+ """
+ return self.outcome == Build.IN_PROGRESS and \
+ self.recipes_parsed < self.recipes_to_parse
+
+ def is_starting(self):
+ """
+ True if the build has no completed tasks yet and is still just starting
+ tasks.
+
+ Note that the mechanism for testing whether a Task is "done" is whether
+ its outcome field is set, as per the completeper() method.
+ """
+ return self.outcome == Build.IN_PROGRESS and \
+ self.task_build.exclude(outcome=Task.OUTCOME_NA).count() == 0
+
+
+ def get_state(self):
+ """
+ Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress',
+ 'Cancelled' (Build outcomes); or 'Queued', 'Cancelling' (states
+ dependent on the BuildRequest state).
+
+ This works around the fact that we have BuildRequest states as well
+ as Build states, but really we just want to know the state of the build.
+ """
+ if self.is_cancelling():
+ return 'Cancelling';
+ elif self.is_queued():
+ return 'Queued'
+ elif self.is_cloning():
+ return 'Cloning'
+ elif self.is_parsing():
+ return 'Parsing'
+ elif self.is_starting():
+ return 'Starting'
+ else:
+ return self.get_outcome_text()
+
+ def __str__(self):
+ return "%d %s %s" % (self.id, self.project, ",".join([t.target for t in self.target_set.all()]))
+
+class ProjectTarget(models.Model):
+ project = models.ForeignKey(Project)
+ target = models.CharField(max_length=100)
+ task = models.CharField(max_length=100, null=True)
+
+class Target(models.Model):
+ search_allowed_fields = ['target', 'file_name']
+ build = models.ForeignKey(Build)
+ target = models.CharField(max_length=100)
+ task = models.CharField(max_length=100, null=True)
+ is_image = models.BooleanField(default = False)
+ image_size = models.IntegerField(default=0)
+ license_manifest_path = models.CharField(max_length=500, null=True)
+ package_manifest_path = models.CharField(max_length=500, null=True)
+
+ def package_count(self):
+ return Target_Installed_Package.objects.filter(target_id__exact=self.id).count()
+
+ def __unicode__(self):
+ return self.target
+
+ def get_similar_targets(self):
+ """
+ Get target sfor the same machine, task and target name
+ (e.g. 'core-image-minimal') from a successful build for this project
+ (but excluding this target).
+
+ Note that we only look for targets built by this project because
+ projects can have different configurations from each other, and put
+ their artifacts in different directories.
+
+ The possibility of error when retrieving candidate targets
+ is minimised by the fact that bitbake will rebuild artifacts if MACHINE
+ (or various other variables) change. In this case, there is no need to
+ clone artifacts from another target, as those artifacts will have
+ been re-generated for this target anyway.
+ """
+ query = ~Q(pk=self.pk) & \
+ Q(target=self.target) & \
+ Q(build__machine=self.build.machine) & \
+ Q(build__outcome=Build.SUCCEEDED) & \
+ Q(build__project=self.build.project)
+
+ return Target.objects.filter(query)
+
+ def get_similar_target_with_image_files(self):
+ """
+ Get the most recent similar target with Target_Image_Files associated
+ with it, for the purpose of cloning those files onto this target.
+ """
+ similar_target = None
+
+ candidates = self.get_similar_targets()
+ if candidates.count() == 0:
+ return similar_target
+
+ task_subquery = Q(task=self.task)
+
+ # we can look for a 'build' task if this task is a 'populate_sdk_ext'
+ # task, as the latter also creates images; and vice versa; note that
+ # 'build' targets can have their task set to '';
+ # also note that 'populate_sdk' does not produce image files
+ image_tasks = [
+ '', # aka 'build'
+ 'build',
+ 'image',
+ 'populate_sdk_ext'
+ ]
+ if self.task in image_tasks:
+ task_subquery = Q(task__in=image_tasks)
+
+ # annotate with the count of files, to exclude any targets which
+ # don't have associated files
+ candidates = candidates.annotate(num_files=Count('target_image_file'))
+
+ query = task_subquery & Q(num_files__gt=0)
+
+ candidates = candidates.filter(query)
+
+ if candidates.count() > 0:
+ candidates.order_by('build__completed_on')
+ similar_target = candidates.last()
+
+ return similar_target
+
+ def get_similar_target_with_sdk_files(self):
+ """
+ Get the most recent similar target with TargetSDKFiles associated
+ with it, for the purpose of cloning those files onto this target.
+ """
+ similar_target = None
+
+ candidates = self.get_similar_targets()
+ if candidates.count() == 0:
+ return similar_target
+
+ # annotate with the count of files, to exclude any targets which
+ # don't have associated files
+ candidates = candidates.annotate(num_files=Count('targetsdkfile'))
+
+ query = Q(task=self.task) & Q(num_files__gt=0)
+
+ candidates = candidates.filter(query)
+
+ if candidates.count() > 0:
+ candidates.order_by('build__completed_on')
+ similar_target = candidates.last()
+
+ return similar_target
+
+ def clone_image_artifacts_from(self, target):
+ """
+ Make clones of the Target_Image_Files and TargetKernelFile objects
+ associated with Target target, then associate them with this target.
+
+ Note that for Target_Image_Files, we only want files from the previous
+ build whose suffix matches one of the suffixes defined in this
+ target's build's IMAGE_FSTYPES configuration variable. This prevents the
+ Target_Image_File object for an ext4 image being associated with a
+ target for a project which didn't produce an ext4 image (for example).
+
+ Also sets the license_manifest_path and package_manifest_path
+ of this target to the same path as that of target being cloned from, as
+ the manifests are also build artifacts but are treated differently.
+ """
+
+ image_fstypes = self.build.get_image_fstypes()
+
+ # filter out any image files whose suffixes aren't in the
+ # IMAGE_FSTYPES suffixes variable for this target's build
+ image_files = [target_image_file \
+ for target_image_file in target.target_image_file_set.all() \
+ if target_image_file.suffix in image_fstypes]
+
+ for image_file in image_files:
+ image_file.pk = None
+ image_file.target = self
+ image_file.save()
+
+ kernel_files = target.targetkernelfile_set.all()
+ for kernel_file in kernel_files:
+ kernel_file.pk = None
+ kernel_file.target = self
+ kernel_file.save()
+
+ self.license_manifest_path = target.license_manifest_path
+ self.package_manifest_path = target.package_manifest_path
+ self.save()
+
+ def clone_sdk_artifacts_from(self, target):
+ """
+ Clone TargetSDKFile objects from target and associate them with this
+ target.
+ """
+ sdk_files = target.targetsdkfile_set.all()
+ for sdk_file in sdk_files:
+ sdk_file.pk = None
+ sdk_file.target = self
+ sdk_file.save()
+
+ def has_images(self):
+ """
+ Returns True if this target has one or more image files attached to it.
+ """
+ return self.target_image_file_set.all().count() > 0
+
+# kernel artifacts for a target: bzImage and modules*
+class TargetKernelFile(models.Model):
+ target = models.ForeignKey(Target)
+ file_name = models.FilePathField()
+ file_size = models.IntegerField()
+
+ @property
+ def basename(self):
+ return os.path.basename(self.file_name)
+
+# SDK artifacts for a target: sh and manifest files
+class TargetSDKFile(models.Model):
+ target = models.ForeignKey(Target)
+ file_name = models.FilePathField()
+ file_size = models.IntegerField()
+
+ @property
+ def basename(self):
+ return os.path.basename(self.file_name)
+
+class Target_Image_File(models.Model):
+ # valid suffixes for image files produced by a build
+ SUFFIXES = {
+ 'btrfs', 'cpio', 'cpio.gz', 'cpio.lz4', 'cpio.lzma', 'cpio.xz',
+ 'cramfs', 'elf', 'ext2', 'ext2.bz2', 'ext2.gz', 'ext2.lzma', 'ext4',
+ 'ext4.gz', 'ext3', 'ext3.gz', 'hdddirect', 'hddimg', 'iso', 'jffs2',
+ 'jffs2.sum', 'multiubi', 'qcow2', 'squashfs', 'squashfs-lzo',
+ 'squashfs-xz', 'tar', 'tar.bz2', 'tar.gz', 'tar.lz4', 'tar.xz', 'ubi',
+ 'ubifs', 'vdi', 'vmdk', 'wic', 'wic.bmap', 'wic.bz2', 'wic.gz', 'wic.lzma'
+ }
+
+ target = models.ForeignKey(Target)
+ file_name = models.FilePathField(max_length=254)
+ file_size = models.IntegerField()
+
+ @property
+ def suffix(self):
+ """
+ Suffix for image file, minus leading "."
+ """
+ for suffix in Target_Image_File.SUFFIXES:
+ if self.file_name.endswith(suffix):
+ return suffix
+
+ filename, suffix = os.path.splitext(self.file_name)
+ suffix = suffix.lstrip('.')
+ return suffix
+
+class Target_File(models.Model):
+ ITYPE_REGULAR = 1
+ ITYPE_DIRECTORY = 2
+ ITYPE_SYMLINK = 3
+ ITYPE_SOCKET = 4
+ ITYPE_FIFO = 5
+ ITYPE_CHARACTER = 6
+ ITYPE_BLOCK = 7
+ ITYPES = ( (ITYPE_REGULAR ,'regular'),
+ ( ITYPE_DIRECTORY ,'directory'),
+ ( ITYPE_SYMLINK ,'symlink'),
+ ( ITYPE_SOCKET ,'socket'),
+ ( ITYPE_FIFO ,'fifo'),
+ ( ITYPE_CHARACTER ,'character'),
+ ( ITYPE_BLOCK ,'block'),
+ )
+
+ target = models.ForeignKey(Target)
+ path = models.FilePathField()
+ size = models.IntegerField()
+ inodetype = models.IntegerField(choices = ITYPES)
+ permission = models.CharField(max_length=16)
+ owner = models.CharField(max_length=128)
+ group = models.CharField(max_length=128)
+ directory = models.ForeignKey('Target_File', related_name="directory_set", null=True)
+ sym_target = models.ForeignKey('Target_File', related_name="symlink_set", null=True)
+
+
+class Task(models.Model):
+
+ SSTATE_NA = 0
+ SSTATE_MISS = 1
+ SSTATE_FAILED = 2
+ SSTATE_RESTORED = 3
+
+ SSTATE_RESULT = (
+ (SSTATE_NA, 'Not Applicable'), # For rest of tasks, but they still need checking.
+ (SSTATE_MISS, 'File not in cache'), # the sstate object was not found
+ (SSTATE_FAILED, 'Failed'), # there was a pkg, but the script failed
+ (SSTATE_RESTORED, 'Succeeded'), # successfully restored
+ )
+
+ CODING_NA = 0
+ CODING_PYTHON = 2
+ CODING_SHELL = 3
+
+ TASK_CODING = (
+ (CODING_NA, 'N/A'),
+ (CODING_PYTHON, 'Python'),
+ (CODING_SHELL, 'Shell'),
+ )
+
+ OUTCOME_NA = -1
+ OUTCOME_SUCCESS = 0
+ OUTCOME_COVERED = 1
+ OUTCOME_CACHED = 2
+ OUTCOME_PREBUILT = 3
+ OUTCOME_FAILED = 4
+ OUTCOME_EMPTY = 5
+
+ TASK_OUTCOME = (
+ (OUTCOME_NA, 'Not Available'),
+ (OUTCOME_SUCCESS, 'Succeeded'),
+ (OUTCOME_COVERED, 'Covered'),
+ (OUTCOME_CACHED, 'Cached'),
+ (OUTCOME_PREBUILT, 'Prebuilt'),
+ (OUTCOME_FAILED, 'Failed'),
+ (OUTCOME_EMPTY, 'Empty'),
+ )
+
+ TASK_OUTCOME_HELP = (
+ (OUTCOME_SUCCESS, 'This task successfully completed'),
+ (OUTCOME_COVERED, 'This task did not run because its output is provided by another task'),
+ (OUTCOME_CACHED, 'This task restored output from the sstate-cache directory or mirrors'),
+ (OUTCOME_PREBUILT, 'This task did not run because its outcome was reused from a previous build'),
+ (OUTCOME_FAILED, 'This task did not complete'),
+ (OUTCOME_EMPTY, 'This task has no executable content'),
+ (OUTCOME_NA, ''),
+ )
+
+ search_allowed_fields = [ "recipe__name", "recipe__version", "task_name", "logfile" ]
+
+ def __init__(self, *args, **kwargs):
+ super(Task, self).__init__(*args, **kwargs)
+ try:
+ self._helptext = HelpText.objects.get(key=self.task_name, area=HelpText.VARIABLE, build=self.build).text
+ except HelpText.DoesNotExist:
+ self._helptext = None
+
+ def get_related_setscene(self):
+ return Task.objects.filter(task_executed=True, build = self.build, recipe = self.recipe, task_name=self.task_name+"_setscene")
+
+ def get_outcome_text(self):
+ return Task.TASK_OUTCOME[int(self.outcome) + 1][1]
+
+ def get_outcome_help(self):
+ return Task.TASK_OUTCOME_HELP[int(self.outcome)][1]
+
+ def get_sstate_text(self):
+ if self.sstate_result==Task.SSTATE_NA:
+ return ''
+ else:
+ return Task.SSTATE_RESULT[int(self.sstate_result)][1]
+
+ def get_executed_display(self):
+ if self.task_executed:
+ return "Executed"
+ return "Not Executed"
+
+ def get_description(self):
+ return self._helptext
+
+ build = models.ForeignKey(Build, related_name='task_build')
+ order = models.IntegerField(null=True)
+ task_executed = models.BooleanField(default=False) # True means Executed, False means Not/Executed
+ outcome = models.IntegerField(choices=TASK_OUTCOME, default=OUTCOME_NA)
+ sstate_checksum = models.CharField(max_length=100, blank=True)
+ path_to_sstate_obj = models.FilePathField(max_length=500, blank=True)
+ recipe = models.ForeignKey('Recipe', related_name='tasks')
+ task_name = models.CharField(max_length=100)
+ source_url = models.FilePathField(max_length=255, blank=True)
+ work_directory = models.FilePathField(max_length=255, blank=True)
+ script_type = models.IntegerField(choices=TASK_CODING, default=CODING_NA)
+ line_number = models.IntegerField(default=0)
+
+ # start/end times
+ started = models.DateTimeField(null=True)
+ ended = models.DateTimeField(null=True)
+
+ # in seconds; this is stored to enable sorting
+ elapsed_time = models.DecimalField(max_digits=8, decimal_places=2, null=True)
+
+ # in bytes; note that disk_io is stored to enable sorting
+ disk_io = models.IntegerField(null=True)
+ disk_io_read = models.IntegerField(null=True)
+ disk_io_write = models.IntegerField(null=True)
+
+ # in seconds
+ cpu_time_user = models.DecimalField(max_digits=8, decimal_places=2, null=True)
+ cpu_time_system = models.DecimalField(max_digits=8, decimal_places=2, null=True)
+
+ sstate_result = models.IntegerField(choices=SSTATE_RESULT, default=SSTATE_NA)
+ message = models.CharField(max_length=240)
+ logfile = models.FilePathField(max_length=255, blank=True)
+
+ outcome_text = property(get_outcome_text)
+ sstate_text = property(get_sstate_text)
+
+ def __unicode__(self):
+ return "%d(%d) %s:%s" % (self.pk, self.build.pk, self.recipe.name, self.task_name)
+
+ class Meta:
+ ordering = ('order', 'recipe' ,)
+ unique_together = ('build', 'recipe', 'task_name', )
+
+
+class Task_Dependency(models.Model):
+ task = models.ForeignKey(Task, related_name='task_dependencies_task')
+ depends_on = models.ForeignKey(Task, related_name='task_dependencies_depends')
+
+class Package(models.Model):
+ search_allowed_fields = ['name', 'version', 'revision', 'recipe__name', 'recipe__version', 'recipe__license', 'recipe__layer_version__layer__name', 'recipe__layer_version__branch', 'recipe__layer_version__commit', 'recipe__layer_version__local_path', 'installed_name']
+ build = models.ForeignKey('Build', null=True)
+ recipe = models.ForeignKey('Recipe', null=True)
+ name = models.CharField(max_length=100)
+ installed_name = models.CharField(max_length=100, default='')
+ version = models.CharField(max_length=100, blank=True)
+ revision = models.CharField(max_length=32, blank=True)
+ summary = models.TextField(blank=True)
+ description = models.TextField(blank=True)
+ size = models.IntegerField(default=0)
+ installed_size = models.IntegerField(default=0)
+ section = models.CharField(max_length=80, blank=True)
+ license = models.CharField(max_length=80, blank=True)
+
+ @property
+ def is_locale_package(self):
+ """ Returns True if this package is identifiable as a locale package """
+ if self.name.find('locale') != -1:
+ return True
+ return False
+
+ @property
+ def is_packagegroup(self):
+ """ Returns True is this package is identifiable as a packagegroup """
+ if self.name.find('packagegroup') != -1:
+ return True
+ return False
+
+class CustomImagePackage(Package):
+ # CustomImageRecipe fields to track pacakges appended,
+ # included and excluded from a CustomImageRecipe
+ recipe_includes = models.ManyToManyField('CustomImageRecipe',
+ related_name='includes_set')
+ recipe_excludes = models.ManyToManyField('CustomImageRecipe',
+ related_name='excludes_set')
+ recipe_appends = models.ManyToManyField('CustomImageRecipe',
+ related_name='appends_set')
+
+
+class Package_DependencyManager(models.Manager):
+ use_for_related_fields = True
+ TARGET_LATEST = "use-latest-target-for-target"
+
+ def get_queryset(self):
+ return super(Package_DependencyManager, self).get_queryset().exclude(package_id = F('depends_on__id'))
+
+ def for_target_or_none(self, target):
+ """ filter the dependencies to be displayed by the supplied target
+ if no dependences are found for the target then try None as the target
+ which will return the dependences calculated without the context of a
+ target e.g. non image recipes.
+
+ returns: { size, packages }
+ """
+ package_dependencies = self.all_depends().order_by('depends_on__name')
+
+ if target is self.TARGET_LATEST:
+ installed_deps =\
+ package_dependencies.filter(~Q(target__target=None))
+ else:
+ installed_deps =\
+ package_dependencies.filter(Q(target__target=target))
+
+ packages_list = None
+ total_size = 0
+
+ # If we have installed depdencies for this package and target then use
+ # these to display
+ if installed_deps.count() > 0:
+ packages_list = installed_deps
+ total_size = installed_deps.aggregate(
+ Sum('depends_on__size'))['depends_on__size__sum']
+ else:
+ new_list = []
+ package_names = []
+
+ # Find dependencies for the package that we know about even if
+ # it's not installed on a target e.g. from a non-image recipe
+ for p in package_dependencies.filter(Q(target=None)):
+ if p.depends_on.name in package_names:
+ continue
+ else:
+ package_names.append(p.depends_on.name)
+ new_list.append(p.pk)
+ # while we're here we may as well total up the size to
+ # avoid iterating again
+ total_size += p.depends_on.size
+
+ # We want to return a queryset here for consistency so pick the
+ # deps from the new_list
+ packages_list = package_dependencies.filter(Q(pk__in=new_list))
+
+ return {'packages': packages_list,
+ 'size': total_size}
+
+ def all_depends(self):
+ """ Returns just the depends packages and not any other dep_type
+ Note that this is for any target
+ """
+ return self.filter(Q(dep_type=Package_Dependency.TYPE_RDEPENDS) |
+ Q(dep_type=Package_Dependency.TYPE_TRDEPENDS))
+
+
+class Package_Dependency(models.Model):
+ TYPE_RDEPENDS = 0
+ TYPE_TRDEPENDS = 1
+ TYPE_RRECOMMENDS = 2
+ TYPE_TRECOMMENDS = 3
+ TYPE_RSUGGESTS = 4
+ TYPE_RPROVIDES = 5
+ TYPE_RREPLACES = 6
+ TYPE_RCONFLICTS = 7
+ ' TODO: bpackage should be changed to remove the DEPENDS_TYPE access '
+ DEPENDS_TYPE = (
+ (TYPE_RDEPENDS, "depends"),
+ (TYPE_TRDEPENDS, "depends"),
+ (TYPE_TRECOMMENDS, "recommends"),
+ (TYPE_RRECOMMENDS, "recommends"),
+ (TYPE_RSUGGESTS, "suggests"),
+ (TYPE_RPROVIDES, "provides"),
+ (TYPE_RREPLACES, "replaces"),
+ (TYPE_RCONFLICTS, "conflicts"),
+ )
+ """ Indexed by dep_type, in view order, key for short name and help
+ description which when viewed will be printf'd with the
+ package name.
+ """
+ DEPENDS_DICT = {
+ TYPE_RDEPENDS : ("depends", "%s is required to run %s"),
+ TYPE_TRDEPENDS : ("depends", "%s is required to run %s"),
+ TYPE_TRECOMMENDS : ("recommends", "%s extends the usability of %s"),
+ TYPE_RRECOMMENDS : ("recommends", "%s extends the usability of %s"),
+ TYPE_RSUGGESTS : ("suggests", "%s is suggested for installation with %s"),
+ TYPE_RPROVIDES : ("provides", "%s is provided by %s"),
+ TYPE_RREPLACES : ("replaces", "%s is replaced by %s"),
+ TYPE_RCONFLICTS : ("conflicts", "%s conflicts with %s, which will not be installed if this package is not first removed"),
+ }
+
+ package = models.ForeignKey(Package, related_name='package_dependencies_source')
+ depends_on = models.ForeignKey(Package, related_name='package_dependencies_target') # soft dependency
+ dep_type = models.IntegerField(choices=DEPENDS_TYPE)
+ target = models.ForeignKey(Target, null=True)
+ objects = Package_DependencyManager()
+
+class Target_Installed_Package(models.Model):
+ target = models.ForeignKey(Target)
+ package = models.ForeignKey(Package, related_name='buildtargetlist_package')
+
+
+class Package_File(models.Model):
+ package = models.ForeignKey(Package, related_name='buildfilelist_package')
+ path = models.FilePathField(max_length=255, blank=True)
+ size = models.IntegerField()
+
+
+class Recipe(models.Model):
+ search_allowed_fields = ['name', 'version', 'file_path', 'section',
+ 'summary', 'description', 'license',
+ 'layer_version__layer__name',
+ 'layer_version__branch', 'layer_version__commit',
+ 'layer_version__local_path',
+ 'layer_version__layer_source']
+
+ up_date = models.DateTimeField(null=True, default=None)
+
+ name = models.CharField(max_length=100, blank=True)
+ version = models.CharField(max_length=100, blank=True)
+ layer_version = models.ForeignKey('Layer_Version',
+ related_name='recipe_layer_version')
+ summary = models.TextField(blank=True)
+ description = models.TextField(blank=True)
+ section = models.CharField(max_length=100, blank=True)
+ license = models.CharField(max_length=200, blank=True)
+ homepage = models.URLField(blank=True)
+ bugtracker = models.URLField(blank=True)
+ file_path = models.FilePathField(max_length=255)
+ pathflags = models.CharField(max_length=200, blank=True)
+ is_image = models.BooleanField(default=False)
+
+ def __unicode__(self):
+ return "Recipe " + self.name + ":" + self.version
+
+ def get_vcs_recipe_file_link_url(self):
+ return self.layer_version.get_vcs_file_link_url(self.file_path)
+
+ def get_description_or_summary(self):
+ if self.description:
+ return self.description
+ elif self.summary:
+ return self.summary
+ else:
+ return ""
+
+ class Meta:
+ unique_together = (("layer_version", "file_path", "pathflags"), )
+
+
+class Recipe_DependencyManager(models.Manager):
+ use_for_related_fields = True
+
+ def get_queryset(self):
+ return super(Recipe_DependencyManager, self).get_queryset().exclude(recipe_id = F('depends_on__id'))
+
+class Provides(models.Model):
+ name = models.CharField(max_length=100)
+ recipe = models.ForeignKey(Recipe)
+
+class Recipe_Dependency(models.Model):
+ TYPE_DEPENDS = 0
+ TYPE_RDEPENDS = 1
+
+ DEPENDS_TYPE = (
+ (TYPE_DEPENDS, "depends"),
+ (TYPE_RDEPENDS, "rdepends"),
+ )
+ recipe = models.ForeignKey(Recipe, related_name='r_dependencies_recipe')
+ depends_on = models.ForeignKey(Recipe, related_name='r_dependencies_depends')
+ via = models.ForeignKey(Provides, null=True, default=None)
+ dep_type = models.IntegerField(choices=DEPENDS_TYPE)
+ objects = Recipe_DependencyManager()
+
+
+class Machine(models.Model):
+ search_allowed_fields = ["name", "description", "layer_version__layer__name"]
+ up_date = models.DateTimeField(null = True, default = None)
+
+ layer_version = models.ForeignKey('Layer_Version')
+ name = models.CharField(max_length=255)
+ description = models.CharField(max_length=255)
+
+ def get_vcs_machine_file_link_url(self):
+ path = 'conf/machine/'+self.name+'.conf'
+
+ return self.layer_version.get_vcs_file_link_url(path)
+
+ def __unicode__(self):
+ return "Machine " + self.name + "(" + self.description + ")"
+
+
+
+
+
+class BitbakeVersion(models.Model):
+
+ name = models.CharField(max_length=32, unique = True)
+ giturl = GitURLField()
+ branch = models.CharField(max_length=32)
+ dirpath = models.CharField(max_length=255)
+
+ def __unicode__(self):
+ return "%s (Branch: %s)" % (self.name, self.branch)
+
+
+class Release(models.Model):
+ """ A release is a project template, used to pre-populate Project settings with a configuration set """
+ name = models.CharField(max_length=32, unique = True)
+ description = models.CharField(max_length=255)
+ bitbake_version = models.ForeignKey(BitbakeVersion)
+ branch_name = models.CharField(max_length=50, default = "")
+ helptext = models.TextField(null=True)
+
+ def __unicode__(self):
+ return "%s (%s)" % (self.name, self.branch_name)
+
+ def __str__(self):
+ return self.name
+
+class ReleaseDefaultLayer(models.Model):
+ release = models.ForeignKey(Release)
+ layer_name = models.CharField(max_length=100, default="")
+
+
+class LayerSource(object):
+ """ Where the layer metadata came from """
+ TYPE_LOCAL = 0
+ TYPE_LAYERINDEX = 1
+ TYPE_IMPORTED = 2
+ TYPE_BUILD = 3
+
+ SOURCE_TYPE = (
+ (TYPE_LOCAL, "local"),
+ (TYPE_LAYERINDEX, "layerindex"),
+ (TYPE_IMPORTED, "imported"),
+ (TYPE_BUILD, "build"),
+ )
+
+ def types_dict():
+ """ Turn the TYPES enums into a simple dictionary """
+ dictionary = {}
+ for key in LayerSource.__dict__:
+ if "TYPE" in key:
+ dictionary[key] = getattr(LayerSource, key)
+ return dictionary
+
+
+class Layer(models.Model):
+
+ up_date = models.DateTimeField(null=True, default=timezone.now)
+
+ name = models.CharField(max_length=100)
+ layer_index_url = models.URLField()
+ vcs_url = GitURLField(default=None, null=True)
+ local_source_dir = models.TextField(null=True, default=None)
+ vcs_web_url = models.URLField(null=True, default=None)
+ vcs_web_tree_base_url = models.URLField(null=True, default=None)
+ vcs_web_file_base_url = models.URLField(null=True, default=None)
+
+ summary = models.TextField(help_text='One-line description of the layer',
+ null=True, default=None)
+ description = models.TextField(null=True, default=None)
+
+ def __unicode__(self):
+ return "%s / %s " % (self.name, self.summary)
+
+
+class Layer_Version(models.Model):
+ """
+ A Layer_Version either belongs to a single project or no project
+ """
+ search_allowed_fields = ["layer__name", "layer__summary",
+ "layer__description", "layer__vcs_url",
+ "dirpath", "release__name", "commit", "branch"]
+
+ build = models.ForeignKey(Build, related_name='layer_version_build',
+ default=None, null=True)
+
+ layer = models.ForeignKey(Layer, related_name='layer_version_layer')
+
+ layer_source = models.IntegerField(choices=LayerSource.SOURCE_TYPE,
+ default=0)
+
+ up_date = models.DateTimeField(null=True, default=timezone.now)
+
+ # To which metadata release does this layer version belong to
+ release = models.ForeignKey(Release, null=True, default=None)
+
+ branch = models.CharField(max_length=80)
+ commit = models.CharField(max_length=100)
+ # If the layer is in a subdir
+ dirpath = models.CharField(max_length=255, null=True, default=None)
+
+ # if -1, this is a default layer
+ priority = models.IntegerField(default=0)
+
+ # where this layer exists on the filesystem
+ local_path = models.FilePathField(max_length=1024, default="/")
+
+ # Set if this layer is restricted to a particular project
+ project = models.ForeignKey('Project', null=True, default=None)
+
+ # code lifted, with adaptations, from the layerindex-web application
+ # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
+ def _handle_url_path(self, base_url, path):
+ import re, posixpath
+ if base_url:
+ if self.dirpath:
+ if path:
+ extra_path = self.dirpath + '/' + path
+ # Normalise out ../ in path for usage URL
+ extra_path = posixpath.normpath(extra_path)
+ # Minor workaround to handle case where subdirectory has been added between branches
+ # (should probably support usage URL per branch to handle this... sigh...)
+ if extra_path.startswith('../'):
+ extra_path = extra_path[3:]
+ else:
+ extra_path = self.dirpath
+ else:
+ extra_path = path
+ branchname = self.release.name
+ url = base_url.replace('%branch%', branchname)
+
+ # If there's a % in the path (e.g. a wildcard bbappend) we need to encode it
+ if extra_path:
+ extra_path = extra_path.replace('%', '%25')
+
+ if '%path%' in base_url:
+ if extra_path:
+ url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '\\1', url)
+ else:
+ url = re.sub(r'\[([^\]]*%path%[^\]]*)\]', '', url)
+ return url.replace('%path%', extra_path)
+ else:
+ return url + extra_path
+ return None
+
+ def get_vcs_link_url(self):
+ if self.layer.vcs_web_url is None:
+ return None
+ return self.layer.vcs_web_url
+
+ def get_vcs_file_link_url(self, file_path=""):
+ if self.layer.vcs_web_file_base_url is None:
+ return None
+ return self._handle_url_path(self.layer.vcs_web_file_base_url,
+ file_path)
+
+ def get_vcs_dirpath_link_url(self):
+ if self.layer.vcs_web_tree_base_url is None:
+ return None
+ return self._handle_url_path(self.layer.vcs_web_tree_base_url, '')
+
+ def get_vcs_reference(self):
+ if self.commit is not None and len(self.commit) > 0:
+ return self.commit
+ if self.branch is not None and len(self.branch) > 0:
+ return self.branch
+ if self.release is not None:
+ return self.release.name
+ return 'N/A'
+
+ def get_detailspage_url(self, project_id=None):
+ """ returns the url to the layer details page uses own project
+ field if project_id is not specified """
+
+ if project_id is None:
+ project_id = self.project.pk
+
+ return reverse('layerdetails', args=(project_id, self.pk))
+
+ def get_alldeps(self, project_id):
+ """Get full list of unique layer dependencies."""
+ def gen_layerdeps(lver, project, depth):
+ if depth == 0:
+ return
+ for ldep in lver.dependencies.all():
+ yield ldep.depends_on
+ # get next level of deps recursively calling gen_layerdeps
+ for subdep in gen_layerdeps(ldep.depends_on, project, depth-1):
+ yield subdep
+
+ project = Project.objects.get(pk=project_id)
+ result = []
+ projectlvers = [player.layercommit for player in
+ project.projectlayer_set.all()]
+ # protect against infinite layer dependency loops
+ maxdepth = 20
+ for dep in gen_layerdeps(self, project, maxdepth):
+ # filter out duplicates and layers already belonging to the project
+ if dep not in result + projectlvers:
+ result.append(dep)
+
+ return sorted(result, key=lambda x: x.layer.name)
+
+ def __unicode__(self):
+ return ("id %d belongs to layer: %s" % (self.pk, self.layer.name))
+
+ def __str__(self):
+ if self.release:
+ release = self.release.name
+ else:
+ release = "No release set"
+
+ return "%d %s (%s)" % (self.pk, self.layer.name, release)
+
+
+class LayerVersionDependency(models.Model):
+
+ layer_version = models.ForeignKey(Layer_Version,
+ related_name="dependencies")
+ depends_on = models.ForeignKey(Layer_Version,
+ related_name="dependees")
+
+class ProjectLayer(models.Model):
+ project = models.ForeignKey(Project)
+ layercommit = models.ForeignKey(Layer_Version, null=True)
+ optional = models.BooleanField(default = True)
+
+ def __unicode__(self):
+ return "%s, %s" % (self.project.name, self.layercommit)
+
+ class Meta:
+ unique_together = (("project", "layercommit"),)
+
+class CustomImageRecipe(Recipe):
+
+ # CustomImageRecipe's belong to layers called:
+ LAYER_NAME = "toaster-custom-images"
+
+ search_allowed_fields = ['name']
+ base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe')
+ project = models.ForeignKey(Project)
+ last_updated = models.DateTimeField(null=True, default=None)
+
+ def get_last_successful_built_target(self):
+ """ Return the last successful built target object if one exists
+ otherwise return None """
+ return Target.objects.filter(Q(build__outcome=Build.SUCCEEDED) &
+ Q(build__project=self.project) &
+ Q(target=self.name)).last()
+
+ def update_package_list(self):
+ """ Update the package list from the last good build of this
+ CustomImageRecipe
+ """
+ # Check if we're aldready up-to-date or not
+ target = self.get_last_successful_built_target()
+ if target == None:
+ # So we've never actually built this Custom recipe but what about
+ # the recipe it's based on?
+ target = \
+ Target.objects.filter(Q(build__outcome=Build.SUCCEEDED) &
+ Q(build__project=self.project) &
+ Q(target=self.base_recipe.name)).last()
+ if target == None:
+ return
+
+ if target.build.completed_on == self.last_updated:
+ return
+
+ self.includes_set.clear()
+
+ excludes_list = self.excludes_set.values_list('name', flat=True)
+ appends_list = self.appends_set.values_list('name', flat=True)
+
+ built_packages_list = \
+ target.target_installed_package_set.values_list('package__name',
+ flat=True)
+ for built_package in built_packages_list:
+ # Is the built package in the custom packages list?
+ if built_package in excludes_list:
+ continue
+
+ if built_package in appends_list:
+ continue
+
+ cust_img_p = \
+ CustomImagePackage.objects.get(name=built_package)
+ self.includes_set.add(cust_img_p)
+
+
+ self.last_updated = target.build.completed_on
+ self.save()
+
+ def get_all_packages(self):
+ """Get the included packages and any appended packages"""
+ self.update_package_list()
+
+ return CustomImagePackage.objects.filter((Q(recipe_appends=self) |
+ Q(recipe_includes=self)) &
+ ~Q(recipe_excludes=self))
+
+ def get_base_recipe_file(self):
+ """Get the base recipe file path if it exists on the file system"""
+ path_schema_one = "%s/%s" % (self.base_recipe.layer_version.local_path,
+ self.base_recipe.file_path)
+
+ path_schema_two = self.base_recipe.file_path
+
+ if os.path.exists(path_schema_one):
+ return path_schema_one
+
+ # The path may now be the full path if the recipe has been built
+ if os.path.exists(path_schema_two):
+ return path_schema_two
+
+ return None
+
+ def generate_recipe_file_contents(self):
+ """Generate the contents for the recipe file."""
+ # If we have no excluded packages we only need to _append
+ if self.excludes_set.count() == 0:
+ packages_conf = "IMAGE_INSTALL_append = \" "
+
+ for pkg in self.appends_set.all():
+ packages_conf += pkg.name+' '
+ else:
+ packages_conf = "IMAGE_FEATURES =\"\"\nIMAGE_INSTALL = \""
+ # We add all the known packages to be built by this recipe apart
+ # from locale packages which are are controlled with IMAGE_LINGUAS.
+ for pkg in self.get_all_packages().exclude(
+ name__icontains="locale"):
+ packages_conf += pkg.name+' '
+
+ packages_conf += "\""
+
+ base_recipe_path = self.get_base_recipe_file()
+ if base_recipe_path:
+ base_recipe = open(base_recipe_path, 'r').read()
+ else:
+ raise IOError("Based on recipe file not found: %s" %
+ base_recipe_path)
+
+ # Add a special case for when the recipe we have based a custom image
+ # recipe on requires another recipe.
+ # For example:
+ # "require core-image-minimal.bb" is changed to:
+ # "require recipes-core/images/core-image-minimal.bb"
+
+ req_search = re.search(r'(require\s+)(.+\.bb\s*$)',
+ base_recipe,
+ re.MULTILINE)
+ if req_search:
+ require_filename = req_search.group(2).strip()
+
+ corrected_location = Recipe.objects.filter(
+ Q(layer_version=self.base_recipe.layer_version) &
+ Q(file_path__icontains=require_filename)).last().file_path
+
+ new_require_line = "require %s" % corrected_location
+
+ base_recipe = base_recipe.replace(req_search.group(0),
+ new_require_line)
+
+ info = {
+ "date": timezone.now().strftime("%Y-%m-%d %H:%M:%S"),
+ "base_recipe": base_recipe,
+ "recipe_name": self.name,
+ "base_recipe_name": self.base_recipe.name,
+ "license": self.license,
+ "summary": self.summary,
+ "description": self.description,
+ "packages_conf": packages_conf.strip()
+ }
+
+ recipe_contents = ("# Original recipe %(base_recipe_name)s \n"
+ "%(base_recipe)s\n\n"
+ "# Recipe %(recipe_name)s \n"
+ "# Customisation Generated by Toaster on %(date)s\n"
+ "SUMMARY = \"%(summary)s\"\n"
+ "DESCRIPTION = \"%(description)s\"\n"
+ "LICENSE = \"%(license)s\"\n"
+ "%(packages_conf)s") % info
+
+ return recipe_contents
+
+class ProjectVariable(models.Model):
+ project = models.ForeignKey(Project)
+ name = models.CharField(max_length=100)
+ value = models.TextField(blank = True)
+
+class Variable(models.Model):
+ search_allowed_fields = ['variable_name', 'variable_value',
+ 'vhistory__file_name', "description"]
+ build = models.ForeignKey(Build, related_name='variable_build')
+ variable_name = models.CharField(max_length=100)
+ variable_value = models.TextField(blank=True)
+ changed = models.BooleanField(default=False)
+ human_readable_name = models.CharField(max_length=200)
+ description = models.TextField(blank=True)
+
+class VariableHistory(models.Model):
+ variable = models.ForeignKey(Variable, related_name='vhistory')
+ value = models.TextField(blank=True)
+ file_name = models.FilePathField(max_length=255)
+ line_number = models.IntegerField(null=True)
+ operation = models.CharField(max_length=64)
+
+class HelpText(models.Model):
+ VARIABLE = 0
+ HELPTEXT_AREA = ((VARIABLE, 'variable'), )
+
+ build = models.ForeignKey(Build, related_name='helptext_build')
+ area = models.IntegerField(choices=HELPTEXT_AREA)
+ key = models.CharField(max_length=100)
+ text = models.TextField()
+
+class LogMessage(models.Model):
+ EXCEPTION = -1 # used to signal self-toaster-exceptions
+ INFO = 0
+ WARNING = 1
+ ERROR = 2
+ CRITICAL = 3
+
+ LOG_LEVEL = (
+ (INFO, "info"),
+ (WARNING, "warn"),
+ (ERROR, "error"),
+ (CRITICAL, "critical"),
+ (EXCEPTION, "toaster exception")
+ )
+
+ build = models.ForeignKey(Build)
+ task = models.ForeignKey(Task, blank = True, null=True)
+ level = models.IntegerField(choices=LOG_LEVEL, default=INFO)
+ message = models.TextField(blank=True, null=True)
+ pathname = models.FilePathField(max_length=255, blank=True)
+ lineno = models.IntegerField(null=True)
+
+ def __str__(self):
+ return force_bytes('%s %s %s' % (self.get_level_display(), self.message, self.build))
+
+def invalidate_cache(**kwargs):
+ from django.core.cache import cache
+ try:
+ cache.clear()
+ except Exception as e:
+ logger.warning("Problem with cache backend: Failed to clear cache: %s" % e)
+
+def signal_runbuilds():
+ """Send SIGUSR1 to runbuilds process"""
+ try:
+ with open(os.path.join(os.getenv('BUILDDIR', '.'),
+ '.runbuilds.pid')) as pidf:
+ os.kill(int(pidf.read()), SIGUSR1)
+ except FileNotFoundError:
+ logger.info("Stopping existing runbuilds: no current process found")
+
+class Distro(models.Model):
+ search_allowed_fields = ["name", "description", "layer_version__layer__name"]
+ up_date = models.DateTimeField(null = True, default = None)
+
+ layer_version = models.ForeignKey('Layer_Version')
+ name = models.CharField(max_length=255)
+ description = models.CharField(max_length=255)
+
+ def get_vcs_distro_file_link_url(self):
+ path = self.name+'.conf'
+ return self.layer_version.get_vcs_file_link_url(path)
+
+ def __unicode__(self):
+ return "Distro " + self.name + "(" + self.description + ")"
+
+django.db.models.signals.post_save.connect(invalidate_cache)
+django.db.models.signals.post_delete.connect(invalidate_cache)
+django.db.models.signals.m2m_changed.connect(invalidate_cache)
diff --git a/poky/bitbake/lib/toaster/tests/__init__.py b/poky/bitbake/lib/toaster/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/browser/README b/poky/bitbake/lib/toaster/tests/browser/README
new file mode 100644
index 000000000..352c4fe3e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/README
@@ -0,0 +1,74 @@
+# Running Toaster's browser-based test suite
+
+These tests require Selenium to be installed in your Python environment.
+
+The simplest way to install this is via pip3:
+
+ pip3 install selenium==2.53.2
+
+Note that if you use other versions of Selenium, some of the tests (such as
+tests.browser.test_js_unit_tests.TestJsUnitTests) may fail, as these rely on
+a Selenium test report with a version-specific format.
+
+To run tests against Chrome:
+
+* Download chromedriver for your host OS from
+ https://sites.google.com/a/chromium.org/chromedriver/downloads
+* On *nix systems, put chromedriver on PATH
+* On Windows, put chromedriver.exe in the same directory as chrome.exe
+
+To run tests against PhantomJS (headless):
+--NOTE - Selenium seems to be deprecating support for this mode ---
+* Download and install PhantomJS:
+ http://phantomjs.org/download.html
+* On *nix systems, put phantomjs on PATH
+* Not tested on Windows
+
+To run tests against Firefox, you may need to install the Marionette driver,
+depending on how new your version of Firefox is. One clue that you need to do
+this is if you see an exception like:
+
+ selenium.common.exceptions.WebDriverException: Message: The browser
+ appears to have exited before we could connect. If you specified
+ a log_file in the FirefoxBinary constructor, check it for details.
+
+See https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
+for installation instructions. Ensure that the Marionette executable (renamed
+as wires on Linux or wires.exe on Windows) is on your PATH; and use "marionette"
+as the browser string passed via TOASTER_TESTS_BROWSER (see below).
+
+(Note: The Toaster tests have been checked against Firefox 47 with the
+Marionette driver.)
+
+The test cases will instantiate a Selenium driver set by the
+TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified.
+
+To run tests against the Selenium Firefox Docker container:
+More explanation is located at https://wiki.yoctoproject.org/wiki/TipsAndTricks/TestingToasterWithContainers
+* Run the Selenium container:
+ ** docker run -it --rm=true -p 5900:5900 -p 4444:4444 --name=selenium selenium/standalone-firefox-debug:2.53.0
+ *** 5900 is the default vnc port. If you are runing a vnc server on your machine map a different port e.g. -p 6900:5900 and connect vnc client to 127.0.0.1:6900
+ *** 4444 is the default selenium sever port.
+* Run the tests
+ ** TOASTER_TESTS_BROWSER=http://127.0.0.1:4444/wd/hub TOASTER_TESTS_URL=http://172.17.0.1:8000 ./bitbake/lib/toaster/manage.py test --liveserver=172.17.0.1:8000 tests.browser
+ ** TOASTER_TESTS_BROWSER=remote TOASTER_REMOTE_HUB=http://127.0.0.1:4444/wd/hub ./bitbake/lib/toaster/manage.py test --liveserver=172.17.0.1:8000 tests.browser
+ *** TOASTER_REMOTE_HUB - This is the address for the Selenium Remote Web Driver hub. Assuming you ran the contianer with -p 4444:4444 it will be http://127.0.0.1:4444/wd/hub.
+ *** --liveserver=xxx tells Django to run the test server on an interface and port reachable by both host and container.
+ **** 172.17.0.1 is the default docker bridge on linux, viewable from inside and outside the contianers. Find it with "ip -4 addr show dev docker0"
+* connect to the vnc server to see the tests if you would like
+ ** xtightvncviewer 127.0.0.1:5900
+ ** note, you need to wait for the test container to come up before this can connect.
+
+Available drivers:
+
+* chrome (default)
+* firefox
+* marionette (for newer Firefoxes)
+* ie
+* phantomjs (deprecated)
+* remote
+
+e.g. to run the test suite with phantomjs where you have phantomjs installed
+in /home/me/apps/phantomjs:
+
+PATH=/home/me/apps/phantomjs/bin:$PATH TOASTER_TESTS_BROWSER=phantomjs manage.py test tests.browser
diff --git a/poky/bitbake/lib/toaster/tests/browser/__init__.py b/poky/bitbake/lib/toaster/tests/browser/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py b/poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py
new file mode 100644
index 000000000..08711e455
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/selenium_helpers.py
@@ -0,0 +1,34 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# The Wait class and some of SeleniumDriverHelper and SeleniumTestCase are
+# modified from Patchwork, released under the same licence terms as Toaster:
+# https://github.com/dlespiau/patchwork/blob/master/patchwork/tests.browser.py
+
+"""
+Helper methods for creating Toaster Selenium tests which run within
+the context of Django unit tests.
+"""
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
+
+class SeleniumTestCase(SeleniumTestCaseBase, StaticLiveServerTestCase):
+ pass
diff --git a/poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py b/poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
new file mode 100644
index 000000000..156d639b1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/selenium_helpers_base.py
@@ -0,0 +1,227 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# The Wait class and some of SeleniumDriverHelper and SeleniumTestCase are
+# modified from Patchwork, released under the same licence terms as Toaster:
+# https://github.com/dlespiau/patchwork/blob/master/patchwork/tests.browser.py
+
+"""
+Helper methods for creating Toaster Selenium tests which run within
+the context of Django unit tests.
+"""
+
+import os
+import time
+import unittest
+
+from django.contrib.staticfiles.testing import StaticLiveServerTestCase
+from selenium import webdriver
+from selenium.webdriver.support.ui import WebDriverWait
+from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
+from selenium.common.exceptions import NoSuchElementException, \
+ StaleElementReferenceException, TimeoutException
+
+def create_selenium_driver(cls,browser='chrome'):
+ # set default browser string based on env (if available)
+ env_browser = os.environ.get('TOASTER_TESTS_BROWSER')
+ if env_browser:
+ browser = env_browser
+
+ if browser == 'chrome':
+ return webdriver.Chrome(
+ service_args=["--verbose", "--log-path=selenium.log"]
+ )
+ elif browser == 'firefox':
+ return webdriver.Firefox()
+ elif browser == 'marionette':
+ capabilities = DesiredCapabilities.FIREFOX
+ capabilities['marionette'] = True
+ return webdriver.Firefox(capabilities=capabilities)
+ elif browser == 'ie':
+ return webdriver.Ie()
+ elif browser == 'phantomjs':
+ return webdriver.PhantomJS()
+ elif browser == 'remote':
+ # if we were to add yet another env variable like TOASTER_REMOTE_BROWSER
+ # we could let people pick firefox or chrome, left for later
+ remote_hub= os.environ.get('TOASTER_REMOTE_HUB')
+ driver = webdriver.Remote(remote_hub,
+ webdriver.DesiredCapabilities.FIREFOX.copy())
+
+ driver.get("http://%s:%s"%(cls.server_thread.host,cls.server_thread.port))
+ return driver
+ else:
+ msg = 'Selenium driver for browser %s is not available' % browser
+ raise RuntimeError(msg)
+
+class Wait(WebDriverWait):
+ """
+ Subclass of WebDriverWait with predetermined timeout and poll
+ frequency. Also deals with a wider variety of exceptions.
+ """
+ _TIMEOUT = 10
+ _POLL_FREQUENCY = 0.5
+
+ def __init__(self, driver):
+ super(Wait, self).__init__(driver, self._TIMEOUT, self._POLL_FREQUENCY)
+
+ def until(self, method, message=''):
+ """
+ Calls the method provided with the driver as an argument until the
+ return value is not False.
+ """
+
+ end_time = time.time() + self._timeout
+ while True:
+ try:
+ value = method(self._driver)
+ if value:
+ return value
+ except NoSuchElementException:
+ pass
+ except StaleElementReferenceException:
+ pass
+
+ time.sleep(self._poll)
+ if time.time() > end_time:
+ break
+
+ raise TimeoutException(message)
+
+ def until_not(self, method, message=''):
+ """
+ Calls the method provided with the driver as an argument until the
+ return value is False.
+ """
+
+ end_time = time.time() + self._timeout
+ while True:
+ try:
+ value = method(self._driver)
+ if not value:
+ return value
+ except NoSuchElementException:
+ return True
+ except StaleElementReferenceException:
+ pass
+
+ time.sleep(self._poll)
+ if time.time() > end_time:
+ break
+
+ raise TimeoutException(message)
+
+class SeleniumTestCaseBase(unittest.TestCase):
+ """
+ NB StaticLiveServerTestCase is used as the base test case so that
+ static files are served correctly in a Selenium test run context; see
+ https://docs.djangoproject.com/en/1.9/ref/contrib/staticfiles/#specialized-test-case-to-support-live-testing
+ """
+
+ @classmethod
+ def setUpClass(cls):
+ """ Create a webdriver driver at the class level """
+
+ super(SeleniumTestCaseBase, cls).setUpClass()
+
+ # instantiate the Selenium webdriver once for all the test methods
+ # in this test case
+ cls.driver = create_selenium_driver(cls)
+ cls.driver.maximize_window()
+
+ @classmethod
+ def tearDownClass(cls):
+ """ Clean up webdriver driver """
+
+ cls.driver.quit()
+ super(SeleniumTestCaseBase, cls).tearDownClass()
+
+ def get(self, url):
+ """
+ Selenium requires absolute URLs, so convert Django URLs returned
+ by resolve() or similar to absolute ones and get using the
+ webdriver instance.
+
+ url: a relative URL
+ """
+ abs_url = '%s%s' % (self.live_server_url, url)
+ self.driver.get(abs_url)
+
+ def find(self, selector):
+ """ Find single element by CSS selector """
+ return self.driver.find_element_by_css_selector(selector)
+
+ def find_all(self, selector):
+ """ Find all elements matching CSS selector """
+ return self.driver.find_elements_by_css_selector(selector)
+
+ def element_exists(self, selector):
+ """
+ Return True if one element matching selector exists,
+ False otherwise
+ """
+ return len(self.find_all(selector)) == 1
+
+ def focused_element(self):
+ """ Return the element which currently has focus on the page """
+ return self.driver.switch_to.active_element
+
+ def wait_until_present(self, selector):
+ """ Wait until element matching CSS selector is on the page """
+ is_present = lambda driver: self.find(selector)
+ msg = 'An element matching "%s" should be on the page' % selector
+ element = Wait(self.driver).until(is_present, msg)
+ return element
+
+ def wait_until_visible(self, selector):
+ """ Wait until element matching CSS selector is visible on the page """
+ is_visible = lambda driver: self.find(selector).is_displayed()
+ msg = 'An element matching "%s" should be visible' % selector
+ Wait(self.driver).until(is_visible, msg)
+ return self.find(selector)
+
+ def wait_until_focused(self, selector):
+ """ Wait until element matching CSS selector has focus """
+ is_focused = \
+ lambda driver: self.find(selector) == self.focused_element()
+ msg = 'An element matching "%s" should be focused' % selector
+ Wait(self.driver).until(is_focused, msg)
+ return self.find(selector)
+
+ def enter_text(self, selector, value):
+ """ Insert text into element matching selector """
+ # note that keyup events don't occur until the element is clicked
+ # (in the case of <input type="text"...>, for example), so simulate
+ # user clicking the element before inserting text into it
+ field = self.click(selector)
+
+ field.send_keys(value)
+ return field
+
+ def click(self, selector):
+ """ Click on element which matches CSS selector """
+ element = self.wait_until_visible(selector)
+ element.click()
+ return element
+
+ def get_page_source(self):
+ """ Get raw HTML for the current page """
+ return self.driver.page_source
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py b/poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
new file mode 100644
index 000000000..b86f29bdd
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_all_builds_page.py
@@ -0,0 +1,233 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, Build, Target
+
+
+class TestAllBuildsPage(SeleniumTestCase):
+ """ Tests for all builds page /builds/ """
+
+ PROJECT_NAME = 'test project'
+ CLI_BUILDS_PROJECT_NAME = 'command line builds'
+
+ def setUp(self):
+ bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
+ branch='master', dirpath='')
+ release = Release.objects.create(name='release1',
+ bitbake_version=bbv)
+ self.project1 = Project.objects.create_project(name=self.PROJECT_NAME,
+ release=release)
+ self.default_project = Project.objects.create_project(
+ name=self.CLI_BUILDS_PROJECT_NAME,
+ release=release
+ )
+ self.default_project.is_default = True
+ self.default_project.save()
+
+ # parameters for builds to associate with the projects
+ now = timezone.now()
+
+ self.project1_build_success = {
+ 'project': self.project1,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.SUCCEEDED
+ }
+
+ self.project1_build_failure = {
+ 'project': self.project1,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.FAILED
+ }
+
+ self.default_project_build_success = {
+ 'project': self.default_project,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.SUCCEEDED
+ }
+
+ def _get_build_time_element(self, build):
+ """
+ Return the HTML element containing the build time for a build
+ in the recent builds area
+ """
+ selector = 'div[data-latest-build-result="%s"] ' \
+ '[data-role="data-recent-build-buildtime-field"]' % build.id
+
+ # because this loads via Ajax, wait for it to be visible
+ self.wait_until_present(selector)
+
+ build_time_spans = self.find_all(selector)
+
+ self.assertEqual(len(build_time_spans), 1)
+
+ return build_time_spans[0]
+
+ def _get_row_for_build(self, build):
+ """ Get the table row for the build from the all builds table """
+ self.wait_until_present('#allbuildstable')
+
+ rows = self.find_all('#allbuildstable tr')
+
+ # look for the row with a download link on the recipe which matches the
+ # build ID
+ url = reverse('builddashboard', args=(build.id,))
+ selector = 'td.target a[href="%s"]' % url
+
+ found_row = None
+ for row in rows:
+
+ outcome_links = row.find_elements_by_css_selector(selector)
+ if len(outcome_links) == 1:
+ found_row = row
+ break
+
+ self.assertNotEqual(found_row, None)
+
+ return found_row
+
+ def test_show_tasks_with_suffix(self):
+ """ Task should be shown as suffix on build name """
+ build = Build.objects.create(**self.project1_build_success)
+ target = 'bash'
+ task = 'clean'
+ Target.objects.create(build=build, target=target, task=task)
+
+ url = reverse('all-builds')
+ self.get(url)
+ self.wait_until_present('td[class="target"]')
+
+ cell = self.find('td[class="target"]')
+ content = cell.get_attribute('innerHTML')
+ expected_text = '%s:%s' % (target, task)
+
+ self.assertTrue(re.search(expected_text, content),
+ '"target" cell should contain text %s' % expected_text)
+
+ def test_rebuild_buttons(self):
+ """
+ Test 'Rebuild' buttons in recent builds section
+
+ 'Rebuild' button should not be shown for command-line builds,
+ but should be shown for other builds
+ """
+ build1 = Build.objects.create(**self.project1_build_success)
+ default_build = Build.objects.create(**self.default_project_build_success)
+
+ url = reverse('all-builds')
+ self.get(url)
+
+ # shouldn't see a rebuild button for command-line builds
+ selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % default_build.id
+ run_again_button = self.find_all(selector)
+ self.assertEqual(len(run_again_button), 0,
+ 'should not see a rebuild button for cli builds')
+
+ # should see a rebuild button for non-command-line builds
+ selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % build1.id
+ run_again_button = self.find_all(selector)
+ self.assertEqual(len(run_again_button), 1,
+ 'should see a rebuild button for non-cli builds')
+
+ def test_tooltips_on_project_name(self):
+ """
+ Test tooltips shown next to project name in the main table
+
+ A tooltip should be present next to the command line
+ builds project name in the all builds page, but not for
+ other projects
+ """
+ Build.objects.create(**self.project1_build_success)
+ Build.objects.create(**self.default_project_build_success)
+
+ url = reverse('all-builds')
+ self.get(url)
+
+ # get the project name cells from the table
+ cells = self.find_all('#allbuildstable td[class="project"]')
+
+ selector = 'span.get-help'
+
+ for cell in cells:
+ content = cell.get_attribute('innerHTML')
+ help_icons = cell.find_elements_by_css_selector(selector)
+
+ if re.search(self.PROJECT_NAME, content):
+ # no help icon next to non-cli project name
+ msg = 'should not be a help icon for non-cli builds name'
+ self.assertEqual(len(help_icons), 0, msg)
+ elif re.search(self.CLI_BUILDS_PROJECT_NAME, content):
+ # help icon next to cli project name
+ msg = 'should be a help icon for cli builds name'
+ self.assertEqual(len(help_icons), 1, msg)
+ else:
+ msg = 'found unexpected project name cell in all builds table'
+ self.fail(msg)
+
+ def test_builds_time_links(self):
+ """
+ Successful builds should have links on the time column and in the
+ recent builds area; failed builds should not have links on the time column,
+ or in the recent builds area
+ """
+ build1 = Build.objects.create(**self.project1_build_success)
+ build2 = Build.objects.create(**self.project1_build_failure)
+
+ # add some targets to these builds so they have recipe links
+ # (and so we can find the row in the ToasterTable corresponding to
+ # a particular build)
+ Target.objects.create(build=build1, target='foo')
+ Target.objects.create(build=build2, target='bar')
+
+ url = reverse('all-builds')
+ self.get(url)
+
+ # test recent builds area for successful build
+ element = self._get_build_time_element(build1)
+ links = element.find_elements_by_css_selector('a')
+ msg = 'should be a link on the build time for a successful recent build'
+ self.assertEquals(len(links), 1, msg)
+
+ # test recent builds area for failed build
+ element = self._get_build_time_element(build2)
+ links = element.find_elements_by_css_selector('a')
+ msg = 'should not be a link on the build time for a failed recent build'
+ self.assertEquals(len(links), 0, msg)
+
+ # test the time column for successful build
+ build1_row = self._get_row_for_build(build1)
+ links = build1_row.find_elements_by_css_selector('td.time a')
+ msg = 'should be a link on the build time for a successful build'
+ self.assertEquals(len(links), 1, msg)
+
+ # test the time column for failed build
+ build2_row = self._get_row_for_build(build2)
+ links = build2_row.find_elements_by_css_selector('td.time a')
+ msg = 'should not be a link on the build time for a failed build'
+ self.assertEquals(len(links), 0, msg)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py b/poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
new file mode 100644
index 000000000..44da64075
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_all_projects_page.py
@@ -0,0 +1,217 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, Build
+from orm.models import ProjectVariable
+
+class TestAllProjectsPage(SeleniumTestCase):
+ """ Browser tests for projects page /projects/ """
+
+ PROJECT_NAME = 'test project'
+ CLI_BUILDS_PROJECT_NAME = 'command line builds'
+ MACHINE_NAME = 'delorean'
+
+ def setUp(self):
+ """ Add default project manually """
+ project = Project.objects.create_project(self.CLI_BUILDS_PROJECT_NAME, None)
+ self.default_project = project
+ self.default_project.is_default = True
+ self.default_project.save()
+
+ # this project is only set for some of the tests
+ self.project = None
+
+ self.release = None
+
+ def _add_build_to_default_project(self):
+ """ Add a build to the default project (not used in all tests) """
+ now = timezone.now()
+ build = Build.objects.create(project=self.default_project,
+ started_on=now,
+ completed_on=now)
+ build.save()
+
+ def _add_non_default_project(self):
+ """ Add another project """
+ bbv = BitbakeVersion.objects.create(name='test bbv', giturl='/tmp/',
+ branch='master', dirpath='')
+ self.release = Release.objects.create(name='test release',
+ branch_name='master',
+ bitbake_version=bbv)
+ self.project = Project.objects.create_project(self.PROJECT_NAME, self.release)
+ self.project.is_default = False
+ self.project.save()
+
+ # fake the MACHINE variable
+ project_var = ProjectVariable.objects.create(project=self.project,
+ name='MACHINE',
+ value=self.MACHINE_NAME)
+ project_var.save()
+
+ def _get_row_for_project(self, project_name):
+ """ Get the HTML row for a project, or None if not found """
+ self.wait_until_present('#projectstable tbody tr')
+ rows = self.find_all('#projectstable tbody tr')
+
+ # find the row with a project name matching the one supplied
+ found_row = None
+ for row in rows:
+ if re.search(project_name, row.get_attribute('innerHTML')):
+ found_row = row
+ break
+
+ return found_row
+
+ def test_default_project_hidden(self):
+ """
+ The default project should be hidden if it has no builds
+ and we should see the "no results" area
+ """
+ url = reverse('all-projects')
+ self.get(url)
+ self.wait_until_visible('#empty-state-projectstable')
+
+ rows = self.find_all('#projectstable tbody tr')
+ self.assertEqual(len(rows), 0, 'should be no projects displayed')
+
+ def test_default_project_has_build(self):
+ """ The default project should be shown if it has builds """
+ self._add_build_to_default_project()
+
+ url = reverse('all-projects')
+ self.get(url)
+
+ default_project_row = self._get_row_for_project(self.default_project.name)
+
+ self.assertNotEqual(default_project_row, None,
+ 'default project "cli builds" should be in page')
+
+ def test_default_project_release(self):
+ """
+ The release for the default project should display as
+ 'Not applicable'
+ """
+ # need a build, otherwise project doesn't display at all
+ self._add_build_to_default_project()
+
+ # another project to test, which should show release
+ self._add_non_default_project()
+
+ self.get(reverse('all-projects'))
+ self.wait_until_visible("#projectstable tr")
+
+ # find the row for the default project
+ default_project_row = self._get_row_for_project(self.default_project.name)
+
+ # check the release text for the default project
+ selector = 'span[data-project-field="release"] span.text-muted'
+ element = default_project_row.find_element_by_css_selector(selector)
+ text = element.text.strip()
+ self.assertEqual(text, 'Not applicable',
+ 'release should be "not applicable" for default project')
+
+ # find the row for the default project
+ other_project_row = self._get_row_for_project(self.project.name)
+
+ # check the link in the release cell for the other project
+ selector = 'span[data-project-field="release"]'
+ element = other_project_row.find_element_by_css_selector(selector)
+ text = element.text.strip()
+ self.assertEqual(text, self.release.name,
+ 'release name should be shown for non-default project')
+
+ def test_default_project_machine(self):
+ """
+ The machine for the default project should display as
+ 'Not applicable'
+ """
+ # need a build, otherwise project doesn't display at all
+ self._add_build_to_default_project()
+
+ # another project to test, which should show machine
+ self._add_non_default_project()
+
+ self.get(reverse('all-projects'))
+
+ self.wait_until_visible("#projectstable tr")
+
+ # find the row for the default project
+ default_project_row = self._get_row_for_project(self.default_project.name)
+
+ # check the machine cell for the default project
+ selector = 'span[data-project-field="machine"] span.text-muted'
+ element = default_project_row.find_element_by_css_selector(selector)
+ text = element.text.strip()
+ self.assertEqual(text, 'Not applicable',
+ 'machine should be not applicable for default project')
+
+ # find the row for the default project
+ other_project_row = self._get_row_for_project(self.project.name)
+
+ # check the link in the machine cell for the other project
+ selector = 'span[data-project-field="machine"]'
+ element = other_project_row.find_element_by_css_selector(selector)
+ text = element.text.strip()
+ self.assertEqual(text, self.MACHINE_NAME,
+ 'machine name should be shown for non-default project')
+
+ def test_project_page_links(self):
+ """
+ Test that links for the default project point to the builds
+ page /projects/X/builds for that project, and that links for
+ other projects point to their configuration pages /projects/X/
+ """
+
+ # need a build, otherwise project doesn't display at all
+ self._add_build_to_default_project()
+
+ # another project to test
+ self._add_non_default_project()
+
+ self.get(reverse('all-projects'))
+
+ # find the row for the default project
+ default_project_row = self._get_row_for_project(self.default_project.name)
+
+ # check the link on the name field
+ selector = 'span[data-project-field="name"] a'
+ element = default_project_row.find_element_by_css_selector(selector)
+ link_url = element.get_attribute('href').strip()
+ expected_url = reverse('projectbuilds', args=(self.default_project.id,))
+ msg = 'link on default project name should point to builds but was %s' % link_url
+ self.assertTrue(link_url.endswith(expected_url), msg)
+
+ # find the row for the other project
+ other_project_row = self._get_row_for_project(self.project.name)
+
+ # check the link for the other project
+ selector = 'span[data-project-field="name"] a'
+ element = other_project_row.find_element_by_css_selector(selector)
+ link_url = element.get_attribute('href').strip()
+ expected_url = reverse('project', args=(self.project.id,))
+ msg = 'link on project name should point to configuration but was %s' % link_url
+ self.assertTrue(link_url.endswith(expected_url), msg)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
new file mode 100644
index 000000000..f8ccb5452
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page.py
@@ -0,0 +1,347 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import Project, Release, BitbakeVersion, Build, LogMessage
+from orm.models import Layer, Layer_Version, Recipe, CustomImageRecipe, Variable
+
+class TestBuildDashboardPage(SeleniumTestCase):
+ """ Tests for the build dashboard /build/X """
+
+ def setUp(self):
+ bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
+ branch='master', dirpath="")
+ release = Release.objects.create(name='release1',
+ bitbake_version=bbv)
+ project = Project.objects.create_project(name='test project',
+ release=release)
+
+ now = timezone.now()
+
+ self.build1 = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now,
+ outcome=Build.SUCCEEDED)
+
+ self.build2 = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now,
+ outcome=Build.SUCCEEDED)
+
+ self.build3 = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now,
+ outcome=Build.FAILED)
+
+ # add Variable objects to the successful builds, as this is the criterion
+ # used to determine whether the left-hand panel should be displayed
+ Variable.objects.create(build=self.build1,
+ variable_name='Foo',
+ variable_value='Bar')
+ Variable.objects.create(build=self.build2,
+ variable_name='Foo',
+ variable_value='Bar')
+
+ # exception
+ msg1 = 'an exception was thrown'
+ self.exception_message = LogMessage.objects.create(
+ build=self.build1,
+ level=LogMessage.EXCEPTION,
+ message=msg1
+ )
+
+ # critical
+ msg2 = 'a critical error occurred'
+ self.critical_message = LogMessage.objects.create(
+ build=self.build1,
+ level=LogMessage.CRITICAL,
+ message=msg2
+ )
+
+ # error on the failed build
+ msg3 = 'an error occurred'
+ self.error_message = LogMessage.objects.create(
+ build=self.build3,
+ level=LogMessage.ERROR,
+ message=msg3
+ )
+
+ # warning on the failed build
+ msg4 = 'DANGER WILL ROBINSON'
+ self.warning_message = LogMessage.objects.create(
+ build=self.build3,
+ level=LogMessage.WARNING,
+ message=msg4
+ )
+
+ # recipes related to the build, for testing the edit custom image/new
+ # custom image buttons
+ layer = Layer.objects.create(name='alayer')
+ layer_version = Layer_Version.objects.create(
+ layer=layer, build=self.build1
+ )
+
+ # non-image recipes related to a build, for testing the new custom
+ # image button
+ layer_version2 = Layer_Version.objects.create(layer=layer,
+ build=self.build3)
+
+ # image recipes
+ self.image_recipe1 = Recipe.objects.create(
+ name='recipeA',
+ layer_version=layer_version,
+ file_path='/foo/recipeA.bb',
+ is_image=True
+ )
+ self.image_recipe2 = Recipe.objects.create(
+ name='recipeB',
+ layer_version=layer_version,
+ file_path='/foo/recipeB.bb',
+ is_image=True
+ )
+
+ # custom image recipes for this project
+ self.custom_image_recipe1 = CustomImageRecipe.objects.create(
+ name='customRecipeY',
+ project=project,
+ layer_version=layer_version,
+ file_path='/foo/customRecipeY.bb',
+ base_recipe=self.image_recipe1,
+ is_image=True
+ )
+ self.custom_image_recipe2 = CustomImageRecipe.objects.create(
+ name='customRecipeZ',
+ project=project,
+ layer_version=layer_version,
+ file_path='/foo/customRecipeZ.bb',
+ base_recipe=self.image_recipe2,
+ is_image=True
+ )
+
+ # custom image recipe for a different project (to test filtering
+ # of image recipes and custom image recipes is correct: this shouldn't
+ # show up in either query against self.build1)
+ self.custom_image_recipe3 = CustomImageRecipe.objects.create(
+ name='customRecipeOmega',
+ project=Project.objects.create(name='baz', release=release),
+ layer_version=Layer_Version.objects.create(
+ layer=layer, build=self.build2
+ ),
+ file_path='/foo/customRecipeOmega.bb',
+ base_recipe=self.image_recipe2,
+ is_image=True
+ )
+
+ # another non-image recipe (to test filtering of image recipes and
+ # custom image recipes is correct: this shouldn't show up in either
+ # for any build)
+ self.non_image_recipe = Recipe.objects.create(
+ name='nonImageRecipe',
+ layer_version=layer_version,
+ file_path='/foo/nonImageRecipe.bb',
+ is_image=False
+ )
+
+ def _get_build_dashboard(self, build):
+ """
+ Navigate to the build dashboard for build
+ """
+ url = reverse('builddashboard', args=(build.id,))
+ self.get(url)
+
+ def _get_build_dashboard_errors(self, build):
+ """
+ Get a list of HTML fragments representing the errors on the
+ dashboard for the Build object build
+ """
+ self._get_build_dashboard(build)
+ return self.find_all('#errors div.alert-danger')
+
+ def _check_for_log_message(self, message_elements, log_message):
+ """
+ Check that the LogMessage <log_message> has a representation in
+ the HTML elements <message_elements>.
+
+ message_elements: WebElements representing the log messages shown
+ in the build dashboard; each should have a <pre> element inside
+ it with a data-log-message-id attribute
+
+ log_message: orm.models.LogMessage instance
+ """
+ expected_text = log_message.message
+ expected_pk = str(log_message.pk)
+
+ found = False
+ for element in message_elements:
+ log_message_text = element.find_element_by_tag_name('pre').text.strip()
+ text_matches = (log_message_text == expected_text)
+
+ log_message_pk = element.get_attribute('data-log-message-id')
+ id_matches = (log_message_pk == expected_pk)
+
+ if text_matches and id_matches:
+ found = True
+ break
+
+ template_vars = (expected_text, expected_pk)
+ assertion_failed_msg = 'message not found: ' \
+ 'expected text "%s" and ID %s' % template_vars
+ self.assertTrue(found, assertion_failed_msg)
+
+ def _check_for_error_message(self, build, log_message):
+ """
+ Check whether the LogMessage instance <log_message> is
+ represented as an HTML error in the dashboard page for the Build object
+ build
+ """
+ errors = self._get_build_dashboard_errors(build)
+ self._check_for_log_message(errors, log_message)
+
+ def _check_labels_in_modal(self, modal, expected):
+ """
+ Check that the text values of the <label> elements inside
+ the WebElement modal match the list of text values in expected
+ """
+ # labels containing the radio buttons we're testing for
+ labels = modal.find_elements_by_css_selector(".radio")
+
+ labels_text = [lab.text for lab in labels]
+ self.assertEqual(len(labels_text), len(expected))
+
+ for expected_text in expected:
+ self.assertTrue(expected_text in labels_text,
+ "Could not find %s in %s" % (expected_text,
+ labels_text))
+
+ def test_exceptions_show_as_errors(self):
+ """
+ LogMessages with level EXCEPTION should display in the errors
+ section of the page
+ """
+ self._check_for_error_message(self.build1, self.exception_message)
+
+ def test_criticals_show_as_errors(self):
+ """
+ LogMessages with level CRITICAL should display in the errors
+ section of the page
+ """
+ self._check_for_error_message(self.build1, self.critical_message)
+
+ def test_edit_custom_image_button(self):
+ """
+ A build which built two custom images should present a modal which lets
+ the user choose one of them to edit
+ """
+ self._get_build_dashboard(self.build1)
+
+ # click the "edit custom image" button, which populates the modal
+ selector = '[data-role="edit-custom-image-trigger"]'
+ self.click(selector)
+
+ modal = self.driver.find_element_by_id('edit-custom-image-modal')
+ self.wait_until_visible("#edit-custom-image-modal")
+
+ # recipes we expect to see in the edit custom image modal
+ expected_recipes = [
+ self.custom_image_recipe1.name,
+ self.custom_image_recipe2.name
+ ]
+
+ self._check_labels_in_modal(modal, expected_recipes)
+
+ def test_new_custom_image_button(self):
+ """
+ Check that a build with multiple images and custom images presents
+ all of them as options for creating a new custom image from
+ """
+ self._get_build_dashboard(self.build1)
+
+ # click the "new custom image" button, which populates the modal
+ selector = '[data-role="new-custom-image-trigger"]'
+ self.click(selector)
+
+ modal = self.driver.find_element_by_id('new-custom-image-modal')
+ self.wait_until_visible("#new-custom-image-modal")
+
+ # recipes we expect to see in the new custom image modal
+ expected_recipes = [
+ self.image_recipe1.name,
+ self.image_recipe2.name,
+ self.custom_image_recipe1.name,
+ self.custom_image_recipe2.name
+ ]
+
+ self._check_labels_in_modal(modal, expected_recipes)
+
+ def test_new_custom_image_button_no_image(self):
+ """
+ Check that a build which builds non-image recipes doesn't show
+ the new custom image button on the dashboard.
+ """
+ self._get_build_dashboard(self.build3)
+ selector = '[data-role="new-custom-image-trigger"]'
+ self.assertFalse(self.element_exists(selector),
+ 'new custom image button should not show for builds which ' \
+ 'don\'t have any image recipes')
+
+ def test_left_panel(self):
+ """"
+ Builds which succeed should have a left panel and a build summary
+ """
+ self._get_build_dashboard(self.build1)
+
+ left_panel = self.find_all('#nav')
+ self.assertEqual(len(left_panel), 1)
+
+ build_summary = self.find_all('[data-role="build-summary-heading"]')
+ self.assertEqual(len(build_summary), 1)
+
+ def test_failed_no_left_panel(self):
+ """
+ Builds which fail should have no left panel and no build summary
+ """
+ self._get_build_dashboard(self.build3)
+
+ left_panel = self.find_all('#nav')
+ self.assertEqual(len(left_panel), 0)
+
+ build_summary = self.find_all('[data-role="build-summary-heading"]')
+ self.assertEqual(len(build_summary), 0)
+
+ def test_failed_shows_errors_and_warnings(self):
+ """
+ Failed builds should still show error and warning messages
+ """
+ self._get_build_dashboard(self.build3)
+
+ errors = self.find_all('#errors div.alert-danger')
+ self._check_for_log_message(errors, self.error_message)
+
+ # expand the warnings area
+ self.click('#warning-toggle')
+ self.wait_until_visible('#warnings div.alert-warning')
+
+ warnings = self.find_all('#warnings div.alert-warning')
+ self._check_for_log_message(warnings, self.warning_message)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py
new file mode 100644
index 000000000..1c627ad49
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_artifacts.py
@@ -0,0 +1,222 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import Project, Release, BitbakeVersion, Build, Target, Package
+from orm.models import Target_Image_File, TargetSDKFile, TargetKernelFile
+from orm.models import Target_Installed_Package, Variable
+
+class TestBuildDashboardPageArtifacts(SeleniumTestCase):
+ """ Tests for artifacts on the build dashboard /build/X """
+
+ def setUp(self):
+ bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
+ branch='master', dirpath="")
+ release = Release.objects.create(name='release1',
+ bitbake_version=bbv)
+ self.project = Project.objects.create_project(name='test project',
+ release=release)
+
+ def _get_build_dashboard(self, build):
+ """
+ Navigate to the build dashboard for build
+ """
+ url = reverse('builddashboard', args=(build.id,))
+ self.get(url)
+
+ def _has_build_artifacts_heading(self):
+ """
+ Check whether the "Build artifacts" heading is visible (True if it
+ is, False otherwise).
+ """
+ return self.element_exists('[data-heading="build-artifacts"]')
+
+ def _has_images_menu_option(self):
+ """
+ Try to get the "Images" list element from the left-hand menu in the
+ build dashboard, and return True if it is present, False otherwise.
+ """
+ return self.element_exists('li.nav-header[data-menu-heading="images"]')
+
+ def test_no_artifacts(self):
+ """
+ If a build produced no artifacts, the artifacts heading and images
+ menu option shouldn't show.
+ """
+ now = timezone.now()
+ build = Build.objects.create(project=self.project,
+ started_on=now, completed_on=now, outcome=Build.SUCCEEDED)
+
+ Target.objects.create(is_image=False, build=build, task='',
+ target='mpfr-native')
+
+ self._get_build_dashboard(build)
+
+ # check build artifacts heading
+ msg = 'Build artifacts heading should not be displayed for non-image' \
+ 'builds'
+ self.assertFalse(self._has_build_artifacts_heading(), msg)
+
+ # check "Images" option in left-hand menu (should not be there)
+ msg = 'Images option should not be shown in left-hand menu'
+ self.assertFalse(self._has_images_menu_option(), msg)
+
+ def test_sdk_artifacts(self):
+ """
+ If a build produced SDK artifacts, they should be shown, but the section
+ for image files and the images menu option should be hidden.
+
+ The packages count and size should also be hidden.
+ """
+ now = timezone.now()
+ build = Build.objects.create(project=self.project,
+ started_on=now, completed_on=timezone.now(),
+ outcome=Build.SUCCEEDED)
+
+ target = Target.objects.create(is_image=True, build=build,
+ task='populate_sdk', target='core-image-minimal')
+
+ sdk_file1 = TargetSDKFile.objects.create(target=target,
+ file_size=100000,
+ file_name='/home/foo/core-image-minimal.toolchain.sh')
+
+ sdk_file2 = TargetSDKFile.objects.create(target=target,
+ file_size=120000,
+ file_name='/home/foo/x86_64.toolchain.sh')
+
+ self._get_build_dashboard(build)
+
+ # check build artifacts heading
+ msg = 'Build artifacts heading should be displayed for SDK ' \
+ 'builds which generate artifacts'
+ self.assertTrue(self._has_build_artifacts_heading(), msg)
+
+ # check "Images" option in left-hand menu (should not be there)
+ msg = 'Images option should not be shown in left-hand menu for ' \
+ 'builds which didn\'t generate an image file'
+ self.assertFalse(self._has_images_menu_option(), msg)
+
+ # check links to SDK artifacts
+ sdk_artifact_links = self.find_all('[data-links="sdk-artifacts"] li')
+ self.assertEqual(len(sdk_artifact_links), 2,
+ 'should be links to 2 SDK artifacts')
+
+ # package count and size should not be visible, no link on
+ # target name
+ selector = '[data-value="target-package-count"]'
+ self.assertFalse(self.element_exists(selector),
+ 'package count should not be shown for non-image builds')
+
+ selector = '[data-value="target-package-size"]'
+ self.assertFalse(self.element_exists(selector),
+ 'package size should not be shown for non-image builds')
+
+ selector = '[data-link="target-packages"]'
+ self.assertFalse(self.element_exists(selector),
+ 'link to target packages should not be on target heading')
+
+ def test_image_artifacts(self):
+ """
+ If a build produced image files, kernel artifacts, and manifests,
+ they should all be shown, as well as the image link in the left-hand
+ menu.
+
+ The packages count and size should be shown, with a link to the
+ package display page.
+ """
+ now = timezone.now()
+ build = Build.objects.create(project=self.project,
+ started_on=now, completed_on=timezone.now(),
+ outcome=Build.SUCCEEDED)
+
+ # add a variable to the build so that it counts as "started"
+ Variable.objects.create(build=build,
+ variable_name='Christopher',
+ variable_value='Lee')
+
+ target = Target.objects.create(is_image=True, build=build,
+ task='', target='core-image-minimal',
+ license_manifest_path='/home/foo/license.manifest',
+ package_manifest_path='/home/foo/package.manifest')
+
+ image_file = Target_Image_File.objects.create(target=target,
+ file_name='/home/foo/core-image-minimal.ext4', file_size=9000)
+
+ kernel_file1 = TargetKernelFile.objects.create(target=target,
+ file_name='/home/foo/bzImage', file_size=2000)
+
+ kernel_file2 = TargetKernelFile.objects.create(target=target,
+ file_name='/home/foo/bzImage', file_size=2000)
+
+ package = Package.objects.create(build=build, name='foo', size=1024,
+ installed_name='foo1')
+ installed_package = Target_Installed_Package.objects.create(
+ target=target, package=package)
+
+ self._get_build_dashboard(build)
+
+ # check build artifacts heading
+ msg = 'Build artifacts heading should be displayed for image ' \
+ 'builds'
+ self.assertTrue(self._has_build_artifacts_heading(), msg)
+
+ # check "Images" option in left-hand menu (should be there)
+ msg = 'Images option should be shown in left-hand menu for image builds'
+ self.assertTrue(self._has_images_menu_option(), msg)
+
+ # check link to image file
+ selector = '[data-links="image-artifacts"] li'
+ self.assertTrue(self.element_exists(selector),
+ 'should be a link to the image file (selector %s)' % selector)
+
+ # check links to kernel artifacts
+ kernel_artifact_links = \
+ self.find_all('[data-links="kernel-artifacts"] li')
+ self.assertEqual(len(kernel_artifact_links), 2,
+ 'should be links to 2 kernel artifacts')
+
+ # check manifest links
+ selector = 'a[data-link="license-manifest"]'
+ self.assertTrue(self.element_exists(selector),
+ 'should be a link to the license manifest (selector %s)' % selector)
+
+ selector = 'a[data-link="package-manifest"]'
+ self.assertTrue(self.element_exists(selector),
+ 'should be a link to the package manifest (selector %s)' % selector)
+
+ # check package count and size, link on target name
+ selector = '[data-value="target-package-count"]'
+ element = self.find(selector)
+ self.assertEquals(element.text, '1',
+ 'package count should be shown for image builds')
+
+ selector = '[data-value="target-package-size"]'
+ element = self.find(selector)
+ self.assertEquals(element.text, '1.0 KB',
+ 'package size should be shown for image builds')
+
+ selector = '[data-link="target-packages"]'
+ self.assertTrue(self.element_exists(selector),
+ 'link to target packages should be on target heading')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py
new file mode 100644
index 000000000..ed18324e5
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_recipes.py
@@ -0,0 +1,66 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
+from orm.models import Target
+
+class TestBuilddashboardPageRecipes(SeleniumTestCase):
+ """ Test build dashboard recipes sub-page """
+
+ def setUp(self):
+ project = Project.objects.get_or_create_default_project()
+
+ now = timezone.now()
+
+ self.build = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now)
+
+ layer = Layer.objects.create()
+
+ layer_version = Layer_Version.objects.create(layer=layer,
+ build=self.build)
+
+ recipe = Recipe.objects.create(layer_version=layer_version)
+
+ task = Task.objects.create(build=self.build, recipe=recipe, order=1)
+
+ Target.objects.create(build=self.build, task=task, target='do_build')
+
+ def test_build_recipes_columns(self):
+ """
+ Check that non-hideable columns of the table on the recipes sub-page
+ are disabled on the edit columns dropdown.
+ """
+ url = reverse('recipes', args=(self.build.id,))
+ self.get(url)
+
+ self.wait_until_visible('#edit-columns-button')
+
+ # check that options for the non-hideable columns are disabled
+ non_hideable = ['name', 'version']
+
+ for column in non_hideable:
+ selector = 'input#checkbox-%s[disabled="disabled"]' % column
+ self.wait_until_present(selector)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py
new file mode 100644
index 000000000..da50f1601
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_builddashboard_page_tasks.py
@@ -0,0 +1,65 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
+from orm.models import Target
+
+class TestBuilddashboardPageTasks(SeleniumTestCase):
+ """ Test build dashboard tasks sub-page """
+
+ def setUp(self):
+ project = Project.objects.get_or_create_default_project()
+
+ now = timezone.now()
+
+ self.build = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=now)
+
+ layer = Layer.objects.create()
+
+ layer_version = Layer_Version.objects.create(layer=layer)
+
+ recipe = Recipe.objects.create(layer_version=layer_version)
+
+ task = Task.objects.create(build=self.build, recipe=recipe, order=1)
+
+ Target.objects.create(build=self.build, task=task, target='do_build')
+
+ def test_build_tasks_columns(self):
+ """
+ Check that non-hideable columns of the table on the tasks sub-page
+ are disabled on the edit columns dropdown.
+ """
+ url = reverse('tasks', args=(self.build.id,))
+ self.get(url)
+
+ self.wait_until_visible('#edit-columns-button')
+
+ # check that options for the non-hideable columns are disabled
+ non_hideable = ['order', 'task_name', 'recipe__name']
+
+ for column in non_hideable:
+ selector = 'input#checkbox-%s[disabled="disabled"]' % column
+ self.wait_until_present(selector)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py b/poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py
new file mode 100644
index 000000000..3c0b96252
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_js_unit_tests.py
@@ -0,0 +1,57 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+Run the js unit tests
+"""
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+import logging
+
+logger = logging.getLogger("toaster")
+
+
+class TestJsUnitTests(SeleniumTestCase):
+ """ Test landing page shows the Toaster brand """
+
+ fixtures = ['toastergui-unittest-data']
+
+ def test_that_js_unit_tests_pass(self):
+ url = reverse('js-unit-tests')
+ self.get(url)
+ self.wait_until_present('#qunit-testresult .failed')
+
+ failed = self.find("#qunit-testresult .failed").text
+ passed = self.find("#qunit-testresult .passed").text
+ total = self.find("#qunit-testresult .total").text
+
+ logger.info("Js unit tests completed %s out of %s passed, %s failed",
+ passed,
+ total,
+ failed)
+
+ failed_tests = self.find_all("li .fail .test-message")
+ for fail in failed_tests:
+ logger.error("JS unit test failed: %s" % fail.text)
+
+ self.assertEqual(failed, '0',
+ "%s JS unit tests failed" % failed)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_landing_page.py b/poky/bitbake/lib/toaster/tests/browser/test_landing_page.py
new file mode 100644
index 000000000..4d4cd660f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_landing_page.py
@@ -0,0 +1,108 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import Project, Build
+
+class TestLandingPage(SeleniumTestCase):
+ """ Tests for redirects on the landing page """
+
+ PROJECT_NAME = 'test project'
+ LANDING_PAGE_TITLE = 'This is Toaster'
+ CLI_BUILDS_PROJECT_NAME = 'command line builds'
+
+ def setUp(self):
+ """ Add default project manually """
+ self.project = Project.objects.create_project(
+ self.CLI_BUILDS_PROJECT_NAME,
+ None
+ )
+ self.project.is_default = True
+ self.project.save()
+
+ def test_only_default_project(self):
+ """
+ No projects except default
+ => should see the landing page
+ """
+ self.get(reverse('landing'))
+ self.assertTrue(self.LANDING_PAGE_TITLE in self.get_page_source())
+
+ def test_default_project_has_build(self):
+ """
+ Default project has a build, no other projects
+ => should see the builds page
+ """
+ now = timezone.now()
+ build = Build.objects.create(project=self.project,
+ started_on=now,
+ completed_on=now)
+ build.save()
+
+ self.get(reverse('landing'))
+
+ elements = self.find_all('#allbuildstable')
+ self.assertEqual(len(elements), 1, 'should redirect to builds')
+ content = self.get_page_source()
+ self.assertFalse(self.PROJECT_NAME in content,
+ 'should not show builds for project %s' % self.PROJECT_NAME)
+ self.assertTrue(self.CLI_BUILDS_PROJECT_NAME in content,
+ 'should show builds for cli project')
+
+ def test_user_project_exists(self):
+ """
+ User has added a project (without builds)
+ => should see the projects page
+ """
+ user_project = Project.objects.create_project('foo', None)
+ user_project.save()
+
+ self.get(reverse('landing'))
+
+ elements = self.find_all('#projectstable')
+ self.assertEqual(len(elements), 1, 'should redirect to projects')
+
+ def test_user_project_has_build(self):
+ """
+ User has added a project (with builds), command line builds doesn't
+ => should see the builds page
+ """
+ user_project = Project.objects.create_project(self.PROJECT_NAME, None)
+ user_project.save()
+
+ now = timezone.now()
+ build = Build.objects.create(project=user_project,
+ started_on=now,
+ completed_on=now)
+ build.save()
+
+ self.get(reverse('landing'))
+
+ elements = self.find_all('#allbuildstable')
+ self.assertEqual(len(elements), 1, 'should redirect to builds')
+ content = self.get_page_source()
+ self.assertTrue(self.PROJECT_NAME in content,
+ 'should show builds for project %s' % self.PROJECT_NAME)
+ self.assertFalse(self.CLI_BUILDS_PROJECT_NAME in content,
+ 'should not show builds for cli project')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py b/poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
new file mode 100644
index 000000000..f24fb093a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_layerdetails_page.py
@@ -0,0 +1,216 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import Layer, Layer_Version, Project, LayerSource, Release
+from orm.models import BitbakeVersion
+
+from selenium.webdriver.support import expected_conditions as EC
+from selenium.webdriver.support.ui import WebDriverWait
+from selenium.webdriver.common.by import By
+
+
+class TestLayerDetailsPage(SeleniumTestCase):
+ """ Test layerdetails page works correctly """
+
+ def __init__(self, *args, **kwargs):
+ super(TestLayerDetailsPage, self).__init__(*args, **kwargs)
+
+ self.initial_values = None
+ self.url = None
+ self.imported_layer_version = None
+
+ def setUp(self):
+ release = Release.objects.create(
+ name='baz',
+ bitbake_version=BitbakeVersion.objects.create(name='v1')
+ )
+
+ # project to add new custom images to
+ self.project = Project.objects.create(name='foo', release=release)
+
+ name = "meta-imported"
+ vcs_url = "git://example.com/meta-imported"
+ subdir = "/layer"
+ gitrev = "d33d"
+ summary = "A imported layer"
+ description = "This was imported"
+
+ imported_layer = Layer.objects.create(name=name,
+ vcs_url=vcs_url,
+ summary=summary,
+ description=description)
+
+ self.imported_layer_version = Layer_Version.objects.create(
+ layer=imported_layer,
+ layer_source=LayerSource.TYPE_IMPORTED,
+ branch=gitrev,
+ commit=gitrev,
+ dirpath=subdir,
+ project=self.project)
+
+ self.initial_values = [name, vcs_url, subdir, gitrev, summary,
+ description]
+ self.url = reverse('layerdetails',
+ args=(self.project.pk,
+ self.imported_layer_version.pk))
+
+ def test_edit_layerdetails(self):
+ """ Edit all the editable fields for the layer refresh the page and
+ check that the new values exist"""
+
+ self.get(self.url)
+
+ self.click("#add-remove-layer-btn")
+ self.click("#edit-layer-source")
+ self.click("#repo")
+
+ self.wait_until_visible("#layer-git-repo-url")
+
+ # Open every edit box
+ for btn in self.find_all("dd .glyphicon-edit"):
+ btn.click()
+
+ # Wait for the inputs to become visible after animation
+ self.wait_until_visible("#layer-git input[type=text]")
+ self.wait_until_visible("dd textarea")
+ self.wait_until_visible("dd .change-btn")
+
+ # Edit each value
+ for inputs in self.find_all("#layer-git input[type=text]") + \
+ self.find_all("dd textarea"):
+ # ignore the tt inputs (twitter typeahead input)
+ if "tt-" in inputs.get_attribute("class"):
+ continue
+
+ value = inputs.get_attribute("value")
+
+ self.assertTrue(value in self.initial_values,
+ "Expecting any of \"%s\"but got \"%s\"" %
+ (self.initial_values, value))
+
+ inputs.send_keys("-edited")
+
+ # Save the new values
+ for save_btn in self.find_all(".change-btn"):
+ save_btn.click()
+
+ self.click("#save-changes-for-switch")
+ self.wait_until_visible("#edit-layer-source")
+
+ # Refresh the page to see if the new values are returned
+ self.get(self.url)
+
+ new_values = ["%s-edited" % old_val
+ for old_val in self.initial_values]
+
+ for inputs in self.find_all('#layer-git input[type="text"]') + \
+ self.find_all('dd textarea'):
+ # ignore the tt inputs (twitter typeahead input)
+ if "tt-" in inputs.get_attribute("class"):
+ continue
+
+ value = inputs.get_attribute("value")
+
+ self.assertTrue(value in new_values,
+ "Expecting any of \"%s\" but got \"%s\"" %
+ (new_values, value))
+
+ # Now convert it to a local layer
+ self.click("#edit-layer-source")
+ self.click("#dir")
+ dir_input = self.wait_until_visible("#layer-dir-path-in-details")
+
+ new_dir = "/home/test/my-meta-dir"
+ dir_input.send_keys(new_dir)
+
+ self.click("#save-changes-for-switch")
+ self.wait_until_visible("#edit-layer-source")
+
+ # Refresh the page to see if the new values are returned
+ self.get(self.url)
+ dir_input = self.find("#layer-dir-path-in-details")
+ self.assertTrue(new_dir in dir_input.get_attribute("value"),
+ "Expected %s in the dir value for layer directory" %
+ new_dir)
+
+ def test_delete_layer(self):
+ """ Delete the layer """
+
+ self.get(self.url)
+
+ # Wait for the tables to load to avoid a race condition where the
+ # toaster tables have made an async request. If the layer is deleted
+ # before the request finishes it will cause an exception and fail this
+ # test.
+ wait = WebDriverWait(self.driver, 30)
+
+ wait.until(EC.text_to_be_present_in_element(
+ (By.CLASS_NAME,
+ "table-count-recipestable"), "0"))
+
+ wait.until(EC.text_to_be_present_in_element(
+ (By.CLASS_NAME,
+ "table-count-machinestable"), "0"))
+
+ self.click('a[data-target="#delete-layer-modal"]')
+ self.wait_until_visible("#delete-layer-modal")
+ self.click("#layer-delete-confirmed")
+
+ notification = self.wait_until_visible("#change-notification-msg")
+ expected_text = "You have deleted 1 layer from your project: %s" % \
+ self.imported_layer_version.layer.name
+
+ self.assertTrue(expected_text in notification.text,
+ "Expected notification text \"%s\" not found instead"
+ "it was \"%s\"" %
+ (expected_text, notification.text))
+
+ def test_addrm_to_project(self):
+ self.get(self.url)
+
+ # Add the layer
+ self.click("#add-remove-layer-btn")
+
+ notification = self.wait_until_visible("#change-notification-msg")
+
+ expected_text = "You have added 1 layer to your project: %s" % \
+ self.imported_layer_version.layer.name
+
+ self.assertTrue(expected_text in notification.text,
+ "Expected notification text %s not found was "
+ " \"%s\" instead" %
+ (expected_text, notification.text))
+
+ # Remove the layer
+ self.click("#add-remove-layer-btn")
+
+ notification = self.wait_until_visible("#change-notification-msg")
+
+ expected_text = "You have removed 1 layer from your project: %s" % \
+ self.imported_layer_version.layer.name
+
+ self.assertTrue(expected_text in notification.text,
+ "Expected notification text %s not found was "
+ " \"%s\" instead" %
+ (expected_text, notification.text))
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py b/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py
new file mode 100644
index 000000000..abc0b0bc8
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_most_recent_builds_states.py
@@ -0,0 +1,211 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+from tests.browser.selenium_helpers_base import Wait
+from orm.models import Project, Build, Task, Recipe, Layer, Layer_Version
+from bldcontrol.models import BuildRequest
+
+class TestMostRecentBuildsStates(SeleniumTestCase):
+ """ Test states update correctly in most recent builds area """
+
+ def _create_build_request(self):
+ project = Project.objects.get_or_create_default_project()
+
+ now = timezone.now()
+
+ build = Build.objects.create(project=project, build_name='fakebuild',
+ started_on=now, completed_on=now)
+
+ return BuildRequest.objects.create(build=build, project=project,
+ state=BuildRequest.REQ_QUEUED)
+
+ def _create_recipe(self):
+ """ Add a recipe to the database and return it """
+ layer = Layer.objects.create()
+ layer_version = Layer_Version.objects.create(layer=layer)
+ return Recipe.objects.create(name='foo', layer_version=layer_version)
+
+ def _check_build_states(self, build_request):
+ recipes_to_parse = 10
+ url = reverse('all-builds')
+ self.get(url)
+
+ build = build_request.build
+ base_selector = '[data-latest-build-result="%s"] ' % build.id
+
+ # build queued; check shown as queued
+ selector = base_selector + '[data-build-state="Queued"]'
+ element = self.wait_until_visible(selector)
+ self.assertRegexpMatches(element.get_attribute('innerHTML'),
+ 'Build queued', 'build should show queued status')
+
+ # waiting for recipes to be parsed
+ build.outcome = Build.IN_PROGRESS
+ build.recipes_to_parse = recipes_to_parse
+ build.recipes_parsed = 0
+
+ build_request.state = BuildRequest.REQ_INPROGRESS
+ build_request.save()
+
+ self.get(url)
+
+ selector = base_selector + '[data-build-state="Parsing"]'
+ element = self.wait_until_visible(selector)
+
+ bar_selector = '#recipes-parsed-percentage-bar-%s' % build.id
+ bar_element = element.find_element_by_css_selector(bar_selector)
+ self.assertEqual(bar_element.value_of_css_property('width'), '0px',
+ 'recipe parse progress should be at 0')
+
+ # recipes being parsed; check parse progress
+ build.recipes_parsed = 5
+ build.save()
+
+ self.get(url)
+
+ element = self.wait_until_visible(selector)
+ bar_element = element.find_element_by_css_selector(bar_selector)
+ recipe_bar_updated = lambda driver: \
+ bar_element.get_attribute('style') == 'width: 50%;'
+ msg = 'recipe parse progress bar should update to 50%'
+ element = Wait(self.driver).until(recipe_bar_updated, msg)
+
+ # all recipes parsed, task started, waiting for first task to finish;
+ # check status is shown as "Tasks starting..."
+ build.recipes_parsed = recipes_to_parse
+ build.save()
+
+ recipe = self._create_recipe()
+ task1 = Task.objects.create(build=build, recipe=recipe,
+ task_name='Lionel')
+ task2 = Task.objects.create(build=build, recipe=recipe,
+ task_name='Jeffries')
+
+ self.get(url)
+
+ selector = base_selector + '[data-build-state="Starting"]'
+ element = self.wait_until_visible(selector)
+ self.assertRegexpMatches(element.get_attribute('innerHTML'),
+ 'Tasks starting', 'build should show "tasks starting" status')
+
+ # first task finished; check tasks progress bar
+ task1.order = 1
+ task1.save()
+
+ self.get(url)
+
+ selector = base_selector + '[data-build-state="In Progress"]'
+ element = self.wait_until_visible(selector)
+
+ bar_selector = '#build-pc-done-bar-%s' % build.id
+ bar_element = element.find_element_by_css_selector(bar_selector)
+
+ task_bar_updated = lambda driver: \
+ bar_element.get_attribute('style') == 'width: 50%;'
+ msg = 'tasks progress bar should update to 50%'
+ element = Wait(self.driver).until(task_bar_updated, msg)
+
+ # last task finished; check tasks progress bar updates
+ task2.order = 2
+ task2.save()
+
+ self.get(url)
+
+ element = self.wait_until_visible(selector)
+ bar_element = element.find_element_by_css_selector(bar_selector)
+ task_bar_updated = lambda driver: \
+ bar_element.get_attribute('style') == 'width: 100%;'
+ msg = 'tasks progress bar should update to 100%'
+ element = Wait(self.driver).until(task_bar_updated, msg)
+
+ def test_states_to_success(self):
+ """
+ Test state transitions in the recent builds area for a build which
+ completes successfully.
+ """
+ build_request = self._create_build_request()
+
+ self._check_build_states(build_request)
+
+ # all tasks complete and build succeeded; check success state shown
+ build = build_request.build
+ build.outcome = Build.SUCCEEDED
+ build.save()
+
+ selector = '[data-latest-build-result="%s"] ' \
+ '[data-build-state="Succeeded"]' % build.id
+ element = self.wait_until_visible(selector)
+
+ def test_states_to_failure(self):
+ """
+ Test state transitions in the recent builds area for a build which
+ completes in a failure.
+ """
+ build_request = self._create_build_request()
+
+ self._check_build_states(build_request)
+
+ # all tasks complete and build succeeded; check fail state shown
+ build = build_request.build
+ build.outcome = Build.FAILED
+ build.save()
+
+ selector = '[data-latest-build-result="%s"] ' \
+ '[data-build-state="Failed"]' % build.id
+ element = self.wait_until_visible(selector)
+
+ def test_states_cancelling(self):
+ """
+ Test that most recent build area updates correctly for a build
+ which is cancelled.
+ """
+ url = reverse('all-builds')
+
+ build_request = self._create_build_request()
+ build = build_request.build
+
+ # cancel the build
+ build_request.state = BuildRequest.REQ_CANCELLING
+ build_request.save()
+
+ self.get(url)
+
+ # check cancelling state
+ selector = '[data-latest-build-result="%s"] ' \
+ '[data-build-state="Cancelling"]' % build.id
+ element = self.wait_until_visible(selector)
+ self.assertRegexpMatches(element.get_attribute('innerHTML'),
+ 'Cancelling the build', 'build should show "cancelling" status')
+
+ # check cancelled state
+ build.outcome = Build.CANCELLED
+ build.save()
+
+ self.get(url)
+
+ selector = '[data-latest-build-result="%s"] ' \
+ '[data-build-state="Cancelled"]' % build.id
+ element = self.wait_until_visible(selector)
+ self.assertRegexpMatches(element.get_attribute('innerHTML'),
+ 'Build cancelled', 'build should show "cancelled" status')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py b/poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
new file mode 100644
index 000000000..ab5a8e66b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
@@ -0,0 +1,161 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, ProjectLayer, Layer
+from orm.models import Layer_Version, Recipe, CustomImageRecipe
+
+
+class TestNewCustomImagePage(SeleniumTestCase):
+ CUSTOM_IMAGE_NAME = 'roopa-doopa'
+
+ def setUp(self):
+ release = Release.objects.create(
+ name='baz',
+ bitbake_version=BitbakeVersion.objects.create(name='v1')
+ )
+
+ # project to add new custom images to
+ self.project = Project.objects.create(name='foo', release=release)
+
+ # layer associated with the project
+ layer = Layer.objects.create(name='bar')
+ layer_version = Layer_Version.objects.create(
+ layer=layer,
+ project=self.project
+ )
+
+ # properly add the layer to the project
+ ProjectLayer.objects.create(
+ project=self.project,
+ layercommit=layer_version,
+ optional=False
+ )
+
+ # add a fake image recipe to the layer that can be customised
+ self.recipe = Recipe.objects.create(
+ name='core-image-minimal',
+ layer_version=layer_version,
+ is_image=True
+ )
+
+ # another project with a custom image already in it
+ project2 = Project.objects.create(name='whoop', release=release)
+ layer_version2 = Layer_Version.objects.create(
+ layer=layer,
+ project=project2
+ )
+ ProjectLayer.objects.create(
+ project=project2,
+ layercommit=layer_version2,
+ optional=False
+ )
+ recipe2 = Recipe.objects.create(
+ name='core-image-minimal',
+ layer_version=layer_version2,
+ is_image=True
+ )
+ CustomImageRecipe.objects.create(
+ name=self.CUSTOM_IMAGE_NAME,
+ base_recipe=recipe2,
+ layer_version=layer_version2,
+ file_path='/1/2',
+ project=project2
+ )
+
+ def _create_custom_image(self, new_custom_image_name):
+ """
+ 1. Go to the 'new custom image' page
+ 2. Click the button for the fake core-image-minimal
+ 3. Wait for the dialog box for setting the name of the new custom
+ image
+ 4. Insert new_custom_image_name into that dialog's text box
+ """
+ url = reverse('newcustomimage', args=(self.project.id,))
+ self.get(url)
+
+ self.click('button[data-recipe="%s"]' % self.recipe.id)
+
+ selector = '#new-custom-image-modal input[type="text"]'
+ self.enter_text(selector, new_custom_image_name)
+
+ self.click('#create-new-custom-image-btn')
+
+ def _check_for_custom_image(self, image_name):
+ """
+ Fetch the list of custom images for the project and check the
+ image with name image_name is listed there
+ """
+ url = reverse('projectcustomimages', args=(self.project.id,))
+ self.get(url)
+
+ self.wait_until_visible('#customimagestable')
+
+ element = self.find('#customimagestable td[class="name"] a')
+ msg = 'should be a custom image link with text %s' % image_name
+ self.assertEqual(element.text.strip(), image_name, msg)
+
+ def test_new_image(self):
+ """
+ Should be able to create a new custom image
+ """
+ custom_image_name = 'boo-image'
+ self._create_custom_image(custom_image_name)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(custom_image_name)
+
+ def test_new_duplicates_other_project_image(self):
+ """
+ Should be able to create a new custom image if its name is the same
+ as a custom image in another project
+ """
+ self._create_custom_image(self.CUSTOM_IMAGE_NAME)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(self.CUSTOM_IMAGE_NAME)
+
+ def test_new_duplicates_non_image_recipe(self):
+ """
+ Should not be able to create a new custom image whose name is the
+ same as an existing non-image recipe
+ """
+ self._create_custom_image(self.recipe.name)
+ element = self.wait_until_visible('#invalid-name-help')
+ self.assertRegexpMatches(element.text.strip(),
+ 'image with this name already exists')
+
+ def test_new_duplicates_project_image(self):
+ """
+ Should not be able to create a new custom image whose name is the same
+ as a custom image in this project
+ """
+ # create the image
+ custom_image_name = 'doh-image'
+ self._create_custom_image(custom_image_name)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(custom_image_name)
+
+ # try to create an image with the same name
+ self._create_custom_image(custom_image_name)
+ element = self.wait_until_visible('#invalid-name-help')
+ expected = 'An image with this name already exists in this project'
+ self.assertRegexpMatches(element.text.strip(), expected)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_new_project_page.py b/poky/bitbake/lib/toaster/tests/browser/test_new_project_page.py
new file mode 100644
index 000000000..77e5f1526
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_new_project_page.py
@@ -0,0 +1,113 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+from selenium.webdriver.support.ui import Select
+from selenium.common.exceptions import InvalidElementStateException
+
+from orm.models import Project, Release, BitbakeVersion
+
+
+class TestNewProjectPage(SeleniumTestCase):
+ """ Test project data at /project/X/ is displayed correctly """
+
+ def setUp(self):
+ bitbake, c = BitbakeVersion.objects.get_or_create(
+ name="master",
+ giturl="git://master",
+ branch="master",
+ dirpath="master")
+
+ release, c = Release.objects.get_or_create(name="msater",
+ description="master"
+ "release",
+ branch_name="master",
+ helptext="latest",
+ bitbake_version=bitbake)
+
+ self.release, c = Release.objects.get_or_create(
+ name="msater2",
+ description="master2"
+ "release2",
+ branch_name="master2",
+ helptext="latest2",
+ bitbake_version=bitbake)
+
+ def test_create_new_project(self):
+ """ Test creating a project """
+
+ project_name = "masterproject"
+
+ url = reverse('newproject')
+ self.get(url)
+
+ self.enter_text('#new-project-name', project_name)
+
+ select = Select(self.find('#projectversion'))
+ select.select_by_value(str(self.release.pk))
+
+ self.click("#create-project-button")
+
+ # We should get redirected to the new project's page with the
+ # notification at the top
+ element = self.wait_until_visible('#project-created-notification')
+
+ self.assertTrue(project_name in element.text,
+ "New project name not in new project notification")
+
+ self.assertTrue(Project.objects.filter(name=project_name).count(),
+ "New project not found in database")
+
+ def test_new_duplicates_project_name(self):
+ """
+ Should not be able to create a new project whose name is the same
+ as an existing project
+ """
+
+ project_name = "dupproject"
+
+ Project.objects.create_project(name=project_name,
+ release=self.release)
+
+ url = reverse('newproject')
+ self.get(url)
+
+ self.enter_text('#new-project-name', project_name)
+
+ select = Select(self.find('#projectversion'))
+ select.select_by_value(str(self.release.pk))
+
+ element = self.wait_until_visible('#hint-error-project-name')
+
+ self.assertTrue(("Project names must be unique" in element.text),
+ "Did not find unique project name error message")
+
+ # Try and click it anyway, if it submits we'll have a new project in
+ # the db and assert then
+ try:
+ self.click("#create-project-button")
+ except InvalidElementStateException:
+ pass
+
+ self.assertTrue(
+ (Project.objects.filter(name=project_name).count() == 1),
+ "New project not found in database")
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py b/poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py
new file mode 100644
index 000000000..9fe91ab06
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_project_builds_page.py
@@ -0,0 +1,168 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, Build, Target
+
+class TestProjectBuildsPage(SeleniumTestCase):
+ """ Test data at /project/X/builds is displayed correctly """
+
+ PROJECT_NAME = 'test project'
+ CLI_BUILDS_PROJECT_NAME = 'command line builds'
+
+ def setUp(self):
+ bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
+ branch='master', dirpath='')
+ release = Release.objects.create(name='release1',
+ bitbake_version=bbv)
+ self.project1 = Project.objects.create_project(name=self.PROJECT_NAME,
+ release=release)
+ self.project1.save()
+
+ self.project2 = Project.objects.create_project(name=self.PROJECT_NAME,
+ release=release)
+ self.project2.save()
+
+ self.default_project = Project.objects.create_project(
+ name=self.CLI_BUILDS_PROJECT_NAME,
+ release=release
+ )
+ self.default_project.is_default = True
+ self.default_project.save()
+
+ # parameters for builds to associate with the projects
+ now = timezone.now()
+
+ self.project1_build_success = {
+ 'project': self.project1,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.SUCCEEDED
+ }
+
+ self.project1_build_in_progress = {
+ 'project': self.project1,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.IN_PROGRESS
+ }
+
+ self.project2_build_success = {
+ 'project': self.project2,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.SUCCEEDED
+ }
+
+ self.project2_build_in_progress = {
+ 'project': self.project2,
+ 'started_on': now,
+ 'completed_on': now,
+ 'outcome': Build.IN_PROGRESS
+ }
+
+ def _get_rows_for_project(self, project_id):
+ """
+ Helper to retrieve HTML rows for a project's builds,
+ as shown in the main table of the page
+ """
+ url = reverse('projectbuilds', args=(project_id,))
+ self.get(url)
+ self.wait_until_present('#projectbuildstable tbody tr')
+ return self.find_all('#projectbuildstable tbody tr')
+
+ def test_show_builds_for_project(self):
+ """ Builds for a project should be displayed in the main table """
+ Build.objects.create(**self.project1_build_success)
+ Build.objects.create(**self.project1_build_success)
+ build_rows = self._get_rows_for_project(self.project1.id)
+ self.assertEqual(len(build_rows), 2)
+
+ def test_show_builds_project_only(self):
+ """ Builds for other projects should be excluded """
+ Build.objects.create(**self.project1_build_success)
+ Build.objects.create(**self.project1_build_success)
+ Build.objects.create(**self.project1_build_success)
+
+ # shouldn't see these two
+ Build.objects.create(**self.project2_build_success)
+ Build.objects.create(**self.project2_build_in_progress)
+
+ build_rows = self._get_rows_for_project(self.project1.id)
+ self.assertEqual(len(build_rows), 3)
+
+ def test_builds_exclude_in_progress(self):
+ """ "in progress" builds should not be shown in main table """
+ Build.objects.create(**self.project1_build_success)
+ Build.objects.create(**self.project1_build_success)
+
+ # shouldn't see this one
+ Build.objects.create(**self.project1_build_in_progress)
+
+ # shouldn't see these two either, as they belong to a different project
+ Build.objects.create(**self.project2_build_success)
+ Build.objects.create(**self.project2_build_in_progress)
+
+ build_rows = self._get_rows_for_project(self.project1.id)
+ self.assertEqual(len(build_rows), 2)
+
+ def test_show_tasks_with_suffix(self):
+ """ Task should be shown as suffixes on build names """
+ build = Build.objects.create(**self.project1_build_success)
+ target = 'bash'
+ task = 'clean'
+ Target.objects.create(build=build, target=target, task=task)
+
+ url = reverse('projectbuilds', args=(self.project1.id,))
+ self.get(url)
+ self.wait_until_present('td[class="target"]')
+
+ cell = self.find('td[class="target"]')
+ content = cell.get_attribute('innerHTML')
+ expected_text = '%s:%s' % (target, task)
+
+ self.assertTrue(re.search(expected_text, content),
+ '"target" cell should contain text %s' % expected_text)
+
+ def test_cli_builds_hides_tabs(self):
+ """
+ Display for command line builds should hide tabs
+ """
+ url = reverse('projectbuilds', args=(self.default_project.id,))
+ self.get(url)
+ tabs = self.find_all('#project-topbar')
+ self.assertEqual(len(tabs), 0,
+ 'should be no top bar shown for command line builds')
+
+ def test_non_cli_builds_has_tabs(self):
+ """
+ Non-command-line builds projects should show the tabs
+ """
+ url = reverse('projectbuilds', args=(self.project1.id,))
+ self.get(url)
+ tabs = self.find_all('#project-topbar')
+ self.assertEqual(len(tabs), 1,
+ 'should be a top bar shown for non-command-line builds')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_project_config_page.py b/poky/bitbake/lib/toaster/tests/browser/test_project_config_page.py
new file mode 100644
index 000000000..071008499
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_project_config_page.py
@@ -0,0 +1,231 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, ProjectVariable
+
+class TestProjectConfigsPage(SeleniumTestCase):
+ """ Test data at /project/X/builds is displayed correctly """
+
+ PROJECT_NAME = 'test project'
+ INVALID_PATH_START_TEXT = 'The directory path should either start with a /'
+ INVALID_PATH_CHAR_TEXT = 'The directory path cannot include spaces or ' \
+ 'any of these characters'
+
+ def setUp(self):
+ bbv = BitbakeVersion.objects.create(name='bbv1', giturl='/tmp/',
+ branch='master', dirpath='')
+ release = Release.objects.create(name='release1',
+ bitbake_version=bbv)
+ self.project1 = Project.objects.create_project(name=self.PROJECT_NAME,
+ release=release)
+ self.project1.save()
+
+
+ def test_no_underscore_iamgefs_type(self):
+ """
+ Should not accept IMAGEFS_TYPE with an underscore
+ """
+
+ imagefs_type = "foo_bar"
+
+ ProjectVariable.objects.get_or_create(project = self.project1, name = "IMAGE_FSTYPES", value = "abcd ")
+ url = reverse('projectconf', args=(self.project1.id,));
+ self.get(url);
+
+ self.click('#change-image_fstypes-icon')
+
+ self.enter_text('#new-imagefs_types', imagefs_type)
+
+ element = self.wait_until_visible('#hintError-image-fs_type')
+
+ self.assertTrue(("A valid image type cannot include underscores" in element.text),
+ "Did not find underscore error message")
+
+
+ def test_checkbox_verification(self):
+ """
+ Should automatically check the checkbox if user enters value
+ text box, if value is there in the checkbox.
+ """
+ imagefs_type = "btrfs"
+
+ ProjectVariable.objects.get_or_create(project = self.project1, name = "IMAGE_FSTYPES", value = "abcd ")
+ url = reverse('projectconf', args=(self.project1.id,));
+ self.get(url);
+
+ self.click('#change-image_fstypes-icon')
+
+ self.enter_text('#new-imagefs_types', imagefs_type)
+
+ checkboxes = self.driver.find_elements_by_xpath("//input[@class='fs-checkbox-fstypes']")
+
+ for checkbox in checkboxes:
+ if checkbox.get_attribute("value") == "btrfs":
+ self.assertEqual(checkbox.is_selected(), True)
+
+
+ def test_textbox_with_checkbox_verification(self):
+ """
+ Should automatically add or remove value in textbox, if user checks
+ or unchecks checkboxes.
+ """
+
+ ProjectVariable.objects.get_or_create(project = self.project1, name = "IMAGE_FSTYPES", value = "abcd ")
+ url = reverse('projectconf', args=(self.project1.id,));
+ self.get(url);
+
+ self.click('#change-image_fstypes-icon')
+
+ self.wait_until_visible('#new-imagefs_types')
+
+ checkboxes_selector = '.fs-checkbox-fstypes'
+
+ self.wait_until_visible(checkboxes_selector)
+ checkboxes = self.find_all(checkboxes_selector)
+
+ for checkbox in checkboxes:
+ if checkbox.get_attribute("value") == "cpio":
+ checkbox.click()
+ element = self.driver.find_element_by_id('new-imagefs_types')
+
+ self.wait_until_visible('#new-imagefs_types')
+
+ self.assertTrue(("cpio" in element.get_attribute('value'),
+ "Imagefs not added into the textbox"))
+ checkbox.click()
+ self.assertTrue(("cpio" not in element.text),
+ "Image still present in the textbox")
+
+ def test_set_download_dir(self):
+ """
+ Validate the allowed and disallowed types in the directory field for
+ DL_DIR
+ """
+
+ ProjectVariable.objects.get_or_create(project=self.project1,
+ name='DL_DIR')
+ url = reverse('projectconf', args=(self.project1.id,))
+ self.get(url)
+
+ # activate the input to edit download dir
+ self.click('#change-dl_dir-icon')
+ self.wait_until_visible('#new-dl_dir')
+
+ # downloads dir path doesn't start with / or ${...}
+ self.enter_text('#new-dl_dir', 'home/foo')
+ element = self.wait_until_visible('#hintError-initialChar-dl_dir')
+
+ msg = 'downloads directory path starts with invalid character but ' \
+ 'treated as valid'
+ self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
+
+ # downloads dir path has a space
+ self.driver.find_element_by_id('new-dl_dir').clear()
+ self.enter_text('#new-dl_dir', '/foo/bar a')
+
+ element = self.wait_until_visible('#hintError-dl_dir')
+ msg = 'downloads directory path characters invalid but treated as valid'
+ self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
+
+ # downloads dir path starts with ${...} but has a space
+ self.driver.find_element_by_id('new-dl_dir').clear()
+ self.enter_text('#new-dl_dir', '${TOPDIR}/down foo')
+
+ element = self.wait_until_visible('#hintError-dl_dir')
+ msg = 'downloads directory path characters invalid but treated as valid'
+ self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
+
+ # downloads dir path starts with /
+ self.driver.find_element_by_id('new-dl_dir').clear()
+ self.enter_text('#new-dl_dir', '/bar/foo')
+
+ hidden_element = self.driver.find_element_by_id('hintError-dl_dir')
+ self.assertEqual(hidden_element.is_displayed(), False,
+ 'downloads directory path valid but treated as invalid')
+
+ # downloads dir path starts with ${...}
+ self.driver.find_element_by_id('new-dl_dir').clear()
+ self.enter_text('#new-dl_dir', '${TOPDIR}/down')
+
+ hidden_element = self.driver.find_element_by_id('hintError-dl_dir')
+ self.assertEqual(hidden_element.is_displayed(), False,
+ 'downloads directory path valid but treated as invalid')
+
+ def test_set_sstate_dir(self):
+ """
+ Validate the allowed and disallowed types in the directory field for
+ SSTATE_DIR
+ """
+
+ ProjectVariable.objects.get_or_create(project=self.project1,
+ name='SSTATE_DIR')
+ url = reverse('projectconf', args=(self.project1.id,))
+ self.get(url)
+
+ self.click('#change-sstate_dir-icon')
+
+ self.wait_until_visible('#new-sstate_dir')
+
+ # path doesn't start with / or ${...}
+ self.enter_text('#new-sstate_dir', 'home/foo')
+ element = self.wait_until_visible('#hintError-initialChar-sstate_dir')
+
+ msg = 'sstate directory path starts with invalid character but ' \
+ 'treated as valid'
+ self.assertTrue((self.INVALID_PATH_START_TEXT in element.text), msg)
+
+ # path has a space
+ self.driver.find_element_by_id('new-sstate_dir').clear()
+ self.enter_text('#new-sstate_dir', '/foo/bar a')
+
+ element = self.wait_until_visible('#hintError-sstate_dir')
+ msg = 'sstate directory path characters invalid but treated as valid'
+ self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
+
+ # path starts with ${...} but has a space
+ self.driver.find_element_by_id('new-sstate_dir').clear()
+ self.enter_text('#new-sstate_dir', '${TOPDIR}/down foo')
+
+ element = self.wait_until_visible('#hintError-sstate_dir')
+ msg = 'sstate directory path characters invalid but treated as valid'
+ self.assertTrue((self.INVALID_PATH_CHAR_TEXT in element.text), msg)
+
+ # path starts with /
+ self.driver.find_element_by_id('new-sstate_dir').clear()
+ self.enter_text('#new-sstate_dir', '/bar/foo')
+
+ hidden_element = self.driver.find_element_by_id('hintError-sstate_dir')
+ self.assertEqual(hidden_element.is_displayed(), False,
+ 'sstate directory path valid but treated as invalid')
+
+ # paths starts with ${...}
+ self.driver.find_element_by_id('new-sstate_dir').clear()
+ self.enter_text('#new-sstate_dir', '${TOPDIR}/down')
+
+ hidden_element = self.driver.find_element_by_id('hintError-sstate_dir')
+ self.assertEqual(hidden_element.is_displayed(), False,
+ 'sstate directory path valid but treated as invalid') \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_project_page.py b/poky/bitbake/lib/toaster/tests/browser/test_project_page.py
new file mode 100644
index 000000000..018646332
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_project_page.py
@@ -0,0 +1,59 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import Build, Project
+
+class TestProjectPage(SeleniumTestCase):
+ """ Test project data at /project/X/ is displayed correctly """
+
+ CLI_BUILDS_PROJECT_NAME = 'Command line builds'
+
+ def test_cli_builds_in_progress(self):
+ """
+ In progress builds should not cause an error to be thrown
+ when navigating to "command line builds" project page;
+ see https://bugzilla.yoctoproject.org/show_bug.cgi?id=8277
+ """
+
+ # add the "command line builds" default project; this mirrors what
+ # we do with get_or_create_default_project()
+ default_project = Project.objects.create_project(self.CLI_BUILDS_PROJECT_NAME, None)
+ default_project.is_default = True
+ default_project.save()
+
+ # add an "in progress" build for the default project
+ now = timezone.now()
+ Build.objects.create(project=default_project,
+ started_on=now,
+ completed_on=now,
+ outcome=Build.IN_PROGRESS)
+
+ # navigate to the project page for the default project
+ url = reverse("project", args=(default_project.id,))
+ self.get(url)
+
+ # check that we get a project page with the correct heading
+ project_name = self.find('.project-name').text.strip()
+ self.assertEqual(project_name, self.CLI_BUILDS_PROJECT_NAME)
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_sample.py b/poky/bitbake/lib/toaster/tests/browser/test_sample.py
new file mode 100644
index 000000000..20ec53c28
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_sample.py
@@ -0,0 +1,41 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+A small example test demonstrating the basics of writing a test with
+Toaster's SeleniumTestCase; this just fetches the Toaster home page
+and checks it has the word "Toaster" in the brand link
+
+New test files should follow this structure, should be named "test_*.py",
+and should be in the same directory as this sample.
+"""
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+class TestSample(SeleniumTestCase):
+ """ Test landing page shows the Toaster brand """
+
+ def test_landing_page_has_brand(self):
+ url = reverse('landing')
+ self.get(url)
+ brand_link = self.find('.toaster-navbar-brand a.brand')
+ self.assertEqual(brand_link.text.strip(), 'Toaster')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_task_page.py b/poky/bitbake/lib/toaster/tests/browser/test_task_page.py
new file mode 100644
index 000000000..690d116cb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_task_page.py
@@ -0,0 +1,76 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+from orm.models import Project, Build, Layer, Layer_Version, Recipe, Target
+from orm.models import Task, Task_Dependency
+
+class TestTaskPage(SeleniumTestCase):
+ """ Test page which shows an individual task """
+ RECIPE_NAME = 'bar'
+ RECIPE_VERSION = '0.1'
+ TASK_NAME = 'do_da_doo_ron_ron'
+
+ def setUp(self):
+ now = timezone.now()
+
+ project = Project.objects.get_or_create_default_project()
+
+ self.build = Build.objects.create(project=project, started_on=now,
+ completed_on=now)
+
+ Target.objects.create(target='foo', build=self.build)
+
+ layer = Layer.objects.create()
+
+ layer_version = Layer_Version.objects.create(layer=layer)
+
+ recipe = Recipe.objects.create(name=TestTaskPage.RECIPE_NAME,
+ layer_version=layer_version, version=TestTaskPage.RECIPE_VERSION)
+
+ self.task = Task.objects.create(build=self.build, recipe=recipe,
+ order=1, outcome=Task.OUTCOME_COVERED, task_executed=False,
+ task_name=TestTaskPage.TASK_NAME)
+
+ def test_covered_task(self):
+ """
+ Check that covered tasks are displayed for tasks which have
+ dependencies on themselves
+ """
+
+ # the infinite loop which of bug 9952 was down to tasks which
+ # depend on themselves, so add self-dependent tasks to replicate the
+ # situation which caused the infinite loop (now fixed)
+ Task_Dependency.objects.create(task=self.task, depends_on=self.task)
+
+ url = reverse('task', args=(self.build.id, self.task.id,))
+ self.get(url)
+
+ # check that we see the task name
+ self.wait_until_visible('.page-header h1')
+
+ heading = self.find('.page-header h1')
+ expected_heading = '%s_%s %s' % (TestTaskPage.RECIPE_NAME,
+ TestTaskPage.RECIPE_VERSION, TestTaskPage.TASK_NAME)
+ self.assertEqual(heading.text, expected_heading,
+ 'Heading should show recipe name, version and task')
diff --git a/poky/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py b/poky/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py
new file mode 100644
index 000000000..53ddf30c3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/browser/test_toastertable_ui.py
@@ -0,0 +1,160 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from datetime import datetime
+
+from django.core.urlresolvers import reverse
+from django.utils import timezone
+from tests.browser.selenium_helpers import SeleniumTestCase
+from orm.models import BitbakeVersion, Release, Project, Build
+
+class TestToasterTableUI(SeleniumTestCase):
+ """
+ Tests for the UI elements of ToasterTable (sorting etc.);
+ note that the tests cover generic functionality of ToasterTable which
+ manifests as UI elements in the browser, and can only be tested via
+ Selenium.
+ """
+
+ def setUp(self):
+ pass
+
+ def _get_orderby_heading(self, table):
+ """
+ Get the current order by finding the column heading in <table> with
+ the sorted class on it.
+
+ table: WebElement for a ToasterTable
+ """
+ selector = 'thead a.sorted'
+ heading = table.find_element_by_css_selector(selector)
+ return heading.get_attribute('innerHTML').strip()
+
+ def _get_datetime_from_cell(self, row, selector):
+ """
+ Return the value in the cell selected by <selector> on <row> as a
+ datetime.
+
+ row: <tr> WebElement for a row in the ToasterTable
+ selector: CSS selector to use to find the cell containing the date time
+ string
+ """
+ cell = row.find_element_by_css_selector(selector)
+ cell_text = cell.get_attribute('innerHTML').strip()
+ return datetime.strptime(cell_text, '%d/%m/%y %H:%M')
+
+ def test_revert_orderby(self):
+ """
+ Test that sort order for a table reverts to the default sort order
+ if the current sort column is hidden.
+ """
+ now = timezone.now()
+ later = now + timezone.timedelta(hours=1)
+ even_later = later + timezone.timedelta(hours=1)
+
+ bbv = BitbakeVersion.objects.create(name='test bbv', giturl='/tmp/',
+ branch='master', dirpath='')
+ release = Release.objects.create(name='test release',
+ branch_name='master',
+ bitbake_version=bbv)
+
+ project = Project.objects.create_project('project', release)
+
+ # set up two builds which will order differently when sorted by
+ # started_on or completed_on
+
+ # started first, finished last
+ build1 = Build.objects.create(project=project,
+ started_on=now,
+ completed_on=even_later,
+ outcome=Build.SUCCEEDED)
+
+ # started second, finished first
+ build2 = Build.objects.create(project=project,
+ started_on=later,
+ completed_on=later,
+ outcome=Build.SUCCEEDED)
+
+ url = reverse('all-builds')
+ self.get(url)
+ table = self.wait_until_visible('#allbuildstable')
+
+ # check ordering (default is by -completed_on); so build1 should be
+ # first as it finished last
+ active_heading = self._get_orderby_heading(table)
+ self.assertEqual(active_heading, 'Completed on',
+ 'table should be sorted by "Completed on" by default')
+
+ row_selector = '#allbuildstable tbody tr'
+ cell_selector = 'td.completed_on'
+
+ rows = self.find_all(row_selector)
+ row1_completed_on = self._get_datetime_from_cell(rows[0], cell_selector)
+ row2_completed_on = self._get_datetime_from_cell(rows[1], cell_selector)
+ self.assertTrue(row1_completed_on > row2_completed_on,
+ 'table should be sorted by -completed_on')
+
+ # turn on started_on column
+ self.click('#edit-columns-button')
+ self.click('#checkbox-started_on')
+
+ # sort by started_on column
+ links = table.find_elements_by_css_selector('th.started_on a')
+ for link in links:
+ if link.get_attribute('innerHTML').strip() == 'Started on':
+ link.click()
+ break
+
+ # wait for table data to reload in response to new sort
+ self.wait_until_visible('#allbuildstable')
+
+ # check ordering; build1 should be first
+ active_heading = self._get_orderby_heading(table)
+ self.assertEqual(active_heading, 'Started on',
+ 'table should be sorted by "Started on"')
+
+ cell_selector = 'td.started_on'
+
+ rows = self.find_all(row_selector)
+ row1_started_on = self._get_datetime_from_cell(rows[0], cell_selector)
+ row2_started_on = self._get_datetime_from_cell(rows[1], cell_selector)
+ self.assertTrue(row1_started_on < row2_started_on,
+ 'table should be sorted by started_on')
+
+ # turn off started_on column
+ self.click('#edit-columns-button')
+ self.click('#checkbox-started_on')
+
+ # wait for table data to reload in response to new sort
+ self.wait_until_visible('#allbuildstable')
+
+ # check ordering (should revert to completed_on); build2 should be first
+ active_heading = self._get_orderby_heading(table)
+ self.assertEqual(active_heading, 'Completed on',
+ 'table should be sorted by "Completed on" after hiding sort column')
+
+ cell_selector = 'td.completed_on'
+
+ rows = self.find_all(row_selector)
+ row1_completed_on = self._get_datetime_from_cell(rows[0], cell_selector)
+ row2_completed_on = self._get_datetime_from_cell(rows[1], cell_selector)
+ self.assertTrue(row1_completed_on > row2_completed_on,
+ 'table should be sorted by -completed_on')
diff --git a/poky/bitbake/lib/toaster/tests/builds/README b/poky/bitbake/lib/toaster/tests/builds/README
new file mode 100644
index 000000000..4a3b5328b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/builds/README
@@ -0,0 +1,14 @@
+# Running build tests
+
+These tests are to test the running of builds and the data produced by the builds.
+Your oe build environment must be sourced/initialised for these tests to run.
+
+The simplest way to run the tests are the following commands:
+
+$ . oe-init-build-env
+$ cd bitbake/lib/toaster/ # path my vary but this is into toaster's directory
+$ DJANGO_SETTINGS_MODULE='toastermain.settings_test' ./manage.py test tests.builds
+
+Optional environment variables:
+ - TOASTER_DIR (where toaster keeps it's artifacts)
+ - TOASTER_CONF a path to the toasterconf.json file. This will need to be set if you don't execute the tests from toaster's own directory.
diff --git a/poky/bitbake/lib/toaster/tests/builds/__init__.py b/poky/bitbake/lib/toaster/tests/builds/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/builds/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/builds/buildtest.py b/poky/bitbake/lib/toaster/tests/builds/buildtest.py
new file mode 100644
index 000000000..5a56a110a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/builds/buildtest.py
@@ -0,0 +1,169 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import time
+import unittest
+
+from orm.models import Project, Release, ProjectTarget, Build, ProjectVariable
+from bldcontrol.models import BuildEnvironment
+
+from bldcontrol.management.commands.runbuilds import Command\
+ as RunBuildsCommand
+
+from django.core.management import call_command
+
+import subprocess
+import logging
+
+logger = logging.getLogger("toaster")
+
+# We use unittest.TestCase instead of django.test.TestCase because we don't
+# want to wrap everything in a database transaction as an external process
+# (bitbake needs access to the database)
+
+def load_build_environment():
+ call_command('loaddata', 'settings.xml', app_label="orm")
+ call_command('loaddata', 'poky.xml', app_label="orm")
+
+ current_builddir = os.environ.get("BUILDDIR")
+ if current_builddir:
+ BuildTest.BUILDDIR = current_builddir
+ else:
+ # Setup a builddir based on default layout
+ # bitbake inside openebedded-core
+ oe_init_build_env_path = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ os.pardir,
+ os.pardir,
+ os.pardir,
+ os.pardir,
+ os.pardir,
+ 'oe-init-build-env'
+ )
+ if not os.path.exists(oe_init_build_env_path):
+ raise Exception("We had no BUILDDIR set and couldn't "
+ "find oe-init-build-env to set this up "
+ "ourselves please run oe-init-build-env "
+ "before running these tests")
+
+ oe_init_build_env_path = os.path.realpath(oe_init_build_env_path)
+ cmd = "bash -c 'source oe-init-build-env %s'" % BuildTest.BUILDDIR
+ p = subprocess.Popen(
+ cmd,
+ cwd=os.path.dirname(oe_init_build_env_path),
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+ output, err = p.communicate()
+ p.wait()
+
+ logger.info("oe-init-build-env %s %s" % (output, err))
+
+ os.environ['BUILDDIR'] = BuildTest.BUILDDIR
+
+ # Setup the path to bitbake we know where to find this
+ bitbake_path = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ os.pardir,
+ os.pardir,
+ os.pardir,
+ os.pardir,
+ 'bin',
+ 'bitbake')
+ if not os.path.exists(bitbake_path):
+ raise Exception("Could not find bitbake at the expected path %s"
+ % bitbake_path)
+
+ os.environ['BBBASEDIR'] = bitbake_path
+
+class BuildTest(unittest.TestCase):
+
+ PROJECT_NAME = "Testbuild"
+ BUILDDIR = "/tmp/build/"
+
+ def build(self, target):
+ # So that the buildinfo helper uses the test database'
+ self.assertEqual(
+ os.environ.get('DJANGO_SETTINGS_MODULE', ''),
+ 'toastermain.settings_test',
+ "Please initialise django with the tests settings: "
+ "DJANGO_SETTINGS_MODULE='toastermain.settings_test'")
+
+ built = self.target_already_built(target)
+ if built:
+ return built
+
+ load_build_environment()
+
+ BuildEnvironment.objects.get_or_create(
+ betype=BuildEnvironment.TYPE_LOCAL,
+ sourcedir=BuildTest.BUILDDIR,
+ builddir=BuildTest.BUILDDIR
+ )
+
+ release = Release.objects.get(name='local')
+
+ # Create a project for this build to run in
+ project = Project.objects.create_project(name=BuildTest.PROJECT_NAME,
+ release=release)
+
+ if os.environ.get("TOASTER_TEST_USE_SSTATE_MIRROR"):
+ ProjectVariable.objects.get_or_create(
+ name="SSTATE_MIRRORS",
+ value="file://.* http://autobuilder.yoctoproject.org/pub/sstate/PATH;downloadfilename=PATH",
+ project=project)
+
+ ProjectTarget.objects.create(project=project,
+ target=target,
+ task="")
+ build_request = project.schedule_build()
+
+ # run runbuilds command to dispatch the build
+ # e.g. manage.py runubilds
+ RunBuildsCommand().runbuild()
+
+ build_pk = build_request.build.pk
+ while Build.objects.get(pk=build_pk).outcome == Build.IN_PROGRESS:
+ sys.stdout.write("\rBuilding %s %d%%" %
+ (target,
+ build_request.build.completeper()))
+ sys.stdout.flush()
+ time.sleep(1)
+
+ self.assertEqual(Build.objects.get(pk=build_pk).outcome,
+ Build.SUCCEEDED,
+ "Build did not SUCCEEDED")
+
+ logger.info("\nBuild finished %s" % build_request.build.outcome)
+ return build_request.build
+
+ def target_already_built(self, target):
+ """ If the target is already built no need to build it again"""
+ for build in Build.objects.filter(
+ project__name=BuildTest.PROJECT_NAME):
+ targets = build.target_set.values_list('target', flat=True)
+ if target in targets:
+ return build
+
+ return None
diff --git a/poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py b/poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py
new file mode 100644
index 000000000..586f4a8f7
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/builds/test_core_image_min.py
@@ -0,0 +1,386 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Tests were part of openembedded-core oe selftest Authored by: Lucian Musat
+# Ionut Chisanovici, Paul Eggleton and Cristian Iorga
+
+import os
+
+from django.db.models import Q
+
+from orm.models import Target_Image_File, Target_Installed_Package, Task
+from orm.models import Package_Dependency, Recipe_Dependency, Build
+from orm.models import Task_Dependency, Package, Target, Recipe
+from orm.models import CustomImagePackage
+
+from tests.builds.buildtest import BuildTest
+
+
+class BuildCoreImageMinimal(BuildTest):
+ """Build core-image-minimal and test the results"""
+
+ def setUp(self):
+ self.completed_build = self.build("core-image-minimal")
+
+ # Check if build name is unique - tc_id=795
+ def test_Build_Unique_Name(self):
+ all_builds = Build.objects.all().count()
+ distinct_builds = Build.objects.values('id').distinct().count()
+ self.assertEqual(distinct_builds,
+ all_builds,
+ msg='Build name is not unique')
+
+ # Check if build cooker log path is unique - tc_id=819
+ def test_Build_Unique_Cooker_Log_Path(self):
+ distinct_path = Build.objects.values(
+ 'cooker_log_path').distinct().count()
+ total_builds = Build.objects.values('id').count()
+ self.assertEqual(distinct_path,
+ total_builds,
+ msg='Build cooker log path is not unique')
+
+ # Check if task order is unique for one build - tc=824
+ def test_Task_Unique_Order(self):
+ total_task_order = Task.objects.filter(
+ build=self.built).values('order').count()
+ distinct_task_order = Task.objects.filter(
+ build=self.completed_build).values('order').distinct().count()
+
+ self.assertEqual(total_task_order,
+ distinct_task_order,
+ msg='Errors task order is not unique')
+
+ # Check task order sequence for one build - tc=825
+ def test_Task_Order_Sequence(self):
+ cnt_err = []
+ tasks = Task.objects.filter(
+ Q(build=self.completed_build),
+ ~Q(order=None),
+ ~Q(task_name__contains='_setscene')
+ ).values('id', 'order').order_by("order")
+
+ cnt_tasks = 0
+ for task in tasks:
+ cnt_tasks += 1
+ if (task['order'] != cnt_tasks):
+ cnt_err.append(task['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for task id: %s' % cnt_err)
+
+ # Check if disk_io matches the difference between EndTimeIO and
+ # StartTimeIO in build stats - tc=828
+ # def test_Task_Disk_IO_TC828(self):
+
+ # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) -
+ # tc=832
+ def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self):
+ tasks = Task.objects.filter(outcome=2).values('id', 'sstate_result')
+ cnt_err = []
+ for task in tasks:
+ if (task['sstate_result'] != 3):
+ cnt_err.append(task['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must
+ # be 0 (SSTATE_NA) - tc=833
+ def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
+ tasks = Task.objects.filter(
+ outcome__in=(Task.OUTCOME_COVERED,
+ Task.OUTCOME_PREBUILT)).values('id',
+ 'task_name',
+ 'sstate_result')
+ cnt_err = []
+
+ for task in tasks:
+ if (task['sstate_result'] != Task.SSTATE_NA and
+ task['sstate_result'] != Task.SSTATE_MISS):
+ cnt_err.append({'id': task['id'],
+ 'name': task['task_name'],
+ 'sstate_result': task['sstate_result']})
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be
+ # 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834
+ def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self):
+ tasks = Task.objects.filter(
+ outcome__in=(0, 4)).values('id', 'sstate_result')
+ cnt_err = []
+
+ for task in tasks:
+ if (task['sstate_result'] not in [0, 1, 2]):
+ cnt_err.append(task['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2
+ # (CODING_PYTHON), 3 (CODING_SHELL) - tc=891
+ def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self):
+ tasks = Task.objects.filter(
+ task_executed=1).values('id', 'script_type')
+ cnt_err = []
+
+ for task in tasks:
+ if (task['script_type'] not in [0, 2, 3]):
+ cnt_err.append(task['id'])
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4
+ # (FAILED) - tc=836
+ def test_Task_If_Task_Executed_True_Outcome_0_4(self):
+ tasks = Task.objects.filter(task_executed=1).values('id', 'outcome')
+ cnt_err = []
+
+ for task in tasks:
+ if (task['outcome'] not in [0, 4]):
+ cnt_err.append(task['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if task_executed = FALSE (0), script_type must be 0 - tc=890
+ def test_Task_If_Task_Executed_False_Script_Type_0(self):
+ tasks = Task.objects.filter(
+ task_executed=0).values('id', 'script_type')
+ cnt_err = []
+
+ for task in tasks:
+ if (task['script_type'] != 0):
+ cnt_err.append(task['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Check if task_executed = FALSE (0) and build outcome = SUCCEEDED (0),
+ # task outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT), 5 (EMPTY) -
+ # tc=837
+ def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self):
+ builds = Build.objects.filter(outcome=0).values('id')
+ cnt_err = []
+ for build in builds:
+ tasks = Task.objects.filter(
+ build=build['id'], task_executed=0).values('id', 'outcome')
+ for task in tasks:
+ if (task['outcome'] not in [1, 2, 3, 5]):
+ cnt_err.append(task['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task id: %s' % cnt_err)
+
+ # Key verification - tc=888
+ def test_Target_Installed_Package(self):
+ rows = Target_Installed_Package.objects.values('id',
+ 'target_id',
+ 'package_id')
+ cnt_err = []
+
+ for row in rows:
+ target = Target.objects.filter(id=row['target_id']).values('id')
+ package = Package.objects.filter(id=row['package_id']).values('id')
+ if (not target or not package):
+ cnt_err.append(row['id'])
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for target installed package id: %s' %
+ cnt_err)
+
+ # Key verification - tc=889
+ def test_Task_Dependency(self):
+ rows = Task_Dependency.objects.values('id',
+ 'task_id',
+ 'depends_on_id')
+ cnt_err = []
+ for row in rows:
+ task_id = Task.objects.filter(id=row['task_id']).values('id')
+ depends_on_id = Task.objects.filter(
+ id=row['depends_on_id']).values('id')
+ if (not task_id or not depends_on_id):
+ cnt_err.append(row['id'])
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg='Errors for task dependency id: %s' % cnt_err)
+
+ # Check if build target file_name is populated only if is_image=true AND
+ # orm_build.outcome=0 then if the file exists and its size matches
+ # the file_size value. Need to add the tc in the test run
+ def test_Target_File_Name_Populated(self):
+ builds = Build.objects.filter(outcome=0).values('id')
+ for build in builds:
+ targets = Target.objects.filter(
+ build_id=build['id'], is_image=1).values('id')
+ for target in targets:
+ target_files = Target_Image_File.objects.filter(
+ target_id=target['id']).values('id',
+ 'file_name',
+ 'file_size')
+ cnt_err = []
+ for file_info in target_files:
+ target_id = file_info['id']
+ target_file_name = file_info['file_name']
+ target_file_size = file_info['file_size']
+ if (not target_file_name or not target_file_size):
+ cnt_err.append(target_id)
+ else:
+ if (not os.path.exists(target_file_name)):
+ cnt_err.append(target_id)
+ else:
+ if (os.path.getsize(target_file_name) !=
+ target_file_size):
+ cnt_err.append(target_id)
+ self.assertEqual(len(cnt_err), 0,
+ msg='Errors for target image file id: %s' %
+ cnt_err)
+
+ # Key verification - tc=884
+ def test_Package_Dependency(self):
+ cnt_err = []
+ deps = Package_Dependency.objects.values(
+ 'id', 'package_id', 'depends_on_id')
+ for dep in deps:
+ if (dep['package_id'] == dep['depends_on_id']):
+ cnt_err.append(dep['id'])
+ self.assertEqual(len(cnt_err), 0,
+ msg='Errors for package dependency id: %s' % cnt_err)
+
+ # Recipe key verification, recipe name does not depends on a recipe having
+ # the same name - tc=883
+ def test_Recipe_Dependency(self):
+ deps = Recipe_Dependency.objects.values(
+ 'id', 'recipe_id', 'depends_on_id')
+ cnt_err = []
+ for dep in deps:
+ if (not dep['recipe_id'] or not dep['depends_on_id']):
+ cnt_err.append(dep['id'])
+ else:
+ name = Recipe.objects.filter(
+ id=dep['recipe_id']).values('name')
+ dep_name = Recipe.objects.filter(
+ id=dep['depends_on_id']).values('name')
+ if (name == dep_name):
+ cnt_err.append(dep['id'])
+ self.assertEqual(len(cnt_err), 0,
+ msg='Errors for recipe dependency id: %s' % cnt_err)
+
+ # Check if package name does not start with a number (0-9) - tc=846
+ def test_Package_Name_For_Number(self):
+ packages = Package.objects.filter(~Q(size=-1)).values('id', 'name')
+ cnt_err = []
+ for package in packages:
+ if (package['name'][0].isdigit() is True):
+ cnt_err.append(package['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for package id: %s' % cnt_err)
+
+ # Check if package version starts with a number (0-9) - tc=847
+ def test_Package_Version_Starts_With_Number(self):
+ packages = Package.objects.filter(
+ ~Q(size=-1)).values('id', 'version')
+ cnt_err = []
+ for package in packages:
+ if (package['version'][0].isdigit() is False):
+ cnt_err.append(package['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for package id: %s' % cnt_err)
+
+ # Check if package revision starts with 'r' - tc=848
+ def test_Package_Revision_Starts_With_r(self):
+ packages = Package.objects.filter(
+ ~Q(size=-1)).values('id', 'revision')
+ cnt_err = []
+ for package in packages:
+ if (package['revision'][0].startswith("r") is False):
+ cnt_err.append(package['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for package id: %s' % cnt_err)
+
+ # Check the validity of the package build_id
+ # TC must be added in test run
+ def test_Package_Build_Id(self):
+ packages = Package.objects.filter(
+ ~Q(size=-1)).values('id', 'build_id')
+ cnt_err = []
+ for package in packages:
+ build_id = Build.objects.filter(
+ id=package['build_id']).values('id')
+ if (not build_id):
+ # They have no build_id but if they are
+ # CustomImagePackage that's expected
+ try:
+ CustomImagePackage.objects.get(pk=package['id'])
+ except CustomImagePackage.DoesNotExist:
+ cnt_err.append(package['id'])
+
+ self.assertEqual(len(cnt_err),
+ 0,
+ msg="Errors for package id: %s they have no build"
+ "associated with them" % cnt_err)
+
+ # Check the validity of package recipe_id
+ # TC must be added in test run
+ def test_Package_Recipe_Id(self):
+ packages = Package.objects.filter(
+ ~Q(size=-1)).values('id', 'recipe_id')
+ cnt_err = []
+ for package in packages:
+ recipe_id = Recipe.objects.filter(
+ id=package['recipe_id']).values('id')
+ if (not recipe_id):
+ cnt_err.append(package['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for package id: %s' % cnt_err)
+
+ # Check if package installed_size field is not null
+ # TC must be aded in test run
+ def test_Package_Installed_Size_Not_NULL(self):
+ packages = Package.objects.filter(
+ installed_size__isnull=True).values('id')
+ cnt_err = []
+ for package in packages:
+ cnt_err.append(package['id'])
+ self.assertEqual(
+ len(cnt_err), 0, msg='Errors for package id: %s' % cnt_err)
+
+ def test_custom_packages_generated(self):
+ """Test if there is a corresponding generated CustomImagePackage"""
+ """ for each of the packages generated"""
+ missing_packages = []
+
+ for package in Package.objects.all():
+ try:
+ CustomImagePackage.objects.get(name=package.name)
+ except CustomImagePackage.DoesNotExist:
+ missing_packages.append(package.name)
+
+ self.assertEqual(len(missing_packages), 0,
+ "Some package were created from the build but their"
+ " corresponding CustomImagePackage was not found")
diff --git a/poky/bitbake/lib/toaster/tests/commands/__init__.py b/poky/bitbake/lib/toaster/tests/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/commands/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/commands/test_loaddata.py b/poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
new file mode 100644
index 000000000..951f6ff5a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/commands/test_loaddata.py
@@ -0,0 +1,61 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import Layer_Version, Layer, Release, ToasterSetting
+
+
+class TestLoadDataFixtures(TestCase):
+ """ Test loading our 3 provided fixtures """
+ def test_run_loaddata_poky_command(self):
+ management.call_command('loaddata', 'poky')
+
+ num_releases = Release.objects.count()
+
+ self.assertTrue(
+ Layer_Version.objects.filter(
+ layer__name="meta-poky").count() == num_releases,
+ "Loaded poky fixture but don't have a meta-poky for all releases"
+ " defined")
+
+ def test_run_loaddata_oecore_command(self):
+ management.call_command('loaddata', 'oe-core')
+
+ # We only have the one layer for oe-core setup
+ self.assertTrue(
+ Layer.objects.filter(name="openembedded-core").count() > 0,
+ "Loaded oe-core fixture but still have no openemebedded-core"
+ " layer")
+
+ def test_run_loaddata_settings_command(self):
+ management.call_command('loaddata', 'settings')
+
+ self.assertTrue(
+ ToasterSetting.objects.filter(name="DEFAULT_RELEASE").count() > 0,
+ "Loaded settings but have no DEFAULT_RELEASE")
+
+ self.assertTrue(
+ ToasterSetting.objects.filter(
+ name__startswith="DEFCONF").count() > 0,
+ "Loaded settings but have no DEFCONF (default project "
+ "configuration values)")
diff --git a/poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py b/poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py
new file mode 100644
index 000000000..49897a476
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/commands/test_lsupdates.py
@@ -0,0 +1,45 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import Layer_Version, Machine, Recipe
+
+
+class TestLayerIndexUpdater(TestCase):
+ def test_run_lsupdates_command(self):
+ # Load some release information for us to fetch from the layer index
+ management.call_command('loaddata', 'poky')
+
+ old_layers_count = Layer_Version.objects.count()
+ old_recipes_count = Recipe.objects.count()
+ old_machines_count = Machine.objects.count()
+
+ # Now fetch the metadata from the layer index
+ management.call_command('lsupdates')
+
+ self.assertTrue(Layer_Version.objects.count() > old_layers_count,
+ "lsupdates ran but we still have no more layers!")
+ self.assertTrue(Recipe.objects.count() > old_recipes_count,
+ "lsupdates ran but we still have no more Recipes!")
+ self.assertTrue(Machine.objects.count() > old_machines_count,
+ "lsupdates ran but we still have no more Machines!")
diff --git a/poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py b/poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py
new file mode 100644
index 000000000..3e634835e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/commands/test_runbuilds.py
@@ -0,0 +1,88 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+
+from django.test import TestCase
+from django.core import management
+
+from orm.models import signal_runbuilds
+
+import threading
+import time
+import subprocess
+import signal
+
+
+class KillRunbuilds(threading.Thread):
+ """ Kill the runbuilds process after an amount of time """
+ def __init__(self, *args, **kwargs):
+ super(KillRunbuilds, self).__init__(*args, **kwargs)
+ self.setDaemon(True)
+
+ def run(self):
+ time.sleep(5)
+ signal_runbuilds()
+ time.sleep(1)
+
+ pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
+ ".runbuilds.pid")
+
+ with open(pidfile_path) as pidfile:
+ pid = pidfile.read()
+ os.kill(int(pid), signal.SIGTERM)
+
+
+class TestCommands(TestCase):
+ """ Sanity test that runbuilds executes OK """
+
+ def setUp(self):
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE",
+ "toastermain.settings_test")
+ os.environ.setdefault("BUILDDIR",
+ "/tmp/")
+
+ # Setup a real database if needed for runbuilds process
+ # to connect to
+ management.call_command('migrate')
+
+ def test_runbuilds_command(self):
+ kill_runbuilds = KillRunbuilds()
+ kill_runbuilds.start()
+
+ manage_py = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ os.pardir,
+ os.pardir,
+ "manage.py")
+
+ command = "%s runbuilds" % manage_py
+
+ process = subprocess.Popen(command,
+ shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+
+ (out, err) = process.communicate()
+ process.wait()
+
+ self.assertNotEqual(process.returncode, 1,
+ "Runbuilds returned an error %s" % err)
diff --git a/poky/bitbake/lib/toaster/tests/db/__init__.py b/poky/bitbake/lib/toaster/tests/db/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/db/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/db/test_db.py b/poky/bitbake/lib/toaster/tests/db/test_db.py
new file mode 100644
index 000000000..a0f5f6ec0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/db/test_db.py
@@ -0,0 +1,55 @@
+# The MIT License (MIT)
+#
+# Copyright (c) 2016 Damien Lespiau
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import sys
+
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
+
+from contextlib import contextmanager
+
+from django.core import management
+from django.test import TestCase
+
+
+@contextmanager
+def capture(command, *args, **kwargs):
+ out, sys.stdout = sys.stdout, StringIO()
+ command(*args, **kwargs)
+ sys.stdout.seek(0)
+ yield sys.stdout.read()
+ sys.stdout = out
+
+
+def makemigrations():
+ management.call_command('makemigrations')
+
+
+class MigrationTest(TestCase):
+
+ def testPendingMigration(self):
+ """Make sure there's no pending migration."""
+
+ with capture(makemigrations) as output:
+ self.assertEqual(output, "No changes detected\n")
diff --git a/poky/bitbake/lib/toaster/tests/eventreplay/README b/poky/bitbake/lib/toaster/tests/eventreplay/README
new file mode 100644
index 000000000..8c5bb6432
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/eventreplay/README
@@ -0,0 +1,22 @@
+# Running eventreplay tests
+
+These tests use event log files produced by bitbake <target> -w <event log file>
+You need to have event log files produced before running this tests.
+
+At the moment of writing this document tests use 2 event log files: zlib.events
+and core-image-minimal.events. They're not provided with the tests due to their
+significant size.
+
+Here is how to produce them:
+
+$ . oe-init-build-env
+$ rm -r tmp sstate-cache
+$ bitbake core-image-minimal -w core-image-minimal.events
+$ rm -rf tmp sstate-cache
+$ bitbake zlib -w zlib.events
+
+After that it should be possible to run eventreplay tests this way:
+
+$ EVENTREPLAY_DIR=./ DJANGO_SETTINGS_MODULE=toastermain.settings_test ../bitbake/lib/toaster/manage.py test -v2 tests.eventreplay
+
+Note that environment variable EVENTREPLAY_DIR should point to the directory with event log files.
diff --git a/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py b/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py
new file mode 100644
index 000000000..695661947
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/eventreplay/__init__.py
@@ -0,0 +1,97 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Tests were part of openembedded-core oe selftest Authored by: Lucian Musat
+# Ionut Chisanovici, Paul Eggleton and Cristian Iorga
+
+"""
+Test toaster backend by playing build event log files
+using toaster-eventreplay script
+"""
+
+import os
+
+from subprocess import getstatusoutput
+from pathlib import Path
+
+from django.test import TestCase
+
+from orm.models import Target_Installed_Package, Package, Build
+
+class EventReplay(TestCase):
+ """Base class for eventreplay test cases"""
+
+ def setUp(self):
+ """
+ Setup build environment:
+ - set self.script to toaster-eventreplay path
+ - set self.eventplay_dir to the value of EVENTPLAY_DIR env variable
+ """
+ bitbake_dir = Path(__file__.split('lib/toaster')[0])
+ self.script = bitbake_dir / 'bin' / 'toaster-eventreplay'
+ self.assertTrue(self.script.exists(), "%s doesn't exist")
+ self.eventplay_dir = os.getenv("EVENTREPLAY_DIR")
+ self.assertTrue(self.eventplay_dir,
+ "Environment variable EVENTREPLAY_DIR is not set")
+
+ def _replay(self, eventfile):
+ """Run toaster-eventplay <eventfile>"""
+ eventpath = Path(self.eventplay_dir) / eventfile
+ status, output = getstatusoutput('%s %s' % (self.script, eventpath))
+ if status:
+ print(output)
+
+ self.assertEqual(status, 0)
+
+class CoreImageMinimalEventReplay(EventReplay):
+ """Replay core-image-minimal events"""
+
+ def test_installed_packages(self):
+ """Test if all required packages have been installed"""
+
+ self._replay('core-image-minimal.events')
+
+ # test installed packages
+ packages = sorted(Target_Installed_Package.objects.\
+ values_list('package__name', flat=True))
+ self.assertEqual(packages, ['base-files', 'base-passwd', 'busybox',
+ 'busybox-hwclock', 'busybox-syslog',
+ 'busybox-udhcpc', 'eudev', 'glibc',
+ 'init-ifupdown', 'initscripts',
+ 'initscripts-functions', 'kernel-base',
+ 'kernel-module-uvesafb', 'libkmod',
+ 'modutils-initscripts', 'netbase',
+ 'packagegroup-core-boot', 'run-postinsts',
+ 'sysvinit', 'sysvinit-inittab',
+ 'sysvinit-pidof', 'udev-cache',
+ 'update-alternatives-opkg',
+ 'update-rc.d', 'util-linux-libblkid',
+ 'util-linux-libuuid', 'v86d', 'zlib'])
+
+class ZlibEventReplay(EventReplay):
+ """Replay zlib events"""
+
+ def test_replay_zlib(self):
+ """Test if zlib build and package are in the database"""
+ self._replay("zlib.events")
+
+ self.assertEqual(Build.objects.last().target_set.last().target, "zlib")
+ self.assertTrue('zlib' in Package.objects.values_list('name', flat=True))
diff --git a/poky/bitbake/lib/toaster/tests/functional/README b/poky/bitbake/lib/toaster/tests/functional/README
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/functional/README
diff --git a/poky/bitbake/lib/toaster/tests/functional/__init__.py b/poky/bitbake/lib/toaster/tests/functional/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/functional/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/functional/functional_helpers.py b/poky/bitbake/lib/toaster/tests/functional/functional_helpers.py
new file mode 100644
index 000000000..486078a61
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/functional/functional_helpers.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster functional tests implementation
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import logging
+import subprocess
+import signal
+import time
+import re
+
+from tests.browser.selenium_helpers_base import SeleniumTestCaseBase
+from tests.builds.buildtest import load_build_environment
+
+logger = logging.getLogger("toaster")
+
+class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
+ wait_toaster_time = 5
+
+ @classmethod
+ def setUpClass(cls):
+ # So that the buildinfo helper uses the test database'
+ if os.environ.get('DJANGO_SETTINGS_MODULE', '') != \
+ 'toastermain.settings_test':
+ raise RuntimeError("Please initialise django with the tests settings: " \
+ "DJANGO_SETTINGS_MODULE='toastermain.settings_test'")
+
+ load_build_environment()
+
+ # start toaster
+ cmd = "bash -c 'source toaster start'"
+ p = subprocess.Popen(
+ cmd,
+ cwd=os.environ.get("BUILDDIR"),
+ shell=True)
+ if p.wait() != 0:
+ raise RuntimeError("Can't initialize toaster")
+
+ super(SeleniumFunctionalTestCase, cls).setUpClass()
+ cls.live_server_url = 'http://localhost:8000/'
+
+ @classmethod
+ def tearDownClass(cls):
+ super(SeleniumFunctionalTestCase, cls).tearDownClass()
+
+ # XXX: source toaster stop gets blocked, to review why?
+ # from now send SIGTERM by hand
+ time.sleep(cls.wait_toaster_time)
+ builddir = os.environ.get("BUILDDIR")
+
+ with open(os.path.join(builddir, '.toastermain.pid'), 'r') as f:
+ toastermain_pid = int(f.read())
+ os.kill(toastermain_pid, signal.SIGTERM)
+ with open(os.path.join(builddir, '.runbuilds.pid'), 'r') as f:
+ runbuilds_pid = int(f.read())
+ os.kill(runbuilds_pid, signal.SIGTERM)
+
+
+ def get_URL(self):
+ rc=self.get_page_source()
+ project_url=re.search("(projectPageUrl\s:\s\")(.*)(\",)",rc)
+ return project_url.group(2)
+
+
+ def find_element_by_link_text_in_table(self, table_id, link_text):
+ """
+ Assume there're multiple suitable "find_element_by_link_text".
+ In this circumstance we need to specify "table".
+ """
+ try:
+ table_element = self.get_table_element(table_id)
+ element = table_element.find_element_by_link_text(link_text)
+ except NoSuchElementException as e:
+ print('no element found')
+ raise
+ return element
+
+ def get_table_element(self, table_id, *coordinate):
+ if len(coordinate) == 0:
+#return whole-table element
+ element_xpath = "//*[@id='" + table_id + "']"
+ try:
+ element = self.driver.find_element_by_xpath(element_xpath)
+ except NoSuchElementException as e:
+ raise
+ return element
+ row = coordinate[0]
+
+ if len(coordinate) == 1:
+#return whole-row element
+ element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]"
+ try:
+ element = self.driver.find_element_by_xpath(element_xpath)
+ except NoSuchElementException as e:
+ return False
+ return element
+#now we are looking for an element with specified X and Y
+ column = coordinate[1]
+
+ element_xpath = "//*[@id='" + table_id + "']/tbody/tr[" + str(row) + "]/td[" + str(column) + "]"
+ try:
+ element = self.driver.find_element_by_xpath(element_xpath)
+ except NoSuchElementException as e:
+ return False
+ return element
diff --git a/poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py b/poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py
new file mode 100644
index 000000000..cfa2b0fdf
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/functional/test_functional_basic.py
@@ -0,0 +1,243 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster functional tests implementation
+#
+# Copyright (C) 2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import time
+import re
+from tests.functional.functional_helpers import SeleniumFunctionalTestCase
+from orm.models import Project
+
+class FuntionalTestBasic(SeleniumFunctionalTestCase):
+
+# testcase (1514)
+ def test_create_slenium_project(self):
+ project_name = 'selenium-project'
+ self.get('')
+ self.driver.find_element_by_link_text("To start building, create your first Toaster project").click()
+ self.driver.find_element_by_id("new-project-name").send_keys(project_name)
+ self.driver.find_element_by_id('projectversion').click()
+ self.driver.find_element_by_id("create-project-button").click()
+ element = self.wait_until_visible('#project-created-notification')
+ self.assertTrue(self.element_exists('#project-created-notification'),'Project creation notification not shown')
+ self.assertTrue(project_name in element.text,
+ "New project name not in new project notification")
+ self.assertTrue(Project.objects.filter(name=project_name).count(),
+ "New project not found in database")
+
+ # testcase (1515)
+ def test_verify_left_bar_menu(self):
+ self.get('')
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+ self.assertTrue(self.element_exists('#config-nav'),'Configuration Tab does not exist')
+ project_URL=self.get_URL()
+ self.driver.find_element_by_xpath('//a[@href="'+project_URL+'"]').click()
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'customimages/"'+"]").click()
+ self.assertTrue(re.search("Custom images",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'Custom images information is not loading properly')
+ except:
+ self.fail(msg='No Custom images tab available')
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'images/"'+"]").click()
+ self.assertTrue(re.search("Compatible image recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible image recipes information is not loading properly')
+ except:
+ self.fail(msg='No Compatible image tab available')
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'softwarerecipes/"'+"]").click()
+ self.assertTrue(re.search("Compatible software recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible software recipe information is not loading properly')
+ except:
+ self.fail(msg='No Compatible software recipe tab available')
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'machines/"'+"]").click()
+ self.assertTrue(re.search("Compatible machines",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible machine information is not loading properly')
+ except:
+ self.fail(msg='No Compatible machines tab available')
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'layers/"'+"]").click()
+ self.assertTrue(re.search("Compatible layers",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Compatible layer information is not loading properly')
+ except:
+ self.fail(msg='No Compatible layers tab available')
+
+ try:
+ self.driver.find_element_by_xpath("//*[@id='config-nav']/ul/li/a[@href="+'"'+project_URL+'configuration"'+"]").click()
+ self.assertTrue(re.search("Bitbake variables",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Bitbake variables information is not loading properly')
+ except:
+ self.fail(msg='No Bitbake variables tab available')
+
+# testcase (1516)
+ def test_review_configuration_information(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+ project_URL=self.get_URL()
+
+ try:
+ self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
+ self.assertTrue(re.search("qemux86",self.driver.find_element_by_xpath("//span[@id='project-machine-name']").text),'The machine type is not assigned')
+ self.driver.find_element_by_xpath("//span[@id='change-machine-toggle']").click()
+ self.wait_until_visible('#select-machine-form')
+ self.wait_until_visible('#cancel-machine-change')
+ self.driver.find_element_by_xpath("//form[@id='select-machine-form']/a[@id='cancel-machine-change']").click()
+ except:
+ self.fail(msg='The machine information is wrong in the configuration page')
+
+ try:
+ self.driver.find_element_by_id('no-most-built')
+ except:
+ self.fail(msg='No Most built information in project detail page')
+
+ try:
+ self.assertTrue(re.search("Yocto Project master",self.driver.find_element_by_xpath("//span[@id='project-release-title']").text),'The project release is not defined')
+ except:
+ self.fail(msg='No project release title information in project detail page')
+
+ try:
+ self.driver.find_element_by_xpath("//div[@id='layer-container']")
+ self.assertTrue(re.search("3",self.driver.find_element_by_id("project-layers-count").text),'There should be 3 layers listed in the layer count')
+ layer_list = self.driver.find_element_by_id("layers-in-project-list")
+ layers = layer_list.find_elements_by_tag_name("li")
+ for layer in layers:
+ if re.match ("openembedded-core",layer.text):
+ print ("openembedded-core layer is a default layer in the project configuration")
+ elif re.match ("meta-poky",layer.text):
+ print ("meta-poky layer is a default layer in the project configuration")
+ elif re.match ("meta-yocto-bsp",layer.text):
+ print ("meta-yocto-bsp is a default layer in the project configuratoin")
+ else:
+ self.fail(msg='default layers are missing from the project configuration')
+ except:
+ self.fail(msg='No Layer information in project detail page')
+
+# testcase (1517)
+ def test_verify_machine_information(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+
+ try:
+ self.assertTrue(self.element_exists('#machine-section'),'Machine section for the project configuration page does not exist')
+ self.assertTrue(re.search("qemux86",self.driver.find_element_by_id("project-machine-name").text),'The machine type is not assigned')
+ self.driver.find_element_by_id("change-machine-toggle").click()
+ self.wait_until_visible('#select-machine-form')
+ self.wait_until_visible('#cancel-machine-change')
+ self.driver.find_element_by_id("cancel-machine-change").click()
+ except:
+ self.fail(msg='The machine information is wrong in the configuration page')
+
+# testcase (1518)
+ def test_verify_most_built_recipes_information(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+ project_URL=self.get_URL()
+
+ try:
+ self.assertTrue(re.search("You haven't built any recipes yet",self.driver.find_element_by_id("no-most-built").text),'Default message of no builds is not present')
+ self.driver.find_element_by_xpath("//div[@id='no-most-built']/p/a[@href="+'"'+project_URL+'images/"'+"]").click()
+ self.assertTrue(re.search("Compatible image recipes",self.driver.find_element_by_xpath("//div[@class='col-md-10']").text),'The Choose a recipe to build link is not working properly')
+ except:
+ self.fail(msg='No Most built information in project detail page')
+
+# testcase (1519)
+ def test_verify_project_release_information(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+
+ try:
+ self.assertTrue(re.search("Yocto Project master",self.driver.find_element_by_id("project-release-title").text),'The project release is not defined')
+ except:
+ self.fail(msg='No project release title information in project detail page')
+
+# testcase (1520)
+ def test_verify_layer_information(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+ project_URL=self.get_URL()
+
+ try:
+ self.driver.find_element_by_xpath("//div[@id='layer-container']")
+ self.assertTrue(re.search("3",self.driver.find_element_by_id("project-layers-count").text),'There should be 3 layers listed in the layer count')
+ layer_list = self.driver.find_element_by_id("layers-in-project-list")
+ layers = layer_list.find_elements_by_tag_name("li")
+
+ for layer in layers:
+ if re.match ("openembedded-core",layer.text):
+ print ("openembedded-core layer is a default layer in the project configuration")
+ elif re.match ("meta-poky",layer.text):
+ print ("meta-poky layer is a default layer in the project configuration")
+ elif re.match ("meta-yocto-bsp",layer.text):
+ print ("meta-yocto-bsp is a default layer in the project configuratoin")
+ else:
+ self.fail(msg='default layers are missing from the project configuration')
+
+ self.driver.find_element_by_xpath("//input[@id='layer-add-input']")
+ self.driver.find_element_by_xpath("//button[@id='add-layer-btn']")
+ self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@id='view-compatible-layers']")
+ self.driver.find_element_by_xpath("//div[@id='layer-container']/form[@class='form-inline']/p/a[@href="+'"'+project_URL+'importlayer"'+"]")
+ except:
+ self.fail(msg='No Layer information in project detail page')
+
+# testcase (1521)
+ def test_verify_project_detail_links(self):
+ self.get('')
+ self.driver.find_element_by_xpath("//div[@id='global-nav']/ul/li/a[@href="+'"'+'/toastergui/projects/'+'"'+"]").click()
+ self.wait_until_visible('#projectstable')
+ self.find_element_by_link_text_in_table('projectstable', 'selenium-project').click()
+ project_URL=self.get_URL()
+
+ self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").click()
+ self.assertTrue(re.search("Configuration",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li[@id='topbar-configuration-tab']/a[@href="+'"'+project_URL+'"'+"]").text), 'Configuration tab in project topbar is misspelled')
+
+ try:
+ self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").click()
+ self.assertTrue(re.search("Builds",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'builds/"'+"]").text), 'Builds tab in project topbar is misspelled')
+ self.driver.find_element_by_xpath("//div[@id='empty-state-projectbuildstable']")
+ except:
+ self.fail(msg='Builds tab information is not present')
+
+ try:
+ self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").click()
+ self.assertTrue(re.search("Import layer",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'importlayer"'+"]").text), 'Import layer tab in project topbar is misspelled')
+ self.driver.find_element_by_xpath("//fieldset[@id='repo-select']")
+ self.driver.find_element_by_xpath("//fieldset[@id='git-repo']")
+ except:
+ self.fail(msg='Import layer tab not loading properly')
+
+ try:
+ self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").click()
+ self.assertTrue(re.search("New custom image",self.driver.find_element_by_xpath("//div[@id='project-topbar']/ul[@class='nav nav-tabs']/li/a[@href="+'"'+project_URL+'newcustomimage/"'+"]").text), 'New custom image tab in project topbar is misspelled')
+ self.assertTrue(re.search("Select the image recipe you want to customise",self.driver.find_element_by_xpath("//div[@class='col-md-12']/h2").text),'The new custom image tab is not loading correctly')
+ except:
+ self.fail(msg='New custom image tab not loading properly')
+
+
+
diff --git a/poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt b/poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt
new file mode 100644
index 000000000..4f9fcc46d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/toaster-tests-requirements.txt
@@ -0,0 +1 @@
+selenium==2.49.2
diff --git a/poky/bitbake/lib/toaster/tests/views/README b/poky/bitbake/lib/toaster/tests/views/README
new file mode 100644
index 000000000..950c7c989
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/views/README
@@ -0,0 +1,4 @@
+
+Django unit tests to verify classes and functions based on django Views
+
+To run just these tests use ./manage.py test tests.views
diff --git a/poky/bitbake/lib/toaster/tests/views/__init__.py b/poky/bitbake/lib/toaster/tests/views/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/views/__init__.py
diff --git a/poky/bitbake/lib/toaster/tests/views/test_views.py b/poky/bitbake/lib/toaster/tests/views/test_views.py
new file mode 100644
index 000000000..1463077e9
--- /dev/null
+++ b/poky/bitbake/lib/toaster/tests/views/test_views.py
@@ -0,0 +1,540 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Test cases for Toaster GUI and ReST."""
+
+from django.test import TestCase
+from django.test.client import RequestFactory
+from django.core.urlresolvers import reverse
+from django.db.models import Q
+
+from orm.models import Project, Package
+from orm.models import Layer_Version, Recipe
+from orm.models import CustomImageRecipe
+from orm.models import CustomImagePackage
+
+import inspect
+import toastergui
+
+from toastergui.tables import SoftwareRecipesTable
+import json
+from bs4 import BeautifulSoup
+import string
+
+PROJECT_NAME = "test project"
+PROJECT_NAME2 = "test project 2"
+CLI_BUILDS_PROJECT_NAME = 'Command line builds'
+
+
+class ViewTests(TestCase):
+ """Tests to verify view APIs."""
+
+ fixtures = ['toastergui-unittest-data']
+
+ def setUp(self):
+
+ self.project = Project.objects.first()
+ self.recipe1 = Recipe.objects.get(pk=2)
+ self.customr = CustomImageRecipe.objects.first()
+ self.cust_package = CustomImagePackage.objects.first()
+ self.package = Package.objects.first()
+ self.lver = Layer_Version.objects.first()
+
+ def test_get_base_call_returns_html(self):
+ """Basic test for all-projects view"""
+ response = self.client.get(reverse('all-projects'), follow=True)
+ self.assertEqual(response.status_code, 200)
+ self.assertTrue(response['Content-Type'].startswith('text/html'))
+ self.assertTemplateUsed(response, "projects-toastertable.html")
+
+ def test_get_json_call_returns_json(self):
+ """Test for all projects output in json format"""
+ url = reverse('all-projects')
+ response = self.client.get(url, {"format": "json"}, follow=True)
+ self.assertEqual(response.status_code, 200)
+ self.assertTrue(response['Content-Type'].startswith(
+ 'application/json'))
+
+ data = json.loads(response.content.decode('utf-8'))
+
+ self.assertTrue("error" in data)
+ self.assertEqual(data["error"], "ok")
+ self.assertTrue("rows" in data)
+
+ name_found = False
+ for row in data["rows"]:
+ name_found = row['name'].find(self.project.name)
+
+ self.assertTrue(name_found,
+ "project name not found in projects table")
+
+ def test_typeaheads(self):
+ """Test typeahead ReST API"""
+ layers_url = reverse('xhr_layerstypeahead', args=(self.project.id,))
+ prj_url = reverse('xhr_projectstypeahead')
+
+ urls = [layers_url,
+ prj_url,
+ reverse('xhr_recipestypeahead', args=(self.project.id,)),
+ reverse('xhr_machinestypeahead', args=(self.project.id,))]
+
+ def basic_reponse_check(response, url):
+ """Check data structure of http response."""
+ self.assertEqual(response.status_code, 200)
+ self.assertTrue(response['Content-Type'].startswith(
+ 'application/json'))
+
+ data = json.loads(response.content.decode('utf-8'))
+
+ self.assertTrue("error" in data)
+ self.assertEqual(data["error"], "ok")
+ self.assertTrue("results" in data)
+
+ # We got a result so now check the fields
+ if len(data['results']) > 0:
+ result = data['results'][0]
+
+ self.assertTrue(len(result['name']) > 0)
+ self.assertTrue("detail" in result)
+ self.assertTrue(result['id'] > 0)
+
+ # Special check for the layers typeahead's extra fields
+ if url == layers_url:
+ self.assertTrue(len(result['layerdetailurl']) > 0)
+ self.assertTrue(len(result['vcs_url']) > 0)
+ self.assertTrue(len(result['vcs_reference']) > 0)
+ # Special check for project typeahead extra fields
+ elif url == prj_url:
+ self.assertTrue(len(result['projectPageUrl']) > 0)
+
+ return True
+
+ return False
+
+ for url in urls:
+ results = False
+
+ for typeing in list(string.ascii_letters):
+ response = self.client.get(url, {'search': typeing})
+ results = basic_reponse_check(response, url)
+ if results:
+ break
+
+ # After "typeing" the alpabet we should have result true
+ # from each of the urls
+ self.assertTrue(results)
+
+ def test_xhr_add_layer(self):
+ """Test xhr_add API"""
+ # Test for importing an already existing layer
+ api_url = reverse('xhr_layer', args=(self.project.id,))
+
+ layer_data = {'vcs_url': "git://git.example.com/test",
+ 'name': "base-layer",
+ 'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce",
+ 'project_id': self.project.id,
+ 'local_source_dir': "",
+ 'add_to_project': True,
+ 'dir_path': "/path/in/repository"}
+
+ layer_data_json = json.dumps(layer_data)
+
+ response = self.client.put(api_url, layer_data_json)
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(data["error"], "ok")
+
+ self.assertTrue(
+ layer_data['name'] in
+ self.project.get_all_compatible_layer_versions().values_list(
+ 'layer__name',
+ flat=True),
+ "Could not find imported layer in project's all layers list"
+ )
+
+ # Empty data passed
+ response = self.client.put(api_url, "{}")
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertNotEqual(data["error"], "ok")
+
+ def test_custom_ok(self):
+ """Test successful return from ReST API xhr_customrecipe"""
+ url = reverse('xhr_customrecipe')
+ params = {'name': 'custom', 'project': self.project.id,
+ 'base': self.recipe1.id}
+ response = self.client.post(url, params)
+ self.assertEqual(response.status_code, 200)
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertEqual(data['error'], 'ok')
+ self.assertTrue('url' in data)
+ # get recipe from the database
+ recipe = CustomImageRecipe.objects.get(project=self.project,
+ name=params['name'])
+ args = (self.project.id, recipe.id,)
+ self.assertEqual(reverse('customrecipe', args=args), data['url'])
+
+ def test_custom_incomplete_params(self):
+ """Test not passing all required parameters to xhr_customrecipe"""
+ url = reverse('xhr_customrecipe')
+ for params in [{}, {'name': 'custom'},
+ {'name': 'custom', 'project': self.project.id}]:
+ response = self.client.post(url, params)
+ self.assertEqual(response.status_code, 200)
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertNotEqual(data["error"], "ok")
+
+ def test_xhr_custom_wrong_project(self):
+ """Test passing wrong project id to xhr_customrecipe"""
+ url = reverse('xhr_customrecipe')
+ params = {'name': 'custom', 'project': 0, "base": self.recipe1.id}
+ response = self.client.post(url, params)
+ self.assertEqual(response.status_code, 200)
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertNotEqual(data["error"], "ok")
+
+ def test_xhr_custom_wrong_base(self):
+ """Test passing wrong base recipe id to xhr_customrecipe"""
+ url = reverse('xhr_customrecipe')
+ params = {'name': 'custom', 'project': self.project.id, "base": 0}
+ response = self.client.post(url, params)
+ self.assertEqual(response.status_code, 200)
+ data = json.loads(response.content.decode('utf-8'))
+ self.assertNotEqual(data["error"], "ok")
+
+ def test_xhr_custom_details(self):
+ """Test getting custom recipe details"""
+ url = reverse('xhr_customrecipe_id', args=(self.customr.id,))
+ response = self.client.get(url)
+ self.assertEqual(response.status_code, 200)
+ expected = {"error": "ok",
+ "info": {'id': self.customr.id,
+ 'name': self.customr.name,
+ 'base_recipe_id': self.recipe1.id,
+ 'project_id': self.project.id}}
+ self.assertEqual(json.loads(response.content.decode('utf-8')),
+ expected)
+
+ def test_xhr_custom_del(self):
+ """Test deleting custom recipe"""
+ name = "to be deleted"
+ recipe = CustomImageRecipe.objects.create(
+ name=name, project=self.project,
+ base_recipe=self.recipe1,
+ file_path="/tmp/testing",
+ layer_version=self.customr.layer_version)
+ url = reverse('xhr_customrecipe_id', args=(recipe.id,))
+ response = self.client.delete(url)
+ self.assertEqual(response.status_code, 200)
+
+ gotoUrl = reverse('projectcustomimages', args=(self.project.pk,))
+
+ self.assertEqual(json.loads(response.content.decode('utf-8')),
+ {"error": "ok",
+ "gotoUrl": gotoUrl})
+
+ # try to delete not-existent recipe
+ url = reverse('xhr_customrecipe_id', args=(recipe.id,))
+ response = self.client.delete(url)
+ self.assertEqual(response.status_code, 200)
+ self.assertNotEqual(json.loads(
+ response.content.decode('utf-8'))["error"], "ok")
+
+ def test_xhr_custom_packages(self):
+ """Test adding and deleting package to a custom recipe"""
+ # add self.package to recipe
+ response = self.client.put(reverse('xhr_customrecipe_packages',
+ args=(self.customr.id,
+ self.cust_package.id)))
+
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(json.loads(response.content.decode('utf-8')),
+ {"error": "ok"})
+ self.assertEqual(self.customr.appends_set.first().name,
+ self.cust_package.name)
+ # delete it
+ to_delete = self.customr.appends_set.first().pk
+ del_url = reverse('xhr_customrecipe_packages',
+ args=(self.customr.id, to_delete))
+
+ response = self.client.delete(del_url)
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(json.loads(response.content.decode('utf-8')),
+ {"error": "ok"})
+ all_packages = self.customr.get_all_packages().values_list('pk',
+ flat=True)
+
+ self.assertFalse(to_delete in all_packages)
+ # delete invalid package to test error condition
+ del_url = reverse('xhr_customrecipe_packages',
+ args=(self.customr.id,
+ 99999))
+
+ response = self.client.delete(del_url)
+ self.assertEqual(response.status_code, 200)
+ self.assertNotEqual(json.loads(
+ response.content.decode('utf-8'))["error"], "ok")
+
+ def test_xhr_custom_packages_err(self):
+ """Test error conditions of xhr_customrecipe_packages"""
+ # test calls with wrong recipe id and wrong package id
+ for args in [(0, self.package.id), (self.customr.id, 0)]:
+ url = reverse('xhr_customrecipe_packages', args=args)
+ # test put and delete methods
+ for method in (self.client.put, self.client.delete):
+ response = method(url)
+ self.assertEqual(response.status_code, 200)
+ self.assertNotEqual(json.loads(
+ response.content.decode('utf-8')),
+ {"error": "ok"})
+
+ def test_download_custom_recipe(self):
+ """Download the recipe file generated for the custom image"""
+
+ # Create a dummy recipe file for the custom image generation to read
+ open("/tmp/a_recipe.bb", 'a').close()
+ response = self.client.get(reverse('customrecipedownload',
+ args=(self.project.id,
+ self.customr.id)))
+
+ self.assertEqual(response.status_code, 200)
+
+ def test_software_recipes_table(self):
+ """Test structure returned for Software RecipesTable"""
+ table = SoftwareRecipesTable()
+ request = RequestFactory().get('/foo/', {'format': 'json'})
+ response = table.get(request, pid=self.project.id)
+ data = json.loads(response.content.decode('utf-8'))
+
+ recipes = Recipe.objects.filter(Q(is_image=False))
+ self.assertTrue(len(recipes) > 1,
+ "Need more than one software recipe to test "
+ "SoftwareRecipesTable")
+
+ recipe1 = recipes[0]
+ recipe2 = recipes[1]
+
+ rows = data['rows']
+ row1 = next(x for x in rows if x['name'] == recipe1.name)
+ row2 = next(x for x in rows if x['name'] == recipe2.name)
+
+ self.assertEqual(response.status_code, 200, 'should be 200 OK status')
+
+ # check other columns have been populated correctly
+ self.assertTrue(recipe1.name in row1['name'])
+ self.assertTrue(recipe1.version in row1['version'])
+ self.assertTrue(recipe1.description in
+ row1['get_description_or_summary'])
+
+ self.assertTrue(recipe1.layer_version.layer.name in
+ row1['layer_version__layer__name'])
+
+ self.assertTrue(recipe2.name in row2['name'])
+ self.assertTrue(recipe2.version in row2['version'])
+ self.assertTrue(recipe2.description in
+ row2['get_description_or_summary'])
+
+ self.assertTrue(recipe2.layer_version.layer.name in
+ row2['layer_version__layer__name'])
+
+ def test_toaster_tables(self):
+ """Test all ToasterTables instances"""
+
+ def get_data(table, options={}):
+ """Send a request and parse the json response"""
+ options['format'] = "json"
+ options['nocache'] = "true"
+ request = RequestFactory().get('/', options)
+
+ # This is the image recipe needed for a package list for
+ # PackagesTable do this here to throw a non exist exception
+ image_recipe = Recipe.objects.get(pk=4)
+
+ # Add any kwargs that are needed by any of the possible tables
+ args = {'pid': self.project.id,
+ 'layerid': self.lver.pk,
+ 'recipeid': self.recipe1.pk,
+ 'recipe_id': image_recipe.pk,
+ 'custrecipeid': self.customr.pk,
+ 'build_id': 1,
+ 'target_id': 1}
+
+ response = table.get(request, **args)
+ return json.loads(response.content.decode('utf-8'))
+
+ def get_text_from_td(td):
+ """If we have html in the td then extract the text portion"""
+ # just so we don't waste time parsing non html
+ if "<" not in td:
+ ret = td
+ else:
+ ret = BeautifulSoup(td, "html.parser").text
+
+ if len(ret):
+ return "0"
+ else:
+ return ret
+
+ # Get a list of classes in tables module
+ tables = inspect.getmembers(toastergui.tables, inspect.isclass)
+ tables.extend(inspect.getmembers(toastergui.buildtables,
+ inspect.isclass))
+
+ for name, table_cls in tables:
+ # Filter out the non ToasterTables from the tables module
+ if not issubclass(table_cls, toastergui.widgets.ToasterTable) or \
+ table_cls == toastergui.widgets.ToasterTable or \
+ 'Mixin' in name:
+ continue
+
+ # Get the table data without any options, this also does the
+ # initialisation of the table i.e. setup_columns,
+ # setup_filters and setup_queryset that we can use later
+ table = table_cls()
+ all_data = get_data(table)
+
+ self.assertTrue(len(all_data['rows']) > 1,
+ "Cannot test on a %s table with < 1 row" % name)
+
+ if table.default_orderby:
+ row_one = get_text_from_td(
+ all_data['rows'][0][table.default_orderby.strip("-")])
+ row_two = get_text_from_td(
+ all_data['rows'][1][table.default_orderby.strip("-")])
+
+ if '-' in table.default_orderby:
+ self.assertTrue(row_one >= row_two,
+ "Default ordering not working on %s"
+ " '%s' should be >= '%s'" %
+ (name, row_one, row_two))
+ else:
+ self.assertTrue(row_one <= row_two,
+ "Default ordering not working on %s"
+ " '%s' should be <= '%s'" %
+ (name, row_one, row_two))
+
+ # Test the column ordering and filtering functionality
+ for column in table.columns:
+ if column['orderable']:
+ # If a column is orderable test it in both order
+ # directions ordering on the columns field_name
+ ascending = get_data(table_cls(),
+ {"orderby": column['field_name']})
+
+ row_one = get_text_from_td(
+ ascending['rows'][0][column['field_name']])
+ row_two = get_text_from_td(
+ ascending['rows'][1][column['field_name']])
+
+ self.assertTrue(row_one <= row_two,
+ "Ascending sort applied but row 0: \"%s\""
+ " is less than row 1: \"%s\" "
+ "%s %s " %
+ (row_one, row_two,
+ column['field_name'], name))
+
+ descending = get_data(table_cls(),
+ {"orderby":
+ '-'+column['field_name']})
+
+ row_one = get_text_from_td(
+ descending['rows'][0][column['field_name']])
+ row_two = get_text_from_td(
+ descending['rows'][1][column['field_name']])
+
+ self.assertTrue(row_one >= row_two,
+ "Descending sort applied but row 0: %s"
+ "is greater than row 1: %s"
+ "field %s table %s" %
+ (row_one,
+ row_two,
+ column['field_name'], name))
+
+ # If the two start rows are the same we haven't actually
+ # changed the order
+ self.assertNotEqual(ascending['rows'][0],
+ descending['rows'][0],
+ "An orderby %s has not changed the "
+ "order of the data in table %s" %
+ (column['field_name'], name))
+
+ if column['filter_name']:
+ # If a filter is available for the column get the filter
+ # info. This contains what filter actions are defined.
+ filter_info = get_data(table_cls(),
+ {"cmd": "filterinfo",
+ "name": column['filter_name']})
+ self.assertTrue(len(filter_info['filter_actions']) > 0,
+ "Filter %s was defined but no actions "
+ "added to it" % column['filter_name'])
+
+ for filter_action in filter_info['filter_actions']:
+ # filter string to pass as the option
+ # This is the name of the filter:action
+ # e.g. project_filter:not_in_project
+ filter_string = "%s:%s" % (
+ column['filter_name'],
+ filter_action['action_name'])
+ # Now get the data with the filter applied
+ filtered_data = get_data(table_cls(),
+ {"filter": filter_string})
+
+ # date range filter actions can't specify the
+ # number of results they return, so their count is 0
+ if filter_action['count'] is not None:
+ self.assertEqual(
+ len(filtered_data['rows']),
+ int(filter_action['count']),
+ "We added a table filter for %s but "
+ "the number of rows returned was not "
+ "what the filter info said there "
+ "would be" % name)
+
+ # Test search functionality on the table
+ something_found = False
+ for search in list(string.ascii_letters):
+ search_data = get_data(table_cls(), {'search': search})
+
+ if len(search_data['rows']) > 0:
+ something_found = True
+ break
+
+ self.assertTrue(something_found,
+ "We went through the whole alphabet and nothing"
+ " was found for the search of table %s" % name)
+
+ # Test the limit functionality on the table
+ limited_data = get_data(table_cls(), {'limit': "1"})
+ self.assertEqual(len(limited_data['rows']),
+ 1,
+ "Limit 1 set on table %s but not 1 row returned"
+ % name)
+
+ # Test the pagination functionality on the table
+ page_one_data = get_data(table_cls(), {'limit': "1",
+ "page": "1"})['rows'][0]
+
+ page_two_data = get_data(table_cls(), {'limit': "1",
+ "page": "2"})['rows'][0]
+
+ self.assertNotEqual(page_one_data,
+ page_two_data,
+ "Changed page on table %s but first row is"
+ " the same as the previous page" % name)
diff --git a/poky/bitbake/lib/toaster/toastergui/__init__.py b/poky/bitbake/lib/toaster/toastergui/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/__init__.py
diff --git a/poky/bitbake/lib/toaster/toastergui/api.py b/poky/bitbake/lib/toaster/toastergui/api.py
new file mode 100644
index 000000000..ab6ba69e0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/api.py
@@ -0,0 +1,1056 @@
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Please run flake8 on this file before sending patches
+
+import os
+import re
+import logging
+import json
+from collections import Counter
+
+from orm.models import Project, ProjectTarget, Build, Layer_Version
+from orm.models import LayerVersionDependency, LayerSource, ProjectLayer
+from orm.models import Recipe, CustomImageRecipe, CustomImagePackage
+from orm.models import Layer, Target, Package, Package_Dependency
+from orm.models import ProjectVariable
+from bldcontrol.models import BuildRequest, BuildEnvironment
+from bldcontrol import bbcontroller
+
+from django.http import HttpResponse, JsonResponse
+from django.views.generic import View
+from django.core.urlresolvers import reverse
+from django.db.models import Q, F
+from django.db import Error
+from toastergui.templatetags.projecttags import filtered_filesizeformat
+
+logger = logging.getLogger("toaster")
+
+
+def error_response(error):
+ return JsonResponse({"error": error})
+
+
+class XhrBuildRequest(View):
+
+ def get(self, request, *args, **kwargs):
+ return HttpResponse()
+
+ @staticmethod
+ def cancel_build(br):
+ """Cancel a build request"""
+ try:
+ bbctrl = bbcontroller.BitbakeController(br.environment)
+ bbctrl.forceShutDown()
+ except:
+ # We catch a bunch of exceptions here because
+ # this is where the server has not had time to start up
+ # and the build request or build is in transit between
+ # processes.
+ # We can safely just set the build as cancelled
+ # already as it never got started
+ build = br.build
+ build.outcome = Build.CANCELLED
+ build.save()
+
+ # We now hand over to the buildinfohelper to update the
+ # build state once we've finished cancelling
+ br.state = BuildRequest.REQ_CANCELLING
+ br.save()
+
+ def post(self, request, *args, **kwargs):
+ """
+ Build control
+
+ Entry point: /xhr_buildrequest/<project_id>
+ Method: POST
+
+ Args:
+ id: id of build to change
+ buildCancel = build_request_id ...
+ buildDelete = id ...
+ targets = recipe_name ...
+
+ Returns:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ if 'buildCancel' in request.POST:
+ for i in request.POST['buildCancel'].strip().split(" "):
+ try:
+ br = BuildRequest.objects.get(project=project, pk=i)
+ self.cancel_build(br)
+ except BuildRequest.DoesNotExist:
+ return error_response('No such build request id %s' % i)
+
+ return error_response('ok')
+
+ if 'buildDelete' in request.POST:
+ for i in request.POST['buildDelete'].strip().split(" "):
+ try:
+ BuildRequest.objects.select_for_update().get(
+ project=project,
+ pk=i,
+ state__lte=BuildRequest.REQ_DELETED).delete()
+
+ except BuildRequest.DoesNotExist:
+ pass
+ return error_response("ok")
+
+ if 'targets' in request.POST:
+ ProjectTarget.objects.filter(project=project).delete()
+ s = str(request.POST['targets'])
+ for t in re.sub(r'[;%|"]', '', s).split(" "):
+ if ":" in t:
+ target, task = t.split(":")
+ else:
+ target = t
+ task = ""
+ ProjectTarget.objects.create(project=project,
+ target=target,
+ task=task)
+ project.schedule_build()
+
+ return error_response('ok')
+
+ response = HttpResponse()
+ response.status_code = 500
+ return response
+
+
+class XhrLayer(View):
+ """ Delete, Get, Add and Update Layer information
+
+ Methods: GET POST DELETE PUT
+ """
+
+ def get(self, request, *args, **kwargs):
+ """
+ Get layer information
+
+ Method: GET
+ Entry point: /xhr_layer/<project id>/<layerversion_id>
+ """
+
+ try:
+ layer_version = Layer_Version.objects.get(
+ pk=kwargs['layerversion_id'])
+
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ project_layers = ProjectLayer.objects.filter(
+ project=project).values_list("layercommit_id",
+ flat=True)
+
+ ret = {
+ 'error': 'ok',
+ 'id': layer_version.pk,
+ 'name': layer_version.layer.name,
+ 'layerdetailurl':
+ layer_version.get_detailspage_url(project.pk),
+ 'vcs_ref': layer_version.get_vcs_reference(),
+ 'vcs_url': layer_version.layer.vcs_url,
+ 'local_source_dir': layer_version.layer.local_source_dir,
+ 'layerdeps': {
+ "list": [
+ {
+ "id": dep.id,
+ "name": dep.layer.name,
+ "layerdetailurl":
+ dep.get_detailspage_url(project.pk),
+ "vcs_url": dep.layer.vcs_url,
+ "vcs_reference": dep.get_vcs_reference()
+ }
+ for dep in layer_version.get_alldeps(project.id)]
+ },
+ 'projectlayers': list(project_layers)
+ }
+
+ return JsonResponse(ret)
+ except Layer_Version.DoesNotExist:
+ error_response("No such layer")
+
+ def post(self, request, *args, **kwargs):
+ """
+ Update a layer
+
+ Method: POST
+ Entry point: /xhr_layer/<layerversion_id>
+
+ Args:
+ vcs_url, dirpath, commit, up_branch, summary, description,
+ local_source_dir
+
+ add_dep = append a layerversion_id as a dependency
+ rm_dep = remove a layerversion_id as a depedency
+ Returns:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+
+ try:
+ # We currently only allow Imported layers to be edited
+ layer_version = Layer_Version.objects.get(
+ id=kwargs['layerversion_id'],
+ project=kwargs['pid'],
+ layer_source=LayerSource.TYPE_IMPORTED)
+
+ except Layer_Version.DoesNotExist:
+ return error_response("Cannot find imported layer to update")
+
+ if "vcs_url" in request.POST:
+ layer_version.layer.vcs_url = request.POST["vcs_url"]
+ if "dirpath" in request.POST:
+ layer_version.dirpath = request.POST["dirpath"]
+ if "commit" in request.POST:
+ layer_version.commit = request.POST["commit"]
+ layer_version.branch = request.POST["commit"]
+ if "summary" in request.POST:
+ layer_version.layer.summary = request.POST["summary"]
+ if "description" in request.POST:
+ layer_version.layer.description = request.POST["description"]
+ if "local_source_dir" in request.POST:
+ layer_version.layer.local_source_dir = \
+ request.POST["local_source_dir"]
+
+ if "add_dep" in request.POST:
+ lvd = LayerVersionDependency(
+ layer_version=layer_version,
+ depends_on_id=request.POST["add_dep"])
+ lvd.save()
+
+ if "rm_dep" in request.POST:
+ rm_dep = LayerVersionDependency.objects.get(
+ layer_version=layer_version,
+ depends_on_id=request.POST["rm_dep"])
+ rm_dep.delete()
+
+ try:
+ layer_version.layer.save()
+ layer_version.save()
+ except Exception as e:
+ return error_response("Could not update layer version entry: %s"
+ % e)
+
+ return error_response("ok")
+
+ def put(self, request, *args, **kwargs):
+ """ Add a new layer
+
+ Method: PUT
+ Entry point: /xhr_layer/<project id>/
+ Args:
+ project_id, name,
+ [vcs_url, dir_path, git_ref], [local_source_dir], [layer_deps
+ (csv)]
+
+ """
+ try:
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ layer_data = json.loads(request.body.decode('utf-8'))
+
+ # We require a unique layer name as otherwise the lists of layers
+ # becomes very confusing
+ existing_layers = \
+ project.get_all_compatible_layer_versions().values_list(
+ "layer__name",
+ flat=True)
+
+ add_to_project = False
+ layer_deps_added = []
+ if 'add_to_project' in layer_data:
+ add_to_project = True
+
+ if layer_data['name'] in existing_layers:
+ return JsonResponse({"error": "layer-name-exists"})
+
+ layer = Layer.objects.create(name=layer_data['name'])
+
+ layer_version = Layer_Version.objects.create(
+ layer=layer,
+ project=project,
+ layer_source=LayerSource.TYPE_IMPORTED)
+
+ # Local layer
+ if ('local_source_dir' in layer_data) and layer.local_source_dir:
+ layer.local_source_dir = layer_data['local_source_dir']
+ # git layer
+ elif 'vcs_url' in layer_data:
+ layer.vcs_url = layer_data['vcs_url']
+ layer_version.dirpath = layer_data['dir_path']
+ layer_version.commit = layer_data['git_ref']
+ layer_version.branch = layer_data['git_ref']
+
+ layer.save()
+ layer_version.save()
+
+ if add_to_project:
+ ProjectLayer.objects.get_or_create(
+ layercommit=layer_version, project=project)
+
+ # Add the layer dependencies
+ if 'layer_deps' in layer_data:
+ for layer_dep_id in layer_data['layer_deps'].split(","):
+ layer_dep = Layer_Version.objects.get(pk=layer_dep_id)
+ LayerVersionDependency.objects.get_or_create(
+ layer_version=layer_version, depends_on=layer_dep)
+
+ # Add layer deps to the project if specified
+ if add_to_project:
+ created, pl = ProjectLayer.objects.get_or_create(
+ layercommit=layer_dep, project=project)
+ layer_deps_added.append(
+ {'name': layer_dep.layer.name,
+ 'layerdetailurl':
+ layer_dep.get_detailspage_url(project.pk)})
+
+ except Layer_Version.DoesNotExist:
+ return error_response("layer-dep-not-found")
+ except Project.DoesNotExist:
+ return error_response("project-not-found")
+ except KeyError:
+ return error_response("incorrect-parameters")
+
+ return JsonResponse({'error': "ok",
+ 'imported_layer': {
+ 'name': layer.name,
+ 'layerdetailurl':
+ layer_version.get_detailspage_url()},
+ 'deps_added': layer_deps_added})
+
+ def delete(self, request, *args, **kwargs):
+ """ Delete an imported layer
+
+ Method: DELETE
+ Entry point: /xhr_layer/<projed id>/<layerversion_id>
+
+ """
+ try:
+ # We currently only allow Imported layers to be deleted
+ layer_version = Layer_Version.objects.get(
+ id=kwargs['layerversion_id'],
+ project=kwargs['pid'],
+ layer_source=LayerSource.TYPE_IMPORTED)
+ except Layer_Version.DoesNotExist:
+ return error_response("Cannot find imported layer to delete")
+
+ try:
+ ProjectLayer.objects.get(project=kwargs['pid'],
+ layercommit=layer_version).delete()
+ except ProjectLayer.DoesNotExist:
+ pass
+
+ layer_version.layer.delete()
+ layer_version.delete()
+
+ return JsonResponse({
+ "error": "ok",
+ "gotoUrl": reverse('projectlayers', args=(kwargs['pid'],))
+ })
+
+
+class XhrCustomRecipe(View):
+ """ Create a custom image recipe """
+
+ def post(self, request, *args, **kwargs):
+ """
+ Custom image recipe REST API
+
+ Entry point: /xhr_customrecipe/
+ Method: POST
+
+ Args:
+ name: name of custom recipe to create
+ project: target project id of orm.models.Project
+ base: base recipe id of orm.models.Recipe
+
+ Returns:
+ {"error": "ok",
+ "url": <url of the created recipe>}
+ or
+ {"error": <error message>}
+ """
+ # check if request has all required parameters
+ for param in ('name', 'project', 'base'):
+ if param not in request.POST:
+ return error_response("Missing parameter '%s'" % param)
+
+ # get project and baserecipe objects
+ params = {}
+ for name, model in [("project", Project),
+ ("base", Recipe)]:
+ value = request.POST[name]
+ try:
+ params[name] = model.objects.get(id=value)
+ except model.DoesNotExist:
+ return error_response("Invalid %s id %s" % (name, value))
+
+ # create custom recipe
+ try:
+
+ # Only allowed chars in name are a-z, 0-9 and -
+ if re.search(r'[^a-z|0-9|-]', request.POST["name"]):
+ return error_response("invalid-name")
+
+ custom_images = CustomImageRecipe.objects.all()
+
+ # Are there any recipes with this name already in our project?
+ existing_image_recipes_in_project = custom_images.filter(
+ name=request.POST["name"], project=params["project"])
+
+ if existing_image_recipes_in_project.count() > 0:
+ return error_response("image-already-exists")
+
+ # Are there any recipes with this name which aren't custom
+ # image recipes?
+ custom_image_ids = custom_images.values_list('id', flat=True)
+ existing_non_image_recipes = Recipe.objects.filter(
+ Q(name=request.POST["name"]) & ~Q(pk__in=custom_image_ids)
+ )
+
+ if existing_non_image_recipes.count() > 0:
+ return error_response("recipe-already-exists")
+
+ # create layer 'Custom layer' and verion if needed
+ layer, l_created = Layer.objects.get_or_create(
+ name=CustomImageRecipe.LAYER_NAME,
+ summary="Layer for custom recipes")
+
+ if l_created:
+ layer.local_source_dir = "toaster_created_layer"
+ layer.save()
+
+ # Check if we have a layer version already
+ # We don't use get_or_create here because the dirpath will change
+ # and is a required field
+ lver = Layer_Version.objects.filter(Q(project=params['project']) &
+ Q(layer=layer) &
+ Q(build=None)).last()
+ if lver is None:
+ lver, lv_created = Layer_Version.objects.get_or_create(
+ project=params['project'],
+ layer=layer,
+ layer_source=LayerSource.TYPE_LOCAL,
+ dirpath="toaster_created_layer")
+
+ # Add a dependency on our layer to the base recipe's layer
+ LayerVersionDependency.objects.get_or_create(
+ layer_version=lver,
+ depends_on=params["base"].layer_version)
+
+ # Add it to our current project if needed
+ ProjectLayer.objects.get_or_create(project=params['project'],
+ layercommit=lver,
+ optional=False)
+
+ # Create the actual recipe
+ recipe, r_created = CustomImageRecipe.objects.get_or_create(
+ name=request.POST["name"],
+ base_recipe=params["base"],
+ project=params["project"],
+ layer_version=lver,
+ is_image=True)
+
+ # If we created the object then setup these fields. They may get
+ # overwritten later on and cause the get_or_create to create a
+ # duplicate if they've changed.
+ if r_created:
+ recipe.file_path = request.POST["name"]
+ recipe.license = "MIT"
+ recipe.version = "0.1"
+ recipe.save()
+
+ except Error as err:
+ return error_response("Can't create custom recipe: %s" % err)
+
+ # Find the package list from the last build of this recipe/target
+ target = Target.objects.filter(Q(build__outcome=Build.SUCCEEDED) &
+ Q(build__project=params['project']) &
+ (Q(target=params['base'].name) |
+ Q(target=recipe.name))).last()
+ if target:
+ # Copy in every package
+ # We don't want these packages to be linked to anything because
+ # that underlying data may change e.g. delete a build
+ for tpackage in target.target_installed_package_set.all():
+ try:
+ built_package = tpackage.package
+ # The package had no recipe information so is a ghost
+ # package skip it
+ if built_package.recipe is None:
+ continue
+
+ config_package = CustomImagePackage.objects.get(
+ name=built_package.name)
+
+ recipe.includes_set.add(config_package)
+ except Exception as e:
+ logger.warning("Error adding package %s %s" %
+ (tpackage.package.name, e))
+ pass
+
+ # pre-create layer directory structure, so that other builds
+ # are not blocked by this new recipe dependecy
+ # NOTE: this is parallel code to 'localhostbecontroller.py'
+ be = BuildEnvironment.objects.all()[0]
+ layerpath = os.path.join(be.builddir,
+ CustomImageRecipe.LAYER_NAME)
+ for name in ("conf", "recipes"):
+ path = os.path.join(layerpath, name)
+ if not os.path.isdir(path):
+ os.makedirs(path)
+ # pre-create layer.conf
+ config = os.path.join(layerpath, "conf", "layer.conf")
+ if not os.path.isfile(config):
+ with open(config, "w") as conf:
+ conf.write('BBPATH .= ":${LAYERDIR}"\nBBFILES += "${LAYERDIR}/recipes/*.bb"\n')
+ # pre-create new image's recipe file
+ recipe_path = os.path.join(layerpath, "recipes", "%s.bb" %
+ recipe.name)
+ with open(recipe_path, "w") as recipef:
+ recipef.write(recipe.generate_recipe_file_contents())
+
+ return JsonResponse(
+ {"error": "ok",
+ "packages": recipe.get_all_packages().count(),
+ "url": reverse('customrecipe', args=(params['project'].pk,
+ recipe.id))})
+
+
+class XhrCustomRecipeId(View):
+ """
+ Set of ReST API processors working with recipe id.
+
+ Entry point: /xhr_customrecipe/<recipe_id>
+
+ Methods:
+ GET - Get details of custom image recipe
+ DELETE - Delete custom image recipe
+
+ Returns:
+ GET:
+ {"error": "ok",
+ "info": dictionary of field name -> value pairs
+ of the CustomImageRecipe model}
+ DELETE:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+ @staticmethod
+ def _get_ci_recipe(recipe_id):
+ """ Get Custom Image recipe or return an error response"""
+ try:
+ custom_recipe = \
+ CustomImageRecipe.objects.get(pk=recipe_id)
+ return custom_recipe, None
+
+ except CustomImageRecipe.DoesNotExist:
+ return None, error_response("Custom recipe with id=%s "
+ "not found" % recipe_id)
+
+ def get(self, request, *args, **kwargs):
+ custom_recipe, error = self._get_ci_recipe(kwargs['recipe_id'])
+ if error:
+ return error
+
+ if request.method == 'GET':
+ info = {"id": custom_recipe.id,
+ "name": custom_recipe.name,
+ "base_recipe_id": custom_recipe.base_recipe.id,
+ "project_id": custom_recipe.project.id}
+
+ return JsonResponse({"error": "ok", "info": info})
+
+ def delete(self, request, *args, **kwargs):
+ custom_recipe, error = self._get_ci_recipe(kwargs['recipe_id'])
+ if error:
+ return error
+
+ project = custom_recipe.project
+
+ custom_recipe.delete()
+ return JsonResponse({"error": "ok",
+ "gotoUrl": reverse("projectcustomimages",
+ args=(project.pk,))})
+
+
+class XhrCustomRecipePackages(View):
+ """
+ ReST API to add/remove packages to/from custom recipe.
+
+ Entry point: /xhr_customrecipe/<recipe_id>/packages/<package_id>
+ Methods:
+ PUT - Add package to the recipe
+ DELETE - Delete package from the recipe
+ GET - Get package information
+
+ Returns:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+ @staticmethod
+ def _get_package(package_id):
+ try:
+ package = CustomImagePackage.objects.get(pk=package_id)
+ return package, None
+ except Package.DoesNotExist:
+ return None, error_response("Package with id=%s "
+ "not found" % package_id)
+
+ def _traverse_dependents(self, next_package_id,
+ rev_deps, all_current_packages, tree_level=0):
+ """
+ Recurse through reverse dependency tree for next_package_id.
+ Limit the reverse dependency search to packages not already scanned,
+ that is, not already in rev_deps.
+ Limit the scan to a depth (tree_level) not exceeding the count of
+ all packages in the custom image, and if that depth is exceeded
+ return False, pop out of the recursion, and write a warning
+ to the log, but this is unlikely, suggesting a dependency loop
+ not caught by bitbake.
+ On return, the input/output arg rev_deps is appended with queryset
+ dictionary elements, annotated for use in the customimage template.
+ The list has unsorted, but unique elements.
+ """
+ max_dependency_tree_depth = all_current_packages.count()
+ if tree_level >= max_dependency_tree_depth:
+ logger.warning(
+ "The number of reverse dependencies "
+ "for this package exceeds " + max_dependency_tree_depth +
+ " and the remaining reverse dependencies will not be removed")
+ return True
+
+ package = CustomImagePackage.objects.get(id=next_package_id)
+ dependents = \
+ package.package_dependencies_target.annotate(
+ name=F('package__name'),
+ pk=F('package__pk'),
+ size=F('package__size'),
+ ).values("name", "pk", "size").exclude(
+ ~Q(pk__in=all_current_packages)
+ )
+
+ for pkg in dependents:
+ if pkg in rev_deps:
+ # already seen, skip dependent search
+ continue
+
+ rev_deps.append(pkg)
+ if (self._traverse_dependents(pkg["pk"], rev_deps,
+ all_current_packages,
+ tree_level+1)):
+ return True
+
+ return False
+
+ def _get_all_dependents(self, package_id, all_current_packages):
+ """
+ Returns sorted list of recursive reverse dependencies for package_id,
+ as a list of dictionary items, by recursing through dependency
+ relationships.
+ """
+ rev_deps = []
+ self._traverse_dependents(package_id, rev_deps, all_current_packages)
+ rev_deps = sorted(rev_deps, key=lambda x: x["name"])
+ return rev_deps
+
+ def get(self, request, *args, **kwargs):
+ recipe, error = XhrCustomRecipeId._get_ci_recipe(
+ kwargs['recipe_id'])
+ if error:
+ return error
+
+ # If no package_id then list all the current packages
+ if not kwargs['package_id']:
+ total_size = 0
+ packages = recipe.get_all_packages().values("id",
+ "name",
+ "version",
+ "size")
+ for package in packages:
+ package['size_formatted'] = \
+ filtered_filesizeformat(package['size'])
+ total_size += package['size']
+
+ return JsonResponse({"error": "ok",
+ "packages": list(packages),
+ "total": len(packages),
+ "total_size": total_size,
+ "total_size_formatted":
+ filtered_filesizeformat(total_size)})
+ else:
+ package, error = XhrCustomRecipePackages._get_package(
+ kwargs['package_id'])
+ if error:
+ return error
+
+ all_current_packages = recipe.get_all_packages()
+
+ # Dependencies for package which aren't satisfied by the
+ # current packages in the custom image recipe
+ deps = package.package_dependencies_source.for_target_or_none(
+ recipe.name)['packages'].annotate(
+ name=F('depends_on__name'),
+ pk=F('depends_on__pk'),
+ size=F('depends_on__size'),
+ ).values("name", "pk", "size").filter(
+ # There are two depends types we don't know why
+ (Q(dep_type=Package_Dependency.TYPE_TRDEPENDS) |
+ Q(dep_type=Package_Dependency.TYPE_RDEPENDS)) &
+ ~Q(pk__in=all_current_packages)
+ )
+
+ # Reverse dependencies which are needed by packages that are
+ # in the image. Recursive search providing all dependents,
+ # not just immediate dependents.
+ reverse_deps = self._get_all_dependents(kwargs['package_id'],
+ all_current_packages)
+ total_size_deps = 0
+ total_size_reverse_deps = 0
+
+ for dep in deps:
+ dep['size_formatted'] = \
+ filtered_filesizeformat(dep['size'])
+ total_size_deps += dep['size']
+
+ for dep in reverse_deps:
+ dep['size_formatted'] = \
+ filtered_filesizeformat(dep['size'])
+ total_size_reverse_deps += dep['size']
+
+ return JsonResponse(
+ {"error": "ok",
+ "id": package.pk,
+ "name": package.name,
+ "version": package.version,
+ "unsatisfied_dependencies": list(deps),
+ "unsatisfied_dependencies_size": total_size_deps,
+ "unsatisfied_dependencies_size_formatted":
+ filtered_filesizeformat(total_size_deps),
+ "reverse_dependencies": list(reverse_deps),
+ "reverse_dependencies_size": total_size_reverse_deps,
+ "reverse_dependencies_size_formatted":
+ filtered_filesizeformat(total_size_reverse_deps)})
+
+ def put(self, request, *args, **kwargs):
+ recipe, error = XhrCustomRecipeId._get_ci_recipe(kwargs['recipe_id'])
+ package, error = self._get_package(kwargs['package_id'])
+ if error:
+ return error
+
+ included_packages = recipe.includes_set.values_list('pk',
+ flat=True)
+
+ # If we're adding back a package which used to be included in this
+ # image all we need to do is remove it from the excludes
+ if package.pk in included_packages:
+ try:
+ recipe.excludes_set.remove(package)
+ return {"error": "ok"}
+ except Package.DoesNotExist:
+ return error_response("Package %s not found in excludes"
+ " but was in included list" %
+ package.name)
+ else:
+ recipe.appends_set.add(package)
+ # Make sure that package is not in the excludes set
+ try:
+ recipe.excludes_set.remove(package)
+ except:
+ pass
+
+ # Add the dependencies we think will be added to the recipe
+ # as a result of appending this package.
+ # TODO this should recurse down the entire deps tree
+ for dep in package.package_dependencies_source.all_depends():
+ try:
+ cust_package = CustomImagePackage.objects.get(
+ name=dep.depends_on.name)
+
+ recipe.includes_set.add(cust_package)
+ try:
+ # When adding the pre-requisite package, make
+ # sure it's not in the excluded list from a
+ # prior removal.
+ recipe.excludes_set.remove(cust_package)
+ except package.DoesNotExist:
+ # Don't care if the package had never been excluded
+ pass
+ except:
+ logger.warning("Could not add package's suggested"
+ "dependencies to the list")
+ return JsonResponse({"error": "ok"})
+
+ def delete(self, request, *args, **kwargs):
+ recipe, error = XhrCustomRecipeId._get_ci_recipe(kwargs['recipe_id'])
+ package, error = self._get_package(kwargs['package_id'])
+ if error:
+ return error
+
+ try:
+ included_packages = recipe.includes_set.values_list('pk',
+ flat=True)
+ # If we're deleting a package which is included we need to
+ # Add it to the excludes list.
+ if package.pk in included_packages:
+ recipe.excludes_set.add(package)
+ else:
+ recipe.appends_set.remove(package)
+
+ # remove dependencies as well
+ all_current_packages = recipe.get_all_packages()
+
+ reverse_deps_dictlist = self._get_all_dependents(
+ package.pk,
+ all_current_packages)
+
+ ids = [entry['pk'] for entry in reverse_deps_dictlist]
+ reverse_deps = CustomImagePackage.objects.filter(id__in=ids)
+ for r in reverse_deps:
+ try:
+ if r.id in included_packages:
+ recipe.excludes_set.add(r)
+ else:
+ recipe.appends_set.remove(r)
+ except:
+ pass
+
+ return JsonResponse({"error": "ok"})
+ except CustomImageRecipe.DoesNotExist:
+ return error_response("Tried to remove package that wasn't"
+ " present")
+
+
+class XhrProject(View):
+ """ Create, delete or edit a project
+
+ Entry point: /xhr_project/<project_id>
+ """
+ def post(self, request, *args, **kwargs):
+ """
+ Edit project control
+
+ Args:
+ layerAdd = layer_version_id layer_version_id ...
+ layerDel = layer_version_id layer_version_id ...
+ projectName = new_project_name
+ machineName = new_machine_name
+
+ Returns:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+ try:
+ prj = Project.objects.get(pk=kwargs['project_id'])
+ except Project.DoesNotExist:
+ return error_response("No such project")
+
+ # Add layers
+ if 'layerAdd' in request.POST and len(request.POST['layerAdd']) > 0:
+ for layer_version_id in request.POST['layerAdd'].split(','):
+ try:
+ lv = Layer_Version.objects.get(pk=int(layer_version_id))
+ ProjectLayer.objects.get_or_create(project=prj,
+ layercommit=lv)
+ except Layer_Version.DoesNotExist:
+ return error_response("Layer version %s asked to add "
+ "doesn't exist" % layer_version_id)
+
+ # Remove layers
+ if 'layerDel' in request.POST and len(request.POST['layerDel']) > 0:
+ layer_version_ids = request.POST['layerDel'].split(',')
+ ProjectLayer.objects.filter(
+ project=prj,
+ layercommit_id__in=layer_version_ids).delete()
+
+ # Project name change
+ if 'projectName' in request.POST:
+ prj.name = request.POST['projectName']
+ prj.save()
+
+ # Machine name change
+ if 'machineName' in request.POST:
+ machinevar = prj.projectvariable_set.get(name="MACHINE")
+ machinevar.value = request.POST['machineName']
+ machinevar.save()
+
+ # Distro name change
+ if 'distroName' in request.POST:
+ distrovar = prj.projectvariable_set.get(name="DISTRO")
+ distrovar.value = request.POST['distroName']
+ distrovar.save()
+
+ return JsonResponse({"error": "ok"})
+
+ def get(self, request, *args, **kwargs):
+ """
+ Returns:
+ json object representing the current project
+ or:
+ {"error": <error message>}
+ """
+
+ try:
+ project = Project.objects.get(pk=kwargs['project_id'])
+ except Project.DoesNotExist:
+ return error_response("Project %s does not exist" %
+ kwargs['project_id'])
+
+ # Create the frequently built targets list
+
+ freqtargets = Counter(Target.objects.filter(
+ Q(build__project=project),
+ ~Q(build__outcome=Build.IN_PROGRESS)
+ ).order_by("target").values_list("target", flat=True))
+
+ freqtargets = freqtargets.most_common(5)
+
+ # We now have the targets in order of frequency but if there are two
+ # with the same frequency then we need to make sure those are in
+ # alphabetical order without losing the frequency ordering
+
+ tmp = []
+ switch = None
+ for i, freqtartget in enumerate(freqtargets):
+ target, count = freqtartget
+ try:
+ target_next, count_next = freqtargets[i+1]
+ if count == count_next and target > target_next:
+ switch = target
+ continue
+ except IndexError:
+ pass
+
+ tmp.append(target)
+
+ if switch:
+ tmp.append(switch)
+ switch = None
+
+ freqtargets = tmp
+
+ layers = []
+ for layer in project.projectlayer_set.all():
+ layers.append({
+ "id": layer.layercommit.pk,
+ "name": layer.layercommit.layer.name,
+ "vcs_url": layer.layercommit.layer.vcs_url,
+ "local_source_dir": layer.layercommit.layer.local_source_dir,
+ "vcs_reference": layer.layercommit.get_vcs_reference(),
+ "url": layer.layercommit.layer.layer_index_url,
+ "layerdetailurl": layer.layercommit.get_detailspage_url(
+ project.pk),
+ "xhrLayerUrl": reverse("xhr_layer",
+ args=(project.pk,
+ layer.layercommit.pk)),
+ "layersource": layer.layercommit.layer_source
+ })
+
+ data = {
+ "name": project.name,
+ "layers": layers,
+ "freqtargets": freqtargets,
+ }
+
+ if project.release is not None:
+ data['release'] = {
+ "id": project.release.pk,
+ "name": project.release.name,
+ "description": project.release.description
+ }
+
+ try:
+ data["machine"] = {"name":
+ project.projectvariable_set.get(
+ name="MACHINE").value}
+ except ProjectVariable.DoesNotExist:
+ data["machine"] = None
+ try:
+ data["distro"] = {"name":
+ project.projectvariable_set.get(
+ name="DISTRO").value}
+ except ProjectVariable.DoesNotExist:
+ data["distro"] = None
+
+ data['error'] = "ok"
+
+ return JsonResponse(data)
+
+ def put(self, request, *args, **kwargs):
+ # TODO create new project api
+ return HttpResponse()
+
+ def delete(self, request, *args, **kwargs):
+ """Delete a project. Cancels any builds in progress"""
+ try:
+ project = Project.objects.get(pk=kwargs['project_id'])
+ # Cancel any builds in progress
+ for br in BuildRequest.objects.filter(
+ project=project,
+ state=BuildRequest.REQ_INPROGRESS):
+ XhrBuildRequest.cancel_build(br)
+
+ project.delete()
+
+ except Project.DoesNotExist:
+ return error_response("Project %s does not exist" %
+ kwargs['project_id'])
+
+ return JsonResponse({
+ "error": "ok",
+ "gotoUrl": reverse("all-projects", args=[])
+ })
+
+
+class XhrBuild(View):
+ """ Delete a build object
+
+ Entry point: /xhr_build/<build_id>
+ """
+ def delete(self, request, *args, **kwargs):
+ """
+ Delete build data
+
+ Args:
+ build_id = build_id
+
+ Returns:
+ {"error": "ok"}
+ or
+ {"error": <error message>}
+ """
+ try:
+ build = Build.objects.get(pk=kwargs['build_id'])
+ project = build.project
+ build.delete()
+ except Build.DoesNotExist:
+ return error_response("Build %s does not exist" %
+ kwargs['build_id'])
+ return JsonResponse({
+ "error": "ok",
+ "gotoUrl": reverse("projectbuilds", args=(project.pk,))
+ })
diff --git a/poky/bitbake/lib/toaster/toastergui/buildtables.py b/poky/bitbake/lib/toaster/toastergui/buildtables.py
new file mode 100644
index 000000000..755a7c2e4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/buildtables.py
@@ -0,0 +1,609 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from orm.models import Build, Task, Target, Package
+from django.db.models import Q, Sum
+
+import toastergui.tables as tables
+from toastergui.widgets import ToasterTable
+from toastergui.tablefilter import TableFilter
+from toastergui.tablefilter import TableFilterActionToggle
+
+
+class BuildTablesMixin(ToasterTable):
+ def get_context_data(self, **kwargs):
+ # We need to be explicit about which superclass we're calling here
+ # Otherwise the MRO gets in a right mess
+ context = ToasterTable.get_context_data(self, **kwargs)
+ context['build'] = Build.objects.get(pk=kwargs['build_id'])
+ return context
+
+
+class BuiltPackagesTableBase(tables.PackagesTable):
+ """ Table to display all the packages built in a build """
+ def __init__(self, *args, **kwargs):
+ super(BuiltPackagesTableBase, self).__init__(*args, **kwargs)
+ self.title = "Packages built"
+ self.default_orderby = "name"
+
+ def setup_queryset(self, *args, **kwargs):
+ build = Build.objects.get(pk=kwargs['build_id'])
+ self.static_context_extra['build'] = build
+ self.static_context_extra['target_name'] = None
+ self.queryset = build.package_set.all().exclude(recipe=None)
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ def setup_columns(self, *args, **kwargs):
+ super(BuiltPackagesTableBase, self).setup_columns(*args, **kwargs)
+
+ def pkg_link_template(val):
+ """ return the template used for the link with the val as the
+ element value i.e. inside the <a></a>"""
+
+ return ('''
+ <a href="
+ {%% url "package_built_detail" extra.build.pk data.pk %%}
+ ">%s</a>
+ ''' % val)
+
+ def recipe_link_template(val):
+ return ('''
+ {%% if data.recipe %%}
+ <a href="
+ {%% url "recipe" extra.build.pk data.recipe.pk %%}
+ ">%(value)s</a>
+ {%% else %%}
+ %(value)s
+ {%% endif %%}
+ ''' % {'value': val})
+
+ add_pkg_link_to = 'name'
+ add_recipe_link_to = 'recipe__name'
+
+ # Add the recipe and pkg build links to the required columns
+ for column in self.columns:
+ # Convert to template field style accessors
+ tmplv = column['field_name'].replace('__', '.')
+ tmplv = "{{data.%s}}" % tmplv
+
+ if column['field_name'] is add_pkg_link_to:
+ # Don't overwrite an existing template
+ if column['static_data_template']:
+ column['static_data_template'] =\
+ pkg_link_template(column['static_data_template'])
+ else:
+ column['static_data_template'] = pkg_link_template(tmplv)
+
+ column['static_data_name'] = column['field_name']
+
+ elif column['field_name'] is add_recipe_link_to:
+ # Don't overwrite an existing template
+ if column['static_data_template']:
+ column['static_data_template'] =\
+ recipe_link_template(column['static_data_template'])
+ else:
+ column['static_data_template'] =\
+ recipe_link_template(tmplv)
+ column['static_data_name'] = column['field_name']
+
+ self.add_column(title="Layer",
+ field_name="recipe__layer_version__layer__name",
+ hidden=True,
+ orderable=True)
+
+ layer_branch_template = '''
+ {%if not data.recipe.layer_version.layer.local_source_dir %}
+ <span class="text-muted">{{data.recipe.layer_version.branch}}</span>
+ {% else %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.recipe.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
+ {% endif %}
+ '''
+
+ self.add_column(title="Layer branch",
+ field_name="recipe__layer_version__branch",
+ hidden=True,
+ static_data_name="recipe__layer_version__branch",
+ static_data_template=layer_branch_template,
+ orderable=True)
+
+ git_rev_template = '''
+ {% if not data.recipe.layer_version.layer.local_source_dir %}
+ {% with vcs_ref=data.recipe.layer_version.commit %}
+ {% include 'snippets/gitrev_popover.html' %}
+ {% endwith %}
+ {% else %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.recipe.layer_version.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
+ {% endif %}
+ '''
+
+ self.add_column(title="Layer commit",
+ static_data_name='vcs_ref',
+ static_data_template=git_rev_template,
+ hidden=True)
+
+
+class BuiltPackagesTable(BuildTablesMixin, BuiltPackagesTableBase):
+ """ Show all the packages built for the selected build """
+ def __init__(self, *args, **kwargs):
+ super(BuiltPackagesTable, self).__init__(*args, **kwargs)
+ self.title = "Packages built"
+ self.default_orderby = "name"
+
+ self.empty_state =\
+ ('<strong>No packages were built.</strong> How did this happen? '
+ 'Well, BitBake reuses as much stuff as possible. '
+ 'If all of the packages needed were already built and available '
+ 'in your build infrastructure, BitBake '
+ 'will not rebuild any of them. This might be slightly confusing, '
+ 'but it does make everything faster.')
+
+ def setup_columns(self, *args, **kwargs):
+ super(BuiltPackagesTable, self).setup_columns(*args, **kwargs)
+
+ def remove_dep_cols(columns):
+ for column in columns:
+ # We don't need these fields
+ if column['static_data_name'] in ['reverse_dependencies',
+ 'dependencies']:
+ continue
+
+ yield column
+
+ self.columns = list(remove_dep_cols(self.columns))
+
+
+class InstalledPackagesTable(BuildTablesMixin, BuiltPackagesTableBase):
+ """ Show all packages installed in an image """
+ def __init__(self, *args, **kwargs):
+ super(InstalledPackagesTable, self).__init__(*args, **kwargs)
+ self.title = "Packages Included"
+ self.default_orderby = "name"
+
+ def make_package_list(self, target):
+ # The database design means that you get the intermediate objects and
+ # not package objects like you'd really want so we get them here
+ pkgs = target.target_installed_package_set.values_list('package',
+ flat=True)
+ return Package.objects.filter(pk__in=pkgs)
+
+ def get_context_data(self, **kwargs):
+ context = super(InstalledPackagesTable,
+ self).get_context_data(**kwargs)
+
+ target = Target.objects.get(pk=kwargs['target_id'])
+ packages = self.make_package_list(target)
+
+ context['packages_sum'] = packages.aggregate(
+ Sum('installed_size'))['installed_size__sum']
+
+ context['target'] = target
+ return context
+
+ def setup_queryset(self, *args, **kwargs):
+ build = Build.objects.get(pk=kwargs['build_id'])
+ self.static_context_extra['build'] = build
+
+ target = Target.objects.get(pk=kwargs['target_id'])
+ # We send these separately because in the case of image details table
+ # we don't have a target just the recipe name as the target
+ self.static_context_extra['target_name'] = target.target
+ self.static_context_extra['target_id'] = target.pk
+
+ self.static_context_extra['add_links'] = True
+
+ self.queryset = self.make_package_list(target)
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ def setup_columns(self, *args, **kwargs):
+ super(InstalledPackagesTable, self).setup_columns(**kwargs)
+ self.add_column(title="Installed size",
+ static_data_name="installed_size",
+ static_data_template="{% load projecttags %}"
+ "{{data.size|filtered_filesizeformat}}",
+ orderable=True,
+ hidden=True)
+
+ # Add the template to show installed name for installed packages
+ install_name_tmpl =\
+ ('<a href="{% url "package_included_detail" extra.build.pk'
+ ' extra.target_id data.pk %}">{{data.name}}</a>'
+ '{% if data.installed_name and data.installed_name !='
+ ' data.name %}'
+ '<span class="text-muted"> as {{data.installed_name}}</span>'
+ ' <span class="glyphicon glyphicon-question-sign get-help hover-help"'
+ ' title="{{data.name}} was renamed at packaging time and'
+ ' was installed in your image as {{data.installed_name}}'
+ '"></span>{% endif %} ')
+
+ for column in self.columns:
+ if column['static_data_name'] == 'name':
+ column['static_data_template'] = install_name_tmpl
+ break
+
+
+class BuiltRecipesTable(BuildTablesMixin):
+ """ Table to show the recipes that have been built in this build """
+
+ def __init__(self, *args, **kwargs):
+ super(BuiltRecipesTable, self).__init__(*args, **kwargs)
+ self.title = "Recipes built"
+ self.default_orderby = "name"
+
+ def setup_queryset(self, *args, **kwargs):
+ build = Build.objects.get(pk=kwargs['build_id'])
+ self.static_context_extra['build'] = build
+ self.queryset = build.get_recipes()
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ def setup_columns(self, *args, **kwargs):
+ recipe_name_tmpl =\
+ '<a href="{% url "recipe" extra.build.pk data.pk %}">'\
+ '{{data.name}}'\
+ '</a>'
+
+ recipe_file_tmpl =\
+ '{{data.file_path}}'\
+ '{% if data.pathflags %}<i>({{data.pathflags}})</i>'\
+ '{% endif %}'
+
+ git_branch_template = '''
+ {% if data.layer_version.layer.local_source_dir %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
+ {% else %}
+ <span>{{data.layer_version.branch}}</span>
+ {% endif %}
+ '''
+
+ git_rev_template = '''
+ {% if data.layer_version.layer.local_source_dir %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no commit associated with it"> </span>
+ {% else %}
+ {% with vcs_ref=data.layer_version.commit %}
+ {% include 'snippets/gitrev_popover.html' %}
+ {% endwith %}
+ {% endif %}
+ '''
+
+ depends_on_tmpl = '''
+ {% with deps=data.r_dependencies_recipe.all %}
+ {% with count=deps|length %}
+ {% if count %}
+ <a class="btn btn-default" title="
+ <a href='{% url "recipe" extra.build.pk data.pk %}#dependencies'>
+ {{data.name}}</a> dependencies"
+ data-content="<ul class='list-unstyled'>
+ {% for dep in deps|dictsort:"depends_on.name"%}
+ <li><a href='{% url "recipe" extra.build.pk dep.depends_on.pk %}'>
+ {{dep.depends_on.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{count}}
+ </a>
+ {% endif %}{% endwith %}{% endwith %}
+ '''
+
+ rev_depends_tmpl = '''
+ {% with revs=data.r_dependencies_depends.all %}
+ {% with count=revs|length %}
+ {% if count %}
+ <a class="btn btn-default"
+ title="
+ <a href='{% url "recipe" extra.build.pk data.pk %}#brought-in-by'>
+ {{data.name}}</a> reverse dependencies"
+ data-content="<ul class='list-unstyled'>
+ {% for dep in revs|dictsort:"recipe.name" %}
+ <li>
+ <a href='{% url "recipe" extra.build.pk dep.recipe.pk %}'>
+ {{dep.recipe.name}}
+ </a></li>
+ {% endfor %}
+ </ul>">
+ {{count}}
+ </a>
+ {% endif %}{% endwith %}{% endwith %}
+ '''
+
+ self.add_column(title="Recipe",
+ field_name="name",
+ static_data_name='name',
+ orderable=True,
+ hideable=False,
+ static_data_template=recipe_name_tmpl)
+
+ self.add_column(title="Version",
+ hideable=False,
+ field_name="version")
+
+ self.add_column(title="Dependencies",
+ static_data_name="dependencies",
+ static_data_template=depends_on_tmpl)
+
+ self.add_column(title="Reverse dependencies",
+ static_data_name="revdeps",
+ static_data_template=rev_depends_tmpl,
+ help_text='Recipe build-time reverse dependencies'
+ ' (i.e. the recipes that depend on this recipe)')
+
+ self.add_column(title="Recipe file",
+ field_name="file_path",
+ static_data_name="file_path",
+ static_data_template=recipe_file_tmpl,
+ hidden=True)
+
+ self.add_column(title="Section",
+ field_name="section",
+ orderable=True,
+ hidden=True)
+
+ self.add_column(title="License",
+ field_name="license",
+ help_text='Multiple license names separated by the'
+ ' pipe character indicates a choice between licenses.'
+ ' Multiple license names separated by the ampersand'
+ ' character indicates multiple licenses exist that'
+ ' cover different parts of the source',
+ orderable=True)
+
+ self.add_column(title="Layer",
+ field_name="layer_version__layer__name",
+ orderable=True)
+
+ self.add_column(title="Layer branch",
+ field_name="layer_version__branch",
+ static_data_name="layer_version__branch",
+ static_data_template=git_branch_template,
+ orderable=True,
+ hidden=True)
+
+ self.add_column(title="Layer commit",
+ static_data_name="commit",
+ static_data_template=git_rev_template,
+ hidden=True)
+
+
+class BuildTasksTable(BuildTablesMixin):
+ """ Table to show the tasks that run in this build """
+
+ def __init__(self, *args, **kwargs):
+ super(BuildTasksTable, self).__init__(*args, **kwargs)
+ self.title = "Tasks"
+ self.default_orderby = "order"
+
+ # Toggle these columns on off for Time/CPU usage/Disk I/O tables
+ self.toggle_columns = {}
+
+ def setup_queryset(self, *args, **kwargs):
+ build = Build.objects.get(pk=kwargs['build_id'])
+ self.static_context_extra['build'] = build
+ self.queryset = build.task_build.filter(~Q(order=None))
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ def setup_filters(self, *args, **kwargs):
+ # Execution outcome types filter
+ executed_outcome = TableFilter(name="execution_outcome",
+ title="Filter Tasks by 'Executed")
+
+ exec_outcome_action_exec = TableFilterActionToggle(
+ "executed",
+ "Executed Tasks",
+ Q(task_executed=True))
+
+ exec_outcome_action_not_exec = TableFilterActionToggle(
+ "not_executed",
+ "Not Executed Tasks",
+ Q(task_executed=False))
+
+ executed_outcome.add_action(exec_outcome_action_exec)
+ executed_outcome.add_action(exec_outcome_action_not_exec)
+
+ # Task outcome types filter
+ task_outcome = TableFilter(name="task_outcome",
+ title="Filter Task by 'Outcome'")
+
+ for outcome_enum, title in Task.TASK_OUTCOME:
+ if outcome_enum is Task.OUTCOME_NA:
+ continue
+ action = TableFilterActionToggle(
+ title.replace(" ", "_").lower(),
+ "%s Tasks" % title,
+ Q(outcome=outcome_enum))
+
+ task_outcome.add_action(action)
+
+ # SSTATE outcome types filter
+ sstate_outcome = TableFilter(name="sstate_outcome",
+ title="Filter Task by 'Cache attempt'")
+
+ for sstate_result_enum, title in Task.SSTATE_RESULT:
+ action = TableFilterActionToggle(
+ title.replace(" ", "_").lower(),
+ "Tasks with '%s' attempts" % title,
+ Q(sstate_result=sstate_result_enum))
+
+ sstate_outcome.add_action(action)
+
+ self.add_filter(sstate_outcome)
+ self.add_filter(executed_outcome)
+ self.add_filter(task_outcome)
+
+ def setup_columns(self, *args, **kwargs):
+ self.toggle_columns['order'] = len(self.columns)
+
+ recipe_name_tmpl =\
+ '<a href="{% url "recipe" extra.build.pk data.recipe.pk %}">'\
+ '{{data.recipe.name}}'\
+ '</a>'
+
+ def task_link_tmpl(val):
+ return ('<a name="task-{{data.order}}"'
+ 'href="{%% url "task" extra.build.pk data.pk %%}">'
+ '%s'
+ '</a>') % str(val)
+
+ self.add_column(title="Order",
+ static_data_name="order",
+ static_data_template='{{data.order}}',
+ hideable=False,
+ orderable=True)
+
+ self.add_column(title="Task",
+ static_data_name="task_name",
+ static_data_template=task_link_tmpl(
+ "{{data.task_name}}"),
+ hideable=False,
+ orderable=True)
+
+ self.add_column(title="Recipe",
+ static_data_name='recipe__name',
+ static_data_template=recipe_name_tmpl,
+ hideable=False,
+ orderable=True)
+
+ self.add_column(title="Recipe version",
+ field_name='recipe__version',
+ hidden=True)
+
+ self.add_column(title="Executed",
+ static_data_name="task_executed",
+ static_data_template='{{data.get_executed_display}}',
+ filter_name='execution_outcome',
+ orderable=True)
+
+ self.static_context_extra['OUTCOME_FAILED'] = Task.OUTCOME_FAILED
+ outcome_tmpl = '{{data.outcome_text}}'
+ outcome_tmpl = ('%s '
+ '{%% if data.outcome = extra.OUTCOME_FAILED %%}'
+ '<a href="{%% url "build_artifact" extra.build.pk '
+ ' "tasklogfile" data.pk %%}">'
+ ' <span class="glyphicon glyphicon-download-alt'
+ ' get-help" title="Download task log file"></span>'
+ '</a> {%% endif %%}'
+ '<span class="glyphicon glyphicon-question-sign'
+ ' get-help hover-help" style="visibility: hidden;" '
+ 'title="{{data.get_outcome_help}}"></span>'
+ ) % outcome_tmpl
+
+ self.add_column(title="Outcome",
+ static_data_name="outcome",
+ static_data_template=outcome_tmpl,
+ filter_name="task_outcome",
+ orderable=True)
+
+ self.toggle_columns['sstate_result'] = len(self.columns)
+
+ self.add_column(title="Cache attempt",
+ static_data_name="sstate_result",
+ static_data_template='{{data.sstate_text}}',
+ filter_name="sstate_outcome",
+ orderable=True)
+
+ self.toggle_columns['elapsed_time'] = len(self.columns)
+
+ self.add_column(
+ title="Time (secs)",
+ static_data_name="elapsed_time",
+ static_data_template='{% load projecttags %}{% load humanize %}'
+ '{{data.elapsed_time|format_none_and_zero|floatformat:2}}',
+ orderable=True,
+ hidden=True)
+
+ self.toggle_columns['cpu_time_sys'] = len(self.columns)
+
+ self.add_column(
+ title="System CPU time (secs)",
+ static_data_name="cpu_time_system",
+ static_data_template='{% load projecttags %}{% load humanize %}'
+ '{{data.cpu_time_system|format_none_and_zero|floatformat:2}}',
+ hidden=True,
+ orderable=True)
+
+ self.toggle_columns['cpu_time_user'] = len(self.columns)
+
+ self.add_column(
+ title="User CPU time (secs)",
+ static_data_name="cpu_time_user",
+ static_data_template='{% load projecttags %}{% load humanize %}'
+ '{{data.cpu_time_user|format_none_and_zero|floatformat:2}}',
+ hidden=True,
+ orderable=True)
+
+ self.toggle_columns['disk_io'] = len(self.columns)
+
+ self.add_column(
+ title="Disk I/O (ms)",
+ static_data_name="disk_io",
+ static_data_template='{% load projecttags %}{% load humanize %}'
+ '{{data.disk_io|format_none_and_zero|filtered_filesizeformat}}',
+ hidden=True,
+ orderable=True)
+
+
+class BuildTimeTable(BuildTasksTable):
+ """ Same as tasks table but the Time column is default displayed"""
+
+ def __init__(self, *args, **kwargs):
+ super(BuildTimeTable, self).__init__(*args, **kwargs)
+ self.default_orderby = "-elapsed_time"
+
+ def setup_columns(self, *args, **kwargs):
+ super(BuildTimeTable, self).setup_columns(**kwargs)
+
+ self.columns[self.toggle_columns['order']]['hidden'] = True
+ self.columns[self.toggle_columns['order']]['hideable'] = True
+ self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
+ self.columns[self.toggle_columns['elapsed_time']]['hidden'] = False
+
+
+class BuildCPUTimeTable(BuildTasksTable):
+ """ Same as tasks table but the CPU usage columns are default displayed"""
+
+ def __init__(self, *args, **kwargs):
+ super(BuildCPUTimeTable, self).__init__(*args, **kwargs)
+ self.default_orderby = "-cpu_time_system"
+
+ def setup_columns(self, *args, **kwargs):
+ super(BuildCPUTimeTable, self).setup_columns(**kwargs)
+
+ self.columns[self.toggle_columns['order']]['hidden'] = True
+ self.columns[self.toggle_columns['order']]['hideable'] = True
+ self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
+ self.columns[self.toggle_columns['cpu_time_sys']]['hidden'] = False
+ self.columns[self.toggle_columns['cpu_time_user']]['hidden'] = False
+
+
+class BuildIOTable(BuildTasksTable):
+ """ Same as tasks table but the Disk IO column is default displayed"""
+
+ def __init__(self, *args, **kwargs):
+ super(BuildIOTable, self).__init__(*args, **kwargs)
+ self.default_orderby = "-disk_io"
+
+ def setup_columns(self, *args, **kwargs):
+ super(BuildIOTable, self).setup_columns(**kwargs)
+
+ self.columns[self.toggle_columns['order']]['hidden'] = True
+ self.columns[self.toggle_columns['order']]['hideable'] = True
+ self.columns[self.toggle_columns['sstate_result']]['hidden'] = True
+ self.columns[self.toggle_columns['disk_io']]['hidden'] = False
diff --git a/poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml b/poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
new file mode 100644
index 000000000..4517ed176
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/fixtures/toastergui-unittest-data.xml
@@ -0,0 +1,459 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+ <object pk="1" model="orm.bitbakeversion">
+ <field type="CharField" name="name">v2.3</field>
+ <field type="GitURLField" name="giturl">git://git.openembedded.org/bitbake</field>
+ <field type="CharField" name="dirpath">b</field>
+ <field type="CharField" name="branch">a</field>
+ </object>
+ <object pk="1" model="orm.release">
+ <field type="CharField" name="name">master</field>
+ <field type="CharField" name="description">master project</field>
+ <field to="orm.bitbake_version" name="bitbake_version">1</field>
+ </object>
+ <object pk="1" model="orm.project">
+ <field type="CharField" name="name">a test project</field>
+ <field type="CharField" name="short_description"></field>
+ <field to="orm.bitbakeversion" name="bitbake_version" rel="ManyToOneRel">1</field>
+ <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
+ <field type="DateTimeField" name="created">2016-02-15T18:46:20.098248+00:00</field>
+ <field type="DateTimeField" name="updated">2016-02-15T18:46:20.098392+00:00</field>
+ <field type="IntegerField" name="user_id"><None></None></field>
+ <field type="BooleanField" name="is_default">False</field>
+ </object>
+ <object pk="2" model="orm.project">
+ <field type="CharField" name="name">z test project</field>
+ <field type="CharField" name="short_description"></field>
+ <field to="orm.bitbakeversion" name="bitbake_version" rel="ManyToOneRel">1</field>
+ <field to="orm.release" name="release" rel="ManyToOneRel">2</field>
+ <field type="DateTimeField" name="created">2016-02-15T18:46:20.107936+00:00</field>
+ <field type="DateTimeField" name="updated">2016-02-15T18:46:20.108066+00:00</field>
+ <field type="IntegerField" name="user_id"><None></None></field>
+ <field type="BooleanField" name="is_default">False</field>
+ </object>
+ <object pk="1" model="orm.ProjectVariable">
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="name">MACHINE</field>
+ <field type="TextField" name="value">qemux86</field>
+ </object>
+ <object pk="2" model="orm.ProjectVariable">
+ <field to="orm.project" name="project" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="name">MACHINE</field>
+ <field type="TextField" name="value">qemux86</field>
+ </object>
+ <object pk="1" model="orm.build">
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="machine">x12</field>
+ <field type="CharField" name="distro"></field>
+ <field type="CharField" name="distro_version"></field>
+ <field type="DateTimeField" name="started_on">2016-02-14T18:46:20.114530+00:00</field>
+ <field type="DateTimeField" name="completed_on">2016-02-14T18:46:20.114530+00:00</field>
+ <field type="IntegerField" name="outcome">0</field>
+ <field type="CharField" name="cooker_log_path"></field>
+ <field type="CharField" name="build_name">a</field>
+ <field type="CharField" name="bitbake_version"></field>
+ </object>
+ <object pk="2" model="orm.build">
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="machine">raspberrypi2</field>
+ <field type="CharField" name="distro"></field>
+ <field type="CharField" name="distro_version"></field>
+ <field type="DateTimeField" name="started_on">2016-02-13T18:46:20.114530+00:00</field>
+ <field type="DateTimeField" name="completed_on">2016-02-13T18:46:20.114530+00:00</field>
+ <field type="IntegerField" name="outcome">0</field>
+ <field type="CharField" name="cooker_log_path"></field>
+ <field type="CharField" name="build_name">b</field>
+ <field type="CharField" name="bitbake_version"></field>
+ </object>
+ <object pk="3" model="orm.build">
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="machine">qemux86</field>
+ <field type="CharField" name="distro"></field>
+ <field type="CharField" name="distro_version"></field>
+ <field type="DateTimeField" name="started_on">2016-02-12T18:46:20.114530+00:00</field>
+ <field type="DateTimeField" name="completed_on">2016-02-12T18:46:20.114530+00:00</field>
+ <field type="IntegerField" name="outcome">1</field>
+ <field type="CharField" name="cooker_log_path"></field>
+ <field type="CharField" name="build_name">c</field>
+ <field type="CharField" name="bitbake_version"></field>
+ </object>
+ <object pk="4" model="orm.build">
+ <field to="orm.project" name="project" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="machine">qemux86</field>
+ <field type="CharField" name="distro"></field>
+ <field type="CharField" name="distro_version"></field>
+ <field type="DateTimeField" name="started_on">2016-02-11T18:46:20.114530+00:00</field>
+ <field type="DateTimeField" name="completed_on">2016-02-11T18:46:20.114530+00:00</field>
+ <field type="IntegerField" name="outcome">0</field>
+ <field type="CharField" name="cooker_log_path"></field>
+ <field type="CharField" name="build_name">d</field>
+ <field type="CharField" name="bitbake_version"></field>
+ </object>
+ <object pk="1" model="orm.target">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="target">a image recipe</field>
+ <field type="CharField" name="task"><None></None></field>
+ <field type="BooleanField" name="is_image">True</field>
+ <field type="IntegerField" name="image_size">290</field>
+ </object>
+ <object pk="2" model="orm.target">
+ <field to="orm.build" name="build" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="target">z something</field>
+ <field type="CharField" name="task"><None></None></field>
+ <field type="BooleanField" name="is_image">False</field>
+ <field type="IntegerField" name="image_size">0</field>
+ <field type="CharField" name="license_manifest_path"><None></None></field>
+ </object>
+ <object pk="3" model="orm.target">
+ <field to="orm.build" name="build" rel="ManyToOneRel">3</field>
+ <field type="CharField" name="target">h recipe</field>
+ <field type="CharField" name="task"><None></None></field>
+ <field type="BooleanField" name="is_image">False</field>
+ <field type="IntegerField" name="image_size">0</field>
+ <field type="CharField" name="license_manifest_path"><None></None></field>
+ </object>
+ <object pk="1" model="orm.package">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="name">b pkg</field>
+ <field type="CharField" name="installed_name"></field>
+ <field type="CharField" name="version"></field>
+ <field type="CharField" name="revision"></field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="IntegerField" name="size">777</field>
+ <field type="IntegerField" name="installed_size">0</field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license">a license</field>
+ </object>
+ <object pk="2" model="orm.package">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="name">f pkg</field>
+ <field type="CharField" name="installed_name">f</field>
+ <field type="CharField" name="version"></field>
+ <field type="CharField" name="revision"></field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="IntegerField" name="size">4</field>
+ <field type="IntegerField" name="installed_size">10</field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license">z license</field>
+ </object>
+ <object pk="3" model="orm.package">
+ <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="name">a custom image pkg</field>
+ <field type="CharField" name="installed_name"></field>
+ <field type="CharField" name="version"></field>
+ <field type="CharField" name="revision"></field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="IntegerField" name="size">10</field>
+ <field type="IntegerField" name="installed_size">0</field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license">h license</field>
+ </object>
+ <object pk="4" model="orm.package">
+ <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="name">z custom image pkg</field>
+ <field type="CharField" name="installed_name"></field>
+ <field type="CharField" name="version"></field>
+ <field type="CharField" name="revision"></field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="IntegerField" name="size">5</field>
+ <field type="IntegerField" name="installed_size">0</field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license">z license</field>
+ </object>
+ <object pk="5" model="orm.package">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">4</field>
+ <field type="CharField" name="name">a custom image pkg</field>
+ <field type="CharField" name="installed_name"></field>
+ <field type="CharField" name="version"></field>
+ <field type="CharField" name="revision"></field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="IntegerField" name="size">2</field>
+ <field type="IntegerField" name="installed_size">0</field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license">h licence</field>
+ </object>
+ <object pk="1" model="orm.target_installed_package">
+ <field to="orm.target" name="target" rel="ManyToOneRel">1</field>
+ <field to="orm.package" name="package" rel="ManyToOneRel">1</field>
+ </object>
+ <object pk="2" model="orm.target_installed_package">
+ <field to="orm.target" name="target" rel="ManyToOneRel">1</field>
+ <field to="orm.package" name="package" rel="ManyToOneRel">2</field>
+ </object>
+ <object pk="3" model="orm.target_installed_package">
+ <field to="orm.target" name="target" rel="ManyToOneRel">1</field>
+ <field to="orm.package" name="package" rel="ManyToOneRel">3</field>
+ </object>
+ <!-- Note that these augment the existing orm.package of the same pk -->
+ <object pk="4" model="orm.customimagepackage">
+ <field to="orm.customimagerecipe" name="recipe_includes" rel="ManyToManyRel"></field>
+ <field to="orm.customimagerecipe" name="recipe_excludes" rel="ManyToManyRel"></field>
+ <field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object pk="3"></object></field>
+ </object>
+ <object pk="5" model="orm.customimagepackage">
+ <field to="orm.customimagerecipe" name="recipe_includes" rel="ManyToManyRel"></field>
+ <field to="orm.customimagerecipe" name="recipe_excludes" rel="ManyToManyRel"></field>
+ <field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object pk="3"></object></field>
+ </object>
+ <object pk="1" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">z recipe</field>
+ <field type="CharField" name="version">5.2</field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
+ <field type="TextField" name="summary">z recipe</field>
+ <field type="TextField" name="description">z recipe</field>
+ <field type="CharField" name="section">z section</field>
+ <field type="CharField" name="license">z license</field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path"></field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">False</field>
+ </object>
+ <object pk="2" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">a recipe</field>
+ <field type="CharField" name="version">1.2</field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
+ <field type="TextField" name="summary">a recipe</field>
+ <field type="TextField" name="description">a recipe</field>
+ <field type="CharField" name="section">a section</field>
+ <field type="CharField" name="license">a license</field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path">a_recipe.bb</field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">False</field>
+ </object>
+ <object pk="3" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">a custom recipe</field>
+ <field type="CharField" name="version"></field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license"></field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path">custr</field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">False</field>
+ </object>
+ <object pk="4" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">a image recipe</field>
+ <field type="CharField" name="version">1.2</field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
+ <field type="TextField" name="summary">one recipe</field>
+ <field type="TextField" name="description">recipe</field>
+ <field type="CharField" name="section">A</field>
+ <field type="CharField" name="license">A</field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path">/one/</field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">True</field>
+ </object>
+ <object pk="5" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">z image recipe</field>
+ <field type="CharField" name="version">1.3</field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
+ <field type="TextField" name="summary">two image recipe</field>
+ <field type="TextField" name="description">recipe two</field>
+ <field type="CharField" name="section">B</field>
+ <field type="CharField" name="license">Z</field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path">/two/</field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">True</field>
+ </object>
+ <object pk="6" model="orm.recipe">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">z custom recipe</field>
+ <field type="CharField" name="version"></field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
+ <field type="TextField" name="summary"></field>
+ <field type="TextField" name="description"></field>
+ <field type="CharField" name="section"></field>
+ <field type="CharField" name="license"></field>
+ <field type="CharField" name="homepage"></field>
+ <field type="CharField" name="bugtracker"></field>
+ <field type="FilePathField" name="file_path">zzzz</field>
+ <field type="CharField" name="pathflags"></field>
+ <field type="BooleanField" name="is_image">False</field>
+ </object>
+ <!-- Added for an additional built recipe -->
+ <object pk="6" model="orm.recipe">
+ <field type="CharField" name="name">g recipe</field>
+ <field type="CharField" name="version">1.2.3</field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">3</field>
+ <field type="CharField" name="license">g license</field>
+ <field type="FilePathField" name="file_path">/g</field>
+ <field type="BooleanField" name="is_image">False</field>
+ </object>
+
+ <object pk="1" model="orm.machine">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="name">a machine</field>
+ <field type="CharField" name="description">a machine</field>
+ </object>
+ <object pk="2" model="orm.machine">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="name">z machine</field>
+ <field type="CharField" name="description">z machine</field>
+ </object>
+ <object pk="3" model="orm.machine">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="name">g machine</field>
+ <field type="CharField" name="description">g machine</field>
+ </object>
+ <object pk="1" model="orm.bitbakeversion">
+ <field type="CharField" name="name">test bbv</field>
+ <field type="CharField" name="giturl">/tmp/</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="dirpath"></field>
+ </object>
+ <object pk="1" model="orm.release">
+ <field type="CharField" name="name">test release</field>
+ <field type="CharField" name="description"></field>
+ <field to="orm.bitbakeversion" name="bitbake_version" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch_name">master</field>
+ <field type="TextField" name="helptext"><None></None></field>
+ </object>
+ <object pk="2" model="orm.release">
+ <field type="CharField" name="name">test release 2</field>
+ <field type="CharField" name="description"></field>
+ <field to="orm.bitbakeversion" name="bitbake_version" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch_name">master</field>
+ <field type="TextField" name="helptext"><None></None></field>
+ </object>
+ <object pk="1" model="orm.layer">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">a layer</field>
+ <field type="CharField" name="vcs_url">/tmp/</field>
+ </object>
+ <object pk="2" model="orm.layer">
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field type="CharField" name="name">z layer</field>
+ <field type="CharField" name="layer_index_url"></field>
+ <field type="CharField" name="vcs_url">git://two/</field>
+ </object>
+ <object pk="1" model="orm.layer_version">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field to="orm.layer" name="layer" rel="ManyToOneRel">1</field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch">master</field>
+ <field type="CharField" name="commit">abcdef123</field>
+ <field type="CharField" name="dirpath">/tmp/</field>
+ <field type="IntegerField" name="priority">0</field>
+ <field type="FilePathField" name="local_path">/</field>
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ </object>
+ <object pk="2" model="orm.layer_version">
+ <field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
+ <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch">testing-branch</field>
+ <field type="CharField" name="commit">9876fedcba</field>
+ <field type="CharField" name="dirpath"><None></None></field>
+ <field type="IntegerField" name="priority">0</field>
+ <field type="FilePathField" name="local_path">/</field>
+ <field to="orm.project" name="project" rel="ManyToOneRel"><None></None></field>
+ </object>
+ <object pk="3" model="orm.layer_version">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
+ <field type="DateTimeField" name="up_date"><None></None></field>
+ <field to="orm.release" name="release" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="branch">testing-branch</field>
+ <field type="CharField" name="commit">9876fedcba</field>
+ <field type="CharField" name="dirpath"><None></None></field>
+ <field type="IntegerField" name="priority">0</field>
+ <field type="FilePathField" name="local_path">/</field>
+ <field to="orm.project" name="project" rel="ManyToOneRel"><None></None></field>
+ </object>
+ <object pk="1" model="orm.projectlayer">
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field to="orm.layer_version" name="layercommit" rel="ManyToOneRel">1</field>
+ <field type="BooleanField" name="optional">True</field>
+ </object>
+ <object pk="3" model="orm.customimagerecipe">
+ <field to="orm.recipe" name="base_recipe" rel="ManyToOneRel">2</field>
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="DateTimeField" name="last_updated"><None></None></field>
+ </object>
+ <object pk="6" model="orm.customimagerecipe">
+ <field to="orm.recipe" name="base_recipe" rel="ManyToOneRel">4</field>
+ <field to="orm.project" name="project" rel="ManyToOneRel">1</field>
+ <field type="DateTimeField" name="last_updated"><None></None></field>
+ </object>
+ <object pk="1" model="orm.logmessage">
+ <field to="orm.build" name="build" rel="ManyToOneRel">2</field>
+ <field to="orm.task" name="task" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="level">1</field>
+ <field type="TextField" name="message"><None></None></field>
+ <field type="FilePathField" name="pathname"></field>
+ <field type="IntegerField" name="lineno"><None></None></field>
+ </object>
+ <object pk="2" model="orm.logmessage">
+ <field to="orm.build" name="build" rel="ManyToOneRel">2</field>
+ <field to="orm.task" name="task" rel="ManyToOneRel"><None></None></field>
+ <field type="IntegerField" name="level">2</field>
+ <field type="TextField" name="message"><None></None></field>
+ <field type="FilePathField" name="pathname"></field>
+ <field type="IntegerField" name="lineno"><None></None></field>
+ </object>
+ <!-- Some tasks for build 1 to test build tables -->
+ <object pk="1" model="orm.task">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="order">1</field>
+ <field type="BooleanField" name="task_executed">False</field>
+ <field type="IntegerField" name="outcome">-1</field>
+ <field type="CharField" name="sstate_checksum">abcdef123</field>
+ <field type="FilePathField" name="path_to_sstate_obj">34/wefw.tar</field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">1</field>
+ <field type="CharField" name="task_name">a_do_compile</field>
+ <field type="DecimalField" name="elapsed_time">100</field>
+ <field type="IntegerField" name="disk_io">10</field>
+ <field type="IntegerField" name="disk_io_read">11</field>
+ <field type="IntegerField" name="disk_io_write">12</field>
+ <field type="DecimalField" name="cpu_time_user">10.1</field>
+ <field type="DecimalField" name="cpu_time_system">10.2</field>
+ <field type="IntegerField" name="sstate_result">3</field>
+ </object>
+ <object pk="2" model="orm.task">
+ <field to="orm.build" name="build" rel="ManyToOneRel">1</field>
+ <field type="IntegerField" name="order">2</field>
+ <field type="BooleanField" name="task_executed">True</field>
+ <field type="IntegerField" name="outcome">2</field>
+ <field type="CharField" name="sstate_checksum">85bccb7802fd5f48</field>
+ <field type="FilePathField" name="path_to_sstate_obj">85/sstarpm.tgz</field>
+ <field to="orm.recipe" name="recipe" rel="ManyToOneRel">2</field>
+ <field type="CharField" name="task_name">z_do_package_write_rpm</field>
+ <field type="DecimalField" name="elapsed_time">245</field>
+ <field type="IntegerField" name="disk_io">12424</field>
+ <field type="IntegerField" name="disk_io_read">23423</field>
+ <field type="IntegerField" name="disk_io_write">83943</field>
+ <field type="DecimalField" name="cpu_time_user">20394.3</field>
+ <field type="DecimalField" name="cpu_time_system">5363.3</field>
+ <field type="IntegerField" name="sstate_result">1</field>
+ </object>
+</django-objects>
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css
new file mode 100644
index 000000000..42c79d6e4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css
@@ -0,0 +1,6760 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+html {
+ font-family: sans-serif;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+}
+body {
+ margin: 0;
+}
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+ display: block;
+}
+audio,
+canvas,
+progress,
+video {
+ display: inline-block;
+ vertical-align: baseline;
+}
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+[hidden],
+template {
+ display: none;
+}
+a {
+ background-color: transparent;
+}
+a:active,
+a:hover {
+ outline: 0;
+}
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+b,
+strong {
+ font-weight: bold;
+}
+dfn {
+ font-style: italic;
+}
+h1 {
+ margin: .67em 0;
+ font-size: 2em;
+}
+mark {
+ color: #000;
+ background: #ff0;
+}
+small {
+ font-size: 80%;
+}
+sub,
+sup {
+ position: relative;
+ font-size: 75%;
+ line-height: 0;
+ vertical-align: baseline;
+}
+sup {
+ top: -.5em;
+}
+sub {
+ bottom: -.25em;
+}
+img {
+ border: 0;
+}
+svg:not(:root) {
+ overflow: hidden;
+}
+figure {
+ margin: 1em 40px;
+}
+hr {
+ height: 0;
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+}
+pre {
+ overflow: auto;
+}
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+button,
+input,
+optgroup,
+select,
+textarea {
+ margin: 0;
+ font: inherit;
+ color: inherit;
+}
+button {
+ overflow: visible;
+}
+button,
+select {
+ text-transform: none;
+}
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button;
+ cursor: pointer;
+}
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ padding: 0;
+ border: 0;
+}
+input {
+ line-height: normal;
+}
+input[type="checkbox"],
+input[type="radio"] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ padding: 0;
+}
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+input[type="search"] {
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+ -webkit-appearance: textfield;
+}
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+fieldset {
+ padding: .35em .625em .75em;
+ margin: 0 2px;
+ border: 1px solid #c0c0c0;
+}
+legend {
+ padding: 0;
+ border: 0;
+}
+textarea {
+ overflow: auto;
+}
+optgroup {
+ font-weight: bold;
+}
+table {
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+td,
+th {
+ padding: 0;
+}
+/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
+@media print {
+ *,
+ *:before,
+ *:after {
+ color: #000 !important;
+ text-shadow: none !important;
+ background: transparent !important;
+ -webkit-box-shadow: none !important;
+ box-shadow: none !important;
+ }
+ a,
+ a:visited {
+ text-decoration: underline;
+ }
+ a[href]:after {
+ content: " (" attr(href) ")";
+ }
+ abbr[title]:after {
+ content: " (" attr(title) ")";
+ }
+ a[href^="#"]:after,
+ a[href^="javascript:"]:after {
+ content: "";
+ }
+ pre,
+ blockquote {
+ border: 1px solid #999;
+
+ page-break-inside: avoid;
+ }
+ thead {
+ display: table-header-group;
+ }
+ tr,
+ img {
+ page-break-inside: avoid;
+ }
+ img {
+ max-width: 100% !important;
+ }
+ p,
+ h2,
+ h3 {
+ orphans: 3;
+ widows: 3;
+ }
+ h2,
+ h3 {
+ page-break-after: avoid;
+ }
+ .navbar {
+ display: none;
+ }
+ .btn > .caret,
+ .dropup > .btn > .caret {
+ border-top-color: #000 !important;
+ }
+ .label {
+ border: 1px solid #000;
+ }
+ .table {
+ border-collapse: collapse !important;
+ }
+ .table td,
+ .table th {
+ background-color: #fff !important;
+ }
+ .table-bordered th,
+ .table-bordered td {
+ border: 1px solid #ddd !important;
+ }
+}
+@font-face {
+ font-family: 'Glyphicons Halflings';
+
+ src: url('../fonts/glyphicons-halflings-regular.eot');
+ src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
+}
+.glyphicon {
+ position: relative;
+ top: 1px;
+ display: inline-block;
+ font-family: 'Glyphicons Halflings';
+ font-style: normal;
+ font-weight: normal;
+ line-height: 1;
+
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+.glyphicon-asterisk:before {
+ content: "\002a";
+}
+.glyphicon-plus:before {
+ content: "\002b";
+}
+.glyphicon-euro:before,
+.glyphicon-eur:before {
+ content: "\20ac";
+}
+.glyphicon-minus:before {
+ content: "\2212";
+}
+.glyphicon-cloud:before {
+ content: "\2601";
+}
+.glyphicon-envelope:before {
+ content: "\2709";
+}
+.glyphicon-pencil:before {
+ content: "\270f";
+}
+.glyphicon-glass:before {
+ content: "\e001";
+}
+.glyphicon-music:before {
+ content: "\e002";
+}
+.glyphicon-search:before {
+ content: "\e003";
+}
+.glyphicon-heart:before {
+ content: "\e005";
+}
+.glyphicon-star:before {
+ content: "\e006";
+}
+.glyphicon-star-empty:before {
+ content: "\e007";
+}
+.glyphicon-user:before {
+ content: "\e008";
+}
+.glyphicon-film:before {
+ content: "\e009";
+}
+.glyphicon-th-large:before {
+ content: "\e010";
+}
+.glyphicon-th:before {
+ content: "\e011";
+}
+.glyphicon-th-list:before {
+ content: "\e012";
+}
+.glyphicon-ok:before {
+ content: "\e013";
+}
+.glyphicon-remove:before {
+ content: "\e014";
+}
+.glyphicon-zoom-in:before {
+ content: "\e015";
+}
+.glyphicon-zoom-out:before {
+ content: "\e016";
+}
+.glyphicon-off:before {
+ content: "\e017";
+}
+.glyphicon-signal:before {
+ content: "\e018";
+}
+.glyphicon-cog:before {
+ content: "\e019";
+}
+.glyphicon-trash:before {
+ content: "\e020";
+}
+.glyphicon-home:before {
+ content: "\e021";
+}
+.glyphicon-file:before {
+ content: "\e022";
+}
+.glyphicon-time:before {
+ content: "\e023";
+}
+.glyphicon-road:before {
+ content: "\e024";
+}
+.glyphicon-download-alt:before {
+ content: "\e025";
+}
+.glyphicon-download:before {
+ content: "\e026";
+}
+.glyphicon-upload:before {
+ content: "\e027";
+}
+.glyphicon-inbox:before {
+ content: "\e028";
+}
+.glyphicon-play-circle:before {
+ content: "\e029";
+}
+.glyphicon-repeat:before {
+ content: "\e030";
+}
+.glyphicon-refresh:before {
+ content: "\e031";
+}
+.glyphicon-list-alt:before {
+ content: "\e032";
+}
+.glyphicon-lock:before {
+ content: "\e033";
+}
+.glyphicon-flag:before {
+ content: "\e034";
+}
+.glyphicon-headphones:before {
+ content: "\e035";
+}
+.glyphicon-volume-off:before {
+ content: "\e036";
+}
+.glyphicon-volume-down:before {
+ content: "\e037";
+}
+.glyphicon-volume-up:before {
+ content: "\e038";
+}
+.glyphicon-qrcode:before {
+ content: "\e039";
+}
+.glyphicon-barcode:before {
+ content: "\e040";
+}
+.glyphicon-tag:before {
+ content: "\e041";
+}
+.glyphicon-tags:before {
+ content: "\e042";
+}
+.glyphicon-book:before {
+ content: "\e043";
+}
+.glyphicon-bookmark:before {
+ content: "\e044";
+}
+.glyphicon-print:before {
+ content: "\e045";
+}
+.glyphicon-camera:before {
+ content: "\e046";
+}
+.glyphicon-font:before {
+ content: "\e047";
+}
+.glyphicon-bold:before {
+ content: "\e048";
+}
+.glyphicon-italic:before {
+ content: "\e049";
+}
+.glyphicon-text-height:before {
+ content: "\e050";
+}
+.glyphicon-text-width:before {
+ content: "\e051";
+}
+.glyphicon-align-left:before {
+ content: "\e052";
+}
+.glyphicon-align-center:before {
+ content: "\e053";
+}
+.glyphicon-align-right:before {
+ content: "\e054";
+}
+.glyphicon-align-justify:before {
+ content: "\e055";
+}
+.glyphicon-list:before {
+ content: "\e056";
+}
+.glyphicon-indent-left:before {
+ content: "\e057";
+}
+.glyphicon-indent-right:before {
+ content: "\e058";
+}
+.glyphicon-facetime-video:before {
+ content: "\e059";
+}
+.glyphicon-picture:before {
+ content: "\e060";
+}
+.glyphicon-map-marker:before {
+ content: "\e062";
+}
+.glyphicon-adjust:before {
+ content: "\e063";
+}
+.glyphicon-tint:before {
+ content: "\e064";
+}
+.glyphicon-edit:before {
+ content: "\e065";
+}
+.glyphicon-share:before {
+ content: "\e066";
+}
+.glyphicon-check:before {
+ content: "\e067";
+}
+.glyphicon-move:before {
+ content: "\e068";
+}
+.glyphicon-step-backward:before {
+ content: "\e069";
+}
+.glyphicon-fast-backward:before {
+ content: "\e070";
+}
+.glyphicon-backward:before {
+ content: "\e071";
+}
+.glyphicon-play:before {
+ content: "\e072";
+}
+.glyphicon-pause:before {
+ content: "\e073";
+}
+.glyphicon-stop:before {
+ content: "\e074";
+}
+.glyphicon-forward:before {
+ content: "\e075";
+}
+.glyphicon-fast-forward:before {
+ content: "\e076";
+}
+.glyphicon-step-forward:before {
+ content: "\e077";
+}
+.glyphicon-eject:before {
+ content: "\e078";
+}
+.glyphicon-chevron-left:before {
+ content: "\e079";
+}
+.glyphicon-chevron-right:before {
+ content: "\e080";
+}
+.glyphicon-plus-sign:before {
+ content: "\e081";
+}
+.glyphicon-minus-sign:before {
+ content: "\e082";
+}
+.glyphicon-remove-sign:before {
+ content: "\e083";
+}
+.glyphicon-ok-sign:before {
+ content: "\e084";
+}
+.glyphicon-question-sign:before {
+ content: "\e085";
+}
+.glyphicon-info-sign:before {
+ content: "\e086";
+}
+.glyphicon-screenshot:before {
+ content: "\e087";
+}
+.glyphicon-remove-circle:before {
+ content: "\e088";
+}
+.glyphicon-ok-circle:before {
+ content: "\e089";
+}
+.glyphicon-ban-circle:before {
+ content: "\e090";
+}
+.glyphicon-arrow-left:before {
+ content: "\e091";
+}
+.glyphicon-arrow-right:before {
+ content: "\e092";
+}
+.glyphicon-arrow-up:before {
+ content: "\e093";
+}
+.glyphicon-arrow-down:before {
+ content: "\e094";
+}
+.glyphicon-share-alt:before {
+ content: "\e095";
+}
+.glyphicon-resize-full:before {
+ content: "\e096";
+}
+.glyphicon-resize-small:before {
+ content: "\e097";
+}
+.glyphicon-exclamation-sign:before {
+ content: "\e101";
+}
+.glyphicon-gift:before {
+ content: "\e102";
+}
+.glyphicon-leaf:before {
+ content: "\e103";
+}
+.glyphicon-fire:before {
+ content: "\e104";
+}
+.glyphicon-eye-open:before {
+ content: "\e105";
+}
+.glyphicon-eye-close:before {
+ content: "\e106";
+}
+.glyphicon-warning-sign:before {
+ content: "\e107";
+}
+.glyphicon-plane:before {
+ content: "\e108";
+}
+.glyphicon-calendar:before {
+ content: "\e109";
+}
+.glyphicon-random:before {
+ content: "\e110";
+}
+.glyphicon-comment:before {
+ content: "\e111";
+}
+.glyphicon-magnet:before {
+ content: "\e112";
+}
+.glyphicon-chevron-up:before {
+ content: "\e113";
+}
+.glyphicon-chevron-down:before {
+ content: "\e114";
+}
+.glyphicon-retweet:before {
+ content: "\e115";
+}
+.glyphicon-shopping-cart:before {
+ content: "\e116";
+}
+.glyphicon-folder-close:before {
+ content: "\e117";
+}
+.glyphicon-folder-open:before {
+ content: "\e118";
+}
+.glyphicon-resize-vertical:before {
+ content: "\e119";
+}
+.glyphicon-resize-horizontal:before {
+ content: "\e120";
+}
+.glyphicon-hdd:before {
+ content: "\e121";
+}
+.glyphicon-bullhorn:before {
+ content: "\e122";
+}
+.glyphicon-bell:before {
+ content: "\e123";
+}
+.glyphicon-certificate:before {
+ content: "\e124";
+}
+.glyphicon-thumbs-up:before {
+ content: "\e125";
+}
+.glyphicon-thumbs-down:before {
+ content: "\e126";
+}
+.glyphicon-hand-right:before {
+ content: "\e127";
+}
+.glyphicon-hand-left:before {
+ content: "\e128";
+}
+.glyphicon-hand-up:before {
+ content: "\e129";
+}
+.glyphicon-hand-down:before {
+ content: "\e130";
+}
+.glyphicon-circle-arrow-right:before {
+ content: "\e131";
+}
+.glyphicon-circle-arrow-left:before {
+ content: "\e132";
+}
+.glyphicon-circle-arrow-up:before {
+ content: "\e133";
+}
+.glyphicon-circle-arrow-down:before {
+ content: "\e134";
+}
+.glyphicon-globe:before {
+ content: "\e135";
+}
+.glyphicon-wrench:before {
+ content: "\e136";
+}
+.glyphicon-tasks:before {
+ content: "\e137";
+}
+.glyphicon-filter:before {
+ content: "\e138";
+}
+.glyphicon-briefcase:before {
+ content: "\e139";
+}
+.glyphicon-fullscreen:before {
+ content: "\e140";
+}
+.glyphicon-dashboard:before {
+ content: "\e141";
+}
+.glyphicon-paperclip:before {
+ content: "\e142";
+}
+.glyphicon-heart-empty:before {
+ content: "\e143";
+}
+.glyphicon-link:before {
+ content: "\e144";
+}
+.glyphicon-phone:before {
+ content: "\e145";
+}
+.glyphicon-pushpin:before {
+ content: "\e146";
+}
+.glyphicon-usd:before {
+ content: "\e148";
+}
+.glyphicon-gbp:before {
+ content: "\e149";
+}
+.glyphicon-sort:before {
+ content: "\e150";
+}
+.glyphicon-sort-by-alphabet:before {
+ content: "\e151";
+}
+.glyphicon-sort-by-alphabet-alt:before {
+ content: "\e152";
+}
+.glyphicon-sort-by-order:before {
+ content: "\e153";
+}
+.glyphicon-sort-by-order-alt:before {
+ content: "\e154";
+}
+.glyphicon-sort-by-attributes:before {
+ content: "\e155";
+}
+.glyphicon-sort-by-attributes-alt:before {
+ content: "\e156";
+}
+.glyphicon-unchecked:before {
+ content: "\e157";
+}
+.glyphicon-expand:before {
+ content: "\e158";
+}
+.glyphicon-collapse-down:before {
+ content: "\e159";
+}
+.glyphicon-collapse-up:before {
+ content: "\e160";
+}
+.glyphicon-log-in:before {
+ content: "\e161";
+}
+.glyphicon-flash:before {
+ content: "\e162";
+}
+.glyphicon-log-out:before {
+ content: "\e163";
+}
+.glyphicon-new-window:before {
+ content: "\e164";
+}
+.glyphicon-record:before {
+ content: "\e165";
+}
+.glyphicon-save:before {
+ content: "\e166";
+}
+.glyphicon-open:before {
+ content: "\e167";
+}
+.glyphicon-saved:before {
+ content: "\e168";
+}
+.glyphicon-import:before {
+ content: "\e169";
+}
+.glyphicon-export:before {
+ content: "\e170";
+}
+.glyphicon-send:before {
+ content: "\e171";
+}
+.glyphicon-floppy-disk:before {
+ content: "\e172";
+}
+.glyphicon-floppy-saved:before {
+ content: "\e173";
+}
+.glyphicon-floppy-remove:before {
+ content: "\e174";
+}
+.glyphicon-floppy-save:before {
+ content: "\e175";
+}
+.glyphicon-floppy-open:before {
+ content: "\e176";
+}
+.glyphicon-credit-card:before {
+ content: "\e177";
+}
+.glyphicon-transfer:before {
+ content: "\e178";
+}
+.glyphicon-cutlery:before {
+ content: "\e179";
+}
+.glyphicon-header:before {
+ content: "\e180";
+}
+.glyphicon-compressed:before {
+ content: "\e181";
+}
+.glyphicon-earphone:before {
+ content: "\e182";
+}
+.glyphicon-phone-alt:before {
+ content: "\e183";
+}
+.glyphicon-tower:before {
+ content: "\e184";
+}
+.glyphicon-stats:before {
+ content: "\e185";
+}
+.glyphicon-sd-video:before {
+ content: "\e186";
+}
+.glyphicon-hd-video:before {
+ content: "\e187";
+}
+.glyphicon-subtitles:before {
+ content: "\e188";
+}
+.glyphicon-sound-stereo:before {
+ content: "\e189";
+}
+.glyphicon-sound-dolby:before {
+ content: "\e190";
+}
+.glyphicon-sound-5-1:before {
+ content: "\e191";
+}
+.glyphicon-sound-6-1:before {
+ content: "\e192";
+}
+.glyphicon-sound-7-1:before {
+ content: "\e193";
+}
+.glyphicon-copyright-mark:before {
+ content: "\e194";
+}
+.glyphicon-registration-mark:before {
+ content: "\e195";
+}
+.glyphicon-cloud-download:before {
+ content: "\e197";
+}
+.glyphicon-cloud-upload:before {
+ content: "\e198";
+}
+.glyphicon-tree-conifer:before {
+ content: "\e199";
+}
+.glyphicon-tree-deciduous:before {
+ content: "\e200";
+}
+.glyphicon-cd:before {
+ content: "\e201";
+}
+.glyphicon-save-file:before {
+ content: "\e202";
+}
+.glyphicon-open-file:before {
+ content: "\e203";
+}
+.glyphicon-level-up:before {
+ content: "\e204";
+}
+.glyphicon-copy:before {
+ content: "\e205";
+}
+.glyphicon-paste:before {
+ content: "\e206";
+}
+.glyphicon-alert:before {
+ content: "\e209";
+}
+.glyphicon-equalizer:before {
+ content: "\e210";
+}
+.glyphicon-king:before {
+ content: "\e211";
+}
+.glyphicon-queen:before {
+ content: "\e212";
+}
+.glyphicon-pawn:before {
+ content: "\e213";
+}
+.glyphicon-bishop:before {
+ content: "\e214";
+}
+.glyphicon-knight:before {
+ content: "\e215";
+}
+.glyphicon-baby-formula:before {
+ content: "\e216";
+}
+.glyphicon-tent:before {
+ content: "\26fa";
+}
+.glyphicon-blackboard:before {
+ content: "\e218";
+}
+.glyphicon-bed:before {
+ content: "\e219";
+}
+.glyphicon-apple:before {
+ content: "\f8ff";
+}
+.glyphicon-erase:before {
+ content: "\e221";
+}
+.glyphicon-hourglass:before {
+ content: "\231b";
+}
+.glyphicon-lamp:before {
+ content: "\e223";
+}
+.glyphicon-duplicate:before {
+ content: "\e224";
+}
+.glyphicon-piggy-bank:before {
+ content: "\e225";
+}
+.glyphicon-scissors:before {
+ content: "\e226";
+}
+.glyphicon-bitcoin:before {
+ content: "\e227";
+}
+.glyphicon-btc:before {
+ content: "\e227";
+}
+.glyphicon-xbt:before {
+ content: "\e227";
+}
+.glyphicon-yen:before {
+ content: "\00a5";
+}
+.glyphicon-jpy:before {
+ content: "\00a5";
+}
+.glyphicon-ruble:before {
+ content: "\20bd";
+}
+.glyphicon-rub:before {
+ content: "\20bd";
+}
+.glyphicon-scale:before {
+ content: "\e230";
+}
+.glyphicon-ice-lolly:before {
+ content: "\e231";
+}
+.glyphicon-ice-lolly-tasted:before {
+ content: "\e232";
+}
+.glyphicon-education:before {
+ content: "\e233";
+}
+.glyphicon-option-horizontal:before {
+ content: "\e234";
+}
+.glyphicon-option-vertical:before {
+ content: "\e235";
+}
+.glyphicon-menu-hamburger:before {
+ content: "\e236";
+}
+.glyphicon-modal-window:before {
+ content: "\e237";
+}
+.glyphicon-oil:before {
+ content: "\e238";
+}
+.glyphicon-grain:before {
+ content: "\e239";
+}
+.glyphicon-sunglasses:before {
+ content: "\e240";
+}
+.glyphicon-text-size:before {
+ content: "\e241";
+}
+.glyphicon-text-color:before {
+ content: "\e242";
+}
+.glyphicon-text-background:before {
+ content: "\e243";
+}
+.glyphicon-object-align-top:before {
+ content: "\e244";
+}
+.glyphicon-object-align-bottom:before {
+ content: "\e245";
+}
+.glyphicon-object-align-horizontal:before {
+ content: "\e246";
+}
+.glyphicon-object-align-left:before {
+ content: "\e247";
+}
+.glyphicon-object-align-vertical:before {
+ content: "\e248";
+}
+.glyphicon-object-align-right:before {
+ content: "\e249";
+}
+.glyphicon-triangle-right:before {
+ content: "\e250";
+}
+.glyphicon-triangle-left:before {
+ content: "\e251";
+}
+.glyphicon-triangle-bottom:before {
+ content: "\e252";
+}
+.glyphicon-triangle-top:before {
+ content: "\e253";
+}
+.glyphicon-console:before {
+ content: "\e254";
+}
+.glyphicon-superscript:before {
+ content: "\e255";
+}
+.glyphicon-subscript:before {
+ content: "\e256";
+}
+.glyphicon-menu-left:before {
+ content: "\e257";
+}
+.glyphicon-menu-right:before {
+ content: "\e258";
+}
+.glyphicon-menu-down:before {
+ content: "\e259";
+}
+.glyphicon-menu-up:before {
+ content: "\e260";
+}
+* {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+*:before,
+*:after {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+html {
+ font-size: 10px;
+
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+body {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #333;
+ background-color: #fff;
+}
+input,
+button,
+select,
+textarea {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+}
+a {
+ color: #337ab7;
+ text-decoration: none;
+}
+a:hover,
+a:focus {
+ color: #23527c;
+ text-decoration: underline;
+}
+a:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+figure {
+ margin: 0;
+}
+img {
+ vertical-align: middle;
+}
+.img-responsive,
+.thumbnail > img,
+.thumbnail a > img,
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+ display: block;
+ max-width: 100%;
+ height: auto;
+}
+.img-rounded {
+ border-radius: 6px;
+}
+.img-thumbnail {
+ display: inline-block;
+ max-width: 100%;
+ height: auto;
+ padding: 4px;
+ line-height: 1.42857143;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ -webkit-transition: all .2s ease-in-out;
+ -o-transition: all .2s ease-in-out;
+ transition: all .2s ease-in-out;
+}
+.img-circle {
+ border-radius: 50%;
+}
+hr {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ border: 0;
+ border-top: 1px solid #eee;
+}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
+.sr-only-focusable:active,
+.sr-only-focusable:focus {
+ position: static;
+ width: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ clip: auto;
+}
+[role="button"] {
+ cursor: pointer;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+.h1,
+.h2,
+.h3,
+.h4,
+.h5,
+.h6 {
+ font-family: inherit;
+ font-weight: 500;
+ line-height: 1.1;
+ color: inherit;
+}
+h1 small,
+h2 small,
+h3 small,
+h4 small,
+h5 small,
+h6 small,
+.h1 small,
+.h2 small,
+.h3 small,
+.h4 small,
+.h5 small,
+.h6 small,
+h1 .small,
+h2 .small,
+h3 .small,
+h4 .small,
+h5 .small,
+h6 .small,
+.h1 .small,
+.h2 .small,
+.h3 .small,
+.h4 .small,
+.h5 .small,
+.h6 .small {
+ font-weight: normal;
+ line-height: 1;
+ color: #777;
+}
+h1,
+.h1,
+h2,
+.h2,
+h3,
+.h3 {
+ margin-top: 20px;
+ margin-bottom: 10px;
+}
+h1 small,
+.h1 small,
+h2 small,
+.h2 small,
+h3 small,
+.h3 small,
+h1 .small,
+.h1 .small,
+h2 .small,
+.h2 .small,
+h3 .small,
+.h3 .small {
+ font-size: 65%;
+}
+h4,
+.h4,
+h5,
+.h5,
+h6,
+.h6 {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+h4 small,
+.h4 small,
+h5 small,
+.h5 small,
+h6 small,
+.h6 small,
+h4 .small,
+.h4 .small,
+h5 .small,
+.h5 .small,
+h6 .small,
+.h6 .small {
+ font-size: 75%;
+}
+h1,
+.h1 {
+ font-size: 36px;
+}
+h2,
+.h2 {
+ font-size: 30px;
+}
+h3,
+.h3 {
+ font-size: 24px;
+}
+h4,
+.h4 {
+ font-size: 18px;
+}
+h5,
+.h5 {
+ font-size: 14px;
+}
+h6,
+.h6 {
+ font-size: 12px;
+}
+p {
+ margin: 0 0 10px;
+}
+.lead {
+ margin-bottom: 20px;
+ font-size: 16px;
+ font-weight: 300;
+ line-height: 1.4;
+}
+@media (min-width: 768px) {
+ .lead {
+ font-size: 21px;
+ }
+}
+small,
+.small {
+ font-size: 85%;
+}
+mark,
+.mark {
+ padding: .2em;
+ background-color: #fcf8e3;
+}
+.text-left {
+ text-align: left;
+}
+.text-right {
+ text-align: right;
+}
+.text-center {
+ text-align: center;
+}
+.text-justify {
+ text-align: justify;
+}
+.text-nowrap {
+ white-space: nowrap;
+}
+.text-lowercase {
+ text-transform: lowercase;
+}
+.text-uppercase {
+ text-transform: uppercase;
+}
+.text-capitalize {
+ text-transform: capitalize;
+}
+.text-muted {
+ color: #777;
+}
+.text-primary {
+ color: #337ab7;
+}
+a.text-primary:hover,
+a.text-primary:focus {
+ color: #286090;
+}
+.text-success {
+ color: #3c763d;
+}
+a.text-success:hover,
+a.text-success:focus {
+ color: #2b542c;
+}
+.text-info {
+ color: #31708f;
+}
+a.text-info:hover,
+a.text-info:focus {
+ color: #245269;
+}
+.text-warning {
+ color: #8a6d3b;
+}
+a.text-warning:hover,
+a.text-warning:focus {
+ color: #66512c;
+}
+.text-danger {
+ color: #a94442;
+}
+a.text-danger:hover,
+a.text-danger:focus {
+ color: #843534;
+}
+.bg-primary {
+ color: #fff;
+ background-color: #337ab7;
+}
+a.bg-primary:hover,
+a.bg-primary:focus {
+ background-color: #286090;
+}
+.bg-success {
+ background-color: #dff0d8;
+}
+a.bg-success:hover,
+a.bg-success:focus {
+ background-color: #c1e2b3;
+}
+.bg-info {
+ background-color: #d9edf7;
+}
+a.bg-info:hover,
+a.bg-info:focus {
+ background-color: #afd9ee;
+}
+.bg-warning {
+ background-color: #fcf8e3;
+}
+a.bg-warning:hover,
+a.bg-warning:focus {
+ background-color: #f7ecb5;
+}
+.bg-danger {
+ background-color: #f2dede;
+}
+a.bg-danger:hover,
+a.bg-danger:focus {
+ background-color: #e4b9b9;
+}
+.page-header {
+ padding-bottom: 9px;
+ margin: 40px 0 20px;
+ border-bottom: 1px solid #eee;
+}
+ul,
+ol {
+ margin-top: 0;
+ margin-bottom: 10px;
+}
+ul ul,
+ol ul,
+ul ol,
+ol ol {
+ margin-bottom: 0;
+}
+.list-unstyled {
+ padding-left: 0;
+ list-style: none;
+}
+.list-inline {
+ padding-left: 0;
+ margin-left: -5px;
+ list-style: none;
+}
+.list-inline > li {
+ display: inline-block;
+ padding-right: 5px;
+ padding-left: 5px;
+}
+dl {
+ margin-top: 0;
+ margin-bottom: 20px;
+}
+dt,
+dd {
+ line-height: 1.42857143;
+}
+dt {
+ font-weight: bold;
+}
+dd {
+ margin-left: 0;
+}
+@media (min-width: 768px) {
+ .dl-horizontal dt {
+ float: left;
+ width: 160px;
+ overflow: hidden;
+ clear: left;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .dl-horizontal dd {
+ margin-left: 180px;
+ }
+}
+abbr[title],
+abbr[data-original-title] {
+ cursor: help;
+ border-bottom: 1px dotted #777;
+}
+.initialism {
+ font-size: 90%;
+ text-transform: uppercase;
+}
+blockquote {
+ padding: 10px 20px;
+ margin: 0 0 20px;
+ font-size: 17.5px;
+ border-left: 5px solid #eee;
+}
+blockquote p:last-child,
+blockquote ul:last-child,
+blockquote ol:last-child {
+ margin-bottom: 0;
+}
+blockquote footer,
+blockquote small,
+blockquote .small {
+ display: block;
+ font-size: 80%;
+ line-height: 1.42857143;
+ color: #777;
+}
+blockquote footer:before,
+blockquote small:before,
+blockquote .small:before {
+ content: '\2014 \00A0';
+}
+.blockquote-reverse,
+blockquote.pull-right {
+ padding-right: 15px;
+ padding-left: 0;
+ text-align: right;
+ border-right: 5px solid #eee;
+ border-left: 0;
+}
+.blockquote-reverse footer:before,
+blockquote.pull-right footer:before,
+.blockquote-reverse small:before,
+blockquote.pull-right small:before,
+.blockquote-reverse .small:before,
+blockquote.pull-right .small:before {
+ content: '';
+}
+.blockquote-reverse footer:after,
+blockquote.pull-right footer:after,
+.blockquote-reverse small:after,
+blockquote.pull-right small:after,
+.blockquote-reverse .small:after,
+blockquote.pull-right .small:after {
+ content: '\00A0 \2014';
+}
+address {
+ margin-bottom: 20px;
+ font-style: normal;
+ line-height: 1.42857143;
+}
+code,
+kbd,
+pre,
+samp {
+ font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+code {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #c7254e;
+ background-color: #f9f2f4;
+ border-radius: 4px;
+}
+kbd {
+ padding: 2px 4px;
+ font-size: 90%;
+ color: #fff;
+ background-color: #333;
+ border-radius: 3px;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
+}
+kbd kbd {
+ padding: 0;
+ font-size: 100%;
+ font-weight: bold;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+pre {
+ display: block;
+ padding: 9.5px;
+ margin: 0 0 10px;
+ font-size: 13px;
+ line-height: 1.42857143;
+ color: #333;
+ word-break: break-all;
+ word-wrap: break-word;
+ background-color: #f5f5f5;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+}
+pre code {
+ padding: 0;
+ font-size: inherit;
+ color: inherit;
+ white-space: pre-wrap;
+ background-color: transparent;
+ border-radius: 0;
+}
+.pre-scrollable {
+ max-height: 340px;
+ overflow-y: scroll;
+}
+.container {
+ padding-right: 15px;
+ padding-left: 15px;
+ margin-right: auto;
+ margin-left: auto;
+}
+@media (min-width: 768px) {
+ .container {
+ width: 750px;
+ }
+}
+@media (min-width: 992px) {
+ .container {
+ width: 970px;
+ }
+}
+@media (min-width: 1200px) {
+ .container {
+ width: 1170px;
+ }
+}
+.container-fluid {
+ padding-right: 15px;
+ padding-left: 15px;
+ margin-right: auto;
+ margin-left: auto;
+}
+.row {
+ margin-right: -15px;
+ margin-left: -15px;
+}
+.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
+ position: relative;
+ min-height: 1px;
+ padding-right: 15px;
+ padding-left: 15px;
+}
+.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
+ float: left;
+}
+.col-xs-12 {
+ width: 100%;
+}
+.col-xs-11 {
+ width: 91.66666667%;
+}
+.col-xs-10 {
+ width: 83.33333333%;
+}
+.col-xs-9 {
+ width: 75%;
+}
+.col-xs-8 {
+ width: 66.66666667%;
+}
+.col-xs-7 {
+ width: 58.33333333%;
+}
+.col-xs-6 {
+ width: 50%;
+}
+.col-xs-5 {
+ width: 41.66666667%;
+}
+.col-xs-4 {
+ width: 33.33333333%;
+}
+.col-xs-3 {
+ width: 25%;
+}
+.col-xs-2 {
+ width: 16.66666667%;
+}
+.col-xs-1 {
+ width: 8.33333333%;
+}
+.col-xs-pull-12 {
+ right: 100%;
+}
+.col-xs-pull-11 {
+ right: 91.66666667%;
+}
+.col-xs-pull-10 {
+ right: 83.33333333%;
+}
+.col-xs-pull-9 {
+ right: 75%;
+}
+.col-xs-pull-8 {
+ right: 66.66666667%;
+}
+.col-xs-pull-7 {
+ right: 58.33333333%;
+}
+.col-xs-pull-6 {
+ right: 50%;
+}
+.col-xs-pull-5 {
+ right: 41.66666667%;
+}
+.col-xs-pull-4 {
+ right: 33.33333333%;
+}
+.col-xs-pull-3 {
+ right: 25%;
+}
+.col-xs-pull-2 {
+ right: 16.66666667%;
+}
+.col-xs-pull-1 {
+ right: 8.33333333%;
+}
+.col-xs-pull-0 {
+ right: auto;
+}
+.col-xs-push-12 {
+ left: 100%;
+}
+.col-xs-push-11 {
+ left: 91.66666667%;
+}
+.col-xs-push-10 {
+ left: 83.33333333%;
+}
+.col-xs-push-9 {
+ left: 75%;
+}
+.col-xs-push-8 {
+ left: 66.66666667%;
+}
+.col-xs-push-7 {
+ left: 58.33333333%;
+}
+.col-xs-push-6 {
+ left: 50%;
+}
+.col-xs-push-5 {
+ left: 41.66666667%;
+}
+.col-xs-push-4 {
+ left: 33.33333333%;
+}
+.col-xs-push-3 {
+ left: 25%;
+}
+.col-xs-push-2 {
+ left: 16.66666667%;
+}
+.col-xs-push-1 {
+ left: 8.33333333%;
+}
+.col-xs-push-0 {
+ left: auto;
+}
+.col-xs-offset-12 {
+ margin-left: 100%;
+}
+.col-xs-offset-11 {
+ margin-left: 91.66666667%;
+}
+.col-xs-offset-10 {
+ margin-left: 83.33333333%;
+}
+.col-xs-offset-9 {
+ margin-left: 75%;
+}
+.col-xs-offset-8 {
+ margin-left: 66.66666667%;
+}
+.col-xs-offset-7 {
+ margin-left: 58.33333333%;
+}
+.col-xs-offset-6 {
+ margin-left: 50%;
+}
+.col-xs-offset-5 {
+ margin-left: 41.66666667%;
+}
+.col-xs-offset-4 {
+ margin-left: 33.33333333%;
+}
+.col-xs-offset-3 {
+ margin-left: 25%;
+}
+.col-xs-offset-2 {
+ margin-left: 16.66666667%;
+}
+.col-xs-offset-1 {
+ margin-left: 8.33333333%;
+}
+.col-xs-offset-0 {
+ margin-left: 0;
+}
+@media (min-width: 768px) {
+ .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
+ float: left;
+ }
+ .col-sm-12 {
+ width: 100%;
+ }
+ .col-sm-11 {
+ width: 91.66666667%;
+ }
+ .col-sm-10 {
+ width: 83.33333333%;
+ }
+ .col-sm-9 {
+ width: 75%;
+ }
+ .col-sm-8 {
+ width: 66.66666667%;
+ }
+ .col-sm-7 {
+ width: 58.33333333%;
+ }
+ .col-sm-6 {
+ width: 50%;
+ }
+ .col-sm-5 {
+ width: 41.66666667%;
+ }
+ .col-sm-4 {
+ width: 33.33333333%;
+ }
+ .col-sm-3 {
+ width: 25%;
+ }
+ .col-sm-2 {
+ width: 16.66666667%;
+ }
+ .col-sm-1 {
+ width: 8.33333333%;
+ }
+ .col-sm-pull-12 {
+ right: 100%;
+ }
+ .col-sm-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-sm-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-sm-pull-9 {
+ right: 75%;
+ }
+ .col-sm-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-sm-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-sm-pull-6 {
+ right: 50%;
+ }
+ .col-sm-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-sm-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-sm-pull-3 {
+ right: 25%;
+ }
+ .col-sm-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-sm-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-sm-pull-0 {
+ right: auto;
+ }
+ .col-sm-push-12 {
+ left: 100%;
+ }
+ .col-sm-push-11 {
+ left: 91.66666667%;
+ }
+ .col-sm-push-10 {
+ left: 83.33333333%;
+ }
+ .col-sm-push-9 {
+ left: 75%;
+ }
+ .col-sm-push-8 {
+ left: 66.66666667%;
+ }
+ .col-sm-push-7 {
+ left: 58.33333333%;
+ }
+ .col-sm-push-6 {
+ left: 50%;
+ }
+ .col-sm-push-5 {
+ left: 41.66666667%;
+ }
+ .col-sm-push-4 {
+ left: 33.33333333%;
+ }
+ .col-sm-push-3 {
+ left: 25%;
+ }
+ .col-sm-push-2 {
+ left: 16.66666667%;
+ }
+ .col-sm-push-1 {
+ left: 8.33333333%;
+ }
+ .col-sm-push-0 {
+ left: auto;
+ }
+ .col-sm-offset-12 {
+ margin-left: 100%;
+ }
+ .col-sm-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-sm-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-sm-offset-9 {
+ margin-left: 75%;
+ }
+ .col-sm-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-sm-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-sm-offset-6 {
+ margin-left: 50%;
+ }
+ .col-sm-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-sm-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-sm-offset-3 {
+ margin-left: 25%;
+ }
+ .col-sm-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-sm-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-sm-offset-0 {
+ margin-left: 0;
+ }
+}
+@media (min-width: 992px) {
+ .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
+ float: left;
+ }
+ .col-md-12 {
+ width: 100%;
+ }
+ .col-md-11 {
+ width: 91.66666667%;
+ }
+ .col-md-10 {
+ width: 83.33333333%;
+ }
+ .col-md-9 {
+ width: 75%;
+ }
+ .col-md-8 {
+ width: 66.66666667%;
+ }
+ .col-md-7 {
+ width: 58.33333333%;
+ }
+ .col-md-6 {
+ width: 50%;
+ }
+ .col-md-5 {
+ width: 41.66666667%;
+ }
+ .col-md-4 {
+ width: 33.33333333%;
+ }
+ .col-md-3 {
+ width: 25%;
+ }
+ .col-md-2 {
+ width: 16.66666667%;
+ }
+ .col-md-1 {
+ width: 8.33333333%;
+ }
+ .col-md-pull-12 {
+ right: 100%;
+ }
+ .col-md-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-md-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-md-pull-9 {
+ right: 75%;
+ }
+ .col-md-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-md-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-md-pull-6 {
+ right: 50%;
+ }
+ .col-md-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-md-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-md-pull-3 {
+ right: 25%;
+ }
+ .col-md-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-md-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-md-pull-0 {
+ right: auto;
+ }
+ .col-md-push-12 {
+ left: 100%;
+ }
+ .col-md-push-11 {
+ left: 91.66666667%;
+ }
+ .col-md-push-10 {
+ left: 83.33333333%;
+ }
+ .col-md-push-9 {
+ left: 75%;
+ }
+ .col-md-push-8 {
+ left: 66.66666667%;
+ }
+ .col-md-push-7 {
+ left: 58.33333333%;
+ }
+ .col-md-push-6 {
+ left: 50%;
+ }
+ .col-md-push-5 {
+ left: 41.66666667%;
+ }
+ .col-md-push-4 {
+ left: 33.33333333%;
+ }
+ .col-md-push-3 {
+ left: 25%;
+ }
+ .col-md-push-2 {
+ left: 16.66666667%;
+ }
+ .col-md-push-1 {
+ left: 8.33333333%;
+ }
+ .col-md-push-0 {
+ left: auto;
+ }
+ .col-md-offset-12 {
+ margin-left: 100%;
+ }
+ .col-md-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-md-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-md-offset-9 {
+ margin-left: 75%;
+ }
+ .col-md-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-md-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-md-offset-6 {
+ margin-left: 50%;
+ }
+ .col-md-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-md-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-md-offset-3 {
+ margin-left: 25%;
+ }
+ .col-md-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-md-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-md-offset-0 {
+ margin-left: 0;
+ }
+}
+@media (min-width: 1200px) {
+ .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
+ float: left;
+ }
+ .col-lg-12 {
+ width: 100%;
+ }
+ .col-lg-11 {
+ width: 91.66666667%;
+ }
+ .col-lg-10 {
+ width: 83.33333333%;
+ }
+ .col-lg-9 {
+ width: 75%;
+ }
+ .col-lg-8 {
+ width: 66.66666667%;
+ }
+ .col-lg-7 {
+ width: 58.33333333%;
+ }
+ .col-lg-6 {
+ width: 50%;
+ }
+ .col-lg-5 {
+ width: 41.66666667%;
+ }
+ .col-lg-4 {
+ width: 33.33333333%;
+ }
+ .col-lg-3 {
+ width: 25%;
+ }
+ .col-lg-2 {
+ width: 16.66666667%;
+ }
+ .col-lg-1 {
+ width: 8.33333333%;
+ }
+ .col-lg-pull-12 {
+ right: 100%;
+ }
+ .col-lg-pull-11 {
+ right: 91.66666667%;
+ }
+ .col-lg-pull-10 {
+ right: 83.33333333%;
+ }
+ .col-lg-pull-9 {
+ right: 75%;
+ }
+ .col-lg-pull-8 {
+ right: 66.66666667%;
+ }
+ .col-lg-pull-7 {
+ right: 58.33333333%;
+ }
+ .col-lg-pull-6 {
+ right: 50%;
+ }
+ .col-lg-pull-5 {
+ right: 41.66666667%;
+ }
+ .col-lg-pull-4 {
+ right: 33.33333333%;
+ }
+ .col-lg-pull-3 {
+ right: 25%;
+ }
+ .col-lg-pull-2 {
+ right: 16.66666667%;
+ }
+ .col-lg-pull-1 {
+ right: 8.33333333%;
+ }
+ .col-lg-pull-0 {
+ right: auto;
+ }
+ .col-lg-push-12 {
+ left: 100%;
+ }
+ .col-lg-push-11 {
+ left: 91.66666667%;
+ }
+ .col-lg-push-10 {
+ left: 83.33333333%;
+ }
+ .col-lg-push-9 {
+ left: 75%;
+ }
+ .col-lg-push-8 {
+ left: 66.66666667%;
+ }
+ .col-lg-push-7 {
+ left: 58.33333333%;
+ }
+ .col-lg-push-6 {
+ left: 50%;
+ }
+ .col-lg-push-5 {
+ left: 41.66666667%;
+ }
+ .col-lg-push-4 {
+ left: 33.33333333%;
+ }
+ .col-lg-push-3 {
+ left: 25%;
+ }
+ .col-lg-push-2 {
+ left: 16.66666667%;
+ }
+ .col-lg-push-1 {
+ left: 8.33333333%;
+ }
+ .col-lg-push-0 {
+ left: auto;
+ }
+ .col-lg-offset-12 {
+ margin-left: 100%;
+ }
+ .col-lg-offset-11 {
+ margin-left: 91.66666667%;
+ }
+ .col-lg-offset-10 {
+ margin-left: 83.33333333%;
+ }
+ .col-lg-offset-9 {
+ margin-left: 75%;
+ }
+ .col-lg-offset-8 {
+ margin-left: 66.66666667%;
+ }
+ .col-lg-offset-7 {
+ margin-left: 58.33333333%;
+ }
+ .col-lg-offset-6 {
+ margin-left: 50%;
+ }
+ .col-lg-offset-5 {
+ margin-left: 41.66666667%;
+ }
+ .col-lg-offset-4 {
+ margin-left: 33.33333333%;
+ }
+ .col-lg-offset-3 {
+ margin-left: 25%;
+ }
+ .col-lg-offset-2 {
+ margin-left: 16.66666667%;
+ }
+ .col-lg-offset-1 {
+ margin-left: 8.33333333%;
+ }
+ .col-lg-offset-0 {
+ margin-left: 0;
+ }
+}
+table {
+ background-color: transparent;
+}
+caption {
+ padding-top: 8px;
+ padding-bottom: 8px;
+ color: #777;
+ text-align: left;
+}
+th {
+ text-align: left;
+}
+.table {
+ width: 100%;
+ max-width: 100%;
+ margin-bottom: 20px;
+}
+.table > thead > tr > th,
+.table > tbody > tr > th,
+.table > tfoot > tr > th,
+.table > thead > tr > td,
+.table > tbody > tr > td,
+.table > tfoot > tr > td {
+ padding: 8px;
+ line-height: 1.42857143;
+ vertical-align: top;
+ border-top: 1px solid #ddd;
+}
+.table > thead > tr > th {
+ vertical-align: bottom;
+ border-bottom: 2px solid #ddd;
+}
+.table > caption + thead > tr:first-child > th,
+.table > colgroup + thead > tr:first-child > th,
+.table > thead:first-child > tr:first-child > th,
+.table > caption + thead > tr:first-child > td,
+.table > colgroup + thead > tr:first-child > td,
+.table > thead:first-child > tr:first-child > td {
+ border-top: 0;
+}
+.table > tbody + tbody {
+ border-top: 2px solid #ddd;
+}
+.table .table {
+ background-color: #fff;
+}
+.table-condensed > thead > tr > th,
+.table-condensed > tbody > tr > th,
+.table-condensed > tfoot > tr > th,
+.table-condensed > thead > tr > td,
+.table-condensed > tbody > tr > td,
+.table-condensed > tfoot > tr > td {
+ padding: 5px;
+}
+.table-bordered {
+ border: 1px solid #ddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > tbody > tr > th,
+.table-bordered > tfoot > tr > th,
+.table-bordered > thead > tr > td,
+.table-bordered > tbody > tr > td,
+.table-bordered > tfoot > tr > td {
+ border: 1px solid #ddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > thead > tr > td {
+ border-bottom-width: 2px;
+}
+.table-striped > tbody > tr:nth-of-type(odd) {
+ background-color: #f9f9f9;
+}
+.table-hover > tbody > tr:hover {
+ background-color: #f5f5f5;
+}
+table col[class*="col-"] {
+ position: static;
+ display: table-column;
+ float: none;
+}
+table td[class*="col-"],
+table th[class*="col-"] {
+ position: static;
+ display: table-cell;
+ float: none;
+}
+.table > thead > tr > td.active,
+.table > tbody > tr > td.active,
+.table > tfoot > tr > td.active,
+.table > thead > tr > th.active,
+.table > tbody > tr > th.active,
+.table > tfoot > tr > th.active,
+.table > thead > tr.active > td,
+.table > tbody > tr.active > td,
+.table > tfoot > tr.active > td,
+.table > thead > tr.active > th,
+.table > tbody > tr.active > th,
+.table > tfoot > tr.active > th {
+ background-color: #f5f5f5;
+}
+.table-hover > tbody > tr > td.active:hover,
+.table-hover > tbody > tr > th.active:hover,
+.table-hover > tbody > tr.active:hover > td,
+.table-hover > tbody > tr:hover > .active,
+.table-hover > tbody > tr.active:hover > th {
+ background-color: #e8e8e8;
+}
+.table > thead > tr > td.success,
+.table > tbody > tr > td.success,
+.table > tfoot > tr > td.success,
+.table > thead > tr > th.success,
+.table > tbody > tr > th.success,
+.table > tfoot > tr > th.success,
+.table > thead > tr.success > td,
+.table > tbody > tr.success > td,
+.table > tfoot > tr.success > td,
+.table > thead > tr.success > th,
+.table > tbody > tr.success > th,
+.table > tfoot > tr.success > th {
+ background-color: #dff0d8;
+}
+.table-hover > tbody > tr > td.success:hover,
+.table-hover > tbody > tr > th.success:hover,
+.table-hover > tbody > tr.success:hover > td,
+.table-hover > tbody > tr:hover > .success,
+.table-hover > tbody > tr.success:hover > th {
+ background-color: #d0e9c6;
+}
+.table > thead > tr > td.info,
+.table > tbody > tr > td.info,
+.table > tfoot > tr > td.info,
+.table > thead > tr > th.info,
+.table > tbody > tr > th.info,
+.table > tfoot > tr > th.info,
+.table > thead > tr.info > td,
+.table > tbody > tr.info > td,
+.table > tfoot > tr.info > td,
+.table > thead > tr.info > th,
+.table > tbody > tr.info > th,
+.table > tfoot > tr.info > th {
+ background-color: #d9edf7;
+}
+.table-hover > tbody > tr > td.info:hover,
+.table-hover > tbody > tr > th.info:hover,
+.table-hover > tbody > tr.info:hover > td,
+.table-hover > tbody > tr:hover > .info,
+.table-hover > tbody > tr.info:hover > th {
+ background-color: #c4e3f3;
+}
+.table > thead > tr > td.warning,
+.table > tbody > tr > td.warning,
+.table > tfoot > tr > td.warning,
+.table > thead > tr > th.warning,
+.table > tbody > tr > th.warning,
+.table > tfoot > tr > th.warning,
+.table > thead > tr.warning > td,
+.table > tbody > tr.warning > td,
+.table > tfoot > tr.warning > td,
+.table > thead > tr.warning > th,
+.table > tbody > tr.warning > th,
+.table > tfoot > tr.warning > th {
+ background-color: #fcf8e3;
+}
+.table-hover > tbody > tr > td.warning:hover,
+.table-hover > tbody > tr > th.warning:hover,
+.table-hover > tbody > tr.warning:hover > td,
+.table-hover > tbody > tr:hover > .warning,
+.table-hover > tbody > tr.warning:hover > th {
+ background-color: #faf2cc;
+}
+.table > thead > tr > td.danger,
+.table > tbody > tr > td.danger,
+.table > tfoot > tr > td.danger,
+.table > thead > tr > th.danger,
+.table > tbody > tr > th.danger,
+.table > tfoot > tr > th.danger,
+.table > thead > tr.danger > td,
+.table > tbody > tr.danger > td,
+.table > tfoot > tr.danger > td,
+.table > thead > tr.danger > th,
+.table > tbody > tr.danger > th,
+.table > tfoot > tr.danger > th {
+ background-color: #f2dede;
+}
+.table-hover > tbody > tr > td.danger:hover,
+.table-hover > tbody > tr > th.danger:hover,
+.table-hover > tbody > tr.danger:hover > td,
+.table-hover > tbody > tr:hover > .danger,
+.table-hover > tbody > tr.danger:hover > th {
+ background-color: #ebcccc;
+}
+.table-responsive {
+ min-height: .01%;
+ overflow-x: auto;
+}
+@media screen and (max-width: 767px) {
+ .table-responsive {
+ width: 100%;
+ margin-bottom: 15px;
+ overflow-y: hidden;
+ -ms-overflow-style: -ms-autohiding-scrollbar;
+ border: 1px solid #ddd;
+ }
+ .table-responsive > .table {
+ margin-bottom: 0;
+ }
+ .table-responsive > .table > thead > tr > th,
+ .table-responsive > .table > tbody > tr > th,
+ .table-responsive > .table > tfoot > tr > th,
+ .table-responsive > .table > thead > tr > td,
+ .table-responsive > .table > tbody > tr > td,
+ .table-responsive > .table > tfoot > tr > td {
+ white-space: nowrap;
+ }
+ .table-responsive > .table-bordered {
+ border: 0;
+ }
+ .table-responsive > .table-bordered > thead > tr > th:first-child,
+ .table-responsive > .table-bordered > tbody > tr > th:first-child,
+ .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+ .table-responsive > .table-bordered > thead > tr > td:first-child,
+ .table-responsive > .table-bordered > tbody > tr > td:first-child,
+ .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+ border-left: 0;
+ }
+ .table-responsive > .table-bordered > thead > tr > th:last-child,
+ .table-responsive > .table-bordered > tbody > tr > th:last-child,
+ .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+ .table-responsive > .table-bordered > thead > tr > td:last-child,
+ .table-responsive > .table-bordered > tbody > tr > td:last-child,
+ .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+ border-right: 0;
+ }
+ .table-responsive > .table-bordered > tbody > tr:last-child > th,
+ .table-responsive > .table-bordered > tfoot > tr:last-child > th,
+ .table-responsive > .table-bordered > tbody > tr:last-child > td,
+ .table-responsive > .table-bordered > tfoot > tr:last-child > td {
+ border-bottom: 0;
+ }
+}
+fieldset {
+ min-width: 0;
+ padding: 0;
+ margin: 0;
+ border: 0;
+}
+legend {
+ display: block;
+ width: 100%;
+ padding: 0;
+ margin-bottom: 20px;
+ font-size: 21px;
+ line-height: inherit;
+ color: #333;
+ border: 0;
+ border-bottom: 1px solid #e5e5e5;
+}
+label {
+ display: inline-block;
+ max-width: 100%;
+ margin-bottom: 5px;
+ font-weight: bold;
+}
+input[type="search"] {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+input[type="radio"],
+input[type="checkbox"] {
+ margin: 4px 0 0;
+ margin-top: 1px \9;
+ line-height: normal;
+}
+input[type="file"] {
+ display: block;
+}
+input[type="range"] {
+ display: block;
+ width: 100%;
+}
+select[multiple],
+select[size] {
+ height: auto;
+}
+input[type="file"]:focus,
+input[type="radio"]:focus,
+input[type="checkbox"]:focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+output {
+ display: block;
+ padding-top: 7px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555;
+}
+.form-control {
+ display: block;
+ width: 100%;
+ height: 34px;
+ padding: 6px 12px;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #555;
+ background-color: #fff;
+ background-image: none;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
+ -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+}
+.form-control:focus {
+ border-color: #66afe9;
+ outline: 0;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
+}
+.form-control::-moz-placeholder {
+ color: #999;
+ opacity: 1;
+}
+.form-control:-ms-input-placeholder {
+ color: #999;
+}
+.form-control::-webkit-input-placeholder {
+ color: #999;
+}
+.form-control::-ms-expand {
+ background-color: transparent;
+ border: 0;
+}
+.form-control[disabled],
+.form-control[readonly],
+fieldset[disabled] .form-control {
+ background-color: #eee;
+ opacity: 1;
+}
+.form-control[disabled],
+fieldset[disabled] .form-control {
+ cursor: not-allowed;
+}
+textarea.form-control {
+ height: auto;
+}
+input[type="search"] {
+ -webkit-appearance: none;
+}
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ input[type="date"].form-control,
+ input[type="time"].form-control,
+ input[type="datetime-local"].form-control,
+ input[type="month"].form-control {
+ line-height: 34px;
+ }
+ input[type="date"].input-sm,
+ input[type="time"].input-sm,
+ input[type="datetime-local"].input-sm,
+ input[type="month"].input-sm,
+ .input-group-sm input[type="date"],
+ .input-group-sm input[type="time"],
+ .input-group-sm input[type="datetime-local"],
+ .input-group-sm input[type="month"] {
+ line-height: 30px;
+ }
+ input[type="date"].input-lg,
+ input[type="time"].input-lg,
+ input[type="datetime-local"].input-lg,
+ input[type="month"].input-lg,
+ .input-group-lg input[type="date"],
+ .input-group-lg input[type="time"],
+ .input-group-lg input[type="datetime-local"],
+ .input-group-lg input[type="month"] {
+ line-height: 46px;
+ }
+}
+.form-group {
+ margin-bottom: 15px;
+}
+.radio,
+.checkbox {
+ position: relative;
+ display: block;
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.radio label,
+.checkbox label {
+ min-height: 20px;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: normal;
+ cursor: pointer;
+}
+.radio input[type="radio"],
+.radio-inline input[type="radio"],
+.checkbox input[type="checkbox"],
+.checkbox-inline input[type="checkbox"] {
+ position: absolute;
+ margin-top: 4px \9;
+ margin-left: -20px;
+}
+.radio + .radio,
+.checkbox + .checkbox {
+ margin-top: -5px;
+}
+.radio-inline,
+.checkbox-inline {
+ position: relative;
+ display: inline-block;
+ padding-left: 20px;
+ margin-bottom: 0;
+ font-weight: normal;
+ vertical-align: middle;
+ cursor: pointer;
+}
+.radio-inline + .radio-inline,
+.checkbox-inline + .checkbox-inline {
+ margin-top: 0;
+ margin-left: 10px;
+}
+input[type="radio"][disabled],
+input[type="checkbox"][disabled],
+input[type="radio"].disabled,
+input[type="checkbox"].disabled,
+fieldset[disabled] input[type="radio"],
+fieldset[disabled] input[type="checkbox"] {
+ cursor: not-allowed;
+}
+.radio-inline.disabled,
+.checkbox-inline.disabled,
+fieldset[disabled] .radio-inline,
+fieldset[disabled] .checkbox-inline {
+ cursor: not-allowed;
+}
+.radio.disabled label,
+.checkbox.disabled label,
+fieldset[disabled] .radio label,
+fieldset[disabled] .checkbox label {
+ cursor: not-allowed;
+}
+.form-control-static {
+ min-height: 34px;
+ padding-top: 7px;
+ padding-bottom: 7px;
+ margin-bottom: 0;
+}
+.form-control-static.input-lg,
+.form-control-static.input-sm {
+ padding-right: 0;
+ padding-left: 0;
+}
+.input-sm {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+select.input-sm {
+ height: 30px;
+ line-height: 30px;
+}
+textarea.input-sm,
+select[multiple].input-sm {
+ height: auto;
+}
+.form-group-sm .form-control {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.form-group-sm select.form-control {
+ height: 30px;
+ line-height: 30px;
+}
+.form-group-sm textarea.form-control,
+.form-group-sm select[multiple].form-control {
+ height: auto;
+}
+.form-group-sm .form-control-static {
+ height: 30px;
+ min-height: 32px;
+ padding: 6px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+}
+.input-lg {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+select.input-lg {
+ height: 46px;
+ line-height: 46px;
+}
+textarea.input-lg,
+select[multiple].input-lg {
+ height: auto;
+}
+.form-group-lg .form-control {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+.form-group-lg select.form-control {
+ height: 46px;
+ line-height: 46px;
+}
+.form-group-lg textarea.form-control,
+.form-group-lg select[multiple].form-control {
+ height: auto;
+}
+.form-group-lg .form-control-static {
+ height: 46px;
+ min-height: 38px;
+ padding: 11px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+}
+.has-feedback {
+ position: relative;
+}
+.has-feedback .form-control {
+ padding-right: 42.5px;
+}
+.form-control-feedback {
+ position: absolute;
+ top: 0;
+ right: 0;
+ z-index: 2;
+ display: block;
+ width: 34px;
+ height: 34px;
+ line-height: 34px;
+ text-align: center;
+ pointer-events: none;
+}
+.input-lg + .form-control-feedback,
+.input-group-lg + .form-control-feedback,
+.form-group-lg .form-control + .form-control-feedback {
+ width: 46px;
+ height: 46px;
+ line-height: 46px;
+}
+.input-sm + .form-control-feedback,
+.input-group-sm + .form-control-feedback,
+.form-group-sm .form-control + .form-control-feedback {
+ width: 30px;
+ height: 30px;
+ line-height: 30px;
+}
+.has-success .help-block,
+.has-success .control-label,
+.has-success .radio,
+.has-success .checkbox,
+.has-success .radio-inline,
+.has-success .checkbox-inline,
+.has-success.radio label,
+.has-success.checkbox label,
+.has-success.radio-inline label,
+.has-success.checkbox-inline label {
+ color: #3c763d;
+}
+.has-success .form-control {
+ border-color: #3c763d;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-success .form-control:focus {
+ border-color: #2b542c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
+}
+.has-success .input-group-addon {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #3c763d;
+}
+.has-success .form-control-feedback {
+ color: #3c763d;
+}
+.has-warning .help-block,
+.has-warning .control-label,
+.has-warning .radio,
+.has-warning .checkbox,
+.has-warning .radio-inline,
+.has-warning .checkbox-inline,
+.has-warning.radio label,
+.has-warning.checkbox label,
+.has-warning.radio-inline label,
+.has-warning.checkbox-inline label {
+ color: #8a6d3b;
+}
+.has-warning .form-control {
+ border-color: #8a6d3b;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-warning .form-control:focus {
+ border-color: #66512c;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
+}
+.has-warning .input-group-addon {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #8a6d3b;
+}
+.has-warning .form-control-feedback {
+ color: #8a6d3b;
+}
+.has-error .help-block,
+.has-error .control-label,
+.has-error .radio,
+.has-error .checkbox,
+.has-error .radio-inline,
+.has-error .checkbox-inline,
+.has-error.radio label,
+.has-error.checkbox label,
+.has-error.radio-inline label,
+.has-error.checkbox-inline label {
+ color: #a94442;
+}
+.has-error .form-control {
+ border-color: #a94442;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-error .form-control:focus {
+ border-color: #843534;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
+}
+.has-error .input-group-addon {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #a94442;
+}
+.has-error .form-control-feedback {
+ color: #a94442;
+}
+.has-feedback label ~ .form-control-feedback {
+ top: 25px;
+}
+.has-feedback label.sr-only ~ .form-control-feedback {
+ top: 0;
+}
+.help-block {
+ display: block;
+ margin-top: 5px;
+ margin-bottom: 10px;
+ color: #737373;
+}
+@media (min-width: 768px) {
+ .form-inline .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle;
+ }
+ .form-inline .form-control-static {
+ display: inline-block;
+ }
+ .form-inline .input-group {
+ display: inline-table;
+ vertical-align: middle;
+ }
+ .form-inline .input-group .input-group-addon,
+ .form-inline .input-group .input-group-btn,
+ .form-inline .input-group .form-control {
+ width: auto;
+ }
+ .form-inline .input-group > .form-control {
+ width: 100%;
+ }
+ .form-inline .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .radio,
+ .form-inline .checkbox {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .form-inline .radio label,
+ .form-inline .checkbox label {
+ padding-left: 0;
+ }
+ .form-inline .radio input[type="radio"],
+ .form-inline .checkbox input[type="checkbox"] {
+ position: relative;
+ margin-left: 0;
+ }
+ .form-inline .has-feedback .form-control-feedback {
+ top: 0;
+ }
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox,
+.form-horizontal .radio-inline,
+.form-horizontal .checkbox-inline {
+ padding-top: 7px;
+ margin-top: 0;
+ margin-bottom: 0;
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox {
+ min-height: 27px;
+}
+.form-horizontal .form-group {
+ margin-right: -15px;
+ margin-left: -15px;
+}
+@media (min-width: 768px) {
+ .form-horizontal .control-label {
+ padding-top: 7px;
+ margin-bottom: 0;
+ text-align: right;
+ }
+}
+.form-horizontal .has-feedback .form-control-feedback {
+ right: 15px;
+}
+@media (min-width: 768px) {
+ .form-horizontal .form-group-lg .control-label {
+ padding-top: 11px;
+ font-size: 18px;
+ }
+}
+@media (min-width: 768px) {
+ .form-horizontal .form-group-sm .control-label {
+ padding-top: 6px;
+ font-size: 12px;
+ }
+}
+.btn {
+ display: inline-block;
+ padding: 6px 12px;
+ margin-bottom: 0;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 1.42857143;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: middle;
+ -ms-touch-action: manipulation;
+ touch-action: manipulation;
+ cursor: pointer;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus,
+.btn.focus,
+.btn:active.focus,
+.btn.active.focus {
+ outline: thin dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+ outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus,
+.btn.focus {
+ color: #333;
+ text-decoration: none;
+}
+.btn:active,
+.btn.active {
+ background-image: none;
+ outline: 0;
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+ cursor: not-allowed;
+ filter: alpha(opacity=65);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ opacity: .65;
+}
+a.btn.disabled,
+fieldset[disabled] a.btn {
+ pointer-events: none;
+}
+.btn-default {
+ color: #333;
+ background-color: #fff;
+ border-color: #ccc;
+}
+.btn-default:focus,
+.btn-default.focus {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #8c8c8c;
+}
+.btn-default:hover {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ color: #333;
+ background-color: #e6e6e6;
+ border-color: #adadad;
+}
+.btn-default:active:hover,
+.btn-default.active:hover,
+.open > .dropdown-toggle.btn-default:hover,
+.btn-default:active:focus,
+.btn-default.active:focus,
+.open > .dropdown-toggle.btn-default:focus,
+.btn-default:active.focus,
+.btn-default.active.focus,
+.open > .dropdown-toggle.btn-default.focus {
+ color: #333;
+ background-color: #d4d4d4;
+ border-color: #8c8c8c;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+ background-image: none;
+}
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus {
+ background-color: #fff;
+ border-color: #ccc;
+}
+.btn-default .badge {
+ color: #fff;
+ background-color: #333;
+}
+.btn-primary {
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary:focus,
+.btn-primary.focus {
+ color: #fff;
+ background-color: #286090;
+ border-color: #122b40;
+}
+.btn-primary:hover {
+ color: #fff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ color: #fff;
+ background-color: #286090;
+ border-color: #204d74;
+}
+.btn-primary:active:hover,
+.btn-primary.active:hover,
+.open > .dropdown-toggle.btn-primary:hover,
+.btn-primary:active:focus,
+.btn-primary.active:focus,
+.open > .dropdown-toggle.btn-primary:focus,
+.btn-primary:active.focus,
+.btn-primary.active.focus,
+.open > .dropdown-toggle.btn-primary.focus {
+ color: #fff;
+ background-color: #204d74;
+ border-color: #122b40;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+ background-image: none;
+}
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus {
+ background-color: #337ab7;
+ border-color: #2e6da4;
+}
+.btn-primary .badge {
+ color: #337ab7;
+ background-color: #fff;
+}
+.btn-success {
+ color: #fff;
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success:focus,
+.btn-success.focus {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #255625;
+}
+.btn-success:hover {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ color: #fff;
+ background-color: #449d44;
+ border-color: #398439;
+}
+.btn-success:active:hover,
+.btn-success.active:hover,
+.open > .dropdown-toggle.btn-success:hover,
+.btn-success:active:focus,
+.btn-success.active:focus,
+.open > .dropdown-toggle.btn-success:focus,
+.btn-success:active.focus,
+.btn-success.active.focus,
+.open > .dropdown-toggle.btn-success.focus {
+ color: #fff;
+ background-color: #398439;
+ border-color: #255625;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+ background-image: none;
+}
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus {
+ background-color: #5cb85c;
+ border-color: #4cae4c;
+}
+.btn-success .badge {
+ color: #5cb85c;
+ background-color: #fff;
+}
+.btn-info {
+ color: #fff;
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info:focus,
+.btn-info.focus {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #1b6d85;
+}
+.btn-info:hover {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ color: #fff;
+ background-color: #31b0d5;
+ border-color: #269abc;
+}
+.btn-info:active:hover,
+.btn-info.active:hover,
+.open > .dropdown-toggle.btn-info:hover,
+.btn-info:active:focus,
+.btn-info.active:focus,
+.open > .dropdown-toggle.btn-info:focus,
+.btn-info:active.focus,
+.btn-info.active.focus,
+.open > .dropdown-toggle.btn-info.focus {
+ color: #fff;
+ background-color: #269abc;
+ border-color: #1b6d85;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+ background-image: none;
+}
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus {
+ background-color: #5bc0de;
+ border-color: #46b8da;
+}
+.btn-info .badge {
+ color: #5bc0de;
+ background-color: #fff;
+}
+.btn-warning {
+ color: #fff;
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning:focus,
+.btn-warning.focus {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #985f0d;
+}
+.btn-warning:hover {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ color: #fff;
+ background-color: #ec971f;
+ border-color: #d58512;
+}
+.btn-warning:active:hover,
+.btn-warning.active:hover,
+.open > .dropdown-toggle.btn-warning:hover,
+.btn-warning:active:focus,
+.btn-warning.active:focus,
+.open > .dropdown-toggle.btn-warning:focus,
+.btn-warning:active.focus,
+.btn-warning.active.focus,
+.open > .dropdown-toggle.btn-warning.focus {
+ color: #fff;
+ background-color: #d58512;
+ border-color: #985f0d;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+ background-image: none;
+}
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus {
+ background-color: #f0ad4e;
+ border-color: #eea236;
+}
+.btn-warning .badge {
+ color: #f0ad4e;
+ background-color: #fff;
+}
+.btn-danger {
+ color: #fff;
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger:focus,
+.btn-danger.focus {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #761c19;
+}
+.btn-danger:hover {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ color: #fff;
+ background-color: #c9302c;
+ border-color: #ac2925;
+}
+.btn-danger:active:hover,
+.btn-danger.active:hover,
+.open > .dropdown-toggle.btn-danger:hover,
+.btn-danger:active:focus,
+.btn-danger.active:focus,
+.open > .dropdown-toggle.btn-danger:focus,
+.btn-danger:active.focus,
+.btn-danger.active.focus,
+.open > .dropdown-toggle.btn-danger.focus {
+ color: #fff;
+ background-color: #ac2925;
+ border-color: #761c19;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+ background-image: none;
+}
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus {
+ background-color: #d9534f;
+ border-color: #d43f3a;
+}
+.btn-danger .badge {
+ color: #d9534f;
+ background-color: #fff;
+}
+.btn-link {
+ font-weight: normal;
+ color: #337ab7;
+ border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link.active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+ background-color: transparent;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+ border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+ color: #23527c;
+ text-decoration: underline;
+ background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+ color: #777;
+ text-decoration: none;
+}
+.btn-lg,
+.btn-group-lg > .btn {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+.btn-sm,
+.btn-group-sm > .btn {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-xs,
+.btn-group-xs > .btn {
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+.btn-block {
+ display: block;
+ width: 100%;
+}
+.btn-block + .btn-block {
+ margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+ width: 100%;
+}
+.fade {
+ opacity: 0;
+ -webkit-transition: opacity .15s linear;
+ -o-transition: opacity .15s linear;
+ transition: opacity .15s linear;
+}
+.fade.in {
+ opacity: 1;
+}
+.collapse {
+ display: none;
+}
+.collapse.in {
+ display: block;
+}
+tr.collapse.in {
+ display: table-row;
+}
+tbody.collapse.in {
+ display: table-row-group;
+}
+.collapsing {
+ position: relative;
+ height: 0;
+ overflow: hidden;
+ -webkit-transition-timing-function: ease;
+ -o-transition-timing-function: ease;
+ transition-timing-function: ease;
+ -webkit-transition-duration: .35s;
+ -o-transition-duration: .35s;
+ transition-duration: .35s;
+ -webkit-transition-property: height, visibility;
+ -o-transition-property: height, visibility;
+ transition-property: height, visibility;
+}
+.caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ margin-left: 2px;
+ vertical-align: middle;
+ border-top: 4px dashed;
+ border-top: 4px solid \9;
+ border-right: 4px solid transparent;
+ border-left: 4px solid transparent;
+}
+.dropup,
+.dropdown {
+ position: relative;
+}
+.dropdown-toggle:focus {
+ outline: 0;
+}
+.dropdown-menu {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ z-index: 1000;
+ display: none;
+ float: left;
+ min-width: 160px;
+ padding: 5px 0;
+ margin: 2px 0 0;
+ font-size: 14px;
+ text-align: left;
+ list-style: none;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0, 0, 0, .15);
+ border-radius: 4px;
+ -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+ box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+}
+.dropdown-menu.pull-right {
+ right: 0;
+ left: auto;
+}
+.dropdown-menu .divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5;
+}
+.dropdown-menu > li > a {
+ display: block;
+ padding: 3px 20px;
+ clear: both;
+ font-weight: normal;
+ line-height: 1.42857143;
+ color: #333;
+ white-space: nowrap;
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+ color: #262626;
+ text-decoration: none;
+ background-color: #f5f5f5;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+ color: #fff;
+ text-decoration: none;
+ background-color: #337ab7;
+ outline: 0;
+}
+.dropdown-menu > .disabled > a,
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+ color: #777;
+}
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+ text-decoration: none;
+ cursor: not-allowed;
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+}
+.open > .dropdown-menu {
+ display: block;
+}
+.open > a {
+ outline: 0;
+}
+.dropdown-menu-right {
+ right: 0;
+ left: auto;
+}
+.dropdown-menu-left {
+ right: auto;
+ left: 0;
+}
+.dropdown-header {
+ display: block;
+ padding: 3px 20px;
+ font-size: 12px;
+ line-height: 1.42857143;
+ color: #777;
+ white-space: nowrap;
+}
+.dropdown-backdrop {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 990;
+}
+.pull-right > .dropdown-menu {
+ right: 0;
+ left: auto;
+}
+.dropup .caret,
+.navbar-fixed-bottom .dropdown .caret {
+ content: "";
+ border-top: 0;
+ border-bottom: 4px dashed;
+ border-bottom: 4px solid \9;
+}
+.dropup .dropdown-menu,
+.navbar-fixed-bottom .dropdown .dropdown-menu {
+ top: auto;
+ bottom: 100%;
+ margin-bottom: 2px;
+}
+@media (min-width: 768px) {
+ .navbar-right .dropdown-menu {
+ right: 0;
+ left: auto;
+ }
+ .navbar-right .dropdown-menu-left {
+ right: auto;
+ left: 0;
+ }
+}
+.btn-group,
+.btn-group-vertical {
+ position: relative;
+ display: inline-block;
+ vertical-align: middle;
+}
+.btn-group > .btn,
+.btn-group-vertical > .btn {
+ position: relative;
+ float: left;
+}
+.btn-group > .btn:hover,
+.btn-group-vertical > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus,
+.btn-group > .btn:active,
+.btn-group-vertical > .btn:active,
+.btn-group > .btn.active,
+.btn-group-vertical > .btn.active {
+ z-index: 2;
+}
+.btn-group .btn + .btn,
+.btn-group .btn + .btn-group,
+.btn-group .btn-group + .btn,
+.btn-group .btn-group + .btn-group {
+ margin-left: -1px;
+}
+.btn-toolbar {
+ margin-left: -5px;
+}
+.btn-toolbar .btn,
+.btn-toolbar .btn-group,
+.btn-toolbar .input-group {
+ float: left;
+}
+.btn-toolbar > .btn,
+.btn-toolbar > .btn-group,
+.btn-toolbar > .input-group {
+ margin-left: 5px;
+}
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
+ border-radius: 0;
+}
+.btn-group > .btn:first-child {
+ margin-left: 0;
+}
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child) {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group > .btn-group {
+ float: left;
+}
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0;
+}
+.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+ outline: 0;
+}
+.btn-group > .btn + .dropdown-toggle {
+ padding-right: 8px;
+ padding-left: 8px;
+}
+.btn-group > .btn-lg + .dropdown-toggle {
+ padding-right: 12px;
+ padding-left: 12px;
+}
+.btn-group.open .dropdown-toggle {
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn-group.open .dropdown-toggle.btn-link {
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+.btn .caret {
+ margin-left: 0;
+}
+.btn-lg .caret {
+ border-width: 5px 5px 0;
+ border-bottom-width: 0;
+}
+.dropup .btn-lg .caret {
+ border-width: 0 5px 5px;
+}
+.btn-group-vertical > .btn,
+.btn-group-vertical > .btn-group,
+.btn-group-vertical > .btn-group > .btn {
+ display: block;
+ float: none;
+ width: 100%;
+ max-width: 100%;
+}
+.btn-group-vertical > .btn-group > .btn {
+ float: none;
+}
+.btn-group-vertical > .btn + .btn,
+.btn-group-vertical > .btn + .btn-group,
+.btn-group-vertical > .btn-group + .btn,
+.btn-group-vertical > .btn-group + .btn-group {
+ margin-top: -1px;
+ margin-left: 0;
+}
+.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
+ border-radius: 0;
+}
+.btn-group-vertical > .btn:first-child:not(:last-child) {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn:last-child:not(:first-child) {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
+ border-radius: 0;
+}
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+.btn-group-justified {
+ display: table;
+ width: 100%;
+ table-layout: fixed;
+ border-collapse: separate;
+}
+.btn-group-justified > .btn,
+.btn-group-justified > .btn-group {
+ display: table-cell;
+ float: none;
+ width: 1%;
+}
+.btn-group-justified > .btn-group .btn {
+ width: 100%;
+}
+.btn-group-justified > .btn-group .dropdown-menu {
+ left: auto;
+}
+[data-toggle="buttons"] > .btn input[type="radio"],
+[data-toggle="buttons"] > .btn-group > .btn input[type="radio"],
+[data-toggle="buttons"] > .btn input[type="checkbox"],
+[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] {
+ position: absolute;
+ clip: rect(0, 0, 0, 0);
+ pointer-events: none;
+}
+.input-group {
+ position: relative;
+ display: table;
+ border-collapse: separate;
+}
+.input-group[class*="col-"] {
+ float: none;
+ padding-right: 0;
+ padding-left: 0;
+}
+.input-group .form-control {
+ position: relative;
+ z-index: 2;
+ float: left;
+ width: 100%;
+ margin-bottom: 0;
+}
+.input-group .form-control:focus {
+ z-index: 3;
+}
+.input-group-lg > .form-control,
+.input-group-lg > .input-group-addon,
+.input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+ border-radius: 6px;
+}
+select.input-group-lg > .form-control,
+select.input-group-lg > .input-group-addon,
+select.input-group-lg > .input-group-btn > .btn {
+ height: 46px;
+ line-height: 46px;
+}
+textarea.input-group-lg > .form-control,
+textarea.input-group-lg > .input-group-addon,
+textarea.input-group-lg > .input-group-btn > .btn,
+select[multiple].input-group-lg > .form-control,
+select[multiple].input-group-lg > .input-group-addon,
+select[multiple].input-group-lg > .input-group-btn > .btn {
+ height: auto;
+}
+.input-group-sm > .form-control,
+.input-group-sm > .input-group-addon,
+.input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+ border-radius: 3px;
+}
+select.input-group-sm > .form-control,
+select.input-group-sm > .input-group-addon,
+select.input-group-sm > .input-group-btn > .btn {
+ height: 30px;
+ line-height: 30px;
+}
+textarea.input-group-sm > .form-control,
+textarea.input-group-sm > .input-group-addon,
+textarea.input-group-sm > .input-group-btn > .btn,
+select[multiple].input-group-sm > .form-control,
+select[multiple].input-group-sm > .input-group-addon,
+select[multiple].input-group-sm > .input-group-btn > .btn {
+ height: auto;
+}
+.input-group-addon,
+.input-group-btn,
+.input-group .form-control {
+ display: table-cell;
+}
+.input-group-addon:not(:first-child):not(:last-child),
+.input-group-btn:not(:first-child):not(:last-child),
+.input-group .form-control:not(:first-child):not(:last-child) {
+ border-radius: 0;
+}
+.input-group-addon,
+.input-group-btn {
+ width: 1%;
+ white-space: nowrap;
+ vertical-align: middle;
+}
+.input-group-addon {
+ padding: 6px 12px;
+ font-size: 14px;
+ font-weight: normal;
+ line-height: 1;
+ color: #555;
+ text-align: center;
+ background-color: #eee;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+}
+.input-group-addon.input-sm {
+ padding: 5px 10px;
+ font-size: 12px;
+ border-radius: 3px;
+}
+.input-group-addon.input-lg {
+ padding: 10px 16px;
+ font-size: 18px;
+ border-radius: 6px;
+}
+.input-group-addon input[type="radio"],
+.input-group-addon input[type="checkbox"] {
+ margin-top: 0;
+}
+.input-group .form-control:first-child,
+.input-group-addon:first-child,
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group > .btn,
+.input-group-btn:first-child > .dropdown-toggle,
+.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
+.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.input-group-addon:first-child {
+ border-right: 0;
+}
+.input-group .form-control:last-child,
+.input-group-addon:last-child,
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group > .btn,
+.input-group-btn:last-child > .dropdown-toggle,
+.input-group-btn:first-child > .btn:not(:first-child),
+.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.input-group-addon:last-child {
+ border-left: 0;
+}
+.input-group-btn {
+ position: relative;
+ font-size: 0;
+ white-space: nowrap;
+}
+.input-group-btn > .btn {
+ position: relative;
+}
+.input-group-btn > .btn + .btn {
+ margin-left: -1px;
+}
+.input-group-btn > .btn:hover,
+.input-group-btn > .btn:focus,
+.input-group-btn > .btn:active {
+ z-index: 2;
+}
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group {
+ margin-right: -1px;
+}
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group {
+ z-index: 2;
+ margin-left: -1px;
+}
+.nav {
+ padding-left: 0;
+ margin-bottom: 0;
+ list-style: none;
+}
+.nav > li {
+ position: relative;
+ display: block;
+}
+.nav > li > a {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+}
+.nav > li > a:hover,
+.nav > li > a:focus {
+ text-decoration: none;
+ background-color: #eee;
+}
+.nav > li.disabled > a {
+ color: #777;
+}
+.nav > li.disabled > a:hover,
+.nav > li.disabled > a:focus {
+ color: #777;
+ text-decoration: none;
+ cursor: not-allowed;
+ background-color: transparent;
+}
+.nav .open > a,
+.nav .open > a:hover,
+.nav .open > a:focus {
+ background-color: #eee;
+ border-color: #337ab7;
+}
+.nav .nav-divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5;
+}
+.nav > li > a > img {
+ max-width: none;
+}
+.nav-tabs {
+ border-bottom: 1px solid #ddd;
+}
+.nav-tabs > li {
+ float: left;
+ margin-bottom: -1px;
+}
+.nav-tabs > li > a {
+ margin-right: 2px;
+ line-height: 1.42857143;
+ border: 1px solid transparent;
+ border-radius: 4px 4px 0 0;
+}
+.nav-tabs > li > a:hover {
+ border-color: #eee #eee #ddd;
+}
+.nav-tabs > li.active > a,
+.nav-tabs > li.active > a:hover,
+.nav-tabs > li.active > a:focus {
+ color: #555;
+ cursor: default;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-bottom-color: transparent;
+}
+.nav-tabs.nav-justified {
+ width: 100%;
+ border-bottom: 0;
+}
+.nav-tabs.nav-justified > li {
+ float: none;
+}
+.nav-tabs.nav-justified > li > a {
+ margin-bottom: 5px;
+ text-align: center;
+}
+.nav-tabs.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto;
+}
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li {
+ display: table-cell;
+ width: 1%;
+ }
+ .nav-tabs.nav-justified > li > a {
+ margin-bottom: 0;
+ }
+}
+.nav-tabs.nav-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px;
+}
+.nav-tabs.nav-justified > .active > a,
+.nav-tabs.nav-justified > .active > a:hover,
+.nav-tabs.nav-justified > .active > a:focus {
+ border: 1px solid #ddd;
+}
+@media (min-width: 768px) {
+ .nav-tabs.nav-justified > li > a {
+ border-bottom: 1px solid #ddd;
+ border-radius: 4px 4px 0 0;
+ }
+ .nav-tabs.nav-justified > .active > a,
+ .nav-tabs.nav-justified > .active > a:hover,
+ .nav-tabs.nav-justified > .active > a:focus {
+ border-bottom-color: #fff;
+ }
+}
+.nav-pills > li {
+ float: left;
+}
+.nav-pills > li > a {
+ border-radius: 4px;
+}
+.nav-pills > li + li {
+ margin-left: 2px;
+}
+.nav-pills > li.active > a,
+.nav-pills > li.active > a:hover,
+.nav-pills > li.active > a:focus {
+ color: #fff;
+ background-color: #337ab7;
+}
+.nav-stacked > li {
+ float: none;
+}
+.nav-stacked > li + li {
+ margin-top: 2px;
+ margin-left: 0;
+}
+.nav-justified {
+ width: 100%;
+}
+.nav-justified > li {
+ float: none;
+}
+.nav-justified > li > a {
+ margin-bottom: 5px;
+ text-align: center;
+}
+.nav-justified > .dropdown .dropdown-menu {
+ top: auto;
+ left: auto;
+}
+@media (min-width: 768px) {
+ .nav-justified > li {
+ display: table-cell;
+ width: 1%;
+ }
+ .nav-justified > li > a {
+ margin-bottom: 0;
+ }
+}
+.nav-tabs-justified {
+ border-bottom: 0;
+}
+.nav-tabs-justified > li > a {
+ margin-right: 0;
+ border-radius: 4px;
+}
+.nav-tabs-justified > .active > a,
+.nav-tabs-justified > .active > a:hover,
+.nav-tabs-justified > .active > a:focus {
+ border: 1px solid #ddd;
+}
+@media (min-width: 768px) {
+ .nav-tabs-justified > li > a {
+ border-bottom: 1px solid #ddd;
+ border-radius: 4px 4px 0 0;
+ }
+ .nav-tabs-justified > .active > a,
+ .nav-tabs-justified > .active > a:hover,
+ .nav-tabs-justified > .active > a:focus {
+ border-bottom-color: #fff;
+ }
+}
+.tab-content > .tab-pane {
+ display: none;
+}
+.tab-content > .active {
+ display: block;
+}
+.nav-tabs .dropdown-menu {
+ margin-top: -1px;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+.navbar {
+ position: relative;
+ min-height: 50px;
+ margin-bottom: 20px;
+ border: 1px solid transparent;
+}
+@media (min-width: 768px) {
+ .navbar {
+ border-radius: 4px;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-header {
+ float: left;
+ }
+}
+.navbar-collapse {
+ padding-right: 15px;
+ padding-left: 15px;
+ overflow-x: visible;
+ -webkit-overflow-scrolling: touch;
+ border-top: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
+}
+.navbar-collapse.in {
+ overflow-y: auto;
+}
+@media (min-width: 768px) {
+ .navbar-collapse {
+ width: auto;
+ border-top: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+ .navbar-collapse.collapse {
+ display: block !important;
+ height: auto !important;
+ padding-bottom: 0;
+ overflow: visible !important;
+ }
+ .navbar-collapse.in {
+ overflow-y: visible;
+ }
+ .navbar-fixed-top .navbar-collapse,
+ .navbar-static-top .navbar-collapse,
+ .navbar-fixed-bottom .navbar-collapse {
+ padding-right: 0;
+ padding-left: 0;
+ }
+}
+.navbar-fixed-top .navbar-collapse,
+.navbar-fixed-bottom .navbar-collapse {
+ max-height: 340px;
+}
+@media (max-device-width: 480px) and (orientation: landscape) {
+ .navbar-fixed-top .navbar-collapse,
+ .navbar-fixed-bottom .navbar-collapse {
+ max-height: 200px;
+ }
+}
+.container > .navbar-header,
+.container-fluid > .navbar-header,
+.container > .navbar-collapse,
+.container-fluid > .navbar-collapse {
+ margin-right: -15px;
+ margin-left: -15px;
+}
+@media (min-width: 768px) {
+ .container > .navbar-header,
+ .container-fluid > .navbar-header,
+ .container > .navbar-collapse,
+ .container-fluid > .navbar-collapse {
+ margin-right: 0;
+ margin-left: 0;
+ }
+}
+.navbar-static-top {
+ z-index: 1000;
+ border-width: 0 0 1px;
+}
+@media (min-width: 768px) {
+ .navbar-static-top {
+ border-radius: 0;
+ }
+}
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+ position: fixed;
+ right: 0;
+ left: 0;
+ z-index: 1030;
+}
+@media (min-width: 768px) {
+ .navbar-fixed-top,
+ .navbar-fixed-bottom {
+ border-radius: 0;
+ }
+}
+.navbar-fixed-top {
+ top: 0;
+ border-width: 0 0 1px;
+}
+.navbar-fixed-bottom {
+ bottom: 0;
+ margin-bottom: 0;
+ border-width: 1px 0 0;
+}
+.navbar-brand {
+ float: left;
+ height: 50px;
+ padding: 15px 15px;
+ font-size: 18px;
+ line-height: 20px;
+}
+.navbar-brand:hover,
+.navbar-brand:focus {
+ text-decoration: none;
+}
+.navbar-brand > img {
+ display: block;
+}
+@media (min-width: 768px) {
+ .navbar > .container .navbar-brand,
+ .navbar > .container-fluid .navbar-brand {
+ margin-left: -15px;
+ }
+}
+.navbar-toggle {
+ position: relative;
+ float: right;
+ padding: 9px 10px;
+ margin-top: 8px;
+ margin-right: 15px;
+ margin-bottom: 8px;
+ background-color: transparent;
+ background-image: none;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.navbar-toggle:focus {
+ outline: 0;
+}
+.navbar-toggle .icon-bar {
+ display: block;
+ width: 22px;
+ height: 2px;
+ border-radius: 1px;
+}
+.navbar-toggle .icon-bar + .icon-bar {
+ margin-top: 4px;
+}
+@media (min-width: 768px) {
+ .navbar-toggle {
+ display: none;
+ }
+}
+.navbar-nav {
+ margin: 7.5px -15px;
+}
+.navbar-nav > li > a {
+ padding-top: 10px;
+ padding-bottom: 10px;
+ line-height: 20px;
+}
+@media (max-width: 767px) {
+ .navbar-nav .open .dropdown-menu {
+ position: static;
+ float: none;
+ width: auto;
+ margin-top: 0;
+ background-color: transparent;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+ .navbar-nav .open .dropdown-menu > li > a,
+ .navbar-nav .open .dropdown-menu .dropdown-header {
+ padding: 5px 15px 5px 25px;
+ }
+ .navbar-nav .open .dropdown-menu > li > a {
+ line-height: 20px;
+ }
+ .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-nav .open .dropdown-menu > li > a:focus {
+ background-image: none;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-nav {
+ float: left;
+ margin: 0;
+ }
+ .navbar-nav > li {
+ float: left;
+ }
+ .navbar-nav > li > a {
+ padding-top: 15px;
+ padding-bottom: 15px;
+ }
+}
+.navbar-form {
+ padding: 10px 15px;
+ margin-top: 8px;
+ margin-right: -15px;
+ margin-bottom: 8px;
+ margin-left: -15px;
+ border-top: 1px solid transparent;
+ border-bottom: 1px solid transparent;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
+}
+@media (min-width: 768px) {
+ .navbar-form .form-group {
+ display: inline-block;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .form-control {
+ display: inline-block;
+ width: auto;
+ vertical-align: middle;
+ }
+ .navbar-form .form-control-static {
+ display: inline-block;
+ }
+ .navbar-form .input-group {
+ display: inline-table;
+ vertical-align: middle;
+ }
+ .navbar-form .input-group .input-group-addon,
+ .navbar-form .input-group .input-group-btn,
+ .navbar-form .input-group .form-control {
+ width: auto;
+ }
+ .navbar-form .input-group > .form-control {
+ width: 100%;
+ }
+ .navbar-form .control-label {
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .radio,
+ .navbar-form .checkbox {
+ display: inline-block;
+ margin-top: 0;
+ margin-bottom: 0;
+ vertical-align: middle;
+ }
+ .navbar-form .radio label,
+ .navbar-form .checkbox label {
+ padding-left: 0;
+ }
+ .navbar-form .radio input[type="radio"],
+ .navbar-form .checkbox input[type="checkbox"] {
+ position: relative;
+ margin-left: 0;
+ }
+ .navbar-form .has-feedback .form-control-feedback {
+ top: 0;
+ }
+}
+@media (max-width: 767px) {
+ .navbar-form .form-group {
+ margin-bottom: 5px;
+ }
+ .navbar-form .form-group:last-child {
+ margin-bottom: 0;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-form {
+ width: auto;
+ padding-top: 0;
+ padding-bottom: 0;
+ margin-right: 0;
+ margin-left: 0;
+ border: 0;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ }
+}
+.navbar-nav > li > .dropdown-menu {
+ margin-top: 0;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+ margin-bottom: 0;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 0;
+ border-bottom-left-radius: 0;
+}
+.navbar-btn {
+ margin-top: 8px;
+ margin-bottom: 8px;
+}
+.navbar-btn.btn-sm {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.navbar-btn.btn-xs {
+ margin-top: 14px;
+ margin-bottom: 14px;
+}
+.navbar-text {
+ margin-top: 15px;
+ margin-bottom: 15px;
+}
+@media (min-width: 768px) {
+ .navbar-text {
+ float: left;
+ margin-right: 15px;
+ margin-left: 15px;
+ }
+}
+@media (min-width: 768px) {
+ .navbar-left {
+ float: left !important;
+ }
+ .navbar-right {
+ float: right !important;
+ margin-right: -15px;
+ }
+ .navbar-right ~ .navbar-right {
+ margin-right: 0;
+ }
+}
+.navbar-default {
+ background-color: #f8f8f8;
+ border-color: #e7e7e7;
+}
+.navbar-default .navbar-brand {
+ color: #777;
+}
+.navbar-default .navbar-brand:hover,
+.navbar-default .navbar-brand:focus {
+ color: #5e5e5e;
+ background-color: transparent;
+}
+.navbar-default .navbar-text {
+ color: #777;
+}
+.navbar-default .navbar-nav > li > a {
+ color: #777;
+}
+.navbar-default .navbar-nav > li > a:hover,
+.navbar-default .navbar-nav > li > a:focus {
+ color: #333;
+ background-color: transparent;
+}
+.navbar-default .navbar-nav > .active > a,
+.navbar-default .navbar-nav > .active > a:hover,
+.navbar-default .navbar-nav > .active > a:focus {
+ color: #555;
+ background-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .disabled > a,
+.navbar-default .navbar-nav > .disabled > a:hover,
+.navbar-default .navbar-nav > .disabled > a:focus {
+ color: #ccc;
+ background-color: transparent;
+}
+.navbar-default .navbar-toggle {
+ border-color: #ddd;
+}
+.navbar-default .navbar-toggle:hover,
+.navbar-default .navbar-toggle:focus {
+ background-color: #ddd;
+}
+.navbar-default .navbar-toggle .icon-bar {
+ background-color: #888;
+}
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+ border-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .open > a:hover,
+.navbar-default .navbar-nav > .open > a:focus {
+ color: #555;
+ background-color: #e7e7e7;
+}
+@media (max-width: 767px) {
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a {
+ color: #777;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
+ color: #333;
+ background-color: transparent;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #555;
+ background-color: #e7e7e7;
+ }
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+ .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+ color: #ccc;
+ background-color: transparent;
+ }
+}
+.navbar-default .navbar-link {
+ color: #777;
+}
+.navbar-default .navbar-link:hover {
+ color: #333;
+}
+.navbar-default .btn-link {
+ color: #777;
+}
+.navbar-default .btn-link:hover,
+.navbar-default .btn-link:focus {
+ color: #333;
+}
+.navbar-default .btn-link[disabled]:hover,
+fieldset[disabled] .navbar-default .btn-link:hover,
+.navbar-default .btn-link[disabled]:focus,
+fieldset[disabled] .navbar-default .btn-link:focus {
+ color: #ccc;
+}
+.navbar-inverse {
+ background-color: #222;
+ border-color: #080808;
+}
+.navbar-inverse .navbar-brand {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-brand:hover,
+.navbar-inverse .navbar-brand:focus {
+ color: #fff;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-text {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-nav > li > a {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-nav > li > a:hover,
+.navbar-inverse .navbar-nav > li > a:focus {
+ color: #fff;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-nav > .active > a,
+.navbar-inverse .navbar-nav > .active > a:hover,
+.navbar-inverse .navbar-nav > .active > a:focus {
+ color: #fff;
+ background-color: #080808;
+}
+.navbar-inverse .navbar-nav > .disabled > a,
+.navbar-inverse .navbar-nav > .disabled > a:hover,
+.navbar-inverse .navbar-nav > .disabled > a:focus {
+ color: #444;
+ background-color: transparent;
+}
+.navbar-inverse .navbar-toggle {
+ border-color: #333;
+}
+.navbar-inverse .navbar-toggle:hover,
+.navbar-inverse .navbar-toggle:focus {
+ background-color: #333;
+}
+.navbar-inverse .navbar-toggle .icon-bar {
+ background-color: #fff;
+}
+.navbar-inverse .navbar-collapse,
+.navbar-inverse .navbar-form {
+ border-color: #101010;
+}
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .open > a:hover,
+.navbar-inverse .navbar-nav > .open > a:focus {
+ color: #fff;
+ background-color: #080808;
+}
+@media (max-width: 767px) {
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
+ border-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu .divider {
+ background-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
+ color: #9d9d9d;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
+ color: #fff;
+ background-color: transparent;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #fff;
+ background-color: #080808;
+ }
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+ .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+ color: #444;
+ background-color: transparent;
+ }
+}
+.navbar-inverse .navbar-link {
+ color: #9d9d9d;
+}
+.navbar-inverse .navbar-link:hover {
+ color: #fff;
+}
+.navbar-inverse .btn-link {
+ color: #9d9d9d;
+}
+.navbar-inverse .btn-link:hover,
+.navbar-inverse .btn-link:focus {
+ color: #fff;
+}
+.navbar-inverse .btn-link[disabled]:hover,
+fieldset[disabled] .navbar-inverse .btn-link:hover,
+.navbar-inverse .btn-link[disabled]:focus,
+fieldset[disabled] .navbar-inverse .btn-link:focus {
+ color: #444;
+}
+.breadcrumb {
+ padding: 8px 15px;
+ margin-bottom: 20px;
+ list-style: none;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+}
+.breadcrumb > li {
+ display: inline-block;
+}
+.breadcrumb > li + li:before {
+ padding: 0 5px;
+ color: #ccc;
+ content: "/\00a0";
+}
+.breadcrumb > .active {
+ color: #777;
+}
+.pagination {
+ display: inline-block;
+ padding-left: 0;
+ margin: 20px 0;
+ border-radius: 4px;
+}
+.pagination > li {
+ display: inline;
+}
+.pagination > li > a,
+.pagination > li > span {
+ position: relative;
+ float: left;
+ padding: 6px 12px;
+ margin-left: -1px;
+ line-height: 1.42857143;
+ color: #337ab7;
+ text-decoration: none;
+ background-color: #fff;
+ border: 1px solid #ddd;
+}
+.pagination > li:first-child > a,
+.pagination > li:first-child > span {
+ margin-left: 0;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+.pagination > li:last-child > a,
+.pagination > li:last-child > span {
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+}
+.pagination > li > a:hover,
+.pagination > li > span:hover,
+.pagination > li > a:focus,
+.pagination > li > span:focus {
+ z-index: 2;
+ color: #23527c;
+ background-color: #eee;
+ border-color: #ddd;
+}
+.pagination > .active > a,
+.pagination > .active > span,
+.pagination > .active > a:hover,
+.pagination > .active > span:hover,
+.pagination > .active > a:focus,
+.pagination > .active > span:focus {
+ z-index: 3;
+ color: #fff;
+ cursor: default;
+ background-color: #337ab7;
+ border-color: #337ab7;
+}
+.pagination > .disabled > span,
+.pagination > .disabled > span:hover,
+.pagination > .disabled > span:focus,
+.pagination > .disabled > a,
+.pagination > .disabled > a:hover,
+.pagination > .disabled > a:focus {
+ color: #777;
+ cursor: not-allowed;
+ background-color: #fff;
+ border-color: #ddd;
+}
+.pagination-lg > li > a,
+.pagination-lg > li > span {
+ padding: 10px 16px;
+ font-size: 18px;
+ line-height: 1.3333333;
+}
+.pagination-lg > li:first-child > a,
+.pagination-lg > li:first-child > span {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+}
+.pagination-lg > li:last-child > a,
+.pagination-lg > li:last-child > span {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+}
+.pagination-sm > li > a,
+.pagination-sm > li > span {
+ padding: 5px 10px;
+ font-size: 12px;
+ line-height: 1.5;
+}
+.pagination-sm > li:first-child > a,
+.pagination-sm > li:first-child > span {
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.pagination-sm > li:last-child > a,
+.pagination-sm > li:last-child > span {
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+.pager {
+ padding-left: 0;
+ margin: 20px 0;
+ text-align: center;
+ list-style: none;
+}
+.pager li {
+ display: inline;
+}
+.pager li > a,
+.pager li > span {
+ display: inline-block;
+ padding: 5px 14px;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 15px;
+}
+.pager li > a:hover,
+.pager li > a:focus {
+ text-decoration: none;
+ background-color: #eee;
+}
+.pager .next > a,
+.pager .next > span {
+ float: right;
+}
+.pager .previous > a,
+.pager .previous > span {
+ float: left;
+}
+.pager .disabled > a,
+.pager .disabled > a:hover,
+.pager .disabled > a:focus,
+.pager .disabled > span {
+ color: #777;
+ cursor: not-allowed;
+ background-color: #fff;
+}
+.label {
+ display: inline;
+ padding: .2em .6em .3em;
+ font-size: 75%;
+ font-weight: bold;
+ line-height: 1;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: baseline;
+ border-radius: .25em;
+}
+a.label:hover,
+a.label:focus {
+ color: #fff;
+ text-decoration: none;
+ cursor: pointer;
+}
+.label:empty {
+ display: none;
+}
+.btn .label {
+ position: relative;
+ top: -1px;
+}
+.label-default {
+ background-color: #777;
+}
+.label-default[href]:hover,
+.label-default[href]:focus {
+ background-color: #5e5e5e;
+}
+.label-primary {
+ background-color: #337ab7;
+}
+.label-primary[href]:hover,
+.label-primary[href]:focus {
+ background-color: #286090;
+}
+.label-success {
+ background-color: #5cb85c;
+}
+.label-success[href]:hover,
+.label-success[href]:focus {
+ background-color: #449d44;
+}
+.label-info {
+ background-color: #5bc0de;
+}
+.label-info[href]:hover,
+.label-info[href]:focus {
+ background-color: #31b0d5;
+}
+.label-warning {
+ background-color: #f0ad4e;
+}
+.label-warning[href]:hover,
+.label-warning[href]:focus {
+ background-color: #ec971f;
+}
+.label-danger {
+ background-color: #d9534f;
+}
+.label-danger[href]:hover,
+.label-danger[href]:focus {
+ background-color: #c9302c;
+}
+.badge {
+ display: inline-block;
+ min-width: 10px;
+ padding: 3px 7px;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 1;
+ color: #fff;
+ text-align: center;
+ white-space: nowrap;
+ vertical-align: middle;
+ background-color: #777;
+ border-radius: 10px;
+}
+.badge:empty {
+ display: none;
+}
+.btn .badge {
+ position: relative;
+ top: -1px;
+}
+.btn-xs .badge,
+.btn-group-xs > .btn .badge {
+ top: 0;
+ padding: 1px 5px;
+}
+a.badge:hover,
+a.badge:focus {
+ color: #fff;
+ text-decoration: none;
+ cursor: pointer;
+}
+.list-group-item.active > .badge,
+.nav-pills > .active > a > .badge {
+ color: #337ab7;
+ background-color: #fff;
+}
+.list-group-item > .badge {
+ float: right;
+}
+.list-group-item > .badge + .badge {
+ margin-right: 5px;
+}
+.nav-pills > li > a > .badge {
+ margin-left: 3px;
+}
+.jumbotron {
+ padding-top: 30px;
+ padding-bottom: 30px;
+ margin-bottom: 30px;
+ color: inherit;
+ background-color: #eee;
+}
+.jumbotron h1,
+.jumbotron .h1 {
+ color: inherit;
+}
+.jumbotron p {
+ margin-bottom: 15px;
+ font-size: 21px;
+ font-weight: 200;
+}
+.jumbotron > hr {
+ border-top-color: #d5d5d5;
+}
+.container .jumbotron,
+.container-fluid .jumbotron {
+ padding-right: 15px;
+ padding-left: 15px;
+ border-radius: 6px;
+}
+.jumbotron .container {
+ max-width: 100%;
+}
+@media screen and (min-width: 768px) {
+ .jumbotron {
+ padding-top: 48px;
+ padding-bottom: 48px;
+ }
+ .container .jumbotron,
+ .container-fluid .jumbotron {
+ padding-right: 60px;
+ padding-left: 60px;
+ }
+ .jumbotron h1,
+ .jumbotron .h1 {
+ font-size: 63px;
+ }
+}
+.thumbnail {
+ display: block;
+ padding: 4px;
+ margin-bottom: 20px;
+ line-height: 1.42857143;
+ background-color: #fff;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ -webkit-transition: border .2s ease-in-out;
+ -o-transition: border .2s ease-in-out;
+ transition: border .2s ease-in-out;
+}
+.thumbnail > img,
+.thumbnail a > img {
+ margin-right: auto;
+ margin-left: auto;
+}
+a.thumbnail:hover,
+a.thumbnail:focus,
+a.thumbnail.active {
+ border-color: #337ab7;
+}
+.thumbnail .caption {
+ padding: 9px;
+ color: #333;
+}
+.alert {
+ padding: 15px;
+ margin-bottom: 20px;
+ border: 1px solid transparent;
+ border-radius: 4px;
+}
+.alert h4 {
+ margin-top: 0;
+ color: inherit;
+}
+.alert .alert-link {
+ font-weight: bold;
+}
+.alert > p,
+.alert > ul {
+ margin-bottom: 0;
+}
+.alert > p + p {
+ margin-top: 5px;
+}
+.alert-dismissable,
+.alert-dismissible {
+ padding-right: 35px;
+}
+.alert-dismissable .close,
+.alert-dismissible .close {
+ position: relative;
+ top: -2px;
+ right: -21px;
+ color: inherit;
+}
+.alert-success {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #d6e9c6;
+}
+.alert-success hr {
+ border-top-color: #c9e2b3;
+}
+.alert-success .alert-link {
+ color: #2b542c;
+}
+.alert-info {
+ color: #31708f;
+ background-color: #d9edf7;
+ border-color: #bce8f1;
+}
+.alert-info hr {
+ border-top-color: #a6e1ec;
+}
+.alert-info .alert-link {
+ color: #245269;
+}
+.alert-warning {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+}
+.alert-warning hr {
+ border-top-color: #f7e1b5;
+}
+.alert-warning .alert-link {
+ color: #66512c;
+}
+.alert-danger {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1;
+}
+.alert-danger hr {
+ border-top-color: #e4b9c0;
+}
+.alert-danger .alert-link {
+ color: #843534;
+}
+@-webkit-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+@-o-keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+@keyframes progress-bar-stripes {
+ from {
+ background-position: 40px 0;
+ }
+ to {
+ background-position: 0 0;
+ }
+}
+.progress {
+ height: 20px;
+ margin-bottom: 20px;
+ overflow: hidden;
+ background-color: #f5f5f5;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
+}
+.progress-bar {
+ float: left;
+ width: 0;
+ height: 100%;
+ font-size: 12px;
+ line-height: 20px;
+ color: #fff;
+ text-align: center;
+ background-color: #337ab7;
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
+ -webkit-transition: width .6s ease;
+ -o-transition: width .6s ease;
+ transition: width .6s ease;
+}
+.progress-striped .progress-bar,
+.progress-bar-striped {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ -webkit-background-size: 40px 40px;
+ background-size: 40px 40px;
+}
+.progress.active .progress-bar,
+.progress-bar.active {
+ -webkit-animation: progress-bar-stripes 2s linear infinite;
+ -o-animation: progress-bar-stripes 2s linear infinite;
+ animation: progress-bar-stripes 2s linear infinite;
+}
+.progress-bar-success {
+ background-color: #5cb85c;
+}
+.progress-striped .progress-bar-success {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.progress-bar-info {
+ background-color: #5bc0de;
+}
+.progress-striped .progress-bar-info {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.progress-bar-warning {
+ background-color: #f0ad4e;
+}
+.progress-striped .progress-bar-warning {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.progress-bar-danger {
+ background-color: #d9534f;
+}
+.progress-striped .progress-bar-danger {
+ background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.media {
+ margin-top: 15px;
+}
+.media:first-child {
+ margin-top: 0;
+}
+.media,
+.media-body {
+ overflow: hidden;
+ zoom: 1;
+}
+.media-body {
+ width: 10000px;
+}
+.media-object {
+ display: block;
+}
+.media-object.img-thumbnail {
+ max-width: none;
+}
+.media-right,
+.media > .pull-right {
+ padding-left: 10px;
+}
+.media-left,
+.media > .pull-left {
+ padding-right: 10px;
+}
+.media-left,
+.media-right,
+.media-body {
+ display: table-cell;
+ vertical-align: top;
+}
+.media-middle {
+ vertical-align: middle;
+}
+.media-bottom {
+ vertical-align: bottom;
+}
+.media-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+.media-list {
+ padding-left: 0;
+ list-style: none;
+}
+.list-group {
+ padding-left: 0;
+ margin-bottom: 20px;
+}
+.list-group-item {
+ position: relative;
+ display: block;
+ padding: 10px 15px;
+ margin-bottom: -1px;
+ background-color: #fff;
+ border: 1px solid #ddd;
+}
+.list-group-item:first-child {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.list-group-item:last-child {
+ margin-bottom: 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+a.list-group-item,
+button.list-group-item {
+ color: #555;
+}
+a.list-group-item .list-group-item-heading,
+button.list-group-item .list-group-item-heading {
+ color: #333;
+}
+a.list-group-item:hover,
+button.list-group-item:hover,
+a.list-group-item:focus,
+button.list-group-item:focus {
+ color: #555;
+ text-decoration: none;
+ background-color: #f5f5f5;
+}
+button.list-group-item {
+ width: 100%;
+ text-align: left;
+}
+.list-group-item.disabled,
+.list-group-item.disabled:hover,
+.list-group-item.disabled:focus {
+ color: #777;
+ cursor: not-allowed;
+ background-color: #eee;
+}
+.list-group-item.disabled .list-group-item-heading,
+.list-group-item.disabled:hover .list-group-item-heading,
+.list-group-item.disabled:focus .list-group-item-heading {
+ color: inherit;
+}
+.list-group-item.disabled .list-group-item-text,
+.list-group-item.disabled:hover .list-group-item-text,
+.list-group-item.disabled:focus .list-group-item-text {
+ color: #777;
+}
+.list-group-item.active,
+.list-group-item.active:hover,
+.list-group-item.active:focus {
+ z-index: 2;
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #337ab7;
+}
+.list-group-item.active .list-group-item-heading,
+.list-group-item.active:hover .list-group-item-heading,
+.list-group-item.active:focus .list-group-item-heading,
+.list-group-item.active .list-group-item-heading > small,
+.list-group-item.active:hover .list-group-item-heading > small,
+.list-group-item.active:focus .list-group-item-heading > small,
+.list-group-item.active .list-group-item-heading > .small,
+.list-group-item.active:hover .list-group-item-heading > .small,
+.list-group-item.active:focus .list-group-item-heading > .small {
+ color: inherit;
+}
+.list-group-item.active .list-group-item-text,
+.list-group-item.active:hover .list-group-item-text,
+.list-group-item.active:focus .list-group-item-text {
+ color: #c7ddef;
+}
+.list-group-item-success {
+ color: #3c763d;
+ background-color: #dff0d8;
+}
+a.list-group-item-success,
+button.list-group-item-success {
+ color: #3c763d;
+}
+a.list-group-item-success .list-group-item-heading,
+button.list-group-item-success .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-success:hover,
+button.list-group-item-success:hover,
+a.list-group-item-success:focus,
+button.list-group-item-success:focus {
+ color: #3c763d;
+ background-color: #d0e9c6;
+}
+a.list-group-item-success.active,
+button.list-group-item-success.active,
+a.list-group-item-success.active:hover,
+button.list-group-item-success.active:hover,
+a.list-group-item-success.active:focus,
+button.list-group-item-success.active:focus {
+ color: #fff;
+ background-color: #3c763d;
+ border-color: #3c763d;
+}
+.list-group-item-info {
+ color: #31708f;
+ background-color: #d9edf7;
+}
+a.list-group-item-info,
+button.list-group-item-info {
+ color: #31708f;
+}
+a.list-group-item-info .list-group-item-heading,
+button.list-group-item-info .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-info:hover,
+button.list-group-item-info:hover,
+a.list-group-item-info:focus,
+button.list-group-item-info:focus {
+ color: #31708f;
+ background-color: #c4e3f3;
+}
+a.list-group-item-info.active,
+button.list-group-item-info.active,
+a.list-group-item-info.active:hover,
+button.list-group-item-info.active:hover,
+a.list-group-item-info.active:focus,
+button.list-group-item-info.active:focus {
+ color: #fff;
+ background-color: #31708f;
+ border-color: #31708f;
+}
+.list-group-item-warning {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+}
+a.list-group-item-warning,
+button.list-group-item-warning {
+ color: #8a6d3b;
+}
+a.list-group-item-warning .list-group-item-heading,
+button.list-group-item-warning .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-warning:hover,
+button.list-group-item-warning:hover,
+a.list-group-item-warning:focus,
+button.list-group-item-warning:focus {
+ color: #8a6d3b;
+ background-color: #faf2cc;
+}
+a.list-group-item-warning.active,
+button.list-group-item-warning.active,
+a.list-group-item-warning.active:hover,
+button.list-group-item-warning.active:hover,
+a.list-group-item-warning.active:focus,
+button.list-group-item-warning.active:focus {
+ color: #fff;
+ background-color: #8a6d3b;
+ border-color: #8a6d3b;
+}
+.list-group-item-danger {
+ color: #a94442;
+ background-color: #f2dede;
+}
+a.list-group-item-danger,
+button.list-group-item-danger {
+ color: #a94442;
+}
+a.list-group-item-danger .list-group-item-heading,
+button.list-group-item-danger .list-group-item-heading {
+ color: inherit;
+}
+a.list-group-item-danger:hover,
+button.list-group-item-danger:hover,
+a.list-group-item-danger:focus,
+button.list-group-item-danger:focus {
+ color: #a94442;
+ background-color: #ebcccc;
+}
+a.list-group-item-danger.active,
+button.list-group-item-danger.active,
+a.list-group-item-danger.active:hover,
+button.list-group-item-danger.active:hover,
+a.list-group-item-danger.active:focus,
+button.list-group-item-danger.active:focus {
+ color: #fff;
+ background-color: #a94442;
+ border-color: #a94442;
+}
+.list-group-item-heading {
+ margin-top: 0;
+ margin-bottom: 5px;
+}
+.list-group-item-text {
+ margin-bottom: 0;
+ line-height: 1.3;
+}
+.panel {
+ margin-bottom: 20px;
+ background-color: #fff;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
+}
+.panel-body {
+ padding: 15px;
+}
+.panel-heading {
+ padding: 10px 15px;
+ border-bottom: 1px solid transparent;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.panel-heading > .dropdown .dropdown-toggle {
+ color: inherit;
+}
+.panel-title {
+ margin-top: 0;
+ margin-bottom: 0;
+ font-size: 16px;
+ color: inherit;
+}
+.panel-title > a,
+.panel-title > small,
+.panel-title > .small,
+.panel-title > small > a,
+.panel-title > .small > a {
+ color: inherit;
+}
+.panel-footer {
+ padding: 10px 15px;
+ background-color: #f5f5f5;
+ border-top: 1px solid #ddd;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .list-group,
+.panel > .panel-collapse > .list-group {
+ margin-bottom: 0;
+}
+.panel > .list-group .list-group-item,
+.panel > .panel-collapse > .list-group .list-group-item {
+ border-width: 1px 0;
+ border-radius: 0;
+}
+.panel > .list-group:first-child .list-group-item:first-child,
+.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {
+ border-top: 0;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.panel > .list-group:last-child .list-group-item:last-child,
+.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {
+ border-bottom: 0;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+}
+.panel-heading + .list-group .list-group-item:first-child {
+ border-top-width: 0;
+}
+.list-group + .panel-footer {
+ border-top-width: 0;
+}
+.panel > .table,
+.panel > .table-responsive > .table,
+.panel > .panel-collapse > .table {
+ margin-bottom: 0;
+}
+.panel > .table caption,
+.panel > .table-responsive > .table caption,
+.panel > .panel-collapse > .table caption {
+ padding-right: 15px;
+ padding-left: 15px;
+}
+.panel > .table:first-child,
+.panel > .table-responsive:first-child > .table:first-child {
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,
+.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {
+ border-top-left-radius: 3px;
+}
+.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,
+.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,
+.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,
+.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,
+.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {
+ border-top-right-radius: 3px;
+}
+.panel > .table:last-child,
+.panel > .table-responsive:last-child > .table:last-child {
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,
+.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {
+ border-bottom-left-radius: 3px;
+}
+.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,
+.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,
+.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,
+.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {
+ border-bottom-right-radius: 3px;
+}
+.panel > .panel-body + .table,
+.panel > .panel-body + .table-responsive,
+.panel > .table + .panel-body,
+.panel > .table-responsive + .panel-body {
+ border-top: 1px solid #ddd;
+}
+.panel > .table > tbody:first-child > tr:first-child th,
+.panel > .table > tbody:first-child > tr:first-child td {
+ border-top: 0;
+}
+.panel > .table-bordered,
+.panel > .table-responsive > .table-bordered {
+ border: 0;
+}
+.panel > .table-bordered > thead > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,
+.panel > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,
+.panel > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+.panel > .table-bordered > thead > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,
+.panel > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,
+.panel > .table-bordered > tfoot > tr > td:first-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+ border-left: 0;
+}
+.panel > .table-bordered > thead > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,
+.panel > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,
+.panel > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+.panel > .table-bordered > thead > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,
+.panel > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,
+.panel > .table-bordered > tfoot > tr > td:last-child,
+.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+ border-right: 0;
+}
+.panel > .table-bordered > thead > tr:first-child > td,
+.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,
+.panel > .table-bordered > tbody > tr:first-child > td,
+.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,
+.panel > .table-bordered > thead > tr:first-child > th,
+.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,
+.panel > .table-bordered > tbody > tr:first-child > th,
+.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {
+ border-bottom: 0;
+}
+.panel > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,
+.panel > .table-bordered > tfoot > tr:last-child > td,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,
+.panel > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,
+.panel > .table-bordered > tfoot > tr:last-child > th,
+.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {
+ border-bottom: 0;
+}
+.panel > .table-responsive {
+ margin-bottom: 0;
+ border: 0;
+}
+.panel-group {
+ margin-bottom: 20px;
+}
+.panel-group .panel {
+ margin-bottom: 0;
+ border-radius: 4px;
+}
+.panel-group .panel + .panel {
+ margin-top: 5px;
+}
+.panel-group .panel-heading {
+ border-bottom: 0;
+}
+.panel-group .panel-heading + .panel-collapse > .panel-body,
+.panel-group .panel-heading + .panel-collapse > .list-group {
+ border-top: 1px solid #ddd;
+}
+.panel-group .panel-footer {
+ border-top: 0;
+}
+.panel-group .panel-footer + .panel-collapse .panel-body {
+ border-bottom: 1px solid #ddd;
+}
+.panel-default {
+ border-color: #ddd;
+}
+.panel-default > .panel-heading {
+ color: #333;
+ background-color: #f5f5f5;
+ border-color: #ddd;
+}
+.panel-default > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #ddd;
+}
+.panel-default > .panel-heading .badge {
+ color: #f5f5f5;
+ background-color: #333;
+}
+.panel-default > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #ddd;
+}
+.panel-primary {
+ border-color: #337ab7;
+}
+.panel-primary > .panel-heading {
+ color: #fff;
+ background-color: #337ab7;
+ border-color: #337ab7;
+}
+.panel-primary > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #337ab7;
+}
+.panel-primary > .panel-heading .badge {
+ color: #337ab7;
+ background-color: #fff;
+}
+.panel-primary > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #337ab7;
+}
+.panel-success {
+ border-color: #d6e9c6;
+}
+.panel-success > .panel-heading {
+ color: #3c763d;
+ background-color: #dff0d8;
+ border-color: #d6e9c6;
+}
+.panel-success > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #d6e9c6;
+}
+.panel-success > .panel-heading .badge {
+ color: #dff0d8;
+ background-color: #3c763d;
+}
+.panel-success > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #d6e9c6;
+}
+.panel-info {
+ border-color: #bce8f1;
+}
+.panel-info > .panel-heading {
+ color: #31708f;
+ background-color: #d9edf7;
+ border-color: #bce8f1;
+}
+.panel-info > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #bce8f1;
+}
+.panel-info > .panel-heading .badge {
+ color: #d9edf7;
+ background-color: #31708f;
+}
+.panel-info > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #bce8f1;
+}
+.panel-warning {
+ border-color: #faebcc;
+}
+.panel-warning > .panel-heading {
+ color: #8a6d3b;
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+}
+.panel-warning > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #faebcc;
+}
+.panel-warning > .panel-heading .badge {
+ color: #fcf8e3;
+ background-color: #8a6d3b;
+}
+.panel-warning > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #faebcc;
+}
+.panel-danger {
+ border-color: #ebccd1;
+}
+.panel-danger > .panel-heading {
+ color: #a94442;
+ background-color: #f2dede;
+ border-color: #ebccd1;
+}
+.panel-danger > .panel-heading + .panel-collapse > .panel-body {
+ border-top-color: #ebccd1;
+}
+.panel-danger > .panel-heading .badge {
+ color: #f2dede;
+ background-color: #a94442;
+}
+.panel-danger > .panel-footer + .panel-collapse > .panel-body {
+ border-bottom-color: #ebccd1;
+}
+.embed-responsive {
+ position: relative;
+ display: block;
+ height: 0;
+ padding: 0;
+ overflow: hidden;
+}
+.embed-responsive .embed-responsive-item,
+.embed-responsive iframe,
+.embed-responsive embed,
+.embed-responsive object,
+.embed-responsive video {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+}
+.embed-responsive-16by9 {
+ padding-bottom: 56.25%;
+}
+.embed-responsive-4by3 {
+ padding-bottom: 75%;
+}
+.well {
+ min-height: 20px;
+ padding: 19px;
+ margin-bottom: 20px;
+ background-color: #f5f5f5;
+ border: 1px solid #e3e3e3;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05);
+}
+.well blockquote {
+ border-color: #ddd;
+ border-color: rgba(0, 0, 0, .15);
+}
+.well-lg {
+ padding: 24px;
+ border-radius: 6px;
+}
+.well-sm {
+ padding: 9px;
+ border-radius: 3px;
+}
+.close {
+ float: right;
+ font-size: 21px;
+ font-weight: bold;
+ line-height: 1;
+ color: #000;
+ text-shadow: 0 1px 0 #fff;
+ filter: alpha(opacity=20);
+ opacity: .2;
+}
+.close:hover,
+.close:focus {
+ color: #000;
+ text-decoration: none;
+ cursor: pointer;
+ filter: alpha(opacity=50);
+ opacity: .5;
+}
+button.close {
+ -webkit-appearance: none;
+ padding: 0;
+ cursor: pointer;
+ background: transparent;
+ border: 0;
+}
+.modal-open {
+ overflow: hidden;
+}
+.modal {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1050;
+ display: none;
+ overflow: hidden;
+ -webkit-overflow-scrolling: touch;
+ outline: 0;
+}
+.modal.fade .modal-dialog {
+ -webkit-transition: -webkit-transform .3s ease-out;
+ -o-transition: -o-transform .3s ease-out;
+ transition: transform .3s ease-out;
+ -webkit-transform: translate(0, -25%);
+ -ms-transform: translate(0, -25%);
+ -o-transform: translate(0, -25%);
+ transform: translate(0, -25%);
+}
+.modal.in .modal-dialog {
+ -webkit-transform: translate(0, 0);
+ -ms-transform: translate(0, 0);
+ -o-transform: translate(0, 0);
+ transform: translate(0, 0);
+}
+.modal-open .modal {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+.modal-dialog {
+ position: relative;
+ width: auto;
+ margin: 10px;
+}
+.modal-content {
+ position: relative;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #999;
+ border: 1px solid rgba(0, 0, 0, .2);
+ border-radius: 6px;
+ outline: 0;
+ -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
+ box-shadow: 0 3px 9px rgba(0, 0, 0, .5);
+}
+.modal-backdrop {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 1040;
+ background-color: #000;
+}
+.modal-backdrop.fade {
+ filter: alpha(opacity=0);
+ opacity: 0;
+}
+.modal-backdrop.in {
+ filter: alpha(opacity=50);
+ opacity: .5;
+}
+.modal-header {
+ padding: 15px;
+ border-bottom: 1px solid #e5e5e5;
+}
+.modal-header .close {
+ margin-top: -2px;
+}
+.modal-title {
+ margin: 0;
+ line-height: 1.42857143;
+}
+.modal-body {
+ position: relative;
+ padding: 15px;
+}
+.modal-footer {
+ padding: 15px;
+ text-align: right;
+ border-top: 1px solid #e5e5e5;
+}
+.modal-footer .btn + .btn {
+ margin-bottom: 0;
+ margin-left: 5px;
+}
+.modal-footer .btn-group .btn + .btn {
+ margin-left: -1px;
+}
+.modal-footer .btn-block + .btn-block {
+ margin-left: 0;
+}
+.modal-scrollbar-measure {
+ position: absolute;
+ top: -9999px;
+ width: 50px;
+ height: 50px;
+ overflow: scroll;
+}
+@media (min-width: 768px) {
+ .modal-dialog {
+ width: 600px;
+ margin: 30px auto;
+ }
+ .modal-content {
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+ box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+ }
+ .modal-sm {
+ width: 300px;
+ }
+}
+@media (min-width: 992px) {
+ .modal-lg {
+ width: 900px;
+ }
+}
+.tooltip {
+ position: absolute;
+ z-index: 1070;
+ display: block;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ font-style: normal;
+ font-weight: normal;
+ line-height: 1.42857143;
+ text-align: left;
+ text-align: start;
+ text-decoration: none;
+ text-shadow: none;
+ text-transform: none;
+ letter-spacing: normal;
+ word-break: normal;
+ word-spacing: normal;
+ word-wrap: normal;
+ white-space: normal;
+ filter: alpha(opacity=0);
+ opacity: 0;
+
+ line-break: auto;
+}
+.tooltip.in {
+ filter: alpha(opacity=90);
+ opacity: .9;
+}
+.tooltip.top {
+ padding: 5px 0;
+ margin-top: -3px;
+}
+.tooltip.right {
+ padding: 0 5px;
+ margin-left: 3px;
+}
+.tooltip.bottom {
+ padding: 5px 0;
+ margin-top: 3px;
+}
+.tooltip.left {
+ padding: 0 5px;
+ margin-left: -3px;
+}
+.tooltip-inner {
+ max-width: 200px;
+ padding: 3px 8px;
+ color: #fff;
+ text-align: center;
+ background-color: #000;
+ border-radius: 4px;
+}
+.tooltip-arrow {
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+}
+.tooltip.top .tooltip-arrow {
+ bottom: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000;
+}
+.tooltip.top-left .tooltip-arrow {
+ right: 5px;
+ bottom: 0;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000;
+}
+.tooltip.top-right .tooltip-arrow {
+ bottom: 0;
+ left: 5px;
+ margin-bottom: -5px;
+ border-width: 5px 5px 0;
+ border-top-color: #000;
+}
+.tooltip.right .tooltip-arrow {
+ top: 50%;
+ left: 0;
+ margin-top: -5px;
+ border-width: 5px 5px 5px 0;
+ border-right-color: #000;
+}
+.tooltip.left .tooltip-arrow {
+ top: 50%;
+ right: 0;
+ margin-top: -5px;
+ border-width: 5px 0 5px 5px;
+ border-left-color: #000;
+}
+.tooltip.bottom .tooltip-arrow {
+ top: 0;
+ left: 50%;
+ margin-left: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000;
+}
+.tooltip.bottom-left .tooltip-arrow {
+ top: 0;
+ right: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000;
+}
+.tooltip.bottom-right .tooltip-arrow {
+ top: 0;
+ left: 5px;
+ margin-top: -5px;
+ border-width: 0 5px 5px;
+ border-bottom-color: #000;
+}
+.popover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1060;
+ display: none;
+ max-width: 276px;
+ padding: 1px;
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ font-size: 14px;
+ font-style: normal;
+ font-weight: normal;
+ line-height: 1.42857143;
+ text-align: left;
+ text-align: start;
+ text-decoration: none;
+ text-shadow: none;
+ text-transform: none;
+ letter-spacing: normal;
+ word-break: normal;
+ word-spacing: normal;
+ word-wrap: normal;
+ white-space: normal;
+ background-color: #fff;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ border: 1px solid rgba(0, 0, 0, .2);
+ border-radius: 6px;
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
+ box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
+
+ line-break: auto;
+}
+.popover.top {
+ margin-top: -10px;
+}
+.popover.right {
+ margin-left: 10px;
+}
+.popover.bottom {
+ margin-top: 10px;
+}
+.popover.left {
+ margin-left: -10px;
+}
+.popover-title {
+ padding: 8px 14px;
+ margin: 0;
+ font-size: 14px;
+ background-color: #f7f7f7;
+ border-bottom: 1px solid #ebebeb;
+ border-radius: 5px 5px 0 0;
+}
+.popover-content {
+ padding: 9px 14px;
+}
+.popover > .arrow,
+.popover > .arrow:after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+ border-color: transparent;
+ border-style: solid;
+}
+.popover > .arrow {
+ border-width: 11px;
+}
+.popover > .arrow:after {
+ content: "";
+ border-width: 10px;
+}
+.popover.top > .arrow {
+ bottom: -11px;
+ left: 50%;
+ margin-left: -11px;
+ border-top-color: #999;
+ border-top-color: rgba(0, 0, 0, .25);
+ border-bottom-width: 0;
+}
+.popover.top > .arrow:after {
+ bottom: 1px;
+ margin-left: -10px;
+ content: " ";
+ border-top-color: #fff;
+ border-bottom-width: 0;
+}
+.popover.right > .arrow {
+ top: 50%;
+ left: -11px;
+ margin-top: -11px;
+ border-right-color: #999;
+ border-right-color: rgba(0, 0, 0, .25);
+ border-left-width: 0;
+}
+.popover.right > .arrow:after {
+ bottom: -10px;
+ left: 1px;
+ content: " ";
+ border-right-color: #fff;
+ border-left-width: 0;
+}
+.popover.bottom > .arrow {
+ top: -11px;
+ left: 50%;
+ margin-left: -11px;
+ border-top-width: 0;
+ border-bottom-color: #999;
+ border-bottom-color: rgba(0, 0, 0, .25);
+}
+.popover.bottom > .arrow:after {
+ top: 1px;
+ margin-left: -10px;
+ content: " ";
+ border-top-width: 0;
+ border-bottom-color: #fff;
+}
+.popover.left > .arrow {
+ top: 50%;
+ right: -11px;
+ margin-top: -11px;
+ border-right-width: 0;
+ border-left-color: #999;
+ border-left-color: rgba(0, 0, 0, .25);
+}
+.popover.left > .arrow:after {
+ right: 1px;
+ bottom: -10px;
+ content: " ";
+ border-right-width: 0;
+ border-left-color: #fff;
+}
+.carousel {
+ position: relative;
+}
+.carousel-inner {
+ position: relative;
+ width: 100%;
+ overflow: hidden;
+}
+.carousel-inner > .item {
+ position: relative;
+ display: none;
+ -webkit-transition: .6s ease-in-out left;
+ -o-transition: .6s ease-in-out left;
+ transition: .6s ease-in-out left;
+}
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+ line-height: 1;
+}
+@media all and (transform-3d), (-webkit-transform-3d) {
+ .carousel-inner > .item {
+ -webkit-transition: -webkit-transform .6s ease-in-out;
+ -o-transition: -o-transform .6s ease-in-out;
+ transition: transform .6s ease-in-out;
+
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+ -webkit-perspective: 1000px;
+ perspective: 1000px;
+ }
+ .carousel-inner > .item.next,
+ .carousel-inner > .item.active.right {
+ left: 0;
+ -webkit-transform: translate3d(100%, 0, 0);
+ transform: translate3d(100%, 0, 0);
+ }
+ .carousel-inner > .item.prev,
+ .carousel-inner > .item.active.left {
+ left: 0;
+ -webkit-transform: translate3d(-100%, 0, 0);
+ transform: translate3d(-100%, 0, 0);
+ }
+ .carousel-inner > .item.next.left,
+ .carousel-inner > .item.prev.right,
+ .carousel-inner > .item.active {
+ left: 0;
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ }
+}
+.carousel-inner > .active,
+.carousel-inner > .next,
+.carousel-inner > .prev {
+ display: block;
+}
+.carousel-inner > .active {
+ left: 0;
+}
+.carousel-inner > .next,
+.carousel-inner > .prev {
+ position: absolute;
+ top: 0;
+ width: 100%;
+}
+.carousel-inner > .next {
+ left: 100%;
+}
+.carousel-inner > .prev {
+ left: -100%;
+}
+.carousel-inner > .next.left,
+.carousel-inner > .prev.right {
+ left: 0;
+}
+.carousel-inner > .active.left {
+ left: -100%;
+}
+.carousel-inner > .active.right {
+ left: 100%;
+}
+.carousel-control {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: 15%;
+ font-size: 20px;
+ color: #fff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
+ background-color: rgba(0, 0, 0, 0);
+ filter: alpha(opacity=50);
+ opacity: .5;
+}
+.carousel-control.left {
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
+ background-repeat: repeat-x;
+}
+.carousel-control.right {
+ right: 0;
+ left: auto;
+ background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
+ background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
+ background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5)));
+ background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
+ background-repeat: repeat-x;
+}
+.carousel-control:hover,
+.carousel-control:focus {
+ color: #fff;
+ text-decoration: none;
+ filter: alpha(opacity=90);
+ outline: 0;
+ opacity: .9;
+}
+.carousel-control .icon-prev,
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-left,
+.carousel-control .glyphicon-chevron-right {
+ position: absolute;
+ top: 50%;
+ z-index: 5;
+ display: inline-block;
+ margin-top: -10px;
+}
+.carousel-control .icon-prev,
+.carousel-control .glyphicon-chevron-left {
+ left: 50%;
+ margin-left: -10px;
+}
+.carousel-control .icon-next,
+.carousel-control .glyphicon-chevron-right {
+ right: 50%;
+ margin-right: -10px;
+}
+.carousel-control .icon-prev,
+.carousel-control .icon-next {
+ width: 20px;
+ height: 20px;
+ font-family: serif;
+ line-height: 1;
+}
+.carousel-control .icon-prev:before {
+ content: '\2039';
+}
+.carousel-control .icon-next:before {
+ content: '\203a';
+}
+.carousel-indicators {
+ position: absolute;
+ bottom: 10px;
+ left: 50%;
+ z-index: 15;
+ width: 60%;
+ padding-left: 0;
+ margin-left: -30%;
+ text-align: center;
+ list-style: none;
+}
+.carousel-indicators li {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ margin: 1px;
+ text-indent: -999px;
+ cursor: pointer;
+ background-color: #000 \9;
+ background-color: rgba(0, 0, 0, 0);
+ border: 1px solid #fff;
+ border-radius: 10px;
+}
+.carousel-indicators .active {
+ width: 12px;
+ height: 12px;
+ margin: 0;
+ background-color: #fff;
+}
+.carousel-caption {
+ position: absolute;
+ right: 15%;
+ bottom: 20px;
+ left: 15%;
+ z-index: 10;
+ padding-top: 20px;
+ padding-bottom: 20px;
+ color: #fff;
+ text-align: center;
+ text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
+}
+.carousel-caption .btn {
+ text-shadow: none;
+}
+@media screen and (min-width: 768px) {
+ .carousel-control .glyphicon-chevron-left,
+ .carousel-control .glyphicon-chevron-right,
+ .carousel-control .icon-prev,
+ .carousel-control .icon-next {
+ width: 30px;
+ height: 30px;
+ margin-top: -10px;
+ font-size: 30px;
+ }
+ .carousel-control .glyphicon-chevron-left,
+ .carousel-control .icon-prev {
+ margin-left: -10px;
+ }
+ .carousel-control .glyphicon-chevron-right,
+ .carousel-control .icon-next {
+ margin-right: -10px;
+ }
+ .carousel-caption {
+ right: 20%;
+ left: 20%;
+ padding-bottom: 30px;
+ }
+ .carousel-indicators {
+ bottom: 20px;
+ }
+}
+.clearfix:before,
+.clearfix:after,
+.dl-horizontal dd:before,
+.dl-horizontal dd:after,
+.container:before,
+.container:after,
+.container-fluid:before,
+.container-fluid:after,
+.row:before,
+.row:after,
+.form-horizontal .form-group:before,
+.form-horizontal .form-group:after,
+.btn-toolbar:before,
+.btn-toolbar:after,
+.btn-group-vertical > .btn-group:before,
+.btn-group-vertical > .btn-group:after,
+.nav:before,
+.nav:after,
+.navbar:before,
+.navbar:after,
+.navbar-header:before,
+.navbar-header:after,
+.navbar-collapse:before,
+.navbar-collapse:after,
+.pager:before,
+.pager:after,
+.panel-body:before,
+.panel-body:after,
+.modal-header:before,
+.modal-header:after,
+.modal-footer:before,
+.modal-footer:after {
+ display: table;
+ content: " ";
+}
+.clearfix:after,
+.dl-horizontal dd:after,
+.container:after,
+.container-fluid:after,
+.row:after,
+.form-horizontal .form-group:after,
+.btn-toolbar:after,
+.btn-group-vertical > .btn-group:after,
+.nav:after,
+.navbar:after,
+.navbar-header:after,
+.navbar-collapse:after,
+.pager:after,
+.panel-body:after,
+.modal-header:after,
+.modal-footer:after {
+ clear: both;
+}
+.center-block {
+ display: block;
+ margin-right: auto;
+ margin-left: auto;
+}
+.pull-right {
+ float: right !important;
+}
+.pull-left {
+ float: left !important;
+}
+.hide {
+ display: none !important;
+}
+.show {
+ display: block !important;
+}
+.invisible {
+ visibility: hidden;
+}
+.text-hide {
+ font: 0/0 a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0;
+}
+.hidden {
+ display: none !important;
+}
+.affix {
+ position: fixed;
+}
+@-ms-viewport {
+ width: device-width;
+}
+.visible-xs,
+.visible-sm,
+.visible-md,
+.visible-lg {
+ display: none !important;
+}
+.visible-xs-block,
+.visible-xs-inline,
+.visible-xs-inline-block,
+.visible-sm-block,
+.visible-sm-inline,
+.visible-sm-inline-block,
+.visible-md-block,
+.visible-md-inline,
+.visible-md-inline-block,
+.visible-lg-block,
+.visible-lg-inline,
+.visible-lg-inline-block {
+ display: none !important;
+}
+@media (max-width: 767px) {
+ .visible-xs {
+ display: block !important;
+ }
+ table.visible-xs {
+ display: table !important;
+ }
+ tr.visible-xs {
+ display: table-row !important;
+ }
+ th.visible-xs,
+ td.visible-xs {
+ display: table-cell !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-block {
+ display: block !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-inline {
+ display: inline !important;
+ }
+}
+@media (max-width: 767px) {
+ .visible-xs-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm {
+ display: block !important;
+ }
+ table.visible-sm {
+ display: table !important;
+ }
+ tr.visible-sm {
+ display: table-row !important;
+ }
+ th.visible-sm,
+ td.visible-sm {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-block {
+ display: block !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .visible-sm-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md {
+ display: block !important;
+ }
+ table.visible-md {
+ display: table !important;
+ }
+ tr.visible-md {
+ display: table-row !important;
+ }
+ th.visible-md,
+ td.visible-md {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-block {
+ display: block !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .visible-md-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg {
+ display: block !important;
+ }
+ table.visible-lg {
+ display: table !important;
+ }
+ tr.visible-lg {
+ display: table-row !important;
+ }
+ th.visible-lg,
+ td.visible-lg {
+ display: table-cell !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-block {
+ display: block !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-inline {
+ display: inline !important;
+ }
+}
+@media (min-width: 1200px) {
+ .visible-lg-inline-block {
+ display: inline-block !important;
+ }
+}
+@media (max-width: 767px) {
+ .hidden-xs {
+ display: none !important;
+ }
+}
+@media (min-width: 768px) and (max-width: 991px) {
+ .hidden-sm {
+ display: none !important;
+ }
+}
+@media (min-width: 992px) and (max-width: 1199px) {
+ .hidden-md {
+ display: none !important;
+ }
+}
+@media (min-width: 1200px) {
+ .hidden-lg {
+ display: none !important;
+ }
+}
+.visible-print {
+ display: none !important;
+}
+@media print {
+ .visible-print {
+ display: block !important;
+ }
+ table.visible-print {
+ display: table !important;
+ }
+ tr.visible-print {
+ display: table-row !important;
+ }
+ th.visible-print,
+ td.visible-print {
+ display: table-cell !important;
+ }
+}
+.visible-print-block {
+ display: none !important;
+}
+@media print {
+ .visible-print-block {
+ display: block !important;
+ }
+}
+.visible-print-inline {
+ display: none !important;
+}
+@media print {
+ .visible-print-inline {
+ display: inline !important;
+ }
+}
+.visible-print-inline-block {
+ display: none !important;
+}
+@media print {
+ .visible-print-inline-block {
+ display: inline-block !important;
+ }
+}
+@media print {
+ .hidden-print {
+ display: none !important;
+ }
+}
+/*# sourceMappingURL=bootstrap.css.map */
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css.map b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css.map
new file mode 100644
index 000000000..09f8cda78
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.css.map
@@ -0,0 +1 @@
+{"version":3,"sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/mixins/reset-text.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,4EAA4E;ACG5E;EACE,wBAAA;EACA,2BAAA;EACA,+BAAA;CDDD;ACQD;EACE,UAAA;CDND;ACmBD;;;;;;;;;;;;;EAaE,eAAA;CDjBD;ACyBD;;;;EAIE,sBAAA;EACA,yBAAA;CDvBD;AC+BD;EACE,cAAA;EACA,UAAA;CD7BD;ACqCD;;EAEE,cAAA;CDnCD;AC6CD;EACE,8BAAA;CD3CD;ACmDD;;EAEE,WAAA;CDjDD;AC2DD;EACE,0BAAA;CDzDD;ACgED;;EAEE,kBAAA;CD9DD;ACqED;EACE,mBAAA;CDnED;AC2ED;EACE,eAAA;EACA,iBAAA;CDzED;ACgFD;EACE,iBAAA;EACA,YAAA;CD9ED;ACqFD;EACE,eAAA;CDnFD;AC0FD;;EAEE,eAAA;EACA,eAAA;EACA,mBAAA;EACA,yBAAA;CDxFD;AC2FD;EACE,YAAA;CDzFD;AC4FD;EACE,gBAAA;CD1FD;ACoGD;EACE,UAAA;CDlGD;ACyGD;EACE,iBAAA;CDvGD;ACiHD;EACE,iBAAA;CD/GD;ACsHD;EACE,gCAAA;KAAA,6BAAA;UAAA,wBAAA;EACA,UAAA;CDpHD;AC2HD;EACE,eAAA;CDzHD;ACgID;;;;EAIE,kCAAA;EACA,eAAA;CD9HD;ACgJD;;;;;EAKE,eAAA;EACA,cAAA;EACA,UAAA;CD9ID;ACqJD;EACE,kBAAA;CDnJD;AC6JD;;EAEE,qBAAA;CD3JD;ACsKD;;;;EAIE,2BAAA;EACA,gBAAA;CDpKD;AC2KD;;EAEE,gBAAA;CDzKD;ACgLD;;EAEE,UAAA;EACA,WAAA;CD9KD;ACsLD;EACE,oBAAA;CDpLD;AC+LD;;EAEE,+BAAA;KAAA,4BAAA;UAAA,uBAAA;EACA,WAAA;CD7LD;ACsMD;;EAEE,aAAA;CDpMD;AC4MD;EACE,8BAAA;EACA,gCAAA;KAAA,6BAAA;UAAA,wBAAA;CD1MD;ACmND;;EAEE,yBAAA;CDjND;ACwND;EACE,0BAAA;EACA,cAAA;EACA,+BAAA;CDtND;AC8ND;EACE,UAAA;EACA,WAAA;CD5ND;ACmOD;EACE,eAAA;CDjOD;ACyOD;EACE,kBAAA;CDvOD;ACiPD;EACE,0BAAA;EACA,kBAAA;CD/OD;ACkPD;;EAEE,WAAA;CDhPD;AACD,qFAAqF;AElFrF;EA7FI;;;IAGI,mCAAA;IACA,uBAAA;IACA,oCAAA;YAAA,4BAAA;IACA,6BAAA;GFkLL;EE/KC;;IAEI,2BAAA;GFiLL;EE9KC;IACI,6BAAA;GFgLL;EE7KC;IACI,8BAAA;GF+KL;EE1KC;;IAEI,YAAA;GF4KL;EEzKC;;IAEI,uBAAA;IACA,yBAAA;GF2KL;EExKC;IACI,4BAAA;GF0KL;EEvKC;;IAEI,yBAAA;GFyKL;EEtKC;IACI,2BAAA;GFwKL;EErKC;;;IAGI,WAAA;IACA,UAAA;GFuKL;EEpKC;;IAEI,wBAAA;GFsKL;EEhKC;IACI,cAAA;GFkKL;EEhKC;;IAGQ,kCAAA;GFiKT;EE9JC;IACI,uBAAA;GFgKL;EE7JC;IACI,qCAAA;GF+JL;EEhKC;;IAKQ,kCAAA;GF+JT;EE5JC;;IAGQ,kCAAA;GF6JT;CACF;AGnPD;EACE,oCAAA;EACA,sDAAA;EACA,gYAAA;CHqPD;AG7OD;EACE,mBAAA;EACA,SAAA;EACA,sBAAA;EACA,oCAAA;EACA,mBAAA;EACA,oBAAA;EACA,eAAA;EACA,oCAAA;EACA,mCAAA;CH+OD;AG3OmC;EAAW,iBAAA;CH8O9C;AG7OmC;EAAW,iBAAA;CHgP9C;AG9OmC;;EAAW,iBAAA;CHkP9C;AGjPmC;EAAW,iBAAA;CHoP9C;AGnPmC;EAAW,iBAAA;CHsP9C;AGrPmC;EAAW,iBAAA;CHwP9C;AGvPmC;EAAW,iBAAA;CH0P9C;AGzPmC;EAAW,iBAAA;CH4P9C;AG3PmC;EAAW,iBAAA;CH8P9C;AG7PmC;EAAW,iBAAA;CHgQ9C;AG/PmC;EAAW,iBAAA;CHkQ9C;AGjQmC;EAAW,iBAAA;CHoQ9C;AGnQmC;EAAW,iBAAA;CHsQ9C;AGrQmC;EAAW,iBAAA;CHwQ9C;AGvQmC;EAAW,iBAAA;CH0Q9C;AGzQmC;EAAW,iBAAA;CH4Q9C;AG3QmC;EAAW,iBAAA;CH8Q9C;AG7QmC;EAAW,iBAAA;CHgR9C;AG/QmC;EAAW,iBAAA;CHkR9C;AGjRmC;EAAW,iBAAA;CHoR9C;AGnRmC;EAAW,iBAAA;CHsR9C;AGrRmC;EAAW,iBAAA;CHwR9C;AGvRmC;EAAW,iBAAA;CH0R9C;AGzRmC;EAAW,iBAAA;CH4R9C;AG3RmC;EAAW,iBAAA;CH8R9C;AG7RmC;EAAW,iBAAA;CHgS9C;AG/RmC;EAAW,iBAAA;CHkS9C;AGjSmC;EAAW,iBAAA;CHoS9C;AGnSmC;EAAW,iBAAA;CHsS9C;AGrSmC;EAAW,iBAAA;CHwS9C;AGvSmC;EAAW,iBAAA;CH0S9C;AGzSmC;EAAW,iBAAA;CH4S9C;AG3SmC;EAAW,iBAAA;CH8S9C;AG7SmC;EAAW,iBAAA;CHgT9C;AG/SmC;EAAW,iBAAA;CHkT9C;AGjTmC;EAAW,iBAAA;CHoT9C;AGnTmC;EAAW,iBAAA;CHsT9C;AGrTmC;EAAW,iBAAA;CHwT9C;AGvTmC;EAAW,iBAAA;CH0T9C;AGzTmC;EAAW,iBAAA;CH4T9C;AG3TmC;EAAW,iBAAA;CH8T9C;AG7TmC;EAAW,iBAAA;CHgU9C;AG/TmC;EAAW,iBAAA;CHkU9C;AGjUmC;EAAW,iBAAA;CHoU9C;AGnUmC;EAAW,iBAAA;CHsU9C;AGrUmC;EAAW,iBAAA;CHwU9C;AGvUmC;EAAW,iBAAA;CH0U9C;AGzUmC;EAAW,iBAAA;CH4U9C;AG3UmC;EAAW,iBAAA;CH8U9C;AG7UmC;EAAW,iBAAA;CHgV9C;AG/UmC;EAAW,iBAAA;CHkV9C;AGjVmC;EAAW,iBAAA;CHoV9C;AGnVmC;EAAW,iBAAA;CHsV9C;AGrVmC;EAAW,iBAAA;CHwV9C;AGvVmC;EAAW,iBAAA;CH0V9C;AGzVmC;EAAW,iBAAA;CH4V9C;AG3VmC;EAAW,iBAAA;CH8V9C;AG7VmC;EAAW,iBAAA;CHgW9C;AG/VmC;EAAW,iBAAA;CHkW9C;AGjWmC;EAAW,iBAAA;CHoW9C;AGnWmC;EAAW,iBAAA;CHsW9C;AGrWmC;EAAW,iBAAA;CHwW9C;AGvWmC;EAAW,iBAAA;CH0W9C;AGzWmC;EAAW,iBAAA;CH4W9C;AG3WmC;EAAW,iBAAA;CH8W9C;AG7WmC;EAAW,iBAAA;CHgX9C;AG/WmC;EAAW,iBAAA;CHkX9C;AGjXmC;EAAW,iBAAA;CHoX9C;AGnXmC;EAAW,iBAAA;CHsX9C;AGrXmC;EAAW,iBAAA;CHwX9C;AGvXmC;EAAW,iBAAA;CH0X9C;AGzXmC;EAAW,iBAAA;CH4X9C;AG3XmC;EAAW,iBAAA;CH8X9C;AG7XmC;EAAW,iBAAA;CHgY9C;AG/XmC;EAAW,iBAAA;CHkY9C;AGjYmC;EAAW,iBAAA;CHoY9C;AGnYmC;EAAW,iBAAA;CHsY9C;AGrYmC;EAAW,iBAAA;CHwY9C;AGvYmC;EAAW,iBAAA;CH0Y9C;AGzYmC;EAAW,iBAAA;CH4Y9C;AG3YmC;EAAW,iBAAA;CH8Y9C;AG7YmC;EAAW,iBAAA;CHgZ9C;AG/YmC;EAAW,iBAAA;CHkZ9C;AGjZmC;EAAW,iBAAA;CHoZ9C;AGnZmC;EAAW,iBAAA;CHsZ9C;AGrZmC;EAAW,iBAAA;CHwZ9C;AGvZmC;EAAW,iBAAA;CH0Z9C;AGzZmC;EAAW,iBAAA;CH4Z9C;AG3ZmC;EAAW,iBAAA;CH8Z9C;AG7ZmC;EAAW,iBAAA;CHga9C;AG/ZmC;EAAW,iBAAA;CHka9C;AGjamC;EAAW,iBAAA;CHoa9C;AGnamC;EAAW,iBAAA;CHsa9C;AGramC;EAAW,iBAAA;CHwa9C;AGvamC;EAAW,iBAAA;CH0a9C;AGzamC;EAAW,iBAAA;CH4a9C;AG3amC;EAAW,iBAAA;CH8a9C;AG7amC;EAAW,iBAAA;CHgb9C;AG/amC;EAAW,iBAAA;CHkb9C;AGjbmC;EAAW,iBAAA;CHob9C;AGnbmC;EAAW,iBAAA;CHsb9C;AGrbmC;EAAW,iBAAA;CHwb9C;AGvbmC;EAAW,iBAAA;CH0b9C;AGzbmC;EAAW,iBAAA;CH4b9C;AG3bmC;EAAW,iBAAA;CH8b9C;AG7bmC;EAAW,iBAAA;CHgc9C;AG/bmC;EAAW,iBAAA;CHkc9C;AGjcmC;EAAW,iBAAA;CHoc9C;AGncmC;EAAW,iBAAA;CHsc9C;AGrcmC;EAAW,iBAAA;CHwc9C;AGvcmC;EAAW,iBAAA;CH0c9C;AGzcmC;EAAW,iBAAA;CH4c9C;AG3cmC;EAAW,iBAAA;CH8c9C;AG7cmC;EAAW,iBAAA;CHgd9C;AG/cmC;EAAW,iBAAA;CHkd9C;AGjdmC;EAAW,iBAAA;CHod9C;AGndmC;EAAW,iBAAA;CHsd9C;AGrdmC;EAAW,iBAAA;CHwd9C;AGvdmC;EAAW,iBAAA;CH0d9C;AGzdmC;EAAW,iBAAA;CH4d9C;AG3dmC;EAAW,iBAAA;CH8d9C;AG7dmC;EAAW,iBAAA;CHge9C;AG/dmC;EAAW,iBAAA;CHke9C;AGjemC;EAAW,iBAAA;CHoe9C;AGnemC;EAAW,iBAAA;CHse9C;AGremC;EAAW,iBAAA;CHwe9C;AGvemC;EAAW,iBAAA;CH0e9C;AGzemC;EAAW,iBAAA;CH4e9C;AG3emC;EAAW,iBAAA;CH8e9C;AG7emC;EAAW,iBAAA;CHgf9C;AG/emC;EAAW,iBAAA;CHkf9C;AGjfmC;EAAW,iBAAA;CHof9C;AGnfmC;EAAW,iBAAA;CHsf9C;AGrfmC;EAAW,iBAAA;CHwf9C;AGvfmC;EAAW,iBAAA;CH0f9C;AGzfmC;EAAW,iBAAA;CH4f9C;AG3fmC;EAAW,iBAAA;CH8f9C;AG7fmC;EAAW,iBAAA;CHggB9C;AG/fmC;EAAW,iBAAA;CHkgB9C;AGjgBmC;EAAW,iBAAA;CHogB9C;AGngBmC;EAAW,iBAAA;CHsgB9C;AGrgBmC;EAAW,iBAAA;CHwgB9C;AGvgBmC;EAAW,iBAAA;CH0gB9C;AGzgBmC;EAAW,iBAAA;CH4gB9C;AG3gBmC;EAAW,iBAAA;CH8gB9C;AG7gBmC;EAAW,iBAAA;CHghB9C;AG/gBmC;EAAW,iBAAA;CHkhB9C;AGjhBmC;EAAW,iBAAA;CHohB9C;AGnhBmC;EAAW,iBAAA;CHshB9C;AGrhBmC;EAAW,iBAAA;CHwhB9C;AGvhBmC;EAAW,iBAAA;CH0hB9C;AGzhBmC;EAAW,iBAAA;CH4hB9C;AG3hBmC;EAAW,iBAAA;CH8hB9C;AG7hBmC;EAAW,iBAAA;CHgiB9C;AG/hBmC;EAAW,iBAAA;CHkiB9C;AGjiBmC;EAAW,iBAAA;CHoiB9C;AGniBmC;EAAW,iBAAA;CHsiB9C;AGriBmC;EAAW,iBAAA;CHwiB9C;AGviBmC;EAAW,iBAAA;CH0iB9C;AGziBmC;EAAW,iBAAA;CH4iB9C;AG3iBmC;EAAW,iBAAA;CH8iB9C;AG7iBmC;EAAW,iBAAA;CHgjB9C;AG/iBmC;EAAW,iBAAA;CHkjB9C;AGjjBmC;EAAW,iBAAA;CHojB9C;AGnjBmC;EAAW,iBAAA;CHsjB9C;AGrjBmC;EAAW,iBAAA;CHwjB9C;AGvjBmC;EAAW,iBAAA;CH0jB9C;AGzjBmC;EAAW,iBAAA;CH4jB9C;AG3jBmC;EAAW,iBAAA;CH8jB9C;AG7jBmC;EAAW,iBAAA;CHgkB9C;AG/jBmC;EAAW,iBAAA;CHkkB9C;AGjkBmC;EAAW,iBAAA;CHokB9C;AGnkBmC;EAAW,iBAAA;CHskB9C;AGrkBmC;EAAW,iBAAA;CHwkB9C;AGvkBmC;EAAW,iBAAA;CH0kB9C;AGzkBmC;EAAW,iBAAA;CH4kB9C;AG3kBmC;EAAW,iBAAA;CH8kB9C;AG7kBmC;EAAW,iBAAA;CHglB9C;AG/kBmC;EAAW,iBAAA;CHklB9C;AGjlBmC;EAAW,iBAAA;CHolB9C;AGnlBmC;EAAW,iBAAA;CHslB9C;AGrlBmC;EAAW,iBAAA;CHwlB9C;AGvlBmC;EAAW,iBAAA;CH0lB9C;AGzlBmC;EAAW,iBAAA;CH4lB9C;AG3lBmC;EAAW,iBAAA;CH8lB9C;AG7lBmC;EAAW,iBAAA;CHgmB9C;AG/lBmC;EAAW,iBAAA;CHkmB9C;AGjmBmC;EAAW,iBAAA;CHomB9C;AGnmBmC;EAAW,iBAAA;CHsmB9C;AGrmBmC;EAAW,iBAAA;CHwmB9C;AGvmBmC;EAAW,iBAAA;CH0mB9C;AGzmBmC;EAAW,iBAAA;CH4mB9C;AG3mBmC;EAAW,iBAAA;CH8mB9C;AG7mBmC;EAAW,iBAAA;CHgnB9C;AG/mBmC;EAAW,iBAAA;CHknB9C;AGjnBmC;EAAW,iBAAA;CHonB9C;AGnnBmC;EAAW,iBAAA;CHsnB9C;AGrnBmC;EAAW,iBAAA;CHwnB9C;AGvnBmC;EAAW,iBAAA;CH0nB9C;AGznBmC;EAAW,iBAAA;CH4nB9C;AG3nBmC;EAAW,iBAAA;CH8nB9C;AG7nBmC;EAAW,iBAAA;CHgoB9C;AG/nBmC;EAAW,iBAAA;CHkoB9C;AGjoBmC;EAAW,iBAAA;CHooB9C;AGnoBmC;EAAW,iBAAA;CHsoB9C;AGroBmC;EAAW,iBAAA;CHwoB9C;AG/nBmC;EAAW,iBAAA;CHkoB9C;AGjoBmC;EAAW,iBAAA;CHooB9C;AGnoBmC;EAAW,iBAAA;CHsoB9C;AGroBmC;EAAW,iBAAA;CHwoB9C;AGvoBmC;EAAW,iBAAA;CH0oB9C;AGzoBmC;EAAW,iBAAA;CH4oB9C;AG3oBmC;EAAW,iBAAA;CH8oB9C;AG7oBmC;EAAW,iBAAA;CHgpB9C;AG/oBmC;EAAW,iBAAA;CHkpB9C;AGjpBmC;EAAW,iBAAA;CHopB9C;AGnpBmC;EAAW,iBAAA;CHspB9C;AGrpBmC;EAAW,iBAAA;CHwpB9C;AGvpBmC;EAAW,iBAAA;CH0pB9C;AGzpBmC;EAAW,iBAAA;CH4pB9C;AG3pBmC;EAAW,iBAAA;CH8pB9C;AG7pBmC;EAAW,iBAAA;CHgqB9C;AG/pBmC;EAAW,iBAAA;CHkqB9C;AGjqBmC;EAAW,iBAAA;CHoqB9C;AGnqBmC;EAAW,iBAAA;CHsqB9C;AGrqBmC;EAAW,iBAAA;CHwqB9C;AGvqBmC;EAAW,iBAAA;CH0qB9C;AGzqBmC;EAAW,iBAAA;CH4qB9C;AG3qBmC;EAAW,iBAAA;CH8qB9C;AG7qBmC;EAAW,iBAAA;CHgrB9C;AG/qBmC;EAAW,iBAAA;CHkrB9C;AGjrBmC;EAAW,iBAAA;CHorB9C;AGnrBmC;EAAW,iBAAA;CHsrB9C;AGrrBmC;EAAW,iBAAA;CHwrB9C;AGvrBmC;EAAW,iBAAA;CH0rB9C;AGzrBmC;EAAW,iBAAA;CH4rB9C;AG3rBmC;EAAW,iBAAA;CH8rB9C;AG7rBmC;EAAW,iBAAA;CHgsB9C;AG/rBmC;EAAW,iBAAA;CHksB9C;AGjsBmC;EAAW,iBAAA;CHosB9C;AGnsBmC;EAAW,iBAAA;CHssB9C;AGrsBmC;EAAW,iBAAA;CHwsB9C;AGvsBmC;EAAW,iBAAA;CH0sB9C;AGzsBmC;EAAW,iBAAA;CH4sB9C;AG3sBmC;EAAW,iBAAA;CH8sB9C;AG7sBmC;EAAW,iBAAA;CHgtB9C;AG/sBmC;EAAW,iBAAA;CHktB9C;AGjtBmC;EAAW,iBAAA;CHotB9C;AGntBmC;EAAW,iBAAA;CHstB9C;AGrtBmC;EAAW,iBAAA;CHwtB9C;AGvtBmC;EAAW,iBAAA;CH0tB9C;AGztBmC;EAAW,iBAAA;CH4tB9C;AG3tBmC;EAAW,iBAAA;CH8tB9C;AG7tBmC;EAAW,iBAAA;CHguB9C;AG/tBmC;EAAW,iBAAA;CHkuB9C;AGjuBmC;EAAW,iBAAA;CHouB9C;AGnuBmC;EAAW,iBAAA;CHsuB9C;AGruBmC;EAAW,iBAAA;CHwuB9C;AGvuBmC;EAAW,iBAAA;CH0uB9C;AGzuBmC;EAAW,iBAAA;CH4uB9C;AG3uBmC;EAAW,iBAAA;CH8uB9C;AG7uBmC;EAAW,iBAAA;CHgvB9C;AIthCD;ECgEE,+BAAA;EACG,4BAAA;EACK,uBAAA;CLy9BT;AIxhCD;;EC6DE,+BAAA;EACG,4BAAA;EACK,uBAAA;CL+9BT;AIthCD;EACE,gBAAA;EACA,8CAAA;CJwhCD;AIrhCD;EACE,4DAAA;EACA,gBAAA;EACA,wBAAA;EACA,eAAA;EACA,uBAAA;CJuhCD;AInhCD;;;;EAIE,qBAAA;EACA,mBAAA;EACA,qBAAA;CJqhCD;AI/gCD;EACE,eAAA;EACA,sBAAA;CJihCD;AI/gCC;;EAEE,eAAA;EACA,2BAAA;CJihCH;AI9gCC;EErDA,qBAAA;EAEA,2CAAA;EACA,qBAAA;CNqkCD;AIxgCD;EACE,UAAA;CJ0gCD;AIpgCD;EACE,uBAAA;CJsgCD;AIlgCD;;;;;EGvEE,eAAA;EACA,gBAAA;EACA,aAAA;CPglCD;AItgCD;EACE,mBAAA;CJwgCD;AIlgCD;EACE,aAAA;EACA,wBAAA;EACA,uBAAA;EACA,uBAAA;EACA,mBAAA;EC6FA,yCAAA;EACK,oCAAA;EACG,iCAAA;EEvLR,sBAAA;EACA,gBAAA;EACA,aAAA;CPgmCD;AIlgCD;EACE,mBAAA;CJogCD;AI9/BD;EACE,iBAAA;EACA,oBAAA;EACA,UAAA;EACA,8BAAA;CJggCD;AIx/BD;EACE,mBAAA;EACA,WAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,iBAAA;EACA,uBAAA;EACA,UAAA;CJ0/BD;AIl/BC;;EAEE,iBAAA;EACA,YAAA;EACA,aAAA;EACA,UAAA;EACA,kBAAA;EACA,WAAA;CJo/BH;AIz+BD;EACE,gBAAA;CJ2+BD;AQloCD;;;;;;;;;;;;EAEE,qBAAA;EACA,iBAAA;EACA,iBAAA;EACA,eAAA;CR8oCD;AQnpCD;;;;;;;;;;;;;;;;;;;;;;;;EASI,oBAAA;EACA,eAAA;EACA,eAAA;CRoqCH;AQhqCD;;;;;;EAGE,iBAAA;EACA,oBAAA;CRqqCD;AQzqCD;;;;;;;;;;;;EAQI,eAAA;CR+qCH;AQ5qCD;;;;;;EAGE,iBAAA;EACA,oBAAA;CRirCD;AQrrCD;;;;;;;;;;;;EAQI,eAAA;CR2rCH;AQvrCD;;EAAU,gBAAA;CR2rCT;AQ1rCD;;EAAU,gBAAA;CR8rCT;AQ7rCD;;EAAU,gBAAA;CRisCT;AQhsCD;;EAAU,gBAAA;CRosCT;AQnsCD;;EAAU,gBAAA;CRusCT;AQtsCD;;EAAU,gBAAA;CR0sCT;AQpsCD;EACE,iBAAA;CRssCD;AQnsCD;EACE,oBAAA;EACA,gBAAA;EACA,iBAAA;EACA,iBAAA;CRqsCD;AQhsCD;EAwOA;IA1OI,gBAAA;GRssCD;CACF;AQ9rCD;;EAEE,eAAA;CRgsCD;AQ7rCD;;EAEE,0BAAA;EACA,cAAA;CR+rCD;AQ3rCD;EAAuB,iBAAA;CR8rCtB;AQ7rCD;EAAuB,kBAAA;CRgsCtB;AQ/rCD;EAAuB,mBAAA;CRksCtB;AQjsCD;EAAuB,oBAAA;CRosCtB;AQnsCD;EAAuB,oBAAA;CRssCtB;AQnsCD;EAAuB,0BAAA;CRssCtB;AQrsCD;EAAuB,0BAAA;CRwsCtB;AQvsCD;EAAuB,2BAAA;CR0sCtB;AQvsCD;EACE,eAAA;CRysCD;AQvsCD;ECrGE,eAAA;CT+yCD;AS9yCC;;EAEE,eAAA;CTgzCH;AQ3sCD;ECxGE,eAAA;CTszCD;ASrzCC;;EAEE,eAAA;CTuzCH;AQ/sCD;EC3GE,eAAA;CT6zCD;AS5zCC;;EAEE,eAAA;CT8zCH;AQntCD;EC9GE,eAAA;CTo0CD;ASn0CC;;EAEE,eAAA;CTq0CH;AQvtCD;ECjHE,eAAA;CT20CD;AS10CC;;EAEE,eAAA;CT40CH;AQvtCD;EAGE,YAAA;EE3HA,0BAAA;CVm1CD;AUl1CC;;EAEE,0BAAA;CVo1CH;AQztCD;EE9HE,0BAAA;CV01CD;AUz1CC;;EAEE,0BAAA;CV21CH;AQ7tCD;EEjIE,0BAAA;CVi2CD;AUh2CC;;EAEE,0BAAA;CVk2CH;AQjuCD;EEpIE,0BAAA;CVw2CD;AUv2CC;;EAEE,0BAAA;CVy2CH;AQruCD;EEvIE,0BAAA;CV+2CD;AU92CC;;EAEE,0BAAA;CVg3CH;AQpuCD;EACE,oBAAA;EACA,oBAAA;EACA,iCAAA;CRsuCD;AQ9tCD;;EAEE,cAAA;EACA,oBAAA;CRguCD;AQnuCD;;;;EAMI,iBAAA;CRmuCH;AQ5tCD;EACE,gBAAA;EACA,iBAAA;CR8tCD;AQ1tCD;EALE,gBAAA;EACA,iBAAA;EAMA,kBAAA;CR6tCD;AQ/tCD;EAKI,sBAAA;EACA,kBAAA;EACA,mBAAA;CR6tCH;AQxtCD;EACE,cAAA;EACA,oBAAA;CR0tCD;AQxtCD;;EAEE,wBAAA;CR0tCD;AQxtCD;EACE,kBAAA;CR0tCD;AQxtCD;EACE,eAAA;CR0tCD;AQjsCD;EA6EA;IAvFM,YAAA;IACA,aAAA;IACA,YAAA;IACA,kBAAA;IGtNJ,iBAAA;IACA,wBAAA;IACA,oBAAA;GXs6CC;EQ9nCH;IAhFM,mBAAA;GRitCH;CACF;AQxsCD;;EAGE,aAAA;EACA,kCAAA;CRysCD;AQvsCD;EACE,eAAA;EA9IqB,0BAAA;CRw1CtB;AQrsCD;EACE,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,+BAAA;CRusCD;AQlsCG;;;EACE,iBAAA;CRssCL;AQhtCD;;;EAmBI,eAAA;EACA,eAAA;EACA,wBAAA;EACA,eAAA;CRksCH;AQhsCG;;;EACE,uBAAA;CRosCL;AQ5rCD;;EAEE,oBAAA;EACA,gBAAA;EACA,gCAAA;EACA,eAAA;EACA,kBAAA;CR8rCD;AQxrCG;;;;;;EAAW,YAAA;CRgsCd;AQ/rCG;;;;;;EACE,uBAAA;CRssCL;AQhsCD;EACE,oBAAA;EACA,mBAAA;EACA,wBAAA;CRksCD;AYx+CD;;;;EAIE,+DAAA;CZ0+CD;AYt+CD;EACE,iBAAA;EACA,eAAA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;CZw+CD;AYp+CD;EACE,iBAAA;EACA,eAAA;EACA,YAAA;EACA,uBAAA;EACA,mBAAA;EACA,uDAAA;UAAA,+CAAA;CZs+CD;AY5+CD;EASI,WAAA;EACA,gBAAA;EACA,kBAAA;EACA,yBAAA;UAAA,iBAAA;CZs+CH;AYj+CD;EACE,eAAA;EACA,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,sBAAA;EACA,sBAAA;EACA,eAAA;EACA,0BAAA;EACA,uBAAA;EACA,mBAAA;CZm+CD;AY9+CD;EAeI,WAAA;EACA,mBAAA;EACA,eAAA;EACA,sBAAA;EACA,8BAAA;EACA,iBAAA;CZk+CH;AY79CD;EACE,kBAAA;EACA,mBAAA;CZ+9CD;AazhDD;ECHE,mBAAA;EACA,kBAAA;EACA,mBAAA;EACA,oBAAA;Cd+hDD;AazhDC;EAqEF;IAvEI,aAAA;Gb+hDD;CACF;Aa3hDC;EAkEF;IApEI,aAAA;GbiiDD;CACF;Aa7hDD;EA+DA;IAjEI,cAAA;GbmiDD;CACF;Aa1hDD;ECvBE,mBAAA;EACA,kBAAA;EACA,mBAAA;EACA,oBAAA;CdojDD;AavhDD;ECvBE,mBAAA;EACA,oBAAA;CdijDD;AejjDG;EACE,mBAAA;EAEA,gBAAA;EAEA,mBAAA;EACA,oBAAA;CfijDL;AejiDG;EACE,YAAA;CfmiDL;Ae5hDC;EACE,YAAA;Cf8hDH;Ae/hDC;EACE,oBAAA;CfiiDH;AeliDC;EACE,oBAAA;CfoiDH;AeriDC;EACE,WAAA;CfuiDH;AexiDC;EACE,oBAAA;Cf0iDH;Ae3iDC;EACE,oBAAA;Cf6iDH;Ae9iDC;EACE,WAAA;CfgjDH;AejjDC;EACE,oBAAA;CfmjDH;AepjDC;EACE,oBAAA;CfsjDH;AevjDC;EACE,WAAA;CfyjDH;Ae1jDC;EACE,oBAAA;Cf4jDH;Ae7jDC;EACE,mBAAA;Cf+jDH;AejjDC;EACE,YAAA;CfmjDH;AepjDC;EACE,oBAAA;CfsjDH;AevjDC;EACE,oBAAA;CfyjDH;Ae1jDC;EACE,WAAA;Cf4jDH;Ae7jDC;EACE,oBAAA;Cf+jDH;AehkDC;EACE,oBAAA;CfkkDH;AenkDC;EACE,WAAA;CfqkDH;AetkDC;EACE,oBAAA;CfwkDH;AezkDC;EACE,oBAAA;Cf2kDH;Ae5kDC;EACE,WAAA;Cf8kDH;Ae/kDC;EACE,oBAAA;CfilDH;AellDC;EACE,mBAAA;CfolDH;AehlDC;EACE,YAAA;CfklDH;AelmDC;EACE,WAAA;CfomDH;AermDC;EACE,mBAAA;CfumDH;AexmDC;EACE,mBAAA;Cf0mDH;Ae3mDC;EACE,UAAA;Cf6mDH;Ae9mDC;EACE,mBAAA;CfgnDH;AejnDC;EACE,mBAAA;CfmnDH;AepnDC;EACE,UAAA;CfsnDH;AevnDC;EACE,mBAAA;CfynDH;Ae1nDC;EACE,mBAAA;Cf4nDH;Ae7nDC;EACE,UAAA;Cf+nDH;AehoDC;EACE,mBAAA;CfkoDH;AenoDC;EACE,kBAAA;CfqoDH;AejoDC;EACE,WAAA;CfmoDH;AernDC;EACE,kBAAA;CfunDH;AexnDC;EACE,0BAAA;Cf0nDH;Ae3nDC;EACE,0BAAA;Cf6nDH;Ae9nDC;EACE,iBAAA;CfgoDH;AejoDC;EACE,0BAAA;CfmoDH;AepoDC;EACE,0BAAA;CfsoDH;AevoDC;EACE,iBAAA;CfyoDH;Ae1oDC;EACE,0BAAA;Cf4oDH;Ae7oDC;EACE,0BAAA;Cf+oDH;AehpDC;EACE,iBAAA;CfkpDH;AenpDC;EACE,0BAAA;CfqpDH;AetpDC;EACE,yBAAA;CfwpDH;AezpDC;EACE,gBAAA;Cf2pDH;Aa3pDD;EElCI;IACE,YAAA;GfgsDH;EezrDD;IACE,YAAA;Gf2rDD;Ee5rDD;IACE,oBAAA;Gf8rDD;Ee/rDD;IACE,oBAAA;GfisDD;EelsDD;IACE,WAAA;GfosDD;EersDD;IACE,oBAAA;GfusDD;EexsDD;IACE,oBAAA;Gf0sDD;Ee3sDD;IACE,WAAA;Gf6sDD;Ee9sDD;IACE,oBAAA;GfgtDD;EejtDD;IACE,oBAAA;GfmtDD;EeptDD;IACE,WAAA;GfstDD;EevtDD;IACE,oBAAA;GfytDD;Ee1tDD;IACE,mBAAA;Gf4tDD;Ee9sDD;IACE,YAAA;GfgtDD;EejtDD;IACE,oBAAA;GfmtDD;EeptDD;IACE,oBAAA;GfstDD;EevtDD;IACE,WAAA;GfytDD;Ee1tDD;IACE,oBAAA;Gf4tDD;Ee7tDD;IACE,oBAAA;Gf+tDD;EehuDD;IACE,WAAA;GfkuDD;EenuDD;IACE,oBAAA;GfquDD;EetuDD;IACE,oBAAA;GfwuDD;EezuDD;IACE,WAAA;Gf2uDD;Ee5uDD;IACE,oBAAA;Gf8uDD;Ee/uDD;IACE,mBAAA;GfivDD;Ee7uDD;IACE,YAAA;Gf+uDD;Ee/vDD;IACE,WAAA;GfiwDD;EelwDD;IACE,mBAAA;GfowDD;EerwDD;IACE,mBAAA;GfuwDD;EexwDD;IACE,UAAA;Gf0wDD;Ee3wDD;IACE,mBAAA;Gf6wDD;Ee9wDD;IACE,mBAAA;GfgxDD;EejxDD;IACE,UAAA;GfmxDD;EepxDD;IACE,mBAAA;GfsxDD;EevxDD;IACE,mBAAA;GfyxDD;Ee1xDD;IACE,UAAA;Gf4xDD;Ee7xDD;IACE,mBAAA;Gf+xDD;EehyDD;IACE,kBAAA;GfkyDD;Ee9xDD;IACE,WAAA;GfgyDD;EelxDD;IACE,kBAAA;GfoxDD;EerxDD;IACE,0BAAA;GfuxDD;EexxDD;IACE,0BAAA;Gf0xDD;Ee3xDD;IACE,iBAAA;Gf6xDD;Ee9xDD;IACE,0BAAA;GfgyDD;EejyDD;IACE,0BAAA;GfmyDD;EepyDD;IACE,iBAAA;GfsyDD;EevyDD;IACE,0BAAA;GfyyDD;Ee1yDD;IACE,0BAAA;Gf4yDD;Ee7yDD;IACE,iBAAA;Gf+yDD;EehzDD;IACE,0BAAA;GfkzDD;EenzDD;IACE,yBAAA;GfqzDD;EetzDD;IACE,gBAAA;GfwzDD;CACF;AahzDD;EE3CI;IACE,YAAA;Gf81DH;Eev1DD;IACE,YAAA;Gfy1DD;Ee11DD;IACE,oBAAA;Gf41DD;Ee71DD;IACE,oBAAA;Gf+1DD;Eeh2DD;IACE,WAAA;Gfk2DD;Een2DD;IACE,oBAAA;Gfq2DD;Eet2DD;IACE,oBAAA;Gfw2DD;Eez2DD;IACE,WAAA;Gf22DD;Ee52DD;IACE,oBAAA;Gf82DD;Ee/2DD;IACE,oBAAA;Gfi3DD;Eel3DD;IACE,WAAA;Gfo3DD;Eer3DD;IACE,oBAAA;Gfu3DD;Eex3DD;IACE,mBAAA;Gf03DD;Ee52DD;IACE,YAAA;Gf82DD;Ee/2DD;IACE,oBAAA;Gfi3DD;Eel3DD;IACE,oBAAA;Gfo3DD;Eer3DD;IACE,WAAA;Gfu3DD;Eex3DD;IACE,oBAAA;Gf03DD;Ee33DD;IACE,oBAAA;Gf63DD;Ee93DD;IACE,WAAA;Gfg4DD;Eej4DD;IACE,oBAAA;Gfm4DD;Eep4DD;IACE,oBAAA;Gfs4DD;Eev4DD;IACE,WAAA;Gfy4DD;Ee14DD;IACE,oBAAA;Gf44DD;Ee74DD;IACE,mBAAA;Gf+4DD;Ee34DD;IACE,YAAA;Gf64DD;Ee75DD;IACE,WAAA;Gf+5DD;Eeh6DD;IACE,mBAAA;Gfk6DD;Een6DD;IACE,mBAAA;Gfq6DD;Eet6DD;IACE,UAAA;Gfw6DD;Eez6DD;IACE,mBAAA;Gf26DD;Ee56DD;IACE,mBAAA;Gf86DD;Ee/6DD;IACE,UAAA;Gfi7DD;Eel7DD;IACE,mBAAA;Gfo7DD;Eer7DD;IACE,mBAAA;Gfu7DD;Eex7DD;IACE,UAAA;Gf07DD;Ee37DD;IACE,mBAAA;Gf67DD;Ee97DD;IACE,kBAAA;Gfg8DD;Ee57DD;IACE,WAAA;Gf87DD;Eeh7DD;IACE,kBAAA;Gfk7DD;Een7DD;IACE,0BAAA;Gfq7DD;Eet7DD;IACE,0BAAA;Gfw7DD;Eez7DD;IACE,iBAAA;Gf27DD;Ee57DD;IACE,0BAAA;Gf87DD;Ee/7DD;IACE,0BAAA;Gfi8DD;Eel8DD;IACE,iBAAA;Gfo8DD;Eer8DD;IACE,0BAAA;Gfu8DD;Eex8DD;IACE,0BAAA;Gf08DD;Ee38DD;IACE,iBAAA;Gf68DD;Ee98DD;IACE,0BAAA;Gfg9DD;Eej9DD;IACE,yBAAA;Gfm9DD;Eep9DD;IACE,gBAAA;Gfs9DD;CACF;Aa38DD;EE9CI;IACE,YAAA;Gf4/DH;Eer/DD;IACE,YAAA;Gfu/DD;Eex/DD;IACE,oBAAA;Gf0/DD;Ee3/DD;IACE,oBAAA;Gf6/DD;Ee9/DD;IACE,WAAA;GfggED;EejgED;IACE,oBAAA;GfmgED;EepgED;IACE,oBAAA;GfsgED;EevgED;IACE,WAAA;GfygED;Ee1gED;IACE,oBAAA;Gf4gED;Ee7gED;IACE,oBAAA;Gf+gED;EehhED;IACE,WAAA;GfkhED;EenhED;IACE,oBAAA;GfqhED;EethED;IACE,mBAAA;GfwhED;Ee1gED;IACE,YAAA;Gf4gED;Ee7gED;IACE,oBAAA;Gf+gED;EehhED;IACE,oBAAA;GfkhED;EenhED;IACE,WAAA;GfqhED;EethED;IACE,oBAAA;GfwhED;EezhED;IACE,oBAAA;Gf2hED;Ee5hED;IACE,WAAA;Gf8hED;Ee/hED;IACE,oBAAA;GfiiED;EeliED;IACE,oBAAA;GfoiED;EeriED;IACE,WAAA;GfuiED;EexiED;IACE,oBAAA;Gf0iED;Ee3iED;IACE,mBAAA;Gf6iED;EeziED;IACE,YAAA;Gf2iED;Ee3jED;IACE,WAAA;Gf6jED;Ee9jED;IACE,mBAAA;GfgkED;EejkED;IACE,mBAAA;GfmkED;EepkED;IACE,UAAA;GfskED;EevkED;IACE,mBAAA;GfykED;Ee1kED;IACE,mBAAA;Gf4kED;Ee7kED;IACE,UAAA;Gf+kED;EehlED;IACE,mBAAA;GfklED;EenlED;IACE,mBAAA;GfqlED;EetlED;IACE,UAAA;GfwlED;EezlED;IACE,mBAAA;Gf2lED;Ee5lED;IACE,kBAAA;Gf8lED;Ee1lED;IACE,WAAA;Gf4lED;Ee9kED;IACE,kBAAA;GfglED;EejlED;IACE,0BAAA;GfmlED;EeplED;IACE,0BAAA;GfslED;EevlED;IACE,iBAAA;GfylED;Ee1lED;IACE,0BAAA;Gf4lED;Ee7lED;IACE,0BAAA;Gf+lED;EehmED;IACE,iBAAA;GfkmED;EenmED;IACE,0BAAA;GfqmED;EetmED;IACE,0BAAA;GfwmED;EezmED;IACE,iBAAA;Gf2mED;Ee5mED;IACE,0BAAA;Gf8mED;Ee/mED;IACE,yBAAA;GfinED;EelnED;IACE,gBAAA;GfonED;CACF;AgBxrED;EACE,8BAAA;ChB0rED;AgBxrED;EACE,iBAAA;EACA,oBAAA;EACA,eAAA;EACA,iBAAA;ChB0rED;AgBxrED;EACE,iBAAA;ChB0rED;AgBprED;EACE,YAAA;EACA,gBAAA;EACA,oBAAA;ChBsrED;AgBzrED;;;;;;EAWQ,aAAA;EACA,wBAAA;EACA,oBAAA;EACA,2BAAA;ChBsrEP;AgBpsED;EAoBI,uBAAA;EACA,8BAAA;ChBmrEH;AgBxsED;;;;;;EA8BQ,cAAA;ChBkrEP;AgBhtED;EAoCI,2BAAA;ChB+qEH;AgBntED;EAyCI,uBAAA;ChB6qEH;AgBtqED;;;;;;EAOQ,aAAA;ChBuqEP;AgB5pED;EACE,uBAAA;ChB8pED;AgB/pED;;;;;;EAQQ,uBAAA;ChB+pEP;AgBvqED;;EAeM,yBAAA;ChB4pEL;AgBlpED;EAEI,0BAAA;ChBmpEH;AgB1oED;EAEI,0BAAA;ChB2oEH;AgBloED;EACE,iBAAA;EACA,YAAA;EACA,sBAAA;ChBooED;AgB/nEG;;EACE,iBAAA;EACA,YAAA;EACA,oBAAA;ChBkoEL;AiB9wEC;;;;;;;;;;;;EAOI,0BAAA;CjBqxEL;AiB/wEC;;;;;EAMI,0BAAA;CjBgxEL;AiBnyEC;;;;;;;;;;;;EAOI,0BAAA;CjB0yEL;AiBpyEC;;;;;EAMI,0BAAA;CjBqyEL;AiBxzEC;;;;;;;;;;;;EAOI,0BAAA;CjB+zEL;AiBzzEC;;;;;EAMI,0BAAA;CjB0zEL;AiB70EC;;;;;;;;;;;;EAOI,0BAAA;CjBo1EL;AiB90EC;;;;;EAMI,0BAAA;CjB+0EL;AiBl2EC;;;;;;;;;;;;EAOI,0BAAA;CjBy2EL;AiBn2EC;;;;;EAMI,0BAAA;CjBo2EL;AgBltED;EACE,iBAAA;EACA,kBAAA;ChBotED;AgBvpED;EACA;IA3DI,YAAA;IACA,oBAAA;IACA,mBAAA;IACA,6CAAA;IACA,uBAAA;GhBqtED;EgB9pEH;IAnDM,iBAAA;GhBotEH;EgBjqEH;;;;;;IA1CY,oBAAA;GhBmtET;EgBzqEH;IAlCM,UAAA;GhB8sEH;EgB5qEH;;;;;;IAzBY,eAAA;GhB6sET;EgBprEH;;;;;;IArBY,gBAAA;GhBitET;EgB5rEH;;;;IARY,iBAAA;GhB0sET;CACF;AkBp6ED;EACE,WAAA;EACA,UAAA;EACA,UAAA;EAIA,aAAA;ClBm6ED;AkBh6ED;EACE,eAAA;EACA,YAAA;EACA,WAAA;EACA,oBAAA;EACA,gBAAA;EACA,qBAAA;EACA,eAAA;EACA,UAAA;EACA,iCAAA;ClBk6ED;AkB/5ED;EACE,sBAAA;EACA,gBAAA;EACA,mBAAA;EACA,kBAAA;ClBi6ED;AkBt5ED;Eb4BE,+BAAA;EACG,4BAAA;EACK,uBAAA;CL63ET;AkBt5ED;;EAEE,gBAAA;EACA,mBAAA;EACA,oBAAA;ClBw5ED;AkBr5ED;EACE,eAAA;ClBu5ED;AkBn5ED;EACE,eAAA;EACA,YAAA;ClBq5ED;AkBj5ED;;EAEE,aAAA;ClBm5ED;AkB/4ED;;;EZvEE,qBAAA;EAEA,2CAAA;EACA,qBAAA;CN09ED;AkB/4ED;EACE,eAAA;EACA,iBAAA;EACA,gBAAA;EACA,wBAAA;EACA,eAAA;ClBi5ED;AkBv3ED;EACE,eAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,wBAAA;EACA,eAAA;EACA,uBAAA;EACA,uBAAA;EACA,uBAAA;EACA,mBAAA;EbxDA,yDAAA;EACQ,iDAAA;EAyHR,uFAAA;EACK,0EAAA;EACG,uEAAA;CL0zET;AmBl8EC;EACE,sBAAA;EACA,WAAA;EdUF,uFAAA;EACQ,+EAAA;CL27ET;AK15EC;EACE,YAAA;EACA,WAAA;CL45EH;AK15EC;EAA0B,YAAA;CL65E3B;AK55EC;EAAgC,YAAA;CL+5EjC;AkBn4EC;EACE,UAAA;EACA,8BAAA;ClBq4EH;AkB73EC;;;EAGE,0BAAA;EACA,WAAA;ClB+3EH;AkB53EC;;EAEE,oBAAA;ClB83EH;AkB13EC;EACE,aAAA;ClB43EH;AkBh3ED;EACE,yBAAA;ClBk3ED;AkB10ED;EAtBI;;;;IACE,kBAAA;GlBs2EH;EkBn2EC;;;;;;;;IAEE,kBAAA;GlB22EH;EkBx2EC;;;;;;;;IAEE,kBAAA;GlBg3EH;CACF;AkBt2ED;EACE,oBAAA;ClBw2ED;AkBh2ED;;EAEE,mBAAA;EACA,eAAA;EACA,iBAAA;EACA,oBAAA;ClBk2ED;AkBv2ED;;EAQI,iBAAA;EACA,mBAAA;EACA,iBAAA;EACA,oBAAA;EACA,gBAAA;ClBm2EH;AkBh2ED;;;;EAIE,mBAAA;EACA,mBAAA;EACA,mBAAA;ClBk2ED;AkB/1ED;;EAEE,iBAAA;ClBi2ED;AkB71ED;;EAEE,mBAAA;EACA,sBAAA;EACA,mBAAA;EACA,iBAAA;EACA,uBAAA;EACA,oBAAA;EACA,gBAAA;ClB+1ED;AkB71ED;;EAEE,cAAA;EACA,kBAAA;ClB+1ED;AkBt1EC;;;;;;EAGE,oBAAA;ClB21EH;AkBr1EC;;;;EAEE,oBAAA;ClBy1EH;AkBn1EC;;;;EAGI,oBAAA;ClBs1EL;AkB30ED;EAEE,iBAAA;EACA,oBAAA;EAEA,iBAAA;EACA,iBAAA;ClB20ED;AkBz0EC;;EAEE,gBAAA;EACA,iBAAA;ClB20EH;AkB9zED;ECnQE,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;CnBokFD;AmBlkFC;EACE,aAAA;EACA,kBAAA;CnBokFH;AmBjkFC;;EAEE,aAAA;CnBmkFH;AkB10ED;EAEI,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;ClB20EH;AkBj1ED;EASI,aAAA;EACA,kBAAA;ClB20EH;AkBr1ED;;EAcI,aAAA;ClB20EH;AkBz1ED;EAiBI,aAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;ClB20EH;AkBv0ED;EC/RE,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;CnBymFD;AmBvmFC;EACE,aAAA;EACA,kBAAA;CnBymFH;AmBtmFC;;EAEE,aAAA;CnBwmFH;AkBn1ED;EAEI,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;ClBo1EH;AkB11ED;EASI,aAAA;EACA,kBAAA;ClBo1EH;AkB91ED;;EAcI,aAAA;ClBo1EH;AkBl2ED;EAiBI,aAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;ClBo1EH;AkB30ED;EAEE,mBAAA;ClB40ED;AkB90ED;EAMI,sBAAA;ClB20EH;AkBv0ED;EACE,mBAAA;EACA,OAAA;EACA,SAAA;EACA,WAAA;EACA,eAAA;EACA,YAAA;EACA,aAAA;EACA,kBAAA;EACA,mBAAA;EACA,qBAAA;ClBy0ED;AkBv0ED;;;EAGE,YAAA;EACA,aAAA;EACA,kBAAA;ClBy0ED;AkBv0ED;;;EAGE,YAAA;EACA,aAAA;EACA,kBAAA;ClBy0ED;AkBr0ED;;;;;;;;;;EC1ZI,eAAA;CnB2uFH;AkBj1ED;ECtZI,sBAAA;Ed+CF,yDAAA;EACQ,iDAAA;CL4rFT;AmB1uFG;EACE,sBAAA;Ed4CJ,0EAAA;EACQ,kEAAA;CLisFT;AkB31ED;EC5YI,eAAA;EACA,sBAAA;EACA,0BAAA;CnB0uFH;AkBh2ED;ECtYI,eAAA;CnByuFH;AkBh2ED;;;;;;;;;;EC7ZI,eAAA;CnBywFH;AkB52ED;ECzZI,sBAAA;Ed+CF,yDAAA;EACQ,iDAAA;CL0tFT;AmBxwFG;EACE,sBAAA;Ed4CJ,0EAAA;EACQ,kEAAA;CL+tFT;AkBt3ED;EC/YI,eAAA;EACA,sBAAA;EACA,0BAAA;CnBwwFH;AkB33ED;ECzYI,eAAA;CnBuwFH;AkB33ED;;;;;;;;;;EChaI,eAAA;CnBuyFH;AkBv4ED;EC5ZI,sBAAA;Ed+CF,yDAAA;EACQ,iDAAA;CLwvFT;AmBtyFG;EACE,sBAAA;Ed4CJ,0EAAA;EACQ,kEAAA;CL6vFT;AkBj5ED;EClZI,eAAA;EACA,sBAAA;EACA,0BAAA;CnBsyFH;AkBt5ED;EC5YI,eAAA;CnBqyFH;AkBl5EC;EACE,UAAA;ClBo5EH;AkBl5EC;EACE,OAAA;ClBo5EH;AkB14ED;EACE,eAAA;EACA,gBAAA;EACA,oBAAA;EACA,eAAA;ClB44ED;AkBzzED;EAwEA;IAtIM,sBAAA;IACA,iBAAA;IACA,uBAAA;GlB23EH;EkBvvEH;IA/HM,sBAAA;IACA,YAAA;IACA,uBAAA;GlBy3EH;EkB5vEH;IAxHM,sBAAA;GlBu3EH;EkB/vEH;IApHM,sBAAA;IACA,uBAAA;GlBs3EH;EkBnwEH;;;IA9GQ,YAAA;GlBs3EL;EkBxwEH;IAxGM,YAAA;GlBm3EH;EkB3wEH;IApGM,iBAAA;IACA,uBAAA;GlBk3EH;EkB/wEH;;IA5FM,sBAAA;IACA,cAAA;IACA,iBAAA;IACA,uBAAA;GlB+2EH;EkBtxEH;;IAtFQ,gBAAA;GlBg3EL;EkB1xEH;;IAjFM,mBAAA;IACA,eAAA;GlB+2EH;EkB/xEH;IA3EM,OAAA;GlB62EH;CACF;AkBn2ED;;;;EASI,cAAA;EACA,iBAAA;EACA,iBAAA;ClBg2EH;AkB32ED;;EAiBI,iBAAA;ClB81EH;AkB/2ED;EJthBE,mBAAA;EACA,oBAAA;Cdw4FD;AkB50EC;EAyBF;IAnCM,kBAAA;IACA,iBAAA;IACA,iBAAA;GlB01EH;CACF;AkB13ED;EAwCI,YAAA;ClBq1EH;AkBv0EC;EAUF;IAdQ,kBAAA;IACA,gBAAA;GlB+0EL;CACF;AkBr0EC;EAEF;IANQ,iBAAA;IACA,gBAAA;GlB60EL;CACF;AoBt6FD;EACE,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,mBAAA;EACA,uBAAA;EACA,+BAAA;MAAA,2BAAA;EACA,gBAAA;EACA,uBAAA;EACA,8BAAA;EACA,oBAAA;EC0CA,kBAAA;EACA,gBAAA;EACA,wBAAA;EACA,mBAAA;EhB+JA,0BAAA;EACG,uBAAA;EACC,sBAAA;EACI,kBAAA;CLiuFT;AoBz6FG;;;;;;EdrBF,qBAAA;EAEA,2CAAA;EACA,qBAAA;CNq8FD;AoB76FC;;;EAGE,YAAA;EACA,sBAAA;CpB+6FH;AoB56FC;;EAEE,WAAA;EACA,uBAAA;Ef2BF,yDAAA;EACQ,iDAAA;CLo5FT;AoB56FC;;;EAGE,oBAAA;EE7CF,cAAA;EAGA,0BAAA;EjB8DA,yBAAA;EACQ,iBAAA;CL65FT;AoB56FG;;EAEE,qBAAA;CpB86FL;AoBr6FD;EC3DE,YAAA;EACA,uBAAA;EACA,mBAAA;CrBm+FD;AqBj+FC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBm+FP;AqBj+FC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBm+FP;AqBj+FC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBm+FP;AqBj+FG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBy+FT;AqBt+FC;;;EAGE,uBAAA;CrBw+FH;AqBn+FG;;;;;;;;;EAGE,uBAAA;EACI,mBAAA;CrB2+FT;AoB19FD;ECZI,YAAA;EACA,uBAAA;CrBy+FH;AoB39FD;EC9DE,YAAA;EACA,0BAAA;EACA,sBAAA;CrB4hGD;AqB1hGC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB4hGP;AqB1hGC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB4hGP;AqB1hGC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB4hGP;AqB1hGG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBkiGT;AqB/hGC;;;EAGE,uBAAA;CrBiiGH;AqB5hGG;;;;;;;;;EAGE,0BAAA;EACI,sBAAA;CrBoiGT;AoBhhGD;ECfI,eAAA;EACA,uBAAA;CrBkiGH;AoBhhGD;EClEE,YAAA;EACA,0BAAA;EACA,sBAAA;CrBqlGD;AqBnlGC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBqlGP;AqBnlGC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBqlGP;AqBnlGC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBqlGP;AqBnlGG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB2lGT;AqBxlGC;;;EAGE,uBAAA;CrB0lGH;AqBrlGG;;;;;;;;;EAGE,0BAAA;EACI,sBAAA;CrB6lGT;AoBrkGD;ECnBI,eAAA;EACA,uBAAA;CrB2lGH;AoBrkGD;ECtEE,YAAA;EACA,0BAAA;EACA,sBAAA;CrB8oGD;AqB5oGC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB8oGP;AqB5oGC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB8oGP;AqB5oGC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB8oGP;AqB5oGG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBopGT;AqBjpGC;;;EAGE,uBAAA;CrBmpGH;AqB9oGG;;;;;;;;;EAGE,0BAAA;EACI,sBAAA;CrBspGT;AoB1nGD;ECvBI,eAAA;EACA,uBAAA;CrBopGH;AoB1nGD;EC1EE,YAAA;EACA,0BAAA;EACA,sBAAA;CrBusGD;AqBrsGC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBusGP;AqBrsGC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBusGP;AqBrsGC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBusGP;AqBrsGG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrB6sGT;AqB1sGC;;;EAGE,uBAAA;CrB4sGH;AqBvsGG;;;;;;;;;EAGE,0BAAA;EACI,sBAAA;CrB+sGT;AoB/qGD;EC3BI,eAAA;EACA,uBAAA;CrB6sGH;AoB/qGD;EC9EE,YAAA;EACA,0BAAA;EACA,sBAAA;CrBgwGD;AqB9vGC;;EAEE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBgwGP;AqB9vGC;EACE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBgwGP;AqB9vGC;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBgwGP;AqB9vGG;;;;;;;;;EAGE,YAAA;EACA,0BAAA;EACI,sBAAA;CrBswGT;AqBnwGC;;;EAGE,uBAAA;CrBqwGH;AqBhwGG;;;;;;;;;EAGE,0BAAA;EACI,sBAAA;CrBwwGT;AoBpuGD;EC/BI,eAAA;EACA,uBAAA;CrBswGH;AoB/tGD;EACE,eAAA;EACA,oBAAA;EACA,iBAAA;CpBiuGD;AoB/tGC;;;;;EAKE,8BAAA;EfnCF,yBAAA;EACQ,iBAAA;CLqwGT;AoBhuGC;;;;EAIE,0BAAA;CpBkuGH;AoBhuGC;;EAEE,eAAA;EACA,2BAAA;EACA,8BAAA;CpBkuGH;AoB9tGG;;;;EAEE,eAAA;EACA,sBAAA;CpBkuGL;AoBztGD;;ECxEE,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;CrBqyGD;AoB5tGD;;EC5EE,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;CrB4yGD;AoB/tGD;;EChFE,iBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;CrBmzGD;AoB9tGD;EACE,eAAA;EACA,YAAA;CpBguGD;AoB5tGD;EACE,gBAAA;CpB8tGD;AoBvtGC;;;EACE,YAAA;CpB2tGH;AuBr3GD;EACE,WAAA;ElBoLA,yCAAA;EACK,oCAAA;EACG,iCAAA;CLosGT;AuBx3GC;EACE,WAAA;CvB03GH;AuBt3GD;EACE,cAAA;CvBw3GD;AuBt3GC;EAAY,eAAA;CvBy3Gb;AuBx3GC;EAAY,mBAAA;CvB23Gb;AuB13GC;EAAY,yBAAA;CvB63Gb;AuB13GD;EACE,mBAAA;EACA,UAAA;EACA,iBAAA;ElBuKA,gDAAA;EACQ,2CAAA;KAAA,wCAAA;EAOR,mCAAA;EACQ,8BAAA;KAAA,2BAAA;EAGR,yCAAA;EACQ,oCAAA;KAAA,iCAAA;CL8sGT;AwBx5GD;EACE,sBAAA;EACA,SAAA;EACA,UAAA;EACA,iBAAA;EACA,uBAAA;EACA,uBAAA;EACA,yBAAA;EACA,oCAAA;EACA,mCAAA;CxB05GD;AwBt5GD;;EAEE,mBAAA;CxBw5GD;AwBp5GD;EACE,WAAA;CxBs5GD;AwBl5GD;EACE,mBAAA;EACA,UAAA;EACA,QAAA;EACA,cAAA;EACA,cAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,iBAAA;EACA,uBAAA;EACA,uBAAA;EACA,sCAAA;EACA,mBAAA;EnBsBA,oDAAA;EACQ,4CAAA;EmBrBR,qCAAA;UAAA,6BAAA;CxBq5GD;AwBh5GC;EACE,SAAA;EACA,WAAA;CxBk5GH;AwB36GD;ECzBE,YAAA;EACA,cAAA;EACA,iBAAA;EACA,0BAAA;CzBu8GD;AwBj7GD;EAmCI,eAAA;EACA,kBAAA;EACA,YAAA;EACA,oBAAA;EACA,wBAAA;EACA,eAAA;EACA,oBAAA;CxBi5GH;AwB34GC;;EAEE,sBAAA;EACA,eAAA;EACA,0BAAA;CxB64GH;AwBv4GC;;;EAGE,YAAA;EACA,sBAAA;EACA,WAAA;EACA,0BAAA;CxBy4GH;AwBh4GC;;;EAGE,eAAA;CxBk4GH;AwB93GC;;EAEE,sBAAA;EACA,8BAAA;EACA,uBAAA;EE3GF,oEAAA;EF6GE,oBAAA;CxBg4GH;AwB33GD;EAGI,eAAA;CxB23GH;AwB93GD;EAQI,WAAA;CxBy3GH;AwBj3GD;EACE,WAAA;EACA,SAAA;CxBm3GD;AwB32GD;EACE,QAAA;EACA,YAAA;CxB62GD;AwBz2GD;EACE,eAAA;EACA,kBAAA;EACA,gBAAA;EACA,wBAAA;EACA,eAAA;EACA,oBAAA;CxB22GD;AwBv2GD;EACE,gBAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,OAAA;EACA,aAAA;CxBy2GD;AwBr2GD;EACE,SAAA;EACA,WAAA;CxBu2GD;AwB/1GD;;EAII,cAAA;EACA,0BAAA;EACA,4BAAA;EACA,YAAA;CxB+1GH;AwBt2GD;;EAWI,UAAA;EACA,aAAA;EACA,mBAAA;CxB+1GH;AwB10GD;EAXE;IApEA,WAAA;IACA,SAAA;GxB65GC;EwB11GD;IA1DA,QAAA;IACA,YAAA;GxBu5GC;CACF;A2BviHD;;EAEE,mBAAA;EACA,sBAAA;EACA,uBAAA;C3ByiHD;A2B7iHD;;EAMI,mBAAA;EACA,YAAA;C3B2iHH;A2BziHG;;;;;;;;EAIE,WAAA;C3B+iHL;A2BziHD;;;;EAKI,kBAAA;C3B0iHH;A2BriHD;EACE,kBAAA;C3BuiHD;A2BxiHD;;;EAOI,YAAA;C3BsiHH;A2B7iHD;;;EAYI,iBAAA;C3BsiHH;A2BliHD;EACE,iBAAA;C3BoiHD;A2BhiHD;EACE,eAAA;C3BkiHD;A2BjiHC;EClDA,8BAAA;EACG,2BAAA;C5BslHJ;A2BhiHD;;EC/CE,6BAAA;EACG,0BAAA;C5BmlHJ;A2B/hHD;EACE,YAAA;C3BiiHD;A2B/hHD;EACE,iBAAA;C3BiiHD;A2B/hHD;;ECnEE,8BAAA;EACG,2BAAA;C5BsmHJ;A2B9hHD;ECjEE,6BAAA;EACG,0BAAA;C5BkmHJ;A2B7hHD;;EAEE,WAAA;C3B+hHD;A2B9gHD;EACE,kBAAA;EACA,mBAAA;C3BghHD;A2B9gHD;EACE,mBAAA;EACA,oBAAA;C3BghHD;A2B3gHD;EtB/CE,yDAAA;EACQ,iDAAA;CL6jHT;A2B3gHC;EtBnDA,yBAAA;EACQ,iBAAA;CLikHT;A2BxgHD;EACE,eAAA;C3B0gHD;A2BvgHD;EACE,wBAAA;EACA,uBAAA;C3BygHD;A2BtgHD;EACE,wBAAA;C3BwgHD;A2BjgHD;;;EAII,eAAA;EACA,YAAA;EACA,YAAA;EACA,gBAAA;C3BkgHH;A2BzgHD;EAcM,YAAA;C3B8/GL;A2B5gHD;;;;EAsBI,iBAAA;EACA,eAAA;C3B4/GH;A2Bv/GC;EACE,iBAAA;C3By/GH;A2Bv/GC;EC3KA,6BAAA;EACC,4BAAA;EAOD,8BAAA;EACC,6BAAA;C5B+pHF;A2Bz/GC;EC/KA,2BAAA;EACC,0BAAA;EAOD,gCAAA;EACC,+BAAA;C5BqqHF;A2B1/GD;EACE,iBAAA;C3B4/GD;A2B1/GD;;EC/KE,8BAAA;EACC,6BAAA;C5B6qHF;A2Bz/GD;EC7LE,2BAAA;EACC,0BAAA;C5ByrHF;A2Br/GD;EACE,eAAA;EACA,YAAA;EACA,oBAAA;EACA,0BAAA;C3Bu/GD;A2B3/GD;;EAOI,YAAA;EACA,oBAAA;EACA,UAAA;C3Bw/GH;A2BjgHD;EAYI,YAAA;C3Bw/GH;A2BpgHD;EAgBI,WAAA;C3Bu/GH;A2Bt+GD;;;;EAKM,mBAAA;EACA,uBAAA;EACA,qBAAA;C3Bu+GL;A6BjtHD;EACE,mBAAA;EACA,eAAA;EACA,0BAAA;C7BmtHD;A6BhtHC;EACE,YAAA;EACA,gBAAA;EACA,iBAAA;C7BktHH;A6B3tHD;EAeI,mBAAA;EACA,WAAA;EAKA,YAAA;EAEA,YAAA;EACA,iBAAA;C7B0sHH;A6BxsHG;EACE,WAAA;C7B0sHL;A6BhsHD;;;EV0BE,aAAA;EACA,mBAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;CnB2qHD;AmBzqHC;;;EACE,aAAA;EACA,kBAAA;CnB6qHH;AmB1qHC;;;;;;EAEE,aAAA;CnBgrHH;A6BltHD;;;EVqBE,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;CnBksHD;AmBhsHC;;;EACE,aAAA;EACA,kBAAA;CnBosHH;AmBjsHC;;;;;;EAEE,aAAA;CnBusHH;A6BhuHD;;;EAGE,oBAAA;C7BkuHD;A6BhuHC;;;EACE,iBAAA;C7BouHH;A6BhuHD;;EAEE,UAAA;EACA,oBAAA;EACA,uBAAA;C7BkuHD;A6B7tHD;EACE,kBAAA;EACA,gBAAA;EACA,oBAAA;EACA,eAAA;EACA,eAAA;EACA,mBAAA;EACA,0BAAA;EACA,uBAAA;EACA,mBAAA;C7B+tHD;A6B5tHC;EACE,kBAAA;EACA,gBAAA;EACA,mBAAA;C7B8tHH;A6B5tHC;EACE,mBAAA;EACA,gBAAA;EACA,mBAAA;C7B8tHH;A6BlvHD;;EA0BI,cAAA;C7B4tHH;A6BvtHD;;;;;;;EDpGE,8BAAA;EACG,2BAAA;C5Bo0HJ;A6BxtHD;EACE,gBAAA;C7B0tHD;A6BxtHD;;;;;;;EDxGE,6BAAA;EACG,0BAAA;C5By0HJ;A6BztHD;EACE,eAAA;C7B2tHD;A6BttHD;EACE,mBAAA;EAGA,aAAA;EACA,oBAAA;C7BstHD;A6B3tHD;EAUI,mBAAA;C7BotHH;A6B9tHD;EAYM,kBAAA;C7BqtHL;A6BltHG;;;EAGE,WAAA;C7BotHL;A6B/sHC;;EAGI,mBAAA;C7BgtHL;A6B7sHC;;EAGI,WAAA;EACA,kBAAA;C7B8sHL;A8B72HD;EACE,iBAAA;EACA,gBAAA;EACA,iBAAA;C9B+2HD;A8Bl3HD;EAOI,mBAAA;EACA,eAAA;C9B82HH;A8Bt3HD;EAWM,mBAAA;EACA,eAAA;EACA,mBAAA;C9B82HL;A8B72HK;;EAEE,sBAAA;EACA,0BAAA;C9B+2HP;A8B12HG;EACE,eAAA;C9B42HL;A8B12HK;;EAEE,eAAA;EACA,sBAAA;EACA,8BAAA;EACA,oBAAA;C9B42HP;A8Br2HG;;;EAGE,0BAAA;EACA,sBAAA;C9Bu2HL;A8Bh5HD;ELHE,YAAA;EACA,cAAA;EACA,iBAAA;EACA,0BAAA;CzBs5HD;A8Bt5HD;EA0DI,gBAAA;C9B+1HH;A8Bt1HD;EACE,8BAAA;C9Bw1HD;A8Bz1HD;EAGI,YAAA;EAEA,oBAAA;C9Bw1HH;A8B71HD;EASM,kBAAA;EACA,wBAAA;EACA,8BAAA;EACA,2BAAA;C9Bu1HL;A8Bt1HK;EACE,mCAAA;C9Bw1HP;A8Bl1HK;;;EAGE,eAAA;EACA,uBAAA;EACA,uBAAA;EACA,iCAAA;EACA,gBAAA;C9Bo1HP;A8B/0HC;EAqDA,YAAA;EA8BA,iBAAA;C9BgwHD;A8Bn1HC;EAwDE,YAAA;C9B8xHH;A8Bt1HC;EA0DI,mBAAA;EACA,mBAAA;C9B+xHL;A8B11HC;EAgEE,UAAA;EACA,WAAA;C9B6xHH;A8BjxHD;EA0DA;IAjEM,oBAAA;IACA,UAAA;G9B4xHH;E8B5tHH;IA9DQ,iBAAA;G9B6xHL;CACF;A8Bv2HC;EAuFE,gBAAA;EACA,mBAAA;C9BmxHH;A8B32HC;;;EA8FE,uBAAA;C9BkxHH;A8BpwHD;EA2BA;IApCM,8BAAA;IACA,2BAAA;G9BixHH;E8B9uHH;;;IA9BM,0BAAA;G9BixHH;CACF;A8Bl3HD;EAEI,YAAA;C9Bm3HH;A8Br3HD;EAMM,mBAAA;C9Bk3HL;A8Bx3HD;EASM,iBAAA;C9Bk3HL;A8B72HK;;;EAGE,YAAA;EACA,0BAAA;C9B+2HP;A8Bv2HD;EAEI,YAAA;C9Bw2HH;A8B12HD;EAIM,gBAAA;EACA,eAAA;C9By2HL;A8B71HD;EACE,YAAA;C9B+1HD;A8Bh2HD;EAII,YAAA;C9B+1HH;A8Bn2HD;EAMM,mBAAA;EACA,mBAAA;C9Bg2HL;A8Bv2HD;EAYI,UAAA;EACA,WAAA;C9B81HH;A8Bl1HD;EA0DA;IAjEM,oBAAA;IACA,UAAA;G9B61HH;E8B7xHH;IA9DQ,iBAAA;G9B81HL;CACF;A8Bt1HD;EACE,iBAAA;C9Bw1HD;A8Bz1HD;EAKI,gBAAA;EACA,mBAAA;C9Bu1HH;A8B71HD;;;EAYI,uBAAA;C9Bs1HH;A8Bx0HD;EA2BA;IApCM,8BAAA;IACA,2BAAA;G9Bq1HH;E8BlzHH;;;IA9BM,0BAAA;G9Bq1HH;CACF;A8B50HD;EAEI,cAAA;C9B60HH;A8B/0HD;EAKI,eAAA;C9B60HH;A8Bp0HD;EAEE,iBAAA;EF3OA,2BAAA;EACC,0BAAA;C5BijIF;A+B3iID;EACE,mBAAA;EACA,iBAAA;EACA,oBAAA;EACA,8BAAA;C/B6iID;A+BriID;EA8nBA;IAhoBI,mBAAA;G/B2iID;CACF;A+B5hID;EAgnBA;IAlnBI,YAAA;G/BkiID;CACF;A+BphID;EACE,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,kCAAA;EACA,2DAAA;UAAA,mDAAA;EAEA,kCAAA;C/BqhID;A+BnhIC;EACE,iBAAA;C/BqhIH;A+Bz/HD;EA6jBA;IArlBI,YAAA;IACA,cAAA;IACA,yBAAA;YAAA,iBAAA;G/BqhID;E+BnhIC;IACE,0BAAA;IACA,wBAAA;IACA,kBAAA;IACA,6BAAA;G/BqhIH;E+BlhIC;IACE,oBAAA;G/BohIH;E+B/gIC;;;IAGE,gBAAA;IACA,iBAAA;G/BihIH;CACF;A+B7gID;;EAGI,kBAAA;C/B8gIH;A+BzgIC;EAmjBF;;IArjBM,kBAAA;G/BghIH;CACF;A+BvgID;;;;EAII,oBAAA;EACA,mBAAA;C/BygIH;A+BngIC;EAgiBF;;;;IAniBM,gBAAA;IACA,eAAA;G/B6gIH;CACF;A+BjgID;EACE,cAAA;EACA,sBAAA;C/BmgID;A+B9/HD;EA8gBA;IAhhBI,iBAAA;G/BogID;CACF;A+BhgID;;EAEE,gBAAA;EACA,SAAA;EACA,QAAA;EACA,cAAA;C/BkgID;A+B5/HD;EAggBA;;IAlgBI,iBAAA;G/BmgID;CACF;A+BjgID;EACE,OAAA;EACA,sBAAA;C/BmgID;A+BjgID;EACE,UAAA;EACA,iBAAA;EACA,sBAAA;C/BmgID;A+B7/HD;EACE,YAAA;EACA,mBAAA;EACA,gBAAA;EACA,kBAAA;EACA,aAAA;C/B+/HD;A+B7/HC;;EAEE,sBAAA;C/B+/HH;A+BxgID;EAaI,eAAA;C/B8/HH;A+Br/HD;EALI;;IAEE,mBAAA;G/B6/HH;CACF;A+Bn/HD;EACE,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;EC9LA,gBAAA;EACA,mBAAA;ED+LA,8BAAA;EACA,uBAAA;EACA,8BAAA;EACA,mBAAA;C/Bs/HD;A+Bl/HC;EACE,WAAA;C/Bo/HH;A+BlgID;EAmBI,eAAA;EACA,YAAA;EACA,YAAA;EACA,mBAAA;C/Bk/HH;A+BxgID;EAyBI,gBAAA;C/Bk/HH;A+B5+HD;EAqbA;IAvbI,cAAA;G/Bk/HD;CACF;A+Bz+HD;EACE,oBAAA;C/B2+HD;A+B5+HD;EAII,kBAAA;EACA,qBAAA;EACA,kBAAA;C/B2+HH;A+B/8HC;EA2YF;IAjaM,iBAAA;IACA,YAAA;IACA,YAAA;IACA,cAAA;IACA,8BAAA;IACA,UAAA;IACA,yBAAA;YAAA,iBAAA;G/By+HH;E+B9kHH;;IAxZQ,2BAAA;G/B0+HL;E+BllHH;IArZQ,kBAAA;G/B0+HL;E+Bz+HK;;IAEE,uBAAA;G/B2+HP;CACF;A+Bz9HD;EA+XA;IA1YI,YAAA;IACA,UAAA;G/Bw+HD;E+B/lHH;IAtYM,YAAA;G/Bw+HH;E+BlmHH;IApYQ,kBAAA;IACA,qBAAA;G/By+HL;CACF;A+B99HD;EACE,mBAAA;EACA,oBAAA;EACA,mBAAA;EACA,kCAAA;EACA,qCAAA;E1B9NA,6FAAA;EACQ,qFAAA;E2B/DR,gBAAA;EACA,mBAAA;ChC+vID;AkBzuHD;EAwEA;IAtIM,sBAAA;IACA,iBAAA;IACA,uBAAA;GlB2yHH;EkBvqHH;IA/HM,sBAAA;IACA,YAAA;IACA,uBAAA;GlByyHH;EkB5qHH;IAxHM,sBAAA;GlBuyHH;EkB/qHH;IApHM,sBAAA;IACA,uBAAA;GlBsyHH;EkBnrHH;;;IA9GQ,YAAA;GlBsyHL;EkBxrHH;IAxGM,YAAA;GlBmyHH;EkB3rHH;IApGM,iBAAA;IACA,uBAAA;GlBkyHH;EkB/rHH;;IA5FM,sBAAA;IACA,cAAA;IACA,iBAAA;IACA,uBAAA;GlB+xHH;EkBtsHH;;IAtFQ,gBAAA;GlBgyHL;EkB1sHH;;IAjFM,mBAAA;IACA,eAAA;GlB+xHH;EkB/sHH;IA3EM,OAAA;GlB6xHH;CACF;A+BvgIC;EAmWF;IAzWM,mBAAA;G/BihIH;E+B/gIG;IACE,iBAAA;G/BihIL;CACF;A+BhgID;EAoVA;IA5VI,YAAA;IACA,UAAA;IACA,eAAA;IACA,gBAAA;IACA,eAAA;IACA,kBAAA;I1BzPF,yBAAA;IACQ,iBAAA;GLswIP;CACF;A+BtgID;EACE,cAAA;EHpUA,2BAAA;EACC,0BAAA;C5B60IF;A+BtgID;EACE,iBAAA;EHzUA,6BAAA;EACC,4BAAA;EAOD,8BAAA;EACC,6BAAA;C5B40IF;A+BlgID;EChVE,gBAAA;EACA,mBAAA;ChCq1ID;A+BngIC;ECnVA,iBAAA;EACA,oBAAA;ChCy1ID;A+BpgIC;ECtVA,iBAAA;EACA,oBAAA;ChC61ID;A+B9/HD;EChWE,iBAAA;EACA,oBAAA;ChCi2ID;A+B1/HD;EAsSA;IA1SI,YAAA;IACA,kBAAA;IACA,mBAAA;G/BkgID;CACF;A+Br+HD;EAhBE;IExWA,uBAAA;GjCi2IC;E+Bx/HD;IE5WA,wBAAA;IF8WE,oBAAA;G/B0/HD;E+B5/HD;IAKI,gBAAA;G/B0/HH;CACF;A+Bj/HD;EACE,0BAAA;EACA,sBAAA;C/Bm/HD;A+Br/HD;EAKI,YAAA;C/Bm/HH;A+Bl/HG;;EAEE,eAAA;EACA,8BAAA;C/Bo/HL;A+B7/HD;EAcI,YAAA;C/Bk/HH;A+BhgID;EAmBM,YAAA;C/Bg/HL;A+B9+HK;;EAEE,YAAA;EACA,8BAAA;C/Bg/HP;A+B5+HK;;;EAGE,YAAA;EACA,0BAAA;C/B8+HP;A+B1+HK;;;EAGE,YAAA;EACA,8BAAA;C/B4+HP;A+BphID;EA8CI,mBAAA;C/By+HH;A+Bx+HG;;EAEE,uBAAA;C/B0+HL;A+B3hID;EAoDM,uBAAA;C/B0+HL;A+B9hID;;EA0DI,sBAAA;C/Bw+HH;A+Bj+HK;;;EAGE,0BAAA;EACA,YAAA;C/Bm+HP;A+Bl8HC;EAoKF;IA7LU,YAAA;G/B+9HP;E+B99HO;;IAEE,YAAA;IACA,8BAAA;G/Bg+HT;E+B59HO;;;IAGE,YAAA;IACA,0BAAA;G/B89HT;E+B19HO;;;IAGE,YAAA;IACA,8BAAA;G/B49HT;CACF;A+B9jID;EA8GI,YAAA;C/Bm9HH;A+Bl9HG;EACE,YAAA;C/Bo9HL;A+BpkID;EAqHI,YAAA;C/Bk9HH;A+Bj9HG;;EAEE,YAAA;C/Bm9HL;A+B/8HK;;;;EAEE,YAAA;C/Bm9HP;A+B38HD;EACE,uBAAA;EACA,sBAAA;C/B68HD;A+B/8HD;EAKI,eAAA;C/B68HH;A+B58HG;;EAEE,YAAA;EACA,8BAAA;C/B88HL;A+Bv9HD;EAcI,eAAA;C/B48HH;A+B19HD;EAmBM,eAAA;C/B08HL;A+Bx8HK;;EAEE,YAAA;EACA,8BAAA;C/B08HP;A+Bt8HK;;;EAGE,YAAA;EACA,0BAAA;C/Bw8HP;A+Bp8HK;;;EAGE,YAAA;EACA,8BAAA;C/Bs8HP;A+B9+HD;EA+CI,mBAAA;C/Bk8HH;A+Bj8HG;;EAEE,uBAAA;C/Bm8HL;A+Br/HD;EAqDM,uBAAA;C/Bm8HL;A+Bx/HD;;EA2DI,sBAAA;C/Bi8HH;A+B37HK;;;EAGE,0BAAA;EACA,YAAA;C/B67HP;A+Bt5HC;EAwBF;IAvDU,sBAAA;G/By7HP;E+Bl4HH;IApDU,0BAAA;G/By7HP;E+Br4HH;IAjDU,eAAA;G/By7HP;E+Bx7HO;;IAEE,YAAA;IACA,8BAAA;G/B07HT;E+Bt7HO;;;IAGE,YAAA;IACA,0BAAA;G/Bw7HT;E+Bp7HO;;;IAGE,YAAA;IACA,8BAAA;G/Bs7HT;CACF;A+B9hID;EA+GI,eAAA;C/Bk7HH;A+Bj7HG;EACE,YAAA;C/Bm7HL;A+BpiID;EAsHI,eAAA;C/Bi7HH;A+Bh7HG;;EAEE,YAAA;C/Bk7HL;A+B96HK;;;;EAEE,YAAA;C/Bk7HP;AkC5jJD;EACE,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,0BAAA;EACA,mBAAA;ClC8jJD;AkCnkJD;EAQI,sBAAA;ClC8jJH;AkCtkJD;EAWM,kBAAA;EACA,eAAA;EACA,YAAA;ClC8jJL;AkC3kJD;EAkBI,eAAA;ClC4jJH;AmChlJD;EACE,sBAAA;EACA,gBAAA;EACA,eAAA;EACA,mBAAA;CnCklJD;AmCtlJD;EAOI,gBAAA;CnCklJH;AmCzlJD;;EAUM,mBAAA;EACA,YAAA;EACA,kBAAA;EACA,wBAAA;EACA,sBAAA;EACA,eAAA;EACA,uBAAA;EACA,uBAAA;EACA,kBAAA;CnCmlJL;AmCjlJG;;EAGI,eAAA;EPXN,+BAAA;EACG,4BAAA;C5B8lJJ;AmChlJG;;EPvBF,gCAAA;EACG,6BAAA;C5B2mJJ;AmC3kJG;;;;EAEE,WAAA;EACA,eAAA;EACA,0BAAA;EACA,mBAAA;CnC+kJL;AmCzkJG;;;;;;EAGE,WAAA;EACA,YAAA;EACA,0BAAA;EACA,sBAAA;EACA,gBAAA;CnC8kJL;AmCroJD;;;;;;EAkEM,eAAA;EACA,uBAAA;EACA,mBAAA;EACA,oBAAA;CnC2kJL;AmClkJD;;EC3EM,mBAAA;EACA,gBAAA;EACA,uBAAA;CpCipJL;AoC/oJG;;ERKF,+BAAA;EACG,4BAAA;C5B8oJJ;AoC9oJG;;ERTF,gCAAA;EACG,6BAAA;C5B2pJJ;AmC7kJD;;EChFM,kBAAA;EACA,gBAAA;EACA,iBAAA;CpCiqJL;AoC/pJG;;ERKF,+BAAA;EACG,4BAAA;C5B8pJJ;AoC9pJG;;ERTF,gCAAA;EACG,6BAAA;C5B2qJJ;AqC9qJD;EACE,gBAAA;EACA,eAAA;EACA,iBAAA;EACA,mBAAA;CrCgrJD;AqCprJD;EAOI,gBAAA;CrCgrJH;AqCvrJD;;EAUM,sBAAA;EACA,kBAAA;EACA,uBAAA;EACA,uBAAA;EACA,oBAAA;CrCirJL;AqC/rJD;;EAmBM,sBAAA;EACA,0BAAA;CrCgrJL;AqCpsJD;;EA2BM,aAAA;CrC6qJL;AqCxsJD;;EAkCM,YAAA;CrC0qJL;AqC5sJD;;;;EA2CM,eAAA;EACA,uBAAA;EACA,oBAAA;CrCuqJL;AsCrtJD;EACE,gBAAA;EACA,wBAAA;EACA,eAAA;EACA,kBAAA;EACA,eAAA;EACA,YAAA;EACA,mBAAA;EACA,oBAAA;EACA,yBAAA;EACA,qBAAA;CtCutJD;AsCntJG;;EAEE,YAAA;EACA,sBAAA;EACA,gBAAA;CtCqtJL;AsChtJC;EACE,cAAA;CtCktJH;AsC9sJC;EACE,mBAAA;EACA,UAAA;CtCgtJH;AsCzsJD;ECtCE,0BAAA;CvCkvJD;AuC/uJG;;EAEE,0BAAA;CvCivJL;AsC5sJD;EC1CE,0BAAA;CvCyvJD;AuCtvJG;;EAEE,0BAAA;CvCwvJL;AsC/sJD;EC9CE,0BAAA;CvCgwJD;AuC7vJG;;EAEE,0BAAA;CvC+vJL;AsCltJD;EClDE,0BAAA;CvCuwJD;AuCpwJG;;EAEE,0BAAA;CvCswJL;AsCrtJD;ECtDE,0BAAA;CvC8wJD;AuC3wJG;;EAEE,0BAAA;CvC6wJL;AsCxtJD;EC1DE,0BAAA;CvCqxJD;AuClxJG;;EAEE,0BAAA;CvCoxJL;AwCtxJD;EACE,sBAAA;EACA,gBAAA;EACA,iBAAA;EACA,gBAAA;EACA,kBAAA;EACA,YAAA;EACA,eAAA;EACA,uBAAA;EACA,oBAAA;EACA,mBAAA;EACA,0BAAA;EACA,oBAAA;CxCwxJD;AwCrxJC;EACE,cAAA;CxCuxJH;AwCnxJC;EACE,mBAAA;EACA,UAAA;CxCqxJH;AwClxJC;;EAEE,OAAA;EACA,iBAAA;CxCoxJH;AwC/wJG;;EAEE,YAAA;EACA,sBAAA;EACA,gBAAA;CxCixJL;AwC5wJC;;EAEE,eAAA;EACA,uBAAA;CxC8wJH;AwC3wJC;EACE,aAAA;CxC6wJH;AwC1wJC;EACE,kBAAA;CxC4wJH;AwCzwJC;EACE,iBAAA;CxC2wJH;AyCr0JD;EACE,kBAAA;EACA,qBAAA;EACA,oBAAA;EACA,eAAA;EACA,0BAAA;CzCu0JD;AyC50JD;;EASI,eAAA;CzCu0JH;AyCh1JD;EAaI,oBAAA;EACA,gBAAA;EACA,iBAAA;CzCs0JH;AyCr1JD;EAmBI,0BAAA;CzCq0JH;AyCl0JC;;EAEE,mBAAA;EACA,mBAAA;EACA,oBAAA;CzCo0JH;AyC91JD;EA8BI,gBAAA;CzCm0JH;AyCjzJD;EACA;IAfI,kBAAA;IACA,qBAAA;GzCm0JD;EyCj0JC;;IAEE,mBAAA;IACA,oBAAA;GzCm0JH;EyC1zJH;;IAJM,gBAAA;GzCk0JH;CACF;A0C/2JD;EACE,eAAA;EACA,aAAA;EACA,oBAAA;EACA,wBAAA;EACA,uBAAA;EACA,uBAAA;EACA,mBAAA;ErCiLA,4CAAA;EACK,uCAAA;EACG,oCAAA;CLisJT;A0C33JD;;EAaI,kBAAA;EACA,mBAAA;C1Ck3JH;A0C92JC;;;EAGE,sBAAA;C1Cg3JH;A0Cr4JD;EA0BI,aAAA;EACA,eAAA;C1C82JH;A2Cv4JD;EACE,cAAA;EACA,oBAAA;EACA,8BAAA;EACA,mBAAA;C3Cy4JD;A2C74JD;EAQI,cAAA;EAEA,eAAA;C3Cu4JH;A2Cj5JD;EAeI,kBAAA;C3Cq4JH;A2Cp5JD;;EAqBI,iBAAA;C3Cm4JH;A2Cx5JD;EAyBI,gBAAA;C3Ck4JH;A2C13JD;;EAEE,oBAAA;C3C43JD;A2C93JD;;EAMI,mBAAA;EACA,UAAA;EACA,aAAA;EACA,eAAA;C3C43JH;A2Cp3JD;ECvDE,0BAAA;EACA,sBAAA;EACA,eAAA;C5C86JD;A2Cz3JD;EClDI,0BAAA;C5C86JH;A2C53JD;EC/CI,eAAA;C5C86JH;A2C33JD;EC3DE,0BAAA;EACA,sBAAA;EACA,eAAA;C5Cy7JD;A2Ch4JD;ECtDI,0BAAA;C5Cy7JH;A2Cn4JD;ECnDI,eAAA;C5Cy7JH;A2Cl4JD;EC/DE,0BAAA;EACA,sBAAA;EACA,eAAA;C5Co8JD;A2Cv4JD;EC1DI,0BAAA;C5Co8JH;A2C14JD;ECvDI,eAAA;C5Co8JH;A2Cz4JD;ECnEE,0BAAA;EACA,sBAAA;EACA,eAAA;C5C+8JD;A2C94JD;EC9DI,0BAAA;C5C+8JH;A2Cj5JD;EC3DI,eAAA;C5C+8JH;A6Cj9JD;EACE;IAAQ,4BAAA;G7Co9JP;E6Cn9JD;IAAQ,yBAAA;G7Cs9JP;CACF;A6Cn9JD;EACE;IAAQ,4BAAA;G7Cs9JP;E6Cr9JD;IAAQ,yBAAA;G7Cw9JP;CACF;A6C39JD;EACE;IAAQ,4BAAA;G7Cs9JP;E6Cr9JD;IAAQ,yBAAA;G7Cw9JP;CACF;A6Cj9JD;EACE,iBAAA;EACA,aAAA;EACA,oBAAA;EACA,0BAAA;EACA,mBAAA;ExCsCA,uDAAA;EACQ,+CAAA;CL86JT;A6Ch9JD;EACE,YAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,YAAA;EACA,mBAAA;EACA,0BAAA;ExCyBA,uDAAA;EACQ,+CAAA;EAyHR,oCAAA;EACK,+BAAA;EACG,4BAAA;CLk0JT;A6C78JD;;ECCI,8MAAA;EACA,yMAAA;EACA,sMAAA;EDAF,mCAAA;UAAA,2BAAA;C7Ci9JD;A6C18JD;;ExC5CE,2DAAA;EACK,sDAAA;EACG,mDAAA;CL0/JT;A6Cv8JD;EErEE,0BAAA;C/C+gKD;A+C5gKC;EDgDE,8MAAA;EACA,yMAAA;EACA,sMAAA;C9C+9JH;A6C38JD;EEzEE,0BAAA;C/CuhKD;A+CphKC;EDgDE,8MAAA;EACA,yMAAA;EACA,sMAAA;C9Cu+JH;A6C/8JD;EE7EE,0BAAA;C/C+hKD;A+C5hKC;EDgDE,8MAAA;EACA,yMAAA;EACA,sMAAA;C9C++JH;A6Cn9JD;EEjFE,0BAAA;C/CuiKD;A+CpiKC;EDgDE,8MAAA;EACA,yMAAA;EACA,sMAAA;C9Cu/JH;AgD/iKD;EAEE,iBAAA;ChDgjKD;AgD9iKC;EACE,cAAA;ChDgjKH;AgD5iKD;;EAEE,QAAA;EACA,iBAAA;ChD8iKD;AgD3iKD;EACE,eAAA;ChD6iKD;AgD1iKD;EACE,eAAA;ChD4iKD;AgDziKC;EACE,gBAAA;ChD2iKH;AgDviKD;;EAEE,mBAAA;ChDyiKD;AgDtiKD;;EAEE,oBAAA;ChDwiKD;AgDriKD;;;EAGE,oBAAA;EACA,oBAAA;ChDuiKD;AgDpiKD;EACE,uBAAA;ChDsiKD;AgDniKD;EACE,uBAAA;ChDqiKD;AgDjiKD;EACE,cAAA;EACA,mBAAA;ChDmiKD;AgD7hKD;EACE,gBAAA;EACA,iBAAA;ChD+hKD;AiDtlKD;EAEE,oBAAA;EACA,gBAAA;CjDulKD;AiD/kKD;EACE,mBAAA;EACA,eAAA;EACA,mBAAA;EAEA,oBAAA;EACA,uBAAA;EACA,uBAAA;CjDglKD;AiD7kKC;ErB3BA,6BAAA;EACC,4BAAA;C5B2mKF;AiD9kKC;EACE,iBAAA;ErBvBF,gCAAA;EACC,+BAAA;C5BwmKF;AiDvkKD;;EAEE,YAAA;CjDykKD;AiD3kKD;;EAKI,YAAA;CjD0kKH;AiDtkKC;;;;EAEE,sBAAA;EACA,YAAA;EACA,0BAAA;CjD0kKH;AiDtkKD;EACE,YAAA;EACA,iBAAA;CjDwkKD;AiDnkKC;;;EAGE,0BAAA;EACA,eAAA;EACA,oBAAA;CjDqkKH;AiD1kKC;;;EASI,eAAA;CjDskKL;AiD/kKC;;;EAYI,eAAA;CjDwkKL;AiDnkKC;;;EAGE,WAAA;EACA,YAAA;EACA,0BAAA;EACA,sBAAA;CjDqkKH;AiD3kKC;;;;;;;;;EAYI,eAAA;CjD0kKL;AiDtlKC;;;EAeI,eAAA;CjD4kKL;AkD9qKC;EACE,eAAA;EACA,0BAAA;ClDgrKH;AkD9qKG;;EAEE,eAAA;ClDgrKL;AkDlrKG;;EAKI,eAAA;ClDirKP;AkD9qKK;;;;EAEE,eAAA;EACA,0BAAA;ClDkrKP;AkDhrKK;;;;;;EAGE,YAAA;EACA,0BAAA;EACA,sBAAA;ClDqrKP;AkD3sKC;EACE,eAAA;EACA,0BAAA;ClD6sKH;AkD3sKG;;EAEE,eAAA;ClD6sKL;AkD/sKG;;EAKI,eAAA;ClD8sKP;AkD3sKK;;;;EAEE,eAAA;EACA,0BAAA;ClD+sKP;AkD7sKK;;;;;;EAGE,YAAA;EACA,0BAAA;EACA,sBAAA;ClDktKP;AkDxuKC;EACE,eAAA;EACA,0BAAA;ClD0uKH;AkDxuKG;;EAEE,eAAA;ClD0uKL;AkD5uKG;;EAKI,eAAA;ClD2uKP;AkDxuKK;;;;EAEE,eAAA;EACA,0BAAA;ClD4uKP;AkD1uKK;;;;;;EAGE,YAAA;EACA,0BAAA;EACA,sBAAA;ClD+uKP;AkDrwKC;EACE,eAAA;EACA,0BAAA;ClDuwKH;AkDrwKG;;EAEE,eAAA;ClDuwKL;AkDzwKG;;EAKI,eAAA;ClDwwKP;AkDrwKK;;;;EAEE,eAAA;EACA,0BAAA;ClDywKP;AkDvwKK;;;;;;EAGE,YAAA;EACA,0BAAA;EACA,sBAAA;ClD4wKP;AiD3qKD;EACE,cAAA;EACA,mBAAA;CjD6qKD;AiD3qKD;EACE,iBAAA;EACA,iBAAA;CjD6qKD;AmDvyKD;EACE,oBAAA;EACA,uBAAA;EACA,8BAAA;EACA,mBAAA;E9C0DA,kDAAA;EACQ,0CAAA;CLgvKT;AmDtyKD;EACE,cAAA;CnDwyKD;AmDnyKD;EACE,mBAAA;EACA,qCAAA;EvBpBA,6BAAA;EACC,4BAAA;C5B0zKF;AmDzyKD;EAMI,eAAA;CnDsyKH;AmDjyKD;EACE,cAAA;EACA,iBAAA;EACA,gBAAA;EACA,eAAA;CnDmyKD;AmDvyKD;;;;;EAWI,eAAA;CnDmyKH;AmD9xKD;EACE,mBAAA;EACA,0BAAA;EACA,2BAAA;EvBxCA,gCAAA;EACC,+BAAA;C5By0KF;AmDxxKD;;EAGI,iBAAA;CnDyxKH;AmD5xKD;;EAMM,oBAAA;EACA,iBAAA;CnD0xKL;AmDtxKG;;EAEI,cAAA;EvBvEN,6BAAA;EACC,4BAAA;C5Bg2KF;AmDpxKG;;EAEI,iBAAA;EvBvEN,gCAAA;EACC,+BAAA;C5B81KF;AmD7yKD;EvB1DE,2BAAA;EACC,0BAAA;C5B02KF;AmDhxKD;EAEI,oBAAA;CnDixKH;AmD9wKD;EACE,oBAAA;CnDgxKD;AmDxwKD;;;EAII,iBAAA;CnDywKH;AmD7wKD;;;EAOM,mBAAA;EACA,oBAAA;CnD2wKL;AmDnxKD;;EvBzGE,6BAAA;EACC,4BAAA;C5Bg4KF;AmDxxKD;;;;EAmBQ,4BAAA;EACA,6BAAA;CnD2wKP;AmD/xKD;;;;;;;;EAwBU,4BAAA;CnDixKT;AmDzyKD;;;;;;;;EA4BU,6BAAA;CnDuxKT;AmDnzKD;;EvBjGE,gCAAA;EACC,+BAAA;C5Bw5KF;AmDxzKD;;;;EAyCQ,+BAAA;EACA,gCAAA;CnDqxKP;AmD/zKD;;;;;;;;EA8CU,+BAAA;CnD2xKT;AmDz0KD;;;;;;;;EAkDU,gCAAA;CnDiyKT;AmDn1KD;;;;EA2DI,2BAAA;CnD8xKH;AmDz1KD;;EA+DI,cAAA;CnD8xKH;AmD71KD;;EAmEI,UAAA;CnD8xKH;AmDj2KD;;;;;;;;;;;;EA0EU,eAAA;CnDqyKT;AmD/2KD;;;;;;;;;;;;EA8EU,gBAAA;CnD+yKT;AmD73KD;;;;;;;;EAuFU,iBAAA;CnDgzKT;AmDv4KD;;;;;;;;EAgGU,iBAAA;CnDizKT;AmDj5KD;EAsGI,UAAA;EACA,iBAAA;CnD8yKH;AmDpyKD;EACE,oBAAA;CnDsyKD;AmDvyKD;EAKI,iBAAA;EACA,mBAAA;CnDqyKH;AmD3yKD;EASM,gBAAA;CnDqyKL;AmD9yKD;EAcI,iBAAA;CnDmyKH;AmDjzKD;;EAkBM,2BAAA;CnDmyKL;AmDrzKD;EAuBI,cAAA;CnDiyKH;AmDxzKD;EAyBM,8BAAA;CnDkyKL;AmD3xKD;EC1PE,mBAAA;CpDwhLD;AoDthLC;EACE,eAAA;EACA,0BAAA;EACA,mBAAA;CpDwhLH;AoD3hLC;EAMI,uBAAA;CpDwhLL;AoD9hLC;EASI,eAAA;EACA,0BAAA;CpDwhLL;AoDrhLC;EAEI,0BAAA;CpDshLL;AmD1yKD;EC7PE,sBAAA;CpD0iLD;AoDxiLC;EACE,YAAA;EACA,0BAAA;EACA,sBAAA;CpD0iLH;AoD7iLC;EAMI,0BAAA;CpD0iLL;AoDhjLC;EASI,eAAA;EACA,uBAAA;CpD0iLL;AoDviLC;EAEI,6BAAA;CpDwiLL;AmDzzKD;EChQE,sBAAA;CpD4jLD;AoD1jLC;EACE,eAAA;EACA,0BAAA;EACA,sBAAA;CpD4jLH;AoD/jLC;EAMI,0BAAA;CpD4jLL;AoDlkLC;EASI,eAAA;EACA,0BAAA;CpD4jLL;AoDzjLC;EAEI,6BAAA;CpD0jLL;AmDx0KD;ECnQE,sBAAA;CpD8kLD;AoD5kLC;EACE,eAAA;EACA,0BAAA;EACA,sBAAA;CpD8kLH;AoDjlLC;EAMI,0BAAA;CpD8kLL;AoDplLC;EASI,eAAA;EACA,0BAAA;CpD8kLL;AoD3kLC;EAEI,6BAAA;CpD4kLL;AmDv1KD;ECtQE,sBAAA;CpDgmLD;AoD9lLC;EACE,eAAA;EACA,0BAAA;EACA,sBAAA;CpDgmLH;AoDnmLC;EAMI,0BAAA;CpDgmLL;AoDtmLC;EASI,eAAA;EACA,0BAAA;CpDgmLL;AoD7lLC;EAEI,6BAAA;CpD8lLL;AmDt2KD;ECzQE,sBAAA;CpDknLD;AoDhnLC;EACE,eAAA;EACA,0BAAA;EACA,sBAAA;CpDknLH;AoDrnLC;EAMI,0BAAA;CpDknLL;AoDxnLC;EASI,eAAA;EACA,0BAAA;CpDknLL;AoD/mLC;EAEI,6BAAA;CpDgnLL;AqDhoLD;EACE,mBAAA;EACA,eAAA;EACA,UAAA;EACA,WAAA;EACA,iBAAA;CrDkoLD;AqDvoLD;;;;;EAYI,mBAAA;EACA,OAAA;EACA,QAAA;EACA,UAAA;EACA,aAAA;EACA,YAAA;EACA,UAAA;CrDkoLH;AqD7nLD;EACE,uBAAA;CrD+nLD;AqD3nLD;EACE,oBAAA;CrD6nLD;AsDxpLD;EACE,iBAAA;EACA,cAAA;EACA,oBAAA;EACA,0BAAA;EACA,0BAAA;EACA,mBAAA;EjDwDA,wDAAA;EACQ,gDAAA;CLmmLT;AsDlqLD;EASI,mBAAA;EACA,kCAAA;CtD4pLH;AsDvpLD;EACE,cAAA;EACA,mBAAA;CtDypLD;AsDvpLD;EACE,aAAA;EACA,mBAAA;CtDypLD;AuD/qLD;EACE,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,YAAA;EACA,0BAAA;EjCRA,aAAA;EAGA,0BAAA;CtBwrLD;AuDhrLC;;EAEE,YAAA;EACA,sBAAA;EACA,gBAAA;EjCfF,aAAA;EAGA,0BAAA;CtBgsLD;AuD5qLC;EACE,WAAA;EACA,gBAAA;EACA,wBAAA;EACA,UAAA;EACA,yBAAA;CvD8qLH;AwDnsLD;EACE,iBAAA;CxDqsLD;AwDjsLD;EACE,cAAA;EACA,iBAAA;EACA,gBAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,QAAA;EACA,cAAA;EACA,kCAAA;EAIA,WAAA;CxDgsLD;AwD7rLC;EnD+GA,sCAAA;EACI,kCAAA;EACC,iCAAA;EACG,8BAAA;EAkER,oDAAA;EAEK,0CAAA;EACG,oCAAA;CLghLT;AwDnsLC;EnD2GA,mCAAA;EACI,+BAAA;EACC,8BAAA;EACG,2BAAA;CL2lLT;AwDvsLD;EACE,mBAAA;EACA,iBAAA;CxDysLD;AwDrsLD;EACE,mBAAA;EACA,YAAA;EACA,aAAA;CxDusLD;AwDnsLD;EACE,mBAAA;EACA,uBAAA;EACA,uBAAA;EACA,qCAAA;EACA,mBAAA;EnDaA,iDAAA;EACQ,yCAAA;EmDZR,qCAAA;UAAA,6BAAA;EAEA,WAAA;CxDqsLD;AwDjsLD;EACE,gBAAA;EACA,OAAA;EACA,SAAA;EACA,UAAA;EACA,QAAA;EACA,cAAA;EACA,uBAAA;CxDmsLD;AwDjsLC;ElCrEA,WAAA;EAGA,yBAAA;CtBuwLD;AwDpsLC;ElCtEA,aAAA;EAGA,0BAAA;CtB2wLD;AwDnsLD;EACE,cAAA;EACA,iCAAA;CxDqsLD;AwDjsLD;EACE,iBAAA;CxDmsLD;AwD/rLD;EACE,UAAA;EACA,wBAAA;CxDisLD;AwD5rLD;EACE,mBAAA;EACA,cAAA;CxD8rLD;AwD1rLD;EACE,cAAA;EACA,kBAAA;EACA,8BAAA;CxD4rLD;AwD/rLD;EAQI,iBAAA;EACA,iBAAA;CxD0rLH;AwDnsLD;EAaI,kBAAA;CxDyrLH;AwDtsLD;EAiBI,eAAA;CxDwrLH;AwDnrLD;EACE,mBAAA;EACA,aAAA;EACA,YAAA;EACA,aAAA;EACA,iBAAA;CxDqrLD;AwDnqLD;EAZE;IACE,aAAA;IACA,kBAAA;GxDkrLD;EwDhrLD;InDvEA,kDAAA;IACQ,0CAAA;GL0vLP;EwD/qLD;IAAY,aAAA;GxDkrLX;CACF;AwD7qLD;EAFE;IAAY,aAAA;GxDmrLX;CACF;AyDl0LD;EACE,mBAAA;EACA,cAAA;EACA,eAAA;ECRA,4DAAA;EAEA,mBAAA;EACA,oBAAA;EACA,uBAAA;EACA,iBAAA;EACA,wBAAA;EACA,iBAAA;EACA,kBAAA;EACA,sBAAA;EACA,kBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mBAAA;EACA,qBAAA;EACA,kBAAA;EDHA,gBAAA;EnCVA,WAAA;EAGA,yBAAA;CtBy1LD;AyD90LC;EnCdA,aAAA;EAGA,0BAAA;CtB61LD;AyDj1LC;EAAW,iBAAA;EAAmB,eAAA;CzDq1L/B;AyDp1LC;EAAW,iBAAA;EAAmB,eAAA;CzDw1L/B;AyDv1LC;EAAW,gBAAA;EAAmB,eAAA;CzD21L/B;AyD11LC;EAAW,kBAAA;EAAmB,eAAA;CzD81L/B;AyD11LD;EACE,iBAAA;EACA,iBAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;EACA,mBAAA;CzD41LD;AyDx1LD;EACE,mBAAA;EACA,SAAA;EACA,UAAA;EACA,0BAAA;EACA,oBAAA;CzD01LD;AyDt1LC;EACE,UAAA;EACA,UAAA;EACA,kBAAA;EACA,wBAAA;EACA,uBAAA;CzDw1LH;AyDt1LC;EACE,UAAA;EACA,WAAA;EACA,oBAAA;EACA,wBAAA;EACA,uBAAA;CzDw1LH;AyDt1LC;EACE,UAAA;EACA,UAAA;EACA,oBAAA;EACA,wBAAA;EACA,uBAAA;CzDw1LH;AyDt1LC;EACE,SAAA;EACA,QAAA;EACA,iBAAA;EACA,4BAAA;EACA,yBAAA;CzDw1LH;AyDt1LC;EACE,SAAA;EACA,SAAA;EACA,iBAAA;EACA,4BAAA;EACA,wBAAA;CzDw1LH;AyDt1LC;EACE,OAAA;EACA,UAAA;EACA,kBAAA;EACA,wBAAA;EACA,0BAAA;CzDw1LH;AyDt1LC;EACE,OAAA;EACA,WAAA;EACA,iBAAA;EACA,wBAAA;EACA,0BAAA;CzDw1LH;AyDt1LC;EACE,OAAA;EACA,UAAA;EACA,iBAAA;EACA,wBAAA;EACA,0BAAA;CzDw1LH;A2Dr7LD;EACE,mBAAA;EACA,OAAA;EACA,QAAA;EACA,cAAA;EACA,cAAA;EACA,iBAAA;EACA,aAAA;EDXA,4DAAA;EAEA,mBAAA;EACA,oBAAA;EACA,uBAAA;EACA,iBAAA;EACA,wBAAA;EACA,iBAAA;EACA,kBAAA;EACA,sBAAA;EACA,kBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mBAAA;EACA,qBAAA;EACA,kBAAA;ECAA,gBAAA;EAEA,uBAAA;EACA,qCAAA;UAAA,6BAAA;EACA,uBAAA;EACA,qCAAA;EACA,mBAAA;EtD8CA,kDAAA;EACQ,0CAAA;CLq5LT;A2Dh8LC;EAAY,kBAAA;C3Dm8Lb;A2Dl8LC;EAAY,kBAAA;C3Dq8Lb;A2Dp8LC;EAAY,iBAAA;C3Du8Lb;A2Dt8LC;EAAY,mBAAA;C3Dy8Lb;A2Dt8LD;EACE,UAAA;EACA,kBAAA;EACA,gBAAA;EACA,0BAAA;EACA,iCAAA;EACA,2BAAA;C3Dw8LD;A2Dr8LD;EACE,kBAAA;C3Du8LD;A2D/7LC;;EAEE,mBAAA;EACA,eAAA;EACA,SAAA;EACA,UAAA;EACA,0BAAA;EACA,oBAAA;C3Di8LH;A2D97LD;EACE,mBAAA;C3Dg8LD;A2D97LD;EACE,mBAAA;EACA,YAAA;C3Dg8LD;A2D57LC;EACE,UAAA;EACA,mBAAA;EACA,uBAAA;EACA,0BAAA;EACA,sCAAA;EACA,cAAA;C3D87LH;A2D77LG;EACE,aAAA;EACA,YAAA;EACA,mBAAA;EACA,uBAAA;EACA,uBAAA;C3D+7LL;A2D57LC;EACE,SAAA;EACA,YAAA;EACA,kBAAA;EACA,qBAAA;EACA,4BAAA;EACA,wCAAA;C3D87LH;A2D77LG;EACE,aAAA;EACA,UAAA;EACA,cAAA;EACA,qBAAA;EACA,yBAAA;C3D+7LL;A2D57LC;EACE,UAAA;EACA,mBAAA;EACA,oBAAA;EACA,6BAAA;EACA,yCAAA;EACA,WAAA;C3D87LH;A2D77LG;EACE,aAAA;EACA,SAAA;EACA,mBAAA;EACA,oBAAA;EACA,0BAAA;C3D+7LL;A2D37LC;EACE,SAAA;EACA,aAAA;EACA,kBAAA;EACA,sBAAA;EACA,2BAAA;EACA,uCAAA;C3D67LH;A2D57LG;EACE,aAAA;EACA,WAAA;EACA,sBAAA;EACA,wBAAA;EACA,cAAA;C3D87LL;A4DvjMD;EACE,mBAAA;C5DyjMD;A4DtjMD;EACE,mBAAA;EACA,iBAAA;EACA,YAAA;C5DwjMD;A4D3jMD;EAMI,cAAA;EACA,mBAAA;EvD6KF,0CAAA;EACK,qCAAA;EACG,kCAAA;CL44LT;A4DlkMD;;EAcM,eAAA;C5DwjML;A4D9hMC;EA4NF;IvD3DE,uDAAA;IAEK,6CAAA;IACG,uCAAA;IA7JR,oCAAA;IAEQ,4BAAA;IA+GR,4BAAA;IAEQ,oBAAA;GLi7LP;E4D5jMG;;IvDmHJ,2CAAA;IACQ,mCAAA;IuDjHF,QAAA;G5D+jML;E4D7jMG;;IvD8GJ,4CAAA;IACQ,oCAAA;IuD5GF,QAAA;G5DgkML;E4D9jMG;;;IvDyGJ,wCAAA;IACQ,gCAAA;IuDtGF,QAAA;G5DikML;CACF;A4DvmMD;;;EA6CI,eAAA;C5D+jMH;A4D5mMD;EAiDI,QAAA;C5D8jMH;A4D/mMD;;EAsDI,mBAAA;EACA,OAAA;EACA,YAAA;C5D6jMH;A4DrnMD;EA4DI,WAAA;C5D4jMH;A4DxnMD;EA+DI,YAAA;C5D4jMH;A4D3nMD;;EAmEI,QAAA;C5D4jMH;A4D/nMD;EAuEI,YAAA;C5D2jMH;A4DloMD;EA0EI,WAAA;C5D2jMH;A4DnjMD;EACE,mBAAA;EACA,OAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EtC9FA,aAAA;EAGA,0BAAA;EsC6FA,gBAAA;EACA,YAAA;EACA,mBAAA;EACA,0CAAA;EACA,mCAAA;C5DsjMD;A4DjjMC;EdnGE,mGAAA;EACA,8FAAA;EACA,qHAAA;EAAA,+FAAA;EACA,4BAAA;EACA,uHAAA;C9CupMH;A4DrjMC;EACE,WAAA;EACA,SAAA;EdxGA,mGAAA;EACA,8FAAA;EACA,qHAAA;EAAA,+FAAA;EACA,4BAAA;EACA,uHAAA;C9CgqMH;A4DvjMC;;EAEE,WAAA;EACA,YAAA;EACA,sBAAA;EtCvHF,aAAA;EAGA,0BAAA;CtB+qMD;A4DzlMD;;;;EAuCI,mBAAA;EACA,SAAA;EACA,kBAAA;EACA,WAAA;EACA,sBAAA;C5DwjMH;A4DnmMD;;EA+CI,UAAA;EACA,mBAAA;C5DwjMH;A4DxmMD;;EAoDI,WAAA;EACA,oBAAA;C5DwjMH;A4D7mMD;;EAyDI,YAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;C5DwjMH;A4DnjMG;EACE,iBAAA;C5DqjML;A4DjjMG;EACE,iBAAA;C5DmjML;A4DziMD;EACE,mBAAA;EACA,aAAA;EACA,UAAA;EACA,YAAA;EACA,WAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,mBAAA;C5D2iMD;A4DpjMD;EAYI,sBAAA;EACA,YAAA;EACA,aAAA;EACA,YAAA;EACA,oBAAA;EACA,uBAAA;EACA,oBAAA;EACA,gBAAA;EAWA,0BAAA;EACA,mCAAA;C5DiiMH;A4DhkMD;EAkCI,UAAA;EACA,YAAA;EACA,aAAA;EACA,uBAAA;C5DiiMH;A4D1hMD;EACE,mBAAA;EACA,UAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,kBAAA;EACA,qBAAA;EACA,YAAA;EACA,mBAAA;EACA,0CAAA;C5D4hMD;A4D3hMC;EACE,kBAAA;C5D6hMH;A4Dp/LD;EAhCE;;;;IAKI,YAAA;IACA,aAAA;IACA,kBAAA;IACA,gBAAA;G5DshMH;E4D9hMD;;IAYI,mBAAA;G5DshMH;E4DliMD;;IAgBI,oBAAA;G5DshMH;E4DjhMD;IACE,UAAA;IACA,WAAA;IACA,qBAAA;G5DmhMD;E4D/gMD;IACE,aAAA;G5DihMD;CACF;A6DhxMC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEE,aAAA;EACA,eAAA;C7DgzMH;A6D9yMC;;;;;;;;;;;;;;;;EACE,YAAA;C7D+zMH;AiCv0MD;E6BRE,eAAA;EACA,kBAAA;EACA,mBAAA;C9Dk1MD;AiCz0MD;EACE,wBAAA;CjC20MD;AiCz0MD;EACE,uBAAA;CjC20MD;AiCn0MD;EACE,yBAAA;CjCq0MD;AiCn0MD;EACE,0BAAA;CjCq0MD;AiCn0MD;EACE,mBAAA;CjCq0MD;AiCn0MD;E8BzBE,YAAA;EACA,mBAAA;EACA,kBAAA;EACA,8BAAA;EACA,UAAA;C/D+1MD;AiCj0MD;EACE,yBAAA;CjCm0MD;AiC5zMD;EACE,gBAAA;CjC8zMD;AgE/1MD;EACE,oBAAA;ChEi2MD;AgE31MD;;;;ECdE,yBAAA;CjE+2MD;AgE11MD;;;;;;;;;;;;EAYE,yBAAA;ChE41MD;AgEr1MD;EA6IA;IC7LE,0BAAA;GjEy4MC;EiEx4MD;IAAU,0BAAA;GjE24MT;EiE14MD;IAAU,8BAAA;GjE64MT;EiE54MD;;IACU,+BAAA;GjE+4MT;CACF;AgE/1MD;EAwIA;IA1II,0BAAA;GhEq2MD;CACF;AgE/1MD;EAmIA;IArII,2BAAA;GhEq2MD;CACF;AgE/1MD;EA8HA;IAhII,iCAAA;GhEq2MD;CACF;AgE91MD;EAwHA;IC7LE,0BAAA;GjEu6MC;EiEt6MD;IAAU,0BAAA;GjEy6MT;EiEx6MD;IAAU,8BAAA;GjE26MT;EiE16MD;;IACU,+BAAA;GjE66MT;CACF;AgEx2MD;EAmHA;IArHI,0BAAA;GhE82MD;CACF;AgEx2MD;EA8GA;IAhHI,2BAAA;GhE82MD;CACF;AgEx2MD;EAyGA;IA3GI,iCAAA;GhE82MD;CACF;AgEv2MD;EAmGA;IC7LE,0BAAA;GjEq8MC;EiEp8MD;IAAU,0BAAA;GjEu8MT;EiEt8MD;IAAU,8BAAA;GjEy8MT;EiEx8MD;;IACU,+BAAA;GjE28MT;CACF;AgEj3MD;EA8FA;IAhGI,0BAAA;GhEu3MD;CACF;AgEj3MD;EAyFA;IA3FI,2BAAA;GhEu3MD;CACF;AgEj3MD;EAoFA;IAtFI,iCAAA;GhEu3MD;CACF;AgEh3MD;EA8EA;IC7LE,0BAAA;GjEm+MC;EiEl+MD;IAAU,0BAAA;GjEq+MT;EiEp+MD;IAAU,8BAAA;GjEu+MT;EiEt+MD;;IACU,+BAAA;GjEy+MT;CACF;AgE13MD;EAyEA;IA3EI,0BAAA;GhEg4MD;CACF;AgE13MD;EAoEA;IAtEI,2BAAA;GhEg4MD;CACF;AgE13MD;EA+DA;IAjEI,iCAAA;GhEg4MD;CACF;AgEz3MD;EAyDA;ICrLE,yBAAA;GjEy/MC;CACF;AgEz3MD;EAoDA;ICrLE,yBAAA;GjE8/MC;CACF;AgEz3MD;EA+CA;ICrLE,yBAAA;GjEmgNC;CACF;AgEz3MD;EA0CA;ICrLE,yBAAA;GjEwgNC;CACF;AgEt3MD;ECnJE,yBAAA;CjE4gND;AgEn3MD;EA4BA;IC7LE,0BAAA;GjEwhNC;EiEvhND;IAAU,0BAAA;GjE0hNT;EiEzhND;IAAU,8BAAA;GjE4hNT;EiE3hND;;IACU,+BAAA;GjE8hNT;CACF;AgEj4MD;EACE,yBAAA;ChEm4MD;AgE93MD;EAqBA;IAvBI,0BAAA;GhEo4MD;CACF;AgEl4MD;EACE,yBAAA;ChEo4MD;AgE/3MD;EAcA;IAhBI,2BAAA;GhEq4MD;CACF;AgEn4MD;EACE,yBAAA;ChEq4MD;AgEh4MD;EAOA;IATI,iCAAA;GhEs4MD;CACF;AgE/3MD;EACA;ICrLE,yBAAA;GjEujNC;CACF","file":"bootstrap.css","sourcesContent":["/*!\n * Bootstrap v3.3.6 (http://getbootstrap.com)\n * Copyright 2011-2015 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\nhtml {\n font-family: sans-serif;\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n}\nbody {\n margin: 0;\n}\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block;\n vertical-align: baseline;\n}\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n[hidden],\ntemplate {\n display: none;\n}\na {\n background-color: transparent;\n}\na:active,\na:hover {\n outline: 0;\n}\nabbr[title] {\n border-bottom: 1px dotted;\n}\nb,\nstrong {\n font-weight: bold;\n}\ndfn {\n font-style: italic;\n}\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\nmark {\n background: #ff0;\n color: #000;\n}\nsmall {\n font-size: 80%;\n}\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\nsup {\n top: -0.5em;\n}\nsub {\n bottom: -0.25em;\n}\nimg {\n border: 0;\n}\nsvg:not(:root) {\n overflow: hidden;\n}\nfigure {\n margin: 1em 40px;\n}\nhr {\n box-sizing: content-box;\n height: 0;\n}\npre {\n overflow: auto;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit;\n font: inherit;\n margin: 0;\n}\nbutton {\n overflow: visible;\n}\nbutton,\nselect {\n text-transform: none;\n}\nbutton,\nhtml input[type=\"button\"],\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button;\n cursor: pointer;\n}\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\ninput {\n line-height: normal;\n}\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box;\n padding: 0;\n}\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: textfield;\n box-sizing: content-box;\n}\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\nlegend {\n border: 0;\n padding: 0;\n}\ntextarea {\n overflow: auto;\n}\noptgroup {\n font-weight: bold;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\ntd,\nth {\n padding: 0;\n}\n/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important;\n box-shadow: none !important;\n text-shadow: none !important;\n }\n a,\n a:visited {\n text-decoration: underline;\n }\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n thead {\n display: table-header-group;\n }\n tr,\n img {\n page-break-inside: avoid;\n }\n img {\n max-width: 100% !important;\n }\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n h2,\n h3 {\n page-break-after: avoid;\n }\n .navbar {\n display: none;\n }\n .btn > .caret,\n .dropup > .btn > .caret {\n border-top-color: #000 !important;\n }\n .label {\n border: 1px solid #000;\n }\n .table {\n border-collapse: collapse !important;\n }\n .table td,\n .table th {\n background-color: #fff !important;\n }\n .table-bordered th,\n .table-bordered td {\n border: 1px solid #ddd !important;\n }\n}\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('../fonts/glyphicons-halflings-regular.eot');\n src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');\n}\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n.glyphicon-asterisk:before {\n content: \"\\002a\";\n}\n.glyphicon-plus:before {\n content: \"\\002b\";\n}\n.glyphicon-euro:before,\n.glyphicon-eur:before {\n content: \"\\20ac\";\n}\n.glyphicon-minus:before {\n content: \"\\2212\";\n}\n.glyphicon-cloud:before {\n content: \"\\2601\";\n}\n.glyphicon-envelope:before {\n content: \"\\2709\";\n}\n.glyphicon-pencil:before {\n content: \"\\270f\";\n}\n.glyphicon-glass:before {\n content: \"\\e001\";\n}\n.glyphicon-music:before {\n content: \"\\e002\";\n}\n.glyphicon-search:before {\n content: \"\\e003\";\n}\n.glyphicon-heart:before {\n content: \"\\e005\";\n}\n.glyphicon-star:before {\n content: \"\\e006\";\n}\n.glyphicon-star-empty:before {\n content: \"\\e007\";\n}\n.glyphicon-user:before {\n content: \"\\e008\";\n}\n.glyphicon-film:before {\n content: \"\\e009\";\n}\n.glyphicon-th-large:before {\n content: \"\\e010\";\n}\n.glyphicon-th:before {\n content: \"\\e011\";\n}\n.glyphicon-th-list:before {\n content: \"\\e012\";\n}\n.glyphicon-ok:before {\n content: \"\\e013\";\n}\n.glyphicon-remove:before {\n content: \"\\e014\";\n}\n.glyphicon-zoom-in:before {\n content: \"\\e015\";\n}\n.glyphicon-zoom-out:before {\n content: \"\\e016\";\n}\n.glyphicon-off:before {\n content: \"\\e017\";\n}\n.glyphicon-signal:before {\n content: \"\\e018\";\n}\n.glyphicon-cog:before {\n content: \"\\e019\";\n}\n.glyphicon-trash:before {\n content: \"\\e020\";\n}\n.glyphicon-home:before {\n content: \"\\e021\";\n}\n.glyphicon-file:before {\n content: \"\\e022\";\n}\n.glyphicon-time:before {\n content: \"\\e023\";\n}\n.glyphicon-road:before {\n content: \"\\e024\";\n}\n.glyphicon-download-alt:before {\n content: \"\\e025\";\n}\n.glyphicon-download:before {\n content: \"\\e026\";\n}\n.glyphicon-upload:before {\n content: \"\\e027\";\n}\n.glyphicon-inbox:before {\n content: \"\\e028\";\n}\n.glyphicon-play-circle:before {\n content: \"\\e029\";\n}\n.glyphicon-repeat:before {\n content: \"\\e030\";\n}\n.glyphicon-refresh:before {\n content: \"\\e031\";\n}\n.glyphicon-list-alt:before {\n content: \"\\e032\";\n}\n.glyphicon-lock:before {\n content: \"\\e033\";\n}\n.glyphicon-flag:before {\n content: \"\\e034\";\n}\n.glyphicon-headphones:before {\n content: \"\\e035\";\n}\n.glyphicon-volume-off:before {\n content: \"\\e036\";\n}\n.glyphicon-volume-down:before {\n content: \"\\e037\";\n}\n.glyphicon-volume-up:before {\n content: \"\\e038\";\n}\n.glyphicon-qrcode:before {\n content: \"\\e039\";\n}\n.glyphicon-barcode:before {\n content: \"\\e040\";\n}\n.glyphicon-tag:before {\n content: \"\\e041\";\n}\n.glyphicon-tags:before {\n content: \"\\e042\";\n}\n.glyphicon-book:before {\n content: \"\\e043\";\n}\n.glyphicon-bookmark:before {\n content: \"\\e044\";\n}\n.glyphicon-print:before {\n content: \"\\e045\";\n}\n.glyphicon-camera:before {\n content: \"\\e046\";\n}\n.glyphicon-font:before {\n content: \"\\e047\";\n}\n.glyphicon-bold:before {\n content: \"\\e048\";\n}\n.glyphicon-italic:before {\n content: \"\\e049\";\n}\n.glyphicon-text-height:before {\n content: \"\\e050\";\n}\n.glyphicon-text-width:before {\n content: \"\\e051\";\n}\n.glyphicon-align-left:before {\n content: \"\\e052\";\n}\n.glyphicon-align-center:before {\n content: \"\\e053\";\n}\n.glyphicon-align-right:before {\n content: \"\\e054\";\n}\n.glyphicon-align-justify:before {\n content: \"\\e055\";\n}\n.glyphicon-list:before {\n content: \"\\e056\";\n}\n.glyphicon-indent-left:before {\n content: \"\\e057\";\n}\n.glyphicon-indent-right:before {\n content: \"\\e058\";\n}\n.glyphicon-facetime-video:before {\n content: \"\\e059\";\n}\n.glyphicon-picture:before {\n content: \"\\e060\";\n}\n.glyphicon-map-marker:before {\n content: \"\\e062\";\n}\n.glyphicon-adjust:before {\n content: \"\\e063\";\n}\n.glyphicon-tint:before {\n content: \"\\e064\";\n}\n.glyphicon-edit:before {\n content: \"\\e065\";\n}\n.glyphicon-share:before {\n content: \"\\e066\";\n}\n.glyphicon-check:before {\n content: \"\\e067\";\n}\n.glyphicon-move:before {\n content: \"\\e068\";\n}\n.glyphicon-step-backward:before {\n content: \"\\e069\";\n}\n.glyphicon-fast-backward:before {\n content: \"\\e070\";\n}\n.glyphicon-backward:before {\n content: \"\\e071\";\n}\n.glyphicon-play:before {\n content: \"\\e072\";\n}\n.glyphicon-pause:before {\n content: \"\\e073\";\n}\n.glyphicon-stop:before {\n content: \"\\e074\";\n}\n.glyphicon-forward:before {\n content: \"\\e075\";\n}\n.glyphicon-fast-forward:before {\n content: \"\\e076\";\n}\n.glyphicon-step-forward:before {\n content: \"\\e077\";\n}\n.glyphicon-eject:before {\n content: \"\\e078\";\n}\n.glyphicon-chevron-left:before {\n content: \"\\e079\";\n}\n.glyphicon-chevron-right:before {\n content: \"\\e080\";\n}\n.glyphicon-plus-sign:before {\n content: \"\\e081\";\n}\n.glyphicon-minus-sign:before {\n content: \"\\e082\";\n}\n.glyphicon-remove-sign:before {\n content: \"\\e083\";\n}\n.glyphicon-ok-sign:before {\n content: \"\\e084\";\n}\n.glyphicon-question-sign:before {\n content: \"\\e085\";\n}\n.glyphicon-info-sign:before {\n content: \"\\e086\";\n}\n.glyphicon-screenshot:before {\n content: \"\\e087\";\n}\n.glyphicon-remove-circle:before {\n content: \"\\e088\";\n}\n.glyphicon-ok-circle:before {\n content: \"\\e089\";\n}\n.glyphicon-ban-circle:before {\n content: \"\\e090\";\n}\n.glyphicon-arrow-left:before {\n content: \"\\e091\";\n}\n.glyphicon-arrow-right:before {\n content: \"\\e092\";\n}\n.glyphicon-arrow-up:before {\n content: \"\\e093\";\n}\n.glyphicon-arrow-down:before {\n content: \"\\e094\";\n}\n.glyphicon-share-alt:before {\n content: \"\\e095\";\n}\n.glyphicon-resize-full:before {\n content: \"\\e096\";\n}\n.glyphicon-resize-small:before {\n content: \"\\e097\";\n}\n.glyphicon-exclamation-sign:before {\n content: \"\\e101\";\n}\n.glyphicon-gift:before {\n content: \"\\e102\";\n}\n.glyphicon-leaf:before {\n content: \"\\e103\";\n}\n.glyphicon-fire:before {\n content: \"\\e104\";\n}\n.glyphicon-eye-open:before {\n content: \"\\e105\";\n}\n.glyphicon-eye-close:before {\n content: \"\\e106\";\n}\n.glyphicon-warning-sign:before {\n content: \"\\e107\";\n}\n.glyphicon-plane:before {\n content: \"\\e108\";\n}\n.glyphicon-calendar:before {\n content: \"\\e109\";\n}\n.glyphicon-random:before {\n content: \"\\e110\";\n}\n.glyphicon-comment:before {\n content: \"\\e111\";\n}\n.glyphicon-magnet:before {\n content: \"\\e112\";\n}\n.glyphicon-chevron-up:before {\n content: \"\\e113\";\n}\n.glyphicon-chevron-down:before {\n content: \"\\e114\";\n}\n.glyphicon-retweet:before {\n content: \"\\e115\";\n}\n.glyphicon-shopping-cart:before {\n content: \"\\e116\";\n}\n.glyphicon-folder-close:before {\n content: \"\\e117\";\n}\n.glyphicon-folder-open:before {\n content: \"\\e118\";\n}\n.glyphicon-resize-vertical:before {\n content: \"\\e119\";\n}\n.glyphicon-resize-horizontal:before {\n content: \"\\e120\";\n}\n.glyphicon-hdd:before {\n content: \"\\e121\";\n}\n.glyphicon-bullhorn:before {\n content: \"\\e122\";\n}\n.glyphicon-bell:before {\n content: \"\\e123\";\n}\n.glyphicon-certificate:before {\n content: \"\\e124\";\n}\n.glyphicon-thumbs-up:before {\n content: \"\\e125\";\n}\n.glyphicon-thumbs-down:before {\n content: \"\\e126\";\n}\n.glyphicon-hand-right:before {\n content: \"\\e127\";\n}\n.glyphicon-hand-left:before {\n content: \"\\e128\";\n}\n.glyphicon-hand-up:before {\n content: \"\\e129\";\n}\n.glyphicon-hand-down:before {\n content: \"\\e130\";\n}\n.glyphicon-circle-arrow-right:before {\n content: \"\\e131\";\n}\n.glyphicon-circle-arrow-left:before {\n content: \"\\e132\";\n}\n.glyphicon-circle-arrow-up:before {\n content: \"\\e133\";\n}\n.glyphicon-circle-arrow-down:before {\n content: \"\\e134\";\n}\n.glyphicon-globe:before {\n content: \"\\e135\";\n}\n.glyphicon-wrench:before {\n content: \"\\e136\";\n}\n.glyphicon-tasks:before {\n content: \"\\e137\";\n}\n.glyphicon-filter:before {\n content: \"\\e138\";\n}\n.glyphicon-briefcase:before {\n content: \"\\e139\";\n}\n.glyphicon-fullscreen:before {\n content: \"\\e140\";\n}\n.glyphicon-dashboard:before {\n content: \"\\e141\";\n}\n.glyphicon-paperclip:before {\n content: \"\\e142\";\n}\n.glyphicon-heart-empty:before {\n content: \"\\e143\";\n}\n.glyphicon-link:before {\n content: \"\\e144\";\n}\n.glyphicon-phone:before {\n content: \"\\e145\";\n}\n.glyphicon-pushpin:before {\n content: \"\\e146\";\n}\n.glyphicon-usd:before {\n content: \"\\e148\";\n}\n.glyphicon-gbp:before {\n content: \"\\e149\";\n}\n.glyphicon-sort:before {\n content: \"\\e150\";\n}\n.glyphicon-sort-by-alphabet:before {\n content: \"\\e151\";\n}\n.glyphicon-sort-by-alphabet-alt:before {\n content: \"\\e152\";\n}\n.glyphicon-sort-by-order:before {\n content: \"\\e153\";\n}\n.glyphicon-sort-by-order-alt:before {\n content: \"\\e154\";\n}\n.glyphicon-sort-by-attributes:before {\n content: \"\\e155\";\n}\n.glyphicon-sort-by-attributes-alt:before {\n content: \"\\e156\";\n}\n.glyphicon-unchecked:before {\n content: \"\\e157\";\n}\n.glyphicon-expand:before {\n content: \"\\e158\";\n}\n.glyphicon-collapse-down:before {\n content: \"\\e159\";\n}\n.glyphicon-collapse-up:before {\n content: \"\\e160\";\n}\n.glyphicon-log-in:before {\n content: \"\\e161\";\n}\n.glyphicon-flash:before {\n content: \"\\e162\";\n}\n.glyphicon-log-out:before {\n content: \"\\e163\";\n}\n.glyphicon-new-window:before {\n content: \"\\e164\";\n}\n.glyphicon-record:before {\n content: \"\\e165\";\n}\n.glyphicon-save:before {\n content: \"\\e166\";\n}\n.glyphicon-open:before {\n content: \"\\e167\";\n}\n.glyphicon-saved:before {\n content: \"\\e168\";\n}\n.glyphicon-import:before {\n content: \"\\e169\";\n}\n.glyphicon-export:before {\n content: \"\\e170\";\n}\n.glyphicon-send:before {\n content: \"\\e171\";\n}\n.glyphicon-floppy-disk:before {\n content: \"\\e172\";\n}\n.glyphicon-floppy-saved:before {\n content: \"\\e173\";\n}\n.glyphicon-floppy-remove:before {\n content: \"\\e174\";\n}\n.glyphicon-floppy-save:before {\n content: \"\\e175\";\n}\n.glyphicon-floppy-open:before {\n content: \"\\e176\";\n}\n.glyphicon-credit-card:before {\n content: \"\\e177\";\n}\n.glyphicon-transfer:before {\n content: \"\\e178\";\n}\n.glyphicon-cutlery:before {\n content: \"\\e179\";\n}\n.glyphicon-header:before {\n content: \"\\e180\";\n}\n.glyphicon-compressed:before {\n content: \"\\e181\";\n}\n.glyphicon-earphone:before {\n content: \"\\e182\";\n}\n.glyphicon-phone-alt:before {\n content: \"\\e183\";\n}\n.glyphicon-tower:before {\n content: \"\\e184\";\n}\n.glyphicon-stats:before {\n content: \"\\e185\";\n}\n.glyphicon-sd-video:before {\n content: \"\\e186\";\n}\n.glyphicon-hd-video:before {\n content: \"\\e187\";\n}\n.glyphicon-subtitles:before {\n content: \"\\e188\";\n}\n.glyphicon-sound-stereo:before {\n content: \"\\e189\";\n}\n.glyphicon-sound-dolby:before {\n content: \"\\e190\";\n}\n.glyphicon-sound-5-1:before {\n content: \"\\e191\";\n}\n.glyphicon-sound-6-1:before {\n content: \"\\e192\";\n}\n.glyphicon-sound-7-1:before {\n content: \"\\e193\";\n}\n.glyphicon-copyright-mark:before {\n content: \"\\e194\";\n}\n.glyphicon-registration-mark:before {\n content: \"\\e195\";\n}\n.glyphicon-cloud-download:before {\n content: \"\\e197\";\n}\n.glyphicon-cloud-upload:before {\n content: \"\\e198\";\n}\n.glyphicon-tree-conifer:before {\n content: \"\\e199\";\n}\n.glyphicon-tree-deciduous:before {\n content: \"\\e200\";\n}\n.glyphicon-cd:before {\n content: \"\\e201\";\n}\n.glyphicon-save-file:before {\n content: \"\\e202\";\n}\n.glyphicon-open-file:before {\n content: \"\\e203\";\n}\n.glyphicon-level-up:before {\n content: \"\\e204\";\n}\n.glyphicon-copy:before {\n content: \"\\e205\";\n}\n.glyphicon-paste:before {\n content: \"\\e206\";\n}\n.glyphicon-alert:before {\n content: \"\\e209\";\n}\n.glyphicon-equalizer:before {\n content: \"\\e210\";\n}\n.glyphicon-king:before {\n content: \"\\e211\";\n}\n.glyphicon-queen:before {\n content: \"\\e212\";\n}\n.glyphicon-pawn:before {\n content: \"\\e213\";\n}\n.glyphicon-bishop:before {\n content: \"\\e214\";\n}\n.glyphicon-knight:before {\n content: \"\\e215\";\n}\n.glyphicon-baby-formula:before {\n content: \"\\e216\";\n}\n.glyphicon-tent:before {\n content: \"\\26fa\";\n}\n.glyphicon-blackboard:before {\n content: \"\\e218\";\n}\n.glyphicon-bed:before {\n content: \"\\e219\";\n}\n.glyphicon-apple:before {\n content: \"\\f8ff\";\n}\n.glyphicon-erase:before {\n content: \"\\e221\";\n}\n.glyphicon-hourglass:before {\n content: \"\\231b\";\n}\n.glyphicon-lamp:before {\n content: \"\\e223\";\n}\n.glyphicon-duplicate:before {\n content: \"\\e224\";\n}\n.glyphicon-piggy-bank:before {\n content: \"\\e225\";\n}\n.glyphicon-scissors:before {\n content: \"\\e226\";\n}\n.glyphicon-bitcoin:before {\n content: \"\\e227\";\n}\n.glyphicon-btc:before {\n content: \"\\e227\";\n}\n.glyphicon-xbt:before {\n content: \"\\e227\";\n}\n.glyphicon-yen:before {\n content: \"\\00a5\";\n}\n.glyphicon-jpy:before {\n content: \"\\00a5\";\n}\n.glyphicon-ruble:before {\n content: \"\\20bd\";\n}\n.glyphicon-rub:before {\n content: \"\\20bd\";\n}\n.glyphicon-scale:before {\n content: \"\\e230\";\n}\n.glyphicon-ice-lolly:before {\n content: \"\\e231\";\n}\n.glyphicon-ice-lolly-tasted:before {\n content: \"\\e232\";\n}\n.glyphicon-education:before {\n content: \"\\e233\";\n}\n.glyphicon-option-horizontal:before {\n content: \"\\e234\";\n}\n.glyphicon-option-vertical:before {\n content: \"\\e235\";\n}\n.glyphicon-menu-hamburger:before {\n content: \"\\e236\";\n}\n.glyphicon-modal-window:before {\n content: \"\\e237\";\n}\n.glyphicon-oil:before {\n content: \"\\e238\";\n}\n.glyphicon-grain:before {\n content: \"\\e239\";\n}\n.glyphicon-sunglasses:before {\n content: \"\\e240\";\n}\n.glyphicon-text-size:before {\n content: \"\\e241\";\n}\n.glyphicon-text-color:before {\n content: \"\\e242\";\n}\n.glyphicon-text-background:before {\n content: \"\\e243\";\n}\n.glyphicon-object-align-top:before {\n content: \"\\e244\";\n}\n.glyphicon-object-align-bottom:before {\n content: \"\\e245\";\n}\n.glyphicon-object-align-horizontal:before {\n content: \"\\e246\";\n}\n.glyphicon-object-align-left:before {\n content: \"\\e247\";\n}\n.glyphicon-object-align-vertical:before {\n content: \"\\e248\";\n}\n.glyphicon-object-align-right:before {\n content: \"\\e249\";\n}\n.glyphicon-triangle-right:before {\n content: \"\\e250\";\n}\n.glyphicon-triangle-left:before {\n content: \"\\e251\";\n}\n.glyphicon-triangle-bottom:before {\n content: \"\\e252\";\n}\n.glyphicon-triangle-top:before {\n content: \"\\e253\";\n}\n.glyphicon-console:before {\n content: \"\\e254\";\n}\n.glyphicon-superscript:before {\n content: \"\\e255\";\n}\n.glyphicon-subscript:before {\n content: \"\\e256\";\n}\n.glyphicon-menu-left:before {\n content: \"\\e257\";\n}\n.glyphicon-menu-right:before {\n content: \"\\e258\";\n}\n.glyphicon-menu-down:before {\n content: \"\\e259\";\n}\n.glyphicon-menu-up:before {\n content: \"\\e260\";\n}\n* {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\n*:before,\n*:after {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-size: 14px;\n line-height: 1.42857143;\n color: #333333;\n background-color: #fff;\n}\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\na {\n color: #337ab7;\n text-decoration: none;\n}\na:hover,\na:focus {\n color: #23527c;\n text-decoration: underline;\n}\na:focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\nfigure {\n margin: 0;\n}\nimg {\n vertical-align: middle;\n}\n.img-responsive,\n.thumbnail > img,\n.thumbnail a > img,\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n display: block;\n max-width: 100%;\n height: auto;\n}\n.img-rounded {\n border-radius: 6px;\n}\n.img-thumbnail {\n padding: 4px;\n line-height: 1.42857143;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n -webkit-transition: all 0.2s ease-in-out;\n -o-transition: all 0.2s ease-in-out;\n transition: all 0.2s ease-in-out;\n display: inline-block;\n max-width: 100%;\n height: auto;\n}\n.img-circle {\n border-radius: 50%;\n}\nhr {\n margin-top: 20px;\n margin-bottom: 20px;\n border: 0;\n border-top: 1px solid #eeeeee;\n}\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n}\n.sr-only-focusable:active,\n.sr-only-focusable:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n}\n[role=\"button\"] {\n cursor: pointer;\n}\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\n.h1,\n.h2,\n.h3,\n.h4,\n.h5,\n.h6 {\n font-family: inherit;\n font-weight: 500;\n line-height: 1.1;\n color: inherit;\n}\nh1 small,\nh2 small,\nh3 small,\nh4 small,\nh5 small,\nh6 small,\n.h1 small,\n.h2 small,\n.h3 small,\n.h4 small,\n.h5 small,\n.h6 small,\nh1 .small,\nh2 .small,\nh3 .small,\nh4 .small,\nh5 .small,\nh6 .small,\n.h1 .small,\n.h2 .small,\n.h3 .small,\n.h4 .small,\n.h5 .small,\n.h6 .small {\n font-weight: normal;\n line-height: 1;\n color: #777777;\n}\nh1,\n.h1,\nh2,\n.h2,\nh3,\n.h3 {\n margin-top: 20px;\n margin-bottom: 10px;\n}\nh1 small,\n.h1 small,\nh2 small,\n.h2 small,\nh3 small,\n.h3 small,\nh1 .small,\n.h1 .small,\nh2 .small,\n.h2 .small,\nh3 .small,\n.h3 .small {\n font-size: 65%;\n}\nh4,\n.h4,\nh5,\n.h5,\nh6,\n.h6 {\n margin-top: 10px;\n margin-bottom: 10px;\n}\nh4 small,\n.h4 small,\nh5 small,\n.h5 small,\nh6 small,\n.h6 small,\nh4 .small,\n.h4 .small,\nh5 .small,\n.h5 .small,\nh6 .small,\n.h6 .small {\n font-size: 75%;\n}\nh1,\n.h1 {\n font-size: 36px;\n}\nh2,\n.h2 {\n font-size: 30px;\n}\nh3,\n.h3 {\n font-size: 24px;\n}\nh4,\n.h4 {\n font-size: 18px;\n}\nh5,\n.h5 {\n font-size: 14px;\n}\nh6,\n.h6 {\n font-size: 12px;\n}\np {\n margin: 0 0 10px;\n}\n.lead {\n margin-bottom: 20px;\n font-size: 16px;\n font-weight: 300;\n line-height: 1.4;\n}\n@media (min-width: 768px) {\n .lead {\n font-size: 21px;\n }\n}\nsmall,\n.small {\n font-size: 85%;\n}\nmark,\n.mark {\n background-color: #fcf8e3;\n padding: .2em;\n}\n.text-left {\n text-align: left;\n}\n.text-right {\n text-align: right;\n}\n.text-center {\n text-align: center;\n}\n.text-justify {\n text-align: justify;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-lowercase {\n text-transform: lowercase;\n}\n.text-uppercase {\n text-transform: uppercase;\n}\n.text-capitalize {\n text-transform: capitalize;\n}\n.text-muted {\n color: #777777;\n}\n.text-primary {\n color: #337ab7;\n}\na.text-primary:hover,\na.text-primary:focus {\n color: #286090;\n}\n.text-success {\n color: #3c763d;\n}\na.text-success:hover,\na.text-success:focus {\n color: #2b542c;\n}\n.text-info {\n color: #31708f;\n}\na.text-info:hover,\na.text-info:focus {\n color: #245269;\n}\n.text-warning {\n color: #8a6d3b;\n}\na.text-warning:hover,\na.text-warning:focus {\n color: #66512c;\n}\n.text-danger {\n color: #a94442;\n}\na.text-danger:hover,\na.text-danger:focus {\n color: #843534;\n}\n.bg-primary {\n color: #fff;\n background-color: #337ab7;\n}\na.bg-primary:hover,\na.bg-primary:focus {\n background-color: #286090;\n}\n.bg-success {\n background-color: #dff0d8;\n}\na.bg-success:hover,\na.bg-success:focus {\n background-color: #c1e2b3;\n}\n.bg-info {\n background-color: #d9edf7;\n}\na.bg-info:hover,\na.bg-info:focus {\n background-color: #afd9ee;\n}\n.bg-warning {\n background-color: #fcf8e3;\n}\na.bg-warning:hover,\na.bg-warning:focus {\n background-color: #f7ecb5;\n}\n.bg-danger {\n background-color: #f2dede;\n}\na.bg-danger:hover,\na.bg-danger:focus {\n background-color: #e4b9b9;\n}\n.page-header {\n padding-bottom: 9px;\n margin: 40px 0 20px;\n border-bottom: 1px solid #eeeeee;\n}\nul,\nol {\n margin-top: 0;\n margin-bottom: 10px;\n}\nul ul,\nol ul,\nul ol,\nol ol {\n margin-bottom: 0;\n}\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n.list-inline {\n padding-left: 0;\n list-style: none;\n margin-left: -5px;\n}\n.list-inline > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n}\ndl {\n margin-top: 0;\n margin-bottom: 20px;\n}\ndt,\ndd {\n line-height: 1.42857143;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0;\n}\n@media (min-width: 768px) {\n .dl-horizontal dt {\n float: left;\n width: 160px;\n clear: left;\n text-align: right;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .dl-horizontal dd {\n margin-left: 180px;\n }\n}\nabbr[title],\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted #777777;\n}\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\nblockquote {\n padding: 10px 20px;\n margin: 0 0 20px;\n font-size: 17.5px;\n border-left: 5px solid #eeeeee;\n}\nblockquote p:last-child,\nblockquote ul:last-child,\nblockquote ol:last-child {\n margin-bottom: 0;\n}\nblockquote footer,\nblockquote small,\nblockquote .small {\n display: block;\n font-size: 80%;\n line-height: 1.42857143;\n color: #777777;\n}\nblockquote footer:before,\nblockquote small:before,\nblockquote .small:before {\n content: '\\2014 \\00A0';\n}\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid #eeeeee;\n border-left: 0;\n text-align: right;\n}\n.blockquote-reverse footer:before,\nblockquote.pull-right footer:before,\n.blockquote-reverse small:before,\nblockquote.pull-right small:before,\n.blockquote-reverse .small:before,\nblockquote.pull-right .small:before {\n content: '';\n}\n.blockquote-reverse footer:after,\nblockquote.pull-right footer:after,\n.blockquote-reverse small:after,\nblockquote.pull-right small:after,\n.blockquote-reverse .small:after,\nblockquote.pull-right .small:after {\n content: '\\00A0 \\2014';\n}\naddress {\n margin-bottom: 20px;\n font-style: normal;\n line-height: 1.42857143;\n}\ncode,\nkbd,\npre,\nsamp {\n font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: #c7254e;\n background-color: #f9f2f4;\n border-radius: 4px;\n}\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: #fff;\n background-color: #333;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25);\n}\nkbd kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n}\npre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333333;\n background-color: #f5f5f5;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\npre code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n}\n.pre-scrollable {\n max-height: 340px;\n overflow-y: scroll;\n}\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n@media (min-width: 768px) {\n .container {\n width: 750px;\n }\n}\n@media (min-width: 992px) {\n .container {\n width: 970px;\n }\n}\n@media (min-width: 1200px) {\n .container {\n width: 1170px;\n }\n}\n.container-fluid {\n margin-right: auto;\n margin-left: auto;\n padding-left: 15px;\n padding-right: 15px;\n}\n.row {\n margin-left: -15px;\n margin-right: -15px;\n}\n.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {\n position: relative;\n min-height: 1px;\n padding-left: 15px;\n padding-right: 15px;\n}\n.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {\n float: left;\n}\n.col-xs-12 {\n width: 100%;\n}\n.col-xs-11 {\n width: 91.66666667%;\n}\n.col-xs-10 {\n width: 83.33333333%;\n}\n.col-xs-9 {\n width: 75%;\n}\n.col-xs-8 {\n width: 66.66666667%;\n}\n.col-xs-7 {\n width: 58.33333333%;\n}\n.col-xs-6 {\n width: 50%;\n}\n.col-xs-5 {\n width: 41.66666667%;\n}\n.col-xs-4 {\n width: 33.33333333%;\n}\n.col-xs-3 {\n width: 25%;\n}\n.col-xs-2 {\n width: 16.66666667%;\n}\n.col-xs-1 {\n width: 8.33333333%;\n}\n.col-xs-pull-12 {\n right: 100%;\n}\n.col-xs-pull-11 {\n right: 91.66666667%;\n}\n.col-xs-pull-10 {\n right: 83.33333333%;\n}\n.col-xs-pull-9 {\n right: 75%;\n}\n.col-xs-pull-8 {\n right: 66.66666667%;\n}\n.col-xs-pull-7 {\n right: 58.33333333%;\n}\n.col-xs-pull-6 {\n right: 50%;\n}\n.col-xs-pull-5 {\n right: 41.66666667%;\n}\n.col-xs-pull-4 {\n right: 33.33333333%;\n}\n.col-xs-pull-3 {\n right: 25%;\n}\n.col-xs-pull-2 {\n right: 16.66666667%;\n}\n.col-xs-pull-1 {\n right: 8.33333333%;\n}\n.col-xs-pull-0 {\n right: auto;\n}\n.col-xs-push-12 {\n left: 100%;\n}\n.col-xs-push-11 {\n left: 91.66666667%;\n}\n.col-xs-push-10 {\n left: 83.33333333%;\n}\n.col-xs-push-9 {\n left: 75%;\n}\n.col-xs-push-8 {\n left: 66.66666667%;\n}\n.col-xs-push-7 {\n left: 58.33333333%;\n}\n.col-xs-push-6 {\n left: 50%;\n}\n.col-xs-push-5 {\n left: 41.66666667%;\n}\n.col-xs-push-4 {\n left: 33.33333333%;\n}\n.col-xs-push-3 {\n left: 25%;\n}\n.col-xs-push-2 {\n left: 16.66666667%;\n}\n.col-xs-push-1 {\n left: 8.33333333%;\n}\n.col-xs-push-0 {\n left: auto;\n}\n.col-xs-offset-12 {\n margin-left: 100%;\n}\n.col-xs-offset-11 {\n margin-left: 91.66666667%;\n}\n.col-xs-offset-10 {\n margin-left: 83.33333333%;\n}\n.col-xs-offset-9 {\n margin-left: 75%;\n}\n.col-xs-offset-8 {\n margin-left: 66.66666667%;\n}\n.col-xs-offset-7 {\n margin-left: 58.33333333%;\n}\n.col-xs-offset-6 {\n margin-left: 50%;\n}\n.col-xs-offset-5 {\n margin-left: 41.66666667%;\n}\n.col-xs-offset-4 {\n margin-left: 33.33333333%;\n}\n.col-xs-offset-3 {\n margin-left: 25%;\n}\n.col-xs-offset-2 {\n margin-left: 16.66666667%;\n}\n.col-xs-offset-1 {\n margin-left: 8.33333333%;\n}\n.col-xs-offset-0 {\n margin-left: 0%;\n}\n@media (min-width: 768px) {\n .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {\n float: left;\n }\n .col-sm-12 {\n width: 100%;\n }\n .col-sm-11 {\n width: 91.66666667%;\n }\n .col-sm-10 {\n width: 83.33333333%;\n }\n .col-sm-9 {\n width: 75%;\n }\n .col-sm-8 {\n width: 66.66666667%;\n }\n .col-sm-7 {\n width: 58.33333333%;\n }\n .col-sm-6 {\n width: 50%;\n }\n .col-sm-5 {\n width: 41.66666667%;\n }\n .col-sm-4 {\n width: 33.33333333%;\n }\n .col-sm-3 {\n width: 25%;\n }\n .col-sm-2 {\n width: 16.66666667%;\n }\n .col-sm-1 {\n width: 8.33333333%;\n }\n .col-sm-pull-12 {\n right: 100%;\n }\n .col-sm-pull-11 {\n right: 91.66666667%;\n }\n .col-sm-pull-10 {\n right: 83.33333333%;\n }\n .col-sm-pull-9 {\n right: 75%;\n }\n .col-sm-pull-8 {\n right: 66.66666667%;\n }\n .col-sm-pull-7 {\n right: 58.33333333%;\n }\n .col-sm-pull-6 {\n right: 50%;\n }\n .col-sm-pull-5 {\n right: 41.66666667%;\n }\n .col-sm-pull-4 {\n right: 33.33333333%;\n }\n .col-sm-pull-3 {\n right: 25%;\n }\n .col-sm-pull-2 {\n right: 16.66666667%;\n }\n .col-sm-pull-1 {\n right: 8.33333333%;\n }\n .col-sm-pull-0 {\n right: auto;\n }\n .col-sm-push-12 {\n left: 100%;\n }\n .col-sm-push-11 {\n left: 91.66666667%;\n }\n .col-sm-push-10 {\n left: 83.33333333%;\n }\n .col-sm-push-9 {\n left: 75%;\n }\n .col-sm-push-8 {\n left: 66.66666667%;\n }\n .col-sm-push-7 {\n left: 58.33333333%;\n }\n .col-sm-push-6 {\n left: 50%;\n }\n .col-sm-push-5 {\n left: 41.66666667%;\n }\n .col-sm-push-4 {\n left: 33.33333333%;\n }\n .col-sm-push-3 {\n left: 25%;\n }\n .col-sm-push-2 {\n left: 16.66666667%;\n }\n .col-sm-push-1 {\n left: 8.33333333%;\n }\n .col-sm-push-0 {\n left: auto;\n }\n .col-sm-offset-12 {\n margin-left: 100%;\n }\n .col-sm-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-sm-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-sm-offset-9 {\n margin-left: 75%;\n }\n .col-sm-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-sm-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-sm-offset-6 {\n margin-left: 50%;\n }\n .col-sm-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-sm-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-sm-offset-3 {\n margin-left: 25%;\n }\n .col-sm-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-sm-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-sm-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 992px) {\n .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {\n float: left;\n }\n .col-md-12 {\n width: 100%;\n }\n .col-md-11 {\n width: 91.66666667%;\n }\n .col-md-10 {\n width: 83.33333333%;\n }\n .col-md-9 {\n width: 75%;\n }\n .col-md-8 {\n width: 66.66666667%;\n }\n .col-md-7 {\n width: 58.33333333%;\n }\n .col-md-6 {\n width: 50%;\n }\n .col-md-5 {\n width: 41.66666667%;\n }\n .col-md-4 {\n width: 33.33333333%;\n }\n .col-md-3 {\n width: 25%;\n }\n .col-md-2 {\n width: 16.66666667%;\n }\n .col-md-1 {\n width: 8.33333333%;\n }\n .col-md-pull-12 {\n right: 100%;\n }\n .col-md-pull-11 {\n right: 91.66666667%;\n }\n .col-md-pull-10 {\n right: 83.33333333%;\n }\n .col-md-pull-9 {\n right: 75%;\n }\n .col-md-pull-8 {\n right: 66.66666667%;\n }\n .col-md-pull-7 {\n right: 58.33333333%;\n }\n .col-md-pull-6 {\n right: 50%;\n }\n .col-md-pull-5 {\n right: 41.66666667%;\n }\n .col-md-pull-4 {\n right: 33.33333333%;\n }\n .col-md-pull-3 {\n right: 25%;\n }\n .col-md-pull-2 {\n right: 16.66666667%;\n }\n .col-md-pull-1 {\n right: 8.33333333%;\n }\n .col-md-pull-0 {\n right: auto;\n }\n .col-md-push-12 {\n left: 100%;\n }\n .col-md-push-11 {\n left: 91.66666667%;\n }\n .col-md-push-10 {\n left: 83.33333333%;\n }\n .col-md-push-9 {\n left: 75%;\n }\n .col-md-push-8 {\n left: 66.66666667%;\n }\n .col-md-push-7 {\n left: 58.33333333%;\n }\n .col-md-push-6 {\n left: 50%;\n }\n .col-md-push-5 {\n left: 41.66666667%;\n }\n .col-md-push-4 {\n left: 33.33333333%;\n }\n .col-md-push-3 {\n left: 25%;\n }\n .col-md-push-2 {\n left: 16.66666667%;\n }\n .col-md-push-1 {\n left: 8.33333333%;\n }\n .col-md-push-0 {\n left: auto;\n }\n .col-md-offset-12 {\n margin-left: 100%;\n }\n .col-md-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-md-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-md-offset-9 {\n margin-left: 75%;\n }\n .col-md-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-md-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-md-offset-6 {\n margin-left: 50%;\n }\n .col-md-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-md-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-md-offset-3 {\n margin-left: 25%;\n }\n .col-md-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-md-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-md-offset-0 {\n margin-left: 0%;\n }\n}\n@media (min-width: 1200px) {\n .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {\n float: left;\n }\n .col-lg-12 {\n width: 100%;\n }\n .col-lg-11 {\n width: 91.66666667%;\n }\n .col-lg-10 {\n width: 83.33333333%;\n }\n .col-lg-9 {\n width: 75%;\n }\n .col-lg-8 {\n width: 66.66666667%;\n }\n .col-lg-7 {\n width: 58.33333333%;\n }\n .col-lg-6 {\n width: 50%;\n }\n .col-lg-5 {\n width: 41.66666667%;\n }\n .col-lg-4 {\n width: 33.33333333%;\n }\n .col-lg-3 {\n width: 25%;\n }\n .col-lg-2 {\n width: 16.66666667%;\n }\n .col-lg-1 {\n width: 8.33333333%;\n }\n .col-lg-pull-12 {\n right: 100%;\n }\n .col-lg-pull-11 {\n right: 91.66666667%;\n }\n .col-lg-pull-10 {\n right: 83.33333333%;\n }\n .col-lg-pull-9 {\n right: 75%;\n }\n .col-lg-pull-8 {\n right: 66.66666667%;\n }\n .col-lg-pull-7 {\n right: 58.33333333%;\n }\n .col-lg-pull-6 {\n right: 50%;\n }\n .col-lg-pull-5 {\n right: 41.66666667%;\n }\n .col-lg-pull-4 {\n right: 33.33333333%;\n }\n .col-lg-pull-3 {\n right: 25%;\n }\n .col-lg-pull-2 {\n right: 16.66666667%;\n }\n .col-lg-pull-1 {\n right: 8.33333333%;\n }\n .col-lg-pull-0 {\n right: auto;\n }\n .col-lg-push-12 {\n left: 100%;\n }\n .col-lg-push-11 {\n left: 91.66666667%;\n }\n .col-lg-push-10 {\n left: 83.33333333%;\n }\n .col-lg-push-9 {\n left: 75%;\n }\n .col-lg-push-8 {\n left: 66.66666667%;\n }\n .col-lg-push-7 {\n left: 58.33333333%;\n }\n .col-lg-push-6 {\n left: 50%;\n }\n .col-lg-push-5 {\n left: 41.66666667%;\n }\n .col-lg-push-4 {\n left: 33.33333333%;\n }\n .col-lg-push-3 {\n left: 25%;\n }\n .col-lg-push-2 {\n left: 16.66666667%;\n }\n .col-lg-push-1 {\n left: 8.33333333%;\n }\n .col-lg-push-0 {\n left: auto;\n }\n .col-lg-offset-12 {\n margin-left: 100%;\n }\n .col-lg-offset-11 {\n margin-left: 91.66666667%;\n }\n .col-lg-offset-10 {\n margin-left: 83.33333333%;\n }\n .col-lg-offset-9 {\n margin-left: 75%;\n }\n .col-lg-offset-8 {\n margin-left: 66.66666667%;\n }\n .col-lg-offset-7 {\n margin-left: 58.33333333%;\n }\n .col-lg-offset-6 {\n margin-left: 50%;\n }\n .col-lg-offset-5 {\n margin-left: 41.66666667%;\n }\n .col-lg-offset-4 {\n margin-left: 33.33333333%;\n }\n .col-lg-offset-3 {\n margin-left: 25%;\n }\n .col-lg-offset-2 {\n margin-left: 16.66666667%;\n }\n .col-lg-offset-1 {\n margin-left: 8.33333333%;\n }\n .col-lg-offset-0 {\n margin-left: 0%;\n }\n}\ntable {\n background-color: transparent;\n}\ncaption {\n padding-top: 8px;\n padding-bottom: 8px;\n color: #777777;\n text-align: left;\n}\nth {\n text-align: left;\n}\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: 20px;\n}\n.table > thead > tr > th,\n.table > tbody > tr > th,\n.table > tfoot > tr > th,\n.table > thead > tr > td,\n.table > tbody > tr > td,\n.table > tfoot > tr > td {\n padding: 8px;\n line-height: 1.42857143;\n vertical-align: top;\n border-top: 1px solid #ddd;\n}\n.table > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid #ddd;\n}\n.table > caption + thead > tr:first-child > th,\n.table > colgroup + thead > tr:first-child > th,\n.table > thead:first-child > tr:first-child > th,\n.table > caption + thead > tr:first-child > td,\n.table > colgroup + thead > tr:first-child > td,\n.table > thead:first-child > tr:first-child > td {\n border-top: 0;\n}\n.table > tbody + tbody {\n border-top: 2px solid #ddd;\n}\n.table .table {\n background-color: #fff;\n}\n.table-condensed > thead > tr > th,\n.table-condensed > tbody > tr > th,\n.table-condensed > tfoot > tr > th,\n.table-condensed > thead > tr > td,\n.table-condensed > tbody > tr > td,\n.table-condensed > tfoot > tr > td {\n padding: 5px;\n}\n.table-bordered {\n border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > tbody > tr > th,\n.table-bordered > tfoot > tr > th,\n.table-bordered > thead > tr > td,\n.table-bordered > tbody > tr > td,\n.table-bordered > tfoot > tr > td {\n border: 1px solid #ddd;\n}\n.table-bordered > thead > tr > th,\n.table-bordered > thead > tr > td {\n border-bottom-width: 2px;\n}\n.table-striped > tbody > tr:nth-of-type(odd) {\n background-color: #f9f9f9;\n}\n.table-hover > tbody > tr:hover {\n background-color: #f5f5f5;\n}\ntable col[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-column;\n}\ntable td[class*=\"col-\"],\ntable th[class*=\"col-\"] {\n position: static;\n float: none;\n display: table-cell;\n}\n.table > thead > tr > td.active,\n.table > tbody > tr > td.active,\n.table > tfoot > tr > td.active,\n.table > thead > tr > th.active,\n.table > tbody > tr > th.active,\n.table > tfoot > tr > th.active,\n.table > thead > tr.active > td,\n.table > tbody > tr.active > td,\n.table > tfoot > tr.active > td,\n.table > thead > tr.active > th,\n.table > tbody > tr.active > th,\n.table > tfoot > tr.active > th {\n background-color: #f5f5f5;\n}\n.table-hover > tbody > tr > td.active:hover,\n.table-hover > tbody > tr > th.active:hover,\n.table-hover > tbody > tr.active:hover > td,\n.table-hover > tbody > tr:hover > .active,\n.table-hover > tbody > tr.active:hover > th {\n background-color: #e8e8e8;\n}\n.table > thead > tr > td.success,\n.table > tbody > tr > td.success,\n.table > tfoot > tr > td.success,\n.table > thead > tr > th.success,\n.table > tbody > tr > th.success,\n.table > tfoot > tr > th.success,\n.table > thead > tr.success > td,\n.table > tbody > tr.success > td,\n.table > tfoot > tr.success > td,\n.table > thead > tr.success > th,\n.table > tbody > tr.success > th,\n.table > tfoot > tr.success > th {\n background-color: #dff0d8;\n}\n.table-hover > tbody > tr > td.success:hover,\n.table-hover > tbody > tr > th.success:hover,\n.table-hover > tbody > tr.success:hover > td,\n.table-hover > tbody > tr:hover > .success,\n.table-hover > tbody > tr.success:hover > th {\n background-color: #d0e9c6;\n}\n.table > thead > tr > td.info,\n.table > tbody > tr > td.info,\n.table > tfoot > tr > td.info,\n.table > thead > tr > th.info,\n.table > tbody > tr > th.info,\n.table > tfoot > tr > th.info,\n.table > thead > tr.info > td,\n.table > tbody > tr.info > td,\n.table > tfoot > tr.info > td,\n.table > thead > tr.info > th,\n.table > tbody > tr.info > th,\n.table > tfoot > tr.info > th {\n background-color: #d9edf7;\n}\n.table-hover > tbody > tr > td.info:hover,\n.table-hover > tbody > tr > th.info:hover,\n.table-hover > tbody > tr.info:hover > td,\n.table-hover > tbody > tr:hover > .info,\n.table-hover > tbody > tr.info:hover > th {\n background-color: #c4e3f3;\n}\n.table > thead > tr > td.warning,\n.table > tbody > tr > td.warning,\n.table > tfoot > tr > td.warning,\n.table > thead > tr > th.warning,\n.table > tbody > tr > th.warning,\n.table > tfoot > tr > th.warning,\n.table > thead > tr.warning > td,\n.table > tbody > tr.warning > td,\n.table > tfoot > tr.warning > td,\n.table > thead > tr.warning > th,\n.table > tbody > tr.warning > th,\n.table > tfoot > tr.warning > th {\n background-color: #fcf8e3;\n}\n.table-hover > tbody > tr > td.warning:hover,\n.table-hover > tbody > tr > th.warning:hover,\n.table-hover > tbody > tr.warning:hover > td,\n.table-hover > tbody > tr:hover > .warning,\n.table-hover > tbody > tr.warning:hover > th {\n background-color: #faf2cc;\n}\n.table > thead > tr > td.danger,\n.table > tbody > tr > td.danger,\n.table > tfoot > tr > td.danger,\n.table > thead > tr > th.danger,\n.table > tbody > tr > th.danger,\n.table > tfoot > tr > th.danger,\n.table > thead > tr.danger > td,\n.table > tbody > tr.danger > td,\n.table > tfoot > tr.danger > td,\n.table > thead > tr.danger > th,\n.table > tbody > tr.danger > th,\n.table > tfoot > tr.danger > th {\n background-color: #f2dede;\n}\n.table-hover > tbody > tr > td.danger:hover,\n.table-hover > tbody > tr > th.danger:hover,\n.table-hover > tbody > tr.danger:hover > td,\n.table-hover > tbody > tr:hover > .danger,\n.table-hover > tbody > tr.danger:hover > th {\n background-color: #ebcccc;\n}\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%;\n}\n@media screen and (max-width: 767px) {\n .table-responsive {\n width: 100%;\n margin-bottom: 15px;\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid #ddd;\n }\n .table-responsive > .table {\n margin-bottom: 0;\n }\n .table-responsive > .table > thead > tr > th,\n .table-responsive > .table > tbody > tr > th,\n .table-responsive > .table > tfoot > tr > th,\n .table-responsive > .table > thead > tr > td,\n .table-responsive > .table > tbody > tr > td,\n .table-responsive > .table > tfoot > tr > td {\n white-space: nowrap;\n }\n .table-responsive > .table-bordered {\n border: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:first-child,\n .table-responsive > .table-bordered > tbody > tr > th:first-child,\n .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n .table-responsive > .table-bordered > thead > tr > td:first-child,\n .table-responsive > .table-bordered > tbody > tr > td:first-child,\n .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n }\n .table-responsive > .table-bordered > thead > tr > th:last-child,\n .table-responsive > .table-bordered > tbody > tr > th:last-child,\n .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n .table-responsive > .table-bordered > thead > tr > td:last-child,\n .table-responsive > .table-bordered > tbody > tr > td:last-child,\n .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n }\n .table-responsive > .table-bordered > tbody > tr:last-child > th,\n .table-responsive > .table-bordered > tfoot > tr:last-child > th,\n .table-responsive > .table-bordered > tbody > tr:last-child > td,\n .table-responsive > .table-bordered > tfoot > tr:last-child > td {\n border-bottom: 0;\n }\n}\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n min-width: 0;\n}\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: 20px;\n font-size: 21px;\n line-height: inherit;\n color: #333333;\n border: 0;\n border-bottom: 1px solid #e5e5e5;\n}\nlabel {\n display: inline-block;\n max-width: 100%;\n margin-bottom: 5px;\n font-weight: bold;\n}\ninput[type=\"search\"] {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n}\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9;\n line-height: normal;\n}\ninput[type=\"file\"] {\n display: block;\n}\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\nselect[multiple],\nselect[size] {\n height: auto;\n}\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\noutput {\n display: block;\n padding-top: 7px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n}\n.form-control {\n display: block;\n width: 100%;\n height: 34px;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n color: #555555;\n background-color: #fff;\n background-image: none;\n border: 1px solid #ccc;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;\n}\n.form-control:focus {\n border-color: #66afe9;\n outline: 0;\n -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);\n}\n.form-control::-moz-placeholder {\n color: #999;\n opacity: 1;\n}\n.form-control:-ms-input-placeholder {\n color: #999;\n}\n.form-control::-webkit-input-placeholder {\n color: #999;\n}\n.form-control::-ms-expand {\n border: 0;\n background-color: transparent;\n}\n.form-control[disabled],\n.form-control[readonly],\nfieldset[disabled] .form-control {\n background-color: #eeeeee;\n opacity: 1;\n}\n.form-control[disabled],\nfieldset[disabled] .form-control {\n cursor: not-allowed;\n}\ntextarea.form-control {\n height: auto;\n}\ninput[type=\"search\"] {\n -webkit-appearance: none;\n}\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n input[type=\"date\"].form-control,\n input[type=\"time\"].form-control,\n input[type=\"datetime-local\"].form-control,\n input[type=\"month\"].form-control {\n line-height: 34px;\n }\n input[type=\"date\"].input-sm,\n input[type=\"time\"].input-sm,\n input[type=\"datetime-local\"].input-sm,\n input[type=\"month\"].input-sm,\n .input-group-sm input[type=\"date\"],\n .input-group-sm input[type=\"time\"],\n .input-group-sm input[type=\"datetime-local\"],\n .input-group-sm input[type=\"month\"] {\n line-height: 30px;\n }\n input[type=\"date\"].input-lg,\n input[type=\"time\"].input-lg,\n input[type=\"datetime-local\"].input-lg,\n input[type=\"month\"].input-lg,\n .input-group-lg input[type=\"date\"],\n .input-group-lg input[type=\"time\"],\n .input-group-lg input[type=\"datetime-local\"],\n .input-group-lg input[type=\"month\"] {\n line-height: 46px;\n }\n}\n.form-group {\n margin-bottom: 15px;\n}\n.radio,\n.checkbox {\n position: relative;\n display: block;\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.radio label,\n.checkbox label {\n min-height: 20px;\n padding-left: 20px;\n margin-bottom: 0;\n font-weight: normal;\n cursor: pointer;\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n position: absolute;\n margin-left: -20px;\n margin-top: 4px \\9;\n}\n.radio + .radio,\n.checkbox + .checkbox {\n margin-top: -5px;\n}\n.radio-inline,\n.checkbox-inline {\n position: relative;\n display: inline-block;\n padding-left: 20px;\n margin-bottom: 0;\n vertical-align: middle;\n font-weight: normal;\n cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n margin-top: 0;\n margin-left: 10px;\n}\ninput[type=\"radio\"][disabled],\ninput[type=\"checkbox\"][disabled],\ninput[type=\"radio\"].disabled,\ninput[type=\"checkbox\"].disabled,\nfieldset[disabled] input[type=\"radio\"],\nfieldset[disabled] input[type=\"checkbox\"] {\n cursor: not-allowed;\n}\n.radio-inline.disabled,\n.checkbox-inline.disabled,\nfieldset[disabled] .radio-inline,\nfieldset[disabled] .checkbox-inline {\n cursor: not-allowed;\n}\n.radio.disabled label,\n.checkbox.disabled label,\nfieldset[disabled] .radio label,\nfieldset[disabled] .checkbox label {\n cursor: not-allowed;\n}\n.form-control-static {\n padding-top: 7px;\n padding-bottom: 7px;\n margin-bottom: 0;\n min-height: 34px;\n}\n.form-control-static.input-lg,\n.form-control-static.input-sm {\n padding-left: 0;\n padding-right: 0;\n}\n.input-sm {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-sm {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-sm,\nselect[multiple].input-sm {\n height: auto;\n}\n.form-group-sm .form-control {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.form-group-sm select.form-control {\n height: 30px;\n line-height: 30px;\n}\n.form-group-sm textarea.form-control,\n.form-group-sm select[multiple].form-control {\n height: auto;\n}\n.form-group-sm .form-control-static {\n height: 30px;\n min-height: 32px;\n padding: 6px 10px;\n font-size: 12px;\n line-height: 1.5;\n}\n.input-lg {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-lg {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-lg,\nselect[multiple].input-lg {\n height: auto;\n}\n.form-group-lg .form-control {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\n.form-group-lg select.form-control {\n height: 46px;\n line-height: 46px;\n}\n.form-group-lg textarea.form-control,\n.form-group-lg select[multiple].form-control {\n height: auto;\n}\n.form-group-lg .form-control-static {\n height: 46px;\n min-height: 38px;\n padding: 11px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n}\n.has-feedback {\n position: relative;\n}\n.has-feedback .form-control {\n padding-right: 42.5px;\n}\n.form-control-feedback {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2;\n display: block;\n width: 34px;\n height: 34px;\n line-height: 34px;\n text-align: center;\n pointer-events: none;\n}\n.input-lg + .form-control-feedback,\n.input-group-lg + .form-control-feedback,\n.form-group-lg .form-control + .form-control-feedback {\n width: 46px;\n height: 46px;\n line-height: 46px;\n}\n.input-sm + .form-control-feedback,\n.input-group-sm + .form-control-feedback,\n.form-group-sm .form-control + .form-control-feedback {\n width: 30px;\n height: 30px;\n line-height: 30px;\n}\n.has-success .help-block,\n.has-success .control-label,\n.has-success .radio,\n.has-success .checkbox,\n.has-success .radio-inline,\n.has-success .checkbox-inline,\n.has-success.radio label,\n.has-success.checkbox label,\n.has-success.radio-inline label,\n.has-success.checkbox-inline label {\n color: #3c763d;\n}\n.has-success .form-control {\n border-color: #3c763d;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-success .form-control:focus {\n border-color: #2b542c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;\n}\n.has-success .input-group-addon {\n color: #3c763d;\n border-color: #3c763d;\n background-color: #dff0d8;\n}\n.has-success .form-control-feedback {\n color: #3c763d;\n}\n.has-warning .help-block,\n.has-warning .control-label,\n.has-warning .radio,\n.has-warning .checkbox,\n.has-warning .radio-inline,\n.has-warning .checkbox-inline,\n.has-warning.radio label,\n.has-warning.checkbox label,\n.has-warning.radio-inline label,\n.has-warning.checkbox-inline label {\n color: #8a6d3b;\n}\n.has-warning .form-control {\n border-color: #8a6d3b;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-warning .form-control:focus {\n border-color: #66512c;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;\n}\n.has-warning .input-group-addon {\n color: #8a6d3b;\n border-color: #8a6d3b;\n background-color: #fcf8e3;\n}\n.has-warning .form-control-feedback {\n color: #8a6d3b;\n}\n.has-error .help-block,\n.has-error .control-label,\n.has-error .radio,\n.has-error .checkbox,\n.has-error .radio-inline,\n.has-error .checkbox-inline,\n.has-error.radio label,\n.has-error.checkbox label,\n.has-error.radio-inline label,\n.has-error.checkbox-inline label {\n color: #a94442;\n}\n.has-error .form-control {\n border-color: #a94442;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n}\n.has-error .form-control:focus {\n border-color: #843534;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;\n}\n.has-error .input-group-addon {\n color: #a94442;\n border-color: #a94442;\n background-color: #f2dede;\n}\n.has-error .form-control-feedback {\n color: #a94442;\n}\n.has-feedback label ~ .form-control-feedback {\n top: 25px;\n}\n.has-feedback label.sr-only ~ .form-control-feedback {\n top: 0;\n}\n.help-block {\n display: block;\n margin-top: 5px;\n margin-bottom: 10px;\n color: #737373;\n}\n@media (min-width: 768px) {\n .form-inline .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .form-inline .form-control-static {\n display: inline-block;\n }\n .form-inline .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .form-inline .input-group .input-group-addon,\n .form-inline .input-group .input-group-btn,\n .form-inline .input-group .form-control {\n width: auto;\n }\n .form-inline .input-group > .form-control {\n width: 100%;\n }\n .form-inline .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio,\n .form-inline .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .radio label,\n .form-inline .checkbox label {\n padding-left: 0;\n }\n .form-inline .radio input[type=\"radio\"],\n .form-inline .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .form-inline .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox,\n.form-horizontal .radio-inline,\n.form-horizontal .checkbox-inline {\n margin-top: 0;\n margin-bottom: 0;\n padding-top: 7px;\n}\n.form-horizontal .radio,\n.form-horizontal .checkbox {\n min-height: 27px;\n}\n.form-horizontal .form-group {\n margin-left: -15px;\n margin-right: -15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .control-label {\n text-align: right;\n margin-bottom: 0;\n padding-top: 7px;\n }\n}\n.form-horizontal .has-feedback .form-control-feedback {\n right: 15px;\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-lg .control-label {\n padding-top: 11px;\n font-size: 18px;\n }\n}\n@media (min-width: 768px) {\n .form-horizontal .form-group-sm .control-label {\n padding-top: 6px;\n font-size: 12px;\n }\n}\n.btn {\n display: inline-block;\n margin-bottom: 0;\n font-weight: normal;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none;\n border: 1px solid transparent;\n white-space: nowrap;\n padding: 6px 12px;\n font-size: 14px;\n line-height: 1.42857143;\n border-radius: 4px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.btn:focus,\n.btn:active:focus,\n.btn.active:focus,\n.btn.focus,\n.btn:active.focus,\n.btn.active.focus {\n outline: thin dotted;\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n.btn:hover,\n.btn:focus,\n.btn.focus {\n color: #333;\n text-decoration: none;\n}\n.btn:active,\n.btn.active {\n outline: 0;\n background-image: none;\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn.disabled,\n.btn[disabled],\nfieldset[disabled] .btn {\n cursor: not-allowed;\n opacity: 0.65;\n filter: alpha(opacity=65);\n -webkit-box-shadow: none;\n box-shadow: none;\n}\na.btn.disabled,\nfieldset[disabled] a.btn {\n pointer-events: none;\n}\n.btn-default {\n color: #333;\n background-color: #fff;\n border-color: #ccc;\n}\n.btn-default:focus,\n.btn-default.focus {\n color: #333;\n background-color: #e6e6e6;\n border-color: #8c8c8c;\n}\n.btn-default:hover {\n color: #333;\n background-color: #e6e6e6;\n border-color: #adadad;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n color: #333;\n background-color: #e6e6e6;\n border-color: #adadad;\n}\n.btn-default:active:hover,\n.btn-default.active:hover,\n.open > .dropdown-toggle.btn-default:hover,\n.btn-default:active:focus,\n.btn-default.active:focus,\n.open > .dropdown-toggle.btn-default:focus,\n.btn-default:active.focus,\n.btn-default.active.focus,\n.open > .dropdown-toggle.btn-default.focus {\n color: #333;\n background-color: #d4d4d4;\n border-color: #8c8c8c;\n}\n.btn-default:active,\n.btn-default.active,\n.open > .dropdown-toggle.btn-default {\n background-image: none;\n}\n.btn-default.disabled:hover,\n.btn-default[disabled]:hover,\nfieldset[disabled] .btn-default:hover,\n.btn-default.disabled:focus,\n.btn-default[disabled]:focus,\nfieldset[disabled] .btn-default:focus,\n.btn-default.disabled.focus,\n.btn-default[disabled].focus,\nfieldset[disabled] .btn-default.focus {\n background-color: #fff;\n border-color: #ccc;\n}\n.btn-default .badge {\n color: #fff;\n background-color: #333;\n}\n.btn-primary {\n color: #fff;\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary:focus,\n.btn-primary.focus {\n color: #fff;\n background-color: #286090;\n border-color: #122b40;\n}\n.btn-primary:hover {\n color: #fff;\n background-color: #286090;\n border-color: #204d74;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n color: #fff;\n background-color: #286090;\n border-color: #204d74;\n}\n.btn-primary:active:hover,\n.btn-primary.active:hover,\n.open > .dropdown-toggle.btn-primary:hover,\n.btn-primary:active:focus,\n.btn-primary.active:focus,\n.open > .dropdown-toggle.btn-primary:focus,\n.btn-primary:active.focus,\n.btn-primary.active.focus,\n.open > .dropdown-toggle.btn-primary.focus {\n color: #fff;\n background-color: #204d74;\n border-color: #122b40;\n}\n.btn-primary:active,\n.btn-primary.active,\n.open > .dropdown-toggle.btn-primary {\n background-image: none;\n}\n.btn-primary.disabled:hover,\n.btn-primary[disabled]:hover,\nfieldset[disabled] .btn-primary:hover,\n.btn-primary.disabled:focus,\n.btn-primary[disabled]:focus,\nfieldset[disabled] .btn-primary:focus,\n.btn-primary.disabled.focus,\n.btn-primary[disabled].focus,\nfieldset[disabled] .btn-primary.focus {\n background-color: #337ab7;\n border-color: #2e6da4;\n}\n.btn-primary .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.btn-success {\n color: #fff;\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success:focus,\n.btn-success.focus {\n color: #fff;\n background-color: #449d44;\n border-color: #255625;\n}\n.btn-success:hover {\n color: #fff;\n background-color: #449d44;\n border-color: #398439;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n color: #fff;\n background-color: #449d44;\n border-color: #398439;\n}\n.btn-success:active:hover,\n.btn-success.active:hover,\n.open > .dropdown-toggle.btn-success:hover,\n.btn-success:active:focus,\n.btn-success.active:focus,\n.open > .dropdown-toggle.btn-success:focus,\n.btn-success:active.focus,\n.btn-success.active.focus,\n.open > .dropdown-toggle.btn-success.focus {\n color: #fff;\n background-color: #398439;\n border-color: #255625;\n}\n.btn-success:active,\n.btn-success.active,\n.open > .dropdown-toggle.btn-success {\n background-image: none;\n}\n.btn-success.disabled:hover,\n.btn-success[disabled]:hover,\nfieldset[disabled] .btn-success:hover,\n.btn-success.disabled:focus,\n.btn-success[disabled]:focus,\nfieldset[disabled] .btn-success:focus,\n.btn-success.disabled.focus,\n.btn-success[disabled].focus,\nfieldset[disabled] .btn-success.focus {\n background-color: #5cb85c;\n border-color: #4cae4c;\n}\n.btn-success .badge {\n color: #5cb85c;\n background-color: #fff;\n}\n.btn-info {\n color: #fff;\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info:focus,\n.btn-info.focus {\n color: #fff;\n background-color: #31b0d5;\n border-color: #1b6d85;\n}\n.btn-info:hover {\n color: #fff;\n background-color: #31b0d5;\n border-color: #269abc;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n color: #fff;\n background-color: #31b0d5;\n border-color: #269abc;\n}\n.btn-info:active:hover,\n.btn-info.active:hover,\n.open > .dropdown-toggle.btn-info:hover,\n.btn-info:active:focus,\n.btn-info.active:focus,\n.open > .dropdown-toggle.btn-info:focus,\n.btn-info:active.focus,\n.btn-info.active.focus,\n.open > .dropdown-toggle.btn-info.focus {\n color: #fff;\n background-color: #269abc;\n border-color: #1b6d85;\n}\n.btn-info:active,\n.btn-info.active,\n.open > .dropdown-toggle.btn-info {\n background-image: none;\n}\n.btn-info.disabled:hover,\n.btn-info[disabled]:hover,\nfieldset[disabled] .btn-info:hover,\n.btn-info.disabled:focus,\n.btn-info[disabled]:focus,\nfieldset[disabled] .btn-info:focus,\n.btn-info.disabled.focus,\n.btn-info[disabled].focus,\nfieldset[disabled] .btn-info.focus {\n background-color: #5bc0de;\n border-color: #46b8da;\n}\n.btn-info .badge {\n color: #5bc0de;\n background-color: #fff;\n}\n.btn-warning {\n color: #fff;\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning:focus,\n.btn-warning.focus {\n color: #fff;\n background-color: #ec971f;\n border-color: #985f0d;\n}\n.btn-warning:hover {\n color: #fff;\n background-color: #ec971f;\n border-color: #d58512;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n color: #fff;\n background-color: #ec971f;\n border-color: #d58512;\n}\n.btn-warning:active:hover,\n.btn-warning.active:hover,\n.open > .dropdown-toggle.btn-warning:hover,\n.btn-warning:active:focus,\n.btn-warning.active:focus,\n.open > .dropdown-toggle.btn-warning:focus,\n.btn-warning:active.focus,\n.btn-warning.active.focus,\n.open > .dropdown-toggle.btn-warning.focus {\n color: #fff;\n background-color: #d58512;\n border-color: #985f0d;\n}\n.btn-warning:active,\n.btn-warning.active,\n.open > .dropdown-toggle.btn-warning {\n background-image: none;\n}\n.btn-warning.disabled:hover,\n.btn-warning[disabled]:hover,\nfieldset[disabled] .btn-warning:hover,\n.btn-warning.disabled:focus,\n.btn-warning[disabled]:focus,\nfieldset[disabled] .btn-warning:focus,\n.btn-warning.disabled.focus,\n.btn-warning[disabled].focus,\nfieldset[disabled] .btn-warning.focus {\n background-color: #f0ad4e;\n border-color: #eea236;\n}\n.btn-warning .badge {\n color: #f0ad4e;\n background-color: #fff;\n}\n.btn-danger {\n color: #fff;\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger:focus,\n.btn-danger.focus {\n color: #fff;\n background-color: #c9302c;\n border-color: #761c19;\n}\n.btn-danger:hover {\n color: #fff;\n background-color: #c9302c;\n border-color: #ac2925;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n color: #fff;\n background-color: #c9302c;\n border-color: #ac2925;\n}\n.btn-danger:active:hover,\n.btn-danger.active:hover,\n.open > .dropdown-toggle.btn-danger:hover,\n.btn-danger:active:focus,\n.btn-danger.active:focus,\n.open > .dropdown-toggle.btn-danger:focus,\n.btn-danger:active.focus,\n.btn-danger.active.focus,\n.open > .dropdown-toggle.btn-danger.focus {\n color: #fff;\n background-color: #ac2925;\n border-color: #761c19;\n}\n.btn-danger:active,\n.btn-danger.active,\n.open > .dropdown-toggle.btn-danger {\n background-image: none;\n}\n.btn-danger.disabled:hover,\n.btn-danger[disabled]:hover,\nfieldset[disabled] .btn-danger:hover,\n.btn-danger.disabled:focus,\n.btn-danger[disabled]:focus,\nfieldset[disabled] .btn-danger:focus,\n.btn-danger.disabled.focus,\n.btn-danger[disabled].focus,\nfieldset[disabled] .btn-danger.focus {\n background-color: #d9534f;\n border-color: #d43f3a;\n}\n.btn-danger .badge {\n color: #d9534f;\n background-color: #fff;\n}\n.btn-link {\n color: #337ab7;\n font-weight: normal;\n border-radius: 0;\n}\n.btn-link,\n.btn-link:active,\n.btn-link.active,\n.btn-link[disabled],\nfieldset[disabled] .btn-link {\n background-color: transparent;\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn-link,\n.btn-link:hover,\n.btn-link:focus,\n.btn-link:active {\n border-color: transparent;\n}\n.btn-link:hover,\n.btn-link:focus {\n color: #23527c;\n text-decoration: underline;\n background-color: transparent;\n}\n.btn-link[disabled]:hover,\nfieldset[disabled] .btn-link:hover,\n.btn-link[disabled]:focus,\nfieldset[disabled] .btn-link:focus {\n color: #777777;\n text-decoration: none;\n}\n.btn-lg,\n.btn-group-lg > .btn {\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\n.btn-sm,\n.btn-group-sm > .btn {\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-xs,\n.btn-group-xs > .btn {\n padding: 1px 5px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\n.btn-block {\n display: block;\n width: 100%;\n}\n.btn-block + .btn-block {\n margin-top: 5px;\n}\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n width: 100%;\n}\n.fade {\n opacity: 0;\n -webkit-transition: opacity 0.15s linear;\n -o-transition: opacity 0.15s linear;\n transition: opacity 0.15s linear;\n}\n.fade.in {\n opacity: 1;\n}\n.collapse {\n display: none;\n}\n.collapse.in {\n display: block;\n}\ntr.collapse.in {\n display: table-row;\n}\ntbody.collapse.in {\n display: table-row-group;\n}\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n -webkit-transition-property: height, visibility;\n transition-property: height, visibility;\n -webkit-transition-duration: 0.35s;\n transition-duration: 0.35s;\n -webkit-transition-timing-function: ease;\n transition-timing-function: ease;\n}\n.caret {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 2px;\n vertical-align: middle;\n border-top: 4px dashed;\n border-top: 4px solid \\9;\n border-right: 4px solid transparent;\n border-left: 4px solid transparent;\n}\n.dropup,\n.dropdown {\n position: relative;\n}\n.dropdown-toggle:focus {\n outline: 0;\n}\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0;\n list-style: none;\n font-size: 14px;\n text-align: left;\n background-color: #fff;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);\n background-clip: padding-box;\n}\n.dropdown-menu.pull-right {\n right: 0;\n left: auto;\n}\n.dropdown-menu .divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.dropdown-menu > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: 1.42857143;\n color: #333333;\n white-space: nowrap;\n}\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n text-decoration: none;\n color: #262626;\n background-color: #f5f5f5;\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n color: #fff;\n text-decoration: none;\n outline: 0;\n background-color: #337ab7;\n}\n.dropdown-menu > .disabled > a,\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n color: #777777;\n}\n.dropdown-menu > .disabled > a:hover,\n.dropdown-menu > .disabled > a:focus {\n text-decoration: none;\n background-color: transparent;\n background-image: none;\n filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);\n cursor: not-allowed;\n}\n.open > .dropdown-menu {\n display: block;\n}\n.open > a {\n outline: 0;\n}\n.dropdown-menu-right {\n left: auto;\n right: 0;\n}\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n.dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: 12px;\n line-height: 1.42857143;\n color: #777777;\n white-space: nowrap;\n}\n.dropdown-backdrop {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: 990;\n}\n.pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n}\n.dropup .caret,\n.navbar-fixed-bottom .dropdown .caret {\n border-top: 0;\n border-bottom: 4px dashed;\n border-bottom: 4px solid \\9;\n content: \"\";\n}\n.dropup .dropdown-menu,\n.navbar-fixed-bottom .dropdown .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n}\n@media (min-width: 768px) {\n .navbar-right .dropdown-menu {\n left: auto;\n right: 0;\n }\n .navbar-right .dropdown-menu-left {\n left: 0;\n right: auto;\n }\n}\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-block;\n vertical-align: middle;\n}\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n position: relative;\n float: left;\n}\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover,\n.btn-group > .btn:focus,\n.btn-group-vertical > .btn:focus,\n.btn-group > .btn:active,\n.btn-group-vertical > .btn:active,\n.btn-group > .btn.active,\n.btn-group-vertical > .btn.active {\n z-index: 2;\n}\n.btn-group .btn + .btn,\n.btn-group .btn + .btn-group,\n.btn-group .btn-group + .btn,\n.btn-group .btn-group + .btn-group {\n margin-left: -1px;\n}\n.btn-toolbar {\n margin-left: -5px;\n}\n.btn-toolbar .btn,\n.btn-toolbar .btn-group,\n.btn-toolbar .input-group {\n float: left;\n}\n.btn-toolbar > .btn,\n.btn-toolbar > .btn-group,\n.btn-toolbar > .input-group {\n margin-left: 5px;\n}\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n.btn-group > .btn:first-child {\n margin-left: 0;\n}\n.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group > .btn-group {\n float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n outline: 0;\n}\n.btn-group > .btn + .dropdown-toggle {\n padding-left: 8px;\n padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n padding-left: 12px;\n padding-right: 12px;\n}\n.btn-group.open .dropdown-toggle {\n -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);\n}\n.btn-group.open .dropdown-toggle.btn-link {\n -webkit-box-shadow: none;\n box-shadow: none;\n}\n.btn .caret {\n margin-left: 0;\n}\n.btn-lg .caret {\n border-width: 5px 5px 0;\n border-bottom-width: 0;\n}\n.dropup .btn-lg .caret {\n border-width: 0 5px 5px;\n}\n.btn-group-vertical > .btn,\n.btn-group-vertical > .btn-group,\n.btn-group-vertical > .btn-group > .btn {\n display: block;\n float: none;\n width: 100%;\n max-width: 100%;\n}\n.btn-group-vertical > .btn-group > .btn {\n float: none;\n}\n.btn-group-vertical > .btn + .btn,\n.btn-group-vertical > .btn + .btn-group,\n.btn-group-vertical > .btn-group + .btn,\n.btn-group-vertical > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n}\n.btn-group-vertical > .btn:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.btn-group-vertical > .btn:first-child:not(:last-child) {\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn:last-child:not(:first-child) {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.btn-group-justified {\n display: table;\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n}\n.btn-group-justified > .btn,\n.btn-group-justified > .btn-group {\n float: none;\n display: table-cell;\n width: 1%;\n}\n.btn-group-justified > .btn-group .btn {\n width: 100%;\n}\n.btn-group-justified > .btn-group .dropdown-menu {\n left: auto;\n}\n[data-toggle=\"buttons\"] > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn input[type=\"checkbox\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n.input-group {\n position: relative;\n display: table;\n border-collapse: separate;\n}\n.input-group[class*=\"col-\"] {\n float: none;\n padding-left: 0;\n padding-right: 0;\n}\n.input-group .form-control {\n position: relative;\n z-index: 2;\n float: left;\n width: 100%;\n margin-bottom: 0;\n}\n.input-group .form-control:focus {\n z-index: 3;\n}\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n border-radius: 6px;\n}\nselect.input-group-lg > .form-control,\nselect.input-group-lg > .input-group-addon,\nselect.input-group-lg > .input-group-btn > .btn {\n height: 46px;\n line-height: 46px;\n}\ntextarea.input-group-lg > .form-control,\ntextarea.input-group-lg > .input-group-addon,\ntextarea.input-group-lg > .input-group-btn > .btn,\nselect[multiple].input-group-lg > .form-control,\nselect[multiple].input-group-lg > .input-group-addon,\nselect[multiple].input-group-lg > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 3px;\n}\nselect.input-group-sm > .form-control,\nselect.input-group-sm > .input-group-addon,\nselect.input-group-sm > .input-group-btn > .btn {\n height: 30px;\n line-height: 30px;\n}\ntextarea.input-group-sm > .form-control,\ntextarea.input-group-sm > .input-group-addon,\ntextarea.input-group-sm > .input-group-btn > .btn,\nselect[multiple].input-group-sm > .form-control,\nselect[multiple].input-group-sm > .input-group-addon,\nselect[multiple].input-group-sm > .input-group-btn > .btn {\n height: auto;\n}\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: table-cell;\n}\n.input-group-addon:not(:first-child):not(:last-child),\n.input-group-btn:not(:first-child):not(:last-child),\n.input-group .form-control:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n.input-group-addon,\n.input-group-btn {\n width: 1%;\n white-space: nowrap;\n vertical-align: middle;\n}\n.input-group-addon {\n padding: 6px 12px;\n font-size: 14px;\n font-weight: normal;\n line-height: 1;\n color: #555555;\n text-align: center;\n background-color: #eeeeee;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\n.input-group-addon.input-sm {\n padding: 5px 10px;\n font-size: 12px;\n border-radius: 3px;\n}\n.input-group-addon.input-lg {\n padding: 10px 16px;\n font-size: 18px;\n border-radius: 6px;\n}\n.input-group-addon input[type=\"radio\"],\n.input-group-addon input[type=\"checkbox\"] {\n margin-top: 0;\n}\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n border-bottom-right-radius: 0;\n border-top-right-radius: 0;\n}\n.input-group-addon:first-child {\n border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n}\n.input-group-addon:last-child {\n border-left: 0;\n}\n.input-group-btn {\n position: relative;\n font-size: 0;\n white-space: nowrap;\n}\n.input-group-btn > .btn {\n position: relative;\n}\n.input-group-btn > .btn + .btn {\n margin-left: -1px;\n}\n.input-group-btn > .btn:hover,\n.input-group-btn > .btn:focus,\n.input-group-btn > .btn:active {\n z-index: 2;\n}\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group {\n margin-right: -1px;\n}\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group {\n z-index: 2;\n margin-left: -1px;\n}\n.nav {\n margin-bottom: 0;\n padding-left: 0;\n list-style: none;\n}\n.nav > li {\n position: relative;\n display: block;\n}\n.nav > li > a {\n position: relative;\n display: block;\n padding: 10px 15px;\n}\n.nav > li > a:hover,\n.nav > li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.nav > li.disabled > a {\n color: #777777;\n}\n.nav > li.disabled > a:hover,\n.nav > li.disabled > a:focus {\n color: #777777;\n text-decoration: none;\n background-color: transparent;\n cursor: not-allowed;\n}\n.nav .open > a,\n.nav .open > a:hover,\n.nav .open > a:focus {\n background-color: #eeeeee;\n border-color: #337ab7;\n}\n.nav .nav-divider {\n height: 1px;\n margin: 9px 0;\n overflow: hidden;\n background-color: #e5e5e5;\n}\n.nav > li > a > img {\n max-width: none;\n}\n.nav-tabs {\n border-bottom: 1px solid #ddd;\n}\n.nav-tabs > li {\n float: left;\n margin-bottom: -1px;\n}\n.nav-tabs > li > a {\n margin-right: 2px;\n line-height: 1.42857143;\n border: 1px solid transparent;\n border-radius: 4px 4px 0 0;\n}\n.nav-tabs > li > a:hover {\n border-color: #eeeeee #eeeeee #ddd;\n}\n.nav-tabs > li.active > a,\n.nav-tabs > li.active > a:hover,\n.nav-tabs > li.active > a:focus {\n color: #555555;\n background-color: #fff;\n border: 1px solid #ddd;\n border-bottom-color: transparent;\n cursor: default;\n}\n.nav-tabs.nav-justified {\n width: 100%;\n border-bottom: 0;\n}\n.nav-tabs.nav-justified > li {\n float: none;\n}\n.nav-tabs.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-tabs.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-tabs.nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs.nav-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs.nav-justified > .active > a,\n.nav-tabs.nav-justified > .active > a:hover,\n.nav-tabs.nav-justified > .active > a:focus {\n border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n .nav-tabs.nav-justified > li > a {\n border-bottom: 1px solid #ddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs.nav-justified > .active > a,\n .nav-tabs.nav-justified > .active > a:hover,\n .nav-tabs.nav-justified > .active > a:focus {\n border-bottom-color: #fff;\n }\n}\n.nav-pills > li {\n float: left;\n}\n.nav-pills > li > a {\n border-radius: 4px;\n}\n.nav-pills > li + li {\n margin-left: 2px;\n}\n.nav-pills > li.active > a,\n.nav-pills > li.active > a:hover,\n.nav-pills > li.active > a:focus {\n color: #fff;\n background-color: #337ab7;\n}\n.nav-stacked > li {\n float: none;\n}\n.nav-stacked > li + li {\n margin-top: 2px;\n margin-left: 0;\n}\n.nav-justified {\n width: 100%;\n}\n.nav-justified > li {\n float: none;\n}\n.nav-justified > li > a {\n text-align: center;\n margin-bottom: 5px;\n}\n.nav-justified > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n}\n@media (min-width: 768px) {\n .nav-justified > li {\n display: table-cell;\n width: 1%;\n }\n .nav-justified > li > a {\n margin-bottom: 0;\n }\n}\n.nav-tabs-justified {\n border-bottom: 0;\n}\n.nav-tabs-justified > li > a {\n margin-right: 0;\n border-radius: 4px;\n}\n.nav-tabs-justified > .active > a,\n.nav-tabs-justified > .active > a:hover,\n.nav-tabs-justified > .active > a:focus {\n border: 1px solid #ddd;\n}\n@media (min-width: 768px) {\n .nav-tabs-justified > li > a {\n border-bottom: 1px solid #ddd;\n border-radius: 4px 4px 0 0;\n }\n .nav-tabs-justified > .active > a,\n .nav-tabs-justified > .active > a:hover,\n .nav-tabs-justified > .active > a:focus {\n border-bottom-color: #fff;\n }\n}\n.tab-content > .tab-pane {\n display: none;\n}\n.tab-content > .active {\n display: block;\n}\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar {\n position: relative;\n min-height: 50px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n}\n@media (min-width: 768px) {\n .navbar {\n border-radius: 4px;\n }\n}\n@media (min-width: 768px) {\n .navbar-header {\n float: left;\n }\n}\n.navbar-collapse {\n overflow-x: visible;\n padding-right: 15px;\n padding-left: 15px;\n border-top: 1px solid transparent;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);\n -webkit-overflow-scrolling: touch;\n}\n.navbar-collapse.in {\n overflow-y: auto;\n}\n@media (min-width: 768px) {\n .navbar-collapse {\n width: auto;\n border-top: 0;\n box-shadow: none;\n }\n .navbar-collapse.collapse {\n display: block !important;\n height: auto !important;\n padding-bottom: 0;\n overflow: visible !important;\n }\n .navbar-collapse.in {\n overflow-y: visible;\n }\n .navbar-fixed-top .navbar-collapse,\n .navbar-static-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n padding-left: 0;\n padding-right: 0;\n }\n}\n.navbar-fixed-top .navbar-collapse,\n.navbar-fixed-bottom .navbar-collapse {\n max-height: 340px;\n}\n@media (max-device-width: 480px) and (orientation: landscape) {\n .navbar-fixed-top .navbar-collapse,\n .navbar-fixed-bottom .navbar-collapse {\n max-height: 200px;\n }\n}\n.container > .navbar-header,\n.container-fluid > .navbar-header,\n.container > .navbar-collapse,\n.container-fluid > .navbar-collapse {\n margin-right: -15px;\n margin-left: -15px;\n}\n@media (min-width: 768px) {\n .container > .navbar-header,\n .container-fluid > .navbar-header,\n .container > .navbar-collapse,\n .container-fluid > .navbar-collapse {\n margin-right: 0;\n margin-left: 0;\n }\n}\n.navbar-static-top {\n z-index: 1000;\n border-width: 0 0 1px;\n}\n@media (min-width: 768px) {\n .navbar-static-top {\n border-radius: 0;\n }\n}\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n position: fixed;\n right: 0;\n left: 0;\n z-index: 1030;\n}\n@media (min-width: 768px) {\n .navbar-fixed-top,\n .navbar-fixed-bottom {\n border-radius: 0;\n }\n}\n.navbar-fixed-top {\n top: 0;\n border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n bottom: 0;\n margin-bottom: 0;\n border-width: 1px 0 0;\n}\n.navbar-brand {\n float: left;\n padding: 15px 15px;\n font-size: 18px;\n line-height: 20px;\n height: 50px;\n}\n.navbar-brand:hover,\n.navbar-brand:focus {\n text-decoration: none;\n}\n.navbar-brand > img {\n display: block;\n}\n@media (min-width: 768px) {\n .navbar > .container .navbar-brand,\n .navbar > .container-fluid .navbar-brand {\n margin-left: -15px;\n }\n}\n.navbar-toggle {\n position: relative;\n float: right;\n margin-right: 15px;\n padding: 9px 10px;\n margin-top: 8px;\n margin-bottom: 8px;\n background-color: transparent;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.navbar-toggle:focus {\n outline: 0;\n}\n.navbar-toggle .icon-bar {\n display: block;\n width: 22px;\n height: 2px;\n border-radius: 1px;\n}\n.navbar-toggle .icon-bar + .icon-bar {\n margin-top: 4px;\n}\n@media (min-width: 768px) {\n .navbar-toggle {\n display: none;\n }\n}\n.navbar-nav {\n margin: 7.5px -15px;\n}\n.navbar-nav > li > a {\n padding-top: 10px;\n padding-bottom: 10px;\n line-height: 20px;\n}\n@media (max-width: 767px) {\n .navbar-nav .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n box-shadow: none;\n }\n .navbar-nav .open .dropdown-menu > li > a,\n .navbar-nav .open .dropdown-menu .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n .navbar-nav .open .dropdown-menu > li > a {\n line-height: 20px;\n }\n .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-nav .open .dropdown-menu > li > a:focus {\n background-image: none;\n }\n}\n@media (min-width: 768px) {\n .navbar-nav {\n float: left;\n margin: 0;\n }\n .navbar-nav > li {\n float: left;\n }\n .navbar-nav > li > a {\n padding-top: 15px;\n padding-bottom: 15px;\n }\n}\n.navbar-form {\n margin-left: -15px;\n margin-right: -15px;\n padding: 10px 15px;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);\n margin-top: 8px;\n margin-bottom: 8px;\n}\n@media (min-width: 768px) {\n .navbar-form .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .navbar-form .form-control-static {\n display: inline-block;\n }\n .navbar-form .input-group {\n display: inline-table;\n vertical-align: middle;\n }\n .navbar-form .input-group .input-group-addon,\n .navbar-form .input-group .input-group-btn,\n .navbar-form .input-group .form-control {\n width: auto;\n }\n .navbar-form .input-group > .form-control {\n width: 100%;\n }\n .navbar-form .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio,\n .navbar-form .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n }\n .navbar-form .radio label,\n .navbar-form .checkbox label {\n padding-left: 0;\n }\n .navbar-form .radio input[type=\"radio\"],\n .navbar-form .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n .navbar-form .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n@media (max-width: 767px) {\n .navbar-form .form-group {\n margin-bottom: 5px;\n }\n .navbar-form .form-group:last-child {\n margin-bottom: 0;\n }\n}\n@media (min-width: 768px) {\n .navbar-form {\n width: auto;\n border: 0;\n margin-left: 0;\n margin-right: 0;\n padding-top: 0;\n padding-bottom: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n}\n.navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.navbar-btn {\n margin-top: 8px;\n margin-bottom: 8px;\n}\n.navbar-btn.btn-sm {\n margin-top: 10px;\n margin-bottom: 10px;\n}\n.navbar-btn.btn-xs {\n margin-top: 14px;\n margin-bottom: 14px;\n}\n.navbar-text {\n margin-top: 15px;\n margin-bottom: 15px;\n}\n@media (min-width: 768px) {\n .navbar-text {\n float: left;\n margin-left: 15px;\n margin-right: 15px;\n }\n}\n@media (min-width: 768px) {\n .navbar-left {\n float: left !important;\n }\n .navbar-right {\n float: right !important;\n margin-right: -15px;\n }\n .navbar-right ~ .navbar-right {\n margin-right: 0;\n }\n}\n.navbar-default {\n background-color: #f8f8f8;\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-brand {\n color: #777;\n}\n.navbar-default .navbar-brand:hover,\n.navbar-default .navbar-brand:focus {\n color: #5e5e5e;\n background-color: transparent;\n}\n.navbar-default .navbar-text {\n color: #777;\n}\n.navbar-default .navbar-nav > li > a {\n color: #777;\n}\n.navbar-default .navbar-nav > li > a:hover,\n.navbar-default .navbar-nav > li > a:focus {\n color: #333;\n background-color: transparent;\n}\n.navbar-default .navbar-nav > .active > a,\n.navbar-default .navbar-nav > .active > a:hover,\n.navbar-default .navbar-nav > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .disabled > a,\n.navbar-default .navbar-nav > .disabled > a:hover,\n.navbar-default .navbar-nav > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n}\n.navbar-default .navbar-toggle {\n border-color: #ddd;\n}\n.navbar-default .navbar-toggle:hover,\n.navbar-default .navbar-toggle:focus {\n background-color: #ddd;\n}\n.navbar-default .navbar-toggle .icon-bar {\n background-color: #888;\n}\n.navbar-default .navbar-collapse,\n.navbar-default .navbar-form {\n border-color: #e7e7e7;\n}\n.navbar-default .navbar-nav > .open > a,\n.navbar-default .navbar-nav > .open > a:hover,\n.navbar-default .navbar-nav > .open > a:focus {\n background-color: #e7e7e7;\n color: #555;\n}\n@media (max-width: 767px) {\n .navbar-default .navbar-nav .open .dropdown-menu > li > a {\n color: #777;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #333;\n background-color: transparent;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #555;\n background-color: #e7e7e7;\n }\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #ccc;\n background-color: transparent;\n }\n}\n.navbar-default .navbar-link {\n color: #777;\n}\n.navbar-default .navbar-link:hover {\n color: #333;\n}\n.navbar-default .btn-link {\n color: #777;\n}\n.navbar-default .btn-link:hover,\n.navbar-default .btn-link:focus {\n color: #333;\n}\n.navbar-default .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-default .btn-link:hover,\n.navbar-default .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-default .btn-link:focus {\n color: #ccc;\n}\n.navbar-inverse {\n background-color: #222;\n border-color: #080808;\n}\n.navbar-inverse .navbar-brand {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-brand:hover,\n.navbar-inverse .navbar-brand:focus {\n color: #fff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-text {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-nav > li > a:hover,\n.navbar-inverse .navbar-nav > li > a:focus {\n color: #fff;\n background-color: transparent;\n}\n.navbar-inverse .navbar-nav > .active > a,\n.navbar-inverse .navbar-nav > .active > a:hover,\n.navbar-inverse .navbar-nav > .active > a:focus {\n color: #fff;\n background-color: #080808;\n}\n.navbar-inverse .navbar-nav > .disabled > a,\n.navbar-inverse .navbar-nav > .disabled > a:hover,\n.navbar-inverse .navbar-nav > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n}\n.navbar-inverse .navbar-toggle {\n border-color: #333;\n}\n.navbar-inverse .navbar-toggle:hover,\n.navbar-inverse .navbar-toggle:focus {\n background-color: #333;\n}\n.navbar-inverse .navbar-toggle .icon-bar {\n background-color: #fff;\n}\n.navbar-inverse .navbar-collapse,\n.navbar-inverse .navbar-form {\n border-color: #101010;\n}\n.navbar-inverse .navbar-nav > .open > a,\n.navbar-inverse .navbar-nav > .open > a:hover,\n.navbar-inverse .navbar-nav > .open > a:focus {\n background-color: #080808;\n color: #fff;\n}\n@media (max-width: 767px) {\n .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {\n border-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu .divider {\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {\n color: #9d9d9d;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {\n color: #fff;\n background-color: transparent;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {\n color: #fff;\n background-color: #080808;\n }\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,\n .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {\n color: #444;\n background-color: transparent;\n }\n}\n.navbar-inverse .navbar-link {\n color: #9d9d9d;\n}\n.navbar-inverse .navbar-link:hover {\n color: #fff;\n}\n.navbar-inverse .btn-link {\n color: #9d9d9d;\n}\n.navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link:focus {\n color: #fff;\n}\n.navbar-inverse .btn-link[disabled]:hover,\nfieldset[disabled] .navbar-inverse .btn-link:hover,\n.navbar-inverse .btn-link[disabled]:focus,\nfieldset[disabled] .navbar-inverse .btn-link:focus {\n color: #444;\n}\n.breadcrumb {\n padding: 8px 15px;\n margin-bottom: 20px;\n list-style: none;\n background-color: #f5f5f5;\n border-radius: 4px;\n}\n.breadcrumb > li {\n display: inline-block;\n}\n.breadcrumb > li + li:before {\n content: \"/\\00a0\";\n padding: 0 5px;\n color: #ccc;\n}\n.breadcrumb > .active {\n color: #777777;\n}\n.pagination {\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n border-radius: 4px;\n}\n.pagination > li {\n display: inline;\n}\n.pagination > li > a,\n.pagination > li > span {\n position: relative;\n float: left;\n padding: 6px 12px;\n line-height: 1.42857143;\n text-decoration: none;\n color: #337ab7;\n background-color: #fff;\n border: 1px solid #ddd;\n margin-left: -1px;\n}\n.pagination > li:first-child > a,\n.pagination > li:first-child > span {\n margin-left: 0;\n border-bottom-left-radius: 4px;\n border-top-left-radius: 4px;\n}\n.pagination > li:last-child > a,\n.pagination > li:last-child > span {\n border-bottom-right-radius: 4px;\n border-top-right-radius: 4px;\n}\n.pagination > li > a:hover,\n.pagination > li > span:hover,\n.pagination > li > a:focus,\n.pagination > li > span:focus {\n z-index: 2;\n color: #23527c;\n background-color: #eeeeee;\n border-color: #ddd;\n}\n.pagination > .active > a,\n.pagination > .active > span,\n.pagination > .active > a:hover,\n.pagination > .active > span:hover,\n.pagination > .active > a:focus,\n.pagination > .active > span:focus {\n z-index: 3;\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n cursor: default;\n}\n.pagination > .disabled > span,\n.pagination > .disabled > span:hover,\n.pagination > .disabled > span:focus,\n.pagination > .disabled > a,\n.pagination > .disabled > a:hover,\n.pagination > .disabled > a:focus {\n color: #777777;\n background-color: #fff;\n border-color: #ddd;\n cursor: not-allowed;\n}\n.pagination-lg > li > a,\n.pagination-lg > li > span {\n padding: 10px 16px;\n font-size: 18px;\n line-height: 1.3333333;\n}\n.pagination-lg > li:first-child > a,\n.pagination-lg > li:first-child > span {\n border-bottom-left-radius: 6px;\n border-top-left-radius: 6px;\n}\n.pagination-lg > li:last-child > a,\n.pagination-lg > li:last-child > span {\n border-bottom-right-radius: 6px;\n border-top-right-radius: 6px;\n}\n.pagination-sm > li > a,\n.pagination-sm > li > span {\n padding: 5px 10px;\n font-size: 12px;\n line-height: 1.5;\n}\n.pagination-sm > li:first-child > a,\n.pagination-sm > li:first-child > span {\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n}\n.pagination-sm > li:last-child > a,\n.pagination-sm > li:last-child > span {\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n}\n.pager {\n padding-left: 0;\n margin: 20px 0;\n list-style: none;\n text-align: center;\n}\n.pager li {\n display: inline;\n}\n.pager li > a,\n.pager li > span {\n display: inline-block;\n padding: 5px 14px;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 15px;\n}\n.pager li > a:hover,\n.pager li > a:focus {\n text-decoration: none;\n background-color: #eeeeee;\n}\n.pager .next > a,\n.pager .next > span {\n float: right;\n}\n.pager .previous > a,\n.pager .previous > span {\n float: left;\n}\n.pager .disabled > a,\n.pager .disabled > a:hover,\n.pager .disabled > a:focus,\n.pager .disabled > span {\n color: #777777;\n background-color: #fff;\n cursor: not-allowed;\n}\n.label {\n display: inline;\n padding: .2em .6em .3em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25em;\n}\na.label:hover,\na.label:focus {\n color: #fff;\n text-decoration: none;\n cursor: pointer;\n}\n.label:empty {\n display: none;\n}\n.btn .label {\n position: relative;\n top: -1px;\n}\n.label-default {\n background-color: #777777;\n}\n.label-default[href]:hover,\n.label-default[href]:focus {\n background-color: #5e5e5e;\n}\n.label-primary {\n background-color: #337ab7;\n}\n.label-primary[href]:hover,\n.label-primary[href]:focus {\n background-color: #286090;\n}\n.label-success {\n background-color: #5cb85c;\n}\n.label-success[href]:hover,\n.label-success[href]:focus {\n background-color: #449d44;\n}\n.label-info {\n background-color: #5bc0de;\n}\n.label-info[href]:hover,\n.label-info[href]:focus {\n background-color: #31b0d5;\n}\n.label-warning {\n background-color: #f0ad4e;\n}\n.label-warning[href]:hover,\n.label-warning[href]:focus {\n background-color: #ec971f;\n}\n.label-danger {\n background-color: #d9534f;\n}\n.label-danger[href]:hover,\n.label-danger[href]:focus {\n background-color: #c9302c;\n}\n.badge {\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: 12px;\n font-weight: bold;\n color: #fff;\n line-height: 1;\n vertical-align: middle;\n white-space: nowrap;\n text-align: center;\n background-color: #777777;\n border-radius: 10px;\n}\n.badge:empty {\n display: none;\n}\n.btn .badge {\n position: relative;\n top: -1px;\n}\n.btn-xs .badge,\n.btn-group-xs > .btn .badge {\n top: 0;\n padding: 1px 5px;\n}\na.badge:hover,\na.badge:focus {\n color: #fff;\n text-decoration: none;\n cursor: pointer;\n}\n.list-group-item.active > .badge,\n.nav-pills > .active > a > .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.list-group-item > .badge {\n float: right;\n}\n.list-group-item > .badge + .badge {\n margin-right: 5px;\n}\n.nav-pills > li > a > .badge {\n margin-left: 3px;\n}\n.jumbotron {\n padding-top: 30px;\n padding-bottom: 30px;\n margin-bottom: 30px;\n color: inherit;\n background-color: #eeeeee;\n}\n.jumbotron h1,\n.jumbotron .h1 {\n color: inherit;\n}\n.jumbotron p {\n margin-bottom: 15px;\n font-size: 21px;\n font-weight: 200;\n}\n.jumbotron > hr {\n border-top-color: #d5d5d5;\n}\n.container .jumbotron,\n.container-fluid .jumbotron {\n border-radius: 6px;\n padding-left: 15px;\n padding-right: 15px;\n}\n.jumbotron .container {\n max-width: 100%;\n}\n@media screen and (min-width: 768px) {\n .jumbotron {\n padding-top: 48px;\n padding-bottom: 48px;\n }\n .container .jumbotron,\n .container-fluid .jumbotron {\n padding-left: 60px;\n padding-right: 60px;\n }\n .jumbotron h1,\n .jumbotron .h1 {\n font-size: 63px;\n }\n}\n.thumbnail {\n display: block;\n padding: 4px;\n margin-bottom: 20px;\n line-height: 1.42857143;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n -webkit-transition: border 0.2s ease-in-out;\n -o-transition: border 0.2s ease-in-out;\n transition: border 0.2s ease-in-out;\n}\n.thumbnail > img,\n.thumbnail a > img {\n margin-left: auto;\n margin-right: auto;\n}\na.thumbnail:hover,\na.thumbnail:focus,\na.thumbnail.active {\n border-color: #337ab7;\n}\n.thumbnail .caption {\n padding: 9px;\n color: #333333;\n}\n.alert {\n padding: 15px;\n margin-bottom: 20px;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.alert h4 {\n margin-top: 0;\n color: inherit;\n}\n.alert .alert-link {\n font-weight: bold;\n}\n.alert > p,\n.alert > ul {\n margin-bottom: 0;\n}\n.alert > p + p {\n margin-top: 5px;\n}\n.alert-dismissable,\n.alert-dismissible {\n padding-right: 35px;\n}\n.alert-dismissable .close,\n.alert-dismissible .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n}\n.alert-success {\n background-color: #dff0d8;\n border-color: #d6e9c6;\n color: #3c763d;\n}\n.alert-success hr {\n border-top-color: #c9e2b3;\n}\n.alert-success .alert-link {\n color: #2b542c;\n}\n.alert-info {\n background-color: #d9edf7;\n border-color: #bce8f1;\n color: #31708f;\n}\n.alert-info hr {\n border-top-color: #a6e1ec;\n}\n.alert-info .alert-link {\n color: #245269;\n}\n.alert-warning {\n background-color: #fcf8e3;\n border-color: #faebcc;\n color: #8a6d3b;\n}\n.alert-warning hr {\n border-top-color: #f7e1b5;\n}\n.alert-warning .alert-link {\n color: #66512c;\n}\n.alert-danger {\n background-color: #f2dede;\n border-color: #ebccd1;\n color: #a94442;\n}\n.alert-danger hr {\n border-top-color: #e4b9c0;\n}\n.alert-danger .alert-link {\n color: #843534;\n}\n@-webkit-keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n@keyframes progress-bar-stripes {\n from {\n background-position: 40px 0;\n }\n to {\n background-position: 0 0;\n }\n}\n.progress {\n overflow: hidden;\n height: 20px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n}\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: 12px;\n line-height: 20px;\n color: #fff;\n text-align: center;\n background-color: #337ab7;\n -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n -webkit-transition: width 0.6s ease;\n -o-transition: width 0.6s ease;\n transition: width 0.6s ease;\n}\n.progress-striped .progress-bar,\n.progress-bar-striped {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-size: 40px 40px;\n}\n.progress.active .progress-bar,\n.progress-bar.active {\n -webkit-animation: progress-bar-stripes 2s linear infinite;\n -o-animation: progress-bar-stripes 2s linear infinite;\n animation: progress-bar-stripes 2s linear infinite;\n}\n.progress-bar-success {\n background-color: #5cb85c;\n}\n.progress-striped .progress-bar-success {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-info {\n background-color: #5bc0de;\n}\n.progress-striped .progress-bar-info {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-warning {\n background-color: #f0ad4e;\n}\n.progress-striped .progress-bar-warning {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.progress-bar-danger {\n background-color: #d9534f;\n}\n.progress-striped .progress-bar-danger {\n background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n}\n.media {\n margin-top: 15px;\n}\n.media:first-child {\n margin-top: 0;\n}\n.media,\n.media-body {\n zoom: 1;\n overflow: hidden;\n}\n.media-body {\n width: 10000px;\n}\n.media-object {\n display: block;\n}\n.media-object.img-thumbnail {\n max-width: none;\n}\n.media-right,\n.media > .pull-right {\n padding-left: 10px;\n}\n.media-left,\n.media > .pull-left {\n padding-right: 10px;\n}\n.media-left,\n.media-right,\n.media-body {\n display: table-cell;\n vertical-align: top;\n}\n.media-middle {\n vertical-align: middle;\n}\n.media-bottom {\n vertical-align: bottom;\n}\n.media-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.media-list {\n padding-left: 0;\n list-style: none;\n}\n.list-group {\n margin-bottom: 20px;\n padding-left: 0;\n}\n.list-group-item {\n position: relative;\n display: block;\n padding: 10px 15px;\n margin-bottom: -1px;\n background-color: #fff;\n border: 1px solid #ddd;\n}\n.list-group-item:first-child {\n border-top-right-radius: 4px;\n border-top-left-radius: 4px;\n}\n.list-group-item:last-child {\n margin-bottom: 0;\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\na.list-group-item,\nbutton.list-group-item {\n color: #555;\n}\na.list-group-item .list-group-item-heading,\nbutton.list-group-item .list-group-item-heading {\n color: #333;\n}\na.list-group-item:hover,\nbutton.list-group-item:hover,\na.list-group-item:focus,\nbutton.list-group-item:focus {\n text-decoration: none;\n color: #555;\n background-color: #f5f5f5;\n}\nbutton.list-group-item {\n width: 100%;\n text-align: left;\n}\n.list-group-item.disabled,\n.list-group-item.disabled:hover,\n.list-group-item.disabled:focus {\n background-color: #eeeeee;\n color: #777777;\n cursor: not-allowed;\n}\n.list-group-item.disabled .list-group-item-heading,\n.list-group-item.disabled:hover .list-group-item-heading,\n.list-group-item.disabled:focus .list-group-item-heading {\n color: inherit;\n}\n.list-group-item.disabled .list-group-item-text,\n.list-group-item.disabled:hover .list-group-item-text,\n.list-group-item.disabled:focus .list-group-item-text {\n color: #777777;\n}\n.list-group-item.active,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n z-index: 2;\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.list-group-item.active .list-group-item-heading,\n.list-group-item.active:hover .list-group-item-heading,\n.list-group-item.active:focus .list-group-item-heading,\n.list-group-item.active .list-group-item-heading > small,\n.list-group-item.active:hover .list-group-item-heading > small,\n.list-group-item.active:focus .list-group-item-heading > small,\n.list-group-item.active .list-group-item-heading > .small,\n.list-group-item.active:hover .list-group-item-heading > .small,\n.list-group-item.active:focus .list-group-item-heading > .small {\n color: inherit;\n}\n.list-group-item.active .list-group-item-text,\n.list-group-item.active:hover .list-group-item-text,\n.list-group-item.active:focus .list-group-item-text {\n color: #c7ddef;\n}\n.list-group-item-success {\n color: #3c763d;\n background-color: #dff0d8;\n}\na.list-group-item-success,\nbutton.list-group-item-success {\n color: #3c763d;\n}\na.list-group-item-success .list-group-item-heading,\nbutton.list-group-item-success .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-success:hover,\nbutton.list-group-item-success:hover,\na.list-group-item-success:focus,\nbutton.list-group-item-success:focus {\n color: #3c763d;\n background-color: #d0e9c6;\n}\na.list-group-item-success.active,\nbutton.list-group-item-success.active,\na.list-group-item-success.active:hover,\nbutton.list-group-item-success.active:hover,\na.list-group-item-success.active:focus,\nbutton.list-group-item-success.active:focus {\n color: #fff;\n background-color: #3c763d;\n border-color: #3c763d;\n}\n.list-group-item-info {\n color: #31708f;\n background-color: #d9edf7;\n}\na.list-group-item-info,\nbutton.list-group-item-info {\n color: #31708f;\n}\na.list-group-item-info .list-group-item-heading,\nbutton.list-group-item-info .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-info:hover,\nbutton.list-group-item-info:hover,\na.list-group-item-info:focus,\nbutton.list-group-item-info:focus {\n color: #31708f;\n background-color: #c4e3f3;\n}\na.list-group-item-info.active,\nbutton.list-group-item-info.active,\na.list-group-item-info.active:hover,\nbutton.list-group-item-info.active:hover,\na.list-group-item-info.active:focus,\nbutton.list-group-item-info.active:focus {\n color: #fff;\n background-color: #31708f;\n border-color: #31708f;\n}\n.list-group-item-warning {\n color: #8a6d3b;\n background-color: #fcf8e3;\n}\na.list-group-item-warning,\nbutton.list-group-item-warning {\n color: #8a6d3b;\n}\na.list-group-item-warning .list-group-item-heading,\nbutton.list-group-item-warning .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-warning:hover,\nbutton.list-group-item-warning:hover,\na.list-group-item-warning:focus,\nbutton.list-group-item-warning:focus {\n color: #8a6d3b;\n background-color: #faf2cc;\n}\na.list-group-item-warning.active,\nbutton.list-group-item-warning.active,\na.list-group-item-warning.active:hover,\nbutton.list-group-item-warning.active:hover,\na.list-group-item-warning.active:focus,\nbutton.list-group-item-warning.active:focus {\n color: #fff;\n background-color: #8a6d3b;\n border-color: #8a6d3b;\n}\n.list-group-item-danger {\n color: #a94442;\n background-color: #f2dede;\n}\na.list-group-item-danger,\nbutton.list-group-item-danger {\n color: #a94442;\n}\na.list-group-item-danger .list-group-item-heading,\nbutton.list-group-item-danger .list-group-item-heading {\n color: inherit;\n}\na.list-group-item-danger:hover,\nbutton.list-group-item-danger:hover,\na.list-group-item-danger:focus,\nbutton.list-group-item-danger:focus {\n color: #a94442;\n background-color: #ebcccc;\n}\na.list-group-item-danger.active,\nbutton.list-group-item-danger.active,\na.list-group-item-danger.active:hover,\nbutton.list-group-item-danger.active:hover,\na.list-group-item-danger.active:focus,\nbutton.list-group-item-danger.active:focus {\n color: #fff;\n background-color: #a94442;\n border-color: #a94442;\n}\n.list-group-item-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.list-group-item-text {\n margin-bottom: 0;\n line-height: 1.3;\n}\n.panel {\n margin-bottom: 20px;\n background-color: #fff;\n border: 1px solid transparent;\n border-radius: 4px;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.panel-body {\n padding: 15px;\n}\n.panel-heading {\n padding: 10px 15px;\n border-bottom: 1px solid transparent;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel-heading > .dropdown .dropdown-toggle {\n color: inherit;\n}\n.panel-title {\n margin-top: 0;\n margin-bottom: 0;\n font-size: 16px;\n color: inherit;\n}\n.panel-title > a,\n.panel-title > small,\n.panel-title > .small,\n.panel-title > small > a,\n.panel-title > .small > a {\n color: inherit;\n}\n.panel-footer {\n padding: 10px 15px;\n background-color: #f5f5f5;\n border-top: 1px solid #ddd;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .list-group,\n.panel > .panel-collapse > .list-group {\n margin-bottom: 0;\n}\n.panel > .list-group .list-group-item,\n.panel > .panel-collapse > .list-group .list-group-item {\n border-width: 1px 0;\n border-radius: 0;\n}\n.panel > .list-group:first-child .list-group-item:first-child,\n.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child {\n border-top: 0;\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .list-group:last-child .list-group-item:last-child,\n.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child {\n border-bottom: 0;\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n.panel-heading + .list-group .list-group-item:first-child {\n border-top-width: 0;\n}\n.list-group + .panel-footer {\n border-top-width: 0;\n}\n.panel > .table,\n.panel > .table-responsive > .table,\n.panel > .panel-collapse > .table {\n margin-bottom: 0;\n}\n.panel > .table caption,\n.panel > .table-responsive > .table caption,\n.panel > .panel-collapse > .table caption {\n padding-left: 15px;\n padding-right: 15px;\n}\n.panel > .table:first-child,\n.panel > .table-responsive:first-child > .table:first-child {\n border-top-right-radius: 3px;\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child {\n border-top-left-radius: 3px;\n border-top-right-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child {\n border-top-left-radius: 3px;\n}\n.panel > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child,\n.panel > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child,\n.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child,\n.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child {\n border-top-right-radius: 3px;\n}\n.panel > .table:last-child,\n.panel > .table-responsive:last-child > .table:last-child {\n border-bottom-right-radius: 3px;\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child {\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child {\n border-bottom-left-radius: 3px;\n}\n.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child,\n.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child,\n.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child,\n.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child {\n border-bottom-right-radius: 3px;\n}\n.panel > .panel-body + .table,\n.panel > .panel-body + .table-responsive,\n.panel > .table + .panel-body,\n.panel > .table-responsive + .panel-body {\n border-top: 1px solid #ddd;\n}\n.panel > .table > tbody:first-child > tr:first-child th,\n.panel > .table > tbody:first-child > tr:first-child td {\n border-top: 0;\n}\n.panel > .table-bordered,\n.panel > .table-responsive > .table-bordered {\n border: 0;\n}\n.panel > .table-bordered > thead > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:first-child,\n.panel > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child,\n.panel > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child,\n.panel > .table-bordered > thead > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:first-child,\n.panel > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child,\n.panel > .table-bordered > tfoot > tr > td:first-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child {\n border-left: 0;\n}\n.panel > .table-bordered > thead > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > th:last-child,\n.panel > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child,\n.panel > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child,\n.panel > .table-bordered > thead > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > thead > tr > td:last-child,\n.panel > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child,\n.panel > .table-bordered > tfoot > tr > td:last-child,\n.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child {\n border-right: 0;\n}\n.panel > .table-bordered > thead > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > td,\n.panel > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td,\n.panel > .table-bordered > thead > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > thead > tr:first-child > th,\n.panel > .table-bordered > tbody > tr:first-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th {\n border-bottom: 0;\n}\n.panel > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td,\n.panel > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td,\n.panel > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th,\n.panel > .table-bordered > tfoot > tr:last-child > th,\n.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th {\n border-bottom: 0;\n}\n.panel > .table-responsive {\n border: 0;\n margin-bottom: 0;\n}\n.panel-group {\n margin-bottom: 20px;\n}\n.panel-group .panel {\n margin-bottom: 0;\n border-radius: 4px;\n}\n.panel-group .panel + .panel {\n margin-top: 5px;\n}\n.panel-group .panel-heading {\n border-bottom: 0;\n}\n.panel-group .panel-heading + .panel-collapse > .panel-body,\n.panel-group .panel-heading + .panel-collapse > .list-group {\n border-top: 1px solid #ddd;\n}\n.panel-group .panel-footer {\n border-top: 0;\n}\n.panel-group .panel-footer + .panel-collapse .panel-body {\n border-bottom: 1px solid #ddd;\n}\n.panel-default {\n border-color: #ddd;\n}\n.panel-default > .panel-heading {\n color: #333333;\n background-color: #f5f5f5;\n border-color: #ddd;\n}\n.panel-default > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #ddd;\n}\n.panel-default > .panel-heading .badge {\n color: #f5f5f5;\n background-color: #333333;\n}\n.panel-default > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #ddd;\n}\n.panel-primary {\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading {\n color: #fff;\n background-color: #337ab7;\n border-color: #337ab7;\n}\n.panel-primary > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #337ab7;\n}\n.panel-primary > .panel-heading .badge {\n color: #337ab7;\n background-color: #fff;\n}\n.panel-primary > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #337ab7;\n}\n.panel-success {\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading {\n color: #3c763d;\n background-color: #dff0d8;\n border-color: #d6e9c6;\n}\n.panel-success > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #d6e9c6;\n}\n.panel-success > .panel-heading .badge {\n color: #dff0d8;\n background-color: #3c763d;\n}\n.panel-success > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #d6e9c6;\n}\n.panel-info {\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading {\n color: #31708f;\n background-color: #d9edf7;\n border-color: #bce8f1;\n}\n.panel-info > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #bce8f1;\n}\n.panel-info > .panel-heading .badge {\n color: #d9edf7;\n background-color: #31708f;\n}\n.panel-info > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #bce8f1;\n}\n.panel-warning {\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading {\n color: #8a6d3b;\n background-color: #fcf8e3;\n border-color: #faebcc;\n}\n.panel-warning > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #faebcc;\n}\n.panel-warning > .panel-heading .badge {\n color: #fcf8e3;\n background-color: #8a6d3b;\n}\n.panel-warning > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #faebcc;\n}\n.panel-danger {\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading {\n color: #a94442;\n background-color: #f2dede;\n border-color: #ebccd1;\n}\n.panel-danger > .panel-heading + .panel-collapse > .panel-body {\n border-top-color: #ebccd1;\n}\n.panel-danger > .panel-heading .badge {\n color: #f2dede;\n background-color: #a94442;\n}\n.panel-danger > .panel-footer + .panel-collapse > .panel-body {\n border-bottom-color: #ebccd1;\n}\n.embed-responsive {\n position: relative;\n display: block;\n height: 0;\n padding: 0;\n overflow: hidden;\n}\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0;\n}\n.embed-responsive-16by9 {\n padding-bottom: 56.25%;\n}\n.embed-responsive-4by3 {\n padding-bottom: 75%;\n}\n.well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);\n}\n.well blockquote {\n border-color: #ddd;\n border-color: rgba(0, 0, 0, 0.15);\n}\n.well-lg {\n padding: 24px;\n border-radius: 6px;\n}\n.well-sm {\n padding: 9px;\n border-radius: 3px;\n}\n.close {\n float: right;\n font-size: 21px;\n font-weight: bold;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n opacity: 0.2;\n filter: alpha(opacity=20);\n}\n.close:hover,\n.close:focus {\n color: #000;\n text-decoration: none;\n cursor: pointer;\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\nbutton.close {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n}\n.modal-open {\n overflow: hidden;\n}\n.modal {\n display: none;\n overflow: hidden;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1050;\n -webkit-overflow-scrolling: touch;\n outline: 0;\n}\n.modal.fade .modal-dialog {\n -webkit-transform: translate(0, -25%);\n -ms-transform: translate(0, -25%);\n -o-transform: translate(0, -25%);\n transform: translate(0, -25%);\n -webkit-transition: -webkit-transform 0.3s ease-out;\n -moz-transition: -moz-transform 0.3s ease-out;\n -o-transition: -o-transform 0.3s ease-out;\n transition: transform 0.3s ease-out;\n}\n.modal.in .modal-dialog {\n -webkit-transform: translate(0, 0);\n -ms-transform: translate(0, 0);\n -o-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 10px;\n}\n.modal-content {\n position: relative;\n background-color: #fff;\n border: 1px solid #999;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);\n background-clip: padding-box;\n outline: 0;\n}\n.modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1040;\n background-color: #000;\n}\n.modal-backdrop.fade {\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.modal-backdrop.in {\n opacity: 0.5;\n filter: alpha(opacity=50);\n}\n.modal-header {\n padding: 15px;\n border-bottom: 1px solid #e5e5e5;\n}\n.modal-header .close {\n margin-top: -2px;\n}\n.modal-title {\n margin: 0;\n line-height: 1.42857143;\n}\n.modal-body {\n position: relative;\n padding: 15px;\n}\n.modal-footer {\n padding: 15px;\n text-align: right;\n border-top: 1px solid #e5e5e5;\n}\n.modal-footer .btn + .btn {\n margin-left: 5px;\n margin-bottom: 0;\n}\n.modal-footer .btn-group .btn + .btn {\n margin-left: -1px;\n}\n.modal-footer .btn-block + .btn-block {\n margin-left: 0;\n}\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n@media (min-width: 768px) {\n .modal-dialog {\n width: 600px;\n margin: 30px auto;\n }\n .modal-content {\n -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);\n }\n .modal-sm {\n width: 300px;\n }\n}\n@media (min-width: 992px) {\n .modal-lg {\n width: 900px;\n }\n}\n.tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n line-break: auto;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n white-space: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n font-size: 12px;\n opacity: 0;\n filter: alpha(opacity=0);\n}\n.tooltip.in {\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.tooltip.top {\n margin-top: -3px;\n padding: 5px 0;\n}\n.tooltip.right {\n margin-left: 3px;\n padding: 0 5px;\n}\n.tooltip.bottom {\n margin-top: 3px;\n padding: 5px 0;\n}\n.tooltip.left {\n margin-left: -3px;\n padding: 0 5px;\n}\n.tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 4px;\n}\n.tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.tooltip.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.top-left .tooltip-arrow {\n bottom: 0;\n right: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.top-right .tooltip-arrow {\n bottom: 0;\n left: 5px;\n margin-bottom: -5px;\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n.tooltip.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -5px;\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n}\n.tooltip.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -5px;\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n}\n.tooltip.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.tooltip.bottom-left .tooltip-arrow {\n top: 0;\n right: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.tooltip.bottom-right .tooltip-arrow {\n top: 0;\n left: 5px;\n margin-top: -5px;\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1060;\n display: none;\n max-width: 276px;\n padding: 1px;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n line-break: auto;\n line-height: 1.42857143;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n white-space: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n font-size: 14px;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid #ccc;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 6px;\n -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);\n}\n.popover.top {\n margin-top: -10px;\n}\n.popover.right {\n margin-left: 10px;\n}\n.popover.bottom {\n margin-top: 10px;\n}\n.popover.left {\n margin-left: -10px;\n}\n.popover-title {\n margin: 0;\n padding: 8px 14px;\n font-size: 14px;\n background-color: #f7f7f7;\n border-bottom: 1px solid #ebebeb;\n border-radius: 5px 5px 0 0;\n}\n.popover-content {\n padding: 9px 14px;\n}\n.popover > .arrow,\n.popover > .arrow:after {\n position: absolute;\n display: block;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n.popover > .arrow {\n border-width: 11px;\n}\n.popover > .arrow:after {\n border-width: 10px;\n content: \"\";\n}\n.popover.top > .arrow {\n left: 50%;\n margin-left: -11px;\n border-bottom-width: 0;\n border-top-color: #999999;\n border-top-color: rgba(0, 0, 0, 0.25);\n bottom: -11px;\n}\n.popover.top > .arrow:after {\n content: \" \";\n bottom: 1px;\n margin-left: -10px;\n border-bottom-width: 0;\n border-top-color: #fff;\n}\n.popover.right > .arrow {\n top: 50%;\n left: -11px;\n margin-top: -11px;\n border-left-width: 0;\n border-right-color: #999999;\n border-right-color: rgba(0, 0, 0, 0.25);\n}\n.popover.right > .arrow:after {\n content: \" \";\n left: 1px;\n bottom: -10px;\n border-left-width: 0;\n border-right-color: #fff;\n}\n.popover.bottom > .arrow {\n left: 50%;\n margin-left: -11px;\n border-top-width: 0;\n border-bottom-color: #999999;\n border-bottom-color: rgba(0, 0, 0, 0.25);\n top: -11px;\n}\n.popover.bottom > .arrow:after {\n content: \" \";\n top: 1px;\n margin-left: -10px;\n border-top-width: 0;\n border-bottom-color: #fff;\n}\n.popover.left > .arrow {\n top: 50%;\n right: -11px;\n margin-top: -11px;\n border-right-width: 0;\n border-left-color: #999999;\n border-left-color: rgba(0, 0, 0, 0.25);\n}\n.popover.left > .arrow:after {\n content: \" \";\n right: 1px;\n border-right-width: 0;\n border-left-color: #fff;\n bottom: -10px;\n}\n.carousel {\n position: relative;\n}\n.carousel-inner {\n position: relative;\n overflow: hidden;\n width: 100%;\n}\n.carousel-inner > .item {\n display: none;\n position: relative;\n -webkit-transition: 0.6s ease-in-out left;\n -o-transition: 0.6s ease-in-out left;\n transition: 0.6s ease-in-out left;\n}\n.carousel-inner > .item > img,\n.carousel-inner > .item > a > img {\n line-height: 1;\n}\n@media all and (transform-3d), (-webkit-transform-3d) {\n .carousel-inner > .item {\n -webkit-transition: -webkit-transform 0.6s ease-in-out;\n -moz-transition: -moz-transform 0.6s ease-in-out;\n -o-transition: -o-transform 0.6s ease-in-out;\n transition: transform 0.6s ease-in-out;\n -webkit-backface-visibility: hidden;\n -moz-backface-visibility: hidden;\n backface-visibility: hidden;\n -webkit-perspective: 1000px;\n -moz-perspective: 1000px;\n perspective: 1000px;\n }\n .carousel-inner > .item.next,\n .carousel-inner > .item.active.right {\n -webkit-transform: translate3d(100%, 0, 0);\n transform: translate3d(100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.prev,\n .carousel-inner > .item.active.left {\n -webkit-transform: translate3d(-100%, 0, 0);\n transform: translate3d(-100%, 0, 0);\n left: 0;\n }\n .carousel-inner > .item.next.left,\n .carousel-inner > .item.prev.right,\n .carousel-inner > .item.active {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n left: 0;\n }\n}\n.carousel-inner > .active,\n.carousel-inner > .next,\n.carousel-inner > .prev {\n display: block;\n}\n.carousel-inner > .active {\n left: 0;\n}\n.carousel-inner > .next,\n.carousel-inner > .prev {\n position: absolute;\n top: 0;\n width: 100%;\n}\n.carousel-inner > .next {\n left: 100%;\n}\n.carousel-inner > .prev {\n left: -100%;\n}\n.carousel-inner > .next.left,\n.carousel-inner > .prev.right {\n left: 0;\n}\n.carousel-inner > .active.left {\n left: -100%;\n}\n.carousel-inner > .active.right {\n left: 100%;\n}\n.carousel-control {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 15%;\n opacity: 0.5;\n filter: alpha(opacity=50);\n font-size: 20px;\n color: #fff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n background-color: rgba(0, 0, 0, 0);\n}\n.carousel-control.left {\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);\n}\n.carousel-control.right {\n left: auto;\n right: 0;\n background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%);\n background-repeat: repeat-x;\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);\n}\n.carousel-control:hover,\n.carousel-control:focus {\n outline: 0;\n color: #fff;\n text-decoration: none;\n opacity: 0.9;\n filter: alpha(opacity=90);\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-left,\n.carousel-control .glyphicon-chevron-right {\n position: absolute;\n top: 50%;\n margin-top: -10px;\n z-index: 5;\n display: inline-block;\n}\n.carousel-control .icon-prev,\n.carousel-control .glyphicon-chevron-left {\n left: 50%;\n margin-left: -10px;\n}\n.carousel-control .icon-next,\n.carousel-control .glyphicon-chevron-right {\n right: 50%;\n margin-right: -10px;\n}\n.carousel-control .icon-prev,\n.carousel-control .icon-next {\n width: 20px;\n height: 20px;\n line-height: 1;\n font-family: serif;\n}\n.carousel-control .icon-prev:before {\n content: '\\2039';\n}\n.carousel-control .icon-next:before {\n content: '\\203a';\n}\n.carousel-indicators {\n position: absolute;\n bottom: 10px;\n left: 50%;\n z-index: 15;\n width: 60%;\n margin-left: -30%;\n padding-left: 0;\n list-style: none;\n text-align: center;\n}\n.carousel-indicators li {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin: 1px;\n text-indent: -999px;\n border: 1px solid #fff;\n border-radius: 10px;\n cursor: pointer;\n background-color: #000 \\9;\n background-color: rgba(0, 0, 0, 0);\n}\n.carousel-indicators .active {\n margin: 0;\n width: 12px;\n height: 12px;\n background-color: #fff;\n}\n.carousel-caption {\n position: absolute;\n left: 15%;\n right: 15%;\n bottom: 20px;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: #fff;\n text-align: center;\n text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);\n}\n.carousel-caption .btn {\n text-shadow: none;\n}\n@media screen and (min-width: 768px) {\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-prev,\n .carousel-control .icon-next {\n width: 30px;\n height: 30px;\n margin-top: -10px;\n font-size: 30px;\n }\n .carousel-control .glyphicon-chevron-left,\n .carousel-control .icon-prev {\n margin-left: -10px;\n }\n .carousel-control .glyphicon-chevron-right,\n .carousel-control .icon-next {\n margin-right: -10px;\n }\n .carousel-caption {\n left: 20%;\n right: 20%;\n padding-bottom: 30px;\n }\n .carousel-indicators {\n bottom: 20px;\n }\n}\n.clearfix:before,\n.clearfix:after,\n.dl-horizontal dd:before,\n.dl-horizontal dd:after,\n.container:before,\n.container:after,\n.container-fluid:before,\n.container-fluid:after,\n.row:before,\n.row:after,\n.form-horizontal .form-group:before,\n.form-horizontal .form-group:after,\n.btn-toolbar:before,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:before,\n.btn-group-vertical > .btn-group:after,\n.nav:before,\n.nav:after,\n.navbar:before,\n.navbar:after,\n.navbar-header:before,\n.navbar-header:after,\n.navbar-collapse:before,\n.navbar-collapse:after,\n.pager:before,\n.pager:after,\n.panel-body:before,\n.panel-body:after,\n.modal-header:before,\n.modal-header:after,\n.modal-footer:before,\n.modal-footer:after {\n content: \" \";\n display: table;\n}\n.clearfix:after,\n.dl-horizontal dd:after,\n.container:after,\n.container-fluid:after,\n.row:after,\n.form-horizontal .form-group:after,\n.btn-toolbar:after,\n.btn-group-vertical > .btn-group:after,\n.nav:after,\n.navbar:after,\n.navbar-header:after,\n.navbar-collapse:after,\n.pager:after,\n.panel-body:after,\n.modal-header:after,\n.modal-footer:after {\n clear: both;\n}\n.center-block {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n.pull-right {\n float: right !important;\n}\n.pull-left {\n float: left !important;\n}\n.hide {\n display: none !important;\n}\n.show {\n display: block !important;\n}\n.invisible {\n visibility: hidden;\n}\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n.hidden {\n display: none !important;\n}\n.affix {\n position: fixed;\n}\n@-ms-viewport {\n width: device-width;\n}\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n display: none !important;\n}\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n display: none !important;\n}\n@media (max-width: 767px) {\n .visible-xs {\n display: block !important;\n }\n table.visible-xs {\n display: table !important;\n }\n tr.visible-xs {\n display: table-row !important;\n }\n th.visible-xs,\n td.visible-xs {\n display: table-cell !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-block {\n display: block !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline {\n display: inline !important;\n }\n}\n@media (max-width: 767px) {\n .visible-xs-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm {\n display: block !important;\n }\n table.visible-sm {\n display: table !important;\n }\n tr.visible-sm {\n display: table-row !important;\n }\n th.visible-sm,\n td.visible-sm {\n display: table-cell !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-block {\n display: block !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline {\n display: inline !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .visible-sm-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md {\n display: block !important;\n }\n table.visible-md {\n display: table !important;\n }\n tr.visible-md {\n display: table-row !important;\n }\n th.visible-md,\n td.visible-md {\n display: table-cell !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-block {\n display: block !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline {\n display: inline !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .visible-md-inline-block {\n display: inline-block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg {\n display: block !important;\n }\n table.visible-lg {\n display: table !important;\n }\n tr.visible-lg {\n display: table-row !important;\n }\n th.visible-lg,\n td.visible-lg {\n display: table-cell !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-block {\n display: block !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline {\n display: inline !important;\n }\n}\n@media (min-width: 1200px) {\n .visible-lg-inline-block {\n display: inline-block !important;\n }\n}\n@media (max-width: 767px) {\n .hidden-xs {\n display: none !important;\n }\n}\n@media (min-width: 768px) and (max-width: 991px) {\n .hidden-sm {\n display: none !important;\n }\n}\n@media (min-width: 992px) and (max-width: 1199px) {\n .hidden-md {\n display: none !important;\n }\n}\n@media (min-width: 1200px) {\n .hidden-lg {\n display: none !important;\n }\n}\n.visible-print {\n display: none !important;\n}\n@media print {\n .visible-print {\n display: block !important;\n }\n table.visible-print {\n display: table !important;\n }\n tr.visible-print {\n display: table-row !important;\n }\n th.visible-print,\n td.visible-print {\n display: table-cell !important;\n }\n}\n.visible-print-block {\n display: none !important;\n}\n@media print {\n .visible-print-block {\n display: block !important;\n }\n}\n.visible-print-inline {\n display: none !important;\n}\n@media print {\n .visible-print-inline {\n display: inline !important;\n }\n}\n.visible-print-inline-block {\n display: none !important;\n}\n@media print {\n .visible-print-inline-block {\n display: inline-block !important;\n }\n}\n@media print {\n .hidden-print {\n display: none !important;\n }\n}\n/*# sourceMappingURL=bootstrap.css.map */","/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS and IE text size adjust after device orientation change,\n// without disabling user zoom.\n//\n\nhtml {\n font-family: sans-serif; // 1\n -ms-text-size-adjust: 100%; // 2\n -webkit-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n margin: 0;\n}\n\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined for any HTML5 element in IE 8/9.\n// Correct `block` display not defined for `details` or `summary` in IE 10/11\n// and Firefox.\n// Correct `block` display not defined for `main` in IE 11.\n//\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n display: block;\n}\n\n//\n// 1. Correct `inline-block` display not defined in IE 8/9.\n// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n//\n\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block; // 1\n vertical-align: baseline; // 2\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n//\n// Address `[hidden]` styling not present in IE 8/9/10.\n// Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.\n//\n\n[hidden],\ntemplate {\n display: none;\n}\n\n// Links\n// ==========================================================================\n\n//\n// Remove the gray background color from active links in IE 10.\n//\n\na {\n background-color: transparent;\n}\n\n//\n// Improve readability of focused elements when they are also in an\n// active/hover state.\n//\n\na:active,\na:hover {\n outline: 0;\n}\n\n// Text-level semantics\n// ==========================================================================\n\n//\n// Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n//\n\nabbr[title] {\n border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n//\n\nb,\nstrong {\n font-weight: bold;\n}\n\n//\n// Address styling not present in Safari and Chrome.\n//\n\ndfn {\n font-style: italic;\n}\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari, and Chrome.\n//\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n background: #ff0;\n color: #000;\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all browsers.\n//\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsup {\n top: -0.5em;\n}\n\nsub {\n bottom: -0.25em;\n}\n\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9/10.\n//\n\nimg {\n border: 0;\n}\n\n//\n// Correct overflow not hidden in IE 9/10/11.\n//\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n// Grouping content\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari.\n//\n\nfigure {\n margin: 1em 40px;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n box-sizing: content-box;\n height: 0;\n}\n\n//\n// Contain overflow in all browsers.\n//\n\npre {\n overflow: auto;\n}\n\n//\n// Address odd `em`-unit font size rendering in all browsers.\n//\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\n// Forms\n// ==========================================================================\n\n//\n// Known limitation: by default, Chrome and Safari on OS X allow very limited\n// styling of `select`, unless a `border` property is set.\n//\n\n//\n// 1. Correct color not being inherited.\n// Known issue: affects color of disabled elements.\n// 2. Correct font properties not being inherited.\n// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n//\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n color: inherit; // 1\n font: inherit; // 2\n margin: 0; // 3\n}\n\n//\n// Address `overflow` set to `hidden` in IE 8/9/10/11.\n//\n\nbutton {\n overflow: visible;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n// Correct `select` style inheritance in Firefox.\n//\n\nbutton,\nselect {\n text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n// and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n// `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n -webkit-appearance: button; // 2\n cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n cursor: default;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n border: 0;\n padding: 0;\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\ninput {\n line-height: normal;\n}\n\n//\n// It's recommended that you don't attempt to style these elements.\n// Firefox's implementation doesn't respect box-sizing, padding, or width.\n//\n// 1. Address box sizing set to `content-box` in IE 8/9/10.\n// 2. Remove excess padding in IE 8/9/10.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n box-sizing: border-box; // 1\n padding: 0; // 2\n}\n\n//\n// Fix the cursor style for Chrome's increment/decrement buttons. For certain\n// `font-size` values of the `input`, it causes the cursor style of the\n// decrement button to change from `default` to `text`.\n//\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari and Chrome.\n//\n\ninput[type=\"search\"] {\n -webkit-appearance: textfield; // 1\n box-sizing: content-box; //2\n}\n\n//\n// Remove inner padding and search cancel button in Safari and Chrome on OS X.\n// Safari (but not Chrome) clips the cancel button when the search input has\n// padding (and `textfield` appearance).\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9/10/11.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n border: 0; // 1\n padding: 0; // 2\n}\n\n//\n// Remove default vertical scrollbar in IE 8/9/10/11.\n//\n\ntextarea {\n overflow: auto;\n}\n\n//\n// Don't inherit the `font-weight` (applied by a rule above).\n// NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n//\n\noptgroup {\n font-weight: bold;\n}\n\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\ntd,\nth {\n padding: 0;\n}\n","/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */\n\n// ==========================================================================\n// Print styles.\n// Inlined to avoid the additional HTTP request: h5bp.com/r\n// ==========================================================================\n\n@media print {\n *,\n *:before,\n *:after {\n background: transparent !important;\n color: #000 !important; // Black prints faster: h5bp.com/s\n box-shadow: none !important;\n text-shadow: none !important;\n }\n\n a,\n a:visited {\n text-decoration: underline;\n }\n\n a[href]:after {\n content: \" (\" attr(href) \")\";\n }\n\n abbr[title]:after {\n content: \" (\" attr(title) \")\";\n }\n\n // Don't show links that are fragment identifiers,\n // or use the `javascript:` pseudo protocol\n a[href^=\"#\"]:after,\n a[href^=\"javascript:\"]:after {\n content: \"\";\n }\n\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n\n thead {\n display: table-header-group; // h5bp.com/t\n }\n\n tr,\n img {\n page-break-inside: avoid;\n }\n\n img {\n max-width: 100% !important;\n }\n\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n\n h2,\n h3 {\n page-break-after: avoid;\n }\n\n // Bootstrap specific changes start\n\n // Bootstrap components\n .navbar {\n display: none;\n }\n .btn,\n .dropup > .btn {\n > .caret {\n border-top-color: #000 !important;\n }\n }\n .label {\n border: 1px solid #000;\n }\n\n .table {\n border-collapse: collapse !important;\n\n td,\n th {\n background-color: #fff !important;\n }\n }\n .table-bordered {\n th,\n td {\n border: 1px solid #ddd !important;\n }\n }\n\n // Bootstrap specific changes end\n}\n","//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus automatically sized to match the surrounding child. To use, create an\n// inline element with the appropriate classes, like so:\n//\n// <a href=\"#\"><span class=\"glyphicon glyphicon-star\"></span> Star</a>\n\n// Import the fonts\n@font-face {\n font-family: 'Glyphicons Halflings';\n src: url('@{icon-font-path}@{icon-font-name}.eot');\n src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),\n url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'),\n url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),\n url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),\n url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');\n}\n\n// Catchall baseclass\n.glyphicon {\n position: relative;\n top: 1px;\n display: inline-block;\n font-family: 'Glyphicons Halflings';\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n// Individual icons\n.glyphicon-asterisk { &:before { content: \"\\002a\"; } }\n.glyphicon-plus { &:before { content: \"\\002b\"; } }\n.glyphicon-euro,\n.glyphicon-eur { &:before { content: \"\\20ac\"; } }\n.glyphicon-minus { &:before { content: \"\\2212\"; } }\n.glyphicon-cloud { &:before { content: \"\\2601\"; } }\n.glyphicon-envelope { &:before { content: \"\\2709\"; } }\n.glyphicon-pencil { &:before { content: \"\\270f\"; } }\n.glyphicon-glass { &:before { content: \"\\e001\"; } }\n.glyphicon-music { &:before { content: \"\\e002\"; } }\n.glyphicon-search { &:before { content: \"\\e003\"; } }\n.glyphicon-heart { &:before { content: \"\\e005\"; } }\n.glyphicon-star { &:before { content: \"\\e006\"; } }\n.glyphicon-star-empty { &:before { content: \"\\e007\"; } }\n.glyphicon-user { &:before { content: \"\\e008\"; } }\n.glyphicon-film { &:before { content: \"\\e009\"; } }\n.glyphicon-th-large { &:before { content: \"\\e010\"; } }\n.glyphicon-th { &:before { content: \"\\e011\"; } }\n.glyphicon-th-list { &:before { content: \"\\e012\"; } }\n.glyphicon-ok { &:before { content: \"\\e013\"; } }\n.glyphicon-remove { &:before { content: \"\\e014\"; } }\n.glyphicon-zoom-in { &:before { content: \"\\e015\"; } }\n.glyphicon-zoom-out { &:before { content: \"\\e016\"; } }\n.glyphicon-off { &:before { content: \"\\e017\"; } }\n.glyphicon-signal { &:before { content: \"\\e018\"; } }\n.glyphicon-cog { &:before { content: \"\\e019\"; } }\n.glyphicon-trash { &:before { content: \"\\e020\"; } }\n.glyphicon-home { &:before { content: \"\\e021\"; } }\n.glyphicon-file { &:before { content: \"\\e022\"; } }\n.glyphicon-time { &:before { content: \"\\e023\"; } }\n.glyphicon-road { &:before { content: \"\\e024\"; } }\n.glyphicon-download-alt { &:before { content: \"\\e025\"; } }\n.glyphicon-download { &:before { content: \"\\e026\"; } }\n.glyphicon-upload { &:before { content: \"\\e027\"; } }\n.glyphicon-inbox { &:before { content: \"\\e028\"; } }\n.glyphicon-play-circle { &:before { content: \"\\e029\"; } }\n.glyphicon-repeat { &:before { content: \"\\e030\"; } }\n.glyphicon-refresh { &:before { content: \"\\e031\"; } }\n.glyphicon-list-alt { &:before { content: \"\\e032\"; } }\n.glyphicon-lock { &:before { content: \"\\e033\"; } }\n.glyphicon-flag { &:before { content: \"\\e034\"; } }\n.glyphicon-headphones { &:before { content: \"\\e035\"; } }\n.glyphicon-volume-off { &:before { content: \"\\e036\"; } }\n.glyphicon-volume-down { &:before { content: \"\\e037\"; } }\n.glyphicon-volume-up { &:before { content: \"\\e038\"; } }\n.glyphicon-qrcode { &:before { content: \"\\e039\"; } }\n.glyphicon-barcode { &:before { content: \"\\e040\"; } }\n.glyphicon-tag { &:before { content: \"\\e041\"; } }\n.glyphicon-tags { &:before { content: \"\\e042\"; } }\n.glyphicon-book { &:before { content: \"\\e043\"; } }\n.glyphicon-bookmark { &:before { content: \"\\e044\"; } }\n.glyphicon-print { &:before { content: \"\\e045\"; } }\n.glyphicon-camera { &:before { content: \"\\e046\"; } }\n.glyphicon-font { &:before { content: \"\\e047\"; } }\n.glyphicon-bold { &:before { content: \"\\e048\"; } }\n.glyphicon-italic { &:before { content: \"\\e049\"; } }\n.glyphicon-text-height { &:before { content: \"\\e050\"; } }\n.glyphicon-text-width { &:before { content: \"\\e051\"; } }\n.glyphicon-align-left { &:before { content: \"\\e052\"; } }\n.glyphicon-align-center { &:before { content: \"\\e053\"; } }\n.glyphicon-align-right { &:before { content: \"\\e054\"; } }\n.glyphicon-align-justify { &:before { content: \"\\e055\"; } }\n.glyphicon-list { &:before { content: \"\\e056\"; } }\n.glyphicon-indent-left { &:before { content: \"\\e057\"; } }\n.glyphicon-indent-right { &:before { content: \"\\e058\"; } }\n.glyphicon-facetime-video { &:before { content: \"\\e059\"; } }\n.glyphicon-picture { &:before { content: \"\\e060\"; } }\n.glyphicon-map-marker { &:before { content: \"\\e062\"; } }\n.glyphicon-adjust { &:before { content: \"\\e063\"; } }\n.glyphicon-tint { &:before { content: \"\\e064\"; } }\n.glyphicon-edit { &:before { content: \"\\e065\"; } }\n.glyphicon-share { &:before { content: \"\\e066\"; } }\n.glyphicon-check { &:before { content: \"\\e067\"; } }\n.glyphicon-move { &:before { content: \"\\e068\"; } }\n.glyphicon-step-backward { &:before { content: \"\\e069\"; } }\n.glyphicon-fast-backward { &:before { content: \"\\e070\"; } }\n.glyphicon-backward { &:before { content: \"\\e071\"; } }\n.glyphicon-play { &:before { content: \"\\e072\"; } }\n.glyphicon-pause { &:before { content: \"\\e073\"; } }\n.glyphicon-stop { &:before { content: \"\\e074\"; } }\n.glyphicon-forward { &:before { content: \"\\e075\"; } }\n.glyphicon-fast-forward { &:before { content: \"\\e076\"; } }\n.glyphicon-step-forward { &:before { content: \"\\e077\"; } }\n.glyphicon-eject { &:before { content: \"\\e078\"; } }\n.glyphicon-chevron-left { &:before { content: \"\\e079\"; } }\n.glyphicon-chevron-right { &:before { content: \"\\e080\"; } }\n.glyphicon-plus-sign { &:before { content: \"\\e081\"; } }\n.glyphicon-minus-sign { &:before { content: \"\\e082\"; } }\n.glyphicon-remove-sign { &:before { content: \"\\e083\"; } }\n.glyphicon-ok-sign { &:before { content: \"\\e084\"; } }\n.glyphicon-question-sign { &:before { content: \"\\e085\"; } }\n.glyphicon-info-sign { &:before { content: \"\\e086\"; } }\n.glyphicon-screenshot { &:before { content: \"\\e087\"; } }\n.glyphicon-remove-circle { &:before { content: \"\\e088\"; } }\n.glyphicon-ok-circle { &:before { content: \"\\e089\"; } }\n.glyphicon-ban-circle { &:before { content: \"\\e090\"; } }\n.glyphicon-arrow-left { &:before { content: \"\\e091\"; } }\n.glyphicon-arrow-right { &:before { content: \"\\e092\"; } }\n.glyphicon-arrow-up { &:before { content: \"\\e093\"; } }\n.glyphicon-arrow-down { &:before { content: \"\\e094\"; } }\n.glyphicon-share-alt { &:before { content: \"\\e095\"; } }\n.glyphicon-resize-full { &:before { content: \"\\e096\"; } }\n.glyphicon-resize-small { &:before { content: \"\\e097\"; } }\n.glyphicon-exclamation-sign { &:before { content: \"\\e101\"; } }\n.glyphicon-gift { &:before { content: \"\\e102\"; } }\n.glyphicon-leaf { &:before { content: \"\\e103\"; } }\n.glyphicon-fire { &:before { content: \"\\e104\"; } }\n.glyphicon-eye-open { &:before { content: \"\\e105\"; } }\n.glyphicon-eye-close { &:before { content: \"\\e106\"; } }\n.glyphicon-warning-sign { &:before { content: \"\\e107\"; } }\n.glyphicon-plane { &:before { content: \"\\e108\"; } }\n.glyphicon-calendar { &:before { content: \"\\e109\"; } }\n.glyphicon-random { &:before { content: \"\\e110\"; } }\n.glyphicon-comment { &:before { content: \"\\e111\"; } }\n.glyphicon-magnet { &:before { content: \"\\e112\"; } }\n.glyphicon-chevron-up { &:before { content: \"\\e113\"; } }\n.glyphicon-chevron-down { &:before { content: \"\\e114\"; } }\n.glyphicon-retweet { &:before { content: \"\\e115\"; } }\n.glyphicon-shopping-cart { &:before { content: \"\\e116\"; } }\n.glyphicon-folder-close { &:before { content: \"\\e117\"; } }\n.glyphicon-folder-open { &:before { content: \"\\e118\"; } }\n.glyphicon-resize-vertical { &:before { content: \"\\e119\"; } }\n.glyphicon-resize-horizontal { &:before { content: \"\\e120\"; } }\n.glyphicon-hdd { &:before { content: \"\\e121\"; } }\n.glyphicon-bullhorn { &:before { content: \"\\e122\"; } }\n.glyphicon-bell { &:before { content: \"\\e123\"; } }\n.glyphicon-certificate { &:before { content: \"\\e124\"; } }\n.glyphicon-thumbs-up { &:before { content: \"\\e125\"; } }\n.glyphicon-thumbs-down { &:before { content: \"\\e126\"; } }\n.glyphicon-hand-right { &:before { content: \"\\e127\"; } }\n.glyphicon-hand-left { &:before { content: \"\\e128\"; } }\n.glyphicon-hand-up { &:before { content: \"\\e129\"; } }\n.glyphicon-hand-down { &:before { content: \"\\e130\"; } }\n.glyphicon-circle-arrow-right { &:before { content: \"\\e131\"; } }\n.glyphicon-circle-arrow-left { &:before { content: \"\\e132\"; } }\n.glyphicon-circle-arrow-up { &:before { content: \"\\e133\"; } }\n.glyphicon-circle-arrow-down { &:before { content: \"\\e134\"; } }\n.glyphicon-globe { &:before { content: \"\\e135\"; } }\n.glyphicon-wrench { &:before { content: \"\\e136\"; } }\n.glyphicon-tasks { &:before { content: \"\\e137\"; } }\n.glyphicon-filter { &:before { content: \"\\e138\"; } }\n.glyphicon-briefcase { &:before { content: \"\\e139\"; } }\n.glyphicon-fullscreen { &:before { content: \"\\e140\"; } }\n.glyphicon-dashboard { &:before { content: \"\\e141\"; } }\n.glyphicon-paperclip { &:before { content: \"\\e142\"; } }\n.glyphicon-heart-empty { &:before { content: \"\\e143\"; } }\n.glyphicon-link { &:before { content: \"\\e144\"; } }\n.glyphicon-phone { &:before { content: \"\\e145\"; } }\n.glyphicon-pushpin { &:before { content: \"\\e146\"; } }\n.glyphicon-usd { &:before { content: \"\\e148\"; } }\n.glyphicon-gbp { &:before { content: \"\\e149\"; } }\n.glyphicon-sort { &:before { content: \"\\e150\"; } }\n.glyphicon-sort-by-alphabet { &:before { content: \"\\e151\"; } }\n.glyphicon-sort-by-alphabet-alt { &:before { content: \"\\e152\"; } }\n.glyphicon-sort-by-order { &:before { content: \"\\e153\"; } }\n.glyphicon-sort-by-order-alt { &:before { content: \"\\e154\"; } }\n.glyphicon-sort-by-attributes { &:before { content: \"\\e155\"; } }\n.glyphicon-sort-by-attributes-alt { &:before { content: \"\\e156\"; } }\n.glyphicon-unchecked { &:before { content: \"\\e157\"; } }\n.glyphicon-expand { &:before { content: \"\\e158\"; } }\n.glyphicon-collapse-down { &:before { content: \"\\e159\"; } }\n.glyphicon-collapse-up { &:before { content: \"\\e160\"; } }\n.glyphicon-log-in { &:before { content: \"\\e161\"; } }\n.glyphicon-flash { &:before { content: \"\\e162\"; } }\n.glyphicon-log-out { &:before { content: \"\\e163\"; } }\n.glyphicon-new-window { &:before { content: \"\\e164\"; } }\n.glyphicon-record { &:before { content: \"\\e165\"; } }\n.glyphicon-save { &:before { content: \"\\e166\"; } }\n.glyphicon-open { &:before { content: \"\\e167\"; } }\n.glyphicon-saved { &:before { content: \"\\e168\"; } }\n.glyphicon-import { &:before { content: \"\\e169\"; } }\n.glyphicon-export { &:before { content: \"\\e170\"; } }\n.glyphicon-send { &:before { content: \"\\e171\"; } }\n.glyphicon-floppy-disk { &:before { content: \"\\e172\"; } }\n.glyphicon-floppy-saved { &:before { content: \"\\e173\"; } }\n.glyphicon-floppy-remove { &:before { content: \"\\e174\"; } }\n.glyphicon-floppy-save { &:before { content: \"\\e175\"; } }\n.glyphicon-floppy-open { &:before { content: \"\\e176\"; } }\n.glyphicon-credit-card { &:before { content: \"\\e177\"; } }\n.glyphicon-transfer { &:before { content: \"\\e178\"; } }\n.glyphicon-cutlery { &:before { content: \"\\e179\"; } }\n.glyphicon-header { &:before { content: \"\\e180\"; } }\n.glyphicon-compressed { &:before { content: \"\\e181\"; } }\n.glyphicon-earphone { &:before { content: \"\\e182\"; } }\n.glyphicon-phone-alt { &:before { content: \"\\e183\"; } }\n.glyphicon-tower { &:before { content: \"\\e184\"; } }\n.glyphicon-stats { &:before { content: \"\\e185\"; } }\n.glyphicon-sd-video { &:before { content: \"\\e186\"; } }\n.glyphicon-hd-video { &:before { content: \"\\e187\"; } }\n.glyphicon-subtitles { &:before { content: \"\\e188\"; } }\n.glyphicon-sound-stereo { &:before { content: \"\\e189\"; } }\n.glyphicon-sound-dolby { &:before { content: \"\\e190\"; } }\n.glyphicon-sound-5-1 { &:before { content: \"\\e191\"; } }\n.glyphicon-sound-6-1 { &:before { content: \"\\e192\"; } }\n.glyphicon-sound-7-1 { &:before { content: \"\\e193\"; } }\n.glyphicon-copyright-mark { &:before { content: \"\\e194\"; } }\n.glyphicon-registration-mark { &:before { content: \"\\e195\"; } }\n.glyphicon-cloud-download { &:before { content: \"\\e197\"; } }\n.glyphicon-cloud-upload { &:before { content: \"\\e198\"; } }\n.glyphicon-tree-conifer { &:before { content: \"\\e199\"; } }\n.glyphicon-tree-deciduous { &:before { content: \"\\e200\"; } }\n.glyphicon-cd { &:before { content: \"\\e201\"; } }\n.glyphicon-save-file { &:before { content: \"\\e202\"; } }\n.glyphicon-open-file { &:before { content: \"\\e203\"; } }\n.glyphicon-level-up { &:before { content: \"\\e204\"; } }\n.glyphicon-copy { &:before { content: \"\\e205\"; } }\n.glyphicon-paste { &:before { content: \"\\e206\"; } }\n// The following 2 Glyphicons are omitted for the time being because\n// they currently use Unicode codepoints that are outside the\n// Basic Multilingual Plane (BMP). Older buggy versions of WebKit can't handle\n// non-BMP codepoints in CSS string escapes, and thus can't display these two icons.\n// Notably, the bug affects some older versions of the Android Browser.\n// More info: https://github.com/twbs/bootstrap/issues/10106\n// .glyphicon-door { &:before { content: \"\\1f6aa\"; } }\n// .glyphicon-key { &:before { content: \"\\1f511\"; } }\n.glyphicon-alert { &:before { content: \"\\e209\"; } }\n.glyphicon-equalizer { &:before { content: \"\\e210\"; } }\n.glyphicon-king { &:before { content: \"\\e211\"; } }\n.glyphicon-queen { &:before { content: \"\\e212\"; } }\n.glyphicon-pawn { &:before { content: \"\\e213\"; } }\n.glyphicon-bishop { &:before { content: \"\\e214\"; } }\n.glyphicon-knight { &:before { content: \"\\e215\"; } }\n.glyphicon-baby-formula { &:before { content: \"\\e216\"; } }\n.glyphicon-tent { &:before { content: \"\\26fa\"; } }\n.glyphicon-blackboard { &:before { content: \"\\e218\"; } }\n.glyphicon-bed { &:before { content: \"\\e219\"; } }\n.glyphicon-apple { &:before { content: \"\\f8ff\"; } }\n.glyphicon-erase { &:before { content: \"\\e221\"; } }\n.glyphicon-hourglass { &:before { content: \"\\231b\"; } }\n.glyphicon-lamp { &:before { content: \"\\e223\"; } }\n.glyphicon-duplicate { &:before { content: \"\\e224\"; } }\n.glyphicon-piggy-bank { &:before { content: \"\\e225\"; } }\n.glyphicon-scissors { &:before { content: \"\\e226\"; } }\n.glyphicon-bitcoin { &:before { content: \"\\e227\"; } }\n.glyphicon-btc { &:before { content: \"\\e227\"; } }\n.glyphicon-xbt { &:before { content: \"\\e227\"; } }\n.glyphicon-yen { &:before { content: \"\\00a5\"; } }\n.glyphicon-jpy { &:before { content: \"\\00a5\"; } }\n.glyphicon-ruble { &:before { content: \"\\20bd\"; } }\n.glyphicon-rub { &:before { content: \"\\20bd\"; } }\n.glyphicon-scale { &:before { content: \"\\e230\"; } }\n.glyphicon-ice-lolly { &:before { content: \"\\e231\"; } }\n.glyphicon-ice-lolly-tasted { &:before { content: \"\\e232\"; } }\n.glyphicon-education { &:before { content: \"\\e233\"; } }\n.glyphicon-option-horizontal { &:before { content: \"\\e234\"; } }\n.glyphicon-option-vertical { &:before { content: \"\\e235\"; } }\n.glyphicon-menu-hamburger { &:before { content: \"\\e236\"; } }\n.glyphicon-modal-window { &:before { content: \"\\e237\"; } }\n.glyphicon-oil { &:before { content: \"\\e238\"; } }\n.glyphicon-grain { &:before { content: \"\\e239\"; } }\n.glyphicon-sunglasses { &:before { content: \"\\e240\"; } }\n.glyphicon-text-size { &:before { content: \"\\e241\"; } }\n.glyphicon-text-color { &:before { content: \"\\e242\"; } }\n.glyphicon-text-background { &:before { content: \"\\e243\"; } }\n.glyphicon-object-align-top { &:before { content: \"\\e244\"; } }\n.glyphicon-object-align-bottom { &:before { content: \"\\e245\"; } }\n.glyphicon-object-align-horizontal{ &:before { content: \"\\e246\"; } }\n.glyphicon-object-align-left { &:before { content: \"\\e247\"; } }\n.glyphicon-object-align-vertical { &:before { content: \"\\e248\"; } }\n.glyphicon-object-align-right { &:before { content: \"\\e249\"; } }\n.glyphicon-triangle-right { &:before { content: \"\\e250\"; } }\n.glyphicon-triangle-left { &:before { content: \"\\e251\"; } }\n.glyphicon-triangle-bottom { &:before { content: \"\\e252\"; } }\n.glyphicon-triangle-top { &:before { content: \"\\e253\"; } }\n.glyphicon-console { &:before { content: \"\\e254\"; } }\n.glyphicon-superscript { &:before { content: \"\\e255\"; } }\n.glyphicon-subscript { &:before { content: \"\\e256\"; } }\n.glyphicon-menu-left { &:before { content: \"\\e257\"; } }\n.glyphicon-menu-right { &:before { content: \"\\e258\"; } }\n.glyphicon-menu-down { &:before { content: \"\\e259\"; } }\n.glyphicon-menu-up { &:before { content: \"\\e260\"; } }\n","//\n// Scaffolding\n// --------------------------------------------------\n\n\n// Reset the box-sizing\n//\n// Heads up! This reset may cause conflicts with some third-party widgets.\n// For recommendations on resolving such conflicts, see\n// http://getbootstrap.com/getting-started/#third-box-sizing\n* {\n .box-sizing(border-box);\n}\n*:before,\n*:after {\n .box-sizing(border-box);\n}\n\n\n// Body reset\n\nhtml {\n font-size: 10px;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n\nbody {\n font-family: @font-family-base;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @text-color;\n background-color: @body-bg;\n}\n\n// Reset fonts for relevant elements\ninput,\nbutton,\nselect,\ntextarea {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n\n// Links\n\na {\n color: @link-color;\n text-decoration: none;\n\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n }\n\n &:focus {\n .tab-focus();\n }\n}\n\n\n// Figures\n//\n// We reset this here because previously Normalize had no `figure` margins. This\n// ensures we don't break anyone's use of the element.\n\nfigure {\n margin: 0;\n}\n\n\n// Images\n\nimg {\n vertical-align: middle;\n}\n\n// Responsive images (ensure images don't scale beyond their parents)\n.img-responsive {\n .img-responsive();\n}\n\n// Rounded corners\n.img-rounded {\n border-radius: @border-radius-large;\n}\n\n// Image thumbnails\n//\n// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.\n.img-thumbnail {\n padding: @thumbnail-padding;\n line-height: @line-height-base;\n background-color: @thumbnail-bg;\n border: 1px solid @thumbnail-border;\n border-radius: @thumbnail-border-radius;\n .transition(all .2s ease-in-out);\n\n // Keep them at most 100% wide\n .img-responsive(inline-block);\n}\n\n// Perfect circle\n.img-circle {\n border-radius: 50%; // set radius in percents\n}\n\n\n// Horizontal rules\n\nhr {\n margin-top: @line-height-computed;\n margin-bottom: @line-height-computed;\n border: 0;\n border-top: 1px solid @hr-border;\n}\n\n\n// Only display content to screen readers\n//\n// See: http://a11yproject.com/posts/how-to-hide-content/\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0,0,0,0);\n border: 0;\n}\n\n// Use in conjunction with .sr-only to only display content when it's focused.\n// Useful for \"Skip to main content\" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1\n// Credit: HTML5 Boilerplate\n\n.sr-only-focusable {\n &:active,\n &:focus {\n position: static;\n width: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n clip: auto;\n }\n}\n\n\n// iOS \"clickable elements\" fix for role=\"button\"\n//\n// Fixes \"clickability\" issue (and more generally, the firing of events such as focus as well)\n// for traditionally non-focusable elements with role=\"button\"\n// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n\n[role=\"button\"] {\n cursor: pointer;\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They have been removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n -webkit-animation: @animation;\n -o-animation: @animation;\n animation: @animation;\n}\n.animation-name(@name) {\n -webkit-animation-name: @name;\n animation-name: @name;\n}\n.animation-duration(@duration) {\n -webkit-animation-duration: @duration;\n animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n -webkit-animation-timing-function: @timing-function;\n animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n -webkit-animation-delay: @delay;\n animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n -webkit-animation-iteration-count: @iteration-count;\n animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n -webkit-animation-direction: @direction;\n animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n -webkit-animation-fill-mode: @fill-mode;\n animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility) {\n -webkit-backface-visibility: @visibility;\n -moz-backface-visibility: @visibility;\n backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n -webkit-box-sizing: @boxmodel;\n -moz-box-sizing: @boxmodel;\n box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n -webkit-column-count: @column-count;\n -moz-column-count: @column-count;\n column-count: @column-count;\n -webkit-column-gap: @column-gap;\n -moz-column-gap: @column-gap;\n column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n word-wrap: break-word;\n -webkit-hyphens: @mode;\n -moz-hyphens: @mode;\n -ms-hyphens: @mode; // IE10+\n -o-hyphens: @mode;\n hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n // Firefox\n &::-moz-placeholder {\n color: @color;\n opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526\n }\n &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+\n &::-webkit-input-placeholder { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n -webkit-transform: scale(@ratio);\n -ms-transform: scale(@ratio); // IE9 only\n -o-transform: scale(@ratio);\n transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n -webkit-transform: scale(@ratioX, @ratioY);\n -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n -o-transform: scale(@ratioX, @ratioY);\n transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n -webkit-transform: scaleX(@ratio);\n -ms-transform: scaleX(@ratio); // IE9 only\n -o-transform: scaleX(@ratio);\n transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n -webkit-transform: scaleY(@ratio);\n -ms-transform: scaleY(@ratio); // IE9 only\n -o-transform: scaleY(@ratio);\n transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n -webkit-transform: skewX(@x) skewY(@y);\n -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n -o-transform: skewX(@x) skewY(@y);\n transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n -webkit-transform: translate(@x, @y);\n -ms-transform: translate(@x, @y); // IE9 only\n -o-transform: translate(@x, @y);\n transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n -webkit-transform: translate3d(@x, @y, @z);\n transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n -webkit-transform: rotate(@degrees);\n -ms-transform: rotate(@degrees); // IE9 only\n -o-transform: rotate(@degrees);\n transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n -webkit-transform: rotateX(@degrees);\n -ms-transform: rotateX(@degrees); // IE9 only\n -o-transform: rotateX(@degrees);\n transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n -webkit-transform: rotateY(@degrees);\n -ms-transform: rotateY(@degrees); // IE9 only\n -o-transform: rotateY(@degrees);\n transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n -webkit-perspective: @perspective;\n -moz-perspective: @perspective;\n perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n -webkit-perspective-origin: @perspective;\n -moz-perspective-origin: @perspective;\n perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n -webkit-transform-origin: @origin;\n -moz-transform-origin: @origin;\n -ms-transform-origin: @origin; // IE9 only\n transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n -webkit-transition: @transition;\n -o-transition: @transition;\n transition: @transition;\n}\n.transition-property(@transition-property) {\n -webkit-transition-property: @transition-property;\n transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n -webkit-transition-delay: @transition-delay;\n transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n -webkit-transition-duration: @transition-duration;\n transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n -webkit-transition-timing-function: @timing-function;\n transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n -webkit-transition: -webkit-transform @transition;\n -moz-transition: -moz-transform @transition;\n -o-transition: -o-transform @transition;\n transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n -webkit-user-select: @select;\n -moz-user-select: @select;\n -ms-user-select: @select; // IE10+\n user-select: @select;\n}\n","// WebKit-style focus\n\n.tab-focus() {\n // Default\n outline: thin dotted;\n // WebKit\n outline: 5px auto -webkit-focus-ring-color;\n outline-offset: -2px;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n.img-responsive(@display: block) {\n display: @display;\n max-width: 100%; // Part 1: Set a maximum relative to the parent\n height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size. Note that the\n// spelling of `min--moz-device-pixel-ratio` is intentional.\n.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {\n background-image: url(\"@{file-1x}\");\n\n @media\n only screen and (-webkit-min-device-pixel-ratio: 2),\n only screen and ( min--moz-device-pixel-ratio: 2),\n only screen and ( -o-min-device-pixel-ratio: 2/1),\n only screen and ( min-device-pixel-ratio: 2),\n only screen and ( min-resolution: 192dpi),\n only screen and ( min-resolution: 2dppx) {\n background-image: url(\"@{file-2x}\");\n background-size: @width-1x @height-1x;\n }\n}\n","//\n// Typography\n// --------------------------------------------------\n\n\n// Headings\n// -------------------------\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n font-family: @headings-font-family;\n font-weight: @headings-font-weight;\n line-height: @headings-line-height;\n color: @headings-color;\n\n small,\n .small {\n font-weight: normal;\n line-height: 1;\n color: @headings-small-color;\n }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n margin-top: @line-height-computed;\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 65%;\n }\n}\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n margin-top: (@line-height-computed / 2);\n margin-bottom: (@line-height-computed / 2);\n\n small,\n .small {\n font-size: 75%;\n }\n}\n\nh1, .h1 { font-size: @font-size-h1; }\nh2, .h2 { font-size: @font-size-h2; }\nh3, .h3 { font-size: @font-size-h3; }\nh4, .h4 { font-size: @font-size-h4; }\nh5, .h5 { font-size: @font-size-h5; }\nh6, .h6 { font-size: @font-size-h6; }\n\n\n// Body text\n// -------------------------\n\np {\n margin: 0 0 (@line-height-computed / 2);\n}\n\n.lead {\n margin-bottom: @line-height-computed;\n font-size: floor((@font-size-base * 1.15));\n font-weight: 300;\n line-height: 1.4;\n\n @media (min-width: @screen-sm-min) {\n font-size: (@font-size-base * 1.5);\n }\n}\n\n\n// Emphasis & misc\n// -------------------------\n\n// Ex: (12px small font / 14px base font) * 100% = about 85%\nsmall,\n.small {\n font-size: floor((100% * @font-size-small / @font-size-base));\n}\n\nmark,\n.mark {\n background-color: @state-warning-bg;\n padding: .2em;\n}\n\n// Alignment\n.text-left { text-align: left; }\n.text-right { text-align: right; }\n.text-center { text-align: center; }\n.text-justify { text-align: justify; }\n.text-nowrap { white-space: nowrap; }\n\n// Transformation\n.text-lowercase { text-transform: lowercase; }\n.text-uppercase { text-transform: uppercase; }\n.text-capitalize { text-transform: capitalize; }\n\n// Contextual colors\n.text-muted {\n color: @text-muted;\n}\n.text-primary {\n .text-emphasis-variant(@brand-primary);\n}\n.text-success {\n .text-emphasis-variant(@state-success-text);\n}\n.text-info {\n .text-emphasis-variant(@state-info-text);\n}\n.text-warning {\n .text-emphasis-variant(@state-warning-text);\n}\n.text-danger {\n .text-emphasis-variant(@state-danger-text);\n}\n\n// Contextual backgrounds\n// For now we'll leave these alongside the text classes until v4 when we can\n// safely shift things around (per SemVer rules).\n.bg-primary {\n // Given the contrast here, this is the only class to have its color inverted\n // automatically.\n color: #fff;\n .bg-variant(@brand-primary);\n}\n.bg-success {\n .bg-variant(@state-success-bg);\n}\n.bg-info {\n .bg-variant(@state-info-bg);\n}\n.bg-warning {\n .bg-variant(@state-warning-bg);\n}\n.bg-danger {\n .bg-variant(@state-danger-bg);\n}\n\n\n// Page header\n// -------------------------\n\n.page-header {\n padding-bottom: ((@line-height-computed / 2) - 1);\n margin: (@line-height-computed * 2) 0 @line-height-computed;\n border-bottom: 1px solid @page-header-border-color;\n}\n\n\n// Lists\n// -------------------------\n\n// Unordered and Ordered lists\nul,\nol {\n margin-top: 0;\n margin-bottom: (@line-height-computed / 2);\n ul,\n ol {\n margin-bottom: 0;\n }\n}\n\n// List options\n\n// Unstyled keeps list items block level, just removes default browser padding and list-style\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n\n// Inline turns list items into inline-block\n.list-inline {\n .list-unstyled();\n margin-left: -5px;\n\n > li {\n display: inline-block;\n padding-left: 5px;\n padding-right: 5px;\n }\n}\n\n// Description Lists\ndl {\n margin-top: 0; // Remove browser default\n margin-bottom: @line-height-computed;\n}\ndt,\ndd {\n line-height: @line-height-base;\n}\ndt {\n font-weight: bold;\n}\ndd {\n margin-left: 0; // Undo browser default\n}\n\n// Horizontal description lists\n//\n// Defaults to being stacked without any of the below styles applied, until the\n// grid breakpoint is reached (default of ~768px).\n\n.dl-horizontal {\n dd {\n &:extend(.clearfix all); // Clear the floated `dt` if an empty `dd` is present\n }\n\n @media (min-width: @dl-horizontal-breakpoint) {\n dt {\n float: left;\n width: (@dl-horizontal-offset - 20);\n clear: left;\n text-align: right;\n .text-overflow();\n }\n dd {\n margin-left: @dl-horizontal-offset;\n }\n }\n}\n\n\n// Misc\n// -------------------------\n\n// Abbreviations and acronyms\nabbr[title],\n// Add data-* attribute to help out our tooltip plugin, per https://github.com/twbs/bootstrap/issues/5257\nabbr[data-original-title] {\n cursor: help;\n border-bottom: 1px dotted @abbr-border-color;\n}\n.initialism {\n font-size: 90%;\n .text-uppercase();\n}\n\n// Blockquotes\nblockquote {\n padding: (@line-height-computed / 2) @line-height-computed;\n margin: 0 0 @line-height-computed;\n font-size: @blockquote-font-size;\n border-left: 5px solid @blockquote-border-color;\n\n p,\n ul,\n ol {\n &:last-child {\n margin-bottom: 0;\n }\n }\n\n // Note: Deprecated small and .small as of v3.1.0\n // Context: https://github.com/twbs/bootstrap/issues/11660\n footer,\n small,\n .small {\n display: block;\n font-size: 80%; // back to default font-size\n line-height: @line-height-base;\n color: @blockquote-small-color;\n\n &:before {\n content: '\\2014 \\00A0'; // em dash, nbsp\n }\n }\n}\n\n// Opposite alignment of blockquote\n//\n// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.\n.blockquote-reverse,\nblockquote.pull-right {\n padding-right: 15px;\n padding-left: 0;\n border-right: 5px solid @blockquote-border-color;\n border-left: 0;\n text-align: right;\n\n // Account for citation\n footer,\n small,\n .small {\n &:before { content: ''; }\n &:after {\n content: '\\00A0 \\2014'; // nbsp, em dash\n }\n }\n}\n\n// Addresses\naddress {\n margin-bottom: @line-height-computed;\n font-style: normal;\n line-height: @line-height-base;\n}\n","// Typography\n\n.text-emphasis-variant(@color) {\n color: @color;\n a&:hover,\n a&:focus {\n color: darken(@color, 10%);\n }\n}\n","// Contextual backgrounds\n\n.bg-variant(@color) {\n background-color: @color;\n a&:hover,\n a&:focus {\n background-color: darken(@color, 10%);\n }\n}\n","// Text overflow\n// Requires inline-block or block for proper styling\n\n.text-overflow() {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n","//\n// Code (inline and block)\n// --------------------------------------------------\n\n\n// Inline and block code styles\ncode,\nkbd,\npre,\nsamp {\n font-family: @font-family-monospace;\n}\n\n// Inline code\ncode {\n padding: 2px 4px;\n font-size: 90%;\n color: @code-color;\n background-color: @code-bg;\n border-radius: @border-radius-base;\n}\n\n// User input typically entered via keyboard\nkbd {\n padding: 2px 4px;\n font-size: 90%;\n color: @kbd-color;\n background-color: @kbd-bg;\n border-radius: @border-radius-small;\n box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);\n\n kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n box-shadow: none;\n }\n}\n\n// Blocks of code\npre {\n display: block;\n padding: ((@line-height-computed - 1) / 2);\n margin: 0 0 (@line-height-computed / 2);\n font-size: (@font-size-base - 1); // 14px to 13px\n line-height: @line-height-base;\n word-break: break-all;\n word-wrap: break-word;\n color: @pre-color;\n background-color: @pre-bg;\n border: 1px solid @pre-border-color;\n border-radius: @border-radius-base;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n white-space: pre-wrap;\n background-color: transparent;\n border-radius: 0;\n }\n}\n\n// Enable scrollable blocks of code\n.pre-scrollable {\n max-height: @pre-scrollable-max-height;\n overflow-y: scroll;\n}\n","//\n// Grid system\n// --------------------------------------------------\n\n\n// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n.container {\n .container-fixed();\n\n @media (min-width: @screen-sm-min) {\n width: @container-sm;\n }\n @media (min-width: @screen-md-min) {\n width: @container-md;\n }\n @media (min-width: @screen-lg-min) {\n width: @container-lg;\n }\n}\n\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but without any defined\n// width for fluid, full width layouts.\n\n.container-fluid {\n .container-fixed();\n}\n\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n.row {\n .make-row();\n}\n\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n.make-grid-columns();\n\n\n// Extra small grid\n//\n// Columns, offsets, pushes, and pulls for extra small devices like\n// smartphones.\n\n.make-grid(xs);\n\n\n// Small grid\n//\n// Columns, offsets, pushes, and pulls for the small device range, from phones\n// to tablets.\n\n@media (min-width: @screen-sm-min) {\n .make-grid(sm);\n}\n\n\n// Medium grid\n//\n// Columns, offsets, pushes, and pulls for the desktop device range.\n\n@media (min-width: @screen-md-min) {\n .make-grid(md);\n}\n\n\n// Large grid\n//\n// Columns, offsets, pushes, and pulls for the large desktop device range.\n\n@media (min-width: @screen-lg-min) {\n .make-grid(lg);\n}\n","// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n// Centered container element\n.container-fixed(@gutter: @grid-gutter-width) {\n margin-right: auto;\n margin-left: auto;\n padding-left: floor((@gutter / 2));\n padding-right: ceil((@gutter / 2));\n &:extend(.clearfix all);\n}\n\n// Creates a wrapper for a series of columns\n.make-row(@gutter: @grid-gutter-width) {\n margin-left: ceil((@gutter / -2));\n margin-right: floor((@gutter / -2));\n &:extend(.clearfix all);\n}\n\n// Generate the extra small columns\n.make-xs-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n float: left;\n width: percentage((@columns / @grid-columns));\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n}\n.make-xs-column-offset(@columns) {\n margin-left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-push(@columns) {\n left: percentage((@columns / @grid-columns));\n}\n.make-xs-column-pull(@columns) {\n right: percentage((@columns / @grid-columns));\n}\n\n// Generate the small columns\n.make-sm-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-sm-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-offset(@columns) {\n @media (min-width: @screen-sm-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-push(@columns) {\n @media (min-width: @screen-sm-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-sm-column-pull(@columns) {\n @media (min-width: @screen-sm-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the medium columns\n.make-md-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-md-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-offset(@columns) {\n @media (min-width: @screen-md-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-push(@columns) {\n @media (min-width: @screen-md-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-md-column-pull(@columns) {\n @media (min-width: @screen-md-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n\n// Generate the large columns\n.make-lg-column(@columns; @gutter: @grid-gutter-width) {\n position: relative;\n min-height: 1px;\n padding-left: (@gutter / 2);\n padding-right: (@gutter / 2);\n\n @media (min-width: @screen-lg-min) {\n float: left;\n width: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-offset(@columns) {\n @media (min-width: @screen-lg-min) {\n margin-left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-push(@columns) {\n @media (min-width: @screen-lg-min) {\n left: percentage((@columns / @grid-columns));\n }\n}\n.make-lg-column-pull(@columns) {\n @media (min-width: @screen-lg-min) {\n right: percentage((@columns / @grid-columns));\n }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `@grid-columns`.\n\n.make-grid-columns() {\n // Common styles for all sizes of grid columns, widths 1-12\n .col(@index) { // initial\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general; \"=<\" isn't a typo\n @item: ~\".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n position: relative;\n // Prevent columns from collapsing when empty\n min-height: 1px;\n // Inner gutter via padding\n padding-left: ceil((@grid-gutter-width / 2));\n padding-right: floor((@grid-gutter-width / 2));\n }\n }\n .col(1); // kickstart it\n}\n\n.float-grid-columns(@class) {\n .col(@index) { // initial\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), @item);\n }\n .col(@index, @list) when (@index =< @grid-columns) { // general\n @item: ~\".col-@{class}-@{index}\";\n .col((@index + 1), ~\"@{list}, @{item}\");\n }\n .col(@index, @list) when (@index > @grid-columns) { // terminal\n @{list} {\n float: left;\n }\n }\n .col(1); // kickstart it\n}\n\n.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {\n .col-@{class}-@{index} {\n width: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) {\n .col-@{class}-push-@{index} {\n left: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {\n .col-@{class}-push-0 {\n left: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {\n .col-@{class}-pull-@{index} {\n right: percentage((@index / @grid-columns));\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {\n .col-@{class}-pull-0 {\n right: auto;\n }\n}\n.calc-grid-column(@index, @class, @type) when (@type = offset) {\n .col-@{class}-offset-@{index} {\n margin-left: percentage((@index / @grid-columns));\n }\n}\n\n// Basic looping in LESS\n.loop-grid-columns(@index, @class, @type) when (@index >= 0) {\n .calc-grid-column(@index, @class, @type);\n // next iteration\n .loop-grid-columns((@index - 1), @class, @type);\n}\n\n// Create grid for specific class\n.make-grid(@class) {\n .float-grid-columns(@class);\n .loop-grid-columns(@grid-columns, @class, width);\n .loop-grid-columns(@grid-columns, @class, pull);\n .loop-grid-columns(@grid-columns, @class, push);\n .loop-grid-columns(@grid-columns, @class, offset);\n}\n","//\n// Tables\n// --------------------------------------------------\n\n\ntable {\n background-color: @table-bg;\n}\ncaption {\n padding-top: @table-cell-padding;\n padding-bottom: @table-cell-padding;\n color: @text-muted;\n text-align: left;\n}\nth {\n text-align: left;\n}\n\n\n// Baseline styles\n\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: @line-height-computed;\n // Cells\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-cell-padding;\n line-height: @line-height-base;\n vertical-align: top;\n border-top: 1px solid @table-border-color;\n }\n }\n }\n // Bottom align for column headings\n > thead > tr > th {\n vertical-align: bottom;\n border-bottom: 2px solid @table-border-color;\n }\n // Remove top border from thead by default\n > caption + thead,\n > colgroup + thead,\n > thead:first-child {\n > tr:first-child {\n > th,\n > td {\n border-top: 0;\n }\n }\n }\n // Account for multiple tbody instances\n > tbody + tbody {\n border-top: 2px solid @table-border-color;\n }\n\n // Nesting\n .table {\n background-color: @body-bg;\n }\n}\n\n\n// Condensed table w/ half padding\n\n.table-condensed {\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n padding: @table-condensed-cell-padding;\n }\n }\n }\n}\n\n\n// Bordered version\n//\n// Add borders all around the table and between all the columns.\n\n.table-bordered {\n border: 1px solid @table-border-color;\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n border: 1px solid @table-border-color;\n }\n }\n }\n > thead > tr {\n > th,\n > td {\n border-bottom-width: 2px;\n }\n }\n}\n\n\n// Zebra-striping\n//\n// Default zebra-stripe styles (alternating gray and transparent backgrounds)\n\n.table-striped {\n > tbody > tr:nth-of-type(odd) {\n background-color: @table-bg-accent;\n }\n}\n\n\n// Hover effect\n//\n// Placed here since it has to come after the potential zebra striping\n\n.table-hover {\n > tbody > tr:hover {\n background-color: @table-bg-hover;\n }\n}\n\n\n// Table cell sizing\n//\n// Reset default table behavior\n\ntable col[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-column;\n}\ntable {\n td,\n th {\n &[class*=\"col-\"] {\n position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)\n float: none;\n display: table-cell;\n }\n }\n}\n\n\n// Table backgrounds\n//\n// Exact selectors below required to override `.table-striped` and prevent\n// inheritance to nested tables.\n\n// Generate the contextual variants\n.table-row-variant(active; @table-bg-active);\n.table-row-variant(success; @state-success-bg);\n.table-row-variant(info; @state-info-bg);\n.table-row-variant(warning; @state-warning-bg);\n.table-row-variant(danger; @state-danger-bg);\n\n\n// Responsive tables\n//\n// Wrap your tables in `.table-responsive` and we'll make them mobile friendly\n// by enabling horizontal scrolling. Only applies <768px. Everything above that\n// will display normally.\n\n.table-responsive {\n overflow-x: auto;\n min-height: 0.01%; // Workaround for IE9 bug (see https://github.com/twbs/bootstrap/issues/14837)\n\n @media screen and (max-width: @screen-xs-max) {\n width: 100%;\n margin-bottom: (@line-height-computed * 0.75);\n overflow-y: hidden;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n border: 1px solid @table-border-color;\n\n // Tighten up spacing\n > .table {\n margin-bottom: 0;\n\n // Ensure the content doesn't wrap\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th,\n > td {\n white-space: nowrap;\n }\n }\n }\n }\n\n // Special overrides for the bordered tables\n > .table-bordered {\n border: 0;\n\n // Nuke the appropriate borders so that the parent can handle them\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th:first-child,\n > td:first-child {\n border-left: 0;\n }\n > th:last-child,\n > td:last-child {\n border-right: 0;\n }\n }\n }\n\n // Only nuke the last row's bottom-border in `tbody` and `tfoot` since\n // chances are there will be only one `tr` in a `thead` and that would\n // remove the border altogether.\n > tbody,\n > tfoot {\n > tr:last-child {\n > th,\n > td {\n border-bottom: 0;\n }\n }\n }\n\n }\n }\n}\n","// Tables\n\n.table-row-variant(@state; @background) {\n // Exact selectors below required to override `.table-striped` and prevent\n // inheritance to nested tables.\n .table > thead > tr,\n .table > tbody > tr,\n .table > tfoot > tr {\n > td.@{state},\n > th.@{state},\n &.@{state} > td,\n &.@{state} > th {\n background-color: @background;\n }\n }\n\n // Hover states for `.table-hover`\n // Note: this is not available for cells or rows within `thead` or `tfoot`.\n .table-hover > tbody > tr {\n > td.@{state}:hover,\n > th.@{state}:hover,\n &.@{state}:hover > td,\n &:hover > .@{state},\n &.@{state}:hover > th {\n background-color: darken(@background, 5%);\n }\n }\n}\n","//\n// Forms\n// --------------------------------------------------\n\n\n// Normalize non-controls\n//\n// Restyle and baseline non-control form elements.\n\nfieldset {\n padding: 0;\n margin: 0;\n border: 0;\n // Chrome and Firefox set a `min-width: min-content;` on fieldsets,\n // so we reset that to ensure it behaves more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359.\n min-width: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n padding: 0;\n margin-bottom: @line-height-computed;\n font-size: (@font-size-base * 1.5);\n line-height: inherit;\n color: @legend-color;\n border: 0;\n border-bottom: 1px solid @legend-border-color;\n}\n\nlabel {\n display: inline-block;\n max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)\n margin-bottom: 5px;\n font-weight: bold;\n}\n\n\n// Normalize form controls\n//\n// While most of our form styles require extra classes, some basic normalization\n// is required to ensure optimum display with or without those classes to better\n// address browser inconsistencies.\n\n// Override content-box in Normalize (* isn't specific enough)\ninput[type=\"search\"] {\n .box-sizing(border-box);\n}\n\n// Position radios and checkboxes better\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n margin: 4px 0 0;\n margin-top: 1px \\9; // IE8-9\n line-height: normal;\n}\n\ninput[type=\"file\"] {\n display: block;\n}\n\n// Make range inputs behave like textual form controls\ninput[type=\"range\"] {\n display: block;\n width: 100%;\n}\n\n// Make multiple select elements height not fixed\nselect[multiple],\nselect[size] {\n height: auto;\n}\n\n// Focus for file, radio, and checkbox\ninput[type=\"file\"]:focus,\ninput[type=\"radio\"]:focus,\ninput[type=\"checkbox\"]:focus {\n .tab-focus();\n}\n\n// Adjust output element\noutput {\n display: block;\n padding-top: (@padding-base-vertical + 1);\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n}\n\n\n// Common form controls\n//\n// Shared size and type resets for form controls. Apply `.form-control` to any\n// of the following form controls:\n//\n// select\n// textarea\n// input[type=\"text\"]\n// input[type=\"password\"]\n// input[type=\"datetime\"]\n// input[type=\"datetime-local\"]\n// input[type=\"date\"]\n// input[type=\"month\"]\n// input[type=\"time\"]\n// input[type=\"week\"]\n// input[type=\"number\"]\n// input[type=\"email\"]\n// input[type=\"url\"]\n// input[type=\"search\"]\n// input[type=\"tel\"]\n// input[type=\"color\"]\n\n.form-control {\n display: block;\n width: 100%;\n height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)\n padding: @padding-base-vertical @padding-base-horizontal;\n font-size: @font-size-base;\n line-height: @line-height-base;\n color: @input-color;\n background-color: @input-bg;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid @input-border;\n border-radius: @input-border-radius; // Note: This has no effect on <select>s in some browsers, due to the limited stylability of <select>s in CSS.\n .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));\n .transition(~\"border-color ease-in-out .15s, box-shadow ease-in-out .15s\");\n\n // Customize the `:focus` state to imitate native WebKit styles.\n .form-control-focus();\n\n // Placeholder\n .placeholder();\n\n // Unstyle the caret on `<select>`s in IE10+.\n &::-ms-expand {\n border: 0;\n background-color: transparent;\n }\n\n // Disabled and read-only inputs\n //\n // HTML5 says that controls under a fieldset > legend:first-child won't be\n // disabled if the fieldset is disabled. Due to implementation difficulty, we\n // don't honor that edge case; we style them as disabled anyway.\n &[disabled],\n &[readonly],\n fieldset[disabled] & {\n background-color: @input-bg-disabled;\n opacity: 1; // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655\n }\n\n &[disabled],\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n }\n\n // Reset height for `textarea`s\n textarea& {\n height: auto;\n }\n}\n\n\n// Search inputs in iOS\n//\n// This overrides the extra rounded corners on search inputs in iOS so that our\n// `.form-control` class can properly style them. Note that this cannot simply\n// be added to `.form-control` as it's not specific enough. For details, see\n// https://github.com/twbs/bootstrap/issues/11586.\n\ninput[type=\"search\"] {\n -webkit-appearance: none;\n}\n\n\n// Special styles for iOS temporal inputs\n//\n// In Mobile Safari, setting `display: block` on temporal inputs causes the\n// text within the input to become vertically misaligned. As a workaround, we\n// set a pixel line-height that matches the given height of the input, but only\n// for Safari. See https://bugs.webkit.org/show_bug.cgi?id=139848\n//\n// Note that as of 8.3, iOS doesn't support `datetime` or `week`.\n\n@media screen and (-webkit-min-device-pixel-ratio: 0) {\n input[type=\"date\"],\n input[type=\"time\"],\n input[type=\"datetime-local\"],\n input[type=\"month\"] {\n &.form-control {\n line-height: @input-height-base;\n }\n\n &.input-sm,\n .input-group-sm & {\n line-height: @input-height-small;\n }\n\n &.input-lg,\n .input-group-lg & {\n line-height: @input-height-large;\n }\n }\n}\n\n\n// Form groups\n//\n// Designed to help with the organization and spacing of vertical forms. For\n// horizontal forms, use the predefined grid classes.\n\n.form-group {\n margin-bottom: @form-group-margin-bottom;\n}\n\n\n// Checkboxes and radios\n//\n// Indent the labels to position radios/checkboxes as hanging controls.\n\n.radio,\n.checkbox {\n position: relative;\n display: block;\n margin-top: 10px;\n margin-bottom: 10px;\n\n label {\n min-height: @line-height-computed; // Ensure the input doesn't jump when there is no text\n padding-left: 20px;\n margin-bottom: 0;\n font-weight: normal;\n cursor: pointer;\n }\n}\n.radio input[type=\"radio\"],\n.radio-inline input[type=\"radio\"],\n.checkbox input[type=\"checkbox\"],\n.checkbox-inline input[type=\"checkbox\"] {\n position: absolute;\n margin-left: -20px;\n margin-top: 4px \\9;\n}\n\n.radio + .radio,\n.checkbox + .checkbox {\n margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing\n}\n\n// Radios and checkboxes on same line\n.radio-inline,\n.checkbox-inline {\n position: relative;\n display: inline-block;\n padding-left: 20px;\n margin-bottom: 0;\n vertical-align: middle;\n font-weight: normal;\n cursor: pointer;\n}\n.radio-inline + .radio-inline,\n.checkbox-inline + .checkbox-inline {\n margin-top: 0;\n margin-left: 10px; // space out consecutive inline controls\n}\n\n// Apply same disabled cursor tweak as for inputs\n// Some special care is needed because <label>s don't inherit their parent's `cursor`.\n//\n// Note: Neither radios nor checkboxes can be readonly.\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n &[disabled],\n &.disabled,\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n }\n}\n// These classes are used directly on <label>s\n.radio-inline,\n.checkbox-inline {\n &.disabled,\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n }\n}\n// These classes are used on elements with <label> descendants\n.radio,\n.checkbox {\n &.disabled,\n fieldset[disabled] & {\n label {\n cursor: @cursor-disabled;\n }\n }\n}\n\n\n// Static form control text\n//\n// Apply class to a `p` element to make any string of text align with labels in\n// a horizontal form layout.\n\n.form-control-static {\n // Size it appropriately next to real form controls\n padding-top: (@padding-base-vertical + 1);\n padding-bottom: (@padding-base-vertical + 1);\n // Remove default margin from `p`\n margin-bottom: 0;\n min-height: (@line-height-computed + @font-size-base);\n\n &.input-lg,\n &.input-sm {\n padding-left: 0;\n padding-right: 0;\n }\n}\n\n\n// Form control sizing\n//\n// Build on `.form-control` with modifier classes to decrease or increase the\n// height and font-size of form controls.\n//\n// The `.form-group-* form-control` variations are sadly duplicated to avoid the\n// issue documented in https://github.com/twbs/bootstrap/issues/15074.\n\n.input-sm {\n .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @input-border-radius-small);\n}\n.form-group-sm {\n .form-control {\n height: @input-height-small;\n padding: @padding-small-vertical @padding-small-horizontal;\n font-size: @font-size-small;\n line-height: @line-height-small;\n border-radius: @input-border-radius-small;\n }\n select.form-control {\n height: @input-height-small;\n line-height: @input-height-small;\n }\n textarea.form-control,\n select[multiple].form-control {\n height: auto;\n }\n .form-control-static {\n height: @input-height-small;\n min-height: (@line-height-computed + @font-size-small);\n padding: (@padding-small-vertical + 1) @padding-small-horizontal;\n font-size: @font-size-small;\n line-height: @line-height-small;\n }\n}\n\n.input-lg {\n .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @input-border-radius-large);\n}\n.form-group-lg {\n .form-control {\n height: @input-height-large;\n padding: @padding-large-vertical @padding-large-horizontal;\n font-size: @font-size-large;\n line-height: @line-height-large;\n border-radius: @input-border-radius-large;\n }\n select.form-control {\n height: @input-height-large;\n line-height: @input-height-large;\n }\n textarea.form-control,\n select[multiple].form-control {\n height: auto;\n }\n .form-control-static {\n height: @input-height-large;\n min-height: (@line-height-computed + @font-size-large);\n padding: (@padding-large-vertical + 1) @padding-large-horizontal;\n font-size: @font-size-large;\n line-height: @line-height-large;\n }\n}\n\n\n// Form control feedback states\n//\n// Apply contextual and semantic states to individual form controls.\n\n.has-feedback {\n // Enable absolute positioning\n position: relative;\n\n // Ensure icons don't overlap text\n .form-control {\n padding-right: (@input-height-base * 1.25);\n }\n}\n// Feedback icon (requires .glyphicon classes)\n.form-control-feedback {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 2; // Ensure icon is above input groups\n display: block;\n width: @input-height-base;\n height: @input-height-base;\n line-height: @input-height-base;\n text-align: center;\n pointer-events: none;\n}\n.input-lg + .form-control-feedback,\n.input-group-lg + .form-control-feedback,\n.form-group-lg .form-control + .form-control-feedback {\n width: @input-height-large;\n height: @input-height-large;\n line-height: @input-height-large;\n}\n.input-sm + .form-control-feedback,\n.input-group-sm + .form-control-feedback,\n.form-group-sm .form-control + .form-control-feedback {\n width: @input-height-small;\n height: @input-height-small;\n line-height: @input-height-small;\n}\n\n// Feedback states\n.has-success {\n .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);\n}\n.has-warning {\n .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);\n}\n.has-error {\n .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);\n}\n\n// Reposition feedback icon if input has visible label above\n.has-feedback label {\n\n & ~ .form-control-feedback {\n top: (@line-height-computed + 5); // Height of the `label` and its margin\n }\n &.sr-only ~ .form-control-feedback {\n top: 0;\n }\n}\n\n\n// Help text\n//\n// Apply to any element you wish to create light text for placement immediately\n// below a form control. Use for general help, formatting, or instructional text.\n\n.help-block {\n display: block; // account for any element using help-block\n margin-top: 5px;\n margin-bottom: 10px;\n color: lighten(@text-color, 25%); // lighten the text some for contrast\n}\n\n\n// Inline forms\n//\n// Make forms appear inline(-block) by adding the `.form-inline` class. Inline\n// forms begin stacked on extra small (mobile) devices and then go inline when\n// viewports reach <768px.\n//\n// Requires wrapping inputs and labels with `.form-group` for proper display of\n// default HTML form controls and our custom form controls (e.g., input groups).\n//\n// Heads up! This is mixin-ed into `.navbar-form` in navbars.less.\n\n.form-inline {\n\n // Kick in the inline\n @media (min-width: @screen-sm-min) {\n // Inline-block all the things for \"inline\"\n .form-group {\n display: inline-block;\n margin-bottom: 0;\n vertical-align: middle;\n }\n\n // In navbar-form, allow folks to *not* use `.form-group`\n .form-control {\n display: inline-block;\n width: auto; // Prevent labels from stacking above inputs in `.form-group`\n vertical-align: middle;\n }\n\n // Make static controls behave like regular ones\n .form-control-static {\n display: inline-block;\n }\n\n .input-group {\n display: inline-table;\n vertical-align: middle;\n\n .input-group-addon,\n .input-group-btn,\n .form-control {\n width: auto;\n }\n }\n\n // Input groups need that 100% width though\n .input-group > .form-control {\n width: 100%;\n }\n\n .control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n\n // Remove default margin on radios/checkboxes that were used for stacking, and\n // then undo the floating of radios and checkboxes to match.\n .radio,\n .checkbox {\n display: inline-block;\n margin-top: 0;\n margin-bottom: 0;\n vertical-align: middle;\n\n label {\n padding-left: 0;\n }\n }\n .radio input[type=\"radio\"],\n .checkbox input[type=\"checkbox\"] {\n position: relative;\n margin-left: 0;\n }\n\n // Re-override the feedback icon.\n .has-feedback .form-control-feedback {\n top: 0;\n }\n }\n}\n\n\n// Horizontal forms\n//\n// Horizontal forms are built on grid classes and allow you to create forms with\n// labels on the left and inputs on the right.\n\n.form-horizontal {\n\n // Consistent vertical alignment of radios and checkboxes\n //\n // Labels also get some reset styles, but that is scoped to a media query below.\n .radio,\n .checkbox,\n .radio-inline,\n .checkbox-inline {\n margin-top: 0;\n margin-bottom: 0;\n padding-top: (@padding-base-vertical + 1); // Default padding plus a border\n }\n // Account for padding we're adding to ensure the alignment and of help text\n // and other content below items\n .radio,\n .checkbox {\n min-height: (@line-height-computed + (@padding-base-vertical + 1));\n }\n\n // Make form groups behave like rows\n .form-group {\n .make-row();\n }\n\n // Reset spacing and right align labels, but scope to media queries so that\n // labels on narrow viewports stack the same as a default form example.\n @media (min-width: @screen-sm-min) {\n .control-label {\n text-align: right;\n margin-bottom: 0;\n padding-top: (@padding-base-vertical + 1); // Default padding plus a border\n }\n }\n\n // Validation states\n //\n // Reposition the icon because it's now within a grid column and columns have\n // `position: relative;` on them. Also accounts for the grid gutter padding.\n .has-feedback .form-control-feedback {\n right: floor((@grid-gutter-width / 2));\n }\n\n // Form group sizes\n //\n // Quick utility class for applying `.input-lg` and `.input-sm` styles to the\n // inputs and labels within a `.form-group`.\n .form-group-lg {\n @media (min-width: @screen-sm-min) {\n .control-label {\n padding-top: (@padding-large-vertical + 1);\n font-size: @font-size-large;\n }\n }\n }\n .form-group-sm {\n @media (min-width: @screen-sm-min) {\n .control-label {\n padding-top: (@padding-small-vertical + 1);\n font-size: @font-size-small;\n }\n }\n }\n}\n","// Form validation states\n//\n// Used in forms.less to generate the form validation CSS for warnings, errors,\n// and successes.\n\n.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {\n // Color the label and help text\n .help-block,\n .control-label,\n .radio,\n .checkbox,\n .radio-inline,\n .checkbox-inline,\n &.radio label,\n &.checkbox label,\n &.radio-inline label,\n &.checkbox-inline label {\n color: @text-color;\n }\n // Set the border and box shadow on specific inputs to match\n .form-control {\n border-color: @border-color;\n .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work\n &:focus {\n border-color: darken(@border-color, 10%);\n @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);\n .box-shadow(@shadow);\n }\n }\n // Set validation states also for addons\n .input-group-addon {\n color: @text-color;\n border-color: @border-color;\n background-color: @background-color;\n }\n // Optional feedback icon\n .form-control-feedback {\n color: @text-color;\n }\n}\n\n\n// Form control focus state\n//\n// Generate a customized focus state and for any input with the specified color,\n// which defaults to the `@input-border-focus` variable.\n//\n// We highly encourage you to not customize the default value, but instead use\n// this to tweak colors on an as-needed basis. This aesthetic change is based on\n// WebKit's default styles, but applicable to a wider range of browsers. Its\n// usability and accessibility should be taken into account with any change.\n//\n// Example usage: change the default blue border and shadow to white for better\n// contrast against a dark gray background.\n.form-control-focus(@color: @input-border-focus) {\n @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);\n &:focus {\n border-color: @color;\n outline: 0;\n .box-shadow(~\"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}\");\n }\n}\n\n// Form control sizing\n//\n// Relative text size, padding, and border-radii changes for form controls. For\n// horizontal sizing, wrap controls in the predefined grid classes. `<select>`\n// element gets special love because it's special, and that's a fact!\n.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n height: @input-height;\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n border-radius: @border-radius;\n\n select& {\n height: @input-height;\n line-height: @input-height;\n }\n\n textarea&,\n select[multiple]& {\n height: auto;\n }\n}\n","//\n// Buttons\n// --------------------------------------------------\n\n\n// Base styles\n// --------------------------------------------------\n\n.btn {\n display: inline-block;\n margin-bottom: 0; // For input.btn\n font-weight: @btn-font-weight;\n text-align: center;\n vertical-align: middle;\n touch-action: manipulation;\n cursor: pointer;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid transparent;\n white-space: nowrap;\n .button-size(@padding-base-vertical; @padding-base-horizontal; @font-size-base; @line-height-base; @btn-border-radius-base);\n .user-select(none);\n\n &,\n &:active,\n &.active {\n &:focus,\n &.focus {\n .tab-focus();\n }\n }\n\n &:hover,\n &:focus,\n &.focus {\n color: @btn-default-color;\n text-decoration: none;\n }\n\n &:active,\n &.active {\n outline: 0;\n background-image: none;\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n }\n\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n cursor: @cursor-disabled;\n .opacity(.65);\n .box-shadow(none);\n }\n\n a& {\n &.disabled,\n fieldset[disabled] & {\n pointer-events: none; // Future-proof disabling of clicks on `<a>` elements\n }\n }\n}\n\n\n// Alternate buttons\n// --------------------------------------------------\n\n.btn-default {\n .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border);\n}\n.btn-primary {\n .button-variant(@btn-primary-color; @btn-primary-bg; @btn-primary-border);\n}\n// Success appears as green\n.btn-success {\n .button-variant(@btn-success-color; @btn-success-bg; @btn-success-border);\n}\n// Info appears as blue-green\n.btn-info {\n .button-variant(@btn-info-color; @btn-info-bg; @btn-info-border);\n}\n// Warning appears as orange\n.btn-warning {\n .button-variant(@btn-warning-color; @btn-warning-bg; @btn-warning-border);\n}\n// Danger and error appear as red\n.btn-danger {\n .button-variant(@btn-danger-color; @btn-danger-bg; @btn-danger-border);\n}\n\n\n// Link buttons\n// -------------------------\n\n// Make a button look and behave like a link\n.btn-link {\n color: @link-color;\n font-weight: normal;\n border-radius: 0;\n\n &,\n &:active,\n &.active,\n &[disabled],\n fieldset[disabled] & {\n background-color: transparent;\n .box-shadow(none);\n }\n &,\n &:hover,\n &:focus,\n &:active {\n border-color: transparent;\n }\n &:hover,\n &:focus {\n color: @link-hover-color;\n text-decoration: @link-hover-decoration;\n background-color: transparent;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @btn-link-disabled-color;\n text-decoration: none;\n }\n }\n}\n\n\n// Button Sizes\n// --------------------------------------------------\n\n.btn-lg {\n // line-height: ensure even-numbered height of button next to large input\n .button-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @btn-border-radius-large);\n}\n.btn-sm {\n // line-height: ensure proper height of button next to small input\n .button-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n.btn-xs {\n .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @btn-border-radius-small);\n}\n\n\n// Block button\n// --------------------------------------------------\n\n.btn-block {\n display: block;\n width: 100%;\n}\n\n// Vertically space out multiple block buttons\n.btn-block + .btn-block {\n margin-top: 5px;\n}\n\n// Specificity overrides\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"button\"] {\n &.btn-block {\n width: 100%;\n }\n}\n","// Button variants\n//\n// Easily pump out default styles, as well as :hover, :focus, :active,\n// and disabled options for all buttons\n\n.button-variant(@color; @background; @border) {\n color: @color;\n background-color: @background;\n border-color: @border;\n\n &:focus,\n &.focus {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 25%);\n }\n &:hover {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 12%);\n }\n &:active,\n &.active,\n .open > .dropdown-toggle& {\n color: @color;\n background-color: darken(@background, 10%);\n border-color: darken(@border, 12%);\n\n &:hover,\n &:focus,\n &.focus {\n color: @color;\n background-color: darken(@background, 17%);\n border-color: darken(@border, 25%);\n }\n }\n &:active,\n &.active,\n .open > .dropdown-toggle& {\n background-image: none;\n }\n &.disabled,\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus,\n &.focus {\n background-color: @background;\n border-color: @border;\n }\n }\n\n .badge {\n color: @background;\n background-color: @color;\n }\n}\n\n// Button sizes\n.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n border-radius: @border-radius;\n}\n","// Opacity\n\n.opacity(@opacity) {\n opacity: @opacity;\n // IE8 filter\n @opacity-ie: (@opacity * 100);\n filter: ~\"alpha(opacity=@{opacity-ie})\";\n}\n","//\n// Component animations\n// --------------------------------------------------\n\n// Heads up!\n//\n// We don't use the `.opacity()` mixin here since it causes a bug with text\n// fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.\n\n.fade {\n opacity: 0;\n .transition(opacity .15s linear);\n &.in {\n opacity: 1;\n }\n}\n\n.collapse {\n display: none;\n\n &.in { display: block; }\n tr&.in { display: table-row; }\n tbody&.in { display: table-row-group; }\n}\n\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n .transition-property(~\"height, visibility\");\n .transition-duration(.35s);\n .transition-timing-function(ease);\n}\n","//\n// Dropdown menus\n// --------------------------------------------------\n\n\n// Dropdown arrow/caret\n.caret {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 2px;\n vertical-align: middle;\n border-top: @caret-width-base dashed;\n border-top: @caret-width-base solid ~\"\\9\"; // IE8\n border-right: @caret-width-base solid transparent;\n border-left: @caret-width-base solid transparent;\n}\n\n// The dropdown wrapper (div)\n.dropup,\n.dropdown {\n position: relative;\n}\n\n// Prevent the focus on the dropdown toggle when closing dropdowns\n.dropdown-toggle:focus {\n outline: 0;\n}\n\n// The dropdown menu (ul)\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: @zindex-dropdown;\n display: none; // none by default, but block on \"open\" of the menu\n float: left;\n min-width: 160px;\n padding: 5px 0;\n margin: 2px 0 0; // override default ul\n list-style: none;\n font-size: @font-size-base;\n text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)\n background-color: @dropdown-bg;\n border: 1px solid @dropdown-fallback-border; // IE8 fallback\n border: 1px solid @dropdown-border;\n border-radius: @border-radius-base;\n .box-shadow(0 6px 12px rgba(0,0,0,.175));\n background-clip: padding-box;\n\n // Aligns the dropdown menu to right\n //\n // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`\n &.pull-right {\n right: 0;\n left: auto;\n }\n\n // Dividers (basically an hr) within the dropdown\n .divider {\n .nav-divider(@dropdown-divider-bg);\n }\n\n // Links within the dropdown menu\n > li > a {\n display: block;\n padding: 3px 20px;\n clear: both;\n font-weight: normal;\n line-height: @line-height-base;\n color: @dropdown-link-color;\n white-space: nowrap; // prevent links from randomly breaking onto new lines\n }\n}\n\n// Hover/Focus state\n.dropdown-menu > li > a {\n &:hover,\n &:focus {\n text-decoration: none;\n color: @dropdown-link-hover-color;\n background-color: @dropdown-link-hover-bg;\n }\n}\n\n// Active state\n.dropdown-menu > .active > a {\n &,\n &:hover,\n &:focus {\n color: @dropdown-link-active-color;\n text-decoration: none;\n outline: 0;\n background-color: @dropdown-link-active-bg;\n }\n}\n\n// Disabled state\n//\n// Gray out text and ensure the hover/focus state remains gray\n\n.dropdown-menu > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @dropdown-link-disabled-color;\n }\n\n // Nuke hover/focus effects\n &:hover,\n &:focus {\n text-decoration: none;\n background-color: transparent;\n background-image: none; // Remove CSS gradient\n .reset-filter();\n cursor: @cursor-disabled;\n }\n}\n\n// Open state for the dropdown\n.open {\n // Show the menu\n > .dropdown-menu {\n display: block;\n }\n\n // Remove the outline when :focus is triggered\n > a {\n outline: 0;\n }\n}\n\n// Menu positioning\n//\n// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown\n// menu with the parent.\n.dropdown-menu-right {\n left: auto; // Reset the default from `.dropdown-menu`\n right: 0;\n}\n// With v3, we enabled auto-flipping if you have a dropdown within a right\n// aligned nav component. To enable the undoing of that, we provide an override\n// to restore the default dropdown menu alignment.\n//\n// This is only for left-aligning a dropdown menu within a `.navbar-right` or\n// `.pull-right` nav component.\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n\n// Dropdown section headers\n.dropdown-header {\n display: block;\n padding: 3px 20px;\n font-size: @font-size-small;\n line-height: @line-height-base;\n color: @dropdown-header-color;\n white-space: nowrap; // as with > li > a\n}\n\n// Backdrop to catch body clicks on mobile, etc.\n.dropdown-backdrop {\n position: fixed;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: (@zindex-dropdown - 10);\n}\n\n// Right aligned dropdowns\n.pull-right > .dropdown-menu {\n right: 0;\n left: auto;\n}\n\n// Allow for dropdowns to go bottom up (aka, dropup-menu)\n//\n// Just add .dropup after the standard .dropdown class and you're set, bro.\n// TODO: abstract this so that the navbar fixed styles are not placed here?\n\n.dropup,\n.navbar-fixed-bottom .dropdown {\n // Reverse the caret\n .caret {\n border-top: 0;\n border-bottom: @caret-width-base dashed;\n border-bottom: @caret-width-base solid ~\"\\9\"; // IE8\n content: \"\";\n }\n // Different positioning for bottom up menu\n .dropdown-menu {\n top: auto;\n bottom: 100%;\n margin-bottom: 2px;\n }\n}\n\n\n// Component alignment\n//\n// Reiterate per navbar.less and the modified component alignment there.\n\n@media (min-width: @grid-float-breakpoint) {\n .navbar-right {\n .dropdown-menu {\n .dropdown-menu-right();\n }\n // Necessary for overrides of the default right aligned menu.\n // Will remove come v4 in all likelihood.\n .dropdown-menu-left {\n .dropdown-menu-left();\n }\n }\n}\n","// Horizontal dividers\n//\n// Dividers (basically an hr) within dropdowns and nav lists\n\n.nav-divider(@color: #e5e5e5) {\n height: 1px;\n margin: ((@line-height-computed / 2) - 1) 0;\n overflow: hidden;\n background-color: @color;\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the IE filter for IE9 and below.\n\n.reset-filter() {\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n","//\n// Button groups\n// --------------------------------------------------\n\n// Make the div behave like a button\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-block;\n vertical-align: middle; // match .btn alignment given font-size hack above\n > .btn {\n position: relative;\n float: left;\n // Bring the \"active\" button to the front\n &:hover,\n &:focus,\n &:active,\n &.active {\n z-index: 2;\n }\n }\n}\n\n// Prevent double borders when buttons are next to each other\n.btn-group {\n .btn + .btn,\n .btn + .btn-group,\n .btn-group + .btn,\n .btn-group + .btn-group {\n margin-left: -1px;\n }\n}\n\n// Optional: Group multiple button groups together for a toolbar\n.btn-toolbar {\n margin-left: -5px; // Offset the first child's margin\n &:extend(.clearfix all);\n\n .btn,\n .btn-group,\n .input-group {\n float: left;\n }\n > .btn,\n > .btn-group,\n > .input-group {\n margin-left: 5px;\n }\n}\n\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n\n// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match\n.btn-group > .btn:first-child {\n margin-left: 0;\n &:not(:last-child):not(.dropdown-toggle) {\n .border-right-radius(0);\n }\n}\n// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n .border-left-radius(0);\n}\n\n// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)\n.btn-group > .btn-group {\n float: left;\n}\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group > .btn-group:first-child:not(:last-child) {\n > .btn:last-child,\n > .dropdown-toggle {\n .border-right-radius(0);\n }\n}\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n .border-left-radius(0);\n}\n\n// On active and open, don't show outline\n.btn-group .dropdown-toggle:active,\n.btn-group.open .dropdown-toggle {\n outline: 0;\n}\n\n\n// Sizing\n//\n// Remix the default button sizing classes into new ones for easier manipulation.\n\n.btn-group-xs > .btn { &:extend(.btn-xs); }\n.btn-group-sm > .btn { &:extend(.btn-sm); }\n.btn-group-lg > .btn { &:extend(.btn-lg); }\n\n\n// Split button dropdowns\n// ----------------------\n\n// Give the line between buttons some depth\n.btn-group > .btn + .dropdown-toggle {\n padding-left: 8px;\n padding-right: 8px;\n}\n.btn-group > .btn-lg + .dropdown-toggle {\n padding-left: 12px;\n padding-right: 12px;\n}\n\n// The clickable button for toggling the menu\n// Remove the gradient and set the same inset shadow as the :active state\n.btn-group.open .dropdown-toggle {\n .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n\n // Show no shadow for `.btn-link` since it has no other button styles.\n &.btn-link {\n .box-shadow(none);\n }\n}\n\n\n// Reposition the caret\n.btn .caret {\n margin-left: 0;\n}\n// Carets in other button sizes\n.btn-lg .caret {\n border-width: @caret-width-large @caret-width-large 0;\n border-bottom-width: 0;\n}\n// Upside down carets for .dropup\n.dropup .btn-lg .caret {\n border-width: 0 @caret-width-large @caret-width-large;\n}\n\n\n// Vertical button groups\n// ----------------------\n\n.btn-group-vertical {\n > .btn,\n > .btn-group,\n > .btn-group > .btn {\n display: block;\n float: none;\n width: 100%;\n max-width: 100%;\n }\n\n // Clear floats so dropdown menus can be properly placed\n > .btn-group {\n &:extend(.clearfix all);\n > .btn {\n float: none;\n }\n }\n\n > .btn + .btn,\n > .btn + .btn-group,\n > .btn-group + .btn,\n > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n }\n}\n\n.btn-group-vertical > .btn {\n &:not(:first-child):not(:last-child) {\n border-radius: 0;\n }\n &:first-child:not(:last-child) {\n .border-top-radius(@btn-border-radius-base);\n .border-bottom-radius(0);\n }\n &:last-child:not(:first-child) {\n .border-top-radius(0);\n .border-bottom-radius(@btn-border-radius-base);\n }\n}\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n.btn-group-vertical > .btn-group:first-child:not(:last-child) {\n > .btn:last-child,\n > .dropdown-toggle {\n .border-bottom-radius(0);\n }\n}\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n .border-top-radius(0);\n}\n\n\n// Justified button groups\n// ----------------------\n\n.btn-group-justified {\n display: table;\n width: 100%;\n table-layout: fixed;\n border-collapse: separate;\n > .btn,\n > .btn-group {\n float: none;\n display: table-cell;\n width: 1%;\n }\n > .btn-group .btn {\n width: 100%;\n }\n\n > .btn-group .dropdown-menu {\n left: auto;\n }\n}\n\n\n// Checkbox and radio options\n//\n// In order to support the browser's form validation feedback, powered by the\n// `required` attribute, we have to \"hide\" the inputs via `clip`. We cannot use\n// `display: none;` or `visibility: hidden;` as that also hides the popover.\n// Simply visually hiding the inputs via `opacity` would leave them clickable in\n// certain cases which is prevented by using `clip` and `pointer-events`.\n// This way, we ensure a DOM element is visible to position the popover from.\n//\n// See https://github.com/twbs/bootstrap/pull/12794 and\n// https://github.com/twbs/bootstrap/pull/14559 for more information.\n\n[data-toggle=\"buttons\"] {\n > .btn,\n > .btn-group > .btn {\n input[type=\"radio\"],\n input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0,0,0,0);\n pointer-events: none;\n }\n }\n}\n","// Single side border-radius\n\n.border-top-radius(@radius) {\n border-top-right-radius: @radius;\n border-top-left-radius: @radius;\n}\n.border-right-radius(@radius) {\n border-bottom-right-radius: @radius;\n border-top-right-radius: @radius;\n}\n.border-bottom-radius(@radius) {\n border-bottom-right-radius: @radius;\n border-bottom-left-radius: @radius;\n}\n.border-left-radius(@radius) {\n border-bottom-left-radius: @radius;\n border-top-left-radius: @radius;\n}\n","//\n// Input groups\n// --------------------------------------------------\n\n// Base styles\n// -------------------------\n.input-group {\n position: relative; // For dropdowns\n display: table;\n border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table\n\n // Undo padding and float of grid classes\n &[class*=\"col-\"] {\n float: none;\n padding-left: 0;\n padding-right: 0;\n }\n\n .form-control {\n // Ensure that the input is always above the *appended* addon button for\n // proper border colors.\n position: relative;\n z-index: 2;\n\n // IE9 fubars the placeholder attribute in text inputs and the arrows on\n // select elements in input groups. To fix it, we float the input. Details:\n // https://github.com/twbs/bootstrap/issues/11561#issuecomment-28936855\n float: left;\n\n width: 100%;\n margin-bottom: 0;\n \n &:focus {\n z-index: 3;\n }\n }\n}\n\n// Sizing options\n//\n// Remix the default form control sizing classes into new ones for easier\n// manipulation.\n\n.input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n .input-lg();\n}\n.input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n .input-sm();\n}\n\n\n// Display as table-cell\n// -------------------------\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: table-cell;\n\n &:not(:first-child):not(:last-child) {\n border-radius: 0;\n }\n}\n// Addon and addon wrapper for buttons\n.input-group-addon,\n.input-group-btn {\n width: 1%;\n white-space: nowrap;\n vertical-align: middle; // Match the inputs\n}\n\n// Text input groups\n// -------------------------\n.input-group-addon {\n padding: @padding-base-vertical @padding-base-horizontal;\n font-size: @font-size-base;\n font-weight: normal;\n line-height: 1;\n color: @input-color;\n text-align: center;\n background-color: @input-group-addon-bg;\n border: 1px solid @input-group-addon-border-color;\n border-radius: @input-border-radius;\n\n // Sizing\n &.input-sm {\n padding: @padding-small-vertical @padding-small-horizontal;\n font-size: @font-size-small;\n border-radius: @input-border-radius-small;\n }\n &.input-lg {\n padding: @padding-large-vertical @padding-large-horizontal;\n font-size: @font-size-large;\n border-radius: @input-border-radius-large;\n }\n\n // Nuke default margins from checkboxes and radios to vertically center within.\n input[type=\"radio\"],\n input[type=\"checkbox\"] {\n margin-top: 0;\n }\n}\n\n// Reset rounded corners\n.input-group .form-control:first-child,\n.input-group-addon:first-child,\n.input-group-btn:first-child > .btn,\n.input-group-btn:first-child > .btn-group > .btn,\n.input-group-btn:first-child > .dropdown-toggle,\n.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {\n .border-right-radius(0);\n}\n.input-group-addon:first-child {\n border-right: 0;\n}\n.input-group .form-control:last-child,\n.input-group-addon:last-child,\n.input-group-btn:last-child > .btn,\n.input-group-btn:last-child > .btn-group > .btn,\n.input-group-btn:last-child > .dropdown-toggle,\n.input-group-btn:first-child > .btn:not(:first-child),\n.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {\n .border-left-radius(0);\n}\n.input-group-addon:last-child {\n border-left: 0;\n}\n\n// Button input groups\n// -------------------------\n.input-group-btn {\n position: relative;\n // Jankily prevent input button groups from wrapping with `white-space` and\n // `font-size` in combination with `inline-block` on buttons.\n font-size: 0;\n white-space: nowrap;\n\n // Negative margin for spacing, position for bringing hovered/focused/actived\n // element above the siblings.\n > .btn {\n position: relative;\n + .btn {\n margin-left: -1px;\n }\n // Bring the \"active\" button to the front\n &:hover,\n &:focus,\n &:active {\n z-index: 2;\n }\n }\n\n // Negative margin to only have a 1px border between the two\n &:first-child {\n > .btn,\n > .btn-group {\n margin-right: -1px;\n }\n }\n &:last-child {\n > .btn,\n > .btn-group {\n z-index: 2;\n margin-left: -1px;\n }\n }\n}\n","//\n// Navs\n// --------------------------------------------------\n\n\n// Base class\n// --------------------------------------------------\n\n.nav {\n margin-bottom: 0;\n padding-left: 0; // Override default ul/ol\n list-style: none;\n &:extend(.clearfix all);\n\n > li {\n position: relative;\n display: block;\n\n > a {\n position: relative;\n display: block;\n padding: @nav-link-padding;\n &:hover,\n &:focus {\n text-decoration: none;\n background-color: @nav-link-hover-bg;\n }\n }\n\n // Disabled state sets text to gray and nukes hover/tab effects\n &.disabled > a {\n color: @nav-disabled-link-color;\n\n &:hover,\n &:focus {\n color: @nav-disabled-link-hover-color;\n text-decoration: none;\n background-color: transparent;\n cursor: @cursor-disabled;\n }\n }\n }\n\n // Open dropdowns\n .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @nav-link-hover-bg;\n border-color: @link-color;\n }\n }\n\n // Nav dividers (deprecated with v3.0.1)\n //\n // This should have been removed in v3 with the dropping of `.nav-list`, but\n // we missed it. We don't currently support this anywhere, but in the interest\n // of maintaining backward compatibility in case you use it, it's deprecated.\n .nav-divider {\n .nav-divider();\n }\n\n // Prevent IE8 from misplacing imgs\n //\n // See https://github.com/h5bp/html5-boilerplate/issues/984#issuecomment-3985989\n > li > a > img {\n max-width: none;\n }\n}\n\n\n// Tabs\n// -------------------------\n\n// Give the tabs something to sit on\n.nav-tabs {\n border-bottom: 1px solid @nav-tabs-border-color;\n > li {\n float: left;\n // Make the list-items overlay the bottom border\n margin-bottom: -1px;\n\n // Actual tabs (as links)\n > a {\n margin-right: 2px;\n line-height: @line-height-base;\n border: 1px solid transparent;\n border-radius: @border-radius-base @border-radius-base 0 0;\n &:hover {\n border-color: @nav-tabs-link-hover-border-color @nav-tabs-link-hover-border-color @nav-tabs-border-color;\n }\n }\n\n // Active state, and its :hover to override normal :hover\n &.active > a {\n &,\n &:hover,\n &:focus {\n color: @nav-tabs-active-link-hover-color;\n background-color: @nav-tabs-active-link-hover-bg;\n border: 1px solid @nav-tabs-active-link-hover-border-color;\n border-bottom-color: transparent;\n cursor: default;\n }\n }\n }\n // pulling this in mainly for less shorthand\n &.nav-justified {\n .nav-justified();\n .nav-tabs-justified();\n }\n}\n\n\n// Pills\n// -------------------------\n.nav-pills {\n > li {\n float: left;\n\n // Links rendered as pills\n > a {\n border-radius: @nav-pills-border-radius;\n }\n + li {\n margin-left: 2px;\n }\n\n // Active state\n &.active > a {\n &,\n &:hover,\n &:focus {\n color: @nav-pills-active-link-hover-color;\n background-color: @nav-pills-active-link-hover-bg;\n }\n }\n }\n}\n\n\n// Stacked pills\n.nav-stacked {\n > li {\n float: none;\n + li {\n margin-top: 2px;\n margin-left: 0; // no need for this gap between nav items\n }\n }\n}\n\n\n// Nav variations\n// --------------------------------------------------\n\n// Justified nav links\n// -------------------------\n\n.nav-justified {\n width: 100%;\n\n > li {\n float: none;\n > a {\n text-align: center;\n margin-bottom: 5px;\n }\n }\n\n > .dropdown .dropdown-menu {\n top: auto;\n left: auto;\n }\n\n @media (min-width: @screen-sm-min) {\n > li {\n display: table-cell;\n width: 1%;\n > a {\n margin-bottom: 0;\n }\n }\n }\n}\n\n// Move borders to anchors instead of bottom of list\n//\n// Mixin for adding on top the shared `.nav-justified` styles for our tabs\n.nav-tabs-justified {\n border-bottom: 0;\n\n > li > a {\n // Override margin from .nav-tabs\n margin-right: 0;\n border-radius: @border-radius-base;\n }\n\n > .active > a,\n > .active > a:hover,\n > .active > a:focus {\n border: 1px solid @nav-tabs-justified-link-border-color;\n }\n\n @media (min-width: @screen-sm-min) {\n > li > a {\n border-bottom: 1px solid @nav-tabs-justified-link-border-color;\n border-radius: @border-radius-base @border-radius-base 0 0;\n }\n > .active > a,\n > .active > a:hover,\n > .active > a:focus {\n border-bottom-color: @nav-tabs-justified-active-link-border-color;\n }\n }\n}\n\n\n// Tabbable tabs\n// -------------------------\n\n// Hide tabbable panes to start, show them when `.active`\n.tab-content {\n > .tab-pane {\n display: none;\n }\n > .active {\n display: block;\n }\n}\n\n\n// Dropdowns\n// -------------------------\n\n// Specific dropdowns\n.nav-tabs .dropdown-menu {\n // make dropdown border overlap tab border\n margin-top: -1px;\n // Remove the top rounded corners here since there is a hard edge above the menu\n .border-top-radius(0);\n}\n","//\n// Navbars\n// --------------------------------------------------\n\n\n// Wrapper and base class\n//\n// Provide a static navbar from which we expand to create full-width, fixed, and\n// other navbar variations.\n\n.navbar {\n position: relative;\n min-height: @navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)\n margin-bottom: @navbar-margin-bottom;\n border: 1px solid transparent;\n\n // Prevent floats from breaking the navbar\n &:extend(.clearfix all);\n\n @media (min-width: @grid-float-breakpoint) {\n border-radius: @navbar-border-radius;\n }\n}\n\n\n// Navbar heading\n//\n// Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy\n// styling of responsive aspects.\n\n.navbar-header {\n &:extend(.clearfix all);\n\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n }\n}\n\n\n// Navbar collapse (body)\n//\n// Group your navbar content into this for easy collapsing and expanding across\n// various device sizes. By default, this content is collapsed when <768px, but\n// will expand past that for a horizontal display.\n//\n// To start (on mobile devices) the navbar links, forms, and buttons are stacked\n// vertically and include a `max-height` to overflow in case you have too much\n// content for the user's viewport.\n\n.navbar-collapse {\n overflow-x: visible;\n padding-right: @navbar-padding-horizontal;\n padding-left: @navbar-padding-horizontal;\n border-top: 1px solid transparent;\n box-shadow: inset 0 1px 0 rgba(255,255,255,.1);\n &:extend(.clearfix all);\n -webkit-overflow-scrolling: touch;\n\n &.in {\n overflow-y: auto;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n width: auto;\n border-top: 0;\n box-shadow: none;\n\n &.collapse {\n display: block !important;\n height: auto !important;\n padding-bottom: 0; // Override default setting\n overflow: visible !important;\n }\n\n &.in {\n overflow-y: visible;\n }\n\n // Undo the collapse side padding for navbars with containers to ensure\n // alignment of right-aligned contents.\n .navbar-fixed-top &,\n .navbar-static-top &,\n .navbar-fixed-bottom & {\n padding-left: 0;\n padding-right: 0;\n }\n }\n}\n\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n .navbar-collapse {\n max-height: @navbar-collapse-max-height;\n\n @media (max-device-width: @screen-xs-min) and (orientation: landscape) {\n max-height: 200px;\n }\n }\n}\n\n\n// Both navbar header and collapse\n//\n// When a container is present, change the behavior of the header and collapse.\n\n.container,\n.container-fluid {\n > .navbar-header,\n > .navbar-collapse {\n margin-right: -@navbar-padding-horizontal;\n margin-left: -@navbar-padding-horizontal;\n\n @media (min-width: @grid-float-breakpoint) {\n margin-right: 0;\n margin-left: 0;\n }\n }\n}\n\n\n//\n// Navbar alignment options\n//\n// Display the navbar across the entirety of the page or fixed it to the top or\n// bottom of the page.\n\n// Static top (unfixed, but 100% wide) navbar\n.navbar-static-top {\n z-index: @zindex-navbar;\n border-width: 0 0 1px;\n\n @media (min-width: @grid-float-breakpoint) {\n border-radius: 0;\n }\n}\n\n// Fix the top/bottom navbars when screen real estate supports it\n.navbar-fixed-top,\n.navbar-fixed-bottom {\n position: fixed;\n right: 0;\n left: 0;\n z-index: @zindex-navbar-fixed;\n\n // Undo the rounded corners\n @media (min-width: @grid-float-breakpoint) {\n border-radius: 0;\n }\n}\n.navbar-fixed-top {\n top: 0;\n border-width: 0 0 1px;\n}\n.navbar-fixed-bottom {\n bottom: 0;\n margin-bottom: 0; // override .navbar defaults\n border-width: 1px 0 0;\n}\n\n\n// Brand/project name\n\n.navbar-brand {\n float: left;\n padding: @navbar-padding-vertical @navbar-padding-horizontal;\n font-size: @font-size-large;\n line-height: @line-height-computed;\n height: @navbar-height;\n\n &:hover,\n &:focus {\n text-decoration: none;\n }\n\n > img {\n display: block;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n .navbar > .container &,\n .navbar > .container-fluid & {\n margin-left: -@navbar-padding-horizontal;\n }\n }\n}\n\n\n// Navbar toggle\n//\n// Custom button for toggling the `.navbar-collapse`, powered by the collapse\n// JavaScript plugin.\n\n.navbar-toggle {\n position: relative;\n float: right;\n margin-right: @navbar-padding-horizontal;\n padding: 9px 10px;\n .navbar-vertical-align(34px);\n background-color: transparent;\n background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214\n border: 1px solid transparent;\n border-radius: @border-radius-base;\n\n // We remove the `outline` here, but later compensate by attaching `:hover`\n // styles to `:focus`.\n &:focus {\n outline: 0;\n }\n\n // Bars\n .icon-bar {\n display: block;\n width: 22px;\n height: 2px;\n border-radius: 1px;\n }\n .icon-bar + .icon-bar {\n margin-top: 4px;\n }\n\n @media (min-width: @grid-float-breakpoint) {\n display: none;\n }\n}\n\n\n// Navbar nav links\n//\n// Builds on top of the `.nav` components with its own modifier class to make\n// the nav the full height of the horizontal nav (above 768px).\n\n.navbar-nav {\n margin: (@navbar-padding-vertical / 2) -@navbar-padding-horizontal;\n\n > li > a {\n padding-top: 10px;\n padding-bottom: 10px;\n line-height: @line-height-computed;\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display when collapsed\n .open .dropdown-menu {\n position: static;\n float: none;\n width: auto;\n margin-top: 0;\n background-color: transparent;\n border: 0;\n box-shadow: none;\n > li > a,\n .dropdown-header {\n padding: 5px 15px 5px 25px;\n }\n > li > a {\n line-height: @line-height-computed;\n &:hover,\n &:focus {\n background-image: none;\n }\n }\n }\n }\n\n // Uncollapse the nav\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n margin: 0;\n\n > li {\n float: left;\n > a {\n padding-top: @navbar-padding-vertical;\n padding-bottom: @navbar-padding-vertical;\n }\n }\n }\n}\n\n\n// Navbar form\n//\n// Extension of the `.form-inline` with some extra flavor for optimum display in\n// our navbars.\n\n.navbar-form {\n margin-left: -@navbar-padding-horizontal;\n margin-right: -@navbar-padding-horizontal;\n padding: 10px @navbar-padding-horizontal;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);\n .box-shadow(@shadow);\n\n // Mixin behavior for optimum display\n .form-inline();\n\n .form-group {\n @media (max-width: @grid-float-breakpoint-max) {\n margin-bottom: 5px;\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n }\n\n // Vertically center in expanded, horizontal navbar\n .navbar-vertical-align(@input-height-base);\n\n // Undo 100% width for pull classes\n @media (min-width: @grid-float-breakpoint) {\n width: auto;\n border: 0;\n margin-left: 0;\n margin-right: 0;\n padding-top: 0;\n padding-bottom: 0;\n .box-shadow(none);\n }\n}\n\n\n// Dropdown menus\n\n// Menu position and menu carets\n.navbar-nav > li > .dropdown-menu {\n margin-top: 0;\n .border-top-radius(0);\n}\n// Menu position and menu caret support for dropups via extra dropup class\n.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {\n margin-bottom: 0;\n .border-top-radius(@navbar-border-radius);\n .border-bottom-radius(0);\n}\n\n\n// Buttons in navbars\n//\n// Vertically center a button within a navbar (when *not* in a form).\n\n.navbar-btn {\n .navbar-vertical-align(@input-height-base);\n\n &.btn-sm {\n .navbar-vertical-align(@input-height-small);\n }\n &.btn-xs {\n .navbar-vertical-align(22);\n }\n}\n\n\n// Text in navbars\n//\n// Add a class to make any element properly align itself vertically within the navbars.\n\n.navbar-text {\n .navbar-vertical-align(@line-height-computed);\n\n @media (min-width: @grid-float-breakpoint) {\n float: left;\n margin-left: @navbar-padding-horizontal;\n margin-right: @navbar-padding-horizontal;\n }\n}\n\n\n// Component alignment\n//\n// Repurpose the pull utilities as their own navbar utilities to avoid specificity\n// issues with parents and chaining. Only do this when the navbar is uncollapsed\n// though so that navbar contents properly stack and align in mobile.\n//\n// Declared after the navbar components to ensure more specificity on the margins.\n\n@media (min-width: @grid-float-breakpoint) {\n .navbar-left { .pull-left(); }\n .navbar-right {\n .pull-right();\n margin-right: -@navbar-padding-horizontal;\n\n ~ .navbar-right {\n margin-right: 0;\n }\n }\n}\n\n\n// Alternate navbars\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n background-color: @navbar-default-bg;\n border-color: @navbar-default-border;\n\n .navbar-brand {\n color: @navbar-default-brand-color;\n &:hover,\n &:focus {\n color: @navbar-default-brand-hover-color;\n background-color: @navbar-default-brand-hover-bg;\n }\n }\n\n .navbar-text {\n color: @navbar-default-color;\n }\n\n .navbar-nav {\n > li > a {\n color: @navbar-default-link-color;\n\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n background-color: @navbar-default-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-active-color;\n background-color: @navbar-default-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n background-color: @navbar-default-link-disabled-bg;\n }\n }\n }\n\n .navbar-toggle {\n border-color: @navbar-default-toggle-border-color;\n &:hover,\n &:focus {\n background-color: @navbar-default-toggle-hover-bg;\n }\n .icon-bar {\n background-color: @navbar-default-toggle-icon-bar-bg;\n }\n }\n\n .navbar-collapse,\n .navbar-form {\n border-color: @navbar-default-border;\n }\n\n // Dropdown menu items\n .navbar-nav {\n // Remove background color from open dropdown\n > .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @navbar-default-link-active-bg;\n color: @navbar-default-link-active-color;\n }\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display when collapsed\n .open .dropdown-menu {\n > li > a {\n color: @navbar-default-link-color;\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n background-color: @navbar-default-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-active-color;\n background-color: @navbar-default-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n background-color: @navbar-default-link-disabled-bg;\n }\n }\n }\n }\n }\n\n\n // Links in navbars\n //\n // Add a class to ensure links outside the navbar nav are colored correctly.\n\n .navbar-link {\n color: @navbar-default-link-color;\n &:hover {\n color: @navbar-default-link-hover-color;\n }\n }\n\n .btn-link {\n color: @navbar-default-link-color;\n &:hover,\n &:focus {\n color: @navbar-default-link-hover-color;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @navbar-default-link-disabled-color;\n }\n }\n }\n}\n\n// Inverse navbar\n\n.navbar-inverse {\n background-color: @navbar-inverse-bg;\n border-color: @navbar-inverse-border;\n\n .navbar-brand {\n color: @navbar-inverse-brand-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-brand-hover-color;\n background-color: @navbar-inverse-brand-hover-bg;\n }\n }\n\n .navbar-text {\n color: @navbar-inverse-color;\n }\n\n .navbar-nav {\n > li > a {\n color: @navbar-inverse-link-color;\n\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n background-color: @navbar-inverse-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-active-color;\n background-color: @navbar-inverse-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n background-color: @navbar-inverse-link-disabled-bg;\n }\n }\n }\n\n // Darken the responsive nav toggle\n .navbar-toggle {\n border-color: @navbar-inverse-toggle-border-color;\n &:hover,\n &:focus {\n background-color: @navbar-inverse-toggle-hover-bg;\n }\n .icon-bar {\n background-color: @navbar-inverse-toggle-icon-bar-bg;\n }\n }\n\n .navbar-collapse,\n .navbar-form {\n border-color: darken(@navbar-inverse-bg, 7%);\n }\n\n // Dropdowns\n .navbar-nav {\n > .open > a {\n &,\n &:hover,\n &:focus {\n background-color: @navbar-inverse-link-active-bg;\n color: @navbar-inverse-link-active-color;\n }\n }\n\n @media (max-width: @grid-float-breakpoint-max) {\n // Dropdowns get custom display\n .open .dropdown-menu {\n > .dropdown-header {\n border-color: @navbar-inverse-border;\n }\n .divider {\n background-color: @navbar-inverse-border;\n }\n > li > a {\n color: @navbar-inverse-link-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n background-color: @navbar-inverse-link-hover-bg;\n }\n }\n > .active > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-active-color;\n background-color: @navbar-inverse-link-active-bg;\n }\n }\n > .disabled > a {\n &,\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n background-color: @navbar-inverse-link-disabled-bg;\n }\n }\n }\n }\n }\n\n .navbar-link {\n color: @navbar-inverse-link-color;\n &:hover {\n color: @navbar-inverse-link-hover-color;\n }\n }\n\n .btn-link {\n color: @navbar-inverse-link-color;\n &:hover,\n &:focus {\n color: @navbar-inverse-link-hover-color;\n }\n &[disabled],\n fieldset[disabled] & {\n &:hover,\n &:focus {\n color: @navbar-inverse-link-disabled-color;\n }\n }\n }\n}\n","// Navbar vertical align\n//\n// Vertically center elements in the navbar.\n// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.\n\n.navbar-vertical-align(@element-height) {\n margin-top: ((@navbar-height - @element-height) / 2);\n margin-bottom: ((@navbar-height - @element-height) / 2);\n}\n","//\n// Utility classes\n// --------------------------------------------------\n\n\n// Floats\n// -------------------------\n\n.clearfix {\n .clearfix();\n}\n.center-block {\n .center-block();\n}\n.pull-right {\n float: right !important;\n}\n.pull-left {\n float: left !important;\n}\n\n\n// Toggling content\n// -------------------------\n\n// Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1\n.hide {\n display: none !important;\n}\n.show {\n display: block !important;\n}\n.invisible {\n visibility: hidden;\n}\n.text-hide {\n .text-hide();\n}\n\n\n// Hide from screenreaders and browsers\n//\n// Credit: HTML5 Boilerplate\n\n.hidden {\n display: none !important;\n}\n\n\n// For Affix plugin\n// -------------------------\n\n.affix {\n position: fixed;\n}\n","//\n// Breadcrumbs\n// --------------------------------------------------\n\n\n.breadcrumb {\n padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal;\n margin-bottom: @line-height-computed;\n list-style: none;\n background-color: @breadcrumb-bg;\n border-radius: @border-radius-base;\n\n > li {\n display: inline-block;\n\n + li:before {\n content: \"@{breadcrumb-separator}\\00a0\"; // Unicode space added since inline-block means non-collapsing white-space\n padding: 0 5px;\n color: @breadcrumb-color;\n }\n }\n\n > .active {\n color: @breadcrumb-active-color;\n }\n}\n","//\n// Pagination (multiple pages)\n// --------------------------------------------------\n.pagination {\n display: inline-block;\n padding-left: 0;\n margin: @line-height-computed 0;\n border-radius: @border-radius-base;\n\n > li {\n display: inline; // Remove list-style and block-level defaults\n > a,\n > span {\n position: relative;\n float: left; // Collapse white-space\n padding: @padding-base-vertical @padding-base-horizontal;\n line-height: @line-height-base;\n text-decoration: none;\n color: @pagination-color;\n background-color: @pagination-bg;\n border: 1px solid @pagination-border;\n margin-left: -1px;\n }\n &:first-child {\n > a,\n > span {\n margin-left: 0;\n .border-left-radius(@border-radius-base);\n }\n }\n &:last-child {\n > a,\n > span {\n .border-right-radius(@border-radius-base);\n }\n }\n }\n\n > li > a,\n > li > span {\n &:hover,\n &:focus {\n z-index: 2;\n color: @pagination-hover-color;\n background-color: @pagination-hover-bg;\n border-color: @pagination-hover-border;\n }\n }\n\n > .active > a,\n > .active > span {\n &,\n &:hover,\n &:focus {\n z-index: 3;\n color: @pagination-active-color;\n background-color: @pagination-active-bg;\n border-color: @pagination-active-border;\n cursor: default;\n }\n }\n\n > .disabled {\n > span,\n > span:hover,\n > span:focus,\n > a,\n > a:hover,\n > a:focus {\n color: @pagination-disabled-color;\n background-color: @pagination-disabled-bg;\n border-color: @pagination-disabled-border;\n cursor: @cursor-disabled;\n }\n }\n}\n\n// Sizing\n// --------------------------------------------------\n\n// Large\n.pagination-lg {\n .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);\n}\n\n// Small\n.pagination-sm {\n .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);\n}\n","// Pagination\n\n.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {\n > li {\n > a,\n > span {\n padding: @padding-vertical @padding-horizontal;\n font-size: @font-size;\n line-height: @line-height;\n }\n &:first-child {\n > a,\n > span {\n .border-left-radius(@border-radius);\n }\n }\n &:last-child {\n > a,\n > span {\n .border-right-radius(@border-radius);\n }\n }\n }\n}\n","//\n// Pager pagination\n// --------------------------------------------------\n\n\n.pager {\n padding-left: 0;\n margin: @line-height-computed 0;\n list-style: none;\n text-align: center;\n &:extend(.clearfix all);\n li {\n display: inline;\n > a,\n > span {\n display: inline-block;\n padding: 5px 14px;\n background-color: @pager-bg;\n border: 1px solid @pager-border;\n border-radius: @pager-border-radius;\n }\n\n > a:hover,\n > a:focus {\n text-decoration: none;\n background-color: @pager-hover-bg;\n }\n }\n\n .next {\n > a,\n > span {\n float: right;\n }\n }\n\n .previous {\n > a,\n > span {\n float: left;\n }\n }\n\n .disabled {\n > a,\n > a:hover,\n > a:focus,\n > span {\n color: @pager-disabled-color;\n background-color: @pager-bg;\n cursor: @cursor-disabled;\n }\n }\n}\n","//\n// Labels\n// --------------------------------------------------\n\n.label {\n display: inline;\n padding: .2em .6em .3em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: @label-color;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25em;\n\n // Add hover effects, but only for links\n a& {\n &:hover,\n &:focus {\n color: @label-link-hover-color;\n text-decoration: none;\n cursor: pointer;\n }\n }\n\n // Empty labels collapse automatically (not available in IE8)\n &:empty {\n display: none;\n }\n\n // Quick fix for labels in buttons\n .btn & {\n position: relative;\n top: -1px;\n }\n}\n\n// Colors\n// Contextual variations (linked labels get darker on :hover)\n\n.label-default {\n .label-variant(@label-default-bg);\n}\n\n.label-primary {\n .label-variant(@label-primary-bg);\n}\n\n.label-success {\n .label-variant(@label-success-bg);\n}\n\n.label-info {\n .label-variant(@label-info-bg);\n}\n\n.label-warning {\n .label-variant(@label-warning-bg);\n}\n\n.label-danger {\n .label-variant(@label-danger-bg);\n}\n","// Labels\n\n.label-variant(@color) {\n background-color: @color;\n\n &[href] {\n &:hover,\n &:focus {\n background-color: darken(@color, 10%);\n }\n }\n}\n","//\n// Badges\n// --------------------------------------------------\n\n\n// Base class\n.badge {\n display: inline-block;\n min-width: 10px;\n padding: 3px 7px;\n font-size: @font-size-small;\n font-weight: @badge-font-weight;\n color: @badge-color;\n line-height: @badge-line-height;\n vertical-align: middle;\n white-space: nowrap;\n text-align: center;\n background-color: @badge-bg;\n border-radius: @badge-border-radius;\n\n // Empty badges collapse automatically (not available in IE8)\n &:empty {\n display: none;\n }\n\n // Quick fix for badges in buttons\n .btn & {\n position: relative;\n top: -1px;\n }\n\n .btn-xs &,\n .btn-group-xs > .btn & {\n top: 0;\n padding: 1px 5px;\n }\n\n // Hover state, but only for links\n a& {\n &:hover,\n &:focus {\n color: @badge-link-hover-color;\n text-decoration: none;\n cursor: pointer;\n }\n }\n\n // Account for badges in navs\n .list-group-item.active > &,\n .nav-pills > .active > a > & {\n color: @badge-active-color;\n background-color: @badge-active-bg;\n }\n\n .list-group-item > & {\n float: right;\n }\n\n .list-group-item > & + & {\n margin-right: 5px;\n }\n\n .nav-pills > li > a > & {\n margin-left: 3px;\n }\n}\n","//\n// Jumbotron\n// --------------------------------------------------\n\n\n.jumbotron {\n padding-top: @jumbotron-padding;\n padding-bottom: @jumbotron-padding;\n margin-bottom: @jumbotron-padding;\n color: @jumbotron-color;\n background-color: @jumbotron-bg;\n\n h1,\n .h1 {\n color: @jumbotron-heading-color;\n }\n\n p {\n margin-bottom: (@jumbotron-padding / 2);\n font-size: @jumbotron-font-size;\n font-weight: 200;\n }\n\n > hr {\n border-top-color: darken(@jumbotron-bg, 10%);\n }\n\n .container &,\n .container-fluid & {\n border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container\n padding-left: (@grid-gutter-width / 2);\n padding-right: (@grid-gutter-width / 2);\n }\n\n .container {\n max-width: 100%;\n }\n\n @media screen and (min-width: @screen-sm-min) {\n padding-top: (@jumbotron-padding * 1.6);\n padding-bottom: (@jumbotron-padding * 1.6);\n\n .container &,\n .container-fluid & {\n padding-left: (@jumbotron-padding * 2);\n padding-right: (@jumbotron-padding * 2);\n }\n\n h1,\n .h1 {\n font-size: @jumbotron-heading-font-size;\n }\n }\n}\n","//\n// Thumbnails\n// --------------------------------------------------\n\n\n// Mixin and adjust the regular image class\n.thumbnail {\n display: block;\n padding: @thumbnail-padding;\n margin-bottom: @line-height-computed;\n line-height: @line-height-base;\n background-color: @thumbnail-bg;\n border: 1px solid @thumbnail-border;\n border-radius: @thumbnail-border-radius;\n .transition(border .2s ease-in-out);\n\n > img,\n a > img {\n &:extend(.img-responsive);\n margin-left: auto;\n margin-right: auto;\n }\n\n // Add a hover state for linked versions only\n a&:hover,\n a&:focus,\n a&.active {\n border-color: @link-color;\n }\n\n // Image captions\n .caption {\n padding: @thumbnail-caption-padding;\n color: @thumbnail-caption-color;\n }\n}\n","//\n// Alerts\n// --------------------------------------------------\n\n\n// Base styles\n// -------------------------\n\n.alert {\n padding: @alert-padding;\n margin-bottom: @line-height-computed;\n border: 1px solid transparent;\n border-radius: @alert-border-radius;\n\n // Headings for larger alerts\n h4 {\n margin-top: 0;\n // Specified for the h4 to prevent conflicts of changing @headings-color\n color: inherit;\n }\n\n // Provide class for links that match alerts\n .alert-link {\n font-weight: @alert-link-font-weight;\n }\n\n // Improve alignment and spacing of inner content\n > p,\n > ul {\n margin-bottom: 0;\n }\n\n > p + p {\n margin-top: 5px;\n }\n}\n\n// Dismissible alerts\n//\n// Expand the right padding and account for the close button's positioning.\n\n.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.\n.alert-dismissible {\n padding-right: (@alert-padding + 20);\n\n // Adjust close link position\n .close {\n position: relative;\n top: -2px;\n right: -21px;\n color: inherit;\n }\n}\n\n// Alternate styles\n//\n// Generate contextual modifier classes for colorizing the alert.\n\n.alert-success {\n .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text);\n}\n\n.alert-info {\n .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text);\n}\n\n.alert-warning {\n .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text);\n}\n\n.alert-danger {\n .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text);\n}\n","// Alerts\n\n.alert-variant(@background; @border; @text-color) {\n background-color: @background;\n border-color: @border;\n color: @text-color;\n\n hr {\n border-top-color: darken(@border, 5%);\n }\n .alert-link {\n color: darken(@text-color, 10%);\n }\n}\n","//\n// Progress bars\n// --------------------------------------------------\n\n\n// Bar animations\n// -------------------------\n\n// WebKit\n@-webkit-keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n// Spec and IE10+\n@keyframes progress-bar-stripes {\n from { background-position: 40px 0; }\n to { background-position: 0 0; }\n}\n\n\n// Bar itself\n// -------------------------\n\n// Outer container\n.progress {\n overflow: hidden;\n height: @line-height-computed;\n margin-bottom: @line-height-computed;\n background-color: @progress-bg;\n border-radius: @progress-border-radius;\n .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));\n}\n\n// Bar of progress\n.progress-bar {\n float: left;\n width: 0%;\n height: 100%;\n font-size: @font-size-small;\n line-height: @line-height-computed;\n color: @progress-bar-color;\n text-align: center;\n background-color: @progress-bar-bg;\n .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));\n .transition(width .6s ease);\n}\n\n// Striped bars\n//\n// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar-striped` class, which you just add to an existing\n// `.progress-bar`.\n.progress-striped .progress-bar,\n.progress-bar-striped {\n #gradient > .striped();\n background-size: 40px 40px;\n}\n\n// Call animation for the active one\n//\n// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the\n// `.progress-bar.active` approach.\n.progress.active .progress-bar,\n.progress-bar.active {\n .animation(progress-bar-stripes 2s linear infinite);\n}\n\n\n// Variations\n// -------------------------\n\n.progress-bar-success {\n .progress-bar-variant(@progress-bar-success-bg);\n}\n\n.progress-bar-info {\n .progress-bar-variant(@progress-bar-info-bg);\n}\n\n.progress-bar-warning {\n .progress-bar-variant(@progress-bar-warning-bg);\n}\n\n.progress-bar-danger {\n .progress-bar-variant(@progress-bar-danger-bg);\n}\n","// Gradients\n\n#gradient {\n\n // Horizontal gradient, from left to right\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n // Vertical gradient, from top to bottom\n //\n // Creates two color stops, start and end, by specifying a color and position for each color stop.\n // Color stops are not available in IE9 and below.\n .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12\n background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n background-repeat: repeat-x;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n }\n\n .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n background-repeat: repeat-x;\n background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n }\n .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n background-repeat: no-repeat;\n filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n }\n .radial(@inner-color: #555; @outer-color: #333) {\n background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n background-image: radial-gradient(circle, @inner-color, @outer-color);\n background-repeat: no-repeat;\n }\n .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n }\n}\n","// Progress bars\n\n.progress-bar-variant(@color) {\n background-color: @color;\n\n // Deprecated parent class requirement as of v3.2.0\n .progress-striped & {\n #gradient > .striped();\n }\n}\n",".media {\n // Proper spacing between instances of .media\n margin-top: 15px;\n\n &:first-child {\n margin-top: 0;\n }\n}\n\n.media,\n.media-body {\n zoom: 1;\n overflow: hidden;\n}\n\n.media-body {\n width: 10000px;\n}\n\n.media-object {\n display: block;\n\n // Fix collapse in webkit from max-width: 100% and display: table-cell.\n &.img-thumbnail {\n max-width: none;\n }\n}\n\n.media-right,\n.media > .pull-right {\n padding-left: 10px;\n}\n\n.media-left,\n.media > .pull-left {\n padding-right: 10px;\n}\n\n.media-left,\n.media-right,\n.media-body {\n display: table-cell;\n vertical-align: top;\n}\n\n.media-middle {\n vertical-align: middle;\n}\n\n.media-bottom {\n vertical-align: bottom;\n}\n\n// Reset margins on headings for tighter default spacing\n.media-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n\n// Media list variation\n//\n// Undo default ul/ol styles\n.media-list {\n padding-left: 0;\n list-style: none;\n}\n","//\n// List groups\n// --------------------------------------------------\n\n\n// Base class\n//\n// Easily usable on <ul>, <ol>, or <div>.\n\n.list-group {\n // No need to set list-style: none; since .list-group-item is block level\n margin-bottom: 20px;\n padding-left: 0; // reset padding because ul and ol\n}\n\n\n// Individual list items\n//\n// Use on `li`s or `div`s within the `.list-group` parent.\n\n.list-group-item {\n position: relative;\n display: block;\n padding: 10px 15px;\n // Place the border on the list items and negative margin up for better styling\n margin-bottom: -1px;\n background-color: @list-group-bg;\n border: 1px solid @list-group-border;\n\n // Round the first and last items\n &:first-child {\n .border-top-radius(@list-group-border-radius);\n }\n &:last-child {\n margin-bottom: 0;\n .border-bottom-radius(@list-group-border-radius);\n }\n}\n\n\n// Interactive list items\n//\n// Use anchor or button elements instead of `li`s or `div`s to create interactive items.\n// Includes an extra `.active` modifier class for showing selected items.\n\na.list-group-item,\nbutton.list-group-item {\n color: @list-group-link-color;\n\n .list-group-item-heading {\n color: @list-group-link-heading-color;\n }\n\n // Hover state\n &:hover,\n &:focus {\n text-decoration: none;\n color: @list-group-link-hover-color;\n background-color: @list-group-hover-bg;\n }\n}\n\nbutton.list-group-item {\n width: 100%;\n text-align: left;\n}\n\n.list-group-item {\n // Disabled state\n &.disabled,\n &.disabled:hover,\n &.disabled:focus {\n background-color: @list-group-disabled-bg;\n color: @list-group-disabled-color;\n cursor: @cursor-disabled;\n\n // Force color to inherit for custom content\n .list-group-item-heading {\n color: inherit;\n }\n .list-group-item-text {\n color: @list-group-disabled-text-color;\n }\n }\n\n // Active class on item itself, not parent\n &.active,\n &.active:hover,\n &.active:focus {\n z-index: 2; // Place active items above their siblings for proper border styling\n color: @list-group-active-color;\n background-color: @list-group-active-bg;\n border-color: @list-group-active-border;\n\n // Force color to inherit for custom content\n .list-group-item-heading,\n .list-group-item-heading > small,\n .list-group-item-heading > .small {\n color: inherit;\n }\n .list-group-item-text {\n color: @list-group-active-text-color;\n }\n }\n}\n\n\n// Contextual variants\n//\n// Add modifier classes to change text and background color on individual items.\n// Organizationally, this must come after the `:hover` states.\n\n.list-group-item-variant(success; @state-success-bg; @state-success-text);\n.list-group-item-variant(info; @state-info-bg; @state-info-text);\n.list-group-item-variant(warning; @state-warning-bg; @state-warning-text);\n.list-group-item-variant(danger; @state-danger-bg; @state-danger-text);\n\n\n// Custom content options\n//\n// Extra classes for creating well-formatted content within `.list-group-item`s.\n\n.list-group-item-heading {\n margin-top: 0;\n margin-bottom: 5px;\n}\n.list-group-item-text {\n margin-bottom: 0;\n line-height: 1.3;\n}\n","// List Groups\n\n.list-group-item-variant(@state; @background; @color) {\n .list-group-item-@{state} {\n color: @color;\n background-color: @background;\n\n a&,\n button& {\n color: @color;\n\n .list-group-item-heading {\n color: inherit;\n }\n\n &:hover,\n &:focus {\n color: @color;\n background-color: darken(@background, 5%);\n }\n &.active,\n &.active:hover,\n &.active:focus {\n color: #fff;\n background-color: @color;\n border-color: @color;\n }\n }\n }\n}\n","//\n// Panels\n// --------------------------------------------------\n\n\n// Base class\n.panel {\n margin-bottom: @line-height-computed;\n background-color: @panel-bg;\n border: 1px solid transparent;\n border-radius: @panel-border-radius;\n .box-shadow(0 1px 1px rgba(0,0,0,.05));\n}\n\n// Panel contents\n.panel-body {\n padding: @panel-body-padding;\n &:extend(.clearfix all);\n}\n\n// Optional heading\n.panel-heading {\n padding: @panel-heading-padding;\n border-bottom: 1px solid transparent;\n .border-top-radius((@panel-border-radius - 1));\n\n > .dropdown .dropdown-toggle {\n color: inherit;\n }\n}\n\n// Within heading, strip any `h*` tag of its default margins for spacing.\n.panel-title {\n margin-top: 0;\n margin-bottom: 0;\n font-size: ceil((@font-size-base * 1.125));\n color: inherit;\n\n > a,\n > small,\n > .small,\n > small > a,\n > .small > a {\n color: inherit;\n }\n}\n\n// Optional footer (stays gray in every modifier class)\n.panel-footer {\n padding: @panel-footer-padding;\n background-color: @panel-footer-bg;\n border-top: 1px solid @panel-inner-border;\n .border-bottom-radius((@panel-border-radius - 1));\n}\n\n\n// List groups in panels\n//\n// By default, space out list group content from panel headings to account for\n// any kind of custom content between the two.\n\n.panel {\n > .list-group,\n > .panel-collapse > .list-group {\n margin-bottom: 0;\n\n .list-group-item {\n border-width: 1px 0;\n border-radius: 0;\n }\n\n // Add border top radius for first one\n &:first-child {\n .list-group-item:first-child {\n border-top: 0;\n .border-top-radius((@panel-border-radius - 1));\n }\n }\n\n // Add border bottom radius for last one\n &:last-child {\n .list-group-item:last-child {\n border-bottom: 0;\n .border-bottom-radius((@panel-border-radius - 1));\n }\n }\n }\n > .panel-heading + .panel-collapse > .list-group {\n .list-group-item:first-child {\n .border-top-radius(0);\n }\n }\n}\n// Collapse space between when there's no additional content.\n.panel-heading + .list-group {\n .list-group-item:first-child {\n border-top-width: 0;\n }\n}\n.list-group + .panel-footer {\n border-top-width: 0;\n}\n\n// Tables in panels\n//\n// Place a non-bordered `.table` within a panel (not within a `.panel-body`) and\n// watch it go full width.\n\n.panel {\n > .table,\n > .table-responsive > .table,\n > .panel-collapse > .table {\n margin-bottom: 0;\n\n caption {\n padding-left: @panel-body-padding;\n padding-right: @panel-body-padding;\n }\n }\n // Add border top radius for first one\n > .table:first-child,\n > .table-responsive:first-child > .table:first-child {\n .border-top-radius((@panel-border-radius - 1));\n\n > thead:first-child,\n > tbody:first-child {\n > tr:first-child {\n border-top-left-radius: (@panel-border-radius - 1);\n border-top-right-radius: (@panel-border-radius - 1);\n\n td:first-child,\n th:first-child {\n border-top-left-radius: (@panel-border-radius - 1);\n }\n td:last-child,\n th:last-child {\n border-top-right-radius: (@panel-border-radius - 1);\n }\n }\n }\n }\n // Add border bottom radius for last one\n > .table:last-child,\n > .table-responsive:last-child > .table:last-child {\n .border-bottom-radius((@panel-border-radius - 1));\n\n > tbody:last-child,\n > tfoot:last-child {\n > tr:last-child {\n border-bottom-left-radius: (@panel-border-radius - 1);\n border-bottom-right-radius: (@panel-border-radius - 1);\n\n td:first-child,\n th:first-child {\n border-bottom-left-radius: (@panel-border-radius - 1);\n }\n td:last-child,\n th:last-child {\n border-bottom-right-radius: (@panel-border-radius - 1);\n }\n }\n }\n }\n > .panel-body + .table,\n > .panel-body + .table-responsive,\n > .table + .panel-body,\n > .table-responsive + .panel-body {\n border-top: 1px solid @table-border-color;\n }\n > .table > tbody:first-child > tr:first-child th,\n > .table > tbody:first-child > tr:first-child td {\n border-top: 0;\n }\n > .table-bordered,\n > .table-responsive > .table-bordered {\n border: 0;\n > thead,\n > tbody,\n > tfoot {\n > tr {\n > th:first-child,\n > td:first-child {\n border-left: 0;\n }\n > th:last-child,\n > td:last-child {\n border-right: 0;\n }\n }\n }\n > thead,\n > tbody {\n > tr:first-child {\n > td,\n > th {\n border-bottom: 0;\n }\n }\n }\n > tbody,\n > tfoot {\n > tr:last-child {\n > td,\n > th {\n border-bottom: 0;\n }\n }\n }\n }\n > .table-responsive {\n border: 0;\n margin-bottom: 0;\n }\n}\n\n\n// Collapsable panels (aka, accordion)\n//\n// Wrap a series of panels in `.panel-group` to turn them into an accordion with\n// the help of our collapse JavaScript plugin.\n\n.panel-group {\n margin-bottom: @line-height-computed;\n\n // Tighten up margin so it's only between panels\n .panel {\n margin-bottom: 0;\n border-radius: @panel-border-radius;\n\n + .panel {\n margin-top: 5px;\n }\n }\n\n .panel-heading {\n border-bottom: 0;\n\n + .panel-collapse > .panel-body,\n + .panel-collapse > .list-group {\n border-top: 1px solid @panel-inner-border;\n }\n }\n\n .panel-footer {\n border-top: 0;\n + .panel-collapse .panel-body {\n border-bottom: 1px solid @panel-inner-border;\n }\n }\n}\n\n\n// Contextual variations\n.panel-default {\n .panel-variant(@panel-default-border; @panel-default-text; @panel-default-heading-bg; @panel-default-border);\n}\n.panel-primary {\n .panel-variant(@panel-primary-border; @panel-primary-text; @panel-primary-heading-bg; @panel-primary-border);\n}\n.panel-success {\n .panel-variant(@panel-success-border; @panel-success-text; @panel-success-heading-bg; @panel-success-border);\n}\n.panel-info {\n .panel-variant(@panel-info-border; @panel-info-text; @panel-info-heading-bg; @panel-info-border);\n}\n.panel-warning {\n .panel-variant(@panel-warning-border; @panel-warning-text; @panel-warning-heading-bg; @panel-warning-border);\n}\n.panel-danger {\n .panel-variant(@panel-danger-border; @panel-danger-text; @panel-danger-heading-bg; @panel-danger-border);\n}\n","// Panels\n\n.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {\n border-color: @border;\n\n & > .panel-heading {\n color: @heading-text-color;\n background-color: @heading-bg-color;\n border-color: @heading-border;\n\n + .panel-collapse > .panel-body {\n border-top-color: @border;\n }\n .badge {\n color: @heading-bg-color;\n background-color: @heading-text-color;\n }\n }\n & > .panel-footer {\n + .panel-collapse > .panel-body {\n border-bottom-color: @border;\n }\n }\n}\n","// Embeds responsive\n//\n// Credit: Nicolas Gallagher and SUIT CSS.\n\n.embed-responsive {\n position: relative;\n display: block;\n height: 0;\n padding: 0;\n overflow: hidden;\n\n .embed-responsive-item,\n iframe,\n embed,\n object,\n video {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n border: 0;\n }\n}\n\n// Modifier class for 16:9 aspect ratio\n.embed-responsive-16by9 {\n padding-bottom: 56.25%;\n}\n\n// Modifier class for 4:3 aspect ratio\n.embed-responsive-4by3 {\n padding-bottom: 75%;\n}\n","//\n// Wells\n// --------------------------------------------------\n\n\n// Base class\n.well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: @well-bg;\n border: 1px solid @well-border;\n border-radius: @border-radius-base;\n .box-shadow(inset 0 1px 1px rgba(0,0,0,.05));\n blockquote {\n border-color: #ddd;\n border-color: rgba(0,0,0,.15);\n }\n}\n\n// Sizes\n.well-lg {\n padding: 24px;\n border-radius: @border-radius-large;\n}\n.well-sm {\n padding: 9px;\n border-radius: @border-radius-small;\n}\n","//\n// Close icons\n// --------------------------------------------------\n\n\n.close {\n float: right;\n font-size: (@font-size-base * 1.5);\n font-weight: @close-font-weight;\n line-height: 1;\n color: @close-color;\n text-shadow: @close-text-shadow;\n .opacity(.2);\n\n &:hover,\n &:focus {\n color: @close-color;\n text-decoration: none;\n cursor: pointer;\n .opacity(.5);\n }\n\n // Additional properties for button version\n // iOS requires the button element instead of an anchor tag.\n // If you want the anchor version, it requires `href=\"#\"`.\n // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile\n button& {\n padding: 0;\n cursor: pointer;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n }\n}\n","//\n// Modals\n// --------------------------------------------------\n\n// .modal-open - body class for killing the scroll\n// .modal - container to scroll within\n// .modal-dialog - positioning shell for the actual modal\n// .modal-content - actual modal w/ bg and corners and shit\n\n// Kill the scroll on the body\n.modal-open {\n overflow: hidden;\n}\n\n// Container that the modal scrolls within\n.modal {\n display: none;\n overflow: hidden;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: @zindex-modal;\n -webkit-overflow-scrolling: touch;\n\n // Prevent Chrome on Windows from adding a focus outline. For details, see\n // https://github.com/twbs/bootstrap/pull/10951.\n outline: 0;\n\n // When fading in the modal, animate it to slide down\n &.fade .modal-dialog {\n .translate(0, -25%);\n .transition-transform(~\"0.3s ease-out\");\n }\n &.in .modal-dialog { .translate(0, 0) }\n}\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n// Shell div to position the modal with bottom padding\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 10px;\n}\n\n// Actual modal\n.modal-content {\n position: relative;\n background-color: @modal-content-bg;\n border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)\n border: 1px solid @modal-content-border-color;\n border-radius: @border-radius-large;\n .box-shadow(0 3px 9px rgba(0,0,0,.5));\n background-clip: padding-box;\n // Remove focus outline from opened modal\n outline: 0;\n}\n\n// Modal background\n.modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: @zindex-modal-background;\n background-color: @modal-backdrop-bg;\n // Fade for backdrop\n &.fade { .opacity(0); }\n &.in { .opacity(@modal-backdrop-opacity); }\n}\n\n// Modal header\n// Top section of the modal w/ title and dismiss\n.modal-header {\n padding: @modal-title-padding;\n border-bottom: 1px solid @modal-header-border-color;\n &:extend(.clearfix all);\n}\n// Close icon\n.modal-header .close {\n margin-top: -2px;\n}\n\n// Title text within header\n.modal-title {\n margin: 0;\n line-height: @modal-title-line-height;\n}\n\n// Modal body\n// Where all modal content resides (sibling of .modal-header and .modal-footer)\n.modal-body {\n position: relative;\n padding: @modal-inner-padding;\n}\n\n// Footer (for actions)\n.modal-footer {\n padding: @modal-inner-padding;\n text-align: right; // right align buttons\n border-top: 1px solid @modal-footer-border-color;\n &:extend(.clearfix all); // clear it in case folks use .pull-* classes on buttons\n\n // Properly space out buttons\n .btn + .btn {\n margin-left: 5px;\n margin-bottom: 0; // account for input[type=\"submit\"] which gets the bottom margin like all other inputs\n }\n // but override that for button groups\n .btn-group .btn + .btn {\n margin-left: -1px;\n }\n // and override it for block buttons as well\n .btn-block + .btn-block {\n margin-left: 0;\n }\n}\n\n// Measure scrollbar width for padding body during modal show/hide\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n\n// Scale up the modal\n@media (min-width: @screen-sm-min) {\n // Automatically set modal's width for larger viewports\n .modal-dialog {\n width: @modal-md;\n margin: 30px auto;\n }\n .modal-content {\n .box-shadow(0 5px 15px rgba(0,0,0,.5));\n }\n\n // Modal sizes\n .modal-sm { width: @modal-sm; }\n}\n\n@media (min-width: @screen-md-min) {\n .modal-lg { width: @modal-lg; }\n}\n","//\n// Tooltips\n// --------------------------------------------------\n\n\n// Base class\n.tooltip {\n position: absolute;\n z-index: @zindex-tooltip;\n display: block;\n // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.\n // So reset our font and text properties to avoid inheriting weird values.\n .reset-text();\n font-size: @font-size-small;\n\n .opacity(0);\n\n &.in { .opacity(@tooltip-opacity); }\n &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; }\n &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; }\n &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; }\n &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; }\n}\n\n// Wrapper for the tooltip content\n.tooltip-inner {\n max-width: @tooltip-max-width;\n padding: 3px 8px;\n color: @tooltip-color;\n text-align: center;\n background-color: @tooltip-bg;\n border-radius: @border-radius-base;\n}\n\n// Arrows\n.tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n}\n// Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1\n.tooltip {\n &.top .tooltip-arrow {\n bottom: 0;\n left: 50%;\n margin-left: -@tooltip-arrow-width;\n border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n border-top-color: @tooltip-arrow-color;\n }\n &.top-left .tooltip-arrow {\n bottom: 0;\n right: @tooltip-arrow-width;\n margin-bottom: -@tooltip-arrow-width;\n border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n border-top-color: @tooltip-arrow-color;\n }\n &.top-right .tooltip-arrow {\n bottom: 0;\n left: @tooltip-arrow-width;\n margin-bottom: -@tooltip-arrow-width;\n border-width: @tooltip-arrow-width @tooltip-arrow-width 0;\n border-top-color: @tooltip-arrow-color;\n }\n &.right .tooltip-arrow {\n top: 50%;\n left: 0;\n margin-top: -@tooltip-arrow-width;\n border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;\n border-right-color: @tooltip-arrow-color;\n }\n &.left .tooltip-arrow {\n top: 50%;\n right: 0;\n margin-top: -@tooltip-arrow-width;\n border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;\n border-left-color: @tooltip-arrow-color;\n }\n &.bottom .tooltip-arrow {\n top: 0;\n left: 50%;\n margin-left: -@tooltip-arrow-width;\n border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n border-bottom-color: @tooltip-arrow-color;\n }\n &.bottom-left .tooltip-arrow {\n top: 0;\n right: @tooltip-arrow-width;\n margin-top: -@tooltip-arrow-width;\n border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n border-bottom-color: @tooltip-arrow-color;\n }\n &.bottom-right .tooltip-arrow {\n top: 0;\n left: @tooltip-arrow-width;\n margin-top: -@tooltip-arrow-width;\n border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;\n border-bottom-color: @tooltip-arrow-color;\n }\n}\n",".reset-text() {\n font-family: @font-family-base;\n // We deliberately do NOT reset font-size.\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n line-break: auto;\n line-height: @line-height-base;\n text-align: left; // Fallback for where `start` is not supported\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n white-space: normal;\n word-break: normal;\n word-spacing: normal;\n word-wrap: normal;\n}\n","//\n// Popovers\n// --------------------------------------------------\n\n\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: @zindex-popover;\n display: none;\n max-width: @popover-max-width;\n padding: 1px;\n // Our parent element can be arbitrary since popovers are by default inserted as a sibling of their target element.\n // So reset our font and text properties to avoid inheriting weird values.\n .reset-text();\n font-size: @font-size-base;\n\n background-color: @popover-bg;\n background-clip: padding-box;\n border: 1px solid @popover-fallback-border-color;\n border: 1px solid @popover-border-color;\n border-radius: @border-radius-large;\n .box-shadow(0 5px 10px rgba(0,0,0,.2));\n\n // Offset the popover to account for the popover arrow\n &.top { margin-top: -@popover-arrow-width; }\n &.right { margin-left: @popover-arrow-width; }\n &.bottom { margin-top: @popover-arrow-width; }\n &.left { margin-left: -@popover-arrow-width; }\n}\n\n.popover-title {\n margin: 0; // reset heading margin\n padding: 8px 14px;\n font-size: @font-size-base;\n background-color: @popover-title-bg;\n border-bottom: 1px solid darken(@popover-title-bg, 5%);\n border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0;\n}\n\n.popover-content {\n padding: 9px 14px;\n}\n\n// Arrows\n//\n// .arrow is outer, .arrow:after is inner\n\n.popover > .arrow {\n &,\n &:after {\n position: absolute;\n display: block;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n}\n.popover > .arrow {\n border-width: @popover-arrow-outer-width;\n}\n.popover > .arrow:after {\n border-width: @popover-arrow-width;\n content: \"\";\n}\n\n.popover {\n &.top > .arrow {\n left: 50%;\n margin-left: -@popover-arrow-outer-width;\n border-bottom-width: 0;\n border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n border-top-color: @popover-arrow-outer-color;\n bottom: -@popover-arrow-outer-width;\n &:after {\n content: \" \";\n bottom: 1px;\n margin-left: -@popover-arrow-width;\n border-bottom-width: 0;\n border-top-color: @popover-arrow-color;\n }\n }\n &.right > .arrow {\n top: 50%;\n left: -@popover-arrow-outer-width;\n margin-top: -@popover-arrow-outer-width;\n border-left-width: 0;\n border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n border-right-color: @popover-arrow-outer-color;\n &:after {\n content: \" \";\n left: 1px;\n bottom: -@popover-arrow-width;\n border-left-width: 0;\n border-right-color: @popover-arrow-color;\n }\n }\n &.bottom > .arrow {\n left: 50%;\n margin-left: -@popover-arrow-outer-width;\n border-top-width: 0;\n border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n border-bottom-color: @popover-arrow-outer-color;\n top: -@popover-arrow-outer-width;\n &:after {\n content: \" \";\n top: 1px;\n margin-left: -@popover-arrow-width;\n border-top-width: 0;\n border-bottom-color: @popover-arrow-color;\n }\n }\n\n &.left > .arrow {\n top: 50%;\n right: -@popover-arrow-outer-width;\n margin-top: -@popover-arrow-outer-width;\n border-right-width: 0;\n border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback\n border-left-color: @popover-arrow-outer-color;\n &:after {\n content: \" \";\n right: 1px;\n border-right-width: 0;\n border-left-color: @popover-arrow-color;\n bottom: -@popover-arrow-width;\n }\n }\n}\n","//\n// Carousel\n// --------------------------------------------------\n\n\n// Wrapper for the slide container and indicators\n.carousel {\n position: relative;\n}\n\n.carousel-inner {\n position: relative;\n overflow: hidden;\n width: 100%;\n\n > .item {\n display: none;\n position: relative;\n .transition(.6s ease-in-out left);\n\n // Account for jankitude on images\n > img,\n > a > img {\n &:extend(.img-responsive);\n line-height: 1;\n }\n\n // WebKit CSS3 transforms for supported devices\n @media all and (transform-3d), (-webkit-transform-3d) {\n .transition-transform(~'0.6s ease-in-out');\n .backface-visibility(~'hidden');\n .perspective(1000px);\n\n &.next,\n &.active.right {\n .translate3d(100%, 0, 0);\n left: 0;\n }\n &.prev,\n &.active.left {\n .translate3d(-100%, 0, 0);\n left: 0;\n }\n &.next.left,\n &.prev.right,\n &.active {\n .translate3d(0, 0, 0);\n left: 0;\n }\n }\n }\n\n > .active,\n > .next,\n > .prev {\n display: block;\n }\n\n > .active {\n left: 0;\n }\n\n > .next,\n > .prev {\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n > .next {\n left: 100%;\n }\n > .prev {\n left: -100%;\n }\n > .next.left,\n > .prev.right {\n left: 0;\n }\n\n > .active.left {\n left: -100%;\n }\n > .active.right {\n left: 100%;\n }\n\n}\n\n// Left/right controls for nav\n// ---------------------------\n\n.carousel-control {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: @carousel-control-width;\n .opacity(@carousel-control-opacity);\n font-size: @carousel-control-font-size;\n color: @carousel-control-color;\n text-align: center;\n text-shadow: @carousel-text-shadow;\n background-color: rgba(0, 0, 0, 0); // Fix IE9 click-thru bug\n // We can't have this transition here because WebKit cancels the carousel\n // animation if you trip this while in the middle of another animation.\n\n // Set gradients for backgrounds\n &.left {\n #gradient > .horizontal(@start-color: rgba(0,0,0,.5); @end-color: rgba(0,0,0,.0001));\n }\n &.right {\n left: auto;\n right: 0;\n #gradient > .horizontal(@start-color: rgba(0,0,0,.0001); @end-color: rgba(0,0,0,.5));\n }\n\n // Hover/focus state\n &:hover,\n &:focus {\n outline: 0;\n color: @carousel-control-color;\n text-decoration: none;\n .opacity(.9);\n }\n\n // Toggles\n .icon-prev,\n .icon-next,\n .glyphicon-chevron-left,\n .glyphicon-chevron-right {\n position: absolute;\n top: 50%;\n margin-top: -10px;\n z-index: 5;\n display: inline-block;\n }\n .icon-prev,\n .glyphicon-chevron-left {\n left: 50%;\n margin-left: -10px;\n }\n .icon-next,\n .glyphicon-chevron-right {\n right: 50%;\n margin-right: -10px;\n }\n .icon-prev,\n .icon-next {\n width: 20px;\n height: 20px;\n line-height: 1;\n font-family: serif;\n }\n\n\n .icon-prev {\n &:before {\n content: '\\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)\n }\n }\n .icon-next {\n &:before {\n content: '\\203a';// SINGLE RIGHT-POINTING ANGLE QUOTATION MARK (U+203A)\n }\n }\n}\n\n// Optional indicator pips\n//\n// Add an unordered list with the following class and add a list item for each\n// slide your carousel holds.\n\n.carousel-indicators {\n position: absolute;\n bottom: 10px;\n left: 50%;\n z-index: 15;\n width: 60%;\n margin-left: -30%;\n padding-left: 0;\n list-style: none;\n text-align: center;\n\n li {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin: 1px;\n text-indent: -999px;\n border: 1px solid @carousel-indicator-border-color;\n border-radius: 10px;\n cursor: pointer;\n\n // IE8-9 hack for event handling\n //\n // Internet Explorer 8-9 does not support clicks on elements without a set\n // `background-color`. We cannot use `filter` since that's not viewed as a\n // background color by the browser. Thus, a hack is needed.\n // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Internet_Explorer\n //\n // For IE8, we set solid black as it doesn't support `rgba()`. For IE9, we\n // set alpha transparency for the best results possible.\n background-color: #000 \\9; // IE8\n background-color: rgba(0,0,0,0); // IE9\n }\n .active {\n margin: 0;\n width: 12px;\n height: 12px;\n background-color: @carousel-indicator-active-bg;\n }\n}\n\n// Optional captions\n// -----------------------------\n// Hidden by default for smaller viewports\n.carousel-caption {\n position: absolute;\n left: 15%;\n right: 15%;\n bottom: 20px;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: @carousel-caption-color;\n text-align: center;\n text-shadow: @carousel-text-shadow;\n & .btn {\n text-shadow: none; // No shadow for button elements in carousel-caption\n }\n}\n\n\n// Scale up controls for tablets and up\n@media screen and (min-width: @screen-sm-min) {\n\n // Scale up the controls a smidge\n .carousel-control {\n .glyphicon-chevron-left,\n .glyphicon-chevron-right,\n .icon-prev,\n .icon-next {\n width: (@carousel-control-font-size * 1.5);\n height: (@carousel-control-font-size * 1.5);\n margin-top: (@carousel-control-font-size / -2);\n font-size: (@carousel-control-font-size * 1.5);\n }\n .glyphicon-chevron-left,\n .icon-prev {\n margin-left: (@carousel-control-font-size / -2);\n }\n .glyphicon-chevron-right,\n .icon-next {\n margin-right: (@carousel-control-font-size / -2);\n }\n }\n\n // Show and left align the captions\n .carousel-caption {\n left: 20%;\n right: 20%;\n padding-bottom: 30px;\n }\n\n // Move up the indicators\n .carousel-indicators {\n bottom: 20px;\n }\n}\n","// Clearfix\n//\n// For modern browsers\n// 1. The space content is one way to avoid an Opera bug when the\n// contenteditable attribute is included anywhere else in the document.\n// Otherwise it causes space to appear at the top and bottom of elements\n// that are clearfixed.\n// 2. The use of `table` rather than `block` is only necessary if using\n// `:before` to contain the top-margins of child elements.\n//\n// Source: http://nicolasgallagher.com/micro-clearfix-hack/\n\n.clearfix() {\n &:before,\n &:after {\n content: \" \"; // 1\n display: table; // 2\n }\n &:after {\n clear: both;\n }\n}\n","// Center-align a block level element\n\n.center-block() {\n display: block;\n margin-left: auto;\n margin-right: auto;\n}\n","// CSS image replacement\n//\n// Heads up! v3 launched with only `.hide-text()`, but per our pattern for\n// mixins being reused as classes with the same name, this doesn't hold up. As\n// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.\n//\n// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757\n\n// Deprecated as of v3.0.1 (has been removed in v4)\n.hide-text() {\n font: ~\"0/0\" a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n\n// New mixin to use as of v3.0.1\n.text-hide() {\n .hide-text();\n}\n","//\n// Responsive: Utility classes\n// --------------------------------------------------\n\n\n// IE10 in Windows (Phone) 8\n//\n// Support for responsive views via media queries is kind of borked in IE10, for\n// Surface/desktop in split view and for Windows Phone 8. This particular fix\n// must be accompanied by a snippet of JavaScript to sniff the user agent and\n// apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at\n// our Getting Started page for more information on this bug.\n//\n// For more information, see the following:\n//\n// Issue: https://github.com/twbs/bootstrap/issues/10497\n// Docs: http://getbootstrap.com/getting-started/#support-ie10-width\n// Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/\n// Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/\n\n@-ms-viewport {\n width: device-width;\n}\n\n\n// Visibility utilities\n// Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0\n.visible-xs,\n.visible-sm,\n.visible-md,\n.visible-lg {\n .responsive-invisibility();\n}\n\n.visible-xs-block,\n.visible-xs-inline,\n.visible-xs-inline-block,\n.visible-sm-block,\n.visible-sm-inline,\n.visible-sm-inline-block,\n.visible-md-block,\n.visible-md-inline,\n.visible-md-inline-block,\n.visible-lg-block,\n.visible-lg-inline,\n.visible-lg-inline-block {\n display: none !important;\n}\n\n.visible-xs {\n @media (max-width: @screen-xs-max) {\n .responsive-visibility();\n }\n}\n.visible-xs-block {\n @media (max-width: @screen-xs-max) {\n display: block !important;\n }\n}\n.visible-xs-inline {\n @media (max-width: @screen-xs-max) {\n display: inline !important;\n }\n}\n.visible-xs-inline-block {\n @media (max-width: @screen-xs-max) {\n display: inline-block !important;\n }\n}\n\n.visible-sm {\n @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n .responsive-visibility();\n }\n}\n.visible-sm-block {\n @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n display: block !important;\n }\n}\n.visible-sm-inline {\n @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n display: inline !important;\n }\n}\n.visible-sm-inline-block {\n @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n display: inline-block !important;\n }\n}\n\n.visible-md {\n @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n .responsive-visibility();\n }\n}\n.visible-md-block {\n @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n display: block !important;\n }\n}\n.visible-md-inline {\n @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n display: inline !important;\n }\n}\n.visible-md-inline-block {\n @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n display: inline-block !important;\n }\n}\n\n.visible-lg {\n @media (min-width: @screen-lg-min) {\n .responsive-visibility();\n }\n}\n.visible-lg-block {\n @media (min-width: @screen-lg-min) {\n display: block !important;\n }\n}\n.visible-lg-inline {\n @media (min-width: @screen-lg-min) {\n display: inline !important;\n }\n}\n.visible-lg-inline-block {\n @media (min-width: @screen-lg-min) {\n display: inline-block !important;\n }\n}\n\n.hidden-xs {\n @media (max-width: @screen-xs-max) {\n .responsive-invisibility();\n }\n}\n.hidden-sm {\n @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {\n .responsive-invisibility();\n }\n}\n.hidden-md {\n @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {\n .responsive-invisibility();\n }\n}\n.hidden-lg {\n @media (min-width: @screen-lg-min) {\n .responsive-invisibility();\n }\n}\n\n\n// Print utilities\n//\n// Media queries are placed on the inside to be mixin-friendly.\n\n// Note: Deprecated .visible-print as of v3.2.0\n.visible-print {\n .responsive-invisibility();\n\n @media print {\n .responsive-visibility();\n }\n}\n.visible-print-block {\n display: none !important;\n\n @media print {\n display: block !important;\n }\n}\n.visible-print-inline {\n display: none !important;\n\n @media print {\n display: inline !important;\n }\n}\n.visible-print-inline-block {\n display: none !important;\n\n @media print {\n display: inline-block !important;\n }\n}\n\n.hidden-print {\n @media print {\n .responsive-invisibility();\n }\n}\n","// Responsive utilities\n\n//\n// More easily include all the states for responsive-utilities.less.\n.responsive-visibility() {\n display: block !important;\n table& { display: table !important; }\n tr& { display: table-row !important; }\n th&,\n td& { display: table-cell !important; }\n}\n\n.responsive-invisibility() {\n display: none !important;\n}\n"]} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css
new file mode 100755
index 000000000..4cf729e43
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css
@@ -0,0 +1,6 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
+/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css.map b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css.map
new file mode 100644
index 000000000..5f49bb374
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap.min.css.map
@@ -0,0 +1 @@
+{"version":3,"sources":["less/normalize.less","less/print.less","bootstrap.css","dist/css/bootstrap.css","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less/pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/mixins/reset-text.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":";;;;4EAQA,KACE,YAAA,WACA,yBAAA,KACA,qBAAA,KAOF,KACE,OAAA,EAaF,QAAA,MAAA,QAAA,WAAA,OAAA,OAAA,OAAA,OAAA,KAAA,KAAA,IAAA,QAAA,QAaE,QAAA,MAQF,MAAA,OAAA,SAAA,MAIE,QAAA,aACA,eAAA,SAQF,sBACE,QAAA,KACA,OAAA,EAQF,SAAA,SAEE,QAAA,KAUF,EACE,iBAAA,YAQF,SAAA,QAEE,QAAA,EAUF,YACE,cAAA,IAAA,OAOF,EAAA,OAEE,YAAA,IAOF,IACE,WAAA,OAQF,GACE,OAAA,MAAA,EACA,UAAA,IAOF,KACE,MAAA,KACA,WAAA,KAOF,MACE,UAAA,IAOF,IAAA,IAEE,SAAA,SACA,UAAA,IACA,YAAA,EACA,eAAA,SAGF,IACE,IAAA,MAGF,IACE,OAAA,OAUF,IACE,OAAA,EAOF,eACE,SAAA,OAUF,OACE,OAAA,IAAA,KAOF,GACE,OAAA,EAAA,mBAAA,YAAA,gBAAA,YACA,WAAA,YAOF,IACE,SAAA,KAOF,KAAA,IAAA,IAAA,KAIE,YAAA,UAAA,UACA,UAAA,IAkBF,OAAA,MAAA,SAAA,OAAA,SAKE,OAAA,EACA,KAAA,QACA,MAAA,QAOF,OACE,SAAA,QAUF,OAAA,OAEE,eAAA,KAWF,OAAA,wBAAA,kBAAA,mBAIE,mBAAA,OACA,OAAA,QAOF,iBAAA,qBAEE,OAAA,QAOF,yBAAA,wBAEE,QAAA,EACA,OAAA,EAQF,MACE,YAAA,OAWF,qBAAA,kBAEE,mBAAA,WAAA,gBAAA,WAAA,WAAA,WACA,QAAA,EASF,8CAAA,8CAEE,OAAA,KAQF,mBACE,mBAAA,YACA,gBAAA,YAAA,WAAA,YAAA,mBAAA,UASF,iDAAA,8CAEE,mBAAA,KAOF,SACE,QAAA,MAAA,OAAA,MACA,OAAA,EAAA,IACA,OAAA,IAAA,MAAA,OAQF,OACE,QAAA,EACA,OAAA,EAOF,SACE,SAAA,KAQF,SACE,YAAA,IAUF,MACE,eAAA,EACA,gBAAA,SAGF,GAAA,GAEE,QAAA,uFCjUF,aA7FI,EAAA,OAAA,QAGI,MAAA,eACA,YAAA,eACA,WAAA,cAAA,mBAAA,eACA,WAAA,eAGJ,EAAA,UAEI,gBAAA,UAGJ,cACI,QAAA,KAAA,WAAA,IAGJ,kBACI,QAAA,KAAA,YAAA,IAKJ,6BAAA,mBAEI,QAAA,GAGJ,WAAA,IAEI,OAAA,IAAA,MAAA,KC4KL,kBAAA,MDvKK,MC0KL,QAAA,mBDrKK,IE8KN,GDLC,kBAAA,MDrKK,ICwKL,UAAA,eCUD,GF5KM,GE2KN,EF1KM,QAAA,ECuKL,OAAA,ECSD,GF3KM,GCsKL,iBAAA,MD/JK,QCkKL,QAAA,KCSD,YFtKU,oBCiKT,iBAAA,eD7JK,OCgKL,OAAA,IAAA,MAAA,KD5JK,OC+JL,gBAAA,mBCSD,UFpKU,UC+JT,iBAAA,eDzJS,mBEkKV,mBDLC,OAAA,IAAA,MAAA,gBEjPD,WACA,YAAA,uBFsPD,IAAA,+CE7OC,IAAK,sDAAuD,4BAA6B,iDAAkD,gBAAiB,gDAAiD,eAAgB,+CAAgD,mBAAoB,2EAA4E,cAE7W,WACA,SAAA,SACA,IAAA,IACA,QAAA,aACA,YAAA,uBACA,WAAA,OACA,YAAA,IACA,YAAA,EAIkC,uBAAA,YAAW,wBAAA,UACX,2BAAW,QAAA,QAEX,uBDuPlC,QAAS,QCtPyB,sBFiPnC,uBEjP8C,QAAA,QACX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,2BAAW,QAAA,QACX,yBAAW,QAAA,QACX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,yBAAW,QAAA,QACX,wBAAW,QAAA,QACX,uBAAW,QAAA,QACX,6BAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,2BAAW,QAAA,QACX,qBAAW,QAAA,QACX,0BAAW,QAAA,QACX,qBAAW,QAAA,QACX,yBAAW,QAAA,QACX,0BAAW,QAAA,QACX,2BAAW,QAAA,QACX,sBAAW,QAAA,QACX,yBAAW,QAAA,QACX,sBAAW,QAAA,QACX,wBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,+BAAW,QAAA,QACX,2BAAW,QAAA,QACX,yBAAW,QAAA,QACX,wBAAW,QAAA,QACX,8BAAW,QAAA,QACX,yBAAW,QAAA,QACX,0BAAW,QAAA,QACX,2BAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,6BAAW,QAAA,QACX,6BAAW,QAAA,QACX,8BAAW,QAAA,QACX,4BAAW,QAAA,QACX,yBAAW,QAAA,QACX,0BAAW,QAAA,QACX,sBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,2BAAW,QAAA,QACX,wBAAW,QAAA,QACX,yBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,yBAAW,QAAA,QACX,8BAAW,QAAA,QACX,6BAAW,QAAA,QACX,6BAAW,QAAA,QACX,+BAAW,QAAA,QACX,8BAAW,QAAA,QACX,gCAAW,QAAA,QACX,uBAAW,QAAA,QACX,8BAAW,QAAA,QACX,+BAAW,QAAA,QACX,iCAAW,QAAA,QACX,0BAAW,QAAA,QACX,6BAAW,QAAA,QACX,yBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,uBAAW,QAAA,QACX,gCAAW,QAAA,QACX,gCAAW,QAAA,QACX,2BAAW,QAAA,QACX,uBAAW,QAAA,QACX,wBAAW,QAAA,QACX,uBAAW,QAAA,QACX,0BAAW,QAAA,QACX,+BAAW,QAAA,QACX,+BAAW,QAAA,QACX,wBAAW,QAAA,QACX,+BAAW,QAAA,QACX,gCAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,8BAAW,QAAA,QACX,0BAAW,QAAA,QACX,gCAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,gCAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,6BAAW,QAAA,QACX,8BAAW,QAAA,QACX,2BAAW,QAAA,QACX,6BAAW,QAAA,QACX,4BAAW,QAAA,QACX,8BAAW,QAAA,QACX,+BAAW,QAAA,QACX,mCAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,2BAAW,QAAA,QACX,4BAAW,QAAA,QACX,+BAAW,QAAA,QACX,wBAAW,QAAA,QACX,2BAAW,QAAA,QACX,yBAAW,QAAA,QACX,0BAAW,QAAA,QACX,yBAAW,QAAA,QACX,6BAAW,QAAA,QACX,+BAAW,QAAA,QACX,0BAAW,QAAA,QACX,gCAAW,QAAA,QACX,+BAAW,QAAA,QACX,8BAAW,QAAA,QACX,kCAAW,QAAA,QACX,oCAAW,QAAA,QACX,sBAAW,QAAA,QACX,2BAAW,QAAA,QACX,uBAAW,QAAA,QACX,8BAAW,QAAA,QACX,4BAAW,QAAA,QACX,8BAAW,QAAA,QACX,6BAAW,QAAA,QACX,4BAAW,QAAA,QACX,0BAAW,QAAA,QACX,4BAAW,QAAA,QACX,qCAAW,QAAA,QACX,oCAAW,QAAA,QACX,kCAAW,QAAA,QACX,oCAAW,QAAA,QACX,wBAAW,QAAA,QACX,yBAAW,QAAA,QACX,wBAAW,QAAA,QACX,yBAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,4BAAW,QAAA,QACX,4BAAW,QAAA,QACX,8BAAW,QAAA,QACX,uBAAW,QAAA,QACX,wBAAW,QAAA,QACX,0BAAW,QAAA,QACX,sBAAW,QAAA,QACX,sBAAW,QAAA,QACX,uBAAW,QAAA,QACX,mCAAW,QAAA,QACX,uCAAW,QAAA,QACX,gCAAW,QAAA,QACX,oCAAW,QAAA,QACX,qCAAW,QAAA,QACX,yCAAW,QAAA,QACX,4BAAW,QAAA,QACX,yBAAW,QAAA,QACX,gCAAW,QAAA,QACX,8BAAW,QAAA,QACX,yBAAW,QAAA,QACX,wBAAW,QAAA,QACX,0BAAW,QAAA,QACX,6BAAW,QAAA,QACX,yBAAW,QAAA,QACX,uBAAW,QAAA,QACX,uBAAW,QAAA,QACX,wBAAW,QAAA,QACX,yBAAW,QAAA,QACX,yBAAW,QAAA,QACX,uBAAW,QAAA,QACX,8BAAW,QAAA,QACX,+BAAW,QAAA,QACX,gCAAW,QAAA,QACX,8BAAW,QAAA,QACX,8BAAW,QAAA,QACX,8BAAW,QAAA,QACX,2BAAW,QAAA,QACX,0BAAW,QAAA,QACX,yBAAW,QAAA,QACX,6BAAW,QAAA,QACX,2BAAW,QAAA,QACX,4BAAW,QAAA,QACX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,2BAAW,QAAA,QACX,2BAAW,QAAA,QACX,4BAAW,QAAA,QACX,+BAAW,QAAA,QACX,8BAAW,QAAA,QACX,4BAAW,QAAA,QACX,4BAAW,QAAA,QACX,4BAAW,QAAA,QACX,iCAAW,QAAA,QACX,oCAAW,QAAA,QACX,iCAAW,QAAA,QACX,+BAAW,QAAA,QACX,+BAAW,QAAA,QACX,iCAAW,QAAA,QACX,qBAAW,QAAA,QACX,4BAAW,QAAA,QACX,4BAAW,QAAA,QACX,2BAAW,QAAA,QACX,uBAAW,QAAA,QASX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,4BAAW,QAAA,QACX,uBAAW,QAAA,QACX,wBAAW,QAAA,QACX,uBAAW,QAAA,QACX,yBAAW,QAAA,QACX,yBAAW,QAAA,QACX,+BAAW,QAAA,QACX,uBAAW,QAAA,QACX,6BAAW,QAAA,QACX,sBAAW,QAAA,QACX,wBAAW,QAAA,QACX,wBAAW,QAAA,QACX,4BAAW,QAAA,QACX,uBAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,2BAAW,QAAA,QACX,0BAAW,QAAA,QACX,sBAAW,QAAA,QACX,sBAAW,QAAA,QACX,sBAAW,QAAA,QACX,sBAAW,QAAA,QACX,wBAAW,QAAA,QACX,sBAAW,QAAA,QACX,wBAAW,QAAA,QACX,4BAAW,QAAA,QACX,mCAAW,QAAA,QACX,4BAAW,QAAA,QACX,oCAAW,QAAA,QACX,kCAAW,QAAA,QACX,iCAAW,QAAA,QACX,+BAAW,QAAA,QACX,sBAAW,QAAA,QACX,wBAAW,QAAA,QACX,6BAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,kCAAW,QAAA,QACX,mCAAW,QAAA,QACX,sCAAW,QAAA,QACX,0CAAW,QAAA,QACX,oCAAW,QAAA,QACX,wCAAW,QAAA,QACX,qCAAW,QAAA,QACX,iCAAW,QAAA,QACX,gCAAW,QAAA,QACX,kCAAW,QAAA,QACX,+BAAW,QAAA,QACX,0BAAW,QAAA,QACX,8BAAW,QAAA,QACX,4BAAW,QAAA,QACX,4BAAW,QAAA,QACX,6BAAW,QAAA,QACX,4BAAW,QAAA,QCtS/C,0BCgEE,QAAA,QHi+BF,EDNC,mBAAA,WGxhCI,gBAAiB,WFiiCZ,WAAY,WGl+BZ,OADL,QJg+BJ,mBAAA,WGthCI,gBAAiB,WACpB,WAAA,WHyhCD,KGrhCC,UAAW,KAEX,4BAAA,cAEA,KACA,YAAA,iBAAA,UAAA,MAAA,WHuhCD,UAAA,KGnhCC,YAAa,WF4hCb,MAAO,KACP,iBAAkB,KExhClB,OADA,MAEA,OHqhCD,SG/gCC,YAAa,QACb,UAAA,QACA,YAAA,QAEA,EFwhCA,MAAO,QEthCL,gBAAA,KAIF,QH8gCD,QKnkCC,MAAA,QAEA,gBAAA,ULskCD,QGxgCC,QAAS,KAAK,OACd,QAAA,IAAA,KAAA,yBH0gCD,eAAA,KGngCC,OHsgCD,OAAA,ECSD,IACE,eAAgB,ODDjB,4BMhlCC,0BLmlCF,gBKplCE,iBADA,eH4EA,QAAS,MACT,UAAA,KHwgCD,OAAA,KGjgCC,aACA,cAAA,IAEA,eACA,QAAA,aC6FA,UAAA,KACK,OAAA,KACG,QAAA,IEvLR,YAAA,WACA,iBAAA,KACA,OAAA,IAAA,MAAA,KNgmCD,cAAA,IGlgCC,mBAAoB,IAAI,IAAI,YAC5B,cAAA,IAAA,IAAA,YHogCD,WAAA,IAAA,IAAA,YG7/BC,YACA,cAAA,IAEA,GHggCD,WAAA,KGx/BC,cAAe,KACf,OAAA,EACA,WAAA,IAAA,MAAA,KAEA,SACA,SAAA,SACA,MAAA,IACA,OAAA,IACA,QAAA,EH0/BD,OAAA,KGl/BC,SAAA,OF2/BA,KAAM,cEz/BJ,OAAA,EAEA,0BACA,yBACA,SAAA,OACA,MAAA,KHo/BH,OAAA,KGz+BC,OAAQ,EACR,SAAA,QH2+BD,KAAA,KCSD,cACE,OAAQ,QAQV,IACA,IMnpCE,IACA,IACA,IACA,INyoCF,GACA,GACA,GACA,GACA,GACA,GDAC,YAAA,QOnpCC,YAAa,IN4pCb,YAAa,IACb,MAAO,QAoBT,WAZA,UAaA,WAZA,UM7pCI,WN8pCJ,UM7pCI,WN8pCJ,UM7pCI,WN8pCJ,UDMC,WCLD,UACA,UAZA,SAaA,UAZA,SAaA,UAZA,SAaA,UAZA,SAaA,UAZA,SAaA,UAZA,SMrpCE,YAAa,INyqCb,YAAa,EACb,MAAO,KAGT,IMzqCE,IAJF,IN4qCA,GAEA,GDLC,GCSC,WAAY,KACZ,cAAe,KASjB,WANA,UDCC,WCCD,UM7qCA,WN+qCA,UACA,UANA,SM7qCI,UN+qCJ,SM5qCA,UN8qCA,SAQE,UAAW,IAGb,IMrrCE,IAJF,INwrCA,GAEA,GDLC,GCSC,WAAY,KACZ,cAAe,KASjB,WANA,UDCC,WCCD,UMxrCA,WN0rCA,UACA,UANA,SMzrCI,UN2rCJ,SMvrCA,UNyrCA,SMzrCU,UAAA,IACV,IAAA,GAAU,UAAA,KACV,IAAA,GAAU,UAAA,KACV,IAAA,GAAU,UAAA,KACV,IAAA,GAAU,UAAA,KACV,IAAA,GAAU,UAAA,KAOR,IADF,GPusCC,UAAA,KCSD,EM1sCE,OAAA,EAAA,EAAA,KAEA,MPqsCD,cAAA,KOhsCC,UAAW,KAwOX,YAAa,IA1OX,YAAA,IPusCH,yBO9rCC,MNusCE,UAAW,MMlsCf,OAAA,MAEE,UAAA,IAKF,MP2rCC,KO3rCsB,QAAA,KP8rCtB,iBAAA,QO7rCsB,WPgsCtB,WAAA,KO/rCsB,YPksCtB,WAAA,MOjsCsB,aPosCtB,WAAA,OOnsCsB,cPssCtB,WAAA,QOnsCsB,aPssCtB,YAAA,OOrsCsB,gBPwsCtB,eAAA,UOvsCsB,gBP0sCtB,eAAA,UOtsCC,iBPysCD,eAAA,WQ5yCC,YR+yCD,MAAA,KCSD,cOrzCI,MAAA,QAHF,qBDwGF,qBP8sCC,MAAA,QCSD,cO5zCI,MAAA,QAHF,qBD2GF,qBPktCC,MAAA,QCSD,WOn0CI,MAAA,QAHF,kBD8GF,kBPstCC,MAAA,QCSD,cO10CI,MAAA,QAHF,qBDiHF,qBP0tCC,MAAA,QCSD,aOj1CI,MAAA,QDwHF,oBAHF,oBExHE,MAAA,QACA,YR21CA,MAAO,KQz1CL,iBAAA,QAHF,mBF8HF,mBP4tCC,iBAAA,QCSD,YQh2CI,iBAAA,QAHF,mBFiIF,mBPguCC,iBAAA,QCSD,SQv2CI,iBAAA,QAHF,gBFoIF,gBPouCC,iBAAA,QCSD,YQ92CI,iBAAA,QAHF,mBFuIF,mBPwuCC,iBAAA,QCSD,WQr3CI,iBAAA,QF6IF,kBADF,kBAEE,iBAAA,QPuuCD,aO9tCC,eAAgB,INuuChB,OAAQ,KAAK,EAAE,KMruCf,cAAA,IAAA,MAAA,KAFF,GPmuCC,GCSC,WAAY,EACZ,cAAe,KM/tCf,MP2tCD,MO5tCD,MAPI,MASF,cAAA,EAIF,eALE,aAAA,EACA,WAAA,KPmuCD,aO/tCC,aAAc,EAKZ,YAAA,KACA,WAAA,KP8tCH,gBOxtCC,QAAS,aACT,cAAA,IACA,aAAA,IAEF,GNiuCE,WAAY,EM/tCZ,cAAA,KAGA,GADF,GP2tCC,YAAA,WOvtCC,GP0tCD,YAAA,IOpnCD,GAvFM,YAAA,EAEA,yBACA,kBGtNJ,MAAA,KACA,MAAA,MACA,SAAA,OVs6CC,MAAA,KO9nCC,WAAY,MAhFV,cAAA,SPitCH,YAAA,OOvsCD,kBNitCE,YAAa,OM3sCjB,0BPusCC,YOtsCC,OAAA,KA9IqB,cAAA,IAAA,OAAA,KAmJvB,YACE,UAAA,IACA,eAAA,UAEA,WPusCD,QAAA,KAAA,KOlsCG,OAAA,EAAA,EAAA,KN2sCF,UAAW,OACX,YAAa,IAAI,MAAM,KMrtCzB,yBPgtCC,wBOhtCD,yBN0tCE,cAAe,EMpsCb,kBAFA,kBACA,iBPmsCH,QAAA,MOhsCG,UAAA,INysCF,YAAa,WACb,MAAO,KMjsCT,yBP4rCC,yBO5rCD,wBAEE,QAAA,cAEA,oBACA,sBACA,cAAA,KP8rCD,aAAA,EOxrCG,WAAA,MNisCF,aAAc,IAAI,MAAM,KACxB,YAAa,EMjsCX,kCNmsCJ,kCMpsCe,iCACX,oCNosCJ,oCDLC,mCCUC,QAAS,GMlsCX,iCNosCA,iCM1sCM,gCAOJ,mCNosCF,mCDLC,kCO9rCC,QAAA,cPmsCD,QWx+CC,cAAe,KVi/Cf,WAAY,OACZ,YAAa,WU9+Cb,KX0+CD,IWt+CD,IACE,KACA,YAAA,MAAA,OAAA,SAAA,cAAA,UAEA,KACA,QAAA,IAAA,IXw+CD,UAAA,IWp+CC,MAAO,QACP,iBAAA,QACA,cAAA,IAEA,IACA,QAAA,IAAA,IACA,UAAA,IV6+CA,MU7+CA,KXs+CD,iBAAA,KW5+CC,cAAe,IASb,mBAAA,MAAA,EAAA,KAAA,EAAA,gBACA,WAAA,MAAA,EAAA,KAAA,EAAA,gBAEA,QV8+CF,QU9+CE,EXs+CH,UAAA,KWj+CC,YAAa,IACb,mBAAA,KACA,WAAA,KAEA,IACA,QAAA,MACA,QAAA,MACA,OAAA,EAAA,EAAA,KACA,UAAA,KACA,YAAA,WACA,MAAA,KACA,WAAA,UXm+CD,UAAA,WW9+CC,iBAAkB,QAehB,OAAA,IAAA,MAAA,KACA,cAAA,IAEA,SACA,QAAA,EACA,UAAA,QXk+CH,MAAA,QW79CC,YAAa,SACb,iBAAA,YACA,cAAA,EC1DF,gBCHE,WAAA,MACA,WAAA,OAEA,Wb+hDD,cAAA,KYzhDC,aAAA,KAqEA,aAAc,KAvEZ,YAAA,KZgiDH,yBY3hDC,WAkEE,MAAO,OZ89CV,yBY7hDC,WA+DE,MAAO,OZm+CV,0BY1hDC,WCvBA,MAAA,QAGA,iBbojDD,cAAA,KYvhDC,aAAc,KCvBd,aAAA,KACA,YAAA,KCAE,KACE,aAAA,MAEA,YAAA,MAGA,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UdijDL,SAAA,ScjiDG,WAAA,IACE,cAAA,KdmiDL,aAAA,Kc3hDG,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Ud8hDH,MAAA,Kc9hDG,WdiiDH,MAAA,KcjiDG,WdoiDH,MAAA,acpiDG,WduiDH,MAAA,acviDG,Ud0iDH,MAAA,Ic1iDG,Ud6iDH,MAAA,ac7iDG,UdgjDH,MAAA,achjDG,UdmjDH,MAAA,IcnjDG,UdsjDH,MAAA,actjDG,UdyjDH,MAAA,aczjDG,Ud4jDH,MAAA,Ic5jDG,Ud+jDH,MAAA,achjDG,UdmjDH,MAAA,YcnjDG,gBdsjDH,MAAA,KctjDG,gBdyjDH,MAAA,aczjDG,gBd4jDH,MAAA,ac5jDG,ed+jDH,MAAA,Ic/jDG,edkkDH,MAAA,aclkDG,edqkDH,MAAA,acrkDG,edwkDH,MAAA,IcxkDG,ed2kDH,MAAA,ac3kDG,ed8kDH,MAAA,ac9kDG,edilDH,MAAA,IcjlDG,edolDH,MAAA,ac/kDG,edklDH,MAAA,YcjmDG,edomDH,MAAA,KcpmDG,gBdumDH,KAAA,KcvmDG,gBd0mDH,KAAA,ac1mDG,gBd6mDH,KAAA,ac7mDG,edgnDH,KAAA,IchnDG,edmnDH,KAAA,acnnDG,edsnDH,KAAA,actnDG,edynDH,KAAA,IcznDG,ed4nDH,KAAA,ac5nDG,ed+nDH,KAAA,ac/nDG,edkoDH,KAAA,IcloDG,edqoDH,KAAA,achoDG,edmoDH,KAAA,YcpnDG,edunDH,KAAA,KcvnDG,kBd0nDH,YAAA,Kc1nDG,kBd6nDH,YAAA,ac7nDG,kBdgoDH,YAAA,achoDG,iBdmoDH,YAAA,IcnoDG,iBdsoDH,YAAA,actoDG,iBdyoDH,YAAA,aczoDG,iBd4oDH,YAAA,Ic5oDG,iBd+oDH,YAAA,ac/oDG,iBdkpDH,YAAA,aclpDG,iBdqpDH,YAAA,IcrpDG,iBdwpDH,YAAA,acxpDG,iBd2pDH,YAAA,Yc7rDG,iBACE,YAAA,EAOJ,yBACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Ud2rDD,MAAA,Kc3rDC,Wd8rDD,MAAA,Kc9rDC,WdisDD,MAAA,acjsDC,WdosDD,MAAA,acpsDC,UdusDD,MAAA,IcvsDC,Ud0sDD,MAAA,ac1sDC,Ud6sDD,MAAA,ac7sDC,UdgtDD,MAAA,IchtDC,UdmtDD,MAAA,acntDC,UdstDD,MAAA,acttDC,UdytDD,MAAA,IcztDC,Ud4tDD,MAAA,ac7sDC,UdgtDD,MAAA,YchtDC,gBdmtDD,MAAA,KcntDC,gBdstDD,MAAA,acttDC,gBdytDD,MAAA,acztDC,ed4tDD,MAAA,Ic5tDC,ed+tDD,MAAA,ac/tDC,edkuDD,MAAA,acluDC,edquDD,MAAA,IcruDC,edwuDD,MAAA,acxuDC,ed2uDD,MAAA,ac3uDC,ed8uDD,MAAA,Ic9uDC,edivDD,MAAA,ac5uDC,ed+uDD,MAAA,Yc9vDC,ediwDD,MAAA,KcjwDC,gBdowDD,KAAA,KcpwDC,gBduwDD,KAAA,acvwDC,gBd0wDD,KAAA,ac1wDC,ed6wDD,KAAA,Ic7wDC,edgxDD,KAAA,achxDC,edmxDD,KAAA,acnxDC,edsxDD,KAAA,IctxDC,edyxDD,KAAA,aczxDC,ed4xDD,KAAA,ac5xDC,ed+xDD,KAAA,Ic/xDC,edkyDD,KAAA,ac7xDC,edgyDD,KAAA,YcjxDC,edoxDD,KAAA,KcpxDC,kBduxDD,YAAA,KcvxDC,kBd0xDD,YAAA,ac1xDC,kBd6xDD,YAAA,ac7xDC,iBdgyDD,YAAA,IchyDC,iBdmyDD,YAAA,acnyDC,iBdsyDD,YAAA,actyDC,iBdyyDD,YAAA,IczyDC,iBd4yDD,YAAA,ac5yDC,iBd+yDD,YAAA,ac/yDC,iBdkzDD,YAAA,IclzDC,iBdqzDD,YAAA,acrzDC,iBdwzDD,YAAA,YY/yDD,iBE3CE,YAAA,GAQF,yBACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Udy1DD,MAAA,Kcz1DC,Wd41DD,MAAA,Kc51DC,Wd+1DD,MAAA,ac/1DC,Wdk2DD,MAAA,acl2DC,Udq2DD,MAAA,Icr2DC,Udw2DD,MAAA,acx2DC,Ud22DD,MAAA,ac32DC,Ud82DD,MAAA,Ic92DC,Udi3DD,MAAA,acj3DC,Udo3DD,MAAA,acp3DC,Udu3DD,MAAA,Icv3DC,Ud03DD,MAAA,ac32DC,Ud82DD,MAAA,Yc92DC,gBdi3DD,MAAA,Kcj3DC,gBdo3DD,MAAA,acp3DC,gBdu3DD,MAAA,acv3DC,ed03DD,MAAA,Ic13DC,ed63DD,MAAA,ac73DC,edg4DD,MAAA,ach4DC,edm4DD,MAAA,Icn4DC,eds4DD,MAAA,act4DC,edy4DD,MAAA,acz4DC,ed44DD,MAAA,Ic54DC,ed+4DD,MAAA,ac14DC,ed64DD,MAAA,Yc55DC,ed+5DD,MAAA,Kc/5DC,gBdk6DD,KAAA,Kcl6DC,gBdq6DD,KAAA,acr6DC,gBdw6DD,KAAA,acx6DC,ed26DD,KAAA,Ic36DC,ed86DD,KAAA,ac96DC,edi7DD,KAAA,acj7DC,edo7DD,KAAA,Icp7DC,edu7DD,KAAA,acv7DC,ed07DD,KAAA,ac17DC,ed67DD,KAAA,Ic77DC,edg8DD,KAAA,ac37DC,ed87DD,KAAA,Yc/6DC,edk7DD,KAAA,Kcl7DC,kBdq7DD,YAAA,Kcr7DC,kBdw7DD,YAAA,acx7DC,kBd27DD,YAAA,ac37DC,iBd87DD,YAAA,Ic97DC,iBdi8DD,YAAA,acj8DC,iBdo8DD,YAAA,acp8DC,iBdu8DD,YAAA,Icv8DC,iBd08DD,YAAA,ac18DC,iBd68DD,YAAA,ac78DC,iBdg9DD,YAAA,Ich9DC,iBdm9DD,YAAA,acn9DC,iBds9DD,YAAA,YY18DD,iBE9CE,YAAA,GAQF,0BACE,UAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,UAAA,Udu/DD,MAAA,Kcv/DC,Wd0/DD,MAAA,Kc1/DC,Wd6/DD,MAAA,ac7/DC,WdggED,MAAA,achgEC,UdmgED,MAAA,IcngEC,UdsgED,MAAA,actgEC,UdygED,MAAA,aczgEC,Ud4gED,MAAA,Ic5gEC,Ud+gED,MAAA,ac/gEC,UdkhED,MAAA,aclhEC,UdqhED,MAAA,IcrhEC,UdwhED,MAAA,aczgEC,Ud4gED,MAAA,Yc5gEC,gBd+gED,MAAA,Kc/gEC,gBdkhED,MAAA,aclhEC,gBdqhED,MAAA,acrhEC,edwhED,MAAA,IcxhEC,ed2hED,MAAA,ac3hEC,ed8hED,MAAA,ac9hEC,ediiED,MAAA,IcjiEC,edoiED,MAAA,acpiEC,eduiED,MAAA,acviEC,ed0iED,MAAA,Ic1iEC,ed6iED,MAAA,acxiEC,ed2iED,MAAA,Yc1jEC,ed6jED,MAAA,Kc7jEC,gBdgkED,KAAA,KchkEC,gBdmkED,KAAA,acnkEC,gBdskED,KAAA,actkEC,edykED,KAAA,IczkEC,ed4kED,KAAA,ac5kEC,ed+kED,KAAA,ac/kEC,edklED,KAAA,IcllEC,edqlED,KAAA,acrlEC,edwlED,KAAA,acxlEC,ed2lED,KAAA,Ic3lEC,ed8lED,KAAA,aczlEC,ed4lED,KAAA,Yc7kEC,edglED,KAAA,KchlEC,kBdmlED,YAAA,KcnlEC,kBdslED,YAAA,actlEC,kBdylED,YAAA,aczlEC,iBd4lED,YAAA,Ic5lEC,iBd+lED,YAAA,ac/lEC,iBdkmED,YAAA,aclmEC,iBdqmED,YAAA,IcrmEC,iBdwmED,YAAA,acxmEC,iBd2mED,YAAA,ac3mEC,iBd8mED,YAAA,Ic9mEC,iBdinED,YAAA,acjnEC,iBdonED,YAAA,YevrED,iBACA,YAAA,GAGA,MACA,iBAAA,YAEA,Qf0rED,YAAA,IexrEC,eAAgB,IAChB,MAAA,Kf0rED,WAAA,KenrEC,GACA,WAAA,KfurED,OezrEC,MAAO,KdosEP,UAAW,KACX,cAAe,KcxrET,mBd2rER,mBc1rEQ,mBAHA,mBACA,mBd2rER,mBDHC,QAAA,IepsEC,YAAa,WAoBX,eAAA,IACA,WAAA,IAAA,MAAA,KArBJ,mBdmtEE,eAAgB,OAChB,cAAe,IAAI,MAAM,KDJ1B,uCCMD,uCcttEA,wCdutEA,wCcnrEI,2CANI,2CfqrEP,WAAA,Ee1qEG,mBf6qEH,WAAA,IAAA,MAAA,KCWD,cACE,iBAAkB,KchqEpB,6BdmqEA,6BclqEE,6BAZM,6BfuqEP,6BCMD,6BDHC,QAAA,ICWD,gBACE,OAAQ,IAAI,MAAM,Kc3qEpB,4Bd8qEA,4Bc9qEA,4BAQQ,4Bf+pEP,4BCMD,4Bc9pEM,OAAA,IAAA,MAAA,KAYF,4BAFJ,4BfqpEC,oBAAA,IexoEG,yCf2oEH,iBAAA,QejoEC,4BACA,iBAAA,QfqoED,uBe/nEG,SAAA,Od0oEF,QAAS,aczoEL,MAAA,KAEA,sBfkoEL,sBgB9wEC,SAAA,OfyxEA,QAAS,WACT,MAAO,KAST,0BetxEE,0BfgxEF,0BAGA,0BezxEM,0BAMJ,0BfixEF,0BAGA,0BACA,0BDNC,0BCAD,0BAGA,0BASE,iBAAkB,QDLnB,sCgBnyEC,sCAAA,oCf0yEF,sCevxEM,sCf4xEJ,iBAAkB,QASpB,2Be3yEE,2BfqyEF,2BAGA,2Be9yEM,2BAMJ,2BfsyEF,2BAGA,2BACA,2BDNC,2BCAD,2BAGA,2BASE,iBAAkB,QDLnB,uCgBxzEC,uCAAA,qCf+zEF,uCe5yEM,uCfizEJ,iBAAkB,QASpB,wBeh0EE,wBf0zEF,wBAGA,wBen0EM,wBAMJ,wBf2zEF,wBAGA,wBACA,wBDNC,wBCAD,wBAGA,wBASE,iBAAkB,QDLnB,oCgB70EC,oCAAA,kCfo1EF,oCej0EM,oCfs0EJ,iBAAkB,QASpB,2Ber1EE,2Bf+0EF,2BAGA,2Bex1EM,2BAMJ,2Bfg1EF,2BAGA,2BACA,2BDNC,2BCAD,2BAGA,2BASE,iBAAkB,QDLnB,uCgBl2EC,uCAAA,qCfy2EF,uCet1EM,uCf21EJ,iBAAkB,QASpB,0Be12EE,0Bfo2EF,0BAGA,0Be72EM,0BAMJ,0Bfq2EF,0BAGA,0BACA,0BDNC,0BCAD,0BAGA,0BASE,iBAAkB,QDLnB,sCejtEC,sCADF,oCdytEA,sCe32EM,sCDoJJ,iBAAA,QA6DF,kBACE,WAAY,KA3DV,WAAA,KAEA,oCACA,kBACA,MAAA,KfqtED,cAAA,Ke9pEC,WAAY,OAnDV,mBAAA,yBfotEH,OAAA,IAAA,MAAA,KCWD,yBACE,cAAe,Ec7qEjB,qCdgrEA,qCcltEI,qCARM,qCfmtET,qCCMD,qCDHC,YAAA,OCWD,kCACE,OAAQ,EcxrEV,0Dd2rEA,0Dc3rEA,0DAzBU,0Df6sET,0DCMD,0DAME,YAAa,EchsEf,yDdmsEA,yDcnsEA,yDArBU,yDfitET,yDCMD,yDAME,aAAc,EDLjB,yDe3sEW,yDEzNV,yDjBm6EC,yDiBl6ED,cAAA,GAMA,SjBm6ED,UAAA,EiBh6EC,QAAS,EACT,OAAA,EACA,OAAA,EAEA,OACA,QAAA,MACA,MAAA,KACA,QAAA,EACA,cAAA,KACA,UAAA,KjBk6ED,YAAA,QiB/5EC,MAAO,KACP,OAAA,EACA,cAAA,IAAA,MAAA,QAEA,MjBi6ED,QAAA,aiBt5EC,UAAW,Kb4BX,cAAA,IACG,YAAA,IJ83EJ,mBiBt5EC,mBAAoB,WhBi6EjB,gBAAiB,WgB/5EpB,WAAA,WjB05ED,qBiBx5EC,kBAGA,OAAQ,IAAI,EAAE,EACd,WAAA,MjBu5ED,YAAA,OiBl5EC,iBACA,QAAA,MAIF,kBhB45EE,QAAS,MgB15ET,MAAA,KAIF,iBAAA,ahB25EE,OAAQ,KIh+ER,uBL29ED,2BK19EC,wBY2EA,QAAS,KAAK,OACd,QAAA,IAAA,KAAA,yBACA,eAAA,KAEA,OACA,QAAA,MjBi5ED,YAAA,IiBv3EC,UAAW,KACX,YAAA,WACA,MAAA,KAEA,cACA,QAAA,MACA,MAAA,KACA,OAAA,KACA,QAAA,IAAA,KACA,UAAA,KACA,YAAA,WACA,MAAA,KbxDA,iBAAA,KACQ,iBAAA,KAyHR,OAAA,IAAA,MAAA,KACK,cAAA,IACG,mBAAA,MAAA,EAAA,IAAA,IAAA,iBJ0zET,WAAA,MAAA,EAAA,IAAA,IAAA,iBkBl8EC,mBAAA,aAAA,YAAA,KAAA,mBAAA,YAAA,KACE,cAAA,aAAA,YAAA,KAAA,WAAA,YAAA,KACA,WAAA,aAAA,YAAA,KAAA,WAAA,YAAA,KdWM,oBJ27ET,aAAA,QI15EC,QAAA,EACE,mBAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,qBACA,WAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,qBAEF,gCAA0B,MAAA,KJ65E3B,QAAA,EI55EiC,oCJ+5EjC,MAAA,KiBl4EG,yCACA,MAAA,KAQF,0BhBw4EA,iBAAkB,YAClB,OAAQ,EgBr4EN,wBjB+3EH,wBiB53EC,iChBu4EA,iBAAkB,KgBr4EhB,QAAA,EAIF,wBACE,iCjB43EH,OAAA,YiB/2EC,sBjBk3ED,OAAA,KiBh2EG,mBhB42EF,mBAAoB,KAEtB,qDgB72EM,8BjBs2EH,8BiBn2EC,wCAAA,+BhB+2EA,YAAa,KgB72EX,iCjB22EH,iCiBx2EC,2CAAA,kChB42EF,0BACA,0BACA,oCACA,2BAKE,YAAa,KgBl3EX,iCjBg3EH,iCACF,2CiBt2EC,kChBy2EA,0BACA,0BACA,oCACA,2BgB32EA,YAAA,MhBm3EF,YgBz2EE,cAAA,KAGA,UADA,OjBm2ED,SAAA,SiBv2EC,QAAS,MhBk3ET,WAAY,KgB12EV,cAAA,KAGA,gBADA,aAEA,WAAA,KjBm2EH,aAAA,KiBh2EC,cAAe,EhB22Ef,YAAa,IACb,OAAQ,QgBt2ER,+BjBk2ED,sCiBp2EC,yBACA,gCAIA,SAAU,ShB02EV,WAAY,MgBx2EZ,YAAA,MAIF,oBAAA,cAEE,WAAA,KAGA,iBADA,cAEA,SAAA,SACA,QAAA,aACA,aAAA,KjB+1ED,cAAA,EiB71EC,YAAa,IhBw2Eb,eAAgB,OgBt2EhB,OAAA,QAUA,kCjBs1ED,4BCWC,WAAY,EACZ,YAAa,KgBz1Eb,wCAAA,qCjBq1ED,8BCOD,+BgBl2EI,2BhBi2EJ,4BAME,OAAQ,YDNT,0BiBz1EG,uBAMF,oCAAA,iChB+1EA,OAAQ,YDNT,yBiBt1EK,sBAaJ,mCAFF,gCAGE,OAAA,YAGA,qBjB20ED,WAAA,KiBz0EC,YAAA,IhBo1EA,eAAgB,IgBl1Ed,cAAA,EjB40EH,8BiB9zED,8BCnQE,cAAA,EACA,aAAA,EAEA,UACA,OAAA,KlBokFD,QAAA,IAAA,KkBlkFC,UAAA,KACE,YAAA,IACA,cAAA,IAGF,gBjB4kFA,OAAQ,KiB1kFN,YAAA,KD2PA,0BAFJ,kBAGI,OAAA,KAEA,6BACA,OAAA,KjB20EH,QAAA,IAAA,KiBj1EC,UAAW,KAST,YAAA,IACA,cAAA,IAVJ,mChBg2EE,OAAQ,KgBl1EN,YAAA,KAGA,6CAjBJ,qCAkBI,OAAA,KAEA,oCACA,OAAA,KjB20EH,WAAA,KiBv0EC,QAAS,IAAI,KC/Rb,UAAA,KACA,YAAA,IAEA,UACA,OAAA,KlBymFD,QAAA,KAAA,KkBvmFC,UAAA,KACE,YAAA,UACA,cAAA,IAGF,gBjBinFA,OAAQ,KiB/mFN,YAAA,KDuRA,0BAFJ,kBAGI,OAAA,KAEA,6BACA,OAAA,KjBo1EH,QAAA,KAAA,KiB11EC,UAAW,KAST,YAAA,UACA,cAAA,IAVJ,mChBy2EE,OAAQ,KgB31EN,YAAA,KAGA,6CAjBJ,qCAkBI,OAAA,KAEA,oCACA,OAAA,KjBo1EH,WAAA,KiB30EC,QAAS,KAAK,KAEd,UAAA,KjB40ED,YAAA,UiBx0EG,cjB20EH,SAAA,SiBt0EC,4BACA,cAAA,OAEA,uBACA,SAAA,SACA,IAAA,EACA,MAAA,EACA,QAAA,EACA,QAAA,MACA,MAAA,KjBy0ED,OAAA,KiBv0EC,YAAa,KhBk1Eb,WAAY,OACZ,eAAgB,KDLjB,oDiBz0EC,uCADA,iCAGA,MAAO,KhBk1EP,OAAQ,KACR,YAAa,KDLd,oDiBz0EC,uCADA,iCAKA,MAAO,KhBg1EP,OAAQ,KACR,YAAa,KAKf,uBAEA,8BAJA,4BADA,yBAEA,oBAEA,2BDNC,4BkBvuFG,mCAJA,yBD0ZJ,gCbvWE,MAAA,QJ6rFD,2BkB1uFG,aAAA,QACE,mBAAA,MAAA,EAAA,IAAA,IAAA,iBd4CJ,WAAA,MAAA,EAAA,IAAA,IAAA,iBJksFD,iCiB31EC,aAAc,QC5YZ,mBAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QACA,WAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QlB2uFH,gCiBh2EC,MAAO,QCtYL,iBAAA,QlByuFH,aAAA,QCWD,oCACE,MAAO,QAKT,uBAEA,8BAJA,4BADA,yBAEA,oBAEA,2BDNC,4BkBrwFG,mCAJA,yBD6ZJ,gCb1WE,MAAA,QJ2tFD,2BkBxwFG,aAAA,QACE,mBAAA,MAAA,EAAA,IAAA,IAAA,iBd4CJ,WAAA,MAAA,EAAA,IAAA,IAAA,iBJguFD,iCiBt3EC,aAAc,QC/YZ,mBAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QACA,WAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QlBywFH,gCiB33EC,MAAO,QCzYL,iBAAA,QlBuwFH,aAAA,QCWD,oCACE,MAAO,QAKT,qBAEA,4BAJA,0BADA,uBAEA,kBAEA,yBDNC,0BkBnyFG,iCAJA,uBDgaJ,8Bb7WE,MAAA,QJyvFD,yBkBtyFG,aAAA,QACE,mBAAA,MAAA,EAAA,IAAA,IAAA,iBd4CJ,WAAA,MAAA,EAAA,IAAA,IAAA,iBJ8vFD,+BiBj5EC,aAAc,QClZZ,mBAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QACA,WAAA,MAAA,EAAA,IAAA,IAAA,iBAAA,EAAA,EAAA,IAAA,QlBuyFH,8BiBt5EC,MAAO,QC5YL,iBAAA,QlBqyFH,aAAA,QiBj5EG,kCjBo5EH,MAAA,QiBj5EG,2CjBo5EH,IAAA,KiBz4EC,mDACA,IAAA,EAEA,YjB44ED,QAAA,MiBzzEC,WAAY,IAwEZ,cAAe,KAtIX,MAAA,QAEA,yBjB23EH,yBiBvvEC,QAAS,aA/HP,cAAA,EACA,eAAA,OjB03EH,2BiB5vEC,QAAS,aAxHP,MAAA,KjBu3EH,eAAA,OiBn3EG,kCACA,QAAA,aAmHJ,0BhB8wEE,QAAS,aACT,eAAgB,OgBv3Ed,wCjBg3EH,6CiBxwED,2CjB2wEC,MAAA,KiB/2EG,wCACA,MAAA,KAmGJ,4BhB0xEE,cAAe,EgBt3Eb,eAAA,OAGA,uBADA,oBjBg3EH,QAAA,aiBtxEC,WAAY,EhBiyEZ,cAAe,EgBv3EX,eAAA,OAsFN,6BAAA,0BAjFI,aAAA,EAiFJ,4CjB+xEC,sCiB12EG,SAAA,SjB62EH,YAAA,EiBl2ED,kDhB82EE,IAAK,GgBp2EL,2BjBi2EH,kCiBl2EG,wBAEA,+BAXF,YAAa,IhBs3Eb,WAAY,EgBr2EV,cAAA,EJviBF,2BIshBF,wBJrhBE,WAAA,KI4jBA,6BAyBA,aAAc,MAnCV,YAAA,MAEA,yBjB01EH,gCACF,YAAA,IiB13EG,cAAe,EAwCf,WAAA,OAwBJ,sDAdQ,MAAA,KjBg1EL,yBACF,+CiBr0EC,YAAA,KAEE,UAAW,MjBw0EZ,yBACF,+CmBt6FG,YAAa,IACf,UAAA,MAGA,KACA,QAAA,aACA,QAAA,IAAA,KAAA,cAAA,EACA,UAAA,KACA,YAAA,IACA,YAAA,WACA,WAAA,OC0CA,YAAA,OACA,eAAA,OACA,iBAAA,aACA,aAAA,ahB+JA,OAAA,QACG,oBAAA,KACC,iBAAA,KACI,gBAAA,KJiuFT,YAAA,KmBz6FG,iBAAA,KlBq7FF,OAAQ,IAAI,MAAM,YAClB,cAAe,IDHhB,kBKx8FC,kBAEA,WACA,kBJ28FF,kBADA,WkBl7FE,QAAA,KAAA,OlBy7FA,QAAS,IAAI,KAAK,yBAClB,eAAgB,KkBn7FhB,WnB46FD,WmB/6FG,WlB27FF,MAAO,KkBt7FL,gBAAA,Kf6BM,YADR,YJq5FD,iBAAA,KmB56FC,QAAA,ElBw7FA,mBAAoB,MAAM,EAAE,IAAI,IAAI,iBAC5B,WAAY,MAAM,EAAE,IAAI,IAAI,iBoBn+FpC,cAGA,ejB8DA,wBACQ,OAAA,YJ65FT,OAAA,kBmB56FG,mBAAA,KlBw7FM,WAAY,KkBt7FhB,QAAA,IASN,eC3DE,yBACA,eAAA,KpBo+FD,aoBj+FC,MAAA,KnB6+FA,iBAAkB,KmB3+FhB,aAAA,KpBq+FH,mBoBn+FO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBo+FH,mBoBj+FC,MAAA,KnB6+FA,iBAAkB,QAClB,aAAc,QmBz+FR,oBADJ,oBpBo+FH,mCoBj+FG,MAAA,KnB6+FF,iBAAkB,QAClB,aAAc,QmBz+FN,0BnB++FV,0BAHA,0BmB7+FM,0BnB++FN,0BAHA,0BDFC,yCoB3+FK,yCnB++FN,yCmB1+FE,MAAA,KnBk/FA,iBAAkB,QAClB,aAAc,QmB3+FZ,oBpBm+FH,oBoBn+FG,mCnBg/FF,iBAAkB,KmB5+FV,4BnBi/FV,4BAHA,4BDHC,6BCOD,6BAHA,6BkB99FA,sCClBM,sCnBi/FN,sCmB3+FI,iBAAA,KACA,aAAA,KDcJ,oBC9DE,MAAA,KACA,iBAAA,KpB6hGD,aoB1hGC,MAAA,KnBsiGA,iBAAkB,QmBpiGhB,aAAA,QpB8hGH,mBoB5hGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpB6hGH,mBoB1hGC,MAAA,KnBsiGA,iBAAkB,QAClB,aAAc,QmBliGR,oBADJ,oBpB6hGH,mCoB1hGG,MAAA,KnBsiGF,iBAAkB,QAClB,aAAc,QmBliGN,0BnBwiGV,0BAHA,0BmBtiGM,0BnBwiGN,0BAHA,0BDFC,yCoBpiGK,yCnBwiGN,yCmBniGE,MAAA,KnB2iGA,iBAAkB,QAClB,aAAc,QmBpiGZ,oBpB4hGH,oBoB5hGG,mCnByiGF,iBAAkB,KmBriGV,4BnB0iGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBphGA,sCCrBM,sCnB0iGN,sCmBpiGI,iBAAA,QACA,aAAA,QDkBJ,oBClEE,MAAA,QACA,iBAAA,KpBslGD,aoBnlGC,MAAA,KnB+lGA,iBAAkB,QmB7lGhB,aAAA,QpBulGH,mBoBrlGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBslGH,mBoBnlGC,MAAA,KnB+lGA,iBAAkB,QAClB,aAAc,QmB3lGR,oBADJ,oBpBslGH,mCoBnlGG,MAAA,KnB+lGF,iBAAkB,QAClB,aAAc,QmB3lGN,0BnBimGV,0BAHA,0BmB/lGM,0BnBimGN,0BAHA,0BDFC,yCoB7lGK,yCnBimGN,yCmB5lGE,MAAA,KnBomGA,iBAAkB,QAClB,aAAc,QmB7lGZ,oBpBqlGH,oBoBrlGG,mCnBkmGF,iBAAkB,KmB9lGV,4BnBmmGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBzkGA,sCCzBM,sCnBmmGN,sCmB7lGI,iBAAA,QACA,aAAA,QDsBJ,oBCtEE,MAAA,QACA,iBAAA,KpB+oGD,UoB5oGC,MAAA,KnBwpGA,iBAAkB,QmBtpGhB,aAAA,QpBgpGH,gBoB9oGO,gBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpB+oGH,gBoB5oGC,MAAA,KnBwpGA,iBAAkB,QAClB,aAAc,QmBppGR,iBADJ,iBpB+oGH,gCoB5oGG,MAAA,KnBwpGF,iBAAkB,QAClB,aAAc,QmBppGN,uBnB0pGV,uBAHA,uBmBxpGM,uBnB0pGN,uBAHA,uBDFC,sCoBtpGK,sCnB0pGN,sCmBrpGE,MAAA,KnB6pGA,iBAAkB,QAClB,aAAc,QmBtpGZ,iBpB8oGH,iBoB9oGG,gCnB2pGF,iBAAkB,KmBvpGV,yBnB4pGV,yBAHA,yBDHC,0BCOD,0BAHA,0BkB9nGA,mCC7BM,mCnB4pGN,mCmBtpGI,iBAAA,QACA,aAAA,QD0BJ,iBC1EE,MAAA,QACA,iBAAA,KpBwsGD,aoBrsGC,MAAA,KnBitGA,iBAAkB,QmB/sGhB,aAAA,QpBysGH,mBoBvsGO,mBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBwsGH,mBoBrsGC,MAAA,KnBitGA,iBAAkB,QAClB,aAAc,QmB7sGR,oBADJ,oBpBwsGH,mCoBrsGG,MAAA,KnBitGF,iBAAkB,QAClB,aAAc,QmB7sGN,0BnBmtGV,0BAHA,0BmBjtGM,0BnBmtGN,0BAHA,0BDFC,yCoB/sGK,yCnBmtGN,yCmB9sGE,MAAA,KnBstGA,iBAAkB,QAClB,aAAc,QmB/sGZ,oBpBusGH,oBoBvsGG,mCnBotGF,iBAAkB,KmBhtGV,4BnBqtGV,4BAHA,4BDHC,6BCOD,6BAHA,6BkBnrGA,sCCjCM,sCnBqtGN,sCmB/sGI,iBAAA,QACA,aAAA,QD8BJ,oBC9EE,MAAA,QACA,iBAAA,KpBiwGD,YoB9vGC,MAAA,KnB0wGA,iBAAkB,QmBxwGhB,aAAA,QpBkwGH,kBoBhwGO,kBAEN,MAAA,KACE,iBAAA,QACA,aAAA,QpBiwGH,kBoB9vGC,MAAA,KnB0wGA,iBAAkB,QAClB,aAAc,QmBtwGR,mBADJ,mBpBiwGH,kCoB9vGG,MAAA,KnB0wGF,iBAAkB,QAClB,aAAc,QmBtwGN,yBnB4wGV,yBAHA,yBmB1wGM,yBnB4wGN,yBAHA,yBDFC,wCoBxwGK,wCnB4wGN,wCmBvwGE,MAAA,KnB+wGA,iBAAkB,QAClB,aAAc,QmBxwGZ,mBpBgwGH,mBoBhwGG,kCnB6wGF,iBAAkB,KmBzwGV,2BnB8wGV,2BAHA,2BDHC,4BCOD,4BAHA,4BkBxuGA,qCCrCM,qCnB8wGN,qCmBxwGI,iBAAA,QACA,aAAA,QDuCJ,mBACE,MAAA,QACA,iBAAA,KnBkuGD,UmB/tGC,YAAA,IlB2uGA,MAAO,QACP,cAAe,EAEjB,UG5wGE,iBemCE,iBflCM,oBJqwGT,6BmBhuGC,iBAAA,YlB4uGA,mBAAoB,KACZ,WAAY,KkBzuGlB,UAEF,iBAAA,gBnBguGD,gBmB9tGG,aAAA,YnBouGH,gBmBluGG,gBAIA,MAAA,QlB0uGF,gBAAiB,UACjB,iBAAkB,YDNnB,0BmBnuGK,0BAUN,mCATM,mClB8uGJ,MAAO,KmB7yGP,gBAAA,KAGA,mBADA,QpBsyGD,QAAA,KAAA,KmB5tGC,UAAW,KlBwuGX,YAAa,UmBpzGb,cAAA,IAGA,mBADA,QpB6yGD,QAAA,IAAA,KmB/tGC,UAAW,KlB2uGX,YAAa,ImB3zGb,cAAA,IAGA,mBADA,QpBozGD,QAAA,IAAA,ImB9tGC,UAAW,KACX,YAAA,IACA,cAAA,IAIF,WACE,QAAA,MnB8tGD,MAAA,KCYD,sBACE,WAAY,IqB53GZ,6BADF,4BtBq3GC,6BIhsGC,MAAA,KAEQ,MJosGT,QAAA,EsBx3GC,mBAAA,QAAA,KAAA,OACE,cAAA,QAAA,KAAA,OtB03GH,WAAA,QAAA,KAAA,OsBr3GC,StBw3GD,QAAA,EsBt3Ga,UtBy3Gb,QAAA,KsBx3Ga,atB23Gb,QAAA,MsB13Ga,etB63Gb,QAAA,UsBz3GC,kBACA,QAAA,gBlBwKA,YACQ,SAAA,SAAA,OAAA,EAOR,SAAA,OACQ,mCAAA,KAAA,8BAAA,KAGR,2BAAA,KACQ,4BAAA,KAAA,uBAAA,KJ8sGT,oBAAA,KuBx5GC,4BAA6B,OAAQ,WACrC,uBAAA,OAAA,WACA,oBAAA,OAAA,WAEA,OACA,QAAA,aACA,MAAA,EACA,OAAA,EACA,YAAA,IACA,eAAA,OvB05GD,WAAA,IAAA,OuBt5GC,WAAY,IAAI,QtBq6GhB,aAAc,IAAI,MAAM,YsBn6GxB,YAAA,IAAA,MAAA,YAKA,UADF,QvBu5GC,SAAA,SuBj5GC,uBACA,QAAA,EAEA,eACA,SAAA,SACA,IAAA,KACA,KAAA,EACA,QAAA,KACA,QAAA,KACA,MAAA,KACA,UAAA,MACA,QAAA,IAAA,EACA,OAAA,IAAA,EAAA,EACA,UAAA,KACA,WAAA,KACA,WAAA,KnBsBA,iBAAA,KACQ,wBAAA,YmBrBR,gBAAA,YtBk6GA,OsBl6GA,IAAA,MAAA,KvBq5GD,OAAA,IAAA,MAAA,gBuBh5GC,cAAA,IACE,mBAAA,EAAA,IAAA,KAAA,iBACA,WAAA,EAAA,IAAA,KAAA,iBAzBJ,0BCzBE,MAAA,EACA,KAAA,KAEA,wBxBu8GD,OAAA,IuBj7GC,OAAQ,IAAI,EAmCV,SAAA,OACA,iBAAA,QAEA,oBACA,QAAA,MACA,QAAA,IAAA,KACA,MAAA,KvBi5GH,YAAA,IuB34GC,YAAA,WtB25GA,MAAO,KsBz5GL,YAAA,OvB+4GH,0BuB74GG,0BAMF,MAAA,QtBu5GA,gBAAiB,KACjB,iBAAkB,QsBp5GhB,yBAEA,+BADA,+BvB04GH,MAAA,KuBh4GC,gBAAA,KtBg5GA,iBAAkB,QAClB,QAAS,EDZV,2BuB93GC,iCAAA,iCAEE,MAAA,KEzGF,iCF2GE,iCAEA,gBAAA,KvBg4GH,OAAA,YuB33GC,iBAAkB,YAGhB,iBAAA,KvB23GH,OAAA,0DuBt3GG,qBvBy3GH,QAAA,MuBh3GC,QACA,QAAA,EAQF,qBACE,MAAA,EACA,KAAA,KAIF,oBACE,MAAA,KACA,KAAA,EAEA,iBACA,QAAA,MACA,QAAA,IAAA,KvB22GD,UAAA,KuBv2GC,YAAa,WACb,MAAA,KACA,YAAA,OAEA,mBACA,SAAA,MACA,IAAA,EvBy2GD,MAAA,EuBr2GC,OAAQ,EACR,KAAA,EACA,QAAA,IAQF,2BtB+2GE,MAAO,EsB32GL,KAAA,KAEA,eACA,sCvB+1GH,QAAA,GuBt2GC,WAAY,EtBs3GZ,cAAe,IAAI,OsB32GjB,cAAA,IAAA,QAEA,uBvB+1GH,8CuB10GC,IAAK,KAXL,OAAA,KApEA,cAAA,IvB85GC,yBuB11GD,6BA1DA,MAAA,EACA,KAAA,KvBw5GD,kC0BviHG,MAAO,KzBujHP,KAAM,GyBnjHR,W1ByiHD,oB0B7iHC,SAAU,SzB6jHV,QAAS,ayBvjHP,eAAA,OAGA,yB1ByiHH,gBCgBC,SAAU,SACV,MAAO,KyBhjHT,gC1ByiHC,gCCYD,+BAFA,+ByBnjHA,uBANM,uBzB0jHN,sBAFA,sBAQE,QAAS,EyBrjHP,qB1B0iHH,2B0BriHD,2BACE,iC1BuiHD,YAAA,KCgBD,aACE,YAAa,KDZd,kB0B7iHD,wBAAA,0BzB8jHE,MAAO,KDZR,kB0BliHD,wBACE,0B1BoiHD,YAAA,I0B/hHC,yE1BkiHD,cAAA,E2BnlHC,4BACG,YAAA,EDsDL,mEzBgjHE,wBAAyB,E0B/lHzB,2BAAA,E3BolHD,6C0B/hHD,8CACE,uBAAA,E1BiiHD,0BAAA,E0B9hHC,sB1BiiHD,MAAA,KCgBD,8D0BlnHE,cAAA,E3BumHD,mE0B9hHD,oECjEE,wBAAA,EACG,2BAAA,EDqEL,oEzB6iHE,uBAAwB,EyB3iHxB,0BAAA,EAiBF,mCACE,iCACA,QAAA,EAEF,iCACE,cAAA,IACA,aAAA,IAKF,oCtB/CE,cAAA,KACQ,aAAA,KsBkDR,iCtBnDA,mBAAA,MAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,iBsByDV,0CACE,mBAAA,K1B0gHD,WAAA,K0BtgHC,YACA,YAAA,EAGF,eACE,aAAA,IAAA,IAAA,E1BwgHD,oBAAA,ECgBD,uBACE,aAAc,EAAE,IAAI,IyB7gHlB,yBACA,+BACA,oC1BkgHH,QAAA,M0BzgHC,MAAO,KAcH,MAAA,K1B8/GL,UAAA,KCgBD,oCACE,MAAO,KyBvgHL,8BACA,oC1B4/GH,oC0Bv/GC,0CACE,WAAA,K1By/GH,YAAA,E2BlqHC,4DACC,cAAA,EAQA,sD3B+pHF,uBAAA,I0Bz/GC,wBAAA,IC/KA,2BAAA,EACC,0BAAA,EAQA,sD3BqqHF,uBAAA,E0B1/GC,wBAAyB,EACzB,2BAAA,I1B4/GD,0BAAA,ICgBD,uE0BzrHE,cAAA,E3B8qHD,4E0Bz/GD,6EC7LE,2BAAA,EACC,0BAAA,EDoMH,6EACE,uBAAA,EACA,wBAAA,EAEA,qB1Bu/GD,QAAA,M0B3/GC,MAAO,KzB2gHP,aAAc,MyBpgHZ,gBAAA,SAEA,0B1Bw/GH,gC0BjgHC,QAAS,WAYP,MAAA,K1Bw/GH,MAAA,G0Bp/GG,qC1Bu/GH,MAAA,KCgBD,+CACE,KAAM,KyBh/GF,gDAFA,6C1By+GL,2D0Bx+GK,wDEzOJ,SAAU,SACV,KAAA,cACA,eAAA,K5BotHD,a4BhtHC,SAAA,SACE,QAAA,MACA,gBAAA,S5BmtHH,0B4B3tHC,MAAO,KAeL,cAAA,EACA,aAAA,EAOA,2BACA,SAAA,S5B0sHH,QAAA,E4BxsHG,MAAA,KACE,MAAA,K5B0sHL,cAAA,ECgBD,iCACE,QAAS,EiBtrHT,8BACA,mCACA,sCACA,OAAA,KlB2qHD,QAAA,KAAA,KkBzqHC,UAAA,KjByrHA,YAAa,UACb,cAAe,IiBxrHb,oClB6qHH,yCkB1qHC,4CjB0rHA,OAAQ,KACR,YAAa,KDTd,8C4BltHD,mDAAA,sD3B6tHA,sCACA,2CiB5rHI,8CjBisHF,OAAQ,KiB7sHR,8BACA,mCACA,sCACA,OAAA,KlBksHD,QAAA,IAAA,KkBhsHC,UAAA,KjBgtHA,YAAa,IACb,cAAe,IiB/sHb,oClBosHH,yCkBjsHC,4CjBitHA,OAAQ,KACR,YAAa,KDTd,8C4BhuHD,mDAAA,sD3B2uHA,sCACA,2CiBntHI,8CjBwtHF,OAAQ,K2B5uHR,2B5BguHD,mB4BhuHC,iB3BivHA,QAAS,W2B5uHX,8D5BguHC,sD4BhuHD,oDAEE,cAAA,EAEA,mB5BkuHD,iB4B7tHC,MAAO,GACP,YAAA,OACA,eAAA,OAEA,mBACA,QAAA,IAAA,KACA,UAAA,KACA,YAAA,IACA,YAAA,EACA,MAAA,K5B+tHD,WAAA,O4B5tHC,iBAAA,KACE,OAAA,IAAA,MAAA,KACA,cAAA,I5B+tHH,4B4B5tHC,QAAA,IAAA,KACE,UAAA,KACA,cAAA,I5B+tHH,4B4BlvHC,QAAS,KAAK,K3BkwHd,UAAW,K2BxuHT,cAAA,IAKJ,wCAAA,qC3BwuHE,WAAY,EAEd,uCACA,+BACA,kC0Bh1HE,6CACG,8CC4GL,6D5BwtHC,wE4BvtHC,wBAAA,E5B0tHD,2BAAA,ECgBD,+BACE,aAAc,EAEhB,sCACA,8B2BnuHA,+D5BytHC,oDCWD,iC0Br1HE,4CACG,6CCiHH,uBAAA,E5B2tHD,0BAAA,E4BrtHC,8BAGA,YAAA,E5ButHD,iB4B3tHC,SAAU,SAUR,UAAA,E5BotHH,YAAA,O4BltHK,sB5BqtHL,SAAA,SCgBD,2BACE,YAAa,K2B3tHb,6BAAA,4B5B+sHD,4B4B5sHK,QAAA,EAGJ,kCAAA,wCAGI,aAAA,K5B+sHL,iC6B72HD,uCACE,QAAA,EACA,YAAA,K7Bg3HD,K6Bl3HC,aAAc,EAOZ,cAAA,EACA,WAAA,KARJ,QAWM,SAAA,SACA,QAAA,M7B+2HL,U6B72HK,SAAA,S5B63HJ,QAAS,M4B33HH,QAAA,KAAA,KAMJ,gB7B02HH,gB6Bz2HK,gBAAA,K7B42HL,iBAAA,KCgBD,mB4Bx3HQ,MAAA,KAGA,yBADA,yB7B62HP,MAAA,K6Br2HG,gBAAA,K5Bq3HF,OAAQ,YACR,iBAAkB,Y4Bl3Hd,aAzCN,mB7Bg5HC,mBwBn5HC,iBAAA,KACA,aAAA,QAEA,kBxBs5HD,OAAA,I6Bt5HC,OAAQ,IAAI,EA0DV,SAAA,O7B+1HH,iBAAA,Q6Br1HC,c7Bw1HD,UAAA,K6Bt1HG,UAEA,cAAA,IAAA,MAAA,KALJ,aASM,MAAA,KACA,cAAA,KAEA,e7Bu1HL,aAAA,I6Bt1HK,YAAA,WACE,OAAA,IAAA,MAAA,Y7Bw1HP,cAAA,IAAA,IAAA,EAAA,ECgBD,qBACE,aAAc,KAAK,KAAK,K4B/1HlB,sBAEA,4BADA,4BAEA,MAAA,K7Bo1HP,OAAA,Q6B/0HC,iBAAA,KAqDA,OAAA,IAAA,MAAA,KA8BA,oBAAA,YAnFA,wBAwDE,MAAA,K7B8xHH,cAAA,E6B5xHK,2BACA,MAAA,KA3DJ,6BAgEE,cAAA,IACA,WAAA,OAYJ,iDA0DE,IAAK,KAjED,KAAA,K7B6xHH,yB6B5tHD,2BA9DM,QAAA,W7B6xHL,MAAA,G6Bt2HD,6BAuFE,cAAA,GAvFF,6B5B23HA,aAAc,EACd,cAAe,IDZhB,kC6BzuHD,wCA3BA,wCATM,OAAA,IAAA,MAAA,K7BkxHH,yB6B9uHD,6B5B8vHE,cAAe,IAAI,MAAM,KACzB,cAAe,IAAI,IAAI,EAAE,EDZ1B,kC6Bj3HD,wC7Bk3HD,wC6Bh3HG,oBAAA,MAIE,c7Bk3HL,MAAA,K6B/2HK,gB7Bk3HL,cAAA,ICgBD,iBACE,YAAa,I4B13HP,uBAQR,6B7Bu2HC,6B6Br2HG,MAAA,K7Bw2HH,iBAAA,Q6Bt2HK,gBACA,MAAA,KAYN,mBACE,WAAA,I7B+1HD,YAAA,E6B51HG,e7B+1HH,MAAA,K6B71HK,kBACA,MAAA,KAPN,oBAYI,cAAA,IACA,WAAA,OAYJ,wCA0DE,IAAK,KAjED,KAAA,K7B81HH,yB6B7xHD,kBA9DM,QAAA,W7B81HL,MAAA,G6Br1HD,oBACA,cAAA,GAIE,oBACA,cAAA,EANJ,yB5B62HE,aAAc,EACd,cAAe,IDZhB,8B6B7yHD,oCA3BA,oCATM,OAAA,IAAA,MAAA,K7Bs1HH,yB6BlzHD,yB5Bk0HE,cAAe,IAAI,MAAM,KACzB,cAAe,IAAI,IAAI,EAAE,EDZ1B,8B6B30HD,oC7B40HD,oC6B10HG,oBAAA,MAGA,uB7B60HH,QAAA,K6Bl0HC,qBF3OA,QAAA,M3BkjID,yB8B3iIC,WAAY,KACZ,uBAAA,EACA,wBAAA,EAEA,Q9B6iID,SAAA,S8BriIC,WAAY,KA8nBZ,cAAe,KAhoBb,OAAA,IAAA,MAAA,Y9B4iIH,yB8B5hIC,QAgnBE,cAAe,K9Bi7GlB,yB8BphIC,eACA,MAAA,MAGA,iBACA,cAAA,KAAA,aAAA,KAEA,WAAA,Q9BqhID,2BAAA,M8BnhIC,WAAA,IAAA,MAAA,YACE,mBAAA,MAAA,EAAA,IAAA,EAAA,qB9BqhIH,WAAA,MAAA,EAAA,IAAA,EAAA,qB8B57GD,oBArlBI,WAAA,KAEA,yBAAA,iB9BqhID,MAAA,K8BnhIC,WAAA,EACE,mBAAA,KACA,WAAA,KAEA,0B9BqhIH,QAAA,gB8BlhIC,OAAA,eACE,eAAA,E9BohIH,SAAA,kBCkBD,oBACE,WAAY,QDZf,sC8BlhIK,mC9BihIH,oC8B5gIC,cAAe,E7B+hIf,aAAc,G6Bp+GlB,sCAnjBE,mC7B4hIA,WAAY,MDdX,4D8BtgID,sC9BugID,mCCkBG,WAAY,O6B9gId,kCANE,gC9BygIH,4B8B1gIG,0BAuiBF,aAAc,M7Bs/Gd,YAAa,MAEf,yBDZC,kC8B9gIK,gC9B6gIH,4B8B9gIG,0BAcF,aAAc,EAChB,YAAA,GAMF,mBA8gBE,QAAS,KAhhBP,aAAA,EAAA,EAAA,I9BqgIH,yB8BhgIC,mB7BkhIE,cAAe,G6B7gIjB,qBADA,kB9BmgID,SAAA,M8B5/HC,MAAO,EAggBP,KAAM,E7B+gHN,QAAS,KDdR,yB8BhgID,qB9BigID,kB8BhgIC,cAAA,GAGF,kBACE,IAAA,EACA,aAAA,EAAA,EAAA,I9BogID,qB8B7/HC,OAAQ,EACR,cAAA,EACA,aAAA,IAAA,EAAA,EAEA,cACA,MAAA,K9B+/HD,OAAA,K8B7/HC,QAAA,KAAA,K7B+gIA,UAAW,K6B7gIT,YAAA,KAIA,oBAbJ,oB9B2gIC,gBAAA,K8B1/HG,kB7B6gIF,QAAS,MDdR,yBACF,iC8Bn/HC,uCACA,YAAA,OAGA,eC9LA,SAAA,SACA,MAAA,MD+LA,QAAA,IAAA,KACA,WAAA,IACA,aAAA,KACA,cAAA,I9Bs/HD,iBAAA,Y8Bl/HC,iBAAA,KACE,OAAA,IAAA,MAAA,Y9Bo/HH,cAAA,I8B/+HG,qBACA,QAAA,EAEA,yB9Bk/HH,QAAA,M8BxgIC,MAAO,KAyBL,OAAA,I9Bk/HH,cAAA,I8BvjHD,mCAvbI,WAAA,I9Bm/HH,yB8Bz+HC,eACA,QAAA,MAGE,YACA,OAAA,MAAA,M9B4+HH,iB8B/8HC,YAAA,KA2YA,eAAgB,KAjaZ,YAAA,KAEA,yBACA,iCACA,SAAA,OACA,MAAA,KACA,MAAA,KAAA,WAAA,E9By+HH,iBAAA,Y8B9kHC,OAAQ,E7BimHR,mBAAoB,K6Bz/HhB,WAAA,KAGA,kDAqZN,sC9BqlHC,QAAA,IAAA,KAAA,IAAA,KCmBD,sC6B1/HQ,YAAA,KAmBR,4C9By9HD,4C8B1lHG,iBAAkB,M9B+lHnB,yB8B/lHD,YAtYI,MAAA,K9Bw+HH,OAAA,E8Bt+HK,eACA,MAAA,K9B0+HP,iB8B99HG,YAAa,KACf,eAAA,MAGA,aACA,QAAA,KAAA,K1B9NA,WAAA,IACQ,aAAA,M2B/DR,cAAA,IACA,YAAA,M/B+vID,WAAA,IAAA,MAAA,YiBzuHC,cAAe,IAAI,MAAM,YAwEzB,mBAAoB,MAAM,EAAE,IAAI,EAAE,qBAAyB,EAAE,IAAI,EAAE,qBAtI/D,WAAA,MAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,qBAEA,yBjB2yHH,yBiBvqHC,QAAS,aA/HP,cAAA,EACA,eAAA,OjB0yHH,2BiB5qHC,QAAS,aAxHP,MAAA,KjBuyHH,eAAA,OiBnyHG,kCACA,QAAA,aAmHJ,0BhBssHE,QAAS,aACT,eAAgB,OgB/yHd,wCjBgyHH,6CiBxrHD,2CjB2rHC,MAAA,KiB/xHG,wCACA,MAAA,KAmGJ,4BhBktHE,cAAe,EgB9yHb,eAAA,OAGA,uBADA,oBjBgyHH,QAAA,aiBtsHC,WAAY,EhBytHZ,cAAe,EgB/yHX,eAAA,OAsFN,6BAAA,0BAjFI,aAAA,EAiFJ,4CjB+sHC,sCiB1xHG,SAAA,SjB6xHH,YAAA,E8BtgID,kDAmWE,IAAK,GAvWH,yBACE,yB9BihIL,cAAA,I8B//HD,oCAoVE,cAAe,GA1Vf,yBACA,aACA,MAAA,KACA,YAAA,E1BzPF,eAAA,EACQ,aAAA,EJswIP,YAAA,EACF,OAAA,E8BtgIG,mBAAoB,KACtB,WAAA,M9B0gID,8B8BtgIC,WAAY,EACZ,uBAAA,EHzUA,wBAAA,EAQA,mDACC,cAAA,E3B40IF,uBAAA,I8BlgIC,wBAAyB,IChVzB,2BAAA,EACA,0BAAA,EDkVA,YCnVA,WAAA,IACA,cAAA,IDqVA,mBCtVA,WAAA,KACA,cAAA,KD+VF,mBChWE,WAAA,KACA,cAAA,KDuWF,aAsSE,WAAY,KA1SV,cAAA,KAEA,yB9BkgID,aACF,MAAA,K8Br+HG,aAAc,KAhBhB,YAAA,MACA,yBE5WA,aF8WE,MAAA,eAFF,cAKI,MAAA,gB9B0/HH,aAAA,M8Bh/HD,4BACA,aAAA,GADF,gBAKI,iBAAA,Q9Bm/HH,aAAA,QCmBD,8B6BngIM,MAAA,KARN,oC9B6/HC,oC8B/+HG,MAAA,Q9Bk/HH,iBAAA,Y8B7+HK,6B9Bg/HL,MAAA,KCmBD,iC6B//HQ,MAAA,KAKF,uC9B4+HL,uCCmBC,MAAO,KACP,iBAAkB,Y6B5/HZ,sCAIF,4C9B0+HL,4CCmBC,MAAO,KACP,iBAAkB,Q6B1/HZ,wCAxCR,8C9BohIC,8C8Bt+HG,MAAA,K9By+HH,iBAAA,YCmBD,+B6Bz/HM,aAAA,KAGA,qCApDN,qC9B8hIC,iBAAA,KCmBD,yC6Bv/HI,iBAAA,KAOE,iCAAA,6B7Bq/HJ,aAAc,Q6Bj/HR,oCAiCN,0C9Bk8HD,0C8B9xHC,MAAO,KA7LC,iBAAA,QACA,yB7Bi/HR,sD6B/+HU,MAAA,KAKF,4D9B49HP,4DCmBC,MAAO,KACP,iBAAkB,Y6B5+HV,2DAIF,iE9B09HP,iECmBC,MAAO,KACP,iBAAkB,Q6B1+HV,6D9B69HX,mEADE,mE8B7jIC,MAAO,KA8GP,iBAAA,aAEE,6B9Bo9HL,MAAA,K8B/8HG,mC9Bk9HH,MAAA,KCmBD,0B6Bl+HM,MAAA,KAIA,gCAAA,gC7Bm+HJ,MAAO,K6Bz9HT,0CARQ,0CASN,mD9B08HD,mD8Bz8HC,MAAA,KAFF,gBAKI,iBAAA,K9B68HH,aAAA,QCmBD,8B6B79HM,MAAA,QARN,oC9Bu9HC,oC8Bz8HG,MAAA,K9B48HH,iBAAA,Y8Bv8HK,6B9B08HL,MAAA,QCmBD,iC6Bz9HQ,MAAA,QAKF,uC9Bs8HL,uCCmBC,MAAO,KACP,iBAAkB,Y6Bt9HZ,sCAIF,4C9Bo8HL,4CCmBC,MAAO,KACP,iBAAkB,Q6Bp9HZ,wCAxCR,8C9B8+HC,8C8B/7HG,MAAA,K9Bk8HH,iBAAA,YCmBD,+B6Bl9HM,aAAA,KAGA,qCArDN,qC9Bw/HC,iBAAA,KCmBD,yC6Bh9HI,iBAAA,KAME,iCAAA,6B7B+8HJ,aAAc,Q6B38HR,oCAuCN,0C9Bs5HD,0C8B93HC,MAAO,KAvDC,iBAAA,QAuDV,yBApDU,kE9By7HP,aAAA,Q8Bt7HO,0D9By7HP,iBAAA,QCmBD,sD6Bz8HU,MAAA,QAKF,4D9Bs7HP,4DCmBC,MAAO,KACP,iBAAkB,Y6Bt8HV,2DAIF,iE9Bo7HP,iECmBC,MAAO,KACP,iBAAkB,Q6Bp8HV,6D9Bu7HX,mEADE,mE8B7hIC,MAAO,KA+GP,iBAAA,aAEE,6B9Bm7HL,MAAA,Q8B96HG,mC9Bi7HH,MAAA,KCmBD,0B6Bj8HM,MAAA,QAIA,gCAAA,gC7Bk8HJ,MAAO,KgC1kJT,0CH0oBQ,0CGzoBN,mDjC2jJD,mDiC1jJC,MAAA,KAEA,YACA,QAAA,IAAA,KjC8jJD,cAAA,KiCnkJC,WAAY,KAQV,iBAAA,QjC8jJH,cAAA,IiC3jJK,eACA,QAAA,ajC+jJL,yBiC3kJC,QAAS,EAAE,IAkBT,MAAA,KjC4jJH,QAAA,SkC/kJC,oBACA,MAAA,KAEA,YlCklJD,QAAA,akCtlJC,aAAc,EAOZ,OAAA,KAAA,ElCklJH,cAAA,ICmBD,eiClmJM,QAAA,OAEA,iBACA,oBACA,SAAA,SACA,MAAA,KACA,QAAA,IAAA,KACA,YAAA,KACA,YAAA,WlCmlJL,MAAA,QkCjlJG,gBAAA,KjComJF,iBAAkB,KiCjmJZ,OAAA,IAAA,MAAA,KPVH,6B3B8lJJ,gCkChlJG,YAAA,EjCmmJF,uBAAwB,I0B1nJxB,0BAAA,I3B4mJD,4BkC3kJG,+BjC8lJF,wBAAyB,IACzB,2BAA4B,IiC3lJxB,uBAFA,uBAGA,0BAFA,0BlCilJL,QAAA,EkCzkJG,MAAA,QjC4lJF,iBAAkB,KAClB,aAAc,KAEhB,sBiC1lJM,4BAFA,4BjC6lJN,yBiC1lJM,+BAFA,+BAGA,QAAA,ElC8kJL,MAAA,KkCroJC,OAAQ,QjCwpJR,iBAAkB,QAClB,aAAc,QiCtlJV,wBAEA,8BADA,8BjCulJN,2BiCzlJM,iCjC0lJN,iCDZC,MAAA,KkClkJC,OAAQ,YjCqlJR,iBAAkB,KkChqJd,aAAA,KAEA,oBnCipJL,uBmC/oJG,QAAA,KAAA,KlCkqJF,UAAW,K0B7pJX,YAAA,U3B+oJD,gCmC9oJG,mClCiqJF,uBAAwB,I0B1qJxB,0BAAA,I3B4pJD,+BkC7kJD,kCjCgmJE,wBAAyB,IkChrJrB,2BAAA,IAEA,oBnCiqJL,uBmC/pJG,QAAA,IAAA,KlCkrJF,UAAW,K0B7qJX,YAAA,I3B+pJD,gCmC9pJG,mClCirJF,uBAAwB,I0B1rJxB,0BAAA,I3B4qJD,+BoC9qJD,kCACE,wBAAA,IACA,2BAAA,IAEA,OpCgrJD,aAAA,EoCprJC,OAAQ,KAAK,EAOX,WAAA,OpCgrJH,WAAA,KCmBD,UmChsJM,QAAA,OAEA,YACA,eACA,QAAA,apCirJL,QAAA,IAAA,KoC/rJC,iBAAkB,KnCktJlB,OAAQ,IAAI,MAAM,KmC/rJd,cAAA,KAnBN,kBpCosJC,kBCmBC,gBAAiB,KmC5rJb,iBAAA,KA3BN,eAAA,kBAkCM,MAAA,MAlCN,mBAAA,sBnCguJE,MAAO,KmCrrJH,mBAEA,yBADA,yBpCwqJL,sBqCrtJC,MAAO,KACP,OAAA,YACA,iBAAA,KAEA,OACA,QAAA,OACA,QAAA,KAAA,KAAA,KACA,UAAA,IACA,YAAA,IACA,YAAA,EACA,MAAA,KrCutJD,WAAA,OqCntJG,YAAA,OpCsuJF,eAAgB,SoCpuJZ,cAAA,MrCutJL,cqCrtJK,cAKJ,MAAA,KACE,gBAAA,KrCktJH,OAAA,QqC7sJG,aACA,QAAA,KAOJ,YCtCE,SAAA,StCkvJD,IAAA,KCmBD,eqChwJM,iBAAA,KALJ,2BD0CF,2BrC+sJC,iBAAA,QCmBD,eqCvwJM,iBAAA,QALJ,2BD8CF,2BrCktJC,iBAAA,QCmBD,eqC9wJM,iBAAA,QALJ,2BDkDF,2BrCqtJC,iBAAA,QCmBD,YqCrxJM,iBAAA,QALJ,wBDsDF,wBrCwtJC,iBAAA,QCmBD,eqC5xJM,iBAAA,QALJ,2BD0DF,2BrC2tJC,iBAAA,QCmBD,cqCnyJM,iBAAA,QCDJ,0BADF,0BAEE,iBAAA,QAEA,OACA,QAAA,aACA,UAAA,KACA,QAAA,IAAA,IACA,UAAA,KACA,YAAA,IACA,YAAA,EACA,MAAA,KACA,WAAA,OvCwxJD,YAAA,OuCrxJC,eAAA,OACE,iBAAA,KvCuxJH,cAAA,KuClxJG,aACA,QAAA,KAGF,YtCqyJA,SAAU,SsCnyJR,IAAA,KAMA,0BvC+wJH,eCmBC,IAAK,EsChyJD,QAAA,IAAA,IvCmxJL,cuCjxJK,cAKJ,MAAA,KtC+xJA,gBAAiB,KsC7xJf,OAAA,QvC+wJH,+BuC3wJC,4BACE,MAAA,QvC6wJH,iBAAA,KuCzwJG,wBvC4wJH,MAAA,MuCxwJG,+BvC2wJH,aAAA,IwCp0JC,uBACA,YAAA,IAEA,WACA,YAAA,KxCu0JD,eAAA,KwC50JC,cAAe,KvC+1Jf,MAAO,QuCt1JL,iBAAA,KAIA,eAbJ,cAcI,MAAA,QxCu0JH,awCr1JC,cAAe,KAmBb,UAAA,KxCq0JH,YAAA,ICmBD,cuCn1JI,iBAAA,QAEA,sBxCo0JH,4BwC91JC,cAAe,KA8Bb,aAAA,KxCm0JH,cAAA,IwChzJD,sBAfI,UAAA,KxCo0JD,oCwCj0JC,WvCo1JA,YAAa,KuCl1JX,eAAA,KxCo0JH,sBwC1zJD,4BvC60JE,cAAe,KuCj1Jb,aAAA,KC5CJ,ezC+2JD,cyC92JC,UAAA,MAGA,WACA,QAAA,MACA,QAAA,IACA,cAAA,KrCiLA,YAAA,WACK,iBAAA,KACG,OAAA,IAAA,MAAA,KJisJT,cAAA,IyC33JC,mBAAoB,OAAO,IAAI,YxC84J1B,cAAe,OAAO,IAAI,YwCj4J7B,WAAA,OAAA,IAAA,YAKF,iBzC82JD,eCmBC,aAAc,KACd,YAAa,KwC13JX,mBA1BJ,kBzCq4JC,kByC12JG,aAAA,QCzBJ,oBACE,QAAA,IACA,MAAA,KAEA,O1Cy4JD,QAAA,K0C74JC,cAAe,KAQb,OAAA,IAAA,MAAA,YAEA,cAAA,IAVJ,UAeI,WAAA,E1Cq4JH,MAAA,QCmBD,mByCl5JI,YAAA,IArBJ,SAyBI,U1Ck4JH,cAAA,ECmBD,WyC34JE,WAAA,IAFF,mBAAA,mBAMI,cAAA,KAEA,0BACA,0B1C43JH,SAAA,S0Cp3JC,IAAK,KCvDL,MAAA,MACA,MAAA,Q3C+6JD,e0Cz3JC,MAAO,QClDL,iBAAA,Q3C86JH,aAAA,Q2C36JG,kB3C86JH,iBAAA,Q2Ct7JC,2BACA,MAAA,Q3C07JD,Y0Ch4JC,MAAO,QCtDL,iBAAA,Q3Cy7JH,aAAA,Q2Ct7JG,e3Cy7JH,iBAAA,Q2Cj8JC,wBACA,MAAA,Q3Cq8JD,e0Cv4JC,MAAO,QC1DL,iBAAA,Q3Co8JH,aAAA,Q2Cj8JG,kB3Co8JH,iBAAA,Q2C58JC,2BACA,MAAA,Q3Cg9JD,c0C94JC,MAAO,QC9DL,iBAAA,Q3C+8JH,aAAA,Q2C58JG,iB3C+8JH,iBAAA,Q4Ch9JC,0BAAQ,MAAA,QACR,wCAAQ,K5Cs9JP,oBAAA,KAAA,E4Cl9JD,GACA,oBAAA,EAAA,GACA,mCAAQ,K5Cw9JP,oBAAA,KAAA,E4C19JD,GACA,oBAAA,EAAA,GACA,gCAAQ,K5Cw9JP,oBAAA,KAAA,E4Ch9JD,GACA,oBAAA,EAAA,GAGA,UACA,OAAA,KxCsCA,cAAA,KACQ,SAAA,OJ86JT,iBAAA,Q4Ch9JC,cAAe,IACf,mBAAA,MAAA,EAAA,IAAA,IAAA,eACA,WAAA,MAAA,EAAA,IAAA,IAAA,eAEA,cACA,MAAA,KACA,MAAA,EACA,OAAA,KACA,UAAA,KxCyBA,YAAA,KACQ,MAAA,KAyHR,WAAA,OACK,iBAAA,QACG,mBAAA,MAAA,EAAA,KAAA,EAAA,gBJk0JT,WAAA,MAAA,EAAA,KAAA,EAAA,gB4C78JC,mBAAoB,MAAM,IAAI,K3Cw+JzB,cAAe,MAAM,IAAI,K4Cv+J5B,WAAA,MAAA,IAAA,KDEF,sBCAE,gCDAF,iBAAA,yK5Ci9JD,iBAAA,oK4C18JC,iBAAiB,iK3Cs+JjB,wBAAyB,KAAK,KGlhK9B,gBAAA,KAAA,KJ4/JD,qBI1/JS,+BwCmDR,kBAAmB,qBAAqB,GAAG,OAAO,SErElD,aAAA,qBAAA,GAAA,OAAA,S9C+gKD,UAAA,qBAAA,GAAA,OAAA,S6C59JG,sBACA,iBAAA,Q7Cg+JH,wC4C38JC,iBAAkB,yKEzElB,iBAAA,oK9CuhKD,iBAAA,iK6Cp+JG,mBACA,iBAAA,Q7Cw+JH,qC4C/8JC,iBAAkB,yKE7ElB,iBAAA,oK9C+hKD,iBAAA,iK6C5+JG,sBACA,iBAAA,Q7Cg/JH,wC4Cn9JC,iBAAkB,yKEjFlB,iBAAA,oK9CuiKD,iBAAA,iK6Cp/JG,qBACA,iBAAA,Q7Cw/JH,uC+C/iKC,iBAAkB,yKAElB,iBAAA,oK/CgjKD,iBAAA,iK+C7iKG,O/CgjKH,WAAA,KC4BD,mB8CtkKE,WAAA,E/C+iKD,O+C3iKD,YACE,SAAA,O/C6iKD,KAAA,E+CziKC,Y/C4iKD,MAAA,Q+CxiKG,c/C2iKH,QAAA,MC4BD,4B8CjkKE,UAAA,KAGF,aAAA,mBAEE,aAAA,KAGF,YAAA,kB9CkkKE,cAAe,K8C3jKjB,YAHE,Y/CuiKD,a+CniKC,QAAA,W/CsiKD,eAAA,I+CliKC,c/CqiKD,eAAA,O+ChiKC,cACA,eAAA,OAMF,eACE,WAAA,EACA,cAAA,ICvDF,YAEE,aAAA,EACA,WAAA,KAQF,YACE,aAAA,EACA,cAAA,KAGA,iBACA,SAAA,SACA,QAAA,MhDglKD,QAAA,KAAA,KgD7kKC,cAAA,KrB3BA,iBAAA,KACC,OAAA,IAAA,MAAA,KqB6BD,6BACE,uBAAA,IrBvBF,wBAAA,I3BymKD,4BgDvkKC,cAAe,E/CmmKf,2BAA4B,I+CjmK5B,0BAAA,IAFF,kBAAA,uBAKI,MAAA,KAIF,2CAAA,gD/CmmKA,MAAO,K+C/lKL,wBAFA,wBhD4kKH,6BgD3kKG,6BAKF,MAAO,KACP,gBAAA,KACA,iBAAA,QAKA,uB/C+lKA,MAAO,KACP,WAAY,K+C5lKV,0BhDskKH,gCgDrkKG,gCALF,MAAA,K/CsmKA,OAAQ,YACR,iBAAkB,KDxBnB,mDgD/kKC,yDAAA,yD/C4mKA,MAAO,QDxBR,gDgDnkKC,sDAAA,sD/CgmKA,MAAO,K+C5lKL,wBAEA,8BADA,8BhDskKH,QAAA,EgD3kKC,MAAA,K/CumKA,iBAAkB,QAClB,aAAc,QAEhB,iDDpBC,wDCuBD,uDADA,uD+C5mKE,8DAYI,6D/C+lKN,uD+C3mKE,8D/C8mKF,6DAKE,MAAO,QDxBR,8CiD7qKG,oDADF,oDAEE,MAAA,QAEA,yBhD0sKF,MAAO,QgDxsKH,iBAAA,QAFF,0BAAA,+BAKI,MAAA,QAGF,mDAAA,wDhD2sKJ,MAAO,QDtBR,gCiDnrKO,gCAGF,qCAFE,qChD8sKN,MAAO,QACP,iBAAkB,QAEpB,iCgD1sKQ,uCAFA,uChD6sKR,sCDtBC,4CiDtrKO,4CArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,sBhDuuKF,MAAO,QgDruKH,iBAAA,QAFF,uBAAA,4BAKI,MAAA,QAGF,gDAAA,qDhDwuKJ,MAAO,QDtBR,6BiDhtKO,6BAGF,kCAFE,kChD2uKN,MAAO,QACP,iBAAkB,QAEpB,8BgDvuKQ,oCAFA,oChD0uKR,mCDtBC,yCiDntKO,yCArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,yBhDowKF,MAAO,QgDlwKH,iBAAA,QAFF,0BAAA,+BAKI,MAAA,QAGF,mDAAA,wDhDqwKJ,MAAO,QDtBR,gCiD7uKO,gCAGF,qCAFE,qChDwwKN,MAAO,QACP,iBAAkB,QAEpB,iCgDpwKQ,uCAFA,uChDuwKR,sCDtBC,4CiDhvKO,4CArBN,MAAA,KACE,iBAAA,QACA,aAAA,QAEA,wBhDiyKF,MAAO,QgD/xKH,iBAAA,QAFF,yBAAA,8BAKI,MAAA,QAGF,kDAAA,uDhDkyKJ,MAAO,QDtBR,+BiD1wKO,+BAGF,oCAFE,oChDqyKN,MAAO,QACP,iBAAkB,QAEpB,gCgDjyKQ,sCAFA,sChDoyKR,qCDtBC,2CiD7wKO,2CDkGN,MAAO,KACP,iBAAA,QACA,aAAA,QAEF,yBACE,WAAA,EACA,cAAA,IE1HF,sBACE,cAAA,EACA,YAAA,IAEA,O9C0DA,cAAA,KACQ,iBAAA,KJgvKT,OAAA,IAAA,MAAA,YkDtyKC,cAAe,IACf,mBAAA,EAAA,IAAA,IAAA,gBlDwyKD,WAAA,EAAA,IAAA,IAAA,gBkDlyKC,YACA,QAAA,KvBnBC,e3B0zKF,QAAA,KAAA,KkDzyKC,cAAe,IAAI,MAAM,YAMvB,uBAAA,IlDsyKH,wBAAA,IkDhyKC,0CACA,MAAA,QAEA,alDmyKD,WAAA,EkDvyKC,cAAe,EjDm0Kf,UAAW,KACX,MAAO,QDtBR,oBkD7xKC,sBjDqzKF,eiD3zKI,mBAKJ,qBAEE,MAAA,QvBvCA,cACC,QAAA,KAAA,K3By0KF,iBAAA,QkDxxKC,WAAY,IAAI,MAAM,KjDozKtB,2BAA4B,IiDjzK1B,0BAAA,IAHJ,mBAAA,mCAMM,cAAA,ElD2xKL,oCkDtxKG,oDjDkzKF,aAAc,IAAI,EiDhzKZ,cAAA,EvBtEL,4D3Bg2KF,4EkDpxKG,WAAA,EjDgzKF,uBAAwB,IiD9yKlB,wBAAA,IvBtEL,0D3B81KF,0EkD7yKC,cAAe,EvB1Df,2BAAA,IACC,0BAAA,IuB0FH,+EAEI,uBAAA,ElDixKH,wBAAA,EkD7wKC,wDlDgxKD,iBAAA,EC4BD,0BACE,iBAAkB,EiDryKpB,8BlD6wKC,ckD7wKD,gCjD0yKE,cAAe,EiD1yKjB,sCAQM,sBlD2wKL,wCC4BC,cAAe,K0Bx5Kf,aAAA,KuByGF,wDlDwxKC,0BC4BC,uBAAwB,IACxB,wBAAyB,IiDrzK3B,yFAoBQ,yFlD2wKP,2DkD5wKO,2DjDwyKN,uBAAwB,IACxB,wBAAyB,IAK3B,wGiDj0KA,wGjD+zKA,wGDtBC,wGCuBD,0EiDh0KA,0EjD8zKA,0EiDtyKU,0EjD8yKR,uBAAwB,IAK1B,uGiD30KA,uGjDy0KA,uGDtBC,uGCuBD,yEiD10KA,yEjDw0KA,yEiD5yKU,yEvB7HR,wBAAA,IuBiGF,sDlDwzKC,yBC4BC,2BAA4B,IAC5B,0BAA2B,IiD3yKrB,qFA1CR,qFAyCQ,wDlDsxKP,wDC4BC,2BAA4B,IAC5B,0BAA2B,IAG7B,oGDtBC,oGCwBD,oGiDj2KA,oGjD81KA,uEiDhzKU,uEjDkzKV,uEiDh2KA,uEjDs2KE,0BAA2B,IAG7B,mGDtBC,mGCwBD,mGiD32KA,mGjDw2KA,sEiDtzKU,sEjDwzKV,sEiD12KA,sEjDg3KE,2BAA4B,IiDrzK1B,0BlD8xKH,qCkDz1KD,0BAAA,qCA+DI,WAAA,IAAA,MAAA,KA/DJ,kDAAA,kDAmEI,WAAA,EAnEJ,uBAAA,yCjD83KE,OAAQ,EiDpzKA,+CjDwzKV,+CiDl4KA,+CjDo4KA,+CAEA,+CANA,+CDjBC,iECoBD,iEiDn4KA,iEjDq4KA,iEAEA,iEANA,iEAWE,YAAa,EiD9zKL,8CjDk0KV,8CiDh5KA,8CjDk5KA,8CAEA,8CANA,8CDjBC,gECoBD,gEiDj5KA,gEjDm5KA,gEAEA,gEANA,gEAWE,aAAc,EAIhB,+CiD95KA,+CjD45KA,+CiDr0KU,+CjDw0KV,iEiD/5KA,iEjD65KA,iEDtBC,iEC6BC,cAAe,EAEjB,8CiDt0KU,8CjDw0KV,8CiDx6KA,8CjDu6KA,gEDtBC,gECwBD,gEiDn0KI,gEACA,cAAA,EAUJ,yBACE,cAAA,ElDsyKD,OAAA,EkDlyKG,aACA,cAAA,KANJ,oBASM,cAAA,ElDqyKL,cAAA,IkDhyKG,2BlDmyKH,WAAA,IC4BD,4BiD3zKM,cAAA,EAKF,wDAvBJ,wDlDwzKC,WAAA,IAAA,MAAA,KkD/xKK,2BlDkyKL,WAAA,EmDrhLC,uDnDwhLD,cAAA,IAAA,MAAA,KmDrhLG,eACA,aAAA,KnDyhLH,8BmD3hLC,MAAA,KAMI,iBAAA,QnDwhLL,aAAA,KmDrhLK,0DACA,iBAAA,KAGJ,qCAEI,MAAA,QnDshLL,iBAAA,KmDviLC,yDnD0iLD,oBAAA,KmDviLG,eACA,aAAA,QnD2iLH,8BmD7iLC,MAAA,KAMI,iBAAA,QnD0iLL,aAAA,QmDviLK,0DACA,iBAAA,QAGJ,qCAEI,MAAA,QnDwiLL,iBAAA,KmDzjLC,yDnD4jLD,oBAAA,QmDzjLG,eACA,aAAA,QnD6jLH,8BmD/jLC,MAAA,QAMI,iBAAA,QnD4jLL,aAAA,QmDzjLK,0DACA,iBAAA,QAGJ,qCAEI,MAAA,QnD0jLL,iBAAA,QmD3kLC,yDnD8kLD,oBAAA,QmD3kLG,YACA,aAAA,QnD+kLH,2BmDjlLC,MAAA,QAMI,iBAAA,QnD8kLL,aAAA,QmD3kLK,uDACA,iBAAA,QAGJ,kCAEI,MAAA,QnD4kLL,iBAAA,QmD7lLC,sDnDgmLD,oBAAA,QmD7lLG,eACA,aAAA,QnDimLH,8BmDnmLC,MAAA,QAMI,iBAAA,QnDgmLL,aAAA,QmD7lLK,0DACA,iBAAA,QAGJ,qCAEI,MAAA,QnD8lLL,iBAAA,QmD/mLC,yDnDknLD,oBAAA,QmD/mLG,cACA,aAAA,QnDmnLH,6BmDrnLC,MAAA,QAMI,iBAAA,QnDknLL,aAAA,QmD/mLK,yDACA,iBAAA,QAGJ,oCAEI,MAAA,QnDgnLL,iBAAA,QoD/nLC,wDACA,oBAAA,QAEA,kBACA,SAAA,SpDkoLD,QAAA,MoDvoLC,OAAQ,EnDmqLR,QAAS,EACT,SAAU,OAEZ,yCmDzpLI,wBADA,yBAEA,yBACA,wBACA,SAAA,SACA,IAAA,EACA,OAAA,EpDkoLH,KAAA,EoD7nLC,MAAO,KACP,OAAA,KpD+nLD,OAAA,EoD1nLC,wBpD6nLD,eAAA,OqDvpLC,uBACA,eAAA,IAEA,MACA,WAAA,KACA,QAAA,KjDwDA,cAAA,KACQ,iBAAA,QJmmLT,OAAA,IAAA,MAAA,QqDlqLC,cAAe,IASb,mBAAA,MAAA,EAAA,IAAA,IAAA,gBACA,WAAA,MAAA,EAAA,IAAA,IAAA,gBAKJ,iBACE,aAAA,KACA,aAAA,gBAEF,SACE,QAAA,KACA,cAAA,ICtBF,SACE,QAAA,IACA,cAAA,IAEA,OACA,MAAA,MACA,UAAA,KjCRA,YAAA,IAGA,YAAA,ErBwrLD,MAAA,KsDhrLC,YAAA,EAAA,IAAA,EAAA,KrD4sLA,OAAQ,kBqD1sLN,QAAA,GjCbF,aiCeE,ajCZF,MAAA,KrBgsLD,gBAAA,KsD5qLC,OAAA,QACE,OAAA,kBACA,QAAA,GAEA,aACA,mBAAA,KtD8qLH,QAAA,EuDnsLC,OAAQ,QACR,WAAA,IvDqsLD,OAAA,EuDhsLC,YACA,SAAA,OAEA,OACA,SAAA,MACA,IAAA,EACA,MAAA,EACA,OAAA,EACA,KAAA,EAIA,QAAA,KvDgsLD,QAAA,KuD7rLC,SAAA,OnD+GA,2BAAA,MACI,QAAA,EAEI,0BAkER,mBAAA,kBAAA,IAAA,SAEK,cAAA,aAAA,IAAA,SACG,WAAA,UAAA,IAAA,SJghLT,kBAAA,kBuDnsLC,cAAA,kBnD2GA,aAAA,kBACI,UAAA,kBAEI,wBJ2lLT,kBAAA,euDvsLK,cAAe,eACnB,aAAA,eACA,UAAA,eAIF,mBACE,WAAA,OACA,WAAA,KvDwsLD,cuDnsLC,SAAU,SACV,MAAA,KACA,OAAA,KAEA,eACA,SAAA,SnDaA,iBAAA,KACQ,wBAAA,YmDZR,gBAAA,YtD+tLA,OsD/tLA,IAAA,MAAA,KAEA,OAAA,IAAA,MAAA,evDqsLD,cAAA,IuDjsLC,QAAS,EACT,mBAAA,EAAA,IAAA,IAAA,eACA,WAAA,EAAA,IAAA,IAAA,eAEA,gBACA,SAAA,MACA,IAAA,EACA,MAAA,EvDmsLD,OAAA,EuDjsLC,KAAA,ElCrEA,QAAA,KAGA,iBAAA,KkCmEA,qBlCtEA,OAAA,iBAGA,QAAA,EkCwEF,mBACE,OAAA,kBACA,QAAA,GAIF,cACE,QAAA,KvDmsLD,cAAA,IAAA,MAAA,QuD9rLC,qBACA,WAAA,KAKF,aACE,OAAA,EACA,YAAA,WAIF,YACE,SAAA,SACA,QAAA,KvD6rLD,cuD/rLC,QAAS,KAQP,WAAA,MACA,WAAA,IAAA,MAAA,QATJ,wBAaI,cAAA,EvDyrLH,YAAA,IuDrrLG,mCvDwrLH,YAAA,KuDlrLC,oCACA,YAAA,EAEA,yBACA,SAAA,SvDqrLD,IAAA,QuDnqLC,MAAO,KAZP,OAAA,KACE,SAAA,OvDmrLD,yBuDhrLD,cnDvEA,MAAA,MACQ,OAAA,KAAA,KmD2ER,eAAY,mBAAA,EAAA,IAAA,KAAA,evDkrLX,WAAA,EAAA,IAAA,KAAA,euD5qLD,UAFA,MAAA,OvDorLD,yBwDl0LC,UACA,MAAA,OCNA,SAEA,SAAA,SACA,QAAA,KACA,QAAA,MACA,YAAA,iBAAA,UAAA,MAAA,WACA,UAAA,KACA,WAAA,OACA,YAAA,IACA,YAAA,WACA,WAAA,KACA,WAAA,MACA,gBAAA,KACA,YAAA,KACA,eAAA,KACA,eAAA,ODHA,WAAA,OnCVA,aAAA,OAGA,UAAA,OrBy1LD,YAAA,OwD90LC,OAAA,iBnCdA,QAAA,ErBg2LD,WAAA,KwDj1LY,YAAmB,OAAA,kBxDq1L/B,QAAA,GwDp1LY,aAAmB,QAAA,IAAA,ExDw1L/B,WAAA,KwDv1LY,eAAmB,QAAA,EAAA,IxD21L/B,YAAA,IwD11LY,gBAAmB,QAAA,IAAA,ExD81L/B,WAAA,IwDz1LC,cACA,QAAA,EAAA,IACA,YAAA,KAEA,eACA,UAAA,MxD41LD,QAAA,IAAA,IwDx1LC,MAAO,KACP,WAAA,OACA,iBAAA,KACA,cAAA,IAEA,exD01LD,SAAA,SwDt1LC,MAAA,EACE,OAAA,EACA,aAAA,YACA,aAAA,MAEA,4BxDw1LH,OAAA,EwDt1LC,KAAA,IACE,YAAA,KACA,aAAA,IAAA,IAAA,EACA,iBAAA,KAEA,iCxDw1LH,MAAA,IwDt1LC,OAAA,EACE,cAAA,KACA,aAAA,IAAA,IAAA,EACA,iBAAA,KAEA,kCxDw1LH,OAAA,EwDt1LC,KAAA,IACE,cAAA,KACA,aAAA,IAAA,IAAA,EACA,iBAAA,KAEA,8BxDw1LH,IAAA,IwDt1LC,KAAA,EACE,WAAA,KACA,aAAA,IAAA,IAAA,IAAA,EACA,mBAAA,KAEA,6BxDw1LH,IAAA,IwDt1LC,MAAA,EACE,WAAA,KACA,aAAA,IAAA,EAAA,IAAA,IACA,kBAAA,KAEA,+BxDw1LH,IAAA,EwDt1LC,KAAA,IACE,YAAA,KACA,aAAA,EAAA,IAAA,IACA,oBAAA,KAEA,oCxDw1LH,IAAA,EwDt1LC,MAAA,IACE,WAAA,KACA,aAAA,EAAA,IAAA,IACA,oBAAA,KAEA,qCxDw1LH,IAAA,E0Dr7LC,KAAM,IACN,WAAA,KACA,aAAA,EAAA,IAAA,IACA,oBAAA,KAEA,SACA,SAAA,SACA,IAAA,EDXA,KAAA,EAEA,QAAA,KACA,QAAA,KACA,UAAA,MACA,QAAA,IACA,YAAA,iBAAA,UAAA,MAAA,WACA,UAAA,KACA,WAAA,OACA,YAAA,IACA,YAAA,WACA,WAAA,KACA,WAAA,MACA,gBAAA,KACA,YAAA,KACA,eAAA,KCAA,eAAA,OAEA,WAAA,OACA,aAAA,OAAA,UAAA,OACA,YAAA,OACA,iBAAA,KACA,wBAAA,YtD8CA,gBAAA,YACQ,OAAA,IAAA,MAAA,KJq5LT,OAAA,IAAA,MAAA,e0Dh8LC,cAAA,IAAY,mBAAA,EAAA,IAAA,KAAA,e1Dm8Lb,WAAA,EAAA,IAAA,KAAA,e0Dl8La,WAAA,KACZ,aAAY,WAAA,MACZ,eAAY,YAAA,KAGd,gBACE,WAAA,KAEA,cACA,YAAA,MAEA,e1Dw8LD,QAAA,IAAA,K0Dr8LC,OAAQ,EACR,UAAA,K1Du8LD,iBAAA,Q0D/7LC,cAAA,IAAA,MAAA,QzD49LA,cAAe,IAAI,IAAI,EAAE,EyDz9LvB,iBACA,QAAA,IAAA,KAEA,gBACA,sB1Di8LH,SAAA,S0D97LC,QAAS,MACT,MAAA,E1Dg8LD,OAAA,E0D97LC,aAAc,YACd,aAAA,M1Di8LD,gB0D57LC,aAAA,KAEE,sBACA,QAAA,GACA,aAAA,KAEA,oB1D87LH,OAAA,M0D77LG,KAAA,IACE,YAAA,MACA,iBAAA,KACA,iBAAA,gBACA,oBAAA,E1Dg8LL,0B0D57LC,OAAA,IACE,YAAA,MACA,QAAA,IACA,iBAAA,KACA,oBAAA,EAEA,sB1D87LH,IAAA,I0D77LG,KAAA,MACE,WAAA,MACA,mBAAA,KACA,mBAAA,gBACA,kBAAA,E1Dg8LL,4B0D57LC,OAAA,MACE,KAAA,IACA,QAAA,IACA,mBAAA,KACA,kBAAA,EAEA,uB1D87LH,IAAA,M0D77LG,KAAA,IACE,YAAA,MACA,iBAAA,EACA,oBAAA,KACA,oBAAA,gB1Dg8LL,6B0D37LC,IAAA,IACE,YAAA,MACA,QAAA,IACA,iBAAA,EACA,oBAAA,KAEA,qB1D67LH,IAAA,I0D57LG,MAAA,MACE,WAAA,MACA,mBAAA,EACA,kBAAA,KACA,kBAAA,gB1D+7LL,2B2DvjMC,MAAO,IACP,OAAA,M3DyjMD,QAAA,I2DtjMC,mBAAoB,EACpB,kBAAA,KAEA,U3DwjMD,SAAA,S2DrjMG,gBACA,SAAA,SvD6KF,MAAA,KACK,SAAA,OJ64LN,sB2DlkMC,SAAU,S1D+lMV,QAAS,K0DjlML,mBAAA,IAAA,YAAA,K3DwjML,cAAA,IAAA,YAAA,K2D9hMC,WAAA,IAAA,YAAA,KvDmKK,4BAFL,0BAGQ,YAAA,EA3JA,qDA+GR,sBAEQ,mBAAA,kBAAA,IAAA,YJi7LP,cAAA,aAAA,IAAA,Y2D5jMG,WAAA,UAAA,IAAA,YvDmHJ,4BAAA,OACQ,oBAAA,OuDjHF,oBAAA,O3D+jML,YAAA,OI/8LD,mCHy+LA,2BGx+LQ,KAAA,EuD5GF,kBAAA,sB3DgkML,UAAA,sBC2BD,kCADA,2BG/+LA,KAAA,EACQ,kBAAA,uBuDtGF,UAAA,uBArCN,6B3DumMD,gC2DvmMC,iC1DkoME,KAAM,E0DrlMN,kBAAA,mB3D+jMH,UAAA,oBAGA,wB2D/mMD,sBAAA,sBAsDI,QAAA,MAEA,wB3D6jMH,KAAA,E2DzjMG,sB3D4jMH,sB2DxnMC,SAAU,SA+DR,IAAA,E3D4jMH,MAAA,KC0BD,sB0DllMI,KAAA,KAnEJ,sBAuEI,KAAA,MAvEJ,2BA0EI,4B3D2jMH,KAAA,E2DljMC,6BACA,KAAA,MAEA,8BACA,KAAA,KtC3FA,kBsC6FA,SAAA,SACA,IAAA,EACA,OAAA,EACA,KAAA,EACA,MAAA,I3DsjMD,UAAA,K2DjjMC,MAAA,KdnGE,WAAA,OACA,YAAA,EAAA,IAAA,IAAA,eACA,iBAAA,cAAA,OAAA,kBACA,QAAA,G7CwpMH,uB2DrjMC,iBAAA,sEACE,iBAAA,iEACA,iBAAA,uFdxGA,iBAAA,kEACA,OAAA,+GACA,kBAAA,SACA,wBACA,MAAA,E7CgqMH,KAAA,K2DvjMC,iBAAA,sE1DmlMA,iBAAiB,iE0DjlMf,iBAAA,uFACA,iBAAA,kEACA,OAAA,+GtCvHF,kBAAA,SsCyFF,wB3DylMC,wBC4BC,MAAO,KACP,gBAAiB,KACjB,OAAQ,kB0DhlMN,QAAA,EACA,QAAA,G3D2jMH,0C2DnmMD,2CA2CI,6BADA,6B1DqlMF,SAAU,S0DhlMR,IAAA,IACA,QAAA,E3DwjMH,QAAA,a2DxmMC,WAAY,MAqDV,0CADA,6B3DyjMH,KAAA,I2D7mMC,YAAa,MA0DX,2CADA,6BAEA,MAAA,IACA,aAAA,MAME,6BADF,6B3DsjMH,MAAA,K2DjjMG,OAAA,KACE,YAAA,M3DmjML,YAAA,E2DxiMC,oCACA,QAAA,QAEA,oCACA,QAAA,QAEA,qBACA,SAAA,SACA,OAAA,K3D2iMD,KAAA,I2DpjMC,QAAS,GAYP,MAAA,IACA,aAAA,EACA,YAAA,KACA,WAAA,OACA,WAAA,KAEA,wBACA,QAAA,aAWA,MAAA,KACA,OAAA,K3DiiMH,OAAA,I2DhkMC,YAAa,OAkCX,OAAA,QACA,iBAAA,OACA,iBAAA,cACA,OAAA,IAAA,MAAA,K3DiiMH,cAAA,K2DzhMC,6BACA,MAAA,KACA,OAAA,KACA,OAAA,EACA,iBAAA,KAEA,kBACA,SAAA,SACA,MAAA,IACA,OAAA,K3D4hMD,KAAA,I2D3hMC,QAAA,GACE,YAAA,K3D6hMH,eAAA,K2Dp/LC,MAAO,KAhCP,WAAA,O1DijMA,YAAa,EAAE,IAAI,IAAI,eAEzB,uB0D9iMM,YAAA,KAEA,oCACA,0C3DshMH,2C2D9hMD,6BAAA,6BAYI,MAAA,K3DshMH,OAAA,K2DliMD,WAAA,M1D8jME,UAAW,KDxBZ,0C2DjhMD,6BACE,YAAA,MAEA,2C3DmhMD,6B2D/gMD,aAAA,M3DkhMC,kBACF,MAAA,I4DhxMC,KAAA,I3D4yME,eAAgB,KAElB,qBACE,OAAQ,MAkBZ,qCADA,sCADA,mBADA,oBAXA,gBADA,iBAOA,uBADA,wBADA,iBADA,kBADA,wBADA,yBASA,mCADA,oC2DvzME,oBAAA,qBAAA,oBAAA,qB3D8zMF,WADA,YAOA,uBADA,wBADA,qBADA,sBADA,cADA,e2Dl0MI,a3Dw0MJ,cDvBC,kB4DhzMG,mB3DwzMJ,WADA,YAwBE,QAAS,MACT,QAAS,IASX,qCADA,mBANA,gBAGA,uBADA,iBADA,wBAIA,mCDhBC,oB6Dl1MC,oB5Dq2MF,W+B/1MA,uBhCu0MC,qB4D/zMG,cChBF,aACA,kB5Dk2MF,W+Bx1ME,MAAO,KhC40MR,cgCz0MC,QAAS,MACT,aAAA,KhC20MD,YAAA,KgCl0MC,YhCq0MD,MAAA,gBgCl0MC,WhCq0MD,MAAA,egCl0MC,MhCq0MD,QAAA,e8D51MC,MACA,QAAA,gBAEA,WACA,WAAA,O9B8BF,WACE,KAAA,EAAA,EAAA,EhCm0MD,MAAA,YgC5zMC,YAAa,KACb,iBAAA,YhC8zMD,OAAA,E+D91MC,Q/Di2MD,QAAA,eC4BD,OACE,SAAU,M+Dt4MV,chE+2MD,MAAA,aC+BD,YADA,YADA,YADA,YAIE,QAAS,e+Dv5MT,kBhEy4MC,mBgEx4MD,yBhEo4MD,kB+Dr1MD,mBA6IA,yB9D+tMA,kBACA,mB8Dp3ME,yB9Dg3MF,kBACA,mBACA,yB+D15MY,QAAA,eACV,yBAAU,YhE64MT,QAAA,gBC4BD,iB+Dv6MU,QAAA,gBhEg5MX,c+D/1MG,QAAS,oB/Dm2MV,c+Dr2MC,c/Ds2MH,QAAA,sB+Dj2MG,yB/Dq2MD,kBACF,QAAA,iB+Dj2MG,yB/Dq2MD,mBACF,QAAA,kBgEn6MC,yBhEu6MC,yBgEt6MD,QAAA,wBACA,+CAAU,YhE26MT,QAAA,gBC4BD,iB+Dr8MU,QAAA,gBhE86MX,c+Dx2MG,QAAS,oB/D42MV,c+D92MC,c/D+2MH,QAAA,sB+D12MG,+C/D82MD,kBACF,QAAA,iB+D12MG,+C/D82MD,mBACF,QAAA,kBgEj8MC,+ChEq8MC,yBgEp8MD,QAAA,wBACA,gDAAU,YhEy8MT,QAAA,gBC4BD,iB+Dn+MU,QAAA,gBhE48MX,c+Dj3MG,QAAS,oB/Dq3MV,c+Dv3MC,c/Dw3MH,QAAA,sB+Dn3MG,gD/Du3MD,kBACF,QAAA,iB+Dn3MG,gD/Du3MD,mBACF,QAAA,kBgE/9MC,gDhEm+MC,yBgEl+MD,QAAA,wBACA,0BAAU,YhEu+MT,QAAA,gBC4BD,iB+DjgNU,QAAA,gBhE0+MX,c+D13MG,QAAS,oB/D83MV,c+Dh4MC,c/Di4MH,QAAA,sB+D53MG,0B/Dg4MD,kBACF,QAAA,iB+D53MG,0B/Dg4MD,mBACF,QAAA,kBgEr/MC,0BhEy/MC,yBACF,QAAA,wBgE1/MC,yBhE8/MC,WACF,QAAA,gBgE//MC,+ChEmgNC,WACF,QAAA,gBgEpgNC,gDhEwgNC,WACF,QAAA,gBAGA,0B+Dn3MC,WA4BE,QAAS,gBC5LX,eAAU,QAAA,eACV,aAAU,ehE4hNT,QAAA,gBC4BD,oB+DtjNU,QAAA,gBhE+hNX,iB+Dj4MG,QAAS,oBAMX,iB/D83MD,iB+Dz2MG,QAAS,sB/D82MZ,qB+Dl4MC,QAAS,e/Dq4MV,a+D/3MC,qBAcE,QAAS,iB/Ds3MZ,sB+Dn4MC,QAAS,e/Ds4MV,a+Dh4MC,sBAOE,QAAS,kB/D83MZ,4B+D/3MC,QAAS,eCpLT,ahEujNC,4BACF,QAAA,wBC6BD,aACE,cACE,QAAS"} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap3-transition.css b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap3-transition.css
new file mode 100644
index 000000000..9644485ca
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/bootstrap3-transition.css
@@ -0,0 +1,238 @@
+/* Changes to the top bar. Template: base.html */
+
+.navbar .brand {
+ padding: 5px 20px;
+}
+
+.logo {
+ padding-top: 2px !important;
+}
+
+/* Changes to the tables pagination */
+
+.pagination {
+ margin: 0 0 40px 0;
+}
+
+select[class^="pagesize"] {
+ margin-bottom: 0;
+}
+
+/* Project configuration page */
+
+ul.configuration-list {
+ margin-left: 0px;
+}
+
+.configuration-list .checkbox {
+ margin-top: 0;
+}
+
+/* Breadcrumbs */
+
+.breadcrumb {
+ padding: 8px 0;
+}
+
+.breadcrumb > li + li::before {
+ content: none;
+}
+
+.breadcrumb .divider {
+ color: #999;
+ padding: 0 5px;
+}
+
+/* Remove the hovering from the .btn-primary buttons when they are disabled */
+
+.btn-primary.disabled.focus,
+.btn-primary.disabled:focus,
+.btn-primary.disabled:hover,
+.btn-primary.focus[disabled],
+.btn-primary[disabled]:focus,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary.focus,
+fieldset[disabled] .btn-primary:focus,
+fieldset[disabled] .btn-primary:hover {
+ background-color: #04c;
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+}
+
+/* Table search input field */
+
+.navbar-search {
+ width: 60%;
+}
+
+.navbar-search .input-append {
+ width: 90%;
+}
+
+.navbar-search .input-append input[type="text"] {
+ width: 80%;
+}
+
+#search {
+ width: 60%;
+}
+
+/* Definition lists */
+
+.dl-horizontal dd {
+ margin-left: 220px;
+}
+
+.dl-horizontal dt {
+ width: 200px;
+}
+
+/* Table controls */
+
+.navbar-inner > .navbar-search .input-append {
+ margin-bottom: 5px;
+}
+
+.navbar-search.input-append {
+ margin-bottom: 20px;
+}
+
+/* Modal dialogs */
+
+.modal-dialog {
+ width: 700px;
+}
+
+.modal-body {
+ overflow-y: scroll;
+ max-height: 350px;
+}
+
+.modal-body ul.list-unstyled {
+ margin-left: 0;
+}
+
+.modal-footer {
+ background-color: #f5f5f5;
+}
+
+.modal-content form {
+ margin-bottom: 0;
+}
+
+.modal-dialog .checkbox label,
+.modal-dialog .radio label {
+ padding-left: 0;
+}
+
+/* Typeahead */
+
+.tt-menu {
+ width: 120%;
+ padding: 10px 8px;
+}
+
+.tt-suggestion {
+ padding: 3px 8px;
+ cursor: pointer;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.tt-suggestion.active,
+.tt-suggestion:hover {
+ background-color: #0081c2;
+ color: white;
+}
+
+/* Build form */
+
+#build-input {
+ width: 20em;
+}
+
+/* Clear filter tooltips in toastertables */
+
+.tooltip .btn-small {
+ margin: 10px;
+}
+
+/* Table cell notifications */
+
+.inline-notification,
+#temp-inline-notify {
+ padding: 10px;
+}
+
+/* Table buttons */
+
+td .btn {
+ white-space: normal;
+}
+
+th.add-del-layers {
+ width: 18%;
+}
+
+th.add_rm_pkg_btn {
+ width: 20%;
+}
+
+/* Edit columsn menu */
+
+.dropdown-menu {
+ min-width: 200px;
+}
+
+/* Popover content */
+
+.popover-content > ul {
+ margin-left: 0;
+}
+
+h3.popover-title {
+ line-height: 20px;
+}
+
+.popover {
+ max-width: 400px;
+}
+
+/* Errors and warnings accordions */
+
+#errors .panel-heading,
+#warnings .panel-heading {
+ background-color: transparent;
+}
+
+a.toggle-errors:hover,
+a.toggle-warnings:hover,
+a.warning:focus {
+ text-decoration: none;
+}
+
+a.toggle-errors:focus,
+a.toggle-warnings:focus {
+ outline: none;
+}
+
+/* Landing page */
+
+.jumbotron p {
+ margin-top: 20px;
+ margin-bottom: 30px;
+}
+
+.jumbotron ul {
+ margin-left: 10px;
+ font-size: 21px;
+ font-weight: 200;
+}
+
+.jumbotron ul > li {
+ line-height: 30px;
+}
+
+.jumbotron .img-thumbnail {
+ padding: 0;
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/default.css b/poky/bitbake/lib/toaster/toastergui/static/css/default.css
new file mode 100644
index 000000000..5cd7e211a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/default.css
@@ -0,0 +1,369 @@
+/* New Toaster custom css file for Bootstrap 3 */
+
+/* Set required top body padding for the fixed top navbard */
+body { padding-top: 50px; }
+
+/* Style the Yocto Project logo */
+img.logo { height: 30px; vertical-align: bottom; }
+
+/* Style the Yocto Project logo and the Toaster name in the top navbar */
+.toaster-navbar-brand { float: left; margin: 7px 25px 0 0; }
+.toaster-navbar-brand a.brand { color: #777; height: 50px; padding: 15px 5px 15px 15px; font-size: 20px; line-height: 25px; display: inline; }
+.toaster-navbar-brand > a { text-decoration: none; }
+.toaster-navbar-brand > a.brand:hover { color: #5e5e5e; }
+
+/* Style the debugging information in the top navbar */
+.glyphicon-info-sign { color: #777; font-size: 16px; }
+.glyphicon-info-sign:hover { color: #999; cursor: pointer; }
+
+/* Override the negative right margin for the navbar-right class */
+#new-project-button { margin-right: 0; }
+
+/* Increase popovers width to fit commit SHAs */
+.popover { max-width: 350px; }
+
+/* Set a limit to popover height to handle long dependency lists */
+.popover-content { max-height: 350px; overflow: scroll; }
+
+/* Set a limit to modal dialogs height to handle long variable history */
+[id^="variable-"] .modal-content { max-height: 550px; overflow-y: scroll; }
+
+/* Make sure long values in variable history do not make the modal dialogs
+ * scroll horizontally */
+[id^="variable-"] .modal-content p { word-break: break-all; }
+
+/* Increase bottom margin of definition lists inside popovers for the Toaster version information in the top navbar, and also inside the right hand columns of our details pages */
+.popover-content dd,
+.item-info dd { margin-bottom: 15px; }
+
+/* Style the horizontal definition lists */
+.dl-horizontal dt { width: 200px; line-height: 25px; }
+.dl-horizontal dd { margin-left: 220px; line-height: 25px; }
+
+/* Style our build results */
+.build-result .progress { margin-bottom: 0; }
+.alert-link.build-warnings,
+.glyphicon-warning-sign.build-warnings { color: #8a6d3b; }
+.build-result .project-name { margin-top: -10px; margin-bottom: 5px; }
+.rebuild-btn, .cancel-build-btn { cursor: pointer; }
+
+/* Styles for the help information */
+.get-help { color: #CCCCCC; }
+.get-help:hover { color: #999999; cursor: pointer; }
+.get-help-green { color: #3c763d; }
+.get-help-green:hover { color: #2b542c; cursor: pointer; }
+.get-help-blue { color: #3A87AD; }
+.get-help-blue:hover { color: #005580; cursor: pointer; }
+.get-help-red { color: #a94442; }
+.get-help-red:hover { color: #843534; cursor: pointer; }
+
+/* Styles for our table controls */
+.form-control[id^="search-input-"],
+.form-control[id^="new-search-input-"],
+#search{ width: 30em; }
+#search-input-selectpackagestable,
+#search-input-packagestable,
+.form-control[id^="no-results-search-input-"] { width: 20em; }
+#edit-columns-button { margin-right: 30px; }
+.navbar-default[id^="table-chrome-"],
+#variables .navbar-default { background-color: transparent; }
+[id^="table-chrome-collapse-"] .navbar-form { margin-left: -15px; }
+.dropdown-menu.editcol { padding-left: 10px; min-width: 200px; }
+span[class^="remove-search-btn-"] { position: absolute; right: 5px; top: 0; bottom: 0; height: 14px; margin: auto; font-size: 14px; cursor: pointer; color: #777;}
+span[class^="remove-search-btn-"]:hover { color: #333; }
+#no-results-special-selectpackagestable .form-inline { margin-top: 20px; }
+[id^="pagination-"] .pagination,
+[id^="pagination-"] .navbar-form { margin-top: 0; }
+[id^="table-chrome-"] .navbar-form { margin-left: -15px; margin-right: -15px; }
+[id^="table-chrome-"] .detail-page-contols,
+#packages-built .detail-page-controls { padding-left: 0; padding-right: 0; }
+
+/* Override the default font-weight for labels: it's a bit too much */
+label { font-weight: normal; }
+
+/* Firefox workaround for awkward fieldset styling. See http://getbootstrap.com/css/#tables-responsive */
+@-moz-document url-prefix() { fieldset { display: table-cell; } }
+
+/* Table heading sortable / not sortable states */
+thead > tr > th > a { font-weight: normal; }
+thead > tr > th > a.sorted { font-weight: bold; color: #333; }
+
+/* Give some extra space to the 'clear filter' buttons */
+.tooltip .btn { margin: 5px; }
+
+/* In table headings, separate the help bubble from the column heading */
+thead > tr > th > .glyphicon-question-sign { margin-right: 5px; }
+
+/* Style build outcome in tables, download, remove and change icons */
+tbody > tr > td > .glyphicon-ok-circle,
+dd > .glyphicon-ok-circle { color: #3c763d; }
+tbody > tr > td > .glyphicon-minus-sign { color: #a94442; }
+.glyphicon-download-alt,
+.glyphicon-edit { color: #337ab7; }
+.failed_tasks .glyphicon-download-alt { margin-left: 5px; }
+.glyphicon-download-alt:hover,
+.glyphicon-edit:hover { color: #23527c; cursor: pointer; text-decoration: none; }
+.glyphicon-trash { color: #a94442; }
+.btn-danger > .glyphicon-trash,
+.btn-danger > .glyphicon-trash:hover { color: #fff; }
+.glyphicon-trash:hover { color: #843534; cursor: pointer; }
+
+/* Set the font size for icons inside headings, lead paragraphs and definition lists */
+h1 > .glyphicon-edit,
+p.lead .glyphicon { font-size: 16px; }
+h2 > .glyphicon-question-sign,
+h3 > .glyphicon-question-sign,
+.heading-help { font-size: 14px; }
+
+/* Create a class for wells without background colour */
+.well-transparent { background-color: transparent; }
+
+/* Create a class for the left navigation headers */
+.nav-header { display: block; font-size: 12px; font-weight: bold; line-height: 20px; color: #999; text-transform: uppercase; margin-top: 20px !important; margin-bottom: 15px; padding-left: 15px; }
+
+/* Increase the tabs padding and margin in the project pages to fit the build form and the main content */
+#project-topbar .nav-tabs > li > a { padding: 15px; }
+#project-topbar { margin-bottom: 20px; }
+
+/* Style the project name change form in the project pages */
+#project-name-change-input { width: 20em; }
+
+/* Style the build form in the project pages */
+#project-topbar .input-lg { width: 18em; }
+#project-topbar form .glyphicon { top: 15px; right: 4px; }
+#build-button { padding: 10px 30px; }
+
+/* Style the form links in the project page (all machines, all layers, etc) */
+.form-link { margin-top: 10px; }
+
+/* Style the most built recipes list in the project page */
+#freq-build-list .checkbox input[type="checkbox"] { position: relative; margin: 0 10px 0 0; vertical-align: middle; }
+#freq-build-list.lead > li { line-height: 25px; }
+#freq-build-list { margin-top: 20px; }
+#freq-build-list label { padding-left: 0; }
+#freq-build-btn { margin-top: 10px; }
+#no-most-built { margin-top: 20px; }
+
+/* Style the layers section in the project page and the layer dependencies in the import layer form */
+#layer-container .form-inline { margin-top: 20px; }
+#layer-add-input { width: 17em; }
+ul.lead { margin-top: 20px; }
+ul.lead > li { line-height: 38px; }
+ul.lead .glyphicon-trash,
+ul.lead .glyphicon-trash { font-size: 16px; margin-left: 7px; }
+#layers-in-project-list .tooltip-inner { max-width: 600px; }
+#no-layers-in-project { margin-top: 20px; }
+#no-layers-in-project ul { margin-top: 10px; }
+
+/* Style the layer information icons in the layer details pages */
+dd .glyphicon-trash,
+dd .glyphicon-edit { margin-left: 5px; }
+
+/* Style the forms and definition lists in the layer details pages */
+#change-repo-form .form-control { width: 17em; }
+#information { margin-bottom: 5em; }
+#information dd > form { margin-bottom: 5px; margin-top: 5px; }
+#edit-layer-source-form fieldset { margin-top: 20px; }
+#directory-info,
+#git-repo-info { margin-top: 20px; }
+#layer-dir-path-in-details { width: 55%; }
+.add-deps .form-control { width: 15em; }
+
+/* Style the forms and definition lists in the BitBake variables page */
+.variable-list { margin-bottom: 20px; }
+dd.variable-list form { margin-top: 10px; }
+#new-dl_dir,
+#filter-image_fstypes,
+#new-image_install,
+#new-sstate_dir,
+#new-imagefs_types { width: 20em; }
+#package_classes-select { width: 10em; }
+.scrolling { border: 1px solid #dddddd; height: 154px; overflow: auto; padding: 0 10px; width: 27.5%; margin-bottom: 10px; margin-top: 10px; }
+.scrolling.has-error { border-color: #a94442; }
+.help-block.text-danger { color: #a94442; }
+.tooltip-inner code { color: #fff; }
+.text-danger > code { color: #a94442; }
+dd.variable-list .glyphicon-question-sign { font-size: 14px; }
+dd.variable-list .glyphicon-edit { font-size: 16px; }
+dt .glyphicon-trash { margin-left: 5px; font-size: 16px; }
+#change-package_classes-form .checkbox { margin-top: 5px; }
+#variable-form h5 { margin-top: 0; }
+#variable-form .col-md-5 { padding-left: 45px; }
+
+/* Create a class for additional top margin that we can use in headings */
+.top-air { margin-top: 40px; }
+
+/* Add some bottom margin to our h2's */
+h2 { margin-bottom: 25px; }
+
+/* Style the typeahead */
+.tt-menu { min-width: 400px; padding-bottom: 10px; }
+.tt-suggestion { padding: 5px 10px; }
+.tt-suggestion:hover,
+.tt-suggestion:active { background-color: #f5f5f5; cursor: pointer; }
+
+/* Style the import layer form controls*/
+legend { border: none; }
+fieldset.fields-apart-from-layer-name { margin-top: 20px; }
+.radioLegend { margin-bottom: 0; }
+#layer-name-ctrl { margin-top: 20px; }
+#import-layer-name,
+#layer-subdir { width: 20%; }
+#layer-git-repo-url { width: 40%; }
+#local-dir-path { width: 45%; }
+#layer-dependency { width: 16em; }
+#layer-deps-list { margin-top: 0; }
+#form-actions { margin-bottom: 30px; }
+#duplicate-layer-info dl { margin-top: 10px; }
+#duplicate-layer-info dd { margin-bottom: 10px; }
+.help-inline { color: #737373; margin-left: 10px; }
+.radio-help { width: 50%; margin-left: 20px; }
+#repo-select div:nth-of-type(2) { margin-top: 15px; }
+
+/* Give some padding to the in-cell tooltips we use for notifications in tables */
+td > .tooltip-inner,
+.inline-notification { padding: 10px; }
+
+/* Set sane widths for table columns */
+#newcustomimagestable .get_description_or_summary,
+#imagerecipestable .get_description_or_summary,
+#softwarerecipestable .get_description_or_summary,
+#layerstable .layer__summary { width: 30%; }
+#recipestable .get_description_or_summary { width: 40%; }
+#machinestable .name { white-space: nowrap; }
+#machinestable .description { width: 45%; }
+#otable .variable_value,
+#otable .file { word-break: break-all; width: 25%; }
+[id^="variable-"] .file { word-break: break-all; }
+
+/* For the tables still not ported to ToasterTables, style the table headings
+ * that are not sortable */
+th > span.text-muted { font-weight: normal; }
+
+/* Override the rather ugly default code styles */
+code { color: #333; background-color: transparent; }
+
+/* Style our breadcrumbs */
+.breadcrumb > li + li::before { content: none; }
+.breadcrumb { background-color: transparent; padding-left: 0; padding-top: 15px; }
+.breadcrumb .divider { color: #777; margin: 0 5px; }
+
+/* Reduce top margin for the page-header class */
+.page-header { margin-top: 30px; }
+
+/* Set some space around the layer button in the layer details pages */
+.tab-content { margin-top: 20px; }
+.tab-pane { margin-top: 20px; }
+
+/* Style the new window icons */
+.glyphicon-new-window:hover { text-decoration: none; }
+.dl-horizontal > dd > .glyphicon-new-window { margin-left: 5px; }
+
+/* Style the special no results message in the custom image details page */
+[id^="no-results-special-"] > .alert-warning > ol { margin-top: 10px; }
+
+/* style the loading spinner in the new custom image dialog */
+#create-new-custom-image-btn [data-role="loading-state"] {
+ padding-left: 16px;
+}
+
+/* icon has to be absolutely positioned, otherwise the spin animation doesn't work */
+#create-new-custom-image-btn [data-role="loading-state"] .icon-spinner {
+ position: absolute;
+ left: 26px;
+ bottom: 26px;
+}
+
+/* Style the content of modal dialogs */
+.modal-footer { text-align: left; }
+.date-filter-controls { margin-top: 10px; }
+.date-filter-controls span { margin: 0 10px; }
+
+/* Style the fixed positioned notifications */
+#loading-notification { position: fixed; z-index: 1101; top: 3%; left: 40%; right: 40%; -webkit-box-shadow: 0 0 10px #c09853; -moz-box-shadow: 0 0 10px #c09853; box-shadow: 0 0 10px #c09853; }
+
+.change-notification { position: fixed; z-index: 1101; top: 4%; left: 30%; right: 30%; -webkit-box-shadow: 0 0 10px #3a87ad; -moz-box-shadow: 0 0 10px #3a87ad; box-shadow: 0 0 10px #3a87ad; }
+
+.alert-success.change-notification { -webkit-box-shadow: 0 0 10px #3c763d; -moz-box-shadow: 0 0 10px #3c763d; box-shadow: 0 0 10px #3c763d; }
+
+/* Style the new project form */
+#new-project-name { width: 33%; }
+#projectversion { width: 20%; margin-bottom: 10px; }
+
+/* Style the Toaster screenshot in the landing page */
+.img-thumbnail { padding: 0; }
+
+/* Set the layout for the build information pages */
+
+#nav { margin-top: 10px; }
+.page-header.build-data { margin-top: 0px; }
+.build-data > h1 { margin-top: 8px; }
+
+/* Style the build outcome information in the build dashboard */
+.log { margin-left: 30px; }
+.show-warnings { font-weight: 700; color: #8a6d3b; }
+.show-warnings:hover { color: #66512c; }
+
+/* Style the errors and warnings information in the build dashboard */
+#errors .panel-heading { background-color: transparent; color: #843534; }
+#warnings .panel-heading { background-color: transparent; color: #8a6d3b; }
+#warnings .panel-heading a:hover { color: #66512c; }
+h2.panel-title { font-size: 30px; }
+.alert-danger pre,
+.alert-warning pre { background-color: transparent; border: none; }
+.alert-danger pre { color: #a94442; }
+#error-info pre,
+#warning-info pre { white-space: pre-wrap; }
+.alert-warning pre { color: #8a6d3b; }
+
+/* Style the wells in the build dashboard */
+.dashboard-section h3 { margin-top: 10px; margin-bottom: 20px; }
+.col-md-4.dashboard-section dd { margin-bottom: 10px; }
+
+/* Make the help in tables insivisble until you hover over the right cell */
+.hover-help { visibility: hidden; }
+
+#add-remove-layer-btn { margin-bottom: 20px; }
+
+/* Blue hightlight animation for tasks and directory structure tables */
+.highlight { -webkit-animation: target-fade 15s 1; -moz-animation: target-fade 15s 1; animation: target-fade 15s 1; }
+@-webkit-keyframes target-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
+@-moz-keyframes target-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
+@keyframes target-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
+
+/* Copied in from newer version of Font-Awesome 4.3.0 */
+.fa-spin {
+ -webkit-animation: fa-spin 2s infinite linear;
+ animation: fa-spin 2s infinite linear;
+ display: inline-block;
+}
+.fa-pulse {
+ -webkit-animation: fa-spin 1s infinite steps(8);
+ animation: fa-spin 1s infinite steps(8);
+ display: inline-block;
+}
+
+@-webkit-keyframes fa-spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+
+@keyframes fa-spin {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ -moz-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(359deg);
+ -moz-transform: rotate(359deg);
+ transform: rotate(359deg);
+ }
+}
+/* End copied in from newer version of Font-Awesome 4.3.0 */
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css b/poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css
new file mode 100755
index 000000000..fa15fd528
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/font-awesome.min.css
@@ -0,0 +1,33 @@
+/*!
+ * Font Awesome 3.0.2
+ * the iconic font designed for use with Twitter Bootstrap
+ * -------------------------------------------------------
+ * The full suite of pictographic icons, examples, and documentation
+ * can be found at: http://fortawesome.github.com/Font-Awesome/
+ *
+ * License
+ * -------------------------------------------------------
+ * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL
+ * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License -
+ * http://opensource.org/licenses/mit-license.html
+ * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/
+ * - Attribution is no longer required in Font Awesome 3.0, but much appreciated:
+ * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
+
+ * Contact
+ * -------------------------------------------------------
+ * Email: dave@davegandy.com
+ * Twitter: http://twitter.com/fortaweso_me
+ * Work: Lead Product Designer @ http://kyruus.com
+ */
+
+@font-face{
+ font-family:'FontAwesome';
+ src:url('../fonts/fontawesome-webfont.eot?v=3.0.1');
+ src:url('../fonts/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
+ url('../fonts/fontawesome-webfont.woff?v=3.0.1') format('woff'),
+ url('../fonts/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
+ font-weight:normal;
+ font-style:normal }
+
+[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}a [class^="icon-"],a [class*=" icon-"]{display:inline-block}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}.btn [class^="icon-"],.nav [class^="icon-"],.btn [class*=" icon-"],.nav [class*=" icon-"]{display:inline}.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}li [class^="icon-"],.nav li [class^="icon-"],li [class*=" icon-"],.nav li [class*=" icon-"]{display:inline-block;width:1.25em;text-align:center}li [class^="icon-"].icon-large,.nav li [class^="icon-"].icon-large,li [class*=" icon-"].icon-large,.nav li [class*=" icon-"].icon-large{width:1.5625em}ul.icons{list-style-type:none;text-indent:-0.75em}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em}.icon-muted{color:#eee}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@-moz-document url-prefix(){.icon-spin{height:.9em}.btn .icon-spin{height:auto}.icon-spin.icon-large{height:1.25em}.btn .icon-spin.icon-large{height:.75em}}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
new file mode 100755
index 000000000..d5d78a3cf
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
new file mode 100755
index 000000000..1b0a045e4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png
new file mode 100755
index 000000000..c55f8ef7b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png
new file mode 100755
index 000000000..ea4fa0fc4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png
new file mode 100755
index 000000000..2f59e2d8c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100755
index 000000000..f172b302f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
new file mode 100644
index 000000000..1039d548c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
new file mode 100755
index 000000000..1089b70c7
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
new file mode 100755
index 000000000..561b7f842
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png
new file mode 100644
index 000000000..e9c8e16ac
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png
new file mode 100644
index 000000000..8d68c543e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png
new file mode 100644
index 000000000..18bbfe821
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png
new file mode 100644
index 000000000..4435b497e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png
new file mode 100644
index 000000000..4d66f596e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css
new file mode 100755
index 000000000..c486ec045
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.min.css
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.11.4 - 2015-03-17
+* http://jqueryui.com
+* Includes: core.css, datepicker.css, theme.css
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_228ef1_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ffd27a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url("images/ui-bg_flat_10_000000_40x100.png") 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css
new file mode 100755
index 000000000..d1578a4e9
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.structure.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.11.4 - 2015-03-15
+* http://jqueryui.com
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css
new file mode 100755
index 000000000..34543111e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery-ui.theme.min.css
@@ -0,0 +1,5 @@
+/*! jQuery UI - v1.11.4 - 2015-03-17
+* http://jqueryui.com
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-default .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-active .ui-icon{background-image:url("images/ui-icons_ef8c08_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("images/ui-icons_228ef1_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_ffd27a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url("images/ui-bg_flat_10_000000_40x100.png") 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css
new file mode 100644
index 000000000..4e95bfd3a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css
@@ -0,0 +1,28 @@
+table.treetable span.indenter {
+ display: inline-block;
+ margin: 0;
+ padding: 0;
+ text-align: right;
+
+ /* Disable text selection of nodes (for better D&D UX) */
+ user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -o-user-select: none;
+ -webkit-user-select: none;
+
+ /* Force content-box box model for indenter (Bootstrap compatibility) */
+ -webkit-box-sizing: content-box;
+ -moz-box-sizing: content-box;
+ box-sizing: content-box;
+
+ width: 19px;
+}
+
+table.treetable span.indenter a {
+ background-position: left center;
+ background-repeat: no-repeat;
+ display: inline-block;
+ text-decoration: none;
+ width: 19px;
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css
new file mode 100644
index 000000000..48289baad
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css
@@ -0,0 +1,64 @@
+table.treetable {
+ border: 1px solid #888;
+ border-collapse: collapse;
+ font-size: .8em;
+ line-height: 1;
+ margin: .6em 0 1.8em 0;
+ width: 100%;
+}
+
+table.treetable caption {
+ font-size: .9em;
+ font-weight: bold;
+ margin-bottom: .2em;
+}
+
+table.treetable tbody tr td {
+ cursor: default;
+ padding: .3em 1em;
+}
+
+table.treetable span {
+ background-position: center left;
+ background-repeat: no-repeat;
+ padding: .2em 0 .2em 1.5em;
+}
+
+table.treetable span.file {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC);
+}
+
+table.treetable span.folder {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC);
+}
+
+table.treetable tr.collapsed span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNrcU1sNgDAQ6wgmcAM2MICGGlg1gJnNzWQcvwQGy1j4oUl/7tH0mpwzM7SgQyO+EZAUWh2MkkzSWhJwuRAlHYsJwEwyvs1gABDuzqoJcTw5qxaIJN0bgQRgIjnlmn1heSO5PE6Y2YXe+5Cr5+h++gs12AcAS6FS+7YOsj4AAAAASUVORK5CYII=);
+}
+
+table.treetable tr.expanded span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHFJREFUeNpi/P//PwMlgImBQsA44C6gvhfa29v3MzAwOODRc6CystIRbxi0t7fjDJjKykpGYrwwi1hxnLHQ3t7+jIGBQRJJ6HllZaUUKYEYRYBPOB0gBShKwKGA////48VtbW3/8clTnBIH3gCKkzJgAGvBX0dDm0sCAAAAAElFTkSuQmCC);
+}
+
+
+
+table.treetable tr.collapsed.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
+
+table.treetable tr.accept {
+ background-color: #a3bce4;
+ color: #fff
+}
+
+table.treetable tr.collapsed.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css
new file mode 100644
index 000000000..d8552e581
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css
@@ -0,0 +1,38 @@
+table.treetable span.file {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC);
+}
+
+table.treetable span.folder {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC);
+}
+
+table.treetable tr.collapsed span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNrcU1sNgDAQ6wgmcAM2MICGGlg1gJnNzWQcvwQGy1j4oUl/7tH0mpwzM7SgQyO+EZAUWh2MkkzSWhJwuRAlHYsJwEwyvs1gABDuzqoJcTw5qxaIJN0bgQRgIjnlmn1heSO5PE6Y2YXe+5Cr5+h++gs12AcAS6FS+7YOsj4AAAAASUVORK5CYII=);
+}
+
+table.treetable tr.expanded span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHFJREFUeNpi/P//PwMlgImBQsA44C6gvhfa29v3MzAwOODRc6CystIRbxi0t7fjDJjKykpGYrwwi1hxnLHQ3t7+jIGBQRJJ6HllZaUUKYEYRYBPOB0gBShKwKGA////48VtbW3/8clTnBIH3gCKkzJgAGvBX0dDm0sCAAAAAElFTkSuQmCC);
+}
+
+
+
+table.treetable tr.collapsed.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
+
+table.treetable tr.accept {
+ background-color: #a3bce4;
+ color: #fff
+}
+
+table.treetable tr.collapsed.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css b/poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css
new file mode 100644
index 000000000..28cca1cc1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/qunit-1.18.0.css
@@ -0,0 +1 @@
+/**//**/#qunit-tests,#qunit-header,#qunit-banner,#qunit-testrunner-toolbar,#qunit-userAgent,#qunit-testresult{font-family:"Helvetica Neue Light","HelveticaNeue-Light","Helvetica Neue",Calibri,Helvetica,Arial,sans-serif;}#qunit-testrunner-toolbar,#qunit-userAgent,#qunit-testresult,#qunit-tests li{font-size:small;}#qunit-tests{font-size:smaller;}/**/#qunit-tests,#qunit-header,#qunit-banner,#qunit-userAgent,#qunit-testresult,#qunit-modulefilter{margin:0;padding:0;}/**/#qunit-header{padding:0.5em 0 0.5em 1em;color:#8699A4;background-color:#0D3349;font-size:1.5em;line-height:1em;font-weight:400;border-radius:5px 5px 0 0;}#qunit-header a{text-decoration:none;color:#C2CCD1;}#qunit-header a:hover,#qunit-header a:focus{color:#FFF;}#qunit-testrunner-toolbar label{display:inline-block;padding:0 0.5em 0 0.1em;}#qunit-banner{height:5px;}#qunit-testrunner-toolbar{padding:0.5em 1em 0.5em 1em;color:#5E740B;background-color:#EEE;overflow:hidden;}#qunit-userAgent{padding:0.5em 1em 0.5em 1em;background-color:#2B81AF;color:#FFF;text-shadow:rgba(0,0,0,0.5) 2px 2px 1px;}#qunit-modulefilter-container{float:right;padding:0.2em;}.qunit-url-config{display:inline-block;padding:0.1em;}.qunit-filter{display:block;float:right;margin-left:1em;}/**/#qunit-tests{list-style-position:inside;}#qunit-tests li{padding:0.4em 1em 0.4em 1em;border-bottom:1px solid #FFF;list-style-position:inside;}#qunit-tests>li{display:none;}#qunit-tests li.running,#qunit-tests li.pass,#qunit-tests li.fail,#qunit-tests li.skipped{display:list-item;}#qunit-tests.hidepass li.running,#qunit-tests.hidepass li.pass{visibility:hidden;position:absolute;width:0px;height:0px;padding:0;border:0;margin:0;}#qunit-tests li strong{cursor:pointer;}#qunit-tests li.skipped strong{cursor:default;}#qunit-tests li a{padding:0.5em;color:#C2CCD1;text-decoration:none;}#qunit-tests li p a{padding:0.25em;color:#6B6464;}#qunit-tests li a:hover,#qunit-tests li a:focus{color:#000;}#qunit-tests li .runtime{float:right;font-size:smaller;}.qunit-assert-list{margin-top:0.5em;padding:0.5em;background-color:#FFF;border-radius:5px;}.qunit-collapsed{display:none;}#qunit-tests table{border-collapse:collapse;margin-top:0.2em;}#qunit-tests th{text-align:right;vertical-align:top;padding:0 0.5em 0 0;}#qunit-tests td{vertical-align:top;}#qunit-tests pre{margin:0;white-space:pre-wrap;word-wrap:break-word;}#qunit-tests del{background-color:#E0F2BE;color:#374E0C;text-decoration:none;}#qunit-tests ins{background-color:#FFCACA;color:#500;text-decoration:none;}/**/#qunit-tests b.counts{color:#000;}#qunit-tests b.passed{color:#5E740B;}#qunit-tests b.failed{color:#710909;}#qunit-tests li li{padding:5px;background-color:#FFF;border-bottom:none;list-style-position:inside;}/**/#qunit-tests li li.pass{color:#3C510C;background-color:#FFF;border-left:10px solid #C6E746;}#qunit-tests .pass{color:#528CE0;background-color:#D2E0E6;}#qunit-tests .pass .test-name{color:#366097;}#qunit-tests .pass .test-actual,#qunit-tests .pass .test-expected{color:#999;}#qunit-banner.qunit-pass{background-color:#C6E746;}/**/#qunit-tests li li.fail{color:#710909;background-color:#FFF;border-left:10px solid #EE5757;white-space:pre;}#qunit-tests>li:last-child{border-radius:0 0 5px 5px;}#qunit-tests .fail{color:#000;background-color:#EE5757;}#qunit-tests .fail .test-name,#qunit-tests .fail .module-name{color:#000;}#qunit-tests .fail .test-actual{color:#EE5757;}#qunit-tests .fail .test-expected{color:#008000;}#qunit-banner.qunit-fail{background-color:#EE5757;}/**/#qunit-tests .skipped{background-color:#EBECE9;}#qunit-tests .qunit-skipped-label{background-color:#F4FF77;display:inline-block;font-style:normal;color:#366097;line-height:1.8em;padding:0 0.5em;margin:-0.4em 0.4em -0.4em 0;}/**/#qunit-testresult{padding:0.5em 1em 0.5em 1em;color:#2B81AF;background-color:#D2E0E6;border-bottom:1px solid #FFF;}#qunit-testresult .module-name{font-weight:700;}/**/#qunit-fixture{position:absolute;top:-10000px;left:-10000px;width:1000px;height:1000px;} \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/css/screen.css b/poky/bitbake/lib/toaster/toastergui/static/css/screen.css
new file mode 100644
index 000000000..e233ef6ae
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/css/screen.css
@@ -0,0 +1,28 @@
+body {
+ background: #ddd;
+ color: #000;
+ font-family: Helvetica, Arial, sans-serif;
+ line-height: 1.5;
+ margin: 0;
+ padding: 0;
+}
+
+#main {
+ background: #fff;
+ border-left: 20px solid #eee;
+ border-right: 20px solid #eee;
+ margin: 0 auto;
+ max-width: 800px;
+ padding: 20px;
+}
+
+pre.listing {
+ background: #eee;
+ border: 1px solid #ccc;
+ margin: .6em 0 .3em 0;
+ padding: .1em .3em;
+}
+
+pre.listing b {
+ color: #f00;
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf b/poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf
new file mode 100644
index 000000000..64049bf2e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otf
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot
new file mode 100644
index 000000000..7d81019e4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg
new file mode 100644
index 000000000..ba0afe5ef
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg
@@ -0,0 +1,284 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="fontawesomeregular" horiz-adv-x="1536" >
+<font-face units-per-em="1792" ascent="1536" descent="-256" />
+<missing-glyph horiz-adv-x="448" />
+<glyph unicode=" " horiz-adv-x="448" />
+<glyph unicode="&#x09;" horiz-adv-x="448" />
+<glyph unicode="&#xa0;" horiz-adv-x="448" />
+<glyph unicode="&#xa8;" horiz-adv-x="1792" />
+<glyph unicode="&#xa9;" horiz-adv-x="1792" />
+<glyph unicode="&#xae;" horiz-adv-x="1792" />
+<glyph unicode="&#xb4;" horiz-adv-x="1792" />
+<glyph unicode="&#xc6;" horiz-adv-x="1792" />
+<glyph unicode="&#x2000;" horiz-adv-x="768" />
+<glyph unicode="&#x2001;" />
+<glyph unicode="&#x2002;" horiz-adv-x="768" />
+<glyph unicode="&#x2003;" />
+<glyph unicode="&#x2004;" horiz-adv-x="512" />
+<glyph unicode="&#x2005;" horiz-adv-x="384" />
+<glyph unicode="&#x2006;" horiz-adv-x="256" />
+<glyph unicode="&#x2007;" horiz-adv-x="256" />
+<glyph unicode="&#x2008;" horiz-adv-x="192" />
+<glyph unicode="&#x2009;" horiz-adv-x="307" />
+<glyph unicode="&#x200a;" horiz-adv-x="85" />
+<glyph unicode="&#x202f;" horiz-adv-x="307" />
+<glyph unicode="&#x205f;" horiz-adv-x="384" />
+<glyph unicode="&#x2122;" horiz-adv-x="1792" />
+<glyph unicode="&#x221e;" horiz-adv-x="1792" />
+<glyph unicode="&#x2260;" horiz-adv-x="1792" />
+<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
+<glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
+<glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
+<glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
+<glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
+<glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
+<glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
+<glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
+<glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
+<glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
+<glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
+<glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
+<glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
+<glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
+<glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
+<glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
+<glyph unicode="&#xf016;" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h299l-299 299v-299zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544q40 0 88 -20t76 -48l408 -408q28 -28 48 -76t20 -88z" />
+<glyph unicode="&#xf017;" d="M1088 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-384q-13 0 -22.5 9.5t-9.5 22.5v448q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-352h288q13 0 22.5 -9.5t9.5 -22.5zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5 t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5 t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
+<glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1339 729q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39zM1632 512q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-1600q-14 0 -23 9t-9 23v576q0 14 9 23 t23 9h192q14 0 23 -9t9 -23v-352h1152v352q0 14 9 23t23 9h192z" />
+<glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-9 -9 -23 -9t-23 9l-320 320q-9 9 -9 23q0 13 9.5 22.5t22.5 9.5h192v352q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5v-352h192q14 0 23 -9t9 -23zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5 t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5 t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01b;" d="M1120 672q0 -13 -9.5 -22.5t-22.5 -9.5h-192v-352q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q9 9 23 9t23 -9l320 -320q9 -9 9 -23zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5 t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
+<glyph unicode="&#xf01d;" d="M1152 640q0 -37 -33 -56l-512 -288q-14 -8 -31 -8t-32 9q-32 18 -32 55v576q0 37 32 55q31 20 63 1l512 -288q33 -19 33 -56zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5 t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q169 0 304 99.5t185 261.5q7 23 30 23h199 q16 0 25 -12q10 -13 7 -27q-39 -175 -147.5 -312t-266 -213t-336.5 -76q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
+<glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
+<glyph unicode="&#xf023;" horiz-adv-x="1152" d="M704 512q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5q0 -37 19 -67t51 -47l-69 -229q-5 -15 5 -28t26 -13h192q16 0 26 13t5 28l-69 229q32 17 51 47t19 67zM320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68 t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
+<glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
+<glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
+<glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
+<glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M672 1408v-1536h-64v1536h64zM1408 1408v-1536h-64v1536h64zM1568 1408v-1536h-64v1536h64zM576 1408v-1536h-64v1536h64zM1280 1408v-1536h-256v1536h256zM896 1408v-1536h-128v1536h128zM448 1408v-1536h-128v1536h128zM1792 1408v-1536h-128v1536h128zM256 1408v-1536 h-256v1536h256z" />
+<glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
+<glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
+<glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
+<glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
+<glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
+<glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
+<glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" />
+<glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" />
+<glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" />
+<glyph unicode="&#xf034;" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" />
+<glyph unicode="&#xf035;" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" />
+<glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03d;" horiz-adv-x="1920" d="M1900 1278q20 -8 20 -30v-1216q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-585 586v-307q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-307l585 586q16 15 35 7z" />
+<glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
+<glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
+<glyph unicode="&#xf042;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM256 640q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5v1024q-104 0 -198.5 -40.5 t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5z" />
+<glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
+<glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
+<glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
+<glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
+<glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
+<glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
+<glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
+<glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
+<glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
+<glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
+<glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
+<glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
+<glyph unicode="&#xf053;" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" />
+<glyph unicode="&#xf054;" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" />
+<glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
+<glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf059;" d="M896 160v192q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-192q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1152 832q0 97 -58.5 172t-144.5 111.5t-181 36.5t-181 -36.5t-144.5 -111.5t-58.5 -172v-11v-13t1 -11.5t3 -11.5t5.5 -8t9 -7 t13.5 -2h192q14 0 23 9t9 23q0 12 11 27q19 31 50.5 50t66.5 19q39 0 83 -21.5t44 -57.5q0 -33 -26.5 -58t-63.5 -44t-74.5 -41.5t-64 -63.5t-26.5 -98v-11v-13t1 -11.5t3 -11.5t5.5 -8t9 -7t13.5 -2h192q17 0 24 10.5t8 24.5t13.5 33t37.5 32q60 33 70 39q62 44 98.5 108 t36.5 137zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05a;" d="M1024 160v64q0 14 -9 23t-23 9h-96v480q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h96v-384h-96q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 928v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf05c;" d="M1125 448q0 -27 -18 -45l-102 -102q-18 -18 -45 -18t-45 18l-147 147l-147 -147q-18 -18 -45 -18t-45 18l-102 102q-18 18 -18 45t18 45l147 147l-147 147q-18 18 -18 45t18 45l102 102q18 18 45 18t45 -18l147 -147l147 147q18 18 45 18t45 -18l102 -102q18 -18 18 -45 t-18 -45l-147 -147l147 -147q18 -18 18 -45zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5 t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05d;" d="M1189 768q0 -27 -18 -45l-320 -320l-102 -102q-18 -18 -45 -18t-45 18l-102 102l-192 192q-18 18 -18 45t18 45l102 102q18 18 45 18t45 -18l147 -147l275 275q18 18 45 18t45 -18l102 -102q18 -18 18 -45zM1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5 t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05e;" d="M1280 640q0 139 -71 260l-701 -701q121 -71 260 -71q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM327 380l701 701q-121 71 -260 71q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5q0 -139 71 -260zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
+<glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
+<glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
+<glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
+<glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
+<glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
+<glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
+<glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
+<glyph unicode="&#xf06b;" d="M928 180v716h-320v-716q0 -25 18.5 -38.5t45.5 -13.5h192q27 0 45.5 13.5t18.5 38.5zM472 1024h195l-126 161q-24 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-45 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -10 -22t-27 -10.5t-32 -2.5t-34.5 1.5t-24.5 1.5v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416q-5 0 -24.5 -1.5t-34.5 -1.5t-32 2.5t-27 10.5t-10 22v320q0 13 9.5 22.5t22.5 9.5h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5 q108 0 168 -77l128 -165l128 165q60 77 168 77q93 0 158.5 -65.5t65.5 -158.5t-65.5 -158.5t-158.5 -65.5h440q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
+<glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
+<glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
+<glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
+<glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
+<glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1397 1324q0 -87 -149 -236l-240 -240l143 -746l1 -6q0 -14 -9 -23l-64 -64q-9 -9 -23 -9q-21 0 -29 18l-274 575l-245 -245q68 -238 68 -252t-9 -23l-64 -64q-9 -9 -23 -9q-18 0 -28 16l-155 280l-280 155q-17 9 -17 28q0 14 9 23l64 65q9 9 23 9t252 -68l245 245 l-575 274q-18 8 -18 29q0 14 9 23l64 64q9 9 23 9q4 0 6 -1l746 -143l240 240q149 149 236 149q32 0 52.5 -20.5t20.5 -52.5z" />
+<glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
+<glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
+<glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
+<glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf077;" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" />
+<glyph unicode="&#xf078;" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
+<glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
+<glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf080;" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf081;" d="M1280 958q0 13 -9.5 22.5t-22.5 9.5q-5 0 -15 -4q20 34 20 55q0 13 -9.5 22.5t-22.5 9.5q-7 0 -17 -5q-60 -34 -97 -43q-65 63 -154 63q-98 0 -164.5 -72.5t-64.5 -169.5v-12q-107 14 -187.5 64t-156.5 139q-10 12 -28 12q-26 0 -41 -50.5t-15 -86.5q0 -62 29 -117 q-13 -2 -21.5 -11.5t-8.5 -22.5q0 -112 81 -185q-12 -8 -12 -25q0 -6 1 -9q15 -51 50.5 -91.5t84.5 -60.5q-77 -43 -165 -43q-8 0 -24 1.5t-23 1.5q-13 0 -22.5 -9.5t-9.5 -22.5q0 -17 14 -26q63 -47 150 -73.5t170 -26.5q130 0 248 58q166 79 256 232.5t88 339.5v12 q27 22 62.5 63t35.5 61zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf082;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-350q-2 0 -2 1v671h177q31 0 32 23l12 164q2 15 -8 25q-10 12 -24 12h-189v72q0 44 11.5 57t54.5 13q57 0 117 -13q13 -3 26 5q11 8 13 22l23 166q2 12 -5.5 22.5t-19.5 13.5 q-93 26 -197 26q-311 0 -311 -299v-85h-95q-13 0 -23 -10.5t-10 -24.5v-172q0 -8 5.5 -12t10 -4.5t17.5 -0.5h95v-671l10 -1h-330q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
+<glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
+<glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
+<glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
+<glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
+<glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
+<glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
+<glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
+<glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
+<glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
+<glyph unicode="&#xf08c;" d="M512 160v640q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-640q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM503 1028q0 51 -36 87.5t-88 36.5q-51 0 -87 -36.5t-36 -87.5t36 -87.5t87 -36.5q52 0 88 36.5t36 87.5zM1280 160v435 q0 127 -73.5 192.5t-202.5 65.5q-90 0 -158 -45q-12 -8 -14 -12q0 36 -35 36h-176q-14 0 -29.5 -7.5t-15.5 -20.5v-644q0 -13 15.5 -22.5t29.5 -9.5h182q12 0 20.5 9.5t8.5 22.5v349q0 140 114 140q49 0 63.5 -22.5t14.5 -73.5v-393q0 -13 12 -22.5t26 -9.5h186 q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
+<glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf092;" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -26t19 -63zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -52 41 -77v-3q-113 -37 -113 -139q0 -60 36 -98t84 -51t107 -13q224 0 224 187q0 48 -25.5 78t-62.5 42.5t-74 21.5t-62.5 23.5t-25.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q30 7 49 13zM771 350h137q-2 20 -2 90v372q0 59 2 76h-137q3 -26 3 -79v-377 q0 -55 -3 -82zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q4 0 11.5 -0.5t11.5 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1664 480v-576q0 -13 -9.5 -22.5t-22.5 -9.5h-1600q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5v-352h1152v352q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1344 832q0 -26 -19 -45t-45 -19h-256v-448 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
+<glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
+<glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
+<glyph unicode="&#xf096;" horiz-adv-x="1664" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
+<glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf099;" horiz-adv-x="1920" d="M1875 1202q0 -10 -5 -18q-64 -104 -179 -190v-33q4 -227 -100 -457q-134 -297 -397.5 -464.5t-591.5 -167.5q-265 0 -500 122q-64 33 -87 50q-15 12 -15 27q0 13 9.5 22.5t22.5 9.5q14 0 44 -2.5t45 -2.5q204 0 375 106q-103 24 -181 96t-111 173q-2 8 -2 11q0 12 9 21.5 t22 9.5q5 0 14 -2t12 -2q-89 55 -142 147t-53 196q0 15 11.5 25.5t27.5 10.5q10 0 35 -11.5t30 -13.5q-92 110 -92 256q0 51 14.5 108t40.5 95q10 16 25 16q16 0 27 -12q76 -84 110 -115q123 -111 276 -177.5t317 -80.5q-4 21 -4 49q0 167 118.5 285.5t285.5 118.5 q163 0 282 -114q95 20 209 82q8 5 16 5q13 0 22.5 -9.5t9.5 -22.5q0 -24 -28 -73t-51 -76q7 2 30 10.5t43 16t24 7.5q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf09a;" horiz-adv-x="768" d="M560 1125q-49 0 -62 -15.5t-13 -66.5v-88h217q16 0 27 -12q11 -13 10 -29l-14 -200q-2 -15 -12.5 -25.5t-25.5 -10.5h-202v-768q0 -16 -11 -27t-26 -11h-250q-16 0 -27 11t-11 27v768h-122q-16 0 -27 11.5t-11 27.5v200q0 16 11 27t27 11h122v103q0 177 88 263.5 t267 86.5q120 0 225 -30q14 -4 22 -16t6 -26l-27 -195q-2 -16 -16 -26q-14 -9 -30 -6q-76 16 -135 16z" />
+<glyph unicode="&#xf09b;" d="M1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5q0 -209 124.5 -378.5t323.5 -231.5v169q-54 -7 -69 -7q-110 0 -153 100q-15 38 -36 63q-5 6 -21 19t-28.5 24t-12.5 16q0 12 28 12q29 0 51.5 -14.5t38 -35 t31.5 -41.5t40.5 -35.5t56.5 -14.5q42 0 81 14q16 57 63 89q-166 16 -246 83.5t-80 224.5q0 118 73 198q-14 42 -14 84q0 58 27 109q57 0 101 -19.5t101 -60.5q76 18 169 18q80 0 153 -16q57 40 100.5 59t99.5 19q27 -51 27 -109q0 -43 -14 -83q73 -82 73 -199 q0 -157 -80 -225.5t-245 -83.5q69 -47 69 -131v-226q199 62 323.5 231.5t124.5 378.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M704 160q0 6 -15 57t-35 115.5t-20 65.5q32 16 51 47t19 67q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5q0 -36 19 -66.5t51 -47.5q0 -2 -20 -66t-35 -115t-15 -57q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1664 960v-256q0 -26 -19 -45t-45 -19 h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5z" />
+<glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
+<glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
+<glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
+<glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
+<glyph unicode="&#xf0a2;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
+<glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
+<glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
+<glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67 11.5t-64 38.5t-48 44t-50 55q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
+<glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
+<glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -46 -25 -91t-52 -72t-72 -66q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33t55 33 t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580q0 -142 -77.5 -230 t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100q3 2 17 14t21.5 19 t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
+<glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0ac;" d="M1193 993q11 7 25 22v-1q0 -2 -9.5 -10t-11.5 -12q-1 1 -4 1zM1187 992q-1 1 -2.5 3t-1.5 3q3 -2 10 -5q-6 -4 -6 -1zM728 1175q-16 2 -26 5q1 0 6.5 -1t10.5 -2t9 -2zM773 1212q7 4 13.5 2.5t7.5 -7.5q-5 3 -21 5zM765 1206l-3 2q-2 3 -5.5 5t-4.5 2q2 -1 21 -3 q-6 -4 -8 -6zM663 1290v2q1 -2 3 -5.5t3 -5.5zM558 1250q0 -2 -1 -2l-1 2h2zM933 206v-1v1zM768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1240 162 l5 5q-7 10 -29 12q1 12 -14 26.5t-27 15.5q0 4 -10.5 11t-17.5 8q-9 2 -27 -9q-7 -3 -4 -5q-3 3 -12 11t-16 11q-2 1 -7.5 1t-8.5 2q-1 1 -6 4.5t-7 4.5t-6.5 3t-7.5 1.5t-7.5 -2.5t-8.5 -6t-4.5 -15.5t-2.5 -14.5q-8 6 -0.5 20t1.5 20q-7 7 -21 0.5t-21 -15.5 q-1 -1 -9.5 -5.5t-11.5 -7.5q-4 -6 -9 -17.5t-6 -13.5q0 2 -2.5 6.5t-2.5 6.5q-12 -2 -16 3q5 -16 8 -17l-4 2q-1 -6 3 -15t4 -11q1 -5 -1.5 -13t-2.5 -11q0 -2 5 -11q4 -19 -2 -32q0 -1 -3.5 -7t-6.5 -11l-2 -5l-2 1q-1 1 -2 0q-1 -6 -9 -13t-10 -11q-15 -23 -9 -38 q3 -8 10 -10q3 -1 3 2q1 -9 -11 -27q1 -1 4 -3q-17 0 -10 -14q202 36 352 181h-3zM680 347q16 3 30.5 -16t22.5 -23q41 -20 59 -11q0 -9 14 -28q3 -4 6.5 -11.5t5.5 -10.5q5 -7 19 -16t19 -16q6 3 9 9q13 -35 24 -34q5 0 8 8q0 -1 -0.5 -3t-1.5 -3q7 15 5 26l6 4q5 4 5 5 q-6 6 -9 -3q-30 -14 -48 22q-2 3 -4.5 8t-5 12t-1.5 11.5t6 4.5q11 0 12.5 1.5t-2.5 6t-4 7.5q-1 4 -1.5 12.5t-1.5 12.5l-5 6q-5 6 -11.5 13.5t-7.5 9.5q-4 -10 -16.5 -8.5t-18.5 9.5q1 -2 -0.5 -6.5t-1.5 -6.5q-14 0 -17 1q1 6 3 21t4 22q1 5 5.5 13.5t8 15.5t4.5 14 t-4.5 10.5t-18.5 2.5q-20 -1 -29 -22q-1 -3 -3 -11.5t-5 -12.5t-9 -7q-8 -3 -27 -2t-26 5q-14 8 -24 30.5t-11 41.5q0 10 3 27.5t3 27t-6 26.5q3 2 10 10.5t11 11.5q2 2 5 2h5t4 2t3 6q-1 1 -4 3q-3 3 -4 3q4 -3 19 -1t19 2q0 1 22 0q17 -13 24 2q0 1 -2.5 10.5t-0.5 14.5 q5 -29 32 -10q3 -4 16.5 -6t18.5 -5q3 -2 7 -5.5t6 -5t6 -0.5t9 7q11 -17 13 -25q11 -43 20 -48q8 -2 12.5 -2t5 10.5t0 15.5t-1.5 13l-2 37q-16 3 -20 12.5t1.5 20t16.5 19.5q1 1 16.5 8t21.5 12q24 19 17 39q9 -2 11 9l-5 3q-4 3 -8 5.5t-5 1.5q11 7 2 18q5 3 8 11.5 t9 11.5q9 -14 22 -3q8 9 2 18q5 8 22 11.5t20 9.5q5 -1 7 0t2 4.5v7.5t1 8.5t3 7.5q4 6 16 10.5t14 5.5l19 12q4 4 0 4q18 -2 32 11q13 12 -5 23q2 7 -4 10.5t-16 5.5q3 1 12 0.5t12 1.5q15 11 -7 17q-20 5 -47 -13q-3 -2 -13 -12t-17 -11q15 18 5 22q8 -1 22.5 9t15.5 11 q4 2 10.5 2.5t8.5 1.5q71 25 92 -1q8 11 11 15t9.5 9t15.5 8q21 7 23 9l1 23q-12 -1 -18 8t-7 22l-6 -8q0 6 -3.5 7.5t-7.5 0.5t-9.5 -2t-7.5 0q-9 2 -19.5 15.5t-14.5 16.5q9 0 9 5q-2 5 -10 8q1 6 -2 8t-9 0q-2 12 -1 13q-6 1 -11 11t-8 10q-2 0 -4.5 -2t-5 -5.5l-5 -7 t-3.5 -5.5l-2 -2q-12 6 -24 -10q-9 1 -17 -2q15 6 2 13q-11 5 -21 2q12 5 10 14t-12 16q1 0 4 -1t4 -1q-1 5 -9.5 9.5t-19.5 9t-14 6.5q-7 5 -36 10.5t-36 1.5q-5 -3 -6 -6t1.5 -8.5t3.5 -8.5q6 -23 5 -27q-1 -3 -8.5 -8t-5.5 -12q1 -4 11.5 -10t12.5 -12q5 -13 -4 -25 q-4 -5 -15 -11t-14 -10q-5 -5 -3.5 -11.5t0.5 -9.5q1 1 1 2.5t1 2.5q0 -13 11 -22q8 -6 -16 -18q-20 -11 -20 -4q1 8 -7.5 16t-10.5 12t-3.5 19t-9.5 21q-6 4 -19 4t-18 -5q0 10 -49 30q-17 8 -58 4q7 1 0 17q-8 16 -21 12q-8 25 -4 35q2 5 9 14t9 15q1 3 15.5 6t16.5 8 q1 4 -2.5 6.5t-9.5 4.5q53 -6 63 18q5 9 3 14q0 -1 2 -1t2 -1q12 3 7 17q19 8 26 8q5 -1 11 -6t10 -5q17 -3 21.5 10t-9.5 23q7 -4 7 6q-1 13 -7 19q-3 2 -6.5 2.5t-6.5 0t-7 0.5q-1 0 -8 2q-1 -1 -2 -1h-8q-4 -2 -4 -5v-1q-1 -3 4 -6l5 -1l3 -2q-1 0 -2.5 -2.5t-2.5 -2.5 q0 -3 3 -5q-2 -1 -14 -7.5t-17 -10.5q-1 -1 -4 -2.5t-4 -2.5q-2 -1 -4 2t-4 9t-4 11.5t-4.5 10t-5.5 4.5q-12 0 -18 -17q3 10 -13 17.5t-25 7.5q20 15 -9 30l-1 1q-30 -4 -45 -7q-2 -6 3 -12q-1 -7 6 -9q0 -1 0.5 -1t0.5 -1q0 1 -0.5 1t-0.5 1q3 -1 10.5 -1.5t9.5 -1.5 q3 -1 4.5 -2l7.5 -5t5.5 -6t-2.5 -5q-2 -1 -9 -4t-12.5 -5.5t-6.5 -3.5q-3 -5 0 -16t-2 -15q-5 5 -10 18.5t-8 17.5q8 -9 -30 -6l-8 1q-4 0 -15 -2t-16 -1q-7 0 -29 6q7 17 5 25q5 0 7 2l-6 3q-3 -1 -25 -9q2 -3 8 -9.5t9 -11.5q-22 6 -27 -2q0 -1 -9 0q-25 1 -24 -7 q1 -4 9 -12q0 -9 -1 -9q-27 22 -30 23q-172 -83 -276 -248q1 -2 2.5 -11t3.5 -8.5t11 4.5q9 -9 3 -21q2 2 36 -21q56 -40 22 -53v5.5t1 6.5q-9 -1 -19 5q-3 -6 0.5 -20t11.5 -14q-8 0 -10.5 -17t-2.5 -38.5t-1 -25.5l2 -1q-3 -13 6 -37.5t24 -20.5q-4 -18 5 -21q-1 -4 0 -8 t4.5 -8.5t6 -7l7.5 -7.5l6 -6q28 -11 41 -29q4 -6 10.5 -24.5t15.5 -25.5q-2 -6 10 -21.5t11 -25.5q-1 0 -2.5 -0.5t-2.5 -0.5q3 -8 16.5 -16t16.5 -14q2 -3 2.5 -10.5t3 -12t8.5 -2.5q3 24 -26 68q-16 27 -18 31q-3 5 -5.5 16.5t-4.5 15.5q27 -9 26 -13q-5 -10 26 -52 q2 -3 10 -10t11 -12q3 -4 9.5 -14.5t10.5 -15.5q-1 0 -3 -2l-3 -3q4 -2 9 -5t8 -4.5t7.5 -5t7.5 -7.5q16 -18 20 -33q1 -4 0.5 -15.5t1.5 -16.5q2 -6 6 -11t11.5 -10t11.5 -7t14.5 -6.5t11.5 -5.5q2 -1 18 -11t25 -14q10 -4 16.5 -4.5t16 2.5t15.5 4z" />
+<glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
+<glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
+<glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM1792 512v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 512v-128h-256v128h256zM1792 992v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
+<glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
+<glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
+<glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
+<glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
+<glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
+<glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
+<glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
+<glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
+<glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
+<glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
+<glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
+<glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
+<glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
+<glyph unicode="&#xf0d4;" d="M678 -57q0 -38 -10 -71h-380q-95 0 -171.5 56.5t-103.5 147.5q24 45 69 77.5t100 49.5t107 24t107 7q32 0 49 -2q6 -4 30.5 -21t33 -23t31 -23t32 -25.5t27.5 -25.5t26.5 -29.5t21 -30.5t17.5 -34.5t9.5 -36t4.5 -40.5zM385 294q-234 -7 -385 -85v433q103 -118 273 -118 q32 0 70 5q-21 -61 -21 -86q0 -67 63 -149zM558 805q0 -100 -43.5 -160.5t-140.5 -60.5q-51 0 -97 26t-78 67.5t-56 93.5t-35.5 104t-11.5 99q0 96 51.5 165t144.5 69q66 0 119 -41t84 -104t47 -130t16 -128zM1536 896v-736q0 -119 -84.5 -203.5t-203.5 -84.5h-468 q39 73 39 157q0 66 -22 122.5t-55.5 93t-72 71t-72 59.5t-55.5 54.5t-22 59.5q0 36 23 68t56 61.5t65.5 64.5t55.5 93t23 131t-26.5 145.5t-75.5 118.5q-6 6 -14 11t-12.5 7.5t-10 9.5t-10.5 17h135l135 64h-437q-138 0 -244.5 -38.5t-182.5 -133.5q0 126 81 213t207 87h960 q119 0 203.5 -84.5t84.5 -203.5v-96h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" />
+<glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M876 71q0 21 -4.5 40.5t-9.5 36t-17.5 34.5t-21 30.5t-26.5 29.5t-27.5 25.5t-32 25.5t-31 23t-33 23t-30.5 21q-17 2 -50 2q-54 0 -106 -7t-108 -25t-98 -46t-69 -75t-27 -107q0 -68 35.5 -121.5t93 -84t120.5 -45.5t127 -15q59 0 112.5 12.5t100.5 39t74.5 73.5 t27.5 110zM756 933q0 60 -16.5 127.5t-47 130.5t-84 104t-119.5 41q-93 0 -144 -69t-51 -165q0 -47 11.5 -99t35.5 -104t56 -93.5t78 -67.5t97 -26q97 0 140.5 60.5t43.5 160.5zM625 1408h437l-135 -79h-135q71 -45 110 -126t39 -169q0 -74 -23 -131.5t-56 -92.5t-66 -64.5 t-56 -61t-23 -67.5q0 -26 16.5 -51t43 -48t58.5 -48t64 -55.5t58.5 -66t43 -85t16.5 -106.5q0 -160 -140 -282q-152 -131 -420 -131q-59 0 -119.5 10t-122 33.5t-108.5 58t-77 89t-30 121.5q0 61 37 135q32 64 96 110.5t145 71t155 36t150 13.5q-64 83 -64 149q0 12 2 23.5 t5 19.5t8 21.5t7 21.5q-40 -5 -70 -5q-149 0 -255.5 98t-106.5 246q0 140 95 250.5t234 141.5q94 20 187 20zM1664 1152v-128h-256v-256h-128v256h-256v128h256v256h128v-256h256z" />
+<glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
+<glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
+<glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
+<glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
+<glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
+<glyph unicode="&#xf0e1;" horiz-adv-x="1379" d="M1014 961q171 0 268 -85.5t97 -254.5v-586q0 -14 -10.5 -24.5t-24.5 -10.5h-252q-14 0 -24.5 10.5t-10.5 24.5v529q0 71 -26.5 104t-95.5 33q-88 0 -123.5 -51.5t-35.5 -143.5v-471q0 -14 -10.5 -24.5t-25.5 -10.5h-246q-14 0 -24.5 10.5t-10.5 24.5v868q0 14 10.5 24.5 t24.5 10.5h239q13 0 21 -5t10.5 -18.5t3 -18t0.5 -22.5q93 87 246 87zM290 938q14 0 24.5 -10.5t10.5 -24.5v-868q0 -14 -10.5 -24.5t-24.5 -10.5h-246q-14 0 -24.5 10.5t-10.5 24.5v868q0 14 10.5 24.5t24.5 10.5h246zM167 1371q69 0 118 -49t49 -118t-49 -118t-118 -49 t-118 49t-49 118t49 118t118 49z" />
+<glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-179 0 -336.5 76t-266 213t-147.5 312q-3 14 7 27q9 12 25 12h199q23 0 30 -23q50 -162 185 -261.5t304 -99.5q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5t-163.5 109.5 t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
+<glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
+<glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
+<glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
+<glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
+<glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
+<glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
+<glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
+<glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
+<glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
+<glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
+<glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
+<glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
+<glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
+<glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
+<glyph unicode="&#xf0f3;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1664 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5 q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
+<glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
+<glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0f6;" horiz-adv-x="1280" d="M1024 352v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM1024 608v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704q14 0 23 -9t9 -23zM128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280z M768 896h299l-299 299v-299zM1280 768v-800q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h544q40 0 88 -20t76 -48l408 -408q28 -28 48 -76t20 -88z" />
+<glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1632 800q261 -58 287 -93l1 -3q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416 h-64v32h64h160h96q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64z" />
+<glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-160q0 -45 2 -76t7.5 -56.5t14.5 -40t23 -26.5t33.5 -15.5t45 -7.5t58 -2.5t72.5 0.5zM1664 192v-192h-1152v192l128 192h-97q-211 0 -313 102.5t-102 314.5v287l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
+<glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
+<glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
+<glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
+<glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
+<glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
+<glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
+<glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
+<glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
+<glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
+<glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
+<glyph unicode="&#xf10c;" d="M1280 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
+<glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
+<glyph unicode="&#xf110;" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" />
+<glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
+<glyph unicode="&#xf113;" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
+<glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf
new file mode 100644
index 000000000..d46172476
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff
new file mode 100644
index 000000000..3c89ae09b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot
new file mode 100644
index 000000000..b93a4953f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg
new file mode 100644
index 000000000..94fb5490a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,288 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="glyphicons_halflingsregular" horiz-adv-x="1200" >
+<font-face units-per-em="1200" ascent="960" descent="-240" />
+<missing-glyph horiz-adv-x="500" />
+<glyph horiz-adv-x="0" />
+<glyph horiz-adv-x="400" />
+<glyph unicode=" " />
+<glyph unicode="*" d="M600 1100q15 0 34 -1.5t30 -3.5l11 -1q10 -2 17.5 -10.5t7.5 -18.5v-224l158 158q7 7 18 8t19 -6l106 -106q7 -8 6 -19t-8 -18l-158 -158h224q10 0 18.5 -7.5t10.5 -17.5q6 -41 6 -75q0 -15 -1.5 -34t-3.5 -30l-1 -11q-2 -10 -10.5 -17.5t-18.5 -7.5h-224l158 -158 q7 -7 8 -18t-6 -19l-106 -106q-8 -7 -19 -6t-18 8l-158 158v-224q0 -10 -7.5 -18.5t-17.5 -10.5q-41 -6 -75 -6q-15 0 -34 1.5t-30 3.5l-11 1q-10 2 -17.5 10.5t-7.5 18.5v224l-158 -158q-7 -7 -18 -8t-19 6l-106 106q-7 8 -6 19t8 18l158 158h-224q-10 0 -18.5 7.5 t-10.5 17.5q-6 41 -6 75q0 15 1.5 34t3.5 30l1 11q2 10 10.5 17.5t18.5 7.5h224l-158 158q-7 7 -8 18t6 19l106 106q8 7 19 6t18 -8l158 -158v224q0 10 7.5 18.5t17.5 10.5q41 6 75 6z" />
+<glyph unicode="+" d="M450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-350h350q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-350v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v350h-350q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5 h350v350q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xa0;" />
+<glyph unicode="&#xa5;" d="M825 1100h250q10 0 12.5 -5t-5.5 -13l-364 -364q-6 -6 -11 -18h268q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-100h275q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-125v-174q0 -11 -7.5 -18.5t-18.5 -7.5h-148q-11 0 -18.5 7.5t-7.5 18.5v174 h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h125v100h-275q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h118q-5 12 -11 18l-364 364q-8 8 -5.5 13t12.5 5h250q25 0 43 -18l164 -164q8 -8 18 -8t18 8l164 164q18 18 43 18z" />
+<glyph unicode="&#x2000;" horiz-adv-x="650" />
+<glyph unicode="&#x2001;" horiz-adv-x="1300" />
+<glyph unicode="&#x2002;" horiz-adv-x="650" />
+<glyph unicode="&#x2003;" horiz-adv-x="1300" />
+<glyph unicode="&#x2004;" horiz-adv-x="433" />
+<glyph unicode="&#x2005;" horiz-adv-x="325" />
+<glyph unicode="&#x2006;" horiz-adv-x="216" />
+<glyph unicode="&#x2007;" horiz-adv-x="216" />
+<glyph unicode="&#x2008;" horiz-adv-x="162" />
+<glyph unicode="&#x2009;" horiz-adv-x="260" />
+<glyph unicode="&#x200a;" horiz-adv-x="72" />
+<glyph unicode="&#x202f;" horiz-adv-x="260" />
+<glyph unicode="&#x205f;" horiz-adv-x="325" />
+<glyph unicode="&#x20ac;" d="M744 1198q242 0 354 -189q60 -104 66 -209h-181q0 45 -17.5 82.5t-43.5 61.5t-58 40.5t-60.5 24t-51.5 7.5q-19 0 -40.5 -5.5t-49.5 -20.5t-53 -38t-49 -62.5t-39 -89.5h379l-100 -100h-300q-6 -50 -6 -100h406l-100 -100h-300q9 -74 33 -132t52.5 -91t61.5 -54.5t59 -29 t47 -7.5q22 0 50.5 7.5t60.5 24.5t58 41t43.5 61t17.5 80h174q-30 -171 -128 -278q-107 -117 -274 -117q-206 0 -324 158q-36 48 -69 133t-45 204h-217l100 100h112q1 47 6 100h-218l100 100h134q20 87 51 153.5t62 103.5q117 141 297 141z" />
+<glyph unicode="&#x20bd;" d="M428 1200h350q67 0 120 -13t86 -31t57 -49.5t35 -56.5t17 -64.5t6.5 -60.5t0.5 -57v-16.5v-16.5q0 -36 -0.5 -57t-6.5 -61t-17 -65t-35 -57t-57 -50.5t-86 -31.5t-120 -13h-178l-2 -100h288q10 0 13 -6t-3 -14l-120 -160q-6 -8 -18 -14t-22 -6h-138v-175q0 -11 -5.5 -18 t-15.5 -7h-149q-10 0 -17.5 7.5t-7.5 17.5v175h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v100h-267q-10 0 -13 6t3 14l120 160q6 8 18 14t22 6h117v475q0 10 7.5 17.5t17.5 7.5zM600 1000v-300h203q64 0 86.5 33t22.5 119q0 84 -22.5 116t-86.5 32h-203z" />
+<glyph unicode="&#x2212;" d="M250 700h800q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#x231b;" d="M1000 1200v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-50v-100q0 -91 -49.5 -165.5t-130.5 -109.5q81 -35 130.5 -109.5t49.5 -165.5v-150h50q21 0 35.5 -14.5t14.5 -35.5v-150h-800v150q0 21 14.5 35.5t35.5 14.5h50v150q0 91 49.5 165.5t130.5 109.5q-81 35 -130.5 109.5 t-49.5 165.5v100h-50q-21 0 -35.5 14.5t-14.5 35.5v150h800zM400 1000v-100q0 -60 32.5 -109.5t87.5 -73.5q28 -12 44 -37t16 -55t-16 -55t-44 -37q-55 -24 -87.5 -73.5t-32.5 -109.5v-150h400v150q0 60 -32.5 109.5t-87.5 73.5q-28 12 -44 37t-16 55t16 55t44 37 q55 24 87.5 73.5t32.5 109.5v100h-400z" />
+<glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#x2601;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -206.5q0 -121 -85 -207.5t-205 -86.5h-750q-79 0 -135.5 57t-56.5 137q0 69 42.5 122.5t108.5 67.5q-2 12 -2 37q0 153 108 260.5t260 107.5z" />
+<glyph unicode="&#x26fa;" d="M774 1193.5q16 -9.5 20.5 -27t-5.5 -33.5l-136 -187l467 -746h30q20 0 35 -18.5t15 -39.5v-42h-1200v42q0 21 15 39.5t35 18.5h30l468 746l-135 183q-10 16 -5.5 34t20.5 28t34 5.5t28 -20.5l111 -148l112 150q9 16 27 20.5t34 -5zM600 200h377l-182 112l-195 534v-646z " />
+<glyph unicode="&#x2709;" d="M25 1100h1150q10 0 12.5 -5t-5.5 -13l-564 -567q-8 -8 -18 -8t-18 8l-564 567q-8 8 -5.5 13t12.5 5zM18 882l264 -264q8 -8 8 -18t-8 -18l-264 -264q-8 -8 -13 -5.5t-5 12.5v550q0 10 5 12.5t13 -5.5zM918 618l264 264q8 8 13 5.5t5 -12.5v-550q0 -10 -5 -12.5t-13 5.5 l-264 264q-8 8 -8 18t8 18zM818 482l364 -364q8 -8 5.5 -13t-12.5 -5h-1150q-10 0 -12.5 5t5.5 13l364 364q8 8 18 8t18 -8l164 -164q8 -8 18 -8t18 8l164 164q8 8 18 8t18 -8z" />
+<glyph unicode="&#x270f;" d="M1011 1210q19 0 33 -13l153 -153q13 -14 13 -33t-13 -33l-99 -92l-214 214l95 96q13 14 32 14zM1013 800l-615 -614l-214 214l614 614zM317 96l-333 -112l110 335z" />
+<glyph unicode="&#xe001;" d="M700 650v-550h250q21 0 35.5 -14.5t14.5 -35.5v-50h-800v50q0 21 14.5 35.5t35.5 14.5h250v550l-500 550h1200z" />
+<glyph unicode="&#xe002;" d="M368 1017l645 163q39 15 63 0t24 -49v-831q0 -55 -41.5 -95.5t-111.5 -63.5q-79 -25 -147 -4.5t-86 75t25.5 111.5t122.5 82q72 24 138 8v521l-600 -155v-606q0 -42 -44 -90t-109 -69q-79 -26 -147 -5.5t-86 75.5t25.5 111.5t122.5 82.5q72 24 138 7v639q0 38 14.5 59 t53.5 34z" />
+<glyph unicode="&#xe003;" d="M500 1191q100 0 191 -39t156.5 -104.5t104.5 -156.5t39 -191l-1 -2l1 -5q0 -141 -78 -262l275 -274q23 -26 22.5 -44.5t-22.5 -42.5l-59 -58q-26 -20 -46.5 -20t-39.5 20l-275 274q-119 -77 -261 -77l-5 1l-2 -1q-100 0 -191 39t-156.5 104.5t-104.5 156.5t-39 191 t39 191t104.5 156.5t156.5 104.5t191 39zM500 1022q-88 0 -162 -43t-117 -117t-43 -162t43 -162t117 -117t162 -43t162 43t117 117t43 162t-43 162t-117 117t-162 43z" />
+<glyph unicode="&#xe005;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104z" />
+<glyph unicode="&#xe006;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429z" />
+<glyph unicode="&#xe007;" d="M407 800l131 353q7 19 17.5 19t17.5 -19l129 -353h421q21 0 24 -8.5t-14 -20.5l-342 -249l130 -401q7 -20 -0.5 -25.5t-24.5 6.5l-343 246l-342 -247q-17 -12 -24.5 -6.5t-0.5 25.5l130 400l-347 251q-17 12 -14 20.5t23 8.5h429zM477 700h-240l197 -142l-74 -226 l193 139l195 -140l-74 229l192 140h-234l-78 211z" />
+<glyph unicode="&#xe008;" d="M600 1200q124 0 212 -88t88 -212v-250q0 -46 -31 -98t-69 -52v-75q0 -10 6 -21.5t15 -17.5l358 -230q9 -5 15 -16.5t6 -21.5v-93q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v93q0 10 6 21.5t15 16.5l358 230q9 6 15 17.5t6 21.5v75q-38 0 -69 52 t-31 98v250q0 124 88 212t212 88z" />
+<glyph unicode="&#xe009;" d="M25 1100h1150q10 0 17.5 -7.5t7.5 -17.5v-1050q0 -10 -7.5 -17.5t-17.5 -7.5h-1150q-10 0 -17.5 7.5t-7.5 17.5v1050q0 10 7.5 17.5t17.5 7.5zM100 1000v-100h100v100h-100zM875 1000h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5t17.5 -7.5h550 q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM1000 1000v-100h100v100h-100zM100 800v-100h100v100h-100zM1000 800v-100h100v100h-100zM100 600v-100h100v100h-100zM1000 600v-100h100v100h-100zM875 500h-550q-10 0 -17.5 -7.5t-7.5 -17.5v-350q0 -10 7.5 -17.5 t17.5 -7.5h550q10 0 17.5 7.5t7.5 17.5v350q0 10 -7.5 17.5t-17.5 7.5zM100 400v-100h100v100h-100zM1000 400v-100h100v100h-100zM100 200v-100h100v100h-100zM1000 200v-100h100v100h-100z" />
+<glyph unicode="&#xe010;" d="M50 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM50 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM650 500h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe011;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM850 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 700h200q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM850 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5 t35.5 14.5z" />
+<glyph unicode="&#xe012;" d="M50 1100h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 1100h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200 q0 21 14.5 35.5t35.5 14.5zM50 700h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 700h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700 q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM50 300h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5zM450 300h700q21 0 35.5 -14.5t14.5 -35.5v-200 q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe013;" d="M465 477l571 571q8 8 18 8t17 -8l177 -177q8 -7 8 -17t-8 -18l-783 -784q-7 -8 -17.5 -8t-17.5 8l-384 384q-8 8 -8 18t8 17l177 177q7 8 17 8t18 -8l171 -171q7 -7 18 -7t18 7z" />
+<glyph unicode="&#xe014;" d="M904 1083l178 -179q8 -8 8 -18.5t-8 -17.5l-267 -268l267 -268q8 -7 8 -17.5t-8 -18.5l-178 -178q-8 -8 -18.5 -8t-17.5 8l-268 267l-268 -267q-7 -8 -17.5 -8t-18.5 8l-178 178q-8 8 -8 18.5t8 17.5l267 268l-267 268q-8 7 -8 17.5t8 18.5l178 178q8 8 18.5 8t17.5 -8 l268 -267l268 268q7 7 17.5 7t18.5 -7z" />
+<glyph unicode="&#xe015;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM425 900h150q10 0 17.5 -7.5t7.5 -17.5v-75h75q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5 t-17.5 -7.5h-75v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-75q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v75q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe016;" d="M507 1177q98 0 187.5 -38.5t154.5 -103.5t103.5 -154.5t38.5 -187.5q0 -141 -78 -262l300 -299q8 -8 8 -18.5t-8 -18.5l-109 -108q-7 -8 -17.5 -8t-18.5 8l-300 299q-119 -77 -261 -77q-98 0 -188 38.5t-154.5 103t-103 154.5t-38.5 188t38.5 187.5t103 154.5 t154.5 103.5t188 38.5zM506.5 1023q-89.5 0 -165.5 -44t-120 -120.5t-44 -166t44 -165.5t120 -120t165.5 -44t166 44t120.5 120t44 165.5t-44 166t-120.5 120.5t-166 44zM325 800h350q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-350q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe017;" d="M550 1200h100q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM800 975v166q167 -62 272 -209.5t105 -331.5q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5 t-184.5 123t-123 184.5t-45.5 224q0 184 105 331.5t272 209.5v-166q-103 -55 -165 -155t-62 -220q0 -116 57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5q0 120 -62 220t-165 155z" />
+<glyph unicode="&#xe018;" d="M1025 1200h150q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM725 800h150q10 0 17.5 -7.5t7.5 -17.5v-750q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v750 q0 10 7.5 17.5t17.5 7.5zM425 500h150q10 0 17.5 -7.5t7.5 -17.5v-450q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v450q0 10 7.5 17.5t17.5 7.5zM125 300h150q10 0 17.5 -7.5t7.5 -17.5v-250q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5 v250q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe019;" d="M600 1174q33 0 74 -5l38 -152l5 -1q49 -14 94 -39l5 -2l134 80q61 -48 104 -105l-80 -134l3 -5q25 -44 39 -93l1 -6l152 -38q5 -43 5 -73q0 -34 -5 -74l-152 -38l-1 -6q-15 -49 -39 -93l-3 -5l80 -134q-48 -61 -104 -105l-134 81l-5 -3q-44 -25 -94 -39l-5 -2l-38 -151 q-43 -5 -74 -5q-33 0 -74 5l-38 151l-5 2q-49 14 -94 39l-5 3l-134 -81q-60 48 -104 105l80 134l-3 5q-25 45 -38 93l-2 6l-151 38q-6 42 -6 74q0 33 6 73l151 38l2 6q13 48 38 93l3 5l-80 134q47 61 105 105l133 -80l5 2q45 25 94 39l5 1l38 152q43 5 74 5zM600 815 q-89 0 -152 -63t-63 -151.5t63 -151.5t152 -63t152 63t63 151.5t-63 151.5t-152 63z" />
+<glyph unicode="&#xe020;" d="M500 1300h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-75h-1100v75q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5zM500 1200v-100h300v100h-300zM1100 900v-800q0 -41 -29.5 -70.5t-70.5 -29.5h-700q-41 0 -70.5 29.5t-29.5 70.5 v800h900zM300 800v-700h100v700h-100zM500 800v-700h100v700h-100zM700 800v-700h100v700h-100zM900 800v-700h100v700h-100z" />
+<glyph unicode="&#xe021;" d="M18 618l620 608q8 7 18.5 7t17.5 -7l608 -608q8 -8 5.5 -13t-12.5 -5h-175v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v375h-300v-375q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v575h-175q-10 0 -12.5 5t5.5 13z" />
+<glyph unicode="&#xe022;" d="M600 1200v-400q0 -41 29.5 -70.5t70.5 -29.5h300v-650q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5h450zM1000 800h-250q-21 0 -35.5 14.5t-14.5 35.5v250z" />
+<glyph unicode="&#xe023;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h50q10 0 17.5 -7.5t7.5 -17.5v-275h175q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe024;" d="M1300 0h-538l-41 400h-242l-41 -400h-538l431 1200h209l-21 -300h162l-20 300h208zM515 800l-27 -300h224l-27 300h-170z" />
+<glyph unicode="&#xe025;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-450h191q20 0 25.5 -11.5t-7.5 -27.5l-327 -400q-13 -16 -32 -16t-32 16l-327 400q-13 16 -7.5 27.5t25.5 11.5h191v450q0 21 14.5 35.5t35.5 14.5zM1125 400h50q10 0 17.5 -7.5t7.5 -17.5v-350q0 -10 -7.5 -17.5t-17.5 -7.5 h-1050q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h50q10 0 17.5 -7.5t7.5 -17.5v-175h900v175q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe026;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM525 900h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -275q-13 -16 -32 -16t-32 16l-223 275q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z " />
+<glyph unicode="&#xe027;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM632 914l223 -275q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5l223 275q13 16 32 16 t32 -16z" />
+<glyph unicode="&#xe028;" d="M225 1200h750q10 0 19.5 -7t12.5 -17l186 -652q7 -24 7 -49v-425q0 -12 -4 -27t-9 -17q-12 -6 -37 -6h-1100q-12 0 -27 4t-17 8q-6 13 -6 38l1 425q0 25 7 49l185 652q3 10 12.5 17t19.5 7zM878 1000h-556q-10 0 -19 -7t-11 -18l-87 -450q-2 -11 4 -18t16 -7h150 q10 0 19.5 -7t11.5 -17l38 -152q2 -10 11.5 -17t19.5 -7h250q10 0 19.5 7t11.5 17l38 152q2 10 11.5 17t19.5 7h150q10 0 16 7t4 18l-87 450q-2 11 -11 18t-19 7z" />
+<glyph unicode="&#xe029;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM540 820l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
+<glyph unicode="&#xe030;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-362q0 -10 -7.5 -17.5t-17.5 -7.5h-362q-11 0 -13 5.5t5 12.5l133 133q-109 76 -238 76q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5h150q0 -117 -45.5 -224 t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117z" />
+<glyph unicode="&#xe031;" d="M947 1060l135 135q7 7 12.5 5t5.5 -13v-361q0 -11 -7.5 -18.5t-18.5 -7.5h-361q-11 0 -13 5.5t5 12.5l134 134q-110 75 -239 75q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5h-150q0 117 45.5 224t123 184.5t184.5 123t224 45.5q192 0 347 -117zM1027 600h150 q0 -117 -45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5q-192 0 -348 118l-134 -134q-7 -8 -12.5 -5.5t-5.5 12.5v360q0 11 7.5 18.5t18.5 7.5h360q10 0 12.5 -5.5t-5.5 -12.5l-133 -133q110 -76 240 -76q116 0 214.5 57t155.5 155.5t57 214.5z" />
+<glyph unicode="&#xe032;" d="M125 1200h1050q10 0 17.5 -7.5t7.5 -17.5v-1150q0 -10 -7.5 -17.5t-17.5 -7.5h-1050q-10 0 -17.5 7.5t-7.5 17.5v1150q0 10 7.5 17.5t17.5 7.5zM1075 1000h-850q-10 0 -17.5 -7.5t-7.5 -17.5v-850q0 -10 7.5 -17.5t17.5 -7.5h850q10 0 17.5 7.5t7.5 17.5v850 q0 10 -7.5 17.5t-17.5 7.5zM325 900h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 900h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 700h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 700h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 500h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 500h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5zM325 300h50q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM525 300h450q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-450q-10 0 -17.5 7.5t-7.5 17.5v50 q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe033;" d="M900 800v200q0 83 -58.5 141.5t-141.5 58.5h-300q-82 0 -141 -59t-59 -141v-200h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h900q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-100zM400 800v150q0 21 15 35.5t35 14.5h200 q20 0 35 -14.5t15 -35.5v-150h-300z" />
+<glyph unicode="&#xe034;" d="M125 1100h50q10 0 17.5 -7.5t7.5 -17.5v-1075h-100v1075q0 10 7.5 17.5t17.5 7.5zM1075 1052q4 0 9 -2q16 -6 16 -23v-421q0 -6 -3 -12q-33 -59 -66.5 -99t-65.5 -58t-56.5 -24.5t-52.5 -6.5q-26 0 -57.5 6.5t-52.5 13.5t-60 21q-41 15 -63 22.5t-57.5 15t-65.5 7.5 q-85 0 -160 -57q-7 -5 -15 -5q-6 0 -11 3q-14 7 -14 22v438q22 55 82 98.5t119 46.5q23 2 43 0.5t43 -7t32.5 -8.5t38 -13t32.5 -11q41 -14 63.5 -21t57 -14t63.5 -7q103 0 183 87q7 8 18 8z" />
+<glyph unicode="&#xe035;" d="M600 1175q116 0 227 -49.5t192.5 -131t131 -192.5t49.5 -227v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v300q0 127 -70.5 231.5t-184.5 161.5t-245 57t-245 -57t-184.5 -161.5t-70.5 -231.5v-300q0 -10 -7.5 -17.5t-17.5 -7.5h-50 q-10 0 -17.5 7.5t-7.5 17.5v300q0 116 49.5 227t131 192.5t192.5 131t227 49.5zM220 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460q0 8 6 14t14 6zM820 500h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14v460 q0 8 6 14t14 6z" />
+<glyph unicode="&#xe036;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM900 668l120 120q7 7 17 7t17 -7l34 -34q7 -7 7 -17t-7 -17l-120 -120l120 -120q7 -7 7 -17 t-7 -17l-34 -34q-7 -7 -17 -7t-17 7l-120 119l-120 -119q-7 -7 -17 -7t-17 7l-34 34q-7 7 -7 17t7 17l119 120l-119 120q-7 7 -7 17t7 17l34 34q7 8 17 8t17 -8z" />
+<glyph unicode="&#xe037;" d="M321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6 l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238q-6 8 -4.5 18t9.5 17l29 22q7 5 15 5z" />
+<glyph unicode="&#xe038;" d="M967 1004h3q11 -1 17 -10q135 -179 135 -396q0 -105 -34 -206.5t-98 -185.5q-7 -9 -17 -10h-3q-9 0 -16 6l-42 34q-8 6 -9 16t5 18q111 150 111 328q0 90 -29.5 176t-84.5 157q-6 9 -5 19t10 16l42 33q7 5 15 5zM321 814l258 172q9 6 15 2.5t6 -13.5v-750q0 -10 -6 -13.5 t-15 2.5l-258 172q-21 14 -46 14h-250q-10 0 -17.5 7.5t-7.5 17.5v350q0 10 7.5 17.5t17.5 7.5h250q25 0 46 14zM766 900h4q10 -1 16 -10q96 -129 96 -290q0 -154 -90 -281q-6 -9 -17 -10l-3 -1q-9 0 -16 6l-29 23q-7 7 -8.5 16.5t4.5 17.5q72 103 72 229q0 132 -78 238 q-6 8 -4.5 18.5t9.5 16.5l29 22q7 5 15 5z" />
+<glyph unicode="&#xe039;" d="M500 900h100v-100h-100v-100h-400v-100h-100v600h500v-300zM1200 700h-200v-100h200v-200h-300v300h-200v300h-100v200h600v-500zM100 1100v-300h300v300h-300zM800 1100v-300h300v300h-300zM300 900h-100v100h100v-100zM1000 900h-100v100h100v-100zM300 500h200v-500 h-500v500h200v100h100v-100zM800 300h200v-100h-100v-100h-200v100h-100v100h100v200h-200v100h300v-300zM100 400v-300h300v300h-300zM300 200h-100v100h100v-100zM1200 200h-100v100h100v-100zM700 0h-100v100h100v-100zM1200 0h-300v100h300v-100z" />
+<glyph unicode="&#xe040;" d="M100 200h-100v1000h100v-1000zM300 200h-100v1000h100v-1000zM700 200h-200v1000h200v-1000zM900 200h-100v1000h100v-1000zM1200 200h-200v1000h200v-1000zM400 0h-300v100h300v-100zM600 0h-100v91h100v-91zM800 0h-100v91h100v-91zM1100 0h-200v91h200v-91z" />
+<glyph unicode="&#xe041;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
+<glyph unicode="&#xe042;" d="M500 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-682 682l1 475q0 10 7.5 17.5t17.5 7.5h474zM800 1200l682 -682q8 -8 8 -18t-8 -18l-464 -464q-8 -8 -18 -8t-18 8l-56 56l424 426l-700 700h150zM319.5 1024.5q-29.5 29.5 -71 29.5t-71 -29.5 t-29.5 -71.5t29.5 -71.5t71 -29.5t71 29.5t29.5 71.5t-29.5 71.5z" />
+<glyph unicode="&#xe043;" d="M300 1200h825q75 0 75 -75v-900q0 -25 -18 -43l-64 -64q-8 -8 -13 -5.5t-5 12.5v950q0 10 -7.5 17.5t-17.5 7.5h-700q-25 0 -43 -18l-64 -64q-8 -8 -5.5 -13t12.5 -5h700q10 0 17.5 -7.5t7.5 -17.5v-950q0 -10 -7.5 -17.5t-17.5 -7.5h-850q-10 0 -17.5 7.5t-7.5 17.5v975 q0 25 18 43l139 139q18 18 43 18z" />
+<glyph unicode="&#xe044;" d="M250 1200h800q21 0 35.5 -14.5t14.5 -35.5v-1150l-450 444l-450 -445v1151q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe045;" d="M822 1200h-444q-11 0 -19 -7.5t-9 -17.5l-78 -301q-7 -24 7 -45l57 -108q6 -9 17.5 -15t21.5 -6h450q10 0 21.5 6t17.5 15l62 108q14 21 7 45l-83 301q-1 10 -9 17.5t-19 7.5zM1175 800h-150q-10 0 -21 -6.5t-15 -15.5l-78 -156q-4 -9 -15 -15.5t-21 -6.5h-550 q-10 0 -21 6.5t-15 15.5l-78 156q-4 9 -15 15.5t-21 6.5h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-650q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h750q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5 t7.5 17.5v650q0 10 -7.5 17.5t-17.5 7.5zM850 200h-500q-10 0 -19.5 -7t-11.5 -17l-38 -152q-2 -10 3.5 -17t15.5 -7h600q10 0 15.5 7t3.5 17l-38 152q-2 10 -11.5 17t-19.5 7z" />
+<glyph unicode="&#xe046;" d="M500 1100h200q56 0 102.5 -20.5t72.5 -50t44 -59t25 -50.5l6 -20h150q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5h150q2 8 6.5 21.5t24 48t45 61t72 48t102.5 21.5zM900 800v-100 h100v100h-100zM600 730q-95 0 -162.5 -67.5t-67.5 -162.5t67.5 -162.5t162.5 -67.5t162.5 67.5t67.5 162.5t-67.5 162.5t-162.5 67.5zM600 603q43 0 73 -30t30 -73t-30 -73t-73 -30t-73 30t-30 73t30 73t73 30z" />
+<glyph unicode="&#xe047;" d="M681 1199l385 -998q20 -50 60 -92q18 -19 36.5 -29.5t27.5 -11.5l10 -2v-66h-417v66q53 0 75 43.5t5 88.5l-82 222h-391q-58 -145 -92 -234q-11 -34 -6.5 -57t25.5 -37t46 -20t55 -6v-66h-365v66q56 24 84 52q12 12 25 30.5t20 31.5l7 13l399 1006h93zM416 521h340 l-162 457z" />
+<glyph unicode="&#xe048;" d="M753 641q5 -1 14.5 -4.5t36 -15.5t50.5 -26.5t53.5 -40t50.5 -54.5t35.5 -70t14.5 -87q0 -67 -27.5 -125.5t-71.5 -97.5t-98.5 -66.5t-108.5 -40.5t-102 -13h-500v89q41 7 70.5 32.5t29.5 65.5v827q0 24 -0.5 34t-3.5 24t-8.5 19.5t-17 13.5t-28 12.5t-42.5 11.5v71 l471 -1q57 0 115.5 -20.5t108 -57t80.5 -94t31 -124.5q0 -51 -15.5 -96.5t-38 -74.5t-45 -50.5t-38.5 -30.5zM400 700h139q78 0 130.5 48.5t52.5 122.5q0 41 -8.5 70.5t-29.5 55.5t-62.5 39.5t-103.5 13.5h-118v-350zM400 200h216q80 0 121 50.5t41 130.5q0 90 -62.5 154.5 t-156.5 64.5h-159v-400z" />
+<glyph unicode="&#xe049;" d="M877 1200l2 -57q-83 -19 -116 -45.5t-40 -66.5l-132 -839q-9 -49 13 -69t96 -26v-97h-500v97q186 16 200 98l173 832q3 17 3 30t-1.5 22.5t-9 17.5t-13.5 12.5t-21.5 10t-26 8.5t-33.5 10q-13 3 -19 5v57h425z" />
+<glyph unicode="&#xe050;" d="M1300 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM175 1000h-75v-800h75l-125 -167l-125 167h75v800h-75l125 167z" />
+<glyph unicode="&#xe051;" d="M1100 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-650q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v650h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM1167 50l-167 -125v75h-800v-75l-167 125l167 125v-75h800v75z" />
+<glyph unicode="&#xe052;" d="M50 1100h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe053;" d="M250 1100h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM250 500h700q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe054;" d="M500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000 q-21 0 -35.5 14.5t-14.5 35.5zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5zM0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5z" />
+<glyph unicode="&#xe055;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 800h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 500h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe056;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 1100h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 800h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 500h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 500h800q21 0 35.5 -14.5t14.5 -35.5v-100 q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM350 200h800 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe057;" d="M400 0h-100v1100h100v-1100zM550 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM267 550l-167 -125v75h-200v100h200v75zM550 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM550 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe058;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM900 0h-100v1100h100v-1100zM50 800h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM1100 600h200v-100h-200v-75l-167 125l167 125v-75zM50 500h300q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5zM50 200h600 q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-600q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe059;" d="M75 1000h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53v650q0 31 22 53t53 22zM1200 300l-300 300l300 300v-600z" />
+<glyph unicode="&#xe060;" d="M44 1100h1112q18 0 31 -13t13 -31v-1012q0 -18 -13 -31t-31 -13h-1112q-18 0 -31 13t-13 31v1012q0 18 13 31t31 13zM100 1000v-737l247 182l298 -131l-74 156l293 318l236 -288v500h-1000zM342 884q56 0 95 -39t39 -94.5t-39 -95t-95 -39.5t-95 39.5t-39 95t39 94.5 t95 39z" />
+<glyph unicode="&#xe062;" d="M648 1169q117 0 216 -60t156.5 -161t57.5 -218q0 -115 -70 -258q-69 -109 -158 -225.5t-143 -179.5l-54 -62q-9 8 -25.5 24.5t-63.5 67.5t-91 103t-98.5 128t-95.5 148q-60 132 -60 249q0 88 34 169.5t91.5 142t137 96.5t166.5 36zM652.5 974q-91.5 0 -156.5 -65 t-65 -157t65 -156.5t156.5 -64.5t156.5 64.5t65 156.5t-65 157t-156.5 65z" />
+<glyph unicode="&#xe063;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 173v854q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57z" />
+<glyph unicode="&#xe064;" d="M554 1295q21 -72 57.5 -143.5t76 -130t83 -118t82.5 -117t70 -116t49.5 -126t18.5 -136.5q0 -71 -25.5 -135t-68.5 -111t-99 -82t-118.5 -54t-125.5 -23q-84 5 -161.5 34t-139.5 78.5t-99 125t-37 164.5q0 69 18 136.5t49.5 126.5t69.5 116.5t81.5 117.5t83.5 119 t76.5 131t58.5 143zM344 710q-23 -33 -43.5 -70.5t-40.5 -102.5t-17 -123q1 -37 14.5 -69.5t30 -52t41 -37t38.5 -24.5t33 -15q21 -7 32 -1t13 22l6 34q2 10 -2.5 22t-13.5 19q-5 4 -14 12t-29.5 40.5t-32.5 73.5q-26 89 6 271q2 11 -6 11q-8 1 -15 -10z" />
+<glyph unicode="&#xe065;" d="M1000 1013l108 115q2 1 5 2t13 2t20.5 -1t25 -9.5t28.5 -21.5q22 -22 27 -43t0 -32l-6 -10l-108 -115zM350 1100h400q50 0 105 -13l-187 -187h-368q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v182l200 200v-332 q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM1009 803l-362 -362l-161 -50l55 170l355 355z" />
+<glyph unicode="&#xe066;" d="M350 1100h361q-164 -146 -216 -200h-195q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-103q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M824 1073l339 -301q8 -7 8 -17.5t-8 -17.5l-340 -306q-7 -6 -12.5 -4t-6.5 11v203q-26 1 -54.5 0t-78.5 -7.5t-92 -17.5t-86 -35t-70 -57q10 59 33 108t51.5 81.5t65 58.5t68.5 40.5t67 24.5t56 13.5t40 4.5v210q1 10 6.5 12.5t13.5 -4.5z" />
+<glyph unicode="&#xe067;" d="M350 1100h350q60 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-219q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5z M643 639l395 395q7 7 17.5 7t17.5 -7l101 -101q7 -7 7 -17.5t-7 -17.5l-531 -532q-7 -7 -17.5 -7t-17.5 7l-248 248q-7 7 -7 17.5t7 17.5l101 101q7 7 17.5 7t17.5 -7l111 -111q8 -7 18 -7t18 7z" />
+<glyph unicode="&#xe068;" d="M318 918l264 264q8 8 18 8t18 -8l260 -264q7 -8 4.5 -13t-12.5 -5h-170v-200h200v173q0 10 5 12t13 -5l264 -260q8 -7 8 -17.5t-8 -17.5l-264 -265q-8 -7 -13 -5t-5 12v173h-200v-200h170q10 0 12.5 -5t-4.5 -13l-260 -264q-8 -8 -18 -8t-18 8l-264 264q-8 8 -5.5 13 t12.5 5h175v200h-200v-173q0 -10 -5 -12t-13 5l-264 265q-8 7 -8 17.5t8 17.5l264 260q8 7 13 5t5 -12v-173h200v200h-175q-10 0 -12.5 5t5.5 13z" />
+<glyph unicode="&#xe069;" d="M250 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe070;" d="M50 1100h100q21 0 35.5 -14.5t14.5 -35.5v-438l464 453q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5 t-14.5 35.5v1000q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe071;" d="M1200 1050v-1000q0 -21 -10.5 -25t-25.5 10l-464 453v-438q0 -21 -10.5 -25t-25.5 10l-492 480q-15 14 -15 35t15 35l492 480q15 14 25.5 10t10.5 -25v-438l464 453q15 14 25.5 10t10.5 -25z" />
+<glyph unicode="&#xe072;" d="M243 1074l814 -498q18 -11 18 -26t-18 -26l-814 -498q-18 -11 -30.5 -4t-12.5 28v1000q0 21 12.5 28t30.5 -4z" />
+<glyph unicode="&#xe073;" d="M250 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM650 1000h200q21 0 35.5 -14.5t14.5 -35.5v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v800 q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe074;" d="M1100 950v-800q0 -21 -14.5 -35.5t-35.5 -14.5h-800q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5z" />
+<glyph unicode="&#xe075;" d="M500 612v438q0 21 10.5 25t25.5 -10l492 -480q15 -14 15 -35t-15 -35l-492 -480q-15 -14 -25.5 -10t-10.5 25v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10z" />
+<glyph unicode="&#xe076;" d="M1048 1102l100 1q20 0 35 -14.5t15 -35.5l5 -1000q0 -21 -14.5 -35.5t-35.5 -14.5l-100 -1q-21 0 -35.5 14.5t-14.5 35.5l-2 437l-463 -454q-14 -15 -24.5 -10.5t-10.5 25.5l-2 437l-462 -455q-15 -14 -25.5 -9.5t-10.5 24.5l-5 1000q0 21 10.5 25.5t25.5 -10.5l466 -450 l-2 438q0 20 10.5 24.5t25.5 -9.5l466 -451l-2 438q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe077;" d="M850 1100h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-464 -453q-15 -14 -25.5 -10t-10.5 25v1000q0 21 10.5 25t25.5 -10l464 -453v438q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe078;" d="M686 1081l501 -540q15 -15 10.5 -26t-26.5 -11h-1042q-22 0 -26.5 11t10.5 26l501 540q15 15 36 15t36 -15zM150 400h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe079;" d="M885 900l-352 -353l352 -353l-197 -198l-552 552l552 550z" />
+<glyph unicode="&#xe080;" d="M1064 547l-551 -551l-198 198l353 353l-353 353l198 198z" />
+<glyph unicode="&#xe081;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM650 900h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-150 q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5h150v-150q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v150h150q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-150v150q0 21 -14.5 35.5t-35.5 14.5z" />
+<glyph unicode="&#xe082;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM850 700h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5 t35.5 -14.5h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5z" />
+<glyph unicode="&#xe083;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM741.5 913q-12.5 0 -21.5 -9l-120 -120l-120 120q-9 9 -21.5 9 t-21.5 -9l-141 -141q-9 -9 -9 -21.5t9 -21.5l120 -120l-120 -120q-9 -9 -9 -21.5t9 -21.5l141 -141q9 -9 21.5 -9t21.5 9l120 120l120 -120q9 -9 21.5 -9t21.5 9l141 141q9 9 9 21.5t-9 21.5l-120 120l120 120q9 9 9 21.5t-9 21.5l-141 141q-9 9 -21.5 9z" />
+<glyph unicode="&#xe084;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM546 623l-84 85q-7 7 -17.5 7t-18.5 -7l-139 -139q-7 -8 -7 -18t7 -18 l242 -241q7 -8 17.5 -8t17.5 8l375 375q7 7 7 17.5t-7 18.5l-139 139q-7 7 -17.5 7t-17.5 -7z" />
+<glyph unicode="&#xe085;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM588 941q-29 0 -59 -5.5t-63 -20.5t-58 -38.5t-41.5 -63t-16.5 -89.5 q0 -25 20 -25h131q30 -5 35 11q6 20 20.5 28t45.5 8q20 0 31.5 -10.5t11.5 -28.5q0 -23 -7 -34t-26 -18q-1 0 -13.5 -4t-19.5 -7.5t-20 -10.5t-22 -17t-18.5 -24t-15.5 -35t-8 -46q-1 -8 5.5 -16.5t20.5 -8.5h173q7 0 22 8t35 28t37.5 48t29.5 74t12 100q0 47 -17 83 t-42.5 57t-59.5 34.5t-64 18t-59 4.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe086;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM675 1000h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5 t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5zM675 700h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h75v-200h-75q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h350q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5 t-17.5 7.5h-75v275q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe087;" d="M525 1200h150q10 0 17.5 -7.5t7.5 -17.5v-194q103 -27 178.5 -102.5t102.5 -178.5h194q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-194q-27 -103 -102.5 -178.5t-178.5 -102.5v-194q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v194 q-103 27 -178.5 102.5t-102.5 178.5h-194q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h194q27 103 102.5 178.5t178.5 102.5v194q0 10 7.5 17.5t17.5 7.5zM700 893v-168q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v168q-68 -23 -119 -74 t-74 -119h168q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-168q23 -68 74 -119t119 -74v168q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-168q68 23 119 74t74 119h-168q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h168 q-23 68 -74 119t-119 74z" />
+<glyph unicode="&#xe088;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM759 823l64 -64q7 -7 7 -17.5t-7 -17.5l-124 -124l124 -124q7 -7 7 -17.5t-7 -17.5l-64 -64q-7 -7 -17.5 -7t-17.5 7l-124 124l-124 -124q-7 -7 -17.5 -7t-17.5 7l-64 64 q-7 7 -7 17.5t7 17.5l124 124l-124 124q-7 7 -7 17.5t7 17.5l64 64q7 7 17.5 7t17.5 -7l124 -124l124 124q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe089;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5t57 -214.5 t155.5 -155.5t214.5 -57t214.5 57t155.5 155.5t57 214.5t-57 214.5t-155.5 155.5t-214.5 57zM782 788l106 -106q7 -7 7 -17.5t-7 -17.5l-320 -321q-8 -7 -18 -7t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l197 197q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe090;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM600 1027q-116 0 -214.5 -57t-155.5 -155.5t-57 -214.5q0 -120 65 -225 l587 587q-105 65 -225 65zM965 819l-584 -584q104 -62 219 -62q116 0 214.5 57t155.5 155.5t57 214.5q0 115 -62 219z" />
+<glyph unicode="&#xe091;" d="M39 582l522 427q16 13 27.5 8t11.5 -26v-291h550q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-550v-291q0 -21 -11.5 -26t-27.5 8l-522 427q-16 13 -16 32t16 32z" />
+<glyph unicode="&#xe092;" d="M639 1009l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291h-550q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h550v291q0 21 11.5 26t27.5 -8z" />
+<glyph unicode="&#xe093;" d="M682 1161l427 -522q13 -16 8 -27.5t-26 -11.5h-291v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v550h-291q-21 0 -26 11.5t8 27.5l427 522q13 16 32 16t32 -16z" />
+<glyph unicode="&#xe094;" d="M550 1200h200q21 0 35.5 -14.5t14.5 -35.5v-550h291q21 0 26 -11.5t-8 -27.5l-427 -522q-13 -16 -32 -16t-32 16l-427 522q-13 16 -8 27.5t26 11.5h291v550q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe095;" d="M639 1109l522 -427q16 -13 16 -32t-16 -32l-522 -427q-16 -13 -27.5 -8t-11.5 26v291q-94 -2 -182 -20t-170.5 -52t-147 -92.5t-100.5 -135.5q5 105 27 193.5t67.5 167t113 135t167 91.5t225.5 42v262q0 21 11.5 26t27.5 -8z" />
+<glyph unicode="&#xe096;" d="M850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5zM350 0h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249 q8 7 18 7t18 -7l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5z" />
+<glyph unicode="&#xe097;" d="M1014 1120l106 -106q7 -8 7 -18t-7 -18l-249 -249l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l249 249q8 7 18 7t18 -7zM250 600h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-249 -249q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l249 249l-94 94q-14 14 -10 24.5t25 10.5z" />
+<glyph unicode="&#xe101;" d="M600 1177q117 0 224 -45.5t184.5 -123t123 -184.5t45.5 -224t-45.5 -224t-123 -184.5t-184.5 -123t-224 -45.5t-224 45.5t-184.5 123t-123 184.5t-45.5 224t45.5 224t123 184.5t184.5 123t224 45.5zM704 900h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5 t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM675 400h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe102;" d="M260 1200q9 0 19 -2t15 -4l5 -2q22 -10 44 -23l196 -118q21 -13 36 -24q29 -21 37 -12q11 13 49 35l196 118q22 13 45 23q17 7 38 7q23 0 47 -16.5t37 -33.5l13 -16q14 -21 18 -45l25 -123l8 -44q1 -9 8.5 -14.5t17.5 -5.5h61q10 0 17.5 -7.5t7.5 -17.5v-50 q0 -10 -7.5 -17.5t-17.5 -7.5h-50q-10 0 -17.5 -7.5t-7.5 -17.5v-175h-400v300h-200v-300h-400v175q0 10 -7.5 17.5t-17.5 7.5h-50q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5h61q11 0 18 3t7 8q0 4 9 52l25 128q5 25 19 45q2 3 5 7t13.5 15t21.5 19.5t26.5 15.5 t29.5 7zM915 1079l-166 -162q-7 -7 -5 -12t12 -5h219q10 0 15 7t2 17l-51 149q-3 10 -11 12t-15 -6zM463 917l-177 157q-8 7 -16 5t-11 -12l-51 -143q-3 -10 2 -17t15 -7h231q11 0 12.5 5t-5.5 12zM500 0h-375q-10 0 -17.5 7.5t-7.5 17.5v375h400v-400zM1100 400v-375 q0 -10 -7.5 -17.5t-17.5 -7.5h-375v400h400z" />
+<glyph unicode="&#xe103;" d="M1165 1190q8 3 21 -6.5t13 -17.5q-2 -178 -24.5 -323.5t-55.5 -245.5t-87 -174.5t-102.5 -118.5t-118 -68.5t-118.5 -33t-120 -4.5t-105 9.5t-90 16.5q-61 12 -78 11q-4 1 -12.5 0t-34 -14.5t-52.5 -40.5l-153 -153q-26 -24 -37 -14.5t-11 43.5q0 64 42 102q8 8 50.5 45 t66.5 58q19 17 35 47t13 61q-9 55 -10 102.5t7 111t37 130t78 129.5q39 51 80 88t89.5 63.5t94.5 45t113.5 36t129 31t157.5 37t182 47.5zM1116 1098q-8 9 -22.5 -3t-45.5 -50q-38 -47 -119 -103.5t-142 -89.5l-62 -33q-56 -30 -102 -57t-104 -68t-102.5 -80.5t-85.5 -91 t-64 -104.5q-24 -56 -31 -86t2 -32t31.5 17.5t55.5 59.5q25 30 94 75.5t125.5 77.5t147.5 81q70 37 118.5 69t102 79.5t99 111t86.5 148.5q22 50 24 60t-6 19z" />
+<glyph unicode="&#xe104;" d="M653 1231q-39 -67 -54.5 -131t-10.5 -114.5t24.5 -96.5t47.5 -80t63.5 -62.5t68.5 -46.5t65 -30q-4 7 -17.5 35t-18.5 39.5t-17 39.5t-17 43t-13 42t-9.5 44.5t-2 42t4 43t13.5 39t23 38.5q96 -42 165 -107.5t105 -138t52 -156t13 -159t-19 -149.5q-13 -55 -44 -106.5 t-68 -87t-78.5 -64.5t-72.5 -45t-53 -22q-72 -22 -127 -11q-31 6 -13 19q6 3 17 7q13 5 32.5 21t41 44t38.5 63.5t21.5 81.5t-6.5 94.5t-50 107t-104 115.5q10 -104 -0.5 -189t-37 -140.5t-65 -93t-84 -52t-93.5 -11t-95 24.5q-80 36 -131.5 114t-53.5 171q-2 23 0 49.5 t4.5 52.5t13.5 56t27.5 60t46 64.5t69.5 68.5q-8 -53 -5 -102.5t17.5 -90t34 -68.5t44.5 -39t49 -2q31 13 38.5 36t-4.5 55t-29 64.5t-36 75t-26 75.5q-15 85 2 161.5t53.5 128.5t85.5 92.5t93.5 61t81.5 25.5z" />
+<glyph unicode="&#xe105;" d="M600 1094q82 0 160.5 -22.5t140 -59t116.5 -82.5t94.5 -95t68 -95t42.5 -82.5t14 -57.5t-14 -57.5t-43 -82.5t-68.5 -95t-94.5 -95t-116.5 -82.5t-140 -59t-159.5 -22.5t-159.5 22.5t-140 59t-116.5 82.5t-94.5 95t-68.5 95t-43 82.5t-14 57.5t14 57.5t42.5 82.5t68 95 t94.5 95t116.5 82.5t140 59t160.5 22.5zM888 829q-15 15 -18 12t5 -22q25 -57 25 -119q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 59 23 114q8 19 4.5 22t-17.5 -12q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q22 -36 47 -71t70 -82t92.5 -81t113 -58.5t133.5 -24.5 t133.5 24t113 58.5t92.5 81.5t70 81.5t47 70.5q11 18 9 42.5t-14 41.5q-90 117 -163 189zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l35 34q14 15 12.5 33.5t-16.5 33.5q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
+<glyph unicode="&#xe106;" d="M592 0h-148l31 120q-91 20 -175.5 68.5t-143.5 106.5t-103.5 119t-66.5 110t-22 76q0 21 14 57.5t42.5 82.5t68 95t94.5 95t116.5 82.5t140 59t160.5 22.5q61 0 126 -15l32 121h148zM944 770l47 181q108 -85 176.5 -192t68.5 -159q0 -26 -19.5 -71t-59.5 -102t-93 -112 t-129 -104.5t-158 -75.5l46 173q77 49 136 117t97 131q11 18 9 42.5t-14 41.5q-54 70 -107 130zM310 824q-70 -69 -160 -184q-13 -16 -15 -40.5t9 -42.5q18 -30 39 -60t57 -70.5t74 -73t90 -61t105 -41.5l41 154q-107 18 -178.5 101.5t-71.5 193.5q0 59 23 114q8 19 4.5 22 t-17.5 -12zM448 727l-35 -36q-15 -15 -19.5 -38.5t4.5 -41.5q37 -68 93 -116q16 -13 38.5 -11t36.5 17l12 11l22 86l-3 4q-44 44 -89 117q-11 18 -28 20t-32 -12z" />
+<glyph unicode="&#xe107;" d="M-90 100l642 1066q20 31 48 28.5t48 -35.5l642 -1056q21 -32 7.5 -67.5t-50.5 -35.5h-1294q-37 0 -50.5 34t7.5 66zM155 200h345v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h345l-445 723zM496 700h208q20 0 32 -14.5t8 -34.5l-58 -252 q-4 -20 -21.5 -34.5t-37.5 -14.5h-54q-20 0 -37.5 14.5t-21.5 34.5l-58 252q-4 20 8 34.5t32 14.5z" />
+<glyph unicode="&#xe108;" d="M650 1200q62 0 106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -93 100 -113v-64q0 -21 -13 -29t-32 1l-205 128l-205 -128q-19 -9 -32 -1t-13 29v64q0 20 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5v41 q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44z" />
+<glyph unicode="&#xe109;" d="M850 1200h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-150h-1100v150q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-50h500v50q0 21 14.5 35.5t35.5 14.5zM1100 800v-750q0 -21 -14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v750h1100zM100 600v-100h100v100h-100zM300 600v-100h100v100h-100zM500 600v-100h100v100h-100zM700 600v-100h100v100h-100zM900 600v-100h100v100h-100zM100 400v-100h100v100h-100zM300 400v-100h100v100h-100zM500 400 v-100h100v100h-100zM700 400v-100h100v100h-100zM900 400v-100h100v100h-100zM100 200v-100h100v100h-100zM300 200v-100h100v100h-100zM500 200v-100h100v100h-100zM700 200v-100h100v100h-100zM900 200v-100h100v100h-100z" />
+<glyph unicode="&#xe110;" d="M1135 1165l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-159l-600 -600h-291q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h209l600 600h241v150q0 21 10.5 25t24.5 -10zM522 819l-141 -141l-122 122h-209q-21 0 -35.5 14.5 t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h291zM1135 565l249 -230q15 -14 15 -35t-15 -35l-249 -230q-14 -14 -24.5 -10t-10.5 25v150h-241l-181 181l141 141l122 -122h159v150q0 21 10.5 25t24.5 -10z" />
+<glyph unicode="&#xe111;" d="M100 1100h1000q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-596l-304 -300v300h-100q-41 0 -70.5 29.5t-29.5 70.5v600q0 41 29.5 70.5t70.5 29.5z" />
+<glyph unicode="&#xe112;" d="M150 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM850 1200h200q21 0 35.5 -14.5t14.5 -35.5v-250h-300v250q0 21 14.5 35.5t35.5 14.5zM1100 800v-300q0 -41 -3 -77.5t-15 -89.5t-32 -96t-58 -89t-89 -77t-129 -51t-174 -20t-174 20 t-129 51t-89 77t-58 89t-32 96t-15 89.5t-3 77.5v300h300v-250v-27v-42.5t1.5 -41t5 -38t10 -35t16.5 -30t25.5 -24.5t35 -19t46.5 -12t60 -4t60 4.5t46.5 12.5t35 19.5t25 25.5t17 30.5t10 35t5 38t2 40.5t-0.5 42v25v250h300z" />
+<glyph unicode="&#xe113;" d="M1100 411l-198 -199l-353 353l-353 -353l-197 199l551 551z" />
+<glyph unicode="&#xe114;" d="M1101 789l-550 -551l-551 551l198 199l353 -353l353 353z" />
+<glyph unicode="&#xe115;" d="M404 1000h746q21 0 35.5 -14.5t14.5 -35.5v-551h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v401h-381zM135 984l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-400h385l215 -200h-750q-21 0 -35.5 14.5 t-14.5 35.5v550h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe116;" d="M56 1200h94q17 0 31 -11t18 -27l38 -162h896q24 0 39 -18.5t10 -42.5l-100 -475q-5 -21 -27 -42.5t-55 -21.5h-633l48 -200h535q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-50q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-300v-50 q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v50h-31q-18 0 -32.5 10t-20.5 19l-5 10l-201 961h-54q-20 0 -35 14.5t-15 35.5t15 35.5t35 14.5z" />
+<glyph unicode="&#xe117;" d="M1200 1000v-100h-1200v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500zM0 800h1200v-800h-1200v800z" />
+<glyph unicode="&#xe118;" d="M200 800l-200 -400v600h200q0 41 29.5 70.5t70.5 29.5h300q42 0 71 -29.5t29 -70.5h500v-200h-1000zM1500 700l-300 -700h-1200l300 700h1200z" />
+<glyph unicode="&#xe119;" d="M635 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-601h150q21 0 25 -10.5t-10 -24.5l-230 -249q-14 -15 -35 -15t-35 15l-230 249q-14 14 -10 24.5t25 10.5h150v601h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe120;" d="M936 864l249 -229q14 -15 14 -35.5t-14 -35.5l-249 -229q-15 -15 -25.5 -10.5t-10.5 24.5v151h-600v-151q0 -20 -10.5 -24.5t-25.5 10.5l-249 229q-14 15 -14 35.5t14 35.5l249 229q15 15 25.5 10.5t10.5 -25.5v-149h600v149q0 21 10.5 25.5t25.5 -10.5z" />
+<glyph unicode="&#xe121;" d="M1169 400l-172 732q-5 23 -23 45.5t-38 22.5h-672q-20 0 -38 -20t-23 -41l-172 -739h1138zM1100 300h-1000q-41 0 -70.5 -29.5t-29.5 -70.5v-100q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v100q0 41 -29.5 70.5t-70.5 29.5zM800 100v100h100v-100h-100 zM1000 100v100h100v-100h-100z" />
+<glyph unicode="&#xe122;" d="M1150 1100q21 0 35.5 -14.5t14.5 -35.5v-850q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v850q0 21 14.5 35.5t35.5 14.5zM1000 200l-675 200h-38l47 -276q3 -16 -5.5 -20t-29.5 -4h-7h-84q-20 0 -34.5 14t-18.5 35q-55 337 -55 351v250v6q0 16 1 23.5t6.5 14 t17.5 6.5h200l675 250v-850zM0 750v-250q-4 0 -11 0.5t-24 6t-30 15t-24 30t-11 48.5v50q0 26 10.5 46t25 30t29 16t25.5 7z" />
+<glyph unicode="&#xe123;" d="M553 1200h94q20 0 29 -10.5t3 -29.5l-18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q19 0 33 -14.5t14 -35t-13 -40.5t-31 -27q-8 -4 -23 -9.5t-65 -19.5t-103 -25t-132.5 -20t-158.5 -9q-57 0 -115 5t-104 12t-88.5 15.5t-73.5 17.5t-54.5 16t-35.5 12l-11 4 q-18 8 -31 28t-13 40.5t14 35t33 14.5h17l118 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3.5 32t28.5 13zM498 110q50 -6 102 -6q53 0 102 6q-12 -49 -39.5 -79.5t-62.5 -30.5t-63 30.5t-39 79.5z" />
+<glyph unicode="&#xe124;" d="M800 946l224 78l-78 -224l234 -45l-180 -155l180 -155l-234 -45l78 -224l-224 78l-45 -234l-155 180l-155 -180l-45 234l-224 -78l78 224l-234 45l180 155l-180 155l234 45l-78 224l224 -78l45 234l155 -180l155 180z" />
+<glyph unicode="&#xe125;" d="M650 1200h50q40 0 70 -40.5t30 -84.5v-150l-28 -125h328q40 0 70 -40.5t30 -84.5v-100q0 -45 -29 -74l-238 -344q-16 -24 -38 -40.5t-45 -16.5h-250q-7 0 -42 25t-66 50l-31 25h-61q-45 0 -72.5 18t-27.5 57v400q0 36 20 63l145 196l96 198q13 28 37.5 48t51.5 20z M650 1100l-100 -212l-150 -213v-375h100l136 -100h214l250 375v125h-450l50 225v175h-50zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe126;" d="M600 1100h250q23 0 45 -16.5t38 -40.5l238 -344q29 -29 29 -74v-100q0 -44 -30 -84.5t-70 -40.5h-328q28 -118 28 -125v-150q0 -44 -30 -84.5t-70 -40.5h-50q-27 0 -51.5 20t-37.5 48l-96 198l-145 196q-20 27 -20 63v400q0 39 27.5 57t72.5 18h61q124 100 139 100z M50 1000h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM636 1000l-136 -100h-100v-375l150 -213l100 -212h50v175l-50 225h450v125l-250 375h-214z" />
+<glyph unicode="&#xe127;" d="M356 873l363 230q31 16 53 -6l110 -112q13 -13 13.5 -32t-11.5 -34l-84 -121h302q84 0 138 -38t54 -110t-55 -111t-139 -39h-106l-131 -339q-6 -21 -19.5 -41t-28.5 -20h-342q-7 0 -90 81t-83 94v525q0 17 14 35.5t28 28.5zM400 792v-503l100 -89h293l131 339 q6 21 19.5 41t28.5 20h203q21 0 30.5 25t0.5 50t-31 25h-456h-7h-6h-5.5t-6 0.5t-5 1.5t-5 2t-4 2.5t-4 4t-2.5 4.5q-12 25 5 47l146 183l-86 83zM50 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v500 q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe128;" d="M475 1103l366 -230q2 -1 6 -3.5t14 -10.5t18 -16.5t14.5 -20t6.5 -22.5v-525q0 -13 -86 -94t-93 -81h-342q-15 0 -28.5 20t-19.5 41l-131 339h-106q-85 0 -139.5 39t-54.5 111t54 110t138 38h302l-85 121q-11 15 -10.5 34t13.5 32l110 112q22 22 53 6zM370 945l146 -183 q17 -22 5 -47q-2 -2 -3.5 -4.5t-4 -4t-4 -2.5t-5 -2t-5 -1.5t-6 -0.5h-6h-6.5h-6h-475v-100h221q15 0 29 -20t20 -41l130 -339h294l106 89v503l-342 236zM1050 800h100q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5 v500q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe129;" d="M550 1294q72 0 111 -55t39 -139v-106l339 -131q21 -6 41 -19.5t20 -28.5v-342q0 -7 -81 -90t-94 -83h-525q-17 0 -35.5 14t-28.5 28l-9 14l-230 363q-16 31 6 53l112 110q13 13 32 13.5t34 -11.5l121 -84v302q0 84 38 138t110 54zM600 972v203q0 21 -25 30.5t-50 0.5 t-25 -31v-456v-7v-6v-5.5t-0.5 -6t-1.5 -5t-2 -5t-2.5 -4t-4 -4t-4.5 -2.5q-25 -12 -47 5l-183 146l-83 -86l236 -339h503l89 100v293l-339 131q-21 6 -41 19.5t-20 28.5zM450 200h500q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-500 q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe130;" d="M350 1100h500q21 0 35.5 14.5t14.5 35.5v100q0 21 -14.5 35.5t-35.5 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100q0 -21 14.5 -35.5t35.5 -14.5zM600 306v-106q0 -84 -39 -139t-111 -55t-110 54t-38 138v302l-121 -84q-15 -12 -34 -11.5t-32 13.5l-112 110 q-22 22 -6 53l230 363q1 2 3.5 6t10.5 13.5t16.5 17t20 13.5t22.5 6h525q13 0 94 -83t81 -90v-342q0 -15 -20 -28.5t-41 -19.5zM308 900l-236 -339l83 -86l183 146q22 17 47 5q2 -1 4.5 -2.5t4 -4t2.5 -4t2 -5t1.5 -5t0.5 -6v-5.5v-6v-7v-456q0 -22 25 -31t50 0.5t25 30.5 v203q0 15 20 28.5t41 19.5l339 131v293l-89 100h-503z" />
+<glyph unicode="&#xe131;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM914 632l-275 223q-16 13 -27.5 8t-11.5 -26v-137h-275 q-10 0 -17.5 -7.5t-7.5 -17.5v-150q0 -10 7.5 -17.5t17.5 -7.5h275v-137q0 -21 11.5 -26t27.5 8l275 223q16 13 16 32t-16 32z" />
+<glyph unicode="&#xe132;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM561 855l-275 -223q-16 -13 -16 -32t16 -32l275 -223q16 -13 27.5 -8 t11.5 26v137h275q10 0 17.5 7.5t7.5 17.5v150q0 10 -7.5 17.5t-17.5 7.5h-275v137q0 21 -11.5 26t-27.5 -8z" />
+<glyph unicode="&#xe133;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM855 639l-223 275q-13 16 -32 16t-32 -16l-223 -275q-13 -16 -8 -27.5 t26 -11.5h137v-275q0 -10 7.5 -17.5t17.5 -7.5h150q10 0 17.5 7.5t7.5 17.5v275h137q21 0 26 11.5t-8 27.5z" />
+<glyph unicode="&#xe134;" d="M600 1178q118 0 225 -45.5t184.5 -123t123 -184.5t45.5 -225t-45.5 -225t-123 -184.5t-184.5 -123t-225 -45.5t-225 45.5t-184.5 123t-123 184.5t-45.5 225t45.5 225t123 184.5t184.5 123t225 45.5zM675 900h-150q-10 0 -17.5 -7.5t-7.5 -17.5v-275h-137q-21 0 -26 -11.5 t8 -27.5l223 -275q13 -16 32 -16t32 16l223 275q13 16 8 27.5t-26 11.5h-137v275q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe135;" d="M600 1176q116 0 222.5 -46t184 -123.5t123.5 -184t46 -222.5t-46 -222.5t-123.5 -184t-184 -123.5t-222.5 -46t-222.5 46t-184 123.5t-123.5 184t-46 222.5t46 222.5t123.5 184t184 123.5t222.5 46zM627 1101q-15 -12 -36.5 -20.5t-35.5 -12t-43 -8t-39 -6.5 q-15 -3 -45.5 0t-45.5 -2q-20 -7 -51.5 -26.5t-34.5 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -91t-29.5 -79q-9 -34 5 -93t8 -87q0 -9 17 -44.5t16 -59.5q12 0 23 -5t23.5 -15t19.5 -14q16 -8 33 -15t40.5 -15t34.5 -12q21 -9 52.5 -32t60 -38t57.5 -11 q7 -15 -3 -34t-22.5 -40t-9.5 -38q13 -21 23 -34.5t27.5 -27.5t36.5 -18q0 -7 -3.5 -16t-3.5 -14t5 -17q104 -2 221 112q30 29 46.5 47t34.5 49t21 63q-13 8 -37 8.5t-36 7.5q-15 7 -49.5 15t-51.5 19q-18 0 -41 -0.5t-43 -1.5t-42 -6.5t-38 -16.5q-51 -35 -66 -12 q-4 1 -3.5 25.5t0.5 25.5q-6 13 -26.5 17.5t-24.5 6.5q1 15 -0.5 30.5t-7 28t-18.5 11.5t-31 -21q-23 -25 -42 4q-19 28 -8 58q6 16 22 22q6 -1 26 -1.5t33.5 -4t19.5 -13.5q7 -12 18 -24t21.5 -20.5t20 -15t15.5 -10.5l5 -3q2 12 7.5 30.5t8 34.5t-0.5 32q-3 18 3.5 29 t18 22.5t15.5 24.5q6 14 10.5 35t8 31t15.5 22.5t34 22.5q-6 18 10 36q8 0 24 -1.5t24.5 -1.5t20 4.5t20.5 15.5q-10 23 -31 42.5t-37.5 29.5t-49 27t-43.5 23q0 1 2 8t3 11.5t1.5 10.5t-1 9.5t-4.5 4.5q31 -13 58.5 -14.5t38.5 2.5l12 5q5 28 -9.5 46t-36.5 24t-50 15 t-41 20q-18 -4 -37 0zM613 994q0 -17 8 -42t17 -45t9 -23q-8 1 -39.5 5.5t-52.5 10t-37 16.5q3 11 16 29.5t16 25.5q10 -10 19 -10t14 6t13.5 14.5t16.5 12.5z" />
+<glyph unicode="&#xe136;" d="M756 1157q164 92 306 -9l-259 -138l145 -232l251 126q6 -89 -34 -156.5t-117 -110.5q-60 -34 -127 -39.5t-126 16.5l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5t15 37.5l600 599q-34 101 5.5 201.5t135.5 154.5z" />
+<glyph unicode="&#xe137;" horiz-adv-x="1220" d="M100 1196h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 1096h-200v-100h200v100zM100 796h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 696h-500v-100h500v100zM100 396h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5v100q0 41 29.5 70.5t70.5 29.5zM1100 296h-300v-100h300v100z " />
+<glyph unicode="&#xe138;" d="M150 1200h900q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM700 500v-300l-200 -200v500l-350 500h900z" />
+<glyph unicode="&#xe139;" d="M500 1200h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5zM500 1100v-100h200v100h-200zM1200 400v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5v200h1200z" />
+<glyph unicode="&#xe140;" d="M50 1200h300q21 0 25 -10.5t-10 -24.5l-94 -94l199 -199q7 -8 7 -18t-7 -18l-106 -106q-8 -7 -18 -7t-18 7l-199 199l-94 -94q-14 -14 -24.5 -10t-10.5 25v300q0 21 14.5 35.5t35.5 14.5zM850 1200h300q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -10.5 -25t-24.5 10l-94 94 l-199 -199q-8 -7 -18 -7t-18 7l-106 106q-7 8 -7 18t7 18l199 199l-94 94q-14 14 -10 24.5t25 10.5zM364 470l106 -106q7 -8 7 -18t-7 -18l-199 -199l94 -94q14 -14 10 -24.5t-25 -10.5h-300q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 10.5 25t24.5 -10l94 -94l199 199 q8 7 18 7t18 -7zM1071 271l94 94q14 14 24.5 10t10.5 -25v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -25 10.5t10 24.5l94 94l-199 199q-7 8 -7 18t7 18l106 106q8 7 18 7t18 -7z" />
+<glyph unicode="&#xe141;" d="M596 1192q121 0 231.5 -47.5t190 -127t127 -190t47.5 -231.5t-47.5 -231.5t-127 -190.5t-190 -127t-231.5 -47t-231.5 47t-190.5 127t-127 190.5t-47 231.5t47 231.5t127 190t190.5 127t231.5 47.5zM596 1010q-112 0 -207.5 -55.5t-151 -151t-55.5 -207.5t55.5 -207.5 t151 -151t207.5 -55.5t207.5 55.5t151 151t55.5 207.5t-55.5 207.5t-151 151t-207.5 55.5zM454.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38.5 -16.5t-38.5 16.5t-16 39t16 38.5t38.5 16zM754.5 905q22.5 0 38.5 -16t16 -38.5t-16 -39t-38 -16.5q-14 0 -29 10l-55 -145 q17 -23 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5t-61.5 25.5t-25.5 61.5q0 32 20.5 56.5t51.5 29.5l122 126l1 1q-9 14 -9 28q0 23 16 39t38.5 16zM345.5 709q22.5 0 38.5 -16t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16zM854.5 709q22.5 0 38.5 -16 t16 -38.5t-16 -38.5t-38.5 -16t-38.5 16t-16 38.5t16 38.5t38.5 16z" />
+<glyph unicode="&#xe142;" d="M546 173l469 470q91 91 99 192q7 98 -52 175.5t-154 94.5q-22 4 -47 4q-34 0 -66.5 -10t-56.5 -23t-55.5 -38t-48 -41.5t-48.5 -47.5q-376 -375 -391 -390q-30 -27 -45 -41.5t-37.5 -41t-32 -46.5t-16 -47.5t-1.5 -56.5q9 -62 53.5 -95t99.5 -33q74 0 125 51l548 548 q36 36 20 75q-7 16 -21.5 26t-32.5 10q-26 0 -50 -23q-13 -12 -39 -38l-341 -338q-15 -15 -35.5 -15.5t-34.5 13.5t-14 34.5t14 34.5q327 333 361 367q35 35 67.5 51.5t78.5 16.5q14 0 29 -1q44 -8 74.5 -35.5t43.5 -68.5q14 -47 2 -96.5t-47 -84.5q-12 -11 -32 -32 t-79.5 -81t-114.5 -115t-124.5 -123.5t-123 -119.5t-96.5 -89t-57 -45q-56 -27 -120 -27q-70 0 -129 32t-93 89q-48 78 -35 173t81 163l511 511q71 72 111 96q91 55 198 55q80 0 152 -33q78 -36 129.5 -103t66.5 -154q17 -93 -11 -183.5t-94 -156.5l-482 -476 q-15 -15 -36 -16t-37 14t-17.5 34t14.5 35z" />
+<glyph unicode="&#xe143;" d="M649 949q48 68 109.5 104t121.5 38.5t118.5 -20t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-150 152.5t-126.5 127.5t-93.5 124.5t-33.5 117.5q0 64 28 123t73 100.5t104 64t119 20 t120.5 -38.5t104.5 -104zM896 972q-33 0 -64.5 -19t-56.5 -46t-47.5 -53.5t-43.5 -45.5t-37.5 -19t-36 19t-40 45.5t-43 53.5t-54 46t-65.5 19q-67 0 -122.5 -55.5t-55.5 -132.5q0 -23 13.5 -51t46 -65t57.5 -63t76 -75l22 -22q15 -14 44 -44t50.5 -51t46 -44t41 -35t23 -12 t23.5 12t42.5 36t46 44t52.5 52t44 43q4 4 12 13q43 41 63.5 62t52 55t46 55t26 46t11.5 44q0 79 -53 133.5t-120 54.5z" />
+<glyph unicode="&#xe144;" d="M776.5 1214q93.5 0 159.5 -66l141 -141q66 -66 66 -160q0 -42 -28 -95.5t-62 -87.5l-29 -29q-31 53 -77 99l-18 18l95 95l-247 248l-389 -389l212 -212l-105 -106l-19 18l-141 141q-66 66 -66 159t66 159l283 283q65 66 158.5 66zM600 706l105 105q10 -8 19 -17l141 -141 q66 -66 66 -159t-66 -159l-283 -283q-66 -66 -159 -66t-159 66l-141 141q-66 66 -66 159.5t66 159.5l55 55q29 -55 75 -102l18 -17l-95 -95l247 -248l389 389z" />
+<glyph unicode="&#xe145;" d="M603 1200q85 0 162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5v953q0 21 30 46.5t81 48t129 37.5t163 15zM300 1000v-700h600v700h-600zM600 254q-43 0 -73.5 -30.5t-30.5 -73.5t30.5 -73.5t73.5 -30.5t73.5 30.5 t30.5 73.5t-30.5 73.5t-73.5 30.5z" />
+<glyph unicode="&#xe146;" d="M902 1185l283 -282q15 -15 15 -36t-14.5 -35.5t-35.5 -14.5t-35 15l-36 35l-279 -267v-300l-212 210l-308 -307l-280 -203l203 280l307 308l-210 212h300l267 279l-35 36q-15 14 -15 35t14.5 35.5t35.5 14.5t35 -15z" />
+<glyph unicode="&#xe148;" d="M700 1248v-78q38 -5 72.5 -14.5t75.5 -31.5t71 -53.5t52 -84t24 -118.5h-159q-4 36 -10.5 59t-21 45t-40 35.5t-64.5 20.5v-307l64 -13q34 -7 64 -16.5t70 -32t67.5 -52.5t47.5 -80t20 -112q0 -139 -89 -224t-244 -97v-77h-100v79q-150 16 -237 103q-40 40 -52.5 93.5 t-15.5 139.5h139q5 -77 48.5 -126t117.5 -65v335l-27 8q-46 14 -79 26.5t-72 36t-63 52t-40 72.5t-16 98q0 70 25 126t67.5 92t94.5 57t110 27v77h100zM600 754v274q-29 -4 -50 -11t-42 -21.5t-31.5 -41.5t-10.5 -65q0 -29 7 -50.5t16.5 -34t28.5 -22.5t31.5 -14t37.5 -10 q9 -3 13 -4zM700 547v-310q22 2 42.5 6.5t45 15.5t41.5 27t29 42t12 59.5t-12.5 59.5t-38 44.5t-53 31t-66.5 24.5z" />
+<glyph unicode="&#xe149;" d="M561 1197q84 0 160.5 -40t123.5 -109.5t47 -147.5h-153q0 40 -19.5 71.5t-49.5 48.5t-59.5 26t-55.5 9q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -26 13.5 -63t26.5 -61t37 -66q6 -9 9 -14h241v-100h-197q8 -50 -2.5 -115t-31.5 -95q-45 -62 -99 -112 q34 10 83 17.5t71 7.5q32 1 102 -16t104 -17q83 0 136 30l50 -147q-31 -19 -58 -30.5t-55 -15.5t-42 -4.5t-46 -0.5q-23 0 -76 17t-111 32.5t-96 11.5q-39 -3 -82 -16t-67 -25l-23 -11l-55 145q4 3 16 11t15.5 10.5t13 9t15.5 12t14.5 14t17.5 18.5q48 55 54 126.5 t-30 142.5h-221v100h166q-23 47 -44 104q-7 20 -12 41.5t-6 55.5t6 66.5t29.5 70.5t58.5 71q97 88 263 88z" />
+<glyph unicode="&#xe150;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM935 1184l230 -249q14 -14 10 -24.5t-25 -10.5h-150v-900h-200v900h-150q-21 0 -25 10.5t10 24.5l230 249q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe151;" d="M1000 700h-100v100h-100v-100h-100v500h300v-500zM400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM801 1100v-200h100v200h-100zM1000 350l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150z " />
+<glyph unicode="&#xe152;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 1050l-200 -250h200v-100h-300v150l200 250h-200v100h300v-150zM1000 0h-100v100h-100v-100h-100v500h300v-500zM801 400v-200h100v200h-100z " />
+<glyph unicode="&#xe153;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1000 700h-100v400h-100v100h200v-500zM1100 0h-100v100h-200v400h300v-500zM901 400v-200h100v200h-100z" />
+<glyph unicode="&#xe154;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1100 700h-100v100h-200v400h300v-500zM901 1100v-200h100v200h-100zM1000 0h-100v400h-100v100h200v-500z" />
+<glyph unicode="&#xe155;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM900 1000h-200v200h200v-200zM1000 700h-300v200h300v-200zM1100 400h-400v200h400v-200zM1200 100h-500v200h500v-200z" />
+<glyph unicode="&#xe156;" d="M400 300h150q21 0 25 -11t-10 -25l-230 -250q-14 -15 -35 -15t-35 15l-230 250q-14 14 -10 25t25 11h150v900h200v-900zM1200 1000h-500v200h500v-200zM1100 700h-400v200h400v-200zM1000 400h-300v200h300v-200zM900 100h-200v200h200v-200z" />
+<glyph unicode="&#xe157;" d="M350 1100h400q162 0 256 -93.5t94 -256.5v-400q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5z" />
+<glyph unicode="&#xe158;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-163 0 -256.5 92.5t-93.5 257.5v400q0 163 94 256.5t256 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM440 770l253 -190q17 -12 17 -30t-17 -30l-253 -190q-16 -12 -28 -6.5t-12 26.5v400q0 21 12 26.5t28 -6.5z" />
+<glyph unicode="&#xe159;" d="M350 1100h400q163 0 256.5 -94t93.5 -256v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 163 92.5 256.5t257.5 93.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM350 700h400q21 0 26.5 -12t-6.5 -28l-190 -253q-12 -17 -30 -17t-30 17l-190 253q-12 16 -6.5 28t26.5 12z" />
+<glyph unicode="&#xe160;" d="M350 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -163 -92.5 -256.5t-257.5 -93.5h-400q-163 0 -256.5 94t-93.5 256v400q0 165 92.5 257.5t257.5 92.5zM800 900h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5 v500q0 41 -29.5 70.5t-70.5 29.5zM580 693l190 -253q12 -16 6.5 -28t-26.5 -12h-400q-21 0 -26.5 12t6.5 28l190 253q12 17 30 17t30 -17z" />
+<glyph unicode="&#xe161;" d="M550 1100h400q165 0 257.5 -92.5t92.5 -257.5v-400q0 -165 -92.5 -257.5t-257.5 -92.5h-400q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h450q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-450q-21 0 -35.5 14.5t-14.5 35.5v100 q0 21 14.5 35.5t35.5 14.5zM338 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
+<glyph unicode="&#xe162;" d="M793 1182l9 -9q8 -10 5 -27q-3 -11 -79 -225.5t-78 -221.5l300 1q24 0 32.5 -17.5t-5.5 -35.5q-1 0 -133.5 -155t-267 -312.5t-138.5 -162.5q-12 -15 -26 -15h-9l-9 8q-9 11 -4 32q2 9 42 123.5t79 224.5l39 110h-302q-23 0 -31 19q-10 21 6 41q75 86 209.5 237.5 t228 257t98.5 111.5q9 16 25 16h9z" />
+<glyph unicode="&#xe163;" d="M350 1100h400q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-450q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h450q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400 q0 165 92.5 257.5t257.5 92.5zM938 867l324 -284q16 -14 16 -33t-16 -33l-324 -284q-16 -14 -27 -9t-11 26v150h-250q-21 0 -35.5 14.5t-14.5 35.5v200q0 21 14.5 35.5t35.5 14.5h250v150q0 21 11 26t27 -9z" />
+<glyph unicode="&#xe164;" d="M750 1200h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -10.5 -25t-24.5 10l-109 109l-312 -312q-15 -15 -35.5 -15t-35.5 15l-141 141q-15 15 -15 35.5t15 35.5l312 312l-109 109q-14 14 -10 24.5t25 10.5zM456 900h-156q-41 0 -70.5 -29.5t-29.5 -70.5v-500 q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v148l200 200v-298q0 -165 -93.5 -257.5t-256.5 -92.5h-400q-165 0 -257.5 92.5t-92.5 257.5v400q0 165 92.5 257.5t257.5 92.5h300z" />
+<glyph unicode="&#xe165;" d="M600 1186q119 0 227.5 -46.5t187 -125t125 -187t46.5 -227.5t-46.5 -227.5t-125 -187t-187 -125t-227.5 -46.5t-227.5 46.5t-187 125t-125 187t-46.5 227.5t46.5 227.5t125 187t187 125t227.5 46.5zM600 1022q-115 0 -212 -56.5t-153.5 -153.5t-56.5 -212t56.5 -212 t153.5 -153.5t212 -56.5t212 56.5t153.5 153.5t56.5 212t-56.5 212t-153.5 153.5t-212 56.5zM600 794q80 0 137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137t57 137t137 57z" />
+<glyph unicode="&#xe166;" d="M450 1200h200q21 0 35.5 -14.5t14.5 -35.5v-350h245q20 0 25 -11t-9 -26l-383 -426q-14 -15 -33.5 -15t-32.5 15l-379 426q-13 15 -8.5 26t25.5 11h250v350q0 21 14.5 35.5t35.5 14.5zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe167;" d="M583 1182l378 -435q14 -15 9 -31t-26 -16h-244v-250q0 -20 -17 -35t-39 -15h-200q-20 0 -32 14.5t-12 35.5v250h-250q-20 0 -25.5 16.5t8.5 31.5l383 431q14 16 33.5 17t33.5 -14zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5z M900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe168;" d="M396 723l369 369q7 7 17.5 7t17.5 -7l139 -139q7 -8 7 -18.5t-7 -17.5l-525 -525q-7 -8 -17.5 -8t-17.5 8l-292 291q-7 8 -7 18t7 18l139 139q8 7 18.5 7t17.5 -7zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50 h-100z" />
+<glyph unicode="&#xe169;" d="M135 1023l142 142q14 14 35 14t35 -14l77 -77l-212 -212l-77 76q-14 15 -14 36t14 35zM655 855l210 210q14 14 24.5 10t10.5 -25l-2 -599q-1 -20 -15.5 -35t-35.5 -15l-597 -1q-21 0 -25 10.5t10 24.5l208 208l-154 155l212 212zM50 300h1000q21 0 35.5 -14.5t14.5 -35.5 v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe170;" d="M350 1200l599 -2q20 -1 35 -15.5t15 -35.5l1 -597q0 -21 -10.5 -25t-24.5 10l-208 208l-155 -154l-212 212l155 154l-210 210q-14 14 -10 24.5t25 10.5zM524 512l-76 -77q-15 -14 -36 -14t-35 14l-142 142q-14 14 -14 35t14 35l77 77zM50 300h1000q21 0 35.5 -14.5 t14.5 -35.5v-250h-1100v250q0 21 14.5 35.5t35.5 14.5zM900 200v-50h100v50h-100z" />
+<glyph unicode="&#xe171;" d="M1200 103l-483 276l-314 -399v423h-399l1196 796v-1096zM483 424v-230l683 953z" />
+<glyph unicode="&#xe172;" d="M1100 1000v-850q0 -21 -14.5 -35.5t-35.5 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200z" />
+<glyph unicode="&#xe173;" d="M1100 1000l-2 -149l-299 -299l-95 95q-9 9 -21.5 9t-21.5 -9l-149 -147h-312v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1132 638l106 -106q7 -7 7 -17.5t-7 -17.5l-420 -421q-8 -7 -18 -7 t-18 7l-202 203q-8 7 -8 17.5t8 17.5l106 106q7 8 17.5 8t17.5 -8l79 -79l297 297q7 7 17.5 7t17.5 -7z" />
+<glyph unicode="&#xe174;" d="M1100 1000v-269l-103 -103l-134 134q-15 15 -33.5 16.5t-34.5 -12.5l-266 -266h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM1202 572l70 -70q15 -15 15 -35.5t-15 -35.5l-131 -131 l131 -131q15 -15 15 -35.5t-15 -35.5l-70 -70q-15 -15 -35.5 -15t-35.5 15l-131 131l-131 -131q-15 -15 -35.5 -15t-35.5 15l-70 70q-15 15 -15 35.5t15 35.5l131 131l-131 131q-15 15 -15 35.5t15 35.5l70 70q15 15 35.5 15t35.5 -15l131 -131l131 131q15 15 35.5 15 t35.5 -15z" />
+<glyph unicode="&#xe175;" d="M1100 1000v-300h-350q-21 0 -35.5 -14.5t-14.5 -35.5v-150h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM850 600h100q21 0 35.5 -14.5t14.5 -35.5v-250h150q21 0 25 -10.5t-10 -24.5 l-230 -230q-14 -14 -35 -14t-35 14l-230 230q-14 14 -10 24.5t25 10.5h150v250q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe176;" d="M1100 1000v-400l-165 165q-14 15 -35 15t-35 -15l-263 -265h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100zM700 1000h-100v200h100v-200zM935 565l230 -229q14 -15 10 -25.5t-25 -10.5h-150v-250q0 -20 -14.5 -35 t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35v250h-150q-21 0 -25 10.5t10 25.5l230 229q14 15 35 15t35 -15z" />
+<glyph unicode="&#xe177;" d="M50 1100h1100q21 0 35.5 -14.5t14.5 -35.5v-150h-1200v150q0 21 14.5 35.5t35.5 14.5zM1200 800v-550q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v550h1200zM100 500v-200h400v200h-400z" />
+<glyph unicode="&#xe178;" d="M935 1165l248 -230q14 -14 14 -35t-14 -35l-248 -230q-14 -14 -24.5 -10t-10.5 25v150h-400v200h400v150q0 21 10.5 25t24.5 -10zM200 800h-50q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v-200zM400 800h-100v200h100v-200zM18 435l247 230 q14 14 24.5 10t10.5 -25v-150h400v-200h-400v-150q0 -21 -10.5 -25t-24.5 10l-247 230q-15 14 -15 35t15 35zM900 300h-100v200h100v-200zM1000 500h51q20 0 34.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-34.5 -14.5h-51v200z" />
+<glyph unicode="&#xe179;" d="M862 1073l276 116q25 18 43.5 8t18.5 -41v-1106q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v397q-4 1 -11 5t-24 17.5t-30 29t-24 42t-11 56.5v359q0 31 18.5 65t43.5 52zM550 1200q22 0 34.5 -12.5t14.5 -24.5l1 -13v-450q0 -28 -10.5 -59.5 t-25 -56t-29 -45t-25.5 -31.5l-10 -11v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447q-4 4 -11 11.5t-24 30.5t-30 46t-24 55t-11 60v450q0 2 0.5 5.5t4 12t8.5 15t14.5 12t22.5 5.5q20 0 32.5 -12.5t14.5 -24.5l3 -13v-350h100v350v5.5t2.5 12 t7 15t15 12t25.5 5.5q23 0 35.5 -12.5t13.5 -24.5l1 -13v-350h100v350q0 2 0.5 5.5t3 12t7 15t15 12t24.5 5.5z" />
+<glyph unicode="&#xe180;" d="M1200 1100v-56q-4 0 -11 -0.5t-24 -3t-30 -7.5t-24 -15t-11 -24v-888q0 -22 25 -34.5t50 -13.5l25 -2v-56h-400v56q75 0 87.5 6.5t12.5 43.5v394h-500v-394q0 -37 12.5 -43.5t87.5 -6.5v-56h-400v56q4 0 11 0.5t24 3t30 7.5t24 15t11 24v888q0 22 -25 34.5t-50 13.5 l-25 2v56h400v-56q-75 0 -87.5 -6.5t-12.5 -43.5v-394h500v394q0 37 -12.5 43.5t-87.5 6.5v56h400z" />
+<glyph unicode="&#xe181;" d="M675 1000h375q21 0 35.5 -14.5t14.5 -35.5v-150h-105l-295 -98v98l-200 200h-400l100 100h375zM100 900h300q41 0 70.5 -29.5t29.5 -70.5v-500q0 -41 -29.5 -70.5t-70.5 -29.5h-300q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5zM100 800v-200h300v200 h-300zM1100 535l-400 -133v163l400 133v-163zM100 500v-200h300v200h-300zM1100 398v-248q0 -21 -14.5 -35.5t-35.5 -14.5h-375l-100 -100h-375l-100 100h400l200 200h105z" />
+<glyph unicode="&#xe182;" d="M17 1007l162 162q17 17 40 14t37 -22l139 -194q14 -20 11 -44.5t-20 -41.5l-119 -118q102 -142 228 -268t267 -227l119 118q17 17 42.5 19t44.5 -12l192 -136q19 -14 22.5 -37.5t-13.5 -40.5l-163 -162q-3 -1 -9.5 -1t-29.5 2t-47.5 6t-62.5 14.5t-77.5 26.5t-90 42.5 t-101.5 60t-111 83t-119 108.5q-74 74 -133.5 150.5t-94.5 138.5t-60 119.5t-34.5 100t-15 74.5t-4.5 48z" />
+<glyph unicode="&#xe183;" d="M600 1100q92 0 175 -10.5t141.5 -27t108.5 -36.5t81.5 -40t53.5 -37t31 -27l9 -10v-200q0 -21 -14.5 -33t-34.5 -9l-202 34q-20 3 -34.5 20t-14.5 38v146q-141 24 -300 24t-300 -24v-146q0 -21 -14.5 -38t-34.5 -20l-202 -34q-20 -3 -34.5 9t-14.5 33v200q3 4 9.5 10.5 t31 26t54 37.5t80.5 39.5t109 37.5t141 26.5t175 10.5zM600 795q56 0 97 -9.5t60 -23.5t30 -28t12 -24l1 -10v-50l365 -303q14 -15 24.5 -40t10.5 -45v-212q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v212q0 20 10.5 45t24.5 40l365 303v50 q0 4 1 10.5t12 23t30 29t60 22.5t97 10z" />
+<glyph unicode="&#xe184;" d="M1100 700l-200 -200h-600l-200 200v500h200v-200h200v200h200v-200h200v200h200v-500zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5 t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe185;" d="M700 1100h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-1000h300v1000q0 41 -29.5 70.5t-70.5 29.5zM1100 800h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-700h300v700q0 41 -29.5 70.5t-70.5 29.5zM400 0h-300v400q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-400z " />
+<glyph unicode="&#xe186;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
+<glyph unicode="&#xe187;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 300h-100v200h-100v-200h-100v500h100v-200h100v200h100v-500zM900 700v-300l-100 -100h-200v500h200z M700 700v-300h100v300h-100z" />
+<glyph unicode="&#xe188;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-300h200v-100h-300v500h300v-100zM900 700h-200v-300h200v-100h-300v500h300v-100z" />
+<glyph unicode="&#xe189;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 400l-300 150l300 150v-300zM900 550l-300 -150v300z" />
+<glyph unicode="&#xe190;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM900 300h-700v500h700v-500zM800 700h-130q-38 0 -66.5 -43t-28.5 -108t27 -107t68 -42h130v300zM300 700v-300 h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130z" />
+<glyph unicode="&#xe191;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 700h-200v-100h200v-300h-300v100h200v100h-200v300h300v-100zM900 300h-100v400h-100v100h200v-500z M700 300h-100v100h100v-100z" />
+<glyph unicode="&#xe192;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM300 700h200v-400h-300v500h100v-100zM900 300h-100v400h-100v100h200v-500zM300 600v-200h100v200h-100z M700 300h-100v100h100v-100z" />
+<glyph unicode="&#xe193;" d="M200 1100h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212v500q0 124 88 212t212 88zM100 900v-700h900v700h-900zM500 500l-199 -200h-100v50l199 200v150h-200v100h300v-300zM900 300h-100v400h-100v100h200v-500zM701 300h-100 v100h100v-100z" />
+<glyph unicode="&#xe194;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700h-300v-200h300v-100h-300l-100 100v200l100 100h300v-100z" />
+<glyph unicode="&#xe195;" d="M600 1191q120 0 229.5 -47t188.5 -126t126 -188.5t47 -229.5t-47 -229.5t-126 -188.5t-188.5 -126t-229.5 -47t-229.5 47t-188.5 126t-126 188.5t-47 229.5t47 229.5t126 188.5t188.5 126t229.5 47zM600 1021q-114 0 -211 -56.5t-153.5 -153.5t-56.5 -211t56.5 -211 t153.5 -153.5t211 -56.5t211 56.5t153.5 153.5t56.5 211t-56.5 211t-153.5 153.5t-211 56.5zM800 700v-100l-50 -50l100 -100v-50h-100l-100 100h-150v-100h-100v400h300zM500 700v-100h200v100h-200z" />
+<glyph unicode="&#xe197;" d="M503 1089q110 0 200.5 -59.5t134.5 -156.5q44 14 90 14q120 0 205 -86.5t85 -207t-85 -207t-205 -86.5h-128v250q0 21 -14.5 35.5t-35.5 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-250h-222q-80 0 -136 57.5t-56 136.5q0 69 43 122.5t108 67.5q-2 19 -2 37q0 100 49 185 t134 134t185 49zM525 500h150q10 0 17.5 -7.5t7.5 -17.5v-275h137q21 0 26 -11.5t-8 -27.5l-223 -244q-13 -16 -32 -16t-32 16l-223 244q-13 16 -8 27.5t26 11.5h137v275q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe198;" d="M502 1089q110 0 201 -59.5t135 -156.5q43 15 89 15q121 0 206 -86.5t86 -206.5q0 -99 -60 -181t-150 -110l-378 360q-13 16 -31.5 16t-31.5 -16l-381 -365h-9q-79 0 -135.5 57.5t-56.5 136.5q0 69 43 122.5t108 67.5q-2 19 -2 38q0 100 49 184.5t133.5 134t184.5 49.5z M632 467l223 -228q13 -16 8 -27.5t-26 -11.5h-137v-275q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v275h-137q-21 0 -26 11.5t8 27.5q199 204 223 228q19 19 31.5 19t32.5 -19z" />
+<glyph unicode="&#xe199;" d="M700 100v100h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170l-270 -300h400v-100h-50q-21 0 -35.5 -14.5t-14.5 -35.5v-50h400v50q0 21 -14.5 35.5t-35.5 14.5h-50z" />
+<glyph unicode="&#xe200;" d="M600 1179q94 0 167.5 -56.5t99.5 -145.5q89 -6 150.5 -71.5t61.5 -155.5q0 -61 -29.5 -112.5t-79.5 -82.5q9 -29 9 -55q0 -74 -52.5 -126.5t-126.5 -52.5q-55 0 -100 30v-251q21 0 35.5 -14.5t14.5 -35.5v-50h-300v50q0 21 14.5 35.5t35.5 14.5v251q-45 -30 -100 -30 q-74 0 -126.5 52.5t-52.5 126.5q0 18 4 38q-47 21 -75.5 65t-28.5 97q0 74 52.5 126.5t126.5 52.5q5 0 23 -2q0 2 -1 10t-1 13q0 116 81.5 197.5t197.5 81.5z" />
+<glyph unicode="&#xe201;" d="M1010 1010q111 -111 150.5 -260.5t0 -299t-150.5 -260.5q-83 -83 -191.5 -126.5t-218.5 -43.5t-218.5 43.5t-191.5 126.5q-111 111 -150.5 260.5t0 299t150.5 260.5q83 83 191.5 126.5t218.5 43.5t218.5 -43.5t191.5 -126.5zM476 1065q-4 0 -8 -1q-121 -34 -209.5 -122.5 t-122.5 -209.5q-4 -12 2.5 -23t18.5 -14l36 -9q3 -1 7 -1q23 0 29 22q27 96 98 166q70 71 166 98q11 3 17.5 13.5t3.5 22.5l-9 35q-3 13 -14 19q-7 4 -15 4zM512 920q-4 0 -9 -2q-80 -24 -138.5 -82.5t-82.5 -138.5q-4 -13 2 -24t19 -14l34 -9q4 -1 8 -1q22 0 28 21 q18 58 58.5 98.5t97.5 58.5q12 3 18 13.5t3 21.5l-9 35q-3 12 -14 19q-7 4 -15 4zM719.5 719.5q-49.5 49.5 -119.5 49.5t-119.5 -49.5t-49.5 -119.5t49.5 -119.5t119.5 -49.5t119.5 49.5t49.5 119.5t-49.5 119.5zM855 551q-22 0 -28 -21q-18 -58 -58.5 -98.5t-98.5 -57.5 q-11 -4 -17 -14.5t-3 -21.5l9 -35q3 -12 14 -19q7 -4 15 -4q4 0 9 2q80 24 138.5 82.5t82.5 138.5q4 13 -2.5 24t-18.5 14l-34 9q-4 1 -8 1zM1000 515q-23 0 -29 -22q-27 -96 -98 -166q-70 -71 -166 -98q-11 -3 -17.5 -13.5t-3.5 -22.5l9 -35q3 -13 14 -19q7 -4 15 -4 q4 0 8 1q121 34 209.5 122.5t122.5 209.5q4 12 -2.5 23t-18.5 14l-36 9q-3 1 -7 1z" />
+<glyph unicode="&#xe202;" d="M700 800h300v-380h-180v200h-340v-200h-380v755q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM700 300h162l-212 -212l-212 212h162v200h100v-200zM520 0h-395q-10 0 -17.5 7.5t-7.5 17.5v395zM1000 220v-195q0 -10 -7.5 -17.5t-17.5 -7.5h-195z" />
+<glyph unicode="&#xe203;" d="M700 800h300v-520l-350 350l-550 -550v1095q0 10 7.5 17.5t17.5 7.5h575v-400zM1000 900h-200v200zM862 200h-162v-200h-100v200h-162l212 212zM480 0h-355q-10 0 -17.5 7.5t-7.5 17.5v55h380v-80zM1000 80v-55q0 -10 -7.5 -17.5t-17.5 -7.5h-155v80h180z" />
+<glyph unicode="&#xe204;" d="M1162 800h-162v-200h100l100 -100h-300v300h-162l212 212zM200 800h200q27 0 40 -2t29.5 -10.5t23.5 -30t7 -57.5h300v-100h-600l-200 -350v450h100q0 36 7 57.5t23.5 30t29.5 10.5t40 2zM800 400h240l-240 -400h-800l300 500h500v-100z" />
+<glyph unicode="&#xe205;" d="M650 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM1000 850v150q41 0 70.5 -29.5t29.5 -70.5v-800 q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-1 0 -20 4l246 246l-326 326v324q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM412 250l-212 -212v162h-200v100h200v162z" />
+<glyph unicode="&#xe206;" d="M450 1100h100q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-300q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h50v50q0 21 14.5 35.5t35.5 14.5zM800 850v150q41 0 70.5 -29.5t29.5 -70.5v-500 h-200v-300h200q0 -36 -7 -57.5t-23.5 -30t-29.5 -10.5t-40 -2h-600q-41 0 -70.5 29.5t-29.5 70.5v800q0 41 29.5 70.5t70.5 29.5v-150q0 -62 44 -106t106 -44h300q62 0 106 44t44 106zM1212 250l-212 -212v162h-200v100h200v162z" />
+<glyph unicode="&#xe209;" d="M658 1197l637 -1104q23 -38 7 -65.5t-60 -27.5h-1276q-44 0 -60 27.5t7 65.5l637 1104q22 39 54 39t54 -39zM704 800h-208q-20 0 -32 -14.5t-8 -34.5l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5zM500 300v-100h200 v100h-200z" />
+<glyph unicode="&#xe210;" d="M425 1100h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM825 800h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM25 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5zM425 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 500h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5 v150q0 10 7.5 17.5t17.5 7.5zM25 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM425 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5 t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM825 200h250q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-250q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe211;" d="M700 1200h100v-200h-100v-100h350q62 0 86.5 -39.5t-3.5 -94.5l-66 -132q-41 -83 -81 -134h-772q-40 51 -81 134l-66 132q-28 55 -3.5 94.5t86.5 39.5h350v100h-100v200h100v100h200v-100zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-12l137 -100 h-950l138 100h-13q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe212;" d="M600 1300q40 0 68.5 -29.5t28.5 -70.5h-194q0 41 28.5 70.5t68.5 29.5zM443 1100h314q18 -37 18 -75q0 -8 -3 -25h328q41 0 44.5 -16.5t-30.5 -38.5l-175 -145h-678l-178 145q-34 22 -29 38.5t46 16.5h328q-3 17 -3 25q0 38 18 75zM250 700h700q21 0 35.5 -14.5 t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-150v-200l275 -200h-950l275 200v200h-150q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe213;" d="M600 1181q75 0 128 -53t53 -128t-53 -128t-128 -53t-128 53t-53 128t53 128t128 53zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13 l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe214;" d="M600 1300q47 0 92.5 -53.5t71 -123t25.5 -123.5q0 -78 -55.5 -133.5t-133.5 -55.5t-133.5 55.5t-55.5 133.5q0 62 34 143l144 -143l111 111l-163 163q34 26 63 26zM602 798h46q34 0 55.5 -28.5t21.5 -86.5q0 -76 39 -183h-324q39 107 39 183q0 58 21.5 86.5t56.5 28.5h45 zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe215;" d="M600 1200l300 -161v-139h-300q0 -57 18.5 -108t50 -91.5t63 -72t70 -67.5t57.5 -61h-530q-60 83 -90.5 177.5t-30.5 178.5t33 164.5t87.5 139.5t126 96.5t145.5 41.5v-98zM250 400h700q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-13l138 -100h-950l137 100 h-12q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5zM50 100h1100q21 0 35.5 -14.5t14.5 -35.5v-50h-1200v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe216;" d="M600 1300q41 0 70.5 -29.5t29.5 -70.5v-78q46 -26 73 -72t27 -100v-50h-400v50q0 54 27 100t73 72v78q0 41 29.5 70.5t70.5 29.5zM400 800h400q54 0 100 -27t72 -73h-172v-100h200v-100h-200v-100h200v-100h-200v-100h200q0 -83 -58.5 -141.5t-141.5 -58.5h-400 q-83 0 -141.5 58.5t-58.5 141.5v400q0 83 58.5 141.5t141.5 58.5z" />
+<glyph unicode="&#xe218;" d="M150 1100h900q21 0 35.5 -14.5t14.5 -35.5v-500q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v500q0 21 14.5 35.5t35.5 14.5zM125 400h950q10 0 17.5 -7.5t7.5 -17.5v-50q0 -10 -7.5 -17.5t-17.5 -7.5h-283l224 -224q13 -13 13 -31.5t-13 -32 t-31.5 -13.5t-31.5 13l-88 88h-524l-87 -88q-13 -13 -32 -13t-32 13.5t-13 32t13 31.5l224 224h-289q-10 0 -17.5 7.5t-7.5 17.5v50q0 10 7.5 17.5t17.5 7.5zM541 300l-100 -100h324l-100 100h-124z" />
+<glyph unicode="&#xe219;" d="M200 1100h800q83 0 141.5 -58.5t58.5 -141.5v-200h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100q0 41 -29.5 70.5t-70.5 29.5h-250q-41 0 -70.5 -29.5t-29.5 -70.5h-100v200q0 83 58.5 141.5t141.5 58.5zM100 600h1000q41 0 70.5 -29.5 t29.5 -70.5v-300h-1200v300q0 41 29.5 70.5t70.5 29.5zM300 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200zM1100 100v-50q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v50h200z" />
+<glyph unicode="&#xe221;" d="M480 1165l682 -683q31 -31 31 -75.5t-31 -75.5l-131 -131h-481l-517 518q-32 31 -32 75.5t32 75.5l295 296q31 31 75.5 31t76.5 -31zM108 794l342 -342l303 304l-341 341zM250 100h800q21 0 35.5 -14.5t14.5 -35.5v-50h-900v50q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe223;" d="M1057 647l-189 506q-8 19 -27.5 33t-40.5 14h-400q-21 0 -40.5 -14t-27.5 -33l-189 -506q-8 -19 1.5 -33t30.5 -14h625v-150q0 -21 14.5 -35.5t35.5 -14.5t35.5 14.5t14.5 35.5v150h125q21 0 30.5 14t1.5 33zM897 0h-595v50q0 21 14.5 35.5t35.5 14.5h50v50 q0 21 14.5 35.5t35.5 14.5h48v300h200v-300h47q21 0 35.5 -14.5t14.5 -35.5v-50h50q21 0 35.5 -14.5t14.5 -35.5v-50z" />
+<glyph unicode="&#xe224;" d="M900 800h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-375v591l-300 300v84q0 10 7.5 17.5t17.5 7.5h375v-400zM1200 900h-200v200zM400 600h300v-575q0 -10 -7.5 -17.5t-17.5 -7.5h-650q-10 0 -17.5 7.5t-7.5 17.5v950q0 10 7.5 17.5t17.5 7.5h375v-400zM700 700h-200v200z " />
+<glyph unicode="&#xe225;" d="M484 1095h195q75 0 146 -32.5t124 -86t89.5 -122.5t48.5 -142q18 -14 35 -20q31 -10 64.5 6.5t43.5 48.5q10 34 -15 71q-19 27 -9 43q5 8 12.5 11t19 -1t23.5 -16q41 -44 39 -105q-3 -63 -46 -106.5t-104 -43.5h-62q-7 -55 -35 -117t-56 -100l-39 -234q-3 -20 -20 -34.5 t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l12 70q-49 -14 -91 -14h-195q-24 0 -65 8l-11 -64q-3 -20 -20 -34.5t-38 -14.5h-100q-21 0 -33 14.5t-9 34.5l26 157q-84 74 -128 175l-159 53q-19 7 -33 26t-14 40v50q0 21 14.5 35.5t35.5 14.5h124q11 87 56 166l-111 95 q-16 14 -12.5 23.5t24.5 9.5h203q116 101 250 101zM675 1000h-250q-10 0 -17.5 -7.5t-7.5 -17.5v-50q0 -10 7.5 -17.5t17.5 -7.5h250q10 0 17.5 7.5t7.5 17.5v50q0 10 -7.5 17.5t-17.5 7.5z" />
+<glyph unicode="&#xe226;" d="M641 900l423 247q19 8 42 2.5t37 -21.5l32 -38q14 -15 12.5 -36t-17.5 -34l-139 -120h-390zM50 1100h106q67 0 103 -17t66 -71l102 -212h823q21 0 35.5 -14.5t14.5 -35.5v-50q0 -21 -14 -40t-33 -26l-737 -132q-23 -4 -40 6t-26 25q-42 67 -100 67h-300q-62 0 -106 44 t-44 106v200q0 62 44 106t106 44zM173 928h-80q-19 0 -28 -14t-9 -35v-56q0 -51 42 -51h134q16 0 21.5 8t5.5 24q0 11 -16 45t-27 51q-18 28 -43 28zM550 727q-32 0 -54.5 -22.5t-22.5 -54.5t22.5 -54.5t54.5 -22.5t54.5 22.5t22.5 54.5t-22.5 54.5t-54.5 22.5zM130 389 l152 130q18 19 34 24t31 -3.5t24.5 -17.5t25.5 -28q28 -35 50.5 -51t48.5 -13l63 5l48 -179q13 -61 -3.5 -97.5t-67.5 -79.5l-80 -69q-47 -40 -109 -35.5t-103 51.5l-130 151q-40 47 -35.5 109.5t51.5 102.5zM380 377l-102 -88q-31 -27 2 -65l37 -43q13 -15 27.5 -19.5 t31.5 6.5l61 53q19 16 14 49q-2 20 -12 56t-17 45q-11 12 -19 14t-23 -8z" />
+<glyph unicode="&#xe227;" d="M625 1200h150q10 0 17.5 -7.5t7.5 -17.5v-109q79 -33 131 -87.5t53 -128.5q1 -46 -15 -84.5t-39 -61t-46 -38t-39 -21.5l-17 -6q6 0 15 -1.5t35 -9t50 -17.5t53 -30t50 -45t35.5 -64t14.5 -84q0 -59 -11.5 -105.5t-28.5 -76.5t-44 -51t-49.5 -31.5t-54.5 -16t-49.5 -6.5 t-43.5 -1v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-100v-75q0 -10 -7.5 -17.5t-17.5 -7.5h-150q-10 0 -17.5 7.5t-7.5 17.5v75h-175q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5h75v600h-75q-10 0 -17.5 7.5t-7.5 17.5v150 q0 10 7.5 17.5t17.5 7.5h175v75q0 10 7.5 17.5t17.5 7.5h150q10 0 17.5 -7.5t7.5 -17.5v-75h100v75q0 10 7.5 17.5t17.5 7.5zM400 900v-200h263q28 0 48.5 10.5t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-263zM400 500v-200h363q28 0 48.5 10.5 t30 25t15 29t5.5 25.5l1 10q0 4 -0.5 11t-6 24t-15 30t-30 24t-48.5 11h-363z" />
+<glyph unicode="&#xe230;" d="M212 1198h780q86 0 147 -61t61 -147v-416q0 -51 -18 -142.5t-36 -157.5l-18 -66q-29 -87 -93.5 -146.5t-146.5 -59.5h-572q-82 0 -147 59t-93 147q-8 28 -20 73t-32 143.5t-20 149.5v416q0 86 61 147t147 61zM600 1045q-70 0 -132.5 -11.5t-105.5 -30.5t-78.5 -41.5 t-57 -45t-36 -41t-20.5 -30.5l-6 -12l156 -243h560l156 243q-2 5 -6 12.5t-20 29.5t-36.5 42t-57 44.5t-79 42t-105 29.5t-132.5 12zM762 703h-157l195 261z" />
+<glyph unicode="&#xe231;" d="M475 1300h150q103 0 189 -86t86 -189v-500q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
+<glyph unicode="&#xe232;" d="M475 1300h96q0 -150 89.5 -239.5t239.5 -89.5v-446q0 -41 -42 -83t-83 -42h-450q-41 0 -83 42t-42 83v500q0 103 86 189t189 86zM700 300v-225q0 -21 -27 -48t-48 -27h-150q-21 0 -48 27t-27 48v225h300z" />
+<glyph unicode="&#xe233;" d="M1294 767l-638 -283l-378 170l-78 -60v-224l100 -150v-199l-150 148l-150 -149v200l100 150v250q0 4 -0.5 10.5t0 9.5t1 8t3 8t6.5 6l47 40l-147 65l642 283zM1000 380l-350 -166l-350 166v147l350 -165l350 165v-147z" />
+<glyph unicode="&#xe234;" d="M250 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM650 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM1050 800q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
+<glyph unicode="&#xe235;" d="M550 1100q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 700q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44zM550 300q62 0 106 -44t44 -106t-44 -106t-106 -44t-106 44t-44 106t44 106t106 44z" />
+<glyph unicode="&#xe236;" d="M125 1100h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5zM125 700h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5 t17.5 7.5zM125 300h950q10 0 17.5 -7.5t7.5 -17.5v-150q0 -10 -7.5 -17.5t-17.5 -7.5h-950q-10 0 -17.5 7.5t-7.5 17.5v150q0 10 7.5 17.5t17.5 7.5z" />
+<glyph unicode="&#xe237;" d="M350 1200h500q162 0 256 -93.5t94 -256.5v-500q0 -165 -93.5 -257.5t-256.5 -92.5h-500q-165 0 -257.5 92.5t-92.5 257.5v500q0 165 92.5 257.5t257.5 92.5zM900 1000h-600q-41 0 -70.5 -29.5t-29.5 -70.5v-600q0 -41 29.5 -70.5t70.5 -29.5h600q41 0 70.5 29.5 t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5zM350 900h500q21 0 35.5 -14.5t14.5 -35.5v-300q0 -21 -14.5 -35.5t-35.5 -14.5h-500q-21 0 -35.5 14.5t-14.5 35.5v300q0 21 14.5 35.5t35.5 14.5zM400 800v-200h400v200h-400z" />
+<glyph unicode="&#xe238;" d="M150 1100h1000q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5t-35.5 -14.5h-50v-200h50q21 0 35.5 -14.5t14.5 -35.5t-14.5 -35.5 t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5h50v200h-50q-21 0 -35.5 14.5t-14.5 35.5t14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe239;" d="M650 1187q87 -67 118.5 -156t0 -178t-118.5 -155q-87 66 -118.5 155t0 178t118.5 156zM300 800q124 0 212 -88t88 -212q-124 0 -212 88t-88 212zM1000 800q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM300 500q124 0 212 -88t88 -212q-124 0 -212 88t-88 212z M1000 500q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM700 199v-144q0 -21 -14.5 -35.5t-35.5 -14.5t-35.5 14.5t-14.5 35.5v142q40 -4 43 -4q17 0 57 6z" />
+<glyph unicode="&#xe240;" d="M745 878l69 19q25 6 45 -12l298 -295q11 -11 15 -26.5t-2 -30.5q-5 -14 -18 -23.5t-28 -9.5h-8q1 0 1 -13q0 -29 -2 -56t-8.5 -62t-20 -63t-33 -53t-51 -39t-72.5 -14h-146q-184 0 -184 288q0 24 10 47q-20 4 -62 4t-63 -4q11 -24 11 -47q0 -288 -184 -288h-142 q-48 0 -84.5 21t-56 51t-32 71.5t-16 75t-3.5 68.5q0 13 2 13h-7q-15 0 -27.5 9.5t-18.5 23.5q-6 15 -2 30.5t15 25.5l298 296q20 18 46 11l76 -19q20 -5 30.5 -22.5t5.5 -37.5t-22.5 -31t-37.5 -5l-51 12l-182 -193h891l-182 193l-44 -12q-20 -5 -37.5 6t-22.5 31t6 37.5 t31 22.5z" />
+<glyph unicode="&#xe241;" d="M1200 900h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-200v-850q0 -22 25 -34.5t50 -13.5l25 -2v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v850h-200q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h1000v-300zM500 450h-25q0 15 -4 24.5t-9 14.5t-17 7.5t-20 3t-25 0.5h-100v-425q0 -11 12.5 -17.5t25.5 -7.5h12v-50h-200v50q50 0 50 25v425h-100q-17 0 -25 -0.5t-20 -3t-17 -7.5t-9 -14.5t-4 -24.5h-25v150h500v-150z" />
+<glyph unicode="&#xe242;" d="M1000 300v50q-25 0 -55 32q-14 14 -25 31t-16 27l-4 11l-289 747h-69l-300 -754q-18 -35 -39 -56q-9 -9 -24.5 -18.5t-26.5 -14.5l-11 -5v-50h273v50q-49 0 -78.5 21.5t-11.5 67.5l69 176h293l61 -166q13 -34 -3.5 -66.5t-55.5 -32.5v-50h312zM412 691l134 342l121 -342 h-255zM1100 150v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5z" />
+<glyph unicode="&#xe243;" d="M50 1200h1100q21 0 35.5 -14.5t14.5 -35.5v-1100q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-21 0 -35.5 14.5t-14.5 35.5v1100q0 21 14.5 35.5t35.5 14.5zM611 1118h-70q-13 0 -18 -12l-299 -753q-17 -32 -35 -51q-18 -18 -56 -34q-12 -5 -12 -18v-50q0 -8 5.5 -14t14.5 -6 h273q8 0 14 6t6 14v50q0 8 -6 14t-14 6q-55 0 -71 23q-10 14 0 39l63 163h266l57 -153q11 -31 -6 -55q-12 -17 -36 -17q-8 0 -14 -6t-6 -14v-50q0 -8 6 -14t14 -6h313q8 0 14 6t6 14v50q0 7 -5.5 13t-13.5 7q-17 0 -42 25q-25 27 -40 63h-1l-288 748q-5 12 -19 12zM639 611 h-197l103 264z" />
+<glyph unicode="&#xe244;" d="M1200 1100h-1200v100h1200v-100zM50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 1000h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM700 900v-300h300v300h-300z" />
+<glyph unicode="&#xe245;" d="M50 1200h400q21 0 35.5 -14.5t14.5 -35.5v-900q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v900q0 21 14.5 35.5t35.5 14.5zM650 700h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400 q0 21 14.5 35.5t35.5 14.5zM700 600v-300h300v300h-300zM1200 0h-1200v100h1200v-100z" />
+<glyph unicode="&#xe246;" d="M50 1000h400q21 0 35.5 -14.5t14.5 -35.5v-350h100v150q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-150h100v-100h-100v-150q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v150h-100v-350q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5v800q0 21 14.5 35.5t35.5 14.5zM700 700v-300h300v300h-300z" />
+<glyph unicode="&#xe247;" d="M100 0h-100v1200h100v-1200zM250 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM300 1000v-300h300v300h-300zM250 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe248;" d="M600 1100h150q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-100h450q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h350v100h-150q-21 0 -35.5 14.5 t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5h150v100h100v-100zM400 1000v-300h300v300h-300z" />
+<glyph unicode="&#xe249;" d="M1200 0h-100v1200h100v-1200zM550 1100h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM600 1000v-300h300v300h-300zM50 500h900q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-900q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5z" />
+<glyph unicode="&#xe250;" d="M865 565l-494 -494q-23 -23 -41 -23q-14 0 -22 13.5t-8 38.5v1000q0 25 8 38.5t22 13.5q18 0 41 -23l494 -494q14 -14 14 -35t-14 -35z" />
+<glyph unicode="&#xe251;" d="M335 635l494 494q29 29 50 20.5t21 -49.5v-1000q0 -41 -21 -49.5t-50 20.5l-494 494q-14 14 -14 35t14 35z" />
+<glyph unicode="&#xe252;" d="M100 900h1000q41 0 49.5 -21t-20.5 -50l-494 -494q-14 -14 -35 -14t-35 14l-494 494q-29 29 -20.5 50t49.5 21z" />
+<glyph unicode="&#xe253;" d="M635 865l494 -494q29 -29 20.5 -50t-49.5 -21h-1000q-41 0 -49.5 21t20.5 50l494 494q14 14 35 14t35 -14z" />
+<glyph unicode="&#xe254;" d="M700 741v-182l-692 -323v221l413 193l-413 193v221zM1200 0h-800v200h800v-200z" />
+<glyph unicode="&#xe255;" d="M1200 900h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300zM0 700h50q0 21 4 37t9.5 26.5t18 17.5t22 11t28.5 5.5t31 2t37 0.5h100v-550q0 -22 -25 -34.5t-50 -13.5l-25 -2v-100h400v100q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v550h100q25 0 37 -0.5t31 -2 t28.5 -5.5t22 -11t18 -17.5t9.5 -26.5t4 -37h50v300h-800v-300z" />
+<glyph unicode="&#xe256;" d="M800 700h-50q0 21 -4 37t-9.5 26.5t-18 17.5t-22 11t-28.5 5.5t-31 2t-37 0.5h-100v-550q0 -22 25 -34.5t50 -14.5l25 -1v-100h-400v100q4 0 11 0.5t24 3t30 7t24 15t11 24.5v550h-100q-25 0 -37 -0.5t-31 -2t-28.5 -5.5t-22 -11t-18 -17.5t-9.5 -26.5t-4 -37h-50v300 h800v-300zM1100 200h-200v-100h200v-100h-300v300h200v100h-200v100h300v-300z" />
+<glyph unicode="&#xe257;" d="M701 1098h160q16 0 21 -11t-7 -23l-464 -464l464 -464q12 -12 7 -23t-21 -11h-160q-13 0 -23 9l-471 471q-7 8 -7 18t7 18l471 471q10 9 23 9z" />
+<glyph unicode="&#xe258;" d="M339 1098h160q13 0 23 -9l471 -471q7 -8 7 -18t-7 -18l-471 -471q-10 -9 -23 -9h-160q-16 0 -21 11t7 23l464 464l-464 464q-12 12 -7 23t21 11z" />
+<glyph unicode="&#xe259;" d="M1087 882q11 -5 11 -21v-160q0 -13 -9 -23l-471 -471q-8 -7 -18 -7t-18 7l-471 471q-9 10 -9 23v160q0 16 11 21t23 -7l464 -464l464 464q12 12 23 7z" />
+<glyph unicode="&#xe260;" d="M618 993l471 -471q9 -10 9 -23v-160q0 -16 -11 -21t-23 7l-464 464l-464 -464q-12 -12 -23 -7t-11 21v160q0 13 9 23l471 471q8 7 18 7t18 -7z" />
+<glyph unicode="&#xf8ff;" d="M1000 1200q0 -124 -88 -212t-212 -88q0 124 88 212t212 88zM450 1000h100q21 0 40 -14t26 -33l79 -194q5 1 16 3q34 6 54 9.5t60 7t65.5 1t61 -10t56.5 -23t42.5 -42t29 -64t5 -92t-19.5 -121.5q-1 -7 -3 -19.5t-11 -50t-20.5 -73t-32.5 -81.5t-46.5 -83t-64 -70 t-82.5 -50q-13 -5 -42 -5t-65.5 2.5t-47.5 2.5q-14 0 -49.5 -3.5t-63 -3.5t-43.5 7q-57 25 -104.5 78.5t-75 111.5t-46.5 112t-26 90l-7 35q-15 63 -18 115t4.5 88.5t26 64t39.5 43.5t52 25.5t58.5 13t62.5 2t59.5 -4.5t55.5 -8l-147 192q-12 18 -5.5 30t27.5 12z" />
+<glyph unicode="&#x1f511;" d="M250 1200h600q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-150v-500l-255 -178q-19 -9 -32 -1t-13 29v650h-150q-21 0 -35.5 14.5t-14.5 35.5v400q0 21 14.5 35.5t35.5 14.5zM400 1100v-100h300v100h-300z" />
+<glyph unicode="&#x1f6aa;" d="M250 1200h750q39 0 69.5 -40.5t30.5 -84.5v-933l-700 -117v950l600 125h-700v-1000h-100v1025q0 23 15.5 49t34.5 26zM500 525v-100l100 20v100z" />
+</font>
+</defs></svg> \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf
new file mode 100644
index 000000000..1413fc609
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 000000000..9e612858f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff2 b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff2
new file mode 100644
index 000000000..64539b54c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff2
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html b/poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html
new file mode 100644
index 000000000..e843d8d85
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/html/layer_deps_modal.html
@@ -0,0 +1,21 @@
+<div id="dependencies-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <form id="dependencies-modal-form">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3><span id="title"></span> dependencies</h3>
+ </div>
+ <div class="modal-body">
+ <p id="body-text"> <strong id="layer-name"></strong> depends on some layers that are not added to your project. Select the ones you want to add:</p>
+ <ul class="list-unstyled" id="dependencies-list">
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-primary" type="submit">Add layers</button>
+ <button class="btn btn-link" type="reset" data-dismiss="modal">Cancel</button>
+ </div>
+ </form>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
diff --git a/poky/bitbake/lib/toaster/toastergui/static/img/logo.png b/poky/bitbake/lib/toaster/toastergui/static/img/logo.png
new file mode 100644
index 000000000..35ad733ed
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/img/logo.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png b/poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png
new file mode 100644
index 000000000..b46590793
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/img/toaster_bw.png
Binary files differ
diff --git a/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt
new file mode 100644
index 000000000..76927f581
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt
@@ -0,0 +1,278 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES. \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt
new file mode 100644
index 000000000..c2e824fb0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright (c) 2013 Ludo van den Boom, http://ludovandenboom.com
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md
new file mode 100644
index 000000000..ece7afb58
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md
@@ -0,0 +1,20 @@
+# jQuery treetable
+
+jQuery treetable is a plugin for jQuery, the 'Write Less, Do More, JavaScript
+Library'. With this plugin you can display a tree in an HTML table, e.g. a
+directory structure or a nested list. Why not use a list, you say? Because lists
+are great for displaying a tree, and tables are not. Oh wait, but this plugin
+uses tables, doesn't it? Yes. Why do I use a table to display a list? Because I
+need multiple columns to display additional data besides the tree.
+
+Download the latest release from the jQuery Plugin Registry or grab the source
+code from Github. Please report issues through Github issues. This plugin is
+released under both the MIT and the GPLv2 license by Ludo van den Boom.
+
+## Documentation and Examples
+
+See index.html for technical documentation and examples. The most recent version
+of this document is also available online at
+http://ludo.cubicphuse.nl/jquery-treetable. An AJAX enabled example built with
+Ruby on Rails can be found at
+https://github.com/ludo/jquery-treetable-ajax-example.
diff --git a/poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css b/poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css
new file mode 100644
index 000000000..5194b234d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css
@@ -0,0 +1,66 @@
+/*
+table.treetable {
+ border: 1px solid #888;
+ border-collapse: collapse;
+ font-size: .8em;
+ line-height: 1;
+ margin: .6em 0 1.8em 0;
+ width: 100%;
+}
+
+table.treetable caption {
+ font-size: .9em;
+ font-weight: bold;
+ margin-bottom: .2em;
+}
+
+table.treetable tbody tr td {
+ cursor: default;
+ padding: .3em 1em;
+}
+
+table.treetable span {
+ background-position: center left;
+ background-repeat: no-repeat;
+ padding: .2em 0 .2em 1.5em;
+}
+*/
+
+table.treetable span.file {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAADoSURBVBgZBcExblNBGAbA2ceegTRBuIKOgiihSZNTcC5LUHAihNJR0kGKCDcYJY6D3/77MdOinTvzAgCw8ysThIvn/VojIyMjIyPP+bS1sUQIV2s95pBDDvmbP/mdkft83tpYguZq5Jh/OeaYh+yzy8hTHvNlaxNNczm+la9OTlar1UdA/+C2A4trRCnD3jS8BB1obq2Gk6GU6QbQAS4BUaYSQAf4bhhKKTFdAzrAOwAxEUAH+KEM01SY3gM6wBsEAQB0gJ+maZoC3gI6iPYaAIBJsiRmHU0AALOeFC3aK2cWAACUXe7+AwO0lc9eTHYTAAAAAElFTkSuQmCC);
+}
+
+table.treetable span.folder {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGrSURBVDjLxZO7ihRBFIa/6u0ZW7GHBUV0UQQTZzd3QdhMQxOfwMRXEANBMNQX0MzAzFAwEzHwARbNFDdwEd31Mj3X7a6uOr9BtzNjYjKBJ6nicP7v3KqcJFaxhBVtZUAK8OHlld2st7Xl3DJPVONP+zEUV4HqL5UDYHr5xvuQAjgl/Qs7TzvOOVAjxjlC+ePSwe6DfbVegLVuT4r14eTr6zvA8xSAoBLzx6pvj4l+DZIezuVkG9fY2H7YRQIMZIBwycmzH1/s3F8AapfIPNF3kQk7+kw9PWBy+IZOdg5Ug3mkAATy/t0usovzGeCUWTjCz0B+Sj0ekfdvkZ3abBv+U4GaCtJ1iEm6ANQJ6fEzrG/engcKw/wXQvEKxSEKQxRGKE7Izt+DSiwBJMUSm71rguMYhQKrBygOIRStf4TiFFRBvbRGKiQLWP29yRSHKBTtfdBmHs0BUpgvtgF4yRFR+NUKi0XZcYjCeCG2smkzLAHkbRBmP0/Uk26O5YnUActBp1GsAI+S5nRJJJal5K1aAMrq0d6Tm9uI6zjyf75dAe6tx/SsWeD//o2/Ab6IH3/h25pOAAAAAElFTkSuQmCC);
+}
+
+table.treetable tr.collapsed span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHlJREFUeNrcU1sNgDAQ6wgmcAM2MICGGlg1gJnNzWQcvwQGy1j4oUl/7tH0mpwzM7SgQyO+EZAUWh2MkkzSWhJwuRAlHYsJwEwyvs1gABDuzqoJcTw5qxaIJN0bgQRgIjnlmn1heSO5PE6Y2YXe+5Cr5+h++gs12AcAS6FS+7YOsj4AAAAASUVORK5CYII=);
+}
+
+table.treetable tr.expanded span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHFJREFUeNpi/P//PwMlgImBQsA44C6gvhfa29v3MzAwOODRc6CystIRbxi0t7fjDJjKykpGYrwwi1hxnLHQ3t7+jIGBQRJJ6HllZaUUKYEYRYBPOB0gBShKwKGA////48VtbW3/8clTnBIH3gCKkzJgAGvBX0dDm0sCAAAAAElFTkSuQmCC);
+}
+
+
+
+table.treetable tr.collapsed.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.selected span.indenter a {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
+
+table.treetable tr.accept {
+ background-color: #a3bce4;
+ color: #fff
+}
+
+table.treetable tr.collapsed.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFpJREFUeNpi/P//PwMlgHHADWD4//8/NtyAQxwD45KAAQdKDfj//////fgMIsYAZIMw1DKREFwODAwM/4kNRKq64AADA4MjFDOQ6gKyY4HodMA49PMCxQYABgAVYHsjyZ1x7QAAAABJRU5ErkJggg==);
+}
+
+table.treetable tr.expanded.accept td span.indenter a {
+ background-image: url(data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAFtJREFUeNpi/P//PwMlgImBQsA44C6giQENDAwM//HgBmLCAF/AMBLjBUeixf///48L7/+PCvZjU4fPAAc0AxywqcMXCwegGJ1NckL6jx5wpKYDxqGXEkkCgAEAmrqBIejdgngAAAAASUVORK5CYII=);
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc b/poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc
new file mode 100644
index 000000000..b02f3efa1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/.jshintrc
@@ -0,0 +1,11 @@
+{
+ "curly" : false,
+ "predef" : [ "$","libtoaster", "prettyPrint" ],
+ "eqnull": true,
+ "plusplus" : false,
+ "browser" : true,
+ "jquery" : true,
+ "devel" : true,
+ "unused" : true,
+ "maxerr" : 60
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.js b/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.js
new file mode 100644
index 000000000..d47d640fe
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.js
@@ -0,0 +1,2363 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under the MIT license
+ */
+
+if (typeof jQuery === 'undefined') {
+ throw new Error('Bootstrap\'s JavaScript requires jQuery')
+}
+
++function ($) {
+ 'use strict';
+ var version = $.fn.jquery.split(' ')[0].split('.')
+ if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
+ throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
+ }
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: transition.js v3.3.6
+ * http://getbootstrap.com/javascript/#transitions
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
+ // ============================================================
+
+ function transitionEnd() {
+ var el = document.createElement('bootstrap')
+
+ var transEndEventNames = {
+ WebkitTransition : 'webkitTransitionEnd',
+ MozTransition : 'transitionend',
+ OTransition : 'oTransitionEnd otransitionend',
+ transition : 'transitionend'
+ }
+
+ for (var name in transEndEventNames) {
+ if (el.style[name] !== undefined) {
+ return { end: transEndEventNames[name] }
+ }
+ }
+
+ return false // explicit for ie8 ( ._.)
+ }
+
+ // http://blog.alexmaccaw.com/css-transitions
+ $.fn.emulateTransitionEnd = function (duration) {
+ var called = false
+ var $el = this
+ $(this).one('bsTransitionEnd', function () { called = true })
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
+ setTimeout(callback, duration)
+ return this
+ }
+
+ $(function () {
+ $.support.transition = transitionEnd()
+
+ if (!$.support.transition) return
+
+ $.event.special.bsTransitionEnd = {
+ bindType: $.support.transition.end,
+ delegateType: $.support.transition.end,
+ handle: function (e) {
+ if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
+ }
+ }
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: alert.js v3.3.6
+ * http://getbootstrap.com/javascript/#alerts
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // ALERT CLASS DEFINITION
+ // ======================
+
+ var dismiss = '[data-dismiss="alert"]'
+ var Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.VERSION = '3.3.6'
+
+ Alert.TRANSITION_DURATION = 150
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ var selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ var $parent = $(selector)
+
+ if (e) e.preventDefault()
+
+ if (!$parent.length) {
+ $parent = $this.closest('.alert')
+ }
+
+ $parent.trigger(e = $.Event('close.bs.alert'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ // detach from parent, fire event then clean up data
+ $parent.detach().trigger('closed.bs.alert').remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent
+ .one('bsTransitionEnd', removeElement)
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
+ removeElement()
+ }
+
+
+ // ALERT PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.alert')
+
+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ var old = $.fn.alert
+
+ $.fn.alert = Plugin
+ $.fn.alert.Constructor = Alert
+
+
+ // ALERT NO CONFLICT
+ // =================
+
+ $.fn.alert.noConflict = function () {
+ $.fn.alert = old
+ return this
+ }
+
+
+ // ALERT DATA-API
+ // ==============
+
+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: button.js v3.3.6
+ * http://getbootstrap.com/javascript/#buttons
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // BUTTON PUBLIC CLASS DEFINITION
+ // ==============================
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, Button.DEFAULTS, options)
+ this.isLoading = false
+ }
+
+ Button.VERSION = '3.3.6'
+
+ Button.DEFAULTS = {
+ loadingText: 'loading...'
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ var $el = this.$element
+ var val = $el.is('input') ? 'val' : 'html'
+ var data = $el.data()
+
+ state += 'Text'
+
+ if (data.resetText == null) $el.data('resetText', $el[val]())
+
+ // push to event loop to allow forms to submit
+ setTimeout($.proxy(function () {
+ $el[val](data[state] == null ? this.options[state] : data[state])
+
+ if (state == 'loadingText') {
+ this.isLoading = true
+ $el.addClass(d).attr(d, d)
+ } else if (this.isLoading) {
+ this.isLoading = false
+ $el.removeClass(d).removeAttr(d)
+ }
+ }, this), 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var changed = true
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
+
+ if ($parent.length) {
+ var $input = this.$element.find('input')
+ if ($input.prop('type') == 'radio') {
+ if ($input.prop('checked')) changed = false
+ $parent.find('.active').removeClass('active')
+ this.$element.addClass('active')
+ } else if ($input.prop('type') == 'checkbox') {
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
+ this.$element.toggleClass('active')
+ }
+ $input.prop('checked', this.$element.hasClass('active'))
+ if (changed) $input.trigger('change')
+ } else {
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
+ this.$element.toggleClass('active')
+ }
+ }
+
+
+ // BUTTON PLUGIN DEFINITION
+ // ========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.button')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
+
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ var old = $.fn.button
+
+ $.fn.button = Plugin
+ $.fn.button.Constructor = Button
+
+
+ // BUTTON NO CONFLICT
+ // ==================
+
+ $.fn.button.noConflict = function () {
+ $.fn.button = old
+ return this
+ }
+
+
+ // BUTTON DATA-API
+ // ===============
+
+ $(document)
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ Plugin.call($btn, 'toggle')
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
+ })
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: carousel.js v3.3.6
+ * http://getbootstrap.com/javascript/#carousel
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // CAROUSEL CLASS DEFINITION
+ // =========================
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.$indicators = this.$element.find('.carousel-indicators')
+ this.options = options
+ this.paused = null
+ this.sliding = null
+ this.interval = null
+ this.$active = null
+ this.$items = null
+
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
+
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
+ }
+
+ Carousel.VERSION = '3.3.6'
+
+ Carousel.TRANSITION_DURATION = 600
+
+ Carousel.DEFAULTS = {
+ interval: 5000,
+ pause: 'hover',
+ wrap: true,
+ keyboard: true
+ }
+
+ Carousel.prototype.keydown = function (e) {
+ if (/input|textarea/i.test(e.target.tagName)) return
+ switch (e.which) {
+ case 37: this.prev(); break
+ case 39: this.next(); break
+ default: return
+ }
+
+ e.preventDefault()
+ }
+
+ Carousel.prototype.cycle = function (e) {
+ e || (this.paused = false)
+
+ this.interval && clearInterval(this.interval)
+
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+
+ return this
+ }
+
+ Carousel.prototype.getItemIndex = function (item) {
+ this.$items = item.parent().children('.item')
+ return this.$items.index(item || this.$active)
+ }
+
+ Carousel.prototype.getItemForDirection = function (direction, active) {
+ var activeIndex = this.getItemIndex(active)
+ var willWrap = (direction == 'prev' && activeIndex === 0)
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
+ if (willWrap && !this.options.wrap) return active
+ var delta = direction == 'prev' ? -1 : 1
+ var itemIndex = (activeIndex + delta) % this.$items.length
+ return this.$items.eq(itemIndex)
+ }
+
+ Carousel.prototype.to = function (pos) {
+ var that = this
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
+
+ if (pos > (this.$items.length - 1) || pos < 0) return
+
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
+ if (activeIndex == pos) return this.pause().cycle()
+
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
+ }
+
+ Carousel.prototype.pause = function (e) {
+ e || (this.paused = true)
+
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
+ this.$element.trigger($.support.transition.end)
+ this.cycle(true)
+ }
+
+ this.interval = clearInterval(this.interval)
+
+ return this
+ }
+
+ Carousel.prototype.next = function () {
+ if (this.sliding) return
+ return this.slide('next')
+ }
+
+ Carousel.prototype.prev = function () {
+ if (this.sliding) return
+ return this.slide('prev')
+ }
+
+ Carousel.prototype.slide = function (type, next) {
+ var $active = this.$element.find('.item.active')
+ var $next = next || this.getItemForDirection(type, $active)
+ var isCycling = this.interval
+ var direction = type == 'next' ? 'left' : 'right'
+ var that = this
+
+ if ($next.hasClass('active')) return (this.sliding = false)
+
+ var relatedTarget = $next[0]
+ var slideEvent = $.Event('slide.bs.carousel', {
+ relatedTarget: relatedTarget,
+ direction: direction
+ })
+ this.$element.trigger(slideEvent)
+ if (slideEvent.isDefaultPrevented()) return
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ if (this.$indicators.length) {
+ this.$indicators.find('.active').removeClass('active')
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
+ $nextIndicator && $nextIndicator.addClass('active')
+ }
+
+ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ $active
+ .one('bsTransitionEnd', function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () {
+ that.$element.trigger(slidEvent)
+ }, 0)
+ })
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
+ } else {
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger(slidEvent)
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
+
+
+ // CAROUSEL PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.carousel')
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
+ var action = typeof option == 'string' ? option : options.slide
+
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (action) data[action]()
+ else if (options.interval) data.pause().cycle()
+ })
+ }
+
+ var old = $.fn.carousel
+
+ $.fn.carousel = Plugin
+ $.fn.carousel.Constructor = Carousel
+
+
+ // CAROUSEL NO CONFLICT
+ // ====================
+
+ $.fn.carousel.noConflict = function () {
+ $.fn.carousel = old
+ return this
+ }
+
+
+ // CAROUSEL DATA-API
+ // =================
+
+ var clickHandler = function (e) {
+ var href
+ var $this = $(this)
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
+ if (!$target.hasClass('carousel')) return
+ var options = $.extend({}, $target.data(), $this.data())
+ var slideIndex = $this.attr('data-slide-to')
+ if (slideIndex) options.interval = false
+
+ Plugin.call($target, options)
+
+ if (slideIndex) {
+ $target.data('bs.carousel').to(slideIndex)
+ }
+
+ e.preventDefault()
+ }
+
+ $(document)
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
+
+ $(window).on('load', function () {
+ $('[data-ride="carousel"]').each(function () {
+ var $carousel = $(this)
+ Plugin.call($carousel, $carousel.data())
+ })
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: collapse.js v3.3.6
+ * http://getbootstrap.com/javascript/#collapse
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // COLLAPSE PUBLIC CLASS DEFINITION
+ // ================================
+
+ var Collapse = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
+ this.transitioning = null
+
+ if (this.options.parent) {
+ this.$parent = this.getParent()
+ } else {
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
+ }
+
+ if (this.options.toggle) this.toggle()
+ }
+
+ Collapse.VERSION = '3.3.6'
+
+ Collapse.TRANSITION_DURATION = 350
+
+ Collapse.DEFAULTS = {
+ toggle: true
+ }
+
+ Collapse.prototype.dimension = function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
+
+ Collapse.prototype.show = function () {
+ if (this.transitioning || this.$element.hasClass('in')) return
+
+ var activesData
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
+
+ if (actives && actives.length) {
+ activesData = actives.data('bs.collapse')
+ if (activesData && activesData.transitioning) return
+ }
+
+ var startEvent = $.Event('show.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
+ if (actives && actives.length) {
+ Plugin.call(actives, 'hide')
+ activesData || actives.data('bs.collapse', null)
+ }
+
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ .addClass('collapsing')[dimension](0)
+ .attr('aria-expanded', true)
+
+ this.$trigger
+ .removeClass('collapsed')
+ .attr('aria-expanded', true)
+
+ this.transitioning = 1
+
+ var complete = function () {
+ this.$element
+ .removeClass('collapsing')
+ .addClass('collapse in')[dimension]('')
+ this.transitioning = 0
+ this.$element
+ .trigger('shown.bs.collapse')
+ }
+
+ if (!$.support.transition) return complete.call(this)
+
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
+
+ this.$element
+ .one('bsTransitionEnd', $.proxy(complete, this))
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
+ }
+
+ Collapse.prototype.hide = function () {
+ if (this.transitioning || !this.$element.hasClass('in')) return
+
+ var startEvent = $.Event('hide.bs.collapse')
+ this.$element.trigger(startEvent)
+ if (startEvent.isDefaultPrevented()) return
+
+ var dimension = this.dimension()
+
+ this.$element[dimension](this.$element[dimension]())[0].offsetHeight
+
+ this.$element
+ .addClass('collapsing')
+ .removeClass('collapse in')
+ .attr('aria-expanded', false)
+
+ this.$trigger
+ .addClass('collapsed')
+ .attr('aria-expanded', false)
+
+ this.transitioning = 1
+
+ var complete = function () {
+ this.transitioning = 0
+ this.$element
+ .removeClass('collapsing')
+ .addClass('collapse')
+ .trigger('hidden.bs.collapse')
+ }
+
+ if (!$.support.transition) return complete.call(this)
+
+ this.$element
+ [dimension](0)
+ .one('bsTransitionEnd', $.proxy(complete, this))
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
+ }
+
+ Collapse.prototype.toggle = function () {
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
+ }
+
+ Collapse.prototype.getParent = function () {
+ return $(this.options.parent)
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
+ .each($.proxy(function (i, element) {
+ var $element = $(element)
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
+ }, this))
+ .end()
+ }
+
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
+ var isOpen = $element.hasClass('in')
+
+ $element.attr('aria-expanded', isOpen)
+ $trigger
+ .toggleClass('collapsed', !isOpen)
+ .attr('aria-expanded', isOpen)
+ }
+
+ function getTargetFromTrigger($trigger) {
+ var href
+ var target = $trigger.attr('data-target')
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
+
+ return $(target)
+ }
+
+
+ // COLLAPSE PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.collapse')
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.collapse
+
+ $.fn.collapse = Plugin
+ $.fn.collapse.Constructor = Collapse
+
+
+ // COLLAPSE NO CONFLICT
+ // ====================
+
+ $.fn.collapse.noConflict = function () {
+ $.fn.collapse = old
+ return this
+ }
+
+
+ // COLLAPSE DATA-API
+ // =================
+
+ $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
+ var $this = $(this)
+
+ if (!$this.attr('data-target')) e.preventDefault()
+
+ var $target = getTargetFromTrigger($this)
+ var data = $target.data('bs.collapse')
+ var option = data ? 'toggle' : $this.data()
+
+ Plugin.call($target, option)
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: dropdown.js v3.3.6
+ * http://getbootstrap.com/javascript/#dropdowns
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // DROPDOWN CLASS DEFINITION
+ // =========================
+
+ var backdrop = '.dropdown-backdrop'
+ var toggle = '[data-toggle="dropdown"]'
+ var Dropdown = function (element) {
+ $(element).on('click.bs.dropdown', this.toggle)
+ }
+
+ Dropdown.VERSION = '3.3.6'
+
+ function getParent($this) {
+ var selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ var $parent = selector && $(selector)
+
+ return $parent && $parent.length ? $parent : $this.parent()
+ }
+
+ function clearMenus(e) {
+ if (e && e.which === 3) return
+ $(backdrop).remove()
+ $(toggle).each(function () {
+ var $this = $(this)
+ var $parent = getParent($this)
+ var relatedTarget = { relatedTarget: this }
+
+ if (!$parent.hasClass('open')) return
+
+ if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
+
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this.attr('aria-expanded', 'false')
+ $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
+ })
+ }
+
+ Dropdown.prototype.toggle = function (e) {
+ var $this = $(this)
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) {
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+ // if mobile we use a backdrop because click events don't delegate
+ $(document.createElement('div'))
+ .addClass('dropdown-backdrop')
+ .insertAfter($(this))
+ .on('click', clearMenus)
+ }
+
+ var relatedTarget = { relatedTarget: this }
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
+
+ if (e.isDefaultPrevented()) return
+
+ $this
+ .trigger('focus')
+ .attr('aria-expanded', 'true')
+
+ $parent
+ .toggleClass('open')
+ .trigger($.Event('shown.bs.dropdown', relatedTarget))
+ }
+
+ return false
+ }
+
+ Dropdown.prototype.keydown = function (e) {
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
+
+ var $this = $(this)
+
+ e.preventDefault()
+ e.stopPropagation()
+
+ if ($this.is('.disabled, :disabled')) return
+
+ var $parent = getParent($this)
+ var isActive = $parent.hasClass('open')
+
+ if (!isActive && e.which != 27 || isActive && e.which == 27) {
+ if (e.which == 27) $parent.find(toggle).trigger('focus')
+ return $this.trigger('click')
+ }
+
+ var desc = ' li:not(.disabled):visible a'
+ var $items = $parent.find('.dropdown-menu' + desc)
+
+ if (!$items.length) return
+
+ var index = $items.index(e.target)
+
+ if (e.which == 38 && index > 0) index-- // up
+ if (e.which == 40 && index < $items.length - 1) index++ // down
+ if (!~index) index = 0
+
+ $items.eq(index).trigger('focus')
+ }
+
+
+ // DROPDOWN PLUGIN DEFINITION
+ // ==========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.dropdown')
+
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ var old = $.fn.dropdown
+
+ $.fn.dropdown = Plugin
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ // DROPDOWN NO CONFLICT
+ // ====================
+
+ $.fn.dropdown.noConflict = function () {
+ $.fn.dropdown = old
+ return this
+ }
+
+
+ // APPLY TO STANDARD DROPDOWN ELEMENTS
+ // ===================================
+
+ $(document)
+ .on('click.bs.dropdown.data-api', clearMenus)
+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
+ .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: modal.js v3.3.6
+ * http://getbootstrap.com/javascript/#modals
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // MODAL CLASS DEFINITION
+ // ======================
+
+ var Modal = function (element, options) {
+ this.options = options
+ this.$body = $(document.body)
+ this.$element = $(element)
+ this.$dialog = this.$element.find('.modal-dialog')
+ this.$backdrop = null
+ this.isShown = null
+ this.originalBodyPad = null
+ this.scrollbarWidth = 0
+ this.ignoreBackdropClick = false
+
+ if (this.options.remote) {
+ this.$element
+ .find('.modal-content')
+ .load(this.options.remote, $.proxy(function () {
+ this.$element.trigger('loaded.bs.modal')
+ }, this))
+ }
+ }
+
+ Modal.VERSION = '3.3.6'
+
+ Modal.TRANSITION_DURATION = 300
+ Modal.BACKDROP_TRANSITION_DURATION = 150
+
+ Modal.DEFAULTS = {
+ backdrop: true,
+ keyboard: true,
+ show: true
+ }
+
+ Modal.prototype.toggle = function (_relatedTarget) {
+ return this.isShown ? this.hide() : this.show(_relatedTarget)
+ }
+
+ Modal.prototype.show = function (_relatedTarget) {
+ var that = this
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = true
+
+ this.checkScrollbar()
+ this.setScrollbar()
+ this.$body.addClass('modal-open')
+
+ this.escape()
+ this.resize()
+
+ this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
+
+ this.$dialog.on('mousedown.dismiss.bs.modal', function () {
+ that.$element.one('mouseup.dismiss.bs.modal', function (e) {
+ if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
+ })
+ })
+
+ this.backdrop(function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(that.$body) // don't move modals dom position
+ }
+
+ that.$element
+ .show()
+ .scrollTop(0)
+
+ that.adjustDialog()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element.addClass('in')
+
+ that.enforceFocus()
+
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
+
+ transition ?
+ that.$dialog // wait for modal to slide in
+ .one('bsTransitionEnd', function () {
+ that.$element.trigger('focus').trigger(e)
+ })
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
+ that.$element.trigger('focus').trigger(e)
+ })
+ }
+
+ Modal.prototype.hide = function (e) {
+ if (e) e.preventDefault()
+
+ e = $.Event('hide.bs.modal')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = false
+
+ this.escape()
+ this.resize()
+
+ $(document).off('focusin.bs.modal')
+
+ this.$element
+ .removeClass('in')
+ .off('click.dismiss.bs.modal')
+ .off('mouseup.dismiss.bs.modal')
+
+ this.$dialog.off('mousedown.dismiss.bs.modal')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ this.$element
+ .one('bsTransitionEnd', $.proxy(this.hideModal, this))
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
+ this.hideModal()
+ }
+
+ Modal.prototype.enforceFocus = function () {
+ $(document)
+ .off('focusin.bs.modal') // guard against infinite focus loop
+ .on('focusin.bs.modal', $.proxy(function (e) {
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
+ this.$element.trigger('focus')
+ }
+ }, this))
+ }
+
+ Modal.prototype.escape = function () {
+ if (this.isShown && this.options.keyboard) {
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
+ e.which == 27 && this.hide()
+ }, this))
+ } else if (!this.isShown) {
+ this.$element.off('keydown.dismiss.bs.modal')
+ }
+ }
+
+ Modal.prototype.resize = function () {
+ if (this.isShown) {
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
+ } else {
+ $(window).off('resize.bs.modal')
+ }
+ }
+
+ Modal.prototype.hideModal = function () {
+ var that = this
+ this.$element.hide()
+ this.backdrop(function () {
+ that.$body.removeClass('modal-open')
+ that.resetAdjustments()
+ that.resetScrollbar()
+ that.$element.trigger('hidden.bs.modal')
+ })
+ }
+
+ Modal.prototype.removeBackdrop = function () {
+ this.$backdrop && this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ Modal.prototype.backdrop = function (callback) {
+ var that = this
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $(document.createElement('div'))
+ .addClass('modal-backdrop ' + animate)
+ .appendTo(this.$body)
+
+ this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
+ if (this.ignoreBackdropClick) {
+ this.ignoreBackdropClick = false
+ return
+ }
+ if (e.target !== e.currentTarget) return
+ this.options.backdrop == 'static'
+ ? this.$element[0].focus()
+ : this.hide()
+ }, this))
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ if (!callback) return
+
+ doAnimate ?
+ this.$backdrop
+ .one('bsTransitionEnd', callback)
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ var callbackRemove = function () {
+ that.removeBackdrop()
+ callback && callback()
+ }
+ $.support.transition && this.$element.hasClass('fade') ?
+ this.$backdrop
+ .one('bsTransitionEnd', callbackRemove)
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
+ callbackRemove()
+
+ } else if (callback) {
+ callback()
+ }
+ }
+
+ // these following methods are used to handle overflowing modals
+
+ Modal.prototype.handleUpdate = function () {
+ this.adjustDialog()
+ }
+
+ Modal.prototype.adjustDialog = function () {
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
+
+ this.$element.css({
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
+ })
+ }
+
+ Modal.prototype.resetAdjustments = function () {
+ this.$element.css({
+ paddingLeft: '',
+ paddingRight: ''
+ })
+ }
+
+ Modal.prototype.checkScrollbar = function () {
+ var fullWindowWidth = window.innerWidth
+ if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
+ var documentElementRect = document.documentElement.getBoundingClientRect()
+ fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
+ }
+ this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
+ this.scrollbarWidth = this.measureScrollbar()
+ }
+
+ Modal.prototype.setScrollbar = function () {
+ var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
+ this.originalBodyPad = document.body.style.paddingRight || ''
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
+ }
+
+ Modal.prototype.resetScrollbar = function () {
+ this.$body.css('padding-right', this.originalBodyPad)
+ }
+
+ Modal.prototype.measureScrollbar = function () { // thx walsh
+ var scrollDiv = document.createElement('div')
+ scrollDiv.className = 'modal-scrollbar-measure'
+ this.$body.append(scrollDiv)
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
+ this.$body[0].removeChild(scrollDiv)
+ return scrollbarWidth
+ }
+
+
+ // MODAL PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option, _relatedTarget) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.modal')
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option](_relatedTarget)
+ else if (options.show) data.show(_relatedTarget)
+ })
+ }
+
+ var old = $.fn.modal
+
+ $.fn.modal = Plugin
+ $.fn.modal.Constructor = Modal
+
+
+ // MODAL NO CONFLICT
+ // =================
+
+ $.fn.modal.noConflict = function () {
+ $.fn.modal = old
+ return this
+ }
+
+
+ // MODAL DATA-API
+ // ==============
+
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
+ var $this = $(this)
+ var href = $this.attr('href')
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
+ var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
+
+ if ($this.is('a')) e.preventDefault()
+
+ $target.one('show.bs.modal', function (showEvent) {
+ if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
+ $target.one('hidden.bs.modal', function () {
+ $this.is(':visible') && $this.trigger('focus')
+ })
+ })
+ Plugin.call($target, option, this)
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tooltip.js v3.3.6
+ * http://getbootstrap.com/javascript/#tooltip
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // TOOLTIP PUBLIC CLASS DEFINITION
+ // ===============================
+
+ var Tooltip = function (element, options) {
+ this.type = null
+ this.options = null
+ this.enabled = null
+ this.timeout = null
+ this.hoverState = null
+ this.$element = null
+ this.inState = null
+
+ this.init('tooltip', element, options)
+ }
+
+ Tooltip.VERSION = '3.3.6'
+
+ Tooltip.TRANSITION_DURATION = 150
+
+ Tooltip.DEFAULTS = {
+ animation: true,
+ placement: 'top',
+ selector: false,
+ template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
+ trigger: 'hover focus',
+ title: '',
+ delay: 0,
+ html: false,
+ container: false,
+ viewport: {
+ selector: 'body',
+ padding: 0
+ }
+ }
+
+ Tooltip.prototype.init = function (type, element, options) {
+ this.enabled = true
+ this.type = type
+ this.$element = $(element)
+ this.options = this.getOptions(options)
+ this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
+ this.inState = { click: false, hover: false, focus: false }
+
+ if (this.$element[0] instanceof document.constructor && !this.options.selector) {
+ throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
+ }
+
+ var triggers = this.options.trigger.split(' ')
+
+ for (var i = triggers.length; i--;) {
+ var trigger = triggers[i]
+
+ if (trigger == 'click') {
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+ } else if (trigger != 'manual') {
+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
+
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
+ }
+ }
+
+ this.options.selector ?
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+ this.fixTitle()
+ }
+
+ Tooltip.prototype.getDefaults = function () {
+ return Tooltip.DEFAULTS
+ }
+
+ Tooltip.prototype.getOptions = function (options) {
+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
+
+ if (options.delay && typeof options.delay == 'number') {
+ options.delay = {
+ show: options.delay,
+ hide: options.delay
+ }
+ }
+
+ return options
+ }
+
+ Tooltip.prototype.getDelegateOptions = function () {
+ var options = {}
+ var defaults = this.getDefaults()
+
+ this._options && $.each(this._options, function (key, value) {
+ if (defaults[key] != value) options[key] = value
+ })
+
+ return options
+ }
+
+ Tooltip.prototype.enter = function (obj) {
+ var self = obj instanceof this.constructor ?
+ obj : $(obj.currentTarget).data('bs.' + this.type)
+
+ if (!self) {
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+ $(obj.currentTarget).data('bs.' + this.type, self)
+ }
+
+ if (obj instanceof $.Event) {
+ self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
+ }
+
+ if (self.tip().hasClass('in') || self.hoverState == 'in') {
+ self.hoverState = 'in'
+ return
+ }
+
+ clearTimeout(self.timeout)
+
+ self.hoverState = 'in'
+
+ if (!self.options.delay || !self.options.delay.show) return self.show()
+
+ self.timeout = setTimeout(function () {
+ if (self.hoverState == 'in') self.show()
+ }, self.options.delay.show)
+ }
+
+ Tooltip.prototype.isInStateTrue = function () {
+ for (var key in this.inState) {
+ if (this.inState[key]) return true
+ }
+
+ return false
+ }
+
+ Tooltip.prototype.leave = function (obj) {
+ var self = obj instanceof this.constructor ?
+ obj : $(obj.currentTarget).data('bs.' + this.type)
+
+ if (!self) {
+ self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+ $(obj.currentTarget).data('bs.' + this.type, self)
+ }
+
+ if (obj instanceof $.Event) {
+ self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
+ }
+
+ if (self.isInStateTrue()) return
+
+ clearTimeout(self.timeout)
+
+ self.hoverState = 'out'
+
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ self.timeout = setTimeout(function () {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
+ }
+
+ Tooltip.prototype.show = function () {
+ var e = $.Event('show.bs.' + this.type)
+
+ if (this.hasContent() && this.enabled) {
+ this.$element.trigger(e)
+
+ var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
+ if (e.isDefaultPrevented() || !inDom) return
+ var that = this
+
+ var $tip = this.tip()
+
+ var tipId = this.getUID(this.type)
+
+ this.setContent()
+ $tip.attr('id', tipId)
+ this.$element.attr('aria-describedby', tipId)
+
+ if (this.options.animation) $tip.addClass('fade')
+
+ var placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement
+
+ var autoToken = /\s?auto?\s?/i
+ var autoPlace = autoToken.test(placement)
+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
+
+ $tip
+ .detach()
+ .css({ top: 0, left: 0, display: 'block' })
+ .addClass(placement)
+ .data('bs.' + this.type, this)
+
+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
+ this.$element.trigger('inserted.bs.' + this.type)
+
+ var pos = this.getPosition()
+ var actualWidth = $tip[0].offsetWidth
+ var actualHeight = $tip[0].offsetHeight
+
+ if (autoPlace) {
+ var orgPlacement = placement
+ var viewportDim = this.getPosition(this.$viewport)
+
+ placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
+ placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
+ placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
+ placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
+ placement
+
+ $tip
+ .removeClass(orgPlacement)
+ .addClass(placement)
+ }
+
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
+
+ this.applyPlacement(calculatedOffset, placement)
+
+ var complete = function () {
+ var prevHoverState = that.hoverState
+ that.$element.trigger('shown.bs.' + that.type)
+ that.hoverState = null
+
+ if (prevHoverState == 'out') that.leave(that)
+ }
+
+ $.support.transition && this.$tip.hasClass('fade') ?
+ $tip
+ .one('bsTransitionEnd', complete)
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
+ complete()
+ }
+ }
+
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
+ var $tip = this.tip()
+ var width = $tip[0].offsetWidth
+ var height = $tip[0].offsetHeight
+
+ // manually read margins because getBoundingClientRect includes difference
+ var marginTop = parseInt($tip.css('margin-top'), 10)
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
+
+ // we must check for NaN for ie 8/9
+ if (isNaN(marginTop)) marginTop = 0
+ if (isNaN(marginLeft)) marginLeft = 0
+
+ offset.top += marginTop
+ offset.left += marginLeft
+
+ // $.fn.offset doesn't round pixel values
+ // so we use setOffset directly with our own function B-0
+ $.offset.setOffset($tip[0], $.extend({
+ using: function (props) {
+ $tip.css({
+ top: Math.round(props.top),
+ left: Math.round(props.left)
+ })
+ }
+ }, offset), 0)
+
+ $tip.addClass('in')
+
+ // check to see if placing tip in new offset caused the tip to resize itself
+ var actualWidth = $tip[0].offsetWidth
+ var actualHeight = $tip[0].offsetHeight
+
+ if (placement == 'top' && actualHeight != height) {
+ offset.top = offset.top + height - actualHeight
+ }
+
+ var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
+
+ if (delta.left) offset.left += delta.left
+ else offset.top += delta.top
+
+ var isVertical = /top|bottom/.test(placement)
+ var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
+ var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
+
+ $tip.offset(offset)
+ this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
+ }
+
+ Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
+ this.arrow()
+ .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
+ .css(isVertical ? 'top' : 'left', '')
+ }
+
+ Tooltip.prototype.setContent = function () {
+ var $tip = this.tip()
+ var title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
+ $tip.removeClass('fade in top bottom left right')
+ }
+
+ Tooltip.prototype.hide = function (callback) {
+ var that = this
+ var $tip = $(this.$tip)
+ var e = $.Event('hide.bs.' + this.type)
+
+ function complete() {
+ if (that.hoverState != 'in') $tip.detach()
+ that.$element
+ .removeAttr('aria-describedby')
+ .trigger('hidden.bs.' + that.type)
+ callback && callback()
+ }
+
+ this.$element.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ $tip.removeClass('in')
+
+ $.support.transition && $tip.hasClass('fade') ?
+ $tip
+ .one('bsTransitionEnd', complete)
+ .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
+ complete()
+
+ this.hoverState = null
+
+ return this
+ }
+
+ Tooltip.prototype.fixTitle = function () {
+ var $e = this.$element
+ if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
+ }
+ }
+
+ Tooltip.prototype.hasContent = function () {
+ return this.getTitle()
+ }
+
+ Tooltip.prototype.getPosition = function ($element) {
+ $element = $element || this.$element
+
+ var el = $element[0]
+ var isBody = el.tagName == 'BODY'
+
+ var elRect = el.getBoundingClientRect()
+ if (elRect.width == null) {
+ // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
+ elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
+ }
+ var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
+ var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
+ var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
+
+ return $.extend({}, elRect, scroll, outerDims, elOffset)
+ }
+
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
+
+ }
+
+ Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
+ var delta = { top: 0, left: 0 }
+ if (!this.$viewport) return delta
+
+ var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
+ var viewportDimensions = this.getPosition(this.$viewport)
+
+ if (/right|left/.test(placement)) {
+ var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
+ var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
+ if (topEdgeOffset < viewportDimensions.top) { // top overflow
+ delta.top = viewportDimensions.top - topEdgeOffset
+ } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
+ delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
+ }
+ } else {
+ var leftEdgeOffset = pos.left - viewportPadding
+ var rightEdgeOffset = pos.left + viewportPadding + actualWidth
+ if (leftEdgeOffset < viewportDimensions.left) { // left overflow
+ delta.left = viewportDimensions.left - leftEdgeOffset
+ } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
+ delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
+ }
+ }
+
+ return delta
+ }
+
+ Tooltip.prototype.getTitle = function () {
+ var title
+ var $e = this.$element
+ var o = this.options
+
+ title = $e.attr('data-original-title')
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
+
+ return title
+ }
+
+ Tooltip.prototype.getUID = function (prefix) {
+ do prefix += ~~(Math.random() * 1000000)
+ while (document.getElementById(prefix))
+ return prefix
+ }
+
+ Tooltip.prototype.tip = function () {
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ if (this.$tip.length != 1) {
+ throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
+ }
+ }
+ return this.$tip
+ }
+
+ Tooltip.prototype.arrow = function () {
+ return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
+ }
+
+ Tooltip.prototype.enable = function () {
+ this.enabled = true
+ }
+
+ Tooltip.prototype.disable = function () {
+ this.enabled = false
+ }
+
+ Tooltip.prototype.toggleEnabled = function () {
+ this.enabled = !this.enabled
+ }
+
+ Tooltip.prototype.toggle = function (e) {
+ var self = this
+ if (e) {
+ self = $(e.currentTarget).data('bs.' + this.type)
+ if (!self) {
+ self = new this.constructor(e.currentTarget, this.getDelegateOptions())
+ $(e.currentTarget).data('bs.' + this.type, self)
+ }
+ }
+
+ if (e) {
+ self.inState.click = !self.inState.click
+ if (self.isInStateTrue()) self.enter(self)
+ else self.leave(self)
+ } else {
+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
+ }
+ }
+
+ Tooltip.prototype.destroy = function () {
+ var that = this
+ clearTimeout(this.timeout)
+ this.hide(function () {
+ that.$element.off('.' + that.type).removeData('bs.' + that.type)
+ if (that.$tip) {
+ that.$tip.detach()
+ }
+ that.$tip = null
+ that.$arrow = null
+ that.$viewport = null
+ })
+ }
+
+
+ // TOOLTIP PLUGIN DEFINITION
+ // =========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.tooltip')
+ var options = typeof option == 'object' && option
+
+ if (!data && /destroy|hide/.test(option)) return
+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.tooltip
+
+ $.fn.tooltip = Plugin
+ $.fn.tooltip.Constructor = Tooltip
+
+
+ // TOOLTIP NO CONFLICT
+ // ===================
+
+ $.fn.tooltip.noConflict = function () {
+ $.fn.tooltip = old
+ return this
+ }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: popover.js v3.3.6
+ * http://getbootstrap.com/javascript/#popovers
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // POPOVER PUBLIC CLASS DEFINITION
+ // ===============================
+
+ var Popover = function (element, options) {
+ this.init('popover', element, options)
+ }
+
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
+
+ Popover.VERSION = '3.3.6'
+
+ Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
+ placement: 'right',
+ trigger: 'click',
+ content: '',
+ template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
+ })
+
+
+ // NOTE: POPOVER EXTENDS tooltip.js
+ // ================================
+
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
+
+ Popover.prototype.constructor = Popover
+
+ Popover.prototype.getDefaults = function () {
+ return Popover.DEFAULTS
+ }
+
+ Popover.prototype.setContent = function () {
+ var $tip = this.tip()
+ var title = this.getTitle()
+ var content = this.getContent()
+
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
+ this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
+ ](content)
+
+ $tip.removeClass('fade top bottom left right in')
+
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
+ // this manually by checking the contents.
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
+ }
+
+ Popover.prototype.hasContent = function () {
+ return this.getTitle() || this.getContent()
+ }
+
+ Popover.prototype.getContent = function () {
+ var $e = this.$element
+ var o = this.options
+
+ return $e.attr('data-content')
+ || (typeof o.content == 'function' ?
+ o.content.call($e[0]) :
+ o.content)
+ }
+
+ Popover.prototype.arrow = function () {
+ return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
+ }
+
+
+ // POPOVER PLUGIN DEFINITION
+ // =========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.popover')
+ var options = typeof option == 'object' && option
+
+ if (!data && /destroy|hide/.test(option)) return
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.popover
+
+ $.fn.popover = Plugin
+ $.fn.popover.Constructor = Popover
+
+
+ // POPOVER NO CONFLICT
+ // ===================
+
+ $.fn.popover.noConflict = function () {
+ $.fn.popover = old
+ return this
+ }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: scrollspy.js v3.3.6
+ * http://getbootstrap.com/javascript/#scrollspy
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // SCROLLSPY CLASS DEFINITION
+ // ==========================
+
+ function ScrollSpy(element, options) {
+ this.$body = $(document.body)
+ this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
+ this.selector = (this.options.target || '') + ' .nav li > a'
+ this.offsets = []
+ this.targets = []
+ this.activeTarget = null
+ this.scrollHeight = 0
+
+ this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.VERSION = '3.3.6'
+
+ ScrollSpy.DEFAULTS = {
+ offset: 10
+ }
+
+ ScrollSpy.prototype.getScrollHeight = function () {
+ return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
+ }
+
+ ScrollSpy.prototype.refresh = function () {
+ var that = this
+ var offsetMethod = 'offset'
+ var offsetBase = 0
+
+ this.offsets = []
+ this.targets = []
+ this.scrollHeight = this.getScrollHeight()
+
+ if (!$.isWindow(this.$scrollElement[0])) {
+ offsetMethod = 'position'
+ offsetBase = this.$scrollElement.scrollTop()
+ }
+
+ this.$body
+ .find(this.selector)
+ .map(function () {
+ var $el = $(this)
+ var href = $el.data('target') || $el.attr('href')
+ var $href = /^#./.test(href) && $(href)
+
+ return ($href
+ && $href.length
+ && $href.is(':visible')
+ && [[$href[offsetMethod]().top + offsetBase, href]]) || null
+ })
+ .sort(function (a, b) { return a[0] - b[0] })
+ .each(function () {
+ that.offsets.push(this[0])
+ that.targets.push(this[1])
+ })
+ }
+
+ ScrollSpy.prototype.process = function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ var scrollHeight = this.getScrollHeight()
+ var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
+ var offsets = this.offsets
+ var targets = this.targets
+ var activeTarget = this.activeTarget
+ var i
+
+ if (this.scrollHeight != scrollHeight) {
+ this.refresh()
+ }
+
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
+ }
+
+ if (activeTarget && scrollTop < offsets[0]) {
+ this.activeTarget = null
+ return this.clear()
+ }
+
+ for (i = offsets.length; i--;) {
+ activeTarget != targets[i]
+ && scrollTop >= offsets[i]
+ && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
+ && this.activate(targets[i])
+ }
+ }
+
+ ScrollSpy.prototype.activate = function (target) {
+ this.activeTarget = target
+
+ this.clear()
+
+ var selector = this.selector +
+ '[data-target="' + target + '"],' +
+ this.selector + '[href="' + target + '"]'
+
+ var active = $(selector)
+ .parents('li')
+ .addClass('active')
+
+ if (active.parent('.dropdown-menu').length) {
+ active = active
+ .closest('li.dropdown')
+ .addClass('active')
+ }
+
+ active.trigger('activate.bs.scrollspy')
+ }
+
+ ScrollSpy.prototype.clear = function () {
+ $(this.selector)
+ .parentsUntil(this.options.target, '.active')
+ .removeClass('active')
+ }
+
+
+ // SCROLLSPY PLUGIN DEFINITION
+ // ===========================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.scrollspy')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.scrollspy
+
+ $.fn.scrollspy = Plugin
+ $.fn.scrollspy.Constructor = ScrollSpy
+
+
+ // SCROLLSPY NO CONFLICT
+ // =====================
+
+ $.fn.scrollspy.noConflict = function () {
+ $.fn.scrollspy = old
+ return this
+ }
+
+
+ // SCROLLSPY DATA-API
+ // ==================
+
+ $(window).on('load.bs.scrollspy.data-api', function () {
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ Plugin.call($spy, $spy.data())
+ })
+ })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tab.js v3.3.6
+ * http://getbootstrap.com/javascript/#tabs
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // TAB CLASS DEFINITION
+ // ====================
+
+ var Tab = function (element) {
+ // jscs:disable requireDollarBeforejQueryAssignment
+ this.element = $(element)
+ // jscs:enable requireDollarBeforejQueryAssignment
+ }
+
+ Tab.VERSION = '3.3.6'
+
+ Tab.TRANSITION_DURATION = 150
+
+ Tab.prototype.show = function () {
+ var $this = this.element
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
+ var selector = $this.data('target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+ }
+
+ if ($this.parent('li').hasClass('active')) return
+
+ var $previous = $ul.find('.active:last a')
+ var hideEvent = $.Event('hide.bs.tab', {
+ relatedTarget: $this[0]
+ })
+ var showEvent = $.Event('show.bs.tab', {
+ relatedTarget: $previous[0]
+ })
+
+ $previous.trigger(hideEvent)
+ $this.trigger(showEvent)
+
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
+
+ var $target = $(selector)
+
+ this.activate($this.closest('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $previous.trigger({
+ type: 'hidden.bs.tab',
+ relatedTarget: $this[0]
+ })
+ $this.trigger({
+ type: 'shown.bs.tab',
+ relatedTarget: $previous[0]
+ })
+ })
+ }
+
+ Tab.prototype.activate = function (element, container, callback) {
+ var $active = container.find('> .active')
+ var transition = callback
+ && $.support.transition
+ && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
+
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', false)
+
+ element
+ .addClass('active')
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', true)
+
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
+
+ if (element.parent('.dropdown-menu').length) {
+ element
+ .closest('li.dropdown')
+ .addClass('active')
+ .end()
+ .find('[data-toggle="tab"]')
+ .attr('aria-expanded', true)
+ }
+
+ callback && callback()
+ }
+
+ $active.length && transition ?
+ $active
+ .one('bsTransitionEnd', next)
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
+ next()
+
+ $active.removeClass('in')
+ }
+
+
+ // TAB PLUGIN DEFINITION
+ // =====================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.tab')
+
+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.tab
+
+ $.fn.tab = Plugin
+ $.fn.tab.Constructor = Tab
+
+
+ // TAB NO CONFLICT
+ // ===============
+
+ $.fn.tab.noConflict = function () {
+ $.fn.tab = old
+ return this
+ }
+
+
+ // TAB DATA-API
+ // ============
+
+ var clickHandler = function (e) {
+ e.preventDefault()
+ Plugin.call($(this), 'show')
+ }
+
+ $(document)
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: affix.js v3.3.6
+ * http://getbootstrap.com/javascript/#affix
+ * ========================================================================
+ * Copyright 2011-2015 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+ 'use strict';
+
+ // AFFIX CLASS DEFINITION
+ // ======================
+
+ var Affix = function (element, options) {
+ this.options = $.extend({}, Affix.DEFAULTS, options)
+
+ this.$target = $(this.options.target)
+ .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
+ .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
+
+ this.$element = $(element)
+ this.affixed = null
+ this.unpin = null
+ this.pinnedOffset = null
+
+ this.checkPosition()
+ }
+
+ Affix.VERSION = '3.3.6'
+
+ Affix.RESET = 'affix affix-top affix-bottom'
+
+ Affix.DEFAULTS = {
+ offset: 0,
+ target: window
+ }
+
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
+ var scrollTop = this.$target.scrollTop()
+ var position = this.$element.offset()
+ var targetHeight = this.$target.height()
+
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
+
+ if (this.affixed == 'bottom') {
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
+ }
+
+ var initializing = this.affixed == null
+ var colliderTop = initializing ? scrollTop : position.top
+ var colliderHeight = initializing ? targetHeight : height
+
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
+
+ return false
+ }
+
+ Affix.prototype.getPinnedOffset = function () {
+ if (this.pinnedOffset) return this.pinnedOffset
+ this.$element.removeClass(Affix.RESET).addClass('affix')
+ var scrollTop = this.$target.scrollTop()
+ var position = this.$element.offset()
+ return (this.pinnedOffset = position.top - scrollTop)
+ }
+
+ Affix.prototype.checkPositionWithEventLoop = function () {
+ setTimeout($.proxy(this.checkPosition, this), 1)
+ }
+
+ Affix.prototype.checkPosition = function () {
+ if (!this.$element.is(':visible')) return
+
+ var height = this.$element.height()
+ var offset = this.options.offset
+ var offsetTop = offset.top
+ var offsetBottom = offset.bottom
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
+
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
+ if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
+
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
+
+ if (this.affixed != affix) {
+ if (this.unpin != null) this.$element.css('top', '')
+
+ var affixType = 'affix' + (affix ? '-' + affix : '')
+ var e = $.Event(affixType + '.bs.affix')
+
+ this.$element.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ this.affixed = affix
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
+
+ this.$element
+ .removeClass(Affix.RESET)
+ .addClass(affixType)
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
+ }
+
+ if (affix == 'bottom') {
+ this.$element.offset({
+ top: scrollHeight - height - offsetBottom
+ })
+ }
+ }
+
+
+ // AFFIX PLUGIN DEFINITION
+ // =======================
+
+ function Plugin(option) {
+ return this.each(function () {
+ var $this = $(this)
+ var data = $this.data('bs.affix')
+ var options = typeof option == 'object' && option
+
+ if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ var old = $.fn.affix
+
+ $.fn.affix = Plugin
+ $.fn.affix.Constructor = Affix
+
+
+ // AFFIX NO CONFLICT
+ // =================
+
+ $.fn.affix.noConflict = function () {
+ $.fn.affix = old
+ return this
+ }
+
+
+ // AFFIX DATA-API
+ // ==============
+
+ $(window).on('load', function () {
+ $('[data-spy="affix"]').each(function () {
+ var $spy = $(this)
+ var data = $spy.data()
+
+ data.offset = data.offset || {}
+
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
+
+ Plugin.call($spy, data)
+ })
+ })
+
+}(jQuery);
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js b/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js
new file mode 100644
index 000000000..c4a924160
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js
@@ -0,0 +1,7 @@
+/*!
+ * Bootstrap v3.3.6 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under the MIT license
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),
+d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.6",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js b/poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
new file mode 100644
index 000000000..8b1c190df
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/customrecipe.js
@@ -0,0 +1,322 @@
+"use strict";
+
+function customRecipePageInit(ctx) {
+
+ var urlParams = libtoaster.parseUrlParams();
+ var customiseTable = $("#selectpackagestable");
+ var addPkgDepsModalBtn = $("#add-package-deps-modal-btn");
+ var rmdPkgReverseDepsModalBtn = $("#rm-package-reverse-deps-modal-btn");
+
+ if (urlParams.hasOwnProperty('notify') && urlParams.notify === 'new'){
+ $("#image-created-notification").show();
+ }
+
+ customiseTable.on('table-done', function(e, total){
+ /* Table is done so now setup the click handler for the package buttons */
+ $(".add-rm-package-btn").click(function(e){
+ e.preventDefault();
+ var targetPkg = $(this).data();
+
+ checkPackageDeps(targetPkg, function(pkgData){
+ if (targetPkg.directive === 'add'){
+ /* If we're adding a package we may need to show the modal to advise
+ * on dependencies for this package.
+ */
+ if (pkgData.unsatisfied_dependencies.length === 0){
+ addRemovePackage(targetPkg);
+ } else {
+ showPackageDepsModal(targetPkg, pkgData);
+ }
+ } else if (targetPkg.directive === 'remove') {
+ if (pkgData.reverse_dependencies.length === 0){
+ addRemovePackage(targetPkg);
+ } else {
+ showPackageReverseDepsModal(targetPkg, pkgData);
+ }
+ }
+ });
+ });
+ });
+
+ function checkPackageDeps(targetPkg, doneCb){
+ $.ajax({
+ type: 'GET',
+ url: targetPkg.packageUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(data){
+ if (data.error !== 'ok'){
+ console.warn(data.error);
+ return;
+ }
+ doneCb(data);
+ }
+ });
+ }
+
+ function showPackageDepsModal(targetPkg, pkgData){
+ var modal = $("#package-deps-modal");
+ var depsList = modal.find("#package-add-dep-list");
+ var deps = pkgData.unsatisfied_dependencies;
+
+ modal.find(".package-to-add-name").text(targetPkg.name);
+
+ depsList.text("");
+
+ for (var i in deps){
+ var li = $('<li></li>').text(deps[i].name);
+ li.append($('<span></span>').text(" ("+
+ deps[i].size_formatted+")"));
+ depsList.append(li);
+ }
+
+ modal.find("#package-deps-total-size").text(
+ pkgData.unsatisfied_dependencies_size_formatted);
+
+ targetPkg.depsAdded = deps;
+
+ addPkgDepsModalBtn.data(targetPkg);
+ modal.modal('show');
+ }
+
+ addPkgDepsModalBtn.click(function(e){
+ e.preventDefault();
+
+ addRemovePackage($(this).data(), null);
+ });
+
+ function showPackageReverseDepsModal(targetPkg, pkgData){
+ var modal = $("#package-reverse-deps-modal");
+ var depsList = modal.find("#package-reverse-dep-list");
+ var deps = pkgData.reverse_dependencies;
+
+ var depsCount = deps.length;
+ var vDepends = "depends";
+ var vPackage = "package";
+ var vThis = "this";
+ if (depsCount > 1) {
+ vDepends = "depend";
+ vPackage = "packages";
+ vThis = "these";
+ }
+ modal.find(".package-to-rm-name").text(targetPkg.name);
+ modal.find(".reverse-deps-count").text(depsCount);
+ modal.find(".reverse-deps-count-plus1").text((depsCount+1) + " packages");
+ modal.find(".reverse-deps-depends").text(vDepends);
+ modal.find(".reverse-deps-package").text(vPackage);
+ modal.find(".reverse-deps-this").text(vThis);
+
+ depsList.text("");
+
+ for (var i in deps){
+ var li = $('<li></li>').text(deps[i].name);
+ li.append($('<span></span>').text(" ("+
+ deps[i].size_formatted+")"));
+ depsList.append(li);
+ }
+
+ modal.find("#package-reverse-deps-total-size").text(
+ pkgData.reverse_dependencies_size_formatted);
+
+ targetPkg.depsRemoved = deps;
+
+ rmdPkgReverseDepsModalBtn.data(targetPkg);
+ modal.modal('show');
+ }
+
+ rmdPkgReverseDepsModalBtn.click(function(e){
+ e.preventDefault();
+
+ addRemovePackage($(this).data(), null);
+ });
+
+
+ function addRemovePackage(targetPkg, tableParams){
+ var method;
+ var msg = "You have ";
+
+ var btnCell = $("#package-btn-cell-" + targetPkg.id);
+ var inlineNotify = btnCell.children(".inline-notification");
+
+ var i;
+ var dep;
+ var depBtnCell;
+
+ if (targetPkg.directive === 'add') {
+ method = 'PUT';
+ /* If the package had dependencies also notify that they were added */
+ if (targetPkg.hasOwnProperty('depsAdded') &&
+ targetPkg.depsAdded.length > 0) {
+
+ msg += "added ";
+ msg += "<strong>" + (targetPkg.depsAdded.length + 1) + "</strong>";
+ msg += " packages to " + ctx.recipe.name + ": ";
+ msg += "<strong>" + targetPkg.name + "</strong> and its dependencies";
+
+ for (i in targetPkg.depsAdded){
+ dep = targetPkg.depsAdded[i];
+
+ msg += " <strong>" + dep.name + "</strong>";
+
+ /* Add any cells currently in view to the list of cells which get
+ * an list-inline notification inside them and which change add/rm state
+ */
+ depBtnCell = $("#package-btn-cell-" + dep.pk);
+ btnCell = btnCell.add(depBtnCell);
+
+ inlineNotify = inlineNotify.add(
+ depBtnCell.children(".inline-notification"));
+ }
+
+ inlineNotify.text(
+ (targetPkg.depsAdded.length + 1) + " packages added");
+
+ } else {
+ msg += "added <strong>1</strong>";
+ msg += " package to " + ctx.recipe.name + ": ";
+ msg += "<strong>" + targetPkg.name + "</strong>";
+ inlineNotify.text("1 package added");
+ }
+
+ } else if (targetPkg.directive === 'remove') {
+ method = 'DELETE';
+ var numPackageString = "1 package ";
+ var revDepList = "";
+ if (targetPkg.hasOwnProperty('depsRemoved') &&
+ targetPkg.depsRemoved.length > 0) {
+ var depsRemovedLength = targetPkg.depsRemoved.length;
+ var ending = "y: ";
+ var maxRevDepsDisplayed = 5;
+ var d = 0;
+ if (depsRemovedLength > 1) {
+ ending = "ies: ";
+ }
+ numPackageString = (depsRemovedLength + 1) + " packages";
+ revDepList = " and its " + depsRemovedLength + " reverse dependenc" + ending;
+ for (i in targetPkg.depsRemoved){
+ /* include up to maxRevDepsDisplayed rev deps on the page notification */
+ var notShownCount = depsRemovedLength - maxRevDepsDisplayed;
+ dep = targetPkg.depsRemoved[i];
+ if (d < maxRevDepsDisplayed) {
+ if (d > 0) {
+ revDepList += ", ";
+ }
+ revDepList += dep.name;
+ d++;
+ if ((d === maxRevDepsDisplayed) && (notShownCount > 0)) {
+ revDepList += " and " + notShownCount + " more";
+ }
+ }
+
+ /* Add any cells currently in view to the list of cells which get
+ * an list-inline notification inside them and which change add/rm state
+ */
+ depBtnCell = $("#package-btn-cell-" + dep.pk);
+ btnCell = btnCell.add(depBtnCell);
+
+ inlineNotify = inlineNotify.add(
+ depBtnCell.children(".inline-notification"));
+ }
+ }
+ msg+= "removed " + numPackageString + " from " + ctx.recipe.name + ":";
+ msg += " <strong>" + targetPkg.name + "</strong>";
+ msg += revDepList;
+
+ inlineNotify.text(numPackageString + " removed");
+ } else {
+ throw("Unknown package directive: should be add or remove");
+ }
+
+ $.ajax({
+ type: method,
+ url: targetPkg.packageUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(data){
+ if (data.error !== 'ok'){
+ console.warn(data.error);
+ return;
+ }
+
+ libtoaster.showChangeNotification(msg);
+
+ /* do the in-cell/inline notification to swap buttoms from add to
+ * remove
+ */
+ btnCell.children("button").fadeOut().promise().done(function(){
+ inlineNotify.fadeIn().delay(500).fadeOut(function(){
+ if (targetPkg.directive === 'add')
+ btnCell.children("button[data-directive=remove]").fadeIn();
+ else
+ btnCell.children("button[data-directive=add]").fadeIn();
+ });
+ });
+
+ /* Update the total num packages */
+ $.ajax({
+ type: "GET",
+ url: ctx.recipe.xhrPackageListUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(data){
+ console.log(data);
+ $("#total-num-packages").text(data.total);
+ $("#total-size-packages").text(data.total_size_formatted);
+ }
+ });
+ }
+ });
+ }
+
+ $("#no-results-show-all-packages").click(function(){
+ $(".no-results-search-input").val("");
+ });
+
+ $("#no-results-remove-search-btn").click(function(){
+ $(".no-results-search-input").val("");
+ $(this).hide();
+ });
+
+ /* Trigger a build of your custom image */
+ $(".build-custom-image").click(function(){
+ libtoaster.startABuild(null, ctx.recipe.name,
+ function(){
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ });
+ });
+
+ $("#delete-custom-recipe-confirmed").click(function(e){
+ e.preventDefault();
+ libtoaster.disableAjaxLoadingTimer();
+ $(this).find('[data-role="submit-state"]').hide();
+ $(this).find('[data-role="loading-state"]').show();
+ $(this).attr("disabled", "disabled");
+
+ $.ajax({
+ type: 'DELETE',
+ url: ctx.recipe.xhrCustomRecipeUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error !== "ok") {
+ console.warn(data.error);
+ } else {
+ var msg = $('<span>You have deleted <strong>1</strong> custom image: <strong id="deleted-custom-image-name"></strong></span>');
+ msg.find("#deleted-custom-image-name").text(ctx.recipe.name);
+
+ libtoaster.setNotification("custom-image-recipe-deleted",
+ msg.html());
+
+ window.location.replace(data.gotoUrl);
+ }
+ },
+ error: function (data) {
+ console.warn(data);
+ }
+ });
+ });
+
+ /* Stop the download link from working if it is in disabled state
+ * http://getbootstrap.com/css/#forms-disabled-fieldsets
+ */
+ $("a[disabled=disabled]").click(function(e){
+ e.preventDefault();
+ });
+
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js b/poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js
new file mode 100755
index 000000000..2b84c546c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/filtersnippet.js
@@ -0,0 +1,94 @@
+"use strict"
+
+// The disable removes the 'datepicker' attribute and
+// settings, so you have to re-initialize it each time
+// the date range is selected and enabled
+// DOM is used instead of jQuery to find the elements
+// in all contexts
+function date_enable (key, action) {
+
+ var elemFrom=document.getElementById("date_from_"+key);
+ var elemTo=document.getElementById("date_to_"+key);
+
+ if ('enable' == action) {
+ elemFrom.removeAttribute("disabled");
+ elemTo.removeAttribute("disabled");
+
+ $(elemFrom).datepicker();
+ $(elemTo).datepicker();
+
+ $(elemFrom).datepicker( "option", "dateFormat", "dd/mm/yy" );
+ $(elemTo).datepicker( "option", "dateFormat", "dd/mm/yy" );
+
+ $(elemFrom).datepicker( "setDate", elemFrom.getAttribute( "data-setDate") );
+ $(elemTo).datepicker( "setDate", elemTo.getAttribute( "data-setDate") );
+ $(elemFrom).datepicker( "option", "minDate", elemFrom.getAttribute( "data-minDate"));
+ $(elemTo).datepicker( "option", "minDate", elemTo.getAttribute( "data-minDate"));
+ $(elemFrom).datepicker( "option", "maxDate", elemFrom.getAttribute( "data-maxDate"));
+ $(elemTo).datepicker( "option", "maxDate", elemTo.getAttribute( "data-maxDate"));
+ } else {
+ elemFrom.setAttribute("disabled","disabled");
+ elemTo.setAttribute("disabled","disabled");
+ }
+}
+
+// Initialize the date picker elements with their default state variables, and
+// register the radio button and form actions
+function date_init (key, from_date, to_date, min_date, max_date, initial_enable) {
+
+ var elemFrom=document.getElementById("date_from_"+key);
+ var elemTo=document.getElementById("date_to_"+key);
+
+ // Were there any daterange filters instantiated? (e.g. no builds found)
+ if (null == elemFrom) {
+ return;
+ }
+
+ // init the datepicker context data
+ elemFrom.setAttribute( "data-setDate", from_date );
+ elemTo.setAttribute( "data-setDate", to_date );
+ elemFrom.setAttribute( "data-minDate", min_date);
+ elemTo.setAttribute( "data-minDate", min_date);
+ elemFrom.setAttribute( "data-maxDate", max_date);
+ elemTo.setAttribute( "data-maxDate", max_date);
+
+ // does the date set start enabled?
+ if (key == initial_enable) {
+ date_enable (key, "enable");
+ } else {
+ date_enable (key, "disable");
+ }
+
+ // catch the radio button selects for enable/disable
+ $('input:radio[name="filter"]').change(function(){
+ if ($(this).val() == 'daterange') {
+ key=$(this).attr("data-key");
+ date_enable (key, 'enable');
+ } else {
+ key=$(this).attr("data-key");
+ date_enable (key, 'disable');
+ }
+ });
+
+ // catch any new 'from' date as minDate for 'to' date
+ $("#date_from_"+key).change(function(){
+ from_date = $("#date_from_"+key).val();
+ $("#date_to_"+key).datepicker( "option", "minDate", from_date );
+ });
+
+ // catch the submit (just once)
+ $("form").unbind('submit');
+ $("form").submit(function(e) {
+ // format a composite daterange filter value so that it can be parsed and post-processed in the view
+ if (key !== undefined) {
+ if ($("#date_from_"+key).length) {
+ var filter=key+"__gte!"+key+"__lt:"+$("#date_from_"+key).val()+"!"+$("#date_to_"+key).val()+"_daterange";
+ $("#last_date_from_"+key).val($("#date_from_"+key).val());
+ $("#last_date_to_"+key).val($("#date_to_"+key).val());
+ $("#filter_value_"+key).val(filter);
+ }
+ }
+ return true;
+ });
+
+};
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js b/poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js
new file mode 100644
index 000000000..8cc886f1b
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/highlight.pack.js
@@ -0,0 +1,2 @@
+/*! highlight.js v9.12.0 | BSD3 License | git.io/hljslicense */
+!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset<r[0].offset?e:r:"start"===r[0].event?e:r:e.length?e:r}function o(e){function r(e){return" "+e.nodeName+'="'+n(e.value).replace('"',"&quot;")+'"'}s+="<"+t(e)+E.map.call(e.attributes,r).join("")+">"}function u(e){s+="</"+t(e)+">"}function c(e){("start"===e.event?o:u)(e.node)}for(var l=0,s="",f=[];e.length||r.length;){var g=i();if(s+=n(a.substring(l,g[0].offset)),l=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return s+n(a.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},u=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?u("keyword",a.k):x(a.k).forEach(function(e){u(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return l("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var c=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=c.length?t(c.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function l(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function p(e,n,t,r){var a=r?"":I.classPrefix,i='<span class="'+a,o=t?"":C;return i+=e+'">',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=l(E,r),e?(B+=e[1],a+=p(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!y[E.sL])return n(k);var t=e?f(E.sL,k,!0,x[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(B+=t.r),e&&(x[E.sL]=t.top),p(t.language,t.value,!1,!0)}function b(){L+=null!=E.sL?d():h(),k=""}function v(e){L+=e.cN?p(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(k+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),b(),t.rB||t.eB||(k=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),b(),a.eE&&(k=n));do E.cN&&(L+=C),E.skip||(B+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"<unnamed>")+'"');return k+=n,n.length||1}var N=w(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,E=i||N,x={},L="";for(R=E;R!==N;R=R.parent)R.cN&&(L=p(R.cN,"",!0)+L);var k="",B=0;try{for(var M,j,O=0;;){if(E.t.lastIndex=O,M=E.t.exec(t),!M)break;j=m(t.substring(O,M.index),M[0]),O=M.index+j}for(m(t.substr(O)),R=E;R.parent;R=R.parent)R.cN&&(L+=C);return{r:B,value:L,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function g(e,t){t=t||I.languages||x(y);var r={r:0,value:n(e)},a=r;return t.filter(w).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return I.tabReplace||I.useBR?e.replace(M,function(e,n){return I.useBR&&"\n"===e?"<br>":I.tabReplace?n.replace(/\t/g,I.tabReplace):""}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function d(e){var n,t,r,o,l,s=i(e);a(s)||(I.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):n=e,l=n.textContent,r=s?f(s,l,!0):g(l),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),l)),r.value=p(r.value),e.innerHTML=r.value,e.className=h(e.className,s,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){I=o(I,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,d)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=y[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function R(){return x(y)}function w(e){return e=(e||"").toLowerCase(),y[e]||y[L[e]]}var E=[],x=Object.keys,y={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="</span>",I={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=d,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,s.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:o}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("python",function(e){var r={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},b={cN:"meta",b:/^(>>>|\.\.\.) /},c={cN:"subst",b:/\{/,e:/\}/,k:r,i:/#/},a={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[b],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[b,c]},{b:/(fr|rf|f)"""/,e:/"""/,c:[b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[c]},{b:/(fr|rf|f)"/,e:/"/,c:[c]},e.ASM,e.QSM]},s={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},i={cN:"params",b:/\(/,e:/\)/,c:["self",b,s,a]};return c.c=[a,s,b],{aliases:["py","gyp"],k:r,i:/(<\/|->|\?)|=>/,c:[b,s,a,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,i,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={cN:"subst",b:/#\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,r]},{b:/"/,e:/"/,c:[e.BE,r]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[r,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+n},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(i)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:i.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[s,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U)?L?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U)?R"',e:'"',c:[t.BE]},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"</",c:n.concat([i,{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b:/</,e:/>/,c:["self"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},t={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},r=e.inherit(t,{i:/\n/}),a={cN:"subst",b:"{",e:"}",k:i},c=e.inherit(a,{i:/\n/}),n={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,c]},s={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},a]},o=e.inherit(s,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},c]});a.c=[s,n,t,e.ASM,e.QSM,e.CNM,e.CBCM],c.c=[o,n,r,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\n/})];var l={v:[s,n,t,e.ASM,e.QSM]},b=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},l,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+b+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("makefile",function(e){var i={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%<?\^\+\*]/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,i]},a={cN:"variable",b:/\$\([\w-]+\s/,e:/\)/,k:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},c:[i]},n={b:"^"+e.UIR+"\\s*[:+?]?=",i:"\\n",rB:!0,c:[{b:"^"+e.UIR,e:"[:+?]?=",eE:!0}]},t={cN:"meta",b:/^\.PHONY:/,e:/$/,k:{"meta-keyword":".PHONY"},l:/[\.\w]+/},l={cN:"section",b:/^[^\s]+:/,e:/$/,c:[i]};return{aliases:["mk","mak"],k:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath",l:/[\w-]+/,c:[e.HCM,i,r,a,n,t,l]}});hljs.registerLanguage("java",function(e){var a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t=a+"(<"+a+"(\\s*,\\s*"+a+")*>)?",r="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",c={cN:"number",b:s,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:_,l:i,i:"</",c:[t,e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"meta",b:"#",e:"$",c:[{cN:"meta-string",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:i,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/</,e:/(\/\w+|\w+\/)>/,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:"</?",e:">"},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/</,r:0,c:[{cN:"attr",b:e,r:0},{b:/=\s*/,r:0,c:[{cN:"string",endsParent:!0,v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("<!--","-->",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{name:"style"},c:[t],starts:{e:"</style>",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{name:"script"},c:[t],starts:{e:"</script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}}); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
new file mode 100644
index 000000000..296483985
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/importlayer.js
@@ -0,0 +1,447 @@
+"use strict"
+
+function importLayerPageInit (ctx) {
+
+ var layerDepBtn = $("#add-layer-dependency-btn");
+ var importAndAddBtn = $("#import-and-add-btn");
+ var layerNameInput = $("#import-layer-name");
+ var vcsURLInput = $("#layer-git-repo-url");
+ var gitRefInput = $("#layer-git-ref");
+ var layerDepInput = $("#layer-dependency");
+ var layerNameCtrl = $("#layer-name-ctrl");
+ var duplicatedLayerName = $("#duplicated-layer-name-hint");
+ var localDirPath = $("#local-dir-path");
+
+ var layerDeps = {};
+ var layerDepsDeps = {};
+ var currentLayerDepSelection;
+ var validLayerName = /^(\w|-)+$/;
+
+ libtoaster.makeTypeahead(layerDepInput,
+ libtoaster.ctx.layersTypeAheadUrl,
+ { include_added: "true" }, function(item){
+ currentLayerDepSelection = item;
+ layerDepBtn.removeAttr("disabled");
+ });
+
+ layerDepInput.on("typeahead:select", function(event, data){
+ currentLayerDepSelection = data;
+ });
+
+ // Disable local dir repo when page is loaded.
+ $('#local-dir').hide();
+
+ // disable the "Add layer" button when the layer input typeahead is empty
+ // or not in the typeahead choices
+ layerDepInput.on("input change", function(){
+ layerDepBtn.attr("disabled","disabled");
+ });
+
+ /* We automatically add "openembedded-core" layer for convenience as a
+ * dependency as pretty much all layers depend on this one
+ */
+ $.getJSON(libtoaster.ctx.layersTypeAheadUrl,
+ { include_added: "true" , search: "openembedded-core" },
+ function(layer) {
+ if (layer.results.length > 0) {
+ currentLayerDepSelection = layer.results[0];
+ layerDepBtn.click();
+ }
+ });
+
+ layerDepBtn.click(function(){
+ if (currentLayerDepSelection == undefined)
+ return;
+
+ layerDeps[currentLayerDepSelection.id] = currentLayerDepSelection;
+
+ /* Make a list item for the new layer dependency */
+ var newLayerDep = $("<li><a></a><span class=\"glyphicon glyphicon-trash\" data-toggle=\"tooltip\" title=\"Remove\"></span></li>");
+
+ newLayerDep.data('layer-id', currentLayerDepSelection.id);
+ newLayerDep.children("span").tooltip();
+
+ var link = newLayerDep.children("a");
+ link.attr("href", currentLayerDepSelection.layerdetailurl);
+ link.text(currentLayerDepSelection.name);
+ link.tooltip({title: currentLayerDepSelection.tooltip, placement: "right"});
+
+ var trashItem = newLayerDep.children("span");
+ trashItem.click(function () {
+ var toRemove = $(this).parent().data('layer-id');
+ delete layerDeps[toRemove];
+ $(this).parent().fadeOut(function (){
+ $(this).remove();
+ });
+ });
+
+ $("#layer-deps-list").append(newLayerDep);
+
+ libtoaster.getLayerDepsForProject(currentLayerDepSelection.layerdetailurl,
+ function (data){
+ /* These are the dependencies of the layer added as a dependency */
+ if (data.list.length > 0) {
+ currentLayerDepSelection.url = currentLayerDepSelection.layerdetailurl;
+ layerDeps[currentLayerDepSelection.id].deps = data.list;
+ }
+
+ /* Clear the current selection */
+ layerDepInput.val("");
+ currentLayerDepSelection = undefined;
+ layerDepBtn.attr("disabled","disabled");
+ }, null);
+ });
+
+ importAndAddBtn.click(function(e){
+ e.preventDefault();
+ /* This is a list of the names from layerDeps for the layer deps
+ * modal dialog body
+ */
+ var depNames = [];
+
+ /* arrray of all layer dep ids includes parent and child deps */
+ var allDeps = [];
+
+ /* temporary object to use to do a reduce on the dependencies for each
+ * layer dependency added
+ */
+ var depDeps = {};
+
+ /* the layers that have dependencies have an extra property "deps"
+ * look in this for each layer and reduce this to a unquie object
+ * of deps.
+ */
+ for (var key in layerDeps){
+ if (layerDeps[key].hasOwnProperty('deps')){
+ for (var dep in layerDeps[key].deps){
+ var layer = layerDeps[key].deps[dep];
+ depDeps[layer.id] = layer;
+ }
+ }
+ depNames.push(layerDeps[key].name);
+ allDeps.push(layerDeps[key].id);
+ }
+
+ /* we actually want it as an array so convert it now */
+ var depDepsArray = [];
+ for (var key in depDeps)
+ depDepsArray.push (depDeps[key]);
+
+ if (depDepsArray.length > 0) {
+ var layer = { name: layerNameInput.val(), url: "#", id: -1 };
+ var title = "Layer";
+ var body = "<strong>"+layer.name+"</strong>'s dependencies ("+
+ depNames.join(", ")+"</span>) require some layers that are not added to your project. Select the ones you want to add:</p>";
+
+ showLayerDepsModal(layer,
+ depDepsArray,
+ title, body, false, function(layerObsList){
+ /* Add the accepted layer dependencies' ids to the allDeps array */
+ for (var key in layerObsList){
+ allDeps.push(layerObsList[key].id);
+ }
+ import_and_add ();
+ });
+ } else {
+ import_and_add ();
+ }
+
+ function import_and_add () {
+ /* convert to a csv of all the deps to be added */
+ var layerDepsCsv = allDeps.join(",");
+
+ var layerData = {
+ name: layerNameInput.val(),
+ vcs_url: vcsURLInput.val(),
+ git_ref: gitRefInput.val(),
+ dir_path: $("#layer-subdir").val(),
+ project_id: libtoaster.ctx.projectId,
+ layer_deps: layerDepsCsv,
+ local_source_dir: $('#local-dir-path').val(),
+ add_to_project: true,
+ };
+
+ if ($('input[name=repo]:checked').val() == "git") {
+ layerData.local_source_dir = "";
+ } else {
+ layerData.vcs_url = "";
+ layerData.git_ref = "";
+ }
+
+ $.ajax({
+ type: "PUT",
+ url: ctx.xhrLayerUrl,
+ data: JSON.stringify(layerData),
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.log(data.error);
+ /* let the user know why nothing happened */
+ alert(data.error)
+ } else {
+ createImportedNotification(data);
+ window.location.replace(libtoaster.ctx.projectPageUrl);
+ }
+ },
+ error: function (data) {
+ console.log("Call failed");
+ console.log(data);
+ }
+ });
+ }
+ });
+
+ /* Layer imported notification */
+ function createImportedNotification(imported){
+ var message = "Layer imported";
+
+ if (imported.deps_added.length === 0) {
+ message = "You have imported <strong><a class=\"alert-link\" href=\""+imported.imported_layer.layerdetailurl+"\">"+imported.imported_layer.name+"</a></strong> and added it to your project.";
+ } else {
+
+ var links = "<a href=\""+imported.imported_layer.layerdetailurl+"\">"+imported.imported_layer.name+"</a>, ";
+
+ imported.deps_added.map (function(item, index){
+ links +='<a href="'+item.layerdetailurl+'">'+item.name+'</a>';
+ /*If we're at the last element we don't want the trailing comma */
+ if (imported.deps_added[index+1] !== undefined)
+ links += ', ';
+ });
+
+ /* Length + 1 here to do deps + the imported layer */
+ message = 'You have imported <strong><a href="'+imported.imported_layer.layerdetailurl+'">'+imported.imported_layer.name+'</a></strong> and added <strong>'+(imported.deps_added.length+1)+'</strong> layers to your project: <strong>'+links+'</strong>';
+ }
+
+ libtoaster.setNotification("layer-imported", message);
+ }
+
+ function enable_import_btn(enabled) {
+ var importAndAddHint = $("#import-and-add-hint");
+
+ if (enabled) {
+ importAndAddBtn.removeAttr("disabled");
+ importAndAddHint.hide();
+ return;
+ }
+
+ importAndAddBtn.attr("disabled", "disabled");
+ importAndAddHint.show();
+ }
+
+ function check_form() {
+ var valid = false;
+ var inputs = $("input:required");
+ var inputStr = inputs.val().split("");
+
+ for (var i=0; i<inputs.val().length; i++){
+ if (!(valid = inputStr[i])){
+ enable_import_btn(false);
+ break;
+ }
+ }
+
+ if (valid) {
+ if ($("#local-dir-radio").prop("checked") &&
+ localDirPath.val().length > 0) {
+ enable_import_btn(true);
+ }
+
+ if ($("#git-repo-radio").prop("checked")) {
+ if (gitRefInput.val().length > 0 &&
+ gitRefInput.val() == 'HEAD') {
+ $('#invalid-layer-revision-hint').show();
+ $('#layer-revision-ctrl').addClass('has-error');
+ enable_import_btn(false);
+ } else if (vcsURLInput.val().length > 0 &&
+ gitRefInput.val().length > 0) {
+ $('#invalid-layer-revision-hint').hide();
+ $('#layer-revision-ctrl').removeClass('has-error');
+ enable_import_btn(true);
+ }
+ }
+ }
+
+ if (inputs.val().length == 0)
+ enable_import_btn(false);
+ }
+
+ function layerExistsError(layer){
+ var dupLayerInfo = $("#duplicate-layer-info");
+
+ if (layer.local_source_dir) {
+ $("#git-layer-dup").hide();
+ $("#local-layer-dup").fadeIn();
+ dupLayerInfo.find(".dup-layer-name").text(layer.name);
+ dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl);
+ dupLayerInfo.find("#dup-local-source-dir-name").text(layer.local_source_dir);
+ } else {
+ $("#git-layer-dup").fadeIn();
+ $("#local-layer-dup").hide();
+ dupLayerInfo.find(".dup-layer-name").text(layer.name);
+ dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl);
+ dupLayerInfo.find("#dup-layer-vcs-url").text(layer.vcs_url);
+ dupLayerInfo.find("#dup-layer-revision").text(layer.vcs_reference);
+ }
+ $(".fields-apart-from-layer-name").fadeOut(function(){
+
+ dupLayerInfo.fadeIn();
+ });
+ }
+
+ layerNameInput.on('blur', function() {
+ if (!$(this).val()){
+ return;
+ }
+ var name = $(this).val();
+
+ /* Check if the layer name exists */
+ $.getJSON(libtoaster.ctx.layersTypeAheadUrl,
+ { include_added: "true" , search: name, format: "json" },
+ function(layer) {
+ if (layer.results.length > 0) {
+ for (var i in layer.results){
+ if (layer.results[i].name == name) {
+ layerExistsError(layer.results[i]);
+ }
+ }
+ }
+ });
+ });
+
+ vcsURLInput.on('input', function() {
+ check_form();
+ });
+
+ gitRefInput.on('input', function() {
+ check_form();
+ });
+
+ layerNameInput.on('input', function() {
+ if ($(this).val() && !validLayerName.test($(this).val())){
+ layerNameCtrl.addClass("has-error")
+ $("#invalid-layer-name-hint").show();
+ enable_import_btn(false);
+ return;
+ }
+
+ if ($("#duplicate-layer-info").css("display") != "None"){
+ $("#duplicate-layer-info").fadeOut(function(){
+ $(".fields-apart-from-layer-name").show();
+ radioDisplay();
+ });
+
+ }
+
+ radioDisplay();
+
+ /* Don't remove the error class if we're displaying the error for another
+ * reason.
+ */
+ if (!duplicatedLayerName.is(":visible"))
+ layerNameCtrl.removeClass("has-error")
+
+ $("#invalid-layer-name-hint").hide();
+ check_form();
+ });
+
+ /* Setup 'blank' typeahead */
+ libtoaster.makeTypeahead(gitRefInput,
+ ctx.xhrGitRevTypeAheadUrl,
+ { git_url: null }, function(){});
+
+
+ vcsURLInput.focusout(function (){
+ if (!$(this).val())
+ return;
+
+ /* If we a layer name specified don't overwrite it or if there isn't a
+ * url typed in yet return
+ */
+ if (!layerNameInput.val() && $(this).val().search("/")){
+ var urlPts = $(this).val().split("/");
+ /* Add a suggestion of the layer name */
+ var suggestion = urlPts[urlPts.length-1].replace(".git","");
+ layerNameInput.val(suggestion);
+ }
+
+ /* Now actually setup the typeahead properly with the git url entered */
+ gitRefInput._typeahead('destroy');
+
+ libtoaster.makeTypeahead(gitRefInput,
+ ctx.xhrGitRevTypeAheadUrl,
+ { git_url: $(this).val() },
+ function(selected){
+ gitRefInput._typeahead("close");
+ });
+
+ });
+
+ function radioDisplay() {
+ if ($('input[name=repo]:checked').val() == "local") {
+ $('#git-repo').hide();
+ $('#import-git-layer-and-add-hint').hide();
+ $('#local-dir').fadeIn();
+ $('#import-local-dir-and-add-hint').fadeIn();
+ } else {
+ $('#local-dir').hide();
+ $('#import-local-dir-and-add-hint').hide();
+ $('#git-repo').fadeIn();
+ $('#import-git-layer-and-add-hint').fadeIn();
+ }
+ }
+
+ $('input:radio[name="repo"]').change(function() {
+ radioDisplay();
+ if ($("#local-dir-radio").prop("checked")) {
+ if (localDirPath.val().length > 0) {
+ enable_import_btn(true);
+ } else {
+ enable_import_btn(false);
+ }
+ }
+ if ($("#git-repo-radio").prop("checked")) {
+ if (vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) {
+ enable_import_btn(true);
+ } else {
+ enable_import_btn(false);
+ }
+ }
+ });
+
+ localDirPath.on('input', function(){
+ if ($(this).val().trim().length == 0) {
+ $('#import-and-add-btn').attr("disabled","disabled");
+ $('#local-dir').addClass('has-error');
+ $('#hintError-dir-abs-path').show();
+ $('#hintError-dir-path-starts-with-slash').show();
+ } else {
+ var input = $(this);
+ var reBeginWithSlash = /^\//;
+ var reCheckVariable = /^\$/;
+ var re = /([ <>\\|":%\?\*]+)/;
+
+ var invalidDir = re.test(input.val());
+ var invalidSlash = reBeginWithSlash.test(input.val());
+ var invalidVar = reCheckVariable.test(input.val());
+
+ if (!invalidSlash && !invalidVar) {
+ $('#local-dir').addClass('has-error');
+ $('#import-and-add-btn').attr("disabled","disabled");
+ $('#hintError-dir-abs-path').show();
+ $('#hintError-dir-path-starts-with-slash').show();
+ } else if (invalidDir) {
+ $('#local-dir').addClass('has-error');
+ $('#import-and-add-btn').attr("disabled","disabled");
+ $('#hintError-dir-path').show();
+ } else {
+ $('#local-dir').removeClass('has-error');
+ if (layerNameInput.val().length > 0) {
+ $('#import-and-add-btn').removeAttr("disabled");
+ }
+ $('#hintError-dir-abs-path').hide();
+ $('#hintError-dir-path-starts-with-slash').hide();
+ $('#hintError-dir-path').hide();
+ }
+ }
+ });
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js
new file mode 100644
index 000000000..2be209dd2
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js
@@ -0,0 +1,6 @@
+/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-2.0.3.min.map
+*/
+(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:p,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return f.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=st(),k=st(),N=st(),E=!1,S=function(e,t){return e===t?(E=!0,0):0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],q=L.pop,H=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){H.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+mt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,r,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function at(e){return e[v]=!0,e}function ut(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)i.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return at(function(t){return t=+t,at(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.defaultView;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ut(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=ut(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=Q.test(t.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),ut(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=Q.test(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=Q.test(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return ct(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?ct(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:at,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?at(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},i.pseudos.nth=i.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ft(t);function dt(){}dt.prototype=i.filters=i.pseudos,i.setFilters=new dt;function gt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var i=t.dir,o=n&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[v]&&(r=bt(r)),i&&!i[v]&&(i=bt(i,o)),at(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function wt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=yt(function(e){return e===t},a,!0),p=yt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[yt(vt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return bt(l>1&&vt(f),l>1&&mt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&wt(e.slice(l,r)),o>r&&wt(e=e.slice(r)),o>r&&mt(e))}f.push(n)}return vt(f)}function Tt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=q.call(f));y=xt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?at(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function kt(e,t,r,o){var s,u,l,c,p,f=gt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&mt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}n.sortStable=v.split("").sort(S).join("")===v,n.detectDuplicates=E,c(),n.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?undefined:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?undefined:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||lt(R,function(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){var r;return t===undefined||t&&"string"==typeof t&&n===undefined?(r=this.get(e,t),r!==undefined?r:this.get(e,x.camelCase(t))):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)
+};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n\f]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,i=0,o=x(this),s=e.match(w)||[];while(t=s[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,x(this).val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.bool.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,p,f,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:f.bindType||d,p=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function Z(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return e.contentDocument||x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(K[e]||x.unique(i),J.test(e)&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function et(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ct={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(mt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.lastChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[q.expando],o&&(t=q.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);q.cache[o]&&delete q.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=q.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function mt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function qt(t){return e.getComputedStyle(t,null)}function Ht(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=q.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=qt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return Ht(this,!0)},hide:function(){return Ht(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Lt(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=At(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=kt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||qt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Ct.test(a)&&wt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=qt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(xt[0].contentWindow||xt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Mt(e,t),xt.detach()),Nt[e]=n),n}function Mt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&bt.test(x.css(e,"display"))?x.swap(e,Et,function(){return Pt(e,t,r)}):Pt(e,t,r):undefined},set:function(e,n,r){var i=r&&qt(e);return Ot(e,n,r?Ft(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},vt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=vt(e,t),Ct.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+jt[r]+t]=o[r]||o[r-2]||o[0];return i}},wt.test(e)||(x.cssHooks[e+t].set=Ot)});var Wt=/%20/g,$t=/\[\]$/,Bt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,zt=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&zt.test(this.nodeName)&&!It.test(e)&&(this.checked||!ot.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(Bt,"\r\n")}}):{name:t.name,value:n.replace(Bt,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)_t(n,e[n],t,i);return r.join("&").replace(Wt,"+")};function _t(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||$t.test(e)?r(e,i):_t(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)_t(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)
+},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Xt,Ut,Yt=x.now(),Vt=/\?/,Gt=/#.*$/,Jt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Kt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Zt=/^(?:GET|HEAD)$/,en=/^\/\//,tn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,nn=x.fn.load,rn={},on={},sn="*/".concat("*");try{Ut=i.href}catch(an){Ut=o.createElement("a"),Ut.href="",Ut=Ut.href}Xt=tn.exec(Ut.toLowerCase())||[];function un(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ln(e,t,n,r){var i={},o=e===on;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function cn(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&nn)return nn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ut,type:"GET",isLocal:Kt.test(Xt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":sn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?cn(cn(e,x.ajaxSettings),t):cn(x.ajaxSettings,e)},ajaxPrefilter:un(rn),ajaxTransport:un(on),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),p=c.context||c,f=c.context&&(p.nodeType||p.jquery)?x(p):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Qt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Ut)+"").replace(Gt,"").replace(en,Xt[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=tn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===Xt[1]&&a[2]===Xt[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(Xt[3]||("http:"===Xt[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),ln(rn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Zt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Vt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Jt.test(r)?r.replace(Jt,"$1_="+Yt++):r+(Vt.test(r)?"&":"?")+"_="+Yt++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+sn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(p,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=ln(on,c,t,T)){T.readyState=1,u&&f.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=pn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e||"HEAD"===c.type?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(p,[m,C,T]):h.rejectWith(p,[T,C,y]),T.statusCode(g),g=undefined,u&&f.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(p,[T,C]),u&&(f.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function pn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(p){return{state:"parsererror",error:s?p:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var hn=[],dn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=hn.pop()||x.expando+"_"+Yt++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(dn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&dn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(dn,"$1"+i):t.jsonp!==!1&&(t.url+=(Vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,hn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var gn=x.ajaxSettings.xhr(),mn={0:200,1223:204},yn=0,vn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in vn)vn[e]();vn=undefined}),x.support.cors=!!gn&&"withCredentials"in gn,x.support.ajax=gn=!!gn,x.ajaxTransport(function(e){var t;return x.support.cors||gn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete vn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(mn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=vn[o=yn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var xn,bn,wn=/^(?:toggle|show|hide)$/,Tn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Cn=/queueHooks$/,kn=[An],Nn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Tn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),s=(x.cssNumber[e]||"px"!==o&&+r)&&Tn.exec(x.css(n.elem,e)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],i=i||[],s=+r||1;do a=a||".5",s/=a,x.style(n.elem,e,s+o);while(a!==(a=n.cur()/r)&&1!==a&&--u)}return i&&(s=n.start=+s||+r||0,n.unit=o,n.end=i[1]?s+(i[1]+1)*i[2]:+i[2]),n}]};function En(){return setTimeout(function(){xn=undefined}),xn=x.now()}function Sn(e,t,n){var r,i=(Nn[t]||[]).concat(Nn["*"]),o=0,s=i.length;for(;s>o;o++)if(r=i[o].call(n,t,e))return r}function jn(e,t,n){var r,i,o=0,s=kn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=xn||En(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:xn||En(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(Dn(c,l.opts.specialEasing);s>o;o++)if(r=kn[o].call(l,e,c,l.opts))return r;return x.map(c,Sn,l),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function Dn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(jn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Nn[n]=Nn[n]||[],Nn[n].unshift(t)},prefilter:function(e,t){t?kn.unshift(e):kn.push(e)}});function An(e,t,n){var r,i,o,s,a,u,l=this,c={},p=e.style,f=e.nodeType&&Lt(e),h=q.get(e,"fxshow");n.queue||(a=x._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,l.always(function(){l.always(function(){a.unqueued--,x.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",l.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],wn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||h[r]===undefined)continue;f=!0}c[r]=h&&h[r]||x.style(e,r)}if(!x.isEmptyObject(c)){h?"hidden"in h&&(f=h.hidden):h=q.access(e,"fxshow",{}),o&&(h.hidden=!f),f?x(e).show():l.done(function(){x(e).hide()}),l.done(function(){var t;q.remove(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)s=Sn(f?h[r]:0,r,l),r in h||(h[r]=s.start,f&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function Ln(e,t,n,r,i){return new Ln.prototype.init(e,t,n,r,i)}x.Tween=Ln,Ln.prototype={constructor:Ln,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=Ln.propHooks[this.prop];return e&&e.get?e.get(this):Ln.propHooks._default.get(this)},run:function(e){var t,n=Ln.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ln.propHooks._default.set(this),this}},Ln.prototype.init.prototype=Ln.prototype,Ln.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Ln.propHooks.scrollTop=Ln.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(qn(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Lt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=jn(this,x.extend({},e),o);(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Cn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function qn(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=jt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:qn("show"),slideUp:qn("hide"),slideToggle:qn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=Ln.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(xn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),xn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){bn||(bn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(bn),bn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=Hn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),p=x(e),f={};"static"===c&&(e.style.position="relative"),a=p.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=p.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+i),"using"in t?t.using.call(e,f):p.css(f)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=Hn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function Hn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map
new file mode 100644
index 000000000..1edecd1ae
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map
@@ -0,0 +1 @@
+{"version":3,"file":"jquery-2.0.3.min.js","sources":["jquery-2.0.3.js"],"names":["window","undefined","rootjQuery","readyList","core_strundefined","location","document","docElem","documentElement","_jQuery","jQuery","_$","$","class2type","core_deletedIds","core_version","core_concat","concat","core_push","push","core_slice","slice","core_indexOf","indexOf","core_toString","toString","core_hasOwn","hasOwnProperty","core_trim","trim","selector","context","fn","init","core_pnum","source","core_rnotwhite","rquickExpr","rsingleTag","rmsPrefix","rdashAlpha","fcamelCase","all","letter","toUpperCase","completed","removeEventListener","ready","prototype","jquery","constructor","match","elem","this","charAt","length","exec","find","merge","parseHTML","nodeType","ownerDocument","test","isPlainObject","isFunction","attr","getElementById","parentNode","makeArray","toArray","call","get","num","pushStack","elems","ret","prevObject","each","callback","args","promise","done","apply","arguments","first","eq","last","i","len","j","map","end","sort","splice","extend","options","name","src","copy","copyIsArray","clone","target","deep","isArray","expando","Math","random","replace","noConflict","isReady","readyWait","holdReady","hold","wait","resolveWith","trigger","off","obj","type","Array","isWindow","isNumeric","isNaN","parseFloat","isFinite","String","e","isEmptyObject","error","msg","Error","data","keepScripts","parsed","scripts","createElement","buildFragment","remove","childNodes","parseJSON","JSON","parse","parseXML","xml","tmp","DOMParser","parseFromString","getElementsByTagName","noop","globalEval","code","script","indirect","eval","text","head","appendChild","removeChild","camelCase","string","nodeName","toLowerCase","value","isArraylike","arr","results","Object","inArray","second","l","grep","inv","retVal","arg","guid","proxy","access","key","chainable","emptyGet","raw","bulk","now","Date","swap","old","style","Deferred","readyState","setTimeout","addEventListener","split","support","cachedruns","Expr","getText","isXML","compile","outermostContext","sortInput","setDocument","documentIsHTML","rbuggyQSA","rbuggyMatches","matches","contains","preferredDoc","dirruns","classCache","createCache","tokenCache","compilerCache","hasDuplicate","sortOrder","a","b","strundefined","MAX_NEGATIVE","hasOwn","pop","push_native","booleans","whitespace","characterEncoding","identifier","attributes","pseudos","rtrim","RegExp","rcomma","rcombinators","rsibling","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rnative","rinputs","rheader","rescape","runescape","funescape","_","escaped","escapedWhitespace","high","fromCharCode","els","Sizzle","seed","m","groups","nid","newContext","newSelector","id","getElementsByClassName","qsa","tokenize","getAttribute","setAttribute","toSelector","join","querySelectorAll","qsaError","removeAttribute","select","keys","cache","cacheLength","shift","markFunction","assert","div","addHandle","attrs","handler","attrHandle","siblingCheck","cur","diff","sourceIndex","nextSibling","createInputPseudo","createButtonPseudo","createPositionalPseudo","argument","matchIndexes","node","doc","parent","defaultView","attachEvent","top","className","createComment","innerHTML","firstChild","getById","getElementsByName","filter","attrId","getAttributeNode","tag","input","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","compareDocumentPosition","adown","bup","compare","sortDetached","aup","ap","bp","unshift","expr","elements","val","specified","uniqueSort","duplicates","detectDuplicates","sortStable","textContent","nodeValue","selectors","createPseudo","relative",">","dir"," ","+","~","preFilter","excess","unquoted","nodeNameSelector","pattern","operator","check","result","what","simple","forward","ofType","outerCache","nodeIndex","start","useCache","lastChild","pseudo","setFilters","idx","matched","not","matcher","unmatched","has","innerText","lang","elemLang","hash","root","focus","activeElement","hasFocus","href","tabIndex","enabled","disabled","checked","selected","selectedIndex","empty","header","button","even","odd","lt","gt","radio","checkbox","file","password","image","submit","reset","filters","parseOnly","tokens","soFar","preFilters","cached","addCombinator","combinator","base","checkNonElements","doneName","dirkey","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","matcherFromGroupMatchers","elementMatchers","setMatchers","matcherCachedRuns","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","group","contexts","token","div1","defaultValue","unique","isXMLDoc","optionsCache","createOptions","object","flag","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","list","stack","once","fire","stopOnFalse","self","disable","add","index","lock","locked","fireWith","func","tuples","state","always","deferred","fail","then","fns","newDefer","tuple","action","returned","resolve","reject","progress","notify","pipe","stateString","when","subordinate","resolveValues","remaining","updateFunc","values","progressValues","notifyWith","progressContexts","resolveContexts","fragment","createDocumentFragment","opt","checkOn","optSelected","reliableMarginRight","boxSizingReliable","pixelPosition","noCloneChecked","cloneNode","optDisabled","radioValue","checkClone","focusinBubbles","backgroundClip","clearCloneStyle","container","marginDiv","divReset","body","cssText","zoom","boxSizing","offsetWidth","getComputedStyle","width","marginRight","data_user","data_priv","rbrace","rmultiDash","Data","defineProperty","uid","accepts","owner","descriptor","unlock","defineProperties","set","prop","stored","camel","hasData","discard","acceptData","removeData","_data","_removeData","dataAttr","camelKey","queue","dequeue","startLength","hooks","_queueHooks","next","stop","setter","delay","time","fx","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","rclass","rreturn","rfocusable","removeAttr","removeProp","propFix","addClass","classes","clazz","proceed","removeClass","toggleClass","stateVal","classNames","hasClass","valHooks","option","one","max","optionSet","nType","attrHooks","propName","attrNames","for","class","notxml","propHooks","hasAttribute","getter","rkeyEvent","rmouseEvent","rfocusMorph","rtypenamespace","returnTrue","returnFalse","safeActiveElement","err","event","global","types","handleObjIn","eventHandle","events","t","handleObj","special","handlers","namespaces","origType","elemData","handle","triggered","dispatch","delegateType","bindType","namespace","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","onlyHandlers","bubbleType","ontype","eventPath","Event","isTrigger","namespace_re","noBubble","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","props","fixHooks","keyHooks","original","which","charCode","keyCode","mouseHooks","eventDoc","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","originalEvent","fixHook","load","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","getPreventDefault","timeStamp","stopImmediatePropagation","mouseenter","mouseleave","orig","related","relatedTarget","attaches","on","origFn","triggerHandler","isSimple","rparentsprev","rneedsContext","guaranteedUnique","children","contents","prev","targets","winnow","is","closest","pos","prevAll","addBack","sibling","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","contentDocument","reverse","truncate","n","qualifier","rxhtmlTag","rtagName","rhtml","rnoInnerhtml","manipulation_rcheckableType","rchecked","rscriptType","rscriptTypeMasked","rcleanScript","wrapMap","thead","col","tr","td","optgroup","tbody","tfoot","colgroup","caption","th","append","createTextNode","domManip","manipulationTarget","prepend","insertBefore","before","after","keepData","cleanData","getAll","setGlobalEval","dataAndEvents","deepDataAndEvents","html","replaceWith","detach","allowIntersection","hasScripts","iNoClone","disableScript","restoreScript","_evalUrl","appendTo","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","inPage","fixInput","cloneCopyEvent","selection","wrap","nodes","url","ajax","dataType","async","throws","content","refElements","dest","pdataOld","pdataCur","udataOld","udataCur","wrapAll","firstElementChild","wrapInner","unwrap","curCSS","iframe","rdisplayswap","rmargin","rnumsplit","rnumnonpx","rrelNum","elemdisplay","BODY","cssShow","position","visibility","display","cssNormalTransform","letterSpacing","fontWeight","cssExpand","cssPrefixes","vendorPropName","capName","origName","isHidden","el","css","getStyles","showHide","show","hidden","css_defaultDisplay","styles","hide","toggle","cssHooks","opacity","computed","cssNumber","columnCount","fillOpacity","lineHeight","order","orphans","widows","zIndex","cssProps","float","extra","_computed","minWidth","maxWidth","getPropertyValue","setPositiveNumber","subtract","augmentWidthOrHeight","isBorderBox","getWidthOrHeight","valueIsBorderBox","offsetHeight","actualDisplay","contentWindow","write","close","visible","margin","padding","border","prefix","suffix","expand","expanded","parts","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","serialize","param","serializeArray","traditional","s","encodeURIComponent","ajaxSettings","buildParams","v","hover","fnOver","fnOut","bind","unbind","delegate","undelegate","ajaxLocParts","ajaxLocation","ajax_nonce","ajax_rquery","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","_load","prefilters","transports","allTypes","addToPrefiltersOrTransports","structure","dataTypeExpression","dataTypes","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","params","response","responseText","complete","status","active","lastModified","etag","isLocal","processData","contentType","*","json","responseFields","converters","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","fireGlobals","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","mimeType","abort","statusText","finalText","success","method","crossDomain","hasContent","ifModified","headers","beforeSend","send","nativeStatusText","responses","isSuccess","modified","ajaxHandleResponses","ajaxConvert","rejectWith","getJSON","getScript","ct","finalDataType","firstDataType","conv2","current","conv","dataFilter","text script","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","xhr","XMLHttpRequest","xhrSupported","xhrSuccessStatus",1223,"xhrId","xhrCallbacks","ActiveXObject","cors","open","username","xhrFields","onload","onerror","fxNow","timerId","rfxtypes","rfxnum","rrun","animationPrefilters","defaultPrefilter","tweeners","tween","createTween","unit","scale","maxIterations","createFxNow","animation","collection","Animation","properties","stopped","tick","currentTime","startTime","duration","percent","tweens","run","opts","specialEasing","originalProperties","Tween","easing","gotoEnd","propFilter","timer","anim","tweener","prefilter","oldfire","dataShow","unqueued","overflow","overflowX","overflowY","eased","step","cssFn","speed","animate","genFx","fadeTo","to","optall","doAnimation","finish","stopQueue","timers","includeWidth","height","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","interval","setInterval","clearInterval","slow","fast","animated","offset","setOffset","win","box","left","getBoundingClientRect","getWindow","pageYOffset","pageXOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","using","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","size","andSelf","module","exports","define","amd"],"mappings":";;;CAaA,SAAWA,EAAQC,WAOnB,GAECC,GAGAC,EAIAC,QAA2BH,WAG3BI,EAAWL,EAAOK,SAClBC,EAAWN,EAAOM,SAClBC,EAAUD,EAASE,gBAGnBC,EAAUT,EAAOU,OAGjBC,EAAKX,EAAOY,EAGZC,KAGAC,KAEAC,EAAe,QAGfC,EAAcF,EAAgBG,OAC9BC,EAAYJ,EAAgBK,KAC5BC,EAAaN,EAAgBO,MAC7BC,EAAeR,EAAgBS,QAC/BC,EAAgBX,EAAWY,SAC3BC,EAAcb,EAAWc,eACzBC,EAAYb,EAAac,KAGzBnB,EAAS,SAAUoB,EAAUC,GAE5B,MAAO,IAAIrB,GAAOsB,GAAGC,KAAMH,EAAUC,EAAS7B,IAI/CgC,EAAY,sCAAsCC,OAGlDC,EAAiB,OAKjBC,EAAa,sCAGbC,EAAa,6BAGbC,EAAY,QACZC,EAAa,eAGbC,EAAa,SAAUC,EAAKC,GAC3B,MAAOA,GAAOC,eAIfC,EAAY,WACXvC,EAASwC,oBAAqB,mBAAoBD,GAAW,GAC7D7C,EAAO8C,oBAAqB,OAAQD,GAAW,GAC/CnC,EAAOqC,QAGTrC,GAAOsB,GAAKtB,EAAOsC,WAElBC,OAAQlC,EAERmC,YAAaxC,EACbuB,KAAM,SAAUH,EAAUC,EAAS7B,GAClC,GAAIiD,GAAOC,CAGX,KAAMtB,EACL,MAAOuB,KAIR,IAAyB,gBAAbvB,GAAwB,CAUnC,GAPCqB,EAF2B,MAAvBrB,EAASwB,OAAO,IAAyD,MAA3CxB,EAASwB,OAAQxB,EAASyB,OAAS,IAAezB,EAASyB,QAAU,GAE7F,KAAMzB,EAAU,MAGlBO,EAAWmB,KAAM1B,IAIrBqB,IAAUA,EAAM,IAAOpB,EA+CrB,OAAMA,GAAWA,EAAQkB,QACtBlB,GAAW7B,GAAauD,KAAM3B,GAKhCuB,KAAKH,YAAanB,GAAU0B,KAAM3B,EAlDzC,IAAKqB,EAAM,GAAK,CAWf,GAVApB,EAAUA,YAAmBrB,GAASqB,EAAQ,GAAKA,EAGnDrB,EAAOgD,MAAOL,KAAM3C,EAAOiD,UAC1BR,EAAM,GACNpB,GAAWA,EAAQ6B,SAAW7B,EAAQ8B,eAAiB9B,EAAUzB,GACjE,IAIIgC,EAAWwB,KAAMX,EAAM,KAAQzC,EAAOqD,cAAehC,GACzD,IAAMoB,IAASpB,GAETrB,EAAOsD,WAAYX,KAAMF,IAC7BE,KAAMF,GAASpB,EAASoB,IAIxBE,KAAKY,KAAMd,EAAOpB,EAASoB,GAK9B,OAAOE,MAgBP,MAZAD,GAAO9C,EAAS4D,eAAgBf,EAAM,IAIjCC,GAAQA,EAAKe,aAEjBd,KAAKE,OAAS,EACdF,KAAK,GAAKD,GAGXC,KAAKtB,QAAUzB,EACf+C,KAAKvB,SAAWA,EACTuB,KAcH,MAAKvB,GAAS8B,UACpBP,KAAKtB,QAAUsB,KAAK,GAAKvB,EACzBuB,KAAKE,OAAS,EACPF,MAII3C,EAAOsD,WAAYlC,GACvB5B,EAAW6C,MAAOjB,IAGrBA,EAASA,WAAa7B,YAC1BoD,KAAKvB,SAAWA,EAASA,SACzBuB,KAAKtB,QAAUD,EAASC,SAGlBrB,EAAO0D,UAAWtC,EAAUuB,QAIpCvB,SAAU,GAGVyB,OAAQ,EAERc,QAAS,WACR,MAAOjD,GAAWkD,KAAMjB,OAKzBkB,IAAK,SAAUC,GACd,MAAc,OAAPA,EAGNnB,KAAKgB,UAGG,EAANG,EAAUnB,KAAMA,KAAKE,OAASiB,GAAQnB,KAAMmB,IAKhDC,UAAW,SAAUC,GAGpB,GAAIC,GAAMjE,EAAOgD,MAAOL,KAAKH,cAAewB,EAO5C,OAJAC,GAAIC,WAAavB,KACjBsB,EAAI5C,QAAUsB,KAAKtB,QAGZ4C,GAMRE,KAAM,SAAUC,EAAUC,GACzB,MAAOrE,GAAOmE,KAAMxB,KAAMyB,EAAUC,IAGrChC,MAAO,SAAUf,GAIhB,MAFAtB,GAAOqC,MAAMiC,UAAUC,KAAMjD,GAEtBqB,MAGRhC,MAAO,WACN,MAAOgC,MAAKoB,UAAWrD,EAAW8D,MAAO7B,KAAM8B,aAGhDC,MAAO,WACN,MAAO/B,MAAKgC,GAAI,IAGjBC,KAAM,WACL,MAAOjC,MAAKgC,GAAI,KAGjBA,GAAI,SAAUE,GACb,GAAIC,GAAMnC,KAAKE,OACdkC,GAAKF,GAAU,EAAJA,EAAQC,EAAM,EAC1B,OAAOnC,MAAKoB,UAAWgB,GAAK,GAASD,EAAJC,GAAYpC,KAAKoC,SAGnDC,IAAK,SAAUZ,GACd,MAAOzB,MAAKoB,UAAW/D,EAAOgF,IAAIrC,KAAM,SAAUD,EAAMmC,GACvD,MAAOT,GAASR,KAAMlB,EAAMmC,EAAGnC,OAIjCuC,IAAK,WACJ,MAAOtC,MAAKuB,YAAcvB,KAAKH,YAAY,OAK5C/B,KAAMD,EACN0E,QAASA,KACTC,UAAWA,QAIZnF,EAAOsB,GAAGC,KAAKe,UAAYtC,EAAOsB,GAElCtB,EAAOoF,OAASpF,EAAOsB,GAAG8D,OAAS,WAClC,GAAIC,GAASC,EAAMC,EAAKC,EAAMC,EAAaC,EAC1CC,EAASlB,UAAU,OACnBI,EAAI,EACJhC,EAAS4B,UAAU5B,OACnB+C,GAAO,CAqBR,KAlBuB,iBAAXD,KACXC,EAAOD,EACPA,EAASlB,UAAU,OAEnBI,EAAI,GAIkB,gBAAXc,IAAwB3F,EAAOsD,WAAWqC,KACrDA,MAII9C,IAAWgC,IACfc,EAAShD,OACPkC,GAGShC,EAAJgC,EAAYA,IAEnB,GAAmC,OAA7BQ,EAAUZ,UAAWI,IAE1B,IAAMS,IAAQD,GACbE,EAAMI,EAAQL,GACdE,EAAOH,EAASC,GAGXK,IAAWH,IAKXI,GAAQJ,IAAUxF,EAAOqD,cAAcmC,KAAUC,EAAczF,EAAO6F,QAAQL,MAC7EC,GACJA,GAAc,EACdC,EAAQH,GAAOvF,EAAO6F,QAAQN,GAAOA,MAGrCG,EAAQH,GAAOvF,EAAOqD,cAAckC,GAAOA,KAI5CI,EAAQL,GAAStF,EAAOoF,OAAQQ,EAAMF,EAAOF,IAGlCA,IAASjG,YACpBoG,EAAQL,GAASE,GAOrB,OAAOG,IAGR3F,EAAOoF,QAENU,QAAS,UAAazF,EAAe0F,KAAKC,UAAWC,QAAS,MAAO,IAErEC,WAAY,SAAUN,GASrB,MARKtG,GAAOY,IAAMF,IACjBV,EAAOY,EAAID,GAGP2F,GAAQtG,EAAOU,SAAWA,IAC9BV,EAAOU,OAASD,GAGVC,GAIRmG,SAAS,EAITC,UAAW,EAGXC,UAAW,SAAUC,GACfA,EACJtG,EAAOoG,YAEPpG,EAAOqC,OAAO,IAKhBA,MAAO,SAAUkE,IAGXA,KAAS,IAASvG,EAAOoG,UAAYpG,EAAOmG,WAKjDnG,EAAOmG,SAAU,EAGZI,KAAS,KAAUvG,EAAOoG,UAAY,IAK3C3G,EAAU+G,YAAa5G,GAAYI,IAG9BA,EAAOsB,GAAGmF,SACdzG,EAAQJ,GAAW6G,QAAQ,SAASC,IAAI,YAO1CpD,WAAY,SAAUqD,GACrB,MAA4B,aAArB3G,EAAO4G,KAAKD,IAGpBd,QAASgB,MAAMhB,QAEfiB,SAAU,SAAUH,GACnB,MAAc,OAAPA,GAAeA,IAAQA,EAAIrH,QAGnCyH,UAAW,SAAUJ,GACpB,OAAQK,MAAOC,WAAWN,KAAUO,SAAUP,IAG/CC,KAAM,SAAUD,GACf,MAAY,OAAPA,EACWA,EAARQ,GAGc,gBAARR,IAAmC,kBAARA,GACxCxG,EAAYW,EAAc8C,KAAK+C,KAAU,eAClCA,IAGTtD,cAAe,SAAUsD,GAKxB,GAA4B,WAAvB3G,EAAO4G,KAAMD,IAAsBA,EAAIzD,UAAYlD,EAAO8G,SAAUH,GACxE,OAAO,CAOR,KACC,GAAKA,EAAInE,cACNxB,EAAY4C,KAAM+C,EAAInE,YAAYF,UAAW,iBAC/C,OAAO,EAEP,MAAQ8E,GACT,OAAO,EAKR,OAAO,GAGRC,cAAe,SAAUV,GACxB,GAAIrB,EACJ,KAAMA,IAAQqB,GACb,OAAO,CAER,QAAO,GAGRW,MAAO,SAAUC,GAChB,KAAUC,OAAOD,IAMlBtE,UAAW,SAAUwE,EAAMpG,EAASqG,GACnC,IAAMD,GAAwB,gBAATA,GACpB,MAAO,KAEgB,kBAAZpG,KACXqG,EAAcrG,EACdA,GAAU,GAEXA,EAAUA,GAAWzB,CAErB,IAAI+H,GAAS/F,EAAWkB,KAAM2E,GAC7BG,GAAWF,KAGZ,OAAKC,IACKtG,EAAQwG,cAAeF,EAAO,MAGxCA,EAAS3H,EAAO8H,eAAiBL,GAAQpG,EAASuG,GAE7CA,GACJ5H,EAAQ4H,GAAUG,SAGZ/H,EAAOgD,SAAW2E,EAAOK,cAGjCC,UAAWC,KAAKC,MAGhBC,SAAU,SAAUX,GACnB,GAAIY,GAAKC,CACT,KAAMb,GAAwB,gBAATA,GACpB,MAAO,KAIR,KACCa,EAAM,GAAIC,WACVF,EAAMC,EAAIE,gBAAiBf,EAAO,YACjC,MAAQL,GACTiB,EAAM9I,UAMP,QAHM8I,GAAOA,EAAII,qBAAsB,eAAgB5F,SACtD7C,EAAOsH,MAAO,gBAAkBG,GAE1BY,GAGRK,KAAM,aAGNC,WAAY,SAAUC,GACrB,GAAIC,GACFC,EAAWC,IAEbH,GAAO5I,EAAOmB,KAAMyH,GAEfA,IAIgC,IAA/BA,EAAK/H,QAAQ,eACjBgI,EAASjJ,EAASiI,cAAc,UAChCgB,EAAOG,KAAOJ,EACdhJ,EAASqJ,KAAKC,YAAaL,GAASpF,WAAW0F,YAAaN,IAI5DC,EAAUF,KAObQ,UAAW,SAAUC,GACpB,MAAOA,GAAOpD,QAASpE,EAAW,OAAQoE,QAASnE,EAAYC,IAGhEuH,SAAU,SAAU5G,EAAM4C,GACzB,MAAO5C,GAAK4G,UAAY5G,EAAK4G,SAASC,gBAAkBjE,EAAKiE,eAI9DpF,KAAM,SAAUwC,EAAKvC,EAAUC,GAC9B,GAAImF,GACH3E,EAAI,EACJhC,EAAS8D,EAAI9D,OACbgD,EAAU4D,EAAa9C,EAExB,IAAKtC,GACJ,GAAKwB,GACJ,KAAYhD,EAAJgC,EAAYA,IAGnB,GAFA2E,EAAQpF,EAASI,MAAOmC,EAAK9B,GAAKR,GAE7BmF,KAAU,EACd,UAIF,KAAM3E,IAAK8B,GAGV,GAFA6C,EAAQpF,EAASI,MAAOmC,EAAK9B,GAAKR,GAE7BmF,KAAU,EACd,UAOH,IAAK3D,GACJ,KAAYhD,EAAJgC,EAAYA,IAGnB,GAFA2E,EAAQpF,EAASR,KAAM+C,EAAK9B,GAAKA,EAAG8B,EAAK9B,IAEpC2E,KAAU,EACd,UAIF,KAAM3E,IAAK8B,GAGV,GAFA6C,EAAQpF,EAASR,KAAM+C,EAAK9B,GAAKA,EAAG8B,EAAK9B,IAEpC2E,KAAU,EACd,KAMJ,OAAO7C,IAGRxF,KAAM,SAAU6H,GACf,MAAe,OAARA,EAAe,GAAK9H,EAAU0C,KAAMoF,IAI5CtF,UAAW,SAAUgG,EAAKC,GACzB,GAAI1F,GAAM0F,KAaV,OAXY,OAAPD,IACCD,EAAaG,OAAOF,IACxB1J,EAAOgD,MAAOiB,EACE,gBAARyF,IACLA,GAAQA,GAGXlJ,EAAUoD,KAAMK,EAAKyF,IAIhBzF,GAGR4F,QAAS,SAAUnH,EAAMgH,EAAK7E,GAC7B,MAAc,OAAP6E,EAAc,GAAK9I,EAAagD,KAAM8F,EAAKhH,EAAMmC,IAGzD7B,MAAO,SAAU0B,EAAOoF,GACvB,GAAIC,GAAID,EAAOjH,OACdgC,EAAIH,EAAM7B,OACVkC,EAAI,CAEL,IAAkB,gBAANgF,GACX,KAAYA,EAAJhF,EAAOA,IACdL,EAAOG,KAAQiF,EAAQ/E,OAGxB,OAAQ+E,EAAO/E,KAAOxF,UACrBmF,EAAOG,KAAQiF,EAAQ/E,IAMzB,OAFAL,GAAM7B,OAASgC,EAERH,GAGRsF,KAAM,SAAUhG,EAAOI,EAAU6F,GAChC,GAAIC,GACHjG,KACAY,EAAI,EACJhC,EAASmB,EAAMnB,MAKhB,KAJAoH,IAAQA,EAIIpH,EAAJgC,EAAYA,IACnBqF,IAAW9F,EAAUJ,EAAOa,GAAKA,GAC5BoF,IAAQC,GACZjG,EAAIxD,KAAMuD,EAAOa,GAInB,OAAOZ,IAIRe,IAAK,SAAUhB,EAAOI,EAAU+F,GAC/B,GAAIX,GACH3E,EAAI,EACJhC,EAASmB,EAAMnB,OACfgD,EAAU4D,EAAazF,GACvBC,IAGD,IAAK4B,EACJ,KAAYhD,EAAJgC,EAAYA,IACnB2E,EAAQpF,EAAUJ,EAAOa,GAAKA,EAAGsF,GAEnB,MAATX,IACJvF,EAAKA,EAAIpB,QAAW2G,OAMtB,KAAM3E,IAAKb,GACVwF,EAAQpF,EAAUJ,EAAOa,GAAKA,EAAGsF,GAEnB,MAATX,IACJvF,EAAKA,EAAIpB,QAAW2G,EAMvB,OAAOlJ,GAAYkE,SAAWP,IAI/BmG,KAAM,EAINC,MAAO,SAAU/I,EAAID,GACpB,GAAIiH,GAAKjE,EAAMgG,CAUf,OARwB,gBAAZhJ,KACXiH,EAAMhH,EAAID,GACVA,EAAUC,EACVA,EAAKgH,GAKAtI,EAAOsD,WAAYhC,IAKzB+C,EAAO3D,EAAWkD,KAAMa,UAAW,GACnC4F,EAAQ,WACP,MAAO/I,GAAGkD,MAAOnD,GAAWsB,KAAM0B,EAAK9D,OAAQG,EAAWkD,KAAMa,cAIjE4F,EAAMD,KAAO9I,EAAG8I,KAAO9I,EAAG8I,MAAQpK,EAAOoK,OAElCC,GAZC9K,WAiBT+K,OAAQ,SAAUtG,EAAO1C,EAAIiJ,EAAKf,EAAOgB,EAAWC,EAAUC,GAC7D,GAAI7F,GAAI,EACPhC,EAASmB,EAAMnB,OACf8H,EAAc,MAAPJ,CAGR,IAA4B,WAAvBvK,EAAO4G,KAAM2D,GAAqB,CACtCC,GAAY,CACZ,KAAM3F,IAAK0F,GACVvK,EAAOsK,OAAQtG,EAAO1C,EAAIuD,EAAG0F,EAAI1F,IAAI,EAAM4F,EAAUC,OAIhD,IAAKlB,IAAUjK,YACrBiL,GAAY,EAENxK,EAAOsD,WAAYkG,KACxBkB,GAAM,GAGFC,IAECD,GACJpJ,EAAGsC,KAAMI,EAAOwF,GAChBlI,EAAK,OAILqJ,EAAOrJ,EACPA,EAAK,SAAUoB,EAAM6H,EAAKf,GACzB,MAAOmB,GAAK/G,KAAM5D,EAAQ0C,GAAQ8G,MAKhClI,GACJ,KAAYuB,EAAJgC,EAAYA,IACnBvD,EAAI0C,EAAMa,GAAI0F,EAAKG,EAAMlB,EAAQA,EAAM5F,KAAMI,EAAMa,GAAIA,EAAGvD,EAAI0C,EAAMa,GAAI0F,IAK3E,OAAOC,GACNxG,EAGA2G,EACCrJ,EAAGsC,KAAMI,GACTnB,EAASvB,EAAI0C,EAAM,GAAIuG,GAAQE,GAGlCG,IAAKC,KAAKD,IAKVE,KAAM,SAAUpI,EAAM2C,EAASjB,EAAUC,GACxC,GAAIJ,GAAKqB,EACRyF,IAGD,KAAMzF,IAAQD,GACb0F,EAAKzF,GAAS5C,EAAKsI,MAAO1F,GAC1B5C,EAAKsI,MAAO1F,GAASD,EAASC,EAG/BrB,GAAMG,EAASI,MAAO9B,EAAM2B,MAG5B,KAAMiB,IAAQD,GACb3C,EAAKsI,MAAO1F,GAASyF,EAAKzF,EAG3B,OAAOrB,MAITjE,EAAOqC,MAAMiC,QAAU,SAAUqC,GAqBhC,MApBMlH,KAELA,EAAYO,EAAOiL,WAKU,aAAxBrL,EAASsL,WAEbC,WAAYnL,EAAOqC,QAKnBzC,EAASwL,iBAAkB,mBAAoBjJ,GAAW,GAG1D7C,EAAO8L,iBAAkB,OAAQjJ,GAAW,KAGvC1C,EAAU6E,QAASqC,IAI3B3G,EAAOmE,KAAK,gEAAgEkH,MAAM,KAAM,SAASxG,EAAGS,GACnGnF,EAAY,WAAamF,EAAO,KAAQA,EAAKiE,eAG9C,SAASE,GAAa9C,GACrB,GAAI9D,GAAS8D,EAAI9D,OAChB+D,EAAO5G,EAAO4G,KAAMD,EAErB,OAAK3G,GAAO8G,SAAUH,IACd,EAGc,IAAjBA,EAAIzD,UAAkBL,GACnB,EAGQ,UAAT+D,GAA6B,aAATA,IACb,IAAX/D,GACgB,gBAAXA,IAAuBA,EAAS,GAAOA,EAAS,IAAO8D,IAIhEnH,EAAaQ,EAAOJ,GAWpB,SAAWN,EAAQC,WAEnB,GAAIsF,GACHyG,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EAGAC,EACAlM,EACAC,EACAkM,EACAC,EACAC,EACAC,EACAC,EAGArG,EAAU,UAAY,GAAK+E,MAC3BuB,EAAe9M,EAAOM,SACtByM,EAAU,EACV9H,EAAO,EACP+H,EAAaC,KACbC,EAAaD,KACbE,EAAgBF,KAChBG,GAAe,EACfC,EAAY,SAAUC,EAAGC,GACxB,MAAKD,KAAMC,GACVH,GAAe,EACR,GAED,GAIRI,QAAsBvN,WACtBwN,EAAe,GAAK,GAGpBC,KAAc/L,eACdyI,KACAuD,EAAMvD,EAAIuD,IACVC,EAAcxD,EAAIjJ,KAClBA,EAAOiJ,EAAIjJ,KACXE,EAAQ+I,EAAI/I,MAEZE,EAAU6I,EAAI7I,SAAW,SAAU6B,GAClC,GAAImC,GAAI,EACPC,EAAMnC,KAAKE,MACZ,MAAYiC,EAAJD,EAASA,IAChB,GAAKlC,KAAKkC,KAAOnC,EAChB,MAAOmC,EAGT,OAAO,IAGRsI,EAAW,6HAKXC,EAAa,sBAEbC,EAAoB,mCAKpBC,EAAaD,EAAkBpH,QAAS,IAAK,MAG7CsH,EAAa,MAAQH,EAAa,KAAOC,EAAoB,IAAMD,EAClE,mBAAqBA,EAAa,wCAA0CE,EAAa,QAAUF,EAAa,OAQjHI,EAAU,KAAOH,EAAoB,mEAAqEE,EAAWtH,QAAS,EAAG,GAAM,eAGvIwH,EAAYC,OAAQ,IAAMN,EAAa,8BAAgCA,EAAa,KAAM,KAE1FO,EAAaD,OAAQ,IAAMN,EAAa,KAAOA,EAAa,KAC5DQ,EAAmBF,OAAQ,IAAMN,EAAa,WAAaA,EAAa,IAAMA,EAAa,KAE3FS,EAAeH,OAAQN,EAAa,SACpCU,EAAuBJ,OAAQ,IAAMN,EAAa,gBAAkBA,EAAa,OAAQ,KAEzFW,EAAcL,OAAQF,GACtBQ,EAAkBN,OAAQ,IAAMJ,EAAa,KAE7CW,GACCC,GAAUR,OAAQ,MAAQL,EAAoB,KAC9Cc,MAAaT,OAAQ,QAAUL,EAAoB,KACnDe,IAAWV,OAAQ,KAAOL,EAAkBpH,QAAS,IAAK,MAAS,KACnEoI,KAAYX,OAAQ,IAAMH,GAC1Be,OAAcZ,OAAQ,IAAMF,GAC5Be,MAAab,OAAQ,yDAA2DN,EAC/E,+BAAiCA,EAAa,cAAgBA,EAC9D,aAAeA,EAAa,SAAU,KACvCoB,KAAYd,OAAQ,OAASP,EAAW,KAAM,KAG9CsB,aAAoBf,OAAQ,IAAMN,EAAa,mDAC9CA,EAAa,mBAAqBA,EAAa,mBAAoB,MAGrEsB,EAAU,yBAGV/M,EAAa,mCAEbgN,EAAU,sCACVC,GAAU,SAEVC,GAAU,QAGVC,GAAgBpB,OAAQ,qBAAuBN,EAAa,MAAQA,EAAa,OAAQ,MACzF2B,GAAY,SAAUC,EAAGC,EAASC,GACjC,GAAIC,GAAO,KAAOF,EAAU,KAI5B,OAAOE,KAASA,GAAQD,EACvBD,EAEO,EAAPE,EACChI,OAAOiI,aAAcD,EAAO,OAE5BhI,OAAOiI,aAA2B,MAAbD,GAAQ,GAA4B,MAAR,KAAPA,GAI9C,KACC1O,EAAK+D,MACHkF,EAAM/I,EAAMiD,KAAMwI,EAAapE,YAChCoE,EAAapE,YAId0B,EAAK0C,EAAapE,WAAWnF,QAASK,SACrC,MAAQkE,IACT3G,GAAS+D,MAAOkF,EAAI7G,OAGnB,SAAU8C,EAAQ0J,GACjBnC,EAAY1I,MAAOmB,EAAQhF,EAAMiD,KAAKyL,KAKvC,SAAU1J,EAAQ0J,GACjB,GAAItK,GAAIY,EAAO9C,OACdgC,EAAI,CAEL,OAASc,EAAOZ,KAAOsK,EAAIxK,MAC3Bc,EAAO9C,OAASkC,EAAI,IAKvB,QAASuK,IAAQlO,EAAUC,EAASsI,EAAS4F,GAC5C,GAAI9M,GAAOC,EAAM8M,EAAGtM,EAEnB2B,EAAG4K,EAAQ1E,EAAK2E,EAAKC,EAAYC,CASlC,KAPOvO,EAAUA,EAAQ8B,eAAiB9B,EAAU+K,KAAmBxM,GACtEkM,EAAazK,GAGdA,EAAUA,GAAWzB,EACrB+J,EAAUA,OAEJvI,GAAgC,gBAAbA,GACxB,MAAOuI,EAGR,IAAuC,KAAjCzG,EAAW7B,EAAQ6B,WAAgC,IAAbA,EAC3C,QAGD,IAAK6I,IAAmBwD,EAAO,CAG9B,GAAM9M,EAAQd,EAAWmB,KAAM1B,GAE9B,GAAMoO,EAAI/M,EAAM,IACf,GAAkB,IAAbS,EAAiB,CAIrB,GAHAR,EAAOrB,EAAQmC,eAAgBgM,IAG1B9M,IAAQA,EAAKe,WAQjB,MAAOkG,EALP,IAAKjH,EAAKmN,KAAOL,EAEhB,MADA7F,GAAQlJ,KAAMiC,GACPiH,MAOT,IAAKtI,EAAQ8B,gBAAkBT,EAAOrB,EAAQ8B,cAAcK,eAAgBgM,KAC3ErD,EAAU9K,EAASqB,IAAUA,EAAKmN,KAAOL,EAEzC,MADA7F,GAAQlJ,KAAMiC,GACPiH,MAKH,CAAA,GAAKlH,EAAM,GAEjB,MADAhC,GAAK+D,MAAOmF,EAAStI,EAAQoH,qBAAsBrH,IAC5CuI,CAGD,KAAM6F,EAAI/M,EAAM,KAAO6I,EAAQwE,wBAA0BzO,EAAQyO,uBAEvE,MADArP,GAAK+D,MAAOmF,EAAStI,EAAQyO,uBAAwBN,IAC9C7F,EAKT,GAAK2B,EAAQyE,OAAS/D,IAAcA,EAAU5I,KAAMhC,IAAc,CASjE,GARAsO,EAAM3E,EAAMjF,EACZ6J,EAAatO,EACbuO,EAA2B,IAAb1M,GAAkB9B,EAMd,IAAb8B,GAAqD,WAAnC7B,EAAQiI,SAASC,cAA6B,CACpEkG,EAASO,GAAU5O,IAEb2J,EAAM1J,EAAQ4O,aAAa,OAChCP,EAAM3E,EAAI9E,QAAS4I,GAAS,QAE5BxN,EAAQ6O,aAAc,KAAMR,GAE7BA,EAAM,QAAUA,EAAM,MAEtB7K,EAAI4K,EAAO5M,MACX,OAAQgC,IACP4K,EAAO5K,GAAK6K,EAAMS,GAAYV,EAAO5K,GAEtC8K,GAAa9B,EAASzK,KAAMhC,IAAcC,EAAQoC,YAAcpC,EAChEuO,EAAcH,EAAOW,KAAK,KAG3B,GAAKR,EACJ,IAIC,MAHAnP,GAAK+D,MAAOmF,EACXgG,EAAWU,iBAAkBT,IAEvBjG,EACN,MAAM2G,IACN,QACKvF,GACL1J,EAAQkP,gBAAgB,QAQ7B,MAAOC,IAAQpP,EAAS6E,QAASwH,EAAO,MAAQpM,EAASsI,EAAS4F,GASnE,QAAShD,MACR,GAAIkE,KAEJ,SAASC,GAAOnG,EAAKf,GAMpB,MAJKiH,GAAKhQ,KAAM8J,GAAO,KAAQiB,EAAKmF,mBAE5BD,GAAOD,EAAKG,SAEZF,EAAOnG,GAAQf,EAExB,MAAOkH,GAOR,QAASG,IAAcvP,GAEtB,MADAA,GAAIwE,IAAY,EACTxE,EAOR,QAASwP,IAAQxP,GAChB,GAAIyP,GAAMnR,EAASiI,cAAc,MAEjC,KACC,QAASvG,EAAIyP,GACZ,MAAO3J,GACR,OAAO,EACN,QAEI2J,EAAItN,YACRsN,EAAItN,WAAW0F,YAAa4H,GAG7BA,EAAM,MASR,QAASC,IAAWC,EAAOC,GAC1B,GAAIxH,GAAMuH,EAAM5F,MAAM,KACrBxG,EAAIoM,EAAMpO,MAEX,OAAQgC,IACP2G,EAAK2F,WAAYzH,EAAI7E,IAAOqM,EAU9B,QAASE,IAAcxE,EAAGC,GACzB,GAAIwE,GAAMxE,GAAKD,EACd0E,EAAOD,GAAsB,IAAfzE,EAAE1J,UAAiC,IAAf2J,EAAE3J,YAChC2J,EAAE0E,aAAexE,KACjBH,EAAE2E,aAAexE,EAGtB,IAAKuE,EACJ,MAAOA,EAIR,IAAKD,EACJ,MAASA,EAAMA,EAAIG,YAClB,GAAKH,IAAQxE,EACZ,MAAO,EAKV,OAAOD,GAAI,EAAI,GAOhB,QAAS6E,IAAmB7K,GAC3B,MAAO,UAAUlE,GAChB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,OAAgB,UAATjE,GAAoB5C,EAAKkE,OAASA,GAQ3C,QAAS8K,IAAoB9K,GAC5B,MAAO,UAAUlE,GAChB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,QAAiB,UAATjE,GAA6B,WAATA,IAAsB5C,EAAKkE,OAASA,GAQlE,QAAS+K,IAAwBrQ,GAChC,MAAOuP,IAAa,SAAUe,GAE7B,MADAA,IAAYA,EACLf,GAAa,SAAUtB,EAAMrD,GACnC,GAAInH,GACH8M,EAAevQ,KAAQiO,EAAK1M,OAAQ+O,GACpC/M,EAAIgN,EAAahP,MAGlB,OAAQgC,IACF0K,EAAOxK,EAAI8M,EAAahN,MAC5B0K,EAAKxK,KAAOmH,EAAQnH,GAAKwK,EAAKxK,SAWnC2G,EAAQ4D,GAAO5D,MAAQ,SAAUhJ,GAGhC,GAAI5C,GAAkB4C,IAASA,EAAKS,eAAiBT,GAAM5C,eAC3D,OAAOA,GAA+C,SAA7BA,EAAgBwJ,UAAsB,GAIhEgC,EAAUgE,GAAOhE,WAOjBQ,EAAcwD,GAAOxD,YAAc,SAAUgG,GAC5C,GAAIC,GAAMD,EAAOA,EAAK3O,eAAiB2O,EAAO1F,EAC7C4F,EAASD,EAAIE,WAGd,OAAKF,KAAQnS,GAA6B,IAAjBmS,EAAI7O,UAAmB6O,EAAIjS,iBAKpDF,EAAWmS,EACXlS,EAAUkS,EAAIjS,gBAGdiM,GAAkBL,EAAOqG,GAMpBC,GAAUA,EAAOE,aAAeF,IAAWA,EAAOG,KACtDH,EAAOE,YAAa,iBAAkB,WACrCpG,MASFR,EAAQiC,WAAauD,GAAO,SAAUC,GAErC,MADAA,GAAIqB,UAAY,KACRrB,EAAId,aAAa,eAO1B3E,EAAQ7C,qBAAuBqI,GAAO,SAAUC,GAE/C,MADAA,GAAI7H,YAAa6I,EAAIM,cAAc,MAC3BtB,EAAItI,qBAAqB,KAAK5F,SAIvCyI,EAAQwE,uBAAyBgB,GAAO,SAAUC,GAQjD,MAPAA,GAAIuB,UAAY,+CAIhBvB,EAAIwB,WAAWH,UAAY,IAGuB,IAA3CrB,EAAIjB,uBAAuB,KAAKjN,SAOxCyI,EAAQkH,QAAU1B,GAAO,SAAUC,GAElC,MADAlR,GAAQqJ,YAAa6H,GAAMlB,GAAK/J,GACxBiM,EAAIU,oBAAsBV,EAAIU,kBAAmB3M,GAAUjD,SAI/DyI,EAAQkH,SACZhH,EAAKzI,KAAS,GAAI,SAAU8M,EAAIxO,GAC/B,SAAYA,GAAQmC,iBAAmBsJ,GAAgBf,EAAiB,CACvE,GAAIyD,GAAInO,EAAQmC,eAAgBqM,EAGhC,OAAOL,IAAKA,EAAE/L,YAAc+L,QAG9BhE,EAAKkH,OAAW,GAAI,SAAU7C,GAC7B,GAAI8C,GAAS9C,EAAG5J,QAAS6I,GAAWC,GACpC,OAAO,UAAUrM,GAChB,MAAOA,GAAKuN,aAAa,QAAU0C,YAM9BnH,GAAKzI,KAAS,GAErByI,EAAKkH,OAAW,GAAK,SAAU7C,GAC9B,GAAI8C,GAAS9C,EAAG5J,QAAS6I,GAAWC,GACpC,OAAO,UAAUrM,GAChB,GAAIoP,SAAcpP,GAAKkQ,mBAAqB9F,GAAgBpK,EAAKkQ,iBAAiB,KAClF,OAAOd,IAAQA,EAAKtI,QAAUmJ,KAMjCnH,EAAKzI,KAAU,IAAIuI,EAAQ7C,qBAC1B,SAAUoK,EAAKxR,GACd,aAAYA,GAAQoH,uBAAyBqE,EACrCzL,EAAQoH,qBAAsBoK,GADtC,WAID,SAAUA,EAAKxR,GACd,GAAIqB,GACH4F,KACAzD,EAAI,EACJ8E,EAAUtI,EAAQoH,qBAAsBoK,EAGzC,IAAa,MAARA,EAAc,CAClB,MAASnQ,EAAOiH,EAAQ9E,KACA,IAAlBnC,EAAKQ,UACToF,EAAI7H,KAAMiC,EAIZ,OAAO4F,GAER,MAAOqB,IAIT6B,EAAKzI,KAAY,MAAIuI,EAAQwE,wBAA0B,SAAUsC,EAAW/Q,GAC3E,aAAYA,GAAQyO,yBAA2BhD,GAAgBf,EACvD1K,EAAQyO,uBAAwBsC,GADxC,WAWDnG,KAOAD,MAEMV,EAAQyE,IAAMrB,EAAQtL,KAAM2O,EAAI1B,qBAGrCS,GAAO,SAAUC,GAMhBA,EAAIuB,UAAY,iDAIVvB,EAAIV,iBAAiB,cAAcxN,QACxCmJ,EAAUvL,KAAM,MAAQ2M,EAAa,aAAeD,EAAW,KAM1D4D,EAAIV,iBAAiB,YAAYxN,QACtCmJ,EAAUvL,KAAK,cAIjBqQ,GAAO,SAAUC,GAOhB,GAAI+B,GAAQf,EAAIlK,cAAc,QAC9BiL,GAAM5C,aAAc,OAAQ,UAC5Ba,EAAI7H,YAAa4J,GAAQ5C,aAAc,IAAK,IAEvCa,EAAIV,iBAAiB,WAAWxN,QACpCmJ,EAAUvL,KAAM,SAAW2M,EAAa,gBAKnC2D,EAAIV,iBAAiB,YAAYxN,QACtCmJ,EAAUvL,KAAM,WAAY,aAI7BsQ,EAAIV,iBAAiB,QACrBrE,EAAUvL,KAAK,YAIX6K,EAAQyH,gBAAkBrE,EAAQtL,KAAO8I,EAAUrM,EAAQmT,uBAChEnT,EAAQoT,oBACRpT,EAAQqT,kBACRrT,EAAQsT,qBAERrC,GAAO,SAAUC,GAGhBzF,EAAQ8H,kBAAoBlH,EAAQtI,KAAMmN,EAAK,OAI/C7E,EAAQtI,KAAMmN,EAAK,aACnB9E,EAAcxL,KAAM,KAAM+M,KAI5BxB,EAAYA,EAAUnJ,QAAc6K,OAAQ1B,EAAUoE,KAAK,MAC3DnE,EAAgBA,EAAcpJ,QAAc6K,OAAQzB,EAAcmE,KAAK,MAQvEjE,EAAWuC,EAAQtL,KAAMvD,EAAQsM,WAActM,EAAQwT,wBACtD,SAAUzG,EAAGC,GACZ,GAAIyG,GAAuB,IAAf1G,EAAE1J,SAAiB0J,EAAE9M,gBAAkB8M,EAClD2G,EAAM1G,GAAKA,EAAEpJ,UACd,OAAOmJ,KAAM2G,MAAWA,GAAwB,IAAjBA,EAAIrQ,YAClCoQ,EAAMnH,SACLmH,EAAMnH,SAAUoH,GAChB3G,EAAEyG,yBAA8D,GAAnCzG,EAAEyG,wBAAyBE,MAG3D,SAAU3G,EAAGC,GACZ,GAAKA,EACJ,MAASA,EAAIA,EAAEpJ,WACd,GAAKoJ,IAAMD,EACV,OAAO,CAIV,QAAO,GAOTD,EAAY9M,EAAQwT,wBACpB,SAAUzG,EAAGC,GAGZ,GAAKD,IAAMC,EAEV,MADAH,IAAe,EACR,CAGR,IAAI8G,GAAU3G,EAAEwG,yBAA2BzG,EAAEyG,yBAA2BzG,EAAEyG,wBAAyBxG,EAEnG,OAAK2G,GAEW,EAAVA,IACFlI,EAAQmI,cAAgB5G,EAAEwG,wBAAyBzG,KAAQ4G,EAGxD5G,IAAMmF,GAAO5F,EAASC,EAAcQ,GACjC,GAEHC,IAAMkF,GAAO5F,EAASC,EAAcS,GACjC,EAIDhB,EACJhL,EAAQ+C,KAAMiI,EAAWe,GAAM/L,EAAQ+C,KAAMiI,EAAWgB,GAC1D,EAGe,EAAV2G,EAAc,GAAK,EAIpB5G,EAAEyG,wBAA0B,GAAK,GAEzC,SAAUzG,EAAGC,GACZ,GAAIwE,GACHxM,EAAI,EACJ6O,EAAM9G,EAAEnJ,WACR8P,EAAM1G,EAAEpJ,WACRkQ,GAAO/G,GACPgH,GAAO/G,EAGR,IAAKD,IAAMC,EAEV,MADAH,IAAe,EACR,CAGD,KAAMgH,IAAQH,EACpB,MAAO3G,KAAMmF,EAAM,GAClBlF,IAAMkF,EAAM,EACZ2B,EAAM,GACNH,EAAM,EACN1H,EACEhL,EAAQ+C,KAAMiI,EAAWe,GAAM/L,EAAQ+C,KAAMiI,EAAWgB,GAC1D,CAGK,IAAK6G,IAAQH,EACnB,MAAOnC,IAAcxE,EAAGC,EAIzBwE,GAAMzE,CACN,OAASyE,EAAMA,EAAI5N,WAClBkQ,EAAGE,QAASxC,EAEbA,GAAMxE,CACN,OAASwE,EAAMA,EAAI5N,WAClBmQ,EAAGC,QAASxC,EAIb,OAAQsC,EAAG9O,KAAO+O,EAAG/O,GACpBA,GAGD,OAAOA,GAENuM,GAAcuC,EAAG9O,GAAI+O,EAAG/O,IAGxB8O,EAAG9O,KAAOuH,EAAe,GACzBwH,EAAG/O,KAAOuH,EAAe,EACzB,GAGK2F,GA1UCnS,GA6UT0P,GAAOpD,QAAU,SAAU4H,EAAMC,GAChC,MAAOzE,IAAQwE,EAAM,KAAM,KAAMC,IAGlCzE,GAAOyD,gBAAkB,SAAUrQ,EAAMoR,GASxC,IAPOpR,EAAKS,eAAiBT,KAAW9C,GACvCkM,EAAapJ,GAIdoR,EAAOA,EAAK7N,QAAS6H,EAAkB,aAElCxC,EAAQyH,kBAAmBhH,GAC5BE,GAAkBA,EAAc7I,KAAM0Q,IACtC9H,GAAkBA,EAAU5I,KAAM0Q,IAErC,IACC,GAAI7P,GAAMiI,EAAQtI,KAAMlB,EAAMoR,EAG9B,IAAK7P,GAAOqH,EAAQ8H,mBAGlB1Q,EAAK9C,UAAuC,KAA3B8C,EAAK9C,SAASsD,SAChC,MAAOe,GAEP,MAAMmD,IAGT,MAAOkI,IAAQwE,EAAMlU,EAAU,MAAO8C,IAAQG,OAAS,GAGxDyM,GAAOnD,SAAW,SAAU9K,EAASqB,GAKpC,OAHOrB,EAAQ8B,eAAiB9B,KAAczB,GAC7CkM,EAAazK,GAEP8K,EAAU9K,EAASqB,IAG3B4M,GAAO/L,KAAO,SAAUb,EAAM4C,IAEtB5C,EAAKS,eAAiBT,KAAW9C,GACvCkM,EAAapJ,EAGd,IAAIpB,GAAKkK,EAAK2F,WAAY7L,EAAKiE,eAE9ByK,EAAM1S,GAAM0L,EAAOpJ,KAAM4H,EAAK2F,WAAY7L,EAAKiE,eAC9CjI,EAAIoB,EAAM4C,GAAOyG,GACjBxM,SAEF,OAAOyU,KAAQzU,UACd+L,EAAQiC,aAAexB,EACtBrJ,EAAKuN,aAAc3K,IAClB0O,EAAMtR,EAAKkQ,iBAAiBtN,KAAU0O,EAAIC,UAC1CD,EAAIxK,MACJ,KACFwK,GAGF1E,GAAOhI,MAAQ,SAAUC,GACxB,KAAUC,OAAO,0CAA4CD,IAO9D+H,GAAO4E,WAAa,SAAUvK,GAC7B,GAAIjH,GACHyR,KACApP,EAAI,EACJF,EAAI,CAOL,IAJA6H,GAAgBpB,EAAQ8I,iBACxBvI,GAAaP,EAAQ+I,YAAc1K,EAAQhJ,MAAO,GAClDgJ,EAAQzE,KAAMyH,GAETD,EAAe,CACnB,MAAShK,EAAOiH,EAAQ9E,KAClBnC,IAASiH,EAAS9E,KACtBE,EAAIoP,EAAW1T,KAAMoE,GAGvB,OAAQE,IACP4E,EAAQxE,OAAQgP,EAAYpP,GAAK,GAInC,MAAO4E,IAOR8B,EAAU6D,GAAO7D,QAAU,SAAU/I,GACpC,GAAIoP,GACH7N,EAAM,GACNY,EAAI,EACJ3B,EAAWR,EAAKQ,QAEjB,IAAMA,GAMC,GAAkB,IAAbA,GAA+B,IAAbA,GAA+B,KAAbA,EAAkB,CAGjE,GAAiC,gBAArBR,GAAK4R,YAChB,MAAO5R,GAAK4R,WAGZ,KAAM5R,EAAOA,EAAK6P,WAAY7P,EAAMA,EAAOA,EAAK8O,YAC/CvN,GAAOwH,EAAS/I,OAGZ,IAAkB,IAAbQ,GAA+B,IAAbA,EAC7B,MAAOR,GAAK6R,cAhBZ,MAASzC,EAAOpP,EAAKmC,GAAKA,IAEzBZ,GAAOwH,EAASqG,EAkBlB,OAAO7N,IAGRuH,EAAO8D,GAAOkF,WAGb7D,YAAa,GAEb8D,aAAc5D,GAEdpO,MAAOwL,EAEPkD,cAEApO,QAEA2R,UACCC,KAAOC,IAAK,aAAclQ,OAAO,GACjCmQ,KAAOD,IAAK,cACZE,KAAOF,IAAK,kBAAmBlQ,OAAO,GACtCqQ,KAAOH,IAAK,oBAGbI,WACC3G,KAAQ,SAAU5L,GAUjB,MATAA,GAAM,GAAKA,EAAM,GAAGwD,QAAS6I,GAAWC,IAGxCtM,EAAM,IAAOA,EAAM,IAAMA,EAAM,IAAM,IAAKwD,QAAS6I,GAAWC,IAE5C,OAAbtM,EAAM,KACVA,EAAM,GAAK,IAAMA,EAAM,GAAK,KAGtBA,EAAM9B,MAAO,EAAG,IAGxB4N,MAAS,SAAU9L,GA6BlB,MAlBAA,GAAM,GAAKA,EAAM,GAAG8G,cAEY,QAA3B9G,EAAM,GAAG9B,MAAO,EAAG,IAEjB8B,EAAM,IACX6M,GAAOhI,MAAO7E,EAAM,IAKrBA,EAAM,KAAQA,EAAM,GAAKA,EAAM,IAAMA,EAAM,IAAM,GAAK,GAAmB,SAAbA,EAAM,IAA8B,QAAbA,EAAM,KACzFA,EAAM,KAAUA,EAAM,GAAKA,EAAM,IAAqB,QAAbA,EAAM,KAGpCA,EAAM,IACjB6M,GAAOhI,MAAO7E,EAAM,IAGdA,GAGR6L,OAAU,SAAU7L,GACnB,GAAIwS,GACHC,GAAYzS,EAAM,IAAMA,EAAM,EAE/B,OAAKwL,GAAiB,MAAE7K,KAAMX,EAAM,IAC5B,MAIHA,EAAM,IAAMA,EAAM,KAAOlD,UAC7BkD,EAAM,GAAKA,EAAM,GAGNyS,GAAYnH,EAAQ3K,KAAM8R,KAEpCD,EAASjF,GAAUkF,GAAU,MAE7BD,EAASC,EAASrU,QAAS,IAAKqU,EAASrS,OAASoS,GAAWC,EAASrS,UAGvEJ,EAAM,GAAKA,EAAM,GAAG9B,MAAO,EAAGsU,GAC9BxS,EAAM,GAAKyS,EAASvU,MAAO,EAAGsU,IAIxBxS,EAAM9B,MAAO,EAAG,MAIzB+R,QAECtE,IAAO,SAAU+G,GAChB,GAAI7L,GAAW6L,EAAiBlP,QAAS6I,GAAWC,IAAYxF,aAChE,OAA4B,MAArB4L,EACN,WAAa,OAAO,GACpB,SAAUzS,GACT,MAAOA,GAAK4G,UAAY5G,EAAK4G,SAASC,gBAAkBD,IAI3D6E,MAAS,SAAUiE,GAClB,GAAIgD,GAAU9I,EAAY8F,EAAY,IAEtC,OAAOgD,KACLA,EAAc1H,OAAQ,MAAQN,EAAa,IAAMgF,EAAY,IAAMhF,EAAa,SACjFd,EAAY8F,EAAW,SAAU1P,GAChC,MAAO0S,GAAQhS,KAAgC,gBAAnBV,GAAK0P,WAA0B1P,EAAK0P,iBAAoB1P,GAAKuN,eAAiBnD,GAAgBpK,EAAKuN,aAAa,UAAY,OAI3J5B,KAAQ,SAAU/I,EAAM+P,EAAUC,GACjC,MAAO,UAAU5S,GAChB,GAAI6S,GAASjG,GAAO/L,KAAMb,EAAM4C,EAEhC,OAAe,OAAViQ,EACgB,OAAbF,EAEFA,GAINE,GAAU,GAEU,MAAbF,EAAmBE,IAAWD,EACvB,OAAbD,EAAoBE,IAAWD,EAClB,OAAbD,EAAoBC,GAAqC,IAA5BC,EAAO1U,QAASyU,GAChC,OAAbD,EAAoBC,GAASC,EAAO1U,QAASyU,GAAU,GAC1C,OAAbD,EAAoBC,GAASC,EAAO5U,OAAQ2U,EAAMzS,UAAayS,EAClD,OAAbD,GAAsB,IAAME,EAAS,KAAM1U,QAASyU,GAAU,GACjD,OAAbD,EAAoBE,IAAWD,GAASC,EAAO5U,MAAO,EAAG2U,EAAMzS,OAAS,KAAQyS,EAAQ,KACxF,IAZO,IAgBV/G,MAAS,SAAU3H,EAAM4O,EAAM5D,EAAUlN,EAAOE,GAC/C,GAAI6Q,GAAgC,QAAvB7O,EAAKjG,MAAO,EAAG,GAC3B+U,EAA+B,SAArB9O,EAAKjG,MAAO,IACtBgV,EAAkB,YAATH,CAEV,OAAiB,KAAV9Q,GAAwB,IAATE,EAGrB,SAAUlC,GACT,QAASA,EAAKe,YAGf,SAAUf,EAAMrB,EAASgH,GACxB,GAAIqI,GAAOkF,EAAY9D,EAAMR,EAAMuE,EAAWC,EAC7ClB,EAAMa,IAAWC,EAAU,cAAgB,kBAC3C1D,EAAStP,EAAKe,WACd6B,EAAOqQ,GAAUjT,EAAK4G,SAASC,cAC/BwM,GAAY1N,IAAQsN,CAErB,IAAK3D,EAAS,CAGb,GAAKyD,EAAS,CACb,MAAQb,EAAM,CACb9C,EAAOpP,CACP,OAASoP,EAAOA,EAAM8C,GACrB,GAAKe,EAAS7D,EAAKxI,SAASC,gBAAkBjE,EAAyB,IAAlBwM,EAAK5O,SACzD,OAAO,CAIT4S,GAAQlB,EAAe,SAAThO,IAAoBkP,GAAS,cAE5C,OAAO,EAMR,GAHAA,GAAUJ,EAAU1D,EAAOO,WAAaP,EAAOgE,WAG1CN,GAAWK,EAAW,CAE1BH,EAAa5D,EAAQlM,KAAckM,EAAQlM,OAC3C4K,EAAQkF,EAAYhP,OACpBiP,EAAYnF,EAAM,KAAOrE,GAAWqE,EAAM,GAC1CY,EAAOZ,EAAM,KAAOrE,GAAWqE,EAAM,GACrCoB,EAAO+D,GAAa7D,EAAOhK,WAAY6N,EAEvC,OAAS/D,IAAS+D,GAAa/D,GAAQA,EAAM8C,KAG3CtD,EAAOuE,EAAY,IAAMC,EAAM7I,MAGhC,GAAuB,IAAlB6E,EAAK5O,YAAoBoO,GAAQQ,IAASpP,EAAO,CACrDkT,EAAYhP,IAAWyF,EAASwJ,EAAWvE,EAC3C,YAKI,IAAKyE,IAAarF,GAAShO,EAAMoD,KAAcpD,EAAMoD,QAAkBc,KAAW8J,EAAM,KAAOrE,EACrGiF,EAAOZ,EAAM,OAKb,OAASoB,IAAS+D,GAAa/D,GAAQA,EAAM8C,KAC3CtD,EAAOuE,EAAY,IAAMC,EAAM7I,MAEhC,IAAO0I,EAAS7D,EAAKxI,SAASC,gBAAkBjE,EAAyB,IAAlBwM,EAAK5O,aAAsBoO,IAE5EyE,KACHjE,EAAMhM,KAAcgM,EAAMhM,QAAkBc,IAAWyF,EAASiF,IAG7DQ,IAASpP,GACb,KAQJ,OADA4O,IAAQ1M,EACD0M,IAAS5M,GAA4B,IAAjB4M,EAAO5M,GAAe4M,EAAO5M,GAAS,KAKrE4J,OAAU,SAAU2H,EAAQrE,GAK3B,GAAIvN,GACH/C,EAAKkK,EAAKgC,QAASyI,IAAYzK,EAAK0K,WAAYD,EAAO1M,gBACtD+F,GAAOhI,MAAO,uBAAyB2O,EAKzC,OAAK3U,GAAIwE,GACDxE,EAAIsQ,GAIPtQ,EAAGuB,OAAS,GAChBwB,GAAS4R,EAAQA,EAAQ,GAAIrE,GACtBpG,EAAK0K,WAAWjV,eAAgBgV,EAAO1M,eAC7CsH,GAAa,SAAUtB,EAAMrD,GAC5B,GAAIiK,GACHC,EAAU9U,EAAIiO,EAAMqC,GACpB/M,EAAIuR,EAAQvT,MACb,OAAQgC,IACPsR,EAAMtV,EAAQ+C,KAAM2L,EAAM6G,EAAQvR,IAClC0K,EAAM4G,KAAWjK,EAASiK,GAAQC,EAAQvR,MAG5C,SAAUnC,GACT,MAAOpB,GAAIoB,EAAM,EAAG2B,KAIhB/C,IAITkM,SAEC6I,IAAOxF,GAAa,SAAUzP,GAI7B,GAAI0R,MACHnJ,KACA2M,EAAU3K,EAASvK,EAAS6E,QAASwH,EAAO,MAE7C,OAAO6I,GAASxQ,GACf+K,GAAa,SAAUtB,EAAMrD,EAAS7K,EAASgH,GAC9C,GAAI3F,GACH6T,EAAYD,EAAS/G,EAAM,KAAMlH,MACjCxD,EAAI0K,EAAK1M,MAGV,OAAQgC,KACDnC,EAAO6T,EAAU1R,MACtB0K,EAAK1K,KAAOqH,EAAQrH,GAAKnC,MAI5B,SAAUA,EAAMrB,EAASgH,GAGxB,MAFAyK,GAAM,GAAKpQ,EACX4T,EAASxD,EAAO,KAAMzK,EAAKsB,IACnBA,EAAQsD,SAInBuJ,IAAO3F,GAAa,SAAUzP,GAC7B,MAAO,UAAUsB,GAChB,MAAO4M,IAAQlO,EAAUsB,GAAOG,OAAS,KAI3CsJ,SAAY0E,GAAa,SAAU7H,GAClC,MAAO,UAAUtG,GAChB,OAASA,EAAK4R,aAAe5R,EAAK+T,WAAahL,EAAS/I,IAAS7B,QAASmI,GAAS,MAWrF0N,KAAQ7F,GAAc,SAAU6F,GAM/B,MAJM1I,GAAY5K,KAAKsT,GAAQ,KAC9BpH,GAAOhI,MAAO,qBAAuBoP,GAEtCA,EAAOA,EAAKzQ,QAAS6I,GAAWC,IAAYxF,cACrC,SAAU7G,GAChB,GAAIiU,EACJ,GACC,IAAMA,EAAW5K,EAChBrJ,EAAKgU,KACLhU,EAAKuN,aAAa,aAAevN,EAAKuN,aAAa,QAGnD,MADA0G,GAAWA,EAASpN,cACboN,IAAaD,GAA2C,IAAnCC,EAAS9V,QAAS6V,EAAO,YAE5ChU,EAAOA,EAAKe,aAAiC,IAAlBf,EAAKQ,SAC3C,QAAO,KAKTyC,OAAU,SAAUjD,GACnB,GAAIkU,GAAOtX,EAAOK,UAAYL,EAAOK,SAASiX,IAC9C,OAAOA,IAAQA,EAAKjW,MAAO,KAAQ+B,EAAKmN,IAGzCgH,KAAQ,SAAUnU,GACjB,MAAOA,KAAS7C,GAGjBiX,MAAS,SAAUpU,GAClB,MAAOA,KAAS9C,EAASmX,iBAAmBnX,EAASoX,UAAYpX,EAASoX,gBAAkBtU,EAAKkE,MAAQlE,EAAKuU,OAASvU,EAAKwU,WAI7HC,QAAW,SAAUzU,GACpB,MAAOA,GAAK0U,YAAa,GAG1BA,SAAY,SAAU1U,GACrB,MAAOA,GAAK0U,YAAa,GAG1BC,QAAW,SAAU3U,GAGpB,GAAI4G,GAAW5G,EAAK4G,SAASC,aAC7B,OAAqB,UAAbD,KAA0B5G,EAAK2U,SAA0B,WAAb/N,KAA2B5G,EAAK4U,UAGrFA,SAAY,SAAU5U,GAOrB,MAJKA,GAAKe,YACTf,EAAKe,WAAW8T,cAGV7U,EAAK4U,YAAa,GAI1BE,MAAS,SAAU9U,GAMlB,IAAMA,EAAOA,EAAK6P,WAAY7P,EAAMA,EAAOA,EAAK8O,YAC/C,GAAK9O,EAAK4G,SAAW,KAAyB,IAAlB5G,EAAKQ,UAAoC,IAAlBR,EAAKQ,SACvD,OAAO,CAGT,QAAO,GAGR8O,OAAU,SAAUtP,GACnB,OAAQ8I,EAAKgC,QAAe,MAAG9K,IAIhC+U,OAAU,SAAU/U,GACnB,MAAOkM,IAAQxL,KAAMV,EAAK4G,WAG3BwJ,MAAS,SAAUpQ,GAClB,MAAOiM,GAAQvL,KAAMV,EAAK4G,WAG3BoO,OAAU,SAAUhV,GACnB,GAAI4C,GAAO5C,EAAK4G,SAASC,aACzB,OAAgB,UAATjE,GAAkC,WAAd5C,EAAKkE,MAA8B,WAATtB,GAGtD0D,KAAQ,SAAUtG,GACjB,GAAIa,EAGJ,OAAuC,UAAhCb,EAAK4G,SAASC,eACN,SAAd7G,EAAKkE,OACmC,OAArCrD,EAAOb,EAAKuN,aAAa,UAAoB1M,EAAKgG,gBAAkB7G,EAAKkE,OAI9ElC,MAASiN,GAAuB,WAC/B,OAAS,KAGV/M,KAAQ+M,GAAuB,SAAUE,EAAchP,GACtD,OAASA,EAAS,KAGnB8B,GAAMgN,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,OAAoB,EAAXA,EAAeA,EAAW/O,EAAS+O,KAG7C+F,KAAQhG,GAAuB,SAAUE,EAAchP,GACtD,GAAIgC,GAAI,CACR,MAAYhC,EAAJgC,EAAYA,GAAK,EACxBgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGR+F,IAAOjG,GAAuB,SAAUE,EAAchP,GACrD,GAAIgC,GAAI,CACR,MAAYhC,EAAJgC,EAAYA,GAAK,EACxBgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGRgG,GAAMlG,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,GAAI/M,GAAe,EAAX+M,EAAeA,EAAW/O,EAAS+O,CAC3C,QAAU/M,GAAK,GACdgN,EAAapR,KAAMoE,EAEpB,OAAOgN,KAGRiG,GAAMnG,GAAuB,SAAUE,EAAchP,EAAQ+O,GAC5D,GAAI/M,GAAe,EAAX+M,EAAeA,EAAW/O,EAAS+O,CAC3C,MAAc/O,IAAJgC,GACTgN,EAAapR,KAAMoE,EAEpB,OAAOgN,OAKVrG,EAAKgC,QAAa,IAAIhC,EAAKgC,QAAY,EAGvC,KAAM3I,KAAOkT,OAAO,EAAMC,UAAU,EAAMC,MAAM,EAAMC,UAAU,EAAMC,OAAO,GAC5E3M,EAAKgC,QAAS3I,GAAM4M,GAAmB5M,EAExC,KAAMA,KAAOuT,QAAQ,EAAMC,OAAO,GACjC7M,EAAKgC,QAAS3I,GAAM6M,GAAoB7M,EAIzC,SAASqR,OACTA,GAAW5T,UAAYkJ,EAAK8M,QAAU9M,EAAKgC,QAC3ChC,EAAK0K,WAAa,GAAIA,GAEtB,SAASlG,IAAU5O,EAAUmX,GAC5B,GAAInC,GAAS3T,EAAO+V,EAAQ5R,EAC3B6R,EAAOhJ,EAAQiJ,EACfC,EAASnM,EAAYpL,EAAW,IAEjC,IAAKuX,EACJ,MAAOJ,GAAY,EAAII,EAAOhY,MAAO,EAGtC8X,GAAQrX,EACRqO,KACAiJ,EAAalN,EAAKwJ,SAElB,OAAQyD,EAAQ,GAGTrC,IAAY3T,EAAQkL,EAAO7K,KAAM2V,OACjChW,IAEJgW,EAAQA,EAAM9X,MAAO8B,EAAM,GAAGI,SAAY4V,GAE3ChJ,EAAOhP,KAAM+X,OAGdpC,GAAU,GAGJ3T,EAAQmL,EAAa9K,KAAM2V,MAChCrC,EAAU3T,EAAMmO,QAChB4H,EAAO/X,MACN+I,MAAO4M,EAEPxP,KAAMnE,EAAM,GAAGwD,QAASwH,EAAO,OAEhCgL,EAAQA,EAAM9X,MAAOyV,EAAQvT,QAI9B,KAAM+D,IAAQ4E,GAAKkH,SACZjQ,EAAQwL,EAAWrH,GAAO9D,KAAM2V,KAAcC,EAAY9R,MAC9DnE,EAAQiW,EAAY9R,GAAQnE,MAC7B2T,EAAU3T,EAAMmO,QAChB4H,EAAO/X,MACN+I,MAAO4M,EACPxP,KAAMA,EACNsF,QAASzJ,IAEVgW,EAAQA,EAAM9X,MAAOyV,EAAQvT,QAI/B,KAAMuT,EACL,MAOF,MAAOmC,GACNE,EAAM5V,OACN4V,EACCnJ,GAAOhI,MAAOlG,GAEdoL,EAAYpL,EAAUqO,GAAS9O,MAAO,GAGzC,QAASwP,IAAYqI,GACpB,GAAI3T,GAAI,EACPC,EAAM0T,EAAO3V,OACbzB,EAAW,EACZ,MAAY0D,EAAJD,EAASA,IAChBzD,GAAYoX,EAAO3T,GAAG2E,KAEvB,OAAOpI,GAGR,QAASwX,IAAetC,EAASuC,EAAYC,GAC5C,GAAIlE,GAAMiE,EAAWjE,IACpBmE,EAAmBD,GAAgB,eAARlE,EAC3BoE,EAAWzU,GAEZ,OAAOsU,GAAWnU,MAEjB,SAAUhC,EAAMrB,EAASgH,GACxB,MAAS3F,EAAOA,EAAMkS,GACrB,GAAuB,IAAlBlS,EAAKQ,UAAkB6V,EAC3B,MAAOzC,GAAS5T,EAAMrB,EAASgH,IAMlC,SAAU3F,EAAMrB,EAASgH,GACxB,GAAIZ,GAAMiJ,EAAOkF,EAChBqD,EAAS5M,EAAU,IAAM2M,CAG1B,IAAK3Q,GACJ,MAAS3F,EAAOA,EAAMkS,GACrB,IAAuB,IAAlBlS,EAAKQ,UAAkB6V,IACtBzC,EAAS5T,EAAMrB,EAASgH,GAC5B,OAAO,MAKV,OAAS3F,EAAOA,EAAMkS,GACrB,GAAuB,IAAlBlS,EAAKQ,UAAkB6V,EAE3B,GADAnD,EAAalT,EAAMoD,KAAcpD,EAAMoD,QACjC4K,EAAQkF,EAAYhB,KAAUlE,EAAM,KAAOuI,GAChD,IAAMxR,EAAOiJ,EAAM,OAAQ,GAAQjJ,IAAS8D,EAC3C,MAAO9D,MAAS,MAKjB,IAFAiJ,EAAQkF,EAAYhB,IAAUqE,GAC9BvI,EAAM,GAAK4F,EAAS5T,EAAMrB,EAASgH,IAASkD,EACvCmF,EAAM,MAAO,EACjB,OAAO,GASf,QAASwI,IAAgBC,GACxB,MAAOA,GAAStW,OAAS,EACxB,SAAUH,EAAMrB,EAASgH,GACxB,GAAIxD,GAAIsU,EAAStW,MACjB,OAAQgC,IACP,IAAMsU,EAAStU,GAAInC,EAAMrB,EAASgH,GACjC,OAAO,CAGT,QAAO,GAER8Q,EAAS,GAGX,QAASC,IAAU7C,EAAWvR,EAAK0N,EAAQrR,EAASgH,GACnD,GAAI3F,GACH2W,KACAxU,EAAI,EACJC,EAAMyR,EAAU1T,OAChByW,EAAgB,MAAPtU,CAEV,MAAYF,EAAJD,EAASA,KACVnC,EAAO6T,EAAU1R,OAChB6N,GAAUA,EAAQhQ,EAAMrB,EAASgH,MACtCgR,EAAa5Y,KAAMiC,GACd4W,GACJtU,EAAIvE,KAAMoE,GAMd,OAAOwU,GAGR,QAASE,IAAYvE,EAAW5T,EAAUkV,EAASkD,EAAYC,EAAYC,GAO1E,MANKF,KAAeA,EAAY1T,KAC/B0T,EAAaD,GAAYC,IAErBC,IAAeA,EAAY3T,KAC/B2T,EAAaF,GAAYE,EAAYC,IAE/B7I,GAAa,SAAUtB,EAAM5F,EAAStI,EAASgH,GACrD,GAAIsR,GAAM9U,EAAGnC,EACZkX,KACAC,KACAC,EAAcnQ,EAAQ9G,OAGtBmB,EAAQuL,GAAQwK,GAAkB3Y,GAAY,IAAKC,EAAQ6B,UAAa7B,GAAYA,MAGpF2Y,GAAYhF,IAAezF,GAASnO,EAEnC4C,EADAoV,GAAUpV,EAAO4V,EAAQ5E,EAAW3T,EAASgH,GAG9C4R,EAAa3D,EAEZmD,IAAgBlK,EAAOyF,EAAY8E,GAAeN,MAMjD7P,EACDqQ,CAQF,IALK1D,GACJA,EAAS0D,EAAWC,EAAY5Y,EAASgH,GAIrCmR,EAAa,CACjBG,EAAOP,GAAUa,EAAYJ,GAC7BL,EAAYG,KAAUtY,EAASgH,GAG/BxD,EAAI8U,EAAK9W,MACT,OAAQgC,KACDnC,EAAOiX,EAAK9U,MACjBoV,EAAYJ,EAAQhV,MAASmV,EAAWH,EAAQhV,IAAOnC,IAK1D,GAAK6M,GACJ,GAAKkK,GAAczE,EAAY,CAC9B,GAAKyE,EAAa,CAEjBE,KACA9U,EAAIoV,EAAWpX,MACf,OAAQgC,KACDnC,EAAOuX,EAAWpV,KAEvB8U,EAAKlZ,KAAOuZ,EAAUnV,GAAKnC,EAG7B+W,GAAY,KAAOQ,KAAkBN,EAAMtR,GAI5CxD,EAAIoV,EAAWpX,MACf,OAAQgC,KACDnC,EAAOuX,EAAWpV,MACtB8U,EAAOF,EAAa5Y,EAAQ+C,KAAM2L,EAAM7M,GAASkX,EAAO/U,IAAM,KAE/D0K,EAAKoK,KAAUhQ,EAAQgQ,GAAQjX,SAOlCuX,GAAab,GACZa,IAAetQ,EACdsQ,EAAW9U,OAAQ2U,EAAaG,EAAWpX,QAC3CoX,GAEGR,EACJA,EAAY,KAAM9P,EAASsQ,EAAY5R,GAEvC5H,EAAK+D,MAAOmF,EAASsQ,KAMzB,QAASC,IAAmB1B,GAC3B,GAAI2B,GAAc7D,EAASvR,EAC1BD,EAAM0T,EAAO3V,OACbuX,EAAkB5O,EAAKkJ,SAAU8D,EAAO,GAAG5R,MAC3CyT,EAAmBD,GAAmB5O,EAAKkJ,SAAS,KACpD7P,EAAIuV,EAAkB,EAAI,EAG1BE,EAAe1B,GAAe,SAAUlW,GACvC,MAAOA,KAASyX,GACdE,GAAkB,GACrBE,EAAkB3B,GAAe,SAAUlW,GAC1C,MAAO7B,GAAQ+C,KAAMuW,EAAczX,GAAS,IAC1C2X,GAAkB,GACrBlB,GAAa,SAAUzW,EAAMrB,EAASgH,GACrC,OAAU+R,IAAqB/R,GAAOhH,IAAYuK,MAChDuO,EAAe9Y,GAAS6B,SACxBoX,EAAc5X,EAAMrB,EAASgH,GAC7BkS,EAAiB7X,EAAMrB,EAASgH,KAGpC,MAAYvD,EAAJD,EAASA,IAChB,GAAMyR,EAAU9K,EAAKkJ,SAAU8D,EAAO3T,GAAG+B,MACxCuS,GAAaP,GAAcM,GAAgBC,GAAY7C,QACjD,CAIN,GAHAA,EAAU9K,EAAKkH,OAAQ8F,EAAO3T,GAAG+B,MAAOpC,MAAO,KAAMgU,EAAO3T,GAAGqH,SAG1DoK,EAASxQ,GAAY,CAGzB,IADAf,IAAMF,EACMC,EAAJC,EAASA,IAChB,GAAKyG,EAAKkJ,SAAU8D,EAAOzT,GAAG6B,MAC7B,KAGF,OAAO2S,IACN1U,EAAI,GAAKqU,GAAgBC,GACzBtU,EAAI,GAAKsL,GAERqI,EAAO7X,MAAO,EAAGkE,EAAI,GAAItE,QAASiJ,MAAgC,MAAzBgP,EAAQ3T,EAAI,GAAI+B,KAAe,IAAM,MAC7EX,QAASwH,EAAO,MAClB6I,EACIvR,EAAJF,GAASqV,GAAmB1B,EAAO7X,MAAOkE,EAAGE,IACzCD,EAAJC,GAAWmV,GAAoB1B,EAASA,EAAO7X,MAAOoE,IAClDD,EAAJC,GAAWoL,GAAYqI,IAGzBW,EAAS1Y,KAAM6V,GAIjB,MAAO4C,IAAgBC,GAGxB,QAASqB,IAA0BC,EAAiBC,GAEnD,GAAIC,GAAoB,EACvBC,EAAQF,EAAY7X,OAAS,EAC7BgY,EAAYJ,EAAgB5X,OAAS,EACrCiY,EAAe,SAAUvL,EAAMlO,EAASgH,EAAKsB,EAASoR,GACrD,GAAIrY,GAAMqC,EAAGuR,EACZ0E,KACAC,EAAe,EACfpW,EAAI,IACJ0R,EAAYhH,MACZ2L,EAA6B,MAAjBH,EACZI,EAAgBvP,EAEhB5H,EAAQuL,GAAQsL,GAAarP,EAAKzI,KAAU,IAAG,IAAKgY,GAAiB1Z,EAAQoC,YAAcpC,GAE3F+Z,EAAiB/O,GAA4B,MAAjB8O,EAAwB,EAAIpV,KAAKC,UAAY,EAS1E,KAPKkV,IACJtP,EAAmBvK,IAAYzB,GAAYyB,EAC3CkK,EAAaoP,GAKe,OAApBjY,EAAOsB,EAAMa,IAAaA,IAAM,CACxC,GAAKgW,GAAanY,EAAO,CACxBqC,EAAI,CACJ,OAASuR,EAAUmE,EAAgB1V,KAClC,GAAKuR,EAAS5T,EAAMrB,EAASgH,GAAQ,CACpCsB,EAAQlJ,KAAMiC,EACd,OAGGwY,IACJ7O,EAAU+O,EACV7P,IAAeoP,GAKZC,KAEElY,GAAQ4T,GAAW5T,IACxBuY,IAII1L,GACJgH,EAAU9V,KAAMiC,IAOnB,GADAuY,GAAgBpW,EACX+V,GAAS/V,IAAMoW,EAAe,CAClClW,EAAI,CACJ,OAASuR,EAAUoE,EAAY3V,KAC9BuR,EAASC,EAAWyE,EAAY3Z,EAASgH,EAG1C,IAAKkH,EAAO,CAEX,GAAK0L,EAAe,EACnB,MAAQpW,IACA0R,EAAU1R,IAAMmW,EAAWnW,KACjCmW,EAAWnW,GAAKoI,EAAIrJ,KAAM+F,GAM7BqR,GAAa5B,GAAU4B,GAIxBva,EAAK+D,MAAOmF,EAASqR,GAGhBE,IAAc3L,GAAQyL,EAAWnY,OAAS,GAC5CoY,EAAeP,EAAY7X,OAAW,GAExCyM,GAAO4E,WAAYvK,GAUrB,MALKuR,KACJ7O,EAAU+O,EACVxP,EAAmBuP,GAGb5E,EAGT,OAAOqE,GACN/J,GAAciK,GACdA,EAGFnP,EAAU2D,GAAO3D,QAAU,SAAUvK,EAAUia,GAC9C,GAAIxW,GACH6V,KACAD,KACA9B,EAASlM,EAAerL,EAAW,IAEpC,KAAMuX,EAAS,CAER0C,IACLA,EAAQrL,GAAU5O,IAEnByD,EAAIwW,EAAMxY,MACV,OAAQgC,IACP8T,EAASuB,GAAmBmB,EAAMxW,IAC7B8T,EAAQ7S,GACZ4U,EAAYja,KAAMkY,GAElB8B,EAAgBha,KAAMkY,EAKxBA,GAASlM,EAAerL,EAAUoZ,GAA0BC,EAAiBC,IAE9E,MAAO/B,GAGR,SAASoB,IAAkB3Y,EAAUka,EAAU3R,GAC9C,GAAI9E,GAAI,EACPC,EAAMwW,EAASzY,MAChB,MAAYiC,EAAJD,EAASA,IAChByK,GAAQlO,EAAUka,EAASzW,GAAI8E,EAEhC,OAAOA,GAGR,QAAS6G,IAAQpP,EAAUC,EAASsI,EAAS4F,GAC5C,GAAI1K,GAAG2T,EAAQ+C,EAAO3U,EAAM7D,EAC3BN,EAAQuN,GAAU5O,EAEnB,KAAMmO,GAEiB,IAAjB9M,EAAMI,OAAe,CAIzB,GADA2V,EAAS/V,EAAM,GAAKA,EAAM,GAAG9B,MAAO,GAC/B6X,EAAO3V,OAAS,GAAkC,QAA5B0Y,EAAQ/C,EAAO,IAAI5R,MAC5C0E,EAAQkH,SAAgC,IAArBnR,EAAQ6B,UAAkB6I,GAC7CP,EAAKkJ,SAAU8D,EAAO,GAAG5R,MAAS,CAGnC,GADAvF,GAAYmK,EAAKzI,KAAS,GAAGwY,EAAMrP,QAAQ,GAAGjG,QAAQ6I,GAAWC,IAAY1N,QAAkB,IACzFA,EACL,MAAOsI,EAERvI,GAAWA,EAAST,MAAO6X,EAAO5H,QAAQpH,MAAM3G,QAIjDgC,EAAIoJ,EAAwB,aAAE7K,KAAMhC,GAAa,EAAIoX,EAAO3V,MAC5D,OAAQgC,IAAM,CAIb,GAHA0W,EAAQ/C,EAAO3T,GAGV2G,EAAKkJ,SAAW9N,EAAO2U,EAAM3U,MACjC,KAED,KAAM7D,EAAOyI,EAAKzI,KAAM6D,MAEjB2I,EAAOxM,EACZwY,EAAMrP,QAAQ,GAAGjG,QAAS6I,GAAWC,IACrClB,EAASzK,KAAMoV,EAAO,GAAG5R,OAAUvF,EAAQoC,YAAcpC,IACrD,CAKJ,GAFAmX,EAAOrT,OAAQN,EAAG,GAClBzD,EAAWmO,EAAK1M,QAAUsN,GAAYqI,IAChCpX,EAEL,MADAX,GAAK+D,MAAOmF,EAAS4F,GACd5F,CAGR,SAgBL,MAPAgC,GAASvK,EAAUqB,GAClB8M,EACAlO,GACC0K,EACDpC,EACAkE,EAASzK,KAAMhC,IAETuI,EAMR2B,EAAQ+I,WAAavO,EAAQuF,MAAM,IAAInG,KAAMyH,GAAYyD,KAAK,MAAQtK,EAItEwF,EAAQ8I,iBAAmB1H,EAG3BZ,IAIAR,EAAQmI,aAAe3C,GAAO,SAAU0K,GAEvC,MAAuE,GAAhEA,EAAKnI,wBAAyBzT,EAASiI,cAAc,UAMvDiJ,GAAO,SAAUC,GAEtB,MADAA,GAAIuB,UAAY,mBAC+B,MAAxCvB,EAAIwB,WAAWtC,aAAa,WAEnCe,GAAW,yBAA0B,SAAUtO,EAAM4C,EAAMoG,GAC1D,MAAMA,GAAN,UACQhJ,EAAKuN,aAAc3K,EAA6B,SAAvBA,EAAKiE,cAA2B,EAAI,KAOjE+B,EAAQiC,YAAeuD,GAAO,SAAUC,GAG7C,MAFAA,GAAIuB,UAAY,WAChBvB,EAAIwB,WAAWrC,aAAc,QAAS,IACY,KAA3Ca,EAAIwB,WAAWtC,aAAc,YAEpCe,GAAW,QAAS,SAAUtO,EAAM4C,EAAMoG,GACzC,MAAMA,IAAyC,UAAhChJ,EAAK4G,SAASC,cAA7B,UACQ7G,EAAK+Y,eAOT3K,GAAO,SAAUC,GACtB,MAAuC,OAAhCA,EAAId,aAAa,eAExBe,GAAW7D,EAAU,SAAUzK,EAAM4C,EAAMoG,GAC1C,GAAIsI,EACJ,OAAMtI,GAAN,WACSsI,EAAMtR,EAAKkQ,iBAAkBtN,KAAW0O,EAAIC,UACnDD,EAAIxK,MACJ9G,EAAM4C,MAAW,EAAOA,EAAKiE,cAAgB,OAKjDvJ,EAAO+C,KAAOuM,GACdtP,EAAO8T,KAAOxE,GAAOkF,UACrBxU,EAAO8T,KAAK,KAAO9T,EAAO8T,KAAKtG,QAC/BxN,EAAO0b,OAASpM,GAAO4E,WACvBlU,EAAOgJ,KAAOsG,GAAO7D,QACrBzL,EAAO2b,SAAWrM,GAAO5D,MACzB1L,EAAOmM,SAAWmD,GAAOnD,UAGrB7M,EAEJ,IAAIsc,KAGJ,SAASC,GAAexW,GACvB,GAAIyW,GAASF,EAAcvW,KAI3B,OAHArF,GAAOmE,KAAMkB,EAAQ5C,MAAOf,OAAwB,SAAUsN,EAAG+M,GAChED,EAAQC,IAAS,IAEXD,EAyBR9b,EAAOgc,UAAY,SAAU3W,GAI5BA,EAA6B,gBAAZA,GACduW,EAAcvW,IAAawW,EAAexW,GAC5CrF,EAAOoF,UAAYC,EAEpB,IACC4W,GAEAC,EAEAC,EAEAC,EAEAC,EAEAC,EAEAC,KAEAC,GAASnX,EAAQoX,SAEjBC,EAAO,SAAUjV,GAOhB,IANAwU,EAAS5W,EAAQ4W,QAAUxU,EAC3ByU,GAAQ,EACRI,EAAcF,GAAe,EAC7BA,EAAc,EACdC,EAAeE,EAAK1Z,OACpBsZ,GAAS,EACDI,GAAsBF,EAAdC,EAA4BA,IAC3C,GAAKC,EAAMD,GAAc9X,MAAOiD,EAAM,GAAKA,EAAM,OAAU,GAASpC,EAAQsX,YAAc,CACzFV,GAAS,CACT,OAGFE,GAAS,EACJI,IACCC,EACCA,EAAM3Z,QACV6Z,EAAMF,EAAM5L,SAEFqL,EACXM,KAEAK,EAAKC,YAKRD,GAECE,IAAK,WACJ,GAAKP,EAAO,CAEX,GAAIzG,GAAQyG,EAAK1Z,QACjB,QAAUia,GAAKzY,GACdrE,EAAOmE,KAAME,EAAM,SAAU2K,EAAG7E,GAC/B,GAAIvD,GAAO5G,EAAO4G,KAAMuD,EACV,cAATvD,EACEvB,EAAQqW,QAAWkB,EAAKpG,IAAKrM,IAClCoS,EAAK9b,KAAM0J,GAEDA,GAAOA,EAAItH,QAAmB,WAAT+D,GAEhCkW,EAAK3S,OAGJ1F,WAGC0X,EACJE,EAAeE,EAAK1Z,OAGToZ,IACXG,EAActG,EACd4G,EAAMT,IAGR,MAAOtZ,OAGRoF,OAAQ,WAkBP,MAjBKwU,IACJvc,EAAOmE,KAAMM,UAAW,SAAUuK,EAAG7E,GACpC,GAAI4S,EACJ,QAASA,EAAQ/c,EAAO6J,QAASM,EAAKoS,EAAMQ,IAAY,GACvDR,EAAKpX,OAAQ4X,EAAO,GAEfZ,IACUE,GAATU,GACJV,IAEaC,GAATS,GACJT,OAME3Z,MAIR6T,IAAK,SAAUlV,GACd,MAAOA,GAAKtB,EAAO6J,QAASvI,EAAIib,GAAS,MAASA,IAAQA,EAAK1Z,SAGhE2U,MAAO,WAGN,MAFA+E,MACAF,EAAe,EACR1Z,MAGRka,QAAS,WAER,MADAN,GAAOC,EAAQP,EAAS1c,UACjBoD,MAGRyU,SAAU,WACT,OAAQmF,GAGTS,KAAM,WAKL,MAJAR,GAAQjd,UACF0c,GACLW,EAAKC,UAECla,MAGRsa,OAAQ,WACP,OAAQT,GAGTU,SAAU,SAAU7b,EAASgD,GAU5B,OATKkY,GAAWL,IAASM,IACxBnY,EAAOA,MACPA,GAAShD,EAASgD,EAAK1D,MAAQ0D,EAAK1D,QAAU0D,GACzC8X,EACJK,EAAM/b,KAAM4D,GAEZqY,EAAMrY,IAGD1B,MAGR+Z,KAAM,WAEL,MADAE,GAAKM,SAAUva,KAAM8B,WACd9B,MAGRuZ,MAAO,WACN,QAASA,GAIZ,OAAOU,IAER5c,EAAOoF,QAEN6F,SAAU,SAAUkS,GACnB,GAAIC,KAEA,UAAW,OAAQpd,EAAOgc,UAAU,eAAgB,aACpD,SAAU,OAAQhc,EAAOgc,UAAU,eAAgB,aACnD,SAAU,WAAYhc,EAAOgc,UAAU,YAE1CqB,EAAQ,UACR/Y,GACC+Y,MAAO,WACN,MAAOA,IAERC,OAAQ,WAEP,MADAC,GAAShZ,KAAME,WAAY+Y,KAAM/Y,WAC1B9B,MAER8a,KAAM,WACL,GAAIC,GAAMjZ,SACV,OAAOzE,GAAOiL,SAAS,SAAU0S,GAChC3d,EAAOmE,KAAMiZ,EAAQ,SAAUvY,EAAG+Y,GACjC,GAAIC,GAASD,EAAO,GACnBtc,EAAKtB,EAAOsD,WAAYoa,EAAK7Y,KAAS6Y,EAAK7Y,EAE5C0Y,GAAUK,EAAM,IAAK,WACpB,GAAIE,GAAWxc,GAAMA,EAAGkD,MAAO7B,KAAM8B,UAChCqZ,IAAY9d,EAAOsD,WAAYwa,EAASxZ,SAC5CwZ,EAASxZ,UACPC,KAAMoZ,EAASI,SACfP,KAAMG,EAASK,QACfC,SAAUN,EAASO,QAErBP,EAAUE,EAAS,QAAUlb,OAAS2B,EAAUqZ,EAASrZ,UAAY3B,KAAMrB,GAAOwc,GAAarZ,eAIlGiZ,EAAM,OACJpZ,WAIJA,QAAS,SAAUqC,GAClB,MAAc,OAAPA,EAAc3G,EAAOoF,OAAQuB,EAAKrC,GAAYA,IAGvDiZ,IAwCD,OArCAjZ,GAAQ6Z,KAAO7Z,EAAQmZ,KAGvBzd,EAAOmE,KAAMiZ,EAAQ,SAAUvY,EAAG+Y,GACjC,GAAIrB,GAAOqB,EAAO,GACjBQ,EAAcR,EAAO,EAGtBtZ,GAASsZ,EAAM,IAAOrB,EAAKO,IAGtBsB,GACJ7B,EAAKO,IAAI,WAERO,EAAQe,GAGNhB,EAAY,EAAJvY,GAAS,GAAIgY,QAASO,EAAQ,GAAK,GAAIJ,MAInDO,EAAUK,EAAM,IAAO,WAEtB,MADAL,GAAUK,EAAM,GAAK,QAAUjb,OAAS4a,EAAWjZ,EAAU3B,KAAM8B,WAC5D9B,MAER4a,EAAUK,EAAM,GAAK,QAAWrB,EAAKW,WAItC5Y,EAAQA,QAASiZ,GAGZJ,GACJA,EAAKvZ,KAAM2Z,EAAUA,GAIfA,GAIRc,KAAM,SAAUC,GACf,GAAIzZ,GAAI,EACP0Z,EAAgB7d,EAAWkD,KAAMa,WACjC5B,EAAS0b,EAAc1b,OAGvB2b,EAAuB,IAAX3b,GAAkByb,GAAete,EAAOsD,WAAYgb,EAAYha,SAAczB,EAAS,EAGnG0a,EAAyB,IAAdiB,EAAkBF,EAActe,EAAOiL,WAGlDwT,EAAa,SAAU5Z,EAAGyW,EAAUoD,GACnC,MAAO,UAAUlV,GAChB8R,EAAUzW,GAAMlC,KAChB+b,EAAQ7Z,GAAMJ,UAAU5B,OAAS,EAAInC,EAAWkD,KAAMa,WAAc+E,EAChEkV,IAAWC,EACdpB,EAASqB,WAAYtD,EAAUoD,KACfF,GAChBjB,EAAS/W,YAAa8U,EAAUoD,KAKnCC,EAAgBE,EAAkBC,CAGnC,IAAKjc,EAAS,EAIb,IAHA8b,EAAqB9X,MAAOhE,GAC5Bgc,EAAuBhY,MAAOhE,GAC9Bic,EAAsBjY,MAAOhE,GACjBA,EAAJgC,EAAYA,IACd0Z,EAAe1Z,IAAO7E,EAAOsD,WAAYib,EAAe1Z,GAAIP,SAChEia,EAAe1Z,GAAIP,UACjBC,KAAMka,EAAY5Z,EAAGia,EAAiBP,IACtCf,KAAMD,EAASS,QACfC,SAAUQ,EAAY5Z,EAAGga,EAAkBF,MAE3CH,CAUL,OAJMA,IACLjB,EAAS/W,YAAasY,EAAiBP,GAGjChB,EAASjZ,aAGlBtE,EAAOsL,QAAU,SAAWA,GAC3B,GAAIwH,GAAQlT,EAASiI,cAAc,SAClCkX,EAAWnf,EAASof,yBACpBjO,EAAMnR,EAASiI,cAAc,OAC7B2I,EAAS5Q,EAASiI,cAAc,UAChCoX,EAAMzO,EAAOtH,YAAatJ,EAASiI,cAAc,UAGlD,OAAMiL,GAAMlM,MAIZkM,EAAMlM,KAAO,WAIb0E,EAAQ4T,QAA0B,KAAhBpM,EAAMtJ,MAIxB8B,EAAQ6T,YAAcF,EAAI3H,SAG1BhM,EAAQ8T,qBAAsB,EAC9B9T,EAAQ+T,mBAAoB,EAC5B/T,EAAQgU,eAAgB,EAIxBxM,EAAMuE,SAAU,EAChB/L,EAAQiU,eAAiBzM,EAAM0M,WAAW,GAAOnI,QAIjD7G,EAAO4G,UAAW,EAClB9L,EAAQmU,aAAeR,EAAI7H,SAI3BtE,EAAQlT,EAASiI,cAAc,SAC/BiL,EAAMtJ,MAAQ,IACdsJ,EAAMlM,KAAO,QACb0E,EAAQoU,WAA6B,MAAhB5M,EAAMtJ,MAG3BsJ,EAAM5C,aAAc,UAAW,KAC/B4C,EAAM5C,aAAc,OAAQ,KAE5B6O,EAAS7V,YAAa4J,GAItBxH,EAAQqU,WAAaZ,EAASS,WAAW,GAAOA,WAAW,GAAOxJ,UAAUqB,QAI5E/L,EAAQsU,eAAiB,aAAetgB,GAExCyR,EAAI/F,MAAM6U,eAAiB,cAC3B9O,EAAIyO,WAAW,GAAOxU,MAAM6U,eAAiB,GAC7CvU,EAAQwU,gBAA+C,gBAA7B/O,EAAI/F,MAAM6U,eAGpC7f,EAAO,WACN,GAAI+f,GAAWC,EAEdC,EAAW,8HACXC,EAAOtgB,EAAS6I,qBAAqB,QAAS,EAEzCyX,KAKNH,EAAYngB,EAASiI,cAAc,OACnCkY,EAAU/U,MAAMmV,QAAU,gFAG1BD,EAAKhX,YAAa6W,GAAY7W,YAAa6H,GAC3CA,EAAIuB,UAAY,GAEhBvB,EAAI/F,MAAMmV,QAAU,uKAIpBngB,EAAO8K,KAAMoV,EAAyB,MAAnBA,EAAKlV,MAAMoV,MAAiBA,KAAM,MAAU,WAC9D9U,EAAQ+U,UAAgC,IAApBtP,EAAIuP,cAIpBhhB,EAAOihB,mBACXjV,EAAQgU,cAAuE,QAArDhgB,EAAOihB,iBAAkBxP,EAAK,WAAeoB,IACvE7G,EAAQ+T,kBAA2F,SAArE/f,EAAOihB,iBAAkBxP,EAAK,QAAYyP,MAAO,QAAUA,MAMzFR,EAAYjP,EAAI7H,YAAatJ,EAASiI,cAAc,QACpDmY,EAAUhV,MAAMmV,QAAUpP,EAAI/F,MAAMmV,QAAUF,EAC9CD,EAAUhV,MAAMyV,YAAcT,EAAUhV,MAAMwV,MAAQ,IACtDzP,EAAI/F,MAAMwV,MAAQ,MAElBlV,EAAQ8T,qBACNnY,YAAc3H,EAAOihB,iBAAkBP,EAAW,WAAeS,cAGpEP,EAAK/W,YAAa4W,MAGZzU,GArGCA,MAmHT,IAAIoV,GAAWC,EACdC,EAAS,+BACTC,EAAa,UAEd,SAASC,KAIRlX,OAAOmX,eAAgBpe,KAAK+N,SAAY,GACvC7M,IAAK,WACJ,YAIFlB,KAAKmD,QAAU9F,EAAO8F,QAAUC,KAAKC,SAGtC8a,EAAKE,IAAM,EAEXF,EAAKG,QAAU,SAAUC,GAOxB,MAAOA,GAAMhe,SACO,IAAnBge,EAAMhe,UAAqC,IAAnBge,EAAMhe,UAAiB,GAGjD4d,EAAKxe,WACJiI,IAAK,SAAU2W,GAId,IAAMJ,EAAKG,QAASC,GACnB,MAAO,EAGR,IAAIC,MAEHC,EAASF,EAAOve,KAAKmD,QAGtB,KAAMsb,EAAS,CACdA,EAASN,EAAKE,KAGd,KACCG,EAAYxe,KAAKmD,UAAc0D,MAAO4X,GACtCxX,OAAOyX,iBAAkBH,EAAOC,GAI/B,MAAQ/Z,GACT+Z,EAAYxe,KAAKmD,SAAYsb,EAC7BphB,EAAOoF,OAAQ8b,EAAOC,IASxB,MAJMxe,MAAK+N,MAAO0Q,KACjBze,KAAK+N,MAAO0Q,OAGNA,GAERE,IAAK,SAAUJ,EAAOzZ,EAAM+B,GAC3B,GAAI+X,GAIHH,EAASze,KAAK4H,IAAK2W,GACnBxQ,EAAQ/N,KAAK+N,MAAO0Q,EAGrB,IAAqB,gBAAT3Z,GACXiJ,EAAOjJ,GAAS+B,MAKhB,IAAKxJ,EAAOqH,cAAeqJ,GAC1B1Q,EAAOoF,OAAQzC,KAAK+N,MAAO0Q,GAAU3Z,OAGrC,KAAM8Z,IAAQ9Z,GACbiJ,EAAO6Q,GAAS9Z,EAAM8Z,EAIzB,OAAO7Q,IAER7M,IAAK,SAAUqd,EAAO3W,GAKrB,GAAImG,GAAQ/N,KAAK+N,MAAO/N,KAAK4H,IAAK2W,GAElC,OAAO3W,KAAQhL,UACdmR,EAAQA,EAAOnG,IAEjBD,OAAQ,SAAU4W,EAAO3W,EAAKf,GAC7B,GAAIgY,EAYJ,OAAKjX,KAAQhL,WACTgL,GAAsB,gBAARA,IAAqBf,IAAUjK,WAEhDiiB,EAAS7e,KAAKkB,IAAKqd,EAAO3W,GAEnBiX,IAAWjiB,UACjBiiB,EAAS7e,KAAKkB,IAAKqd,EAAOlhB,EAAOoJ,UAAUmB,MAS7C5H,KAAK2e,IAAKJ,EAAO3W,EAAKf,GAIfA,IAAUjK,UAAYiK,EAAQe,IAEtCxC,OAAQ,SAAUmZ,EAAO3W,GACxB,GAAI1F,GAAGS,EAAMmc,EACZL,EAASze,KAAK4H,IAAK2W,GACnBxQ,EAAQ/N,KAAK+N,MAAO0Q,EAErB,IAAK7W,IAAQhL,UACZoD,KAAK+N,MAAO0Q,UAEN,CAEDphB,EAAO6F,QAAS0E,GAOpBjF,EAAOiF,EAAIhK,OAAQgK,EAAIvF,IAAKhF,EAAOoJ,aAEnCqY,EAAQzhB,EAAOoJ,UAAWmB,GAErBA,IAAOmG,GACXpL,GAASiF,EAAKkX,IAIdnc,EAAOmc,EACPnc,EAAOA,IAAQoL,IACZpL,GAAWA,EAAK7C,MAAOf,SAI5BmD,EAAIS,EAAKzC,MACT,OAAQgC,UACA6L,GAAOpL,EAAMT,MAIvB6c,QAAS,SAAUR,GAClB,OAAQlhB,EAAOqH,cACd1E,KAAK+N,MAAOwQ,EAAOve,KAAKmD,gBAG1B6b,QAAS,SAAUT,GACbA,EAAOve,KAAKmD,gBACTnD,MAAK+N,MAAOwQ,EAAOve,KAAKmD,YAMlC4a,EAAY,GAAII,GAChBH,EAAY,GAAIG,GAGhB9gB,EAAOoF,QACNwc,WAAYd,EAAKG,QAEjBS,QAAS,SAAUhf,GAClB,MAAOge,GAAUgB,QAAShf,IAAUie,EAAUe,QAAShf,IAGxD+E,KAAM,SAAU/E,EAAM4C,EAAMmC,GAC3B,MAAOiZ,GAAUpW,OAAQ5H,EAAM4C,EAAMmC,IAGtCoa,WAAY,SAAUnf,EAAM4C,GAC3Bob,EAAU3Y,OAAQrF,EAAM4C,IAKzBwc,MAAO,SAAUpf,EAAM4C,EAAMmC,GAC5B,MAAOkZ,GAAUrW,OAAQ5H,EAAM4C,EAAMmC,IAGtCsa,YAAa,SAAUrf,EAAM4C,GAC5Bqb,EAAU5Y,OAAQrF,EAAM4C,MAI1BtF,EAAOsB,GAAG8D,QACTqC,KAAM,SAAU8C,EAAKf,GACpB,GAAIyH,GAAO3L,EACV5C,EAAOC,KAAM,GACbkC,EAAI,EACJ4C,EAAO,IAGR,IAAK8C,IAAQhL,UAAY,CACxB,GAAKoD,KAAKE,SACT4E,EAAOiZ,EAAU7c,IAAKnB,GAEC,IAAlBA,EAAKQ,WAAmByd,EAAU9c,IAAKnB,EAAM,iBAAmB,CAEpE,IADAuO,EAAQvO,EAAK6K,WACD0D,EAAMpO,OAAVgC,EAAkBA,IACzBS,EAAO2L,EAAOpM,GAAIS,KAEe,IAA5BA,EAAKzE,QAAS,WAClByE,EAAOtF,EAAOoJ,UAAW9D,EAAK3E,MAAM,IACpCqhB,EAAUtf,EAAM4C,EAAMmC,EAAMnC,IAG9Bqb,GAAUW,IAAK5e,EAAM,gBAAgB,GAIvC,MAAO+E,GAIR,MAAoB,gBAAR8C,GACJ5H,KAAKwB,KAAK,WAChBuc,EAAUY,IAAK3e,KAAM4H,KAIhBvK,EAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,GAAI/B,GACHwa,EAAWjiB,EAAOoJ,UAAWmB,EAO9B,IAAK7H,GAAQ8G,IAAUjK,UAAvB,CAIC,GADAkI,EAAOiZ,EAAU7c,IAAKnB,EAAM6H,GACvB9C,IAASlI,UACb,MAAOkI,EAMR,IADAA,EAAOiZ,EAAU7c,IAAKnB,EAAMuf,GACvBxa,IAASlI,UACb,MAAOkI,EAMR,IADAA,EAAOua,EAAUtf,EAAMuf,EAAU1iB,WAC5BkI,IAASlI,UACb,MAAOkI,OAQT9E,MAAKwB,KAAK,WAGT,GAAIsD,GAAOiZ,EAAU7c,IAAKlB,KAAMsf,EAKhCvB,GAAUY,IAAK3e,KAAMsf,EAAUzY,GAKL,KAArBe,EAAI1J,QAAQ,MAAe4G,IAASlI,WACxCmhB,EAAUY,IAAK3e,KAAM4H,EAAKf,MAG1B,KAAMA,EAAO/E,UAAU5B,OAAS,EAAG,MAAM,IAG7Cgf,WAAY,SAAUtX,GACrB,MAAO5H,MAAKwB,KAAK,WAChBuc,EAAU3Y,OAAQpF,KAAM4H,OAK3B,SAASyX,GAAUtf,EAAM6H,EAAK9C,GAC7B,GAAInC,EAIJ,IAAKmC,IAASlI,WAA+B,IAAlBmD,EAAKQ,SAI/B,GAHAoC,EAAO,QAAUiF,EAAItE,QAAS4a,EAAY,OAAQtX,cAClD9B,EAAO/E,EAAKuN,aAAc3K,GAEL,gBAATmC,GAAoB,CAC/B,IACCA,EAAgB,SAATA,GAAkB,EACf,UAATA,GAAmB,EACV,SAATA,EAAkB,MAEjBA,EAAO,KAAOA,GAAQA,EACvBmZ,EAAOxd,KAAMqE,GAASS,KAAKC,MAAOV,GAClCA,EACA,MAAOL,IAGTsZ,EAAUY,IAAK5e,EAAM6H,EAAK9C,OAE1BA,GAAOlI,SAGT,OAAOkI,GAERzH,EAAOoF,QACN8c,MAAO,SAAUxf,EAAMkE,EAAMa,GAC5B,GAAIya,EAEJ,OAAKxf,IACJkE,GAASA,GAAQ,MAAS,QAC1Bsb,EAAQvB,EAAU9c,IAAKnB,EAAMkE,GAGxBa,KACEya,GAASliB,EAAO6F,QAAS4B,GAC9Bya,EAAQvB,EAAUrW,OAAQ5H,EAAMkE,EAAM5G,EAAO0D,UAAU+D,IAEvDya,EAAMzhB,KAAMgH,IAGPya,OAZR,WAgBDC,QAAS,SAAUzf,EAAMkE,GACxBA,EAAOA,GAAQ,IAEf,IAAIsb,GAAQliB,EAAOkiB,MAAOxf,EAAMkE,GAC/Bwb,EAAcF,EAAMrf,OACpBvB,EAAK4gB,EAAMtR,QACXyR,EAAQriB,EAAOsiB,YAAa5f,EAAMkE,GAClC2b,EAAO,WACNviB,EAAOmiB,QAASzf,EAAMkE;CAIZ,gBAAPtF,IACJA,EAAK4gB,EAAMtR,QACXwR,KAGI9gB,IAIU,OAATsF,GACJsb,EAAMrO,QAAS,oBAITwO,GAAMG,KACblhB,EAAGsC,KAAMlB,EAAM6f,EAAMF,KAGhBD,GAAeC,GACpBA,EAAM7K,MAAMkF,QAKd4F,YAAa,SAAU5f,EAAMkE,GAC5B,GAAI2D,GAAM3D,EAAO,YACjB,OAAO+Z,GAAU9c,IAAKnB,EAAM6H,IAASoW,EAAUrW,OAAQ5H,EAAM6H,GAC5DiN,MAAOxX,EAAOgc,UAAU,eAAec,IAAI,WAC1C6D,EAAU5Y,OAAQrF,GAAQkE,EAAO,QAAS2D,WAM9CvK,EAAOsB,GAAG8D,QACT8c,MAAO,SAAUtb,EAAMa,GACtB,GAAIgb,GAAS,CAQb,OANqB,gBAAT7b,KACXa,EAAOb,EACPA,EAAO,KACP6b,KAGuBA,EAAnBhe,UAAU5B,OACP7C,EAAOkiB,MAAOvf,KAAK,GAAIiE,GAGxBa,IAASlI,UACfoD,KACAA,KAAKwB,KAAK,WACT,GAAI+d,GAAQliB,EAAOkiB,MAAOvf,KAAMiE,EAAMa,EAGtCzH,GAAOsiB,YAAa3f,KAAMiE,GAEZ,OAATA,GAA8B,eAAbsb,EAAM,IAC3BliB,EAAOmiB,QAASxf,KAAMiE,MAI1Bub,QAAS,SAAUvb,GAClB,MAAOjE,MAAKwB,KAAK,WAChBnE,EAAOmiB,QAASxf,KAAMiE,MAKxB8b,MAAO,SAAUC,EAAM/b,GAItB,MAHA+b,GAAO3iB,EAAO4iB,GAAK5iB,EAAO4iB,GAAGC,OAAQF,IAAUA,EAAOA,EACtD/b,EAAOA,GAAQ,KAERjE,KAAKuf,MAAOtb,EAAM,SAAU2b,EAAMF,GACxC,GAAIS,GAAU3X,WAAYoX,EAAMI,EAChCN,GAAMG,KAAO,WACZO,aAAcD,OAIjBE,WAAY,SAAUpc,GACrB,MAAOjE,MAAKuf,MAAOtb,GAAQ,UAI5BtC,QAAS,SAAUsC,EAAMD,GACxB,GAAI2B,GACH2a,EAAQ,EACRC,EAAQljB,EAAOiL,WACf8I,EAAWpR,KACXkC,EAAIlC,KAAKE,OACTkb,EAAU,aACCkF,GACTC,EAAM1c,YAAauN,GAAYA,IAIb,iBAATnN,KACXD,EAAMC,EACNA,EAAOrH,WAERqH,EAAOA,GAAQ,IAEf,OAAO/B,IACNyD,EAAMqY,EAAU9c,IAAKkQ,EAAUlP,GAAK+B,EAAO,cACtC0B,GAAOA,EAAIkP,QACfyL,IACA3a,EAAIkP,MAAMsF,IAAKiB,GAIjB,OADAA,KACOmF,EAAM5e,QAASqC,KAGxB,IAAIwc,GAAUC,EACbC,EAAS,cACTC,EAAU,MACVC,EAAa,qCAEdvjB,GAAOsB,GAAG8D,QACT7B,KAAM,SAAU+B,EAAMkE,GACrB,MAAOxJ,GAAOsK,OAAQ3H,KAAM3C,EAAOuD,KAAM+B,EAAMkE,EAAO/E,UAAU5B,OAAS,IAG1E2gB,WAAY,SAAUle,GACrB,MAAO3C,MAAKwB,KAAK,WAChBnE,EAAOwjB,WAAY7gB,KAAM2C,MAI3Bic,KAAM,SAAUjc,EAAMkE,GACrB,MAAOxJ,GAAOsK,OAAQ3H,KAAM3C,EAAOuhB,KAAMjc,EAAMkE,EAAO/E,UAAU5B,OAAS,IAG1E4gB,WAAY,SAAUne,GACrB,MAAO3C,MAAKwB,KAAK,iBACTxB,MAAM3C,EAAO0jB,QAASpe,IAAUA,MAIzCqe,SAAU,SAAUna,GACnB,GAAIoa,GAASlhB,EAAM2O,EAAKwS,EAAO9e,EAC9BF,EAAI,EACJC,EAAMnC,KAAKE,OACXihB,EAA2B,gBAAVta,IAAsBA,CAExC,IAAKxJ,EAAOsD,WAAYkG,GACvB,MAAO7G,MAAKwB,KAAK,SAAUY,GAC1B/E,EAAQ2C,MAAOghB,SAAUna,EAAM5F,KAAMjB,KAAMoC,EAAGpC,KAAKyP,aAIrD,IAAK0R,EAIJ,IAFAF,GAAYpa,GAAS,IAAK/G,MAAOf,OAErBoD,EAAJD,EAASA,IAOhB,GANAnC,EAAOC,KAAMkC,GACbwM,EAAwB,IAAlB3O,EAAKQ,WAAoBR,EAAK0P,WACjC,IAAM1P,EAAK0P,UAAY,KAAMnM,QAASod,EAAQ,KAChD,KAGU,CACVte,EAAI,CACJ,OAAS8e,EAAQD,EAAQ7e,KACgB,EAAnCsM,EAAIxQ,QAAS,IAAMgjB,EAAQ,OAC/BxS,GAAOwS,EAAQ,IAGjBnhB,GAAK0P,UAAYpS,EAAOmB,KAAMkQ,GAMjC,MAAO1O,OAGRohB,YAAa,SAAUva,GACtB,GAAIoa,GAASlhB,EAAM2O,EAAKwS,EAAO9e,EAC9BF,EAAI,EACJC,EAAMnC,KAAKE,OACXihB,EAA+B,IAArBrf,UAAU5B,QAAiC,gBAAV2G,IAAsBA,CAElE,IAAKxJ,EAAOsD,WAAYkG,GACvB,MAAO7G,MAAKwB,KAAK,SAAUY,GAC1B/E,EAAQ2C,MAAOohB,YAAava,EAAM5F,KAAMjB,KAAMoC,EAAGpC,KAAKyP,aAGxD,IAAK0R,EAGJ,IAFAF,GAAYpa,GAAS,IAAK/G,MAAOf,OAErBoD,EAAJD,EAASA,IAQhB,GAPAnC,EAAOC,KAAMkC,GAEbwM,EAAwB,IAAlB3O,EAAKQ,WAAoBR,EAAK0P,WACjC,IAAM1P,EAAK0P,UAAY,KAAMnM,QAASod,EAAQ,KAChD,IAGU,CACVte,EAAI,CACJ,OAAS8e,EAAQD,EAAQ7e,KAExB,MAAQsM,EAAIxQ,QAAS,IAAMgjB,EAAQ,MAAS,EAC3CxS,EAAMA,EAAIpL,QAAS,IAAM4d,EAAQ,IAAK,IAGxCnhB,GAAK0P,UAAY5I,EAAQxJ,EAAOmB,KAAMkQ,GAAQ,GAKjD,MAAO1O,OAGRqhB,YAAa,SAAUxa,EAAOya,GAC7B,GAAIrd,SAAc4C,EAElB,OAAyB,iBAAbya,IAAmC,WAATrd,EAC9Bqd,EAAWthB,KAAKghB,SAAUna,GAAU7G,KAAKohB,YAAava,GAGzDxJ,EAAOsD,WAAYkG,GAChB7G,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOqhB,YAAaxa,EAAM5F,KAAKjB,KAAMkC,EAAGlC,KAAKyP,UAAW6R,GAAWA,KAItEthB,KAAKwB,KAAK,WAChB,GAAc,WAATyC,EAAoB,CAExB,GAAIwL,GACHvN,EAAI,EACJ+X,EAAO5c,EAAQ2C,MACfuhB,EAAa1a,EAAM/G,MAAOf,MAE3B,OAAS0Q,EAAY8R,EAAYrf,KAE3B+X,EAAKuH,SAAU/R,GACnBwK,EAAKmH,YAAa3R,GAElBwK,EAAK+G,SAAUvR,QAKNxL,IAASlH,GAA8B,YAATkH,KACpCjE,KAAKyP,WAETuO,EAAUW,IAAK3e,KAAM,gBAAiBA,KAAKyP,WAO5CzP,KAAKyP,UAAYzP,KAAKyP,WAAa5I,KAAU,EAAQ,GAAKmX,EAAU9c,IAAKlB,KAAM,kBAAqB,OAKvGwhB,SAAU,SAAU/iB,GACnB,GAAIgR,GAAY,IAAMhR,EAAW,IAChCyD,EAAI,EACJkF,EAAIpH,KAAKE,MACV,MAAYkH,EAAJlF,EAAOA,IACd,GAA0B,IAArBlC,KAAKkC,GAAG3B,WAAmB,IAAMP,KAAKkC,GAAGuN,UAAY,KAAKnM,QAAQod,EAAQ,KAAKxiB,QAASuR,IAAe,EAC3G,OAAO,CAIT,QAAO,GAGR4B,IAAK,SAAUxK,GACd,GAAI6Y,GAAOpe,EAAKX,EACfZ,EAAOC,KAAK,EAEb,EAAA,GAAM8B,UAAU5B,OAsBhB,MAFAS,GAAatD,EAAOsD,WAAYkG,GAEzB7G,KAAKwB,KAAK,SAAUU,GAC1B,GAAImP,EAEmB,KAAlBrR,KAAKO,WAKT8Q,EADI1Q,EACEkG,EAAM5F,KAAMjB,KAAMkC,EAAG7E,EAAQ2C,MAAOqR,OAEpCxK,EAIK,MAAPwK,EACJA,EAAM,GACoB,gBAARA,GAClBA,GAAO,GACIhU,EAAO6F,QAASmO,KAC3BA,EAAMhU,EAAOgF,IAAIgP,EAAK,SAAWxK,GAChC,MAAgB,OAATA,EAAgB,GAAKA,EAAQ,MAItC6Y,EAAQriB,EAAOokB,SAAUzhB,KAAKiE,OAAU5G,EAAOokB,SAAUzhB,KAAK2G,SAASC,eAGjE8Y,GAAW,OAASA,IAAUA,EAAMf,IAAK3e,KAAMqR,EAAK,WAAczU,YACvEoD,KAAK6G,MAAQwK,KAjDd,IAAKtR,EAGJ,MAFA2f,GAAQriB,EAAOokB,SAAU1hB,EAAKkE,OAAU5G,EAAOokB,SAAU1hB,EAAK4G,SAASC,eAElE8Y,GAAS,OAASA,KAAUpe,EAAMoe,EAAMxe,IAAKnB,EAAM,YAAenD,UAC/D0E,GAGRA,EAAMvB,EAAK8G,MAEW,gBAARvF,GAEbA,EAAIgC,QAAQqd,EAAS,IAEd,MAAPrf,EAAc,GAAKA,OA0CxBjE,EAAOoF,QACNgf,UACCC,QACCxgB,IAAK,SAAUnB,GAGd,GAAIsR,GAAMtR,EAAK6K,WAAW/D,KAC1B,QAAQwK,GAAOA,EAAIC,UAAYvR,EAAK8G,MAAQ9G,EAAKsG,OAGnDwH,QACC3M,IAAK,SAAUnB,GACd,GAAI8G,GAAO6a,EACVhf,EAAU3C,EAAK2C,QACf0X,EAAQra,EAAK6U,cACb+M,EAAoB,eAAd5hB,EAAKkE,MAAiC,EAARmW,EACpC2B,EAAS4F,EAAM,QACfC,EAAMD,EAAMvH,EAAQ,EAAI1X,EAAQxC,OAChCgC,EAAY,EAARkY,EACHwH,EACAD,EAAMvH,EAAQ,CAGhB,MAAYwH,EAAJ1f,EAASA,IAIhB,GAHAwf,EAAShf,EAASR,MAGXwf,EAAO/M,UAAYzS,IAAMkY,IAE5B/c,EAAOsL,QAAQmU,YAAe4E,EAAOjN,SAA+C,OAApCiN,EAAOpU,aAAa,cACnEoU,EAAO5gB,WAAW2T,UAAapX,EAAOsJ,SAAU+a,EAAO5gB,WAAY,aAAiB,CAMxF,GAHA+F,EAAQxJ,EAAQqkB,GAASrQ,MAGpBsQ,EACJ,MAAO9a,EAIRkV,GAAOje,KAAM+I,GAIf,MAAOkV,IAGR4C,IAAK,SAAU5e,EAAM8G,GACpB,GAAIgb,GAAWH,EACdhf,EAAU3C,EAAK2C,QACfqZ,EAAS1e,EAAO0D,UAAW8F,GAC3B3E,EAAIQ,EAAQxC,MAEb,OAAQgC,IACPwf,EAAShf,EAASR,IACZwf,EAAO/M,SAAWtX,EAAO6J,QAAS7J,EAAOqkB,GAAQrQ,MAAO0K,IAAY,KACzE8F,GAAY,EAQd,OAHMA,KACL9hB,EAAK6U,cAAgB,IAEfmH,KAKVnb,KAAM,SAAUb,EAAM4C,EAAMkE,GAC3B,GAAI6Y,GAAOpe,EACVwgB,EAAQ/hB,EAAKQ,QAGd,IAAMR,GAAkB,IAAV+hB,GAAyB,IAAVA,GAAyB,IAAVA,EAK5C,aAAY/hB,GAAKuN,eAAiBvQ,EAC1BM,EAAOuhB,KAAM7e,EAAM4C,EAAMkE,IAKlB,IAAVib,GAAgBzkB,EAAO2b,SAAUjZ,KACrC4C,EAAOA,EAAKiE,cACZ8Y,EAAQriB,EAAO0kB,UAAWpf,KACvBtF,EAAO8T,KAAKrR,MAAM+L,KAAKpL,KAAMkC,GAAS8d,EAAWD,IAGhD3Z,IAAUjK,UAaH8iB,GAAS,OAASA,IAA6C,QAAnCpe,EAAMoe,EAAMxe,IAAKnB,EAAM4C,IACvDrB,GAGPA,EAAMjE,EAAO+C,KAAKQ,KAAMb,EAAM4C,GAGhB,MAAPrB,EACN1E,UACA0E,GApBc,OAAVuF,EAGO6Y,GAAS,OAASA,KAAUpe,EAAMoe,EAAMf,IAAK5e,EAAM8G,EAAOlE,MAAY/F,UAC1E0E,GAGPvB,EAAKwN,aAAc5K,EAAMkE,EAAQ,IAC1BA,IAPPxJ,EAAOwjB,WAAY9gB,EAAM4C,GAAzBtF,aAuBHwjB,WAAY,SAAU9gB,EAAM8G,GAC3B,GAAIlE,GAAMqf,EACT9f,EAAI,EACJ+f,EAAYpb,GAASA,EAAM/G,MAAOf,EAEnC,IAAKkjB,GAA+B,IAAlBliB,EAAKQ,SACtB,MAASoC,EAAOsf,EAAU/f,KACzB8f,EAAW3kB,EAAO0jB,QAASpe,IAAUA,EAGhCtF,EAAO8T,KAAKrR,MAAM+L,KAAKpL,KAAMkC,KAEjC5C,EAAMiiB,IAAa,GAGpBjiB,EAAK6N,gBAAiBjL,IAKzBof,WACC9d,MACC0a,IAAK,SAAU5e,EAAM8G,GACpB,IAAMxJ,EAAOsL,QAAQoU,YAAwB,UAAVlW,GAAqBxJ,EAAOsJ,SAAS5G,EAAM,SAAW,CAGxF,GAAIsR,GAAMtR,EAAK8G,KAKf,OAJA9G,GAAKwN,aAAc,OAAQ1G,GACtBwK,IACJtR,EAAK8G,MAAQwK,GAEPxK,MAMXka,SACCmB,MAAO,UACPC,QAAS,aAGVvD,KAAM,SAAU7e,EAAM4C,EAAMkE,GAC3B,GAAIvF,GAAKoe,EAAO0C,EACfN,EAAQ/hB,EAAKQ,QAGd,IAAMR,GAAkB,IAAV+hB,GAAyB,IAAVA,GAAyB,IAAVA,EAY5C,MARAM,GAAmB,IAAVN,IAAgBzkB,EAAO2b,SAAUjZ,GAErCqiB,IAEJzf,EAAOtF,EAAO0jB,QAASpe,IAAUA,EACjC+c,EAAQriB,EAAOglB,UAAW1f,IAGtBkE,IAAUjK,UACP8iB,GAAS,OAASA,KAAUpe,EAAMoe,EAAMf,IAAK5e,EAAM8G,EAAOlE,MAAY/F,UAC5E0E,EACEvB,EAAM4C,GAASkE,EAGX6Y,GAAS,OAASA,IAA6C,QAAnCpe,EAAMoe,EAAMxe,IAAKnB,EAAM4C,IACzDrB,EACAvB,EAAM4C,IAIT0f,WACC9N,UACCrT,IAAK,SAAUnB,GACd,MAAOA,GAAKuiB,aAAc,aAAgB1B,EAAWngB,KAAMV,EAAK4G,WAAc5G,EAAKuU,KAClFvU,EAAKwU,SACL,QAOLkM,GACC9B,IAAK,SAAU5e,EAAM8G,EAAOlE,GAO3B,MANKkE,MAAU,EAEdxJ,EAAOwjB,WAAY9gB,EAAM4C,GAEzB5C,EAAKwN,aAAc5K,EAAMA,GAEnBA,IAGTtF,EAAOmE,KAAMnE,EAAO8T,KAAKrR,MAAM+L,KAAK/M,OAAOgB,MAAO,QAAU,SAAUoC,EAAGS,GACxE,GAAI4f,GAASllB,EAAO8T,KAAK3C,WAAY7L,IAAUtF,EAAO+C,KAAKQ,IAE3DvD,GAAO8T,KAAK3C,WAAY7L,GAAS,SAAU5C,EAAM4C,EAAMoG,GACtD,GAAIpK,GAAKtB,EAAO8T,KAAK3C,WAAY7L,GAChCrB,EAAMyH,EACLnM,WAGCS,EAAO8T,KAAK3C,WAAY7L,GAAS/F,YACjC2lB,EAAQxiB,EAAM4C,EAAMoG,GAEpBpG,EAAKiE,cACL,IAKH,OAFAvJ,GAAO8T,KAAK3C,WAAY7L,GAAShE,EAE1B2C,KAMHjE,EAAOsL,QAAQ6T,cACpBnf,EAAOglB,UAAU1N,UAChBzT,IAAK,SAAUnB,GACd,GAAIsP,GAAStP,EAAKe,UAIlB,OAHKuO,IAAUA,EAAOvO,YACrBuO,EAAOvO,WAAW8T,cAEZ,QAKVvX,EAAOmE,MACN,WACA,WACA,YACA,cACA,cACA,UACA,UACA,SACA,cACA,mBACE,WACFnE,EAAO0jB,QAAS/gB,KAAK4G,eAAkB5G,OAIxC3C,EAAOmE,MAAO,QAAS,YAAc,WACpCnE,EAAOokB,SAAUzhB,OAChB2e,IAAK,SAAU5e,EAAM8G,GACpB,MAAKxJ,GAAO6F,QAAS2D,GACX9G,EAAK2U,QAAUrX,EAAO6J,QAAS7J,EAAO0C,GAAMsR,MAAOxK,IAAW,EADxE,YAKIxJ,EAAOsL,QAAQ4T,UACpBlf,EAAOokB,SAAUzhB,MAAOkB,IAAM,SAAUnB,GAGvC,MAAsC,QAA/BA,EAAKuN,aAAa,SAAoB,KAAOvN,EAAK8G,SAI5D,IAAI2b,GAAY,OACfC,EAAc,+BACdC,EAAc,kCACdC,EAAiB,sBAElB,SAASC,KACR,OAAO,EAGR,QAASC,KACR,OAAO,EAGR,QAASC,KACR,IACC,MAAO7lB,GAASmX,cACf,MAAQ2O,KAOX1lB,EAAO2lB,OAENC,UAEA9I,IAAK,SAAUpa,EAAMmjB,EAAO3U,EAASzJ,EAAMrG,GAE1C,GAAI0kB,GAAaC,EAAazd,EAC7B0d,EAAQC,EAAGC,EACXC,EAASC,EAAUxf,EAAMyf,EAAYC,EACrCC,EAAW5F,EAAU9c,IAAKnB,EAG3B,IAAM6jB,EAAN,CAKKrV,EAAQA,UACZ4U,EAAc5U,EACdA,EAAU4U,EAAY5U,QACtB9P,EAAW0kB,EAAY1kB,UAIlB8P,EAAQ9G,OACb8G,EAAQ9G,KAAOpK,EAAOoK,SAIhB4b,EAASO,EAASP,UACxBA,EAASO,EAASP,YAEZD,EAAcQ,EAASC,UAC7BT,EAAcQ,EAASC,OAAS,SAAUpf,GAGzC,aAAcpH,KAAWN,GAAuB0H,GAAKpH,EAAO2lB,MAAMc,YAAcrf,EAAER,KAEjFrH,UADAS,EAAO2lB,MAAMe,SAASliB,MAAOuhB,EAAYrjB,KAAM+B,YAIjDshB,EAAYrjB,KAAOA,GAIpBmjB,GAAUA,GAAS,IAAKpjB,MAAOf,KAAqB,IACpDukB,EAAIJ,EAAMhjB,MACV,OAAQojB,IACP3d,EAAMgd,EAAexiB,KAAM+iB,EAAMI,QACjCrf,EAAO0f,EAAWhe,EAAI,GACtB+d,GAAe/d,EAAI,IAAM,IAAK+C,MAAO,KAAMnG,OAGrC0B,IAKNuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAGhCA,GAASxF,EAAW+kB,EAAQQ,aAAeR,EAAQS,WAAchgB,EAGjEuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAGhCsf,EAAYlmB,EAAOoF,QAClBwB,KAAMA,EACN0f,SAAUA,EACV7e,KAAMA,EACNyJ,QAASA,EACT9G,KAAM8G,EAAQ9G,KACdhJ,SAAUA,EACVqN,aAAcrN,GAAYpB,EAAO8T,KAAKrR,MAAMgM,aAAarL,KAAMhC,GAC/DylB,UAAWR,EAAWjW,KAAK,MACzB0V,IAGIM,EAAWJ,EAAQpf,MACzBwf,EAAWJ,EAAQpf,MACnBwf,EAASU,cAAgB,EAGnBX,EAAQY,OAASZ,EAAQY,MAAMnjB,KAAMlB,EAAM+E,EAAM4e,EAAYN,MAAkB,GAC/ErjB,EAAK0I,kBACT1I,EAAK0I,iBAAkBxE,EAAMmf,GAAa,IAKxCI,EAAQrJ,MACZqJ,EAAQrJ,IAAIlZ,KAAMlB,EAAMwjB,GAElBA,EAAUhV,QAAQ9G,OACvB8b,EAAUhV,QAAQ9G,KAAO8G,EAAQ9G,OAK9BhJ,EACJglB,EAASjhB,OAAQihB,EAASU,gBAAiB,EAAGZ,GAE9CE,EAAS3lB,KAAMylB,GAIhBlmB,EAAO2lB,MAAMC,OAAQhf,IAAS,EAI/BlE,GAAO,OAIRqF,OAAQ,SAAUrF,EAAMmjB,EAAO3U,EAAS9P,EAAU4lB,GAEjD,GAAIjiB,GAAGkiB,EAAW3e,EACjB0d,EAAQC,EAAGC,EACXC,EAASC,EAAUxf,EAAMyf,EAAYC,EACrCC,EAAW5F,EAAUe,QAAShf,IAAUie,EAAU9c,IAAKnB,EAExD,IAAM6jB,IAAcP,EAASO,EAASP,QAAtC,CAKAH,GAAUA,GAAS,IAAKpjB,MAAOf,KAAqB,IACpDukB,EAAIJ,EAAMhjB,MACV,OAAQojB,IAMP,GALA3d,EAAMgd,EAAexiB,KAAM+iB,EAAMI,QACjCrf,EAAO0f,EAAWhe,EAAI,GACtB+d,GAAe/d,EAAI,IAAM,IAAK+C,MAAO,KAAMnG,OAGrC0B,EAAN,CAOAuf,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAChCA,GAASxF,EAAW+kB,EAAQQ,aAAeR,EAAQS,WAAchgB,EACjEwf,EAAWJ,EAAQpf,OACnB0B,EAAMA,EAAI,IAAUoF,OAAQ,UAAY2Y,EAAWjW,KAAK,iBAAmB,WAG3E6W,EAAYliB,EAAIqhB,EAASvjB,MACzB,OAAQkC,IACPmhB,EAAYE,EAAUrhB,IAEfiiB,GAAeV,IAAaJ,EAAUI,UACzCpV,GAAWA,EAAQ9G,OAAS8b,EAAU9b,MACtC9B,IAAOA,EAAIlF,KAAM8iB,EAAUW,YAC3BzlB,GAAYA,IAAa8kB,EAAU9kB,WAAyB,OAAbA,IAAqB8kB,EAAU9kB,YACjFglB,EAASjhB,OAAQJ,EAAG,GAEfmhB,EAAU9kB,UACdglB,EAASU,gBAELX,EAAQpe,QACZoe,EAAQpe,OAAOnE,KAAMlB,EAAMwjB,GAOzBe,KAAcb,EAASvjB,SACrBsjB,EAAQe,UAAYf,EAAQe,SAAStjB,KAAMlB,EAAM2jB,EAAYE,EAASC,WAAa,GACxFxmB,EAAOmnB,YAAazkB,EAAMkE,EAAM2f,EAASC,cAGnCR,GAAQpf,QAtCf,KAAMA,IAAQof,GACbhmB,EAAO2lB,MAAM5d,OAAQrF,EAAMkE,EAAOif,EAAOI,GAAK/U,EAAS9P,GAAU,EA0C/DpB,GAAOqH,cAAe2e,WACnBO,GAASC,OAChB7F,EAAU5Y,OAAQrF,EAAM,aAI1B+D,QAAS,SAAUkf,EAAOle,EAAM/E,EAAM0kB,GAErC,GAAIviB,GAAGwM,EAAK/I,EAAK+e,EAAYC,EAAQd,EAAQL,EAC5CoB,GAAc7kB,GAAQ9C,GACtBgH,EAAO5F,EAAY4C,KAAM+hB,EAAO,QAAWA,EAAM/e,KAAO+e,EACxDU,EAAarlB,EAAY4C,KAAM+hB,EAAO,aAAgBA,EAAMkB,UAAUxb,MAAM,OAK7E,IAHAgG,EAAM/I,EAAM5F,EAAOA,GAAQ9C,EAGJ,IAAlB8C,EAAKQ,UAAoC,IAAlBR,EAAKQ,WAK5BmiB,EAAYjiB,KAAMwD,EAAO5G,EAAO2lB,MAAMc,aAItC7f,EAAK/F,QAAQ,MAAQ,IAEzBwlB,EAAazf,EAAKyE,MAAM,KACxBzE,EAAOyf,EAAWzV,QAClByV,EAAWnhB,QAEZoiB,EAA6B,EAApB1gB,EAAK/F,QAAQ,MAAY,KAAO+F,EAGzC+e,EAAQA,EAAO3lB,EAAO8F,SACrB6f,EACA,GAAI3lB,GAAOwnB,MAAO5gB,EAAuB,gBAAV+e,IAAsBA,GAGtDA,EAAM8B,UAAYL,EAAe,EAAI,EACrCzB,EAAMkB,UAAYR,EAAWjW,KAAK,KAClCuV,EAAM+B,aAAe/B,EAAMkB,UACtBnZ,OAAQ,UAAY2Y,EAAWjW,KAAK,iBAAmB,WAC3D,KAGDuV,EAAMpQ,OAAShW,UACTomB,EAAMhgB,SACXggB,EAAMhgB,OAASjD,GAIhB+E,EAAe,MAARA,GACJke,GACF3lB,EAAO0D,UAAW+D,GAAQke,IAG3BQ,EAAUnmB,EAAO2lB,MAAMQ,QAASvf,OAC1BwgB,IAAgBjB,EAAQ1f,SAAW0f,EAAQ1f,QAAQjC,MAAO9B,EAAM+E,MAAW,GAAjF,CAMA,IAAM2f,IAAiBjB,EAAQwB,WAAa3nB,EAAO8G,SAAUpE,GAAS,CAMrE,IAJA2kB,EAAalB,EAAQQ,cAAgB/f,EAC/Bye,EAAYjiB,KAAMikB,EAAazgB,KACpCyK,EAAMA,EAAI5N,YAEH4N,EAAKA,EAAMA,EAAI5N,WACtB8jB,EAAU9mB,KAAM4Q,GAChB/I,EAAM+I,CAIF/I,MAAS5F,EAAKS,eAAiBvD,IACnC2nB,EAAU9mB,KAAM6H,EAAI2J,aAAe3J,EAAIsf,cAAgBtoB,GAKzDuF,EAAI,CACJ,QAASwM,EAAMkW,EAAU1iB,QAAU8gB,EAAMkC,uBAExClC,EAAM/e,KAAO/B,EAAI,EAChBwiB,EACAlB,EAAQS,UAAYhgB,EAGrB4f,GAAW7F,EAAU9c,IAAKwN,EAAK,eAAoBsU,EAAM/e,OAAU+Z,EAAU9c,IAAKwN,EAAK,UAClFmV,GACJA,EAAOhiB,MAAO6M,EAAK5J,GAIpB+e,EAASc,GAAUjW,EAAKiW,GACnBd,GAAUxmB,EAAO4hB,WAAYvQ,IAASmV,EAAOhiB,OAASgiB,EAAOhiB,MAAO6M,EAAK5J,MAAW,GACxFke,EAAMmC,gBAkCR,OA/BAnC,GAAM/e,KAAOA,EAGPwgB,GAAiBzB,EAAMoC,sBAErB5B,EAAQ6B,UAAY7B,EAAQ6B,SAASxjB,MAAO+iB,EAAUta,MAAOxF,MAAW,IAC9EzH,EAAO4hB,WAAYlf,IAId4kB,GAAUtnB,EAAOsD,WAAYZ,EAAMkE,MAAa5G,EAAO8G,SAAUpE,KAGrE4F,EAAM5F,EAAM4kB,GAEPhf,IACJ5F,EAAM4kB,GAAW,MAIlBtnB,EAAO2lB,MAAMc,UAAY7f,EACzBlE,EAAMkE,KACN5G,EAAO2lB,MAAMc,UAAYlnB,UAEpB+I,IACJ5F,EAAM4kB,GAAWhf,IAMdqd,EAAMpQ,SAGdmR,SAAU,SAAUf,GAGnBA,EAAQ3lB,EAAO2lB,MAAMsC,IAAKtC,EAE1B,IAAI9gB,GAAGE,EAAGd,EAAKmS,EAAS8P,EACvBgC,KACA7jB,EAAO3D,EAAWkD,KAAMa,WACxB2hB,GAAazF,EAAU9c,IAAKlB,KAAM,eAAoBgjB,EAAM/e,UAC5Duf,EAAUnmB,EAAO2lB,MAAMQ,QAASR,EAAM/e,SAOvC,IAJAvC,EAAK,GAAKshB,EACVA,EAAMwC,eAAiBxlB,MAGlBwjB,EAAQiC,aAAejC,EAAQiC,YAAYxkB,KAAMjB,KAAMgjB,MAAY,EAAxE,CAKAuC,EAAeloB,EAAO2lB,MAAMS,SAASxiB,KAAMjB,KAAMgjB,EAAOS,GAGxDvhB,EAAI,CACJ,QAASuR,EAAU8R,EAAcrjB,QAAW8gB,EAAMkC,uBAAyB,CAC1ElC,EAAM0C,cAAgBjS,EAAQ1T,KAE9BqC,EAAI,CACJ,QAASmhB,EAAY9P,EAAQgQ,SAAUrhB,QAAW4gB,EAAM2C,kCAIjD3C,EAAM+B,cAAgB/B,EAAM+B,aAAatkB,KAAM8iB,EAAUW,cAE9DlB,EAAMO,UAAYA,EAClBP,EAAMle,KAAOye,EAAUze,KAEvBxD,IAASjE,EAAO2lB,MAAMQ,QAASD,EAAUI,eAAkBE,QAAUN,EAAUhV,SAC5E1M,MAAO4R,EAAQ1T,KAAM2B,GAEnBJ,IAAQ1E,YACNomB,EAAMpQ,OAAStR,MAAS,IAC7B0hB,EAAMmC,iBACNnC,EAAM4C,oBAYX,MAJKpC,GAAQqC,cACZrC,EAAQqC,aAAa5kB,KAAMjB,KAAMgjB,GAG3BA,EAAMpQ,SAGd6Q,SAAU,SAAUT,EAAOS,GAC1B,GAAIvhB,GAAGqH,EAASuc,EAAKvC,EACpBgC,KACApB,EAAgBV,EAASU,cACzBzV,EAAMsU,EAAMhgB,MAKb,IAAKmhB,GAAiBzV,EAAInO,YAAcyiB,EAAMjO,QAAyB,UAAfiO,EAAM/e,MAE7D,KAAQyK,IAAQ1O,KAAM0O,EAAMA,EAAI5N,YAAcd,KAG7C,GAAK0O,EAAI+F,YAAa,GAAuB,UAAfuO,EAAM/e,KAAmB,CAEtD,IADAsF,KACMrH,EAAI,EAAOiiB,EAAJjiB,EAAmBA,IAC/BqhB,EAAYE,EAAUvhB,GAGtB4jB,EAAMvC,EAAU9kB,SAAW,IAEtB8K,EAASuc,KAAUlpB,YACvB2M,EAASuc,GAAQvC,EAAUzX,aAC1BzO,EAAQyoB,EAAK9lB,MAAOoa,MAAO1L,IAAS,EACpCrR,EAAO+C,KAAM0lB,EAAK9lB,KAAM,MAAQ0O,IAAQxO,QAErCqJ,EAASuc,IACbvc,EAAQzL,KAAMylB,EAGXha,GAAQrJ,QACZqlB,EAAaznB,MAAOiC,KAAM2O,EAAK+U,SAAUla,IAW7C,MAJqBka,GAASvjB,OAAzBikB,GACJoB,EAAaznB,MAAOiC,KAAMC,KAAMyjB,SAAUA,EAASzlB,MAAOmmB,KAGpDoB,GAIRQ,MAAO,wHAAwHrd,MAAM,KAErIsd,YAEAC,UACCF,MAAO,4BAA4Brd,MAAM,KACzCqH,OAAQ,SAAUiT,EAAOkD,GAOxB,MAJoB,OAAflD,EAAMmD,QACVnD,EAAMmD,MAA6B,MAArBD,EAASE,SAAmBF,EAASE,SAAWF,EAASG,SAGjErD,IAITsD,YACCP,MAAO,uFAAuFrd,MAAM,KACpGqH,OAAQ,SAAUiT,EAAOkD,GACxB,GAAIK,GAAUnX,EAAKmO,EAClBxI,EAASmR,EAASnR,MAkBnB,OAfoB,OAAfiO,EAAMwD,OAAqC,MAApBN,EAASO,UACpCF,EAAWvD,EAAMhgB,OAAOxC,eAAiBvD,EACzCmS,EAAMmX,EAASppB,gBACfogB,EAAOgJ,EAAShJ,KAEhByF,EAAMwD,MAAQN,EAASO,SAAYrX,GAAOA,EAAIsX,YAAcnJ,GAAQA,EAAKmJ,YAAc,IAAQtX,GAAOA,EAAIuX,YAAcpJ,GAAQA,EAAKoJ,YAAc,GACnJ3D,EAAM4D,MAAQV,EAASW,SAAYzX,GAAOA,EAAI0X,WAAcvJ,GAAQA,EAAKuJ,WAAc,IAAQ1X,GAAOA,EAAI2X,WAAcxJ,GAAQA,EAAKwJ,WAAc,IAK9I/D,EAAMmD,OAASpR,IAAWnY,YAC/BomB,EAAMmD,MAAmB,EAATpR,EAAa,EAAe,EAATA,EAAa,EAAe,EAATA,EAAa,EAAI,GAGjEiO,IAITsC,IAAK,SAAUtC,GACd,GAAKA,EAAO3lB,EAAO8F,SAClB,MAAO6f,EAIR,IAAI9gB,GAAG0c,EAAM/b,EACZoB,EAAO+e,EAAM/e,KACb+iB,EAAgBhE,EAChBiE,EAAUjnB,KAAKgmB,SAAU/hB,EAEpBgjB,KACLjnB,KAAKgmB,SAAU/hB,GAASgjB,EACvBxE,EAAYhiB,KAAMwD,GAASjE,KAAKsmB,WAChC9D,EAAU/hB,KAAMwD,GAASjE,KAAKimB,aAGhCpjB,EAAOokB,EAAQlB,MAAQ/lB,KAAK+lB,MAAMnoB,OAAQqpB,EAAQlB,OAAU/lB,KAAK+lB,MAEjE/C,EAAQ,GAAI3lB,GAAOwnB,MAAOmC,GAE1B9kB,EAAIW,EAAK3C,MACT,OAAQgC,IACP0c,EAAO/b,EAAMX,GACb8gB,EAAOpE,GAASoI,EAAepI,EAehC,OAVMoE,GAAMhgB,SACXggB,EAAMhgB,OAAS/F,GAKe,IAA1B+lB,EAAMhgB,OAAOzC,WACjByiB,EAAMhgB,OAASggB,EAAMhgB,OAAOlC,YAGtBmmB,EAAQlX,OAAQkX,EAAQlX,OAAQiT,EAAOgE,GAAkBhE,GAGjEQ,SACC0D,MAEClC,UAAU,GAEX7Q,OAECrQ,QAAS,WACR,MAAK9D,QAAS8iB,KAAuB9iB,KAAKmU,OACzCnU,KAAKmU,SACE,GAFR,WAKD6P,aAAc,WAEfmD,MACCrjB,QAAS,WACR,MAAK9D,QAAS8iB,KAAuB9iB,KAAKmnB,MACzCnnB,KAAKmnB,QACE,GAFR,WAKDnD,aAAc,YAEfoD,OAECtjB,QAAS,WACR,MAAmB,aAAd9D,KAAKiE,MAAuBjE,KAAKonB,OAAS/pB,EAAOsJ,SAAU3G,KAAM,UACrEA,KAAKonB,SACE,GAFR,WAOD/B,SAAU,SAAUrC,GACnB,MAAO3lB,GAAOsJ,SAAUqc,EAAMhgB,OAAQ,OAIxCqkB,cACCxB,aAAc,SAAU7C,GAIlBA,EAAMpQ,SAAWhW,YACrBomB,EAAMgE,cAAcM,YAActE,EAAMpQ,WAM5C2U,SAAU,SAAUtjB,EAAMlE,EAAMijB,EAAOwE,GAItC,GAAI/iB,GAAIpH,EAAOoF,OACd,GAAIpF,GAAOwnB,MACX7B,GAEC/e,KAAMA,EACNwjB,aAAa,EACbT,kBAGGQ,GACJnqB,EAAO2lB,MAAMlf,QAASW,EAAG,KAAM1E,GAE/B1C,EAAO2lB,MAAMe,SAAS9iB,KAAMlB,EAAM0E,GAE9BA,EAAE2gB,sBACNpC,EAAMmC,mBAKT9nB,EAAOmnB,YAAc,SAAUzkB,EAAMkE,EAAM4f,GACrC9jB,EAAKN,qBACTM,EAAKN,oBAAqBwE,EAAM4f,GAAQ,IAI1CxmB,EAAOwnB,MAAQ,SAAUjiB,EAAKmjB,GAE7B,MAAO/lB,gBAAgB3C,GAAOwnB,OAKzBjiB,GAAOA,EAAIqB,MACfjE,KAAKgnB,cAAgBpkB,EACrB5C,KAAKiE,KAAOrB,EAAIqB,KAIhBjE,KAAKolB,mBAAuBxiB,EAAI8kB,kBAC/B9kB,EAAI+kB,mBAAqB/kB,EAAI+kB,oBAAwB/E,EAAaC,GAInE7iB,KAAKiE,KAAOrB,EAIRmjB,GACJ1oB,EAAOoF,OAAQzC,KAAM+lB,GAItB/lB,KAAK4nB,UAAYhlB,GAAOA,EAAIglB,WAAavqB,EAAO4K,MAGhDjI,KAAM3C,EAAO8F,UAAY,EAvBzB,WAJQ,GAAI9F,GAAOwnB,MAAOjiB,EAAKmjB,IAgChC1oB,EAAOwnB,MAAMllB,WACZylB,mBAAoBvC,EACpBqC,qBAAsBrC,EACtB8C,8BAA+B9C,EAE/BsC,eAAgB,WACf,GAAI1gB,GAAIzE,KAAKgnB,aAEbhnB,MAAKolB,mBAAqBxC,EAErBne,GAAKA,EAAE0gB,gBACX1gB,EAAE0gB,kBAGJS,gBAAiB,WAChB,GAAInhB,GAAIzE,KAAKgnB,aAEbhnB,MAAKklB,qBAAuBtC,EAEvBne,GAAKA,EAAEmhB,iBACXnhB,EAAEmhB,mBAGJiC,yBAA0B,WACzB7nB,KAAK2lB,8BAAgC/C,EACrC5iB,KAAK4lB,oBAMPvoB,EAAOmE,MACNsmB,WAAY,YACZC,WAAY,YACV,SAAUC,EAAM1C,GAClBjoB,EAAO2lB,MAAMQ,QAASwE,IACrBhE,aAAcsB,EACdrB,SAAUqB,EAEVzB,OAAQ,SAAUb,GACjB,GAAI1hB,GACH0B,EAAShD,KACTioB,EAAUjF,EAAMkF,cAChB3E,EAAYP,EAAMO,SASnB,SALM0E,GAAYA,IAAYjlB,IAAW3F,EAAOmM,SAAUxG,EAAQilB,MACjEjF,EAAM/e,KAAOsf,EAAUI,SACvBriB,EAAMiiB,EAAUhV,QAAQ1M,MAAO7B,KAAM8B,WACrCkhB,EAAM/e,KAAOqhB,GAEPhkB,MAOJjE,EAAOsL,QAAQsU,gBACpB5f,EAAOmE,MAAO2S,MAAO,UAAWgT,KAAM,YAAc,SAAUa,EAAM1C,GAGnE,GAAI6C,GAAW,EACd5Z,EAAU,SAAUyU,GACnB3lB,EAAO2lB,MAAMuE,SAAUjC,EAAKtC,EAAMhgB,OAAQ3F,EAAO2lB,MAAMsC,IAAKtC,IAAS,GAGvE3lB,GAAO2lB,MAAMQ,QAAS8B,IACrBlB,MAAO,WACc,IAAf+D,KACJlrB,EAASwL,iBAAkBuf,EAAMzZ,GAAS,IAG5CgW,SAAU,WACW,MAAb4D,GACNlrB,EAASwC,oBAAqBuoB,EAAMzZ,GAAS,OAOlDlR,EAAOsB,GAAG8D,QAET2lB,GAAI,SAAUlF,EAAOzkB,EAAUqG,EAAMnG,EAAiBgjB,GACrD,GAAI0G,GAAQpkB,CAGZ,IAAsB,gBAAVif,GAAqB,CAEP,gBAAbzkB,KAEXqG,EAAOA,GAAQrG,EACfA,EAAW7B,UAEZ,KAAMqH,IAAQif,GACbljB,KAAKooB,GAAInkB,EAAMxF,EAAUqG,EAAMoe,EAAOjf,GAAQ0d,EAE/C,OAAO3hB,MAmBR,GAhBa,MAAR8E,GAAsB,MAANnG,GAEpBA,EAAKF,EACLqG,EAAOrG,EAAW7B,WACD,MAAN+B,IACc,gBAAbF,IAEXE,EAAKmG,EACLA,EAAOlI,YAGP+B,EAAKmG,EACLA,EAAOrG,EACPA,EAAW7B,YAGR+B,KAAO,EACXA,EAAKkkB,MACC,KAAMlkB,EACZ,MAAOqB,KAaR,OAVa,KAAR2hB,IACJ0G,EAAS1pB,EACTA,EAAK,SAAUqkB,GAGd,MADA3lB,KAAS0G,IAAKif,GACPqF,EAAOxmB,MAAO7B,KAAM8B,YAG5BnD,EAAG8I,KAAO4gB,EAAO5gB,OAAU4gB,EAAO5gB,KAAOpK,EAAOoK,SAE1CzH,KAAKwB,KAAM,WACjBnE,EAAO2lB,MAAM7I,IAAKna,KAAMkjB,EAAOvkB,EAAImG,EAAMrG,MAG3CkjB,IAAK,SAAUuB,EAAOzkB,EAAUqG,EAAMnG,GACrC,MAAOqB,MAAKooB,GAAIlF,EAAOzkB,EAAUqG,EAAMnG,EAAI,IAE5CoF,IAAK,SAAUmf,EAAOzkB,EAAUE,GAC/B,GAAI4kB,GAAWtf,CACf,IAAKif,GAASA,EAAMiC,gBAAkBjC,EAAMK,UAQ3C,MANAA,GAAYL,EAAMK,UAClBlmB,EAAQ6lB,EAAMsC,gBAAiBzhB,IAC9Bwf,EAAUW,UAAYX,EAAUI,SAAW,IAAMJ,EAAUW,UAAYX,EAAUI,SACjFJ,EAAU9kB,SACV8kB,EAAUhV,SAEJvO,IAER,IAAsB,gBAAVkjB,GAAqB,CAEhC,IAAMjf,IAAQif,GACbljB,KAAK+D,IAAKE,EAAMxF,EAAUykB,EAAOjf,GAElC,OAAOjE,MAUR,OARKvB,KAAa,GAA6B,kBAAbA,MAEjCE,EAAKF,EACLA,EAAW7B,WAEP+B,KAAO,IACXA,EAAKkkB,GAEC7iB,KAAKwB,KAAK,WAChBnE,EAAO2lB,MAAM5d,OAAQpF,KAAMkjB,EAAOvkB,EAAIF,MAIxCqF,QAAS,SAAUG,EAAMa,GACxB,MAAO9E,MAAKwB,KAAK,WAChBnE,EAAO2lB,MAAMlf,QAASG,EAAMa,EAAM9E,SAGpCsoB,eAAgB,SAAUrkB,EAAMa,GAC/B,GAAI/E,GAAOC,KAAK,EAChB,OAAKD,GACG1C,EAAO2lB,MAAMlf,QAASG,EAAMa,EAAM/E,GAAM,GADhD,YAKF,IAAIwoB,GAAW,iBACdC,EAAe,iCACfC,EAAgBprB,EAAO8T,KAAKrR,MAAMgM,aAElC4c,GACCC,UAAU,EACVC,UAAU,EACVhJ,MAAM,EACNiJ,MAAM,EAGRxrB,GAAOsB,GAAG8D,QACTrC,KAAM,SAAU3B,GACf,GAAIyD,GACHZ,KACA2Y,EAAOja,KACPmC,EAAM8X,EAAK/Z,MAEZ,IAAyB,gBAAbzB,GACX,MAAOuB,MAAKoB,UAAW/D,EAAQoB,GAAWsR,OAAO,WAChD,IAAM7N,EAAI,EAAOC,EAAJD,EAASA,IACrB,GAAK7E,EAAOmM,SAAUyQ,EAAM/X,GAAKlC,MAChC,OAAO,IAMX,KAAMkC,EAAI,EAAOC,EAAJD,EAASA,IACrB7E,EAAO+C,KAAM3B,EAAUwb,EAAM/X,GAAKZ,EAMnC,OAFAA,GAAMtB,KAAKoB,UAAWe,EAAM,EAAI9E,EAAO0b,OAAQzX,GAAQA,GACvDA,EAAI7C,SAAWuB,KAAKvB,SAAWuB,KAAKvB,SAAW,IAAMA,EAAWA,EACzD6C,GAGRuS,IAAK,SAAU7Q,GACd,GAAI8lB,GAAUzrB,EAAQ2F,EAAQhD,MAC7BoH,EAAI0hB,EAAQ5oB,MAEb,OAAOF,MAAK+P,OAAO,WAClB,GAAI7N,GAAI,CACR,MAAYkF,EAAJlF,EAAOA,IACd,GAAK7E,EAAOmM,SAAUxJ,KAAM8oB,EAAQ5mB,IACnC,OAAO,KAMXwR,IAAK,SAAUjV,GACd,MAAOuB,MAAKoB,UAAW2nB,GAAO/oB,KAAMvB,OAAgB,KAGrDsR,OAAQ,SAAUtR,GACjB,MAAOuB,MAAKoB,UAAW2nB,GAAO/oB,KAAMvB,OAAgB,KAGrDuqB,GAAI,SAAUvqB,GACb,QAASsqB,GACR/oB,KAIoB,gBAAbvB,IAAyBgqB,EAAchoB,KAAMhC,GACnDpB,EAAQoB,GACRA,OACD,GACCyB,QAGH+oB,QAAS,SAAUpX,EAAWnT,GAC7B,GAAIgQ,GACHxM,EAAI,EACJkF,EAAIpH,KAAKE,OACTuT,KACAyV,EAAQT,EAAchoB,KAAMoR,IAAoC,gBAAdA,GACjDxU,EAAQwU,EAAWnT,GAAWsB,KAAKtB,SACnC,CAEF,MAAY0I,EAAJlF,EAAOA,IACd,IAAMwM,EAAM1O,KAAKkC,GAAIwM,GAAOA,IAAQhQ,EAASgQ,EAAMA,EAAI5N,WAEtD,GAAoB,GAAf4N,EAAInO,WAAkB2oB,EAC1BA,EAAI9O,MAAM1L,GAAO,GAGA,IAAjBA,EAAInO,UACHlD,EAAO+C,KAAKgQ,gBAAgB1B,EAAKmD,IAAc,CAEhDnD,EAAM+E,EAAQ3V,KAAM4Q,EACpB,OAKH,MAAO1O,MAAKoB,UAAWqS,EAAQvT,OAAS,EAAI7C,EAAO0b,OAAQtF,GAAYA,IAKxE2G,MAAO,SAAUra,GAGhB,MAAMA,GAKe,gBAATA,GACJ9B,EAAagD,KAAM5D,EAAQ0C,GAAQC,KAAM,IAI1C/B,EAAagD,KAAMjB,KAGzBD,EAAKH,OAASG,EAAM,GAAMA,GAZjBC,KAAM,IAAOA,KAAM,GAAIc,WAAed,KAAK+B,QAAQonB,UAAUjpB,OAAS,IAgBjFia,IAAK,SAAU1b,EAAUC,GACxB,GAAIigB,GAA0B,gBAAblgB,GACfpB,EAAQoB,EAAUC,GAClBrB,EAAO0D,UAAWtC,GAAYA,EAAS8B,UAAa9B,GAAaA,GAClEY,EAAMhC,EAAOgD,MAAOL,KAAKkB,MAAOyd,EAEjC,OAAO3e,MAAKoB,UAAW/D,EAAO0b,OAAO1Z,KAGtC+pB,QAAS,SAAU3qB,GAClB,MAAOuB,MAAKma,IAAiB,MAAZ1b,EAChBuB,KAAKuB,WAAavB,KAAKuB,WAAWwO,OAAOtR,MAK5C,SAAS4qB,GAAS3a,EAAKuD,GACtB,OAASvD,EAAMA,EAAIuD,KAA0B,IAAjBvD,EAAInO,UAEhC,MAAOmO,GAGRrR,EAAOmE,MACN6N,OAAQ,SAAUtP,GACjB,GAAIsP,GAAStP,EAAKe,UAClB,OAAOuO,IAA8B,KAApBA,EAAO9O,SAAkB8O,EAAS,MAEpDia,QAAS,SAAUvpB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,eAE1BwpB,aAAc,SAAUxpB,EAAMmC,EAAGsnB,GAChC,MAAOnsB,GAAO4U,IAAKlS,EAAM,aAAcypB,IAExC5J,KAAM,SAAU7f,GACf,MAAOspB,GAAStpB,EAAM,gBAEvB8oB,KAAM,SAAU9oB,GACf,MAAOspB,GAAStpB,EAAM,oBAEvB0pB,QAAS,SAAU1pB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,gBAE1BopB,QAAS,SAAUppB,GAClB,MAAO1C,GAAO4U,IAAKlS,EAAM,oBAE1B2pB,UAAW,SAAU3pB,EAAMmC,EAAGsnB,GAC7B,MAAOnsB,GAAO4U,IAAKlS,EAAM,cAAeypB,IAEzCG,UAAW,SAAU5pB,EAAMmC,EAAGsnB,GAC7B,MAAOnsB,GAAO4U,IAAKlS,EAAM,kBAAmBypB,IAE7CI,SAAU,SAAU7pB,GACnB,MAAO1C,GAAOgsB,SAAWtpB,EAAKe,gBAAmB8O,WAAY7P,IAE9D4oB,SAAU,SAAU5oB,GACnB,MAAO1C,GAAOgsB,QAAStpB,EAAK6P,aAE7BgZ,SAAU,SAAU7oB,GACnB,MAAOA,GAAK8pB,iBAAmBxsB,EAAOgD,SAAWN,EAAKsF,cAErD,SAAU1C,EAAMhE,GAClBtB,EAAOsB,GAAIgE,GAAS,SAAU6mB,EAAO/qB,GACpC,GAAIgV,GAAUpW,EAAOgF,IAAKrC,KAAMrB,EAAI6qB,EAsBpC,OApB0B,UAArB7mB,EAAK3E,MAAO,MAChBS,EAAW+qB,GAGP/qB,GAAgC,gBAAbA,KACvBgV,EAAUpW,EAAO0S,OAAQtR,EAAUgV,IAG/BzT,KAAKE,OAAS,IAEZwoB,EAAkB/lB,IACvBtF,EAAO0b,OAAQtF,GAIX+U,EAAa/nB,KAAMkC,IACvB8Q,EAAQqW,WAIH9pB,KAAKoB,UAAWqS,MAIzBpW,EAAOoF,QACNsN,OAAQ,SAAUoB,EAAM9P,EAAOqS,GAC9B,GAAI3T,GAAOsB,EAAO,EAMlB,OAJKqS,KACJvC,EAAO,QAAUA,EAAO,KAGD,IAAjB9P,EAAMnB,QAAkC,IAAlBH,EAAKQ,SACjClD,EAAO+C,KAAKgQ,gBAAiBrQ,EAAMoR,IAAWpR,MAC9C1C,EAAO+C,KAAKmJ,QAAS4H,EAAM9T,EAAOgK,KAAMhG,EAAO,SAAUtB,GACxD,MAAyB,KAAlBA,EAAKQ,aAIf0R,IAAK,SAAUlS,EAAMkS,EAAKuX,GACzB,GAAI/V,MACHsW,EAAWP,IAAU5sB,SAEtB,QAASmD,EAAOA,EAAMkS,KAA4B,IAAlBlS,EAAKQ,SACpC,GAAuB,IAAlBR,EAAKQ,SAAiB,CAC1B,GAAKwpB,GAAY1sB,EAAQ0C,GAAOipB,GAAIQ,GACnC,KAED/V,GAAQ3V,KAAMiC,GAGhB,MAAO0T,IAGR4V,QAAS,SAAUW,EAAGjqB,GACrB,GAAI0T,KAEJ,MAAQuW,EAAGA,EAAIA,EAAEnb,YACI,IAAfmb,EAAEzpB,UAAkBypB,IAAMjqB,GAC9B0T,EAAQ3V,KAAMksB,EAIhB,OAAOvW,KAKT,SAASsV,IAAQ3X,EAAU6Y,EAAWvW,GACrC,GAAKrW,EAAOsD,WAAYspB,GACvB,MAAO5sB,GAAOgK,KAAM+J,EAAU,SAAUrR,EAAMmC,GAE7C,QAAS+nB,EAAUhpB,KAAMlB,EAAMmC,EAAGnC,KAAW2T,GAK/C,IAAKuW,EAAU1pB,SACd,MAAOlD,GAAOgK,KAAM+J,EAAU,SAAUrR,GACvC,MAASA,KAASkqB,IAAgBvW,GAKpC,IAA0B,gBAAduW,GAAyB,CACpC,GAAK1B,EAAS9nB,KAAMwpB,GACnB,MAAO5sB,GAAO0S,OAAQka,EAAW7Y,EAAUsC,EAG5CuW,GAAY5sB,EAAO0S,OAAQka,EAAW7Y,GAGvC,MAAO/T,GAAOgK,KAAM+J,EAAU,SAAUrR,GACvC,MAAS9B,GAAagD,KAAMgpB,EAAWlqB,IAAU,IAAQ2T,IAG3D,GAAIwW,IAAY,0EACfC,GAAW,YACXC,GAAQ,YACRC,GAAe,0BACfC,GAA8B,wBAE9BC,GAAW,oCACXC,GAAc,4BACdC,GAAoB,cACpBC,GAAe,2CAGfC,IAGCjJ,QAAU,EAAG,+BAAgC,aAE7CkJ,OAAS,EAAG,UAAW,YACvBC,KAAO,EAAG,oBAAqB,uBAC/BC,IAAM,EAAG,iBAAkB,oBAC3BC,IAAM,EAAG,qBAAsB,yBAE/B1F,UAAY,EAAG,GAAI,IAIrBsF,IAAQK,SAAWL,GAAQjJ,OAE3BiJ,GAAQM,MAAQN,GAAQO,MAAQP,GAAQQ,SAAWR,GAAQS,QAAUT,GAAQC,MAC7ED,GAAQU,GAAKV,GAAQI,GAErB1tB,EAAOsB,GAAG8D,QACT4D,KAAM,SAAUQ,GACf,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,MAAOA,KAAUjK,UAChBS,EAAOgJ,KAAMrG,MACbA,KAAK6U,QAAQyW,QAAUtrB,KAAM,IAAOA,KAAM,GAAIQ,eAAiBvD,GAAWsuB,eAAgB1kB,KACzF,KAAMA,EAAO/E,UAAU5B,SAG3BorB,OAAQ,WACP,MAAOtrB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GAC1C,GAAuB,IAAlBC,KAAKO,UAAoC,KAAlBP,KAAKO,UAAqC,IAAlBP,KAAKO,SAAiB,CACzE,GAAIyC,GAASyoB,GAAoBzrB,KAAMD,EACvCiD,GAAOuD,YAAaxG,OAKvB2rB,QAAS,WACR,MAAO1rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GAC1C,GAAuB,IAAlBC,KAAKO,UAAoC,KAAlBP,KAAKO,UAAqC,IAAlBP,KAAKO,SAAiB,CACzE,GAAIyC,GAASyoB,GAAoBzrB,KAAMD,EACvCiD,GAAO2oB,aAAc5rB,EAAMiD,EAAO4M,gBAKrCgc,OAAQ,WACP,MAAO5rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACrCC,KAAKc,YACTd,KAAKc,WAAW6qB,aAAc5rB,EAAMC,SAKvC6rB,MAAO,WACN,MAAO7rB,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACrCC,KAAKc,YACTd,KAAKc,WAAW6qB,aAAc5rB,EAAMC,KAAK6O,gBAM5CzJ,OAAQ,SAAU3G,EAAUqtB,GAC3B,GAAI/rB,GACHsB,EAAQ5C,EAAWpB,EAAO0S,OAAQtR,EAAUuB,MAASA,KACrDkC,EAAI,CAEL,MAA6B,OAApBnC,EAAOsB,EAAMa,IAAaA,IAC5B4pB,GAA8B,IAAlB/rB,EAAKQ,UACtBlD,EAAO0uB,UAAWC,GAAQjsB,IAGtBA,EAAKe,aACJgrB,GAAYzuB,EAAOmM,SAAUzJ,EAAKS,cAAeT,IACrDksB,GAAeD,GAAQjsB,EAAM,WAE9BA,EAAKe,WAAW0F,YAAazG,GAI/B,OAAOC,OAGR6U,MAAO,WACN,GAAI9U,GACHmC,EAAI,CAEL,MAA4B,OAAnBnC,EAAOC,KAAKkC,IAAaA,IACV,IAAlBnC,EAAKQ,WAGTlD,EAAO0uB,UAAWC,GAAQjsB,GAAM,IAGhCA,EAAK4R,YAAc,GAIrB,OAAO3R,OAGR+C,MAAO,SAAUmpB,EAAeC,GAI/B,MAHAD,GAAiC,MAAjBA,GAAwB,EAAQA,EAChDC,EAAyC,MAArBA,EAA4BD,EAAgBC,EAEzDnsB,KAAKqC,IAAK,WAChB,MAAOhF,GAAO0F,MAAO/C,KAAMksB,EAAeC,MAI5CC,KAAM,SAAUvlB,GACf,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAU6G,GACrC,GAAI9G,GAAOC,KAAM,OAChBkC,EAAI,EACJkF,EAAIpH,KAAKE,MAEV,IAAK2G,IAAUjK,WAA+B,IAAlBmD,EAAKQ,SAChC,MAAOR,GAAK4P,SAIb,IAAsB,gBAAV9I,KAAuBwjB,GAAa5pB,KAAMoG,KACpD8jB,IAAWR,GAAShqB,KAAM0G,KAAa,GAAI,KAAQ,GAAID,eAAkB,CAE1EC,EAAQA,EAAMvD,QAAS4mB,GAAW,YAElC,KACC,KAAY9iB,EAAJlF,EAAOA,IACdnC,EAAOC,KAAMkC,OAGU,IAAlBnC,EAAKQ,WACTlD,EAAO0uB,UAAWC,GAAQjsB,GAAM,IAChCA,EAAK4P,UAAY9I,EAInB9G,GAAO,EAGN,MAAO0E,KAGL1E,GACJC,KAAK6U,QAAQyW,OAAQzkB,IAEpB,KAAMA,EAAO/E,UAAU5B,SAG3BmsB,YAAa,WACZ,GAEC3qB,GAAOrE,EAAOgF,IAAKrC,KAAM,SAAUD,GAClC,OAASA,EAAK8O,YAAa9O,EAAKe,cAEjCoB,EAAI,CAmBL,OAhBAlC,MAAKwrB,SAAU1pB,UAAW,SAAU/B,GACnC,GAAI6f,GAAOle,EAAMQ,KAChBmN,EAAS3N,EAAMQ,IAEXmN,KAECuQ,GAAQA,EAAK9e,aAAeuO,IAChCuQ,EAAO5f,KAAK6O,aAEbxR,EAAQ2C,MAAOoF,SACfiK,EAAOsc,aAAc5rB,EAAM6f,MAG1B,GAGI1d,EAAIlC,KAAOA,KAAKoF,UAGxBknB,OAAQ,SAAU7tB,GACjB,MAAOuB,MAAKoF,OAAQ3G,GAAU,IAG/B+sB,SAAU,SAAU9pB,EAAMD,EAAU8qB,GAGnC7qB,EAAO/D,EAAYkE,SAAWH,EAE9B,IAAI0a,GAAUra,EAAOkD,EAASunB,EAAYrd,EAAMC,EAC/ClN,EAAI,EACJkF,EAAIpH,KAAKE,OACTye,EAAM3e,KACNysB,EAAWrlB,EAAI,EACfP,EAAQnF,EAAM,GACdf,EAAatD,EAAOsD,WAAYkG,EAGjC,IAAKlG,KAAsB,GAALyG,GAA2B,gBAAVP,IAAsBxJ,EAAOsL,QAAQqU,aAAeuN,GAAS9pB,KAAMoG,GACzG,MAAO7G,MAAKwB,KAAK,SAAU4Y,GAC1B,GAAIH,GAAO0E,EAAI3c,GAAIoY,EACdzZ,KACJe,EAAM,GAAMmF,EAAM5F,KAAMjB,KAAMoa,EAAOH,EAAKmS,SAE3CnS,EAAKuR,SAAU9pB,EAAMD,EAAU8qB,IAIjC,IAAKnlB,IACJgV,EAAW/e,EAAO8H,cAAezD,EAAM1B,KAAM,GAAIQ,eAAe,GAAQ+rB,GAAqBvsB,MAC7F+B,EAAQqa,EAASxM,WAEmB,IAA/BwM,EAAS/W,WAAWnF,SACxBkc,EAAWra,GAGPA,GAAQ,CAMZ,IALAkD,EAAU5H,EAAOgF,IAAK2pB,GAAQ5P,EAAU,UAAYsQ,IACpDF,EAAavnB,EAAQ/E,OAITkH,EAAJlF,EAAOA,IACdiN,EAAOiN,EAEFla,IAAMuqB,IACVtd,EAAO9R,EAAO0F,MAAOoM,GAAM,GAAM,GAG5Bqd,GAGJnvB,EAAOgD,MAAO4E,EAAS+mB,GAAQ7c,EAAM,YAIvC1N,EAASR,KAAMjB,KAAMkC,GAAKiN,EAAMjN,EAGjC,IAAKsqB,EAOJ,IANApd,EAAMnK,EAASA,EAAQ/E,OAAS,GAAIM,cAGpCnD,EAAOgF,IAAK4C,EAAS0nB,IAGfzqB,EAAI,EAAOsqB,EAAJtqB,EAAgBA,IAC5BiN,EAAOlK,EAAS/C,GACXsoB,GAAY/pB,KAAM0O,EAAKlL,MAAQ,MAClC+Z,EAAUrW,OAAQwH,EAAM,eAAkB9R,EAAOmM,SAAU4F,EAAKD,KAE5DA,EAAKvM,IAETvF,EAAOuvB,SAAUzd,EAAKvM,KAEtBvF,EAAO2I,WAAYmJ,EAAKwC,YAAYrO,QAASonB,GAAc,MAQjE,MAAO1qB,SAIT3C,EAAOmE,MACNqrB,SAAU,SACVC,UAAW,UACXnB,aAAc,SACdoB,YAAa,QACbC,WAAY,eACV,SAAUrqB,EAAMujB,GAClB7oB,EAAOsB,GAAIgE,GAAS,SAAUlE,GAC7B,GAAI4C,GACHC,KACA2rB,EAAS5vB,EAAQoB,GACjBwD,EAAOgrB,EAAO/sB,OAAS,EACvBgC,EAAI,CAEL,MAAaD,GAALC,EAAWA,IAClBb,EAAQa,IAAMD,EAAOjC,KAAOA,KAAK+C,OAAO,GACxC1F,EAAQ4vB,EAAQ/qB,IAAOgkB,GAAY7kB,GAInCxD,EAAUgE,MAAOP,EAAKD,EAAMH,MAG7B,OAAOlB,MAAKoB,UAAWE,MAIzBjE,EAAOoF,QACNM,MAAO,SAAUhD,EAAMmsB,EAAeC,GACrC,GAAIjqB,GAAGkF,EAAG8lB,EAAaC,EACtBpqB,EAAQhD,EAAK8c,WAAW,GACxBuQ,EAAS/vB,EAAOmM,SAAUzJ,EAAKS,cAAeT,EAI/C,MAAM1C,EAAOsL,QAAQiU,gBAAsC,IAAlB7c,EAAKQ,UAAoC,KAAlBR,EAAKQ,UAAsBlD,EAAO2b,SAAUjZ,IAM3G,IAHAotB,EAAenB,GAAQjpB,GACvBmqB,EAAclB,GAAQjsB,GAEhBmC,EAAI,EAAGkF,EAAI8lB,EAAYhtB,OAAYkH,EAAJlF,EAAOA,IAC3CmrB,GAAUH,EAAahrB,GAAKirB,EAAcjrB,GAK5C,IAAKgqB,EACJ,GAAKC,EAIJ,IAHAe,EAAcA,GAAelB,GAAQjsB,GACrCotB,EAAeA,GAAgBnB,GAAQjpB,GAEjCb,EAAI,EAAGkF,EAAI8lB,EAAYhtB,OAAYkH,EAAJlF,EAAOA,IAC3CorB,GAAgBJ,EAAahrB,GAAKirB,EAAcjrB,QAGjDorB,IAAgBvtB,EAAMgD,EAWxB,OANAoqB,GAAenB,GAAQjpB,EAAO,UACzBoqB,EAAajtB,OAAS,GAC1B+rB,GAAekB,GAAeC,GAAUpB,GAAQjsB,EAAM,WAIhDgD,GAGRoC,cAAe,SAAU9D,EAAO3C,EAASuG,EAASsoB,GACjD,GAAIxtB,GAAM4F,EAAKuK,EAAKsd,EAAMhkB,EAAUpH,EACnCF,EAAI,EACJkF,EAAI/F,EAAMnB,OACVkc,EAAW1d,EAAQ2d,yBACnBoR,IAED,MAAYrmB,EAAJlF,EAAOA,IAGd,GAFAnC,EAAOsB,EAAOa,GAETnC,GAAiB,IAATA,EAGZ,GAA6B,WAAxB1C,EAAO4G,KAAMlE,GAGjB1C,EAAOgD,MAAOotB,EAAO1tB,EAAKQ,UAAaR,GAASA,OAG1C,IAAMqqB,GAAM3pB,KAAMV,GAIlB,CACN4F,EAAMA,GAAOyW,EAAS7V,YAAa7H,EAAQwG,cAAc,QAGzDgL,GAAQia,GAAShqB,KAAMJ,KAAW,GAAI,KAAO,GAAI6G,cACjD4mB,EAAO7C,GAASza,IAASya,GAAQtF,SACjC1f,EAAIgK,UAAY6d,EAAM,GAAMztB,EAAKuD,QAAS4mB,GAAW,aAAgBsD,EAAM,GAG3EprB,EAAIorB,EAAM,EACV,OAAQprB,IACPuD,EAAMA,EAAI0N,SAKXhW,GAAOgD,MAAOotB,EAAO9nB,EAAIN,YAGzBM,EAAMyW,EAASxM,WAIfjK,EAAIgM,YAAc,OA1BlB8b,GAAM3vB,KAAMY,EAAQ6sB,eAAgBxrB,GAgCvCqc,GAASzK,YAAc,GAEvBzP,EAAI,CACJ,OAASnC,EAAO0tB,EAAOvrB,KAItB,KAAKqrB,GAAmD,KAAtClwB,EAAO6J,QAASnH,EAAMwtB,MAIxC/jB,EAAWnM,EAAOmM,SAAUzJ,EAAKS,cAAeT,GAGhD4F,EAAMqmB,GAAQ5P,EAAS7V,YAAaxG,GAAQ,UAGvCyJ,GACJyiB,GAAetmB,GAIXV,GAAU,CACd7C,EAAI,CACJ,OAASrC,EAAO4F,EAAKvD,KACfooB,GAAY/pB,KAAMV,EAAKkE,MAAQ,KACnCgB,EAAQnH,KAAMiC,GAMlB,MAAOqc,IAGR2P,UAAW,SAAU1qB,GACpB,GAAIyD,GAAM/E,EAAMsjB,EAAQpf,EAAM2D,EAAKxF,EAClCohB,EAAUnmB,EAAO2lB,MAAMQ,QACvBthB,EAAI,CAEL,OAASnC,EAAOsB,EAAOa,MAAStF,UAAWsF,IAAM,CAChD,GAAKic,EAAKG,QAASve,KAClB6H,EAAM7H,EAAMie,EAAU7a,SAEjByE,IAAQ9C,EAAOkZ,EAAUjQ,MAAOnG,KAAS,CAE7C,GADAyb,EAASpc,OAAO6G,KAAMhJ,EAAKue,YACtBA,EAAOnjB,OACX,IAAMkC,EAAI,GAAI6B,EAAOof,EAAOjhB,MAAQxF,UAAWwF,IACzCohB,EAASvf,GACb5G,EAAO2lB,MAAM5d,OAAQrF,EAAMkE,GAI3B5G,EAAOmnB,YAAazkB,EAAMkE,EAAMa,EAAK+e,OAInC7F,GAAUjQ,MAAOnG,UAEdoW,GAAUjQ,MAAOnG,SAKpBmW,GAAUhQ,MAAOhO,EAAMge,EAAU5a,YAI1CypB,SAAU,SAAUc,GACnB,MAAOrwB,GAAOswB,MACbD,IAAKA,EACLzpB,KAAM,MACN2pB,SAAU,SACVC,OAAO,EACP5K,QAAQ,EACR6K,UAAU,MAOb,SAASrC,IAAoB1rB,EAAMguB,GAClC,MAAO1wB,GAAOsJ,SAAU5G,EAAM,UAC7B1C,EAAOsJ,SAA+B,IAArBonB,EAAQxtB,SAAiBwtB,EAAUA,EAAQne,WAAY,MAExE7P,EAAK+F,qBAAqB,SAAS,IAClC/F,EAAKwG,YAAaxG,EAAKS,cAAc0E,cAAc,UACpDnF,EAIF,QAAS2sB,IAAe3sB,GAEvB,MADAA,GAAKkE,MAAsC,OAA9BlE,EAAKuN,aAAa,SAAoB,IAAMvN,EAAKkE,KACvDlE,EAER,QAAS4sB,IAAe5sB,GACvB,GAAID,GAAQ2qB,GAAkBtqB,KAAMJ,EAAKkE,KAQzC,OANKnE,GACJC,EAAKkE,KAAOnE,EAAO,GAEnBC,EAAK6N,gBAAgB,QAGf7N,EAIR,QAASksB,IAAe5qB,EAAO2sB,GAC9B,GAAI5mB,GAAI/F,EAAMnB,OACbgC,EAAI,CAEL,MAAYkF,EAAJlF,EAAOA,IACd8b,EAAUW,IACTtd,EAAOa,GAAK,cAAe8rB,GAAehQ,EAAU9c,IAAK8sB,EAAa9rB,GAAK,eAK9E,QAASorB,IAAgB1qB,EAAKqrB,GAC7B,GAAI/rB,GAAGkF,EAAGnD,EAAMiqB,EAAUC,EAAUC,EAAUC,EAAUhL,CAExD,IAAuB,IAAlB4K,EAAK1tB,SAAV,CAKA,GAAKyd,EAAUe,QAASnc,KACvBsrB,EAAWlQ,EAAUrW,OAAQ/E,GAC7BurB,EAAWnQ,EAAUW,IAAKsP,EAAMC,GAChC7K,EAAS6K,EAAS7K,QAEJ,OACN8K,GAAStK,OAChBsK,EAAS9K,SAET,KAAMpf,IAAQof,GACb,IAAMnhB,EAAI,EAAGkF,EAAIic,EAAQpf,GAAO/D,OAAYkH,EAAJlF,EAAOA,IAC9C7E,EAAO2lB,MAAM7I,IAAK8T,EAAMhqB,EAAMof,EAAQpf,GAAQ/B,IAO7C6b,EAAUgB,QAASnc,KACvBwrB,EAAWrQ,EAAUpW,OAAQ/E,GAC7ByrB,EAAWhxB,EAAOoF,UAAY2rB,GAE9BrQ,EAAUY,IAAKsP,EAAMI,KAKvB,QAASrC,IAAQttB,EAASwR,GACzB,GAAI5O,GAAM5C,EAAQoH,qBAAuBpH,EAAQoH,qBAAsBoK,GAAO,KAC5ExR,EAAQgP,iBAAmBhP,EAAQgP,iBAAkBwC,GAAO,OAG9D,OAAOA,KAAQtT,WAAasT,GAAO7S,EAAOsJ,SAAUjI,EAASwR,GAC5D7S,EAAOgD,OAAS3B,GAAW4C,GAC3BA,EAIF,QAAS+rB,IAAUzqB,EAAKqrB,GACvB,GAAItnB,GAAWsnB,EAAKtnB,SAASC,aAGX,WAAbD,GAAwB2jB,GAA4B7pB,KAAMmC,EAAIqB,MAClEgqB,EAAKvZ,QAAU9R,EAAI8R,SAGK,UAAb/N,GAAqC,aAAbA,KACnCsnB,EAAKnV,aAAelW,EAAIkW,cAG1Bzb,EAAOsB,GAAG8D,QACT6rB,QAAS,SAAUlC,GAClB,GAAIoB,EAEJ,OAAKnwB,GAAOsD,WAAYyrB,GAChBpsB,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOsuB,QAASlC,EAAKnrB,KAAKjB,KAAMkC,OAIrClC,KAAM,KAGVwtB,EAAOnwB,EAAQ+uB,EAAMpsB,KAAM,GAAIQ,eAAgBwB,GAAI,GAAIe,OAAO,GAEzD/C,KAAM,GAAIc,YACd0sB,EAAK7B,aAAc3rB,KAAM,IAG1BwtB,EAAKnrB,IAAI,WACR,GAAItC,GAAOC,IAEX,OAAQD,EAAKwuB,kBACZxuB,EAAOA,EAAKwuB,iBAGb,OAAOxuB,KACLurB,OAAQtrB,OAGLA,OAGRwuB,UAAW,SAAUpC,GACpB,MAAK/uB,GAAOsD,WAAYyrB,GAChBpsB,KAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOwuB,UAAWpC,EAAKnrB,KAAKjB,KAAMkC,MAIrClC,KAAKwB,KAAK,WAChB,GAAIyY,GAAO5c,EAAQ2C,MAClB4oB,EAAW3O,EAAK2O,UAEZA,GAAS1oB,OACb0oB,EAAS0F,QAASlC,GAGlBnS,EAAKqR,OAAQc,MAKhBoB,KAAM,SAAUpB,GACf,GAAIzrB,GAAatD,EAAOsD,WAAYyrB,EAEpC,OAAOpsB,MAAKwB,KAAK,SAAUU,GAC1B7E,EAAQ2C,MAAOsuB,QAAS3tB,EAAayrB,EAAKnrB,KAAKjB,KAAMkC,GAAKkqB,MAI5DqC,OAAQ,WACP,MAAOzuB,MAAKqP,SAAS7N,KAAK,WACnBnE,EAAOsJ,SAAU3G,KAAM,SAC5B3C,EAAQ2C,MAAOqsB,YAAarsB,KAAKqF,cAEhC/C,QAGL,IAAIosB,IAAQC,GAGXC,GAAe,4BACfC,GAAU,UACVC,GAAgB/jB,OAAQ,KAAOlM,EAAY,SAAU,KACrDkwB,GAAgBhkB,OAAQ,KAAOlM,EAAY,kBAAmB,KAC9DmwB,GAAcjkB,OAAQ,YAAclM,EAAY,IAAK,KACrDowB,IAAgBC,KAAM,SAEtBC,IAAYC,SAAU,WAAYC,WAAY,SAAUC,QAAS,SACjEC,IACCC,cAAe,EACfC,WAAY,KAGbC,IAAc,MAAO,QAAS,SAAU,QACxCC,IAAgB,SAAU,IAAK,MAAO,KAGvC,SAASC,IAAgBvnB,EAAO1F,GAG/B,GAAKA,IAAQ0F,GACZ,MAAO1F,EAIR,IAAIktB,GAAUltB,EAAK1C,OAAO,GAAGV,cAAgBoD,EAAK3E,MAAM,GACvD8xB,EAAWntB,EACXT,EAAIytB,GAAYzvB,MAEjB,OAAQgC,IAEP,GADAS,EAAOgtB,GAAaztB,GAAM2tB,EACrBltB,IAAQ0F,GACZ,MAAO1F,EAIT,OAAOmtB,GAGR,QAASC,IAAUhwB,EAAMiwB,GAIxB,MADAjwB,GAAOiwB,GAAMjwB,EAC4B,SAAlC1C,EAAO4yB,IAAKlwB,EAAM,aAA2B1C,EAAOmM,SAAUzJ,EAAKS,cAAeT,GAK1F,QAASmwB,IAAWnwB,GACnB,MAAOpD,GAAOihB,iBAAkB7d,EAAM,MAGvC,QAASowB,IAAU/e,EAAUgf,GAC5B,GAAId,GAASvvB,EAAMswB,EAClBtU,KACA3B,EAAQ,EACRla,EAASkR,EAASlR,MAEnB,MAAgBA,EAARka,EAAgBA,IACvBra,EAAOqR,EAAUgJ,GACXra,EAAKsI,QAIX0T,EAAQ3B,GAAU4D,EAAU9c,IAAKnB,EAAM,cACvCuvB,EAAUvvB,EAAKsI,MAAMinB,QAChBc,GAGErU,EAAQ3B,IAAuB,SAAZkV,IACxBvvB,EAAKsI,MAAMinB,QAAU,IAMM,KAAvBvvB,EAAKsI,MAAMinB,SAAkBS,GAAUhwB,KAC3Cgc,EAAQ3B,GAAU4D,EAAUrW,OAAQ5H,EAAM,aAAcuwB,GAAmBvwB,EAAK4G,aAI3EoV,EAAQ3B,KACbiW,EAASN,GAAUhwB,IAEduvB,GAAuB,SAAZA,IAAuBe,IACtCrS,EAAUW,IAAK5e,EAAM,aAAcswB,EAASf,EAAUjyB,EAAO4yB,IAAIlwB,EAAM,aAQ3E,KAAMqa,EAAQ,EAAWla,EAARka,EAAgBA,IAChCra,EAAOqR,EAAUgJ,GACXra,EAAKsI,QAGL+nB,GAA+B,SAAvBrwB,EAAKsI,MAAMinB,SAA6C,KAAvBvvB,EAAKsI,MAAMinB,UACzDvvB,EAAKsI,MAAMinB,QAAUc,EAAOrU,EAAQ3B,IAAW,GAAK,QAItD,OAAOhJ,GAGR/T,EAAOsB,GAAG8D,QACTwtB,IAAK,SAAUttB,EAAMkE,GACpB,MAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAM4C,EAAMkE,GACjD,GAAI0pB,GAAQpuB,EACXE,KACAH,EAAI,CAEL,IAAK7E,EAAO6F,QAASP,GAAS,CAI7B,IAHA4tB,EAASL,GAAWnwB,GACpBoC,EAAMQ,EAAKzC,OAECiC,EAAJD,EAASA,IAChBG,EAAKM,EAAMT,IAAQ7E,EAAO4yB,IAAKlwB,EAAM4C,EAAMT,IAAK,EAAOquB,EAGxD,OAAOluB,GAGR,MAAOwE,KAAUjK,UAChBS,EAAOgL,MAAOtI,EAAM4C,EAAMkE,GAC1BxJ,EAAO4yB,IAAKlwB,EAAM4C,IACjBA,EAAMkE,EAAO/E,UAAU5B,OAAS,IAEpCkwB,KAAM,WACL,MAAOD,IAAUnwB,MAAM,IAExBwwB,KAAM,WACL,MAAOL,IAAUnwB,OAElBywB,OAAQ,SAAU/V,GACjB,MAAsB,iBAAVA,GACJA,EAAQ1a,KAAKowB,OAASpwB,KAAKwwB,OAG5BxwB,KAAKwB,KAAK,WACXuuB,GAAU/vB,MACd3C,EAAQ2C,MAAOowB,OAEf/yB,EAAQ2C,MAAOwwB,YAMnBnzB,EAAOoF,QAGNiuB,UACCC,SACCzvB,IAAK,SAAUnB,EAAM6wB,GACpB,GAAKA,EAAW,CAEf,GAAItvB,GAAMotB,GAAQ3uB,EAAM,UACxB,OAAe,KAARuB,EAAa,IAAMA,MAO9BuvB,WACCC,aAAe,EACfC,aAAe,EACftB,YAAc,EACduB,YAAc,EACdL,SAAW,EACXM,OAAS,EACTC,SAAW,EACXC,QAAU,EACVC,QAAU,EACV3T,MAAQ,GAKT4T,UAECC,QAAS,YAIVjpB,MAAO,SAAUtI,EAAM4C,EAAMkE,EAAO0qB,GAEnC,GAAMxxB,GAA0B,IAAlBA,EAAKQ,UAAoC,IAAlBR,EAAKQ,UAAmBR,EAAKsI,MAAlE,CAKA,GAAI/G,GAAK2C,EAAMyb,EACdoQ,EAAWzyB,EAAOoJ,UAAW9D,GAC7B0F,EAAQtI,EAAKsI,KASd,OAPA1F,GAAOtF,EAAOg0B,SAAUvB,KAAgBzyB,EAAOg0B,SAAUvB,GAAaF,GAAgBvnB,EAAOynB,IAI7FpQ,EAAQriB,EAAOqzB,SAAU/tB,IAAUtF,EAAOqzB,SAAUZ,GAG/CjpB,IAAUjK,UAiCT8iB,GAAS,OAASA,KAAUpe,EAAMoe,EAAMxe,IAAKnB,GAAM,EAAOwxB,MAAa30B,UACpE0E,EAID+G,EAAO1F,IArCdsB,QAAc4C,GAGA,WAAT5C,IAAsB3C,EAAM0tB,GAAQ7uB,KAAM0G,MAC9CA,GAAUvF,EAAI,GAAK,GAAMA,EAAI,GAAKgD,WAAYjH,EAAO4yB,IAAKlwB,EAAM4C,IAEhEsB,EAAO,UAIM,MAAT4C,GAA0B,WAAT5C,GAAqBI,MAAOwC,KAKpC,WAAT5C,GAAsB5G,EAAOwzB,UAAWf,KAC5CjpB,GAAS,MAKJxJ,EAAOsL,QAAQwU,iBAA6B,KAAVtW,GAA+C,IAA/BlE,EAAKzE,QAAQ,gBACpEmK,EAAO1F,GAAS,WAIX+c,GAAW,OAASA,KAAW7Y,EAAQ6Y,EAAMf,IAAK5e,EAAM8G,EAAO0qB,MAAa30B,YACjFyL,EAAO1F,GAASkE,IAjBjB,aA+BFopB,IAAK,SAAUlwB,EAAM4C,EAAM4uB,EAAOhB,GACjC,GAAIlf,GAAKlQ,EAAKue,EACboQ,EAAWzyB,EAAOoJ,UAAW9D,EAyB9B,OAtBAA,GAAOtF,EAAOg0B,SAAUvB,KAAgBzyB,EAAOg0B,SAAUvB,GAAaF,GAAgB7vB,EAAKsI,MAAOynB,IAIlGpQ,EAAQriB,EAAOqzB,SAAU/tB,IAAUtF,EAAOqzB,SAAUZ,GAG/CpQ,GAAS,OAASA,KACtBrO,EAAMqO,EAAMxe,IAAKnB,GAAM,EAAMwxB,IAIzBlgB,IAAQzU,YACZyU,EAAMqd,GAAQ3uB,EAAM4C,EAAM4tB,IAId,WAARlf,GAAoB1O,IAAQ4sB,MAChCle,EAAMke,GAAoB5sB,IAIZ,KAAV4uB,GAAgBA,GACpBpwB,EAAMmD,WAAY+M,GACXkgB,KAAU,GAAQl0B,EAAO+G,UAAWjD,GAAQA,GAAO,EAAIkQ,GAExDA,KAITqd,GAAS,SAAU3uB,EAAM4C,EAAM6uB,GAC9B,GAAI3T,GAAO4T,EAAUC,EACpBd,EAAWY,GAAatB,GAAWnwB,GAInCuB,EAAMsvB,EAAWA,EAASe,iBAAkBhvB,IAAUiuB,EAAUjuB,GAAS/F,UACzEyL,EAAQtI,EAAKsI,KA8Bd,OA5BKuoB,KAES,KAARtvB,GAAejE,EAAOmM,SAAUzJ,EAAKS,cAAeT,KACxDuB,EAAMjE,EAAOgL,MAAOtI,EAAM4C,IAOtBosB,GAAUtuB,KAAMa,IAASutB,GAAQpuB,KAAMkC,KAG3Ckb,EAAQxV,EAAMwV,MACd4T,EAAWppB,EAAMopB,SACjBC,EAAWrpB,EAAMqpB,SAGjBrpB,EAAMopB,SAAWppB,EAAMqpB,SAAWrpB,EAAMwV,MAAQvc,EAChDA,EAAMsvB,EAAS/S,MAGfxV,EAAMwV,MAAQA,EACdxV,EAAMopB,SAAWA,EACjBppB,EAAMqpB,SAAWA,IAIZpwB,EAIR,SAASswB,IAAmB7xB,EAAM8G,EAAOgrB,GACxC,GAAItoB,GAAUulB,GAAU3uB,KAAM0G,EAC9B,OAAO0C,GAENnG,KAAKwe,IAAK,EAAGrY,EAAS,IAAQsoB,GAAY,KAAUtoB,EAAS,IAAO,MACpE1C,EAGF,QAASirB,IAAsB/xB,EAAM4C,EAAM4uB,EAAOQ,EAAaxB,GAC9D,GAAIruB,GAAIqvB,KAAYQ,EAAc,SAAW,WAE5C,EAES,UAATpvB,EAAmB,EAAI,EAEvB0O,EAAM,CAEP,MAAY,EAAJnP,EAAOA,GAAK,EAEJ,WAAVqvB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAMwxB,EAAQ7B,GAAWxtB,IAAK,EAAMquB,IAGnDwB,GAEW,YAAVR,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,UAAY2vB,GAAWxtB,IAAK,EAAMquB,IAI7C,WAAVgB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,SAAW2vB,GAAWxtB,GAAM,SAAS,EAAMquB,MAIrElf,GAAOhU,EAAO4yB,IAAKlwB,EAAM,UAAY2vB,GAAWxtB,IAAK,EAAMquB,GAG5C,YAAVgB,IACJlgB,GAAOhU,EAAO4yB,IAAKlwB,EAAM,SAAW2vB,GAAWxtB,GAAM,SAAS,EAAMquB,IAKvE,OAAOlf,GAGR,QAAS2gB,IAAkBjyB,EAAM4C,EAAM4uB,GAGtC,GAAIU,IAAmB,EACtB5gB,EAAe,UAAT1O,EAAmB5C,EAAK4d,YAAc5d,EAAKmyB,aACjD3B,EAASL,GAAWnwB,GACpBgyB,EAAc10B,EAAOsL,QAAQ+U,WAAgE,eAAnDrgB,EAAO4yB,IAAKlwB,EAAM,aAAa,EAAOwwB,EAKjF,IAAY,GAAPlf,GAAmB,MAAPA,EAAc,CAQ9B,GANAA,EAAMqd,GAAQ3uB,EAAM4C,EAAM4tB,IACf,EAANlf,GAAkB,MAAPA,KACfA,EAAMtR,EAAKsI,MAAO1F,IAIdosB,GAAUtuB,KAAK4Q,GACnB,MAAOA,EAKR4gB,GAAmBF,IAAiB10B,EAAOsL,QAAQ+T,mBAAqBrL,IAAQtR,EAAKsI,MAAO1F,IAG5F0O,EAAM/M,WAAY+M,IAAS,EAI5B,MAASA,GACRygB,GACC/xB,EACA4C,EACA4uB,IAAWQ,EAAc,SAAW,WACpCE,EACA1B,GAEE,KAIL,QAASD,IAAoB3pB,GAC5B,GAAIyI,GAAMnS,EACTqyB,EAAUL,GAAatoB,EA0BxB,OAxBM2oB,KACLA,EAAU6C,GAAexrB,EAAUyI,GAGlB,SAAZkgB,GAAuBA,IAE3BX,IAAWA,IACVtxB,EAAO,kDACN4yB,IAAK,UAAW,6BAChBpD,SAAUzd,EAAIjS,iBAGhBiS,GAAQuf,GAAO,GAAGyD,eAAiBzD,GAAO,GAAG9E,iBAAkB5sB,SAC/DmS,EAAIijB,MAAM,+BACVjjB,EAAIkjB,QAEJhD,EAAU6C,GAAexrB,EAAUyI,GACnCuf,GAAOrC,UAIR2C,GAAatoB,GAAa2oB,GAGpBA,EAIR,QAAS6C,IAAexvB,EAAMyM,GAC7B,GAAIrP,GAAO1C,EAAQ+R,EAAIlK,cAAevC,IAASkqB,SAAUzd,EAAImO,MAC5D+R,EAAUjyB,EAAO4yB,IAAKlwB,EAAK,GAAI,UAEhC,OADAA,GAAKqF,SACEkqB,EAGRjyB,EAAOmE,MAAO,SAAU,SAAW,SAAUU,EAAGS,GAC/CtF,EAAOqzB,SAAU/tB,IAChBzB,IAAK,SAAUnB,EAAM6wB,EAAUW,GAC9B,MAAKX,GAGwB,IAArB7wB,EAAK4d,aAAqBiR,GAAanuB,KAAMpD,EAAO4yB,IAAKlwB,EAAM,YACrE1C,EAAO8K,KAAMpI,EAAMovB,GAAS,WAC3B,MAAO6C,IAAkBjyB,EAAM4C,EAAM4uB,KAEtCS,GAAkBjyB,EAAM4C,EAAM4uB,GAPhC,WAWD5S,IAAK,SAAU5e,EAAM8G,EAAO0qB,GAC3B,GAAIhB,GAASgB,GAASrB,GAAWnwB,EACjC,OAAO6xB,IAAmB7xB,EAAM8G,EAAO0qB,EACtCO,GACC/xB,EACA4C,EACA4uB,EACAl0B,EAAOsL,QAAQ+U,WAAgE,eAAnDrgB,EAAO4yB,IAAKlwB,EAAM,aAAa,EAAOwwB,GAClEA,GACG,OAQRlzB,EAAO,WAEAA,EAAOsL,QAAQ8T,sBACpBpf,EAAOqzB,SAAS5S,aACf5c,IAAK,SAAUnB,EAAM6wB,GACpB,MAAKA,GAIGvzB,EAAO8K,KAAMpI,GAAQuvB,QAAW,gBACtCZ,IAAU3uB,EAAM,gBALlB,cAcG1C,EAAOsL,QAAQgU,eAAiBtf,EAAOsB,GAAGywB,UAC/C/xB,EAAOmE,MAAQ,MAAO,QAAU,SAAUU,EAAG0c,GAC5CvhB,EAAOqzB,SAAU9R,IAChB1d,IAAK,SAAUnB,EAAM6wB,GACpB,MAAKA,IACJA,EAAWlC,GAAQ3uB,EAAM6e,GAElBmQ,GAAUtuB,KAAMmwB,GACtBvzB,EAAQ0C,GAAOqvB,WAAYxQ,GAAS,KACpCgS,GALF,gBAcAvzB,EAAO8T,MAAQ9T,EAAO8T,KAAKwE,UAC/BtY,EAAO8T,KAAKwE,QAAQ0a,OAAS,SAAUtwB,GAGtC,MAA2B,IAApBA,EAAK4d,aAAyC,GAArB5d,EAAKmyB,cAGtC70B,EAAO8T,KAAKwE,QAAQ4c,QAAU,SAAUxyB,GACvC,OAAQ1C,EAAO8T,KAAKwE,QAAQ0a,OAAQtwB,KAKtC1C,EAAOmE,MACNgxB,OAAQ,GACRC,QAAS,GACTC,OAAQ,SACN,SAAUC,EAAQC,GACpBv1B,EAAOqzB,SAAUiC,EAASC,IACzBC,OAAQ,SAAUhsB,GACjB,GAAI3E,GAAI,EACP4wB,KAGAC,EAAyB,gBAAVlsB,GAAqBA,EAAM6B,MAAM,MAAS7B,EAE1D,MAAY,EAAJ3E,EAAOA,IACd4wB,EAAUH,EAASjD,GAAWxtB,GAAM0wB,GACnCG,EAAO7wB,IAAO6wB,EAAO7wB,EAAI,IAAO6wB,EAAO,EAGzC,OAAOD,KAIHjE,GAAQpuB,KAAMkyB,KACnBt1B,EAAOqzB,SAAUiC,EAASC,GAASjU,IAAMiT,KAG3C,IAAIoB,IAAM,OACTC,GAAW,QACXC,GAAQ,SACRC,GAAkB,wCAClBC,GAAe,oCAEhB/1B,GAAOsB,GAAG8D,QACT4wB,UAAW,WACV,MAAOh2B,GAAOi2B,MAAOtzB,KAAKuzB,mBAE3BA,eAAgB,WACf,MAAOvzB,MAAKqC,IAAI,WAEf,GAAI+O,GAAW/T,EAAOuhB,KAAM5e,KAAM,WAClC,OAAOoR,GAAW/T,EAAO0D,UAAWqQ,GAAapR,OAEjD+P,OAAO,WACP,GAAI9L,GAAOjE,KAAKiE,IAEhB,OAAOjE,MAAK2C,OAAStF,EAAQ2C,MAAOgpB,GAAI,cACvCoK,GAAa3yB,KAAMT,KAAK2G,YAAewsB,GAAgB1yB,KAAMwD,KAC3DjE,KAAK0U,UAAY4V,GAA4B7pB,KAAMwD,MAEtD5B,IAAI,SAAUH,EAAGnC,GACjB,GAAIsR,GAAMhU,EAAQ2C,MAAOqR,KAEzB,OAAc,OAAPA,EACN,KACAhU,EAAO6F,QAASmO,GACfhU,EAAOgF,IAAKgP,EAAK,SAAUA,GAC1B,OAAS1O,KAAM5C,EAAK4C,KAAMkE,MAAOwK,EAAI/N,QAAS4vB,GAAO,YAEpDvwB,KAAM5C,EAAK4C,KAAMkE,MAAOwK,EAAI/N,QAAS4vB,GAAO,WAC9ChyB,SAML7D,EAAOi2B,MAAQ,SAAUrpB,EAAGupB,GAC3B,GAAIb,GACHc,KACAtZ,EAAM,SAAUvS,EAAKf,GAEpBA,EAAQxJ,EAAOsD,WAAYkG,GAAUA,IAAqB,MAATA,EAAgB,GAAKA,EACtE4sB,EAAGA,EAAEvzB,QAAWwzB,mBAAoB9rB,GAAQ,IAAM8rB,mBAAoB7sB,GASxE,IALK2sB,IAAgB52B,YACpB42B,EAAcn2B,EAAOs2B,cAAgBt2B,EAAOs2B,aAAaH,aAIrDn2B,EAAO6F,QAAS+G,IAASA,EAAErK,SAAWvC,EAAOqD,cAAeuJ,GAEhE5M,EAAOmE,KAAMyI,EAAG,WACfkQ,EAAKna,KAAK2C,KAAM3C,KAAK6G,aAMtB,KAAM8rB,IAAU1oB,GACf2pB,GAAajB,EAAQ1oB,EAAG0oB,GAAUa,EAAarZ,EAKjD,OAAOsZ,GAAEhmB,KAAM,KAAMnK,QAAS0vB,GAAK,KAGpC,SAASY,IAAajB,EAAQ3uB,EAAKwvB,EAAarZ,GAC/C,GAAIxX,EAEJ,IAAKtF,EAAO6F,QAASc,GAEpB3G,EAAOmE,KAAMwC,EAAK,SAAU9B,EAAG2xB,GACzBL,GAAeP,GAASxyB,KAAMkyB,GAElCxY,EAAKwY,EAAQkB,GAIbD,GAAajB,EAAS,KAAqB,gBAANkB,GAAiB3xB,EAAI,IAAO,IAAK2xB,EAAGL,EAAarZ,SAIlF,IAAMqZ,GAAsC,WAAvBn2B,EAAO4G,KAAMD,GAQxCmW,EAAKwY,EAAQ3uB,OANb,KAAMrB,IAAQqB,GACb4vB,GAAajB,EAAS,IAAMhwB,EAAO,IAAKqB,EAAKrB,GAAQ6wB,EAAarZ,GAQrE9c,EAAOmE,KAAM,0MAEqDkH,MAAM,KAAM,SAAUxG,EAAGS,GAG1FtF,EAAOsB,GAAIgE,GAAS,SAAUmC,EAAMnG,GACnC,MAAOmD,WAAU5B,OAAS,EACzBF,KAAKooB,GAAIzlB,EAAM,KAAMmC,EAAMnG,GAC3BqB,KAAK8D,QAASnB,MAIjBtF,EAAOsB,GAAG8D,QACTqxB,MAAO,SAAUC,EAAQC,GACxB,MAAOh0B,MAAK8nB,WAAYiM,GAAShM,WAAYiM,GAASD,IAGvDE,KAAM,SAAU/Q,EAAOpe,EAAMnG,GAC5B,MAAOqB,MAAKooB,GAAIlF,EAAO,KAAMpe,EAAMnG,IAEpCu1B,OAAQ,SAAUhR,EAAOvkB,GACxB,MAAOqB,MAAK+D,IAAKmf,EAAO,KAAMvkB;EAG/Bw1B,SAAU,SAAU11B,EAAUykB,EAAOpe,EAAMnG,GAC1C,MAAOqB,MAAKooB,GAAIlF,EAAOzkB,EAAUqG,EAAMnG,IAExCy1B,WAAY,SAAU31B,EAAUykB,EAAOvkB,GAEtC,MAA4B,KAArBmD,UAAU5B,OAAeF,KAAK+D,IAAKtF,EAAU,MAASuB,KAAK+D,IAAKmf,EAAOzkB,GAAY,KAAME,KAGlG,IAEC01B,IACAC,GAEAC,GAAal3B,EAAO4K,MAEpBusB,GAAc,KACdC,GAAQ,OACRC,GAAM,gBACNC,GAAW,6BAEXC,GAAiB,4DACjBC,GAAa,iBACbC,GAAY,QACZC,GAAO,8CAGPC,GAAQ33B,EAAOsB,GAAGuoB,KAWlB+N,MAOAC,MAGAC,GAAW,KAAKv3B,OAAO,IAIxB,KACC02B,GAAet3B,EAASsX,KACvB,MAAO7P,IAGR6vB,GAAer3B,EAASiI,cAAe,KACvCovB,GAAahgB,KAAO,GACpBggB,GAAeA,GAAahgB,KAI7B+f,GAAeU,GAAK50B,KAAMm0B,GAAa1tB,kBAGvC,SAASwuB,IAA6BC,GAGrC,MAAO,UAAUC,EAAoB9a,GAED,gBAAvB8a,KACX9a,EAAO8a,EACPA,EAAqB,IAGtB,IAAI1H,GACH1rB,EAAI,EACJqzB,EAAYD,EAAmB1uB,cAAc9G,MAAOf,MAErD,IAAK1B,EAAOsD,WAAY6Z,GAEvB,MAASoT,EAAW2H,EAAUrzB,KAER,MAAhB0rB,EAAS,IACbA,EAAWA,EAAS5vB,MAAO,IAAO,KACjCq3B,EAAWzH,GAAayH,EAAWzH,QAAkB1c,QAASsJ,KAI9D6a,EAAWzH,GAAayH,EAAWzH,QAAkB9vB,KAAM0c,IAQjE,QAASgb,IAA+BH,EAAW3yB,EAAS+yB,EAAiBC,GAE5E,GAAIC,MACHC,EAAqBP,IAAcH,EAEpC,SAASW,GAASjI,GACjB,GAAIjZ,EAYJ,OAXAghB,GAAW/H,IAAa,EACxBvwB,EAAOmE,KAAM6zB,EAAWzH,OAAkB,SAAUvhB,EAAGypB,GACtD,GAAIC,GAAsBD,EAAoBpzB,EAAS+yB,EAAiBC,EACxE,OAAmC,gBAAxBK,IAAqCH,GAAqBD,EAAWI,GAIpEH,IACDjhB,EAAWohB,GADf,WAHNrzB,EAAQ6yB,UAAUrkB,QAAS6kB,GAC3BF,EAASE,IACF,KAKFphB,EAGR,MAAOkhB,GAASnzB,EAAQ6yB,UAAW,MAAUI,EAAW,MAASE,EAAS,KAM3E,QAASG,IAAYhzB,EAAQJ,GAC5B,GAAIgF,GAAK3E,EACRgzB,EAAc54B,EAAOs2B,aAAasC,eAEnC,KAAMruB,IAAOhF,GACPA,EAAKgF,KAAUhL,aACjBq5B,EAAaruB,GAAQ5E,EAAWC,IAASA,OAAgB2E,GAAQhF,EAAKgF,GAO1E,OAJK3E,IACJ5F,EAAOoF,QAAQ,EAAMO,EAAQC,GAGvBD,EAGR3F,EAAOsB,GAAGuoB,KAAO,SAAUwG,EAAKwI,EAAQz0B,GACvC,GAAoB,gBAARisB,IAAoBsH,GAC/B,MAAOA,IAAMnzB,MAAO7B,KAAM8B,UAG3B,IAAIrD,GAAUwF,EAAMkyB,EACnBlc,EAAOja,KACP+D,EAAM2pB,EAAIxvB,QAAQ,IA+CnB,OA7CK6F,IAAO,IACXtF,EAAWivB,EAAI1vB,MAAO+F,GACtB2pB,EAAMA,EAAI1vB,MAAO,EAAG+F,IAIhB1G,EAAOsD,WAAYu1B,IAGvBz0B,EAAWy0B,EACXA,EAASt5B,WAGEs5B,GAA4B,gBAAXA,KAC5BjyB,EAAO,QAIHgW,EAAK/Z,OAAS,GAClB7C,EAAOswB,MACND,IAAKA,EAGLzpB,KAAMA,EACN2pB,SAAU,OACV9oB,KAAMoxB,IACJt0B,KAAK,SAAUw0B,GAGjBD,EAAWr0B,UAEXmY,EAAKmS,KAAM3tB,EAIVpB,EAAO,SAASiuB,OAAQjuB,EAAOiD,UAAW81B,IAAiBh2B,KAAM3B,GAGjE23B,KAECC,SAAU50B,GAAY,SAAUi0B,EAAOY,GACzCrc,EAAKzY,KAAMC,EAAU00B,IAAcT,EAAMU,aAAcE,EAAQZ,MAI1D11B,MAIR3C,EAAOmE,MAAQ,YAAa,WAAY,eAAgB,YAAa,cAAe,YAAc,SAAUU,EAAG+B,GAC9G5G,EAAOsB,GAAIsF,GAAS,SAAUtF,GAC7B,MAAOqB,MAAKooB,GAAInkB,EAAMtF,MAIxBtB,EAAOoF,QAGN8zB,OAAQ,EAGRC,gBACAC,QAEA9C,cACCjG,IAAK4G,GACLrwB,KAAM,MACNyyB,QAAS9B,GAAen0B,KAAM4zB,GAAc,IAC5CpR,QAAQ,EACR0T,aAAa,EACb9I,OAAO,EACP+I,YAAa,mDAabtY,SACCuY,IAAK1B,GACL9uB,KAAM,aACN+lB,KAAM,YACN1mB,IAAK,4BACLoxB,KAAM,qCAGPlO,UACCljB,IAAK,MACL0mB,KAAM,OACN0K,KAAM,QAGPC,gBACCrxB,IAAK,cACLW,KAAM,eACNywB,KAAM,gBAKPE,YAGCC,SAAUzyB,OAGV0yB,aAAa,EAGbC,YAAa95B,EAAOiI,UAGpB8xB,WAAY/5B,EAAOoI,UAOpBwwB,aACCvI,KAAK,EACLhvB,SAAS,IAOX24B,UAAW,SAAUr0B,EAAQs0B,GAC5B,MAAOA,GAGNtB,GAAYA,GAAYhzB,EAAQ3F,EAAOs2B,cAAgB2D,GAGvDtB,GAAY34B,EAAOs2B,aAAc3wB,IAGnCu0B,cAAenC,GAA6BH,IAC5CuC,cAAepC,GAA6BF,IAG5CvH,KAAM,SAAUD,EAAKhrB,GAGA,gBAARgrB,KACXhrB,EAAUgrB,EACVA,EAAM9wB,WAIP8F,EAAUA,KAEV,IAAI+0B,GAEHC,EAEAC,EACAC,EAEAC,EAEA9E,EAEA+E,EAEA51B,EAEAuxB,EAAIp2B,EAAOg6B,aAAe30B,GAE1Bq1B,EAAkBtE,EAAE/0B,SAAW+0B,EAE/BuE,EAAqBvE,EAAE/0B,UAAaq5B,EAAgBx3B,UAAYw3B,EAAgBn4B,QAC/EvC,EAAQ06B,GACR16B,EAAO2lB,MAERpI,EAAWvd,EAAOiL,WAClB2vB,EAAmB56B,EAAOgc,UAAU,eAEpC6e,EAAazE,EAAEyE,eAEfC,KACAC,KAEA1d,EAAQ,EAER2d,EAAW,WAEX3C,GACCntB,WAAY,EAGZ+vB,kBAAmB,SAAU1wB,GAC5B,GAAI9H,EACJ,IAAe,IAAV4a,EAAc,CAClB,IAAMkd,EAAkB,CACvBA,IACA,OAAS93B,EAAQ60B,GAASx0B,KAAMw3B,GAC/BC,EAAiB93B,EAAM,GAAG8G,eAAkB9G,EAAO,GAGrDA,EAAQ83B,EAAiBhwB,EAAIhB,eAE9B,MAAgB,OAAT9G,EAAgB,KAAOA,GAI/By4B,sBAAuB,WACtB,MAAiB,KAAV7d,EAAcid,EAAwB,MAI9Ca,iBAAkB,SAAU71B,EAAMkE,GACjC,GAAI4xB,GAAQ91B,EAAKiE,aAKjB,OAJM8T,KACL/X,EAAOy1B,EAAqBK,GAAUL,EAAqBK,IAAW91B,EACtEw1B,EAAgBx1B,GAASkE,GAEnB7G,MAIR04B,iBAAkB,SAAUz0B,GAI3B,MAHMyW,KACL+Y,EAAEkF,SAAW10B,GAEPjE,MAIRk4B,WAAY,SAAU71B,GACrB,GAAI4D,EACJ,IAAK5D,EACJ,GAAa,EAARqY,EACJ,IAAMzU,IAAQ5D,GAEb61B,EAAYjyB,IAAWiyB,EAAYjyB,GAAQ5D,EAAK4D,QAIjDyvB,GAAM/a,OAAQtY,EAAKqzB,EAAMY,QAG3B,OAAOt2B,OAIR44B,MAAO,SAAUC,GAChB,GAAIC,GAAYD,GAAcR,CAK9B,OAJKZ,IACJA,EAAUmB,MAAOE,GAElBl3B,EAAM,EAAGk3B,GACF94B,MAyCV,IApCA4a,EAASjZ,QAAS+zB,GAAQW,SAAW4B,EAAiB9d,IACtDub,EAAMqD,QAAUrD,EAAM9zB,KACtB8zB,EAAM/wB,MAAQ+wB,EAAM7a,KAMpB4Y,EAAE/F,MAAUA,GAAO+F,EAAE/F,KAAO4G,IAAiB,IAAKhxB,QAASmxB,GAAO,IAChEnxB,QAASwxB,GAAWT,GAAc,GAAM,MAG1CZ,EAAExvB,KAAOvB,EAAQs2B,QAAUt2B,EAAQuB,MAAQwvB,EAAEuF,QAAUvF,EAAExvB,KAGzDwvB,EAAE8B,UAAYl4B,EAAOmB,KAAMi1B,EAAE7F,UAAY,KAAMhnB,cAAc9G,MAAOf,KAAqB,IAGnE,MAAjB00B,EAAEwF,cACNlG,EAAQgC,GAAK50B,KAAMszB,EAAE/F,IAAI9mB,eACzB6sB,EAAEwF,eAAkBlG,GACjBA,EAAO,KAAQsB,GAAc,IAAOtB,EAAO,KAAQsB,GAAc,KAChEtB,EAAO,KAAwB,UAAfA,EAAO,GAAkB,KAAO,WAC/CsB,GAAc,KAA+B,UAAtBA,GAAc,GAAkB,KAAO,UAK/DZ,EAAE3uB,MAAQ2uB,EAAEkD,aAAiC,gBAAXlD,GAAE3uB,OACxC2uB,EAAE3uB,KAAOzH,EAAOi2B,MAAOG,EAAE3uB,KAAM2uB,EAAED,cAIlCgC,GAA+BP,GAAYxB,EAAG/wB,EAASgzB,GAGxC,IAAVhb,EACJ,MAAOgb,EAIRoC,GAAcrE,EAAExQ,OAGX6U,GAAmC,IAApBz6B,EAAOk5B,UAC1Bl5B,EAAO2lB,MAAMlf,QAAQ,aAItB2vB,EAAExvB,KAAOwvB,EAAExvB,KAAK1E,cAGhBk0B,EAAEyF,YAAcrE,GAAWp0B,KAAMgzB,EAAExvB,MAInCyzB,EAAWjE,EAAE/F,IAGP+F,EAAEyF,aAGFzF,EAAE3uB,OACN4yB,EAAajE,EAAE/F,MAAS8G,GAAY/zB,KAAMi3B,GAAa,IAAM,KAAQjE,EAAE3uB,WAEhE2uB,GAAE3uB,MAIL2uB,EAAE1lB,SAAU,IAChB0lB,EAAE/F,IAAMgH,GAAIj0B,KAAMi3B,GAGjBA,EAASp0B,QAASoxB,GAAK,OAASH,MAGhCmD,GAAalD,GAAY/zB,KAAMi3B,GAAa,IAAM,KAAQ,KAAOnD,OAK/Dd,EAAE0F,aACD97B,EAAOm5B,aAAckB,IACzBhC,EAAM8C,iBAAkB,oBAAqBn7B,EAAOm5B,aAAckB,IAE9Dr6B,EAAOo5B,KAAMiB,IACjBhC,EAAM8C,iBAAkB,gBAAiBn7B,EAAOo5B,KAAMiB,MAKnDjE,EAAE3uB,MAAQ2uB,EAAEyF,YAAczF,EAAEmD,eAAgB,GAASl0B,EAAQk0B,cACjElB,EAAM8C,iBAAkB,eAAgB/E,EAAEmD,aAI3ClB,EAAM8C,iBACL,SACA/E,EAAE8B,UAAW,IAAO9B,EAAEnV,QAASmV,EAAE8B,UAAU,IAC1C9B,EAAEnV,QAASmV,EAAE8B,UAAU,KAA8B,MAArB9B,EAAE8B,UAAW,GAAc,KAAOJ,GAAW,WAAa,IAC1F1B,EAAEnV,QAAS,KAIb,KAAMpc,IAAKuxB,GAAE2F,QACZ1D,EAAM8C,iBAAkBt2B,EAAGuxB,EAAE2F,QAASl3B,GAIvC,IAAKuxB,EAAE4F,aAAgB5F,EAAE4F,WAAWp4B,KAAM82B,EAAiBrC,EAAOjC,MAAQ,GAAmB,IAAV/Y,GAElF,MAAOgb,GAAMkD,OAIdP,GAAW,OAGX,KAAMn2B,KAAO62B,QAAS,EAAGp0B,MAAO,EAAG0xB,SAAU,GAC5CX,EAAOxzB,GAAKuxB,EAAGvxB,GAOhB,IAHAu1B,EAAYjC,GAA+BN,GAAYzB,EAAG/wB,EAASgzB,GAK5D,CACNA,EAAMntB,WAAa,EAGduvB,GACJE,EAAmBl0B,QAAS,YAAc4xB,EAAOjC,IAG7CA,EAAE5F,OAAS4F,EAAEtT,QAAU,IAC3B0X,EAAervB,WAAW,WACzBktB,EAAMkD,MAAM,YACVnF,EAAEtT,SAGN,KACCzF,EAAQ,EACR+c,EAAU6B,KAAMnB,EAAgBv2B,GAC/B,MAAQ6C,GAET,KAAa,EAARiW,GAIJ,KAAMjW,EAHN7C,GAAM,GAAI6C,QArBZ7C,GAAM,GAAI,eA8BX,SAASA,GAAM00B,EAAQiD,EAAkBC,EAAWJ,GACnD,GAAIK,GAAWV,EAASp0B,EAAOwxB,EAAUuD,EACxCb,EAAaU,CAGC,KAAV7e,IAKLA,EAAQ,EAGHmd,GACJzX,aAAcyX,GAKfJ,EAAY76B,UAGZ+6B,EAAwByB,GAAW,GAGnC1D,EAAMntB,WAAa+tB,EAAS,EAAI,EAAI,EAGpCmD,EAAYnD,GAAU,KAAgB,IAATA,GAA2B,MAAXA,EAGxCkD,IACJrD,EAAWwD,GAAqBlG,EAAGiC,EAAO8D,IAI3CrD,EAAWyD,GAAanG,EAAG0C,EAAUT,EAAO+D,GAGvCA,GAGChG,EAAE0F,aACNO,EAAWhE,EAAM4C,kBAAkB,iBAC9BoB,IACJr8B,EAAOm5B,aAAckB,GAAagC,GAEnCA,EAAWhE,EAAM4C,kBAAkB,QAC9BoB,IACJr8B,EAAOo5B,KAAMiB,GAAagC,IAKZ,MAAXpD,GAA6B,SAAX7C,EAAExvB,KACxB40B,EAAa,YAGS,MAAXvC,EACXuC,EAAa,eAIbA,EAAa1C,EAASzb,MACtBqe,EAAU5C,EAASrxB,KACnBH,EAAQwxB,EAASxxB,MACjB80B,GAAa90B,KAKdA,EAAQk0B,GACHvC,IAAWuC,KACfA,EAAa,QACC,EAATvC,IACJA,EAAS,KAMZZ,EAAMY,OAASA,EACfZ,EAAMmD,YAAeU,GAAoBV,GAAe,GAGnDY,EACJ7e,EAAS/W,YAAak0B,GAAmBgB,EAASF,EAAYnD,IAE9D9a,EAASif,WAAY9B,GAAmBrC,EAAOmD,EAAYl0B,IAI5D+wB,EAAMwC,WAAYA,GAClBA,EAAat7B,UAERk7B,GACJE,EAAmBl0B,QAAS21B,EAAY,cAAgB,aACrD/D,EAAOjC,EAAGgG,EAAYV,EAAUp0B,IAIpCszB,EAAiB1d,SAAUwd,GAAmBrC,EAAOmD,IAEhDf,IACJE,EAAmBl0B,QAAS,gBAAkB4xB,EAAOjC,MAE3Cp2B,EAAOk5B,QAChBl5B,EAAO2lB,MAAMlf,QAAQ,cAKxB,MAAO4xB,IAGRoE,QAAS,SAAUpM,EAAK5oB,EAAMrD,GAC7B,MAAOpE,GAAO6D,IAAKwsB,EAAK5oB,EAAMrD,EAAU,SAGzCs4B,UAAW,SAAUrM,EAAKjsB,GACzB,MAAOpE,GAAO6D,IAAKwsB,EAAK9wB,UAAW6E,EAAU,aAI/CpE,EAAOmE,MAAQ,MAAO,QAAU,SAAUU,EAAG82B,GAC5C37B,EAAQ27B,GAAW,SAAUtL,EAAK5oB,EAAMrD,EAAUwC,GAQjD,MANK5G,GAAOsD,WAAYmE,KACvBb,EAAOA,GAAQxC,EACfA,EAAWqD,EACXA,EAAOlI,WAGDS,EAAOswB,MACbD,IAAKA,EACLzpB,KAAM+0B,EACNpL,SAAU3pB,EACVa,KAAMA,EACNi0B,QAASt3B,MASZ,SAASk4B,IAAqBlG,EAAGiC,EAAO8D,GAEvC,GAAIQ,GAAI/1B,EAAMg2B,EAAeC,EAC5BtR,EAAW6K,EAAE7K,SACb2M,EAAY9B,EAAE8B,SAGf,OAA0B,MAAnBA,EAAW,GACjBA,EAAUtnB,QACL+rB,IAAOp9B,YACXo9B,EAAKvG,EAAEkF,UAAYjD,EAAM4C,kBAAkB,gBAK7C,IAAK0B,EACJ,IAAM/1B,IAAQ2kB,GACb,GAAKA,EAAU3kB,IAAU2kB,EAAU3kB,GAAOxD,KAAMu5B,GAAO,CACtDzE,EAAUrkB,QAASjN,EACnB,OAMH,GAAKsxB,EAAW,IAAOiE,GACtBS,EAAgB1E,EAAW,OACrB,CAEN,IAAMtxB,IAAQu1B,GAAY,CACzB,IAAMjE,EAAW,IAAO9B,EAAEuD,WAAY/yB,EAAO,IAAMsxB,EAAU,IAAO,CACnE0E,EAAgBh2B,CAChB,OAEKi2B,IACLA,EAAgBj2B,GAIlBg2B,EAAgBA,GAAiBC,EAMlC,MAAKD,IACCA,IAAkB1E,EAAW,IACjCA,EAAUrkB,QAAS+oB,GAEbT,EAAWS,IAJnB,UAWD,QAASL,IAAanG,EAAG0C,EAAUT,EAAO+D,GACzC,GAAIU,GAAOC,EAASC,EAAM10B,EAAKkjB,EAC9BmO,KAEAzB,EAAY9B,EAAE8B,UAAUv3B,OAGzB,IAAKu3B,EAAW,GACf,IAAM8E,IAAQ5G,GAAEuD,WACfA,EAAYqD,EAAKzzB,eAAkB6sB,EAAEuD,WAAYqD,EAInDD,GAAU7E,EAAUtnB,OAGpB,OAAQmsB,EAcP,GAZK3G,EAAEsD,eAAgBqD,KACtB1E,EAAOjC,EAAEsD,eAAgBqD,IAAcjE,IAIlCtN,GAAQ4Q,GAAahG,EAAE6G,aAC5BnE,EAAW1C,EAAE6G,WAAYnE,EAAU1C,EAAE7F,WAGtC/E,EAAOuR,EACPA,EAAU7E,EAAUtnB,QAKnB,GAAiB,MAAZmsB,EAEJA,EAAUvR,MAGJ,IAAc,MAATA,GAAgBA,IAASuR,EAAU,CAM9C,GAHAC,EAAOrD,EAAYnO,EAAO,IAAMuR,IAAapD,EAAY,KAAOoD,IAG1DC,EACL,IAAMF,IAASnD,GAId,GADArxB,EAAMw0B,EAAMzxB,MAAO,KACd/C,EAAK,KAAQy0B,IAGjBC,EAAOrD,EAAYnO,EAAO,IAAMljB,EAAK,KACpCqxB,EAAY,KAAOrxB,EAAK,KACb,CAEN00B,KAAS,EACbA,EAAOrD,EAAYmD,GAGRnD,EAAYmD,MAAY,IACnCC,EAAUz0B,EAAK,GACf4vB,EAAUrkB,QAASvL,EAAK,IAEzB,OAOJ,GAAK00B,KAAS,EAGb,GAAKA,GAAQ5G,EAAG,UACf0C,EAAWkE,EAAMlE,OAEjB,KACCA,EAAWkE,EAAMlE,GAChB,MAAQ1xB,GACT,OAASiW,MAAO,cAAe/V,MAAO01B,EAAO51B,EAAI,sBAAwBokB,EAAO,OAASuR,IAQ/F,OAAS1f,MAAO,UAAW5V,KAAMqxB,GAGlC94B,EAAOg6B,WACN/Y,SACCpY,OAAQ,6FAET0iB,UACC1iB,OAAQ,uBAET8wB,YACCuD,cAAe,SAAUl0B,GAExB,MADAhJ,GAAO2I,WAAYK,GACZA,MAMVhJ,EAAOk6B,cAAe,SAAU,SAAU9D,GACpCA,EAAE1lB,QAAUnR,YAChB62B,EAAE1lB,OAAQ,GAEN0lB,EAAEwF,cACNxF,EAAExvB,KAAO,SAKX5G,EAAOm6B,cAAe,SAAU,SAAU/D,GAEzC,GAAKA,EAAEwF,YAAc,CACpB,GAAI/yB,GAAQzE,CACZ,QACC63B,KAAM,SAAUjtB,EAAGgqB,GAClBnwB,EAAS7I,EAAO,YAAYuhB,MAC3BiP,OAAO,EACP2M,QAAS/G,EAAEgH,cACX73B,IAAK6wB,EAAE/F,MACLtF,GACF,aACA3mB,EAAW,SAAUi5B,GACpBx0B,EAAOd,SACP3D,EAAW,KACNi5B,GACJrE,EAAuB,UAAbqE,EAAIz2B,KAAmB,IAAM,IAAKy2B,EAAIz2B,QAInDhH,EAASqJ,KAAKC,YAAaL,EAAQ,KAEpC0yB,MAAO,WACDn3B,GACJA,QAML,IAAIk5B,OACHC,GAAS,mBAGVv9B,GAAOg6B,WACNwD,MAAO,WACPC,cAAe,WACd,GAAIr5B,GAAWk5B,GAAarwB,OAAWjN,EAAO8F,QAAU,IAAQoxB,IAEhE,OADAv0B,MAAMyB,IAAa,EACZA,KAKTpE,EAAOk6B,cAAe,aAAc,SAAU9D,EAAGsH,EAAkBrF,GAElE,GAAIsF,GAAcC,EAAaC,EAC9BC,EAAW1H,EAAEoH,SAAU,IAAWD,GAAOn6B,KAAMgzB,EAAE/F,KAChD,MACkB,gBAAX+F,GAAE3uB,QAAwB2uB,EAAEmD,aAAe,IAAK14B,QAAQ,sCAAwC08B,GAAOn6B,KAAMgzB,EAAE3uB,OAAU,OAIlI,OAAKq2B,IAAiC,UAArB1H,EAAE8B,UAAW,IAG7ByF,EAAevH,EAAEqH,cAAgBz9B,EAAOsD,WAAY8yB,EAAEqH,eACrDrH,EAAEqH,gBACFrH,EAAEqH,cAGEK,EACJ1H,EAAG0H,GAAa1H,EAAG0H,GAAW73B,QAASs3B,GAAQ,KAAOI,GAC3CvH,EAAEoH,SAAU,IACvBpH,EAAE/F,MAAS8G,GAAY/zB,KAAMgzB,EAAE/F,KAAQ,IAAM,KAAQ+F,EAAEoH,MAAQ,IAAMG,GAItEvH,EAAEuD,WAAW,eAAiB,WAI7B,MAHMkE,IACL79B,EAAOsH,MAAOq2B,EAAe,mBAEvBE,EAAmB,IAI3BzH,EAAE8B,UAAW,GAAM,OAGnB0F,EAAct+B,EAAQq+B,GACtBr+B,EAAQq+B,GAAiB,WACxBE,EAAoBp5B,WAIrB4zB,EAAM/a,OAAO,WAEZhe,EAAQq+B,GAAiBC,EAGpBxH,EAAGuH,KAEPvH,EAAEqH,cAAgBC,EAAiBD,cAGnCH,GAAa78B,KAAMk9B,IAIfE,GAAqB79B,EAAOsD,WAAYs6B,IAC5CA,EAAaC,EAAmB,IAGjCA,EAAoBD,EAAcr+B,YAI5B,UAtDR,YAyDDS,EAAOs2B,aAAayH,IAAM,WACzB,IACC,MAAO,IAAIC,gBACV,MAAO52B,KAGV,IAAI62B,IAAej+B,EAAOs2B,aAAayH,MACtCG,IAEC,EAAG,IAGHC,KAAM,KAKPC,GAAQ,EACRC,KAEI/+B,GAAOg/B,eACXt+B,EAAQV,GAASyrB,GAAI,SAAU,WAC9B,IAAK,GAAIxgB,KAAO8zB,IACfA,GAAc9zB,IAEf8zB,IAAe9+B,YAIjBS,EAAOsL,QAAQizB,OAASN,IAAkB,mBAAqBA,IAC/Dj+B,EAAOsL,QAAQglB,KAAO2N,KAAiBA,GAEvCj+B,EAAOm6B,cAAc,SAAU90B,GAC9B,GAAIjB,EAEJ,OAAKpE,GAAOsL,QAAQizB,MAAQN,KAAiB54B,EAAQu2B,aAEnDK,KAAM,SAAUF,EAAS/C,GACxB,GAAIn0B,GAAGgL,EACNkuB,EAAM14B,EAAQ04B,KAGf,IAFAA,EAAIS,KAAMn5B,EAAQuB,KAAMvB,EAAQgrB,IAAKhrB,EAAQmrB,MAAOnrB,EAAQo5B,SAAUp5B,EAAQ6S,UAEzE7S,EAAQq5B,UACZ,IAAM75B,IAAKQ,GAAQq5B,UAClBX,EAAKl5B,GAAMQ,EAAQq5B,UAAW75B,EAI3BQ,GAAQi2B,UAAYyC,EAAI1C,kBAC5B0C,EAAI1C,iBAAkBh2B,EAAQi2B,UAOzBj2B,EAAQu2B,aAAgBG,EAAQ,sBACrCA,EAAQ,oBAAsB,iBAG/B,KAAMl3B,IAAKk3B,GACVgC,EAAI5C,iBAAkBt2B,EAAGk3B,EAASl3B,GAGnCT,GAAW,SAAUwC,GACpB,MAAO,YACDxC,UACGi6B,IAAcxuB,GACrBzL,EAAW25B,EAAIY,OAASZ,EAAIa,QAAU,KACxB,UAATh4B,EACJm3B,EAAIxC,QACgB,UAAT30B,EACXoyB,EAEC+E,EAAI9E,QAAU,IACd8E,EAAIvC,YAGLxC,EACCkF,GAAkBH,EAAI9E,SAAY8E,EAAI9E,OACtC8E,EAAIvC,WAIwB,gBAArBuC,GAAIhF,cACV/vB,KAAM+0B,EAAIhF,cACPx5B,UACJw+B,EAAI7C,4BAOT6C,EAAIY,OAASv6B,IACb25B,EAAIa,QAAUx6B,EAAS,SAEvBA,EAAWi6B,GAAexuB,EAAKuuB,MAAah6B,EAAS,SAIrD25B,EAAI9B,KAAM52B,EAAQw2B,YAAcx2B,EAAQoC,MAAQ,OAEjD8zB,MAAO,WACDn3B,GACJA,MAtEJ,WA4ED,IAAIy6B,IAAOC,GACVC,GAAW,yBACXC,GAAatxB,OAAQ,iBAAmBlM,EAAY,cAAe,KACnEy9B,GAAO,cACPC,IAAwBC,IACxBC,IACC5F,KAAM,SAAUjY,EAAM/X,GACrB,GAAI61B,GAAQ18B,KAAK28B,YAAa/d,EAAM/X,GACnC7D,EAAS05B,EAAMhuB,MACfqkB,EAAQsJ,GAAOl8B,KAAM0G,GACrB+1B,EAAO7J,GAASA,EAAO,KAAS11B,EAAOwzB,UAAWjS,GAAS,GAAK,MAGhEzL,GAAU9V,EAAOwzB,UAAWjS,IAAmB,OAATge,IAAkB55B,IACvDq5B,GAAOl8B,KAAM9C,EAAO4yB,IAAKyM,EAAM38B,KAAM6e,IACtCie,EAAQ,EACRC,EAAgB,EAEjB,IAAK3pB,GAASA,EAAO,KAAQypB,EAAO,CAEnCA,EAAOA,GAAQzpB,EAAO,GAGtB4f,EAAQA,MAGR5f,GAASnQ,GAAU,CAEnB,GAGC65B,GAAQA,GAAS,KAGjB1pB,GAAgB0pB,EAChBx/B,EAAOgL,MAAOq0B,EAAM38B,KAAM6e,EAAMzL,EAAQypB,SAI/BC,KAAWA,EAAQH,EAAMhuB,MAAQ1L,IAAqB,IAAV65B,KAAiBC,GAaxE,MATK/J,KACJ5f,EAAQupB,EAAMvpB,OAASA,IAAUnQ,GAAU,EAC3C05B,EAAME,KAAOA,EAEbF,EAAMp6B,IAAMywB,EAAO,GAClB5f,GAAU4f,EAAO,GAAM,GAAMA,EAAO,IACnCA,EAAO,IAGH2J,IAKV,SAASK,MAIR,MAHAv0B,YAAW,WACV0zB,GAAQt/B,YAEAs/B,GAAQ7+B,EAAO4K,MAGzB,QAAS00B,IAAa91B,EAAO+X,EAAMoe,GAClC,GAAIN,GACHO,GAAeR,GAAU7d,QAAehhB,OAAQ6+B,GAAU,MAC1DriB,EAAQ,EACRla,EAAS+8B,EAAW/8B,MACrB,MAAgBA,EAARka,EAAgBA,IACvB,GAAMsiB,EAAQO,EAAY7iB,GAAQnZ,KAAM+7B,EAAWpe,EAAM/X,GAGxD,MAAO61B,GAKV,QAASQ,IAAWn9B,EAAMo9B,EAAYz6B,GACrC,GAAIkQ,GACHwqB,EACAhjB,EAAQ,EACRla,EAASq8B,GAAoBr8B,OAC7B0a,EAAWvd,EAAOiL,WAAWqS,OAAQ,iBAE7B0iB,GAAKt9B,OAEbs9B,EAAO,WACN,GAAKD,EACJ,OAAO,CAER,IAAIE,GAAcpB,IAASa,KAC1BlhB,EAAYzY,KAAKwe,IAAK,EAAGob,EAAUO,UAAYP,EAAUQ,SAAWF,GAEpEtmB,EAAO6E,EAAYmhB,EAAUQ,UAAY,EACzCC,EAAU,EAAIzmB,EACdoD,EAAQ,EACRla,EAAS88B,EAAUU,OAAOx9B,MAE3B,MAAgBA,EAARka,EAAiBA,IACxB4iB,EAAUU,OAAQtjB,GAAQujB,IAAKF,EAKhC,OAFA7iB,GAASqB,WAAYlc,GAAQi9B,EAAWS,EAAS5hB,IAElC,EAAV4hB,GAAev9B,EACZ2b,GAEPjB,EAAS/W,YAAa9D,GAAQi9B,KACvB,IAGTA,EAAYpiB,EAASjZ,SACpB5B,KAAMA,EACNgmB,MAAO1oB,EAAOoF,UAAY06B,GAC1BS,KAAMvgC,EAAOoF,QAAQ,GAAQo7B,kBAAqBn7B,GAClDo7B,mBAAoBX,EACpB1H,gBAAiB/yB,EACjB66B,UAAWrB,IAASa,KACpBS,SAAU96B,EAAQ86B,SAClBE,UACAf,YAAa,SAAU/d,EAAMtc,GAC5B,GAAIo6B,GAAQr/B,EAAO0gC,MAAOh+B,EAAMi9B,EAAUY,KAAMhf,EAAMtc,EACpD06B,EAAUY,KAAKC,cAAejf,IAAUoe,EAAUY,KAAKI,OAEzD,OADAhB,GAAUU,OAAO5/B,KAAM4+B,GAChBA,GAER7c,KAAM,SAAUoe,GACf,GAAI7jB,GAAQ,EAGXla,EAAS+9B,EAAUjB,EAAUU,OAAOx9B,OAAS,CAC9C,IAAKk9B,EACJ,MAAOp9B,KAGR,KADAo9B,GAAU,EACMl9B,EAARka,EAAiBA,IACxB4iB,EAAUU,OAAQtjB,GAAQujB,IAAK,EAUhC,OALKM,GACJrjB,EAAS/W,YAAa9D,GAAQi9B,EAAWiB,IAEzCrjB,EAASif,WAAY95B,GAAQi9B,EAAWiB,IAElCj+B,QAGT+lB,EAAQiX,EAAUjX,KAInB,KAFAmY,GAAYnY,EAAOiX,EAAUY,KAAKC,eAElB39B,EAARka,EAAiBA,IAExB,GADAxH,EAAS2pB,GAAqBniB,GAAQnZ,KAAM+7B,EAAWj9B,EAAMgmB,EAAOiX,EAAUY,MAE7E,MAAOhrB,EAmBT,OAfAvV,GAAOgF,IAAK0jB,EAAO4W,GAAaK,GAE3B3/B,EAAOsD,WAAYq8B,EAAUY,KAAKzqB,QACtC6pB,EAAUY,KAAKzqB,MAAMlS,KAAMlB,EAAMi9B,GAGlC3/B,EAAO4iB,GAAGke,MACT9gC,EAAOoF,OAAQ46B,GACdt9B,KAAMA,EACNq+B,KAAMpB,EACNzd,MAAOyd,EAAUY,KAAKre,SAKjByd,EAAU1hB,SAAU0hB,EAAUY,KAAKtiB,UACxC1Z,KAAMo7B,EAAUY,KAAKh8B,KAAMo7B,EAAUY,KAAKvH,UAC1Cxb,KAAMmiB,EAAUY,KAAK/iB,MACrBF,OAAQqiB,EAAUY,KAAKjjB,QAG1B,QAASujB,IAAYnY,EAAO8X,GAC3B,GAAIzjB,GAAOzX,EAAMq7B,EAAQn3B,EAAO6Y,CAGhC,KAAMtF,IAAS2L,GAed,GAdApjB,EAAOtF,EAAOoJ,UAAW2T,GACzB4jB,EAASH,EAAel7B,GACxBkE,EAAQkf,EAAO3L,GACV/c,EAAO6F,QAAS2D,KACpBm3B,EAASn3B,EAAO,GAChBA,EAAQkf,EAAO3L,GAAUvT,EAAO,IAG5BuT,IAAUzX,IACdojB,EAAOpjB,GAASkE,QACTkf,GAAO3L,IAGfsF,EAAQriB,EAAOqzB,SAAU/tB,GACpB+c,GAAS,UAAYA,GAAQ,CACjC7Y,EAAQ6Y,EAAMmT,OAAQhsB,SACfkf,GAAOpjB,EAId,KAAMyX,IAASvT,GACNuT,IAAS2L,KAChBA,EAAO3L,GAAUvT,EAAOuT,GACxByjB,EAAezjB,GAAU4jB,OAI3BH,GAAel7B,GAASq7B,EAK3B3gC,EAAO6/B,UAAY7/B,EAAOoF,OAAQy6B,IAEjCmB,QAAS,SAAUtY,EAAOtkB,GACpBpE,EAAOsD,WAAYolB,IACvBtkB,EAAWskB,EACXA,GAAU,MAEVA,EAAQA,EAAMrd,MAAM,IAGrB,IAAIkW,GACHxE,EAAQ,EACRla,EAAS6lB,EAAM7lB,MAEhB,MAAgBA,EAARka,EAAiBA,IACxBwE,EAAOmH,EAAO3L,GACdqiB,GAAU7d,GAAS6d,GAAU7d,OAC7B6d,GAAU7d,GAAO1N,QAASzP,IAI5B68B,UAAW,SAAU78B,EAAUiqB,GACzBA,EACJ6Q,GAAoBrrB,QAASzP,GAE7B86B,GAAoBz+B,KAAM2D,KAK7B,SAAS+6B,IAAkBz8B,EAAMgmB,EAAO6X,GAEvC,GAAIhf,GAAM/X,EAAO4pB,EAAQiM,EAAOhd,EAAO6e,EACtCH,EAAOp+B,KACPgoB,KACA3f,EAAQtI,EAAKsI,MACbgoB,EAAStwB,EAAKQ,UAAYwvB,GAAUhwB,GACpCy+B,EAAWxgB,EAAU9c,IAAKnB,EAAM,SAG3B69B,GAAKre,QACVG,EAAQriB,EAAOsiB,YAAa5f,EAAM,MACX,MAAlB2f,EAAM+e,WACV/e,EAAM+e,SAAW,EACjBF,EAAU7e,EAAM7K,MAAMkF,KACtB2F,EAAM7K,MAAMkF,KAAO,WACZ2F,EAAM+e,UACXF,MAIH7e,EAAM+e,WAENL,EAAKzjB,OAAO,WAGXyjB,EAAKzjB,OAAO,WACX+E,EAAM+e,WACAphC,EAAOkiB,MAAOxf,EAAM,MAAOG,QAChCwf,EAAM7K,MAAMkF,YAOO,IAAlBha,EAAKQ,WAAoB,UAAYwlB,IAAS,SAAWA,MAK7D6X,EAAKc,UAAar2B,EAAMq2B,SAAUr2B,EAAMs2B,UAAWt2B,EAAMu2B,WAIlB,WAAlCvhC,EAAO4yB,IAAKlwB,EAAM,YACW,SAAhC1C,EAAO4yB,IAAKlwB,EAAM,WAEnBsI,EAAMinB,QAAU,iBAIbsO,EAAKc,WACTr2B,EAAMq2B,SAAW,SACjBN,EAAKzjB,OAAO,WACXtS,EAAMq2B,SAAWd,EAAKc,SAAU,GAChCr2B,EAAMs2B,UAAYf,EAAKc,SAAU,GACjCr2B,EAAMu2B,UAAYhB,EAAKc,SAAU,KAMnC,KAAM9f,IAAQmH,GAEb,GADAlf,EAAQkf,EAAOnH,GACVwd,GAASj8B,KAAM0G,GAAU,CAG7B,SAFOkf,GAAOnH,GACd6R,EAASA,GAAoB,WAAV5pB,EACdA,KAAYwpB,EAAS,OAAS,QAAW,CAG7C,GAAe,SAAVxpB,IAAoB23B,GAAYA,EAAU5f,KAAWhiB,UAGzD,QAFAyzB,IAAS,EAKXrI,EAAMpJ,GAAS4f,GAAYA,EAAU5f,IAAUvhB,EAAOgL,MAAOtI,EAAM6e,GAIrE,IAAMvhB,EAAOqH,cAAesjB,GAAS,CAC/BwW,EACC,UAAYA,KAChBnO,EAASmO,EAASnO,QAGnBmO,EAAWxgB,EAAUrW,OAAQ5H,EAAM,aAI/B0wB,IACJ+N,EAASnO,QAAUA,GAEfA,EACJhzB,EAAQ0C,GAAOqwB,OAEfgO,EAAKx8B,KAAK,WACTvE,EAAQ0C,GAAOywB,SAGjB4N,EAAKx8B,KAAK,WACT,GAAIgd,EAEJZ,GAAU5Y,OAAQrF,EAAM,SACxB,KAAM6e,IAAQoJ,GACb3qB,EAAOgL,MAAOtI,EAAM6e,EAAMoJ,EAAMpJ,KAGlC,KAAMA,IAAQoJ,GACb0U,EAAQC,GAAatM,EAASmO,EAAU5f,GAAS,EAAGA,EAAMwf,GAElDxf,IAAQ4f,KACfA,EAAU5f,GAAS8d,EAAMvpB,MACpBkd,IACJqM,EAAMp6B,IAAMo6B,EAAMvpB,MAClBupB,EAAMvpB,MAAiB,UAATyL,GAA6B,WAATA,EAAoB,EAAI,KAO/D,QAASmf,IAAOh+B,EAAM2C,EAASkc,EAAMtc,EAAK07B,GACzC,MAAO,IAAID,IAAMp+B,UAAUf,KAAMmB,EAAM2C,EAASkc,EAAMtc,EAAK07B,GAE5D3gC,EAAO0gC,MAAQA,GAEfA,GAAMp+B,WACLE,YAAak+B,GACbn/B,KAAM,SAAUmB,EAAM2C,EAASkc,EAAMtc,EAAK07B,EAAQpB,GACjD58B,KAAKD,KAAOA,EACZC,KAAK4e,KAAOA,EACZ5e,KAAKg+B,OAASA,GAAU,QACxBh+B,KAAK0C,QAAUA,EACf1C,KAAKmT,MAAQnT,KAAKiI,IAAMjI,KAAK0O,MAC7B1O,KAAKsC,IAAMA,EACXtC,KAAK48B,KAAOA,IAAUv/B,EAAOwzB,UAAWjS,GAAS,GAAK,OAEvDlQ,IAAK,WACJ,GAAIgR,GAAQqe,GAAM1b,UAAWriB,KAAK4e,KAElC,OAAOc,IAASA,EAAMxe,IACrBwe,EAAMxe,IAAKlB,MACX+9B,GAAM1b,UAAUgD,SAASnkB,IAAKlB,OAEhC29B,IAAK,SAAUF,GACd,GAAIoB,GACHnf,EAAQqe,GAAM1b,UAAWriB,KAAK4e,KAoB/B,OAjBC5e,MAAKkpB,IAAM2V,EADP7+B,KAAK0C,QAAQ86B,SACEngC,EAAO2gC,OAAQh+B,KAAKg+B,QACtCP,EAASz9B,KAAK0C,QAAQ86B,SAAWC,EAAS,EAAG,EAAGz9B,KAAK0C,QAAQ86B,UAG3CC,EAEpBz9B,KAAKiI,KAAQjI,KAAKsC,IAAMtC,KAAKmT,OAAU0rB,EAAQ7+B,KAAKmT,MAE/CnT,KAAK0C,QAAQo8B,MACjB9+B,KAAK0C,QAAQo8B,KAAK79B,KAAMjB,KAAKD,KAAMC,KAAKiI,IAAKjI,MAGzC0f,GAASA,EAAMf,IACnBe,EAAMf,IAAK3e,MAEX+9B,GAAM1b,UAAUgD,SAAS1G,IAAK3e,MAExBA,OAIT+9B,GAAMp+B,UAAUf,KAAKe,UAAYo+B,GAAMp+B,UAEvCo+B,GAAM1b,WACLgD,UACCnkB,IAAK,SAAUw7B,GACd,GAAI9pB,EAEJ,OAAiC,OAA5B8pB,EAAM38B,KAAM28B,EAAM9d,OACpB8d,EAAM38B,KAAKsI,OAA2C,MAAlCq0B,EAAM38B,KAAKsI,MAAOq0B,EAAM9d,OAQ/ChM,EAASvV,EAAO4yB,IAAKyM,EAAM38B,KAAM28B,EAAM9d,KAAM,IAErChM,GAAqB,SAAXA,EAAwBA,EAAJ,GAT9B8pB,EAAM38B,KAAM28B,EAAM9d,OAW3BD,IAAK,SAAU+d,GAGTr/B,EAAO4iB,GAAG6e,KAAMpC,EAAM9d,MAC1BvhB,EAAO4iB,GAAG6e,KAAMpC,EAAM9d,MAAQ8d,GACnBA,EAAM38B,KAAKsI,QAAgE,MAArDq0B,EAAM38B,KAAKsI,MAAOhL,EAAOg0B,SAAUqL,EAAM9d,QAAoBvhB,EAAOqzB,SAAUgM,EAAM9d,OACrHvhB,EAAOgL,MAAOq0B,EAAM38B,KAAM28B,EAAM9d,KAAM8d,EAAMz0B,IAAMy0B,EAAME,MAExDF,EAAM38B,KAAM28B,EAAM9d,MAAS8d,EAAMz0B,OASrC81B,GAAM1b,UAAUyE,UAAYiX,GAAM1b,UAAUqE,YAC3C/H,IAAK,SAAU+d,GACTA,EAAM38B,KAAKQ,UAAYm8B,EAAM38B,KAAKe,aACtC47B,EAAM38B,KAAM28B,EAAM9d,MAAS8d,EAAMz0B,OAKpC5K,EAAOmE,MAAO,SAAU,OAAQ,QAAU,SAAUU,EAAGS,GACtD,GAAIo8B,GAAQ1hC,EAAOsB,GAAIgE,EACvBtF,GAAOsB,GAAIgE,GAAS,SAAUq8B,EAAOhB,EAAQv8B,GAC5C,MAAgB,OAATu9B,GAAkC,iBAAVA,GAC9BD,EAAMl9B,MAAO7B,KAAM8B,WACnB9B,KAAKi/B,QAASC,GAAOv8B,GAAM,GAAQq8B,EAAOhB,EAAQv8B,MAIrDpE,EAAOsB,GAAG8D,QACT08B,OAAQ,SAAUH,EAAOI,EAAIpB,EAAQv8B,GAGpC,MAAOzB,MAAK+P,OAAQggB,IAAWE,IAAK,UAAW,GAAIG,OAGjD9tB,MAAM28B,SAAUtO,QAASyO,GAAMJ,EAAOhB,EAAQv8B,IAEjDw9B,QAAS,SAAUrgB,EAAMogB,EAAOhB,EAAQv8B,GACvC,GAAIoT,GAAQxX,EAAOqH,cAAeka,GACjCygB,EAAShiC,EAAO2hC,MAAOA,EAAOhB,EAAQv8B,GACtC69B,EAAc,WAEb,GAAIlB,GAAOlB,GAAWl9B,KAAM3C,EAAOoF,UAAYmc,GAAQygB,IAGlDxqB,GAASmJ,EAAU9c,IAAKlB,KAAM,YAClCo+B,EAAKve,MAAM,GAKd,OAFCyf,GAAYC,OAASD,EAEfzqB,GAASwqB,EAAO9f,SAAU,EAChCvf,KAAKwB,KAAM89B,GACXt/B,KAAKuf,MAAO8f,EAAO9f,MAAO+f,IAE5Bzf,KAAM,SAAU5b,EAAMoc,EAAY4d,GACjC,GAAIuB,GAAY,SAAU9f,GACzB,GAAIG,GAAOH,EAAMG,WACVH,GAAMG,KACbA,EAAMoe,GAYP,OATqB,gBAATh6B,KACXg6B,EAAU5d,EACVA,EAAapc,EACbA,EAAOrH,WAEHyjB,GAAcpc,KAAS,GAC3BjE,KAAKuf,MAAOtb,GAAQ,SAGdjE,KAAKwB,KAAK,WAChB,GAAIge,IAAU,EACbpF,EAAgB,MAARnW,GAAgBA,EAAO,aAC/Bw7B,EAASpiC,EAAOoiC,OAChB36B,EAAOkZ,EAAU9c,IAAKlB,KAEvB,IAAKoa,EACCtV,EAAMsV,IAAWtV,EAAMsV,GAAQyF,MACnC2f,EAAW16B,EAAMsV,QAGlB,KAAMA,IAAStV,GACTA,EAAMsV,IAAWtV,EAAMsV,GAAQyF,MAAQyc,GAAK77B,KAAM2Z,IACtDolB,EAAW16B,EAAMsV,GAKpB,KAAMA,EAAQqlB,EAAOv/B,OAAQka,KACvBqlB,EAAQrlB,GAAQra,OAASC,MAAiB,MAARiE,GAAgBw7B,EAAQrlB,GAAQmF,QAAUtb,IAChFw7B,EAAQrlB,GAAQgkB,KAAKve,KAAMoe,GAC3Bze,GAAU,EACVigB,EAAOj9B,OAAQ4X,EAAO,KAOnBoF,IAAYye,IAChB5gC,EAAOmiB,QAASxf,KAAMiE,MAIzBs7B,OAAQ,SAAUt7B,GAIjB,MAHKA,MAAS,IACbA,EAAOA,GAAQ,MAETjE,KAAKwB,KAAK,WAChB,GAAI4Y,GACHtV,EAAOkZ,EAAU9c,IAAKlB,MACtBuf,EAAQza,EAAMb,EAAO,SACrByb,EAAQ5a,EAAMb,EAAO,cACrBw7B,EAASpiC,EAAOoiC,OAChBv/B,EAASqf,EAAQA,EAAMrf,OAAS,CAajC,KAVA4E,EAAKy6B,QAAS,EAGdliC,EAAOkiB,MAAOvf,KAAMiE,MAEfyb,GAASA,EAAMG,MACnBH,EAAMG,KAAK5e,KAAMjB,MAAM,GAIlBoa,EAAQqlB,EAAOv/B,OAAQka,KACvBqlB,EAAQrlB,GAAQra,OAASC,MAAQy/B,EAAQrlB,GAAQmF,QAAUtb,IAC/Dw7B,EAAQrlB,GAAQgkB,KAAKve,MAAM,GAC3B4f,EAAOj9B,OAAQ4X,EAAO,GAKxB,KAAMA,EAAQ,EAAWla,EAARka,EAAgBA,IAC3BmF,EAAOnF,IAAWmF,EAAOnF,GAAQmlB,QACrChgB,EAAOnF,GAAQmlB,OAAOt+B,KAAMjB,YAKvB8E,GAAKy6B,WAMf,SAASL,IAAOj7B,EAAMy7B,GACrB,GAAIvZ,GACH7X,GAAUqxB,OAAQ17B,GAClB/B,EAAI,CAKL,KADAw9B,EAAeA,EAAc,EAAI,EACtB,EAAJx9B,EAAQA,GAAK,EAAIw9B,EACvBvZ,EAAQuJ,GAAWxtB,GACnBoM,EAAO,SAAW6X,GAAU7X,EAAO,UAAY6X,GAAUliB,CAO1D,OAJKy7B,KACJpxB,EAAMqiB,QAAUriB,EAAMuP,MAAQ5Z,GAGxBqK,EAIRjR,EAAOmE,MACNo+B,UAAWV,GAAM,QACjBW,QAASX,GAAM,QACfY,YAAaZ,GAAM,UACnBa,QAAUpP,QAAS,QACnBqP,SAAWrP,QAAS,QACpBsP,YAActP,QAAS,WACrB,SAAUhuB,EAAMojB,GAClB1oB,EAAOsB,GAAIgE,GAAS,SAAUq8B,EAAOhB,EAAQv8B,GAC5C,MAAOzB,MAAKi/B,QAASlZ,EAAOiZ,EAAOhB,EAAQv8B,MAI7CpE,EAAO2hC,MAAQ,SAAUA,EAAOhB,EAAQr/B,GACvC,GAAI2d,GAAM0iB,GAA0B,gBAAVA,GAAqB3hC,EAAOoF,UAAYu8B,IACjE3I,SAAU13B,IAAOA,GAAMq/B,GACtB3gC,EAAOsD,WAAYq+B,IAAWA,EAC/BxB,SAAUwB,EACVhB,OAAQr/B,GAAMq/B,GAAUA,IAAW3gC,EAAOsD,WAAYq9B,IAAYA,EAwBnE,OArBA1hB,GAAIkhB,SAAWngC,EAAO4iB,GAAGlc,IAAM,EAA4B,gBAAjBuY,GAAIkhB,SAAwBlhB,EAAIkhB,SACzElhB,EAAIkhB,WAAYngC,GAAO4iB,GAAGC,OAAS7iB,EAAO4iB,GAAGC,OAAQ5D,EAAIkhB,UAAangC,EAAO4iB,GAAGC,OAAOmF,UAGtE,MAAb/I,EAAIiD,OAAiBjD,EAAIiD,SAAU,KACvCjD,EAAIiD,MAAQ,MAIbjD,EAAIlU,IAAMkU,EAAI+Z,SAEd/Z,EAAI+Z,SAAW,WACTh5B,EAAOsD,WAAY2b,EAAIlU,MAC3BkU,EAAIlU,IAAInH,KAAMjB,MAGVsc,EAAIiD,OACRliB,EAAOmiB,QAASxf,KAAMsc,EAAIiD,QAIrBjD,GAGRjf,EAAO2gC,QACNkC,OAAQ,SAAUC,GACjB,MAAOA,IAERC,MAAO,SAAUD,GAChB,MAAO,GAAM/8B,KAAKi9B,IAAKF,EAAE/8B,KAAKk9B,IAAO,IAIvCjjC,EAAOoiC,UACPpiC,EAAO4iB,GAAK8d,GAAMp+B,UAAUf,KAC5BvB,EAAO4iB,GAAGod,KAAO,WAChB,GAAIc,GACHsB,EAASpiC,EAAOoiC,OAChBv9B,EAAI,CAIL,KAFAg6B,GAAQ7+B,EAAO4K,MAEHw3B,EAAOv/B,OAAXgC,EAAmBA,IAC1Bi8B,EAAQsB,EAAQv9B,GAEVi8B,KAAWsB,EAAQv9B,KAAQi8B,GAChCsB,EAAOj9B,OAAQN,IAAK,EAIhBu9B,GAAOv/B,QACZ7C,EAAO4iB,GAAGJ,OAEXqc,GAAQt/B,WAGTS,EAAO4iB,GAAGke,MAAQ,SAAUA,GACtBA,KAAW9gC,EAAOoiC,OAAO3hC,KAAMqgC,IACnC9gC,EAAO4iB,GAAG9M,SAIZ9V,EAAO4iB,GAAGsgB,SAAW,GAErBljC,EAAO4iB,GAAG9M,MAAQ,WACXgpB,KACLA,GAAUqE,YAAanjC,EAAO4iB,GAAGod,KAAMhgC,EAAO4iB,GAAGsgB,YAInDljC,EAAO4iB,GAAGJ,KAAO,WAChB4gB,cAAetE,IACfA,GAAU,MAGX9+B,EAAO4iB,GAAGC,QACTwgB,KAAM,IACNC,KAAM,IAENtb,SAAU,KAIXhoB,EAAO4iB,GAAG6e,QAELzhC,EAAO8T,MAAQ9T,EAAO8T,KAAKwE,UAC/BtY,EAAO8T,KAAKwE,QAAQirB,SAAW,SAAU7gC,GACxC,MAAO1C,GAAOgK,KAAKhK,EAAOoiC,OAAQ,SAAU9gC,GAC3C,MAAOoB,KAASpB,EAAGoB,OACjBG,SAGL7C,EAAOsB,GAAGkiC,OAAS,SAAUn+B,GAC5B,GAAKZ,UAAU5B,OACd,MAAOwC,KAAY9F,UAClBoD,KACAA,KAAKwB,KAAK,SAAUU,GACnB7E,EAAOwjC,OAAOC,UAAW9gC,KAAM0C,EAASR,IAI3C,IAAIhF,GAAS6jC,EACZhhC,EAAOC,KAAM,GACbghC,GAAQxxB,IAAK,EAAGyxB,KAAM,GACtB7xB,EAAMrP,GAAQA,EAAKS,aAEpB,IAAM4O,EAON,MAHAlS,GAAUkS,EAAIjS,gBAGRE,EAAOmM,SAAUtM,EAAS6C,UAMpBA,GAAKmhC,wBAA0BnkC,IAC1CikC,EAAMjhC,EAAKmhC,yBAEZH,EAAMI,GAAW/xB,IAEhBI,IAAKwxB,EAAIxxB,IAAMuxB,EAAIK,YAAclkC,EAAQ6pB,UACzCka,KAAMD,EAAIC,KAAOF,EAAIM,YAAcnkC,EAAQypB,aAXpCqa,GAeT3jC,EAAOwjC,QAENC,UAAW,SAAU/gC,EAAM2C,EAASR,GACnC,GAAIo/B,GAAaC,EAASC,EAAWC,EAAQC,EAAWC,EAAYC,EACnExS,EAAW/xB,EAAO4yB,IAAKlwB,EAAM,YAC7B8hC,EAAUxkC,EAAQ0C,GAClBgmB,IAGiB,YAAbqJ,IACJrvB,EAAKsI,MAAM+mB,SAAW,YAGvBsS,EAAYG,EAAQhB,SACpBW,EAAYnkC,EAAO4yB,IAAKlwB,EAAM,OAC9B4hC,EAAatkC,EAAO4yB,IAAKlwB,EAAM,QAC/B6hC,GAAmC,aAAbxS,GAAwC,UAAbA,KAA4BoS,EAAYG,GAAazjC,QAAQ,QAAU,GAGnH0jC,GACJN,EAAcO,EAAQzS,WACtBqS,EAASH,EAAY9xB,IACrB+xB,EAAUD,EAAYL,OAGtBQ,EAASn9B,WAAYk9B,IAAe,EACpCD,EAAUj9B,WAAYq9B,IAAgB,GAGlCtkC,EAAOsD,WAAY+B,KACvBA,EAAUA,EAAQzB,KAAMlB,EAAMmC,EAAGw/B,IAGd,MAAfh/B,EAAQ8M,MACZuW,EAAMvW,IAAQ9M,EAAQ8M,IAAMkyB,EAAUlyB,IAAQiyB,GAE1B,MAAhB/+B,EAAQu+B,OACZlb,EAAMkb,KAASv+B,EAAQu+B,KAAOS,EAAUT,KAASM,GAG7C,SAAW7+B,GACfA,EAAQo/B,MAAM7gC,KAAMlB,EAAMgmB,GAG1B8b,EAAQ5R,IAAKlK,KAMhB1oB,EAAOsB,GAAG8D,QAET2sB,SAAU,WACT,GAAMpvB,KAAM,GAAZ,CAIA,GAAI+hC,GAAclB,EACjB9gC,EAAOC,KAAM,GACbgiC,GAAiBxyB,IAAK,EAAGyxB,KAAM,EAuBhC,OApBwC,UAAnC5jC,EAAO4yB,IAAKlwB,EAAM,YAEtB8gC,EAAS9gC,EAAKmhC,yBAIda,EAAe/hC,KAAK+hC,eAGpBlB,EAAS7gC,KAAK6gC,SACRxjC,EAAOsJ,SAAUo7B,EAAc,GAAK,UACzCC,EAAeD,EAAalB,UAI7BmB,EAAaxyB,KAAOnS,EAAO4yB,IAAK8R,EAAc,GAAK,kBAAkB,GACrEC,EAAaf,MAAQ5jC,EAAO4yB,IAAK8R,EAAc,GAAK,mBAAmB,KAKvEvyB,IAAKqxB,EAAOrxB,IAAMwyB,EAAaxyB,IAAMnS,EAAO4yB,IAAKlwB,EAAM,aAAa,GACpEkhC,KAAMJ,EAAOI,KAAOe,EAAaf,KAAO5jC,EAAO4yB,IAAKlwB,EAAM,cAAc,MAI1EgiC,aAAc,WACb,MAAO/hC,MAAKqC,IAAI,WACf,GAAI0/B,GAAe/hC,KAAK+hC,cAAgB7kC,CAExC,OAAQ6kC,IAAmB1kC,EAAOsJ,SAAUo7B,EAAc,SAAsD,WAA1C1kC,EAAO4yB,IAAK8R,EAAc,YAC/FA,EAAeA,EAAaA,YAG7B,OAAOA,IAAgB7kC,OAO1BG,EAAOmE,MAAOklB,WAAY,cAAeI,UAAW,eAAgB,SAAUkS,EAAQpa,GACrF,GAAIpP,GAAM,gBAAkBoP,CAE5BvhB,GAAOsB,GAAIq6B,GAAW,SAAU3nB,GAC/B,MAAOhU,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAMi5B,EAAQ3nB,GACnD,GAAI0vB,GAAMI,GAAWphC,EAErB,OAAKsR,KAAQzU,UACLmkC,EAAMA,EAAKniB,GAAS7e,EAAMi5B,IAG7B+H,EACJA,EAAIkB,SACFzyB,EAAY7S,EAAO0kC,YAAbhwB,EACP7B,EAAM6B,EAAM1U,EAAOykC,aAIpBrhC,EAAMi5B,GAAW3nB,EAPlB,YASE2nB,EAAQ3nB,EAAKvP,UAAU5B,OAAQ,QAIpC,SAASihC,IAAWphC,GACnB,MAAO1C,GAAO8G,SAAUpE,GAASA,EAAyB,IAAlBA,EAAKQ,UAAkBR,EAAKuP,YAGrEjS,EAAOmE,MAAQ0gC,OAAQ,SAAUC,MAAO,SAAW,SAAUx/B,EAAMsB,GAClE5G,EAAOmE,MAAQixB,QAAS,QAAU9vB,EAAMorB,QAAS9pB,EAAM,GAAI,QAAUtB,GAAQ,SAAUy/B,EAAcC,GAEpGhlC,EAAOsB,GAAI0jC,GAAa,SAAU7P,EAAQ3rB,GACzC,GAAIgB,GAAY/F,UAAU5B,SAAYkiC,GAAkC,iBAAX5P,IAC5DjB,EAAQ6Q,IAAkB5P,KAAW,GAAQ3rB,KAAU,EAAO,SAAW,SAE1E,OAAOxJ,GAAOsK,OAAQ3H,KAAM,SAAUD,EAAMkE,EAAM4C,GACjD,GAAIuI,EAEJ,OAAK/R,GAAO8G,SAAUpE,GAIdA,EAAK9C,SAASE,gBAAiB,SAAWwF,GAI3B,IAAlB5C,EAAKQ,UACT6O,EAAMrP,EAAK5C,gBAIJiG,KAAKwe,IACX7hB,EAAKwd,KAAM,SAAW5a,GAAQyM,EAAK,SAAWzM,GAC9C5C,EAAKwd,KAAM,SAAW5a,GAAQyM,EAAK,SAAWzM,GAC9CyM,EAAK,SAAWzM,KAIXkE,IAAUjK,UAEhBS,EAAO4yB,IAAKlwB,EAAMkE,EAAMstB,GAGxBl0B,EAAOgL,MAAOtI,EAAMkE,EAAM4C,EAAO0qB,IAChCttB,EAAM4D,EAAY2qB,EAAS51B,UAAWiL,EAAW,WAQvDxK,EAAOsB,GAAG2jC,KAAO,WAChB,MAAOtiC,MAAKE,QAGb7C,EAAOsB,GAAG4jC,QAAUllC,EAAOsB,GAAGyqB,QAGP,gBAAXoZ,SAAuBA,QAAoC,gBAAnBA,QAAOC,QAK1DD,OAAOC,QAAUplC,EASM,kBAAXqlC,SAAyBA,OAAOC,KAC3CD,OAAQ,YAAc,WAAc,MAAOrlC,KAMtB,gBAAXV,IAAkD,gBAApBA,GAAOM,WAChDN,EAAOU,OAASV,EAAOY,EAAIF,KAGxBV"}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js
new file mode 100755
index 000000000..4e6396b21
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jquery-ui.min.js
@@ -0,0 +1,7 @@
+/*! jQuery UI - v1.11.4 - 2015-03-15
+* http://jqueryui.com
+* Includes: core.js, datepicker.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap='#"+n+"']")[0],!!r&&i(r)):!1):(/^(input|select|textarea|button|object)$/.test(o)?!t.disabled:"a"===o?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function a(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=n(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",r)}function r(){e.datepicker._isDisabledDatepicker(h.inline?h.dpDiv.parent()[0]:h.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function o(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,a=t?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:a.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&n.length?n:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),a=isNaN(s);return(a||s>=0)&&t(i,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,n){return e.each(a,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),n&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var a="Width"===i?["Left","Right"]:["Top","Bottom"],n=i.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?r["inner"+i].call(this):this.each(function(){e(this).css(n,s(this,t)+"px")})},e.fn["outer"+i]=function(t,a){return"number"!=typeof t?r["outer"+i].call(this,t):this.each(function(){e(this).css(n,s(this,t,!0,a)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,a=e(this[0]);a.length&&a[0]!==document;){if(i=a.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(a.css("zIndex"),10),!isNaN(s)&&0!==s))return s;a=a.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i,s){var a,n=e.plugins[t];if(n&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(a=0;n.length>a;a++)e.options[n[a][0]]&&n[a][1].apply(e.element,i)}},e.extend(e.ui,{datepicker:{version:"1.11.4"}});var h;e.extend(a.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,a,n;s=t.nodeName.toLowerCase(),a="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),n=this._newInst(e(t),a),n.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,n):a&&this._inlineDatepicker(t,n)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,a,n,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=e("<span class='"+this._appendClass+"'>"+r+"</span>"),t[o?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(a=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:n,alt:a,title:a}):e("<button type='button'></button>").addClass(this._triggerClass).html(n?e("<img/>").attr({src:n,alt:a,title:a}):a)),t[o?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,a,n=new Date(2009,11,20),r=this._get(e,"dateFormat");r.match(/[DM]/)&&(t=function(e){for(i=0,s=0,a=0;e.length>a;a++)e[a].length>i&&(i=e[a].length,s=a);return s},n.setMonth(t(this._get(e,r.match(/MM/)?"monthNames":"monthNamesShort"))),n.setDate(t(this._get(e,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-n.getDay())),e.input.attr("size",this._formatDate(e,n).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,a,n){var r,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),o(c.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),a=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(a.append.remove(),a.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),h===a&&(h=null))},_enableDatepicker:function(t){var i,s,a=e(t),n=e.data(t,"datepicker");a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=a.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,a=e(t),n=e.data(t,"datepicker");a.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=a.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var a,n,r,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(a=i||{},"string"==typeof i&&(a={},a[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),o(l.settings,a),null!==r&&void 0!==a.dateFormat&&void 0===a.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==a.dateFormat&&void 0===a.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in a&&(a.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,n),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,a,n=e.datepicker._getInst(t.target),r=!0,o=n.dpDiv.is(".ui-datepicker-rtl");if(n._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),r=!1;break;case 13:return a=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",n.dpDiv),a[0]&&e.datepicker._selectDay(t.target,n.selectedMonth,n.selectedYear,a[0]),i=e.datepicker._get(n,"onSelect"),i?(s=e.datepicker._formatDate(n),i.apply(n.input?n.input[0]:null,[s,n])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),r=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),r=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(n,"stepBigMonths"):-e.datepicker._get(n,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),r=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),r=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(n,"stepBigMonths"):+e.datepicker._get(n,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),r=t.ctrlKey||t.metaKey;break;default:r=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):r=!1;r&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,a=e.datepicker._getInst(t.target);return e.datepicker._get(a,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(a,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(a){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,a,n,r,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),a=e.datepicker._get(i,"beforeShow"),n=a?a.apply(t,[t,i]):{},n!==!1&&(o(i.settings,n),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),r=!1,e(t).parents().each(function(){return r|="fixed"===e(this).css("position"),!r}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,r),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,h=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),a=s[1],n=17,o=t.dpDiv.find("."+this._dayOverClass+" a");o.length>0&&r.apply(o.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),a>1&&t.dpDiv.addClass("ui-datepicker-multi-"+a).css("width",n*a+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var a=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),r=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?a-r:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+a>h&&h>a?Math.abs(i.left+a-h):0),i.top-=Math.min(i.top,i.top+n>l&&l>n?Math.abs(n+o):0),i},_findPos:function(t){for(var i,s=this._getInst(t),a=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[a?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,a,n,r=this._curInst;!r||t&&r!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),a=function(){e.datepicker._tidyDialog(r)},e.effects&&(e.effects.effect[i]||e.effects[i])?r.dpDiv.hide(i,e.datepicker._get(r,"showOptions"),s,a):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,a),i||a(),this._datepickerShowing=!1,n=this._get(r,"onClose"),n&&n.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var a=e(t),n=this._getInst(a[0]);this._isDisabledDatepicker(a[0])||(this._adjustInstDate(n,i+("M"===s?this._get(n,"showCurrentAtPos"):0),s),this._updateDatepicker(n))},_gotoToday:function(t){var i,s=e(t),a=this._getInst(s[0]);this._get(a,"gotoCurrent")&&a.currentDay?(a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear):(i=new Date,a.selectedDay=i.getDate(),a.drawMonth=a.selectedMonth=i.getMonth(),a.drawYear=a.selectedYear=i.getFullYear()),this._notifyChange(a),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var a=e(t),n=this._getInst(a[0]);n["selected"+("M"===s?"Month":"Year")]=n["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(n),this._adjustDate(a)},_selectDay:function(t,i,s,a){var n,r=e(t);e(a).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(n=this._getInst(r[0]),n.selectedDay=n.currentDay=e("a",a).html(),n.selectedMonth=n.currentMonth=i,n.selectedYear=n.currentYear=s,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,a=e(t),n=this._getInst(a[0]);i=null!=i?i:this._formatDate(n),n.input&&n.input.val(i),this._updateAlternate(n),s=this._get(n,"onSelect"),s?s.apply(n.input?n.input[0]:null,[i,n]):n.input&&n.input.trigger("change"),n.inline?this._updateDatepicker(n):(this._hideDatepicker(),this._lastInput=n.input[0],"object"!=typeof n.input[0]&&n.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,a,n=this._get(t,"altField");n&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),a=this.formatDate(i,s,this._getFormatConfig(t)),e(n).each(function(){e(this).val(a)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var a,n,r,o,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>a+1&&t.charAt(a+1)===e;return i&&a++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,a="y"===e?s:1,n=RegExp("^\\d{"+a+","+s+"}"),r=i.substring(h).match(n);if(!r)throw"Missing number at position "+h;return h+=r[0].length,parseInt(r[0],10)},k=function(t,s,a){var n=-1,r=e.map(_(t)?a:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(r,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(n=t[0],h+=s.length,!1):void 0}),-1!==n)return n+1;throw"Unknown name at position "+h},w=function(){if(i.charAt(h)!==t.charAt(a))throw"Unexpected literal at position "+h;h++};for(a=0;t.length>a;a++)if(b)"'"!==t.charAt(a)||_("'")?w():b=!1;else switch(t.charAt(a)){case"d":v=x("d");break;case"D":k("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=k("M",p,f);break;case"y":m=x("y");break;case"@":o=new Date(x("@")),m=o.getFullYear(),g=o.getMonth()+1,v=o.getDate();break;case"!":o=new Date((x("!")-this._ticksTo1970)/1e4),m=o.getFullYear(),g=o.getMonth()+1,v=o.getDate();break;case"'":_("'")?w():b=!0;break;default:w()}if(i.length>h&&(r=i.substr(h),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(n=this._getDaysInMonth(m,g-1),n>=v)break;g++,v-=n}if(o=this._daylightSavingAdjust(new Date(m,g-1,v)),o.getFullYear()!==m||o.getMonth()+1!==g||o.getDate()!==v)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,n=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),a,n);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),r,o);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,a=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||a("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":a("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,a=this._getDefaultDate(e),n=a,r=this._getFormatConfig(e);try{n=this.parseDate(i,s,r)||a}catch(o){s=t?"":s}e.selectedDay=n.getDate(),e.drawMonth=e.selectedMonth=n.getMonth(),e.drawYear=e.selectedYear=n.getFullYear(),e.currentDay=s?n.getDate():0,e.currentMonth=s?n.getMonth():0,e.currentYear=s?n.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var a=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},n=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var a=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,n=a.getFullYear(),r=a.getMonth(),o=a.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r));break;case"y":case"Y":n+=parseInt(l[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(n,r))}l=h.exec(i)}return new Date(n,r,o)},r=null==i||""===i?s:"string"==typeof i?n(i):"number"==typeof i?isNaN(i)?s:a(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,a=e.selectedMonth,n=e.selectedYear,r=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=r.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=r.getMonth(),e.drawYear=e.selectedYear=e.currentYear=r.getFullYear(),a===e.selectedMonth&&n===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,a,n,r,o,h,l,u,d,c,p,f,m,g,v,y,b,_,x,k,w,T,S,D,N,M,C,A,P,I,H,F,j,z,E,O,L,W=new Date,R=this._daylightSavingAdjust(new Date(W.getFullYear(),W.getMonth(),W.getDate())),Y=this._get(e,"isRTL"),J=this._get(e,"showButtonPanel"),B=this._get(e,"hideIfNoPrevNext"),K=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),q=this._get(e,"showCurrentAtPos"),Q=this._get(e,"stepMonths"),U=1!==V[0]||1!==V[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-q,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-V[0]*V[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-Q,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":B?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",a=this._get(e,"nextText"),a=K?this.formatDate(a,this._daylightSavingAdjust(new Date(et,Z+Q,1)),this._getFormatConfig(e)):a,n=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+a+"</span></a>":B?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+a+"</span></a>",r=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?G:R,r=K?this.formatDate(r,o,this._getFormatConfig(e)):r,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=J?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",k=0;V[0]>k;k++){for(w="",this.maxRows=4,T=0;V[1]>T;T++){if(S=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),D=" ui-corner-all",N="",U){if(N+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:N+=" ui-datepicker-group-first",D=" ui-corner-"+(Y?"right":"left");
+break;case V[1]-1:N+=" ui-datepicker-group-last",D=" ui-corner-"+(Y?"left":"right");break;default:N+=" ui-datepicker-group-middle",D=""}N+="'>"}for(N+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+D+"'>"+(/all|left/.test(D)&&0===k?Y?n:s:"")+(/all|right/.test(D)&&0===k?Y?s:n:"")+this._generateMonthYearHeader(e,Z,et,X,$,k>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)C=(x+u)%7,M+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[C]+"'>"+p[C]+"</span></th>";for(N+=M+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=U?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,F=this._daylightSavingAdjust(new Date(et,Z,1-P)),j=0;H>j;j++){for(N+="<tr>",z=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",x=0;7>x;x++)E=g?g.apply(e.input?e.input[0]:null,[F]):[!0,""],O=F.getMonth()!==Z,L=O&&!y||!E[0]||X&&X>F||$&&F>$,z+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(O?" ui-datepicker-other-month":"")+(F.getTime()===S.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===F.getTime()&&b.getTime()===S.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(O&&!v?"":" "+E[1]+(F.getTime()===G.getTime()?" "+this._currentClass:"")+(F.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(O&&!v||!E[2]?"":" title='"+E[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(O&&!v?"&#xa0;":L?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===R.getTime()?" ui-state-highlight":"")+(F.getTime()===G.getTime()?" ui-state-active":"")+(O?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);N+=z+"</tr>"}Z++,Z>11&&(Z=0,et++),N+="</tbody></table>"+(U?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=N}_+=w}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,a,n,r,o){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(n||!g)_+="<span class='ui-datepicker-month'>"+r[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=a&&a.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||a.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+o[u]+"</option>");_+="</select>"}if(y||(b+=_+(!n&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",n||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=a?Math.min(m,a.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!n&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),a=e.drawMonth+("M"===i?t:0),n=Math.min(e.selectedDay,this._getDaysInMonth(s,a))+("D"===i?t:0),r=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,a,n)));e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),a=i&&i>t?i:t;return s&&a>s?s:a},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var a=this._getNumberOfMonths(e),n=this._daylightSavingAdjust(new Date(i,s+(0>t?t:a[0]*a[1]),1));return 0>t&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(e,n)},_isInRange:function(e,t){var i,s,a=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=null,o=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!a||t.getTime()>=a.getTime())&&(!n||t.getTime()<=n.getTime())&&(!r||t.getFullYear()>=r)&&(!o||o>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var a=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),a,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new a,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker}); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js b/poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js
new file mode 100644
index 000000000..927190008
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js
@@ -0,0 +1,117 @@
+/*!
+ * jQuery Cookie Plugin v1.4.0
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2013 Klaus Hartl
+ * Released under the MIT license
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as anonymous module.
+ define(['jquery'], factory);
+ } else {
+ // Browser globals.
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var pluses = /\+/g;
+
+ function encode(s) {
+ return config.raw ? s : encodeURIComponent(s);
+ }
+
+ function decode(s) {
+ return config.raw ? s : decodeURIComponent(s);
+ }
+
+ function stringifyCookieValue(value) {
+ return encode(config.json ? JSON.stringify(value) : String(value));
+ }
+
+ function parseCookieValue(s) {
+ if (s.indexOf('"') === 0) {
+ // This is a quoted cookie as according to RFC2068, unescape...
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+ }
+
+ try {
+ // Replace server-side written pluses with spaces.
+ // If we can't decode the cookie, ignore it, it's unusable.
+ s = decodeURIComponent(s.replace(pluses, ' '));
+ } catch(e) {
+ return;
+ }
+
+ try {
+ // If we can't parse the cookie, ignore it, it's unusable.
+ return config.json ? JSON.parse(s) : s;
+ } catch(e) {}
+ }
+
+ function read(s, converter) {
+ var value = config.raw ? s : parseCookieValue(s);
+ return $.isFunction(converter) ? converter(value) : value;
+ }
+
+ var config = $.cookie = function (key, value, options) {
+
+ // Write
+ if (value !== undefined && !$.isFunction(value)) {
+ options = $.extend({}, config.defaults, options);
+
+ if (typeof options.expires === 'number') {
+ var days = options.expires, t = options.expires = new Date();
+ t.setDate(t.getDate() + days);
+ }
+
+ return (document.cookie = [
+ encode(key), '=', stringifyCookieValue(value),
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
+ ].join(''));
+ }
+
+ // Read
+
+ var result = key ? undefined : {};
+
+ // To prevent the for loop in the first place assign an empty array
+ // in case there are no cookies at all. Also prevents odd result when
+ // calling $.cookie().
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
+
+ for (var i = 0, l = cookies.length; i < l; i++) {
+ var parts = cookies[i].split('=');
+ var name = decode(parts.shift());
+ var cookie = parts.join('=');
+
+ if (key && key === name) {
+ // If second argument (value) is a function it's a converter...
+ result = read(cookie, value);
+ break;
+ }
+
+ // Prevent storing a cookie that we couldn't decode.
+ if (!key && (cookie = read(cookie)) !== undefined) {
+ result[name] = cookie;
+ }
+ }
+
+ return result;
+ };
+
+ config.defaults = {};
+
+ $.removeCookie = function (key, options) {
+ if ($.cookie(key) !== undefined) {
+ // Must not alter options, thus extending a fresh object...
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
+ return true;
+ }
+ return false;
+ };
+
+}));
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js b/poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js
new file mode 100644
index 000000000..794b902c5
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js
@@ -0,0 +1,620 @@
+/*
+ * jQuery treetable Plugin 3.1.0
+ * http://ludo.cubicphuse.nl/jquery-treetable
+ *
+ * Copyright 2013, Ludo van den Boom
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ */
+(function() {
+ var $, Node, Tree, methods;
+
+ $ = jQuery;
+
+ Node = (function() {
+ function Node(row, tree, settings) {
+ var parentId;
+
+ this.row = row;
+ this.tree = tree;
+ this.settings = settings;
+
+ // TODO Ensure id/parentId is always a string (not int)
+ this.id = this.row.data(this.settings.nodeIdAttr);
+
+ // TODO Move this to a setParentId function?
+ parentId = this.row.data(this.settings.parentIdAttr);
+ if (parentId != null && parentId !== "") {
+ this.parentId = parentId;
+ }
+
+ this.treeCell = $(this.row.children(this.settings.columnElType)[this.settings.column]);
+ this.expander = $(this.settings.expanderTemplate);
+ this.indenter = $(this.settings.indenterTemplate);
+ this.children = [];
+ this.initialized = false;
+ this.treeCell.prepend(this.indenter);
+ }
+
+ Node.prototype.addChild = function(child) {
+ return this.children.push(child);
+ };
+
+ Node.prototype.ancestors = function() {
+ var ancestors, node;
+ node = this;
+ ancestors = [];
+ while (node = node.parentNode()) {
+ ancestors.push(node);
+ }
+ return ancestors;
+ };
+
+ Node.prototype.collapse = function() {
+ if (this.collapsed()) {
+ return this;
+ }
+
+ this.row.removeClass("expanded").addClass("collapsed");
+
+ this._hideChildren();
+ this.expander.attr("title", this.settings.stringExpand);
+
+ if (this.initialized && this.settings.onNodeCollapse != null) {
+ this.settings.onNodeCollapse.apply(this);
+ }
+
+ return this;
+ };
+
+ Node.prototype.collapsed = function() {
+ return this.row.hasClass("collapsed");
+ };
+
+ // TODO destroy: remove event handlers, expander, indenter, etc.
+
+ Node.prototype.expand = function() {
+ if (this.expanded()) {
+ return this;
+ }
+
+ this.row.removeClass("collapsed").addClass("expanded");
+
+ if (this.initialized && this.settings.onNodeExpand != null) {
+ this.settings.onNodeExpand.apply(this);
+ }
+
+ if ($(this.row).is(":visible")) {
+ this._showChildren();
+ }
+
+ this.expander.attr("title", this.settings.stringCollapse);
+
+ return this;
+ };
+
+ Node.prototype.expanded = function() {
+ return this.row.hasClass("expanded");
+ };
+
+ Node.prototype.hide = function() {
+ this._hideChildren();
+ this.row.hide();
+ return this;
+ };
+
+ Node.prototype.isBranchNode = function() {
+ if(this.children.length > 0 || this.row.data(this.settings.branchAttr) === true) {
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ Node.prototype.updateBranchLeafClass = function(){
+ this.row.removeClass('branch');
+ this.row.removeClass('leaf');
+ this.row.addClass(this.isBranchNode() ? 'branch' : 'leaf');
+ };
+
+ Node.prototype.level = function() {
+ return this.ancestors().length;
+ };
+
+ Node.prototype.parentNode = function() {
+ if (this.parentId != null) {
+ return this.tree[this.parentId];
+ } else {
+ return null;
+ }
+ };
+
+ Node.prototype.removeChild = function(child) {
+ var i = $.inArray(child, this.children);
+ return this.children.splice(i, 1)
+ };
+
+ Node.prototype.render = function() {
+ var handler,
+ settings = this.settings,
+ target;
+
+ if (settings.expandable === true && this.isBranchNode()) {
+ handler = function(e) {
+ $(this).parents("table").treetable("node", $(this).parents("tr").data(settings.nodeIdAttr)).toggle();
+ return e.preventDefault();
+ };
+
+ this.indenter.html(this.expander);
+ target = settings.clickableNodeNames === true ? this.treeCell : this.expander;
+
+ target.off("click.treetable").on("click.treetable", handler);
+ target.off("keydown.treetable").on("keydown.treetable", function(e) {
+ if (e.keyCode == 13) {
+ handler.apply(this, [e]);
+ }
+ });
+ }
+
+ this.indenter[0].style.paddingLeft = "" + (this.level() * settings.indent) + "px";
+
+ return this;
+ };
+
+ Node.prototype.reveal = function() {
+ if (this.parentId != null) {
+ this.parentNode().reveal();
+ }
+ return this.expand();
+ };
+
+ Node.prototype.setParent = function(node) {
+ if (this.parentId != null) {
+ this.tree[this.parentId].removeChild(this);
+ }
+ this.parentId = node.id;
+ this.row.data(this.settings.parentIdAttr, node.id);
+ return node.addChild(this);
+ };
+
+ Node.prototype.show = function() {
+ if (!this.initialized) {
+ this._initialize();
+ }
+ this.row.show();
+ if (this.expanded()) {
+ this._showChildren();
+ }
+ return this;
+ };
+
+ Node.prototype.toggle = function() {
+ if (this.expanded()) {
+ this.collapse();
+ } else {
+ this.expand();
+ }
+ return this;
+ };
+
+ Node.prototype._hideChildren = function() {
+ var child, _i, _len, _ref, _results;
+ _ref = this.children;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ child = _ref[_i];
+ _results.push(child.hide());
+ }
+ return _results;
+ };
+
+ Node.prototype._initialize = function() {
+ var settings = this.settings;
+
+ this.render();
+
+ if (settings.expandable === true && settings.initialState === "collapsed") {
+ this.collapse();
+ } else {
+ this.expand();
+ }
+
+ if (settings.onNodeInitialized != null) {
+ settings.onNodeInitialized.apply(this);
+ }
+
+ return this.initialized = true;
+ };
+
+ Node.prototype._showChildren = function() {
+ var child, _i, _len, _ref, _results;
+ _ref = this.children;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ child = _ref[_i];
+ _results.push(child.show());
+ }
+ return _results;
+ };
+
+ return Node;
+ })();
+
+ Tree = (function() {
+ function Tree(table, settings) {
+ this.table = table;
+ this.settings = settings;
+ this.tree = {};
+
+ // Cache the nodes and roots in simple arrays for quick access/iteration
+ this.nodes = [];
+ this.roots = [];
+ }
+
+ Tree.prototype.collapseAll = function() {
+ var node, _i, _len, _ref, _results;
+ _ref = this.nodes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ node = _ref[_i];
+ _results.push(node.collapse());
+ }
+ return _results;
+ };
+
+ Tree.prototype.expandAll = function() {
+ var node, _i, _len, _ref, _results;
+ _ref = this.nodes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ node = _ref[_i];
+ _results.push(node.expand());
+ }
+ return _results;
+ };
+
+ Tree.prototype.findLastNode = function (node) {
+ if (node.children.length > 0) {
+ return this.findLastNode(node.children[node.children.length - 1]);
+ } else {
+ return node;
+ }
+ };
+
+ Tree.prototype.loadRows = function(rows) {
+ var node, row, i;
+
+ if (rows != null) {
+ for (i = 0; i < rows.length; i++) {
+ row = $(rows[i]);
+
+ if (row.data(this.settings.nodeIdAttr) != null) {
+ node = new Node(row, this.tree, this.settings);
+ this.nodes.push(node);
+ this.tree[node.id] = node;
+
+ if (node.parentId != null) {
+ this.tree[node.parentId].addChild(node);
+ } else {
+ this.roots.push(node);
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < this.nodes.length; i++) {
+ node = this.nodes[i].updateBranchLeafClass();
+ }
+
+ return this;
+ };
+
+ Tree.prototype.move = function(node, destination) {
+ // Conditions:
+ // 1: +node+ should not be inserted as a child of +node+ itself.
+ // 2: +destination+ should not be the same as +node+'s current parent (this
+ // prevents +node+ from being moved to the same location where it already
+ // is).
+ // 3: +node+ should not be inserted in a location in a branch if this would
+ // result in +node+ being an ancestor of itself.
+ var nodeParent = node.parentNode();
+ if (node !== destination && destination.id !== node.parentId && $.inArray(node, destination.ancestors()) === -1) {
+ node.setParent(destination);
+ this._moveRows(node, destination);
+
+ // Re-render parentNode if this is its first child node, and therefore
+ // doesn't have the expander yet.
+ if (node.parentNode().children.length === 1) {
+ node.parentNode().render();
+ }
+ }
+
+ if(nodeParent){
+ nodeParent.updateBranchLeafClass();
+ }
+ if(node.parentNode()){
+ node.parentNode().updateBranchLeafClass();
+ }
+ node.updateBranchLeafClass();
+ return this;
+ };
+
+ Tree.prototype.removeNode = function(node) {
+ // Recursively remove all descendants of +node+
+ this.unloadBranch(node);
+
+ // Remove node from DOM (<tr>)
+ node.row.remove();
+
+ // Clean up Tree object (so Node objects are GC-ed)
+ delete this.tree[node.id];
+ this.nodes.splice($.inArray(node, this.nodes), 1);
+ }
+
+ Tree.prototype.render = function() {
+ var root, _i, _len, _ref;
+ _ref = this.roots;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ root = _ref[_i];
+
+ // Naming is confusing (show/render). I do not call render on node from
+ // here.
+ root.show();
+ }
+ return this;
+ };
+
+ Tree.prototype.sortBranch = function(node, sortFun) {
+ // First sort internal array of children
+ node.children.sort(sortFun);
+
+ // Next render rows in correct order on page
+ this._sortChildRows(node);
+
+ return this;
+ };
+
+ Tree.prototype.unloadBranch = function(node) {
+ var children, i;
+
+ for (i = 0; i < node.children.length; i++) {
+ this.removeNode(node.children[i]);
+ }
+
+ // Reset node's collection of children
+ node.children = [];
+
+ node.updateBranchLeafClass();
+
+ return this;
+ };
+
+ Tree.prototype._moveRows = function(node, destination) {
+ var children = node.children, i;
+
+ node.row.insertAfter(destination.row);
+ node.render();
+
+ // Loop backwards through children to have them end up on UI in correct
+ // order (see #112)
+ for (i = children.length - 1; i >= 0; i--) {
+ this._moveRows(children[i], node);
+ }
+ };
+
+ // Special _moveRows case, move children to itself to force sorting
+ Tree.prototype._sortChildRows = function(parentNode) {
+ return this._moveRows(parentNode, parentNode);
+ };
+
+ return Tree;
+ })();
+
+ // jQuery Plugin
+ methods = {
+ init: function(options, force) {
+ var settings;
+
+ settings = $.extend({
+ branchAttr: "ttBranch",
+ clickableNodeNames: false,
+ column: 0,
+ columnElType: "td", // i.e. 'td', 'th' or 'td,th'
+ expandable: false,
+ expanderTemplate: "<a href='#'>&nbsp;</a>",
+ indent: 10,
+ indenterTemplate: "<span class='indenter'></span>",
+ initialState: "collapsed",
+ nodeIdAttr: "ttId", // maps to data-tt-id
+ parentIdAttr: "ttParentId", // maps to data-tt-parent-id
+ stringExpand: "Expand",
+ stringCollapse: "Collapse",
+
+ // Events
+ onInitialized: null,
+ onNodeCollapse: null,
+ onNodeExpand: null,
+ onNodeInitialized: null
+ }, options);
+
+ return this.each(function() {
+ var el = $(this), tree;
+
+ if (force || el.data("treetable") === undefined) {
+ tree = new Tree(this, settings);
+ tree.loadRows(this.rows).render();
+
+ el.addClass("treetable").data("treetable", tree);
+
+ if (settings.onInitialized != null) {
+ settings.onInitialized.apply(tree);
+ }
+ }
+
+ return el;
+ });
+ },
+
+ destroy: function() {
+ return this.each(function() {
+ return $(this).removeData("treetable").removeClass("treetable");
+ });
+ },
+
+ collapseAll: function() {
+ this.data("treetable").collapseAll();
+ return this;
+ },
+
+ collapseNode: function(id) {
+ var node = this.data("treetable").tree[id];
+
+ if (node) {
+ node.collapse();
+ } else {
+ throw new Error("Unknown node '" + id + "'");
+ }
+
+ return this;
+ },
+
+ expandAll: function() {
+ this.data("treetable").expandAll();
+ return this;
+ },
+
+ expandNode: function(id) {
+ var node = this.data("treetable").tree[id];
+
+ if (node) {
+ if (!node.initialized) {
+ node._initialize();
+ }
+
+ node.expand();
+ } else {
+ throw new Error("Unknown node '" + id + "'");
+ }
+
+ return this;
+ },
+
+ loadBranch: function(node, rows) {
+ var settings = this.data("treetable").settings,
+ tree = this.data("treetable").tree;
+
+ // TODO Switch to $.parseHTML
+ rows = $(rows);
+
+ if (node == null) { // Inserting new root nodes
+ this.append(rows);
+ } else {
+ var lastNode = this.data("treetable").findLastNode(node);
+ rows.insertAfter(lastNode.row);
+ }
+
+ this.data("treetable").loadRows(rows);
+
+ // Make sure nodes are properly initialized
+ rows.filter("tr").each(function() {
+ tree[$(this).data(settings.nodeIdAttr)].show();
+ });
+
+ if (node != null) {
+ // Re-render parent to ensure expander icon is shown (#79)
+ node.render().expand();
+ }
+
+ return this;
+ },
+
+ move: function(nodeId, destinationId) {
+ var destination, node;
+
+ node = this.data("treetable").tree[nodeId];
+ destination = this.data("treetable").tree[destinationId];
+ this.data("treetable").move(node, destination);
+
+ return this;
+ },
+
+ node: function(id) {
+ return this.data("treetable").tree[id];
+ },
+
+ removeNode: function(id) {
+ var node = this.data("treetable").tree[id];
+
+ if (node) {
+ this.data("treetable").removeNode(node);
+ } else {
+ throw new Error("Unknown node '" + id + "'");
+ }
+
+ return this;
+ },
+
+ reveal: function(id) {
+ var node = this.data("treetable").tree[id];
+
+ if (node) {
+ node.reveal();
+ } else {
+ throw new Error("Unknown node '" + id + "'");
+ }
+
+ return this;
+ },
+
+ sortBranch: function(node, columnOrFunction) {
+ var settings = this.data("treetable").settings,
+ prepValue,
+ sortFun;
+
+ columnOrFunction = columnOrFunction || settings.column;
+ sortFun = columnOrFunction;
+
+ if ($.isNumeric(columnOrFunction)) {
+ sortFun = function(a, b) {
+ var extractValue, valA, valB;
+
+ extractValue = function(node) {
+ var val = node.row.find("td:eq(" + columnOrFunction + ")").text();
+ // Ignore trailing/leading whitespace and use uppercase values for
+ // case insensitive ordering
+ return $.trim(val).toUpperCase();
+ }
+
+ valA = extractValue(a);
+ valB = extractValue(b);
+
+ if (valA < valB) return -1;
+ if (valA > valB) return 1;
+ return 0;
+ };
+ }
+
+ this.data("treetable").sortBranch(node, sortFun);
+ return this;
+ },
+
+ unloadBranch: function(node) {
+ this.data("treetable").unloadBranch(node);
+ return this;
+ }
+ };
+
+ $.fn.treetable = function(method) {
+ if (methods[method]) {
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ return $.error("Method " + method + " does not exist on jQuery.treetable");
+ }
+ };
+
+ // Expose classes to world
+ this.TreeTable || (this.TreeTable = {});
+ this.TreeTable.Node = Node;
+ this.TreeTable.Tree = Tree;
+}).call(this);
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/jsrender.min.js b/poky/bitbake/lib/toaster/toastergui/static/js/jsrender.min.js
new file mode 100644
index 000000000..87cac4eb3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/jsrender.min.js
@@ -0,0 +1,4 @@
+/*! JsRender v0.9.78 (Beta): http://jsviews.com/#jsrender */
+/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
+!function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return e(t,n)}:"function"==typeof define&&define.amd?define(function(){return e(t)}):e(t,!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return te(t)&&(t=n(e?e._d?e:n(s,e):s,t),t._d=1),t}function i(e,t){for(var n in t.props)Re.test(n)&&(e[n]=r(e[n],t.props[n]))}function o(e){return e}function s(){return""}function a(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function d(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e,t,n){return e?(de.delimiters=[e,t,ve=n?n.charAt(0):ve],pe=e.charAt(0),ce=e.charAt(1),fe=t.charAt(0),ge=t.charAt(1),e="\\"+pe+"(\\"+ve+")?\\"+ce,t="\\"+fe+"\\"+ge,G="(?:(\\w+(?=[\\/\\s\\"+fe+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+fe+"]|\\"+fe+"(?!\\"+ge+"))*?)",ae.rTag="(?:"+G+")",G=new RegExp("(?:"+e+G+"(\\/)?|\\"+pe+"(\\"+ve+")?\\"+ce+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),W=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),le):de.delimiters}function p(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,o,s=this,a=!t||"root"===t;if(e){if(o=t&&s.type===t&&s,!o)if(n=s.views,s._.useKey){for(r in n)if(o=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!o&&i>r;r++)o=t?n[r].get(e,t):n[r]}else if(a)for(;s.parent;)o=s,s=s.parent;else for(;s&&!o;)o=s.type===t?s:void 0,s=s.parent;return o}function c(){var e=this.get("item");return e?e.index:void 0}function f(){return this.index}function g(t){var n,r=this,i=r.linkCtx,o=(r.ctx||{})[t];return void 0===o&&i&&i.ctx&&(o=i.ctx[t]),void 0===o&&(o=oe[t]),o&&te(o)&&!o._wrp&&(n=function(){return o.apply(this&&this!==e?this:r,arguments)},n._wrp=r,u(n,o)),n||o}function v(e){return e&&(e.fn?e:this.getRsc("templates",e)||re(e))}function h(e,t,n,r){var o,s,a="number"==typeof n&&t.tmpl.bnds[n-1],d=t.linkCtx;return void 0!==r?n=r={props:{},args:[r]}:a&&(n=a(t.data,t,ae)),s=n.args[0],(e||a)&&(o=d&&d.tag,o||(o=u(new ae._tg,{_:{inline:!d,bnd:a,unlinked:!0},tagName:":",cvt:e,flow:!0,tagCtx:n}),d&&(d.tag=o,o.linkCtx=d),n.ctx=L(n.ctx,(d?d.view:t).ctx)),o._er=r&&s,i(o,n),n.view=t,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,s=o.cvtArgs("true"!==e&&e)[0],s=a&&t._.onRender?t._.onRender(s,t,o):s),void 0!=s?s:""}function m(e){var t=this,n=t.tagCtx,r=n.view,i=n.args;return e=e||t.convert,e=e&&(""+e===e?r.getRsc("converters",e)||S("Unknown converter: '"+e+"'"):e),i=i.length||n.index?e?i.slice():i:[r.data],e&&(e.depends&&(t.depends=ae.getDeps(t.depends,t,e.depends,e)),i[0]=e.apply(t,i)),i}function w(e,t){for(var n,r,i=this;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||Y[e][t]}function x(e,t,n,r,o,s){t=t||X;var a,d,u,l,p,c,f,g,v,h,m,w,x,b,_,y,k,j,C,A="",T=t.linkCtx||0,V=t.ctx,R=n||t.tmpl,M="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(a=e,e=a.tagName,r=a.tagCtxs,u=a.template):(d=t.getRsc("tags",e)||S("Unknown tag: {{"+e+"}} "),u=d.template),void 0!==s?(A+=s,r=s=[{props:{},args:[]}]):M&&(r=M(t.data,t,ae)),g=r.length,f=0;g>f;f++)h=r[f],(!T||!T.tag||f&&!T.tag._.inline||a._er)&&((w=R.tmpls&&h.tmpl)&&(w=h.content=R.tmpls[w-1]),h.index=f,h.tmpl=w,h.render=N,h.view=t,h.ctx=L(h.ctx,V)),(n=h.props.tmpl)&&(h.tmpl=t.getTmpl(n)),a||(a=new d._ctr,x=!!a.init,a.parent=c=V&&V.tag,a.tagCtxs=r,C=a.dataMap,T&&(a._.inline=!1,T.tag=a,a.linkCtx=T),(a._.bnd=M||T.fn)?a._.arrVws={}:a.dataBoundOnly&&S("{^{"+e+"}} tag must be data-bound")),r=a.tagCtxs,C=a.dataMap,h.tag=a,C&&r&&(h.map=r[f].map),a.flow||(m=h.ctx=h.ctx||{},l=a.parents=m.parentTags=V&&L(m.parentTags,V.parentTags)||{},c&&(l[c.tagName]=c),l[a.tagName]=m.tag=a);if(!(a._er=s)){for(i(a,r[0]),a.rendering={},f=0;g>f;f++)h=a.tagCtx=r[f],k=h.props,y=a.cvtArgs(),(b=k.dataMap||C)&&(y.length||k.dataMap)&&(_=h.map,_&&_.src===y[0]&&!o||(_&&_.src&&_.unmap(),_=h.map=b.map(y[0],k,void 0,!a._.bnd)),y=[_.tgt]),a.ctx=h.ctx,f||(x&&(j=a.template,a.init(h,T,a.ctx),x=void 0),T&&(T.attr=a.attr=T.attr||a.attr),p=a.attr,a._.noVws=p&&p!==Ee),v=void 0,a.render&&(v=a.render.apply(a,y)),y.length||(y=[t]),void 0===v&&(v=h.render(y[0],!0)||(o?void 0:"")),A=A?A+(v||""):v;a.rendering=void 0}return a.tagCtx=r[0],a.ctx=a.tagCtx.ctx,a._.noVws&&a._.inline&&(A="text"===p?ie.html(A):""),M&&t._.onRender?t._.onRender(A,t,a):A}function b(e,t,n,r,i,o,s,a){var d,u,l,p=this,f="array"===t;p.content=a,p.views=f?[]:{},p.parent=n,p.type=t||"top",p.data=r,p.tmpl=i,l=p._={key:0,useKey:f?0:1,id:""+$e++,onRender:s,bnds:{}},p.linked=!!s,n?(d=n.views,u=n._,u.useKey?(d[l.key="_"+u.useKey++]=p,p.index=Ue,p.getIndex=c):d.length===(l.key=p.index=o)?d.push(p):d.splice(o,0,p),p.ctx=e||n.ctx):p.ctx=e}function _(e){var t,n,r,i,o,s,a;for(t in Oe)if(o=Oe[t],(s=o.compile)&&(n=e[t+"s"]))for(r in n)i=n[r]=s(r,n[r],e,0),i._is=t,i&&(a=ae.onStore[t])&&a(r,i,s)}function y(e,t,n){function i(){var t=this;t._={inline:!0,unlinked:!0},t.tagName=e}var o,s,a,d=new ae._tg;if(te(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),s=t.baseTag){t.flow=!!t.flow,t.baseTag=s=""+s===s?n&&n.tags[s]||se[s]:s,d=u(d,s);for(a in t)d[a]=r(s[a],t[a])}else d=u(d,t);return void 0!==(o=d.template)&&(d.template=""+o===o?re[o]||re(o):o),d.init!==!1&&((i.prototype=d).constructor=d._ctr=i),n&&(d._parentTmpl=n),d}function k(e){return this.base.apply(this,e)}function j(e,n,r,i){function o(n){var o,a;if(""+n===n||n.nodeType>0&&(s=n)){if(!s)if(/^\.\/[^\\:*?"<>]*$/.test(n))(a=re[e=e||n])?n=a:s=document.getElementById(n);else if(t.fn&&!W.test(n))try{s=t(document).find(n)[0]}catch(d){}s&&(i?n=s.innerHTML:(o=s.getAttribute(Se),o?o!==Ie?(n=re[o],delete re[o]):t.fn&&(n=t.data(s)[Ie]):(e=e||(t.fn?Ie:n),n=j(e,s.innerHTML,r,i)),n.tmplName=e=e||o,e!==Ie&&(re[e]=n),s.setAttribute(Se,e),t.fn&&t.data(s,Ie,n))),s=void 0}else n.fn||(n=void 0);return n}var s,a,d=n=n||"";return 0===i&&(i=void 0,d=o(d)),i=i||(n.markup?n:{}),i.tmplName=e,r&&(i._parentTmpl=r),!d&&n.markup&&(d=o(n.markup))&&d.fn&&(d=d.markup),void 0!==d?(d.fn||n.fn?d.fn&&(a=d):(n=V(d,i),U(d.replace(ke,"\\$&"),n)),a||(_(i),a=u(function(){return n.render.apply(n,arguments)},n)),e&&!r&&e!==Ie&&(qe[e]=a),a):void 0}function C(e,n){return t.isFunction(e)?e.call(n):e}function A(e){var t,n=[],r=e.length;for(t=0;r>t;t++)n.push(e[t].unmap());return n}function T(e,n){function r(e){l.apply(this,e)}function i(){return new r(arguments)}function o(e,t){var n,r,i,o,s,a=c.length;for(n=0;a>n;n++)o=c[n],r=void 0,o+""!==o&&(r=o,o=r.getter),void 0===(s=e[o])&&r&&void 0!==(i=r.defaultVal)&&(s=C(i,e)),t(s,r&&p[r.type],o)}function s(n){n=n+""===n?JSON.parse(n):n;var r,i,s,u=n,l=[];if(t.isArray(n)){for(n=n||[],i=n.length,r=0;i>r;r++)l.push(this.map(n[r]));return l._is=e,l.unmap=d,l.merge=a,l}if(n){o(n,function(e,t){t&&(e=t.map(e)),l.push(e)}),u=this.apply(this,l);for(s in n)s===ee||b[s]||(u[s]=n[s])}return u}function a(e){e=e+""===e?JSON.parse(e):e;var n,r,s,a,d,u,l,p,c,f,v=this;if(t.isArray(v)){for(p={},f=[],s=e.length,a=v.length,n=0;s>n;n++){for(c=e[n],l=!1,r=0;a>r&&!l;r++)p[r]||(u=v[r],g&&(p[r]=l=g+""===g?c[g]&&(b[g]?u[g]():u[g])===c[g]:g(u,c)));l?(u.merge(c),f.push(u)):f.push(i.map(c))}return void(x?x(v).refresh(f,!0):v.splice.apply(v,[0,v.length].concat(f)))}o(e,function(e,t,n){t?v[n]().merge(e):v[n](e)});for(d in e)d===ee||b[d]||(v[d]=e[d])}function d(){var e,n,r,i,o,s,a=this;if(t.isArray(a))return A(a);for(e={},i=c.length,r=0;i>r;r++)n=c[r],o=void 0,n+""!==n&&(o=n,n=o.getter),s=a[n](),e[n]=o&&s&&p[o.type]?t.isArray(s)?A(s):s.unmap():s;for(n in a)"_is"===n||b[n]||n===ee||"_"===n.charAt(0)&&b[n.slice(1)]||t.isFunction(a[n])||(e[n]=a[n]);return e}var u,l,p=this,c=n.getters,f=n.extend,g=n.id,v=t.extend({_is:e||"unnamed",unmap:d,merge:a},f),h="",m="",w=c?c.length:0,x=t.observable,b={};for(r.prototype=v,u=0;w>u;u++)!function(e){e=e.getter||e,b[e]=u+1;var t="_"+e;h+=(h?",":"")+e,m+="this."+t+" = "+e+";\n",v[e]=v[e]||function(n){return arguments.length?void(x?x(this).setProperty(e,n):this[t]=n):this[t]},x&&(v[e].set=v[e].set||function(e){this[t]=e})}(c[u]);return l=new Function(h,m.slice(0,-1)),l.prototype=v,v.constructor=l,i.map=s,i.getters=c,i.extend=f,i.id=g,i}function V(e,n){var r,i=ue._wm||{},o=u({tmpls:[],links:{},bnds:[],_is:"template",render:N},n);return o.markup=e,n.htmlTag||(r=Ae.exec(e),o.htmlTag=r?r[1].toLowerCase():""),r=i[o.htmlTag],r&&r!==i.div&&(o.markup=t.trim(o.markup)),o}function R(e,t){function n(i,o,s){var a,d,u,l;if(i&&typeof i===Fe&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(u in i)n(u,i[u],o);return o||Y}return void 0===o&&(o=i,i=void 0),i&&""+i!==i&&(s=o,o=i,i=void 0),l=s?"viewModel"===e?s:s[r]=s[r]||{}:n,d=t.compile,null===o?i&&delete l[i]:(o=d?d.call(l,i,o,s,0):o,i&&(l[i]=o)),d&&o&&(o._is=e),o&&(a=ae.onStore[e])&&a(i,o,d),o}var r=e+"s";Y[r]=n}function M(e){le[e]=function(t){return arguments.length?(de[e]=t,le):de[e]}}function $(e){function t(t,n){this.tgt=e.getTgt(t,n)}return te(e)&&(e={getTgt:e}),e.baseMap&&(e=u(u({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function N(e,t,n,r,i,o){var s,a,d,u,l,p,c,f,g=r,v="";if(t===!0?(n=t,t=void 0):typeof t!==Fe&&(t=void 0),(d=this.tag)?(l=this,g=g||l.view,u=g.getTmpl(d.template||l.tmpl),arguments.length||(e=g)):u=this,u){if(!g&&e&&"view"===e._is&&(g=e),g&&e===g&&(e=g.data),p=!g,me=me||p,g||((t=t||{}).root=e),!me||ue.useViews||u.useViews||g&&g!==X)v=E(u,e,t,n,g,i,o,d);else{if(g?(c=g.data,f=g.index,g.index=Ue):(g=X,g.data=e,g.ctx=t),ne(e)&&!n)for(s=0,a=e.length;a>s;s++)g.index=s,g.data=e[s],v+=u.fn(e[s],g,ae);else g.data=e,v+=u.fn(e,g,ae);g.data=c,g.index=f}p&&(me=void 0)}return v}function E(e,t,n,r,i,o,s,a){function d(e){_=u({},n),_[x]=e}var l,p,c,f,g,v,h,m,w,x,_,y,k="";if(a&&(w=a.tagName,y=a.tagCtx,n=n?L(n,a.ctx):a.ctx,e===i.content?h=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==y.content?e===a.template?(h=y.tmpl,n._wrp=y.content):h=y.content||i.content:h=i.content,y.props.link===!1&&(n=n||{},n.link=!1),(x=y.props.itemVar)&&("~"!==x.charAt(0)&&I("Use itemVar='~myItem'"),x=x.slice(1))),i&&(s=s||i._.onRender,n=L(n,i.ctx)),o===!0&&(v=!0,o=0),s&&(n&&n.link===!1||a&&a._.noVws)&&(s=void 0),m=s,s===!0&&(m=void 0,s=i._.onRender),n=e.helpers?L(e.helpers,n):n,_=n,ne(t)&&!r)for(c=v?i:void 0!==o&&i||new b(n,"array",i,t,e,o,s),i&&i._.useKey&&(c._.bnd=!a||a._.bnd&&a),x&&(c.it=x),x=c.it,l=0,p=t.length;p>l;l++)x&&d(t[l]),f=new b(_,"item",c,t[l],e,(o||0)+l,s,h),g=e.fn(t[l],f,ae),k+=c._.onRender?c._.onRender(g,f):g;else x&&d(t),c=v?i:new b(_,w||"data",i,t,e,o,s,h),a&&!a.flow&&(c.tag=a),k+=e.fn(t,c,ae);return m?m(k,c):k}function F(e,t,n){var r=void 0!==n?te(n)?n.call(t.data,e,t):n||"":"{Error: "+e.message+"}";return de.onError&&void 0!==(n=de.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t.linkCtx?ie.html(r):r}function S(e){throw new ae.Err(e)}function I(e){S("Syntax error\n"+e)}function U(e,t,n,r,i){function o(t){t-=v,t&&m.push(e.substr(v,t).replace(_e,"\\n"))}function s(t,n){t&&(t+="}}",I((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}function a(a,d,u,c,g,x,b,_,y,k,j,C){(b&&d||y&&!u||_&&":"===_.slice(-1)||k)&&I(a),x&&(g=":",c=Ee),y=y||n&&!i;var A=(d||n)&&[[]],T="",V="",R="",M="",$="",N="",E="",F="",S=!y&&!g;u=u||(_=_||"#data",g),o(C),v=C+a.length,b?f&&m.push(["*","\n"+_.replace(/^:/,"ret+= ").replace(ye,"$1")+";\n"]):u?("else"===u&&(Ce.test(_)&&I('for "{{else if expr}}" use "{{else expr}}"'),A=w[7]&&[[]],w[8]=e.substring(w[8],C),w=h.pop(),m=w[2],S=!0),_&&O(_.replace(_e," "),A,t).replace(je,function(e,t,n,r,i,o,s,a){return r="'"+i+"':",s?(V+=o+",",M+="'"+a+"',"):n?(R+=r+o+",",N+=r+"'"+a+"',"):t?E+=o:("trigger"===i&&(F+=o),T+=r+o+",",$+=r+"'"+a+"',",p=p||Re.test(i)),""}).slice(0,-1),A&&A[0]&&A.pop(),l=[u,c||!!r||p||"",S&&[],J(M||(":"===u?"'#data',":""),$,N),J(V||(":"===u?"data,":""),T,R),E,F,A||0],m.push(l),S&&(h.push(w),w=l,w[8]=v)):j&&(s(j!==w[0]&&"else"!==w[0]&&j,w[0]),w[8]=e.substring(w[8],C),w=h.pop()),s(!w&&j),m=w[2]}var d,u,l,p,c,f=de.allowCode||t&&t.allowCode||le.allowCode===!0,g=[],v=0,h=[],m=g,w=[,,g];if(f&&(t.allowCode=f),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+ge),e=pe+e+ge),s(h[0]&&h[0][2].pop()[0]),e.replace(G,a),o(e.length),(v=g[g.length-1])&&s(""+v!==v&&+v[8]===v[8]&&v[0]),n){for(u=B(g,e,n),c=[],d=g.length;d--;)c.unshift(g[d][7]);q(u,c)}else u=B(g,t);return u}function q(e,t){var n,r,i=0,o=t.length;for(e.deps=[];o>i;i++){r=t[i];for(n in r)"_jsvto"!==n&&r[n].length&&(e.deps=e.deps.concat(r[n]))}e.paths=r}function J(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function K(e,t){return"\n "+(t?t+":{":"")+"args:["+e[0]+"]"+(e[1]||!t?",\n props:{"+e[1]+"}":"")+(e[2]?",\n ctx:{"+e[2]+"}":"")}function O(e,t,n){function r(r,m,w,x,b,_,y,k,j,C,A,T,V,R,M,$,N,E,F,S){function q(e,n,r,s,a,d,p,c){var f="."===r;if(r&&(b=b.slice(n.length),/^\.?constructor$/.test(c||b)&&I(e),f||(e=(s?'view.hlp("'+s+'")':a?"view":"data")+(c?(d?"."+d:s?"":a?"":"."+r)+(p||""):(c=s?"":a?d||"":r,"")),e+=c?"."+c:"",e=n+("view.data"===e.slice(0,9)?e.slice(5):e)),u)){if(O="linkTo"===i?o=t._jsvto=t._jsvto||[]:l.bd,B=f&&O[O.length-1]){if(B._jsv){for(;B.sb;)B=B.sb;B.bnd&&(b="^"+b.slice(1)),B.sb=b,B.bnd=B.bnd||"^"===b.charAt(0)}}else O.push(b);h[g]=F+(f?1:0)}return e}x=u&&x,x&&!k&&(b=x+b),_=_||"",w=w||m||T,b=b||j,C=C||N||"";var J,K,O,B,L,Q=")";if("["===C&&(C="[j._sq(",Q=")]"),!y||d||a){if(u&&$&&!d&&!a&&(!i||s||o)&&(J=h[g-1],S.length-1>F-(J||0))){if(J=S.slice(J,F+r.length),K!==!0)if(O=o||p[g-1].bd,B=O[O.length-1],B&&B.prm){for(;B.sb&&B.sb.prm;)B=B.sb;L=B.sb={path:B.sb,bnd:B.bnd}}else O.push(L={path:O.pop()});$=ce+":"+J+" onerror=''"+fe,K=f[$],K||(f[$]=!0,f[$]=K=U($,n,!0)),K!==!0&&L&&(L._jsv=K,L.prm=l.bd,L.bnd=L.bnd||L.path&&L.path.indexOf("^")>=0)}return d?(d=!V,d?r:T+'"'):a?(a=!R,a?r:T+'"'):(w?(h[g]=F++,l=p[++g]={bd:[]},w):"")+(E?g?"":(c=S.slice(c,F),(i?(i=s=o=!1,"\b"):"\b,")+c+(c=F+r.length,u&&t.push(l.bd=[]),"\b")):k?(g&&I(e),u&&t.pop(),i=b,s=x,c=F+r.length,x&&(u=l.bd=t[i]=[]),b+":"):b?b.split("^").join(".").replace(xe,q)+(C?(l=p[++g]={bd:[]},v[g]=Q,C):_):_?_:M?(M=v[g]||M,v[g]=!1,l=p[--g],M+(C?(l=p[++g],v[g]=Q,C):"")):A?(v[g]||I(e),","):m?"":(d=V,a=R,'"'))}I(e)}var i,o,s,a,d,u=t&&t[0],l={bd:u},p={0:l},c=0,f=n?n.links:u&&(u.links=u.links||{}),g=0,v={},h={},m=(e+(n?" ":"")).replace(be,r);return!g&&m||I(e)}function B(e,t,n){var r,i,o,s,a,d,u,l,p,c,f,g,v,h,m,w,x,b,_,y,k,j,C,A,T,R,M,$,N,E,F=0,S=ue.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,U="",J={},O=e.length;for(""+t===t?(b=n?'data-link="'+t.replace(_e," ").slice(1,-1)+'"':t,t=0):(b=t.tmplName||"unnamed",t.allowCode&&(J.allowCode=!0),t.debug&&(J.debug=!0),f=t.bnds,x=t.tmpls),r=0;O>r;r++)if(i=e[r],""+i===i)U+='\n+"'+i+'"';else if(o=i[0],"*"===o)U+=";\n"+i[1]+"\nret=ret";else{if(s=i[1],k=!n&&i[2],a=K(i[3],"params")+"},"+K(v=i[4]),$=i[5],E=i[6],j=i[8]&&i[8].replace(ye,"$1"),(T="else"===o)?g&&g.push(i[7]):(F=0,f&&(g=i[7])&&(g=[g],F=f.push(1))),S=S||v[1]||v[2]||g||/view.(?!index)/.test(v[0]),(R=":"===o)?s&&(o=s===Ee?">":s+o):(k&&(_=V(j,J),_.tmplName=b+"/"+o,_.useViews=_.useViews||S,B(k,_),S=_.useViews,x.push(_)),T||(y=o,S=S||o&&(!se[o]||!se[o].flow),A=U,U=""),C=e[r+1],C=C&&"else"===C[0]),N=$?";\ntry{\nret+=":"\n+",h="",m="",R&&(g||E||s&&s!==Ee)){if(M=new Function("data,view,j,u"," // "+b+" "+F+" "+o+"\nreturn {"+a+"};"),M._er=$,M._tag=o,n)return M;q(M,g),w='c("'+s+'",view,',c=!0,h=w+F+",",m=")"}if(U+=R?(n?($?"try{\n":"")+"return ":N)+(c?(c=void 0,S=p=!0,w+(g?(f[F-1]=M,F):"{"+a+"}")+")"):">"===o?(u=!0,"h("+v[0]+")"):(l=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(d=!0,"\n{view:view,tmpl:"+(k?x.length:"0")+","+a+"},"),y&&!C){if(U="["+U.slice(0,-1)+"]",w='t("'+y+'",view,this,',n||g){if(U=new Function("data,view,j,u"," // "+b+" "+F+" "+y+"\nreturn "+U+";"),U._er=$,U._tag=y,g&&q(f[F-1]=U,g),n)return U;h=w+F+",undefined,",m=")"}U=A+N+w+(F||U)+")",g=0,y=0}$&&(S=!0,U+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+$+")"+m+";}"+(n?"":"ret=ret"))}U="// "+b+"\nvar v"+(d?",t=j._tag":"")+(p?",c=j._cnvt":"")+(u?",h=j._html":"")+(n?";\n":',ret=""\n')+(J.debug?"debugger;":"")+U+(n?"\n":";\nreturn ret;"),de.debugMode!==!1&&(U="try {\n"+U+"\n}catch(e){\nreturn j._err(e, view);\n}");try{U=new Function("data,view,j,u",U)}catch(L){I("Compiled template code:\n\n"+U+'\n: "'+L.message+'"')}return t&&(t.fn=U,t.useViews=!!S),U}function L(e,t){return e&&e!==t?t?u(u({},t),e):e:t&&u({},t)}function Q(e){return Ne[e]||(Ne[e]="&#"+e.charCodeAt(0)+";")}function H(e){var t,n,r=[];if(typeof e===Fe)for(t in e)n=e[t],t===ee||te(n)||r.push({key:t,prop:n});return r}function P(e,n,r){var i=this.jquery&&(this[0]||S('Unknown template: "'+this.selector+'"')),o=i.getAttribute(Se);return N.call(o?t.data(i)[Ie]:re(i),e,n,r)}function D(e){return void 0!=e?Ve.test(e)&&(""+e).replace(Me,Q)||e:""}var Z=t===!1;t=t&&t.fn?t:e.jQuery;var z,G,W,X,Y,ee,te,ne,re,ie,oe,se,ae,de,ue,le,pe,ce,fe,ge,ve,he,me,we="v0.9.78",xe=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,be=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,_e=/[ \t]*(\r\n|\n|\r)/g,ye=/\\(['"])/g,ke=/['"\\]/g,je=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,Ce=/^if\s/,Ae=/<(\w+)[>\s]/,Te=/[\x00`><"'&=]/g,Ve=/[\x00`><\"'&=]/,Re=/^on[A-Z]|^convert(Back)?$/,Me=Te,$e=0,Ne={"&":"&amp;","<":"&lt;",">":"&gt;","\x00":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;","=":"&#61;"},Ee="html",Fe="object",Se="data-jsv-tmpl",Ie="jsvTmpl",Ue="For #index in nested block use #getIndex().",qe={},Je=e.jsrender,Ke=Je&&t&&!t.render,Oe={template:{compile:j},tag:{compile:y},viewModel:{compile:T},helper:{},converter:{}};if(Y={jsviews:we,sub:{View:b,Err:d,tmplFn:U,parse:O,extend:u,extendCtx:L,syntaxErr:I,onStore:{},addSetting:M,settings:{allowCode:!1},advSet:s,_ths:i,_tg:function(){},_cnvt:h,_tag:x,_er:S,_err:F,_html:D,_sq:function(e){return"constructor"===e&&I(""),e}},settings:{delimiters:l,advanced:function(e){return e?(u(ue,e),ae.advSet(),le):ue}},map:$},(d.prototype=new Error).constructor=d,c.depends=function(){return[this.get("item"),"index"]},f.depends="index",b.prototype={get:p,getIndex:f,getRsc:w,getTmpl:v,hlp:g,_is:"view"},ae=Y.sub,le=Y.settings,!(Je||t&&t.render)){for(z in Oe)R(z,Oe[z]);ie=Y.converters,oe=Y.helpers,se=Y.tags,ae._tg.prototype={baseApply:k,cvtArgs:m},X=ae.topView=new b,t?(t.fn.render=P,ee=t.expando,t.observable&&(u(ae,t.views.sub),Y.map=t.views.map)):(t={},Z&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},ae._jq=function(e){e!==t&&(u(e,t),t=e,t.fn.render=P,delete t.jsrender,ee=t.expando)},t.jsrender=we),de=ae.settings,de.allowCode=!1,te=t.isFunction,ne=t.isArray,t.render=qe,t.views=Y,t.templates=re=Y.templates;for(he in de)M(he);(le.debugMode=function(e){return void 0===e?de.debugMode:(de.debugMode=e,de.onError=e+""===e?new Function("","return '"+e+"';"):te(e)?e:void 0,le)})(!1),ue=de.advanced={useViews:!1,_jsv:!1},se({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(arguments.length||!n.index)?"":(t.rendering.done=!0,t.selected=n.index,n.render(n.view,!0));return r},flow:!0},"for":{render:function(e){var t,n=!arguments.length,r=this,i=r.tagCtx,o="",s=0;return r.rendering.done||(t=n?i.view.data:e,void 0!==t&&(o+=i.render(t,n),s+=ne(t)?t.length:1),(r.rendering.done=s)&&(r.selected=i.index)),o},flow:!0},props:{baseTag:"for",dataMap:$(H),flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:oe.dbg=ie.dbg=a}),ie({html:D,attr:D,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}return de=ae.settings,le.delimiters("{{","}}","^"),Ke&&Je.views.sub._jq(t),t||Je},window);
+//# sourceMappingURL=jsrender.min.js.map
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js b/poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js
new file mode 100644
index 000000000..9f9eda1e1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/layerBtn.js
@@ -0,0 +1,83 @@
+"use strict";
+
+function layerBtnsInit() {
+
+ /* Remove any current bindings to avoid duplicated binds */
+ $(".layerbtn").unbind('click');
+
+ $(".layerbtn").click(function (){
+ var layerObj = $(this).data("layer");
+ var add = ($(this).data('directive') === "add");
+ var thisBtn = $(this);
+
+ libtoaster.addRmLayer(layerObj, add, function (layerDepsList){
+ libtoaster.showChangeNotification(libtoaster.makeLayerAddRmAlertMsg(layerObj, layerDepsList, add));
+
+ /* In-cell notification */
+ var notification = $('<div id="temp-inline-notify" style="display: none; font-size: 11px; line-height: 1.3;" class="tooltip-inner"></div>');
+ thisBtn.parent().append(notification);
+
+ if (add){
+ if (layerDepsList.length > 0)
+ notification.text(String(layerDepsList.length + 1) + " layers added");
+ else
+ notification.text("1 layer added");
+
+ var layerBtnsFadeOut = $();
+ var layerExistsBtnFadeIn = $();
+
+ layerBtnsFadeOut = layerBtnsFadeOut.add(".layer-add-" + layerObj.id);
+ layerExistsBtnFadeIn = layerExistsBtnFadeIn.add(".layer-exists-" + layerObj.id);
+
+ for (var i in layerDepsList){
+ layerBtnsFadeOut = layerBtnsFadeOut.add(".layer-add-" + layerDepsList[i].id);
+ layerExistsBtnFadeIn = layerExistsBtnFadeIn.add(".layer-exists-" + layerDepsList[i].id);
+ }
+
+ layerBtnsFadeOut.fadeOut().promise().done(function(){
+ notification.fadeIn().delay(500).fadeOut(function(){
+ /* Fade in the buttons */
+ layerExistsBtnFadeIn.fadeIn();
+ notification.remove();
+ });
+ });
+ } else {
+ notification.text("1 layer removed");
+ /* Deleting a layer we only hanlde the one button */
+ thisBtn.fadeOut(function(){
+ notification.fadeIn().delay(500).fadeOut(function(){
+ $(".layer-add-" + layerObj.id).fadeIn();
+ notification.remove();
+ });
+ });
+ }
+
+ });
+ });
+
+ $("td .build-recipe-btn").unbind('click');
+ $("td .build-recipe-btn").click(function(e){
+ e.preventDefault();
+ var recipe = $(this).data('recipe-name');
+
+ libtoaster.startABuild(null, recipe,
+ function(){
+ /* Success */
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ });
+ });
+
+
+ $(".customise-btn").unbind('click');
+ $(".customise-btn").click(function(e){
+ e.preventDefault();
+ var imgCustomModal = $("#new-custom-image-modal");
+
+ if (imgCustomModal.length == 0)
+ throw("Modal new-custom-image not found");
+
+ var recipe = {id: $(this).data('recipe'), name: null}
+ newCustomImageModalSetRecipes([recipe]);
+ imgCustomModal.modal('show');
+ });
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js b/poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
new file mode 100644
index 000000000..e9622243a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/layerDepsModal.js
@@ -0,0 +1,98 @@
+/*
+ * layer: Object representing the parent layer { id: .. name: ... url }
+ * dependencies: array of dependency layer objects { id: .. name: ..}
+ * title: optional override for title
+ * body: optional override for body
+ * addToProject: Whether to add layers to project on accept
+ * successAdd: function to run on success
+ */
+function showLayerDepsModal(layer,
+ dependencies,
+ title,
+ body,
+ addToProject,
+ successAdd) {
+
+ if ($("#dependencies-modal").length === 0) {
+ $.get(libtoaster.ctx.htmlUrl + "/layer_deps_modal.html", function(html){
+ $("body").append(html);
+ setupModal();
+ });
+ } else {
+ setupModal();
+ }
+
+ function setupModal(){
+
+ if (title) {
+ $('#dependencies-modal #title').text(title);
+ } else {
+ $('#dependencies-modal #title').text(layer.name);
+ }
+
+ if (body) {
+ $("#dependencies-modal #body-text").html(body);
+ } else {
+ $("#dependencies-modal #layer-name").text(layer.name);
+ }
+
+ var deplistHtml = "";
+ for (var i = 0; i < dependencies.length; i++) {
+ deplistHtml += "<li><div class=\"checkbox\"><label><input name=\"dependencies\" value=\"";
+ deplistHtml += dependencies[i].id;
+ deplistHtml +="\" type=\"checkbox\" checked=\"checked\"/>";
+ deplistHtml += dependencies[i].name;
+ deplistHtml += "</label></div></li>";
+ }
+ $('#dependencies-list').html(deplistHtml);
+
+ $("#dependencies-modal").data("deps", dependencies);
+
+ /* Clear any alert notifications before showing the modal */
+ $(".alert").fadeOut(function(){
+ $('#dependencies-modal').modal('show');
+ });
+
+ /* Discard the old submission function */
+ $("#dependencies-modal-form").unbind('submit');
+
+ $("#dependencies-modal-form").submit(function (e) {
+ e.preventDefault();
+ var selectedLayerIds = [];
+ var selectedLayers = [];
+
+ $("input[name='dependencies']:checked").each(function () {
+ selectedLayerIds.push(parseInt($(this).val()));
+ });
+
+ /* -1 is a special dummy Id which we use when the layer isn't yet in the
+ * system, normally we would add the current layer to the selection.
+ */
+ if (layer.id != -1)
+ selectedLayerIds.push(layer.id);
+
+ /* Find the selected layer objects from our original list */
+ for (var i = 0; i < selectedLayerIds.length; i++) {
+ for (var j = 0; j < dependencies.length; j++) {
+ if (dependencies[j].id == selectedLayerIds[i]) {
+ selectedLayers.push(dependencies[j]);
+ }
+ }
+ }
+
+ if (addToProject) {
+ libtoaster.editCurrentProject({ 'layerAdd': selectedLayerIds.join(",") }, function () {
+ if (successAdd) {
+ successAdd(selectedLayers);
+ }
+ }, function () {
+ console.warn("Adding layers to project failed");
+ });
+ } else {
+ successAdd(selectedLayers);
+ }
+
+ $('#dependencies-modal').modal('hide');
+ });
+ }
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
new file mode 100644
index 000000000..9ead393cb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -0,0 +1,521 @@
+"use strict";
+
+function layerDetailsPageInit (ctx) {
+
+ var layerDepInput = $("#layer-dep-input");
+ var layerDepBtn = $("#add-layer-dependency-btn");
+ var layerDepsList = $("#layer-deps-list");
+ var currentLayerDepSelection;
+ var addRmLayerBtn = $("#add-remove-layer-btn");
+ var targetTab = $("#targets-tab");
+ var machineTab = $("#machines-tab");
+ var detailsTab = $("#details-tab");
+ var editLayerSource = $("#edit-layer-source");
+ var saveSourceChangesBtn = $("#save-changes-for-switch");
+ var layerGitRefInput = $("#layer-git-ref");
+ var layerSubDirInput = $('#layer-subdir');
+
+ targetTab.on('show.bs.tab', targetsTabShow);
+ detailsTab.on('show.bs.tab', detailsTabShow);
+ machineTab.on('show.bs.tab', machinesTabShow);
+
+ /* setup the dependencies typeahead */
+ libtoaster.makeTypeahead(layerDepInput,
+ libtoaster.ctx.layersTypeAheadUrl,
+ { include_added: "true" }, function(item){
+ currentLayerDepSelection = item;
+ layerDepBtn.removeAttr("disabled");
+ });
+
+ /* disable the add layer button if its input field is empty */
+ layerDepInput.on("keyup",function(){
+ if ($(this).val().length === 0) {
+ layerDepBtn.attr("disabled", "disabled");
+ }
+ });
+
+ function addRemoveDep(depLayerId, add, doneCb) {
+ var data = { layer_version_id : ctx.layerVersion.id };
+ if (add)
+ data.add_dep = depLayerId;
+ else
+ data.rm_dep = depLayerId;
+
+ $.ajax({
+ type: "POST",
+ url: ctx.xhrUpdateLayerUrl,
+ data: data,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.warn(data.error);
+ } else {
+ doneCb();
+ }
+ },
+ error: function (data) {
+ console.warn("Call failed");
+ console.warn(data);
+ }
+ });
+ }
+
+ function layerDepRemoveClick() {
+ var toRemove = $(this).parent().data('layer-id');
+ var layerDepItem = $(this);
+
+ addRemoveDep(toRemove, false, function(){
+ layerDepItem.parent().fadeOut(function (){
+ layerDepItem.remove();
+ });
+ });
+ }
+
+ /* Add dependency layer button click handler */
+ layerDepBtn.click(function(){
+ if (currentLayerDepSelection === undefined)
+ return;
+
+ addRemoveDep(currentLayerDepSelection.id, true, function(){
+ /* Make a list item for the new layer dependency */
+ var newLayerDep = $("<li><a></a><span class=\"glyphicon glyphicon-trash\" data-toggle=\"tooltip\" title=\"Delete\"></span></li>");
+
+ newLayerDep.data('layer-id', currentLayerDepSelection.id);
+ newLayerDep.children("span").tooltip();
+
+ var link = newLayerDep.children("a");
+ link.attr("href", currentLayerDepSelection.layerdetailurl);
+ link.text(currentLayerDepSelection.name);
+ link.tooltip({title: currentLayerDepSelection.tooltip, placement: "right"});
+
+ /* Connect up the tash icon */
+ var trashItem = newLayerDep.children("span");
+ trashItem.click(layerDepRemoveClick);
+
+ layerDepsList.append(newLayerDep);
+ /* Clear the current selection */
+ layerDepInput.val("");
+ currentLayerDepSelection = undefined;
+ layerDepBtn.attr("disabled", "disabled");
+ });
+ });
+
+ $(".glyphicon-edit").click(function (){
+ var mParent = $(this).parent("dd");
+ mParent.prev().css("margin-top", "10px");
+ mParent.children("form").slideDown();
+ var currentVal = mParent.children(".current-value");
+ currentVal.hide();
+ /* Set the current value to the input field */
+ mParent.find("textarea,input").val(currentVal.text());
+ /* If the input field is empty, disable the submit button */
+ if ( mParent.find("textarea,input").val().length == 0 ) {
+ mParent.find(".change-btn").attr("disabled", "disabled");
+ }
+ /* Hides the "Not set" text */
+ mParent.children(".text-muted").hide();
+ /* We're editing so hide the delete icon */
+ mParent.children(".delete-current-value").hide();
+ mParent.find(".cancel").show();
+ $(this).hide();
+ });
+
+ $(".delete-current-value").click(function(){
+ var mParent = $(this).parent("dd");
+ mParent.find("input").val("");
+ mParent.find("textarea").val("");
+ mParent.find(".change-btn").click();
+ });
+
+ $(".cancel").click(function(){
+ var mParent = $(this).parents("dd");
+ $(this).hide();
+ mParent.children("form").slideUp(function(){
+ mParent.children(".current-value").show();
+ /* Show the "Not set" text if we ended up with no value */
+ if (!mParent.children(".current-value").html()){
+ mParent.children(".text-muted").fadeIn();
+ mParent.children(".delete-current-value").hide();
+ } else {
+ mParent.children(".delete-current-value").show();
+ }
+
+ mParent.children(".glyphicon-edit").show();
+ mParent.prev().css("margin-top", "0");
+ });
+ });
+
+
+ function defaultAddBtnText(){
+ var text = " Add the "+ctx.layerVersion.name+" layer to your project";
+ addRmLayerBtn.text(text);
+ addRmLayerBtn.prepend("<span class=\"glyphicon glyphicon-plus\"></span>");
+ addRmLayerBtn.removeClass("btn-danger");
+ }
+
+ function detailsTabShow(){
+ if (!ctx.layerVersion.inCurrentPrj)
+ defaultAddBtnText();
+
+ window.location.hash = "information";
+ }
+
+ function targetsTabShow(){
+ if (!ctx.layerVersion.inCurrentPrj){
+ if (ctx.numTargets > 0) {
+ var text = " Add the "+ctx.layerVersion.name+" layer to your project "+
+ "to enable these recipes";
+ addRmLayerBtn.text(text);
+ addRmLayerBtn.prepend("<span class=\"glyphicon glyphicon-plus\"></span>");
+ } else {
+ defaultAddBtnText();
+ }
+ }
+
+ window.location.hash = "recipes";
+ }
+
+ $("#recipestable").on('table-done', function(e, total, tableParams){
+ ctx.numTargets = total;
+
+ if (total === 0 && !tableParams.search) {
+ $("#no-recipes-yet").show();
+ } else {
+ $("#no-recipes-yet").hide();
+ }
+
+ targetTab.removeClass("text-muted");
+ if (window.location.hash === "#recipes"){
+ /* re run the machinesTabShow to update the text */
+ targetsTabShow();
+ }
+ });
+
+ $("#machinestable").on('table-done', function(e, total, tableParams){
+ ctx.numMachines = total;
+
+ if (total === 0 && !tableParams.search)
+ $("#no-machines-yet").show();
+ else
+ $("#no-machines-yet").hide();
+
+ machineTab.removeClass("text-muted");
+ if (window.location.hash === "#machines"){
+ /* re run the machinesTabShow to update the text */
+ machinesTabShow();
+ }
+
+ $(".select-machine-btn").click(function(e){
+ if ($(this).hasClass("disabled"))
+ e.preventDefault();
+ });
+
+ });
+
+
+ function machinesTabShow(){
+ if (!ctx.layerVersion.inCurrentPrj) {
+ if (ctx.numMachines > 0){
+ var text = " Add the "+ctx.layerVersion.name+" layer to your project " +
+ "to enable these machines";
+ addRmLayerBtn.text(text);
+ addRmLayerBtn.prepend("<span class=\"glyphicon glyphicon-plus\"></span>");
+ } else {
+ defaultAddBtnText();
+ }
+ }
+
+ window.location.hash = "machines";
+ }
+
+ $(".pagesize").change(function(){
+ var search = libtoaster.parseUrlParams();
+ search.limit = this.value;
+
+ window.location.search = libtoaster.dumpsUrlParams(search);
+ });
+
+ /* Enables the Build target and Select Machine buttons and switches the
+ * add/remove button
+ */
+ function setLayerInCurrentPrj(added) {
+ ctx.layerVersion.inCurrentPrj = added;
+
+ if (added){
+ /* enable and switch all the button states */
+ $(".build-recipe-btn").removeClass("disabled");
+ $(".select-machine-btn").removeClass("disabled");
+ addRmLayerBtn.addClass("btn-danger");
+ addRmLayerBtn.data('directive', "remove");
+ addRmLayerBtn.text(" Remove the "+ctx.layerVersion.name+" layer from your project");
+ addRmLayerBtn.prepend("<span class=\"glyphicon glyphicon-trash\"></span>");
+
+ } else {
+ /* disable and switch all the button states */
+ $(".build-recipe-btn").addClass("disabled");
+ $(".select-machine-btn").addClass("disabled");
+ addRmLayerBtn.removeClass("btn-danger");
+ addRmLayerBtn.data('directive', "add");
+
+ /* "special" handler so that we get the correct button text which depends
+ * on which tab is currently visible. Unfortunately we can't just call
+ * tab('show') as if it's already visible it doesn't run the event.
+ */
+ switch ($(".nav-tabs .active a").prop('id')){
+ case 'machines-tab':
+ machinesTabShow();
+ break;
+ case 'targets-tab':
+ targetsTabShow();
+ break;
+ default:
+ defaultAddBtnText();
+ break;
+ }
+ }
+ }
+
+ $("#dismiss-alert").click(function(){
+ $(this).parent().fadeOut();
+ });
+
+ /* Add or remove this layer from the project */
+ addRmLayerBtn.click(function() {
+
+ var add = ($(this).data('directive') === "add");
+
+ libtoaster.addRmLayer(ctx.layerVersion, add, function (layersList){
+ var alertMsg = $("#alert-msg");
+ alertMsg.html(libtoaster.makeLayerAddRmAlertMsg(ctx.layerVersion, layersList, add));
+
+ setLayerInCurrentPrj(add);
+
+ libtoaster.showChangeNotification(alertMsg);
+ });
+ });
+
+ /* Handler for all of the Change buttons */
+ $(".change-btn").click(function(){
+ var mParent = $(this).parent();
+ var prop = $(this).data('layer-prop');
+
+ /* We have inputs, select and textareas to potentially grab the value
+ * from.
+ */
+ var entryElement = mParent.find("input");
+ if (entryElement.length === 0)
+ entryElement = mParent.find("textarea");
+ if (entryElement.length === 0) {
+ console.warn("Could not find element to get data from for this change");
+ return;
+ }
+
+ var data = { layer_version_id: ctx.layerVersion.id };
+ data[prop] = entryElement.val();
+
+ $.ajax({
+ type: "POST",
+ url: ctx.xhrUpdateLayerUrl,
+ data: data,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.warn(data.error);
+ } else {
+ /* success layer property changed */
+ var inputArea = mParent.parents("dd");
+ var text;
+
+ text = entryElement.val();
+
+ /* Hide the "Not set" text if it's visible */
+ inputArea.find(".text-muted").hide();
+ inputArea.find(".current-value").text(text);
+ /* Same behaviour as cancel in that we hide the form/show current
+ * value.
+ */
+ inputArea.find(".cancel").click();
+ }
+ },
+ error: function (data) {
+ console.warn("Call failed");
+ console.warn(data);
+ }
+ });
+ });
+
+ /* Disable the change button when we have no data in the input */
+ $("dl input, dl textarea").on("input",function() {
+ if ($(this).val().length === 0)
+ $(this).parent().next(".change-btn").attr("disabled", "disabled");
+ else
+ $(this).parent().next(".change-btn").removeAttr("disabled");
+ });
+
+ /* This checks to see if the dt's dd has data in it or if the change data
+ * form is visible, otherwise hide it
+ */
+ $("dl").children().each(function (){
+ if ($(this).is("dt")) {
+ var dd = $(this).next("dd");
+ if (!dd.children("form:visible")|| !dd.find(".current-value").html()){
+ if (ctx.layerVersion.layer_source == ctx.layerSourceTypes.TYPE_IMPORTED){
+ /* There's no current value and the layer is editable
+ * so show the "Not set" and hide the delete icon
+ */
+ dd.find(".text-muted").show();
+ dd.find(".delete-current-value").hide();
+ } else {
+ /* We're not viewing an editable layer so hide the empty dd/dl pair */
+ $(this).hide();
+ dd.hide();
+ }
+ }
+ }
+ });
+
+ /* Hide the right column if it contains no information */
+ if ($("dl.item-info").children(':visible').length === 0) {
+ $("dl.item-info").parent().hide();
+ }
+
+ /* Clear the current search selection and reload the results */
+ $(".target-search-clear").click(function(){
+ $("#target-search").val("");
+ $(this).parents("form").submit();
+ });
+
+ $(".machine-search-clear").click(function(){
+ $("#machine-search").val("");
+ $(this).parents("form").submit();
+ });
+
+ $("#layer-delete-confirmed").click(function(){
+
+ $("#delete-layer-modal button[data-dismiss='modal']").hide();
+
+ var message = $('<span>You have deleted <strong>1</strong> layer from your project: <strong id="deleted-layer-name"></strong>');
+ message.find("#deleted-layer-name").text(ctx.layerVersion.name);
+
+ $.ajax({
+ type: "DELETE",
+ url: ctx.xhrUpdateLayerUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(data) {
+ if (data.error != "ok") {
+ console.warn(data.error);
+ } else {
+ libtoaster.setNotification("layer-deleted", message.html());
+ window.location.replace(data.gotoUrl);
+ }
+ },
+ error: function(data) {
+ console.warn("Call failed");
+ console.warn(data);
+ }
+ });
+ });
+
+ layerDepsList.find(".glyphicon-trash").click(layerDepRemoveClick);
+ layerDepsList.find("a").tooltip();
+ $(".glyphicon-trash").tooltip();
+ $(".commit").tooltip();
+
+ editLayerSource.click(function() {
+ /* Kindly bring the git layers imported from layerindex to normal page
+ * and not this new page :(
+ */
+ $(this).hide();
+ saveSourceChangesBtn.attr("disabled", "disabled");
+
+ $("#git-repo-info, #directory-info").hide();
+ $("#edit-layer-source-form").fadeIn();
+ if ($("#layer-dir-path-in-details").val() == "") {
+ //Local dir path is empty...
+ $("#repo").prop("checked", true);
+ $("#layer-git").fadeIn();
+ $("#layer-dir").hide();
+ } else {
+ $("#layer-git").hide();
+ $("#layer-dir").fadeIn();
+ }
+ });
+
+ $('input:radio[name="source-location"]').change(function() {
+ if ($('input[name=source-location]:checked').val() == "repo") {
+ $("#layer-git").fadeIn();
+ $("#layer-dir").hide();
+ if ($("#layer-git-repo-url").val().length === 0 && layerGitRefInput.val().length === 0) {
+ saveSourceChangesBtn.attr("disabled", "disabled");
+ }
+ } else {
+ $("#layer-dir").fadeIn();
+ $("#layer-git").hide();
+ }
+ });
+
+ $("#layer-dir-path-in-details").keyup(function() {
+ saveSourceChangesBtn.removeAttr("disabled");
+ });
+
+ $("#layer-git-repo-url").keyup(function() {
+ if ($("#layer-git-repo-url").val().length > 0 && layerGitRefInput.val().length > 0) {
+ saveSourceChangesBtn.removeAttr("disabled");
+ }
+ });
+
+ layerGitRefInput.keyup(function() {
+ if ($("#layer-git-repo-url").val().length > 0 && layerGitRefInput.val().length > 0) {
+ saveSourceChangesBtn.removeAttr("disabled");
+ }
+ });
+
+
+ layerSubDirInput.keyup(function(){
+ if ($(this).val().length > 0){
+ saveSourceChangesBtn.removeAttr("disabled");
+ }
+ });
+
+ $('#cancel-changes-for-switch').click(function() {
+ $("#edit-layer-source-form").hide();
+ $("#directory-info, #git-repo-info").fadeIn();
+ editLayerSource.show();
+ });
+
+ saveSourceChangesBtn.click(function() {
+
+ var layerData = {
+ vcs_url: $('#layer-git-repo-url').val(),
+ commit: layerGitRefInput.val(),
+ dirpath: layerSubDirInput.val(),
+ local_source_dir: $('#layer-dir-path-in-details').val(),
+ };
+
+ if ($('input[name=source-location]:checked').val() == "repo") {
+ layerData.local_source_dir = "";
+ } else {
+ layerData.vcs_url = "";
+ layerData.git_ref = "";
+ }
+
+ $.ajax({
+ type: "POST",
+ url: ctx.xhrUpdateLayerUrl,
+ data: layerData,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.warn(data.error);
+ } else {
+ /* success layer property changed */
+ window.location.reload();
+ }
+ },
+ error: function (data) {
+ console.warn("Call failed");
+ console.warn(data);
+ }
+ });
+ });
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
new file mode 100644
index 000000000..6f9b5d0f0
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/libtoaster.js
@@ -0,0 +1,735 @@
+"use strict";
+/* All shared functionality to go in libtoaster object.
+ * This object really just helps readability since we can then have
+ * a traceable namespace.
+ */
+var libtoaster = (function () {
+ // prevent conflicts with Bootstrap 2's typeahead (required during
+ // transition from v2 to v3)
+ var typeahead = jQuery.fn.typeahead.noConflict();
+ jQuery.fn._typeahead = typeahead;
+
+ /* Make a typeahead from an input element
+ *
+ * _makeTypeahead parameters
+ * jQElement: input element as selected by $('selector')
+ * xhrUrl: the url to get the JSON from; this URL should return JSON in the
+ * format:
+ * { "results": [ { "name": "test", "detail" : "a test thing" }, ... ] }
+ * xhrParams: the data/parameters to pass to the getJSON url e.g.
+ * { 'type' : 'projects' }; the text typed will be passed as 'search'.
+ * selectedCB: function to call once an item has been selected; has
+ * signature selectedCB(item), where item is an item in the format shown
+ * in the JSON list above, i.e.
+ * { "name": "name", "detail": "detail" }.
+ */
+ function _makeTypeahead(jQElement, xhrUrl, xhrParams, selectedCB) {
+ if (!xhrUrl || xhrUrl.length === 0) {
+ throw("No url supplied for typeahead");
+ }
+
+ var xhrReq;
+
+ jQElement._typeahead(
+ {
+ highlight: true,
+ classNames: {
+ open: "dropdown-menu",
+ cursor: "active"
+ }
+ },
+ {
+ source: function (query, syncResults, asyncResults) {
+ xhrParams.search = query;
+
+ // if we have a request in progress, cancel it and start another
+ if (xhrReq) {
+ xhrReq.abort();
+ }
+
+ xhrReq = $.getJSON(xhrUrl, xhrParams, function (data) {
+ if (data.error !== "ok") {
+ console.error("Error getting data from server: " + data.error);
+ return;
+ }
+
+ xhrReq = null;
+
+ asyncResults(data.results);
+ });
+ },
+
+ // how the selected item is shown in the input
+ display: function (item) {
+ return item.name;
+ },
+
+ templates: {
+ // how the item is displayed in the dropdown
+ suggestion: function (item) {
+ var elt = document.createElement("div");
+ elt.innerHTML = item.name + " " + item.detail;
+ return elt;
+ }
+ }
+ }
+ );
+
+ // when an item is selected using the typeahead, invoke the callback
+ jQElement.on("typeahead:select", function (event, item) {
+ selectedCB(item);
+ });
+ }
+
+ /* startABuild:
+ * url: xhr_buildrequest or null for current project
+ * targets: an array or space separated list of targets to build
+ * onsuccess: callback for successful execution
+ * onfail: callback for failed execution
+ */
+ function _startABuild (url, targets, onsuccess, onfail) {
+
+ if (!url)
+ url = libtoaster.ctx.xhrBuildRequestUrl;
+
+ /* Flatten the array of targets into a space spearated list */
+ if (targets instanceof Array){
+ targets = targets.reduce(function(prevV, nextV){
+ return prev + ' ' + next;
+ });
+ }
+
+ $.ajax( {
+ type: "POST",
+ url: url,
+ data: { 'targets' : targets },
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (_data) {
+ if (_data.error !== "ok") {
+ console.warn(_data.error);
+ } else {
+ if (onsuccess !== undefined) onsuccess(_data);
+ }
+ },
+ error: function (_data) {
+ console.warn("Call failed");
+ console.warn(_data);
+ if (onfail) onfail(data);
+ } });
+ }
+
+ /* cancelABuild:
+ * url: xhr_buildrequest url or null for current project
+ * buildRequestIds: space separated list of build request ids
+ * onsuccess: callback for successful execution
+ * onfail: callback for failed execution
+ */
+ function _cancelABuild(url, buildRequestIds, onsuccess, onfail){
+ if (!url)
+ url = libtoaster.ctx.xhrBuildRequestUrl;
+
+ $.ajax( {
+ type: "POST",
+ url: url,
+ data: { 'buildCancel': buildRequestIds },
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (_data) {
+ if (_data.error !== "ok") {
+ console.warn(_data.error);
+ } else {
+ if (onsuccess) onsuccess(_data);
+ }
+ },
+ error: function (_data) {
+ console.warn("Call failed");
+ console.warn(_data);
+ if (onfail) onfail(_data);
+ }
+ });
+ }
+
+ function _getMostRecentBuilds(url, onsuccess, onfail) {
+ $.ajax({
+ url: url,
+ type: 'GET',
+ data : {format: 'json'},
+ headers: {'X-CSRFToken': $.cookie('csrftoken')},
+ success: function (data) {
+ onsuccess ? onsuccess(data) : console.log(data);
+ },
+ error: function (data) {
+ onfail ? onfail(data) : console.error(data);
+ }
+ });
+ }
+
+ /* Get a project's configuration info */
+ function _getProjectInfo(url, onsuccess, onfail){
+ $.ajax({
+ type: "GET",
+ url: url,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (_data) {
+ if (_data.error !== "ok") {
+ console.warn(_data.error);
+ } else {
+ if (onsuccess !== undefined) onsuccess(_data);
+ }
+ },
+ error: function (_data) {
+ console.warn(_data);
+ if (onfail) onfail(_data);
+ }
+ });
+ }
+
+ /* Properties for data can be:
+ * layerDel (csv)
+ * layerAdd (csv)
+ * projectName
+ * projectVersion
+ * machineName
+ */
+ function _editCurrentProject(data, onSuccess, onFail){
+ $.ajax({
+ type: "POST",
+ url: libtoaster.ctx.xhrProjectUrl,
+ data: data,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error != "ok") {
+ console.log(data.error);
+ if (onFail !== undefined)
+ onFail(data);
+ } else {
+ if (onSuccess !== undefined)
+ onSuccess(data);
+ }
+ },
+ error: function (data) {
+ console.log("Call failed");
+ console.log(data);
+ }
+ });
+ }
+
+ function _getLayerDepsForProject(url, onSuccess, onFail){
+ /* Check for dependencies not in the current project */
+ $.getJSON(url,
+ { format: 'json' },
+ function(data) {
+ if (data.error != "ok") {
+ console.log(data.error);
+ if (onFail !== undefined)
+ onFail(data);
+ } else {
+ var deps = {};
+ /* Filter out layer dep ids which are in the
+ * project already.
+ */
+ deps.list = data.layerdeps.list.filter(function(layerObj){
+ return (data.projectlayers.lastIndexOf(layerObj.id) < 0);
+ });
+
+ onSuccess(deps);
+ }
+ }, function() {
+ console.log("E: Failed to make request");
+ });
+ }
+
+ /* parses the query string of the current window.location to an object */
+ function _parseUrlParams() {
+ var string = window.location.search;
+ string = string.substr(1);
+ var stringArray = string.split ("&");
+ var obj = {};
+
+ for (var i in stringArray) {
+ var keyVal = stringArray[i].split ("=");
+ obj[keyVal[0]] = keyVal[1];
+ }
+
+ return obj;
+ }
+
+ /* takes a flat object and outputs it as a query string
+ * e.g. the output of dumpsUrlParams
+ */
+ function _dumpsUrlParams(obj) {
+ var str = "?";
+
+ for (var key in obj){
+ if (!obj[key])
+ continue;
+
+ str += key+ "="+obj[key].toString();
+ str += "&";
+ }
+
+ /* Maintain the current hash */
+ str += window.location.hash;
+
+ return str;
+ }
+
+ function _addRmLayer(layerObj, add, doneCb){
+ if (layerObj.xhrLayerUrl === undefined){
+ throw("xhrLayerUrl is undefined")
+ }
+
+ if (add === true) {
+ /* If adding get the deps for this layer */
+ libtoaster.getLayerDepsForProject(layerObj.xhrLayerUrl,
+ function (layers) {
+
+ /* got result for dependencies */
+ if (layers.list.length === 0){
+ var editData = { layerAdd : layerObj.id };
+ libtoaster.editCurrentProject(editData, function() {
+ doneCb([]);
+ });
+ return;
+ } else {
+ try {
+ showLayerDepsModal(layerObj, layers.list, null, null, true, doneCb);
+ } catch (e) {
+ $.getScript(libtoaster.ctx.jsUrl + "layerDepsModal.js", function(){
+ showLayerDepsModal(layerObj, layers.list, null, null, true, doneCb);
+ }, function(){
+ console.warn("Failed to load layerDepsModal");
+ });
+ }
+ }
+ }, null);
+ } else if (add === false) {
+ var editData = { layerDel : layerObj.id };
+
+ libtoaster.editCurrentProject(editData, function () {
+ doneCb([]);
+ }, function () {
+ console.warn ("Removing layer from project failed");
+ doneCb(null);
+ });
+ }
+ }
+
+ function _makeLayerAddRmAlertMsg(layer, layerDepsList, add) {
+ var alertMsg;
+
+ if (layerDepsList.length > 0 && add === true) {
+ alertMsg = $("<span>You have added <strong>"+(layerDepsList.length+1)+"</strong> layers to your project: <a class=\"alert-link\" id=\"layer-affected-name\"></a> and its dependencies </span>");
+
+ /* Build the layer deps list */
+ layerDepsList.map(function(layer, i){
+ var link = $("<a class=\"alert-link\"></a>");
+
+ link.attr("href", layer.layerdetailurl);
+ link.text(layer.name);
+ link.tooltip({title: layer.tooltip});
+
+ if (i !== 0)
+ alertMsg.append(", ");
+
+ alertMsg.append(link);
+ });
+ } else if (layerDepsList.length === 0 && add === true) {
+ alertMsg = $("<span>You have added <strong>1</strong> layer to your project: <a class=\"alert-link\" id=\"layer-affected-name\"></a></span></span>");
+ } else if (add === false) {
+ alertMsg = $("<span>You have removed <strong>1</strong> layer from your project: <a class=\"alert-link\" id=\"layer-affected-name\"></a></span>");
+ }
+
+ alertMsg.children("#layer-affected-name").text(layer.name);
+ alertMsg.children("#layer-affected-name").attr("href", layer.layerdetailurl);
+
+ return alertMsg.html();
+ }
+
+ function _showChangeNotification(message){
+ $(".alert-dismissible").fadeOut().promise().done(function(){
+ var alertMsg = $("#change-notification-msg");
+
+ alertMsg.html(message);
+ $("#change-notification, #change-notification *").fadeIn();
+ });
+ }
+
+ function _createCustomRecipe(name, baseRecipeId, doneCb){
+ var data = {
+ 'name' : name,
+ 'project' : libtoaster.ctx.projectId,
+ 'base' : baseRecipeId,
+ };
+
+ $.ajax({
+ type: "POST",
+ url: libtoaster.ctx.xhrCustomRecipeUrl,
+ data: data,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (ret) {
+ if (doneCb){
+ doneCb(ret);
+ } else if (ret.error !== "ok") {
+ console.warn(ret.error);
+ }
+ },
+ error: function (ret) {
+ console.warn("Call failed");
+ console.warn(ret);
+ }
+ });
+ }
+
+ /* Validate project names. Use unique project names
+
+ All arguments accepted by this function are JQeury objects.
+
+ For example if the HTML element has "hint-error-project-name", then
+ it is passed to this function as $("#hint-error-project-name").
+
+ Arg1 - projectName : This is a string object. In the HTML, project name will be entered here.
+ Arg2 - hintEerror : This is a jquery object which will accept span which throws error for
+ duplicate project
+ Arg3 - ctrlGrpValidateProjectName : This object holds the div with class "control-group"
+ Arg4 - enableOrDisableBtn : This object will help the API to enable or disable the form.
+ For example in the new project the create project button will be hidden if the
+ duplicate project exist. Similarly in the projecttopbar the save button will be
+ disabled if the project name already exist.
+
+ Return - This function doesn't return anything. It sets/unsets the behavior of the elements.
+ */
+
+ function _makeProjectNameValidation(projectName, hintError,
+ ctrlGrpValidateProjectName, enableOrDisableBtn ) {
+
+ function checkProjectName(projectName){
+ $.ajax({
+ type: "GET",
+ url: libtoaster.ctx.projectsTypeAheadUrl,
+ data: { 'search' : projectName },
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(data){
+ if (data.results.length > 0 &&
+ data.results[0].name === projectName) {
+ // This project name exists hence show the error and disable
+ // the save button
+ ctrlGrpValidateProjectName.addClass('has-error');
+ hintError.show();
+ enableOrDisableBtn.attr('disabled', 'disabled');
+ } else {
+ ctrlGrpValidateProjectName.removeClass('has-error');
+ hintError.hide();
+ enableOrDisableBtn.removeAttr('disabled');
+ }
+ },
+ error: function (data) {
+ console.log(data);
+ },
+ });
+ }
+
+ /* The moment user types project name remove the error */
+ projectName.on("input", function() {
+ var projectName = $(this).val();
+ checkProjectName(projectName)
+ });
+
+ /* Validate new project name */
+ projectName.on("blur", function(){
+ var projectName = $(this).val();
+ checkProjectName(projectName)
+ });
+ }
+
+ // if true, the loading spinner for Ajax requests will be displayed
+ // if requests take more than 1200ms
+ var ajaxLoadingTimerEnabled = true;
+
+ // turn on the page-level loading spinner for Ajax requests
+ function _enableAjaxLoadingTimer() {
+ ajaxLoadingTimerEnabled = true;
+ }
+
+ // turn off the page-level loading spinner for Ajax requests
+ function _disableAjaxLoadingTimer() {
+ ajaxLoadingTimerEnabled = false;
+ }
+
+ /* Utility function to set a notification for the next page load */
+ function _setNotification(name, message){
+ var data = {
+ name: name,
+ message: message
+ };
+
+ $.cookie('toaster-notification', JSON.stringify(data), { path: '/'});
+ }
+
+ return {
+ enableAjaxLoadingTimer: _enableAjaxLoadingTimer,
+ disableAjaxLoadingTimer: _disableAjaxLoadingTimer,
+ reload_params : reload_params,
+ startABuild : _startABuild,
+ cancelABuild : _cancelABuild,
+ getMostRecentBuilds: _getMostRecentBuilds,
+ makeTypeahead : _makeTypeahead,
+ getProjectInfo: _getProjectInfo,
+ getLayerDepsForProject : _getLayerDepsForProject,
+ editCurrentProject : _editCurrentProject,
+ debug: false,
+ parseUrlParams : _parseUrlParams,
+ dumpsUrlParams : _dumpsUrlParams,
+ addRmLayer : _addRmLayer,
+ makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg,
+ showChangeNotification : _showChangeNotification,
+ createCustomRecipe: _createCustomRecipe,
+ makeProjectNameValidation: _makeProjectNameValidation,
+ setNotification: _setNotification,
+ };
+})();
+
+/* keep this in the global scope for compatability */
+function reload_params(params) {
+ var uri = window.location.href;
+ var splitlist = uri.split("?");
+ var url = splitlist[0];
+ var parameters = splitlist[1];
+ // deserialize the call parameters
+ var cparams = [];
+ if(parameters)
+ cparams = parameters.split("&");
+
+ var nparams = {};
+ for (var i = 0; i < cparams.length; i++) {
+ var temp = cparams[i].split("=");
+ nparams[temp[0]] = temp[1];
+ }
+ // update parameter values
+ for (i in params) {
+ nparams[encodeURIComponent(i)] = encodeURIComponent(params[i]);
+ }
+ // serialize the structure
+ var callparams = [];
+ for (i in nparams) {
+ callparams.push(i+"="+nparams[i]);
+ }
+ window.location.href = url+"?"+callparams.join('&');
+}
+
+/* Things that happen for all pages */
+$(document).ready(function() {
+
+ (function showNotificationRequest(){
+ var cookie = $.cookie('toaster-notification');
+
+ if (!cookie)
+ return;
+
+ var notificationData = JSON.parse(cookie);
+
+ libtoaster.showChangeNotification(notificationData.message);
+
+ $.removeCookie('toaster-notification', { path: "/"});
+ })();
+
+
+
+ var ajaxLoadingTimer;
+
+ /* If we don't have a console object which might be the case in some
+ * browsers, no-op it to avoid undefined errors.
+ */
+ if (!window.console) {
+ window.console = {};
+ window.console.warn = function() {};
+ window.console.error = function() {};
+ }
+
+ /*
+ * highlight plugin.
+ */
+ hljs.initHighlightingOnLoad();
+
+ // Prevent invalid links from jumping page scroll
+ $('a[href=#]').click(function() {
+ return false;
+ });
+
+
+ /* START TODO Delete this section now redundant */
+ /* Belen's additions */
+
+ // turn Edit columns dropdown into a multiselect menu
+ $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
+ e.stopPropagation();
+ });
+
+ // enable popovers in any table cells that contain an anchor with the
+ // .btn class applied, and make sure popovers work on click, are mutually
+ // exclusive and they close when your click outside their area
+
+ $('html').click(function(){
+ $('td > a.btn').popover('hide');
+ });
+
+ $('td > a.btn').popover({
+ html:true,
+ placement:'left',
+ container:'body',
+ trigger:'manual'
+ }).click(function(e){
+ $('td > a.btn').not(this).popover('hide');
+ // ideally we would use 'toggle' here
+ // but it seems buggy in our Bootstrap version
+ $(this).popover('show');
+ e.stopPropagation();
+ });
+
+ // enable tooltips for applied filters
+ $('th a.btn-primary').tooltip({container:'body', html:true, placement:'bottom', delay:{hide:1500}});
+
+ // hide applied filter tooltip when you click on the filter button
+ $('th a.btn-primary').click(function () {
+ $('.tooltip').hide();
+ });
+
+ /* Initialise bootstrap tooltips */
+ $(".get-help, [data-toggle=tooltip]").tooltip({
+ container : 'body',
+ html : true,
+ delay: { show : 300 }
+ });
+
+ // show help bubble on hover inside tables
+ $("table").on("mouseover", "th, td", function () {
+ $(this).find(".hover-help").css("visibility","visible");
+ });
+
+ $("table").on("mouseleave", "th, td", function () {
+ $(this).find(".hover-help").css("visibility","hidden");
+ });
+
+ /* END TODO Delete this section now redundant */
+
+ // show task type and outcome in task details pages
+ $(".task-info").tooltip({ container: 'body', html: true, delay: {show: 200}, placement: 'right' });
+
+ // initialise the tooltips for the edit icons
+ $(".glyphicon-edit").tooltip({ container: 'body', html: true, delay: {show: 400}, title: "Change" });
+
+ // initialise the tooltips for the download icons
+ $(".icon-download-alt").tooltip({ container: 'body', html: true, delay: { show: 200 } });
+
+ // initialise popover for debug information
+ $(".glyphicon-info-sign").popover( { placement: 'bottom', html: true, container: 'body' });
+
+ // linking directly to tabs
+ $(function(){
+ var hash = window.location.hash;
+ $('ul.nav a[href="' + hash + '"]').tab('show');
+
+ $('.nav-tabs a').click(function () {
+ $(this).tab('show');
+ $('body').scrollTop();
+ });
+ });
+
+ // toggle for long content (variables, python stack trace, etc)
+ $('.full, .full-hide').hide();
+ $('.full-show').click(function(){
+ $('.full').slideDown(function(){
+ $('.full-hide').show();
+ });
+ $(this).hide();
+ });
+ $('.full-hide').click(function(){
+ $(this).hide();
+ $('.full').slideUp(function(){
+ $('.full-show').show();
+ });
+ });
+
+ //toggle the errors and warnings sections
+ $('.show-errors').click(function() {
+ $('#collapse-errors').addClass('in');
+ });
+ $('.toggle-errors').click(function() {
+ $('#collapse-errors').toggleClass('in');
+ });
+ $('.show-warnings').click(function() {
+ $('#collapse-warnings').addClass('in');
+ });
+ $('.toggle-warnings').click(function() {
+ $('#collapse-warnings').toggleClass('in');
+ });
+ $('.show-exceptions').click(function() {
+ $('#collapse-exceptions').addClass('in');
+ });
+ $('.toggle-exceptions').click(function() {
+ $('#collapse-exceptions').toggleClass('in');
+ });
+
+
+ $("#hide-alert").click(function(){
+ $(this).parent().fadeOut();
+ });
+
+ //show warnings section when requested from the previous page
+ if (location.href.search('#warnings') > -1) {
+ $('#collapse-warnings').addClass('in');
+ }
+
+ /* Show the loading notification if nothing has happend after 1.5
+ * seconds
+ */
+ $(document).bind("ajaxStart", function(){
+ if (ajaxLoadingTimer)
+ window.clearTimeout(ajaxLoadingTimer);
+
+ ajaxLoadingTimer = window.setTimeout(function() {
+ if (libtoaster.ajaxLoadingTimerEnabled) {
+ $("#loading-notification").fadeIn();
+ }
+ }, 1200);
+ });
+
+ $(document).bind("ajaxStop", function(){
+ if (ajaxLoadingTimer)
+ window.clearTimeout(ajaxLoadingTimer);
+
+ $("#loading-notification").fadeOut();
+ });
+
+ $(document).ajaxError(function(event, jqxhr, settings, errMsg){
+ if (errMsg === 'abort')
+ return;
+
+ console.warn("Problem with xhr call");
+ console.warn(errMsg);
+ console.warn(jqxhr.responseText);
+ });
+
+ function check_for_duplicate_ids () {
+ /* warn about duplicate element ids */
+ var ids = {};
+ $("[id]").each(function() {
+ if (this.id && ids[this.id]) {
+ console.warn('Duplicate element id #'+this.id);
+ }
+ ids[this.id] = true;
+ });
+ }
+
+ /* Make sure we don't have a notification overlay a modal */
+ $(".modal").on('show.bs.modal', function(){
+ $(".alert-dismissible").fadeOut();
+ });
+
+ if (libtoaster.debug) {
+ check_for_duplicate_ids();
+ } else {
+ /* Debug is false so supress warnings by overriding the functions */
+ window.console.warn = function () {};
+ window.console.error = function () {};
+ }
+});
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js b/poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
new file mode 100644
index 000000000..c0c5fa958
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/mrbsection.js
@@ -0,0 +1,150 @@
+
+function mrbSectionInit(ctx){
+ $('#latest-builds').on('click', '.cancel-build-btn', function(e){
+ e.stopImmediatePropagation();
+ e.preventDefault();
+
+ var url = $(this).data('request-url');
+ var buildReqIds = $(this).data('buildrequest-id');
+
+ libtoaster.cancelABuild(url, buildReqIds, function () {
+ window.location.reload();
+ }, null);
+ });
+
+ $('#latest-builds').on('click', '.rebuild-btn', function(e){
+ e.stopImmediatePropagation();
+ e.preventDefault();
+
+ var url = $(this).data('request-url');
+ var target = $(this).data('target');
+
+ libtoaster.startABuild(url, target, function(){
+ window.location.reload();
+ }, null);
+ });
+
+ // cached version of buildData, so we can determine whether a build has
+ // changed since it was last fetched, and update the DOM appropriately
+ var buildData = {};
+
+ // returns the cached version of this build, or {} is there isn't a cached one
+ function getCached(build) {
+ return buildData[build.id] || {};
+ }
+
+ // returns true if a build's state changed to "Succeeded", "Failed"
+ // or "Cancelled" from some other value
+ function buildFinished(build) {
+ var cached = getCached(build);
+ return cached.state &&
+ cached.state !== build.state &&
+ (build.state == 'Succeeded' || build.state == 'Failed' ||
+ build.state == 'Cancelled');
+ }
+
+ // returns true if the state changed
+ function stateChanged(build) {
+ var cached = getCached(build);
+ return (cached.state !== build.state);
+ }
+
+ // returns true if the tasks_complete_percentage changed
+ function tasksProgressChanged(build) {
+ var cached = getCached(build);
+ return (cached.tasks_complete_percentage !== build.tasks_complete_percentage);
+ }
+
+ // returns true if the number of recipes parsed/to parse changed
+ function recipeProgressChanged(build) {
+ var cached = getCached(build);
+ return (cached.recipes_parsed_percentage !== build.recipes_parsed_percentage);
+ }
+
+ // returns true if the number of repos cloned/to clone changed
+ function cloneProgressChanged(build) {
+ var cached = getCached(build);
+ return (cached.repos_cloned_percentage !== build.repos_cloned_percentage);
+ }
+
+ function refreshMostRecentBuilds(){
+ libtoaster.getMostRecentBuilds(
+ libtoaster.ctx.mostRecentBuildsUrl,
+
+ // success callback
+ function (data) {
+ var build;
+ var tmpl;
+ var container;
+ var selector;
+ var colourClass;
+ var elements;
+
+ for (var i = 0; i < data.length; i++) {
+ build = data[i];
+
+ if (buildFinished(build)) {
+ // a build finished: reload the whole page so that the build
+ // shows up in the builds table
+ window.location.reload();
+ }
+ else if (stateChanged(build)) {
+ // update the whole template
+ build.warnings_pluralise = (build.warnings !== 1 ? 's' : '');
+ build.errors_pluralise = (build.errors !== 1 ? 's' : '');
+
+ tmpl = $.templates("#build-template");
+
+ html = $(tmpl.render(build));
+
+ selector = '[data-latest-build-result="' + build.id + '"] ' +
+ '[data-role="build-status-container"]';
+ container = $(selector);
+
+ // initialize bootstrap tooltips in the new HTML
+ html.find('span.glyphicon-question-sign').tooltip();
+
+ container.html(html);
+ }
+ else if (cloneProgressChanged(build)) {
+ // update the clone progress text
+ selector = '#repos-cloned-percentage-' + build.id;
+ $(selector).html(build.repos_cloned_percentage);
+
+ // update the recipe progress bar
+ selector = '#repos-cloned-percentage-bar-' + build.id;
+ $(selector).width(build.repos_cloned_percentage + '%');
+ }
+ else if (tasksProgressChanged(build)) {
+ // update the task progress text
+ selector = '#build-pc-done-' + build.id;
+ $(selector).html(build.tasks_complete_percentage);
+
+ // update the task progress bar
+ selector = '#build-pc-done-bar-' + build.id;
+ $(selector).width(build.tasks_complete_percentage + '%');
+ }
+ else if (recipeProgressChanged(build)) {
+ // update the recipe progress text
+ selector = '#recipes-parsed-percentage-' + build.id;
+ $(selector).html(build.recipes_parsed_percentage);
+
+ // update the recipe progress bar
+ selector = '#recipes-parsed-percentage-bar-' + build.id;
+ $(selector).width(build.recipes_parsed_percentage + '%');
+ }
+
+ buildData[build.id] = build;
+ }
+ },
+
+ // fail callback
+ function (data) {
+ console.error(data);
+ }
+ );
+ }
+
+ window.setInterval(refreshMostRecentBuilds, 1500);
+ refreshMostRecentBuilds();
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
new file mode 100644
index 000000000..dace8e325
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -0,0 +1,199 @@
+"use strict";
+
+/*
+Used for the newcustomimage_modal actions
+
+The .data('recipe') value on the outer element determines which
+recipe ID is used as the basis for the new custom image recipe created via
+this modal.
+
+Use newCustomImageModalSetRecipes() to set the recipes available as a base
+for the new custom image. This will manage the addition of radio buttons
+to select the base image (or remove the radio buttons, if there is only a
+single base image available).
+*/
+
+function newCustomImageModalInit(){
+
+ var newCustomImgBtn = $("#create-new-custom-image-btn");
+ var imgCustomModal = $("#new-custom-image-modal");
+ var invalidNameHelp = $("#invalid-name-help");
+ var invalidRecipeHelp = $("#invalid-recipe-help");
+ var nameInput = imgCustomModal.find('input');
+
+ var invalidNameMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-).";
+ var duplicateNameMsg = "An image with this name already exists. Image names must be unique.";
+ var duplicateImageInProjectMsg = "An image with this name already exists in this project."
+ var invalidBaseRecipeIdMsg = "Please select an image to customise.";
+
+ // set button to "submit" state and enable text entry so user can
+ // enter the custom recipe name
+ showSubmitState();
+
+ /* capture clicks on radio buttons inside the modal; when one is selected,
+ * set the recipe on the modal
+ */
+ imgCustomModal.on("click", "[name='select-image']", function(e) {
+ clearRecipeError();
+ $(".radio").each(function(){
+ $(this).removeClass("has-error");
+ });
+
+ var recipeId = $(e.target).attr('data-recipe');
+ imgCustomModal.data('recipe', recipeId);
+ });
+
+ newCustomImgBtn.click(function(e){
+ // disable the button and text entry
+ showLoadingState();
+
+ e.preventDefault();
+
+ var baseRecipeId = imgCustomModal.data('recipe');
+
+ if (!baseRecipeId) {
+ showRecipeError(invalidBaseRecipeIdMsg);
+ $(".radio").each(function(){
+ $(this).addClass("has-error");
+ });
+ return;
+ }
+
+ if (nameInput.val().length > 0) {
+ libtoaster.createCustomRecipe(nameInput.val(), baseRecipeId,
+ function(ret) {
+ if (ret.error !== "ok") {
+ console.warn(ret.error);
+ if (ret.error === "invalid-name") {
+ showNameError(invalidNameMsg);
+ return;
+ } else if (ret.error === "recipe-already-exists") {
+ showNameError(duplicateNameMsg);
+ return;
+ } else if (ret.error === "image-already-exists") {
+ showNameError(duplicateImageInProjectMsg);
+ return;
+ }
+ } else {
+ imgCustomModal.modal('hide');
+ imgCustomModal.one('hidden.bs.modal', showSubmitState);
+ window.location.replace(ret.url + '?notify=new');
+ }
+ });
+ }
+ });
+
+ // enable text entry, show "Create image" button text
+ function showSubmitState() {
+ libtoaster.enableAjaxLoadingTimer();
+ newCustomImgBtn.find('[data-role="loading-state"]').hide();
+ newCustomImgBtn.find('[data-role="submit-state"]').show();
+ newCustomImgBtn.removeAttr('disabled');
+ nameInput.removeAttr('disabled');
+ }
+
+ // disable text entry, show "Creating image..." button text;
+ // we also disabled the page-level ajax loading spinner while this spinner
+ // is active
+ function showLoadingState() {
+ libtoaster.disableAjaxLoadingTimer();
+ newCustomImgBtn.find('[data-role="submit-state"]').hide();
+ newCustomImgBtn.find('[data-role="loading-state"]').show();
+ newCustomImgBtn.attr('disabled', 'disabled');
+ nameInput.attr('disabled', 'disabled');
+ }
+
+ function showNameError(text){
+ invalidNameHelp.text(text);
+ invalidNameHelp.show();
+ nameInput.parent().addClass('has-error');
+ }
+
+ function showRecipeError(text){
+ invalidRecipeHelp.text(text);
+ invalidRecipeHelp.show();
+ }
+
+ function clearRecipeError(){
+ invalidRecipeHelp.hide();
+ }
+
+ nameInput.on('keyup', function(){
+ if (nameInput.val().length === 0){
+ newCustomImgBtn.prop("disabled", true);
+ return
+ }
+
+ if (nameInput.val().search(/[^a-z|0-9|-]/) != -1){
+ showNameError(invalidNameMsg);
+ newCustomImgBtn.prop("disabled", true);
+ nameInput.parent().addClass('has-error');
+ } else {
+ invalidNameHelp.hide();
+ newCustomImgBtn.prop("disabled", false);
+ nameInput.parent().removeClass('has-error');
+ }
+ });
+}
+
+/* Set the image recipes which can used as the basis for the custom
+ * image recipe the user is creating
+ * baseRecipes: a list of one or more recipes which can be
+ * used as the base for the new custom image recipe in the format:
+ * [{'id': <recipe ID>, 'name': <recipe name>'}, ...]
+ *
+ * if recipes is a single recipe, just show the text box to set the
+ * name for the new custom image; if recipes contains multiple recipe objects,
+ * show a set of radio buttons so the user can decide which to use as the
+ * basis for the new custom image
+ */
+function newCustomImageModalSetRecipes(baseRecipes) {
+ var imgCustomModal = $("#new-custom-image-modal");
+ var imageSelector = $('#new-custom-image-modal [data-role="image-selector"]');
+ var imageSelectRadiosContainer = $('#new-custom-image-modal [data-role="image-selector-radios"]');
+
+ // remove any existing radio buttons + labels
+ imageSelector.remove('[data-role="image-radio"]');
+
+ if (baseRecipes.length === 1) {
+ // hide the radio button container
+ imageSelector.hide();
+
+ /* set the single recipe ID on the modal as it's the only one
+ * we can build from.
+ */
+ imgCustomModal.data('recipe', baseRecipes[0].id);
+ }
+ else {
+ // add radio buttons; note that the handlers for the radio buttons
+ // are set in newCustomImageModalInit via event delegation
+ for (var i = 0; i < baseRecipes.length; i++) {
+ var recipe = baseRecipes[i];
+ imageSelectRadiosContainer.append(
+ '<div class="radio"><label data-role="image-radio">' +
+ '<input type="radio" name="select-image" ' +
+ 'data-recipe="' + recipe.id + '">' +
+ recipe.name +
+ '</label></div>'
+ );
+ }
+
+ /* select the first radio button as default selection. Radio button
+ * groups should always display with an option checked
+ */
+ imageSelectRadiosContainer.find("input:radio:first").attr("checked", "checked");
+
+ /* check which radio button is selected by default inside the modal,
+ * and set the recipe on the modal accordingly
+ */
+ imageSelectRadiosContainer.find("input:radio").each(function(){
+ if ( $(this).is(":checked") ) {
+ var recipeId = $(this).attr("data-recipe");
+ imgCustomModal.data("recipe", recipeId);
+ }
+ });
+
+ // show the radio button container
+ imageSelector.show();
+ }
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
new file mode 100644
index 000000000..506471e09
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -0,0 +1,390 @@
+"use strict";
+
+function projectPageInit(ctx) {
+
+ var layerAddInput = $("#layer-add-input");
+ var layersInPrjList = $("#layers-in-project-list");
+ var layerAddBtn = $("#add-layer-btn");
+
+ var machineChangeInput = $("#machine-change-input");
+ var machineChangeBtn = $("#machine-change-btn");
+ var machineForm = $("#select-machine-form");
+ var machineChangeFormToggle = $("#change-machine-toggle");
+ var machineNameTitle = $("#project-machine-name");
+ var machineChangeCancel = $("#cancel-machine-change");
+ var machineInputForm = $("#machine-input-form");
+ var invalidMachineNameHelp = $("#invalid-machine-name-help");
+
+ var distroChangeInput = $("#distro-change-input");
+ var distroChangeBtn = $("#distro-change-btn");
+ var distroForm = $("#select-distro-form");
+ var distroChangeFormToggle = $("#change-distro-toggle");
+ var distroNameTitle = $("#project-distro-name");
+ var distroChangeCancel = $("#cancel-distro-change");
+
+ var freqBuildBtn = $("#freq-build-btn");
+ var freqBuildList = $("#freq-build-list");
+
+ var releaseChangeFormToggle = $("#release-change-toggle");
+ var releaseTitle = $("#project-release-title");
+ var releaseForm = $("#change-release-form");
+ var releaseModal = $("#change-release-modal");
+ var cancelReleaseChange = $("#cancel-release-change");
+
+ var currentLayerAddSelection;
+ var currentMachineAddSelection = "";
+ var currentDistroAddSelection = "";
+
+ var urlParams = libtoaster.parseUrlParams();
+
+ libtoaster.getProjectInfo(libtoaster.ctx.xhrProjectUrl, function(prjInfo){
+ updateProjectLayers(prjInfo.layers);
+ updateFreqBuildRecipes(prjInfo.freqtargets);
+ updateProjectRelease(prjInfo.release);
+
+ /* If we're receiving a machine set from the url and it's different from
+ * our current machine then activate set machine sequence.
+ */
+ if (urlParams.hasOwnProperty('setMachine') &&
+ urlParams.setMachine !== prjInfo.machine.name){
+ machineChangeInput.val(urlParams.setMachine);
+ machineChangeBtn.click();
+ } else {
+ updateMachineName(prjInfo.machine.name);
+ }
+
+ /* If we're receiving a distro set from the url and it's different from
+ * our current distro then activate set machine sequence.
+ */
+ if (urlParams.hasOwnProperty('setDistro') &&
+ urlParams.setDistro !== prjInfo.distro.name){
+ distroChangeInput.val(urlParams.setDistro);
+ distroChangeBtn.click();
+ } else {
+ updateDistroName(prjInfo.distro.name);
+ }
+
+ /* Now we're really ready show the page */
+ $("#project-page").show();
+
+ /* Set the project name in the delete modal */
+ $("#delete-project-modal .project-name").text(prjInfo.name);
+ });
+
+ if (urlParams.hasOwnProperty('notify') && urlParams.notify === 'new-project'){
+ $("#project-created-notification").show();
+ }
+
+ /* Add/Rm layer functionality */
+
+ libtoaster.makeTypeahead(layerAddInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "false" }, function(item){
+ currentLayerAddSelection = item;
+ layerAddBtn.removeAttr("disabled");
+ });
+
+ layerAddInput.keyup(function() {
+ if ($(this).val().length == 0) {
+ layerAddBtn.attr("disabled", "disabled")
+ }
+ });
+
+ layerAddBtn.click(function(e){
+ e.preventDefault();
+ var layerObj = currentLayerAddSelection;
+
+ addRmLayer(layerObj, true);
+ /* Reset the text input */
+ layerAddInput.val("");
+ /* Disable the add layer button*/
+ layerAddBtn.attr("disabled", "disabled");
+ });
+
+ function addRmLayer(layerObj, add){
+
+ libtoaster.addRmLayer(layerObj, add, function(layerDepsList){
+ if (add){
+ updateProjectLayers([layerObj]);
+ updateProjectLayers(layerDepsList);
+ }
+
+ /* Show the alert message */
+ var message = libtoaster.makeLayerAddRmAlertMsg(layerObj, layerDepsList, add);
+ libtoaster.showChangeNotification(message);
+ });
+ }
+
+ function updateProjectLayers(layers){
+
+ /* No layers to add */
+ if (layers.length === 0){
+ updateLayersCount();
+ return;
+ }
+
+ for (var i in layers){
+ var layerObj = layers[i];
+
+ var projectLayer = $("<li><a></a><span class=\"glyphicon glyphicon-trash\" data-toggle=\"tooltip\" title=\"Remove\"></span></li>");
+
+ projectLayer.data('layer', layerObj);
+ projectLayer.children("span").tooltip();
+
+ var link = projectLayer.children("a");
+
+ link.attr("href", layerObj.layerdetailurl);
+ link.text(layerObj.name);
+
+ if (layerObj.local_source_dir) {
+ link.tooltip({title: layerObj.local_source_dir, placement: "right"});
+ } else {
+ link.tooltip({title: layerObj.vcs_url + " | "+ layerObj.vcs_reference, placement: "right"});
+ }
+
+ var trashItem = projectLayer.children("span");
+ trashItem.click(function (e) {
+ e.preventDefault();
+ var layerObjToRm = $(this).parent().data('layer');
+
+ addRmLayer(layerObjToRm, false);
+
+ $(this).parent().fadeOut(function (){
+ $(this).remove();
+ updateLayersCount();
+ });
+ });
+
+ layersInPrjList.append(projectLayer);
+
+ updateLayersCount();
+ }
+ }
+
+ function updateLayersCount(){
+ var count = $("#layers-in-project-list").children().length;
+ var noLayerMsg = $("#no-layers-in-project");
+ var buildInput = $("#build-input");
+
+
+ if (count === 0) {
+ noLayerMsg.fadeIn();
+ $("#no-layers-in-project").fadeIn();
+ buildInput.attr("disabled", "disabled");
+ } else {
+ noLayerMsg.hide();
+ buildInput.removeAttr("disabled");
+ }
+
+ $("#project-layers-count").text(count);
+
+ return count;
+ }
+
+ /* Frequent builds functionality */
+ function updateFreqBuildRecipes(recipes) {
+ var noMostBuilt = $("#no-most-built");
+
+ if (recipes.length === 0){
+ noMostBuilt.show();
+ freqBuildBtn.hide();
+ } else {
+ noMostBuilt.hide();
+ freqBuildBtn.show();
+ }
+
+ for (var i in recipes){
+ var freqTargetCheck = $('<li><div class="checkbox"><label><input type="checkbox" /><span class="freq-target-name"></span></label></li>');
+ freqTargetCheck.find(".freq-target-name").text(recipes[i]);
+ freqTargetCheck.find("input").val(recipes[i]);
+ freqTargetCheck.click(function(){
+ if (freqBuildList.find(":checked").length > 0)
+ freqBuildBtn.removeAttr("disabled");
+ else
+ freqBuildBtn.attr("disabled", "disabled");
+ });
+
+ freqBuildList.append(freqTargetCheck);
+ }
+ }
+
+ freqBuildBtn.click(function(e){
+ e.preventDefault();
+
+ var toBuild = "";
+ freqBuildList.find(":checked").each(function(){
+ toBuild += $(this).val() + ' ';
+ });
+
+ toBuild = toBuild.trim();
+
+ libtoaster.startABuild(null, toBuild,
+ function(){
+ /* Build request started */
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ },
+ function(){
+ /* Build request failed */
+ console.warn("Build request failed to be created");
+ });
+ });
+
+
+ /* Change machine functionality */
+ machineChangeInput.keyup(function(){
+ if ($(this).val().indexOf(' ') >= 0) {
+ machineChangeBtn.attr("disabled", "disabled");
+ invalidMachineNameHelp.show();
+ machineInputForm.addClass('has-error');
+ } else {
+ machineChangeBtn.removeAttr("disabled");
+ invalidMachineNameHelp.hide();
+ machineInputForm.removeClass('has-error');
+ }
+ });
+
+ machineChangeFormToggle.click(function(){
+ machineChangeInput.val(machineNameTitle.text());
+ machineChangeBtn.removeAttr("disabled");
+ invalidMachineNameHelp.hide();
+ machineInputForm.removeClass('has-error');
+ machineForm.slideDown();
+ machineNameTitle.hide();
+ $(this).hide();
+ });
+
+ machineChangeCancel.click(function(){
+ machineForm.slideUp(function(){
+ machineNameTitle.show();
+ machineChangeFormToggle.show();
+ });
+ });
+
+ function updateMachineName(machineName){
+ machineChangeInput.val(machineName);
+ machineNameTitle.text(machineName);
+ }
+
+ libtoaster.makeTypeahead(machineChangeInput,
+ libtoaster.ctx.machinesTypeAheadUrl,
+ { }, function(item){
+ currentMachineAddSelection = item.name;
+ machineChangeBtn.removeAttr("disabled");
+ });
+
+ machineChangeBtn.click(function(e){
+ e.preventDefault();
+ /* We accept any value regardless of typeahead selection or not */
+ if (machineChangeInput.val().length === 0)
+ return;
+
+ currentMachineAddSelection = machineChangeInput.val();
+
+ libtoaster.editCurrentProject(
+ { machineName : currentMachineAddSelection },
+ function(){
+ /* Success machine changed */
+ updateMachineName(currentMachineAddSelection);
+ machineChangeCancel.click();
+
+ /* Show the alert message */
+ var message = $('<span>You have changed the machine to: <strong><span id="notify-machine-name"></span></strong></span>');
+ message.find("#notify-machine-name").text(currentMachineAddSelection);
+ libtoaster.showChangeNotification(message);
+ },
+ function(){
+ /* Failed machine changed */
+ console.warn("Failed to change machine");
+ });
+ });
+
+
+ /* Change distro functionality */
+
+ distroChangeFormToggle.click(function(){
+ distroForm.slideDown();
+ distroNameTitle.hide();
+ $(this).hide();
+ });
+
+ distroChangeCancel.click(function(){
+ distroForm.slideUp(function(){
+ distroNameTitle.show();
+ distroChangeFormToggle.show();
+ });
+ });
+
+ function updateDistroName(distroName){
+ distroChangeInput.val(distroName);
+ distroNameTitle.text(distroName);
+ }
+
+ libtoaster.makeTypeahead(distroChangeInput,
+ libtoaster.ctx.distrosTypeAheadUrl,
+ { }, function(item){
+ currentDistroAddSelection = item.name;
+ distroChangeBtn.removeAttr("disabled");
+ });
+
+ distroChangeBtn.click(function(e){
+ e.preventDefault();
+ /* We accept any value regardless of typeahead selection or not */
+ if (distroChangeInput.val().length === 0)
+ return;
+
+ currentDistroAddSelection = distroChangeInput.val();
+
+ libtoaster.editCurrentProject(
+ { distroName : currentDistroAddSelection },
+ function(){
+ /* Success machine changed */
+ updateDistroName(currentDistroAddSelection);
+ distroChangeCancel.click();
+
+ /* Show the alert message */
+ var message = $('<span>You have changed the distro to: <strong><span id="notify-machine-name"></span></strong></span>');
+ message.find("#notify-machine-name").text(currentDistroAddSelection);
+ libtoaster.showChangeNotification(message);
+ },
+ function(){
+ /* Failed machine changed */
+ console.warn("Failed to change distro");
+ });
+ });
+
+
+ /* Change release functionality */
+ function updateProjectRelease(release){
+ releaseTitle.text(release.description);
+ }
+
+
+ $("#delete-project-confirmed").click(function(e){
+ e.preventDefault();
+ libtoaster.disableAjaxLoadingTimer();
+ $(this).find('[data-role="submit-state"]').hide();
+ $(this).find('[data-role="loading-state"]').show();
+ $(this).attr("disabled", "disabled");
+ $('#delete-project-modal [data-dismiss="modal"]').hide();
+
+ $.ajax({
+ type: 'DELETE',
+ url: libtoaster.ctx.xhrProjectUrl,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error !== "ok") {
+ console.warn(data.error);
+ } else {
+ var msg = $('<span>You have deleted <strong>1</strong> project: <strong id="project-deleted"></strong></span>');
+
+ msg.find("#project-deleted").text(libtoaster.ctx.projectName);
+ libtoaster.setNotification("project-deleted", msg.html());
+
+ window.location.replace(data.gotoUrl);
+ }
+ },
+ error: function (data) {
+ console.warn(data);
+ }
+ });
+ });
+
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js b/poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js
new file mode 100644
index 000000000..69220aaf5
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/projecttopbar.js
@@ -0,0 +1,97 @@
+'use strict';
+
+function projectTopBarInit(ctx) {
+
+ var projectNameForm = $("#project-name-change-form");
+ var projectNameContainer = $("#project-name-container");
+ var projectName = $(".project-name");
+ var projectNameFormToggle = $("#project-change-form-toggle");
+ var projectNameChangeCancel = $("#project-name-change-cancel");
+
+ // this doesn't exist for command-line builds
+ var newBuildTargetInput = $("#build-input");
+
+ var newBuildTargetBuildBtn = $("#build-button");
+ var selectedTarget;
+
+ /* Project name change functionality */
+ projectNameFormToggle.click(function(e){
+ e.preventDefault();
+ projectNameContainer.hide();
+ projectNameForm.fadeIn();
+ });
+
+ projectNameChangeCancel.click(function(e){
+ e.preventDefault();
+ projectNameForm.hide();
+ projectNameContainer.fadeIn();
+ $("#project-name-change-input").val(projectName.first().text());
+ });
+
+ $("#project-name-change-btn").click(function(){
+ var newProjectName = $("#project-name-change-input").val();
+
+ libtoaster.editCurrentProject({ projectName: newProjectName }, function (){
+ projectName.text(newProjectName);
+ libtoaster.ctx.projectName = newProjectName;
+ projectNameChangeCancel.click();
+ });
+ });
+
+ /* Nav bar activate state switcher */
+ $("#project-topbar .nav li a").each(function(){
+ if (window.location.pathname === $(this).attr('href'))
+ $(this).parent().addClass('active');
+ else
+ $(this).parent().removeClass('active');
+ });
+
+ if (!newBuildTargetInput.length) {
+ return;
+ }
+
+ /* the following only applies for non-command-line projects */
+
+ /* Recipe build input functionality */
+ if (ctx.numProjectLayers > 0 && ctx.machine){
+ newBuildTargetInput.removeAttr("disabled");
+ }
+
+ libtoaster.makeTypeahead(newBuildTargetInput,
+ libtoaster.ctx.recipesTypeAheadUrl, {}, function (item) {
+ selectedTarget = item;
+ newBuildTargetBuildBtn.removeAttr("disabled");
+ });
+
+ newBuildTargetInput.on('input', function () {
+ if ($(this).val().length === 0) {
+ newBuildTargetBuildBtn.attr("disabled", "disabled");
+ } else {
+ newBuildTargetBuildBtn.removeAttr("disabled");
+ }
+ });
+
+ newBuildTargetBuildBtn.click(function (e) {
+ e.preventDefault();
+ if (!newBuildTargetInput.val().trim()) {
+ return;
+ }
+ /* We use the value of the input field so as to maintain any command also
+ * added e.g. core-image-minimal:clean and because we can build targets
+ * that toaster doesn't yet know about
+ */
+ selectedTarget = { name: newBuildTargetInput.val().trim() };
+
+ /* Fire off the build */
+ libtoaster.startABuild(null, selectedTarget.name,
+ function(){
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ }, null);
+ });
+
+ /* Call makeProjectNameValidation function */
+ libtoaster.makeProjectNameValidation($("#project-name-change-input"),
+ $("#hint-error-project-name"), $("#validate-project-name"),
+ $("#project-name-change-btn"));
+
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js b/poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js
new file mode 100644
index 000000000..fadd3403a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/qunit-1.18.0.js
@@ -0,0 +1,347 @@
+(function(window){var QUnit,config,onErrorFnPrev,loggingCallbacks={},fileName=(sourceFromStacktrace(0)||"").replace(/(:\d+)+\)?/,"").replace(/.+\//,""),toString=Object.prototype.toString,hasOwn=Object.prototype.hasOwnProperty,Date=window.Date,now=Date.now||function(){return new Date().getTime();},globalStartCalled=false,runStarted=false,setTimeout=window.setTimeout,clearTimeout=window.clearTimeout,defined={document:window.document!==undefined,setTimeout:window.setTimeout!==undefined,sessionStorage:(function(){var x="qunit-test-string";try{sessionStorage.setItem(x,x);sessionStorage.removeItem(x);return true;}catch(e){return false;}}())},errorString=function(error){var name,message,errorString=error.toString();if(errorString.substring(0,7)==="[object"){name=error.name?error.name.toString():"Error";message=error.message?error.message.toString():"";if(name&&message){return name+": "+message;}else if(name){return name;}else if(message){return message;}else{return "Error";}}else{return errorString;}},objectValues =function(obj){var key,val,vals=QUnit.is("array",obj)?[]:{};for(key in obj){if(hasOwn.call(obj,key)){val=obj[key];vals[key]=val===Object(val)?objectValues(val):val;}}
+return vals;};QUnit={};config={queue:[],blocking:true,reorder:true,altertitle:true,scrolltop:true,requireExpects:false,maxDepth:5,urlConfig:[{id:"hidepassed",label:"Hide passed tests",tooltip:"Only show tests and assertions that fail. Stored as query-strings."},{id:"noglobals",label:"Check for Globals",tooltip:"Enabling this will test if any test introduces new properties on the "+
+"`window` object. Stored as query-strings."},{id:"notrycatch",label:"No try-catch",tooltip:"Enabling this will run tests outside of a try-catch block. Makes debugging "+
+"exceptions in IE reasonable. Stored as query-strings."}],modules:[],currentModule:{name:"",tests:[]},callbacks:{}};config.modules.push(config.currentModule);(function(){var i,current,location=window.location||{search:"",protocol:"file:"},params=location.search.slice(1).split("&"),length=params.length,urlParams={};if(params[0]){for(i=0;i<length;i++){current=params[i].split("=");current[0]=decodeURIComponent(current[0]);current[1]=current[1]?decodeURIComponent(current[1]):true;if(urlParams[current[0]]){urlParams[current[0]]=[].concat(urlParams[current[0]],current[1]);}else{urlParams[current[0]]=current[1];}}}
+if(urlParams.filter===true){delete urlParams.filter;}
+QUnit.urlParams=urlParams;config.filter=urlParams.filter;if(urlParams.maxDepth){config.maxDepth=parseInt(urlParams.maxDepth,10)===-1?Number.POSITIVE_INFINITY:urlParams.maxDepth;}
+config.testId=[];if(urlParams.testId){urlParams.testId=decodeURIComponent(urlParams.testId).split(",");for(i=0;i<urlParams.testId.length;i++){config.testId.push(urlParams.testId[i]);}}
+QUnit.isLocal=location.protocol==="file:";QUnit.version="1.18.0";}());extend(QUnit,{module:function(name,testEnvironment){var currentModule={name:name,testEnvironment:testEnvironment,tests:[]};if(testEnvironment&&testEnvironment.setup){testEnvironment.beforeEach=testEnvironment.setup;delete testEnvironment.setup;}
+if(testEnvironment&&testEnvironment.teardown){testEnvironment.afterEach=testEnvironment.teardown;delete testEnvironment.teardown;}
+config.modules.push(currentModule);config.currentModule=currentModule;},asyncTest:function(testName,expected,callback){if(arguments.length===2){callback=expected;expected=null;}
+QUnit.test(testName,expected,callback,true);},test:function(testName,expected,callback,async){var test;if(arguments.length===2){callback=expected;expected=null;}
+test=new Test({testName:testName,expected:expected,async:async,callback:callback});test.queue();},skip:function(testName){var test=new Test({testName:testName,skip:true});test.queue();},//
+start:function(count){var globalStartAlreadyCalled=globalStartCalled;if(!config.current){globalStartCalled=true;if(runStarted){throw new Error("Called start() outside of a test context while already started");}else if(globalStartAlreadyCalled||count>1){throw new Error("Called start() outside of a test context too many times");}else if(config.autostart){throw new Error("Called start() outside of a test context when "+
+"QUnit.config.autostart was true");}else if(!config.pageLoaded){config.autostart=true;return;}}else{config.current.semaphore-=count||1;if(config.current.semaphore>0){return;}
+if(config.current.semaphore<0){config.current.semaphore=0;QUnit.pushFailure("Called start() while already started (test's semaphore was 0 already)",sourceFromStacktrace(2));return;}}
+resumeProcessing();},stop:function(count){if(!config.current){throw new Error("Called stop() outside of a test context");}
+config.current.semaphore+=count||1;pauseProcessing();},config:config,is:function(type,obj){return QUnit.objectType(obj)===type;},objectType:function(obj){if(typeof obj==="undefined"){return "undefined";}//
+if(obj===null){return "null";}
+var match=toString.call(obj).match(/^\[object\s(.*)\]$/),type=match&&match[1]||"";switch(type){case "Number":if(isNaN(obj)){return "nan";}
+return "number";case "String":case "Boolean":case "Array":case "Date":case "RegExp":case "Function":return type.toLowerCase();}
+if(typeof obj==="object"){return "object";}
+return undefined;},extend:extend,load:function(){config.pageLoaded=true;extend(config,{stats:{all:0,bad:0},moduleStats:{all:0,bad:0},started:0,updateRate:1000,autostart:true,filter:""},true);config.blocking=false;if(config.autostart){resumeProcessing();}}});(function(){var i,l,key,callbacks=["begin","done","log","testStart","testDone","moduleStart","moduleDone"];function registerLoggingCallback(key){var loggingCallback=function(callback){if(QUnit.objectType(callback)!=="function"){throw new Error("QUnit logging methods require a callback function as their first parameters.");}
+config.callbacks[key].push(callback);};loggingCallbacks[key]=loggingCallback;return loggingCallback;}
+for(i=0,l=callbacks.length;i<l;i++){key=callbacks[i];if(QUnit.objectType(config.callbacks[key])==="undefined"){config.callbacks[key]=[];}
+QUnit[key]=registerLoggingCallback(key);}})();onErrorFnPrev=window.onerror;//
+window.onerror=function(error,filePath,linerNr){var ret=false;if(onErrorFnPrev){ret=onErrorFnPrev(error,filePath,linerNr);}
+if(ret!==true){if(QUnit.config.current){if(QUnit.config.current.ignoreGlobalErrors){return true;}
+QUnit.pushFailure(error,filePath+":"+linerNr);}else{QUnit.test("global failure",extend(function(){QUnit.pushFailure(error,filePath+":"+linerNr);},{validTest:true}));}
+return false;}
+return ret;};function done(){var runtime,passed;config.autorun=true;if(config.previousModule){runLoggingCallbacks("moduleDone",{name:config.previousModule.name,tests:config.previousModule.tests,failed:config.moduleStats.bad,passed:config.moduleStats.all-config.moduleStats.bad,total:config.moduleStats.all,runtime:now()-config.moduleStats.started});}
+delete config.previousModule;runtime=now()-config.started;passed=config.stats.all-config.stats.bad;runLoggingCallbacks("done",{failed:config.stats.bad,passed:passed,total:config.stats.all,runtime:runtime});}
+function extractStacktrace(e,offset){offset=offset===undefined?4:offset;var stack,include,i;if(e.stack){stack=e.stack.split("\n");if(/^error$/i.test(stack[0])){stack.shift();}
+if(fileName){include=[];for(i=offset;i<stack.length;i++){if(stack[i].indexOf(fileName)!==-1){break;}
+include.push(stack[i]);}
+if(include.length){return include.join("\n");}}
+return stack[offset];//
+}else if(e.sourceURL){if(/qunit.js$/.test(e.sourceURL)){return;}
+return e.sourceURL+":"+e.line;}}
+function sourceFromStacktrace(offset){var error=new Error();if(!error.stack){try{throw error;}catch(err){error=err;}}
+return extractStacktrace(error,offset);}
+function synchronize(callback,last){if(QUnit.objectType(callback)==="array"){while(callback.length){synchronize(callback.shift());}
+return;}
+config.queue.push(callback);if(config.autorun&&!config.blocking){process(last);}}
+function process(last){function next(){process(last);}
+var start=now();config.depth=(config.depth||0)+1;while(config.queue.length&&!config.blocking){if(!defined.setTimeout||config.updateRate<=0||((now()-start)<config.updateRate)){if(config.current){config.current.usedAsync=false;}
+config.queue.shift()();}else{setTimeout(next,13);break;}}
+config.depth--;if(last&&!config.blocking&&!config.queue.length&&config.depth===0){done();}}
+function begin(){var i,l,modulesLog=[];if(!config.started){config.started=now();verifyLoggingCallbacks();if(config.modules[0].name===""&&config.modules[0].tests.length===0){config.modules.shift();}
+for(i=0,l=config.modules.length;i<l;i++){modulesLog.push({name:config.modules[i].name,tests:config.modules[i].tests});}
+runLoggingCallbacks("begin",{totalTests:Test.count,modules:modulesLog});}
+config.blocking=false;process(true);}
+function resumeProcessing(){runStarted=true;if(defined.setTimeout){setTimeout(function(){if(config.current&&config.current.semaphore>0){return;}
+if(config.timeout){clearTimeout(config.timeout);}
+begin();},13);}else{begin();}}
+function pauseProcessing(){config.blocking=true;if(config.testTimeout&&defined.setTimeout){clearTimeout(config.timeout);config.timeout=setTimeout(function(){if(config.current){config.current.semaphore=0;QUnit.pushFailure("Test timed out",sourceFromStacktrace(2));}else{throw new Error("Test timed out");}
+resumeProcessing();},config.testTimeout);}}
+function saveGlobal(){config.pollution=[];if (config.noglobals){for(var key in window){if(hasOwn.call(window,key)){if(/^qunit-test-output/.test(key)){continue;}
+config.pollution.push(key);}}}}
+function checkPollution(){var newGlobals,deletedGlobals,old=config.pollution;saveGlobal();newGlobals=diff(config.pollution,old);if(newGlobals.length>0){QUnit.pushFailure("Introduced global variable(s): "+newGlobals.join(", "));}
+deletedGlobals=diff(old,config.pollution);if(deletedGlobals.length>0){QUnit.pushFailure("Deleted global variable(s): "+deletedGlobals.join(", "));}}
+function diff(a,b){var i,j,result=a.slice();for(i=0;i<result.length;i++){for(j=0;j<b.length;j++){if(result[i]===b[j]){result.splice(i,1);i--;break;}}}
+return result;}
+function extend(a,b,undefOnly){for(var prop in b){if(hasOwn.call(b,prop)){if(!(prop==="constructor"&&a===window)){if(b[prop]===undefined){delete a[prop];}else if(!(undefOnly&&typeof a[prop]!=="undefined")){a[prop]=b[prop];}}}}
+return a;}
+function runLoggingCallbacks(key,args){var i,l,callbacks;callbacks=config.callbacks[key];for(i=0,l=callbacks.length;i<l;i++){callbacks[i](args);}}
+function verifyLoggingCallbacks(){var loggingCallback,userCallback;for(loggingCallback in loggingCallbacks){if(QUnit[loggingCallback]!==loggingCallbacks[loggingCallback]){userCallback=QUnit[loggingCallback];QUnit[loggingCallback]=loggingCallbacks[loggingCallback];QUnit[loggingCallback](userCallback);if(window.console&&window.console.warn){window.console.warn("QUnit."+loggingCallback+" was replaced with a new value.\n"+
+"Please, check out the documentation on how to apply logging callbacks.\n"+
+"Reference: http://api.qunitjs.com/category/callbacks/");}}}}
+function inArray(elem,array){if(array.indexOf){return array.indexOf(elem);}
+for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i;}}
+return-1;}
+function Test(settings){var i,l;++Test.count;extend(this,settings);this.assertions=[];this.semaphore=0;this.usedAsync=false;this.module=config.currentModule;this.stack=sourceFromStacktrace(3);for(i=0,l=this.module.tests;i<l.length;i++){if(this.module.tests[i].name===this.testName){this.testName+=" ";}}
+this.testId=generateHash(this.module.name,this.testName);this.module.tests.push({name:this.testName,testId:this.testId});if(settings.skip){this.callback=function(){};this.async=false;this.expected=0;}else{this.assert=new Assert(this);}}
+Test.count=0;Test.prototype={before:function(){if(this.module!==config.previousModule||//
+!hasOwn.call(config,"previousModule")){if(hasOwn.call(config,"previousModule")){runLoggingCallbacks("moduleDone",{name:config.previousModule.name,tests:config.previousModule.tests,failed:config.moduleStats.bad,passed:config.moduleStats.all-config.moduleStats.bad,total:config.moduleStats.all,runtime:now()-config.moduleStats.started});}
+config.previousModule=this.module;config.moduleStats={all:0,bad:0,started:now()};runLoggingCallbacks("moduleStart",{name:this.module.name,tests:this.module.tests});}
+config.current=this;this.testEnvironment=extend({},this.module.testEnvironment);delete this.testEnvironment.beforeEach;delete this.testEnvironment.afterEach;this.started=now();runLoggingCallbacks("testStart",{name:this.testName,module:this.module.name,testId:this.testId});if(!config.pollution){saveGlobal();}},run:function(){var promise;config.current=this;if(this.async){QUnit.stop();}
+this.callbackStarted=now();if(config.notrycatch){promise=this.callback.call(this.testEnvironment,this.assert);this.resolvePromise(promise);return;}
+try{promise=this.callback.call(this.testEnvironment,this.assert);this.resolvePromise(promise);}catch(e){this.pushFailure("Died on test #"+(this.assertions.length+1)+" "+
+this.stack+": "+(e.message||e),extractStacktrace(e,0));saveGlobal();if(config.blocking){QUnit.start();}}},after:function(){checkPollution();},queueHook:function(hook,hookName){var promise,test=this;return function runHook(){config.current=test;if(config.notrycatch){promise=hook.call(test.testEnvironment,test.assert);test.resolvePromise(promise,hookName);return;}
+try{promise=hook.call(test.testEnvironment,test.assert);test.resolvePromise(promise,hookName);}catch(error){test.pushFailure(hookName+" failed on "+test.testName+": "+(error.message||error),extractStacktrace(error,0));}};},hooks:function(handler){var hooks=[];if(this.skip){return hooks;}
+if(this.module.testEnvironment&&QUnit.objectType(this.module.testEnvironment[handler])==="function"){hooks.push(this.queueHook(this.module.testEnvironment[handler],handler));}
+return hooks;},finish:function(){config.current=this;if(config.requireExpects&&this.expected===null){this.pushFailure("Expected number of assertions to be defined, but expect() was "+
+"not called.",this.stack);}else if(this.expected!==null&&this.expected!==this.assertions.length){this.pushFailure("Expected "+this.expected+" assertions, but "+
+this.assertions.length+" were run",this.stack);}else if(this.expected===null&&!this.assertions.length){this.pushFailure("Expected at least one assertion, but none were run - call "+
+"expect(0) to accept zero assertions.",this.stack);}
+var i,bad=0;this.runtime=now()-this.started;config.stats.all+=this.assertions.length;config.moduleStats.all+=this.assertions.length;for(i=0;i<this.assertions.length;i++){if(!this.assertions[i].result){bad++;config.stats.bad++;config.moduleStats.bad++;}}
+runLoggingCallbacks("testDone",{name:this.testName,module:this.module.name,skipped:!!this.skip,failed:bad,passed:this.assertions.length-bad,total:this.assertions.length,runtime:this.runtime,assertions:this.assertions,testId:this.testId,duration:this.runtime});QUnit.reset();config.current=undefined;},queue:function(){var bad,test=this;if(!this.valid()){return;}
+function run(){synchronize([function(){test.before();},test.hooks("beforeEach"),function(){test.run();},test.hooks("afterEach").reverse(),function(){test.after();},function(){test.finish();}]);}
+bad=QUnit.config.reorder&&defined.sessionStorage&&+sessionStorage.getItem("qunit-test-"+this.module.name+"-"+this.testName);if(bad){run();}else{synchronize(run,true);}},push:function(result,actual,expected,message){var source,details={module:this.module.name,name:this.testName,result:result,message:message,actual:actual,expected:expected,testId:this.testId,runtime:now()-this.started};if(!result){source=sourceFromStacktrace();if(source){details.source=source;}}
+runLoggingCallbacks("log",details);this.assertions.push({result:!!result,message:message});},pushFailure:function(message,source,actual){if(!this instanceof Test){throw new Error("pushFailure() assertion outside test context, was "+
+sourceFromStacktrace(2));}
+var details={module:this.module.name,name:this.testName,result:false,message:message||"error",actual:actual||null,testId:this.testId,runtime:now()-this.started};if(source){details.source=source;}
+runLoggingCallbacks("log",details);this.assertions.push({result:false,message:message});},resolvePromise:function(promise,phase){var then,message,test=this;if(promise!=null){then=promise.then;if(QUnit.objectType(then)==="function"){QUnit.stop();then.call(promise,QUnit.start,function(error){message="Promise rejected "+(!phase?"during":phase.replace(/Each$/,""))+
+" "+test.testName+": "+(error.message||error);test.pushFailure(message,extractStacktrace(error,0));saveGlobal();QUnit.start();});}}},valid:function(){var include,filter=config.filter&&config.filter.toLowerCase(),module=QUnit.urlParams.module&&QUnit.urlParams.module.toLowerCase(),fullName=(this.module.name+": "+this.testName).toLowerCase();if(this.callback&&this.callback.validTest){return true;}
+if(config.testId.length>0&&inArray(this.testId,config.testId)<0){return false;}
+if(module&&(!this.module.name||this.module.name.toLowerCase()!==module)){return false;}
+if(!filter){return true;}
+include=filter.charAt(0)!=="!";if(!include){filter=filter.slice(1);}
+if(fullName.indexOf(filter)!==-1){return include;}
+return!include;}};QUnit.reset=function(){if(typeof window==="undefined"){return;}
+var fixture=defined.document&&document.getElementById&&document.getElementById("qunit-fixture");if(fixture){fixture.innerHTML=config.fixture;}};QUnit.pushFailure=function(){if(!QUnit.config.current){throw new Error("pushFailure() assertion outside test context, in "+
+sourceFromStacktrace(2));}
+var currentTest=QUnit.config.current;return currentTest.pushFailure.apply(currentTest,arguments);};function generateHash(module,testName){var hex,i=0,hash=0,str=module+"\x1C"+testName,len=str.length;for(;i<len;i++){hash=((hash<<5)-hash)+str.charCodeAt(i);hash|=0;}
+hex=(0x100000000+hash).toString(16);if(hex.length<8){hex="0000000"+hex;}
+return hex.slice(-8);}
+function Assert(testContext){this.test=testContext;}
+QUnit.assert=Assert.prototype={expect:function(asserts){if(arguments.length===1){this.test.expected=asserts;}else{return this.test.expected;}},async:function(){var test=this.test,popped=false;test.semaphore+=1;test.usedAsync=true;pauseProcessing();return function done(){if(!popped){test.semaphore-=1;popped=true;resumeProcessing();}else{test.pushFailure("Called the callback returned from `assert.async` more than once",sourceFromStacktrace(2));}};},push:function(){var assert=this,currentTest=(assert instanceof Assert&&assert.test)||QUnit.config.current;if(!currentTest){throw new Error("assertion outside test context, in "+sourceFromStacktrace(2));}
+if(currentTest.usedAsync===true&&currentTest.semaphore===0){currentTest.pushFailure("Assertion after the final `assert.async` was resolved",sourceFromStacktrace(2));}
+if(!(assert instanceof Assert)){assert=currentTest.assert;}
+return assert.test.push.apply(assert.test,arguments);},ok:function(result,message){message=message||(result?"okay":"failed, expected argument to be truthy, was: "+
+QUnit.dump.parse(result));this.push(!!result,result,true,message);},notOk:function(result,message){message=message||(!result?"okay":"failed, expected argument to be falsy, was: "+
+QUnit.dump.parse(result));this.push(!result,result,false,message);},equal:function(actual,expected,message){this.push(expected==actual,actual,expected,message);},notEqual:function(actual,expected,message){this.push(expected!=actual,actual,expected,message);},propEqual:function(actual,expected,message){actual=objectValues(actual);expected=objectValues(expected);this.push(QUnit.equiv(actual,expected),actual,expected,message);},notPropEqual:function(actual,expected,message){actual=objectValues(actual);expected=objectValues(expected);this.push(!QUnit.equiv(actual,expected),actual,expected,message);},deepEqual:function(actual,expected,message){this.push(QUnit.equiv(actual,expected),actual,expected,message);},notDeepEqual:function(actual,expected,message){this.push(!QUnit.equiv(actual,expected),actual,expected,message);},strictEqual:function(actual,expected,message){this.push(expected===actual,actual,expected,message);},notStrictEqual:function(actual,expected,message){this.push(expected!==actual,actual,expected,message);},"throws":function(block,expected,message){var actual,expectedType,expectedOutput=expected,ok=false,currentTest=(this instanceof Assert&&this.test)||QUnit.config.current;if(message==null&&typeof expected==="string"){message=expected;expected=null;}
+currentTest.ignoreGlobalErrors=true;try{block.call(currentTest.testEnvironment);}catch(e){actual=e;}
+currentTest.ignoreGlobalErrors=false;if(actual){expectedType=QUnit.objectType(expected);if(!expected){ok=true;expectedOutput=null;}else if(expectedType==="regexp"){ok=expected.test(errorString(actual));}else if(expectedType==="string"){ok=expected===errorString(actual);}else if(expectedType==="function"&&actual instanceof expected){ok=true;}else if(expectedType==="object"){ok=actual instanceof expected.constructor&&actual.name===expected.name&&actual.message===expected.message;}else if(expectedType==="function"&&expected.call({},actual)===true){expectedOutput= null;ok=true;}}
+currentTest.assert.push(ok,actual,expectedOutput,message);}};(function(){Assert.prototype.raises=Assert.prototype["throws"];}());QUnit.equiv=(function(){function bindCallbacks(o,callbacks,args){var prop=QUnit.objectType(o);if(prop){if(QUnit.objectType(callbacks[prop])==="function"){return callbacks[prop].apply(callbacks,args);}else{return callbacks[prop];}}}
+var innerEquiv,callers=[],parents=[],parentsB=[],getProto=Object.getPrototypeOf||function(obj){return obj.__proto__;},callbacks=(function(){function useStrictEquality(b,a){if(b instanceof a.constructor||a instanceof b.constructor){return a==b;}else{return a===b;}}
+return{"string":useStrictEquality,"boolean":useStrictEquality,"number":useStrictEquality,"null":useStrictEquality,"undefined":useStrictEquality,"nan":function(b){return isNaN(b);},"date":function(b,a){return QUnit.objectType(b)==="date"&&a.valueOf()===b.valueOf();},"regexp":function(b,a){return QUnit.objectType(b)==="regexp"&&a.source===b.source&&a.global===b.global&&a.ignoreCase===b.ignoreCase&&a.multiline===b.multiline&&a.sticky===b.sticky;},"function":function(){var caller=callers[callers.length-1];return caller!==Object&&typeof caller!=="undefined";},"array":function(b,a){var i,j,len,loop,aCircular,bCircular;if(QUnit.objectType(b)!=="array"){return false;}
+len=a.length;if(len!==b.length){return false;}
+parents.push(a);parentsB.push(b);for(i=0;i<len;i++){loop=false;for(j=0;j<parents.length;j++){aCircular=parents[j]===a[i];bCircular=parentsB[j]===b[i];if(aCircular||bCircular){ if(a[i]===b[i]||aCircular&&bCircular){loop=true;}else{parents.pop();parentsB.pop();return false;}}}
+if(!loop&&!innerEquiv(a[i],b[i])){parents.pop();parentsB.pop();return false;}}
+parents.pop();parentsB.pop();return true;},"object":function(b,a){var i,j,loop,aCircular,bCircular,eq=true,aProperties=[],bProperties=[];if(a.constructor!==b.constructor){if(!((getProto(a)===null&&getProto(b)===Object.prototype)||(getProto(b)===null&&getProto(a)===Object.prototype))){return false;}}
+callers.push(a.constructor);parents.push(a);parentsB.push(b);for(i in a){loop=false;for(j=0;j<parents.length;j++){aCircular=parents[j]===a[i];bCircular=parentsB[j]===b[i];if(aCircular||bCircular){if(a[i]===b[i]||aCircular&&bCircular){loop=true;}else{eq=false;break;}}}
+aProperties.push(i);if(!loop&&!innerEquiv(a[i],b[i])){eq=false;break;}}
+parents.pop();parentsB.pop();callers.pop();for(i in b){bProperties.push(i);}
+return eq&&innerEquiv(aProperties.sort(),bProperties.sort());}};}());innerEquiv=function(){var args=[].slice.apply(arguments);if(args.length<2){return true;}
+return((function(a,b){if(a===b){return true;}else if(a===null||b===null||typeof a==="undefined"||typeof b==="undefined"||QUnit.objectType(a)!==QUnit.objectType(b)){return false;}else{return bindCallbacks(a,callbacks,[b,a]);}}(args[0],args[1]))&&innerEquiv.apply(this,args.splice(1,args.length-1)));};return innerEquiv;}());QUnit.dump=(function(){function quote(str){return "\""+str.toString().replace(/"/g,"\\\"")+"\"";}
+function literal(o){return o+"";}
+function join(pre,arr,post){var s=dump.separator(),base=dump.indent(),inner=dump.indent(1);if(arr.join){arr=arr.join(","+s+inner);}
+if(!arr){return pre+post;}
+return[pre,inner+arr,base+post].join(s);}
+function array(arr,stack){var i=arr.length,ret=new Array(i);if(dump.maxDepth&&dump.depth>dump.maxDepth){return "[object Array]";}
+this.up();while(i--){ret[i]=this.parse(arr[i],undefined,stack);}
+this.down();return join("[",ret,"]");}
+var reName=/^function (\w+)/,dump={parse:function(obj,objType,stack){stack=stack||[];var res,parser,parserType,inStack=inArray(obj,stack);if(inStack!==-1){return "recursion("+(inStack-stack.length)+")";}
+objType=objType||this.typeOf(obj);parser=this.parsers[objType];parserType=typeof parser;if(parserType==="function"){stack.push(obj);res=parser.call(this,obj,stack);stack.pop();return res;}
+return(parserType==="string")?parser:this.parsers.error;},typeOf:function(obj){var type;if(obj===null){type="null";}else if(typeof obj==="undefined"){type="undefined";}else if(QUnit.is("regexp",obj)){type="regexp";}else if(QUnit.is("date",obj)){type="date";}else if(QUnit.is("function",obj)){type="function";}else if(obj.setInterval!==undefined&&obj.document!==undefined&&obj.nodeType===undefined){type="window";}else if(obj.nodeType===9){type="document";}else if(obj.nodeType){type="node";}else if(toString.call(obj)==="[object Array]"||(typeof obj.length==="number"&&obj.item!==undefined&&(obj.length?obj.item(0)===obj[ 0]:(obj.item(0)===null&&obj[0]===undefined)))){type="array";}else if(obj.constructor===Error.prototype.constructor){type="error";}else{type=typeof obj;}
+return type;},separator:function(){return this.multiline?this.HTML?"<br />":"\n":this.HTML?"&#160;":" ";},indent:function(extra){if(!this.multiline){return "";}
+var chr=this.indentChar;if(this.HTML){chr=chr.replace(/\t/g," ").replace(/ /g,"&#160;");}
+return new Array(this.depth+(extra||0)).join(chr);},up:function(a){this.depth+=a||1;},down:function(a){this.depth-=a||1;},setParser:function(name,parser){this.parsers[name]=parser;},quote:quote,literal:literal,join:join,depth:1,maxDepth:QUnit.config.maxDepth,parsers:{window:"[Window]",document:"[Document]",error:function(error){return "Error(\""+error.message+"\")";},unknown:"[Unknown]","null":"null","undefined":"undefined","function":function(fn){var ret="function",name="name" in fn?fn.name:(reName.exec(fn)||[])[1];if(name){ret+=" "+name;}
+ret+="( ";ret=[ret,dump.parse(fn,"functionArgs"),"){"].join("");return join(ret,dump.parse(fn,"functionCode"),"}");},array:array,nodelist:array,"arguments":array,object:function(map,stack){var keys,key,val,i,nonEnumerableProperties,ret=[];if(dump.maxDepth&&dump.depth>dump.maxDepth){return "[object Object]";}
+dump.up(); keys=[];for(key in map){keys.push(key);}
+nonEnumerableProperties=["message","name"];for(i in nonEnumerableProperties){key=nonEnumerableProperties[i];if(key in map&&inArray(key,keys)<0){keys.push(key);}}
+keys.sort();for(i=0;i<keys.length;i++){key=keys[i];val=map[key];ret.push(dump.parse(key,"key")+": "+
+dump.parse(val,undefined,stack));}
+dump.down();return join("{",ret,"}");},node:function(node){var len,i,val,open=dump.HTML?"&lt;":"<",close=dump.HTML?"&gt;":">",tag=node.nodeName.toLowerCase(),ret=open+tag,attrs=node.attributes;if(attrs){for(i=0,len=attrs.length;i<len;i++){val=attrs[i].nodeValue;if(val&&val!=="inherit"){ret+=" "+attrs[i].nodeName+"="+
+dump.parse(val,"attribute");}}}
+ret+=close;if(node.nodeType===3||node.nodeType===4){ret+=node.nodeValue;}
+return ret+open+"/"+tag+close;},functionArgs:function(fn){var args,l=fn.length;if(!l){return "";}
+args=new Array(l);while(l--){args[l]=String.fromCharCode(97+l);}
+return " "+args.join(", ")+" ";},key:quote,functionCode:"[code]",attribute:quote,string:quote,date:quote,regexp:literal,number:literal,"boolean":literal},HTML:false,indentChar:" ",multiline:true};return dump;}());QUnit.jsDump=QUnit.dump;if(typeof window!=="undefined"){(function(){var i,assertions=Assert.prototype;function applyCurrent(current){return function(){var assert=new Assert(QUnit.config.current);current.apply(assert,arguments);};}
+for(i in assertions){QUnit[i]=applyCurrent(assertions[i]);}})();(function(){var i,l,keys=["test","module","expect","asyncTest","start","stop","ok","notOk","equal","notEqual","propEqual","notPropEqual","deepEqual","notDeepEqual","strictEqual","notStrictEqual","throws"];for(i=0,l=keys.length;i<l;i++){window[keys[i]]=QUnit[keys[i]];}})();window.QUnit=QUnit;}
+if(typeof module!=="undefined"&&module&&module.exports){module.exports=QUnit;module.exports.QUnit=QUnit;}
+if(typeof exports!=="undefined"&&exports){exports.QUnit=QUnit;}
+if(typeof define==="function"&&define.amd){define(function(){return QUnit;});QUnit.config.autostart=false;}}((function(){return this;})()));//
+/**/
+QUnit.diff=(function(){function DiffMatchPatch(){this.DiffTimeout=1.0;this.DiffEditCost=4;}
+var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;DiffMatchPatch.prototype.DiffMain=function(text1,text2,optChecklines,optDeadline){var deadline,checklines,commonlength,commonprefix,commonsuffix,diffs;if(typeof optDeadline==="undefined"){if(this.DiffTimeout<=0){optDeadline=Number.MAX_VALUE;}else{ optDeadline=(new Date()).getTime()+this.DiffTimeout*1000;}}
+deadline=optDeadline;if(text1===null||text2===null){throw new Error("Null input. (DiffMain)");}
+if(text1===text2){if(text1){return[[DIFF_EQUAL,text1]];}
+return[];}
+if(typeof optChecklines==="undefined"){optChecklines=true;}
+checklines=optChecklines;commonlength=this.diffCommonPrefix(text1,text2);commonprefix=text1.substring(0,commonlength);text1=text1.substring(commonlength);text2=text2.substring(commonlength);commonlength=this.diffCommonSuffix(text1,text2);commonsuffix=text1.substring(text1.length-commonlength);text1=text1.substring(0,text1.length-commonlength);text2=text2.substring(0,text2.length-commonlength);diffs=this.diffCompute(text1,text2,checklines,deadline);if(commonprefix){diffs.unshift([DIFF_EQUAL,commonprefix]);}
+if(commonsuffix){diffs.push([DIFF_EQUAL,commonsuffix]);}
+this.diffCleanupMerge(diffs);return diffs;};DiffMatchPatch.prototype.diffCleanupEfficiency=function(diffs){var changes,equalities,equalitiesLength,lastequality,pointer,preIns,preDel,postIns,postDel;changes=false;equalities=[];equalitiesLength=0;lastequality=null;pointer=0;preIns=false;preDel=false;postIns=false;postDel=false;while(pointer<diffs.length){if(diffs[pointer][0]===DIFF_EQUAL){if(diffs[pointer][1].length<this.DiffEditCost&&(postIns||postDel)){equalities[equalitiesLength++]=pointer;preIns=postIns;preDel=postDel;lastequality=diffs[pointer][1];}else{equalitiesLength=0;lastequality=null;}
+postIns=postDel=false;}else{if(diffs[pointer][0]===DIFF_DELETE){postDel=true;}else{postIns=true;}
+if(lastequality&&((preIns&&preDel&&postIns&&postDel)||((lastequality.length<this.DiffEditCost/2)&&(preIns+preDel+postIns+postDel)===3))){diffs.splice(equalities[equalitiesLength-1],0,[DIFF_DELETE,lastequality]);diffs[equalities[equalitiesLength-1]+1][0]=DIFF_INSERT;equalitiesLength--;lastequality=null;if(preIns&&preDel){postIns=postDel=true;equalitiesLength=0;}else{equalitiesLength--;pointer=equalitiesLength>0?equalities[equalitiesLength-1]:-1;postIns=postDel=false;}
+changes=true;}}
+pointer++;}
+if(changes){this.diffCleanupMerge(diffs);}};DiffMatchPatch.prototype.diffPrettyHtml=function(diffs){var op,data,x,html=[];for(x=0;x<diffs.length;x++){op=diffs[x][0];data=diffs[x][1];switch(op){case DIFF_INSERT:html[x]="<ins>"+data+"</ins>";break;case DIFF_DELETE:html[x]="<del>"+data+"</del>";break;case DIFF_EQUAL:html[x]="<span>"+data+"</span>";break;}}
+return html.join("");};DiffMatchPatch.prototype.diffCommonPrefix=function(text1,text2){var pointermid,pointermax,pointermin,pointerstart;if(!text1||!text2||text1.charAt(0)!==text2.charAt(0)){return 0;}
+pointermin=0;pointermax=Math.min(text1.length,text2.length);pointermid=pointermax;pointerstart=0;while(pointermin<pointermid){if(text1.substring(pointerstart,pointermid)===text2.substring(pointerstart,pointermid)){pointermin=pointermid;pointerstart=pointermin;}else{pointermax=pointermid;}
+pointermid=Math.floor((pointermax-pointermin)/2+pointermin);}
+return pointermid;};DiffMatchPatch.prototype.diffCommonSuffix=function(text1,text2){var pointermid,pointermax,pointermin,pointerend;if(!text1||!text2||text1.charAt(text1.length-1)!==text2.charAt(text2.length-1)){return 0;}
+pointermin=0;pointermax=Math.min(text1.length,text2.length);pointermid=pointermax;pointerend=0;while(pointermin<pointermid){if(text1.substring(text1.length-pointermid,text1.length-pointerend)===text2.substring(text2.length-pointermid,text2.length-pointerend)){pointermin=pointermid;pointerend=pointermin;}else{pointermax=pointermid;}
+pointermid=Math.floor((pointermax-pointermin)/2+pointermin);}
+return pointermid;};/**/
+DiffMatchPatch.prototype.diffCompute=function(text1,text2,checklines,deadline){var diffs,longtext,shorttext,i,hm,text1A,text2A,text1B,text2B,midCommon,diffsA,diffsB;if(!text1){return[[DIFF_INSERT,text2]];}
+if(!text2){return[[DIFF_DELETE,text1]];}
+longtext=text1.length>text2.length?text1:text2;shorttext=text1.length>text2.length?text2:text1;i=longtext.indexOf(shorttext);if(i!==-1){diffs=[[DIFF_INSERT,longtext.substring(0,i)],[DIFF_EQUAL,shorttext],[DIFF_INSERT,longtext.substring(i+shorttext.length)]];if(text1.length>text2.length){diffs[0][0]=diffs[2][0]=DIFF_DELETE;}
+return diffs;}
+if(shorttext.length===1){return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]];}
+hm =this.diffHalfMatch(text1,text2);if(hm){text1A=hm[0];text1B=hm[1];text2A=hm[2];text2B=hm[3];midCommon=hm[4];diffsA=this.DiffMain(text1A,text2A,checklines,deadline);diffsB=this.DiffMain(text1B,text2B,checklines,deadline);return diffsA.concat([[DIFF_EQUAL,midCommon]],diffsB);}
+if(checklines&&text1.length>100&&text2.length>100){return this.diffLineMode(text1,text2,deadline);}
+return this.diffBisect(text1,text2,deadline);};DiffMatchPatch.prototype.diffHalfMatch=function(text1,text2){var longtext,shorttext,dmp,text1A,text2B,text2A,text1B,midCommon,hm1,hm2,hm;if(this.DiffTimeout<=0){return null;}
+longtext=text1.length>text2.length?text1:text2;shorttext=text1.length>text2.length?text2:text1;if(longtext.length<4||shorttext.length*2<longtext.length){return null;}
+dmp=this;/**/
+function diffHalfMatchI(longtext,shorttext,i){var seed,j,bestCommon,prefixLength,suffixLength,bestLongtextA,bestLongtextB,bestShorttextA,bestShorttextB;seed=longtext.substring(i,i+Math.floor(longtext.length/4));j=-1;bestCommon="";while((j=shorttext.indexOf(seed,j+1))!==-1){prefixLength=dmp.diffCommonPrefix(longtext.substring(i),shorttext.substring(j));suffixLength=dmp.diffCommonSuffix(longtext.substring(0,i),shorttext.substring(0,j));if(bestCommon.length<suffixLength+prefixLength){bestCommon=shorttext.substring(j-suffixLength,j)+
+shorttext.substring(j,j+prefixLength);bestLongtextA=longtext.substring(0,i-suffixLength);bestLongtextB=longtext.substring(i+prefixLength);bestShorttextA=shorttext.substring(0,j-suffixLength);bestShorttextB=shorttext.substring(j+prefixLength);}}
+if(bestCommon.length*2>=longtext.length){return[bestLongtextA,bestLongtextB,bestShorttextA,bestShorttextB,bestCommon
+];}else{return null;}}
+hm1=diffHalfMatchI(longtext,shorttext,Math.ceil(longtext.length/4));hm2=diffHalfMatchI(longtext,shorttext,Math.ceil(longtext.length/2));if(!hm1&&!hm2){return null;}else if(!hm2){hm=hm1;}else if(!hm1){hm=hm2;}else{hm=hm1[4].length>hm2[4].length?hm1:hm2;}
+text1A,text1B,text2A,text2B;if(text1.length>text2.length){text1A=hm[0];text1B=hm[1];text2A=hm[2];text2B=hm[3];}else{text2A=hm[0];text2B=hm[1];text1A=hm[2];text1B=hm[3];}
+midCommon=hm[4];return[text1A,text1B,text2A,text2B,midCommon];};DiffMatchPatch.prototype.diffLineMode=function(text1,text2,deadline){var a,diffs,linearray,pointer,countInsert,countDelete,textInsert,textDelete,j;a=this.diffLinesToChars(text1,text2);text1=a.chars1;text2=a.chars2;linearray=a.lineArray;diffs=this.DiffMain(text1,text2,false,deadline);
+this.diffCharsToLines(diffs,linearray);this.diffCleanupSemantic(diffs);diffs.push([DIFF_EQUAL,""]);pointer=0;countDelete=0;countInsert=0;textDelete="";textInsert="";while(pointer<diffs.length){switch(diffs[pointer][0]){case DIFF_INSERT:countInsert++;textInsert+=diffs[pointer][1];break;case DIFF_DELETE:countDelete++;textDelete+=diffs[pointer][1];break;case DIFF_EQUAL:if(countDelete>=1&&countInsert>=1){diffs.splice(pointer-countDelete-countInsert,countDelete+countInsert);pointer=pointer-countDelete-countInsert;a=this.DiffMain(textDelete,textInsert,false,deadline);for(j=a.length-1;j>=0;j--){diffs.splice(pointer,0,a[j]);}
+pointer=pointer+a.length;}
+countInsert=0;countDelete=0;textDelete="";textInsert="";break;}
+pointer++;}
+diffs.pop();return diffs;};DiffMatchPatch.prototype.diffBisect=function(text1,text2,deadline){var text1Length,text2Length,maxD,vOffset,vLength,v1,v2,x,delta,front,k1start,k1end,k2start,k2end,k2Offset,k1Offset,x1,x2,y1,y2,d,k1,k2;text1Length=text1.length;text2Length=text2.length;maxD=Math.ceil((text1Length+text2Length)/2);vOffset=maxD;vLength=2*maxD;v1=new Array(vLength);v2=new Array(vLength);for(x=0;x<vLength;x++){v1[x]=-1;v2[x]=-1;}
+ v1[vOffset+1]=0;v2[vOffset+1]=0;delta=text1Length-text2Length;front=(delta%2!==0);k1start=0;k1end=0;k2start=0;k2end=0;for(d=0;d<maxD;d++){if((new Date()).getTime()>deadline){break;}
+for(k1=-d+k1start;k1<=d-k1end;k1+=2){k1Offset=vOffset+k1;if(k1===-d||(k1!==d&&v1[k1Offset-1]<v1[k1Offset+1])){x1=v1[k1Offset+1];}else{x1=v1[k1Offset-1]+1;}
+y1=x1-k1;while(x1<text1Length&&y1<text2Length&&text1.charAt(x1)===text2.charAt(y1)){x1++;y1++;}
+v1[k1Offset]=x1;if(x1>text1Length){k1end+=2;}else if(y1>text2Length){k1start+=2;}else if(front){k2Offset=vOffset+delta-k1;if(k2Offset>=0&&k2Offset<vLength&&v2[k2Offset]!==-1){x2=text1Length-v2[k2Offset];if(x1>=x2){return this.diffBisectSplit(text1,text2,x1,y1,deadline);}}
+}}
+for(k2=-d+k2start;k2<=d-k2end;k2+=2){k2Offset=vOffset+k2;if(k2===-d||(k2!==d&&v2[k2Offset-1]<v2[k2Offset+1])){x2=v2[k2Offset+1];}else{x2=v2[k2Offset-1]+1;}
+y2=x2-k2;while(x2<text1Length&&y2<text2Length&&text1.charAt(text1Length-x2-1)===text2.charAt(text2Length-y2-1)){x2++;y2++;}
+v2[k2Offset]=x2;if(x2>text1Length){k2end+=2;}else if(y2>text2Length){k2start+=2;}else if(!front){k1Offset=vOffset+delta-k2;if(k1Offset>=0&&k1Offset<vLength&&v1[k1Offset]!==-1){x1=v1[k1Offset];y1=vOffset+x1-k1Offset;x2=text1Length-x2;if(x1>=x2){return this.diffBisectSplit(text1,text2,x1,y1,deadline);}}}}}
+return[[DIFF_DELETE,text1],[DIFF_INSERT,text2]];};/**/
+DiffMatchPatch.prototype.diffBisectSplit=function(text1,text2,x,y,deadline){var text1a,text1b,text2a,text2b,diffs,diffsb;text1a=text1.substring(0,x);text2a=text2.substring(0,y);text1b=text1.substring(x);text2b=text2.substring(y);diffs=this.DiffMain(text1a,text2a,false,deadline);diffsb=this.DiffMain(text1b,text2b,false,deadline);return diffs.concat(diffsb);};DiffMatchPatch.prototype.diffCleanupSemantic=function(diffs){var changes,equalities,equalitiesLength,lastequality,pointer,lengthInsertions2,lengthDeletions2,lengthInsertions1,lengthDeletions1,deletion,insertion,overlapLength1,overlapLength2;changes=false;equalities=[];equalitiesLength=0;lastequality=null;pointer=0;lengthInsertions1=0;lengthDeletions1=0;lengthInsertions2=0;lengthDeletions2=0;while(pointer<diffs.length){if(diffs[pointer][0]===DIFF_EQUAL){equalities[equalitiesLength++]=pointer;lengthInsertions1=lengthInsertions2;lengthDeletions1=lengthDeletions2;lengthInsertions2=0;lengthDeletions2=0;lastequality=diffs[pointer][1];}else{if(diffs[pointer][0]===DIFF_INSERT){lengthInsertions2+=diffs[pointer][1].length;}else{lengthDeletions2+=diffs[pointer][1].length;}
+if(lastequality&&(lastequality.length<=Math.max(lengthInsertions1,lengthDeletions1))&&(lastequality.length<=Math.max(lengthInsertions2,lengthDeletions2))){diffs.splice(equalities[equalitiesLength-1],0,[DIFF_DELETE,lastequality]);diffs[equalities[equalitiesLength-1]+1][0]=DIFF_INSERT;equalitiesLength--;equalitiesLength--;pointer=equalitiesLength>0?equalities[equalitiesLength-1]:-1;lengthInsertions1=0;lengthDeletions1=0;lengthInsertions2=0;lengthDeletions2=0;lastequality=null;changes=true;}}
+pointer++;}
+if(changes){this.diffCleanupMerge(diffs);}
+pointer=1;while(pointer<diffs.length){if(diffs[pointer-1][0]===DIFF_DELETE&&diffs[pointer][0]===DIFF_INSERT){deletion=diffs[pointer-1][1];insertion=diffs[pointer][1];overlapLength1=this.diffCommonOverlap(deletion,insertion);overlapLength2=this.diffCommonOverlap(insertion,deletion);if(overlapLength1>=overlapLength2){if(overlapLength1>=deletion.length/2||overlapLength1>=insertion.length/2){diffs.splice(pointer,0,[DIFF_EQUAL,insertion.substring(0,overlapLength1)]);diffs[pointer-1][1]=deletion.substring(0,deletion.length-overlapLength1);diffs[pointer+1][1]=insertion.substring(overlapLength1);pointer++;}}else{if(overlapLength2>=deletion.length/2||overlapLength2>=insertion.length/2){diffs.splice(pointer,0,[DIFF_EQUAL,deletion.substring(0,overlapLength2)]);diffs[pointer-1][0]=DIFF_INSERT;diffs[pointer-1][1]=insertion.substring(0,insertion.length-overlapLength2);diffs[pointer+1][0]=DIFF_DELETE;diffs[pointer+1][1]=deletion.substring(overlapLength2);pointer++;}}
+pointer++;}
+pointer++;}};DiffMatchPatch.prototype.diffCommonOverlap=function(text1,text2){var text1Length,text2Length,textLength,best,length,pattern,found;text1Length=text1.length;text2Length=text2.length;if(text1Length===0||text2Length===0){return 0;}
+if(text1Length>text2Length){text1=text1.substring(text1Length-text2Length);}else if(text1Length<text2Length){ text2=text2.substring(0,text1Length);}
+textLength=Math.min(text1Length,text2Length);if(text1===text2){return textLength;}
+best=0;length=1;while(true){pattern=text1.substring(textLength-length);found=text2.indexOf(pattern);if(found===-1){return best;}
+length+=found;if(found===0||text1.substring(textLength-length)===text2.substring(0,length)){best=length;length++;}}};/**/
+DiffMatchPatch.prototype.diffLinesToChars=function(text1,text2){var lineArray,lineHash,chars1,chars2;lineArray=[];lineHash={};lineArray[0]="";function diffLinesToCharsMunge(text){var chars,lineStart,lineEnd,lineArrayLength,line;chars="";lineStart=0;lineEnd=-1;lineArrayLength=lineArray.length;while(lineEnd<text.length-1){lineEnd=text.indexOf("\n",lineStart);if(lineEnd===-1){lineEnd=text.length-1;}
+line=text.substring(lineStart,lineEnd+1);lineStart=lineEnd+1;if(lineHash.hasOwnProperty?lineHash.hasOwnProperty(line):(lineHash[line]!==undefined)){chars+=String.fromCharCode(lineHash[line]);}else{chars+=String.fromCharCode(lineArrayLength);lineHash[line]=lineArrayLength;lineArray[lineArrayLength++]=line;}}
+return chars;}
+chars1=diffLinesToCharsMunge(text1);chars2=diffLinesToCharsMunge(text2);return{chars1:chars1,chars2:chars2,lineArray:lineArray};};DiffMatchPatch.prototype.diffCharsToLines=function(diffs,lineArray){var x,chars,text,y;for(x=0;x<diffs.length;x++){chars=diffs[x][1];text=[];for(y=0;y<chars.length;y++){text[y]=lineArray[chars.charCodeAt(y)];}
+diffs[x][1]=text.join("");}};DiffMatchPatch.prototype.diffCleanupMerge=function(diffs){var pointer,countDelete,countInsert,textInsert,textDelete,commonlength,changes;diffs.push([DIFF_EQUAL,""]);pointer=0;countDelete=0;countInsert=0;textDelete="";textInsert="";commonlength;while(pointer<diffs.length){switch(diffs[pointer][0]){case DIFF_INSERT:countInsert++;textInsert+=diffs[pointer][1];pointer++;break;case DIFF_DELETE:countDelete++;textDelete+=diffs[pointer][1];pointer++;break;case DIFF_EQUAL:if(countDelete+countInsert>1){if(countDelete!==0&&countInsert!==0){commonlength=this.diffCommonPrefix(textInsert,textDelete);if(commonlength!==0){if((pointer-countDelete-countInsert)>0&&diffs[pointer-countDelete-countInsert-1][0]===
+ DIFF_EQUAL){diffs[pointer-countDelete-countInsert-1][1]+=textInsert.substring(0,commonlength);}else{diffs.splice(0,0,[DIFF_EQUAL,textInsert.substring(0,commonlength)]);pointer++;}
+textInsert=textInsert.substring(commonlength);textDelete=textDelete.substring(commonlength);}
+commonlength=this.diffCommonSuffix(textInsert,textDelete);if(commonlength!==0){diffs[pointer][1]=textInsert.substring(textInsert.length-
+commonlength)+diffs[pointer][1];textInsert=textInsert.substring(0,textInsert.length-
+commonlength);textDelete=textDelete.substring(0,textDelete.length-
+commonlength);}}
+if(countDelete===0){diffs.splice(pointer-countInsert,countDelete+countInsert,[DIFF_INSERT,textInsert]);}else if(countInsert===0){diffs.splice(pointer-countDelete,countDelete+countInsert,[DIFF_DELETE,textDelete]);}else{diffs.splice(pointer-countDelete-countInsert, countDelete+countInsert,[DIFF_DELETE,textDelete],[DIFF_INSERT,textInsert]);}
+pointer=pointer-countDelete-countInsert+(countDelete?1:0)+(countInsert?1:0)+1;}else if(pointer!==0&&diffs[pointer-1][0]===DIFF_EQUAL){diffs[pointer-1][1]+=diffs[pointer][1];diffs.splice(pointer,1);}else{pointer++;}
+countInsert=0;countDelete=0;textDelete="";textInsert="";break;}}
+if(diffs[diffs.length-1][1]===""){diffs.pop();}
+changes=false;pointer=1;while(pointer<diffs.length-1){if(diffs[pointer-1][0]===DIFF_EQUAL&&diffs[pointer+1][0]===DIFF_EQUAL){if(diffs[pointer][1].substring(diffs[pointer][1].length-
+diffs[pointer-1][1].length)===diffs[pointer-1][1]){diffs[pointer][1]=diffs[pointer-1][1]+
+diffs[pointer][1].substring(0,diffs[pointer][1].length-
+diffs[pointer-1][1].length);diffs[pointer+1][1]=diffs[pointer-1][1]+diffs[pointer+1][1];diffs.splice(pointer-1,1);changes=true;}else if(diffs[pointer][1].substring(0,diffs[pointer+1][1].length)===diffs[pointer+1][1]){diffs[pointer-1][1]+=diffs[pointer+1][1];diffs[pointer][1]=diffs[pointer][1].substring(diffs[pointer+1][1].length)+
+diffs[pointer+1][1];diffs.splice(pointer+1,1);changes=true;}}
+pointer++;}
+if(changes){this.diffCleanupMerge(diffs);}};return function(o,n){var diff,output,text;diff=new DiffMatchPatch();output=diff.DiffMain(o,n);diff.diffCleanupEfficiency(output);text=diff.diffPrettyHtml(output);return text;};}());//
+(function(){QUnit.init=function(){var tests,banner,result,qunit,config=QUnit.config;config.stats={all:0,bad:0};config.moduleStats={all:0,bad:0};config.started=0;config.updateRate=1000;config.blocking=false;config.autostart=true;config.autorun=false;config.filter="";config.queue=[];if(typeof window==="undefined"){return;}
+qunit=id("qunit");if(qunit){qunit.innerHTML="<h1 id='qunit-header'>"+escapeText(document.title)+"</h1>"+
+"<h2 id='qunit-banner'></h2>"+
+"<div id='qunit-testrunner-toolbar'></div>"+
+"<h2 id='qunit-userAgent'></h2>"+
+"<ol id='qunit-tests'></ol>";}
+tests=id("qunit-tests");banner=id("qunit-banner");result=id("qunit-testresult");if(tests){tests.innerHTML="";}
+if(banner){banner.className="";}
+if(result){result.parentNode.removeChild(result);}
+if(tests){result=document.createElement("p");result.id="qunit-testresult";result.className="result";tests.parentNode.insertBefore(result,tests);result.innerHTML="Running...<br />&#160;";}};if(typeof window==="undefined"){return;}
+var config=QUnit.config,hasOwn=Object.prototype.hasOwnProperty,defined={document:window.document!==undefined,sessionStorage:(function(){var x="qunit-test-string";try{sessionStorage.setItem(x,x);sessionStorage.removeItem(x);return true;}catch(e){return false;}}())},modulesList=[];function escapeText(s){if(!s){return "";}
+s=s+"";return s.replace(/['"<>&]/g,function(s){switch(s){case "'":return "&#039;";case "\"":return "&quot;";case "<":return "&lt;";case ">":return "&gt;";case "&":return "&amp;";}});}
+function addEvent(elem,type,fn){if(elem.addEventListener){elem.addEventListener(type,fn,false);}else if(elem.attachEvent){elem.attachEvent("on"+type,function(){var event=window.event;if(!event.target){event.target=event.srcElement||document;}
+fn.call(elem,event);});}}
+function addEvents(elems,type,fn){var i=elems.length;while(i--){addEvent(elems[i],type,fn);}}
+function hasClass(elem,name){return(" "+elem.className+" ").indexOf(" "+name+" ")>=0;}
+function addClass(elem,name){if(!hasClass(elem,name)){elem.className+=(elem.className?" ":"")+name;}}
+function toggleClass(elem,name){if(hasClass(elem,name)){removeClass(elem,name);}else{addClass(elem,name);}}
+function removeClass(elem,name){var set=" "+elem.className+" ";while(set.indexOf(" "+name+" ")>=0){set=set.replace(" "+name+" "," ");}
+elem.className=typeof set.trim==="function"?set.trim():set.replace(/^\s+|\s+$/g,"");}
+function id(name){return defined.document&&document.getElementById&&document.getElementById(name);}
+function getUrlConfigHtml(){var i,j,val,escaped,escapedTooltip,selection=false,len=config.urlConfig.length,urlConfigHtml="";for(i=0;i<len;i++){val=config.urlConfig[i];if(typeof val==="string"){val={id:val,label:val};}
+escaped=escapeText(val.id);escapedTooltip=escapeText(val.tooltip);if(config[val.id]===undefined){config[val.id]=QUnit.urlParams[val.id];}
+if(!val.value||typeof val.value==="string"){urlConfigHtml+="<input id='qunit-urlconfig-"+escaped+
+"' name='"+escaped+"' type='checkbox'"+(val.value?" value='"+escapeText(val.value)+"'":"")+(config[val.id]?" checked='checked'":"")+
+" title='"+escapedTooltip+"' /><label for='qunit-urlconfig-"+escaped+
+"' title='"+escapedTooltip+"'>"+val.label+"</label>";}else{urlConfigHtml+="<label for='qunit-urlconfig-"+escaped+
+"' title='"+escapedTooltip+"'>"+val.label+
+": </label><select id='qunit-urlconfig-"+escaped+
+"' name='"+escaped+"' title='"+escapedTooltip+"'><option></option>";if(QUnit.is("array",val.value)){for(j=0;j<val.value.length;j++){escaped=escapeText(val.value[j]);urlConfigHtml+="<option value='"+escaped+"'"+(config[val.id]===val.value[j]?(selection=true)&&" selected='selected'":"")+
+">"+escaped+"</option>";}}else{for(j in val.value){if(hasOwn.call(val.value,j)){urlConfigHtml+="<option value='"+escapeText(j)+"'"+(config[val.id]===j?(selection=true)&&" selected='selected'":"")+
+">"+escapeText(val.value[j])+"</option>";}}}
+if(config[val.id]&&!selection){escaped=escapeText(config[val.id]);urlConfigHtml+="<option value='"+escaped+
+"' selected='selected' disabled='disabled'>"+escaped+"</option>";}
+urlConfigHtml+="</select>";}}
+return urlConfigHtml;}
+function toolbarChanged(){var updatedUrl,value,field=this,params={};//
+if("selectedIndex" in field){value=field.options[field.selectedIndex].value||undefined;}else{value=field.checked?(field.defaultValue||true):undefined;}
+params[field.name]=value;updatedUrl=setUrl(params);if("hidepassed"===field.name&&"replaceState" in window.history){config[field.name]=value||false;if(value){addClass(id("qunit-tests"),"hidepass");}else{removeClass(id("qunit-tests"),"hidepass");}
+window.history.replaceState(null,"",updatedUrl);}else{window.location=updatedUrl;}}
+function setUrl(params){var key,querystring="?";params=QUnit.extend(QUnit.extend({},QUnit.urlParams),params);for(key in params){if(hasOwn.call(params,key)){if(params[key]===undefined){continue;}
+querystring+=encodeURIComponent(key);if(params[key]!==true){querystring+="="+encodeURIComponent(params[key]);}
+querystring+="&";}}
+return location.protocol+"//"+location.host+
+location.pathname+querystring.slice(0,-1);}
+function applyUrlParams(){var selectedModule,modulesList=id("qunit-modulefilter"),filter=id("qunit-filter-input").value;selectedModule=modulesList?decodeURIComponent(modulesList.options[modulesList.selectedIndex].value):undefined;window.location=setUrl({module:(selectedModule==="")?undefined:selectedModule,filter:(filter==="")?undefined:filter,testId:undefined});}
+function toolbarUrlConfigContainer(){var urlConfigContainer=document.createElement("span");urlConfigContainer.innerHTML=getUrlConfigHtml();addClass(urlConfigContainer,"qunit-url-config");addEvents(urlConfigContainer.getElementsByTagName("input"),"click",toolbarChanged);addEvents(urlConfigContainer.getElementsByTagName("select"),"change",toolbarChanged);return urlConfigContainer;}
+function toolbarLooseFilter(){var filter=document.createElement("form"),label=document.createElement("label"),input=document.createElement("input"),button=document.createElement("button");addClass(filter,"qunit-filter");label.innerHTML="Filter: ";input.type="text";input.value=config.filter||"";input.name="filter";input.id="qunit-filter-input";button.innerHTML="Go";label.appendChild(input);filter.appendChild(label);filter.appendChild(button);addEvent(filter,"submit",function(ev){applyUrlParams();if(ev&&ev.preventDefault){ev.preventDefault();}
+return false;});return filter;}
+function toolbarModuleFilterHtml(){var i,moduleFilterHtml="";if(!modulesList.length){return false;}
+modulesList.sort(function(a,b){return a.localeCompare(b);});moduleFilterHtml+="<label for='qunit-modulefilter'>Module: </label>"+
+"<select id='qunit-modulefilter' name='modulefilter'><option value='' "+(QUnit.urlParams.module===undefined?"selected='selected'":"")+
+">< All Modules ></option>";for(i=0;i<modulesList.length;i++){moduleFilterHtml+="<option value='"+
+escapeText(encodeURIComponent(modulesList[i]))+"' "+(QUnit.urlParams.module===modulesList[i]?"selected='selected'":"")+
+">"+escapeText(modulesList[i])+"</option>";}
+moduleFilterHtml+="</select>";return moduleFilterHtml;}
+function toolbarModuleFilter(){var toolbar=id("qunit-testrunner-toolbar"),moduleFilter=document.createElement("span"),moduleFilterHtml=toolbarModuleFilterHtml();if(!toolbar||!moduleFilterHtml){return false;}
+moduleFilter.setAttribute("id","qunit-modulefilter-container");moduleFilter.innerHTML=moduleFilterHtml;addEvent(moduleFilter.lastChild,"change",applyUrlParams);toolbar.appendChild(moduleFilter);}
+function appendToolbar(){var toolbar=id("qunit-testrunner-toolbar");if(toolbar){toolbar.appendChild(toolbarUrlConfigContainer());toolbar.appendChild(toolbarLooseFilter());}}
+function appendHeader(){var header=id("qunit-header");if(header){header.innerHTML="<a href='"+
+setUrl({filter:undefined,module:undefined,testId:undefined})+
+"'>"+header.innerHTML+"</a> ";}}
+function appendBanner(){var banner=id("qunit-banner");if(banner){banner.className="";}}
+function appendTestResults(){var tests=id("qunit-tests"),result=id("qunit-testresult");if(result){result.parentNode.removeChild(result);}
+if(tests){tests.innerHTML="";result=document.createElement("p");result.id="qunit-testresult";result.className="result";tests.parentNode.insertBefore(result,tests);result.innerHTML="Running...<br />&#160;";}}
+function storeFixture(){var fixture=id("qunit-fixture");if(fixture){config.fixture=fixture.innerHTML;}}
+function appendUserAgent(){var userAgent=id("qunit-userAgent");if(userAgent){userAgent.innerHTML="";userAgent.appendChild(document.createTextNode("QUnit "+QUnit.version+"; "+navigator.userAgent));}}
+function appendTestsList(modules){var i,l,x,z,test,moduleObj;for(i=0,l=modules.length;i<l;i++){moduleObj=modules[i];if(moduleObj.name){modulesList.push(moduleObj.name);}
+for(x=0,z=moduleObj.tests.length;x<z;x++){test=moduleObj.tests[x];appendTest(test.name,test.testId,moduleObj.name);}}}
+function appendTest(name,testId,moduleName){var title,rerunTrigger,testBlock,assertList,tests=id("qunit-tests");if(!tests){return;}
+title=document.createElement("strong");title.innerHTML=getNameHtml(name,moduleName);rerunTrigger=document.createElement("a");rerunTrigger.innerHTML="Rerun";rerunTrigger.href=setUrl({testId:testId});testBlock=document.createElement("li");testBlock.appendChild(title);testBlock.appendChild(rerunTrigger);testBlock.id="qunit-test-output-"+testId;assertList=document.createElement("ol");assertList.className="qunit-assert-list";testBlock.appendChild(assertList);tests.appendChild(testBlock);}
+QUnit.begin(function(details){var qunit=id("qunit");storeFixture();if(qunit){qunit.innerHTML="<h1 id='qunit-header'>"+escapeText(document.title)+"</h1>"+
+"<h2 id='qunit-banner'></h2>"+
+"<div id='qunit-testrunner-toolbar'></div>"+
+"<h2 id='qunit-userAgent'></h2>"+
+"<ol id='qunit-tests'></ol>";}
+appendHeader();appendBanner();appendTestResults();appendUserAgent();appendToolbar();appendTestsList(details.modules);toolbarModuleFilter();if(qunit&&config.hidepassed){addClass(qunit.lastChild,"hidepass");}});QUnit.done(function(details){var i,key,banner=id("qunit-banner"),tests=id("qunit-tests"),html=["Tests completed in ",details.runtime," milliseconds.<br />","<span class='passed'>",details.passed,"</span> assertions of <span class='total'>",details.total,"</span> passed, <span class='failed'>",details.failed,"</span> failed."].join("");if(banner){banner.className=details.failed?"qunit-fail":"qunit-pass";}
+if(tests){id("qunit-testresult").innerHTML=html;}
+if(config.altertitle&&defined.document&&document.title){document.title=[(details.failed?"\u2716":"\u2714"),document.title.replace(/^[\u2714\u2716] /i,"")].join(" ");}
+if(config.reorder&&defined.sessionStorage&&details.failed===0){for(i=0;i<sessionStorage.length;i++){key=sessionStorage.key(i++);if(key.indexOf("qunit-test-")===0){sessionStorage.removeItem(key);}}}
+if(config.scrolltop&&window.scrollTo){window.scrollTo(0,0);}});function getNameHtml(name,module){var nameHtml="";if(module){nameHtml="<span class='module-name'>"+escapeText(module)+"</span>: ";}
+nameHtml+="<span class='test-name'>"+escapeText(name)+"</span>";return nameHtml;}
+QUnit.testStart(function(details){var running,testBlock,bad;testBlock=id("qunit-test-output-"+details.testId);if(testBlock){testBlock.className="running";}else{appendTest(details.name,details.testId,details.module);}
+running=id("qunit-testresult");if(running){bad=QUnit.config.reorder&&defined.sessionStorage&&+sessionStorage.getItem("qunit-test-"+details.module+"-"+details.name);running.innerHTML=(bad?"Rerunning previously failed test: <br />":"Running: <br />")+
+getNameHtml(details.name,details.module);}});QUnit.log(function(details){var assertList,assertLi,message,expected,actual,testItem=id("qunit-test-output-"+details.testId);if(!testItem){return;}
+message=escapeText(details.message)||(details.result?"okay":"failed");message="<span class='test-message'>"+message+"</span>";message+="<span class='runtime'>@ "+details.runtime+" ms</span>";if(!details.result&&hasOwn.call(details,"expected")){expected=escapeText(QUnit.dump.parse(details.expected));actual=escapeText(QUnit.dump.parse(details.actual));message+="<table><tr class='test-expected'><th>Expected: </th><td><pre>"+
+expected+
+"</pre></td></tr>";if(actual!==expected){message+="<tr class='test-actual'><th>Result: </th><td><pre>"+
+actual+"</pre></td></tr>"+
+"<tr class='test-diff'><th>Diff: </th><td><pre>"+
+QUnit.diff(expected,actual)+"</pre></td></tr>";}else{if(expected.indexOf("[object Array]")!==-1||expected.indexOf("[object Object]")!==-1){message+="<tr class='test-message'><th>Message: </th><td>"+
+"Diff suppressed as the depth of object is more than current max depth ("+
+QUnit.config.maxDepth+").<p>Hint: Use <code>QUnit.dump.maxDepth</code> to "+
+" run with a higher max depth or <a href='"+setUrl({maxDepth:-1})+"'>"+
+"Rerun</a> without max depth.</p></td></tr>";}}
+if(details.source){message+="<tr class='test-source'><th>Source: </th><td><pre>"+
+escapeText(details.source)+"</pre></td></tr>";}
+message+="</table>";}else if(!details.result&&details.source){message+="<table>"+
+"<tr class='test-source'><th>Source: </th><td><pre>"+
+escapeText(details.source)+"</pre></td></tr>"+
+"</table>";}
+assertList=testItem.getElementsByTagName("ol")[0];assertLi=document.createElement("li");assertLi.className=details.result?"pass":"fail";assertLi.innerHTML=message;assertList.appendChild(assertLi);});QUnit.testDone(function(details){var testTitle,time,testItem,assertList,good,bad,testCounts,skipped,tests=id("qunit-tests");if(!tests){return;}
+testItem=id("qunit-test-output-"+details.testId);assertList=testItem.getElementsByTagName("ol")[0];good=details.passed;bad=details.failed;if(config.reorder&&defined.sessionStorage){if(bad){sessionStorage.setItem("qunit-test-"+details.module+"-"+details.name,bad);}else{sessionStorage.removeItem("qunit-test-"+ details.module+"-"+details.name);}}
+if(bad===0){addClass(assertList,"qunit-collapsed");}
+testTitle=testItem.firstChild;testCounts=bad?"<b class='failed'>"+bad+"</b>, "+"<b class='passed'>"+good+"</b>, ":"";testTitle.innerHTML+=" <b class='counts'>("+testCounts+
+details.assertions.length+")</b>";if(details.skipped){testItem.className="skipped";skipped=document.createElement("em");skipped.className="qunit-skipped-label";skipped.innerHTML="skipped";testItem.insertBefore(skipped,testTitle);}else{addEvent(testTitle,"click",function(){toggleClass(assertList,"qunit-collapsed");});testItem.className=bad?"fail":"pass";time=document.createElement("span");time.className="runtime";time.innerHTML=details.runtime+" ms";testItem.insertBefore(time,assertList);}});if(defined.document){if(document.readyState==="complete"){QUnit.load();}else{addEvent(window,"load",QUnit.load);}}else{config.pageLoaded=true;config.autorun=true;}})(); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js b/poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js
new file mode 100644
index 000000000..604db5f03
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/recipedetails.js
@@ -0,0 +1,51 @@
+"use strict";
+
+function recipeDetailsPageInit(ctx){
+
+ $(".customise-btn").click(function(e){
+ e.preventDefault();
+ var imgCustomModal = $("#new-custom-image-modal");
+
+ if (imgCustomModal.length === 0)
+ throw("Modal new-custom-image not found");
+
+ var recipe = {id: $(this).data('recipe'), name: null}
+ newCustomImageModalSetRecipes([recipe]);
+ imgCustomModal.modal('show');
+ });
+
+ $("#add-layer-btn").click(function(){
+ var btn = $(this);
+
+ libtoaster.addRmLayer(ctx.recipe.layer_version,
+ true,
+ function (layersList){
+ var msg = libtoaster.makeLayerAddRmAlertMsg(ctx.recipe.layer_version,
+ layersList,
+ true);
+
+ libtoaster.showChangeNotification(msg);
+
+ var toShow = $("#customise-build-btns");
+
+ /* If we have no packages built yet also fade in the build packages
+ * hint message
+ */
+ if (ctx.recipe.totalPackages === 0){
+ toShow = toShow.add("#build-to-get-packages-msg");
+ }
+
+ $("#packages-alert").add(btn).fadeOut(function(){
+ toShow.fadeIn();
+ });
+ });
+ });
+
+ /* Trigger a build of your custom image */
+ $(".build-recipe-btn").click(function(){
+ libtoaster.startABuild(null, ctx.recipe.name,
+ function(){
+ window.location.replace(libtoaster.ctx.projectBuildsUrl);
+ });
+ });
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/table.js b/poky/bitbake/lib/toaster/toastergui/static/js/table.js
new file mode 100644
index 000000000..abcb5ca7a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -0,0 +1,857 @@
+'use strict';
+
+function tableInit(ctx){
+
+ if (ctx.url.length === 0) {
+ throw "No url supplied for retreiving data";
+ }
+
+ var tableChromeDone = false;
+ var tableTotal = 0;
+
+ var tableParams = {
+ limit : 25,
+ page : 1,
+ orderby : null,
+ filter : null,
+ search : null,
+ default_orderby: null,
+ };
+
+ var defaultHiddenCols = [];
+
+ var table = $("#" + ctx.tableName);
+
+ /* if we're loading clean from a url use it's parameters as the default */
+ var urlParams = libtoaster.parseUrlParams();
+
+ /* Merge the tableParams and urlParams object properties */
+ tableParams = $.extend(tableParams, urlParams);
+
+ /* Now fix the types that .extend changed for us */
+ tableParams.limit = Number(tableParams.limit);
+ tableParams.page = Number(tableParams.page);
+
+ loadData(tableParams);
+
+ // clicking on this set of elements removes the search
+ var clearSearchElements = $('.remove-search-btn-'+ctx.tableName +
+ ', .show-all-'+ctx.tableName);
+
+ function loadData(tableParams){
+ table.trigger("table-loading");
+
+ $.ajax({
+ type: "GET",
+ url: ctx.url,
+ data: tableParams,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function(tableData) {
+ updateTable(tableData);
+ window.history.replaceState(null, null,
+ libtoaster.dumpsUrlParams(tableParams));
+ }
+ });
+ }
+
+ function updateTable(tableData) {
+ var tableBody = table.children("tbody");
+ var pagination = $('#pagination-'+ctx.tableName);
+ var paginationBtns = pagination.children('ul');
+ var tableContainer = $("#table-container-"+ctx.tableName);
+
+ tableContainer.css("visibility", "hidden");
+ /* To avoid page re-layout flicker when paging set fixed height */
+ table.css("padding-bottom", table.height());
+
+ /* Reset table components */
+ tableBody.html("");
+ paginationBtns.html("");
+
+ if (tableParams.search)
+ clearSearchElements.show();
+ else
+ clearSearchElements.hide();
+
+ $('.table-count-' + ctx.tableName).text(tableData.total);
+ tableTotal = tableData.total;
+
+ if (tableData.total === 0){
+ tableContainer.hide();
+ /* No results caused by a search returning nothing */
+ if (tableParams.search) {
+ if ($("#no-results-special-"+ctx.tableName).length > 0) {
+ /* use this page's special no-results form instead of the default */
+ $("#no-results-search-input-"+ctx.tableName).val(tableParams.search);
+ $("#no-results-special-"+ctx.tableName).show();
+ $("#results-found-"+ctx.tableName).hide();
+ } else {
+ $("#new-search-input-"+ctx.tableName).val(tableParams.search);
+ $("#no-results-"+ctx.tableName).show();
+ }
+ }
+ else {
+ /* No results caused by there being no data */
+ $("#empty-state-"+ctx.tableName).show();
+ }
+ table.trigger("table-done", [tableData.total, tableParams]);
+
+ return;
+ } else {
+ tableContainer.show();
+ $("#no-results-"+ctx.tableName).hide();
+ $("#empty-state-"+ctx.tableName).hide();
+ }
+
+ setupTableChrome(tableData);
+
+ /* Add table data rows */
+ var column_index;
+ for (var i in tableData.rows){
+ /* only display if the column is display-able */
+ var row = $("<tr></tr>");
+ column_index = -1;
+ for (var key_j in tableData.rows[i]){
+ var td = $("<td></td>");
+ td.prop("class", key_j);
+ if (tableData.rows[i][key_j]){
+ td.html(tableData.rows[i][key_j]);
+ }
+ row.append(td);
+ }
+ tableBody.append(row);
+
+ /* If we have layerbtns then initialise them */
+ layerBtnsInit();
+
+ /* If we have popovers initialise them now */
+ $('td > a.btn').popover({
+ html:true,
+ placement:'left',
+ container:'body',
+ trigger:'manual'
+ }).click(function(e){
+ $('td > a.btn').not(this).popover('hide');
+ /* ideally we would use 'toggle' here
+ * but it seems buggy in our Bootstrap version
+ */
+ $(this).popover('show');
+ e.stopPropagation();
+ });
+
+ /* enable help information tooltip */
+ $(".get-help").tooltip({container:'body', html:true, delay:{show:300}});
+ }
+
+ /* Setup the pagination controls */
+
+ var start = tableParams.page - 2;
+ var end = tableParams.page + 2;
+ var numPages = Math.ceil(tableData.total/tableParams.limit);
+
+ if (numPages > 1){
+ if (tableParams.page < 3)
+ end = 5;
+
+ for (var page_i=1; page_i <= numPages; page_i++){
+ if (page_i >= start && page_i <= end){
+ var btn = $('<li><a href="#" class="page">'+page_i+'</a></li>');
+
+ if (page_i === tableParams.page){
+ btn.addClass("active");
+ }
+
+ /* Add the click handler */
+ btn.click(pageButtonClicked);
+ paginationBtns.append(btn);
+ }
+ }
+ }
+
+ loadColumnsPreference();
+
+ table.css("padding-bottom", 0);
+ tableContainer.css("visibility", "visible");
+
+ /* If we have a hash in the url try and highlight that item in the table */
+ if (window.location.hash){
+ var highlight = $("table a[name="+window.location.hash.replace('#',''));
+ if (highlight.length > 0){
+ highlight.parents("tr").addClass('highlight');
+ window.scroll(0, highlight.position().top - 50);
+ }
+ }
+
+ table.trigger("table-done", [tableData.total, tableParams]);
+ }
+
+ function setupTableChrome(tableData){
+ if (tableChromeDone === true)
+ return;
+
+ var tableHeadRow = table.find("thead > tr");
+ var editColMenu = $("#table-chrome-"+ctx.tableName).find(".editcol");
+
+ tableHeadRow.html("");
+ editColMenu.html("");
+
+ tableParams.default_orderby = tableData.default_orderby;
+
+ if (!tableParams.orderby && tableData.default_orderby){
+ tableParams.orderby = tableData.default_orderby;
+ }
+
+ /* Add table header and column toggle menu */
+ var column_edit_entries = [];
+ for (var i in tableData.columns){
+ var col = tableData.columns[i];
+ if (col.displayable === false) {
+ continue;
+ }
+ var header = $("<th></th>");
+ header.prop("class", col.field_name);
+
+ /* Setup the help text */
+ if (col.help_text.length > 0) {
+ var help_text = $('<span class="glyphicon glyphicon-question-sign get-help"> </span>');
+ help_text.tooltip({title: col.help_text});
+ header.append(help_text);
+ }
+
+ /* Setup the orderable title */
+ if (col.orderable) {
+ var title = $('<a href=\"#\" ></a>');
+
+ title.data('field-name', col.field_name);
+ title.attr('data-sort-field', col.field_name);
+ title.text(col.title);
+ title.click(sortColumnClicked);
+
+ header.append(title);
+
+ header.append(' <i class="icon-caret-down" style="display:none"></i>');
+ header.append(' <i class="icon-caret-up" style="display:none"></i>');
+
+ /* If we're currently ordered setup the visual indicator */
+ if (col.field_name === tableParams.orderby ||
+ '-' + col.field_name === tableParams.orderby){
+ header.children("a").addClass("sorted");
+
+ if (tableParams.orderby.indexOf("-") === -1){
+ header.find('.icon-caret-down').show();
+ } else {
+ header.find('.icon-caret-up').show();
+ }
+ }
+
+ if (col.field_name === tableData.default_orderby){
+ title.addClass("default-orderby");
+ }
+
+ } else {
+ /* Not orderable */
+ header.css("font-weight", "normal");
+ header.append('<span class="text-muted">' + col.title + '</span> ');
+ }
+
+ /* Setup the filter button */
+ if (col.filter_name){
+ var filterBtn = $('<a href="#" role="button" data-filter-on="' + col.filter_name + '" class="pull-right btn btn-link btn-xs" data-toggle="modal"><i class="glyphicon glyphicon-filter filtered"></i></a>');
+
+ filterBtn.data('filter-name', col.filter_name);
+ filterBtn.prop('id', col.filter_name);
+ filterBtn.click(filterOpenClicked);
+
+ /* If we're currently being filtered setup the visial indicator */
+ if (tableParams.filter &&
+ tableParams.filter.match('^'+col.filter_name)) {
+
+ filterBtnActive(filterBtn, true);
+ }
+ header.append(filterBtn);
+ }
+
+ /* Done making the header now add it */
+ tableHeadRow.append(header);
+
+ /* Now setup the checkbox state and click handler */
+ var toggler = $('<li><div class="checkbox"><label><input type="checkbox" id="checkbox-'+ col.field_name +'" class="col-toggle" value="'+col.field_name+'" />'+col.title+'</label></div></li>');
+
+ var togglerInput = toggler.find("input");
+
+ togglerInput.attr("checked","checked");
+
+ /* If we can hide the column enable the checkbox action */
+ if (col.hideable){
+ togglerInput.click(colToggleClicked);
+ } else {
+ toggler.find("label").addClass("text-muted");
+ toggler.find("label").parent().addClass("disabled");
+ togglerInput.attr("disabled", "disabled");
+ }
+
+ if (col.hidden) {
+ defaultHiddenCols.push(col.field_name);
+ }
+
+ /* Gather the Edit Column entries */
+ column_edit_entries.push({'title':col.title,'html':toggler});
+
+ } /* End for each column */
+
+ /* Append the sorted Edit Column toggler entries */
+ column_edit_entries.sort(function(a,b) {return (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0);} );
+ for (var col in column_edit_entries){
+ editColMenu.append(column_edit_entries[col].html);
+ }
+
+ tableChromeDone = true;
+ }
+
+ /* Toggles the active state of the filter button */
+ function filterBtnActive(filterBtn, active){
+ if (active) {
+ filterBtn.removeClass("btn-link");
+ filterBtn.addClass("btn-primary");
+
+ filterBtn.tooltip({
+ html: true,
+ title: '<button class="btn btn-sm btn-primary" onClick=\'$("#clear-filter-btn-'+ ctx.tableName +'").click();\'>Clear filter</button>',
+ placement: 'bottom',
+ delay: {
+ hide: 1500,
+ show: 400,
+ },
+ });
+ } else {
+ filterBtn.removeClass("btn-primary");
+ filterBtn.addClass("btn-link");
+ filterBtn.tooltip('destroy');
+ }
+ }
+
+ /* Display or hide table columns based on the cookie preference or defaults */
+ function loadColumnsPreference(){
+ var cookie_data = $.cookie("cols");
+
+ if (cookie_data) {
+ var cols_hidden = JSON.parse($.cookie("cols"));
+
+ /* For each of the columns check if we should hide them
+ * also update the checked status in the Edit columns menu
+ */
+ $("#"+ctx.tableName+" th").each(function(){
+ for (var i in cols_hidden){
+ if ($(this).hasClass(cols_hidden[i])){
+ table.find("."+cols_hidden[i]).hide();
+ $("#checkbox-"+cols_hidden[i]).removeAttr("checked");
+ }
+ }
+ });
+ } else {
+ /* Disable these columns by default when we have no columns
+ * user setting.
+ */
+ for (var i in defaultHiddenCols) {
+ table.find("."+defaultHiddenCols[i]).hide();
+ $("#checkbox-"+defaultHiddenCols[i]).removeAttr("checked");
+ }
+ }
+ }
+
+ /* Apply an ordering to the current table.
+ *
+ * 1. Find the column heading matching the sortSpecifier
+ * 2. Set its up/down arrow and add .sorted
+ *
+ * orderby: e.g. "-started_on", "completed_on"
+ * colHeading: column heading element to activate (by showing the caret
+ * up/down, depending on sort order); if not set, the correct column
+ * heading is selected from the DOM using orderby as a key
+ */
+ function applyOrderby(orderby, colHeading) {
+ if (!orderby) {
+ return;
+ }
+
+ // We only have one sort at a time so remove existing sort indicators
+ $("#" + ctx.tableName + " th .icon-caret-down").hide();
+ $("#" + ctx.tableName + " th .icon-caret-up").hide();
+ $("#" + ctx.tableName + " th a").removeClass("sorted");
+
+ // normalise the orderby so we can use it to find the link we want
+ // to style
+ var fieldName = orderby;
+ if (fieldName.indexOf('-') === 0) {
+ fieldName = fieldName.slice(1);
+ }
+
+ // find the table header element which corresponds to the sort field
+ // (if we don't already have it)
+ if (!colHeading) {
+ colHeading = $('[data-sort-field="' + fieldName + '"]');
+ }
+
+ colHeading.addClass("sorted");
+
+ var parent = colHeading.parent();
+
+ if (orderby.indexOf('-') === 0) {
+ parent.children('.icon-caret-up').show();
+ }
+ else {
+ parent.children('.icon-caret-down').show();
+ }
+
+ tableParams.orderby = orderby;
+ loadData(tableParams);
+ }
+
+ function sortColumnClicked(e){
+ e.preventDefault();
+
+ /* if we're already sorted sort the other way */
+ var orderby = $(this).data('field-name');
+ if (tableParams.orderby === orderby &&
+ tableParams.orderby.indexOf('-') === -1) {
+ orderby = '-' + orderby;
+ }
+
+ applyOrderby(orderby, $(this));
+ }
+
+ function pageButtonClicked(e) {
+ tableParams.page = Number($(this).text());
+ loadData(tableParams);
+ /* Stop page jumps when clicking on # links */
+ e.preventDefault();
+ }
+
+ /* Toggle a table column */
+ function colToggleClicked (){
+ var col = $(this).val();
+ var disabled_cols = [];
+
+ if ($(this).prop("checked")) {
+ table.find("."+col).show();
+ } else {
+ table.find("."+col).hide();
+ // If we're ordered by the column we're hiding remove the order by
+ // and apply the default one instead
+ if (col === tableParams.orderby ||
+ '-' + col === tableParams.orderby){
+ tableParams.orderby = null;
+
+ applyOrderby(tableParams.default_orderby);
+ }
+ }
+
+ /* Update the cookie with the unchecked columns */
+ $(".col-toggle").not(":checked").map(function(){
+ disabled_cols.push($(this).val());
+ });
+
+ $.cookie("cols", JSON.stringify(disabled_cols));
+ }
+
+ /**
+ * Create the DOM/JS for the client side of a TableFilterActionToggle
+ * or TableFilterActionDay
+ *
+ * filterName: (string) internal name for the filter action
+ * filterActionData: (object)
+ * filterActionData.count: (number) The number of items this filter will
+ * show when selected
+ *
+ * NB this triggers a filtervalue event each time its radio button is checked
+ */
+ function createActionRadio(filterName, filterActionData) {
+ var hasNoRecords = (Number(filterActionData.count) == 0);
+
+ var actionStr = '<div class="radio">' +
+ '<label class="filter-title' +
+ (hasNoRecords ? ' text-muted' : '') + '"' +
+ ' for="' + filterName + '">' +
+ '<input type="radio" name="filter"' +
+ ' value="' + filterName + '"';
+
+ if (hasNoRecords) {
+ actionStr += ' disabled="disabled"';
+ }
+
+ actionStr += ' id="' + filterName + '">' +
+ '<input type="hidden" name="filter_value" value="on"' +
+ ' data-value-for="' + filterName + '">' +
+ filterActionData.title +
+ ' (' + filterActionData.count + ')' +
+ '</label>' +
+ '</div>';
+
+ var action = $(actionStr);
+
+ // fire the filtervalue event from this action when the radio button
+ // is active so that the apply button can be enabled
+ action.find('[type="radio"]').change(function () {
+ if ($(this).is(':checked')) {
+ action.trigger('filtervalue', 'on');
+ }
+ });
+
+ return action;
+ }
+
+ /**
+ * Create the DOM/JS for the client side of a TableFilterActionDateRange
+ *
+ * filterName: (string) internal name for the filter action
+ * filterValue: (string) from,to date range in format yyyy-mm-dd,yyyy-mm-dd;
+ * used to select the current values for the from/to datepickers;
+ * if this is partial (e.g. "yyyy-mm-dd,") only the applicable datepicker
+ * will have a date pre-selected; if empty, neither will
+ * filterActionData: (object) data for generating the action's HTML
+ * filterActionData.title: label for the radio button
+ * filterActionData.max: (string) maximum date for the pickers, in ISO 8601
+ * datetime format
+ * filterActionData.min: (string) minimum date for the pickers, ISO 8601
+ * datetime
+ *
+ * NB this triggers a filtervalue event each time its radio button is checked
+ */
+ function createActionDateRange(filterName, filterValue, filterActionData) {
+ var action = $('<div class="radio">' +
+ '<label class="filter-title"' +
+ ' for="' + filterName + '">' +
+ '<input type="radio" name="filter"' +
+ ' value="' + filterName + '" ' +
+ ' id="' + filterName + '">' +
+ '<input type="hidden" name="filter_value" value=""' +
+ ' data-value-for="' + filterName + '">' +
+ filterActionData.title +
+ '</label>' +
+ '<div class="form-inline form-group date-filter-controls">' +
+ '<input type="text" maxlength="10" class="form-control"' +
+ ' data-date-from-for="' + filterName + '">' +
+ '<span>to</span>' +
+ '<input type="text" maxlength="10" class="form-control"' +
+ ' data-date-to-for="' + filterName + '">' +
+ '<span class="help-inline get-help">(yyyy-mm-dd)</span>' +
+ '</div></div>');
+
+ var radio = action.find('[type="radio"]');
+ var value = action.find('[data-value-for]');
+
+ // make the datepickers for the range
+ var options = {
+ dateFormat: 'yy-mm-dd',
+ maxDate: new Date(filterActionData.max),
+ minDate: new Date(filterActionData.min)
+ };
+
+ // create date pickers, setting currently-selected from and to dates
+ var selectedFrom = null;
+ var selectedTo = null;
+
+ var selectedFromAndTo = [];
+ if (filterValue) {
+ selectedFromAndTo = filterValue.split(',');
+ }
+
+ if (selectedFromAndTo.length == 2) {
+ selectedFrom = selectedFromAndTo[0];
+ selectedTo = selectedFromAndTo[1];
+ }
+
+ options.defaultDate = selectedFrom;
+ var inputFrom =
+ action.find('[data-date-from-for]').datepicker(options);
+ inputFrom.val(selectedFrom);
+
+ options.defaultDate = selectedTo;
+ var inputTo =
+ action.find('[data-date-to-for]').datepicker(options);
+ inputTo.val(selectedTo);
+
+ // set filter_value based on date pickers when
+ // one of their values changes; if either from or to are unset,
+ // the new value is null;
+ // this triggers a 'filter_value-change' event on the action's element,
+ // which is used to determine the disabled/enabled state of the "Apply"
+ // button
+ var changeHandler = function () {
+ var fromValue = inputFrom.val();
+ var toValue = inputTo.val();
+
+ var newValue = undefined;
+ if (fromValue !== '' && toValue !== '') {
+ newValue = fromValue + ',' + toValue;
+ }
+
+ value.val(newValue);
+
+ // if this action is selected, fire an event for the new range
+ if (radio.is(':checked')) {
+ action.trigger('filtervalue', newValue);
+ }
+ };
+
+ inputFrom.change(changeHandler);
+ inputTo.change(changeHandler);
+
+ // check the associated radio button on clicking a date picker
+ var checkRadio = function () {
+ radio.prop('checked', 'checked');
+
+ // checking the radio button this way doesn't cause the "change"
+ // event to fire, so we manually call the changeHandler
+ changeHandler();
+ };
+
+ inputFrom.focus(checkRadio);
+ inputTo.focus(checkRadio);
+
+ // selecting a date in a picker constrains the date you can
+ // set in the other picker
+ inputFrom.change(function () {
+ inputTo.datepicker('option', 'minDate', inputFrom.val());
+ });
+
+ inputTo.change(function () {
+ inputFrom.datepicker('option', 'maxDate', inputTo.val());
+ });
+
+ // checking the radio input causes the "Apply" button disabled state to
+ // change, depending on which from/to dates are supplied
+ radio.change(changeHandler);
+
+ return action;
+ }
+
+ function filterOpenClicked(){
+ var filterName = $(this).data('filter-name');
+
+ /* We need to pass in the current search so that the filter counts take
+ * into account the current search term
+ */
+ var params = {
+ 'name' : filterName,
+ 'search': tableParams.search,
+ 'cmd': 'filterinfo',
+ };
+
+ $.ajax({
+ type: "GET",
+ url: ctx.url,
+ data: params,
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (filterData) {
+ /*
+ filterData structure:
+
+ {
+ title: '<title for the filter popup>',
+ filter_actions: [
+ {
+ title: '<label for radio button inside the popup>',
+ name: '<name of the filter action>',
+ count: <number of items this filter will show>,
+ ... additional data for the action ...
+ }
+ ]
+ }
+
+ each filter_action gets a radio button; the value of this is
+ set to filterName + ':' + filter_action.name; e.g.
+
+ in_current_project:in_project
+
+ specifies the "in_project" action of the "in_current_project"
+ filter
+
+ the filterName is set on the column filter icon, and corresponds
+ to a value in the table's filter map
+
+ when the filter popup's "Apply" button is clicked, the
+ value for the radio button which is checked is passed in the
+ querystring, along with a filter_value, and applied to the
+ queryset on the table
+ */
+ var filterActionRadios = $('#filter-actions-' + ctx.tableName);
+ var filterApplyBtn = $('[data-cat="filter-apply"]');
+
+ var setApplyButtonState = function (e, filterActionValue) {
+ if (filterActionValue !== undefined) {
+ filterApplyBtn.removeAttr('disabled');
+ }
+ else {
+ filterApplyBtn.attr('disabled', 'disabled');
+ }
+ };
+
+ $('#filter-modal-title-' + ctx.tableName).text(filterData.title);
+
+ filterActionRadios.empty();
+
+ // create a radio button + form elements for each action associated
+ // with the filter on this column of the table
+ for (var i in filterData.filter_actions) {
+ var action = null;
+ var filterActionData = filterData.filter_actions[i];
+ var filterName = filterData.name + ':' +
+ filterActionData.action_name;
+
+ if (filterActionData.type === 'toggle' ||
+ filterActionData.type === 'day') {
+ action = createActionRadio(filterName, filterActionData);
+ }
+ else if (filterActionData.type === 'daterange') {
+ // current values for the from/to dates
+ var filterValue = tableParams.filter_value;
+
+ action = createActionDateRange(
+ filterName,
+ filterValue,
+ filterActionData
+ );
+ }
+
+ if (action) {
+ // Setup the current selected filter; default to 'all' if
+ // no current filter selected
+ var radioInput = action.find('input[name="filter"]');
+ if ((tableParams.filter &&
+ tableParams.filter === radioInput.val()) ||
+ filterActionData.action_name == 'all') {
+ radioInput.prop("checked", "checked");
+ }
+
+ filterActionRadios.append(action);
+
+ // if the action's filter_value changes but is falsy, disable
+ // the "Apply" button
+ action.on('filtervalue', setApplyButtonState);
+ }
+ }
+
+ $('#filter-modal-'+ctx.tableName).modal('show');
+ }
+ });
+ }
+
+ /* Allow pages to trigger reload event */
+ table.on('reload', function(e, newTableParams){
+ if (newTableParams)
+ loadData(newTableParams);
+ else
+ loadData(tableParams)
+ });
+
+ $(".get-help").tooltip({container:'body', html:true, delay:{show:300}});
+
+ /* Keep the Edit columns menu open after click by eating the event */
+ $('.dropdown-menu').click(function(e) {
+ e.stopPropagation();
+ });
+
+ $(".pagesize-"+ctx.tableName).val(tableParams.limit);
+
+ /* page size selector */
+ $(".pagesize-"+ctx.tableName).change(function(e){
+ tableParams.limit = Number(this.value);
+ if ((tableParams.page * tableParams.limit) > tableTotal)
+ tableParams.page = 1;
+
+ loadData(tableParams);
+ /* sync the other selectors on the page */
+ $(".pagesize-"+ctx.tableName).val(this.value);
+ e.preventDefault();
+ });
+
+ $("#search-submit-"+ctx.tableName).click(function(e){
+ e.preventDefault();
+ var searchTerm = $("#search-input-"+ctx.tableName).val();
+
+ tableParams.page = 1;
+ tableParams.search = searchTerm;
+
+ /* If a filter was active we remove it */
+ if (tableParams.filter) {
+ var filterBtn = $("#" + tableParams.filter.split(":")[0]);
+ filterBtnActive(filterBtn, false);
+ tableParams.filter = null;
+ }
+
+ loadData(tableParams);
+ });
+
+ clearSearchElements.click(function(e){
+ e.preventDefault();
+
+ tableParams.page = 1;
+ tableParams.search = null;
+ loadData(tableParams);
+
+ $("#search-input-"+ctx.tableName).val("");
+ $(this).hide();
+ });
+
+ $("#search-input-"+ctx.tableName).keyup(function(e){
+ if (e.which === 13)
+ $('#search-submit-'+ctx.tableName).click();
+ });
+
+ /* Stop page jumps when clicking on # links */
+ $('a[href="#"]').click(function(e){
+ e.preventDefault();
+ });
+
+ $("#clear-filter-btn-"+ctx.tableName).click(function(e){
+ e.preventDefault();
+
+ var filterBtn = $("#" + tableParams.filter.split(":")[0]);
+ filterBtnActive(filterBtn, false);
+
+ tableParams.filter = null;
+ loadData(tableParams);
+ });
+
+ $("#filter-modal-form-"+ctx.tableName).submit(function(e){
+ e.preventDefault();
+
+ /* remove active status from all filter buttons so that only one filter
+ can be active at a time */
+ $('[data-filter-on]').each(function (index, filterBtn) {
+ filterBtnActive($(filterBtn), false);
+ });
+
+ // checked radio button
+ var checkedFilter = $(this).find("input[name='filter']:checked");
+ tableParams.filter = checkedFilter.val();
+
+ // hidden field holding the value for the checked filter
+ var checkedFilterValue = $(this).find("input[data-value-for='" +
+ tableParams.filter + "']");
+ tableParams.filter_value = checkedFilterValue.val();
+
+ /* All === remove filter */
+ if (tableParams.filter.match(":all$")) {
+ tableParams.filter = null;
+ tableParams.filter_value = null;
+ } else {
+ var filterBtn = $("#" + tableParams.filter.split(":")[0]);
+ filterBtnActive(filterBtn, true);
+ }
+
+ loadData(tableParams);
+
+
+ $('#filter-modal-'+ctx.tableName).modal('hide');
+ });
+
+ table.on("table-loading", function(){
+ table.css("opacity", 0.5);
+ });
+
+ table.on("table-done", function(){
+ table.css("opacity", 1);
+ })
+}
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js b/poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
new file mode 100644
index 000000000..4a4c83f4c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/tests/test.js
@@ -0,0 +1,177 @@
+"use strict";
+/* Unit tests for Toaster's JS */
+
+/* libtoaster tests */
+QUnit.test("Layer alert notification", function(assert) {
+ var layer = {
+ "layerdetailurl":"/toastergui/project/1/layer/22",
+ "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
+ "vcs_url":"git://example.com/example.git",
+ "detail":"[ git://example.com/example.git | master ]",
+ "vcs_reference":"master",
+ "id": 22,
+ "name":"meta-example"
+ };
+
+ var layerDepsList = [
+ {
+ "layerdetailurl":"/toastergui/project/1/layer/9",
+ "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
+ "vcs_url":"git://example.com/example.git",
+ "detail":"[ git://example.com/example.git | master ]",
+ "vcs_reference":"master",
+ "id": 9,
+ "name":"meta-example-two"
+ },
+ {
+ "layerdetailurl":"/toastergui/project/1/layer/9",
+ "xhrLayerUrl":"/toastergui/xhr_layer/1/9",
+ "vcs_url":"git://example.com/example.git",
+ "detail":"[ git://example.com/example.git | master ]",
+ "vcs_reference":"master",
+ "id": 10,
+ "name":"meta-example-three"
+ },
+ ];
+
+ var msg = libtoaster.makeLayerAddRmAlertMsg(layer, layerDepsList, true);
+ var test = $("<div></div>");
+
+ test.html(msg);
+
+ assert.equal(test.children("strong").text(), "3");
+ assert.equal(test.children("a").length, 3);
+});
+
+QUnit.test("Project info", function(assert){
+ var done = assert.async();
+ libtoaster.getProjectInfo(libtoaster.ctx.xhrProjectUrl, function(prjInfo){
+ assert.ok(prjInfo.machine.name);
+ assert.ok(prjInfo.layers.length > 0);
+ assert.ok(prjInfo.freqtargets);
+ assert.ok(prjInfo.release);
+ done();
+ });
+});
+
+QUnit.test("Show notification", function(assert){
+ var msg = "Testing";
+ var element = $("#change-notification-msg");
+
+ libtoaster.showChangeNotification(msg);
+
+ assert.equal(element.text(), msg);
+ assert.ok(element.is(":visible"));
+
+ $("#change-notification").hide();
+});
+
+var layer = {
+ "id": 1,
+ "name": "meta-testing",
+ "layerdetailurl": "/toastergui/project/1/layer/1",
+ "xhrLayerUrl": "/toastergui/xhr_layer/1/1"
+};
+
+QUnit.test("Add layer", function(assert){
+ var done = assert.async();
+
+ /* Wait for the modal to be added to the dom */
+ var checkModal = setInterval(function(){
+ if ($("#dependencies-modal").length > 0) {
+ $("#dependencies-modal .btn-primary").click();
+ clearInterval(checkModal);
+ }
+ }, 200);
+
+ /* Compare the number of layers before and after the add in the project */
+ libtoaster.getProjectInfo(libtoaster.ctx.xhrProjectUrl, function(prjInfo){
+ var origNumLayers = prjInfo.layers.length;
+
+ libtoaster.addRmLayer(layer, true, function(deps){
+ libtoaster.getProjectInfo(libtoaster.ctx.xhrProjectUrl,
+ function(prjInfo){
+ assert.ok(prjInfo.layers.length > origNumLayers,
+ "Layer not added to project");
+ done();
+ });
+ });
+ });
+});
+
+QUnit.test("Rm layer", function(assert){
+ var done = assert.async();
+
+ libtoaster.addRmLayer(layer, false, function(deps){
+ assert.equal(deps.length, 0);
+ done();
+ });
+
+});
+
+QUnit.test("Parse url params", function(assert){
+ var params = libtoaster.parseUrlParams();
+ assert.ok(params);
+});
+
+QUnit.test("Dump url params", function(assert){
+ var params = libtoaster.dumpsUrlParams();
+ assert.ok(params);
+});
+
+QUnit.test("Make typeaheads", function(assert){
+ var layersT = $("#layers");
+ var machinesT = $("#machines");
+ var projectsT = $("#projects");
+ var recipesT = $("#recipes");
+
+ libtoaster.makeTypeahead(layersT,
+ libtoaster.ctx.layersTypeAheadUrl, {}, function(){});
+
+ libtoaster.makeTypeahead(machinesT,
+ libtoaster.ctx.machinesTypeAheadUrl, {}, function(){});
+
+ libtoaster.makeTypeahead(projectsT,
+ libtoaster.ctx.projectsTypeAheadUrl, {}, function(){});
+
+ libtoaster.makeTypeahead(recipesT,
+ libtoaster.ctx.recipesTypeAheadUrl, {}, function(){});
+
+ assert.ok(recipesT.data('ttTypeahead'));
+ assert.ok(layersT.data('ttTypeahead'));
+ assert.ok(projectsT.data('ttTypeahead'));
+ assert.ok(recipesT.data('ttTypeahead'));
+});
+
+
+
+/* Page init functions */
+
+QUnit.test("Import layer page init", function(assert){
+ assert.throws(importLayerPageInit({ xhrGitRevTypeAheadUrl: "url" }));
+});
+
+QUnit.test("Project page init", function(assert){
+ assert.throws(projectPageInit());
+});
+
+QUnit.test("Layer details page init", function(assert){
+ assert.throws(layerDetailsPageInit());
+});
+
+QUnit.test("Layer btns init", function(assert){
+ assert.throws(layerBtnsInit());
+});
+
+QUnit.test("Table init", function(assert){
+ assert.throws(tableInit({ url : ctx.tableUrl }));
+});
+
+$(document).ajaxError(function(event, jqxhr, settings, errMsg){
+ if (errMsg === 'abort')
+ return;
+
+ QUnit.test("Ajax error", function(assert){
+ assert.notOk(jqxhr.responseText);
+ });
+});
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/typeahead.jquery.js b/poky/bitbake/lib/toaster/toastergui/static/js/typeahead.jquery.js
new file mode 100644
index 000000000..f3efd80cb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/typeahead.jquery.js
@@ -0,0 +1,1551 @@
+/*!
+ * typeahead.js 0.11.1
+ * https://github.com/twitter/typeahead.js
+ * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
+ */
+
+(function(root, factory) {
+ if (typeof define === "function" && define.amd) {
+ define("typeahead.js", [ "jquery" ], function(a0) {
+ return factory(a0);
+ });
+ } else if (typeof exports === "object") {
+ module.exports = factory(require("jquery"));
+ } else {
+ factory(jQuery);
+ }
+})(this, function($) {
+ var _ = function() {
+ "use strict";
+ return {
+ isMsie: function() {
+ return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
+ },
+ isBlankString: function(str) {
+ return !str || /^\s*$/.test(str);
+ },
+ escapeRegExChars: function(str) {
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+ },
+ isString: function(obj) {
+ return typeof obj === "string";
+ },
+ isNumber: function(obj) {
+ return typeof obj === "number";
+ },
+ isArray: $.isArray,
+ isFunction: $.isFunction,
+ isObject: $.isPlainObject,
+ isUndefined: function(obj) {
+ return typeof obj === "undefined";
+ },
+ isElement: function(obj) {
+ return !!(obj && obj.nodeType === 1);
+ },
+ isJQuery: function(obj) {
+ return obj instanceof $;
+ },
+ toStr: function toStr(s) {
+ return _.isUndefined(s) || s === null ? "" : s + "";
+ },
+ bind: $.proxy,
+ each: function(collection, cb) {
+ $.each(collection, reverseArgs);
+ function reverseArgs(index, value) {
+ return cb(value, index);
+ }
+ },
+ map: $.map,
+ filter: $.grep,
+ every: function(obj, test) {
+ var result = true;
+ if (!obj) {
+ return result;
+ }
+ $.each(obj, function(key, val) {
+ if (!(result = test.call(null, val, key, obj))) {
+ return false;
+ }
+ });
+ return !!result;
+ },
+ some: function(obj, test) {
+ var result = false;
+ if (!obj) {
+ return result;
+ }
+ $.each(obj, function(key, val) {
+ if (result = test.call(null, val, key, obj)) {
+ return false;
+ }
+ });
+ return !!result;
+ },
+ mixin: $.extend,
+ identity: function(x) {
+ return x;
+ },
+ clone: function(obj) {
+ return $.extend(true, {}, obj);
+ },
+ getIdGenerator: function() {
+ var counter = 0;
+ return function() {
+ return counter++;
+ };
+ },
+ templatify: function templatify(obj) {
+ return $.isFunction(obj) ? obj : template;
+ function template() {
+ return String(obj);
+ }
+ },
+ defer: function(fn) {
+ setTimeout(fn, 0);
+ },
+ debounce: function(func, wait, immediate) {
+ var timeout, result;
+ return function() {
+ var context = this, args = arguments, later, callNow;
+ later = function() {
+ timeout = null;
+ if (!immediate) {
+ result = func.apply(context, args);
+ }
+ };
+ callNow = immediate && !timeout;
+ clearTimeout(timeout);
+ timeout = setTimeout(later, wait);
+ if (callNow) {
+ result = func.apply(context, args);
+ }
+ return result;
+ };
+ },
+ throttle: function(func, wait) {
+ var context, args, timeout, result, previous, later;
+ previous = 0;
+ later = function() {
+ previous = new Date();
+ timeout = null;
+ result = func.apply(context, args);
+ };
+ return function() {
+ var now = new Date(), remaining = wait - (now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0) {
+ clearTimeout(timeout);
+ timeout = null;
+ previous = now;
+ result = func.apply(context, args);
+ } else if (!timeout) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+ },
+ stringify: function(val) {
+ return _.isString(val) ? val : JSON.stringify(val);
+ },
+ noop: function() {}
+ };
+ }();
+ var WWW = function() {
+ "use strict";
+ var defaultClassNames = {
+ wrapper: "twitter-typeahead",
+ input: "tt-input",
+ hint: "tt-hint",
+ menu: "tt-menu",
+ dataset: "tt-dataset",
+ suggestion: "tt-suggestion",
+ selectable: "tt-selectable",
+ empty: "tt-empty",
+ open: "tt-open",
+ cursor: "tt-cursor",
+ highlight: "tt-highlight"
+ };
+ return build;
+ function build(o) {
+ var www, classes;
+ classes = _.mixin({}, defaultClassNames, o);
+ www = {
+ css: buildCss(),
+ classes: classes,
+ html: buildHtml(classes),
+ selectors: buildSelectors(classes)
+ };
+ return {
+ css: www.css,
+ html: www.html,
+ classes: www.classes,
+ selectors: www.selectors,
+ mixin: function(o) {
+ _.mixin(o, www);
+ }
+ };
+ }
+ function buildHtml(c) {
+ return {
+ wrapper: '<span class="' + c.wrapper + '"></span>',
+ menu: '<div class="' + c.menu + '"></div>'
+ };
+ }
+ function buildSelectors(classes) {
+ var selectors = {};
+ _.each(classes, function(v, k) {
+ selectors[k] = "." + v;
+ });
+ return selectors;
+ }
+ function buildCss() {
+ var css = {
+ wrapper: {
+ position: "relative",
+ display: "inline-block"
+ },
+ hint: {
+ position: "absolute",
+ top: "0",
+ left: "0",
+ borderColor: "transparent",
+ boxShadow: "none",
+ opacity: "1"
+ },
+ input: {
+ position: "relative",
+ verticalAlign: "top",
+ backgroundColor: "transparent"
+ },
+ inputWithNoHint: {
+ position: "relative",
+ verticalAlign: "top"
+ },
+ menu: {
+ position: "absolute",
+ top: "100%",
+ left: "0",
+ zIndex: "100",
+ display: "none"
+ },
+ ltr: {
+ left: "0",
+ right: "auto"
+ },
+ rtl: {
+ left: "auto",
+ right: " 0"
+ }
+ };
+ if (_.isMsie()) {
+ _.mixin(css.input, {
+ backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
+ });
+ }
+ return css;
+ }
+ }();
+ var EventBus = function() {
+ "use strict";
+ var namespace, deprecationMap;
+ namespace = "typeahead:";
+ deprecationMap = {
+ render: "rendered",
+ cursorchange: "cursorchanged",
+ select: "selected",
+ autocomplete: "autocompleted"
+ };
+ function EventBus(o) {
+ if (!o || !o.el) {
+ $.error("EventBus initialized without el");
+ }
+ this.$el = $(o.el);
+ }
+ _.mixin(EventBus.prototype, {
+ _trigger: function(type, args) {
+ var $e;
+ $e = $.Event(namespace + type);
+ (args = args || []).unshift($e);
+ this.$el.trigger.apply(this.$el, args);
+ return $e;
+ },
+ before: function(type) {
+ var args, $e;
+ args = [].slice.call(arguments, 1);
+ $e = this._trigger("before" + type, args);
+ return $e.isDefaultPrevented();
+ },
+ trigger: function(type) {
+ var deprecatedType;
+ this._trigger(type, [].slice.call(arguments, 1));
+ if (deprecatedType = deprecationMap[type]) {
+ this._trigger(deprecatedType, [].slice.call(arguments, 1));
+ }
+ }
+ });
+ return EventBus;
+ }();
+ var EventEmitter = function() {
+ "use strict";
+ var splitter = /\s+/, nextTick = getNextTick();
+ return {
+ onSync: onSync,
+ onAsync: onAsync,
+ off: off,
+ trigger: trigger
+ };
+ function on(method, types, cb, context) {
+ var type;
+ if (!cb) {
+ return this;
+ }
+ types = types.split(splitter);
+ cb = context ? bindContext(cb, context) : cb;
+ this._callbacks = this._callbacks || {};
+ while (type = types.shift()) {
+ this._callbacks[type] = this._callbacks[type] || {
+ sync: [],
+ async: []
+ };
+ this._callbacks[type][method].push(cb);
+ }
+ return this;
+ }
+ function onAsync(types, cb, context) {
+ return on.call(this, "async", types, cb, context);
+ }
+ function onSync(types, cb, context) {
+ return on.call(this, "sync", types, cb, context);
+ }
+ function off(types) {
+ var type;
+ if (!this._callbacks) {
+ return this;
+ }
+ types = types.split(splitter);
+ while (type = types.shift()) {
+ delete this._callbacks[type];
+ }
+ return this;
+ }
+ function trigger(types) {
+ var type, callbacks, args, syncFlush, asyncFlush;
+ if (!this._callbacks) {
+ return this;
+ }
+ types = types.split(splitter);
+ args = [].slice.call(arguments, 1);
+ while ((type = types.shift()) && (callbacks = this._callbacks[type])) {
+ syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args));
+ asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args));
+ syncFlush() && nextTick(asyncFlush);
+ }
+ return this;
+ }
+ function getFlush(callbacks, context, args) {
+ return flush;
+ function flush() {
+ var cancelled;
+ for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {
+ cancelled = callbacks[i].apply(context, args) === false;
+ }
+ return !cancelled;
+ }
+ }
+ function getNextTick() {
+ var nextTickFn;
+ if (window.setImmediate) {
+ nextTickFn = function nextTickSetImmediate(fn) {
+ setImmediate(function() {
+ fn();
+ });
+ };
+ } else {
+ nextTickFn = function nextTickSetTimeout(fn) {
+ setTimeout(function() {
+ fn();
+ }, 0);
+ };
+ }
+ return nextTickFn;
+ }
+ function bindContext(fn, context) {
+ return fn.bind ? fn.bind(context) : function() {
+ fn.apply(context, [].slice.call(arguments, 0));
+ };
+ }
+ }();
+ var highlight = function(doc) {
+ "use strict";
+ var defaults = {
+ node: null,
+ pattern: null,
+ tagName: "strong",
+ className: null,
+ wordsOnly: false,
+ caseSensitive: false
+ };
+ return function hightlight(o) {
+ var regex;
+ o = _.mixin({}, defaults, o);
+ if (!o.node || !o.pattern) {
+ return;
+ }
+ o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ];
+ regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
+ traverse(o.node, hightlightTextNode);
+ function hightlightTextNode(textNode) {
+ var match, patternNode, wrapperNode;
+ if (match = regex.exec(textNode.data)) {
+ wrapperNode = doc.createElement(o.tagName);
+ o.className && (wrapperNode.className = o.className);
+ patternNode = textNode.splitText(match.index);
+ patternNode.splitText(match[0].length);
+ wrapperNode.appendChild(patternNode.cloneNode(true));
+ textNode.parentNode.replaceChild(wrapperNode, patternNode);
+ }
+ return !!match;
+ }
+ function traverse(el, hightlightTextNode) {
+ var childNode, TEXT_NODE_TYPE = 3;
+ for (var i = 0; i < el.childNodes.length; i++) {
+ childNode = el.childNodes[i];
+ if (childNode.nodeType === TEXT_NODE_TYPE) {
+ i += hightlightTextNode(childNode) ? 1 : 0;
+ } else {
+ traverse(childNode, hightlightTextNode);
+ }
+ }
+ }
+ };
+ function getRegex(patterns, caseSensitive, wordsOnly) {
+ var escapedPatterns = [], regexStr;
+ for (var i = 0, len = patterns.length; i < len; i++) {
+ escapedPatterns.push(_.escapeRegExChars(patterns[i]));
+ }
+ regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
+ return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
+ }
+ }(window.document);
+ var Input = function() {
+ "use strict";
+ var specialKeyCodeMap;
+ specialKeyCodeMap = {
+ 9: "tab",
+ 27: "esc",
+ 37: "left",
+ 39: "right",
+ 13: "enter",
+ 38: "up",
+ 40: "down"
+ };
+ function Input(o, www) {
+ o = o || {};
+ if (!o.input) {
+ $.error("input is missing");
+ }
+ www.mixin(this);
+ this.$hint = $(o.hint);
+ this.$input = $(o.input);
+ this.query = this.$input.val();
+ this.queryWhenFocused = this.hasFocus() ? this.query : null;
+ this.$overflowHelper = buildOverflowHelper(this.$input);
+ this._checkLanguageDirection();
+ if (this.$hint.length === 0) {
+ this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
+ }
+ }
+ Input.normalizeQuery = function(str) {
+ return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
+ };
+ _.mixin(Input.prototype, EventEmitter, {
+ _onBlur: function onBlur() {
+ this.resetInputValue();
+ this.trigger("blurred");
+ },
+ _onFocus: function onFocus() {
+ this.queryWhenFocused = this.query;
+ this.trigger("focused");
+ },
+ _onKeydown: function onKeydown($e) {
+ var keyName = specialKeyCodeMap[$e.which || $e.keyCode];
+ this._managePreventDefault(keyName, $e);
+ if (keyName && this._shouldTrigger(keyName, $e)) {
+ this.trigger(keyName + "Keyed", $e);
+ }
+ },
+ _onInput: function onInput() {
+ this._setQuery(this.getInputValue());
+ this.clearHintIfInvalid();
+ this._checkLanguageDirection();
+ },
+ _managePreventDefault: function managePreventDefault(keyName, $e) {
+ var preventDefault;
+ switch (keyName) {
+ case "up":
+ case "down":
+ preventDefault = !withModifier($e);
+ break;
+
+ default:
+ preventDefault = false;
+ }
+ preventDefault && $e.preventDefault();
+ },
+ _shouldTrigger: function shouldTrigger(keyName, $e) {
+ var trigger;
+ switch (keyName) {
+ case "tab":
+ trigger = !withModifier($e);
+ break;
+
+ default:
+ trigger = true;
+ }
+ return trigger;
+ },
+ _checkLanguageDirection: function checkLanguageDirection() {
+ var dir = (this.$input.css("direction") || "ltr").toLowerCase();
+ if (this.dir !== dir) {
+ this.dir = dir;
+ this.$hint.attr("dir", dir);
+ this.trigger("langDirChanged", dir);
+ }
+ },
+ _setQuery: function setQuery(val, silent) {
+ var areEquivalent, hasDifferentWhitespace;
+ areEquivalent = areQueriesEquivalent(val, this.query);
+ hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false;
+ this.query = val;
+ if (!silent && !areEquivalent) {
+ this.trigger("queryChanged", this.query);
+ } else if (!silent && hasDifferentWhitespace) {
+ this.trigger("whitespaceChanged", this.query);
+ }
+ },
+ bind: function() {
+ var that = this, onBlur, onFocus, onKeydown, onInput;
+ onBlur = _.bind(this._onBlur, this);
+ onFocus = _.bind(this._onFocus, this);
+ onKeydown = _.bind(this._onKeydown, this);
+ onInput = _.bind(this._onInput, this);
+ this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown);
+ if (!_.isMsie() || _.isMsie() > 9) {
+ this.$input.on("input.tt", onInput);
+ } else {
+ this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) {
+ if (specialKeyCodeMap[$e.which || $e.keyCode]) {
+ return;
+ }
+ _.defer(_.bind(that._onInput, that, $e));
+ });
+ }
+ return this;
+ },
+ focus: function focus() {
+ this.$input.focus();
+ },
+ blur: function blur() {
+ this.$input.blur();
+ },
+ getLangDir: function getLangDir() {
+ return this.dir;
+ },
+ getQuery: function getQuery() {
+ return this.query || "";
+ },
+ setQuery: function setQuery(val, silent) {
+ this.setInputValue(val);
+ this._setQuery(val, silent);
+ },
+ hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() {
+ return this.query !== this.queryWhenFocused;
+ },
+ getInputValue: function getInputValue() {
+ return this.$input.val();
+ },
+ setInputValue: function setInputValue(value) {
+ this.$input.val(value);
+ this.clearHintIfInvalid();
+ this._checkLanguageDirection();
+ },
+ resetInputValue: function resetInputValue() {
+ this.setInputValue(this.query);
+ },
+ getHint: function getHint() {
+ return this.$hint.val();
+ },
+ setHint: function setHint(value) {
+ this.$hint.val(value);
+ },
+ clearHint: function clearHint() {
+ this.setHint("");
+ },
+ clearHintIfInvalid: function clearHintIfInvalid() {
+ var val, hint, valIsPrefixOfHint, isValid;
+ val = this.getInputValue();
+ hint = this.getHint();
+ valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;
+ isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow();
+ !isValid && this.clearHint();
+ },
+ hasFocus: function hasFocus() {
+ return this.$input.is(":focus");
+ },
+ hasOverflow: function hasOverflow() {
+ var constraint = this.$input.width() - 2;
+ this.$overflowHelper.text(this.getInputValue());
+ return this.$overflowHelper.width() >= constraint;
+ },
+ isCursorAtEnd: function() {
+ var valueLength, selectionStart, range;
+ valueLength = this.$input.val().length;
+ selectionStart = this.$input[0].selectionStart;
+ if (_.isNumber(selectionStart)) {
+ return selectionStart === valueLength;
+ } else if (document.selection) {
+ range = document.selection.createRange();
+ range.moveStart("character", -valueLength);
+ return valueLength === range.text.length;
+ }
+ return true;
+ },
+ destroy: function destroy() {
+ this.$hint.off(".tt");
+ this.$input.off(".tt");
+ this.$overflowHelper.remove();
+ this.$hint = this.$input = this.$overflowHelper = $("<div>");
+ }
+ });
+ return Input;
+ function buildOverflowHelper($input) {
+ return $('<pre aria-hidden="true"></pre>').css({
+ position: "absolute",
+ visibility: "hidden",
+ whiteSpace: "pre",
+ fontFamily: $input.css("font-family"),
+ fontSize: $input.css("font-size"),
+ fontStyle: $input.css("font-style"),
+ fontVariant: $input.css("font-variant"),
+ fontWeight: $input.css("font-weight"),
+ wordSpacing: $input.css("word-spacing"),
+ letterSpacing: $input.css("letter-spacing"),
+ textIndent: $input.css("text-indent"),
+ textRendering: $input.css("text-rendering"),
+ textTransform: $input.css("text-transform")
+ }).insertAfter($input);
+ }
+ function areQueriesEquivalent(a, b) {
+ return Input.normalizeQuery(a) === Input.normalizeQuery(b);
+ }
+ function withModifier($e) {
+ return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;
+ }
+ }();
+ var Dataset = function() {
+ "use strict";
+ var keys, nameGenerator;
+ keys = {
+ val: "tt-selectable-display",
+ obj: "tt-selectable-object"
+ };
+ nameGenerator = _.getIdGenerator();
+ function Dataset(o, www) {
+ o = o || {};
+ o.templates = o.templates || {};
+ o.templates.notFound = o.templates.notFound || o.templates.empty;
+ if (!o.source) {
+ $.error("missing source");
+ }
+ if (!o.node) {
+ $.error("missing node");
+ }
+ if (o.name && !isValidName(o.name)) {
+ $.error("invalid dataset name: " + o.name);
+ }
+ www.mixin(this);
+ this.highlight = !!o.highlight;
+ this.name = o.name || nameGenerator();
+ this.limit = o.limit || 5;
+ this.displayFn = getDisplayFn(o.display || o.displayKey);
+ this.templates = getTemplates(o.templates, this.displayFn);
+ this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source;
+ this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async;
+ this._resetLastSuggestion();
+ this.$el = $(o.node).addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name);
+ }
+ Dataset.extractData = function extractData(el) {
+ var $el = $(el);
+ if ($el.data(keys.obj)) {
+ return {
+ val: $el.data(keys.val) || "",
+ obj: $el.data(keys.obj) || null
+ };
+ }
+ return null;
+ };
+ _.mixin(Dataset.prototype, EventEmitter, {
+ _overwrite: function overwrite(query, suggestions) {
+ suggestions = suggestions || [];
+ if (suggestions.length) {
+ this._renderSuggestions(query, suggestions);
+ } else if (this.async && this.templates.pending) {
+ this._renderPending(query);
+ } else if (!this.async && this.templates.notFound) {
+ this._renderNotFound(query);
+ } else {
+ this._empty();
+ }
+ this.trigger("rendered", this.name, suggestions, false);
+ },
+ _append: function append(query, suggestions) {
+ suggestions = suggestions || [];
+ if (suggestions.length && this.$lastSuggestion.length) {
+ this._appendSuggestions(query, suggestions);
+ } else if (suggestions.length) {
+ this._renderSuggestions(query, suggestions);
+ } else if (!this.$lastSuggestion.length && this.templates.notFound) {
+ this._renderNotFound(query);
+ }
+ this.trigger("rendered", this.name, suggestions, true);
+ },
+ _renderSuggestions: function renderSuggestions(query, suggestions) {
+ var $fragment;
+ $fragment = this._getSuggestionsFragment(query, suggestions);
+ this.$lastSuggestion = $fragment.children().last();
+ this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions));
+ },
+ _appendSuggestions: function appendSuggestions(query, suggestions) {
+ var $fragment, $lastSuggestion;
+ $fragment = this._getSuggestionsFragment(query, suggestions);
+ $lastSuggestion = $fragment.children().last();
+ this.$lastSuggestion.after($fragment);
+ this.$lastSuggestion = $lastSuggestion;
+ },
+ _renderPending: function renderPending(query) {
+ var template = this.templates.pending;
+ this._resetLastSuggestion();
+ template && this.$el.html(template({
+ query: query,
+ dataset: this.name
+ }));
+ },
+ _renderNotFound: function renderNotFound(query) {
+ var template = this.templates.notFound;
+ this._resetLastSuggestion();
+ template && this.$el.html(template({
+ query: query,
+ dataset: this.name
+ }));
+ },
+ _empty: function empty() {
+ this.$el.empty();
+ this._resetLastSuggestion();
+ },
+ _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) {
+ var that = this, fragment;
+ fragment = document.createDocumentFragment();
+ _.each(suggestions, function getSuggestionNode(suggestion) {
+ var $el, context;
+ context = that._injectQuery(query, suggestion);
+ $el = $(that.templates.suggestion(context)).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable);
+ fragment.appendChild($el[0]);
+ });
+ this.highlight && highlight({
+ className: this.classes.highlight,
+ node: fragment,
+ pattern: query
+ });
+ return $(fragment);
+ },
+ _getFooter: function getFooter(query, suggestions) {
+ return this.templates.footer ? this.templates.footer({
+ query: query,
+ suggestions: suggestions,
+ dataset: this.name
+ }) : null;
+ },
+ _getHeader: function getHeader(query, suggestions) {
+ return this.templates.header ? this.templates.header({
+ query: query,
+ suggestions: suggestions,
+ dataset: this.name
+ }) : null;
+ },
+ _resetLastSuggestion: function resetLastSuggestion() {
+ this.$lastSuggestion = $();
+ },
+ _injectQuery: function injectQuery(query, obj) {
+ return _.isObject(obj) ? _.mixin({
+ _query: query
+ }, obj) : obj;
+ },
+ update: function update(query) {
+ var that = this, canceled = false, syncCalled = false, rendered = 0;
+ this.cancel();
+ this.cancel = function cancel() {
+ canceled = true;
+ that.cancel = $.noop;
+ that.async && that.trigger("asyncCanceled", query);
+ };
+ this.source(query, sync, async);
+ !syncCalled && sync([]);
+ function sync(suggestions) {
+ if (syncCalled) {
+ return;
+ }
+ syncCalled = true;
+ suggestions = (suggestions || []).slice(0, that.limit);
+ rendered = suggestions.length;
+ that._overwrite(query, suggestions);
+ if (rendered < that.limit && that.async) {
+ that.trigger("asyncRequested", query);
+ }
+ }
+ function async(suggestions) {
+ suggestions = suggestions || [];
+ if (!canceled && rendered < that.limit) {
+ that.cancel = $.noop;
+ rendered += suggestions.length;
+
+ // HACK: because we don't have a synchronous way of
+ // retrieving results, we use the async function every
+ // time we update the drop-down; however, the typeahead
+ // does some internal book-keeping which means that we
+ // only get the additional items in the drop-down when
+ // the next set of results is fetched, instead of all
+ // of them (it appears to implicitly track which
+ // results have already been shown in the drop-down); by
+ // forcing an overwrite, we see all of the new results
+ // every time we fetch a set of suggestions
+ //that._append(query, suggestions.slice(0, that.limit - rendered));
+ that._overwrite(query, suggestions);
+
+ that.async && that.trigger("asyncReceived", query);
+ }
+ }
+ },
+ cancel: $.noop,
+ clear: function clear() {
+ this._empty();
+ this.cancel();
+ this.trigger("cleared");
+ },
+ isEmpty: function isEmpty() {
+ return this.$el.is(":empty");
+ },
+ destroy: function destroy() {
+ this.$el = $("<div>");
+ }
+ });
+ return Dataset;
+ function getDisplayFn(display) {
+ display = display || _.stringify;
+ return _.isFunction(display) ? display : displayFn;
+ function displayFn(obj) {
+ return obj[display];
+ }
+ }
+ function getTemplates(templates, displayFn) {
+ return {
+ notFound: templates.notFound && _.templatify(templates.notFound),
+ pending: templates.pending && _.templatify(templates.pending),
+ header: templates.header && _.templatify(templates.header),
+ footer: templates.footer && _.templatify(templates.footer),
+ suggestion: templates.suggestion || suggestionTemplate
+ };
+ function suggestionTemplate(context) {
+ return $("<div>").text(displayFn(context));
+ }
+ }
+ function isValidName(str) {
+ return /^[_a-zA-Z0-9-]+$/.test(str);
+ }
+ }();
+ var Menu = function() {
+ "use strict";
+ function Menu(o, www) {
+ var that = this;
+ o = o || {};
+ if (!o.node) {
+ $.error("node is required");
+ }
+ www.mixin(this);
+ this.$node = $(o.node);
+ this.query = null;
+ this.datasets = _.map(o.datasets, initializeDataset);
+ function initializeDataset(oDataset) {
+ var node = that.$node.find(oDataset.node).first();
+ oDataset.node = node.length ? node : $("<div>").appendTo(that.$node);
+ return new Dataset(oDataset, www);
+ }
+ }
+ _.mixin(Menu.prototype, EventEmitter, {
+ _onSelectableClick: function onSelectableClick($e) {
+ this.trigger("selectableClicked", $($e.currentTarget));
+ },
+ _onRendered: function onRendered(type, dataset, suggestions, async) {
+ this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
+ this.trigger("datasetRendered", dataset, suggestions, async);
+ },
+ _onCleared: function onCleared() {
+ this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty());
+ this.trigger("datasetCleared");
+ },
+ _propagate: function propagate() {
+ this.trigger.apply(this, arguments);
+ },
+ _allDatasetsEmpty: function allDatasetsEmpty() {
+ return _.every(this.datasets, isDatasetEmpty);
+ function isDatasetEmpty(dataset) {
+ return dataset.isEmpty();
+ }
+ },
+ _getSelectables: function getSelectables() {
+ return this.$node.find(this.selectors.selectable);
+ },
+ _removeCursor: function _removeCursor() {
+ var $selectable = this.getActiveSelectable();
+ $selectable && $selectable.removeClass(this.classes.cursor);
+ },
+ _ensureVisible: function ensureVisible($el) {
+ var elTop, elBottom, nodeScrollTop, nodeHeight;
+ elTop = $el.position().top;
+ elBottom = elTop + $el.outerHeight(true);
+ nodeScrollTop = this.$node.scrollTop();
+ nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10);
+ if (elTop < 0) {
+ this.$node.scrollTop(nodeScrollTop + elTop);
+ } else if (nodeHeight < elBottom) {
+ this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight));
+ }
+ },
+ bind: function() {
+ var that = this, onSelectableClick;
+ onSelectableClick = _.bind(this._onSelectableClick, this);
+ this.$node.on("click.tt", this.selectors.selectable, onSelectableClick);
+ _.each(this.datasets, function(dataset) {
+ dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that);
+ });
+ return this;
+ },
+ isOpen: function isOpen() {
+ return this.$node.hasClass(this.classes.open);
+ },
+ open: function open() {
+ this.$node.addClass(this.classes.open);
+ },
+ close: function close() {
+ this.$node.removeClass(this.classes.open);
+ this._removeCursor();
+ },
+ setLanguageDirection: function setLanguageDirection(dir) {
+ this.$node.attr("dir", dir);
+ },
+ selectableRelativeToCursor: function selectableRelativeToCursor(delta) {
+ var $selectables, $oldCursor, oldIndex, newIndex;
+ $oldCursor = this.getActiveSelectable();
+ $selectables = this._getSelectables();
+ oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1;
+ newIndex = oldIndex + delta;
+ newIndex = (newIndex + 1) % ($selectables.length + 1) - 1;
+ newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex;
+ return newIndex === -1 ? null : $selectables.eq(newIndex);
+ },
+ setCursor: function setCursor($selectable) {
+ this._removeCursor();
+ if ($selectable = $selectable && $selectable.first()) {
+ $selectable.addClass(this.classes.cursor);
+ this._ensureVisible($selectable);
+ }
+ },
+ getSelectableData: function getSelectableData($el) {
+ return $el && $el.length ? Dataset.extractData($el) : null;
+ },
+ getActiveSelectable: function getActiveSelectable() {
+ var $selectable = this._getSelectables().filter(this.selectors.cursor).first();
+ return $selectable.length ? $selectable : null;
+ },
+ getTopSelectable: function getTopSelectable() {
+ var $selectable = this._getSelectables().first();
+ return $selectable.length ? $selectable : null;
+ },
+ update: function update(query) {
+ var isValidUpdate = query !== this.query;
+ if (isValidUpdate) {
+ this.query = query;
+ _.each(this.datasets, updateDataset);
+ }
+ return isValidUpdate;
+ function updateDataset(dataset) {
+ dataset.update(query);
+ }
+ },
+ empty: function empty() {
+ _.each(this.datasets, clearDataset);
+ this.query = null;
+ this.$node.addClass(this.classes.empty);
+ function clearDataset(dataset) {
+ dataset.clear();
+ }
+ },
+ destroy: function destroy() {
+ this.$node.off(".tt");
+ this.$node = $("<div>");
+ _.each(this.datasets, destroyDataset);
+ function destroyDataset(dataset) {
+ dataset.destroy();
+ }
+ }
+ });
+ return Menu;
+ }();
+ var DefaultMenu = function() {
+ "use strict";
+ var s = Menu.prototype;
+ function DefaultMenu() {
+ Menu.apply(this, [].slice.call(arguments, 0));
+ }
+ _.mixin(DefaultMenu.prototype, Menu.prototype, {
+ open: function open() {
+ !this._allDatasetsEmpty() && this._show();
+ return s.open.apply(this, [].slice.call(arguments, 0));
+ },
+ close: function close() {
+ this._hide();
+ return s.close.apply(this, [].slice.call(arguments, 0));
+ },
+ _onRendered: function onRendered() {
+ if (this._allDatasetsEmpty()) {
+ this._hide();
+ } else {
+ this.isOpen() && this._show();
+ }
+ return s._onRendered.apply(this, [].slice.call(arguments, 0));
+ },
+ _onCleared: function onCleared() {
+ if (this._allDatasetsEmpty()) {
+ this._hide();
+ } else {
+ this.isOpen() && this._show();
+ }
+ return s._onCleared.apply(this, [].slice.call(arguments, 0));
+ },
+ setLanguageDirection: function setLanguageDirection(dir) {
+ this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl);
+ return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0));
+ },
+ _hide: function hide() {
+ this.$node.hide();
+ },
+ _show: function show() {
+ this.$node.css("display", "block");
+ }
+ });
+ return DefaultMenu;
+ }();
+ var Typeahead = function() {
+ "use strict";
+ function Typeahead(o, www) {
+ var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged;
+ o = o || {};
+ if (!o.input) {
+ $.error("missing input");
+ }
+ if (!o.menu) {
+ $.error("missing menu");
+ }
+ if (!o.eventBus) {
+ $.error("missing event bus");
+ }
+ www.mixin(this);
+ this.eventBus = o.eventBus;
+ this.minLength = _.isNumber(o.minLength) ? o.minLength : 1;
+ this.input = o.input;
+ this.menu = o.menu;
+ this.enabled = true;
+ this.active = false;
+ this.input.hasFocus() && this.activate();
+ this.dir = this.input.getLangDir();
+ this._hacks();
+ this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this);
+ onFocused = c(this, "activate", "open", "_onFocused");
+ onBlurred = c(this, "deactivate", "_onBlurred");
+ onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed");
+ onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed");
+ onEscKeyed = c(this, "isActive", "_onEscKeyed");
+ onUpKeyed = c(this, "isActive", "open", "_onUpKeyed");
+ onDownKeyed = c(this, "isActive", "open", "_onDownKeyed");
+ onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed");
+ onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed");
+ onQueryChanged = c(this, "_openIfActive", "_onQueryChanged");
+ onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged");
+ this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this);
+ }
+ _.mixin(Typeahead.prototype, {
+ _hacks: function hacks() {
+ var $input, $menu;
+ $input = this.input.$input || $("<div>");
+ $menu = this.menu.$node || $("<div>");
+ $input.on("blur.tt", function($e) {
+ var active, isActive, hasActive;
+ active = document.activeElement;
+ isActive = $menu.is(active);
+ hasActive = $menu.has(active).length > 0;
+ if (_.isMsie() && (isActive || hasActive)) {
+ $e.preventDefault();
+ $e.stopImmediatePropagation();
+ _.defer(function() {
+ $input.focus();
+ });
+ }
+ });
+ $menu.on("mousedown.tt", function($e) {
+ $e.preventDefault();
+ });
+ },
+ _onSelectableClicked: function onSelectableClicked(type, $el) {
+ this.select($el);
+ },
+ _onDatasetCleared: function onDatasetCleared() {
+ this._updateHint();
+ },
+ _onDatasetRendered: function onDatasetRendered(type, dataset, suggestions, async) {
+ this._updateHint();
+ this.eventBus.trigger("render", suggestions, async, dataset);
+ },
+ _onAsyncRequested: function onAsyncRequested(type, dataset, query) {
+ this.eventBus.trigger("asyncrequest", query, dataset);
+ },
+ _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) {
+ this.eventBus.trigger("asynccancel", query, dataset);
+ },
+ _onAsyncReceived: function onAsyncReceived(type, dataset, query) {
+ this.eventBus.trigger("asyncreceive", query, dataset);
+ },
+ _onFocused: function onFocused() {
+ this._minLengthMet() && this.menu.update(this.input.getQuery());
+ },
+ _onBlurred: function onBlurred() {
+ if (this.input.hasQueryChangedSinceLastFocus()) {
+ this.eventBus.trigger("change", this.input.getQuery());
+ }
+ },
+ _onEnterKeyed: function onEnterKeyed(type, $e) {
+ var $selectable;
+ if ($selectable = this.menu.getActiveSelectable()) {
+ this.select($selectable) && $e.preventDefault();
+ }
+ },
+ _onTabKeyed: function onTabKeyed(type, $e) {
+ var $selectable;
+ if ($selectable = this.menu.getActiveSelectable()) {
+ this.select($selectable) && $e.preventDefault();
+ } else if ($selectable = this.menu.getTopSelectable()) {
+ this.autocomplete($selectable) && $e.preventDefault();
+ }
+ },
+ _onEscKeyed: function onEscKeyed() {
+ this.close();
+ },
+ _onUpKeyed: function onUpKeyed() {
+ this.moveCursor(-1);
+ },
+ _onDownKeyed: function onDownKeyed() {
+ this.moveCursor(+1);
+ },
+ _onLeftKeyed: function onLeftKeyed() {
+ if (this.dir === "rtl" && this.input.isCursorAtEnd()) {
+ this.autocomplete(this.menu.getTopSelectable());
+ }
+ },
+ _onRightKeyed: function onRightKeyed() {
+ if (this.dir === "ltr" && this.input.isCursorAtEnd()) {
+ this.autocomplete(this.menu.getTopSelectable());
+ }
+ },
+ _onQueryChanged: function onQueryChanged(e, query) {
+ this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty();
+ },
+ _onWhitespaceChanged: function onWhitespaceChanged() {
+ this._updateHint();
+ },
+ _onLangDirChanged: function onLangDirChanged(e, dir) {
+ if (this.dir !== dir) {
+ this.dir = dir;
+ this.menu.setLanguageDirection(dir);
+ }
+ },
+ _openIfActive: function openIfActive() {
+ this.isActive() && this.open();
+ },
+ _minLengthMet: function minLengthMet(query) {
+ query = _.isString(query) ? query : this.input.getQuery() || "";
+ return query.length >= this.minLength;
+ },
+ _updateHint: function updateHint() {
+ var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match;
+ $selectable = this.menu.getTopSelectable();
+ data = this.menu.getSelectableData($selectable);
+ val = this.input.getInputValue();
+ if (data && !_.isBlankString(val) && !this.input.hasOverflow()) {
+ query = Input.normalizeQuery(val);
+ escapedQuery = _.escapeRegExChars(query);
+ frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i");
+ match = frontMatchRegEx.exec(data.val);
+ match && this.input.setHint(val + match[1]);
+ } else {
+ this.input.clearHint();
+ }
+ },
+ isEnabled: function isEnabled() {
+ return this.enabled;
+ },
+ enable: function enable() {
+ this.enabled = true;
+ },
+ disable: function disable() {
+ this.enabled = false;
+ },
+ isActive: function isActive() {
+ return this.active;
+ },
+ activate: function activate() {
+ if (this.isActive()) {
+ return true;
+ } else if (!this.isEnabled() || this.eventBus.before("active")) {
+ return false;
+ } else {
+ this.active = true;
+ this.eventBus.trigger("active");
+ return true;
+ }
+ },
+ deactivate: function deactivate() {
+ if (!this.isActive()) {
+ return true;
+ } else if (this.eventBus.before("idle")) {
+ return false;
+ } else {
+ this.active = false;
+ this.close();
+ this.eventBus.trigger("idle");
+ return true;
+ }
+ },
+ isOpen: function isOpen() {
+ return this.menu.isOpen();
+ },
+ open: function open() {
+ if (!this.isOpen() && !this.eventBus.before("open")) {
+ this.menu.open();
+ this._updateHint();
+ this.eventBus.trigger("open");
+ }
+ return this.isOpen();
+ },
+ close: function close() {
+ if (this.isOpen() && !this.eventBus.before("close")) {
+ this.menu.close();
+ this.input.clearHint();
+ this.input.resetInputValue();
+ this.eventBus.trigger("close");
+ }
+ return !this.isOpen();
+ },
+ setVal: function setVal(val) {
+ this.input.setQuery(_.toStr(val));
+ },
+ getVal: function getVal() {
+ return this.input.getQuery();
+ },
+ select: function select($selectable) {
+ var data = this.menu.getSelectableData($selectable);
+ if (data && !this.eventBus.before("select", data.obj)) {
+ this.input.setQuery(data.val, true);
+ this.eventBus.trigger("select", data.obj);
+ this.close();
+ return true;
+ }
+ return false;
+ },
+ autocomplete: function autocomplete($selectable) {
+ var query, data, isValid;
+ query = this.input.getQuery();
+ data = this.menu.getSelectableData($selectable);
+ isValid = data && query !== data.val;
+ if (isValid && !this.eventBus.before("autocomplete", data.obj)) {
+ this.input.setQuery(data.val);
+ this.eventBus.trigger("autocomplete", data.obj);
+ return true;
+ }
+ return false;
+ },
+ moveCursor: function moveCursor(delta) {
+ var query, $candidate, data, payload, cancelMove;
+ query = this.input.getQuery();
+ $candidate = this.menu.selectableRelativeToCursor(delta);
+ data = this.menu.getSelectableData($candidate);
+ payload = data ? data.obj : null;
+ cancelMove = this._minLengthMet() && this.menu.update(query);
+ if (!cancelMove && !this.eventBus.before("cursorchange", payload)) {
+ this.menu.setCursor($candidate);
+ if (data) {
+ this.input.setInputValue(data.val);
+ } else {
+ this.input.resetInputValue();
+ this._updateHint();
+ }
+ this.eventBus.trigger("cursorchange", payload);
+ return true;
+ }
+ return false;
+ },
+ destroy: function destroy() {
+ this.input.destroy();
+ this.menu.destroy();
+ }
+ });
+ return Typeahead;
+ function c(ctx) {
+ var methods = [].slice.call(arguments, 1);
+ return function() {
+ var args = [].slice.call(arguments);
+ _.each(methods, function(method) {
+ return ctx[method].apply(ctx, args);
+ });
+ };
+ }
+ }();
+ (function() {
+ "use strict";
+ var old, keys, methods;
+ old = $.fn.typeahead;
+ keys = {
+ www: "tt-www",
+ attrs: "tt-attrs",
+ typeahead: "tt-typeahead"
+ };
+ methods = {
+ initialize: function initialize(o, datasets) {
+ var www;
+ datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);
+ o = o || {};
+ www = WWW(o.classNames);
+ return this.each(attach);
+ function attach() {
+ var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, typeahead, MenuConstructor;
+ _.each(datasets, function(d) {
+ d.highlight = !!o.highlight;
+ });
+ $input = $(this);
+ $wrapper = $(www.html.wrapper);
+ $hint = $elOrNull(o.hint);
+ $menu = $elOrNull(o.menu);
+ defaultHint = o.hint !== false && !$hint;
+ defaultMenu = o.menu !== false && !$menu;
+ defaultHint && ($hint = buildHintFromInput($input, www));
+ defaultMenu && ($menu = $(www.html.menu).css(www.css.menu));
+ $hint && $hint.val("");
+ $input = prepInput($input, www);
+ if (defaultHint || defaultMenu) {
+ $wrapper.css(www.css.wrapper);
+ $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint);
+ $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null);
+ }
+ MenuConstructor = defaultMenu ? DefaultMenu : Menu;
+ eventBus = new EventBus({
+ el: $input
+ });
+ input = new Input({
+ hint: $hint,
+ input: $input
+ }, www);
+ menu = new MenuConstructor({
+ node: $menu,
+ datasets: datasets
+ }, www);
+ typeahead = new Typeahead({
+ input: input,
+ menu: menu,
+ eventBus: eventBus,
+ minLength: o.minLength
+ }, www);
+ $input.data(keys.www, www);
+ $input.data(keys.typeahead, typeahead);
+ }
+ },
+ isEnabled: function isEnabled() {
+ var enabled;
+ ttEach(this.first(), function(t) {
+ enabled = t.isEnabled();
+ });
+ return enabled;
+ },
+ enable: function enable() {
+ ttEach(this, function(t) {
+ t.enable();
+ });
+ return this;
+ },
+ disable: function disable() {
+ ttEach(this, function(t) {
+ t.disable();
+ });
+ return this;
+ },
+ isActive: function isActive() {
+ var active;
+ ttEach(this.first(), function(t) {
+ active = t.isActive();
+ });
+ return active;
+ },
+ activate: function activate() {
+ ttEach(this, function(t) {
+ t.activate();
+ });
+ return this;
+ },
+ deactivate: function deactivate() {
+ ttEach(this, function(t) {
+ t.deactivate();
+ });
+ return this;
+ },
+ isOpen: function isOpen() {
+ var open;
+ ttEach(this.first(), function(t) {
+ open = t.isOpen();
+ });
+ return open;
+ },
+ open: function open() {
+ ttEach(this, function(t) {
+ t.open();
+ });
+ return this;
+ },
+ close: function close() {
+ ttEach(this, function(t) {
+ t.close();
+ });
+ return this;
+ },
+ select: function select(el) {
+ var success = false, $el = $(el);
+ ttEach(this.first(), function(t) {
+ success = t.select($el);
+ });
+ return success;
+ },
+ autocomplete: function autocomplete(el) {
+ var success = false, $el = $(el);
+ ttEach(this.first(), function(t) {
+ success = t.autocomplete($el);
+ });
+ return success;
+ },
+ moveCursor: function moveCursoe(delta) {
+ var success = false;
+ ttEach(this.first(), function(t) {
+ success = t.moveCursor(delta);
+ });
+ return success;
+ },
+ val: function val(newVal) {
+ var query;
+ if (!arguments.length) {
+ ttEach(this.first(), function(t) {
+ query = t.getVal();
+ });
+ return query;
+ } else {
+ ttEach(this, function(t) {
+ t.setVal(newVal);
+ });
+ return this;
+ }
+ },
+ destroy: function destroy() {
+ ttEach(this, function(typeahead, $input) {
+ revert($input);
+ typeahead.destroy();
+ });
+ return this;
+ }
+ };
+ $.fn.typeahead = function(method) {
+ if (methods[method]) {
+ return methods[method].apply(this, [].slice.call(arguments, 1));
+ } else {
+ return methods.initialize.apply(this, arguments);
+ }
+ };
+ $.fn.typeahead.noConflict = function noConflict() {
+ $.fn.typeahead = old;
+ return this;
+ };
+ function ttEach($els, fn) {
+ $els.each(function() {
+ var $input = $(this), typeahead;
+ (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input);
+ });
+ }
+ function buildHintFromInput($input, www) {
+ return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop("readonly", true).removeAttr("id name placeholder required").attr({
+ autocomplete: "off",
+ spellcheck: "false",
+ tabindex: -1
+ });
+ }
+ function prepInput($input, www) {
+ $input.data(keys.attrs, {
+ dir: $input.attr("dir"),
+ autocomplete: $input.attr("autocomplete"),
+ spellcheck: $input.attr("spellcheck"),
+ style: $input.attr("style")
+ });
+ $input.addClass(www.classes.input).attr({
+ autocomplete: "off",
+ spellcheck: false
+ });
+ try {
+ !$input.attr("dir") && $input.attr("dir", "auto");
+ } catch (e) {}
+ return $input;
+ }
+ function getBackgroundStyles($el) {
+ return {
+ backgroundAttachment: $el.css("background-attachment"),
+ backgroundClip: $el.css("background-clip"),
+ backgroundColor: $el.css("background-color"),
+ backgroundImage: $el.css("background-image"),
+ backgroundOrigin: $el.css("background-origin"),
+ backgroundPosition: $el.css("background-position"),
+ backgroundRepeat: $el.css("background-repeat"),
+ backgroundSize: $el.css("background-size")
+ };
+ }
+ function revert($input) {
+ var www, $wrapper;
+ www = $input.data(keys.www);
+ $wrapper = $input.parent().filter(www.selectors.wrapper);
+ _.each($input.data(keys.attrs), function(val, key) {
+ _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val);
+ });
+ $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input);
+ if ($wrapper.length) {
+ $input.detach().insertAfter($wrapper);
+ $wrapper.remove();
+ }
+ }
+ function $elOrNull(obj) {
+ var isValid, $el;
+ isValid = _.isJQuery(obj) || _.isElement(obj);
+ $el = isValid ? $(obj).first() : [];
+ return $el.length ? $el : null;
+ }
+ })();
+}); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js b/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js
new file mode 100644
index 000000000..fa6a86131
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js
@@ -0,0 +1,10 @@
+/*
+ * angular-ui-bootstrap
+ * http://angular-ui.github.io/bootstrap/
+
+ * Version: 0.11.0 - 2014-05-01
+ * License: MIT
+ */
+angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var d={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.createParser=function(a){var c=[],e=a.split("");return angular.forEach(d,function(b,d){var f=a.indexOf(d);if(f>-1){a=a.split(""),e[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+d.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+e.join("")+"$"),map:b(c,"index")}},this.parse=function(b,d){if(!angular.isString(b))return b;d=a.DATETIME_FORMATS[d]||d,this.parsers[d]||(this.parsers[d]=this.createParser(d));var e=this.parsers[d],f=e.regex,g=e.map,h=b.match(f);if(h&&h.length){for(var i,j={year:1900,month:0,date:1,hours:0},k=1,l=h.length;l>k;k++){var m=g[k-1];m.apply&&m.apply.call(j,h[k])}return c(j.year,j.month,j.date)&&(i=new Date(j.year,j.month,j.date,j.hours)),i}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)<p;);}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),angular.forEach(["minDate","maxDate"],function(a){j[a]&&(h.$parent.$watch(b(j[a]),function(b){h[a]=b}),r.attr(l(a),a))}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){a&&a.isDefaultPrevented()||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(b){b.animate=!1,a(function(){b.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,b(function(){c.animate=!0,d[0].focus()}),c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))}}}}]).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=n.keys(),c=0;c<b.length;c++)n.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=n.get(a).value;n.remove(a),j(d.modalDomEl,d.modalScope,300,function(){d.modalScope.$destroy(),b.toggleClass(m,n.length()>0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g,0)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();h>=0&&!k&&(l=e.$new(!0),l.index=h,k=d("<div modal-backdrop></div>")(l),f.append(k));var i=angular.element("<div modal-window></div>");i.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var j=d(i)(b.scope);n.top().value.modalDomEl=j,f.append(j),f.addClass(m)},o.close=function(a,b){var c=n.get(a).value;c&&(c.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a).value;c&&(c.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";
+return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="<div "+p+'-popup title="'+q+"tt_title"+r+'" content="'+q+"tt_content"+r+'" placement="'+q+"tt_placement"+r+'" animation="tt_animation" is-open="tt_isOpen"></div>';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("<div typeahead-popup></div>");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e<c.length;e++)b[v.itemName]=c[e],w.matches.push({id:A(e),label:v.viewMapper(w,b),model:c[e]});w.query=a,w.position=t?f.offset(j):f.position(j),w.position.top=w.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else z();d&&q(i,!1)},function(){z(),q(i,!1)})};z(),w.query=void 0;var C;l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(C&&d.cancel(C),C=d(function(){B(a)},o)):B(a):(q(i,!1),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var D=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",D),i.$on("$destroy",function(){e.unbind("click",D)});var E=a(y)(w);t?e.find("body").append(E):j.after(E)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="{\'alert-{{type || \'warning\'}}\': true, \'alert-dismissable\': closeable}" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html","<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item text-center\" ng-transclude></div>\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" ng-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset-titles.html","<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n</ul>\n")}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'\n<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-if="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>')
+}]); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js b/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js
new file mode 100644
index 000000000..fa6a86131
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js
@@ -0,0 +1,10 @@
+/*
+ * angular-ui-bootstrap
+ * http://angular-ui.github.io/bootstrap/
+
+ * Version: 0.11.0 - 2014-05-01
+ * License: MIT
+ */
+angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var d={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.createParser=function(a){var c=[],e=a.split("");return angular.forEach(d,function(b,d){var f=a.indexOf(d);if(f>-1){a=a.split(""),e[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+d.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+e.join("")+"$"),map:b(c,"index")}},this.parse=function(b,d){if(!angular.isString(b))return b;d=a.DATETIME_FORMATS[d]||d,this.parsers[d]||(this.parsers[d]=this.createParser(d));var e=this.parsers[d],f=e.regex,g=e.map,h=b.match(f);if(h&&h.length){for(var i,j={year:1900,month:0,date:1,hours:0},k=1,l=h.length;l>k;k++){var m=g[k-1];m.apply&&m.apply.call(j,h[k])}return c(j.year,j.month,j.date)&&(i=new Date(j.year,j.month,j.date,j.hours)),i}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)<p;);}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),angular.forEach(["minDate","maxDate"],function(a){j[a]&&(h.$parent.$watch(b(j[a]),function(b){h[a]=b}),r.attr(l(a),a))}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){a&&a.isDefaultPrevented()||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(b){b.animate=!1,a(function(){b.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,b(function(){c.animate=!0,d[0].focus()}),c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))}}}}]).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=n.keys(),c=0;c<b.length;c++)n.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=n.get(a).value;n.remove(a),j(d.modalDomEl,d.modalScope,300,function(){d.modalScope.$destroy(),b.toggleClass(m,n.length()>0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g,0)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();h>=0&&!k&&(l=e.$new(!0),l.index=h,k=d("<div modal-backdrop></div>")(l),f.append(k));var i=angular.element("<div modal-window></div>");i.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var j=d(i)(b.scope);n.top().value.modalDomEl=j,f.append(j),f.addClass(m)},o.close=function(a,b){var c=n.get(a).value;c&&(c.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a).value;c&&(c.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";
+return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="<div "+p+'-popup title="'+q+"tt_title"+r+'" content="'+q+"tt_content"+r+'" placement="'+q+"tt_placement"+r+'" animation="tt_animation" is-open="tt_isOpen"></div>';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("<div typeahead-popup></div>");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e<c.length;e++)b[v.itemName]=c[e],w.matches.push({id:A(e),label:v.viewMapper(w,b),model:c[e]});w.query=a,w.position=t?f.offset(j):f.position(j),w.position.top=w.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else z();d&&q(i,!1)},function(){z(),q(i,!1)})};z(),w.query=void 0;var C;l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(C&&d.cancel(C),C=d(function(){B(a)},o)):B(a):(q(i,!1),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var D=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",D),i.$on("$destroy",function(){e.unbind("click",D)});var E=a(y)(w);t?e.find("body").append(E):j.after(E)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="{\'alert-{{type || \'warning\'}}\': true, \'alert-dismissable\': closeable}" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html","<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item text-center\" ng-transclude></div>\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" ng-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset-titles.html","<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n</ul>\n")}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'\n<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-if="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>')
+}]); \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/tablefilter.py b/poky/bitbake/lib/toaster/toastergui/tablefilter.py
new file mode 100644
index 000000000..65454e140
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/tablefilter.py
@@ -0,0 +1,292 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.db.models import Q, Max, Min
+from django.utils import dateparse, timezone
+from datetime import timedelta
+
+class TableFilter(object):
+ """
+ Stores a filter for a named field, and can retrieve the action
+ requested from the set of actions for that filter;
+ the order in which actions are added governs the order in which they
+ are returned in the JSON for the filter
+ """
+
+ def __init__(self, name, title):
+ self.name = name
+ self.title = title
+ self.__filter_action_map = {}
+
+ # retains the ordering of actions
+ self.__filter_action_keys = []
+
+ def add_action(self, action):
+ self.__filter_action_keys.append(action.name)
+ self.__filter_action_map[action.name] = action
+
+ def get_action(self, action_name):
+ return self.__filter_action_map[action_name]
+
+ def to_json(self, queryset):
+ """
+ Dump all filter actions as an object which can be JSON serialised;
+ this is used to generate the JSON for processing in
+ table.js / filterOpenClicked()
+ """
+ filter_actions = []
+
+ # add the "all" pseudo-filter action, which just selects the whole
+ # queryset
+ filter_actions.append({
+ 'action_name' : 'all',
+ 'title' : 'All',
+ 'type': 'toggle',
+ 'count' : queryset.count()
+ })
+
+ # add other filter actions
+ for action_name in self.__filter_action_keys:
+ filter_action = self.__filter_action_map[action_name]
+ obj = filter_action.to_json(queryset)
+ obj['action_name'] = action_name
+ filter_actions.append(obj)
+
+ return {
+ 'name': self.name,
+ 'title': self.title,
+ 'filter_actions': filter_actions
+ }
+
+class TableFilterQueryHelper(object):
+ def dateStringsToQ(self, field_name, date_from_str, date_to_str):
+ """
+ Convert the date strings from_date_str and to_date_str into a
+ set of args in the form
+
+ {'<field_name>__gte': <date from>, '<field_name>__lte': <date to>}
+
+ where date_from and date_to are Django-timezone-aware dates; then
+ convert that into a Django Q object
+
+ Returns the Q object based on those criteria
+ """
+
+ # one of the values required for the filter is missing, so set
+ # it to the one which was supplied
+ if date_from_str == '':
+ date_from_str = date_to_str
+ elif date_to_str == '':
+ date_to_str = date_from_str
+
+ date_from_naive = dateparse.parse_datetime(date_from_str + ' 00:00:00')
+ date_to_naive = dateparse.parse_datetime(date_to_str + ' 23:59:59')
+
+ tz = timezone.get_default_timezone()
+ date_from = timezone.make_aware(date_from_naive, tz)
+ date_to = timezone.make_aware(date_to_naive, tz)
+
+ args = {}
+ args[field_name + '__gte'] = date_from
+ args[field_name + '__lte'] = date_to
+
+ return Q(**args)
+
+class TableFilterAction(object):
+ """
+ A filter action which displays in the filter popup for a ToasterTable
+ and uses an associated QuerysetFilter to filter the queryset for that
+ ToasterTable
+ """
+
+ def __init__(self, name, title, criteria):
+ self.name = name
+ self.title = title
+ self.criteria = criteria
+
+ # set in subclasses
+ self.type = None
+
+ def set_filter_params(self, params):
+ """
+ params: (str) a string of extra parameters for the action;
+ the structure of this string depends on the type of action;
+ it's ignored for a toggle filter action, which is just on or off
+ """
+ pass
+
+ def filter(self, queryset):
+ if self.criteria:
+ return queryset.filter(self.criteria)
+ else:
+ return queryset
+
+ def to_json(self, queryset):
+ """ Dump as a JSON object """
+ return {
+ 'title': self.title,
+ 'type': self.type,
+ 'count': self.filter(queryset).count()
+ }
+
+class TableFilterActionToggle(TableFilterAction):
+ """
+ A single filter action which will populate one radio button of
+ a ToasterTable filter popup; this filter can either be on or off and
+ has no other parameters
+ """
+
+ def __init__(self, *args):
+ super(TableFilterActionToggle, self).__init__(*args)
+ self.type = 'toggle'
+
+class TableFilterActionDay(TableFilterAction):
+ """
+ A filter action which filters according to the named datetime field and a
+ string representing a day ("today" or "yesterday")
+ """
+
+ TODAY = 'today'
+ YESTERDAY = 'yesterday'
+
+ def __init__(self, name, title, field, day,
+ query_helper = TableFilterQueryHelper()):
+ """
+ field: (string) the datetime field to filter by
+ day: (string) "today" or "yesterday"
+ """
+ super(TableFilterActionDay, self).__init__(name, title, None)
+ self.type = 'day'
+ self.field = field
+ self.day = day
+ self.query_helper = query_helper
+
+ def filter(self, queryset):
+ """
+ Apply the day filtering before returning the queryset;
+ this is done here as the value of the filter criteria changes
+ depending on when the filtering is applied
+ """
+
+ now = timezone.now()
+
+ if self.day == self.YESTERDAY:
+ increment = timedelta(days=1)
+ wanted_date = now - increment
+ else:
+ wanted_date = now
+
+ wanted_date_str = wanted_date.strftime('%Y-%m-%d')
+
+ self.criteria = self.query_helper.dateStringsToQ(
+ self.field,
+ wanted_date_str,
+ wanted_date_str
+ )
+
+ return queryset.filter(self.criteria)
+
+class TableFilterActionDateRange(TableFilterAction):
+ """
+ A filter action which will filter the queryset by a date range.
+ The date range can be set via set_params()
+ """
+
+ def __init__(self, name, title, field,
+ query_helper = TableFilterQueryHelper()):
+ """
+ field: (string) the field to find the max/min range from in the queryset
+ """
+ super(TableFilterActionDateRange, self).__init__(
+ name,
+ title,
+ None
+ )
+
+ self.type = 'daterange'
+ self.field = field
+ self.query_helper = query_helper
+
+ def set_filter_params(self, params):
+ """
+ This filter depends on the user selecting some input, so it needs
+ to have its parameters set before its queryset is filtered
+
+ params: (str) a string of extra parameters for the filtering
+ in the format "2015-12-09,2015-12-11" (from,to); this is passed in the
+ querystring and used to set the criteria on the QuerysetFilter
+ associated with this action
+ """
+
+ # if params are invalid, return immediately, resetting criteria
+ # on the QuerysetFilter
+ try:
+ date_from_str, date_to_str = params.split(',')
+ except ValueError:
+ self.criteria = None
+ return
+
+ # one of the values required for the filter is missing, so set
+ # it to the one which was supplied
+ self.criteria = self.query_helper.dateStringsToQ(
+ self.field,
+ date_from_str,
+ date_to_str
+ )
+
+ def to_json(self, queryset):
+ """ Dump as a JSON object """
+ data = super(TableFilterActionDateRange, self).to_json(queryset)
+
+ # additional data about the date range covered by the queryset's
+ # records, retrieved from its <field> column
+ data['min'] = queryset.aggregate(Min(self.field))[self.field + '__min']
+ data['max'] = queryset.aggregate(Max(self.field))[self.field + '__max']
+
+ # a range filter has a count of None, as the number of records it
+ # will select depends on the date range entered and we don't know
+ # that ahead of time
+ data['count'] = None
+
+ return data
+
+class TableFilterMap(object):
+ """
+ Map from field names to TableFilter objects for those fields
+ """
+
+ def __init__(self):
+ self.__filters = {}
+
+ def add_filter(self, filter_name, table_filter):
+ """ table_filter is an instance of Filter """
+ self.__filters[filter_name] = table_filter
+
+ def get_filter(self, filter_name):
+ return self.__filters[filter_name]
+
+ def to_json(self, queryset):
+ data = {}
+
+ for filter_name, table_filter in self.__filters.items():
+ data[filter_name] = table_filter.to_json()
+
+ return data
diff --git a/poky/bitbake/lib/toaster/toastergui/tables.py b/poky/bitbake/lib/toaster/toastergui/tables.py
new file mode 100644
index 000000000..dca2fa291
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/tables.py
@@ -0,0 +1,1629 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from toastergui.widgets import ToasterTable
+from orm.models import Recipe, ProjectLayer, Layer_Version, Machine, Project
+from orm.models import CustomImageRecipe, Package, Target, Build, LogMessage, Task
+from orm.models import CustomImagePackage, Package_DependencyManager
+from orm.models import Distro
+from django.db.models import Q, Max, Sum, Count, When, Case, Value, IntegerField
+from django.conf.urls import url
+from django.core.urlresolvers import reverse, resolve
+from django.http import HttpResponse
+from django.views.generic import TemplateView
+
+from toastergui.tablefilter import TableFilter
+from toastergui.tablefilter import TableFilterActionToggle
+from toastergui.tablefilter import TableFilterActionDateRange
+from toastergui.tablefilter import TableFilterActionDay
+
+class ProjectFilters(object):
+ @staticmethod
+ def in_project(project_layers):
+ return Q(layer_version__in=project_layers)
+
+ @staticmethod
+ def not_in_project(project_layers):
+ return ~(ProjectFilters.in_project(project_layers))
+
+class LayersTable(ToasterTable):
+ """Table of layers in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(LayersTable, self).__init__(*args, **kwargs)
+ self.default_orderby = "layer__name"
+ self.title = "Compatible layers"
+
+ def get_context_data(self, **kwargs):
+ context = super(LayersTable, self).get_context_data(**kwargs)
+
+ project = Project.objects.get(pk=kwargs['pid'])
+ context['project'] = project
+
+ return context
+
+ def setup_filters(self, *args, **kwargs):
+ project = Project.objects.get(pk=kwargs['pid'])
+ self.project_layers = ProjectLayer.objects.filter(project=project)
+
+ in_current_project_filter = TableFilter(
+ "in_current_project",
+ "Filter by project layers"
+ )
+
+ criteria = Q(projectlayer__in=self.project_layers)
+
+ in_project_action = TableFilterActionToggle(
+ "in_project",
+ "Layers added to this project",
+ criteria
+ )
+
+ not_in_project_action = TableFilterActionToggle(
+ "not_in_project",
+ "Layers not added to this project",
+ ~criteria
+ )
+
+ in_current_project_filter.add_action(in_project_action)
+ in_current_project_filter.add_action(not_in_project_action)
+ self.add_filter(in_current_project_filter)
+
+ def setup_queryset(self, *args, **kwargs):
+ prj = Project.objects.get(pk = kwargs['pid'])
+ compatible_layers = prj.get_all_compatible_layer_versions()
+
+ self.static_context_extra['current_layers'] = \
+ prj.get_project_layer_versions(pk=True)
+
+ self.queryset = compatible_layers.order_by(self.default_orderby)
+
+ def setup_columns(self, *args, **kwargs):
+
+ layer_link_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.id %}">
+ {{data.layer.name}}
+ </a>
+ '''
+
+ self.add_column(title="Layer",
+ hideable=False,
+ orderable=True,
+ static_data_name="layer__name",
+ static_data_template=layer_link_template)
+
+ self.add_column(title="Summary",
+ field_name="layer__summary")
+
+ git_url_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.id %}">
+ {% if data.layer.local_source_dir %}
+ <code>{{data.layer.local_source_dir}}</code>
+ {% else %}
+ <code>{{data.layer.vcs_url}}</code>
+ </a>
+ {% endif %}
+ {% if data.get_vcs_link_url %}
+ <a target="_blank" href="{{ data.get_vcs_link_url }}">
+ <span class="glyphicon glyphicon-new-window"></span>
+ </a>
+ {% endif %}
+ '''
+
+ self.add_column(title="Layer source code location",
+ help_text="A Git repository or an absolute path to a directory",
+ hidden=True,
+ static_data_name="layer__vcs_url",
+ static_data_template=git_url_template)
+
+ git_dir_template = '''
+ {% if data.layer.local_source_dir %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer.name}} is not in a Git repository, so there is no subdirectory associated with it"> </span>
+ {% else %}
+ <a href="{% url 'layerdetails' extra.pid data.id %}">
+ <code>{{data.dirpath}}</code>
+ </a>
+ {% endif %}
+ {% if data.dirpath and data.get_vcs_dirpath_link_url %}
+ <a target="_blank" href="{{ data.get_vcs_dirpath_link_url }}">
+ <span class="glyphicon glyphicon-new-window"></span>
+ </a>
+ {% endif %}'''
+
+ self.add_column(title="Subdirectory",
+ help_text="The layer directory within the Git repository",
+ hidden=True,
+ static_data_name="git_subdir",
+ static_data_template=git_dir_template)
+
+ revision_template = '''
+ {% if data.layer.local_source_dir %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
+ {% else %}
+ {% with vcs_ref=data.get_vcs_reference %}
+ {% include 'snippets/gitrev_popover.html' %}
+ {% endwith %}
+ {% endif %}
+ '''
+
+ self.add_column(title="Git revision",
+ help_text="The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project",
+ static_data_name="revision",
+ static_data_template=revision_template)
+
+ deps_template = '''
+ {% with ods=data.dependencies.all%}
+ {% if ods.count %}
+ <a class="btn btn-default" title="<a href='{% url "layerdetails" extra.pid data.id %}'>{{data.layer.name}}</a> dependencies"
+ data-content="<ul class='list-unstyled'>
+ {% for i in ods%}
+ <li><a href='{% url "layerdetails" extra.pid i.depends_on.pk %}'>{{i.depends_on.layer.name}}</a></li>
+ {% endfor %}
+ </ul>">
+ {{ods.count}}
+ </a>
+ {% endif %}
+ {% endwith %}
+ '''
+
+ self.add_column(title="Dependencies",
+ help_text="Other layers a layer depends upon",
+ static_data_name="dependencies",
+ static_data_template=deps_template)
+
+ self.add_column(title="Add | Remove",
+ help_text="Add or remove layers to / from your project",
+ hideable=False,
+ filter_name="in_current_project",
+ static_data_name="add-del-layers",
+ static_data_template='{% include "layer_btn.html" %}')
+
+
+class MachinesTable(ToasterTable):
+ """Table of Machines in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(MachinesTable, self).__init__(*args, **kwargs)
+ self.empty_state = "Toaster has no machine information for this project. Sadly, machine information cannot be obtained from builds, so this page will remain empty."
+ self.title = "Compatible machines"
+ self.default_orderby = "name"
+
+ def get_context_data(self, **kwargs):
+ context = super(MachinesTable, self).get_context_data(**kwargs)
+ context['project'] = Project.objects.get(pk=kwargs['pid'])
+ return context
+
+ def setup_filters(self, *args, **kwargs):
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ in_current_project_filter = TableFilter(
+ "in_current_project",
+ "Filter by project machines"
+ )
+
+ in_project_action = TableFilterActionToggle(
+ "in_project",
+ "Machines provided by layers added to this project",
+ ProjectFilters.in_project(self.project_layers)
+ )
+
+ not_in_project_action = TableFilterActionToggle(
+ "not_in_project",
+ "Machines provided by layers not added to this project",
+ ProjectFilters.not_in_project(self.project_layers)
+ )
+
+ in_current_project_filter.add_action(in_project_action)
+ in_current_project_filter.add_action(not_in_project_action)
+ self.add_filter(in_current_project_filter)
+
+ def setup_queryset(self, *args, **kwargs):
+ prj = Project.objects.get(pk = kwargs['pid'])
+ self.queryset = prj.get_all_compatible_machines()
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ self.static_context_extra['current_layers'] = \
+ self.project_layers = \
+ prj.get_project_layer_versions(pk=True)
+
+ def setup_columns(self, *args, **kwargs):
+
+ self.add_column(title="Machine",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ self.add_column(title="Description",
+ field_name="description")
+
+ layer_link_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.layer_version.id %}">
+ {{data.layer_version.layer.name}}</a>
+ '''
+
+ self.add_column(title="Layer",
+ static_data_name="layer_version__layer__name",
+ static_data_template=layer_link_template,
+ orderable=True)
+
+ self.add_column(title="Git revision",
+ help_text="The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project",
+ hidden=True,
+ field_name="layer_version__get_vcs_reference")
+
+ machine_file_template = '''<code>conf/machine/{{data.name}}.conf</code>
+ <a href="{{data.get_vcs_machine_file_link_url}}" target="_blank"><span class="glyphicon glyphicon-new-window"></i></a>'''
+
+ self.add_column(title="Machine file",
+ hidden=True,
+ static_data_name="machinefile",
+ static_data_template=machine_file_template)
+
+ self.add_column(title="Select",
+ help_text="Sets the selected machine as the project machine. You can only have one machine per project",
+ hideable=False,
+ filter_name="in_current_project",
+ static_data_name="add-del-layers",
+ static_data_template='{% include "machine_btn.html" %}')
+
+
+class LayerMachinesTable(MachinesTable):
+ """ Smaller version of the Machines table for use in layer details """
+
+ def __init__(self, *args, **kwargs):
+ super(LayerMachinesTable, self).__init__(*args, **kwargs)
+
+ def get_context_data(self, **kwargs):
+ context = super(LayerMachinesTable, self).get_context_data(**kwargs)
+ context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid'])
+ return context
+
+
+ def setup_queryset(self, *args, **kwargs):
+ MachinesTable.setup_queryset(self, *args, **kwargs)
+
+ self.queryset = self.queryset.filter(layer_version__pk=int(kwargs['layerid']))
+ self.queryset = self.queryset.order_by(self.default_orderby)
+ self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) & Q(layercommit=kwargs['layerid'])).count()
+
+ def setup_columns(self, *args, **kwargs):
+ self.add_column(title="Machine",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ self.add_column(title="Description",
+ field_name="description")
+
+ select_btn_template = '''
+ <a href="{% url "project" extra.pid %}?setMachine={{data.name}}"
+ class="btn btn-default btn-block select-machine-btn
+ {% if extra.in_prj == 0%}disabled{%endif%}">Select machine</a>
+ '''
+
+ self.add_column(title="Select machine",
+ static_data_name="add-del-layers",
+ static_data_template=select_btn_template)
+
+
+class RecipesTable(ToasterTable):
+ """Table of All Recipes in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(RecipesTable, self).__init__(*args, **kwargs)
+ self.empty_state = "Toaster has no recipe information. To generate recipe information you need to run a build."
+
+ build_col = { 'title' : "Build",
+ 'help_text' : "Before building a recipe, you might need to add the corresponding layer to your project",
+ 'hideable' : False,
+ 'filter_name' : "in_current_project",
+ 'static_data_name' : "add-del-layers",
+ 'static_data_template' : '{% include "recipe_btn.html" %}'}
+
+ def get_context_data(self, **kwargs):
+ project = Project.objects.get(pk=kwargs['pid'])
+ context = super(RecipesTable, self).get_context_data(**kwargs)
+
+ context['project'] = project
+ context['projectlayers'] = [player.layercommit.id for player in ProjectLayer.objects.filter(project=context['project'])]
+
+ return context
+
+ def setup_filters(self, *args, **kwargs):
+ table_filter = TableFilter(
+ 'in_current_project',
+ 'Filter by project recipes'
+ )
+
+ in_project_action = TableFilterActionToggle(
+ 'in_project',
+ 'Recipes provided by layers added to this project',
+ ProjectFilters.in_project(self.project_layers)
+ )
+
+ not_in_project_action = TableFilterActionToggle(
+ 'not_in_project',
+ 'Recipes provided by layers not added to this project',
+ ProjectFilters.not_in_project(self.project_layers)
+ )
+
+ table_filter.add_action(in_project_action)
+ table_filter.add_action(not_in_project_action)
+ self.add_filter(table_filter)
+
+ def setup_queryset(self, *args, **kwargs):
+ prj = Project.objects.get(pk = kwargs['pid'])
+
+ # Project layers used by the filters
+ self.project_layers = prj.get_project_layer_versions(pk=True)
+
+ # Project layers used to switch the button states
+ self.static_context_extra['current_layers'] = self.project_layers
+
+ self.queryset = prj.get_all_compatible_recipes()
+
+
+ def setup_columns(self, *args, **kwargs):
+
+ self.add_column(title="Version",
+ hidden=False,
+ field_name="version")
+
+ self.add_column(title="Description",
+ field_name="get_description_or_summary")
+
+ recipe_file_template = '''
+ <code>{{data.file_path}}</code>
+ <a href="{{data.get_vcs_recipe_file_link_url}}" target="_blank">
+ <span class="glyphicon glyphicon-new-window"></i>
+ </a>
+ '''
+
+ self.add_column(title="Recipe file",
+ help_text="Path to the recipe .bb file",
+ hidden=True,
+ static_data_name="recipe-file",
+ static_data_template=recipe_file_template)
+
+ self.add_column(title="Section",
+ help_text="The section in which recipes should be categorized",
+ hidden=True,
+ orderable=True,
+ field_name="section")
+
+ layer_link_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.layer_version.id %}">
+ {{data.layer_version.layer.name}}</a>
+ '''
+
+ self.add_column(title="Layer",
+ help_text="The name of the layer providing the recipe",
+ orderable=True,
+ static_data_name="layer_version__layer__name",
+ static_data_template=layer_link_template)
+
+ self.add_column(title="License",
+ help_text="The list of source licenses for the recipe. Multiple license names separated by the pipe character indicates a choice between licenses. Multiple license names separated by the ampersand character indicates multiple licenses exist that cover different parts of the source",
+ hidden=True,
+ orderable=True,
+ field_name="license")
+
+ revision_link_template = '''
+ {% if data.layer_version.layer.local_source_dir %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
+ {% else %}
+ {{data.layer_version.get_vcs_reference}}
+ {% endif %}
+ '''
+
+ self.add_column(title="Git revision",
+ hidden=True,
+ static_data_name="layer_version__get_vcs_reference",
+ static_data_template=revision_link_template)
+
+
+class LayerRecipesTable(RecipesTable):
+ """ Smaller version of the Recipes table for use in layer details """
+
+ def __init__(self, *args, **kwargs):
+ super(LayerRecipesTable, self).__init__(*args, **kwargs)
+ self.default_orderby = "name"
+
+ def get_context_data(self, **kwargs):
+ context = super(LayerRecipesTable, self).get_context_data(**kwargs)
+ context['layerversion'] = Layer_Version.objects.get(pk=kwargs['layerid'])
+ return context
+
+
+ def setup_queryset(self, *args, **kwargs):
+ self.queryset = \
+ Recipe.objects.filter(layer_version__pk=int(kwargs['layerid']))
+
+ self.queryset = self.queryset.order_by(self.default_orderby)
+ self.static_context_extra['in_prj'] = ProjectLayer.objects.filter(Q(project=kwargs['pid']) & Q(layercommit=kwargs['layerid'])).count()
+
+ def setup_columns(self, *args, **kwargs):
+ self.add_column(title="Recipe",
+ help_text="Information about a single piece of software, including where to download the source, configuration options, how to compile the source files and how to package the compiled output",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ self.add_column(title="Version",
+ field_name="version")
+
+ self.add_column(title="Description",
+ field_name="get_description_or_summary")
+
+ build_recipe_template = '''
+ <a class="btn btn-default btn-block build-recipe-btn
+ {% if extra.in_prj == 0 %}disabled{% endif %}"
+ data-recipe-name="{{data.name}}">Build recipe</a>
+ '''
+
+ self.add_column(title="Build recipe",
+ static_data_name="add-del-layers",
+ static_data_template=build_recipe_template)
+
+class CustomImagesTable(ToasterTable):
+ """ Table to display your custom images """
+ def __init__(self, *args, **kwargs):
+ super(CustomImagesTable, self).__init__(*args, **kwargs)
+ self.title = "Custom images"
+ self.default_orderby = "name"
+
+ def get_context_data(self, **kwargs):
+ context = super(CustomImagesTable, self).get_context_data(**kwargs)
+
+ empty_state_template = '''
+ You have not created any custom images yet.
+ <a href="{% url 'newcustomimage' data.pid %}">
+ Create your first custom image</a>
+ '''
+ context['empty_state'] = self.render_static_data(empty_state_template,
+ kwargs)
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ # TODO put project into the ToasterTable base class
+ context['project'] = project
+ return context
+
+ def setup_queryset(self, *args, **kwargs):
+ prj = Project.objects.get(pk = kwargs['pid'])
+ self.queryset = CustomImageRecipe.objects.filter(project=prj)
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ def setup_columns(self, *args, **kwargs):
+
+ name_link_template = '''
+ <a href="{% url 'customrecipe' extra.pid data.id %}">
+ {{data.name}}
+ </a>
+ '''
+
+ self.add_column(title="Custom image",
+ hideable=False,
+ orderable=True,
+ field_name="name",
+ static_data_name="name",
+ static_data_template=name_link_template)
+
+ recipe_file_template = '''
+ {% if data.get_base_recipe_file %}
+ <code>{{data.name}}_{{data.version}}.bb</code>
+ <a href="{% url 'customrecipedownload' extra.pid data.pk %}"
+ class="glyphicon glyphicon-download-alt get-help" title="Download recipe file"></a>
+ {% endif %}'''
+
+ self.add_column(title="Recipe file",
+ static_data_name='recipe_file_download',
+ static_data_template=recipe_file_template)
+
+ approx_packages_template = '''
+ {% if data.get_all_packages.count > 0 %}
+ <a href="{% url 'customrecipe' extra.pid data.id %}">
+ {{data.get_all_packages.count}}
+ </a>
+ {% endif %}'''
+
+ self.add_column(title="Packages",
+ static_data_name='approx_packages',
+ static_data_template=approx_packages_template)
+
+
+ build_btn_template = '''
+ <button data-recipe-name="{{data.name}}"
+ class="btn btn-default btn-block build-recipe-btn">
+ Build
+ </button>'''
+
+ self.add_column(title="Build",
+ hideable=False,
+ static_data_name='build_custom_img',
+ static_data_template=build_btn_template)
+
+class ImageRecipesTable(RecipesTable):
+ """ A subset of the recipes table which displayed just image recipes """
+
+ def __init__(self, *args, **kwargs):
+ super(ImageRecipesTable, self).__init__(*args, **kwargs)
+ self.title = "Compatible image recipes"
+ self.default_orderby = "name"
+
+ def setup_queryset(self, *args, **kwargs):
+ super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
+
+ custom_image_recipes = CustomImageRecipe.objects.filter(
+ project=kwargs['pid'])
+ self.queryset = self.queryset.filter(
+ Q(is_image=True) & ~Q(pk__in=custom_image_recipes))
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+
+ def setup_columns(self, *args, **kwargs):
+
+ name_link_template = '''
+ <a href="{% url 'recipedetails' extra.pid data.pk %}">{{data.name}}</a>
+ '''
+
+ self.add_column(title="Image recipe",
+ help_text="When you build an image recipe, you get an "
+ "image: a root file system you can"
+ "deploy to a machine",
+ hideable=False,
+ orderable=True,
+ static_data_name="name",
+ static_data_template=name_link_template,
+ field_name="name")
+
+ super(ImageRecipesTable, self).setup_columns(*args, **kwargs)
+
+ self.add_column(**RecipesTable.build_col)
+
+
+class NewCustomImagesTable(ImageRecipesTable):
+ """ Table which displays Images recipes which can be customised """
+ def __init__(self, *args, **kwargs):
+ super(NewCustomImagesTable, self).__init__(*args, **kwargs)
+ self.title = "Select the image recipe you want to customise"
+
+ def setup_queryset(self, *args, **kwargs):
+ super(ImageRecipesTable, self).setup_queryset(*args, **kwargs)
+ prj = Project.objects.get(pk = kwargs['pid'])
+ self.static_context_extra['current_layers'] = \
+ prj.get_project_layer_versions(pk=True)
+
+ self.queryset = self.queryset.filter(is_image=True)
+
+ def setup_columns(self, *args, **kwargs):
+
+ name_link_template = '''
+ <a href="{% url 'recipedetails' extra.pid data.pk %}">{{data.name}}</a>
+ '''
+
+ self.add_column(title="Image recipe",
+ help_text="When you build an image recipe, you get an "
+ "image: a root file system you can"
+ "deploy to a machine",
+ hideable=False,
+ orderable=True,
+ static_data_name="name",
+ static_data_template=name_link_template,
+ field_name="name")
+
+ super(ImageRecipesTable, self).setup_columns(*args, **kwargs)
+
+ self.add_column(title="Customise",
+ hideable=False,
+ filter_name="in_current_project",
+ static_data_name="customise-or-add-recipe",
+ static_data_template='{% include "customise_btn.html" %}')
+
+
+class SoftwareRecipesTable(RecipesTable):
+ """ Displays just the software recipes """
+ def __init__(self, *args, **kwargs):
+ super(SoftwareRecipesTable, self).__init__(*args, **kwargs)
+ self.title = "Compatible software recipes"
+ self.default_orderby = "name"
+
+ def setup_queryset(self, *args, **kwargs):
+ super(SoftwareRecipesTable, self).setup_queryset(*args, **kwargs)
+
+ self.queryset = self.queryset.filter(is_image=False)
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+
+ def setup_columns(self, *args, **kwargs):
+ self.add_column(title="Software recipe",
+ help_text="Information about a single piece of "
+ "software, including where to download the source, "
+ "configuration options, how to compile the source "
+ "files and how to package the compiled output",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ super(SoftwareRecipesTable, self).setup_columns(*args, **kwargs)
+
+ self.add_column(**RecipesTable.build_col)
+
+class PackagesTable(ToasterTable):
+ """ Table to display the packages in a recipe from it's last successful
+ build"""
+
+ def __init__(self, *args, **kwargs):
+ super(PackagesTable, self).__init__(*args, **kwargs)
+ self.title = "Packages included"
+ self.packages = None
+ self.default_orderby = "name"
+
+ def create_package_list(self, recipe, project_id):
+ """Creates a list of packages for the specified recipe by looking for
+ the last SUCCEEDED build of ther recipe"""
+
+ target = Target.objects.filter(Q(target=recipe.name) &
+ Q(build__project_id=project_id) &
+ Q(build__outcome=Build.SUCCEEDED)
+ ).last()
+
+ if target:
+ pkgs = target.target_installed_package_set.values_list('package',
+ flat=True)
+ return Package.objects.filter(pk__in=pkgs)
+
+ # Target/recipe never successfully built so empty queryset
+ return Package.objects.none()
+
+ def get_context_data(self, **kwargs):
+ """Context for rendering the sidebar and other items on the recipe
+ details page """
+ context = super(PackagesTable, self).get_context_data(**kwargs)
+
+ recipe = Recipe.objects.get(pk=kwargs['recipe_id'])
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ in_project = (recipe.layer_version.pk in
+ project.get_project_layer_versions(pk=True))
+
+ packages = self.create_package_list(recipe, project.pk)
+
+ context.update({'project': project,
+ 'recipe' : recipe,
+ 'packages': packages,
+ 'approx_pkg_size' : packages.aggregate(Sum('size')),
+ 'in_project' : in_project,
+ })
+
+ return context
+
+ def setup_queryset(self, *args, **kwargs):
+ recipe = Recipe.objects.get(pk=kwargs['recipe_id'])
+ self.static_context_extra['target_name'] = recipe.name
+
+ self.queryset = self.create_package_list(recipe, kwargs['pid'])
+ self.queryset = self.queryset.order_by('name')
+
+ def setup_columns(self, *args, **kwargs):
+ self.add_column(title="Package",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ self.add_column(title="Package Version",
+ field_name="version",
+ hideable=False)
+
+ self.add_column(title="Approx Size",
+ orderable=True,
+ field_name="size",
+ static_data_name="size",
+ static_data_template="{% load projecttags %} \
+ {{data.size|filtered_filesizeformat}}")
+
+ self.add_column(title="License",
+ field_name="license",
+ orderable=True,
+ hidden=True)
+
+
+ self.add_column(title="Dependencies",
+ static_data_name="dependencies",
+ static_data_template='\
+ {% include "snippets/pkg_dependencies_popover.html" %}')
+
+ self.add_column(title="Reverse dependencies",
+ static_data_name="reverse_dependencies",
+ static_data_template='\
+ {% include "snippets/pkg_revdependencies_popover.html" %}',
+ hidden=True)
+
+ self.add_column(title="Recipe",
+ field_name="recipe__name",
+ orderable=True,
+ hidden=True)
+
+ self.add_column(title="Recipe version",
+ field_name="recipe__version",
+ hidden=True)
+
+
+class SelectPackagesTable(PackagesTable):
+ """ Table to display the packages to add and remove from an image """
+
+ def __init__(self, *args, **kwargs):
+ super(SelectPackagesTable, self).__init__(*args, **kwargs)
+ self.title = "Add | Remove packages"
+
+ def setup_queryset(self, *args, **kwargs):
+ self.cust_recipe =\
+ CustomImageRecipe.objects.get(pk=kwargs['custrecipeid'])
+ prj = Project.objects.get(pk = kwargs['pid'])
+
+ current_packages = self.cust_recipe.get_all_packages()
+
+ current_recipes = prj.get_available_recipes()
+
+ # only show packages where recipes->layers are in the project
+ self.queryset = CustomImagePackage.objects.filter(
+ ~Q(recipe=None) &
+ Q(recipe__in=current_recipes))
+
+ self.queryset = self.queryset.order_by('name')
+
+ # This target is the target used to work out which group of dependences
+ # to display, if we've built the custom image we use it otherwise we
+ # can use the based recipe instead
+ if prj.build_set.filter(target__target=self.cust_recipe.name).count()\
+ > 0:
+ self.static_context_extra['target_name'] = self.cust_recipe.name
+ else:
+ self.static_context_extra['target_name'] =\
+ Package_DependencyManager.TARGET_LATEST
+
+ self.static_context_extra['recipe_id'] = kwargs['custrecipeid']
+
+
+ self.static_context_extra['current_packages'] = \
+ current_packages.values_list('pk', flat=True)
+
+ def get_context_data(self, **kwargs):
+ # to reuse the Super class map the custrecipeid to the recipe_id
+ kwargs['recipe_id'] = kwargs['custrecipeid']
+ context = super(SelectPackagesTable, self).get_context_data(**kwargs)
+ custom_recipe = \
+ CustomImageRecipe.objects.get(pk=kwargs['custrecipeid'])
+
+ context['recipe'] = custom_recipe
+ context['approx_pkg_size'] = \
+ custom_recipe.get_all_packages().aggregate(Sum('size'))
+ return context
+
+
+ def setup_columns(self, *args, **kwargs):
+ super(SelectPackagesTable, self).setup_columns(*args, **kwargs)
+
+ add_remove_template = '{% include "pkg_add_rm_btn.html" %}'
+
+ self.add_column(title="Add | Remove",
+ hideable=False,
+ help_text="Use the add and remove buttons to modify "
+ "the package content of your custom image",
+ static_data_name="add_rm_pkg_btn",
+ static_data_template=add_remove_template,
+ filter_name='in_current_image_filter')
+
+ def setup_filters(self, *args, **kwargs):
+ in_current_image_filter = TableFilter(
+ 'in_current_image_filter',
+ 'Filter by added packages'
+ )
+
+ in_image_action = TableFilterActionToggle(
+ 'in_image',
+ 'Packages in %s' % self.cust_recipe.name,
+ Q(pk__in=self.static_context_extra['current_packages'])
+ )
+
+ not_in_image_action = TableFilterActionToggle(
+ 'not_in_image',
+ 'Packages not added to %s' % self.cust_recipe.name,
+ ~Q(pk__in=self.static_context_extra['current_packages'])
+ )
+
+ in_current_image_filter.add_action(in_image_action)
+ in_current_image_filter.add_action(not_in_image_action)
+ self.add_filter(in_current_image_filter)
+
+class ProjectsTable(ToasterTable):
+ """Table of projects in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(ProjectsTable, self).__init__(*args, **kwargs)
+ self.default_orderby = '-updated'
+ self.title = 'All projects'
+ self.static_context_extra['Build'] = Build
+
+ def get_context_data(self, **kwargs):
+ return super(ProjectsTable, self).get_context_data(**kwargs)
+
+ def setup_queryset(self, *args, **kwargs):
+ queryset = Project.objects.all()
+
+ # annotate each project with its number of builds
+ queryset = queryset.annotate(num_builds=Count('build'))
+
+ # exclude the command line builds project if it has no builds
+ q_default_with_builds = Q(is_default=True) & Q(num_builds__gt=0)
+ queryset = queryset.filter(Q(is_default=False) |
+ q_default_with_builds)
+
+ # order rows
+ queryset = queryset.order_by(self.default_orderby)
+
+ self.queryset = queryset
+
+ # columns: last activity on (updated) - DEFAULT, project (name), release,
+ # machine, number of builds, last build outcome, recipe (name), errors,
+ # warnings, image files
+ def setup_columns(self, *args, **kwargs):
+ name_template = '''
+ {% load project_url_tag %}
+ <span data-project-field="name">
+ <a href="{% project_url data %}">
+ {{data.name}}
+ </a>
+ </span>
+ '''
+
+ last_activity_on_template = '''
+ {% load project_url_tag %}
+ <span data-project-field="updated">
+ {{data.updated | date:"d/m/y H:i"}}
+ </span>
+ '''
+
+ release_template = '''
+ <span data-project-field="release">
+ {% if data.release %}
+ {{data.release.name}}
+ {% elif data.is_default %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help hover-help"
+ title="This project does not have a release set.
+ It simply collects information about the builds you start from
+ the command line while Toaster is running"
+ style="visibility: hidden;">
+ </span>
+ {% else %}
+ No release available
+ {% endif %}
+ </span>
+ '''
+
+ machine_template = '''
+ <span data-project-field="machine">
+ {% if data.is_default %}
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help hover-help"
+ title="This project does not have a machine
+ set. It simply collects information about the builds you
+ start from the command line while Toaster is running"
+ style="visibility: hidden;"></span>
+ {% else %}
+ {{data.get_current_machine_name}}
+ {% endif %}
+ </span>
+ '''
+
+ number_of_builds_template = '''
+ {% if data.get_number_of_builds > 0 %}
+ <a href="{% url 'projectbuilds' data.id %}">
+ {{data.get_number_of_builds}}
+ </a>
+ {% endif %}
+ '''
+
+ last_build_outcome_template = '''
+ {% if data.get_number_of_builds > 0 %}
+ {% if data.get_last_outcome == extra.Build.SUCCEEDED %}
+ <span class="glyphicon glyphicon-ok-circle"></span>
+ {% elif data.get_last_outcome == extra.Build.FAILED %}
+ <span class="glyphicon glyphicon-minus-sign"></span>
+ {% endif %}
+ {% endif %}
+ '''
+
+ recipe_template = '''
+ {% if data.get_number_of_builds > 0 %}
+ <a href="{% url "builddashboard" data.get_last_build_id %}">
+ {{data.get_last_target}}
+ </a>
+ {% endif %}
+ '''
+
+ errors_template = '''
+ {% if data.get_number_of_builds > 0 and data.get_last_errors > 0 %}
+ <a class="errors.count text-danger"
+ href="{% url "builddashboard" data.get_last_build_id %}#errors">
+ {{data.get_last_errors}} error{{data.get_last_errors | pluralize}}
+ </a>
+ {% endif %}
+ '''
+
+ warnings_template = '''
+ {% if data.get_number_of_builds > 0 and data.get_last_warnings > 0 %}
+ <a class="warnings.count text-warning"
+ href="{% url "builddashboard" data.get_last_build_id %}#warnings">
+ {{data.get_last_warnings}} warning{{data.get_last_warnings | pluralize}}
+ </a>
+ {% endif %}
+ '''
+
+ image_files_template = '''
+ {% if data.get_number_of_builds > 0 and data.get_last_outcome == extra.Build.SUCCEEDED %}
+ {{data.get_last_build_extensions}}
+ {% endif %}
+ '''
+
+ self.add_column(title='Project',
+ hideable=False,
+ orderable=True,
+ static_data_name='name',
+ static_data_template=name_template)
+
+ self.add_column(title='Last activity on',
+ help_text='Starting date and time of the \
+ last project build. If the project has no \
+ builds, this shows the date the project was \
+ created.',
+ hideable=False,
+ orderable=True,
+ static_data_name='updated',
+ static_data_template=last_activity_on_template)
+
+ self.add_column(title='Release',
+ help_text='The version of the build system used by \
+ the project',
+ hideable=False,
+ orderable=True,
+ static_data_name='release',
+ static_data_template=release_template)
+
+ self.add_column(title='Machine',
+ help_text='The hardware currently selected for the \
+ project',
+ hideable=False,
+ orderable=False,
+ static_data_name='machine',
+ static_data_template=machine_template)
+
+ self.add_column(title='Builds',
+ help_text='The number of builds which have been run \
+ for the project',
+ hideable=False,
+ orderable=False,
+ static_data_name='number_of_builds',
+ static_data_template=number_of_builds_template)
+
+ self.add_column(title='Last build outcome',
+ help_text='Indicates whether the last project build \
+ completed successfully or failed',
+ hideable=True,
+ orderable=False,
+ static_data_name='last_build_outcome',
+ static_data_template=last_build_outcome_template)
+
+ self.add_column(title='Recipe',
+ help_text='The last recipe which was built in this \
+ project',
+ hideable=True,
+ orderable=False,
+ static_data_name='recipe_name',
+ static_data_template=recipe_template)
+
+ self.add_column(title='Errors',
+ help_text='The number of errors encountered during \
+ the last project build (if any)',
+ hideable=True,
+ orderable=False,
+ static_data_name='errors',
+ static_data_template=errors_template)
+
+ self.add_column(title='Warnings',
+ help_text='The number of warnings encountered during \
+ the last project build (if any)',
+ hideable=True,
+ hidden=True,
+ orderable=False,
+ static_data_name='warnings',
+ static_data_template=warnings_template)
+
+ self.add_column(title='Image files',
+ help_text='The root file system types produced by \
+ the last project build',
+ hideable=True,
+ hidden=True,
+ orderable=False,
+ static_data_name='image_files',
+ static_data_template=image_files_template)
+
+class BuildsTable(ToasterTable):
+ """Table of builds in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(BuildsTable, self).__init__(*args, **kwargs)
+ self.default_orderby = '-completed_on'
+ self.static_context_extra['Build'] = Build
+ self.static_context_extra['Task'] = Task
+
+ # attributes that are overridden in subclasses
+
+ # title for the page
+ self.title = ''
+
+ # 'project' or 'all'; determines how the mrb (most recent builds)
+ # section is displayed
+ self.mrb_type = ''
+
+ def get_builds(self):
+ """
+ overridden in ProjectBuildsTable to return builds for a
+ single project
+ """
+ return Build.objects.all()
+
+ def get_context_data(self, **kwargs):
+ context = super(BuildsTable, self).get_context_data(**kwargs)
+
+ # should be set in subclasses
+ context['mru'] = []
+
+ context['mrb_type'] = self.mrb_type
+
+ return context
+
+ def setup_queryset(self, *args, **kwargs):
+ """
+ The queryset is annotated so that it can be sorted by number of
+ errors and number of warnings; but note that the criteria for
+ finding the log messages to populate these fields should match those
+ used in the Build model (orm/models.py) to populate the errors and
+ warnings properties
+ """
+ queryset = self.get_builds()
+
+ # Don't include in progress builds pr cancelled builds
+ queryset = queryset.exclude(Q(outcome=Build.IN_PROGRESS) |
+ Q(outcome=Build.CANCELLED))
+
+ # sort
+ queryset = queryset.order_by(self.default_orderby)
+
+ # annotate with number of ERROR, EXCEPTION and CRITICAL log messages
+ criteria = (Q(logmessage__level=LogMessage.ERROR) |
+ Q(logmessage__level=LogMessage.EXCEPTION) |
+ Q(logmessage__level=LogMessage.CRITICAL))
+
+ queryset = queryset.annotate(
+ errors_no=Count(
+ Case(
+ When(criteria, then=Value(1)),
+ output_field=IntegerField()
+ )
+ )
+ )
+
+ # annotate with number of WARNING log messages
+ queryset = queryset.annotate(
+ warnings_no=Count(
+ Case(
+ When(logmessage__level=LogMessage.WARNING, then=Value(1)),
+ output_field=IntegerField()
+ )
+ )
+ )
+
+ self.queryset = queryset
+
+ def setup_columns(self, *args, **kwargs):
+ outcome_template = '''
+ {% if data.outcome == data.SUCCEEDED %}
+ <span class="glyphicon glyphicon-ok-circle"></span>
+ {% elif data.outcome == data.FAILED %}
+ <span class="glyphicon glyphicon-minus-sign"></span>
+ {% endif %}
+
+ {% if data.cooker_log_path %}
+ &nbsp;
+ <a href="{% url "build_artifact" data.id "cookerlog" data.id %}">
+ <span class="glyphicon glyphicon-download-alt get-help"
+ data-original-title="Download build log"></span>
+ </a>
+ {% endif %}
+ '''
+
+ recipe_template = '''
+ {% for target_label in data.target_labels %}
+ <a href="{% url "builddashboard" data.id %}">
+ {{target_label}}
+ </a>
+ <br />
+ {% endfor %}
+ '''
+
+ machine_template = '''
+ {{data.machine}}
+ '''
+
+ started_on_template = '''
+ {{data.started_on | date:"d/m/y H:i"}}
+ '''
+
+ completed_on_template = '''
+ {{data.completed_on | date:"d/m/y H:i"}}
+ '''
+
+ failed_tasks_template = '''
+ {% if data.failed_tasks.count == 1 %}
+ <a class="text-danger" href="{% url "task" data.id data.failed_tasks.0.id %}">
+ <span>
+ {{data.failed_tasks.0.recipe.name}} {{data.failed_tasks.0.task_name}}
+ </span>
+ </a>
+ <a href="{% url "build_artifact" data.id "tasklogfile" data.failed_tasks.0.id %}">
+ <span class="glyphicon glyphicon-download-alt get-help"
+ title="Download task log file">
+ </span>
+ </a>
+ {% elif data.failed_tasks.count > 1 %}
+ <a href="{% url "tasks" data.id %}?filter=outcome%3A{{extra.Task.OUTCOME_FAILED}}">
+ <span class="text-danger">{{data.failed_tasks.count}} tasks</span>
+ </a>
+ {% endif %}
+ '''
+
+ errors_template = '''
+ {% if data.errors_no %}
+ <a class="errors.count text-danger" href="{% url "builddashboard" data.id %}#errors">
+ {{data.errors_no}} error{{data.errors_no|pluralize}}
+ </a>
+ {% endif %}
+ '''
+
+ warnings_template = '''
+ {% if data.warnings_no %}
+ <a class="warnings.count text-warning" href="{% url "builddashboard" data.id %}#warnings">
+ {{data.warnings_no}} warning{{data.warnings_no|pluralize}}
+ </a>
+ {% endif %}
+ '''
+
+ time_template = '''
+ {% load projecttags %}
+ {% if data.outcome == extra.Build.SUCCEEDED %}
+ <a href="{% url "buildtime" data.id %}">
+ {{data.timespent_seconds | sectohms}}
+ </a>
+ {% else %}
+ {{data.timespent_seconds | sectohms}}
+ {% endif %}
+ '''
+
+ image_files_template = '''
+ {% if data.outcome == extra.Build.SUCCEEDED %}
+ {{data.get_image_file_extensions}}
+ {% endif %}
+ '''
+
+ self.add_column(title='Outcome',
+ help_text='Final state of the build (successful \
+ or failed)',
+ hideable=False,
+ orderable=True,
+ filter_name='outcome_filter',
+ static_data_name='outcome',
+ static_data_template=outcome_template)
+
+ self.add_column(title='Recipe',
+ help_text='What was built (i.e. one or more recipes \
+ or image recipes)',
+ hideable=False,
+ orderable=False,
+ static_data_name='target',
+ static_data_template=recipe_template)
+
+ self.add_column(title='Machine',
+ help_text='Hardware for which you are building a \
+ recipe or image recipe',
+ hideable=False,
+ orderable=True,
+ static_data_name='machine',
+ static_data_template=machine_template)
+
+ self.add_column(title='Started on',
+ help_text='The date and time when the build started',
+ hideable=True,
+ hidden=True,
+ orderable=True,
+ filter_name='started_on_filter',
+ static_data_name='started_on',
+ static_data_template=started_on_template)
+
+ self.add_column(title='Completed on',
+ help_text='The date and time when the build finished',
+ hideable=False,
+ orderable=True,
+ filter_name='completed_on_filter',
+ static_data_name='completed_on',
+ static_data_template=completed_on_template)
+
+ self.add_column(title='Failed tasks',
+ help_text='The number of tasks which failed during \
+ the build',
+ hideable=True,
+ orderable=False,
+ filter_name='failed_tasks_filter',
+ static_data_name='failed_tasks',
+ static_data_template=failed_tasks_template)
+
+ self.add_column(title='Errors',
+ help_text='The number of errors encountered during \
+ the build (if any)',
+ hideable=True,
+ orderable=True,
+ static_data_name='errors_no',
+ static_data_template=errors_template)
+
+ self.add_column(title='Warnings',
+ help_text='The number of warnings encountered during \
+ the build (if any)',
+ hideable=True,
+ orderable=True,
+ static_data_name='warnings_no',
+ static_data_template=warnings_template)
+
+ self.add_column(title='Time',
+ help_text='How long the build took to finish',
+ hideable=True,
+ hidden=True,
+ orderable=False,
+ static_data_name='time',
+ static_data_template=time_template)
+
+ self.add_column(title='Image files',
+ help_text='The root file system types produced by \
+ the build',
+ hideable=True,
+ orderable=False,
+ static_data_name='image_files',
+ static_data_template=image_files_template)
+
+ def setup_filters(self, *args, **kwargs):
+ # outcomes
+ outcome_filter = TableFilter(
+ 'outcome_filter',
+ 'Filter builds by outcome'
+ )
+
+ successful_builds_action = TableFilterActionToggle(
+ 'successful_builds',
+ 'Successful builds',
+ Q(outcome=Build.SUCCEEDED)
+ )
+
+ failed_builds_action = TableFilterActionToggle(
+ 'failed_builds',
+ 'Failed builds',
+ Q(outcome=Build.FAILED)
+ )
+
+ outcome_filter.add_action(successful_builds_action)
+ outcome_filter.add_action(failed_builds_action)
+ self.add_filter(outcome_filter)
+
+ # started on
+ started_on_filter = TableFilter(
+ 'started_on_filter',
+ 'Filter by date when build was started'
+ )
+
+ started_today_action = TableFilterActionDay(
+ 'today',
+ 'Today\'s builds',
+ 'started_on',
+ 'today'
+ )
+
+ started_yesterday_action = TableFilterActionDay(
+ 'yesterday',
+ 'Yesterday\'s builds',
+ 'started_on',
+ 'yesterday'
+ )
+
+ by_started_date_range_action = TableFilterActionDateRange(
+ 'date_range',
+ 'Build date range',
+ 'started_on'
+ )
+
+ started_on_filter.add_action(started_today_action)
+ started_on_filter.add_action(started_yesterday_action)
+ started_on_filter.add_action(by_started_date_range_action)
+ self.add_filter(started_on_filter)
+
+ # completed on
+ completed_on_filter = TableFilter(
+ 'completed_on_filter',
+ 'Filter by date when build was completed'
+ )
+
+ completed_today_action = TableFilterActionDay(
+ 'today',
+ 'Today\'s builds',
+ 'completed_on',
+ 'today'
+ )
+
+ completed_yesterday_action = TableFilterActionDay(
+ 'yesterday',
+ 'Yesterday\'s builds',
+ 'completed_on',
+ 'yesterday'
+ )
+
+ by_completed_date_range_action = TableFilterActionDateRange(
+ 'date_range',
+ 'Build date range',
+ 'completed_on'
+ )
+
+ completed_on_filter.add_action(completed_today_action)
+ completed_on_filter.add_action(completed_yesterday_action)
+ completed_on_filter.add_action(by_completed_date_range_action)
+ self.add_filter(completed_on_filter)
+
+ # failed tasks
+ failed_tasks_filter = TableFilter(
+ 'failed_tasks_filter',
+ 'Filter builds by failed tasks'
+ )
+
+ criteria = Q(task_build__outcome=Task.OUTCOME_FAILED)
+
+ with_failed_tasks_action = TableFilterActionToggle(
+ 'with_failed_tasks',
+ 'Builds with failed tasks',
+ criteria
+ )
+
+ without_failed_tasks_action = TableFilterActionToggle(
+ 'without_failed_tasks',
+ 'Builds without failed tasks',
+ ~criteria
+ )
+
+ failed_tasks_filter.add_action(with_failed_tasks_action)
+ failed_tasks_filter.add_action(without_failed_tasks_action)
+ self.add_filter(failed_tasks_filter)
+
+
+class AllBuildsTable(BuildsTable):
+ """ Builds page for all builds """
+
+ def __init__(self, *args, **kwargs):
+ super(AllBuildsTable, self).__init__(*args, **kwargs)
+ self.title = 'All builds'
+ self.mrb_type = 'all'
+
+ def setup_columns(self, *args, **kwargs):
+ """
+ All builds page shows a column for the project
+ """
+
+ super(AllBuildsTable, self).setup_columns(*args, **kwargs)
+
+ project_template = '''
+ {% load project_url_tag %}
+ <a href="{% project_url data.project %}">
+ {{data.project.name}}
+ </a>
+ {% if data.project.is_default %}
+ <span class="glyphicon glyphicon-question-sign get-help hover-help" title=""
+ data-original-title="This project shows information about
+ the builds you start from the command line while Toaster is
+ running" style="visibility: hidden;"></span>
+ {% endif %}
+ '''
+
+ self.add_column(title='Project',
+ hideable=True,
+ orderable=True,
+ static_data_name='project',
+ static_data_template=project_template)
+
+ def get_context_data(self, **kwargs):
+ """ Get all builds for the recent builds area """
+ context = super(AllBuildsTable, self).get_context_data(**kwargs)
+ context['mru'] = Build.get_recent()
+ return context
+
+class ProjectBuildsTable(BuildsTable):
+ """
+ Builds page for a single project; a BuildsTable, with the queryset
+ filtered by project
+ """
+
+ def __init__(self, *args, **kwargs):
+ super(ProjectBuildsTable, self).__init__(*args, **kwargs)
+ self.title = 'All project builds'
+ self.mrb_type = 'project'
+
+ # set from the querystring
+ self.project_id = None
+
+ def setup_columns(self, *args, **kwargs):
+ """
+ Project builds table doesn't show the machines column by default
+ """
+
+ super(ProjectBuildsTable, self).setup_columns(*args, **kwargs)
+
+ # hide the machine column
+ self.set_column_hidden('Machine', True)
+
+ # allow the machine column to be hidden by the user
+ self.set_column_hideable('Machine', True)
+
+ def setup_queryset(self, *args, **kwargs):
+ """
+ NOTE: self.project_id must be set before calling super(),
+ as it's used in setup_queryset()
+ """
+ self.project_id = kwargs['pid']
+ super(ProjectBuildsTable, self).setup_queryset(*args, **kwargs)
+ project = Project.objects.get(pk=self.project_id)
+ self.queryset = self.queryset.filter(project=project)
+
+ def get_context_data(self, **kwargs):
+ """
+ Get recent builds for this project, and the project itself
+
+ NOTE: self.project_id must be set before calling super(),
+ as it's used in get_context_data()
+ """
+ self.project_id = kwargs['pid']
+ context = super(ProjectBuildsTable, self).get_context_data(**kwargs)
+
+ empty_state_template = '''
+ This project has no builds.
+ <a href="{% url 'projectimagerecipes' data.pid %}">
+ Choose a recipe to build</a>
+ '''
+ context['empty_state'] = self.render_static_data(empty_state_template,
+ kwargs)
+
+ project = Project.objects.get(pk=self.project_id)
+ context['mru'] = Build.get_recent(project)
+ context['project'] = project
+
+ self.setup_queryset(**kwargs)
+ if self.queryset.count() == 0 and \
+ project.build_set.filter(outcome=Build.IN_PROGRESS).count() > 0:
+ context['build_in_progress_none_completed'] = True
+ else:
+ context['build_in_progress_none_completed'] = False
+
+ return context
+
+
+class DistrosTable(ToasterTable):
+ """Table of Distros in Toaster"""
+
+ def __init__(self, *args, **kwargs):
+ super(DistrosTable, self).__init__(*args, **kwargs)
+ self.empty_state = "Toaster has no distro information for this project. Sadly, distro information cannot be obtained from builds, so this page will remain empty."
+ self.title = "Compatible Distros"
+ self.default_orderby = "name"
+
+ def get_context_data(self, **kwargs):
+ context = super(DistrosTable, self).get_context_data(**kwargs)
+ context['project'] = Project.objects.get(pk=kwargs['pid'])
+ return context
+
+ def setup_filters(self, *args, **kwargs):
+ project = Project.objects.get(pk=kwargs['pid'])
+
+ in_current_project_filter = TableFilter(
+ "in_current_project",
+ "Filter by project Distros"
+ )
+
+ in_project_action = TableFilterActionToggle(
+ "in_project",
+ "Distro provided by layers added to this project",
+ ProjectFilters.in_project(self.project_layers)
+ )
+
+ not_in_project_action = TableFilterActionToggle(
+ "not_in_project",
+ "Distros provided by layers not added to this project",
+ ProjectFilters.not_in_project(self.project_layers)
+ )
+
+ in_current_project_filter.add_action(in_project_action)
+ in_current_project_filter.add_action(not_in_project_action)
+ self.add_filter(in_current_project_filter)
+
+ def setup_queryset(self, *args, **kwargs):
+ prj = Project.objects.get(pk = kwargs['pid'])
+ self.queryset = prj.get_all_compatible_distros()
+ self.queryset = self.queryset.order_by(self.default_orderby)
+
+ self.static_context_extra['current_layers'] = \
+ self.project_layers = \
+ prj.get_project_layer_versions(pk=True)
+
+ def setup_columns(self, *args, **kwargs):
+
+ self.add_column(title="Distro",
+ hideable=False,
+ orderable=True,
+ field_name="name")
+
+ self.add_column(title="Description",
+ field_name="description")
+
+ layer_link_template = '''
+ <a href="{% url 'layerdetails' extra.pid data.layer_version.id %}">
+ {{data.layer_version.layer.name}}</a>
+ '''
+
+ self.add_column(title="Layer",
+ static_data_name="layer_version__layer__name",
+ static_data_template=layer_link_template,
+ orderable=True)
+
+ self.add_column(title="Git revision",
+ help_text="The Git branch, tag or commit. For the layers from the OpenEmbedded layer source, the revision is always the branch compatible with the Yocto Project version you selected for this project",
+ hidden=True,
+ field_name="layer_version__get_vcs_reference")
+
+ wrtemplate_file_template = '''<code>conf/machine/{{data.name}}.conf</code>
+ <a href="{{data.get_vcs_machine_file_link_url}}" target="_blank"><span class="glyphicon glyphicon-new-window"></i></a>'''
+
+ self.add_column(title="Distro file",
+ hidden=True,
+ static_data_name="templatefile",
+ static_data_template=wrtemplate_file_template)
+
+
+ self.add_column(title="Select",
+ help_text="Sets the selected distro to the project",
+ hideable=False,
+ filter_name="in_current_project",
+ static_data_name="add-del-layers",
+ static_data_template='{% include "distro_btn.html" %}')
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/base.html b/poky/bitbake/lib/toaster/toastergui/templates/base.html
new file mode 100644
index 000000000..4f7206489
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/base.html
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+{% load static %}
+{% load projecttags %}
+{% load project_url_tag %}
+<html lang="en">
+ <head>
+ <title>
+ {% block title %} Toaster {% endblock %}
+ </title>
+ <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css"/>
+ <!--link rel="stylesheet" href="{% static 'css/bootstrap-theme.css' %}" type="text/css"/-->
+ <link rel="stylesheet" href="{% static 'css/font-awesome.min.css' %}" type='text/css'/>
+ <link rel="stylesheet" href="{% static 'css/default.css' %}" type='text/css'/>
+
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
+ <script src="{% static 'js/jquery-2.0.3.min.js' %}">
+ </script>
+ <script src="{% static 'js/jquery.cookie.js' %}">
+ </script>
+ <script src="{% static 'js/bootstrap.min.js' %}">
+ </script>
+ <script src="{% static 'js/typeahead.jquery.js' %}">
+ </script>
+ <script src="{% static 'js/jsrender.min.js' %}">
+ </script>
+ <script src="{% static 'js/highlight.pack.js' %}">
+ </script>
+ <script src="{% static 'js/libtoaster.js' %}">
+ </script>
+ {% if DEBUG %}
+ <script>
+ libtoaster.debug = true;
+ </script>
+ {% endif %}
+ <script>
+ $.views.settings.delimiters("<%", "%>");
+
+ libtoaster.ctx = {
+ jsUrl : "{% static 'js/' %}",
+ htmlUrl : "{% static 'html/' %}",
+ projectsUrl : "{% url 'all-projects' %}",
+ projectsTypeAheadUrl: {% url 'xhr_projectstypeahead' as prjurl%}{{prjurl|json}},
+ {% if project.id %}
+ projectId : {{project.id}},
+ projectPageUrl : {% url 'project' project.id as purl %}{{purl|json}},
+ xhrProjectUrl : {% url 'xhr_project' project.id as pxurl %}{{pxurl|json}},
+ projectName : {{project.name|json}},
+ recipesTypeAheadUrl: {% url 'xhr_recipestypeahead' project.id as paturl%}{{paturl|json}},
+ layersTypeAheadUrl: {% url 'xhr_layerstypeahead' project.id as paturl%}{{paturl|json}},
+ machinesTypeAheadUrl: {% url 'xhr_machinestypeahead' project.id as paturl%}{{paturl|json}},
+ distrosTypeAheadUrl: {% url 'xhr_distrostypeahead' project.id as paturl%}{{paturl|json}},
+ projectBuildsUrl: {% url 'projectbuilds' project.id as pburl %}{{pburl|json}},
+ xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
+ projectId : {{project.id}},
+ xhrBuildRequestUrl: "{% url 'xhr_buildrequest' project.id %}",
+ mostRecentBuildsUrl: "{% url 'most_recent_builds' %}?project_id={{project.id}}",
+ {% else %}
+ mostRecentBuildsUrl: "{% url 'most_recent_builds' %}",
+ projectId : undefined,
+ projectPageUrl : undefined,
+ projectName : undefined,
+ {% endif %}
+ };
+ </script>
+ {% block extraheadcontent %}
+ {% endblock %}
+ </head>
+
+ <body>
+
+ {% csrf_token %}
+ <div id="loading-notification" class="alert alert-warning lead text-center" style="display:none">
+ Loading <i class="fa-pulse icon-spinner"></i>
+ </div>
+
+ <div id="change-notification" class="alert alert-info alert-dismissible change-notification" style="display:none">
+ <button type="button" class="close" id="hide-alert" data-toggle="alert">&times;</button>
+ <span id="change-notification-msg"></span>
+ </div>
+
+ <nav class="navbar navbar-default navbar-fixed-top">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#global-nav" aria-expanded="false">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <div class="toaster-navbar-brand">
+ <a href="/">
+ <img class="logo" src="{% static 'img/logo.png' %}" class="" alt="Yocto logo project"/>
+ </a>
+ <a class="brand" href="/">Toaster</a>
+ {% if DEBUG %}
+ <span class="glyphicon glyphicon-info-sign" title="<strong>Toaster version information</strong>" data-content="<dl><dt>Git branch</dt><dd>{{TOASTER_BRANCH}}</dd><dt>Git revision</dt><dd>{{TOASTER_REVISION}}</dd></dl>"></i>
+ {% endif %}
+ </div>
+ </div>
+ <div class="collapse navbar-collapse" id="global-nav">
+ <ul class="nav navbar-nav">
+ {% if request.resolver_match.url_name != 'landing' and request.resolver_match.url_name != 'newproject' %}
+ <li id="navbar-all-builds"
+ {% if request.resolver_match.url_name == 'all-builds' %}
+ class="active"
+ {% endif %}>
+ <a href="{% url 'all-builds' %}">
+ <i class="glyphicon glyphicon-tasks"></i>
+ All builds
+ </a>
+ </li>
+ {% if project_enable %}
+ <li id="navbar-all-projects"
+ {% if request.resolver_match.url_name == 'all-projects' %}
+ class="active"
+ {% endif %}>
+ <a href="{% url 'all-projects' %}">
+ <i class="icon-folder-open"></i>
+ All projects
+ </a>
+ </li>
+ {% endif %}
+ {% endif %}
+ <li id="navbar-docs">
+ <a target="_blank" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
+ <i class="glyphicon glyphicon-book"></i>
+ Documentation
+ </a>
+ </li>
+ </ul>
+ {% if project_enable %}
+ <a class="btn btn-default navbar-btn navbar-right" id="new-project-button" href="{% url 'newproject' %}">New project</a>
+ {% endif %}
+ </div>
+ </div>
+ </nav>
+
+ <div class="container-fluid">
+ {% block pagecontent %}
+ {% endblock %}
+ </div>
+ </body>
+</html>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html b/poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html
new file mode 100644
index 000000000..4d5066732
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html
@@ -0,0 +1,31 @@
+{% extends "base.html" %}
+{% load project_url_tag %}
+{% load humanize %}
+{% block pagecontent %}
+
+<div class="row">
+ <!-- Breadcrumbs -->
+ <div class="col-md-12">
+ <ul class="breadcrumb" id="breadcrumb">
+ <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
+ {% if not build.project.is_default %}
+ <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
+ {% endif %}
+ <li><a href="{%url 'builddashboard' build.pk%}">{{build.get_sorted_target_list.0.target}} {%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})</a></li>
+ {% block localbreadcrumb %}{% endblock %}
+ </ul>
+ <script>
+$( function () {
+ $('#breadcrumb > li').append('<span class="divider">&rarr;</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+ });
+ </script>
+ </div>
+</div>
+
+<!-- Begin container -->
+{% block pagedetailinfomain %}{% endblock %}
+<!-- End container -->
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
new file mode 100644
index 000000000..a41911f52
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/basebuildpage.html
@@ -0,0 +1,234 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load project_url_tag %}
+{% load objects_to_dictionaries_filter %}
+{% load humanize %}
+{% load field_values_filter %}
+{% block pagecontent %}
+
+ <script>
+ var configVarUrl = "{% url 'configvars' build.id %}";
+
+ $(document).ready(function(){
+
+ $("#delete-build-confirm").click(function(){
+ libtoaster.disableAjaxLoadingTimer();
+ $(this).find('[data-role="submit-state"]').hide();
+ $(this).find('[data-role="loading-state"]').show();
+ $(this).attr("disabled", "disabled");
+
+ /* Make the modal non cancelable while delete is in progress */
+ $('#delete-build-modal button[data-dismiss="modal"]').hide();
+
+ $.ajax({
+ type: 'DELETE',
+ url: "{% url 'xhr_build' build.id %}",
+ headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
+ success: function (data) {
+ if (data.error !== "ok") {
+ console.warn(data.error);
+ } else {
+ libtoaster.setNotification("build-deleted",
+ $("#deleted-build-message").html());
+ window.location.replace(data.gotoUrl);
+ }
+ },
+ error: function (data) {
+ console.warn(data);
+ }
+ });
+ });
+
+
+ $('#breadcrumb > li').append('<span class="divider">&rarr;</span>');
+ $('#breadcrumb > li:last').addClass("active");
+ $('#breadcrumb > li:last > span').remove();
+
+ $("#build-menu li a").each(function(){
+ /* Set the page active state in the Build menu */
+ var currentUrl = window.location.href.split('?')[0];
+ if (currentUrl === $(this).prop("href")){
+ $(this).parent().addClass("active");
+ } else {
+ /* Special case the configvar as this is part of configuration
+ * page but is a separate url
+ */
+ if (window.location.pathname === configVarUrl){
+ $("#menu-configuration").addClass("active");
+ } else {
+ $(this).parent().removeClass("active");
+ }
+ }
+ });
+ });
+ </script>
+
+<span style="display:none" id="deleted-build-message">
+ You have deleted 1 build: <strong>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</strong> completed on <strong>{{build.completed_on|date:"d/m/y H:i"}}</strong>
+</span>
+
+<div class="modal fade" tabindex="-1" role="dialog" id="delete-build-modal" style="display: none;" data-backdrop="static" data-keyboard="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-body">
+ <p>Are you sure you want to delete the build <strong>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</strong> completed on <strong>{{build.completed_on|date:"d/m/y H:i"}}</strong>?</p>
+ </div>
+ <div class="modal-footer">
+ <button id="delete-build-confirm" class="btn btn-primary btn-large">
+ <span data-role="submit-state">Delete build</span>
+ <span data-role="loading-state" style="display:none">
+ <span class="fa-pulse">
+ <i class="icon-spinner"></i>
+ </span>
+ &nbsp;Deleting build...
+ </span>
+ </button>
+ <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div> <!-- / modal -->
+
+<div class="row">
+ <!-- breadcrumbs -->
+ <div class="col-md-12">
+ <ul class="breadcrumb" id="breadcrumb">
+ <li><a href="{% project_url build.project %}">{{build.project.name}}</a></li>
+ {% if not build.project.is_default %}
+ <li><a href="{% url 'projectbuilds' build.project.id %}">Builds</a></li>
+ {% endif %}
+ <li>
+ {% block parentbreadcrumb %}
+ <a href="{%url 'builddashboard' build.pk%}">
+ {{build.get_sorted_target_list.0.target}} {% if build.target_set.all.count > 1 %}(+{{build.target_set.all.count|add:"-1"}}){% endif %} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+ </a>
+ {% endblock %}
+ </li>
+ {% block localbreadcrumb %}{% endblock %}
+ </ul>
+ </div>
+</div>
+
+ <!-- begin left sidebar container for builds which started properly -->
+ {% if build.started %}
+ <div class="row">
+ <div id="nav" class="col-md-2">
+ <ul class="nav nav-pills nav-stacked" id="build-menu">
+ <li id="menu-dashboard"
+ {% if request.resolver_match.url_name == 'builddashboard' %}
+ class="active"
+ {% endif %} >
+ <a href="{% url 'builddashboard' build.pk %}">Build summary</a>
+ </li>
+ {% if build.has_images and build.outcome == build.SUCCEEDED %}
+ <li class="nav-header" data-menu-heading="images">Images</li>
+ {% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ {% if t.has_images %}
+ <li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endif %}
+ {% endfor %}
+ {% endblock %}
+ {% endif %}
+ <li class="nav-header">Build</li>
+ <li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
+ <li id="menu-tasks"><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+ <li id="menu-recipes"><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+ <li id="menu-packages"><a href="{% url 'packages' build.pk %}">Packages</a></li>
+ <li class="nav-header">Performance</li>
+ <li id="menu-time"><a href="{% url 'buildtime' build.pk %}">Time</a></li>
+ <li id="menu-cpu-time"><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
+ <li id="menu-disk-io"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
+
+ <li class="nav-header">Actions</li>
+ <li id="menu-download-build-log">
+ <a href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">
+ <span class="glyphicon glyphicon-download-alt"></span>
+ Download build log
+ </a>
+ </li>
+
+ {% with build.get_custom_image_recipes as custom_image_recipes %}
+ {% if custom_image_recipes.count > 0 %}
+ <!-- edit custom image built during this build -->
+ <li id="menu-edit-custom-image">
+ <a href="#" data-role="edit-custom-image-trigger">
+ <span class="glyphicon glyphicon-edit"></span>
+ Edit custom image
+ </a>
+ {% include 'editcustomimage_modal.html' %}
+ <script>
+ var editableCustomImageRecipes = {{ custom_image_recipes | objects_to_dictionaries:"id,name" | json }};
+
+ $(document).ready(function () {
+ var editCustomImageTrigger = $('[data-role="edit-custom-image-trigger"]');
+ var editCustomImageModal = $('#edit-custom-image-modal');
+
+ // edit custom image which was built during this build
+ editCustomImageTrigger.click(function () {
+ // single editable custom image: redirect to the edit page
+ // for that image
+ if (editableCustomImageRecipes.length === 1) {
+ var url = '{% url "customrecipe" build.project.id custom_image_recipes.first.id %}';
+ document.location.href = url;
+ }
+ // multiple editable custom images: show modal to select
+ // one of them for editing
+ else {
+ editCustomImageModal.modal('show');
+ }
+ });
+ });
+ </script>
+ </li>
+ {% endif %}
+ {% endwith %}
+
+ <!-- new custom image from image recipe in this build -->
+ {% if build.has_image_recipes %}
+ <li id="menu-new-custom-image">
+ <a href="#" data-role="new-custom-image-trigger">
+ <span class="glyphicon glyphicon-plus"></span>
+ New custom image
+ </a>
+ {% include 'newcustomimage_modal.html' %}
+ <script>
+ // imageRecipes includes both custom image recipes and built-in
+ // image recipes, any of which can be used as the basis for a
+ // new custom image
+ var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
+
+ $(document).ready(function () {
+ var newCustomImageModal = $('#new-custom-image-modal');
+ var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
+
+ // show create new custom image modal to select an image built
+ // during this build as the basis for the custom recipe
+ newCustomImageTrigger.click(function () {
+ if (!imageRecipes.length) {
+ return;
+ }
+
+ newCustomImageModalSetRecipes(imageRecipes);
+ newCustomImageModal.modal('show');
+ });
+ });
+ </script>
+ {% endif %}
+
+ <li id="menu-delete-build">
+ <a href="#delete-build-modal" id="delete-build" data-toggle="modal" data-target="#delete-build-modal" class="text-danger">
+ <span class="glyphicon glyphicon-trash"></span>
+ Delete build
+ </a>
+ </ul>
+ </div>
+ <!-- end left sidebar container -->
+ {% endif %}
+
+ <!-- right container; need class="row" for builds without left-hand menu -->
+ <div{% if not build.started %} class="row"{% endif %}>
+ {% block buildinfomain %}{% endblock %}
+ </div>
+ </div>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html b/poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html
new file mode 100644
index 000000000..229cd17ba
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/baseprojectbuildspage.html
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% block pagecontent %}
+
+{% include "projecttopbar.html" %}
+
+<!-- Begin main page container -->
+<div>
+ {% block projectinfomain %}{% endblock %}
+</div>
+<!-- End main container -->
+
+{% endblock %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html b/poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html
new file mode 100644
index 000000000..f2bb2ebf6
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/baseprojectpage.html
@@ -0,0 +1,52 @@
+{% extends "base.html" %}
+
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} {{title}} - {{project.name}} - Toaster {% endblock %}
+
+{% block pagecontent %}
+
+<div class="row">
+ {% include "projecttopbar.html" %}
+ <script type="text/javascript">
+$(document).ready(function(){
+ $("#config-nav .nav li a").each(function(){
+ if (window.location.pathname === $(this).attr('href'))
+ $(this).parent().addClass('active');
+ else
+ $(this).parent().removeClass('active');
+ });
+
+ $("#topbar-configuration-tab").addClass("active")
+ });
+ </script>
+
+ <!-- only on config pages -->
+ <div id="config-nav" class="col-md-2">
+ <ul class="nav nav-pills nav-stacked">
+ <li><a class="nav-parent" href="{% url 'project' project.id %}">Configuration</a></li>
+ <li class="nav-header">Compatible metadata</li>
+ <li><a href="{% url 'projectcustomimages' project.id %}">Custom images</a></li>
+ <li><a href="{% url 'projectimagerecipes' project.id %}">Image recipes</a></li>
+ <li><a href="{% url 'projectsoftwarerecipes' project.id %}">Software recipes</a></li>
+ <li><a href="{% url 'projectmachines' project.id %}">Machines</a></li>
+ <li><a href="{% url 'projectlayers' project.id %}">Layers</a></li>
+ <li><a href="{% url 'projectdistros' project.id %}">Distros</a></li>
+ <li class="nav-header">Extra configuration</li>
+ <li><a href="{% url 'projectconf' project.id %}">BitBake variables</a></li>
+
+ <li class="nav-header">Actions</li>
+ <li>
+ <a href="#delete-project-modal" role="button" class="text-danger" data-toggle="modal" data-target="#delete-project-modal">
+ <i class="icon-trash text-danger"></i> Delete project</a>
+ </li>
+ </ul>
+ </div>
+ <div class="col-md-10">
+ {% block projectinfomain %}{% endblock %}
+ </div>
+
+</div>
+{% endblock %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html b/poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html
new file mode 100644
index 000000000..a2011fa90
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/basetable_bottom.html
@@ -0,0 +1,94 @@
+ </tbody>
+ </table>
+
+<!-- Show pagination controls -->
+<div id="pagination-basetable_bottom">
+ <!--span class="help-inline">Showing {{objects.start_index}} to {{objects.end_index}} out of {{objects.paginator.count}} entries.</span-->
+
+ <ul class="pagination">
+{%if objects.has_previous %}
+ <li><a href="javascript:reload_params({'page':{{objects.previous_page_number}}})">&laquo;</a></li>
+{%else%}
+ <li class="disabled"><a href="#">&laquo;</a></li>
+{%endif%}
+{% for i in objects.page_range %}
+ <li{%if i == objects.number %} class="active" {%endif%}><a href="javascript:reload_params({'page':{{i}}})">{{i}}</a></li>
+{% endfor %}
+{%if objects.has_next%}
+ <li><a href="javascript:reload_params({'page':{{objects.next_page_number}}})">&raquo;</a></li>
+{%else%}
+ <li class="disabled"><a href="#">&raquo;</a></li>
+{%endif%}
+ </ul>
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="form-control pagesize">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+</div>
+
+<!-- Update page display settings -->
+
+<script>
+ $(document).ready(function() {
+
+ // we load cookies for the column display
+ save = $.cookie('_displaycols_{{objectname}}');
+ if (save != undefined) {
+ setting = save.split(';');
+ for ( i = 0; i < setting.length; i++) {
+ if (setting[i].length > 0) {
+ splitlist = setting[i].split(':');
+ id = splitlist[0], v = splitlist[1];
+ if (v == 'true') {
+ $('.chbxtoggle#'+id).prop('checked', true);
+ }
+ else {
+ $('.chbxtoggle#'+id).prop('checked', false);
+ }
+ }
+ }
+ }
+
+ // load data for number of entries to be displayed on page
+ if ({{request.GET.count}} != "") {
+ pagesize = {{request.GET.count}};
+ }
+
+ $('.pagesize option').prop('selected', false)
+ .filter('[value="' + pagesize + '"]')
+ .attr('selected', true);
+
+ $('.chbxtoggle').each(function () {
+ showhideTableColumn($(this).attr('id'), $(this).is(':checked'))
+ });
+
+ //turn edit columns dropdown into a multi-select menu
+ $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
+ e.stopPropagation();
+ });
+
+ //show tooltip with applied filter
+ $('#filtered').tooltip({container:'table', placement:'bottom', delay:{hide:1500}, html:true});
+
+ //progress bar tooltip
+ $('.progress, .lead span').tooltip({container:'table', placement:'top'});
+
+ $(".pagesize").change(function () {
+ reload_params({"count":$(this).val()});
+ });
+});
+</script>
+
+<!-- modal filter boxes -->
+ {% for tc in tablecols %}{% if tc.filter %}{% with objectname=objectname f=tc.filter %}
+ {% include "filtersnippet.html" %}
+ {% endwith %}{% endif %} {% endfor %}
+<!-- end modals -->
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html b/poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html
new file mode 100644
index 000000000..5a9076d2a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/basetable_top.html
@@ -0,0 +1,256 @@
+{% load projecttags %}
+<!-- component to display a generic table -->
+ <script>
+
+ //
+ // most of the following javascript is for managing the 'Edit Columns'
+ // pop-up dialog and actions. the idea is that there are 2 types
+ // of actions: immediate - performed while the dialog is still
+ // visible - hide/show columns, and delayed - performed when the
+ // dialog becomes invisible - any resorting if necessary.
+ //
+ // When the dialog is open, an interval timer is set up to
+ // determine if the dialog is still visible. when the dialog
+ // closes - goes invisible, the delayed actions are performed.
+ //
+ // the interval timer and interrupt handler is a way of simulating
+ // an onclose event. there is probably a simpler way to do this
+ // however the pop-up window id was elusive.
+ //
+
+ var editColTimer;
+ var editColAction;
+
+ //
+ // this is the target function of the interval timeout.
+ // check to see if the dialog is visible. if the dialog
+ // has gone invisible since the last check, take any delayed
+ // actions indicated in the action list and clear the timer.
+ //
+
+ function checkVisible( ) {
+ editcol = document.getElementById( 'editcol' );
+ if ( editcol.offsetWidth <= 0 ) {
+ clearInterval( editColTimer );
+ editColTimer = false;
+ hideshowColumns( );
+ editColAction = [ ];
+ }
+ }
+
+ function filterTableRows(test) {
+ if (test.length > 0) {
+ var r = test.split(/[ ,]+/).map(function (e) { return new RegExp(e, 'i') });
+ $('tr.data').map( function (i, el) {
+ (! r.map(function (j) { return j.test($(el).html())}).reduce(function (c, p) { return c && p;} )) ? $(el).hide() : $(el).show();
+ });
+ } else
+ {
+ $('tr.data').show();
+ }
+ }
+
+ //
+ // determine the value of the indicated url arg.
+ // this is needed to determine whether a resort
+ // is necessary. it looks like a lot of gorp stuff
+ // but its actually pretty simple.
+ //
+
+ function getURLParameter( name ) {
+ return decodeURIComponent((new RegExp('[?|&]' + name + '=' +
+ '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g,
+ '%20'))||null
+ }
+
+ //
+ // when the dialog box goes invisible
+ // this function is called to interpret
+ // the action list and take any delayed actions necessary.
+ // the editColAction list is a hash table with
+ // the column name as the hash key, the hash value
+ // is a 2 element list. the first element is a flag
+ // indicating whether the column is on or off. the
+ // 2nd element is the sort order indicator for the column.
+ //
+
+ function hideshowColumns( ) {
+ for( var k in editColAction ) {
+ showhideDelayedTableAction( k, editColAction[ k ][ 0 ], editColAction[ k ][ 1 ]);
+ }
+ }
+
+ //
+ // this function actually performs the delayed table actions
+ // namely any resorting if necessary
+ //
+
+ function showhideDelayedTableAction( clname, sh, orderkey ) {
+ if ( !sh ) {
+ p = getURLParameter( "orderby" ).split( ":" )[ 0 ];
+ if ( p == orderkey ) {
+ reload_params({ 'orderby' : '{{default_orderby}}'});
+ }
+ }
+ }
+
+ //
+ // this function actually performs the immediate table actions
+ // namely any colums that need to be hidden/shown
+ //
+
+ function showhideImmediateTableAction( clname, sh, orderkey ) {
+ if ( sh ) {
+ $( '.' + clname ).show( 100 );
+ }
+ else {
+ $( '.' + clname ).hide( 100 );
+ }
+
+ // save cookie for all checkboxes
+ save = '';
+ $( '.chbxtoggle' ).each(function( ) {
+ if ( $( this ).attr( 'id' ) != undefined ) {
+ save += ';' + $( this ).attr( 'id' ) +':'+ $( this ).is( ':checked' )
+ }
+ });
+ $.cookie( '_displaycols_{{objectname}}', save );
+ save = '';
+ }
+
+ //
+ // this is the onclick handler for all of the check box
+ // items in edit columns dialog
+ //
+
+ function showhideTableColumn( clname, sh, orderkey ) {
+ editcol = document.getElementById( 'editcol' );
+ if ( editcol.offsetWidth <= 0 ) {
+
+ //
+ // this path is taken when the page is first
+ // getting initialized - no dialog visible,
+ // perform both the immediate and delayed actions
+ //
+
+ showhideImmediateTableAction( clname, sh, orderkey );
+ showhideDelayedTableAction( clname, sh, orderkey );
+ return;
+ }
+ if ( !editColTimer ) {
+
+ //
+ // we don't have a timer active so set one up
+ // and clear the action list
+ //
+
+ editColTimer = setInterval( checkVisible, 250 );
+ editColAction = [ ];
+ }
+
+ //
+ // save the action to be taken when the dialog closes
+ //
+
+ editColAction[ clname ] = [ sh, orderkey ];
+ showhideImmediateTableAction( clname, sh, orderkey );
+ }
+
+ </script>
+
+<!-- control header -->
+<div class="navbar navbar-default">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#table-chrome-collapse-variablehistory" aria-expanded="false">
+ <span class="sr-only">Toggle table options</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ </div>
+ <div class="collapse navbar-collapse" id="table-chrome-collapse-variablehistory">
+ <form class="navbar-form navbar-left" id="searchform">
+ <div class="form-group">
+ <div class="btn-group">
+ <input class="form-control" id="search" name="search" type="text" placeholder="Search {%if object_search_display %}{{object_search_display}}{%else%}{{objectname}}{%endif%}" value="{%if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ {% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" tabindex="-1"><span class="remove-search-btn-variables glyphicon glyphicon-remove-circle"></span></a>{%endif%}
+ </div>
+ </div>
+ <input type="hidden" name="orderby" value="{{request.GET.orderby}}">
+ <input type="hidden" name="page" value="1">
+ <button class="btn btn-default" id="search-button" type="submit" value="Search">Search</button>
+ </form>
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="pagesize form-control">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+
+ <div class="btn-group navbar-right">
+ {% if tablecols %}
+ <button id="edit-columns-button" class="btn btn-default navbar-btn dropdown-toggle" data-toggle="dropdown">Edit columns
+ <span class="caret"></span>
+ </button>
+<!--
+ {{tablecols|sortcols}}
+-->
+ <ul id="editcol" class="dropdown-menu editcol">
+ {% for i in tablecols|sortcols %}
+ <li>
+ <div class="checkbox">
+ <label {% if not i.clclass %} class="muted" {%endif%}>
+ <input type="checkbox" class="chbxtoggle"
+ {% if i.clclass %}
+ id="{{i.clclass}}"
+ value="ct{{i.name}}"
+ {% if not i.hidden %}
+ checked="checked"
+ {%endif%}
+ onclick="showhideTableColumn(
+ $(this).attr('id'),
+ $(this).is(':checked'),
+ {% if i.ordericon %}
+ '{{i.orderkey}}'
+ {% else %}
+ undefined
+ {% endif %}
+ )"
+ {%else%}
+ checked disabled
+ {% endif %}/>{{i.name}}
+ </label>
+ </div>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div>
+ </div> <!-- navbar-collapse -->
+ </div> <!-- container-fluid -->
+</div> <!-- navbar-default -->
+
+<!-- the actual rows of the table -->
+ <table class="table table-bordered table-hover tablesorter" id="otable">
+ <thead>
+ <!-- Table header row; generated from "tablecols" entry in the context dict -->
+ <tr>
+ {% for tc in tablecols %}<th class="{%if tc.dclass%}{{tc.dclass}}{%endif%} {% if tc.clclass %}{{tc.clclass}}{% endif %}">
+ {%if tc.qhelp%}<span class="glyphicon glyphicon-question-sign get-help" title="{{tc.qhelp}}"></span>{%endif%}
+ {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })">{{tc.name}}</a>{%else%}<span class="text-muted">{{tc.name}}</span>{%endif%}
+ {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}
+ {%if tc.filter%}<div class="btn-group pull-right">
+ <a href="#filter_{{tc.filter.class}}" role="button" class="btn btn-xs {%if request.GET.filter%}{{tc.filter.options|filtered_icon:request.GET.filter}} {%endif%}" {%if request.GET.filter and tc.filter.options|filtered_tooltip:request.GET.filter %} title="<p>{{tc.filter.options|filtered_tooltip:request.GET.filter}}</p><p><a class='btn btn-sm btn-primary' href=javascript:reload_params({'filter':''})>Show all {% if filter_search_display %}{{filter_search_display}}{% else %}{{objectname}}{% endif %}</a></p>" {%endif%} data-toggle="modal"> <span class="glyphicon glyphicon-filter filtered"></span> </a>
+ </div>{%endif%}
+ </th>{% endfor %}
+ </tr>
+ </thead>
+ <tbody>
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html b/poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html
new file mode 100644
index 000000000..722091b2d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/basetable_top_layers.html
@@ -0,0 +1,5 @@
+{% extends "basetable_top.html" %}
+
+{%block custombuttons %}
+ <a class="btn" href="{% url 'importlayer' project.id %}" style="margin-right:5px;">Import layer</a>
+{%endblock%}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/bfile.html b/poky/bitbake/lib/toaster/toastergui/templates/bfile.html
new file mode 100644
index 000000000..c7f59434a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/bfile.html
@@ -0,0 +1,24 @@
+{% extends "basebuildpage.html" %}
+
+{% block pagetitle %}Files for package {{objects.0.bpackage.name}} {% endblock %}
+{% block pagetable %}
+ {% if not objects %}
+ <p>No files were recorded for this package!</p>
+ {% else %}
+
+ <tr>
+ <th>Name</th>
+ <th>Size (Bytes)</th>
+ </tr>
+
+ {% for file in objects %}
+
+ <tr class="data">
+ <td>{{file.path}}</td>
+ <td>{{file.size}}</td>
+
+ {% endfor %}
+
+ {% endif %}
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/brtargets.html b/poky/bitbake/lib/toaster/toastergui/templates/brtargets.html
new file mode 100644
index 000000000..4ebd05879
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/brtargets.html
@@ -0,0 +1,20 @@
+<span data-toggle="tooltip"
+ {% if buildrequest.brtarget_set.all.count > 1 %}
+ title="Targets:
+ {% for target in buildrequest.brtarget_set.all %}
+ {% if target.task %}
+ {{target.target}}:{{target.task}}
+ {% else %}
+ {{target.target}}
+ {% endif %}
+ {%endfor%}"
+ {%endif%}>
+ {% if buildrequest.brtarget_set.all.0.task %}
+ {{buildrequest.brtarget_set.all.0.target}}:{{buildrequest.brtarget_set.all.0.task}}
+ {% else %}
+ {{buildrequest.brtarget_set.all.0.target}}
+ {% endif %}
+ {% if buildrequest.brtarget_set.all.count > 1 %}
+ (+ {{buildrequest.brtarget_set.all.count|add:"-1"}})
+ {% endif %}
+</span>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html b/poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html
new file mode 100644
index 000000000..02a29816a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/builddashboard.html
@@ -0,0 +1,319 @@
+{% extends "basebuildpage.html" %}
+{% load humanize %}
+{% load projecttags %}
+{% load field_values_filter %}
+
+{% block title %} {{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block parentbreadcrumb %}
+{% if build.get_sorted_target_list.count > 0 %}
+ {{build.get_sorted_target_list.0.target}}
+{% endif %}
+
+{%if build.target_set.all.count > 1%}(+{{build.target_set.all.count|add:"-1"}}){%endif%} {{build.machine}} ({{build.completed_on|date:"d/m/y H:i"}})
+{% endblock %}
+
+{% block buildinfomain %}
+<!-- page title -->
+<div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
+ <div class="page-header build-data">
+ <h1>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</h1>
+ </div>
+
+<!-- build result bar -->
+ <div class="alert {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-danger{%else%}alert-info{%endif%}">
+ <span><strong>{%if build.outcome == build.SUCCEEDED%}Completed{%elif build.outcome == build.FAILED%}Failed{%else%}{%endif%}</strong> on {{build.completed_on|date:"d/m/y H:i"}}</span>
+ {% if build.warnings.count or build.errors.count %}
+ <span>with</span>
+ {% endif %}
+ {%if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
+ {% if build.errors.count %}
+ <a href="#errors" class="alert-link show-errors"> {{build.errors.count}} error{{build.errors.count|pluralize}}</a>
+ {% endif %}
+ {% if build.warnings.count %}
+ {% if build.errors.count %}and{% endif %}
+ <a href="#warnings" class="show-warnings"> {{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>
+ {% endif %}
+ {% if build.cooker_log_path %}
+ <a class="pull-right log" href="{% url 'build_artifact' build.id "cookerlog" build.id %}">Download build log</a>
+ {% endif %}
+ <span class="pull-right">
+ Build time:
+ <span data-build-field="buildtime">
+ {% if build.outcome == build.SUCCEEDED %}
+ <a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
+ {% else %}
+ {{ build.timespent_seconds|sectohms }}
+ {% endif %}
+ </span>
+ </span>
+
+ {%endif%}
+</div>
+
+{% if build.errors.count %}
+ <div class="panel panel-default" id="errors">
+ <div class="panel-heading">
+ <h2 class="panel-title">
+ <span class="glyphicon glyphicon-minus-sign"></span>
+ <a data-toggle="collapse" href="#error-info" id="error-toggle">
+ {{build.errors.count}} error{{build.errors.count|pluralize}}
+ </a>
+ </h2>
+ </div>
+ <div class="panel-collapse collapse in" id="error-info">
+ <div class="panel-body">
+ <div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
+ {% for error in build.errors %}
+ <div class="alert alert-danger" data-log-message-id="{{error.pk}}">
+ <pre>{{error.message}}</pre>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ </div>
+{% endif %}
+
+{%if build.outcome == build.SUCCEEDED%}
+<!-- built images -->
+ {% if hasArtifacts %}
+ <h2 data-heading="build-artifacts">Build artifacts</h2>
+ {% for target in targets %}
+ {% if target.target.is_image %}
+ <div class="well well-transparent dashboard-section" data-artifacts-for-target="{{target.target.pk}}">
+ {% if target.npkg > 0 %}
+ <h3>
+ <a href="{% url 'target' build.pk target.target.pk %}" data-link="target-packages">
+ {{target.target.target}}
+ </a>
+ </h3>
+ <dl class="dl-horizontal">
+ <dt>Packages included</dt>
+ <dd>
+ <a href="{% url 'target' build.pk target.target.pk %}">
+ <span data-value="target-package-count">{{target.npkg}}</span>
+ </a>
+ </dd>
+ <dt>Total package size</dt>
+ <dd>
+ <span data-value="target-package-size">{{target.pkgsz|filtered_filesizeformat}}</span>
+ </dd>
+ </dl>
+ {% else %}
+ <h3>{{target.target.target}}</h3>
+ {% endif %}
+
+ {% if target.targetHasImages %}
+ <dl class="dl-horizontal">
+ <dt>
+ Manifests
+ </dt>
+
+ <dd>
+ <a data-link="license-manifest" href="{% url 'build_artifact' build.pk 'licensemanifest' target.target.pk %}">License manifest</a>
+ </dd>
+
+ {% if target.target.package_manifest_path %}
+ <dd>
+ <a data-link="package-manifest" href="{% url 'build_artifact' build.pk 'packagemanifest' target.target.pk %}">Package manifest</a>
+ </dd>
+ {% endif %}
+ </dl>
+
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Image files are stored in <code>build/tmp/deploy/images/</code>"></span>
+ Image files
+ </dt>
+ <dd>
+ <ul class="list-unstyled" data-links="image-artifacts">
+ {% for i in target.imageFiles|dictsort:"suffix" %}
+ <li>
+ <a href="{% url 'build_artifact' build.pk 'imagefile' i.id %}">
+ {{i.suffix}}
+ </a>
+ &nbsp;({{i.size|filtered_filesizeformat}})
+ </li>
+ {% endfor %}
+ </ul>
+ </dd>
+ <dt>
+ Kernel artifacts
+ </dt>
+ <dd>
+ <ul class="list-unstyled" data-links="kernel-artifacts">
+ {% for artifact in target.target_kernel_artifacts|dictsort:"basename" %}
+ <li>
+ <a href="{% url 'build_artifact' build.id 'targetkernelartifact' artifact.id %}">{{artifact.basename}}</a>
+ ({{artifact.file_size|filtered_filesizeformat}})
+ </li>
+ {% endfor %}
+ </ul>
+ </dd>
+ </dl>
+ {% endif %}
+ {% if target.target_sdk_artifacts_count > 0 %}
+ <dl class="dl-horizontal">
+ <dt>
+ SDK artifacts
+ </dt>
+ <dd>
+ <ul class="list-unstyled" data-links="sdk-artifacts">
+ {% for artifact in target.target_sdk_artifacts|dictsort:"basename" %}
+ <li>
+ <a href="{% url 'build_artifact' build.id 'targetsdkartifact' artifact.id %}">{{artifact.basename}}</a>
+ ({{artifact.file_size|filtered_filesizeformat}})
+ </li>
+ {% endfor %}
+ </ul>
+ </dd>
+ </dl>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+{%else%}
+<!-- error dump -->
+{%endif%}
+
+<!-- other artifacts -->
+{% if build.buildartifact_set.all.count > 0 %}
+<h2>Other artifacts</h2>
+
+ <div class="well well-transparent dashboard-section">
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Build artifacts discovered in <i>tmp/deploy/images</i>. Usually kernel images and kernel modules."></span>
+ Other artifacts</dt>
+ <dd><div>
+ {% for ba in build.buildartifact_set.all|dictsort:"file_name" %}
+ <a href="{%url 'build_artifact' build.id 'buildartifact' ba.id %}">
+ {{ba.get_basename}}
+ </a>
+
+ ({{ba.file_size|filtered_filesizeformat}}) <br/>
+ {% endfor %}
+ </div>
+ </dd>
+ </dl>
+ </div>
+
+{% endif %}
+
+{% if build.started %}
+ <!-- build summary -->
+ <h2 data-role="build-summary-heading">Build summary</h2>
+ <div class="row">
+ <div class="col-md-4 dashboard-section">
+ <div class="well well-transparent">
+ <h3><a href="{%url 'configuration' build.pk%}">Configuration</a></h3>
+ <dl>
+ <dt>Machine</dt><dd>{{build.machine}}</dd>
+ <dt>Distro</dt><dd>{{build.distro}}</dd>
+ <dt>Layers</dt><dd><ul class="list-unstyled">{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<li>{{i.layer.name}}</li>{%endfor%}</ul></dd>
+ </dl>
+ </div>
+ </div>
+ <div class="col-md-4 dashboard-section">
+ <div class="well well-transparent">
+ <h3><a href="{%url 'tasks' build.pk%}">Tasks</a></h3>
+ <dl>
+ {% query build.task_build outcome=4 order__gt=0 as exectask%}
+ {% if exectask.count > 0 %}
+ <dt>Failed tasks</dt>
+ <dd>
+ {% if exectask.count == 1 %}
+ <a class="text-danger" href="{% url "task" build.id exectask.0.id %}">
+ {{exectask.0.recipe.name}}
+ <span class="task-name">{{exectask.0.task_name}}</span>
+ </a>
+
+ <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
+ <span class="glyphicon glyphicon-download-alt get-help" title="Download task log file"></i>
+ </a>
+
+ {% elif exectask.count > 1%}
+ <a class="text-danger" href="{% url "tasks" build.id %}?limit=25&amp;page=1&amp;orderby=order&amp;filter=task_outcome:failed&amp;default_orderby=order&amp;filter_value=on&amp;">{{exectask.count}}</a>
+ {% endif %}
+ </dd>
+ {% endif %}
+ <dt>Total number of tasks</dt><dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
+ <dt>
+ Tasks executed
+ <span class="glyphicon glyphicon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></span>
+ </dt>
+ <dd><a href="{% url 'tasks' build.pk %}?limit=25&amp;page=1&amp;orderby=order&amp;filter=execution_outcome:executed&amp;default_orderby=order&amp;filter_value=on&amp;">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
+ <dt>
+ Tasks not executed
+ <span class="glyphicon glyphicon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></span>
+ </dt>
+ <dd><a href="{% url 'tasks' build.pk %}?limit=25&amp;page=1&amp;orderby=order&amp;filter=execution_outcome:not_executed&amp;default_orderby=order&amp;filter_value=on&amp;">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
+ <dt>
+ Reuse
+ <span class="glyphicon glyphicon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></span>
+ </dt>
+ <dd>
+ {% query build.task_build order__gt=0 as texec %}
+ {% if noexectask.count|multiply:100|divide:texec.count < 0 %}
+ 0
+ {% else %}
+ {{noexectask.count|multiply:100|divide:texec.count}}
+ {% endif %}
+ %
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="col-md-4 dashboard-section">
+ <div class="well well-transparent">
+ <h3><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h3>
+ <dl>
+ <dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
+ <dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+{% endif %} <!-- end build summary -->
+
+{% if build.warnings.count %}
+ <div class="panel panel-default" id="warnings">
+ <div class="panel-heading">
+ <h2 class="panel-title">
+ <span class="glyphicon glyphicon-warning-sign"></span>
+ <a id="warning-toggle" href="#warning-info" data-toggle="collapse">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>
+ </h2>
+ </div>
+ <div class="panel-collapse collapse" id="warning-info">
+ <div class="panel-body">
+ <div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
+ {% for warning in logmessages %}{% if warning.level == 1 %}
+ <div class="alert alert-warning" data-log-message-id="{{warning.pk}}">
+ <pre>{{warning.message}}</pre>
+ </div>
+ {% endif %}{% endfor %}
+ </div>
+ </div>
+ </div>
+ </div>
+{% endif %}
+
+</div> <!-- end 10 column row -->
+
+<script type="text/javascript">
+ $(document).ready(function() {
+ //show warnings section when requested from the previous page
+ if (location.href.search('#warnings') > -1) {
+ $('#warning-info').addClass('in');
+ }
+
+ //show warnings section when requested from the build outcome
+ $(".show-warnings").click(function() {
+ $('#warning-info').addClass('in');
+ });
+ });
+</script>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html b/poky/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html
new file mode 100644
index 000000000..eb4c65690
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/buildinfo-toastertable.html
@@ -0,0 +1,25 @@
+{% extends "basebuildpage.html" %}
+
+{% load projecttags %}
+
+{% block title %} {{title}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>{{title}}</li>
+{% endblock %}
+
+{% block nav-packages %}
+{% endblock %}
+
+{% block buildinfomain %}
+<div class="col-md-10">
+{# xhr_table_url is just the current url so leave it blank #}
+{% with xhr_table_url='' %}
+ <div class="page-header build-data">
+ <h1>
+ {{title}} (<span class="table-count-{{table_name}}">0</span>) </h2>
+ </h1>
+ </div>
+ {% include "toastertable.html" %}
+{% endwith %}
+</div>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html b/poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
new file mode 100644
index 000000000..0afe0a311
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/builds-toastertable.html
@@ -0,0 +1,52 @@
+{% extends 'base.html' %}
+{% load static %}
+
+{% block extraheadcontent %}
+ <link rel="stylesheet" href="{% static 'css/jquery-ui.min.css' %}" type='text/css'>
+ <link rel="stylesheet" href="{% static 'css/jquery-ui.structure.min.css' %}" type='text/css'>
+ <link rel="stylesheet" href="{% static 'css/jquery-ui.theme.min.css' %}" type='text/css'>
+ <script src="{% static 'js/jquery-ui.min.js' %}">
+ </script>
+{% endblock %}
+
+{% block title %} All builds - Toaster {% endblock %}
+
+{% block pagecontent %}
+
+<div class="row">
+ <div class="col-md-12">
+ {% with mru=mru mrb_type=mrb_type %}
+ {% include 'mrb_section.html' %}
+ {% endwith %}
+
+ <div class="page-header">
+ <h1 class="top-air" data-role="page-title"></h1>
+ </div>
+
+ {% url 'builds' as xhr_table_url %}
+ {% include 'toastertable.html' %}
+ </div>
+</div>
+
+ <script>
+ $(document).ready(function () {
+ var tableElt = $("#{{table_name}}");
+ var titleElt = $("[data-role='page-title']");
+
+ tableElt.on("table-done", function (e, total, tableParams) {
+ var title = "All builds";
+
+ if (tableParams.search || tableParams.filter) {
+ if (total === 0) {
+ title = "No builds found";
+ }
+ else if (total > 0) {
+ title = total + " build" + (total > 1 ? 's' : '') + " found";
+ }
+ }
+
+ titleElt.text(title);
+ });
+ });
+ </script>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/configuration.html b/poky/bitbake/lib/toaster/toastergui/templates/configuration.html
new file mode 100644
index 000000000..58989f865
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/configuration.html
@@ -0,0 +1,85 @@
+{% extends "basebuildpage.html" %}
+{% load projecttags %}
+
+{% block title %} Configuration summary - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>Configuration</li>
+{% endblock %}
+
+{% block buildinfomain %}
+<!-- page title -->
+<div class="col-md-10">
+
+ <div class="page-header build-data">
+ <h1>Configuration</h1>
+ </div>
+
+<!-- configuration table -->
+<div id="navTab">
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#">Summary</a></li>
+ <li class=""><a href="{% url 'configvars' build.id %}">BitBake variables</a></li>
+</ul>
+
+ <!-- summary -->
+ <div id="summary" class="tab-pane active">
+ <h3>Build configuration</h3>
+ <dl class="dl-horizontal">
+ {%if BB_VERSION %}<dt>BitBake version</dt><dd>{{BB_VERSION}}</dd> {% endif %}
+ {%if BUILD_SYS %}<dt>Build system</dt><dd>{{BUILD_SYS}}</dd> {% endif %}
+ {%if NATIVELSBSTRING %}<dt>Host distribution</dt><dd>{{NATIVELSBSTRING}}</dd> {% endif %}
+ {%if TARGET_SYS %}<dt>Target system</dt><dd>{{TARGET_SYS}}</dd> {% endif %}
+ {%if MACHINE %}<dt>Machine</dt><dd>{{MACHINE}}</dd> {% endif %}
+ {%if DISTRO %}<dt>Distro</dt><dd>{{DISTRO}}</dd> {% endif %}
+ {%if DISTRO_VERSION %}<dt>Distro version</dt><dd>{{DISTRO_VERSION}}</dd> {% endif %}
+ {%if TUNE_FEATURES %}<dt>Tune features</dt><dd>{{TUNE_FEATURES}}</dd> {% endif %}
+ {%if TARGET_FPU %}<dt>Target FPU</dt><dd>{{TARGET_FPU}}</dd> {% endif %}
+ {%if targets.all %}<dt>Target(s)</dt>
+ <dd> <ul class="list-unstyled"> {% for target in targets.all %}
+ <li>{{target.target}}{%if forloop.counter > 1 %}<br>{% endif %}</li>
+ {% endfor %} </ul> </dd> {% endif %}
+ </dl>
+ <h3>Layers</h3>
+ <div class="row">
+ <div class="col-md-9 table-responsive">
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Layer</th>
+ <th>Layer branch</th>
+ <th>Layer commit</th>
+ </tr>
+ </thead>
+ <tbody>{% for lv in build.layer_version_build.all|dictsort:"layer.name" %}
+ <tr>
+ <td>{{lv.layer.name}}</td>
+ {% if lv.layer.local_source_dir %}
+ <td>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{lv.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
+ </td>
+ {% else %}
+ <td>{{lv.branch}}</td>
+ {% endif %}
+ {% if lv.layer.local_source_dir %}
+ <td>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{lv.layer.name}} is not in a Git repository, so there is no commit associated with it"> </span>
+ </td>
+ {% else %}
+ <td> <a class="btn btn-default" data-content="<ul class='list-unstyled'>
+ <li>{{lv.commit}}</li> </ul>">
+ {{lv.commit|truncatechars:13}}
+ </a></td>
+ {% endif %}
+ </tr>{% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+
+</div>
+
+</div> <!-- end of 10-column section -->
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/configvars.html b/poky/bitbake/lib/toaster/toastergui/templates/configvars.html
new file mode 100644
index 000000000..ca2e1eab3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/configvars.html
@@ -0,0 +1,145 @@
+{% extends "basebuildpage.html" %}
+{% load projecttags %}
+
+{% block title %} BitBake variables - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>Configuration</li>
+{% endblock %}
+
+{% block buildinfomain %}
+<!-- page title -->
+<div class="col-md-10">
+ <div class="page-header build-data">
+ <h1>
+ {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} variable{{objects.paginator.count|pluralize}} found
+ {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
+ No variables found
+ {%else%}
+ Configuration
+ {%endif%}
+ </h1>
+ </div>
+
+<!-- configuration table -->
+<div id="navTab">
+ <ul class="nav nav-tabs">
+ <li class=""><a href="{% url 'configuration' build.id %}">Summary</a></li>
+ <li class="active"><a href="#" >BitBake variables</a></li>
+ </ul>
+
+ <!-- variables -->
+ <div id="variables" class="tab-pane">
+
+ {% if objects.paginator.count == 0 %}
+ <div class="alert alert-warning">
+ <form class="no-results form-inline" id="searchform">
+ <div class="form-group">
+ <div class="btn-group">
+ <input class="form-control" id="search" name="search" type="text" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ {% if request.GET.search %}
+ <a href="javascript:$('#search').val('');searchform.submit()" tabindex="-1">
+ <span class="remove-search-btn-variables glyphicon glyphicon-remove-circle"></span>
+ </a>
+ {% endif %}
+ </div>
+ </div>
+ <button class="btn btn-default" type="submit" value="Search">Search</button>
+ <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all variables</button>
+ </form>
+ </div>
+
+ {% else %}
+ {% include "basetable_top.html" %}
+
+ {% for variable in objects %}
+ <tr class="data">
+ <td class="variable_name"><a data-toggle="modal" href="#variable-{{variable.pk}}">{{variable.variable_name}}</a></td>
+ <td class="variable_value">{{variable.variable_value|truncatechars:153}}</td>
+ <td class="file">
+ {% if variable.vhistory.all %}
+ {% for path in variable.vhistory.all|filter_setin_files:file_filter %}
+ {{path}}<br/>
+ {% endfor %}
+ {% endif %}
+ </td>
+ <td class="description">
+ {% if variable.description %}
+ {{variable.description}}
+ <a href="http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-{{variable.variable_name|variable_parent_name}}" target="_blank">
+ <span class="glyphicon glyphicon-new-window get-info"></span></a>
+ {% endif %}
+ </td>
+ </tr>
+{% endfor %}
+</tbody>
+</table>
+</div> <!-- table-responsive -->
+{% include "basetable_bottom.html" %}
+{% endif %}
+</div> <!-- endvariables -->
+
+<!-- file list popups -->
+{% for variable in objects %}
+{% if variable.vhistory.count %}
+<div id="variable-{{variable.pk}}" class="modal fade" tabindex="-1" role="dialog">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3>History of {{variable.variable_name}}</h3>
+ </div>
+ <div class="modal-body">
+ {% if variable.variable_value %}
+ {% if variable.variable_value|length < 570 %}
+ <h4>{{variable.variable_name}} value is:</h4>
+ <p>
+ {{variable.variable_value}}
+ </p>
+ {% else %}
+ <h4>{{variable.variable_name}} value is:</h4>
+ <p>
+ <span>{{variable.variable_value|string_slice:':570'}}
+ <span class="full"> {{variable.variable_value|string_slice:'570:'}}
+ </span>
+ <a href="#" class="full-show">...</a>
+ </span>
+ </p>
+ <a href="#" class="full-hide">Collapse variable value <i class="icon-caret-up"></i>
+ </a>
+ {% endif %}
+ {% else %}
+ <div class="alert alert-info">The value of <strong>{{variable.variable_name}}</strong> is an empty string</div>
+ {% endif %}
+ <h4>The value was set in the following configuration files:</h4>
+ <div class="table-responsive">
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Order</th>
+ <th>Configuration file</th>
+ <th>Operation</th>
+ <th>Line</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for vh in variable.vhistory.all %}
+ <tr>
+ <td>{{forloop.counter}}</td><td class="file">{{vh.file_name}}</td><td>{{vh.operation}}</td><td>{{vh.line_number}}</td>
+ </tr>
+ {%endfor%}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+{% endif %}
+{% endfor %}
+
+</div> <!-- buildinfomain -->
+
+</div> <!-- end 10-column section -->
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html b/poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html
new file mode 100644
index 000000000..02f07b760
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/cpuusage.html
@@ -0,0 +1,4 @@
+{% extends "basebuildpage.html" %}
+{% block localbreadcrumb %}
+<li>Cpu Usage</li>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html
new file mode 100644
index 000000000..38c258ac3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/customise_btn.html
@@ -0,0 +1,15 @@
+<button class="btn btn-default btn-block layer-exists-{{data.layer_version.pk}} customise-btn" data-recipe="{{data.pk}}"
+ {% if data.layer_version.pk not in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ Customise
+</button>
+<button class="btn btn-default btn-block layer-add-{{data.layer_version.pk}} layerbtn" data-layer='{ "id": {{data.layer_version.pk}}, "name": "{{data.layer_version.layer.name}}", "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.pk%}"}' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ <i class="glyphicon glyphicon-plus"></i>
+ Add layer
+</button>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html b/poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html
new file mode 100644
index 000000000..945fc9797
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/customrecipe.html
@@ -0,0 +1,268 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+{% with recipe.get_base_recipe_file as base_recipe_file %}
+ <ul class="breadcrumb">
+ <li>
+ <a href="{% url 'project' project.id %}">{{project.name}}</a>
+ <span class="divider">&rarr;</span>
+ </li>
+ <li><a href="{% url 'projectcustomimages' project.id %}">Custom images</a>
+ <span class="divider">&rarr;</span>
+ </li>
+ <li class="active">
+ {{recipe.name}} ({{recipe.layer_version.layer.name}})
+ </li>
+ </ul>
+
+<script src="{% static 'js/customrecipe.js' %}"></script>
+<script>
+ $(document).ready(function (){
+ var ctx = {
+ recipe : {
+ id: {{recipe.pk}},
+ name: "{{recipe.name}}",
+ includedPackagesCount: {{recipe.includes_set.count}},
+ baseRecipeId: {{recipe.base_recipe.pk}},
+ xhrPackageListUrl: "{% url 'xhr_customrecipe_packages' recipe.pk %}",
+ xhrCustomRecipeUrl: "{% url 'xhr_customrecipe_id' recipe.pk %}",
+ }
+ };
+
+ try {
+ customRecipePageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<!-- Delete recipe modal -->
+<div id="delete-recipe-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-body">
+ <p>Are you sure you want to delete the <strong>{{recipe.name}}</strong>
+ custom image?</p>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-primary" id="delete-custom-recipe-confirmed">
+ <span data-role="submit-state">Delete custom image</span>
+ <span data-role="loading-state" style="display:none">
+ <span class="fa-pulse">
+ <i class="fa-pulse icon-spinner"></i>
+ </span>
+ &nbsp;Deleting custom image...
+ </span>
+ </button>
+ <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+<!-- end delete recipe modal -->
+
+<!-- package dependencies modal -->
+<div id="package-deps-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3><span class="package-to-add-name"></span> dependencies</h3>
+ </div>
+ <div class="modal-body">
+ <p>Based on information from a previous build it is likely that adding <strong class="package-to-add-name"></strong> will also add the following packages to your custom image:
+ </p>
+ <ul id="package-add-dep-list">
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <p class="help-block text-left">Total package size: <strong id="package-deps-total-size"></strong></p>
+ <button id="add-package-deps-modal-btn" type="submit" class="btn btn-primary" data-dismiss="modal">Add packages</button>
+ <button class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+<!-- end package dependencies modal -->
+
+<!-- package reverse dependencies modal -->
+<div style="display:none" id="package-reverse-deps-modal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3><span class="package-to-rm-name"></span> reverse dependencies</h3>
+ </div>
+ <div class="modal-body">
+ <p> <strong class="reverse-deps-count"></strong> <span class="reverse-deps-package"></span> in your image <span class="reverse-deps-depends"></span> on <strong class="package-to-rm-name"></strong>:</p>
+ <ul id="package-reverse-dep-list">
+ </ul>
+ <p>In order to remove <strong class="package-to-rm-name"></strong>, you must remove <span class="reverse-deps-this"></span> <strong class="reverse-deps-count"></strong> <span class="reverse-deps-package"></span> as well.</p>
+ </div>
+ <div class="modal-footer">
+ <p class="help-block text-left">Total package size: <strong id="package-reverse-deps-total-size"></strong></p>
+ <button id="rm-package-reverse-deps-modal-btn" type="submit" class="btn btn-primary" data-dismiss="modal">Remove all <span class="reverse-deps-count-plus1"></button>
+ <button class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div><!-- /.modal -->
+<!-- end package dependencies modal -->
+
+<div class="alert alert-success alert-dismissible change-notification" id="image-created-notification" style="display: none">
+ <button type="button" data-dismiss="alert" class="close">&times;</button>
+ <p>Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed.</p>
+</div>
+<div class="page-header">
+ <h1>
+ {{recipe.name}}
+ <small>({{recipe.layer_version.layer.name}})</small>
+ </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-8">
+ <div class="button-place btn-group" style="width: 100%">
+ <a class="btn btn-default btn-lg build-custom-image" href="#" style="width: 50%">
+ Build {{recipe.name}}
+ </a>
+ <a href="{% url 'customrecipedownload' project.id recipe.id %}" class="btn btn-default btn-lg" style="width: 50%"
+ {% if not base_recipe_file %}
+ disabled="disabled"
+ {% endif %}>
+ Download recipe file
+ {% if not base_recipe_file %}
+ <i class="icon-question-sign get-help"
+ data-original-title="The recipe file doesn't exist yet, so you cannot download it. You need to build your custom image first"></i>
+ {% endif %}
+ </a>
+ </div>
+ <div id="no-results-special-{{table_name}}" class="top-air" style="display:none;">
+ <div class="alert alert-warning">
+ <h3>No packages found</h3>
+ <p>You might consider <a href={% url 'projectsoftwarerecipes' project.id %}>searching the list of recipes</a> instead.</p>
+ <p>If you find a recipe that matches the name of the package you want:</p>
+ <ol>
+ <li>Add the layer providing the recipe to your project</li>
+ <li>Build the recipe</li>
+ <li>Once the build completes, come back to this page and search for the package</li>
+ </ol>
+ <form class="form-inline no-results">
+ <div class="form-group">
+ <div class="btn-group">
+ <input type="text" class="form-control no-results-search-input" id="no-results-search-input-{{table_name}}" name="search" placeholder="Search {{title|lower}}" />
+ <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" id="no-results-remove-search-btn" tabindex="-1"></span>
+ </div>
+ </div>
+ <button class="btn btn-default search-submit-{{table_name}}">Search</button>
+ <button class="btn btn-link" id="no-results-show-all-packages">Show all packages</button>
+ </form>
+ </div>
+ </div>
+ <div id="results-found-{{table_name}}">
+ <div id="packages-table">
+ {% if recipe.get_all_packages.count == 0 and last_build == None %}
+ <h2> Add | Remove packages </h2>
+ <div class="alert alert-info">
+ <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p>
+ <button class="btn btn-info btn-lg build-custom-image" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button>
+ </div>
+ {% else %}
+ {# ToasterTable for Adding remove packages #}
+ {% url 'recipeselectpackages' project.id recipe.id as xhr_table_url %}
+ <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2>
+ {% include "toastertable.html" %}
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="well">
+ <h2>About {{recipe.name}}</h2>
+
+ <dl class="item-info">
+ <dt>
+ Approx. packages included
+ <span class="glyphicon glyphicon-question-sign get-help" title="" data-original-title="The number of packages included is based on information from previous builds and from parsing layers, so we can never be sure it is 100% accurate"></span>
+ </dt>
+ <dd id="total-num-packages">{{recipe.get_all_packages.count}}</dd>
+ <dt>
+ Approx. package size
+ <span class="glyphicon glyphicon-question-sign get-help" title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></span>
+ </dt>
+ <dd id="total-size-packages">{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd>
+ {% if last_build %}
+ <dt>Last build</dt>
+ <dd>
+ <span class="glyphicon glyphicon-ok-circle"></span>
+ <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a>
+ </dd>
+ {% endif %}
+ <dt>Based on</dt>
+ <dd><a href="{% url 'recipedetails' project.id recipe.base_recipe.pk %}">{{recipe.base_recipe.name}}</a></dd>
+ {% if recipe.get_last_successful_built_target %}
+ {% with recipe.get_last_successful_built_target as last_build_target %}
+ <dt>Last build</dt>
+ <dd>
+ <span class="glyphicon glyphicon-ok-circle"></span>
+ <a href="{% url 'builddashboard' last_build_target.build.pk %}">
+ {{last_build_target.build.completed_on|date:"d/m/y H:i"}}</a>
+ </dd>
+ {% endwith %}
+ {% endif %}
+ {% if base_recipe_file %}
+ <dt>Recipe file</dt>
+ <dd>
+ <code>{{recipe.name}}_{{recipe.version}}.bb</code>
+ <a href="{% url 'customrecipedownload' project.pk recipe.pk %}"><span class="glyphicon glyphicon-download-alt" data-toggle="tooltip" title="Download recipe file"></span></a>
+ </dd>
+ {% endif %}
+ <dt>Layer</dt>
+ <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd>
+ {% if recipe.summary %}
+ <dt>
+ Summary
+ </dt>
+ <dd>
+ {{recipe.summary}}
+ </dd>
+ {% endif %}
+ {% if recipe.description %}
+ <dt>
+ Description
+ </dt>
+ <dd>
+ {{recipe.description}}
+ </dd>
+ {% endif %}
+ <dt>Version</dt>
+ <dd>
+ {{recipe.version}}
+ </dd>
+ {% if recipe.section %}
+ <dt>Section</dt>
+ <dd>
+ {{recipe.section}}
+ </dd>
+ {% endif %}
+ <dt>License</dt>
+ <dd>
+ {{recipe.license}}
+ <span class="glyphicon glyphicon-question-sign get-help" title="All custom images have their license set to MIT. This is because the license applies only to the recipe (.bb) file, and not to the image itself. To see which licenses apply to the image you must check the license manifest generated with each build"></i>
+ </dd>
+ </dl>
+ <i class="icon-trash text-danger"></i>
+ <a href="#delete-recipe-modal" data-target="#delete-recipe-modal" data-toggle="modal" class="text-danger" id="delete-recipe">
+ Delete custom image
+ </a>
+ </div>
+ </div>
+</div>
+
+{% endwith %}{# end base_recipe_file #}
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html b/poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
new file mode 100644
index 000000000..15adfbc91
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/detail_pagination_bottom.html
@@ -0,0 +1,57 @@
+{% comment %}
+ Show pagination controls as per search/pagination table detail spec.
+ Input: objects, setup for pagination using the standard method in views.
+ object_count, count for complete list of objects, (all pages, no pattern)
+{% endcomment %}
+
+{# only paginate if 10 or more rows unfiltered, all pages #}
+{% if object_count >= 10 %}
+<div id="pagination-detail">
+ <ul class="pagination">
+{%if objects.has_previous %}
+ <li><a href="javascript:reload_params({'page':{{objects.previous_page_number}}})">&laquo;</a></li>
+{%else%}
+ <li class="disabled"><a href="#">&laquo;</a></li>
+{%endif%}
+{% for i in objects.page_range %}
+ <li{%if i == objects.number %} class="active" {%endif%}><a href="javascript:reload_params({'page':{{i}}})">{{i}}</a></li>
+{% endfor %}
+{%if objects.has_next%}
+ <li><a href="javascript:reload_params({'page':{{objects.next_page_number}}})">&raquo;</a></li>
+{%else%}
+ <li class="disabled"><a href="#">&raquo;</a></li>
+{%endif%}
+ </ul>
+
+ <form class="navbar-form navbar-right">
+ <div class=form-group">
+ <label>Show rows:</label>
+ <select class="pagesize form-control">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+</div>
+
+<!-- Update page display settings -->
+<script>
+ $(document).ready(function() {
+ // load data for number of entries to be displayed on page
+ if ({{request.GET.count}} != "") {
+ pagesize = {{request.GET.count}};
+ }
+ $('.pagesize option').prop('selected', false)
+ .filter('[value="' + pagesize + '"]')
+ .attr('selected', true);
+
+ $(".pagesize").change(function () {
+ reload_params({"count":$(this).val()});
+ });
+});
+</script>
+{% endif %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html b/poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html
new file mode 100644
index 000000000..7a9865908
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/detail_search_header.html
@@ -0,0 +1,72 @@
+{% comment %}
+ Show a detail table Search field and Rows per page.
+ Input:
+ objects, our boilerplated paginated with search fields set.
+ object_count, count of full, unfiltered, objects list
+ search_what, fills in "Search ___"
+ Only show the search form if we have more than 10 results,
+ or if return from a previous search.
+{% endcomment %}
+
+
+<script>
+$(document).ready(function() {
+ /* Clear the current search selection and reload the results */
+ $(".search-clear").click(function(){
+ $("#search").val("");
+ $(this).parents("form").submit();
+ });
+});
+</script>
+
+{% if objects.paginator.count > 10 or request.GET.search %}
+ {% if objects.paginator.count == 0 %}
+ <div class="alert alert-warning">
+ <h4>No {{search_what}} found</h4>
+ <form id="searchform" class="form-inline">
+ {% else %}
+ <form id="searchform" class="navbar-form navbar-left detail-page-controls">
+ {% endif %}
+
+ <div class="form-group">
+ <div class="btn-group">
+ <input id="search" class="form-control" type="text" placeholder="Search {{search_what}}" name="search" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}">
+ <input type="hidden" value="name:+" name="orderby">
+ <input type="hidden" value="l" name="page">
+ {% if request.GET.search %}
+ <span class="remove-search-btn-detail-search search-clear glyphicon glyphicon-remove-circle"></span>
+ {% endif %}
+ </div>
+ </div>
+ <button type="submit" class="btn btn-default">Search</button>
+ {% if objects.paginator.count == 0 %}
+ <button type="submit" class="btn btn-link search-clear">
+ Show all {{search_what}}
+ </button>
+ {% endif %}
+ </form>
+ {% endif %}
+
+ {% if objects.paginator.count == 0 %}
+ </div> {# end alert #}
+ {% else %}
+ {% if object_count > 10 %}
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="pagesize form-control">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ {% if request.session.limit == i %}
+ <option value="{{i}}" selected>{{i}}</option>
+ {% else %}
+ <option value="{{i}}">{{i}}</option>
+ {% endif %}
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+ {% endif %}
+{% endif %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html b/poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html
new file mode 100644
index 000000000..4434df439
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/detail_sorted_header.html
@@ -0,0 +1,25 @@
+{% comment %}
+ Adds sorted columns to a detail table.
+ Must be preceded by <table class="table table-bordered table-hover tablesorter" id="otable">
+ Must be followed by <tbody>...</tbody></table>.
+ Requires tablecols setup column fields dclass, clclass, qhelp, orderfield.
+{% endcomment %}
+{% load projecttags %}
+{# <table class="table table-bordered table-hover tablesorter" id="otable"> #}
+ <thead>
+ <!-- Table header row; generated from "tablecols" entry in the context dict -->
+ <tr>
+ {% for tc in tablecols %}<th class="{%if tc.dclass%}{{tc.dclass}}{% endif %} {%if tc.class %}{{tc.clclass}}{% endif %}">
+ {%if tc.qhelp%}<span class="glyphicon glyphicon-question-sign get-help" title="{{tc.qhelp}}"></span>{%endif%}
+ {%if tc.orderfield%}<a {%if tc.ordericon%} class="sorted" {%endif%}href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })">{{tc.name}}</a>{%else%}<span class="text-muted">{{tc.name}}</span>{%endif%}
+ {%if tc.ordericon%} <span class="icon-caret-{{tc.ordericon}}"></span>{%endif%}
+ {% if request.GET.search and forloop.first %}
+ <span class="badge badge-info">{{objects.paginator.count}}</span>
+ {% endif %}
+ {%if tc.filter%}<div class="btn-group pull-right">
+ <a href="#filter_{{tc.filter.class}}" role="button" class="btn btn-mini {%if request.GET.filter%}{{tc.filter.options|filtered_icon:request.GET.filter}} {%endif%}" {%if request.GET.filter and tc.filter.options|filtered_tooltip:request.GET.filter %} title="<p>{{tc.filter.options|filtered_tooltip:request.GET.filter}}</p><p><a class='btn btn-sm btn-primary' href=javascript:reload_params({'filter':''})>Show all {% if filter_search_display %}{{filter_search_display}}{% else %}{{objectname}}{% endif %}</a></p>" {%endif%} data-toggle="modal"> <i class="glyphicon glyphicon-filter filtered"></i> </a>
+ </div>{%endif%}
+ </th>{% endfor %}
+ </tr>
+ </thead>
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html b/poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html
new file mode 100644
index 000000000..ab89e279f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/dirinfo.html
@@ -0,0 +1,245 @@
+{% extends "basebuildpage.html" %}
+{% block title %} Directory structure - {{ target.target }} {{ build.machine }} - {{ build.project.name }} - Toaster {% endblock %}
+{% block extraheadcontent %}
+{% load static %}
+<link rel="stylesheet" href="{% static 'css/jquery.treetable.css' %}" type="text/css">
+<link rel="stylesheet" href="{% static 'css/jquery.treetable.theme.toaster.css' %}" type="text/css">
+{% endblock extraheadcontent %}
+
+{% block localbreadcrumb %}
+<li>{{target.target}}</li>
+{% endblock localbreadcrumb%}
+
+{% block buildinfomain %}
+
+{% load static %}
+<script src="{% static 'js/jquery.treetable.js' %}">
+</script>
+{% load projecttags %}
+
+<script type='text/javascript'>
+ var ctx = {};
+ ctx.target = "{{target.target}}";
+
+ $(document).ready(function(){
+ $("#menu-"+ctx.target).addClass("active");
+ });
+
+ function setupTreetable() {
+ $("#dirtable").treetable({
+ expandable: true,
+ branchAttr: "ttBranch",
+ clickableNodeNames: true,
+ onNodeCollapse: function() {
+ /* Do nothing, keep cached */
+ },
+ onNodeExpand: function() {
+ var start = this.id;
+ var n = $("#dirtable").treetable("node", start);
+ if (this.children.length > 0) {
+ /* already was expanded once */
+ $("#dirtable").treetable("reveal", start);
+ }
+ else {
+ var url = "{% url "dirinfo_ajax" build.id target.id %}";
+ $.ajax({
+ async: false,
+ type : "GET",
+ url : url,
+ data : "start=" + start,
+ success : function(response) {
+ addRows(n, response)
+ },
+ error : function(jqXHR, textStatus, errorThrown ) {alert(textStatus + ":" + errorThrown)},
+ });
+ }
+ },
+ });
+ }
+ function td(data) {
+ if (data == null) {
+ data = '';
+ }
+ return '<td>' + data + '</td>'
+ }
+
+ function formatRow(o) {
+ /* setup tr-wide formatting */
+ var tr = '<tr class="';
+ if (o.isdir && o.childcount) {
+ tr += 'branch" data-tt-branch="true" ';
+ }
+ else {
+ tr += 'leaf" data-tt-branch="false" ';
+ }
+ tr += ' data-tt-id="' + o.fullpath +'" ';
+ if (o.parent != "/") {
+ tr += ' data-tt-parent-id="' + o.parent +'" ';
+ }
+ tr += '>';
+
+ /* setup td specific formatting */
+ var link_to = '<td class="text-muted">' + o.link_to + '</td>';
+ var size = '<td class = "sizecol">' + o.size + '</td>'
+ var permission = td(o.permission);
+ var owner = td(o.owner);
+ var group = td(o.group);
+
+ /* handle the name column */
+ var name = null;;
+ var namespan=1;
+ if (o.isdir) {
+ if (o.link_to == null) {
+ namespan = 2;
+ if (o.package == null) {
+ namespan = 3;
+ }
+ }
+ var colspan = 'colspan="' + namespan + '"';
+ name = '<td class="content-directory"' + colspan + '>';
+ if (o.childcount) {
+ name += '<a href="">';
+ }
+ name += '<span class="glyphicon glyphicon-folder-close"></span>';
+ name += '&nbsp;' + o.name;
+ if (o.childcount) {
+ name += '</a>';
+ }
+ name += '</td>';
+ }
+ else {
+ if (o.link_to == null) {
+ namespan = 2;
+ if (o.package == null) {
+ namespan = 3;
+ }
+ var colspan = 'colspan="' + namespan + '"';
+ name = '<td ' + colspan + '><span class="glyphicon glyphicon-file"></span>';
+ }
+ else {
+ name = '<td class="text-muted"><span class="glyphicon glyphicon-hand-right"></span>';
+ }
+ name += '&nbsp;' + o.name;
+ name += '</td>';
+ }
+
+ /* handle the package column */
+ var package = null;
+ if (o.package != null) {
+ /* add link to included package page */
+ build_id = {{ build.id }};
+ target_id = {{ target.id }};
+ /* Create a url for a dummy package id of 0 */
+ dummy = "{% url 'package_included_detail' build.id target.id 0 %}"
+ /* fill in the package id */
+ url = dummy.substr(0, dummy.length-1) + o.package_id;
+ package = '<a href=' + url + '>' ;
+ package += o.package;
+ package += '</a>';
+ if (o.installed_package != o.package) {
+ /* make class muted and add hover help */
+ package += '<span class="text-muted"> as ' + o.installed_package + ' </span>';
+ package += '<span class="glyphicon glyphicon-question-sign get-help hover-help" ';
+ package += 'title="' + o.package + ' was renamed at packaging time and was installed in your image as ' + o.installed_package + '">';
+ package += '</span>';
+ }
+ }
+ package = td(package);
+
+ var cols1to3;
+ switch (namespan) {
+ case 3:
+ cols1to3 = name;
+ break;
+ case 2:
+ cols1to3 = name + package;
+ break;
+ default:
+ cols1to3 = name + link_to + package;
+ }
+ r = tr + cols1to3 + size + permission + owner + group + "</tr>"
+ return r;
+ }
+
+ function addRows(n, objs) {
+ rows = "";
+ for (i=0; i<objs.length; i++) {
+ rows += formatRow(objs[i]);
+ }
+ $("#dirtable").treetable("loadBranch", n, rows);
+ }
+
+ $.fn.isOffScreen = function(){
+ var win = $(window);
+ viewportBottom = win.scrollTop() + win.height();
+
+ var bounds = this.offset();
+ bounds.bottom = bounds.top + this.outerHeight();
+
+ return (bounds.bottom > viewportBottom);
+ };
+
+ function selectRow(path) {
+ var row = $('tr[data-tt-id="' + path + '"]');
+ row.addClass(" highlight");
+ if (row.isOffScreen()) {
+ $('html, body').animate({ scrollTop: row.offset().top - 150}, 2000);
+ }
+ }
+</script>
+
+<div class="col-md-10">
+
+ <div class="page-header build-data">
+ <h1> {{target.target}} </h1>
+ </div>
+
+ <ul class="nav nav-tabs">
+ <li>
+ <a href="{% url 'target' build.id target.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></span>
+ Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
+ </a>
+ </li>
+ <li class="active">
+ <a href="{% url 'dirinfo' build.id target.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The directories and files in the root file system of this image"></span>
+ Directory structure
+ </a>
+ </li>
+ </ul>
+
+ <div id="directory-structure" class="tab-pane active">
+ <table id="dirtable" class="table table-bordered table-hover treetable">
+ <thead>
+ <tr>
+ <th>Directory / File</th>
+ <th>Symbolic link to</th>
+ <th>Source package</th>
+ <th class="narrow-col">Size</th>
+ <th class="medium-col">Permissions</th>
+ <th class="narrow-col">Owner</th>
+ <th class="narrow-col">Group</th>
+ </tr>
+ </thead>
+ <tbody>
+ <script type='text/javascript'>
+ setupTreetable();
+ addRows(null, {{ objects|safe }} );
+ {% if file_path %}
+ {% comment %}
+ link from package_included_detail specifies file path
+ {% endcomment %}
+ {% for dir_elem in dir_list %}
+ $("#dirtable").treetable("expandNode", "{{dir_elem}}");
+ {% endfor %}
+ selectRow("{{file_path}}");
+ {% endif %}
+ </script>
+ </tbody>
+ </table>
+ </div> <!-- directory-structure -->
+</div> <!-- col-md-10 -->
+
+{% endblock buildinfomain %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/diskio.html b/poky/bitbake/lib/toaster/toastergui/templates/diskio.html
new file mode 100644
index 000000000..c5cef6f38
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/diskio.html
@@ -0,0 +1,4 @@
+{% extends "basebuildpage.html" %}
+{% block localbreadcrumb %}
+<li>Disk I/O</li>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/distro_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/distro_btn.html
new file mode 100644
index 000000000..fac79472c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/distro_btn.html
@@ -0,0 +1,20 @@
+<a href="{% url 'project' extra.pid %}?setDistro={{data.name}}" class="btn btn-default btn-block layer-exists-{{data.layer_version.id}}"
+ {% if data.layer_version.pk not in extra.current_layers %}
+ style="display:none;"
+ {% endif %}>
+ Set distro</a>
+<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.id}}" data-layer='{
+ "id": {{data.layer_version.id}},
+ "name": "{{data.layer_version.layer.name}}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}"
+ }' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ <span class="glyphicon glyphicon-plus"></span>
+ Add layer
+ <span class="glyphicon glyphicon-question-sign get-help" title="To select this distro, you must first add the {{data.layer_version.layer.name}} layer to your project"></i>
+</a>
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html b/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html
new file mode 100644
index 000000000..baa36c0e1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/editcustomimage_modal.html
@@ -0,0 +1,88 @@
+<!--
+modal dialog shown on the build dashboard, for editing an existing custom image;
+only shown if more than one custom image was built, so the user needs to
+choose which one to edit
+
+required context:
+ build - a Build object
+-->
+<div class="modal fade" aria-hidden="false" id="edit-custom-image-modal">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3>Which image do you want to edit?</h3>
+ </div>
+
+ <div class="modal-body">
+ {% for recipe in build.get_custom_image_recipes %}
+ <div class="radio">
+ <label>
+ <input type="radio" name="select-custom-image"
+ data-url="{% url 'customrecipe' build.project.id recipe.id %}">
+ {{recipe.name}}
+ </label>
+ </div>
+ {% endfor %}
+ <span class="help-block text-danger" id="invalid-custom-image-help" style="display:none">
+ Please select a custom image to edit.
+ </span>
+ </div>
+
+ <div class="modal-footer">
+ <button class="btn btn-primary btn-lg" data-url="#"
+ data-action="edit-custom-image" disabled>
+ Edit custom image
+ </button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<script>
+$(document).ready(function () {
+ var editCustomImageButton = $('[data-action="edit-custom-image"]');
+ var error = $('#invalid-custom-image-help');
+ var radios = $('[name="select-custom-image"]');
+
+ // return custom image radio buttons which are selected
+ var getSelectedRadios = function () {
+ return $('[name="select-custom-image"]:checked');
+ };
+
+ function enableSubmit() {
+ if (getSelectedRadios().length === 1) {
+ editCustomImageButton.removeAttr('disabled');
+ error.hide();
+ }
+ else {
+ editCustomImageButton.attr('disabled', 'disabled');
+ error.show();
+ }
+ };
+
+ $("#edit-custom-image-modal").on("shown.bs.modal", function() {
+ enableSubmit();
+ });
+
+ radios.change(function () {
+ enableSubmit();
+ });
+
+ editCustomImageButton.click(function () {
+ var selectedRadios = getSelectedRadios();
+
+ if (selectedRadios.length === 1) {
+ document.location.href = selectedRadios.first().attr('data-url');
+ }
+ else {
+ error.show();
+ }
+ });
+
+ // Select the first custom image listed. Radio button groups
+ // should always have an option selected by default
+ $("input:radio:first").attr("checked", "checked");
+
+});
+</script>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html b/poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html
new file mode 100644
index 000000000..1286ca315
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/filtersnippet.html
@@ -0,0 +1,72 @@
+{% load projecttags %}
+<!-- '{{f.class}}' filter -->
+{% with f.class as key %}
+
+<div id="filter_{{f.class}}" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <form>
+ <input type="hidden" name="search" value="{%if request.GET.search %}{{request.GET.search}}{%endif%}"/>
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ {% if search_term %}
+ <h3>Filter {{total_count}} {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} matching '{{search_term}}' by '{{tc.name}}'</h3>
+ {% else %}
+ <h3>Filter {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%} by '{{tc.name}}'</h3>
+ {% endif %}
+ </div>
+ <div class="modal-body">
+ <p>{{f.label}}</p>
+ <div class="radio">
+ <label>
+ <input type="radio" name="filter" {%if request.GET.filter%}{{f.options|check_filter_status:request.GET.filter}} {%else%} checked {%endif%} value="" data-key="{{key}}"> All {%if filter_search_display%}{{filter_search_display|title}}{%else%}{{objectname|title}}{%endif%}
+ </label>
+ </div>
+ {% for option in f.options %}
+ <div class="radio">
+ {% if option.1 == 'daterange' %}
+ <label>
+ <input type="radio" name="filter" id="filter_value_{{key}}" {%if key == daterange_selected %}checked{%endif%} value="{{option.1}}" data-key="{{key}}"> {{option.0}}
+ {% else %}
+ {% if 1 %}
+ <label>
+ <input type="radio" name="filter" {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}" data-key="{{key}}"> {{option.0}}
+ {% comment "do not disable radio selections by count for now" %}{% else %}
+ <label class="text-muted">
+ <input type="radio" name="filter" disabled {%if request.GET.filter == option.1 %}checked{%endif%} value="{{option.1}}" data-key="{{key}}"> {{option.0}}
+ {% endcomment %}{% endif %}
+ {% endif %}
+ {% if option.3 %}<i class="icon-question-sign get-help" data-placement="right" title="{{option.3}}"></i>{% endif %}
+ </label></div>
+ {% if option.1 == 'daterange' %}
+ <input type="text" id="date_from_{{key}}" name="date_from_{{key}}" disabled class="input-sm" /><label class="help-inline">to</label>
+ <input type="text" id="date_to_{{key}}" name="date_to_{{key}}" disabled class="input-sm" />
+ <label class="help-inline get-help" >(dd/mm/yyyy)</label>
+ </div>
+ {% endif %}
+ {% endfor %}
+ <!-- daterange persistence -->
+ {% if last_date_from and last_date_to %}
+ <input type="hidden" id="last_date_from_{{key}}" name="last_date_from" value="{{last_date_from}}"/>
+ <input type="hidden" id="last_date_to_{{key}}" name="last_date_to" value="{{last_date_to}}"/>
+ {% endif %}
+ </div>
+ <div class="modal-footer">
+ <div class="row">
+ <div class="col-md-6">
+ <button type="submit" class="btn btn-primary" data-key="{{key}}">Apply</button>
+ </div>
+ <div class="col-md-6">
+ {% if request.GET.filter %}
+ {% if request.GET.filter|string_remove_regex:':.*' != f.options.0.1|string_remove_regex:':.*' %}
+ <p class="text-right text-muted">You can only apply one filter to the table. This filter will override the current filter.</p>
+ {% endif %}
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </form>
+ </div><!-- /.modal-content -->
+</div><!-- /.modal-dialog -->
+</div> <!--/.modal -->
+{% endwith %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html b/poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html
new file mode 100644
index 000000000..b3eabe1a2
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/generic-toastertable-page.html
@@ -0,0 +1,17 @@
+{% extends "baseprojectpage.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block projectinfomain %}
+
+<h2>{{title}} (<span class="table-count-{{table_name}}"></span>)
+ {% if project.release %}
+ <i class="glyphicon glyphicon-question-sign get-help" title="This page lists {{title|lower}} compatible with the release selected for this project, which is {{project.release.description}}"></i>
+ {% endif %}
+</h2>
+
+{% url table_name project.id as xhr_table_url %}
+{% include "toastertable.html" %}
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/health.html b/poky/bitbake/lib/toaster/toastergui/templates/health.html
new file mode 100644
index 000000000..f17fdbc43
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/health.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head><title>Toaster Health</title></head>
+ <body>Ok</body>
+</html>
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/importlayer.html b/poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
new file mode 100644
index 000000000..97d52c76c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/importlayer.html
@@ -0,0 +1,170 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block title %} Import layer - {{project.name}} - Toaster {% endblock %}
+{% block pagecontent %}
+
+<div class="row">
+ {% include "projecttopbar.html" %}
+ {% if project and project.release %}
+ <script src="{% static 'js/layerDepsModal.js' %}"></script>
+ <script src="{% static 'js/importlayer.js' %}"></script>
+ <script>
+ $(document).ready(function (){
+ var ctx = {
+ xhrLayerUrl : "{% url 'xhr_layer' project.id %}",
+ xhrGitRevTypeAheadUrl : "{% url 'xhr_gitrevtypeahead' %}",
+ };
+
+ try {
+ importLayerPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+ </script>
+
+ <form class="col-md-11">
+ <span class="help-block">The layer you are importing must be compatible with <strong>{{project.release.description}}</strong>, which is the release you are using in this project.</span>
+ <div class="alert alert-error" id="import-error" style="display:none">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ <h3>&nbsp;</h3>
+ <p></p>
+ <ul></ul>
+ </div>
+ <fieldset>
+ <div class="form-group" id="layer-name-ctrl">
+ <label class="control-label" for="import-layer-name">
+ Layer name
+ <span class="glyphicon glyphicon-question-sign get-help" title="Something like 'meta-mylayer'. Your layer name must be unique and can only include letters, numbers and dashes"></span>
+ </label>
+ <input class="form-control" id="import-layer-name" type="text" required autofocus data-autocomplete="off" data-provide="typeahead">
+ <span class="help-block" style="display: none;" id="invalid-layer-name-hint">A valid layer name can only include letters, numbers and dashes</span>
+ <span class="help-inline" style="display: none;" id="duplicated-layer-name-hint"></span>
+ </div>
+ </fieldset>
+ <div id="duplicate-layer-info" style="display:none">
+ <div class="alert alert-warning">
+ <h3>A layer called <a href="" class="dup-layer-link"><span class="dup-layer-name"></span></a> already exists</h3>
+ <p>Layer names must be unqiue. Please use a different layer name.</p>
+ <dl id="git-layer-dup" style="display:none;">
+ <dt>
+ The <span class="dup-layer-name"></span> repository url is
+ </dt>
+ <dd>
+ <span id="dup-layer-vcs-url"></span>
+ </dd>
+ <dt>
+ The <span class="dup-layer-name"></span> revision is
+ </dt>
+ <dd>
+ <span id="dup-layer-revision"></span>
+ </dd>
+ </dl>
+ <dl id="local-layer-dup" style="display:none;">
+ <dt>
+ The <span class="dup-layer-name"></span> directory is
+ </dt>
+ <dd>
+ <span id="dup-local-source-dir-name"></span>
+ </dd>
+ </dl>
+ <p><a href="" class="dup-layer-link">View the <span class="dup-layer-name"></span> layer information</a></p>
+ </div>
+ </div>
+ <fieldset class="fields-apart-from-layer-name" id="repo-select">
+ <legend class="radioLegend">Where is the layer source code?</legend>
+ <div class="radio">
+ <label>
+ <input type="radio" id="git-repo-radio" name="repo" value="git" checked="checked">
+ In a <strong>Git repository</strong>
+ </label>
+ <p class="help-block radio-help">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p>
+ </div>
+ <div class="radio">
+ <label>
+ <input type="radio" id="local-dir-radio" name="repo" value="local">
+ In a <strong>directory</strong>
+ </label>
+ <p class="help-block radio-help">Use this option for quick layer development, by simply providing the path to the layer source code.</p>
+ </div>
+ </fieldset>
+ <fieldset class="fields-apart-from-layer-name" id="git-repo">
+ <legend>Git repository information</legend>
+ <div class="form-group">
+ <label for="layer-git-repo-url">
+ Git repository URL
+ <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
+ </label>
+ <input type="text" id="layer-git-repo-url" class="form-control" required>
+ </div>
+ <div class="form-group">
+ <label for="layer-subdir">
+ Repository subdirectory
+ <span class="text-muted">(optional)</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
+ </label>
+ <input type="text" class="form-control" id="layer-subdir">
+ </div>
+ <div class="form-group" id="layer-revision-ctrl">
+ <label for="layer-git-ref">
+ Git revision
+ <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
+ </label>
+ <span style="display: block">
+ <input type="text" class="form-control" id="layer-git-ref" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" required>
+ </span>
+ <span class="help-block has-error" style="display:none;" id="invalid-layer-revision-hint">The "HEAD" branch is reserved (only allowed for the "Local Yocto Project" layers)</span>
+ </div>
+ </fieldset>
+
+ <fieldset class="fields-apart-from-layer-name" id="local-dir" style="display:none;">
+ <legend>Layer directory information</legend>
+ <div class="form-group">
+ <label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label>
+ <input type="text" class="form-control" id="local-dir-path" required/>
+ <p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p>
+ <p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
+ </div>
+ </fieldset>
+
+ <fieldset class="fields-apart-from-layer-name">
+ <legend>
+ Layer dependencies
+ <small class="text-muted">(optional)</small>
+ <span class="glyphicon glyphicon-question-sign get-help heading-help" title="Other layers this layer depends upon"></span>
+ </legend>
+ <ul class="list-unstyled lead" id="layer-deps-list">
+ </ul>
+ <div class="form-inline">
+ <div class="form-group">
+ <input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" placeholder="Type a layer name" id="layer-dependency" class="form-control">
+ </div>
+ <button class="btn btn-default" id="add-layer-dependency-btn">
+ Add layer
+ </button>
+ <span class="help-inline">You can only add layers Toaster knows about</span>
+ </fieldset>
+ <div class="top-air fields-apart-from-layer-name" id="form-actions">
+ <button class="btn btn-primary btn-lg" data-toggle="modal" id="import-and-add-btn" data-target="#dependencies-message" disabled>Import and add to project</button>
+ <span class="help-inline" id="import-git-layer-and-add-hint" style="vertical-align: middle;">To import a layer you need to enter a layer name, a Git repository URL and a Git revision (branch, tag or commit)</span>
+ <span class="help-inline" id="import-local-dir-and-add-hint" style="vertical-align: middle;display:none;">To import a layer you need to enter a layer name and the absolute path to the layer directory</span>
+ </div>
+ </div>
+</form>
+
+ {% else %} {#project and project release#}
+ <div class="page-header">
+ <h1>Import layer</h1>
+ </div>
+ <div class="alert alert-info" id="import-error" >
+ <h3>Unsupported project type</h3>
+ <p>This project does not support importing layers.</p>
+ <ul></ul>
+ </div>
+
+ {% endif %}
+</div>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html b/poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
new file mode 100644
index 000000000..ca248962f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/js-unit-tests.html
@@ -0,0 +1,47 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+<link rel="stylesheet" href="{% static 'css/qunit-1.18.0.css' %}" />
+
+<script src="{% static 'js/qunit-1.18.0.js' %}"></script>
+
+<script src="{% static 'js/layerDepsModal.js' %}"></script>
+<script src="{% static 'js/projectpage.js' %}"></script>
+
+<script src="{% static 'js/bootstrap.min.js' %}"></script>
+<script src="{% static 'js/filtersnippet.js' %}"></script>
+<script src="{% static 'js/importlayer.js' %}"></script>
+<script src="{% static 'js/highlight.pack.js' %}"></script>
+<script src="{% static 'js/layerBtn.js' %}"></script>
+<script src="{% static 'js/layerDepsModal.js' %}"></script>
+<script src="{% static 'js/projectpage.js' %}"></script>
+<script src="{% static 'js/layerdetails.js' %}"></script>
+<script src="{% static 'js/table.js' %}"></script>
+
+<script>
+ var ctx = {
+ tableUrl : '{% url 'projectlayers' project.pk %}',
+ projectId : {{project.pk}},
+ }
+</script>
+<script src="{% static 'js/tests/test.js' %}"></script>
+
+<div id="qunit"></div>
+
+<input type="text" id="layers" placeholder="layers" ></input>
+<input type="text" id="recipes" placeholder="recipes"></input>
+<input type="text" id="projects" placeholder="projects"></input>
+<input type="text" id="machines" placeholder="machines"></input>
+
+<!-- import layer dependency input typeahead -->
+<input type="text" id="layer-dependency" style="display:none"></input>
+<!-- project page input typeaheads -->
+<input type="text" id="layer-add-input" style="display:none"></input>
+<input type="text" id="machine-change-input" style="display:none"></input>
+<!-- import layer dependency input typeahead on layer details edit layer -->
+<input type="text" id="layer-dep-input" style="display:none"></input>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/landing.html b/poky/bitbake/lib/toaster/toastergui/templates/landing.html
new file mode 100644
index 000000000..70c7359fa
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/landing.html
@@ -0,0 +1,67 @@
+{% extends "base.html" %}
+
+{% load static %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Welcome to Toaster {% endblock %}
+{% block pagecontent %}
+ <div class="row">
+ <div class="jumbotron well-transparent">
+
+ <div class="col-md-6">
+ <h1>This is Toaster</h1>
+
+ <p>A web interface to <a href="http://www.openembedded.org">OpenEmbedded</a> and <a href="http://www.yoctoproject.org/tools-resources/projects/bitbake">BitBake</a>, the <a href="http://www.yoctoproject.org">Yocto Project</a> build system.</p>
+
+ <p class="top-air">
+ <a class="btn btn-info btn-lg" href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#toaster-manual-setup-and-use">
+ Toaster is ready to capture your command line builds
+ </a>
+ </p>
+
+ {% if lvs_nos %}
+ {% if project_enable %}
+ <p class="top-air">
+ <a class="btn btn-primary btn-lg" href="{% url 'newproject' %}">
+ Create your first Toaster project to run manage builds
+ </a>
+ </p>
+ {% endif %}
+ {% else %}
+ <div class="alert alert-info lead top-air">
+ Toaster has no layer information. Without layer information, you cannot run builds. To generate layer information you can:
+ <ul>
+ <li>
+ <a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#layer-source">Configure a layer source</a>
+ </li>
+ <li>
+ <a href="{% url 'newproject' %}">Create a project</a>, then import layers
+ </li>
+ </ul>
+ </div>
+ {% endif %}
+
+ <ul class="list-unstyled lead">
+ <li>
+ <a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
+ Read the Toaster manual
+ </a>
+ </li>
+
+ <li>
+ <a href="https://wiki.yoctoproject.org/wiki/Contribute_to_Toaster">
+ Contribute to Toaster
+ </a>
+ </li>
+ </ul>
+ </div>
+
+ <div class="col-md-6">
+ <img alt="Yocto Project Toaster" class="img-thumbnail" src="{% static 'img/toaster_bw.png' %}"/>
+ </div>
+
+ </div>
+ </div>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html b/poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html
new file mode 100644
index 000000000..baa4b72c1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/landing_not_managed.html
@@ -0,0 +1,34 @@
+{% extends "base.html" %}
+
+{% load static %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Welcome to Toaster {% endblock %}
+
+{% block pagecontent %}
+
+ <div class="container">
+ <div class="row">
+ <!-- Empty - no build module -->
+ <div class="page-header top-air">
+ <h1>
+ This page only works with Toaster in 'Build' mode
+ </h1>
+ </div>
+ <div class="alert alert-info lead">
+ <p">
+ The 'Build' mode allows you to configure and run your Yocto Project builds from Toaster.
+ <ul>
+ <li><a href="http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#intro-modes">
+ Read about the 'Build' mode
+ </a></li>
+ <li><a href="/">
+ View your builds
+ </a></li>
+ </ul>
+ </p>
+ </div>
+ </div>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
new file mode 100644
index 000000000..1580991a1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/layer_btn.html
@@ -0,0 +1,26 @@
+<a class="btn btn-danger btn-block layer-exists-{{data.pk}} layerbtn" data-layer='{
+ "id": {{data.pk}},
+ "name": "{{data.layer.name}}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ "layerdetailurl": "{% url 'layerdetails' extra.pid data.pk %}"
+ }' data-directive="remove"
+ {% if data.pk not in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ <span class="glyphicon glyphicon-trash"></span>
+ Remove layer
+</a>
+<a class="btn btn-default btn-block layer-add-{{data.pk}} layerbtn"
+ data-layer='{ "id": {{data.pk}},
+ "name": "{{data.layer.name}}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.pk %}",
+ "layerdetailurl": "{%url "layerdetails" extra.pid data.pk %}"
+ }' data-directive="add"
+ {% if data.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+ >
+ <span class="glyphicon glyphicon-plus"></span>
+ Add layer
+</a>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html b/poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
new file mode 100644
index 000000000..e0069db80
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/layerdetails.html
@@ -0,0 +1,373 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block title %} {{layerversion.layer.name}} - {{project.name}} - Toaster {% endblock %}
+{% block pagecontent %}
+
+<div id="delete-layer-modal" class="modal fade" tabindex="-1" role="dialog"
+ data-keyboard="false" data-backdrop="static">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-body">
+ Are you sure you want to delete the <strong>{{layerversion.layer.name}}</strong> layer?
+ </div>
+ <div class="modal-footer">
+ <button type="button" id="layer-delete-confirmed" class="btn
+ btn-primary">Delete layer</button>
+ <button type="button" class="btn btn-default btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-md-12">
+ <ul class="breadcrumb">
+ <li>
+ <a href="{% url 'project' project.id %}">{{project.name}}</a>
+ <span class="divider">&rarr;</span>
+ </li>
+ <li><a href="{% url 'projectlayers' project.id %}">Compatible layers</a>
+ <span class="divider">&rarr;</span>
+ </li>
+ <li class="active">
+ {{layerversion.layer.name}} ({{layerversion.get_vcs_reference|truncatechars:13}})
+ </li>
+ </ul>
+
+ {# If this is not an imported layer then hide the edit ui #}
+ {% if layerversion.layer_source != layer_source.TYPE_IMPORTED %}
+ <style scoped>
+ .glyphicon-edit {
+ display:none;
+ }
+ .delete-current-value{
+ display: none;
+ }
+ li .glyphicon-trash {
+ display:none;
+ }
+ .add-deps {
+ display:none;
+ }
+ </style>
+ {% endif %}
+
+ <script src="{% static 'js/layerdetails.js' %}"></script>
+ <script>
+
+ $(document).ready(function(){
+ var ctx = {
+ xhrUpdateLayerUrl : "{% url 'xhr_layer' project.id layerversion.pk %}",
+ layerVersion : {
+ name : "{{layerversion.layer.name}}",
+ id : {{layerversion.id}},
+ commit: "{{layerversion.get_vcs_reference}}",
+ {%if layerversion.id in projectlayers %}
+ inCurrentPrj : true,
+ {% else %}
+ inCurrentPrj : false,
+ {% endif %}
+ layerdetailurl : "{% url 'layerdetails' project.id layerversion.id %}",
+ xhrLayerUrl: "{% url 'xhr_layer' project.id layerversion.id %}",
+ layer_source: {{layerversion.layer_source|json}},
+ },
+ layerSourceTypes: {{layer_source|json}},
+ };
+
+ try {
+ layerDetailsPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+ </script>
+
+ <div class="page-header">
+ {% if layerversion.layer.local_source_dir %}
+ <h1>{{layerversion.layer.name}} <small class="commit" style="display:none;"></small>
+ </h1>
+ {% else %}
+ <h1>{{layerversion.layer.name}} <small class="commit"
+ {% if layerversion.get_vcs_reference|length > 13 %}
+ data-toggle="tooltip" title="{{layerversion.get_vcs_reference}}"
+ {% endif %}>({{layerversion.get_vcs_reference|truncatechars:13}})</small>
+ </h1>
+ {% endif %}
+ </div>
+ <div class="row">
+ <!-- container for tabs -->
+ <div class="col-md-8 tabbable">
+ <div class="alert alert-info lead" id="alert-area" style="display:none">
+ <button type="button" class="close" id="dismiss-alert">&times;</button>
+ <span id="alert-msg"></span>
+ </div>
+
+ {% if layerversion.id not in projectlayers %}
+ <button id="add-remove-layer-btn" data-directive="add" class="btn btn-default btn-lg btn-block">
+ <span class="glyphicon glyphicon-plus"></span>
+ Add the {{layerversion.layer.name}} layer to your project
+ </button>
+ {% else %}
+ <button id="add-remove-layer-btn" data-directive="remove" class="btn btn-default btn-block btn-lg btn-danger">
+ <span class="glyphicon glyphicon-trash"></span>
+ Remove the {{layerversion.layer.name}} layer from your project
+ </button>
+ {% endif %}
+
+ <ul class="nav nav-tabs">
+ <li class="active">
+ <a data-toggle="tab" href="#information" id="details-tab">Layer details</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#recipes" class="text-muted" id="targets-tab">Recipes (<span class="table-count-recipestable"></span>)</a>
+ </li>
+ <li>
+ <a data-toggle="tab" href="#machines" class="text-muted" id="machines-tab">Machines (<span class="table-count-machinestable"></span>)</a>
+ </li>
+ </ul>
+ <div class="tab-content">
+
+ <!-- layer details pane -->
+ <div id="information" class="tab-pane active">
+ <h3>Layer source code location</h3>
+ {% if layerversion.layer.local_source_dir %}
+ <dl class="dl-horizontal" id="directory-info">
+ <dt>
+ Path to the layer directory
+ </dt>
+ <dd>
+ <code>{{layerversion.layer.local_source_dir}}</code>
+ </dd>
+ </dl>
+ {% else %}
+ <dl class="dl-horizontal" id="git-repo-info">
+ <dt class="">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository"></span>
+ Repository URL
+ </dt>
+ <dd>
+ <span class="current-value">{{layerversion.layer.vcs_url}}</span>
+ {% if layerversion.get_vcs_link_url %}
+ <a href="{{layerversion.get_vcs_link_url}}/" class="glyphicon glyphicon-new-window" target="_blank"></a>
+ {% endif %}
+ <form id="change-repo-form" class="form-inline" style="display:none">
+ <div class="form-group">
+ <input type="text" class="form-control" value="{{layerversion.layer.vcs_url}}">
+ </div>
+ </form>
+ </dd>
+ {% if layerversion.dirpath %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
+ Repository subdirectory
+ </dt>
+ <dd>
+ <span class="text-muted" style="display:none">Not set</span>
+ <span class="current-value">{{layerversion.dirpath}}</span>
+ {% if layerversion.get_vcs_dirpath_link_url %}
+ <a href="{{layerversion.get_vcs_dirpath_link_url}}" class="glyphicon glyphicon-new-window" target="_blank"></a>
+ {% endif %}
+ <form id="change-subdir-form" class="form-inline" style="display:none;">
+ <div class="form-group">
+ <input type="text" class="form-control" value="{{layerversion.dirpath}}">
+ </div>
+ </form>
+ </dd>
+ {% endif %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The Git branch, tag or commit"></span>
+ Git revision
+ </dt>
+ <dd>
+ <span class="current-value">{{layerversion.get_vcs_reference}}</span>
+ <form style="display:none;" class="form-inline">
+ <div class="form-group">
+ <input type="text" class="form-control" value="{{layerversion.get_vcs_reference}}">
+ </div>
+ </form>
+ </dd>
+ </dl>
+ {% endif %}
+ {% if layerversion.layer_source == layer_source.TYPE_IMPORTED %}
+ <button class="btn btn-default btn-lg" id="edit-layer-source" style="margin-left:220px;">Edit layer source code location</button>
+ {% endif %}
+ <form id="edit-layer-source-form" style="display:none;">
+ <fieldset>
+ <legend class="radioLegend">Where is the layer source code?</legend>
+ <div class="radio">
+ <label>
+ <input type="radio" name="source-location" id="repo" value="repo">
+ In a <strong>Git repository</strong>
+ </label>
+ <p class="help-block" style="margin-left:20px;width:70%;">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p>
+ </div>
+ <div class="radio" style="margin-top:15px;">
+ <label>
+ <input type="radio" name="source-location" id="dir" value="dir" checked>
+ In a <strong>directory</strong>
+ </label>
+ <p class="help-block" style="margin-left:20px;width:70%;">Use this option for quick layer development, by simply providing the path to the layer source code.</p>
+ </div>
+ </fieldset>
+
+ <fieldset id="layer-git">
+ <legend>Git repository information</legend>
+ <div class="form-group">
+ <label for="layer-git-repo-url">
+ Git repository URL
+ <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
+ </label>
+ <input type="text" id="layer-git-repo-url" class="form-control" value="{{layerversion.layer.vcs_url|default_if_none:''}}">
+ </div>
+ <div class="form-group">
+ <label for="layer-subdir">
+ Repository subdirectory
+ <span class="text-muted">(optional)</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
+ </label>
+ <input type="text" class="form-control" id="layer-subdir" value="{{layerversion.dirpath|default_if_none:''}}">
+ </div>
+ <div class="form-group" id="layer-revision-ctrl">
+ <label for="layer-git-ref">Git revision
+ <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
+ </label>
+ <input type="text" class="form-control" id="layer-git-ref" value="{{layerversion.get_vcs_reference|default_if_none:''}}">
+ <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span>
+ </div>
+ </fieldset>
+
+ <fieldset id="layer-dir">
+ <legend>Layer directory information</legend>
+ <div class="form-group">
+ <label for="layer-dir-path">
+ Enter the absolute path to the layer directory
+ </label>
+ <input type="text" id="layer-dir-path-in-details" class="form-control" value="{{layerversion.layer.local_source_dir}}" required>
+ </div>
+ </fieldset>
+
+ <div style="margin-top:25px;">
+ <a href="#" class="btn btn-primary btn-lg" id="save-changes-for-switch">Save changes</a>
+ <a href="#" class="btn btn-link btn-lg" id="cancel-changes-for-switch">Cancel</a>
+ </div>
+ </form>
+
+ <h3 class="top-air">Layer dependencies
+ <span class="glyphicon glyphicon-question-sign get-help" title="Other layers this layer depends upon"></span>
+ </h3>
+
+ <ul class="list-unstyled current-value lead" id="layer-deps-list">
+ {% for ld in layerversion.dependencies.all %}
+ <li data-layer-id="{{ld.depends_on.id}}">
+ <a data-toggle="tooltip" title="{{ld.depends_on.layer.vcs_url}} | {{ld.depends_on.get_vcs_reference}}" href="{% url 'layerdetails' project.id ld.depends_on.id %}">{{ld.depends_on.layer.name}}</a>
+ <span class="glyphicon glyphicon-trash " data-toggle="tooltip" title="Delete"></span>
+ </li>
+ {% endfor %}
+ </ul>
+ <form class="form-inline add-deps">
+ <div class="form-group">
+ <input class="form-control" type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" placeholder="Type a layer name" id="layer-dep-input">
+ </div>
+ <a class="btn btn-default" id="add-layer-dependency-btn" disabled="disabled">
+ Add layer
+ </a>
+ <span class="help-block add-deps">You can only add layers Toaster knows about</span>
+ </form>
+ </div>
+ <!-- end layerdetails tab -->
+ <!-- targets tab -->
+ <div id="recipes" class="tab-pane">
+ <!-- Recipe table -->
+ <div id="no-recipes-yet" class="alert alert-info" style="display:none">
+ <p>Toaster does not have recipe information for the <strong> {{layerversion.layer.name}} </strong> layer.</p>
+ <p>Toaster learns about layers when you build them. If this layer provides any recipes, they will be listed here after you build the <strong> {{layerversion.layer.name}} </strong> layer.</p>
+ </div>
+ {% url 'layerrecipestable' project.id layerversion.id as xhr_table_url %}
+ {% with "recipestable" as table_name %}
+ {% with "Recipes" as title %}
+ {% include 'toastertable-simple.html' %}
+ {% endwith %}
+ {% endwith %}
+ </div>
+
+ <div id="machines" class="tab-pane">
+
+ <div id="no-machines-yet" class="alert alert-info" style="display:none">
+ <p>Toaster does not have machine information for the <strong> {{layerversion.layer.name}} </strong> layer.</p>
+ <p>Sadly, machine information cannot be obtained from builds, so this page will remain empty.</p>
+ </div>
+
+
+ <!-- Machines table -->
+ {% url 'layermachinestable' project.id layerversion.id as xhr_table_url %}
+ {% with "machinestable" as table_name %}
+ {% with "Machines" as title %}
+ {% include 'toastertable-simple.html' %}
+ {% endwith %}
+ {% endwith %}
+ </div>
+ </div> <!-- end tab content -->
+ </div> <!-- end tabable -->
+
+ <div class="col-md-4"> <!-- info side panel -->
+ <div class="well">
+ <h2>About {{layerversion.layer.name}}</h2>
+ <dl class="item-info">
+
+ <dt>
+ Summary
+ <span class="glyphicon glyphicon-question-sign get-help" title="One-line description of the layer"></span>
+ </dt>
+ <dd>
+ <span class="text-muted" style="display:none">Not set</span>
+ <span class="current-value">{{layerversion.layer.summary|default_if_none:''}}</span>
+ <form style="display:none; margin-bottom:20px; margin-top:5px;">
+ <div class="form-group">
+ <textarea class="form-control" rows="2">{% if layerversion.layer.summary %}{{layerversion.layer.summary}}{% endif %}</textarea>
+ </div>
+ <button class="btn btn-default change-btn" data-layer-prop="summary" type="button">Save</button>
+ <a href="#" class="btn btn-link cancel">Cancel</a>
+ </form>
+ <span class="glyphicon glyphicon-edit"></span>
+ <span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
+ </dd>
+ <dt>
+ Description
+ </dt>
+ <dd>
+ <span class="text-muted" style="display:none">Not set</span>
+ <span class="current-value">{{layerversion.layer.description|default_if_none:''}}</span>
+ <form style="display:none; margin-bottom:20px; margin-top:5px;">
+ <div class="form-group">
+ <textarea class="form-control" rows="6">{% if layerversion.layer.description %}{{layerversion.layer.description}}{% endif %}</textarea>
+ </div>
+ <button class="btn btn-default change-btn" data-layer-prop="description" type="button" >Save</button>
+ <a href="#" class="btn btn-link cancel">Cancel</a>
+ </form>
+ <span class="glyphicon glyphicon-edit"></span>
+ <span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
+ </dd>
+ {% if layerversion.layer_source == layer_source.TYPE_LAYERINDEX %}
+ <dt>Layer index</dt>
+ <dd>
+ <a href="http://layers.openembedded.org/layerindex/branch/{{layerversion.release.name}}/layer/{{layerversion.layer.name}}">Layer index {{layerversion.layer.name}}</a>
+ </dd>
+ {% endif %}
+ </dl>
+ {# Only show delete link for imported layers #}
+ {% if layerversion.layer_source == layer_source.TYPE_IMPORTED %}
+ <i class="icon-trash text-danger"></i>
+ <a href="#delete-layer-modal" role="button" class="text-danger"
+ data-toggle="modal" data-target="#delete-layer-modal">Delete layer</a>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div> <!-- close column 12 div -->
+</div> <!-- close top row div -->
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
new file mode 100644
index 000000000..6debe6573
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/machine_btn.html
@@ -0,0 +1,21 @@
+<a href="{% url 'project' extra.pid %}?setMachine={{data.name}}" class="btn btn-default btn-block layer-exists-{{data.layer_version.id}}"
+ {% if data.layer_version.pk not in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ Select machine</a>
+<a class="btn btn-default btn-block layerbtn
+layer-add-{{data.layer_version.id}}" data-layer='{ "id":
+ {{data.layer_version.id}}, "name": "{{data.layer_version.layer.name}}",
+ "layerdetailurl": "{%url 'layerdetails' extra.pid data.layer_version.id %}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.layer_version.id %}"
+ }' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ <span class="glyphicon glyphicon-plus"></span>
+ Add layer
+ <span class="glyphicon glyphicon-question-sign get-help" title="To select this machine, you must first add the {{data.layer_version.layer.name}} layer to your project"></i>
+</a>
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html
new file mode 100644
index 000000000..c5b9fe90d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/mrb_section.html
@@ -0,0 +1,301 @@
+{% load static %}
+{% load humanize %}
+{% load project_url_tag %}
+<script src="{% static 'js/mrbsection.js' %}"></script>
+
+{% if mru %}
+ {% if mrb_type == 'project' %}
+ <h2>
+ Latest project builds
+
+ {% if project.is_default %}
+ <span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
+ {% endif %}
+ </h2>
+ {% else %}
+ <div class="page-header">
+ <h1>Latest builds</h1>
+ </div>
+ {% endif %}
+
+ <div id="latest-builds">
+ {% for build in mru %}
+ <div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
+ <!-- project title -->
+ {% if mrb_type != 'project' %}
+ <div class="row project-name">
+ <div class="col-md-12">
+ <small>
+ <a class="alert-link text-uppercase" href="{% project_url build.project %}">
+ {{build.project.name}}
+ </a>
+ </small>
+ </div>
+ </div>
+ {% endif %}
+
+ <div class="row" data-role="build-status-container">
+ <div class="col-md-12">
+ Loading...
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+{% endif %}
+
+<!-- build main template -->
+<script id="build-template" type="text/x-jsrender">
+ <div class="col-md-3">
+ <!-- only show link for completed builds -->
+ <%if state == 'Succeeded' || state == 'Failed'%>
+ <a class="alert-link" href="<%:dashboard_url%>">
+ <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
+ <%:targets_abbreviated%>
+ </span>
+ </a>
+ <%else targets_abbreviated !== ''%>
+ <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
+ <%:targets_abbreviated%>
+ </span>
+ <%else%>
+ Fetching recipe names...
+ <%/if%>
+ </div>
+
+ <div data-build-state="<%:state%>">
+ <%if state == 'Cloning'%>
+ <%include tmpl='#cloning-repos-build-template'/%>
+ <%else state == 'Parsing'%>
+ <%include tmpl='#parsing-recipes-build-template'/%>
+ <%else state == 'Queued'%>
+ <%include tmpl='#queued-build-template'/%>
+ <%else state == 'Succeeded' || state == 'Failed'%>
+ <%include tmpl='#succeeded-or-failed-build-template'/%>
+ <%else state == 'Cancelling'%>
+ <%include tmpl='#cancelling-build-template'/%>
+ <%else state == 'Starting'%>
+ <%include tmpl='#starting-template'/%>
+ <%else state == 'In Progress'%>
+ <%include tmpl='#in-progress-build-template'/%>
+ <%else state == 'Cancelled'%>
+ <%include tmpl='#cancelled-build-template'/%>
+ <%/if%>
+ </div>
+</script>
+
+<!-- queued build -->
+<script id="queued-build-template" type="text/x-jsrender">
+ <div class="col-md-5">
+ <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
+ title="This build is waiting for the build directory to become available">
+ </span>
+
+ Build queued
+ </div>
+
+ <div class="col-md-4">
+ <!-- cancel button -->
+ <%include tmpl='#cancel-template'/%>
+ </div>
+</script>
+
+<!-- cloning repos build -->
+<script id="cloning-repos-build-template" type="text/x-jsrender">
+ <!-- progress bar and parse completion percentage -->
+ <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
+ <!-- progress bar -->
+ <div class="progress">
+ <div id="repos-cloned-percentage-bar-<%:id%>"
+ style="width: <%:repos_cloned_percentage%>%;"
+ class="progress-bar">
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4 progress-info">
+ <!-- parse completion percentage -->
+ <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
+ title="Toaster is cloning the repos required for your build">
+ </span>
+
+ Cloning <span id="repos-cloned-percentage-<%:id%>"><%:repos_cloned_percentage%></span>% complete
+
+ <%include tmpl='#cancel-template'/%>
+ </div>
+</script>
+
+<!-- parsing recipes build -->
+<script id="parsing-recipes-build-template" type="text/x-jsrender">
+ <!-- progress bar and parse completion percentage -->
+ <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
+ <!-- progress bar -->
+ <div class="progress">
+ <div id="recipes-parsed-percentage-bar-<%:id%>"
+ style="width: <%:recipes_parsed_percentage%>%;"
+ class="progress-bar">
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4 progress-info">
+ <!-- parse completion percentage -->
+ <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
+ title="BitBake is parsing the layers required for your build">
+ </span>
+
+ Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete
+
+ <%include tmpl='#cancel-template'/%>
+ </div>
+</script>
+
+<!-- in progress build; tasks still starting -->
+<script id="starting-template" type="text/x-jsrender">
+ <div class="col-md-5">
+ <span class="glyphicon glyphicon-question-sign get-help get-help-blue"
+ title="This build is waiting for tasks to start">
+ </span>
+
+ Tasks starting...
+ </div>
+
+ <div class="col-md-4">
+ <!-- cancel button -->
+ <%include tmpl='#cancel-template'/%>
+ </div>
+</script>
+
+<!-- in progress build; at least one task finished -->
+<script id="in-progress-build-template" type="text/x-jsrender">
+ <!-- progress bar and task completion percentage -->
+ <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
+ <!-- progress bar -->
+ <div class="progress" id="build-pc-done-title-<%:id%>">
+ <div id="build-pc-done-bar-<%:id%>"
+ style="width: <%:tasks_complete_percentage%>%;"
+ class="progress-bar">
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4 progress-info">
+ <!-- task completion percentage -->
+ <span id="build-pc-done-<%:id%>"><%:tasks_complete_percentage%></span>% of
+ tasks complete
+
+ <!-- cancel button -->
+ <%include tmpl='#cancel-template'/%>
+ </div>
+</script>
+
+<!-- cancelling build -->
+<script id="cancelling-build-template" type="text/x-jsrender">
+ <div class="col-md-9">
+ Cancelling the build ...
+ </div>
+</script>
+
+<!-- succeeded or failed build -->
+<script id="succeeded-or-failed-build-template" type="text/x-jsrender">
+ <!-- completed_on -->
+ <div class="col-md-2">
+ <%:completed_on%>
+ </div>
+
+ <!-- errors -->
+ <div class="col-md-2">
+ <%if errors%>
+ <span class="glyphicon glyphicon-minus-sign"></span>
+ <a href="<%:dashboard_errors_url%>" class="alert-link">
+ <%:errors%> error<%:errors_pluralise%>
+ </a>
+ <%/if%>
+ </div>
+
+ <!-- warnings -->
+ <div class="col-md-2">
+ <%if warnings%>
+ <span class="glyphicon glyphicon-warning-sign build-warnings"></span>
+ <a href="<%:dashboard_warnings_url%>" class="alert-link build-warnings">
+ <%:warnings%> warning<%:warnings_pluralise%>
+ </a>
+ <%/if%>
+ </div>
+
+ <!-- build time -->
+ <div class="col-md-3">
+ Build time:
+
+ <span data-role="data-recent-build-buildtime-field">
+ <%if state == 'Succeeded'%>
+ <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
+ <%else%>
+ <%:buildtime%>
+ <%/if%>
+ </span>
+
+ <!-- rebuild button -->
+ <%include tmpl='#rebuild-template'/%>
+ </div>
+</script>
+
+<!-- cancelled build -->
+<script id="cancelled-build-template" type="text/x-jsrender">
+ <!-- build cancelled message -->
+ <div class="col-md-6">
+ Build cancelled
+ </div>
+
+ <!-- rebuild button -->
+ <div class="col-md-3">
+ <%include tmpl='#rebuild-template'/%>
+ </div>
+</script>
+
+<!-- rebuild button or no rebuild icon -->
+<script id="rebuild-template" type="text/x-jsrender">
+ <%if is_default_project_build%>
+ <!-- no rebuild info icon -->
+ <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 'Succeeded'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
+ title="Builds in this project cannot be started from Toaster: they are started from the command line">
+ </span>
+ <%else%>
+ <!-- rebuild button -->
+ <span class="rebuild-btn alert-link <%if state == 'Success'%>success<%else state == 'Failed'%>danger<%else%>info<%/if%> pull-right"
+ data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
+ <span class="glyphicon glyphicon-repeat"></span>
+ Rebuild
+ </span>
+ <%/if%>
+</script>
+
+<!-- cancel button or no cancel icon -->
+<script id="cancel-template" type="text/x-jsrender">
+ <%if is_default_project_build%>
+ <!-- no cancel icon -->
+ <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
+ <%else%>
+ <!-- cancel button -->
+ <span class="cancel-build-btn pull-right alert-link"
+ data-buildrequest-id="<%:buildrequest_id%>" data-request-url="<%:cancel_url%>">
+ <span class="glyphicon glyphicon-remove-circle"></span>
+ Cancel
+ </span>
+ <%/if%>
+</script>
+
+<script>
+ $(document).ready(function () {
+ var ctx = {
+ mrbType : "{{mrb_type}}",
+ }
+
+ try {
+ mrbSectionInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html b/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
new file mode 100644
index 000000000..980179a40
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage.html
@@ -0,0 +1,21 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+{% include "newcustomimage_modal.html" %}
+
+<div class="row">
+
+ {% include "projecttopbar.html" %}
+
+ <div class="col-md-12">
+ {% url table_name project.id as xhr_table_url %}
+ <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>)</h2>
+ {% include "toastertable.html" %}
+ </div>
+
+</div>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html b/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
new file mode 100644
index 000000000..d448d3afc
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/newcustomimage_modal.html
@@ -0,0 +1,60 @@
+{% load static %}
+
+<script src="{% static 'js/newcustomimage_modal.js' %}"></script>
+<script>
+ $(document).ready(function (){
+ try {
+ newCustomImageModalInit();
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<div class="modal fade" id="new-custom-image-modal" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <h3>New custom image</h3>
+ </div>
+
+ <div class="modal-body">
+ <!--
+ this container is visible if there are multiple image recipes which could
+ be used as a basis for the new custom image; radio buttons are added to it
+ via newCustomImageModalSetRecipes() as required
+ -->
+ <div data-role="image-selector" style="display:none;">
+ <h4>Which image do you want to customise?</h4>
+ <span class="help-block text-danger" id="invalid-recipe-help" style="display:none"></span>
+ <div data-role="image-selector-radios"></div>
+ <div class="air"></div>
+ </div>
+
+ <h4>Name your custom image</h4>
+
+ <div class="row">
+ <div class="col-md-10">
+ <p class="help-block">Image names must be unique. They should not contain spaces or capital letters, and the only allowed special character is dash (-).
+ </p>
+ <div class="form-group">
+ <input type="text" class="form-control input-lg" placeholder="Type the custom image name" required>
+ </div>
+ <span class="help-block text-danger" id="invalid-name-help" style="display:none"></span>
+ </div>
+ </div>
+ </div>
+
+ <div class="modal-footer">
+ <button id="create-new-custom-image-btn" class="btn btn-primary btn-large" disabled>
+ <span data-role="submit-state">Create custom image</span>
+ <span data-role="loading-state" style="display:none">
+ <i class="fa-pulse icon-spinner"></i>&nbsp;Creating custom image...
+ </span>
+ </button>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/newproject.html b/poky/bitbake/lib/toaster/toastergui/templates/newproject.html
new file mode 100644
index 000000000..acb614e9d
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/newproject.html
@@ -0,0 +1,138 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Create a new project - Toaster {% endblock %}
+
+{% block pagecontent %}
+<div class="row">
+ <div class="col-md-12">
+ <div class="page-header">
+ <h1>Create a new project</h1>
+ </div>
+ {% if alert %}
+ <div class="alert alert-danger" role="alert">{{alert}}</div>
+ {% endif %}
+
+ <form method="POST">{% csrf_token %}
+ <div class="form-group" id="validate-project-name">
+ <label class="control-label">Project name <span class="text-muted">(required)</span></label>
+ <input type="text" class="form-control" required id="new-project-name" name="projectname">
+ </div>
+ <p class="help-block text-danger" style="display: none;" id="hint-error-project-name">A project with this name exists. Project names must be unique.</p>
+<!--
+ <fieldset>
+ <label class="project-form">Project type</label>
+ <label class="project-form radio"><input type="radio" name="ptype" value="analysis" checked/> Analysis Project</label>
+
+ {% if releases.count > 0 %}
+ <label class="project-form radio"><input type="radio" name="ptype" value="build" checked /> Build Project</label>
+ {% endif %}
+ </fieldset> -->
+ <input type="hidden" name="ptype" value="build" />
+
+ {% if releases.count > 0 %}
+ <div class="release form-group">
+ {% if releases.count > 1 %}
+ <label class="control-label">
+ Release
+ <span class="glyphicon glyphicon-question-sign get-help" title="The version of the build system you want to use"></span>
+ </label>
+ <select name="projectversion" id="projectversion" class="form-control">
+ {% for release in releases %}
+ <option value="{{release.id}}"
+ {%if defaultbranch == release.name %}
+ selected
+ {%endif%}
+ >{{release.description}}</option>
+ {% endfor %}
+ </select>
+ <div class="row">
+ <div class="col-md-4">
+ {% for release in releases %}
+ <div class="helptext" id="description-{{release.id}}" style="display: none">
+ <span class="help-block">{{release.helptext|safe}}</span>
+ </div>
+ {% endfor %}
+ {% else %}
+ <input type="hidden" name="projectversion" value="{{releases.0.id}}"/>
+ {% endif %}
+ </div>
+ </div>
+ </fieldset>
+ {% endif %}
+ <div class="top-air">
+ <input type="submit" id="create-project-button" class="btn btn-primary btn-lg" value="Create project"/>
+ <span class="help-inline" style="vertical-align:middle;">To create a project, you need to enter a project name</span>
+ </div>
+
+ </form>
+ <!--
+ <div class="col-md-5 well">
+ <span class="help-block">
+ <h4>Toaster project types</h4>
+ <p>With a <strong>build project</strong> you configure and run your builds from Toaster.</p>
+ <p>With an <strong>analysis project</strong>, the builds are configured and run by another tool
+ (something like Buildbot or Jenkins), and the project only collects the information about the
+ builds (packages, recipes, dependencies, logs, etc). </p>
+ <p>You can read more on <a href="#">how to set up an analysis project</a>
+ in the Toaster manual.</p>
+ <h4>Release</h4>
+ <p>If you create a <strong>build project</strong>, you will need to select a <strong>release</strong>,
+ which is the version of the build system you want to use to run your builds.</p>
+ </div> -->
+ </div>
+ </div>
+
+ <script type="text/javascript">
+ $(document).ready(function () {
+ // hide the new project button
+ $("#new-project-button").hide();
+ $('.btn-primary').attr('disabled', 'disabled');
+
+ // enable submit button when all required fields are populated
+ $("input#new-project-name").on('input', function() {
+ if ($("input#new-project-name").val().length > 0 ){
+ $('.btn-primary').removeAttr('disabled');
+ $(".help-inline").css('visibility','hidden');
+ }
+ else {
+ $('.btn-primary').attr('disabled', 'disabled');
+ $(".help-inline").css('visibility','visible');
+ }
+ });
+
+ // show relevant help text for the selected release
+ var selected_release = $('select').val();
+ $("#description-" + selected_release).show();
+
+
+ $('select').change(function(){
+ var new_release = $('select').val();
+ $(".helptext").hide();
+ $('#description-' + new_release).fadeIn();
+ });
+
+ libtoaster.makeProjectNameValidation($("#new-project-name"),
+ $("#hint-error-project-name"), $("#validate-project-name"),
+ $(".btn-primary"));
+
+
+/* // Hide the project release when you select an analysis project
+ function projectType() {
+ if ($("input[type='radio']:checked").val() == 'build') {
+ $('.release').fadeIn();
+ }
+ else {
+ $('.release').fadeOut();
+ }
+ }
+ projectType();
+
+ $('input:radio').change(function(){
+ projectType();
+ }); */
+ });
+ </script>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html b/poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html
new file mode 100644
index 000000000..a5d589357
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html
@@ -0,0 +1,99 @@
+{% extends "package_detail_base.html" %}
+{% load projecttags %}
+
+{% block tabcontent %}
+ <ul class="nav nav-tabs">
+ <li class="">
+ <a href="{% url 'package_built_detail' build.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Shows the files produced by this package."></span>
+ Generated files ({{package.buildfilelist_package.count}})
+ </a>
+ </li>
+ <li class="active">
+ <a href="{% url 'package_built_dependencies' build.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Shows the runtime packages required by this package."></span>
+ Runtime dependencies ({{dependency_count}})
+ </a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="dependencies">
+ {% ifequal runtime_deps|length 0 %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> has no runtime dependencies.
+ </div>
+ {% else %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> is <strong>not included</strong> in any image. This page shows you the projected runtime dependencies if you were to include <strong>{{package.fullpackagespec}}</strong> in an image.
+ </div>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Package</th>
+ <th>Version</th>
+ <th class="sizecol col-md-2">Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for runtime_dep in runtime_deps %}
+ <tr {{runtime_dep.size|format_vpackage_rowclass}} >
+ {% if runtime_dep.size != -1 %}
+ <td>
+ <a href="{% url 'package_built_detail' build.id runtime_dep.depends_on_id %}">
+ {{runtime_dep.name}}
+ </a>
+ </td>
+ {% else %}
+ <td>
+ {{runtime_dep.name|format_vpackage_namehelp}}
+ </td>
+ {% endif %}
+ <td>{{runtime_dep.version}}</td>
+ <td class="sizecol">{{runtime_dep.size|filtered_filesizeformat}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifequal %}
+ {% ifnotequal other_deps|length 0 %}
+ <h3>Other runtime relationships</h3>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Package</th>
+ <th>Version</th>
+ <th class="sizecol col-md-2">Size</th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></span>
+ Relationship type
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for other_dep in other_deps %}
+ <tr {{other_dep.size|format_vpackage_rowclass}} >
+ {% if other_dep.size != -1 %}
+ <td>
+ <a href="{% url 'package_built_detail' build.id other_dep.depends_on_id %}">
+ {{other_dep.name}}
+ </a>
+ </td>
+ {% else %}
+ <td>
+ {{other_dep.name|format_vpackage_namehelp}}
+ </td>
+ {% endif %}
+ <td>{{other_dep.version}}</td>
+ <td class="sizecol">{{other_dep.size|filtered_filesizeformat}}</td>
+ <td>
+ {{other_dep.dep_type_display}}
+ <span class="glyphicon glyphicon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></span>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifnotequal %}
+ </div> <!-- tab-pane -->
+ </div> <!-- tab-content -->
+{% endblock tabcontent %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html b/poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html
new file mode 100644
index 000000000..0bdbc2a41
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_built_detail.html
@@ -0,0 +1,65 @@
+{% extends "package_detail_base.html" %}
+{% load projecttags %}
+
+{% block tabcontent %}
+ {% with packageFileCount=package.buildfilelist_package.count %}
+ <!-- Generated Files -->
+ {% if package.buildtargetlist_package.count == 0 %}
+ {# Not included case #}
+ <ul class="nav nav-tabs">
+ <li class="active"> <a href="#">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Files added to a root file system when you include {{package.name}} in an image"></span>
+ Generated files ({{packageFileCount}})
+ </a></li>
+ <li class=""><a href="{% url 'package_built_dependencies' build.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Projected runtime dependencies when you include {{package.name}} in an image"></span>
+ Runtime dependencies ({{dependency_count}})
+ </a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="files">
+ <!-- Package file list or if empty, alert pane -->
+ {% if packageFileCount > 0 %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> is <strong>not included</strong> in any image. This page shows you the files that would be added to an image root file system with <strong>{{package.fullpackagespec}}</strong> included in it.
+ </div>
+ {% include "tablesort.html" %}
+ <tbody>
+ {% for file in objects %}
+ <tr>
+ <td class="path">{{file.path}}</td>
+ <td class="filesize sizecol">{{file.size|filtered_filesizeformat}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ {% else %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> does not generate any files.
+ </div>
+ {% endif %}
+
+ </div> <!-- tab-pane active -->
+ </div> <!-- tab-content -->
+ {% else %}
+ {# Included case #}
+ <div class="tab-content">
+ <div class="tab-pane active">
+ <div class="lead well">
+ Package included in:
+ {% for itarget in package.buildtargetlist_package.all|dictsort:"target.target" %}
+ <a href="{% url 'package_included_detail' build.id itarget.target.id package.id %}">
+ {% if forloop.counter0 > 0 %}
+ ,&nbsp;
+ {% endif %}
+ {{itarget.target.target}}
+ </a>
+ {% endfor %}
+ </div>
+ </div> <!-- tab-pane active -->
+ </div> <!-- tab-content -->
+ {% endif %}
+
+ {% endwith %}
+{% endblock tabcontent %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html b/poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html
new file mode 100644
index 000000000..66f8e7f06
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_detail_base.html
@@ -0,0 +1,169 @@
+{% extends "basebuilddetailpage.html" %}
+{% load projecttags %}
+
+{% block title %}
+ {% if target %}
+ {{package.fullpackagespec}} - {{ target.target }} {{ build.machine }} - {{ build.project.name }} - Toaster
+ {% else %}
+ {{package.fullpackagespec}} - {{ build.target_set.all|dictsort:"target"|join:", " }} {{ build.machine }} - {{ build.project.name }} - Toaster
+ {% endif %}
+{% endblock %}
+{% block extraheadcontent %}
+ <!-- functions to format package 'installed_package' alias -->
+ <script>
+ function fmtAliasHelp(package_name, alias, hover) {
+ var r = null;
+ if (alias != null && alias != '') {
+ r = '<span class="text-muted"> as ' + alias + '&nbsp';
+ r += '<span class="glyphicon glyphicon-question-sign get-help';
+ if (hover) {
+ r+= ' hover-help';
+ }
+ else {
+ r+= ' heading-help';
+ }
+ r += '"';
+ title = '<code>' + package_name + '</code> was renamed at packaging time and was installed on your system as <code>' + alias + '</code>';
+ r += ' title="' + title + '">';
+ r += '</span>';
+ r += '</span>';
+ document.write(r);
+ }
+ }
+ </script>
+{% endblock extraheadcontent %}
+{% block localbreadcrumb %}
+ {% if target %}
+ <li><a href="{% url "target" build.id target.id %}">{{target.target}}</a></li>
+ <li>{{package.fullpackagespec}} {% if package.alias %} as {{package.alias}}{% endif %}</li>
+ {% else %}
+ <li><a href="{% url "packages" build.id %}"> Packages </a></li>
+ <li>{{package.fullpackagespec}}</li>
+ {% endif %}
+{% endblock localbreadcrumb %}
+
+{% block pagedetailinfomain %}
+ <div class="row">
+ <div class="col-md-12">
+ <div class="page-header build-data">
+ {% block mainheading %}
+ <h1>{{package.fullpackagespec}}</h1>
+ {% endblock %}
+ </div> <!-- page-header -->
+ </div> <!-- col-md-12 page-header -->
+ </div> <!-- end row -->
+
+ {% block twocolumns %}
+ <div class="row">
+ <div class="col-md-8 tabbable">
+ {% block tabcontent %}
+ {% endblock tabcontent %}
+ </div> <!-- row col-md-8 -->
+
+ <div class="col-md-4">
+ <div class="well">
+ <h2>Package information</h2>
+
+ <!-- info presented as definition list -->
+ <dl class="item-info">
+ <dt>
+ Size
+ <span class="glyphicon glyphicon-question-sign get-help" title="The size of the package"></span>
+ </dt>
+ <dd>
+ {% comment %}
+ if recipe is absent, filesize is not 0
+ {% endcomment %}
+ {% if package.recipe_id > 0 %}
+ {{package.size|filtered_filesizeformat}}
+ {% if target.file_size %}
+ ({{package.size|multiply:100|divide:target.file_size}}% of included package size)
+ {% endif %}
+
+ {% endif %}
+ </dd>
+
+ <dt>
+ License
+ <span class="glyphicon glyphicon-question-sign get-help" title="The license under which this package is distributed"></span>
+ </dt>
+ <dd>{{package.license}}</dd>
+
+ {% comment %}
+ # Removed per review on 1/18/2014 until license data population
+ # problemse are resolved.
+ <dt>
+ License files
+ <i class="icon-question-sign get-help" title="Path to the license files that apply to the package"></i>
+ </dt>
+ <dd></dd>
+ {% endcomment %}
+
+ <dt>
+ Recipe
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name of the recipe building this package"></span>
+ </dt>
+ <dd>
+ {% if package.recipe_id > 0 %}
+ <a href="{% url "recipe" build.id package.recipe_id %}"> {{package.recipe.name}} </a>
+ {% else %}
+ {{package.recipe.name}}
+ {% endif %}
+ </dd>
+
+ <dt>
+ Recipe version
+ <span class="glyphicon glyphicon-question-sign get-help" title="The version of the recipe building this package"></span>
+ </dt>
+ <dd>{{package.recipe.version}}</dd>
+
+ <dt>
+ Layer
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name of the layer providing the recipe that builds this package"></span>
+ </dt>
+ <dd>
+ {{package.recipe.layer_version.layer.name}}
+ {% if package.recipe.layer_version.layer.name|format_none_and_zero != "" %}
+ {% comment %}
+ # Removed per team meeting of 1/29/2014 until
+ # decision on index search algorithm
+ <a href="http://layers.openembedded.org" target="_blank">
+ <i class="glyphicon glyphicon-share get-info"></i>
+ </a>
+ {% endcomment %}
+ {% endif %}
+ </dd>
+ <dt>
+ Layer branch
+ <span class="glyphicon glyphicon-question-sign get-help" title="The Git branch of the layer providing the recipe that builds this package"></span>
+ {%if package.recipe.layer_version.layer.local_source_dir %}
+ <dd>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The source code of {{package.recipe.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"></span>
+ </dd>
+ {% endif %}
+ </dt>
+ {% if not package.recipe.layer_version.layer.local_source_dir %}
+ <dd>{{package.recipe.layer_version.branch}}</dd>
+ {% endif %}
+ <dt>
+ Layer commit
+ <span class="glyphicon glyphicon-question-sign get-help" title="The Git commit of the layer providing the recipe that builds this package"></span>
+ {%if package.recipe.layer_version.layer.local_source_dir %}
+ <dd>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The source code of {{package.recipe.layer_version.layer.name}} is not in a Git repository, so there is no commit associated with it"></span>
+ </dd>
+ {% endif %}
+ </dt>
+
+ {% if not package.recipe.layer_version.layer.local_source_dir %}
+ <dd class="iscommit">{{package.recipe.layer_version.commit}}</dd>
+ {% endif %}
+
+ </dl>
+ <div> <!-- end well -->
+ </div> <!-- end 4-column section -->
+ {% endblock twocolumns %}
+ </div> <!-- end row -->
+{% endblock pagedetailinfomain %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html b/poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html
new file mode 100644
index 000000000..95e56ded2
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html
@@ -0,0 +1,110 @@
+{% extends "package_detail_base.html" %}
+{% load projecttags %}
+
+{% block mainheading %}
+ <h1>
+ {{package.fullpackagespec}}
+ <script> fmtAliasHelp("{{package.name}}", "{{package.alias}}", false) </script>
+ <small>({{target.target}})</small>
+ </h1>
+{% endblock %}
+
+{% block tabcontent %}
+ {% with packageFileCount=package.buildfilelist_package.count %}
+ {% include "package_included_tabs.html" with active_tab="dependencies" %}
+ <div class="tab-content">
+ <div class="tab-pane active" id="dependencies">
+ {% ifnotequal runtime_deps|length 0 %}
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Package</th>
+ <th>Version</th>
+ <th class='sizecol col-md-2'>Size</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for runtime_dep in runtime_deps %}
+ <tr {{runtime_dep.size|format_vpackage_rowclass}} >
+ {% if runtime_dep.size != -1 %}
+ <td>
+ <a href="{% url 'package_included_detail' build.id target.id runtime_dep.depends_on_id %}">
+ {{runtime_dep.name}}
+ </a>
+ <script>fmtAliasHelp("{{runtime_dep.name}}", "{{runtime_dep.alias}}", true)</script>
+ </td>
+ {% else %}
+ <td>
+ {{runtime_dep.name|format_vpackage_namehelp}}
+ </td>
+ {% endif %}
+ <td>{{runtime_dep.version}}&nbsp;</td>
+ <td class='sizecol'>{{runtime_dep.size|filtered_filesizeformat}}&nbsp;</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> has no runtime dependencies.
+ </div>
+ {% endifnotequal %}
+
+ {% ifnotequal other_deps|length 0 %}
+ <h3>Other runtime relationships</h3>
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>Package</th>
+ <th>Version</th>
+ <th class='sizecol col-md-2'>Size</th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Five relationship types exist: recommends, suggests, provides, replaces and conflicts"></span>
+ Relationship type
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for other_dep in other_deps %}
+ {% if other_dep.installed %}
+ <tr {{other_dep.size|format_vpackage_rowclass}}>
+ {% if other_dep.size != -1 %}
+ <td>
+ <a href="{% url 'package_included_detail' build.id target.id other_dep.depends_on_id %}">
+ {{other_dep.name}}
+ <script>
+ fmtAliasHelp("{{other_dep.name}}","{{other_dep.alias}}", true)
+ </script>
+ </a>
+ </td>
+ {% else %}
+ <td>
+ {{other_dep.name|format_vpackage_namehelp}}
+ </td>
+ {% endif %}
+ <td>{{other_dep.version}}&nbsp;</td>
+ <td class='sizecol'>{{other_dep.size|filtered_filesizeformat}}&nbsp;</td>
+ <td>
+ {{other_dep.dep_type_display}}
+ <span class="glyphicon glyphicon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></span>
+ </td>
+ </tr>
+ {% else %}
+ <tr class="text-muted">
+ <td>{{other_dep.name}}</td>
+ <td>{{other_dep.version}}</td>
+ <td></td>
+ <td>
+ {{other_dep.dep_type_display}}
+ <span class="glyphicon glyphicon-question-sign get-help hover-help" title="{{other_dep.dep_type_help}}" ></span>
+ </td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifnotequal %}
+ </div> <!-- end tab-pane -->
+ </div> <!-- end tab content -->
+ {% endwith %}
+{% endblock tabcontent %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html b/poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html
new file mode 100644
index 000000000..568e2f235
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_included_detail.html
@@ -0,0 +1,44 @@
+{% extends "package_detail_base.html" %}
+{% load projecttags %}
+
+{% block mainheading %}
+ <h1>
+ {{package.fullpackagespec}}
+ <script>
+ fmtAliasHelp("{{package.name}}", "{{package.alias}}", false)
+ </script>
+ <small>({{target.target}})</small>
+ </h1>
+{% endblock %}
+
+{% block tabcontent %}
+{% with packageFileCount=package.buildfilelist_package.count %}
+ {% include "package_included_tabs.html" with active_tab="detail" %}
+ <div class="tab-content">
+ <div class="tab-pane active" id="files">
+ {% if packageFileCount > 0 %}
+ {% include "tablesort.html" %}
+ <tbody>
+ {% for file in objects %}
+ <tr>
+ <td class="path">
+ <a href="{% url 'dirinfo_filepath' build.id target.id file.path %}">
+ {{file.path}}
+ </a>
+ </td>
+ <td class="filesize sizecol" >{{file.size|filtered_filesizeformat}}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ {% else %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> does not generate any files.
+ </div>
+ {% endif %}
+ </div> <!-- end tab-pane -->
+ </div> <!-- end tab content -->
+
+{% endwith %}
+{% endblock tabcontent %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html b/poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html
new file mode 100644
index 000000000..fb310c7fc
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html
@@ -0,0 +1,50 @@
+{% extends "package_detail_base.html" %}
+{% load projecttags %}
+
+{% block mainheading %}
+ <h1>
+ {{package.fullpackagespec}}
+ <script> fmtAliasHelp("{{package.name}}", "{{package.alias}}", false) </script>
+ <small>({{target.target}})</small>
+ </h1>
+{% endblock %}
+
+{% block tabcontent %}
+ {% with packageFileCount=package.buildfilelist_package.count %}
+ {% include "package_included_tabs.html" with active_tab="reverse" %}
+ <div class="tab-content">
+ <div class="tab-pane active" id="brought-in-by">
+
+ {% ifequal reverse_count 0 %}
+ <div class="alert alert-info">
+ <strong>{{package.fullpackagespec}}</strong> has no reverse runtime dependencies.
+ </div>
+ {% else %}
+ {% include "tablesort.html" %}
+ <tbody>
+ {% for reverse_dep in objects %}
+ <tr {% if reverse_dep.size %}{{reverse_dep.size|format_vpackage_rowclass}}{%endif%} >
+ {% if reverse_dep.size != -1 %}
+ <td>
+ <a href="{% url 'package_included_detail' build.id target.id reverse_dep.package_id %}">
+ {{reverse_dep.package.name}}
+ </a>
+ <script>fmtAliasHelp("{{reverse_dep.package.name}}", "{{reverse_dep.alias}}", true)</script>
+ </td>
+ {% else %}
+ <td>
+ {{reverse_dep.name|format_vpackage_namehelp}}
+ </td>
+ {% endif %}
+
+ <td>{{reverse_dep.package.version}}&nbsp;</td>
+ <td class='sizecol'>{{reverse_dep.package.size|filtered_filesizeformat}}&nbsp;</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endifequal %}
+ </div> <!-- end tab-pane -->
+ </div> <!-- end tab content -->
+ {% endwith %}
+{% endblock tabcontent %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html b/poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html
new file mode 100644
index 000000000..e89fa211c
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/package_included_tabs.html
@@ -0,0 +1,33 @@
+
+ <ul class="nav nav-tabs">
+ {% if active_tab == "detail" %}
+ <li class="active">
+ {% else %}
+ <li class="">
+ {% endif %}
+ <a href="{% url 'package_included_detail' build.id target.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The files this package adds to the image root file system"></span>
+ Files in root file system ({{packageFileCount}})
+ </a>
+ </li>
+ {% if active_tab == "dependencies" %}
+ <li class="active">
+ {% else %}
+ <li class="">
+ {% endif %}
+ <a href="{% url 'package_included_dependencies' build.id target.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Package runtime dependencies"></span>
+ Runtime dependencies ({{dependency_count}})
+ </a>
+ </li>
+ {% if active_tab == "reverse" %}
+ <li class="active">
+ {% else %}
+ <li class="">
+ {% endif %}
+ <a href="{% url 'package_included_reverse_dependencies' build.id target.id package.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The package runtime reverse dependencies (i.e. the packages in this image that depend on this package). Reverse dependencies reflect only the 'depends' dependency type"></span>
+ Reverse runtime dependencies ({{reverse_count}})
+ </a>
+ </li>
+ </ul>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html
new file mode 100644
index 000000000..303faecbd
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/pkg_add_rm_btn.html
@@ -0,0 +1,34 @@
+{# TODO move to snippets dir #}
+{% if data.is_locale_package %}
+<p class="text-center">
+ <span class="text-muted">Locale package</span>
+ <span class="glyphicon glyphicon-question-sign get-help hover-help"
+ title="This package is included in your image
+ based on the locale specified in the IMAGE_LINGUAS variable"
+ style="visibility: hidden;">
+ </span>
+</p>
+
+{% else %}
+
+<div id="package-btn-cell-{{data.pk}}">
+ <div style="display: none; font-size: 11px; line-height: 1.3;" class="tooltip-inner inline-notification"></div>
+ <button class="btn btn-block btn-danger add-rm-package-btn" data-directive="remove" data-id="{{data.pk}}" data-package-url="{% url 'xhr_customrecipe_packages' extra.recipe_id data.pk %}" data-name="{{data.name}}" style="
+ {% if data.pk not in extra.current_packages %}
+ display:none
+ {% endif %}
+ ">
+ <i class="icon-trash no-tooltip"></i>
+ Remove package
+ </button>
+ <button class="btn btn-default btn-block add-rm-package-btn" data-directive="add" data-id="{{data.pk}}" data-package-url="{% url 'xhr_customrecipe_packages' extra.recipe_id data.pk %}" data-name="{{data.name}}" style="
+ {% if data.pk in extra.current_packages %}
+ display:none
+ {% endif %}
+ ">
+ <i class="glyphicon glyphicon-plus"></i>
+ Add package
+ </button>
+</div>
+
+{% endif %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/project.html b/poky/bitbake/lib/toaster/toastergui/templates/project.html
new file mode 100644
index 000000000..11603d1e1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/project.html
@@ -0,0 +1,161 @@
+{% extends "baseprojectpage.html" %}
+
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block title %} Configuration - {{project.name}} - Toaster {% endblock %}
+{% block projectinfomain %}
+
+<script src="{% static 'js/layerDepsModal.js' %}"></script>
+<script src="{% static 'js/projectpage.js' %}"></script>
+<script>
+ $(document).ready(function (){
+ var ctx = {
+ testReleaseChangeUrl: "{% url 'xhr_testreleasechange' project.id %}",
+ };
+
+ try {
+ projectPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<div id="delete-project-modal" class="modal fade" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4>Are you sure you want to delete this project?</h4>
+ </div>
+ <div class="modal-body">
+ <p>Deleting the <strong class="project-name"></strong> project
+ will:</p>
+ <ul>
+ <li>Cancel its builds currently in progress</li>
+ <li>Remove its configuration information</li>
+ <li>Remove its imported layers</li>
+ <li>Remove its custom images</li>
+ <li>Remove all its build information</li>
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-primary" id="delete-project-confirmed">
+ <span data-role="submit-state">Delete project</span>
+ <span data-role="loading-state" style="display:none">
+ <span class="fa-pulse">
+ <i class="fa-pulse icon-spinner"></i>
+ </span>
+ &nbsp;Deleting project...
+ </span>
+ </button>
+ <button type="button" class="btn btn-link" data-dismiss="modal">Cancel</button>
+ </div>
+ </div><!-- /.modal-content -->
+ </div><!-- /.modal-dialog -->
+</div>
+
+
+<div class="row" id="project-page" style="display:none">
+ <div class="col-md-6">
+ <div class="well well-transparent" id="machine-section">
+ <h3>Machine</h3>
+
+ <p class="lead"><span id="project-machine-name"></span> <span class="glyphicon glyphicon-edit" id="change-machine-toggle"></span></p>
+
+ <form id="select-machine-form" style="display:none;" class="form-inline">
+ <span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span>
+ <div class="form-group" id="machine-input-form">
+ <input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
+ </div>
+ <button id="machine-change-btn" class="btn btn-default" type="button">Save</button>
+ <a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
+ <span class="help-block text-danger" id="invalid-machine-name-help" style="display:none">A valid machine name cannot include spaces.</span>
+ <p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p>
+ </form>
+ </div>
+
+ <div class="well well-transparent" id="distro-section">
+ <h3>Distro</h3>
+
+ <p class="lead"><span id="project-distro-name"></span> <span class="glyphicon glyphicon-edit" id="change-distro-toggle"></span></p>
+
+ <form id="select-distro-form" style="display:none;" class="form-inline">
+ <span class="help-block">Distro suggestions come from the Layer Index</a></span>
+ <div class="form-group">
+ <input class="form-control" id="distro-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
+ </div>
+ <button id="distro-change-btn" class="btn btn-default" type="button">Save</button>
+ <a href="#" id="cancel-distro-change" class="btn btn-link">Cancel</a>
+ <p class="form-link"><a href="{% url 'projectdistros' project.id %}">View compatible distros</a></p>
+ </form>
+ </div>
+
+ <div class="well well-transparent">
+ <h3>Most built recipes</h3>
+
+ <div class="alert alert-info" style="display:none" id="no-most-built">
+ <h4>You haven't built any recipes yet</h4>
+ <p class="form-link"><a href="{% url 'projectimagerecipes' project.id %}">Choose a recipe to build</a></p>
+ </div>
+
+ <ul class="list-unstyled lead" id="freq-build-list">
+ </ul>
+ <button class="btn btn-primary" id="freq-build-btn" disabled="disabled">Build selected recipes</button>
+ </div>
+
+ <div class="well well-transparent">
+ <h3>Project release</h3>
+
+ <p class="lead"><span id="project-release-title"></span>
+
+ <!-- Comment out the ability to change the project release, until we decide what to do with this functionality -->
+
+ <!--i title="" data-original-title="" id="release-change-toggle" class="icon-pencil"></i-->
+ </p>
+
+ <!-- Comment out the ability to change the project release, until we decide what to do with this functionality -->
+
+ <!--form class="form-inline" id="change-release-form" style="display:none;">
+ <select></select>
+ <button class="btn" style="margin-left:5px;" id="change-release-btn">Change</button> <a href="#" id="cancel-release-change" class="btn btn-link">Cancel</a>
+ </form-->
+ </div>
+ </div>
+
+ <div class="col-md-6">
+ <div class="well well-transparent" id="layer-container">
+ <h3>Layers <span class="counter">(<span id="project-layers-count"></span>)</span>
+ <span title="OpenEmbedded organises recipes and machines into thematic groups called <strong>layers</strong>. Click on a layer name to see the recipes and machines it includes." class="glyphicon glyphicon-question-sign get-help"></span>
+ </h3>
+
+ <div class="alert alert-warning" id="no-layers-in-project" style="display:none">
+ <h4>This project has no layers</h4>
+ In order to build this project you need to add some layers first. For that you can:
+ <ul>
+ <li><a href="{% url 'projectlayers' project.id %}">Choose from the layers compatible with this project</a></li>
+ <li><a href="{% url 'importlayer' project.id %}">Import a layer</a></li>
+ <li><a href="http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#understanding-and-creating-layers" target="_blank">Read about layers in the documentation</a></li>
+ <li>Or type a layer name below</li>
+ </ul>
+ </div>
+
+ <form class="form-inline">
+ <div class="form-group">
+ <input id="layer-add-input" class="form-control" autocomplete="off" placeholder="Type a layer name" data-minlength="1" data-autocomplete="off" data-provide="typeahead" data-source="" type="text">
+ </div>
+ <button id="add-layer-btn" class="btn btn-default" disabled>Add layer</button>
+ <p class="form-link">
+ <a href="{% url 'projectlayers' project.id %}" id="view-compatible-layers">View compatible layers</a>
+ <span class="text-muted">|</span>
+ <a href="{% url 'importlayer' project.id %}">Import layer</a>
+ </p>
+ </form>
+
+ <ul class="list-unstyled lead" id="layers-in-project-list">
+ </ul>
+ </div>
+</div>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html b/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html
new file mode 100644
index 000000000..a5fed2dd4
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds-toastertable.html
@@ -0,0 +1,65 @@
+{% extends 'base.html' %}
+
+{% load static %}
+
+{% block extraheadcontent %}
+<link rel="stylesheet" href="{% static 'css/jquery-ui.min.css' %}" type='text/css'>
+<link rel="stylesheet" href="{% static 'css/jquery-ui.structure.min.css' %}" type='text/css'>
+<link rel="stylesheet" href="{% static 'css/jquery-ui.theme.min.css' %}" type='text/css'>
+<script src="{% static 'js/jquery-ui.min.js' %}">
+</script>
+{% endblock %}
+
+{% block title %} {{title}} - {{project.name}} - Toaster {% endblock %}
+
+{% block pagecontent %}
+<div class="row">
+
+ {% include "projecttopbar.html" %}
+
+ <div class="col-md-12">
+ {% with mru=mru mrb_type=mrb_type %}
+ {% include 'mrb_section.html' %}
+ {% endwith %}
+
+ <h2 class="top-air" data-role="page-title"></h2>
+
+ {% if not build_in_progress_none_completed %}
+ {% url 'projectbuilds' project.id as xhr_table_url %}
+ {% include 'toastertable.html' %}
+ {% endif %}
+ </div>
+
+ <script>
+ $(document).ready(function () {
+ // title
+ var tableElt = $("#{{table_name}}");
+ var titleElt = $("[data-role='page-title']");
+
+ tableElt.on("table-done", function (e, total, tableParams) {
+ var title = "All project builds";
+
+ if (tableParams.search || tableParams.filter) {
+ if (total === 0) {
+ title = "No project builds found";
+ }
+ else if (total > 0) {
+ title = total + " project build" + (total > 1 ? 's' : '') + " found";
+ }
+ }
+
+ if (total === 0) {
+ titleElt.hide();
+ } else {
+ titleElt.show();
+ titleElt.text(title);
+ }
+ });
+
+ // highlight builds tab
+ $("#topbar-builds-tab").addClass("active")
+ });
+ </script>
+
+</div>
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html b/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html
new file mode 100644
index 000000000..50697a159
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/projectbuilds.html
@@ -0,0 +1,118 @@
+{% extends "baseprojectbuildspage.html" %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} Builds - {{project.name}} - Toaster {% endblock %}
+{% block extraheadcontent %}
+<link rel="stylesheet" href="/static/css/jquery-ui.min.css" type='text/css'>
+<link rel="stylesheet" href="/static/css/jquery-ui.structure.min.css" type='text/css'>
+<link rel="stylesheet" href="/static/css/jquery-ui.theme.min.css" type='text/css'>
+<script src="/static/js/jquery-ui.min.js"></script>
+<script src="/static/js/filtersnippet.js"></script>
+{% endblock %}
+
+{% block projectinfomain %}
+
+<script>
+ // initialize the date range controls
+ $(document).ready(function () {
+ date_init('started_on','{{last_date_from}}','{{last_date_to}}','{{dateMin_started_on}}','{{dateMax_started_on}}','{{daterange_selected}}');
+ date_init('completed_on','{{last_date_from}}','{{last_date_to}}','{{dateMin_completed_on}}','{{dateMax_completed_on}}','{{daterange_selected}}');
+ });
+</script>
+
+ {% with mrb_type='project' %}
+ {% include "mrb_section.html" %}
+ {% endwith %}
+
+ <h2>
+ {% if request.GET.filter and objects.paginator.count > 0 or request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} project build{{objects.paginator.count|pluralize}} found
+ {%elif request.GET.filter and objects.paginator.count == 0 or request.GET.search and objects.paginator.count == 0 %}
+ No project builds found
+ {%else%}
+ All project builds
+ {%endif%}
+ <i class="icon-question-sign get-help heading-help" title="This page lists all the builds for the current project"></i>
+ </h2>
+
+
+ {% if objects.paginator.count == 0 %}
+ {% if request.GET.filter or request.GET.search %}
+ <div class="row">
+ <div class="alert">
+ <form class="no-results input-append" id="searchform">
+ <input id="search" name="search" class="input-xxlarge" type="text" value="{{request.GET.search}}"/>{% if request.GET.search %}<a href="javascript:$('#search').val('');searchform.submit()" class="input-append-addon btn" tabindex="-1"><i class="glyphicon glyphicon-remove"></i></a>{% endif %}
+ <button class="btn" type="submit" value="Search">Search</button>
+ <button class="btn btn-link" onclick="javascript:$('#search').val('');searchform.submit()">Show all builds</button>
+ </form>
+ </div>
+ </div>
+ {% else %}
+ <div class="alert alert-info">
+ <p class="lead">
+ This project has no builds.
+ </p>
+ </div>
+ {% endif %}
+
+ {% else %}
+
+ {% include "basetable_top.html" %}
+ <!-- Table data rows; the order needs to match the order of "tablecols" definitions; and the <td class value needs to match the tablecols clclass value for show/hide buttons to work -->
+ {% for build in objects %} {# if we have a build, just display it #}
+ <tr class="data">
+ <td class="outcome"><a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a>
+ {% if build.cooker_log_path %}
+ &nbsp;
+ <a href="{% url 'build_artifact' build.id "cookerlog" build.id %}">
+ <i class="icon-download-alt" title="Download build log"></i>
+ </a>
+ {% endif %}
+ </td>
+
+ <td class="target">
+ {% for t in build.target_set.all %}
+ <a href="{% url "builddashboard" build.id %}">
+ {% if t.task %}
+ {{t.target}}:{{t.task}}
+ {% else %}
+ {{t.target}}
+ {% endif %}
+ </a> <br />
+ {% endfor %}
+ </td>
+ <td class="machine"><a href="{% url "builddashboard" build.id %}">{{build.machine}}</a></td>
+ <td class="started_on"><a href="{% url "builddashboard" build.id %}">{{build.started_on|date:"d/m/y H:i"}}</a></td>
+ <td class="completed_on"><a href="{% url "builddashboard" build.id %}">{{build.completed_on|date:"d/m/y H:i"}}</a></td>
+ <td class="failed_tasks error">
+ {% query build.task_build outcome=4 order__gt=0 as exectask%}
+ {% if exectask.count == 1 %}
+ <a href="{% url "task" build.id exectask.0.id %}">{{exectask.0.recipe.name}}.{{exectask.0.task_name}}</a>
+ <a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
+ <i class="icon-download-alt" title="" data-original-title="Download task log file"></i>
+ </a>
+ {% elif exectask.count > 1%}
+ <a href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}} task{{exectask.count|pluralize}}</a>
+ {%endif%}
+ </td>
+ <td class="errors.count">
+ {% if build.errors.count %}
+ <a class="errors.count error" href="{% url "builddashboard" build.id %}#errors">{{build.errors.count}} error{{build.errors.count|pluralize}}</a>
+ {%endif%}
+ </td>
+ <td class="warnings.count">{% if build.warnings.count %}<a class="warnings.count warning" href="{% url "builddashboard" build.id %}#warnings">{{build.warnings.count}} warning{{build.warnings.count|pluralize}}</a>{%endif%}</td>
+ <td class="time"><a href="{% url "buildtime" build.id %}">{{build.timespent_seconds|sectohms}}</a></td>
+ <td class="output">
+ {% if build.outcome == build.SUCCEEDED %}
+ <a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a>
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+
+
+ {% include "basetable_bottom.html" %}
+{% endif %}
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/projectconf.html b/poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
new file mode 100644
index 000000000..933c588f3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/projectconf.html
@@ -0,0 +1,1042 @@
+{% extends "baseprojectpage.html" %}
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} BitBake variables - {{project.name}} - Toaster {% endblock %}
+{% block projectinfomain %}
+
+<h2>Bitbake variables</h2>
+<div>
+ <dl>
+ {% if distro_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">DISTRO</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used"></span>
+ </dt>
+ <dd class="variable-list">
+ <span class="lead" id="distro">{{distro}}</span>
+ <span class="glyphicon glyphicon-edit" id="change-distro-icon"></span>
+ <form id="change-distro-form" class="form-inline" style="display:none;">
+ <div id="edit-distro-name-div" class="form-group">
+ <input type="text" class="form-control" id="new-distro" value="{{distro}}">
+ </div>
+ <button id="apply-change-distro" class="btn btn-default" type="button">Save</button>
+ <button id="cancel-change-distro" type="button" class="btn btn-link">Cancel</button>
+ <span class="help-block" id="distro-error-message"></span>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if dl_dir_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">DL_DIR</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Absolute path to the directory used to store downloads required for your builds. By default, Toaster projects share the same downloads directory"></span>
+ </dt>
+ <dd class="variable-list">
+ <span id="dl_dir" class="lead {% if not dl_dir %} text-muted {% endif %}">{% if dl_dir %}{{dl_dir}}{%else%}Not set{%endif%}</span>
+ <span class="glyphicon glyphicon-edit" id="change-dl_dir-icon"></span>
+ <form id="change-dl_dir-form" class="form-inline" style="display:none;">
+ <div class="form-group" id="validate-dl_dir">
+ <input type="text" class="form-control" id="new-dl_dir" placeholder="Type an absolute path">
+ </div>
+ <button id="apply-change-dl_dir" class="btn btn-default" type="button">Save</button>
+ <button id="cancel-change-dl_dir" type="button" class="btn btn-link">Cancel</button>
+ <p class="help-block" id="hintError-dl_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
+ <p class="help-block" id="hintError-initialChar-dl_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/downloads; or with a variable, e.g. ${TOPDIR}/downloads.</p>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if fstypes_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">IMAGE_FSTYPES</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Formats of root file system images that you want to create"></span>
+ </dt>
+ <dd class="variable-list">
+ <span class="lead" id="image_fstypes">{{fstypes}}</span>
+ <span class="glyphicon glyphicon-edit" id="change-image_fstypes-icon"></span>
+ <form id="change-image_fstypes-form" style="display:none;">
+ <label>Type the image types you want to build:</label>
+ <div class="form-group form-inline" id="validate-image_fstypes">
+ <input type="text" class="form-control "id="new-imagefs_types">
+ <button id="apply-change-image_fstypes" type="button" class="btn btn-default">Save</button>
+ <button id="cancel-change-image_fstypes" type="button" class="btn btn-link">Cancel</button>
+ </div>
+ <p class="help-block text-danger" style="display:none;" id="hintError-image-fs_type">A valid image type cannot include underscores</p>
+ <p class="help-block text-danger" style="display:none;" id="fstypes-error-message">You must select at least one image type</p>
+ <label>Or choose from known image types:</label>
+ <input id="filter-image_fstypes" type="text" placeholder="Search image types" class="form-control">
+ <div id="all-image_fstypes" class="scrolling"></div>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if image_install_append_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">IMAGE_INSTALL_append</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Specifies additional packages to install into an image. If your build creates more than one image, the packages will be installed in all of them"></span>
+ </dt>
+ <dd class="variable-list">
+ <span id="image_install" class="lead {% if not image_install_append %} text-muted {%endif%}">{% if image_install_append %}{{image_install_append}}{%else%}Not set{%endif%}</span>
+ <span class="glyphicon glyphicon-edit" id="change-image_install-icon"></span>
+ <span class="glyphicon glyphicon-trash" id="delete-image_install-icon" {% if image_install_append %}{%else%}style="display:none;"{%endif%}></span>
+ <form id="change-image_install-form" class="form-inline" style="display:none;">
+ <div class="row">
+ <div class="col-md-4">
+ <span class="help-block">To set IMAGE_INSTALL_append to more than one package, type the package names separated by a space.</span>
+ </div>
+ </div>
+ <div class="form-group">
+ <input type="text" class="form-control" id="new-image_install" placeholder="Type one or more package names">
+ </div>
+ <button id="apply-change-image_install" class="btn btn-default" type="button">Save</button>
+ <button id="cancel-change-image_install" type="button" class="btn btn-link">Cancel</button>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if package_classes_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">PACKAGE_CLASSES</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Specifies the package manager to use when packaging data"></span>
+ </dt>
+ <dd class="variable-list">
+ <span class="lead" id="package_classes">{{package_classes}}</span>
+ <span id="change-package_classes-icon" class="glyphicon glyphicon-edit"></span>
+ <form id="change-package_classes-form" style="display:none;">
+ <div class="form-group">
+ <label class="control-label">
+ Root file system package format
+ <span class="glyphicon glyphicon-question-sign get-help" title="The package format used to generate the root file system. Options are <code>deb</code>, <code>ipk</code> and <code>rpm</code>"></i>
+ </label>
+ <select id="package_classes-select" class="form-control">
+ <option>package_deb</option>
+ <option>package_ipk</option>
+ <option>package_rpm</option>
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label">
+ Additional package formats
+ <span class="glyphicon glyphicon-question-sign get-help" title="Extra package formats to build"></span>
+ </label>
+ <div class="checkbox">
+ <label id="package_class_1">
+ <input type="checkbox" id="package_class_1_input"> package_deb
+ </label>
+ </div>
+ <div class="checkbox">
+ <label id="package_class_2">
+ <input type="checkbox" id="package_class_2_input"> package_ipk
+ </label>
+ </div>
+ </div>
+ <button id="apply-change-package_classes" type="button" class="btn btn-default">Save</button>
+ <button id="cancel-change-package_classes" type="button" class="btn btn-link">Cancel</button>
+ </form>
+ </dd>
+ {% endif %}
+
+ {% if sstate_dir_defined %}
+ <dt>
+ <span class="js-config-var-name js-config-var-managed-name">SSTATE_DIR</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Absolute path to the directory used to store shared state cache files. These files are reused across the builds, which makes the builds faster. By default, Toaster projects share the same cache directory"></span>
+ </dt>
+ <dd class="variable-list">
+ <span id="sstate_dir" class="lead {% if not sstate_dir %} text-muted {% endif %}">{% if sstate_dir %}{{sstate_dir}}{%else%}Not set{%endif%}</span>
+ <span class="glyphicon glyphicon-edit" id="change-sstate_dir-icon"></span>
+ <form class="form-inline" id="change-sstate_dir-form" style="display:none;">
+ <div class="form-group" id="validate-sstate_dir">
+ <input type="text" class="form-control" id="new-sstate_dir" placeholder="Type an absolute path">
+ </div>
+ <button id="apply-change-sstate_dir" class="btn btn-default" type="button">Save</button>
+ <button id="cancel-change-sstate_dir" type="button" class="btn btn-link">Cancel</button>
+ <p class="help-block" id="hintError-sstate_dir" style="display:none;">The directory path cannot include spaces or any of these characters: \ ? % * : | " " &lt; &gt;</p>
+ <p class="help-block" id="hintError-initialChar-sstate_dir" style="display:none;">The directory path should either start with a /, e.g. /home/toaster/sstate-cache; or with a variable, e.g. ${TOPDIR}/sstate-cache.</p>
+ </form>
+ </dd>
+ {% endif %}
+ </dl>
+
+ <!-- <ul class="list-unstyled configuration-list" id="configvar-list"> -->
+ <dl id="configvar-list">
+ <!-- the added configuration variables are inserted here -->
+ </dl>
+
+ <!-- pass the fstypes list, black list, and externally managed variables here -->
+ {% for fstype in vars_fstypes %}
+ <input type="hidden" class="js-checkbox-fstypes-list" value="{{fstype}}">
+ {% endfor %}
+ {% for b in vars_blacklist %}
+ <input type="hidden" class="js-config-blacklist-name" value="{{b}}">
+ {% endfor %}
+ {% for b in vars_managed %}
+ <input type="hidden" class="js-config-managed-name" value="{{b}}">
+ {% endfor %}
+
+ <form id="variable-form">
+ <fieldset>
+ <legend>Add variable</legend>
+ <div class="row">
+ <div class="col-md-3">
+ <div id="add-configvar-name-div" class="form-group">
+ <label class="control-label">
+ Variable
+ <span class="glyphicon glyphicon-question-sign get-help"
+ title="Variable names are case sensitive,
+ cannot have spaces, and can only include letters, numbers, underscores
+ and dashes"></span>
+ </label>
+ <input type="text" class="form-control" placeholder="Type the variable name" id="variable">
+ </div>
+ <p class="help-block" id="new-variable-error-message"></p>
+ <div class="form-group">
+ <label clas="control-label">Value</label>
+ <input id="value" type="text" class="form-control" placeholder="Type the variable value">
+ </div>
+ <button id="add-configvar-button" class="btn btn-default save" type="button" disabled>Add variable</button>
+ </div>
+ <div class="col-md-5 help-block">
+ <h5>Some variables cannot be set from Toaster</h5>
+ <p>Toaster cannot set any variables that impact 1) the configuration of the build servers,
+ or 2) where artifacts produced by the build are stored. Such variables include: </p>
+ <p>
+ <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-BB_DISKMON_DIRS" target="_blank">BB_DISKMON_DIRS</a></code>
+ <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-BB_NUMBER_THREADS" target="_blank">BB_NUMBER_THREADS</a></code>
+ <code>CVS_PROXY_HOST</code>
+ <code>CVS_PROXY_PORT</code>
+ <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-PARALLEL_MAKE" target="_blank">PARALLEL_MAKE</a></code>
+ <code><a href="http://www.yoctoproject.org/docs/1.6.1/ref-manual/ref-manual.html#var-TMPDIR" target="_blank">TMPDIR</a></code></p>
+ <p>Plus the following standard shell environment variables:</p>
+ <p><code>http_proxy</code> <code>ftp_proxy</code> <code>https_proxy</code> <code>all_proxy</code></p>
+ </div>
+ </div>
+ </fieldset>
+ </form>
+</div>
+
+</div>
+
+<script>
+
+// global variables
+var do_reload=false;
+
+// validate new variable name
+function validate_new_variable() {
+ var variable = $("input#variable").val();
+ var value = $("input#value").val();
+
+ // presumed innocence
+ $('#new-variable-error-message').text("");
+ var error_msg = "";
+
+ var existing_configvars = document.getElementsByClassName('js-config-var-name');
+ for (var i = 0, length = existing_configvars.length; i < length; i++) {
+ if (existing_configvars[i].innerHTML.toUpperCase() == variable.toUpperCase()) {
+ error_msg = "This variable is already set in this page. Edit its value instead";
+ }
+ }
+
+ var blacklist_configvars = document.getElementsByClassName('js-config-blacklist-name');
+ for (var i = 0, length = blacklist_configvars.length; i < length; i++) {
+ if (blacklist_configvars[i].value.toUpperCase() == variable.toUpperCase()) {
+ error_msg = "You cannot edit this variable in Toaster because it is set by the build servers";
+ }
+ }
+
+ var managed_configvars = document.getElementsByClassName('js-config-managed-name');
+ for (var i = 0, length = managed_configvars.length; i < length; i++) {
+ if (managed_configvars[i].value.toUpperCase() == variable.toUpperCase()) {
+ error_msg = "You cannot set this variable here. Please set it in the <a href=\"{% url 'project' project.id %}\">project main page</a>";
+ }
+ }
+
+ var bad_chars = /[^a-zA-Z0-9\-_/]/.test(variable);
+ var has_spaces = (0 <= variable.indexOf(" "));
+ var only_spaces = (0 < variable.length) && (0 == variable.trim().length);
+
+ if (only_spaces) {
+ error_msg = "A valid variable name cannot include spaces";
+ } else if (bad_chars && has_spaces) {
+ error_msg = "A valid variable name can only include letters, numbers and the special characters <code> _ - /</code>. Variable names cannot include spaces";
+ } else if (bad_chars) {
+ error_msg = "A valid variable name can only include letters, numbers and the special characters <code>_ - /</code>";
+ }
+
+ if ("" != error_msg) {
+ $('#new-variable-error-message').html(error_msg);
+ $(".save").attr("disabled","disabled");
+
+ // add one (and only one) error class append
+ $("#add-configvar-name-div").addClass("has-error");
+ $("#new-variable-error-message").addClass("text-danger");
+
+ return false;
+ } else if (0 == variable.length) {
+ $(".save").attr("disabled","disabled");
+ return false;
+ }
+
+ $("#add-configvar-name-div").removeClass("has-error");
+
+ // now set the "Save" enablement if 'value' also passes
+ if (value.trim().length > 0) {
+ $(".save").removeAttr("disabled");
+ } else {
+ $(".save").attr("disabled","disabled");
+ }
+
+ return true;
+}
+
+// validate distro name
+function validate_distro_name() {
+ var value = $("input#new-distro").val();
+
+ // presumed innocence
+ $('#distro-error-message').text("");
+ var error_msg = "";
+
+ var has_spaces = (0 <= value.indexOf(" "));
+
+ if (has_spaces) {
+ error_msg = "A valid distro name cannot include spaces";
+ } else if (0 == value.length) {
+ error_msg = " ";
+ }
+
+ if ("" != error_msg) {
+ $('#distro-error-message').text(error_msg);
+ $("#apply-change-distro").attr("disabled","disabled");
+
+ // add one (and only one) error class append
+ $("#change-distro-form").addClass("has-error");
+
+ return false;
+ }
+
+ $("#change-distro-form").removeClass("has-error");
+ $("#apply-change-distro").removeAttr("disabled");
+ return true;
+}
+
+// Test to insure at least one FS Type is checked
+function enableFsTypesSave() {
+ var any_checked = 0;
+ $(".fs-checkbox-fstypes:checked").each(function(){
+ any_checked = 1;
+ });
+ if ( 0 == any_checked ) {
+ $("#apply-change-image_fstypes").attr("disabled","disabled");
+ $('.scrolling').addClass('has-error');
+ $('#fstypes-error-message').show();
+ }
+ else {
+ $("#apply-change-image_fstypes").removeAttr("disabled");
+ $('.scrolling').removeClass('has-error');
+ $('#fstypes-error-message').hide();
+ }
+}
+
+// Preset or reset the Package Class checkbox labels
+function updatePackageClassCheckboxes() {
+ $('#package_class_1, #package_class_2').hide();
+ if ($('select').val() == 'package_deb') {
+ $('#package_class_1').html('<input type="checkbox" id="package_class_1_input"> package_ipk');
+ $('#package_class_2').html('<input type="checkbox" id="package_class_2_input"> package_rpm');
+ }
+ if ($('select').val() == 'package_ipk') {
+ $('#package_class_1').html('<input type="checkbox" id="package_class_1_input"> package_deb');
+ $('#package_class_2').html('<input type="checkbox" id="package_class_2_input"> package_rpm');
+ }
+ if ($('select').val() == 'package_rpm') {
+ $('#package_class_1').html('<input type="checkbox" id="package_class_1_input"> package_deb');
+ $('#package_class_2').html('<input type="checkbox" id="package_class_2_input"> package_ipk');
+ }
+ $('#package_class_1, #package_class_2').fadeIn(1500);
+}
+
+// Re-assert handlers when the page is served and/or refreshed via Ajax
+function setEventHandlersForDynamicElements() {
+
+ // change variable value
+ $('.js-icon-pencil-config_var').click(function (evt) {
+ var pk = $(this).attr("x-data");
+ var current_val = $("#config_var_value_"+pk).text();
+ $("#config_var_value_"+pk).hide();
+ $("#config_var_trash_"+pk).hide();
+ $(".js-icon-pencil-config_var[x-data="+pk+"]").hide();
+ $("#change-config_var-form_"+pk).slideDown();
+ $("#new-config_var_"+pk).val(current_val);
+ if ( $("#new-config_var_"+pk).val().length ) {
+ $("#apply-change-config_var_"+pk).removeAttr("disabled");
+ }
+ else {
+ $("#apply-change-config_var_"+pk).attr("disabled");
+ }
+ });
+
+ $('.js-cancel-change-config_var').click(function (evt) {
+ var pk = evt.target.attributes["x-data"].value;
+ $("#change-config_var-form_"+pk).slideUp(function() {
+ $("#config_var_trash_"+pk).show();
+ $('#config_var_value_'+pk).show();
+ $(".js-icon-pencil-config_var[x-data="+pk+"]").show();
+ });
+ });
+
+ $(".js-new-config_var").on('input', function(){
+ if ($(this).val().length == 0) {
+ $(this).parent("div").next(".btn-default").attr("disabled","disabled");
+ }
+ else {
+ $(this).parent("div").next(".btn-default").removeAttr("disabled");
+ }
+ });
+
+ $('.js-apply-change-config_var').click(function (evt) {
+ var xdata = evt.target.attributes["x-data"].value.split(":");
+ var pk = xdata[0];
+ var variable = xdata[1];
+ var val = $('#new-config_var_'+pk).val();
+ postEditAjaxRequest({"configvarChange" : variable+':'+val});
+ $("#change-config_var-form_"+pk).slideUp();
+ $("#config_var_trash_"+pk).fadeIn();
+ $('#config_var_value_'+pk).fadeIn();
+ $(".js-icon-pencil-config_var[x-data="+pk+"]").fadeIn();
+ });
+
+ // delete variable
+ $(".js-icon-trash-config_var").click(function (evt) {
+ var pk = $(this).attr("x-data");
+
+ // fade out the variable+value div, then refresh the variable list
+ $(this).fadeOut();
+ $(this).tooltip("hide");
+ $("config_var_entry_"+pk).fadeOut();
+ $('#config_var_value_'+pk).parent("dd").fadeOut();
+ postEditAjaxRequest({"configvarDel": evt.target.attributes["x-data"].value});
+ });
+
+}
+
+function onEditPageUpdate(data) {
+ // update targets
+ var i; var orightml = "";
+
+ var configvars_sorted = data.configvars.sort(function(a, b){return a[0] > b[0]});
+
+ var managed_configvars = document.getElementsByClassName('js-config-var-managed-name');
+
+ for (i = 0; i < configvars_sorted.length; i++) {
+ // skip if the variable name has a special context (not user defined)
+ var var_context=undefined;
+ for (var j = 0, length = managed_configvars.length; j < length; j++) {
+ if ((managed_configvars[j].innerHTML == configvars_sorted[i][0]) ||
+ (managed_configvars[j].value == configvars_sorted[i][0]) ) {
+ var_context='m';
+ }
+ }
+ if (var_context == undefined) {
+ orightml += '<dt><span id="config_var_entry_'+configvars_sorted[i][2]+'" class="js-config-var-name"></span><span class="glyphicon glyphicon-trash js-icon-trash-config_var" id="config_var_trash_'+configvars_sorted[i][2]+'" x-data="'+configvars_sorted[i][2]+'"></span> </dt>'
+ orightml += '<dd class="variable-list">'
+ orightml += ' <span class="lead" id="config_var_value_'+configvars_sorted[i][2]+'"></span>'
+ orightml += ' <span class="glyphicon glyphicon-edit js-icon-pencil-config_var" x-data="'+configvars_sorted[i][2]+'"></span>'
+ orightml += ' <form class="form-inline" id="change-config_var-form_'+configvars_sorted[i][2]+'" style="display:none;">'
+ orightml += ' <div class="form-group">'
+ orightml += ' <input type="text" class="form-control js-new-config_var" id="new-config_var_'+configvars_sorted[i][2]+'" value=""></div>'
+ orightml += ' <button id="apply-change-config_var_'+configvars_sorted[i][2]+'" class="btn btn-default js-apply-change-config_var" type="button" x-data="'+configvars_sorted[i][2]+':'+configvars_sorted[i][0]+'" disabled>Save</button>'
+ orightml += ' <button type="button" class="btn btn-link js-cancel-change-config_var" x-data="'+configvars_sorted[i][2]+'">Cancel</button>'
+ orightml += ' </form>'
+ orightml += '</dd>'
+ }
+ }
+
+ // update configvars list HTML framework
+ $("dl#configvar-list").html(orightml);
+
+ // insert the name/value pairs safely as non-HTML
+ for (i = 0; i < configvars_sorted.length; i++) {
+ $('#config_var_entry_'+configvars_sorted[i][2]).text(configvars_sorted[i][0]);
+ $('#config_var_value_'+configvars_sorted[i][2]).text(configvars_sorted[i][1]);
+ }
+
+ // Add the tooltips
+ $(".js-icon-trash-config_var").each( function(){ setDeleteTooltip($(this)); });
+ $(".js-icon-pencil-config_var").each(function(){ setChangeTooltip($(this)); });
+
+ // re-assert these event handlers
+ setEventHandlersForDynamicElements();
+}
+
+function onEditAjaxSuccess(data, textstatus) {
+ console.log("XHR returned:", data, "(" + textstatus + ")");
+ if (data.error != "ok") {
+ alert("error on request:\n" + data.error);
+ return;
+ }
+
+ // delayed page reload?
+ if (do_reload) {
+ do_reload=false;
+ location.reload(true);
+ } else {
+ onEditPageUpdate(data);
+ }
+}
+
+function onEditAjaxError(jqXHR, textstatus, error) {
+ alert("XHR errored:\n" + error + "\n(" + textstatus + ")");
+ // re-assert the event handlers
+}
+
+/* ensure cookie exists {% csrf_token %} */
+function postEditAjaxRequest(reqdata) {
+ var ajax = $.ajax({
+ type:"POST",
+ data: $.param(reqdata),
+ url:"{% url 'xhr_configvaredit' project.id%}",
+ headers: { 'X-CSRFToken': $.cookie("csrftoken")},
+ success: onEditAjaxSuccess,
+ error: onEditAjaxError,
+ })
+}
+
+function setDeleteTooltip(object) {
+ object.tooltip({ container: 'body', html: true, delay: {show: 400}, title: "Delete" });
+}
+function setChangeTooltip(object) {
+ object.tooltip({ container: 'body', html: true, delay: {show: 400}, title: "Change" });
+}
+
+$(document).ready(function() {
+
+ //
+ // Register handlers for static elements
+ //
+
+ {% if distro_defined %}
+ // change distro variable
+ $('#change-distro-icon').click(function() {
+ $('#change-distro-icon, #distro').hide();
+ $("#change-distro-form").slideDown();
+ $("#new-distro").val( $('#distro').text() );
+ $("#apply-change-distro").removeAttr("disabled");
+ });
+
+ $('#cancel-change-distro').click(function(){
+ $("#change-distro-form").slideUp(function() {
+ $('#distro, #change-distro-icon').show();
+
+ // reset any dangling error state
+ $('#distro-error-message').text("");
+ $("#change-distro-form").removeClass("has-error");
+ });
+ });
+
+ // validate new distro name
+ $("input#new-distro").on('input', function (evt) {
+ validate_distro_name();
+ });
+
+ $('#apply-change-distro').click(function(){
+ //$('#repo').parent().removeClass('highlight-go');
+ var name = $('#new-distro').val();
+ postEditAjaxRequest({"configvarChange" : 'DISTRO:'+name});
+ $('#distro').text(name);
+ $("#change-distro-form").slideUp(function () {
+ $('#distro, #change-distro-icon').show();
+ });
+ });
+ {% endif %}
+
+ {% if dl_dir_defined %}
+
+ // change DL_DIR variable
+ $('#change-dl_dir-icon').click(function() {
+ $('#change-dl_dir-form').removeClass('has-error');
+ // preset the edit value
+ var current_val = $("#dl_dir").text().trim();
+ if (current_val == "Not set") {
+ current_val="";
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ }
+ $("input#new-dl_dir").val(current_val);
+ // enable / disable the save button based on the input value
+ if ( current_val.length ) {
+ $("#apply-change-dl_dir").removeAttr("disabled");
+ }
+ else {
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ }
+
+ $('#change-dl_dir-icon, #dl_dir').hide();
+ $("#change-dl_dir-form").slideDown();
+ });
+
+ $('#cancel-change-dl_dir').click(function(){
+ $("#hintError-dl_dir").hide();
+ $("#hintError-initialChar-dl_dir").hide();
+ $("#change-dl_dir-form").slideUp(function() {
+ $('#dl_dir, #change-dl_dir-icon').show();
+ });
+ });
+
+ $("#new-dl_dir").on('input', function(){
+ if ($(this).val().trim().length == 0) {
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ $('#change-dl_dir-form').addClass('has-error');
+ $('#hintError-dl_dir').hide();
+ $('#hintError-initialChar-dl_dir').hide();
+ }
+ else {
+ var input = $(this);
+ var reBeginWithSlash = /^\//;
+ var reCheckVariable = /^\$/;
+ var re = /([ <>\\|":%\?\*]+)/;
+ var invalidDir = re.test(input.val());
+ var invalidSlash = reBeginWithSlash.test(input.val());
+ var invalidVar = reCheckVariable.test(input.val());
+ if (!invalidSlash && !invalidVar) {
+ $('#change-dl_dir-form').addClass('has-error');
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ $('#hintError-initialChar-dl_dir').show();
+ } else if (invalidDir) {
+ $('#change-dl_dir-form').addClass('has-error');
+ $("#apply-change-dl_dir").attr("disabled","disabled");
+ $('#hintError-dl_dir').show();
+ } else {
+ $('#change-dl_dir-form').removeClass('has-error');
+ $("#apply-change-dl_dir").removeAttr("disabled");
+ $('#hintError-dl_dir').hide();
+ $('#hintError-initialChar-dl_dir').hide();
+ }
+ }
+ });
+
+ $('#apply-change-dl_dir').click(function(){
+ var value = $('#new-dl_dir').val().trim();
+ postEditAjaxRequest({"configvarChange" : 'DL_DIR:'+value});
+ $('#dl_dir').text(value);
+ $('#dl_dir').removeClass('muted');
+ $("#change-dl_dir-form").slideUp(function () {
+ $('#dl_dir, #change-dl_dir-icon').show();
+ });
+ });
+
+ {% endif %}
+
+ {% if fstypes_defined %}
+ // change IMAGE_FSTYPES variable
+
+ // get value of fstypes and add to the textbox
+ $("#new-imagefs_types").val("{{fstypes}}");
+
+ // If value of new-imagefs_types is empty disable save button
+ $("#new-imagefs_types").on("input", function() {
+ $(this).val($(this).val().replace(/\s+/g,' '));
+ if ($(this).val().length === 0) {
+ //$('#apply-change-image_fstypes').prop('disabled', true);
+ $('#apply-change-image_fstypes').attr("disabled", "disabled");
+ } else {
+ //$('#apply-change-image_fstypes').prop('disabled', false);
+ $('#apply-change-image_fstypes').removeAttr("disabled");
+ }
+
+ /*If user types imagefs do the action on checkboxes.
+ Lets say if an imagefstype typed by user and the same
+ imagefs is unchecked in the checkbox, then checkbox needs
+ to get checked. Similarly when user deletes imagefs from
+ textbox the checkbox which is checked gets unchecked.
+ */
+ $('#all-image_fstypes input').each(function(){
+ var imagefs_userval = $('#new-imagefs_types').val();
+ if( imagefs_userval.indexOf($(this).val()) > -1) {
+ $(this).prop('checked', true);
+ } else {
+ $(this).prop('checked', false);
+ }
+ });
+
+ // Validate underscore in image fs types
+ if ($(this).val().indexOf('_') > -1) {
+ $('#validate-image_fstypes').addClass('has-error');
+ $('#hintError-image-fs_type').show();
+ $("#apply-change-image_fstypes").prop("disabled", true);
+ } else {
+ $('#validate-image_fstypes').removeClass('has-error');
+ $('#hintError-image-fs_type').hide();
+ }
+ });
+
+ $('#change-image_fstypes-icon').click(function() {
+ $('#change-image_fstypes-icon, #image_fstypes').hide();
+ $("#change-image_fstypes-form").slideDown();
+ // avoid false substring matches by including space separators
+ var html = "";
+ var fstypes = " " + document.getElementById("image_fstypes").innerHTML + " ";
+ var fstypes_list = document.getElementsByClassName('js-checkbox-fstypes-list');
+ // Add the checked boxes first
+ if (" " != fstypes) {
+ for (var i = 0, length = fstypes_list.length; i < length; i++) {
+ if (0 <= fstypes.indexOf(" "+fstypes_list[i].value+" ")) {
+ html += '<div class="checkbox"><label><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'" checked="checked">'+fstypes_list[i].value+'</label></div>';
+ }
+ }
+ }
+ // Add the un-checked boxes second
+ for (var i = 0, length = fstypes_list.length; i < length; i++) {
+ if (0 > fstypes.indexOf(" "+fstypes_list[i].value+" ")) {
+ html += '<div class="checkbox"><label><input type="checkbox" class="fs-checkbox-fstypes" value="'+fstypes_list[i].value+'">'+fstypes_list[i].value+'</label></div>';
+ }
+ }
+ // Add the 'no search matches' line last
+ html += '<label id="no-match-fstypes" class="text-muted">No image types found</label>\n';
+ // Display the list
+ document.getElementById("all-image_fstypes").innerHTML = html;
+ $('#no-match-fstypes').hide();
+
+ // clear the previous filter values and warning messages
+ $("input#filter-image_fstypes").val("");
+ });
+
+ // When checkbox is checked/unchecked kindly update the text
+ $(document).on("change", "#all-image_fstypes :checkbox", function() {
+ var imagefs = $(this);
+ var imagefs_obj = $('#new-imagefs_types');
+ var imagefs_userval = imagefs_obj.val();
+ if ($(this).is(':checked')) {
+ if (imagefs_userval.indexOf($(imagefs).val()) === -1) {
+ imagefs_obj.val(imagefs_userval + " " + $(imagefs).val());
+ }
+ } else {
+ if (imagefs_userval.indexOf($(imagefs).val()) > -1) {
+ imagefs_obj.val(imagefs_userval.replace($(imagefs).val(), '').trim());
+ }
+ }
+ if ($('#new-imagefs_types').val().length === 0) {
+ $("#apply-change-image_fstypes").prop("disabled", true);
+ $('#fstypes-error-message').show();
+ } else {
+ $("#apply-change-image_fstypes").prop("disabled", false);
+ $('#fstypes-error-message').hide();
+ }
+ });
+
+ $('#cancel-change-image_fstypes').click(function(){
+ $("#new-imagefs_types").val("{{fstypes}}");
+ $("#change-image_fstypes-form").slideUp(function() {
+ $('#image_fstypes, #change-image_fstypes-icon').show();
+ });
+ });
+
+ $('#filter-image_fstypes').on('input', function(){
+ var valThis = $(this).val().toLowerCase();
+ var matchCount=0;
+ $('#all-image_fstypes label').each(function(){
+ var text = $(this).text().toLowerCase();
+ var match = text.indexOf(valThis);
+ if (match >= 0) {
+ $(this).show();
+ matchCount += 1;
+ }
+ else {
+ $(this).hide();
+ }
+ });
+ if (matchCount === 0) {
+ $('#no-match-fstypes').show();
+ } else {
+ $('#no-match-fstypes').hide();
+ }
+ });
+
+ $('#apply-change-image_fstypes').click(function(){
+ var fstypes = $('#new-imagefs_types').val();
+
+ postEditAjaxRequest({"configvarChange" : 'IMAGE_FSTYPES:'+fstypes});
+ $('#image_fstypes').text(fstypes);
+ $('#image_fstypes').parent().removeClass('muted');
+
+ $("#change-image_fstypes-form").slideUp(function() {
+ $('#image_fstypes, #change-image_fstypes-icon').show();
+ });
+ });
+ {% endif %}
+
+
+ {% if image_install_append_defined %}
+
+ // init IMAGE_INSTALL_append trash icon
+ setDeleteTooltip($('#delete-image_install-icon'));
+
+ // change IMAGE_INSTALL_append variable
+ $('#change-image_install-icon').click(function() {
+ // preset the edit value
+ var current_val = $("span#image_install").text().trim();
+ if (current_val == "Not set") {
+ current_val="";
+ $("#apply-change-image_install").attr("disabled","disabled");
+ } else {
+ // insure these non-empty values have single space prefix
+ current_val=" " + current_val;
+ $("#apply-change-image_install").removeAttr("disabled");
+ }
+ $("input#new-image_install").val(current_val);
+
+ $('#change-image_install-icon, #delete-image_install-icon, #image_install').hide();
+ $("#change-image_install-form").slideDown();
+ });
+
+ $('#cancel-change-image_install').click(function(){
+ $("#change-image_install-form").slideUp(function() {
+ $('#image_install, #change-image_install-icon').show();
+ if ($("span#image_install").text() != "Not set") {
+ $('#delete-image_install-icon').show();
+ setDeleteTooltip($('#delete-image_install-icon'));
+ }
+ });
+ });
+
+ $("#new-image_install").on('input', function(){
+ if ($(this).val().trim().length == 0) {
+ $("#apply-change-image_install").attr("disabled","disabled");
+ }
+ else {
+ $("#apply-change-image_install").removeAttr("disabled");
+ }
+ });
+
+ $('#apply-change-image_install').click(function(){
+ // insure these non-empty values have single space prefix
+ var value = " " + $('#new-image_install').val().trim();
+ postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+value});
+ $('#image_install').text(value);
+ $('#image_install').removeClass('text-muted');
+ $("#change-image_install-form").slideUp(function () {
+ $('#image_install, #change-image_install-icon').show();
+ if (value.length > -1) {
+ $('#delete-image_install-icon').show();
+ setDeleteTooltip($('#delete-image_install-icon'));
+ }
+ });
+ });
+
+ // delete IMAGE_INSTALL_append variable value
+ $('#delete-image_install-icon').click(function(){
+ $(this).tooltip('hide');
+ postEditAjaxRequest({"configvarChange" : 'IMAGE_INSTALL_append:'+''});
+ $('#image_install').parent().fadeOut(1000, function(){
+ $('#image_install').addClass('text-muted');
+ $('#image_install').text('Not set');
+ $('#delete-image_install-icon').hide();
+ $('#image_install').parent().fadeIn(1000);
+ });
+ });
+ {% endif %}
+
+
+ {% if package_classes_defined %}
+ // change PACKAGE_CLASSES variable
+ $('#change-package_classes-icon').click(function() {
+ $('#change-package_classes-icon, #package_classes').hide();
+ $("#change-package_classes-form").slideDown();
+
+ // initialize the pulldown and checkboxes
+ var value = $("#package_classes").text();
+ if ( value.indexOf("package_deb") == 0 ) {
+ $("#package_classes-select").prop('selectedIndex', 0);
+ updatePackageClassCheckboxes();
+ if ( value.indexOf("_ipk") > 0 ) {
+ $("#package_class_1_input").attr("checked",true);
+ }
+ if ( value.indexOf("_rpm") > 0 ) {
+ $("#package_class_2_input").attr("checked",true);
+ }
+ }
+
+ if ( value.indexOf("package_ipk") == 0 ) {
+ $("#package_classes-select").prop('selectedIndex', 1);
+ updatePackageClassCheckboxes();
+ if ( value.indexOf("_deb") > 0 ) {
+ $("#package_class_1_input").attr("checked",true);
+ }
+ if ( value.indexOf("_rpm") > 0 ) {
+ $("#package_class_2_input").attr("checked",true);
+ }
+ }
+
+ if ( value.indexOf("package_rpm") == 0 ) {
+ $("#package_classes-select").prop('selectedIndex', 2);
+ updatePackageClassCheckboxes();
+ if ( value.indexOf("_deb") > 0 ) {
+ $("#package_class_1_input").attr("checked",true);
+ }
+ if ( value.indexOf("_ipk") > 0 ) {
+ $("#package_class_2_input").attr("checked",true);
+ }
+ }
+ });
+
+ $('#cancel-change-package_classes').click(function(){
+ $("#change-package_classes-form").slideUp(function() {
+ $('#package_classes, #change-package_classes-icon').show();
+ });
+ });
+
+ $('select').change(function() {
+ updatePackageClassCheckboxes();
+ });
+
+ $('#apply-change-package_classes').click(function(){
+ var e = document.getElementById("package_classes-select");
+ var val = e.options[e.selectedIndex].text;
+
+ pc1_checked = document.getElementById("package_class_1_input").checked;
+ pc2_checked = document.getElementById("package_class_2_input").checked;
+ if (val == "package_deb") {
+ if (pc1_checked) val = val + " package_ipk";
+ if (pc2_checked) val = val + " package_rpm";
+ }
+ if (val == "package_ipk") {
+ if (pc1_checked) val = val + " package_deb";
+ if (pc2_checked) val = val + " package_rpm";
+ }
+ if (val == "package_rpm") {
+ if (pc1_checked) val = val + " package_deb";
+ if (pc2_checked) val = val + " package_ipk";
+ }
+
+ $('#package_classes').text(val);
+ //$('#package_classes').parent().removeClass('muted');
+ postEditAjaxRequest({"configvarChange" : 'PACKAGE_CLASSES:'+val});
+ $("#change-package_classes-form").slideUp(function() {
+ $('#package_classes, #change-package_classes-icon').show();
+ });
+ });
+ {% endif %}
+
+ {% if sstate_dir_defined %}
+
+ // change SSTATE_DIR variable
+ $('#change-sstate_dir-icon').click(function() {
+ $('#change-sstate_dir-form').removeClass('has-error');
+ // preset the edit value
+ var current_val = $("span#sstate_dir").text().trim();
+ if (current_val == "Not set") {
+ current_val="";
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ }
+ $("input#new-sstate_dir").val(current_val);
+
+ // enable / disable the save button based on the input value
+ if ( current_val.length ) {
+ $("#apply-change-sstate_dir").removeAttr("disabled");
+ }
+ else {
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ }
+
+ $('#change-sstate_dir-icon, #sstate_dir').hide();
+ $("#change-sstate_dir-form").slideDown();
+ });
+
+ $('#cancel-change-sstate_dir').click(function(){
+ $("#hintError-sstate_dir").hide();
+ $("#hintError-initialChar-sstate_dir").hide();
+ $("#change-sstate_dir-form").slideUp(function() {
+ $('#sstate_dir, #change-sstate_dir-icon').show();
+ });
+ });
+
+ $("#new-sstate_dir").on('input', function(){
+ if ($(this).val().trim().length == 0) {
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ $('#change-sstate_dir-form').addClass('has-error');
+ $('#hintError-sstate_dir').hide();
+ $('#hintError-initialChar-sstate_dir').hide();
+ }
+ else {
+ var input = $(this);
+ var reBeginWithSlash = /^\//;
+ var reCheckVariable = /^\$/;
+ var re = /([ <>\\|":%\?\*]+)/;
+ var invalidDir = re.test(input.val());
+ var invalidSlash = reBeginWithSlash.test(input.val());
+ var invalidVar = reCheckVariable.test(input.val());
+ if (!invalidSlash && !invalidVar) {
+ $('#change-sstate_dir-form').addClass('has-error');
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ $('#hintError-initialChar-sstate_dir').show();
+ } else if (invalidDir) {
+ $('#change-sstate_dir-form').addClass('has-error');
+ $("#apply-change-sstate_dir").attr("disabled","disabled");
+ $('#hintError-sstate_dir').show();
+ } else {
+ $('#change-sstate_dir-form').removeClass('has-error');
+ $("#apply-change-sstate_dir").removeAttr("disabled");
+ $('#hintError-sstate_dir').hide();
+ $('#hintError-initialChar-sstate_dir').hide();
+ }
+ }
+ });
+
+ $('#apply-change-sstate_dir').click(function(){
+ var value = $('#new-sstate_dir').val().trim();
+ postEditAjaxRequest({"configvarChange" : 'SSTATE_DIR:'+value});
+ $('#sstate_dir').text(value);
+ $('#sstate_dir').removeClass('text-muted');
+ $("#change-sstate_dir-form").slideUp(function () {
+ $('#sstate_dir, #change-sstate_dir-icon').show();
+ });
+ });
+
+ {% endif %}
+
+ // add new variable
+ $("button#add-configvar-button").click( function (evt) {
+ var variable = $("input#variable").val();
+ var value = $("input#value").val();
+
+ postEditAjaxRequest({"configvarAdd" : variable+':'+value});
+
+ // clear the previous values
+ $("input#variable").val("");
+ $("input#value").val("");
+ // Disable add button
+ $(".save").attr("disabled","disabled");
+
+ // Reload page if admin-removed core managed value is manually added back in
+ if (0 <= " DISTRO DL_DIR IMAGE_FSTYPES IMAGE_INSTALL_append PACKAGE_CLASSES SSTATE_DIR ".indexOf( " "+variable+" " )) {
+ // delayed reload to avoid race condition with postEditAjaxRequest
+ do_reload=true;
+ }
+ });
+
+ // validate new variable name and value
+ $("#variable, #value").on('input', function() {
+ validate_new_variable();
+ });
+
+ //
+ // draw and register the dynamic configuration variables and handlers
+ //
+
+ var data = {
+ configvars : []
+ };
+ {% for c in configvars %}
+ data.configvars.push([ "{{c.name}}","{{c.value}}","{{c.pk}}" ]);
+ {% if '' != vars_context|get_dict_value:c.name %}
+ data.vars_context[ "{{c.name}}" ] = "{{vars_context|get_dict_value:c.name }}";
+ {% endif %}
+ {% endfor %}
+
+ // draw these elements and assert their event handlers
+ onEditPageUpdate(data);
+});
+
+</script>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html b/poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html
new file mode 100644
index 000000000..d8020a97f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/projects-toastertable.html
@@ -0,0 +1,42 @@
+{% extends 'base.html' %}
+
+{% block title %} All projects - Toaster {% endblock %}
+
+{% block pagecontent %}
+
+<div class="row">
+ <div class="col-md-12">
+
+ <div class="page-header">
+ <h1 data-role="page-title"></h1>
+ </div>
+
+ {% url 'projects' as xhr_table_url %}
+ {% include 'toastertable.html' %}
+
+ <script>
+$(document).ready(function () {
+ var tableElt = $("#{{table_name}}");
+ var titleElt = $("[data-role='page-title']");
+
+ tableElt.on("table-done", function (e, total, tableParams) {
+ var title = "All projects";
+
+ if (tableParams.search || tableParams.filter) {
+ if (total === 0) {
+ title = "No projects found";
+ }
+ else if (total > 0) {
+ title = total + " project" + (total > 1 ? 's' : '') + " found";
+ }
+ }
+
+ titleElt.text(title);
+ });
+ });
+ </script>
+
+ </div>
+</div>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html b/poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
new file mode 100644
index 000000000..768ca9455
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
@@ -0,0 +1,79 @@
+{% load static %}
+<script src="{% static 'js/projecttopbar.js' %}"></script>
+<script>
+ $(document).ready(function () {
+ var ctx = {
+ numProjectLayers : {{project.get_project_layer_versions.count}},
+ machine : "{{project.get_current_machine_name|default_if_none:""}}",
+ }
+
+ try {
+ projectTopBarInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+<div class="col-md-12">
+ <div class="alert alert-success alert-dismissible change-notification" id="project-created-notification" style="display:none">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ <p>Your project <strong>{{project.name}}</strong> has been created. You can now <a class="alert-link" href="{% url 'projectmachines' project.id %}">select your target machine</a> and <a class="alert-link" href="{% url 'projectimagerecipes' project.id %}">choose image recipes</a> to build.</p>
+ </div>
+ <!-- project name -->
+ <div class="page-header">
+ <h1 id="project-name-container">
+ <span class="project-name">{{project.name}}</span>
+
+ <span class="glyphicon glyphicon-edit" id="project-change-form-toggle"></i>
+
+ {% if project.is_default %}
+ <span class="glyphicon glyphicon-question-sign get-help" title="This project shows information about the builds you start from the command line while Toaster is running"></span>
+ {% endif %}
+ </h1>
+ <form id="project-name-change-form" class="form-inline" style="display: none;">
+ <div class="form-group">
+ <input class="form-control input-lg" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}">
+ </div>
+ <button id="project-name-change-btn" class="btn btn-default btn-lg" type="button">Save</button>
+ <a href="#" id="project-name-change-cancel" class="btn btn-lg btn-link">Cancel</a>
+ </form>
+ </div>
+
+ {% if not project.is_default %}
+ <div id="project-topbar">
+ <ul class="nav nav-tabs">
+ <li id="topbar-configuration-tab">
+ <a href="{% url 'project' project.id %}">
+ Configuration
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'projectbuilds' project.id %}">
+ Builds ({{project.get_number_of_builds}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'importlayer' project.id %}">
+ Import layer
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'newcustomimage' project.id %}">
+ New custom image
+ </a>
+ </li>
+ <li class="pull-right">
+ <form class="form-inline">
+ <div class="form-group">
+ <span class="glyphicon glyphicon-question-sign get-help" data-placement="left" title="Type the name of one or more recipes you want to build, separated by a space. You can also specify a task by appending a colon and a task name to the recipe name, like so: <code>busybox:clean</code>"></span>
+ <input id="build-input" type="text" class="form-control input-lg" placeholder="Type the recipe you want to build" autocomplete="off" disabled>
+ </div>
+ <button id="build-button" class="btn btn-primary btn-lg" data-project-id="{{project.id}}" disabled>Build</button>
+ </form>
+ </li>
+ </ul>
+ </div>
+ {% endif %}
+</div>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/recipe.html b/poky/bitbake/lib/toaster/toastergui/templates/recipe.html
new file mode 100644
index 000000000..bf2cd7169
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/recipe.html
@@ -0,0 +1,320 @@
+{% extends "basebuilddetailpage.html" %}
+
+{% load projecttags %}
+
+{% block title %} {{object.name}}_{{object.version}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+<li>{{object.name}}_{{object.version}} </li>
+{% endblock %}
+
+{% block pagedetailinfomain %}
+
+<!-- Begin container -->
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="page-header build-data">
+ <h1>{{object.name}}_{{object.version}}</h1>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-md-8 tabbable">
+ <ul class="nav nav-tabs">
+ <li class="{{tab_states.1}}">
+ <a href="#information" data-toggle="tab">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Build-related
+ information about the recipe"></span>
+ Recipe details
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe_packages" build.pk object.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The packaged
+ output resulting from building the recipe"></span>
+ Packages ({{package_count}})
+ </a>
+ </li>
+ <li class="{{tab_states.3}}">
+ <a href="#dependencies" data-toggle="tab">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The recipe
+ build-time dependencies (i.e. other recipes)"></span>
+ Build dependencies ({{object.r_dependencies_recipe.all.count}})
+ </a>
+ </li>
+ <li class="{{tab_states.4}}">
+ <a href="#brought-in-by" data-toggle="tab">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The recipe
+ build-time reverse dependencies (i.e. the recipes that
+ depend on this recipe)"></span>
+ Reverse build dependencies ({{object.r_dependencies_depends.all.count}})
+ </a>
+ </li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane {{tab_states.1}}" id="information">
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name of
+ the layer providing the recipe"></span>
+ Layer
+ </dt>
+ <dd>{{layer.name}}</dd>
+
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Path to the
+ recipe .bb file"></span>
+ Recipe file
+ </dt>
+ <dd><code>{{object.file_path}} {% if object.pathflags %}<i>({{object.pathflags}})</i>{% endif %}</code></dd>
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help"
+ title="The Git branch of the layer providing the
+ recipe"></span>
+ Layer branch
+ </dt>
+ {% if layer_version.layer.local_source_dir %}
+ <dd>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The source
+ code of {{layer_version.layer.name}} is not in a git repository
+ so there is no branch associated with it"></span>
+ </dd>
+ {% else %}
+ <dd>{{layer_version.branch}}</dd>
+ {% endif %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The Git
+ commit of the layer providing the recipe"></span>
+ Layer commit
+ </dt>
+ {% if layer_version.layer.local_source_dir %}
+ <dd>
+ <span class="text-muted">Not applicable</span>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The source
+ code of {{layer_version.layer.name}} is not in a git repository
+ so there is no commit associated with it"></span>
+ </dd>
+ {% else %}
+ <dd class="iscommit">{{layer_version.commit}}</dd>
+ {% endif %}
+ {% if object.provides_set.all %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help"
+ title="A list of aliases by which a particular recipe can be known. The additional aliases are
+ synonyms for the recipe and can be useful satisfying dependencies of other recipes during
+ the build"></span>
+ PROVIDES
+ </dt>
+ <dd><code>{% for provider in object.provides_set.all %}{{ provider.name }}&nbsp;{% endfor %}</code></dd>
+ {% endif %}
+ </dl>
+
+ <h2 class="details">Tasks</h2>
+ {% if not tasks %}
+ <div class="alert alert-info">
+ <strong>{{object.name}}_{{object.version}}</strong> does not have any tasks in this build.
+ </div>
+ {% else %}
+ <div class="table-responsive">
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>
+ <span class="glyphicon glyphicon-question-sign
+ get-help" title="The running sequence of each task
+ in the build"></span>
+ Order
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name
+ of the task"></span>
+ Task
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="This
+ value tells you if a task had to run (executed) in
+ order to generate the task output, or if the output was
+ provided by another task and therefore the task didn't need
+ to run (not executed)"></span>
+ Executed
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="This
+ column tells you if 'executed' tasks succeeded or
+ failed. The column also tells you why 'not executed'
+ tasks did not need to run"></span>
+ Outcome
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="This
+ column tells you if a task tried to restore output
+ from the <code>sstate-cache</code> directory or
+ mirrors, and reports the result: Succeeded, Failed or File
+ not in cache"></span>
+ Cache attempt
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+
+ {% for task in tasks %}
+
+ <tr {{ task|task_color }} >
+
+ <td>{{task.order}}</td>
+ <td>
+ <a href="{% url "task" build.pk task.pk %}">{{task.task_name}}</a>
+ {% if task.get_description %}<span class="glyphicon
+ glyphicon-question-sign get-help hover-help"
+ title="{{task.get_description}}"></span>
+ {% endif %}
+ </td>
+
+ <td>{{task.get_executed_display}}</td>
+
+ <td>{{task.get_outcome_display}}
+ {% if task.outcome = task.OUTCOME_FAILED %}
+ <a href="{% url 'build_artifact' build.pk "tasklogfile" task.pk %}">
+ <span class="glyphicon glyphicon-download-alt
+ get-help" title="Download task log
+ file"></span>
+ </a>
+ {% endif %}
+ <i class="icon-question-sign get-help hover-help" title="{{task.get_outcome_help}}"></i>
+ </td>
+ <td>
+ {% ifnotequal task.sstate_result task.SSTATE_NA %}
+ {{task.get_sstate_result_display}}
+ {% endifnotequal %}
+ </td>
+
+ </tr>
+
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% endif %}
+ </div>
+ <div class="tab-pane {{tab_states.3}}" id="dependencies">
+
+ {% if not object.r_dependencies_recipe.all %}
+ <div class="alert alert-info">
+ <strong>{{object.name}}_{{object.version}}</strong> has no build dependencies.
+ </div>
+ {% else %}
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>
+ Recipe
+ </th>
+ <th>
+ Version
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+
+ {% for rr in object.r_dependencies_recipe.all|dictsort:"depends_on.name" %}
+ <tr>
+ <td><a href="{% url "recipe" build.pk rr.depends_on.pk %}">{{rr.depends_on.name}}</a>
+ {% if rr.via %}
+ <span class="text-muted">satisfied via <code class="text-muted">{{rr.via.name}}</code></span>
+ <span class="glyphicon glyphicon-question-sign get-help hover-help"
+ title="This dependency is satisfied by the PROVIDES value
+ <code>{{rr.via.name}}</code> in the <code>{{rr.depends_on.name}}</code> recipe"></span>
+ {% endif %}
+ </td>
+ <td>{{rr.depends_on.version}}</td>
+ </tr>
+ {% endfor %}
+
+ </tbody>
+ </table>
+ {% endif %}
+
+ </div>
+ <div class="tab-pane {{tab_states.4}}" id="brought-in-by">
+
+ {% if not object.r_dependencies_depends.all %}
+ <div class="alert alert-info">
+ <strong>{{object.name}}_{{object.version}}</strong> has no reverse build dependencies.
+ </div>
+ {% else %}
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ <th>
+ Recipe
+ </th>
+ <th>
+ Version
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+
+ {% for rr in object.r_dependencies_depends.all|dictsort:"recipe.name" %}
+ <tr>
+ <td><a href="{% url "recipe" build.pk rr.recipe.pk %}">{{rr.recipe.name}}</a>
+ {% if rr.via %}
+ <span class="text-muted"> satisfied via <code class="text-muted">{{rr.via.name}}</code></span>
+ <span class="glyphicon glyphicon-question-sign get-help hover-help"
+ title="This dependency is satisfied by the PROVIDES value
+ <code>{{rr.via.name}}</code> in the <code>{{rr.depends_on.name}}</code> recipe"></i>
+ {% endif %}
+ </td>
+ <td>{{rr.recipe.version}}</td>
+ </tr>
+ {% endfor %}
+
+ </tbody>
+ </table>
+ {% endif %}
+
+ </div>
+ </div>
+</div>
+
+<div class="col-md-4">
+ <div class="well">
+ <h2>About {{object.name}}</h2>
+ <dl class="item-info">
+ {% if object.summary %}
+ <dt>Summary</dt>
+ <dd>{{object.summary}}</dd>
+ {% endif %}
+ {% if object.description %}
+ <dt>Description</dt>
+ <dd>{{object.description}}</dd>
+ {% endif %}
+ {% if object.homepage %}
+ <dt>Homepage</dt>
+ <dd><a href="{{object.homepage}}">{{object.homepage}}</a></dd>
+ {% endif %}
+ {% if object.bugtracker %}
+ <dt>Bugtracker</dt>
+ <dd><a href="{{object.bugtracker}}">{{object.bugtracker}}</a></dd>
+ {% endif %}
+ {% if object.section %}
+ <dt>
+ Section
+ <span class="glyphicon glyphicon-question-sign get-help" title="The section in which recipes should be categorized"></span>
+ </dt>
+ <dd>{{object.section}}</dd>
+ {% endif %}
+ {% if object.license %}
+ <dt>License</dt>
+ <dd>{{object.license}}</dd>
+ {% endif %}
+ </dl>
+ </div>
+</div>
+
+</div> <!-- end row -->
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html b/poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
new file mode 100644
index 000000000..0ee0ba559
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/recipe_btn.html
@@ -0,0 +1,23 @@
+<a data-recipe-name="{{data.name}}" class="btn btn-default btn-block layer-exists-{{data.layer_version.pk}} build-recipe-btn" style="margin-top: 5px;
+ {% if data.layer_version.pk not in extra.current_layers %}
+ display:none;
+ {% endif %}"
+ >
+ Build recipe
+</a>
+<a class="btn btn-default btn-block layerbtn layer-add-{{data.layer_version.pk}}"
+ data-layer='{
+ "id": {{data.layer_version.pk}},
+ "name": "{{data.layer_version.layer.name}}",
+ "layerdetailurl": "{%url "layerdetails" extra.pid data.layer_version.pk%}",
+ "xhrLayerUrl": "{% url "xhr_layer" extra.pid data.layer_version.pk %}"
+ }' data-directive="add"
+ {% if data.layer_version.pk in extra.current_layers %}
+ style="display:none;"
+ {% endif %}
+>
+ <span class="glyphicon glyphicon-plus"></span>
+ Add layer
+ <span class="glyphicon glyphicon-question-sign get-help" title="To build this
+ recipe you must first add the {{data.layer_version.layer.name}} layer to your project"></i>
+</a>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html b/poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html
new file mode 100644
index 000000000..37a586f38
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/recipe_packages.html
@@ -0,0 +1,135 @@
+{% extends "basebuilddetailpage.html" %}
+
+{% load projecttags %}
+{% load humanize %}
+{% block localbreadcrumb %}
+<li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
+<li>{{recipe.name}}_{{recipe.version}} </li>
+{% endblock %}
+
+{% block pagedetailinfomain %}
+
+<!-- Begin container -->
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="page-header build-data">
+ <h1>{{recipe.name}}_{{recipe.version}}</h1>
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-md-8 tabbable">
+ <ul class="nav nav-tabs">
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "1" %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Build-related
+ information about the recipe"></span>
+ Recipe details
+ </a>
+ </li>
+ <li class="active">
+ <a href="#packages-built" data-toggle="tab">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The packaged
+ output resulting from building the recipe"></span>
+ Packages ({{object_count}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "3" %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The recipe
+ build-time dependencies (i.e. other recipes)"></span>
+ Build dependencies ({{recipe.r_dependencies_recipe.all.count}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url "recipe" build.pk recipe.id "4" %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The recipe
+ build-time reverse dependencies (i.e. the recipes that
+ depend on this recipe)"></span>
+ Reverse build dependencies ({{recipe.r_dependencies_depends.all.count}})
+ </a>
+ </li>
+ </ul>
+ <div class="tab-content">
+{# <div class="tab-pane active" id="packages-built" name="packages-built">#}
+ <div class="tab-pane active" id="packages-built">
+ {% if not objects and not request.GET.search %}
+ <div class="alert alert-info">
+ <strong>{{recipe.name}}_{{recipe.version}}</strong> does not build any packages.
+ </div>
+
+ {% elif not objects %}
+ {# have empty search results, no table nor pagination #}
+ {% with "packages" as search_what %}
+ {% include "detail_search_header.html" %}
+ {% endwith %}
+
+ {% else %}
+
+
+ {% with "packages" as search_what %}
+ {% include "detail_search_header.html" %}
+ {% endwith %}
+ <table class="table table-bordered table-hover tablesorter" id="otable">
+ {% include "detail_sorted_header.html" %}
+
+ <tbody>
+ {% for package in objects %}
+
+ <tr>
+ <td><a href="{% url "package_built_detail" build.pk package.pk %}">{{package.name}}</a></td>
+ <td>{{package.version}}_{{package.revision}}</td>
+ <td class="sizecol">{{package.size|filtered_filesizeformat}}</td>
+ </tr>
+
+ {% endfor %}
+
+ {% endif %}
+ {% if objects %}
+ </tbody>
+ </table>
+ {% include "detail_pagination_bottom.html" %}
+ {% endif %}
+ </div> {# tab-pane #}
+ </div> {# tab-content #}
+</div> {# col-md-8 #}
+
+<div class="col-md-4">
+ <div class="well">
+ <h2>About {{recipe.name}}</h2>
+ <dl class="item-info">
+ {% if recipe.summary %}
+ <dt>Summary</dt>
+ <dd>{{recipe.summary}}</dd>
+ {% endif %}
+ {% if recipe.description %}
+ <dt>Description</dt>
+ <dd>{{recipe.description}}</dd>
+ {% endif %}
+ {% if recipe.homepage %}
+ <dt>Homepage</dt>
+ <dd><a href="{{recipe.homepage}}">{{recipe.homepage}}</a></dd>
+ {% endif %}
+ {% if recipe.bugtracker %}
+ <dt>Bugtracker</dt>
+ <dd><a href="{{recipe.bugtracker}}">{{recipe.bugtracker}}</a></dd>
+ {% endif %}
+ {% if recipe.section %}
+ <dt>
+ Section
+ <i class="icon-question-sign get-help" title="The section in which recipes should be categorized"></i>
+ </dt>
+ <dd>{{recipe.section}}</dd>
+ {% endif %}
+ {% if recipe.license %}
+ <dt>License</dt>
+ <dd>{{recipe.license}}</dd>
+ {% endif %}
+ </dl>
+ </div>
+</div>
+
+</div> <!-- end row -->
+{% endblock pagedetailinfomain %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html b/poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html
new file mode 100644
index 000000000..66c1f7bcd
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/recipedetails.html
@@ -0,0 +1,175 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+{% block pagecontent %}
+
+<ul class="breadcrumb">
+ <li>
+ <a href="{% url 'project' project.id %}">{{project.name}}</a>
+ <span class="divider">&rarr;</span>
+ </li>
+ <li>
+ {% if recipe.is_image %}
+ <a href="{% url 'projectimagerecipes' project.id %}">Image recipes</a>
+ {% else %}
+ <a href="{% url 'projectsoftwarerecipes' project.id %}">Software recipes</a>
+ {% endif %}
+ <span class="divider">&rarr;</span>
+ </li>
+ <li class="active">
+ {{recipe.name}} ({{recipe.layer_version.layer.name}})
+ </li>
+</ul>
+
+<script src="{% static 'js/recipedetails.js' %}"></script>
+<script>
+ $(document).ready(function (){
+ var ctx = {
+ recipe : {
+ id: {{recipe.pk}},
+ name: "{{recipe.name}}",
+ totalPackages: {{packages.count}},
+ layer_version : {
+ id: {{recipe.layer_version.pk}},
+ name: "{{recipe.layer_version.layer.name}}",
+ layerdetailurl: "{% url 'layerdetails' project.pk recipe.layer_version.pk %}"
+ }
+ }
+ };
+
+ try {
+ recipeDetailsPageInit(ctx);
+ } catch (e) {
+ document.write("Sorry, An error has occurred loading this page");
+ console.warn(e);
+ }
+ });
+</script>
+
+{% include 'newcustomimage_modal.html' %}
+
+<div class="alert alert-success lead" id="image-created-notification" style="margin-top: 15px; display: none">
+ <button type="button" data-dismiss="alert" class="close">x</button>
+ Your custom image <strong>{{recipe.name}}</strong> has been created. You can now add or remove packages as needed.
+</div>
+<div class="page-header">
+ <h1>
+ {{recipe.name}}
+ <small>({{recipe.layer_version.layer.name}})</small>
+ </h1>
+</div>
+
+<div class="row">
+ <div class="col-md-8">
+ <div class="button-place btn-group" id="customise-build-btns"
+ style="width: 100%;
+ {% if not in_project %}
+ display:none;
+ {% endif %}">
+ <button class="btn btn-default btn-lg build-recipe-btn" style="width: 50%">
+ Build {{recipe.name}}
+ </button>
+ {% if recipe.is_image %}
+ <button class="btn btn-default btn-lg customise-btn" data-recipe="{{recipe.pk}}" style="width: 50%">
+ Customise {{recipe.name}}
+ </button>
+ {% endif %}
+ </div>
+ <div class="button-place">
+ <button class="btn btn-default btn-block btn-lg" id="add-layer-btn"
+ style="width:100%;
+ {% if in_project %}
+ display:none;
+ {% endif %}">
+ <i class="glyphicon glyphicon-plus"></i>
+ Add the {{recipe.layer_version.layer.name}} layer to your project to build or customise this image recipe
+ </button>
+ </div>
+
+ <div id="packages-table">
+ {% if packages.count %}
+ {% url 'recipepackages' project.id recipe.id as xhr_table_url %}
+ <h2>{{title}} (<span class="table-count-{{table_name}}">0</span>) </h2>
+ {% include "toastertable.html" %}
+ {% else %}
+ <h2>{{title}}</h2>
+ {% endif %}
+
+ <div class="alert alert-info air" id="build-to-get-packages-msg"
+ {# if there are packages and it's in the project don't show this msg #}
+ {% if packages.count or not packages.count and not in_project %}
+ style="display:none"
+ {% endif %} >
+ <p class="lead">Toaster has no package information for {{recipe.name}}. To generate package information, build {{recipe.name}}</p>
+ <button class="btn btn-info btn-lg build-recipe-btn" style="margin:20px 0 10px 0;">Build {{recipe.name}}</button>
+ </div>
+
+ <div class="alert alert-info air" id="packages-alert"
+ {% if packages.count or in_project %}
+ style="display:none"
+ {% endif %}
+ >
+ <p class="lead">Toaster has no package information for {{recipe.name}}
+ </p>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="well">
+ <h2>About {{recipe.name}}</h2>
+ <dl class="item-info">
+ <dt>
+ Approx. packages included
+ <span class="glyphicon glyphicon-question-sign get-help" title="The number of packages included is based on information from previous builds and from parsing layers, so we can never be sure it is 100% accurate"></span>
+ </dt>
+ <dd class="no-packages">{{packages.count}}</dd>
+ <dt>
+ Approx. package size
+ <span class="glyphicon glyphicon-question-sign get-help" title="Package size is based on information from previous builds, so we can never be sure it is 100% accurate"></span>
+ </dt>
+ <dd>{{approx_pkg_size.size__sum|filtered_filesizeformat}}</dd>
+ {% if last_build %}
+ <dt>Last build</dt>
+ <dd>
+ <span class="glyphicon glyphicon-ok-circle"></span>
+ <a href="{% url 'projectbuilds' project.id%}">{{last_build.completed_on|date:"d/m/y H:i"}}</a>
+ </dd>
+ {% endif %}
+ <dt>Recipe file</dt>
+ <dd>
+ <code>{{recipe.file_path|cut_path_prefix:recipe.layer_version.local_path}}</code>
+ <a href="{{recipe.get_vcs_recipe_file_link_url}}"><span class="glyphicon glyphicon-new-window" title="View recipe file" data-toggle="tooltip"></span></a>
+ </dd>
+ <dt>Layer</dt>
+ <dd><a href="{% url 'layerdetails' project.id recipe.layer_version.pk %}">{{recipe.layer_version.layer.name}}</a></dd>
+ <dt>
+ Summary
+ </dt>
+ <dd>
+ {{recipe.summary}}
+ </dd>
+ <dt>
+ Description
+ </dt>
+ <dd>
+ {{recipe.description}}
+ </dd>
+ <dt>Version</dt>
+ <dd>
+ {{recipe.version}}
+ </dd>
+ <dt>Section</dt>
+ <dd>
+ {{recipe.section}}
+ </dd>
+ <dt>License</dt>
+ <dd>
+ {{recipe.license}}
+ </dd>
+ </dl>
+ </div>
+ </div>
+</div>
+
+{% endblock %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html b/poky/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html
new file mode 100644
index 000000000..c1e3dabfb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/snippets/gitrev_popover.html
@@ -0,0 +1,8 @@
+{% load projecttags %}
+{% if vcs_ref|is_shaid %}
+<a class="btn btn-default" data-content="{{vcs_ref}}">
+ {{vcs_ref|truncatechars:10}}
+</a>
+{% else %}
+{{vcs_ref}}
+{% endif %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html b/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
new file mode 100644
index 000000000..273437e38
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_dependencies_popover.html
@@ -0,0 +1,38 @@
+{# Popover that displays the dependences and sizes of a package 'data' used in the Packages table #}
+{% load projecttags %}
+
+{% with package_deps=data.package_dependencies_source|for_target:extra.target_name %}
+{% with count_package=package_deps.packages|length %}
+
+{% if count_package > 0 %}
+ <a data-content='<ul class="list-unstyled">
+ {% for dep in package_deps.packages %}
+ <li>
+ {% if extra.add_links %}
+ <a href="{% url 'package_included_detail' extra.build.pk extra.target_id dep.depends_on.pk %}">
+ {{dep.depends_on.name}}</a>
+ {% else %}
+ {{dep.depends_on.name}}
+ {% endif %}
+ {% if dep.depends_on.size > 0 %}
+ ({{dep.depends_on.size|filtered_filesizeformat}})
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>' class="btn btn-default" title='
+ <strong>
+ {% if extra.add_links %}
+ <a href="{% url 'package_included_dependencies' extra.build.pk extra.target_id data.pk %}">
+ {{data.name}}</a>
+ {% else %}
+ {{data.name}}
+ {% endif %}
+ </strong>
+ dependencies -
+ <strong>{{package_deps.size|filtered_filesizeformat}}</strong>'>
+ {{count_package}}
+ </a>
+{% endif %}
+
+{% endwith %}
+{% endwith %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html b/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
new file mode 100644
index 000000000..e6ef816e7
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/snippets/pkg_revdependencies_popover.html
@@ -0,0 +1,38 @@
+{# Popover that displays the reverse dependences and sizes of a package 'data' used in the Packages table #}
+{% load projecttags %}
+
+{% with package_deps=data.package_dependencies_target|for_target:extra.target_name %}
+{% with count_package=package_deps.packages|length %}
+
+{% if count_package > 0 %}
+ <a data-content='<ul class="list-unstyled">
+ {% for dep in package_deps.packages|dictsort:"package.name" %}
+ <li>
+ {% if extra.add_links %}
+ <a href="{% url 'package_included_detail' extra.build.pk extra.target_id dep.package.pk %}">
+ {{dep.package.name}}</a>
+ {% else %}
+ {{dep.package.name}}
+ {% endif %}
+ {% if dep.package.size > 0 %}
+ ({{dep.package.size|filtered_filesizeformat}})
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>' class="btn btn-default" title='
+ <strong>
+ {% if extra.add_links %}
+ <a href="{% url 'package_included_reverse_dependencies' extra.build.pk extra.target_id data.pk %}">
+ {{data.name}}</a>
+ {% else %}
+ {{data.name}}
+ {% endif %}
+ </strong>
+ dependencies -
+ <strong>{{package_deps.size|filtered_filesizeformat}}</strong>'>
+ {{count_package}}
+ </a>
+{% endif %}
+
+{% endwith %}
+{% endwith %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/tablesort.html b/poky/bitbake/lib/toaster/toastergui/templates/tablesort.html
new file mode 100644
index 000000000..362474293
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/tablesort.html
@@ -0,0 +1,38 @@
+{% load projecttags %}
+<!-- component to display a generic table -->
+ {% if disable_sort %}
+ <table class="table table-bordered table-hover" id="detail_table">
+ <thead>
+ <tr>
+ {% for tc in tablecols %}
+ <th class="{%if tc.dclass%}{{tc.dclass}}{%endif%} {%if tc.clclass%}{{tc.clclass}}{%endif%}">
+ {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%}
+ {{tc.name}}
+ </th>
+ {% endfor %}
+ </tr>
+ </thead>
+ {% else %}
+ <table class="table table-bordered table-hover tablesorter" id="otable">
+ <thead>
+ <!-- Table header row; generated from "tablecols" entry in the context dict -->
+ <tr>
+ {% for tc in tablecols %}
+ <th class="{%if tc.dclass%}{{tc.dclass}}{%endif%} {%if tc.clclass%}{{tc.clclass}}{%endif%}">
+ {%if tc.qhelp%}<i class="icon-question-sign get-help" title="{{tc.qhelp}}"></i>{%endif%}
+ {%if tc.orderfield%}
+ <a {%if tc.ordericon%} class="sorted" {%endif%}
+ href="javascript:reload_params({'page': 1, 'orderby' : '{{tc.orderfield}}' })" >
+ {{tc.name}}
+ </a>
+ {%else%}
+ <span class="muted">
+ {{tc.name}}
+ </span>
+ {%endif%}
+ {%if tc.ordericon%} <i class="icon-caret-{{tc.ordericon}}"></i>{%endif%}
+ </th>
+ {% endfor %}
+ </tr>
+ </thead>
+ {% endif %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/target.html b/poky/bitbake/lib/toaster/toastergui/templates/target.html
new file mode 100644
index 000000000..1924a0dad
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/target.html
@@ -0,0 +1,56 @@
+{% extends "basebuildpage.html" %}
+{% block title %} Packages included - {{ target.target }} {{ target.build.machine }} - {{ target.build.project.name }} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li>{{target.target}}</li>
+{% endblock localbreadcrumb%}
+
+{% load projecttags %}
+
+{% block nav-target %}
+ {% for t in build.get_sorted_target_list %}
+ {% ifequal target.pk t.pk %}
+ <li class="active"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% else %}
+ <li><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
+ {% endifequal %}
+ {% endfor %}
+{% endblock %}
+
+{% block buildinfomain %}
+<div class="col-md-10">
+ <div class="page-header build-data">
+ <h1>
+ {% if request.GET.search and objects.paginator.count > 0 %}
+ {{objects.paginator.count}} package{{objects.paginator.count|pluralize}} found
+ {% elif request.GET.search and objects.paginator.count == 0 %}
+ No packages found
+ {% else %}
+ {{target.target}}
+ {% endif %}
+ </h1>
+ </div>
+<div id="navTab">
+ <ul class="nav nav-tabs">
+ <li class="active">
+ <a href="#target">
+ <span class="glyphicon glyphicon-question-sign get-help" title="Of all the packages built, the subset installed in the root file system of this image"></span>
+ Packages included ({{target.package_count}} - {{packages_sum|filtered_filesizeformat}})
+ </a>
+ </li>
+ <li>
+ <a href="{% url 'dirinfo' build.id target.id %}">
+ <span class="glyphicon glyphicon-question-sign get-help" title="The directories and files in the root file system of this image"></span>
+ Directory structure
+ </a>
+ </li>
+ </ul>
+
+ <div id="image-packages" class="tab-pane">
+ {# xhr_table_url is just the current url so leave it blank #}
+ {% with xhr_table_url='' %}
+ {% include "toastertable.html" %}
+ {% endwith %}
+ </div> <!-- tabpane -->
+ </div> <!--navTab -->
+<!-- col-md-10 -->
+{% endblock buildinfomain %}
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/task.html b/poky/bitbake/lib/toaster/toastergui/templates/task.html
new file mode 100644
index 000000000..214c77783
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/task.html
@@ -0,0 +1,348 @@
+{% extends "basebuilddetailpage.html" %}
+
+{% load projecttags %}
+{% load humanize %}
+
+{% block title %} {{task.recipe.name}}_{{task.recipe.version}} {{task.task_name}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
+{% block localbreadcrumb %}
+<li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
+<li>{{task.recipe.name}}_{{task.recipe.version}} {{task.task_name}}</li>
+{% endblock %}
+
+{% block pagedetailinfomain %}
+
+<div class="row">
+ <div class="col-md-12">
+ <div class="page-header build-data">
+ <h1><a href="{%url 'recipe' build.pk task.recipe.pk %}">{{task.recipe.name}}_{{task.recipe.version}}</a> {{task.task_name}}</h1>
+ </div>
+
+{# Outcome section #}
+<h2 {{ task|task_color:True }}>
+ {{task.get_outcome_display}}
+ <span class="glyphicon glyphicon-question-sign get-help" title="{{task.get_outcome_help}}"></i>
+</h2>
+{%if task.task_executed %}
+ {# executed tasks outcome #}
+ {% if task.logfile %}
+ <a class="btn btn-default btn-lg"
+ href="{% url 'build_artifact' build.id 'tasklogfile' task.pk %}">
+ Download task log
+ </a>
+ {% endif %}
+ {# show stack trace for failed task #}
+ {% if task.outcome == task.OUTCOME_FAILED and log_head %}
+ <h3>Python stack trace</h3>
+ <div>
+ <pre style="min-height:160px;">
+ <code>{{log_head}}</code><a id="full-trace-show" data-target="#fulltrace" data-toggle="collapse" class="btn btn-xs">...</a>
+ <div id="fulltrace" class="collapse" style="margin-top: -20px; height: 0px;">
+ <code>{{log_body}}</code><br><a id="full-trace-hide" class="btn btn-xs collapsed" style="font-family:Helvetica Neue" data-target="#fulltrace" data-toggle="collapse">Collapse stack trace<i class="icon-caret-up"></i></a></div></pre>
+ </div>
+ {% endif %}
+{% else %}
+{# not executed tasks outcome #}
+ {% if task.outcome == task.OUTCOME_PREBUILT %}
+ {% if not showing_matches %}
+ <a class="btn btn-default"
+ href="javascript:reload_params({'show_matches' : 'true'
+ })">Match to tasks in previous builds <span class="glyphicon
+glyphicon-question-sign get-help" title="This shows you a list of tasks from
+previous builds with the same signature generated from the same inputs as used
+in the prebuilt task. Any of them could be the task that generated the output
+this prebuilt task is reusing"></span></a>
+ {% elif matching_tasks %}
+ <h3 class="details">Prebuilt task could be based on
+ <span class="glyphicon glyphicon-question-sign get-help" title="This
+ table shows a list of tasks from previous builds with the
+ same signature generated from the same inputs as used in the
+ prebuilt task. Any of them could be the task that generated the
+ output this prebuilt task is reusing"></span>
+ </h3>
+ <div class="table-responsive">
+ <table class="table table-bordered table-hover">
+ <thead>
+ <th>
+ <span class="glyphicon glyphicon-question-sign
+ get-help" title="The name of the recipe to which
+ each task applies"></span>
+ Recipe
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name
+ of the task"></span>
+ Task
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign get-help" title="This
+ value tells you if a task had to run (executed) in
+ order to generate the task output, or if the output was
+ provided by another task and therefore the task didn't need
+ to run (not executed)"></span>
+ Executed
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign
+ get-help" title="This column tells you if
+ 'executed' tasks succeeded or failed. The column also
+ tells you why 'not executed' tasks did not need to
+ run"></span>
+ Outcome
+ </th>
+ <th>
+ <span class="glyphicon glyphicon-question-sign
+ get-help" title="The date and time the build
+ finished"></span>
+ Build completed on
+ </th>
+ </thead>
+ <tbody>
+ {% for match in matching_tasks %}
+ <tr {{ match|task_color }}>
+ <td>
+ {{match.recipe.name}}
+ </td>
+ <td>
+ <a href="{%url "task" match.build.pk match.pk%}">{{match.task_name}}</a>
+ {% if task.get_description %}
+ <span class="glyphicon
+ glyphicon-question-sign get-help
+ hover-help"
+ title="{{task.get_description}}"></span>
+ {% endif %}
+ </td>
+ <td>
+ {{match.get_executed_display}}
+ </td>
+ <td>
+ {{match.get_outcome_display}}
+ <span class="glyphicon glyphicon-question-sign
+ get-help hover-help"
+ title="{{match.get_outcome_help}}"></span>
+ </td>
+ <td>
+ {{match.build.completed_on|date:"d/m/y H:i"}}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ {% else %}
+ <p class="alert">
+ <strong> We have found no tasks matching this prebuilt task</strong><br/>
+ The task you are looking for could belong to a build for which Toaster has no data.
+ </p>
+ {% endif %}
+ {% elif task.outcome == task.OUTCOME_COVERED %}
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The task(s)
+ providing the outcome of this task"></span> Task covered by
+ </dt>
+ <dd>
+ <ul class="list-unstyled">
+ {% for t in covered_by %}
+ <li>
+ <a href="{%url 'task' t.build.pk t.pk%}"
+ class="task-info"
+ title="{{t.get_executed_display}} | {{t.get_outcome_display}}">
+ {{t.recipe.name}}_{{t.recipe.version}}
+ {{t.task_name}}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ </dd>
+ </dl>
+ {%elif task.outcome == task.OUTCOME_CACHED%}
+ {% for t in task.get_related_setscene %}
+ {% if forloop.last %}
+ <a class="btn btn-default btn-lg"
+ href="{% url 'build_artifact' build.id "tasklogfile" t.pk %}">
+ Download task log
+ </a>
+ {% endif %}
+ {% endfor %}
+
+ {%elif task.outcome == task.OUTCOME_EMPTY%}
+ <div class="alert alert-info details">
+ This task is empty because it has the <code>noexec</code> flag set to <code>1</code>, or the task function is empty
+ </div>
+ {% endif %}
+{% endif %}
+
+{# Execution section #}
+ {% if task.task_executed %}
+ <h2>
+ Executed
+ <span class="glyphicon glyphicon-question-sign get-help"
+ title="'Executed' tasks are those that need to run in order to
+ generate the task output"></span>
+ {% else %}
+ <h2>
+ Not Executed
+ <span class="glyphicon glyphicon-question-sign get-help" title="'Not
+ executed' tasks don't need to run because their outcome is provided
+ by another task"></span>
+ {% endif %}
+ </h2>
+
+<dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="To make builds more
+ efficient, the build system detects changes in the 'inputs' to a
+ given task by creating a 'task signature'. If the signature changes,
+ the build system assumes the inputs have changed and the task needs to be
+rerun"></span>
+ Task inputs signature
+ </dt>
+ <dd>
+ {{task.sstate_checksum}}
+ </dd>
+ {% if task.sstate_result != task.SSTATE_NA %}
+ </dl>
+ <div class="alert alert-info">Attempting to restore output from sstate cache
+ <span class="glyphicon glyphicon-question-sign get-help
+ get-help-blue" title="The build system is searching for the
+ task output in your <code>sstate-cache</code> directory and
+ mirrors. If the build system finds the task output, it will reuse it
+ instead of building it from scratch by running the real task. Reusing the
+ task output makes the build faster"></span>
+ </div>
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The name of the
+ file searched for in your <code>sstate-cache</code>
+ directory and mirrors"></span>
+ File searched for
+ </dt>
+ <dd><code>{{task.path_to_sstate_obj}}</code></dd>
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The locations
+ searched for the above file (i.e. your
+ <code>sstate-cache</code> directory and any mirrors you have
+ set up)"></span>
+ URI(s) searched
+ </dt>
+ <dd><ul class="list-unstyled">{% for uri in uri_list %}<li><code>{{uri}}</code></li>{% endfor %}</ul></dd>
+ </dl>
+ {% endif %}
+ {% if task.sstate_result == task.SSTATE_MISS %}
+ <div class="alert alert-info">
+ <strong>File not in sstate cache.</strong> Running the real task instead.
+ </div>
+ {% elif task.sstate_result == task.SSTATE_FAILED%}
+ <div class="alert alert-warning">
+ <strong>Failed</strong> to restore output from sstate cache. The file was found but could not be unpacked.
+ </div>
+ <dl class="dl-horizontal">
+ <a href="{% url 'build_artifact' build.id "tasklogfile" task.pk %}" style="margin:15px;">Download log</a>
+ </dl>
+ <div class="alert alert-info">
+ Running the real task instead.
+ </div>
+ {% elif task.sstate_result == task.SSTATE_RESTORED %}
+ <div class="alert alert-info">
+ Output <strong>successfully restored</strong> from sstate cache.
+ </div>
+ {% endif %}
+ <dl class="dl-horizontal">
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="The
+ running sequence of each task in the build"></span>
+ Task order
+ </dt>
+ <dd><a href="{%url "tasks" build.pk %}?page={{task_in_tasks_table_pg}}&limit=25#task-{{task.order}}">{{task.order}}</a></dd>
+ {% if task.task_executed %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help"
+ title="Indicates if this task executes a Python or Shell
+ function(s)"></span>
+ Task script type
+ </dt>
+ <dd>{{task.get_script_type_display}}</dd>
+ {% endif %}
+<!--
+ <dt>
+ <i class="icon-question-sign get-help" title="The code executed by the task"></i>
+ Task executable output
+ </dt>
+ <dd><code>{{task.source_url}}</code></dd>
+-->
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Task dependency chain
+ (i.e. other tasks)"></span>
+ Dependencies
+ </dt>
+ <dd>
+ <ul class="list-unstyled">
+ {% for dep in deps %}
+ <li><a href="{%url 'task' dep.build.pk dep.pk%}" class="task-info" title="{{dep.get_executed_display}} | {{dep.get_outcome_display}}">{{dep.recipe.name}}_{{dep.recipe.version}} <span class="task-name">{{dep.task_name}}</span></a></li>
+ {% empty %}
+ <li class="text-muted" style="margin-bottom: -10px;">This task has no dependencies</li>
+ {% endfor %}
+ </ul>
+ </dd>
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Tasks that depend on this
+ task"></span>
+ Reverse dependencies
+ </dt>
+ <dd>
+ <ul class="list-unstyled">
+ {% for dep in rdeps %}
+ <li><a href="{%url 'task' dep.build.pk dep.pk%}" class="task-info" title="{{dep.get_executed_display}} | {{dep.get_outcome_display}}">{{dep.recipe.name}}_{{dep.recipe.version}} <span class="task-name">{{dep.task_name}}</span></a></li>
+ {% empty %}
+ <li class="text-muted">This task has no reverse dependencies</li>
+ {% endfor %}
+ </ul>
+</dl>
+
+{# Performance section - shown only for executed tasks #}
+{%if task.elapsed_time or task.cpu_time_user or task.cpu_time_system or task.disk_io %}
+ <h2 class="details">Performance</h2>
+{% endif %}
+ <dl class="dl-horizontal">
+ {% if task.elapsed_time %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="How
+ long it took the task to finish in seconds"></span>
+ Time (secs)
+ </dt>
+ <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd>
+ {% endif %}
+ {% if task.cpu_time_user > 0 %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Total amount of time
+ spent executing in user mode, in seconds. Note that this time
+ can be greater than the task time due to parallel
+ execution."></span>
+ User CPU time (secs)
+ </dt>
+ <dd>{{task.cpu_time_user|format_none_and_zero|floatformat:2}}</dd>
+ {% endif %}
+ {% if task.cpu_time_system > 0 %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Total amount of time
+ spent executing in kernel mode, in seconds. Note that this time
+ can be greater than the task time due to parallel
+ execution."></span>
+ System CPU time (secs)
+ </dt>
+ <dd>{{task.cpu_time_system|format_none_and_zero|floatformat:2}}</dd>
+ {% endif %}
+ {% if task.disk_io > 0 %}
+ <dt>
+ <span class="glyphicon glyphicon-question-sign get-help" title="Number of bytes
+ written to and read from the disk during the task"></span>
+ Disk I/O (bytes)
+ </dt>
+ <dd>{{task.disk_io|format_none_and_zero|intcomma}}</dd>
+ {% endif %}
+ </dl>
+
+</div>
+
+{% endblock %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html b/poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html
new file mode 100644
index 000000000..25eef52a3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/toastertable-filter.html
@@ -0,0 +1,24 @@
+<!-- filter modal -->
+<div id="filter-modal-{{table_name}}" class="modal fade" tabindex="-1" role="dialog" aria-hidden="false">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
+ <h3 id="filter-modal-title-{{table_name}}">&nbsp;</h3>
+ </div>
+ <div class="modal-body">
+ <form id="filter-modal-form-{{table_name}}" style="margin-bottom: 0px">
+ <p>Show:</p>
+ <span id="filter-actions-{{table_name}}"></span>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-primary" type="submit" data-role="filter-apply">
+ Apply
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+</div>
+<button id="clear-filter-btn-{{table_name}}" style="display:none"></button>
+<!-- end filter modal -->
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html b/poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html
new file mode 100644
index 000000000..56cd2ce37
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/toastertable-simple.html
@@ -0,0 +1,100 @@
+
+{% load static %}
+{% load projecttags %}
+
+<script src="{% static 'js/table.js' %}"></script>
+<script src="{% static 'js/layerBtn.js' %}"></script>
+<script>
+ $(document).ready(function() {
+ (function(){
+
+ var ctx = {
+ tableName : "{{table_name}}",
+ url : "{{ xhr_table_url }}?format=json",
+ title : "{{title}}",
+ projectLayers : {{projectlayers|json}},
+ };
+
+ try {
+ tableInit(ctx);
+ } catch (e) {
+ document.write("Problem loading table widget: " + e);
+ }
+ })();
+ });
+</script>
+
+{% include 'toastertable-filter.html' %}
+
+<div id="no-results-{{table_name}}" style="display:none">
+ <div class="alert alert-warning">
+ <form class="no-results form-inline">
+ <div class="form-group">
+ <div class="btn-group">
+ <input class="form-control" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></span>
+ </div>
+ </div>
+ <button class="btn btn-default search-submit-{{table_name}}">Search</button>
+ <button class="btn btn-link remove-search-btn-{{table_name}}">Show all {{title|lower}}</button>
+ </form>
+ </div>
+</div>
+<div id="table-container-{{table_name}}" style="visibility: hidden">
+ <!-- control header -->
+ <div id="table-chrome-{{table_name}}">
+ <div class="container-fluid detail-page-contols">
+ <form class="navbar-form navbar-left">
+ <div class="form-group">
+ <div class="btn-group">
+ <input class="form-control" id="search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{% if request.GET.search %}{{request.GET.search}}{% endif %}"/>
+ <span href="#" style="display:none" class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></span>
+ </div>
+ </div>
+ <button class="btn btn-default" id="search-submit-{{table_name}}" >Search</button>
+ </form>
+
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="form-control pagesize-{{table_name}}">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+ </div>
+ </div>
+
+ <!-- The actual table -->
+ <div class="table-responsive">
+ <table class="table table-bordered table-hover" id="{{table_name}}">
+ <thead>
+ <tr><th></th></tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+ </div>
+
+ <!-- Pagination controls -->
+ <div id="pagination-{{table_name}}">
+ <ul class="pagination">
+ </ul>
+
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="form-control pagesize-{{table_name}}">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+ </div>
+</div>
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/toastertable.html b/poky/bitbake/lib/toaster/toastergui/templates/toastertable.html
new file mode 100644
index 000000000..aa148955e
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/toastertable.html
@@ -0,0 +1,125 @@
+
+{% load static %}
+{% load projecttags %}
+
+<script src="{% static 'js/table.js' %}"></script>
+<script src="{% static 'js/layerBtn.js' %}"></script>
+<script>
+ $(document).ready(function() {
+ (function(){
+
+ var ctx = {
+ tableName : "{{table_name}}",
+ url : "{{ xhr_table_url }}?format=json",
+ title : "{{title}}",
+ };
+
+ try {
+ tableInit(ctx);
+ } catch (e) {
+ document.write("Problem loading table widget: " + e);
+ }
+ })();
+ });
+</script>
+
+{% include 'toastertable-filter.html' %}
+
+<div class="row-fluid" id="empty-state-{{table_name}}" style="display:none">
+ <div class="alert alert-info">{{empty_state|safe}}</div>
+</div>
+
+<div id="no-results-{{table_name}}" style="display:none">
+ <div class="alert alert-warning">
+ <form class="form-inline">
+ <div class="form-group">
+ <div class="btn-group">
+ <input class="form-control" id="new-search-input-{{table_name}}" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search %}{{request.GET.search}}{%endif%}"/>
+ <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1"></a>
+ </div>
+ </div>
+ <button class="btn btn-default search-submit-{{table_name}}">
+ Search
+ </button>
+ <button class="btn btn-link show-all-{{table_name}} remove-search-btn-{{table_name}}">
+ Show all
+ </button>
+ </form>
+ </div>
+</div>
+
+<div id="table-container-{{table_name}}" style="visibility: hidden">
+ <!-- control header -->
+ <div class="navbar navbar-default" id="table-chrome-{{table_name}}">
+ <div class="container-fluid">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#table-chrome-collapse-{{table_name}}" aria-expanded="false">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ </div>
+ <div class="collapse navbar-collapse" id="table-chrome-collapse-{{table_name}}">
+ <form class="navbar-form navbar-left">
+ <div class="form-group">
+ <div class="btn-group">
+ <input id="search-input-{{table_name}}" class="form-control" name="search" type="text" placeholder="Search {{title|lower}}" value="{%if request.GET.search%}{{request.GET.search}}{%endif%}"/>
+ <span class="remove-search-btn-{{table_name}} glyphicon glyphicon-remove-circle" tabindex="-1" style="display:none;">
+ </div>
+ </div>
+ <button class="btn btn-default" id="search-submit-{{table_name}}" >Search</button>
+ </form>
+ <form class="navbar-form navbar-right">
+ <div clas="form-group">
+ <label>Show rows:</label>
+ <select class="form-control pagesize-{{table_name}}">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+ <div class="btn-group navbar-right">
+ <button id="edit-columns-button" class="btn btn-default navbar-btn dropdown-toggle" data-toggle="dropdown">Edit columns
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu editcol">
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- The actual table -->
+ <div class="table-responsive">
+ <table class="table table-bordered table-hover" id="{{table_name}}">
+ <thead>
+ <tr><th></th></tr>
+ </thead>
+ <tbody></tbody>
+ </table>
+ </div>
+
+ <!-- Pagination controls -->
+ <div id="pagination-{{table_name}}">
+ <ul class="pagination">
+ </ul>
+
+ <form class="navbar-form navbar-right">
+ <div class="form-group">
+ <label>Show rows:</label>
+ <select class="form-control pagesize-{{table_name}}">
+ {% with "10 25 50 100 150" as list%}
+ {% for i in list.split %}
+ <option value="{{i}}">{{i}}</option>
+ {% endfor %}
+ {% endwith %}
+ </select>
+ </div>
+ </form>
+ </div>
+
+</div> <!--end table container -->
diff --git a/poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html b/poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html
new file mode 100644
index 000000000..fc77e405f
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+{% load projecttags %}
+{% load humanize %}
+{% load static %}
+
+{% block title %} Build artifact does not exist - Toaster {% endblock %}
+
+{% block pagecontent %}
+ <div class="row">
+ <div class="col-md-8">
+ <div class="alert alert-info lead top-air">
+ <p>The build artifact you are trying to download does not exist.</p>
+ <p><a href="javascript:window.history.back()">Back to previous page</a></p>
+ </div>
+ </div>
+ </div>
+{% endblock %}
+
diff --git a/poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py b/poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templatetags/__init__.py
diff --git a/poky/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py b/poky/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py
new file mode 100644
index 000000000..5a73af797
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templatetags/field_values_filter.py
@@ -0,0 +1,18 @@
+from django import template
+
+register = template.Library()
+
+def field_values(iterable, field):
+ """
+ Convert an iterable of models into a list of strings, one for each model,
+ where the string for each model is the value of the field "field".
+ """
+ objects = []
+
+ if field:
+ for item in iterable:
+ objects.append(getattr(item, field))
+
+ return objects
+
+register.filter('field_values', field_values) \ No newline at end of file
diff --git a/poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py b/poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
new file mode 100644
index 000000000..0dcc7d271
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templatetags/objects_to_dictionaries_filter.py
@@ -0,0 +1,35 @@
+from django import template
+import json
+
+register = template.Library()
+
+def objects_to_dictionaries(iterable, fields):
+ """
+ Convert an iterable into a list of dictionaries; fields should be set
+ to a comma-separated string of properties for each item included in the
+ resulting list; e.g. for a queryset:
+
+ {{ queryset | objects_to_dictionaries:"id,name" }}
+
+ will return a list like
+
+ [{'id': 1, 'name': 'foo'}, ...]
+
+ providing queryset has id and name fields
+
+ This is mostly to support serialising querysets or lists of model objects
+ to JSON
+ """
+ objects = []
+
+ if fields:
+ fields_list = [field.strip() for field in fields.split(',')]
+ for item in iterable:
+ out = {}
+ for field in fields_list:
+ out[field] = getattr(item, field)
+ objects.append(out)
+
+ return objects
+
+register.filter('objects_to_dictionaries', objects_to_dictionaries)
diff --git a/poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py b/poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py
new file mode 100644
index 000000000..04770ac6a
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templatetags/project_url_tag.py
@@ -0,0 +1,34 @@
+from django import template
+from django.core.urlresolvers import reverse
+
+register = template.Library()
+
+def project_url(parser, token):
+ """
+ Create a URL for a project's main page;
+ for non-default projects, this is the configuration page;
+ for the default project, this is the project builds page
+ """
+ try:
+ tag_name, project = token.split_contents()
+ except ValueError:
+ raise template.TemplateSyntaxError(
+ "%s tag requires exactly one argument" % tag_name
+ )
+ return ProjectUrlNode(project)
+
+class ProjectUrlNode(template.Node):
+ def __init__(self, project):
+ self.project = template.Variable(project)
+
+ def render(self, context):
+ try:
+ project = self.project.resolve(context)
+ if project.is_default:
+ return reverse('projectbuilds', args=(project.id,))
+ else:
+ return reverse('project', args=(project.id,))
+ except template.VariableDoesNotExist:
+ return ''
+
+register.tag('project_url', project_url)
diff --git a/poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
new file mode 100644
index 000000000..b170a1616
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -0,0 +1,299 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from datetime import datetime, timedelta
+from os.path import relpath
+import re
+from django import template
+from django.utils import timezone
+from django.template.defaultfilters import filesizeformat
+import json as JsonLib
+from django.utils.safestring import mark_safe
+
+register = template.Library()
+
+@register.simple_tag
+def time_difference(start_time, end_time):
+ return end_time - start_time
+
+@register.filter(name = 'sectohms')
+def sectohms(time):
+ try:
+ tdsec = int(time)
+ except ValueError:
+ tdsec = 0
+ hours = int(tdsec / 3600)
+ return "%02d:%02d:%02d" % (hours, int((tdsec - (hours * 3600))/ 60), int(tdsec) % 60)
+
+
+@register.filter(name = 'get_tasks')
+def get_tasks(queryset):
+ return list(target + ':' + task if task else target \
+ for target, task in queryset.values_list('target', 'task'))
+
+
+@register.filter(name = "json")
+def json(value, default = None):
+ # JSON spec says that "\/" is functionally identical to "/" to allow for HTML-tag embedding in JSON strings
+ # unfortunately, I can't find any option in the json module to turn on forward-slash escaping, so we do
+ # it manually here
+ return mark_safe(JsonLib.dumps(value, indent=2, default = default, ensure_ascii=False).replace('</', '<\\/'))
+
+@register.assignment_tag
+def query(qs, **kwargs):
+ """ template tag which allows queryset filtering. Usage:
+ {% query books author=author as mybooks %}
+ {% for book in mybooks %}
+ ...
+ {% endfor %}
+ """
+ return qs.filter(**kwargs)
+
+
+@register.filter("whitespace_slice")
+def whitespace_space_filter(value, arg):
+ try:
+ bits = []
+ for x in arg.split(":"):
+ if len(x) == 0:
+ bits.append(None)
+ else:
+ # convert numeric value to the first whitespace after
+ first_whitespace = value.find(" ", int(x))
+ if first_whitespace == -1:
+ bits.append(int(x))
+ else:
+ bits.append(first_whitespace)
+ return value[slice(*bits)]
+ except (ValueError, TypeError):
+ raise
+
+@register.filter
+def divide(value, arg):
+ if int(arg) == 0:
+ return -1
+ return int(value) // int(arg)
+
+@register.filter
+def multiply(value, arg):
+ return int(value) * int(arg)
+
+@register.assignment_tag
+def datecompute(delta, start = timezone.now()):
+ return start + timedelta(delta)
+
+
+@register.filter(name = 'sortcols')
+def sortcols(tablecols):
+ return sorted(tablecols, key = lambda t: t['name'])
+
+@register.filter
+def task_color(task_object, show_green=False):
+ """ Return css class depending on Task execution status and execution outcome.
+ By default, green is not returned for executed and successful tasks;
+ show_green argument should be True to get green color.
+ """
+ if not task_object.task_executed:
+ return 'class=text-muted'
+ elif task_object.outcome == task_object.OUTCOME_FAILED:
+ return 'class=text-danger'
+ elif task_object.outcome == task_object.OUTCOME_SUCCESS and show_green:
+ return 'class=text-success'
+ else:
+ return ''
+
+@register.filter
+def filtered_icon(options, filter):
+ """Returns btn-primary if the filter matches one of the filter options
+ """
+ for option in options:
+ if filter == option[1]:
+ return "btn-primary"
+ if ('daterange' == option[1]) and filter.startswith(option[4]):
+ return "btn-primary"
+ return ""
+
+@register.filter
+def filtered_tooltip(options, filter):
+ """Returns tooltip for the filter icon if the filter matches one of the filter options
+ """
+ for option in options:
+ if filter == option[1]:
+ return "Showing only %s"%option[0]
+ if ('daterange' == option[1]) and filter.startswith(option[4]):
+ return "Showing only %s"%option[0]
+ return ""
+
+@register.filter
+def format_none_and_zero(value):
+ """Return empty string if the value is None, zero or Not Applicable
+ """
+ return "" if (not value) or (value == 0) or (value == "0") or (value == 'Not Applicable') else value
+
+@register.filter
+def filtered_filesizeformat(value):
+ """
+ If the value is -1 return an empty string. Otherwise,
+ change output from fileformatsize to suppress trailing '.0'
+ and change 'bytes' to 'B'.
+ """
+ if value == -1:
+ return ''
+
+ return filesizeformat(value).replace("bytes", "B")
+
+@register.filter
+def filtered_packagespec(value):
+ """Strip off empty version and revision"""
+ return re.sub(r'(--$)', '', value)
+
+@register.filter
+def check_filter_status(options, filter):
+ """Check if the active filter is among the available options, and return 'checked'
+ if filter is not active.
+ Used in FilterDialog to select the first radio button if the filter is not active.
+ """
+ for option in options:
+ if filter == option[1]:
+ return ""
+ return "checked"
+
+@register.filter
+def variable_parent_name(value):
+ """ filter extended variable names to the parent name
+ """
+ value=re.sub('_\$.*', '', value)
+ return re.sub('_[a-z].*', '', value)
+
+@register.filter
+def filter_setin_files(file_list, matchstr):
+ """Filter/search the 'set in' file lists."""
+ result = []
+ search, filter = matchstr.split(':')
+ for pattern in (search, filter):
+ if pattern:
+ for fobj in file_list:
+ fname = fobj.file_name
+ if fname not in result and re.search(pattern, fname):
+ result.append(fname)
+
+ # no filter, show last file (if any)
+ last = list(file_list)[-1].file_name
+ if not filter and last not in result:
+ result.append(last)
+
+ return result
+
+@register.filter
+def string_slice(strvar,slicevar):
+ """ slice a string with |string_slice:'[first]:[last]'
+ """
+ first,last= slicevar.partition(':')[::2]
+ if first=='':
+ return strvar[:int(last)]
+ elif last=='':
+ return strvar[int(first):]
+ else:
+ return strvar[int(first):int(last)]
+
+@register.filter
+def string_remove_regex(value,ex):
+ """ remove sub-string of string that matches regex
+ """
+ return re.sub(ex, '', value)
+
+@register.filter
+def filtered_installedsize(size, installed_size):
+ """If package.installed_size not null and not empty return it,
+ else return package.size
+ """
+ return size if (installed_size == 0) or (installed_size == "") or (installed_size == None) else installed_size
+
+@register.filter
+def filtered_packageversion(version, revision):
+ """ Emit "version-revision" if version and revision are not null
+ else "version" if version is not null
+ else ""
+ """
+ return "" if (not version or version == "") else version if (not revision or revision == "") else version + "-" + revision
+
+@register.filter
+def filter_sizeovertotal(package_object, total_size):
+ """ Return the % size of the package over the total size argument
+ formatted nicely.
+ """
+ size = package_object.installed_size
+ if size == None or size == '':
+ size = package_object.size
+
+ return '{:.1%}'.format(float(size)/float(total_size))
+
+from django.utils.safestring import mark_safe
+@register.filter
+def format_vpackage_rowclass(size):
+ if size == -1:
+ return mark_safe('class="text-muted"')
+ return ''
+
+@register.filter
+def format_vpackage_namehelp(name):
+ r = name + '&nbsp;'
+ r += '<span class="glyphicon glyphicon-question-sign get-help hover-help"'
+ r += ' title = "' + name + ' has not been built">'
+ r += '</span>'
+ return mark_safe(r)
+
+@register.filter
+def get_dict_value(dictionary, key):
+ """ return the value of a dictionary key
+ """
+ try:
+ return dictionary[key]
+ except (KeyError, IndexError):
+ return ''
+
+@register.filter
+def is_shaid(text):
+ """ return True if text length is 40 characters and all hex-digits
+ """
+ try:
+ int(text, 16)
+ if len(text) == 40:
+ return True
+ return False
+ except ValueError:
+ return False
+
+@register.filter
+def cut_path_prefix(fullpath, prefixes):
+ """Cut path prefix from fullpath."""
+ for prefix in prefixes:
+ if fullpath.startswith(prefix):
+ return relpath(fullpath, prefix)
+ return fullpath
+
+
+@register.filter
+def for_target(package_dependencies, target):
+ """ filter the dependencies to be displayed by the supplied target
+ if no dependences are found for the target then return the predicted
+ dependences"""
+ return package_dependencies.for_target_or_none(target)
diff --git a/poky/bitbake/lib/toaster/toastergui/typeaheads.py b/poky/bitbake/lib/toaster/toastergui/typeaheads.py
new file mode 100644
index 000000000..5aa0f8d88
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/typeaheads.py
@@ -0,0 +1,211 @@
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import subprocess
+
+from toastergui.widgets import ToasterTypeAhead
+from orm.models import Project
+from django.core.urlresolvers import reverse
+from django.core.cache import cache
+
+
+class LayersTypeAhead(ToasterTypeAhead):
+ """ Typeahead for layers available and not added in the current project's
+ configuration """
+
+ def apply_search(self, search_term, prj, request):
+ layers = prj.get_all_compatible_layer_versions()
+ layers = layers.order_by('layer__name')
+
+ # Unlike the other typeaheads we also don't want to show suggestions
+ # for layers already in the project unless required such as when adding
+ # layerdeps to a new layer.
+ if "include_added" in request.GET and \
+ request.GET['include_added'] != "true":
+ layers = layers.exclude(
+ pk__in=prj.get_project_layer_versions(pk=True))
+
+ primary_results = layers.filter(layer__name__istartswith=search_term)
+ secondary_results = layers.filter(
+ layer__name__icontains=search_term).exclude(
+ pk__in=primary_results)
+
+ results = []
+
+ for layer_version in list(primary_results) + list(secondary_results):
+ vcs_reference = layer_version.get_vcs_reference()
+
+ detail = "[ %s | %s ]" % (layer_version.layer.vcs_url,
+ vcs_reference)
+ needed_fields = {
+ 'id': layer_version.pk,
+ 'name': layer_version.layer.name,
+ 'layerdetailurl': layer_version.get_detailspage_url(prj.pk),
+ 'xhrLayerUrl': reverse('xhr_layer',
+ args=(prj.pk, layer_version.pk)),
+ 'vcs_url': layer_version.layer.vcs_url,
+ 'vcs_reference': vcs_reference,
+ 'detail': detail,
+ 'local_source_dir': layer_version.layer.local_source_dir,
+ }
+
+ results.append(needed_fields)
+
+ return results
+
+
+class MachinesTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the machines available in the current project's
+ configuration """
+
+ def apply_search(self, search_term, prj, request):
+ machines = prj.get_available_machines()
+ machines = machines.order_by("name")
+
+ primary_results = machines.filter(name__istartswith=search_term)
+ secondary_results = machines.filter(
+ name__icontains=search_term).exclude(pk__in=primary_results)
+ tertiary_results = machines.filter(
+ layer_version__layer__name__icontains=search_term).exclude(
+ pk__in=primary_results).exclude(pk__in=secondary_results)
+
+ results = []
+
+ for machine in list(primary_results) + list(secondary_results) + \
+ list(tertiary_results):
+
+ detail = "[ %s ]" % (machine.layer_version.layer.name)
+ needed_fields = {
+ 'id': machine.pk,
+ 'name': machine.name,
+ 'detail': detail,
+ }
+
+ results.append(needed_fields)
+ return results
+
+
+class DistrosTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the distros available in the current project's
+ configuration """
+ def __init__(self):
+ super(DistrosTypeAhead, self).__init__()
+
+ def apply_search(self, search_term, prj, request):
+ distros = prj.get_available_distros()
+ distros = distros.order_by("name")
+
+ primary_results = distros.filter(name__istartswith=search_term)
+ secondary_results = distros.filter(name__icontains=search_term).exclude(pk__in=primary_results)
+ tertiary_results = distros.filter(layer_version__layer__name__icontains=search_term).exclude(pk__in=primary_results).exclude(pk__in=secondary_results)
+
+ results = []
+
+ for distro in list(primary_results) + list(secondary_results) + list(tertiary_results):
+
+ detail = "[ %s ]" % (distro.layer_version.layer.name)
+ needed_fields = {
+ 'id' : distro.pk,
+ 'name' : distro.name,
+ 'detail' : detail,
+ }
+
+ results.append(needed_fields)
+
+ return results
+
+
+class RecipesTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the recipes available in the current project's
+ configuration """
+ def apply_search(self, search_term, prj, request):
+ recipes = prj.get_available_recipes()
+ recipes = recipes.order_by("name")
+
+ primary_results = recipes.filter(name__istartswith=search_term)
+ secondary_results = recipes.filter(
+ name__icontains=search_term).exclude(pk__in=primary_results)
+ tertiary_results = recipes.filter(
+ layer_version__layer__name__icontains=search_term).exclude(
+ pk__in=primary_results).exclude(pk__in=secondary_results)
+
+ results = []
+
+ for recipe in list(primary_results) + list(secondary_results) + \
+ list(tertiary_results):
+
+ detail = "[ %s ]" % (recipe.layer_version.layer.name)
+ needed_fields = {
+ 'id': recipe.pk,
+ 'name': recipe.name,
+ 'detail': detail,
+ }
+
+ results.append(needed_fields)
+
+ return results
+
+
+class ProjectsTypeAhead(ToasterTypeAhead):
+ """ Typeahead for all the projects, except for command line builds """
+ def apply_search(self, search_term, prj, request):
+ projects = Project.objects.exclude(is_default=True).order_by("name")
+
+ primary_results = projects.filter(name__istartswith=search_term)
+ secondary_results = projects.filter(
+ name__icontains=search_term).exclude(pk__in=primary_results)
+
+ results = []
+
+ for project in list(primary_results) + list(secondary_results):
+ needed_fields = {
+ 'id': project.pk,
+ 'name': project.name,
+ 'detail': "",
+ 'projectPageUrl': reverse('project', args=(project.pk,))
+ }
+
+ results.append(needed_fields)
+
+ return results
+
+
+class GitRevisionTypeAhead(ToasterTypeAhead):
+ def apply_search(self, search_term, prj, request):
+ results = []
+ git_url = request.GET.get('git_url')
+ ls_remote = cache.get(git_url)
+
+ if ls_remote is None:
+ ls_remote = subprocess.check_output(['git', 'ls-remote', git_url],
+ universal_newlines=True)
+ ls_remote = ls_remote.splitlines()
+ # Avoid fetching the list of git refs on each new input
+ cache.set(git_url, ls_remote, 120)
+
+ for rev in ls_remote:
+ git_rev = str(rev).split("/")[-1:][0]
+ # "HEAD" has a special meaning in Toaster... YOCTO #9924
+ if "HEAD" in git_rev:
+ continue
+
+ if git_rev.startswith(search_term):
+ results.append({'name': git_rev,
+ 'detail': '[ %s ]' % str(rev)})
+
+ return results
diff --git a/poky/bitbake/lib/toaster/toastergui/urls.py b/poky/bitbake/lib/toaster/toastergui/urls.py
new file mode 100644
index 000000000..e07b0efc1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/urls.py
@@ -0,0 +1,254 @@
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.conf.urls import include, url
+from django.views.generic import RedirectView, TemplateView
+
+from django.http import HttpResponseBadRequest
+from toastergui import tables
+from toastergui import buildtables
+from toastergui import typeaheads
+from toastergui import api
+from toastergui import widgets
+from toastergui import views
+
+urlpatterns = [
+ # landing page
+ url(r'^landing/$', views.landing, name='landing'),
+
+ url(r'^builds/$',
+ tables.AllBuildsTable.as_view(template_name="builds-toastertable.html"),
+ name='all-builds'),
+
+ # build info navigation
+ url(r'^build/(?P<build_id>\d+)$', views.builddashboard, name="builddashboard"),
+ url(r'^build/(?P<build_id>\d+)/tasks/$',
+ buildtables.BuildTasksTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='tasks'),
+
+ url(r'^build/(?P<build_id>\d+)/task/(?P<task_id>\d+)$', views.task, name='task'),
+
+ url(r'^build/(?P<build_id>\d+)/recipes/$',
+ buildtables.BuiltRecipesTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='recipes'),
+
+ url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)/active_tab/(?P<active_tab>\d{1})$', views.recipe, name='recipe'),
+
+ url(r'^build/(?P<build_id>\d+)/recipe/(?P<recipe_id>\d+)$', views.recipe, name='recipe'),
+ url(r'^build/(?P<build_id>\d+)/recipe_packages/(?P<recipe_id>\d+)$', views.recipe_packages, name='recipe_packages'),
+
+ url(r'^build/(?P<build_id>\d+)/packages/$',
+ buildtables.BuiltPackagesTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='packages'),
+
+ url(r'^build/(?P<build_id>\d+)/package/(?P<package_id>\d+)$', views.package_built_detail,
+ name='package_built_detail'),
+ url(r'^build/(?P<build_id>\d+)/package_built_dependencies/(?P<package_id>\d+)$',
+ views.package_built_dependencies, name='package_built_dependencies'),
+ url(r'^build/(?P<build_id>\d+)/package_included_detail/(?P<target_id>\d+)/(?P<package_id>\d+)$',
+ views.package_included_detail, name='package_included_detail'),
+ url(r'^build/(?P<build_id>\d+)/package_included_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
+ views.package_included_dependencies, name='package_included_dependencies'),
+ url(r'^build/(?P<build_id>\d+)/package_included_reverse_dependencies/(?P<target_id>\d+)/(?P<package_id>\d+)$',
+ views.package_included_reverse_dependencies, name='package_included_reverse_dependencies'),
+
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$',
+ buildtables.InstalledPackagesTable.as_view(
+ template_name="target.html"),
+ name='target'),
+
+
+ url(r'^dentries/build/(?P<build_id>\d+)/target/(?P<target_id>\d+)$', views.xhr_dirinfo, name='dirinfo_ajax'),
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo$', views.dirinfo, name='dirinfo'),
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/dirinfo_filepath/_(?P<file_path>(?:/[^/\n]+)*)$', views.dirinfo, name='dirinfo_filepath'),
+ url(r'^build/(?P<build_id>\d+)/configuration$', views.configuration, name='configuration'),
+ url(r'^build/(?P<build_id>\d+)/configvars$', views.configvars, name='configvars'),
+ url(r'^build/(?P<build_id>\d+)/buildtime$',
+ buildtables.BuildTimeTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='buildtime'),
+
+ url(r'^build/(?P<build_id>\d+)/cputime$',
+ buildtables.BuildCPUTimeTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='cputime'),
+
+ url(r'^build/(?P<build_id>\d+)/diskio$',
+ buildtables.BuildIOTable.as_view(
+ template_name="buildinfo-toastertable.html"),
+ name='diskio'),
+
+ # image information dir
+ url(r'^build/(?P<build_id>\d+)/target/(?P<target_id>\d+)/packagefile/(?P<packagefile_id>\d+)$',
+ views.image_information_dir, name='image_information_dir'),
+
+ # build download artifact
+ url(r'^build/(?P<build_id>\d+)/artifact/(?P<artifact_type>\w+)/id/(?P<artifact_id>\w+)', views.build_artifact, name="build_artifact"),
+
+ # project URLs
+ url(r'^newproject/$', views.newproject, name='newproject'),
+
+ url(r'^projects/$',
+ tables.ProjectsTable.as_view(template_name="projects-toastertable.html"),
+ name='all-projects'),
+
+ url(r'^project/(?P<pid>\d+)/$', views.project, name='project'),
+ url(r'^project/(?P<pid>\d+)/configuration$', views.projectconf, name='projectconf'),
+ url(r'^project/(?P<pid>\d+)/builds/$',
+ tables.ProjectBuildsTable.as_view(template_name="projectbuilds-toastertable.html"),
+ name='projectbuilds'),
+
+ # the import layer is a project-specific functionality;
+ url(r'^project/(?P<pid>\d+)/importlayer$', views.importlayer, name='importlayer'),
+
+ # the table pages that have been converted to ToasterTable widget
+ url(r'^project/(?P<pid>\d+)/machines/$',
+ tables.MachinesTable.as_view(template_name="generic-toastertable-page.html"),
+ name="projectmachines"),
+
+ url(r'^project/(?P<pid>\d+)/softwarerecipes/$',
+ tables.SoftwareRecipesTable.as_view(template_name="generic-toastertable-page.html"),
+ name="projectsoftwarerecipes"),
+
+ url(r'^project/(?P<pid>\d+)/images/$',
+ tables.ImageRecipesTable.as_view(template_name="generic-toastertable-page.html"), name="projectimagerecipes"),
+
+ url(r'^project/(?P<pid>\d+)/customimages/$',
+ tables.CustomImagesTable.as_view(template_name="generic-toastertable-page.html"), name="projectcustomimages"),
+
+ url(r'^project/(?P<pid>\d+)/newcustomimage/$',
+ tables.NewCustomImagesTable.as_view(template_name="newcustomimage.html"),
+ name="newcustomimage"),
+
+ url(r'^project/(?P<pid>\d+)/layers/$',
+ tables.LayersTable.as_view(template_name="generic-toastertable-page.html"),
+ name="projectlayers"),
+
+ url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)$',
+ views.layerdetails, name='layerdetails'),
+
+ url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/recipes/$',
+ tables.LayerRecipesTable.as_view(template_name="generic-toastertable-page.html"),
+ { 'table_name': tables.LayerRecipesTable.__name__.lower(),
+ 'title' : 'All recipes in layer' },
+ name=tables.LayerRecipesTable.__name__.lower()),
+
+ url(r'^project/(?P<pid>\d+)/layer/(?P<layerid>\d+)/machines/$',
+ tables.LayerMachinesTable.as_view(template_name="generic-toastertable-page.html"),
+ { 'table_name': tables.LayerMachinesTable.__name__.lower(),
+ 'title' : 'All machines in layer' },
+ name=tables.LayerMachinesTable.__name__.lower()),
+
+
+ url(r'^project/(?P<pid>\d+)/distros/$',
+ tables.DistrosTable.as_view(template_name="generic-toastertable-page.html"),
+ name="projectdistros"),
+
+
+ url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)/selectpackages/$',
+ tables.SelectPackagesTable.as_view(), name="recipeselectpackages"),
+
+
+ url(r'^project/(?P<pid>\d+)/customrecipe/(?P<custrecipeid>\d+)$',
+ tables.SelectPackagesTable.as_view(template_name="customrecipe.html"),
+ name="customrecipe"),
+
+ url(r'^project/(?P<pid>\d+)/customrecipe/(?P<recipe_id>\d+)/download$',
+ views.customrecipe_download,
+ name="customrecipedownload"),
+
+ url(r'^project/(?P<pid>\d+)/recipe/(?P<recipe_id>\d+)$',
+ tables.PackagesTable.as_view(template_name="recipedetails.html"),
+ name="recipedetails"),
+
+ # typeahead api end points
+ url(r'^xhr_typeahead/(?P<pid>\d+)/layers$',
+ typeaheads.LayersTypeAhead.as_view(), name='xhr_layerstypeahead'),
+ url(r'^xhr_typeahead/(?P<pid>\d+)/machines$',
+ typeaheads.MachinesTypeAhead.as_view(), name='xhr_machinestypeahead'),
+ url(r'^xhr_typeahead/(?P<pid>\d+)/recipes$',
+ typeaheads.RecipesTypeAhead.as_view(), name='xhr_recipestypeahead'),
+ url(r'^xhr_typeahead/projects$',
+ typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
+ url(r'^xhr_typeahead/gitrev$',
+ typeaheads.GitRevisionTypeAhead.as_view(),
+ name='xhr_gitrevtypeahead'),
+
+ url(r'^xhr_typeahead/(?P<pid>\d+)/distros$',
+ typeaheads.DistrosTypeAhead.as_view(), name='xhr_distrostypeahead'),
+
+ url(r'^xhr_testreleasechange/(?P<pid>\d+)$', views.xhr_testreleasechange,
+ name='xhr_testreleasechange'),
+ url(r'^xhr_configvaredit/(?P<pid>\d+)$', views.xhr_configvaredit,
+ name='xhr_configvaredit'),
+
+ url(r'^xhr_layer/(?P<pid>\d+)/(?P<layerversion_id>\d+)$',
+ api.XhrLayer.as_view(),
+ name='xhr_layer'),
+
+ url(r'^xhr_layer/(?P<pid>\d+)$',
+ api.XhrLayer.as_view(),
+ name='xhr_layer'),
+
+ # JS Unit tests
+ url(r'^js-unit-tests/$', views.jsunittests, name='js-unit-tests'),
+
+ # image customisation functionality
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)'
+ '/packages/(?P<package_id>\d+|)$',
+ api.XhrCustomRecipePackages.as_view(),
+ name='xhr_customrecipe_packages'),
+
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$',
+ api.XhrCustomRecipePackages.as_view(),
+ name='xhr_customrecipe_packages'),
+
+ url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$',
+ api.XhrCustomRecipeId.as_view(),
+ name='xhr_customrecipe_id'),
+
+ url(r'^xhr_customrecipe/',
+ api.XhrCustomRecipe.as_view(),
+ name='xhr_customrecipe'),
+
+ url(r'^xhr_buildrequest/project/(?P<pid>\d+)$',
+ api.XhrBuildRequest.as_view(),
+ name='xhr_buildrequest'),
+
+ url(r'xhr_project/(?P<project_id>\d+)$',
+ api.XhrProject.as_view(),
+ name='xhr_project'),
+
+ url(r'xhr_build/(?P<build_id>\d+)$',
+ api.XhrBuild.as_view(),
+ name='xhr_build'),
+
+ url(r'^mostrecentbuilds$', widgets.MostRecentBuildsView.as_view(),
+ name='most_recent_builds'),
+
+ # JSON data for aggregators
+ url(r'^api/builds$', views.json_builds, name='json_builds'),
+ url(r'^api/building$', views.json_building, name='json_building'),
+ url(r'^api/build/(?P<build_id>\d+)$', views.json_build, name='json_build'),
+
+ # default redirection
+ url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
+]
diff --git a/poky/bitbake/lib/toaster/toastergui/views.py b/poky/bitbake/lib/toaster/toastergui/views.py
new file mode 100755
index 000000000..34ed2b2e3
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/views.py
@@ -0,0 +1,1791 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import re
+
+from django.db.models import F, Q, Sum
+from django.db import IntegrityError
+from django.shortcuts import render, redirect, get_object_or_404
+from orm.models import Build, Target, Task, Layer, Layer_Version, Recipe
+from orm.models import LogMessage, Variable, Package_Dependency, Package
+from orm.models import Task_Dependency, Package_File
+from orm.models import Target_Installed_Package, Target_File
+from orm.models import TargetKernelFile, TargetSDKFile, Target_Image_File
+from orm.models import BitbakeVersion, CustomImageRecipe
+
+from django.core.urlresolvers import reverse, resolve
+from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
+from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
+from django.http import HttpResponseNotFound, JsonResponse
+from django.utils import timezone
+from datetime import timedelta, datetime
+from toastergui.templatetags.projecttags import json as jsonfilter
+from decimal import Decimal
+import json
+import os
+from os.path import dirname
+import mimetypes
+
+import logging
+
+logger = logging.getLogger("toaster")
+
+# Project creation and managed build enable
+project_enable = ('1' == os.environ.get('TOASTER_BUILDSERVER'))
+
+class MimeTypeFinder(object):
+ # setting this to False enables additional non-standard mimetypes
+ # to be included in the guess
+ _strict = False
+
+ # returns the mimetype for a file path as a string,
+ # or 'application/octet-stream' if the type couldn't be guessed
+ @classmethod
+ def get_mimetype(self, path):
+ guess = mimetypes.guess_type(path, self._strict)
+ guessed_type = guess[0]
+ if guessed_type == None:
+ guessed_type = 'application/octet-stream'
+ return guessed_type
+
+# single point to add global values into the context before rendering
+def toaster_render(request, page, context):
+ context['project_enable'] = project_enable
+ return render(request, page, context)
+
+
+# all new sessions should come through the landing page;
+# determine in which mode we are running in, and redirect appropriately
+def landing(request):
+ # in build mode, we redirect to the command-line builds page
+ # if there are any builds for the default (cli builds) project
+ default_project = Project.objects.get_or_create_default_project()
+ default_project_builds = Build.objects.filter(project = default_project)
+
+ # we only redirect to projects page if there is a user-generated project
+ num_builds = Build.objects.all().count()
+ user_projects = Project.objects.filter(is_default = False)
+ has_user_project = user_projects.count() > 0
+
+ if num_builds == 0 and has_user_project:
+ return redirect(reverse('all-projects'), permanent = False)
+
+ if num_builds > 0:
+ return redirect(reverse('all-builds'), permanent = False)
+
+ context = {'lvs_nos' : Layer_Version.objects.all().count()}
+
+ return toaster_render(request, 'landing.html', context)
+
+def objtojson(obj):
+ from django.db.models.query import QuerySet
+ from django.db.models import Model
+
+ if isinstance(obj, datetime):
+ return obj.isoformat()
+ elif isinstance(obj, timedelta):
+ return obj.total_seconds()
+ elif isinstance(obj, QuerySet) or isinstance(obj, set):
+ return list(obj)
+ elif isinstance(obj, Decimal):
+ return str(obj)
+ elif type(obj).__name__ == "RelatedManager":
+ return [x.pk for x in obj.all()]
+ elif hasattr( obj, '__dict__') and isinstance(obj, Model):
+ d = obj.__dict__
+ nd = dict(d)
+ for di in d.keys():
+ if di.startswith("_"):
+ del nd[di]
+ elif isinstance(d[di], Model):
+ nd[di] = d[di].pk
+ elif isinstance(d[di], int) and hasattr(obj, "get_%s_display" % di):
+ nd[di] = getattr(obj, "get_%s_display" % di)()
+ return nd
+ elif isinstance( obj, type(lambda x:x)):
+ import inspect
+ return inspect.getsourcelines(obj)[0]
+ else:
+ raise TypeError("Unserializable object %s (%s) of type %s" % ( obj, dir(obj), type(obj)))
+
+
+def _lv_to_dict(prj, x = None):
+ if x is None:
+ def wrapper(x):
+ return _lv_to_dict(prj, x)
+ return wrapper
+
+ return {"id": x.pk,
+ "name": x.layer.name,
+ "tooltip": "%s | %s" % (x.layer.vcs_url,x.get_vcs_reference()),
+ "detail": "(%s" % x.layer.vcs_url + (")" if x.release == None else " | "+x.get_vcs_reference()+")"),
+ "giturl": x.layer.vcs_url,
+ "layerdetailurl" : reverse('layerdetails', args=(prj.id,x.pk)),
+ "revision" : x.get_vcs_reference(),
+ }
+
+
+def _build_page_range(paginator, index = 1):
+ try:
+ page = paginator.page(index)
+ except PageNotAnInteger:
+ page = paginator.page(1)
+ except EmptyPage:
+ page = paginator.page(paginator.num_pages)
+
+
+ page.page_range = [page.number]
+ crt_range = 0
+ for i in range(1,5):
+ if (page.number + i) <= paginator.num_pages:
+ page.page_range = page.page_range + [ page.number + i]
+ crt_range +=1
+ if (page.number - i) > 0:
+ page.page_range = [page.number -i] + page.page_range
+ crt_range +=1
+ if crt_range == 4:
+ break
+ return page
+
+
+def _verify_parameters(g, mandatory_parameters):
+ miss = []
+ for mp in mandatory_parameters:
+ if not mp in g:
+ miss.append(mp)
+ if len(miss):
+ return miss
+ return None
+
+def _redirect_parameters(view, g, mandatory_parameters, *args, **kwargs):
+ try:
+ from urllib import unquote, urlencode
+ except ImportError:
+ from urllib.parse import unquote, urlencode
+ url = reverse(view, kwargs=kwargs)
+ params = {}
+ for i in g:
+ params[i] = g[i]
+ for i in mandatory_parameters:
+ if not i in params:
+ params[i] = unquote(str(mandatory_parameters[i]))
+
+ return redirect(url + "?%s" % urlencode(params), permanent = False, **kwargs)
+
+class RedirectException(Exception):
+ def __init__(self, view, g, mandatory_parameters, *args, **kwargs):
+ super(RedirectException, self).__init__()
+ self.view = view
+ self.g = g
+ self.mandatory_parameters = mandatory_parameters
+ self.oargs = args
+ self.okwargs = kwargs
+
+ def get_redirect_response(self):
+ return _redirect_parameters(self.view, self.g, self.mandatory_parameters, self.oargs, **self.okwargs)
+
+FIELD_SEPARATOR = ":"
+AND_VALUE_SEPARATOR = "!"
+OR_VALUE_SEPARATOR = "|"
+DESCENDING = "-"
+
+def __get_q_for_val(name, value):
+ if "OR" in value or "AND" in value:
+ result = None
+ for x in value.split("OR"):
+ x = __get_q_for_val(name, x)
+ result = result | x if result else x
+ return result
+ if "AND" in value:
+ result = None
+ for x in value.split("AND"):
+ x = __get_q_for_val(name, x)
+ result = result & x if result else x
+ return result
+ if value.startswith("NOT"):
+ value = value[3:]
+ if value == 'None':
+ value = None
+ kwargs = { name : value }
+ return ~Q(**kwargs)
+ else:
+ if value == 'None':
+ value = None
+ kwargs = { name : value }
+ return Q(**kwargs)
+
+def _get_filtering_query(filter_string):
+
+ search_terms = filter_string.split(FIELD_SEPARATOR)
+ and_keys = search_terms[0].split(AND_VALUE_SEPARATOR)
+ and_values = search_terms[1].split(AND_VALUE_SEPARATOR)
+
+ and_query = None
+ for kv in zip(and_keys, and_values):
+ or_keys = kv[0].split(OR_VALUE_SEPARATOR)
+ or_values = kv[1].split(OR_VALUE_SEPARATOR)
+ query = None
+ for key, val in zip(or_keys, or_values):
+ x = __get_q_for_val(key, val)
+ query = query | x if query else x
+
+ and_query = and_query & query if and_query else query
+
+ return and_query
+
+def _get_toggle_order(request, orderkey, toggle_reverse = False):
+ if toggle_reverse:
+ return "%s:+" % orderkey if request.GET.get('orderby', "") == "%s:-" % orderkey else "%s:-" % orderkey
+ else:
+ return "%s:-" % orderkey if request.GET.get('orderby', "") == "%s:+" % orderkey else "%s:+" % orderkey
+
+def _get_toggle_order_icon(request, orderkey):
+ if request.GET.get('orderby', "") == "%s:+"%orderkey:
+ return "down"
+ elif request.GET.get('orderby', "") == "%s:-"%orderkey:
+ return "up"
+ else:
+ return None
+
+# we check that the input comes in a valid form that we can recognize
+def _validate_input(field_input, model):
+
+ invalid = None
+
+ if field_input:
+ field_input_list = field_input.split(FIELD_SEPARATOR)
+
+ # Check we have only one colon
+ if len(field_input_list) != 2:
+ invalid = "We have an invalid number of separators: " + field_input + " -> " + str(field_input_list)
+ return None, invalid
+
+ # Check we have an equal number of terms both sides of the colon
+ if len(field_input_list[0].split(AND_VALUE_SEPARATOR)) != len(field_input_list[1].split(AND_VALUE_SEPARATOR)):
+ invalid = "Not all arg names got values"
+ return None, invalid + str(field_input_list)
+
+ # Check we are looking for a valid field
+ valid_fields = [f.name for f in model._meta.get_fields()]
+ for field in field_input_list[0].split(AND_VALUE_SEPARATOR):
+ if True in [field.startswith(x) for x in valid_fields]:
+ break
+ else:
+ return None, (field, valid_fields)
+
+ return field_input, invalid
+
+# uses search_allowed_fields in orm/models.py to create a search query
+# for these fields with the supplied input text
+def _get_search_results(search_term, queryset, model):
+ search_object = None
+ for st in search_term.split(" "):
+ queries = None
+ for field in model.search_allowed_fields:
+ query = Q(**{field + '__icontains': st})
+ queries = queries | query if queries else query
+
+ search_object = search_object & queries if search_object else queries
+ queryset = queryset.filter(search_object)
+
+ return queryset
+
+
+# function to extract the search/filter/ordering parameters from the request
+# it uses the request and the model to validate input for the filter and orderby values
+def _search_tuple(request, model):
+ ordering_string, invalid = _validate_input(request.GET.get('orderby', ''), model)
+ if invalid:
+ raise BaseException("Invalid ordering model:" + str(model) + str(invalid))
+
+ filter_string, invalid = _validate_input(request.GET.get('filter', ''), model)
+ if invalid:
+ raise BaseException("Invalid filter " + str(invalid))
+
+ search_term = request.GET.get('search', '')
+ return (filter_string, search_term, ordering_string)
+
+
+# returns a lazy-evaluated queryset for a filter/search/order combination
+def _get_queryset(model, queryset, filter_string, search_term, ordering_string, ordering_secondary=''):
+ if filter_string:
+ filter_query = _get_filtering_query(filter_string)
+ queryset = queryset.filter(filter_query)
+ else:
+ queryset = queryset.all()
+
+ if search_term:
+ queryset = _get_search_results(search_term, queryset, model)
+
+ if ordering_string:
+ column, order = ordering_string.split(':')
+ if column == re.sub('-','',ordering_secondary):
+ ordering_secondary=''
+ if order.lower() == DESCENDING:
+ column = '-' + column
+ if ordering_secondary:
+ queryset = queryset.order_by(column, ordering_secondary)
+ else:
+ queryset = queryset.order_by(column)
+
+ # insure only distinct records (e.g. from multiple search hits) are returned
+ return queryset.distinct()
+
+# returns the value of entries per page and the name of the applied sorting field.
+# if the value is given explicitly as a GET parameter it will be the first selected,
+# otherwise the cookie value will be used.
+def _get_parameters_values(request, default_count, default_order):
+ current_url = resolve(request.path_info).url_name
+ pagesize = request.GET.get('count', request.session.get('%s_count' % current_url, default_count))
+ orderby = request.GET.get('orderby', request.session.get('%s_orderby' % current_url, default_order))
+ return (pagesize, orderby)
+
+
+# set cookies for parameters. this is usefull in case parameters are set
+# manually from the GET values of the link
+def _set_parameters_values(pagesize, orderby, request):
+ from django.core.urlresolvers import resolve
+ current_url = resolve(request.path_info).url_name
+ request.session['%s_count' % current_url] = pagesize
+ request.session['%s_orderby' % current_url] =orderby
+
+# date range: normalize GUI's dd/mm/yyyy to date object
+def _normalize_input_date(date_str,default):
+ date_str=re.sub('/', '-', date_str)
+ # accept dd/mm/yyyy to d/m/yy
+ try:
+ date_in = datetime.strptime(date_str, "%d-%m-%Y")
+ except ValueError:
+ # courtesy try with two digit year
+ try:
+ date_in = datetime.strptime(date_str, "%d-%m-%y")
+ except ValueError:
+ return default
+ date_in = date_in.replace(tzinfo=default.tzinfo)
+ return date_in
+
+# convert and normalize any received date range filter, for example:
+# "completed_on__gte!completed_on__lt:01/03/2015!02/03/2015_daterange" to
+# "completed_on__gte!completed_on__lt:2015-03-01!2015-03-02"
+def _modify_date_range_filter(filter_string):
+ # was the date range radio button selected?
+ if 0 > filter_string.find('_daterange'):
+ return filter_string,''
+ # normalize GUI dates to database format
+ filter_string = filter_string.replace('_daterange','').replace(':','!');
+ filter_list = filter_string.split('!');
+ if 4 != len(filter_list):
+ return filter_string
+ today = timezone.localtime(timezone.now())
+ date_id = filter_list[1]
+ date_from = _normalize_input_date(filter_list[2],today)
+ date_to = _normalize_input_date(filter_list[3],today)
+ # swap dates if manually set dates are out of order
+ if date_to < date_from:
+ date_to,date_from = date_from,date_to
+ # convert to strings, make 'date_to' inclusive by moving to begining of next day
+ date_from_str = date_from.strftime("%Y-%m-%d")
+ date_to_str = (date_to+timedelta(days=1)).strftime("%Y-%m-%d")
+ filter_string=filter_list[0]+'!'+filter_list[1]+':'+date_from_str+'!'+date_to_str
+ daterange_selected = re.sub('__.*','', date_id)
+ return filter_string,daterange_selected
+
+def _add_daterange_context(queryset_all, request, daterange_list):
+ # calculate the exact begining of local today and yesterday
+ today_begin = timezone.localtime(timezone.now())
+ yesterday_begin = today_begin - timedelta(days=1)
+ # add daterange persistent
+ context_date = {}
+ context_date['last_date_from'] = request.GET.get('last_date_from',timezone.localtime(timezone.now()).strftime("%d/%m/%Y"))
+ context_date['last_date_to' ] = request.GET.get('last_date_to' ,context_date['last_date_from'])
+ # calculate the date ranges, avoid second sort for 'created'
+ # fetch the respective max range from the database
+ context_date['daterange_filter']=''
+ for key in daterange_list:
+ queryset_key = queryset_all.order_by(key)
+ try:
+ context_date['dateMin_'+key]=timezone.localtime(getattr(queryset_key.first(),key)).strftime("%d/%m/%Y")
+ except AttributeError:
+ context_date['dateMin_'+key]=timezone.localtime(timezone.now())
+ try:
+ context_date['dateMax_'+key]=timezone.localtime(getattr(queryset_key.last(),key)).strftime("%d/%m/%Y")
+ except AttributeError:
+ context_date['dateMax_'+key]=timezone.localtime(timezone.now())
+ return context_date,today_begin,yesterday_begin
+
+
+##
+# build dashboard for a single build, coming in as argument
+# Each build may contain multiple targets and each target
+# may generate multiple image files. display them all.
+#
+def builddashboard( request, build_id ):
+ template = "builddashboard.html"
+ if Build.objects.filter( pk=build_id ).count( ) == 0 :
+ return redirect( builds )
+ build = Build.objects.get( pk = build_id );
+ layerVersionId = Layer_Version.objects.filter( build = build_id );
+ recipeCount = Recipe.objects.filter( layer_version__id__in = layerVersionId ).count( );
+ tgts = Target.objects.filter( build_id = build_id ).order_by( 'target' );
+
+ # set up custom target list with computed package and image data
+ targets = []
+ ntargets = 0
+
+ # True if at least one target for this build has an SDK artifact
+ # or image file
+ has_artifacts = False
+
+ for t in tgts:
+ elem = {}
+ elem['target'] = t
+
+ target_has_images = False
+ image_files = []
+
+ npkg = 0
+ pkgsz = 0
+ package = None
+ # Chunk the query to avoid "too many SQL variables" error
+ package_set = t.target_installed_package_set.all()
+ package_set_len = len(package_set)
+ for ps_start in range(0,package_set_len,500):
+ ps_stop = min(ps_start+500,package_set_len)
+ for package in Package.objects.filter(id__in = [x.package_id for x in package_set[ps_start:ps_stop]]):
+ pkgsz = pkgsz + package.size
+ if package.installed_name:
+ npkg = npkg + 1
+ elem['npkg'] = npkg
+ elem['pkgsz'] = pkgsz
+ ti = Target_Image_File.objects.filter(target_id = t.id)
+ for i in ti:
+ ndx = i.file_name.rfind('/')
+ if ndx < 0:
+ ndx = 0;
+ f = i.file_name[ndx + 1:]
+ image_files.append({
+ 'id': i.id,
+ 'path': f,
+ 'size': i.file_size,
+ 'suffix': i.suffix
+ })
+ if len(image_files) > 0:
+ target_has_images = True
+ elem['targetHasImages'] = target_has_images
+
+ elem['imageFiles'] = image_files
+ elem['target_kernel_artifacts'] = t.targetkernelfile_set.all()
+
+ target_sdk_files = t.targetsdkfile_set.all()
+ target_sdk_artifacts_count = target_sdk_files.count()
+ elem['target_sdk_artifacts_count'] = target_sdk_artifacts_count
+ elem['target_sdk_artifacts'] = target_sdk_files
+
+ if target_has_images or target_sdk_artifacts_count > 0:
+ has_artifacts = True
+
+ targets.append(elem)
+
+ ##
+ # how many packages in this build - ignore anonymous ones
+ #
+
+ packageCount = 0
+ packages = Package.objects.filter( build_id = build_id )
+ for p in packages:
+ if ( p.installed_name ):
+ packageCount = packageCount + 1
+
+ logmessages = list(LogMessage.objects.filter( build = build_id ))
+
+ context = {
+ 'build' : build,
+ 'project' : build.project,
+ 'hasArtifacts' : has_artifacts,
+ 'ntargets' : ntargets,
+ 'targets' : targets,
+ 'recipecount' : recipeCount,
+ 'packagecount' : packageCount,
+ 'logmessages' : logmessages,
+ }
+ return toaster_render( request, template, context )
+
+
+
+def generateCoveredList2( revlist = None ):
+ if not revlist:
+ revlist = []
+ covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ]
+ while len(covered_list):
+ revlist = [ x for x in revlist if x.outcome != Task.OUTCOME_COVERED ]
+ if len(revlist) > 0:
+ return revlist
+
+ newlist = _find_task_revdep_list(covered_list)
+
+ revlist = list(set(revlist + newlist))
+ covered_list = [ x for x in revlist if x.outcome == Task.OUTCOME_COVERED ]
+ return revlist
+
+def task( request, build_id, task_id ):
+ template = "task.html"
+ tasks_list = Task.objects.filter( pk=task_id )
+ if tasks_list.count( ) == 0:
+ return redirect( builds )
+ task_object = tasks_list[ 0 ];
+ dependencies = sorted(
+ _find_task_dep( task_object ),
+ key=lambda t:'%s_%s %s'%(t.recipe.name, t.recipe.version, t.task_name))
+ reverse_dependencies = sorted(
+ _find_task_revdep( task_object ),
+ key=lambda t:'%s_%s %s'%( t.recipe.name, t.recipe.version, t.task_name ))
+ coveredBy = '';
+ if ( task_object.outcome == Task.OUTCOME_COVERED ):
+# _list = generateCoveredList( task )
+ coveredBy = sorted(generateCoveredList2( _find_task_revdep( task_object ) ), key = lambda x: x.recipe.name)
+ log_head = ''
+ log_body = ''
+ if task_object.outcome == task_object.OUTCOME_FAILED:
+ pass
+
+ uri_list= [ ]
+ variables = Variable.objects.filter(build=build_id)
+ v=variables.filter(variable_name='SSTATE_DIR')
+ if v.count() > 0:
+ uri_list.append(v[0].variable_value)
+ v=variables.filter(variable_name='SSTATE_MIRRORS')
+ if (v.count() > 0):
+ for mirror in v[0].variable_value.split('\\n'):
+ s=re.sub('.* ','',mirror.strip(' \t\n\r'))
+ if len(s):
+ uri_list.append(s)
+
+ context = {
+ 'build' : Build.objects.filter( pk = build_id )[ 0 ],
+ 'object' : task_object,
+ 'task' : task_object,
+ 'covered_by' : coveredBy,
+ 'deps' : dependencies,
+ 'rdeps' : reverse_dependencies,
+ 'log_head' : log_head,
+ 'log_body' : log_body,
+ 'showing_matches' : False,
+ 'uri_list' : uri_list,
+ 'task_in_tasks_table_pg': int(task_object.order / 25) + 1
+ }
+ if request.GET.get( 'show_matches', "" ):
+ context[ 'showing_matches' ] = True
+ context[ 'matching_tasks' ] = Task.objects.filter(
+ sstate_checksum=task_object.sstate_checksum ).filter(
+ build__completed_on__lt=task_object.build.completed_on).exclude(
+ order__isnull=True).exclude(outcome=Task.OUTCOME_NA).order_by('-build__completed_on')
+
+ return toaster_render( request, template, context )
+
+def recipe(request, build_id, recipe_id, active_tab="1"):
+ template = "recipe.html"
+ if Recipe.objects.filter(pk=recipe_id).count() == 0 :
+ return redirect(builds)
+
+ recipe_object = Recipe.objects.get(pk=recipe_id)
+ layer_version = Layer_Version.objects.get(pk=recipe_object.layer_version_id)
+ layer = Layer.objects.get(pk=layer_version.layer_id)
+ tasks_list = Task.objects.filter(recipe_id = recipe_id, build_id = build_id).exclude(order__isnull=True).exclude(task_name__endswith='_setscene').exclude(outcome=Task.OUTCOME_NA)
+ package_count = Package.objects.filter(recipe_id = recipe_id).filter(build_id = build_id).filter(size__gte=0).count()
+
+ if active_tab != '1' and active_tab != '3' and active_tab != '4' :
+ active_tab = '1'
+ tab_states = {'1': '', '3': '', '4': ''}
+ tab_states[active_tab] = 'active'
+
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'object' : recipe_object,
+ 'layer_version' : layer_version,
+ 'layer' : layer,
+ 'tasks' : tasks_list,
+ 'package_count' : package_count,
+ 'tab_states' : tab_states,
+ }
+ return toaster_render(request, template, context)
+
+def recipe_packages(request, build_id, recipe_id):
+ template = "recipe_packages.html"
+ if Recipe.objects.filter(pk=recipe_id).count() == 0 :
+ return redirect(builds)
+
+ (pagesize, orderby) = _get_parameters_values(request, 10, 'name:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'recipe_packages', request.GET, mandatory_parameters, build_id = build_id, recipe_id = recipe_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Package)
+
+ recipe_object = Recipe.objects.get(pk=recipe_id)
+ queryset = Package.objects.filter(recipe_id = recipe_id).filter(build_id = build_id).filter(size__gte=0)
+ package_count = queryset.count()
+ queryset = _get_queryset(Package, queryset, filter_string, search_term, ordering_string, 'name')
+
+ packages = _build_page_range(Paginator(queryset, pagesize),request.GET.get('page', 1))
+
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'recipe' : recipe_object,
+ 'objects' : packages,
+ 'object_count' : package_count,
+ 'tablecols':[
+ {
+ 'name':'Package',
+ 'orderfield': _get_toggle_order(request,"name"),
+ 'ordericon': _get_toggle_order_icon(request,"name"),
+ 'orderkey': "name",
+ },
+ {
+ 'name':'Version',
+ },
+ {
+ 'name':'Size',
+ 'orderfield': _get_toggle_order(request,"size", True),
+ 'ordericon': _get_toggle_order_icon(request,"size"),
+ 'orderkey': 'size',
+ 'dclass': 'sizecol span2',
+ },
+ ]
+ }
+ response = toaster_render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+from django.core.serializers.json import DjangoJSONEncoder
+from django.http import HttpResponse
+def xhr_dirinfo(request, build_id, target_id):
+ top = request.GET.get('start', '/')
+ return HttpResponse(_get_dir_entries(build_id, target_id, top), content_type = "application/json")
+
+from django.utils.functional import Promise
+from django.utils.encoding import force_text
+class LazyEncoder(json.JSONEncoder):
+ def default(self, obj):
+ if isinstance(obj, Promise):
+ return force_text(obj)
+ return super(LazyEncoder, self).default(obj)
+
+from toastergui.templatetags.projecttags import filtered_filesizeformat
+import os
+def _get_dir_entries(build_id, target_id, start):
+ node_str = {
+ Target_File.ITYPE_REGULAR : '-',
+ Target_File.ITYPE_DIRECTORY : 'd',
+ Target_File.ITYPE_SYMLINK : 'l',
+ Target_File.ITYPE_SOCKET : 's',
+ Target_File.ITYPE_FIFO : 'p',
+ Target_File.ITYPE_CHARACTER : 'c',
+ Target_File.ITYPE_BLOCK : 'b',
+ }
+ response = []
+ objects = Target_File.objects.filter(target__exact=target_id, directory__path=start)
+ target_packages = Target_Installed_Package.objects.filter(target__exact=target_id).values_list('package_id', flat=True)
+ for o in objects:
+ # exclude root inode '/'
+ if o.path == '/':
+ continue
+ try:
+ entry = {}
+ entry['parent'] = start
+ entry['name'] = os.path.basename(o.path)
+ entry['fullpath'] = o.path
+
+ # set defaults, not all dentries have packages
+ entry['installed_package'] = None
+ entry['package_id'] = None
+ entry['package'] = None
+ entry['link_to'] = None
+ if o.inodetype == Target_File.ITYPE_DIRECTORY:
+ entry['isdir'] = 1
+ # is there content in directory
+ entry['childcount'] = Target_File.objects.filter(target__exact=target_id, directory__path=o.path).all().count()
+ else:
+ entry['isdir'] = 0
+
+ # resolve the file to get the package from the resolved file
+ resolved_id = o.sym_target_id
+ resolved_path = o.path
+ if target_packages.count():
+ while resolved_id != "" and resolved_id != None:
+ tf = Target_File.objects.get(pk=resolved_id)
+ resolved_path = tf.path
+ resolved_id = tf.sym_target_id
+
+ thisfile=Package_File.objects.all().filter(path__exact=resolved_path, package_id__in=target_packages)
+ if thisfile.count():
+ p = Package.objects.get(pk=thisfile[0].package_id)
+ entry['installed_package'] = p.installed_name
+ entry['package_id'] = str(p.id)
+ entry['package'] = p.name
+ # don't use resolved path from above, show immediate link-to
+ if o.sym_target_id != "" and o.sym_target_id != None:
+ entry['link_to'] = Target_File.objects.get(pk=o.sym_target_id).path
+ entry['size'] = filtered_filesizeformat(o.size)
+ if entry['link_to'] != None:
+ entry['permission'] = node_str[o.inodetype] + o.permission
+ else:
+ entry['permission'] = node_str[o.inodetype] + o.permission
+ entry['owner'] = o.owner
+ entry['group'] = o.group
+ response.append(entry)
+
+ except Exception as e:
+ print("Exception ", e)
+ traceback.print_exc()
+
+ # sort by directories first, then by name
+ rsorted = sorted(response, key=lambda entry : entry['name'])
+ rsorted = sorted(rsorted, key=lambda entry : entry['isdir'], reverse=True)
+ return json.dumps(rsorted, cls=LazyEncoder).replace('</', '<\\/')
+
+def dirinfo(request, build_id, target_id, file_path=None):
+ template = "dirinfo.html"
+ objects = _get_dir_entries(build_id, target_id, '/')
+ packages_sum = Package.objects.filter(id__in=Target_Installed_Package.objects.filter(target_id=target_id).values('package_id')).aggregate(Sum('installed_size'))
+ dir_list = None
+ if file_path != None:
+ """
+ Link from the included package detail file list page and is
+ requesting opening the dir info to a specific file path.
+ Provide the list of directories to expand and the full path to
+ highlight in the page.
+ """
+ # Aassume target's path separator matches host's, that is, os.sep
+ sep = os.sep
+ dir_list = []
+ head = file_path
+ while head != sep:
+ (head, tail) = os.path.split(head)
+ if head != sep:
+ dir_list.insert(0, head)
+
+ build = Build.objects.get(pk=build_id)
+
+ context = { 'build': build,
+ 'project': build.project,
+ 'target': Target.objects.get(pk=target_id),
+ 'packages_sum': packages_sum['installed_size__sum'],
+ 'objects': objects,
+ 'dir_list': dir_list,
+ 'file_path': file_path,
+ }
+ return toaster_render(request, template, context)
+
+def _find_task_dep(task_object):
+ tdeps = Task_Dependency.objects.filter(task=task_object).filter(depends_on__order__gt=0)
+ tdeps = tdeps.exclude(depends_on__outcome=Task.OUTCOME_NA).select_related("depends_on")
+ return [x.depends_on for x in tdeps]
+
+def _find_task_revdep(task_object):
+ tdeps = Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0)
+ tdeps = tdeps.exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
+
+ # exclude self-dependencies to prevent infinite dependency loop
+ # in generateCoveredList2()
+ tdeps = tdeps.exclude(task=task_object)
+
+ return [tdep.task for tdep in tdeps]
+
+def _find_task_revdep_list(tasklist):
+ tdeps = Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0)
+ tdeps = tdeps.exclude(task__outcome=Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
+
+ # exclude self-dependencies to prevent infinite dependency loop
+ # in generateCoveredList2()
+ tdeps = tdeps.exclude(task=F('depends_on'))
+
+ return [tdep.task for tdep in tdeps]
+
+def _find_task_provider(task_object):
+ task_revdeps = _find_task_revdep(task_object)
+ for tr in task_revdeps:
+ if tr.outcome != Task.OUTCOME_COVERED:
+ return tr
+ for tr in task_revdeps:
+ trc = _find_task_provider(tr)
+ if trc is not None:
+ return trc
+ return None
+
+def configuration(request, build_id):
+ template = 'configuration.html'
+
+ var_names = ('BB_VERSION', 'BUILD_SYS', 'NATIVELSBSTRING', 'TARGET_SYS',
+ 'MACHINE', 'DISTRO', 'DISTRO_VERSION', 'TUNE_FEATURES', 'TARGET_FPU')
+ context = dict(Variable.objects.filter(build=build_id, variable_name__in=var_names)\
+ .values_list('variable_name', 'variable_value'))
+ build = Build.objects.get(pk=build_id)
+ context.update({'objectname': 'configuration',
+ 'object_search_display':'variables',
+ 'filter_search_display':'variables',
+ 'build': build,
+ 'project': build.project,
+ 'targets': Target.objects.filter(build=build_id)})
+ return toaster_render(request, template, context)
+
+
+def configvars(request, build_id):
+ template = 'configvars.html'
+ (pagesize, orderby) = _get_parameters_values(request, 100, 'variable_name:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby' : orderby, 'filter' : 'description__regex:.+' }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Variable)
+ if retval:
+ # if new search, clear the default filter
+ if search_term and len(search_term):
+ mandatory_parameters['filter']=''
+ return _redirect_parameters( 'configvars', request.GET, mandatory_parameters, build_id = build_id)
+
+ queryset = Variable.objects.filter(build=build_id).exclude(variable_name__istartswith='B_').exclude(variable_name__istartswith='do_')
+ queryset_with_search = _get_queryset(Variable, queryset, None, search_term, ordering_string, 'variable_name').exclude(variable_value='',vhistory__file_name__isnull=True)
+ queryset = _get_queryset(Variable, queryset, filter_string, search_term, ordering_string, 'variable_name')
+ # remove records where the value is empty AND there are no history files
+ queryset = queryset.exclude(variable_value='',vhistory__file_name__isnull=True)
+
+ variables = _build_page_range(Paginator(queryset, pagesize), request.GET.get('page', 1))
+
+ # show all matching files (not just the last one)
+ file_filter= search_term + ":"
+ if filter_string.find('/conf/') > 0:
+ file_filter += 'conf/(local|bblayers).conf'
+ if filter_string.find('conf/machine/') > 0:
+ file_filter += 'conf/machine/'
+ if filter_string.find('conf/distro/') > 0:
+ file_filter += 'conf/distro/'
+ if filter_string.find('/bitbake.conf') > 0:
+ file_filter += '/bitbake.conf'
+ build_dir=re.sub("/tmp/log/.*","",Build.objects.get(pk=build_id).cooker_log_path)
+
+ build = Build.objects.get(pk=build_id)
+
+ context = {
+ 'objectname': 'configvars',
+ 'object_search_display':'BitBake variables',
+ 'filter_search_display':'variables',
+ 'file_filter': file_filter,
+ 'build': build,
+ 'project': build.project,
+ 'objects' : variables,
+ 'total_count':queryset_with_search.count(),
+ 'default_orderby' : 'variable_name:+',
+ 'search_term':search_term,
+ # Specifies the display of columns for the table, appearance in "Edit columns" box, toggling default show/hide, and specifying filters for columns
+ 'tablecols' : [
+ {'name': 'Variable',
+ 'qhelp': "BitBake is a generic task executor that considers a list of tasks with dependencies and handles metadata that consists of variables in a certain format that get passed to the tasks",
+ 'orderfield': _get_toggle_order(request, "variable_name"),
+ 'ordericon':_get_toggle_order_icon(request, "variable_name"),
+ },
+ {'name': 'Value',
+ 'qhelp': "The value assigned to the variable",
+ },
+ {'name': 'Set in file',
+ 'qhelp': "The last configuration file that touched the variable value",
+ 'clclass': 'file', 'hidden' : 0,
+ 'orderkey' : 'vhistory__file_name',
+ 'filter' : {
+ 'class' : 'vhistory__file_name',
+ 'label': 'Show:',
+ 'options' : [
+ ('Local configuration variables', 'vhistory__file_name__contains:'+build_dir+'/conf/',queryset_with_search.filter(vhistory__file_name__contains=build_dir+'/conf/').count(), 'Select this filter to see variables set by the <code>local.conf</code> and <code>bblayers.conf</code> configuration files inside the <code>/build/conf/</code> directory'),
+ ('Machine configuration variables', 'vhistory__file_name__contains:conf/machine/',queryset_with_search.filter(vhistory__file_name__contains='conf/machine').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/machine/</code> directory'),
+ ('Distro configuration variables', 'vhistory__file_name__contains:conf/distro/',queryset_with_search.filter(vhistory__file_name__contains='conf/distro').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/distro/</code> directory'),
+ ('Layer configuration variables', 'vhistory__file_name__contains:conf/layer.conf',queryset_with_search.filter(vhistory__file_name__contains='conf/layer.conf').count(), 'Select this filter to see variables set by the <code>layer.conf</code> configuration file inside your layers'),
+ ('bitbake.conf variables', 'vhistory__file_name__contains:/bitbake.conf',queryset_with_search.filter(vhistory__file_name__contains='/bitbake.conf').count(), 'Select this filter to see variables set by the <code>bitbake.conf</code> configuration file'),
+ ]
+ },
+ },
+ {'name': 'Description',
+ 'qhelp': "A brief explanation of the variable",
+ 'clclass': 'description', 'hidden' : 0,
+ 'dclass': "span4",
+ 'filter' : {
+ 'class' : 'description',
+ 'label': 'Show:',
+ 'options' : [
+ ('Variables with description', 'description__regex:.+', queryset_with_search.filter(description__regex='.+').count(), 'We provide descriptions for the most common BitBake variables. The list of descriptions lives in <code>meta/conf/documentation.conf</code>'),
+ ]
+ },
+ },
+ ],
+ }
+
+ response = toaster_render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def bfile(request, build_id, package_id):
+ template = 'bfile.html'
+ files = Package_File.objects.filter(package = package_id)
+ build = Build.objects.get(pk=build_id)
+ context = {
+ 'build': build,
+ 'project': build.project,
+ 'objects' : files
+ }
+ return toaster_render(request, template, context)
+
+
+# A set of dependency types valid for both included and built package views
+OTHER_DEPENDS_BASE = [
+ Package_Dependency.TYPE_RSUGGESTS,
+ Package_Dependency.TYPE_RPROVIDES,
+ Package_Dependency.TYPE_RREPLACES,
+ Package_Dependency.TYPE_RCONFLICTS,
+ ]
+
+# value for invalid row id
+INVALID_KEY = -1
+
+"""
+Given a package id, target_id retrieves two sets of this image and package's
+dependencies. The return value is a dictionary consisting of two other
+lists: a list of 'runtime' dependencies, that is, having RDEPENDS
+values in source package's recipe, and a list of other dependencies, that is
+the list of possible recipe variables as found in OTHER_DEPENDS_BASE plus
+the RRECOMMENDS or TRECOMMENDS value.
+The lists are built in the sort order specified for the package runtime
+dependency views.
+"""
+def _get_package_dependencies(package_id, target_id = INVALID_KEY):
+ runtime_deps = []
+ other_deps = []
+ other_depends_types = OTHER_DEPENDS_BASE
+
+ if target_id != INVALID_KEY :
+ rdepends_type = Package_Dependency.TYPE_TRDEPENDS
+ other_depends_types += [Package_Dependency.TYPE_TRECOMMENDS]
+ else :
+ rdepends_type = Package_Dependency.TYPE_RDEPENDS
+ other_depends_types += [Package_Dependency.TYPE_RRECOMMENDS]
+
+ package = Package.objects.get(pk=package_id)
+ if target_id != INVALID_KEY :
+ alldeps = package.package_dependencies_source.filter(target_id__exact = target_id)
+ else :
+ alldeps = package.package_dependencies_source.all()
+ for idep in alldeps:
+ dep_package = Package.objects.get(pk=idep.depends_on_id)
+ dep_entry = Package_Dependency.DEPENDS_DICT[idep.dep_type]
+ if dep_package.version == '' :
+ version = ''
+ else :
+ version = dep_package.version + "-" + dep_package.revision
+ installed = False
+ if target_id != INVALID_KEY :
+ if Target_Installed_Package.objects.filter(target_id__exact = target_id, package_id__exact = dep_package.id).count() > 0:
+ installed = True
+ dep = {
+ 'name' : dep_package.name,
+ 'version' : version,
+ 'size' : dep_package.size,
+ 'dep_type' : idep.dep_type,
+ 'dep_type_display' : dep_entry[0].capitalize(),
+ 'dep_type_help' : dep_entry[1] % (dep_package.name, package.name),
+ 'depends_on_id' : dep_package.id,
+ 'installed' : installed,
+ }
+
+ if target_id != INVALID_KEY:
+ dep['alias'] = _get_package_alias(dep_package)
+
+ if idep.dep_type == rdepends_type :
+ runtime_deps.append(dep)
+ elif idep.dep_type in other_depends_types :
+ other_deps.append(dep)
+
+ rdep_sorted = sorted(runtime_deps, key=lambda k: k['name'])
+ odep_sorted = sorted(
+ sorted(other_deps, key=lambda k: k['name']),
+ key=lambda k: k['dep_type'])
+ retvalues = {'runtime_deps' : rdep_sorted, 'other_deps' : odep_sorted}
+ return retvalues
+
+# Return the count of packages dependent on package for this target_id image
+def _get_package_reverse_dep_count(package, target_id):
+ return package.package_dependencies_target.filter(target_id__exact=target_id, dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count()
+
+# Return the count of the packages that this package_id is dependent on.
+# Use one of the two RDEPENDS types, either TRDEPENDS if the package was
+# installed, or else RDEPENDS if only built.
+def _get_package_dependency_count(package, target_id, is_installed):
+ if is_installed :
+ return package.package_dependencies_source.filter(target_id__exact = target_id,
+ dep_type__exact = Package_Dependency.TYPE_TRDEPENDS).count()
+ else :
+ return package.package_dependencies_source.filter(dep_type__exact = Package_Dependency.TYPE_RDEPENDS).count()
+
+def _get_package_alias(package):
+ alias = package.installed_name
+ if alias != None and alias != '' and alias != package.name:
+ return alias
+ else:
+ return ''
+
+def _get_fullpackagespec(package):
+ r = package.name
+ version_good = package.version != None and package.version != ''
+ revision_good = package.revision != None and package.revision != ''
+ if version_good or revision_good:
+ r += '_'
+ if version_good:
+ r += package.version
+ if revision_good:
+ r += '-'
+ if revision_good:
+ r += package.revision
+ return r
+
+def package_built_detail(request, build_id, package_id):
+ template = "package_built_detail.html"
+ if Build.objects.filter(pk=build_id).count() == 0 :
+ return redirect(builds)
+
+ # follow convention for pagination w/ search although not used for this view
+ queryset = Package_File.objects.filter(package_id__exact=package_id)
+ (pagesize, orderby) = _get_parameters_values(request, 25, 'path:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby' : orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'package_built_detail', request.GET, mandatory_parameters, build_id = build_id, package_id = package_id)
+
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
+ paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path')
+
+ package = Package.objects.get(pk=package_id)
+ package.fullpackagespec = _get_fullpackagespec(package)
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'package' : package,
+ 'dependency_count' : _get_package_dependency_count(package, -1, False),
+ 'objects' : paths,
+ 'tablecols':[
+ {
+ 'name':'File',
+ 'orderfield': _get_toggle_order(request, "path"),
+ 'ordericon':_get_toggle_order_icon(request, "path"),
+ },
+ {
+ 'name':'Size',
+ 'orderfield': _get_toggle_order(request, "size", True),
+ 'ordericon':_get_toggle_order_icon(request, "size"),
+ 'dclass': 'sizecol span2',
+ },
+ ]
+ }
+ if paths.all().count() < 2:
+ context['disable_sort'] = True;
+
+ response = toaster_render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def package_built_dependencies(request, build_id, package_id):
+ template = "package_built_dependencies.html"
+ if Build.objects.filter(pk=build_id).count() == 0 :
+ return redirect(builds)
+
+ package = Package.objects.get(pk=package_id)
+ package.fullpackagespec = _get_fullpackagespec(package)
+ dependencies = _get_package_dependencies(package_id)
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'package' : package,
+ 'runtime_deps' : dependencies['runtime_deps'],
+ 'other_deps' : dependencies['other_deps'],
+ 'dependency_count' : _get_package_dependency_count(package, -1, False)
+ }
+ return toaster_render(request, template, context)
+
+
+def package_included_detail(request, build_id, target_id, package_id):
+ template = "package_included_detail.html"
+ if Build.objects.filter(pk=build_id).count() == 0 :
+ return redirect(builds)
+
+ # follow convention for pagination w/ search although not used for this view
+ (pagesize, orderby) = _get_parameters_values(request, 25, 'path:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby' : orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'package_included_detail', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
+
+ queryset = Package_File.objects.filter(package_id__exact=package_id)
+ paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path')
+
+ package = Package.objects.get(pk=package_id)
+ package.fullpackagespec = _get_fullpackagespec(package)
+ package.alias = _get_package_alias(package)
+ target = Target.objects.get(pk=target_id)
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'target' : target,
+ 'package' : package,
+ 'reverse_count' : _get_package_reverse_dep_count(package, target_id),
+ 'dependency_count' : _get_package_dependency_count(package, target_id, True),
+ 'objects': paths,
+ 'tablecols':[
+ {
+ 'name':'File',
+ 'orderfield': _get_toggle_order(request, "path"),
+ 'ordericon':_get_toggle_order_icon(request, "path"),
+ },
+ {
+ 'name':'Size',
+ 'orderfield': _get_toggle_order(request, "size", True),
+ 'ordericon':_get_toggle_order_icon(request, "size"),
+ 'dclass': 'sizecol span2',
+ },
+ ]
+ }
+ if paths.all().count() < 2:
+ context['disable_sort'] = True
+ response = toaster_render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def package_included_dependencies(request, build_id, target_id, package_id):
+ template = "package_included_dependencies.html"
+ if Build.objects.filter(pk=build_id).count() == 0 :
+ return redirect(builds)
+
+ package = Package.objects.get(pk=package_id)
+ package.fullpackagespec = _get_fullpackagespec(package)
+ package.alias = _get_package_alias(package)
+ target = Target.objects.get(pk=target_id)
+
+ dependencies = _get_package_dependencies(package_id, target_id)
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'package' : package,
+ 'target' : target,
+ 'runtime_deps' : dependencies['runtime_deps'],
+ 'other_deps' : dependencies['other_deps'],
+ 'reverse_count' : _get_package_reverse_dep_count(package, target_id),
+ 'dependency_count' : _get_package_dependency_count(package, target_id, True)
+ }
+ return toaster_render(request, template, context)
+
+def package_included_reverse_dependencies(request, build_id, target_id, package_id):
+ template = "package_included_reverse_dependencies.html"
+ if Build.objects.filter(pk=build_id).count() == 0 :
+ return redirect(builds)
+
+ (pagesize, orderby) = _get_parameters_values(request, 25, 'package__name:+')
+ mandatory_parameters = { 'count': pagesize, 'page' : 1, 'orderby': orderby }
+ retval = _verify_parameters( request.GET, mandatory_parameters )
+ if retval:
+ return _redirect_parameters( 'package_included_reverse_dependencies', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id)
+ (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
+
+ queryset = Package_Dependency.objects.select_related('depends_on__name', 'depends_on__size').filter(depends_on=package_id, target_id=target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS)
+ objects = _get_queryset(Package_Dependency, queryset, filter_string, search_term, ordering_string, 'package__name')
+
+ package = Package.objects.get(pk=package_id)
+ package.fullpackagespec = _get_fullpackagespec(package)
+ package.alias = _get_package_alias(package)
+ target = Target.objects.get(pk=target_id)
+ for o in objects:
+ if o.package.version != '':
+ o.package.version += '-' + o.package.revision
+ o.alias = _get_package_alias(o.package)
+ context = {
+ 'build' : Build.objects.get(pk=build_id),
+ 'package' : package,
+ 'target' : target,
+ 'objects' : objects,
+ 'reverse_count' : _get_package_reverse_dep_count(package, target_id),
+ 'dependency_count' : _get_package_dependency_count(package, target_id, True),
+ 'tablecols':[
+ {
+ 'name':'Package',
+ 'orderfield': _get_toggle_order(request, "package__name"),
+ 'ordericon': _get_toggle_order_icon(request, "package__name"),
+ },
+ {
+ 'name':'Version',
+ },
+ {
+ 'name':'Size',
+ 'orderfield': _get_toggle_order(request, "package__size", True),
+ 'ordericon': _get_toggle_order_icon(request, "package__size"),
+ 'dclass': 'sizecol span2',
+ },
+ ]
+ }
+ if objects.all().count() < 2:
+ context['disable_sort'] = True
+ response = toaster_render(request, template, context)
+ _set_parameters_values(pagesize, orderby, request)
+ return response
+
+def image_information_dir(request, build_id, target_id, packagefile_id):
+ # stubbed for now
+ return redirect(builds)
+ # the context processor that supplies data used across all the pages
+
+# a context processor which runs on every request; this provides the
+# projects and non_cli_projects (i.e. projects created by the user)
+# variables referred to in templates, which used to determine the
+# visibility of UI elements like the "New build" button
+def managedcontextprocessor(request):
+ projects = Project.objects.all()
+ ret = {
+ "projects": projects,
+ "non_cli_projects": projects.exclude(is_default=True),
+ "DEBUG" : toastermain.settings.DEBUG,
+ "TOASTER_BRANCH": toastermain.settings.TOASTER_BRANCH,
+ "TOASTER_REVISION" : toastermain.settings.TOASTER_REVISION,
+ }
+ return ret
+
+# REST-based API calls to return build/building status to external Toaster
+# managers and aggregators via JSON
+
+def _json_build_status(build_id,extend):
+ build_stat = None
+ try:
+ build = Build.objects.get( pk = build_id )
+ build_stat = {}
+ build_stat['id'] = build.id
+ build_stat['name'] = build.build_name
+ build_stat['machine'] = build.machine
+ build_stat['distro'] = build.distro
+ build_stat['start'] = build.started_on
+ # look up target name
+ target= Target.objects.get( build = build )
+ if target:
+ if target.task:
+ build_stat['target'] = '%s:%s' % (target.target,target.task)
+ else:
+ build_stat['target'] = '%s' % (target.target)
+ else:
+ build_stat['target'] = ''
+ # look up project name
+ project = Project.objects.get( build = build )
+ if project:
+ build_stat['project'] = project.name
+ else:
+ build_stat['project'] = ''
+ if Build.IN_PROGRESS == build.outcome:
+ now = timezone.now()
+ timediff = now - build.started_on
+ build_stat['seconds']='%.3f' % timediff.total_seconds()
+ build_stat['clone']='%d:%d' % (build.repos_cloned,build.repos_to_clone)
+ build_stat['parse']='%d:%d' % (build.recipes_parsed,build.recipes_to_parse)
+ tf = Task.objects.filter(build = build)
+ tfc = tf.count()
+ if tfc > 0:
+ tfd = tf.exclude(order__isnull=True).count()
+ else:
+ tfd = 0
+ build_stat['task']='%d:%d' % (tfd,tfc)
+ else:
+ build_stat['outcome'] = build.get_outcome_text()
+ timediff = build.completed_on - build.started_on
+ build_stat['seconds']='%.3f' % timediff.total_seconds()
+ build_stat['stop'] = build.completed_on
+ messages = LogMessage.objects.all().filter(build = build)
+ errors = len(messages.filter(level=LogMessage.ERROR) |
+ messages.filter(level=LogMessage.EXCEPTION) |
+ messages.filter(level=LogMessage.CRITICAL))
+ build_stat['errors'] = errors
+ warnings = len(messages.filter(level=LogMessage.WARNING))
+ build_stat['warnings'] = warnings
+ if extend:
+ build_stat['cooker_log'] = build.cooker_log_path
+ except Exception as e:
+ build_state = str(e)
+ return build_stat
+
+def json_builds(request):
+ build_table = []
+ builds = []
+ try:
+ builds = Build.objects.exclude(outcome=Build.IN_PROGRESS).order_by("-started_on")
+ for build in builds:
+ build_table.append(_json_build_status(build.id,False))
+ except Exception as e:
+ build_table = str(e)
+ return JsonResponse({'builds' : build_table, 'count' : len(builds)})
+
+def json_building(request):
+ build_table = []
+ builds = []
+ try:
+ builds = Build.objects.filter(outcome=Build.IN_PROGRESS).order_by("-started_on")
+ for build in builds:
+ build_table.append(_json_build_status(build.id,False))
+ except Exception as e:
+ build_table = str(e)
+ return JsonResponse({'building' : build_table, 'count' : len(builds)})
+
+def json_build(request,build_id):
+ return JsonResponse({'build' : _json_build_status(build_id,True)})
+
+
+import toastermain.settings
+
+from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable
+from bldcontrol.models import BuildEnvironment
+
+# we have a set of functions if we're in managed mode, or
+# a default "page not available" simple functions for interactive mode
+
+if True:
+ from django.contrib.auth.models import User
+ from django.contrib.auth import authenticate, login
+ from django.contrib.auth.decorators import login_required
+
+ from orm.models import LayerSource, ToasterSetting, Release, Machine, LayerVersionDependency
+ from bldcontrol.models import BuildRequest
+
+ import traceback
+
+ class BadParameterException(Exception):
+ ''' The exception raised on invalid POST requests '''
+ pass
+
+ # new project
+ def newproject(request):
+ if not project_enable:
+ return redirect( landing )
+
+ template = "newproject.html"
+ context = {
+ 'email': request.user.email if request.user.is_authenticated() else '',
+ 'username': request.user.username if request.user.is_authenticated() else '',
+ 'releases': Release.objects.order_by("description"),
+ }
+
+ try:
+ context['defaultbranch'] = ToasterSetting.objects.get(name = "DEFAULT_RELEASE").value
+ except ToasterSetting.DoesNotExist:
+ pass
+
+ if request.method == "GET":
+ # render new project page
+ return toaster_render(request, template, context)
+ elif request.method == "POST":
+ mandatory_fields = ['projectname', 'ptype']
+ try:
+ ptype = request.POST.get('ptype')
+ if ptype == "build":
+ mandatory_fields.append('projectversion')
+ # make sure we have values for all mandatory_fields
+ missing = [field for field in mandatory_fields if len(request.POST.get(field, '')) == 0]
+ if missing:
+ # set alert for missing fields
+ raise BadParameterException("Fields missing: %s" % ", ".join(missing))
+
+ if not request.user.is_authenticated():
+ user = authenticate(username = request.POST.get('username', '_anonuser'), password = 'nopass')
+ if user is None:
+ user = User.objects.create_user(username = request.POST.get('username', '_anonuser'), email = request.POST.get('email', ''), password = "nopass")
+
+ user = authenticate(username = user.username, password = 'nopass')
+ login(request, user)
+
+ # save the project
+ if ptype == "analysis":
+ release = None
+ else:
+ release = Release.objects.get(pk = request.POST.get('projectversion', None ))
+
+ prj = Project.objects.create_project(name = request.POST['projectname'], release = release)
+ prj.user_id = request.user.pk
+ prj.save()
+ return redirect(reverse(project, args=(prj.pk,)) + "?notify=new-project")
+
+ except (IntegrityError, BadParameterException) as e:
+ # fill in page with previously submitted values
+ for field in mandatory_fields:
+ context.__setitem__(field, request.POST.get(field, "-- missing"))
+ if isinstance(e, IntegrityError) and "username" in str(e):
+ context['alert'] = "Your chosen username is already used"
+ else:
+ context['alert'] = str(e)
+ return toaster_render(request, template, context)
+
+ raise Exception("Invalid HTTP method for this page")
+
+ # Shows the edit project page
+ def project(request, pid):
+ project = Project.objects.get(pk=pid)
+ context = {"project": project}
+ return toaster_render(request, "project.html", context)
+
+ def jsunittests(request):
+ """ Provides a page for the js unit tests """
+ bbv = BitbakeVersion.objects.filter(branch="master").first()
+ release = Release.objects.filter(bitbake_version=bbv).first()
+
+ name = "_js_unit_test_prj_"
+
+ # If there is an existing project by this name delete it.
+ # We don't want Lots of duplicates cluttering up the projects.
+ Project.objects.filter(name=name).delete()
+
+ new_project = Project.objects.create_project(name=name,
+ release=release)
+ # Add a layer
+ layer = new_project.get_all_compatible_layer_versions().first()
+
+ ProjectLayer.objects.get_or_create(layercommit=layer,
+ project=new_project)
+
+ # make sure we have a machine set for this project
+ ProjectVariable.objects.get_or_create(project=new_project,
+ name="MACHINE",
+ value="qemux86")
+ context = {'project': new_project}
+ return toaster_render(request, "js-unit-tests.html", context)
+
+ from django.views.decorators.csrf import csrf_exempt
+ @csrf_exempt
+ def xhr_testreleasechange(request, pid):
+ def response(data):
+ return HttpResponse(jsonfilter(data),
+ content_type="application/json")
+
+ """ returns layer versions that would be deleted on the new
+ release__pk """
+ try:
+ prj = Project.objects.get(pk = pid)
+ new_release_id = request.GET['new_release_id']
+
+ # If we're already on this project do nothing
+ if prj.release.pk == int(new_release_id):
+ return reponse({"error": "ok", "rows": []})
+
+ retval = []
+
+ for project in prj.projectlayer_set.all():
+ release = Release.objects.get(pk = new_release_id)
+
+ layer_versions = prj.get_all_compatible_layer_versions()
+ layer_versions = layer_versions.filter(release = release)
+ layer_versions = layer_versions.filter(layer__name = project.layercommit.layer.name)
+
+ # there is no layer_version with the new release id,
+ # and the same name
+ if layer_versions.count() < 1:
+ retval.append(project)
+
+ return response({"error":"ok",
+ "rows": [_lv_to_dict(prj) for y in [x.layercommit for x in retval]]
+ })
+
+ except Exception as e:
+ return response({"error": str(e) })
+
+ def xhr_configvaredit(request, pid):
+ try:
+ prj = Project.objects.get(id = pid)
+ # There are cases where user can add variables which hold values
+ # like http://, file:/// etc. In such case a simple split(":")
+ # would fail. One example is SSTATE_MIRRORS variable. So we use
+ # max_split var to handle them.
+ max_split = 1
+ # add conf variables
+ if 'configvarAdd' in request.POST:
+ t=request.POST['configvarAdd'].strip()
+ if ":" in t:
+ variable, value = t.split(":", max_split)
+ else:
+ variable = t
+ value = ""
+
+ pt, created = ProjectVariable.objects.get_or_create(project = prj, name = variable, value = value)
+ # change conf variables
+ if 'configvarChange' in request.POST:
+ t=request.POST['configvarChange'].strip()
+ if ":" in t:
+ variable, value = t.split(":", max_split)
+ else:
+ variable = t
+ value = ""
+
+ pt, created = ProjectVariable.objects.get_or_create(project = prj, name = variable)
+ pt.value=value
+ pt.save()
+ # remove conf variables
+ if 'configvarDel' in request.POST:
+ t=request.POST['configvarDel'].strip()
+ pt = ProjectVariable.objects.get(pk = int(t)).delete()
+
+ # return all project settings, filter out blacklist and elsewhere-managed variables
+ vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context()
+ configvars_query = ProjectVariable.objects.filter(project_id = pid).all()
+ for var in vars_managed:
+ configvars_query = configvars_query.exclude(name = var)
+ for var in vars_blacklist:
+ configvars_query = configvars_query.exclude(name = var)
+
+ return_data = {
+ "error": "ok",
+ 'configvars': [(x.name, x.value, x.pk) for x in configvars_query]
+ }
+ try:
+ return_data['distro'] = ProjectVariable.objects.get(project = prj, name = "DISTRO").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ return_data['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ return_data['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ return_data['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ return_data['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value,
+ except ProjectVariable.DoesNotExist:
+ pass
+
+ return HttpResponse(json.dumps( return_data ), content_type = "application/json")
+
+ except Exception as e:
+ return HttpResponse(json.dumps({"error":str(e) + "\n" + traceback.format_exc()}), content_type = "application/json")
+
+
+ def customrecipe_download(request, pid, recipe_id):
+ recipe = get_object_or_404(CustomImageRecipe, pk=recipe_id)
+
+ file_data = recipe.generate_recipe_file_contents()
+
+ response = HttpResponse(file_data, content_type='text/plain')
+ response['Content-Disposition'] = \
+ 'attachment; filename="%s_%s.bb"' % (recipe.name,
+ recipe.version)
+
+ return response
+
+ def importlayer(request, pid):
+ template = "importlayer.html"
+ context = {
+ 'project': Project.objects.get(id=pid),
+ }
+ return toaster_render(request, template, context)
+
+ def layerdetails(request, pid, layerid):
+ project = Project.objects.get(pk=pid)
+ layer_version = Layer_Version.objects.get(pk=layerid)
+
+ project_layers = ProjectLayer.objects.filter(
+ project=project).values_list("layercommit_id",
+ flat=True)
+
+ context = {
+ 'project': project,
+ 'layer_source': LayerSource.types_dict(),
+ 'layerversion': layer_version,
+ 'layerdeps': {
+ "list": [
+ {
+ "id": dep.id,
+ "name": dep.layer.name,
+ "layerdetailurl": reverse('layerdetails',
+ args=(pid, dep.pk)),
+ "vcs_url": dep.layer.vcs_url,
+ "vcs_reference": dep.get_vcs_reference()
+ }
+ for dep in layer_version.get_alldeps(project.id)]
+ },
+ 'projectlayers': list(project_layers)
+ }
+
+ return toaster_render(request, 'layerdetails.html', context)
+
+
+ def get_project_configvars_context():
+ # Vars managed outside of this view
+ vars_managed = {
+ 'MACHINE', 'BBLAYERS'
+ }
+
+ vars_blacklist = {
+ 'PARALLEL_MAKE','BB_NUMBER_THREADS',
+ 'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT',
+ 'PARALLEL_MAKE','TMPDIR',
+ 'all_proxy','ftp_proxy','http_proxy ','https_proxy'
+ }
+
+ vars_fstypes = Target_Image_File.SUFFIXES
+
+ return(vars_managed,sorted(vars_fstypes),vars_blacklist)
+
+ def projectconf(request, pid):
+
+ try:
+ prj = Project.objects.get(id = pid)
+ except Project.DoesNotExist:
+ return HttpResponseNotFound("<h1>Project id " + pid + " is unavailable</h1>")
+
+ # remove blacklist and externally managed varaibles from this list
+ vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context()
+ configvars = ProjectVariable.objects.filter(project_id = pid).all()
+ for var in vars_managed:
+ configvars = configvars.exclude(name = var)
+ for var in vars_blacklist:
+ configvars = configvars.exclude(name = var)
+
+ context = {
+ 'project': prj,
+ 'configvars': configvars,
+ 'vars_managed': vars_managed,
+ 'vars_fstypes': vars_fstypes,
+ 'vars_blacklist': vars_blacklist,
+ }
+
+ try:
+ context['distro'] = ProjectVariable.objects.get(project = prj, name = "DISTRO").value
+ context['distro_defined'] = "1"
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ if ProjectVariable.objects.get(project = prj, name = "DL_DIR").value == "${TOPDIR}/../downloads":
+ be = BuildEnvironment.objects.get(pk = str(1))
+ dl_dir = os.path.join(dirname(be.builddir), "downloads")
+ context['dl_dir'] = dl_dir
+ pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "DL_DIR")
+ pv.value = dl_dir
+ pv.save()
+ else:
+ context['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value
+ context['dl_dir_defined'] = "1"
+ except (ProjectVariable.DoesNotExist, BuildEnvironment.DoesNotExist):
+ pass
+ try:
+ context['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value
+ context['fstypes_defined'] = "1"
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ context['image_install_append'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_INSTALL_append").value
+ context['image_install_append_defined'] = "1"
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ context['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value
+ context['package_classes_defined'] = "1"
+ except ProjectVariable.DoesNotExist:
+ pass
+ try:
+ if ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value == "${TOPDIR}/../sstate-cache":
+ be = BuildEnvironment.objects.get(pk = str(1))
+ sstate_dir = os.path.join(dirname(be.builddir), "sstate-cache")
+ context['sstate_dir'] = sstate_dir
+ pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "SSTATE_DIR")
+ pv.value = sstate_dir
+ pv.save()
+ else:
+ context['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value
+ context['sstate_dir_defined'] = "1"
+ except (ProjectVariable.DoesNotExist, BuildEnvironment.DoesNotExist):
+ pass
+
+ return toaster_render(request, "projectconf.html", context)
+
+ def _file_names_for_artifact(build, artifact_type, artifact_id):
+ """
+ Return a tuple (file path, file name for the download response) for an
+ artifact of type artifact_type with ID artifact_id for build; if
+ artifact type is not supported, returns (None, None)
+ """
+ file_name = None
+ response_file_name = None
+
+ if artifact_type == "cookerlog":
+ file_name = build.cooker_log_path
+ response_file_name = "cooker.log"
+
+ elif artifact_type == "imagefile":
+ file_name = Target_Image_File.objects.get(target__build = build, pk = artifact_id).file_name
+
+ elif artifact_type == "targetkernelartifact":
+ target = TargetKernelFile.objects.get(pk=artifact_id)
+ file_name = target.file_name
+
+ elif artifact_type == "targetsdkartifact":
+ target = TargetSDKFile.objects.get(pk=artifact_id)
+ file_name = target.file_name
+
+ elif artifact_type == "licensemanifest":
+ file_name = Target.objects.get(build = build, pk = artifact_id).license_manifest_path
+
+ elif artifact_type == "packagemanifest":
+ file_name = Target.objects.get(build = build, pk = artifact_id).package_manifest_path
+
+ elif artifact_type == "tasklogfile":
+ file_name = Task.objects.get(build = build, pk = artifact_id).logfile
+
+ elif artifact_type == "logmessagefile":
+ file_name = LogMessage.objects.get(build = build, pk = artifact_id).pathname
+
+ if file_name and not response_file_name:
+ response_file_name = os.path.basename(file_name)
+
+ return (file_name, response_file_name)
+
+ def build_artifact(request, build_id, artifact_type, artifact_id):
+ """
+ View which returns a build artifact file as a response
+ """
+ file_name = None
+ response_file_name = None
+
+ try:
+ build = Build.objects.get(pk = build_id)
+ file_name, response_file_name = _file_names_for_artifact(
+ build, artifact_type, artifact_id
+ )
+
+ if file_name and response_file_name:
+ fsock = open(file_name, "rb")
+ content_type = MimeTypeFinder.get_mimetype(file_name)
+
+ response = HttpResponse(fsock, content_type = content_type)
+
+ disposition = "attachment; filename=" + response_file_name
+ response["Content-Disposition"] = disposition
+
+ return response
+ else:
+ return toaster_render(request, "unavailable_artifact.html")
+ except (ObjectDoesNotExist, IOError):
+ return toaster_render(request, "unavailable_artifact.html")
+
diff --git a/poky/bitbake/lib/toaster/toastergui/widgets.py b/poky/bitbake/lib/toaster/toastergui/widgets.py
new file mode 100644
index 000000000..a1792d997
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastergui/widgets.py
@@ -0,0 +1,577 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.views.generic import View, TemplateView
+from django.views.decorators.cache import cache_control
+from django.shortcuts import HttpResponse
+from django.core.cache import cache
+from django.core.paginator import Paginator, EmptyPage
+from django.db.models import Q
+from orm.models import Project, Build
+from django.template import Context, Template
+from django.template import VariableDoesNotExist
+from django.template import TemplateSyntaxError
+from django.core.serializers.json import DjangoJSONEncoder
+from django.core.exceptions import FieldError
+from django.utils import timezone
+from toastergui.templatetags.projecttags import sectohms, get_tasks
+from toastergui.templatetags.projecttags import json as template_json
+from django.http import JsonResponse
+from django.core.urlresolvers import reverse
+
+import types
+import json
+import collections
+import re
+import os
+
+from toastergui.tablefilter import TableFilterMap
+
+try:
+ from urllib import unquote_plus
+except ImportError:
+ from urllib.parse import unquote_plus
+
+import logging
+logger = logging.getLogger("toaster")
+
+
+class NoFieldOrDataName(Exception):
+ pass
+
+
+class ToasterTable(TemplateView):
+ def __init__(self, *args, **kwargs):
+ super(ToasterTable, self).__init__()
+ if 'template_name' in kwargs:
+ self.template_name = kwargs['template_name']
+ self.title = "Table"
+ self.queryset = None
+ self.columns = []
+
+ # map from field names to Filter instances
+ self.filter_map = TableFilterMap()
+
+ self.total_count = 0
+ self.static_context_extra = {}
+ self.empty_state = "Sorry - no data found"
+ self.default_orderby = ""
+
+ # prevent HTTP caching of table data
+ @cache_control(must_revalidate=True,
+ max_age=0, no_store=True, no_cache=True)
+ def dispatch(self, *args, **kwargs):
+ return super(ToasterTable, self).dispatch(*args, **kwargs)
+
+ def get_context_data(self, **kwargs):
+ context = super(ToasterTable, self).get_context_data(**kwargs)
+ context['title'] = self.title
+ context['table_name'] = type(self).__name__.lower()
+ context['empty_state'] = self.empty_state
+
+ # global variables
+ context['project_enable'] = ('1' == os.environ.get('TOASTER_BUILDSERVER'))
+
+ return context
+
+ def get(self, request, *args, **kwargs):
+ if request.GET.get('format', None) == 'json':
+
+ self.setup_queryset(*args, **kwargs)
+ # Put the project id into the context for the static_data_template
+ if 'pid' in kwargs:
+ self.static_context_extra['pid'] = kwargs['pid']
+
+ cmd = request.GET.get('cmd', None)
+ if cmd and 'filterinfo' in cmd:
+ data = self.get_filter_info(request, **kwargs)
+ else:
+ # If no cmd is specified we give you the table data
+ data = self.get_data(request, **kwargs)
+
+ return HttpResponse(data, content_type="application/json")
+
+ return super(ToasterTable, self).get(request, *args, **kwargs)
+
+ def get_filter_info(self, request, **kwargs):
+ self.setup_filters(**kwargs)
+
+ search = request.GET.get("search", None)
+ if search:
+ self.apply_search(search)
+
+ name = request.GET.get("name", None)
+ table_filter = self.filter_map.get_filter(name)
+ return json.dumps(table_filter.to_json(self.queryset),
+ indent=2,
+ cls=DjangoJSONEncoder)
+
+ def setup_columns(self, *args, **kwargs):
+ """ function to implement in the subclass which sets up
+ the columns """
+ pass
+
+ def setup_filters(self, *args, **kwargs):
+ """ function to implement in the subclass which sets up the
+ filters """
+ pass
+
+ def setup_queryset(self, *args, **kwargs):
+ """ function to implement in the subclass which sets up the
+ queryset"""
+ pass
+
+ def add_filter(self, table_filter):
+ """Add a filter to the table.
+
+ Args:
+ table_filter: Filter instance
+ """
+ self.filter_map.add_filter(table_filter.name, table_filter)
+
+ def add_column(self, title="", help_text="",
+ orderable=False, hideable=True, hidden=False,
+ field_name="", filter_name=None, static_data_name=None,
+ static_data_template=None):
+ """Add a column to the table.
+
+ Args:
+ title (str): Title for the table header
+ help_text (str): Optional help text to describe the column
+ orderable (bool): Whether the column can be ordered.
+ We order on the field_name.
+ hideable (bool): Whether the user can hide the column
+ hidden (bool): Whether the column is default hidden
+ field_name (str or list): field(s) required for this column's data
+ static_data_name (str, optional): The column's main identifier
+ which will replace the field_name.
+ static_data_template(str, optional): The template to be rendered
+ as data
+ """
+
+ self.columns.append({'title': title,
+ 'help_text': help_text,
+ 'orderable': orderable,
+ 'hideable': hideable,
+ 'hidden': hidden,
+ 'field_name': field_name,
+ 'filter_name': filter_name,
+ 'static_data_name': static_data_name,
+ 'static_data_template': static_data_template})
+
+ def set_column_hidden(self, title, hidden):
+ """
+ Set the hidden state of the column to the value of hidden
+ """
+ for col in self.columns:
+ if col['title'] == title:
+ col['hidden'] = hidden
+ break
+
+ def set_column_hideable(self, title, hideable):
+ """
+ Set the hideable state of the column to the value of hideable
+ """
+ for col in self.columns:
+ if col['title'] == title:
+ col['hideable'] = hideable
+ break
+
+ def render_static_data(self, template, row):
+ """Utility function to render the static data template"""
+
+ context = {
+ 'extra': self.static_context_extra,
+ 'data': row,
+ }
+
+ context = Context(context)
+ template = Template(template)
+
+ return template.render(context)
+
+ def apply_filter(self, filters, filter_value, **kwargs):
+ """
+ Apply a filter submitted in the querystring to the ToasterTable
+
+ filters: (str) in the format:
+ '<filter name>:<action name>'
+ filter_value: (str) parameters to pass to the named filter
+
+ <filter name> and <action name> are used to look up the correct filter
+ in the ToasterTable's filter map; the <action params> are set on
+ TableFilterAction* before its filter is applied and may modify the
+ queryset returned by the filter
+ """
+ self.setup_filters(**kwargs)
+
+ try:
+ filter_name, action_name = filters.split(':')
+ action_params = unquote_plus(filter_value)
+ except ValueError:
+ return
+
+ if "all" in action_name:
+ return
+
+ try:
+ table_filter = self.filter_map.get_filter(filter_name)
+ action = table_filter.get_action(action_name)
+ action.set_filter_params(action_params)
+ self.queryset = action.filter(self.queryset)
+ except KeyError:
+ # pass it to the user - programming error here
+ raise
+
+ def apply_orderby(self, orderby):
+ # Note that django will execute this when we try to retrieve the data
+ self.queryset = self.queryset.order_by(orderby)
+
+ def apply_search(self, search_term):
+ """Creates a query based on the model's search_allowed_fields"""
+
+ if not hasattr(self.queryset.model, 'search_allowed_fields'):
+ raise Exception("Search fields aren't defined in the model %s"
+ % self.queryset.model)
+
+ search_queries = None
+ for st in search_term.split(" "):
+ queries = None
+ for field in self.queryset.model.search_allowed_fields:
+ query = Q(**{field + '__icontains': st})
+ if queries:
+ queries |= query
+ else:
+ queries = query
+
+ if search_queries:
+ search_queries &= queries
+ else:
+ search_queries = queries
+
+ self.queryset = self.queryset.filter(search_queries)
+
+ def get_data(self, request, **kwargs):
+ """
+ Returns the data for the page requested with the specified
+ parameters applied
+
+ filters: filter and action name, e.g. "outcome:build_succeeded"
+ filter_value: value to pass to the named filter+action, e.g. "on"
+ (for a toggle filter) or "2015-12-11,2015-12-12"
+ (for a date range filter)
+ """
+
+ page_num = request.GET.get("page", 1)
+ limit = request.GET.get("limit", 10)
+ search = request.GET.get("search", None)
+ filters = request.GET.get("filter", None)
+ filter_value = request.GET.get("filter_value", "on")
+ orderby = request.GET.get("orderby", None)
+ nocache = request.GET.get("nocache", None)
+
+ # Make a unique cache name
+ cache_name = self.__class__.__name__
+
+ for key, val in request.GET.items():
+ if key == 'nocache':
+ continue
+ cache_name = cache_name + str(key) + str(val)
+
+ for key, val in kwargs.items():
+ cache_name = cache_name + str(key) + str(val)
+
+ # No special chars allowed in the cache name apart from dash
+ cache_name = re.sub(r'[^A-Za-z0-9-]', "", cache_name)
+
+ if nocache:
+ cache.delete(cache_name)
+
+ data = cache.get(cache_name)
+
+ if data:
+ logger.debug("Got cache data for table '%s'" % self.title)
+ return data
+
+ self.setup_columns(**kwargs)
+
+ if search:
+ self.apply_search(search)
+ if filters:
+ self.apply_filter(filters, filter_value, **kwargs)
+ if orderby:
+ self.apply_orderby(orderby)
+
+ paginator = Paginator(self.queryset, limit)
+
+ try:
+ page = paginator.page(page_num)
+ except EmptyPage:
+ page = paginator.page(1)
+
+ data = {
+ 'total': self.queryset.count(),
+ 'default_orderby': self.default_orderby,
+ 'columns': self.columns,
+ 'rows': [],
+ 'error': "ok",
+ }
+
+ try:
+ for model_obj in page.object_list:
+ # Use collection to maintain the order
+ required_data = collections.OrderedDict()
+
+ for col in self.columns:
+ field = col['field_name']
+ if not field:
+ field = col['static_data_name']
+ if not field:
+ raise NoFieldOrDataName("Must supply a field_name or"
+ "static_data_name for column"
+ "%s.%s" %
+ (self.__class__.__name__, col)
+ )
+
+ # Check if we need to process some static data
+ if "static_data_name" in col and col['static_data_name']:
+ # Overwrite the field_name with static_data_name
+ # so that this can be used as the html class name
+ col['field_name'] = col['static_data_name']
+
+ try:
+ # Render the template given
+ required_data[col['static_data_name']] = \
+ self.render_static_data(
+ col['static_data_template'], model_obj)
+ except (TemplateSyntaxError,
+ VariableDoesNotExist) as e:
+ logger.error("could not render template code"
+ "%s %s %s",
+ col['static_data_template'],
+ e, self.__class__.__name__)
+ required_data[col['static_data_name']] =\
+ '<!--error-->'
+
+ else:
+ # Traverse to any foriegn key in the field
+ # e.g. recipe__layer_version__name
+ model_data = None
+
+ if "__" in field:
+ for subfield in field.split("__"):
+ if not model_data:
+ # The first iteration is always going to
+ # be on the actual model object instance.
+ # Subsequent ones are on the result of
+ # that. e.g. forieng key objects
+ model_data = getattr(model_obj,
+ subfield)
+ else:
+ model_data = getattr(model_data,
+ subfield)
+
+ else:
+ model_data = getattr(model_obj,
+ col['field_name'])
+
+ # We might have a model function as the field so
+ # call it to return the data needed
+ if isinstance(model_data, types.MethodType):
+ model_data = model_data()
+
+ required_data[col['field_name']] = model_data
+
+ data['rows'].append(required_data)
+
+ except FieldError:
+ # pass it to the user - programming-error here
+ raise
+
+ data = json.dumps(data, indent=2, cls=DjangoJSONEncoder)
+ cache.set(cache_name, data, 60*30)
+
+ return data
+
+
+class ToasterTypeAhead(View):
+ """ A typeahead mechanism to support the front end typeahead widgets """
+ MAX_RESULTS = 6
+
+ class MissingFieldsException(Exception):
+ pass
+
+ def __init__(self, *args, **kwargs):
+ super(ToasterTypeAhead, self).__init__()
+
+ def get(self, request, *args, **kwargs):
+ def response(data):
+ return HttpResponse(json.dumps(data,
+ indent=2,
+ cls=DjangoJSONEncoder),
+ content_type="application/json")
+
+ error = "ok"
+
+ search_term = request.GET.get("search", None)
+ if search_term is None:
+ # We got no search value so return empty reponse
+ return response({'error': error, 'results': []})
+
+ try:
+ prj = Project.objects.get(pk=kwargs['pid'])
+ except KeyError:
+ prj = None
+
+ results = self.apply_search(search_term,
+ prj,
+ request)[:ToasterTypeAhead.MAX_RESULTS]
+
+ if len(results) > 0:
+ try:
+ self.validate_fields(results[0])
+ except self.MissingFieldsException as e:
+ error = e
+
+ data = {'results': results,
+ 'error': error}
+
+ return response(data)
+
+ def validate_fields(self, result):
+ if 'name' in result is False or 'detail' in result is False:
+ raise self.MissingFieldsException(
+ "name and detail are required fields")
+
+ def apply_search(self, search_term, prj):
+ """ Override this function to implement search. Return an array of
+ dictionaries with a minium of a name and detail field"""
+ pass
+
+
+class MostRecentBuildsView(View):
+ def _was_yesterday_or_earlier(self, completed_on):
+ now = timezone.now()
+ delta = now - completed_on
+
+ if delta.days >= 1:
+ return True
+
+ return False
+
+ def get(self, request, *args, **kwargs):
+ """
+ Returns a list of builds in JSON format.
+ """
+ project = None
+
+ project_id = request.GET.get('project_id', None)
+ if project_id:
+ try:
+ project = Project.objects.get(pk=project_id)
+ except:
+ # if project lookup fails, assume no project
+ pass
+
+ recent_build_objs = Build.get_recent(project)
+ recent_builds = []
+
+ for build_obj in recent_build_objs:
+ dashboard_url = reverse('builddashboard', args=(build_obj.pk,))
+ buildtime_url = reverse('buildtime', args=(build_obj.pk,))
+ rebuild_url = \
+ reverse('xhr_buildrequest', args=(build_obj.project.pk,))
+ cancel_url = \
+ reverse('xhr_buildrequest', args=(build_obj.project.pk,))
+
+ build = {}
+ build['id'] = build_obj.pk
+ build['dashboard_url'] = dashboard_url
+
+ buildrequest_id = None
+ if hasattr(build_obj, 'buildrequest'):
+ buildrequest_id = build_obj.buildrequest.pk
+ build['buildrequest_id'] = buildrequest_id
+
+ build['recipes_parsed_percentage'] = \
+ int((build_obj.recipes_parsed /
+ build_obj.recipes_to_parse) * 100)
+
+ build['repos_cloned_percentage'] = \
+ int((build_obj.repos_cloned /
+ build_obj.repos_to_clone) * 100)
+
+ tasks_complete_percentage = 0
+ if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED):
+ tasks_complete_percentage = 100
+ elif build_obj.outcome == Build.IN_PROGRESS:
+ tasks_complete_percentage = build_obj.completeper()
+ build['tasks_complete_percentage'] = tasks_complete_percentage
+
+ build['state'] = build_obj.get_state()
+
+ build['errors'] = build_obj.errors.count()
+ build['dashboard_errors_url'] = dashboard_url + '#errors'
+
+ build['warnings'] = build_obj.warnings.count()
+ build['dashboard_warnings_url'] = dashboard_url + '#warnings'
+
+ build['buildtime'] = sectohms(build_obj.timespent_seconds)
+ build['buildtime_url'] = buildtime_url
+
+ build['rebuild_url'] = rebuild_url
+ build['cancel_url'] = cancel_url
+
+ build['is_default_project_build'] = build_obj.project.is_default
+
+ build['build_targets_json'] = \
+ template_json(get_tasks(build_obj.target_set.all()))
+
+ # convert completed_on time to user's timezone
+ completed_on = timezone.localtime(build_obj.completed_on)
+
+ completed_on_template = '%H:%M'
+ if self._was_yesterday_or_earlier(completed_on):
+ completed_on_template = '%d/%m/%Y ' + completed_on_template
+ build['completed_on'] = completed_on.strftime(
+ completed_on_template)
+
+ targets = []
+ target_objs = build_obj.get_sorted_target_list()
+ for target_obj in target_objs:
+ if target_obj.task:
+ targets.append(target_obj.target + ':' + target_obj.task)
+ else:
+ targets.append(target_obj.target)
+ build['targets'] = ' '.join(targets)
+
+ # abbreviated form of the full target list
+ abbreviated_targets = ''
+ num_targets = len(targets)
+ if num_targets > 0:
+ abbreviated_targets = targets[0]
+ if num_targets > 1:
+ abbreviated_targets += (' +%s' % (num_targets - 1))
+ build['targets_abbreviated'] = abbreviated_targets
+
+ recent_builds.append(build)
+
+ return JsonResponse(recent_builds, safe=False)
diff --git a/poky/bitbake/lib/toaster/toastermain/__init__.py b/poky/bitbake/lib/toaster/toastermain/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/__init__.py
diff --git a/poky/bitbake/lib/toaster/toastermain/management/__init__.py b/poky/bitbake/lib/toaster/toastermain/management/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/__init__.py
diff --git a/poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py b/poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/commands/__init__.py
diff --git a/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
new file mode 100644
index 000000000..0bef8d410
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
@@ -0,0 +1,54 @@
+from django.core.management.base import BaseCommand, CommandError
+from django.core.exceptions import ObjectDoesNotExist
+from orm.models import Build
+from django.db import OperationalError
+import os
+
+
+
+class Command(BaseCommand):
+ args = '<buildID1 buildID2 .....>'
+ help = "Deletes selected build(s)"
+
+ def handle(self, *args, **options):
+ for bid in args:
+ try:
+ b = Build.objects.get(pk = bid)
+ except ObjectDoesNotExist:
+ print('build %s does not exist, skipping...' %(bid))
+ continue
+ # theoretically, just b.delete() would suffice
+ # however SQLite runs into problems when you try to
+ # delete too many rows at once, so we delete some direct
+ # relationships from Build manually.
+ for t in b.target_set.all():
+ t.delete()
+ for t in b.task_build.all():
+ t.delete()
+ for p in b.package_set.all():
+ p.delete()
+ for lv in b.layer_version_build.all():
+ lv.delete()
+ for v in b.variable_build.all():
+ v.delete()
+ for l in b.logmessage_set.all():
+ l.delete()
+
+ # delete the build; some databases might have had problem with migration of the bldcontrol app
+ retry_count = 0
+ need_bldcontrol_migration = False
+ while True:
+ if retry_count >= 5:
+ break
+ retry_count += 1
+ if need_bldcontrol_migration:
+ from django.core import management
+ management.call_command('migrate', 'bldcontrol', interactive=False)
+
+ try:
+ b.delete()
+ break
+ except OperationalError as e:
+ # execute migrations
+ need_bldcontrol_migration = True
+
diff --git a/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py b/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
new file mode 100644
index 000000000..70b5812d9
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
@@ -0,0 +1,13 @@
+from django.core.management.base import BaseCommand, CommandError
+from orm.models import Build
+import os
+
+
+
+class Command(BaseCommand):
+ args = ""
+ help = "Lists current builds"
+
+ def handle(self,**options):
+ for b in Build.objects.all():
+ print("%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()])))
diff --git a/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py b/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
new file mode 100644
index 000000000..0399b8659
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Custom management command checksocket."""
+
+import errno
+import socket
+
+from django.core.management.base import BaseCommand, CommandError
+from django.utils.encoding import force_text
+
+DEFAULT_ADDRPORT = "0.0.0.0:8000"
+
+class Command(BaseCommand):
+ """Custom management command."""
+
+ help = 'Check if Toaster can listen on address:port'
+
+ def add_arguments(self, parser):
+ parser.add_argument('addrport', nargs='?', default=DEFAULT_ADDRPORT,
+ help='ipaddr:port to check, %s by default' % \
+ DEFAULT_ADDRPORT)
+
+ def handle(self, *args, **options):
+ addrport = options['addrport']
+ if ':' not in addrport:
+ raise CommandError('Invalid addr:port specified: %s' % addrport)
+ splitted = addrport.split(':')
+ try:
+ splitted[1] = int(splitted[1])
+ except ValueError:
+ raise CommandError('Invalid port specified: %s' % splitted[1])
+ self.stdout.write('Check if toaster can listen on %s' % addrport)
+ try:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ sock.bind(tuple(splitted))
+ except (socket.error, OverflowError) as err:
+ errors = {
+ errno.EACCES: 'You don\'t have permission to access port %s' \
+ % splitted[1],
+ errno.EADDRINUSE: 'Port %s is already in use' % splitted[1],
+ errno.EADDRNOTAVAIL: 'IP address can\'t be assigned to',
+ }
+ if hasattr(err, 'errno') and err.errno in errors:
+ errtext = errors[err.errno]
+ else:
+ errtext = force_text(err)
+ raise CommandError(errtext)
+
+ self.stdout.write("OK")
diff --git a/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py b/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
new file mode 100644
index 000000000..6b450bbdf
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
@@ -0,0 +1,58 @@
+from django.core.management.base import BaseCommand
+from django.test.client import Client
+import os, sys, re
+import requests
+from django.conf import settings
+
+# pylint: disable=E1103
+# Instance of 'WSGIRequest' has no 'status_code' member
+# (but some types could not be inferred) (maybe-no-member)
+
+
+class Command(BaseCommand):
+ help = "Test the response time for all toaster urls"
+
+ def handle(self, *args, **options):
+ root_urlconf = __import__(settings.ROOT_URLCONF)
+ patterns = root_urlconf.urls.urlpatterns
+ global full_url
+ for pat in patterns:
+ if pat.__class__.__name__ == 'RegexURLResolver':
+ url_root_res = str(pat).split('^')[1].replace('>', '')
+ if 'gui' in url_root_res:
+ for url_patt in pat.url_patterns:
+ full_url = self.get_full_url(url_patt, url_root_res)
+ info = self.url_info(full_url)
+ status_code = info[0]
+ load_time = info[1]
+ print('Trying \'' + full_url + '\', ' + str(status_code) + ', ' + str(load_time))
+
+ def get_full_url(self, url_patt, url_root_res):
+ full_url = str(url_patt).split('^')[1].replace('$>', '').replace('(?P<file_path>(?:/[', '/bin/busybox').replace('.*', '')
+ full_url = str(url_root_res + full_url)
+ full_url = re.sub('\(\?P<.*?>\\\d\+\)', '1', full_url)
+ full_url = 'http://localhost:8000/' + full_url
+ return full_url
+
+ def url_info(self, full_url):
+ client = Client()
+ info = []
+ try:
+ resp = client.get(full_url, follow = True)
+ except Exception as e_status_code:
+ self.error('Url: %s, error: %s' % (full_url, e_status_code))
+ resp = type('object', (), {'status_code':0, 'content': str(e_status_code)})
+ status_code = resp.status_code
+ info.append(status_code)
+ try:
+ req = requests.get(full_url)
+ except Exception as e_load_time:
+ self.error('Url: %s, error: %s' % (full_url, e_load_time))
+ load_time = req.elapsed
+ info.append(load_time)
+ return info
+
+ def error(self, *args):
+ for arg in args:
+ print(arg, end=' ', file=sys.stderr)
+ print(file=sys.stderr)
diff --git a/poky/bitbake/lib/toaster/toastermain/settings.py b/poky/bitbake/lib/toaster/toastermain/settings.py
new file mode 100644
index 000000000..13541d380
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/settings.py
@@ -0,0 +1,369 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Django settings for Toaster project.
+
+import os
+
+DEBUG = True
+
+# Set to True to see the SQL queries in console
+SQL_DEBUG = False
+if os.environ.get("TOASTER_SQLDEBUG", None) is not None:
+ SQL_DEBUG = True
+
+
+ADMINS = (
+ # ('Your Name', 'your_email@example.com'),
+)
+
+MANAGERS = ADMINS
+
+TOASTER_SQLITE_DEFAULT_DIR = os.environ.get('TOASTER_DIR')
+
+DATABASES = {
+ 'default': {
+ # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+ 'ENGINE': 'django.db.backends.sqlite3',
+ # DB name or full path to database file if using sqlite3.
+ 'NAME': "%s/toaster.sqlite" % TOASTER_SQLITE_DEFAULT_DIR,
+ 'USER': '',
+ 'PASSWORD': '',
+ #'HOST': '127.0.0.1', # e.g. mysql server
+ #'PORT': '3306', # e.g. mysql port
+ }
+}
+
+# Needed when Using sqlite especially to add a longer timeout for waiting
+# for the database lock to be released
+# https://docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors
+if 'sqlite' in DATABASES['default']['ENGINE']:
+ DATABASES['default']['OPTIONS'] = { 'timeout': 20 }
+
+# Update as of django 1.8.16 release, the '*' is needed to allow us to connect while running
+# on hosts without explicitly setting the fqdn for the toaster server.
+# See https://docs.djangoproject.com/en/dev/ref/settings/ for info on ALLOWED_HOSTS
+# Previously this setting was not enforced if DEBUG was set but it is now.
+# The previous behavior was such that ALLOWED_HOSTS defaulted to ['localhost','127.0.0.1','::1']
+# and if you bound to 0.0.0.0:<port #> then accessing toaster as localhost or fqdn would both work.
+# To have that same behavior, with a fqdn explicitly enabled you would set
+# ALLOWED_HOSTS= ['localhost','127.0.0.1','::1','myserver.mycompany.com'] for
+# Django >= 1.8.16. By default, we are not enforcing this restriction in
+# DEBUG mode.
+if DEBUG is True:
+ # this will allow connection via localhost,hostname, or fqdn
+ ALLOWED_HOSTS = ['*']
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be available on all operating systems.
+# In a Windows environment this must be set to your system time zone.
+
+# Always use local computer's time zone, find
+import hashlib
+if 'TZ' in os.environ:
+ TIME_ZONE = os.environ['TZ']
+else:
+ # need to read the /etc/localtime file which is the libc standard
+ # and do a reverse-mapping to /usr/share/zoneinfo/;
+ # since the timezone may match any number of identical timezone definitions,
+
+ zonefilelist = {}
+ ZONEINFOPATH = '/usr/share/zoneinfo/'
+ for dirpath, dirnames, filenames in os.walk(ZONEINFOPATH):
+ for fn in filenames:
+ filepath = os.path.join(dirpath, fn)
+ zonename = filepath.lstrip(ZONEINFOPATH).strip()
+ try:
+ import pytz
+ from pytz.exceptions import UnknownTimeZoneError
+ try:
+ if pytz.timezone(zonename) is not None:
+ zonefilelist[hashlib.md5(open(filepath, 'rb').read()).hexdigest()] = zonename
+ except UnknownTimeZoneError as ValueError:
+ # we expect timezone failures here, just move over
+ pass
+ except ImportError:
+ zonefilelist[hashlib.md5(open(filepath, 'rb').read()).hexdigest()] = zonename
+
+ TIME_ZONE = zonefilelist[hashlib.md5(open('/etc/localtime', 'rb').read()).hexdigest()]
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+USE_I18N = True
+
+# If you set this to False, Django will not format dates, numbers and
+# calendars according to the current locale.
+USE_L10N = True
+
+# If you set this to False, Django will not use timezone-aware datetimes.
+USE_TZ = True
+
+# Absolute filesystem path to the directory that will hold user-uploaded files.
+# Example: "/var/www/example.com/media/"
+MEDIA_ROOT = ''
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash.
+# Examples: "http://example.com/media/", "http://media.example.com/"
+MEDIA_URL = ''
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/var/www/example.com/static/"
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://example.com/static/", "http://static.example.com/"
+STATIC_URL = '/static/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+ # Put strings here, like "/home/html/static" or "C:/www/django/static".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT'
+
+class InvalidString(str):
+ def __mod__(self, other):
+ from django.template.base import TemplateSyntaxError
+ raise TemplateSyntaxError(
+ "Undefined variable or unknown value for: \"%s\"" % other)
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+ ],
+ 'OPTIONS': {
+ 'context_processors': [
+ # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
+ # list if you haven't customized them:
+ 'django.contrib.auth.context_processors.auth',
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.i18n',
+ 'django.template.context_processors.media',
+ 'django.template.context_processors.static',
+ 'django.template.context_processors.tz',
+ 'django.contrib.messages.context_processors.messages',
+ # Custom
+ 'django.template.context_processors.request',
+ 'toastergui.views.managedcontextprocessor',
+
+ ],
+ 'loaders': [
+ # List of callables that know how to import templates from various sources.
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+ #'django.template.loaders.eggs.Loader',
+ ],
+ 'string_if_invalid': InvalidString("%s"),
+ 'debug': DEBUG,
+ },
+ },
+]
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ # Uncomment the next line for simple clickjacking protection:
+ # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+)
+
+CACHES = {
+ # 'default': {
+ # 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+ # 'LOCATION': '127.0.0.1:11211',
+ # },
+ 'default': {
+ 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
+ 'LOCATION': '/tmp/toaster_cache_%d' % os.getuid(),
+ 'TIMEOUT': 1,
+ }
+ }
+
+
+from os.path import dirname as DN
+SITE_ROOT=DN(DN(os.path.abspath(__file__)))
+
+import subprocess
+TOASTER_BRANCH = subprocess.Popen('git branch | grep "^* " | tr -d "* "', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
+TOASTER_REVISION = subprocess.Popen('git rev-parse HEAD ', cwd = SITE_ROOT, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0]
+
+ROOT_URLCONF = 'toastermain.urls'
+
+# Python dotted path to the WSGI application used by Django's runserver.
+WSGI_APPLICATION = 'toastermain.wsgi.application'
+
+
+INSTALLED_APPS = (
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.messages',
+ 'django.contrib.sessions',
+ 'django.contrib.admin',
+ 'django.contrib.staticfiles',
+
+ # Uncomment the next line to enable admin documentation:
+ # 'django.contrib.admindocs',
+ 'django.contrib.humanize',
+ 'bldcollector',
+ 'toastermain',
+)
+
+
+INTERNAL_IPS = ['127.0.0.1', '192.168.2.28']
+
+# Load django-fresh is TOASTER_DEVEL is set, and the module is available
+FRESH_ENABLED = False
+if os.environ.get('TOASTER_DEVEL', None) is not None:
+ try:
+ import fresh
+ MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES
+ INSTALLED_APPS = INSTALLED_APPS + ('fresh',)
+ FRESH_ENABLED = True
+ except:
+ pass
+
+DEBUG_PANEL_ENABLED = False
+if os.environ.get('TOASTER_DEVEL', None) is not None:
+ try:
+ import debug_toolbar, debug_panel
+ MIDDLEWARE_CLASSES = ('debug_panel.middleware.DebugPanelMiddleware',) + MIDDLEWARE_CLASSES
+ #MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+ INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',)
+ DEBUG_PANEL_ENABLED = True
+
+ # this cache backend will be used by django-debug-panel
+ CACHES['debug-panel'] = {
+ 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
+ 'LOCATION': '/var/tmp/debug-panel-cache',
+ 'TIMEOUT': 300,
+ 'OPTIONS': {
+ 'MAX_ENTRIES': 200
+ }
+ }
+
+ except:
+ pass
+
+
+SOUTH_TESTS_MIGRATE = False
+
+
+# We automatically detect and install applications here if
+# they have a 'models.py' or 'views.py' file
+import os
+currentdir = os.path.dirname(__file__)
+for t in os.walk(os.path.dirname(currentdir)):
+ modulename = os.path.basename(t[0])
+ #if we have a virtualenv skip it to avoid incorrect imports
+ if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]:
+ continue
+
+ if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS:
+ INSTALLED_APPS = INSTALLED_APPS + (modulename,)
+
+# A sample logging configuration. The only tangible logging
+# performed by this configuration is to send an email to
+# the site admins on every HTTP 500 error when DEBUG=False.
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize your logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'filters': {
+ 'require_debug_false': {
+ '()': 'django.utils.log.RequireDebugFalse'
+ }
+ },
+ 'formatters': {
+ 'datetime': {
+ 'format': '%(asctime)s %(levelname)s %(message)s'
+ }
+ },
+ 'handlers': {
+ 'mail_admins': {
+ 'level': 'ERROR',
+ 'filters': ['require_debug_false'],
+ 'class': 'django.utils.log.AdminEmailHandler'
+ },
+ 'console': {
+ 'level': 'DEBUG',
+ 'class': 'logging.StreamHandler',
+ 'formatter': 'datetime',
+ }
+ },
+ 'loggers': {
+ 'toaster' : {
+ 'handlers': ['console'],
+ 'level': 'DEBUG',
+ },
+ 'django.request': {
+ 'handlers': ['console'],
+ 'level': 'WARN',
+ 'propagate': True,
+ },
+ }
+}
+
+if DEBUG and SQL_DEBUG:
+ LOGGING['loggers']['django.db.backends'] = {
+ 'level': 'DEBUG',
+ 'handlers': ['console'],
+ }
+
+
+# If we're using sqlite, we need to tweak the performance a bit
+from django.db.backends.signals import connection_created
+def activate_synchronous_off(sender, connection, **kwargs):
+ if connection.vendor == 'sqlite':
+ cursor = connection.cursor()
+ cursor.execute('PRAGMA synchronous = 0;')
+connection_created.connect(activate_synchronous_off)
+#
+
+
+
diff --git a/poky/bitbake/lib/toaster/toastermain/settings_production_example.py b/poky/bitbake/lib/toaster/toastermain/settings_production_example.py
new file mode 100644
index 000000000..61a288864
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/settings_production_example.py
@@ -0,0 +1,58 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# See Django documentation for more information about deployment
+# https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
+
+# Toaster production settings example overlay
+# To use this copy this example to "settings_production.py" and set in your
+# environment DJANGO_SETTINGS_MODULE=toastermain.settings_production
+# This can be permanently set in a new .wsgi file
+
+from toastermain.settings import * # NOQA
+
+# Set this value!
+SECRET_KEY = None
+
+# Switch off any debugging
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': 'toaster_data',
+ 'USER': 'toaster',
+ 'PASSWORD': 'yourpasswordhere',
+ 'HOST': '127.0.0.1',
+ 'PORT': '3306',
+ }
+}
+
+# Location where static files will be placed by "manage.py collectstatic"
+STATIC_ROOT = '/var/www/static-toaster/'
+
+# URL prefix for static files.
+STATIC_URL = '/static-toaster/'
+
+# Hosts that Django will serve
+# https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-ALLOWED_HOSTS
+ALLOWED_HOSTS = ['toaster-example.example.com']
diff --git a/poky/bitbake/lib/toaster/toastermain/settings_test.py b/poky/bitbake/lib/toaster/toastermain/settings_test.py
new file mode 100644
index 000000000..a32271157
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/settings_test.py
@@ -0,0 +1,41 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Django settings for Toaster project.
+
+# Settings overlay to use for running tests
+# DJANGO_SETTINGS_MODULE=toastermain.settings-test
+
+from toastermain.settings import *
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': '/tmp/toaster-test-db.sqlite',
+ 'TEST': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': '/tmp/toaster-test-db.sqlite',
+ }
+ }
+}
diff --git a/poky/bitbake/lib/toaster/toastermain/urls.py b/poky/bitbake/lib/toaster/toastermain/urls.py
new file mode 100644
index 000000000..e2fb0aebf
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/urls.py
@@ -0,0 +1,93 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.conf.urls import include, url
+from django.views.generic import RedirectView, TemplateView
+from django.views.decorators.cache import never_cache
+import bldcollector.views
+
+import logging
+
+logger = logging.getLogger("toaster")
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = [
+
+ # Examples:
+ # url(r'^toaster/', include('toaster.foo.urls')),
+
+ # Uncomment the admin/doc line below to enable admin documentation:
+ # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+
+ # This is here to maintain backward compatibility and will be deprecated
+ # in the future.
+ url(r'^orm/eventfile$', bldcollector.views.eventfile),
+
+ url(r'^health$', TemplateView.as_view(template_name="health.html"), name='Toaster Health'),
+
+ # if no application is selected, we have the magic toastergui app here
+ url(r'^$', never_cache(RedirectView.as_view(url='/toastergui/', permanent=True))),
+]
+
+import toastermain.settings
+
+if toastermain.settings.FRESH_ENABLED:
+ urlpatterns.insert(1, url(r'', include('fresh.urls')))
+ #logger.info("Enabled django-fresh extension")
+
+if toastermain.settings.DEBUG_PANEL_ENABLED:
+ import debug_toolbar
+ urlpatterns.insert(1, url(r'', include(debug_toolbar.urls)))
+ #logger.info("Enabled django_toolbar extension")
+
+urlpatterns = [
+ # Uncomment the next line to enable the admin:
+ url(r'^admin/', include(admin.site.urls)),
+] + urlpatterns
+
+# Automatically discover urls.py in various apps, beside our own
+# and map module directories to the patterns
+
+import os
+currentdir = os.path.dirname(__file__)
+for t in os.walk(os.path.dirname(currentdir)):
+ #if we have a virtualenv skip it to avoid incorrect imports
+ if 'VIRTUAL_ENV' in os.environ and os.environ['VIRTUAL_ENV'] in t[0]:
+ continue
+
+ if "urls.py" in t[2] and t[0] != currentdir:
+ modulename = os.path.basename(t[0])
+ # make sure we don't have this module name in
+ conflict = False
+ for p in urlpatterns:
+ if p.regex.pattern == '^' + modulename + '/':
+ conflict = True
+ if not conflict:
+ urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls')))
+ else:
+ logger.warning("Module \'%s\' has a regexp conflict, was not added to the urlpatterns" % modulename)
+
+from pprint import pformat
+#logger.debug("urlpatterns list %s", pformat(urlpatterns))
diff --git a/poky/bitbake/lib/toaster/toastermain/wsgi.py b/poky/bitbake/lib/toaster/toastermain/wsgi.py
new file mode 100644
index 000000000..031b314b1
--- /dev/null
+++ b/poky/bitbake/lib/toaster/toastermain/wsgi.py
@@ -0,0 +1,35 @@
+"""
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+WSGI config for Toaster project.
+
+This module contains the WSGI application used by Django's development server
+and any production WSGI deployments. It should expose a module-level variable
+named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
+this application via the ``WSGI_APPLICATION`` setting.
+
+Usually you will have the standard Django WSGI application here, but it also
+might make sense to replace the whole Django WSGI application with a custom one
+that later delegates to the Django one. For example, you could introduce WSGI
+middleware here, or combine a Django application with an application of another
+framework.
+
+"""
+import os
+
+# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
+# if running multiple sites in the same mod_wsgi process. To fix this, use
+# mod_wsgi daemon mode with each site in its own daemon process, or use
+# os.environ["DJANGO_SETTINGS_MODULE"] = "Toaster.settings"
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
+
+# This application object is used by any WSGI server configured to use this
+# file. This includes Django's development server, if the WSGI_APPLICATION
+# setting points here.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()
+
+# Apply WSGI middleware here.
+# from helloworld.wsgi import HelloWorldApplication
+# application = HelloWorldApplication(application)
diff --git a/poky/bitbake/toaster-requirements.txt b/poky/bitbake/toaster-requirements.txt
new file mode 100644
index 000000000..c0ec36828
--- /dev/null
+++ b/poky/bitbake/toaster-requirements.txt
@@ -0,0 +1,3 @@
+Django>1.8,<1.11.9
+beautifulsoup4>=4.4.0
+pytz
diff --git a/poky/documentation/Makefile b/poky/documentation/Makefile
new file mode 100644
index 000000000..e41d5a0f6
--- /dev/null
+++ b/poky/documentation/Makefile
@@ -0,0 +1,482 @@
+# This is a single Makefile to handle all generated Yocto Project documents,
+# which includes the BitBake User Manual and the Toaster User Manual.
+# The Makefile needs to live in the documents directory and all figures used
+# in any manuals must be .PNG files and live in the individual book's figures
+# directory as well as in the figures directory for the mega-manual.
+#
+# Some manuals are available as linked help through the Eclipse development
+# system. These manuals also include an "eclipse" sub-directory as part of
+# the make process.
+#
+# Note that the figures for the Yocto Project Development Tasks Manual
+# differ depending on the BRANCH being built.
+#
+# The Makefile has these targets:
+# all: If you leave off the target then "all" is implied.
+# You will generate HTML, eclipse help (if applicable),
+# and a tarball of files.
+#
+# pdf: generates a PDF version of a manual. Not valid for the
+# Quick Start or the mega-manual (single, large HTML file
+# comprised of all Yocto Project manuals).
+# html: generates an HTML version of a manual.
+# eclipse: generates an HTML version of a manual that can be used as
+# eclipse help (including necessary metadata files).
+# tarball: creates a tarball for the doc files.
+# validate: validates
+# publish: pushes generated files to the Yocto Project website
+# clean: removes files
+#
+# The Makefile can generate an HTML and PDF version of every document except the
+# Yocto Project Quick Start and the single, HTML mega-manual, which is comprised
+# of all the individual Yocto Project manuals. You can generate these two manuals
+# in HTML form only. The variable DOC indicates the folder name for a given manual.
+# The variable VER represents the distro version of the Yocto Release for which the
+# manuals are being generated. The variable BRANCH is used to indicate the
+# branch (edison or denzil) and is used only when DOC=dev-manual or
+# DOC=mega-manual. If you do not specify a BRANCH, the default branch used
+# will be for the latest Yocto Project release. If you build for either
+# edison or denzil, you must use BRANCH. You do not need to use BRANCH for
+# any release beyond denzil.
+#
+# To build a manual, you must invoke Makefile with the DOC argument. If you
+# are going to publish the manual, then you must invoke Makefile with both the
+# DOC and the VER argument. Furthermore, if you are building or publishing
+# the edison or denzil versions of the Yocto Project Development Tasks Manual or
+# the mega-manual, you must also use the BRANCH argument.
+#
+# Examples:
+#
+# make DOC=bsp-guide
+# make html DOC=brief-yoctoprojectqs
+# make pdf DOC=ref-manual
+# make DOC=dev-manual BRANCH=edison
+# make DOC=mega-manual BRANCH=denzil
+#
+# The first example generates the HTML and Eclipse help versions of the BSP Guide.
+# The second example generates the HTML version only of the Quick Start. Note
+# that the Quick Start only has an HTML version available. So, the
+# 'make DOC=brief-yoctoprojectqs' command would be equivalent. The third example
+# generates just the PDF version of the Yocto Project Reference Manual.
+# The fourth example generates the HTML 'edison' version and (if available)
+# the Eclipse help version of the YP Development Tasks Manual. The last example
+# generates the HTML version of the mega-manual and uses the 'denzil'
+# branch when choosing figures for the tarball of figures. Any example that does
+# not use the BRANCH argument builds the current version of the manual set.
+#
+# The publish target pushes the generated manuals to the Yocto Project
+# website. Unless you are a developer on the YP team, you will not succeed in
+# pushing manuals to this server. All files needed for the manual's HTML form are
+# pushed as well as applicable Eclipse versions.
+#
+# Examples:
+#
+# make publish DOC=bsp-guide VER=1.7
+# make publish DOC=adt-manual VER=1.6
+# make publish DOC=dev-manual VER=1.1.1 BRANCH=edison
+# make publish DOC=dev-manual VER=1.2 BRANCH=denzil
+#
+# The first example publishes the 1.7 version of both the PDF and HTML versions of
+# the BSP Guide. The second example publishes the 1.6 version of both the PDF and
+# HTML versions of the ADT Manual. The third example publishes the 1.1.1 version of
+# the PDF and HTML YP Development Tasks Manual for the 'edison' branch. The fourth
+# example publishes the 1.2 version of the PDF and HTML YP Development Tasks Manual
+# for the 'denzil' branch.
+#
+
+ifeq ($(DOC),brief-yoctoprojectqs)
+XSLTOPTS = --stringparam html.stylesheet brief-yoctoprojectqs-style.css \
+ --stringparam chapter.autolabel 0 \
+ --stringparam section.autolabel 0 \
+ --stringparam section.label.includes.component.label 0 \
+ --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = brief-yoctoprojectqs-style.css brief-yoctoprojectqs.html figures/bypqs-title.png \
+ figures/yocto-project-transp.png
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),overview-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = overview-manual-style.css overview-manual.html figures/overview-manual-title.png \
+ figures/git-workflow.png figures/source-repos.png figures/index-downloads.png \
+ figures/yp-download.png figures/YP-flow-diagram.png figures/key-dev-elements.png \
+ figures/poky-reference-distribution.png figures/cross-development-toolchains.png \
+ figures/user-configuration.png figures/layer-input.png figures/source-input.png \
+ figures/package-feeds.png figures/patching.png figures/source-fetching.png \
+ figures/configuration-compile-autoreconf.png figures/analysis-for-package-splitting.png \
+ figures/image-generation.png figures/sdk-generation.png figures/images.png \
+ figures/sdk.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),bsp-guide)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = bsp-style.css bsp-guide.html figures/bsp-title.png \
+ figures/bsp-dev-flow.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),dev-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+#
+# Note that the tarfile might produce the "Cannot stat: No such file or
+# directory" error message for .PNG files that are not present when building
+# a particular branch. The list of files is all-inclusive for all branches.
+# Note, if you don't provide a BRANCH option, it defaults to the latest stuff.
+# This would be appropriate for "master" branch.
+#
+
+ ifeq ($(BRANCH),edison)
+TARFILES = dev-style.css dev-manual.html \
+ figures/app-dev-flow.png figures/bsp-dev-flow.png \
+ figures/dev-title.png figures/git-workflow.png \
+ figures/index-downloads.png figures/kernel-dev-flow.png \
+ figures/kernel-example-repos-edison.png \
+ figures/kernel-overview-1.png figures/kernel-overview-2.png \
+ figures/kernel-overview-3-edison.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/wip.png
+ else ifeq ($(BRANCH),denzil)
+TARFILES = dev-style.css dev-manual.html \
+ figures/app-dev-flow.png figures/bsp-dev-flow.png \
+ figures/dev-title.png figures/git-workflow.png \
+ figures/index-downloads.png figures/kernel-dev-flow.png \
+ figures/kernel-example-repos-denzil.png \
+ figures/kernel-overview-1.png figures/kernel-overview-2.png \
+ figures/kernel-overview-3-denzil.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/wip.png
+ else
+TARFILES = dev-style.css dev-manual.html figures/buildhistory-web.png \
+ figures/dev-title.png figures/buildhistory.png \
+ figures/recipe-workflow.png figures/bitbake-build-flow.png \
+ eclipse
+ endif
+
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),mega-manual)
+XSLTOPTS = --stringparam html.stylesheet mega-style.css \
+ --stringparam chapter.autolabel 1 \
+ --stringparam section.autolabel 1 \
+ --stringparam section.label.includes.component.label 1 \
+ --xinclude
+ALLPREQ = html tarball
+
+ ifeq ($(BRANCH),edison)
+TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
+ figures/building-an-image.png \
+ figures/using-a-pre-built-image.png \
+ figures/poky-title.png \
+ figures/adt-title.png figures/bsp-title.png \
+ figures/kernel-title.png figures/kernel-architecture-overview.png \
+ figures/app-dev-flow.png figures/bsp-dev-flow.png \
+ figures/dev-title.png figures/git-workflow.png \
+ figures/index-downloads.png figures/kernel-dev-flow.png \
+ figures/kernel-example-repos-edison.png \
+ figures/kernel-overview-1.png figures/kernel-overview-2.png \
+ figures/kernel-overview-3-edison.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/wip.png
+ else ifeq ($(BRANCH),denzil)
+TARFILES = mega-manual.html mega-style.css figures/yocto-environment.png \
+ figures/building-an-image.png \
+ figures/using-a-pre-built-image.png \
+ figures/poky-title.png \
+ figures/adt-title.png figures/bsp-title.png \
+ figures/kernel-title.png figures/kernel-architecture-overview.png \
+ figures/app-dev-flow.png figures/bsp-dev-flow.png \
+ figures/dev-title.png figures/git-workflow.png \
+ figures/index-downloads.png figures/kernel-dev-flow.png \
+ figures/kernel-example-repos-denzil.png \
+ figures/kernel-overview-1.png figures/kernel-overview-2.png \
+ figures/kernel-overview-3-denzil.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/wip.png
+ else
+TARFILES = mega-manual.html mega-style.css \
+ figures/YP-flow-diagram.png \
+ figures/using-a-pre-built-image.png \
+ figures/poky-title.png figures/buildhistory.png \
+ figures/buildhistory-web.png \
+ figures/sdk-title.png figures/bsp-title.png \
+ figures/kernel-dev-title.png figures/kernel-architecture-overview.png \
+ figures/bsp-dev-flow.png \
+ figures/dev-title.png \
+ figures/git-workflow.png figures/index-downloads.png \
+ figures/kernel-dev-flow.png \
+ figures/kernel-overview-2-generic.png \
+ figures/source-repos.png figures/yp-download.png \
+ figures/profile-title.png figures/kernelshark-all.png \
+ figures/kernelshark-choose-events.png \
+ figures/kernelshark-i915-display.png \
+ figures/kernelshark-output-display.png figures/lttngmain0.png \
+ figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
+ figures/oprofileui-downloading.png figures/oprofileui-processes.png \
+ figures/perf-probe-do_fork-profile.png \
+ figures/perf-report-cycles-u.png \
+ figures/perf-systemwide.png figures/perf-systemwide-libc.png \
+ figures/perf-wget-busybox-annotate-menu.png \
+ figures/perf-wget-busybox-annotate-udhcpc.png \
+ figures/perf-wget-busybox-debuginfo.png \
+ figures/perf-wget-busybox-dso-zoom.png \
+ figures/perf-wget-busybox-dso-zoom-menu.png \
+ figures/perf-wget-busybox-expanded-stripped.png \
+ figures/perf-wget-flat-stripped.png \
+ figures/perf-wget-g-copy-from-user-expanded-stripped.png \
+ figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
+ figures/perf-wget-g-copy-to-user-expanded-stripped.png \
+ figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
+ figures/pybootchartgui-linux-yocto.png \
+ figures/pychart-linux-yocto-rpm.png \
+ figures/pychart-linux-yocto-rpm-nostrip.png \
+ figures/sched-wakeup-profile.png figures/sysprof-callers.png \
+ figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
+ figures/cross-development-toolchains.png \
+ figures/user-configuration.png \
+ figures/source-input.png figures/package-feeds.png \
+ figures/layer-input.png figures/images.png figures/sdk.png \
+ figures/source-fetching.png figures/patching.png \
+ figures/configuration-compile-autoreconf.png \
+ figures/analysis-for-package-splitting.png \
+ figures/image-generation.png figures/key-dev-elements.png\
+ figures/sdk-generation.png figures/recipe-workflow.png \
+ figures/build-workspace-directory.png figures/mega-title.png \
+ figures/toaster-title.png figures/hosted-service.png \
+ figures/simple-configuration.png figures/poky-reference-distribution.png \
+ figures/compatible-layers.png figures/import-layer.png figures/new-project.png \
+ figures/sdk-environment.png figures/sdk-installed-standard-sdk-directory.png \
+ figures/sdk-devtool-add-flow.png figures/sdk-installed-extensible-sdk-directory.png \
+ figures/sdk-devtool-modify-flow.png figures/sdk-eclipse-dev-flow.png \
+ figures/sdk-devtool-upgrade-flow.png figures/bitbake-build-flow.png figures/bypqs-title.png \
+ figures/overview-manual-title.png figures/sdk-autotools-flow.png figures/sdk-makefile-flow.png
+ endif
+
+MANUALS = $(DOC)/$(DOC).html
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+
+endif
+
+ifeq ($(DOC),ref-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
+ figures/build-workspace-directory.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+endif
+
+ifeq ($(DOC),sdk-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = sdk-manual.html sdk-style.css figures/sdk-title.png \
+ figures/sdk-environment.png figures/sdk-installed-standard-sdk-directory.png \
+ figures/sdk-installed-extensible-sdk-directory.png figures/sdk-devtool-add-flow.png \
+ figures/sdk-devtool-modify-flow.png figures/sdk-eclipse-dev-flow.png \
+ figures/sdk-devtool-upgrade-flow.png figures/sdk-autotools-flow.png figures/sdk-makefile-flow.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+endif
+
+ifeq ($(DOC),profile-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = profile-manual.html profile-manual-style.css \
+ figures/profile-title.png figures/kernelshark-all.png \
+ figures/kernelshark-choose-events.png \
+ figures/kernelshark-i915-display.png \
+ figures/kernelshark-output-display.png figures/lttngmain0.png \
+ figures/oprofileui-busybox.png figures/oprofileui-copy-to-user.png \
+ figures/oprofileui-downloading.png figures/oprofileui-processes.png \
+ figures/perf-probe-do_fork-profile.png \
+ figures/perf-report-cycles-u.png \
+ figures/perf-systemwide.png figures/perf-systemwide-libc.png \
+ figures/perf-wget-busybox-annotate-menu.png \
+ figures/perf-wget-busybox-annotate-udhcpc.png \
+ figures/perf-wget-busybox-debuginfo.png \
+ figures/perf-wget-busybox-dso-zoom.png \
+ figures/perf-wget-busybox-dso-zoom-menu.png \
+ figures/perf-wget-busybox-expanded-stripped.png \
+ figures/perf-wget-flat-stripped.png \
+ figures/perf-wget-g-copy-from-user-expanded-stripped.png \
+ figures/perf-wget-g-copy-to-user-expanded-debuginfo.png \
+ figures/perf-wget-g-copy-to-user-expanded-stripped.png \
+ figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png \
+ figures/pybootchartgui-linux-yocto.png \
+ figures/pychart-linux-yocto-rpm.png \
+ figures/pychart-linux-yocto-rpm-nostrip.png \
+ figures/sched-wakeup-profile.png figures/sysprof-callers.png \
+ figures/sysprof-copy-from-user.png figures/sysprof-copy-to-user.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+endif
+
+ifeq ($(DOC),kernel-dev)
+XSLTOPTS = --xinclude
+ALLPREQ = html eclipse tarball
+TARFILES = kernel-dev.html kernel-dev-style.css \
+ figures/kernel-dev-title.png figures/kernel-overview-2-generic.png \
+ figures/kernel-architecture-overview.png figures/kernel-dev-flow.png \
+ eclipse
+MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+endif
+
+ifeq ($(DOC),toaster-manual)
+XSLTOPTS = --xinclude
+ALLPREQ = html tarball
+TARFILES = toaster-manual.html toaster-manual-style.css \
+ figures/toaster-title.png figures/simple-configuration.png \
+ figures/hosted-service.png \
+ figures/compatible-layers.png figures/import-layer.png figures/new-project.png
+MANUALS = $(DOC)/$(DOC).html
+FIGURES = figures
+STYLESHEET = $(DOC)/*.css
+endif
+
+
+##
+# These URI should be rewritten by your distribution's xml catalog to
+# match your locally installed XSL stylesheets.
+XSL_BASE_URI = http://docbook.sourceforge.net/release/xsl/1.76.1
+XSL_XHTML_URI = $(XSL_BASE_URI)/xhtml/docbook.xsl
+
+all: $(ALLPREQ)
+
+pdf:
+ifeq ($(DOC),brief-yoctoprojectqs)
+ @echo " "
+ @echo "ERROR: You cannot generate a PDF file for brief-yoctoprojectqs."
+ @echo " "
+
+else ifeq ($(DOC),mega-manual)
+ @echo " "
+ @echo "ERROR: You cannot generate a mega-manual PDF file."
+ @echo " "
+
+else
+
+ cd $(DOC); ../tools/poky-docbook-to-pdf $(DOC).xml ../template; cd ..
+endif
+
+html:
+ifeq ($(DOC),mega-manual)
+# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
+ @echo " "
+ @echo "******** Building "$(DOC)
+ @echo " "
+ cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
+ @echo " "
+ @echo "******** Using mega-manual.sed to process external links"
+ @echo " "
+ cd $(DOC); sed -f ../tools/mega-manual.sed < mega-manual.html > mega-output.html; cd ..
+ @echo " "
+ @echo "******** Cleaning up transient file mega-output.html"
+ @echo " "
+ cd $(DOC); rm mega-manual.html; mv mega-output.html mega-manual.html; cd ..
+else
+# See http://www.sagehill.net/docbookxsl/HtmlOutput.html
+ @echo " "
+ @echo "******** Building "$(DOC)
+ @echo " "
+ cd $(DOC); xsltproc $(XSLTOPTS) -o $(DOC).html $(DOC)-customization.xsl $(DOC).xml; cd ..
+endif
+
+
+eclipse: BASE_DIR = html/$(DOC)/
+
+eclipse: eclipse-generate eclipse-resolve-links
+
+.PHONY : eclipse-generate eclipse-resolve-links
+
+eclipse-generate:
+ifeq ($(filter $(DOC), overview-manual sdk-manual bsp-guide dev-manual kernel-dev profile-manual ref-manual brief-yoctoprojectqs),)
+ @echo " "
+ @echo "ERROR: You can only create eclipse documentation"
+ @echo " of the following documentation parts:"
+ @echo " - overview-manual"
+ @echo " - sdk-manual"
+ @echo " - bsp-guide"
+ @echo " - dev-manual"
+ @echo " - kernel-dev"
+ @echo " - profile-manual"
+ @echo " - ref-manual"
+ @echo " - brief-yoctoprojectqs"
+ @echo " "
+else
+ @echo " "
+ @echo "******** Building eclipse help of "$(DOC)
+ @echo " "
+ cd $(DOC) && \
+ xsltproc $(XSLTOPTS) \
+ --stringparam base.dir '$(BASE_DIR)' \
+ -o eclipse/$(DOC).html \
+ $(DOC)-eclipse-customization.xsl $(DOC).xml && \
+ mv eclipse/toc.xml eclipse/$(DOC)-toc.xml && \
+ cp -rf $(FIGURES) eclipse/$(BASE_DIR) && \
+ cd ..;
+
+ $(call modify-eclipse)
+endif
+
+eclipse-resolve-links:
+ @echo " "
+ @echo "******** Using eclipse-help.sed to process external links"
+ @echo " "
+ $(foreach FILE, \
+ $(wildcard $(DOC)/eclipse/html/$(DOC)/*.html), \
+ $(shell sed -i -f tools/eclipse-help.sed $(FILE)))
+
+tarball: html
+ @echo " "
+ @echo "******** Creating Tarball of document files"
+ @echo " "
+ cd $(DOC); tar -cvzf $(DOC).tgz $(TARFILES); cd ..
+
+validate:
+ cd $(DOC); xmllint --postvalid --xinclude --noout $(DOC).xml; cd ..
+
+
+publish:
+ @if test -f $(DOC)/$(DOC).html; \
+ then \
+ echo " "; \
+ echo "******** Publishing "$(DOC)".html"; \
+ echo " "; \
+ scp -r $(MANUALS) $(STYLESHEET) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
+ cd $(DOC); scp -r $(FIGURES) docs.yp:/var/www/www.yoctoproject.org-docs/$(VER)/$(DOC); \
+ else \
+ echo " "; \
+ echo $(DOC)".html missing. Generate the file first then try again."; \
+ echo " "; \
+ fi
+
+clean:
+ rm -rf $(MANUALS); rm $(DOC)/$(DOC).tgz;
diff --git a/poky/documentation/README b/poky/documentation/README
new file mode 100644
index 000000000..d64f2fd2f
--- /dev/null
+++ b/poky/documentation/README
@@ -0,0 +1,93 @@
+documentation
+=============
+
+This is the directory that contains the Yocto Project documentation. The Yocto
+Project source repositories at http://git.yoctoproject.org/cgit.cgi have two
+instances of the "documentation" directory. You should understand each of
+these instances.
+
+ poky/documentation - The directory within the poky Git repository containing
+ the set of Yocto Project manuals. When you clone the
+ poky Git repository, the documentation directory
+ contains the manuals. The state of the manuals in this
+ directory is guaranteed to reflect the latest Yocto
+ Project release. The manuals at the tip of this
+ directory will also likely contain most manual
+ development changes.
+
+ yocto-docs/documentation - The Git repository for the Yocto Project manuals.
+ This repository is where manual development
+ occurs. If you plan on contributing back to the
+ Yocto Project documentation, you should set up
+ a local Git repository based on this upstream
+ repository as follows:
+
+ git clone git://git.yoctoproject.org/yocto-docs
+
+ Changes and patches are first pushed to the
+ yocto-docs Git repository. Later, they make it
+ into the poky Git repository found at
+ git://git.yoctoproject.org/poky.
+
+Manual Organization
+===================
+
+Folders exist for individual manuals as follows:
+
+* sdk-manual - The Yocto Project Software Development Kit (SDK) Developer's Guide.
+* bsp-guide - The Yocto Project Board Support Package (BSP) Developer's Guide
+* dev-manual - The Yocto Project Development Tasks Manual
+* kernel-dev - The Yocto Project Linux Kernel Development Tasks Manual
+* ref-manual - The Yocto Project Reference Manual
+* yocto-project-qs - The Yocto Project Quick Start
+* mega-manual - The Yocto Project Mega-Manual, which is an aggregated manual comprised
+ of all YP manuals and guides
+* profile-manual - The Yocto Project Profile and Tracing Manual
+* toaster-manual - The Toaster Manual
+
+Each folder is self-contained regarding content and figures. Note that there
+is a sed file needed to process the links of the mega-manual. The sed file
+is located in the tools directory. Also note that the figures folder in the
+mega-manual directory contains duplicates of all the figures in the YP folders
+directories for all YP manuals and guides.
+
+If you want to find HTML versions of the Yocto Project manuals on the web,
+go to http://www.yoctoproject.org and click on the "Documentation" tab. From
+there you have access to archived documentation from previous releases, current
+documentation for the latest release, and "Docs in Progress" for the release
+currently being developed.
+
+In general, the Yocto Project site (http://www.yoctoproject.org) is a great
+reference for both information and downloads.
+
+Makefile
+========
+
+The Makefile processes manual directories to create HTML, PDF,
+tarballs, etc. Details on how the Makefile work are documented
+inside the Makefile. See that file for more information.
+
+To build a manual, you run the make command and pass it the name
+of the folder containing the manual's contents.
+For example, the following command run from the documentation directory
+creates an HTML version of the SDK manual.
+The DOC variable specifies the manual you are making:
+
+ $ make DOC=sdk-manual
+
+poky.ent
+========
+
+This file defines variables used for documentation production. The variables
+are used to define release pathnames, URLs for the published manuals, etc.
+
+template
+========
+Contains various templates, fonts, and some old PNG files.
+
+tools
+=====
+Contains a tool to convert the DocBook files to PDF format. This folder also
+contains the mega-manual.sed file, which is used by Makefile to process
+cross-references from within the manual that normally go to an external
+manual.
diff --git a/poky/documentation/adt-manual/adt-command.xml b/poky/documentation/adt-manual/adt-command.xml
new file mode 100644
index 000000000..c78d18a16
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-command.xml
@@ -0,0 +1,265 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='using-the-command-line'>
+<title>Using the Command Line</title>
+
+ <para>
+ Recall that earlier the manual discussed how to use an existing toolchain
+ tarball that had been installed into the default installation
+ directory, <filename>/opt/poky/&DISTRO;</filename>, which is outside of the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ (see the section "<link linkend='using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball)</link>".
+ And, that sourcing your architecture-specific environment setup script
+ initializes a suitable cross-toolchain development environment.
+ </para>
+
+ <para>
+ During this setup, locations for the compiler, QEMU scripts, QEMU binary,
+ a special version of <filename>pkgconfig</filename> and other useful
+ utilities are added to the <filename>PATH</filename> variable.
+ Also, variables to assist
+ <filename>pkgconfig</filename> and <filename>autotools</filename>
+ are also defined so that, for example, <filename>configure.sh</filename>
+ can find pre-generated test results for tests that need target hardware
+ on which to run.
+ You can see the
+ "<link linkend='setting-up-the-cross-development-environment'>Setting Up the Cross-Development Environment</link>"
+ section for the list of cross-toolchain environment variables
+ established by the script.
+ </para>
+
+ <para>
+ Collectively, these conditions allow you to easily use the toolchain
+ outside of the OpenEmbedded build environment on both Autotools-based
+ projects and Makefile-based projects.
+ This chapter provides information for both these types of projects.
+ </para>
+
+
+<section id='autotools-based-projects'>
+<title>Autotools-Based Projects</title>
+
+ <para>
+ Once you have a suitable cross-toolchain installed, it is very easy to
+ develop a project outside of the OpenEmbedded build system.
+ This section presents a simple "Helloworld" example that shows how
+ to set up, compile, and run the project.
+ </para>
+
+ <section id='creating-and-running-a-project-based-on-gnu-autotools'>
+ <title>Creating and Running a Project Based on GNU Autotools</title>
+
+ <para>
+ Follow these steps to create a simple Autotools-based project:
+ <orderedlist>
+ <listitem><para><emphasis>Create your directory:</emphasis>
+ Create a clean directory for your project and then make
+ that directory your working location:
+ <literallayout class='monospaced'>
+ $ mkdir $HOME/helloworld
+ $ cd $HOME/helloworld
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Populate the directory:</emphasis>
+ Create <filename>hello.c</filename>, <filename>Makefile.am</filename>,
+ and <filename>configure.in</filename> files as follows:
+ <itemizedlist>
+ <listitem><para>For <filename>hello.c</filename>, include
+ these lines:
+ <literallayout class='monospaced'>
+ #include &lt;stdio.h&gt;
+
+ main()
+ {
+ printf("Hello World!\n");
+ }
+ </literallayout></para></listitem>
+ <listitem><para>For <filename>Makefile.am</filename>,
+ include these lines:
+ <literallayout class='monospaced'>
+ bin_PROGRAMS = hello
+ hello_SOURCES = hello.c
+ </literallayout></para></listitem>
+ <listitem><para>For <filename>configure.in</filename>,
+ include these lines:
+ <literallayout class='monospaced'>
+ AC_INIT(hello.c)
+ AM_INIT_AUTOMAKE(hello,0.1)
+ AC_PROG_CC
+ AC_PROG_INSTALL
+ AC_OUTPUT(Makefile)
+ </literallayout></para></listitem>
+ </itemizedlist></para></listitem>
+ <listitem><para><emphasis>Source the cross-toolchain
+ environment setup file:</emphasis>
+ Installation of the cross-toolchain creates a cross-toolchain
+ environment setup script in the directory that the ADT
+ was installed.
+ Before you can use the tools to develop your project, you must
+ source this setup script.
+ The script begins with the string "environment-setup" and contains
+ the machine architecture, which is followed by the string
+ "poky-linux".
+ Here is an example that sources a script from the
+ default ADT installation directory that uses the
+ 32-bit Intel x86 Architecture and the
+ &DISTRO_NAME; Yocto Project release:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Generate the local aclocal.m4
+ files and create the configure script:</emphasis>
+ The following GNU Autotools generate the local
+ <filename>aclocal.m4</filename> files and create the
+ configure script:
+ <literallayout class='monospaced'>
+ $ aclocal
+ $ autoconf
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Generate files needed by GNU
+ coding standards:</emphasis>
+ GNU coding standards require certain files in order for the
+ project to be compliant.
+ This command creates those files:
+ <literallayout class='monospaced'>
+ $ touch NEWS README AUTHORS ChangeLog
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Generate the configure
+ file:</emphasis>
+ This command generates the <filename>configure</filename>:
+ <literallayout class='monospaced'>
+ $ automake -a
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Cross-compile the project:</emphasis>
+ This command compiles the project using the cross-compiler.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIGURE_FLAGS'><filename>CONFIGURE_FLAGS</filename></ulink>
+ environment variable provides the minimal arguments for
+ GNU configure:
+ <literallayout class='monospaced'>
+ $ ./configure ${CONFIGURE_FLAGS}
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Make and install the project:</emphasis>
+ These two commands generate and install the project into the
+ destination directory:
+ <literallayout class='monospaced'>
+ $ make
+ $ make install DESTDIR=./tmp
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Verify the installation:</emphasis>
+ This command is a simple way to verify the installation
+ of your project.
+ Running the command prints the architecture on which
+ the binary file can run.
+ This architecture should be the same architecture that
+ the installed cross-toolchain supports.
+ <literallayout class='monospaced'>
+ $ file ./tmp/usr/local/bin/hello
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Execute your project:</emphasis>
+ To execute the project in the shell, simply enter the name.
+ You could also copy the binary to the actual target hardware
+ and run the project there as well:
+ <literallayout class='monospaced'>
+ $ ./hello
+ </literallayout>
+ As expected, the project displays the "Hello World!" message.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='passing-host-options'>
+ <title>Passing Host Options</title>
+
+ <para>
+ For an Autotools-based project, you can use the cross-toolchain by just
+ passing the appropriate host option to <filename>configure.sh</filename>.
+ The host option you use is derived from the name of the environment setup
+ script found in the directory in which you installed the cross-toolchain.
+ For example, the host option for an ARM-based target that uses the GNU EABI
+ is <filename>armv5te-poky-linux-gnueabi</filename>.
+ You will notice that the name of the script is
+ <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>.
+ Thus, the following command works to update your project and
+ rebuild it using the appropriate cross-toolchain tools:
+ <literallayout class='monospaced'>
+ $ ./configure --host=armv5te-poky-linux-gnueabi \
+ --with-libtool-sysroot=<replaceable>sysroot_dir</replaceable>
+ </literallayout>
+ <note>
+ If the <filename>configure</filename> script results in problems recognizing the
+ <filename>--with-libtool-sysroot=</filename><replaceable>sysroot-dir</replaceable> option,
+ regenerate the script to enable the support by doing the following and then
+ run the script again:
+ <literallayout class='monospaced'>
+ $ libtoolize --automake
+ $ aclocal -I ${OECORE_NATIVE_SYSROOT}/usr/share/aclocal \
+ [-I <replaceable>dir_containing_your_project-specific_m4_macros</replaceable>]
+ $ autoconf
+ $ autoheader
+ $ automake -a
+ </literallayout>
+ </note>
+ </para>
+ </section>
+</section>
+
+<section id='makefile-based-projects'>
+<title>Makefile-Based Projects</title>
+
+ <para>
+ For Makefile-based projects, the cross-toolchain environment variables
+ established by running the cross-toolchain environment setup script
+ are subject to general <filename>make</filename> rules.
+ </para>
+
+ <para>
+ To illustrate this, consider the following four cross-toolchain
+ environment variables:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'>CC</ulink>=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'>LD</ulink>=i586-poky-linux-ld --sysroot=/opt/poky/1.8/sysroots/i586-poky-linux
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CFLAGS'>CFLAGS</ulink>=-O2 -pipe -g -feliminate-unused-debug-types
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CXXFLAGS'>CXXFLAGS</ulink>=-O2 -pipe -g -feliminate-unused-debug-types
+ </literallayout>
+ Now, consider the following three cases:
+ <itemizedlist>
+ <listitem><para><emphasis>Case 1 - No Variables Set in the <filename>Makefile</filename>:</emphasis>
+ Because these variables are not specifically set in the
+ <filename>Makefile</filename>, the variables retain their
+ values based on the environment.
+ </para></listitem>
+ <listitem><para><emphasis>Case 2 - Variables Set in the <filename>Makefile</filename>:</emphasis>
+ Specifically setting variables in the
+ <filename>Makefile</filename> during the build results in the
+ environment settings of the variables being overwritten.
+ </para></listitem>
+ <listitem><para><emphasis>Case 3 - Variables Set when the <filename>Makefile</filename> is Executed from the Command Line:</emphasis>
+ Executing the <filename>Makefile</filename> from the command
+ line results in the variables being overwritten with
+ command-line content regardless of what is being set in the
+ <filename>Makefile</filename>.
+ In this case, environment variables are not considered unless
+ you use the "-e" flag during the build:
+ <literallayout class='monospaced'>
+ $ make -e <replaceable>file</replaceable>
+ </literallayout>
+ If you use this flag, then the environment values of the
+ variables override any variables specifically set in the
+ <filename>Makefile</filename>.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ For the list of variables set up by the cross-toolchain environment
+ setup script, see the
+ "<link linkend='setting-up-the-cross-development-environment'>Setting Up the Cross-Development Environment</link>"
+ section.
+ </note>
+ </para>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-intro.xml b/poky/documentation/adt-manual/adt-intro.xml
new file mode 100644
index 000000000..597c7120b
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-intro.xml
@@ -0,0 +1,180 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='adt-intro'>
+ <title>The Application Development Toolkit (ADT)</title>
+
+ <para>
+ Part of the Yocto Project development solution is an Application Development
+ Toolkit (ADT).
+ The ADT provides you with a custom-built, cross-development
+ platform suited for developing a user-targeted product application.
+ </para>
+
+ <para>
+ Fundamentally, the ADT consists of the following:
+ <itemizedlist>
+ <listitem><para>An architecture-specific cross-toolchain and matching
+ sysroot both built by the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ The toolchain and sysroot are based on a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata'>Metadata</ulink>
+ configuration and extensions,
+ which allows you to cross-develop on the host machine for the target hardware.
+ </para></listitem>
+ <listitem><para>The Eclipse IDE Yocto Plug-in.</para></listitem>
+ <listitem><para>The Quick EMUlator (QEMU), which lets you simulate target hardware.
+ </para></listitem>
+ <listitem><para>Various user-space tools that greatly enhance your application
+ development experience.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='the-cross-development-toolchain'>
+ <title>The Cross-Development Toolchain</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_DEV_URL;#cross-development-toolchain'>Cross-Development Toolchain</ulink>
+ consists of a cross-compiler, cross-linker, and cross-debugger
+ that are used to develop user-space applications for targeted
+ hardware.
+ This toolchain is created either by running the ADT Installer
+ script, a toolchain installer script, or through a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ that is based on your Metadata configuration or extension for
+ your targeted device.
+ The cross-toolchain works with a matching target sysroot.
+ </para>
+ </section>
+
+ <section id='sysroot'>
+ <title>Sysroot</title>
+
+ <para>
+ The matching target sysroot contains needed headers and libraries for generating
+ binaries that run on the target architecture.
+ The sysroot is based on the target root filesystem image that is built by
+ the OpenEmbedded build system and uses the same Metadata configuration
+ used to build the cross-toolchain.
+ </para>
+ </section>
+
+ <section id='eclipse-overview'>
+ <title>Eclipse Yocto Plug-in</title>
+
+ <para>
+ The Eclipse IDE is a popular development environment and it fully supports
+ development using the Yocto Project.
+ When you install and configure the Eclipse Yocto Project Plug-in into
+ the Eclipse IDE, you maximize your Yocto Project experience.
+ Installing and configuring the Plug-in results in an environment that
+ has extensions specifically designed to let you more easily develop software.
+ These extensions allow for cross-compilation, deployment, and execution of
+ your output into a QEMU emulation session.
+ You can also perform cross-debugging and profiling.
+ The environment also supports a suite of tools that allows you to perform
+ remote profiling, tracing, collection of power data, collection of
+ latency data, and collection of performance data.
+ </para>
+
+ <para>
+ For information about the application development workflow that uses the Eclipse
+ IDE and for a detailed example of how to install and configure the Eclipse
+ Yocto Project Plug-in, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#adt-eclipse'>Working Within Eclipse</ulink>" section
+ of the Yocto Project Development Manual.
+ </para>
+ </section>
+
+ <section id='the-qemu-emulator'>
+ <title>The QEMU Emulator</title>
+
+ <para>
+ The QEMU emulator allows you to simulate your hardware while running your
+ application or image.
+ QEMU is made available a number of ways:
+ <itemizedlist>
+ <listitem><para>
+ If you use the ADT Installer script to install ADT, you can
+ specify whether or not to install QEMU.
+ </para></listitem>
+ <listitem><para>
+ If you have cloned the <filename>poky</filename> Git
+ repository to create a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ and you have sourced the environment setup script, QEMU is
+ installed and automatically available.
+ </para></listitem>
+ <listitem><para>
+ If you have downloaded a Yocto Project release and unpacked
+ it to create a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
+ and you have sourced the environment setup script, QEMU is
+ installed and automatically available.
+ </para></listitem>
+ <listitem><para>
+ If you have installed the cross-toolchain tarball and you
+ have sourced the toolchain's setup environment script, QEMU
+ is also installed and automatically available.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='user-space-tools'>
+ <title>User-Space Tools</title>
+
+ <para>
+ User-space tools are included as part of the Yocto Project.
+ You will find these tools helpful during development.
+ The tools include LatencyTOP, PowerTOP, OProfile, Perf, SystemTap, and Lttng-ust.
+ These tools are common development tools for the Linux platform.
+ <itemizedlist>
+ <listitem><para><emphasis>LatencyTOP:</emphasis> LatencyTOP focuses on latency
+ that causes skips in audio,
+ stutters in your desktop experience, or situations that overload your server
+ even when you have plenty of CPU power left.
+ </para></listitem>
+ <listitem><para><emphasis>PowerTOP:</emphasis> Helps you determine what
+ software is using the most power.
+ You can find out more about PowerTOP at
+ <ulink url='https://01.org/powertop/'></ulink>.</para></listitem>
+ <listitem><para><emphasis>OProfile:</emphasis> A system-wide profiler for Linux
+ systems that is capable of profiling all running code at low overhead.
+ You can find out more about OProfile at
+ <ulink url='http://oprofile.sourceforge.net/about/'></ulink>.
+ For examples on how to setup and use this tool, see the
+ "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>OProfile</ulink>"
+ section in the Yocto Project Profiling and Tracing Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Perf:</emphasis> Performance counters for Linux used
+ to keep track of certain types of hardware and software events.
+ For more information on these types of counters see
+ <ulink url='https://perf.wiki.kernel.org/'></ulink>.
+ For examples on how to setup and use this tool, see the
+ "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-perf'>perf</ulink>"
+ section in the Yocto Project Profiling and Tracing Manual.
+ </para></listitem>
+ <listitem><para><emphasis>SystemTap:</emphasis> A free software infrastructure
+ that simplifies information gathering about a running Linux system.
+ This information helps you diagnose performance or functional problems.
+ SystemTap is not available as a user-space tool through the Eclipse IDE Yocto Plug-in.
+ See <ulink url='http://sourceware.org/systemtap'></ulink> for more information
+ on SystemTap.
+ For examples on how to setup and use this tool, see the
+ "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-systemtap'>SystemTap</ulink>"
+ section in the Yocto Project Profiling and Tracing Manual.</para></listitem>
+ <listitem><para><emphasis>Lttng-ust:</emphasis> A User-space Tracer designed to
+ provide detailed information on user-space activity.
+ See <ulink url='http://lttng.org/ust'></ulink> for more information on Lttng-ust.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-manual-customization.xsl b/poky/documentation/adt-manual/adt-manual-customization.xsl
new file mode 100644
index 000000000..b86be519b
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-manual-customization.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'adt-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl b/poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..77ba5f571
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/adt-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/adt-manual/adt-manual-intro.xml b/poky/documentation/adt-manual/adt-manual-intro.xml
new file mode 100644
index 000000000..034fdff60
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-manual-intro.xml
@@ -0,0 +1,33 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='adt-manual-intro'>
+<title>Introduction</title>
+
+ <para>
+ Welcome to the Yocto Project Application Developer's Guide.
+ This manual provides information that lets you begin developing applications
+ using the Yocto Project.
+ </para>
+
+ <para>
+ The Yocto Project provides an application development environment based on
+ an Application Development Toolkit (ADT) and the availability of stand-alone
+ cross-development toolchains and other tools.
+ This manual describes the ADT and how you can configure and install it,
+ how to access and use the cross-development toolchains, how to
+ customize the development packages installation,
+ how to use command-line development for both Autotools-based and
+ Makefile-based projects, and an introduction to the
+ <trademark class='trade'>Eclipse</trademark> IDE Yocto Plug-in.
+ <note>
+ The ADT is distribution-neutral and does not require the Yocto
+ Project reference distribution, which is called Poky.
+ This manual, however, uses examples that use the Poky distribution.
+ </note>
+ </para>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-manual.xml b/poky/documentation/adt-manual/adt-manual.xml
new file mode 100644
index 000000000..972f8bf08
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-manual.xml
@@ -0,0 +1,140 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='adt-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/adt-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Application Developer's Guide
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Jessica</firstname> <surname>Zhang</surname>
+ <affiliation>
+ <orgname>Intel Corporation</orgname>
+ </affiliation>
+ <email>jessica.zhang@intel.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.0</revnumber>
+ <date>6 April 2011</date>
+ <revremark>Released with the Yocto Project 1.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.0.1</revnumber>
+ <date>23 May 2011</date>
+ <revremark>Released with the Yocto Project 1.0.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.1</revnumber>
+ <date>6 October 2011</date>
+ <revremark>Released with the Yocto Project 1.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.2</revnumber>
+ <date>April 2012</date>
+ <revremark>Released with the Yocto Project 1.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.3</revnumber>
+ <date>October 2012</date>
+ <revremark>Released with the Yocto Project 1.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>Sometime in 2016</date>
+ <revremark>Released with the future Yocto Project 2.1 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note>
+ For the latest version of this manual associated with this
+ Yocto Project release, see the
+ <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>
+ from the Yocto Project website.
+ </note>
+
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="adt-manual-intro.xml"/>
+
+ <xi:include href="adt-intro.xml"/>
+
+ <xi:include href="adt-prepare.xml"/>
+
+ <xi:include href="adt-package.xml"/>
+
+ <xi:include href="adt-command.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-package.xml b/poky/documentation/adt-manual/adt-package.xml
new file mode 100644
index 000000000..68eee9b38
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-package.xml
@@ -0,0 +1,102 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='adt-package'>
+<title>Optionally Customizing the Development Packages Installation</title>
+
+ <para>
+ Because the Yocto Project is suited for embedded Linux development, it is
+ likely that you will need to customize your development packages installation.
+ For example, if you are developing a minimal image, then you might not need
+ certain packages (e.g. graphics support packages).
+ Thus, you would like to be able to remove those packages from your target sysroot.
+ </para>
+
+<section id='package-management-systems'>
+ <title>Package Management Systems</title>
+
+ <para>
+ The OpenEmbedded build system supports the generation of sysroot files using
+ three different Package Management Systems (PMS):
+ <itemizedlist>
+ <listitem><para><emphasis>OPKG:</emphasis> A less well known PMS whose use
+ originated in the OpenEmbedded and OpenWrt embedded Linux projects.
+ This PMS works with files packaged in an <filename>.ipk</filename> format.
+ See <ulink url='http://en.wikipedia.org/wiki/Opkg'></ulink> for more
+ information about OPKG.</para></listitem>
+ <listitem><para><emphasis>RPM:</emphasis> A more widely known PMS intended for GNU/Linux
+ distributions.
+ This PMS works with files packaged in an <filename>.rpm</filename> format.
+ The build system currently installs through this PMS by default.
+ See <ulink url='http://en.wikipedia.org/wiki/RPM_Package_Manager'></ulink>
+ for more information about RPM.</para></listitem>
+ <listitem><para><emphasis>Debian:</emphasis> The PMS for Debian-based systems
+ is built on many PMS tools.
+ The lower-level PMS tool <filename>dpkg</filename> forms the base of the Debian PMS.
+ For information on dpkg see
+ <ulink url='http://en.wikipedia.org/wiki/Dpkg'></ulink>.</para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='configuring-the-pms'>
+ <title>Configuring the PMS</title>
+
+ <para>
+ Whichever PMS you are using, you need to be sure that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ variable in the <filename>conf/local.conf</filename>
+ file is set to reflect that system.
+ The first value you choose for the variable specifies the package file format for the root
+ filesystem at sysroot.
+ Additional values specify additional formats for convenience or testing.
+ See the <filename>conf/local.conf</filename> configuration file for
+ details.
+ </para>
+
+ <note>
+ For build performance information related to the PMS, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-package'><filename>package.bbclass</filename></ulink>"
+ section in the Yocto Project Reference Manual.
+ </note>
+
+ <para>
+ As an example, consider a scenario where you are using OPKG and you want to add
+ the <filename>libglade</filename> package to the target sysroot.
+ </para>
+
+ <para>
+ First, you should generate the IPK file for the
+ <filename>libglade</filename> package and add it
+ into a working <filename>opkg</filename> repository.
+ Use these commands:
+ <literallayout class='monospaced'>
+ $ bitbake libglade
+ $ bitbake package-index
+ </literallayout>
+ </para>
+
+ <para>
+ Next, source the cross-toolchain environment setup script found in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ Follow that by setting up the installation destination to point to your
+ sysroot as <replaceable>sysroot_dir</replaceable>.
+ Finally, have an OPKG configuration file <replaceable>conf_file</replaceable>
+ that corresponds to the <filename>opkg</filename> repository you have just created.
+ The following command forms should now work:
+ <literallayout class='monospaced'>
+ $ opkg-cl –f <replaceable>conf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> update
+ $ opkg-cl –f <replaceable>cconf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> \
+ --force-overwrite install libglade
+ $ opkg-cl –f <replaceable>cconf_file</replaceable> -o <replaceable>sysroot_dir</replaceable> \
+ --force-overwrite install libglade-dbg
+ $ opkg-cl –f <replaceable>conf_file&gt; -o </replaceable>sysroot_dir&gt; \
+ --force-overwrite install libglade-dev
+ </literallayout>
+ </para>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-prepare.xml b/poky/documentation/adt-manual/adt-prepare.xml
new file mode 100644
index 000000000..65df1d03e
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-prepare.xml
@@ -0,0 +1,999 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='adt-prepare'>
+
+<title>Preparing for Application Development</title>
+
+<para>
+ In order to develop applications, you need set up your host development system.
+ Several ways exist that allow you to install cross-development tools, QEMU, the
+ Eclipse Yocto Plug-in, and other tools.
+ This chapter describes how to prepare for application development.
+</para>
+
+<section id='installing-the-adt'>
+ <title>Installing the ADT and Toolchains</title>
+
+ <para>
+ The following list describes installation methods that set up varying
+ degrees of tool availability on your system.
+ Regardless of the installation method you choose,
+ you must <filename>source</filename> the cross-toolchain
+ environment setup script, which establishes several key
+ environment variables, before you use a toolchain.
+ See the
+ "<link linkend='setting-up-the-cross-development-environment'>Setting Up the Cross-Development Environment</link>"
+ section for more information.
+ </para>
+
+ <note>
+ <para>
+ Avoid mixing installation methods when installing toolchains for
+ different architectures.
+ For example, avoid using the ADT Installer to install some
+ toolchains and then hand-installing cross-development toolchains
+ by running the toolchain installer for different architectures.
+ Mixing installation methods can result in situations where the
+ ADT Installer becomes unreliable and might not install the
+ toolchain.
+ </para>
+
+ <para>
+ If you must mix installation methods, you might avoid problems by
+ deleting <filename>/var/lib/opkg</filename>, thus purging the
+ <filename>opkg</filename> package metadata.
+ </para>
+ </note>
+
+ <para>
+ <itemizedlist>
+ <listitem><para><emphasis>Use the ADT installer script:</emphasis>
+ This method is the recommended way to install the ADT because it
+ automates much of the process for you.
+ For example, you can configure the installation to install the QEMU emulator
+ and the user-space NFS, specify which root filesystem profiles to download,
+ and define the target sysroot location.</para></listitem>
+ <listitem><para><emphasis>Use an existing toolchain:</emphasis>
+ Using this method, you select and download an architecture-specific
+ toolchain installer and then run the script to hand-install the toolchain.
+ If you use this method, you just get the cross-toolchain and QEMU - you do not
+ get any of the other mentioned benefits had you run the ADT Installer script.</para></listitem>
+ <listitem><para><emphasis>Use the toolchain from within the Build Directory:</emphasis>
+ If you already have a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ you can build the cross-toolchain within the directory.
+ However, like the previous method mentioned, you only get the cross-toolchain and QEMU - you
+ do not get any of the other benefits without taking separate steps.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='using-the-adt-installer'>
+ <title>Using the ADT Installer</title>
+
+ <para>
+ To run the ADT Installer, you need to get the ADT Installer tarball, be sure
+ you have the necessary host development packages that support the ADT Installer,
+ and then run the ADT Installer Script.
+ </para>
+
+ <para>
+ For a list of the host packages needed to support ADT installation and use, see the
+ "ADT Installer Extras" lists in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" section
+ of the Yocto Project Reference Manual.
+ </para>
+
+ <section id='getting-the-adt-installer-tarball'>
+ <title>Getting the ADT Installer Tarball</title>
+
+ <para>
+ The ADT Installer is contained in the ADT Installer tarball.
+ You can get the tarball using either of these methods:
+ <itemizedlist>
+ <listitem><para><emphasis>Download the Tarball:</emphasis>
+ You can download the tarball from
+ <ulink url='&YOCTO_ADTINSTALLER_DL_URL;'></ulink> into
+ any directory.</para></listitem>
+ <listitem><para><emphasis>Build the Tarball:</emphasis>
+ You can use
+ <ulink url='&YOCTO_DOCS_DEV_URL;#bitbake-term'>BitBake</ulink>
+ to generate the tarball inside an existing
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ </para>
+ <para>If you use BitBake to generate the ADT Installer
+ tarball, you must <filename>source</filename> the
+ environment setup script
+ (<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
+ located in the Source Directory before running the
+ <filename>bitbake</filename> command that creates the
+ tarball.</para>
+ <para>The following example commands establish
+ the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
+ check out the current release branch, set up the
+ build environment while also creating the default
+ Build Directory, and run the
+ <filename>bitbake</filename> command that results in the
+ tarball
+ <filename>poky/build/tmp/deploy/sdk/adt_installer.tar.bz2</filename>:
+ <note>
+ Before using BitBake to build the ADT tarball, be
+ sure to make sure your
+ <filename>local.conf</filename> file is properly
+ configured.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#user-configuration'>User Configuration</ulink>"
+ section in the Yocto Project Reference Manual for
+ general configuration information.
+ </note>
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/poky
+ $ cd poky
+ $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
+ $ source &OE_INIT_FILE;
+ $ bitbake adt-installer
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='configuring-and-running-the-adt-installer-script'>
+ <title>Configuring and Running the ADT Installer Script</title>
+
+ <para>
+ Before running the ADT Installer script, you need to unpack the tarball.
+ You can unpack the tarball in any directory you wish.
+ For example, this command copies the ADT Installer tarball from where
+ it was built into the home directory and then unpacks the tarball into
+ a top-level directory named <filename>adt-installer</filename>:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ cp poky/build/tmp/deploy/sdk/adt_installer.tar.bz2 $HOME
+ $ tar -xjf adt_installer.tar.bz2
+ </literallayout>
+ Unpacking it creates the directory <filename>adt-installer</filename>,
+ which contains the ADT Installer script (<filename>adt_installer</filename>)
+ and its configuration file (<filename>adt_installer.conf</filename>).
+ </para>
+
+ <para>
+ Before you run the script, however, you should examine the ADT Installer configuration
+ file and be sure you are going to get what you want.
+ Your configurations determine which kernel and filesystem image are downloaded.
+ </para>
+
+ <para>
+ The following list describes the configurations you can define for the ADT Installer.
+ For configuration values and restrictions, see the comments in
+ the <filename>adt-installer.conf</filename> file:
+
+ <itemizedlist>
+ <listitem><para><filename>YOCTOADT_REPO</filename>: This area
+ includes the IPKG-based packages and the root filesystem upon which
+ the installation is based.
+ If you want to set up your own IPKG repository pointed to by
+ <filename>YOCTOADT_REPO</filename>, you need to be sure that the
+ directory structure follows the same layout as the reference directory
+ set up at <ulink url='http://adtrepo.yoctoproject.org'></ulink>.
+ Also, your repository needs to be accessible through HTTP.</para></listitem>
+ <listitem><para><filename>YOCTOADT_TARGETS</filename>: The machine
+ target architectures for which you want to set up cross-development
+ environments.</para></listitem>
+ <listitem><para><filename>YOCTOADT_QEMU</filename>: Indicates whether
+ or not to install the emulator QEMU.</para></listitem>
+ <listitem><para><filename>YOCTOADT_NFS_UTIL</filename>: Indicates whether
+ or not to install user-mode NFS.
+ If you plan to use the Eclipse IDE Yocto plug-in against QEMU,
+ you should install NFS.
+ <note>To boot QEMU images using our userspace NFS server, you need
+ to be running <filename>portmap</filename> or <filename>rpcbind</filename>.
+ If you are running <filename>rpcbind</filename>, you will also need to add the
+ <filename>-i</filename> option when <filename>rpcbind</filename> starts up.
+ Please make sure you understand the security implications of doing this.
+ You might also have to modify your firewall settings to allow
+ NFS booting to work.</note></para></listitem>
+ <listitem><para><filename>YOCTOADT_ROOTFS_</filename><replaceable>arch</replaceable>: The root
+ filesystem images you want to download from the
+ <filename>YOCTOADT_IPKG_REPO</filename> repository.</para></listitem>
+ <listitem><para><filename>YOCTOADT_TARGET_SYSROOT_IMAGE_</filename><replaceable>arch</replaceable>: The
+ particular root filesystem used to extract and create the target sysroot.
+ The value of this variable must have been specified with
+ <filename>YOCTOADT_ROOTFS_</filename><replaceable>arch</replaceable>.
+ For example, if you downloaded both <filename>minimal</filename> and
+ <filename>sato-sdk</filename> images by setting
+ <filename>YOCTOADT_ROOTFS_</filename><replaceable>arch</replaceable>
+ to "minimal sato-sdk", then <filename>YOCTOADT_ROOTFS_</filename><replaceable>arch</replaceable>
+ must be set to either "minimal" or "sato-sdk".
+ </para></listitem>
+ <listitem><para><filename>YOCTOADT_TARGET_SYSROOT_LOC_</filename><replaceable>arch</replaceable>: The
+ location on the development host where the target sysroot is created.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ After you have configured the <filename>adt_installer.conf</filename> file,
+ run the installer using the following command:
+ <literallayout class='monospaced'>
+ $ cd adt-installer
+ $ ./adt_installer
+ </literallayout>
+ Once the installer begins to run, you are asked to enter the
+ location for cross-toolchain installation.
+ The default location is
+ <filename>/opt/poky/</filename><replaceable>release</replaceable>.
+ After either accepting the default location or selecting your
+ own location, you are prompted to run the installation script
+ interactively or in silent mode.
+ If you want to closely monitor the installation,
+ choose “I†for interactive mode rather than “S†for silent mode.
+ Follow the prompts from the script to complete the installation.
+ </para>
+
+ <para>
+ Once the installation completes, the ADT, which includes the
+ cross-toolchain, is installed in the selected installation
+ directory.
+ You will notice environment setup files for the cross-toolchain
+ in the installation directory, and image tarballs in the
+ <filename>adt-installer</filename> directory according to your
+ installer configurations, and the target sysroot located
+ according to the
+ <filename>YOCTOADT_TARGET_SYSROOT_LOC_</filename><replaceable>arch</replaceable>
+ variable also in your configuration file.
+ </para>
+ </section>
+ </section>
+
+ <section id='using-an-existing-toolchain-tarball'>
+ <title>Using a Cross-Toolchain Tarball</title>
+
+ <para>
+ If you want to simply install a cross-toolchain by hand, you can
+ do so by running the toolchain installer.
+ The installer includes the pre-built cross-toolchain, the
+ <filename>runqemu</filename> script, and support files.
+ If you use this method to install the cross-toolchain, you
+ might still need to install the target sysroot by installing and
+ extracting it separately.
+ For information on how to install the sysroot, see the
+ "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
+ </para>
+
+ <para>
+ Follow these steps:
+ <orderedlist>
+ <listitem><para><emphasis>Get your toolchain installer using one of the following methods:</emphasis>
+ <itemizedlist>
+ <listitem><para>Go to
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>
+ and find the folder that matches your host
+ development system (i.e. <filename>i686</filename>
+ for 32-bit machines or <filename>x86_64</filename>
+ for 64-bit machines).</para>
+ <para>Go into that folder and download the toolchain
+ installer whose name includes the appropriate target
+ architecture.
+ The toolchains provided by the Yocto Project
+ are based off of the
+ <filename>core-image-sato</filename> image and
+ contain libraries appropriate for developing
+ against that image.
+ For example, if your host development system is a
+ 64-bit x86 system and you are going to use
+ your cross-toolchain for a 32-bit x86
+ target, go into the <filename>x86_64</filename>
+ folder and download the following installer:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout></para></listitem>
+ <listitem><para>Build your own toolchain installer.
+ For cases where you cannot use an installer
+ from the download area, you can build your own as
+ described in the
+ "<link linkend='optionally-building-a-toolchain-installer'>Optionally Building a Toolchain Installer</link>"
+ section.</para></listitem>
+ </itemizedlist></para></listitem>
+ <listitem><para><emphasis>Once you have the installer, run it to install the toolchain:</emphasis>
+ <note>
+ You must change the permissions on the toolchain
+ installer script so that it is executable.
+ </note></para>
+ <para>The following command shows how to run the installer
+ given a toolchain tarball for a 64-bit x86 development host
+ system and a 32-bit x86 target architecture.
+ The example assumes the toolchain installer is located
+ in <filename>~/Downloads/</filename>.
+ <literallayout class='monospaced'>
+ $ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout>
+ The first thing the installer prompts you for is the
+ directory into which you want to install the toolchain.
+ The default directory used is
+ <filename>/opt/poky/&DISTRO;</filename>.
+ If you do not have write permissions for the directory
+ into which you are installing the toolchain, the
+ toolchain installer notifies you and exits.
+ Be sure you have write permissions in the directory and
+ run the installer again.</para>
+ <para>When the script finishes, the cross-toolchain is
+ installed.
+ You will notice environment setup files for the
+ cross-toolchain in the installation directory.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='using-the-toolchain-from-within-the-build-tree'>
+ <title>Using BitBake and the Build Directory</title>
+
+ <para>
+ A final way of making the cross-toolchain available is to use BitBake
+ to generate the toolchain within an existing
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ This method does not install the toolchain into the default
+ <filename>/opt</filename> directory.
+ As with the previous method, if you need to install the target sysroot, you must
+ do that separately as well.
+ </para>
+
+ <para>
+ Follow these steps to generate the toolchain into the Build Directory:
+ <orderedlist>
+ <listitem><para><emphasis>Set up the Build Environment:</emphasis>
+ Source the OpenEmbedded build environment setup
+ script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
+ located in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Check your Local Configuration File:</emphasis>
+ At this point, you should be sure that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable
+ in the <filename>local.conf</filename> file found in the
+ <filename>conf</filename> directory of the Build Directory
+ is set for the target architecture.
+ Comments within the <filename>local.conf</filename> file
+ list the values you can use for the
+ <filename>MACHINE</filename> variable.
+ If you do not change the <filename>MACHINE</filename>
+ variable, the OpenEmbedded build system uses
+ <filename>qemux86</filename> as the default target
+ machine when building the cross-toolchain.
+ <note>
+ You can populate the Build Directory with the
+ cross-toolchains for more than a single architecture.
+ You just need to edit the <filename>MACHINE</filename>
+ variable in the <filename>local.conf</filename> file and
+ re-run the <filename>bitbake</filename> command.
+ </note></para></listitem>
+ <listitem><para><emphasis>Make Sure Your Layers are Enabled:</emphasis>
+ Examine the <filename>conf/bblayers.conf</filename> file
+ and make sure that you have enabled all the compatible
+ layers for your target machine.
+ The OpenEmbedded build system needs to be aware of each
+ layer you want included when building images and
+ cross-toolchains.
+ For information on how to enable a layer, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-your-layer'>Enabling Your Layer</ulink>"
+ section in the Yocto Project Development Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Generate the Cross-Toolchain:</emphasis>
+ Run <filename>bitbake meta-ide-support</filename> to
+ complete the cross-toolchain generation.
+ Once the <filename>bitbake</filename> command finishes,
+ the cross-toolchain is
+ generated and populated within the Build Directory.
+ You will notice environment setup files for the
+ cross-toolchain that contain the string
+ "<filename>environment-setup</filename>" in the
+ Build Directory's <filename>tmp</filename> folder.</para>
+ <para>Be aware that when you use this method to install the
+ toolchain, you still need to separately extract and install
+ the sysroot filesystem.
+ For information on how to do this, see the
+ "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>" section.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</section>
+
+<section id='setting-up-the-cross-development-environment'>
+ <title>Setting Up the Cross-Development Environment</title>
+
+ <para>
+ Before you can develop using the cross-toolchain, you need to set up the
+ cross-development environment by sourcing the toolchain's environment setup script.
+ If you used the ADT Installer or hand-installed cross-toolchain,
+ then you can find this script in the directory you chose for installation.
+ For this release, the default installation directory is
+ <filename>&YOCTO_ADTPATH_DIR;</filename>.
+ If you installed the toolchain in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>,
+ you can find the environment setup
+ script for the toolchain in the Build Directory's <filename>tmp</filename> directory.
+ </para>
+
+ <para>
+ Be sure to run the environment setup script that matches the
+ architecture for which you are developing.
+ Environment setup scripts begin with the string
+ "<filename>environment-setup</filename>" and include as part of their
+ name the architecture.
+ For example, the toolchain environment setup script for a 64-bit
+ IA-based architecture installed in the default installation directory
+ would be the following:
+ <literallayout class='monospaced'>
+ &YOCTO_ADTPATH_DIR;/environment-setup-x86_64-poky-linux
+ </literallayout>
+ When you run the setup script, many environment variables are
+ defined:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKTARGETSYSROOT'><filename>SDKTARGETSYSROOT</filename></ulink> - The path to the sysroot used for cross-compilation
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKG_CONFIG_PATH'><filename>PKG_CONFIG_PATH</filename></ulink> - The path to the target pkg-config files
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIG_SITE'><filename>CONFIG_SITE</filename></ulink> - A GNU autoconf site file preconfigured for the target
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink> - The minimal command and arguments to run the C compiler
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CXX'><filename>CXX</filename></ulink> - The minimal command and arguments to run the C++ compiler
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CPP'><filename>CPP</filename></ulink> - The minimal command and arguments to run the C preprocessor
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-AS'><filename>AS</filename></ulink> - The minimal command and arguments to run the assembler
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink> - The minimal command and arguments to run the linker
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-GDB'><filename>GDB</filename></ulink> - The minimal command and arguments to run the GNU Debugger
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STRIP'><filename>STRIP</filename></ulink> - The minimal command and arguments to run 'strip', which strips symbols
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RANLIB'><filename>RANLIB</filename></ulink> - The minimal command and arguments to run 'ranlib'
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-OBJCOPY'><filename>OBJCOPY</filename></ulink> - The minimal command and arguments to run 'objcopy'
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-OBJDUMP'><filename>OBJDUMP</filename></ulink> - The minimal command and arguments to run 'objdump'
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-AR'><filename>AR</filename></ulink> - The minimal command and arguments to run 'ar'
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-NM'><filename>NM</filename></ulink> - The minimal command and arguments to run 'nm'
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_PREFIX'><filename>TARGET_PREFIX</filename></ulink> - The toolchain binary prefix for the target tools
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CROSS_COMPILE'><filename>CROSS_COMPILE</filename></ulink> - The toolchain binary prefix for the target tools
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIGURE_FLAGS'><filename>CONFIGURE_FLAGS</filename></ulink> - The minimal arguments for GNU configure
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CFLAGS'><filename>CFLAGS</filename></ulink> - Suggested C flags
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CXXFLAGS'><filename>CXXFLAGS</filename></ulink> - Suggested C++ flags
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LDFLAGS'><filename>LDFLAGS</filename></ulink> - Suggested linker flags when you use CC to link
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CPPFLAGS'><filename>CPPFLAGS</filename></ulink> - Suggested preprocessor flags
+ </literallayout>
+ </para>
+</section>
+
+<section id='securing-kernel-and-filesystem-images'>
+ <title>Securing Kernel and Filesystem Images</title>
+
+ <para>
+ You will need to have a kernel and filesystem image to boot using your
+ hardware or the QEMU emulator.
+ Furthermore, if you plan on booting your image using NFS or you want to use the root filesystem
+ as the target sysroot, you need to extract the root filesystem.
+ </para>
+
+ <section id='getting-the-images'>
+ <title>Getting the Images</title>
+
+ <para>
+ To get the kernel and filesystem images, you either have to build them or download
+ pre-built versions.
+ For an example of how to build these images, see the
+ "<ulink url='&YOCTO_DOCS_QS_URL;#qs-buiding-images'>Buiding Images</ulink>"
+ section of the Yocto Project Quick Start.
+ For an example of downloading pre-build versions, see the
+ "<link linkend='using-pre-built'>Example Using Pre-Built Binaries and QEMU</link>"
+ section.
+ </para>
+
+ <para>
+ The Yocto Project ships basic kernel and filesystem images for several
+ architectures (<filename>x86</filename>, <filename>x86-64</filename>,
+ <filename>mips</filename>, <filename>powerpc</filename>, and <filename>arm</filename>)
+ that you can use unaltered in the QEMU emulator.
+ These kernel images reside in the release
+ area - <ulink url='&YOCTO_MACHINES_DL_URL;'></ulink>
+ and are ideal for experimentation using Yocto Project.
+ For information on the image types you can build using the OpenEmbedded build system,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ If you are planning on developing against your image and you are not
+ building or using one of the Yocto Project development images
+ (e.g. <filename>core-image-*-dev</filename>), you must be sure to
+ include the development packages as part of your image recipe.
+ </para>
+
+ <para>
+ If you plan on remotely deploying and debugging your
+ application from within the Eclipse IDE, you must have an image
+ that contains the Yocto Target Communication Framework (TCF) agent
+ (<filename>tcf-agent</filename>).
+ You can do this by including the <filename>eclipse-debug</filename>
+ image feature.
+ <note>
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-features-image'>Image Features</ulink>"
+ section in the Yocto Project Reference Manual for information on
+ image features.
+ </note>
+ To include the <filename>eclipse-debug</filename> image feature,
+ modify your <filename>local.conf</filename> file in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
+ so that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
+ variable includes the "eclipse-debug" feature.
+ After modifying the configuration file, you can rebuild the image.
+ Once the image is rebuilt, the <filename>tcf-agent</filename>
+ will be included in the image and is launched automatically after
+ the boot.
+ </para>
+ </section>
+
+ <section id='extracting-the-root-filesystem'>
+ <title>Extracting the Root Filesystem</title>
+
+ <para>
+ If you install your toolchain by hand or build it using BitBake and
+ you need a root filesystem, you need to extract it separately.
+ If you use the ADT Installer to install the ADT, the root
+ filesystem is automatically extracted and installed.
+ </para>
+
+ <para>
+ Here are some cases where you need to extract the root filesystem:
+ <itemizedlist>
+ <listitem><para>You want to boot the image using NFS.
+ </para></listitem>
+ <listitem><para>You want to use the root filesystem as the
+ target sysroot.
+ For example, the Eclipse IDE environment with the Eclipse
+ Yocto Plug-in installed allows you to use QEMU to boot
+ under NFS.</para></listitem>
+ <listitem><para>You want to develop your target application
+ using the root filesystem as the target sysroot.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ To extract the root filesystem, first <filename>source</filename>
+ the cross-development environment setup script to establish
+ necessary environment variables.
+ If you built the toolchain in the Build Directory, you will find
+ the toolchain environment script in the
+ <filename>tmp</filename> directory.
+ If you installed the toolchain by hand, the environment setup
+ script is located in <filename>/opt/poky/&DISTRO;</filename>.
+ </para>
+
+ <para>
+ After sourcing the environment script, use the
+ <filename>runqemu-extract-sdk</filename> command and provide the
+ filesystem image.
+ </para>
+
+ <para>
+ Following is an example.
+ The second command sets up the environment.
+ In this case, the setup script is located in the
+ <filename>/opt/poky/&DISTRO;</filename> directory.
+ The third command extracts the root filesystem from a previously
+ built filesystem that is located in the
+ <filename>~/Downloads</filename> directory.
+ Furthermore, this command extracts the root filesystem into the
+ <filename>qemux86-sato</filename> directory:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ $ runqemu-extract-sdk \
+ ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \
+ $HOME/qemux86-sato
+ </literallayout>
+ You could now point to the target sysroot at
+ <filename>qemux86-sato</filename>.
+ </para>
+ </section>
+</section>
+
+<section id='optionally-building-a-toolchain-installer'>
+ <title>Optionally Building a Toolchain Installer</title>
+
+ <para>
+ As an alternative to locating and downloading a toolchain installer,
+ you can build the toolchain installer if you have a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>.
+ <note>
+ Although not the preferred method, it is also possible to use
+ <filename>bitbake meta-toolchain</filename> to build the toolchain
+ installer.
+ If you do use this method, you must separately install and extract
+ the target sysroot.
+ For information on how to install the sysroot, see the
+ "<link linkend='extracting-the-root-filesystem'>Extracting the Root Filesystem</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ To build the toolchain installer and populate the SDK image, use the
+ following command:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c populate_sdk
+ </literallayout>
+ The command results in a toolchain installer that contains the sysroot
+ that matches your target root filesystem.
+ </para>
+
+ <para>
+ Another powerful feature is that the toolchain is completely
+ self-contained.
+ The binaries are linked against their own copy of
+ <filename>libc</filename>, which results in no dependencies
+ on the target system.
+ To achieve this, the pointer to the dynamic loader is
+ configured at install time since that path cannot be dynamically
+ altered.
+ This is the reason for a wrapper around the
+ <filename>populate_sdk</filename> archive.
+ </para>
+
+ <para>
+ Another feature is that only one set of cross-canadian toolchain
+ binaries are produced per architecture.
+ This feature takes advantage of the fact that the target hardware can
+ be passed to <filename>gcc</filename> as a set of compiler options.
+ Those options are set up by the environment script and contained in
+ variables such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink>.
+ This reduces the space needed for the tools.
+ Understand, however, that a sysroot is still needed for every target
+ since those binaries are target-specific.
+ </para>
+
+ <para>
+ Remember, before using any BitBake command, you
+ must source the build environment setup script
+ (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>)
+ located in the Source Directory and you must make sure your
+ <filename>conf/local.conf</filename> variables are correct.
+ In particular, you need to be sure the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable matches the architecture for which you are building and that
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>
+ variable is correctly set if you are building a toolchain designed to
+ run on an architecture that differs from your current development host
+ machine (i.e. the build machine).
+ </para>
+
+ <para>
+ When the <filename>bitbake</filename> command completes, the toolchain
+ installer will be in
+ <filename>tmp/deploy/sdk</filename> in the Build Directory.
+ <note>
+ By default, this toolchain does not build static binaries.
+ If you want to use the toolchain to build these types of libraries,
+ you need to be sure your image has the appropriate static
+ development libraries.
+ Use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
+ variable inside your <filename>local.conf</filename> file to
+ install the appropriate library packages.
+ Following is an example using <filename>glibc</filename> static
+ development libraries:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " glibc-staticdev"
+ </literallayout>
+ </note>
+ </para>
+</section>
+
+<section id='optionally-using-an-external-toolchain'>
+ <title>Optionally Using an External Toolchain</title>
+
+ <para>
+ You might want to use an external toolchain as part of your
+ development.
+ If this is the case, the fundamental steps you need to accomplish
+ are as follows:
+ <itemizedlist>
+ <listitem><para>
+ Understand where the installed toolchain resides.
+ For cases where you need to build the external toolchain, you
+ would need to take separate steps to build and install the
+ toolchain.
+ </para></listitem>
+ <listitem><para>
+ Make sure you add the layer that contains the toolchain to
+ your <filename>bblayers.conf</filename> file through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ Set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNAL_TOOLCHAIN'><filename>EXTERNAL_TOOLCHAIN</filename></ulink>
+ variable in your <filename>local.conf</filename> file
+ to the location in which you installed the toolchain.
+ </para></listitem>
+ </itemizedlist>
+ A good example of an external toolchain used with the Yocto Project
+ is <trademark class='registered'>Mentor Graphics</trademark>
+ Sourcery G++ Toolchain.
+ You can see information on how to use that particular layer in the
+ <filename>README</filename> file at
+ <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>.
+ You can find further information by reading about the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TCMODE'><filename>TCMODE</filename></ulink>
+ variable in the Yocto Project Reference Manual's variable glossary.
+ </para>
+</section>
+
+ <section id='using-pre-built'>
+ <title>Example Using Pre-Built Binaries and QEMU</title>
+
+ <para>
+ If hardware, libraries and services are stable, you can get started by using a pre-built binary
+ of the filesystem image, kernel, and toolchain and run it using the QEMU emulator.
+ This scenario is useful for developing application software.
+ </para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/using-a-pre-built-image.png" format="PNG" align='center' scalefit='1'/>
+ </imageobject>
+ <caption>
+ <para>Using a Pre-Built Image</para>
+ </caption>
+ </mediaobject>
+
+ <para>
+ For this scenario, you need to do several things:
+ </para>
+
+ <itemizedlist>
+ <listitem><para>Install the appropriate stand-alone toolchain tarball.</para></listitem>
+ <listitem><para>Download the pre-built image that will boot with QEMU.
+ You need to be sure to get the QEMU image that matches your target machine’s
+ architecture (e.g. x86, ARM, etc.).</para></listitem>
+ <listitem><para>Download the filesystem image for your target machine's architecture.
+ </para></listitem>
+ <listitem><para>Set up the environment to emulate the hardware and then start the QEMU emulator.
+ </para></listitem>
+ </itemizedlist>
+
+ <section id='installing-the-toolchain'>
+ <title>Installing the Toolchain</title>
+
+ <para>
+ You can download a tarball installer, which includes the
+ pre-built toolchain, the <filename>runqemu</filename>
+ script, and support files from the appropriate directory under
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>.
+ Toolchains are available for 32-bit and 64-bit x86 development
+ systems from the <filename>i686</filename> and
+ <filename>x86_64</filename> directories, respectively.
+ The toolchains the Yocto Project provides are based off the
+ <filename>core-image-sato</filename> image and contain
+ libraries appropriate for developing against that image.
+ Each type of development system supports five or more target
+ architectures.
+ </para>
+
+ <para>
+ The names of the tarball installer scripts are such that a
+ string representing the host system appears first in the
+ filename and then is immediately followed by a string
+ representing the target architecture.
+ </para>
+
+ <literallayout class='monospaced'>
+ poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-<replaceable>release_version</replaceable>.sh
+
+ Where:
+ <replaceable>host_system</replaceable> is a string representing your development system:
+
+ i686 or x86_64.
+
+ <replaceable>image_type</replaceable> is a string representing the image you wish to
+ develop a Software Development Toolkit (SDK) for use against.
+ The Yocto Project builds toolchain installers using the
+ following BitBake command:
+
+ bitbake core-image-sato -c populate_sdk
+
+ <replaceable>arch</replaceable> is a string representing the tuned target architecture:
+
+ i586, x86_64, powerpc, mips, armv7a or armv5te
+
+ <replaceable>release_version</replaceable> is a string representing the release number of the
+ Yocto Project:
+
+ &DISTRO;, &DISTRO;+snapshot
+ </literallayout>
+
+ <para>
+ For example, the following toolchain installer is for a 64-bit
+ development host system and a i586-tuned target architecture
+ based off the SDK for <filename>core-image-sato</filename>:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout>
+ </para>
+
+ <para>
+ Toolchains are self-contained and by default are installed into
+ <filename>/opt/poky</filename>.
+ However, when you run the toolchain installer, you can choose an
+ installation directory.
+ </para>
+
+ <para>
+ The following command shows how to run the installer given a toolchain tarball
+ for a 64-bit x86 development host system and a 32-bit x86 target architecture.
+ You must change the permissions on the toolchain
+ installer script so that it is executable.
+ </para>
+
+ <para>
+ The example assumes the toolchain installer is located in <filename>~/Downloads/</filename>.
+ <note>
+ If you do not have write permissions for the directory into which you are installing
+ the toolchain, the toolchain installer notifies you and exits.
+ Be sure you have write permissions in the directory and run the installer again.
+ </note>
+ </para>
+
+ <para>
+ <literallayout class='monospaced'>
+ $ ~/Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on how to install tarballs, see the
+ "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" and
+ "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Build Directory</ulink>" sections in the Yocto Project Application Developer's Guide.
+ </para>
+ </section>
+
+ <section id='downloading-the-pre-built-linux-kernel'>
+ <title>Downloading the Pre-Built Linux Kernel</title>
+
+ <para>
+ You can download the pre-built Linux kernel suitable for running in the QEMU emulator from
+ <ulink url='&YOCTO_QEMU_DL_URL;'></ulink>.
+ Be sure to use the kernel that matches the architecture you want to simulate.
+ Download areas exist for the five supported machine architectures:
+ <filename>qemuarm</filename>, <filename>qemumips</filename>, <filename>qemuppc</filename>,
+ <filename>qemux86</filename>, and <filename>qemux86-64</filename>.
+ </para>
+
+ <para>
+ Most kernel files have one of the following forms:
+ <literallayout class='monospaced'>
+ *zImage-qemu<replaceable>arch</replaceable>.bin
+ vmlinux-qemu<replaceable>arch</replaceable>.bin
+
+ Where:
+ <replaceable>arch</replaceable> is a string representing the target architecture:
+ x86, x86-64, ppc, mips, or arm.
+ </literallayout>
+ </para>
+
+ <para>
+ You can learn more about downloading a Yocto Project kernel in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#local-kernel-files'>Yocto Project Kernel</ulink>"
+ bulleted item in the Yocto Project Development Manual.
+ </para>
+ </section>
+
+ <section id='downloading-the-filesystem'>
+ <title>Downloading the Filesystem</title>
+
+ <para>
+ You can also download the filesystem image suitable for your target architecture from
+ <ulink url='&YOCTO_QEMU_DL_URL;'></ulink>.
+ Again, be sure to use the filesystem that matches the architecture you want
+ to simulate.
+ </para>
+
+ <para>
+ The filesystem image has two tarball forms: <filename>ext3</filename> and
+ <filename>tar</filename>.
+ You must use the <filename>ext3</filename> form when booting an image using the
+ QEMU emulator.
+ The <filename>tar</filename> form can be flattened out in your host development system
+ and used for build purposes with the Yocto Project.
+ <literallayout class='monospaced'>
+ core-image-<replaceable>profile</replaceable>-qemu<replaceable>arch</replaceable>.ext3
+ core-image-<replaceable>profile</replaceable>-qemu<replaceable>arch</replaceable>.tar.bz2
+
+ Where:
+ <replaceable>profile</replaceable> is the filesystem image's profile:
+ lsb, lsb-dev, lsb-sdk, lsb-qt3, minimal, minimal-dev, sato,
+ sato-dev, or sato-sdk. For information on these types of image
+ profiles, see the "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.
+
+ <replaceable>arch</replaceable> is a string representing the target architecture:
+ x86, x86-64, ppc, mips, or arm.
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-up-the-environment-and-starting-the-qemu-emulator'>
+ <title>Setting Up the Environment and Starting the QEMU Emulator</title>
+
+ <para>
+ Before you start the QEMU emulator, you need to set up the emulation environment.
+ The following command form sets up the emulation environment.
+ <literallayout class='monospaced'>
+ $ source &YOCTO_ADTPATH_DIR;/environment-setup-<replaceable>arch</replaceable>-poky-linux-<replaceable>if</replaceable>
+
+ Where:
+ <replaceable>arch</replaceable> is a string representing the target architecture:
+ i586, x86_64, ppc603e, mips, or armv5te.
+
+ <replaceable>if</replaceable> is a string representing an embedded application binary interface.
+ Not all setup scripts include this string.
+ </literallayout>
+ </para>
+
+ <para>
+ Finally, this command form invokes the QEMU emulator
+ <literallayout class='monospaced'>
+ $ runqemu <replaceable>qemuarch</replaceable> <replaceable>kernel-image</replaceable> <replaceable>filesystem-image</replaceable>
+
+ Where:
+ <replaceable>qemuarch</replaceable> is a string representing the target architecture: qemux86, qemux86-64,
+ qemuppc, qemumips, or qemuarm.
+
+ <replaceable>kernel-image</replaceable> is the architecture-specific kernel image.
+
+ <replaceable>filesystem-image</replaceable> is the .ext3 filesystem image.
+
+ </literallayout>
+ </para>
+
+ <para>
+ Continuing with the example, the following two commands setup the emulation
+ environment and launch QEMU.
+ This example assumes the root filesystem (<filename>.ext3</filename> file) and
+ the pre-built kernel image file both reside in your home directory.
+ The kernel and filesystem are for a 32-bit target architecture.
+ <literallayout class='monospaced'>
+ $ cd $HOME
+ $ source &YOCTO_ADTPATH_DIR;/environment-setup-i586-poky-linux
+ $ runqemu qemux86 bzImage-qemux86.bin \
+ core-image-sato-qemux86.ext3
+ </literallayout>
+ </para>
+
+ <para>
+ The environment in which QEMU launches varies depending on the filesystem image and on the
+ target architecture.
+ For example, if you source the environment for the ARM target
+ architecture and then boot the minimal QEMU image, the emulator comes up in a new
+ shell in command-line mode.
+ However, if you boot the SDK image, QEMU comes up with a GUI.
+ <note>Booting the PPC image results in QEMU launching in the same shell in
+ command-line mode.</note>
+ </para>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/adt-manual/adt-style.css b/poky/documentation/adt-manual/adt-style.css
new file mode 100644
index 000000000..d722ad4b7
--- /dev/null
+++ b/poky/documentation/adt-manual/adt-style.css
@@ -0,0 +1,984 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/adt-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/adt-manual/figures/adt-title.png b/poky/documentation/adt-manual/figures/adt-title.png
new file mode 100644
index 000000000..6e71e41f1
--- /dev/null
+++ b/poky/documentation/adt-manual/figures/adt-title.png
Binary files differ
diff --git a/poky/documentation/adt-manual/figures/using-a-pre-built-image.png b/poky/documentation/adt-manual/figures/using-a-pre-built-image.png
new file mode 100644
index 000000000..b03130d12
--- /dev/null
+++ b/poky/documentation/adt-manual/figures/using-a-pre-built-image.png
Binary files differ
diff --git a/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-customization.xsl b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-customization.xsl
new file mode 100644
index 000000000..0d57424b5
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-customization.xsl
@@ -0,0 +1,24 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:import href="brief-yoctoprojectqs-titlepage.xsl"/>
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="generate.toc" select="'article nop'"></xsl:param>
+ <xsl:param name="html.stylesheet" select="'brief-yoctoprojectqs-style.css'" />
+</xsl:stylesheet>
diff --git a/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-eclipse-customization.xsl b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-eclipse-customization.xsl
new file mode 100644
index 000000000..fbb3b578e
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:import href="brief-yoctoprojectqs-titlepage.xsl"/>
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/brief-yoctoprojectqs/'"/>
+ <xsl:param name="chunk.section.depth" select="0"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="generate.toc" select="'article nop'"></xsl:param>
+ <xsl:param name="html.stylesheet" select="'style.css'" />
+</xsl:stylesheet>
+
diff --git a/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-style.css b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-style.css
new file mode 100644
index 000000000..386841deb
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-style.css
@@ -0,0 +1,989 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/bypqs-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title {
+ background-position: bottom;
+ background-repeat: repeat-x;
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-titlepage.xsl b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-titlepage.xsl
new file mode 100644
index 000000000..a435ac77a
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs-titlepage.xsl
@@ -0,0 +1,3820 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
+
+<!-- This stylesheet was created by template/titlepage.xsl-->
+
+<xsl:template name="article.titlepage.recto">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/abstract"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/abstract"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/abstract"/>
+ <xsl:choose>
+ <xsl:when test="articleinfo/title">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/title"/>
+ </xsl:when>
+ <xsl:when test="artheader/title">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="articleinfo/subtitle">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="artheader/subtitle">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/corpauthor"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/corpauthor"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/authorgroup"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/authorgroup"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/author"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/author"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/othercredit"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/othercredit"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/releaseinfo"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/releaseinfo"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/copyright"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/copyright"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/legalnotice"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/legalnotice"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/pubdate"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/pubdate"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revision"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revision"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="articleinfo/revhistory"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="artheader/revhistory"/>
+ <xsl:apply-templates mode="article.titlepage.recto.auto.mode" select="info/revhistory"/>
+</xsl:template>
+
+<xsl:template name="article.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="article.titlepage.separator"><hr/>
+</xsl:template>
+
+<xsl:template name="article.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="article.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="article.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="article.titlepage.before.recto"/>
+ <xsl:call-template name="article.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="article.titlepage.before.verso"/>
+ <xsl:call-template name="article.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="article.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="article.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="article.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="abstract" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+ <xsl:call-template name="anchor"/>
+ <xsl:apply-templates/>
+<!-- orignally generated content -->
+<!-- <xsl:apply-templates select="." mode="article.titlepage.recto.mode"/> -->
+</div>
+</xsl:template>
+
+<xsl:template match="title" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="article.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="article.titlepage.recto.style">
+<xsl:apply-templates select="." mode="article.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="set.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="setinfo/title">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="setinfo/subtitle">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/corpauthor"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/authorgroup"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/author"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/othercredit"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/releaseinfo"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/copyright"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/legalnotice"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/pubdate"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revision"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/revhistory"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="setinfo/abstract"/>
+ <xsl:apply-templates mode="set.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="set.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="set.titlepage.separator"><hr/>
+</xsl:template>
+
+<xsl:template name="set.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="set.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="set.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="set.titlepage.before.recto"/>
+ <xsl:call-template name="set.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="set.titlepage.before.verso"/>
+ <xsl:call-template name="set.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="set.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="set.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="set.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="set.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="set.titlepage.recto.style">
+<xsl:apply-templates select="." mode="set.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="book.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="bookinfo/title">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="bookinfo/subtitle">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/corpauthor"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/authorgroup"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/author"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/othercredit"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/releaseinfo"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/copyright"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/legalnotice"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/pubdate"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revision"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/revhistory"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="bookinfo/abstract"/>
+ <xsl:apply-templates mode="book.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="book.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="book.titlepage.separator"><hr/>
+</xsl:template>
+
+<xsl:template name="book.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="book.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="book.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="book.titlepage.before.recto"/>
+ <xsl:call-template name="book.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="book.titlepage.before.verso"/>
+ <xsl:call-template name="book.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="book.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="book.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="book.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="book.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="book.titlepage.recto.style">
+<xsl:apply-templates select="." mode="book.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="part.titlepage.recto">
+ <div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:call-template name="division.title">
+<xsl:with-param name="node" select="ancestor-or-self::part[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="partinfo/subtitle">
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/corpauthor"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/authorgroup"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/author"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/othercredit"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/releaseinfo"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/copyright"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/legalnotice"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/pubdate"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revision"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/revhistory"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="partinfo/abstract"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="part.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="part.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="part.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="part.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="part.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="part.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="part.titlepage.before.recto"/>
+ <xsl:call-template name="part.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="part.titlepage.before.verso"/>
+ <xsl:call-template name="part.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="part.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="part.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="part.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="part.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="part.titlepage.recto.style">
+<xsl:apply-templates select="." mode="part.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="partintro.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="partintroinfo/title">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="partintroinfo/subtitle">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/corpauthor"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/authorgroup"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/author"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/othercredit"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/releaseinfo"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/copyright"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/legalnotice"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/pubdate"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revision"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/revhistory"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="partintroinfo/abstract"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="partintro.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="partintro.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="partintro.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="partintro.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="partintro.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="partintro.titlepage">
+ <div>
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="partintro.titlepage.before.recto"/>
+ <xsl:call-template name="partintro.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="partintro.titlepage.before.verso"/>
+ <xsl:call-template name="partintro.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="partintro.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="partintro.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="partintro.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="partintro.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="partintro.titlepage.recto.style">
+<xsl:apply-templates select="." mode="partintro.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="reference.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="referenceinfo/title">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="referenceinfo/subtitle">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/corpauthor"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/authorgroup"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/author"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/othercredit"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/releaseinfo"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/copyright"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/legalnotice"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/pubdate"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revision"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/revhistory"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="referenceinfo/abstract"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="reference.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="reference.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="reference.titlepage.separator"><hr/>
+</xsl:template>
+
+<xsl:template name="reference.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="reference.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="reference.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="reference.titlepage.before.recto"/>
+ <xsl:call-template name="reference.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="reference.titlepage.before.verso"/>
+ <xsl:call-template name="reference.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="reference.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="reference.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="reference.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="reference.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="reference.titlepage.recto.style">
+<xsl:apply-templates select="." mode="reference.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="refentry.titlepage.recto">
+</xsl:template>
+
+<xsl:template name="refentry.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="refentry.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="refentry.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="refentry.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="refentry.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="refentry.titlepage.before.recto"/>
+ <xsl:call-template name="refentry.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="refentry.titlepage.before.verso"/>
+ <xsl:call-template name="refentry.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="refentry.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="refentry.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="refentry.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template name="dedication.titlepage.recto">
+ <div xsl:use-attribute-sets="dedication.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::dedication[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="dedicationinfo/subtitle">
+ <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="dedicationinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="dedication.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="dedication.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="dedication.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="dedication.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="dedication.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="dedication.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="dedication.titlepage.before.recto"/>
+ <xsl:call-template name="dedication.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="dedication.titlepage.before.verso"/>
+ <xsl:call-template name="dedication.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="dedication.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="dedication.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="dedication.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="dedication.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="dedication.titlepage.recto.style">
+<xsl:apply-templates select="." mode="dedication.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage.recto">
+ <div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::acknowledgements[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="acknowledgementsinfo/subtitle">
+ <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="acknowledgementsinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="acknowledgements.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="acknowledgements.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="acknowledgements.titlepage.before.recto"/>
+ <xsl:call-template name="acknowledgements.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="acknowledgements.titlepage.before.verso"/>
+ <xsl:call-template name="acknowledgements.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="acknowledgements.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="acknowledgements.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="acknowledgements.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="acknowledgements.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="acknowledgements.titlepage.recto.style">
+<xsl:apply-templates select="." mode="acknowledgements.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="preface.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="prefaceinfo/title">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="prefaceinfo/subtitle">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/corpauthor"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/authorgroup"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/author"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/othercredit"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/releaseinfo"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/copyright"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/legalnotice"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/pubdate"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revision"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/revhistory"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="prefaceinfo/abstract"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="preface.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="preface.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="preface.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="preface.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="preface.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="preface.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="preface.titlepage.before.recto"/>
+ <xsl:call-template name="preface.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="preface.titlepage.before.verso"/>
+ <xsl:call-template name="preface.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="preface.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="preface.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="preface.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="preface.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="preface.titlepage.recto.style">
+<xsl:apply-templates select="." mode="preface.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="chapter.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="chapterinfo/title">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="chapterinfo/subtitle">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/corpauthor"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/authorgroup"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/author"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/othercredit"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/releaseinfo"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/copyright"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/legalnotice"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/pubdate"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revision"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/revhistory"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="chapterinfo/abstract"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="chapter.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="chapter.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="chapter.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="chapter.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="chapter.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="chapter.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="chapter.titlepage.before.recto"/>
+ <xsl:call-template name="chapter.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="chapter.titlepage.before.verso"/>
+ <xsl:call-template name="chapter.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="chapter.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="chapter.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="chapter.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="chapter.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="chapter.titlepage.recto.style">
+<xsl:apply-templates select="." mode="chapter.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="appendix.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="appendixinfo/title">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="appendixinfo/subtitle">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/corpauthor"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/authorgroup"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/author"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/othercredit"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/releaseinfo"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/copyright"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/legalnotice"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/pubdate"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revision"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/revhistory"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="appendixinfo/abstract"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="appendix.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="appendix.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="appendix.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="appendix.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="appendix.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="appendix.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="appendix.titlepage.before.recto"/>
+ <xsl:call-template name="appendix.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="appendix.titlepage.before.verso"/>
+ <xsl:call-template name="appendix.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="appendix.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="appendix.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="appendix.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="appendix.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="appendix.titlepage.recto.style">
+<xsl:apply-templates select="." mode="appendix.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="section.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sectioninfo/title">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sectioninfo/subtitle">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/corpauthor"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/authorgroup"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/author"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/othercredit"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/releaseinfo"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/copyright"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/legalnotice"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/pubdate"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revision"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/revhistory"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="sectioninfo/abstract"/>
+ <xsl:apply-templates mode="section.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="section.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="section.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="section.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="section.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="section.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="section.titlepage.before.recto"/>
+ <xsl:call-template name="section.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="section.titlepage.before.verso"/>
+ <xsl:call-template name="section.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="section.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="section.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="section.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="section.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="section.titlepage.recto.style">
+<xsl:apply-templates select="." mode="section.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sect1.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sect1info/title">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sect1info/subtitle">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/corpauthor"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/authorgroup"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/author"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/othercredit"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/releaseinfo"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/copyright"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/legalnotice"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/pubdate"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revision"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/revhistory"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="sect1info/abstract"/>
+ <xsl:apply-templates mode="sect1.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="sect1.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sect1.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="sect1.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sect1.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sect1.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sect1.titlepage.before.recto"/>
+ <xsl:call-template name="sect1.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sect1.titlepage.before.verso"/>
+ <xsl:call-template name="sect1.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sect1.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sect1.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sect1.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="sect1.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect1.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect1.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sect2.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sect2info/title">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sect2info/subtitle">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/corpauthor"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/authorgroup"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/author"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/othercredit"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/releaseinfo"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/copyright"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/legalnotice"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/pubdate"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revision"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/revhistory"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="sect2info/abstract"/>
+ <xsl:apply-templates mode="sect2.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="sect2.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sect2.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="sect2.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sect2.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sect2.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sect2.titlepage.before.recto"/>
+ <xsl:call-template name="sect2.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sect2.titlepage.before.verso"/>
+ <xsl:call-template name="sect2.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sect2.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sect2.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sect2.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="sect2.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect2.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect2.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sect3.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sect3info/title">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sect3info/subtitle">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/corpauthor"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/authorgroup"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/author"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/othercredit"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/releaseinfo"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/copyright"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/legalnotice"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/pubdate"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revision"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/revhistory"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="sect3info/abstract"/>
+ <xsl:apply-templates mode="sect3.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="sect3.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sect3.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="sect3.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sect3.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sect3.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sect3.titlepage.before.recto"/>
+ <xsl:call-template name="sect3.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sect3.titlepage.before.verso"/>
+ <xsl:call-template name="sect3.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sect3.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sect3.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sect3.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="sect3.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect3.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect3.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sect4.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sect4info/title">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sect4info/subtitle">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/corpauthor"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/authorgroup"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/author"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/othercredit"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/releaseinfo"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/copyright"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/legalnotice"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/pubdate"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revision"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/revhistory"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="sect4info/abstract"/>
+ <xsl:apply-templates mode="sect4.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="sect4.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sect4.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="sect4.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sect4.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sect4.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sect4.titlepage.before.recto"/>
+ <xsl:call-template name="sect4.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sect4.titlepage.before.verso"/>
+ <xsl:call-template name="sect4.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sect4.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sect4.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sect4.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="sect4.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect4.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect4.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sect5.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sect5info/title">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sect5info/subtitle">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/corpauthor"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/authorgroup"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/author"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/othercredit"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/releaseinfo"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/copyright"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/legalnotice"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/pubdate"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revision"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/revhistory"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="sect5info/abstract"/>
+ <xsl:apply-templates mode="sect5.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="sect5.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sect5.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="sect5.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sect5.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sect5.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sect5.titlepage.before.recto"/>
+ <xsl:call-template name="sect5.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sect5.titlepage.before.verso"/>
+ <xsl:call-template name="sect5.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sect5.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sect5.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sect5.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="sect5.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sect5.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sect5.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="simplesectinfo/title">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="simplesectinfo/subtitle">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/corpauthor"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/corpauthor"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/corpauthor"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/authorgroup"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/authorgroup"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/authorgroup"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/author"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/author"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/author"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/othercredit"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/othercredit"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/othercredit"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/releaseinfo"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/releaseinfo"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/releaseinfo"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/copyright"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/copyright"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/copyright"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/legalnotice"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/legalnotice"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/legalnotice"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/pubdate"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/pubdate"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/pubdate"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revision"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revision"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revision"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/revhistory"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/revhistory"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/revhistory"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="simplesectinfo/abstract"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="docinfo/abstract"/>
+ <xsl:apply-templates mode="simplesect.titlepage.recto.auto.mode" select="info/abstract"/>
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage.separator"><xsl:if test="count(parent::*)='0'"><hr/></xsl:if>
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="simplesect.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="simplesect.titlepage.before.recto"/>
+ <xsl:call-template name="simplesect.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="simplesect.titlepage.before.verso"/>
+ <xsl:call-template name="simplesect.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="simplesect.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="simplesect.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="simplesect.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="authorgroup" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="author" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="othercredit" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="copyright" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="legalnotice" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revision" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="revhistory" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template match="abstract" mode="simplesect.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="simplesect.titlepage.recto.style">
+<xsl:apply-templates select="." mode="simplesect.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage.recto">
+ <div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::bibliography[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="bibliographyinfo/subtitle">
+ <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="bibliographyinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="bibliography.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="bibliography.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="bibliography.titlepage.before.recto"/>
+ <xsl:call-template name="bibliography.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="bibliography.titlepage.before.verso"/>
+ <xsl:call-template name="bibliography.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="bibliography.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="bibliography.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="bibliography.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="bibliography.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="bibliography.titlepage.recto.style">
+<xsl:apply-templates select="." mode="bibliography.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="glossary.titlepage.recto">
+ <div xsl:use-attribute-sets="glossary.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::glossary[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="glossaryinfo/subtitle">
+ <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="glossaryinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="glossary.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="glossary.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="glossary.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="glossary.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="glossary.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="glossary.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="glossary.titlepage.before.recto"/>
+ <xsl:call-template name="glossary.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="glossary.titlepage.before.verso"/>
+ <xsl:call-template name="glossary.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="glossary.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="glossary.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="glossary.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="glossary.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="glossary.titlepage.recto.style">
+<xsl:apply-templates select="." mode="glossary.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="index.titlepage.recto">
+ <div xsl:use-attribute-sets="index.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::index[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="indexinfo/subtitle">
+ <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="indexinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="index.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="index.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="index.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="index.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="index.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="index.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="index.titlepage.before.recto"/>
+ <xsl:call-template name="index.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="index.titlepage.before.verso"/>
+ <xsl:call-template name="index.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="index.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="index.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="index.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="index.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="index.titlepage.recto.style">
+<xsl:apply-templates select="." mode="index.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="setindex.titlepage.recto">
+ <div xsl:use-attribute-sets="setindex.titlepage.recto.style">
+<xsl:call-template name="component.title">
+<xsl:with-param name="node" select="ancestor-or-self::setindex[1]"/>
+</xsl:call-template></div>
+ <xsl:choose>
+ <xsl:when test="setindexinfo/subtitle">
+ <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="setindexinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="setindex.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="setindex.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="setindex.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="setindex.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="setindex.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="setindex.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="setindex.titlepage.before.recto"/>
+ <xsl:call-template name="setindex.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="setindex.titlepage.before.verso"/>
+ <xsl:call-template name="setindex.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="setindex.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="setindex.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="setindex.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="setindex.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="setindex.titlepage.recto.style">
+<xsl:apply-templates select="." mode="setindex.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage.recto">
+ <xsl:choose>
+ <xsl:when test="sidebarinfo/title">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/title"/>
+ </xsl:when>
+ <xsl:when test="docinfo/title">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/title"/>
+ </xsl:when>
+ <xsl:when test="info/title">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/title"/>
+ </xsl:when>
+ <xsl:when test="title">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="title"/>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:choose>
+ <xsl:when test="sidebarinfo/subtitle">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="sidebarinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="docinfo/subtitle">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="docinfo/subtitle"/>
+ </xsl:when>
+ <xsl:when test="info/subtitle">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="info/subtitle"/>
+ </xsl:when>
+ <xsl:when test="subtitle">
+ <xsl:apply-templates mode="sidebar.titlepage.recto.auto.mode" select="subtitle"/>
+ </xsl:when>
+ </xsl:choose>
+
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage.verso">
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage.separator">
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage.before.recto">
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage.before.verso">
+</xsl:template>
+
+<xsl:template name="sidebar.titlepage">
+ <div class="titlepage">
+ <xsl:variable name="recto.content">
+ <xsl:call-template name="sidebar.titlepage.before.recto"/>
+ <xsl:call-template name="sidebar.titlepage.recto"/>
+ </xsl:variable>
+ <xsl:variable name="recto.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($recto.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($recto.content) != '') or ($recto.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$recto.content"/></div>
+ </xsl:if>
+ <xsl:variable name="verso.content">
+ <xsl:call-template name="sidebar.titlepage.before.verso"/>
+ <xsl:call-template name="sidebar.titlepage.verso"/>
+ </xsl:variable>
+ <xsl:variable name="verso.elements.count">
+ <xsl:choose>
+ <xsl:when test="function-available('exsl:node-set')"><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:when test="contains(system-property('xsl:vendor'), 'Apache Software Foundation')">
+ <!--Xalan quirk--><xsl:value-of select="count(exsl:node-set($verso.content)/*)"/></xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="(normalize-space($verso.content) != '') or ($verso.elements.count &gt; 0)">
+ <div><xsl:copy-of select="$verso.content"/></div>
+ </xsl:if>
+ <xsl:call-template name="sidebar.titlepage.separator"/>
+ </div>
+</xsl:template>
+
+<xsl:template match="*" mode="sidebar.titlepage.recto.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="*" mode="sidebar.titlepage.verso.mode">
+ <!-- if an element isn't found in this mode, -->
+ <!-- try the generic titlepage.mode -->
+ <xsl:apply-templates select="." mode="titlepage.mode"/>
+</xsl:template>
+
+<xsl:template match="title" mode="sidebar.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sidebar.titlepage.recto.style">
+<xsl:call-template name="formal.object.heading">
+<xsl:with-param name="object" select="ancestor-or-self::sidebar[1]"/>
+</xsl:call-template>
+</div>
+</xsl:template>
+
+<xsl:template match="subtitle" mode="sidebar.titlepage.recto.auto.mode">
+<div xsl:use-attribute-sets="sidebar.titlepage.recto.style">
+<xsl:apply-templates select="." mode="sidebar.titlepage.recto.mode"/>
+</div>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.xml b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.xml
new file mode 100644
index 000000000..62c4964f5
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/brief-yoctoprojectqs.xml
@@ -0,0 +1,491 @@
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<article id='brief-yocto-project-qs-intro'>
+ <articleinfo>
+ <title>Yocto Project Quick Build</title>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ </legalnotice>
+
+
+ <abstract>
+ <imagedata fileref="figures/yocto-project-transp.png"
+ width="6in" depth="1in"
+ align="right" scale="25" />
+ </abstract>
+ </articleinfo>
+
+ <section id='brief-welcome'>
+ <title>Welcome!</title>
+
+ <para>
+ Welcome!
+ This short document steps you through the process for a typical
+ image build using the Yocto Project.
+ The document also introduces how to configure a build for specific
+ hardware.
+ You will use Yocto Project to build a reference embedded OS
+ called Poky.
+ <note>
+ The examples in this paper assume you are using a native Linux
+ system running a recent Ubuntu Linux distribution.
+ If the machine you want to use
+ Yocto Project on to build an image is not a native Linux
+ system, you can still perform these steps by using CROss
+ PlatformS (CROPS) and setting up a Poky container.
+ See the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information.
+ </note>
+ </para>
+
+ <para>
+ If you want more conceptual or background information on the
+ Yocto Project, see the
+ <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>.
+ </para>
+ </section>
+
+ <section id='brief-compatible-distro'>
+ <title>Compatible Linux Distribution</title>
+
+ <para>
+ Make sure your
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
+ meets the following requirements:
+ <itemizedlist>
+ <listitem><para>
+ 50 Gbytes of free disk space
+ </para></listitem>
+ <listitem><para>
+ Runs a supported Linux distribution (i.e. recent releases of
+ Fedora, openSUSE, CentOS, Debian, or Ubuntu). For a list of
+ Linux distributions that support the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ <listitem><para>
+ <itemizedlist>
+ <listitem><para>
+ Git 1.8.3.1 or greater
+ </para></listitem>
+ <listitem><para>
+ tar 1.27 or greater
+ </para></listitem>
+ <listitem><para>
+ Python 3.4.0 or greater.
+ </para></listitem>
+ </itemizedlist>
+ If your build host does not meet any of these three listed
+ version requirements, you can take steps to prepare the
+ system so that you can still use the Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
+ section in the Yocto Project Reference Manual for information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='brief-build-system-packages'>
+ <title>Build Host Packages</title>
+
+ <para>
+ You must install essential host packages on your
+ build host.
+ The following command installs the host packages based on an
+ Ubuntu distribution:
+ <note>
+ For host package requirements on all supported Linux
+ distributions, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
+ section in the Yocto Project Reference Manual.
+ </note>
+ <literallayout class='monospaced'>
+ $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL; libsdl1.2-dev xterm
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='brief-use-git-to-clone-poky'>
+ <title>Use Git to Clone Poky</title>
+
+ <para>
+ Once you complete the setup instructions for your machine,
+ you need to get a copy of the Poky repository on your build
+ host.
+ Use the following commands to clone the Poky
+ repository and then checkout the &DISTRO_REL_TAG; release:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ Cloning into 'poky'...
+ remote: Counting objects: 361782, done.
+ remote: Compressing objects: 100% (87100/87100), done.
+ remote: Total 361782 (delta 268619), reused 361439 (delta 268277)
+ Receiving objects: 100% (361782/361782), 131.94 MiB | 6.88 MiB/s, done.
+ Resolving deltas: 100% (268619/268619), done.
+ Checking connectivity... done.
+ $ git checkout tags/yocto-2.5 -b my-yocto-2.5
+ </literallayout>
+ The previous Git checkout command creates a local branch
+ named my-&DISTRO_REL_TAG;. The files available to you in that
+ branch exactly match the repository's files in the
+ "&DISTRO_NAME_NO_CAP;" development branch at the time of the
+ Yocto Project &DISTRO; release.
+ </para>
+
+ <para>
+ For more options and information about accessing Yocto
+ Project related repositories, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='brief-building-your-image'>
+ <title>Building Your Image</title>
+
+ <para>
+ Use the following steps to build your image.
+ The build process creates an entire Linux distribution, including
+ the toolchain, from source.
+ <note>
+ <itemizedlist>
+ <listitem><para>
+ If you are working behind a firewall and your build
+ host is not set up for proxies, you could encounter
+ problems with the build process when fetching source
+ code (e.g. fetcher failures or Git failures).
+ </para></listitem>
+ <listitem><para>
+ If you do not know your proxy settings, consult your
+ local network infrastructure resources and get that
+ information.
+ A good starting point could also be to check your
+ web browser settings.
+ Finally, you can find more information on the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
+ page of the Yocto Project Wiki.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Initialize the Build Environment:</emphasis>
+ Run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ environment setup script to define Yocto Project's
+ build environment on your build host.
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ Among other things, the script creates the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ which is <filename>build</filename> in this case
+ and is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ After the script runs, your current working directory
+ is set to the Build Directory.
+ Later, when the build completes, the Build Directory
+ contains all the files created during the build.
+ </para></listitem>
+ <listitem><para id='conf-file-step'>
+ <emphasis>Examine Your Local Configuration File:</emphasis>
+ When you set up the build environment, a local
+ configuration file named
+ <filename>local.conf</filename> becomes available in
+ a <filename>conf</filename> subdirectory of the
+ Build Directory.
+ For this example, the defaults are set to build
+ for a <filename>qemux86</filename> target, which is
+ suitable for emulation.
+ The package manager used is set to the RPM package
+ manager.
+ <tip>
+ You can significantly speed up your build and guard
+ against fetcher failures by using mirrors.
+ To use mirrors, add these lines to your
+ <filename>local.conf</filename> file in the Build
+ directory:
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS = "\
+ file://.* http://sstate.yoctoproject.org/dev/PATH;downloadfilename=PATH \n \
+ file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION_MINUS_ONE;/PATH;downloadfilename=PATH \n \
+ file://.* http://sstate.yoctoproject.org/&YOCTO_DOC_VERSION;/PATH;downloadfilename=PATH \n \
+ "
+ </literallayout>
+ The previous examples showed how to add sstate
+ paths for Yocto Project &YOCTO_DOC_VERSION_MINUS_ONE;,
+ &YOCTO_DOC_VERSION;, and a development area.
+ For a complete index of sstate locations, see
+ <ulink url='http://sstate.yoctoproject.org/'></ulink>.
+ </tip>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Start the Build:</emphasis>
+ Continue with the following command to build an OS image
+ for the target, which is
+ <filename>core-image-sato</filename> in this example:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ For information on using the
+ <filename>bitbake</filename> command, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#usingpoky-components-bitbake'>BitBake</ulink>"
+ section in the Yocto Project Overview and Concepts Manual,
+ or see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-command'>BitBake Command</ulink>"
+ section in the BitBake User Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Simulate Your Image Using QEMU:</emphasis>
+ Once this particular image is built, you can start
+ QEMU, which is a Quick EMUlator that ships with
+ the Yocto Project:
+ <literallayout class='monospaced'>
+ $ runqemu qemux86
+ </literallayout>
+ If you want to learn more about running QEMU, see the
+ "<ulink url="&YOCTO_DOCS_DEV_URL;#dev-manual-qemu">Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Exit QEMU:</emphasis>
+ Exit QEMU by either clicking on the shutdown icon or by
+ typing <filename>Ctrl-C</filename> in the QEMU
+ transcript window from which you evoked QEMU.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='customizing-your-build-for-specific-hardware'>
+ <title>Customizing Your Build for Specific Hardware</title>
+
+ <para>
+ So far, all you have done is quickly built an image suitable
+ for emulation only.
+ This section shows you how to customize your build for specific
+ hardware by adding a hardware layer into the Yocto Project
+ development environment.
+ </para>
+
+ <para>
+ In general, layers are repositories that contain related sets of
+ instructions and configurations that tell the Yocto Project what
+ to do.
+ Isolating related metadata into functionally specific layers
+ facilitates modular development and makes it easier to reuse the
+ layer metadata.
+ <note>
+ By convention, layer names start with the string "meta-".
+ </note>
+ </para>
+
+ <para>
+ Follow these steps to add a hardware layer:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Find a Layer:</emphasis>
+ Lots of hardware layers exist.
+ The Yocto Project
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>
+ has many hardware layers.
+ This example adds the
+ <ulink url='https://github.com/kraj/meta-altera'>meta-altera</ulink>
+ hardware layer.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the Layer</emphasis>
+ Use Git to make a local copy of the layer on your machine.
+ You can put the copy in the top level of the copy of the
+ Poky repository created earlier:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git clone https://github.com/kraj/meta-altera.git
+ Cloning into 'meta-altera'...
+ remote: Counting objects: 25170, done.
+ remote: Compressing objects: 100% (350/350), done.
+ remote: Total 25170 (delta 645), reused 719 (delta 538), pack-reused 24219
+ Receiving objects: 100% (25170/25170), 41.02 MiB | 1.64 MiB/s, done.
+ Resolving deltas: 100% (13385/13385), done.
+ Checking connectivity... done.
+ </literallayout>
+ The hardware layer now exists with other layers inside
+ the Poky reference repository on your build host as
+ <filename>meta-altera</filename> and contains all the
+ metadata needed to support hardware from Altera, which
+ is owned by Intel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Change the Configuration to Build for a Specific Machine:</emphasis>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable in the <filename>local.conf</filename> file
+ specifies the machine for the build.
+ For this example, set the <filename>MACHINE</filename>
+ variable to "cyclone5".
+ These configurations are used:
+ <ulink url='https://github.com/kraj/meta-altera/blob/master/conf/machine/cyclone5.conf'></ulink>.
+ <note>
+ See the
+ "<link linkend='conf-file-step'>Examine Your Local Configuration File</link>"
+ step earlier for more information on configuring the
+ build.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add Your Layer to the Layer Configuration File:</emphasis>
+ Before you can use a layer during a build, you must add it
+ to your <filename>bblayers.conf</filename> file, which
+ is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory's</ulink>
+ <filename>conf</filename> directory.</para>
+
+ <para>Use the <filename>bitbake-layers add-layer</filename>
+ command to add the layer to the configuration file:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake-layers add-layer ../meta-altera
+ NOTE: Starting bitbake server...
+ Parsing recipes: 100% |##################################################################| Time: 0:00:32
+ Parsing of 918 .bb files complete (0 cached, 918 parsed). 1401 targets, 123 skipped, 0 masked, 0 errors.
+ </literallayout>
+ You can find more information on adding layers in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#adding-a-layer-using-the-bitbake-layers-script'>Adding a Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section.
+ </para></listitem>
+ </orderedlist>
+ Completing these steps has added the
+ <filename>meta-altera</filename> layer to your Yocto Project
+ development environment and configured it to build for the
+ "cyclone5" machine.
+ <note>
+ The previous steps are for demonstration purposes only.
+ If you were to attempt to build an image for the
+ "cyclone5" build, you should read the Altera
+ <filename>README</filename>.
+ </note>
+ </para>
+ </section>
+
+ <section id='creating-your-own-general-layer'>
+ <title>Creating Your Own General Layer</title>
+
+ <para>
+ Maybe you have an application or specific set of behaviors you
+ need to isolate.
+ You can create your own general layer using the
+ <filename>bitbake-layers create-layer</filename> command.
+ The tool automates layer creation by setting up a
+ subdirectory with a <filename>layer.conf</filename>
+ configuration file, a <filename>recipes-example</filename>
+ subdirectory that contains an <filename>example.bb</filename>
+ recipe, a licensing file, and a <filename>README</filename>.
+ </para>
+
+ <para>
+ The following commands run the tool to create a layer named
+ <filename>meta-mylayer</filename> in the
+ <filename>poky</filename> directory:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ bitbake-layers create-layer meta-mylayer
+ NOTE: Starting bitbake server...
+ Add your new layer with 'bitbake-layers add-layer meta-mylayer'
+ </literallayout>
+ For more information on layers and how to create them, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='brief-where-to-go-next'>
+ <title>Where To Go Next</title>
+
+ <para>
+ Now that you have experienced using the Yocto Project, you might
+ be asking yourself "What now?"
+ The Yocto Project has many sources of information including
+ the website, wiki pages, and user manuals:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Website:</emphasis>
+ The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ provides background information, the latest builds,
+ breaking news, full development documentation, and
+ access to a rich Yocto Project Development Community
+ into which you can tap.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Developer Screencast:</emphasis>
+ The
+ <ulink url='http://vimeo.com/36450321'>Getting Started with the Yocto Project - New Developer Screencast Tutorial</ulink>
+ provides a 30-minute video created for users unfamiliar
+ with the Yocto Project but familiar with Linux build
+ hosts.
+ While this screencast is somewhat dated, the
+ introductory and fundamental concepts are useful for
+ the beginner.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Yocto Project Overview and Concepts Manual:</emphasis>
+ The
+ <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>
+ is a great place to start to learn about the
+ Yocto Project.
+ This manual introduces you to the Yocto Project and its
+ development environment.
+ The manual also provides conceptual information for
+ various aspects of the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Yocto Project Wiki:</emphasis>
+ The
+ <ulink url='&YOCTO_WIKI_URL;'>Yocto Project Wiki</ulink>
+ provides additional information on where to go next
+ when ramping up with the Yocto Project, release
+ information, project planning, and QA information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Yocto Project Mailing Lists:</emphasis>
+ Related mailing lists provide a forum for discussion,
+ patch submission and announcements.
+ Several mailing lists exist and are grouped according
+ to areas of concern.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
+ section in the Yocto Project Reference Manual for a
+ complete list of Yocto Project mailing lists.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Comprehensive List of Links and Other Documentation:</emphasis>
+ The
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
+ section in the Yocto Project Reference Manual provides a
+ comprehensive list of all related links and other
+ user documentation.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</article>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/brief-yoctoprojectqs/figures/bypqs-title.png b/poky/documentation/brief-yoctoprojectqs/figures/bypqs-title.png
new file mode 100644
index 000000000..9e0a5ce52
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/figures/bypqs-title.png
Binary files differ
diff --git a/poky/documentation/brief-yoctoprojectqs/figures/yocto-project-transp.png b/poky/documentation/brief-yoctoprojectqs/figures/yocto-project-transp.png
new file mode 100755
index 000000000..31d2b147f
--- /dev/null
+++ b/poky/documentation/brief-yoctoprojectqs/figures/yocto-project-transp.png
Binary files differ
diff --git a/poky/documentation/bsp-guide/bsp-guide-customization.xsl b/poky/documentation/bsp-guide/bsp-guide-customization.xsl
new file mode 100644
index 000000000..de674a0ae
--- /dev/null
+++ b/poky/documentation/bsp-guide/bsp-guide-customization.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'bsp-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl b/poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl
new file mode 100644
index 000000000..35346effc
--- /dev/null
+++ b/poky/documentation/bsp-guide/bsp-guide-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/bsp-guide/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/bsp-guide/bsp-guide.xml b/poky/documentation/bsp-guide/bsp-guide.xml
new file mode 100644
index 000000000..7ca4c5d7d
--- /dev/null
+++ b/poky/documentation/bsp-guide/bsp-guide.xml
@@ -0,0 +1,190 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='bsp-guide' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/bsp-title.png'
+ format='SVG'
+ align='center' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Board Support Package Developer's Guide
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>0.9</revnumber>
+ <date>24 November 2010</date>
+ <revremark>The initial document draft released with the Yocto Project 0.9 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.0</revnumber>
+ <date>6 April 2011</date>
+ <revremark>Released with the Yocto Project 1.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.0.1</revnumber>
+ <date>23 May 2011</date>
+ <revremark>Released with the Yocto Project 1.0.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.1</revnumber>
+ <date>6 October 2011</date>
+ <revremark>Released with the Yocto Project 1.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.2</revnumber>
+ <date>April 2012</date>
+ <revremark>Released with the Yocto Project 1.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.3</revnumber>
+ <date>October 2012</date>
+ <revremark>Released with the Yocto Project 1.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Board Support Package (BSP) Developer's Guide</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="bsp.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/bsp-guide/bsp-style.css b/poky/documentation/bsp-guide/bsp-style.css
new file mode 100644
index 000000000..0c8689b96
--- /dev/null
+++ b/poky/documentation/bsp-guide/bsp-style.css
@@ -0,0 +1,987 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/bsp-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+.writernotes {
+ color: red;
+}
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title {
+ background-position: bottom;
+ background-repeat: repeat-x;
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/bsp-guide/bsp.xml b/poky/documentation/bsp-guide/bsp.xml
new file mode 100644
index 000000000..00a28b032
--- /dev/null
+++ b/poky/documentation/bsp-guide/bsp.xml
@@ -0,0 +1,2269 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='bsp'>
+
+<title>Board Support Packages (BSP) - Developer's Guide</title>
+
+<para>
+ A Board Support Package (BSP) is a collection of information that
+ defines how to support a particular hardware device, set of devices, or
+ hardware platform.
+ The BSP includes information about the hardware features
+ present on the device and kernel configuration information along with any
+ additional hardware drivers required.
+ The BSP also lists any additional software
+ components required in addition to a generic Linux software stack for both
+ essential and optional platform features.
+</para>
+
+<para>
+ This guide presents information about BSP Layers, defines a structure for components
+ so that BSPs follow a commonly understood layout, discusses how to customize
+ a recipe for a BSP, addresses BSP licensing, and provides information that
+ shows you how to create a
+ <link linkend='bsp-layers'>BSP Layer</link> using the
+ <link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'><filename>bitbake-layers</filename></link>
+ tool.
+</para>
+
+<section id='bsp-layers'>
+ <title>BSP Layers</title>
+
+ <para>
+ A BSP consists of a file structure inside a base directory.
+ Collectively, you can think of the base directory, its file structure,
+ and the contents as a BSP Layer.
+ Although not a strict requirement, BSP layers in the Yocto Project
+ use the following well-established naming convention:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>
+ </literallayout>
+ The string "meta-" is prepended to the machine or platform name, which is
+ <replaceable>bsp_root_name</replaceable> in the above form.
+ <note><title>Tip</title>
+ Because the BSP layer naming convention is well-established,
+ it is advisable to follow it when creating layers.
+ Technically speaking, a BSP layer name does not need to
+ start with <filename>meta-</filename>.
+ However, various scripts and tools in the Yocto Project
+ development environment assume this convention.
+ </note>
+ </para>
+
+ <para>
+ To help understand the BSP layer concept, consider the BSPs that the
+ Yocto Project supports and provides with each release.
+ You can see the layers in the
+ <ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>
+ through a web interface at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ If you go to that interface, you will find a list of repositories
+ under "Yocto Metadata Layers".
+ <note>
+ Layers that are no longer actively supported as part of the
+ Yocto Project appear under the heading "Yocto Metadata Layer
+ Archive."
+ </note>
+ Each repository is a BSP layer supported by the Yocto Project
+ (e.g. <filename>meta-raspberrypi</filename> and
+ <filename>meta-intel</filename>).
+ Each of these layers is a repository unto itself and clicking on a
+ layer reveals information that includes two links from which you can choose
+ to set up a clone of the layer's repository on your local host system.
+ Here is an example that clones the Raspberry Pi BSP layer:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/meta-raspberrypi
+ </literallayout>
+ </para>
+
+ <para>
+ In addition to BSP layers, the
+ <filename>meta-yocto-bsp</filename> layer is part of the
+ shipped <filename>poky</filename> repository.
+ The <filename>meta-yocto-bsp</filename> layer maintains several
+ BSPs such as the Beaglebone, EdgeRouter, and generic versions of
+ both 32-bit and 64-bit IA machines.
+ </para>
+
+ <para>
+ For information on the BSP development workflow, see the
+ "<link linkend='developing-a-board-support-package-bsp'>Developing a Board Support Package (BSP)</link>"
+ section.
+ For more information on how to set up a local copy of source files
+ from a Git repository, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ The layer's base directory
+ (<filename>meta-<replaceable>bsp_root_name</replaceable></filename>)
+ is the root directory of the BSP Layer.
+ This directory is what you add to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the <filename>conf/bblayers.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ which is established after you run the OpenEmbedded build environment
+ setup script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>).
+ Adding the root directory allows the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ to recognize the BSP layer and from it build an image.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBLAYERS ?= " \
+ /usr/local/src/yocto/meta \
+ /usr/local/src/yocto/meta-poky \
+ /usr/local/src/yocto/meta-yocto-bsp \
+ /usr/local/src/yocto/meta-mylayer \
+ "
+ </literallayout>
+ <note><title>Tip</title>
+ Ordering and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>
+ for the layers listed in <filename>BBLAYERS</filename>
+ matter.
+ For example, if multiple layers define a machine
+ configuration, the OpenEmbedded build system uses
+ the last layer searched given similar layer
+ priorities.
+ The build system works from the top-down through
+ the layers listed in <filename>BBLAYERS</filename>.
+ </note>
+ </para>
+
+ <para>
+ Some BSPs require or depend on additional layers
+ beyond the BSP's root layer in order to be functional.
+ In this case, you need to specify these layers in the
+ <filename>README</filename> "Dependencies" section of the
+ BSP's root layer.
+ Additionally, if any build instructions exist for the
+ BSP, you must add them to the "Dependencies" section.
+ </para>
+
+ <para>
+ Some layers function as a layer to hold other BSP layers.
+ These layers are knows as
+ "<ulink url='&YOCTO_DOCS_REF_URL;#term-container-layer'>container layers</ulink>".
+ An example of this type of layer is the
+ <filename>meta-intel</filename> layer.
+ This layer contains BSP layers for the Intel-core2-32
+ <trademark class='registered'>Intel</trademark> Common Core
+ (Intel-core2-32) and the Intel-corei7-64
+ <trademark class='registered'>Intel</trademark> Common Core
+ (Intel-corei7-64).
+ the <filename>meta-intel</filename> layer also contains
+ the <filename>common/</filename> directory, which contains
+ common content across those layers.
+ </para>
+
+ <para>
+ For more information on layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='preparing-your-build-host-to-work-with-bsp-layers'>
+ <title>Preparing Your Build Host to Work With BSP Layers</title>
+
+ <para>
+ This section describes how to get your build host ready
+ to work with BSP layers.
+ Once you have the host set up, you can create the layer
+ as described in the
+ "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section.
+ <note>
+ For structural information on BSPs, see the
+ <link linkend='bsp-filelayout'>Example Filesystem Layout</link>
+ section.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set Up the Build Environment:</emphasis>
+ Be sure you are set up to use BitBake in a shell.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</ulink>"
+ section in the Yocto Project Development Tasks Manual for information
+ on how to get a build host ready that is either a native
+ Linux machine or a machine that uses CROPS.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the <filename>poky</filename> Repository:</emphasis>
+ You need to have a local copy of the Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (i.e. a local <filename>poky</filename> repository).
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</ulink>"
+ and possibly the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out by Branch in Poky</ulink>"
+ or
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checkout-out-by-tag-in-poky'>Checking Out by Tag in Poky</ulink>"
+ sections all in the Yocto Project Development Tasks Manual for
+ information on how to clone the <filename>poky</filename>
+ repository and check out the appropriate branch for your work.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Determine the BSP Layer You Want:</emphasis>
+ The Yocto Project supports many BSPs, which are maintained in
+ their own layers or in layers designed to contain several
+ BSPs.
+ To get an idea of machine support through BSP layers, you can
+ look at the
+ <ulink url='&YOCTO_RELEASE_DL_URL;/machines'>index of machines</ulink>
+ for the release.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Clone the
+ <filename>meta-intel</filename> BSP Layer:</emphasis>
+ If your hardware is based on current Intel CPUs and devices,
+ you can leverage this BSP layer.
+ For details on the <filename>meta-intel</filename> BSP layer,
+ see the layer's
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/tree/README'><filename>README</filename></ulink>
+ file.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Navigate to Your Source Directory:</emphasis>
+ Typically, you set up the
+ <filename>meta-intel</filename> Git repository
+ inside the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ <literallayout class='monospaced'>
+ $ cd /home/<replaceable>you</replaceable>/poky
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the Layer:</emphasis>
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/meta-intel.git
+ Cloning into 'meta-intel'...
+ remote: Counting objects: 15585, done.
+ remote: Compressing objects: 100% (5056/5056), done.
+ remote: Total 15585 (delta 9123), reused 15329 (delta 8867)
+ Receiving objects: 100% (15585/15585), 4.51 MiB | 3.19 MiB/s, done.
+ Resolving deltas: 100% (9123/9123), done.
+ Checking connectivity... done.
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Check Out the Proper Branch:</emphasis>
+ The branch you check out for
+ <filename>meta-intel</filename> must match the same
+ branch you are using for the Yocto Project release
+ (e.g. &DISTRO_NAME_NO_CAP;):
+ <literallayout class='monospaced'>
+ $ cd meta-intel
+ $ git checkout -b &DISTRO_NAME_NO_CAP; remotes/origin/&DISTRO_NAME_NO_CAP;
+ Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
+ Switched to a new branch '&DISTRO_NAME_NO_CAP;'
+ </literallayout>
+ <note>
+ To see the available branch names in a cloned repository,
+ use the <filename>git branch -al</filename> command.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual for more information.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Set Up an Alternative BSP Layer:</emphasis>
+ If your hardware can be more closely leveraged to an
+ existing BSP not within the <filename>meta-intel</filename>
+ BSP layer, you can clone that BSP layer.</para>
+
+ <para>The process is identical to the process used for the
+ <filename>meta-intel</filename> layer except for the layer's
+ name.
+ For example, if you determine that your hardware most
+ closely matches the <filename>meta-raspberrypi</filename>,
+ clone that layer:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/meta-raspberrypi
+ Cloning into 'meta-raspberrypi'...
+ remote: Counting objects: 4743, done.
+ remote: Compressing objects: 100% (2185/2185), done.
+ remote: Total 4743 (delta 2447), reused 4496 (delta 2258)
+ Receiving objects: 100% (4743/4743), 1.18 MiB | 0 bytes/s, done.
+ Resolving deltas: 100% (2447/2447), done.
+ Checking connectivity... done.
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Initialize the Build Environment:</emphasis>
+ While in the root directory of the Source Directory (i.e.
+ <filename>poky</filename>), run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ environment setup script to define the OpenEmbedded
+ build environment on your build host.
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ Among other things, the script creates the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ which is <filename>build</filename> in this case
+ and is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ After the script runs, your current working directory
+ is set to the <filename>build</filename> directory.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id="bsp-filelayout">
+ <title>Example Filesystem Layout</title>
+
+ <para>
+ Defining a common BSP directory structure allows
+ end-users to understand and become familiar with
+ that standard.
+ A common format also encourages standardization
+ of software support for hardware.
+ </para>
+
+ <para>
+ The proposed form described in this section does
+ have elements that are specific to the OpenEmbedded
+ build system.
+ It is intended that developers can use this structure
+ with other build systems besides the OpenEmbedded build
+ system.
+ It is also intended that it will be be simple to extract
+ information and convert it to other formats if required.
+ The OpenEmbedded build system, through its standard
+ <ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>layers mechanism</ulink>,
+ can directly accept the format described as a layer.
+ The BSP layer captures all the hardware-specific details
+ in one place using a standard format, which is useful
+ for any person wishing to use the hardware platform
+ regardless of the build system they are using.
+ </para>
+
+ <para>
+ The BSP specification does not include a build system
+ or other tools - the specification is concerned with
+ the hardware-specific components only.
+ At the end-distribution point, you can ship the BSP
+ layer combined with a build system and other tools.
+ Realize that it is important to maintain the distinction
+ that the BSP layer, a build system, and tools are
+ separate components that could to be combined in
+ certain end products.
+ </para>
+
+ <para>
+ Before looking at the common form for the file structure
+ inside a BSP Layer, you should be aware that some
+ requirements do exist in order for a BSP layer to
+ be considered compliant with the Yocto Project.
+ For that list of requirements, see the
+ "<link linkend='released-bsp-requirements'>Released BSP Requirements</link>"
+ section.
+ </para>
+
+ <para>
+ Below is the common form for the file structure
+ inside a BSP Layer.
+ While this basic form represents the standard,
+ realize that the actual file structures for specific
+ BSPs could differ.
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/
+ meta-<replaceable>bsp_root_name</replaceable>/<replaceable>bsp_license_file</replaceable>
+ meta-<replaceable>bsp_root_name</replaceable>/README
+ meta-<replaceable>bsp_root_name</replaceable>/README.sources
+ meta-<replaceable>bsp_root_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
+ meta-<replaceable>bsp_root_name</replaceable>/conf/layer.conf
+ meta-<replaceable>bsp_root_name</replaceable>/conf/machine/*.conf
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-bsp/*
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-core/*
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-graphics/*
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/linux-yocto_<replaceable>kernel_rev</replaceable>.bbappend
+ </literallayout>
+ </para>
+
+ <para>
+ Below is an example of the Raspberry Pi BSP
+ layer that is available from the
+ <ulink url='&YOCTO_GIT_URL;'>Source Respositories</ulink>:
+ <literallayout class='monospaced'>
+ meta-raspberrypi/COPYING.MIT
+ meta-raspberrypi/README.md
+ meta-raspberrypi/classes
+ meta-raspberrypi/classes/sdcard_image-rpi.bbclass
+ meta-raspberrypi/conf/
+ meta-raspberrypi/conf/layer.conf
+ meta-raspberrypi/conf/machine/
+ meta-raspberrypi/conf/machine/raspberrypi-cm.conf
+ meta-raspberrypi/conf/machine/raspberrypi-cm3.conf
+ meta-raspberrypi/conf/machine/raspberrypi.conf
+ meta-raspberrypi/conf/machine/raspberrypi0-wifi.conf
+ meta-raspberrypi/conf/machine/raspberrypi0.conf
+ meta-raspberrypi/conf/machine/raspberrypi2.conf
+ meta-raspberrypi/conf/machine/raspberrypi3-64.conf
+ meta-raspberrypi/conf/machine/raspberrypi3.conf
+ meta-raspberrypi/conf/machine/include
+ meta-raspberrypi/conf/machine/include/rpi-base.inc
+ meta-raspberrypi/conf/machine/include/rpi-default-providers.inc
+ meta-raspberrypi/conf/machine/include/rpi-default-settings.inc
+ meta-raspberrypi/conf/machine/include/rpi-default-versions.inc
+ meta-raspberrypi/conf/machine/include/tune-arm1176jzf-s.inc
+ meta-raspberrypi/docs
+ meta-raspberrypi/docs/Makefile
+ meta-raspberrypi/docs/conf.py
+ meta-raspberrypi/docs/contributing.md
+ meta-raspberrypi/docs/extra-apps.md
+ meta-raspberrypi/docs/extra-build-config.md
+ meta-raspberrypi/docs/index.rst
+ meta-raspberrypi/docs/layer-contents.md
+ meta-raspberrypi/docs/readme.md
+ meta-raspberrypi/files
+ meta-raspberrypi/files/custom-licenses
+ meta-raspberrypi/files/custom-licenses/Broadcom
+ meta-raspberrypi/recipes-bsp
+ meta-raspberrypi/recipes-bsp/bootfiles
+ meta-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bb
+ meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bb
+ meta-raspberrypi/recipes-bsp/common
+ meta-raspberrypi/recipes-bsp/common/firmware.inc
+ meta-raspberrypi/recipes-bsp/formfactor
+ meta-raspberrypi/recipes-bsp/formfactor/formfactor
+ meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi
+ meta-raspberrypi/recipes-bsp/formfactor/formfactor/raspberrypi/machconfig
+ meta-raspberrypi/recipes-bsp/formfactor/formfactor_0.0.bbappend
+ meta-raspberrypi/recipes-bsp/rpi-u-boot-src
+ meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files
+ meta-raspberrypi/recipes-bsp/rpi-u-boot-src/files/boot.cmd.in
+ meta-raspberrypi/recipes-bsp/rpi-u-boot-src/rpi-u-boot-scr.bb
+ meta-raspberrypi/recipes-bsp/u-boot
+ meta-raspberrypi/recipes-bsp/u-boot/u-boot
+ meta-raspberrypi/recipes-bsp/u-boot/u-boot/*.patch
+ meta-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend
+ meta-raspberrypi/recipes-connectivity
+ meta-raspberrypi/recipes-connectivity/bluez5
+ meta-raspberrypi/recipes-connectivity/bluez5/bluez5
+ meta-raspberrypi/recipes-connectivity/bluez5/bluez5/*.patch
+ meta-raspberrypi/recipes-connectivity/bluez5/bluez5/BCM43430A1.hcd
+ meta-raspberrypi/recipes-connectivity/bluez5/bluez5brcm43438.service
+ meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend
+ meta-raspberrypi/recipes-core
+ meta-raspberrypi/recipes-core/images
+ meta-raspberrypi/recipes-core/images/rpi-basic-image.bb
+ meta-raspberrypi/recipes-core/images/rpi-hwup-image.bb
+ meta-raspberrypi/recipes-core/images/rpi-test-image.bb
+ meta-raspberrypi/recipes-core/packagegroups
+ meta-raspberrypi/recipes-core/packagegroups/packagegroup-rpi-test.bb
+ meta-raspberrypi/recipes-core/psplash
+ meta-raspberrypi/recipes-core/psplash/files
+ meta-raspberrypi/recipes-core/psplash/files/psplash-raspberrypi-img.h
+ meta-raspberrypi/recipes-core/psplash/psplash_git.bbappend
+ meta-raspberrypi/recipes-core/udev
+ meta-raspberrypi/recipes-core/udev/udev-rules-rpi
+ meta-raspberrypi/recipes-core/udev/udev-rules-rpi/99-com.rules
+ meta-raspberrypi/recipes-core/udev/udev-rules-rpi.bb
+ meta-raspberrypi/recipes-devtools
+ meta-raspberrypi/recipes-devtools/bcm2835
+ meta-raspberrypi/recipes-devtools/bcm2835/bcm2835_1.52.bb
+ meta-raspberrypi/recipes-devtools/pi-blaster
+ meta-raspberrypi/recipes-devtools/pi-blaster/files
+ meta-raspberrypi/recipes-devtools/pi-blaster/files/*.patch
+ meta-raspberrypi/recipes-devtools/pi-blaster/pi-blaster_git.bb
+ meta-raspberrypi/recipes-devtools/python
+ meta-raspberrypi/recipes-devtools/python/python-rtimu
+ meta-raspberrypi/recipes-devtools/python/python-rtimu/*.patch
+ meta-raspberrypi/recipes-devtools/python/python-rtimu_git.bb
+ meta-raspberrypi/recipes-devtools/python/python-sense-hat_2.2.0.bb
+ meta-raspberrypi/recipes-devtools/python/rpi-gpio
+ meta-raspberrypi/recipes-devtools/python/rpi-gpio/*.patch
+ meta-raspberrypi/recipes-devtools/python/rpi-gpio_0.6.3.bb
+ meta-raspberrypi/recipes-devtools/python/rpio
+ meta-raspberrypi/recipes-devtools/python/rpio/*.patch
+ meta-raspberrypi/recipes-devtools/python/rpio_0.10.0.bb
+ meta-raspberrypi/recipes-devtools/wiringPi
+ meta-raspberrypi/recipes-devtools/wiringPi/files
+ meta-raspberrypi/recipes-devtools/wiringPi/files/*.patch
+ meta-raspberrypi/recipes-devtools/wiringPi/wiringpi_git.bb
+ meta-raspberrypi/recipes-graphics
+ meta-raspberrypi/recipes-graphics/eglinfo
+ meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-fb_%.bbappend
+ meta-raspberrypi/recipes-graphics/eglinfo/eglinfo-x11_%.bbappend
+ meta-raspberrypi/recipes-graphics/mesa
+ meta-raspberrypi/recipes-graphics/mesa/mesa-gl_%.bbappend
+ meta-raspberrypi/recipes-graphics/mesa/mesa_%.bbappend
+ meta-raspberrypi/recipes-graphics/userland
+ meta-raspberrypi/recipes-graphics/userland/userland
+ meta-raspberrypi/recipes-graphics/userland/userland/*.patch
+ meta-raspberrypi/recipes-graphics/userland/userland_git.bb
+ meta-raspberrypi/recipes-graphics/vc-graphics
+ meta-raspberrypi/recipes-graphics/vc-graphics/files
+ meta-raspberrypi/recipes-graphics/vc-graphics/files/egl.pc
+ meta-raspberrypi/recipes-graphics/vc-graphics/files/vchiq.sh
+ meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics-hardfp.bb
+ meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.bb
+ meta-raspberrypi/recipes-graphics/vc-graphics/vc-graphics.inc
+ meta-raspberrypi/recipes-graphics/wayland
+ meta-raspberrypi/recipes-graphics/wayland/weston_%.bbappend
+ meta-raspberrypi/recipes-graphics/xorg-xserver
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/10-evdev.conf
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/98-pitft.conf
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config/rpi/xorg.conf.d/99-calibration.conf
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
+ meta-raspberrypi/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend
+ meta-raspberrypi/recipes-kernel
+ meta-raspberrypi/recipes-kernel/linux-firmware
+ meta-raspberrypi/recipes-kernel/linux-firmware/files
+ meta-raspberrypi/recipes-kernel/linux-firmware/files/brcmfmac43430-sdio.bin
+ meta-raspberrypi/recipes-kernel/linux-firmware/files/brcfmac43430-sdio.txt
+ meta-raspberrypi/recipes-kernel/linux-firmware/linux-firmware_%.bbappend
+ meta-raspberrypi/recipes-kernel/linux
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi-dev.bb
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi.inc
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.14.bb
+ meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_4.9.bb
+ meta-raspberrypi/recipes-multimedia
+ meta-raspberrypi/recipes-multimedia/gstreamer
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/*.patch
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12
+ meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/*.patch
+ meta-raspberrypi/recipes-multimedia/omxplayer
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer/*.patch
+ meta-raspberrypi/recipes-multimedia/omxplayer/omxplayer_git.bb
+ meta-raspberrypi/recipes-multimedia/x264
+ meta-raspberrypi/recipes-multimedia/x264/x264_git.bbappend
+ meta-raspberrypi/wic
+ meta-raspberrypi/wic/sdimage-raspberrypi.wks
+ </literallayout>
+ </para>
+
+ <para>
+ The following sections describe each part of the proposed
+ BSP format.
+ </para>
+
+ <section id="bsp-filelayout-license">
+ <title>License Files</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/<replaceable>bsp_license_file</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ These optional files satisfy licensing requirements
+ for the BSP.
+ The type or types of files here can vary depending
+ on the licensing requirements.
+ For example, in the Raspberry Pi BSP all licensing
+ requirements are handled with the
+ <filename>COPYING.MIT</filename> file.
+ </para>
+
+ <para>
+ Licensing files can be MIT, BSD, GPLv*, and so forth.
+ These files are recommended for the BSP but are
+ optional and totally up to the BSP developer.
+ For information on how to maintain license
+ compliance, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </para>
+ </section>
+
+ <section id="bsp-filelayout-readme">
+ <title>README File</title>
+
+ <para>
+ You can find this file in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/README
+ </literallayout>
+ </para>
+
+ <para>
+ This file provides information on how to boot the live
+ images that are optionally included in the
+ <filename>binary/</filename> directory.
+ The <filename>README</filename> file also provides
+ information needed for building the image.
+ </para>
+
+ <para>
+ At a minimum, the <filename>README</filename> file must
+ contain a list of dependencies, such as the names of
+ any other layers on which the BSP depends and the name of
+ the BSP maintainer with his or her contact information.
+ </para>
+ </section>
+
+ <section id="bsp-filelayout-readme-sources">
+ <title>README.sources File</title>
+
+ <para>
+ You can find this file in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/README.sources
+ </literallayout>
+ </para>
+
+ <para>
+ This file provides information on where to locate the BSP
+ source files used to build the images (if any) that
+ reside in
+ <filename>meta-<replaceable>bsp_root_name</replaceable>/binary</filename>.
+ Images in the <filename>binary</filename> would be images
+ released with the BSP.
+ The information in the <filename>README.sources</filename>
+ file also helps you find the
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ used to generate the images that ship with the BSP.
+ <note>
+ If the BSP's <filename>binary</filename> directory is
+ missing or the directory has no images, an existing
+ <filename>README.sources</filename> file is
+ meaningless and usually does not exist.
+ </note>
+ </para>
+ </section>
+
+ <section id="bsp-filelayout-binary">
+ <title>Pre-built User Binaries</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/binary/<replaceable>bootable_images</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ This optional area contains useful pre-built kernels
+ and user-space filesystem images released with the
+ BSP that are appropriate to the target system.
+ This directory typically contains graphical (e.g. Sato)
+ and minimal live images when the BSP tarball has been
+ created and made available in the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
+ website.
+ You can use these kernels and images to get a system
+ running and quickly get started on development tasks.
+ </para>
+
+ <para>
+ The exact types of binaries present are highly
+ hardware-dependent.
+ The
+ <link linkend='bsp-filelayout-readme'><filename>README</filename></link>
+ file should be present in the BSP Layer and it
+ explains how to use the images with the target hardware.
+ Additionally, the
+ <link linkend='bsp-filelayout-readme-sources'><filename>README.sources</filename></link>
+ file should be present to locate the sources used to
+ build the images and provide information on the
+ Metadata.
+ </para>
+ </section>
+
+ <section id='bsp-filelayout-layer'>
+ <title>Layer Configuration File</title>
+
+ <para>
+ You can find this file in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/conf/layer.conf
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>conf/layer.conf</filename> file
+ identifies the file structure as a layer,
+ identifies the contents of the layer, and
+ contains information about how the build system should
+ use it.
+ Generally, a standard boilerplate file such as the
+ following works.
+ In the following example, you would replace
+ <replaceable>bsp</replaceable> with the actual
+ name of the BSP (i.e.
+ <replaceable>bsp_root_name</replaceable> from the example
+ template).
+ </para>
+
+ <para>
+ <literallayout class='monospaced'>
+ # We have a conf and classes directory, add to BBPATH
+ BBPATH .= ":${LAYERDIR}"
+
+ # We have a recipes directory, add to BBFILES
+ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+ BBFILE_COLLECTIONS += "<replaceable>bsp</replaceable>"
+ BBFILE_PATTERN_<replaceable>bsp</replaceable> = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_<replaceable>bsp</replaceable> = "6"
+
+ LAYERDEPENDS_<replaceable>bsp</replaceable> = "intel"
+ </literallayout>
+ </para>
+
+ <para>
+ To illustrate the string substitutions, here are
+ the corresponding statements from the Raspberry
+ Pi <filename>conf/layer.conf</filename> file:
+ <literallayout class='monospaced'>
+ # We have a conf and classes directory, append to BBPATH
+ BBPATH .= ":${LAYERDIR}"
+
+ # We have a recipes directory containing .bb and .bbappend files, add to BBFILES
+ BBFILES += "${LAYERDIR}/recipes*/*/*.bb \
+ ${LAYERDIR}/recipes*/*/*.bbappend"
+
+ BBFILE_COLLECTIONS += "raspberrypi"
+ BBFILE_PATTERN_raspberrypi := "^${LAYERDIR}/"
+ BBFILE_PRIORITY_raspberrypi = "9"
+
+ # Additional license directories.
+ LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
+ .
+ .
+ .
+ </literallayout>
+ </para>
+
+ <para>
+ This file simply makes
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ aware of the recipes and configuration directories.
+ The file must exist so that the OpenEmbedded build system
+ can recognize the BSP.
+ </para>
+ </section>
+
+ <section id="bsp-filelayout-machine">
+ <title>Hardware Configuration Options</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/conf/machine/*.conf
+ </literallayout>
+ </para>
+
+ <para>
+ The machine files bind together all the information
+ contained elsewhere in the BSP into a format that
+ the build system can understand.
+ Each BSP Layer requires at least one machine file.
+ If the BSP supports multiple machines, multiple
+ machine configuration files can exist.
+ These filenames correspond to the values to which
+ users have set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink> variable.
+ </para>
+
+ <para>
+ These files define things such as the kernel package
+ to use
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
+ of
+ <ulink url='&YOCTO_DOCS_DEV_URL;#metadata-virtual-providers'>virtual/kernel</ulink>),
+ the hardware drivers to include in different types
+ of images, any special software components that are
+ needed, any bootloader information, and also any
+ special image format requirements.
+ </para>
+
+ <para>
+ This configuration file could also include a hardware
+ "tuning" file that is commonly used to define the
+ package architecture and specify optimization flags,
+ which are carefully chosen to give best performance
+ on a given processor.
+ </para>
+
+ <para>
+ Tuning files are found in the
+ <filename>meta/conf/machine/include</filename>
+ directory within the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ For example, many <filename>tune-*</filename> files
+ (e.g. <filename>tune-arm1136jf-s.inc</filename>,
+ <filename>tun-1586-nlp.inc</filename>, and so forth)
+ reside in the
+ <filename>poky/meta/conf/machine/include</filename>
+ directory.
+ </para>
+
+ <para>
+ To use an include file, you simply include them in the
+ machine configuration file.
+ For example, the Raspberry Pi BSP
+ <filename>raspberrypi3.conf</filename> contains the
+ following statement:
+ <literallayout class='monospaced'>
+ include conf/machine/include/rpi-base.inc
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='bsp-filelayout-misc-recipes'>
+ <title>Miscellaneous BSP-Specific Recipe Files</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-bsp/*
+ </literallayout>
+ </para>
+
+ <para>
+ This optional directory contains miscellaneous recipe
+ files for the BSP.
+ Most notably would be the formfactor files.
+ For example, in the Raspberry Pi BSP there is the
+ <filename>formfactor_0.0.bbappend</filename> file,
+ which is an append file used to augment the recipe
+ that starts the build.
+ Furthermore, there are machine-specific settings used
+ during the build that are defined by the
+ <filename>machconfig</filename> file further down in
+ the directory.
+ Here is the <filename>machconfig</filename> file for
+ the Raspberry Pi BSP:
+ <literallayout class='monospaced'>
+ HAVE_TOUCHSCREEN=0
+ HAVE_KEYBOARD=1
+
+ DISPLAY_CAN_ROTATE=0
+ DISPLAY_ORIENTATION=0
+ DISPLAY_DPI=133
+ </literallayout>
+ </para>
+
+ <note><para>
+ If a BSP does not have a formfactor entry, defaults
+ are established according to the formfactor
+ configuration file that is installed by the main
+ formfactor recipe
+ <filename>meta/recipes-bsp/formfactor/formfactor_0.0.bb</filename>,
+ which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ </para></note>
+ </section>
+
+ <section id='bsp-filelayout-recipes-graphics'>
+ <title>Display Support Files</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-graphics/*
+ </literallayout>
+ </para>
+
+ <para>
+ This optional directory contains recipes for the
+ BSP if it has special requirements for graphics
+ support.
+ All files that are needed for the BSP to support
+ a display are kept here.
+ </para>
+ </section>
+
+ <section id='bsp-filelayout-kernel'>
+ <title>Linux Kernel Configuration</title>
+
+ <para>
+ You can find these files in the BSP Layer at:
+ <literallayout class='monospaced'>
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/linux*.bbappend
+ meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux/*.bb
+ </literallayout>
+ </para>
+
+ <para>
+ Append files (<filename>*.bbappend</filename>) modify
+ the main kernel recipe being used to build the image.
+ The <filename>*.bb</filename> files would be a
+ developer-supplied kernel recipe.
+ This area of the BSP hierarchy can contain both these
+ types of files, although in practice, it is likely that
+ you would have one or the other.
+ </para>
+
+ <para>
+ For your BSP, you typically want to use an existing Yocto
+ Project kernel recipe found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ at <filename>meta/recipes-kernel/linux</filename>.
+ You can append machine-specific changes to the
+ kernel recipe by using a similarly named append
+ file, which is located in the BSP Layer for your
+ target device (e.g. the
+ <filename>meta-<replaceable>bsp_root_name</replaceable>/recipes-kernel/linux</filename> directory).
+ </para>
+
+ <para>
+ Suppose you are using the
+ <filename>linux-yocto_4.4.bb</filename> recipe to
+ build the kernel.
+ In other words, you have selected the kernel in your
+ <replaceable>bsp_root_name</replaceable><filename>.conf</filename>
+ file by adding
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
+ statements as follows:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+ PREFERRED_VERSION_linux-yocto ?= "4.4%"
+ </literallayout>
+ <note>
+ When the preferred provider is assumed by
+ default, the
+ <filename>PREFERRED_PROVIDER</filename>
+ statement does not appear in the
+ <replaceable>bsp_root_name</replaceable><filename>.conf</filename> file.
+ </note>
+ You would use the
+ <filename>linux-yocto_4.4.bbappend</filename>
+ file to append specific BSP settings to the kernel,
+ thus configuring the kernel for your particular BSP.
+ </para>
+
+ <para>
+ You can find more information on what your append file
+ should contain in the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-the-append-file'>Creating the Append File</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para>
+
+ <para>
+ An alternate scenario is when you create your own
+ kernel recipe for the BSP.
+ A good example of this is the Raspberry Pi BSP.
+ If you examine the
+ <filename>recipes-kernel/linux</filename> directory
+ you see the following:
+ <literallayout class='monospaced'>
+ linux-raspberrypi-dev.bb
+ linux-raspberrypi.inc
+ linux-raspberrypi_4.14.bb
+ linux-raspberrypi_4.9.bb
+ </literallayout>
+ The directory contains three kernel recipes and a
+ common include file.
+ </para>
+ </section>
+</section>
+
+<section id='developing-a-board-support-package-bsp'>
+ <title>Developing a Board Support Package (BSP)</title>
+
+ <para>
+ This section contains the high-level procedure you can
+ follow to create a BSP.
+ Although not required for BSP creation, the
+ <filename>meta-intel</filename> repository, which
+ contains many BSPs supported by the Yocto Project,
+ is part of the example.
+ </para>
+
+ <para>
+ For an example that shows how to create a new
+ layer using the tools, see the
+ "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section.
+ </para>
+
+ <para>
+ The following illustration and list summarize the BSP
+ creation general workflow.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/bsp-dev-flow.png" width="7in" depth="5in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set up Your Host Development System
+ to Support Development Using the Yocto
+ Project</emphasis>:
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual for options on how to get a system ready
+ to use the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Establish the
+ <filename>meta-intel</filename>
+ Repository on Your System:</emphasis>
+ Having local copies of these supported BSP layers
+ on your system gives you access to layers you
+ might be able to leverage when creating your BSP.
+ For information on how to get these files, see the
+ "<link linkend='preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work with BSP Layers</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create Your Own BSP Layer Using the
+ <filename>bitbake-layers</filename>
+ Script:</emphasis>
+ Layers are ideal for isolating and storing work
+ for a given piece of hardware.
+ A layer is really just a location or area in which you
+ place the recipes and configurations for your BSP.
+ In fact, a BSP is, in itself, a special type of layer.
+ The simplest way to create a new BSP layer that is
+ compliant with the Yocto Project is to use the
+ <filename>bitbake-layers</filename> script.
+ For information about that script, see the
+ "<link linkend='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section.</para>
+
+ <para>Another example that illustrates a layer
+ is an application.
+ Suppose you are creating an application that has
+ library or other dependencies in order for it to
+ compile and run.
+ The layer, in this case, would be where all the
+ recipes that define those dependencies are kept.
+ The key point for a layer is that it is an
+ isolated area that contains all the relevant
+ information for the project that the
+ OpenEmbedded build system knows about.
+ For more information on layers, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
+ section in the Yocto Project Overview and Concepts
+ Manual.
+ You can also reference the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ For more information on BSP layers, see the
+ "<link linkend='bsp-layers'>BSP Layers</link>"
+ section.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Five hardware reference BSPs exist
+ that are part of the Yocto Project release
+ and are located in the
+ <filename>poky/meta-yocto-bsp</filename> BSP
+ layer:
+ <itemizedlist>
+ <listitem><para>
+ Texas Instruments Beaglebone
+ (<filename>beaglebone-yocto</filename>)
+ </para></listitem>
+ <listitem><para>
+ Freescale MPC8315E-RDB
+ (<filename>mpc8315e-rdb</filename>)
+ </para></listitem>
+ <listitem><para>
+ Ubiquiti Networks EdgeRouter Lite
+ (<filename>edgerouter</filename>)
+ </para></listitem>
+ <listitem><para>
+ Two general IA platforms
+ (<filename>genericx86</filename> and
+ <filename>genericx86-64</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ Three core Intel BSPs exist as part of
+ the Yocto Project release in the
+ <filename>meta-intel</filename> layer:
+ <itemizedlist>
+ <listitem><para>
+ <filename>intel-core2-32</filename>,
+ which is a BSP optimized for the Core2
+ family of CPUs as well as all CPUs
+ prior to the Silvermont core.
+ </para></listitem>
+ <listitem><para>
+ <filename>intel-corei7-64</filename>,
+ which is a BSP optimized for Nehalem
+ and later Core and Xeon CPUs as well
+ as Silvermont and later Atom CPUs,
+ such as the Baytrail SoCs.
+ </para></listitem>
+ <listitem><para>
+ <filename>intel-quark</filename>,
+ which is a BSP optimized for the
+ Intel Galileo gen1 &amp; gen2
+ development boards.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </note></para>
+
+ <para>When you set up a layer for a new BSP,
+ you should follow a standard layout.
+ This layout is described in the
+ "<link linkend='bsp-filelayout'>Example Filesystem Layout</link>"
+ section.
+ In the standard layout, notice the suggested
+ structure for recipes and configuration
+ information.
+ You can see the standard layout for a BSP
+ by examining any supported BSP found in the
+ <filename>meta-intel</filename> layer inside
+ the Source Directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Configuration Changes to Your New
+ BSP Layer:</emphasis>
+ The standard BSP layer structure organizes the
+ files you need to edit in
+ <filename>conf</filename> and several
+ <filename>recipes-*</filename> directories
+ within the BSP layer.
+ Configuration changes identify where your new
+ layer is on the local system and identifies the
+ kernel you are going to use.
+ When you run the
+ <filename>bitbake-layers</filename> script,
+ you are able to interactively configure many
+ things for the BSP (e.g. keyboard, touchscreen,
+ and so forth).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Recipe Changes to Your New BSP
+ Layer:</emphasis>
+ Recipe changes include altering recipes
+ (<filename>*.bb</filename> files), removing
+ recipes you do not use, and adding new recipes
+ or append files (<filename>.bbappend</filename>)
+ that support your hardware.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Prepare for the Build:</emphasis>
+ Once you have made all the changes to your BSP
+ layer, there remains a few things you need to
+ do for the OpenEmbedded build system in order
+ for it to create your image.
+ You need to get the build environment ready by
+ sourcing an environment setup script
+ (i.e. <filename>oe-init-build-env</filename>)
+ and you need to be sure two key configuration
+ files are configured appropriately: the
+ <filename>conf/local.conf</filename> and the
+ <filename>conf/bblayers.conf</filename> file.
+ You must make the OpenEmbedded build system aware
+ of your new layer.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-your-layer'>Enabling Your Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for information on how to let the build system
+ know about your new layer.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Image:</emphasis>
+ The OpenEmbedded build system uses the BitBake tool
+ to build images based on the type of image you want to
+ create.
+ You can find more information about BitBake in the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para>
+
+ <para>The build process supports several types of
+ images to satisfy different needs.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual for
+ information on supported images.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='requirements-and-recommendations-for-released-bsps'>
+ <title>Requirements and Recommendations for Released BSPs</title>
+
+ <para>
+ Certain requirements exist for a released BSP to be
+ considered compliant with the Yocto Project.
+ Additionally, recommendations also exist.
+ This section describes the requirements and
+ recommendations for released BSPs.
+ </para>
+
+ <section id='released-bsp-requirements'>
+ <title>Released BSP Requirements</title>
+
+ <para>
+ Before looking at BSP requirements, you should consider
+ the following:
+ <itemizedlist>
+ <listitem><para>
+ The requirements here assume the BSP layer
+ is a well-formed, "legal" layer that can be
+ added to the Yocto Project.
+ For guidelines on creating a layer that meets
+ these base requirements, see the
+ "<link linkend='bsp-layers'>BSP Layers</link>"
+ section in this manual and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers"</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </para></listitem>
+ <listitem><para>
+ The requirements in this section apply
+ regardless of how you package a BSP.
+ You should consult the packaging and distribution
+ guidelines for your specific release process.
+ For an example of packaging and distribution
+ requirements, see the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/Third_Party_BSP_Release_Process'>Third Party BSP Release Process</ulink>"
+ wiki page.
+ </para></listitem>
+ <listitem><para>
+ The requirements for the BSP as it is made
+ available to a developer are completely
+ independent of the released form of the BSP.
+ For example, the BSP Metadata can be contained
+ within a Git repository and could have a directory
+ structure completely different from what appears
+ in the officially released BSP layer.
+ </para></listitem>
+ <listitem><para>
+ It is not required that specific packages or
+ package modifications exist in the BSP layer,
+ beyond the requirements for general
+ compliance with the Yocto Project.
+ For example, no requirement exists dictating
+ that a specific kernel or kernel version be
+ used in a given BSP.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Following are the requirements for a released BSP
+ that conform to the Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Layer Name:</emphasis>
+ The BSP must have a layer name that follows
+ the Yocto Project standards.
+ For information on BSP layer names, see the
+ "<link linkend='bsp-layers'>BSP Layers</link>" section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>File System Layout:</emphasis>
+ When possible, use the same directory names
+ in your BSP layer as listed in the
+ <filename>recipes.txt</filename> file, which
+ is found in <filename>poky/meta</filename>
+ directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ or in the OpenEmbedded-Core Layer
+ (<filename>openembedded-core</filename>) at
+ <ulink url='http://git.openembedded.org/openembedded-core/tree/meta'></ulink>.
+ </para>
+
+ <para>You should place recipes
+ (<filename>*.bb</filename> files) and recipe
+ modifications (<filename>*.bbappend</filename>
+ files) into <filename>recipes-*</filename>
+ subdirectories by functional area as outlined
+ in <filename>recipes.txt</filename>.
+ If you cannot find a category in
+ <filename>recipes.txt</filename> to fit a
+ particular recipe, you can make up your own
+ <filename>recipes-*</filename> subdirectory.
+ </para>
+
+ <para>Within any particular
+ <filename>recipes-*</filename> category, the
+ layout should match what is found in the
+ OpenEmbedded-Core Git repository
+ (<filename>openembedded-core</filename>)
+ or the Source Directory (<filename>poky</filename>).
+ In other words, make sure you place related
+ files in appropriately related
+ <filename>recipes-*</filename> subdirectories
+ specific to the recipe's function, or within
+ a subdirectory containing a set of closely-related
+ recipes.
+ The recipes themselves should follow the general
+ guidelines for recipes used in the Yocto Project
+ found in the
+ "<ulink url='http://openembedded.org/wiki/Styleguide'>OpenEmbedded Style Guide</ulink>".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>License File:</emphasis>
+ You must include a license file in the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ This license covers the BSP Metadata as a whole.
+ You must specify which license to use since no
+ default license exists when one not specified.
+ See the
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-raspberrypi/tree/COPYING.MIT'><filename>COPYING.MIT</filename></ulink>
+ file for the Raspberry Pi BSP in the
+ <filename>meta-raspberrypi</filename> BSP layer
+ as an example.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>README File:</emphasis>
+ You must include a <filename>README</filename>
+ file in the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ See the
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/meta-raspberrypi/tree/README.md'><filename>README.md</filename></ulink>
+ file for the Raspberry Pi BSP in the
+ <filename>meta-raspberrypi</filename> BSP layer
+ as an example.</para>
+
+ <para>At a minimum, the <filename>README</filename>
+ file should contain the following:
+ <itemizedlist>
+ <listitem><para>
+ A brief description about the hardware the BSP
+ targets.
+ </para></listitem>
+ <listitem><para>
+ A list of all the dependencies
+ on which a BSP layer depends.
+ These dependencies are typically a list
+ of required layers needed to build the
+ BSP.
+ However, the dependencies should also
+ contain information regarding any other
+ dependencies the BSP might have.
+ </para></listitem>
+ <listitem><para>
+ Any required special licensing information.
+ For example, this information includes
+ information on special variables needed
+ to satisfy a EULA, or instructions on
+ information needed to build or distribute
+ binaries built from the BSP Metadata.
+ </para></listitem>
+ <listitem><para>
+ The name and contact information for the
+ BSP layer maintainer.
+ This is the person to whom patches and
+ questions should be sent.
+ For information on how to find the right
+ person, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
+ section in the Yocto Project Development
+ Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ Instructions on how to build the BSP using
+ the BSP layer.
+ </para></listitem>
+ <listitem><para>
+ Instructions on how to boot the BSP build
+ from the BSP layer.
+ </para></listitem>
+ <listitem><para>
+ Instructions on how to boot the binary
+ images contained in the
+ <filename>binary</filename> directory,
+ if present.
+ </para></listitem>
+ <listitem><para>
+ Information on any known bugs or issues
+ that users should know about when either
+ building or booting the BSP binaries.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>README.sources File:</emphasis>
+ If you BSP contains binary images in the
+ <filename>binary</filename> directory, you must
+ include a <filename>README.sources</filename>
+ file in the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ This file specifies exactly where you can find
+ the sources used to generate the binary images.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Layer Configuration File:</emphasis>
+ You must include a
+ <filename>conf/layer.conf</filename> file in
+ the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ This file identifies the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ BSP layer as a layer to the build system.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Machine Configuration File:</emphasis>
+ You must include one or more
+ <filename>conf/machine/</filename><replaceable>bsp_root_name</replaceable><filename>.conf</filename>
+ files in the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ These configuration files define machine targets
+ that can be built using the BSP layer.
+ Multiple machine configuration files define
+ variations of machine configurations that the
+ BSP supports.
+ If a BSP supports multiple machine variations,
+ you need to adequately describe each variation
+ in the BSP <filename>README</filename> file.
+ Do not use multiple machine configuration files
+ to describe disparate hardware.
+ If you do have very different targets, you should
+ create separate BSP layers for each target.
+ <note>
+ It is completely possible for a developer to
+ structure the working repository as a
+ conglomeration of unrelated BSP files, and to
+ possibly generate BSPs targeted for release
+ from that directory using scripts or some
+ other mechanism
+ (e.g. <filename>meta-yocto-bsp</filename> layer).
+ Such considerations are outside the scope of
+ this document.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='released-bsp-recommendations'>
+ <title>Released BSP Recommendations</title>
+
+ <para>
+ Following are recommendations for released BSPs that
+ conform to the Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Bootable Images:</emphasis>
+ Released BSPs can contain one or more bootable
+ images.
+ Including bootable images allows users to easily
+ try out the BSP using their own hardware.</para>
+
+ <para>In some cases, it might not be convenient
+ to include a bootable image.
+ If so, you might want to make two versions of the
+ BSP available: one that contains binary images, and
+ one that does not.
+ The version that does not contain bootable images
+ avoids unnecessary download times for users not
+ interested in the images.</para>
+
+ <para>If you need to distribute a BSP and include
+ bootable images or build kernel and filesystems
+ meant to allow users to boot the BSP for evaluation
+ purposes, you should put the images and artifacts
+ within a
+ <filename>binary/</filename> subdirectory located
+ in the
+ <filename>meta-</filename><replaceable>bsp_root_name</replaceable>
+ directory.
+ <note>
+ If you do include a bootable image as part
+ of the BSP and the image was built by software
+ covered by the GPL or other open source licenses,
+ it is your responsibility to understand
+ and meet all licensing requirements, which could
+ include distribution of source files.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use a Yocto Linux Kernel:</emphasis>
+ Kernel recipes in the BSP should be based on a
+ Yocto Linux kernel.
+ Basing your recipes on these kernels reduces
+ the costs for maintaining the BSP and increases
+ its scalability.
+ See the <filename>Yocto Linux Kernel</filename>
+ category in the
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>
+ for these kernels.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='customizing-a-recipe-for-a-bsp'>
+ <title>Customizing a Recipe for a BSP</title>
+
+ <para>
+ If you plan on customizing a recipe for a particular BSP,
+ you need to do the following:
+ <itemizedlist>
+ <listitem><para>
+ Create a <filename>*.bbappend</filename> file for
+ the modified recipe.
+ For information on using append files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </para></listitem>
+ <listitem><para>
+ Ensure your directory structure in the BSP layer
+ that supports your machine is such that the
+ OpenEmbedded build system can find it.
+ See the example later in this section for more
+ information.
+ </para></listitem>
+ <listitem><para>
+ Put the append file in a directory whose name matches
+ the machine's name and is located in an appropriate
+ sub-directory inside the BSP layer (i.e.
+ <filename>recipes-bsp</filename>,
+ <filename>recipes-graphics</filename>,
+ <filename>recipes-core</filename>, and so forth).
+ </para></listitem>
+ <listitem><para>
+ Place the BSP-specific files in the proper
+ directory inside the BSP layer.
+ How expansive the layer is affects where you must
+ place these files.
+ For example, if your layer supports several
+ different machine types, you need to be sure your
+ layer's directory structure includes hierarchy
+ that separates the files according to machine.
+ If your layer does not support multiple machines,
+ the layer would not have that additional hierarchy
+ and the files would obviously not be able to reside
+ in a machine-specific directory.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Following is a specific example to help you better understand
+ the process.
+ This example customizes customizes a recipe by adding a
+ BSP-specific configuration file named
+ <filename>interfaces</filename> to the
+ <filename>init-ifupdown_1.0.bb</filename> recipe for machine
+ "xyz" where the BSP layer also supports several other
+ machines:
+ <orderedlist>
+ <listitem><para>
+ Edit the
+ <filename>init-ifupdown_1.0.bbappend</filename> file
+ so that it contains the following:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+ </literallayout>
+ The append file needs to be in the
+ <filename>meta-xyz/recipes-core/init-ifupdown</filename>
+ directory.
+ </para></listitem>
+ <listitem><para>
+ Create and place the new
+ <filename>interfaces</filename> configuration file in
+ the BSP's layer here:
+ <literallayout class='monospaced'>
+ meta-xyz/recipes-core/init-ifupdown/files/xyz-machine-one/interfaces
+ </literallayout>
+ <note>
+ If the <filename>meta-xyz</filename> layer did
+ not support multiple machines, you would place
+ the <filename>interfaces</filename> configuration
+ file in the layer here:
+ <literallayout class='monospaced'>
+ meta-xyz/recipes-core/init-ifupdown/files/interfaces
+ </literallayout>
+ </note>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ variable in the append files extends the search path
+ the build system uses to find files during the build.
+ Consequently, for this example you need to have the
+ <filename>files</filename> directory in the same
+ location as your append file.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='bsp-licensing-considerations'>
+ <title>BSP Licensing Considerations</title>
+
+ <para>
+ In some cases, a BSP contains separately licensed
+ Intellectual Property (IP) for a component or components.
+ For these cases, you are required to accept the terms
+ of a commercial or other type of license that requires
+ some kind of explicit End User License Agreement (EULA).
+ Once you accept the license, the OpenEmbedded build system
+ can then build and include the corresponding component
+ in the final BSP image.
+ If the BSP is available as a pre-built image, you can
+ download the image after agreeing to the license or EULA.
+ </para>
+
+ <para>
+ You could find that some separately licensed components
+ that are essential for normal operation of the system might
+ not have an unencumbered (or free) substitute.
+ Without these essential components, the system would be
+ non-functional.
+ Then again, you might find that other licensed components
+ that are simply 'good-to-have' or purely elective do have
+ an unencumbered, free replacement component that you can
+ use rather than agreeing to the separately licensed
+ component.
+ Even for components essential to the system, you might
+ find an unencumbered component that is not identical but
+ will work as a less-capable version of the licensed version
+ in the BSP recipe.
+ </para>
+
+ <para>
+ For cases where you can substitute a free component and
+ still maintain the system's functionality, the "DOWNLOADS"
+ selection from the "SOFTWARE" tab on the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>
+ makes available de-featured BSPs that are completely free
+ of any IP encumbrances.
+ For these cases, you can use the substitution directly and
+ without any further licensing requirements.
+ If present, these fully de-featured BSPs are named
+ appropriately different as compared to the names of their
+ respective encumbered BSPs.
+ If available, these substitutions are your simplest and
+ most preferred options.
+ Obviously, use of these substitutions assumes the resulting
+ functionality meets system requirements.
+ <note>
+ If however, a non-encumbered version is unavailable or
+ it provides unsuitable functionality or quality, you can
+ use an encumbered version.
+ </note>
+ </para>
+
+ <para>
+ A couple different methods exist within the OpenEmbedded
+ build system to satisfy the licensing requirements for an
+ encumbered BSP.
+ The following list describes them in order of preference:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></ulink>
+ Variable to Define the Recipes that Have Commercial
+ or Other Types of Specially-Licensed Packages:</emphasis>
+ For each of those recipes, you can specify a
+ matching license string in a
+ <filename>local.conf</filename> variable named
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></ulink>.
+ Specifying the matching license string signifies
+ that you agree to the license.
+ Thus, the build system can build the corresponding
+ recipe and include the component in the image.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual for details on how to use these variables.
+ </para>
+
+ <para>If you build as you normally would, without
+ specifying any recipes in the
+ <filename>LICENSE_FLAGS_WHITELIST</filename>, the
+ build stops and provides you with the list of recipes
+ that you have tried to include in the image that
+ need entries in the
+ <filename>LICENSE_FLAGS_WHITELIST</filename>.
+ Once you enter the appropriate license flags into
+ the whitelist, restart the build to continue where
+ it left off.
+ During the build, the prompt will not appear again
+ since you have satisfied the requirement.</para>
+
+ <para>Once the appropriate license flags are on the
+ white list in the
+ <filename>LICENSE_FLAGS_WHITELIST</filename> variable,
+ you can build the encumbered image with no change
+ at all to the normal build process.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Get a Pre-Built Version of the BSP:</emphasis>
+ You can get this type of BSP by selecting the
+ "DOWNLOADS" item from the "SOFTWARE" tab on the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project website</ulink>.
+ You can download BSP tarballs that contain
+ proprietary components after agreeing to the
+ licensing requirements of each of the individually
+ encumbered packages as part of the download process.
+ Obtaining the BSP this way allows you to access an
+ encumbered image immediately after agreeing to the
+ click-through license agreements presented by the
+ website.
+ If you want to build the image yourself using
+ the recipes contained within the BSP tarball,
+ you will still need to create an appropriate
+ <filename>LICENSE_FLAGS_WHITELIST</filename>
+ to match the encumbered recipes in the BSP.
+ </para></listitem>
+ </orderedlist>
+ <note>
+ Pre-compiled images are bundled with a time-limited
+ kernel that runs for a predetermined amount of time
+ (10 days) before it forces the system to reboot.
+ This limitation is meant to discourage direct
+ redistribution of the image.
+ You must eventually rebuild the image if you want
+ to remove this restriction.
+ </note>
+ </para>
+</section>
+
+<section id='creating-a-new-bsp-layer-using-the-bitbake-layers-script'>
+ <title>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</title>
+
+ <para>
+ The <filename>bitbake-layers create-layer</filename> script
+ automates creating a BSP layer.
+ What makes a layer a "BSP layer", is the presence of a machine
+ configuration file.
+ Additionally, a BSP layer usually has a kernel recipe
+ or an append file that leverages off an existing kernel recipe.
+ The primary requirement, however, is the machine configuration.
+ </para>
+
+ <para>
+ Use these steps to create a BSP layer:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Create a General Layer:</emphasis>
+ Use the <filename>bitbake-layers</filename> script with the
+ <filename>create-layer</filename> subcommand to create a
+ new general layer.
+ For instructions on how to create a general layer using the
+ <filename>bitbake-layers</filename> script, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Layer Configuration File:</emphasis>
+ Every layer needs a layer configuration file.
+ This configuration file establishes locations for the
+ layer's recipes, priorities for the layer, and so forth.
+ You can find examples of <filename>layer.conf</filename>
+ files in the Yocto Project
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>.
+ To get examples of what you need in your configuration
+ file, locate a layer (e.g. "meta-ti") and examine the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-ti/tree/conf/layer.conf'></ulink>
+ file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Machine Configuration File:</emphasis>
+ Create a <filename>conf/machine/</filename><replaceable>bsp_root_name</replaceable><filename>.conf</filename>
+ file.
+ See
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf/machine'><filename>meta-yocto-bsp/conf/machine</filename></ulink>
+ for sample
+ <replaceable>bsp_root_name</replaceable><filename>.conf</filename>
+ files.
+ Other samples such as
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-ti/tree/conf/machine'><filename>meta-ti</filename></ulink>
+ and
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/tree/conf/machine'><filename>meta-freescale</filename></ulink>
+ exist from other vendors that have more specific machine
+ and tuning examples.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Kernel Recipe:</emphasis>
+ Create a kernel recipe in <filename>recipes-kernel/linux</filename>
+ by either using a kernel append file or a new custom kernel
+ recipe file (e.g. <filename>yocto-linux_4.12.bb</filename>).
+ The BSP layers mentioned in the previous step also contain different
+ kernel examples.
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#modifying-an-existing-recipe'>Modifying an Existing Recipe</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual
+ for information on how to create a custom kernel.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The remainder of this section provides a description of
+ the Yocto Project reference BSP for Beaglebone, which
+ resides in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#term-container-layer'>Container Layer</ulink>
+ (i.e.
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp'><filename>meta-yocto-bsp</filename></ulink>).
+ </para>
+
+ <section id='bsp-layer-configuration-example'>
+ <title>BSP Layer Configuration Example</title>
+
+ <para>
+ The layer's <filename>conf</filename> directory
+ contains the <filename>layer.conf</filename>
+ configuration file.
+ In this example, the
+ <filename>conf/layer.conf</filename> is the
+ following:
+ <literallayout class='monospaced'>
+ # 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 += "yoctobsp"
+ BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_yoctobsp = "5"
+ LAYERVERSION_yoctobsp = "4"
+ LAYERSERIES_COMPAT_yoctobsp = "&DISTRO_NAME_NO_CAP;"
+ </literallayout>
+ The variables used in this file configure the
+ layer.
+ A good way to learn about layer configuration
+ files is to examine various files for BSP from
+ the
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>.
+ </para>
+
+ <para>
+ For a detailed description of this particular
+ layer configuration file, see
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-layer-config-file-description'>step 3</ulink>
+ in the discussion that describes how to create
+ layers in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='bsp-machine-configuration-example'>
+ <title>BSP Machine Configuration Example</title>
+
+ <para>
+ As mentioned earlier in this section, the existence
+ of a machine configuration file is what makes a
+ layer a BSP layer as compared to a general or
+ kernel layer.
+ </para>
+
+ <para>
+ Machine configuration files exist in the
+ <replaceable>bsp_layer</replaceable><filename>/conf/machine/</filename>
+ directory of the layer:
+ <literallayout class='monospaced'>
+ <replaceable>bsp_layer</replaceable><filename>/conf/machine/</filename><replaceable>machine</replaceable><filename>.conf</filename>
+ </literallayout>
+ For example, the machine configuration file for the
+ <ulink url='http://beagleboard.org/bone'>BeagleBone and BeagleBone Black development boards</ulink>
+ is located in the container layer
+ <filename>poky/meta-yocto-bsp/conf/machine</filename>
+ and is named <filename>beaglebone-yocto.conf</filename>:
+ <literallayout class='monospaced'>
+ #@TYPE: Machine
+ #@NAME: Beaglebone-yocto machine
+ #@DESCRIPTION: Reference machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards
+
+ PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+ XSERVER ?= "xserver-xorg \
+ xf86-video-modesetting \
+ "
+
+ MACHINE_EXTRA_RRECOMMENDS = "kernel-modules kernel-devicetree"
+
+ EXTRA_IMAGEDEPENDS += "u-boot"
+
+ DEFAULTTUNE ?= "cortexa8hf-neon"
+ include conf/machine/include/tune-cortexa8.inc
+
+ IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
+ EXTRA_IMAGECMD_jffs2 = "-lnp "
+ WKS_FILE ?= "beaglebone-yocto.wks"
+ IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
+ do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
+
+ SERIAL_CONSOLES = "115200;ttyO0"
+
+ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+ PREFERRED_VERSION_linux-yocto ?= "4.12%"
+
+ KERNEL_IMAGETYPE = "zImage"
+ KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
+ KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+
+ SPL_BINARY = "MLO"
+ UBOOT_SUFFIX = "img"
+ UBOOT_MACHINE = "am335x_boneblack_config"
+ UBOOT_ENTRYPOINT = "0x80008000"
+ UBOOT_LOADADDRESS = "0x80008000"
+
+ MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
+
+ IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
+ </literallayout>
+ The variables used to configure the machine define
+ machine-specific properties.
+ For example, machine-dependent packages, machine
+ tunings, the type of kernel to build, and
+ U-Boot configurations.
+ </para>
+
+ <para>
+ The following list provides some explanation
+ for the statements found in the example reference
+ machine configuration file for the BeagleBone
+ development boards.
+ Realize that much more can be defined as part of
+ a machines configuration file.
+ In general, you can learn about related variables
+ that this example does not have by locating the
+ variables in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-variables-glos'>Yocto Project Variables Glossary</ulink>"
+ in the Yocto Project Reference Manual.
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER_virtual/xserver</filename></ulink>:
+ The recipe that provides "virtual/xserver" when
+ more than one provider is found.
+ In this case, the recipe that provides
+ "virtual/xserver" is "xserver-xorg", which
+ exists in
+ <filename>poky/meta/recipes-graphics/xserver-xorg</filename>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-XSERVER'><filename>XSERVER</filename></ulink>:
+ The packages that should be installed to provide
+ an X server and drivers for the machine.
+ In this example, the "xserver-xorg" and
+ "xf86-video-modesetting" are installed.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink>:
+ A list of machine-dependent packages
+ not essential for booting the image.
+ Thus, the build does not fail if the packages
+ do not exist.
+ However, the packages are required for a
+ fully-featured image.
+ <note><title>Tip</title>
+ Many <filename>MACHINE*</filename> variables
+ exist that help you configure a particular
+ piece of hardware.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGEDEPENDS'><filename>EXTRA_IMAGEDEPENDS</filename></ulink>:
+ Recipes to build that do not provide packages
+ for installing into the root filesystem
+ but building the image depends on the
+ recipes.
+ Sometimes a recipe is required to build
+ the final image but is not needed in the
+ root filesystem.
+ In this case, the U-Boot recipe must be
+ built for the image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></ulink>:
+ Machines use tunings to optimize machine,
+ CPU, and application performance.
+ These features, which are collectively known
+ as "tuning features", exist in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core (OE-Core)</ulink>
+ layer (e.g.
+ <filename>poky/meta/conf/machine/include</filename>).
+ In this example, the default tunning file is
+ "cortexa8hf-neon".
+ <note>
+ The <filename>include</filename> statement
+ that pulls in the
+ <filename>conf/machine/include/tune-cortexa8.inc</filename>
+ file provides many tuning possibilities.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>:
+ The formats the OpenEmbedded build system
+ uses during the build when creating the
+ root filesystem.
+ In this example, four types of images are
+ supported.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGECMD'><filename>EXTRA_IMAGECMD</filename></ulink>:
+ Specifies additional options for image
+ creation commands.
+ In this example, the "-lnp " option is used
+ when creating the
+ <ulink url='https://en.wikipedia.org/wiki/JFFS2'>JFFS2</ulink>
+ image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE'><filename>WKS_FILE</filename></ulink>:
+ The location of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-kickstart'>Wic kickstart</ulink>
+ file used by the OpenEmbedded build system to
+ create a partitioned image (image.wic).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>:
+ Specifies packages to install into an image
+ through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image'><filename>image</filename></ulink>
+ class.
+ Recipes use the <filename>IMAGE_INSTALL</filename>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <filename>do_image_wic[depends]</filename>:
+ A task that is constructed during the build.
+ In this example, the task depends on specific tools
+ in order to create the sysroot when buiding a Wic
+ image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></ulink>:
+ Defines a serial console (TTY) to enable using
+ getty.
+ In this case, the baud rate is "115200" and the
+ device name is "ttyO0".
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER_virtual/kernel</filename></ulink>:
+ Specifies the recipe that provides
+ "virtual/kernel" when more than one provider
+ is found.
+ In this case, the recipe that provides
+ "virtual/kernel" is "linux-yocto", which
+ exists in the layer's
+ <filename>recipes-kernel/linux</filename> directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION_linux-yocto</filename></ulink>:
+ Defines the version of the recipe used
+ to build the kernel, which is "4.12" in this
+ case.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></ulink>:
+ The type of kernel to build for the device.
+ In this case, the OpenEmbedded build system
+ creates a "zImage" image type.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_DEVICETREE'><filename>KERNEL_DEVICETREE</filename></ulink>:
+ The name of the generated Linux kernel device
+ tree (i.e. the <filename>.dtb</filename>) file.
+ All the device trees for the various BeagleBone
+ devices are included.
+<!--
+ You have to include some *.inc files according to the definition of KERNEL_DEVICETREE.
+ I don't see where these are being provided.
+-->
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_EXTRA_ARGS'><filename>KERNEL_EXTRA_ARGS</filename></ulink>:
+ Additional <filename>make</filename>
+ command-line arguments the OpenEmbedded build
+ system passes on when compiling the kernel.
+ In this example, "LOADADDR=${UBOOT_ENTRYPOINT}"
+ is passed as a command-line argument.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SPL_BINARY'><filename>SPL_BINARY</filename></ulink>:
+ Defines the Secondary Program Loader (SPL) binary
+ type.
+ In this case, the SPL binary is set to
+ "MLO", which stands for Multimedia card LOader.
+ </para>
+
+ <para>The BeagleBone development board requires an
+ SPL to boot and that SPL file type must be MLO.
+ Consequently, the machine configuration needs to
+ define <filename>SPL_BINARY</filename> as "MLO".
+ <note>
+ For more information on how the SPL variables
+ are used, see the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-bsp/u-boot/u-boot.inc'><filename>u-boot.inc</filename></ulink>
+ include file.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_ENTRYPOINT'><filename>UBOOT_*</filename></ulink>:
+ Defines various U-Boot configurations needed
+ to build a U-Boot image.
+ In this example, a U-Boot image is required
+ to boot the BeagleBone device.
+ See the following variables for more information:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_SUFFIX'><filename>UBOOT_SUFFIX</filename></ulink>:
+ Points to the generated U-Boot extension.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></ulink>:
+ Specifies the value passed on the make command line when building a U-Boot image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_ENTRYPOINT'><filename>UBOOT_ENTRYPOINT</filename></ulink>:
+ Specifies the entry point for the U-Boot image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-UBOOT_LOADADDRESS'><filename>UBOOT_LOADADDRESS</filename></ulink>:
+ Specifies the load address for the U-Boot image.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></ulink>:
+ Specifies the list of hardware features the
+ BeagleBone device is capable of supporting.
+ In this case, the device supports
+ "usbgadget usbhost vfat alsa".
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_BOOT_FILES'><filename>IMAGE_BOOT_FILES</filename></ulink>:
+ Files installed into the device's boot partition
+ when preparing the image using the Wic tool
+ with the <filename>bootimg-partition</filename>
+ source plugin.
+ In this case, the "u-boot.${UBOOT_SUFFIX}" and
+ "MLO" files are installed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='bsp-kernel-recipe-example'>
+ <title>BSP Kernel Recipe Example</title>
+
+ <para>
+ The kernel recipe used to build the kernel image
+ for the BeagleBone device was established in the
+ machine configuration:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+ PREFERRED_VERSION_linux-yocto ?= "4.12%"
+ </literallayout>
+ The <filename>meta-yocto-bsp/recipes-kernel/linux</filename>
+ directory in the layer contains metadata used
+ to build the kernel.
+ In this case, a kernel append file is used to
+ override an established kernel recipe, which is
+ located in
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-kernel/linux'></ulink>
+ and named
+ <filename>linux-yocto_4.12.bb</filename>.
+ </para>
+
+ <para>
+ Following is the contents of the append file:
+ <literallayout class='monospaced'>
+ KBRANCH_genericx86 = "standard/base"
+ KBRANCH_genericx86-64 = "standard/base"
+
+ KMACHINE_genericx86 ?= "common-pc"
+ KMACHINE_genericx86-64 ?= "common-pc-64"
+ KBRANCH_edgerouter = "standard/edgerouter"
+ KBRANCH_beaglebone-yocto = "standard/beaglebone"
+ KMACHINE_beaglebone-yocto = "beaglebone"
+ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+ SRCREV_machine_genericx86 ?= "1c4ad569af3e23a77994235435040e322908687f"
+ SRCREV_machine_genericx86-64 ?= "1c4ad569af3e23a77994235435040e322908687f"
+ SRCREV_machine_edgerouter ?= "257f843ea367744620f1d92910afd2f454e31483"
+ SRCREV_machine_beaglebone-yocto ?= "257f843ea367744620f1d92910afd2f454e31483"
+ SRCREV_machine_mpc8315e-rdb ?= "014560874f9eb2a86138c9cc35046ff1720485e1"
+
+
+ COMPATIBLE_MACHINE_genericx86 = "genericx86"
+ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+ COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+ COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
+ COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+ LINUX_VERSION_genericx86 = "4.12.20"
+ LINUX_VERSION_genericx86-64 = "4.12.20"
+ LINUX_VERSION_edgerouter = "4.12.19"
+ LINUX_VERSION_beaglebone-yocto = "4.12.19"
+ LINUX_VERSION_mpc8315e-rdb = "4.12.19"
+ </literallayout>
+ This particular append file works for all the
+ machines that are part of the
+ <filename>meta-yocto-bsp</filename> container
+ layer.
+ The relevant statements are appended with
+ the "beaglebone-yocto" string.
+ The OpenEmbedded build system uses these
+ statements to override similar statements
+ in the kernel recipe:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>:
+ Identifies the kernel branch that is validated,
+ patched, and configured during the build.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>:
+ Identifies the machine name as known by the
+ kernel, which is sometimes a different name
+ than what is known by the OpenEmbedded build
+ system.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>:
+ Identifies the revision of the source code used
+ to build the image.
+<!--
+ You find out about that point in the kernel source tree by
+ doing the following command:
+
+ git log &dash;&dash;decorate 257f843ea367744620f1d92910afd2f454e31483
+
+ Returns information about the commit, which is usually
+ that it is a merge point for a stable kernel release.
+-->
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>:
+ A regular expression that resolves to one or
+ more target machines with which the recipe
+ is compatible.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>:
+ The Linux version from kernel.org used by
+ the OpenEmbedded build system to build the
+ kernel image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+</chapter>
diff --git a/poky/documentation/bsp-guide/figures/bsp-dev-flow.png b/poky/documentation/bsp-guide/figures/bsp-dev-flow.png
new file mode 100644
index 000000000..2ca1fecad
--- /dev/null
+++ b/poky/documentation/bsp-guide/figures/bsp-dev-flow.png
Binary files differ
diff --git a/poky/documentation/bsp-guide/figures/bsp-title.png b/poky/documentation/bsp-guide/figures/bsp-title.png
new file mode 100644
index 000000000..f624dd4f9
--- /dev/null
+++ b/poky/documentation/bsp-guide/figures/bsp-title.png
Binary files differ
diff --git a/poky/documentation/dev-manual/dev-manual-common-tasks.xml b/poky/documentation/dev-manual/dev-manual-common-tasks.xml
new file mode 100644
index 000000000..fe1bfba6c
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -0,0 +1,15326 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='extendpoky'>
+
+<title>Common Tasks</title>
+ <para>
+ This chapter describes fundamental procedures such as creating layers,
+ adding new software packages, extending or customizing images,
+ porting work to new hardware (adding a new machine), and so forth.
+ You will find that the procedures documented here occur often in the
+ development cycle using the Yocto Project.
+ </para>
+
+ <section id="understanding-and-creating-layers">
+ <title>Understanding and Creating Layers</title>
+
+ <para>
+ The OpenEmbedded build system supports organizing
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink> into
+ multiple layers.
+ Layers allow you to isolate different types of customizations from
+ each other.
+ For introductory information on the Yocto Project Layer Model,
+ see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <section id='creating-your-own-layer'>
+ <title>Creating Your Own Layer</title>
+
+ <para>
+ It is very easy to create your own layers to use with the
+ OpenEmbedded build system.
+ The Yocto Project ships with tools that speed up creating
+ layers.
+ This section describes the steps you perform by hand to create
+ layers so that you can better understand them.
+ For information about the layer-creation tools, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide and the
+ "<link linkend='creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section further down in this manual.
+ </para>
+
+ <para>
+ Follow these general steps to create your layer without using
+ tools:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Check Existing Layers:</emphasis>
+ Before creating a new layer, you should be sure someone
+ has not already created a layer containing the Metadata
+ you need.
+ You can see the
+ <ulink url='http://layers.openembedded.org/layerindex/layers/'>OpenEmbedded Metadata Index</ulink>
+ for a list of layers from the OpenEmbedded community
+ that can be used in the Yocto Project.
+ You could find a layer that is identical or close to
+ what you need.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Directory:</emphasis>
+ Create the directory for your layer.
+ When you create the layer, be sure to create the
+ directory in an area not associated with the
+ Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. the cloned <filename>poky</filename> repository).
+ </para>
+
+ <para>While not strictly required, prepend the name of
+ the directory with the string "meta-".
+ For example:
+ <literallayout class='monospaced'>
+ meta-mylayer
+ meta-GUI_xyz
+ meta-mymachine
+ </literallayout>
+ With rare exceptions, a layer's name follows this
+ form:
+ <literallayout class='monospaced'>
+ meta-<replaceable>root_name</replaceable>
+ </literallayout>
+ Following this layer naming convention can
+ save you trouble later when tools, components, or
+ variables "assume" your layer name begins with "meta-".
+ A notable example is in configuration files as
+ shown in the following step where layer names without
+ the "meta-" string are appended
+ to several variables used in the configuration.
+ </para></listitem>
+ <listitem><para id='dev-layer-config-file-description'>
+ <emphasis>Create a Layer Configuration File:</emphasis>
+ Inside your new layer folder, you need to create a
+ <filename>conf/layer.conf</filename> file.
+ It is easiest to take an existing layer configuration
+ file and copy that to your layer's
+ <filename>conf</filename> directory and then modify the
+ file as needed.</para>
+
+ <para>The
+ <filename>meta-yocto-bsp/conf/layer.conf</filename> file
+ in the Yocto Project
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp/conf'>Source Repositories</ulink>
+ demonstrates the required syntax.
+ For your layer, you need to replace "yoctobsp" with
+ a unique identifier for your layer (e.g. "machinexyz"
+ for a layer named "meta-machinexyz"):
+ <literallayout class='monospaced'>
+ # 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 += "yoctobsp"
+ BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_yoctobsp = "5"
+ LAYERVERSION_yoctobsp = "4"
+ LAYERSERIES_COMPAT_yoctobsp = "&DISTRO_NAME_NO_CAP;"
+ </literallayout>
+ Following is an explanation of the layer configuration
+ file:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>:
+ Adds the layer's root directory to BitBake's
+ search path.
+ Through the use of the
+ <filename>BBPATH</filename> variable, BitBake
+ locates class files
+ (<filename>.bbclass</filename>),
+ configuration files, and files that are
+ included with <filename>include</filename> and
+ <filename>require</filename> statements.
+ For these cases, BitBake uses the first file
+ that matches the name found in
+ <filename>BBPATH</filename>.
+ This is similar to the way the
+ <filename>PATH</filename> variable is used for
+ binaries.
+ It is recommended, therefore, that you use
+ unique class and configuration filenames in
+ your custom layer.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILES'><filename>BBFILES</filename></ulink>:
+ Defines the location for all recipes in the
+ layer.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_COLLECTIONS'><filename>BBFILE_COLLECTIONS</filename></ulink>:
+ Establishes the current layer through a
+ unique identifier that is used throughout the
+ OpenEmbedded build system to refer to the layer.
+ In this example, the identifier "yoctobsp" is
+ the representation for the container layer
+ named "meta-yocto-bsp".
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PATTERN'><filename>BBFILE_PATTERN</filename></ulink>:
+ Expands immediately during parsing to
+ provide the directory of the layer.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>:
+ Establishes a priority to use for
+ recipes in the layer when the OpenEmbedded build
+ finds recipes of the same name in different
+ layers.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERVERSION'><filename>LAYERVERSION</filename></ulink>:
+ Establishes a version number for the layer.
+ You can use this version number to specify this
+ exact version of the layer as a dependency when
+ using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERDEPENDS'><filename>LAYERDEPENDS</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LAYERSERIES_COMPAT'><filename>LAYERSERIES_COMPAT</filename></ulink>:
+ Lists the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Yocto Project</ulink>
+ releases for which the current version is
+ compatible.
+ This variable is a good way to indicate how
+ up-to-date your particular layer is.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add Content:</emphasis>
+ Depending on the type of layer, add the content.
+ If the layer adds support for a machine, add the machine
+ configuration in a <filename>conf/machine/</filename>
+ file within the layer.
+ If the layer adds distro policy, add the distro
+ configuration in a <filename>conf/distro/</filename>
+ file within the layer.
+ If the layer introduces new recipes, put the recipes
+ you need in <filename>recipes-*</filename>
+ subdirectories within the layer.
+ <note>
+ For an explanation of layer hierarchy that
+ is compliant with the Yocto Project, see
+ the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout'>Example Filesystem Layout</ulink>"
+ section in the Yocto Project Board
+ Support Package (BSP) Developer's Guide.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Test for Compatibility:</emphasis>
+ If you want permission to use the Yocto Project
+ Compatibility logo with your layer or application that
+ uses your layer, perform the steps to apply for
+ compatibility.
+ See the
+ "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
+ section for more information.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='best-practices-to-follow-when-creating-layers'>
+ <title>Following Best Practices When Creating Layers</title>
+
+ <para>
+ To create layers that are easier to maintain and that will
+ not impact builds for other machines, you should consider the
+ information in the following list:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Avoid "Overlaying" Entire Recipes from Other Layers in Your Configuration:</emphasis>
+ In other words, do not copy an entire recipe into your
+ layer and then modify it.
+ Rather, use an append file
+ (<filename>.bbappend</filename>) to override only those
+ parts of the original recipe you need to modify.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Avoid Duplicating Include Files:</emphasis>
+ Use append files (<filename>.bbappend</filename>)
+ for each recipe that uses an include file.
+ Or, if you are introducing a new recipe that requires
+ the included file, use the path relative to the
+ original layer directory to refer to the file.
+ For example, use
+ <filename>require recipes-core/</filename><replaceable>package</replaceable><filename>/</filename><replaceable>file</replaceable><filename>.inc</filename>
+ instead of
+ <filename>require </filename><replaceable>file</replaceable><filename>.inc</filename>.
+ If you're finding you have to overlay the include file,
+ it could indicate a deficiency in the include file in
+ the layer to which it originally belongs.
+ If this is the case, you should try to address that
+ deficiency instead of overlaying the include file.
+ For example, you could address this by getting the
+ maintainer of the include file to add a variable or
+ variables to make it easy to override the parts needing
+ to be overridden.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Structure Your Layers:</emphasis>
+ Proper use of overrides within append files and
+ placement of machine-specific files within your layer
+ can ensure that a build is not using the wrong Metadata
+ and negatively impacting a build for a different
+ machine.
+ Following are some examples:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Modify Variables to Support a
+ Different Machine:</emphasis>
+ Suppose you have a layer named
+ <filename>meta-one</filename> that adds support
+ for building machine "one".
+ To do so, you use an append file named
+ <filename>base-files.bbappend</filename> and
+ create a dependency on "foo" by altering the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable:
+ <literallayout class='monospaced'>
+ DEPENDS = "foo"
+ </literallayout>
+ The dependency is created during any build that
+ includes the layer
+ <filename>meta-one</filename>.
+ However, you might not want this dependency
+ for all machines.
+ For example, suppose you are building for
+ machine "two" but your
+ <filename>bblayers.conf</filename> file has the
+ <filename>meta-one</filename> layer included.
+ During the build, the
+ <filename>base-files</filename> for machine
+ "two" will also have the dependency on
+ <filename>foo</filename>.</para>
+ <para>To make sure your changes apply only when
+ building machine "one", use a machine override
+ with the <filename>DEPENDS</filename> statement:
+ <literallayout class='monospaced'>
+ DEPENDS_one = "foo"
+ </literallayout>
+ You should follow the same strategy when using
+ <filename>_append</filename> and
+ <filename>_prepend</filename> operations:
+ <literallayout class='monospaced'>
+ DEPENDS_append_one = " foo"
+ DEPENDS_prepend_one = "foo "
+ </literallayout>
+ As an actual example, here's a line from the recipe
+ for gnutls, which adds dependencies on
+ "argp-standalone" when building with the musl C
+ library:
+ <literallayout class='monospaced'>
+ DEPENDS_append_libc-musl = " argp-standalone"
+ </literallayout>
+ <note>
+ Avoiding "+=" and "=+" and using
+ machine-specific
+ <filename>_append</filename>
+ and <filename>_prepend</filename> operations
+ is recommended as well.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Place Machine-Specific Files in
+ Machine-Specific Locations:</emphasis>
+ When you have a base recipe, such as
+ <filename>base-files.bb</filename>, that
+ contains a
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement to a file, you can use an append file
+ to cause the build to use your own version of
+ the file.
+ For example, an append file in your layer at
+ <filename>meta-one/recipes-core/base-files/base-files.bbappend</filename>
+ could extend
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ using
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ as follows:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+ </literallayout>
+ The build for machine "one" will pick up your
+ machine-specific file as long as you have the
+ file in
+ <filename>meta-one/recipes-core/base-files/base-files/</filename>.
+ However, if you are building for a different
+ machine and the
+ <filename>bblayers.conf</filename> file includes
+ the <filename>meta-one</filename> layer and
+ the location of your machine-specific file is
+ the first location where that file is found
+ according to <filename>FILESPATH</filename>,
+ builds for all machines will also use that
+ machine-specific file.</para>
+ <para>You can make sure that a machine-specific
+ file is used for a particular machine by putting
+ the file in a subdirectory specific to the
+ machine.
+ For example, rather than placing the file in
+ <filename>meta-one/recipes-core/base-files/base-files/</filename>
+ as shown above, put it in
+ <filename>meta-one/recipes-core/base-files/base-files/one/</filename>.
+ Not only does this make sure the file is used
+ only when building for machine "one", but the
+ build process locates the file more quickly.</para>
+ <para>In summary, you need to place all files
+ referenced from <filename>SRC_URI</filename>
+ in a machine-specific subdirectory within the
+ layer in order to restrict those files to
+ machine-specific builds.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Perform Steps to Apply for Yocto Project Compatibility:</emphasis>
+ If you want permission to use the
+ Yocto Project Compatibility logo with your layer
+ or application that uses your layer, perform the
+ steps to apply for compatibility.
+ See the
+ "<link linkend='making-sure-your-layer-is-compatible-with-yocto-project'>Making Sure Your Layer is Compatible With Yocto Project</link>"
+ section for more information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Follow the Layer Naming Convention:</emphasis>
+ Store custom layers in a Git repository that use the
+ <filename>meta-<replaceable>layer_name</replaceable></filename>
+ format.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Group Your Layers Locally:</emphasis>
+ Clone your repository alongside other cloned
+ <filename>meta</filename> directories from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='making-sure-your-layer-is-compatible-with-yocto-project'>
+ <title>Making Sure Your Layer is Compatible With Yocto Project</title>
+
+ <para>
+ When you create a layer used with the Yocto Project, it is
+ advantageous to make sure that the layer interacts well with
+ existing Yocto Project layers (i.e. the layer is compatible
+ with the Yocto Project).
+ Ensuring compatibility makes the layer easy to be consumed
+ by others in the Yocto Project community and could allow you
+ permission to use the Yocto Project Compatible Logo.
+ <note>
+ Only Yocto Project member organizations are permitted to
+ use the Yocto Project Compatible Logo.
+ The logo is not available for general use.
+ For information on how to become a Yocto Project member
+ organization, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
+ </note>
+ </para>
+
+ <para>
+ The Yocto Project Compatibility Program consists of a layer
+ application process that requests permission to use the Yocto
+ Project Compatibility Logo for your layer and application.
+ The process consists of two parts:
+ <orderedlist>
+ <listitem><para>
+ Successfully passing a script
+ (<filename>yocto-check-layer</filename>) that
+ when run against your layer, tests it against
+ constraints based on experiences of how layers have
+ worked in the real world and where pitfalls have been
+ found.
+ Getting a "PASS" result from the script is required for
+ successful compatibility registration.
+ </para></listitem>
+ <listitem><para>
+ Completion of an application acceptance form, which
+ you can find at
+ <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ To be granted permission to use the logo, you need to satisfy
+ the following:
+ <itemizedlist>
+ <listitem><para>
+ Be able to check the box indicating that you
+ got a "PASS" when running the script against your
+ layer.
+ </para></listitem>
+ <listitem><para>
+ Answer "Yes" to the questions on the form or have an
+ acceptable explanation for any questions answered "No".
+ </para></listitem>
+ <listitem><para>
+ Be a Yocto Project Member Organization.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The remainder of this section presents information on the
+ registration form and on the
+ <filename>yocto-check-layer</filename> script.
+ </para>
+
+ <section id='yocto-project-compatible-program-application'>
+ <title>Yocto Project Compatible Program Application</title>
+
+ <para>
+ Use the form to apply for your layer's approval.
+ Upon successful application, you can use the Yocto
+ Project Compatibility Logo with your layer and the
+ application that uses your layer.
+ </para>
+
+ <para>
+ To access the form, use this link:
+ <ulink url='https://www.yoctoproject.org/webform/yocto-project-compatible-registration'></ulink>.
+ Follow the instructions on the form to complete your
+ application.
+ </para>
+
+ <para>
+ The application consists of the following sections:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Contact Information:</emphasis>
+ Provide your contact information as the fields
+ require.
+ Along with your information, provide the
+ released versions of the Yocto Project for which
+ your layer is compatible.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Acceptance Criteria:</emphasis>
+ Provide "Yes" or "No" answers for each of the
+ items in the checklist.
+ Space exists at the bottom of the form for any
+ explanations for items for which you answered "No".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Recommendations:</emphasis>
+ Provide answers for the questions regarding Linux
+ kernel use and build success.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='yocto-check-layer-script'>
+ <title><filename>yocto-check-layer</filename> Script</title>
+
+ <para>
+ The <filename>yocto-check-layer</filename> script
+ provides you a way to assess how compatible your layer is
+ with the Yocto Project.
+ You should run this script prior to using the form to
+ apply for compatibility as described in the previous
+ section.
+ You need to achieve a "PASS" result in order to have
+ your application form successfully processed.
+ </para>
+
+ <para>
+ The script divides tests into three areas: COMMON, BSP,
+ and DISTRO.
+ For example, given a distribution layer (DISTRO), the
+ layer must pass both the COMMON and DISTRO related tests.
+ Furthermore, if your layer is a BSP layer, the layer must
+ pass the COMMON and BSP set of tests.
+ </para>
+
+ <para>
+ To execute the script, enter the following commands from
+ your build directory:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env
+ $ yocto-check-layer <replaceable>your_layer_directory</replaceable>
+ </literallayout>
+ Be sure to provide the actual directory for your layer
+ as part of the command.
+ </para>
+
+ <para>
+ Entering the command causes the script to determine the
+ type of layer and then to execute a set of specific
+ tests against the layer.
+ The following list overviews the test:
+ <itemizedlist>
+ <listitem><para>
+ <filename>common.test_readme</filename>:
+ Tests if a <filename>README</filename> file
+ exists in the layer and the file is not empty.
+ </para></listitem>
+ <listitem><para>
+ <filename>common.test_parse</filename>:
+ Tests to make sure that BitBake can parse the
+ files without error (i.e.
+ <filename>bitbake -p</filename>).
+ </para></listitem>
+ <listitem><para>
+ <filename>common.test_show_environment</filename>:
+ Tests that the global or per-recipe environment
+ is in order without errors (i.e.
+ <filename>bitbake -e</filename>).
+ </para></listitem>
+ <listitem><para>
+ <filename>common.test_signatures</filename>:
+ Tests to be sure that BSP and DISTRO layers do not
+ come with recipes that change signatures.
+ </para></listitem>
+ <listitem><para>
+ <filename>bsp.test_bsp_defines_machines</filename>:
+ Tests if a BSP layer has machine configurations.
+ </para></listitem>
+ <listitem><para>
+ <filename>bsp.test_bsp_no_set_machine</filename>:
+ Tests to ensure a BSP layer does not set the
+ machine when the layer is added.
+ </para></listitem>
+ <listitem><para>
+ <filename>distro.test_distro_defines_distros</filename>:
+ Tests if a DISTRO layer has distro configurations.
+ </para></listitem>
+ <listitem><para>
+ <filename>distro.test_distro_no_set_distro</filename>:
+ Tests to ensure a DISTRO layer does not set the
+ distribution when the layer is added.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='enabling-your-layer'>
+ <title>Enabling Your Layer</title>
+
+ <para>
+ Before the OpenEmbedded build system can use your new layer,
+ you need to enable it.
+ To enable your layer, simply add your layer's path to the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'>BBLAYERS</ulink></filename>
+ variable in your <filename>conf/bblayers.conf</filename> file,
+ which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ The following example shows how to enable a layer named
+ <filename>meta-mylayer</filename>:
+ <literallayout class='monospaced'>
+ # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
+ # changes incompatibly
+ POKY_BBLAYERS_CONF_VERSION = "2"
+
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
+
+ BBLAYERS ?= " \
+ /home/<replaceable>user</replaceable>/poky/meta \
+ /home/<replaceable>user</replaceable>/poky/meta-poky \
+ /home/<replaceable>user</replaceable>/poky/meta-yocto-bsp \
+ /home/<replaceable>user</replaceable>/poky/meta-mylayer \
+ "
+ </literallayout>
+ </para>
+
+ <para>
+ BitBake parses each <filename>conf/layer.conf</filename> file
+ from the top down as specified in the
+ <filename>BBLAYERS</filename> variable
+ within the <filename>conf/bblayers.conf</filename> file.
+ During the processing of each
+ <filename>conf/layer.conf</filename> file, BitBake adds the
+ recipes, classes and configurations contained within the
+ particular layer to the source directory.
+ </para>
+ </section>
+
+ <section id='using-bbappend-files'>
+ <title>Using .bbappend Files in Your Layer</title>
+
+ <para>
+ A recipe that appends Metadata to another recipe is called a
+ BitBake append file.
+ A BitBake append file uses the <filename>.bbappend</filename>
+ file type suffix, while the corresponding recipe to which
+ Metadata is being appended uses the <filename>.bb</filename>
+ file type suffix.
+ </para>
+
+ <para>
+ You can use a <filename>.bbappend</filename> file in your
+ layer to make additions or changes to the content of another
+ layer's recipe without having to copy the other layer's
+ recipe into your layer.
+ Your <filename>.bbappend</filename> file resides in your layer,
+ while the main <filename>.bb</filename> recipe file to
+ which you are appending Metadata resides in a different layer.
+ </para>
+
+ <para>
+ Being able to append information to an existing recipe not only
+ avoids duplication, but also automatically applies recipe
+ changes from a different layer into your layer.
+ If you were copying recipes, you would have to manually merge
+ changes as they occur.
+ </para>
+
+ <para>
+ When you create an append file, you must use the same root
+ name as the corresponding recipe file.
+ For example, the append file
+ <filename>someapp_&DISTRO;.bbappend</filename> must apply to
+ <filename>someapp_&DISTRO;.bb</filename>.
+ This means the original recipe and append file names are
+ version number-specific.
+ If the corresponding recipe is renamed to update to a newer
+ version, you must also rename and possibly update
+ the corresponding <filename>.bbappend</filename> as well.
+ During the build process, BitBake displays an error on starting
+ if it detects a <filename>.bbappend</filename> file that does
+ not have a corresponding recipe with a matching name.
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_DANGLINGAPPENDS_WARNONLY'><filename>BB_DANGLINGAPPENDS_WARNONLY</filename></ulink>
+ variable for information on how to handle this error.
+ </para>
+
+ <para>
+ As an example, consider the main formfactor recipe and a
+ corresponding formfactor append file both from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ Here is the main formfactor recipe, which is named
+ <filename>formfactor_0.0.bb</filename> and located in the
+ "meta" layer at
+ <filename>meta/recipes-bsp/formfactor</filename>:
+ <literallayout class='monospaced'>
+ SUMMARY = "Device formfactor information"
+ SECTION = "base"
+ LICENSE = "MIT"
+ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+ PR = "r45"
+
+ SRC_URI = "file://config file://machconfig"
+ S = "${WORKDIR}"
+
+ PACKAGE_ARCH = "${MACHINE_ARCH}"
+ INHIBIT_DEFAULT_DEPS = "1"
+
+ do_install() {
+ # Install file only if it has contents
+ install -d ${D}${sysconfdir}/formfactor/
+ install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/
+ if [ -s "${S}/machconfig" ]; then
+ install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
+ fi
+ } </literallayout>
+ In the main recipe, note the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable, which tells the OpenEmbedded build system where to
+ find files during the build.
+ </para>
+
+ <para>
+ Following is the append file, which is named
+ <filename>formfactor_0.0.bbappend</filename> and is from the
+ Raspberry Pi BSP Layer named
+ <filename>meta-raspberrypi</filename>.
+ The file is in the layer at
+ <filename>recipes-bsp/formfactor</filename>:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ </literallayout>
+ </para>
+
+ <para>
+ By default, the build system uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable to locate files.
+ This append file extends the locations by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ variable.
+ Setting this variable in the <filename>.bbappend</filename>
+ file is the most reliable and recommended method for adding
+ directories to the search path used by the build system
+ to find files.
+ </para>
+
+ <para>
+ The statement in this example extends the directories to
+ include
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>,
+ which resolves to a directory named
+ <filename>formfactor</filename> in the same directory
+ in which the append file resides (i.e.
+ <filename>meta-raspberrypi/recipes-bsp/formfactor</filename>.
+ This implies that you must have the supporting directory
+ structure set up that will contain any files or patches you
+ will be including from the layer.
+ </para>
+
+ <para>
+ Using the immediate expansion assignment operator
+ <filename>:=</filename> is important because of the reference
+ to <filename>THISDIR</filename>.
+ The trailing colon character is important as it ensures that
+ items in the list remain colon-separated.
+ <note>
+ <para>
+ BitBake automatically defines the
+ <filename>THISDIR</filename> variable.
+ You should never set this variable yourself.
+ Using "_prepend" as part of the
+ <filename>FILESEXTRAPATHS</filename> ensures your path
+ will be searched prior to other paths in the final
+ list.
+ </para>
+
+ <para>
+ Also, not all append files add extra files.
+ Many append files simply exist to add build options
+ (e.g. <filename>systemd</filename>).
+ For these cases, your append file would not even
+ use the <filename>FILESEXTRAPATHS</filename> statement.
+ </para>
+ </note>
+ </para>
+ </section>
+
+ <section id='prioritizing-your-layer'>
+ <title>Prioritizing Your Layer</title>
+
+ <para>
+ Each layer is assigned a priority value.
+ Priority values control which layer takes precedence if there
+ are recipe files with the same name in multiple layers.
+ For these cases, the recipe file from the layer with a higher
+ priority number takes precedence.
+ Priority values also affect the order in which multiple
+ <filename>.bbappend</filename> files for the same recipe are
+ applied.
+ You can either specify the priority manually, or allow the
+ build system to calculate it based on the layer's dependencies.
+ </para>
+
+ <para>
+ To specify the layer's priority manually, use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>
+ variable and append the layer's root name:
+ <literallayout class='monospaced'>
+ BBFILE_PRIORITY_mylayer = "1"
+ </literallayout>
+ </para>
+
+ <note>
+ <para>It is possible for a recipe with a lower version number
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ in a layer that has a higher priority to take precedence.</para>
+ <para>Also, the layer priority does not currently affect the
+ precedence order of <filename>.conf</filename>
+ or <filename>.bbclass</filename> files.
+ Future versions of BitBake might address this.</para>
+ </note>
+ </section>
+
+ <section id='managing-layers'>
+ <title>Managing Layers</title>
+
+ <para>
+ You can use the BitBake layer management tool
+ <filename>bitbake-layers</filename> to provide a view
+ into the structure of recipes across a multi-layer project.
+ Being able to generate output that reports on configured layers
+ with their paths and priorities and on
+ <filename>.bbappend</filename> files and their applicable
+ recipes can help to reveal potential problems.
+ </para>
+
+ <para>
+ For help on the BitBake layer management tool, use the
+ following command:
+ <literallayout class='monospaced'>
+ $ bitbake-layers --help
+ NOTE: Starting bitbake server...
+ usage: bitbake-layers [-d] [-q] [-F] [--color COLOR] [-h] &lt;subcommand&gt; ...
+
+ BitBake layers utility
+
+ optional arguments:
+ -d, --debug Enable debug output
+ -q, --quiet Print only errors
+ -F, --force Force add without recipe parse verification
+ --color COLOR Colorize output (where COLOR is auto, always, never)
+ -h, --help show this help message and exit
+
+ subcommands:
+ &lt;subcommand&gt;
+ show-layers show current configured layers.
+ show-overlayed list overlayed recipes (where the same recipe exists
+ in another layer)
+ show-recipes list available recipes, showing the layer they are
+ provided by
+ show-appends list bbappend files and recipe files they apply to
+ show-cross-depends Show dependencies between recipes that cross layer
+ boundaries.
+ add-layer Add one or more layers to bblayers.conf.
+ remove-layer Remove one or more layers from bblayers.conf.
+ flatten flatten layer configuration into a separate output
+ directory.
+ layerindex-fetch Fetches a layer from a layer index along with its
+ dependent layers, and adds them to conf/bblayers.conf.
+ layerindex-show-depends
+ Find layer dependencies from layer index.
+ create-layer Create a basic layer
+
+ Use bitbake-layers &lt;subcommand&gt; --help to get help on a specific command
+ </literallayout>
+ </para>
+
+ <para>
+ The following list describes the available commands:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>help:</filename></emphasis>
+ Displays general help or help on a specified command.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>show-layers:</filename></emphasis>
+ Shows the current configured layers.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>show-overlayed:</filename></emphasis>
+ Lists overlayed recipes.
+ A recipe is overlayed when a recipe with the same name
+ exists in another layer that has a higher layer
+ priority.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>show-recipes:</filename></emphasis>
+ Lists available recipes and the layers that provide them.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>show-appends:</filename></emphasis>
+ Lists <filename>.bbappend</filename> files and the
+ recipe files to which they apply.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>show-cross-depends:</filename></emphasis>
+ Lists dependency relationships between recipes that
+ cross layer boundaries.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>add-layer:</filename></emphasis>
+ Adds a layer to <filename>bblayers.conf</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>remove-layer:</filename></emphasis>
+ Removes a layer from <filename>bblayers.conf</filename>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>flatten:</filename></emphasis>
+ Flattens the layer configuration into a separate output
+ directory.
+ Flattening your layer configuration builds a "flattened"
+ directory that contains the contents of all layers,
+ with any overlayed recipes removed and any
+ <filename>.bbappend</filename> files appended to the
+ corresponding recipes.
+ You might have to perform some manual cleanup of the
+ flattened layer as follows:
+ <itemizedlist>
+ <listitem><para>
+ Non-recipe files (such as patches)
+ are overwritten.
+ The flatten command shows a warning for these
+ files.
+ </para></listitem>
+ <listitem><para>
+ Anything beyond the normal layer
+ setup has been added to the
+ <filename>layer.conf</filename> file.
+ Only the lowest priority layer's
+ <filename>layer.conf</filename> is used.
+ </para></listitem>
+ <listitem><para>
+ Overridden and appended items from
+ <filename>.bbappend</filename> files need to be
+ cleaned up.
+ The contents of each
+ <filename>.bbappend</filename> end up in the
+ flattened recipe.
+ However, if there are appended or changed
+ variable values, you need to tidy these up
+ yourself.
+ Consider the following example.
+ Here, the <filename>bitbake-layers</filename>
+ command adds the line
+ <filename>#### bbappended ...</filename> so that
+ you know where the following lines originate:
+ <literallayout class='monospaced'>
+ ...
+ DESCRIPTION = "A useful utility"
+ ...
+ EXTRA_OECONF = "--enable-something"
+ ...
+
+ #### bbappended from meta-anotherlayer ####
+
+ DESCRIPTION = "Customized utility"
+ EXTRA_OECONF += "--enable-somethingelse"
+ </literallayout>
+ Ideally, you would tidy up these utilities as
+ follows:
+ <literallayout class='monospaced'>
+ ...
+ DESCRIPTION = "Customized utility"
+ ...
+ EXTRA_OECONF = "--enable-something --enable-somethingelse"
+ ...
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>layerindex-fetch</filename>:</emphasis>
+ Fetches a layer from a layer index, along with its
+ dependent layers, and adds the layers to the
+ <filename>conf/bblayers.conf</filename> file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>layerindex-show-depends</filename>:</emphasis>
+ Finds layer dependencies from the layer index.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>create-layer</filename>:</emphasis>
+ Creates a basic layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='creating-a-general-layer-using-the-bitbake-layers-script'>
+ <title>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</title>
+
+ <para>
+ The <filename>bitbake-layers</filename> script with the
+ <filename>create-layer</filename> subcommand simplifies
+ creating a new general layer.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For information on BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Specific (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para>
+ In order to use a layer with the OpenEmbedded
+ build system, you need to add the layer to your
+ <filename>bblayers.conf</filename> configuration
+ file.
+ See the
+ "<link linkend='adding-a-layer-using-the-bitbake-layers-script'>Adding a Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ The default mode of the script's operation with this
+ subcommand is to create a layer with the following:
+ <itemizedlist>
+ <listitem><para>A layer priority of 6.
+ </para></listitem>
+ <listitem><para>A <filename>conf</filename>
+ subdirectory that contains a
+ <filename>layer.conf</filename> file.
+ </para></listitem>
+ <listitem><para>
+ A <filename>recipes-example</filename> subdirectory
+ that contains a further subdirectory named
+ <filename>example</filename>, which contains
+ an <filename>example.bb</filename> recipe file.
+ </para></listitem>
+ <listitem><para>A <filename >COPYING.MIT</filename>,
+ which is the license statement for the layer.
+ The script assumes you want to use the MIT license,
+ which is typical for most layers, for the contents of
+ the layer itself.
+ </para></listitem>
+ <listitem><para>
+ A <filename>README</filename> file, which is a file
+ describing the contents of your new layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In its simplest form, you can use the following command form
+ to create a layer.
+ The command creates a layer whose name corresponds to
+ <replaceable>your_layer_name</replaceable> in the current
+ directory:
+ <literallayout class='monospaced'>
+ $ bitbake-layers create-layer <replaceable>your_layer_name</replaceable>
+ </literallayout>
+ As an example, the following command creates a layer named
+ <filename>meta-scottrif</filename> in your home directory:
+ <literallayout class='monospaced'>
+ $ cd /usr/home
+ $ bitbake-layers create-layer meta-scottrif
+ NOTE: Starting bitbake server...
+ Add your new layer with 'bitbake-layers add-layer meta-scottrif'
+ </literallayout>
+ </para>
+
+ <para>
+ If you want to set the priority of the layer to other than the
+ default value of "6", you can either use the
+ <filename>&dash;&dash;priority</filename> option or you can
+ edit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILE_PRIORITY'><filename>BBFILE_PRIORITY</filename></ulink>
+ value in the <filename>conf/layer.conf</filename> after the
+ script creates it.
+ Furthermore, if you want to give the example recipe file
+ some name other than the default, you can
+ use the
+ <filename>&dash;&dash;example-recipe-name</filename> option.
+ </para>
+
+ <para>
+ The easiest way to see how the
+ <filename>bitbake-layers create-layer</filename> command
+ works is to experiment with the script.
+ You can also read the usage information by entering the
+ following:
+ <literallayout class='monospaced'>
+ $ bitbake-layers create-layer --help
+ NOTE: Starting bitbake server...
+ usage: bitbake-layers create-layer [-h] [--priority PRIORITY]
+ [--example-recipe-name EXAMPLERECIPE]
+ layerdir
+
+ Create a basic layer
+
+ positional arguments:
+ layerdir Layer directory to create
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --priority PRIORITY, -p PRIORITY
+ Layer directory to create
+ --example-recipe-name EXAMPLERECIPE, -e EXAMPLERECIPE
+ Filename of the example recipe
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='adding-a-layer-using-the-bitbake-layers-script'>
+ <title>Adding a Layer Using the <filename>bitbake-layers</filename> Script</title>
+
+ <para>
+ Once you create your general layer, you must add it to your
+ <filename>bblayers.conf</filename> file.
+ Adding the layer to this configuration file makes the
+ OpenEmbedded build system aware of your layer so that it can
+ search it for metadata.
+ </para>
+
+ <para>
+ Add your layer by using the
+ <filename>bitbake-layers add-layer</filename> command:
+ <literallayout class='monospaced'>
+ $ bitbake-layers add-layer <replaceable>your_layer_name</replaceable>
+ </literallayout>
+ Here is an example that adds a layer named
+ <filename>meta-scottrif</filename> to the configuration file.
+ Following the command that adds the layer is another
+ <filename>bitbake-layers</filename> command that shows the
+ layers that are in your <filename>bblayers.conf</filename>
+ file:
+ <literallayout class='monospaced'>
+ $ bitbake-layers add-layer meta-scottrif
+ NOTE: Starting bitbake server...
+ Parsing recipes: 100% |##########################################################| Time: 0:00:49
+ Parsing of 1441 .bb files complete (0 cached, 1441 parsed). 2055 targets, 56 skipped, 0 masked, 0 errors.
+ $ bitbake-layers show-layers
+ NOTE: Starting bitbake server...
+ layer path priority
+ ==========================================================================
+ meta /home/scottrif/poky/meta 5
+ meta-poky /home/scottrif/poky/meta-poky 5
+ meta-yocto-bsp /home/scottrif/poky/meta-yocto-bsp 5
+ workspace /home/scottrif/poky/build/workspace 99
+ meta-scottrif /home/scottrif/poky/build/meta-scottrif 6
+ </literallayout>
+ Adding the layer to this file enables the build system to
+ locate the layer during the build.
+ <note>
+ During a build, the OpenEmbedded build system looks in
+ the layers from the top of the list down to the bottom
+ in that order.
+ </note>
+ </para>
+ </section>
+ </section>
+
+ <section id='usingpoky-extend-customimage'>
+ <title>Customizing Images</title>
+
+ <para>
+ You can customize images to satisfy particular requirements.
+ This section describes several methods and provides guidelines for each.
+ </para>
+
+ <section id='usingpoky-extend-customimage-localconf'>
+ <title>Customizing Images Using <filename>local.conf</filename></title>
+
+ <para>
+ Probably the easiest way to customize an image is to add a
+ package by way of the <filename>local.conf</filename>
+ configuration file.
+ Because it is limited to local use, this method generally only
+ allows you to add packages and is not as flexible as creating
+ your own customized image.
+ When you add packages using local variables this way, you need
+ to realize that these variable changes are in effect for every
+ build and consequently affect all images, which might not
+ be what you require.
+ </para>
+
+ <para>
+ To add a package to your image using the local configuration
+ file, use the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
+ variable with the <filename>_append</filename> operator:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " strace"
+ </literallayout>
+ Use of the syntax is important - specifically, the space between
+ the quote and the package name, which is
+ <filename>strace</filename> in this example.
+ This space is required since the <filename>_append</filename>
+ operator does not add the space.
+ </para>
+
+ <para>
+ Furthermore, you must use <filename>_append</filename> instead
+ of the <filename>+=</filename> operator if you want to avoid
+ ordering issues.
+ The reason for this is because doing so unconditionally appends
+ to the variable and avoids ordering problems due to the
+ variable being set in image recipes and
+ <filename>.bbclass</filename> files with operators like
+ <filename>?=</filename>.
+ Using <filename>_append</filename> ensures the operation takes
+ affect.
+ </para>
+
+ <para>
+ As shown in its simplest use,
+ <filename>IMAGE_INSTALL_append</filename> affects all images.
+ It is possible to extend the syntax so that the variable
+ applies to a specific image only.
+ Here is an example:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append_pn-core-image-minimal = " strace"
+ </literallayout>
+ This example adds <filename>strace</filename> to the
+ <filename>core-image-minimal</filename> image only.
+ </para>
+
+ <para>
+ You can add packages using a similar approach through the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CORE_IMAGE_EXTRA_INSTALL'>CORE_IMAGE_EXTRA_INSTALL</ulink></filename>
+ variable.
+ If you use this variable, only
+ <filename>core-image-*</filename> images are affected.
+ </para>
+ </section>
+
+ <section id='usingpoky-extend-customimage-imagefeatures'>
+ <title>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and
+ <filename>EXTRA_IMAGE_FEATURES</filename></title>
+
+ <para>
+ Another method for customizing your image is to enable or
+ disable high-level image features by using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
+ variables.
+ Although the functions for both variables are nearly equivalent,
+ best practices dictate using <filename>IMAGE_FEATURES</filename>
+ from within a recipe and using
+ <filename>EXTRA_IMAGE_FEATURES</filename> from within
+ your <filename>local.conf</filename> file, which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para>
+
+ <para>
+ To understand how these features work, the best reference is
+ <filename>meta/classes/core-image.bbclass</filename>.
+ This class lists out the available
+ <filename>IMAGE_FEATURES</filename> of which most map to
+ package groups while some, such as
+ <filename>debug-tweaks</filename> and
+ <filename>read-only-rootfs</filename>, resolve as general
+ configuration settings.
+ </para>
+
+ <para>
+ In summary, the file looks at the contents of the
+ <filename>IMAGE_FEATURES</filename> variable and then maps
+ or configures the feature accordingly.
+ Based on this information, the build system automatically
+ adds the appropriate packages or configurations to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
+ variable.
+ Effectively, you are enabling extra features by extending the
+ class or creating a custom class for use with specialized image
+ <filename>.bb</filename> files.
+ </para>
+
+ <para>
+ Use the <filename>EXTRA_IMAGE_FEATURES</filename> variable
+ from within your local configuration file.
+ Using a separate area from which to enable features with
+ this variable helps you avoid overwriting the features in the
+ image recipe that are enabled with
+ <filename>IMAGE_FEATURES</filename>.
+ The value of <filename>EXTRA_IMAGE_FEATURES</filename> is added
+ to <filename>IMAGE_FEATURES</filename> within
+ <filename>meta/conf/bitbake.conf</filename>.
+ </para>
+
+ <para>
+ To illustrate how you can use these variables to modify your
+ image, consider an example that selects the SSH server.
+ The Yocto Project ships with two SSH servers you can use
+ with your images: Dropbear and OpenSSH.
+ Dropbear is a minimal SSH server appropriate for
+ resource-constrained environments, while OpenSSH is a
+ well-known standard SSH server implementation.
+ By default, the <filename>core-image-sato</filename> image
+ is configured to use Dropbear.
+ The <filename>core-image-full-cmdline</filename> and
+ <filename>core-image-lsb</filename> images both
+ include OpenSSH.
+ The <filename>core-image-minimal</filename> image does not
+ contain an SSH server.
+ </para>
+
+ <para>
+ You can customize your image and change these defaults.
+ Edit the <filename>IMAGE_FEATURES</filename> variable
+ in your recipe or use the
+ <filename>EXTRA_IMAGE_FEATURES</filename> in your
+ <filename>local.conf</filename> file so that it configures the
+ image you are working with to include
+ <filename>ssh-server-dropbear</filename> or
+ <filename>ssh-server-openssh</filename>.
+ </para>
+
+ <note>
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ section in the Yocto Project Reference Manual for a complete
+ list of image features that ship with the Yocto Project.
+ </note>
+ </section>
+
+ <section id='usingpoky-extend-customimage-custombb'>
+ <title>Customizing Images Using Custom .bb Files</title>
+
+ <para>
+ You can also customize an image by creating a custom recipe
+ that defines additional software as part of the image.
+ The following example shows the form for the two lines you need:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2"
+
+ inherit core-image
+ </literallayout>
+ </para>
+
+ <para>
+ Defining the software using a custom recipe gives you total
+ control over the contents of the image.
+ It is important to use the correct names of packages in the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>
+ variable.
+ You must use the OpenEmbedded notation and not the Debian notation for the names
+ (e.g. <filename>glibc-dev</filename> instead of <filename>libc6-dev</filename>).
+ </para>
+
+ <para>
+ The other method for creating a custom image is to base it on an existing image.
+ For example, if you want to create an image based on <filename>core-image-sato</filename>
+ but add the additional package <filename>strace</filename> to the image,
+ copy the <filename>meta/recipes-sato/images/core-image-sato.bb</filename> to a
+ new <filename>.bb</filename> and add the following line to the end of the copy:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL += "strace"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='usingpoky-extend-customimage-customtasks'>
+ <title>Customizing Images Using Custom Package Groups</title>
+
+ <para>
+ For complex custom images, the best approach for customizing
+ an image is to create a custom package group recipe that is
+ used to build the image or images.
+ A good example of a package group recipe is
+ <filename>meta/recipes-core/packagegroups/packagegroup-base.bb</filename>.
+ </para>
+
+ <para>
+ If you examine that recipe, you see that the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename>
+ variable lists the package group packages to produce.
+ The <filename>inherit packagegroup</filename> statement
+ sets appropriate default values and automatically adds
+ <filename>-dev</filename>, <filename>-dbg</filename>, and
+ <filename>-ptest</filename> complementary packages for each
+ package specified in the <filename>PACKAGES</filename>
+ statement.
+ <note>
+ The <filename>inherit packages</filename> should be
+ located near the top of the recipe, certainly before
+ the <filename>PACKAGES</filename> statement.
+ </note>
+ </para>
+
+ <para>
+ For each package you specify in <filename>PACKAGES</filename>,
+ you can use
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'>RDEPENDS</ulink></filename>
+ and
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'>RRECOMMENDS</ulink></filename>
+ entries to provide a list of packages the parent task package
+ should contain.
+ You can see examples of these further down in the
+ <filename>packagegroup-base.bb</filename> recipe.
+ </para>
+
+ <para>
+ Here is a short, fabricated example showing the same basic
+ pieces:
+ <literallayout class='monospaced'>
+ DESCRIPTION = "My Custom Package Groups"
+
+ inherit packagegroup
+
+ PACKAGES = "\
+ packagegroup-custom-apps \
+ packagegroup-custom-tools \
+ "
+
+ RDEPENDS_packagegroup-custom-apps = "\
+ dropbear \
+ portmap \
+ psplash"
+
+ RDEPENDS_packagegroup-custom-tools = "\
+ oprofile \
+ oprofileui-server \
+ lttng-tools"
+
+ RRECOMMENDS_packagegroup-custom-tools = "\
+ kernel-module-oprofile"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, two package group packages are created with their dependencies and their
+ recommended package dependencies listed: <filename>packagegroup-custom-apps</filename>, and
+ <filename>packagegroup-custom-tools</filename>.
+ To build an image using these package group packages, you need to add
+ <filename>packagegroup-custom-apps</filename> and/or
+ <filename>packagegroup-custom-tools</filename> to
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'>IMAGE_INSTALL</ulink></filename>.
+ For other forms of image dependencies see the other areas of this section.
+ </para>
+ </section>
+
+ <section id='usingpoky-extend-customimage-image-name'>
+ <title>Customizing an Image Hostname</title>
+
+ <para>
+ By default, the configured hostname (i.e.
+ <filename>/etc/hostname</filename>) in an image is the
+ same as the machine name.
+ For example, if
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ equals "qemux86", the configured hostname written to
+ <filename>/etc/hostname</filename> is "qemux86".
+ </para>
+
+ <para>
+ You can customize this name by altering the value of the
+ "hostname" variable in the
+ <filename>base-files</filename> recipe using either
+ an append file or a configuration file.
+ Use the following in an append file:
+ <literallayout class='monospaced'>
+ hostname="myhostname"
+ </literallayout>
+ Use the following in a configuration file:
+ <literallayout class='monospaced'>
+ hostname_pn-base-files = "myhostname"
+ </literallayout>
+ </para>
+
+ <para>
+ Changing the default value of the variable "hostname" can be
+ useful in certain situations.
+ For example, suppose you need to do extensive testing on an
+ image and you would like to easily identify the image
+ under test from existing images with typical default
+ hostnames.
+ In this situation, you could change the default hostname to
+ "testme", which results in all the images using the name
+ "testme".
+ Once testing is complete and you do not need to rebuild the
+ image for test any longer, you can easily reset the default
+ hostname.
+ </para>
+
+ <para>
+ Another point of interest is that if you unset the variable,
+ the image will have no default hostname in the filesystem.
+ Here is an example that unsets the variable in a
+ configuration file:
+ <literallayout class='monospaced'>
+ hostname_pn-base-files = ""
+ </literallayout>
+ Having no default hostname in the filesystem is suitable for
+ environments that use dynamic hostnames such as virtual
+ machines.
+ </para>
+ </section>
+ </section>
+
+ <section id='new-recipe-writing-a-new-recipe'>
+ <title>Writing a New Recipe</title>
+
+ <para>
+ Recipes (<filename>.bb</filename> files) are fundamental components
+ in the Yocto Project environment.
+ Each software component built by the OpenEmbedded build system
+ requires a recipe to define the component.
+ This section describes how to create, write, and test a new
+ recipe.
+ <note>
+ For information on variables that are useful for recipes and
+ for information about recipe naming issues, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-varlocality-recipe-required'>Required</ulink>"
+ section of the Yocto Project Reference Manual.
+ </note>
+ </para>
+
+ <section id='new-recipe-overview'>
+ <title>Overview</title>
+
+ <para>
+ The following figure shows the basic process for creating a
+ new recipe.
+ The remainder of the section provides details for the steps.
+ <imagedata fileref="figures/recipe-workflow.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+ </section>
+
+ <section id='new-recipe-locate-or-automatically-create-a-base-recipe'>
+ <title>Locate or Automatically Create a Base Recipe</title>
+
+ <para>
+ You can always write a recipe from scratch.
+ However, three choices exist that can help you quickly get a
+ start on a new recipe:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>devtool add</filename>:</emphasis>
+ A command that assists in creating a recipe and
+ an environment conducive to development.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>recipetool create</filename>:</emphasis>
+ A command provided by the Yocto Project that automates
+ creation of a base recipe based on the source
+ files.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Existing Recipes:</emphasis>
+ Location and modification of an existing recipe that is
+ similar in function to the recipe you need.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ For information on recipe syntax, see the
+ "<link linkend='recipe-syntax'>Recipe Syntax</link>"
+ section.
+ </note>
+ </para>
+
+ <section id='new-recipe-creating-the-base-recipe-using-devtool'>
+ <title>Creating the Base Recipe Using <filename>devtool add</filename></title>
+
+ <para>
+ The <filename>devtool add</filename> command uses the same
+ logic for auto-creating the recipe as
+ <filename>recipetool create</filename>, which is listed
+ below.
+ Additionally, however, <filename>devtool add</filename>
+ sets up an environment that makes it easy for you to
+ patch the source and to make changes to the recipe as
+ is often necessary when adding a recipe to build a new
+ piece of software to be included in a build.
+ </para>
+
+ <para>
+ You can find a complete description of the
+ <filename>devtool add</filename> command in the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-a-closer-look-at-devtool-add'>A Closer Look at <filename>devtool</filename> add</ulink>"
+ section in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK) manual.
+ </para>
+ </section>
+
+ <section id='new-recipe-creating-the-base-recipe-using-recipetool'>
+ <title>Creating the Base Recipe Using <filename>recipetool create</filename></title>
+
+ <para>
+ <filename>recipetool create</filename> automates creation
+ of a base recipe given a set of source code files.
+ As long as you can extract or point to the source files,
+ the tool will construct a recipe and automatically
+ configure all pre-build information into the recipe.
+ For example, suppose you have an application that builds
+ using Autotools.
+ Creating the base recipe using
+ <filename>recipetool</filename> results in a recipe
+ that has the pre-build dependencies, license requirements,
+ and checksums configured.
+ </para>
+
+ <para>
+ To run the tool, you just need to be in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ and have sourced the build environment setup script
+ (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>).
+ To get help on the tool, use the following command:
+ <literallayout class='monospaced'>
+ $ recipetool -h
+ NOTE: Starting bitbake server...
+ usage: recipetool [-d] [-q] [--color COLOR] [-h] &lt;subcommand&gt; ...
+
+ OpenEmbedded recipe tool
+
+ options:
+ -d, --debug Enable debug output
+ -q, --quiet Print only errors
+ --color COLOR Colorize output (where COLOR is auto, always, never)
+ -h, --help show this help message and exit
+
+ subcommands:
+ create Create a new recipe
+ newappend Create a bbappend for the specified target in the specified
+ layer
+ setvar Set a variable within a recipe
+ appendfile Create/update a bbappend to replace a target file
+ appendsrcfiles Create/update a bbappend to add or replace source files
+ appendsrcfile Create/update a bbappend to add or replace a source file
+ Use recipetool &lt;subcommand&gt; --help to get help on a specific command
+ </literallayout>
+ </para>
+
+ <para>
+ Running
+ <filename>recipetool create -o</filename>&nbsp;<replaceable>OUTFILE</replaceable>
+ creates the base recipe and locates it properly in the
+ layer that contains your source files.
+ Following are some syntax examples:
+ </para>
+
+ <para>
+ Use this syntax to generate a recipe based on
+ <replaceable>source</replaceable>.
+ Once generated, the recipe resides in the existing source
+ code layer:
+ <literallayout class='monospaced'>
+ recipetool create -o <replaceable>OUTFILE</replaceable>&nbsp;<replaceable>source</replaceable>
+ </literallayout>
+ Use this syntax to generate a recipe using code that you
+ extract from <replaceable>source</replaceable>.
+ The extracted code is placed in its own layer defined
+ by <replaceable>EXTERNALSRC</replaceable>.
+ <literallayout class='monospaced'>
+ recipetool create -o <replaceable>OUTFILE</replaceable> -x <replaceable>EXTERNALSRC</replaceable> <replaceable>source</replaceable>
+ </literallayout>
+ Use this syntax to generate a recipe based on
+ <replaceable>source</replaceable>.
+ The options direct <filename>recipetool</filename> to
+ generate debugging information.
+ Once generated, the recipe resides in the existing source
+ code layer:
+ <literallayout class='monospaced'>
+ recipetool create -d -o <replaceable>OUTFILE</replaceable> <replaceable>source</replaceable>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='new-recipe-locating-and-using-a-similar-recipe'>
+ <title>Locating and Using a Similar Recipe</title>
+
+ <para>
+ Before writing a recipe from scratch, it is often useful to
+ discover whether someone else has already written one that
+ meets (or comes close to meeting) your needs.
+ The Yocto Project and OpenEmbedded communities maintain many
+ recipes that might be candidates for what you are doing.
+ You can find a good central index of these recipes in the
+ <ulink url='http://layers.openembedded.org'>OpenEmbedded Layer Index</ulink>.
+ </para>
+
+ <para>
+ Working from an existing recipe or a skeleton recipe is the
+ best way to get started.
+ Here are some points on both methods:
+ <itemizedlist>
+ <listitem><para><emphasis>Locate and modify a recipe that
+ is close to what you want to do:</emphasis>
+ This method works when you are familiar with the
+ current recipe space.
+ The method does not work so well for those new to
+ the Yocto Project or writing recipes.</para>
+ <para>Some risks associated with this method are
+ using a recipe that has areas totally unrelated to
+ what you are trying to accomplish with your recipe,
+ not recognizing areas of the recipe that you might
+ have to add from scratch, and so forth.
+ All these risks stem from unfamiliarity with the
+ existing recipe space.</para></listitem>
+ <listitem><para><emphasis>Use and modify the following
+ skeleton recipe:</emphasis>
+ If for some reason you do not want to use
+ <filename>recipetool</filename> and you cannot
+ find an existing recipe that is close to meeting
+ your needs, you can use the following structure to
+ provide the fundamental areas of a new recipe.
+ <literallayout class='monospaced'>
+ DESCRIPTION = ""
+ HOMEPAGE = ""
+ LICENSE = ""
+ SECTION = ""
+ DEPENDS = ""
+ LIC_FILES_CHKSUM = ""
+
+ SRC_URI = ""
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='new-recipe-storing-and-naming-the-recipe'>
+ <title>Storing and Naming the Recipe</title>
+
+ <para>
+ Once you have your base recipe, you should put it in your
+ own layer and name it appropriately.
+ Locating it correctly ensures that the OpenEmbedded build
+ system can find it when you use BitBake to process the
+ recipe.
+ </para>
+
+ <itemizedlist>
+ <listitem><para><emphasis>Storing Your Recipe:</emphasis>
+ The OpenEmbedded build system locates your recipe
+ through the layer's <filename>conf/layer.conf</filename>
+ file and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBFILES'><filename>BBFILES</filename></ulink>
+ variable.
+ This variable sets up a path from which the build system can
+ locate recipes.
+ Here is the typical use:
+ <literallayout class='monospaced'>
+ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+ </literallayout>
+ Consequently, you need to be sure you locate your new recipe
+ inside your layer such that it can be found.</para>
+ <para>You can find more information on how layers are
+ structured in the
+ "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>"
+ section.</para></listitem>
+ <listitem><para><emphasis>Naming Your Recipe:</emphasis>
+ When you name your recipe, you need to follow this naming
+ convention:
+ <literallayout class='monospaced'>
+ <replaceable>basename</replaceable>_<replaceable>version</replaceable>.bb
+ </literallayout>
+ Use lower-cased characters and do not include the reserved
+ suffixes <filename>-native</filename>,
+ <filename>-cross</filename>, <filename>-initial</filename>,
+ or <filename>-dev</filename> casually (i.e. do not use them
+ as part of your recipe name unless the string applies).
+ Here are some examples:
+ <literallayout class='monospaced'>
+ cups_1.7.0.bb
+ gawk_4.0.2.bb
+ irssi_0.8.16-rc1.bb
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </section>
+
+ <section id='new-recipe-running-a-build-on-the-recipe'>
+ <title>Running a Build on the Recipe</title>
+
+ <para>
+ Creating a new recipe is usually an iterative process that
+ requires using BitBake to process the recipe multiple times in
+ order to progressively discover and add information to the
+ recipe file.
+ </para>
+
+ <para>
+ Assuming you have sourced the build environment setup script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>)
+ and you are in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ use BitBake to process your recipe.
+ All you need to provide is the
+ <filename><replaceable>basename</replaceable></filename> of the recipe as described
+ in the previous section:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>basename</replaceable>
+ </literallayout>
+
+ </para>
+
+ <para>
+ During the build, the OpenEmbedded build system creates a
+ temporary work directory for each recipe
+ (<filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>)
+ where it keeps extracted source files, log files, intermediate
+ compilation and packaging files, and so forth.
+ </para>
+
+ <para>
+ The path to the per-recipe temporary work directory depends
+ on the context in which it is being built.
+ The quickest way to find this path is to have BitBake return it
+ by running the following:
+ <literallayout class='monospaced'>
+ $ bitbake -e <replaceable>basename</replaceable> | grep ^WORKDIR=
+ </literallayout>
+ As an example, assume a Source Directory top-level folder named
+ <filename>poky</filename>, a default Build Directory at
+ <filename>poky/build</filename>, and a
+ <filename>qemux86-poky-linux</filename> machine target system.
+ Furthermore, suppose your recipe is named
+ <filename>foo_1.3.0.bb</filename>.
+ In this case, the work directory the build system uses to
+ build the package would be as follows:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
+ </literallayout>
+ Inside this directory you can find sub-directories such as
+ <filename>image</filename>, <filename>packages-split</filename>,
+ and <filename>temp</filename>.
+ After the build, you can examine these to determine how well
+ the build went.
+ <note>
+ You can find log files for each task in the recipe's
+ <filename>temp</filename> directory (e.g.
+ <filename>poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0/temp</filename>).
+ Log files are named <filename>log.<replaceable>taskname</replaceable></filename>
+ (e.g. <filename>log.do_configure</filename>,
+ <filename>log.do_fetch</filename>, and
+ <filename>log.do_compile</filename>).
+ </note>
+ </para>
+
+ <para>
+ You can find more information about the build process in
+ "<ulink url='&YOCTO_DOCS_OM_URL;#overview-development-environment'>The Yocto Project Development Environment</ulink>"
+ chapter of the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='new-recipe-fetching-code'>
+ <title>Fetching Code</title>
+
+ <para>
+ The first thing your recipe must do is specify how to fetch
+ the source files.
+ Fetching is controlled mainly through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable.
+ Your recipe must have a <filename>SRC_URI</filename> variable
+ that points to where the source is located.
+ For a graphical representation of source locations, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#sources-dev-environment'>Sources</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
+ task uses the prefix of each entry in the
+ <filename>SRC_URI</filename> variable value to determine which
+ fetcher to use to get your source files.
+ It is the <filename>SRC_URI</filename> variable that triggers
+ the fetcher.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ task uses the variable after source is fetched to apply
+ patches.
+ The OpenEmbedded build system uses
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESOVERRIDES'><filename>FILESOVERRIDES</filename></ulink>
+ for scanning directory locations for local files in
+ <filename>SRC_URI</filename>.
+ </para>
+
+ <para>
+ The <filename>SRC_URI</filename> variable in your recipe must
+ define each unique location for your source files.
+ It is good practice to not hard-code pathnames in an URL used
+ in <filename>SRC_URI</filename>.
+ Rather than hard-code these paths, use
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink><filename>}</filename>,
+ which causes the fetch process to use the version specified in
+ the recipe filename.
+ Specifying the version in this manner means that upgrading the
+ recipe to a future version is as simple as renaming the recipe
+ to match the new version.
+ </para>
+
+ <para>
+ Here is a simple example from the
+ <filename>meta/recipes-devtools/cdrtools/cdrtools-native_3.01a20.bb</filename>
+ recipe where the source comes from a single tarball.
+ Notice the use of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ variable:
+ <literallayout class='monospaced'>
+ SRC_URI = "ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-${PV}.tar.bz2"
+ </literallayout>
+ </para>
+
+ <para>
+ Files mentioned in <filename>SRC_URI</filename> whose names end
+ in a typical archive extension (e.g. <filename>.tar</filename>,
+ <filename>.tar.gz</filename>, <filename>.tar.bz2</filename>,
+ <filename>.zip</filename>, and so forth), are automatically
+ extracted during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>
+ task.
+ For another example that specifies these types of files, see
+ the
+ "<link linkend='new-recipe-autotooled-package'>Autotooled Package</link>"
+ section.
+ </para>
+
+ <para>
+ Another way of specifying source is from an SCM.
+ For Git repositories, you must specify
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ and you should specify
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ to include the revision with
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>.
+ Here is an example from the recipe
+ <filename>meta/recipes-kernel/blktrace/blktrace_git.bb</filename>:
+ <literallayout class='monospaced'>
+ SRCREV = "d6918c8832793b4205ed3bfede78c2f915c23385"
+
+ PR = "r6"
+ PV = "1.0.5+git${SRCPV}"
+
+ SRC_URI = "git://git.kernel.dk/blktrace.git \
+ file://ldflags.patch"
+ </literallayout>
+ </para>
+
+ <para>
+ If your <filename>SRC_URI</filename> statement includes
+ URLs pointing to individual files fetched from a remote server
+ other than a version control system, BitBake attempts to
+ verify the files against checksums defined in your recipe to
+ ensure they have not been tampered with or otherwise modified
+ since the recipe was written.
+ Two checksums are used:
+ <filename>SRC_URI[md5sum]</filename> and
+ <filename>SRC_URI[sha256sum]</filename>.
+ </para>
+
+ <para>
+ If your <filename>SRC_URI</filename> variable points to
+ more than a single URL (excluding SCM URLs), you need to
+ provide the <filename>md5</filename> and
+ <filename>sha256</filename> checksums for each URL.
+ For these cases, you provide a name for each URL as part of
+ the <filename>SRC_URI</filename> and then reference that name
+ in the subsequent checksum statements.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \
+ ${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.diff.gz;name=patch"
+
+ SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
+ SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
+
+ SRC_URI[patch.md5sum] = "57e1b689264ea80f78353519eece0c92"
+ SRC_URI[patch.sha256sum] = "7905ff96be93d725544d0040e425c42f9c05580db3c272f11cff75b9aa89d430"
+ </literallayout>
+ </para>
+
+ <para>
+ Proper values for <filename>md5</filename> and
+ <filename>sha256</filename> checksums might be available
+ with other signatures on the download page for the upstream
+ source (e.g. <filename>md5</filename>,
+ <filename>sha1</filename>, <filename>sha256</filename>,
+ <filename>GPG</filename>, and so forth).
+ Because the OpenEmbedded build system only deals with
+ <filename>sha256sum</filename> and <filename>md5sum</filename>,
+ you should verify all the signatures you find by hand.
+ </para>
+
+ <para>
+ If no <filename>SRC_URI</filename> checksums are specified
+ when you attempt to build the recipe, or you provide an
+ incorrect checksum, the build will produce an error for each
+ missing or incorrect checksum.
+ As part of the error message, the build system provides
+ the checksum string corresponding to the fetched file.
+ Once you have the correct checksums, you can copy and paste
+ them into your recipe and then run the build again to continue.
+ <note>
+ As mentioned, if the upstream source provides signatures
+ for verifying the downloaded source code, you should
+ verify those manually before setting the checksum values
+ in the recipe and continuing with the build.
+ </note>
+ </para>
+
+ <para>
+ This final example is a bit more complicated and is from the
+ <filename>meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb</filename>
+ recipe.
+ The example's <filename>SRC_URI</filename> statement identifies
+ multiple files as the source files for the recipe: a tarball, a
+ patch file, a desktop file, and an icon.
+ <literallayout class='monospaced'>
+ SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2 \
+ file://xwc.patch \
+ file://rxvt.desktop \
+ file://rxvt.png"
+ </literallayout>
+ </para>
+
+ <para>
+ When you specify local files using the
+ <filename>file://</filename> URI protocol, the build system
+ fetches files from the local machine.
+ The path is relative to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable and searches specific directories in a certain order:
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink><filename>}</filename>,
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}</filename>,
+ and <filename>files</filename>.
+ The directories are assumed to be subdirectories of the
+ directory in which the recipe or append file resides.
+ For another example that specifies these types of files, see the
+ "<link linkend='new-recipe-single-c-file-package-hello-world'>Single .c File Package (Hello World!)</link>"
+ section.
+ </para>
+
+ <para>
+ The previous example also specifies a patch file.
+ Patch files are files whose names usually end in
+ <filename>.patch</filename> or <filename>.diff</filename> but
+ can end with compressed suffixes such as
+ <filename>diff.gz</filename> and
+ <filename>patch.bz2</filename>, for example.
+ The build system automatically applies patches as described
+ in the
+ "<link linkend='new-recipe-patching-code'>Patching Code</link>" section.
+ </para>
+ </section>
+
+ <section id='new-recipe-unpacking-code'>
+ <title>Unpacking Code</title>
+
+ <para>
+ During the build, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>
+ task unpacks the source with
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>
+ pointing to where it is unpacked.
+ </para>
+
+ <para>
+ If you are fetching your source files from an upstream source
+ archived tarball and the tarball's internal structure matches
+ the common convention of a top-level subdirectory named
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink><filename>}-${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink><filename>}</filename>,
+ then you do not need to set <filename>S</filename>.
+ However, if <filename>SRC_URI</filename> specifies to fetch
+ source from an archive that does not use this convention,
+ or from an SCM like Git or Subversion, your recipe needs to
+ define <filename>S</filename>.
+ </para>
+
+ <para>
+ If processing your recipe using BitBake successfully unpacks
+ the source files, you need to be sure that the directory
+ pointed to by <filename>${S}</filename> matches the structure
+ of the source.
+ </para>
+ </section>
+
+ <section id='new-recipe-patching-code'>
+ <title>Patching Code</title>
+
+ <para>
+ Sometimes it is necessary to patch code after it has been
+ fetched.
+ Any files mentioned in <filename>SRC_URI</filename> whose
+ names end in <filename>.patch</filename> or
+ <filename>.diff</filename> or compressed versions of these
+ suffixes (e.g. <filename>diff.gz</filename> are treated as
+ patches.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ task automatically applies these patches.
+ </para>
+
+ <para>
+ The build system should be able to apply patches with the "-p1"
+ option (i.e. one directory level in the path will be stripped
+ off).
+ If your patch needs to have more directory levels stripped off,
+ specify the number of levels using the "striplevel" option in
+ the <filename>SRC_URI</filename> entry for the patch.
+ Alternatively, if your patch needs to be applied in a specific
+ subdirectory that is not specified in the patch file, use the
+ "patchdir" option in the entry.
+ </para>
+
+ <para>
+ As with all local files referenced in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ using <filename>file://</filename>, you should place
+ patch files in a directory next to the recipe either
+ named the same as the base name of the recipe
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink>)
+ or "files".
+ </para>
+ </section>
+
+ <section id='new-recipe-licensing'>
+ <title>Licensing</title>
+
+ <para>
+ Your recipe needs to have both the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink>
+ variables:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>LICENSE</filename>:</emphasis>
+ This variable specifies the license for the software.
+ If you do not know the license under which the software
+ you are building is distributed, you should go to the
+ source code and look for that information.
+ Typical files containing this information include
+ <filename>COPYING</filename>,
+ <filename>LICENSE</filename>, and
+ <filename>README</filename> files.
+ You could also find the information near the top of
+ a source file.
+ For example, given a piece of software licensed under
+ the GNU General Public License version 2, you would
+ set <filename>LICENSE</filename> as follows:
+ <literallayout class='monospaced'>
+ LICENSE = "GPLv2"
+ </literallayout></para>
+ <para>The licenses you specify within
+ <filename>LICENSE</filename> can have any name as long
+ as you do not use spaces, since spaces are used as
+ separators between license names.
+ For standard licenses, use the names of the files in
+ <filename>meta/files/common-licenses/</filename>
+ or the <filename>SPDXLICENSEMAP</filename> flag names
+ defined in <filename>meta/conf/licenses.conf</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>LIC_FILES_CHKSUM</filename>:</emphasis>
+ The OpenEmbedded build system uses this variable to
+ make sure the license text has not changed.
+ If it has, the build produces an error and it affords
+ you the chance to figure it out and correct the problem.
+ </para>
+ <para>You need to specify all applicable licensing
+ files for the software.
+ At the end of the configuration step, the build process
+ will compare the checksums of the files to be sure
+ the text has not changed.
+ Any differences result in an error with the message
+ containing the current checksum.
+ For more explanation and examples of how to set the
+ <filename>LIC_FILES_CHKSUM</filename> variable, see the
+ "<link link='usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</link>"
+ section.</para>
+
+ <para>To determine the correct checksum string, you
+ can list the appropriate files in the
+ <filename>LIC_FILES_CHKSUM</filename> variable with
+ incorrect md5 strings, attempt to build the software,
+ and then note the resulting error messages that will
+ report the correct md5 strings.
+ See the
+ "<link linkend='new-recipe-fetching-code'>Fetching Code</link>"
+ section for additional information.
+ </para>
+
+ <para>
+ Here is an example that assumes the software has a
+ <filename>COPYING</filename> file:
+ <literallayout class='monospaced'>
+ LIC_FILES_CHKSUM = "file://COPYING;md5=xxx"
+ </literallayout>
+ When you try to build the software, the build system
+ will produce an error and give you the correct string
+ that you can substitute into the recipe file for a
+ subsequent build.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+<!--
+
+ <para>
+ For trying this out I created a new recipe named
+ <filename>htop_1.0.2.bb</filename> and put it in
+ <filename>poky/meta/recipes-extended/htop</filename>.
+ There are two license type statements in my very simple
+ recipe:
+ <literallayout class='monospaced'>
+ LICENSE = ""
+
+ LIC_FILES_CHKSUM = ""
+
+ SRC_URI[md5sum] = ""
+ SRC_URI[sha256sum] = ""
+ </literallayout>
+ Evidently, you need to run a <filename>bitbake -c cleanall htop</filename>.
+ Next, you delete or comment out the two <filename>SRC_URI</filename>
+ lines at the end and then attempt to build the software with
+ <filename>bitbake htop</filename>.
+ Doing so causes BitBake to report some errors and and give
+ you the actual strings you need for the last two
+ <filename>SRC_URI</filename> lines.
+ Prior to this, you have to dig around in the home page of the
+ source for <filename>htop</filename> and determine that the
+ software is released under GPLv2.
+ You can provide that in the <filename>LICENSE</filename>
+ statement.
+ Now you edit your recipe to have those two strings for
+ the <filename>SRC_URI</filename> statements:
+ <literallayout class='monospaced'>
+ LICENSE = "GPLv2"
+
+ LIC_FILES_CHKSUM = ""
+
+ SRC_URI = "${SOURCEFORGE_MIRROR}/htop/htop-${PV}.tar.gz"
+ SRC_URI[md5sum] = "0d01cca8df3349c74569cefebbd9919e"
+ SRC_URI[sha256sum] = "ee60657b044ece0df096c053060df7abf3cce3a568ab34d260049e6a37ccd8a1"
+ </literallayout>
+ At this point, you can build the software again using the
+ <filename>bitbake htop</filename> command.
+ There is just a set of errors now associated with the
+ empty <filename>LIC_FILES_CHKSUM</filename> variable now.
+ </para>
+-->
+
+ </section>
+
+ <section id='new-dependencies'>
+ <title>Dependencies</title>
+
+ <para>
+ Most software packages have a short list of other packages
+ that they require, which are called dependencies.
+ These dependencies fall into two main categories: build-time
+ dependencies, which are required when the software is built;
+ and runtime dependencies, which are required to be installed
+ on the target in order for the software to run.
+ </para>
+
+ <para>
+ Within a recipe, you specify build-time dependencies using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable.
+ Although nuances exist, items specified in
+ <filename>DEPENDS</filename> should be names of other recipes.
+ It is important that you specify all build-time dependencies
+ explicitly.
+ If you do not, due to the parallel nature of BitBake's
+ execution, you can end up with a race condition where the
+ dependency is present for one task of a recipe (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>)
+ and then gone when the next task runs (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>).
+ </para>
+
+ <para>
+ Another consideration is that configure scripts might
+ automatically check for optional dependencies and enable
+ corresponding functionality if those dependencies are found.
+ This behavior means that to ensure deterministic results and
+ thus avoid more race conditions, you need to either explicitly
+ specify these dependencies as well, or tell the configure
+ script explicitly to disable the functionality.
+ If you wish to make a recipe that is more generally useful
+ (e.g. publish the recipe in a layer for others to use),
+ instead of hard-disabling the functionality, you can use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></ulink>
+ variable to allow functionality and the corresponding
+ dependencies to be enabled and disabled easily by other
+ users of the recipe.
+ </para>
+
+ <para>
+ Similar to build-time dependencies, you specify runtime
+ dependencies through a variable -
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>,
+ which is package-specific.
+ All variables that are package-specific need to have the name
+ of the package added to the end as an override.
+ Since the main package for a recipe has the same name as the
+ recipe, and the recipe's name can be found through the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
+ variable, then you specify the dependencies for the main
+ package by setting <filename>RDEPENDS_${PN}</filename>.
+ If the package were named <filename>${PN}-tools</filename>,
+ then you would set <filename>RDEPENDS_${PN}-tools</filename>,
+ and so forth.
+ </para>
+
+ <para>
+ Some runtime dependencies will be set automatically at
+ packaging time.
+ These dependencies include any shared library dependencies
+ (i.e. if a package "example" contains "libexample" and
+ another package "mypackage" contains a binary that links to
+ "libexample" then the OpenEmbedded build system will
+ automatically add a runtime dependency to "mypackage" on
+ "example").
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for
+ further details.
+ </para>
+ </section>
+
+ <section id='new-recipe-configuring-the-recipe'>
+ <title>Configuring the Recipe</title>
+
+ <para>
+ Most software provides some means of setting build-time
+ configuration options before compilation.
+ Typically, setting these options is accomplished by running a
+ configure script with some options, or by modifying a build
+ configuration file.
+ <note>
+ As of Yocto Project Release 1.7, some of the core recipes
+ that package binary configuration scripts now disable the
+ scripts due to the scripts previously requiring error-prone
+ path substitution.
+ The OpenEmbedded build system uses
+ <filename>pkg-config</filename> now, which is much more
+ robust.
+ You can find a list of the <filename>*-config</filename>
+ scripts that are disabled list in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#migration-1.7-binary-configuration-scripts-disabled'>Binary Configuration Scripts Disabled</ulink>"
+ section in the Yocto Project Reference Manual.
+ </note>
+ </para>
+
+ <para>
+ A major part of build-time configuration is about checking for
+ build-time dependencies and possibly enabling optional
+ functionality as a result.
+ You need to specify any build-time dependencies for the
+ software you are building in your recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ value, in terms of other recipes that satisfy those
+ dependencies.
+ You can often find build-time or runtime
+ dependencies described in the software's documentation.
+ </para>
+
+ <para>
+ The following list provides configuration items of note based
+ on how your software is built:
+ <itemizedlist>
+ <listitem><para><emphasis>Autotools:</emphasis>
+ If your source files have a
+ <filename>configure.ac</filename> file, then your
+ software is built using Autotools.
+ If this is the case, you just need to worry about
+ modifying the configuration.</para>
+ <para>When using Autotools, your recipe needs to inherit
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ class and your recipe does not have to contain a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ task.
+ However, you might still want to make some adjustments.
+ For example, you can set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ to pass any needed configure options that are specific
+ to the recipe.</para></listitem>
+ <listitem><para><emphasis>CMake:</emphasis>
+ If your source files have a
+ <filename>CMakeLists.txt</filename> file, then your
+ software is built using CMake.
+ If this is the case, you just need to worry about
+ modifying the configuration.</para>
+ <para>When you use CMake, your recipe needs to inherit
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink>
+ class and your recipe does not have to contain a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ task.
+ You can make some adjustments by setting
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink>
+ to pass any needed configure options that are specific
+ to the recipe.</para></listitem>
+ <listitem><para><emphasis>Other:</emphasis>
+ If your source files do not have a
+ <filename>configure.ac</filename> or
+ <filename>CMakeLists.txt</filename> file, then your
+ software is built using some method other than Autotools
+ or CMake.
+ If this is the case, you normally need to provide a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ task in your recipe
+ unless, of course, there is nothing to configure.
+ </para>
+ <para>Even if your software is not being built by
+ Autotools or CMake, you still might not need to deal
+ with any configuration issues.
+ You need to determine if configuration is even a required step.
+ You might need to modify a Makefile or some configuration file
+ used for the build to specify necessary build options.
+ Or, perhaps you might need to run a provided, custom
+ configure script with the appropriate options.</para>
+ <para>For the case involving a custom configure
+ script, you would run
+ <filename>./configure --help</filename> and look for
+ the options you need to set.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Once configuration succeeds, it is always good practice to
+ look at the <filename>log.do_configure</filename> file to
+ ensure that the appropriate options have been enabled and no
+ additional build-time dependencies need to be added to
+ <filename>DEPENDS</filename>.
+ For example, if the configure script reports that it found
+ something not mentioned in <filename>DEPENDS</filename>, or
+ that it did not find something that it needed for some
+ desired optional functionality, then you would need to add
+ those to <filename>DEPENDS</filename>.
+ Looking at the log might also reveal items being checked for,
+ enabled, or both that you do not want, or items not being found
+ that are in <filename>DEPENDS</filename>, in which case
+ you would need to look at passing extra options to the
+ configure script as needed.
+ For reference information on configure options specific to the
+ software you are building, you can consult the output of the
+ <filename>./configure --help</filename> command within
+ <filename>${S}</filename> or consult the software's upstream
+ documentation.
+ </para>
+ </section>
+
+ <section id='new-recipe-using-headers-to-interface-with-devices'>
+ <title>Using Headers to Interface with Devices</title>
+
+ <para>
+ If your recipe builds an application that needs to
+ communicate with some device or needs an API into a custom
+ kernel, you will need to provide appropriate header files.
+ Under no circumstances should you ever modify the existing
+ <filename>meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc</filename>
+ file.
+ These headers are used to build <filename>libc</filename> and
+ must not be compromised with custom or machine-specific
+ header information.
+ If you customize <filename>libc</filename> through modified
+ headers all other applications that use
+ <filename>libc</filename> thus become affected.
+ <note><title>Warning</title>
+ Never copy and customize the <filename>libc</filename>
+ header file (i.e.
+ <filename>meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc</filename>).
+ </note>
+ The correct way to interface to a device or custom kernel is
+ to use a separate package that provides the additional headers
+ for the driver or other unique interfaces.
+ When doing so, your application also becomes responsible for
+ creating a dependency on that specific provider.
+ </para>
+
+ <para>
+ Consider the following:
+ <itemizedlist>
+ <listitem><para>
+ Never modify
+ <filename>linux-libc-headers.inc</filename>.
+ Consider that file to be part of the
+ <filename>libc</filename> system, and not something
+ you use to access the kernel directly.
+ You should access <filename>libc</filename> through
+ specific <filename>libc</filename> calls.
+ </para></listitem>
+ <listitem><para>
+ Applications that must talk directly to devices
+ should either provide necessary headers themselves,
+ or establish a dependency on a special headers package
+ that is specific to that driver.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For example, suppose you want to modify an existing header
+ that adds I/O control or network support.
+ If the modifications are used by a small number programs,
+ providing a unique version of a header is easy and has little
+ impact.
+ When doing so, bear in mind the guidelines in the previous
+ list.
+ <note>
+ If for some reason your changes need to modify the behavior
+ of the <filename>libc</filename>, and subsequently all
+ other applications on the system, use a
+ <filename>.bbappend</filename> to modify the
+ <filename>linux-kernel-headers.inc</filename> file.
+ However, take care to not make the changes
+ machine specific.
+ </note>
+ </para>
+
+ <para>
+ Consider a case where your kernel is older and you need
+ an older <filename>libc</filename> ABI.
+ The headers installed by your recipe should still be a
+ standard mainline kernel, not your own custom one.
+ </para>
+
+ <para>
+ When you use custom kernel headers you need to get them from
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink>,
+ which is the directory with kernel headers that are
+ required to build out-of-tree modules.
+ Your recipe will also need the following:
+ <literallayout class='monospaced'>
+ do_configure[depends] += "virtual/kernel:do_shared_workdir"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='new-recipe-compilation'>
+ <title>Compilation</title>
+
+ <para>
+ During a build, the <filename>do_compile</filename> task
+ happens after source is fetched, unpacked, and configured.
+ If the recipe passes through <filename>do_compile</filename>
+ successfully, nothing needs to be done.
+ </para>
+
+ <para>
+ However, if the compile step fails, you need to diagnose the
+ failure.
+ Here are some common issues that cause failures.
+ <note>
+ For cases where improper paths are detected for
+ configuration files or for when libraries/headers cannot
+ be found, be sure you are using the more robust
+ <filename>pkg-config</filename>.
+ See the note in section
+ "<link linkend='new-recipe-configuring-the-recipe'>Configuring the Recipe</link>"
+ for additional information.
+ </note>
+ <itemizedlist>
+ <listitem><para><emphasis>Parallel build failures:</emphasis>
+ These failures manifest themselves as intermittent
+ errors, or errors reporting that a file or directory
+ that should be created by some other part of the build
+ process could not be found.
+ This type of failure can occur even if, upon inspection,
+ the file or directory does exist after the build has
+ failed, because that part of the build process happened
+ in the wrong order.</para>
+ <para>To fix the problem, you need to either satisfy
+ the missing dependency in the Makefile or whatever
+ script produced the Makefile, or (as a workaround)
+ set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink>
+ to an empty string:
+ <literallayout class='monospaced'>
+ PARALLEL_MAKE = ""
+ </literallayout></para>
+ <para>
+ For information on parallel Makefile issues, see the
+ "<link linkend='debugging-parallel-make-races'>Debugging Parallel Make Races</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Improper host path usage:</emphasis>
+ This failure applies to recipes building for the target
+ or <filename>nativesdk</filename> only.
+ The failure occurs when the compilation process uses
+ improper headers, libraries, or other files from the
+ host system when cross-compiling for the target.
+ </para>
+ <para>To fix the problem, examine the
+ <filename>log.do_compile</filename> file to identify
+ the host paths being used (e.g.
+ <filename>/usr/include</filename>,
+ <filename>/usr/lib</filename>, and so forth) and then
+ either add configure options, apply a patch, or do both.
+ </para></listitem>
+ <listitem><para><emphasis>Failure to find required
+ libraries/headers:</emphasis>
+ If a build-time dependency is missing because it has
+ not been declared in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>,
+ or because the dependency exists but the path used by
+ the build process to find the file is incorrect and the
+ configure step did not detect it, the compilation
+ process could fail.
+ For either of these failures, the compilation process
+ notes that files could not be found.
+ In these cases, you need to go back and add additional
+ options to the configure script as well as possibly
+ add additional build-time dependencies to
+ <filename>DEPENDS</filename>.</para>
+ <para>Occasionally, it is necessary to apply a patch
+ to the source to ensure the correct paths are used.
+ If you need to specify paths to find files staged
+ into the sysroot from other recipes, use the variables
+ that the OpenEmbedded build system provides
+ (e.g.
+ <filename>STAGING_BINDIR</filename>,
+ <filename>STAGING_INCDIR</filename>,
+ <filename>STAGING_DATADIR</filename>, and so forth).
+<!--
+ (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_BINDIR'><filename>STAGING_BINDIR</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_INCDIR'><filename>STAGING_INCDIR</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DATADIR'><filename>STAGING_DATADIR</filename></ulink>,
+ and so forth).
+-->
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='new-recipe-installing'>
+ <title>Installing</title>
+
+ <para>
+ During <filename>do_install</filename>, the task copies the
+ built files along with their hierarchy to locations that
+ would mirror their locations on the target device.
+ The installation process copies files from the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>,
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink><filename>}</filename>,
+ and
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>
+ directories to the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>
+ directory to create the structure as it should appear on the
+ target system.
+ </para>
+
+ <para>
+ How your software is built affects what you must do to be
+ sure your software is installed correctly.
+ The following list describes what you must do for installation
+ depending on the type of build system used by the software
+ being built:
+ <itemizedlist>
+ <listitem><para><emphasis>Autotools and CMake:</emphasis>
+ If the software your recipe is building uses Autotools
+ or CMake, the OpenEmbedded build
+ system understands how to install the software.
+ Consequently, you do not have to have a
+ <filename>do_install</filename> task as part of your
+ recipe.
+ You just need to make sure the install portion of the
+ build completes with no issues.
+ However, if you wish to install additional files not
+ already being installed by
+ <filename>make install</filename>, you should do this
+ using a <filename>do_install_append</filename> function
+ using the install command as described in
+ the "Manual" bulleted item later in this list.
+ </para></listitem>
+ <listitem><para><emphasis>Other (using
+ <filename>make install</filename>):</emphasis>
+ You need to define a
+ <filename>do_install</filename> function in your
+ recipe.
+ The function should call
+ <filename>oe_runmake install</filename> and will likely
+ need to pass in the destination directory as well.
+ How you pass that path is dependent on how the
+ <filename>Makefile</filename> being run is written
+ (e.g. <filename>DESTDIR=${D}</filename>,
+ <filename>PREFIX=${D}</filename>,
+ <filename>INSTALLROOT=${D}</filename>, and so forth).
+ </para>
+ <para>For an example recipe using
+ <filename>make install</filename>, see the
+ "<link linkend='new-recipe-makefile-based-package'>Makefile-Based Package</link>"
+ section.</para></listitem>
+ <listitem><para><emphasis>Manual:</emphasis>
+ You need to define a
+ <filename>do_install</filename> function in your
+ recipe.
+ The function must first use
+ <filename>install -d</filename> to create the
+ directories under
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>.
+ Once the directories exist, your function can use
+ <filename>install</filename> to manually install the
+ built software into the directories.</para>
+ <para>You can find more information on
+ <filename>install</filename> at
+ <ulink url='http://www.gnu.org/software/coreutils/manual/html_node/install-invocation.html'></ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For the scenarios that do not use Autotools or
+ CMake, you need to track the installation
+ and diagnose and fix any issues until everything installs
+ correctly.
+ You need to look in the default location of
+ <filename>${D}</filename>, which is
+ <filename>${WORKDIR}/image</filename>, to be sure your
+ files have been installed correctly.
+ </para>
+
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ During the installation process, you might need to
+ modify some of the installed files to suit the target
+ layout.
+ For example, you might need to replace hard-coded paths
+ in an initscript with values of variables provided by
+ the build system, such as replacing
+ <filename>/usr/bin/</filename> with
+ <filename>${bindir}</filename>.
+ If you do perform such modifications during
+ <filename>do_install</filename>, be sure to modify the
+ destination file after copying rather than before
+ copying.
+ Modifying after copying ensures that the build system
+ can re-execute <filename>do_install</filename> if
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <filename>oe_runmake install</filename>, which can be
+ run directly or can be run indirectly by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink>
+ classes, runs <filename>make install</filename> in
+ parallel.
+ Sometimes, a Makefile can have missing dependencies
+ between targets that can result in race conditions.
+ If you experience intermittent failures during
+ <filename>do_install</filename>, you might be able to
+ work around them by disabling parallel Makefile
+ installs by adding the following to the recipe:
+ <literallayout class='monospaced'>
+ PARALLEL_MAKEINST = ""
+ </literallayout>
+ See
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></ulink>
+ for additional information.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </section>
+
+ <section id='new-recipe-enabling-system-services'>
+ <title>Enabling System Services</title>
+
+ <para>
+ If you want to install a service, which is a process that
+ usually starts on boot and runs in the background, then
+ you must include some additional definitions in your recipe.
+ </para>
+
+ <para>
+ If you are adding services and the service initialization
+ script or the service file itself is not installed, you must
+ provide for that installation in your recipe using a
+ <filename>do_install_append</filename> function.
+ If your recipe already has a <filename>do_install</filename>
+ function, update the function near its end rather than
+ adding an additional <filename>do_install_append</filename>
+ function.
+ </para>
+
+ <para>
+ When you create the installation for your services, you need
+ to accomplish what is normally done by
+ <filename>make install</filename>.
+ In other words, make sure your installation arranges the output
+ similar to how it is arranged on the target system.
+ </para>
+
+ <para>
+ The OpenEmbedded build system provides support for starting
+ services two different ways:
+ <itemizedlist>
+ <listitem><para><emphasis>SysVinit:</emphasis>
+ SysVinit is a system and service manager that
+ manages the init system used to control the very basic
+ functions of your system.
+ The init program is the first program
+ started by the Linux kernel when the system boots.
+ Init then controls the startup, running and shutdown
+ of all other programs.</para>
+ <para>To enable a service using SysVinit, your recipe
+ needs to inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-update-rc.d'><filename>update-rc.d</filename></ulink>
+ class.
+ The class helps facilitate safely installing the
+ package on the target.</para>
+ <para>You will need to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_PACKAGES'><filename>INITSCRIPT_PACKAGES</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_NAME'><filename>INITSCRIPT_NAME</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITSCRIPT_PARAMS'><filename>INITSCRIPT_PARAMS</filename></ulink>
+ variables within your recipe.</para></listitem>
+ <listitem><para><emphasis>systemd:</emphasis>
+ System Management Daemon (systemd) was designed to
+ replace SysVinit and to provide
+ enhanced management of services.
+ For more information on systemd, see the systemd
+ homepage at
+ <ulink url='http://freedesktop.org/wiki/Software/systemd/'></ulink>.
+ </para>
+ <para>To enable a service using systemd, your recipe
+ needs to inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-systemd'><filename>systemd</filename></ulink>
+ class.
+ See the <filename>systemd.bbclass</filename> file
+ located in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='new-recipe-packaging'>
+ <title>Packaging</title>
+
+ <para>
+ Successful packaging is a combination of automated processes
+ performed by the OpenEmbedded build system and some
+ specific steps you need to take.
+ The following list describes the process:
+ <itemizedlist>
+ <listitem><para><emphasis>Splitting Files</emphasis>:
+ The <filename>do_package</filename> task splits the
+ files produced by the recipe into logical components.
+ Even software that produces a single binary might
+ still have debug symbols, documentation, and other
+ logical components that should be split out.
+ The <filename>do_package</filename> task ensures
+ that files are split up and packaged correctly.
+ </para></listitem>
+ <listitem><para><emphasis>Running QA Checks</emphasis>:
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-insane'><filename>insane</filename></ulink>
+ class adds a step to
+ the package generation process so that output quality
+ assurance checks are generated by the OpenEmbedded
+ build system.
+ This step performs a range of checks to be sure the
+ build's output is free of common problems that show
+ up during runtime.
+ For information on these checks, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-insane'><filename>insane</filename></ulink>
+ class and the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-qa-checks'>QA Error and Warning Messages</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Hand-Checking Your Packages</emphasis>:
+ After you build your software, you need to be sure
+ your packages are correct.
+ Examine the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/packages-split</filename>
+ directory and make sure files are where you expect
+ them to be.
+ If you discover problems, you can set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>,
+ <filename>do_install(_append)</filename>, and so forth as
+ needed.
+ </para></listitem>
+ <listitem><para><emphasis>Splitting an Application into Multiple Packages</emphasis>:
+ If you need to split an application into several
+ packages, see the
+ "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>"
+ section for an example.
+ </para></listitem>
+ <listitem><para><emphasis>Installing a Post-Installation Script</emphasis>:
+ For an example showing how to install a
+ post-installation script, see the
+ "<link linkend='new-recipe-post-installation-scripts'>Post-Installation Scripts</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Marking Package Architecture</emphasis>:
+ Depending on what your recipe is building and how it
+ is configured, it might be important to mark the
+ packages produced as being specific to a particular
+ machine, or to mark them as not being specific to
+ a particular machine or architecture at all.</para>
+ <para>By default, packages apply to any machine with the
+ same architecture as the target machine.
+ When a recipe produces packages that are
+ machine-specific (e.g. the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ value is passed into the configure script or a patch
+ is applied only for a particular machine), you should
+ mark them as such by adding the following to the
+ recipe:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCH = "${MACHINE_ARCH}"
+ </literallayout></para>
+ <para>On the other hand, if the recipe produces packages
+ that do not contain anything specific to the target
+ machine or architecture at all (e.g. recipes
+ that simply package script files or configuration
+ files), you should use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-allarch'><filename>allarch</filename></ulink>
+ class to do this for you by adding this to your
+ recipe:
+ <literallayout class='monospaced'>
+ inherit allarch
+ </literallayout>
+ Ensuring that the package architecture is correct is
+ not critical while you are doing the first few builds
+ of your recipe.
+ However, it is important in order
+ to ensure that your recipe rebuilds (or does not
+ rebuild) appropriately in response to changes in
+ configuration, and to ensure that you get the
+ appropriate packages installed on the target machine,
+ particularly if you run separate builds for more
+ than one target machine.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='new-sharing-files-between-recipes'>
+ <title>Sharing Files Between Recipes</title>
+
+ <para>
+ Recipes often need to use files provided by other recipes on
+ the build host.
+ For example, an application linking to a common library needs
+ access to the library itself and its associated headers.
+ The way this access is accomplished is by populating a sysroot
+ with files.
+ Each recipe has two sysroots in its work directory, one for
+ target files
+ (<filename>recipe-sysroot</filename>) and one for files that
+ are native to the build host
+ (<filename>recipe-sysroot-native</filename>).
+ <note>
+ You could find the term "staging" used within the Yocto
+ project regarding files populating sysroots (e.g. the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DIR'><filename>STAGING_DIR</filename></ulink>
+ variable).
+ </note>
+ </para>
+
+ <para>
+ Recipes should never populate the sysroot directly (i.e. write
+ files into sysroot).
+ Instead, files should be installed into standard locations
+ during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task within the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>
+ directory.
+ The reason for this limitation is that almost all files that
+ populate the sysroot are cataloged in manifests in order to
+ ensure the files can be removed later when a recipe is either
+ modified or removed.
+ Thus, the sysroot is able to remain free from stale files.
+ </para>
+
+ <para>
+ A subset of the files installed by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task are used by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+ task as defined by the the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></ulink>
+ variable to automatically populate the sysroot.
+ It is possible to modify the list of directories that populate
+ the sysroot.
+ The following example shows how you could add the
+ <filename>/opt</filename> directory to the list of
+ directories within a recipe:
+ <literallayout class='monospaced'>
+ SYSROOT_DIRS += "/opt"
+ </literallayout>
+ </para>
+
+ <para>
+ For a more complete description of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+ task and its associated functions, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-staging'><filename>staging</filename></ulink>
+ class.
+ </para>
+ </section>
+
+ <section id='metadata-virtual-providers'>
+ <title>Using Virtual Providers</title>
+
+ <para>
+ Prior to a build, if you know that several different recipes
+ provide the same functionality, you can use a virtual provider
+ (i.e. <filename>virtual/*</filename>) as a placeholder for the
+ actual provider.
+ The actual provider is determined at build-time.
+ </para>
+
+ <para>
+ A common scenario where a virtual provider is used would be
+ for the kernel recipe.
+ Suppose you have three kernel recipes whose
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>
+ values map to <filename>kernel-big</filename>,
+ <filename>kernel-mid</filename>, and
+ <filename>kernel-small</filename>.
+ Furthermore, each of these recipes in some way uses a
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PROVIDES'><filename>PROVIDES</filename></ulink>
+ statement that essentially identifies itself as being able
+ to provide <filename>virtual/kernel</filename>.
+ Here is one way through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-kernel'><filename>kernel</filename></ulink>
+ class:
+ <literallayout class='monospaced'>
+ PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
+ </literallayout>
+ Any recipe that inherits the <filename>kernel</filename> class
+ is going to utilize a <filename>PROVIDES</filename> statement
+ that identifies that recipe as being able to provide the
+ <filename>virtual/kernel</filename> item.
+ </para>
+
+ <para>
+ Now comes the time to actually build an image and you need a
+ kernel recipe, but which one?
+ You can configure your build to call out the kernel recipe
+ you want by using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></ulink>
+ variable.
+ As an example, consider the
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/conf/machine/include/x86-base.inc'><filename>x86-base.inc</filename></ulink>
+ include file, which is a machine
+ (i.e. <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>)
+ configuration file.
+ This include file is the reason all x86-based machines use the
+ <filename>linux-yocto</filename> kernel.
+ Here are the relevant lines from the include file:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
+ PREFERRED_VERSION_linux-yocto ??= "4.15%"
+ </literallayout>
+ </para>
+
+ <para>
+ When you use a virtual provider, you do not have to
+ "hard code" a recipe name as a build dependency.
+ You can use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable to state the build is dependent on
+ <filename>virtual/kernel</filename> for example:
+ <literallayout class='monospaced'>
+ DEPENDS = "virtual/kernel"
+ </literallayout>
+ During the build, the OpenEmbedded build system picks
+ the correct recipe needed for the
+ <filename>virtual/kernel</filename> dependency based on the
+ <filename>PREFERRED_PROVIDER</filename> variable.
+ If you want to use the small kernel mentioned at the beginning
+ of this section, configure your build as follows:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ??= "kernel-small"
+ </literallayout>
+ <note>
+ Any recipe that
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PROVIDES'><filename>PROVIDES</filename></ulink>
+ a <filename>virtual/*</filename> item that is ultimately
+ not selected through
+ <filename>PREFERRED_PROVIDER</filename> does not get built.
+ Preventing these recipes from building is usually the
+ desired behavior since this mechanism's purpose is to
+ select between mutually exclusive alternative providers.
+ </note>
+ </para>
+
+ <para>
+ The following lists specific examples of virtual providers:
+ <itemizedlist>
+ <listitem><para>
+ <filename>virtual/kernel</filename>:
+ Provides the name of the kernel recipe to use when
+ building a kernel image.
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/bootloader</filename>:
+ Provides the name of the bootloader to use when
+ building an image.
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/mesa</filename>:
+ Provides <filename>gbm.pc</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/egl</filename>:
+ Provides <filename>egl.pc</filename> and possibly
+ <filename>wayland-egl.pc</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/libgl</filename>:
+ Provides <filename>gl.pc</filename> (i.e. libGL).
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/libgles1</filename>:
+ Provides <filename>glesv1_cm.pc</filename>
+ (i.e. libGLESv1_CM).
+ </para></listitem>
+ <listitem><para>
+ <filename>virtual/libgles2</filename>:
+ Provides <filename>glesv2.pc</filename>
+ (i.e. libGLESv2).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='properly-versioning-pre-release-recipes'>
+ <title>Properly Versioning Pre-Release Recipes</title>
+
+ <para>
+ Sometimes the name of a recipe can lead to versioning
+ problems when the recipe is upgraded to a final release.
+ For example, consider the
+ <filename>irssi_0.8.16-rc1.bb</filename> recipe file in
+ the list of example recipes in the
+ "<link linkend='new-recipe-storing-and-naming-the-recipe'>Storing and Naming the Recipe</link>"
+ section.
+ This recipe is at a release candidate stage (i.e.
+ "rc1").
+ When the recipe is released, the recipe filename becomes
+ <filename>irssi_0.8.16.bb</filename>.
+ The version change from <filename>0.8.16-rc1</filename>
+ to <filename>0.8.16</filename> is seen as a decrease by the
+ build system and package managers, so the resulting packages
+ will not correctly trigger an upgrade.
+ </para>
+
+ <para>
+ In order to ensure the versions compare properly, the
+ recommended convention is to set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ within the recipe to
+ "<replaceable>previous_version</replaceable>+<replaceable>current_version</replaceable>".
+ You can use an additional variable so that you can use the
+ current version elsewhere.
+ Here is an example:
+ <literallayout class='monospaced'>
+ REALPV = "0.8.16-rc1"
+ PV = "0.8.15+${REALPV}"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='new-recipe-post-installation-scripts'>
+ <title>Post-Installation Scripts</title>
+
+ <para>
+ Post-installation scripts run immediately after installing
+ a package on the target or during image creation when a
+ package is included in an image.
+ To add a post-installation script to a package, add a
+ <filename>pkg_postinst_</filename><replaceable>PACKAGENAME</replaceable><filename>()</filename> function to
+ the recipe file (<filename>.bb</filename>) and replace
+ <replaceable>PACKAGENAME</replaceable> with the name of the package
+ you want to attach to the <filename>postinst</filename>
+ script.
+ To apply the post-installation script to the main package
+ for the recipe, which is usually what is required, specify
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
+ in place of <replaceable>PACKAGENAME</replaceable>.
+ </para>
+
+ <para>
+ A post-installation function has the following structure:
+ <literallayout class='monospaced'>
+ pkg_postinst_<replaceable>PACKAGENAME</replaceable>() {
+ # Commands to carry out
+ }
+ </literallayout>
+ </para>
+
+ <para>
+ The script defined in the post-installation function is
+ called when the root filesystem is created.
+ If the script succeeds, the package is marked as installed.
+ If the script fails, the package is marked as unpacked and
+ the script is executed when the image boots again.
+ <note>
+ Any RPM post-installation script that runs on the target
+ should return a 0 exit code.
+ RPM does not allow non-zero exit codes for these scripts,
+ and the RPM package manager will cause the package to fail
+ installation on the target.
+ </note>
+ </para>
+
+ <para>
+ Sometimes it is necessary for the execution of a
+ post-installation script to be delayed until the first boot.
+ For example, the script might need to be executed on the
+ device itself.
+ To delay script execution until boot time, use the following
+ structure in the post-installation script:
+ <literallayout class='monospaced'>
+ pkg_postinst_<replaceable>PACKAGENAME</replaceable>() {
+ if [ x"$D" = "x" ]; then
+ # Actions to carry out on the device go here
+ else
+ exit 1
+ fi
+ }
+ </literallayout>
+ </para>
+
+ <para>
+ The previous example delays execution until the image boots
+ again because the environment variable <filename>D</filename>
+ points to the directory containing the image when
+ the root filesystem is created at build time but is unset
+ when executed on the first boot.
+ </para>
+
+ <para>
+ If you have recipes that use <filename>pkg_postinst</filename>
+ scripts and they require the use of non-standard native
+ tools that have dependencies during rootfs construction, you
+ need to use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_WRITE_DEPS'><filename>PACKAGE_WRITE_DEPS</filename></ulink>
+ variable in your recipe to list these tools.
+ If you do not use this variable, the tools might be missing and
+ execution of the post-installation script is deferred until
+ first boot.
+ Deferring the script to first boot is undesirable and for
+ read-only rootfs impossible.
+ </para>
+
+ <note>
+ Equivalent support for pre-install, pre-uninstall, and
+ post-uninstall scripts exist by way of
+ <filename>pkg_preinst</filename>,
+ <filename>pkg_prerm</filename>, and
+ <filename>pkg_postrm</filename>, respectively.
+ These scrips work in exactly the same way as does
+ <filename>pkg_postinst</filename> with the exception that they
+ run at different times.
+ Also, because of when they run, they are not applicable to
+ being run at image creation time like
+ <filename>pkg_postinst</filename>.
+ </note>
+ </section>
+
+ <section id='new-recipe-testing'>
+ <title>Testing</title>
+
+ <para>
+ The final step for completing your recipe is to be sure that
+ the software you built runs correctly.
+ To accomplish runtime testing, add the build's output
+ packages to your image and test them on the target.
+ </para>
+
+ <para>
+ For information on how to customize your image by adding
+ specific packages, see the
+ "<link linkend='usingpoky-extend-customimage'>Customizing Images</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='new-recipe-testing-examples'>
+ <title>Examples</title>
+
+ <para>
+ To help summarize how to write a recipe, this section provides
+ some examples given various scenarios:
+ <itemizedlist>
+ <listitem><para>Recipes that use local files</para></listitem>
+ <listitem><para>Using an Autotooled package</para></listitem>
+ <listitem><para>Using a Makefile-based package</para></listitem>
+ <listitem><para>Splitting an application into multiple packages</para></listitem>
+ <listitem><para>Adding binaries to an image</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='new-recipe-single-c-file-package-hello-world'>
+ <title>Single .c File Package (Hello World!)</title>
+
+ <para>
+ Building an application from a single file that is stored
+ locally (e.g. under <filename>files</filename>) requires
+ a recipe that has the file listed in the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
+ variable.
+ Additionally, you need to manually write the
+ <filename>do_compile</filename> and
+ <filename>do_install</filename> tasks.
+ The <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename>
+ variable defines the directory containing the source code,
+ which is set to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
+ in this case - the directory BitBake uses for the build.
+ <literallayout class='monospaced'>
+ SUMMARY = "Simple helloworld application"
+ SECTION = "examples"
+ LICENSE = "MIT"
+ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+ SRC_URI = "file://helloworld.c"
+
+ S = "${WORKDIR}"
+
+ do_compile() {
+ ${CC} helloworld.c -o helloworld
+ }
+
+ do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 helloworld ${D}${bindir}
+ }
+ </literallayout>
+ </para>
+
+ <para>
+ By default, the <filename>helloworld</filename>,
+ <filename>helloworld-dbg</filename>, and
+ <filename>helloworld-dev</filename> packages are built.
+ For information on how to customize the packaging process,
+ see the
+ "<link linkend='splitting-an-application-into-multiple-packages'>Splitting an Application into Multiple Packages</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='new-recipe-autotooled-package'>
+ <title>Autotooled Package</title>
+ <para>
+ Applications that use Autotools such as <filename>autoconf</filename> and
+ <filename>automake</filename> require a recipe that has a source archive listed in
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename> and
+ also inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ class, which contains the definitions of all the steps
+ needed to build an Autotool-based application.
+ The result of the build is automatically packaged.
+ And, if the application uses NLS for localization, packages with local information are
+ generated (one package per language).
+ Following is one example: (<filename>hello_2.3.bb</filename>)
+ <literallayout class='monospaced'>
+ SUMMARY = "GNU Helloworld application"
+ SECTION = "examples"
+ LICENSE = "GPLv2+"
+ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+ SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.gz"
+
+ inherit autotools gettext
+ </literallayout>
+ </para>
+
+ <para>
+ The variable
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</ulink></filename>
+ is used to track source license changes as described in the
+ "<link linkend='usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</link>"
+ section in the Yocto Project Overview and Concepts Manual.
+ You can quickly create Autotool-based recipes in a manner
+ similar to the previous example.
+ </para>
+ </section>
+
+ <section id='new-recipe-makefile-based-package'>
+ <title>Makefile-Based Package</title>
+
+ <para>
+ Applications that use GNU <filename>make</filename> also require a recipe that has
+ the source archive listed in
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>.
+ You do not need to add a <filename>do_compile</filename> step since by default BitBake
+ starts the <filename>make</filename> command to compile the application.
+ If you need additional <filename>make</filename> options, you should store them in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ variables.
+ BitBake passes these options into the GNU <filename>make</filename> invocation.
+ Note that a <filename>do_install</filename> task is still required.
+ Otherwise, BitBake runs an empty <filename>do_install</filename> task by default.
+ </para>
+
+ <para>
+ Some applications might require extra parameters to be passed to the compiler.
+ For example, the application might need an additional header path.
+ You can accomplish this by adding to the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-CFLAGS'>CFLAGS</ulink></filename> variable.
+ The following example shows this:
+ <literallayout class='monospaced'>
+ CFLAGS_prepend = "-I ${S}/include "
+ </literallayout>
+ </para>
+
+ <para>
+ In the following example, <filename>mtd-utils</filename> is a makefile-based package:
+ <literallayout class='monospaced'>
+ SUMMARY = "Tools for managing memory technology devices"
+ SECTION = "base"
+ DEPENDS = "zlib lzo e2fsprogs util-linux"
+ HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+ LICENSE = "GPLv2+"
+ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+
+ # Use the latest version at 26 Oct, 2013
+ SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
+ SRC_URI = "git://git.infradead.org/mtd-utils.git \
+ file://add-exclusion-to-mkfs-jffs2-git-2.patch \
+ "
+
+ PV = "1.5.1+git${SRCPV}"
+
+ S = "${WORKDIR}/git"
+
+ EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
+
+ do_install () {
+ oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
+ }
+
+ PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
+
+ FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
+ FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+ FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+
+ PARALLEL_MAKE = ""
+
+ BBCLASSEXTEND = "native"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='splitting-an-application-into-multiple-packages'>
+ <title>Splitting an Application into Multiple Packages</title>
+
+ <para>
+ You can use the variables
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'>PACKAGES</ulink></filename> and
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'>FILES</ulink></filename>
+ to split an application into multiple packages.
+ </para>
+
+ <para>
+ Following is an example that uses the <filename>libxpm</filename> recipe.
+ By default, this recipe generates a single package that contains the library along
+ with a few binaries.
+ You can modify the recipe to split the binaries into separate packages:
+ <literallayout class='monospaced'>
+ require xorg-lib-common.inc
+
+ SUMMARY = "Xpm: X Pixmap extension library"
+ LICENSE = "BSD"
+ LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
+ DEPENDS += "libxext libsm libxt"
+ PE = "1"
+
+ XORG_PN = "libXpm"
+
+ PACKAGES =+ "sxpm cxpm"
+ FILES_cxpm = "${bindir}/cxpm"
+ FILES_sxpm = "${bindir}/sxpm"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, we want to ship the <filename>sxpm</filename>
+ and <filename>cxpm</filename> binaries in separate packages.
+ Since <filename>bindir</filename> would be packaged into the main
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'>PN</ulink></filename>
+ package by default, we prepend the <filename>PACKAGES</filename>
+ variable so additional package names are added to the start of list.
+ This results in the extra <filename>FILES_*</filename>
+ variables then containing information that define which files and
+ directories go into which packages.
+ Files included by earlier packages are skipped by latter packages.
+ Thus, the main <filename>PN</filename> package
+ does not include the above listed files.
+ </para>
+ </section>
+
+ <section id='packaging-externally-produced-binaries'>
+ <title>Packaging Externally Produced Binaries</title>
+
+ <para>
+ Sometimes, you need to add pre-compiled binaries to an
+ image.
+ For example, suppose that binaries for proprietary code
+ exist, which are created by a particular division of a
+ company.
+ Your part of the company needs to use those binaries as
+ part of an image that you are building using the
+ OpenEmbedded build system.
+ Since you only have the binaries and not the source code,
+ you cannot use a typical recipe that expects to fetch the
+ source specified in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ and then compile it.
+ </para>
+
+ <para>
+ One method is to package the binaries and then install them
+ as part of the image.
+ Generally, it is not a good idea to package binaries
+ since, among other things, it can hinder the ability to
+ reproduce builds and could lead to compatibility problems
+ with ABI in the future.
+ However, sometimes you have no choice.
+ </para>
+
+ <para>
+ The easiest solution is to create a recipe that uses
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-bin-package'><filename>bin_package</filename></ulink>
+ class and to be sure that you are using default locations
+ for build artifacts.
+ In most cases, the <filename>bin_package</filename> class
+ handles "skipping" the configure and compile steps as well
+ as sets things up to grab packages from the appropriate
+ area.
+ In particular, this class sets <filename>noexec</filename>
+ on both the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ tasks, sets
+ <filename>FILES_${PN}</filename> to "/" so that it picks
+ up all files, and sets up a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task, which effectively copies all files from
+ <filename>${S}</filename> to <filename>${D}</filename>.
+ The <filename>bin_package</filename> class works well when
+ the files extracted into <filename>${S}</filename> are
+ already laid out in the way they should be laid out
+ on the target.
+ For more information on these variables, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink>
+ variables in the Yocto Project Reference Manual's variable
+ glossary.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Using
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ is a good idea even for components distributed
+ in binary form, and is often necessary for
+ shared libraries.
+ For a shared library, listing the library
+ dependencies in
+ <filename>DEPENDS</filename> makes sure that
+ the libraries are available in the staging
+ sysroot when other recipes link against the
+ library, which might be necessary for
+ successful linking.
+ </para></listitem>
+ <listitem><para>
+ Using <filename>DEPENDS</filename> also
+ allows runtime dependencies between packages
+ to be added automatically.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and
+ Concepts Manual for more information.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ If you cannot use the <filename>bin_package</filename>
+ class, you need to be sure you are doing the following:
+ <itemizedlist>
+ <listitem><para>
+ Create a recipe where the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ tasks do nothing:
+ It is usually sufficient to just not define these
+ tasks in the recipe, because the default
+ implementations do nothing unless a Makefile is
+ found in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>.
+ </para>
+
+ <para>If
+ <filename>${S}</filename> might contain a Makefile,
+ or if you inherit some class that replaces
+ <filename>do_configure</filename> and
+ <filename>do_compile</filename> with custom
+ versions, then you can use the
+ <filename>[</filename><ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>noexec</filename></ulink><filename>]</filename>
+ flag to turn the tasks into no-ops, as follows:
+ <literallayout class='monospaced'>
+ do_configure[noexec] = "1"
+ do_compile[noexec] = "1"
+ </literallayout>
+ Unlike
+ <ulink url='&YOCTO_DOCS_BB_URL;#deleting-a-task'><filename>deleting the tasks</filename></ulink>,
+ using the flag preserves the dependency chain from
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>, <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ tasks to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task.
+ </para></listitem>
+ <listitem><para>Make sure your
+ <filename>do_install</filename> task installs the
+ binaries appropriately.
+ </para></listitem>
+ <listitem><para>Ensure that you set up
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
+ (usually
+ <filename>FILES_${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>)
+ to point to the files you have installed, which of
+ course depends on where you have installed them
+ and whether those files are in different locations
+ than the defaults.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id="following-recipe-style-guidelines">
+ <title>Following Recipe Style Guidelines</title>
+
+ <para>
+ When writing recipes, it is good to conform to existing
+ style guidelines.
+ The
+ <ulink url='http://www.openembedded.org/wiki/Styleguide'>OpenEmbedded Styleguide</ulink>
+ wiki page provides rough guidelines for preferred recipe style.
+ </para>
+
+ <para>
+ It is common for existing recipes to deviate a bit from this
+ style.
+ However, aiming for at least a consistent style is a good idea.
+ Some practices, such as omitting spaces around
+ <filename>=</filename> operators in assignments or ordering
+ recipe components in an erratic way, are widely seen as poor
+ style.
+ </para>
+ </section>
+
+ <section id='recipe-syntax'>
+ <title>Recipe Syntax</title>
+
+ <para>
+ Understanding recipe file syntax is important for writing
+ recipes.
+ The following list overviews the basic items that make up a
+ BitBake recipe file.
+ For more complete BitBake syntax descriptions, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>"
+ chapter of the BitBake User Manual.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Variable Assignments and Manipulations:</emphasis>
+ Variable assignments allow a value to be assigned to a
+ variable.
+ The assignment can be static text or might include
+ the contents of other variables.
+ In addition to the assignment, appending and prepending
+ operations are also supported.</para>
+
+ <para>The following example shows some of the ways
+ you can use variables in recipes:
+ <literallayout class='monospaced'>
+ S = "${WORKDIR}/postfix-${PV}"
+ CFLAGS += "-DNO_ASM"
+ SRC_URI_append = " file://fixup.patch"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Functions:</emphasis>
+ Functions provide a series of actions to be performed.
+ You usually use functions to override the default
+ implementation of a task function or to complement
+ a default function (i.e. append or prepend to an
+ existing function).
+ Standard functions use <filename>sh</filename> shell
+ syntax, although access to OpenEmbedded variables and
+ internal methods are also available.</para>
+
+ <para>The following is an example function from the
+ <filename>sed</filename> recipe:
+ <literallayout class='monospaced'>
+ do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+ rmdir ${D}${bindir}/
+ }
+ </literallayout>
+ It is also possible to implement new functions that
+ are called between existing tasks as long as the
+ new functions are not replacing or complementing the
+ default functions.
+ You can implement functions in Python
+ instead of shell.
+ Both of these options are not seen in the majority of
+ recipes.
+ </para></listitem>
+ <listitem><para><emphasis>Keywords:</emphasis>
+ BitBake recipes use only a few keywords.
+ You use keywords to include common
+ functions (<filename>inherit</filename>), load parts
+ of a recipe from other files
+ (<filename>include</filename> and
+ <filename>require</filename>) and export variables
+ to the environment (<filename>export</filename>).
+ </para>
+
+ <para>The following example shows the use of some of
+ these keywords:
+ <literallayout class='monospaced'>
+ export POSTCONF = "${STAGING_BINDIR}/postconf"
+ inherit autoconf
+ require otherfile.inc
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Comments (#):</emphasis>
+ Any lines that begin with the hash character
+ (<filename>#</filename>) are treated as comment lines
+ and are ignored:
+ <literallayout class='monospaced'>
+ # This is a comment
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This next list summarizes the most important and most commonly
+ used parts of the recipe syntax.
+ For more information on these parts of the syntax, you can
+ reference the
+ <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>
+ chapter in the BitBake User Manual.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Line Continuation (\):</emphasis>
+ Use the backward slash (<filename>\</filename>)
+ character to split a statement over multiple lines.
+ Place the slash character at the end of the line that
+ is to be continued on the next line:
+ <literallayout class='monospaced'>
+ VAR = "A really long \
+ line"
+ </literallayout>
+ <note>
+ You cannot have any characters including spaces
+ or tabs after the slash character.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Using Variables (${<replaceable>VARNAME</replaceable>}):</emphasis>
+ Use the <filename>${<replaceable>VARNAME</replaceable>}</filename>
+ syntax to access the contents of a variable:
+ <literallayout class='monospaced'>
+ SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/zlib-${PV}.tar.gz"
+ </literallayout>
+ <note>
+ It is important to understand that the value of a
+ variable expressed in this form does not get
+ substituted automatically.
+ The expansion of these expressions happens
+ on-demand later (e.g. usually when a function that
+ makes reference to the variable executes).
+ This behavior ensures that the values are most
+ appropriate for the context in which they are
+ finally used.
+ On the rare occasion that you do need the variable
+ expression to be expanded immediately, you can use
+ the <filename>:=</filename> operator instead of
+ <filename>=</filename> when you make the
+ assignment, but this is not generally needed.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Quote All Assignments ("<replaceable>value</replaceable>"):</emphasis>
+ Use double quotes around values in all variable
+ assignments (e.g.
+ <filename>"<replaceable>value</replaceable>"</filename>).
+ Following is an example:
+ <literallayout class='monospaced'>
+ VAR1 = "${OTHERVAR}"
+ VAR2 = "The version is ${PV}"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Conditional Assignment (?=):</emphasis>
+ Conditional assignment is used to assign a
+ value to a variable, but only when the variable is
+ currently unset.
+ Use the question mark followed by the equal sign
+ (<filename>?=</filename>) to make a "soft" assignment
+ used for conditional assignment.
+ Typically, "soft" assignments are used in the
+ <filename>local.conf</filename> file for variables
+ that are allowed to come through from the external
+ environment.
+ </para>
+
+ <para>Here is an example where
+ <filename>VAR1</filename> is set to "New value" if
+ it is currently empty.
+ However, if <filename>VAR1</filename> has already been
+ set, it remains unchanged:
+ <literallayout class='monospaced'>
+ VAR1 ?= "New value"
+ </literallayout>
+ In this next example, <filename>VAR1</filename>
+ is left with the value "Original value":
+ <literallayout class='monospaced'>
+ VAR1 = "Original value"
+ VAR1 ?= "New value"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Appending (+=):</emphasis>
+ Use the plus character followed by the equals sign
+ (<filename>+=</filename>) to append values to existing
+ variables.
+ <note>
+ This operator adds a space between the existing
+ content of the variable and the new content.
+ </note></para>
+
+ <para>Here is an example:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://fix-makefile.patch"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Prepending (=+):</emphasis>
+ Use the equals sign followed by the plus character
+ (<filename>=+</filename>) to prepend values to existing
+ variables.
+ <note>
+ This operator adds a space between the new content
+ and the existing content of the variable.
+ </note></para>
+
+ <para>Here is an example:
+ <literallayout class='monospaced'>
+ VAR =+ "Starts"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Appending (_append):</emphasis>
+ Use the <filename>_append</filename> operator to
+ append values to existing variables.
+ This operator does not add any additional space.
+ Also, the operator is applied after all the
+ <filename>+=</filename>, and
+ <filename>=+</filename> operators have been applied and
+ after all <filename>=</filename> assignments have
+ occurred.
+ </para>
+
+ <para>The following example shows the space being
+ explicitly added to the start to ensure the appended
+ value is not merged with the existing value:
+ <literallayout class='monospaced'>
+ SRC_URI_append = " file://fix-makefile.patch"
+ </literallayout>
+ You can also use the <filename>_append</filename>
+ operator with overrides, which results in the actions
+ only being performed for the specified target or
+ machine:
+ <literallayout class='monospaced'>
+ SRC_URI_append_sh4 = " file://fix-makefile.patch"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Prepending (_prepend):</emphasis>
+ Use the <filename>_prepend</filename> operator to
+ prepend values to existing variables.
+ This operator does not add any additional space.
+ Also, the operator is applied after all the
+ <filename>+=</filename>, and
+ <filename>=+</filename> operators have been applied and
+ after all <filename>=</filename> assignments have
+ occurred.
+ </para>
+
+ <para>The following example shows the space being
+ explicitly added to the end to ensure the prepended
+ value is not merged with the existing value:
+ <literallayout class='monospaced'>
+ CFLAGS_prepend = "-I${S}/myincludes "
+ </literallayout>
+ You can also use the <filename>_prepend</filename>
+ operator with overrides, which results in the actions
+ only being performed for the specified target or
+ machine:
+ <literallayout class='monospaced'>
+ CFLAGS_prepend_sh4 = "-I${S}/myincludes "
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Overrides:</emphasis>
+ You can use overrides to set a value conditionally,
+ typically based on how the recipe is being built.
+ For example, to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
+ variable's value to "standard/base" for any target
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>,
+ except for qemuarm where it should be set to
+ "standard/arm-versatile-926ejs", you would do the
+ following:
+ <literallayout class='monospaced'>
+ KBRANCH = "standard/base"
+ KBRANCH_qemuarm = "standard/arm-versatile-926ejs"
+ </literallayout>
+ Overrides are also used to separate alternate values
+ of a variable in other situations.
+ For example, when setting variables such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
+ that are specific to individual packages produced by
+ a recipe, you should always use an override that
+ specifies the name of the package.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Indentation:</emphasis>
+ Use spaces for indentation rather than than tabs.
+ For shell functions, both currently work.
+ However, it is a policy decision of the Yocto Project
+ to use tabs in shell functions.
+ Realize that some layers have a policy to use spaces
+ for all indentation.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Using Python for Complex Operations:</emphasis>
+ For more advanced processing, it is possible to use
+ Python code during variable assignments (e.g.
+ search and replacement on a variable).</para>
+
+ <para>You indicate Python code using the
+ <filename>${@<replaceable>python_code</replaceable>}</filename>
+ syntax for the variable assignment:
+ <literallayout class='monospaced'>
+ SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Shell Function Syntax:</emphasis>
+ Write shell functions as if you were writing a shell
+ script when you describe a list of actions to take.
+ You should ensure that your script works with a generic
+ <filename>sh</filename> and that it does not require
+ any <filename>bash</filename> or other shell-specific
+ functionality.
+ The same considerations apply to various system
+ utilities (e.g. <filename>sed</filename>,
+ <filename>grep</filename>, <filename>awk</filename>,
+ and so forth) that you might wish to use.
+ If in doubt, you should check with multiple
+ implementations - including those from BusyBox.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id="platdev-newmachine">
+ <title>Adding a New Machine</title>
+
+ <para>
+ Adding a new machine to the Yocto Project is a straightforward
+ process.
+ This section describes how to add machines that are similar
+ to those that the Yocto Project already supports.
+ <note>
+ Although well within the capabilities of the Yocto Project,
+ adding a totally new architecture might require
+ changes to <filename>gcc/glibc</filename> and to the site
+ information, which is beyond the scope of this manual.
+ </note>
+ </para>
+
+ <para>
+ For a complete example that shows how to add a new machine,
+ see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a New BSP Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ </para>
+
+ <section id="platdev-newmachine-conffile">
+ <title>Adding the Machine Configuration File</title>
+
+ <para>
+ To add a new machine, you need to add a new machine
+ configuration file to the layer's
+ <filename>conf/machine</filename> directory.
+ This configuration file provides details about the device
+ you are adding.
+ </para>
+
+ <para>
+ The OpenEmbedded build system uses the root name of the
+ machine configuration file to reference the new machine.
+ For example, given a machine configuration file named
+ <filename>crownbay.conf</filename>, the build system
+ recognizes the machine as "crownbay".
+ </para>
+
+ <para>
+ The most important variables you must set in your machine
+ configuration file or include from a lower-level configuration
+ file are as follows:
+ <itemizedlist>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_ARCH'>TARGET_ARCH</ulink></filename>
+ (e.g. "arm")</para></listitem>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_PROVIDER'>PREFERRED_PROVIDER</ulink>_virtual/kernel</filename>
+ </para></listitem>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES'>MACHINE_FEATURES</ulink></filename>
+ (e.g. "apm screen wifi")</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You might also need these variables:
+ <itemizedlist>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SERIAL_CONSOLES'>SERIAL_CONSOLES</ulink></filename>
+ (e.g. "115200;ttyS0 115200;ttyS1")</para></listitem>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_IMAGETYPE'>KERNEL_IMAGETYPE</ulink></filename>
+ (e.g. "zImage")</para></listitem>
+ <listitem><para><filename><ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'>IMAGE_FSTYPES</ulink></filename>
+ (e.g. "tar.gz jffs2")</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can find full details on these variables in the reference
+ section.
+ You can leverage existing machine <filename>.conf</filename>
+ files from <filename>meta-yocto-bsp/conf/machine/</filename>.
+ </para>
+ </section>
+
+ <section id="platdev-newmachine-kernel">
+ <title>Adding a Kernel for the Machine</title>
+
+ <para>
+ The OpenEmbedded build system needs to be able to build a kernel
+ for the machine.
+ You need to either create a new kernel recipe for this machine,
+ or extend an existing kernel recipe.
+ You can find several kernel recipe examples in the
+ Source Directory at
+ <filename>meta/recipes-kernel/linux</filename>
+ that you can use as references.
+ </para>
+
+ <para>
+ If you are creating a new kernel recipe, normal recipe-writing
+ rules apply for setting up a
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>.
+ Thus, you need to specify any necessary patches and set
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'>S</ulink></filename>
+ to point at the source code.
+ You need to create a <filename>do_configure</filename> task that
+ configures the unpacked kernel with a
+ <filename>defconfig</filename> file.
+ You can do this by using a <filename>make defconfig</filename>
+ command or, more commonly, by copying in a suitable
+ <filename>defconfig</filename> file and then running
+ <filename>make oldconfig</filename>.
+ By making use of <filename>inherit kernel</filename> and
+ potentially some of the <filename>linux-*.inc</filename> files,
+ most other functionality is centralized and the defaults of the
+ class normally work well.
+ </para>
+
+ <para>
+ If you are extending an existing kernel recipe, it is usually
+ a matter of adding a suitable <filename>defconfig</filename>
+ file.
+ The file needs to be added into a location similar to
+ <filename>defconfig</filename> files used for other machines
+ in a given kernel recipe.
+ A possible way to do this is by listing the file in the
+ <filename>SRC_URI</filename> and adding the machine to the
+ expression in
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'>COMPATIBLE_MACHINE</ulink></filename>:
+ <literallayout class='monospaced'>
+ COMPATIBLE_MACHINE = '(qemux86|qemumips)'
+ </literallayout>
+ For more information on <filename>defconfig</filename> files,
+ see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#changing-the-configuration'>Changing the Configuration</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+ </section>
+
+ <section id="platdev-newmachine-formfactor">
+ <title>Adding a Formfactor Configuration File</title>
+
+ <para>
+ A formfactor configuration file provides information about the
+ target hardware for which the image is being built and information that
+ the build system cannot obtain from other sources such as the kernel.
+ Some examples of information contained in a formfactor configuration file include
+ framebuffer orientation, whether or not the system has a keyboard,
+ the positioning of the keyboard in relation to the screen, and
+ the screen resolution.
+ </para>
+
+ <para>
+ The build system uses reasonable defaults in most cases.
+ However, if customization is
+ necessary, you need to create a <filename>machconfig</filename> file
+ in the <filename>meta/recipes-bsp/formfactor/files</filename>
+ directory.
+ This directory contains directories for specific machines such as
+ <filename>qemuarm</filename> and <filename>qemux86</filename>.
+ For information about the settings available and the defaults, see the
+ <filename>meta/recipes-bsp/formfactor/files/config</filename> file found in the
+ same area.
+ </para>
+
+ <para>
+ Following is an example for "qemuarm" machine:
+ <literallayout class='monospaced'>
+ HAVE_TOUCHSCREEN=1
+ HAVE_KEYBOARD=1
+
+ DISPLAY_CAN_ROTATE=0
+ DISPLAY_ORIENTATION=0
+ #DISPLAY_WIDTH_PIXELS=640
+ #DISPLAY_HEIGHT_PIXELS=480
+ #DISPLAY_BPP=16
+ DISPLAY_DPI=150
+ DISPLAY_SUBPIXEL_ORDER=vrgb
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='gs-upgrading-recipes'>
+ <title>Upgrading Recipes</title>
+
+ <para>
+ Over time, upstream developers publish new versions for software
+ built by layer recipes.
+ It is recommended to keep recipes up-to-date with upstream
+ version releases.
+ You can use the Automated Upgrade Helper (AUH) to set up
+ automatic version upgrades.
+ Alternatively, you can use <filename>devtool upgrade</filename>
+ to set up semi-automatic version upgrades.
+ Finally, you can even manually upgrade a recipe by editing the
+ recipe itself.
+ </para>
+
+ <section id='gs-using-the-auto-upgrade-helper'>
+ <title>Using the Auto Upgrade Helper (AUH)</title>
+
+ <para>
+ The AUH utility works in conjunction with the
+ OpenEmbedded build system in order to automatically generate
+ upgrades for recipes based on new versions being
+ published upstream.
+ Use AUH when you want to create a service that performs the
+ upgrades automatically and optionally sends you an email with
+ the results.
+ </para>
+
+ <para>
+ AUH allows you to update several recipes with a single use.
+ You can also optionally perform build and integration tests
+ using images with the results saved to your hard drive and
+ emails of results optionally sent to recipe maintainers.
+ Finally, AUH creates Git commits with appropriate commit
+ messages in the layer's tree for the changes made to recipes.
+ <note>
+ Conditions do exist when you should not use AUH to upgrade
+ recipes and you should instead use either
+ <filename>devtool upgrade</filename> or upgrade your
+ recipes manually:
+ <itemizedlist>
+ <listitem><para>
+ When AUH cannot complete the upgrade sequence.
+ This situation usually results because custom
+ patches carried by the recipe cannot be
+ automatically rebased to the new version.
+ In this case, <filename>devtool upgrade</filename>
+ allows you to manually resolve conflicts.
+ </para></listitem>
+ <listitem><para>
+ When for any reason you want fuller control over
+ the upgrade process.
+ For example, when you want special arrangements
+ for testing.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The following steps describe how to set up the AUH utility:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Be Sure the Development Host is Set Up:</emphasis>
+ You need to be sure that your development host is
+ set up to use the Yocto Project.
+ For information on how to set up your host, see the
+ "<link linkend='setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Sure Git is Configured:</emphasis>
+ The AUH utility requires Git to be configured because
+ AUH uses Git to save upgrades.
+ Thus, you must have Git user and email configured.
+ The following command shows your configurations:
+ <literallayout class='monospaced'>
+ $ git config --list
+ </literallayout>
+ If you do not have the user and email configured, you
+ can use the following commands to do so:
+ <literallayout class='monospaced'>
+ $ git config --global user.name <replaceable>some_name</replaceable>
+ $ git config --global user.email <replaceable>username</replaceable>@<replaceable>domain</replaceable>.com
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the AUH Repository:</emphasis>
+ To use AUH, you must clone the repository onto your
+ development host.
+ The following command uses Git to create a local
+ copy of the repository on your system:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/auto-upgrade-helper
+ Cloning into 'auto-upgrade-helper'...
+ remote: Counting objects: 768, done.
+ remote: Compressing objects: 100% (300/300), done.
+ remote: Total 768 (delta 499), reused 703 (delta 434)
+ Receiving objects: 100% (768/768), 191.47 KiB | 98.00 KiB/s, done.
+ Resolving deltas: 100% (499/499), done.
+ Checking connectivity... done.
+ </literallayout>
+ AUH is not part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core (OE-Core)</ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#poky'>Poky</ulink>
+ repositories.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Dedicated Build Directory:</emphasis>
+ Run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>
+ script to create a fresh build directory that you
+ use exclusively for running the AUH utility:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source oe-init-build-env <replaceable>your_AUH_build_directory</replaceable>
+ </literallayout>
+ Re-using an existing build directory and its
+ configurations is not recommended as existing settings
+ could cause AUH to fail or behave undesirably.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Configurations in Your Local Configuration File:</emphasis>
+ Several settings need to exist in the
+ <filename>local.conf</filename> file in the build
+ directory you just created for AUH.
+ Make these following configurations:
+ <itemizedlist>
+ <listitem><para>
+ Enable "distrodata" as follows:
+ <literallayout class='monospaced'>
+ INHERIT =+ "distrodata"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you want to enable
+ <ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Build History</ulink>,
+ which is optional, you need the following
+ lines in the
+ <filename>conf/local.conf</filename> file:
+ <literallayout class='monospaced'>
+ INHERIT =+ "buildhistory"
+ BUILDHISTORY_COMMIT = "1"
+ </literallayout>
+ With this configuration and a successful
+ upgrade, a build history "diff" file appears in
+ the
+ <filename>upgrade-helper/work/recipe/buildhistory-diff.txt</filename>
+ file found in your build directory.
+ </para></listitem>
+ <listitem><para>
+ If you want to enable testing through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-testimage*'><filename>testimage</filename></ulink>
+ class, which is optional, you need to have the
+ following set in your
+ <filename>conf/local.conf</filename> file:
+ <literallayout class='monospaced'>
+ INHERIT += "testimage"
+ </literallayout>
+ <note>
+ If your distro does not enable by default
+ ptest, which Poky does, you need the
+ following in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " ptest"
+ </literallayout>
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Start a vncserver:</emphasis>
+ If you are running in a server without an X11 session,
+ you need to start a vncserver:
+ <literallayout class='monospaced'>
+ $ vncserver :1
+ $ export DISPLAY=:1
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create and Edit an AUH Configuration File:</emphasis>
+ You need to have the
+ <filename>upgrade-helper/upgrade-helper.conf</filename>
+ configuration file in your build directory.
+ You can find a sample configuration file in the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/auto-upgrade-helper/tree/'>AUH source repository</ulink>.
+ </para>
+
+ <para>Read through the sample file and make
+ configurations as needed.
+ For example, if you enabled build history in your
+ <filename>local.conf</filename> as described earlier,
+ you must enable it in
+ <filename>upgrade-helper.conf</filename>.</para>
+
+ <para>Also, if you are using the default
+ <filename>maintainers.inc</filename> file supplied
+ with Poky and located in
+ <filename>meta-yocto</filename> and you do not set a
+ "maintainers_whitelist" or "global_maintainer_override"
+ in the <filename>upgrade-helper.conf</filename>
+ configuration, and you specify "-e all" on the
+ AUH command-line, the utility automatically sends out
+ emails to all the default maintainers.
+ Please avoid this.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ This next set of examples describes how to use the AUH:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Upgrading a Specific Recipe:</emphasis>
+ To upgrade a specific recipe, use the following
+ form:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py <replaceable>recipe_name</replaceable>
+ </literallayout>
+ For example, this command upgrades the
+ <filename>xmodmap</filename> recipe:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py xmodmap
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Upgrading a Specific Recipe to a Particular Version:</emphasis>
+ To upgrade a specific recipe to a particular version,
+ use the following form:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py <replaceable>recipe_name</replaceable> -t <replaceable>version</replaceable>
+ </literallayout>
+ For example, this command upgrades the
+ <filename>xmodmap</filename> recipe to version
+ 1.2.3:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py xmodmap -t 1.2.3
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Upgrading all Recipes to the Latest Versions and Suppressing Email Notifications:</emphasis>
+ To upgrade all recipes to their most recent versions
+ and suppress the email notifications, use the following
+ command:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py all
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Upgrading all Recipes to the Latest Versions and Send Email Notifications:</emphasis>
+ To upgrade all recipes to their most recent versions
+ and send email messages to maintainers for each
+ attempted recipe as well as a status email, use the
+ following command:
+ <literallayout class='monospaced'>
+ $ upgrade-helper.py -e all
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Once you have run the AUH utility, you can find the results
+ in the AUH build directory:
+ <literallayout class='monospaced'>
+ ${BUILDDIR}/upgrade-helper/<replaceable>timestamp</replaceable>
+ </literallayout>
+ The AUH utility also creates recipe update commits from
+ successful upgrade attempts in the layer tree.
+ </para>
+
+ <para>
+ You can easily set up to run the AUH utility on a regular
+ basis by using a cron job.
+ See the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/auto-upgrade-helper/tree/weeklyjob.sh'><filename>weeklyjob.sh</filename></ulink>
+ file distributed with the utility for an example.
+ </para>
+ </section>
+
+ <section id='gs-using-devtool-upgrade'>
+ <title>Using <filename>devtool upgrade</filename></title>
+
+ <para>
+ As mentioned earlier, an alternative method for upgrading
+ recipes to newer versions is to use
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-devtool-reference'><filename>devtool upgrade</filename></ulink>.
+ You can read about <filename>devtool upgrade</filename> in
+ general in the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) Manual.
+ </para>
+
+ <para>
+ To see all the command-line options available with
+ <filename>devtool upgrade</filename>, use the following help
+ command:
+ <literallayout class='monospaced'>
+ $ devtool upgrade -h
+ </literallayout>
+ </para>
+
+ <para>
+ If you want to find out what version a recipe is currently at
+ upstream without any attempt to upgrade your local version of
+ the recipe, you can use the following command:
+ <literallayout class='monospaced'>
+ $ devtool latest-version <replaceable>recipe_name</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ As mentioned in the previous section describing AUH,
+ <filename>devtool upgrade</filename> works in a
+ less-automated manner than AUH.
+ Specifically, <filename>devtool upgrade</filename> only
+ works on a single recipe that you name on the command line,
+ cannot perform build and integration testing using images,
+ and does not automatically generate commits for changes in
+ the source tree.
+ Despite all these "limitations",
+ <filename>devtool upgrade</filename> updates the recipe file
+ to the new upstream version and attempts to rebase custom
+ patches contained by the recipe as needed.
+ <note>
+ AUH uses much of <filename>devtool upgrade</filename>
+ behind the scenes making AUH somewhat of a "wrapper"
+ application for <filename>devtool upgrade</filename>.
+ </note>
+ </para>
+
+ <para>
+ A typical scenario involves having used Git to clone an
+ upstream repository that you use during build operations.
+ Because you are (or have) built the recipe in the past, the
+ layer is likely added to your configuration already.
+ If for some reason, the layer is not added, you could add
+ it easily using the
+ <ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-bitbake-layers-script'><filename>bitbake-layers</filename></ulink>
+ script.
+ For example, suppose you use the <filename>nano.bb</filename>
+ recipe from the <filename>meta-oe</filename> layer in the
+ <filename>meta-openembedded</filename> repository.
+ For this example, assume that the layer has been cloned into
+ following area:
+ <literallayout class='monospaced'>
+ /home/scottrif/meta-openembedded
+ </literallayout>
+ The following command from your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ adds the layer to your build configuration (i.e.
+ <filename>${BUILDDIR}/conf/bblayers.conf</filename>):
+ <literallayout class='monospaced'>
+ $ bitbake-layers add-layer /home/scottrif/meta-openembedded/meta-oe
+ NOTE: Starting bitbake server...
+ Parsing recipes: 100% |##########################################| Time: 0:00:55
+ Parsing of 1431 .bb files complete (0 cached, 1431 parsed). 2040 targets, 56 skipped, 0 masked, 0 errors.
+ Removing 12 recipes from the x86_64 sysroot: 100% |##############| Time: 0:00:00
+ Removing 1 recipes from the x86_64_i586 sysroot: 100% |##########| Time: 0:00:00
+ Removing 5 recipes from the i586 sysroot: 100% |#################| Time: 0:00:00
+ Removing 5 recipes from the qemux86 sysroot: 100% |##############| Time: 0:00:00
+ </literallayout>
+ For this example, assume that the <filename>nano.bb</filename>
+ recipe that is upstream has a 2.9.3 version number.
+ However, the version in the local repository is 2.7.4.
+ The following command from your build directory automatically
+ upgrades the recipe for you:
+ <note>
+ Using the <filename>-V</filename> option is not necessary.
+ Omitting the version number causes
+ <filename>devtool upgrade</filename> to upgrade the recipe
+ to the most recent version.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool upgrade nano -V 2.9.3
+ NOTE: Starting bitbake server...
+ NOTE: Creating workspace layer in /home/scottrif/poky/build/workspace
+ Parsing recipes: 100% |##########################################| Time: 0:00:46
+ Parsing of 1431 .bb files complete (0 cached, 1431 parsed). 2040 targets, 56 skipped, 0 masked, 0 errors.
+ NOTE: Extracting current version source...
+ NOTE: Resolving any missing task queue dependencies
+ .
+ .
+ .
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ NOTE: Tasks Summary: Attempted 74 tasks of which 72 didn't need to be rerun and all succeeded.
+ Adding changed files: 100% |#####################################| Time: 0:00:00
+ NOTE: Upgraded source extracted to /home/scottrif/poky/build/workspace/sources/nano
+ NOTE: New recipe is /home/scottrif/poky/build/workspace/recipes/nano/nano_2.9.3.bb
+ </literallayout>
+ Continuing with this example, you can use
+ <filename>devtool build</filename> to build the newly upgraded
+ recipe:
+ <literallayout class='monospaced'>
+ $ devtool build nano
+ NOTE: Starting bitbake server...
+ Loading cache: 100% |################################################################################################| Time: 0:00:01
+ Loaded 2040 entries from dependency cache.
+ Parsing recipes: 100% |##############################################################################################| Time: 0:00:00
+ Parsing of 1432 .bb files complete (1431 cached, 1 parsed). 2041 targets, 56 skipped, 0 masked, 0 errors.
+ NOTE: Resolving any missing task queue dependencies
+ .
+ .
+ .
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ NOTE: nano: compiling from external source tree /home/scottrif/poky/build/workspace/sources/nano
+ NOTE: Tasks Summary: Attempted 520 tasks of which 304 didn't need to be rerun and all succeeded.
+ </literallayout>
+ Within the <filename>devtool upgrade</filename> workflow,
+ opportunity exists to deploy and test your rebuilt software.
+ For this example, however, running
+ <filename>devtool finish</filename> cleans up the workspace
+ once the source in your workspace is clean.
+ This usually means using Git to stage and submit commits
+ for the changes generated by the upgrade process.
+ </para>
+
+ <para>
+ Once the tree is clean, you can clean things up in this
+ example with the following command from the
+ <filename>${BUILDDIR}/workspace/sources/nano</filename>
+ directory:
+ <literallayout class='monospaced'>
+ $ devtool finish nano meta-oe
+ NOTE: Starting bitbake server...
+ Loading cache: 100% |################################################################################################| Time: 0:00:00
+ Loaded 2040 entries from dependency cache.
+ Parsing recipes: 100% |##############################################################################################| Time: 0:00:01
+ Parsing of 1432 .bb files complete (1431 cached, 1 parsed). 2041 targets, 56 skipped, 0 masked, 0 errors.
+ NOTE: Adding new patch 0001-nano.bb-Stuff-I-changed-when-upgrading-nano.bb.patch
+ NOTE: Updating recipe nano_2.9.3.bb
+ NOTE: Removing file /home/scottrif/meta-openembedded/meta-oe/recipes-support/nano/nano_2.7.4.bb
+ NOTE: Moving recipe file to /home/scottrif/meta-openembedded/meta-oe/recipes-support/nano
+ NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/nano as-is; if you no longer need it then please delete it manually
+ </literallayout>
+ Using the <filename>devtool finish</filename> command cleans
+ up the workspace and creates a patch file based on your
+ commits.
+ The tool puts all patch files back into the source directory
+ in a sub-directory named <filename>nano</filename> in this
+ case.
+ </para>
+ </section>
+
+ <section id='dev-manually-upgrading-a-recipe'>
+ <title>Manually Upgrading a Recipe</title>
+
+ <para>
+ If for some reason you choose not to upgrade recipes using the
+ <link linkend='gs-using-the-auto-upgrade-helper'>Auto Upgrade Helper (AUH)</link>
+ or by using
+ <link linkend='gs-using-devtool-upgrade'><filename>devtool upgrade</filename></link>,
+ you can manually edit the recipe files to upgrade the versions.
+ <note><title>Caution</title>
+ Manually updating multiple recipes scales poorly and
+ involves many steps.
+ The recommendation to upgrade recipe versions is through
+ AUH or <filename>devtool upgrade</filename>, both of which
+ automate some steps and provide guidance for others needed
+ for the manual process.
+ </note>
+ </para>
+
+ <para>
+ To manually upgrade recipe versions, follow these general steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Change the Version:</emphasis>
+ Rename the recipe such that the version (i.e. the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ part of the recipe name) changes appropriately.
+ If the version is not part of the recipe name, change
+ the value as it is set for <filename>PV</filename>
+ within the recipe itself.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Update <filename>SRCREV</filename> if Needed:</emphasis>
+ If the source code your recipe builds is fetched from
+ Git or some other version control system, update
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ to point to the commit hash that matches the new
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Software:</emphasis>
+ Try to build the recipe using BitBake.
+ Typical build failures include the following:
+ <itemizedlist>
+ <listitem><para>
+ License statements were updated for the new
+ version.
+ For this case, you need to review any changes
+ to the license and update the values of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink>
+ as needed.
+ <note>
+ License changes are often inconsequential.
+ For example, the license text's copyright
+ year might have changed.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Custom patches carried by the older version of
+ the recipe might fail to apply to the new
+ version.
+ For these cases, you need to review the
+ failures.
+ Patches might not be necessary for the new
+ version of the software if the upgraded version
+ has fixed those issues.
+ If a patch is necessary and failing, you need
+ to rebase it into the new version.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Attempt to Build for Several Architectures:</emphasis>
+ Once you successfully build the new software for a
+ given architecture, you could test the build for
+ other architectures by changing the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable and rebuilding the software.
+ This optional step is especially important if the
+ recipe is to be released publicly.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Check the Upstream Change Log or Release Notes:</emphasis>
+ Checking both these reveals if new features exist that
+ could break backwards-compatibility.
+ If so, you need to take steps to mitigate or eliminate
+ that situation.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Create a Bootable Image and Test:</emphasis>
+ If you want, you can test the new software by booting
+ it onto actual hardware.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Commit with the Change in the Layer Repository:</emphasis>
+ After all builds work and any testing is successful,
+ you can create commits for any changes in the layer
+ holding your upgraded recipe.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='finding-the-temporary-source-code'>
+ <title>Finding Temporary Source Code</title>
+
+ <para>
+ You might find it helpful during development to modify the
+ temporary source code used by recipes to build packages.
+ For example, suppose you are developing a patch and you need to
+ experiment a bit to figure out your solution.
+ After you have initially built the package, you can iteratively
+ tweak the source code, which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ and then you can force a re-compile and quickly test your altered
+ code.
+ Once you settle on a solution, you can then preserve your changes
+ in the form of patches.
+ </para>
+
+ <para>
+ During a build, the unpacked temporary source code used by recipes
+ to build packages is available in the Build Directory as
+ defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable.
+ Below is the default value for the <filename>S</filename> variable
+ as defined in the
+ <filename>meta/conf/bitbake.conf</filename> configuration file
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>:
+ <literallayout class='monospaced'>
+ S = "${WORKDIR}/${BP}"
+ </literallayout>
+ You should be aware that many recipes override the
+ <filename>S</filename> variable.
+ For example, recipes that fetch their source from Git usually set
+ <filename>S</filename> to <filename>${WORKDIR}/git</filename>.
+ <note>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BP'><filename>BP</filename></ulink>
+ represents the base recipe name, which consists of the name
+ and version:
+ <literallayout class='monospaced'>
+ BP = "${BPN}-${PV}"
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ The path to the work directory for the recipe
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>)
+ is defined as follows:
+ <literallayout class='monospaced'>
+ ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
+ </literallayout>
+ The actual directory depends on several things:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
+ The top-level build output directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></ulink>:
+ The target system identifier.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
+ The recipe name.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTENDPE'><filename>EXTENDPE</filename></ulink>:
+ The epoch - (if
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>
+ is not specified, which is usually the case for most
+ recipes, then <filename>EXTENDPE</filename> is blank).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The recipe version.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ The recipe revision.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ As an example, assume a Source Directory top-level folder
+ named <filename>poky</filename>, a default Build Directory at
+ <filename>poky/build</filename>, and a
+ <filename>qemux86-poky-linux</filename> machine target
+ system.
+ Furthermore, suppose your recipe is named
+ <filename>foo_1.3.0.bb</filename>.
+ In this case, the work directory the build system uses to
+ build the package would be as follows:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="using-a-quilt-workflow">
+ <title>Using Quilt in Your Workflow</title>
+
+ <para>
+ <ulink url='http://savannah.nongnu.org/projects/quilt'>Quilt</ulink>
+ is a powerful tool that allows you to capture source code changes
+ without having a clean source tree.
+ This section outlines the typical workflow you can use to modify
+ source code, test changes, and then preserve the changes in the
+ form of a patch all using Quilt.
+ <note><title>Tip</title>
+ With regard to preserving changes to source files, if you
+ clean a recipe or have <filename>rm_work</filename> enabled,
+ the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename> workflow</ulink>
+ as described in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK) manual
+ is a safer development flow than the flow that uses Quilt.
+ </note>
+ </para>
+
+ <para>
+ Follow these general steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Find the Source Code:</emphasis>
+ Temporary source code used by the OpenEmbedded build system
+ is kept in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ See the
+ "<link linkend='finding-the-temporary-source-code'>Finding Temporary Source Code</link>"
+ section to learn how to locate the directory that has the
+ temporary source code for a particular package.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Change Your Working Directory:</emphasis>
+ You need to be in the directory that has the temporary
+ source code.
+ That directory is defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable.</para></listitem>
+ <listitem><para>
+ <emphasis>Create a New Patch:</emphasis>
+ Before modifying source code, you need to create a new
+ patch.
+ To create a new patch file, use
+ <filename>quilt new</filename> as below:
+ <literallayout class='monospaced'>
+ $ quilt new my_changes.patch
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Notify Quilt and Add Files:</emphasis>
+ After creating the patch, you need to notify Quilt about
+ the files you plan to edit.
+ You notify Quilt by adding the files to the patch you
+ just created:
+ <literallayout class='monospaced'>
+ $ quilt add file1.c file2.c file3.c
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Files:</emphasis>
+ Make your changes in the source code to the files you added
+ to the patch.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test Your Changes:</emphasis>
+ Once you have modified the source code, the easiest way to
+ test your changes is by calling the
+ <filename>do_compile</filename> task as shown in the
+ following example:
+ <literallayout class='monospaced'>
+ $ bitbake -c compile -f <replaceable>package</replaceable>
+ </literallayout>
+ The <filename>-f</filename> or <filename>--force</filename>
+ option forces the specified task to execute.
+ If you find problems with your code, you can just keep
+ editing and re-testing iteratively until things work
+ as expected.
+ <note>
+ All the modifications you make to the temporary
+ source code disappear once you run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-clean'><filename>do_clean</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-cleanall'><filename>do_cleanall</filename></ulink>
+ tasks using BitBake (i.e.
+ <filename>bitbake -c clean <replaceable>package</replaceable></filename>
+ and
+ <filename>bitbake -c cleanall <replaceable>package</replaceable></filename>).
+ Modifications will also disappear if you use the
+ <filename>rm_work</filename> feature as described
+ in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-saving-memory-during-a-build'>Conserving Disk Space During Builds</ulink>"
+ section.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Generate the Patch:</emphasis>
+ Once your changes work as expected, you need to use Quilt
+ to generate the final patch that contains all your
+ modifications.
+ <literallayout class='monospaced'>
+ $ quilt refresh
+ </literallayout>
+ At this point, the <filename>my_changes.patch</filename>
+ file has all your edits made to the
+ <filename>file1.c</filename>, <filename>file2.c</filename>,
+ and <filename>file3.c</filename> files.</para>
+
+ <para>You can find the resulting patch file in the
+ <filename>patches/</filename> subdirectory of the source
+ (<filename>S</filename>) directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Copy the Patch File:</emphasis>
+ For simplicity, copy the patch file into a directory
+ named <filename>files</filename>, which you can create
+ in the same directory that holds the recipe
+ (<filename>.bb</filename>) file or the append
+ (<filename>.bbappend</filename>) file.
+ Placing the patch here guarantees that the OpenEmbedded
+ build system will find the patch.
+ Next, add the patch into the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'>SRC_URI</ulink></filename>
+ of the recipe.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://my_changes.patch"
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id="platdev-appdev-devshell">
+ <title>Using a Development Shell</title>
+
+ <para>
+ When debugging certain commands or even when just editing packages,
+ <filename>devshell</filename> can be a useful tool.
+ When you invoke <filename>devshell</filename>, all tasks up to and
+ including
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ are run for the specified target.
+ Then, a new terminal is opened and you are placed in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink><filename>}</filename>,
+ the source directory.
+ In the new terminal, all the OpenEmbedded build-related environment variables are
+ still defined so you can use commands such as <filename>configure</filename> and
+ <filename>make</filename>.
+ The commands execute just as if the OpenEmbedded build system were executing them.
+ Consequently, working this way can be helpful when debugging a build or preparing
+ software to be used with the OpenEmbedded build system.
+ </para>
+
+ <para>
+ Following is an example that uses <filename>devshell</filename> on a target named
+ <filename>matchbox-desktop</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c devshell
+ </literallayout>
+ </para>
+
+ <para>
+ This command spawns a terminal with a shell prompt within the OpenEmbedded build environment.
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
+ variable controls what type of shell is opened.
+ </para>
+
+ <para>
+ For spawned terminals, the following occurs:
+ <itemizedlist>
+ <listitem><para>The <filename>PATH</filename> variable includes the
+ cross-toolchain.</para></listitem>
+ <listitem><para>The <filename>pkgconfig</filename> variables find the correct
+ <filename>.pc</filename> files.</para></listitem>
+ <listitem><para>The <filename>configure</filename> command finds the
+ Yocto Project site files as well as any other necessary files.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Within this environment, you can run configure or compile
+ commands as if they were being run by
+ the OpenEmbedded build system itself.
+ As noted earlier, the working directory also automatically changes to the
+ Source Directory (<ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>).
+ </para>
+
+ <para>
+ To manually run a specific task using <filename>devshell</filename>,
+ run the corresponding <filename>run.*</filename> script in
+ the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/temp</filename>
+ directory (e.g.,
+ <filename>run.do_configure.</filename><replaceable>pid</replaceable>).
+ If a task's script does not exist, which would be the case if the task was
+ skipped by way of the sstate cache, you can create the task by first running
+ it outside of the <filename>devshell</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake -c <replaceable>task</replaceable>
+ </literallayout>
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>Execution of a task's <filename>run.*</filename>
+ script and BitBake's execution of a task are identical.
+ In other words, running the script re-runs the task
+ just as it would be run using the
+ <filename>bitbake -c</filename> command.
+ </para></listitem>
+ <listitem><para>Any <filename>run.*</filename> file that does not
+ have a <filename>.pid</filename> extension is a
+ symbolic link (symlink) to the most recent version of that
+ file.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ Remember, that the <filename>devshell</filename> is a mechanism that allows
+ you to get into the BitBake task execution environment.
+ And as such, all commands must be called just as BitBake would call them.
+ That means you need to provide the appropriate options for
+ cross-compilation and so forth as applicable.
+ </para>
+
+ <para>
+ When you are finished using <filename>devshell</filename>, exit the shell
+ or close the terminal window.
+ </para>
+
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ It is worth remembering that when using <filename>devshell</filename>
+ you need to use the full compiler name such as <filename>arm-poky-linux-gnueabi-gcc</filename>
+ instead of just using <filename>gcc</filename>.
+ The same applies to other applications such as <filename>binutils</filename>,
+ <filename>libtool</filename> and so forth.
+ BitBake sets up environment variables such as <filename>CC</filename>
+ to assist applications, such as <filename>make</filename> to find the correct tools.
+ </para></listitem>
+ <listitem><para>
+ It is also worth noting that <filename>devshell</filename> still works over
+ X11 forwarding and similar situations.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </section>
+
+ <section id="platdev-appdev-devpyshell">
+ <title>Using a Development Python Shell</title>
+
+ <para>
+ Similar to working within a development shell as described in
+ the previous section, you can also spawn and work within an
+ interactive Python development shell.
+ When debugging certain commands or even when just editing packages,
+ <filename>devpyshell</filename> can be a useful tool.
+ When you invoke <filename>devpyshell</filename>, all tasks up to and
+ including
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ are run for the specified target.
+ Then a new terminal is opened.
+ Additionally, key Python objects and code are available in the same
+ way they are to BitBake tasks, in particular, the data store 'd'.
+ So, commands such as the following are useful when exploring the data
+ store and running functions:
+ <literallayout class='monospaced'>
+ pydevshell> d.getVar("STAGING_DIR", True)
+ '/media/build1/poky/build/tmp/sysroots'
+ pydevshell> d.getVar("STAGING_DIR", False)
+ '${TMPDIR}/sysroots'
+ pydevshell> d.setVar("FOO", "bar")
+ pydevshell> d.getVar("FOO", True)
+ 'bar'
+ pydevshell> d.delVar("FOO")
+ pydevshell> d.getVar("FOO", True)
+ pydevshell> bb.build.exec_func("do_unpack", d)
+ pydevshell>
+ </literallayout>
+ The commands execute just as if the OpenEmbedded build system were executing them.
+ Consequently, working this way can be helpful when debugging a build or preparing
+ software to be used with the OpenEmbedded build system.
+ </para>
+
+ <para>
+ Following is an example that uses <filename>devpyshell</filename> on a target named
+ <filename>matchbox-desktop</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c devpyshell
+ </literallayout>
+ </para>
+
+ <para>
+ This command spawns a terminal and places you in an interactive
+ Python interpreter within the OpenEmbedded build environment.
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_TERMINAL'><filename>OE_TERMINAL</filename></ulink>
+ variable controls what type of shell is opened.
+ </para>
+
+ <para>
+ When you are finished using <filename>devpyshell</filename>, you
+ can exit the shell either by using Ctrl+d or closing the terminal
+ window.
+ </para>
+ </section>
+
+ <section id='dev-building'>
+ <title>Building</title>
+
+ <para>
+ This section describes various build procedures.
+ For example, the steps needed for a simple build, a target that
+ uses multiple configurations, building an image for more than
+ one machine, and so forth.
+ </para>
+
+ <section id='dev-building-a-simple-image'>
+ <title>Building a Simple Image</title>
+
+ <para>
+ In the development environment, you need to build an image
+ whenever you change hardware support, add or change system
+ libraries, or add or change services that have dependencies.
+ Several methods exist that allow you to build an image within
+ the Yocto Project.
+ This section presents the basic steps you need to build a
+ simple image using BitBake from a build host running Linux.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For information on how to build an image using
+ <ulink url='&YOCTO_DOCS_REF_URL;#toaster-term'>Toaster</ulink>,
+ see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ For information on how to use
+ <filename>devtool</filename> to build images, see
+ the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in Your SDK Workflow</ulink>"
+ section in the Yocto Project Application
+ Development and the Extensible Software Development
+ Kit (eSDK) manual.
+ </para></listitem>
+ <listitem><para>
+ For a quick example on how to build an image using
+ the OpenEmbedded build system, see the
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>
+ document.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The build process creates an entire Linux distribution from
+ source and places it in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ under <filename>tmp/deploy/images</filename>.
+ For detailed information on the build process using BitBake,
+ see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <para>
+ The following figure and list overviews the build process:
+ <imagedata fileref="figures/bitbake-build-flow.png" width="7in" depth="4in" align="center" scalefit="1" />
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set up Your Host Development System to Support
+ Development Using the Yocto Project</emphasis>:
+ See the
+ "<link linkend='dev-manual-start'>Setting Up to Use the Yocto Project</link>"
+ section for options on how to get a build host ready to
+ use the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Initialize the Build Environment:</emphasis>
+ Initialize the build environment by sourcing the build
+ environment script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>):
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE; [<replaceable>build_dir</replaceable>]
+ </literallayout></para>
+
+ <para>When you use the initialization script, the
+ OpenEmbedded build system uses
+ <filename>build</filename> as the default Build
+ Directory in your current work directory.
+ You can use a <replaceable>build_dir</replaceable>
+ argument with the script to specify a different build
+ directory.
+ <note><title>Tip</title>
+ A common practice is to use a different Build
+ Directory for different targets.
+ For example, <filename>~/build/x86</filename> for a
+ <filename>qemux86</filename> target, and
+ <filename>~/build/arm</filename> for a
+ <filename>qemuarm</filename> target.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Sure Your <filename>local.conf</filename>
+ File is Correct:</emphasis>
+ Ensure the <filename>conf/local.conf</filename>
+ configuration file, which is found in the Build
+ Directory, is set up how you want it.
+ This file defines many aspects of the build environment
+ including the target machine architecture through the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'>MACHINE</ulink></filename> variable,
+ the packaging format used during the build
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>),
+ and a centralized tarball download directory through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink> variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Image:</emphasis>
+ Build the image using the <filename>bitbake</filename>
+ command:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>target</replaceable>
+ </literallayout>
+ <note>
+ For information on BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </note>
+ The <replaceable>target</replaceable> is the name of the
+ recipe you want to build.
+ Common targets are the images in
+ <filename>meta/recipes-core/images</filename>,
+ <filename>meta/recipes-sato/images</filename>, and so
+ forth all found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ Or, the target can be the name of a recipe for a
+ specific piece of software such as BusyBox.
+ For more details about the images the OpenEmbedded build
+ system supports, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.</para>
+
+ <para>As an example, the following command builds the
+ <filename>core-image-minimal</filename> image:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-minimal
+ </literallayout>
+ Once an image has been built, it often needs to be
+ installed.
+ The images and kernels built by the OpenEmbedded
+ build system are placed in the Build Directory in
+ <filename class="directory">tmp/deploy/images</filename>.
+ For information on how to run pre-built images such as
+ <filename>qemux86</filename> and <filename>qemuarm</filename>,
+ see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ For information about how to install these images,
+ see the documentation for your particular board or
+ machine.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='platdev-building-targets-with-multiple-configurations'>
+ <title>Building Targets with Multiple Configurations</title>
+
+ <para>
+ Bitbake also has functionality that allows you to build
+ multiple targets at the same time, where each target uses
+ a different configuration.
+ </para>
+
+ <para>
+ In order to accomplish this, you setup each of the configurations
+ you need to use in parallel by placing the configuration files in
+ your current build directory alongside the usual
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ Follow these guidelines to create an environment that supports
+ multiple configurations:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Create Configuration Files</emphasis>:
+ You need to create a single configuration file for each
+ configuration for which you want to add support.
+ These files would contain lines such as the following:
+ <literallayout class='monospaced'>
+ MACHINE = "A"
+ </literallayout>
+ The files would contain any other variables that can
+ be set and built in the same directory.
+ <note>
+ You can change the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ to not conflict.
+ </note></para>
+
+ <para>
+ Furthermore, the configuration file must be located in the
+ current build directory in a directory named
+ <filename>multiconfig</filename> under the build's
+ <filename>conf</filename> directory where
+ <filename>local.conf</filename> resides.
+ The reason for this restriction is because the
+ <filename>BBPATH</filename> variable is not constructed
+ until the layers are parsed.
+ Consequently, using the configuration file as a
+ pre-configuration file is not possible unless it is
+ located in the current working directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add the BitBake Multi-Config Variable to you Local Configuration File</emphasis>:
+ Use the
+ <filename>BBMULTICONFIG</filename>
+ variable in your <filename>conf/local.conf</filename>
+ configuration file to specify each separate configuration.
+ For example, the following line tells BitBake it should load
+ <filename>conf/multiconfig/configA.conf</filename>,
+ <filename>conf/multiconfig/configB.conf</filename>, and
+ <filename>conf/multiconfig/configC.conf</filename>.
+ <literallayout class='monospaced'>
+ BBMULTICONFIG = "configA configB configC"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Launch BitBake</emphasis>:
+ Use the following BitBake command form to launch the
+ build:
+ <literallayout class='monospaced'>
+ $ bitbake [multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable> [[[multiconfig:<replaceable>multiconfigname</replaceable>:]<replaceable>target</replaceable>] ... ]
+ </literallayout>
+ Following is an example that supports building a minimal
+ image for configuration A alongside a standard
+ <filename>core-image-sato</filename>, which takes its
+ configuration from <filename>local.conf</filename>:
+ <literallayout class='monospaced'>
+ $ bitbake multiconfig:configA:core-image-minimal core-image-sato
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Support for multiple configurations in this current release of
+ the Yocto Project (&DISTRO_NAME; &DISTRO;) has some known issues:
+ <itemizedlist>
+ <listitem><para>
+ No inter-multi-configuration dependencies exist.
+ </para></listitem>
+ <listitem><para>
+ Shared State (sstate) optimizations do not exist.
+ Consequently, if the build uses the same object twice
+ in, for example, two different
+ <filename>TMPDIR</filename> directories, the build
+ will either load from an existing sstate cache at the
+ start or build the object twice.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='building-an-initramfs-image'>
+ <title>Building an Initial RAM Filesystem (initramfs) Image</title>
+
+ <para>
+ An initial RAM filesystem (initramfs) image provides a temporary
+ root filesystem used for early system initialization (e.g.
+ loading of modules needed to locate and mount the "real" root
+ filesystem).
+ <note>
+ The initramfs image is the successor of initial RAM disk
+ (initrd).
+ It is a "copy in and out" (cpio) archive of the initial
+ filesystem that gets loaded into memory during the Linux
+ startup process.
+ Because Linux uses the contents of the archive during
+ initialization, the initramfs image needs to contain all of the
+ device drivers and tools needed to mount the final root
+ filesystem.
+ </note>
+ </para>
+
+ <para>
+ Follow these steps to create an initramfs image:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create the initramfs Image Recipe:</emphasis>
+ You can reference the
+ <filename>core-image-minimal-initramfs.bb</filename>
+ recipe found in the <filename>meta/recipes-core</filename>
+ directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ as an example from which to work.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Decide if You Need to Bundle the initramfs Image
+ Into the Kernel Image:</emphasis>
+ If you want the initramfs image that is built to be
+ bundled in with the kernel image, set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
+ variable to "1" in your <filename>local.conf</filename>
+ configuration file and set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE'><filename>INITRAMFS_IMAGE</filename></ulink>
+ variable in the recipe that builds the kernel image.
+ <note><title>Tip</title>
+ It is recommended that you do bundle the initramfs
+ image with the kernel image to avoid circular
+ dependencies between the kernel recipe and the
+ initramfs recipe should the initramfs image
+ include kernel modules.
+ </note>
+ Setting the <filename>INITRAMFS_IMAGE_BUNDLE</filename>
+ flag causes the initramfs image to be unpacked
+ into the <filename>${B}/usr/</filename> directory.
+ The unpacked initramfs image is then passed to the kernel's
+ <filename>Makefile</filename> using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></ulink>
+ variable, allowing the initramfs image to be built into
+ the kernel normally.
+ <note>
+ If you choose to not bundle the initramfs image with
+ the kernel image, you are essentially using an
+ <ulink url='https://en.wikipedia.org/wiki/Initrd'>Initial RAM Disk (initrd)</ulink>.
+ Creating an initrd is handled primarily through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRD_IMAGE'><filename>INITRD_IMAGE</filename></ulink>,
+ <filename>INITRD_LIVE</filename>, and
+ <filename>INITRD_IMAGE_LIVE</filename> variables.
+ For more information, see the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/image-live.bbclass'><filename>image-live.bbclass</filename></ulink>
+ file.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Add Items to the initramfs Image
+ Through the initramfs Image Recipe:</emphasis>
+ If you add items to the initramfs image by way of its
+ recipe, you should use
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></ulink>
+ rather than
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>.
+ <filename>PACKAGE_INSTALL</filename> gives more direct
+ control of what is added to the image as compared to
+ the defaults you might not necessarily want that are
+ set by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image'><filename>image</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-core-image'><filename>core-image</filename></ulink>
+ classes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Kernel Image and the initramfs
+ Image:</emphasis>
+ Build your kernel image using BitBake.
+ Because the initramfs image recipe is a dependency of the
+ kernel image, the initramfs image is built as well and
+ bundled with the kernel image if you used the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></ulink>
+ variable described earlier.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='building-a-tiny-system'>
+ <title>Building a Tiny System</title>
+
+ <para>
+ Very small distributions have some significant advantages such
+ as requiring less on-die or in-package memory (cheaper), better
+ performance through efficient cache usage, lower power requirements
+ due to less memory, faster boot times, and reduced development
+ overhead.
+ Some real-world examples where a very small distribution gives
+ you distinct advantages are digital cameras, medical devices,
+ and small headless systems.
+ </para>
+
+ <para>
+ This section presents information that shows you how you can
+ trim your distribution to even smaller sizes than the
+ <filename>poky-tiny</filename> distribution, which is around
+ 5 Mbytes, that can be built out-of-the-box using the Yocto Project.
+ </para>
+
+ <section id='tiny-system-overview'>
+ <title>Overview</title>
+
+ <para>
+ The following list presents the overall steps you need to
+ consider and perform to create distributions with smaller
+ root filesystems, achieve faster boot times, maintain your critical
+ functionality, and avoid initial RAM disks:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='goals-and-guiding-principles'>Determine your goals and guiding principles.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='understand-what-gives-your-image-size'>Understand what contributes to your image size.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='trim-the-root-filesystem'>Reduce the size of the root filesystem.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='trim-the-kernel'>Reduce the size of the kernel.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='remove-package-management-requirements'>Eliminate packaging requirements.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='look-for-other-ways-to-minimize-size'>Look for other ways to minimize size.</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='iterate-on-the-process'>Iterate on the process.</link>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='goals-and-guiding-principles'>
+ <title>Goals and Guiding Principles</title>
+
+ <para>
+ Before you can reach your destination, you need to know
+ where you are going.
+ Here is an example list that you can use as a guide when
+ creating very small distributions:
+ <itemizedlist>
+ <listitem><para>Determine how much space you need
+ (e.g. a kernel that is 1 Mbyte or less and
+ a root filesystem that is 3 Mbytes or less).
+ </para></listitem>
+ <listitem><para>Find the areas that are currently
+ taking 90% of the space and concentrate on reducing
+ those areas.
+ </para></listitem>
+ <listitem><para>Do not create any difficult "hacks"
+ to achieve your goals.</para></listitem>
+ <listitem><para>Leverage the device-specific
+ options.</para></listitem>
+ <listitem><para>Work in a separate layer so that you
+ keep changes isolated.
+ For information on how to create layers, see
+ the "<link linkend='understanding-and-creating-layers'>Understanding and Creating Layers</link>" section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='understand-what-gives-your-image-size'>
+ <title>Understand What Contributes to Your Image Size</title>
+
+ <para>
+ It is easiest to have something to start with when creating
+ your own distribution.
+ You can use the Yocto Project out-of-the-box to create the
+ <filename>poky-tiny</filename> distribution.
+ Ultimately, you will want to make changes in your own
+ distribution that are likely modeled after
+ <filename>poky-tiny</filename>.
+ <note>
+ To use <filename>poky-tiny</filename> in your build,
+ set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ variable in your
+ <filename>local.conf</filename> file to "poky-tiny"
+ as described in the
+ "<link linkend='creating-your-own-distribution'>Creating Your Own Distribution</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ Understanding some memory concepts will help you reduce the
+ system size.
+ Memory consists of static, dynamic, and temporary memory.
+ Static memory is the TEXT (code), DATA (initialized data
+ in the code), and BSS (uninitialized data) sections.
+ Dynamic memory represents memory that is allocated at runtime:
+ stacks, hash tables, and so forth.
+ Temporary memory is recovered after the boot process.
+ This memory consists of memory used for decompressing
+ the kernel and for the <filename>__init__</filename>
+ functions.
+ </para>
+
+ <para>
+ To help you see where you currently are with kernel and root
+ filesystem sizes, you can use two tools found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> in
+ the <filename>scripts/tiny/</filename> directory:
+ <itemizedlist>
+ <listitem><para><filename>ksize.py</filename>: Reports
+ component sizes for the kernel build objects.
+ </para></listitem>
+ <listitem><para><filename>dirsize.py</filename>: Reports
+ component sizes for the root filesystem.</para></listitem>
+ </itemizedlist>
+ This next tool and command help you organize configuration
+ fragments and view file dependencies in a human-readable form:
+ <itemizedlist>
+ <listitem><para><filename>merge_config.sh</filename>:
+ Helps you manage configuration files and fragments
+ within the kernel.
+ With this tool, you can merge individual configuration
+ fragments together.
+ The tool allows you to make overrides and warns you
+ of any missing configuration options.
+ The tool is ideal for allowing you to iterate on
+ configurations, create minimal configurations, and
+ create configuration files for different machines
+ without having to duplicate your process.</para>
+ <para>The <filename>merge_config.sh</filename> script is
+ part of the Linux Yocto kernel Git repositories
+ (i.e. <filename>linux-yocto-3.14</filename>,
+ <filename>linux-yocto-3.10</filename>,
+ <filename>linux-yocto-3.8</filename>, and so forth)
+ in the
+ <filename>scripts/kconfig</filename> directory.</para>
+ <para>For more information on configuration fragments,
+ see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para></listitem>
+ <listitem><para><filename>bitbake -u taskexp -g <replaceable>bitbake_target</replaceable></filename>:
+ Using the BitBake command with these options brings up
+ a Dependency Explorer from which you can view file
+ dependencies.
+ Understanding these dependencies allows you to make
+ informed decisions when cutting out various pieces of the
+ kernel and root filesystem.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='trim-the-root-filesystem'>
+ <title>Trim the Root Filesystem</title>
+
+ <para>
+ The root filesystem is made up of packages for booting,
+ libraries, and applications.
+ To change things, you can configure how the packaging happens,
+ which changes the way you build them.
+ You can also modify the filesystem itself or select a different
+ filesystem.
+ </para>
+
+ <para>
+ First, find out what is hogging your root filesystem by running the
+ <filename>dirsize.py</filename> script from your root directory:
+ <literallayout class='monospaced'>
+ $ cd <replaceable>root-directory-of-image</replaceable>
+ $ dirsize.py 100000 > dirsize-100k.log
+ $ cat dirsize-100k.log
+ </literallayout>
+ You can apply a filter to the script to ignore files under
+ a certain size.
+ The previous example filters out any files below 100 Kbytes.
+ The sizes reported by the tool are uncompressed, and thus
+ will be smaller by a relatively constant factor in a
+ compressed root filesystem.
+ When you examine your log file, you can focus on areas of the
+ root filesystem that take up large amounts of memory.
+ </para>
+
+ <para>
+ You need to be sure that what you eliminate does not cripple
+ the functionality you need.
+ One way to see how packages relate to each other is by using
+ the Dependency Explorer UI with the BitBake command:
+ <literallayout class='monospaced'>
+ $ cd <replaceable>image-directory</replaceable>
+ $ bitbake -u taskexp -g <replaceable>image</replaceable>
+ </literallayout>
+ Use the interface to select potential packages you wish to
+ eliminate and see their dependency relationships.
+ </para>
+
+ <para>
+ When deciding how to reduce the size, get rid of packages that
+ result in minimal impact on the feature set.
+ For example, you might not need a VGA display.
+ Or, you might be able to get by with <filename>devtmpfs</filename>
+ and <filename>mdev</filename> instead of
+ <filename>udev</filename>.
+ </para>
+
+ <para>
+ Use your <filename>local.conf</filename> file to make changes.
+ For example, to eliminate <filename>udev</filename> and
+ <filename>glib</filename>, set the following in the
+ local configuration file:
+ <literallayout class='monospaced'>
+ VIRTUAL-RUNTIME_dev_manager = ""
+ </literallayout>
+ </para>
+
+ <para>
+ Finally, you should consider exactly the type of root
+ filesystem you need to meet your needs while also reducing
+ its size.
+ For example, consider <filename>cramfs</filename>,
+ <filename>squashfs</filename>, <filename>ubifs</filename>,
+ <filename>ext2</filename>, or an <filename>initramfs</filename>
+ using <filename>initramfs</filename>.
+ Be aware that <filename>ext3</filename> requires a 1 Mbyte
+ journal.
+ If you are okay with running read-only, you do not need this
+ journal.
+ </para>
+
+ <note>
+ After each round of elimination, you need to rebuild your
+ system and then use the tools to see the effects of your
+ reductions.
+ </note>
+ </section>
+
+ <section id='trim-the-kernel'>
+ <title>Trim the Kernel</title>
+
+ <para>
+ The kernel is built by including policies for hardware-independent
+ aspects.
+ What subsystems do you enable?
+ For what architecture are you building?
+ Which drivers do you build by default?
+ <note>You can modify the kernel source if you want to help
+ with boot time.
+ </note>
+ </para>
+
+ <para>
+ Run the <filename>ksize.py</filename> script from the top-level
+ Linux build directory to get an idea of what is making up
+ the kernel:
+ <literallayout class='monospaced'>
+ $ cd <replaceable>top-level-linux-build-directory</replaceable>
+ $ ksize.py > ksize.log
+ $ cat ksize.log
+ </literallayout>
+ When you examine the log, you will see how much space is
+ taken up with the built-in <filename>.o</filename> files for
+ drivers, networking, core kernel files, filesystem, sound,
+ and so forth.
+ The sizes reported by the tool are uncompressed, and thus
+ will be smaller by a relatively constant factor in a compressed
+ kernel image.
+ Look to reduce the areas that are large and taking up around
+ the "90% rule."
+ </para>
+
+ <para>
+ To examine, or drill down, into any particular area, use the
+ <filename>-d</filename> option with the script:
+ <literallayout class='monospaced'>
+ $ ksize.py -d > ksize.log
+ </literallayout>
+ Using this option breaks out the individual file information
+ for each area of the kernel (e.g. drivers, networking, and
+ so forth).
+ </para>
+
+ <para>
+ Use your log file to see what you can eliminate from the kernel
+ based on features you can let go.
+ For example, if you are not going to need sound, you do not
+ need any drivers that support sound.
+ </para>
+
+ <para>
+ After figuring out what to eliminate, you need to reconfigure
+ the kernel to reflect those changes during the next build.
+ You could run <filename>menuconfig</filename> and make all your
+ changes at once.
+ However, that makes it difficult to see the effects of your
+ individual eliminations and also makes it difficult to replicate
+ the changes for perhaps another target device.
+ A better method is to start with no configurations using
+ <filename>allnoconfig</filename>, create configuration
+ fragments for individual changes, and then manage the
+ fragments into a single configuration file using
+ <filename>merge_config.sh</filename>.
+ The tool makes it easy for you to iterate using the
+ configuration change and build cycle.
+ </para>
+
+ <para>
+ Each time you make configuration changes, you need to rebuild
+ the kernel and check to see what impact your changes had on
+ the overall size.
+ </para>
+ </section>
+
+ <section id='remove-package-management-requirements'>
+ <title>Remove Package Management Requirements</title>
+
+ <para>
+ Packaging requirements add size to the image.
+ One way to reduce the size of the image is to remove all the
+ packaging requirements from the image.
+ This reduction includes both removing the package manager
+ and its unique dependencies as well as removing the package
+ management data itself.
+ </para>
+
+ <para>
+ To eliminate all the packaging requirements for an image,
+ be sure that "package-management" is not part of your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ statement for the image.
+ When you remove this feature, you are removing the package
+ manager as well as its dependencies from the root filesystem.
+ </para>
+ </section>
+
+ <section id='look-for-other-ways-to-minimize-size'>
+ <title>Look for Other Ways to Minimize Size</title>
+
+ <para>
+ Depending on your particular circumstances, other areas that you
+ can trim likely exist.
+ The key to finding these areas is through tools and methods
+ described here combined with experimentation and iteration.
+ Here are a couple of areas to experiment with:
+ <itemizedlist>
+ <listitem><para><filename>glibc</filename>:
+ In general, follow this process:
+ <orderedlist>
+ <listitem><para>Remove <filename>glibc</filename>
+ features from
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
+ that you think you do not need.</para></listitem>
+ <listitem><para>Build your distribution.
+ </para></listitem>
+ <listitem><para>If the build fails due to missing
+ symbols in a package, determine if you can
+ reconfigure the package to not need those
+ features.
+ For example, change the configuration to not
+ support wide character support as is done for
+ <filename>ncurses</filename>.
+ Or, if support for those characters is needed,
+ determine what <filename>glibc</filename>
+ features provide the support and restore the
+ configuration.
+ </para></listitem>
+ <listitem><para>Rebuild and repeat the process.
+ </para></listitem>
+ </orderedlist></para></listitem>
+ <listitem><para><filename>busybox</filename>:
+ For BusyBox, use a process similar as described for
+ <filename>glibc</filename>.
+ A difference is you will need to boot the resulting
+ system to see if you are able to do everything you
+ expect from the running system.
+ You need to be sure to integrate configuration fragments
+ into Busybox because BusyBox handles its own core
+ features and then allows you to add configuration
+ fragments on top.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='iterate-on-the-process'>
+ <title>Iterate on the Process</title>
+
+ <para>
+ If you have not reached your goals on system size, you need
+ to iterate on the process.
+ The process is the same.
+ Use the tools and see just what is taking up 90% of the root
+ filesystem and the kernel.
+ Decide what you can eliminate without limiting your device
+ beyond what you need.
+ </para>
+
+ <para>
+ Depending on your system, a good place to look might be
+ Busybox, which provides a stripped down
+ version of Unix tools in a single, executable file.
+ You might be able to drop virtual terminal services or perhaps
+ ipv6.
+ </para>
+ </section>
+ </section>
+
+ <section id='building-images-for-more-than-one-machine'>
+ <title>Building Images for More than One Machine</title>
+
+ <para>
+ A common scenario developers face is creating images for several
+ different machines that use the same software environment.
+ In this situation, it is tempting to set the
+ tunings and optimization flags for each build specifically for
+ the targeted hardware (i.e. "maxing out" the tunings).
+ Doing so can considerably add to build times and package feed
+ maintenance collectively for the machines.
+ For example, selecting tunes that are extremely specific to a
+ CPU core used in a system might enable some micro optimizations
+ in GCC for that particular system but would otherwise not gain
+ you much of a performance difference across the other systems
+ as compared to using a more general tuning across all the builds
+ (e.g. setting
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></ulink>
+ specifically for each machine's build).
+ Rather than "max out" each build's tunings, you can take steps that
+ cause the OpenEmbedded build system to reuse software across the
+ various machines where it makes sense.
+ </para>
+
+ <para>
+ If build speed and package feed maintenance are considerations,
+ you should consider the points in this section that can help you
+ optimize your tunings to best consider build times and package
+ feed maintenance.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Share the Build Directory:</emphasis>
+ If at all possible, share the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ across builds.
+ The Yocto Project supports switching between different
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ values in the same <filename>TMPDIR</filename>.
+ This practice is well supported and regularly used by
+ developers when building for multiple machines.
+ When you use the same <filename>TMPDIR</filename> for
+ multiple machine builds, the OpenEmbedded build system can
+ reuse the existing native and often cross-recipes for
+ multiple machines.
+ Thus, build time decreases.
+ <note>
+ If
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ settings change or fundamental configuration settings
+ such as the filesystem layout, you need to work with
+ a clean <filename>TMPDIR</filename>.
+ Sharing <filename>TMPDIR</filename> under these
+ circumstances might work but since it is not
+ guaranteed, you should use a clean
+ <filename>TMPDIR</filename>.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Enable the Appropriate Package Architecture:</emphasis>
+ By default, the OpenEmbedded build system enables three
+ levels of package architectures: "all", "tune" or "package",
+ and "machine".
+ Any given recipe usually selects one of these package
+ architectures (types) for its output.
+ Depending for what a given recipe creates packages, making
+ sure you enable the appropriate package architecture can
+ directly impact the build time.</para>
+
+ <para>A recipe that just generates scripts can enable
+ "all" architecture because there are no binaries to build.
+ To specifically enable "all" architecture, be sure your
+ recipe inherits the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-allarch'><filename>allarch</filename></ulink>
+ class.
+ This class is useful for "all" architectures because it
+ configures many variables so packages can be used across
+ multiple architectures.</para>
+
+ <para>If your recipe needs to generate packages that are
+ machine-specific or when one of the build or runtime
+ dependencies is already machine-architecture dependent,
+ which makes your recipe also machine-architecture dependent,
+ make sure your recipe enables the "machine" package
+ architecture through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></ulink>
+ variable:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCH = "${MACHINE_ARCH}"
+ </literallayout>
+ When you do not specifically enable a package
+ architecture through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>,
+ The OpenEmbedded build system defaults to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></ulink>
+ setting:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCH = "${TUNE_PKGARCH}"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Choose a Generic Tuning File if Possible:</emphasis>
+ Some tunes are more generic and can run on multiple targets
+ (e.g. an <filename>armv5</filename> set of packages could
+ run on <filename>armv6</filename> and
+ <filename>armv7</filename> processors in most cases).
+ Similarly, <filename>i486</filename> binaries could work
+ on <filename>i586</filename> and higher processors.
+ You should realize, however, that advances on newer
+ processor versions would not be used.</para>
+
+ <para>If you select the same tune for several different
+ machines, the OpenEmbedded build system reuses software
+ previously built, thus speeding up the overall build time.
+ Realize that even though a new sysroot for each machine is
+ generated, the software is not recompiled and only one
+ package feed exists.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Manage Granular Level Packaging:</emphasis>
+ Sometimes cases exist where injecting another level of
+ package architecture beyond the three higher levels noted
+ earlier can be useful.
+ For example, consider how NXP (formerly Freescale) allows
+ for the easy reuse of binary packages in their layer
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/'><filename>meta-freescale</filename></ulink>.
+ In this example, the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/meta-freescale/tree/classes/fsl-dynamic-packagearch.bbclass'><filename>fsl-dynamic-packagearch</filename></ulink>
+ class shares GPU packages for i.MX53 boards because
+ all boards share the AMD GPU.
+ The i.MX6-based boards can do the same because all boards
+ share the Vivante GPU.
+ This class inspects the BitBake datastore to identify if
+ the package provides or depends on one of the
+ sub-architecture values.
+ If so, the class sets the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>
+ value based on the <filename>MACHINE_SUBARCH</filename>
+ value.
+ If the package does not provide or depend on one of the
+ sub-architecture values but it matches a value in the
+ machine-specific filter, it sets
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></ulink>.
+ This behavior reduces the number of packages built and
+ saves build time by reusing binaries.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use Tools to Debug Issues:</emphasis>
+ Sometimes you can run into situations where software is
+ being rebuilt when you think it should not be.
+ For example, the OpenEmbedded build system might not be
+ using shared state between machines when you think it
+ should be.
+ These types of situations are usually due to references
+ to machine-specific variables such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-XSERVER'><filename>XSERVER</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></ulink>,
+ and so forth in code that is supposed to only be
+ tune-specific or when the recipe depends
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RSUGGESTS'><filename>RSUGGESTS</filename></ulink>,
+ and so forth) on some other recipe that already has
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>
+ defined as "${MACHINE_ARCH}".
+ <note>
+ Patches to fix any issues identified are most welcome
+ as these issues occasionally do occur.
+ </note></para>
+
+ <para>For such cases, you can use some tools to help you
+ sort out the situation:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>sstate-diff-machines.sh</filename>:</emphasis>
+ You can find this tool in the
+ <filename>scripts</filename> directory of the
+ Source Repositories.
+ See the comments in the script for information on
+ how to use the tool.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>BitBake's "-S printdiff" Option:</emphasis>
+ Using this option causes BitBake to try to
+ establish the closest signature match it can
+ (e.g. in the shared state cache) and then run
+ <filename>bitbake-diffsigs</filename> over the
+ matches to determine the stamps and delta where
+ these two stamp trees diverge.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="building-software-from-an-external-source">
+ <title>Building Software from an External Source</title>
+
+ <para>
+ By default, the OpenEmbedded build system uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ when building source code.
+ The build process involves fetching the source files, unpacking
+ them, and then patching them if necessary before the build takes
+ place.
+ </para>
+
+ <para>
+ Situations exist where you might want to build software from source
+ files that are external to and thus outside of the
+ OpenEmbedded build system.
+ For example, suppose you have a project that includes a new BSP with
+ a heavily customized kernel.
+ And, you want to minimize exposing the build system to the
+ development team so that they can focus on their project and
+ maintain everyone's workflow as much as possible.
+ In this case, you want a kernel source directory on the development
+ machine where the development occurs.
+ You want the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable to point to the external directory and use it as is, not
+ copy it.
+ </para>
+
+ <para>
+ To build from software that comes from an external source, all you
+ need to do is inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc</filename></ulink>
+ class and then set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink>
+ variable to point to your external source code.
+ Here are the statements to put in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ INHERIT += "externalsrc"
+ EXTERNALSRC_pn-<replaceable>myrecipe</replaceable> = "<replaceable>path-to-your-source-tree</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ This next example shows how to accomplish the same thing by setting
+ <filename>EXTERNALSRC</filename> in the recipe itself or in the
+ recipe's append file:
+ <literallayout class='monospaced'>
+ EXTERNALSRC = "<replaceable>path</replaceable>"
+ EXTERNALSRC_BUILD = "<replaceable>path</replaceable>"
+ </literallayout>
+ <note>
+ In order for these settings to take effect, you must globally
+ or locally inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc</filename></ulink>
+ class.
+ </note>
+ </para>
+
+ <para>
+ By default, <filename>externalsrc.bbclass</filename> builds
+ the source code in a directory separate from the external source
+ directory as specified by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC'><filename>EXTERNALSRC</filename></ulink>.
+ If you need to have the source built in the same directory in
+ which it resides, or some other nominated directory, you can set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></ulink>
+ to point to that directory:
+ <literallayout class='monospaced'>
+ EXTERNALSRC_BUILD_pn-<replaceable>myrecipe</replaceable> = "<replaceable>path-to-your-source-tree</replaceable>"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+
+
+ <section id='speeding-up-a-build'>
+ <title>Speeding Up a Build</title>
+
+ <para>
+ Build time can be an issue.
+ By default, the build system uses simple controls to try and maximize
+ build efficiency.
+ In general, the default settings for all the following variables
+ result in the most efficient build times when dealing with single
+ socket systems (i.e. a single CPU).
+ If you have multiple CPUs, you might try increasing the default
+ values to gain more speed.
+ See the descriptions in the glossary for each variable for more
+ information:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename>:</ulink>
+ The maximum number of threads BitBake simultaneously executes.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_NUMBER_PARSE_THREADS'><filename>BB_NUMBER_PARSE_THREADS</filename>:</ulink>
+ The number of threads BitBake uses during parsing.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename>:</ulink>
+ Extra options passed to the <filename>make</filename> command
+ during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ task in order to specify parallel compilation on the
+ local build host.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename>:</ulink>
+ Extra options passed to the <filename>make</filename> command
+ during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task in order to specify parallel installation on the
+ local build host.
+ </para></listitem>
+ </itemizedlist>
+ As mentioned, these variables all scale to the number of processor
+ cores available on the build system.
+ For single socket systems, this auto-scaling ensures that the build
+ system fundamentally takes advantage of potential parallel operations
+ during the build based on the build machine's capabilities.
+ </para>
+
+ <para>
+ Following are additional factors that can affect build speed:
+ <itemizedlist>
+ <listitem><para>
+ File system type:
+ The file system type that the build is being performed on can
+ also influence performance.
+ Using <filename>ext4</filename> is recommended as compared
+ to <filename>ext2</filename> and <filename>ext3</filename>
+ due to <filename>ext4</filename> improved features
+ such as extents.
+ </para></listitem>
+ <listitem><para>
+ Disabling the updating of access time using
+ <filename>noatime</filename>:
+ The <filename>noatime</filename> mount option prevents the
+ build system from updating file and directory access times.
+ </para></listitem>
+ <listitem><para>
+ Setting a longer commit:
+ Using the "commit=" mount option increases the interval
+ in seconds between disk cache writes.
+ Changing this interval from the five second default to
+ something longer increases the risk of data loss but decreases
+ the need to write to the disk, thus increasing the build
+ performance.
+ </para></listitem>
+ <listitem><para>
+ Choosing the packaging backend:
+ Of the available packaging backends, IPK is the fastest.
+ Additionally, selecting a singular packaging backend also
+ helps.
+ </para></listitem>
+ <listitem><para>
+ Using <filename>tmpfs</filename> for
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ as a temporary file system:
+ While this can help speed up the build, the benefits are
+ limited due to the compiler using
+ <filename>-pipe</filename>.
+ The build system goes to some lengths to avoid
+ <filename>sync()</filename> calls into the
+ file system on the principle that if there was a significant
+ failure, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ contents could easily be rebuilt.
+ </para></listitem>
+ <listitem><para>
+ Inheriting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-rm-work'><filename>rm_work</filename></ulink>
+ class:
+ Inheriting this class has shown to speed up builds due to
+ significantly lower amounts of data stored in the data
+ cache as well as on disk.
+ Inheriting this class also makes cleanup of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ faster, at the expense of being easily able to dive into the
+ source code.
+ File system maintainers have recommended that the fastest way
+ to clean up large numbers of files is to reformat partitions
+ rather than delete files due to the linear nature of
+ partitions.
+ This, of course, assumes you structure the disk partitions and
+ file systems in a way that this is practical.
+ </para></listitem>
+ </itemizedlist>
+ Aside from the previous list, you should keep some trade offs in
+ mind that can help you speed up the build:
+ <itemizedlist>
+ <listitem><para>
+ Remove items from
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
+ that you might not need.
+ </para></listitem>
+ <listitem><para>
+ Exclude debug symbols and other debug information:
+ If you do not need these symbols and other debug information,
+ disabling the <filename>*-dbg</filename> package generation
+ can speed up the build.
+ You can disable this generation by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHIBIT_PACKAGE_DEBUG_SPLIT'><filename>INHIBIT_PACKAGE_DEBUG_SPLIT</filename></ulink>
+ variable to "1".
+ </para></listitem>
+ <listitem><para>
+ Disable static library generation for recipes derived from
+ <filename>autoconf</filename> or <filename>libtool</filename>:
+ Following is an example showing how to disable static
+ libraries and still provide an override to handle exceptions:
+ <literallayout class='monospaced'>
+ STATICLIBCONF = "--disable-static"
+ STATICLIBCONF_sqlite3-native = ""
+ EXTRA_OECONF += "${STATICLIBCONF}"
+ </literallayout>
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Some recipes need static libraries in order to work
+ correctly (e.g. <filename>pseudo-native</filename>
+ needs <filename>sqlite3-native</filename>).
+ Overrides, as in the previous example, account for
+ these kinds of exceptions.
+ </para></listitem>
+ <listitem><para>
+ Some packages have packaging code that assumes the
+ presence of the static libraries.
+ If so, you might need to exclude them as well.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="platdev-working-with-libraries">
+ <title>Working With Libraries</title>
+
+ <para>
+ Libraries are an integral part of your system.
+ This section describes some common practices you might find
+ helpful when working with libraries to build your system:
+ <itemizedlist>
+ <listitem><para><link linkend='including-static-library-files'>How to include static library files</link>
+ </para></listitem>
+ <listitem><para><link linkend='combining-multiple-versions-library-files-into-one-image'>How to use the Multilib feature to combine multiple versions of library files into a single image</link>
+ </para></listitem>
+ <listitem><para><link linkend='installing-multiple-versions-of-the-same-library'>How to install multiple versions of the same library in parallel on the same system</link>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='including-static-library-files'>
+ <title>Including Static Library Files</title>
+
+ <para>
+ If you are building a library and the library offers static linking, you can control
+ which static library files (<filename>*.a</filename> files) get included in the
+ built library.
+ </para>
+
+ <para>
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES_*</filename></ulink>
+ variables in the
+ <filename>meta/conf/bitbake.conf</filename> configuration file define how files installed
+ by the <filename>do_install</filename> task are packaged.
+ By default, the <filename>PACKAGES</filename> variable includes
+ <filename>${PN}-staticdev</filename>, which represents all static library files.
+ <note>
+ Some previously released versions of the Yocto Project
+ defined the static library files through
+ <filename>${PN}-dev</filename>.
+ </note>
+ Following is part of the BitBake configuration file, where
+ you can see how the static library files are defined:
+ <literallayout class='monospaced'>
+ PACKAGE_BEFORE_PN ?= ""
+ PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
+ PACKAGES_DYNAMIC = "^${PN}-locale-.*"
+ FILES = ""
+
+ FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
+ ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+ ${base_bindir}/* ${base_sbindir}/* \
+ ${base_libdir}/*${SOLIBS} \
+ ${base_prefix}/lib/udev/rules.d ${prefix}/lib/udev/rules.d \
+ ${datadir}/${BPN} ${libdir}/${BPN}/* \
+ ${datadir}/pixmaps ${datadir}/applications \
+ ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
+ ${libdir}/bonobo/servers"
+
+ FILES_${PN}-bin = "${bindir}/* ${sbindir}/*"
+
+ FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
+ ${datadir}/gnome/help"
+ SECTION_${PN}-doc = "doc"
+
+ FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
+ FILES_${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
+ ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
+ ${datadir}/aclocal ${base_libdir}/*.o \
+ ${libdir}/${BPN}/*.la ${base_libdir}/*.la"
+ SECTION_${PN}-dev = "devel"
+ ALLOW_EMPTY_${PN}-dev = "1"
+ RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
+
+ FILES_${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
+ SECTION_${PN}-staticdev = "devel"
+ RDEPENDS_${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="combining-multiple-versions-library-files-into-one-image">
+ <title>Combining Multiple Versions of Library Files into One Image</title>
+
+ <para>
+ The build system offers the ability to build libraries with different
+ target optimizations or architecture formats and combine these together
+ into one system image.
+ You can link different binaries in the image
+ against the different libraries as needed for specific use cases.
+ This feature is called "Multilib."
+ </para>
+
+ <para>
+ An example would be where you have most of a system compiled in 32-bit
+ mode using 32-bit libraries, but you have something large, like a database
+ engine, that needs to be a 64-bit application and uses 64-bit libraries.
+ Multilib allows you to get the best of both 32-bit and 64-bit libraries.
+ </para>
+
+ <para>
+ While the Multilib feature is most commonly used for 32 and 64-bit differences,
+ the approach the build system uses facilitates different target optimizations.
+ You could compile some binaries to use one set of libraries and other binaries
+ to use a different set of libraries.
+ The libraries could differ in architecture, compiler options, or other
+ optimizations.
+ </para>
+
+ <para>
+ Several examples exist in the
+ <filename>meta-skeleton</filename> layer found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>:
+ <itemizedlist>
+ <listitem><para><filename>conf/multilib-example.conf</filename>
+ configuration file</para></listitem>
+ <listitem><para><filename>conf/multilib-example2.conf</filename>
+ configuration file</para></listitem>
+ <listitem><para><filename>recipes-multilib/images/core-image-multilib-example.bb</filename>
+ recipe</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='preparing-to-use-multilib'>
+ <title>Preparing to Use Multilib</title>
+
+ <para>
+ User-specific requirements drive the Multilib feature.
+ Consequently, there is no one "out-of-the-box" configuration that likely
+ exists to meet your needs.
+ </para>
+
+ <para>
+ In order to enable Multilib, you first need to ensure your recipe is
+ extended to support multiple libraries.
+ Many standard recipes are already extended and support multiple libraries.
+ You can check in the <filename>meta/conf/multilib.conf</filename>
+ configuration file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink> to see how this is
+ done using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></ulink>
+ variable.
+ Eventually, all recipes will be covered and this list will
+ not be needed.
+ </para>
+
+ <para>
+ For the most part, the Multilib class extension works automatically to
+ extend the package name from <filename>${PN}</filename> to
+ <filename>${MLPREFIX}${PN}</filename>, where <filename>MLPREFIX</filename>
+ is the particular multilib (e.g. "lib32-" or "lib64-").
+ Standard variables such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RPROVIDES'><filename>RPROVIDES</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>, and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES_DYNAMIC'><filename>PACKAGES_DYNAMIC</filename></ulink>
+ are automatically extended by the system.
+ If you are extending any manual code in the recipe, you can use the
+ <filename>${MLPREFIX}</filename> variable to ensure those names are extended
+ correctly.
+ This automatic extension code resides in <filename>multilib.bbclass</filename>.
+ </para>
+ </section>
+
+ <section id='using-multilib'>
+ <title>Using Multilib</title>
+
+ <para>
+ After you have set up the recipes, you need to define the actual
+ combination of multiple libraries you want to build.
+ You accomplish this through your <filename>local.conf</filename>
+ configuration file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ An example configuration would be as follows:
+ <literallayout class='monospaced'>
+ MACHINE = "qemux86-64"
+ require conf/multilib.conf
+ MULTILIBS = "multilib:lib32"
+ DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
+ IMAGE_INSTALL_append = " lib32-glib-2.0"
+ </literallayout>
+ This example enables an
+ additional library named <filename>lib32</filename> alongside the
+ normal target packages.
+ When combining these "lib32" alternatives, the example uses "x86" for tuning.
+ For information on this particular tuning, see
+ <filename>meta/conf/machine/include/ia32/arch-ia32.inc</filename>.
+ </para>
+
+ <para>
+ The example then includes <filename>lib32-glib-2.0</filename>
+ in all the images, which illustrates one method of including a
+ multiple library dependency.
+ You can use a normal image build to include this dependency,
+ for example:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ You can also build Multilib packages specifically with a command like this:
+ <literallayout class='monospaced'>
+ $ bitbake lib32-glib-2.0
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='additional-implementation-details'>
+ <title>Additional Implementation Details</title>
+
+ <para>
+ Generic implementation details as well as details that are
+ specific to package management systems exist.
+ Following are implementation details that exist regardless
+ of the package management system:
+ <itemizedlist>
+ <listitem><para>The typical convention used for the
+ class extension code as used by
+ Multilib assumes that all package names specified
+ in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>
+ that contain <filename>${PN}</filename> have
+ <filename>${PN}</filename> at the start of the name.
+ When that convention is not followed and
+ <filename>${PN}</filename> appears at
+ the middle or the end of a name, problems occur.
+ </para></listitem>
+ <listitem><para>The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_VENDOR'><filename>TARGET_VENDOR</filename></ulink>
+ value under Multilib will be extended to
+ "-<replaceable>vendor</replaceable>ml<replaceable>multilib</replaceable>"
+ (e.g. "-pokymllib32" for a "lib32" Multilib with
+ Poky).
+ The reason for this slightly unwieldy contraction
+ is that any "-" characters in the vendor
+ string presently break Autoconf's
+ <filename>config.sub</filename>, and
+ other separators are problematic for different
+ reasons.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For the RPM Package Management System, the following implementation details
+ exist:
+ <itemizedlist>
+ <listitem><para>A unique architecture is defined for the Multilib packages,
+ along with creating a unique deploy folder under
+ <filename>tmp/deploy/rpm</filename> in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ For example, consider <filename>lib32</filename> in a
+ <filename>qemux86-64</filename> image.
+ The possible architectures in the system are "all", "qemux86_64",
+ "lib32_qemux86_64", and "lib32_x86".</para></listitem>
+ <listitem><para>The <filename>${MLPREFIX}</filename> variable is stripped from
+ <filename>${PN}</filename> during RPM packaging.
+ The naming for a normal RPM package and a Multilib RPM package in a
+ <filename>qemux86-64</filename> system resolves to something similar to
+ <filename>bash-4.1-r2.x86_64.rpm</filename> and
+ <filename>bash-4.1.r2.lib32_x86.rpm</filename>, respectively.
+ </para></listitem>
+ <listitem><para>When installing a Multilib image, the RPM backend first
+ installs the base image and then installs the Multilib libraries.
+ </para></listitem>
+ <listitem><para>The build system relies on RPM to resolve the identical files in the
+ two (or more) Multilib packages.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For the IPK Package Management System, the following implementation details exist:
+ <itemizedlist>
+ <listitem><para>The <filename>${MLPREFIX}</filename> is not stripped from
+ <filename>${PN}</filename> during IPK packaging.
+ The naming for a normal RPM package and a Multilib IPK package in a
+ <filename>qemux86-64</filename> system resolves to something like
+ <filename>bash_4.1-r2.x86_64.ipk</filename> and
+ <filename>lib32-bash_4.1-rw_x86.ipk</filename>, respectively.
+ </para></listitem>
+ <listitem><para>The IPK deploy folder is not modified with
+ <filename>${MLPREFIX}</filename> because packages with and without
+ the Multilib feature can exist in the same folder due to the
+ <filename>${PN}</filename> differences.</para></listitem>
+ <listitem><para>IPK defines a sanity check for Multilib installation
+ using certain rules for file comparison, overridden, etc.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='installing-multiple-versions-of-the-same-library'>
+ <title>Installing Multiple Versions of the Same Library</title>
+
+ <para>
+ Situations can exist where you need to install and use
+ multiple versions of the same library on the same system
+ at the same time.
+ These situations almost always exist when a library API
+ changes and you have multiple pieces of software that
+ depend on the separate versions of the library.
+ To accommodate these situations, you can install multiple
+ versions of the same library in parallel on the same system.
+ </para>
+
+ <para>
+ The process is straightforward as long as the libraries use
+ proper versioning.
+ With properly versioned libraries, all you need to do to
+ individually specify the libraries is create separate,
+ appropriately named recipes where the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink> part of the
+ name includes a portion that differentiates each library version
+ (e.g.the major part of the version number).
+ Thus, instead of having a single recipe that loads one version
+ of a library (e.g. <filename>clutter</filename>), you provide
+ multiple recipes that result in different versions
+ of the libraries you want.
+ As an example, the following two recipes would allow the
+ two separate versions of the <filename>clutter</filename>
+ library to co-exist on the same system:
+ <literallayout class='monospaced'>
+ clutter-1.6_1.6.20.bb
+ clutter-1.8_1.8.4.bb
+ </literallayout>
+ Additionally, if you have other recipes that depend on a given
+ library, you need to use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable to create the dependency.
+ Continuing with the same example, if you want to have a recipe
+ depend on the 1.8 version of the <filename>clutter</filename>
+ library, use the following in your recipe:
+ <literallayout class='monospaced'>
+ DEPENDS = "clutter-1.8"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='using-x32-psabi'>
+ <title>Using x32 psABI</title>
+
+ <para>
+ x32 processor-specific Application Binary Interface
+ (<ulink url='https://software.intel.com/en-us/node/628948'>x32 psABI</ulink>)
+ is a native 32-bit processor-specific ABI for
+ <trademark class='registered'>Intel</trademark> 64 (x86-64)
+ architectures.
+ An ABI defines the calling conventions between functions in a
+ processing environment.
+ The interface determines what registers are used and what the
+ sizes are for various C data types.
+ </para>
+
+ <para>
+ Some processing environments prefer using 32-bit applications even
+ when running on Intel 64-bit platforms.
+ Consider the i386 psABI, which is a very old 32-bit ABI for Intel
+ 64-bit platforms.
+ The i386 psABI does not provide efficient use and access of the
+ Intel 64-bit processor resources, leaving the system underutilized.
+ Now consider the x86_64 psABI.
+ This ABI is newer and uses 64-bits for data sizes and program
+ pointers.
+ The extra bits increase the footprint size of the programs,
+ libraries, and also increases the memory and file system size
+ requirements.
+ Executing under the x32 psABI enables user programs to utilize CPU
+ and system resources more efficiently while keeping the memory
+ footprint of the applications low.
+ Extra bits are used for registers but not for addressing mechanisms.
+ </para>
+
+ <para>
+ The Yocto Project supports the final specifications of x32 psABI
+ as follows:
+ <itemizedlist>
+ <listitem><para>
+ You can create packages and images in x32 psABI format on
+ x86_64 architecture targets.
+ </para></listitem>
+ <listitem><para>
+ You can successfully build recipes with the x32 toolchain.
+ </para></listitem>
+ <listitem><para>
+ You can create and boot
+ <filename>core-image-minimal</filename> and
+ <filename>core-image-sato</filename> images.
+ </para></listitem>
+ <listitem><para>
+ RPM Package Manager (RPM) support exists for x32 binaries.
+ </para></listitem>
+ <listitem><para>
+ Support for large images exists.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ To use the x32 psABI, you need to edit your
+ <filename>conf/local.conf</filename> configuration file as
+ follows:
+ <literallayout class='monospaced'>
+ MACHINE = "qemux86-64"
+ DEFAULTTUNE = "x86-64-x32"
+ baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) \
+ or 'INVALID'), True) or 'lib'}"
+ </literallayout>
+ Once you have set up your configuration file, use BitBake to
+ build an image that supports the x32 psABI.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='enabling-gobject-introspection-support'>
+ <title>Enabling GObject Introspection Support</title>
+
+ <para>
+ <ulink url='https://wiki.gnome.org/Projects/GObjectIntrospection'>GObject introspection</ulink>
+ is the standard mechanism for accessing GObject-based software
+ from runtime environments.
+ GObject is a feature of the GLib library that provides an object
+ framework for the GNOME desktop and related software.
+ GObject Introspection adds information to GObject that allows
+ objects created within it to be represented across different
+ programming languages.
+ If you want to construct GStreamer pipelines using Python, or
+ control UPnP infrastructure using Javascript and GUPnP,
+ GObject introspection is the only way to do it.
+ </para>
+
+ <para>
+ This section describes the Yocto Project support for generating
+ and packaging GObject introspection data.
+ GObject introspection data is a description of the
+ API provided by libraries built on top of GLib framework,
+ and, in particular, that framework's GObject mechanism.
+ GObject Introspection Repository (GIR) files go to
+ <filename>-dev</filename> packages,
+ <filename>typelib</filename> files go to main packages as they
+ are packaged together with libraries that are introspected.
+ </para>
+
+ <para>
+ The data is generated when building such a library, by linking
+ the library with a small executable binary that asks the library
+ to describe itself, and then executing the binary and
+ processing its output.
+ </para>
+
+ <para>
+ Generating this data in a cross-compilation environment
+ is difficult because the library is produced for the target
+ architecture, but its code needs to be executed on the build host.
+ This problem is solved with the OpenEmbedded build system by
+ running the code through QEMU, which allows precisely that.
+ Unfortunately, QEMU does not always work perfectly as mentioned
+ in the xxx section.
+ </para>
+
+ <section id='enabling-the-generation-of-introspection-data'>
+ <title>Enabling the Generation of Introspection Data</title>
+
+ <para>
+ Enabling the generation of introspection data (GIR files)
+ in your library package involves the following:
+ <orderedlist>
+ <listitem><para>
+ Inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-gobject-introspection'><filename>gobject-introspection</filename></ulink>
+ class.
+ </para></listitem>
+ <listitem><para>
+ Make sure introspection is not disabled anywhere in
+ the recipe or from anything the recipe includes.
+ Also, make sure that "gobject-introspection-data" is
+ not in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></ulink>
+ and that "qemu-usermode" is not in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></ulink>.
+ If either of these conditions exist, nothing will
+ happen.
+ </para></listitem>
+ <listitem><para>
+ Try to build the recipe.
+ If you encounter build errors that look like
+ something is unable to find
+ <filename>.so</filename> libraries, check where these
+ libraries are located in the source tree and add
+ the following to the recipe:
+ <literallayout class='monospaced'>
+ GIR_EXTRA_LIBS_PATH = "${B}/<replaceable>something</replaceable>/.libs"
+ </literallayout>
+ <note>
+ See recipes in the <filename>oe-core</filename>
+ repository that use that
+ <filename>GIR_EXTRA_LIBS_PATH</filename> variable
+ as an example.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Look for any other errors, which probably mean that
+ introspection support in a package is not entirely
+ standard, and thus breaks down in a cross-compilation
+ environment.
+ For such cases, custom-made fixes are needed.
+ A good place to ask and receive help in these cases
+ is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Yocto Project mailing lists</ulink>.
+ </para></listitem>
+ </orderedlist>
+ <note>
+ Using a library that no longer builds against the latest
+ Yocto Project release and prints introspection related
+ errors is a good candidate for the previous procedure.
+ </note>
+ </para>
+ </section>
+
+ <section id='disabling-the-generation-of-introspection-data'>
+ <title>Disabling the Generation of Introspection Data</title>
+
+ <para>
+ You might find that you do not want to generate
+ introspection data.
+ Or, perhaps QEMU does not work on your build host and
+ target architecture combination.
+ If so, you can use either of the following methods to
+ disable GIR file generations:
+ <itemizedlist>
+ <listitem><para>
+ Add the following to your distro configuration:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_BACKFILL_CONSIDERED = "gobject-introspection-data"
+ </literallayout>
+ Adding this statement disables generating
+ introspection data using QEMU but will still enable
+ building introspection tools and libraries
+ (i.e. building them does not require the use of QEMU).
+ </para></listitem>
+ <listitem><para>
+ Add the following to your machine configuration:
+ <literallayout class='monospaced'>
+ MACHINE_FEATURES_BACKFILL_CONSIDERED = "qemu-usermode"
+ </literallayout>
+ Adding this statement disables the use of QEMU
+ when building packages for your machine.
+ Currently, this feature is used only by introspection
+ recipes and has the same effect as the previously
+ described option.
+ <note>
+ Future releases of the Yocto Project might have
+ other features affected by this option.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ If you disable introspection data, you can still
+ obtain it through other means such as copying the data
+ from a suitable sysroot, or by generating it on the
+ target hardware.
+ The OpenEmbedded build system does not currently
+ provide specific support for these techniques.
+ </para>
+ </section>
+
+ <section id='testing-that-introspection-works-in-an-image'>
+ <title>Testing that Introspection Works in an Image</title>
+
+ <para>
+ Use the following procedure to test if generating
+ introspection data is working in an image:
+ <orderedlist>
+ <listitem><para>
+ Make sure that "gobject-introspection-data" is not in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></ulink>
+ and that "qemu-usermode" is not in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></ulink>.
+ </para></listitem>
+ <listitem><para>
+ Build <filename>core-image-sato</filename>.
+ </para></listitem>
+ <listitem><para>
+ Launch a Terminal and then start Python in the
+ terminal.
+ </para></listitem>
+ <listitem><para>
+ Enter the following in the terminal:
+ <literallayout class='monospaced'>
+ >>> from gi.repository import GLib
+ >>> GLib.get_host_name()
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ For something a little more advanced, enter the
+ following:
+ <literallayout class='monospaced'>
+ http://python-gtk-3-tutorial.readthedocs.org/en/latest/introduction.html
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='known-issues'>
+ <title>Known Issues</title>
+
+ <para>
+ The following know issues exist for
+ GObject Introspection Support:
+ <itemizedlist>
+ <listitem><para>
+ <filename>qemu-ppc64</filename> immediately crashes.
+ Consequently, you cannot build introspection data on
+ that architecture.
+ </para></listitem>
+ <listitem><para>
+ x32 is not supported by QEMU.
+ Consequently, introspection data is disabled.
+ </para></listitem>
+ <listitem><para>
+ musl causes transient GLib binaries to crash on
+ assertion failures.
+ Consequently, generating introspection data is
+ disabled.
+ </para></listitem>
+ <listitem><para>
+ Because QEMU is not able to run the binaries correctly,
+ introspection is disabled for some specific packages
+ under specific architectures (e.g.
+ <filename>gcr</filename>,
+ <filename>libsecret</filename>, and
+ <filename>webkit</filename>).
+ </para></listitem>
+ <listitem><para>
+ QEMU usermode might not work properly when running
+ 64-bit binaries under 32-bit host machines.
+ In particular, "qemumips64" is known to not work under
+ i686.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='dev-optionally-using-an-external-toolchain'>
+ <title>Optionally Using an External Toolchain</title>
+
+ <para>
+ You might want to use an external toolchain as part of your
+ development.
+ If this is the case, the fundamental steps you need to accomplish
+ are as follows:
+ <itemizedlist>
+ <listitem><para>
+ Understand where the installed toolchain resides.
+ For cases where you need to build the external toolchain,
+ you would need to take separate steps to build and install
+ the toolchain.
+ </para></listitem>
+ <listitem><para>
+ Make sure you add the layer that contains the toolchain to
+ your <filename>bblayers.conf</filename> file through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ Set the <filename>EXTERNAL_TOOLCHAIN</filename>
+ variable in your <filename>local.conf</filename> file
+ to the location in which you installed the toolchain.
+ </para></listitem>
+ </itemizedlist>
+ A good example of an external toolchain used with the Yocto Project
+ is <trademark class='registered'>Mentor Graphics</trademark>
+ Sourcery G++ Toolchain.
+ You can see information on how to use that particular layer in the
+ <filename>README</filename> file at
+ <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>.
+ You can find further information by reading about the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TCMODE'><filename>TCMODE</filename></ulink>
+ variable in the Yocto Project Reference Manual's variable glossary.
+ </para>
+ </section>
+
+ <section id='creating-partitioned-images-using-wic'>
+ <title>Creating Partitioned Images Using Wic</title>
+
+ <para>
+ Creating an image for a particular hardware target using the
+ OpenEmbedded build system does not necessarily mean you can boot
+ that image as is on your device.
+ Physical devices accept and boot images in various ways depending
+ on the specifics of the device.
+ Usually, information about the hardware can tell you what image
+ format the device requires.
+ Should your device require multiple partitions on an SD card, flash,
+ or an HDD, you can use the OpenEmbedded Image Creator,
+ Wic, to create the properly partitioned image.
+ </para>
+
+ <para>
+ The <filename>wic</filename> command generates partitioned
+ images from existing OpenEmbedded build artifacts.
+ Image generation is driven by partitioning commands
+ contained in an Openembedded kickstart file
+ (<filename>.wks</filename>) specified either directly on
+ the command line or as one of a selection of canned
+ kickstart files as shown with the
+ <filename>wic list images</filename> command in the
+ "<link linkend='using-a-provided-kickstart-file'>Using an Existing Kickstart File</link>"
+ section.
+ When you apply the command to a given set of build
+ artifacts, the result is an image or set of images that
+ can be directly written onto media and used on a particular
+ system.
+ <note>
+ For a kickstart file reference, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-kickstart'>OpenEmbedded Kickstart (<filename>.wks</filename>) Reference</ulink>"
+ Chapter in the Yocto Project Reference Manual.
+ </note>
+ </para>
+
+ <para>
+ The <filename>wic</filename> command and the infrastructure
+ it is based on is by definition incomplete.
+ The purpose of the command is to allow the generation of
+ customized images, and as such, was designed to be
+ completely extensible through a plug-in interface.
+ See the
+ "<link linkend='wic-using-the-wic-plug-ins-interface'>Using the Wic Plug-Ins Interface</link>"
+ section for information on these plug-ins.
+ </para>
+
+ <para>
+ This section provides some background information on Wic,
+ describes what you need to have in
+ place to run the tool, provides instruction on how to use
+ the Wic utility, provides information on using the Wic plug-ins
+ interface, and provides several examples that show how to use
+ Wic.
+ </para>
+
+ <section id='wic-background'>
+ <title>Background</title>
+
+ <para>
+ This section provides some background on the Wic utility.
+ While none of this information is required to use
+ Wic, you might find it interesting.
+ <itemizedlist>
+ <listitem><para>
+ The name "Wic" is derived from OpenEmbedded
+ Image Creator (oeic).
+ The "oe" diphthong in "oeic" was promoted to the
+ letter "w", because "oeic" is both difficult to
+ remember and to pronounce.
+ </para></listitem>
+ <listitem><para>
+ Wic is loosely based on the
+ Meego Image Creator (<filename>mic</filename>)
+ framework.
+ The Wic implementation has been
+ heavily modified to make direct use of OpenEmbedded
+ build artifacts instead of package installation and
+ configuration, which are already incorporated within
+ the OpenEmbedded artifacts.
+ </para></listitem>
+ <listitem><para>
+ Wic is a completely independent
+ standalone utility that initially provides
+ easier-to-use and more flexible replacements for an
+ existing functionality in OE-Core's
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-image-live'><filename>image-live</filename></ulink>
+ class and <filename>mkefidisk.sh</filename> script.
+ The difference between
+ Wic and those examples is
+ that with Wic the
+ functionality of those scripts is implemented
+ by a general-purpose partitioning language, which is
+ based on Redhat kickstart syntax.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='wic-requirements'>
+ <title>Requirements</title>
+
+ <para>
+ In order to use the Wic utility with the OpenEmbedded Build
+ system, your system needs to meet the following
+ requirements:
+ <itemizedlist>
+ <listitem><para>
+ The Linux distribution on your development host must
+ support the Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
+ section in the Yocto Project Reference Manual for
+ the list of distributions that support the
+ Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ The standard system utilities, such as
+ <filename>cp</filename>, must be installed on your
+ development host system.
+ </para></listitem>
+ <listitem><para>
+ You must have sourced the build environment
+ setup script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>)
+ found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para></listitem>
+ <listitem><para>
+ You need to have the build artifacts already
+ available, which typically means that you must
+ have already created an image using the
+ Openembedded build system (e.g.
+ <filename>core-image-minimal</filename>).
+ While it might seem redundant to generate an image
+ in order to create an image using
+ Wic, the current version of
+ Wic requires the artifacts
+ in the form generated by the OpenEmbedded build
+ system.
+ </para></listitem>
+ <listitem><para>
+ You must build several native tools, which are
+ built to run on the build system:
+ <literallayout class='monospaced'>
+ $ bitbake parted-native dosfstools-native mtools-native
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Include "wic" as part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ Include the name of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#openembedded-kickstart-wks-reference'>wic kickstart file</ulink>
+ as part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE'><filename>WKS_FILE</filename></ulink>
+ variable
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='wic-getting-help'>
+ <title>Getting Help</title>
+
+ <para>
+ You can get general help for the <filename>wic</filename>
+ command by entering the <filename>wic</filename> command
+ by itself or by entering the command with a help argument
+ as follows:
+ <literallayout class='monospaced'>
+ $ wic -h
+ $ wic --help
+ $ wic help
+ </literallayout>
+ </para>
+
+ <para>
+ Currently, Wic supports seven commands:
+ <filename>cp</filename>, <filename>create</filename>,
+ <filename>help</filename>, <filename>list</filename>,
+ <filename>ls</filename>, <filename>rm</filename>, and
+ <filename>write</filename>.
+ You can get help for all these commands except "help" by
+ using the following form:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>command</replaceable>
+ </literallayout>
+ For example, the following command returns help for the
+ <filename>write</filename> command:
+ <literallayout class='monospaced'>
+ $ wic help write
+ </literallayout>
+ </para>
+
+ <para>
+ Wic supports help for three topics:
+ <filename>overview</filename>,
+ <filename>plugins</filename>, and
+ <filename>kickstart</filename>.
+ You can get help for any topic using the following form:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>topic</replaceable>
+ </literallayout>
+ For example, the following returns overview help for Wic:
+ <literallayout class='monospaced'>
+ $ wic help overview
+ </literallayout>
+ </para>
+
+ <para>
+ One additional level of help exists for Wic.
+ You can get help on individual images through the
+ <filename>list</filename> command.
+ You can use the <filename>list</filename> command to return the
+ available Wic images as follows:
+ <literallayout class='monospaced'>
+ $ wic list images
+ mpc8315e-rdb Create SD card image for MPC8315E-RDB
+ genericx86 Create an EFI disk image for genericx86*
+ beaglebone-yocto Create SD card image for Beaglebone
+ edgerouter Create SD card image for Edgerouter
+ qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
+ directdisk-gpt Create a 'pcbios' direct disk image
+ mkefidisk Create an EFI disk image
+ directdisk Create a 'pcbios' direct disk image
+ systemd-bootdisk Create an EFI disk image with systemd-boot
+ mkhybridiso Create a hybrid ISO image
+ sdimage-bootpart Create SD card image with a boot partition
+ directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
+ directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
+ </literallayout>
+ Once you know the list of available Wic images, you can use
+ <filename>help</filename> with the command to get help on a
+ particular image.
+ For example, the following command returns help on the
+ "beaglebone-yocto" image:
+ <literallayout class='monospaced'>
+ $ wic list beaglebone-yocto help
+
+
+ Creates a partitioned SD card image for Beaglebone.
+ Boot files are located in the first vfat partition.
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='operational-modes'>
+ <title>Operational Modes</title>
+
+ <para>
+ You can use Wic in two different
+ modes, depending on how much control you need for
+ specifying the Openembedded build artifacts that are
+ used for creating the image: Raw and Cooked:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Raw Mode:</emphasis>
+ You explicitly specify build artifacts through
+ Wic command-line arguments.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Cooked Mode:</emphasis>
+ The current
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ setting and image name are used to automatically
+ locate and provide the build artifacts.
+ You just supply a kickstart file and the name
+ of the image from which to use artifacts.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Regardless of the mode you use, you need to have the build
+ artifacts ready and available.
+ </para>
+
+ <section id='raw-mode'>
+ <title>Raw Mode</title>
+
+ <para>
+ Running Wic in raw mode allows you to specify all the
+ partitions through the <filename>wic</filename>
+ command line.
+ The primary use for raw mode is if you have built
+ your kernel outside of the Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ In other words, you can point to arbitrary kernel,
+ root filesystem locations, and so forth.
+ Contrast this behavior with cooked mode where Wic
+ looks in the Build Directory (e.g.
+ <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>).
+ </para>
+
+ <para>
+ The general form of the
+ <filename>wic</filename> command in raw mode is:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>wks_file</replaceable> <replaceable>options</replaceable> ...
+
+ Where:
+
+ <replaceable>wks_file</replaceable>:
+ An OpenEmbedded kickstart file. You can provide
+ your own custom file or use a file from a set of
+ existing files as described by further options.
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -o <replaceable>OUTDIR</replaceable>, --outdir <replaceable>OUTDIR</replaceable>
+ name of directory to create image in
+ -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable>
+ name of the image to use the artifacts from e.g. core-
+ image-sato
+ -r <replaceable>ROOTFS_DIR</replaceable>, --rootfs-dir <replaceable>ROOTFS_DIR</replaceable>
+ path to the /rootfs dir to use as the .wks rootfs
+ source
+ -b <replaceable>BOOTIMG_DIR</replaceable>, --bootimg-dir <replaceable>BOOTIMG_DIR</replaceable>
+ path to the dir containing the boot artifacts (e.g.
+ /EFI or /syslinux dirs) to use as the .wks bootimg
+ source
+ -k <replaceable>KERNEL_DIR</replaceable>, --kernel-dir <replaceable>KERNEL_DIR</replaceable>
+ path to the dir containing the kernel to use in the
+ .wks bootimg
+ -n <replaceable>NATIVE_SYSROOT</replaceable>, --native-sysroot <replaceable>NATIVE_SYSROOT</replaceable>
+ path to the native sysroot containing the tools to use
+ to build the image
+ -s, --skip-build-check
+ skip the build check
+ -f, --build-rootfs build rootfs
+ -c {gzip,bzip2,xz}, --compress-with {gzip,bzip2,xz}
+ compress image with specified compressor
+ -m, --bmap generate .bmap
+ --no-fstab-update Do not change fstab file.
+ -v <replaceable>VARS_DIR</replaceable>, --vars <replaceable>VARS_DIR</replaceable>
+ directory with &lt;image&gt;.env files that store bitbake
+ variables
+ -D, --debug output debug information
+ </literallayout>
+ <note>
+ You do not need root privileges to run
+ Wic.
+ In fact, you should not run as root when using the
+ utility.
+ </note>
+ </para>
+ </section>
+
+ <section id='cooked-mode'>
+ <title>Cooked Mode</title>
+
+ <para>
+ Running Wic in cooked mode leverages off artifacts in
+ the Build Directory.
+ In other words, you do not have to specify kernel or
+ root filesystem locations as part of the command.
+ All you need to provide is a kickstart file and the
+ name of the image from which to use artifacts by using
+ the "-e" option.
+ Wic looks in the Build Directory (e.g.
+ <filename>tmp/deploy/images/</filename><replaceable>machine</replaceable>)
+ for artifacts.
+ </para>
+
+ <para>
+ The general form of the <filename>wic</filename>
+ command using Cooked Mode is as follows:
+ <literallayout class='monospaced'>
+ $ wic create <replaceable>wks_file</replaceable> -e <replaceable>IMAGE_NAME</replaceable>
+
+ Where:
+
+ <replaceable>wks_file</replaceable>:
+ An OpenEmbedded kickstart file. You can provide
+ your own custom file or use a file from a set of
+ existing files provided with the Yocto Project
+ release.
+
+ required argument:
+ -e <replaceable>IMAGE_NAME</replaceable>, --image-name <replaceable>IMAGE_NAME</replaceable>
+ name of the image to use the artifacts from e.g. core-
+ image-sato
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='using-a-provided-kickstart-file'>
+ <title>Using an Existing Kickstart File</title>
+
+ <para>
+ If you do not want to create your own kickstart file, you
+ can use an existing file provided by the Wic installation.
+ As shipped, kickstart files can be found in the
+ Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ in the following two locations:
+ <literallayout class='monospaced'>
+ poky/meta-yocto-bsp/wic
+ poky/scripts/lib/wic/canned-wks
+ </literallayout>
+ Use the following command to list the available kickstart
+ files:
+ <literallayout class='monospaced'>
+ $ wic list images
+ mpc8315e-rdb Create SD card image for MPC8315E-RDB
+ genericx86 Create an EFI disk image for genericx86*
+ beaglebone-yocto Create SD card image for Beaglebone
+ edgerouter Create SD card image for Edgerouter
+ qemux86-directdisk Create a qemu machine 'pcbios' direct disk image
+ directdisk-gpt Create a 'pcbios' direct disk image
+ mkefidisk Create an EFI disk image
+ directdisk Create a 'pcbios' direct disk image
+ systemd-bootdisk Create an EFI disk image with systemd-boot
+ mkhybridiso Create a hybrid ISO image
+ sdimage-bootpart Create SD card image with a boot partition
+ directdisk-multi-rootfs Create multi rootfs image using rootfs plugin
+ directdisk-bootloader-config Create a 'pcbios' direct disk image with custom bootloader config
+ </literallayout>
+ When you use an existing file, you do not have to use the
+ <filename>.wks</filename> extension.
+ Here is an example in Raw Mode that uses the
+ <filename>directdisk</filename> file:
+ <literallayout class='monospaced'>
+ $ wic create directdisk -r <replaceable>rootfs_dir</replaceable> -b <replaceable>bootimg_dir</replaceable> \
+ -k <replaceable>kernel_dir</replaceable> -n <replaceable>native_sysroot</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ Here are the actual partition language commands
+ used in the <filename>genericx86.wks</filename> file to
+ generate an image:
+ <literallayout class='monospaced'>
+ # short-description: Create an EFI disk image for genericx86*
+ # long-description: Creates a partitioned EFI disk image for genericx86* machines
+ part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+ part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+ part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+ bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='wic-using-the-wic-plug-ins-interface'>
+ <title>Using the Wic Plug-Ins Interface</title>
+
+ <para>
+ You can extend and specialize Wic functionality by using
+ Wic plug-ins.
+ This section explains the Wic plug-in interface.
+ <note>
+ Wic plug-ins consist of "source" and "imager" plug-ins.
+ Imager plug-ins are beyond the scope of this section.
+ </note>
+ </para>
+
+ <para>
+ Source plug-ins provide a mechanism to customize partition
+ content during the Wic image generation process.
+ You can use source plug-ins to map values that you specify
+ using <filename>--source</filename> commands in kickstart
+ files (i.e. <filename>*.wks</filename>) to a plug-in
+ implementation used to populate a given partition.
+ <note>
+ If you use plug-ins that have build-time dependencies
+ (e.g. native tools, bootloaders, and so forth)
+ when building a Wic image, you need to specify those
+ dependencies using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WKS_FILE_DEPENDS'><filename>WKS_FILE_DEPENDS</filename></ulink>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ Source plug-ins are subclasses defined in plug-in files.
+ As shipped, the Yocto Project provides several plug-in
+ files.
+ You can see the source plug-in files that ship with the
+ Yocto Project
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/scripts/lib/wic/plugins/source'>here</ulink>.
+ Each of these plug-in files contains source plug-ins that
+ are designed to populate a specific Wic image partition.
+ </para>
+
+ <para>
+ Source plug-ins are subclasses of the
+ <filename>SourcePlugin</filename> class, which is
+ defined in the
+ <filename>poky/scripts/lib/wic/pluginbase.py</filename>
+ file.
+ For example, the <filename>BootimgEFIPlugin</filename>
+ source plug-in found in the
+ <filename>bootimg-efi.py</filename> file is a subclass of
+ the <filename>SourcePlugin</filename> class, which is found
+ in the <filename>pluginbase.py</filename> file.
+ </para>
+
+ <para>
+ You can also implement source plug-ins in a layer outside
+ of the Source Repositories (external layer).
+ To do so, be sure that your plug-in files are located in
+ a directory whose path is
+ <filename>scripts/lib/wic/plugins/source/</filename>
+ within your external layer.
+ When the plug-in files are located there, the source
+ plug-ins they contain are made available to Wic.
+ </para>
+
+ <para>
+ When the Wic implementation needs to invoke a
+ partition-specific implementation, it looks for the plug-in
+ with the same name as the <filename>--source</filename>
+ parameter used in the kickstart file given to that
+ partition.
+ For example, if the partition is set up using the following
+ command in a kickstart file:
+ <literallayout class='monospaced'>
+ part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+ </literallayout>
+ The methods defined as class members of the matching
+ source plug-in (i.e. <filename>bootimg-pcbios</filename>)
+ in the <filename>bootimg-pcbios.py</filename> plug-in file
+ are used.
+ </para>
+
+ <para>
+ To be more concrete, here is the corresponding plug-in
+ definition from the <filename>bootimg-pcbios.py</filename>
+ file for the previous command along with an example
+ method called by the Wic implementation when it needs to
+ prepare a partition using an implementation-specific
+ function:
+ <literallayout class='monospaced'>
+ .
+ .
+ .
+ class BootimgPcbiosPlugin(SourcePlugin):
+ """
+ Create MBR boot partition and install syslinux on it.
+ """
+
+ name = 'bootimg-pcbios'
+ .
+ .
+ .
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, prepare content for legacy bios boot partition.
+ """
+ .
+ .
+ .
+ </literallayout>
+ If a subclass (plug-in) itself does not implement a
+ particular function, Wic locates and uses the default
+ version in the superclass.
+ It is for this reason that all source plug-ins are derived
+ from the <filename>SourcePlugin</filename> class.
+ </para>
+
+ <para>
+ The <filename>SourcePlugin</filename> class defined in
+ the <filename>pluginbase.py</filename> file defines
+ a set of methods that source plug-ins can implement or
+ override.
+ Any plug-ins (subclass of
+ <filename>SourcePlugin</filename>) that do not implement
+ a particular method inherit the implementation of the
+ method from the <filename>SourcePlugin</filename> class.
+ For more information, see the
+ <filename>SourcePlugin</filename> class in the
+ <filename>pluginbase.py</filename> file for details:
+ </para>
+
+ <para>
+ The following list describes the methods implemented in the
+ <filename>SourcePlugin</filename> class:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>do_prepare_partition()</filename>:</emphasis>
+ Called to populate a partition with actual content.
+ In other words, the method prepares the final
+ partition image that is incorporated into the
+ disk image.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_configure_partition()</filename>:</emphasis>
+ Called before
+ <filename>do_prepare_partition()</filename> to
+ create custom configuration files for a partition
+ (e.g. syslinux or grub configuration files).
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_install_disk()</filename>:</emphasis>
+ Called after all partitions have been prepared and
+ assembled into a disk image.
+ This method provides a hook to allow finalization
+ of a disk image (e.g. writing an MBR).
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_stage_partition()</filename>:</emphasis>
+ Special content-staging hook called before
+ <filename>do_prepare_partition()</filename>.
+ This method is normally empty.</para>
+
+ <para>Typically, a partition just uses the passed-in
+ parameters (e.g. the unmodified value of
+ <filename>bootimg_dir</filename>).
+ However, in some cases, things might need to be
+ more tailored.
+ As an example, certain files might additionally
+ need to be taken from
+ <filename>bootimg_dir + /boot</filename>.
+ This hook allows those files to be staged in a
+ customized fashion.
+ <note>
+ <filename>get_bitbake_var()</filename>
+ allows you to access non-standard variables
+ that you might want to use for this
+ behavior.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can extend the source plug-in mechanism.
+ To add more hooks, create more source plug-in methods
+ within <filename>SourcePlugin</filename> and the
+ corresponding derived subclasses.
+ The code that calls the plug-in methods uses the
+ <filename>plugin.get_source_plugin_methods()</filename>
+ function to find the method or methods needed by the call.
+ Retrieval of those methods is accomplished by filling up
+ a dict with keys that contain the method names of interest.
+ On success, these will be filled in with the actual
+ methods.
+ See the Wic implementation for examples and details.
+ </para>
+ </section>
+
+ <section id='wic-usage-examples'>
+ <title>Examples</title>
+
+ <para>
+ This section provides several examples that show how to use
+ the Wic utility.
+ All the examples assume the list of requirements in the
+ "<link linkend='wic-requirements'>Requirements</link>"
+ section have been met.
+ The examples assume the previously generated image is
+ <filename>core-image-minimal</filename>.
+ </para>
+
+ <section id='generate-an-image-using-a-provided-kickstart-file'>
+ <title>Generate an Image using an Existing Kickstart File</title>
+
+ <para>
+ This example runs in Cooked Mode and uses the
+ <filename>mkefidisk</filename> kickstart file:
+ <literallayout class='monospaced'>
+ $ wic create mkefidisk -e core-image-minimal
+ INFO: Building wic-tools...
+ .
+ .
+ .
+ INFO: The new image(s) can be found here:
+ ./mkefidisk-201804191017-sda.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/stephano/build/master/build/tmp-glibc/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/stephano/build/master/build/tmp-glibc/work/i586-oe-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: The image(s) were created using OE kickstart file:
+ /home/stephano/build/master/openembedded-core/scripts/lib/wic/canned-wks/mkefidisk.wks
+ </literallayout>
+ The previous example shows the easiest way to create
+ an image by running in cooked mode and supplying
+ a kickstart file and the "-e" option to point to the
+ existing build artifacts.
+ Your <filename>local.conf</filename> file needs to have
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable set to the machine you are using, which is
+ "qemux86" in this example.
+ </para>
+
+ <para>
+ Once the image builds, the output provides image
+ location, artifact use, and kickstart file information.
+ <note>
+ You should always verify the details provided in the
+ output to make sure that the image was indeed
+ created exactly as expected.
+ </note>
+ </para>
+
+ <para>
+ Continuing with the example, you can now write the
+ image from the Build Directory onto a USB stick, or
+ whatever media for which you built your image, and boot
+ from the media.
+ You can write the image by using
+ <filename>bmaptool</filename> or
+ <filename>dd</filename>:
+ <literallayout class='monospaced'>
+ $ oe-run-native bmaptool copy mkefidisk-201804191017-sda.direct /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ $ sudo dd if=mkefidisk-201804191017-sda.direct of=/dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ <note>
+ For more information on how to use the
+ <filename>bmaptool</filename> to flash a device
+ with an image, see the
+ "<link linkend='flashing-images-using-bmaptool'>Flashing Images Using <filename>bmaptool</filename></link>"
+ section.
+ </note>
+ </para>
+ </section>
+
+ <section id='using-a-modified-kickstart-file'>
+ <title>Using a Modified Kickstart File</title>
+
+ <para>
+ Because partitioned image creation is driven by the
+ kickstart file, it is easy to affect image creation by
+ changing the parameters in the file.
+ This next example demonstrates that through modification
+ of the <filename>directdisk-gpt</filename> kickstart
+ file.
+ </para>
+
+ <para>
+ As mentioned earlier, you can use the command
+ <filename>wic list images</filename> to show the list
+ of existing kickstart files.
+ The directory in which the
+ <filename>directdisk-gpt.wks</filename> file resides is
+ <filename>scripts/lib/image/canned-wks/</filename>,
+ which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ Because available files reside in this directory,
+ you can create and add your own custom files to the
+ directory.
+ Subsequent use of the
+ <filename>wic list images</filename> command would then
+ include your kickstart files.
+ </para>
+
+ <para>
+ In this example, the existing
+ <filename>directdisk-gpt</filename> file already does
+ most of what is needed.
+ However, for the hardware in this example, the image
+ will need to boot from <filename>sdb</filename> instead
+ of <filename>sda</filename>, which is what the
+ <filename>directdisk-gpt</filename> kickstart file
+ uses.
+ </para>
+
+ <para>
+ The example begins by making a copy of the
+ <filename>directdisk-gpt.wks</filename> file in the
+ <filename>scripts/lib/image/canned-wks</filename>
+ directory and then by changing the lines that specify
+ the target disk from which to boot.
+ <literallayout class='monospaced'>
+ $ cp /home/stephano/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks \
+ /home/stephano/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks
+ </literallayout>
+ Next, the example modifies the
+ <filename>directdisksdb-gpt.wks</filename> file and
+ changes all instances of
+ "<filename>--ondisk sda</filename>" to
+ "<filename>--ondisk sdb</filename>".
+ The example changes the following two lines and leaves
+ the remaining lines untouched:
+ <literallayout class='monospaced'>
+ part /boot --source bootimg-pcbios --ondisk sdb --label boot --active --align 1024
+ part / --source rootfs --ondisk sdb --fstype=ext4 --label platform --align 1024 --use-uuid
+ </literallayout>
+ Once the lines are changed, the example generates the
+ <filename>directdisksdb-gpt</filename> image.
+ The command points the process at the
+ <filename>core-image-minimal</filename> artifacts for
+ the Next Unit of Computing (nuc)
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ the <filename>local.conf</filename>.
+ <literallayout class='monospaced'>
+ $ wic create directdisksdb-gpt -e core-image-minimal
+ INFO: Building wic-tools...
+ .
+ .
+ .
+ Initialising tasks: 100% |#######################################| Time: 0:00:01
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ NOTE: Tasks Summary: Attempted 1161 tasks of which 1157 didn't need to be rerun and all succeeded.
+ INFO: Creating image(s)...
+
+ INFO: The new image(s) can be found here:
+ ./directdisksdb-gpt-201710090938-sdb.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/stephano/build/master/build/tmp-glibc/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/stephano/build/master/build/tmp-glibc/work/i586-oe-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: The image(s) were created using OE kickstart file:
+ /home/stephano/poky/scripts/lib/wic/canned-wks/directdisksdb-gpt.wks
+ </literallayout>
+ Continuing with the example, you can now directly
+ <filename>dd</filename> the image to a USB stick, or
+ whatever media for which you built your image,
+ and boot the resulting media:
+ <literallayout class='monospaced'>
+ $ sudo dd if=directdisksdb-gpt-201710090938-sdb.direct of=/dev/sdb
+ 140966+0 records in
+ 140966+0 records out
+ 72174592 bytes (72 MB, 69 MiB) copied, 78.0282 s, 925 kB/s
+ $ sudo eject /dev/sdb
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='using-a-modified-kickstart-file-and-running-in-raw-mode'>
+ <title>Using a Modified Kickstart File and Running in Raw Mode</title>
+
+ <para>
+ This next example manually specifies each build artifact
+ (runs in Raw Mode) and uses a modified kickstart file.
+ The example also uses the <filename>-o</filename> option
+ to cause Wic to create the output
+ somewhere other than the default output directory,
+ which is the current directory:
+ <literallayout class='monospaced'>
+ $ wic create /home/stephano/my_yocto/test.wks -o /home/stephano/testwic \
+ --rootfs-dir /home/stephano/build/master/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/rootfs \
+ --bootimg-dir /home/stephano/build/master/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share \
+ --kernel-dir /home/stephano/build/master/build/tmp/deploy/images/qemux86 \
+ --native-sysroot /home/stephano/build/master/build/tmp/work/i586-poky-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: Creating image(s)...
+
+ INFO: The new image(s) can be found here:
+ /home/stephano/testwic/test-201710091445-sdb.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: /home/stephano/build/master/build/tmp-glibc/work/qemux86-oe-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share
+ KERNEL_DIR: /home/stephano/build/master/build/tmp-glibc/deploy/images/qemux86
+ NATIVE_SYSROOT: /home/stephano/build/master/build/tmp-glibc/work/i586-oe-linux/wic-tools/1.0-r0/recipe-sysroot-native
+
+ INFO: The image(s) were created using OE kickstart file:
+ /home/stephano/my_yocto/test.wks
+ </literallayout>
+ For this example,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ did not have to be specified in the
+ <filename>local.conf</filename> file since the
+ artifact is manually specified.
+ </para>
+ </section>
+
+ <section id='using-wic-to-manipulate-an-image'>
+ <title>Using Wic to Manipulate an Image</title>
+
+ <para>
+ Wic image manipulation allows you to shorten turnaround
+ time during image development.
+ For example, you can use Wic to delete the kernel partition
+ of a Wic image and then insert a newly built kernel.
+ This saves you time from having to rebuild the entire image
+ each time you modify the kernel.
+ <note>
+ In order to use Wic to manipulate a Wic image as in
+ this example, your development machine must have the
+ <filename>mtools</filename> package installed.
+ </note>
+ </para>
+
+ <para>
+ The following example examines the contents of the Wic
+ image, deletes the existing kernel, and then inserts a
+ new kernel:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>List the Partitions:</emphasis>
+ Use the <filename>wic ls</filename> command to list
+ all the partitions in the Wic image:
+ <literallayout class='monospaced'>
+ $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic
+ Num Start End Size Fstype
+ 1 1048576 25041919 23993344 fat16
+ 2 25165824 72157183 46991360 ext4
+ </literallayout>
+ The previous output shows two partitions in the
+ <filename>core-image-minimal-qemux86.wic</filename>
+ image.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine a Particular Partition:</emphasis>
+ Use the <filename>wic ls</filename> command again
+ but in a different form to examine a particular
+ partition.
+ <note>
+ You can get command usage on any Wic command
+ using the following form:
+ <literallayout class='monospaced'>
+ $ wic help <replaceable>command</replaceable>
+ </literallayout>
+ For example, the following command shows you
+ the various ways to use the
+ <filename>wic ls</filename> command:
+ <literallayout class='monospaced'>
+ $ wic help ls
+ </literallayout>
+ </note>
+ The following command shows what is in Partition
+ one:
+ <literallayout class='monospaced'>
+ $ wic ls tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is E894-1809
+ Directory for ::/
+
+ libcom32 c32 186500 2017-10-09 16:06
+ libutil c32 24148 2017-10-09 16:06
+ syslinux cfg 220 2017-10-09 16:06
+ vesamenu c32 27104 2017-10-09 16:06
+ vmlinuz 6904608 2017-10-09 16:06
+ 5 files 7 142 580 bytes
+ 16 582 656 bytes free
+ </literallayout>
+ The previous output shows five files, with the
+ <filename>vmlinuz</filename> being the kernel.
+ <note>
+ If you see the following error, you need to
+ update or create a
+ <filename>~/.mtoolsrc</filename> file and
+ be sure to have the line “mtools_skip_check=1“
+ in the file.
+ Then, run the Wic command again:
+ <literallayout class='monospaced'>
+ ERROR: _exec_cmd: /usr/bin/mdir -i /tmp/wic-parttfokuwra ::/ returned '1' instead of 0
+ output: Total number of sectors (47824) not a multiple of sectors per track (32)!
+ Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Remove the Old Kernel:</emphasis>
+ Use the <filename>wic rm</filename> command to
+ remove the <filename>vmlinuz</filename> file
+ (kernel):
+ <literallayout class='monospaced'>
+ $ wic rm tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add In the New Kernel:</emphasis>
+ Use the <filename>wic cp</filename> command to
+ add the updated kernel to the Wic image.
+ Depending on how you built your kernel, it could
+ be in different places.
+ If you used <filename>devtool</filename> and
+ an SDK to build your kernel, it resides in the
+ <filename>tmp/work</filename> directory of the
+ extensible SDK.
+ If you used <filename>make</filename> to build the
+ kernel, the kernel will be in the
+ <filename>workspace/sources</filename> area.
+ </para>
+
+ <para>The following example assumes
+ <filename>devtool</filename> was used to build
+ the kernel:
+ <literallayout class='monospaced'>
+ cp ~/poky_sdk/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+git999-r0/linux-yocto-4.12.12+git999/arch/x86/boot/bzImage \
+ ~/poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86.wic:1/vmlinuz
+ </literallayout>
+ Once the new kernel is added back into the image,
+ you can use the <filename>dd</filename>
+ command or
+ <link linkend='flashing-images-using-bmaptool'><filename>bmaptool</filename></link>
+ to flash your wic image onto an SD card
+ or USB stick and test your target.
+ <note>
+ Using <filename>bmaptool</filename> is
+ generally 10 to 20 times faster than using
+ <filename>dd</filename>.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='flashing-images-using-bmaptool'>
+ <title>Flashing Images Using <filename>bmaptool</filename></title>
+
+ <para>
+ A fast and easy way to flash an image to a bootable device
+ is to use Bmaptool, which is integrated into the OpenEmbedded
+ build system.
+ Bmaptool is a generic tool that creates a file's block map (bmap)
+ and then uses that map to copy the file.
+ As compared to traditional tools such as dd or cp, Bmaptool
+ can copy (or flash) large files like raw system image files
+ much faster.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ If you are using Ubuntu or Debian distributions, you
+ can install the <filename>bmap-tools</filename> package
+ using the following command and then use the tool
+ without specifying <filename>PATH</filename> even from
+ the root account:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install bmap-tools
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you are unable to install the
+ <filename>bmap-tools</filename> package, you will
+ need to build Bmaptool before using it.
+ Use the following command:
+ <literallayout class='monospaced'>
+ $ bitbake bmap-tools-native
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ Following, is an example that shows how to flash a Wic image.
+ Realize that while this example uses a Wic image, you can use
+ Bmaptool to flash any type of image.
+ Use these steps to flash an image using Bmaptool:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Update your <filename>local.conf</filename> File:</emphasis>
+ You need to have the following set in your
+ <filename>local.conf</filename> file before building
+ your image:
+ <literallayout class='monospaced'>
+ IMAGE_FSTYPES += "wic wic.bmap"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Get Your Image:</emphasis>
+ Either have your image ready (pre-built with the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>
+ setting previously mentioned) or take the step to build
+ the image:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Flash the Device:</emphasis>
+ Flash the device with the image by using Bmaptool
+ depending on your particular setup.
+ The following commands assume the image resides in the
+ Build Directory's <filename>deploy/images/</filename>
+ area:
+ <itemizedlist>
+ <listitem><para>
+ If you have write access to the media, use this
+ command form:
+ <literallayout class='monospaced'>
+ $ oe-run-native bmap-tools-native bmaptool copy <replaceable>build-directory</replaceable>/tmp/deploy/images/<replaceable>machine</replaceable>/<replaceable>image</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you do not have write access to the media, set
+ your permissions first and then use the same
+ command form:
+ <literallayout class='monospaced'>
+ $ sudo chmod 666 /dev/sd<replaceable>X</replaceable>
+ $ oe-run-native bmap-tools-native bmaptool copy <replaceable>build-directory</replaceable>/tmp/deploy/images/<replaceable>machine</replaceable>/<replaceable>image</replaceable>.wic /dev/sd<replaceable>X</replaceable>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ For help on the <filename>bmaptool</filename> command, use the
+ following command:
+ <literallayout class='monospaced'>
+ $ bmaptool --help
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='making-images-more-secure'>
+ <title>Making Images More Secure</title>
+
+ <para>
+ Security is of increasing concern for embedded devices.
+ Consider the issues and problems discussed in just this
+ sampling of work found across the Internet:
+ <itemizedlist>
+ <listitem><para><emphasis>
+ "<ulink url='https://www.schneier.com/blog/archives/2014/01/security_risks_9.html'>Security Risks of Embedded Systems</ulink>"</emphasis>
+ by Bruce Schneier
+ </para></listitem>
+ <listitem><para><emphasis>
+ "<ulink url='http://census2012.sourceforge.net/paper.html'>Internet Census 2012</ulink>"</emphasis>
+ by Carna Botnet</para></listitem>
+ <listitem><para><emphasis>
+ "<ulink url='http://elinux.org/images/6/6f/Security-issues.pdf'>Security Issues for Embedded Devices</ulink>"</emphasis>
+ by Jake Edge
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ When securing your image is of concern, there are steps, tools,
+ and variables that you can consider to help you reach the
+ security goals you need for your particular device.
+ Not all situations are identical when it comes to making an
+ image secure.
+ Consequently, this section provides some guidance and suggestions
+ for consideration when you want to make your image more secure.
+ <note>
+ Because the security requirements and risks are
+ different for every type of device, this section cannot
+ provide a complete reference on securing your custom OS.
+ It is strongly recommended that you also consult other sources
+ of information on embedded Linux system hardening and on
+ security.
+ </note>
+ </para>
+
+ <section id='general-considerations'>
+ <title>General Considerations</title>
+
+ <para>
+ General considerations exist that help you create more
+ secure images.
+ You should consider the following suggestions to help
+ make your device more secure:
+ <itemizedlist>
+ <listitem><para>
+ Scan additional code you are adding to the system
+ (e.g. application code) by using static analysis
+ tools.
+ Look for buffer overflows and other potential
+ security problems.
+ </para></listitem>
+ <listitem><para>
+ Pay particular attention to the security for
+ any web-based administration interface.
+ </para>
+ <para>Web interfaces typically need to perform
+ administrative functions and tend to need to run with
+ elevated privileges.
+ Thus, the consequences resulting from the interface's
+ security becoming compromised can be serious.
+ Look for common web vulnerabilities such as
+ cross-site-scripting (XSS), unvalidated inputs,
+ and so forth.</para>
+ <para>As with system passwords, the default credentials
+ for accessing a web-based interface should not be the
+ same across all devices.
+ This is particularly true if the interface is enabled
+ by default as it can be assumed that many end-users
+ will not change the credentials.
+ </para></listitem>
+ <listitem><para>
+ Ensure you can update the software on the device to
+ mitigate vulnerabilities discovered in the future.
+ This consideration especially applies when your
+ device is network-enabled.
+ </para></listitem>
+ <listitem><para>
+ Ensure you remove or disable debugging functionality
+ before producing the final image.
+ For information on how to do this, see the
+ "<link linkend='considerations-specific-to-the-openembedded-build-system'>Considerations Specific to the OpenEmbedded Build System</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ Ensure you have no network services listening that
+ are not needed.
+ </para></listitem>
+ <listitem><para>
+ Remove any software from the image that is not needed.
+ </para></listitem>
+ <listitem><para>
+ Enable hardware support for secure boot functionality
+ when your device supports this functionality.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='security-flags'>
+ <title>Security Flags</title>
+
+ <para>
+ The Yocto Project has security flags that you can enable that
+ help make your build output more secure.
+ The security flags are in the
+ <filename>meta/conf/distro/include/security_flags.inc</filename>
+ file in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ <note>
+ Depending on the recipe, certain security flags are enabled
+ and disabled by default.
+ </note>
+ </para>
+
+ <para>
+<!--
+ The GCC/LD flags in <filename>security_flags.inc</filename>
+ enable more secure code generation.
+ By including the <filename>security_flags.inc</filename>
+ file, you enable flags to the compiler and linker that cause
+ them to generate more secure code.
+ <note>
+ The GCC/LD flags are enabled by default in the
+ <filename>poky-lsb</filename> distribution.
+ </note>
+-->
+ Use the following line in your
+ <filename>local.conf</filename> file or in your custom
+ distribution configuration file to enable the security
+ compiler and linker flags for your build:
+ <literallayout class='monospaced'>
+ require conf/distro/include/security_flags.inc
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='considerations-specific-to-the-openembedded-build-system'>
+ <title>Considerations Specific to the OpenEmbedded Build System</title>
+
+ <para>
+ You can take some steps that are specific to the
+ OpenEmbedded build system to make your images more secure:
+ <itemizedlist>
+ <listitem><para>
+ Ensure "debug-tweaks" is not one of your selected
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>.
+ When creating a new project, the default is to provide you
+ with an initial <filename>local.conf</filename> file that
+ enables this feature using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> variable with the line:
+ <literallayout class='monospaced'>
+ EXTRA_IMAGE_FEATURES = "debug-tweaks"
+ </literallayout>
+ To disable that feature, simply comment out that line in your
+ <filename>local.conf</filename> file, or
+ make sure <filename>IMAGE_FEATURES</filename> does not contain
+ "debug-tweaks" before producing your final image.
+ Among other things, leaving this in place sets the
+ root password as blank, which makes logging in for
+ debugging or inspection easy during
+ development but also means anyone can easily log in
+ during production.
+ </para></listitem>
+ <listitem><para>
+ It is possible to set a root password for the image
+ and also to set passwords for any extra users you might
+ add (e.g. administrative or service type users).
+ When you set up passwords for multiple images or
+ users, you should not duplicate passwords.
+ </para>
+ <para>
+ To set up passwords, use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-extrausers'><filename>extrausers</filename></ulink>
+ class, which is the preferred method.
+ For an example on how to set up both root and user
+ passwords, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-extrausers'><filename>extrausers.bbclass</filename></ulink>"
+ section.
+ <note>
+ When adding extra user accounts or setting a
+ root password, be cautious about setting the
+ same password on every device.
+ If you do this, and the password you have set
+ is exposed, then every device is now potentially
+ compromised.
+ If you need this access but want to ensure
+ security, consider setting a different,
+ random password for each device.
+ Typically, you do this as a separate step after
+ you deploy the image onto the device.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Consider enabling a Mandatory Access Control (MAC)
+ framework such as SMACK or SELinux and tuning it
+ appropriately for your device's usage.
+ You can find more information in the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-selinux/'><filename>meta-selinux</filename></ulink>
+ layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ </para>
+ </section>
+
+ <section id='tools-for-hardening-your-image'>
+ <title>Tools for Hardening Your Image</title>
+
+ <para>
+ The Yocto Project provides tools for making your image
+ more secure.
+ You can find these tools in the
+ <filename>meta-security</filename> layer of the
+ <ulink url='&YOCTO_GIT_URL;'>Yocto Project Source Repositories</ulink>.
+ </para>
+ </section>
+ </section>
+
+ <section id='creating-your-own-distribution'>
+ <title>Creating Your Own Distribution</title>
+
+ <para>
+ When you build an image using the Yocto Project and
+ do not alter any distribution
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>,
+ you are creating a Poky distribution.
+ If you wish to gain more control over package alternative
+ selections, compile-time options, and other low-level
+ configurations, you can create your own distribution.
+ </para>
+
+ <para>
+ To create your own distribution, the basic steps consist of
+ creating your own distribution layer, creating your own
+ distribution configuration file, and then adding any needed
+ code and Metadata to the layer.
+ The following steps provide some more detail:
+ <itemizedlist>
+ <listitem><para><emphasis>Create a layer for your new distro:</emphasis>
+ Create your distribution layer so that you can keep your
+ Metadata and code for the distribution separate.
+ It is strongly recommended that you create and use your own
+ layer for configuration and code.
+ Using your own layer as compared to just placing
+ configurations in a <filename>local.conf</filename>
+ configuration file makes it easier to reproduce the same
+ build configuration when using multiple build machines.
+ See the
+ "<link linkend='creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</link>"
+ section for information on how to quickly set up a layer.
+ </para></listitem>
+ <listitem><para><emphasis>Create the distribution configuration file:</emphasis>
+ The distribution configuration file needs to be created in
+ the <filename>conf/distro</filename> directory of your
+ layer.
+ You need to name it using your distribution name
+ (e.g. <filename>mydistro.conf</filename>).
+ <note>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ variable in your
+ <filename>local.conf</filename> file determines the
+ name of your distribution.
+ </note></para>
+ <para>You can split out parts of your configuration file
+ into include files and then "require" them from within
+ your distribution configuration file.
+ Be sure to place the include files in the
+ <filename>conf/distro/include</filename> directory of
+ your layer.
+ A common example usage of include files would be to
+ separate out the selection of desired version and revisions
+ for individual recipes.
+</para>
+ <para>Your configuration file needs to set the following
+ required variables:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_NAME'><filename>DISTRO_NAME</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_VERSION'><filename>DISTRO_VERSION</filename></ulink>
+ </literallayout>
+ These following variables are optional and you typically
+ set them from the distribution configuration file:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_EXTRA_RDEPENDS'><filename>DISTRO_EXTRA_RDEPENDS</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_EXTRA_RRECOMMENDS'><filename>DISTRO_EXTRA_RRECOMMENDS</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TCLIBC'><filename>TCLIBC</filename></ulink>
+ </literallayout>
+ <tip>
+ If you want to base your distribution configuration file
+ on the very basic configuration from OE-Core, you
+ can use
+ <filename>conf/distro/defaultsetup.conf</filename> as
+ a reference and just include variables that differ
+ as compared to <filename>defaultsetup.conf</filename>.
+ Alternatively, you can create a distribution
+ configuration file from scratch using the
+ <filename>defaultsetup.conf</filename> file
+ or configuration files from other distributions
+ such as Poky or Angstrom as references.
+ </tip></para></listitem>
+ <listitem><para><emphasis>Provide miscellaneous variables:</emphasis>
+ Be sure to define any other variables for which you want to
+ create a default or enforce as part of the distribution
+ configuration.
+ You can include nearly any variable from the
+ <filename>local.conf</filename> file.
+ The variables you use are not limited to the list in the
+ previous bulleted item.</para></listitem>
+ <listitem><para><emphasis>Point to Your distribution configuration file:</emphasis>
+ In your <filename>local.conf</filename> file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ set your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ variable to point to your distribution's configuration file.
+ For example, if your distribution's configuration file is
+ named <filename>mydistro.conf</filename>, then you point
+ to it as follows:
+ <literallayout class='monospaced'>
+ DISTRO = "mydistro"
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Add more to the layer if necessary:</emphasis>
+ Use your layer to hold other information needed for the
+ distribution:
+ <itemizedlist>
+ <listitem><para>Add recipes for installing
+ distro-specific configuration files that are not
+ already installed by another recipe.
+ If you have distro-specific configuration files
+ that are included by an existing recipe, you should
+ add an append file (<filename>.bbappend</filename>)
+ for those.
+ For general information and recommendations
+ on how to add recipes to your layer, see the
+ "<link linkend='creating-your-own-layer'>Creating Your Own Layer</link>"
+ and
+ "<link linkend='best-practices-to-follow-when-creating-layers'>Following Best Practices When Creating Layers</link>"
+ sections.</para></listitem>
+ <listitem><para>Add any image recipes that are specific
+ to your distribution.</para></listitem>
+ <listitem><para>Add a <filename>psplash</filename>
+ append file for a branded splash screen.
+ For information on append files, see the
+ "<link linkend='using-bbappend-files'>Using .bbappend Files in Your Layer</link>"
+ section.</para></listitem>
+ <listitem><para>Add any other append files to make
+ custom changes that are specific to individual
+ recipes.</para></listitem>
+ </itemizedlist></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='creating-a-custom-template-configuration-directory'>
+ <title>Creating a Custom Template Configuration Directory</title>
+
+ <para>
+ If you are producing your own customized version
+ of the build system for use by other users, you might
+ want to customize the message shown by the setup script or
+ you might want to change the template configuration files (i.e.
+ <filename>local.conf</filename> and
+ <filename>bblayers.conf</filename>) that are created in
+ a new build directory.
+ </para>
+
+ <para>
+ The OpenEmbedded build system uses the environment variable
+ <filename>TEMPLATECONF</filename> to locate the directory
+ from which it gathers configuration information that ultimately
+ ends up in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ <filename>conf</filename> directory.
+ By default, <filename>TEMPLATECONF</filename> is set as
+ follows in the <filename>poky</filename> repository:
+ <literallayout class='monospaced'>
+ TEMPLATECONF=${TEMPLATECONF:-meta-poky/conf}
+ </literallayout>
+ This is the directory used by the build system to find templates
+ from which to build some key configuration files.
+ If you look at this directory, you will see the
+ <filename>bblayers.conf.sample</filename>,
+ <filename>local.conf.sample</filename>, and
+ <filename>conf-notes.txt</filename> files.
+ The build system uses these files to form the respective
+ <filename>bblayers.conf</filename> file,
+ <filename>local.conf</filename> file, and display the list of
+ BitBake targets when running the setup script.
+ </para>
+
+ <para>
+ To override these default configuration files with
+ configurations you want used within every new
+ Build Directory, simply set the
+ <filename>TEMPLATECONF</filename> variable to your directory.
+ The <filename>TEMPLATECONF</filename> variable is set in the
+ <filename>.templateconf</filename> file, which is in the
+ top-level
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ folder (e.g. <filename>poky</filename>).
+ Edit the <filename>.templateconf</filename> so that it can locate
+ your directory.
+ </para>
+
+ <para>
+ Best practices dictate that you should keep your
+ template configuration directory in your custom distribution layer.
+ For example, suppose you have a layer named
+ <filename>meta-mylayer</filename> located in your home directory
+ and you want your template configuration directory named
+ <filename>myconf</filename>.
+ Changing the <filename>.templateconf</filename> as follows
+ causes the OpenEmbedded build system to look in your directory
+ and base its configuration files on the
+ <filename>*.sample</filename> configuration files it finds.
+ The final configuration files (i.e.
+ <filename>local.conf</filename> and
+ <filename>bblayers.conf</filename> ultimately still end up in
+ your Build Directory, but they are based on your
+ <filename>*.sample</filename> files.
+ <literallayout class='monospaced'>
+ TEMPLATECONF=${TEMPLATECONF:-meta-mylayer/myconf}
+ </literallayout>
+ </para>
+
+ <para>
+ Aside from the <filename>*.sample</filename> configuration files,
+ the <filename>conf-notes.txt</filename> also resides in the
+ default <filename>meta-poky/conf</filename> directory.
+ The script that sets up the build environment
+ (i.e.
+ <ulink url="&YOCTO_DOCS_REF_URL;#structure-core-script"><filename>&OE_INIT_FILE;</filename></ulink>)
+ uses this file to display BitBake targets as part of the script
+ output.
+ Customizing this <filename>conf-notes.txt</filename> file is a
+ good way to make sure your list of custom targets appears
+ as part of the script's output.
+ </para>
+
+ <para>
+ Here is the default list of targets displayed as a result of
+ running either of the setup scripts:
+ <literallayout class='monospaced'>
+ You can now run 'bitbake &lt;target&gt;'
+
+ Common targets are:
+ core-image-minimal
+ core-image-sato
+ meta-toolchain
+ meta-ide-support
+ </literallayout>
+ </para>
+
+ <para>
+ Changing the listed common targets is as easy as editing your
+ version of <filename>conf-notes.txt</filename> in your
+ custom template configuration directory and making sure you
+ have <filename>TEMPLATECONF</filename> set to your directory.
+ </para>
+ </section>
+
+ <section id='dev-saving-memory-during-a-build'>
+ <title>Conserving Disk Space During Builds</title>
+
+ <para>
+ To help conserve disk space during builds, you can add the
+ following statement to your project's
+ <filename>local.conf</filename> configuration file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "rm_work"
+ </literallayout>
+ Adding this statement deletes the work directory used for building
+ a recipe once the recipe is built.
+ For more information on "rm_work", see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-rm-work'><filename>rm_work</filename></ulink>
+ class in the Yocto Project Reference Manual.
+ </para>
+ </section>
+
+ <section id='working-with-packages'>
+ <title>Working with Packages</title>
+
+ <para>
+ This section describes a few tasks that involve packages:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='excluding-packages-from-an-image'>Excluding packages from an image</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='incrementing-a-binary-package-version'>Incrementing a binary package version</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='handling-optional-module-packaging'>Handling optional module packaging</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='using-runtime-package-management'>Using Runtime Package Management</link>
+ </para></listitem>
+ <listitem><para>
+ <link linkend='testing-packages-with-ptest'>Setting up and running package test (ptest)</link>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='excluding-packages-from-an-image'>
+ <title>Excluding Packages from an Image</title>
+
+ <para>
+ You might find it necessary to prevent specific packages
+ from being installed into an image.
+ If so, you can use several variables to direct the build
+ system to essentially ignore installing recommended packages
+ or to not install a package at all.
+ </para>
+
+ <para>
+ The following list introduces variables you can use to
+ prevent packages from being installed into your image.
+ Each of these variables only works with IPK and RPM
+ package types.
+ Support for Debian packages does not exist.
+ Also, you can use these variables from your
+ <filename>local.conf</filename> file or attach them to a
+ specific image recipe by using a recipe name override.
+ For more detail on the variables, see the descriptions in the
+ Yocto Project Reference Manual's glossary chapter.
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></ulink>:
+ Use this variable to specify "recommended-only"
+ packages that you do not want installed.
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></ulink>:
+ Use this variable to prevent all "recommended-only"
+ packages from being installed.
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></ulink>:
+ Use this variable to prevent specific packages from
+ being installed regardless of whether they are
+ "recommended-only" or not.
+ You need to realize that the build process could
+ fail with an error when you
+ prevent the installation of a package whose presence
+ is required by an installed package.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='incrementing-a-binary-package-version'>
+ <title>Incrementing a Package Version</title>
+
+ <para>
+ This section provides some background on how binary package
+ versioning is accomplished and presents some of the services,
+ variables, and terminology involved.
+ </para>
+
+ <para>
+ In order to understand binary package versioning, you need
+ to consider the following:
+ <itemizedlist>
+ <listitem><para>
+ Binary Package: The binary package that is eventually
+ built and installed into an image.
+ </para></listitem>
+ <listitem><para>
+ Binary Package Version: The binary package version
+ is composed of two components - a version and a
+ revision.
+ <note>
+ Technically, a third component, the "epoch" (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>)
+ is involved but this discussion for the most part
+ ignores <filename>PE</filename>.
+ </note>
+ The version and revision are taken from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ variables, respectively.
+ </para></listitem>
+ <listitem><para>
+ <filename>PV</filename>: The recipe version.
+ <filename>PV</filename> represents the version of the
+ software being packaged.
+ Do not confuse <filename>PV</filename> with the
+ binary package version.
+ </para></listitem>
+ <listitem><para>
+ <filename>PR</filename>: The recipe revision.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>:
+ The OpenEmbedded build system uses this string
+ to help define the value of <filename>PV</filename>
+ when the source code revision needs to be included
+ in it.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='https://wiki.yoctoproject.org/wiki/PR_Service'>PR Service</ulink>:
+ A network-based service that helps automate keeping
+ package feeds compatible with existing package
+ manager applications such as RPM, APT, and OPKG.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Whenever the binary package content changes, the binary package
+ version must change.
+ Changing the binary package version is accomplished by changing
+ or "bumping" the <filename>PR</filename> and/or
+ <filename>PV</filename> values.
+ Increasing these values occurs one of two ways:
+ <itemizedlist>
+ <listitem><para>Automatically using a Package Revision
+ Service (PR Service).
+ </para></listitem>
+ <listitem><para>Manually incrementing the
+ <filename>PR</filename> and/or
+ <filename>PV</filename> variables.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Given a primary challenge of any build system and its users
+ is how to maintain a package feed that is compatible with
+ existing package manager applications such as RPM, APT, and
+ OPKG, using an automated system is much preferred over a
+ manual system.
+ In either system, the main requirement is that binary package
+ version numbering increases in a linear fashion and that a
+ number of version components exist that support that linear
+ progression.
+ For information on how to ensure package revisioning remains
+ linear, see the
+ "<link linkend='automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</link>"
+ section.
+ </para>
+
+ <para>
+ The following three sections provide related information on the
+ PR Service, the manual method for "bumping"
+ <filename>PR</filename> and/or <filename>PV</filename>, and
+ on how to ensure binary package revisioning remains linear.
+ </para>
+
+ <section id='working-with-a-pr-service'>
+ <title>Working With a PR Service</title>
+
+ <para>
+ As mentioned, attempting to maintain revision numbers in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ is error prone, inaccurate, and causes problems for people
+ submitting recipes.
+ Conversely, the PR Service automatically generates
+ increasing numbers, particularly the revision field,
+ which removes the human element.
+ <note>
+ For additional information on using a PR Service, you
+ can see the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/PR_Service'>PR Service</ulink>
+ wiki page.
+ </note>
+ </para>
+
+ <para>
+ The Yocto Project uses variables in order of
+ decreasing priority to facilitate revision numbering (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>, and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ for epoch, version, and revision, respectively).
+ The values are highly dependent on the policies and
+ procedures of a given distribution and package feed.
+ </para>
+
+ <para>
+ Because the OpenEmbedded build system uses
+ "<ulink url='&YOCTO_DOCS_OM_URL;#overview-checksums'>signatures</ulink>",
+ which are unique to a given build, the build system
+ knows when to rebuild packages.
+ All the inputs into a given task are represented by a
+ signature, which can trigger a rebuild when different.
+ Thus, the build system itself does not rely on the
+ <filename>PR</filename>, <filename>PV</filename>, and
+ <filename>PE</filename> numbers to trigger a rebuild.
+ The signatures, however, can be used to generate
+ these values.
+ </para>
+
+ <para>
+ The PR Service works with both
+ <filename>OEBasic</filename> and
+ <filename>OEBasicHash</filename> generators.
+ The value of <filename>PR</filename> bumps when the
+ checksum changes and the different generator mechanisms
+ change signatures under different circumstances.
+ </para>
+
+ <para>
+ As implemented, the build system includes values from
+ the PR Service into the <filename>PR</filename> field as
+ an addition using the form "<filename>.x</filename>" so
+ <filename>r0</filename> becomes <filename>r0.1</filename>,
+ <filename>r0.2</filename> and so forth.
+ This scheme allows existing <filename>PR</filename> values
+ to be used for whatever reasons, which include manual
+ <filename>PR</filename> bumps, should it be necessary.
+ </para>
+
+ <para>
+ By default, the PR Service is not enabled or running.
+ Thus, the packages generated are just "self consistent".
+ The build system adds and removes packages and
+ there are no guarantees about upgrade paths but images
+ will be consistent and correct with the latest changes.
+ </para>
+
+ <para>
+ The simplest form for a PR Service is for it to exist
+ for a single host development system that builds the
+ package feed (building system).
+ For this scenario, you can enable a local PR Service by
+ setting
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PRSERV_HOST'><filename>PRSERV_HOST</filename></ulink>
+ in your <filename>local.conf</filename> file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ PRSERV_HOST = "localhost:0"
+ </literallayout>
+ Once the service is started, packages will automatically
+ get increasing <filename>PR</filename> values and
+ BitBake takes care of starting and stopping the server.
+ </para>
+
+ <para>
+ If you have a more complex setup where multiple host
+ development systems work against a common, shared package
+ feed, you have a single PR Service running and it is
+ connected to each building system.
+ For this scenario, you need to start the PR Service using
+ the <filename>bitbake-prserv</filename> command:
+ <literallayout class='monospaced'>
+ bitbake-prserv --host <replaceable>ip</replaceable> --port <replaceable>port</replaceable> --start
+ </literallayout>
+ In addition to hand-starting the service, you need to
+ update the <filename>local.conf</filename> file of each
+ building system as described earlier so each system
+ points to the server and port.
+ </para>
+
+ <para>
+ It is also recommended you use build history, which adds
+ some sanity checks to binary package versions, in
+ conjunction with the server that is running the PR Service.
+ To enable build history, add the following to each building
+ system's <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ # It is recommended to activate "buildhistory" for testing the PR service
+ INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "1"
+ </literallayout>
+ For information on build history, see the
+ "<link linkend='maintaining-build-output-quality'>Maintaining Build Output Quality</link>"
+ section.
+ </para>
+
+ <note>
+ <para>
+ The OpenEmbedded build system does not maintain
+ <filename>PR</filename> information as part of the
+ shared state (sstate) packages.
+ If you maintain an sstate feed, its expected that either
+ all your building systems that contribute to the sstate
+ feed use a shared PR Service, or you do not run a PR
+ Service on any of your building systems.
+ Having some systems use a PR Service while others do
+ not leads to obvious problems.
+ </para>
+
+ <para>
+ For more information on shared state, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>Shared State Cache</ulink>"
+ section in the Yocto Project Overview and Concepts
+ Manual.
+ </para>
+ </note>
+ </section>
+
+ <section id='manually-bumping-pr'>
+ <title>Manually Bumping PR</title>
+
+ <para>
+ The alternative to setting up a PR Service is to manually
+ "bump" the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ variable.
+ </para>
+
+ <para>
+ If a committed change results in changing the package
+ output, then the value of the PR variable needs to be
+ increased (or "bumped") as part of that commit.
+ For new recipes you should add the <filename>PR</filename>
+ variable and set its initial value equal to "r0", which is
+ the default.
+ Even though the default value is "r0", the practice of
+ adding it to a new recipe makes it harder to forget to bump
+ the variable when you make changes to the recipe in future.
+ </para>
+
+ <para>
+ If you are sharing a common <filename>.inc</filename> file
+ with multiple recipes, you can also use the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-INC_PR'>INC_PR</ulink></filename>
+ variable to ensure that the recipes sharing the
+ <filename>.inc</filename> file are rebuilt when the
+ <filename>.inc</filename> file itself is changed.
+ The <filename>.inc</filename> file must set
+ <filename>INC_PR</filename> (initially to "r0"), and all
+ recipes referring to it should set <filename>PR</filename>
+ to "${INC_PR}.0" initially, incrementing the last number
+ when the recipe is changed.
+ If the <filename>.inc</filename> file is changed then its
+ <filename>INC_PR</filename> should be incremented.
+ </para>
+
+ <para>
+ When upgrading the version of a binary package, assuming the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'>PV</ulink></filename>
+ changes, the <filename>PR</filename> variable should be
+ reset to "r0" (or "${INC_PR}.0" if you are using
+ <filename>INC_PR</filename>).
+ </para>
+
+ <para>
+ Usually, version increases occur only to binary packages.
+ However, if for some reason <filename>PV</filename> changes
+ but does not increase, you can increase the
+ <filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PE'>PE</ulink></filename>
+ variable (Package Epoch).
+ The <filename>PE</filename> variable defaults to "0".
+ </para>
+
+ <para>
+ Binary package version numbering strives to follow the
+ <ulink url='http://www.debian.org/doc/debian-policy/ch-controlfields.html'>
+ Debian Version Field Policy Guidelines</ulink>.
+ These guidelines define how versions are compared and what
+ "increasing" a version means.
+ </para>
+ </section>
+
+ <section id='automatically-incrementing-a-binary-package-revision-number'>
+ <title>Automatically Incrementing a Package Version Number</title>
+
+ <para>
+ When fetching a repository, BitBake uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ variable to determine the specific source code revision
+ from which to build.
+ You set the <filename>SRCREV</filename> variable to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-AUTOREV'><filename>AUTOREV</filename></ulink>
+ to cause the OpenEmbedded build system to automatically use the
+ latest revision of the software:
+ <literallayout class='monospaced'>
+ SRCREV = "${AUTOREV}"
+ </literallayout>
+ </para>
+
+ <para>
+ Furthermore, you need to reference <filename>SRCPV</filename>
+ in <filename>PV</filename> in order to automatically update
+ the version whenever the revision of the source code
+ changes.
+ Here is an example:
+ <literallayout class='monospaced'>
+ PV = "1.0+git${SRCPV}"
+ </literallayout>
+ The OpenEmbedded build system substitutes
+ <filename>SRCPV</filename> with the following:
+ <literallayout class='monospaced'>
+ AUTOINC+<replaceable>source_code_revision</replaceable>
+ </literallayout>
+ The build system replaces the <filename>AUTOINC</filename> with
+ a number.
+ The number used depends on the state of the PR Service:
+ <itemizedlist>
+ <listitem><para>
+ If PR Service is enabled, the build system increments
+ the number, which is similar to the behavior of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>.
+ This behavior results in linearly increasing package
+ versions, which is desirable.
+ Here is an example:
+ <literallayout class='monospaced'>
+ hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
+ hello-world-git_0.0+git1+dd2f5c3565-r0.0_armv7a-neon.ipk
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If PR Service is not enabled, the build system
+ replaces the <filename>AUTOINC</filename>
+ placeholder with zero (i.e. "0").
+ This results in changing the package version since
+ the source revision is included.
+ However, package versions are not increased linearly.
+ Here is an example:
+ <literallayout class='monospaced'>
+ hello-world-git_0.0+git0+b6558dd387-r0.0_armv7a-neon.ipk
+ hello-world-git_0.0+git0+dd2f5c3565-r0.0_armv7a-neon.ipk
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In summary, the OpenEmbedded build system does not track the
+ history of binary package versions for this purpose.
+ <filename>AUTOINC</filename>, in this case, is comparable to
+ <filename>PR</filename>.
+ If PR server is not enabled, <filename>AUTOINC</filename>
+ in the package version is simply replaced by "0".
+ If PR server is enabled, the build system keeps track of the
+ package versions and bumps the number when the package
+ revision changes.
+ </para>
+ </section>
+ </section>
+
+ <section id='handling-optional-module-packaging'>
+ <title>Handling Optional Module Packaging</title>
+
+ <para>
+ Many pieces of software split functionality into optional
+ modules (or plug-ins) and the plug-ins that are built
+ might depend on configuration options.
+ To avoid having to duplicate the logic that determines what
+ modules are available in your recipe or to avoid having
+ to package each module by hand, the OpenEmbedded build system
+ provides functionality to handle module packaging dynamically.
+ </para>
+
+ <para>
+ To handle optional module packaging, you need to do two things:
+ <itemizedlist>
+ <listitem><para>Ensure the module packaging is actually
+ done.</para></listitem>
+ <listitem><para>Ensure that any dependencies on optional
+ modules from other recipes are satisfied by your recipe.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='making-sure-the-packaging-is-done'>
+ <title>Making Sure the Packaging is Done</title>
+
+ <para>
+ To ensure the module packaging actually gets done, you use
+ the <filename>do_split_packages</filename> function within
+ the <filename>populate_packages</filename> Python function
+ in your recipe.
+ The <filename>do_split_packages</filename> function
+ searches for a pattern of files or directories under a
+ specified path and creates a package for each one it finds
+ by appending to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>
+ variable and setting the appropriate values for
+ <filename>FILES_packagename</filename>,
+ <filename>RDEPENDS_packagename</filename>,
+ <filename>DESCRIPTION_packagename</filename>, and so forth.
+ Here is an example from the <filename>lighttpd</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ python populate_packages_prepend () {
+ lighttpd_libdir = d.expand('${libdir}')
+ do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$',
+ 'lighttpd-module-%s', 'Lighttpd module for %s',
+ extra_depends='')
+ }
+ </literallayout>
+ The previous example specifies a number of things in the
+ call to <filename>do_split_packages</filename>.
+ <itemizedlist>
+ <listitem><para>A directory within the files installed
+ by your recipe through <filename>do_install</filename>
+ in which to search.</para></listitem>
+ <listitem><para>A regular expression used to match module
+ files in that directory.
+ In the example, note the parentheses () that mark
+ the part of the expression from which the module
+ name should be derived.</para></listitem>
+ <listitem><para>A pattern to use for the package names.
+ </para></listitem>
+ <listitem><para>A description for each package.
+ </para></listitem>
+ <listitem><para>An empty string for
+ <filename>extra_depends</filename>, which disables
+ the default dependency on the main
+ <filename>lighttpd</filename> package.
+ Thus, if a file in <filename>${libdir}</filename>
+ called <filename>mod_alias.so</filename> is found,
+ a package called <filename>lighttpd-module-alias</filename>
+ is created for it and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DESCRIPTION'><filename>DESCRIPTION</filename></ulink>
+ is set to "Lighttpd module for alias".</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Often, packaging modules is as simple as the previous
+ example.
+ However, more advanced options exist that you can use
+ within <filename>do_split_packages</filename> to modify its
+ behavior.
+ And, if you need to, you can add more logic by specifying
+ a hook function that is called for each package.
+ It is also perfectly acceptable to call
+ <filename>do_split_packages</filename> multiple times if
+ you have more than one set of modules to package.
+ </para>
+
+ <para>
+ For more examples that show how to use
+ <filename>do_split_packages</filename>, see the
+ <filename>connman.inc</filename> file in the
+ <filename>meta/recipes-connectivity/connman/</filename>
+ directory of the <filename>poky</filename>
+ <ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>source repository</ulink>.
+ You can also find examples in
+ <filename>meta/classes/kernel.bbclass</filename>.
+ </para>
+
+ <para>
+ Following is a reference that shows
+ <filename>do_split_packages</filename> mandatory and
+ optional arguments:
+ <literallayout class='monospaced'>
+ Mandatory arguments
+
+ root
+ The path in which to search
+ file_regex
+ Regular expression to match searched files.
+ Use parentheses () to mark the part of this
+ expression that should be used to derive the
+ module name (to be substituted where %s is
+ used in other function arguments as noted below)
+ output_pattern
+ Pattern to use for the package names. Must
+ include %s.
+ description
+ Description to set for each package. Must
+ include %s.
+
+ Optional arguments
+
+ postinst
+ Postinstall script to use for all packages
+ (as a string)
+ recursive
+ True to perform a recursive search - default
+ False
+ hook
+ A hook function to be called for every match.
+ The function will be called with the following
+ arguments (in the order listed):
+
+ f
+ Full path to the file/directory match
+ pkg
+ The package name
+ file_regex
+ As above
+ output_pattern
+ As above
+ modulename
+ The module name derived using file_regex
+
+ extra_depends
+ Extra runtime dependencies (RDEPENDS) to be
+ set for all packages. The default value of None
+ causes a dependency on the main package
+ (${PN}) - if you do not want this, pass empty
+ string '' for this parameter.
+ aux_files_pattern
+ Extra item(s) to be added to FILES for each
+ package. Can be a single string item or a list
+ of strings for multiple items. Must include %s.
+ postrm
+ postrm script to use for all packages (as a
+ string)
+ allow_dirs
+ True to allow directories to be matched -
+ default False
+ prepend
+ If True, prepend created packages to PACKAGES
+ instead of the default False which appends them
+ match_path
+ match file_regex on the whole relative path to
+ the root rather than just the file name
+ aux_files_pattern_verbatim
+ Extra item(s) to be added to FILES for each
+ package, using the actual derived module name
+ rather than converting it to something legal
+ for a package name. Can be a single string item
+ or a list of strings for multiple items. Must
+ include %s.
+ allow_links
+ True to allow symlinks to be matched - default
+ False
+ summary
+ Summary to set for each package. Must include %s;
+ defaults to description if not set.
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='satisfying-dependencies'>
+ <title>Satisfying Dependencies</title>
+
+ <para>
+ The second part for handling optional module packaging
+ is to ensure that any dependencies on optional modules
+ from other recipes are satisfied by your recipe.
+ You can be sure these dependencies are satisfied by
+ using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES_DYNAMIC'><filename>PACKAGES_DYNAMIC</filename></ulink> variable.
+ Here is an example that continues with the
+ <filename>lighttpd</filename> recipe shown earlier:
+ <literallayout class='monospaced'>
+ PACKAGES_DYNAMIC = "lighttpd-module-.*"
+ </literallayout>
+ The name specified in the regular expression can of
+ course be anything.
+ In this example, it is <filename>lighttpd-module-</filename>
+ and is specified as the prefix to ensure that any
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>
+ on a package name starting with the prefix are satisfied
+ during build time.
+ If you are using <filename>do_split_packages</filename>
+ as described in the previous section, the value you put in
+ <filename>PACKAGES_DYNAMIC</filename> should correspond to
+ the name pattern specified in the call to
+ <filename>do_split_packages</filename>.
+ </para>
+ </section>
+ </section>
+
+ <section id='using-runtime-package-management'>
+ <title>Using Runtime Package Management</title>
+
+ <para>
+ During a build, BitBake always transforms a recipe into one or
+ more packages.
+ For example, BitBake takes the <filename>bash</filename> recipe
+ and produces a number of packages (e.g.
+ <filename>bash</filename>, <filename>bash-bashbug</filename>,
+ <filename>bash-completion</filename>,
+ <filename>bash-completion-dbg</filename>,
+ <filename>bash-completion-dev</filename>,
+ <filename>bash-completion-extra</filename>,
+ <filename>bash-dbg</filename>, and so forth).
+ Not all generated packages are included in an image.
+ </para>
+
+ <para>
+ In several situations, you might need to update, add, remove,
+ or query the packages on a target device at runtime
+ (i.e. without having to generate a new image).
+ Examples of such situations include:
+ <itemizedlist>
+ <listitem><para>
+ You want to provide in-the-field updates to deployed
+ devices (e.g. security updates).
+ </para></listitem>
+ <listitem><para>
+ You want to have a fast turn-around development cycle
+ for one or more applications that run on your device.
+ </para></listitem>
+ <listitem><para>
+ You want to temporarily install the "debug" packages
+ of various applications on your device so that
+ debugging can be greatly improved by allowing
+ access to symbols and source debugging.
+ </para></listitem>
+ <listitem><para>
+ You want to deploy a more minimal package selection of
+ your device but allow in-the-field updates to add a
+ larger selection for customization.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In all these situations, you have something similar to a more
+ traditional Linux distribution in that in-field devices
+ are able to receive pre-compiled packages from a server for
+ installation or update.
+ Being able to install these packages on a running,
+ in-field device is what is termed "runtime package
+ management".
+ </para>
+
+ <para>
+ In order to use runtime package management, you
+ need a host or server machine that serves up the pre-compiled
+ packages plus the required metadata.
+ You also need package manipulation tools on the target.
+ The build machine is a likely candidate to act as the server.
+ However, that machine does not necessarily have to be the
+ package server.
+ The build machine could push its artifacts to another machine
+ that acts as the server (e.g. Internet-facing).
+ In fact, doing so is advantageous for a production
+ environment as getting the packages away from the
+ development system's build directory prevents accidental
+ overwrites.
+ </para>
+
+ <para>
+ A simple build that targets just one device produces
+ more than one package database.
+ In other words, the packages produced by a build are separated
+ out into a couple of different package groupings based on
+ criteria such as the target's CPU architecture, the target
+ board, or the C library used on the target.
+ For example, a build targeting the <filename>qemux86</filename>
+ device produces the following three package databases:
+ <filename>noarch</filename>, <filename>i586</filename>, and
+ <filename>qemux86</filename>.
+ If you wanted your <filename>qemux86</filename> device to be
+ aware of all the packages that were available to it,
+ you would need to point it to each of these databases
+ individually.
+ In a similar way, a traditional Linux distribution usually is
+ configured to be aware of a number of software repositories
+ from which it retrieves packages.
+ </para>
+
+ <para>
+ Using runtime package management is completely optional and
+ not required for a successful build or deployment in any
+ way.
+ But if you want to make use of runtime package management,
+ you need to do a couple things above and beyond the basics.
+ The remainder of this section describes what you need to do.
+ </para>
+
+ <section id='runtime-package-management-build'>
+ <title>Build Considerations</title>
+
+ <para>
+ This section describes build considerations of which you
+ need to be aware in order to provide support for runtime
+ package management.
+ </para>
+
+ <para>
+ When BitBake generates packages, it needs to know
+ what format or formats to use.
+ In your configuration, you use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ variable to specify the format:
+ <orderedlist>
+ <listitem><para>
+ Open the <filename>local.conf</filename> file
+ inside your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ (e.g. <filename>~/poky/build/conf/local.conf</filename>).
+ </para></listitem>
+ <listitem><para>
+ Select the desired package format as follows:
+ <literallayout class='monospaced'>
+ PACKAGE_CLASSES ?= “package_<replaceable>packageformat</replaceable>â€
+ </literallayout>
+ where <replaceable>packageformat</replaceable>
+ can be "ipk", "rpm", "deb", or "tar" which are the
+ supported package formats.
+ <note>
+ Because the Yocto Project supports four
+ different package formats, you can set the
+ variable with more than one argument.
+ However, the OpenEmbedded build system only
+ uses the first argument when creating an image
+ or Software Development Kit (SDK).
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ If you would like your image to start off with a basic
+ package database containing the packages in your current
+ build as well as to have the relevant tools available on the
+ target for runtime package management, you can include
+ "package-management" in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ variable.
+ Including "package-management" in this configuration
+ variable ensures that when the image is assembled for your
+ target, the image includes the currently-known package
+ databases as well as the target-specific tools required
+ for runtime package management to be performed on the
+ target.
+ However, this is not strictly necessary.
+ You could start your image off without any databases
+ but only include the required on-target package
+ tool(s).
+ As an example, you could include "opkg" in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>
+ variable if you are using the IPK package format.
+ You can then initialize your target's package database(s)
+ later once your image is up and running.
+ </para>
+
+ <para>
+ Whenever you perform any sort of build step that can
+ potentially generate a package or modify existing
+ package, it is always a good idea to re-generate the
+ package index after the build by using the following
+ command:
+ <literallayout class='monospaced'>
+ $ bitbake package-index
+ </literallayout>
+ It might be tempting to build the package and the
+ package index at the same time with a command such as
+ the following:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>some-package</replaceable> package-index
+ </literallayout>
+ Do not do this as BitBake does not schedule the package
+ index for after the completion of the package you are
+ building.
+ Consequently, you cannot be sure of the package index
+ including information for the package you just built.
+ Thus, be sure to run the package update step separately
+ after building any packages.
+ </para>
+
+ <para>
+ You can use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
+ variables to pre-configure target images to use a package
+ feed.
+ If you do not define these variables, then manual steps
+ as described in the subsequent sections are necessary to
+ configure the target.
+ You should set these variables before building the image
+ in order to produce a correctly configured image.
+ </para>
+
+ <para>
+ When your build is complete, your packages reside in the
+ <filename>${TMPDIR}/deploy/<replaceable>packageformat</replaceable></filename>
+ directory.
+ For example, if
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink><filename>}</filename>
+ is <filename>tmp</filename> and your selected package type
+ is RPM, then your RPM packages are available in
+ <filename>tmp/deploy/rpm</filename>.
+ </para>
+ </section>
+
+ <section id='runtime-package-management-server'>
+ <title>Host or Server Machine Setup</title>
+
+ <para>
+ Although other protocols are possible, a server using HTTP
+ typically serves packages.
+ If you want to use HTTP, then set up and configure a
+ web server such as Apache 2, lighttpd, or
+ SimpleHTTPServer on the machine serving the packages.
+ </para>
+
+ <para>
+ To keep things simple, this section describes how to set
+ up a SimpleHTTPServer web server to share package feeds
+ from the developer's machine.
+ Although this server might not be the best for a production
+ environment, the setup is simple and straight forward.
+ Should you want to use a different server more suited for
+ production (e.g. Apache 2, Lighttpd, or Nginx), take the
+ appropriate steps to do so.
+ </para>
+
+ <para>
+ From within the build directory where you have built an
+ image based on your packaging choice (i.e. the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ setting), simply start the server.
+ The following example assumes a build directory of
+ <filename>~/poky/build/tmp/deploy/rpm</filename> and a
+ <filename>PACKAGE_CLASSES</filename> setting of
+ "package_rpm":
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/tmp/deploy/rpm
+ $ python -m SimpleHTTPServer
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='runtime-package-management-target'>
+ <title>Target Setup</title>
+
+ <para>
+ Setting up the target differs depending on the
+ package management system.
+ This section provides information for RPM, IPK, and DEB.
+ </para>
+
+ <section id='runtime-package-management-target-rpm'>
+ <title>Using RPM</title>
+
+ <para>
+ The
+ <ulink url='https://en.wikipedia.org/wiki/DNF_(software)'>Dandified Packaging Tool</ulink>
+ (DNF) performs runtime package management of RPM
+ packages.
+ In order to use DNF for runtime package management,
+ you must perform an initial setup on the target
+ machine for cases where the
+ <filename>PACKAGE_FEED_*</filename> variables were not
+ set as part of the image that is running on the
+ target.
+ This means if you built your image and did not not use
+ these variables as part of the build and your image is
+ now running on the target, you need to perform the
+ steps in this section if you want to use runtime
+ package management.
+ <note>
+ For information on the
+ <filename>PACKAGE_FEED_*</filename> variables, see
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
+ in the Yocto Project Reference Manual variables
+ glossary.
+ </note>
+ </para>
+
+ <para>
+ On the target, you must inform DNF that package
+ databases are available.
+ You do this by creating a file named
+ <filename>/etc/yum.repos.d/oe-packages.repo</filename>
+ and defining the <filename>oe-packages</filename>.
+ </para>
+
+ <para>
+ As an example, assume the target is able to use the
+ following package databases:
+ <filename>all</filename>, <filename>i586</filename>,
+ and <filename>qemux86</filename> from a server named
+ <filename>my.server</filename>.
+ The specifics for setting up the web server are up to
+ you.
+ The critical requirement is that the URIs in the
+ target repository configuration point to the
+ correct remote location for the feeds.
+ <note><title>Tip</title>
+ For development purposes, you can point the web
+ server to the build system's
+ <filename>deploy</filename> directory.
+ However, for production use, it is better to copy
+ the package directories to a location outside of
+ the build area and use that location.
+ Doing so avoids situations where the build system
+ overwrites or changes the
+ <filename>deploy</filename> directory.
+ </note>
+ </para>
+
+ <para>
+ When telling DNF where to look for the package
+ databases, you must declare individual locations
+ per architecture or a single location used for all
+ architectures.
+ You cannot do both:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Create an Explicit List of Architectures:</emphasis>
+ Define individual base URLs to identify where
+ each package database is located:
+ <literallayout class='monospaced'>
+ [oe-packages]
+ baseurl=http://my.server/rpm/i586 http://my.server/rpm/qemux86 http://my.server/rpm/all
+ </literallayout>
+ This example informs DNF about individual
+ package databases for all three architectures.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Single (Full) Package Index:</emphasis>
+ Define a single base URL that identifies where
+ a full package database is located:
+ <literallayout class='monospaced'>
+ [oe-packages]
+ baseurl=http://my.server/rpm
+ </literallayout>
+ This example informs DNF about a single package
+ database that contains all the package index
+ information for all supported architectures.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Once you have informed DNF where to find the package
+ databases, you need to fetch them:
+ <literallayout class='monospaced'>
+ # dnf makecache
+ </literallayout>
+ DNF is now able to find, install, and upgrade packages
+ from the specified repository or repositories.
+ <note>
+ See the
+ <ulink url='http://dnf.readthedocs.io/en/latest/'>DNF documentation</ulink>
+ for additional information.
+ </note>
+ </para>
+ </section>
+
+ <section id='runtime-package-management-target-ipk'>
+ <title>Using IPK</title>
+
+ <para>
+ The <filename>opkg</filename> application performs
+ runtime package management of IPK packages.
+ You must perform an initial setup for
+ <filename>opkg</filename> on the target machine
+ if the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
+ variables have not been set or the target image was
+ built before the variables were set.
+ </para>
+
+ <para>
+ The <filename>opkg</filename> application uses
+ configuration files to find available package
+ databases.
+ Thus, you need to create a configuration file inside
+ the <filename>/etc/opkg/</filename> direction, which
+ informs <filename>opkg</filename> of any repository
+ you want to use.
+ </para>
+
+ <para>
+ As an example, suppose you are serving packages from a
+ <filename>ipk/</filename> directory containing the
+ <filename>i586</filename>,
+ <filename>all</filename>, and
+ <filename>qemux86</filename> databases through an
+ HTTP server named <filename>my.server</filename>.
+ On the target, create a configuration file
+ (e.g. <filename>my_repo.conf</filename>) inside the
+ <filename>/etc/opkg/</filename> directory containing
+ the following:
+ <literallayout class='monospaced'>
+ src/gz all http://my.server/ipk/all
+ src/gz i586 http://my.server/ipk/i586
+ src/gz qemux86 http://my.server/ipk/qemux86
+ </literallayout>
+ Next, instruct <filename>opkg</filename> to fetch
+ the repository information:
+ <literallayout class='monospaced'>
+ # opkg update
+ </literallayout>
+ The <filename>opkg</filename> application is now able
+ to find, install, and upgrade packages from the
+ specified repository.
+ </para>
+ </section>
+
+ <section id='runtime-package-management-target-deb'>
+ <title>Using DEB</title>
+
+ <para>
+ The <filename>apt</filename> application performs
+ runtime package management of DEB packages.
+ This application uses a source list file to find
+ available package databases.
+ You must perform an initial setup for
+ <filename>apt</filename> on the target machine
+ if the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></ulink>, and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></ulink>
+ variables have not been set or the target image was
+ built before the variables were set.
+ </para>
+
+ <para>
+ To inform <filename>apt</filename> of the repository
+ you want to use, you might create a list file (e.g.
+ <filename>my_repo.list</filename>) inside the
+ <filename>/etc/apt/sources.list.d/</filename>
+ directory.
+ As an example, suppose you are serving packages from a
+ <filename>deb/</filename> directory containing the
+ <filename>i586</filename>,
+ <filename>all</filename>, and
+ <filename>qemux86</filename> databases through an
+ HTTP server named <filename>my.server</filename>.
+ The list file should contain:
+ <literallayout class='monospaced'>
+ deb http://my.server/deb/all ./
+ deb http://my.server/deb/i586 ./
+ deb http://my.server/deb/qemux86 ./
+ </literallayout>
+ Next, instruct the <filename>apt</filename>
+ application to fetch the repository information:
+ <literallayout class='monospaced'>
+ # apt-get update
+ </literallayout>
+ After this step, <filename>apt</filename> is able
+ to find, install, and upgrade packages from the
+ specified repository.
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='generating-and-using-signed-packages'>
+ <title>Generating and Using Signed Packages</title>
+ <para>
+ In order to add security to RPM packages used during a build,
+ you can take steps to securely sign them.
+ Once a signature is verified, the OpenEmbedded build system
+ can use the package in the build.
+ If security fails for a signed package, the build system
+ aborts the build.
+ </para>
+
+ <para>
+ This section describes how to sign RPM packages during a build
+ and how to use signed package feeds (repositories) when
+ doing a build.
+ </para>
+
+ <section id='signing-rpm-packages'>
+ <title>Signing RPM Packages</title>
+
+ <para>
+ To enable signing RPM packages, you must set up the
+ following configurations in either your
+ <filename>local.config</filename> or
+ <filename>distro.config</filename> file:
+ <literallayout class='monospaced'>
+ # Inherit sign_rpm.bbclass to enable signing functionality
+ INHERIT += " sign_rpm"
+ # Define the GPG key that will be used for signing.
+ RPM_GPG_NAME = "<replaceable>key_name</replaceable>"
+ # Provide passphrase for the key
+ RPM_GPG_PASSPHRASE = "<replaceable>passphrase</replaceable>"
+ </literallayout>
+ <note>
+ Be sure to supply appropriate values for both
+ <replaceable>key_name</replaceable> and
+ <replaceable>passphrase</replaceable>
+ </note>
+ Aside from the
+ <filename>RPM_GPG_NAME</filename> and
+ <filename>RPM_GPG_PASSPHRASE</filename> variables in the
+ previous example, two optional variables related to signing
+ exist:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>GPG_BIN</filename>:</emphasis>
+ Specifies a <filename>gpg</filename> binary/wrapper
+ that is executed when the package is signed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>GPG_PATH</filename>:</emphasis>
+ Specifies the <filename>gpg</filename> home
+ directory used when the package is signed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='processing-package-feeds'>
+ <title>Processing Package Feeds</title>
+
+ <para>
+ In addition to being able to sign RPM packages, you can
+ also enable signed package feeds for IPK and RPM packages.
+ </para>
+
+ <para>
+ The steps you need to take to enable signed package feed
+ use are similar to the steps used to sign RPM packages.
+ You must define the following in your
+ <filename>local.config</filename> or
+ <filename>distro.config</filename> file:
+ <literallayout class='monospaced'>
+ INHERIT += "sign_package_feed"
+ PACKAGE_FEED_GPG_NAME = "<replaceable>key_name</replaceable>"
+ PACKAGE_FEED_GPG_PASSPHRASE_FILE = "<replaceable>path_to_file_containing_passphrase</replaceable>"
+ </literallayout>
+ For signed package feeds, the passphrase must exist in a
+ separate file, which is pointed to by the
+ <filename>PACKAGE_FEED_GPG_PASSPHRASE_FILE</filename>
+ variable.
+ Regarding security, keeping a plain text passphrase out of
+ the configuration is more secure.
+ </para>
+
+ <para>
+ Aside from the
+ <filename>PACKAGE_FEED_GPG_NAME</filename> and
+ <filename>PACKAGE_FEED_GPG_PASSPHRASE_FILE</filename>
+ variables, three optional variables related to signed
+ package feeds exist:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>GPG_BIN</filename>:</emphasis>
+ Specifies a <filename>gpg</filename> binary/wrapper
+ that is executed when the package is signed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>GPG_PATH</filename>:</emphasis>
+ Specifies the <filename>gpg</filename> home
+ directory used when the package is signed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>PACKAGE_FEED_GPG_SIGNATURE_TYPE</filename>:</emphasis>
+ Specifies the type of <filename>gpg</filename>
+ signature.
+ This variable applies only to RPM and IPK package
+ feeds.
+ Allowable values for the
+ <filename>PACKAGE_FEED_GPG_SIGNATURE_TYPE</filename>
+ are "ASC", which is the default and specifies ascii
+ armored, and "BIN", which specifies binary.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='testing-packages-with-ptest'>
+ <title>Testing Packages With ptest</title>
+
+ <para>
+ A Package Test (ptest) runs tests against packages built
+ by the OpenEmbedded build system on the target machine.
+ A ptest contains at least two items: the actual test, and
+ a shell script (<filename>run-ptest</filename>) that starts
+ the test.
+ The shell script that starts the test must not contain
+ the actual test - the script only starts the test.
+ On the other hand, the test can be anything from a simple
+ shell script that runs a binary and checks the output to
+ an elaborate system of test binaries and data files.
+ </para>
+
+ <para>
+ The test generates output in the format used by
+ Automake:
+ <literallayout class='monospaced'>
+ <replaceable>result</replaceable>: <replaceable>testname</replaceable>
+ </literallayout>
+ where the result can be <filename>PASS</filename>,
+ <filename>FAIL</filename>, or <filename>SKIP</filename>,
+ and the testname can be any identifying string.
+ </para>
+
+ <para>
+ For a list of Yocto Project recipes that are already
+ enabled with ptest, see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/Ptest'>Ptest</ulink>
+ wiki page.
+ <note>
+ A recipe is "ptest-enabled" if it inherits the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-ptest'><filename>ptest</filename></ulink>
+ class.
+ </note>
+ </para>
+
+ <section id='adding-ptest-to-your-build'>
+ <title>Adding ptest to Your Build</title>
+
+ <para>
+ To add package testing to your build, add the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
+ variables to your <filename>local.conf</filename> file,
+ which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " ptest"
+ EXTRA_IMAGE_FEATURES += "ptest-pkgs"
+ </literallayout>
+ Once your build is complete, the ptest files are installed
+ into the
+ <filename>/usr/lib/<replaceable>package</replaceable>/ptest</filename>
+ directory within the image, where
+ <filename><replaceable>package</replaceable></filename>
+ is the name of the package.
+ </para>
+ </section>
+
+ <section id='running-ptest'>
+ <title>Running ptest</title>
+
+ <para>
+ The <filename>ptest-runner</filename> package installs a
+ shell script that loops through all installed ptest test
+ suites and runs them in sequence.
+ Consequently, you might want to add this package to
+ your image.
+ </para>
+ </section>
+
+ <section id='getting-your-package-ready'>
+ <title>Getting Your Package Ready</title>
+
+ <para>
+ In order to enable a recipe to run installed ptests
+ on target hardware,
+ you need to prepare the recipes that build the packages
+ you want to test.
+ Here is what you have to do for each recipe:
+ <itemizedlist>
+ <listitem><para><emphasis>Be sure the recipe
+ inherits the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-ptest'><filename>ptest</filename></ulink>
+ class:</emphasis>
+ Include the following line in each recipe:
+ <literallayout class='monospaced'>
+ inherit ptest
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Create <filename>run-ptest</filename>:</emphasis>
+ This script starts your test.
+ Locate the script where you will refer to it
+ using
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
+ Here is an example that starts a test for
+ <filename>dbus</filename>:
+ <literallayout class='monospaced'>
+ #!/bin/sh
+ cd test
+ make -k runtest-TESTS
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Ensure dependencies are
+ met:</emphasis>
+ If the test adds build or runtime dependencies
+ that normally do not exist for the package
+ (such as requiring "make" to run the test suite),
+ use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
+ variables in your recipe in order for the package
+ to meet the dependencies.
+ Here is an example where the package has a runtime
+ dependency on "make":
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN}-ptest += "make"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Add a function to build the
+ test suite:</emphasis>
+ Not many packages support cross-compilation of
+ their test suites.
+ Consequently, you usually need to add a
+ cross-compilation function to the package.
+ </para>
+
+ <para>Many packages based on Automake compile and
+ run the test suite by using a single command
+ such as <filename>make check</filename>.
+ However, the host <filename>make check</filename>
+ builds and runs on the same computer, while
+ cross-compiling requires that the package is built
+ on the host but executed for the target
+ architecture (though often, as in the case for
+ ptest, the execution occurs on the host).
+ The built version of Automake that ships with the
+ Yocto Project includes a patch that separates
+ building and execution.
+ Consequently, packages that use the unaltered,
+ patched version of <filename>make check</filename>
+ automatically cross-compiles.</para>
+ <para>Regardless, you still must add a
+ <filename>do_compile_ptest</filename> function to
+ build the test suite.
+ Add a function similar to the following to your
+ recipe:
+ <literallayout class='monospaced'>
+ do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+ }
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Ensure special configurations
+ are set:</emphasis>
+ If the package requires special configurations
+ prior to compiling the test code, you must
+ insert a <filename>do_configure_ptest</filename>
+ function into the recipe.
+ </para></listitem>
+ <listitem><para><emphasis>Install the test
+ suite:</emphasis>
+ The <filename>ptest</filename> class
+ automatically copies the file
+ <filename>run-ptest</filename> to the target and
+ then runs make <filename>install-ptest</filename>
+ to run the tests.
+ If this is not enough, you need to create a
+ <filename>do_install_ptest</filename> function and
+ make sure it gets called after the
+ "make install-ptest" completes.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='efficiently-fetching-source-files-during-a-build'>
+ <title>Efficiently Fetching Source Files During a Build</title>
+
+ <para>
+ The OpenEmbedded build system works with source files located
+ through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable.
+ When you build something using BitBake, a big part of the operation
+ is locating and downloading all the source tarballs.
+ For images, downloading all the source for various packages can
+ take a significant amount of time.
+ </para>
+
+ <para>
+ This section shows you how you can use mirrors to speed up
+ fetching source files and how you can pre-fetch files all of which
+ leads to more efficient use of resources and time.
+ </para>
+
+ <section id='setting-up-effective-mirrors'>
+ <title>Setting up Effective Mirrors</title>
+
+ <para>
+ A good deal that goes into a Yocto Project
+ build is simply downloading all of the source tarballs.
+ Maybe you have been working with another build system
+ (OpenEmbedded or Angstrom) for which you have built up a
+ sizable directory of source tarballs.
+ Or, perhaps someone else has such a directory for which you
+ have read access.
+ If so, you can save time by adding statements to your
+ configuration file so that the build process checks local
+ directories first for existing tarballs before checking the
+ Internet.
+ </para>
+
+ <para>
+ Here is an efficient way to set it up in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ SOURCE_MIRROR_URL ?= "file:///home/you/your-download-dir/"
+ INHERIT += "own-mirrors"
+ BB_GENERATE_MIRROR_TARBALLS = "1"
+ # BB_NO_NETWORK = "1"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink>
+ variable causes the OpenEmbedded build system to generate
+ tarballs of the Git repositories and store them in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ directory.
+ Due to performance reasons, generating and storing these
+ tarballs is not the build system's default behavior.
+ </para>
+
+ <para>
+ You can also use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREMIRRORS'><filename>PREMIRRORS</filename></ulink>
+ variable.
+ For an example, see the variable's glossary entry in the
+ Yocto Project Reference Manual.
+ </para>
+ </section>
+
+ <section id='getting-source-files-and-suppressing-the-build'>
+ <title>Getting Source Files and Suppressing the Build</title>
+
+ <para>
+ Another technique you can use to ready yourself for a
+ successive string of build operations, is to pre-fetch
+ all the source files without actually starting a build.
+ This technique lets you work through any download issues
+ and ultimately gathers all the source files into your
+ download directory
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-build-downloads'><filename>build/downloads</filename></ulink>,
+ which is located with
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>.
+ </para>
+
+ <para>
+ Use the following BitBake command form to fetch all the
+ necessary sources without starting the build:
+ <literallayout class='monospaced'>
+ $ bitbake -c <replaceable>target</replaceable> runall="fetch"
+ </literallayout>
+ This variation of the BitBake command guarantees that you
+ have all the sources for that BitBake target should you
+ disconnect from the Internet and want to do the build
+ later offline.
+ </para>
+ </section>
+ </section>
+
+ <section id="selecting-an-initialization-manager">
+ <title>Selecting an Initialization Manager</title>
+
+ <para>
+ By default, the Yocto Project uses SysVinit as the initialization
+ manager.
+ However, support also exists for systemd,
+ which is a full replacement for init with
+ parallel starting of services, reduced shell overhead and other
+ features that are used by many distributions.
+ </para>
+
+ <para>
+ If you want to use SysVinit, you do
+ not have to do anything.
+ But, if you want to use systemd, you must
+ take some steps as described in the following sections.
+ </para>
+
+ <section id='using-systemd-exclusively'>
+ <title>Using systemd Exclusively</title>
+
+ <para>
+ Set the these variables in your distribution configuration
+ file as follows:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " systemd"
+ VIRTUAL-RUNTIME_init_manager = "systemd"
+ </literallayout>
+ You can also prevent the SysVinit
+ distribution feature from
+ being automatically enabled as follows:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
+ </literallayout>
+ Doing so removes any redundant SysVinit scripts.
+ </para>
+
+ <para>
+ To remove initscripts from your image altogether,
+ set this variable also:
+ <literallayout class='monospaced'>
+ VIRTUAL-RUNTIME_initscripts = ""
+ </literallayout>
+ </para>
+
+ <para>
+ For information on the backfill variable, see
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></ulink>.
+ </para>
+ </section>
+
+ <section id='using-systemd-for-the-main-image-and-using-sysvinit-for-the-rescue-image'>
+ <title>Using systemd for the Main Image and Using SysVinit for the Rescue Image</title>
+
+ <para>
+ Set these variables in your distribution configuration
+ file as follows:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " systemd"
+ VIRTUAL-RUNTIME_init_manager = "systemd"
+ </literallayout>
+ Doing so causes your main image to use the
+ <filename>packagegroup-core-boot.bb</filename> recipe and
+ systemd.
+ The rescue/minimal image cannot use this package group.
+ However, it can install SysVinit
+ and the appropriate packages will have support for both
+ systemd and SysVinit.
+ </para>
+ </section>
+ </section>
+
+ <section id="selecting-dev-manager">
+ <title>Selecting a Device Manager</title>
+
+ <para>
+ The Yocto Project provides multiple ways to manage the device
+ manager (<filename>/dev</filename>):
+ <itemizedlist>
+ <listitem><para><emphasis>Persistent and Pre-Populated<filename>/dev</filename>:</emphasis>
+ For this case, the <filename>/dev</filename> directory
+ is persistent and the required device nodes are created
+ during the build.
+ </para></listitem>
+ <listitem><para><emphasis>Use <filename>devtmpfs</filename> with a Device Manager:</emphasis>
+ For this case, the <filename>/dev</filename> directory
+ is provided by the kernel as an in-memory file system and
+ is automatically populated by the kernel at runtime.
+ Additional configuration of device nodes is done in user
+ space by a device manager like
+ <filename>udev</filename> or
+ <filename>busybox-mdev</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id="static-dev-management">
+ <title>Using Persistent and Pre-Populated<filename>/dev</filename></title>
+
+ <para>
+ To use the static method for device population, you need to
+ set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-USE_DEVFS'><filename>USE_DEVFS</filename></ulink>
+ variable to "0" as follows:
+ <literallayout class='monospaced'>
+ USE_DEVFS = "0"
+ </literallayout>
+ </para>
+
+ <para>
+ The content of the resulting <filename>/dev</filename>
+ directory is defined in a Device Table file.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_DEVICE_TABLES'><filename>IMAGE_DEVICE_TABLES</filename></ulink>
+ variable defines the Device Table to use and should be set
+ in the machine or distro configuration file.
+ Alternatively, you can set this variable in your
+ <filename>local.conf</filename> configuration file.
+ </para>
+
+ <para>
+ If you do not define the
+ <filename>IMAGE_DEVICE_TABLES</filename> variable, the default
+ <filename>device_table-minimal.txt</filename> is used:
+ <literallayout class='monospaced'>
+ IMAGE_DEVICE_TABLES = "device_table-mymachine.txt"
+ </literallayout>
+ </para>
+
+ <para>
+ The population is handled by the <filename>makedevs</filename>
+ utility during image creation:
+ </para>
+ </section>
+
+ <section id="devtmpfs-dev-management">
+ <title>Using <filename>devtmpfs</filename> and a Device Manager</title>
+
+ <para>
+ To use the dynamic method for device population, you need to
+ use (or be sure to set) the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-USE_DEVFS'><filename>USE_DEVFS</filename></ulink>
+ variable to "1", which is the default:
+ <literallayout class='monospaced'>
+ USE_DEVFS = "1"
+ </literallayout>
+ With this setting, the resulting <filename>/dev</filename>
+ directory is populated by the kernel using
+ <filename>devtmpfs</filename>.
+ Make sure the corresponding kernel configuration variable
+ <filename>CONFIG_DEVTMPFS</filename> is set when building
+ you build a Linux kernel.
+ </para>
+
+ <para>
+ All devices created by <filename>devtmpfs</filename> will be
+ owned by <filename>root</filename> and have permissions
+ <filename>0600</filename>.
+ </para>
+
+ <para>
+ To have more control over the device nodes, you can use a
+ device manager like <filename>udev</filename> or
+ <filename>busybox-mdev</filename>.
+ You choose the device manager by defining the
+ <filename>VIRTUAL-RUNTIME_dev_manager</filename> variable
+ in your machine or distro configuration file.
+ Alternatively, you can set this variable in your
+ <filename>local.conf</filename> configuration file:
+ <literallayout class='monospaced'>
+ VIRTUAL-RUNTIME_dev_manager = "udev"
+
+ # Some alternative values
+ # VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+ # VIRTUAL-RUNTIME_dev_manager = "systemd"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id="platdev-appdev-srcrev">
+ <title>Using an External SCM</title>
+
+ <para>
+ If you're working on a recipe that pulls from an external Source
+ Code Manager (SCM), it is possible to have the OpenEmbedded build
+ system notice new recipe changes added to the SCM and then build
+ the resulting packages that depend on the new recipes by using
+ the latest versions.
+ This only works for SCMs from which it is possible to get a
+ sensible revision number for changes.
+ Currently, you can do this with Apache Subversion (SVN), Git, and
+ Bazaar (BZR) repositories.
+ </para>
+
+ <para>
+ To enable this behavior, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ of the recipe needs to reference
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ PV = "1.2.3+git${SRCPV}"
+ </literallayout>
+ Then, you can add the following to your
+ <filename>local.conf</filename>:
+ <literallayout class='monospaced'>
+ SRCREV_pn-<replaceable>PN</replaceable> = "${AUTOREV}"
+ </literallayout>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>
+ is the name of the recipe for which you want to enable automatic source
+ revision updating.
+ </para>
+
+ <para>
+ If you do not want to update your local configuration file, you can
+ add the following directly to the recipe to finish enabling
+ the feature:
+ <literallayout class='monospaced'>
+ SRCREV = "${AUTOREV}"
+ </literallayout>
+ </para>
+
+ <para>
+ The Yocto Project provides a distribution named
+ <filename>poky-bleeding</filename>, whose configuration
+ file contains the line:
+ <literallayout class='monospaced'>
+ require conf/distro/include/poky-floating-revisions.inc
+ </literallayout>
+ This line pulls in the listed include file that contains
+ numerous lines of exactly that form:
+ <literallayout class='monospaced'>
+ #SRCREV_pn-opkg-native ?= "${AUTOREV}"
+ #SRCREV_pn-opkg-sdk ?= "${AUTOREV}"
+ #SRCREV_pn-opkg ?= "${AUTOREV}"
+ #SRCREV_pn-opkg-utils-native ?= "${AUTOREV}"
+ #SRCREV_pn-opkg-utils ?= "${AUTOREV}"
+ SRCREV_pn-gconf-dbus ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-common ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-config-gtk ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-desktop ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-keyboard ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-panel-2 ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-themes-extra ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-terminal ?= "${AUTOREV}"
+ SRCREV_pn-matchbox-wm ?= "${AUTOREV}"
+ SRCREV_pn-settings-daemon ?= "${AUTOREV}"
+ SRCREV_pn-screenshot ?= "${AUTOREV}"
+ .
+ .
+ .
+ </literallayout>
+ These lines allow you to experiment with building a
+ distribution that tracks the latest development source
+ for numerous packages.
+ <note><title>Caution</title>
+ The <filename>poky-bleeding</filename> distribution
+ is not tested on a regular basis.
+ Keep this in mind if you use it.
+ </note>
+ </para>
+ </section>
+
+ <section id='creating-a-read-only-root-filesystem'>
+ <title>Creating a Read-Only Root Filesystem</title>
+
+ <para>
+ Suppose, for security reasons, you need to disable
+ your target device's root filesystem's write permissions
+ (i.e. you need a read-only root filesystem).
+ Or, perhaps you are running the device's operating system
+ from a read-only storage device.
+ For either case, you can customize your image for
+ that behavior.
+ </para>
+
+ <note>
+ Supporting a read-only root filesystem requires that the system and
+ applications do not try to write to the root filesystem.
+ You must configure all parts of the target system to write
+ elsewhere, or to gracefully fail in the event of attempting to
+ write to the root filesystem.
+ </note>
+
+ <section id='creating-the-root-filesystem'>
+ <title>Creating the Root Filesystem</title>
+
+ <para>
+ To create the read-only root filesystem, simply add the
+ "read-only-rootfs" feature to your image.
+ Using either of the following statements in your
+ image recipe or from within the
+ <filename>local.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ causes the build system to create a read-only root filesystem:
+ <literallayout class='monospaced'>
+ IMAGE_FEATURES = "read-only-rootfs"
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ EXTRA_IMAGE_FEATURES += "read-only-rootfs"
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on how to use these variables, see the
+ "<link linkend='usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></link>"
+ section.
+ For information on the variables, see
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>.
+ </para>
+ </section>
+
+ <section id='post-installation-scripts'>
+ <title>Post-Installation Scripts</title>
+
+ <para>
+ It is very important that you make sure all
+ post-Installation (<filename>pkg_postinst</filename>) scripts
+ for packages that are installed into the image can be run
+ at the time when the root filesystem is created during the
+ build on the host system.
+ These scripts cannot attempt to run during first-boot on the
+ target device.
+ With the "read-only-rootfs" feature enabled,
+ the build system checks during root filesystem creation to make
+ sure all post-installation scripts succeed.
+ If any of these scripts still need to be run after the root
+ filesystem is created, the build immediately fails.
+ These build-time checks ensure that the build fails
+ rather than the target device fails later during its
+ initial boot operation.
+ </para>
+
+ <para>
+ Most of the common post-installation scripts generated by the
+ build system for the out-of-the-box Yocto Project are engineered
+ so that they can run during root filesystem creation
+ (e.g. post-installation scripts for caching fonts).
+ However, if you create and add custom scripts, you need
+ to be sure they can be run during this file system creation.
+ </para>
+
+ <para>
+ Here are some common problems that prevent
+ post-installation scripts from running during root filesystem
+ creation:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Not using $D in front of absolute
+ paths:</emphasis>
+ The build system defines
+ <filename>$</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink>
+ when the root filesystem is created.
+ Furthermore, <filename>$D</filename> is blank when the
+ script is run on the target device.
+ This implies two purposes for <filename>$D</filename>:
+ ensuring paths are valid in both the host and target
+ environments, and checking to determine which
+ environment is being used as a method for taking
+ appropriate actions.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Attempting to run processes that are
+ specific to or dependent on the target
+ architecture:</emphasis>
+ You can work around these attempts by using native
+ tools, which run on the host system,
+ to accomplish the same tasks, or
+ by alternatively running the processes under QEMU,
+ which has the <filename>qemu_run_binary</filename>
+ function.
+ For more information, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-qemu'><filename>qemu</filename></ulink>
+ class.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='areas-with-write-access'>
+ <title>Areas With Write Access</title>
+
+ <para>
+ With the "read-only-rootfs" feature enabled,
+ any attempt by the target to write to the root filesystem at
+ runtime fails.
+ Consequently, you must make sure that you configure processes
+ and applications that attempt these types of writes do so
+ to directories with write access (e.g.
+ <filename>/tmp</filename> or <filename>/var/run</filename>).
+ </para>
+ </section>
+ </section>
+
+
+
+
+ <section id='maintaining-build-output-quality'>
+ <title>Maintaining Build Output Quality</title>
+
+ <para>
+ Many factors can influence the quality of a build.
+ For example, if you upgrade a recipe to use a new version of an
+ upstream software package or you experiment with some new
+ configuration options, subtle changes can occur that you might
+ not detect until later.
+ Consider the case where your recipe is using a newer version of
+ an upstream package.
+ In this case, a new version of a piece of software might
+ introduce an optional dependency on another library, which is
+ auto-detected.
+ If that library has already been built when the software is
+ building, the software will link to the built library and that
+ library will be pulled into your image along with the new
+ software even if you did not want the library.
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-buildhistory'><filename>buildhistory</filename></ulink>
+ class exists to help you maintain the quality of your build
+ output.
+ You can use the class to highlight unexpected and possibly
+ unwanted changes in the build output.
+ When you enable build history, it records information about the
+ contents of each package and image and then commits that
+ information to a local Git repository where you can examine
+ the information.
+ </para>
+
+ <para>
+ The remainder of this section describes the following:
+ <itemizedlist>
+ <listitem><para>
+ How you can enable and disable build history
+ </para></listitem>
+ <listitem><para>
+ How to understand what the build history contains
+ </para></listitem>
+ <listitem><para>
+ How to limit the information used for build history
+ </para></listitem>
+ <listitem><para>
+ How to examine the build history from both a
+ command-line and web interface
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='enabling-and-disabling-build-history'>
+ <title>Enabling and Disabling Build History</title>
+
+ <para>
+ Build history is disabled by default.
+ To enable it, add the following <filename>INHERIT</filename>
+ statement and set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></ulink>
+ variable to "1" at the end of your
+ <filename>conf/local.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "1"
+ </literallayout>
+ Enabling build history as previously described causes the
+ OpenEmbedded build system to collect build output information
+ and commit it as a single commit to a local
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
+ repository.
+ <note>
+ Enabling build history increases your build times slightly,
+ particularly for images, and increases the amount of disk
+ space used during the build.
+ </note>
+ </para>
+
+ <para>
+ You can disable build history by removing the previous
+ statements from your <filename>conf/local.conf</filename>
+ file.
+ </para>
+ </section>
+
+ <section id='understanding-what-the-build-history-contains'>
+ <title>Understanding What the Build History Contains</title>
+
+ <para>
+ Build history information is kept in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-TOPDIR'><filename>TOPDIR</filename></ulink><filename>}/buildhistory</filename>
+ in the Build Directory as defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BUILDHISTORY_DIR'><filename>BUILDHISTORY_DIR</filename></ulink>
+ variable.
+ The following is an example abbreviated listing:
+ <imagedata fileref="figures/buildhistory.png" align="center" width="6in" depth="4in" />
+ </para>
+
+ <para>
+ At the top level, a <filename>metadata-revs</filename>
+ file exists that lists the revisions of the repositories for
+ the enabled layers when the build was produced.
+ The rest of the data splits into separate
+ <filename>packages</filename>, <filename>images</filename>
+ and <filename>sdk</filename> directories, the contents of
+ which are described as follows.
+ </para>
+
+ <section id='build-history-package-information'>
+ <title>Build History Package Information</title>
+
+ <para>
+ The history for each package contains a text file that has
+ name-value pairs with information about the package.
+ For example,
+ <filename>buildhistory/packages/i586-poky-linux/busybox/busybox/latest</filename>
+ contains the following:
+ <literallayout class='monospaced'>
+ PV = 1.22.1
+ PR = r32
+ RPROVIDES =
+ RDEPENDS = glibc (>= 2.20) update-alternatives-opkg
+ RRECOMMENDS = busybox-syslog busybox-udhcpc update-rc.d
+ PKGSIZE = 540168
+ FILES = /usr/bin/* /usr/sbin/* /usr/lib/busybox/* /usr/lib/lib*.so.* \
+ /etc /com /var /bin/* /sbin/* /lib/*.so.* /lib/udev/rules.d \
+ /usr/lib/udev/rules.d /usr/share/busybox /usr/lib/busybox/* \
+ /usr/share/pixmaps /usr/share/applications /usr/share/idl \
+ /usr/share/omf /usr/share/sounds /usr/lib/bonobo/servers
+ FILELIST = /bin/busybox /bin/busybox.nosuid /bin/busybox.suid /bin/sh \
+ /etc/busybox.links.nosuid /etc/busybox.links.suid
+ </literallayout>
+ Most of these name-value pairs correspond to variables
+ used to produce the package.
+ The exceptions are <filename>FILELIST</filename>, which
+ is the actual list of files in the package, and
+ <filename>PKGSIZE</filename>, which is the total size of
+ files in the package in bytes.
+ </para>
+
+ <para>
+ A file also exists that corresponds to the recipe from
+ which the package came (e.g.
+ <filename>buildhistory/packages/i586-poky-linux/busybox/latest</filename>):
+ <literallayout class='monospaced'>
+ PV = 1.22.1
+ PR = r32
+ DEPENDS = initscripts kern-tools-native update-rc.d-native \
+ virtual/i586-poky-linux-compilerlibs virtual/i586-poky-linux-gcc \
+ virtual/libc virtual/update-alternatives
+ PACKAGES = busybox-ptest busybox-httpd busybox-udhcpd busybox-udhcpc \
+ busybox-syslog busybox-mdev busybox-hwclock busybox-dbg \
+ busybox-staticdev busybox-dev busybox-doc busybox-locale busybox
+ </literallayout>
+ </para>
+
+ <para>
+ Finally, for those recipes fetched from a version control
+ system (e.g., Git), a file exists that lists source
+ revisions that are specified in the recipe and lists
+ the actual revisions used during the build.
+ Listed and actual revisions might differ when
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ is set to
+ ${<ulink url='&YOCTO_DOCS_REF_URL;#var-AUTOREV'><filename>AUTOREV</filename></ulink>}.
+ Here is an example assuming
+ <filename>buildhistory/packages/qemux86-poky-linux/linux-yocto/latest_srcrev</filename>):
+ <literallayout class='monospaced'>
+ # SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1"
+ SRCREV_machine = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1"
+ # SRCREV_meta = "a227f20eff056e511d504b2e490f3774ab260d6f"
+ SRCREV_meta = "a227f20eff056e511d504b2e490f3774ab260d6f"
+ </literallayout>
+ You can use the
+ <filename>buildhistory-collect-srcrevs</filename>
+ command with the <filename>-a</filename> option to
+ collect the stored <filename>SRCREV</filename> values
+ from build history and report them in a format suitable for
+ use in global configuration (e.g.,
+ <filename>local.conf</filename> or a distro include file)
+ to override floating <filename>AUTOREV</filename> values
+ to a fixed set of revisions.
+ Here is some example output from this command:
+ <literallayout class='monospaced'>
+ $ buildhistory-collect-srcrevs -a
+ # i586-poky-linux
+ SRCREV_pn-glibc = "b8079dd0d360648e4e8de48656c5c38972621072"
+ SRCREV_pn-glibc-initial = "b8079dd0d360648e4e8de48656c5c38972621072"
+ SRCREV_pn-opkg-utils = "53274f087565fd45d8452c5367997ba6a682a37a"
+ SRCREV_pn-kmod = "fd56638aed3fe147015bfa10ed4a5f7491303cb4"
+ # x86_64-linux
+ SRCREV_pn-gtk-doc-stub-native = "1dea266593edb766d6d898c79451ef193eb17cfa"
+ SRCREV_pn-dtc-native = "65cc4d2748a2c2e6f27f1cf39e07a5dbabd80ebf"
+ SRCREV_pn-update-rc.d-native = "eca680ddf28d024954895f59a241a622dd575c11"
+ SRCREV_glibc_pn-cross-localedef-native = "b8079dd0d360648e4e8de48656c5c38972621072"
+ SRCREV_localedef_pn-cross-localedef-native = "c833367348d39dad7ba018990bfdaffaec8e9ed3"
+ SRCREV_pn-prelink-native = "faa069deec99bf61418d0bab831c83d7c1b797ca"
+ SRCREV_pn-opkg-utils-native = "53274f087565fd45d8452c5367997ba6a682a37a"
+ SRCREV_pn-kern-tools-native = "23345b8846fe4bd167efdf1bd8a1224b2ba9a5ff"
+ SRCREV_pn-kmod-native = "fd56638aed3fe147015bfa10ed4a5f7491303cb4"
+ # qemux86-poky-linux
+ SRCREV_machine_pn-linux-yocto = "38cd560d5022ed2dbd1ab0dca9642e47c98a0aa1"
+ SRCREV_meta_pn-linux-yocto = "a227f20eff056e511d504b2e490f3774ab260d6f"
+ # all-poky-linux
+ SRCREV_pn-update-rc.d = "eca680ddf28d024954895f59a241a622dd575c11"
+ </literallayout>
+ <note>
+ Here are some notes on using the
+ <filename>buildhistory-collect-srcrevs</filename>
+ command:
+ <itemizedlist>
+ <listitem><para>
+ By default, only values where the
+ <filename>SRCREV</filename> was not hardcoded
+ (usually when <filename>AUTOREV</filename>
+ is used) are reported.
+ Use the <filename>-a</filename> option to
+ see all <filename>SRCREV</filename> values.
+ </para></listitem>
+ <listitem><para>
+ The output statements might not have any effect
+ if overrides are applied elsewhere in the
+ build system configuration.
+ Use the <filename>-f</filename> option to add
+ the <filename>forcevariable</filename> override
+ to each output line if you need to work around
+ this restriction.
+ </para></listitem>
+ <listitem><para>
+ The script does apply special handling when
+ building for multiple machines.
+ However, the script does place a comment before
+ each set of values that specifies which
+ triplet to which they belong as previously
+ shown (e.g.,
+ <filename>i586-poky-linux</filename>).
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </section>
+
+ <section id='build-history-image-information'>
+ <title>Build History Image Information</title>
+
+ <para>
+ The files produced for each image are as follows:
+ <itemizedlist>
+ <listitem><para>
+ <filename>image-files:</filename>
+ A directory containing selected files from the root
+ filesystem.
+ The files are defined by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BUILDHISTORY_IMAGE_FILES'><filename>BUILDHISTORY_IMAGE_FILES</filename></ulink>.
+ </para></listitem>
+ <listitem><para>
+ <filename>build-id.txt:</filename>
+ Human-readable information about the build
+ configuration and metadata source revisions.
+ This file contains the full build header as printed
+ by BitBake.
+ </para></listitem>
+ <listitem><para>
+ <filename>*.dot:</filename>
+ Dependency graphs for the image that are
+ compatible with <filename>graphviz</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>files-in-image.txt:</filename>
+ A list of files in the image with permissions,
+ owner, group, size, and symlink information.
+ </para></listitem>
+ <listitem><para>
+ <filename>image-info.txt:</filename>
+ A text file containing name-value pairs with
+ information about the image.
+ See the following listing example for more
+ information.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-package-names.txt:</filename>
+ A list of installed packages by name only.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-package-sizes.txt:</filename>
+ A list of installed packages ordered by size.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-packages.txt:</filename>
+ A list of installed packages with full package
+ filenames.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ Installed package information is able to be gathered
+ and produced even if package management is disabled
+ for the final image.
+ </note>
+ </para>
+
+ <para>
+ Here is an example of <filename>image-info.txt</filename>:
+ <literallayout class='monospaced'>
+ DISTRO = poky
+ DISTRO_VERSION = 1.7
+ USER_CLASSES = buildstats image-mklibs image-prelink
+ IMAGE_CLASSES = image_types
+ IMAGE_FEATURES = debug-tweaks
+ IMAGE_LINGUAS =
+ IMAGE_INSTALL = packagegroup-core-boot run-postinsts
+ BAD_RECOMMENDATIONS =
+ NO_RECOMMENDATIONS =
+ PACKAGE_EXCLUDE =
+ ROOTFS_POSTPROCESS_COMMAND = write_package_manifest; license_create_manifest; \
+ write_image_manifest ; buildhistory_list_installed_image ; \
+ buildhistory_get_image_installed ; ssh_allow_empty_password; \
+ postinst_enable_logging; rootfs_update_timestamp ; ssh_disable_dns_lookup ;
+ IMAGE_POSTPROCESS_COMMAND = buildhistory_get_imageinfo ;
+ IMAGESIZE = 6900
+ </literallayout>
+ Other than <filename>IMAGESIZE</filename>, which is the
+ total size of the files in the image in Kbytes, the
+ name-value pairs are variables that may have influenced the
+ content of the image.
+ This information is often useful when you are trying to
+ determine why a change in the package or file
+ listings has occurred.
+ </para>
+ </section>
+
+ <section id='using-build-history-to-gather-image-information-only'>
+ <title>Using Build History to Gather Image Information Only</title>
+
+ <para>
+ As you can see, build history produces image information,
+ including dependency graphs, so you can see why something
+ was pulled into the image.
+ If you are just interested in this information and not
+ interested in collecting specific package or SDK
+ information, you can enable writing only image information
+ without any history by adding the following to your
+ <filename>conf/local.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "buildhistory"
+ BUILDHISTORY_COMMIT = "0"
+ BUILDHISTORY_FEATURES = "image"
+ </literallayout>
+ Here, you set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BUILDHISTORY_FEATURES'><filename>BUILDHISTORY_FEATURES</filename></ulink>
+ variable to use the image feature only.
+ </para>
+ </section>
+
+ <section id='build-history-sdk-information'>
+ <title>Build History SDK Information</title>
+
+ <para>
+ Build history collects similar information on the contents
+ of SDKs
+ (e.g. <filename>bitbake -c populate_sdk imagename</filename>)
+ as compared to information it collects for images.
+ Furthermore, this information differs depending on whether
+ an extensible or standard SDK is being produced.
+ </para>
+
+ <para>
+ The following list shows the files produced for SDKs:
+ <itemizedlist>
+ <listitem><para>
+ <filename>files-in-sdk.txt:</filename>
+ A list of files in the SDK with permissions,
+ owner, group, size, and symlink information.
+ This list includes both the host and target parts
+ of the SDK.
+ </para></listitem>
+ <listitem><para>
+ <filename>sdk-info.txt:</filename>
+ A text file containing name-value pairs with
+ information about the SDK.
+ See the following listing example for more
+ information.
+ </para></listitem>
+ <listitem><para>
+ <filename>sstate-task-sizes.txt:</filename>
+ A text file containing name-value pairs with
+ information about task group sizes
+ (e.g. <filename>do_populate_sysroot</filename>
+ tasks have a total size).
+ The <filename>sstate-task-sizes.txt</filename> file
+ exists only when an extensible SDK is created.
+ </para></listitem>
+ <listitem><para>
+ <filename>sstate-package-sizes.txt:</filename>
+ A text file containing name-value pairs with
+ information for the shared-state packages and
+ sizes in the SDK.
+ The <filename>sstate-package-sizes.txt</filename>
+ file exists only when an extensible SDK is created.
+ </para></listitem>
+ <listitem><para>
+ <filename>sdk-files:</filename>
+ A folder that contains copies of the files
+ mentioned in
+ <filename>BUILDHISTORY_SDK_FILES</filename> if the
+ files are present in the output.
+ Additionally, the default value of
+ <filename>BUILDHISTORY_SDK_FILES</filename> is
+ specific to the extensible SDK although you can
+ set it differently if you would like to pull in
+ specific files from the standard SDK.</para>
+
+ <para>The default files are
+ <filename>conf/local.conf</filename>,
+ <filename>conf/bblayers.conf</filename>,
+ <filename>conf/auto.conf</filename>,
+ <filename>conf/locked-sigs.inc</filename>, and
+ <filename>conf/devtool.conf</filename>.
+ Thus, for an extensible SDK, these files get
+ copied into the <filename>sdk-files</filename>
+ directory.
+ </para></listitem>
+ <listitem><para>
+ The following information appears under
+ each of the <filename>host</filename>
+ and <filename>target</filename> directories
+ for the portions of the SDK that run on the host
+ and on the target, respectively:
+ <note>
+ The following files for the most part are empty
+ when producing an extensible SDK because this
+ type of SDK is not constructed from packages
+ as is the standard SDK.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <filename>depends.dot:</filename>
+ Dependency graph for the SDK that is
+ compatible with
+ <filename>graphviz</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-package-names.txt:</filename>
+ A list of installed packages by name only.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-package-sizes.txt:</filename>
+ A list of installed packages ordered by size.
+ </para></listitem>
+ <listitem><para>
+ <filename>installed-packages.txt:</filename>
+ A list of installed packages with full
+ package filenames.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Here is an example of <filename>sdk-info.txt</filename>:
+ <literallayout class='monospaced'>
+ DISTRO = poky
+ DISTRO_VERSION = 1.3+snapshot-20130327
+ SDK_NAME = poky-glibc-i686-arm
+ SDK_VERSION = 1.3+snapshot
+ SDKMACHINE =
+ SDKIMAGE_FEATURES = dev-pkgs dbg-pkgs
+ BAD_RECOMMENDATIONS =
+ SDKSIZE = 352712
+ </literallayout>
+ Other than <filename>SDKSIZE</filename>, which is the
+ total size of the files in the SDK in Kbytes, the
+ name-value pairs are variables that might have influenced
+ the content of the SDK.
+ This information is often useful when you are trying to
+ determine why a change in the package or file listings
+ has occurred.
+ </para>
+ </section>
+
+ <section id='examining-build-history-information'>
+ <title>Examining Build History Information</title>
+
+ <para>
+ You can examine build history output from the command
+ line or from a web interface.
+ </para>
+
+ <para>
+ To see any changes that have occurred (assuming you have
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></ulink><filename>&nbsp;= "1"</filename>),
+ you can simply use any Git command that allows you to
+ view the history of a repository.
+ Here is one method:
+ <literallayout class='monospaced'>
+ $ git log -p
+ </literallayout>
+ You need to realize, however, that this method does show
+ changes that are not significant (e.g. a package's size
+ changing by a few bytes).
+ </para>
+
+ <para>
+ A command-line tool called
+ <filename>buildhistory-diff</filename> does exist, though,
+ that queries the Git repository and prints just the
+ differences that might be significant in human-readable
+ form.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ ~/poky/poky/scripts/buildhistory-diff . HEAD^
+ Changes to images/qemux86_64/glibc/core-image-minimal (files-in-image.txt):
+ /etc/anotherpkg.conf was added
+ /sbin/anotherpkg was added
+ * (installed-package-names.txt):
+ * anotherpkg was added
+ Changes to images/qemux86_64/glibc/core-image-minimal (installed-package-names.txt):
+ anotherpkg was added
+ packages/qemux86_64-poky-linux/v86d: PACKAGES: added "v86d-extras"
+ * PR changed from "r0" to "r1"
+ * PV changed from "0.1.10" to "0.1.12"
+ packages/qemux86_64-poky-linux/v86d/v86d: PKGSIZE changed from 110579 to 144381 (+30%)
+ * PR changed from "r0" to "r1"
+ * PV changed from "0.1.10" to "0.1.12"
+ </literallayout>
+ <note>
+ The <filename>buildhistory-diff</filename> tool
+ requires the <filename>GitPython</filename> package.
+ Be sure to install it using Pip3 as follows:
+ <literallayout class='monospaced'>
+ $ pip3 install GitPython --user
+ </literallayout>
+ Alternatively, you can install
+ <filename>python3-git</filename> using the appropriate
+ distribution package manager (e.g.
+ <filename>apt-get</filename>, <filename>dnf</filename>,
+ or <filename>zipper</filename>).
+ </note>
+ </para>
+
+ <para>
+ To see changes to the build history using a web interface,
+ follow the instruction in the <filename>README</filename>
+ file here.
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/buildhistory-web/'></ulink>.
+ </para>
+
+ <para>
+ Here is a sample screenshot of the interface:
+ <imagedata fileref="figures/buildhistory-web.png" align="center" scalefit="1" width="130%" contentdepth="130%" />
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id="performing-automated-runtime-testing">
+ <title>Performing Automated Runtime Testing</title>
+
+ <para>
+ The OpenEmbedded build system makes available a series of automated
+ tests for images to verify runtime functionality.
+ You can run these tests on either QEMU or actual target hardware.
+ Tests are written in Python making use of the
+ <filename>unittest</filename> module, and the majority of them
+ run commands on the target system over SSH.
+ This section describes how you set up the environment to use these
+ tests, run available tests, and write and add your own tests.
+ </para>
+
+ <para>
+ For information on the test and QA infrastructure available
+ within the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#testing-and-quality-assurance'>Testing and Quality Assurance</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <section id='enabling-tests'>
+ <title>Enabling Tests</title>
+
+ <para>
+ Depending on whether you are planning to run tests using
+ QEMU or on the hardware, you have to take
+ different steps to enable the tests.
+ See the following subsections for information on how to
+ enable both types of tests.
+ </para>
+
+ <section id='qemu-image-enabling-tests'>
+ <title>Enabling Runtime Tests on QEMU</title>
+
+ <para>
+ In order to run tests, you need to do the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Set up to avoid interaction
+ with <filename>sudo</filename> for networking:</emphasis>
+ To accomplish this, you must do one of the
+ following:
+ <itemizedlist>
+ <listitem><para>Add
+ <filename>NOPASSWD</filename> for your user
+ in <filename>/etc/sudoers</filename> either for
+ all commands or just for
+ <filename>runqemu-ifup</filename>.
+ You must provide the full path as that can
+ change if you are using multiple clones of the
+ source repository.
+ <note>
+ On some distributions, you also need to
+ comment out "Defaults requiretty" in
+ <filename>/etc/sudoers</filename>.
+ </note></para></listitem>
+ <listitem><para>Manually configure a tap interface
+ for your system.</para></listitem>
+ <listitem><para>Run as root the script in
+ <filename>scripts/runqemu-gen-tapdevs</filename>,
+ which should generate a list of tap devices.
+ This is the option typically chosen for
+ Autobuilder-type environments.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Be sure to use an absolute path
+ when calling this script
+ with sudo.
+ </para></listitem>
+ <listitem><para>
+ The package recipe
+ <filename>qemu-helper-native</filename>
+ is required to run this script.
+ Build the package using the
+ following command:
+ <literallayout class='monospaced'>
+ $ bitbake qemu-helper-native
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ </itemizedlist></para></listitem>
+ <listitem><para><emphasis>Set the
+ <filename>DISPLAY</filename> variable:</emphasis>
+ You need to set this variable so that you have an X
+ server available (e.g. start
+ <filename>vncserver</filename> for a headless machine).
+ </para></listitem>
+ <listitem><para><emphasis>Be sure your host's firewall
+ accepts incoming connections from
+ 192.168.7.0/24:</emphasis>
+ Some of the tests (in particular DNF tests) start
+ an HTTP server on a random high number port,
+ which is used to serve files to the target.
+ The DNF module serves
+ <filename>${WORKDIR}/oe-rootfs-repo</filename>
+ so it can run DNF channel commands.
+ That means your host's firewall
+ must accept incoming connections from 192.168.7.0/24,
+ which is the default IP range used for tap devices
+ by <filename>runqemu</filename>.</para></listitem>
+ <listitem><para><emphasis>Be sure your host has the
+ correct packages installed:</emphasis>
+ Depending your host's distribution, you need
+ to have the following packages installed:
+ <itemizedlist>
+ <listitem><para>Ubuntu and Debian:
+ <filename>sysstat</filename> and
+ <filename>iproute2</filename>
+ </para></listitem>
+ <listitem><para>OpenSUSE:
+ <filename>sysstat</filename> and
+ <filename>iproute2</filename>
+ </para></listitem>
+ <listitem><para>Fedora:
+ <filename>sysstat</filename> and
+ <filename>iproute</filename>
+ </para></listitem>
+ <listitem><para>CentOS:
+ <filename>sysstat</filename> and
+ <filename>iproute</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Once you start running the tests, the following happens:
+ <orderedlist>
+ <listitem><para>A copy of the root filesystem is written
+ to <filename>${WORKDIR}/testimage</filename>.
+ </para></listitem>
+ <listitem><para>The image is booted under QEMU using the
+ standard <filename>runqemu</filename> script.
+ </para></listitem>
+ <listitem><para>A default timeout of 500 seconds occurs
+ to allow for the boot process to reach the login prompt.
+ You can change the timeout period by setting
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_QEMUBOOT_TIMEOUT'><filename>TEST_QEMUBOOT_TIMEOUT</filename></ulink>
+ in the <filename>local.conf</filename> file.
+ </para></listitem>
+ <listitem><para>Once the boot process is reached and the
+ login prompt appears, the tests run.
+ The full boot log is written to
+ <filename>${WORKDIR}/testimage/qemu_boot_log</filename>.
+ </para></listitem>
+ <listitem><para>Each test module loads in the order found
+ in <filename>TEST_SUITES</filename>.
+ You can find the full output of the commands run over
+ SSH in
+ <filename>${WORKDIR}/testimgage/ssh_target_log</filename>.
+ </para></listitem>
+ <listitem><para>If no failures occur, the task running the
+ tests ends successfully.
+ You can find the output from the
+ <filename>unittest</filename> in the task log at
+ <filename>${WORKDIR}/temp/log.do_testimage</filename>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='hardware-image-enabling-tests'>
+ <title>Enabling Runtime Tests on Hardware</title>
+
+ <para>
+ The OpenEmbedded build system can run tests on real
+ hardware, and for certain devices it can also deploy
+ the image to be tested onto the device beforehand.
+ </para>
+
+ <para>
+ For automated deployment, a "master image" is installed
+ onto the hardware once as part of setup.
+ Then, each time tests are to be run, the following
+ occurs:
+ <orderedlist>
+ <listitem><para>The master image is booted into and
+ used to write the image to be tested to
+ a second partition.
+ </para></listitem>
+ <listitem><para>The device is then rebooted using an
+ external script that you need to provide.
+ </para></listitem>
+ <listitem><para>The device boots into the image to be
+ tested.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ When running tests (independent of whether the image
+ has been deployed automatically or not), the device is
+ expected to be connected to a network on a
+ pre-determined IP address.
+ You can either use static IP addresses written into
+ the image, or set the image to use DHCP and have your
+ DHCP server on the test network assign a known IP address
+ based on the MAC address of the device.
+ </para>
+
+ <para>
+ In order to run tests on hardware, you need to set
+ <filename>TEST_TARGET</filename> to an appropriate value.
+ For QEMU, you do not have to change anything, the default
+ value is "QemuTarget".
+ For running tests on hardware, the following options exist:
+ <itemizedlist>
+ <listitem><para><emphasis>"SimpleRemoteTarget":</emphasis>
+ Choose "SimpleRemoteTarget" if you are going to
+ run tests on a target system that is already
+ running the image to be tested and is available
+ on the network.
+ You can use "SimpleRemoteTarget" in conjunction
+ with either real hardware or an image running
+ within a separately started QEMU or any
+ other virtual machine manager.
+ </para></listitem>
+ <listitem><para><emphasis>"Systemd-bootTarget":</emphasis>
+ Choose "Systemd-bootTarget" if your hardware is
+ an EFI-based machine with
+ <filename>systemd-boot</filename> as bootloader and
+ <filename>core-image-testmaster</filename>
+ (or something similar) is installed.
+ Also, your hardware under test must be in a
+ DHCP-enabled network that gives it the same IP
+ address for each reboot.</para>
+ <para>If you choose "Systemd-bootTarget", there are
+ additional requirements and considerations.
+ See the
+ "<link linkend='selecting-systemd-boottarget'>Selecting Systemd-bootTarget</link>"
+ section, which follows, for more information.
+ </para></listitem>
+ <listitem><para><emphasis>"BeagleBoneTarget":</emphasis>
+ Choose "BeagleBoneTarget" if you are deploying
+ images and running tests on the BeagleBone
+ "Black" or original "White" hardware.
+ For information on how to use these tests, see the
+ comments at the top of the BeagleBoneTarget
+ <filename>meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py</filename>
+ file.
+ </para></listitem>
+ <listitem><para><emphasis>"EdgeRouterTarget":</emphasis>
+ Choose "EdgeRouterTarget" is you are deploying
+ images and running tests on the Ubiquiti Networks
+ EdgeRouter Lite.
+ For information on how to use these tests, see the
+ comments at the top of the EdgeRouterTarget
+ <filename>meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py</filename>
+ file.
+ </para></listitem>
+ <listitem><para><emphasis>"GrubTarget":</emphasis>
+ Choose the "supports deploying images and running
+ tests on any generic PC that boots using GRUB.
+ For information on how to use these tests, see the
+ comments at the top of the GrubTarget
+ <filename>meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py</filename>
+ file.
+ </para></listitem>
+ <listitem><para><emphasis>"<replaceable>your-target</replaceable>":</emphasis>
+ Create your own custom target if you want to run
+ tests when you are deploying images and running
+ tests on a custom machine within your BSP layer.
+ To do this, you need to add a Python unit that
+ defines the target class under
+ <filename>lib/oeqa/controllers/</filename> within
+ your layer.
+ You must also provide an empty
+ <filename>__init__.py</filename>.
+ For examples, see files in
+ <filename>meta-yocto-bsp/lib/oeqa/controllers/</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='selecting-systemd-boottarget'>
+ <title>Selecting Systemd-bootTarget</title>
+
+ <para>
+ If you did not set <filename>TEST_TARGET</filename> to
+ "Systemd-bootTarget", then you do not need any information
+ in this section.
+ You can skip down to the
+ "<link linkend='qemu-image-running-tests'>Running Tests</link>"
+ section.
+ </para>
+
+ <para>
+ If you did set <filename>TEST_TARGET</filename> to
+ "Systemd-bootTarget", you also need to perform a one-time
+ setup of your master image by doing the following:
+ <orderedlist>
+ <listitem><para><emphasis>Set <filename>EFI_PROVIDER</filename>:</emphasis>
+ Be sure that <filename>EFI_PROVIDER</filename>
+ is as follows:
+ <literallayout class='monospaced'>
+ EFI_PROVIDER = "systemd-boot"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Build the master image:</emphasis>
+ Build the <filename>core-image-testmaster</filename>
+ image.
+ The <filename>core-image-testmaster</filename>
+ recipe is provided as an example for a
+ "master" image and you can customize the image
+ recipe as you would any other recipe.
+ </para>
+ <para>Here are the image recipe requirements:
+ <itemizedlist>
+ <listitem><para>Inherits
+ <filename>core-image</filename>
+ so that kernel modules are installed.
+ </para></listitem>
+ <listitem><para>Installs normal linux utilities
+ not busybox ones (e.g.
+ <filename>bash</filename>,
+ <filename>coreutils</filename>,
+ <filename>tar</filename>,
+ <filename>gzip</filename>, and
+ <filename>kmod</filename>).
+ </para></listitem>
+ <listitem><para>Uses a custom
+ Initial RAM Disk (initramfs) image with a
+ custom installer.
+ A normal image that you can install usually
+ creates a single rootfs partition.
+ This image uses another installer that
+ creates a specific partition layout.
+ Not all Board Support Packages (BSPs)
+ can use an installer.
+ For such cases, you need to manually create
+ the following partition layout on the
+ target:
+ <itemizedlist>
+ <listitem><para>First partition mounted
+ under <filename>/boot</filename>,
+ labeled "boot".
+ </para></listitem>
+ <listitem><para>The main rootfs
+ partition where this image gets
+ installed, which is mounted under
+ <filename>/</filename>.
+ </para></listitem>
+ <listitem><para>Another partition
+ labeled "testrootfs" where test
+ images get deployed.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Install image:</emphasis>
+ Install the image that you just built on the target
+ system.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The final thing you need to do when setting
+ <filename>TEST_TARGET</filename> to "Systemd-bootTarget" is
+ to set up the test image:
+ <orderedlist>
+ <listitem><para><emphasis>Set up your <filename>local.conf</filename> file:</emphasis>
+ Make sure you have the following statements in
+ your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ IMAGE_FSTYPES += "tar.gz"
+ INHERIT += "testimage"
+ TEST_TARGET = "Systemd-bootTarget"
+ TEST_TARGET_IP = "192.168.2.3"
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Build your test image:</emphasis>
+ Use BitBake to build the image:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='power-control'>
+ <title>Power Control</title>
+
+ <para>
+ For most hardware targets other than SimpleRemoteTarget,
+ you can control power:
+ <itemizedlist>
+ <listitem><para>
+ You can use
+ <filename>TEST_POWERCONTROL_CMD</filename>
+ together with
+ <filename>TEST_POWERCONTROL_EXTRA_ARGS</filename>
+ as a command that runs on the host and does power
+ cycling.
+ The test code passes one argument to that command:
+ off, on or cycle (off then on).
+ Here is an example that could appear in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ TEST_POWERCONTROL_CMD = "powercontrol.exp test 10.11.12.1 nuc1"
+ </literallayout>
+ In this example, the expect script does the
+ following:
+ <literallayout class='monospaced'>
+ ssh test@10.11.12.1 "pyctl nuc1 <replaceable>arg</replaceable>"
+ </literallayout>
+ It then runs a Python script that controls power
+ for a label called <filename>nuc1</filename>.
+ <note>
+ You need to customize
+ <filename>TEST_POWERCONTROL_CMD</filename>
+ and
+ <filename>TEST_POWERCONTROL_EXTRA_ARGS</filename>
+ for your own setup.
+ The one requirement is that it accepts
+ "on", "off", and "cycle" as the last argument.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ When no command is defined, it connects to the
+ device over SSH and uses the classic reboot command
+ to reboot the device.
+ Classic reboot is fine as long as the machine
+ actually reboots (i.e. the SSH test has not
+ failed).
+ It is useful for scenarios where you have a simple
+ setup, typically with a single board, and where
+ some manual interaction is okay from time to time.
+ </para></listitem>
+ </itemizedlist>
+ If you have no hardware to automatically perform power
+ control but still wish to experiment with automated
+ hardware testing, you can use the dialog-power-control
+ script that shows a dialog prompting you to perform the
+ required power action.
+ This script requires either KDialog or Zenity to be
+ installed.
+ To use this script, set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_POWERCONTROL_CMD'><filename>TEST_POWERCONTROL_CMD</filename></ulink>
+ variable as follows:
+ <literallayout class='monospaced'>
+ TEST_POWERCONTROL_CMD = "${COREBASE}/scripts/contrib/dialog-power-control"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='serial-console-connection'>
+ <title>Serial Console Connection</title>
+
+ <para>
+ For test target classes requiring a serial console
+ to interact with the bootloader (e.g. BeagleBoneTarget,
+ EdgeRouterTarget, and GrubTarget), you need to
+ specify a command to use to connect to the serial console
+ of the target machine by using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SERIALCONTROL_CMD'><filename>TEST_SERIALCONTROL_CMD</filename></ulink>
+ variable and optionally the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SERIALCONTROL_EXTRA_ARGS'><filename>TEST_SERIALCONTROL_EXTRA_ARGS</filename></ulink>
+ variable.
+ </para>
+
+ <para>
+ These cases could be a serial terminal program if the
+ machine is connected to a local serial port, or a
+ <filename>telnet</filename> or
+ <filename>ssh</filename> command connecting to a remote
+ console server.
+ Regardless of the case, the command simply needs to
+ connect to the serial console and forward that connection
+ to standard input and output as any normal terminal
+ program does.
+ For example, to use the picocom terminal program on
+ serial device <filename>/dev/ttyUSB0</filename>
+ at 115200bps, you would set the variable as follows:
+ <literallayout class='monospaced'>
+ TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200"
+ </literallayout>
+ For local devices where the serial port device disappears
+ when the device reboots, an additional "serdevtry" wrapper
+ script is provided.
+ To use this wrapper, simply prefix the terminal command
+ with
+ <filename>${COREBASE}/scripts/contrib/serdevtry</filename>:
+ <literallayout class='monospaced'>
+ TEST_SERIALCONTROL_CMD = "${COREBASE}/scripts/contrib/serdevtry picocom -b
+115200 /dev/ttyUSB0"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id="qemu-image-running-tests">
+ <title>Running Tests</title>
+
+ <para>
+ You can start the tests automatically or manually:
+ <itemizedlist>
+ <listitem><para><emphasis>Automatically running tests:</emphasis>
+ To run the tests automatically after the
+ OpenEmbedded build system successfully creates an image,
+ first set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_IMAGE'><filename>TEST_IMAGE</filename></ulink>
+ variable to "1" in your <filename>local.conf</filename>
+ file in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ TEST_IMAGE = "1"
+ </literallayout>
+ Next, build your image.
+ If the image successfully builds, the tests will be
+ run:
+ <literallayout class='monospaced'>
+ bitbake core-image-sato
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Manually running tests:</emphasis>
+ To manually run the tests, first globally inherit the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-testimage*'><filename>testimage</filename></ulink>
+ class by editing your <filename>local.conf</filename>
+ file:
+ <literallayout class='monospaced'>
+ INHERIT += "testimage"
+ </literallayout>
+ Next, use BitBake to run the tests:
+ <literallayout class='monospaced'>
+ bitbake -c testimage <replaceable>image</replaceable>
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ All test files reside in
+ <filename>meta/lib/oeqa/runtime</filename> in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ A test name maps directly to a Python module.
+ Each test module may contain a number of individual tests.
+ Tests are usually grouped together by the area
+ tested (e.g tests for systemd reside in
+ <filename>meta/lib/oeqa/runtime/systemd.py</filename>).
+ </para>
+
+ <para>
+ You can add tests to any layer provided you place them in the
+ proper area and you extend
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>
+ in the <filename>local.conf</filename> file as normal.
+ Be sure that tests reside in
+ <filename><replaceable>layer</replaceable>/lib/oeqa/runtime</filename>.
+ <note>
+ Be sure that module names do not collide with module names
+ used in the default set of test modules in
+ <filename>meta/lib/oeqa/runtime</filename>.
+ </note>
+ </para>
+
+ <para>
+ You can change the set of tests run by appending or overriding
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SUITES'><filename>TEST_SUITES</filename></ulink>
+ variable in <filename>local.conf</filename>.
+ Each name in <filename>TEST_SUITES</filename> represents a
+ required test for the image.
+ Test modules named within <filename>TEST_SUITES</filename>
+ cannot be skipped even if a test is not suitable for an image
+ (e.g. running the RPM tests on an image without
+ <filename>rpm</filename>).
+ Appending "auto" to <filename>TEST_SUITES</filename> causes the
+ build system to try to run all tests that are suitable for the
+ image (i.e. each test module may elect to skip itself).
+ </para>
+
+ <para>
+ The order you list tests in <filename>TEST_SUITES</filename>
+ is important and influences test dependencies.
+ Consequently, tests that depend on other tests should be added
+ after the test on which they depend.
+ For example, since the <filename>ssh</filename> test
+ depends on the
+ <filename>ping</filename> test, "ssh" needs to come after
+ "ping" in the list.
+ The test class provides no re-ordering or dependency handling.
+ <note>
+ Each module can have multiple classes with multiple test
+ methods.
+ And, Python <filename>unittest</filename> rules apply.
+ </note>
+ </para>
+
+ <para>
+ Here are some things to keep in mind when running tests:
+ <itemizedlist>
+ <listitem><para>The default tests for the image are defined
+ as:
+ <literallayout class='monospaced'>
+ DEFAULT_TEST_SUITES_pn-<replaceable>image</replaceable> = "ping ssh df connman syslog xorg scp vnc date rpm dnf dmesg"
+ </literallayout></para></listitem>
+ <listitem><para>Add your own test to the list of the
+ by using the following:
+ <literallayout class='monospaced'>
+ TEST_SUITES_append = " mytest"
+ </literallayout></para></listitem>
+ <listitem><para>Run a specific list of tests as follows:
+ <literallayout class='monospaced'>
+ TEST_SUITES = "test1 test2 test3"
+ </literallayout>
+ Remember, order is important.
+ Be sure to place a test that is dependent on another test
+ later in the order.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="exporting-tests">
+ <title>Exporting Tests</title>
+
+ <para>
+ You can export tests so that they can run independently of
+ the build system.
+ Exporting tests is required if you want to be able to hand
+ the test execution off to a scheduler.
+ You can only export tests that are defined in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TEST_SUITES'><filename>TEST_SUITES</filename></ulink>.
+ </para>
+
+ <para>
+ If your image is already built, make sure the following are set
+ in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ INHERIT +="testexport"
+ TEST_TARGET_IP = "<replaceable>IP-address-for-the-test-target</replaceable>"
+ TEST_SERVER_IP = "<replaceable>IP-address-for-the-test-server</replaceable>"
+ </literallayout>
+ You can then export the tests with the following BitBake
+ command form:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c testexport
+ </literallayout>
+ Exporting the tests places them in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in
+ <filename>tmp/testexport/</filename><replaceable>image</replaceable>,
+ which is controlled by the
+ <filename>TEST_EXPORT_DIR</filename> variable.
+ </para>
+
+ <para>
+ You can now run the tests outside of the build environment:
+ <literallayout class='monospaced'>
+ $ cd tmp/testexport/<replaceable>image</replaceable>
+ $ ./runexported.py testdata.json
+ </literallayout>
+ </para>
+
+ <para>
+ Here is a complete example that shows IP addresses and uses
+ the <filename>core-image-sato</filename> image:
+ <literallayout class='monospaced'>
+ INHERIT +="testexport"
+ TEST_TARGET_IP = "192.168.7.2"
+ TEST_SERVER_IP = "192.168.7.1"
+ </literallayout>
+ Use BitBake to export the tests:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato -c testexport
+ </literallayout>
+ Run the tests outside of the build environment using the
+ following:
+ <literallayout class='monospaced'>
+ $ cd tmp/testexport/core-image-sato
+ $ ./runexported.py testdata.json
+ </literallayout>
+ </para>
+ </section>
+
+ <section id="qemu-image-writing-new-tests">
+ <title>Writing New Tests</title>
+
+ <para>
+ As mentioned previously, all new test files need to be in the
+ proper place for the build system to find them.
+ New tests for additional functionality outside of the core
+ should be added to the layer that adds the functionality, in
+ <filename><replaceable>layer</replaceable>/lib/oeqa/runtime</filename>
+ (as long as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>
+ is extended in the layer's
+ <filename>layer.conf</filename> file as normal).
+ Just remember the following:
+ <itemizedlist>
+ <listitem><para>Filenames need to map directly to test
+ (module) names.
+ </para></listitem>
+ <listitem><para>Do not use module names that
+ collide with existing core tests.
+ </para></listitem>
+ <listitem><para>Minimally, an empty
+ <filename>__init__.py</filename> file must exist
+ in the runtime directory.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ To create a new test, start by copying an existing module
+ (e.g. <filename>syslog.py</filename> or
+ <filename>gcc.py</filename> are good ones to use).
+ Test modules can use code from
+ <filename>meta/lib/oeqa/utils</filename>, which are helper
+ classes.
+ </para>
+
+ <note>
+ Structure shell commands such that you rely on them and they
+ return a single code for success.
+ Be aware that sometimes you will need to parse the output.
+ See the <filename>df.py</filename> and
+ <filename>date.py</filename> modules for examples.
+ </note>
+
+ <para>
+ You will notice that all test classes inherit
+ <filename>oeRuntimeTest</filename>, which is found in
+ <filename>meta/lib/oetest.py</filename>.
+ This base class offers some helper attributes, which are
+ described in the following sections:
+ </para>
+
+ <section id='qemu-image-writing-tests-class-methods'>
+ <title>Class Methods</title>
+
+ <para>
+ Class methods are as follows:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>hasPackage(pkg)</filename>:</emphasis>
+ Returns "True" if <filename>pkg</filename> is in the
+ installed package list of the image, which is based
+ on the manifest file that is generated during the
+ <filename>do_rootfs</filename> task.
+ </para></listitem>
+ <listitem><para><emphasis><filename>hasFeature(feature)</filename>:</emphasis>
+ Returns "True" if the feature is in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='qemu-image-writing-tests-class-attributes'>
+ <title>Class Attributes</title>
+
+ <para>
+ Class attributes are as follows:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>pscmd</filename>:</emphasis>
+ Equals "ps -ef" if <filename>procps</filename> is
+ installed in the image.
+ Otherwise, <filename>pscmd</filename> equals
+ "ps" (busybox).
+ </para></listitem>
+ <listitem><para><emphasis><filename>tc</filename>:</emphasis>
+ The called test context, which gives access to the
+ following attributes:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>d</filename>:</emphasis>
+ The BitBake datastore, which allows you to
+ use stuff such as
+ <filename>oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager")</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>testslist</filename> and <filename>testsrequired</filename>:</emphasis>
+ Used internally.
+ The tests do not need these.
+ </para></listitem>
+ <listitem><para><emphasis><filename>filesdir</filename>:</emphasis>
+ The absolute path to
+ <filename>meta/lib/oeqa/runtime/files</filename>,
+ which contains helper files for tests meant
+ for copying on the target such as small
+ files written in C for compilation.
+ </para></listitem>
+ <listitem><para><emphasis><filename>target</filename>:</emphasis>
+ The target controller object used to deploy
+ and start an image on a particular target
+ (e.g. QemuTarget, SimpleRemote, and
+ Systemd-bootTarget).
+ Tests usually use the following:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>ip</filename>:</emphasis>
+ The target's IP address.
+ </para></listitem>
+ <listitem><para><emphasis><filename>server_ip</filename>:</emphasis>
+ The host's IP address, which is
+ usually used by the DNF test
+ suite.
+ </para></listitem>
+ <listitem><para><emphasis><filename>run(cmd, timeout=None)</filename>:</emphasis>
+ The single, most used method.
+ This command is a wrapper for:
+ <filename>ssh root@host "cmd"</filename>.
+ The command returns a tuple:
+ (status, output), which are what
+ their names imply - the return code
+ of "cmd" and whatever output
+ it produces.
+ The optional timeout argument
+ represents the number of seconds the
+ test should wait for "cmd" to
+ return.
+ If the argument is "None", the
+ test uses the default instance's
+ timeout period, which is 300
+ seconds.
+ If the argument is "0", the test
+ runs until the command returns.
+ </para></listitem>
+ <listitem><para><emphasis><filename>copy_to(localpath, remotepath)</filename>:</emphasis>
+ <filename>scp localpath root@ip:remotepath</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>copy_from(remotepath, localpath)</filename>:</emphasis>
+ <filename>scp root@host:remotepath localpath</filename>.
+ </para></listitem>
+ </itemizedlist></para></listitem>
+ </itemizedlist></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='qemu-image-writing-tests-instance-attributes'>
+ <title>Instance Attributes</title>
+
+ <para>
+ A single instance attribute exists, which is
+ <filename>target</filename>.
+ The <filename>target</filename> instance attribute is
+ identical to the class attribute of the same name, which
+ is described in the previous section.
+ This attribute exists as both an instance and class
+ attribute so tests can use
+ <filename>self.target.run(cmd)</filename> in instance
+ methods instead of
+ <filename>oeRuntimeTest.tc.target.run(cmd)</filename>.
+ </para>
+ </section>
+ </section>
+
+ <section id='installing-packages-in-the-dut-without-the-package-manager'>
+ <title>Installing Packages in the DUT Without the Package Manager</title>
+
+ <para>
+ When a test requires a package built by BitBake, it is possible
+ to install that package.
+ Installing the package does not require a package manager be
+ installed in the device under test (DUT).
+ It does, however, require an SSH connection and the target must
+ be using the <filename>sshcontrol</filename> class.
+ <note>
+ This method uses <filename>scp</filename> to copy files
+ from the host to the target, which causes permissions and
+ special attributes to be lost.
+ </note>
+ </para>
+
+ <para>
+ A JSON file is used to define the packages needed by a test.
+ This file must be in the same path as the file used to define
+ the tests.
+ Furthermore, the filename must map directly to the test
+ module name with a <filename>.json</filename> extension.
+ </para>
+
+ <para>
+ The JSON file must include an object with the test name as
+ keys of an object or an array.
+ This object (or array of objects) uses the following data:
+ <itemizedlist>
+ <listitem><para>"pkg" - A mandatory string that is the
+ name of the package to be installed.
+ </para></listitem>
+ <listitem><para>"rm" - An optional boolean, which defaults
+ to "false", that specifies to remove the package after
+ the test.
+ </para></listitem>
+ <listitem><para>"extract" - An optional boolean, which
+ defaults to "false", that specifies if the package must
+ be extracted from the package format.
+ When set to "true", the package is not automatically
+ installed into the DUT.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Following is an example JSON file that handles test "foo"
+ installing package "bar" and test "foobar" installing
+ packages "foo" and "bar".
+ Once the test is complete, the packages are removed from the
+ DUT.
+ <literallayout class='monospaced'>
+ {
+ "foo": {
+ "pkg": "bar"
+ },
+ "foobar": [
+ {
+ "pkg": "foo",
+ "rm": true
+ },
+ {
+ "pkg": "bar",
+ "rm": true
+ }
+ ]
+ }
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='usingpoky-debugging-tools-and-techniques'>
+ <title>Debugging Tools and Techniques</title>
+
+ <para>
+ The exact method for debugging build failures depends on the nature
+ of the problem and on the system's area from which the bug
+ originates.
+ Standard debugging practices such as comparison against the last
+ known working version with examination of the changes and the
+ re-application of steps to identify the one causing the problem are
+ valid for the Yocto Project just as they are for any other system.
+ Even though it is impossible to detail every possible potential
+ failure, this section provides some general tips to aid in
+ debugging given a variety of situations.
+ <note><title>Tip</title>
+ A useful feature for debugging is the error reporting tool.
+ Configuring the Yocto Project to use this tool causes the
+ OpenEmbedded build system to produce error reporting commands as
+ part of the console output.
+ You can enter the commands after the build completes to log
+ error information into a common database, that can help you
+ figure out what might be going wrong.
+ For information on how to enable and use this feature, see the
+ "<link linkend='using-the-error-reporting-tool'>Using the Error Reporting Tool</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ The following list shows the debugging topics in the remainder of
+ this section:
+ <itemizedlist>
+ <listitem><para>
+ "<link linkend='dev-debugging-viewing-logs-from-failed-tasks'>Viewing Logs from Failed Tasks</link>"
+ describes how to find and view logs from tasks that
+ failed during the build process.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-debugging-viewing-variable-values'>Viewing Variable Values</link>"
+ describes how to use the BitBake <filename>-e</filename>
+ option to examine variable values after a recipe has been
+ parsed.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='viewing-package-information-with-oe-pkgdata-util'>Viewing Package Information with <filename>oe-pkgdata-util</filename></link>"
+ describes how to use the
+ <filename>oe-pkgdata-util</filename> utility to query
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></ulink>
+ and display package-related information for built
+ packages.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-viewing-dependencies-between-recipes-and-tasks'>Viewing Dependencies Between Recipes and Tasks</link>"
+ describes how to use the BitBake <filename>-g</filename>
+ option to display recipe dependency information used
+ during the build.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-viewing-task-variable-dependencies'>Viewing Task Variable Dependencies</link>"
+ describes how to use the
+ <filename>bitbake-dumpsig</filename> command in
+ conjunction with key subdirectories in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ to determine variable dependencies.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-debugging-taskrunning'>Running Specific Tasks</link>"
+ describes how to use several BitBake options (e.g.
+ <filename>-c</filename>, <filename>-C</filename>, and
+ <filename>-f</filename>) to run specific tasks in the
+ build chain.
+ It can be useful to run tasks "out-of-order" when trying
+ isolate build issues.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-debugging-bitbake'>General BitBake Problems</link>"
+ describes how to use BitBake's <filename>-D</filename>
+ debug output option to reveal more about what BitBake is
+ doing during the build.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-debugging-buildfile'>Building with No Dependencies</link>"
+ describes how to use the BitBake <filename>-b</filename>
+ option to build a recipe while ignoring dependencies.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='recipe-logging-mechanisms'>Recipe Logging Mechanisms</link>"
+ describes how to use the many recipe logging functions
+ to produce debugging output and report errors and warnings.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='debugging-parallel-make-races'>Debugging Parallel Make Races</link>"
+ describes how to debug situations where the build consists
+ of several parts that are run simultaneously and when the
+ output or result of one part is not ready for use with a
+ different part of the build that depends on that output.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='platdev-gdb-remotedebug'>Debugging With the GNU Project Debugger (GDB) Remotely</link>"
+ describes how to use GDB to allow you to examine running
+ programs, which can help you fix problems.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='debugging-with-the-gnu-project-debugger-gdb-on-the-target'>Debugging with the GNU Project Debugger (GDB) on the Target</link>"
+ describes how to use GDB directly on target hardware for
+ debugging.
+ </para></listitem>
+ <listitem><para>
+ "<link linkend='dev-other-debugging-others'>Other Debugging Tips</link>"
+ describes miscellaneous debugging tips that can be useful.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For debugging information within the popular
+ <trademark class='trade'>Eclipse</trademark> IDE, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#adt-eclipse'>Working within Eclipse</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para>
+
+ <section id='dev-debugging-viewing-logs-from-failed-tasks'>
+ <title>Viewing Logs from Failed Tasks</title>
+
+ <para>
+ You can find the log for a task in the file
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/temp/log.do_</filename><replaceable>taskname</replaceable>.
+ For example, the log for the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ task of the QEMU minimal image for the x86 machine
+ (<filename>qemux86</filename>) might be in
+ <filename>tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_compile</filename>.
+ To see the commands
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ ran to generate a log, look at the corresponding
+ <filename>run.do_</filename><replaceable>taskname</replaceable>
+ file in the same directory.
+ </para>
+
+ <para>
+ <filename>log.do_</filename><replaceable>taskname</replaceable>
+ and
+ <filename>run.do_</filename><replaceable>taskname</replaceable>
+ are actually symbolic links to
+ <filename>log.do_</filename><replaceable>taskname</replaceable><filename>.</filename><replaceable>pid</replaceable>
+ and
+ <filename>log.run_</filename><replaceable>taskname</replaceable><filename>.</filename><replaceable>pid</replaceable>,
+ where <replaceable>pid</replaceable> is the PID the task had
+ when it ran.
+ The symlinks always point to the files corresponding to the most
+ recent run.
+ </para>
+ </section>
+
+ <section id='dev-debugging-viewing-variable-values'>
+ <title>Viewing Variable Values</title>
+
+ <para>
+ BitBake's <filename>-e</filename> option is used to display
+ variable values after parsing.
+ The following command displays the variable values after the
+ configuration files (i.e. <filename>local.conf</filename>,
+ <filename>bblayers.conf</filename>,
+ <filename>bitbake.conf</filename> and so forth) have been
+ parsed:
+ <literallayout class='monospaced'>
+ $ bitbake -e
+ </literallayout>
+ The following command displays variable values after a specific
+ recipe has been parsed.
+ The variables include those from the configuration as well:
+ <literallayout class='monospaced'>
+ $ bitbake -e recipename
+ </literallayout>
+ <note><para>
+ Each recipe has its own private set of variables
+ (datastore).
+ Internally, after parsing the configuration, a copy of the
+ resulting datastore is made prior to parsing each recipe.
+ This copying implies that variables set in one recipe will
+ not be visible to other recipes.</para>
+
+ <para>Likewise, each task within a recipe gets a private
+ datastore based on the recipe datastore, which means that
+ variables set within one task will not be visible to
+ other tasks.</para>
+ </note>
+ </para>
+
+ <para>
+ In the output of <filename>bitbake -e</filename>, each
+ variable is preceded by a description of how the variable
+ got its value, including temporary values that were later
+ overriden.
+ This description also includes variable flags (varflags) set on
+ the variable.
+ The output can be very helpful during debugging.
+ </para>
+
+ <para>
+ Variables that are exported to the environment are preceded by
+ <filename>export</filename> in the output of
+ <filename>bitbake -e</filename>.
+ See the following example:
+ <literallayout class='monospaced'>
+ export CC="i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/ulf/poky/build/tmp/sysroots/qemux86"
+ </literallayout>
+ </para>
+
+ <para>
+ In addition to variable values, the output of the
+ <filename>bitbake -e</filename> and
+ <filename>bitbake -e</filename>&nbsp;<replaceable>recipe</replaceable>
+ commands includes the following information:
+ <itemizedlist>
+ <listitem><para>
+ The output starts with a tree listing all configuration
+ files and classes included globally, recursively listing
+ the files they include or inherit in turn.
+ Much of the behavior of the OpenEmbedded build system
+ (including the behavior of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#normal-recipe-build-tasks'>normal recipe build tasks</ulink>)
+ is implemented in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-base'><filename>base</filename></ulink>
+ class and the classes it inherits, rather than being
+ built into BitBake itself.
+ </para></listitem>
+ <listitem><para>
+ After the variable values, all functions appear in the
+ output.
+ For shell functions, variables referenced within the
+ function body are expanded.
+ If a function has been modified using overrides or
+ using override-style operators like
+ <filename>_append</filename> and
+ <filename>_prepend</filename>, then the final assembled
+ function body appears in the output.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='viewing-package-information-with-oe-pkgdata-util'>
+ <title>Viewing Package Information with <filename>oe-pkgdata-util</filename></title>
+
+ <para>
+ You can use the <filename>oe-pkgdata-util</filename>
+ command-line utility to query
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></ulink>
+ and display various package-related information.
+ When you use the utility, you must use it to view information
+ on packages that have already been built.
+ </para>
+
+ <para>
+ Following are a few of the available
+ <filename>oe-pkgdata-util</filename> subcommands.
+ <note>
+ You can use the standard * and ? globbing wildcards as part
+ of package names and paths.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <filename>oe-pkgdata-util list-pkgs [</filename><replaceable>pattern</replaceable><filename>]</filename>:
+ Lists all packages that have been built, optionally
+ limiting the match to packages that match
+ <replaceable>pattern</replaceable>.
+ </para></listitem>
+ <listitem><para>
+ <filename>oe-pkgdata-util list-pkg-files&nbsp;</filename><replaceable>package</replaceable><filename>&nbsp;...</filename>:
+ Lists the files and directories contained in the given
+ packages.
+ <note>
+ <para>
+ A different way to view the contents of a package is
+ to look at the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/packages-split</filename>
+ directory of the recipe that generates the
+ package.
+ This directory is created by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ task and has one subdirectory for each package the
+ recipe generates, which contains the files stored in
+ that package.</para>
+ <para>
+ If you want to inspect the
+ <filename>${WORKDIR}/packages-split</filename>
+ directory, make sure that
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-rm-work'><filename>rm_work</filename></ulink>
+ is not enabled when you build the recipe.
+ </para>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <filename>oe-pkgdata-util find-path&nbsp;</filename><replaceable>path</replaceable><filename>&nbsp;...</filename>:
+ Lists the names of the packages that contain the given
+ paths.
+ For example, the following tells us that
+ <filename>/usr/share/man/man1/make.1</filename>
+ is contained in the <filename>make-doc</filename>
+ package:
+ <literallayout class='monospaced'>
+ $ oe-pkgdata-util find-path /usr/share/man/man1/make.1
+ make-doc: /usr/share/man/man1/make.1
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <filename>oe-pkgdata-util lookup-recipe&nbsp;</filename><replaceable>package</replaceable><filename>&nbsp;...</filename>:
+ Lists the name of the recipes that
+ produce the given packages.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For more information on the <filename>oe-pkgdata-util</filename>
+ command, use the help facility:
+ <literallayout class='monospaced'>
+ $ oe-pkgdata-util &dash;&dash;help
+ $ oe-pkgdata-util <replaceable>subcommand</replaceable> --help
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='dev-viewing-dependencies-between-recipes-and-tasks'>
+ <title>Viewing Dependencies Between Recipes and Tasks</title>
+
+ <para>
+ Sometimes it can be hard to see why BitBake wants to build other
+ recipes before the one you have specified.
+ Dependency information can help you understand why a recipe is
+ built.
+ </para>
+
+ <para>
+ To generate dependency information for a recipe, run the
+ following command:
+ <literallayout class='monospaced'>
+ $ bitbake -g <replaceable>recipename</replaceable>
+ </literallayout>
+ This command writes the following files in the current
+ directory:
+ <itemizedlist>
+ <listitem><para>
+ <filename>pn-buildlist</filename>: A list of
+ recipes/targets involved in building
+ <replaceable>recipename</replaceable>.
+ "Involved" here means that at least one task from the
+ recipe needs to run when building
+ <replaceable>recipename</replaceable> from scratch.
+ Targets that are in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-ASSUME_PROVIDED'><filename>ASSUME_PROVIDED</filename></ulink>
+ are not listed.
+ </para></listitem>
+ <listitem><para>
+ <filename>task-depends.dot</filename>: A graph showing
+ dependencies between tasks.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The graphs are in
+ <ulink url='https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29'>DOT</ulink>
+ format and can be converted to images (e.g. using the
+ <filename>dot</filename> tool from
+ <ulink url='http://www.graphviz.org/'>Graphviz</ulink>).
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ DOT files use a plain text format.
+ The graphs generated using the
+ <filename>bitbake -g</filename> command are often so
+ large as to be difficult to read without special
+ pruning (e.g. with Bitbake's
+ <filename>-I</filename> option) and processing.
+ Despite the form and size of the graphs, the
+ corresponding <filename>.dot</filename> files can
+ still be possible to read and provide useful
+ information.
+ </para>
+
+ <para>As an example, the
+ <filename>task-depends.dot</filename> file contains
+ lines such as the following:
+ <literallayout class='monospaced'>
+ "libxslt.do_configure" -> "libxml2.do_populate_sysroot"
+ </literallayout>
+ The above example line reveals that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ task in <filename>libxslt</filename> depends on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+ task in <filename>libxml2</filename>, which is a
+ normal
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ dependency between the two recipes.
+ </para></listitem>
+ <listitem><para>
+ For an example of how <filename>.dot</filename>
+ files can be processed, see the
+ <filename>scripts/contrib/graph-tool</filename>
+ Python script, which finds and displays paths
+ between graph nodes.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ You can use a different method to view dependency information
+ by using the following command:
+ <literallayout class='monospaced'>
+ $ bitbake -g -u taskexp <replaceable>recipename</replaceable>
+ </literallayout>
+ This command displays a GUI window from which you can view
+ build-time and runtime dependencies for the recipes involved in
+ building <replaceable>recipename</replaceable>.
+ </para>
+ </section>
+
+ <section id='dev-viewing-task-variable-dependencies'>
+ <title>Viewing Task Variable Dependencies</title>
+
+ <para>
+ As mentioned in the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#checksums'>Checksums (Signatures)</ulink>"
+ section of the BitBake User Manual, BitBake tries to
+ automatically determine what variables a task depends on so
+ that it can rerun the task if any values of the variables
+ change.
+ This determination is usually reliable.
+ However, if you do things like construct variable names at
+ runtime, then you might have to manually declare dependencies
+ on those variables using <filename>vardeps</filename> as
+ described in the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'>Variable Flags</ulink>"
+ section of the BitBake User Manual.
+ </para>
+
+ <para>
+ If you are unsure whether a variable dependency is being
+ picked up automatically for a given task, you can list the
+ variable dependencies BitBake has determined by doing the
+ following:
+ <orderedlist>
+ <listitem><para>
+ Build the recipe containing the task:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>recipename</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Inside the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAMPS_DIR'><filename>STAMPS_DIR</filename></ulink>
+ directory, find the signature data
+ (<filename>sigdata</filename>) file that corresponds
+ to the task.
+ The <filename>sigdata</filename> files contain a pickled
+ Python database of all the metadata that went into
+ creating the input checksum for the task.
+ As an example, for the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
+ task of the <filename>db</filename> recipe, the
+ <filename>sigdata</filename> file might be found in the
+ following location:
+ <literallayout class='monospaced'>
+ ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1
+ </literallayout>
+ For tasks that are accelerated through the shared state
+ (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>)
+ cache, an additional <filename>siginfo</filename> file
+ is written into
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>
+ along with the cached task output.
+ The <filename>siginfo</filename> files contain exactly
+ the same information as <filename>sigdata</filename>
+ files.
+ </para></listitem>
+ <listitem><para>
+ Run <filename>bitbake-dumpsig</filename> on the
+ <filename>sigdata</filename> or
+ <filename>siginfo</filename> file.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake-dumpsig ${BUILDDIR}/tmp/stamps/i586-poky-linux/db/6.0.30-r1.do_fetch.sigdata.7c048c18222b16ff0bcee2000ef648b1
+ </literallayout>
+ In the output of the above command, you will find a
+ line like the following, which lists all the (inferred)
+ variable dependencies for the task.
+ This list also includes indirect dependencies from
+ variables depending on other variables, recursively.
+ <literallayout class='monospaced'>
+ Task dependencies: ['PV', 'SRCREV', 'SRC_URI', 'SRC_URI[md5sum]', 'SRC_URI[sha256sum]', 'base_do_fetch']
+ </literallayout>
+ <note>
+ Functions (e.g. <filename>base_do_fetch</filename>)
+ also count as variable dependencies.
+ These functions in turn depend on the variables they
+ reference.
+ </note>
+ The output of <filename>bitbake-dumpsig</filename> also
+ includes the value each variable had, a list of
+ dependencies for each variable, and
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_HASHBASE_WHITELIST'><filename>BB_HASHBASE_WHITELIST</filename></ulink>
+ information.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ There is also a <filename>bitbake-diffsigs</filename> command
+ for comparing two <filename>siginfo</filename> or
+ <filename>sigdata</filename> files.
+ This command can be helpful when trying to figure out what
+ changed between two versions of a task.
+ If you call <filename>bitbake-diffsigs</filename> with just one
+ file, the command behaves like
+ <filename>bitbake-dumpsig</filename>.
+ </para>
+
+ <para>
+ You can also use BitBake to dump out the signature construction
+ information without executing tasks by using either of the
+ following BitBake command-line options:
+ <literallayout class='monospaced'>
+ &dash;&dash;dump-signatures=<replaceable>SIGNATURE_HANDLER</replaceable>
+ -S <replaceable>SIGNATURE_HANDLER</replaceable>
+ </literallayout>
+ <note>
+ Two common values for
+ <replaceable>SIGNATURE_HANDLER</replaceable> are "none" and
+ "printdiff", which dump only the signature or compare the
+ dumped signature with the cached one, respectively.
+ </note>
+ Using BitBake with either of these options causes BitBake to
+ dump out <filename>sigdata</filename> files in the
+ <filename>stamps</filename> directory for every task it would
+ have executed instead of building the specified target package.
+ </para>
+ </section>
+
+ <section id='dev-viewing-metadata-used-to-create-the-input-signature-of-a-shared-state-task'>
+ <title>Viewing Metadata Used to Create the Input Signature of a Shared State Task</title>
+
+ <para>
+ Seeing what metadata went into creating the input signature
+ of a shared state (sstate) task can be a useful debugging
+ aid.
+ This information is available in signature information
+ (<filename>siginfo</filename>) files in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>.
+ For information on how to view and interpret information in
+ <filename>siginfo</filename> files, see the
+ "<link linkend='dev-viewing-task-variable-dependencies'>Viewing Task Variable Dependencies</link>"
+ section.
+ </para>
+
+ <para>
+ For conceptual information on shared state, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#shared-state'>Shared State</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='dev-invalidating-shared-state-to-force-a-task-to-run'>
+ <title>Invalidating Shared State to Force a Task to Run</title>
+
+ <para>
+ The OpenEmbedded build system uses
+ <ulink url='&YOCTO_DOCS_OM_URL;#overview-checksums'>checksums</ulink>
+ and
+ <ulink url='&YOCTO_DOCS_OM_URL;#shared-state'>shared state</ulink>
+ cache to avoid unnecessarily rebuilding tasks.
+ Collectively, this scheme is known as "shared state code."
+ </para>
+
+ <para>
+ As with all schemes, this one has some drawbacks.
+ It is possible that you could make implicit changes to your
+ code that the checksum calculations do not take into
+ account.
+ These implicit changes affect a task's output but do not
+ trigger the shared state code into rebuilding a recipe.
+ Consider an example during which a tool changes its output.
+ Assume that the output of <filename>rpmdeps</filename>
+ changes.
+ The result of the change should be that all the
+ <filename>package</filename> and
+ <filename>package_write_rpm</filename> shared state cache
+ items become invalid.
+ However, because the change to the output is
+ external to the code and therefore implicit,
+ the associated shared state cache items do not become
+ invalidated.
+ In this case, the build process uses the cached items
+ rather than running the task again.
+ Obviously, these types of implicit changes can cause
+ problems.
+ </para>
+
+ <para>
+ To avoid these problems during the build, you need to
+ understand the effects of any changes you make.
+ Realize that changes you make directly to a function
+ are automatically factored into the checksum calculation.
+ Thus, these explicit changes invalidate the associated
+ area of shared state cache.
+ However, you need to be aware of any implicit changes that
+ are not obvious changes to the code and could affect
+ the output of a given task.
+ </para>
+
+ <para>
+ When you identify an implicit change, you can easily
+ take steps to invalidate the cache and force the tasks
+ to run.
+ The steps you can take are as simple as changing a
+ function's comments in the source code.
+ For example, to invalidate package shared state files,
+ change the comment statements of
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ or the comments of one of the functions it calls.
+ Even though the change is purely cosmetic, it causes the
+ checksum to be recalculated and forces the build system to
+ run the task again.
+ <note>
+ For an example of a commit that makes a cosmetic
+ change to invalidate shared state, see this
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/commit/meta/classes/package.bbclass?id=737f8bbb4f27b4837047cb9b4fbfe01dfde36d54'>commit</ulink>.
+ </note>
+ </para>
+ </section>
+
+ <section id='dev-debugging-taskrunning'>
+ <title>Running Specific Tasks</title>
+
+ <para>
+ Any given recipe consists of a set of tasks.
+ The standard BitBake behavior in most cases is:
+ <filename>do_fetch</filename>,
+ <filename>do_unpack</filename>,
+ <filename>do_patch</filename>,
+ <filename>do_configure</filename>,
+ <filename>do_compile</filename>,
+ <filename>do_install</filename>,
+ <filename>do_package</filename>,
+ <filename>do_package_write_*</filename>, and
+ <filename>do_build</filename>.
+ The default task is <filename>do_build</filename> and any tasks
+ on which it depends build first.
+ Some tasks, such as <filename>do_devshell</filename>, are not
+ part of the default build chain.
+ If you wish to run a task that is not part of the default build
+ chain, you can use the <filename>-c</filename> option in
+ BitBake.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c devshell
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>-c</filename> option respects task dependencies,
+ which means that all other tasks (including tasks from other
+ recipes) that the specified task depends on will be run before
+ the task.
+ Even when you manually specify a task to run with
+ <filename>-c</filename>, BitBake will only run the task if it
+ considers it "out of date".
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#stamp-files-and-the-rerunning-of-tasks'>Stamp Files and the Rerunning of Tasks</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for
+ how BitBake determines whether a task is "out of date".
+ </para>
+
+ <para>
+ If you want to force an up-to-date task to be rerun (e.g.
+ because you made manual modifications to the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
+ that you want to try out), then you can use the
+ <filename>-f</filename> option.
+ <note>
+ The reason <filename>-f</filename> is never required when
+ running the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-devshell'><filename>do_devshell</filename></ulink>
+ task is because the
+ <filename>[</filename><ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>nostamp</filename></ulink><filename>]</filename>
+ variable flag is already set for the task.
+ </note>
+ The following example shows one way you can use the
+ <filename>-f</filename> option:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop
+ .
+ .
+ make some changes to the source code in the work directory
+ .
+ .
+ $ bitbake matchbox-desktop -c compile -f
+ $ bitbake matchbox-desktop
+ </literallayout>
+ </para>
+
+ <para>
+ This sequence first builds and then recompiles
+ <filename>matchbox-desktop</filename>.
+ The last command reruns all tasks (basically the packaging
+ tasks) after the compile.
+ BitBake recognizes that the <filename>do_compile</filename>
+ task was rerun and therefore understands that the other tasks
+ also need to be run again.
+ </para>
+
+ <para>
+ Another, shorter way to rerun a task and all
+ <ulink url='&YOCTO_DOCS_REF_URL;#normal-recipe-build-tasks'>normal recipe build tasks</ulink>
+ that depend on it is to use the <filename>-C</filename>
+ option.
+ <note>
+ This option is upper-cased and is separate from the
+ <filename>-c</filename> option, which is lower-cased.
+ </note>
+ Using this option invalidates the given task and then runs the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-build'><filename>do_build</filename></ulink>
+ task, which is the default task if no task is given, and the
+ tasks on which it depends.
+ You could replace the final two commands in the previous example
+ with the following single command:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -C compile
+ </literallayout>
+ Internally, the <filename>-f</filename> and
+ <filename>-C</filename> options work by tainting (modifying) the
+ input checksum of the specified task.
+ This tainting indirectly causes the task and its
+ dependent tasks to be rerun through the normal task dependency
+ mechanisms.
+ <note>
+ BitBake explicitly keeps track of which tasks have been
+ tainted in this fashion, and will print warnings such as the
+ following for builds involving such tasks:
+ <literallayout class='monospaced'>
+ WARNING: /home/ulf/poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.1.bb.do_compile is tainted from a forced run
+ </literallayout>
+ The purpose of the warning is to let you know that the work
+ directory and build output might not be in the clean state
+ they would be in for a "normal" build, depending on what
+ actions you took.
+ To get rid of such warnings, you can remove the work
+ directory and rebuild the recipe, as follows:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c clean
+ $ bitbake matchbox-desktop
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ You can view a list of tasks in a given package by running the
+ <filename>do_listtasks</filename> task as follows:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop -c listtasks
+ </literallayout>
+ The results appear as output to the console and are also in the
+ file <filename>${WORKDIR}/temp/log.do_listtasks</filename>.
+ </para>
+ </section>
+
+ <section id='dev-debugging-bitbake'>
+ <title>General BitBake Problems</title>
+
+ <para>
+ You can see debug output from BitBake by using the
+ <filename>-D</filename> option.
+ The debug output gives more information about what BitBake
+ is doing and the reason behind it.
+ Each <filename>-D</filename> option you use increases the
+ logging level.
+ The most common usage is <filename>-DDD</filename>.
+ </para>
+
+ <para>
+ The output from
+ <filename>bitbake -DDD -v</filename> <replaceable>targetname</replaceable>
+ can reveal why BitBake chose a certain version of a package or
+ why BitBake picked a certain provider.
+ This command could also help you in a situation where you think
+ BitBake did something unexpected.
+ </para>
+ </section>
+
+ <section id='dev-debugging-buildfile'>
+ <title>Building with No Dependencies</title>
+
+ <para>
+ To build a specific recipe (<filename>.bb</filename> file),
+ you can use the following command form:
+ <literallayout class='monospaced'>
+ $ bitbake -b <replaceable>somepath</replaceable>/<replaceable>somerecipe</replaceable>.bb
+ </literallayout>
+ This command form does not check for dependencies.
+ Consequently, you should use it only when you know existing
+ dependencies have been met.
+ <note>
+ You can also specify fragments of the filename.
+ In this case, BitBake checks for a unique match.
+ </note>
+ </para>
+ </section>
+
+ <section id='recipe-logging-mechanisms'>
+ <title>Recipe Logging Mechanisms</title>
+
+ <para>
+ The Yocto Project provides several logging functions for
+ producing debugging output and reporting errors and warnings.
+ For Python functions, the following logging functions exist.
+ All of these functions log to
+ <filename>${T}/log.do_</filename><replaceable>task</replaceable>,
+ and can also log to standard output (stdout) with the right
+ settings:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bb.plain(</filename><replaceable>msg</replaceable><filename>)</filename>:
+ Writes <replaceable>msg</replaceable> as is to the
+ log while also logging to stdout.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.note(</filename><replaceable>msg</replaceable><filename>)</filename>:
+ Writes "NOTE: <replaceable>msg</replaceable>" to the
+ log.
+ Also logs to stdout if BitBake is called with "-v".
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.debug(</filename><replaceable>level</replaceable><filename>,&nbsp;</filename><replaceable>msg</replaceable><filename>)</filename>:
+ Writes "DEBUG: <replaceable>msg</replaceable>" to the
+ log.
+ Also logs to stdout if the log level is greater than or
+ equal to <replaceable>level</replaceable>.
+ See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#usage-and-syntax'>-D</ulink>"
+ option in the BitBake User Manual for more information.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.warn(</filename><replaceable>msg</replaceable><filename>)</filename>:
+ Writes "WARNING: <replaceable>msg</replaceable>" to the
+ log while also logging to stdout.
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.error(</filename><replaceable>msg</replaceable><filename>)</filename>:
+ Writes "ERROR: <replaceable>msg</replaceable>" to the
+ log while also logging to standard out (stdout).
+ <note>
+ Calling this function does not cause the task to fail.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <filename>bb.fatal(</filename><replaceable>msg</replaceable><filename>)</filename>:
+ This logging function is similar to
+ <filename>bb.error(</filename><replaceable>msg</replaceable><filename>)</filename>
+ but also causes the calling task to fail.
+ <note>
+ <filename>bb.fatal()</filename> raises an exception,
+ which means you do not need to put a "return"
+ statement after the function.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The same logging functions are also available in shell
+ functions, under the names
+ <filename>bbplain</filename>, <filename>bbnote</filename>,
+ <filename>bbdebug</filename>, <filename>bbwarn</filename>,
+ <filename>bberror</filename>, and <filename>bbfatal</filename>.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-logging'><filename>logging</filename></ulink>
+ class implements these functions.
+ See that class in the
+ <filename>meta/classes</filename> folder of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ for information.
+ </para>
+
+ <section id='logging-with-python'>
+ <title>Logging With Python</title>
+
+ <para>
+ When creating recipes using Python and inserting code that
+ handles build logs, keep in mind the goal is to have
+ informative logs while keeping the console as "silent" as
+ possible.
+ Also, if you want status messages in the log, use the
+ "debug" loglevel.
+ </para>
+
+ <para>
+ Following is an example written in Python.
+ The code handles logging for a function that determines the
+ number of tasks needed to be run.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-listtasks'><filename>do_listtasks</filename></ulink>"
+ section for additional information:
+ <literallayout class='monospaced'>
+ python do_listtasks() {
+ bb.debug(2, "Starting to figure out the task list")
+ if noteworthy_condition:
+ bb.note("There are 47 tasks to run")
+ bb.debug(2, "Got to point xyz")
+ if warning_trigger:
+ bb.warn("Detected warning_trigger, this might be a problem later.")
+ if recoverable_error:
+ bb.error("Hit recoverable_error, you really need to fix this!")
+ if fatal_error:
+ bb.fatal("fatal_error detected, unable to print the task list")
+ bb.plain("The tasks present are abc")
+ bb.debug(2, "Finished figuring out the tasklist")
+ }
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='logging-with-bash'>
+ <title>Logging With Bash</title>
+
+ <para>
+ When creating recipes using Bash and inserting code that
+ handles build logs, you have the same goals - informative
+ with minimal console output.
+ The syntax you use for recipes written in Bash is similar
+ to that of recipes written in Python described in the
+ previous section.
+ </para>
+
+ <para>
+ Following is an example written in Bash.
+ The code logs the progress of the <filename>do_my_function</filename> function.
+ <literallayout class='monospaced'>
+ do_my_function() {
+ bbdebug 2 "Running do_my_function"
+ if [ exceptional_condition ]; then
+ bbnote "Hit exceptional_condition"
+ fi
+ bbdebug 2 "Got to point xyz"
+ if [ warning_trigger ]; then
+ bbwarn "Detected warning_trigger, this might cause a problem later."
+ fi
+ if [ recoverable_error ]; then
+ bberror "Hit recoverable_error, correcting"
+ fi
+ if [ fatal_error ]; then
+ bbfatal "fatal_error detected"
+ fi
+ bbdebug 2 "Completed do_my_function"
+ }
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='debugging-parallel-make-races'>
+ <title>Debugging Parallel Make Races</title>
+
+ <para>
+ A parallel <filename>make</filename> race occurs when the build
+ consists of several parts that are run simultaneously and
+ a situation occurs when the output or result of one
+ part is not ready for use with a different part of the build
+ that depends on that output.
+ Parallel make races are annoying and can sometimes be difficult
+ to reproduce and fix.
+ However, some simple tips and tricks exist that can help
+ you debug and fix them.
+ This section presents a real-world example of an error
+ encountered on the Yocto Project autobuilder and the process
+ used to fix it.
+ <note>
+ If you cannot properly fix a <filename>make</filename> race
+ condition, you can work around it by clearing either the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></ulink>
+ variables.
+ </note>
+ </para>
+
+ <section id='the-failure'>
+ <title>The Failure</title>
+
+ <para>
+ For this example, assume that you are building an image that
+ depends on the "neard" package.
+ And, during the build, BitBake runs into problems and
+ creates the following output.
+ <note>
+ This example log file has longer lines artificially
+ broken to make the listing easier to read.
+ </note>
+ If you examine the output or the log file, you see the
+ failure during <filename>make</filename>:
+ <literallayout class='monospaced'>
+ | DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i586-linux', 'common']
+ | DEBUG: Executing shell function do_compile
+ | NOTE: make -j 16
+ | make --no-print-directory all-am
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/types.h include/near/types.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/log.h include/near/log.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/plugin.h include/near/plugin.h
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/tag.h include/near/tag.h
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/adapter.h include/near/adapter.h
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/ndef.h include/near/ndef.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/tlv.h include/near/tlv.h
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/setting.h include/near/setting.h
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | /bin/mkdir -p include/near
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/device.h include/near/device.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/nfc_copy.h include/near/nfc_copy.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/snep.h include/near/snep.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/version.h include/near/version.h
+ | ln -s /home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/neard/
+ 0.14-r0/neard-0.14/include/dbus.h include/near/dbus.h
+ | ./src/genbuiltin nfctype1 nfctype2 nfctype3 nfctype4 p2p > src/builtin.h
+ | i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/
+ build/build/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I./include -I./src -I./gdbus -I/home/pokybuild/
+ yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/include/glib-2.0
+ -I/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/
+ lib/glib-2.0/include -I/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86/build/build/
+ tmp/sysroots/qemux86/usr/include/dbus-1.0 -I/home/pokybuild/yocto-autobuilder/yocto-slave/
+ nightly-x86/build/build/tmp/sysroots/qemux86/usr/lib/dbus-1.0/include -I/home/pokybuild/yocto-autobuilder/
+ yocto-slave/nightly-x86/build/build/tmp/sysroots/qemux86/usr/include/libnl3
+ -DNEAR_PLUGIN_BUILTIN -DPLUGINDIR=\""/usr/lib/near/plugins"\"
+ -DCONFIGDIR=\""/etc/neard\"" -O2 -pipe -g -feliminate-unused-debug-types -c
+ -o tools/snep-send.o tools/snep-send.c
+ | In file included from tools/snep-send.c:16:0:
+ | tools/../src/near.h:41:23: fatal error: near/dbus.h: No such file or directory
+ | #include &lt;near/dbus.h&gt;
+ | ^
+ | compilation terminated.
+ | make[1]: *** [tools/snep-send.o] Error 1
+ | make[1]: *** Waiting for unfinished jobs....
+ | make: *** [all] Error 2
+ | ERROR: oe_runmake failed
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='reproducing-the-error'>
+ <title>Reproducing the Error</title>
+
+ <para>
+ Because race conditions are intermittent, they do not
+ manifest themselves every time you do the build.
+ In fact, most times the build will complete without problems
+ even though the potential race condition exists.
+ Thus, once the error surfaces, you need a way to reproduce
+ it.
+ </para>
+
+ <para>
+ In this example, compiling the "neard" package is causing
+ the problem.
+ So the first thing to do is build "neard" locally.
+ Before you start the build, set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink>
+ variable in your <filename>local.conf</filename> file to
+ a high number (e.g. "-j 20").
+ Using a high value for <filename>PARALLEL_MAKE</filename>
+ increases the chances of the race condition showing up:
+ <literallayout class='monospaced'>
+ $ bitbake neard
+ </literallayout>
+ </para>
+
+ <para>
+ Once the local build for "neard" completes, start a
+ <filename>devshell</filename> build:
+ <literallayout class='monospaced'>
+ $ bitbake neard -c devshell
+ </literallayout>
+ For information on how to use a
+ <filename>devshell</filename>, see the
+ "<link linkend='platdev-appdev-devshell'>Using a Development Shell</link>"
+ section.
+ </para>
+
+ <para>
+ In the <filename>devshell</filename>, do the following:
+ <literallayout class='monospaced'>
+ $ make clean
+ $ make tools/snep-send.o
+ </literallayout>
+ The <filename>devshell</filename> commands cause the failure
+ to clearly be visible.
+ In this case, a missing dependency exists for the "neard"
+ Makefile target.
+ Here is some abbreviated, sample output with the
+ missing dependency clearly visible at the end:
+ <literallayout class='monospaced'>
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/scott-lenovo/......
+ .
+ .
+ .
+ tools/snep-send.c
+ In file included from tools/snep-send.c:16:0:
+ tools/../src/near.h:41:23: fatal error: near/dbus.h: No such file or directory
+ #include &lt;near/dbus.h&gt;
+ ^
+ compilation terminated.
+ make: *** [tools/snep-send.o] Error 1
+ $
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='creating-a-patch-for-the-fix'>
+ <title>Creating a Patch for the Fix</title>
+
+ <para>
+ Because there is a missing dependency for the Makefile
+ target, you need to patch the
+ <filename>Makefile.am</filename> file, which is generated
+ from <filename>Makefile.in</filename>.
+ You can use Quilt to create the patch:
+ <literallayout class='monospaced'>
+ $ quilt new parallelmake.patch
+ Patch patches/parallelmake.patch is now on top
+ $ quilt add Makefile.am
+ File Makefile.am added to patch patches/parallelmake.patch
+ </literallayout>
+ For more information on using Quilt, see the
+ "<link linkend='using-a-quilt-workflow'>Using Quilt in Your Workflow</link>"
+ section.
+ </para>
+
+ <para>
+ At this point you need to make the edits to
+ <filename>Makefile.am</filename> to add the missing
+ dependency.
+ For our example, you have to add the following line
+ to the file:
+ <literallayout class='monospaced'>
+ tools/snep-send.$(OBJEXT): include/near/dbus.h
+ </literallayout>
+ </para>
+
+ <para>
+ Once you have edited the file, use the
+ <filename>refresh</filename> command to create the patch:
+ <literallayout class='monospaced'>
+ $ quilt refresh
+ Refreshed patch patches/parallelmake.patch
+ </literallayout>
+ Once the patch file exists, you need to add it back to the
+ originating recipe folder.
+ Here is an example assuming a top-level
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ named <filename>poky</filename>:
+ <literallayout class='monospaced'>
+ $ cp patches/parallelmake.patch poky/meta/recipes-connectivity/neard/neard
+ </literallayout>
+ The final thing you need to do to implement the fix in the
+ build is to update the "neard" recipe (i.e.
+ <filename>neard-0.14.bb</filename>) so that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement includes the patch file.
+ The recipe file is in the folder above the patch.
+ Here is what the edited <filename>SRC_URI</filename>
+ statement would look like:
+ <literallayout class='monospaced'>
+ SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \
+ file://neard.in \
+ file://neard.service.in \
+ file://parallelmake.patch \
+ "
+ </literallayout>
+ </para>
+
+ <para>
+ With the patch complete and moved to the correct folder and
+ the <filename>SRC_URI</filename> statement updated, you can
+ exit the <filename>devshell</filename>:
+ <literallayout class='monospaced'>
+ $ exit
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='testing-the-build'>
+ <title>Testing the Build</title>
+
+ <para>
+ With everything in place, you can get back to trying the
+ build again locally:
+ <literallayout class='monospaced'>
+ $ bitbake neard
+ </literallayout>
+ This build should succeed.
+ </para>
+
+ <para>
+ Now you can open up a <filename>devshell</filename> again
+ and repeat the clean and make operations as follows:
+ <literallayout class='monospaced'>
+ $ bitbake neard -c devshell
+ $ make clean
+ $ make tools/snep-send.o
+ </literallayout>
+ The build should work without issue.
+ </para>
+
+ <para>
+ As with all solved problems, if they originated upstream,
+ you need to submit the fix for the recipe in OE-Core and
+ upstream so that the problem is taken care of at its
+ source.
+ See the
+ "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
+ section for more information.
+ </para>
+ </section>
+ </section>
+
+ <section id="platdev-gdb-remotedebug">
+ <title>Debugging With the GNU Project Debugger (GDB) Remotely</title>
+
+ <para>
+ GDB allows you to examine running programs, which in turn helps
+ you to understand and fix problems.
+ It also allows you to perform post-mortem style analysis of
+ program crashes.
+ GDB is available as a package within the Yocto Project and is
+ installed in SDK images by default.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual for a description of
+ these images.
+ You can find information on GDB at
+ <ulink url="http://sourceware.org/gdb/"/>.
+ <note><title>Tip</title>
+ For best results, install debug (<filename>-dbg</filename>)
+ packages for the applications you are going to debug.
+ Doing so makes extra debug symbols available that give you
+ more meaningful output.
+ </note>
+ </para>
+
+ <para>
+ Sometimes, due to memory or disk space constraints, it is not
+ possible to use GDB directly on the remote target to debug
+ applications.
+ These constraints arise because GDB needs to load the debugging
+ information and the binaries of the process being debugged.
+ Additionally, GDB needs to perform many computations to locate
+ information such as function names, variable names and values,
+ stack traces and so forth - even before starting the debugging
+ process.
+ These extra computations place more load on the target system
+ and can alter the characteristics of the program being debugged.
+ </para>
+
+ <para>
+ To help get past the previously mentioned constraints, you can
+ use gdbserver, which runs on the remote target and does not
+ load any debugging information from the debugged process.
+ Instead, a GDB instance processes the debugging information that
+ is run on a remote computer - the host GDB.
+ The host GDB then sends control commands to gdbserver to make
+ it stop or start the debugged program, as well as read or write
+ memory regions of that debugged program.
+ All the debugging information loaded and processed as well
+ as all the heavy debugging is done by the host GDB.
+ Offloading these processes gives the gdbserver running on the
+ target a chance to remain small and fast.
+ </para>
+
+ <para>
+ Because the host GDB is responsible for loading the debugging
+ information and for doing the necessary processing to make
+ actual debugging happen, you have to make sure the host can
+ access the unstripped binaries complete with their debugging
+ information and also be sure the target is compiled with no
+ optimizations.
+ The host GDB must also have local access to all the libraries
+ used by the debugged program.
+ Because gdbserver does not need any local debugging information,
+ the binaries on the remote target can remain stripped.
+ However, the binaries must also be compiled without optimization
+ so they match the host's binaries.
+ </para>
+
+ <para>
+ To remain consistent with GDB documentation and terminology,
+ the binary being debugged on the remote target machine is
+ referred to as the "inferior" binary.
+ For documentation on GDB see the
+ <ulink url="http://sourceware.org/gdb/documentation/">GDB site</ulink>.
+ </para>
+
+ <para>
+ The following steps show you how to debug using the GNU project
+ debugger.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Configure your build system to construct the
+ companion debug filesystem:</emphasis></para>
+
+ <para>In your <filename>local.conf</filename> file, set
+ the following:
+ <literallayout class='monospaced'>
+ IMAGE_GEN_DEBUGFS = "1"
+ IMAGE_FSTYPES_DEBUGFS = "tar.bz2"
+ </literallayout>
+ These options cause the OpenEmbedded build system
+ to generate a special companion filesystem fragment,
+ which contains the matching source and debug symbols to
+ your deployable filesystem.
+ The build system does this by looking at what is in the
+ deployed filesystem, and pulling the corresponding
+ <filename>-dbg</filename> packages.</para>
+
+ <para>The companion debug filesystem is not a complete
+ filesystem, but only contains the debug fragments.
+ This filesystem must be combined with the full filesystem
+ for debugging.
+ Subsequent steps in this procedure show how to combine
+ the partial filesystem with the full filesystem.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Configure the system to include gdbserver in
+ the target filesystem:</emphasis></para>
+
+ <para>Make the following addition in either your
+ <filename>local.conf</filename> file or in an image
+ recipe:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = “ gdbserver"
+ </literallayout>
+ The change makes sure the <filename>gdbserver</filename>
+ package is included.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the environment:</emphasis></para>
+
+ <para>Use the following command to construct the image
+ and the companion Debug Filesystem:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable>
+ </literallayout>
+ Build the cross GDB component and make it available
+ for debugging.
+ Build the SDK that matches the image.
+ Building the SDK is best for a production build
+ that can be used later for debugging, especially
+ during long term maintenance:
+ <literallayout class='monospaced'>
+ $ bitbake -c populate_sdk <replaceable>image</replaceable>
+ </literallayout></para>
+
+ <para>Alternatively, you can build the minimal
+ toolchain components that match the target.
+ Doing so creates a smaller than typical SDK and only
+ contains a minimal set of components with which to
+ build simple test applications, as well as run the
+ debugger:
+ <literallayout class='monospaced'>
+ $ bitbake meta-toolchain
+ </literallayout></para>
+
+ <para>A final method is to build Gdb itself within
+ the build system:
+ <literallayout class='monospaced'>
+ $ bitbake gdb-cross-<replaceable>architecture</replaceable>
+ </literallayout>
+ Doing so produces a temporary copy of
+ <filename>cross-gdb</filename> you can use for
+ debugging during development.
+ While this is the quickest approach, the two previous
+ methods in this step are better when considering
+ long-term maintenance strategies.
+ <note>
+ If you run
+ <filename>bitbake gdb-cross</filename>, the
+ OpenEmbedded build system suggests the actual
+ image (e.g. <filename>gdb-cross-i586</filename>).
+ The suggestion is usually the actual name you want
+ to use.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up the</emphasis>&nbsp;<filename>debugfs</filename></para>
+
+ <para>Run the following commands to set up the
+ <filename>debugfs</filename>:
+ <literallayout class='monospaced'>
+ $ mkdir debugfs
+ $ cd debugfs
+ $ tar xvfj <replaceable>build-dir</replaceable>/tmp-glibc/deploy/images/<replaceable>machine</replaceable>/<replaceable>image</replaceable>.rootfs.tar.bz2
+ $ tar xvfj <replaceable>build-dir</replaceable>/tmp-glibc/deploy/images/<replaceable>machine</replaceable>/<replaceable>image</replaceable>-dbg.rootfs.tar.bz2
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up GDB</emphasis></para>
+
+ <para>Install the SDK (if you built one) and then
+ source the correct environment file.
+ Sourcing the environment file puts the SDK in your
+ <filename>PATH</filename> environment variable.</para>
+
+ <para>If you are using the build system, Gdb is
+ located in
+ <replaceable>build-dir</replaceable>/tmp/sysroots/<replaceable>host</replaceable>/usr/bin/<replaceable>architecture</replaceable>/<replaceable>architecture</replaceable>-gdb
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Boot the target:</emphasis></para>
+
+ <para>For information on how to run QEMU, see the
+ <ulink url='http://wiki.qemu.org/Documentation/GettingStartedDevelopers'>QEMU Documentation</ulink>.
+ <note>
+ Be sure to verify that your host can access the
+ target via TCP.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Debug a program:</emphasis></para>
+
+ <para>Debugging a program involves running gdbserver
+ on the target and then running Gdb on the host.
+ The example in this step debugs
+ <filename>gzip</filename>:
+ <literallayout class='monospaced'>
+ root@qemux86:~# gdbserver localhost:1234 /bin/gzip —help
+ </literallayout>
+ For additional gdbserver options, see the
+ <ulink url='https://www.gnu.org/software/gdb/documentation/'>GDB Server Documentation</ulink>.
+ </para>
+
+ <para>After running gdbserver on the target, you need
+ to run Gdb on the host and configure it and connect to
+ the target.
+ Use these commands:
+ <literallayout class='monospaced'>
+ $ cd <replaceable>directory-holding-the-debugfs-directory</replaceable>
+ $ <replaceable>arch</replaceable>-gdb
+
+ (gdb) set sysroot debugfs
+ (gdb) set substitute-path /usr/src/debug debugfs/usr/src/debug
+ (gdb) target remote <replaceable>IP-of-target</replaceable>:1234
+ </literallayout>
+ At this point, everything should automatically load
+ (i.e. matching binaries, symbols and headers).
+ <note>
+ The Gdb <filename>set</filename> commands in the
+ previous example can be placed into the users
+ <filename>~/.gdbinit</filename> file.
+ Upon starting, Gdb automatically runs whatever
+ commands are in that file.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Deploying without a full image
+ rebuild:</emphasis></para>
+
+ <para>In many cases, during development you want a
+ quick method to deploy a new binary to the target and
+ debug it, without waiting for a full image build.
+ </para>
+
+ <para>One approach to solving this situation is to
+ just build the component you want to debug.
+ Once you have built the component, copy the
+ executable directly to both the target and the
+ host <filename>debugfs</filename>.</para>
+
+ <para>If the binary is processed through the debug
+ splitting in OpenEmbedded, you should also
+ copy the debug items (i.e. <filename>.debug</filename>
+ contents and corresponding
+ <filename>/usr/src/debug</filename> files)
+ from the work directory.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ bitbake bash
+ $ bitbake -c devshell bash
+ $ cd ..
+ $ scp packages-split/bash/bin/bash <replaceable>target</replaceable>:/bin/bash
+ $ cp -a packages-split/bash-dbg/* <replaceable>path</replaceable>/debugfs
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='debugging-with-the-gnu-project-debugger-gdb-on-the-target'>
+ <title>Debugging with the GNU Project Debugger (GDB) on the Target</title>
+
+ <para>
+ The previous section addressed using GDB remotely for debugging
+ purposes, which is the most usual case due to the inherent
+ hardware limitations on many embedded devices.
+ However, debugging in the target hardware itself is also
+ possible with more powerful devices.
+ This section describes what you need to do in order to support
+ using GDB to debug on the target hardware.
+ </para>
+
+ <para>
+ To support this kind of debugging, you need do the following:
+ <itemizedlist>
+ <listitem><para>
+ Ensure that GDB is on the target.
+ You can do this by adding "gdb" to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " gdb"
+ </literallayout>
+ Alternatively, you can add "tools-debug" to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>:
+ <literallayout class='monospaced'>
+ IMAGE_FEATURES_append = " tools-debug"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Ensure that debug symbols are present.
+ You can make sure these symbols are present by
+ installing <filename>-dbg</filename>:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " <replaceable>packagename</replaceable>-dbg"
+ </literallayout>
+ Alternatively, you can do the following to include all
+ the debug symbols:
+ <literallayout class='monospaced'>
+ IMAGE_FEATURES_append = " dbg-pkgs"
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ To improve the debug information accuracy, you can reduce
+ the level of optimization used by the compiler.
+ For example, when adding the following line to your
+ <filename>local.conf</filename> file, you will reduce
+ optimization from
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FULL_OPTIMIZATION'><filename>FULL_OPTIMIZATION</filename></ulink>
+ of "-O2" to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEBUG_OPTIMIZATION'><filename>DEBUG_OPTIMIZATION</filename></ulink>
+ of "-O -fno-omit-frame-pointer":
+ <literallayout class='monospaced'>
+ DEBUG_BUILD = "1"
+ </literallayout>
+ Consider that this will reduce the application's performance
+ and is recommended only for debugging purposes.
+ </note>
+ </para>
+ </section>
+
+ <section id='dev-other-debugging-others'>
+ <title>Other Debugging Tips</title>
+
+ <para>
+ Here are some other tips that you might find useful:
+ <itemizedlist>
+ <listitem><para>
+ When adding new packages, it is worth watching for
+ undesirable items making their way into compiler command
+ lines.
+ For example, you do not want references to local system
+ files like
+ <filename>/usr/lib/</filename> or
+ <filename>/usr/include/</filename>.
+ </para></listitem>
+ <listitem><para>
+ If you want to remove the <filename>psplash</filename>
+ boot splashscreen,
+ add <filename>psplash=false</filename> to the kernel
+ command line.
+ Doing so prevents <filename>psplash</filename> from
+ loading and thus allows you to see the console.
+ It is also possible to switch out of the splashscreen by
+ switching the virtual console (e.g. Fn+Left or Fn+Right
+ on a Zaurus).
+ </para></listitem>
+ <listitem><para>
+ Removing
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ (usually <filename>tmp/</filename>, within the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>)
+ can often fix temporary build issues.
+ Removing <filename>TMPDIR</filename> is usually a
+ relatively cheap operation, because task output will be
+ cached in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>
+ (usually <filename>sstate-cache/</filename>, which is
+ also in the Build Directory).
+ <note>
+ Removing <filename>TMPDIR</filename> might be a
+ workaround rather than a fix.
+ Consequently, trying to determine the underlying
+ cause of an issue before removing the directory is
+ a good idea.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Understanding how a feature is used in practice within
+ existing recipes can be very helpful.
+ It is recommended that you configure some method that
+ allows you to quickly search through files.</para>
+
+ <para>Using GNU Grep, you can use the following shell
+ function to recursively search through common
+ recipe-related files, skipping binary files,
+ <filename>.git</filename> directories, and the
+ Build Directory (assuming its name starts with
+ "build"):
+ <literallayout class='monospaced'>
+ g() {
+ grep -Ir \
+ --exclude-dir=.git \
+ --exclude-dir='build*' \
+ --include='*.bb*' \
+ --include='*.inc*' \
+ --include='*.conf*' \
+ --include='*.py*' \
+ "$@"
+ }
+ </literallayout>
+ Following are some usage examples:
+ <literallayout class='monospaced'>
+ $ g FOO # Search recursively for "FOO"
+ $ g -i foo # Search recursively for "foo", ignoring case
+ $ g -w FOO # Search recursively for "FOO" as a word, ignoring e.g. "FOOBAR"
+ </literallayout>
+ If figuring out how some feature works requires a lot of
+ searching, it might indicate that the documentation
+ should be extended or improved.
+ In such cases, consider filing a documentation bug using
+ the Yocto Project implementation of
+ <ulink url='https://bugzilla.yoctoproject.org/'>Bugzilla</ulink>.
+ For information on how to submit a bug against
+ the Yocto Project, see the Yocto Project Bugzilla
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>wiki page</ulink>
+ and the
+ "<link linkend='submitting-a-defect-against-the-yocto-project'>Submitting a Defect Against the Yocto Project</link>"
+ section.
+ <note>
+ The manuals might not be the right place to document
+ variables that are purely internal and have a
+ limited scope (e.g. internal variables used to
+ implement a single <filename>.bbclass</filename>
+ file).
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='making-changes-to-the-yocto-project'>
+ <title>Making Changes to the Yocto Project</title>
+
+ <para>
+ Because the Yocto Project is an open-source, community-based
+ project, you can effect changes to the project.
+ This section presents procedures that show you how to submit
+ a defect against the project and how to submit a change.
+ </para>
+
+ <section id='submitting-a-defect-against-the-yocto-project'>
+ <title>Submitting a Defect Against the Yocto Project</title>
+
+ <para>
+ Use the Yocto Project implementation of
+ <ulink url='http://www.bugzilla.org/about/'>Bugzilla</ulink>
+ to submit a defect (bug) against the Yocto Project.
+ For additional information on this implementation of Bugzilla see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-bugtracker'>Yocto Project Bugzilla</ulink>"
+ section in the Yocto Project Reference Manual.
+ For more detail on any of the following steps, see the Yocto Project
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla wiki page</ulink>.
+ </para>
+
+ <para>
+ Use the following general steps to submit a bug"
+
+ <orderedlist>
+ <listitem><para>
+ Open the Yocto Project implementation of
+ <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Click "File a Bug" to enter a new bug.
+ </para></listitem>
+ <listitem><para>
+ Choose the appropriate "Classification", "Product", and
+ "Component" for which the bug was found.
+ Bugs for the Yocto Project fall into one of several
+ classifications, which in turn break down into several
+ products and components.
+ For example, for a bug against the
+ <filename>meta-intel</filename> layer, you would choose
+ "Build System, Metadata &amp; Runtime", "BSPs", and
+ "bsps-meta-intel", respectively.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Version" of the Yocto Project for which you found
+ the bug (e.g. &DISTRO;).
+ </para></listitem>
+ <listitem><para>
+ Determine and select the "Severity" of the bug.
+ The severity indicates how the bug impacted your work.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Hardware" that the bug impacts.
+ </para></listitem>
+ <listitem><para>
+ Choose the "Architecture" that the bug impacts.
+ </para></listitem>
+ <listitem><para>
+ Choose a "Documentation change" item for the bug.
+ Fixing a bug might or might not affect the Yocto Project
+ documentation.
+ If you are unsure of the impact to the documentation, select
+ "Don't Know".
+ </para></listitem>
+ <listitem><para>
+ Provide a brief "Summary" of the bug.
+ Try to limit your summary to just a line or two and be sure
+ to capture the essence of the bug.
+ </para></listitem>
+ <listitem><para>
+ Provide a detailed "Description" of the bug.
+ You should provide as much detail as you can about the context,
+ behavior, output, and so forth that surrounds the bug.
+ You can even attach supporting files for output from logs by
+ using the "Add an attachment" button.
+ </para></listitem>
+ <listitem><para>
+ Click the "Submit Bug" button submit the bug.
+ A new Bugzilla number is assigned to the bug and the defect
+ is logged in the bug tracking system.
+ </para></listitem>
+ </orderedlist>
+ Once you file a bug, the bug is processed by the Yocto Project Bug
+ Triage Team and further details concerning the bug are assigned
+ (e.g. priority and owner).
+ You are the "Submitter" of the bug and any further categorization,
+ progress, or comments on the bug result in Bugzilla sending you an
+ automated email concerning the particular change or progress to the
+ bug.
+ </para>
+ </section>
+
+ <section id='how-to-submit-a-change'>
+ <title>Submitting a Change to the Yocto Project</title>
+
+ <para>
+ Contributions to the Yocto Project and OpenEmbedded are very welcome.
+ Because the system is extremely configurable and flexible, we recognize
+ that developers will want to extend, configure or optimize it for
+ their specific uses.
+ </para>
+
+ <para>
+ The Yocto Project uses a mailing list and a patch-based workflow
+ that is similar to the Linux kernel but contains important
+ differences.
+ In general, a mailing list exists through which you can submit
+ patches.
+ You should send patches to the appropriate mailing list so that they
+ can be reviewed and merged by the appropriate maintainer.
+ The specific mailing list you need to use depends on the
+ location of the code you are changing.
+ Each component (e.g. layer) should have a
+ <filename>README</filename> file that indicates where to send
+ the changes and which process to follow.
+ </para>
+
+ <para>
+ You can send the patch to the mailing list using whichever approach
+ you feel comfortable with to generate the patch.
+ Once sent, the patch is usually reviewed by the community at large.
+ If somebody has concerns with the patch, they will usually voice
+ their concern over the mailing list.
+ If a patch does not receive any negative reviews, the maintainer of
+ the affected layer typically takes the patch, tests it, and then
+ based on successful testing, merges the patch.
+ </para>
+
+ <para id='figuring-out-the-mailing-list-to-use'>
+ The "poky" repository, which is the Yocto Project's reference build
+ environment, is a hybrid repository that contains several
+ individual pieces (e.g. BitBake, Metadata, documentation,
+ and so forth) built using the combo-layer tool.
+ The upstream location used for submitting changes varies by
+ component:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Core Metadata:</emphasis>
+ Send your patch to the
+ <ulink url='http://lists.openembedded.org/mailman/listinfo/openembedded-core'>openembedded-core</ulink>
+ mailing list. For example, a change to anything under
+ the <filename>meta</filename> or
+ <filename>scripts</filename> directories should be sent
+ to this mailing list.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>BitBake:</emphasis>
+ For changes to BitBake (i.e. anything under the
+ <filename>bitbake</filename> directory), send your patch
+ to the
+ <ulink url='http://lists.openembedded.org/mailman/listinfo/bitbake-devel'>bitbake-devel</ulink>
+ mailing list.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"meta-*" trees:</emphasis>
+ These trees contain Metadata.
+ Use the
+ <ulink url='https://lists.yoctoproject.org/listinfo/poky'>poky</ulink>
+ mailing list.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For changes to other layers hosted in the Yocto Project source
+ repositories (i.e. <filename>yoctoproject.org</filename>), tools,
+ and the Yocto Project documentation, use the
+ <ulink url='https://lists.yoctoproject.org/listinfo/yocto'>Yocto Project</ulink>
+ general mailing list.
+ <note>
+ Sometimes a layer's documentation specifies to use a
+ particular mailing list.
+ If so, use that list.
+ </note>
+ For additional recipes that do not fit into the core Metadata, you
+ should determine which layer the recipe should go into and submit
+ the change in the manner recommended by the documentation (e.g.
+ the <filename>README</filename> file) supplied with the layer.
+ If in doubt, please ask on the Yocto general mailing list or on
+ the openembedded-devel mailing list.
+ </para>
+
+ <para>
+ You can also push a change upstream and request a maintainer to
+ pull the change into the component's upstream repository.
+ You do this by pushing to a contribution repository that is upstream.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#gs-git-workflows-and-the-yocto-project'>Git Workflows and the Yocto Project</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for additional
+ concepts on working in the Yocto Project development environment.
+ </para>
+
+ <para>
+ Two commonly used testing repositories exist for
+ OpenEmbedded-Core:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>"ross/mut" branch:</emphasis>
+ The "mut" (master-under-test) tree
+ exists in the <filename>poky-contrib</filename> repository
+ in the
+ <ulink url='&YOCTO_GIT_URL;'>Yocto Project source repositories</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>"master-next" branch:</emphasis>
+ This branch is part of the main
+ "poky" repository in the Yocto Project source repositories.
+ </para></listitem>
+ </itemizedlist>
+ Maintainers use these branches to test submissions prior to merging
+ patches.
+ Thus, you can get an idea of the status of a patch based on
+ whether the patch has been merged into one of these branches.
+ <note>
+ This system is imperfect and changes can sometimes get lost in the
+ flow.
+ Asking about the status of a patch or change is reasonable if the
+ change has been idle for a while with no feedback.
+ The Yocto Project does have plans to use
+ <ulink url='https://en.wikipedia.org/wiki/Patchwork_(software)'>Patchwork</ulink>
+ to track the status of patches and also to automatically preview
+ patches.
+ </note>
+ </para>
+
+ <para>
+ The following sections provide procedures for submitting a change.
+ </para>
+
+ <section id='pushing-a-change-upstream'>
+ <title>Using Scripts to Push a Change Upstream and Request a Pull</title>
+
+ <para>
+ Follow this procedure to push a change to an upstream "contrib"
+ Git repository:
+ <note>
+ You can find general Git information on how to push a change
+ upstream in the
+ <ulink url='http://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows'>Git Community Book</ulink>.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Make Your Changes Locally:</emphasis>
+ Make your changes in your local Git repository.
+ You should make small, controlled, isolated changes.
+ Keeping changes small and isolated aids review,
+ makes merging/rebasing easier and keeps the change
+ history clean should anyone need to refer to it in
+ future.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage Your Changes:</emphasis>
+ Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.
+ </para></listitem>
+ <listitem><para id='making-sure-you-have-correct-commit-information'>
+ <emphasis>Commit Your Changes:</emphasis>
+ Commit the change by using the
+ <filename>git commit</filename> command.
+ Make sure your commit information follows standards by
+ following these accepted conventions:
+ <itemizedlist>
+ <listitem><para>
+ Be sure to include a "Signed-off-by:" line in the
+ same style as required by the Linux kernel.
+ Adding this line signifies that you, the submitter,
+ have agreed to the Developer's Certificate of
+ Origin 1.1 as follows:
+ <literallayout class='monospaced'>
+ Developer's Certificate of Origin 1.1
+
+ By making a contribution to this project, I certify that:
+
+ (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+ (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+ (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+ (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Provide a single-line summary of the change.
+ and,
+ if more explanation is needed, provide more
+ detail in the body of the commit.
+ This summary is typically viewable in the
+ "shortlist" of changes.
+ Thus, providing something short and descriptive
+ that gives the reader a summary of the change is
+ useful when viewing a list of many commits.
+ You should prefix this short description with the
+ recipe name (if changing a recipe), or else with
+ the short form path to the file being changed.
+ </para></listitem>
+ <listitem><para>
+ For the body of the commit message, provide
+ detailed information that describes what you
+ changed, why you made the change, and the approach
+ you used.
+ It might also be helpful if you mention how you
+ tested the change.
+ Provide as much detail as you can in the body of
+ the commit message.
+ <note>
+ You do not need to provide a more detailed
+ explanation of a change if the change is
+ minor to the point of the single line
+ summary providing all the information.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ If the change addresses a specific bug or issue
+ that is associated with a bug-tracking ID,
+ include a reference to that ID in your detailed
+ description.
+ For example, the Yocto Project uses a specific
+ convention for bug references - any commit that
+ addresses a specific bug should use the following
+ form for the detailed description.
+ Be sure to use the actual bug-tracking ID from
+ Bugzilla for
+ <replaceable>bug-id</replaceable>:
+ <literallayout class='monospaced'>
+ Fixes [YOCTO #<replaceable>bug-id</replaceable>]
+
+ <replaceable>detailed description of change</replaceable>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Push Your Commits to a "Contrib" Upstream:</emphasis>
+ If you have arranged for permissions to push to an
+ upstream contrib repository, push the change to that
+ repository:
+ <literallayout class='monospaced'>
+ $ git push <replaceable>upstream_remote_repo</replaceable> <replaceable>local_branch_name</replaceable>
+ </literallayout>
+ For example, suppose you have permissions to push into the
+ upstream <filename>meta-intel-contrib</filename>
+ repository and you are working in a local branch named
+ <replaceable>your_name</replaceable><filename>/README</filename>.
+ The following command pushes your local commits to the
+ <filename>meta-intel-contrib</filename> upstream
+ repository and puts the commit in a branch named
+ <replaceable>your_name</replaceable><filename>/README</filename>:
+ <literallayout class='monospaced'>
+ $ git push meta-intel-contrib <replaceable>your_name</replaceable>/README
+ </literallayout>
+ </para></listitem>
+ <listitem><para id='push-determine-who-to-notify'>
+ <emphasis>Determine Who to Notify:</emphasis>
+ Determine the maintainer or the mailing list
+ that you need to notify for the change.</para>
+
+ <para>Before submitting any change, you need to be sure
+ who the maintainer is or what mailing list that you need
+ to notify.
+ Use either these methods to find out:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Maintenance File:</emphasis>
+ Examine the <filename>maintainers.inc</filename>
+ file, which is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ at
+ <filename>meta/conf/distro/include</filename>,
+ to see who is responsible for code.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Search by File:</emphasis>
+ Using <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>,
+ you can enter the following command to bring up a
+ short list of all commits against a specific file:
+ <literallayout class='monospaced'>
+ git shortlog -- <replaceable>filename</replaceable>
+ </literallayout>
+ Just provide the name of the file for which you
+ are interested.
+ The information returned is not ordered by history
+ but does include a list of everyone who has
+ committed grouped by name.
+ From the list, you can see who is responsible for
+ the bulk of the changes against the file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine the List of Mailing Lists:</emphasis>
+ For a list of the Yocto Project and related mailing
+ lists, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing lists</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make a Pull Request:</emphasis>
+ Notify the maintainer or the mailing list that you have
+ pushed a change by making a pull request.</para>
+
+ <para>The Yocto Project provides two scripts that
+ conveniently let you generate and send pull requests to the
+ Yocto Project.
+ These scripts are <filename>create-pull-request</filename>
+ and <filename>send-pull-request</filename>.
+ You can find these scripts in the
+ <filename>scripts</filename> directory within the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>~/poky/scripts</filename>).
+ </para>
+
+ <para>Using these scripts correctly formats the requests
+ without introducing any whitespace or HTML formatting.
+ The maintainer that receives your patches either directly
+ or through the mailing list needs to be able to save and
+ apply them directly from your emails.
+ Using these scripts is the preferred method for sending
+ patches.</para>
+
+ <para>First, create the pull request.
+ For example, the following command runs the script,
+ specifies the upstream repository in the contrib directory
+ into which you pushed the change, and provides a subject
+ line in the created patch files:
+ <literallayout class='monospaced'>
+ $ ~/poky/scripts/create-pull-request -u meta-intel-contrib -s "Updated Manual Section Reference in README"
+ </literallayout>
+ Running this script forms
+ <filename>*.patch</filename> files in a folder named
+ <filename>pull-</filename><replaceable>PID</replaceable>
+ in the current directory.
+ One of the patch files is a cover letter.</para>
+
+ <para>Before running the
+ <filename>send-pull-request</filename> script, you must
+ edit the cover letter patch to insert information about
+ your change.
+ After editing the cover letter, send the pull request.
+ For example, the following command runs the script and
+ specifies the patch directory and email address.
+ In this example, the email address is a mailing list:
+ <literallayout class='monospaced'>
+ $ ~/poky/scripts/send-pull-request -p ~/meta-intel/pull-10565 -t meta-intel@yoctoproject.org
+ </literallayout>
+ You need to follow the prompts as the script is
+ interactive.
+ <note>
+ For help on using these scripts, simply provide the
+ <filename>-h</filename> argument as follows:
+ <literallayout class='monospaced'>
+ $ poky/scripts/create-pull-request -h
+ $ poky/scripts/send-pull-request -h
+ </literallayout>
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='submitting-a-patch'>
+ <title>Using Email to Submit a Patch</title>
+
+ <para>
+ You can submit patches without using the
+ <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename> scripts described in the
+ previous section.
+ However, keep in mind, the preferred method is to use the scripts.
+ </para>
+
+ <para>
+ Depending on the components changed, you need to submit the email
+ to a specific mailing list.
+ For some guidance on which mailing list to use, see the
+ <link linkend='figuring-out-the-mailing-list-to-use'>list</link>
+ at the beginning of this section.
+ For a description of all the available mailing lists, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ Here is the general procedure on how to submit a patch through
+ email without using the scripts:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Make Your Changes Locally:</emphasis>
+ Make your changes in your local Git repository.
+ You should make small, controlled, isolated changes.
+ Keeping changes small and isolated aids review,
+ makes merging/rebasing easier and keeps the change
+ history clean should anyone need to refer to it in
+ future.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage Your Changes:</emphasis>
+ Stage your changes by using the <filename>git add</filename>
+ command on each file you changed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Commit Your Changes:</emphasis>
+ Commit the change by using the
+ <filename>git commit --signoff</filename> command.
+ Using the <filename>--signoff</filename> option identifies
+ you as the person making the change and also satisfies
+ the Developer's Certificate of Origin (DCO) shown earlier.
+ </para>
+
+ <para>When you form a commit, you must follow certain
+ standards established by the Yocto Project development
+ team.
+ See
+ <link linkend='making-sure-you-have-correct-commit-information'>Step 3</link>
+ in the previous section for information on how to
+ provide commit information that meets Yocto Project
+ commit message standards.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Format the Commit:</emphasis>
+ Format the commit into an email message.
+ To format commits, use the
+ <filename>git format-patch</filename> command.
+ When you provide the command, you must include a revision
+ list or a number of patches as part of the command.
+ For example, either of these two commands takes your most
+ recent single commit and formats it as an email message in
+ the current directory:
+ <literallayout class='monospaced'>
+ $ git format-patch -1
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ $ git format-patch HEAD~
+ </literallayout></para>
+
+ <para>After the command is run, the current directory
+ contains a numbered <filename>.patch</filename> file for
+ the commit.</para>
+
+ <para>If you provide several commits as part of the
+ command, the <filename>git format-patch</filename> command
+ produces a series of numbered files in the current
+ directory – one for each commit.
+ If you have more than one patch, you should also use the
+ <filename>--cover</filename> option with the command,
+ which generates a cover letter as the first "patch" in
+ the series.
+ You can then edit the cover letter to provide a
+ description for the series of patches.
+ For information on the
+ <filename>git format-patch</filename> command,
+ see <filename>GIT_FORMAT_PATCH(1)</filename> displayed
+ using the <filename>man git-format-patch</filename>
+ command.
+ <note>
+ If you are or will be a frequent contributor to the
+ Yocto Project or to OpenEmbedded, you might consider
+ requesting a contrib area and the necessary associated
+ rights.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Import the Files Into Your Mail Client:</emphasis>
+ Import the files into your mail client by using the
+ <filename>git send-email</filename> command.
+ <note>
+ In order to use <filename>git send-email</filename>,
+ you must have the proper Git packages installed on
+ your host.
+ For Ubuntu, Debian, and Fedora the package is
+ <filename>git-email</filename>.
+ </note></para>
+
+ <para>The <filename>git send-email</filename> command
+ sends email by using a local or remote Mail Transport Agent
+ (MTA) such as <filename>msmtp</filename>,
+ <filename>sendmail</filename>, or through a direct
+ <filename>smtp</filename> configuration in your Git
+ <filename>~/.gitconfig</filename> file.
+ If you are submitting patches through email only, it is
+ very important that you submit them without any whitespace
+ or HTML formatting that either you or your mailer
+ introduces.
+ The maintainer that receives your patches needs to be able
+ to save and apply them directly from your emails.
+ A good way to verify that what you are sending will be
+ applicable by the maintainer is to do a dry run and send
+ them to yourself and then save and apply them as the
+ maintainer would.</para>
+
+ <para>The <filename>git send-email</filename> command is
+ the preferred method for sending your patches using
+ email since there is no risk of compromising whitespace
+ in the body of the message, which can occur when you use
+ your own mail client.
+ The command also has several options that let you
+ specify recipients and perform further editing of the
+ email message.
+ For information on how to use the
+ <filename>git send-email</filename> command,
+ see <filename>GIT-SEND-EMAIL(1)</filename> displayed using
+ the <filename>man git-send-email</filename> command.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='working-with-licenses'>
+ <title>Working With Licenses</title>
+
+ <para>
+ As mentioned in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#licensing'>Licensing</ulink>"
+ section in the Yocto Project Overview and Concepts Manual,
+ open source projects are open to the public and they
+ consequently have different licensing structures in place.
+ This section describes the mechanism by which the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ tracks changes to licensing text and covers how to maintain open
+ source license compliance during your project's lifecycle.
+ The section also describes how to enable commercially licensed
+ recipes, which by default are disabled.
+ </para>
+
+ <section id="usingpoky-configuring-LIC_FILES_CHKSUM">
+ <title>Tracking License Changes</title>
+
+ <para>
+ The license of an upstream project might change in the future.
+ In order to prevent these changes going unnoticed, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink>
+ variable tracks changes to the license text. The checksums are
+ validated at the end of the configure step, and if the
+ checksums do not match, the build will fail.
+ </para>
+
+ <section id="usingpoky-specifying-LIC_FILES_CHKSUM">
+ <title>Specifying the <filename>LIC_FILES_CHKSUM</filename> Variable</title>
+
+ <para>
+ The <filename>LIC_FILES_CHKSUM</filename>
+ variable contains checksums of the license text in the
+ source code for the recipe.
+ Following is an example of how to specify
+ <filename>LIC_FILES_CHKSUM</filename>:
+ <literallayout class='monospaced'>
+ LIC_FILES_CHKSUM = "file://COPYING;md5=xxxx \
+ file://licfile1.txt;beginline=5;endline=29;md5=yyyy \
+ file://licfile2.txt;endline=50;md5=zzzz \
+ ..."
+ </literallayout>
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ When using "beginline" and "endline", realize
+ that line numbering begins with one and not
+ zero.
+ Also, the included lines are inclusive (i.e.
+ lines five through and including 29 in the
+ previous example for
+ <filename>licfile1.txt</filename>).
+ </para></listitem>
+ <listitem><para>
+ When a license check fails, the selected license
+ text is included as part of the QA message.
+ Using this output, you can determine the exact
+ start and finish for the needed license text.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The build system uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable as the default directory when searching files
+ listed in <filename>LIC_FILES_CHKSUM</filename>.
+ The previous example employs the default directory.
+ </para>
+
+ <para>
+ Consider this next example:
+ <literallayout class='monospaced'>
+ LIC_FILES_CHKSUM = "file://src/ls.c;beginline=5;endline=16;\
+ md5=bb14ed3c4cda583abc85401304b5cd4e"
+ LIC_FILES_CHKSUM = "file://${WORKDIR}/license.html;md5=5c94767cedb5d6987c902ac850ded2c6"
+ </literallayout>
+ </para>
+
+ <para>
+ The first line locates a file in
+ <filename>${S}/src/ls.c</filename> and isolates lines five
+ through 16 as license text.
+ The second line refers to a file in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>.
+ </para>
+
+ <para>
+ Note that <filename>LIC_FILES_CHKSUM</filename> variable is
+ mandatory for all recipes, unless the
+ <filename>LICENSE</filename> variable is set to "CLOSED".
+ </para>
+ </section>
+
+ <section id="usingpoky-LIC_FILES_CHKSUM-explanation-of-syntax">
+ <title>Explanation of Syntax</title>
+
+ <para>
+ As mentioned in the previous section, the
+ <filename>LIC_FILES_CHKSUM</filename> variable lists all
+ the important files that contain the license text for the
+ source code.
+ It is possible to specify a checksum for an entire file,
+ or a specific section of a file (specified by beginning and
+ ending line numbers with the "beginline" and "endline"
+ parameters, respectively).
+ The latter is useful for source files with a license
+ notice header, README documents, and so forth.
+ If you do not use the "beginline" parameter, then it is
+ assumed that the text begins on the first line of the file.
+ Similarly, if you do not use the "endline" parameter,
+ it is assumed that the license text ends with the last
+ line of the file.
+ </para>
+
+ <para>
+ The "md5" parameter stores the md5 checksum of the license
+ text.
+ If the license text changes in any way as compared to
+ this parameter then a mismatch occurs.
+ This mismatch triggers a build failure and notifies
+ the developer.
+ Notification allows the developer to review and address
+ the license text changes.
+ Also note that if a mismatch occurs during the build,
+ the correct md5 checksum is placed in the build log and
+ can be easily copied to the recipe.
+ </para>
+
+ <para>
+ There is no limit to how many files you can specify using
+ the <filename>LIC_FILES_CHKSUM</filename> variable.
+ Generally, however, every project requires a few
+ specifications for license tracking.
+ Many projects have a "COPYING" file that stores the
+ license information for all the source code files.
+ This practice allows you to just track the "COPYING"
+ file as long as it is kept up to date.
+ <note><title>Tips</title>
+ <itemizedlist>
+ <listitem><para>
+ If you specify an empty or invalid "md5"
+ parameter,
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ returns an md5 mis-match
+ error and displays the correct "md5" parameter
+ value during the build.
+ The correct parameter is also captured in
+ the build log.
+ </para></listitem>
+ <listitem><para>
+ If the whole file contains only license text,
+ you do not need to use the "beginline" and
+ "endline" parameters.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </section>
+ </section>
+
+ <section id="enabling-commercially-licensed-recipes">
+ <title>Enabling Commercially Licensed Recipes</title>
+
+ <para>
+ By default, the OpenEmbedded build system disables
+ components that have commercial or other special licensing
+ requirements.
+ Such requirements are defined on a
+ recipe-by-recipe basis through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></ulink>
+ variable definition in the affected recipe.
+ For instance, the
+ <filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
+ recipe contains the following statement:
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS = "commercial"
+ </literallayout>
+ Here is a slightly more complicated example that contains both
+ an explicit recipe name and version (after variable expansion):
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS = "license_${PN}_${PV}"
+ </literallayout>
+ In order for a component restricted by a
+ <filename>LICENSE_FLAGS</filename> definition to be enabled and
+ included in an image, it needs to have a matching entry in the
+ global
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></ulink>
+ variable, which is a variable typically defined in your
+ <filename>local.conf</filename> file.
+ For example, to enable the
+ <filename>poky/meta/recipes-multimedia/gstreamer/gst-plugins-ugly</filename>
+ package, you could add either the string
+ "commercial_gst-plugins-ugly" or the more general string
+ "commercial" to <filename>LICENSE_FLAGS_WHITELIST</filename>.
+ See the
+ "<link linkend='license-flag-matching'>License Flag Matching</link>"
+ section for a full
+ explanation of how <filename>LICENSE_FLAGS</filename> matching
+ works.
+ Here is the example:
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly"
+ </literallayout>
+ Likewise, to additionally enable the package built from the
+ recipe containing
+ <filename>LICENSE_FLAGS = "license_${PN}_${PV}"</filename>,
+ and assuming that the actual recipe name was
+ <filename>emgd_1.10.bb</filename>, the following string would
+ enable that package as well as the original
+ <filename>gst-plugins-ugly</filename> package:
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly license_emgd_1.10"
+ </literallayout>
+ As a convenience, you do not need to specify the complete
+ license string in the whitelist for every package.
+ You can use an abbreviated form, which consists
+ of just the first portion or portions of the license
+ string before the initial underscore character or characters.
+ A partial string will match any license that contains the
+ given string as the first portion of its license.
+ For example, the following whitelist string will also match
+ both of the packages previously mentioned as well as any other
+ packages that have licenses starting with "commercial" or
+ "license".
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS_WHITELIST = "commercial license"
+ </literallayout>
+ </para>
+
+ <section id="license-flag-matching">
+ <title>License Flag Matching</title>
+
+ <para>
+ License flag matching allows you to control what recipes
+ the OpenEmbedded build system includes in the build.
+ Fundamentally, the build system attempts to match
+ <filename>LICENSE_FLAGS</filename> strings found in recipes
+ against <filename>LICENSE_FLAGS_WHITELIST</filename>
+ strings found in the whitelist.
+ A match causes the build system to include a recipe in the
+ build, while failure to find a match causes the build
+ system to exclude a recipe.
+ </para>
+
+ <para>
+ In general, license flag matching is simple.
+ However, understanding some concepts will help you
+ correctly and effectively use matching.
+ </para>
+
+ <para>
+ Before a flag
+ defined by a particular recipe is tested against the
+ contents of the whitelist, the expanded string
+ <filename>_${PN}</filename> is appended to the flag.
+ This expansion makes each
+ <filename>LICENSE_FLAGS</filename> value recipe-specific.
+ After expansion, the string is then matched against the
+ whitelist.
+ Thus, specifying
+ <filename>LICENSE_FLAGS = "commercial"</filename>
+ in recipe "foo", for example, results in the string
+ <filename>"commercial_foo"</filename>.
+ And, to create a match, that string must appear in the
+ whitelist.
+ </para>
+
+ <para>
+ Judicious use of the <filename>LICENSE_FLAGS</filename>
+ strings and the contents of the
+ <filename>LICENSE_FLAGS_WHITELIST</filename> variable
+ allows you a lot of flexibility for including or excluding
+ recipes based on licensing.
+ For example, you can broaden the matching capabilities by
+ using license flags string subsets in the whitelist.
+ <note>
+ When using a string subset, be sure to use the part of
+ the expanded string that precedes the appended
+ underscore character (e.g.
+ <filename>usethispart_1.3</filename>,
+ <filename>usethispart_1.4</filename>, and so forth).
+ </note>
+ For example, simply specifying the string "commercial" in
+ the whitelist matches any expanded
+ <filename>LICENSE_FLAGS</filename> definition that starts
+ with the string "commercial" such as "commercial_foo" and
+ "commercial_bar", which are the strings the build system
+ automatically generates for hypothetical recipes named
+ "foo" and "bar" assuming those recipes simply specify the
+ following:
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS = "commercial"
+ </literallayout>
+ Thus, you can choose to exhaustively
+ enumerate each license flag in the whitelist and
+ allow only specific recipes into the image, or
+ you can use a string subset that causes a broader range of
+ matches to allow a range of recipes into the image.
+ </para>
+
+ <para>
+ This scheme works even if the
+ <filename>LICENSE_FLAGS</filename> string already
+ has <filename>_${PN}</filename> appended.
+ For example, the build system turns the license flag
+ "commercial_1.2_foo" into "commercial_1.2_foo_foo" and
+ would match both the general "commercial" and the specific
+ "commercial_1.2_foo" strings found in the whitelist, as
+ expected.
+ </para>
+
+ <para>
+ Here are some other scenarios:
+ <itemizedlist>
+ <listitem><para>
+ You can specify a versioned string in the recipe
+ such as "commercial_foo_1.2" in a "foo" recipe.
+ The build system expands this string to
+ "commercial_foo_1.2_foo".
+ Combine this license flag with a whitelist that has
+ the string "commercial" and you match the flag
+ along with any other flag that starts with the
+ string "commercial".
+ </para></listitem>
+ <listitem><para>
+ Under the same circumstances, you can use
+ "commercial_foo" in the whitelist and the build
+ system not only matches "commercial_foo_1.2" but
+ also matches any license flag with the string
+ "commercial_foo", regardless of the version.
+ </para></listitem>
+ <listitem><para>
+ You can be very specific and use both the
+ package and version parts in the whitelist (e.g.
+ "commercial_foo_1.2") to specifically match a
+ versioned recipe.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="other-variables-related-to-commercial-licenses">
+ <title>Other Variables Related to Commercial Licenses</title>
+
+ <para>
+ Other helpful variables related to commercial
+ license handling exist and are defined in the
+ <filename>poky/meta/conf/distro/include/default-distrovars.inc</filename> file:
+ <literallayout class='monospaced'>
+ COMMERCIAL_AUDIO_PLUGINS ?= ""
+ COMMERCIAL_VIDEO_PLUGINS ?= ""
+ </literallayout>
+ If you want to enable these components, you can do so by
+ making sure you have statements similar to the following
+ in your <filename>local.conf</filename> configuration file:
+ <literallayout class='monospaced'>
+ COMMERCIAL_AUDIO_PLUGINS = "gst-plugins-ugly-mad \
+ gst-plugins-ugly-mpegaudioparse"
+ COMMERCIAL_VIDEO_PLUGINS = "gst-plugins-ugly-mpeg2dec \
+ gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse"
+ LICENSE_FLAGS_WHITELIST = "commercial_gst-plugins-ugly commercial_gst-plugins-bad commercial_qmmp"
+ </literallayout>
+ Of course, you could also create a matching whitelist
+ for those components using the more general "commercial"
+ in the whitelist, but that would also enable all the
+ other packages with <filename>LICENSE_FLAGS</filename>
+ containing "commercial", which you may or may not want:
+ <literallayout class='monospaced'>
+ LICENSE_FLAGS_WHITELIST = "commercial"
+ </literallayout>
+ </para>
+
+ <para>
+ Specifying audio and video plug-ins as part of the
+ <filename>COMMERCIAL_AUDIO_PLUGINS</filename> and
+ <filename>COMMERCIAL_VIDEO_PLUGINS</filename> statements
+ (along with the enabling
+ <filename>LICENSE_FLAGS_WHITELIST</filename>) includes the
+ plug-ins or components into built images, thus adding
+ support for media formats or components.
+ </para>
+ </section>
+ </section>
+
+ <section id='maintaining-open-source-license-compliance-during-your-products-lifecycle'>
+ <title>Maintaining Open Source License Compliance During Your Product's Lifecycle</title>
+
+ <para>
+ One of the concerns for a development organization using open source
+ software is how to maintain compliance with various open source
+ licensing during the lifecycle of the product.
+ While this section does not provide legal advice or
+ comprehensively cover all scenarios, it does
+ present methods that you can use to
+ assist you in meeting the compliance requirements during a software
+ release.
+ </para>
+
+ <para>
+ With hundreds of different open source licenses that the Yocto
+ Project tracks, it is difficult to know the requirements of each
+ and every license.
+ However, the requirements of the major FLOSS licenses can begin
+ to be covered by
+ assuming that three main areas of concern exist:
+ <itemizedlist>
+ <listitem><para>Source code must be provided.</para></listitem>
+ <listitem><para>License text for the software must be
+ provided.</para></listitem>
+ <listitem><para>Compilation scripts and modifications to the
+ source code must be provided.
+ </para></listitem>
+ </itemizedlist>
+ There are other requirements beyond the scope of these
+ three and the methods described in this section
+ (e.g. the mechanism through which source code is distributed).
+ </para>
+
+ <para>
+ As different organizations have different methods of complying with
+ open source licensing, this section is not meant to imply that
+ there is only one single way to meet your compliance obligations,
+ but rather to describe one method of achieving compliance.
+ The remainder of this section describes methods supported to meet the
+ previously mentioned three requirements.
+ Once you take steps to meet these requirements,
+ and prior to releasing images, sources, and the build system,
+ you should audit all artifacts to ensure completeness.
+ <note>
+ The Yocto Project generates a license manifest during
+ image creation that is located
+ in <filename>${DEPLOY_DIR}/licenses/<replaceable>image_name-datestamp</replaceable></filename>
+ to assist with any audits.
+ </note>
+ </para>
+
+ <section id='providing-the-source-code'>
+ <title>Providing the Source Code</title>
+
+ <para>
+ Compliance activities should begin before you generate the
+ final image.
+ The first thing you should look at is the requirement that
+ tops the list for most compliance groups - providing
+ the source.
+ The Yocto Project has a few ways of meeting this
+ requirement.
+ </para>
+
+ <para>
+ One of the easiest ways to meet this requirement is
+ to provide the entire
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ used by the build.
+ This method, however, has a few issues.
+ The most obvious is the size of the directory since it includes
+ all sources used in the build and not just the source used in
+ the released image.
+ It will include toolchain source, and other artifacts, which
+ you would not generally release.
+ However, the more serious issue for most companies is accidental
+ release of proprietary software.
+ The Yocto Project provides an
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-archiver'><filename>archiver</filename></ulink>
+ class to help avoid some of these concerns.
+ </para>
+
+ <para>
+ Before you employ <filename>DL_DIR</filename> or the
+ <filename>archiver</filename> class, you need to decide how
+ you choose to provide source.
+ The source <filename>archiver</filename> class can generate
+ tarballs and SRPMs and can create them with various levels of
+ compliance in mind.
+ </para>
+
+ <para>
+ One way of doing this (but certainly not the only way) is to
+ release just the source as a tarball.
+ You can do this by adding the following to the
+ <filename>local.conf</filename> file found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
+ <literallayout class='monospaced'>
+ INHERIT += "archiver"
+ ARCHIVER_MODE[src] = "original"
+ </literallayout>
+ During the creation of your image, the source from all
+ recipes that deploy packages to the image is placed within
+ subdirectories of
+ <filename>DEPLOY_DIR/sources</filename> based on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
+ for each recipe.
+ Releasing the entire directory enables you to comply with
+ requirements concerning providing the unmodified source.
+ It is important to note that the size of the directory can
+ get large.
+ </para>
+
+ <para>
+ A way to help mitigate the size issue is to only release
+ tarballs for licenses that require the release of
+ source.
+ Let us assume you are only concerned with GPL code as
+ identified by running the following script:
+ <literallayout class='monospaced'>
+ # Script to archive a subset of packages matching specific license(s)
+ # Source and license files are copied into sub folders of package folder
+ # Must be run from build folder
+ #!/bin/bash
+ src_release_dir="source-release"
+ mkdir -p $src_release_dir
+ for a in tmp/deploy/sources/*; do
+ for d in $a/*; do
+ # Get package name from path
+ p=`basename $d`
+ p=${p%-*}
+ p=${p%-*}
+ # Only archive GPL packages (update *GPL* regex for your license check)
+ numfiles=`ls tmp/deploy/licenses/$p/*GPL* 2> /dev/null | wc -l`
+ if [ $numfiles -gt 1 ]; then
+ echo Archiving $p
+ mkdir -p $src_release_dir/$p/source
+ cp $d/* $src_release_dir/$p/source 2> /dev/null
+ mkdir -p $src_release_dir/$p/license
+ cp tmp/deploy/licenses/$p/* $src_release_dir/$p/license 2> /dev/null
+ fi
+ done
+ done
+ </literallayout>
+ At this point, you could create a tarball from the
+ <filename>gpl_source_release</filename> directory and
+ provide that to the end user.
+ This method would be a step toward achieving compliance
+ with section 3a of GPLv2 and with section 6 of GPLv3.
+ </para>
+ </section>
+
+ <section id='providing-license-text'>
+ <title>Providing License Text</title>
+
+ <para>
+ One requirement that is often overlooked is inclusion
+ of license text.
+ This requirement also needs to be dealt with prior to
+ generating the final image.
+ Some licenses require the license text to accompany
+ the binary.
+ You can achieve this by adding the following to your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ COPY_LIC_MANIFEST = "1"
+ COPY_LIC_DIRS = "1"
+ LICENSE_CREATE_PACKAGE = "1"
+ </literallayout>
+ Adding these statements to the configuration file ensures
+ that the licenses collected during package generation
+ are included on your image.
+ <note>
+ <para>Setting all three variables to "1" results in the
+ image having two copies of the same license file.
+ One copy resides in
+ <filename>/usr/share/common-licenses</filename> and
+ the other resides in
+ <filename>/usr/share/license</filename>.</para>
+
+ <para>The reason for this behavior is because
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></ulink>
+ add a copy of the license when the image is built but do
+ not offer a path for adding licenses for newly installed
+ packages to an image.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></ulink>
+ adds a separate package and an upgrade path for adding
+ licenses to an image.</para>
+ </note>
+ </para>
+
+ <para>
+ As the source <filename>archiver</filename> class has already
+ archived the original
+ unmodified source that contains the license files,
+ you would have already met the requirements for inclusion
+ of the license information with source as defined by the GPL
+ and other open source licenses.
+ </para>
+ </section>
+
+ <section id='providing-compilation-scripts-and-source-code-modifications'>
+ <title>Providing Compilation Scripts and Source Code Modifications</title>
+
+ <para>
+ At this point, we have addressed all we need to
+ prior to generating the image.
+ The next two requirements are addressed during the final
+ packaging of the release.
+ </para>
+
+ <para>
+ By releasing the version of the OpenEmbedded build system
+ and the layers used during the build, you will be providing both
+ compilation scripts and the source code modifications in one
+ step.
+ </para>
+
+ <para>
+ If the deployment team has a
+ <ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP layer</ulink>
+ and a distro layer, and those those layers are used to patch,
+ compile, package, or modify (in any way) any open source
+ software included in your released images, you
+ might be required to release those layers under section 3 of
+ GPLv2 or section 1 of GPLv3.
+ One way of doing that is with a clean
+ checkout of the version of the Yocto Project and layers used
+ during your build.
+ Here is an example:
+ <literallayout class='monospaced'>
+ # We built using the &DISTRO_NAME_NO_CAP; branch of the poky repo
+ $ git clone -b &DISTRO_NAME_NO_CAP; git://git.yoctoproject.org/poky
+ $ cd poky
+ # We built using the release_branch for our layers
+ $ git clone -b release_branch git://git.mycompany.com/meta-my-bsp-layer
+ $ git clone -b release_branch git://git.mycompany.com/meta-my-software-layer
+ # clean up the .git repos
+ $ find . -name ".git" -type d -exec rm -rf {} \;
+ </literallayout>
+ One thing a development organization might want to consider
+ for end-user convenience is to modify
+ <filename>meta-poky/conf/bblayers.conf.sample</filename> to
+ ensure that when the end user utilizes the released build
+ system to build an image, the development organization's
+ layers are included in the <filename>bblayers.conf</filename>
+ file automatically:
+ <literallayout class='monospaced'>
+ # POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
+ # changes incompatibly
+ POKY_BBLAYERS_CONF_VERSION = "2"
+
+ BBPATH = "${TOPDIR}"
+ BBFILES ?= ""
+
+ BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/meta-yocto-bsp \
+ ##OEROOT##/meta-mylayer \
+ "
+ </literallayout>
+ Creating and providing an archive of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ layers (recipes, configuration files, and so forth)
+ enables you to meet your
+ requirements to include the scripts to control compilation
+ as well as any modifications to the original source.
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='using-the-error-reporting-tool'>
+ <title>Using the Error Reporting Tool</title>
+
+ <para>
+ The error reporting tool allows you to
+ submit errors encountered during builds to a central database.
+ Outside of the build environment, you can use a web interface to
+ browse errors, view statistics, and query for errors.
+ The tool works using a client-server system where the client
+ portion is integrated with the installed Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ The server receives the information collected and saves it in a
+ database.
+ </para>
+
+ <para>
+ A live instance of the error reporting server exists at
+ <ulink url='http://errors.yoctoproject.org'></ulink>.
+ This server exists so that when you want to get help with
+ build failures, you can submit all of the information on the
+ failure easily and then point to the URL in your bug report
+ or send an email to the mailing list.
+ <note>
+ If you send error reports to this server, the reports become
+ publicly visible.
+ </note>
+ </para>
+
+ <section id='enabling-and-using-the-tool'>
+ <title>Enabling and Using the Tool</title>
+
+ <para>
+ By default, the error reporting tool is disabled.
+ You can enable it by inheriting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-report-error'><filename>report-error</filename></ulink>
+ class by adding the following statement to the end of
+ your <filename>local.conf</filename> file in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ <literallayout class='monospaced'>
+ INHERIT += "report-error"
+ </literallayout>
+ </para>
+
+ <para>
+ By default, the error reporting feature stores information in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-LOG_DIR'><filename>LOG_DIR</filename></ulink><filename>}/error-report</filename>.
+ However, you can specify a directory to use by adding the following
+ to your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ ERR_REPORT_DIR = "path"
+ </literallayout>
+ Enabling error reporting causes the build process to collect
+ the errors and store them in a file as previously described.
+ When the build system encounters an error, it includes a
+ command as part of the console output.
+ You can run the command to send the error file to the server.
+ For example, the following command sends the errors to an
+ upstream server:
+ <literallayout class='monospaced'>
+ $ send-error-report /home/brandusa/project/poky/build/tmp/log/error-report/error_report_201403141617.txt
+ </literallayout>
+ In the previous example, the errors are sent to a public
+ database available at
+ <ulink url='http://errors.yoctoproject.org'></ulink>, which is
+ used by the entire community.
+ If you specify a particular server, you can send the errors
+ to a different database.
+ Use the following command for more information on available
+ options:
+ <literallayout class='monospaced'>
+ $ send-error-report --help
+ </literallayout>
+ </para>
+
+ <para>
+ When sending the error file, you are prompted to review the
+ data being sent as well as to provide a name and optional
+ email address.
+ Once you satisfy these prompts, the command returns a link
+ from the server that corresponds to your entry in the database.
+ For example, here is a typical link:
+ <literallayout class='monospaced'>
+ http://errors.yoctoproject.org/Errors/Details/9522/
+ </literallayout>
+ Following the link takes you to a web interface where you can
+ browse, query the errors, and view statistics.
+ </para>
+ </section>
+
+ <section id='disabling-the-tool'>
+ <title>Disabling the Tool</title>
+
+ <para>
+ To disable the error reporting feature, simply remove or comment
+ out the following statement from the end of your
+ <filename>local.conf</filename> file in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ <literallayout class='monospaced'>
+ INHERIT += "report-error"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-up-your-own-error-reporting-server'>
+ <title>Setting Up Your Own Error Reporting Server</title>
+
+ <para>
+ If you want to set up your own error reporting server, you
+ can obtain the code from the Git repository at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/'></ulink>.
+ Instructions on how to set it up are in the README document.
+ </para>
+ </section>
+ </section>
+
+ <section id="dev-using-wayland-and-weston">
+ <title>Using Wayland and Weston</title>
+
+ <para>
+ <ulink url='http://en.wikipedia.org/wiki/Wayland_(display_server_protocol)'>Wayland</ulink>
+ is a computer display server protocol that
+ provides a method for compositing window managers to communicate
+ directly with applications and video hardware and expects them to
+ communicate with input hardware using other libraries.
+ Using Wayland with supporting targets can result in better control
+ over graphics frame rendering than an application might otherwise
+ achieve.
+ </para>
+
+ <para>
+ The Yocto Project provides the Wayland protocol libraries and the
+ reference
+ <ulink url='http://en.wikipedia.org/wiki/Wayland_(display_server_protocol)#Weston'>Weston</ulink>
+ compositor as part of its release.
+ You can find the integrated packages in the
+ <filename>meta</filename> layer of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ Specifically, you can find the recipes that build both Wayland
+ and Weston at <filename>meta/recipes-graphics/wayland</filename>.
+ </para>
+
+ <para>
+ You can build both the Wayland and Weston packages for use only
+ with targets that accept the
+ <ulink url='https://en.wikipedia.org/wiki/Mesa_(computer_graphics)'>Mesa 3D and Direct Rendering Infrastructure</ulink>,
+ which is also known as Mesa DRI.
+ This implies that you cannot build and use the packages if your
+ target uses, for example, the
+ <trademark class='registered'>Intel</trademark> Embedded Media
+ and Graphics Driver
+ (<trademark class='registered'>Intel</trademark> EMGD) that
+ overrides Mesa DRI.
+ <note>
+ Due to lack of EGL support, Weston 1.0.3 will not run
+ directly on the emulated QEMU hardware.
+ However, this version of Weston will run under X emulation
+ without issues.
+ </note>
+ </para>
+
+ <para>
+ This section describes what you need to do to implement Wayland and
+ use the Weston compositor when building an image for a supporting
+ target.
+ </para>
+
+ <section id="enabling-wayland-in-an-image">
+ <title>Enabling Wayland in an Image</title>
+
+ <para>
+ To enable Wayland, you need to enable it to be built and enable
+ it to be included (installed) in the image.
+ </para>
+
+ <section id="enable-building">
+ <title>Building</title>
+
+ <para>
+ To cause Mesa to build the <filename>wayland-egl</filename>
+ platform and Weston to build Wayland with Kernel Mode
+ Setting
+ (<ulink url='https://wiki.archlinux.org/index.php/Kernel_Mode_Setting'>KMS</ulink>)
+ support, include the "wayland" flag in the
+ <ulink url="&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES"><filename>DISTRO_FEATURES</filename></ulink>
+ statement in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " wayland"
+ </literallayout>
+ <note>
+ If X11 has been enabled elsewhere, Weston will build
+ Wayland with X11 support
+ </note>
+ </para>
+ </section>
+
+ <section id="enable-installation-in-an-image">
+ <title>Installing</title>
+
+ <para>
+ To install the Wayland feature into an image, you must
+ include the following
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CORE_IMAGE_EXTRA_INSTALL'><filename>CORE_IMAGE_EXTRA_INSTALL</filename></ulink>
+ statement in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ CORE_IMAGE_EXTRA_INSTALL += "wayland weston"
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id="running-weston">
+ <title>Running Weston</title>
+
+ <para>
+ To run Weston inside X11, enabling it as described earlier and
+ building a Sato image is sufficient.
+ If you are running your image under Sato, a Weston Launcher
+ appears in the "Utility" category.
+ </para>
+
+ <para>
+ Alternatively, you can run Weston through the command-line
+ interpretor (CLI), which is better suited for development work.
+ To run Weston under the CLI, you need to do the following after
+ your image is built:
+ <orderedlist>
+ <listitem><para>
+ Run these commands to export
+ <filename>XDG_RUNTIME_DIR</filename>:
+ <literallayout class='monospaced'>
+ mkdir -p /tmp/$USER-weston
+ chmod 0700 /tmp/$USER-weston
+ export XDG_RUNTIME_DIR=/tmp/$USER-weston
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Launch Weston in the shell:
+ <literallayout class='monospaced'>
+ weston
+ </literallayout></para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+</chapter>
+
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/dev-manual/dev-manual-customization.xsl b/poky/documentation/dev-manual/dev-manual-customization.xsl
new file mode 100644
index 000000000..523ea3c5e
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-customization.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'dev-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl b/poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..6d7b5fbb6
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/dev-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/dev-manual/dev-manual-intro.xml b/poky/documentation/dev-manual/dev-manual-intro.xml
new file mode 100644
index 000000000..f457c8033
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-intro.xml
@@ -0,0 +1,103 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='dev-manual-intro'>
+
+<title>The Yocto Project Development Tasks Manual</title>
+ <section id='dev-welcome'>
+ <title>Welcome</title>
+
+ <para>
+ Welcome to the Yocto Project Development Tasks Manual!
+ This manual provides relevant procedures necessary for developing
+ in the Yocto Project environment (i.e. developing embedded Linux
+ images and user-space applications that run on targeted devices).
+ The manual groups related procedures into higher-level sections.
+ Procedures can consist of high-level steps or low-level steps
+ depending on the topic.
+ </para>
+
+ <para>
+ The following list describes what you can get from this manual:
+ <itemizedlist>
+ <listitem><para>
+ Procedures that help you get going with the Yocto Project.
+ For example, procedures that show you how to set up
+ a build host and work with the Yocto Project
+ source repositories.
+ </para></listitem>
+ <listitem><para>
+ Procedures that show you how to submit changes to the
+ Yocto Project.
+ Changes can be improvements, new features, or bug
+ fixes.
+ </para></listitem>
+ <listitem><para>
+ Procedures related to "everyday" tasks you perform while
+ developing images and applications using the Yocto
+ Project.
+ For example, procedures to create a layer, customize an
+ image, write a new recipe, and so forth.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This manual will not give you the following:
+ <itemizedlist>
+ <listitem><para>
+ Redundant Step-by-step Instructions:
+ For example, the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual contains detailed instructions on how to install an
+ SDK, which is used to develop applications for target
+ hardware.
+ </para></listitem>
+ <listitem><para>
+ Reference or Conceptual Material:
+ This type of material resides in an appropriate reference
+ manual.
+ For example, system variables are documented in the
+ <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Detailed Public Information Not Specific to the
+ Yocto Project:
+ For example, exhaustive information on how to use the
+ Source Control Manager Git is better covered with Internet
+ searches and official Git Documentation than through the
+ Yocto Project documentation.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='other-information'>
+ <title>Other Information</title>
+
+ <para>
+ Because this manual presents information for many different
+ topics, supplemental information is recommended for full
+ comprehension.
+ For introductory information on the Yocto Project, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
+ If you want to build an image with no knowledge of Yocto Project
+ as a way of quickly testing it out, see the
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>
+ document.
+ </para>
+
+ <para>
+ For a comprehensive list of links and other documentation, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/dev-manual/dev-manual-qemu.xml b/poky/documentation/dev-manual/dev-manual-qemu.xml
new file mode 100644
index 000000000..4e7b5de4e
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-qemu.xml
@@ -0,0 +1,687 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='dev-manual-qemu'>
+
+<title>Using the Quick EMUlator (QEMU)</title>
+
+ <para>
+ The Yocto Project uses an implementation of the Quick EMUlator (QEMU)
+ Open Source project as part of the Yocto Project development "tool
+ set".
+ This chapter provides both procedures that show you how to use the
+ Quick EMUlator (QEMU) and other QEMU information helpful for
+ development purposes.
+ </para>
+
+ <section id='qemu-dev-overview'>
+ <title>Overview</title>
+
+ <para>
+ Within the context of the Yocto Project, QEMU is an
+ emulator and virtualization machine that allows you to run a
+ complete image you have built using the Yocto Project as just
+ another task on your build system.
+ QEMU is useful for running and testing images and applications on
+ supported Yocto Project architectures without having actual
+ hardware.
+ Among other things, the Yocto Project uses QEMU to run automated
+ Quality Assurance (QA) tests on final images shipped with each
+ release.
+ <note>
+ This implementation is not the same as QEMU in general.
+ </note>
+ This section provides a brief reference for the Yocto Project
+ implementation of QEMU.
+ </para>
+
+ <para>
+ For official information and documentation on QEMU in general, see
+ the following references:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><ulink url='http://wiki.qemu.org/Main_Page'>QEMU Website</ulink>:</emphasis>
+ The official website for the QEMU Open Source project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><ulink url='http://wiki.qemu.org/Manual'>Documentation</ulink>:</emphasis>
+ The QEMU user manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='qemu-running-qemu'>
+ <title>Running QEMU</title>
+
+ <para>
+ To use QEMU, you need to have QEMU installed and initialized as
+ well as have the proper artifacts (i.e. image files and root
+ filesystems) available.
+ Follow these general steps to run QEMU:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Install QEMU:</emphasis>
+ QEMU is made available with the Yocto Project a number of
+ ways.
+ One method is to install a Software Development Kit (SDK).
+ See
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#the-qemu-emulator'>The QEMU Emulator</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual
+ for information on how to install QEMU.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Setting Up the Environment:</emphasis>
+ How you set up the QEMU environment depends on how you
+ installed QEMU:
+ <itemizedlist>
+ <listitem><para>
+ If you cloned the <filename>poky</filename>
+ repository or you downloaded and unpacked a
+ Yocto Project release tarball, you can source
+ the build environment script (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>):
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source oe-init-build-env
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you installed a cross-toolchain, you can
+ run the script that initializes the toolchain.
+ For example, the following commands run the
+ initialization script from the default
+ <filename>poky_sdk</filename> directory:
+ <literallayout class='monospaced'>
+ . ~/poky_sdk/environment-setup-core2-64-poky-linux
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Ensure the Artifacts are in Place:</emphasis>
+ You need to be sure you have a pre-built kernel that
+ will boot in QEMU.
+ You also need the target root filesystem for your target
+ machine’s architecture:
+ <itemizedlist>
+ <listitem><para>
+ If you have previously built an image for QEMU
+ (e.g. <filename>qemux86</filename>,
+ <filename>qemuarm</filename>, and so forth),
+ then the artifacts are in place in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para></listitem>
+ <listitem><para>
+ If you have not built an image, you can go to the
+ <ulink url='&YOCTO_MACHINES_DL_URL;'>machines/qemu</ulink>
+ area and download a pre-built image that matches
+ your architecture and can be run on QEMU.
+ </para></listitem>
+ </itemizedlist></para>
+
+ <para>See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual
+ for information on how to extract a root filesystem.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Run QEMU:</emphasis>
+ The basic <filename>runqemu</filename> command syntax is as
+ follows:
+ <literallayout class='monospaced'>
+ $ runqemu [<replaceable>option</replaceable> ] [...]
+ </literallayout>
+ Based on what you provide on the command line,
+ <filename>runqemu</filename> does a good job of figuring
+ out what you are trying to do.
+ For example, by default, QEMU looks for the most recently
+ built image according to the timestamp when it needs to
+ look for an image.
+ Minimally, through the use of options, you must provide
+ either a machine name, a virtual machine image
+ (<filename>*wic.vmdk</filename>), or a kernel image
+ (<filename>*.bin</filename>).</para>
+
+ <para>Here are some additional examples to help illustrate
+ further QEMU:
+ <itemizedlist>
+ <listitem><para>
+ This example starts QEMU with
+ <replaceable>MACHINE</replaceable> set to "qemux86".
+ Assuming a standard
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ <filename>runqemu</filename> automatically finds the
+ <filename>bzImage-qemux86.bin</filename> image file and
+ the
+ <filename>core-image-minimal-qemux86-20140707074611.rootfs.ext3</filename>
+ (assuming the current build created a
+ <filename>core-image-minimal</filename> image).
+ <note>
+ When more than one image with the same name exists, QEMU finds
+ and uses the most recently built image according to the
+ timestamp.
+ </note>
+ <literallayout class='monospaced'>
+ $ runqemu qemux86
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example produces the exact same results as the
+ previous example.
+ This command, however, specifically provides the image
+ and root filesystem type.
+ <literallayout class='monospaced'>
+ $ runqemu qemux86 core-image-minimal ext3
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example specifies to boot an initial RAM disk image
+ and to enable audio in QEMU.
+ For this case, <filename>runqemu</filename> set the
+ internal variable <filename>FSTYPE</filename> to
+ "cpio.gz".
+ Also, for audio to be enabled, an appropriate driver must
+ be installed (see the previous description for the
+ <filename>audio</filename> option for more information).
+ <literallayout class='monospaced'>
+ $ runqemu qemux86 ramfs audio
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example does not provide enough information for
+ QEMU to launch.
+ While the command does provide a root filesystem type, it
+ must also minimally provide a
+ <replaceable>MACHINE</replaceable>,
+ <replaceable>KERNEL</replaceable>, or
+ <replaceable>VM</replaceable> option.
+ <literallayout class='monospaced'>
+ $ runqemu ext3
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ This example specifies to boot a virtual machine
+ image (<filename>.wic.vmdk</filename> file).
+ From the <filename>.wic.vmdk</filename>,
+ <filename>runqemu</filename> determines the QEMU
+ architecture (<replaceable>MACHINE</replaceable>) to be
+ "qemux86" and the root filesystem type to be "vmdk".
+ <literallayout class='monospaced'>
+ $ runqemu /home/scott-lenovo/vm/core-image-minimal-qemux86.wic.vmdk
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='switching-between-consoles'>
+ <title>Switching Between Consoles</title>
+
+ <para>
+ When booting or running QEMU, you can switch between
+ supported consoles by using
+ Ctrl+Alt+<replaceable>number</replaceable>.
+ For example, Ctrl+Alt+3 switches you to the serial console
+ as long as that console is enabled.
+ Being able to switch consoles is helpful, for example, if
+ the main QEMU console breaks for some reason.
+ <note>
+ Usually, "2" gets you to the main console and "3"
+ gets you to the serial console.
+ </note>
+ </para>
+ </section>
+
+ <section id='removing-the-splash-screen'>
+ <title>Removing the Splash Screen</title>
+
+ <para>
+ You can remove the splash screen when QEMU is booting by
+ using Alt+left.
+ Removing the splash screen allows you to see what is
+ happening in the background.
+ </para>
+ </section>
+
+ <section id='disabling-the-cursor-grab'>
+ <title>Disabling the Cursor Grab</title>
+
+ <para>
+ The default QEMU integration captures the cursor within the
+ main window.
+ It does this since standard mouse devices only provide
+ relative input and not absolute coordinates.
+ You then have to break out of the grab using the "Ctrl+Alt"
+ key combination.
+ However, the Yocto Project's integration of QEMU enables
+ the wacom USB touch pad driver by default to allow input
+ of absolute coordinates.
+ This default means that the mouse can enter and leave the
+ main window without the grab taking effect leading to a
+ better user experience.
+ </para>
+ </section>
+
+ <section id='qemu-running-under-a-network-file-system-nfs-server'>
+ <title>Running Under a Network File System (NFS) Server</title>
+
+ <para>
+ One method for running QEMU is to run it on an NFS server.
+ This is useful when you need to access the same file system
+ from both the build and the emulated system at the same time.
+ It is also worth noting that the system does not need root
+ privileges to run.
+ It uses a user space NFS server to avoid that.
+ Follow these steps to set up for running QEMU using an NFS
+ server.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Extract a Root Filesystem:</emphasis>
+ Once you are able to run QEMU in your environment, you can
+ use the <filename>runqemu-extract-sdk</filename> script,
+ which is located in the <filename>scripts</filename>
+ directory along with the <filename>runqemu</filename>
+ script.</para>
+
+ <para>The <filename>runqemu-extract-sdk</filename> takes a
+ root filesystem tarball and extracts it into a location
+ that you specify.
+ Here is an example that takes a file system and
+ extracts it to a directory named
+ <filename>test-nfs</filename>:
+ <literallayout class='monospaced'>
+ runqemu-extract-sdk ./tmp/deploy/images/qemux86/core-image-sato-qemux86.tar.bz2 test-nfs
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Start QEMU:</emphasis>
+ Once you have extracted the file system, you can run
+ <filename>runqemu</filename> normally with the additional
+ location of the file system.
+ You can then also make changes to the files within
+ <filename>./test-nfs</filename> and see those changes
+ appear in the image in real time.
+ Here is an example using the <filename>qemux86</filename>
+ image:
+ <literallayout class='monospaced'>
+ runqemu qemux86 ./test-nfs
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ <note>
+ <para>
+ Should you need to start, stop, or restart the NFS share,
+ you can use the following commands:
+ <itemizedlist>
+ <listitem><para>
+ The following command starts the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs start <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The following command stops the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs stop <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The following command restarts the NFS share:
+ <literallayout class='monospaced'>
+ runqemu-export-rootfs restart <replaceable>file-system-location</replaceable>
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </note>
+ </para>
+ </section>
+
+ <section id='qemu-kvm-cpu-compatibility'>
+ <title>QEMU CPU Compatibility Under KVM</title>
+
+ <para>
+ By default, the QEMU build compiles for and targets 64-bit and x86
+ <trademark class='registered'>Intel</trademark> <trademark class='trademark'>Core</trademark>2
+ Duo processors and 32-bit x86
+ <trademark class='registered'>Intel</trademark> <trademark class='registered'>Pentium</trademark>
+ II processors.
+ QEMU builds for and targets these CPU types because they display
+ a broad range of CPU feature compatibility with many commonly
+ used CPUs.
+ </para>
+
+ <para>
+ Despite this broad range of compatibility, the CPUs could support
+ a feature that your host CPU does not support.
+ Although this situation is not a problem when QEMU uses software
+ emulation of the feature, it can be a problem when QEMU is
+ running with KVM enabled.
+ Specifically, software compiled with a certain CPU feature crashes
+ when run on a CPU under KVM that does not support that feature.
+ To work around this problem, you can override QEMU's runtime CPU
+ setting by changing the <filename>QB_CPU_KVM</filename>
+ variable in <filename>qemuboot.conf</filename> in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory's</ulink>
+ <filename>deploy/image</filename> directory.
+ This setting specifies a <filename>-cpu</filename> option
+ passed into QEMU in the <filename>runqemu</filename> script.
+ Running <filename>qemu -cpu help</filename> returns a list of
+ available supported CPU types.
+ </para>
+ </section>
+
+ <section id='qemu-dev-performance'>
+ <title>QEMU Performance</title>
+
+ <para>
+ Using QEMU to emulate your hardware can result in speed issues
+ depending on the target and host architecture mix.
+ For example, using the <filename>qemux86</filename> image in the
+ emulator on an Intel-based 32-bit (x86) host machine is fast
+ because the target and host architectures match.
+ On the other hand, using the <filename>qemuarm</filename> image
+ on the same Intel-based host can be slower.
+ But, you still achieve faithful emulation of ARM-specific issues.
+ </para>
+
+ <para>
+ To speed things up, the QEMU images support using
+ <filename>distcc</filename> to call a cross-compiler outside the
+ emulated system.
+ If you used <filename>runqemu</filename> to start QEMU, and the
+ <filename>distccd</filename> application is present on the host
+ system, any BitBake cross-compiling toolchain available from the
+ build system is automatically used from within QEMU simply by
+ calling <filename>distcc</filename>.
+ You can accomplish this by defining the cross-compiler variable
+ (e.g. <filename>export CC="distcc"</filename>).
+ Alternatively, if you are using a suitable SDK image or the
+ appropriate stand-alone toolchain is present, the toolchain is
+ also automatically used.
+ <note>
+ Several mechanisms exist that let you connect to the system
+ running on the QEMU emulator:
+ <itemizedlist>
+ <listitem><para>
+ QEMU provides a framebuffer interface that makes
+ standard consoles available.
+ </para></listitem>
+ <listitem><para>
+ Generally, headless embedded devices have a serial port.
+ If so, you can configure the operating system of the
+ running image to use that port to run a console.
+ The connection uses standard IP networking.
+ </para></listitem>
+ <listitem><para>
+ SSH servers exist in some QEMU images.
+ The <filename>core-image-sato</filename> QEMU image
+ has a Dropbear secure shell (SSH) server that runs
+ with the root password disabled.
+ The <filename>core-image-full-cmdline</filename> and
+ <filename>core-image-lsb</filename> QEMU images
+ have OpenSSH instead of Dropbear.
+ Including these SSH servers allow you to use standard
+ <filename>ssh</filename> and <filename>scp</filename>
+ commands.
+ The <filename>core-image-minimal</filename> QEMU image,
+ however, contains no SSH server.
+ </para></listitem>
+ <listitem><para>
+ You can use a provided, user-space NFS server to boot
+ the QEMU session using a local copy of the root
+ filesystem on the host.
+ In order to make this connection, you must extract a
+ root filesystem tarball by using the
+ <filename>runqemu-extract-sdk</filename> command.
+ After running the command, you must then point the
+ <filename>runqemu</filename>
+ script to the extracted directory instead of a root
+ filesystem image file.
+ See the
+ "<link linkend='qemu-running-under-a-network-file-system-nfs-server'>Running Under a Network File System (NFS) Server</link>"
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </section>
+
+ <section id='qemu-dev-command-line-syntax'>
+ <title>QEMU Command-Line Syntax</title>
+
+ <para>
+ The basic <filename>runqemu</filename> command syntax is as
+ follows:
+ <literallayout class='monospaced'>
+ $ runqemu [<replaceable>option</replaceable> ] [...]
+ </literallayout>
+ Based on what you provide on the command line,
+ <filename>runqemu</filename> does a good job of figuring out what
+ you are trying to do.
+ For example, by default, QEMU looks for the most recently built
+ image according to the timestamp when it needs to look for an
+ image.
+ Minimally, through the use of options, you must provide either
+ a machine name, a virtual machine image
+ (<filename>*wic.vmdk</filename>), or a kernel image
+ (<filename>*.bin</filename>).
+ </para>
+
+ <para>
+ Following is the command-line help output for the
+ <filename>runqemu</filename> command:
+ <literallayout class='monospaced'>
+ $ runqemu --help
+
+ Usage: you can run this script with any valid combination
+ of the following environment variables (in any order):
+ KERNEL - the kernel image file to use
+ ROOTFS - the rootfs image file or nfsroot directory to use
+ MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
+ Simplified QEMU command-line options can be passed with:
+ nographic - disable video console
+ serial - enable a serial console on /dev/ttyS0
+ slirp - enable user networking, no root privileges is required
+ kvm - enable KVM when running x86/x86_64 (VT-capable CPU required)
+ kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
+ publicvnc - enable a VNC server open to all hosts
+ audio - enable audio
+ [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
+ tcpserial=&lt;port&gt; - specify tcp serial port number
+ biosdir=&lt;dir&gt; - specify custom bios dir
+ biosfilename=&lt;filename&gt; - specify bios filename
+ qemuparams=&lt;xyz&gt; - specify custom parameters to QEMU
+ bootparams=&lt;xyz&gt; - specify custom kernel parameters during boot
+ help, -h, --help: print this text
+
+ Examples:
+ runqemu
+ runqemu qemuarm
+ runqemu tmp/deploy/images/qemuarm
+ runqemu tmp/deploy/images/qemux86/&lt;qemuboot.conf&gt;
+ runqemu qemux86-64 core-image-sato ext4
+ runqemu qemux86-64 wic-image-minimal wic
+ runqemu path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
+ runqemu qemux86 iso/hddimg/wic.vmdk/wic.qcow2/wic.vdi/ramfs/cpio.gz...
+ runqemu qemux86 qemuparams="-m 256"
+ runqemu qemux86 bootparams="psplash=false"
+ runqemu path/to/&lt;image&gt;-&lt;machine&gt;.wic
+ runqemu path/to/&lt;image&gt;-&lt;machine&gt;.wic.vmdk
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='qemu-dev-runqemu-command-line-options'>
+ <title><filename>runqemu</filename> Command-Line Options</title>
+
+ <para>
+ Following is a description of <filename>runqemu</filename>
+ options you can provide on the command line:
+ <note><title>Tip</title>
+ If you do provide some "illegal" option combination or perhaps
+ you do not provide enough in the way of options,
+ <filename>runqemu</filename> provides appropriate error
+ messaging to help you correct the problem.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <replaceable>QEMUARCH</replaceable>:
+ The QEMU machine architecture, which must be "qemuarm",
+ "qemuarm64", "qemumips", "qemumips64", "qemuppc",
+ "qemux86", or "qemux86-64".
+ </para></listitem>
+ <listitem><para>
+ <filename><replaceable>VM</replaceable></filename>:
+ The virtual machine image, which must be a
+ <filename>.wic.vmdk</filename> file.
+ Use this option when you want to boot a
+ <filename>.wic.vmdk</filename> image.
+ The image filename you provide must contain one of the
+ following strings: "qemux86-64", "qemux86", "qemuarm",
+ "qemumips64", "qemumips", "qemuppc", or "qemush4".
+ </para></listitem>
+ <listitem><para>
+ <replaceable>ROOTFS</replaceable>:
+ A root filesystem that has one of the following
+ filetype extensions: "ext2", "ext3", "ext4", "jffs2",
+ "nfs", or "btrfs".
+ If the filename you provide for this option uses “nfsâ€, it
+ must provide an explicit root filesystem path.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>KERNEL</replaceable>:
+ A kernel image, which is a <filename>.bin</filename> file.
+ When you provide a <filename>.bin</filename> file,
+ <filename>runqemu</filename> detects it and assumes the
+ file is a kernel image.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>MACHINE</replaceable>:
+ The architecture of the QEMU machine, which must be one
+ of the following: "qemux86", "qemux86-64", "qemuarm",
+ "qemuarm64", "qemumips", “qemumips64", or "qemuppc".
+ The <replaceable>MACHINE</replaceable> and
+ <replaceable>QEMUARCH</replaceable> options are basically
+ identical.
+ If you do not provide a <replaceable>MACHINE</replaceable>
+ option, <filename>runqemu</filename> tries to determine
+ it based on other options.
+ </para></listitem>
+ <listitem><para>
+ <filename>ramfs</filename>:
+ Indicates you are booting an initial RAM disk (initramfs)
+ image, which means the <filename>FSTYPE</filename> is
+ <filename>cpio.gz</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>iso</filename>:
+ Indicates you are booting an ISO image, which means the
+ <filename>FSTYPE</filename> is
+ <filename>.iso</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>nographic</filename>:
+ Disables the video console, which sets the console to
+ "ttys0".
+ </para></listitem>
+ <listitem><para>
+ <filename>serial</filename>:
+ Enables a serial console on
+ <filename>/dev/ttyS0</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>biosdir</filename>:
+ Establishes a custom directory for BIOS, VGA BIOS and
+ keymaps.
+ </para></listitem>
+ <listitem><para>
+ <filename>biosfilename</filename>:
+ Establishes a custom BIOS name.
+ </para></listitem>
+ <listitem><para>
+ <filename>qemuparams=\"<replaceable>xyz</replaceable>\"</filename>:
+ Specifies custom QEMU parameters.
+ Use this option to pass options other than the simple
+ "kvm" and "serial" options.
+ </para></listitem>
+ <listitem><para><filename>bootparams=\"<replaceable>xyz</replaceable>\"</filename>:
+ Specifies custom boot parameters for the kernel.
+ </para></listitem>
+ <listitem><para>
+ <filename>audio</filename>:
+ Enables audio in QEMU.
+ The <replaceable>MACHINE</replaceable> option must be
+ either "qemux86" or "qemux86-64" in order for audio to be
+ enabled.
+ Additionally, the <filename>snd_intel8x0</filename>
+ or <filename>snd_ens1370</filename> driver must be
+ installed in linux guest.
+ </para></listitem>
+ <listitem><para>
+ <filename>slirp</filename>:
+ Enables "slirp" networking, which is a different way
+ of networking that does not need root access
+ but also is not as easy to use or comprehensive
+ as the default.
+ </para></listitem>
+ <listitem><para id='kvm-cond'>
+ <filename>kvm</filename>:
+ Enables KVM when running "qemux86" or "qemux86-64"
+ QEMU architectures.
+ For KVM to work, all the following conditions must be met:
+ <itemizedlist>
+ <listitem><para>
+ Your <replaceable>MACHINE</replaceable> must be either
+qemux86" or "qemux86-64".
+ </para></listitem>
+ <listitem><para>
+ Your build host has to have the KVM modules
+ installed, which are
+ <filename>/dev/kvm</filename>.
+ </para></listitem>
+ <listitem><para>
+ The build host <filename>/dev/kvm</filename>
+ directory has to be both writable and readable.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <filename>kvm-vhost</filename>:
+ Enables KVM with VHOST support when running "qemux86"
+ or "qemux86-64" QEMU architectures.
+ For KVM with VHOST to work, the following conditions must
+ be met:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='kvm-cond'>kvm</link> option
+ conditions must be met.
+ </para></listitem>
+ <listitem><para>
+ Your build host has to have virtio net device, which
+ are <filename>/dev/vhost-net</filename>.
+ </para></listitem>
+ <listitem><para>
+ The build host <filename>/dev/vhost-net</filename>
+ directory has to be either readable or writable
+ and “slirp-enabledâ€.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <filename>publicvnc</filename>:
+ Enables a VNC server open to all hosts.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/dev-manual/dev-manual-start.xml b/poky/documentation/dev-manual/dev-manual-start.xml
new file mode 100644
index 000000000..d8726b485
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual-start.xml
@@ -0,0 +1,1086 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='dev-manual-start'>
+
+<title>Setting Up to Use the Yocto Project</title>
+
+<para>
+ This chapter provides procedures related to getting set up to use the
+ Yocto Project.
+ You can learn about creating a team environment that develops using the
+ Yocto Project, how to set up a build host, how to locate Yocto Project
+ source repositories, and how to create local Git repositories.
+</para>
+
+<section id="usingpoky-changes-collaborate">
+ <title>Creating a Team Development Environment</title>
+
+ <para>
+ It might not be immediately clear how you can use the Yocto
+ Project in a team development environment, or scale it for a large
+ team of developers.
+ One of the strengths of the Yocto Project is that it is extremely
+ flexible.
+ Thus, you can adapt it to many different use cases and scenarios.
+ However, these characteristics can cause a struggle if you are trying
+ to create a working setup that scales across a large team.
+ </para>
+
+ <para>
+ To help you understand how to set up this type of environment,
+ this section presents a procedure that gives you the information
+ to learn how to get the results you want.
+ The procedure is high-level and presents some of the project's most
+ successful experiences, practices, solutions, and available
+ technologies that work well.
+ Keep in mind, the procedure here is a starting point.
+ You can build off it and customize it to fit any
+ particular working environment and set of practices.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Determine Who is Going to be Developing:</emphasis>
+ You need to understand who is going to be doing anything
+ related to the Yocto Project and what their roles would be.
+ Making this determination is essential to completing the
+ steps two and three, which are to get your equipment together
+ and set up your development environment's hardware topology.
+ </para>
+
+ <para>The following roles exist:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Application Development:</emphasis>
+ These types of developers do application level work
+ on top of an existing software stack.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Core System Development:</emphasis>
+ These types of developers work on the contents of the
+ operating system image itself.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build Engineer:</emphasis>
+ This type of developer manages Autobuilders and
+ releases.
+ Not all environments need a Build Engineer.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test Engineer:</emphasis>
+ This type of developer creates and manages automated
+ tests needed to ensure all application and core
+ system development meets desired quality standards.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Gather the Hardware:</emphasis>
+ Based on the size and make-up of the team, get the hardware
+ together.
+ Any development, build, or test engineer should be using
+ a system that is running a supported Linux distribution.
+ Systems, in general, should be high performance (e.g. dual,
+ six-core Xeons with 24 Gbytes of RAM and plenty of disk space).
+ You can help ensure efficiency by having any machines used
+ for testing or that run Autobuilders be as high performance
+ as possible.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Understand the Hardware Topology of the Environment:</emphasis>
+ Once you understand the hardware involved and the make-up
+ of the team, you can understand the hardware topology of the
+ development environment.
+ You can get a visual idea of the machines and their roles
+ across the development environment.
+
+<!--
+ The following figure shows a moderately sized Yocto Project
+ development environment.
+
+ <para role="writernotes">
+ Need figure.</para>
+-->
+
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use Git as Your Source Control Manager (SCM):</emphasis>
+ Keeping your
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ and any software you are developing under the
+ control of an SCM system that is compatible
+ with the OpenEmbedded build system is advisable.
+ Of the SCMs BitBake supports, the
+ Yocto Project team strongly recommends using
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>.
+ Git is a distributed system that is easy to backup,
+ allows you to work remotely, and then connects back to the
+ infrastructure.
+ <note>
+ For information about BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </note></para>
+
+ <para>It is relatively easy to set up Git services and create
+ infrastructure like
+ <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>,
+ which is based on server software called
+ <filename>gitolite</filename> with <filename>cgit</filename>
+ being used to generate the web interface that lets you view the
+ repositories.
+ The <filename>gitolite</filename> software identifies users
+ using SSH keys and allows branch-based
+ access controls to repositories that you can control as little
+ or as much as necessary.
+
+ <note>
+ The setup of these services is beyond the scope of this
+ manual.
+ However, sites such as these exist that describe how to
+ perform setup:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://git-scm.com/book/ch4-8.html'>Git documentation</ulink>:
+ Describes how to install <filename>gitolite</filename>
+ on the server.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://gitolite.com'>Gitolite</ulink>:
+ Information for <filename>gitolite</filename>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools'>Interfaces, frontends, and tools</ulink>:
+ Documentation on how to create interfaces and frontends
+ for Git.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up the Application Development Machines:</emphasis>
+ As mentioned earlier, application developers are creating
+ applications on top of existing software stacks.
+ Following are some best practices for setting up machines
+ that do application development:
+ <itemizedlist>
+ <listitem><para>
+ Use a pre-built toolchain that
+ contains the software stack itself.
+ Then, develop the application code on top of the
+ stack.
+ This method works well for small numbers of relatively
+ isolated applications.
+ </para></listitem>
+ <listitem><para>
+ When possible, use the Yocto Project
+ plug-in for the
+ <trademark class='trade'>Eclipse</trademark> IDE
+ and SDK development practices.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>"
+ manual.
+ </para></listitem>
+ <listitem><para>
+ Keep your cross-development toolchains updated.
+ You can do this through provisioning either as new
+ toolchain downloads or as updates through a package
+ update mechanism using <filename>opkg</filename>
+ to provide updates to an existing toolchain.
+ The exact mechanics of how and when to do this are a
+ question for local policy.
+ </para></listitem>
+ <listitem><para>
+ Use multiple toolchains installed locally
+ into different locations to allow development across
+ versions.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up the Core Development Machines:</emphasis>
+ As mentioned earlier, these types of developers work on the
+ contents of the operating system itself.
+ Following are some best practices for setting up machines
+ used for developing images:
+ <itemizedlist>
+ <listitem><para>
+ Have the Yocto Project build system itself available on
+ the developer workstations so developers can run their own
+ builds and directly rebuild the software stack.
+ </para></listitem>
+ <listitem><para>
+ Keep the core system unchanged as much as
+ possible and do your work in layers on top of the
+ core system.
+ Doing so gives you a greater level of portability when
+ upgrading to new versions of the core system or Board
+ Support Packages (BSPs).
+ </para></listitem>
+ <listitem><para>
+ Share layers amongst the developers of a
+ particular project and contain the policy configuration
+ that defines the project.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up an Autobuilder:</emphasis>
+ Autobuilders are often the core of the development
+ environment.
+ It is here that changes from individual developers are brought
+ together and centrally tested and subsequent decisions about
+ releases can be made.
+ Autobuilders also allow for "continuous integration" style
+ testing of software components and regression identification
+ and tracking.</para>
+
+ <para>See "<ulink url='http://autobuilder.yoctoproject.org'>Yocto Project Autobuilder</ulink>"
+ for more information and links to buildbot.
+ The Yocto Project team has found this implementation
+ works well in this role.
+ A public example of this is the Yocto Project
+ Autobuilders, which we use to test the overall health of the
+ project.</para>
+
+ <para>The features of this system are:
+ <itemizedlist>
+ <listitem><para>
+ Highlights when commits break the build.
+ </para></listitem>
+ <listitem><para>
+ Populates an sstate cache from which
+ developers can pull rather than requiring local
+ builds.
+ </para></listitem>
+ <listitem><para>
+ Allows commit hook triggers,
+ which trigger builds when commits are made.
+ </para></listitem>
+ <listitem><para>
+ Allows triggering of automated image booting
+ and testing under the QuickEMUlator (QEMU).
+ </para></listitem>
+ <listitem><para>
+ Supports incremental build testing and
+ from-scratch builds.
+ </para></listitem>
+ <listitem><para>
+ Shares output that allows developer
+ testing and historical regression investigation.
+ </para></listitem>
+ <listitem><para>
+ Creates output that can be used for releases.
+ </para></listitem>
+ <listitem><para>
+ Allows scheduling of builds so that resources
+ can be used efficiently.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set up Test Machines:</emphasis>
+ Use a small number of shared, high performance systems
+ for testing purposes.
+ Developers can use these systems for wider, more
+ extensive testing while they continue to develop
+ locally using their primary development system.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Document Policies and Change Flow:</emphasis>
+ The Yocto Project itself uses a hierarchical structure and a
+ pull model.
+ Scripts exist to create and send pull requests
+ (i.e. <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename>).
+ This model is in line with other open source projects where
+ maintainers are responsible for specific areas of the project
+ and a single maintainer handles the final "top-of-tree" merges.
+ <note>
+ You can also use a more collective push model.
+ The <filename>gitolite</filename> software supports both the
+ push and pull models quite easily.
+ </note></para>
+
+ <para>As with any development environment, it is important
+ to document the policy used as well as any main project
+ guidelines so they are understood by everyone.
+ It is also a good idea to have well structured
+ commit messages, which are usually a part of a project's
+ guidelines.
+ Good commit messages are essential when looking back in time and
+ trying to understand why changes were made.</para>
+
+ <para>If you discover that changes are needed to the core
+ layer of the project, it is worth sharing those with the
+ community as soon as possible.
+ Chances are if you have discovered the need for changes,
+ someone else in the community needs them also.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Development Environment Summary:</emphasis>
+ Aside from the previous steps, some best practices exist
+ within the Yocto Project development environment.
+ Consider the following:
+ <itemizedlist>
+ <listitem><para>
+ Use
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>
+ as the source control system.
+ </para></listitem>
+ <listitem><para>
+ Maintain your Metadata in layers that make sense
+ for your situation.
+ See the "<link linkend='understanding-and-creating-layers'>Understanding
+ and Creating Layers</link>" section for more information on
+ layers.
+ </para></listitem>
+ <listitem><para>
+ Separate the project's Metadata and code by using
+ separate Git repositories.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
+ section for information on these repositories.
+ See the
+ "<link linkend='locating-yocto-project-source-files'>Locating Yocto Project Source Files</link>"
+ section for information on how to set up local Git
+ repositories for related upstream Yocto Project
+ Git repositories.
+ </para></listitem>
+ <listitem><para>
+ Set up the directory for the shared state cache
+ (<ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>)
+ where it makes sense.
+ For example, set up the sstate cache on a system used
+ by developers in the same organization and share the
+ same source directories on their machines.
+ </para></listitem>
+ <listitem><para>
+ Set up an Autobuilder and have it populate the
+ sstate cache and source directories.
+ </para></listitem>
+ <listitem><para>
+ The Yocto Project community encourages you
+ to send patches to the project to fix bugs or add features.
+ If you do submit patches, follow the project commit
+ guidelines for writing good commit messages.
+ See the "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ Send changes to the core sooner than later
+ as others are likely to run into the same issues.
+ For some guidance on mailing lists to use, see the list in the
+ "<link linkend='how-to-submit-a-change'>Submitting a Change to the Yocto Project</link>"
+ section.
+ For a description of the available mailing lists, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-mailinglist'>Mailing Lists</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='setting-up-the-development-host-to-use-the-yocto-project'>
+ <title>Preparing the Build Host</title>
+
+ <para>
+ This section provides procedures to set up your development host to
+ use the Yocto Project.
+ You can use the Yocto Project on a native Linux development host or
+ you can use
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
+ to prepare any Linux, Mac, or Windows development host.
+ </para>
+
+ <para>
+ Once your development host is set up to use the Yocto Project,
+ further steps are necessary depending on what you want to
+ accomplish.
+ See the following references for information on how to prepare for
+ Board Support Package (BSP) development, kernel development, and
+ development using the <trademark class='trade'>Eclipse</trademark> IDE:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>BSP Development:</emphasis>
+ See the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work With BSP Layers</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Kernel Development:</emphasis>
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Eclipse Development:</emphasis>
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='setting-up-a-native-linux-host'>
+ <title>Setting Up a Native Linux Host</title>
+
+ <para>
+ Follow these steps to prepare a native Linux machine as your
+ Yocto Project development host:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Use a Supported Linux Distribution:</emphasis>
+ You should have a reasonably current Linux-based host
+ system.
+ You will have the best results with a recent release of
+ Fedora, openSUSE, Debian, Ubuntu, or CentOS as these
+ releases are frequently tested against the Yocto Project
+ and officially supported.
+ For a list of the distributions under validation and their
+ status, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" section
+ in the Yocto Project Reference Manual and the wiki page at
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Have Enough Free Memory:</emphasis>
+ You should have at least 50 Gbytes of free disk space
+ for building images.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Meet Minimal Version Requirements:</emphasis>
+ The OpenEmbedded build system should be able to run on any
+ modern distribution that has the following versions for
+ Git, tar, and Python.
+ <itemizedlist>
+ <listitem><para>
+ Git 1.8.3.1 or greater
+ </para></listitem>
+ <listitem><para>
+ tar 1.27 or greater
+ </para></listitem>
+ <listitem><para>
+ Python 3.4.0 or greater.
+ </para></listitem>
+ </itemizedlist>
+ If your build host does not meet any of these three listed
+ version requirements, you can take steps to prepare the
+ system so that you can still use the Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</ulink>"
+ section in the Yocto Project Reference Manual for
+ information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install Development Host Packages:</emphasis>
+ Required development host packages vary depending on your
+ build machine and what you want to do with the Yocto
+ Project.
+ Collectively, the number of required packages is large
+ if you want to be able to cover all cases.</para>
+
+ <para>For lists of required packages for all scenarios,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para></listitem>
+ </orderedlist>
+ Once you have completed the previous steps, you are ready to
+ continue using a given development path on your native Linux
+ machine.
+ If you are going to use BitBake, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ If you are going to use the Extensible SDK, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ If you want to work on the kernel, see the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>.
+ If you are going to use Toaster, see the
+ "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
+ section in the Toaster User Manual.
+ </para>
+ </section>
+
+ <section id='setting-up-to-use-crops'>
+ <title>Setting Up to Use CROss PlatformS (CROPS)</title>
+
+ <para>
+ With
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
+ you can create a Yocto Project development environment that
+ is operating system agnostic.
+ You can set up a container in which you can develop using the
+ Yocto Project on a Windows, Mac, or Linux machine.
+ </para>
+
+ <para>
+ Follow these general steps to prepare a Windows, Mac, or Linux
+ machine as your Yocto Project development host:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Go to the Docker Installation Site:</emphasis>
+ <ulink url='https://www.docker.com/what-docker'>Docker</ulink>
+ is a software container platform that you need to install
+ on the host development machine.
+ To start the installation process, see the
+ <ulink url='https://docs.docker.com/engine/installation/'>Docker Installation</ulink>
+ site.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Choose Your Docker Edition:</emphasis>
+ Docker comes in several editions.
+ For the Yocto Project, the stable community edition
+ (i.e. "Docker CE Stable") is adequate.
+ You can learn more about the Docker editions from the
+ site.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Go to the Install Site for Your Platform:</emphasis>
+ Click the link for the Docker edition associated with
+ your development host machine's native software.
+ For example, if your machine is running Microsoft
+ Windows Version 10 and you want the Docker CE Stable
+ edition, click that link under "Supported Platforms".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Understand What You Need:</emphasis>
+ The install page has pre-requisites your machine must
+ meet.
+ Be sure you read through this page and make sure your
+ machine meets the requirements to run Docker.
+ If your machine does not meet the requirements, the page
+ has instructions to handle exceptions.
+ For example, to run Docker on Windows 10, you must have
+ the pro version of the operating system.
+ If you have the home version, you need to install the
+ <ulink url='https://docs.docker.com/toolbox/overview/#ready-to-get-started'>Docker Toolbox</ulink>.
+ </para>
+
+ <para>Another example is that a Windows machine needs to
+ have Microsoft Hyper-V.
+ If you have a legacy version of the the Microsoft
+ operating system or for any other reason you do not have
+ Microsoft Hyper-V, you would have to enter the BIOS and
+ enable virtualization.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install the Software:</emphasis>
+ Once you have understood all the pre-requisites, you can
+ download and install the appropriate software.
+ Follow the instructions for your specific machine and
+ the type of the software you need to install.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Optionally Orient Yourself With Docker:</emphasis>
+ If you are unfamiliar with Docker and the container
+ concept, you can learn more here -
+ <ulink url='https://docs.docker.com/get-started/'></ulink>.
+ You should be able to launch Docker or the Docker Toolbox
+ and have a terminal shell on your development host.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set Up the Containers to Use the Yocto Project:</emphasis>
+ Go to
+ <ulink url='https://github.com/crops/docker-win-mac-docs/wiki'></ulink>
+ and follow the directions for your particular
+ development host (i.e. Linux, Mac, or Windows).</para>
+
+ <para>Once you complete the setup instructions for your
+ machine, you have the Poky, Extensible SDK, and Toaster
+ containers available.
+ You can click those links from the page and learn more
+ about using each of those containers.
+ </para></listitem>
+ </orderedlist>
+ Once you have a container set up, everything is in place to
+ develop just as if you were running on a native Linux machine.
+ If you are going to use the Poky container, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ If you are going to use the Extensible SDK container, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ If you are going to use the Toaster container, see the
+ "<ulink url='&YOCTO_DOCS_TOAST_URL;#toaster-manual-setup-and-use'>Setting Up and Using Toaster</ulink>"
+ section in the Toaster User Manual.
+ </para>
+ </section>
+</section>
+
+<section id='locating-yocto-project-source-files'>
+ <title>Locating Yocto Project Source Files</title>
+
+ <para>
+ This section contains procedures related to locating Yocto Project
+ files.
+ You establish and use these local files to work on projects.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For concepts and introductory information about Git as it
+ is used in the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para></listitem>
+ <listitem><para>
+ For concepts on Yocto Project source repositories, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>"
+ section in the Yocto Project Overview and Concepts Manual."
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <section id='accessing-source-repositories'>
+ <title>Accessing Source Repositories</title>
+
+ <para>
+ Working from a copy of the upstream Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ is the preferred method for obtaining and using a Yocto Project
+ release.
+ You can view the Yocto Project Source Repositories at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ In particular, you can find the
+ <filename>poky</filename> repository at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/'></ulink>.
+ </para>
+
+ <para>
+ Use the following procedure to locate the latest upstream copy of
+ the <filename>poky</filename> Git repository:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Access Repositories:</emphasis>
+ Open a browser and go to
+ <ulink url='&YOCTO_GIT_URL;'></ulink> to access the
+ GUI-based interface into the Yocto Project source
+ repositories.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select the Repository:</emphasis>
+ Click on the repository in which you are interested (i.e.
+ <filename>poky</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Find the URL Used to Clone the Repository:</emphasis>
+ At the bottom of the page, note the URL used to
+ <ulink url='&YOCTO_DOCS_OM_URL;#git-commands-clone'>clone</ulink>
+ that repository (e.g.
+ <filename>&YOCTO_GIT_URL;/poky</filename>).
+ <note>
+ For information on cloning a repository, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='accessing-index-of-releases'>
+ <title>Accessing Index of Releases</title>
+
+ <para>
+ Yocto Project maintains an Index of Releases area that contains
+ related files that contribute to the Yocto Project.
+ Rather than Git repositories, these files are tarballs that
+ represent snapshots in time of a given component.
+ <note><title>Tip</title>
+ The recommended method for accessing Yocto Project
+ components is to use Git to clone the upstream repository and
+ work from within that locally cloned repository.
+ The procedure in this section exists should you desire a
+ tarball snapshot of any given component.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Access the Index of Releases:</emphasis>
+ Open a browser and go to
+ <ulink url='&YOCTO_DL_URL;/releases'></ulink> to access the
+ Index of Releases.
+ The list represents released components (e.g.
+ <filename>eclipse-plugin</filename>,
+ <filename>sato</filename>, and so on).
+ <note>
+ The <filename>yocto</filename> directory contains the
+ full array of released Poky tarballs.
+ The <filename>poky</filename> directory in the
+ Index of Releases was historically used for very
+ early releases and exists now only for retroactive
+ completeness.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select a Component:</emphasis>
+ Click on any released component in which you are interested
+ (e.g. <filename>yocto</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Find the Tarball:</emphasis>
+ Drill down to find the associated tarball.
+ For example, click on <filename>yocto-&DISTRO;</filename> to
+ view files associated with the Yocto Project &DISTRO;
+ release (e.g. <filename>poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;.tar.bz2</filename>,
+ which is the released Poky tarball).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download the Tarball:</emphasis>
+ Click the tarball to download and save a snapshot of the
+ given component.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='using-the-downloads-page'>
+ <title>Using the Downloads Page</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ uses a "DOWNLOADS" page from which you can locate and download
+ tarballs of any Yocto Project release.
+ Rather than Git repositories, these files represent snapshot
+ tarballs.
+ <note><title>Tip</title>
+ The recommended method for accessing Yocto Project
+ components is to use Git to clone a repository and work from
+ within that local repository.
+ The procedure in this section exists should you desire a
+ tarball snapshot of any given component.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Go to the Yocto Project Website:</emphasis>
+ Open The
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>
+ in your browser.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Get to the Downloads Area:</emphasis>
+ Select the "DOWNLOADS" item from the pull-down
+ "SOFTWARE" tab menu.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select a Yocto Project Release:</emphasis>
+ Use the menu next to "RELEASE" to display and choose
+ a Yocto Project release (e.g. sumo, rocko, pyro, and
+ so forth.
+ For a "map" of Yocto Project releases to version numbers,
+ see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Releases</ulink>
+ wiki page.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download Tools or Board Support Packages (BSPs):</emphasis>
+ From the "DOWNLOADS" page, you can download tools or
+ BSPs as well.
+ Just scroll down the page and look for what you need.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='accessing-nightly-builds'>
+ <title>Accessing Nightly Builds</title>
+
+ <para>
+ Yocto Project maintains an area for nightly builds that contains
+ tarball releases at <ulink url='&YOCTO_AB_NIGHTLY_URL;'/>.
+ These builds include Yocto Project releases, SDK installation
+ scripts, and experimental builds.
+ </para>
+
+ <para>
+ Should you ever want to access a nightly build of a particular
+ Yocto Project component, use the following procedure:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Access the Nightly Builds:</emphasis>
+ Open a browser and go to
+ <ulink url='&YOCTO_AB_NIGHTLY_URL;'/> to access the
+ Nightly Builds.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select a Build:</emphasis>
+ Click on any build by date in which you are interested.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Find the Tarball:</emphasis>
+ Drill down to find the associated tarball.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download the Tarball:</emphasis>
+ Click the tarball to download and save a snapshot of the
+ given component.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</section>
+
+<section id='cloning-and-checking-out-branchs'>
+ <title>Cloning and Checking Out Branches</title>
+
+ <para>
+ To use the Yocto Project, you need a release of the Yocto Project
+ locally installed on your development system.
+ The locally installed set of files is referred to as the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ in the Yocto Project documentation.
+ </para>
+
+ <para>
+ You create your Source Directory by using
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> to clone a local
+ copy of the upstream <filename>poky</filename> repository.
+ <note><title>Tip</title>
+ The preferred method of getting the Yocto Project Source
+ Directory set up is to clone the repository.
+ </note>
+ Working from a copy of the upstream repository allows you
+ to contribute back into the Yocto Project or simply work with
+ the latest software on a development branch.
+ Because Git maintains and creates an upstream repository with
+ a complete history of changes and you are working with a local
+ clone of that repository, you have access to all the Yocto
+ Project development branches and tag names used in the upstream
+ repository.
+ </para>
+
+ <section id='cloning-the-poky-repository'>
+ <title>Cloning the <filename>poky</filename> Repository</title>
+
+ <para>
+ Follow these steps to create a local version of the
+ upstream
+ <ulink url='&YOCTO_DOCS_REF_URL;#poky'><filename>poky</filename></ulink>
+ Git repository.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set Your Directory:</emphasis>
+ Be in the directory where you want to create your local
+ copy of poky.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the Repository:</emphasis>
+ The following command clones the repository and uses
+ the default name "poky" for your local repository:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ Cloning into 'poky'...
+ remote: Counting objects: 367178, done.
+ remote: Compressing objects: 100% (88161/88161), done.
+ remote: Total 367178 (delta 272761), reused 366942 (delta 272525)
+ Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done.
+ Resolving deltas: 100% (272761/272761), done.
+ Checking connectivity... done.
+ </literallayout>
+ Unless you specify a specific development branch or
+ tag name, Git clones the "master" branch, which results
+ in a snapshot of the latest development changes for
+ "master".
+ For information on how to check out a specific
+ development branch or on how to check out a local
+ branch based on a tag name, see the
+ "<link linkend='checking-out-by-branch-in-poky'>Checking Out By Branch in Poky</link>"
+ and
+ <link linkend='checkout-out-by-tag-in-poky'>Checking Out By Tag in Poky</link>"
+ sections, respectively.</para>
+
+ <para>Once the repository is created, you can change to
+ that directory and check its status.
+ Here, the single "master" branch exists on your system
+ and by default, it is checked out:
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git status
+ On branch master
+ Your branch is up-to-date with 'origin/master'.
+ nothing to commit, working directory clean
+ $ git branch
+ * master
+ </literallayout>
+ Your local repository of poky is identical to the
+ upstream poky repository at the time from which it was
+ cloned.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='checking-out-by-branch-in-poky'>
+ <title>Checking Out by Branch in Poky</title>
+
+ <para>
+ When you clone the upstream poky repository, you have access to
+ all its development branches.
+ Each development branch in a repository is unique as it forks
+ off the "master" branch.
+ To see and use the files of a particular development branch
+ locally, you need to know the branch name and then specifically
+ check out that development branch.
+ <note>
+ Checking out an active development branch by branch name
+ gives you a snapshot of that particular branch at the time
+ you check it out.
+ Further development on top of the branch that occurs after
+ check it out can occur.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Switch to the Poky Directory:</emphasis>
+ If you have a local poky Git repository, switch to that
+ directory.
+ If you do not have the local copy of poky, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Determine Existing Branch Names:</emphasis>
+ <literallayout class='monospaced'>
+ $ git branch -a
+ * master
+ remotes/origin/1.1_M1
+ remotes/origin/1.1_M2
+ remotes/origin/1.1_M3
+ remotes/origin/1.1_M4
+ remotes/origin/1.2_M1
+ remotes/origin/1.2_M2
+ remotes/origin/1.2_M3
+ .
+ .
+ .
+ remotes/origin/master-next
+ remotes/origin/master-next2
+ remotes/origin/morty
+ remotes/origin/pinky
+ remotes/origin/purple
+ remotes/origin/pyro
+ remotes/origin/rocko
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Checkout the Branch:</emphasis>
+ Checkout the development branch in which you want to work.
+ For example, to access the files for the Yocto Project
+ &DISTRO; Release (&DISTRO_NAME;), use the following command:
+ <literallayout class='monospaced'>
+ $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
+ Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
+ Switched to a new branch '&DISTRO_NAME_NO_CAP;'
+ </literallayout>
+ The previous command checks out the "&DISTRO_NAME_NO_CAP;"
+ development branch and reports that the branch is tracking
+ the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.</para>
+
+ <para>The following command displays the branches
+ that are now part of your local poky repository.
+ The asterisk character indicates the branch that is
+ currently checked out for work:
+ <literallayout class='monospaced'>
+ $ git branch
+ master
+ * &DISTRO_NAME_NO_CAP;
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='checkout-out-by-tag-in-poky'>
+ <title>Checking Out by Tag in Poky</title>
+
+ <para>
+ Similar to branches, the upstream repository uses tags
+ to mark specific commits associated with significant points in
+ a development branch (i.e. a release point or stage of a
+ release).
+ You might want to set up a local branch based on one of those
+ points in the repository.
+ The process is similar to checking out by branch name except you
+ use tag names.
+ <note>
+ Checking out a branch based on a tag gives you a
+ stable set of files not affected by development on the
+ branch above the tag.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Switch to the Poky Directory:</emphasis>
+ If you have a local poky Git repository, switch to that
+ directory.
+ If you do not have the local copy of poky, see the
+ "<link linkend='cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Fetch the Tag Names:</emphasis>
+ To checkout the branch based on a tag name, you need to
+ fetch the upstream tags into your local repository:
+ <literallayout class='monospaced'>
+ $ git fetch --tags
+ $
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>List the Tag Names:</emphasis>
+ You can list the tag names now:
+ <literallayout class='monospaced'>
+ $ git tag
+ 1.1_M1.final
+ 1.1_M1.rc1
+ 1.1_M1.rc2
+ 1.1_M2.final
+ 1.1_M2.rc1
+ .
+ .
+ .
+ yocto-2.2
+ yocto-2.2.1
+ yocto-2.3
+ yocto-2.3.1
+ yocto-2.4
+ yocto_1.5_M5.rc8
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Checkout the Branch:</emphasis>
+ <literallayout class='monospaced'>
+ $ git checkout tags/&DISTRO_REL_TAG; -b my_yocto_&DISTRO;
+ Switched to a new branch 'my_yocto_&DISTRO;'
+ $ git branch
+ master
+ * my_yocto_&DISTRO;
+ </literallayout>
+ The previous command creates and checks out a local
+ branch named "my_yocto_&DISTRO;", which is based on
+ the commit in the upstream poky repository that has
+ the same tag.
+ In this example, the files you have available locally
+ as a result of the <filename>checkout</filename>
+ command are a snapshot of the
+ "&DISTRO_NAME_NO_CAP;" development branch at the point
+ where Yocto Project &DISTRO; was released.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/dev-manual/dev-manual.xml b/poky/documentation/dev-manual/dev-manual.xml
new file mode 100644
index 000000000..93a615c2a
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-manual.xml
@@ -0,0 +1,178 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='dev-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/dev-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Development Tasks Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.1</revnumber>
+ <date>6 October 2011</date>
+ <revremark>The initial document released with the Yocto Project 1.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.2</revnumber>
+ <date>April 2012</date>
+ <revremark>Released with the Yocto Project 1.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.3</revnumber>
+ <date>October 2012</date>
+ <revremark>Released with the Yocto Project 1.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">
+ Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by
+ Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Development Tasks Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="dev-manual-intro.xml"/>
+
+ <xi:include href="dev-manual-start.xml"/>
+
+ <xi:include href="dev-manual-common-tasks.xml"/>
+
+ <xi:include href="dev-manual-qemu.xml"/>
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/dev-manual/dev-style.css b/poky/documentation/dev-manual/dev-style.css
new file mode 100644
index 000000000..6d0aa8e9f
--- /dev/null
+++ b/poky/documentation/dev-manual/dev-style.css
@@ -0,0 +1,988 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/dev-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/dev-manual/figures/bitbake-build-flow.png b/poky/documentation/dev-manual/figures/bitbake-build-flow.png
new file mode 100644
index 000000000..108265ae0
--- /dev/null
+++ b/poky/documentation/dev-manual/figures/bitbake-build-flow.png
Binary files differ
diff --git a/poky/documentation/dev-manual/figures/buildhistory-web.png b/poky/documentation/dev-manual/figures/buildhistory-web.png
new file mode 100644
index 000000000..f6db86c97
--- /dev/null
+++ b/poky/documentation/dev-manual/figures/buildhistory-web.png
Binary files differ
diff --git a/poky/documentation/dev-manual/figures/buildhistory.png b/poky/documentation/dev-manual/figures/buildhistory.png
new file mode 100644
index 000000000..bd5f8a490
--- /dev/null
+++ b/poky/documentation/dev-manual/figures/buildhistory.png
Binary files differ
diff --git a/poky/documentation/dev-manual/figures/dev-title.png b/poky/documentation/dev-manual/figures/dev-title.png
new file mode 100644
index 000000000..15e67d074
--- /dev/null
+++ b/poky/documentation/dev-manual/figures/dev-title.png
Binary files differ
diff --git a/poky/documentation/dev-manual/figures/recipe-workflow.png b/poky/documentation/dev-manual/figures/recipe-workflow.png
new file mode 100644
index 000000000..c0e960b13
--- /dev/null
+++ b/poky/documentation/dev-manual/figures/recipe-workflow.png
Binary files differ
diff --git a/poky/documentation/kernel-dev/figures/kernel-architecture-overview.png b/poky/documentation/kernel-dev/figures/kernel-architecture-overview.png
new file mode 100755
index 000000000..2aad172db
--- /dev/null
+++ b/poky/documentation/kernel-dev/figures/kernel-architecture-overview.png
Binary files differ
diff --git a/poky/documentation/kernel-dev/figures/kernel-dev-flow.png b/poky/documentation/kernel-dev/figures/kernel-dev-flow.png
new file mode 100644
index 000000000..793a395e8
--- /dev/null
+++ b/poky/documentation/kernel-dev/figures/kernel-dev-flow.png
Binary files differ
diff --git a/poky/documentation/kernel-dev/figures/kernel-dev-title.png b/poky/documentation/kernel-dev/figures/kernel-dev-title.png
new file mode 100644
index 000000000..7a8dd5437
--- /dev/null
+++ b/poky/documentation/kernel-dev/figures/kernel-dev-title.png
Binary files differ
diff --git a/poky/documentation/kernel-dev/figures/kernel-overview-2-generic.png b/poky/documentation/kernel-dev/figures/kernel-overview-2-generic.png
new file mode 100644
index 000000000..ee2cdb206
--- /dev/null
+++ b/poky/documentation/kernel-dev/figures/kernel-overview-2-generic.png
Binary files differ
diff --git a/poky/documentation/kernel-dev/kernel-dev-advanced.xml b/poky/documentation/kernel-dev/kernel-dev-advanced.xml
new file mode 100644
index 000000000..5c76ed239
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-advanced.xml
@@ -0,0 +1,1256 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='kernel-dev-advanced'>
+<title>Working with Advanced Metadata (<filename>yocto-kernel-cache</filename>)</title>
+
+<section id='kernel-dev-advanced-overview'>
+ <title>Overview</title>
+
+ <para>
+ In addition to supporting configuration fragments and patches, the
+ Yocto Project kernel tools also support rich
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink> that you can
+ use to define complex policies and Board Support Package (BSP) support.
+ The purpose of the Metadata and the tools that manage it is
+ to help you manage the complexity of the configuration and sources
+ used to support multiple BSPs and Linux kernel types.
+ </para>
+
+ <para>
+ Kernel Metadata exists in many places.
+ One area in the Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ is the <filename>yocto-kernel-cache</filename> Git repository.
+ You can find this repository grouped under the "Yocto Linux Kernel"
+ heading in the
+ <ulink url='&YOCTO_GIT_URL;'>Yocto Project Source Repositories</ulink>.
+ </para>
+
+ <para>
+ Kernel development tools ("kern-tools") exist also in the Yocto
+ Project Source Repositories under the "Yocto Linux Kernel" heading
+ in the <filename>yocto-kernel-tools</filename> Git repository.
+ The recipe that builds these tools is
+ <filename>meta/recipes-kernel/kern-tools/kern-tools-native_git.bb</filename>
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>).
+ </para>
+</section>
+
+<section id='using-kernel-metadata-in-a-recipe'>
+ <title>Using Kernel Metadata in a Recipe</title>
+
+ <para>
+ As mentioned in the introduction, the Yocto Project contains kernel
+ Metadata, which is located in the
+ <filename>yocto-kernel-cache</filename> Git repository.
+ This Metadata defines Board Support Packages (BSPs) that
+ correspond to definitions in linux-yocto recipes for corresponding BSPs.
+ A BSP consists of an aggregation of kernel policy and enabled
+ hardware-specific features.
+ The BSP can be influenced from within the linux-yocto recipe.
+ <note>
+ A Linux kernel recipe that contains kernel Metadata (e.g.
+ inherits from the <filename>linux-yocto.inc</filename> file)
+ is said to be a "linux-yocto style" recipe.
+ </note>
+ </para>
+
+ <para>
+ Every linux-yocto style recipe must define the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>
+ variable.
+ This variable is typically set to the same value as the
+ <filename>MACHINE</filename> variable, which is used by
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>.
+ However, in some cases, the variable might instead refer to the
+ underlying platform of the <filename>MACHINE</filename>.
+ </para>
+
+ <para>
+ Multiple BSPs can reuse the same <filename>KMACHINE</filename>
+ name if they are built using the same BSP description.
+ Multiple Corei7-based BSPs could share the same "intel-corei7-64"
+ value for <filename>KMACHINE</filename>.
+ It is important to realize that <filename>KMACHINE</filename> is
+ just for kernel mapping, while <filename>MACHINE</filename>
+ is the machine type within a BSP Layer.
+ Even with this distinction, however, these two variables can hold
+ the same value.
+ See the <link linkend='bsp-descriptions'>BSP Descriptions</link>
+ section for more information.
+ </para>
+
+ <para>
+ Every linux-yocto style recipe must also indicate the Linux kernel
+ source repository branch used to build the Linux kernel.
+ The <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
+ variable must be set to indicate the branch.
+ <note>
+ You can use the <filename>KBRANCH</filename> value to define an
+ alternate branch typically with a machine override as shown here
+ from the <filename>meta-yocto-bsp</filename> layer:
+ <literallayout class='monospaced'>
+ KBRANCH_edgerouter = "standard/edgerouter"
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ The linux-yocto style recipes can optionally define the following
+ variables:
+ <literallayout class='monospaced'>
+ KERNEL_FEATURES
+ LINUX_KERNEL_TYPE
+ </literallayout>
+ </para>
+
+ <para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+ defines the kernel type to be
+ used in assembling the configuration.
+ If you do not specify a <filename>LINUX_KERNEL_TYPE</filename>,
+ it defaults to "standard".
+ Together with <filename>KMACHINE</filename>,
+ <filename>LINUX_KERNEL_TYPE</filename> defines the search
+ arguments used by the kernel tools to find the
+ appropriate description within the kernel Metadata with which to
+ build out the sources and configuration.
+ The linux-yocto recipes define "standard", "tiny", and "preempt-rt"
+ kernel types.
+ See the "<link linkend='kernel-types'>Kernel Types</link>" section
+ for more information on kernel types.
+ </para>
+
+ <para>
+ During the build, the kern-tools search for the BSP description
+ file that most closely matches the <filename>KMACHINE</filename>
+ and <filename>LINUX_KERNEL_TYPE</filename> variables passed in from the
+ recipe.
+ The tools use the first BSP description it finds that match
+ both variables.
+ If the tools cannot find a match, they issue a warning.
+ </para>
+
+ <para>
+ The tools first search for the <filename>KMACHINE</filename> and
+ then for the <filename>LINUX_KERNEL_TYPE</filename>.
+ If the tools cannot find a partial match, they will use the
+ sources from the <filename>KBRANCH</filename> and any configuration
+ specified in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
+ </para>
+
+ <para>
+ You can use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+ variable
+ to include features (configuration fragments, patches, or both) that
+ are not already included by the <filename>KMACHINE</filename> and
+ <filename>LINUX_KERNEL_TYPE</filename> variable combination.
+ For example, to include a feature specified as
+ "features/netfilter/netfilter.scc",
+ specify:
+ <literallayout class='monospaced'>
+ KERNEL_FEATURES += "features/netfilter/netfilter.scc"
+ </literallayout>
+ To include a feature called "cfg/sound.scc" just for the
+ <filename>qemux86</filename> machine, specify:
+ <literallayout class='monospaced'>
+ KERNEL_FEATURES_append_qemux86 = " cfg/sound.scc"
+ </literallayout>
+ The value of the entries in <filename>KERNEL_FEATURES</filename>
+ are dependent on their location within the kernel Metadata itself.
+ The examples here are taken from the
+ <filename>yocto-kernel-cache</filename> repository.
+ Each branch of this repository contains "features" and "cfg"
+ subdirectories at the top-level.
+ For more information, see the
+ "<link linkend='kernel-metadata-syntax'>Kernel Metadata Syntax</link>"
+ section.
+ </para>
+</section>
+
+<section id='kernel-metadata-syntax'>
+ <title>Kernel Metadata Syntax</title>
+
+ <para>
+ The kernel Metadata consists of three primary types of files:
+ <filename>scc</filename>
+ <footnote>
+ <para>
+ <filename>scc</filename> stands for Series Configuration
+ Control, but the naming has less significance in the
+ current implementation of the tooling than it had in the
+ past.
+ Consider <filename>scc</filename> files to be description files.
+ </para>
+ </footnote>
+ description files, configuration fragments, and patches.
+ The <filename>scc</filename> files define variables and include or
+ otherwise reference any of the three file types.
+ The description files are used to aggregate all types of kernel
+ Metadata into
+ what ultimately describes the sources and the configuration required
+ to build a Linux kernel tailored to a specific machine.
+ </para>
+
+ <para>
+ The <filename>scc</filename> description files are used to define two
+ fundamental types of kernel Metadata:
+ <itemizedlist>
+ <listitem><para>Features</para></listitem>
+ <listitem><para>Board Support Packages (BSPs)</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Features aggregate sources in the form of patches and configuration
+ fragments into a modular reusable unit.
+ You can use features to implement conceptually separate kernel
+ Metadata descriptions such as pure configuration fragments,
+ simple patches, complex features, and kernel types.
+ <link linkend='kernel-types'>Kernel types</link> define general
+ kernel features and policy to be reused in the BSPs.
+ </para>
+
+ <para>
+ BSPs define hardware-specific features and aggregate them with kernel
+ types to form the final description of what will be assembled and built.
+ </para>
+
+ <para>
+ While the kernel Metadata syntax does not enforce any logical
+ separation of configuration fragments, patches, features or kernel
+ types, best practices dictate a logical separation of these types
+ of Metadata.
+ The following Metadata file hierarchy is recommended:
+ <literallayout class='monospaced'>
+ <replaceable>base</replaceable>/
+ bsp/
+ cfg/
+ features/
+ ktypes/
+ patches/
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>bsp</filename> directory contains the
+ <link linkend='bsp-descriptions'>BSP descriptions</link>.
+ The remaining directories all contain "features".
+ Separating <filename>bsp</filename> from the rest of the structure
+ aids conceptualizing intended usage.
+ </para>
+
+ <para>
+ Use these guidelines to help place your <filename>scc</filename>
+ description files within the structure:
+ <itemizedlist>
+ <listitem><para>If your file contains
+ only configuration fragments, place the file in the
+ <filename>cfg</filename> directory.</para></listitem>
+ <listitem><para>If your file contains
+ only source-code fixes, place the file in the
+ <filename>patches</filename> directory.</para></listitem>
+ <listitem><para>If your file encapsulates
+ a major feature, often combining sources and configurations,
+ place the file in <filename>features</filename> directory.
+ </para></listitem>
+ <listitem><para>If your file aggregates
+ non-hardware configuration and patches in order to define a
+ base kernel policy or major kernel type to be reused across
+ multiple BSPs, place the file in <filename>ktypes</filename>
+ directory.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ These distinctions can easily become blurred - especially as
+ out-of-tree features slowly merge upstream over time.
+ Also, remember that how the description files are placed is
+ a purely logical organization and has no impact on the functionality
+ of the kernel Metadata.
+ There is no impact because all of <filename>cfg</filename>,
+ <filename>features</filename>, <filename>patches</filename>, and
+ <filename>ktypes</filename>, contain "features" as far as the kernel
+ tools are concerned.
+ </para>
+
+ <para>
+ Paths used in kernel Metadata files are relative to
+ <replaceable>base</replaceable>, which is either
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ if you are creating Metadata in
+ <link linkend='recipe-space-metadata'>recipe-space</link>,
+ or the top level of
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache/tree/'><filename>yocto-kernel-cache</filename></ulink>
+ if you are creating
+ <link linkend='metadata-outside-the-recipe-space'>Metadata outside of the recipe-space</link>.
+ </para>
+
+ <section id='configuration'>
+ <title>Configuration</title>
+
+ <para>
+ The simplest unit of kernel Metadata is the configuration-only
+ feature.
+ This feature consists of one or more Linux kernel configuration
+ parameters in a configuration fragment file
+ (<filename>.cfg</filename>) and a <filename>.scc</filename> file
+ that describes the fragment.
+ </para>
+
+ <para>
+ As an example, consider the Symmetric Multi-Processing (SMP)
+ fragment used with the <filename>linux-yocto-4.12</filename>
+ kernel as defined outside of the recipe space (i.e.
+ <filename>yocto-kernel-cache</filename>).
+ This Metadata consists of two files: <filename>smp.scc</filename>
+ and <filename>smp.cfg</filename>.
+ You can find these files in the <filename>cfg</filename> directory
+ of the <filename>yocto-4.12</filename> branch in the
+ <filename>yocto-kernel-cache</filename> Git repository:
+ <literallayout class='monospaced'>
+ cfg/smp.scc:
+ define KFEATURE_DESCRIPTION "Enable SMP for 32 bit builds"
+ define KFEATURE_COMPATIBILITY all
+
+ kconf hardware smp.cfg
+
+ cfg/smp.cfg:
+ CONFIG_SMP=y
+ CONFIG_SCHED_SMT=y
+ # Increase default NR_CPUS from 8 to 64 so that platform with
+ # more than 8 processors can be all activated at boot time
+ CONFIG_NR_CPUS=64
+ # The following is needed when setting NR_CPUS to something
+ # greater than 8 on x86 architectures, it should be automatically
+ # disregarded by Kconfig when using a different arch
+ CONFIG_X86_BIGSMP=y
+ </literallayout>
+ You can find general information on configuration fragment files in
+ the
+ "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
+ section.
+ </para>
+
+ <para>
+ Within the <filename>smp.scc</filename> file, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION'><filename>KFEATURE_DESCRIPTION</filename></ulink>
+ statement provides a short description of the fragment.
+ Higher level kernel tools use this description.
+ </para>
+
+ <para>
+ Also within the <filename>smp.scc</filename> file, the
+ <filename>kconf</filename> command includes the
+ actual configuration fragment in an <filename>.scc</filename>
+ file, and the "hardware" keyword identifies the fragment as
+ being hardware enabling, as opposed to general policy,
+ which would use the "non-hardware" keyword.
+ The distinction is made for the benefit of the configuration
+ validation tools, which warn you if a hardware fragment
+ overrides a policy set by a non-hardware fragment.
+ <note>
+ The description file can include multiple
+ <filename>kconf</filename> statements, one per fragment.
+ </note>
+ </para>
+
+ <para>
+ As described in the
+ "<link linkend='validating-configuration'>Validating Configuration</link>"
+ section, you can use the following BitBake command to audit your
+ configuration:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configcheck -f
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='patches'>
+ <title>Patches</title>
+
+ <para>
+ Patch descriptions are very similar to configuration fragment
+ descriptions, which are described in the previous section.
+ However, instead of a <filename>.cfg</filename> file, these
+ descriptions work with source patches (i.e.
+ <filename>.patch</filename> files).
+ </para>
+
+ <para>
+ A typical patch includes a description file and the patch itself.
+ As an example, consider the build patches used with the
+ <filename>linux-yocto-4.12</filename> kernel as defined outside of
+ the recipe space (i.e. <filename>yocto-kernel-cache</filename>).
+ This Metadata consists of several files:
+ <filename>build.scc</filename> and a set of
+ <filename>*.patch</filename> files.
+ You can find these files in the <filename>patches/build</filename>
+ directory of the <filename>yocto-4.12</filename> branch in the
+ <filename>yocto-kernel-cache</filename> Git repository.
+ </para>
+
+ <para>
+ The following listings show the <filename>build.scc</filename>
+ file and part of the
+ <filename>modpost-mask-trivial-warnings.patch</filename> file:
+ <literallayout class='monospaced'>
+ patches/build/build.scc:
+ patch arm-serialize-build-targets.patch
+ patch powerpc-serialize-image-targets.patch
+ patch kbuild-exclude-meta-directory-from-distclean-processi.patch
+
+ # applied by kgit
+ # patch kbuild-add-meta-files-to-the-ignore-li.patch
+
+ patch modpost-mask-trivial-warnings.patch
+ patch menuconfig-check-lxdiaglog.sh-Allow-specification-of.patch
+
+ patches/build/modpost-mask-trivial-warnings.patch:
+ From bd48931bc142bdd104668f3a062a1f22600aae61 Mon Sep 17 00:00:00 2001
+ From: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
+ Date: Sun, 25 Jan 2009 17:58:09 -0500
+ Subject: [PATCH] modpost: mask trivial warnings
+
+ Newer HOSTCC will complain about various stdio fcns because
+ .
+ .
+ .
+ char *dump_write = NULL, *files_source = NULL;
+ int opt;
+ --
+ 2.10.1
+
+ generated by cgit v0.10.2 at 2017-09-28 15:23:23 (GMT)
+ </literallayout>
+ The description file can include multiple patch statements where
+ each statement handles a single patch.
+ In the example <filename>build.scc</filename> file, five patch
+ statements exist for the five patches in the directory.
+ </para>
+
+ <para>
+ You can create a typical <filename>.patch</filename> file using
+ <filename>diff -Nurp</filename> or
+ <filename>git format-patch</filename> commands.
+ For information on how to create patches, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ and
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ sections.
+ </para>
+ </section>
+
+ <section id='features'>
+ <title>Features</title>
+
+ <para>
+ Features are complex kernel Metadata types that consist
+ of configuration fragments, patches, and possibly other feature
+ description files.
+ As an example, consider the following generic listing:
+ <literallayout class='monospaced'>
+ features/<replaceable>myfeature</replaceable>.scc
+ define KFEATURE_DESCRIPTION "Enable <replaceable>myfeature</replaceable>"
+
+ patch 0001-<replaceable>myfeature</replaceable>-core.patch
+ patch 0002-<replaceable>myfeature</replaceable>-interface.patch
+
+ include cfg/<replaceable>myfeature</replaceable>_dependency.scc
+ kconf non-hardware <replaceable>myfeature</replaceable>.cfg
+ </literallayout>
+ This example shows how the <filename>patch</filename> and
+ <filename>kconf</filename> commands are used as well as
+ how an additional feature description file is included with
+ the <filename>include</filename> command.
+ </para>
+
+ <para>
+ Typically, features are less granular than configuration
+ fragments and are more likely than configuration fragments
+ and patches to be the types of things you want to specify
+ in the <filename>KERNEL_FEATURES</filename> variable of the
+ Linux kernel recipe.
+ See the "<link linkend='using-kernel-metadata-in-a-recipe'>Using Kernel Metadata in a Recipe</link>"
+ section earlier in the manual.
+ </para>
+ </section>
+
+ <section id='kernel-types'>
+ <title>Kernel Types</title>
+
+ <para>
+ A kernel type defines a high-level kernel policy by
+ aggregating non-hardware configuration fragments with
+ patches you want to use when building a Linux kernel of a
+ specific type (e.g. a real-time kernel).
+ Syntactically, kernel types are no different than features
+ as described in the "<link linkend='features'>Features</link>"
+ section.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+ variable in the kernel recipe selects the kernel type.
+ For example, in the <filename>linux-yocto_4.12.bb</filename>
+ kernel recipe found in
+ <filename>poky/meta/recipes-kernel/linux</filename>, a
+ <ulink url='&YOCTO_DOCS_BB_URL;#require-inclusion'><filename>require</filename></ulink>
+ directive includes the
+ <filename>poky/meta/recipes-kernel/linux/linux-yocto.inc</filename>
+ file, which has the following statement that defines the default
+ kernel type:
+ <literallayout class='monospaced'>
+ LINUX_KERNEL_TYPE ??= "standard"
+ </literallayout>
+ </para>
+
+ <para>
+ Another example would be the real-time kernel (i.e.
+ <filename>linux-yocto-rt_4.12.bb</filename>).
+ This kernel recipe directly sets the kernel type as follows:
+ <literallayout class='monospaced'>
+ LINUX_KERNEL_TYPE = "preempt-rt"
+ </literallayout>
+ <note>
+ You can find kernel recipes in the
+ <filename>meta/recipes-kernel/linux</filename> directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb</filename>).
+ See the "<link linkend='using-kernel-metadata-in-a-recipe'>Using Kernel Metadata in a Recipe</link>"
+ section for more information.
+ </note>
+ </para>
+
+ <para>
+ Three kernel types ("standard", "tiny", and "preempt-rt") are
+ supported for Linux Yocto kernels:
+ <itemizedlist>
+ <listitem><para>"standard":
+ Includes the generic Linux kernel policy of the Yocto
+ Project linux-yocto kernel recipes.
+ This policy includes, among other things, which file
+ systems, networking options, core kernel features, and
+ debugging and tracing options are supported.
+ </para></listitem>
+ <listitem><para>"preempt-rt":
+ Applies the <filename>PREEMPT_RT</filename>
+ patches and the configuration options required to
+ build a real-time Linux kernel.
+ This kernel type inherits from the "standard" kernel type.
+ </para></listitem>
+ <listitem><para>"tiny":
+ Defines a bare minimum configuration meant to serve as a
+ base for very small Linux kernels.
+ The "tiny" kernel type is independent from the "standard"
+ configuration.
+ Although the "tiny" kernel type does not currently include
+ any source changes, it might in the future.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For any given kernel type, the Metadata is defined by the
+ <filename>.scc</filename> (e.g. <filename>standard.scc</filename>).
+ Here is a partial listing for the <filename>standard.scc</filename>
+ file, which is found in the <filename>ktypes/standard</filename>
+ directory of the <filename>yocto-kernel-cache</filename> Git
+ repository:
+ <literallayout class='monospaced'>
+ # Include this kernel type fragment to get the standard features and
+ # configuration values.
+
+ # Note: if only the features are desired, but not the configuration
+ # then this should be included as:
+ # include ktypes/standard/standard.scc nocfg
+ # if no chained configuration is desired, include it as:
+ # include ktypes/standard/standard.scc nocfg inherit
+
+
+
+ include ktypes/base/base.scc
+ branch standard
+
+ kconf non-hardware standard.cfg
+
+ include features/kgdb/kgdb.scc
+ .
+ .
+ .
+
+ include cfg/net/ip6_nf.scc
+ include cfg/net/bridge.scc
+
+ include cfg/systemd.scc
+
+ include features/rfkill/rfkill.scc
+ </literallayout>
+ </para>
+
+ <para>
+ As with any <filename>.scc</filename> file, a
+ kernel type definition can aggregate other
+ <filename>.scc</filename> files with
+ <filename>include</filename> commands.
+ These definitions can also directly pull in
+ configuration fragments and patches with the
+ <filename>kconf</filename> and <filename>patch</filename>
+ commands, respectively.
+ </para>
+
+ <note>
+ It is not strictly necessary to create a kernel type
+ <filename>.scc</filename> file.
+ The Board Support Package (BSP) file can implicitly define
+ the kernel type using a <filename>define
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'>KTYPE</ulink> myktype</filename>
+ line.
+ See the "<link linkend='bsp-descriptions'>BSP Descriptions</link>"
+ section for more information.
+ </note>
+ </section>
+
+ <section id='bsp-descriptions'>
+ <title>BSP Descriptions</title>
+
+ <para>
+ BSP descriptions (i.e. <filename>*.scc</filename> files)
+ combine kernel types with hardware-specific features.
+ The hardware-specific Metadata is typically defined
+ independently in the BSP layer, and then aggregated with each
+ supported kernel type.
+ <note>
+ For BSPs supported by the Yocto Project, the BSP description
+ files are located in the <filename>bsp</filename> directory
+ of the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache/tree/bsp'><filename>yocto-kernel-cache</filename></ulink>
+ repository organized under the "Yocto Linux Kernel" heading
+ in the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Yocto Project Source Repositories</ulink>.
+ </note>
+ </para>
+
+ <para>
+ This section overviews the BSP description structure, the
+ aggregation concepts, and presents a detailed example using
+ a BSP supported by the Yocto Project (i.e. BeagleBone Board).
+ For complete information on BSP layer file hierarchy, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ </para>
+
+ <section id='bsp-description-file-overview'>
+ <title>Overview</title>
+
+ <para>
+ For simplicity, consider the following root BSP layer
+ description files for the BeagleBone board.
+ These files employ both a structure and naming convention
+ for consistency.
+ The naming convention for the file is as follows:
+ <literallayout class='monospaced'>
+ <replaceable>bsp_root_name</replaceable>-<replaceable>kernel_type</replaceable>.scc
+ </literallayout>
+ Here are some example root layer BSP filenames for the
+ BeagleBone Board BSP, which is supported by the Yocto Project:
+ <literallayout class='monospaced'>
+ beaglebone-standard.scc
+ beaglebone-preempt-rt.scc
+ </literallayout>
+ Each file uses the root name (i.e "beaglebone") BSP name
+ followed by the kernel type.
+ </para>
+
+ <para>
+ Examine the <filename>beaglebone-standard.scc</filename>
+ file:
+ <literallayout class='monospaced'>
+ define KMACHINE beaglebone
+ define KTYPE standard
+ define KARCH arm
+
+ include ktypes/standard/standard.scc
+ branch beaglebone
+
+ include beaglebone.scc
+
+ # default policy for standard kernels
+ include features/latencytop/latencytop.scc
+ include features/profiling/profiling.scc
+ </literallayout>
+ Every top-level BSP description file should define the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>,
+ and <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink>
+ variables.
+ These variables allow the OpenEmbedded build system to identify
+ the description as meeting the criteria set by the recipe being
+ built.
+ This example supports the "beaglebone" machine for the
+ "standard" kernel and the "arm" architecture.
+ </para>
+
+ <para>
+ Be aware that a hard link between the
+ <filename>KTYPE</filename> variable and a kernel type
+ description file does not exist.
+ Thus, if you do not have the kernel type defined in your kernel
+ Metadata as it is here, you only need to ensure that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></ulink>
+ variable in the kernel recipe and the
+ <filename>KTYPE</filename> variable in the BSP description
+ file match.
+ </para>
+
+ <para>
+ To separate your kernel policy from your hardware configuration,
+ you include a kernel type (<filename>ktype</filename>), such as
+ "standard".
+ In the previous example, this is done using the following:
+ <literallayout class='monospaced'>
+ include ktypes/standard/standard.scc
+ </literallayout>
+ This file aggregates all the configuration fragments, patches,
+ and features that make up your standard kernel policy.
+ See the "<link linkend='kernel-types'>Kernel Types</link>"
+ section for more information.
+ </para>
+
+ <para>
+ To aggregate common configurations and features specific to the
+ kernel for <replaceable>mybsp</replaceable>, use the following:
+ <literallayout class='monospaced'>
+ include <replaceable>mybsp</replaceable>.scc
+ </literallayout>
+ You can see that in the BeagleBone example with the following:
+ <literallayout class='monospaced'>
+ include beaglebone.scc
+ </literallayout>
+ For information on how to break a complete
+ <filename>.config</filename> file into the various
+ configuration fragments, see the
+ "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
+ section.
+ </para>
+
+ <para>
+ Finally, if you have any configurations specific to the
+ hardware that are not in a <filename>*.scc</filename> file,
+ you can include them as follows:
+ <literallayout class='monospaced'>
+ kconf hardware <replaceable>mybsp</replaceable>-<replaceable>extra</replaceable>.cfg
+ </literallayout>
+ The BeagleBone example does not include these types of
+ configurations.
+ However, the Malta 32-bit board does ("mti-malta32").
+ Here is the <filename>mti-malta32-le-standard.scc</filename>
+ file:
+ <literallayout class='monospaced'>
+ define KMACHINE mti-malta32-le
+ define KMACHINE qemumipsel
+ define KTYPE standard
+ define KARCH mips
+
+ include ktypes/standard/standard.scc
+ branch mti-malta32
+
+ include mti-malta32.scc
+ kconf hardware mti-malta32-le.cfg
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='bsp-description-file-example-minnow'>
+ <title>Example</title>
+
+ <para>
+ Many real-world examples are more complex.
+ Like any other <filename>.scc</filename> file, BSP
+ descriptions can aggregate features.
+ Consider the Minnow BSP definition given the
+ <filename>linux-yocto-4.4</filename> branch of the
+ <filename>yocto-kernel-cache</filename> (i.e.
+ <filename>yocto-kernel-cache/bsp/minnow/minnow.scc</filename>):
+ <note>
+ Although the Minnow Board BSP is unused, the Metadata
+ remains and is being used here just as an example.
+ </note>
+ <literallayout class='monospaced'>
+ include cfg/x86.scc
+ include features/eg20t/eg20t.scc
+ include cfg/dmaengine.scc
+ include features/power/intel.scc
+ include cfg/efi.scc
+ include features/usb/ehci-hcd.scc
+ include features/usb/ohci-hcd.scc
+ include features/usb/usb-gadgets.scc
+ include features/usb/touchscreen-composite.scc
+ include cfg/timer/hpet.scc
+ include features/leds/leds.scc
+ include features/spi/spidev.scc
+ include features/i2c/i2cdev.scc
+ include features/mei/mei-txe.scc
+
+ # Earlyprintk and port debug requires 8250
+ kconf hardware cfg/8250.cfg
+
+ kconf hardware minnow.cfg
+ kconf hardware minnow-dev.cfg
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>minnow.scc</filename> description file includes
+ a hardware configuration fragment
+ (<filename>minnow.cfg</filename>) specific to the Minnow
+ BSP as well as several more general configuration
+ fragments and features enabling hardware found on the
+ machine.
+ This <filename>minnow.scc</filename> description file is then
+ included in each of the three
+ "minnow" description files for the supported kernel types
+ (i.e. "standard", "preempt-rt", and "tiny").
+ Consider the "minnow" description for the "standard" kernel
+ type (i.e. <filename>minnow-standard.scc</filename>:
+ <literallayout class='monospaced'>
+ define KMACHINE minnow
+ define KTYPE standard
+ define KARCH i386
+
+ include ktypes/standard
+
+ include minnow.scc
+
+ # Extra minnow configs above the minimal defined in minnow.scc
+ include cfg/efi-ext.scc
+ include features/media/media-all.scc
+ include features/sound/snd_hda_intel.scc
+
+ # The following should really be in standard.scc
+ # USB live-image support
+ include cfg/usb-mass-storage.scc
+ include cfg/boot-live.scc
+
+ # Basic profiling
+ include features/latencytop/latencytop.scc
+ include features/profiling/profiling.scc
+
+ # Requested drivers that don't have an existing scc
+ kconf hardware minnow-drivers-extra.cfg
+ </literallayout>
+ The <filename>include</filename> command midway through the file
+ includes the <filename>minnow.scc</filename> description that
+ defines all enabled hardware for the BSP that is common to
+ all kernel types.
+ Using this command significantly reduces duplication.
+ </para>
+
+ <para>
+ Now consider the "minnow" description for the "tiny" kernel
+ type (i.e. <filename>minnow-tiny.scc</filename>):
+ <literallayout class='monospaced'>
+ define KMACHINE minnow
+ define KTYPE tiny
+ define KARCH i386
+
+ include ktypes/tiny
+
+ include minnow.scc
+ </literallayout>
+ As you might expect, the "tiny" description includes quite a
+ bit less.
+ In fact, it includes only the minimal policy defined by the
+ "tiny" kernel type and the hardware-specific configuration
+ required for booting the machine along with the most basic
+ functionality of the system as defined in the base "minnow"
+ description file.
+ </para>
+
+ <para>
+ Notice again the three critical variables:
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink>.
+ Of these variables, only <filename>KTYPE</filename>
+ has changed to specify the "tiny" kernel type.
+ </para>
+ </section>
+ </section>
+</section>
+
+<section id='kernel-metadata-location'>
+ <title>Kernel Metadata Location</title>
+
+ <para>
+ Kernel Metadata always exists outside of the kernel tree either
+ defined in a kernel recipe (recipe-space) or outside of the recipe.
+ Where you choose to define the Metadata depends on what you want
+ to do and how you intend to work.
+ Regardless of where you define the kernel Metadata, the syntax used
+ applies equally.
+ </para>
+
+ <para>
+ If you are unfamiliar with the Linux kernel and only wish
+ to apply a configuration and possibly a couple of patches provided to
+ you by others, the recipe-space method is recommended.
+ This method is also a good approach if you are working with Linux kernel
+ sources you do not control or if you just do not want to maintain a
+ Linux kernel Git repository on your own.
+ For partial information on how you can define kernel Metadata in
+ the recipe-space, see the
+ "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
+ section.
+ </para>
+
+ <para>
+ Conversely, if you are actively developing a kernel and are already
+ maintaining a Linux kernel Git repository of your own, you might find
+ it more convenient to work with kernel Metadata kept outside the
+ recipe-space.
+ Working with Metadata in this area can make iterative development of
+ the Linux kernel more efficient outside of the BitBake environment.
+ </para>
+
+ <section id='recipe-space-metadata'>
+ <title>Recipe-Space Metadata</title>
+
+ <para>
+ When stored in recipe-space, the kernel Metadata files reside in a
+ directory hierarchy below
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>.
+ For a linux-yocto recipe or for a Linux kernel recipe derived
+ by copying and modifying
+ <filename>oe-core/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb</filename>
+ to a recipe in your layer, <filename>FILESEXTRAPATHS</filename>
+ is typically set to
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>.
+ See the "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
+ section for more information.
+ </para>
+
+ <para>
+ Here is an example that shows a trivial tree of kernel Metadata
+ stored in recipe-space within a BSP layer:
+ <literallayout class='monospaced'>
+ meta-<replaceable>my_bsp_layer</replaceable>/
+ `-- recipes-kernel
+ `-- linux
+ `-- linux-yocto
+ |-- bsp-standard.scc
+ |-- bsp.cfg
+ `-- standard.cfg
+ </literallayout>
+ </para>
+
+ <para>
+ When the Metadata is stored in recipe-space, you must take
+ steps to ensure BitBake has the necessary information to decide
+ what files to fetch and when they need to be fetched again.
+ It is only necessary to specify the <filename>.scc</filename>
+ files on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>.
+ BitBake parses them and fetches any files referenced in the
+ <filename>.scc</filename> files by the <filename>include</filename>,
+ <filename>patch</filename>, or <filename>kconf</filename> commands.
+ Because of this, it is necessary to bump the recipe
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ value when changing the content of files not explicitly listed
+ in the <filename>SRC_URI</filename>.
+ </para>
+
+ <para>
+ If the BSP description is in recipe space, you cannot simply list
+ the <filename>*.scc</filename> in the <filename>SRC_URI</filename>
+ statement.
+ You need to use the following form from your kernel append file:
+ <literallayout class='monospaced'>
+ SRC_URI_append_<replaceable>myplatform</replaceable> = " \
+ file://<replaceable>myplatform</replaceable>;type=kmeta;destsuffix=<replaceable>myplatform</replaceable> \
+ "
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='metadata-outside-the-recipe-space'>
+ <title>Metadata Outside the Recipe-Space</title>
+
+ <para>
+ When stored outside of the recipe-space, the kernel Metadata
+ files reside in a separate repository.
+ The OpenEmbedded build system adds the Metadata to the build as
+ a "type=kmeta" repository through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable.
+ As an example, consider the following <filename>SRC_URI</filename>
+ statement from the <filename>linux-yocto_4.12.bb</filename>
+ kernel recipe:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
+ </literallayout>
+ <filename>${KMETA}</filename>, in this context, is simply used to
+ name the directory into which the Git fetcher places the Metadata.
+ This behavior is no different than any multi-repository
+ <filename>SRC_URI</filename> statement used in a recipe (e.g.
+ see the previous section).
+ </para>
+
+ <para>
+ You can keep kernel Metadata in a "kernel-cache", which is a
+ directory containing configuration fragments.
+ As with any Metadata kept outside the recipe-space, you simply
+ need to use the <filename>SRC_URI</filename> statement with the
+ "type=kmeta" attribute.
+ Doing so makes the kernel Metadata available during the
+ configuration phase.
+ </para>
+
+ <para>
+ If you modify the Metadata, you must not forget to update the
+ <filename>SRCREV</filename> statements in the kernel's recipe.
+ In particular, you need to update the
+ <filename>SRCREV_meta</filename> variable to match the commit in
+ the <filename>KMETA</filename> branch you wish to use.
+ Changing the data in these branches and not updating the
+ <filename>SRCREV</filename> statements to match will cause the
+ build to fetch an older commit.
+ </para>
+ </section>
+</section>
+
+<section id='organizing-your-source'>
+ <title>Organizing Your Source</title>
+
+ <para>
+ Many recipes based on the <filename>linux-yocto-custom.bb</filename>
+ recipe use Linux kernel sources that have only a single
+ branch - "master".
+ This type of repository structure is fine for linear development
+ supporting a single machine and architecture.
+ However, if you work with multiple boards and architectures,
+ a kernel source repository with multiple branches is more
+ efficient.
+ For example, suppose you need a series of patches for one board to boot.
+ Sometimes, these patches are works-in-progress or fundamentally wrong,
+ yet they are still necessary for specific boards.
+ In these situations, you most likely do not want to include these
+ patches in every kernel you build (i.e. have the patches as part of
+ the lone "master" branch).
+ It is situations like these that give rise to multiple branches used
+ within a Linux kernel sources Git repository.
+ </para>
+
+ <para>
+ Repository organization strategies exist that maximize source reuse,
+ remove redundancy, and logically order your changes.
+ This section presents strategies for the following cases:
+ <itemizedlist>
+ <listitem><para>Encapsulating patches in a feature description
+ and only including the patches in the BSP descriptions of
+ the applicable boards.</para></listitem>
+ <listitem><para>Creating a machine branch in your
+ kernel source repository and applying the patches on that
+ branch only.</para></listitem>
+ <listitem><para>Creating a feature branch in your
+ kernel source repository and merging that branch into your
+ BSP when needed.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The approach you take is entirely up to you
+ and depends on what works best for your development model.
+ </para>
+
+ <section id='encapsulating-patches'>
+ <title>Encapsulating Patches</title>
+
+ <para>
+ if you are reusing patches from an external tree and are not
+ working on the patches, you might find the encapsulated feature
+ to be appropriate.
+ Given this scenario, you do not need to create any branches in the
+ source repository.
+ Rather, you just take the static patches you need and encapsulate
+ them within a feature description.
+ Once you have the feature description, you simply include that into
+ the BSP description as described in the
+ "<link linkend='bsp-descriptions'>BSP Descriptions</link>"
+ section.
+ </para>
+
+ <para>
+ You can find information on how to create patches and BSP
+ descriptions in the "<link linkend='patches'>Patches</link>" and
+ "<link linkend='bsp-descriptions'>BSP Descriptions</link>"
+ sections.
+ </para>
+ </section>
+
+ <section id='machine-branches'>
+ <title>Machine Branches</title>
+
+ <para>
+ When you have multiple machines and architectures to support,
+ or you are actively working on board support, it is more
+ efficient to create branches in the repository based on
+ individual machines.
+ Having machine branches allows common source to remain in the
+ "master" branch with any features specific to a machine stored
+ in the appropriate machine branch.
+ This organization method frees you from continually reintegrating
+ your patches into a feature.
+ </para>
+
+ <para>
+ Once you have a new branch, you can set up your kernel Metadata
+ to use the branch a couple different ways.
+ In the recipe, you can specify the new branch as the
+ <filename>KBRANCH</filename> to use for the board as
+ follows:
+ <literallayout class='monospaced'>
+ KBRANCH = "mynewbranch"
+ </literallayout>
+ Another method is to use the <filename>branch</filename> command
+ in the BSP description:
+ <literallayout class='monospaced'>
+ mybsp.scc:
+ define KMACHINE mybsp
+ define KTYPE standard
+ define KARCH i386
+ include standard.scc
+
+ branch mynewbranch
+
+ include mybsp-hw.scc
+ </literallayout>
+ </para>
+
+ <para>
+ If you find yourself with numerous branches, you might consider
+ using a hierarchical branching system similar to what the
+ Yocto Linux Kernel Git repositories use:
+ <literallayout class='monospaced'>
+ <replaceable>common</replaceable>/<replaceable>kernel_type</replaceable>/<replaceable>machine</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ If you had two kernel types, "standard" and "small" for
+ instance, three machines, and <replaceable>common</replaceable>
+ as <filename>mydir</filename>, the branches in your
+ Git repository might look like this:
+ <literallayout class='monospaced'>
+ mydir/base
+ mydir/standard/base
+ mydir/standard/machine_a
+ mydir/standard/machine_b
+ mydir/standard/machine_c
+ mydir/small/base
+ mydir/small/machine_a
+ </literallayout>
+ </para>
+
+ <para>
+ This organization can help clarify the branch relationships.
+ In this case, <filename>mydir/standard/machine_a</filename>
+ includes everything in <filename>mydir/base</filename> and
+ <filename>mydir/standard/base</filename>.
+ The "standard" and "small" branches add sources specific to those
+ kernel types that for whatever reason are not appropriate for the
+ other branches.
+ <note>
+ The "base" branches are an artifact of the way Git manages
+ its data internally on the filesystem: Git will not allow you
+ to use <filename>mydir/standard</filename> and
+ <filename>mydir/standard/machine_a</filename> because it
+ would have to create a file and a directory named "standard".
+ </note>
+ </para>
+ </section>
+
+ <section id='feature-branches'>
+ <title>Feature Branches</title>
+
+ <para>
+ When you are actively developing new features, it can be more
+ efficient to work with that feature as a branch, rather than
+ as a set of patches that have to be regularly updated.
+ The Yocto Project Linux kernel tools provide for this with
+ the <filename>git merge</filename> command.
+ </para>
+
+ <para>
+ To merge a feature branch into a BSP, insert the
+ <filename>git merge</filename> command after any
+ <filename>branch</filename> commands:
+ <literallayout class='monospaced'>
+ mybsp.scc:
+ define KMACHINE mybsp
+ define KTYPE standard
+ define KARCH i386
+ include standard.scc
+
+ branch mynewbranch
+ git merge myfeature
+
+ include mybsp-hw.scc
+ </literallayout>
+ </para>
+ </section>
+</section>
+
+<section id='scc-reference'>
+ <title>SCC Description File Reference</title>
+
+ <para>
+ This section provides a brief reference for the commands you can use
+ within an SCC description file (<filename>.scc</filename>):
+ <itemizedlist>
+ <listitem><para>
+ <filename>branch [ref]</filename>:
+ Creates a new branch relative to the current branch
+ (typically <filename>${KTYPE}</filename>) using
+ the currently checked-out branch, or "ref" if specified.
+ </para></listitem>
+ <listitem><para>
+ <filename>define</filename>:
+ Defines variables, such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KTYPE'><filename>KTYPE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KARCH'><filename>KARCH</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KFEATURE_DESCRIPTION'><filename>KFEATURE_DESCRIPTION</filename></ulink>.
+ </para></listitem>
+ <listitem><para>
+ <filename>include SCC_FILE</filename>:
+ Includes an SCC file in the current file.
+ The file is parsed as if you had inserted it inline.
+ </para></listitem>
+ <listitem><para>
+ <filename>kconf [hardware|non-hardware] CFG_FILE</filename>:
+ Queues a configuration fragment for merging into the final
+ Linux <filename>.config</filename> file.</para></listitem>
+ <listitem><para>
+ <filename>git merge GIT_BRANCH</filename>:
+ Merges the feature branch into the current branch.
+ </para></listitem>
+ <listitem><para>
+ <filename>patch PATCH_FILE</filename>:
+ Applies the patch to the current Git branch.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-common.xml b/poky/documentation/kernel-dev/kernel-dev-common.xml
new file mode 100644
index 000000000..299bac407
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-common.xml
@@ -0,0 +1,2706 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='kernel-dev-common'>
+<title>Common Tasks</title>
+
+ <para>
+ This chapter presents several common tasks you perform when you
+ work with the Yocto Project Linux kernel.
+ These tasks include preparing your host development system for
+ kernel development, preparing a layer, modifying an existing recipe,
+ patching the kernel, configuring the kernel, iterative development,
+ working with your own sources, and incorporating out-of-tree modules.
+ <note>
+ The examples presented in this chapter work with the Yocto Project
+ 2.4 Release and forward.
+ </note>
+ </para>
+
+ <section id='preparing-the-build-host-to-work-on-the-kernel'>
+ <title>Preparing the Build Host to Work on the Kernel</title>
+
+ <para>
+ Before you can do any kernel development, you need to be
+ sure your build host is set up to use the Yocto Project.
+ For information on how to get set up, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ Part of preparing the system is creating a local Git
+ repository of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (<filename>poky</filename>) on your system.
+ Follow the steps in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</ulink>"
+ section in the Yocto Project Development Tasks Manual to set up your
+ Source Directory.
+ <note>
+ Be sure you check out the appropriate development branch or
+ you create your local branch by checking out a specific tag
+ to get the desired version of Yocto Project.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out by Branch in Poky</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checkout-out-by-tag-in-poky'>Checking Out by Tag in Poky</ulink>"
+ sections in the Yocto Project Development Tasks Manual for more
+ information.
+ </note>
+ </para>
+
+ <para>
+ Kernel development is best accomplished using
+ <ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename></ulink>
+ and not through traditional kernel workflow methods.
+ The remainder of this section provides information for both
+ scenarios.
+ </para>
+
+ <section id='getting-ready-to-develop-using-devtool'>
+ <title>Getting Ready to Develop Using <filename>devtool</filename></title>
+
+ <para>
+ Follow these steps to prepare to update the kernel image using
+ <filename>devtool</filename>.
+ Completing this procedure leaves you with a clean kernel image
+ and ready to make modifications as described in the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ section:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Initialize the BitBake Environment:</emphasis>
+ Before building an extensible SDK, you need to
+ initialize the BitBake build environment by sourcing the
+ build environment script
+ (i.e. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>):
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ source oe-init-build-env
+ </literallayout>
+ <note>
+ The previous commands assume the
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ (i.e. <filename>poky</filename>) have been cloned
+ using Git and the local repository is named
+ "poky".
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Prepare Your <filename>local.conf</filename> File:</emphasis>
+ By default, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable is set to "qemux86", which is fine if you are
+ building for the QEMU emulator in 32-bit mode.
+ However, if you are not, you need to set the
+ <filename>MACHINE</filename> variable appropriately in
+ your <filename>conf/local.conf</filename> file found in
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ (i.e. <filename>~/poky/build</filename> in this
+ example).</para>
+
+ <para>Also, since you are preparing to work on the
+ kernel image, you need to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
+ variable to include kernel modules.</para>
+
+ <para>This example uses the default "qemux86" for the
+ <filename>MACHINE</filename> variable but needs to
+ add the "kernel-modules":
+ <literallayout class='monospaced'>
+ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Layer for Patches:</emphasis>
+ You need to create a layer to hold patches created
+ for the kernel image.
+ You can use the
+ <filename>bitbake-layers create-layer</filename>
+ command as follows:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake-layers create-layer ../../meta-mylayer
+ NOTE: Starting bitbake server...
+ Add your new layer with 'bitbake-layers add-layer ../../meta-mylayer'
+ $
+ </literallayout>
+ <note>
+ For background information on working with
+ common and BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual and the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support (BSP)
+ Developer's Guide, respectively.
+ For information on how to use the
+ <filename>bitbake-layers create-layer</filename>
+ command to quickly set up a layer, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Inform the BitBake Build Environment About
+ Your Layer:</emphasis>
+ As directed when you created your layer, you need to
+ add the layer to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the <filename>bblayers.conf</filename> file
+ as follows:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake-layers add-layer ../../meta-mylayer
+ NOTE: Starting bitbake server...
+ $
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Extensible SDK:</emphasis>
+ Use BitBake to build the extensible SDK specifically
+ for use with images to be run using QEMU:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake core-image-minimal -c populate_sdk_ext
+ </literallayout>
+ Once the build finishes, you can find the SDK installer
+ file (i.e. <filename>*.sh</filename> file) in the
+ following directory:
+ <literallayout class='monospaced'>
+ ~/poky/build/tmp/deploy/sdk
+ </literallayout>
+ For this example, the installer file is named
+ <filename>poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh</filename>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install the Extensible SDK:</emphasis>
+ Use the following command to install the SDK.
+ For this example, install the SDK in the default
+ <filename>~/poky_sdk</filename> directory:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/tmp/deploy/sdk
+ $ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh
+ Poky (Yocto Project Reference Distro) Extensible SDK installer version &DISTRO;
+ ============================================================================
+ Enter target directory for SDK (default: ~/poky_sdk):
+ You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed[Y/n]? Y
+ Extracting SDK......................................done
+ Setting it up...
+ Extracting buildtools...
+ Preparing build system...
+ Parsing recipes: 100% |#################################################################| Time: 0:00:52
+ Initializing tasks: 100% |############## ###############################################| Time: 0:00:04
+ Checking sstate mirror object availability: 100% |######################################| Time: 0:00:00
+ Parsing recipes: 100% |#################################################################| Time: 0:00:33
+ Initializing tasks: 100% |##############################################################| Time: 0:00:00
+ done
+ SDK has been successfully set up and is ready to be used.
+ Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
+ $ . /home/scottrif/poky_sdk/environment-setup-i586-poky-linux
+ </literallayout>
+ </para></listitem>
+ <listitem><para id='setting-up-the-esdk-terminal'>
+ <emphasis>Set Up a New Terminal to Work With the
+ Extensible SDK:</emphasis>
+ You must set up a new terminal to work with the SDK.
+ You cannot use the same BitBake shell used to build the
+ installer.</para>
+
+ <para>After opening a new shell, run the SDK environment
+ setup script as directed by the output from installing
+ the SDK:
+ <literallayout class='monospaced'>
+ $ source ~/poky_sdk/environment-setup-i586-poky-linux
+ "SDK environment now set up; additionally you may now run devtool to perform development tasks.
+ Run devtool --help for further details.
+ </literallayout>
+ <note>
+ If you get a warning about attempting to use the
+ extensible SDK in an environment set up to run
+ BitBake, you did not use a new shell.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Clean Image:</emphasis>
+ The final step in preparing to work on the kernel is to
+ build an initial image using
+ <filename>devtool</filename> in the new terminal you
+ just set up and initialized for SDK work:
+ <literallayout class='monospaced'>
+ $ devtool build-image
+ Parsing recipes: 100% |##########################################| Time: 0:00:05
+ Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors.
+ WARNING: No packages to add, building image core-image-minimal unmodified
+ Loading cache: 100% |############################################| Time: 0:00:00
+ Loaded 1299 entries from dependency cache.
+ NOTE: Resolving any missing task queue dependencies
+ Initializing tasks: 100% |#######################################| Time: 0:00:07
+ Checking sstate mirror object availability: 100% |###############| Time: 0:00:00
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need to be rerun and all succeeded.
+ NOTE: Successfully built core-image-minimal. You can find output files in /home/scottrif/poky_sdk/tmp/deploy/images/qemux86
+ </literallayout>
+ If you were building for actual hardware and not for
+ emulation, you could flash the image to a USB stick
+ on <filename>/dev/sdd</filename> and boot your device.
+ For an example that uses a Minnowboard, see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/KernelDevelopmentWithEsdk'>TipsAndTricks/KernelDevelopmentWithEsdk</ulink>
+ Wiki page.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ At this point you have set up to start making modifications to
+ the kernel by using the extensible SDK.
+ For a continued example, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='getting-ready-for-traditional-kernel-development'>
+ <title>Getting Ready for Traditional Kernel Development</title>
+
+ <para>
+ Getting ready for traditional kernel development using the Yocto
+ Project involves many of the same steps as described in the
+ previous section.
+ However, you need to establish a local copy of the kernel source
+ since you will be editing these files.
+ </para>
+
+ <para>
+ Follow these steps to prepare to update the kernel image using
+ traditional kernel development flow with the Yocto Project.
+ Completing this procedure leaves you ready to make modifications
+ to the kernel source as described in the
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ section:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Initialize the BitBake Environment:</emphasis>
+ Before you can do anything using BitBake, you need to
+ initialize the BitBake build environment by sourcing the
+ build environment script
+ (i.e. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>).
+ Also, for this example, be sure that the local branch
+ you have checked out for <filename>poky</filename> is
+ the Yocto Project &DISTRO_NAME; branch.
+ If you need to checkout out the &DISTRO_NAME; branch,
+ see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking out by Branch in Poky</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ <literallayout class='monospaced'>
+ $ cd ~/poky
+ $ git branch
+ master
+ * &DISTRO_NAME;
+ $ source oe-init-build-env
+ </literallayout>
+ <note>
+ The previous commands assume the
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ (i.e. <filename>poky</filename>) have been cloned
+ using Git and the local repository is named
+ "poky".
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Prepare Your <filename>local.conf</filename>
+ File:</emphasis>
+ By default, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable is set to "qemux86", which is fine if you are
+ building for the QEMU emulator in 32-bit mode.
+ However, if you are not, you need to set the
+ <filename>MACHINE</filename> variable appropriately in
+ your <filename>conf/local.conf</filename> file found
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ (i.e. <filename>~/poky/build</filename> in this
+ example).</para>
+
+ <para>Also, since you are preparing to work on the
+ kernel image, you need to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
+ variable to include kernel modules.</para>
+
+ <para>This example uses the default "qemux86" for the
+ <filename>MACHINE</filename> variable but needs to
+ add the "kernel-modules":
+ <literallayout class='monospaced'>
+ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Layer for Patches:</emphasis>
+ You need to create a layer to hold patches created
+ for the kernel image.
+ You can use the
+ <filename>bitbake-layers create-layer</filename>
+ command as follows:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake-layers create-layer ../../meta-mylayer
+ NOTE: Starting bitbake server...
+ Add your new layer with 'bitbake-layers add-layer ../../meta-mylayer'
+ </literallayout>
+ <note>
+ For background information on working with
+ common and BSP layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual and the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support (BSP)
+ Developer's Guide, respectively.
+ For information on how to use the
+ <filename>bitbake-layers create-layer</filename>
+ command to quickly set up a layer, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Inform the BitBake Build Environment About
+ Your Layer:</emphasis>
+ As directed when you created your layer, you need to add
+ the layer to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
+ variable in the <filename>bblayers.conf</filename> file
+ as follows:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake-layers add-layer ../../meta-mylayer
+ NOTE: Starting bitbake server ...
+ $
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Local Copy of the Kernel Git
+ Repository:</emphasis>
+ You can find Git repositories of supported Yocto Project
+ kernels organized under "Yocto Linux Kernel" in the
+ Yocto Project Source Repositories at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ </para>
+
+ <para>
+ For simplicity, it is recommended that you create your
+ copy of the kernel Git repository outside of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>,
+ which is usually named <filename>poky</filename>.
+ Also, be sure you are in the
+ <filename>standard/base</filename> branch.
+ </para>
+
+ <para>
+ The following commands show how to create a local copy
+ of the <filename>linux-yocto-4.12</filename> kernel and
+ be in the <filename>standard/base</filename> branch.
+ <note>
+ The <filename>linux-yocto-4.12</filename> kernel
+ can be used with the Yocto Project 2.4 release
+ and forward.
+ You cannot use the
+ <filename>linux-yocto-4.12</filename> kernel with
+ releases prior to Yocto Project 2.4:
+ </note>
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/linux-yocto-4.12 --branch standard/base
+ Cloning into 'linux-yocto-4.12'...
+ remote: Counting objects: 6097195, done.
+ remote: Compressing objects: 100% (901026/901026), done.
+ remote: Total 6097195 (delta 5152604), reused 6096847 (delta 5152256)
+ Receiving objects: 100% (6097195/6097195), 1.24 GiB | 7.81 MiB/s, done.
+ Resolving deltas: 100% (5152604/5152604), done.
+ Checking connectivity... done.
+ Checking out files: 100% (59846/59846), done.
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Local Copy of the Kernel Cache Git
+ Repository:</emphasis>
+ For simplicity, it is recommended that you create your
+ copy of the kernel cache Git repository outside of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>,
+ which is usually named <filename>poky</filename>.
+ Also, for this example, be sure you are in the
+ <filename>yocto-4.12</filename> branch.
+ </para>
+
+ <para>
+ The following commands show how to create a local copy
+ of the <filename>yocto-kernel-cache</filename> and
+ be in the <filename>yocto-4.12</filename> branch:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/yocto-kernel-cache --branch yocto-4.12
+ Cloning into 'yocto-kernel-cache'...
+ remote: Counting objects: 22639, done.
+ remote: Compressing objects: 100% (9761/9761), done.
+ remote: Total 22639 (delta 12400), reused 22586 (delta 12347)
+ Receiving objects: 100% (22639/22639), 22.34 MiB | 6.27 MiB/s, done.
+ Resolving deltas: 100% (12400/12400), done.
+ Checking connectivity... done.
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ At this point, you are ready to start making modifications to
+ the kernel using traditional kernel development steps.
+ For a continued example, see the
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ section.
+ </para>
+ </section>
+ </section>
+
+ <section id='creating-and-preparing-a-layer'>
+ <title>Creating and Preparing a Layer</title>
+
+ <para>
+ If you are going to be modifying kernel recipes, it is recommended
+ that you create and prepare your own layer in which to do your
+ work.
+ Your layer contains its own
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ append files (<filename>.bbappend</filename>) and provides a
+ convenient mechanism to create your own recipe files
+ (<filename>.bb</filename>) as well as store and use kernel
+ patch files.
+ For background information on working with layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ <note><title>Tip</title>
+ The Yocto Project comes with many tools that simplify
+ tasks you need to perform.
+ One such tool is the
+ <filename>bitbake-layers create-layer</filename>
+ command, which simplifies creating a new layer.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-general-layer-using-the-bitbake-layers-script'>Creating a General Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ information on how to use this script to quick set up a
+ new layer.
+ </note>
+ </para>
+
+ <para>
+ To better understand the layer you create for kernel development,
+ the following section describes how to create a layer
+ without the aid of tools.
+ These steps assume creation of a layer named
+ <filename>mylayer</filename> in your home directory:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create Structure</emphasis>:
+ Create the layer's structure:
+ <literallayout class='monospaced'>
+ $ cd $HOME
+ $ mkdir meta-mylayer
+ $ mkdir meta-mylayer/conf
+ $ mkdir meta-mylayer/recipes-kernel
+ $ mkdir meta-mylayer/recipes-kernel/linux
+ $ mkdir meta-mylayer/recipes-kernel/linux/linux-yocto
+ </literallayout>
+ The <filename>conf</filename> directory holds your
+ configuration files, while the
+ <filename>recipes-kernel</filename> directory holds your
+ append file and eventual patch files.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the Layer Configuration File</emphasis>:
+ Move to the <filename>meta-mylayer/conf</filename>
+ directory and create the <filename>layer.conf</filename>
+ file as follows:
+ <literallayout class='monospaced'>
+ # 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 += "mylayer"
+ BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
+ BBFILE_PRIORITY_mylayer = "5"
+ </literallayout>
+ Notice <filename>mylayer</filename> as part of the last
+ three statements.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the Kernel Recipe Append File</emphasis>:
+ Move to the
+ <filename>meta-mylayer/recipes-kernel/linux</filename>
+ directory and create the kernel's append file.
+ This example uses the
+ <filename>linux-yocto-4.12</filename> kernel.
+ Thus, the name of the append file is
+ <filename>linux-yocto_4.12.bbappend</filename>:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+ SRC_URI_append += "file://<replaceable>patch-file-one</replaceable>"
+ SRC_URI_append += "file://<replaceable>patch-file-two</replaceable>"
+ SRC_URI_append += "file://<replaceable>patch-file-three</replaceable>"
+ </literallayout>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements enable the OpenEmbedded build system to find
+ patch files.
+ For more information on using append files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='modifying-an-existing-recipe'>
+ <title>Modifying an Existing Recipe</title>
+
+ <para>
+ In many cases, you can customize an existing linux-yocto recipe to
+ meet the needs of your project.
+ Each release of the Yocto Project provides a few Linux
+ kernel recipes from which you can choose.
+ These are located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ in <filename>meta/recipes-kernel/linux</filename>.
+ </para>
+
+ <para>
+ Modifying an existing recipe can consist of the following:
+ <itemizedlist>
+ <listitem><para>Creating the append file</para></listitem>
+ <listitem><para>Applying patches</para></listitem>
+ <listitem><para>Changing the configuration</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Before modifying an existing recipe, be sure that you have created
+ a minimal, custom layer from which you can work.
+ See the
+ "<link linkend='creating-and-preparing-a-layer'>Creating and Preparing a Layer</link>"
+ section for information.
+ </para>
+
+ <section id='creating-the-append-file'>
+ <title>Creating the Append File</title>
+
+ <para>
+ You create this file in your custom layer.
+ You also name it accordingly based on the linux-yocto recipe
+ you are using.
+ For example, if you are modifying the
+ <filename>meta/recipes-kernel/linux/linux-yocto_4.12.bb</filename>
+ recipe, the append file will typically be located as follows
+ within your custom layer:
+ <literallayout class='monospaced'>
+ <replaceable>your-layer</replaceable>/recipes-kernel/linux/linux-yocto_4.12.bbappend
+ </literallayout>
+ The append file should initially extend the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ search path by prepending the directory that contains your
+ files to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ variable as follows:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ </literallayout>
+ The path <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-THISDIR'><filename>THISDIR</filename></ulink><filename>}/${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
+ expands to "linux-yocto" in the current directory for this
+ example.
+ If you add any new files that modify the kernel recipe and you
+ have extended <filename>FILESPATH</filename> as
+ described above, you must place the files in your layer in the
+ following area:
+ <literallayout class='monospaced'>
+ <replaceable>your-layer</replaceable>/recipes-kernel/linux/linux-yocto/
+ </literallayout>
+ <note>If you are working on a new machine Board Support Package
+ (BSP), be sure to refer to the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ </note>
+ </para>
+
+ <para>
+ As an example, consider the following append file
+ used by the BSPs in <filename>meta-yocto-bsp</filename>:
+ <literallayout class='monospaced'>
+ meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
+ </literallayout>
+ The following listing shows the file.
+ Be aware that the actual commit ID strings in this
+ example listing might be different than the actual strings
+ in the file from the <filename>meta-yocto-bsp</filename>
+ layer upstream.
+ <literallayout class='monospaced'>
+ KBRANCH_genericx86 = "standard/base"
+ KBRANCH_genericx86-64 = "standard/base"
+
+ KMACHINE_genericx86 ?= "common-pc"
+ KMACHINE_genericx86-64 ?= "common-pc-64"
+ KBRANCH_edgerouter = "standard/edgerouter"
+ KBRANCH_beaglebone = "standard/beaglebone"
+ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+ SRCREV_machine_genericx86 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
+ SRCREV_machine_genericx86-64 ?= "d09f2ce584d60ecb7890550c22a80c48b83c2e19"
+ SRCREV_machine_edgerouter ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
+ SRCREV_machine_beaglebone ?= "b5c8cfda2dfe296410d51e131289fb09c69e1e7d"
+ SRCREV_machine_mpc8315e-rdb ?= "2d1d010240846d7bff15d1fcc0cb6eb8a22fc78a"
+
+
+ COMPATIBLE_MACHINE_genericx86 = "genericx86"
+ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+ COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+ COMPATIBLE_MACHINE_beaglebone = "beaglebone"
+ COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+ LINUX_VERSION_genericx86 = "4.12.7"
+ LINUX_VERSION_genericx86-64 = "4.12.7"
+ LINUX_VERSION_edgerouter = "4.12.10"
+ LINUX_VERSION_beaglebone = "4.12.10"
+ LINUX_VERSION_mpc8315e-rdb = "4.12.10"
+ </literallayout>
+ This append file contains statements used to support
+ several BSPs that ship with the Yocto Project.
+ The file defines machines using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>
+ variable and uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KMACHINE'><filename>KMACHINE</filename></ulink>
+ variable to ensure the machine name used by the OpenEmbedded
+ build system maps to the machine name used by the Linux Yocto
+ kernel.
+ The file also uses the optional
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KBRANCH'><filename>KBRANCH</filename></ulink>
+ variable to ensure the build process uses the
+ appropriate kernel branch.
+ </para>
+
+ <para>
+ Although this particular example does not use it, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+ variable could be used to enable features specific to
+ the kernel.
+ The append file points to specific commits in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ Git repository and the <filename>meta</filename> Git repository
+ branches to identify the exact kernel needed to build the
+ BSP.
+ </para>
+
+ <para>
+ One thing missing in this particular BSP, which you will
+ typically need when developing a BSP, is the kernel
+ configuration file (<filename>.config</filename>) for your BSP.
+ When developing a BSP, you probably have a kernel configuration
+ file or a set of kernel configuration files that, when taken
+ together, define the kernel configuration for your BSP.
+ You can accomplish this definition by putting the configurations
+ in a file or a set of files inside a directory located at the
+ same level as your kernel's append file and having the same
+ name as the kernel's main recipe file.
+ With all these conditions met, simply reference those files in
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement in the append file.
+ </para>
+
+ <para>
+ For example, suppose you had some configuration options
+ in a file called <filename>network_configs.cfg</filename>.
+ You can place that file inside a directory named
+ <filename>linux-yocto</filename> and then add
+ a <filename>SRC_URI</filename> statement such as the
+ following to the append file.
+ When the OpenEmbedded build system builds the kernel, the
+ configuration options are picked up and applied.
+ <literallayout class='monospaced'>
+ SRC_URI += "file://network_configs.cfg"
+ </literallayout>
+ </para>
+
+ <para>
+ To group related configurations into multiple files, you
+ perform a similar procedure.
+ Here is an example that groups separate configurations
+ specifically for Ethernet and graphics into their own
+ files and adds the configurations by using a
+ <filename>SRC_URI</filename> statement like the following
+ in your append file:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://myconfig.cfg \
+ file://eth.cfg \
+ file://gfx.cfg"
+ </literallayout>
+ </para>
+
+ <para>
+ Another variable you can use in your kernel recipe append
+ file is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ variable.
+ When you use this statement, you are extending the locations
+ used by the OpenEmbedded system to look for files and
+ patches as the recipe is processed.
+ </para>
+
+ <note>
+ <para>
+ Other methods exist to accomplish grouping and defining
+ configuration options.
+ For example, if you are working with a local clone of the
+ kernel repository, you could checkout the kernel's
+ <filename>meta</filename> branch, make your changes, and
+ then push the changes to the local bare clone of the
+ kernel.
+ The result is that you directly add configuration options
+ to the <filename>meta</filename> branch for your BSP.
+ The configuration options will likely end up in that
+ location anyway if the BSP gets added to the Yocto Project.
+ </para>
+
+ <para>
+ In general, however, the Yocto Project maintainers take
+ care of moving the <filename>SRC_URI</filename>-specified
+ configuration options to the kernel's
+ <filename>meta</filename> branch.
+ Not only is it easier for BSP developers to not have to
+ worry about putting those configurations in the branch,
+ but having the maintainers do it allows them to apply
+ 'global' knowledge about the kinds of common configuration
+ options multiple BSPs in the tree are typically using.
+ This allows for promotion of common configurations into
+ common features.
+ </para>
+ </note>
+ </section>
+
+ <section id='applying-patches'>
+ <title>Applying Patches</title>
+
+ <para>
+ If you have a single patch or a small series of patches
+ that you want to apply to the Linux kernel source, you
+ can do so just as you would with any other recipe.
+ You first copy the patches to the path added to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ in your <filename>.bbappend</filename> file as described in
+ the previous section, and then reference them in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements.
+ </para>
+
+ <para>
+ For example, you can apply a three-patch series by adding the
+ following lines to your linux-yocto
+ <filename>.bbappend</filename> file in your layer:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://0001-first-change.patch"
+ SRC_URI += "file://0002-second-change.patch"
+ SRC_URI += "file://0003-third-change.patch"
+ </literallayout>
+ The next time you run BitBake to build the Linux kernel,
+ BitBake detects the change in the recipe and fetches and
+ applies the patches before building the kernel.
+ </para>
+
+ <para>
+ For a detailed example showing how to patch the kernel using
+ <filename>devtool</filename>, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ and
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ sections.
+ </para>
+ </section>
+
+ <section id='changing-the-configuration'>
+ <title>Changing the Configuration</title>
+
+ <para>
+ You can make wholesale or incremental changes to the final
+ <filename>.config</filename> file used for the eventual
+ Linux kernel configuration by including a
+ <filename>defconfig</filename> file and by specifying
+ configuration fragments in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ to be applied to that file.
+ </para>
+
+ <para>
+ If you have a complete, working Linux kernel
+ <filename>.config</filename>
+ file you want to use for the configuration, as before, copy
+ that file to the appropriate <filename>${PN}</filename>
+ directory in your layer's
+ <filename>recipes-kernel/linux</filename> directory,
+ and rename the copied file to "defconfig".
+ Then, add the following lines to the linux-yocto
+ <filename>.bbappend</filename> file in your layer:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ SRC_URI += "file://defconfig"
+ </literallayout>
+ The <filename>SRC_URI</filename> tells the build system how to
+ search for the file, while the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ extends the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable (search directories) to include the
+ <filename>${PN}</filename> directory you created to hold the
+ configuration changes.
+ </para>
+
+ <note>
+ The build system applies the configurations from the
+ <filename>defconfig</filename> file before applying any
+ subsequent configuration fragments.
+ The final kernel configuration is a combination of the
+ configurations in the <filename>defconfig</filename> file and
+ any configuration fragments you provide.
+ You need to realize that if you have any configuration
+ fragments, the build system applies these on top of and
+ after applying the existing <filename>defconfig</filename>
+ file configurations.
+ </note>
+
+ <para>
+ Generally speaking, the preferred approach is to determine the
+ incremental change you want to make and add that as a
+ configuration fragment.
+ For example, if you want to add support for a basic serial
+ console, create a file named <filename>8250.cfg</filename> in
+ the <filename>${PN}</filename> directory with the following
+ content (without indentation):
+ <literallayout class='monospaced'>
+ CONFIG_SERIAL_8250=y
+ CONFIG_SERIAL_8250_CONSOLE=y
+ CONFIG_SERIAL_8250_PCI=y
+ CONFIG_SERIAL_8250_NR_UARTS=4
+ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+ CONFIG_SERIAL_CORE=y
+ CONFIG_SERIAL_CORE_CONSOLE=y
+ </literallayout>
+ Next, include this configuration fragment and extend the
+ <filename>FILESPATH</filename> variable in your
+ <filename>.bbappend</filename> file:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ SRC_URI += "file://8250.cfg"
+ </literallayout>
+ The next time you run BitBake to build the Linux kernel, BitBake
+ detects the change in the recipe and fetches and applies the
+ new configuration before building the kernel.
+ </para>
+
+ <para>
+ For a detailed example showing how to configure the kernel,
+ see the
+ "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='using-an-in-tree-defconfig-file'>
+ <title>Using an "In-Tree"&nbsp;&nbsp;<filename>defconfig</filename> File</title>
+
+ <para>
+ It might be desirable to have kernel configuration fragment
+ support through a <filename>defconfig</filename> file that
+ is pulled from the kernel source tree for the configured
+ machine.
+ By default, the OpenEmbedded build system looks for
+ <filename>defconfig</filename> files in the layer used for
+ Metadata, which is "out-of-tree", and then configures them
+ using the following:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://defconfig"
+ </literallayout>
+ If you do not want to maintain copies of
+ <filename>defconfig</filename> files in your layer but would
+ rather allow users to use the default configuration from the
+ kernel tree and still be able to add configuration fragments
+ to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ through, for example, append files, you can direct the
+ OpenEmbedded build system to use a
+ <filename>defconfig</filename> file that is "in-tree".
+ </para>
+
+ <para>
+ To specify an "in-tree" <filename>defconfig</filename> file,
+ use the following statement form:
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_<replaceable>KMACHINE</replaceable> ?= <replaceable>defconfig_file</replaceable>
+ </literallayout>
+ Here is an example that appends the
+ <filename>KBUILD_DEFCONFIG</filename> variable with
+ "common-pc" and provides the path to the "in-tree"
+ <filename>defconfig</filename> file:
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_common-pc ?= "/home/scottrif/configfiles/my_defconfig_file"
+ </literallayout>
+ </para>
+
+ <para>
+ Aside from modifying your kernel recipe and providing your own
+ <filename>defconfig</filename> file, you need to be sure no
+ files or statements set <filename>SRC_URI</filename> to use a
+ <filename>defconfig</filename> other than your "in-tree"
+ file (e.g. a kernel's
+ <filename>linux-</filename><replaceable>machine</replaceable><filename>.inc</filename>
+ file).
+ In other words, if the build system detects a statement
+ that identifies an "out-of-tree"
+ <filename>defconfig</filename> file, that statement
+ will override your
+ <filename>KBUILD_DEFCONFIG</filename> variable.
+ </para>
+
+ <para>
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KBUILD_DEFCONFIG'><filename>KBUILD_DEFCONFIG</filename></ulink>
+ variable description for more information.
+ </para>
+ </section>
+ </section>
+
+ <section id="using-devtool-to-patch-the-kernel">
+ <title>Using <filename>devtool</filename> to Patch the Kernel</title>
+
+ <para>
+ The steps in this procedure show you how you can patch the
+ kernel using the extensible SDK and <filename>devtool</filename>.
+ <note>
+ Before attempting this procedure, be sure you have performed
+ the steps to get ready for updating the kernel as described
+ in the
+ "<link linkend='getting-ready-to-develop-using-devtool'>Getting Ready to Develop Using <filename>devtool</filename></link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ Patching the kernel involves changing or adding configurations
+ to an existing kernel, changing or adding recipes to the kernel
+ that are needed to support specific hardware features, or even
+ altering the source code itself.
+ </para>
+
+ <para>
+ This example creates a simple patch by adding some QEMU emulator
+ console output at boot time through <filename>printk</filename>
+ statements in the kernel's <filename>calibrate.c</filename> source
+ code file.
+ Applying the patch and booting the modified image causes the added
+ messages to appear on the emulator's console.
+ The example is a continuation of the setup procedure found in
+ the
+ "<link linkend='getting-ready-to-develop-using-devtool'>Getting Ready to Develop Using <filename>devtool</filename></link>"
+ Section.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Check Out the Kernel Source Files:</emphasis>
+ First you must use <filename>devtool</filename> to checkout
+ the kernel source code in its workspace.
+ Be sure you are in the terminal set up to do work
+ with the extensible SDK.
+ <note>
+ See this
+ <link linkend='setting-up-the-esdk-terminal'>step</link>
+ in the
+ "<link linkend='getting-ready-to-develop-using-devtool'>Getting Ready to Develop Using <filename>devtool</filename></link>"
+ section for more information.
+ </note>
+ Use the following <filename>devtool</filename> command
+ to check out the code:
+ <literallayout class='monospaced'>
+ $ devtool modify linux-yocto
+ </literallayout>
+ <note>
+ During the checkout operation, a bug exists that could
+ cause errors such as the following to appear:
+ <literallayout class='monospaced'>
+ ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus
+ be3a89ce7c47178880ba7bf6293d7404 for
+ /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack
+ </literallayout>
+ You can safely ignore these messages.
+ The source code is correctly checked out.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Source Files</emphasis>
+ Follow these steps to make some simple changes to the source
+ files:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Change the working directory</emphasis>:
+ In the previous step, the output noted where you can find
+ the source files (e.g.
+ <filename>~/poky_sdk/workspace/sources/linux-yocto</filename>).
+ Change to where the kernel source code is before making
+ your edits to the <filename>calibrate.c</filename> file:
+ <literallayout class='monospaced'>
+ $ cd ~/poky_sdk/workspace/sources/linux-yocto
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the source file</emphasis>:
+ Edit the <filename>init/calibrate.c</filename> file to have
+ the following changes:
+ <literallayout class='monospaced'>
+ void calibrate_delay(void)
+ {
+ unsigned long lpj;
+ static bool printed;
+ int this_cpu = smp_processor_id();
+
+ printk("*************************************\n");
+ printk("* *\n");
+ printk("* HELLO YOCTO KERNEL *\n");
+ printk("* *\n");
+ printk("*************************************\n");
+
+ if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
+ .
+ .
+ .
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Updated Kernel Source:</emphasis>
+ To build the updated kernel source, use
+ <filename>devtool</filename>:
+ <literallayout class='monospaced'>
+ $ devtool build linux-yocto
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the Image With the New Kernel:</emphasis>
+ Use the <filename>devtool build-image</filename> command
+ to create a new image that has the new kernel.
+ <note>
+ If the image you originally created resulted in a Wic
+ file, you can use an alternate method to create the new
+ image with the updated kernel.
+ For an example, see the steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/KernelDevelopmentWithEsdk'>TipsAndTricks/KernelDevelopmentWithEsdk</ulink>
+ Wiki Page.
+ </note>
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ devtool build-image core-image-minimal
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test the New Image:</emphasis>
+ For this example, you can run the new image using QEMU
+ to verify your changes:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Boot the image</emphasis>:
+ Boot the modified image in the QEMU emulator
+ using this command:
+ <literallayout class='monospaced'>
+ $ runqemu qemux86
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Verify the changes</emphasis>:
+ Log into the machine using <filename>root</filename>
+ with no password and then use the following shell
+ command to scroll through the console's boot output.
+ <literallayout class='monospaced'>
+ # dmesg | less
+ </literallayout>
+ You should see the results of your
+ <filename>printk</filename> statements
+ as part of the output when you scroll down the
+ console window.
+ </para></listitem>
+ </orderedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage and commit your changes</emphasis>:
+ Within your eSDK terminal, change your working directory to
+ where you modified the <filename>calibrate.c</filename>
+ file and use these Git commands to stage and commit your
+ changes:
+ <literallayout class='monospaced'>
+ $ cd ~/poky_sdk/workspace/sources/linux-yocto
+ $ git status
+ $ git add init/calibrate.c
+ $ git commit -m "calibrate: Add printk example"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Export the Patches and Create an Append File:</emphasis>
+ To export your commits as patches and create a
+ <filename>.bbappend</filename> file, use the following
+ command in the terminal used to work with the extensible
+ SDK.
+ This example uses the previously established layer named
+ <filename>meta-mylayer</filename>.
+ <note>
+ See Step 3 of the
+ "<link linkend='getting-ready-to-develop-using-devtool'>Getting Ready to Develop Using devtool</link>"
+ section for information on setting up this layer.
+ </note>
+ <literallayout class='monospaced'>
+ $ devtool finish linux-yocto ~/meta-mylayer
+ </literallayout>
+ Once the command finishes, the patches and the
+ <filename>.bbappend</filename> file are located in the
+ <filename>~/meta-mylayer/recipes-kernel/linux</filename>
+ directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Image With Your Modified Kernel:</emphasis>
+ You can now build an image that includes your kernel
+ patches.
+ Execute the following command from your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in the terminal set up to run BitBake:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake core-image-minimal
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id="using-traditional-kernel-development-to-patch-the-kernel">
+ <title>Using Traditional Kernel Development to Patch the Kernel</title>
+
+ <para>
+ The steps in this procedure show you how you can patch the
+ kernel using traditional kernel development (i.e. not using
+ <filename>devtool</filename> and the extensible SDK as
+ described in the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ section).
+ <note>
+ Before attempting this procedure, be sure you have performed
+ the steps to get ready for updating the kernel as described
+ in the
+ "<link linkend='getting-ready-for-traditional-kernel-development'>Getting Ready for Traditional Kernel Development</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ Patching the kernel involves changing or adding configurations
+ to an existing kernel, changing or adding recipes to the kernel
+ that are needed to support specific hardware features, or even
+ altering the source code itself.
+ </para>
+
+ <para>
+ The example in this section creates a simple patch by adding some
+ QEMU emulator console output at boot time through
+ <filename>printk</filename> statements in the kernel's
+ <filename>calibrate.c</filename> source code file.
+ Applying the patch and booting the modified image causes the added
+ messages to appear on the emulator's console.
+ The example is a continuation of the setup procedure found in
+ the
+ "<link linkend='getting-ready-for-traditional-kernel-development'>Getting Ready for Traditional Kernel Development</link>"
+ Section.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Edit the Source Files</emphasis>
+ Prior to this step, you should have used Git to create a
+ local copy of the repository for your kernel.
+ Assuming you created the repository as directed in the
+ "<link linkend='getting-ready-for-traditional-kernel-development'>Getting Ready for Traditional Kernel Development</link>"
+ section, use the following commands to edit the
+ <filename>calibrate.c</filename> file:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Change the working directory</emphasis>:
+ You need to locate the source files in the
+ local copy of the kernel Git repository:
+ Change to where the kernel source code is before making
+ your edits to the <filename>calibrate.c</filename> file:
+ <literallayout class='monospaced'>
+ $ cd ~/linux-yocto-4.12/init
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the source file</emphasis>:
+ Edit the <filename>calibrate.c</filename> file to have
+ the following changes:
+ <literallayout class='monospaced'>
+ void calibrate_delay(void)
+ {
+ unsigned long lpj;
+ static bool printed;
+ int this_cpu = smp_processor_id();
+
+ printk("*************************************\n");
+ printk("* *\n");
+ printk("* HELLO YOCTO KERNEL *\n");
+ printk("* *\n");
+ printk("*************************************\n");
+
+ if (per_cpu(cpu_loops_per_jiffy, this_cpu)) {
+ .
+ .
+ .
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage and Commit Your Changes:</emphasis>
+ Use standard Git commands to stage and commit the changes
+ you just made:
+ <literallayout class='monospaced'>
+ $ git add calibrate.c
+ $ git commit -m "calibrate.c - Added some printk statements"
+ </literallayout>
+ If you do not stage and commit your changes, the OpenEmbedded
+ Build System will not pick up the changes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Update Your <filename>local.conf</filename> File
+ to Point to Your Source Files:</emphasis>
+ In addition to your <filename>local.conf</filename> file
+ specifying to use "kernel-modules" and the "qemux86"
+ machine, it must also point to the updated kernel source
+ files.
+ Add
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ statements similar to the following to your
+ <filename>local.conf</filename>:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/conf
+ </literallayout>
+ Add the following to the <filename>local.conf</filename>:
+ <literallayout class='monospaced'>
+ SRC_URI_pn-linux-yocto = "git:///<replaceable>path-to</replaceable>/linux-yocto-4.12;protocol=file;name=machine;branch=standard/base; \
+ git:///<replaceable>path-to</replaceable>/yocto-kernel-cache;protocol=file;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
+ SRCREV_meta_qemux86 = "${AUTOREV}"
+ SRCREV_machine_qemux86 = "${AUTOREV}"
+ </literallayout>
+ <note>
+ Be sure to replace
+ <replaceable>path-to</replaceable> with the pathname
+ to your local Git repositories.
+ Also, you must be sure to specify the correct branch
+ and machine types.
+ For this example, the branch is
+ <filename>standard/base</filename> and the machine is
+ "qemux86".
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Image:</emphasis>
+ With the source modified, your changes staged and
+ committed, and the <filename>local.conf</filename> file
+ pointing to the kernel files, you can now use BitBake to
+ build the image:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake core-image-minimal
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Boot the image</emphasis>:
+ Boot the modified image in the QEMU emulator
+ using this command.
+ When prompted to login to the QEMU console, use "root"
+ with no password:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ runqemu qemux86
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Look for Your Changes:</emphasis>
+ As QEMU booted, you might have seen your changes rapidly
+ scroll by.
+ If not, use these commands to see your changes:
+ <literallayout class='monospaced'>
+ # dmesg | less
+ </literallayout>
+ You should see the results of your
+ <filename>printk</filename> statements
+ as part of the output when you scroll down the
+ console window.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Generate the Patch File:</emphasis>
+ Once you are sure that your patch works correctly, you
+ can generate a <filename>*.patch</filename> file in the
+ kernel source repository:
+ <literallayout class='monospaced'>
+ $ cd ~/linux-yocto-4.12/init
+ $ git format-patch -1
+ 0001-calibrate.c-Added-some-printk-statements.patch
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Move the Patch File to Your Layer:</emphasis>
+ In order for subsequent builds to pick up patches, you
+ need to move the patch file you created in the previous
+ step to your layer <filename>meta-mylayer</filename>.
+ For this example, the layer created earlier is located
+ in your home directory as <filename>meta-mylayer</filename>.
+ When the layer was created using the
+ <filename>yocto-create</filename> script, no additional
+ hierarchy was created to support patches.
+ Before moving the patch file, you need to add additional
+ structure to your layer using the following commands:
+ <literallayout class='monospaced'>
+ $ cd ~/meta-mylayer
+ $ mkdir recipes-kernel
+ $ mkdir recipes-kernel/linux
+ $ mkdir recipes-kernel/linux/linux-yocto
+ </literallayout>
+ Once you have created this hierarchy in your layer, you can
+ move the patch file using the following command:
+ <literallayout class='monospaced'>
+ $ mv ~/linux-yocto-4.12/init/0001-calibrate.c-Added-some-printk-statements.patch ~/meta-mylayer/recipes-kernel/linux/linux-yocto
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the Append File:</emphasis>
+ Finally, you need to create the
+ <filename>linux-yocto_4.12.bbappend</filename> file and
+ insert statements that allow the OpenEmbedded build
+ system to find the patch.
+ The append file needs to be in your layer's
+ <filename>recipes-kernel/linux</filename>
+ directory and it must be named
+ <filename>linux-yocto_4.12.bbappend</filename> and have
+ the following contents:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+ SRC_URI_append = " file://0001-calibrate.c-Added-some-printk-statements.patch"
+ </literallayout>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements enable the OpenEmbedded build system to find
+ the patch file.</para>
+
+ <para>For more information on append files and patches,
+ see the
+ "<link linkend='creating-the-append-file'>Creating the Append File</link>"
+ and
+ "<link linkend='applying-patches'>Applying Patches</link>"
+ sections.
+ You can also see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer"</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ <note>
+ To build <filename>core-image-minimal</filename>
+ again and see the effects of your patch, you can
+ essentially eliminate the temporary source files
+ saved in <filename>poky/build/tmp/work/...</filename>
+ and residual effects of the build by entering the
+ following sequence of commands:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ bitbake -c cleanall yocto-linux
+ $ bitbake core-image-minimal -c cleanall
+ $ bitbake core-image-minimal
+ $ runqemu qemux86
+ </literallayout>
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='configuring-the-kernel'>
+ <title>Configuring the Kernel</title>
+
+ <para>
+ Configuring the Yocto Project kernel consists of making sure the
+ <filename>.config</filename> file has all the right information
+ in it for the image you are building.
+ You can use the <filename>menuconfig</filename> tool and
+ configuration fragments to make sure your
+ <filename>.config</filename> file is just how you need it.
+ You can also save known configurations in a
+ <filename>defconfig</filename> file that the build system can use
+ for kernel configuration.
+ </para>
+
+ <para>
+ This section describes how to use <filename>menuconfig</filename>,
+ create and use configuration fragments, and how to interactively
+ modify your <filename>.config</filename> file to create the
+ leanest kernel configuration file possible.
+ </para>
+
+ <para>
+ For more information on kernel configuration, see the
+ "<link linkend='changing-the-configuration'>Changing the Configuration</link>"
+ section.
+ </para>
+
+ <section id='using-menuconfig'>
+ <title>Using&nbsp;&nbsp;<filename>menuconfig</filename></title>
+
+ <para>
+ The easiest way to define kernel configurations is to set
+ them through the <filename>menuconfig</filename> tool.
+ This tool provides an interactive method with which
+ to set kernel configurations.
+ For general information on <filename>menuconfig</filename>, see
+ <ulink url='http://en.wikipedia.org/wiki/Menuconfig'></ulink>.
+ </para>
+
+ <para>
+ To use the <filename>menuconfig</filename> tool in the Yocto
+ Project development environment, you must launch it using
+ BitBake.
+ Thus, the environment must be set up using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ script found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ You must also be sure of the state of your build's
+ configuration in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ The following commands initialize the BitBake environment,
+ run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></ulink>
+ task, and launch <filename>menuconfig</filename>.
+ These commands assume the Source Directory's top-level folder
+ is <filename>~/poky</filename>:
+ <literallayout class='monospaced'>
+ $ cd poky
+ $ source oe-init-build-env
+ $ bitbake linux-yocto -c kernel_configme -f
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout>
+ Once <filename>menuconfig</filename> comes up, its standard
+ interface allows you to interactively examine and configure
+ all the kernel configuration parameters.
+ After making your changes, simply exit the tool and save your
+ changes to create an updated version of the
+ <filename>.config</filename> configuration file.
+ <note>
+ You can use the entire <filename>.config</filename> file
+ as the <filename>defconfig</filename> file.
+ For information on <filename>defconfig</filename> files,
+ see the
+ "<link linkend='changing-the-configuration'>Changing the Configuration</link>",
+ "<link linkend='using-an-in-tree-defconfig-file'>Using an In-Tree <filename>defconfig</filename> File</link>,
+ and
+ "<link linkend='creating-a-defconfig-file'>Creating a <filename>defconfig</filename> File</link>"
+ sections.
+ </note>
+ </para>
+
+ <para>
+ Consider an example that configures the "CONFIG_SMP" setting
+ for the <filename>linux-yocto-4.12</filename> kernel.
+ <note>
+ The OpenEmbedded build system recognizes this kernel as
+ <filename>linux-yocto</filename> through Metadata (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink><filename>_linux-yocto ?= "12.4%"</filename>).
+ </note>
+ Once <filename>menuconfig</filename> launches, use the
+ interface to navigate through the selections to find the
+ configuration settings in which you are interested.
+ For this example, you deselect "CONFIG_SMP" by clearing the
+ "Symmetric Multi-Processing Support" option.
+ Using the interface, you can find the option under
+ "Processor Type and Features".
+ To deselect "CONFIG_SMP", use the arrow keys to
+ highlight "Symmetric Multi-Processing Support" and enter "N"
+ to clear the asterisk.
+ When you are finished, exit out and save the change.
+ </para>
+
+ <para>
+ Saving the selections updates the <filename>.config</filename>
+ configuration file.
+ This is the file that the OpenEmbedded build system uses to
+ configure the kernel during the build.
+ You can find and examine this file in the Build Directory in
+ <filename>tmp/work/</filename>.
+ The actual <filename>.config</filename> is located in the
+ area where the specific kernel is built.
+ For example, if you were building a Linux Yocto kernel based
+ on the <filename>linux-yocto-4.12</filename> kernel and you
+ were building a QEMU image targeted for
+ <filename>x86</filename> architecture, the
+ <filename>.config</filename> file would be:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/linux-yocto/4.12.12+gitAUTOINC+eda4d18...
+ ...967-r0/linux-qemux86-standard-build/.config
+ </literallayout>
+ <note>
+ The previous example directory is artificially split and
+ many of the characters in the actual filename are omitted
+ in order to make it more readable.
+ Also, depending on the kernel you are using, the exact
+ pathname might differ.
+ </note>
+ </para>
+
+ <para>
+ Within the <filename>.config</filename> file, you can see the
+ kernel settings.
+ For example, the following entry shows that symmetric
+ multi-processor support is not set:
+ <literallayout class='monospaced'>
+ # CONFIG_SMP is not set
+ </literallayout>
+ </para>
+
+ <para>
+ A good method to isolate changed configurations is to use a
+ combination of the <filename>menuconfig</filename> tool and
+ simple shell commands.
+ Before changing configurations with
+ <filename>menuconfig</filename>, copy the existing
+ <filename>.config</filename> and rename it to something else,
+ use <filename>menuconfig</filename> to make as many changes as
+ you want and save them, then compare the renamed configuration
+ file against the newly created file.
+ You can use the resulting differences as your base to create
+ configuration fragments to permanently save in your kernel
+ layer.
+ <note>
+ Be sure to make a copy of the <filename>.config</filename>
+ file and do not just rename it.
+ The build system needs an existing
+ <filename>.config</filename> file from which to work.
+ </note>
+ </para>
+ </section>
+
+ <section id='creating-a-defconfig-file'>
+ <title>Creating a&nbsp;&nbsp;<filename>defconfig</filename> File</title>
+
+ <para>
+ A <filename>defconfig</filename> file is simply a
+ <filename>.config</filename> renamed to "defconfig".
+ You can use a <filename>defconfig</filename> file
+ to retain a known set of kernel configurations from which the
+ OpenEmbedded build system can draw to create the final
+ <filename>.config</filename> file.
+ <note>
+ Out-of-the-box, the Yocto Project never ships a
+ <filename>defconfig</filename> or
+ <filename>.config</filename> file.
+ The OpenEmbedded build system creates the final
+ <filename>.config</filename> file used to configure the
+ kernel.
+ </note>
+ </para>
+
+ <para>
+ To create a <filename>defconfig</filename>, start with a
+ complete, working Linux kernel <filename>.config</filename>
+ file.
+ Copy that file to the appropriate
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
+ directory in your layer's
+ <filename>recipes-kernel/linux</filename> directory, and rename
+ the copied file to "defconfig" (e.g.
+ <filename>~/meta-mylayer/recipes-kernel/linux/linux-yocto/defconfig</filename>).
+ Then, add the following lines to the linux-yocto
+ <filename>.bbappend</filename> file in your layer:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ SRC_URI += "file://defconfig"
+ </literallayout>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ tells the build system how to search for the file, while the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></ulink>
+ extends the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable (search directories) to include the
+ <filename>${PN}</filename> directory you created to hold the
+ configuration changes.
+ <note>
+ The build system applies the configurations from the
+ <filename>defconfig</filename> file before applying any
+ subsequent configuration fragments.
+ The final kernel configuration is a combination of the
+ configurations in the <filename>defconfig</filename>
+ file and any configuration fragments you provide.
+ You need to realize that if you have any configuration
+ fragments, the build system applies these on top of and
+ after applying the existing defconfig file configurations.
+ </note>
+ For more information on configuring the kernel, see the
+ "<link linkend='changing-the-configuration'>Changing the Configuration</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='creating-config-fragments'>
+ <title>Creating Configuration Fragments</title>
+
+ <para>
+ Configuration fragments are simply kernel options that
+ appear in a file placed where the OpenEmbedded build system
+ can find and apply them.
+ The build system applies configuration fragments after
+ applying configurations from a <filename>defconfig</filename>
+ file.
+ Thus, the final kernel configuration is a combination of the
+ configurations in the <filename>defconfig</filename>
+ file and then any configuration fragments you provide.
+ The build system applies fragments on top of and
+ after applying the existing defconfig file configurations.
+ </para>
+
+ <para>
+ Syntactically, the configuration statement is identical to
+ what would appear in the <filename>.config</filename> file,
+ which is in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ <note>
+ For more information about where the
+ <filename>.config</filename> file is located, see the
+ example in the
+ "<link linkend='using-menuconfig'>Using <filename>menuconfig</filename></link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ It is simple to create a configuration fragment.
+ One method is to use shell commands.
+ For example, issuing the following from the shell creates a
+ configuration fragment file named
+ <filename>my_smp.cfg</filename> that enables multi-processor
+ support within the kernel:
+ <literallayout class='monospaced'>
+ $ echo "CONFIG_SMP=y" >> my_smp.cfg
+ </literallayout>
+ <note>
+ All configuration fragment files must use the
+ <filename>.cfg</filename> extension in order for the
+ OpenEmbedded build system to recognize them as a
+ configuration fragment.
+ </note>
+ </para>
+
+ <para>
+ Another method is to create a configuration fragment using the
+ differences between two configuration files: one previously
+ created and saved, and one freshly created using the
+ <filename>menuconfig</filename> tool.
+ </para>
+
+ <para>
+ To create a configuration fragment using this method, follow
+ these steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Complete a Build Through Kernel Configuration:</emphasis>
+ Complete a build at least through the kernel
+ configuration task as follows:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configme -f
+ </literallayout>
+ This step ensures that you create a
+ <filename>.config</filename> file from a known state.
+ Because situations exist where your build state might
+ become unknown, it is best to run this task prior
+ to starting <filename>menuconfig</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Launch <filename>menuconfig</filename>:</emphasis>
+ Run the <filename>menuconfig</filename> command:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the Configuration Fragment:</emphasis>
+ Run the <filename>diffconfig</filename>
+ command to prepare a configuration fragment.
+ The resulting file <filename>fragment.cfg</filename>
+ is placed in the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename> directory:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c diffconfig
+ </literallayout>
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The <filename>diffconfig</filename> command creates a file
+ that is a list of Linux kernel <filename>CONFIG_</filename>
+ assignments.
+ See the "<link linkend='changing-the-configuration'>Changing the Configuration</link>"
+ section for additional information on how to use the output
+ as a configuration fragment.
+ <note>
+ You can also use this method to create configuration
+ fragments for a BSP.
+ See the "<link linkend='bsp-descriptions'>BSP Descriptions</link>"
+ section for more information.
+ </note>
+ </para>
+
+ <para>
+ Where do you put your configuration fragment files?
+ You can place these files in an area pointed to by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ as directed by your <filename>bblayers.conf</filename> file,
+ which is located in your layer.
+ The OpenEmbedded build system picks up the configuration and
+ adds it to the kernel's configuration.
+ For example, suppose you had a set of configuration options
+ in a file called <filename>myconfig.cfg</filename>.
+ If you put that file inside a directory named
+ <filename>linux-yocto</filename> that resides in the same
+ directory as the kernel's append file within your layer
+ and then add the following statements to the kernel's append
+ file, those configuration options will be picked up and applied
+ when the kernel is built:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ SRC_URI += "file://myconfig.cfg"
+ </literallayout>
+ </para>
+
+ <para>
+ As mentioned earlier, you can group related configurations
+ into multiple files and name them all in the
+ <filename>SRC_URI</filename> statement as well.
+ For example, you could group separate configurations
+ specifically for Ethernet and graphics into their own files
+ and add those by using a <filename>SRC_URI</filename> statement
+ like the following in your append file:
+ <literallayout class='monospaced'>
+ SRC_URI += "file://myconfig.cfg \
+ file://eth.cfg \
+ file://gfx.cfg"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='validating-configuration'>
+ <title>Validating Configuration</title>
+
+ <para>
+ You can use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configcheck'><filename>do_kernel_configcheck</filename></ulink>
+ task to provide configuration validation:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configcheck -f
+ </literallayout>
+ Running this task produces warnings for when a
+ requested configuration does not appear in the final
+ <filename>.config</filename> file or when you override a
+ policy configuration in a hardware configuration fragment.
+ </para>
+
+ <para>
+ In order to run this task, you must have an existing
+ <filename>.config</filename> file.
+ See the
+ "<link linkend='using-menuconfig'>Using <filename>menuconfig</filename></link>"
+ section for information on how to create a configuration file.
+ </para>
+
+ <para>
+ Following is sample output from the
+ <filename>do_kernel_configcheck</filename> task:
+ <literallayout class='monospaced'>
+ Loading cache: 100% |########################################################| Time: 0:00:00
+ Loaded 1275 entries from dependency cache.
+ NOTE: Resolving any missing task queue dependencies
+
+ Build Configuration:
+ .
+ .
+ .
+
+ NOTE: Executing SetScene Tasks
+ NOTE: Executing RunQueue Tasks
+ WARNING: linux-yocto-4.12.12+gitAUTOINC+eda4d18ce4_16de014967-r0 do_kernel_configcheck:
+ [kernel config]: specified values did not make it into the kernel's final configuration:
+
+ ---------- CONFIG_X86_TSC -----------------
+ Config: CONFIG_X86_TSC
+ From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc-cpu.cfg
+ Requested value: CONFIG_X86_TSC=y
+ Actual value:
+
+
+ ---------- CONFIG_X86_BIGSMP -----------------
+ Config: CONFIG_X86_BIGSMP
+ From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
+ /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
+ Requested value: # CONFIG_X86_BIGSMP is not set
+ Actual value:
+
+
+ ---------- CONFIG_NR_CPUS -----------------
+ Config: CONFIG_NR_CPUS
+ From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
+ /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/bsp/common-pc/common-pc.cfg
+ /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
+ Requested value: CONFIG_NR_CPUS=8
+ Actual value: CONFIG_NR_CPUS=1
+
+
+ ---------- CONFIG_SCHED_SMT -----------------
+ Config: CONFIG_SCHED_SMT
+ From: /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/cfg/smp.cfg
+ /home/scottrif/poky/build/tmp/work-shared/qemux86/kernel-source/.kernel-meta/configs/standard/defconfig
+ Requested value: CONFIG_SCHED_SMT=y
+ Actual value:
+
+
+
+ NOTE: Tasks Summary: Attempted 288 tasks of which 285 didn't need to be rerun and all succeeded.
+
+ Summary: There were 3 WARNING messages shown.
+ </literallayout>
+ <note>
+ The previous output example has artificial line breaks
+ to make it more readable.
+ </note>
+ </para>
+
+ <para>
+ The output describes the various problems that you can
+ encounter along with where to find the offending configuration
+ items.
+ You can use the information in the logs to adjust your
+ configuration files and then repeat the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-kernel_configcheck'><filename>do_kernel_configcheck</filename></ulink>
+ tasks until they produce no warnings.
+ </para>
+
+ <para>
+ For more information on how to use the
+ <filename>menuconfig</filename> tool, see the
+ "<link linkend='using-menuconfig'>Using <filename>menuconfig</filename></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='fine-tuning-the-kernel-configuration-file'>
+ <title>Fine-Tuning the Kernel Configuration File</title>
+
+ <para>
+ You can make sure the <filename>.config</filename> file is as
+ lean or efficient as possible by reading the output of the
+ kernel configuration fragment audit, noting any issues, making
+ changes to correct the issues, and then repeating.
+ </para>
+
+ <para>
+ As part of the kernel build process, the
+ <filename>do_kernel_configcheck</filename> task runs.
+ This task validates the kernel configuration by checking the
+ final <filename>.config</filename> file against the input
+ files.
+ During the check, the task produces warning messages for the
+ following issues:
+ <itemizedlist>
+ <listitem><para>
+ Requested options that did not make the final
+ <filename>.config</filename> file.
+ </para></listitem>
+ <listitem><para>
+ Configuration items that appear twice in the same
+ configuration fragment.
+ </para></listitem>
+ <listitem><para>
+ Configuration items tagged as "required" that were
+ overridden.
+ </para></listitem>
+ <listitem><para>
+ A board overrides a non-board specific option.
+ </para></listitem>
+ <listitem><para>
+ Listed options not valid for the kernel being
+ processed.
+ In other words, the option does not appear anywhere.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ The <filename>do_kernel_configcheck</filename> task can
+ also optionally report if an option is overridden during
+ processing.
+ </note>
+ </para>
+
+ <para>
+ For each output warning, a message points to the file
+ that contains a list of the options and a pointer to the
+ configuration fragment that defines them.
+ Collectively, the files are the key to streamlining the
+ configuration.
+ </para>
+
+ <para>
+ To streamline the configuration, do the following:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Use a Working Configuration:</emphasis>
+ Start with a full configuration that you
+ know works.
+ Be sure the configuration builds and boots
+ successfully.
+ Use this configuration file as your baseline.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Run Configure and Check Tasks:</emphasis>
+ Separately run the
+ <filename>do_kernel_configme</filename> and
+ <filename>do_kernel_configcheck</filename> tasks:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configme -f
+ $ bitbake linux-yocto -c kernel_configcheck -f
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Process the Results:</emphasis>
+ Take the resulting list of files from the
+ <filename>do_kernel_configcheck</filename> task
+ warnings and do the following:
+ <itemizedlist>
+ <listitem><para>
+ Drop values that are redefined in the fragment
+ but do not change the final
+ <filename>.config</filename> file.
+ </para></listitem>
+ <listitem><para>
+ Analyze and potentially drop values from the
+ <filename>.config</filename> file that override
+ required configurations.
+ </para></listitem>
+ <listitem><para>
+ Analyze and potentially remove non-board
+ specific options.
+ </para></listitem>
+ <listitem><para>
+ Remove repeated and invalid options.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Re-Run Configure and Check Tasks:</emphasis>
+ After you have worked through the output of the kernel
+ configuration audit, you can re-run the
+ <filename>do_kernel_configme</filename> and
+ <filename>do_kernel_configcheck</filename> tasks to
+ see the results of your changes.
+ If you have more issues, you can deal with them as
+ described in the previous step.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Iteratively working through steps two through four eventually
+ yields a minimal, streamlined configuration file.
+ Once you have the best <filename>.config</filename>, you can
+ build the Linux Yocto kernel.
+ </para>
+ </section>
+ </section>
+
+ <section id='expanding-variables'>
+ <title>Expanding Variables</title>
+
+ <para>
+ Sometimes it is helpful to determine what a variable expands
+ to during a build.
+ You can do examine the values of variables by examining the
+ output of the <filename>bitbake -e</filename> command.
+ The output is long and is more easily managed in a text file,
+ which allows for easy searches:
+ <literallayout class='monospaced'>
+ $ bitbake -e virtual/kernel > <replaceable>some_text_file</replaceable>
+ </literallayout>
+ Within the text file, you can see exactly how each variable is
+ expanded and used by the OpenEmbedded build system.
+ </para>
+ </section>
+
+ <section id='working-with-a-dirty-kernel-version-string'>
+ <title>Working with a "Dirty" Kernel Version String</title>
+
+ <para>
+ If you build a kernel image and the version string has a
+ "+" or a "-dirty" at the end, uncommitted modifications exist
+ in the kernel's source directory.
+ Follow these steps to clean up the version string:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Discover the Uncommitted Changes:</emphasis>
+ Go to the kernel's locally cloned Git repository
+ (source directory) and use the following Git command
+ to list the files that have been changed, added, or
+ removed:
+ <literallayout class='monospaced'>
+ $ git status
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Commit the Changes:</emphasis>
+ You should commit those changes to the kernel source
+ tree regardless of whether or not you will save,
+ export, or use the changes:
+ <literallayout class='monospaced'>
+ $ git add
+ $ git commit -s -a -m "getting rid of -dirty"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Rebuild the Kernel Image:</emphasis>
+ Once you commit the changes, rebuild the kernel.</para>
+
+ <para>Depending on your particular kernel development
+ workflow, the commands you use to rebuild the
+ kernel might differ.
+ For information on building the kernel image when
+ using <filename>devtool</filename>, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ section.
+ For information on building the kernel image when
+ using Bitbake, see the
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ section.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='working-with-your-own-sources'>
+ <title>Working With Your Own Sources</title>
+
+ <para>
+ If you cannot work with one of the Linux kernel
+ versions supported by existing linux-yocto recipes, you can
+ still make use of the Yocto Project Linux kernel tooling by
+ working with your own sources.
+ When you use your own sources, you will not be able to
+ leverage the existing kernel
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink> and
+ stabilization work of the linux-yocto sources.
+ However, you will be able to manage your own Metadata in the same
+ format as the linux-yocto sources.
+ Maintaining format compatibility facilitates converging with
+ linux-yocto on a future, mutually-supported kernel version.
+ </para>
+
+ <para>
+ To help you use your own sources, the Yocto Project provides a
+ linux-yocto custom recipe
+ (<filename>linux-yocto-custom.bb</filename>) that uses
+ <filename>kernel.org</filename> sources
+ and the Yocto Project Linux kernel tools for managing
+ kernel Metadata.
+ You can find this recipe in the
+ <filename>poky</filename> Git repository of the
+ Yocto Project <ulink url='&YOCTO_GIT_URL;'>Source Repository</ulink>
+ at:
+ <literallayout class="monospaced">
+ poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
+ </literallayout>
+ </para>
+
+ <para>
+ Here are some basic steps you can use to work with your own
+ sources:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create a Copy of the Kernel Recipe:</emphasis>
+ Copy the <filename>linux-yocto-custom.bb</filename>
+ recipe to your layer and give it a meaningful name.
+ The name should include the version of the Yocto Linux
+ kernel you are using (e.g.
+ <filename>linux-yocto-myproject_4.12.bb</filename>,
+ where "4.12" is the base version of the Linux kernel
+ with which you would be working).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create a Directory for Your Patches:</emphasis>
+ In the same directory inside your layer, create a matching
+ directory to store your patches and configuration files
+ (e.g. <filename>linux-yocto-myproject</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Ensure You Have Configurations:</emphasis>
+ Make sure you have either a <filename>defconfig</filename>
+ file or configuration fragment files in your layer.
+ When you use the <filename>linux-yocto-custom.bb</filename>
+ recipe, you must specify a configuration.
+ If you do not have a <filename>defconfig</filename> file,
+ you can run the following:
+ <literallayout class='monospaced'>
+ $ make defconfig
+ </literallayout>
+ After running the command, copy the resulting
+ <filename>.config</filename> file to the
+ <filename>files</filename> directory in your layer
+ as "defconfig" and then add it to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable in the recipe.</para>
+
+ <para>Running the <filename>make defconfig</filename>
+ command results in the default configuration for your
+ architecture as defined by your kernel.
+ However, no guarantee exists that this configuration is
+ valid for your use case, or that your board will even boot.
+ This is particularly true for non-x86 architectures.</para>
+
+ <para>To use non-x86 <filename>defconfig</filename> files,
+ you need to be more specific and find one that matches your
+ board (i.e. for arm, you look in
+ <filename>arch/arm/configs</filename> and use the one that
+ is the best starting point for your board).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Recipe:</emphasis>
+ Edit the following variables in your recipe as appropriate
+ for your project:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>:
+ The <filename>SRC_URI</filename> should specify
+ a Git repository that uses one of the supported Git
+ fetcher protocols (i.e. <filename>file</filename>,
+ <filename>git</filename>, <filename>http</filename>,
+ and so forth).
+ The <filename>SRC_URI</filename> variable should
+ also specify either a <filename>defconfig</filename>
+ file or some configuration fragment files.
+ The skeleton recipe provides an example
+ <filename>SRC_URI</filename> as a syntax reference.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION'><filename>LINUX_VERSION</filename></ulink>:
+ The Linux kernel version you are using (e.g.
+ "4.12").
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LINUX_VERSION_EXTENSION'><filename>LINUX_VERSION_EXTENSION</filename></ulink>:
+ The Linux kernel
+ <filename>CONFIG_LOCALVERSION</filename> that is
+ compiled into the resulting kernel and visible
+ through the <filename>uname</filename> command.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>:
+ The commit ID from which you want to build.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ Treat this variable the same as you would in any
+ other recipe.
+ Increment the variable to indicate to the
+ OpenEmbedded build system that the recipe has
+ changed.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The default <filename>PV</filename> assignment is
+ typically adequate.
+ It combines the <filename>LINUX_VERSION</filename>
+ with the Source Control Manager (SCM) revision
+ as derived from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCPV'><filename>SRCPV</filename></ulink>
+ variable.
+ The combined results are a string with the
+ following form:
+ <literallayout class='monospaced'>
+ 3.19.11+git1+68a635bf8dfb64b02263c1ac80c948647cc76d5f_1+218bd8d2022b9852c60d32f0d770931e3cf343e2
+ </literallayout>
+ While lengthy, the extra verbosity in
+ <filename>PV</filename> helps ensure you are using
+ the exact sources from which you intend to build.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></ulink>:
+ A list of the machines supported by your new recipe.
+ This variable in the example recipe is set
+ by default to a regular expression that matches
+ only the empty string, "(^$)".
+ This default setting triggers an explicit build
+ failure.
+ You must change it to match a list of the machines
+ that your new recipe supports.
+ For example, to support the
+ <filename>qemux86</filename> and
+ <filename>qemux86-64</filename> machines, use
+ the following form:
+ <literallayout class='monospaced'>
+ COMPATIBLE_MACHINE = "qemux86|qemux86-64"
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Customize Your Recipe as Needed:</emphasis>
+ Provide further customizations to your recipe
+ as needed just as you would customize an existing
+ linux-yocto recipe.
+ See the
+ "<link linkend='modifying-an-existing-recipe'>Modifying an Existing Recipe</link>"
+ section for information.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='working-with-out-of-tree-modules'>
+ <title>Working with Out-of-Tree Modules</title>
+
+ <para>
+ This section describes steps to build out-of-tree modules on
+ your target and describes how to incorporate out-of-tree modules
+ in the build.
+ </para>
+
+ <section id='building-out-of-tree-modules-on-the-target'>
+ <title>Building Out-of-Tree Modules on the Target</title>
+
+ <para>
+ While the traditional Yocto Project development model would be
+ to include kernel modules as part of the normal build
+ process, you might find it useful to build modules on the
+ target.
+ This could be the case if your target system is capable
+ and powerful enough to handle the necessary compilation.
+ Before deciding to build on your target, however, you should
+ consider the benefits of using a proper cross-development
+ environment from your build host.
+ </para>
+
+ <para>
+ If you want to be able to build out-of-tree modules on
+ the target, there are some steps you need to take
+ on the target that is running your SDK image.
+ Briefly, the <filename>kernel-dev</filename> package
+ is installed by default on all
+ <filename>*.sdk</filename> images and the
+ <filename>kernel-devsrc</filename> package is installed
+ on many of the <filename>*.sdk</filename> images.
+ However, you need to create some scripts prior to
+ attempting to build the out-of-tree modules on the target
+ that is running that image.
+ </para>
+
+ <para>
+ Prior to attempting to build the out-of-tree modules,
+ you need to be on the target as root and you need to
+ change to the <filename>/usr/src/kernel</filename> directory.
+ Next, <filename>make</filename> the scripts:
+ <literallayout class='monospaced'>
+ # cd /usr/src/kernel
+ # make scripts
+ </literallayout>
+ Because all SDK image recipes include
+ <filename>dev-pkgs</filename>, the
+ <filename>kernel-dev</filename> packages will be installed
+ as part of the SDK image and the
+ <filename>kernel-devsrc</filename> packages will be installed
+ as part of applicable SDK images.
+ The SDK uses the scripts when building out-of-tree
+ modules.
+ Once you have switched to that directory and created the
+ scripts, you should be able to build your out-of-tree modules
+ on the target.
+ </para>
+ </section>
+
+ <section id='incorporating-out-of-tree-modules'>
+ <title>Incorporating Out-of-Tree Modules</title>
+
+ <para>
+ While it is always preferable to work with sources integrated
+ into the Linux kernel sources, if you need an external kernel
+ module, the <filename>hello-mod.bb</filename> recipe is
+ available as a template from which you can create your
+ own out-of-tree Linux kernel module recipe.
+ </para>
+
+ <para>
+ This template recipe is located in the
+ <filename>poky</filename> Git repository of the
+ Yocto Project <ulink url='&YOCTO_GIT_URL;'>Source Repository</ulink>
+ at:
+ <literallayout class="monospaced">
+ poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
+ </literallayout>
+ </para>
+
+ <para>
+ To get started, copy this recipe to your layer and give it a
+ meaningful name (e.g. <filename>mymodule_1.0.bb</filename>).
+ In the same directory, create a new directory named
+ <filename>files</filename> where you can store any source files,
+ patches, or other files necessary for building
+ the module that do not come with the sources.
+ Finally, update the recipe as needed for the module.
+ Typically, you will need to set the following variables:
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-DESCRIPTION'><filename>DESCRIPTION</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE*</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Depending on the build system used by the module sources,
+ you might need to make some adjustments.
+ For example, a typical module <filename>Makefile</filename>
+ looks much like the one provided with the
+ <filename>hello-mod</filename> template:
+ <literallayout class='monospaced'>
+ obj-m := hello.o
+
+ SRC := $(shell pwd)
+
+ all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+ modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+ ...
+ </literallayout>
+ </para>
+
+ <para>
+ The important point to note here is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_SRC'><filename>KERNEL_SRC</filename></ulink>
+ variable.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-module'><filename>module</filename></ulink>
+ class sets this variable and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_PATH'><filename>KERNEL_PATH</filename></ulink>
+ variable to
+ <filename>${<ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></ulink>}</filename>
+ with the necessary Linux kernel build information to build
+ modules.
+ If your module <filename>Makefile</filename> uses a different
+ variable, you might want to override the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ step, or create a patch to
+ the <filename>Makefile</filename> to work with the more typical
+ <filename>KERNEL_SRC</filename> or
+ <filename>KERNEL_PATH</filename> variables.
+ </para>
+
+ <para>
+ After you have prepared your recipe, you will likely want to
+ include the module in your images.
+ To do this, see the documentation for the following variables in
+ the Yocto Project Reference Manual and set one of them
+ appropriately for your machine configuration file:
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RDEPENDS'><filename>MACHINE_EXTRA_RDEPENDS</filename></ulink>
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Modules are often not required for boot and can be excluded from
+ certain build configurations.
+ The following allows for the most flexibility:
+ <literallayout class='monospaced'>
+ MACHINE_EXTRA_RRECOMMENDS += "kernel-module-mymodule"
+ </literallayout>
+ The value is derived by appending the module filename without
+ the <filename>.ko</filename> extension to the string
+ "kernel-module-".
+ </para>
+
+ <para>
+ Because the variable is
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>
+ and not a
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>
+ variable, the build will not fail if this module is not
+ available to include in the image.
+ </para>
+ </section>
+ </section>
+
+
+ <section id='inspecting-changes-and-commits'>
+ <title>Inspecting Changes and Commits</title>
+
+ <para>
+ A common question when working with a kernel is:
+ "What changes have been applied to this tree?"
+ Rather than using "grep" across directories to see what has
+ changed, you can use Git to inspect or search the kernel tree.
+ Using Git is an efficient way to see what has changed in the tree.
+ </para>
+
+ <section id='what-changed-in-a-kernel'>
+ <title>What Changed in a Kernel?</title>
+
+ <para>
+ Following are a few examples that show how to use Git
+ commands to examine changes.
+ These examples are by no means the only way to see changes.
+ <note>
+ In the following examples, unless you provide a commit
+ range, <filename>kernel.org</filename> history is blended
+ with Yocto Project kernel changes.
+ You can form ranges by using branch names from the
+ kernel tree as the upper and lower commit markers with
+ the Git commands.
+ You can see the branch names through the web interface
+ to the Yocto Project source repositories at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ </note>
+ To see a full range of the changes, use the
+ <filename>git whatchanged</filename> command and specify a
+ commit range for the branch
+ (<replaceable>commit</replaceable><filename>..</filename><replaceable>commit</replaceable>).
+ </para>
+
+ <para>
+ Here is an example that looks at what has changed in the
+ <filename>emenlow</filename> branch of the
+ <filename>linux-yocto-3.19</filename> kernel.
+ The lower commit range is the commit associated with the
+ <filename>standard/base</filename> branch, while
+ the upper commit range is the commit associated with the
+ <filename>standard/emenlow</filename> branch.
+ <literallayout class='monospaced'>
+ $ git whatchanged origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ To see short, one line summaries of changes use the
+ <filename>git log</filename> command:
+ <literallayout class='monospaced'>
+ $ git log --oneline origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ Use this command to see code differences for the changes:
+ <literallayout class='monospaced'>
+ $ git diff origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ Use this command to see the commit log messages and the
+ text differences:
+ <literallayout class='monospaced'>
+ $ git show origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+
+ <para>
+ Use this command to create individual patches for
+ each change.
+ Here is an example that that creates patch files for each
+ commit and places them in your <filename>Documents</filename>
+ directory:
+ <literallayout class='monospaced'>
+ $ git format-patch -o $HOME/Documents origin/standard/base..origin/standard/emenlow
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='showing-a-particular-feature-or-branch-change'>
+ <title>Showing a Particular Feature or Branch Change</title>
+
+ <para>
+ Tags in the Yocto Project kernel tree divide changes for
+ significant features or branches.
+ The <filename>git show</filename>&nbsp;<replaceable>tag</replaceable>
+ command shows changes based on a tag.
+ Here is an example that shows <filename>systemtap</filename>
+ changes:
+ <literallayout class='monospaced'>
+ $ git show systemtap
+ </literallayout>
+ You can use the
+ <filename>git branch --contains</filename>&nbsp;<replaceable>tag</replaceable>
+ command to show the branches that contain a particular feature.
+ This command shows the branches that contain the
+ <filename>systemtap</filename> feature:
+ <literallayout class='monospaced'>
+ $ git branch --contains systemtap
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='adding-recipe-space-kernel-features'>
+ <title>Adding Recipe-Space Kernel Features</title>
+
+ <para>
+ You can add kernel features in the
+ <link linkend='recipe-space-metadata'>recipe-space</link> by
+ using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+ variable and by specifying the feature's <filename>.scc</filename>
+ file path in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement.
+ When you add features using this method, the OpenEmbedded build
+ system checks to be sure the features are present.
+ If the features are not present, the build stops.
+ Kernel features are the last elements processed for configuring
+ and patching the kernel.
+ Therefore, adding features in this manner is a way
+ to enforce specific features are present and enabled
+ without needing to do a full audit of any other layer's additions
+ to the <filename>SRC_URI</filename> statement.
+ </para>
+
+ <para>
+ You add a kernel feature by providing the feature as part of the
+ <filename>KERNEL_FEATURES</filename> variable and by providing the
+ path to the feature's <filename>.scc</filename> file, which is
+ relative to the root of the kernel Metadata.
+ The OpenEmbedded build system searches all forms of kernel
+ Metadata on the <filename>SRC_URI</filename> statement regardless
+ of whether the Metadata is in the "kernel-cache", system kernel
+ Metadata, or a recipe-space Metadata (i.e. part of the kernel
+ recipe).
+ See the
+ "<link linkend='kernel-metadata-location'>Kernel Metadata Location</link>"
+ section for additional information.
+ </para>
+
+ <para>
+ When you specify the feature's <filename>.scc</filename> file
+ on the <filename>SRC_URI</filename> statement, the OpenEmbedded
+ build system adds the directory of that
+ <filename>.scc</filename> file along with all its subdirectories
+ to the kernel feature search path.
+ Because subdirectories are searched, you can reference a single
+ <filename>.scc</filename> file in the
+ <filename>SRC_URI</filename> statement to reference multiple kernel
+ features.
+ </para>
+
+ <para>
+ Consider the following example that adds the "test.scc" feature
+ to the build.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create the Feature File:</emphasis>
+ Create a <filename>.scc</filename> file and locate it
+ just as you would any other patch file,
+ <filename>.cfg</filename> file, or fetcher item
+ you specify in the <filename>SRC_URI</filename>
+ statement.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ You must add the directory of the
+ <filename>.scc</filename> file to the fetcher's
+ search path in the same manner as you would
+ add a <filename>.patch</filename> file.
+ </para></listitem>
+ <listitem><para>
+ You can create additional
+ <filename>.scc</filename> files beneath the
+ directory that contains the file you are
+ adding.
+ All subdirectories are searched during the
+ build as potential feature directories.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ Continuing with the example, suppose the "test.scc"
+ feature you are adding has a
+ <filename>test.scc</filename> file in the following
+ directory:
+ <literallayout class='monospaced'>
+ <replaceable>my_recipe</replaceable>
+ |
+ +-linux-yocto
+ |
+ +-test.cfg
+ +-test.scc
+ </literallayout>
+ In this example, the <filename>linux-yocto</filename>
+ directory has both the feature
+ <filename>test.scc</filename> file and a similarly
+ named configuration fragment file
+ <filename>test.cfg</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Add the Feature File to <filename>SRC_URI</filename>:</emphasis>
+ Add the <filename>.scc</filename> file to the
+ recipe's <filename>SRC_URI</filename> statement:
+ <literallayout class='monospaced'>
+ SRC_URI_append = " file://test.scc"
+ </literallayout>
+ The leading space before the path is important as the
+ path is appended to the existing path.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Specify the Feature as a Kernel Feature:</emphasis>
+ Use the <filename>KERNEL_FEATURES</filename> statement
+ to specify the feature as a kernel feature:
+ <literallayout class='monospaced'>
+ KERNEL_FEATURES_append = " test.scc"
+ </literallayout>
+ The OpenEmbedded build system processes the kernel feature
+ when it builds the kernel.
+ <note>
+ If other features are contained below "test.scc",
+ then their directories are relative to the directory
+ containing the <filename>test.scc</filename> file.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml b/poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml
new file mode 100644
index 000000000..6d675a6d5
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-concepts-appx.xml
@@ -0,0 +1,622 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='kernel-dev-concepts-appx'>
+<title>Advanced Kernel Concepts</title>
+
+ <section id='kernel-big-picture'>
+ <title>Yocto Project Kernel Development and Maintenance</title>
+
+ <para>
+ Kernels available through the Yocto Project (Yocto Linux kernels),
+ like other kernels, are based off the Linux kernel releases from
+ <ulink url='http://www.kernel.org'></ulink>.
+ At the beginning of a major Linux kernel development cycle, the
+ Yocto Project team chooses a Linux kernel based on factors such as
+ release timing, the anticipated release timing of final upstream
+ <filename>kernel.org</filename> versions, and Yocto Project
+ feature requirements.
+ Typically, the Linux kernel chosen is in the final stages of
+ development by the Linux community.
+ In other words, the Linux kernel is in the release candidate
+ or "rc" phase and has yet to reach final release.
+ But, by being in the final stages of external development, the
+ team knows that the <filename>kernel.org</filename> final release
+ will clearly be within the early stages of the Yocto Project
+ development window.
+ </para>
+
+ <para>
+ This balance allows the Yocto Project team to deliver the most
+ up-to-date Yocto Linux kernel possible, while still ensuring that
+ the team has a stable official release for the baseline Linux
+ kernel version.
+ </para>
+
+ <para>
+ As implied earlier, the ultimate source for Yocto Linux kernels
+ are released kernels from <filename>kernel.org</filename>.
+ In addition to a foundational kernel from
+ <filename>kernel.org</filename>, the available Yocto Linux kernels
+ contain a mix of important new mainline developments, non-mainline
+ developments (when no alternative exists), Board Support Package
+ (BSP) developments, and custom features.
+ These additions result in a commercially released Yocto
+ Project Linux kernel that caters to specific embedded designer
+ needs for targeted hardware.
+ </para>
+
+ <para>
+ You can find a web interface to the Yocto Linux kernels in the
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ If you look at the interface, you will see to the left a
+ grouping of Git repositories titled "Yocto Linux Kernel".
+ Within this group, you will find several Linux Yocto kernels
+ developed and included with Yocto Project releases:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.1</filename>:</emphasis>
+ The stable Yocto Project kernel to use with the Yocto
+ Project Release 2.0.
+ This kernel is based on the Linux 4.1 released kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.4</filename>:</emphasis>
+ The stable Yocto Project kernel to use with the Yocto
+ Project Release 2.1.
+ This kernel is based on the Linux 4.4 released kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.6</filename>:</emphasis>
+ A temporary kernel that is not tied to any Yocto Project
+ release.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.8</filename>:</emphasis>
+ The stable yocto Project kernel to use with the Yocto
+ Project Release 2.2.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.9</filename>:</emphasis>
+ The stable Yocto Project kernel to use with the Yocto
+ Project Release 2.3.
+ This kernel is based on the Linux 4.9 released kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.10</filename>:</emphasis>
+ The default stable Yocto Project kernel to use with the
+ Yocto Project Release 2.3.
+ This kernel is based on the Linux 4.10 released kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-4.12</filename>:</emphasis>
+ The default stable Yocto Project kernel to use with the
+ Yocto Project Release 2.4.
+ This kernel is based on the Linux 4.12 released kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>yocto-kernel-cache</filename>:</emphasis>
+ The <filename>linux-yocto-cache</filename> contains
+ patches and configurations for the linux-yocto kernel
+ tree.
+ This repository is useful when working on the linux-yocto
+ kernel.
+ For more information on this "Advanced Kernel Metadata",
+ see the
+ "<link linkend='kernel-dev-advanced'>Working With Advanced Metadata (<filename>yocto-kernel-cache</filename>)</link>"
+ Chapter.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto-dev</filename>:</emphasis>
+ A development kernel based on the latest upstream release
+ candidate available.
+ </para></listitem>
+ </itemizedlist>
+ <note><title>Notes</title>
+ Long Term Support Initiative (LTSI) for Yocto Linux
+ kernels is as follows:
+ <itemizedlist>
+ <listitem><para>
+ For Yocto Project releases 1.7, 1.8, and 2.0,
+ the LTSI kernel is
+ <filename>linux-yocto-3.14</filename>.
+ </para></listitem>
+ <listitem><para>
+ For Yocto Project releases 2.1, 2.2, and 2.3,
+ the LTSI kernel is <filename>linux-yocto-4.1</filename>.
+ </para></listitem>
+ <listitem><para>
+ For Yocto Project release 2.4, the LTSI kernel is
+ <filename>linux-yocto-4.9</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>linux-yocto-4.4</filename> is an LTS
+ kernel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ Once a Yocto Linux kernel is officially released, the Yocto
+ Project team goes into their next development cycle, or upward
+ revision (uprev) cycle, while still continuing maintenance on the
+ released kernel.
+ It is important to note that the most sustainable and stable way
+ to include feature development upstream is through a kernel uprev
+ process.
+ Back-porting hundreds of individual fixes and minor features from
+ various kernel versions is not sustainable and can easily
+ compromise quality.
+ </para>
+
+ <para>
+ During the uprev cycle, the Yocto Project team uses an ongoing
+ analysis of Linux kernel development, BSP support, and release
+ timing to select the best possible <filename>kernel.org</filename>
+ Linux kernel version on which to base subsequent Yocto Linux
+ kernel development.
+ The team continually monitors Linux community kernel development
+ to look for significant features of interest.
+ The team does consider back-porting large features if they have a
+ significant advantage.
+ User or community demand can also trigger a back-port or creation
+ of new functionality in the Yocto Project baseline kernel during
+ the uprev cycle.
+ </para>
+
+ <para>
+ Generally speaking, every new Linux kernel both adds features and
+ introduces new bugs.
+ These consequences are the basic properties of upstream
+ Linux kernel development and are managed by the Yocto Project
+ team's Yocto Linux kernel development strategy.
+ It is the Yocto Project team's policy to not back-port minor
+ features to the released Yocto Linux kernel.
+ They only consider back-porting significant technological
+ jumps &dash; and, that is done after a complete gap analysis.
+ The reason for this policy is that back-porting any small to
+ medium sized change from an evolving Linux kernel can easily
+ create mismatches, incompatibilities and very subtle errors.
+ </para>
+
+ <para>
+ The policies described in this section result in both a stable
+ and a cutting edge Yocto Linux kernel that mixes forward ports of
+ existing Linux kernel features and significant and critical new
+ functionality.
+ Forward porting Linux kernel functionality into the Yocto Linux
+ kernels available through the Yocto Project can be thought of as
+ a "micro uprev."
+ The many “micro uprevs†produce a Yocto Linux kernel version with
+ a mix of important new mainline, non-mainline, BSP developments
+ and feature integrations.
+ This Yocto Linux kernel gives insight into new features and
+ allows focused amounts of testing to be done on the kernel,
+ which prevents surprises when selecting the next major uprev.
+ The quality of these cutting edge Yocto Linux kernels is evolving
+ and the kernels are used in leading edge feature and BSP
+ development.
+ </para>
+ </section>
+
+ <section id='yocto-linux-kernel-architecture-and-branching-strategies'>
+ <title>Yocto Linux Kernel Architecture and Branching Strategies</title>
+
+ <para>
+ As mentioned earlier, a key goal of the Yocto Project is
+ to present the developer with a kernel that has a clear and
+ continuous history that is visible to the user.
+ The architecture and mechanisms, in particular the branching
+ strategies, used achieve that goal in a manner similar to
+ upstream Linux kernel development in
+ <filename>kernel.org</filename>.
+ </para>
+
+ <para>
+ You can think of a Yocto Linux kernel as consisting of a
+ baseline Linux kernel with added features logically structured
+ on top of the baseline.
+ The features are tagged and organized by way of a branching
+ strategy implemented by the Yocto Project team using the
+ Source Code Manager (SCM) Git.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Git is the obvious SCM for meeting the Yocto Linux
+ kernel organizational and structural goals described
+ in this section.
+ Not only is Git the SCM for Linux kernel development in
+ <filename>kernel.org</filename> but, Git continues to
+ grow in popularity and supports many different work
+ flows, front-ends and management techniques.
+ </para></listitem>
+ <listitem><para>
+ You can find documentation on Git at
+ <ulink url='http://git-scm.com/documentation'></ulink>.
+ You can also get an introduction to Git as it
+ applies to the Yocto Project in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink>"
+ section in the Yocto Project Overview and Concepts
+ Manual.
+ The latter reference provides an overview of
+ Git and presents a minimal set of Git commands
+ that allows you to be functional using Git.
+ You can use as much, or as little, of what Git
+ has to offer to accomplish what you need for your
+ project.
+ You do not have to be a "Git Expert" in order to
+ use it with the Yocto Project.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ Using Git's tagging and branching features, the Yocto Project
+ team creates kernel branches at points where functionality is
+ no longer shared and thus, needs to be isolated.
+ For example, board-specific incompatibilities would require
+ different functionality and would require a branch to
+ separate the features.
+ Likewise, for specific kernel features, the same branching
+ strategy is used.
+ </para>
+
+ <para>
+ This "tree-like" architecture results in a structure that has
+ features organized to be specific for particular functionality,
+ single kernel types, or a subset of kernel types.
+ Thus, the user has the ability to see the added features and the
+ commits that make up those features.
+ In addition to being able to see added features, the user
+ can also view the history of what made up the baseline
+ Linux kernel.
+ </para>
+
+ <para>
+ Another consequence of this strategy results in not having to
+ store the same feature twice internally in the tree.
+ Rather, the kernel team stores the unique differences required
+ to apply the feature onto the kernel type in question.
+ <note>
+ The Yocto Project team strives to place features in the tree
+ such that features can be shared by all boards and kernel
+ types where possible.
+ However, during development cycles or when large features
+ are merged, the team cannot always follow this practice.
+ In those cases, the team uses isolated branches to merge
+ features.
+ </note>
+ </para>
+
+ <para>
+ BSP-specific code additions are handled in a similar manner to
+ kernel-specific additions.
+ Some BSPs only make sense given certain kernel types.
+ So, for these types, the team creates branches off the end
+ of that kernel type for all of the BSPs that are supported on
+ that kernel type.
+ From the perspective of the tools that create the BSP branch,
+ the BSP is really no different than a feature.
+ Consequently, the same branching strategy applies to BSPs as
+ it does to kernel features.
+ So again, rather than store the BSP twice, the team only
+ stores the unique differences for the BSP across the supported
+ multiple kernels.
+ </para>
+
+ <para>
+ While this strategy can result in a tree with a significant number
+ of branches, it is important to realize that from the developer's
+ point of view, there is a linear path that travels from the
+ baseline <filename>kernel.org</filename>, through a select
+ group of features and ends with their BSP-specific commits.
+ In other words, the divisions of the kernel are transparent and
+ are not relevant to the developer on a day-to-day basis.
+ From the developer's perspective, this path is the "master" branch
+ in Git terms.
+ The developer does not need to be aware of the existence of any
+ other branches at all.
+ Of course, value exists in the having these branches in the tree,
+ should a person decide to explore them.
+ For example, a comparison between two BSPs at either the commit
+ level or at the line-by-line code <filename>diff</filename> level
+ is now a trivial operation.
+ </para>
+
+ <para>
+ The following illustration shows the conceptual Yocto
+ Linux kernel.
+ <imagedata fileref="figures/kernel-architecture-overview.png" width="6in" depth="7in" align="center" scale="100" />
+ </para>
+
+ <para>
+ In the illustration, the "Kernel.org Branch Point" marks the
+ specific spot (or Linux kernel release) from which the
+ Yocto Linux kernel is created.
+ From this point forward in the tree, features and differences
+ are organized and tagged.
+ </para>
+
+ <para>
+ The "Yocto Project Baseline Kernel" contains functionality that
+ is common to every kernel type and BSP that is organized
+ further along in the tree.
+ Placing these common features in the tree this way means
+ features do not have to be duplicated along individual
+ branches of the tree structure.
+ </para>
+
+ <para>
+ From the "Yocto Project Baseline Kernel", branch points represent
+ specific functionality for individual Board Support Packages
+ (BSPs) as well as real-time kernels.
+ The illustration represents this through three BSP-specific
+ branches and a real-time kernel branch.
+ Each branch represents some unique functionality for the BSP
+ or for a real-time Yocto Linux kernel.
+ </para>
+
+ <para>
+ In this example structure, the "Real-time (rt) Kernel" branch has
+ common features for all real-time Yocto Linux kernels and
+ contains more branches for individual BSP-specific real-time
+ kernels.
+ The illustration shows three branches as an example.
+ Each branch points the way to specific, unique features for a
+ respective real-time kernel as they apply to a given BSP.
+ </para>
+
+ <para>
+ The resulting tree structure presents a clear path of markers
+ (or branches) to the developer that, for all practical
+ purposes, is the Yocto Linux kernel needed for any given set of
+ requirements.
+ <note>
+ Keep in mind the figure does not take into account all the
+ supported Yocto Linux kernels, but rather shows a single
+ generic kernel just for conceptual purposes.
+ Also keep in mind that this structure represents the Yocto
+ Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ that are either pulled from during the build or established
+ on the host development system prior to the build by either
+ cloning a particular kernel's Git repository or by
+ downloading and unpacking a tarball.
+ </note>
+ </para>
+
+ <para>
+ Working with the kernel as a structured tree follows recognized
+ community best practices.
+ In particular, the kernel as shipped with the product, should be
+ considered an "upstream source" and viewed as a series of
+ historical and documented modifications (commits).
+ These modifications represent the development and stabilization
+ done by the Yocto Project kernel development team.
+ </para>
+
+ <para>
+ Because commits only change at significant release points in the
+ product life cycle, developers can work on a branch created
+ from the last relevant commit in the shipped Yocto Project Linux
+ kernel.
+ As mentioned previously, the structure is transparent to the
+ developer because the kernel tree is left in this state after
+ cloning and building the kernel.
+ </para>
+ </section>
+
+ <section id='kernel-build-file-hierarchy'>
+ <title>Kernel Build File Hierarchy</title>
+
+ <para>
+ Upstream storage of all the available kernel source code is
+ one thing, while representing and using the code on your host
+ development system is another.
+ Conceptually, you can think of the kernel source repositories
+ as all the source files necessary for all the supported
+ Yocto Linux kernels.
+ As a developer, you are just interested in the source files
+ for the kernel on which you are working.
+ And, furthermore, you need them available on your host system.
+ </para>
+
+ <para>
+ Kernel source code is available on your host system several
+ different ways:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Files Accessed While using <filename>devtool</filename>:</emphasis>
+ <filename>devtool</filename>, which is available with the
+ Yocto Project, is the preferred method by which to
+ modify the kernel.
+ See the
+ "<link linkend='kernel-modification-workflow'>Kernel Modification Workflow</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Cloned Repository:</emphasis>
+ If you are working in the kernel all the time, you probably
+ would want to set up your own local Git repository of the
+ Yocto Linux kernel tree.
+ For information on how to clone a Yocto Linux kernel
+ Git repository, see the
+ "<link linkend='preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Temporary Source Files from a Build:</emphasis>
+ If you just need to make some patches to the kernel using
+ a traditional BitBake workflow (i.e. not using the
+ <filename>devtool</filename>), you can access temporary
+ kernel source files that were extracted and used during
+ a kernel build.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The temporary kernel source files resulting from a build using
+ BitBake have a particular hierarchy.
+ When you build the kernel on your development system, all files
+ needed for the build are taken from the source repositories
+ pointed to by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable and gathered in a temporary work area where they are
+ subsequently used to create the unique kernel.
+ Thus, in a sense, the process constructs a local source tree
+ specific to your kernel from which to generate the new kernel
+ image.
+ </para>
+
+ <para>
+ The following figure shows the temporary file structure
+ created on your host system when you build the kernel using
+ Bitbake.
+ This
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ contains all the source files used during the build.
+ <imagedata fileref="figures/kernel-overview-2-generic.png"
+ width="6in" depth="5in" align="center" scale="100" />
+ </para>
+
+ <para>
+ Again, for additional information on the Yocto Project kernel's
+ architecture and its branching strategy, see the
+ "<link linkend='yocto-linux-kernel-architecture-and-branching-strategies'>Yocto Linux Kernel Architecture and Branching Strategies</link>"
+ section.
+ You can also reference the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ and
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ sections for detailed example that modifies the kernel.
+ </para>
+ </section>
+
+ <section id='determining-hardware-and-non-hardware-features-for-the-kernel-configuration-audit-phase'>
+ <title>Determining Hardware and Non-Hardware Features for the Kernel Configuration Audit Phase</title>
+
+ <para>
+ This section describes part of the kernel configuration audit
+ phase that most developers can ignore.
+ For general information on kernel configuration including
+ <filename>menuconfig</filename>, <filename>defconfig</filename>
+ files, and configuration fragments, see the
+ "<link linkend='configuring-the-kernel'>Configuring the Kernel</link>"
+ section.
+ </para>
+
+ <para>
+ During this part of the audit phase, the contents of the final
+ <filename>.config</filename> file are compared against the
+ fragments specified by the system.
+ These fragments can be system fragments, distro fragments,
+ or user-specified configuration elements.
+ Regardless of their origin, the OpenEmbedded build system
+ warns the user if a specific option is not included in the
+ final kernel configuration.
+ </para>
+
+ <para>
+ By default, in order to not overwhelm the user with
+ configuration warnings, the system only reports missing
+ "hardware" options as they could result in a boot
+ failure or indicate that important hardware is not available.
+ </para>
+
+ <para>
+ To determine whether or not a given option is "hardware" or
+ "non-hardware", the kernel Metadata in
+ <filename>yocto-kernel-cache</filename> contains files that
+ classify individual or groups of options as either hardware
+ or non-hardware.
+ To better show this, consider a situation where the
+ <filename>yocto-kernel-cache</filename> contains the following
+ files:
+ <literallayout class='monospaced'>
+ yocto-kernel-cache/features/drm-psb/hardware.cfg
+ yocto-kernel-cache/features/kgdb/hardware.cfg
+ yocto-kernel-cache/ktypes/base/hardware.cfg
+ yocto-kernel-cache/bsp/mti-malta32/hardware.cfg
+ yocto-kernel-cache/bsp/fsl-mpc8315e-rdb/hardware.cfg
+ yocto-kernel-cache/bsp/qemu-ppc32/hardware.cfg
+ yocto-kernel-cache/bsp/qemuarma9/hardware.cfg
+ yocto-kernel-cache/bsp/mti-malta64/hardware.cfg
+ yocto-kernel-cache/bsp/arm-versatile-926ejs/hardware.cfg
+ yocto-kernel-cache/bsp/common-pc/hardware.cfg
+ yocto-kernel-cache/bsp/common-pc-64/hardware.cfg
+ yocto-kernel-cache/features/rfkill/non-hardware.cfg
+ yocto-kernel-cache/ktypes/base/non-hardware.cfg
+ yocto-kernel-cache/features/aufs/non-hardware.kcf
+ yocto-kernel-cache/features/ocf/non-hardware.kcf
+ yocto-kernel-cache/ktypes/base/non-hardware.kcf
+ yocto-kernel-cache/ktypes/base/hardware.kcf
+ yocto-kernel-cache/bsp/qemu-ppc32/hardware.kcf
+ </literallayout>
+ The following list provides explanations for the various
+ files:
+ <itemizedlist>
+ <listitem><para>
+ <filename>hardware.kcf</filename>:
+ Specifies a list of kernel Kconfig files that contain
+ hardware options only.
+ </para></listitem>
+ <listitem><para>
+ <filename>non-hardware.kcf</filename>:
+ Specifies a list of kernel Kconfig files that contain
+ non-hardware options only.
+ </para></listitem>
+ <listitem><para>
+ <filename>hardware.cfg</filename>:
+ Specifies a list of kernel <filename>CONFIG_</filename>
+ options that are hardware, regardless of whether or not
+ they are within a Kconfig file specified by a hardware
+ or non-hardware Kconfig file (i.e.
+ <filename>hardware.kcf</filename> or
+ <filename>non-hardware.kcf</filename>).
+ </para></listitem>
+ <listitem><para>
+ <filename>non-hardware.cfg</filename>:
+ Specifies a list of kernel <filename>CONFIG_</filename>
+ options that are not hardware, regardless of whether or
+ not they are within a Kconfig file specified by a
+ hardware or non-hardware Kconfig file (i.e.
+ <filename>hardware.kcf</filename> or
+ <filename>non-hardware.kcf</filename>).
+ </para></listitem>
+ </itemizedlist>
+ Here is a specific example using the
+ <filename>kernel-cache/bsp/mti-malta32/hardware.cfg</filename>:
+ <literallayout class='monospaced'>
+ CONFIG_SERIAL_8250
+ CONFIG_SERIAL_8250_CONSOLE
+ CONFIG_SERIAL_8250_NR_UARTS
+ CONFIG_SERIAL_8250_PCI
+ CONFIG_SERIAL_CORE
+ CONFIG_SERIAL_CORE_CONSOLE
+ CONFIG_VGA_ARB
+ </literallayout>
+ The kernel configuration audit automatically detects these
+ files (hence the names must be exactly the ones discussed here),
+ and uses them as inputs when generating warnings about the
+ final <filename>.config</filename> file.
+ </para>
+
+ <para>
+ A user-specified kernel Metadata repository, or recipe space
+ feature, can use these same files to classify options that are
+ found within its <filename>.cfg</filename> files as hardware
+ or non-hardware, to prevent the OpenEmbedded build system from
+ producing an error or warning when an option is not in the
+ final <filename>.config</filename> file.
+ </para>
+ </section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-customization.xsl b/poky/documentation/kernel-dev/kernel-dev-customization.xsl
new file mode 100644
index 000000000..325b738e9
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-customization.xsl
@@ -0,0 +1,26 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'kernel-dev-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl b/poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl
new file mode 100644
index 000000000..3c56a5a9e
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/kernel-dev/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/kernel-dev/kernel-dev-faq.xml b/poky/documentation/kernel-dev/kernel-dev-faq.xml
new file mode 100644
index 000000000..c3a20465a
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-faq.xml
@@ -0,0 +1,142 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='kernel-dev-faq'>
+<title>Kernel Development FAQ</title>
+
+<section id='kernel-dev-faq-section'>
+ <title>Common Questions and Solutions</title>
+
+ <para>
+ The following lists some solutions for common questions.
+
+
+ <qandaset>
+ <qandaentry>
+ <question>
+ <para>
+ How do I use my own Linux kernel <filename>.config</filename>
+ file?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Refer to the "<link linkend='changing-the-configuration'>Changing the Configuration</link>"
+ section for information.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I create configuration fragments?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Refer to the
+ "<link linkend='creating-config-fragments'>Creating Configuration Fragments</link>"
+ section for information.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I use my own Linux kernel sources?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Refer to the "<link linkend='working-with-your-own-sources'>Working With Your Own Sources</link>"
+ section for information.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I install/not-install the kernel image on the rootfs?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The kernel image (e.g. <filename>vmlinuz</filename>) is provided
+ by the <filename>kernel-image</filename> package.
+ Image recipes depend on <filename>kernel-base</filename>.
+ To specify whether or not the kernel
+ image is installed in the generated root filesystem, override
+ <filename>RDEPENDS_kernel-base</filename> to include or not
+ include "kernel-image".</para>
+ <para>See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for information on how to use an append file to
+ override metadata.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I install a specific kernel module?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Linux kernel modules are packaged individually.
+ To ensure a specific kernel module is included in an image,
+ include it in the appropriate machine
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>
+ variable.</para>
+ <para>These other variables are useful for installing specific
+ modules:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RDEPENDS'><filename>MACHINE_EXTRA_RDEPENDS</filename></ulink>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_EXTRA_RRECOMMENDS'><filename>MACHINE_EXTRA_RRECOMMENDS</filename></ulink>
+ </literallayout>
+ For example, set the following in the <filename>qemux86.conf</filename>
+ file to include the <filename>ab123</filename> kernel modules
+ with images built for the <filename>qemux86</filename> machine:
+ <literallayout class='monospaced'>
+ MACHINE_EXTRA_RRECOMMENDS += "kernel-module-ab123"
+ </literallayout>
+ For more information, see the
+ "<link linkend='incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</link>"
+ section.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I change the Linux kernel command line?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The Linux kernel command line is typically specified in
+ the machine config using the <filename>APPEND</filename> variable.
+ For example, you can add some helpful debug information doing
+ the following:
+ <literallayout class='monospaced'>
+ APPEND += "printk.time=y initcall_debug debug"
+ </literallayout>
+ </para>
+ </answer>
+ </qandaentry>
+ </qandaset>
+ </para>
+</section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-intro.xml b/poky/documentation/kernel-dev/kernel-dev-intro.xml
new file mode 100644
index 000000000..4e4fd282a
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-intro.xml
@@ -0,0 +1,259 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='kernel-dev-intro'>
+<title>Introduction</title>
+
+<section id='kernel-dev-overview'>
+ <title>Overview</title>
+
+ <para>
+ Regardless of how you intend to make use of the Yocto Project,
+ chances are you will work with the Linux kernel.
+ This manual describes how to set up your build host to support
+ kernel development, introduces the kernel development process,
+ provides background information on the Yocto Linux kernel
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>,
+ describes common tasks you can perform using the kernel tools,
+ shows you how to use the kernel Metadata needed to work with
+ the kernel inside the Yocto Project, and provides insight into how
+ the Yocto Project team develops and maintains Yocto Linux kernel
+ Git repositories and Metadata.
+ </para>
+
+ <para>
+ Each Yocto Project release has a set of Yocto Linux kernel recipes,
+ whose Git repositories you can view in the Yocto
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> under
+ the "Yocto Linux Kernel" heading.
+ New recipes for the release track the latest Linux kernel
+ upstream developments from
+ <ulink url='http://www.kernel.org'></ulink> and introduce
+ newly-supported platforms.
+ Previous recipes in the release are refreshed and supported for at
+ least one additional Yocto Project release.
+ As they align, these previous releases are updated to include the
+ latest from the Long Term Support Initiative (LTSI) project.
+ You can learn more about Yocto Linux kernels and LTSI in the
+ "<link linkend='kernel-big-picture'>Yocto Project Kernel Development and Maintenance</link>"
+ section.
+ </para>
+
+ <para>
+ Also included is a Yocto Linux kernel development recipe
+ (<filename>linux-yocto-dev.bb</filename>) should you want to work
+ with the very latest in upstream Yocto Linux kernel development and
+ kernel Metadata development.
+ <note>
+ For more on Yocto Linux kernels, see the
+ "<link linkend='kernel-big-picture'>Yocto Project Kernel Development and Maintenance</link>
+ section.
+ </note>
+ </para>
+
+ <para>
+ The Yocto Project also provides a powerful set of kernel
+ tools for managing Yocto Linux kernel sources and configuration data.
+ You can use these tools to make a single configuration change,
+ apply multiple patches, or work with your own kernel sources.
+ </para>
+
+ <para>
+ In particular, the kernel tools allow you to generate configuration
+ fragments that specify only what you must, and nothing more.
+ Configuration fragments only need to contain the highest level
+ visible <filename>CONFIG</filename> options as presented by the
+ Yocto Linux kernel <filename>menuconfig</filename> system.
+ Contrast this against a complete Yocto Linux kernel
+ <filename>.config</filename> file, which includes all the automatically
+ selected <filename>CONFIG</filename> options.
+ This efficiency reduces your maintenance effort and allows you
+ to further separate your configuration in ways that make sense for
+ your project.
+ A common split separates policy and hardware.
+ For example, all your kernels might support the
+ <filename>proc</filename> and <filename>sys</filename> filesystems,
+ but only specific boards require sound, USB, or specific drivers.
+ Specifying these configurations individually allows you to aggregate
+ them together as needed, but maintains them in only one place.
+ Similar logic applies to separating source changes.
+ </para>
+
+ <para>
+ If you do not maintain your own kernel sources and need to make
+ only minimal changes to the sources, the released recipes provide a
+ vetted base upon which to layer your changes.
+ Doing so allows you to benefit from the continual kernel
+ integration and testing performed during development of the
+ Yocto Project.
+ </para>
+
+ <para>
+ If, instead, you have a very specific Linux kernel source tree
+ and are unable to align with one of the official Yocto Linux kernel
+ recipes, an alternative exists by which you can use the Yocto
+ Project Linux kernel tools with your own kernel sources.
+ </para>
+
+ <para>
+ The remainder of this manual provides instructions for completing
+ specific Linux kernel development tasks.
+ These instructions assume you are comfortable working with
+ <ulink url='http://openembedded.org/wiki/Bitbake'>BitBake</ulink>
+ recipes and basic open-source development tools.
+ Understanding these concepts will facilitate the process of working
+ with the kernel recipes.
+ If you find you need some additional background, please be sure to
+ review and understand the following documentation:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>
+ document.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'><filename>devtool</filename> workflow</ulink>
+ as described in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
+ <listitem><para>
+ The
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ The
+ "<link linkend='kernel-modification-workflow'>Kernel Modification Workflow</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='kernel-modification-workflow'>
+ <title>Kernel Modification Workflow</title>
+
+ <para>
+ Kernel modification involves changing the Yocto Project kernel,
+ which could involve changing configuration options as well as adding
+ new kernel recipes.
+ Configuration changes can be added in the form of configuration
+ fragments, while recipe modification comes through the kernel's
+ <filename>recipes-kernel</filename> area in a kernel layer you create.
+ </para>
+
+ <para>
+ This section presents a high-level overview of the Yocto Project
+ kernel modification workflow.
+ The illustration and accompanying list provide general information
+ and references for further information.
+ <imagedata fileref="figures/kernel-dev-flow.png"
+ width="9in" depth="5in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+
+
+ <emphasis>Set up Your Host Development System to Support
+ Development Using the Yocto Project</emphasis>:
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-start'>Setting Up the Development Host to Use the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ options on how to get a build host ready to use the Yocto
+ Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Set Up Your Host Development System for Kernel Development:</emphasis>
+ It is recommended that you use <filename>devtool</filename>
+ and an extensible SDK for kernel development.
+ Alternatively, you can use traditional kernel development
+ methods with the Yocto Project.
+ Either way, there are steps you need to take to get the
+ development environment ready.</para>
+
+ <para>Using <filename>devtool</filename> and the eSDK requires
+ that you have a clean build of the image and that you are
+ set up with the appropriate eSDK.
+ For more information, see the
+ "<link linkend='getting-ready-to-develop-using-devtool'>Getting Ready to Develop Using <filename>devtool</filename></link>"
+ section.</para>
+
+ <para>Using traditional kernel development requires that you
+ have the kernel source available in an isolated local Git
+ repository.
+ For more information, see the
+ "<link linkend='getting-ready-for-traditional-kernel-development'>Getting Ready for Traditional Kernel Development</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Changes to the Kernel Source Code if
+ applicable:</emphasis>
+ Modifying the kernel does not always mean directly
+ changing source files.
+ However, if you have to do this, you make the changes to the
+ files in the eSDK's Build Directory if you are using
+ <filename>devtool</filename>.
+ For more information, see the
+ "<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
+ section.</para>
+
+ <para>If you are using traditional kernel development, you
+ edit the source files in the kernel's local Git repository.
+ For more information, see the
+ "<link linkend='using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Kernel Configuration Changes if
+ Applicable:</emphasis>
+ If your situation calls for changing the kernel's
+ configuration, you can use
+ <link linkend='using-menuconfig'><filename>menuconfig</filename></link>,
+ which allows you to interactively develop and test the
+ configuration changes you are making to the kernel.
+ Saving changes you make with <filename>menuconfig</filename>
+ updates the kernel's <filename>.config</filename> file.
+ <note><title>Warning</title>
+ Try to resist the temptation to directly edit an
+ existing <filename>.config</filename> file, which is
+ found in the Build Directory among the source code
+ used for the build.
+ Doing so, can produce unexpected results when the
+ OpenEmbedded build system regenerates the configuration
+ file.
+ </note>
+ Once you are satisfied with the configuration
+ changes made using <filename>menuconfig</filename>
+ and you have saved them, you can directly compare the
+ resulting <filename>.config</filename> file against an
+ existing original and gather those changes into a
+ <link linkend='creating-config-fragments'>configuration fragment file</link>
+ to be referenced from within the kernel's
+ <filename>.bbappend</filename> file.</para>
+
+ <para>Additionally, if you are working in a BSP layer
+ and need to modify the BSP's kernel's configuration,
+ you can use <filename>menuconfig</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Rebuild the Kernel Image With Your Changes:</emphasis>
+ Rebuilding the kernel image applies your changes.
+ Depending on your target hardware, you can verify your changes
+ on actual hardware or perhaps QEMU.
+ </para></listitem>
+ </orderedlist>
+ The remainder of this developer's guide covers common tasks typically
+ used during kernel development, advanced Metadata usage, and Yocto Linux
+ kernel maintenance concepts.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-maint-appx.xml b/poky/documentation/kernel-dev/kernel-dev-maint-appx.xml
new file mode 100644
index 000000000..b825ae7ea
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-maint-appx.xml
@@ -0,0 +1,356 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='kernel-dev-maint-appx'>
+<title>Kernel Maintenance</title>
+
+ <section id='tree-construction'>
+ <title>Tree Construction</title>
+
+ <para>
+ This section describes construction of the Yocto Project kernel
+ source repositories as accomplished by the Yocto Project team to
+ create Yocto Linux kernel repositories.
+ These kernel repositories are found under the heading "Yocto Linux
+ Kernel" at
+ <ulink url='&YOCTO_GIT_URL;'>&YOCTO_GIT_URL;</ulink>
+ and are shipped as part of a Yocto Project release.
+ The team creates these repositories by compiling and executing the
+ set of feature descriptions for every BSP and feature in the
+ product.
+ Those feature descriptions list all necessary patches,
+ configurations, branches, tags, and feature divisions found in a
+ Yocto Linux kernel.
+ Thus, the Yocto Project Linux kernel repository (or tree) and
+ accompanying Metadata in the
+ <filename>yocto-kernel-cache</filename> are built.
+ </para>
+
+ <para>
+ The existence of these repositories allow you to access and clone a
+ particular Yocto Project Linux kernel repository and use it to
+ build images based on their configurations and features.
+ </para>
+
+ <para>
+ You can find the files used to describe all the valid features and
+ BSPs in the Yocto Project Linux kernel in any clone of the Yocto
+ Project Linux kernel source repository and
+ <filename>yocto-kernel-cache</filename> Git trees.
+ For example, the following commands clone the Yocto Project
+ baseline Linux kernel that branches off
+ <filename>linux.org</filename> version 4.12 and the
+ <filename>yocto-kernel-cache</filename>, which contains stores of
+ kernel Metadata:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/linux-yocto-4.12
+ $ git clone git://git.yoctoproject.org/linux-kernel-cache
+ </literallayout>
+ For more information on how to set up a local Git repository of
+ the Yocto Project Linux kernel files, see the
+ "<link linkend='preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</link>"
+ section.
+ </para>
+
+ <para>
+ Once you have cloned the kernel Git repository and the
+ cache of Metadata on your local machine, you can discover the
+ branches that are available in the repository using the following
+ Git command:
+ <literallayout class='monospaced'>
+ $ git branch -a
+ </literallayout>
+ Checking out a branch allows you to work with a particular
+ Yocto Linux kernel.
+ For example, the following commands check out the
+ "standard/beagleboard" branch of the Yocto Linux kernel repository
+ and the "yocto-4.12" branch of the
+ <filename>yocto-kernel-cache</filename> repository:
+ <literallayout class='monospaced'>
+ $ cd ~/linux-yocto-4.12
+ $ git checkout -b my-kernel-4.12 remotes/origin/standard/beagleboard
+ $ cd ~/linux-kernel-cache
+ $ git checkout -b my-4.12-metadata remotes/origin/yocto-4.12
+ </literallayout>
+ <note>
+ Branches in the <filename>yocto-kernel-cache</filename>
+ repository correspond to Yocto Linux kernel versions
+ (e.g. "yocto-4.12", "yocto-4.10", "yocto-4.9", and so forth).
+ </note>
+ Once you have checked out and switched to appropriate branches,
+ you can see a snapshot of all the kernel source files used to
+ used to build that particular Yocto Linux kernel for a
+ particular board.
+ </para>
+
+ <para>
+ To see the features and configurations for a particular Yocto
+ Linux kernel, you need to examine the
+ <filename>yocto-kernel-cache</filename> Git repository.
+ As mentioned, branches in the
+ <filename>yocto-kernel-cache</filename> repository correspond to
+ Yocto Linux kernel versions (e.g. <filename>yocto-4.12</filename>).
+ Branches contain descriptions in the form of
+ <filename>.scc</filename> and <filename>.cfg</filename> files.
+ </para>
+
+ <para>
+ You should realize, however, that browsing your local
+ <filename>yocto-kernel-cache</filename> repository for feature
+ descriptions and patches is not an effective way to determine what
+ is in a particular kernel branch.
+ Instead, you should use Git directly to discover the changes in
+ a branch.
+ Using Git is an efficient and flexible way to inspect changes to
+ the kernel.
+ <note>
+ Ground up reconstruction of the complete kernel tree is an
+ action only taken by the Yocto Project team during an active
+ development cycle.
+ When you create a clone of the kernel Git repository, you are
+ simply making it efficiently available for building and
+ development.
+ </note>
+ </para>
+
+ <para>
+ The following steps describe what happens when the Yocto Project
+ Team constructs the Yocto Project kernel source Git repository
+ (or tree) found at
+ <ulink url='&YOCTO_GIT_URL;'></ulink> given the
+ introduction of a new top-level kernel feature or BSP.
+ The following actions effectively provide the Metadata
+ and create the tree that includes the new feature, patch, or BSP:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Pass Feature to the OpenEmbedded Build System:</emphasis>
+ A top-level kernel feature is passed to the kernel build
+ subsystem.
+ Normally, this feature is a BSP for a particular kernel
+ type.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Locate Feature:</emphasis>
+ The file that describes the top-level feature is located
+ by searching these system directories:
+ <itemizedlist>
+ <listitem><para>
+ The in-tree kernel-cache directories, which are
+ located in the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache/tree/bsp'><filename>yocto-kernel-cache</filename></ulink>
+ repository organized under the "Yocto Linux Kernel"
+ heading in the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Yocto Project Source Repositories</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Areas pointed to by <filename>SRC_URI</filename>
+ statements found in kernel recipes
+ </para></listitem>
+ </itemizedlist>
+ For a typical build, the target of the search is a
+ feature description in an <filename>.scc</filename> file
+ whose name follows this format (e.g.
+ <filename>beaglebone-standard.scc</filename> and
+ <filename>beaglebone-preempt-rt.scc</filename>):
+ <literallayout class='monospaced'>
+ <replaceable>bsp_root_name</replaceable>-<replaceable>kernel_type</replaceable>.scc
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Expand Feature:</emphasis>
+ Once located, the feature description is either expanded
+ into a simple script of actions, or into an existing
+ equivalent script that is already part of the shipped
+ kernel.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Append Extra Features:</emphasis>
+ Extra features are appended to the top-level feature
+ description.
+ These features can come from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_FEATURES'><filename>KERNEL_FEATURES</filename></ulink>
+ variable in recipes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Locate, Expand, and Append Each Feature:</emphasis>
+ Each extra feature is located, expanded and appended to
+ the script as described in step three.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Execute the Script:</emphasis>
+ The script is executed to produce files
+ <filename>.scc</filename> and <filename>.cfg</filename>
+ files in appropriate directories of the
+ <filename>yocto-kernel-cache</filename> repository.
+ These files are descriptions of all the branches, tags,
+ patches and configurations that need to be applied to the
+ base Git repository to completely create the
+ source (build) branch for the new BSP or feature.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone Base Repository:</emphasis>
+ The base repository is cloned, and the actions
+ listed in the <filename>yocto-kernel-cache</filename>
+ directories are applied to the tree.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Perform Cleanup:</emphasis>
+ The Git repositories are left with the desired branches
+ checked out and any required branching, patching and
+ tagging has been performed.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The kernel tree and cache are ready for developer consumption to
+ be locally cloned, configured, and built into a Yocto Project
+ kernel specific to some target hardware.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ The generated <filename>yocto-kernel-cache</filename>
+ repository adds to the kernel as shipped with the Yocto
+ Project release.
+ Any add-ons and configuration data are applied to the
+ end of an existing branch.
+ The full repository generation that is found in the
+ official Yocto Project kernel repositories at
+ <ulink url='&YOCTO_GIT_URL;'>http://git.yoctoproject.org</ulink>
+ is the combination of all supported boards and
+ configurations.
+ </para></listitem>
+ <listitem><para>
+ The technique the Yocto Project team uses is flexible
+ and allows for seamless blending of an immutable
+ history with additional patches specific to a
+ deployment.
+ Any additions to the kernel become an integrated part
+ of the branches.
+ </para></listitem>
+ <listitem><para>
+ The full kernel tree that you see on
+ <ulink url='&YOCTO_GIT_URL;'></ulink> is
+ generated through repeating the above steps for all
+ valid BSPs.
+ The end result is a branched, clean history tree that
+ makes up the kernel for a given release.
+ You can see the script (<filename>kgit-scc</filename>)
+ responsible for this in the
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/yocto-kernel-tools/tree/tools'><filename>yocto-kernel-tools</filename></ulink>
+ repository.
+ </para></listitem>
+ <listitem><para>
+ The steps used to construct the full kernel tree are
+ the same steps that BitBake uses when it builds a
+ kernel image.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </section>
+
+ <section id='build-strategy'>
+ <title>Build Strategy</title>
+
+ <para>
+ Once you have cloned a Yocto Linux kernel repository and the
+ cache repository (<filename>yocto-kernel-cache</filename>) onto
+ your development system, you can consider the compilation phase
+ of kernel development, which is building a kernel image.
+ Some prerequisites exist that are validated by the build process
+ before compilation starts:
+ </para>
+
+ <itemizedlist>
+ <listitem><para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ points to the kernel Git repository.
+ </para></listitem>
+ <listitem><para>
+ A BSP build branch with Metadata exists in the
+ <filename>yocto-kernel-cache</filename> repository.
+ The branch is based on the Yocto Linux kernel version and
+ has configurations and features grouped under the
+ <filename>yocto-kernel-cache/bsp</filename> directory.
+ For example, features and configurations for the
+ BeagleBone Board assuming a
+ <filename>linux-yocto_4.12</filename> kernel reside in the
+ following area of the <filename>yocto-kernel-cache</filename>
+ repository:
+ <literallayout class='monospaced'>
+ yocto-kernel-cache/bsp/beaglebone
+ </literallayout>
+ <note>
+ In the previous example, the "yocto-4.12" branch is
+ checked out in the <filename>yocto-kernel-cache</filename>
+ repository.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+
+ <para>
+ The OpenEmbedded build system makes sure these conditions exist
+ before attempting compilation.
+ Other means, however, do exist, such as as bootstrapping a BSP.
+ </para>
+
+ <para>
+ Before building a kernel, the build process verifies the tree
+ and configures the kernel by processing all of the
+ configuration "fragments" specified by feature descriptions
+ in the <filename>.scc</filename> files.
+ As the features are compiled, associated kernel configuration
+ fragments are noted and recorded in the series of directories
+ in their compilation order.
+ The fragments are migrated, pre-processed and passed to the
+ Linux Kernel Configuration subsystem (<filename>lkc</filename>) as
+ raw input in the form of a <filename>.config</filename> file.
+ The <filename>lkc</filename> uses its own internal dependency
+ constraints to do the final processing of that information and
+ generates the final <filename>.config</filename> file that is used
+ during compilation.
+ </para>
+
+ <para>
+ Using the board's architecture and other relevant values from
+ the board's template, kernel compilation is started and a kernel
+ image is produced.
+ </para>
+
+ <para>
+ The other thing that you notice once you configure a kernel is that
+ the build process generates a build tree that is separate from
+ your kernel's local Git source repository tree.
+ This build tree has a name that uses the following form, where
+ <filename>${MACHINE}</filename> is the metadata name of the
+ machine (BSP) and "kernel_type" is one of the Yocto Project
+ supported kernel types (e.g. "standard"):
+ <literallayout class='monospaced'>
+ linux-${MACHINE}-<replaceable>kernel_type</replaceable>-build
+ </literallayout>
+ </para>
+
+ <para>
+ The existing support in the <filename>kernel.org</filename> tree
+ achieves this default functionality.
+ </para>
+
+ <para>
+ This behavior means that all the generated files for a particular
+ machine or BSP are now in the build tree directory.
+ The files include the final <filename>.config</filename> file,
+ all the <filename>.o</filename> files, the <filename>.a</filename>
+ files, and so forth.
+ Since each machine or BSP has its own separate
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in its own separate branch of the Git repository, you can easily
+ switch between different builds.
+ </para>
+ </section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/kernel-dev/kernel-dev-style.css b/poky/documentation/kernel-dev/kernel-dev-style.css
new file mode 100644
index 000000000..9c01aa798
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev-style.css
@@ -0,0 +1,988 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/kernel-dev-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/kernel-dev/kernel-dev.xml b/poky/documentation/kernel-dev/kernel-dev.xml
new file mode 100644
index 000000000..986c44044
--- /dev/null
+++ b/poky/documentation/kernel-dev/kernel-dev.xml
@@ -0,0 +1,170 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='kernel-dev' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/kernel-dev-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Linux Kernel Development Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Linux Kernel Development Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="kernel-dev-intro.xml"/>
+
+ <xi:include href="kernel-dev-common.xml"/>
+
+ <xi:include href="kernel-dev-advanced.xml"/>
+
+ <xi:include href="kernel-dev-concepts-appx.xml"/>
+
+ <xi:include href="kernel-dev-maint-appx.xml"/>
+
+ <xi:include href="kernel-dev-faq.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/mega-manual/figures/YP-flow-diagram.png b/poky/documentation/mega-manual/figures/YP-flow-diagram.png
new file mode 100644
index 000000000..35969038c
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/YP-flow-diagram.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/add-variable.png b/poky/documentation/mega-manual/figures/add-variable.png
new file mode 100644
index 000000000..6bdcca705
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/add-variable.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/analysis-for-package-splitting.png b/poky/documentation/mega-manual/figures/analysis-for-package-splitting.png
new file mode 100644
index 000000000..0cb038666
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/analysis-for-package-splitting.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/bash-oecore.png b/poky/documentation/mega-manual/figures/bash-oecore.png
new file mode 100644
index 000000000..801a5d911
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/bash-oecore.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/bitbake-build-flow.png b/poky/documentation/mega-manual/figures/bitbake-build-flow.png
new file mode 100644
index 000000000..eb95eb3da
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/bitbake-build-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/bsp-dev-flow.png b/poky/documentation/mega-manual/figures/bsp-dev-flow.png
new file mode 100644
index 000000000..2ca1fecad
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/bsp-dev-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/bsp-title.png b/poky/documentation/mega-manual/figures/bsp-title.png
new file mode 100644
index 000000000..f624dd4f9
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/bsp-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/build-workspace-directory.png b/poky/documentation/mega-manual/figures/build-workspace-directory.png
new file mode 100644
index 000000000..5387d33f0
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/build-workspace-directory.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/buildhistory-web.png b/poky/documentation/mega-manual/figures/buildhistory-web.png
new file mode 100644
index 000000000..f6db86c97
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/buildhistory-web.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/buildhistory.png b/poky/documentation/mega-manual/figures/buildhistory.png
new file mode 100644
index 000000000..bd5f8a490
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/buildhistory.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/building-an-image.png b/poky/documentation/mega-manual/figures/building-an-image.png
new file mode 100755
index 000000000..1fbea5ab0
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/building-an-image.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/bypqs-title.png b/poky/documentation/mega-manual/figures/bypqs-title.png
new file mode 100644
index 000000000..9e0a5ce52
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/bypqs-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/compatible-layers.png b/poky/documentation/mega-manual/figures/compatible-layers.png
new file mode 100644
index 000000000..38436b075
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/compatible-layers.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/concepts-manual-title.png b/poky/documentation/mega-manual/figures/concepts-manual-title.png
new file mode 100644
index 000000000..bac7a6999
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/concepts-manual-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png b/poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png
new file mode 100644
index 000000000..043d195a3
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/configuration-compile-autoreconf.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/cross-development-toolchains.png b/poky/documentation/mega-manual/figures/cross-development-toolchains.png
new file mode 100644
index 000000000..cbe8371c0
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/cross-development-toolchains.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/define-generic.png b/poky/documentation/mega-manual/figures/define-generic.png
new file mode 100644
index 000000000..bd22718a5
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/define-generic.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/dev-title.png b/poky/documentation/mega-manual/figures/dev-title.png
new file mode 100644
index 000000000..15e67d074
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/dev-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/git-workflow.png b/poky/documentation/mega-manual/figures/git-workflow.png
new file mode 100644
index 000000000..e401330a1
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/git-workflow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/hosted-service.png b/poky/documentation/mega-manual/figures/hosted-service.png
new file mode 100644
index 000000000..01fea7b24
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/hosted-service.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/image-generation.png b/poky/documentation/mega-manual/figures/image-generation.png
new file mode 100644
index 000000000..aff9fc27e
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/image-generation.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/images.png b/poky/documentation/mega-manual/figures/images.png
new file mode 100644
index 000000000..20c01307d
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/images.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/import-layer.png b/poky/documentation/mega-manual/figures/import-layer.png
new file mode 100644
index 000000000..436ec7af4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/import-layer.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/index-downloads.png b/poky/documentation/mega-manual/figures/index-downloads.png
new file mode 100644
index 000000000..96303b878
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/index-downloads.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-architecture-overview.png b/poky/documentation/mega-manual/figures/kernel-architecture-overview.png
new file mode 100755
index 000000000..2aad172db
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-architecture-overview.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-dev-flow.png b/poky/documentation/mega-manual/figures/kernel-dev-flow.png
new file mode 100644
index 000000000..793a395e8
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-dev-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-dev-title.png b/poky/documentation/mega-manual/figures/kernel-dev-title.png
new file mode 100644
index 000000000..7a8dd5437
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-dev-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-overview-1.png b/poky/documentation/mega-manual/figures/kernel-overview-1.png
new file mode 100644
index 000000000..116c0b9bd
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-overview-1.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-overview-2-generic.png b/poky/documentation/mega-manual/figures/kernel-overview-2-generic.png
new file mode 100644
index 000000000..ee2cdb206
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-overview-2-generic.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernel-title.png b/poky/documentation/mega-manual/figures/kernel-title.png
new file mode 100644
index 000000000..59d86c00d
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernel-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernelshark-all.png b/poky/documentation/mega-manual/figures/kernelshark-all.png
new file mode 100644
index 000000000..99b40bafe
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernelshark-all.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernelshark-choose-events.png b/poky/documentation/mega-manual/figures/kernelshark-choose-events.png
new file mode 100644
index 000000000..e8dd62a57
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernelshark-choose-events.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernelshark-i915-display.png b/poky/documentation/mega-manual/figures/kernelshark-i915-display.png
new file mode 100644
index 000000000..bb0edfb7f
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernelshark-i915-display.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/kernelshark-output-display.png b/poky/documentation/mega-manual/figures/kernelshark-output-display.png
new file mode 100644
index 000000000..ae2d0e573
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/kernelshark-output-display.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/key-dev-elements.png b/poky/documentation/mega-manual/figures/key-dev-elements.png
new file mode 100644
index 000000000..76c44050f
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/key-dev-elements.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/layer-input.png b/poky/documentation/mega-manual/figures/layer-input.png
new file mode 100644
index 000000000..29b56f9ea
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/layer-input.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/lttngmain0.png b/poky/documentation/mega-manual/figures/lttngmain0.png
new file mode 100644
index 000000000..5f60113cc
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/lttngmain0.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/mega-title.png b/poky/documentation/mega-manual/figures/mega-title.png
new file mode 100644
index 000000000..cde0b89a4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/mega-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/new-project.png b/poky/documentation/mega-manual/figures/new-project.png
new file mode 100644
index 000000000..dbc50b991
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/new-project.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/oprofileui-busybox.png b/poky/documentation/mega-manual/figures/oprofileui-busybox.png
new file mode 100644
index 000000000..a8275c65d
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/oprofileui-busybox.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png b/poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png
new file mode 100644
index 000000000..deb647020
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/oprofileui-copy-to-user.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/oprofileui-downloading.png b/poky/documentation/mega-manual/figures/oprofileui-downloading.png
new file mode 100644
index 000000000..57742d672
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/oprofileui-downloading.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/oprofileui-processes.png b/poky/documentation/mega-manual/figures/oprofileui-processes.png
new file mode 100644
index 000000000..ae547028f
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/oprofileui-processes.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/overview-manual-title.png b/poky/documentation/mega-manual/figures/overview-manual-title.png
new file mode 100644
index 000000000..41e9012c4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/overview-manual-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/package-feeds.png b/poky/documentation/mega-manual/figures/package-feeds.png
new file mode 100644
index 000000000..759283937
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/package-feeds.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/patching.png b/poky/documentation/mega-manual/figures/patching.png
new file mode 100644
index 000000000..80fba7e7c
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/patching.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png b/poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png
new file mode 100644
index 000000000..1a1070deb
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-probe-do_fork-profile.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-report-cycles-u.png b/poky/documentation/mega-manual/figures/perf-report-cycles-u.png
new file mode 100644
index 000000000..68ec6af80
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-report-cycles-u.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-systemwide-libc.png b/poky/documentation/mega-manual/figures/perf-systemwide-libc.png
new file mode 100644
index 000000000..2b72869c7
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-systemwide-libc.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-systemwide.png b/poky/documentation/mega-manual/figures/perf-systemwide.png
new file mode 100644
index 000000000..12ce2444a
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-systemwide.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png
new file mode 100644
index 000000000..ceb34eaea
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-menu.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png
new file mode 100644
index 000000000..3581e9daa
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-annotate-udhcpc.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png
new file mode 100644
index 000000000..c317b49a4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-debuginfo.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png
new file mode 100644
index 000000000..1913c867d
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom-menu.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png
new file mode 100644
index 000000000..a1962c437
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-dso-zoom.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png b/poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png
new file mode 100644
index 000000000..b642d06c8
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-busybox-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png b/poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png
new file mode 100644
index 000000000..c8f395ab5
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-flat-stripped.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
new file mode 100644
index 000000000..bb7c764ce
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
new file mode 100644
index 000000000..a799af512
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
new file mode 100644
index 000000000..e91808ae4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
new file mode 100644
index 000000000..812302d0a
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/poky-reference-distribution.png b/poky/documentation/mega-manual/figures/poky-reference-distribution.png
new file mode 100644
index 000000000..1be89ae68
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/poky-reference-distribution.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/poky-title.png b/poky/documentation/mega-manual/figures/poky-title.png
new file mode 100644
index 000000000..2893d8462
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/poky-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/profile-title.png b/poky/documentation/mega-manual/figures/profile-title.png
new file mode 100644
index 000000000..ce5c682b5
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/profile-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png b/poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png
new file mode 100644
index 000000000..2b6bfdacf
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/pybootchartgui-linux-yocto.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png
new file mode 100644
index 000000000..444675c54
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm-nostrip.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png b/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png
new file mode 100644
index 000000000..8ee35352d
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/pychart-linux-yocto-rpm.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/recipe-workflow.png b/poky/documentation/mega-manual/figures/recipe-workflow.png
new file mode 100644
index 000000000..c0e960b13
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/recipe-workflow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sched-wakeup-profile.png b/poky/documentation/mega-manual/figures/sched-wakeup-profile.png
new file mode 100644
index 000000000..2f2581188
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sched-wakeup-profile.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-autotools-flow.png b/poky/documentation/mega-manual/figures/sdk-autotools-flow.png
new file mode 100644
index 000000000..ec6685f8b
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-autotools-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png b/poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png
new file mode 100644
index 000000000..e7d6173d2
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-devtool-add-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png b/poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png
new file mode 100644
index 000000000..18ba8b7e6
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-devtool-modify-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-devtool-upgrade-flow.png b/poky/documentation/mega-manual/figures/sdk-devtool-upgrade-flow.png
new file mode 100644
index 000000000..7d4f395e2
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-devtool-upgrade-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png b/poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png
new file mode 100644
index 000000000..9f986e0d4
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-eclipse-dev-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-environment.png b/poky/documentation/mega-manual/figures/sdk-environment.png
new file mode 100644
index 000000000..78b8cad39
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-environment.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-generation.png b/poky/documentation/mega-manual/figures/sdk-generation.png
new file mode 100644
index 000000000..939f83911
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-generation.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png b/poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png
new file mode 100644
index 000000000..99e07ce6f
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-installed-extensible-sdk-directory.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png b/poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png
new file mode 100644
index 000000000..d4af85020
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-installed-standard-sdk-directory.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-makefile-flow.png b/poky/documentation/mega-manual/figures/sdk-makefile-flow.png
new file mode 100644
index 000000000..0ccb4180a
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-makefile-flow.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk-title.png b/poky/documentation/mega-manual/figures/sdk-title.png
new file mode 100644
index 000000000..e69e03935
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sdk.png b/poky/documentation/mega-manual/figures/sdk.png
new file mode 100644
index 000000000..a37687263
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sdk.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/set-variable.png b/poky/documentation/mega-manual/figures/set-variable.png
new file mode 100644
index 000000000..d36b52754
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/set-variable.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/simple-configuration.png b/poky/documentation/mega-manual/figures/simple-configuration.png
new file mode 100644
index 000000000..e8fce2bf1
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/simple-configuration.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/source-fetching.png b/poky/documentation/mega-manual/figures/source-fetching.png
new file mode 100644
index 000000000..bf5e187b2
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/source-fetching.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/source-input.png b/poky/documentation/mega-manual/figures/source-input.png
new file mode 100644
index 000000000..6b6ba4b33
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/source-input.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/source-repos.png b/poky/documentation/mega-manual/figures/source-repos.png
new file mode 100644
index 000000000..e9cff16cc
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/source-repos.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sysprof-callers.png b/poky/documentation/mega-manual/figures/sysprof-callers.png
new file mode 100644
index 000000000..640c8d914
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sysprof-callers.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sysprof-copy-from-user.png b/poky/documentation/mega-manual/figures/sysprof-copy-from-user.png
new file mode 100644
index 000000000..8d3142782
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sysprof-copy-from-user.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/sysprof-copy-to-user.png b/poky/documentation/mega-manual/figures/sysprof-copy-to-user.png
new file mode 100644
index 000000000..7a5bab799
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/sysprof-copy-to-user.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/toaster-title.png b/poky/documentation/mega-manual/figures/toaster-title.png
new file mode 100644
index 000000000..b7ea39cd8
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/toaster-title.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/user-configuration.png b/poky/documentation/mega-manual/figures/user-configuration.png
new file mode 100644
index 000000000..142454715
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/user-configuration.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/using-a-pre-built-image.png b/poky/documentation/mega-manual/figures/using-a-pre-built-image.png
new file mode 100644
index 000000000..b03130d12
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/using-a-pre-built-image.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/variable-added.png b/poky/documentation/mega-manual/figures/variable-added.png
new file mode 100644
index 000000000..518f25fa1
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/variable-added.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/yocto-project-transp.png b/poky/documentation/mega-manual/figures/yocto-project-transp.png
new file mode 100755
index 000000000..31d2b147f
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/yocto-project-transp.png
Binary files differ
diff --git a/poky/documentation/mega-manual/figures/yp-download.png b/poky/documentation/mega-manual/figures/yp-download.png
new file mode 100644
index 000000000..bfd12b678
--- /dev/null
+++ b/poky/documentation/mega-manual/figures/yp-download.png
Binary files differ
diff --git a/poky/documentation/mega-manual/mega-manual-customization.xsl b/poky/documentation/mega-manual/mega-manual-customization.xsl
new file mode 100644
index 000000000..b52b5b2aa
--- /dev/null
+++ b/poky/documentation/mega-manual/mega-manual-customization.xsl
@@ -0,0 +1,42 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:param name="generate.toc">
+ appendix toc
+ chapter toc
+ article nop
+ book nop
+ part nop
+ preface nop
+ qandadiv nop
+ qandaset nop
+ reference nop
+ section nop
+ set nop
+ </xsl:param>
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+ <xsl:include href="../template/gloss-permalinks.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'mega-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/mega-manual/mega-manual.xml b/poky/documentation/mega-manual/mega-manual.xml
new file mode 100644
index 000000000..2c0943e26
--- /dev/null
+++ b/poky/documentation/mega-manual/mega-manual.xml
@@ -0,0 +1,319 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+
+<book id='mega-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+
+ <bookinfo>
+
+ <abstract>
+ The Yocto Project Mega-Manual is a concatenation of the published
+ Yocto Project HTML manuals for the given release.
+ The manual exists to help users efficiently search for strings
+ across the entire Yocto Project documentation set.
+ </abstract>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/mega-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Mega-Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Mega-Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+
+ </legalnotice>
+
+ </bookinfo>
+
+<!-- Includes brief-yoctoprojectqs -->
+
+ <para>
+ <imagedata fileref="figures/bypqs-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../brief-yoctoprojectqs/brief-yoctoprojectqs.xml"/>
+
+<!-- Includes overview-manual title image and then overview-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/overview-manual-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../overview-manual/overview-manual-intro.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../overview-manual/overview-manual-yp-intro.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../overview-manual/overview-manual-development-environment.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../overview-manual/overview-manual-concepts.xml"/>
+
+<!-- Includes dev-manual title image and then dev-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/dev-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual-intro.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual-start.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual-common-tasks.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../dev-manual/dev-manual-qemu.xml"/>
+
+<!-- Includes sdk-manual title image and then sdk-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/sdk-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-intro.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-extensible.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-using.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-working-projects.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-eclipse-project.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-appendix-obtain.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-appendix-customizing.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-appendix-customizing-standard.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../sdk-manual/sdk-appendix-neon.xml"/>
+
+<!-- Includes bsp-guide title image and then bsp-guide chapters -->
+
+ <para>
+ <imagedata fileref="figures/bsp-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../bsp-guide/bsp.xml"/>
+
+<!-- Includes kernel-dev title image and then kernel-dev chapters -->
+
+ <para>
+ <imagedata fileref="figures/kernel-dev-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev-intro.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev-common.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev-advanced.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev-concepts-appx.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../kernel-dev/kernel-dev-maint-appx.xml"/>
+
+<!-- Includes profile-manual title image and then profile-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/profile-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../profile-manual/profile-manual-intro.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../profile-manual/profile-manual-arch.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../profile-manual/profile-manual-usage.xml"/>
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../profile-manual/profile-manual-examples.xml"/>
+
+<!-- Includes ref-manual title image and then ref-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/poky-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-system-requirements.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-terms.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-release-process.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/migration.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-structure.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-classes.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-tasks.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-devtool-reference.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-kickstart.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-qa-checks.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-images.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-features.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-variables.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/ref-varlocality.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/faq.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../ref-manual/resources.xml"/>
+
+<!-- Includes toaster-manual title image and then toaster-manual chapters -->
+
+ <para>
+ <imagedata fileref="figures/toaster-title.png" width="100%" align="left" scalefit="1" />
+ </para>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../toaster-manual/toaster-manual-intro.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../toaster-manual/toaster-manual-start.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../toaster-manual/toaster-manual-setup-and-use.xml"/>
+
+ <xi:include
+ xmlns:xi="http://www.w3.org/2003/XInclude" href="../toaster-manual/toaster-manual-reference.xml"/>
+
+</book>
+
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/mega-manual/mega-style.css b/poky/documentation/mega-manual/mega-style.css
new file mode 100644
index 000000000..cd71eb642
--- /dev/null
+++ b/poky/documentation/mega-manual/mega-style.css
@@ -0,0 +1,989 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/mega-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/overview-manual/figures/YP-flow-diagram.png b/poky/documentation/overview-manual/figures/YP-flow-diagram.png
new file mode 100644
index 000000000..826441050
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/YP-flow-diagram.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/analysis-for-package-splitting.png b/poky/documentation/overview-manual/figures/analysis-for-package-splitting.png
new file mode 100644
index 000000000..0cb038666
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/analysis-for-package-splitting.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/configuration-compile-autoreconf.png b/poky/documentation/overview-manual/figures/configuration-compile-autoreconf.png
new file mode 100644
index 000000000..043d195a3
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/configuration-compile-autoreconf.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/cross-development-toolchains.png b/poky/documentation/overview-manual/figures/cross-development-toolchains.png
new file mode 100644
index 000000000..cbe8371c0
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/cross-development-toolchains.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/git-workflow.png b/poky/documentation/overview-manual/figures/git-workflow.png
new file mode 100644
index 000000000..e401330a1
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/git-workflow.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/image-generation.png b/poky/documentation/overview-manual/figures/image-generation.png
new file mode 100644
index 000000000..aff9fc27e
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/image-generation.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/images.png b/poky/documentation/overview-manual/figures/images.png
new file mode 100644
index 000000000..20c01307d
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/images.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/index-downloads.png b/poky/documentation/overview-manual/figures/index-downloads.png
new file mode 100644
index 000000000..96303b878
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/index-downloads.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/key-dev-elements.png b/poky/documentation/overview-manual/figures/key-dev-elements.png
new file mode 100644
index 000000000..76c44050f
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/key-dev-elements.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/layer-input.png b/poky/documentation/overview-manual/figures/layer-input.png
new file mode 100644
index 000000000..29b56f9ea
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/layer-input.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/overview-manual-title.png b/poky/documentation/overview-manual/figures/overview-manual-title.png
new file mode 100644
index 000000000..41e9012c4
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/overview-manual-title.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/package-feeds.png b/poky/documentation/overview-manual/figures/package-feeds.png
new file mode 100644
index 000000000..759283937
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/package-feeds.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/patching.png b/poky/documentation/overview-manual/figures/patching.png
new file mode 100644
index 000000000..80fba7e7c
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/patching.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/poky-reference-distribution.png b/poky/documentation/overview-manual/figures/poky-reference-distribution.png
new file mode 100644
index 000000000..1be89ae68
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/poky-reference-distribution.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/sdk-generation.png b/poky/documentation/overview-manual/figures/sdk-generation.png
new file mode 100644
index 000000000..939f83911
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/sdk-generation.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/sdk.png b/poky/documentation/overview-manual/figures/sdk.png
new file mode 100644
index 000000000..a37687263
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/sdk.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/source-fetching.png b/poky/documentation/overview-manual/figures/source-fetching.png
new file mode 100644
index 000000000..bf5e187b2
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/source-fetching.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/source-input.png b/poky/documentation/overview-manual/figures/source-input.png
new file mode 100644
index 000000000..6b6ba4b33
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/source-input.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/source-repos.png b/poky/documentation/overview-manual/figures/source-repos.png
new file mode 100644
index 000000000..603300b6d
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/source-repos.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/user-configuration.png b/poky/documentation/overview-manual/figures/user-configuration.png
new file mode 100644
index 000000000..142454715
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/user-configuration.png
Binary files differ
diff --git a/poky/documentation/overview-manual/figures/yp-download.png b/poky/documentation/overview-manual/figures/yp-download.png
new file mode 100644
index 000000000..bfd12b678
--- /dev/null
+++ b/poky/documentation/overview-manual/figures/yp-download.png
Binary files differ
diff --git a/poky/documentation/overview-manual/overview-manual-concepts.xml b/poky/documentation/overview-manual/overview-manual-concepts.xml
new file mode 100644
index 000000000..338a190ae
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-concepts.xml
@@ -0,0 +1,3232 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id=' overview-manual-concepts'>
+<title>Yocto Project Concepts</title>
+
+ <para>
+ This chapter provides explanations for Yocto Project concepts that
+ go beyond the surface of "how-to" information and reference (or
+ look-up) material.
+ Concepts such as components, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ workflow, cross-development toolchains, shared state cache, and so
+ forth are explained.
+ </para>
+
+ <section id='yocto-project-components'>
+ <title>Yocto Project Components</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ task executor together with various types of configuration files
+ form the
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core</ulink>.
+ This section overviews these components by describing their use and
+ how they interact.
+ </para>
+
+ <para>
+ BitBake handles the parsing and execution of the data files.
+ The data itself is of various types:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Recipes:</emphasis>
+ Provides details about particular pieces of software.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Class Data:</emphasis>
+ Abstracts common build information (e.g. how to build a
+ Linux kernel).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Configuration Data:</emphasis>
+ Defines machine-specific settings, policy decisions, and
+ so forth.
+ Configuration data acts as the glue to bind everything
+ together.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ BitBake knows how to combine multiple data sources together and
+ refers to each data source as a layer.
+ For information on layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ Following are some brief details on these core components.
+ For additional information on how these components interact during
+ a build, see the
+ "<link linkend='openembedded-build-system-build-concepts'>OpenEmbedded Build System Concepts</link>"
+ section.
+ </para>
+
+ <section id='usingpoky-components-bitbake'>
+ <title>BitBake</title>
+
+ <para>
+ BitBake is the tool at the heart of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ and is responsible for parsing the
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>,
+ generating a list of tasks from it, and then executing those
+ tasks.
+ </para>
+
+ <para>
+ This section briefly introduces BitBake.
+ If you want more information on BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>.
+ </para>
+
+ <para>
+ To see a list of the options BitBake supports, use either of
+ the following commands:
+ <literallayout class='monospaced'>
+ $ bitbake -h
+ $ bitbake --help
+ </literallayout>
+ </para>
+
+ <para>
+ The most common usage for BitBake is
+ <filename>bitbake <replaceable>packagename</replaceable></filename>,
+ where <filename>packagename</filename> is the name of the
+ package you want to build (referred to as the "target").
+ The target often equates to the first part of a recipe's
+ filename (e.g. "foo" for a recipe named
+ <filename>foo_1.3.0-r0.bb</filename>).
+ So, to process the
+ <filename>matchbox-desktop_1.2.3.bb</filename> recipe file, you
+ might type the following:
+ <literallayout class='monospaced'>
+ $ bitbake matchbox-desktop
+ </literallayout>
+ Several different versions of
+ <filename>matchbox-desktop</filename> might exist.
+ BitBake chooses the one selected by the distribution
+ configuration.
+ You can get more details about how BitBake chooses between
+ different target versions and providers in the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bb-bitbake-preferences'>Preferences</ulink>"
+ section of the BitBake User Manual.
+ </para>
+
+ <para>
+ BitBake also tries to execute any dependent tasks first.
+ So for example, before building
+ <filename>matchbox-desktop</filename>, BitBake would build a
+ cross compiler and <filename>glibc</filename> if they had not
+ already been built.
+ </para>
+
+ <para>
+ A useful BitBake option to consider is the
+ <filename>-k</filename> or <filename>--continue</filename>
+ option.
+ This option instructs BitBake to try and continue processing
+ the job as long as possible even after encountering an error.
+ When an error occurs, the target that failed and those that
+ depend on it cannot be remade.
+ However, when you use this option other dependencies can
+ still be processed.
+ </para>
+ </section>
+
+ <section id='overview-components-recipes'>
+ <title>Recipes</title>
+
+ <para>
+ Files that have the <filename>.bb</filename> suffix are
+ "recipes" files.
+ In general, a recipe contains information about a single piece
+ of software.
+ This information includes the location from which to download
+ the unaltered source, any source patches to be applied to that
+ source (if needed), which special configuration options to
+ apply, how to compile the source files, and how to package the
+ compiled output.
+ </para>
+
+ <para>
+ The term "package" is sometimes used to refer to recipes.
+ However, since the word "package" is used for the packaged
+ output from the OpenEmbedded build system (i.e.
+ <filename>.ipk</filename> or <filename>.deb</filename> files),
+ this document avoids using the term "package" when referring
+ to recipes.
+ </para>
+ </section>
+
+ <section id='overview-components-classes'>
+ <title>Classes</title>
+
+ <para>
+ Class files (<filename>.bbclass</filename>) contain information
+ that is useful to share between recipes files.
+ An example is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ class, which contains common settings for any application that
+ Autotools uses.
+ The
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>Classes</ulink>"
+ chapter in the Yocto Project Reference Manual provides
+ details about classes and how to use them.
+ </para>
+ </section>
+
+ <section id='overview-components-configurations'>
+ <title>Configurations</title>
+
+ <para>
+ The configuration files (<filename>.conf</filename>) define
+ various configuration variables that govern the OpenEmbedded
+ build process.
+ These files fall into several areas that define machine
+ configuration options, distribution configuration options,
+ compiler tuning options, general common configuration options,
+ and user configuration options in
+ <filename>conf/local.conf</filename>, which is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ </para>
+ </section>
+ </section>
+
+ <section id='overview-layers'>
+ <title>Layers</title>
+
+ <para>
+ Layers are repositories that contain related metadata (i.e.
+ sets of instructions) that tell the OpenEmbedded build system how
+ to build a target.
+ Yocto Project's
+ <link linkend='the-yocto-project-layer-model'>layer model</link>
+ facilitates collaboration, sharing, customization, and reuse
+ within the Yocto Project development environment.
+ Layers logically separate information for your project.
+ For example, you can use a layer to hold all the configurations
+ for a particular piece of hardware.
+ Isolating hardware-specific configurations allows you to share
+ other metadata by using a different layer where that metadata
+ might be common across several pieces of hardware.
+ </para>
+
+ <para>
+ Many layers exist that work in the Yocto Project development
+ environment.
+ The
+ <ulink url='https://caffelli-staging.yoctoproject.org/software-overview/layers/'>Yocto Project Curated Layer Index</ulink>
+ and
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layers/'>OpenEmbedded Layer Index</ulink>
+ both contain layers from which you can use or leverage.
+ </para>
+
+ <para>
+ By convention, layers in the Yocto Project follow a specific form.
+ Conforming to a known structure allows BitBake to make assumptions
+ during builds on where to find types of metadata.
+ You can find procedures and learn about tools (i.e.
+ <filename>bitbake-layers</filename>) for creating layers suitable
+ for the Yocto Project in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id="openembedded-build-system-build-concepts">
+ <title>OpenEmbedded Build System Concepts</title>
+
+ <para>
+ This section takes a more detailed look inside the build
+ process used by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>,
+ which is the build system specific to the Yocto Project.
+ At the heart of the build system is BitBake, the task executor.
+ </para>
+
+ <para>
+ The following diagram represents the high-level workflow of a
+ build.
+ The remainder of this section expands on the fundamental input,
+ output, process, and metadata logical blocks that make up the
+ workflow.
+ </para>
+
+ <para id='general-workflow-figure'>
+ <imagedata fileref="figures/YP-flow-diagram.png" format="PNG" align='center' width="8in"/>
+ </para>
+
+ <para>
+ In general, the build's workflow consists of several functional
+ areas:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>User Configuration:</emphasis>
+ metadata you can use to control the build process.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Metadata Layers:</emphasis>
+ Various layers that provide software, machine, and
+ distro metadata.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Source Files:</emphasis>
+ Upstream releases, local projects, and SCMs.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build System:</emphasis>
+ Processes under the control of
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>.
+ This block expands on how BitBake fetches source, applies
+ patches, completes compilation, analyzes output for package
+ generation, creates and tests packages, generates images,
+ and generates cross-development tools.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Package Feeds:</emphasis>
+ Directories containing output packages (RPM, DEB or IPK),
+ which are subsequently used in the construction of an
+ image or Software Development Kit (SDK), produced by the
+ build system.
+ These feeds can also be copied and shared using a web
+ server or other means to facilitate extending or updating
+ existing images on devices at runtime if runtime package
+ management is enabled.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Images:</emphasis>
+ Images produced by the workflow.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Application Development SDK:</emphasis>
+ Cross-development tools that are produced along with
+ an image or separately with BitBake.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id="user-configuration">
+ <title>User Configuration</title>
+
+ <para>
+ User configuration helps define the build.
+ Through user configuration, you can tell BitBake the
+ target architecture for which you are building the image,
+ where to store downloaded source, and other build properties.
+ </para>
+
+ <para>
+ The following figure shows an expanded representation of the
+ "User Configuration" box of the
+ <link linkend='general-workflow-figure'>general workflow figure</link>:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/user-configuration.png" align="center" width="8in" depth="4.5in" />
+ </para>
+
+ <para>
+ BitBake needs some basic configuration files in order to
+ complete a build.
+ These files are <filename>*.conf</filename> files.
+ The minimally necessary ones reside as example files in the
+ <filename>build/conf</filename> directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ For simplicity, this section refers to the Source Directory as
+ the "Poky Directory."
+ </para>
+
+ <para>
+ When you clone the
+ <ulink url='&YOCTO_DOCS_REF_URL;#poky'>Poky</ulink>
+ Git repository or you download and unpack a Yocto Project
+ release, you can set up the Source Directory to be named
+ anything you want.
+ For this discussion, the cloned repository uses the default
+ name <filename>poky</filename>.
+ <note>
+ The Poky repository is primarily an aggregation of existing
+ repositories.
+ It is not a canonical upstream source.
+ </note>
+ </para>
+
+ <para>
+ The <filename>meta-poky</filename> layer inside Poky contains
+ a <filename>conf</filename> directory that has example
+ configuration files.
+ These example files are used as a basis for creating actual
+ configuration files when you source
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>,
+ which is the build environment script.
+ </para>
+
+ <para>
+ Sourcing the build environment script creates a
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ if one does not already exist.
+ BitBake uses the Build Directory for all its work during
+ builds.
+ The Build Directory has a <filename>conf</filename> directory
+ that contains default versions of your
+ <filename>local.conf</filename> and
+ <filename>bblayers.conf</filename> configuration files.
+ These default configuration files are created only if versions
+ do not already exist in the Build Directory at the time you
+ source the build environment setup script.
+ </para>
+
+ <para>
+ Because the Poky repository is fundamentally an aggregation of
+ existing repositories, some users might be familiar with
+ running the <filename>&OE_INIT_FILE;</filename> script
+ in the context of separate
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core</ulink>
+ and BitBake repositories rather than a single Poky repository.
+ This discussion assumes the script is executed from
+ within a cloned or unpacked version of Poky.
+ </para>
+
+ <para>
+ Depending on where the script is sourced, different
+ sub-scripts are called to set up the Build Directory
+ (Yocto or OpenEmbedded).
+ Specifically, the script
+ <filename>scripts/oe-setup-builddir</filename> inside the
+ poky directory sets up the Build Directory and seeds the
+ directory (if necessary) with configuration files appropriate
+ for the Yocto Project development environment.
+ <note>
+ The <filename>scripts/oe-setup-builddir</filename> script
+ uses the <filename>$TEMPLATECONF</filename> variable to
+ determine which sample configuration files to locate.
+ </note>
+ </para>
+
+ <para>
+ The <filename>local.conf</filename> file provides many
+ basic variables that define a build environment.
+ Here is a list of a few.
+ To see the default configurations in a
+ <filename>local.conf</filename> file created by the build
+ environment script, see the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-poky/conf/local.conf.sample'><filename>local.conf.sample</filename></ulink>
+ in the <filename>meta-poky</filename> layer:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Target Machine Selection:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download Directory:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Shared State Directory:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build Output:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Distribution Policy:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Packaging Format:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>SDK Target Architecture:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Extra Image Packages:</emphasis>
+ Controlled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
+ variable.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ Configurations set in the
+ <filename>conf/local.conf</filename> file can also be set
+ in the <filename>conf/site.conf</filename> and
+ <filename>conf/auto.conf</filename> configuration files.
+ </note>
+ </para>
+
+ <para>
+ The <filename>bblayers.conf</filename> file tells BitBake what
+ layers you want considered during the build.
+ By default, the layers listed in this file include layers
+ minimally needed by the build system.
+ However, you must manually add any custom layers you have
+ created.
+ You can find more information on working with the
+ <filename>bblayers.conf</filename> file in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-your-layer'>Enabling Your Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ The files <filename>site.conf</filename> and
+ <filename>auto.conf</filename> are not created by the
+ environment initialization script.
+ If you want the <filename>site.conf</filename> file, you
+ need to create that yourself.
+ The <filename>auto.conf</filename> file is typically created by
+ an autobuilder:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>site.conf</filename>:</emphasis>
+ You can use the <filename>conf/site.conf</filename>
+ configuration file to configure multiple
+ build directories.
+ For example, suppose you had several build environments
+ and they shared some common features.
+ You can set these default build properties here.
+ A good example is perhaps the packaging format to use
+ through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ variable.</para>
+
+ <para>One useful scenario for using the
+ <filename>conf/site.conf</filename> file is to extend
+ your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BBPATH'><filename>BBPATH</filename></ulink>
+ variable to include the path to a
+ <filename>conf/site.conf</filename>.
+ Then, when BitBake looks for Metadata using
+ <filename>BBPATH</filename>, it finds the
+ <filename>conf/site.conf</filename> file and applies
+ your common configurations found in the file.
+ To override configurations in a particular build
+ directory, alter the similar configurations within
+ that build directory's
+ <filename>conf/local.conf</filename> file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>auto.conf</filename>:</emphasis>
+ The file is usually created and written to by
+ an autobuilder.
+ The settings put into the file are typically the
+ same as you would find in the
+ <filename>conf/local.conf</filename> or the
+ <filename>conf/site.conf</filename> files.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can edit all configuration files to further define
+ any particular build environment.
+ This process is represented by the "User Configuration Edits"
+ box in the figure.
+ </para>
+
+ <para>
+ When you launch your build with the
+ <filename>bitbake <replaceable>target</replaceable></filename>
+ command, BitBake sorts out the configurations to ultimately
+ define your build environment.
+ It is important to understand that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ reads the configuration files in a specific order:
+ <filename>site.conf</filename>, <filename>auto.conf</filename>,
+ and <filename>local.conf</filename>.
+ And, the build system applies the normal assignment statement
+ rules as described in the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual-metadata'>Syntax and Operators</ulink>"
+ chapter of the BitBake User Manual.
+ Because the files are parsed in a specific order, variable
+ assignments for the same variable could be affected.
+ For example, if the <filename>auto.conf</filename> file and
+ the <filename>local.conf</filename> set
+ <replaceable>variable1</replaceable> to different values,
+ because the build system parses <filename>local.conf</filename>
+ after <filename>auto.conf</filename>,
+ <replaceable>variable1</replaceable> is assigned the value from
+ the <filename>local.conf</filename> file.
+ </para>
+ </section>
+
+ <section id="metadata-machine-configuration-and-policy-configuration">
+ <title>Metadata, Machine Configuration, and Policy Configuration</title>
+
+ <para>
+ The previous section described the user configurations that
+ define BitBake's global behavior.
+ This section takes a closer look at the layers the build system
+ uses to further control the build.
+ These layers provide Metadata for the software, machine, and
+ policies.
+ </para>
+
+ <para>
+ In general, three types of layer input exists.
+ You can see them below the "User Configuration" box in the
+ <link linkend='general-workflow-figure'>general workflow figure</link>:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Metadata (<filename>.bb</filename> + Patches):</emphasis>
+ Software layers containing user-supplied recipe files,
+ patches, and append files.
+ A good example of a software layer might be the
+ <ulink url='https://github.com/meta-qt5/meta-qt5'><filename>meta-qt5</filename></ulink>
+ layer from the
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layers/'>OpenEmbedded Layer Index</ulink>.
+ This layer is for version 5.0 of the popular
+ <ulink url='https://wiki.qt.io/About_Qt'>Qt</ulink>
+ cross-platform application development framework for
+ desktop, embedded and mobile.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Machine BSP Configuration:</emphasis>
+ Board Support Package (BSP) layers (i.e. "BSP Layer"
+ in the following figure) providing machine-specific
+ configurations.
+ This type of information is specific to a particular
+ target architecture.
+ A good example of a BSP layer from the
+ <link linkend='gs-reference-distribution-poky'>Poky Reference Distribution</link>
+ is the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-yocto-bsp'><filename>meta-yocto-bsp</filename></ulink>
+ layer.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Policy Configuration:</emphasis>
+ Distribution Layers (i.e. "Distro Layer" in the
+ following figure) providing top-level or general
+ policies for the images or SDKs being built for a
+ particular distribution.
+ For example, in the Poky Reference Distribution the
+ distro layer is the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-poky'><filename>meta-poky</filename></ulink>
+ layer.
+ Within the distro layer is a
+ <filename>conf/distro</filename> directory that
+ contains distro configuration files (e.g.
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-poky/conf/distro/poky.conf'><filename>poky.conf</filename></ulink>
+ that contain many policy configurations for the
+ Poky distribution.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The following figure shows an expanded representation of
+ these three layers from the
+ <link linkend='general-workflow-figure'>general workflow figure</link>:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/layer-input.png" align="center" width="8in" depth="8in" />
+ </para>
+
+ <para>
+ In general, all layers have a similar structure.
+ They all contain a licensing file
+ (e.g. <filename>COPYING.MIT</filename>) if the layer is to be
+ distributed, a <filename>README</filename> file as good
+ practice and especially if the layer is to be distributed, a
+ configuration directory, and recipe directories.
+ You can learn about the general structure for layers used with
+ the Yocto Project in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-your-own-layer'>Creating Your Own Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For a general discussion on layers and the many layers from
+ which you can draw, see the
+ "<link linkend='overview-layers'>Layers</link>" and
+ "<link linkend='the-yocto-project-layer-model'>The Yocto Project Layer Model</link>"
+ sections both earlier in this manual.
+ </para>
+
+ <para>
+ If you explored the previous links, you discovered some
+ areas where many layers that work with the Yocto Project
+ exist.
+ The
+ <ulink url="http://git.yoctoproject.org/">Source Repositories</ulink>
+ also shows layers categorized under "Yocto Metadata Layers."
+ <note>
+ Layers exist in the Yocto Project Source Repositories that
+ cannot be found in the OpenEmbedded Layer Index.
+ These layers are either deprecated or experimental
+ in nature.
+ </note>
+ </para>
+
+ <para>
+ BitBake uses the <filename>conf/bblayers.conf</filename> file,
+ which is part of the user configuration, to find what layers it
+ should be using as part of the build.
+ </para>
+
+ <section id="distro-layer">
+ <title>Distro Layer</title>
+
+ <para>
+ The distribution layer provides policy configurations for
+ your distribution.
+ Best practices dictate that you isolate these types of
+ configurations into their own layer.
+ Settings you provide in
+ <filename>conf/distro/<replaceable>distro</replaceable>.conf</filename> override
+ similar settings that BitBake finds in your
+ <filename>conf/local.conf</filename> file in the Build
+ Directory.
+ </para>
+
+ <para>
+ The following list provides some explanation and references
+ for what you typically find in the distribution layer:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>classes:</emphasis>
+ Class files (<filename>.bbclass</filename>) hold
+ common functionality that can be shared among
+ recipes in the distribution.
+ When your recipes inherit a class, they take on the
+ settings and functions for that class.
+ You can read more about class files in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes'>Classes</ulink>"
+ chapter of the Yocto Reference Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>conf:</emphasis>
+ This area holds configuration files for the
+ layer (<filename>conf/layer.conf</filename>),
+ the distribution
+ (<filename>conf/distro/<replaceable>distro</replaceable>.conf</filename>),
+ and any distribution-wide include files.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>recipes-*:</emphasis>
+ Recipes and append files that affect common
+ functionality across the distribution.
+ This area could include recipes and append files
+ to add distribution-specific configuration,
+ initialization scripts, custom image recipes,
+ and so forth.
+ Examples of <filename>recipes-*</filename>
+ directories are <filename>recipes-core</filename>
+ and <filename>recipes-extra</filename>.
+ Hierarchy and contents within a
+ <filename>recipes-*</filename> directory can vary.
+ Generally, these directories contain recipe files
+ (<filename>*.bb</filename>), recipe append files
+ (<filename>*.bbappend</filename>), directories
+ that are distro-specific for configuration files,
+ and so forth.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="bsp-layer">
+ <title>BSP Layer</title>
+
+ <para>
+ The BSP Layer provides machine configurations that
+ target specific hardware.
+ Everything in this layer is specific to the machine for
+ which you are building the image or the SDK.
+ A common structure or form is defined for BSP layers.
+ You can learn more about this structure in the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ <note>
+ In order for a BSP layer to be considered compliant
+ with the Yocto Project, it must meet some structural
+ requirements.
+ </note>
+ </para>
+
+ <para>
+ The BSP Layer's configuration directory contains
+ configuration files for the machine
+ (<filename>conf/machine/<replaceable>machine</replaceable>.conf</filename>)
+ and, of course, the layer
+ (<filename>conf/layer.conf</filename>).
+ </para>
+
+ <para>
+ The remainder of the layer is dedicated to specific recipes
+ by function: <filename>recipes-bsp</filename>,
+ <filename>recipes-core</filename>,
+ <filename>recipes-graphics</filename>,
+ <filename>recipes-kernel</filename>, and so forth.
+ Metadata can exist for multiple formfactors, graphics
+ support systems, and so forth.
+ <note>
+ While the figure shows several
+ <filename>recipes-*</filename> directories, not all
+ these directories appear in all BSP layers.
+ </note>
+ </para>
+ </section>
+
+ <section id="software-layer">
+ <title>Software Layer</title>
+
+ <para>
+ The software layer provides the Metadata for additional
+ software packages used during the build.
+ This layer does not include Metadata that is specific to
+ the distribution or the machine, which are found in their
+ respective layers.
+ </para>
+
+ <para>
+ This layer contains any recipes, append files, and
+ patches, that your project needs.
+ </para>
+ </section>
+ </section>
+
+ <section id="sources-dev-environment">
+ <title>Sources</title>
+
+ <para>
+ In order for the OpenEmbedded build system to create an
+ image or any target, it must be able to access source files.
+ The
+ <link linkend='general-workflow-figure'>general workflow figure</link>
+ represents source files using the "Upstream Project Releases",
+ "Local Projects", and "SCMs (optional)" boxes.
+ The figure represents mirrors, which also play a role in
+ locating source files, with the "Source Materials" box.
+ </para>
+
+ <para>
+ The method by which source files are ultimately organized is
+ a function of the project.
+ For example, for released software, projects tend to use
+ tarballs or other archived files that can capture the
+ state of a release guaranteeing that it is statically
+ represented.
+ On the other hand, for a project that is more dynamic or
+ experimental in nature, a project might keep source files in a
+ repository controlled by a Source Control Manager (SCM) such as
+ Git.
+ Pulling source from a repository allows you to control
+ the point in the repository (the revision) from which you
+ want to build software.
+ Finally, a combination of the two might exist, which would
+ give the consumer a choice when deciding where to get
+ source files.
+ </para>
+
+ <para>
+ BitBake uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable to point to source files regardless of their location.
+ Each recipe must have a <filename>SRC_URI</filename> variable
+ that points to the source.
+ </para>
+
+ <para>
+ Another area that plays a significant role in where source
+ files come from is pointed to by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ variable.
+ This area is a cache that can hold previously downloaded
+ source.
+ You can also instruct the OpenEmbedded build system to create
+ tarballs from Git repositories, which is not the default
+ behavior, and store them in the <filename>DL_DIR</filename>
+ by using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink>
+ variable.
+ </para>
+
+ <para>
+ Judicious use of a <filename>DL_DIR</filename> directory can
+ save the build system a trip across the Internet when looking
+ for files.
+ A good method for using a download directory is to have
+ <filename>DL_DIR</filename> point to an area outside of your
+ Build Directory.
+ Doing so allows you to safely delete the Build Directory
+ if needed without fear of removing any downloaded source file.
+ </para>
+
+ <para>
+ The remainder of this section provides a deeper look into the
+ source files and the mirrors.
+ Here is a more detailed look at the source file area of the
+ <link linkend='general-workflow-figure'>general workflow figure</link>:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/source-input.png" width="6in" depth="6in" align="center" />
+ </para>
+
+ <section id='upstream-project-releases'>
+ <title>Upstream Project Releases</title>
+
+ <para>
+ Upstream project releases exist anywhere in the form of an
+ archived file (e.g. tarball or zip file).
+ These files correspond to individual recipes.
+ For example, the figure uses specific releases each for
+ BusyBox, Qt, and Dbus.
+ An archive file can be for any released product that can be
+ built using a recipe.
+ </para>
+ </section>
+
+ <section id='local-projects'>
+ <title>Local Projects</title>
+
+ <para>
+ Local projects are custom bits of software the user
+ provides.
+ These bits reside somewhere local to a project - perhaps
+ a directory into which the user checks in items (e.g.
+ a local directory containing a development source tree
+ used by the group).
+ </para>
+
+ <para>
+ The canonical method through which to include a local
+ project is to use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-externalsrc'><filename>externalsrc</filename></ulink>
+ class to include that local project.
+ You use either the <filename>local.conf</filename> or a
+ recipe's append file to override or set the
+ recipe to point to the local directory on your disk to pull
+ in the whole source tree.
+ </para>
+ </section>
+
+ <section id='scms'>
+ <title>Source Control Managers (Optional)</title>
+
+ <para>
+ Another place the build system can get source files from is
+ through an SCM such as Git or Subversion.
+ In this case, a repository is cloned or checked out.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
+ task inside BitBake uses
+ the <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ variable and the argument's prefix to determine the correct
+ fetcher module.
+ <note>
+ For information on how to have the OpenEmbedded build
+ system generate tarballs for Git repositories and place
+ them in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ directory, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></ulink>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ When fetching a repository, BitBake uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRCREV'><filename>SRCREV</filename></ulink>
+ variable to determine the specific revision from which to
+ build.
+ </para>
+ </section>
+
+ <section id='source-mirrors'>
+ <title>Source Mirror(s)</title>
+
+ <para>
+ Two kinds of mirrors exist: pre-mirrors and regular
+ mirrors.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREMIRRORS'><filename>PREMIRRORS</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MIRRORS'><filename>MIRRORS</filename></ulink>
+ variables point to these, respectively.
+ BitBake checks pre-mirrors before looking upstream for any
+ source files.
+ Pre-mirrors are appropriate when you have a shared
+ directory that is not a directory defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DL_DIR'><filename>DL_DIR</filename></ulink>
+ variable.
+ A Pre-mirror typically points to a shared directory that is
+ local to your organization.
+ </para>
+
+ <para>
+ Regular mirrors can be any site across the Internet
+ that is used as an alternative location for source
+ code should the primary site not be functioning for
+ some reason or another.
+ </para>
+ </section>
+ </section>
+
+ <section id="package-feeds-dev-environment">
+ <title>Package Feeds</title>
+
+ <para>
+ When the OpenEmbedded build system generates an image or an
+ SDK, it gets the packages from a package feed area located
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ The
+ <link linkend='general-workflow-figure'>general workflow figure</link>
+ shows this package feeds area in the upper-right corner.
+ </para>
+
+ <para>
+ This section looks a little closer into the package feeds
+ area used by the build system.
+ Here is a more detailed look at the area:
+ <imagedata fileref="figures/package-feeds.png" align="center" width="7in" depth="6in" />
+ </para>
+
+ <para>
+ Package feeds are an intermediary step in the build process.
+ The OpenEmbedded build system provides classes to generate
+ different package types, and you specify which classes to
+ enable through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>
+ variable.
+ Before placing the packages into package feeds,
+ the build process validates them with generated output quality
+ assurance checks through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-insane'><filename>insane</filename></ulink>
+ class.
+ </para>
+
+ <para>
+ The package feed area resides in the Build Directory.
+ The directory the build system uses to temporarily store
+ packages is determined by a combination of variables and the
+ particular package manager in use.
+ See the "Package Feeds" box in the illustration and note the
+ information to the right of that area.
+ In particular, the following defines where package files are
+ kept:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></ulink>:
+ Defined as <filename>tmp/deploy</filename> in the Build
+ Directory.
+ </para></listitem>
+ <listitem><para>
+ <filename>DEPLOY_DIR_*</filename>:
+ Depending on the package manager used, the package type
+ sub-folder.
+ Given RPM, IPK, or DEB packaging and tarball creation,
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></ulink>,
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></ulink>,
+ variables are used, respectively.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>:
+ Defines architecture-specific sub-folders.
+ For example, packages could exist for the i586 or
+ qemux86 architectures.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ BitBake uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_deb'><filename>do_package_write_*</filename></ulink>
+ tasks to generate packages and place them into the package
+ holding area (e.g. <filename>do_package_write_ipk</filename>
+ for IPK packages).
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_deb'><filename>do_package_write_deb</filename></ulink>",
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></ulink>",
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_rpm'><filename>do_package_write_rpm</filename></ulink>",
+ and
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_tar'><filename>do_package_write_tar</filename></ulink>"
+ sections in the Yocto Project Reference Manual
+ for additional information.
+ As an example, consider a scenario where an IPK packaging
+ manager is being used and package architecture support for
+ both i586 and qemux86 exist.
+ Packages for the i586 architecture are placed in
+ <filename>build/tmp/deploy/ipk/i586</filename>, while packages
+ for the qemux86 architecture are placed in
+ <filename>build/tmp/deploy/ipk/qemux86</filename>.
+ </para>
+ </section>
+
+ <section id='bitbake-dev-environment'>
+ <title>BitBake</title>
+
+ <para>
+ The OpenEmbedded build system uses
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ to produce images and Software Development Kits (SDKs).
+ You can see from the
+ <link linkend='general-workflow-figure'>general workflow figure</link>,
+ the BitBake area consists of several functional areas.
+ This section takes a closer look at each of those areas.
+ <note>
+ Separate documentation exists for the BitBake tool.
+ See the
+ <ulink url='&YOCTO_DOCS_BB_URL;#bitbake-user-manual'>BitBake User Manual</ulink>
+ for reference material on BitBake.
+ </note>
+ </para>
+
+ <section id='source-fetching-dev-environment'>
+ <title>Source Fetching</title>
+
+ <para>
+ The first stages of building a recipe are to fetch and
+ unpack the source code:
+ <imagedata fileref="figures/source-fetching.png" align="center" width="6.5in" depth="5in" />
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>
+ tasks fetch the source files and unpack them into the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ <note>
+ For every local file (e.g. <filename>file://</filename>)
+ that is part of a recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statement, the OpenEmbedded build system takes a
+ checksum of the file for the recipe and inserts the
+ checksum into the signature for the
+ <filename>do_fetch</filename> task.
+ If any local file has been modified, the
+ <filename>do_fetch</filename> task and all tasks that
+ depend on it are re-executed.
+ </note>
+ By default, everything is accomplished in the Build
+ Directory, which has a defined structure.
+ For additional general information on the Build Directory,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#structure-core-build'><filename>build/</filename></ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ Each recipe has an area in the Build Directory where the
+ unpacked source code resides.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ variable points to this area for a recipe's unpacked source
+ code.
+ The name of that directory for any given recipe is defined
+ from several different variables.
+ The preceding figure and the following list describe
+ the Build Directory's hierarchy:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>:
+ The base directory where the OpenEmbedded build
+ system performs all its work during the build.
+ The default base directory is the
+ <filename>tmp</filename> directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></ulink>:
+ The architecture of the built package or packages.
+ Depending on the eventual destination of the
+ package or packages (i.e. machine architecture,
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>,
+ SDK, or specific machine),
+ <filename>PACKAGE_ARCH</filename> varies.
+ See the variable's description for details.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TARGET_OS'><filename>TARGET_OS</filename></ulink>:
+ The operating system of the target device.
+ A typical value would be "linux" (e.g.
+ "qemux86-poky-linux").
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink>:
+ The name of the recipe used to build the package.
+ This variable can have multiple meanings.
+ However, when used in the context of input files,
+ <filename>PN</filename> represents the the name
+ of the recipe.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>:
+ The location where the OpenEmbedded build system
+ builds a recipe (i.e. does the work to create the
+ package).
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The version of the recipe used to build the
+ package.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>:
+ The revision of the recipe used to build the
+ package.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>:
+ Contains the unpacked source files for a given
+ recipe.
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BPN'><filename>BPN</filename></ulink>:
+ The name of the recipe used to build the
+ package.
+ The <filename>BPN</filename> variable is
+ a version of the <filename>PN</filename>
+ variable but with common prefixes and
+ suffixes removed.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>:
+ The version of the recipe used to build the
+ package.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ In the previous figure, notice that two sample
+ hierarchies exist: one based on package architecture (i.e.
+ <filename>PACKAGE_ARCH</filename>) and one based on a
+ machine (i.e. <filename>MACHINE</filename>).
+ The underlying structures are identical.
+ The differentiator being what the OpenEmbedded build
+ system is using as a build target (e.g. general
+ architecture, a build host, an SDK, or a specific
+ machine).
+ </note>
+ </para>
+ </section>
+
+ <section id='patching-dev-environment'>
+ <title>Patching</title>
+
+ <para>
+ Once source code is fetched and unpacked, BitBake locates
+ patch files and applies them to the source files:
+ <imagedata fileref="figures/patching.png" align="center" width="7in" depth="6in" />
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ task uses a recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable to locate applicable patch files.
+ </para>
+
+ <para>
+ Default processing for patch files assumes the files have
+ either <filename>*.patch</filename> or
+ <filename>*.diff</filename> file types.
+ You can use <filename>SRC_URI</filename> parameters to
+ change the way the build system recognizes patch files.
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ task for more information.
+ </para>
+
+ <para>
+ BitBake finds and applies multiple patches for a single
+ recipe in the order in which it locates the patches.
+ The <filename>FILESPATH</filename> variable defines the
+ default set of directories that the build system uses to
+ search for patch files.
+ Once found, patches are applied to the recipe's source
+ files, which are located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ directory.
+ </para>
+
+ <para>
+ For more information on how the source directories are
+ created, see the
+ "<link linkend='source-fetching-dev-environment'>Source Fetching</link>"
+ section.
+ For more information on how to create patches and how the
+ build system processes patches, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ You can also see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component'>Use <filename>devtool modify</filename> to Modify the Source of an Existing Component</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (SDK) manual and
+ the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-traditional-kernel-development-to-patch-the-kernel'>Using Traditional Kernel Development to Patch the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para>
+ </section>
+
+ <section id='configuration-compilation-and-staging-dev-environment'>
+ <title>Configuration, Compilation, and Staging</title>
+
+ <para>
+ After source code is patched, BitBake executes tasks that
+ configure and compile the source code.
+ Once compilation occurs, the files are copied to a holding
+ area (staged) in preparation for packaging:
+ <imagedata fileref="figures/configuration-compile-autoreconf.png" align="center" width="7in" depth="5in" />
+ </para>
+
+ <para>
+ This step in the build process consists of the following
+ tasks:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></ulink></emphasis>:
+ This task sets up the two sysroots in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}</filename>
+ (i.e. <filename>recipe-sysroot</filename> and
+ <filename>recipe-sysroot-native</filename>) so that
+ during the packaging phase the sysroots can contain
+ the contents of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+ tasks of the recipes on which the recipe
+ containing the tasks depends.
+ A sysroot exists for both the target and for the
+ native binaries, which run on the host system.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_configure</filename></emphasis>:
+ This task configures the source by enabling and
+ disabling any build-time and configuration options
+ for the software being built.
+ Configurations can come from the recipe itself as
+ well as from an inherited class.
+ Additionally, the software itself might configure
+ itself depending on the target for which it is
+ being built.</para>
+
+ <para>The configurations handled by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-configure'><filename>do_configure</filename></ulink>
+ task are specific to configurations for the source
+ code being built by the recipe.</para>
+
+ <para>If you are using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ class, you can add additional configuration options
+ by using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ variables.
+ For information on how this variable works within
+ that class, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
+ class
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/autotools.bbclass'>here</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_compile</filename></emphasis>:
+ Once a configuration task has been satisfied,
+ BitBake compiles the source using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-compile'><filename>do_compile</filename></ulink>
+ task.
+ Compilation occurs in the directory pointed to by
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-B'><filename>B</filename></ulink>
+ variable.
+ Realize that the <filename>B</filename> directory
+ is, by default, the same as the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-S'><filename>S</filename></ulink>
+ directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>do_install</filename></emphasis>:
+ After compilation completes, BitBake executes the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task.
+ This task copies files from the
+ <filename>B</filename> directory and places them
+ in a holding area pointed to by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink>
+ variable.
+ Packaging occurs later using files from this
+ holding directory.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='package-splitting-dev-environment'>
+ <title>Package Splitting</title>
+
+ <para>
+ After source code is configured, compiled, and staged, the
+ build system analyzes the results and splits the output
+ into packages:
+ <imagedata fileref="figures/analysis-for-package-splitting.png" align="center" width="7in" depth="7in" />
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-packagedata'><filename>do_packagedata</filename></ulink>
+ tasks combine to analyze the files found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink>
+ directory and split them into subsets based on available
+ packages and files.
+ Analysis involves the following as well as other items:
+ splitting out debugging symbols, looking at shared library
+ dependencies between packages, and looking at package
+ relationships.
+ </para>
+
+ <para>
+ The <filename>do_packagedata</filename> task creates
+ package metadata based on the analysis such that the
+ build system can generate the final packages.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>
+ task stages (copies) a subset of the files installed by
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task into the appropriate sysroot.
+ Working, staged, and intermediate results of the analysis
+ and package splitting process use several areas:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGD'><filename>PKGD</filename></ulink>:
+ The destination directory
+ (i.e. <filename>package</filename>) for packages
+ before they are split into individual packages.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDESTWORK'><filename>PKGDESTWORK</filename></ulink>:
+ A temporary work area (i.e.
+ <filename>pkgdata</filename>) used by the
+ <filename>do_package</filename> task to save
+ package metadata.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDEST'><filename>PKGDEST</filename></ulink>:
+ The parent directory (i.e.
+ <filename>packages-split</filename>) for packages
+ after they have been split.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></ulink>:
+ A shared, global-state directory that holds
+ packaging metadata generated during the packaging
+ process.
+ The packaging process copies metadata from
+ <filename>PKGDESTWORK</filename> to the
+ <filename>PKGDATA_DIR</filename> area where it
+ becomes globally available.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></ulink>:
+ The path for the sysroot for the system on which
+ a component is built to run (i.e.
+ <filename>recipe-sysroot</filename>).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DIR_NATIVE'><filename>STAGING_DIR_NATIVE</filename></ulink>:
+ The path for the sysroot used when building
+ components for the build host (i.e.
+ <filename>recipe-sysroot-native</filename>).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></ulink>:
+ The path for the sysroot used when a component that
+ is built to execute on a system and it generates
+ code for yet another machine (e.g. cross-canadian
+ recipes).
+ </para></listitem>
+ </itemizedlist>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
+ variable defines the files that go into each package in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>.
+ If you want details on how this is accomplished, you can
+ look at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/package.bbclass'><filename>package.bbclass</filename></ulink>.
+ </para>
+
+ <para>
+ Depending on the type of packages being created (RPM, DEB,
+ or IPK), the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_deb'><filename>do_package_write_*</filename></ulink>
+ task creates the actual packages and places them in the
+ Package Feed area, which is
+ <filename>${TMPDIR}/deploy</filename>.
+ You can see the
+ "<link linkend='package-feeds-dev-environment'>Package Feeds</link>"
+ section for more detail on that part of the build process.
+ <note>
+ Support for creating feeds directly from the
+ <filename>deploy/*</filename> directories does not
+ exist.
+ Creating such feeds usually requires some kind of feed
+ maintenance mechanism that would upload the new
+ packages into an official package feed (e.g. the
+ Ångström distribution).
+ This functionality is highly distribution-specific
+ and thus is not provided out of the box.
+ </note>
+ </para>
+ </section>
+
+ <section id='image-generation-dev-environment'>
+ <title>Image Generation</title>
+
+ <para>
+ Once packages are split and stored in the Package Feeds
+ area, the build system uses BitBake to generate the root
+ filesystem image:
+ <imagedata fileref="figures/image-generation.png" align="center" width="7.5in" depth="7.5in" />
+ </para>
+
+ <para>
+ The image generation process consists of several stages and
+ depends on several tasks and variables.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-rootfs'><filename>do_rootfs</filename></ulink>
+ task creates the root filesystem (file and directory
+ structure) for an image.
+ This task uses several key variables to help create the
+ list of packages to actually install:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></ulink>:
+ Lists out the base set of packages from which to
+ install from the Package Feeds area.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></ulink>:
+ Specifies packages that should not be installed
+ into the image.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>:
+ Specifies features to include in the image.
+ Most of these features map to additional packages
+ for installation.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></ulink>:
+ Specifies the package backend (e.g. RPM, DEB, or
+ IPK) to use and consequently helps determine where
+ to locate packages within the Package Feeds area.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_LINGUAS'><filename>IMAGE_LINGUAS</filename></ulink>:
+ Determines the language(s) for which additional
+ language support packages are installed.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></ulink>:
+ The final list of packages passed to the package
+ manager for installation into the image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ With
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></ulink>
+ pointing to the location of the filesystem under
+ construction and the <filename>PACKAGE_INSTALL</filename>
+ variable providing the final list of packages to install,
+ the root file system is created.
+ </para>
+
+ <para>
+ Package installation is under control of the package
+ manager (e.g. dnf/rpm, opkg, or apt/dpkg) regardless of
+ whether or not package management is enabled for the
+ target.
+ At the end of the process, if package management is not
+ enabled for the target, the package manager's data files
+ are deleted from the root filesystem.
+ As part of the final stage of package installation,
+ post installation scripts that are part of the packages
+ are run.
+ Any scripts that fail to run on the build host are run on
+ the target when the target system is first booted.
+ If you are using a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>read-only root filesystem</ulink>,
+ all the post installation scripts must succeed on the
+ build host during the package installation phase since the
+ root filesystem on the target is read-only.
+ </para>
+
+ <para>
+ The final stages of the <filename>do_rootfs</filename> task
+ handle post processing.
+ Post processing includes creation of a manifest file and
+ optimizations.
+ </para>
+
+ <para>
+ The manifest file (<filename>.manifest</filename>) resides
+ in the same directory as the root filesystem image.
+ This file lists out, line-by-line, the installed packages.
+ The manifest file is useful for the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-testimage*'><filename>testimage</filename></ulink>
+ class, for example, to determine whether or not to run
+ specific tests.
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_MANIFEST'><filename>IMAGE_MANIFEST</filename></ulink>
+ variable for additional information.
+ </para>
+
+ <para>
+ Optimizing processes that are run across the image include
+ <filename>mklibs</filename>, <filename>prelink</filename>,
+ and any other post-processing commands as defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></ulink>
+ variable.
+ The <filename>mklibs</filename> process optimizes the size
+ of the libraries, while the <filename>prelink</filename>
+ process optimizes the dynamic linking of shared libraries
+ to reduce start up time of executables.
+ </para>
+
+ <para>
+ After the root filesystem is built, processing begins on
+ the image through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-image'><filename>do_image</filename></ulink>
+ task.
+ The build system runs any pre-processing commands as
+ defined by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_PREPROCESS_COMMAND'><filename>IMAGE_PREPROCESS_COMMAND</filename></ulink>
+ variable.
+ This variable specifies a list of functions to call before
+ the build system creates the final image output files.
+ </para>
+
+ <para>
+ The build system dynamically creates
+ <filename>do_image_*</filename> tasks as needed, based
+ on the image types specified in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>
+ variable.
+ The process turns everything into an image file or a set of
+ image files and can compress the root filesystem image to
+ reduce the overall size of the image.
+ The formats used for the root filesystem depend on the
+ <filename>IMAGE_FSTYPES</filename> variable.
+ Compression depends on whether the formats support
+ compression.
+ </para>
+
+ <para>
+ As an example, a dynamically created task when creating a
+ particular image <replaceable>type</replaceable> would
+ take the following form:
+ <literallayout class='monospaced'>
+ do_image_<replaceable>type</replaceable>
+ </literallayout>
+ So, if the <replaceable>type</replaceable> as specified by
+ the <filename>IMAGE_FSTYPES</filename> were
+ <filename>ext4</filename>, the dynamically generated task
+ would be as follows:
+ <literallayout class='monospaced'>
+ do_image_ext4
+ </literallayout>
+ </para>
+
+ <para>
+ The final task involved in image creation is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-image-complete'><filename>do_image_complete</filename></ulink>
+ task.
+ This task completes the image by applying any image
+ post processing as defined through the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_POSTPROCESS_COMMAND'><filename>IMAGE_POSTPROCESS_COMMAND</filename></ulink>
+ variable.
+ The variable specifies a list of functions to call once the
+ build system has created the final image output files.
+ <note>
+ The entire image generation process is run under
+ <link linkend='fakeroot-and-pseudo'>Pseudo</link>.
+ Running under Pseudo ensures that the files in the
+ root filesystem have correct ownership.
+ </note>
+ </para>
+ </section>
+
+ <section id='sdk-generation-dev-environment'>
+ <title>SDK Generation</title>
+
+ <para>
+ The OpenEmbedded build system uses BitBake to generate the
+ Software Development Kit (SDK) installer scripts for both
+ the standard SDK and the extensible SDK (eSDK):
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-generation.png" width="9in" align="center" />
+ <note>
+ For more information on the cross-development toolchain
+ generation, see the
+ "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
+ section.
+ For information on advantages gained when building a
+ cross-development toolchain using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></ulink>
+ task, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
+ section in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK)
+ manual.
+ </note>
+ </para>
+
+ <para>
+ Like image generation, the SDK script process consists of
+ several stages and depends on many variables.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sdk_ext'><filename>do_populate_sdk_ext</filename></ulink>
+ tasks use these key variables to help create the list of
+ packages to actually install.
+ For information on the variables listed in the figure,
+ see the
+ "<link linkend='sdk-dev-environment'>Application Development SDK</link>"
+ section.
+ </para>
+
+ <para>
+ The <filename>do_populate_sdk</filename> task helps create
+ the standard SDK and handles two parts: a target part and a
+ host part.
+ The target part is the part built for the target hardware
+ and includes libraries and headers.
+ The host part is the part of the SDK that runs on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>.
+ </para>
+
+ <para>
+ The <filename>do_populate_sdk_ext</filename> task helps
+ create the extensible SDK and handles host and target parts
+ differently than its counter part does for the standard SDK.
+ For the extensible SDK, the task encapsulates the build
+ system, which includes everything needed (host and target)
+ for the SDK.
+ </para>
+
+ <para>
+ Regardless of the type of SDK being constructed, the
+ tasks perform some cleanup after which a cross-development
+ environment setup script and any needed configuration files
+ are created.
+ The final output is the Cross-development
+ toolchain installation script (<filename>.sh</filename>
+ file), which includes the environment setup script.
+ </para>
+ </section>
+
+ <section id='stamp-files-and-the-rerunning-of-tasks'>
+ <title>Stamp Files and the Rerunning of Tasks</title>
+
+ <para>
+ For each task that completes successfully, BitBake writes a
+ stamp file into the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAMPS_DIR'><filename>STAMPS_DIR</filename></ulink>
+ directory.
+ The beginning of the stamp file's filename is determined
+ by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-STAMP'><filename>STAMP</filename></ulink>
+ variable, and the end of the name consists of the task's
+ name and current
+ <link linkend='overview-checksums'>input checksum</link>.
+ <note>
+ This naming scheme assumes that
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SIGNATURE_HANDLER'><filename>BB_SIGNATURE_HANDLER</filename></ulink>
+ is "OEBasicHash", which is almost always the case in
+ current OpenEmbedded.
+ </note>
+ To determine if a task needs to be rerun, BitBake checks
+ if a stamp file with a matching input checksum exists
+ for the task.
+ If such a stamp file exists, the task's output is
+ assumed to exist and still be valid.
+ If the file does not exist, the task is rerun.
+ <note>
+ <para>The stamp mechanism is more general than the
+ shared state (sstate) cache mechanism described in the
+ "<link linkend='setscene-tasks-and-shared-state'>Setscene Tasks and Shared State</link>"
+ section.
+ BitBake avoids rerunning any task that has a valid
+ stamp file, not just tasks that can be accelerated
+ through the sstate cache.</para>
+
+ <para>However, you should realize that stamp files only
+ serve as a marker that some work has been done and that
+ these files do not record task output.
+ The actual task output would usually be somewhere in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>
+ (e.g. in some recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>.)
+ What the sstate cache mechanism adds is a way to cache
+ task output that can then be shared between build
+ machines.</para>
+ </note>
+ Since <filename>STAMPS_DIR</filename> is usually a
+ subdirectory of <filename>TMPDIR</filename>, removing
+ <filename>TMPDIR</filename> will also remove
+ <filename>STAMPS_DIR</filename>, which means tasks will
+ properly be rerun to repopulate
+ <filename>TMPDIR</filename>.
+ </para>
+
+ <para>
+ If you want some task to always be considered "out of
+ date", you can mark it with the
+ <ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>nostamp</filename></ulink>
+ varflag.
+ If some other task depends on such a task, then that
+ task will also always be considered out of date, which
+ might not be what you want.
+ </para>
+
+ <para>
+ For details on how to view information about a task's
+ signature, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-viewing-task-variable-dependencies'>Viewing Task Variable Dependencies</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='setscene-tasks-and-shared-state'>
+ <title>Setscene Tasks and Shared State</title>
+
+ <para>
+ The description of tasks so far assumes that BitBake needs
+ to build everything and no available prebuilt objects
+ exist.
+ BitBake does support skipping tasks if prebuilt objects are
+ available.
+ These objects are usually made available in the form of a
+ shared state (sstate) cache.
+ <note>
+ For information on variables affecting sstate, see the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>
+ variables.
+ </note>
+ </para>
+
+ <para>
+ The idea of a setscene task (i.e
+ <filename>do_</filename><replaceable>taskname</replaceable><filename>_setscene</filename>)
+ is a version of the task where
+ instead of building something, BitBake can skip to the end
+ result and simply place a set of files into specific
+ locations as needed.
+ In some cases, it makes sense to have a setscene task
+ variant (e.g. generating package files in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_deb'><filename>do_package_write_*</filename></ulink>
+ task).
+ In other cases, it does not make sense (e.g. a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-patch'><filename>do_patch</filename></ulink>
+ task or a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>
+ task) since the work involved would be equal to or greater
+ than the underlying task.
+ </para>
+
+ <para>
+ In the build system, the common tasks that have setscene
+ variants are
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>,
+ <filename>do_package_write_*</filename>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-deploy'><filename>do_deploy</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-packagedata'><filename>do_packagedata</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></ulink>.
+ Notice that these tasks represent most of the tasks whose
+ output is an end result.
+ </para>
+
+ <para>
+ The build system has knowledge of the relationship between
+ these tasks and other preceding tasks.
+ For example, if BitBake runs
+ <filename>do_populate_sysroot_setscene</filename> for
+ something, it does not make sense to run any of the
+ <filename>do_fetch</filename>,
+ <filename>do_unpack</filename>,
+ <filename>do_patch</filename>,
+ <filename>do_configure</filename>,
+ <filename>do_compile</filename>, and
+ <filename>do_install</filename> tasks.
+ However, if <filename>do_package</filename> needs to be
+ run, BitBake needs to run those other tasks.
+ </para>
+
+ <para>
+ It becomes more complicated if everything can come
+ from an sstate cache because some objects are simply
+ not required at all.
+ For example, you do not need a compiler or native tools,
+ such as quilt, if nothing exists to compile or patch.
+ If the <filename>do_package_write_*</filename> packages
+ are available from sstate, BitBake does not need the
+ <filename>do_package</filename> task data.
+ </para>
+
+ <para>
+ To handle all these complexities, BitBake runs in two
+ phases.
+ The first is the "setscene" stage.
+ During this stage, BitBake first checks the sstate cache
+ for any targets it is planning to build.
+ BitBake does a fast check to see if the object exists
+ rather than a complete download.
+ If nothing exists, the second phase, which is the setscene
+ stage, completes and the main build proceeds.
+ </para>
+
+ <para>
+ If objects are found in the sstate cache, the build system
+ works backwards from the end targets specified by the user.
+ For example, if an image is being built, the build system
+ first looks for the packages needed for that image and the
+ tools needed to construct an image.
+ If those are available, the compiler is not needed.
+ Thus, the compiler is not even downloaded.
+ If something was found to be unavailable, or the
+ download or setscene task fails, the build system then
+ tries to install dependencies, such as the compiler, from
+ the cache.
+ </para>
+
+ <para>
+ The availability of objects in the sstate cache is
+ handled by the function specified by the
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_HASHCHECK_FUNCTION'><filename>BB_HASHCHECK_FUNCTION</filename></ulink>
+ variable and returns a list of available objects.
+ The function specified by the
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_SETSCENE_DEPVALID'><filename>BB_SETSCENE_DEPVALID</filename></ulink>
+ variable is the function that determines whether a given
+ dependency needs to be followed, and whether for any given
+ relationship the function needs to be passed.
+ The function returns a True or False value.
+ </para>
+ </section>
+ </section>
+
+ <section id='images-dev-environment'>
+ <title>Images</title>
+
+ <para>
+ The images produced by the build system are compressed forms
+ of the root filesystem and are ready to boot on a target
+ device.
+ You can see from the
+ <link linkend='general-workflow-figure'>general workflow figure</link>
+ that BitBake output, in part, consists of images.
+ This section takes a closer look at this output:
+ <imagedata fileref="figures/images.png" align="center" width="5.5in" depth="5.5in" />
+ </para>
+
+ <note>
+ For a list of example images that the Yocto Project provides,
+ see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-images'>Images</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </note>
+
+ <para>
+ The build process writes images out to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ inside the
+ <filename>tmp/deploy/images/<replaceable>machine</replaceable>/</filename>
+ folder as shown in the figure.
+ This folder contains any files expected to be loaded on the
+ target device.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></ulink>
+ variable points to the <filename>deploy</filename> directory,
+ while the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></ulink>
+ variable points to the appropriate directory containing images
+ for the current configuration.
+ <itemizedlist>
+ <listitem><para>
+ <replaceable>kernel-image</replaceable>:
+ A kernel binary file.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></ulink>
+ variable determines the naming scheme for the
+ kernel image file.
+ Depending on this variable, the file could begin with
+ a variety of naming strings.
+ The
+ <filename>deploy/images/</filename><replaceable>machine</replaceable>
+ directory can contain multiple image files for the
+ machine.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>root-filesystem-image</replaceable>:
+ Root filesystems for the target device (e.g.
+ <filename>*.ext3</filename> or
+ <filename>*.bz2</filename> files).
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></ulink>
+ variable determines the root filesystem image type.
+ The
+ <filename>deploy/images/</filename><replaceable>machine</replaceable>
+ directory can contain multiple root filesystems for the
+ machine.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>kernel-modules</replaceable>:
+ Tarballs that contain all the modules built for the
+ kernel.
+ Kernel module tarballs exist for legacy purposes and
+ can be suppressed by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MODULE_TARBALL_DEPLOY'><filename>MODULE_TARBALL_DEPLOY</filename></ulink>
+ variable to "0".
+ The
+ <filename>deploy/images/</filename><replaceable>machine</replaceable>
+ directory can contain multiple kernel module tarballs
+ for the machine.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>bootloaders</replaceable>:
+ If applicable to the target machine, bootloaders
+ supporting the image.
+ The <filename>deploy/images/</filename><replaceable>machine</replaceable>
+ directory can contain multiple bootloaders for the
+ machine.
+ </para></listitem>
+ <listitem><para>
+ <replaceable>symlinks</replaceable>:
+ The
+ <filename>deploy/images/</filename><replaceable>machine</replaceable>
+ folder contains a symbolic link that points to the
+ most recently built file for each machine.
+ These links might be useful for external scripts that
+ need to obtain the latest version of each file.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='sdk-dev-environment'>
+ <title>Application Development SDK</title>
+
+ <para>
+ In the
+ <link linkend='general-workflow-figure'>general workflow figure</link>,
+ the output labeled "Application Development SDK" represents an
+ SDK.
+ The SDK generation process differs depending on whether you
+ build an extensible SDK (e.g.
+ <filename>bitbake -c populate_sdk_ext</filename> <replaceable>imagename</replaceable>)
+ or a standard SDK (e.g.
+ <filename>bitbake -c populate_sdk</filename> <replaceable>imagename</replaceable>).
+ This section takes a closer look at this output:
+ <imagedata fileref="figures/sdk.png" align="center" width="9in" depth="7.25in" />
+ </para>
+
+ <para>
+ The specific form of this output is a set of files that
+ includes a self-extracting SDK installer
+ (<filename>*.sh</filename>), host and target manifest files,
+ and files used for SDK testing.
+ When the SDK installer file is run, it installs the SDK.
+ The SDK consists of a cross-development toolchain, a set of
+ libraries and headers, and an SDK environment setup script.
+ Running this installer essentially sets up your
+ cross-development environment.
+ You can think of the cross-toolchain as the "host"
+ part because it runs on the SDK machine.
+ You can think of the libraries and headers as the "target"
+ part because they are built for the target hardware.
+ The environment setup script is added so that you can
+ initialize the environment before using the tools.
+ </para>
+
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ The Yocto Project supports several methods by which
+ you can set up this cross-development environment.
+ These methods include downloading pre-built SDK
+ installers or building and installing your own SDK
+ installer.
+ </para></listitem>
+ <listitem><para>
+ For background information on cross-development
+ toolchains in the Yocto Project development
+ environment, see the
+ "<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+
+ <para>
+ All the output files for an SDK are written to the
+ <filename>deploy/sdk</filename> folder inside the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ as shown in the previous figure.
+ Depending on the type of SDK, several variables exist that help
+ configure these files.
+ The following list shows the variables associated with an
+ extensible SDK:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></ulink>:
+ Points to the <filename>deploy</filename> directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></ulink>:
+ Controls whether or not shared state artifacts are
+ copied into the extensible SDK.
+ By default, all required shared state artifacts are
+ copied into the SDK.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_PKGDATA'><filename>SDK_INCLUDE_PKGDATA</filename></ulink>:
+ Specifies whether or not packagedata is included in the
+ extensible SDK for all recipes in the "world" target.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_TOOLCHAIN'><filename>SDK_INCLUDE_TOOLCHAIN</filename></ulink>:
+ Specifies whether or not the toolchain is included
+ when building the extensible SDK.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_WHITELIST'><filename>SDK_LOCAL_CONF_WHITELIST</filename></ulink>:
+ A list of variables allowed through from the build
+ system configuration into the extensible SDK
+ configuration.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_BLACKLIST'><filename>SDK_LOCAL_CONF_BLACKLIST</filename></ulink>:
+ A list of variables not allowed through from the build
+ system configuration into the extensible SDK
+ configuration.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></ulink>:
+ A list of classes to remove from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHERIT'><filename>INHERIT</filename></ulink>
+ value globally within the extensible SDK configuration.
+ </para></listitem>
+ </itemizedlist>
+ This next list, shows the variables associated with a standard
+ SDK:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></ulink>:
+ Points to the <filename>deploy</filename> directory.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>:
+ Specifies the architecture of the machine on which the
+ cross-development tools are run to create packages for
+ the target hardware.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKIMAGE_FEATURES'><filename>SDKIMAGE_FEATURES</filename></ulink>:
+ Lists the features to include in the "target" part
+ of the SDK.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_HOST_TASK'><filename>TOOLCHAIN_HOST_TASK</filename></ulink>:
+ Lists packages that make up the host part of the SDK
+ (i.e. the part that runs on the
+ <filename>SDKMACHINE</filename>).
+ When you use
+ <filename>bitbake -c populate_sdk <replaceable>imagename</replaceable></filename>
+ to create the SDK, a set of default packages apply.
+ This variable allows you to add more packages.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></ulink>:
+ Lists packages that make up the target part of the SDK
+ (i.e. the part built for the target hardware).
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKPATH'><filename>SDKPATH</filename></ulink>:
+ Defines the default SDK installation path offered by
+ the installation script.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_HOST_MANIFEST'><filename>SDK_HOST_MANIFEST</filename></ulink>:
+ Lists all the installed packages that make up the host
+ part of the SDK.
+ This variable also plays a minor role for extensible
+ SDK development as well.
+ However, it is mainly used for the standard SDK.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_TARGET_MANIFEST'><filename>SDK_TARGET_MANIFEST</filename></ulink>:
+ Lists all the installed packages that make up the
+ target part of the SDK.
+ This variable also plays a minor role for extensible
+ SDK development as well.
+ However, it is mainly used for the standard SDK.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id="cross-development-toolchain-generation">
+ <title>Cross-Development Toolchain Generation</title>
+
+ <para>
+ The Yocto Project does most of the work for you when it comes to
+ creating
+ <ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain'>cross-development toolchains</ulink>.
+ This section provides some technical background on how
+ cross-development toolchains are created and used.
+ For more information on toolchains, you can also see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para>
+
+ <para>
+ In the Yocto Project development environment, cross-development
+ toolchains are used to build images and applications that run
+ on the target hardware.
+ With just a few commands, the OpenEmbedded build system creates
+ these necessary toolchains for you.
+ </para>
+
+ <para>
+ The following figure shows a high-level build environment regarding
+ toolchain construction and use.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/cross-development-toolchains.png" width="8in" depth="6in" align="center" />
+ </para>
+
+ <para>
+ Most of the work occurs on the Build Host.
+ This is the machine used to build images and generally work within
+ the the Yocto Project environment.
+ When you run
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ to create an image, the OpenEmbedded build system
+ uses the host <filename>gcc</filename> compiler to bootstrap a
+ cross-compiler named <filename>gcc-cross</filename>.
+ The <filename>gcc-cross</filename> compiler is what BitBake uses to
+ compile source files when creating the target image.
+ You can think of <filename>gcc-cross</filename> simply as an
+ automatically generated cross-compiler that is used internally
+ within BitBake only.
+ <note>
+ The extensible SDK does not use
+ <filename>gcc-cross-canadian</filename> since this SDK
+ ships a copy of the OpenEmbedded build system and the sysroot
+ within it contains <filename>gcc-cross</filename>.
+ </note>
+ </para>
+
+ <para>
+ The chain of events that occurs when <filename>gcc-cross</filename> is
+ bootstrapped is as follows:
+ <literallayout class='monospaced'>
+ gcc -> binutils-cross -> gcc-cross-initial -> linux-libc-headers -> glibc-initial -> glibc -> gcc-cross -> gcc-runtime
+ </literallayout>
+ <itemizedlist>
+ <listitem><para>
+ <filename>gcc</filename>:
+ The build host's GNU Compiler Collection (GCC).
+ </para></listitem>
+ <listitem><para>
+ <filename>binutils-cross</filename>:
+ The bare minimum binary utilities needed in order to run
+ the <filename>gcc-cross-initial</filename> phase of the
+ bootstrap operation.
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-cross-initial</filename>:
+ An early stage of the bootstrap process for creating
+ the cross-compiler.
+ This stage builds enough of the <filename>gcc-cross</filename>,
+ the C library, and other pieces needed to finish building the
+ final cross-compiler in later stages.
+ This tool is a "native" package (i.e. it is designed to run on
+ the build host).
+ </para></listitem>
+ <listitem><para>
+ <filename>linux-libc-headers</filename>:
+ Headers needed for the cross-compiler.
+ </para></listitem>
+ <listitem><para>
+ <filename>glibc-initial</filename>:
+ An initial version of the Embedded GNU C Library
+ (GLIBC) needed to bootstrap <filename>glibc</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>glibc</filename>:
+ The GNU C Library.
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-cross</filename>:
+ The final stage of the bootstrap process for the
+ cross-compiler.
+ This stage results in the actual cross-compiler that
+ BitBake uses when it builds an image for a targeted
+ device.
+ <note>
+ If you are replacing this cross compiler toolchain
+ with a custom version, you must replace
+ <filename>gcc-cross</filename>.
+ </note>
+ This tool is also a "native" package (i.e. it is
+ designed to run on the build host).
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-runtime</filename>:
+ Runtime libraries resulting from the toolchain bootstrapping
+ process.
+ This tool produces a binary that consists of the
+ runtime libraries need for the targeted device.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can use the OpenEmbedded build system to build an installer for
+ the relocatable SDK used to develop applications.
+ When you run the installer, it installs the toolchain, which
+ contains the development tools (e.g.,
+ <filename>gcc-cross-canadian</filename>,
+ <filename>binutils-cross-canadian</filename>, and other
+ <filename>nativesdk-*</filename> tools),
+ which are tools native to the SDK (i.e. native to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_ARCH'><filename>SDK_ARCH</filename></ulink>),
+ you need to cross-compile and test your software.
+ The figure shows the commands you use to easily build out this
+ toolchain.
+ This cross-development toolchain is built to execute on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>,
+ which might or might not be the same
+ machine as the Build Host.
+ <note>
+ If your target architecture is supported by the Yocto Project,
+ you can take advantage of pre-built images that ship with the
+ Yocto Project and already contain cross-development toolchain
+ installers.
+ </note>
+ </para>
+
+ <para>
+ Here is the bootstrap process for the relocatable toolchain:
+ <literallayout class='monospaced'>
+ gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers ->
+ glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian
+ </literallayout>
+ <itemizedlist>
+ <listitem><para>
+ <filename>gcc</filename>:
+ The build host's GNU Compiler Collection (GCC).
+ </para></listitem>
+ <listitem><para>
+ <filename>binutils-crosssdk</filename>:
+ The bare minimum binary utilities needed in order to run
+ the <filename>gcc-crosssdk-initial</filename> phase of the
+ bootstrap operation.
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-crosssdk-initial</filename>:
+ An early stage of the bootstrap process for creating
+ the cross-compiler.
+ This stage builds enough of the
+ <filename>gcc-crosssdk</filename> and supporting pieces so that
+ the final stage of the bootstrap process can produce the
+ finished cross-compiler.
+ This tool is a "native" binary that runs on the build host.
+ </para></listitem>
+ <listitem><para>
+ <filename>linux-libc-headers</filename>:
+ Headers needed for the cross-compiler.
+ </para></listitem>
+ <listitem><para>
+ <filename>glibc-initial</filename>:
+ An initial version of the Embedded GLIBC needed to bootstrap
+ <filename>nativesdk-glibc</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>nativesdk-glibc</filename>:
+ The Embedded GLIBC needed to bootstrap the
+ <filename>gcc-crosssdk</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-crosssdk</filename>:
+ The final stage of the bootstrap process for the
+ relocatable cross-compiler.
+ The <filename>gcc-crosssdk</filename> is a transitory
+ compiler and never leaves the build host.
+ Its purpose is to help in the bootstrap process to create
+ the eventual <filename>gcc-cross-canadian</filename>
+ compiler, which is relocatable.
+ This tool is also a "native" package (i.e. it is
+ designed to run on the build host).
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-cross-canadian</filename>:
+ The final relocatable cross-compiler.
+ When run on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>,
+ this tool
+ produces executable code that runs on the target device.
+ Only one cross-canadian compiler is produced per architecture
+ since they can be targeted at different processor optimizations
+ using configurations passed to the compiler through the
+ compile commands.
+ This circumvents the need for multiple compilers and thus
+ reduces the size of the toolchains.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <note>
+ For information on advantages gained when building a
+ cross-development toolchain installer, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
+ appendix in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </note>
+ </section>
+
+ <section id="shared-state-cache">
+ <title>Shared State Cache</title>
+
+ <para>
+ By design, the OpenEmbedded build system builds everything from
+ scratch unless
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ can determine that parts do not need to be rebuilt.
+ Fundamentally, building from scratch is attractive as it means all
+ parts are built fresh and no possibility of stale data exists that
+ can cause problems.
+ When developers hit problems, they typically default back to
+ building from scratch so they have a know state from the
+ start.
+ </para>
+
+ <para>
+ Building an image from scratch is both an advantage and a
+ disadvantage to the process.
+ As mentioned in the previous paragraph, building from scratch
+ ensures that everything is current and starts from a known state.
+ However, building from scratch also takes much longer as it
+ generally means rebuilding things that do not necessarily need
+ to be rebuilt.
+ </para>
+
+ <para>
+ The Yocto Project implements shared state code that supports
+ incremental builds.
+ The implementation of the shared state code answers the following
+ questions that were fundamental roadblocks within the OpenEmbedded
+ incremental build support system:
+ <itemizedlist>
+ <listitem><para>
+ What pieces of the system have changed and what pieces have
+ not changed?
+ </para></listitem>
+ <listitem><para>
+ How are changed pieces of software removed and replaced?
+ </para></listitem>
+ <listitem><para>
+ How are pre-built components that do not need to be rebuilt
+ from scratch used when they are available?
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For the first question, the build system detects changes in the
+ "inputs" to a given task by creating a checksum (or signature) of
+ the task's inputs.
+ If the checksum changes, the system assumes the inputs have changed
+ and the task needs to be rerun.
+ For the second question, the shared state (sstate) code tracks
+ which tasks add which output to the build process.
+ This means the output from a given task can be removed, upgraded
+ or otherwise manipulated.
+ The third question is partly addressed by the solution for the
+ second question assuming the build system can fetch the sstate
+ objects from remote locations and install them if they are deemed
+ to be valid.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ The build system does not maintain
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ information as part of the shared state packages.
+ Consequently, considerations exist that affect
+ maintaining shared state feeds.
+ For information on how the build system works with
+ packages and can track incrementing
+ <filename>PR</filename> information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ The code in the build system that supports incremental
+ builds is not simple code.
+ For techniques that help you work around issues related
+ to shared state code, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-viewing-metadata-used-to-create-the-input-signature-of-a-shared-state-task'>Viewing Metadata Used to Create the Input Signature of a Shared State Task</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-invalidating-shared-state-to-force-a-task-to-run'>Invalidating Shared State to Force a Task to Run</ulink>"
+ sections both in the Yocto Project Development Tasks
+ Manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ The rest of this section goes into detail about the overall
+ incremental build architecture, the checksums (signatures), and
+ shared state.
+ </para>
+
+ <section id='concepts-overall-architecture'>
+ <title>Overall Architecture</title>
+
+ <para>
+ When determining what parts of the system need to be built,
+ BitBake works on a per-task basis rather than a per-recipe
+ basis.
+ You might wonder why using a per-task basis is preferred over
+ a per-recipe basis.
+ To help explain, consider having the IPK packaging backend
+ enabled and then switching to DEB.
+ In this case, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ task outputs are still valid.
+ However, with a per-recipe approach, the build would not
+ include the <filename>.deb</filename> files.
+ Consequently, you would have to invalidate the whole build and
+ rerun it.
+ Rerunning everything is not the best solution.
+ Also, in this case, the core must be "taught" much about
+ specific tasks.
+ This methodology does not scale well and does not allow users
+ to easily add new tasks in layers or as external recipes
+ without touching the packaged-staging core.
+ </para>
+ </section>
+
+ <section id='overview-checksums'>
+ <title>Checksums (Signatures)</title>
+
+ <para>
+ The shared state code uses a checksum, which is a unique
+ signature of a task's inputs, to determine if a task needs to
+ be run again.
+ Because it is a change in a task's inputs that triggers a
+ rerun, the process needs to detect all the inputs to a given
+ task.
+ For shell tasks, this turns out to be fairly easy because
+ the build process generates a "run" shell script for each task
+ and it is possible to create a checksum that gives you a good
+ idea of when the task's data changes.
+ </para>
+
+ <para>
+ To complicate the problem, there are things that should not be
+ included in the checksum.
+ First, there is the actual specific build path of a given
+ task - the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>.
+ It does not matter if the work directory changes because it
+ should not affect the output for target packages.
+ Also, the build process has the objective of making native
+ or cross packages relocatable.
+ <note>
+ Both native and cross packages run on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>.
+ However, cross packages generate output for the target
+ architecture.
+ </note>
+ The checksum therefore needs to exclude
+ <filename>WORKDIR</filename>.
+ The simplistic approach for excluding the work directory is to
+ set <filename>WORKDIR</filename> to some fixed value and
+ create the checksum for the "run" script.
+ </para>
+
+ <para>
+ Another problem results from the "run" scripts containing
+ functions that might or might not get called.
+ The incremental build solution contains code that figures out
+ dependencies between shell functions.
+ This code is used to prune the "run" scripts down to the
+ minimum set, thereby alleviating this problem and making the
+ "run" scripts much more readable as a bonus.
+ </para>
+
+ <para>
+ So far, solutions for shell scripts exist.
+ What about Python tasks?
+ The same approach applies even though these tasks are more
+ difficult.
+ The process needs to figure out what variables a Python
+ function accesses and what functions it calls.
+ Again, the incremental build solution contains code that first
+ figures out the variable and function dependencies, and then
+ creates a checksum for the data used as the input to the task.
+ </para>
+
+ <para>
+ Like the <filename>WORKDIR</filename> case, situations exist
+ where dependencies should be ignored.
+ For these situations, you can instruct the build process to
+ ignore a dependency by using a line like the following:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCHS[vardepsexclude] = "MACHINE"
+ </literallayout>
+ This example ensures that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGE_ARCHS'><filename>PACKAGE_ARCHS</filename></ulink>
+ variable does not depend on the value of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>,
+ even if it does reference it.
+ </para>
+
+ <para>
+ Equally, there are cases where you need to add dependencies
+ BitBake is not able to find.
+ You can accomplish this by using a line like the following:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCHS[vardeps] = "MACHINE"
+ </literallayout>
+ This example explicitly adds the <filename>MACHINE</filename>
+ variable as a dependency for
+ <filename>PACKAGE_ARCHS</filename>.
+ </para>
+
+ <para>
+ As an example, consider a case with in-line Python where
+ BitBake is not able to figure out dependencies.
+ When running in debug mode (i.e. using
+ <filename>-DDD</filename>), BitBake produces output when it
+ discovers something for which it cannot figure out dependencies.
+ The Yocto Project team has currently not managed to cover
+ those dependencies in detail and is aware of the need to fix
+ this situation.
+ </para>
+
+ <para>
+ Thus far, this section has limited discussion to the direct
+ inputs into a task.
+ Information based on direct inputs is referred to as the
+ "basehash" in the code.
+ However, the question of a task's indirect inputs still
+ exits - items already built and present in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ The checksum (or signature) for a particular task needs to add
+ the hashes of all the tasks on which the particular task
+ depends.
+ Choosing which dependencies to add is a policy decision.
+ However, the effect is to generate a master checksum that
+ combines the basehash and the hashes of the task's
+ dependencies.
+ </para>
+
+ <para>
+ At the code level, a variety of ways exist by which both the
+ basehash and the dependent task hashes can be influenced.
+ Within the BitBake configuration file, you can give BitBake
+ some extra information to help it construct the basehash.
+ The following statement effectively results in a list of
+ global variable dependency excludes (i.e. variables never
+ included in any checksum):
+ <literallayout class='monospaced'>
+ BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
+ SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+ USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
+ PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
+ CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX"
+ </literallayout>
+ The previous example excludes
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>
+ since that variable is actually constructed as a path within
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TMPDIR'><filename>TMPDIR</filename></ulink>,
+ which is on the whitelist.
+ </para>
+
+ <para>
+ The rules for deciding which hashes of dependent tasks to
+ include through dependency chains are more complex and are
+ generally accomplished with a Python function.
+ The code in <filename>meta/lib/oe/sstatesig.py</filename> shows
+ two examples of this and also illustrates how you can insert
+ your own policy into the system if so desired.
+ This file defines the two basic signature generators
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OE-Core</ulink>
+ uses: "OEBasic" and "OEBasicHash".
+ By default, a dummy "noop" signature handler is enabled
+ in BitBake.
+ This means that behavior is unchanged from previous versions.
+ OE-Core uses the "OEBasicHash" signature handler by default
+ through this setting in the <filename>bitbake.conf</filename>
+ file:
+ <literallayout class='monospaced'>
+ BB_SIGNATURE_HANDLER ?= "OEBasicHash"
+ </literallayout>
+ The "OEBasicHash" <filename>BB_SIGNATURE_HANDLER</filename>
+ is the same as the "OEBasic" version but adds the task hash to
+ the
+ <link linkend='stamp-files-and-the-rerunning-of-tasks'>stamp files</link>.
+ This results in any metadata change that changes the task hash,
+ automatically causing the task to be run again.
+ This removes the need to bump
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>
+ values, and changes to metadata automatically ripple across
+ the build.
+ </para>
+
+ <para>
+ It is also worth noting that the end result of these
+ signature generators is to make some dependency and hash
+ information available to the build.
+ This information includes:
+ <itemizedlist>
+ <listitem><para>
+ <filename>BB_BASEHASH_task-</filename><replaceable>taskname</replaceable>:
+ The base hashes for each task in the recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>BB_BASEHASH_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
+ The base hashes for each dependent task.
+ </para></listitem>
+ <listitem><para>
+ <filename>BBHASHDEPS_</filename><replaceable>filename</replaceable><filename>:</filename><replaceable>taskname</replaceable>:
+ The task dependencies for each task.
+ </para></listitem>
+ <listitem><para>
+ <filename>BB_TASKHASH</filename>:
+ The hash of the currently running task.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='shared-state'>
+ <title>Shared State</title>
+
+ <para>
+ Checksums and dependencies, as discussed in the previous
+ section, solve half the problem of supporting a shared state.
+ The other half of the problem is being able to use checksum
+ information during the build and being able to reuse or rebuild
+ specific components.
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-sstate'><filename>sstate</filename></ulink>
+ class is a relatively generic implementation of how to
+ "capture" a snapshot of a given task.
+ The idea is that the build process does not care about the
+ source of a task's output.
+ Output could be freshly built or it could be downloaded and
+ unpacked from somewhere.
+ In other words, the build process does not need to worry about
+ its origin.
+ </para>
+
+ <para>
+ Two types of output exist.
+ One type is just about creating a directory in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink>.
+ A good example is the output of either
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>.
+ The other type of output occurs when a set of data is merged
+ into a shared directory tree such as the sysroot.
+ </para>
+
+ <para>
+ The Yocto Project team has tried to keep the details of the
+ implementation hidden in <filename>sstate</filename> class.
+ From a user's perspective, adding shared state wrapping to a
+ task is as simple as this
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-deploy'><filename>do_deploy</filename></ulink>
+ example taken from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-deploy'><filename>deploy</filename></ulink>
+ class:
+ <literallayout class='monospaced'>
+ DEPLOYDIR = "${WORKDIR}/deploy-${PN}"
+ SSTATETASKS += "do_deploy"
+ do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"
+ do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+
+ python do_deploy_setscene () {
+ sstate_setscene(d)
+ }
+ addtask do_deploy_setscene
+ do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+ do_deploy[stamp-extra-info] = "${MACHINE_ARCH}"
+ </literallayout>
+ The following list explains the previous example:
+ <itemizedlist>
+ <listitem><para>
+ Adding "do_deploy" to <filename>SSTATETASKS</filename>
+ adds some required sstate-related processing, which is
+ implemented in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-sstate'><filename>sstate</filename></ulink>
+ class, to before and after the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-deploy'><filename>do_deploy</filename></ulink>
+ task.
+ </para></listitem>
+ <listitem><para>
+ The
+ <filename>do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"</filename>
+ declares that <filename>do_deploy</filename> places its
+ output in <filename>${DEPLOYDIR}</filename> when run
+ normally (i.e. when not using the sstate cache).
+ This output becomes the input to the shared state cache.
+ </para></listitem>
+ <listitem><para>
+ The
+ <filename>do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"</filename>
+ line causes the contents of the shared state cache to be
+ copied to <filename>${DEPLOY_DIR_IMAGE}</filename>.
+ <note>
+ If <filename>do_deploy</filename> is not already in
+ the shared state cache or if its input checksum
+ (signature) has changed from when the output was
+ cached, the task runs to populate the shared
+ state cache, after which the contents of the shared
+ state cache is copied to
+ <filename>${DEPLOY_DIR_IMAGE}</filename>.
+ If <filename>do_deploy</filename> is in the shared
+ state cache and its signature indicates that the
+ cached output is still valid (i.e. if no
+ relevant task inputs have changed), then the
+ contents of the shared state cache copies
+ directly to
+ <filename>${DEPLOY_DIR_IMAGE}</filename> by the
+ <filename>do_deploy_setscene</filename> task
+ instead, skipping the
+ <filename>do_deploy</filename> task.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ The following task definition is glue logic needed to
+ make the previous settings effective:
+ <literallayout class='monospaced'>
+ python do_deploy_setscene () {
+ sstate_setscene(d)
+ }
+ addtask do_deploy_setscene
+ </literallayout>
+ <filename>sstate_setscene()</filename> takes the flags
+ above as input and accelerates the
+ <filename>do_deploy</filename> task through the
+ shared state cache if possible.
+ If the task was accelerated,
+ <filename>sstate_setscene()</filename> returns True.
+ Otherwise, it returns False, and the normal
+ <filename>do_deploy</filename> task runs.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#setscene'>setscene</ulink>"
+ section in the BitBake User Manual.
+ </para></listitem>
+ <listitem><para>
+ The <filename>do_deploy[dirs] = "${DEPLOYDIR} ${B}"</filename>
+ line creates <filename>${DEPLOYDIR}</filename> and
+ <filename>${B}</filename> before the
+ <filename>do_deploy</filename> task runs, and also sets
+ the current working directory of
+ <filename>do_deploy</filename> to
+ <filename>${B}</filename>.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'>Variable Flags</ulink>"
+ section in the BitBake User Manual.
+ <note>
+ In cases where
+ <filename>sstate-inputdirs</filename> and
+ <filename>sstate-outputdirs</filename> would be the
+ same, you can use
+ <filename>sstate-plaindirs</filename>.
+ For example, to preserve the
+ <filename>${PKGD}</filename> and
+ <filename>${PKGDEST}</filename> output from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ task, use the following:
+ <literallayout class='monospaced'>
+ do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST}"
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ The <filename>do_deploy[stamp-extra-info] = "${MACHINE_ARCH}"</filename>
+ line appends extra metadata to the
+ <link linkend='stamp-files-and-the-rerunning-of-tasks'>stamp file</link>.
+ In this case, the metadata makes the task specific
+ to a machine's architecture.
+ See
+ "<ulink url='&YOCTO_DOCS_BB_URL;#ref-bitbake-tasklist'>The Task List</ulink>"
+ section in the BitBake User Manual for more
+ information on the <filename>stamp-extra-info</filename>
+ flag.
+ </para></listitem>
+ <listitem><para>
+ <filename>sstate-inputdirs</filename> and
+ <filename>sstate-outputdirs</filename> can also be used
+ with multiple directories.
+ For example, the following declares
+ <filename>PKGDESTWORK</filename> and
+ <filename>SHLIBWORK</filename> as shared state
+ input directories, which populates the shared state
+ cache, and <filename>PKGDATA_DIR</filename> and
+ <filename>SHLIBSDIR</filename> as the corresponding
+ shared state output directories:
+ <literallayout class='monospaced'>
+ do_package[sstate-inputdirs] = "${PKGDESTWORK} ${SHLIBSWORKDIR}"
+ do_package[sstate-outputdirs] = "${PKGDATA_DIR} ${SHLIBSDIR}"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ These methods also include the ability to take a
+ lockfile when manipulating shared state directory
+ structures, for cases where file additions or removals
+ are sensitive:
+ <literallayout class='monospaced'>
+ do_package[sstate-lockfile] = "${PACKAGELOCK}"
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Behind the scenes, the shared state code works by looking in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_DIR'><filename>SSTATE_DIR</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>
+ for shared state files.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS ?= "\
+ file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
+ file://.* file:///some/local/dir/sstate/PATH"
+ </literallayout>
+ <note>
+ The shared state directory
+ (<filename>SSTATE_DIR</filename>) is organized into
+ two-character subdirectories, where the subdirectory
+ names are based on the first two characters of the hash.
+ If the shared state directory structure for a mirror has the
+ same structure as <filename>SSTATE_DIR</filename>, you must
+ specify "PATH" as part of the URI to enable the build system
+ to map to the appropriate subdirectory.
+ </note>
+ </para>
+
+ <para>
+ The shared state package validity can be detected just by
+ looking at the filename since the filename contains the task
+ checksum (or signature) as described earlier in this section.
+ If a valid shared state package is found, the build process
+ downloads it and uses it to accelerate the task.
+ </para>
+
+ <para>
+ The build processes use the <filename>*_setscene</filename>
+ tasks for the task acceleration phase.
+ BitBake goes through this phase before the main execution
+ code and tries to accelerate any tasks for which it can find
+ shared state packages.
+ If a shared state package for a task is available, the
+ shared state package is used.
+ This means the task and any tasks on which it is dependent
+ are not executed.
+ </para>
+
+ <para>
+ As a real world example, the aim is when building an IPK-based
+ image, only the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></ulink>
+ tasks would have their shared state packages fetched and
+ extracted.
+ Since the sysroot is not used, it would never get extracted.
+ This is another reason why a task-based approach is preferred
+ over a recipe-based approach, which would have to install the
+ output from every task.
+ </para>
+ </section>
+ </section>
+
+ <section id='automatically-added-runtime-dependencies'>
+ <title>Automatically Added Runtime Dependencies</title>
+
+ <para>
+ The OpenEmbedded build system automatically adds common types of
+ runtime dependencies between packages, which means that you do not
+ need to explicitly declare the packages using
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RDEPENDS'><filename>RDEPENDS</filename></ulink>.
+ Three automatic mechanisms exist (<filename>shlibdeps</filename>,
+ <filename>pcdeps</filename>, and <filename>depchains</filename>)
+ that handle shared libraries, package configuration (pkg-config)
+ modules, and <filename>-dev</filename> and
+ <filename>-dbg</filename> packages, respectively.
+ For other types of runtime dependencies, you must manually declare
+ the dependencies.
+ <itemizedlist>
+ <listitem><para>
+ <filename>shlibdeps</filename>:
+ During the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ task of each recipe, all shared libraries installed by the
+ recipe are located.
+ For each shared library, the package that contains the
+ shared library is registered as providing the shared
+ library.
+ More specifically, the package is registered as providing
+ the
+ <ulink url='https://en.wikipedia.org/wiki/Soname'>soname</ulink>
+ of the library.
+ The resulting shared-library-to-package mapping
+ is saved globally in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></ulink>
+ by the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-packagedata'><filename>do_packagedata</filename></ulink>
+ task.</para>
+
+ <para>Simultaneously, all executables and shared libraries
+ installed by the recipe are inspected to see what shared
+ libraries they link against.
+ For each shared library dependency that is found,
+ <filename>PKGDATA_DIR</filename> is queried to
+ see if some package (likely from a different recipe)
+ contains the shared library.
+ If such a package is found, a runtime dependency is added
+ from the package that depends on the shared library to the
+ package that contains the library.</para>
+
+ <para>The automatically added runtime dependency also
+ includes a version restriction.
+ This version restriction specifies that at least the
+ current version of the package that provides the shared
+ library must be used, as if
+ "<replaceable>package</replaceable> (>= <replaceable>version</replaceable>)"
+ had been added to <filename>RDEPENDS</filename>.
+ This forces an upgrade of the package containing the shared
+ library when installing the package that depends on the
+ library, if needed.</para>
+
+ <para>If you want to avoid a package being registered as
+ providing a particular shared library (e.g. because the library
+ is for internal use only), then add the library to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PRIVATE_LIBS'><filename>PRIVATE_LIBS</filename></ulink>
+ inside the package's recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>pcdeps</filename>:
+ During the <filename>do_package</filename> task of each
+ recipe, all pkg-config modules
+ (<filename>*.pc</filename> files) installed by the recipe
+ are located.
+ For each module, the package that contains the module is
+ registered as providing the module.
+ The resulting module-to-package mapping is saved globally in
+ <filename>PKGDATA_DIR</filename> by the
+ <filename>do_packagedata</filename> task.</para>
+
+ <para>Simultaneously, all pkg-config modules installed by
+ the recipe are inspected to see what other pkg-config
+ modules they depend on.
+ A module is seen as depending on another module if it
+ contains a "Requires:" line that specifies the other module.
+ For each module dependency,
+ <filename>PKGDATA_DIR</filename> is queried to see if some
+ package contains the module.
+ If such a package is found, a runtime dependency is added
+ from the package that depends on the module to the package
+ that contains the module.
+ <note>
+ The <filename>pcdeps</filename> mechanism most often
+ infers dependencies between <filename>-dev</filename>
+ packages.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <filename>depchains</filename>:
+ If a package <filename>foo</filename> depends on a package
+ <filename>bar</filename>, then <filename>foo-dev</filename>
+ and <filename>foo-dbg</filename> are also made to depend on
+ <filename>bar-dev</filename> and
+ <filename>bar-dbg</filename>, respectively.
+ Taking the <filename>-dev</filename> packages as an
+ example, the <filename>bar-dev</filename> package might
+ provide headers and shared library symlinks needed by
+ <filename>foo-dev</filename>, which shows the need
+ for a dependency between the packages.</para>
+
+ <para>The dependencies added by
+ <filename>depchains</filename> are in the form of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-RRECOMMENDS'><filename>RRECOMMENDS</filename></ulink>.
+ <note>
+ By default, <filename>foo-dev</filename> also has an
+ <filename>RDEPENDS</filename>-style dependency on
+ <filename>foo</filename>, because the default value of
+ <filename>RDEPENDS_${PN}-dev</filename> (set in
+ <filename>bitbake.conf</filename>) includes
+ "${PN}".
+ </note></para>
+
+ <para>To ensure that the dependency chain is never broken,
+ <filename>-dev</filename> and <filename>-dbg</filename>
+ packages are always generated by default, even if the
+ packages turn out to be empty.
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></ulink>
+ variable for more information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The <filename>do_package</filename> task depends on the
+ <filename>do_packagedata</filename> task of each recipe in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ through use of a
+ <filename>[</filename><ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>deptask</filename></ulink><filename>]</filename>
+ declaration, which guarantees that the required
+ shared-library/module-to-package mapping information will be available
+ when needed as long as <filename>DEPENDS</filename> has been
+ correctly set.
+ </para>
+ </section>
+
+ <section id='fakeroot-and-pseudo'>
+ <title>Fakeroot and Pseudo</title>
+
+ <para>
+ Some tasks are easier to implement when allowed to perform certain
+ operations that are normally reserved for the root user (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package_write_deb'><filename>do_package_write*</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-rootfs'><filename>do_rootfs</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-image'><filename>do_image*</filename></ulink>).
+ For example, the <filename>do_install</filename> task benefits
+ from being able to set the UID and GID of installed files to
+ arbitrary values.
+ </para>
+
+ <para>
+ One approach to allowing tasks to perform root-only operations
+ would be to require
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ to run as root.
+ However, this method is cumbersome and has security issues.
+ The approach that is actually used is to run tasks that benefit
+ from root privileges in a "fake" root environment.
+ Within this environment, the task and its child processes believe
+ that they are running as the root user, and see an internally
+ consistent view of the filesystem.
+ As long as generating the final output (e.g. a package or an image)
+ does not require root privileges, the fact that some earlier
+ steps ran in a fake root environment does not cause problems.
+ </para>
+
+ <para>
+ The capability to run tasks in a fake root environment is known as
+ "<ulink url='http://man.he.net/man1/fakeroot'>fakeroot</ulink>",
+ which is derived from the BitBake keyword/variable
+ flag that requests a fake root environment for a task.
+ </para>
+
+ <para>
+ In the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>,
+ the program that implements fakeroot is known as Pseudo.
+ Pseudo overrides system calls by using the environment variable
+ <filename>LD_PRELOAD</filename>, which results in the illusion
+ of running as root.
+ To keep track of "fake" file ownership and permissions resulting
+ from operations that require root permissions, Pseudo uses
+ an SQLite 3 database.
+ This database is stored in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/pseudo/files.db</filename>
+ for individual recipes.
+ Storing the database in a file as opposed to in memory
+ gives persistence between tasks and builds, which is not
+ accomplished using fakeroot.
+ <note><title>Caution</title>
+ If you add your own task that manipulates the same files or
+ directories as a fakeroot task, then that task also needs to
+ run under fakeroot.
+ Otherwise, the task cannot run root-only operations, and
+ cannot see the fake file ownership and permissions set by the
+ other task.
+ You need to also add a dependency on
+ <filename>virtual/fakeroot-native:do_populate_sysroot</filename>,
+ giving the following:
+ <literallayout class='monospaced'>
+ fakeroot do_mytask () {
+ ...
+ }
+ do_mytask[depends] += "virtual/fakeroot-native:do_populate_sysroot"
+ </literallayout>
+ </note>
+ For more information, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-FAKEROOT'><filename>FAKEROOT*</filename></ulink>
+ variables in the BitBake User Manual.
+ You can also reference the
+ "<ulink url='http://www.ibm.com/developerworks/opensource/library/os-aapseudo1/index.html'>Pseudo</ulink>"
+ and
+ "<ulink url='https://github.com/wrpseudo/pseudo/wiki/WhyNotFakeroot'>Why Not Fakeroot?</ulink>"
+ articles for background information on Pseudo.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/overview-manual/overview-manual-customization.xsl b/poky/documentation/overview-manual/overview-manual-customization.xsl
new file mode 100644
index 000000000..22360e7ba
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-customization.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'overview-manual-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/overview-manual/overview-manual-development-environment.xml b/poky/documentation/overview-manual/overview-manual-development-environment.xml
new file mode 100644
index 000000000..bba93ccef
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-development-environment.xml
@@ -0,0 +1,970 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='overview-development-environment'>
+<title>The Yocto Project Development Environment</title>
+
+<para>
+ This chapter takes a look at the Yocto Project development
+ environment.
+ The chapter provides Yocto Project Development environment concepts that
+ help you understand how work is accomplished in an open source environment,
+ which is very different as compared to work accomplished in a closed,
+ proprietary environment.
+</para>
+
+<para>
+ Specifically, this chapter addresses open source philosophy, source
+ repositories, workflows, Git, and licensing.
+</para>
+
+<section id='open-source-philosophy'>
+ <title>Open Source Philosophy</title>
+
+ <para>
+ Open source philosophy is characterized by software development
+ directed by peer production and collaboration through an active
+ community of developers.
+ Contrast this to the more standard centralized development models
+ used by commercial software companies where a finite set of developers
+ produces a product for sale using a defined set of procedures that
+ ultimately result in an end product whose architecture and source
+ material are closed to the public.
+ </para>
+
+ <para>
+ Open source projects conceptually have differing concurrent agendas,
+ approaches, and production.
+ These facets of the development process can come from anyone in the
+ public (community) who has a stake in the software project.
+ The open source environment contains new copyright, licensing, domain,
+ and consumer issues that differ from the more traditional development
+ environment.
+ In an open source environment, the end product, source material,
+ and documentation are all available to the public at no cost.
+ </para>
+
+ <para>
+ A benchmark example of an open source project is the Linux kernel,
+ which was initially conceived and created by Finnish computer science
+ student Linus Torvalds in 1991.
+ Conversely, a good example of a non-open source project is the
+ <trademark class='registered'>Windows</trademark> family of operating
+ systems developed by
+ <trademark class='registered'>Microsoft</trademark> Corporation.
+ </para>
+
+ <para>
+ Wikipedia has a good historical description of the Open Source
+ Philosophy
+ <ulink url='http://en.wikipedia.org/wiki/Open_source'>here</ulink>.
+ You can also find helpful information on how to participate in the
+ Linux Community
+ <ulink url='http://ldn.linuxfoundation.org/book/how-participate-linux-community'>here</ulink>.
+ </para>
+</section>
+
+<section id='gs-the-development-host'>
+ <title>The Development Host</title>
+
+ <para>
+ A development host or
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
+ is key to using the Yocto Project.
+ Because the goal of the Yocto Project is to develop images or
+ applications that run on embedded hardware, development of those
+ images and applications generally takes place on a system not
+ intended to run the software - the development host.
+ </para>
+
+ <para>
+ You need to set up a development host in order to use it with the
+ Yocto Project.
+ Most find that it is best to have a native Linux machine function as
+ the development host.
+ However, it is possible to use a system that does not run Linux
+ as its operating system as your development host.
+ When you have a Mac or Windows-based system, you can set it up
+ as the development host by using
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
+ Once you take the steps to set up a CROPS machine, you effectively
+ have access to a shell environment that is similar to what you see
+ when using a Linux-based development host.
+ For the steps needed to set up a system using CROPS, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ If your development host is going to be a system that runs a Linux
+ distribution, steps still exist that you must take to prepare the
+ system for use with the Yocto Project.
+ You need to be sure that the Linux distribution on the system is
+ one that supports the Yocto Project.
+ You also need to be sure that the correct set of host packages are
+ installed that allow development using the Yocto Project.
+ For the steps needed to set up a development host that runs Linux,
+ see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-a-native-linux-host'>Setting Up a Native Linux Host</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ Once your development host is set up to use the Yocto Project,
+ several methods exist for you to do work in the Yocto Project
+ environment:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Command Lines, BitBake, and Shells:</emphasis>
+ Traditional development in the Yocto Project involves using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>,
+ which uses BitBake, in a command-line environment from a shell
+ on your development host.
+ You can accomplish this from a host that is a native Linux
+ machine or from a host that has been set up with CROPS.
+ Either way, you create, modify, and build images and
+ applications all within a shell-based environment using
+ components and tools available through your Linux distribution
+ and the Yocto Project.</para>
+
+ <para>For a general flow of the build procedures, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-building-a-simple-image'>Building a Simple Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Board Support Package (BSP) Development:</emphasis>
+ Development of BSPs involves using the Yocto Project to
+ create and test layers that allow easy development of
+ images and applications targeted for specific hardware.
+ To development BSPs, you need to take some additional steps
+ beyond what was described in setting up a development host.
+ </para>
+
+ <para>The
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>
+ provides BSP-related development information.
+ For specifics on development host preparation, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#preparing-your-build-host-to-work-with-bsp-layers'>Preparing Your Build Host to Work With BSP Layers</ulink>"
+ section in the Yocto Project Board Support Package (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Kernel Development:</emphasis>
+ If you are going to be developing kernels using the Yocto
+ Project you likely will be using <filename>devtool</filename>.
+ A workflow using <filename>devtool</filename> makes kernel
+ development quicker by reducing iteration cycle times.</para>
+
+ <para>The
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>
+ provides kernel-related development information.
+ For specifics on development host preparation, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#preparing-the-build-host-to-work-on-the-kernel'>Preparing the Build Host to Work on the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Using the <trademark class='trade'>Eclipse</trademark> IDE:</emphasis>
+ One of two Yocto Project development methods that involves an
+ interface that effectively puts the Yocto Project into the
+ background is the popular Eclipse IDE.
+ This method of development is advantageous if you are already
+ familiar with working within Eclipse.
+ Development is supported through a plugin that you install
+ onto your development host.</para>
+
+ <para>For steps that show you how to set up your development
+ host to use the Eclipse Yocto Project plugin, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>"
+ Chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Using Toaster:</emphasis>
+ The other Yocto Project development method that involves an
+ interface that effectively puts the Yocto Project into the
+ background is Toaster.
+ Toaster provides an interface to the OpenEmbedded build system.
+ The interface enables you to configure and run your builds.
+ Information about builds is collected and stored in a database.
+ You can use Toaster to configure and start builds on multiple
+ remote build servers.</para>
+
+ <para>For steps that show you how to set up your development
+ host to use Toaster and on how to use Toaster in general,
+ see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='yocto-project-repositories'>
+ <title>Yocto Project Source Repositories</title>
+
+ <para>
+ The Yocto Project team maintains complete source repositories for all
+ Yocto Project files at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ This web-based source code browser is organized into categories by
+ function such as IDE Plugins, Matchbox, Poky, Yocto Linux Kernel, and
+ so forth.
+ From the interface, you can click on any particular item in the "Name"
+ column and see the URL at the bottom of the page that you need to clone
+ a Git repository for that particular item.
+ Having a local Git repository of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>,
+ which is usually named "poky", allows
+ you to make changes, contribute to the history, and ultimately enhance
+ the Yocto Project's tools, Board Support Packages, and so forth.
+ </para>
+
+ <para>
+ For any supported release of Yocto Project, you can also go to the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and
+ select the "DOWNLOADS" item from the "SOFTWARE" menu and get a
+ released tarball of the <filename>poky</filename> repository, any
+ supported BSP tarball, or Yocto Project tools.
+ Unpacking these tarballs gives you a snapshot of the released
+ files.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ The recommended method for setting up the Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ and the files for supported BSPs
+ (e.g., <filename>meta-intel</filename>) is to use
+ <link linkend='git'>Git</link> to create a local copy of
+ the upstream repositories.
+ </para></listitem>
+ <listitem><para>
+ Be sure to always work in matching branches for both
+ the selected BSP repository and the Source Directory
+ (i.e. <filename>poky</filename>) repository.
+ For example, if you have checked out the "master" branch
+ of <filename>poky</filename> and you are going to use
+ <filename>meta-intel</filename>, be sure to checkout the
+ "master" branch of <filename>meta-intel</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ In summary, here is where you can get the project files needed for
+ development:
+ <itemizedlist>
+ <listitem><para id='source-repositories'>
+ <emphasis>
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories:</ulink>
+ </emphasis>
+ This area contains IDE Plugins, Matchbox, Poky, Poky Support,
+ Tools, Yocto Linux Kernel, and Yocto Metadata Layers.
+ You can create local copies of Git repositories for each of
+ these areas.</para>
+
+ <para>
+ <imagedata fileref="figures/source-repos.png" align="center" width="6in" depth="4in" />
+ For steps on how to view and access these upstream Git
+ repositories, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#accessing-source-repositories'>Accessing Source Repositories</ulink>"
+ Section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para><anchor id='index-downloads' />
+ <emphasis>
+ <ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink>
+ </emphasis>
+ This is an index of releases such as
+ the <trademark class='trade'>Eclipse</trademark>
+ Yocto Plug-in, miscellaneous support, Poky, Pseudo, installers
+ for cross-development toolchains, and all released versions of
+ Yocto Project in the form of images or tarballs.
+ Downloading and extracting these files does not produce a local
+ copy of the Git repository but rather a snapshot of a
+ particular release or image.</para>
+
+ <para>
+ <imagedata fileref="figures/index-downloads.png" align="center" width="6in" depth="3.5in" />
+ For steps on how to view and access these files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#accessing-index-of-releases'>Accessing Index of Releases</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para id='downloads-page'>
+ <emphasis>"DOWNLOADS" page for the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>:
+ </emphasis></para>
+
+ <para>The Yocto Project website includes a "DOWNLOADS" page
+ accessible through the "SOFTWARE" menu that allows you to
+ download any Yocto Project release, tool, and Board Support
+ Package (BSP) in tarball form.
+ The tarballs are similar to those found in the
+ <ulink url='&YOCTO_DL_URL;/releases/'>Index of /releases:</ulink>
+ area.</para>
+
+ <para>
+ <imagedata fileref="figures/yp-download.png" align="center" width="6in" depth="4in" />
+ For steps on how to use the "DOWNLOADS" page, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-the-downloads-page'>Using the Downloads Page</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='gs-git-workflows-and-the-yocto-project'>
+ <title>Git Workflows and the Yocto Project</title>
+
+ <para>
+ Developing using the Yocto Project likely requires the use of
+ <link linkend='git'>Git</link>.
+ Git is a free, open source distributed version control system
+ used as part of many collaborative design environments.
+ This section provides workflow concepts using the Yocto Project and
+ Git.
+ In particular, the information covers basic practices that describe
+ roles and actions in a collaborative development environment.
+ <note>
+ If you are familiar with this type of development environment, you
+ might not want to read this section.
+ </note>
+ </para>
+
+ <para>
+ The Yocto Project files are maintained using Git in "branches"
+ whose Git histories track every change and whose structures
+ provide branches for all diverging functionality.
+ Although there is no need to use Git, many open source projects do so.
+ <para>
+
+ </para>
+ For the Yocto Project, a key individual called the "maintainer" is
+ responsible for the integrity of the "master" branch of a given Git
+ repository.
+ The "master" branch is the “upstream†repository from which final or
+ most recent builds of a project occur.
+ The maintainer is responsible for accepting changes from other
+ developers and for organizing the underlying branch structure to
+ reflect release strategies and so forth.
+ <note>
+ For information on finding out who is responsible for (maintains)
+ a particular area of code in the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ </note>
+ </para>
+
+ <para>
+ The Yocto Project <filename>poky</filename> Git repository also has an
+ upstream contribution Git repository named
+ <filename>poky-contrib</filename>.
+ You can see all the branches in this repository using the web interface
+ of the
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink> organized
+ within the "Poky Support" area.
+ These branches hold changes (commits) to the project that have been
+ submitted or committed by the Yocto Project development team and by
+ community members who contribute to the project.
+ The maintainer determines if the changes are qualified to be moved
+ from the "contrib" branches into the "master" branch of the Git
+ repository.
+ </para>
+
+ <para>
+ Developers (including contributing community members) create and
+ maintain cloned repositories of upstream branches.
+ The cloned repositories are local to their development platforms and
+ are used to develop changes.
+ When a developer is satisfied with a particular feature or change,
+ they "push" the change to the appropriate "contrib" repository.
+ </para>
+
+ <para>
+ Developers are responsible for keeping their local repository
+ up-to-date with whatever upstream branch they are working against.
+ They are also responsible for straightening out any conflicts that
+ might arise within files that are being worked on simultaneously by
+ more than one person.
+ All this work is done locally on the development host before
+ anything is pushed to a "contrib" area and examined at the maintainer’s
+ level.
+ </para>
+
+ <para>
+ A somewhat formal method exists by which developers commit changes
+ and push them into the "contrib" area and subsequently request that
+ the maintainer include them into an upstream branch.
+ This process is called “submitting a patch†or "submitting a change."
+ For information on submitting patches and changes, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ In summary, a single point of entry
+ exists for changes into a "master" or development branch of the
+ Git repository, which is controlled by the project’s maintainer.
+ And, a set of developers exist who independently develop, test, and
+ submit changes to "contrib" areas for the maintainer to examine.
+ The maintainer then chooses which changes are going to become a
+ permanent part of the project.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/git-workflow.png" width="6in" depth="3in" align="left" scalefit="1" />
+ </para>
+
+ <para>
+ While each development environment is unique, there are some best
+ practices or methods that help development run smoothly.
+ The following list describes some of these practices.
+ For more information about Git workflows, see the workflow topics in
+ the
+ <ulink url='http://book.git-scm.com'>Git Community Book</ulink>.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Make Small Changes:</emphasis>
+ It is best to keep the changes you commit small as compared to
+ bundling many disparate changes into a single commit.
+ This practice not only keeps things manageable but also allows
+ the maintainer to more easily include or refuse changes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Complete Changes:</emphasis>
+ It is also good practice to leave the repository in a
+ state that allows you to still successfully build your project.
+ In other words, do not commit half of a feature,
+ then add the other half as a separate, later commit.
+ Each commit should take you from one buildable project state
+ to another buildable state.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use Branches Liberally:</emphasis>
+ It is very easy to create, use, and delete local branches in
+ your working Git repository on the development host.
+ You can name these branches anything you like.
+ It is helpful to give them names associated with the particular
+ feature or change on which you are working.
+ Once you are done with a feature or change and have merged it
+ into your local master branch, simply discard the temporary
+ branch.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Merge Changes:</emphasis>
+ The <filename>git merge</filename> command allows you to take
+ the changes from one branch and fold them into another branch.
+ This process is especially helpful when more than a single
+ developer might be working on different parts of the same
+ feature.
+ Merging changes also automatically identifies any collisions
+ or "conflicts" that might happen as a result of the same lines
+ of code being altered by two different developers.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Manage Branches:</emphasis>
+ Because branches are easy to use, you should use a system
+ where branches indicate varying levels of code readiness.
+ For example, you can have a "work" branch to develop in, a
+ "test" branch where the code or change is tested, a "stage"
+ branch where changes are ready to be committed, and so forth.
+ As your project develops, you can merge code across the
+ branches to reflect ever-increasing stable states of the
+ development.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Use Push and Pull:</emphasis>
+ The push-pull workflow is based on the concept of developers
+ "pushing" local commits to a remote repository, which is
+ usually a contribution repository.
+ This workflow is also based on developers "pulling" known
+ states of the project down into their local development
+ repositories.
+ The workflow easily allows you to pull changes submitted by
+ other developers from the upstream repository into your
+ work area ensuring that you have the most recent software
+ on which to develop.
+ The Yocto Project has two scripts named
+ <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename> that ship with the
+ release to facilitate this workflow.
+ You can find these scripts in the <filename>scripts</filename>
+ folder of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ For information on how to use these scripts, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#pushing-a-change-upstream'>Using Scripts to Push a Change Upstream and Request a Pull</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Patch Workflow:</emphasis>
+ This workflow allows you to notify the maintainer through an
+ email that you have a change (or patch) you would like
+ considered for the "master" branch of the Git repository.
+ To send this type of change, you format the patch and then
+ send the email using the Git commands
+ <filename>git format-patch</filename> and
+ <filename>git send-email</filename>.
+ For information on how to use these scripts, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='git'>
+ <title>Git</title>
+
+ <para>
+ The Yocto Project makes extensive use of Git, which is a
+ free, open source distributed version control system.
+ Git supports distributed development, non-linear development,
+ and can handle large projects.
+ It is best that you have some fundamental understanding
+ of how Git tracks projects and how to work with Git if
+ you are going to use the Yocto Project for development.
+ This section provides a quick overview of how Git works and
+ provides you with a summary of some essential Git commands.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ For more information on Git, see
+ <ulink url='http://git-scm.com/documentation'></ulink>.
+ </para></listitem>
+ <listitem><para>
+ If you need to download Git, it is recommended that you add
+ Git to your system through your distribution's "software
+ store" (e.g. for Ubuntu, use the Ubuntu Software feature).
+ For the Git download page, see
+ <ulink url='http://git-scm.com/download'></ulink>.
+ </para></listitem>
+ <listitem><para>
+ For information beyond the introductory nature in this
+ section, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <section id='repositories-tags-and-branches'>
+ <title>Repositories, Tags, and Branches</title>
+
+ <para>
+ As mentioned briefly in the previous section and also in the
+ "<link linkend='gs-git-workflows-and-the-yocto-project'>Git Workflows and the Yocto Project</link>"
+ section, the Yocto Project maintains source repositories at
+ <ulink url='&YOCTO_GIT_URL;'></ulink>.
+ If you look at this web-interface of the repositories, each item
+ is a separate Git repository.
+ </para>
+
+ <para>
+ Git repositories use branching techniques that track content
+ change (not files) within a project (e.g. a new feature or updated
+ documentation).
+ Creating a tree-like structure based on project divergence allows
+ for excellent historical information over the life of a project.
+ This methodology also allows for an environment from which you can
+ do lots of local experimentation on projects as you develop
+ changes or new features.
+ </para>
+
+ <para>
+ A Git repository represents all development efforts for a given
+ project.
+ For example, the Git repository <filename>poky</filename> contains
+ all changes and developments for that repository over the course
+ of its entire life.
+ That means that all changes that make up all releases are captured.
+ The repository maintains a complete history of changes.
+ </para>
+
+ <para>
+ You can create a local copy of any repository by "cloning" it
+ with the <filename>git clone</filename> command.
+ When you clone a Git repository, you end up with an identical
+ copy of the repository on your development system.
+ Once you have a local copy of a repository, you can take steps to
+ develop locally.
+ For examples on how to clone Git repositories, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ It is important to understand that Git tracks content change and
+ not files.
+ Git uses "branches" to organize different development efforts.
+ For example, the <filename>poky</filename> repository has
+ several branches that include the current "&DISTRO_NAME_NO_CAP;"
+ branch, the "master" branch, and many branches for past
+ Yocto Project releases.
+ You can see all the branches by going to
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and
+ clicking on the
+ <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/heads'>[...]</ulink></filename>
+ link beneath the "Branch" heading.
+ </para>
+
+ <para>
+ Each of these branches represents a specific area of development.
+ The "master" branch represents the current or most recent
+ development.
+ All other branches represent offshoots of the "master" branch.
+ </para>
+
+ <para>
+ When you create a local copy of a Git repository, the copy has
+ the same set of branches as the original.
+ This means you can use Git to create a local working area
+ (also called a branch) that tracks a specific development branch
+ from the upstream source Git repository.
+ in other words, you can define your local Git environment to
+ work on any development branch in the repository.
+ To help illustrate, consider the following example Git commands:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/poky
+ $ cd poky
+ $ git checkout -b &DISTRO_NAME_NO_CAP; origin/&DISTRO_NAME_NO_CAP;
+ </literallayout>
+ In the previous example after moving to the home directory, the
+ <filename>git clone</filename> command creates a
+ local copy of the upstream <filename>poky</filename> Git repository.
+ By default, Git checks out the "master" branch for your work.
+ After changing the working directory to the new local repository
+ (i.e. <filename>poky</filename>), the
+ <filename>git checkout</filename> command creates
+ and checks out a local branch named "&DISTRO_NAME_NO_CAP;", which
+ tracks the upstream "origin/&DISTRO_NAME_NO_CAP;" branch.
+ Changes you make while in this branch would ultimately affect
+ the upstream "&DISTRO_NAME_NO_CAP;" branch of the
+ <filename>poky</filename> repository.
+ </para>
+
+ <para>
+ It is important to understand that when you create and checkout a
+ local working branch based on a branch name,
+ your local environment matches the "tip" of that particular
+ development branch at the time you created your local branch,
+ which could be different from the files in the "master" branch
+ of the upstream repository.
+ In other words, creating and checking out a local branch based on
+ the "&DISTRO_NAME_NO_CAP;" branch name is not the same as
+ checking out the "master" branch in the repository.
+ Keep reading to see how you create a local snapshot of a Yocto
+ Project Release.
+ </para>
+
+ <para>
+ Git uses "tags" to mark specific changes in a repository branch
+ structure.
+ Typically, a tag is used to mark a special point such as the final
+ change (or commit) before a project is released.
+ You can see the tags used with the <filename>poky</filename> Git
+ repository by going to
+ <ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/'></ulink> and
+ clicking on the
+ <filename><ulink url='&YOCTO_GIT_URL;/cgit.cgi/poky/refs/tags'>[...]</ulink></filename>
+ link beneath the "Tag" heading.
+ </para>
+
+ <para>
+ Some key tags for the <filename>poky</filename> repository are
+ <filename>jethro-14.0.3</filename>,
+ <filename>morty-16.0.1</filename>,
+ <filename>pyro-17.0.0</filename>, and
+ <filename>&DISTRO_NAME_NO_CAP;-&POKYVERSION;</filename>.
+ These tags represent Yocto Project releases.
+ </para>
+
+ <para>
+ When you create a local copy of the Git repository, you also
+ have access to all the tags in the upstream repository.
+ Similar to branches, you can create and checkout a local working
+ Git branch based on a tag name.
+ When you do this, you get a snapshot of the Git repository that
+ reflects the state of the files when the change was made associated
+ with that tag.
+ The most common use is to checkout a working branch that matches
+ a specific Yocto Project release.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/poky
+ $ cd poky
+ $ git fetch --tags
+ $ git checkout tags/rocko-18.0.0 -b my_rocko-18.0.0
+ </literallayout>
+ In this example, the name of the top-level directory of your
+ local Yocto Project repository is <filename>poky</filename>.
+ After moving to the <filename>poky</filename> directory, the
+ <filename>git fetch</filename> command makes all the upstream
+ tags available locally in your repository.
+ Finally, the <filename>git checkout</filename> command
+ creates and checks out a branch named "my-rocko-18.0.0" that is
+ based on the upstream branch whose "HEAD" matches the
+ commit in the repository associated with the "rocko-18.0.0" tag.
+ The files in your repository now exactly match that particular
+ Yocto Project release as it is tagged in the upstream Git
+ repository.
+ It is important to understand that when you create and
+ checkout a local working branch based on a tag, your environment
+ matches a specific point in time and not the entire development
+ branch (i.e. from the "tip" of the branch backwards).
+ </para>
+ </section>
+
+ <section id='basic-commands'>
+ <title>Basic Commands</title>
+
+ <para>
+ Git has an extensive set of commands that lets you manage changes
+ and perform collaboration over the life of a project.
+ Conveniently though, you can manage with a small set of basic
+ operations and workflows once you understand the basic
+ philosophy behind Git.
+ You do not have to be an expert in Git to be functional.
+ A good place to look for instruction on a minimal set of Git
+ commands is
+ <ulink url='http://git-scm.com/documentation'>here</ulink>.
+ </para>
+
+ <para>
+ The following list of Git commands briefly describes some basic
+ Git operations as a way to get started.
+ As with any set of commands, this list (in most cases) simply shows
+ the base command and omits the many arguments it supports.
+ See the Git documentation for complete descriptions and strategies
+ on how to use these commands:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>git init</filename>:</emphasis>
+ Initializes an empty Git repository.
+ You cannot use Git commands unless you have a
+ <filename>.git</filename> repository.
+ </para></listitem>
+ <listitem><para id='git-commands-clone'>
+ <emphasis><filename>git clone</filename>:</emphasis>
+ Creates a local clone of a Git repository that is on
+ equal footing with a fellow developer’s Git repository
+ or an upstream repository.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git add</filename>:</emphasis>
+ Locally stages updated file contents to the index that
+ Git uses to track changes.
+ You must stage all files that have changed before you
+ can commit them.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git commit</filename>:</emphasis>
+ Creates a local "commit" that documents the changes you
+ made.
+ Only changes that have been staged can be committed.
+ Commits are used for historical purposes, for determining
+ if a maintainer of a project will allow the change,
+ and for ultimately pushing the change from your local
+ Git repository into the project’s upstream repository.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git status</filename>:</emphasis>
+ Reports any modified files that possibly need to be
+ staged and gives you a status of where you stand regarding
+ local commits as compared to the upstream repository.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git checkout</filename> <replaceable>branch-name</replaceable>:</emphasis>
+ Changes your local working branch and in this form
+ assumes the local branch already exists.
+ This command is analogous to "cd".
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git checkout –b</filename> <replaceable>working-branch</replaceable> <replaceable>upstream-branch</replaceable>:</emphasis>
+ Creates and checks out a working branch on your local
+ machine.
+ The local branch tracks the upstream branch.
+ You can use your local branch to isolate your work.
+ It is a good idea to use local branches when adding
+ specific features or changes.
+ Using isolated branches facilitates easy removal of
+ changes if they do not work out.
+ </para></listitem>
+ <listitem><para><emphasis><filename>git branch</filename>:</emphasis>
+ Displays the existing local branches associated with your
+ local repository.
+ The branch that you have currently checked out is noted
+ with an asterisk character.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git branch -D</filename> <replaceable>branch-name</replaceable>:</emphasis>
+ Deletes an existing local branch.
+ You need to be in a local branch other than the one you
+ are deleting in order to delete
+ <replaceable>branch-name</replaceable>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git pull --rebase</filename>:</emphasis>
+ Retrieves information from an upstream Git repository
+ and places it in your local Git repository.
+ You use this command to make sure you are synchronized with
+ the repository from which you are basing changes
+ (.e.g. the "master" branch).
+ The "--rebase" option ensures that any local commits you
+ have in your branch are preserved at the top of your
+ local branch.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git push</filename> <replaceable>repo-name</replaceable> <replaceable>local-branch</replaceable><filename>:</filename><replaceable>upstream-branch</replaceable>:</emphasis>
+ Sends all your committed local changes to the upstream Git
+ repository that your local repository is tracking
+ (e.g. a contribution repository).
+ The maintainer of the project draws from these repositories
+ to merge changes (commits) into the appropriate branch
+ of project's upstream repository.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git merge</filename>:</emphasis>
+ Combines or adds changes from one
+ local branch of your repository with another branch.
+ When you create a local Git repository, the default branch
+ is named "master".
+ A typical workflow is to create a temporary branch that is
+ based off "master" that you would use for isolated work.
+ You would make your changes in that isolated branch,
+ stage and commit them locally, switch to the "master"
+ branch, and then use the <filename>git merge</filename>
+ command to apply the changes from your isolated branch
+ into the currently checked out branch (e.g. "master").
+ After the merge is complete and if you are done with
+ working in that isolated branch, you can safely delete
+ the isolated branch.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git cherry-pick</filename> <replaceable>commits</replaceable>:</emphasis>
+ Choose and apply specific commits from one branch
+ into another branch.
+ There are times when you might not be able to merge
+ all the changes in one branch with
+ another but need to pick out certain ones.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gitk</filename>:</emphasis>
+ Provides a GUI view of the branches and changes in your
+ local Git repository.
+ This command is a good way to graphically see where things
+ have diverged in your local repository.
+ <note>
+ You need to install the <filename>gitk</filename>
+ package on your development system to use this
+ command.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git log</filename>:</emphasis>
+ Reports a history of your commits to the repository.
+ This report lists all commits regardless of whether you
+ have pushed them upstream or not.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>git diff</filename>:</emphasis>
+ Displays line-by-line differences between a local
+ working file and the same file as understood by Git.
+ This command is useful to see what you have changed
+ in any given file.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='licensing'>
+ <title>Licensing</title>
+
+ <para>
+ Because open source projects are open to the public, they have
+ different licensing structures in place.
+ License evolution for both Open Source and Free Software has an
+ interesting history.
+ If you are interested in this history, you can find basic information
+ here:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://en.wikipedia.org/wiki/Open-source_license'>Open source license history</ulink>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://en.wikipedia.org/wiki/Free_software_license'>Free software license history</ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In general, the Yocto Project is broadly licensed under the
+ Massachusetts Institute of Technology (MIT) License.
+ MIT licensing permits the reuse of software within proprietary
+ software as long as the license is distributed with that software.
+ MIT is also compatible with the GNU General Public License (GPL).
+ Patches to the Yocto Project follow the upstream licensing scheme.
+ You can find information on the MIT license
+ <ulink url='http://www.opensource.org/licenses/mit-license.php'>here</ulink>.
+ You can find information on the GNU GPL
+ <ulink url='http://www.opensource.org/licenses/LGPL-3.0'>here</ulink>.
+ </para>
+
+ <para>
+ When you build an image using the Yocto Project, the build process
+ uses a known list of licenses to ensure compliance.
+ You can find this list in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ at <filename>meta/files/common-licenses</filename>.
+ Once the build completes, the list of all licenses found and used
+ during that build are kept in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ at <filename>tmp/deploy/licenses</filename>.
+ </para>
+
+ <para>
+ If a module requires a license that is not in the base list, the
+ build process generates a warning during the build.
+ These tools make it easier for a developer to be certain of the
+ licenses with which their shipped products must comply.
+ However, even with these tools it is still up to the developer to
+ resolve potential licensing issues.
+ </para>
+
+ <para>
+ The base list of licenses used by the build process is a combination
+ of the Software Package Data Exchange (SPDX) list and the Open
+ Source Initiative (OSI) projects.
+ <ulink url='http://spdx.org'>SPDX Group</ulink> is a working group of
+ the Linux Foundation that maintains a specification for a standard
+ format for communicating the components, licenses, and copyrights
+ associated with a software package.
+ <ulink url='http://opensource.org'>OSI</ulink> is a corporation
+ dedicated to the Open Source Definition and the effort for reviewing
+ and approving licenses that conform to the Open Source Definition
+ (OSD).
+ </para>
+
+ <para>
+ You can find a list of the combined SPDX and OSI licenses that the
+ Yocto Project uses in the
+ <filename>meta/files/common-licenses</filename> directory in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ </para>
+
+ <para>
+ For information that can help you maintain compliance with various
+ open source licensing during the lifecycle of a product created using
+ the Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/overview-manual/overview-manual-eclipse-customization.xsl b/poky/documentation/overview-manual/overview-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..aaf99ea1b
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/overview-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/overview-manual/overview-manual-intro.xml b/poky/documentation/overview-manual/overview-manual-intro.xml
new file mode 100644
index 000000000..39433aa41
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-intro.xml
@@ -0,0 +1,112 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='overview-manual-intro'>
+
+<title>The Yocto Project Overview and Concepts Manual</title>
+ <section id='overview-manual-welcome'>
+ <title>Welcome</title>
+
+ <para>
+ Welcome to the Yocto Project Overview and Concepts Manual!
+ This manual introduces the Yocto Project by providing concepts,
+ software overviews, best-known-methods (BKMs), and any other
+ high-level introductory information suitable for a new Yocto
+ Project user.
+ </para>
+
+ <para>
+ The following list describes what you can get from this manual:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><link linkend='overview-yp'>Introducing the Yocto Project</link>:</emphasis>
+ This chapter provides an introduction to the Yocto
+ Project.
+ You will learn about features and challenges of the
+ Yocto Project, the layer model, components and tools,
+ development methods, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#poky'>Poky</ulink>
+ reference distribution, the OpenEmbedded build system
+ workflow, and some basic Yocto terms.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><link linkend='overview-development-environment'>The Yocto Project Development Environment</link>:</emphasis>
+ This chapter helps you get started understanding the
+ Yocto Project development environment.
+ You will learn about open source, development hosts,
+ Yocto Project source repositories, workflows using Git
+ and the Yocto Project, a Git primer, and information
+ about licensing.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><link linkend='overview-manual-concepts'>Yocto Project Concepts</link>:</emphasis>
+ This chapter presents various concepts regarding the
+ Yocto Project.
+ You can find conceptual information about components,
+ development, cross-toolchains, and so forth.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ This manual does not give you the following:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Step-by-step Instructions for Development Tasks:</emphasis>
+ Instructional procedures reside in other manuals within
+ the Yocto Project documentation set.
+ For example, the
+ <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Tasks Manual</ulink>
+ provides examples on how to perform various development
+ tasks.
+ As another example, the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual contains detailed instructions on how to install an
+ SDK, which is used to develop applications for target
+ hardware.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Reference Material:</emphasis>
+ This type of material resides in an appropriate reference
+ manual.
+ For example, system variables are documented in the
+ <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>.
+ As another example, the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>
+ contains reference information on BSPs.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Detailed Public Information Not Specific to the
+ Yocto Project:</emphasis>
+ For example, exhaustive information on how to use the
+ Source Control Manager Git is better covered with Internet
+ searches and official Git Documentation than through the
+ Yocto Project documentation.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='overview-manual-other-information'>
+ <title>Other Information</title>
+
+ <para>
+ Because this manual presents information for many different
+ topics, supplemental information is recommended for full
+ comprehension.
+ For additional introductory information on the Yocto Project, see
+ the <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
+ If you want to build an image with no knowledge of Yocto Project
+ as a way of quickly testing it out, see the
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>
+ document.
+ For a comprehensive list of links and other documentation, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#resources-links-and-related-documentation'>Links and Related Documentation</ulink>"
+ section in the Yocto Project Reference Manual.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/overview-manual/overview-manual-style.css b/poky/documentation/overview-manual/overview-manual-style.css
new file mode 100644
index 000000000..97a364b12
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-style.css
@@ -0,0 +1,988 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/overview-manual-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/overview-manual/overview-manual-yp-intro.xml b/poky/documentation/overview-manual/overview-manual-yp-intro.xml
new file mode 100644
index 000000000..ccf5e274a
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual-yp-intro.xml
@@ -0,0 +1,1357 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='overview-yp'>
+ <title>Introducing the Yocto Project</title>
+
+ <section id='what-is-the-yocto-project'>
+ <title>What is the Yocto Project?</title>
+
+ <para>
+ The Yocto Project is an open source collaboration project
+ that helps developers create custom Linux-based systems that are
+ designed for embedded products regardless of the product's hardware
+ architecture.
+ Yocto Project provides a flexible toolset and a development
+ environment that allows embedded device developers across the
+ world to collaborate through shared technologies, software stacks,
+ configurations, and best practices used to create these tailored
+ Linux images.
+ </para>
+
+ <para>
+ Thousands of developers worldwide have discovered that Yocto
+ Project provides advantages in both systems and applications
+ development, archival and management benefits, and customizations
+ used for speed, footprint, and memory utilization.
+ The project is a standard when it comes to delivering embedded
+ software stacks.
+ The project allows software customizations and build interchange
+ for multiple hardware platforms as well as software stacks that
+ can be maintained and scaled.
+ </para>
+
+ <para id='yp-key-dev-elements'>
+ <imagedata fileref="figures/key-dev-elements.png" format="PNG" align='center' width="8in"/>
+ </para>
+
+ <para>
+ For further introductory information on the Yocto Project, you
+ might be interested in this
+ <ulink url='https://www.embedded.com/electronics-blogs/say-what-/4458600/Why-the-Yocto-Project-for-my-IoT-Project-'>article</ulink>
+ by Drew Moseley and in this short introductory
+ <ulink url='https://www.youtube.com/watch?v=utZpKM7i5Z4'>video</ulink>.
+ </para>
+
+ <para>
+ The remainder of this section overviews advantages and challenges
+ tied to the Yocto Project.
+ </para>
+
+ <section id='gs-features'>
+ <title>Features</title>
+
+ <para>
+ The following list describes features and advantages of the
+ Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Widely Adopted Across the Industry:</emphasis>
+ Semiconductor, operating system, software, and
+ service vendors exist whose products and services
+ adopt and support the Yocto Project.
+ For a look at the Yocto Project community and
+ the companies involved with the Yocto
+ Project, see the "COMMUNITY" and "ECOSYSTEM" tabs
+ on the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project</ulink>
+ home page.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Architecture Agnostic:</emphasis>
+ Yocto Project supports Intel, ARM, MIPS, AMD, PPC
+ and other architectures.
+ Most ODMs, OSVs, and chip vendors create and supply
+ BSPs that support their hardware.
+ If you have custom silicon, you can create a BSP
+ that supports that architecture.</para>
+
+ <para>Aside from lots of architecture support, the
+ Yocto Project fully supports a wide range of device
+ emulation through the Quick EMUlator (QEMU).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Images and Code Transfer Easily:</emphasis>
+ Yocto Project output can easily move between
+ architectures without moving to new development
+ environments.
+ Additionally, if you have used the Yocto Project to
+ create an image or application and you find yourself
+ not able to support it, commercial Linux vendors such
+ as Wind River, Mentor Graphics, Timesys, and ENEA could
+ take it and provide ongoing support.
+ These vendors have offerings that are built using
+ the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Flexibility:</emphasis>
+ Corporations use the Yocto Project many different ways.
+ One example is to create an internal Linux distribution
+ as a code base the corporation can use across multiple
+ product groups.
+ Through customization and layering, a project group
+ can leverage the base Linux distribution to create
+ a distribution that works for their product needs.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Ideal for Constrained Embedded and IoT devices:</emphasis>
+ Unlike a full Linux distribution, you can use the
+ Yocto Project to create exactly what you need for
+ embedded devices.
+ You only add the feature support or packages that you
+ absolutely need for the device.
+ For devices that have display hardware, you can use
+ available system components such as X11, GTK+, Qt,
+ Clutter, and SDL (among others) to create a rich user
+ experience.
+ For devices that do not have a display or where you
+ want to use alternative UI frameworks, you can choose
+ to not install these components.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Comprehensive Toolchain Capabilities:</emphasis>
+ Toolchains for supported architectures satisfy most
+ use cases.
+ However, if your hardware supports features that are
+ not part of a standard toolchain, you can easily
+ customize that toolchain through specification of
+ platform-specific tuning parameters.
+ And, should you need to use a third-party toolchain,
+ mechanisms built into the Yocto Project allow for that.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Mechanism Rules Over Policy:</emphasis>
+ Focusing on mechanism rather than policy ensures that
+ you are free to set policies based on the needs of your
+ design instead of adopting decisions enforced by some
+ system software provider.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Uses a Layer Model:</emphasis>
+ The Yocto Project
+ <link linkend='the-yocto-project-layer-model'>layer infrastructure</link>
+ groups related functionality into separate bundles.
+ You can incrementally add these grouped functionalities
+ to your project as needed.
+ Using layers to isolate and group functionality
+ reduces project complexity and redundancy, allows you
+ to easily extend the system, make customizations,
+ and keep functionality organized.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Supports Partial Builds:</emphasis>
+ You can build and rebuild individual packages as
+ needed.
+ Yocto Project accomplishes this through its
+ <link linkend='shared-state-cache'>shared-state cache</link>
+ (sstate) scheme.
+ Being able to build and debug components individually
+ eases project development.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Releases According to a Strict Schedule:</emphasis>
+ Major releases occur on a
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-release-process'>six-month cycle</ulink>
+ predictably in October and April.
+ The most recent two releases support point releases
+ to address common vulnerabilities and exposures.
+ This predictability is crucial for projects based on
+ the Yocto Project and allows development teams to
+ plan activities.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Rich Ecosystem of Individuals and Organizations:</emphasis>
+ For open source projects, the value of community is
+ very important.
+ Support forums, expertise, and active developers who
+ continue to push the Yocto Project forward are readily
+ available.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Binary Reproducibility:</emphasis>
+ The Yocto Project allows you to be very specific about
+ dependencies and achieves very high percentages of
+ binary reproducibility (e.g. 99.8% for
+ <filename>core-image-minimal</filename>).
+ When distributions are not specific about which
+ packages are pulled in and in what order to support
+ dependencies, other build systems can arbitrarily
+ include packages.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>License Manifest:</emphasis>
+ The Yocto Project provides a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>license manifest</ulink>
+ for review by people who need to track the use of open
+ source licenses (e.g.legal teams).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='gs-challenges'>
+ <title>Challenges</title>
+
+ <para>
+ The following list presents challenges you might encounter
+ when developing using the Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Steep Learning Curve:</emphasis>
+ The Yocto Project has a steep learning curve and has
+ many different ways to accomplish similar tasks.
+ It can be difficult to choose how to proceed when
+ varying methods exist by which to accomplish a given
+ task.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Understanding What Changes You Need to Make
+ For Your Design Requires Some Research:</emphasis>
+ Beyond the simple tutorial stage, understanding what
+ changes need to be made for your particular design
+ can require a significant amount of research and
+ investigation.
+ For information that helps you transition from
+ trying out the Yocto Project to using it for your
+ project, see the
+ "<ulink url='&YOCTO_HOME_URL;/docs/what-i-wish-id-known/'>What I wish I'd Known</ulink>"
+ and
+ "<ulink url='&YOCTO_HOME_URL;/docs/transitioning-to-a-custom-environment/'>Transitioning to a Custom Environment for Systems Development</ulink>"
+ documents on the Yocto Project website.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Project Workflow Could Be Confusing:</emphasis>
+ The
+ <link linkend='overview-development-environment'>Yocto Project workflow</link>
+ could be confusing if you are used to traditional
+ desktop and server software development.
+ In a desktop development environment, mechanisms exist
+ to easily pull and install new packages, which are
+ typically pre-compiled binaries from servers accessible
+ over the Internet.
+ Using the Yocto Project, you must modify your
+ configuration and rebuild to add additional packages.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Working in a Cross-Build Environment Can
+ Feel Unfamiliar:</emphasis>
+ When developing code to run on a target, compilation,
+ execution, and testing done on the actual target
+ can be faster than running a BitBake build on a
+ development host and then deploying binaries to the
+ target for test.
+ While the Yocto Project does support development tools
+ on the target, the additional step of integrating your
+ changes back into the Yocto Project build environment
+ would be required.
+ Yocto Project supports an intermediate approach that
+ involves making changes on the development system
+ within the BitBake environment and then deploying only
+ the updated packages to the target.</para>
+
+ <para>The Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ produces packages in standard formats (i.e. RPM,
+ DEB, IPK, and TAR).
+ You can deploy these packages into the running system
+ on the target by using utilities on the target such
+ as <filename>rpm</filename> or
+ <filename>ipk</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Initial Build Times Can be Significant:</emphasis>
+ Long initial build times are unfortunately unavoidable
+ due to the large number of packages initially built
+ from scratch for a fully functioning Linux system.
+ Once that initial build is completed, however, the
+ shared-state (sstate) cache mechanism Yocto Project
+ uses keeps the system from rebuilding packages that
+ have not been "touched" since the last build.
+ The sstate mechanism significantly reduces times
+ for successive builds.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='the-yocto-project-layer-model'>
+ <title>The Yocto Project Layer Model</title>
+
+ <para>
+ The Yocto Project's "Layer Model" is a development model for
+ embedded and IoT Linux creation that distinguishes the
+ Yocto Project from other simple build systems.
+ The Layer Model simultaneously supports collaboration and
+ customization.
+ Layers are repositories that contain related sets of instructions
+ that tell the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ what to do.
+ You can collaborate, share, and reuse layers.
+ </para>
+
+ <para>
+ Layers can contain changes to previous instructions or settings
+ at any time.
+ This powerful override capability is what allows you to customize
+ previously supplied collaborative or community layers to suit your
+ product requirements.
+ </para>
+
+ <para>
+ You use different layers to logically separate information in your
+ build.
+ As an example, you could have BSP, GUI, distro configuration,
+ middleware, or application layers.
+ Putting your entire build into one layer limits and complicates
+ future customization and reuse.
+ Isolating information into layers, on the other hand, helps
+ simplify future customizations and reuse.
+ You might find it tempting to keep everything in one layer when
+ working on a single project.
+ However, the more modular your Metadata, the easier
+ it is to cope with future changes.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Use Board Support Package (BSP) layers from silicon
+ vendors when possible.
+ </para></listitem>
+ <listitem><para>
+ Familiarize yourself with the
+ <ulink url='https://caffelli-staging.yoctoproject.org/software-overview/layers/'>Yocto Project curated layer index</ulink>
+ or the
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layers/'>OpenEmbedded layer index</ulink>.
+ The latter contains more layers but they are less
+ universally validated.
+ </para></listitem>
+ <listitem><para>
+ Layers support the inclusion of technologies, hardware
+ components, and software components.
+ The
+ <ulink url='&YOCTO_DOCS_DEV_URL;#making-sure-your-layer-is-compatible-with-yocto-project'>Yocto Project Compatible</ulink>
+ designation provides a minimum level of standardization
+ that contributes to a strong ecosystem.
+ "YP Compatible" is applied to appropriate products and
+ software components such as BSPs, other OE-compatible
+ layers, and related open-source projects, allowing the
+ producer to use Yocto Project badges and branding
+ assets.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ To illustrate how layers are used to keep things modular, consider
+ machine customizations.
+ These types of customizations typically reside in a special layer,
+ rather than a general layer, called a BSP Layer.
+ Furthermore, the machine customizations should be isolated from
+ recipes and Metadata that support a new GUI environment,
+ for example.
+ This situation gives you a couple of layers: one for the machine
+ configurations, and one for the GUI environment.
+ It is important to understand, however, that the BSP layer can
+ still make machine-specific additions to recipes within the GUI
+ environment layer without polluting the GUI layer itself
+ with those machine-specific changes.
+ You can accomplish this through a recipe that is a BitBake append
+ (<filename>.bbappend</filename>) file, which is described later
+ in this section.
+ <note>
+ For general information on BSP layer structure, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Packages (BSP) Developer's Guide</ulink>.
+ </note>
+ </para>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ contains both general layers and BSP layers right out of the box.
+ You can easily identify layers that ship with a Yocto Project
+ release in the Source Directory by their names.
+ Layers typically have names that begin with the string
+ <filename>meta-</filename>.
+ <note>
+ It is not a requirement that a layer name begin with the
+ prefix <filename>meta-</filename>, but it is a commonly
+ accepted standard in the Yocto Project community.
+ </note>
+ For example, if you were to examine the
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/'>tree view</ulink>
+ of the <filename>poky</filename> repository, you will see several
+ layers: <filename>meta</filename>,
+ <filename>meta-skeleton</filename>,
+ <filename>meta-selftest</filename>,
+ <filename>meta-poky</filename>, and
+ <filename>meta-yocto-bsp</filename>.
+ Each of these repositories represents a distinct layer.
+ </para>
+
+ <para>
+ For procedures on how to create layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='components-and-tools'>
+ <title>Components and Tools</title>
+
+ <para>
+ The Yocto Project employs a collection of components and
+ tools used by the project itself, by project developers,
+ and by those using the Yocto Project.
+ These components and tools are open source projects and
+ metadata that are separate from the reference distribution
+ (<ulink url='&YOCTO_DOCS_REF_URL;#poky'>Poky</ulink>)
+ and the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ Most of the components and tools are downloaded separately.
+ </para>
+
+ <para>
+ This section provides brief overviews of the components and
+ tools associated with the Yocto Project.
+ </para>
+
+ <section id='gs-development-tools'>
+ <title>Development Tools</title>
+
+ <para>
+ The following list consists of tools that help you develop
+ images and applications using the Yocto Project:
+ <itemizedlist>
+ <listitem><para id='gs-crops-overview'>
+ <emphasis>CROPS:</emphasis>
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>
+ is an open source, cross-platform development framework
+ that leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>.
+ CROPS provides an easily managed, extensible environment
+ that allows you to build binaries for a variety of
+ architectures on Windows, Linux and Mac OS X hosts.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>devtool</filename>:</emphasis>
+ This command-line tool is available as part of the
+ extensible SDK (eSDK) and is its cornerstone.
+ You can use <filename>devtool</filename> to help build,
+ test, and package software within the eSDK.
+ You can use the tool to optionally integrate what you
+ build into an image built by the OpenEmbedded build
+ system.</para>
+
+ <para>The <filename>devtool</filename> command employs
+ a number of sub-commands that allow you to add, modify,
+ and upgrade recipes.
+ As with the OpenEmbedded build system, “recipesâ€
+ represent software packages within
+ <filename>devtool</filename>.
+ When you use <filename>devtool add</filename>, a recipe
+ is automatically created.
+ When you use <filename>devtool modify</filename>, the
+ specified existing recipe is used in order to determine
+ where to get the source code and how to patch it.
+ In both cases, an environment is set up so that when
+ you build the recipe a source tree that is under your
+ control is used in order to allow you to make changes
+ to the source as desired.
+ By default, both new recipes and the source go into
+ a “workspace†directory under the eSDK.
+ The <filename>devtool upgrade</filename> command
+ updates an existing recipe so that you can build it
+ for an updated set of source files.</para>
+
+ <para>You can read about the
+ <filename>devtool</filename> workflow in the Yocto
+ Project Application Development and Extensible
+ Software Development Kit (eSDK) Manual in the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#using-devtool-in-your-sdk-workflow'>Using <filename>devtool</filename> in Your SDK Workflow'</ulink>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Extensible Software Development Kit (eSDK):</emphasis>
+ The eSDK provides a cross-development toolchain and
+ libraries tailored to the contents of a specific image.
+ The eSDK makes it easy to add new applications and
+ libraries to an image, modify the source for an
+ existing component, test changes on the target
+ hardware, and integrate into the rest of the
+ OpenEmbedded build system.
+ The eSDK gives you a toolchain experience supplemented
+ with the powerful set of <filename>devtool</filename>
+ commands tailored for the Yocto Project environment.
+ </para>
+
+ <para>For information on the eSDK, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><trademark class='trade'>Eclipse</trademark> IDE Plug-in:</emphasis>
+ This plug-in enables you to use the popular Eclipse
+ Integrated Development Environment (IDE), which allows
+ for development using the Yocto Project all within the
+ Eclipse IDE.
+ You can work within Eclipse to cross-compile, deploy,
+ and execute your output into a QEMU emulation session
+ as well as onto actual target hardware.</para>
+
+ <para>The environment also supports performance
+ enhancing tools that allow you to perform remote
+ profiling, tracing, collection of power data,
+ collection of latency data, and collection of
+ performance data.</para>
+
+ <para>Once you enable the plug-in, standard Eclipse
+ functions automatically use the cross-toolchain
+ and target system libraries.
+ You can build applications using any of these
+ libraries.</para>
+
+ <para>For more information on the Eclipse plug-in,
+ see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#adt-eclipse'>Working Within Eclipse</ulink>"
+ section in the Yocto Project Application Development
+ and the Extensible Software Development Kit (eSDK)
+ manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Toaster:</emphasis>
+ Toaster is a web interface to the Yocto Project
+ OpenEmbedded build system.
+ Toaster allows you to configure, run, and view
+ information about builds.
+ For information on Toaster, see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='gs-production-tools'>
+ <title>Production Tools</title>
+
+ <para>
+ The following list consists of tools that help production
+ related activities using the Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Auto Upgrade Helper:</emphasis>
+ This utility when used in conjunction with the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ (BitBake and OE-Core) automatically generates upgrades
+ for recipes that are based on new versions of the
+ recipes published upstream.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Recipe Reporting System:</emphasis>
+ The Recipe Reporting System tracks recipe versions
+ available for Yocto Project.
+ The main purpose of the system is to help you
+ manage the recipes you maintain and to offer a dynamic
+ overview of the project.
+ The Recipe Reporting System is built on top of the
+ <ulink url="http://layers.openembedded.org/layerindex/layers/">OpenEmbedded Layer Index</ulink>,
+ which is a website that indexes OpenEmbedded-Core
+ layers.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Patchwork:</emphasis>
+ <ulink url='http://jk.ozlabs.org/projects/patchwork/'>Patchwork</ulink>
+ is a fork of a project originally started by
+ <ulink url='http://ozlabs.org/'>OzLabs</ulink>.
+ The project is a web-based tracking system designed
+ to streamline the process of bringing contributions
+ into a project.
+ The Yocto Project uses Patchwork as an organizational
+ tool to handle patches, which number in the thousands
+ for every release.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>AutoBuilder:</emphasis>
+ AutoBuilder is a project that automates build tests
+ and quality assurance (QA).
+ By using the public AutoBuilder, anyone can determine
+ the status of the current "master" branch of Poky.
+ <note>
+ AutoBuilder is based on
+ <ulink url='https://buildbot.net/'>buildbot</ulink>.
+ </note></para>
+
+ <para>A goal of the Yocto Project is to lead the
+ open source industry with a project that automates
+ testing and QA procedures.
+ In doing so, the project encourages a development
+ community that publishes QA and test plans, publicly
+ demonstrates QA and test plans, and encourages
+ development of tools that automate and test and QA
+ procedures for the benefit of the development
+ community.</para>
+
+ <para>You can learn more about the AutoBuilder used
+ by the Yocto Project
+ <ulink url='&YOCTO_AB_URL;'>here</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Cross-Prelink:</emphasis>
+ Prelinking is the process of pre-computing the load
+ addresses and link tables generated by the dynamic
+ linker as compared to doing this at runtime.
+ Doing this ahead of time results in performance
+ improvements when the application is launched and
+ reduced memory usage for libraries shared by many
+ applications.</para>
+
+ <para>Historically, cross-prelink is a variant of
+ prelink, which was conceived by
+ <ulink url='http://people.redhat.com/jakub/prelink.pdf'>Jakub Jel&iacute;nek</ulink>
+ a number of years ago.
+ Both prelink and cross-prelink are maintained in the
+ same repository albeit on separate branches.
+ By providing an emulated runtime dynamic linker
+ (i.e. <filename>glibc</filename>-derived
+ <filename>ld.so</filename> emulation), the
+ cross-prelink project extends the prelink software’s
+ ability to prelink a sysroot environment.
+ Additionally, the cross-prelink software enables the
+ ability to work in sysroot style environments.</para>
+
+ <para>The dynamic linker determines standard load
+ address calculations based on a variety of factors
+ such as mapping addresses, library usage, and library
+ function conflicts.
+ The prelink tool uses this information, from the
+ dynamic linker, to determine unique load addresses
+ for executable and linkable format (ELF) binaries
+ that are shared libraries and dynamically linked.
+ The prelink tool modifies these ELF binaries with the
+ pre-computed information.
+ The result is faster loading and often lower memory
+ consumption because more of the library code can
+ be re-used from shared Copy-On-Write (COW) pages.
+ </para>
+
+ <para>The original upstream prelink project only
+ supports running prelink on the end target device
+ due to the reliance on the target device’s dynamic
+ linker.
+ This restriction causes issues when developing a
+ cross-compiled system.
+ The cross-prelink adds a synthesized dynamic loader
+ that runs on the host, thus permitting cross-prelinking
+ without ever having to run on a read-write target
+ filesystem.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Pseudo:</emphasis>
+ Pseudo is the Yocto Project implementation of
+ <ulink url='http://man.he.net/man1/fakeroot'>fakeroot</ulink>,
+ which is used to run commands in an environment
+ that seemingly has root privileges.</para>
+
+ <para>During a build, it can be necessary to perform
+ operations that require system administrator
+ privileges.
+ For example, file ownership or permissions might need
+ definition.
+ Pseudo is a tool that you can either use directly or
+ through the environment variable
+ <filename>LD_PRELOAD</filename>.
+ Either method allows these operations to succeed as
+ if system administrator privileges exist even
+ when they do not.</para>
+
+ <para>You can read more about Pseudo in the
+ "<link linkend='fakeroot-and-pseudo'>Fakeroot and Pseudo</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='gs-openembedded-build-system'>
+ <title>Open-Embedded Build System Components</title>
+
+ <para>
+ The following list consists of components associated with the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>BitBake:</emphasis>
+ BitBake is a core component of the Yocto Project and is
+ used by the OpenEmbedded build system to build images.
+ While BitBake is key to the build system, BitBake
+ is maintained separately from the Yocto Project.</para>
+
+ <para>BitBake is a generic task execution engine that
+ allows shell and Python tasks to be run efficiently
+ and in parallel while working within complex inter-task
+ dependency constraints.
+ In short, BitBake is a build engine that works
+ through recipes written in a specific format in order
+ to perform sets of tasks.</para>
+
+ <para>You can learn more about BitBake in the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>OpenEmbedded-Core:</emphasis>
+ OpenEmbedded-Core (OE-Core) is a common layer of
+ metadata (i.e. recipes, classes, and associated files)
+ used by OpenEmbedded-derived systems, which includes
+ the Yocto Project.
+ The Yocto Project and the OpenEmbedded Project both
+ maintain the OpenEmbedded-Core.
+ You can find the OE-Core metadata in the Yocto Project
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta'>Source Repositories</ulink>.
+ </para>
+
+ <para>Historically, the Yocto Project integrated the
+ OE-Core metadata throughout the Yocto Project
+ source repository reference system (Poky).
+ After Yocto Project Version 1.0, the Yocto Project
+ and OpenEmbedded agreed to work together and share a
+ common core set of metadata (OE-Core), which contained
+ much of the functionality previously found in Poky.
+ This collaboration achieved a long-standing
+ OpenEmbedded objective for having a more tightly
+ controlled and quality-assured core.
+ The results also fit well with the Yocto Project
+ objective of achieving a smaller number of fully
+ featured tools as compared to many different ones.
+ </para>
+
+ <para>Sharing a core set of metadata results in Poky
+ as an integration layer on top of OE-Core.
+ You can see that in this
+ <link linkend='yp-key-dev-elements'>figure</link>.
+ The Yocto Project combines various components such as
+ BitBake, OE-Core, script “glueâ€, and documentation
+ for its build system.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='gs-reference-distribution-poky'>
+ <title>Reference Distribution (Poky)</title>
+
+ <para>
+ Poky is the Yocto Project reference distribution.
+ It contains the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>Open-Embedded build system</ulink>
+ (BitBake and OE-Core) as well as a set of metadata to get you
+ started building your own distribution.
+ See the
+ <link linkend='what-is-the-yocto-project'>figure</link> in
+ "What is the Yocto Project?" section for an illustration
+ that shows Poky and its relationship with other parts of the
+ Yocto Project.</para>
+
+ <para>To use the Yocto Project tools and components, you
+ can download (<filename>clone</filename>) Poky and use it
+ to bootstrap your own distribution.
+ <note>
+ Poky does not contain binary files.
+ It is a working example of how to build your own custom
+ Linux distribution from source.
+ </note>
+ You can read more about Poky in the
+ "<link linkend='reference-embedded-distribution'>Reference Embedded Distribution (Poky)</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='gs-packages-for-finished-targets'>
+ <title>Packages for Finished Targets</title>
+
+ <para>
+ The following lists components associated with packages
+ for finished targets:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Matchbox:</emphasis>
+ Matchbox is an Open Source, base environment for the
+ X Window System running on non-desktop, embedded
+ platforms such as handhelds, set-top boxes, kiosks,
+ and anything else for which screen space, input
+ mechanisms, or system resources are limited.</para>
+
+ <para>Matchbox consists of a number of interchangeable
+ and optional applications that you can tailor to a
+ specific, non-desktop platform to enhance usability
+ in constrained environments.</para>
+
+ <para>You can find the Matchbox source in the Yocto
+ Project
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Opkg</emphasis>
+ Open PacKaGe management (opkg) is a lightweight
+ package management system based on the itsy package
+ (ipkg) management system.
+ Opkg is written in C and resembles Advanced Package
+ Tool (APT) and Debian Package (dpkg) in operation.
+ </para>
+
+ <para>Opkg is intended for use on embedded Linux
+ devices and is used in this capacity in the
+ <ulink url='http://www.openembedded.org/wiki/Main_Page'>OpenEmbedded</ulink>
+ and
+ <ulink url='https://openwrt.org/'>OpenWrt</ulink>
+ projects, as well as the Yocto Project.
+ <note>
+ As best it can, opkg maintains backwards
+ compatibility with ipkg and conforms to a subset
+ of Debian’s policy manual regarding control files.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='gs-archived-components'>
+ <title>Archived Components</title>
+
+ <para>
+ The Build Appliance is a virtual machine image that enables
+ you to build and boot a custom embedded Linux image with
+ the Yocto Project using a non-Linux development system.
+ </para>
+
+ <para>
+ Historically, the Build Appliance was the second of three
+ methods by which you could use the Yocto Project on a system
+ that was not native to Linux.
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Hob:</emphasis>
+ Hob, which is now deprecated and is no longer available
+ since the 2.1 release of the Yocto Project provided
+ a rudimentary, GUI-based interface to the Yocto
+ Project.
+ Toaster has fully replaced Hob.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build Appliance:</emphasis>
+ Post Hob, the Build Appliance became available.
+ It was never recommended that you use the Build
+ Appliance as a day-to-day production development
+ environment with the Yocto Project.
+ Build Appliance was useful as a way to try out
+ development in the Yocto Project environment.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>CROPS:</emphasis>
+ The final and best solution available now for
+ developing using the Yocto Project on a system
+ not native to Linux is with
+ <link linkend='gs-crops-overview'>CROPS</link>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='gs-development-methods'>
+ <title>Development Methods</title>
+
+ <para>
+ The Yocto Project development environment usually involves a
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink>
+ and target hardware.
+ You use the Build Host to build images and develop applications,
+ while you use the target hardware to test deployed software.
+ </para>
+
+ <para>
+ This section provides an introduction to the choices or
+ development methods you have when setting up your Build Host.
+ Depending on the your particular workflow preference and the
+ type of operating system your Build Host runs, several choices
+ exist that allow you to use the Yocto Project.
+ <note>
+ For additional detail about the Yocto Project development
+ environment, see the
+ "<link linkend='overview-development-environment'>The Yocto Project Development Environment</link>"
+ chapter.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Native Linux Host:</emphasis>
+ By far the best option for a Build Host.
+ A system running Linux as its native operating system
+ allows you to develop software by directly using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink>
+ tool.
+ You can accomplish all aspects of development from a
+ familiar shell of a supported Linux distribution.</para>
+
+ <para>For information on how to set up a Build Host on
+ a system running Linux as its native operating system,
+ see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-a-native-linux-host'>Setting Up a Native Linux Host</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>CROss PlatformS (CROPS):</emphasis>
+ Typically, you use
+ <ulink url='https://git.yoctoproject.org/cgit/cgit.cgi/crops/about/'>CROPS</ulink>,
+ which leverages
+ <ulink url='https://www.docker.com/'>Docker Containers</ulink>,
+ to set up a Build Host that is not running Linux (e.g.
+ <trademark class='registered'>Microsoft</trademark>
+ <trademark class='trademark'>Windows</trademark>
+ or
+ <trademark class='registered'>macOS</trademark>).
+ <note>
+ You can, however, use CROPS on a Linux-based system.
+ </note>
+ CROPS is an open source, cross-platform development
+ framework that provides an easily managed, extensible
+ environment for building binaries targeted for a variety
+ of architectures on Windows, macOS, or Linux hosts.
+ Once the Build Host is set up using CROPS, you can prepare
+ a shell environment to mimic that of a shell being used
+ on a system natively running Linux.</para>
+
+ <para>For information on how to set up a Build Host with
+ CROPS, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-to-use-crops'>Setting Up to Use CROss PlatformS (CROPS)</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Toaster:</emphasis>
+ Regardless of what your Build Host is running, you can
+ use Toaster to develop software using the Yocto Project.
+ Toaster is a web interface to the Yocto Project's
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>Open-Embedded build system</ulink>.
+ The interface enables you to configure and run your
+ builds.
+ Information about builds is collected and stored in a
+ database.
+ You can use Toaster to configure and start builds on
+ multiple remote build servers.</para>
+
+ <para>For information about and how to use Toaster,
+ see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><trademark class='trade'>Eclipse</trademark> IDE:</emphasis>
+ If your Build Host supports and runs the popular
+ Eclipse IDE, you can install the Yocto Project Eclipse
+ plug-in and use the Yocto Project to develop software.
+ The plug-in integrates the Yocto Project functionality
+ into Eclipse development practices.</para>
+
+ <para>For information about how to install and use the
+ Yocto Project Eclipse plug-in, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-eclipse-project'>Developing Applications Using Eclipse</ulink>"
+ chapter in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='reference-embedded-distribution'>
+ <title>Reference Embedded Distribution (Poky)</title>
+
+ <para>
+ "Poky", which is pronounced <emphasis>Pock</emphasis>-ee, is the
+ name of the Yocto Project's reference distribution or Reference OS
+ Kit.
+ Poky contains the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded Build System</ulink>
+ (<ulink url='&YOCTO_DOCS_REF_URL;#bitbake-term'>BitBake</ulink> and
+ <ulink url='&YOCTO_DOCS_REF_URL;#oe-core'>OpenEmbedded-Core</ulink>)
+ as well as a set of
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>metadata</ulink> to get
+ you started building your own distro.
+ In other words, Poky is a base specification of the functionality
+ needed for a typical embedded system as well as the components
+ from the Yocto Project that allow you to build a distribution into
+ a usable binary image.
+ </para>
+
+ <para>
+ Poky is a combined repository of BitBake, OpenEmbedded-Core
+ (which is found in <filename>meta</filename>),
+ <filename>meta-poky</filename>,
+ <filename>meta-yocto-bsp</filename>, and documentation provided
+ all together and known to work well together.
+ You can view these items that make up the Poky repository in the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/'>Source Repositories</ulink>.
+ <note>
+ If you are interested in all the contents of the
+ <filename>poky</filename> Git repository, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#structure-core'>Top-Level Core Components</ulink>"
+ section in the Yocto Project Reference Manual.
+ </note>
+ </para>
+
+ <para id='gs-poky-reference-distribution'>
+ The following figure illustrates what generally comprises Poky:
+ <imagedata fileref="figures/poky-reference-distribution.png" format="PNG" align='center' width="8in"/>
+ <itemizedlist>
+ <listitem><para>
+ BitBake is a task executor and scheduler that is the heart of
+ the OpenEmbedded build system.
+ </para></listitem>
+ <listitem><para>
+ <filename>meta-poky</filename>, which is Poky-specific
+ metadata.
+ </para></listitem>
+ <listitem><para>
+ <filename>meta-yocto-bsp</filename>, which are Yocto
+ Project-specific Board Support Packages (BSPs).
+ </para></listitem>
+ <listitem><para>
+ OpenEmbedded-Core (OE-Core) metadata, which includes
+ shared configurations, global variable definitions,
+ shared classes, packaging, and recipes.
+ Classes define the encapsulation and inheritance of build
+ logic.
+ Recipes are the logical units of software and images
+ to be built.
+ </para></listitem>
+ <listitem><para>
+ Documentation, which contains the Yocto Project source
+ files used to make the set of user manuals.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ While Poky is a "complete" distribution specification and is
+ tested and put through QA, you cannot use it as a product
+ "out of the box" in its current form.
+ </note>
+ </para>
+
+ <para>
+ To use the Yocto Project tools, you can use Git to clone (download)
+ the Poky repository then use your local copy of the reference
+ distribution to bootstrap your own distribution.
+ <note>
+ Poky does not contain binary files.
+ It is a working example of how to build your own custom Linux distribution
+ from source.
+ </note>
+ </para>
+
+ <para>
+ Poky has a regular, well established, six-month release cycle
+ under its own version.
+ Major releases occur at the same time major releases (point
+ releases) occur for the Yocto Project, which are typically in the
+ Spring and Fall.
+ For more information on the Yocto Project release schedule and
+ cadence, see the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-release-process'>Yocto Project Releases and the Stable Release Process</ulink>"
+ chapter in the Yocto Project Reference Manual.
+ </para>
+
+ <para>
+ Much has been said about Poky being a "default configuration."
+ A default configuration provides a starting image footprint.
+ You can use Poky out of the box to create an image ranging from a
+ shell-accessible minimal image all the way up to a Linux
+ Standard Base-compliant image that uses a GNOME Mobile and
+ Embedded (GMAE) based reference user interface called Sato.
+ </para>
+
+ <para>
+ One of the most powerful properties of Poky is that every aspect
+ of a build is controlled by the metadata.
+ You can use metadata to augment these base image types by
+ adding metadata
+ <link linkend='the-yocto-project-layer-model'>layers</link>
+ that extend functionality.
+ These layers can provide, for example, an additional software
+ stack for an image type, add a board support package (BSP) for
+ additional hardware, or even create a new image type.
+ </para>
+
+ <para>
+ Metadata is loosely grouped into configuration files or package
+ recipes.
+ A recipe is a collection of non-executable metadata used by
+ BitBake to set variables or define additional build-time tasks.
+ A recipe contains fields such as the recipe description, the recipe
+ version, the license of the package and the upstream source
+ repository.
+ A recipe might also indicate that the build process uses autotools,
+ make, distutils or any other build process, in which case the basic
+ functionality can be defined by the classes it inherits from
+ the OE-Core layer's class definitions in
+ <filename>./meta/classes</filename>.
+ Within a recipe you can also define additional tasks as well as
+ task prerequisites.
+ Recipe syntax through BitBake also supports both
+ <filename>_prepend</filename> and <filename>_append</filename>
+ operators as a method of extending task functionality.
+ These operators inject code into the beginning or end of a task.
+ For information on these BitBake operators, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#appending-and-prepending-override-style-syntax'>Appending and Prepending (Override Style Syntax)</ulink>"
+ section in the BitBake User's Manual.
+ </para>
+ </section>
+
+ <section id='openembedded-build-system-workflow'>
+ <title>The OpenEmbedded Build System Workflow</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>
+ uses a "workflow" to accomplish image and SDK generation.
+ The following figure overviews that workflow:
+ <imagedata fileref="figures/YP-flow-diagram.png"
+ format="PNG" align='center' width="8in"/>
+ Following is a brief summary of the "workflow":
+ <orderedlist>
+ <listitem><para>
+ Developers specify architecture, policies, patches and
+ configuration details.
+ </para></listitem>
+ <listitem><para>
+ The build system fetches and downloads the source code
+ from the specified location.
+ The build system supports standard methods such as tarballs
+ or source code repositories systems such as Git.
+ </para></listitem>
+ <listitem><para>
+ Once source code is downloaded, the build system extracts
+ the sources into a local work area where patches are
+ applied and common steps for configuring and compiling
+ the software are run.
+ </para></listitem>
+ <listitem><para>
+ The build system then installs the software into a
+ temporary staging area where the binary package format you
+ select (DEB, RPM, or IPK) is used to roll up the software.
+ </para></listitem>
+ <listitem><para>
+ Different QA and sanity checks run throughout entire
+ build process.
+ </para></listitem>
+ <listitem><para>
+ After the binaries are created, the build system
+ generates a binary package feed that is used to create
+ the final root file image.
+ </para></listitem>
+ <listitem><para>
+ The build system generates the file system image and a
+ customized Extensible SDK (eSDSK) for application
+ development in parallel.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ For a very detailed look at this workflow, see the
+ "<link linkend='openembedded-build-system-build-concepts'>OpenEmbedded Build System Concepts</link>"
+ section.
+ </para>
+ </section>
+
+
+ <section id='some-basic-terms'>
+ <title>Some Basic Terms</title>
+
+ <para>
+ It helps to understand some basic fundamental terms when
+ learning the Yocto Project.
+ Although a list of terms exists in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-terms'>Yocto Project Terms</ulink>"
+ section of the Yocto Project Reference Manual, this section
+ provides the definitions of some terms helpful for getting started:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Configuration Files:</emphasis>
+ Files that hold global definitions of variables,
+ user-defined variables, and hardware configuration
+ information.
+ These files tell the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>Open-Embedded build system</ulink>
+ what to build and what to put into the image to support a
+ particular platform.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Extensible Software Development Kit (eSDK):</emphasis>
+ A custom SDK for application developers.
+ This eSDK allows developers to incorporate their library
+ and programming changes back into the image to make
+ their code available to other application developers.
+ For information on the eSDK, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Layer:</emphasis>
+ A collection of related recipes.
+ Layers allow you to consolidate related metadata to
+ customize your build.
+ Layers also isolate information used when building
+ for multiple architectures.
+ Layers are hierarchical in their ability to override
+ previous specifications.
+ You can include any number of available layers from the
+ Yocto Project and customize the build by adding your
+ layers after them.
+ You can search the Layer Index for layers used within
+ Yocto Project.</para>
+
+ <para>For more detailed information on layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For a discussion specifically on BSP Layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support Packages (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Metadata:</emphasis>
+ A key element of the Yocto Project is the Metadata that
+ is used to construct a Linux distribution and is contained
+ in the files that the OpenEmbedded build system parses
+ when building an image.
+ In general, Metadata includes recipes, configuration
+ files, and other information that refers to the build
+ instructions themselves, as well as the data used to
+ control what things get built and the effects of the
+ build.
+ Metadata also includes commands and data used to
+ indicate what versions of software are used, from
+ where they are obtained, and changes or additions to the
+ software itself (patches or auxiliary files) that
+ are used to fix bugs or customize the software for use
+ in a particular situation.
+ OpenEmbedded-Core is an important set of validated
+ metadata.
+ </para></listitem>
+ <listitem><para id='gs-term-openembedded-build-system'>
+ <emphasis>OpenEmbedded Build System:</emphasis>
+ The terms "BitBake" and "build system" are sometimes
+ used for the OpenEmbedded Build System.</para>
+
+ <para>BitBake is a task scheduler and execution engine
+ that parses instructions (i.e. recipes) and configuration
+ data.
+ After a parsing phase, BitBake creates a dependency tree
+ to order the compilation, schedules the compilation of
+ the included code, and finally executes the building
+ of the specified custom Linux image (distribution).
+ BitBake is similar to the <filename>make</filename>
+ tool.</para>
+
+ <para>During a build process, the build system tracks
+ dependencies and performs a native or cross-compilation
+ of the package.
+ As a first step in a cross-build setup, the framework
+ attempts to create a cross-compiler toolchain
+ (i.e. Extensible SDK) suited for the target platform.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>OpenEmbedded-Core (OE-Core):</emphasis>
+ OE-Core is metadata comprised of foundation recipes,
+ classes, and associated files that are meant to be
+ common among many different OpenEmbedded-derived systems,
+ including the Yocto Project.
+ OE-Core is a curated subset of an original repository
+ developed by the OpenEmbedded community that has been
+ pared down into a smaller, core set of continuously
+ validated recipes.
+ The result is a tightly controlled and quality-assured
+ core set of recipes.</para>
+
+ <para>You can see the Metadata in the
+ <filename>meta</filename> directory of the Yocto Project
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Source Repositories</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Packages:</emphasis>
+ In the context of the Yocto Project, this term refers to a
+ recipe's packaged output produced by BitBake (i.e. a
+ "baked recipe").
+ A package is generally the compiled binaries produced from the
+ recipe's sources.
+ You "bake" something by running it through BitBake.</para>
+
+ <para>It is worth noting that the term "package" can,
+ in general, have subtle meanings.
+ For example, the packages referred to in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
+ section in the Yocto Project Reference Manual are compiled
+ binaries that, when installed, add functionality to your
+ Linux distribution.</para>
+
+ <para>Another point worth noting is that historically within
+ the Yocto Project, recipes were referred to as packages - thus,
+ the existence of several BitBake variables that are seemingly
+ mis-named,
+ (e.g. <ulink url='&YOCTO_DOCS_REF_URL;#var-PR'><filename>PR</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PV'><filename>PV</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PE'><filename>PE</filename></ulink>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Poky:</emphasis>
+ Poky is a reference embedded distribution and a reference
+ test configuration.
+ Poky provides the following:
+ <itemizedlist>
+ <listitem><para>
+ A base-level functional distro used to illustrate
+ how to customize a distribution.
+ </para></listitem>
+ <listitem><para>
+ A means by which to test the Yocto Project
+ components (i.e. Poky is used to validate
+ the Yocto Project).
+ </para></listitem>
+ <listitem><para>
+ A vehicle through which you can download
+ the Yocto Project.
+ </para></listitem>
+ </itemizedlist>
+ Poky is not a product level distro.
+ Rather, it is a good starting point for customization.
+ <note>
+ Poky is an integration layer on top of OE-Core.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Recipe:</emphasis>
+ The most common form of metadata.
+ A recipe contains a list of settings and tasks
+ (i.e. instructions) for building packages that are then
+ used to build the binary image.
+ A recipe describes where you get source code and which
+ patches to apply.
+ Recipes describe dependencies for libraries or for other
+ recipes as well as configuration and compilation options.
+ Related recipes are consolidated into a layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/overview-manual/overview-manual.xml b/poky/documentation/overview-manual/overview-manual.xml
new file mode 100644
index 000000000..c283f9a37
--- /dev/null
+++ b/poky/documentation/overview-manual/overview-manual.xml
@@ -0,0 +1,108 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='overview-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/overview-manual-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Overview and Concepts Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>The initial document released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">
+ Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by
+ Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Overview and Concepts Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="overview-manual-intro.xml"/>
+
+ <xi:include href="overview-manual-yp-intro.xml"/>
+
+ <xi:include href="overview-manual-development-environment.xml"/>
+
+ <xi:include href="overview-manual-concepts.xml" />
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/poky.ent b/poky/documentation/poky.ent
new file mode 100644
index 000000000..49b19008f
--- /dev/null
+++ b/poky/documentation/poky.ent
@@ -0,0 +1,85 @@
+<!ENTITY DISTRO "2.5">
+<!ENTITY DISTRO_COMPRESSED "25">
+<!ENTITY DISTRO_NAME_NO_CAP "sumo">
+<!ENTITY DISTRO_NAME "Sumo">
+<!ENTITY DISTRO_NAME_NO_CAP_MINUS_ONE "rocko">
+<!ENTITY DISTRO_NAME_MINUS_ONE "Rocko">
+<!ENTITY YOCTO_DOC_VERSION "2.5">
+<!ENTITY YOCTO_DOC_VERSION_MINUS_ONE "2.4">
+<!ENTITY DISTRO_REL_TAG "yocto-2.5">
+<!ENTITY METAINTELVERSION "9.0">
+<!ENTITY REL_MONTH_YEAR "May 2018">
+<!ENTITY META_INTEL_REL_TAG "&METAINTELVERSION;-&DISTRO_NAME_NO_CAP;-&YOCTO_DOC_VERSION;">
+<!ENTITY POKYVERSION "20.0.0">
+<!ENTITY POKYVERSION_COMPRESSED "2000">
+<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME_NO_CAP;-&POKYVERSION;">
+<!ENTITY COPYRIGHT_YEAR "2010-2018">
+<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
+<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
+<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
+<!ENTITY YOCTO_BUGZILLA_URL "http://bugzilla.yoctoproject.org">
+<!ENTITY YOCTO_WIKI_URL "https://wiki.yoctoproject.org">
+<!ENTITY YOCTO_AB_URL "http://autobuilder.yoctoproject.org">
+<!ENTITY YOCTO_GIT_URL "http://git.yoctoproject.org">
+<!ENTITY YOCTO_ADTREPO_URL "http://adtrepo.yoctoproject.org">
+<!ENTITY OE_HOME_URL "http://www.openembedded.org">
+<!ENTITY OE_LISTS_URL "http://lists.openembedded.org/mailman">
+<!ENTITY OE_DOCS_URL "http://docs.openembedded.org">
+<!ENTITY OH_HOME_URL "http://o-hand.com">
+<!ENTITY BITBAKE_HOME_URL "http://developer.berlios.de/projects/bitbake/">
+<!ENTITY ECLIPSE_MAIN_URL "http://www.eclipse.org/downloads">
+<!ENTITY ECLIPSE_DL_URL "http://download.eclipse.org">
+<!ENTITY ECLIPSE_DL_PLUGIN_URL "&YOCTO_DL_URL;/releases/eclipse-plugin/&DISTRO;">
+<!ENTITY ECLIPSE_UPDATES_URL "&ECLIPSE_DL_URL;/tm/updates/3.3">
+<!ENTITY ECLIPSE_INDIGO_URL "&ECLIPSE_DL_URL;/releases/indigo">
+<!ENTITY ECLIPSE_JUNO_URL "&ECLIPSE_DL_URL;/releases/juno">
+<!ENTITY ECLIPSE_LUNA_URL "&ECLIPSE_DL_URL;/releases/luna">
+<!ENTITY ECLIPSE_KEPLER_URL "&ECLIPSE_DL_URL;/releases/kepler">
+<!ENTITY ECLIPSE_INDIGO_CDT_URL "&ECLIPSE_DL_URL;/tools/cdt/releases/indigo">
+<!ENTITY YOCTO_DOCS_URL "&YOCTO_HOME_URL;/docs">
+<!ENTITY YOCTO_SOURCES_URL "&YOCTO_HOME_URL;/sources/">
+<!ENTITY YOCTO_AB_PORT_URL "https://autobuilder.yocto.io/">
+<!ENTITY YOCTO_AB_NIGHTLY_URL "&YOCTO_AB_PORT_URL;/pub/nightly/">
+<!ENTITY YOCTO_POKY_URL "&YOCTO_DL_URL;/releases/poky/">
+<!ENTITY YOCTO_RELEASE_DL_URL "&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;">
+<!ENTITY YOCTO_TOOLCHAIN_DL_URL "&YOCTO_RELEASE_DL_URL;/toolchain/">
+<!ENTITY YOCTO_ECLIPSE_DL_URL "&YOCTO_RELEASE_DL_URL;/eclipse-plugin/">
+<!ENTITY YOCTO_ADTINSTALLER_DL_URL "&YOCTO_RELEASE_DL_URL;/adt-installer">
+<!ENTITY YOCTO_POKY_DL_URL "&YOCTO_RELEASE_DL_URL;/&YOCTO_POKY;.tar.bz2">
+<!ENTITY YOCTO_MACHINES_DL_URL "&YOCTO_RELEASE_DL_URL;/machines">
+<!ENTITY YOCTO_QEMU_DL_URL "&YOCTO_MACHINES_DL_URL;/qemu">
+<!ENTITY YOCTO_PYTHON-i686_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-i686.tar.bz2">
+<!ENTITY YOCTO_PYTHON-x86_64_DL_URL "&YOCTO_DL_URL;/releases/miscsupport/python-nativesdk-standalone-x86_64.tar.bz2">
+<!ENTITY YOCTO_DOCS_QS_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/yocto-project-qs/yocto-project-qs.html">
+<!ENTITY YOCTO_DOCS_ADT_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/adt-manual/adt-manual.html">
+<!ENTITY YOCTO_DOCS_REF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/ref-manual/ref-manual.html">
+<!ENTITY YOCTO_DOCS_BSP_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bsp-guide/bsp-guide.html">
+<!ENTITY YOCTO_DOCS_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/dev-manual/dev-manual.html">
+<!ENTITY YOCTO_DOCS_KERNEL_DEV_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/kernel-dev/kernel-dev.html">
+<!ENTITY YOCTO_DOCS_PROF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/profile-manual/profile-manual.html">
+<!ENTITY YOCTO_DOCS_MM_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/mega-manual/mega-manual.html">
+<!ENTITY YOCTO_DOCS_BB_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/bitbake-user-manual/bitbake-user-manual.html">
+<!ENTITY YOCTO_DOCS_TOAST_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/toaster-manual/toaster-manual.html">
+<!ENTITY YOCTO_DOCS_SDK_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/sdk-manual/sdk-manual.html">
+<!ENTITY YOCTO_DOCS_OM_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/overview-manual/overview-manual.html">
+<!ENTITY YOCTO_DOCS_BRIEF_URL "&YOCTO_DOCS_URL;/&YOCTO_DOC_VERSION;/brief-yoctoprojectqs/brief-yoctoprojectqs.html">
+<!ENTITY YOCTO_ADTPATH_DIR "/opt/poky/&DISTRO;">
+<!ENTITY YOCTO_POKY_TARBALL "&YOCTO_POKY;.tar.bz2">
+<!ENTITY OE_INIT_PATH "&YOCTO_POKY;/oe-init-build-env">
+<!ENTITY OE_INIT_FILE "oe-init-build-env">
+<!ENTITY UBUNTU_HOST_PACKAGES_ESSENTIAL "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">
+<!ENTITY FEDORA_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python3 unzip perl patch \
+ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
+ ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue perl-bignum socat \
+ python3-pexpect findutils which file cpio python python3-pip xz">
+<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
+ diffstat makeinfo python-curses patch socat python3 python3-curses tar python3-pip \
+ python3-pexpect xz which">
+<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "-y epel-release
+ $ sudo yum makecache
+ $ sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
+ diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
+ perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python34-pip xz \
+ which">
diff --git a/poky/documentation/profile-manual/figures/kernelshark-all.png b/poky/documentation/profile-manual/figures/kernelshark-all.png
new file mode 100644
index 000000000..99b40bafe
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/kernelshark-all.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/kernelshark-choose-events.png b/poky/documentation/profile-manual/figures/kernelshark-choose-events.png
new file mode 100644
index 000000000..e8dd62a57
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/kernelshark-choose-events.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/kernelshark-i915-display.png b/poky/documentation/profile-manual/figures/kernelshark-i915-display.png
new file mode 100644
index 000000000..bb0edfb7f
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/kernelshark-i915-display.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/kernelshark-output-display.png b/poky/documentation/profile-manual/figures/kernelshark-output-display.png
new file mode 100644
index 000000000..ae2d0e573
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/kernelshark-output-display.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/lttngmain0.png b/poky/documentation/profile-manual/figures/lttngmain0.png
new file mode 100644
index 000000000..5f60113cc
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/lttngmain0.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/oprofileui-busybox.png b/poky/documentation/profile-manual/figures/oprofileui-busybox.png
new file mode 100644
index 000000000..a8275c65d
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/oprofileui-busybox.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png b/poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png
new file mode 100644
index 000000000..deb647020
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/oprofileui-copy-to-user.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/oprofileui-downloading.png b/poky/documentation/profile-manual/figures/oprofileui-downloading.png
new file mode 100644
index 000000000..57742d672
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/oprofileui-downloading.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/oprofileui-processes.png b/poky/documentation/profile-manual/figures/oprofileui-processes.png
new file mode 100644
index 000000000..ae547028f
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/oprofileui-processes.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png b/poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png
new file mode 100644
index 000000000..1a1070deb
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-probe-do_fork-profile.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-report-cycles-u.png b/poky/documentation/profile-manual/figures/perf-report-cycles-u.png
new file mode 100644
index 000000000..68ec6af80
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-report-cycles-u.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-systemwide-libc.png b/poky/documentation/profile-manual/figures/perf-systemwide-libc.png
new file mode 100644
index 000000000..2b72869c7
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-systemwide-libc.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-systemwide.png b/poky/documentation/profile-manual/figures/perf-systemwide.png
new file mode 100644
index 000000000..12ce2444a
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-systemwide.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png
new file mode 100644
index 000000000..ceb34eaea
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-menu.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png
new file mode 100644
index 000000000..3581e9daa
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-annotate-udhcpc.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png
new file mode 100644
index 000000000..c317b49a4
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-debuginfo.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png
new file mode 100644
index 000000000..1913c867d
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom-menu.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png
new file mode 100644
index 000000000..a1962c437
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-dso-zoom.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png b/poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png
new file mode 100644
index 000000000..b642d06c8
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-busybox-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png b/poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png
new file mode 100644
index 000000000..c8f395ab5
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-flat-stripped.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png b/poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
new file mode 100644
index 000000000..bb7c764ce
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-g-copy-from-user-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
new file mode 100644
index 000000000..a799af512
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-debuginfo.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
new file mode 100644
index 000000000..e91808ae4
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped-unresolved-hidden.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
new file mode 100644
index 000000000..812302d0a
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/perf-wget-g-copy-to-user-expanded-stripped.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/profile-title.png b/poky/documentation/profile-manual/figures/profile-title.png
new file mode 100644
index 000000000..ce5c682b5
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/profile-title.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png b/poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png
new file mode 100644
index 000000000..2b6bfdacf
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/pybootchartgui-linux-yocto.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png b/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png
new file mode 100644
index 000000000..444675c54
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm-nostrip.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png b/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png
new file mode 100644
index 000000000..8ee35352d
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/pychart-linux-yocto-rpm.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/sched-wakeup-profile.png b/poky/documentation/profile-manual/figures/sched-wakeup-profile.png
new file mode 100644
index 000000000..2f2581188
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/sched-wakeup-profile.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/sysprof-callers.png b/poky/documentation/profile-manual/figures/sysprof-callers.png
new file mode 100644
index 000000000..640c8d914
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/sysprof-callers.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/sysprof-copy-from-user.png b/poky/documentation/profile-manual/figures/sysprof-copy-from-user.png
new file mode 100644
index 000000000..8d3142782
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/sysprof-copy-from-user.png
Binary files differ
diff --git a/poky/documentation/profile-manual/figures/sysprof-copy-to-user.png b/poky/documentation/profile-manual/figures/sysprof-copy-to-user.png
new file mode 100644
index 000000000..7a5bab799
--- /dev/null
+++ b/poky/documentation/profile-manual/figures/sysprof-copy-to-user.png
Binary files differ
diff --git a/poky/documentation/profile-manual/profile-manual-arch.xml b/poky/documentation/profile-manual/profile-manual-arch.xml
new file mode 100644
index 000000000..19d115522
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-arch.xml
@@ -0,0 +1,45 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='profile-manual-arch'>
+
+<title>Overall Architecture of the Linux Tracing and Profiling Tools</title>
+
+<section id='architecture-of-the-tracing-and-profiling-tools'>
+ <title>Architecture of the Tracing and Profiling Tools</title>
+
+ <para>
+ It may seem surprising to see a section covering an 'overall architecture'
+ for what seems to be a random collection of tracing tools that together
+ make up the Linux tracing and profiling space.
+ The fact is, however, that in recent years this seemingly disparate
+ set of tools has started to converge on a 'core' set of underlying
+ mechanisms:
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>static tracepoints</listitem>
+ <listitem>dynamic tracepoints
+ <itemizedlist>
+ <listitem>kprobes</listitem>
+ <listitem>uprobes</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>the perf_events subsystem</listitem>
+ <listitem>debugfs</listitem>
+ </itemizedlist>
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> Rather than enumerating here how each tool makes use of
+ these common mechanisms, textboxes like this will make note of the
+ specific usages in each tool as they come up in the course
+ of the text.
+ </informalexample>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/profile-manual/profile-manual-customization.xsl b/poky/documentation/profile-manual/profile-manual-customization.xsl
new file mode 100644
index 000000000..caa57ef34
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-customization.xsl
@@ -0,0 +1,27 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'profile-manual-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl b/poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..a898281ff
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/profile-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/profile-manual/profile-manual-examples.xml b/poky/documentation/profile-manual/profile-manual-examples.xml
new file mode 100644
index 000000000..9630c6c30
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-examples.xml
@@ -0,0 +1,39 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='profile-manual-examples'>
+
+<title>Real-World Examples</title>
+
+<para>
+ This chapter contains real-world examples.
+</para>
+
+<section id='slow-write-speed-on-live-images'>
+ <title>Slow Write Speed on Live Images</title>
+
+ <para>
+ In one of our previous releases (denzil), users noticed that booting
+ off of a live image and writing to disk was noticeably slower.
+ This included the boot itself, especially the first one, since first
+ boots tend to do a significant amount of writing due to certain
+ post-install scripts.
+ </para>
+
+ <para>
+ The problem (and solution) was discovered by using the Yocto tracing
+ tools, in this case 'perf stat', 'perf script', 'perf record'
+ and 'perf report'.
+ </para>
+
+ <para>
+ See all the unvarnished details of how this bug was diagnosed and
+ solved here: Yocto Bug #3049
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/profile-manual/profile-manual-intro.xml b/poky/documentation/profile-manual/profile-manual-intro.xml
new file mode 100644
index 000000000..d38d61a82
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-intro.xml
@@ -0,0 +1,104 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='profile-manual-intro'>
+
+<title>Yocto Project Profiling and Tracing Manual</title>
+ <section id='profile-intro'>
+ <title>Introduction</title>
+
+ <para>
+ Yocto bundles a number of tracing and profiling tools - this 'HOWTO'
+ describes their basic usage and shows by example how to make use
+ of them to examine application and system behavior.
+ </para>
+
+ <para>
+ The tools presented are for the most part completely open-ended and
+ have quite good and/or extensive documentation of their own which
+ can be used to solve just about any problem you might come across
+ in Linux.
+ Each section that describes a particular tool has links to that
+ tool's documentation and website.
+ </para>
+
+ <para>
+ The purpose of this 'HOWTO' is to present a set of common and
+ generally useful tracing and profiling idioms along with their
+ application (as appropriate) to each tool, in the context of a
+ general-purpose 'drill-down' methodology that can be applied
+ to solving a large number (90%?) of problems.
+ For help with more advanced usages and problems, please see
+ the documentation and/or websites listed for each tool.
+ </para>
+
+ <para>
+ The final section of this 'HOWTO' is a collection of real-world
+ examples which we'll be continually adding to as we solve more
+ problems using the tools - feel free to add your own examples
+ to the list!
+ </para>
+ </section>
+
+ <section id='profile-manual-general-setup'>
+ <title>General Setup</title>
+
+ <para>
+ Most of the tools are available only in 'sdk' images or in images
+ built after adding 'tools-profile' to your local.conf.
+ So, in order to be able to access all of the tools described here,
+ please first build and boot an 'sdk' image e.g.
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato-sdk
+ </literallayout>
+ or alternatively by adding 'tools-profile' to the
+ EXTRA_IMAGE_FEATURES line in your local.conf:
+ <literallayout class='monospaced'>
+ EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile"
+ </literallayout>
+ If you use the 'tools-profile' method, you don't need to build an
+ sdk image - the tracing and profiling tools will be included in
+ non-sdk images as well e.g.:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-sato
+ </literallayout>
+ <note><para>
+ By default, the Yocto build system strips symbols from the
+ binaries it packages, which makes it difficult to use some
+ of the tools.
+ </para><para>You can prevent that by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHIBIT_PACKAGE_STRIP'><filename>INHIBIT_PACKAGE_STRIP</filename></ulink>
+ variable to "1" in your
+ <filename>local.conf</filename> when you build the image:
+ </para>
+ </note>
+ <literallayout class='monospaced'>
+ INHIBIT_PACKAGE_STRIP = "1"
+ </literallayout>
+ The above setting will noticeably increase the size of your image.
+ </para>
+
+ <para>
+ If you've already built a stripped image, you can generate
+ debug packages (xxx-dbg) which you can manually install as
+ needed.
+ </para>
+
+ <para>
+ To generate debug info for packages, you can add dbg-pkgs to
+ EXTRA_IMAGE_FEATURES in local.conf. For example:
+ <literallayout class='monospaced'>
+ EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
+ </literallayout>
+ Additionally, in order to generate the right type of
+ debuginfo, we also need to add the following to local.conf:
+ <literallayout class='monospaced'>
+ PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
+ </literallayout>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/profile-manual/profile-manual-style.css b/poky/documentation/profile-manual/profile-manual-style.css
new file mode 100644
index 000000000..f3cca8536
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-style.css
@@ -0,0 +1,984 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/profile-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/profile-manual/profile-manual-usage.xml b/poky/documentation/profile-manual/profile-manual-usage.xml
new file mode 100644
index 000000000..c0873e13a
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual-usage.xml
@@ -0,0 +1,3163 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='profile-manual-usage'>
+
+<title>Basic Usage (with examples) for each of the Yocto Tracing Tools</title>
+
+<para>
+ This chapter presents basic usage examples for each of the tracing
+ tools.
+</para>
+
+<section id='profile-manual-perf'>
+ <title>perf</title>
+
+ <para>
+ The 'perf' tool is the profiling and tracing tool that comes
+ bundled with the Linux kernel.
+ </para>
+
+ <para>
+ Don't let the fact that it's part of the kernel fool you into thinking
+ that it's only for tracing and profiling the kernel - you can indeed
+ use it to trace and profile just the kernel, but you can also use it
+ to profile specific applications separately (with or without kernel
+ context), and you can also use it to trace and profile the kernel
+ and all applications on the system simultaneously to gain a system-wide
+ view of what's going on.
+ </para>
+
+ <para>
+ In many ways, perf aims to be a superset of all the tracing and profiling
+ tools available in Linux today, including all the other tools covered
+ in this HOWTO. The past couple of years have seen perf subsume a lot
+ of the functionality of those other tools and, at the same time, those
+ other tools have removed large portions of their previous functionality
+ and replaced it with calls to the equivalent functionality now
+ implemented by the perf subsystem. Extrapolation suggests that at
+ some point those other tools will simply become completely redundant
+ and go away; until then, we'll cover those other tools in these pages
+ and in many cases show how the same things can be accomplished in
+ perf and the other tools when it seems useful to do so.
+ </para>
+
+ <para>
+ The coverage below details some of the most common ways you'll likely
+ want to apply the tool; full documentation can be found either within
+ the tool itself or in the man pages at
+ <ulink url='http://linux.die.net/man/1/perf'>perf(1)</ulink>.
+ </para>
+
+ <section id='perf-setup'>
+ <title>Setup</title>
+
+ <para>
+ For this section, we'll assume you've already performed the basic
+ setup outlined in the General Setup section.
+ </para>
+
+ <para>
+ In particular, you'll get the most mileage out of perf if you
+ profile an image built with the following in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHIBIT_PACKAGE_STRIP'>INHIBIT_PACKAGE_STRIP</ulink> = "1"
+ </literallayout>
+ </para>
+
+ <para>
+ perf runs on the target system for the most part. You can archive
+ profile data and copy it to the host for analysis, but for the
+ rest of this document we assume you've ssh'ed to the host and
+ will be running the perf commands on the target.
+ </para>
+ </section>
+
+ <section id='perf-basic-usage'>
+ <title>Basic Usage</title>
+
+ <para>
+ The perf tool is pretty much self-documenting. To remind yourself
+ of the available commands, simply type 'perf', which will show you
+ basic usage along with the available perf subcommands:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf
+
+ usage: perf [--version] [--help] COMMAND [ARGS]
+
+ The most commonly used perf commands are:
+ annotate Read perf.data (created by perf record) and display annotated code
+ archive Create archive with object files with build-ids found in perf.data file
+ bench General framework for benchmark suites
+ buildid-cache Manage build-id cache.
+ buildid-list List the buildids in a perf.data file
+ diff Read two perf.data files and display the differential profile
+ evlist List the event names in a perf.data file
+ inject Filter to augment the events stream with additional information
+ kmem Tool to trace/measure kernel memory(slab) properties
+ kvm Tool to trace/measure kvm guest os
+ list List all symbolic event types
+ lock Analyze lock events
+ probe Define new dynamic tracepoints
+ record Run a command and record its profile into perf.data
+ report Read perf.data (created by perf record) and display the profile
+ sched Tool to trace/measure scheduler properties (latencies)
+ script Read perf.data (created by perf record) and display trace output
+ stat Run a command and gather performance counter statistics
+ test Runs sanity tests.
+ timechart Tool to visualize total system behavior during a workload
+ top System profiling tool.
+
+ See 'perf help COMMAND' for more information on a specific command.
+ </literallayout>
+ </para>
+
+ <section id='using-perf-to-do-basic-profiling'>
+ <title>Using perf to do Basic Profiling</title>
+
+ <para>
+ As a simple test case, we'll profile the 'wget' of a fairly large
+ file, which is a minimally interesting case because it has both
+ file and network I/O aspects, and at least in the case of standard
+ Yocto images, it's implemented as part of busybox, so the methods
+ we use to analyze it can be used in a very similar way to the whole
+ host of supported busybox applets in Yocto.
+ <literallayout class='monospaced'>
+ root@crownbay:~# rm linux-2.6.19.2.tar.bz2; \
+ wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ </literallayout>
+ The quickest and easiest way to get some basic overall data about
+ what's going on for a particular workload is to profile it using
+ 'perf stat'. 'perf stat' basically profiles using a few default
+ counters and displays the summed counts at the end of the run:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf stat wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |***************************************************| 41727k 0:00:00 ETA
+
+ Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>':
+
+ 4597.223902 task-clock # 0.077 CPUs utilized
+ 23568 context-switches # 0.005 M/sec
+ 68 CPU-migrations # 0.015 K/sec
+ 241 page-faults # 0.052 K/sec
+ 3045817293 cycles # 0.663 GHz
+ &lt;not supported&gt; stalled-cycles-frontend
+ &lt;not supported&gt; stalled-cycles-backend
+ 858909167 instructions # 0.28 insns per cycle
+ 165441165 branches # 35.987 M/sec
+ 19550329 branch-misses # 11.82% of all branches
+
+ 59.836627620 seconds time elapsed
+ </literallayout>
+ Many times such a simple-minded test doesn't yield much of
+ interest, but sometimes it does (see Real-world Yocto bug
+ (slow loop-mounted write speed)).
+ </para>
+
+ <para>
+ Also, note that 'perf stat' isn't restricted to a fixed set of
+ counters - basically any event listed in the output of 'perf list'
+ can be tallied by 'perf stat'. For example, suppose we wanted to
+ see a summary of all the events related to kernel memory
+ allocation/freeing along with cache hits and misses:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf stat -e kmem:* -e cache-references -e cache-misses wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |***************************************************| 41727k 0:00:00 ETA
+
+ Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>':
+
+ 5566 kmem:kmalloc
+ 125517 kmem:kmem_cache_alloc
+ 0 kmem:kmalloc_node
+ 0 kmem:kmem_cache_alloc_node
+ 34401 kmem:kfree
+ 69920 kmem:kmem_cache_free
+ 133 kmem:mm_page_free
+ 41 kmem:mm_page_free_batched
+ 11502 kmem:mm_page_alloc
+ 11375 kmem:mm_page_alloc_zone_locked
+ 0 kmem:mm_page_pcpu_drain
+ 0 kmem:mm_page_alloc_extfrag
+ 66848602 cache-references
+ 2917740 cache-misses # 4.365 % of all cache refs
+
+ 44.831023415 seconds time elapsed
+ </literallayout>
+ So 'perf stat' gives us a nice easy way to get a quick overview of
+ what might be happening for a set of events, but normally we'd
+ need a little more detail in order to understand what's going on
+ in a way that we can act on in a useful way.
+ </para>
+
+ <para>
+ To dive down into a next level of detail, we can use 'perf
+ record'/'perf report' which will collect profiling data and
+ present it to use using an interactive text-based UI (or
+ simply as text if we specify --stdio to 'perf report').
+ </para>
+
+ <para>
+ As our first attempt at profiling this workload, we'll simply
+ run 'perf record', handing it the workload we want to profile
+ (everything after 'perf record' and any perf options we hand
+ it - here none - will be executed in a new shell). perf collects
+ samples until the process exits and records them in a file named
+ 'perf.data' in the current working directory.
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |************************************************| 41727k 0:00:00 ETA
+ [ perf record: Woken up 1 times to write data ]
+ [ perf record: Captured and wrote 0.176 MB perf.data (~7700 samples) ]
+ </literallayout>
+ To see the results in a 'text-based UI' (tui), simply run
+ 'perf report', which will read the perf.data file in the current
+ working directory and display the results in an interactive UI:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf report
+ </literallayout>
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-flat-stripped.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ The above screenshot displays a 'flat' profile, one entry for
+ each 'bucket' corresponding to the functions that were profiled
+ during the profiling run, ordered from the most popular to the
+ least (perf has options to sort in various orders and keys as
+ well as display entries only above a certain threshold and so
+ on - see the perf documentation for details). Note that this
+ includes both userspace functions (entries containing a [.]) and
+ kernel functions accounted to the process (entries containing
+ a [k]). (perf has command-line modifiers that can be used to
+ restrict the profiling to kernel or userspace, among others).
+ </para>
+
+ <para>
+ Notice also that the above report shows an entry for 'busybox',
+ which is the executable that implements 'wget' in Yocto, but that
+ instead of a useful function name in that entry, it displays
+ a not-so-friendly hex value instead. The steps below will show
+ how to fix that problem.
+ </para>
+
+ <para>
+ Before we do that, however, let's try running a different profile,
+ one which shows something a little more interesting. The only
+ difference between the new profile and the previous one is that
+ we'll add the -g option, which will record not just the address
+ of a sampled function, but the entire callchain to the sampled
+ function as well:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |************************************************| 41727k 0:00:00 ETA
+ [ perf record: Woken up 3 times to write data ]
+ [ perf record: Captured and wrote 0.652 MB perf.data (~28476 samples) ]
+
+
+ root@crownbay:~# perf report
+ </literallayout>
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-g-copy-to-user-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Using the callgraph view, we can actually see not only which
+ functions took the most time, but we can also see a summary of
+ how those functions were called and learn something about how the
+ program interacts with the kernel in the process.
+ </para>
+
+ <para>
+ Notice that each entry in the above screenshot now contains a '+'
+ on the left-hand side. This means that we can expand the entry and
+ drill down into the callchains that feed into that entry.
+ Pressing 'enter' on any one of them will expand the callchain
+ (you can also press 'E' to expand them all at the same time or 'C'
+ to collapse them all).
+ </para>
+
+ <para>
+ In the screenshot above, we've toggled the __copy_to_user_ll()
+ entry and several subnodes all the way down. This lets us see
+ which callchains contributed to the profiled __copy_to_user_ll()
+ function which contributed 1.77% to the total profile.
+ </para>
+
+ <para>
+ As a bit of background explanation for these callchains, think
+ about what happens at a high level when you run wget to get a file
+ out on the network. Basically what happens is that the data comes
+ into the kernel via the network connection (socket) and is passed
+ to the userspace program 'wget' (which is actually a part of
+ busybox, but that's not important for now), which takes the buffers
+ the kernel passes to it and writes it to a disk file to save it.
+ </para>
+
+ <para>
+ The part of this process that we're looking at in the above call
+ stacks is the part where the kernel passes the data it's read from
+ the socket down to wget i.e. a copy-to-user.
+ </para>
+
+ <para>
+ Notice also that here there's also a case where the hex value
+ is displayed in the callstack, here in the expanded
+ sys_clock_gettime() function. Later we'll see it resolve to a
+ userspace function call in busybox.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-g-copy-from-user-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ The above screenshot shows the other half of the journey for the
+ data - from the wget program's userspace buffers to disk. To get
+ the buffers to disk, the wget program issues a write(2), which
+ does a copy-from-user to the kernel, which then takes care via
+ some circuitous path (probably also present somewhere in the
+ profile data), to get it safely to disk.
+ </para>
+
+ <para>
+ Now that we've seen the basic layout of the profile data and the
+ basics of how to extract useful information out of it, let's get
+ back to the task at hand and see if we can get some basic idea
+ about where the time is spent in the program we're profiling,
+ wget. Remember that wget is actually implemented as an applet
+ in busybox, so while the process name is 'wget', the executable
+ we're actually interested in is busybox. So let's expand the
+ first entry containing busybox:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-expanded-stripped.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Again, before we expanded we saw that the function was labeled
+ with a hex value instead of a symbol as with most of the kernel
+ entries. Expanding the busybox entry doesn't make it any better.
+ </para>
+
+ <para>
+ The problem is that perf can't find the symbol information for the
+ busybox binary, which is actually stripped out by the Yocto build
+ system.
+ </para>
+
+ <para>
+ One way around that is to put the following in your
+ <filename>local.conf</filename> file when you build the image:
+ <literallayout class='monospaced'>
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHIBIT_PACKAGE_STRIP'>INHIBIT_PACKAGE_STRIP</ulink> = "1"
+ </literallayout>
+ However, we already have an image with the binaries stripped,
+ so what can we do to get perf to resolve the symbols? Basically
+ we need to install the debuginfo for the busybox package.
+ </para>
+
+ <para>
+ To generate the debug info for the packages in the image, we can
+ add dbg-pkgs to EXTRA_IMAGE_FEATURES in local.conf. For example:
+ <literallayout class='monospaced'>
+ EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile dbg-pkgs"
+ </literallayout>
+ Additionally, in order to generate the type of debuginfo that
+ perf understands, we also need to add the following to local.conf:
+ <literallayout class='monospaced'>
+ PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
+ </literallayout>
+ Once we've done that, we can install the debuginfo for busybox.
+ The debug packages once built can be found in
+ build/tmp/deploy/rpm/* on the host system. Find the
+ busybox-dbg-...rpm file and copy it to the target. For example:
+ <literallayout class='monospaced'>
+ [trz@empanada core2]$ scp /home/trz/yocto/crownbay-tracing-dbg/build/tmp/deploy/rpm/core2_32/busybox-dbg-1.20.2-r2.core2_32.rpm root@192.168.1.31:
+ root@192.168.1.31's password:
+ busybox-dbg-1.20.2-r2.core2_32.rpm 100% 1826KB 1.8MB/s 00:01
+ </literallayout>
+ Now install the debug rpm on the target:
+ <literallayout class='monospaced'>
+ root@crownbay:~# rpm -i busybox-dbg-1.20.2-r2.core2_32.rpm
+ </literallayout>
+ Now that the debuginfo is installed, we see that the busybox
+ entries now display their functions symbolically:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-debuginfo.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ If we expand one of the entries and press 'enter' on a leaf node,
+ we're presented with a menu of actions we can take to get more
+ information related to that entry:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-dso-zoom-menu.png" width="6in" depth="2in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ One of these actions allows us to show a view that displays a
+ busybox-centric view of the profiled functions (in this case we've
+ also expanded all the nodes using the 'E' key):
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-dso-zoom.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Finally, we can see that now that the busybox debuginfo is
+ installed, the previously unresolved symbol in the
+ sys_clock_gettime() entry mentioned previously is now resolved,
+ and shows that the sys_clock_gettime system call that was the
+ source of 6.75% of the copy-to-user overhead was initiated by
+ the handle_input() busybox function:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-g-copy-to-user-expanded-debuginfo.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ At the lowest level of detail, we can dive down to the assembly
+ level and see which instructions caused the most overhead in a
+ function. Pressing 'enter' on the 'udhcpc_main' function, we're
+ again presented with a menu:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-annotate-menu.png" width="6in" depth="2in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Selecting 'Annotate udhcpc_main', we get a detailed listing of
+ percentages by instruction for the udhcpc_main function. From the
+ display, we can see that over 50% of the time spent in this
+ function is taken up by a couple tests and the move of a
+ constant (1) to a register:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-wget-busybox-annotate-udhcpc.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ As a segue into tracing, let's try another profile using a
+ different counter, something other than the default 'cycles'.
+ </para>
+
+ <para>
+ The tracing and profiling infrastructure in Linux has become
+ unified in a way that allows us to use the same tool with a
+ completely different set of counters, not just the standard
+ hardware counters that traditional tools have had to restrict
+ themselves to (of course the traditional tools can also make use
+ of the expanded possibilities now available to them, and in some
+ cases have, as mentioned previously).
+ </para>
+
+ <para>
+ We can get a list of the available events that can be used to
+ profile a workload via 'perf list':
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf list
+
+ List of pre-defined events (to be used in -e):
+ cpu-cycles OR cycles [Hardware event]
+ stalled-cycles-frontend OR idle-cycles-frontend [Hardware event]
+ stalled-cycles-backend OR idle-cycles-backend [Hardware event]
+ instructions [Hardware event]
+ cache-references [Hardware event]
+ cache-misses [Hardware event]
+ branch-instructions OR branches [Hardware event]
+ branch-misses [Hardware event]
+ bus-cycles [Hardware event]
+ ref-cycles [Hardware event]
+
+ cpu-clock [Software event]
+ task-clock [Software event]
+ page-faults OR faults [Software event]
+ minor-faults [Software event]
+ major-faults [Software event]
+ context-switches OR cs [Software event]
+ cpu-migrations OR migrations [Software event]
+ alignment-faults [Software event]
+ emulation-faults [Software event]
+
+ L1-dcache-loads [Hardware cache event]
+ L1-dcache-load-misses [Hardware cache event]
+ L1-dcache-prefetch-misses [Hardware cache event]
+ L1-icache-loads [Hardware cache event]
+ L1-icache-load-misses [Hardware cache event]
+ .
+ .
+ .
+ rNNN [Raw hardware event descriptor]
+ cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor]
+ (see 'perf list --help' on how to encode it)
+
+ mem:&lt;addr&gt;[:access] [Hardware breakpoint]
+
+ sunrpc:rpc_call_status [Tracepoint event]
+ sunrpc:rpc_bind_status [Tracepoint event]
+ sunrpc:rpc_connect_status [Tracepoint event]
+ sunrpc:rpc_task_begin [Tracepoint event]
+ skb:kfree_skb [Tracepoint event]
+ skb:consume_skb [Tracepoint event]
+ skb:skb_copy_datagram_iovec [Tracepoint event]
+ net:net_dev_xmit [Tracepoint event]
+ net:net_dev_queue [Tracepoint event]
+ net:netif_receive_skb [Tracepoint event]
+ net:netif_rx [Tracepoint event]
+ napi:napi_poll [Tracepoint event]
+ sock:sock_rcvqueue_full [Tracepoint event]
+ sock:sock_exceed_buf_limit [Tracepoint event]
+ udp:udp_fail_queue_rcv_skb [Tracepoint event]
+ hda:hda_send_cmd [Tracepoint event]
+ hda:hda_get_response [Tracepoint event]
+ hda:hda_bus_reset [Tracepoint event]
+ scsi:scsi_dispatch_cmd_start [Tracepoint event]
+ scsi:scsi_dispatch_cmd_error [Tracepoint event]
+ scsi:scsi_eh_wakeup [Tracepoint event]
+ drm:drm_vblank_event [Tracepoint event]
+ drm:drm_vblank_event_queued [Tracepoint event]
+ drm:drm_vblank_event_delivered [Tracepoint event]
+ random:mix_pool_bytes [Tracepoint event]
+ random:mix_pool_bytes_nolock [Tracepoint event]
+ random:credit_entropy_bits [Tracepoint event]
+ gpio:gpio_direction [Tracepoint event]
+ gpio:gpio_value [Tracepoint event]
+ block:block_rq_abort [Tracepoint event]
+ block:block_rq_requeue [Tracepoint event]
+ block:block_rq_issue [Tracepoint event]
+ block:block_bio_bounce [Tracepoint event]
+ block:block_bio_complete [Tracepoint event]
+ block:block_bio_backmerge [Tracepoint event]
+ .
+ .
+ writeback:writeback_wake_thread [Tracepoint event]
+ writeback:writeback_wake_forker_thread [Tracepoint event]
+ writeback:writeback_bdi_register [Tracepoint event]
+ .
+ .
+ writeback:writeback_single_inode_requeue [Tracepoint event]
+ writeback:writeback_single_inode [Tracepoint event]
+ kmem:kmalloc [Tracepoint event]
+ kmem:kmem_cache_alloc [Tracepoint event]
+ kmem:mm_page_alloc [Tracepoint event]
+ kmem:mm_page_alloc_zone_locked [Tracepoint event]
+ kmem:mm_page_pcpu_drain [Tracepoint event]
+ kmem:mm_page_alloc_extfrag [Tracepoint event]
+ vmscan:mm_vmscan_kswapd_sleep [Tracepoint event]
+ vmscan:mm_vmscan_kswapd_wake [Tracepoint event]
+ vmscan:mm_vmscan_wakeup_kswapd [Tracepoint event]
+ vmscan:mm_vmscan_direct_reclaim_begin [Tracepoint event]
+ .
+ .
+ module:module_get [Tracepoint event]
+ module:module_put [Tracepoint event]
+ module:module_request [Tracepoint event]
+ sched:sched_kthread_stop [Tracepoint event]
+ sched:sched_wakeup [Tracepoint event]
+ sched:sched_wakeup_new [Tracepoint event]
+ sched:sched_process_fork [Tracepoint event]
+ sched:sched_process_exec [Tracepoint event]
+ sched:sched_stat_runtime [Tracepoint event]
+ rcu:rcu_utilization [Tracepoint event]
+ workqueue:workqueue_queue_work [Tracepoint event]
+ workqueue:workqueue_execute_end [Tracepoint event]
+ signal:signal_generate [Tracepoint event]
+ signal:signal_deliver [Tracepoint event]
+ timer:timer_init [Tracepoint event]
+ timer:timer_start [Tracepoint event]
+ timer:hrtimer_cancel [Tracepoint event]
+ timer:itimer_state [Tracepoint event]
+ timer:itimer_expire [Tracepoint event]
+ irq:irq_handler_entry [Tracepoint event]
+ irq:irq_handler_exit [Tracepoint event]
+ irq:softirq_entry [Tracepoint event]
+ irq:softirq_exit [Tracepoint event]
+ irq:softirq_raise [Tracepoint event]
+ printk:console [Tracepoint event]
+ task:task_newtask [Tracepoint event]
+ task:task_rename [Tracepoint event]
+ syscalls:sys_enter_socketcall [Tracepoint event]
+ syscalls:sys_exit_socketcall [Tracepoint event]
+ .
+ .
+ .
+ syscalls:sys_enter_unshare [Tracepoint event]
+ syscalls:sys_exit_unshare [Tracepoint event]
+ raw_syscalls:sys_enter [Tracepoint event]
+ raw_syscalls:sys_exit [Tracepoint event]
+ </literallayout>
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> These are exactly the same set of events defined
+ by the trace event subsystem and exposed by
+ ftrace/tracecmd/kernelshark as files in
+ /sys/kernel/debug/tracing/events, by SystemTap as
+ kernel.trace("tracepoint_name") and (partially) accessed by LTTng.
+ </informalexample>
+
+ <para>
+ Only a subset of these would be of interest to us when looking at
+ this workload, so let's choose the most likely subsystems
+ (identified by the string before the colon in the Tracepoint events)
+ and do a 'perf stat' run using only those wildcarded subsystems:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf stat -e skb:* -e net:* -e napi:* -e sched:* -e workqueue:* -e irq:* -e syscalls:* wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ Performance counter stats for 'wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>':
+
+ 23323 skb:kfree_skb
+ 0 skb:consume_skb
+ 49897 skb:skb_copy_datagram_iovec
+ 6217 net:net_dev_xmit
+ 6217 net:net_dev_queue
+ 7962 net:netif_receive_skb
+ 2 net:netif_rx
+ 8340 napi:napi_poll
+ 0 sched:sched_kthread_stop
+ 0 sched:sched_kthread_stop_ret
+ 3749 sched:sched_wakeup
+ 0 sched:sched_wakeup_new
+ 0 sched:sched_switch
+ 29 sched:sched_migrate_task
+ 0 sched:sched_process_free
+ 1 sched:sched_process_exit
+ 0 sched:sched_wait_task
+ 0 sched:sched_process_wait
+ 0 sched:sched_process_fork
+ 1 sched:sched_process_exec
+ 0 sched:sched_stat_wait
+ 2106519415641 sched:sched_stat_sleep
+ 0 sched:sched_stat_iowait
+ 147453613 sched:sched_stat_blocked
+ 12903026955 sched:sched_stat_runtime
+ 0 sched:sched_pi_setprio
+ 3574 workqueue:workqueue_queue_work
+ 3574 workqueue:workqueue_activate_work
+ 0 workqueue:workqueue_execute_start
+ 0 workqueue:workqueue_execute_end
+ 16631 irq:irq_handler_entry
+ 16631 irq:irq_handler_exit
+ 28521 irq:softirq_entry
+ 28521 irq:softirq_exit
+ 28728 irq:softirq_raise
+ 1 syscalls:sys_enter_sendmmsg
+ 1 syscalls:sys_exit_sendmmsg
+ 0 syscalls:sys_enter_recvmmsg
+ 0 syscalls:sys_exit_recvmmsg
+ 14 syscalls:sys_enter_socketcall
+ 14 syscalls:sys_exit_socketcall
+ .
+ .
+ .
+ 16965 syscalls:sys_enter_read
+ 16965 syscalls:sys_exit_read
+ 12854 syscalls:sys_enter_write
+ 12854 syscalls:sys_exit_write
+ .
+ .
+ .
+
+ 58.029710972 seconds time elapsed
+ </literallayout>
+ Let's pick one of these tracepoints and tell perf to do a profile
+ using it as the sampling event:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g -e sched:sched_wakeup wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ </literallayout>
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sched-wakeup-profile.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ The screenshot above shows the results of running a profile using
+ sched:sched_switch tracepoint, which shows the relative costs of
+ various paths to sched_wakeup (note that sched_wakeup is the
+ name of the tracepoint - it's actually defined just inside
+ ttwu_do_wakeup(), which accounts for the function name actually
+ displayed in the profile:
+ <literallayout class='monospaced'>
+ /*
+ * Mark the task runnable and perform wakeup-preemption.
+ */
+ static void
+ ttwu_do_wakeup(struct rq *rq, struct task_struct *p, int wake_flags)
+ {
+ trace_sched_wakeup(p, true);
+ .
+ .
+ .
+ }
+ </literallayout>
+ A couple of the more interesting callchains are expanded and
+ displayed above, basically some network receive paths that
+ presumably end up waking up wget (busybox) when network data is
+ ready.
+ </para>
+
+ <para>
+ Note that because tracepoints are normally used for tracing,
+ the default sampling period for tracepoints is 1 i.e. for
+ tracepoints perf will sample on every event occurrence (this
+ can be changed using the -c option). This is in contrast to
+ hardware counters such as for example the default 'cycles'
+ hardware counter used for normal profiling, where sampling
+ periods are much higher (in the thousands) because profiling should
+ have as low an overhead as possible and sampling on every cycle
+ would be prohibitively expensive.
+ </para>
+ </section>
+
+ <section id='using-perf-to-do-basic-tracing'>
+ <title>Using perf to do Basic Tracing</title>
+
+ <para>
+ Profiling is a great tool for solving many problems or for
+ getting a high-level view of what's going on with a workload or
+ across the system. It is however by definition an approximation,
+ as suggested by the most prominent word associated with it,
+ 'sampling'. On the one hand, it allows a representative picture of
+ what's going on in the system to be cheaply taken, but on the other
+ hand, that cheapness limits its utility when that data suggests a
+ need to 'dive down' more deeply to discover what's really going
+ on. In such cases, the only way to see what's really going on is
+ to be able to look at (or summarize more intelligently) the
+ individual steps that go into the higher-level behavior exposed
+ by the coarse-grained profiling data.
+ </para>
+
+ <para>
+ As a concrete example, we can trace all the events we think might
+ be applicable to our workload:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g -e skb:* -e net:* -e napi:* -e sched:sched_switch -e sched:sched_wakeup -e irq:*
+ -e syscalls:sys_enter_read -e syscalls:sys_exit_read -e syscalls:sys_enter_write -e syscalls:sys_exit_write
+ wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ </literallayout>
+ We can look at the raw trace output using 'perf script' with no
+ arguments:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf script
+
+ perf 1262 [000] 11624.857082: sys_exit_read: 0x0
+ perf 1262 [000] 11624.857193: sched_wakeup: comm=migration/0 pid=6 prio=0 success=1 target_cpu=000
+ wget 1262 [001] 11624.858021: softirq_raise: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.858074: softirq_entry: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.858081: softirq_exit: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.858166: sys_enter_read: fd: 0x0003, buf: 0xbf82c940, count: 0x0200
+ wget 1262 [001] 11624.858177: sys_exit_read: 0x200
+ wget 1262 [001] 11624.858878: kfree_skb: skbaddr=0xeb248d80 protocol=0 location=0xc15a5308
+ wget 1262 [001] 11624.858945: kfree_skb: skbaddr=0xeb248000 protocol=0 location=0xc15a5308
+ wget 1262 [001] 11624.859020: softirq_raise: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.859076: softirq_entry: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.859083: softirq_exit: vec=1 [action=TIMER]
+ wget 1262 [001] 11624.859167: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400
+ wget 1262 [001] 11624.859192: sys_exit_read: 0x1d7
+ wget 1262 [001] 11624.859228: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400
+ wget 1262 [001] 11624.859233: sys_exit_read: 0x0
+ wget 1262 [001] 11624.859573: sys_enter_read: fd: 0x0003, buf: 0xbf82c580, count: 0x0200
+ wget 1262 [001] 11624.859584: sys_exit_read: 0x200
+ wget 1262 [001] 11624.859864: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400
+ wget 1262 [001] 11624.859888: sys_exit_read: 0x400
+ wget 1262 [001] 11624.859935: sys_enter_read: fd: 0x0003, buf: 0xb7720000, count: 0x0400
+ wget 1262 [001] 11624.859944: sys_exit_read: 0x400
+ </literallayout>
+ This gives us a detailed timestamped sequence of events that
+ occurred within the workload with respect to those events.
+ </para>
+
+ <para>
+ In many ways, profiling can be viewed as a subset of tracing -
+ theoretically, if you have a set of trace events that's sufficient
+ to capture all the important aspects of a workload, you can derive
+ any of the results or views that a profiling run can.
+ </para>
+
+ <para>
+ Another aspect of traditional profiling is that while powerful in
+ many ways, it's limited by the granularity of the underlying data.
+ Profiling tools offer various ways of sorting and presenting the
+ sample data, which make it much more useful and amenable to user
+ experimentation, but in the end it can't be used in an open-ended
+ way to extract data that just isn't present as a consequence of
+ the fact that conceptually, most of it has been thrown away.
+ </para>
+
+ <para>
+ Full-blown detailed tracing data does however offer the opportunity
+ to manipulate and present the information collected during a
+ tracing run in an infinite variety of ways.
+ </para>
+
+ <para>
+ Another way to look at it is that there are only so many ways that
+ the 'primitive' counters can be used on their own to generate
+ interesting output; to get anything more complicated than simple
+ counts requires some amount of additional logic, which is typically
+ very specific to the problem at hand. For example, if we wanted to
+ make use of a 'counter' that maps to the value of the time
+ difference between when a process was scheduled to run on a
+ processor and the time it actually ran, we wouldn't expect such
+ a counter to exist on its own, but we could derive one called say
+ 'wakeup_latency' and use it to extract a useful view of that metric
+ from trace data. Likewise, we really can't figure out from standard
+ profiling tools how much data every process on the system reads and
+ writes, along with how many of those reads and writes fail
+ completely. If we have sufficient trace data, however, we could
+ with the right tools easily extract and present that information,
+ but we'd need something other than pre-canned profiling tools to
+ do that.
+ </para>
+
+ <para>
+ Luckily, there is a general-purpose way to handle such needs,
+ called 'programming languages'. Making programming languages
+ easily available to apply to such problems given the specific
+ format of data is called a 'programming language binding' for
+ that data and language. Perf supports two programming language
+ bindings, one for Python and one for Perl.
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> Language bindings for manipulating and
+ aggregating trace data are of course not a new
+ idea. One of the first projects to do this was IBM's DProbes
+ dpcc compiler, an ANSI C compiler which targeted a low-level
+ assembly language running on an in-kernel interpreter on the
+ target system. This is exactly analogous to what Sun's DTrace
+ did, except that DTrace invented its own language for the purpose.
+ Systemtap, heavily inspired by DTrace, also created its own
+ one-off language, but rather than running the product on an
+ in-kernel interpreter, created an elaborate compiler-based
+ machinery to translate its language into kernel modules written
+ in C.
+ </informalexample>
+
+ <para>
+ Now that we have the trace data in perf.data, we can use
+ 'perf script -g' to generate a skeleton script with handlers
+ for the read/write entry/exit events we recorded:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf script -g python
+ generated Python script: perf-script.py
+ </literallayout>
+ The skeleton script simply creates a python function for each
+ event type in the perf.data file. The body of each function simply
+ prints the event name along with its parameters. For example:
+ <literallayout class='monospaced'>
+ def net__netif_rx(event_name, context, common_cpu,
+ common_secs, common_nsecs, common_pid, common_comm,
+ skbaddr, len, name):
+ print_header(event_name, common_cpu, common_secs, common_nsecs,
+ common_pid, common_comm)
+
+ print "skbaddr=%u, len=%u, name=%s\n" % (skbaddr, len, name),
+ </literallayout>
+ We can run that script directly to print all of the events
+ contained in the perf.data file:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf script -s perf-script.py
+
+ in trace_begin
+ syscalls__sys_exit_read 0 11624.857082795 1262 perf nr=3, ret=0
+ sched__sched_wakeup 0 11624.857193498 1262 perf comm=migration/0, pid=6, prio=0, success=1, target_cpu=0
+ irq__softirq_raise 1 11624.858021635 1262 wget vec=TIMER
+ irq__softirq_entry 1 11624.858074075 1262 wget vec=TIMER
+ irq__softirq_exit 1 11624.858081389 1262 wget vec=TIMER
+ syscalls__sys_enter_read 1 11624.858166434 1262 wget nr=3, fd=3, buf=3213019456, count=512
+ syscalls__sys_exit_read 1 11624.858177924 1262 wget nr=3, ret=512
+ skb__kfree_skb 1 11624.858878188 1262 wget skbaddr=3945041280, location=3243922184, protocol=0
+ skb__kfree_skb 1 11624.858945608 1262 wget skbaddr=3945037824, location=3243922184, protocol=0
+ irq__softirq_raise 1 11624.859020942 1262 wget vec=TIMER
+ irq__softirq_entry 1 11624.859076935 1262 wget vec=TIMER
+ irq__softirq_exit 1 11624.859083469 1262 wget vec=TIMER
+ syscalls__sys_enter_read 1 11624.859167565 1262 wget nr=3, fd=3, buf=3077701632, count=1024
+ syscalls__sys_exit_read 1 11624.859192533 1262 wget nr=3, ret=471
+ syscalls__sys_enter_read 1 11624.859228072 1262 wget nr=3, fd=3, buf=3077701632, count=1024
+ syscalls__sys_exit_read 1 11624.859233707 1262 wget nr=3, ret=0
+ syscalls__sys_enter_read 1 11624.859573008 1262 wget nr=3, fd=3, buf=3213018496, count=512
+ syscalls__sys_exit_read 1 11624.859584818 1262 wget nr=3, ret=512
+ syscalls__sys_enter_read 1 11624.859864562 1262 wget nr=3, fd=3, buf=3077701632, count=1024
+ syscalls__sys_exit_read 1 11624.859888770 1262 wget nr=3, ret=1024
+ syscalls__sys_enter_read 1 11624.859935140 1262 wget nr=3, fd=3, buf=3077701632, count=1024
+ syscalls__sys_exit_read 1 11624.859944032 1262 wget nr=3, ret=1024
+ </literallayout>
+ That in itself isn't very useful; after all, we can accomplish
+ pretty much the same thing by simply running 'perf script'
+ without arguments in the same directory as the perf.data file.
+ </para>
+
+ <para>
+ We can however replace the print statements in the generated
+ function bodies with whatever we want, and thereby make it
+ infinitely more useful.
+ </para>
+
+ <para>
+ As a simple example, let's just replace the print statements in
+ the function bodies with a simple function that does nothing but
+ increment a per-event count. When the program is run against a
+ perf.data file, each time a particular event is encountered,
+ a tally is incremented for that event. For example:
+ <literallayout class='monospaced'>
+ def net__netif_rx(event_name, context, common_cpu,
+ common_secs, common_nsecs, common_pid, common_comm,
+ skbaddr, len, name):
+ inc_counts(event_name)
+ </literallayout>
+ Each event handler function in the generated code is modified
+ to do this. For convenience, we define a common function called
+ inc_counts() that each handler calls; inc_counts() simply tallies
+ a count for each event using the 'counts' hash, which is a
+ specialized hash function that does Perl-like autovivification, a
+ capability that's extremely useful for kinds of multi-level
+ aggregation commonly used in processing traces (see perf's
+ documentation on the Python language binding for details):
+ <literallayout class='monospaced'>
+ counts = autodict()
+
+ def inc_counts(event_name):
+ try:
+ counts[event_name] += 1
+ except TypeError:
+ counts[event_name] = 1
+ </literallayout>
+ Finally, at the end of the trace processing run, we want to
+ print the result of all the per-event tallies. For that, we
+ use the special 'trace_end()' function:
+ <literallayout class='monospaced'>
+ def trace_end():
+ for event_name, count in counts.iteritems():
+ print "%-40s %10s\n" % (event_name, count)
+ </literallayout>
+ The end result is a summary of all the events recorded in the
+ trace:
+ <literallayout class='monospaced'>
+ skb__skb_copy_datagram_iovec 13148
+ irq__softirq_entry 4796
+ irq__irq_handler_exit 3805
+ irq__softirq_exit 4795
+ syscalls__sys_enter_write 8990
+ net__net_dev_xmit 652
+ skb__kfree_skb 4047
+ sched__sched_wakeup 1155
+ irq__irq_handler_entry 3804
+ irq__softirq_raise 4799
+ net__net_dev_queue 652
+ syscalls__sys_enter_read 17599
+ net__netif_receive_skb 1743
+ syscalls__sys_exit_read 17598
+ net__netif_rx 2
+ napi__napi_poll 1877
+ syscalls__sys_exit_write 8990
+ </literallayout>
+ Note that this is pretty much exactly the same information we get
+ from 'perf stat', which goes a little way to support the idea
+ mentioned previously that given the right kind of trace data,
+ higher-level profiling-type summaries can be derived from it.
+ </para>
+
+ <para>
+ Documentation on using the
+ <ulink url='http://linux.die.net/man/1/perf-script-python'>'perf script' python binding</ulink>.
+ </para>
+ </section>
+
+ <section id='system-wide-tracing-and-profiling'>
+ <title>System-Wide Tracing and Profiling</title>
+
+ <para>
+ The examples so far have focused on tracing a particular program or
+ workload - in other words, every profiling run has specified the
+ program to profile in the command-line e.g. 'perf record wget ...'.
+ </para>
+
+ <para>
+ It's also possible, and more interesting in many cases, to run a
+ system-wide profile or trace while running the workload in a
+ separate shell.
+ </para>
+
+ <para>
+ To do system-wide profiling or tracing, you typically use
+ the -a flag to 'perf record'.
+ </para>
+
+ <para>
+ To demonstrate this, open up one window and start the profile
+ using the -a flag (press Ctrl-C to stop tracing):
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g -a
+ ^C[ perf record: Woken up 6 times to write data ]
+ [ perf record: Captured and wrote 1.400 MB perf.data (~61172 samples) ]
+ </literallayout>
+ In another window, run the wget test:
+ <literallayout class='monospaced'>
+ root@crownbay:~# wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA
+ </literallayout>
+ Here we see entries not only for our wget load, but for other
+ processes running on the system as well:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-systemwide.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ In the snapshot above, we can see callchains that originate in
+ libc, and a callchain from Xorg that demonstrates that we're
+ using a proprietary X driver in userspace (notice the presence
+ of 'PVR' and some other unresolvable symbols in the expanded
+ Xorg callchain).
+ </para>
+
+ <para>
+ Note also that we have both kernel and userspace entries in the
+ above snapshot. We can also tell perf to focus on userspace but
+ providing a modifier, in this case 'u', to the 'cycles' hardware
+ counter when we record a profile:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g -a -e cycles:u
+ ^C[ perf record: Woken up 2 times to write data ]
+ [ perf record: Captured and wrote 0.376 MB perf.data (~16443 samples) ]
+ </literallayout>
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-report-cycles-u.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Notice in the screenshot above, we see only userspace entries ([.])
+ </para>
+
+ <para>
+ Finally, we can press 'enter' on a leaf node and select the 'Zoom
+ into DSO' menu item to show only entries associated with a
+ specific DSO. In the screenshot below, we've zoomed into the
+ 'libc' DSO which shows all the entries associated with the
+ libc-xxx.so DSO.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-systemwide-libc.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ We can also use the system-wide -a switch to do system-wide
+ tracing. Here we'll trace a couple of scheduler events:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -a -e sched:sched_switch -e sched:sched_wakeup
+ ^C[ perf record: Woken up 38 times to write data ]
+ [ perf record: Captured and wrote 9.780 MB perf.data (~427299 samples) ]
+ </literallayout>
+ We can look at the raw output using 'perf script' with no
+ arguments:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf script
+
+ perf 1383 [001] 6171.460045: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1383 [001] 6171.460066: sched_switch: prev_comm=perf prev_pid=1383 prev_prio=120 prev_state=R+ ==> next_comm=kworker/1:1 next_pid=21 next_prio=120
+ kworker/1:1 21 [001] 6171.460093: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=perf next_pid=1383 next_prio=120
+ swapper 0 [000] 6171.468063: sched_wakeup: comm=kworker/0:3 pid=1209 prio=120 success=1 target_cpu=000
+ swapper 0 [000] 6171.468107: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120
+ kworker/0:3 1209 [000] 6171.468143: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120
+ perf 1383 [001] 6171.470039: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1383 [001] 6171.470058: sched_switch: prev_comm=perf prev_pid=1383 prev_prio=120 prev_state=R+ ==> next_comm=kworker/1:1 next_pid=21 next_prio=120
+ kworker/1:1 21 [001] 6171.470082: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=perf next_pid=1383 next_prio=120
+ perf 1383 [001] 6171.480035: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ </literallayout>
+ </para>
+
+ <section id='perf-filtering'>
+ <title>Filtering</title>
+
+ <para>
+ Notice that there are a lot of events that don't really have
+ anything to do with what we're interested in, namely events
+ that schedule 'perf' itself in and out or that wake perf up.
+ We can get rid of those by using the '--filter' option -
+ for each event we specify using -e, we can add a --filter
+ after that to filter out trace events that contain fields
+ with specific values:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -a -e sched:sched_switch --filter 'next_comm != perf &amp;&amp; prev_comm != perf' -e sched:sched_wakeup --filter 'comm != perf'
+ ^C[ perf record: Woken up 38 times to write data ]
+ [ perf record: Captured and wrote 9.688 MB perf.data (~423279 samples) ]
+
+
+ root@crownbay:~# perf script
+
+ swapper 0 [000] 7932.162180: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120
+ kworker/0:3 1209 [000] 7932.162236: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120
+ perf 1407 [001] 7932.170048: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1407 [001] 7932.180044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1407 [001] 7932.190038: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1407 [001] 7932.200044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1407 [001] 7932.210044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ perf 1407 [001] 7932.220044: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ swapper 0 [001] 7932.230111: sched_wakeup: comm=kworker/1:1 pid=21 prio=120 success=1 target_cpu=001
+ swapper 0 [001] 7932.230146: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/1:1 next_pid=21 next_prio=120
+ kworker/1:1 21 [001] 7932.230205: sched_switch: prev_comm=kworker/1:1 prev_pid=21 prev_prio=120 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120
+ swapper 0 [000] 7932.326109: sched_wakeup: comm=kworker/0:3 pid=1209 prio=120 success=1 target_cpu=000
+ swapper 0 [000] 7932.326171: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=kworker/0:3 next_pid=1209 next_prio=120
+ kworker/0:3 1209 [000] 7932.326214: sched_switch: prev_comm=kworker/0:3 prev_pid=1209 prev_prio=120 prev_state=S ==> next_comm=swapper/0 next_pid=0 next_prio=120
+ </literallayout>
+ In this case, we've filtered out all events that have 'perf'
+ in their 'comm' or 'comm_prev' or 'comm_next' fields. Notice
+ that there are still events recorded for perf, but notice
+ that those events don't have values of 'perf' for the filtered
+ fields. To completely filter out anything from perf will
+ require a bit more work, but for the purpose of demonstrating
+ how to use filters, it's close enough.
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> These are exactly the same set of event
+ filters defined by the trace event subsystem. See the
+ ftrace/tracecmd/kernelshark section for more discussion about
+ these event filters.
+ </informalexample>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> These event filters are implemented by a
+ special-purpose pseudo-interpreter in the kernel and are an
+ integral and indispensable part of the perf design as it
+ relates to tracing. kernel-based event filters provide a
+ mechanism to precisely throttle the event stream that appears
+ in user space, where it makes sense to provide bindings to real
+ programming languages for postprocessing the event stream.
+ This architecture allows for the intelligent and flexible
+ partitioning of processing between the kernel and user space.
+ Contrast this with other tools such as SystemTap, which does
+ all of its processing in the kernel and as such requires a
+ special project-defined language in order to accommodate that
+ design, or LTTng, where everything is sent to userspace and
+ as such requires a super-efficient kernel-to-userspace
+ transport mechanism in order to function properly. While
+ perf certainly can benefit from for instance advances in
+ the design of the transport, it doesn't fundamentally depend
+ on them. Basically, if you find that your perf tracing
+ application is causing buffer I/O overruns, it probably
+ means that you aren't taking enough advantage of the
+ kernel filtering engine.
+ </informalexample>
+ </section>
+ </section>
+
+ <section id='using-dynamic-tracepoints'>
+ <title>Using Dynamic Tracepoints</title>
+
+ <para>
+ perf isn't restricted to the fixed set of static tracepoints
+ listed by 'perf list'. Users can also add their own 'dynamic'
+ tracepoints anywhere in the kernel. For instance, suppose we
+ want to define our own tracepoint on do_fork(). We can do that
+ using the 'perf probe' perf subcommand:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf probe do_fork
+ Added new event:
+ probe:do_fork (on do_fork)
+
+ You can now use it in all perf tools, such as:
+
+ perf record -e probe:do_fork -aR sleep 1
+ </literallayout>
+ Adding a new tracepoint via 'perf probe' results in an event
+ with all the expected files and format in
+ /sys/kernel/debug/tracing/events, just the same as for static
+ tracepoints (as discussed in more detail in the trace events
+ subsystem section:
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing/events/probe/do_fork# ls -al
+ drwxr-xr-x 2 root root 0 Oct 28 11:42 .
+ drwxr-xr-x 3 root root 0 Oct 28 11:42 ..
+ -rw-r--r-- 1 root root 0 Oct 28 11:42 enable
+ -rw-r--r-- 1 root root 0 Oct 28 11:42 filter
+ -r--r--r-- 1 root root 0 Oct 28 11:42 format
+ -r--r--r-- 1 root root 0 Oct 28 11:42 id
+
+ root@crownbay:/sys/kernel/debug/tracing/events/probe/do_fork# cat format
+ name: do_fork
+ ID: 944
+ format:
+ field:unsigned short common_type; offset:0; size:2; signed:0;
+ field:unsigned char common_flags; offset:2; size:1; signed:0;
+ field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
+ field:int common_pid; offset:4; size:4; signed:1;
+ field:int common_padding; offset:8; size:4; signed:1;
+
+ field:unsigned long __probe_ip; offset:12; size:4; signed:0;
+
+ print fmt: "(%lx)", REC->__probe_ip
+ </literallayout>
+ We can list all dynamic tracepoints currently in existence:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf probe -l
+ probe:do_fork (on do_fork)
+ probe:schedule (on schedule)
+ </literallayout>
+ Let's record system-wide ('sleep 30' is a trick for recording
+ system-wide but basically do nothing and then wake up after
+ 30 seconds):
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf record -g -a -e probe:do_fork sleep 30
+ [ perf record: Woken up 1 times to write data ]
+ [ perf record: Captured and wrote 0.087 MB perf.data (~3812 samples) ]
+ </literallayout>
+ Using 'perf script' we can see each do_fork event that fired:
+ <literallayout class='monospaced'>
+ root@crownbay:~# perf script
+
+ # ========
+ # captured on: Sun Oct 28 11:55:18 2012
+ # hostname : crownbay
+ # os release : 3.4.11-yocto-standard
+ # perf version : 3.4.11
+ # arch : i686
+ # nrcpus online : 2
+ # nrcpus avail : 2
+ # cpudesc : Intel(R) Atom(TM) CPU E660 @ 1.30GHz
+ # cpuid : GenuineIntel,6,38,1
+ # total memory : 1017184 kB
+ # cmdline : /usr/bin/perf record -g -a -e probe:do_fork sleep 30
+ # event : name = probe:do_fork, type = 2, config = 0x3b0, config1 = 0x0, config2 = 0x0, excl_usr = 0, excl_kern
+ = 0, id = { 5, 6 }
+ # HEADER_CPU_TOPOLOGY info available, use -I to display
+ # ========
+ #
+ matchbox-deskto 1197 [001] 34211.378318: do_fork: (c1028460)
+ matchbox-deskto 1295 [001] 34211.380388: do_fork: (c1028460)
+ pcmanfm 1296 [000] 34211.632350: do_fork: (c1028460)
+ pcmanfm 1296 [000] 34211.639917: do_fork: (c1028460)
+ matchbox-deskto 1197 [001] 34217.541603: do_fork: (c1028460)
+ matchbox-deskto 1299 [001] 34217.543584: do_fork: (c1028460)
+ gthumb 1300 [001] 34217.697451: do_fork: (c1028460)
+ gthumb 1300 [001] 34219.085734: do_fork: (c1028460)
+ gthumb 1300 [000] 34219.121351: do_fork: (c1028460)
+ gthumb 1300 [001] 34219.264551: do_fork: (c1028460)
+ pcmanfm 1296 [000] 34219.590380: do_fork: (c1028460)
+ matchbox-deskto 1197 [001] 34224.955965: do_fork: (c1028460)
+ matchbox-deskto 1306 [001] 34224.957972: do_fork: (c1028460)
+ matchbox-termin 1307 [000] 34225.038214: do_fork: (c1028460)
+ matchbox-termin 1307 [001] 34225.044218: do_fork: (c1028460)
+ matchbox-termin 1307 [000] 34225.046442: do_fork: (c1028460)
+ matchbox-deskto 1197 [001] 34237.112138: do_fork: (c1028460)
+ matchbox-deskto 1311 [001] 34237.114106: do_fork: (c1028460)
+ gaku 1312 [000] 34237.202388: do_fork: (c1028460)
+ </literallayout>
+ And using 'perf report' on the same file, we can see the
+ callgraphs from starting a few programs during those 30 seconds:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/perf-probe-do_fork-profile.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> The trace events subsystem accommodate static
+ and dynamic tracepoints in exactly the same way - there's no
+ difference as far as the infrastructure is concerned. See the
+ ftrace section for more details on the trace event subsystem.
+ </informalexample>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> Dynamic tracepoints are implemented under the
+ covers by kprobes and uprobes. kprobes and uprobes are also used
+ by and in fact are the main focus of SystemTap.
+ </informalexample>
+ </section>
+ </section>
+
+ <section id='perf-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ Online versions of the man pages for the commands discussed in this
+ section can be found here:
+ <itemizedlist>
+ <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-stat'>'perf stat' manpage</ulink>.
+ </para></listitem>
+ <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-record'>'perf record' manpage</ulink>.
+ </para></listitem>
+ <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-report'>'perf report' manpage</ulink>.
+ </para></listitem>
+ <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-probe'>'perf probe' manpage</ulink>.
+ </para></listitem>
+ <listitem><para>The <ulink url='http://linux.die.net/man/1/perf-script'>'perf script' manpage</ulink>.
+ </para></listitem>
+ <listitem><para>Documentation on using the
+ <ulink url='http://linux.die.net/man/1/perf-script-python'>'perf script' python binding</ulink>.
+ </para></listitem>
+ <listitem><para>The top-level
+ <ulink url='http://linux.die.net/man/1/perf'>perf(1) manpage</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Normally, you should be able to invoke the man pages via perf
+ itself e.g. 'perf help' or 'perf help record'.
+ </para>
+
+ <para>
+ However, by default Yocto doesn't install man pages, but perf
+ invokes the man pages for most help functionality. This is a bug
+ and is being addressed by a Yocto bug:
+ <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=3388'>Bug 3388 - perf: enable man pages for basic 'help' functionality</ulink>.
+ </para>
+
+ <para>
+ The man pages in text form, along with some other files, such as
+ a set of examples, can be found in the 'perf' directory of the
+ kernel tree:
+ <literallayout class='monospaced'>
+ tools/perf/Documentation
+ </literallayout>
+ There's also a nice perf tutorial on the perf wiki that goes
+ into more detail than we do here in certain areas:
+ <ulink url='https://perf.wiki.kernel.org/index.php/Tutorial'>Perf Tutorial</ulink>
+ </para>
+ </section>
+</section>
+
+<section id='profile-manual-ftrace'>
+ <title>ftrace</title>
+
+ <para>
+ 'ftrace' literally refers to the 'ftrace function tracer' but in
+ reality this encompasses a number of related tracers along with
+ the infrastructure that they all make use of.
+ </para>
+
+ <section id='ftrace-setup'>
+ <title>Setup</title>
+
+ <para>
+ For this section, we'll assume you've already performed the basic
+ setup outlined in the General Setup section.
+ </para>
+
+ <para>
+ ftrace, trace-cmd, and kernelshark run on the target system,
+ and are ready to go out-of-the-box - no additional setup is
+ necessary. For the rest of this section we assume you've ssh'ed
+ to the host and will be running ftrace on the target. kernelshark
+ is a GUI application and if you use the '-X' option to ssh you
+ can have the kernelshark GUI run on the target but display
+ remotely on the host if you want.
+ </para>
+ </section>
+
+ <section id='basic-ftrace-usage'>
+ <title>Basic ftrace usage</title>
+
+ <para>
+ 'ftrace' essentially refers to everything included in
+ the /tracing directory of the mounted debugfs filesystem
+ (Yocto follows the standard convention and mounts it
+ at /sys/kernel/debug). Here's a listing of all the files
+ found in /sys/kernel/debug/tracing on a Yocto system:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# ls
+ README kprobe_events trace
+ available_events kprobe_profile trace_clock
+ available_filter_functions options trace_marker
+ available_tracers per_cpu trace_options
+ buffer_size_kb printk_formats trace_pipe
+ buffer_total_size_kb saved_cmdlines tracing_cpumask
+ current_tracer set_event tracing_enabled
+ dyn_ftrace_total_info set_ftrace_filter tracing_on
+ enabled_functions set_ftrace_notrace tracing_thresh
+ events set_ftrace_pid
+ free_buffer set_graph_function
+ </literallayout>
+ The files listed above are used for various purposes -
+ some relate directly to the tracers themselves, others are
+ used to set tracing options, and yet others actually contain
+ the tracing output when a tracer is in effect. Some of the
+ functions can be guessed from their names, others need
+ explanation; in any case, we'll cover some of the files we
+ see here below but for an explanation of the others, please
+ see the ftrace documentation.
+ </para>
+
+ <para>
+ We'll start by looking at some of the available built-in
+ tracers.
+ </para>
+
+ <para>
+ cat'ing the 'available_tracers' file lists the set of
+ available tracers:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# cat available_tracers
+ blk function_graph function nop
+ </literallayout>
+ The 'current_tracer' file contains the tracer currently in
+ effect:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# cat current_tracer
+ nop
+ </literallayout>
+ The above listing of current_tracer shows that
+ the 'nop' tracer is in effect, which is just another
+ way of saying that there's actually no tracer
+ currently in effect.
+ </para>
+
+ <para>
+ echo'ing one of the available_tracers into current_tracer
+ makes the specified tracer the current tracer:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# echo function > current_tracer
+ root@sugarbay:/sys/kernel/debug/tracing# cat current_tracer
+ function
+ </literallayout>
+ The above sets the current tracer to be the
+ 'function tracer'. This tracer traces every function
+ call in the kernel and makes it available as the
+ contents of the 'trace' file. Reading the 'trace' file
+ lists the currently buffered function calls that have been
+ traced by the function tracer:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# cat trace | less
+
+ # tracer: function
+ #
+ # entries-in-buffer/entries-written: 310629/766471 #P:8
+ #
+ # _-----=&gt; irqs-off
+ # / _----=&gt; need-resched
+ # | / _---=&gt; hardirq/softirq
+ # || / _--=&gt; preempt-depth
+ # ||| / delay
+ # TASK-PID CPU# |||| TIMESTAMP FUNCTION
+ # | | | |||| | |
+ &lt;idle&gt;-0 [004] d..1 470.867169: ktime_get_real &lt;-intel_idle
+ &lt;idle&gt;-0 [004] d..1 470.867170: getnstimeofday &lt;-ktime_get_real
+ &lt;idle&gt;-0 [004] d..1 470.867171: ns_to_timeval &lt;-intel_idle
+ &lt;idle&gt;-0 [004] d..1 470.867171: ns_to_timespec &lt;-ns_to_timeval
+ &lt;idle&gt;-0 [004] d..1 470.867172: smp_apic_timer_interrupt &lt;-apic_timer_interrupt
+ &lt;idle&gt;-0 [004] d..1 470.867172: native_apic_mem_write &lt;-smp_apic_timer_interrupt
+ &lt;idle&gt;-0 [004] d..1 470.867172: irq_enter &lt;-smp_apic_timer_interrupt
+ &lt;idle&gt;-0 [004] d..1 470.867172: rcu_irq_enter &lt;-irq_enter
+ &lt;idle&gt;-0 [004] d..1 470.867173: rcu_idle_exit_common.isra.33 &lt;-rcu_irq_enter
+ &lt;idle&gt;-0 [004] d..1 470.867173: local_bh_disable &lt;-irq_enter
+ &lt;idle&gt;-0 [004] d..1 470.867173: add_preempt_count &lt;-local_bh_disable
+ &lt;idle&gt;-0 [004] d.s1 470.867174: tick_check_idle &lt;-irq_enter
+ &lt;idle&gt;-0 [004] d.s1 470.867174: tick_check_oneshot_broadcast &lt;-tick_check_idle
+ &lt;idle&gt;-0 [004] d.s1 470.867174: ktime_get &lt;-tick_check_idle
+ &lt;idle&gt;-0 [004] d.s1 470.867174: tick_nohz_stop_idle &lt;-tick_check_idle
+ &lt;idle&gt;-0 [004] d.s1 470.867175: update_ts_time_stats &lt;-tick_nohz_stop_idle
+ &lt;idle&gt;-0 [004] d.s1 470.867175: nr_iowait_cpu &lt;-update_ts_time_stats
+ &lt;idle&gt;-0 [004] d.s1 470.867175: tick_do_update_jiffies64 &lt;-tick_check_idle
+ &lt;idle&gt;-0 [004] d.s1 470.867175: _raw_spin_lock &lt;-tick_do_update_jiffies64
+ &lt;idle&gt;-0 [004] d.s1 470.867176: add_preempt_count &lt;-_raw_spin_lock
+ &lt;idle&gt;-0 [004] d.s2 470.867176: do_timer &lt;-tick_do_update_jiffies64
+ &lt;idle&gt;-0 [004] d.s2 470.867176: _raw_spin_lock &lt;-do_timer
+ &lt;idle&gt;-0 [004] d.s2 470.867176: add_preempt_count &lt;-_raw_spin_lock
+ &lt;idle&gt;-0 [004] d.s3 470.867177: ntp_tick_length &lt;-do_timer
+ &lt;idle&gt;-0 [004] d.s3 470.867177: _raw_spin_lock_irqsave &lt;-ntp_tick_length
+ .
+ .
+ .
+ </literallayout>
+ Each line in the trace above shows what was happening in
+ the kernel on a given cpu, to the level of detail of
+ function calls. Each entry shows the function called,
+ followed by its caller (after the arrow).
+ </para>
+
+ <para>
+ The function tracer gives you an extremely detailed idea
+ of what the kernel was doing at the point in time the trace
+ was taken, and is a great way to learn about how the kernel
+ code works in a dynamic sense.
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> The ftrace function tracer is also
+ available from within perf, as the ftrace:function tracepoint.
+ </informalexample>
+
+ <para>
+ It is a little more difficult to follow the call chains than
+ it needs to be - luckily there's a variant of the function
+ tracer that displays the callchains explicitly, called the
+ 'function_graph' tracer:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# echo function_graph &gt; current_tracer
+ root@sugarbay:/sys/kernel/debug/tracing# cat trace | less
+
+ tracer: function_graph
+
+ CPU DURATION FUNCTION CALLS
+ | | | | | | |
+ 7) 0.046 us | pick_next_task_fair();
+ 7) 0.043 us | pick_next_task_stop();
+ 7) 0.042 us | pick_next_task_rt();
+ 7) 0.032 us | pick_next_task_fair();
+ 7) 0.030 us | pick_next_task_idle();
+ 7) | _raw_spin_unlock_irq() {
+ 7) 0.033 us | sub_preempt_count();
+ 7) 0.258 us | }
+ 7) 0.032 us | sub_preempt_count();
+ 7) + 13.341 us | } /* __schedule */
+ 7) 0.095 us | } /* sub_preempt_count */
+ 7) | schedule() {
+ 7) | __schedule() {
+ 7) 0.060 us | add_preempt_count();
+ 7) 0.044 us | rcu_note_context_switch();
+ 7) | _raw_spin_lock_irq() {
+ 7) 0.033 us | add_preempt_count();
+ 7) 0.247 us | }
+ 7) | idle_balance() {
+ 7) | _raw_spin_unlock() {
+ 7) 0.031 us | sub_preempt_count();
+ 7) 0.246 us | }
+ 7) | update_shares() {
+ 7) 0.030 us | __rcu_read_lock();
+ 7) 0.029 us | __rcu_read_unlock();
+ 7) 0.484 us | }
+ 7) 0.030 us | __rcu_read_lock();
+ 7) | load_balance() {
+ 7) | find_busiest_group() {
+ 7) 0.031 us | idle_cpu();
+ 7) 0.029 us | idle_cpu();
+ 7) 0.035 us | idle_cpu();
+ 7) 0.906 us | }
+ 7) 1.141 us | }
+ 7) 0.022 us | msecs_to_jiffies();
+ 7) | load_balance() {
+ 7) | find_busiest_group() {
+ 7) 0.031 us | idle_cpu();
+ .
+ .
+ .
+ 4) 0.062 us | msecs_to_jiffies();
+ 4) 0.062 us | __rcu_read_unlock();
+ 4) | _raw_spin_lock() {
+ 4) 0.073 us | add_preempt_count();
+ 4) 0.562 us | }
+ 4) + 17.452 us | }
+ 4) 0.108 us | put_prev_task_fair();
+ 4) 0.102 us | pick_next_task_fair();
+ 4) 0.084 us | pick_next_task_stop();
+ 4) 0.075 us | pick_next_task_rt();
+ 4) 0.062 us | pick_next_task_fair();
+ 4) 0.066 us | pick_next_task_idle();
+ ------------------------------------------
+ 4) kworker-74 =&gt; &lt;idle&gt;-0
+ ------------------------------------------
+
+ 4) | finish_task_switch() {
+ 4) | _raw_spin_unlock_irq() {
+ 4) 0.100 us | sub_preempt_count();
+ 4) 0.582 us | }
+ 4) 1.105 us | }
+ 4) 0.088 us | sub_preempt_count();
+ 4) ! 100.066 us | }
+ .
+ .
+ .
+ 3) | sys_ioctl() {
+ 3) 0.083 us | fget_light();
+ 3) | security_file_ioctl() {
+ 3) 0.066 us | cap_file_ioctl();
+ 3) 0.562 us | }
+ 3) | do_vfs_ioctl() {
+ 3) | drm_ioctl() {
+ 3) 0.075 us | drm_ut_debug_printk();
+ 3) | i915_gem_pwrite_ioctl() {
+ 3) | i915_mutex_lock_interruptible() {
+ 3) 0.070 us | mutex_lock_interruptible();
+ 3) 0.570 us | }
+ 3) | drm_gem_object_lookup() {
+ 3) | _raw_spin_lock() {
+ 3) 0.080 us | add_preempt_count();
+ 3) 0.620 us | }
+ 3) | _raw_spin_unlock() {
+ 3) 0.085 us | sub_preempt_count();
+ 3) 0.562 us | }
+ 3) 2.149 us | }
+ 3) 0.133 us | i915_gem_object_pin();
+ 3) | i915_gem_object_set_to_gtt_domain() {
+ 3) 0.065 us | i915_gem_object_flush_gpu_write_domain();
+ 3) 0.065 us | i915_gem_object_wait_rendering();
+ 3) 0.062 us | i915_gem_object_flush_cpu_write_domain();
+ 3) 1.612 us | }
+ 3) | i915_gem_object_put_fence() {
+ 3) 0.097 us | i915_gem_object_flush_fence.constprop.36();
+ 3) 0.645 us | }
+ 3) 0.070 us | add_preempt_count();
+ 3) 0.070 us | sub_preempt_count();
+ 3) 0.073 us | i915_gem_object_unpin();
+ 3) 0.068 us | mutex_unlock();
+ 3) 9.924 us | }
+ 3) + 11.236 us | }
+ 3) + 11.770 us | }
+ 3) + 13.784 us | }
+ 3) | sys_ioctl() {
+ </literallayout>
+ As you can see, the function_graph display is much easier to
+ follow. Also note that in addition to the function calls and
+ associated braces, other events such as scheduler events
+ are displayed in context. In fact, you can freely include
+ any tracepoint available in the trace events subsystem described
+ in the next section by simply enabling those events, and they'll
+ appear in context in the function graph display. Quite a
+ powerful tool for understanding kernel dynamics.
+ </para>
+
+ <para>
+ Also notice that there are various annotations on the left
+ hand side of the display. For example if the total time it
+ took for a given function to execute is above a certain
+ threshold, an exclamation point or plus sign appears on the
+ left hand side. Please see the ftrace documentation for
+ details on all these fields.
+ </para>
+ </section>
+
+ <section id='the-trace-events-subsystem'>
+ <title>The 'trace events' Subsystem</title>
+
+ <para>
+ One especially important directory contained within
+ the /sys/kernel/debug/tracing directory is the 'events'
+ subdirectory, which contains representations of every
+ tracepoint in the system. Listing out the contents of
+ the 'events' subdirectory, we see mainly another set of
+ subdirectories:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# cd events
+ root@sugarbay:/sys/kernel/debug/tracing/events# ls -al
+ drwxr-xr-x 38 root root 0 Nov 14 23:19 .
+ drwxr-xr-x 5 root root 0 Nov 14 23:19 ..
+ drwxr-xr-x 19 root root 0 Nov 14 23:19 block
+ drwxr-xr-x 32 root root 0 Nov 14 23:19 btrfs
+ drwxr-xr-x 5 root root 0 Nov 14 23:19 drm
+ -rw-r--r-- 1 root root 0 Nov 14 23:19 enable
+ drwxr-xr-x 40 root root 0 Nov 14 23:19 ext3
+ drwxr-xr-x 79 root root 0 Nov 14 23:19 ext4
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 ftrace
+ drwxr-xr-x 8 root root 0 Nov 14 23:19 hda
+ -r--r--r-- 1 root root 0 Nov 14 23:19 header_event
+ -r--r--r-- 1 root root 0 Nov 14 23:19 header_page
+ drwxr-xr-x 25 root root 0 Nov 14 23:19 i915
+ drwxr-xr-x 7 root root 0 Nov 14 23:19 irq
+ drwxr-xr-x 12 root root 0 Nov 14 23:19 jbd
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 jbd2
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 kmem
+ drwxr-xr-x 7 root root 0 Nov 14 23:19 module
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 napi
+ drwxr-xr-x 6 root root 0 Nov 14 23:19 net
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 oom
+ drwxr-xr-x 12 root root 0 Nov 14 23:19 power
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 printk
+ drwxr-xr-x 8 root root 0 Nov 14 23:19 random
+ drwxr-xr-x 4 root root 0 Nov 14 23:19 raw_syscalls
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 rcu
+ drwxr-xr-x 6 root root 0 Nov 14 23:19 rpm
+ drwxr-xr-x 20 root root 0 Nov 14 23:19 sched
+ drwxr-xr-x 7 root root 0 Nov 14 23:19 scsi
+ drwxr-xr-x 4 root root 0 Nov 14 23:19 signal
+ drwxr-xr-x 5 root root 0 Nov 14 23:19 skb
+ drwxr-xr-x 4 root root 0 Nov 14 23:19 sock
+ drwxr-xr-x 10 root root 0 Nov 14 23:19 sunrpc
+ drwxr-xr-x 538 root root 0 Nov 14 23:19 syscalls
+ drwxr-xr-x 4 root root 0 Nov 14 23:19 task
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 timer
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 udp
+ drwxr-xr-x 21 root root 0 Nov 14 23:19 vmscan
+ drwxr-xr-x 3 root root 0 Nov 14 23:19 vsyscall
+ drwxr-xr-x 6 root root 0 Nov 14 23:19 workqueue
+ drwxr-xr-x 26 root root 0 Nov 14 23:19 writeback
+ </literallayout>
+ Each one of these subdirectories corresponds to a
+ 'subsystem' and contains yet again more subdirectories,
+ each one of those finally corresponding to a tracepoint.
+ For example, here are the contents of the 'kmem' subsystem:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing/events# cd kmem
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem# ls -al
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 .
+ drwxr-xr-x 38 root root 0 Nov 14 23:19 ..
+ -rw-r--r-- 1 root root 0 Nov 14 23:19 enable
+ -rw-r--r-- 1 root root 0 Nov 14 23:19 filter
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kfree
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kmalloc
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kmalloc_node
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_alloc
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_alloc_node
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 kmem_cache_free
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc_extfrag
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_alloc_zone_locked
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_free
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_free_batched
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 mm_page_pcpu_drain
+ </literallayout>
+ Let's see what's inside the subdirectory for a specific
+ tracepoint, in this case the one for kmalloc:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem# cd kmalloc
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# ls -al
+ drwxr-xr-x 2 root root 0 Nov 14 23:19 .
+ drwxr-xr-x 14 root root 0 Nov 14 23:19 ..
+ -rw-r--r-- 1 root root 0 Nov 14 23:19 enable
+ -rw-r--r-- 1 root root 0 Nov 14 23:19 filter
+ -r--r--r-- 1 root root 0 Nov 14 23:19 format
+ -r--r--r-- 1 root root 0 Nov 14 23:19 id
+ </literallayout>
+ The 'format' file for the tracepoint describes the event
+ in memory, which is used by the various tracing tools
+ that now make use of these tracepoint to parse the event
+ and make sense of it, along with a 'print fmt' field that
+ allows tools like ftrace to display the event as text.
+ Here's what the format of the kmalloc event looks like:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# cat format
+ name: kmalloc
+ ID: 313
+ format:
+ field:unsigned short common_type; offset:0; size:2; signed:0;
+ field:unsigned char common_flags; offset:2; size:1; signed:0;
+ field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
+ field:int common_pid; offset:4; size:4; signed:1;
+ field:int common_padding; offset:8; size:4; signed:1;
+
+ field:unsigned long call_site; offset:16; size:8; signed:0;
+ field:const void * ptr; offset:24; size:8; signed:0;
+ field:size_t bytes_req; offset:32; size:8; signed:0;
+ field:size_t bytes_alloc; offset:40; size:8; signed:0;
+ field:gfp_t gfp_flags; offset:48; size:4; signed:0;
+
+ print fmt: "call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", REC->call_site, REC->ptr, REC->bytes_req, REC->bytes_alloc,
+ (REC->gfp_flags) ? __print_flags(REC->gfp_flags, "|", {(unsigned long)(((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | ((
+ gfp_t)0x20000u) | (( gfp_t)0x02u) | (( gfp_t)0x08u)) | (( gfp_t)0x4000u) | (( gfp_t)0x10000u) | (( gfp_t)0x1000u) | (( gfp_t)0x200u) | ((
+ gfp_t)0x400000u)), "GFP_TRANSHUGE"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x20000u) | ((
+ gfp_t)0x02u) | (( gfp_t)0x08u)), "GFP_HIGHUSER_MOVABLE"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | ((
+ gfp_t)0x20000u) | (( gfp_t)0x02u)), "GFP_HIGHUSER"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | ((
+ gfp_t)0x20000u)), "GFP_USER"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u) | (( gfp_t)0x80000u)), GFP_TEMPORARY"},
+ {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u) | (( gfp_t)0x80u)), "GFP_KERNEL"}, {(unsigned long)((( gfp_t)0x10u) | (( gfp_t)0x40u)),
+ "GFP_NOFS"}, {(unsigned long)((( gfp_t)0x20u)), "GFP_ATOMIC"}, {(unsigned long)((( gfp_t)0x10u)), "GFP_NOIO"}, {(unsigned long)((
+ gfp_t)0x20u), "GFP_HIGH"}, {(unsigned long)(( gfp_t)0x10u), "GFP_WAIT"}, {(unsigned long)(( gfp_t)0x40u), "GFP_IO"}, {(unsigned long)((
+ gfp_t)0x100u), "GFP_COLD"}, {(unsigned long)(( gfp_t)0x200u), "GFP_NOWARN"}, {(unsigned long)(( gfp_t)0x400u), "GFP_REPEAT"}, {(unsigned
+ long)(( gfp_t)0x800u), "GFP_NOFAIL"}, {(unsigned long)(( gfp_t)0x1000u), "GFP_NORETRY"}, {(unsigned long)(( gfp_t)0x4000u), "GFP_COMP"},
+ {(unsigned long)(( gfp_t)0x8000u), "GFP_ZERO"}, {(unsigned long)(( gfp_t)0x10000u), "GFP_NOMEMALLOC"}, {(unsigned long)(( gfp_t)0x20000u),
+ "GFP_HARDWALL"}, {(unsigned long)(( gfp_t)0x40000u), "GFP_THISNODE"}, {(unsigned long)(( gfp_t)0x80000u), "GFP_RECLAIMABLE"}, {(unsigned
+ long)(( gfp_t)0x08u), "GFP_MOVABLE"}, {(unsigned long)(( gfp_t)0), "GFP_NOTRACK"}, {(unsigned long)(( gfp_t)0x400000u), "GFP_NO_KSWAPD"},
+ {(unsigned long)(( gfp_t)0x800000u), "GFP_OTHER_NODE"} ) : "GFP_NOWAIT"
+ </literallayout>
+ The 'enable' file in the tracepoint directory is what allows
+ the user (or tools such as trace-cmd) to actually turn the
+ tracepoint on and off. When enabled, the corresponding
+ tracepoint will start appearing in the ftrace 'trace'
+ file described previously. For example, this turns on the
+ kmalloc tracepoint:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# echo 1 > enable
+ </literallayout>
+ At the moment, we're not interested in the function tracer or
+ some other tracer that might be in effect, so we first turn
+ it off, but if we do that, we still need to turn tracing on in
+ order to see the events in the output buffer:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# echo nop > current_tracer
+ root@sugarbay:/sys/kernel/debug/tracing# echo 1 > tracing_on
+ </literallayout>
+ Now, if we look at the the 'trace' file, we see nothing
+ but the kmalloc events we just turned on:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing# cat trace | less
+ # tracer: nop
+ #
+ # entries-in-buffer/entries-written: 1897/1897 #P:8
+ #
+ # _-----=&gt; irqs-off
+ # / _----=&gt; need-resched
+ # | / _---=&gt; hardirq/softirq
+ # || / _--=&gt; preempt-depth
+ # ||| / delay
+ # TASK-PID CPU# |||| TIMESTAMP FUNCTION
+ # | | | |||| | |
+ dropbear-1465 [000] ...1 18154.620753: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18154.621640: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ &lt;idle&gt;-0 [000] ..s3 18154.621656: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ matchbox-termin-1361 [001] ...1 18154.755472: kmalloc: call_site=ffffffff81614050 ptr=ffff88006d5f0e00 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_REPEAT
+ Xorg-1264 [002] ...1 18154.755581: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY
+ Xorg-1264 [002] ...1 18154.755583: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO
+ Xorg-1264 [002] ...1 18154.755589: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO
+ matchbox-termin-1361 [001] ...1 18155.354594: kmalloc: call_site=ffffffff81614050 ptr=ffff88006db35400 bytes_req=576 bytes_alloc=1024 gfp_flags=GFP_KERNEL|GFP_REPEAT
+ Xorg-1264 [002] ...1 18155.354703: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY
+ Xorg-1264 [002] ...1 18155.354705: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO
+ Xorg-1264 [002] ...1 18155.354711: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO
+ &lt;idle&gt;-0 [000] ..s3 18155.673319: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ dropbear-1465 [000] ...1 18155.673525: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18155.674821: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ &lt;idle&gt;-0 [000] ..s3 18155.793014: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ dropbear-1465 [000] ...1 18155.793219: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18155.794147: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ &lt;idle&gt;-0 [000] ..s3 18155.936705: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ dropbear-1465 [000] ...1 18155.936910: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18155.937869: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ matchbox-termin-1361 [001] ...1 18155.953667: kmalloc: call_site=ffffffff81614050 ptr=ffff88006d5f2000 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_REPEAT
+ Xorg-1264 [002] ...1 18155.953775: kmalloc: call_site=ffffffff8141abe8 ptr=ffff8800734f4cc0 bytes_req=168 bytes_alloc=192 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_NORETRY
+ Xorg-1264 [002] ...1 18155.953777: kmalloc: call_site=ffffffff814192a3 ptr=ffff88001f822520 bytes_req=24 bytes_alloc=32 gfp_flags=GFP_KERNEL|GFP_ZERO
+ Xorg-1264 [002] ...1 18155.953783: kmalloc: call_site=ffffffff81419edb ptr=ffff8800721a2f00 bytes_req=64 bytes_alloc=64 gfp_flags=GFP_KERNEL|GFP_ZERO
+ &lt;idle&gt;-0 [000] ..s3 18156.176053: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ dropbear-1465 [000] ...1 18156.176257: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18156.177717: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ &lt;idle&gt;-0 [000] ..s3 18156.399229: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d555800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ dropbear-1465 [000] ...1 18156.399434: kmalloc: call_site=ffffffff816650d4 ptr=ffff8800729c3000 bytes_http://rostedt.homelinux.com/kernelshark/req=2048 bytes_alloc=2048 gfp_flags=GFP_KERNEL
+ &lt;idle&gt;-0 [000] ..s3 18156.400660: kmalloc: call_site=ffffffff81619b36 ptr=ffff88006d554800 bytes_req=512 bytes_alloc=512 gfp_flags=GFP_ATOMIC
+ matchbox-termin-1361 [001] ...1 18156.552800: kmalloc: call_site=ffffffff81614050 ptr=ffff88006db34800 bytes_req=576 bytes_alloc=1024 gfp_flags=GFP_KERNEL|GFP_REPEAT
+ </literallayout>
+ To again disable the kmalloc event, we need to send 0 to the
+ enable file:
+ <literallayout class='monospaced'>
+ root@sugarbay:/sys/kernel/debug/tracing/events/kmem/kmalloc# echo 0 > enable
+ </literallayout>
+ You can enable any number of events or complete subsystems
+ (by using the 'enable' file in the subsystem directory) and
+ get an arbitrarily fine-grained idea of what's going on in the
+ system by enabling as many of the appropriate tracepoints
+ as applicable.
+ </para>
+
+ <para>
+ A number of the tools described in this HOWTO do just that,
+ including trace-cmd and kernelshark in the next section.
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> These tracepoints and their representation
+ are used not only by ftrace, but by many of the other tools
+ covered in this document and they form a central point of
+ integration for the various tracers available in Linux.
+ They form a central part of the instrumentation for the
+ following tools: perf, lttng, ftrace, blktrace and SystemTap
+ </informalexample>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> Eventually all the special-purpose tracers
+ currently available in /sys/kernel/debug/tracing will be
+ removed and replaced with equivalent tracers based on the
+ 'trace events' subsystem.
+ </informalexample>
+ </section>
+
+ <section id='trace-cmd-kernelshark'>
+ <title>trace-cmd/kernelshark</title>
+
+ <para>
+ trace-cmd is essentially an extensive command-line 'wrapper'
+ interface that hides the details of all the individual files
+ in /sys/kernel/debug/tracing, allowing users to specify
+ specific particular events within the
+ /sys/kernel/debug/tracing/events/ subdirectory and to collect
+ traces and avoid having to deal with those details directly.
+ </para>
+
+ <para>
+ As yet another layer on top of that, kernelshark provides a GUI
+ that allows users to start and stop traces and specify sets
+ of events using an intuitive interface, and view the
+ output as both trace events and as a per-CPU graphical
+ display. It directly uses 'trace-cmd' as the plumbing
+ that accomplishes all that underneath the covers (and
+ actually displays the trace-cmd command it uses, as we'll see).
+ </para>
+
+ <para>
+ To start a trace using kernelshark, first start kernelshark:
+ <literallayout class='monospaced'>
+ root@sugarbay:~# kernelshark
+ </literallayout>
+ Then bring up the 'Capture' dialog by choosing from the
+ kernelshark menu:
+ <literallayout class='monospaced'>
+ Capture | Record
+ </literallayout>
+ That will display the following dialog, which allows you to
+ choose one or more events (or even one or more complete
+ subsystems) to trace:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/kernelshark-choose-events.png" width="6in" depth="6in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Note that these are exactly the same sets of events described
+ in the previous trace events subsystem section, and in fact
+ is where trace-cmd gets them for kernelshark.
+ </para>
+
+ <para>
+ In the above screenshot, we've decided to explore the
+ graphics subsystem a bit and so have chosen to trace all
+ the tracepoints contained within the 'i915' and 'drm'
+ subsystems.
+ </para>
+
+ <para>
+ After doing that, we can start and stop the trace using
+ the 'Run' and 'Stop' button on the lower right corner of
+ the dialog (the same button will turn into the 'Stop'
+ button after the trace has started):
+ </para>
+
+ <para>
+ <imagedata fileref="figures/kernelshark-output-display.png" width="6in" depth="6in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Notice that the right-hand pane shows the exact trace-cmd
+ command-line that's used to run the trace, along with the
+ results of the trace-cmd run.
+ </para>
+
+ <para>
+ Once the 'Stop' button is pressed, the graphical view magically
+ fills up with a colorful per-cpu display of the trace data,
+ along with the detailed event listing below that:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/kernelshark-i915-display.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Here's another example, this time a display resulting
+ from tracing 'all events':
+ </para>
+
+ <para>
+ <imagedata fileref="figures/kernelshark-all.png" width="6in" depth="7in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ The tool is pretty self-explanatory, but for more detailed
+ information on navigating through the data, see the
+ <ulink url='http://rostedt.homelinux.com/kernelshark/'>kernelshark website</ulink>.
+ </para>
+ </section>
+
+ <section id='ftrace-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ The documentation for ftrace can be found in the kernel
+ Documentation directory:
+ <literallayout class='monospaced'>
+ Documentation/trace/ftrace.txt
+ </literallayout>
+ The documentation for the trace event subsystem can also
+ be found in the kernel Documentation directory:
+ <literallayout class='monospaced'>
+ Documentation/trace/events.txt
+ </literallayout>
+ There is a nice series of articles on using
+ ftrace and trace-cmd at LWN:
+ <itemizedlist>
+ <listitem><para><ulink url='http://lwn.net/Articles/365835/'>Debugging the kernel using Ftrace - part 1</ulink>
+ </para></listitem>
+ <listitem><para><ulink url='http://lwn.net/Articles/366796/'>Debugging the kernel using Ftrace - part 2</ulink>
+ </para></listitem>
+ <listitem><para><ulink url='http://lwn.net/Articles/370423/'>Secrets of the Ftrace function tracer</ulink>
+ </para></listitem>
+ <listitem><para><ulink url='https://lwn.net/Articles/410200/'>trace-cmd: A front-end for Ftrace</ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ There's more detailed documentation kernelshark usage here:
+ <ulink url='http://rostedt.homelinux.com/kernelshark/'>KernelShark</ulink>
+ </para>
+
+ <para>
+ An amusing yet useful README (a tracing mini-HOWTO) can be
+ found in /sys/kernel/debug/tracing/README.
+ </para>
+ </section>
+</section>
+
+<section id='profile-manual-systemtap'>
+ <title>systemtap</title>
+
+ <para>
+ SystemTap is a system-wide script-based tracing and profiling tool.
+ </para>
+
+ <para>
+ SystemTap scripts are C-like programs that are executed in the
+ kernel to gather/print/aggregate data extracted from the context
+ they end up being invoked under.
+ </para>
+
+ <para>
+ For example, this probe from the
+ <ulink url='http://sourceware.org/systemtap/tutorial/'>SystemTap tutorial</ulink>
+ simply prints a line every time any process on the system open()s
+ a file. For each line, it prints the executable name of the
+ program that opened the file, along with its PID, and the name
+ of the file it opened (or tried to open), which it extracts
+ from the open syscall's argstr.
+ <literallayout class='monospaced'>
+ probe syscall.open
+ {
+ printf ("%s(%d) open (%s)\n", execname(), pid(), argstr)
+ }
+
+ probe timer.ms(4000) # after 4 seconds
+ {
+ exit ()
+ }
+ </literallayout>
+ Normally, to execute this probe, you'd simply install
+ systemtap on the system you want to probe, and directly run
+ the probe on that system e.g. assuming the name of the file
+ containing the above text is trace_open.stp:
+ <literallayout class='monospaced'>
+ # stap trace_open.stp
+ </literallayout>
+ What systemtap does under the covers to run this probe is 1)
+ parse and convert the probe to an equivalent 'C' form, 2)
+ compile the 'C' form into a kernel module, 3) insert the
+ module into the kernel, which arms it, and 4) collect the data
+ generated by the probe and display it to the user.
+ </para>
+
+ <para>
+ In order to accomplish steps 1 and 2, the 'stap' program needs
+ access to the kernel build system that produced the kernel
+ that the probed system is running. In the case of a typical
+ embedded system (the 'target'), the kernel build system
+ unfortunately isn't typically part of the image running on
+ the target. It is normally available on the 'host' system
+ that produced the target image however; in such cases,
+ steps 1 and 2 are executed on the host system, and steps
+ 3 and 4 are executed on the target system, using only the
+ systemtap 'runtime'.
+ </para>
+
+ <para>
+ The systemtap support in Yocto assumes that only steps
+ 3 and 4 are run on the target; it is possible to do
+ everything on the target, but this section assumes only
+ the typical embedded use-case.
+ </para>
+
+ <para>
+ So basically what you need to do in order to run a systemtap
+ script on the target is to 1) on the host system, compile the
+ probe into a kernel module that makes sense to the target, 2)
+ copy the module onto the target system and 3) insert the
+ module into the target kernel, which arms it, and 4) collect
+ the data generated by the probe and display it to the user.
+ </para>
+
+ <section id='systemtap-setup'>
+ <title>Setup</title>
+
+ <para>
+ Those are a lot of steps and a lot of details, but
+ fortunately Yocto includes a script called 'crosstap'
+ that will take care of those details, allowing you to
+ simply execute a systemtap script on the remote target,
+ with arguments if necessary.
+ </para>
+
+ <para>
+ In order to do this from a remote host, however, you
+ need to have access to the build for the image you
+ booted. The 'crosstap' script provides details on how
+ to do this if you run the script on the host without having
+ done a build:
+ <note>
+ SystemTap, which uses 'crosstap', assumes you can establish an
+ ssh connection to the remote target.
+ Please refer to the crosstap wiki page for details on verifying
+ ssh connections at
+ <ulink url='https://wiki.yoctoproject.org/wiki/Tracing_and_Profiling#systemtap'></ulink>.
+ Also, the ability to ssh into the target system is not enabled
+ by default in *-minimal images.
+ </note>
+ <literallayout class='monospaced'>
+ $ crosstap root@192.168.1.88 trace_open.stp
+
+ Error: No target kernel build found.
+ Did you forget to create a local build of your image?
+
+ 'crosstap' requires a local sdk build of the target system
+ (or a build that includes 'tools-profile') in order to build
+ kernel modules that can probe the target system.
+
+ Practically speaking, that means you need to do the following:
+ - If you're running a pre-built image, download the release
+ and/or BSP tarballs used to build the image.
+ - If you're working from git sources, just clone the metadata
+ and BSP layers needed to build the image you'll be booting.
+ - Make sure you're properly set up to build a new image (see
+ the BSP README and/or the widely available basic documentation
+ that discusses how to build images).
+ - Build an -sdk version of the image e.g.:
+ $ bitbake core-image-sato-sdk
+ OR
+ - Build a non-sdk image but include the profiling tools:
+ [ edit local.conf and add 'tools-profile' to the end of
+ the EXTRA_IMAGE_FEATURES variable ]
+ $ bitbake core-image-sato
+
+ Once you've build the image on the host system, you're ready to
+ boot it (or the equivalent pre-built image) and use 'crosstap'
+ to probe it (you need to source the environment as usual first):
+
+ $ source oe-init-build-env
+ $ cd ~/my/systemtap/scripts
+ $ crosstap root@192.168.1.xxx myscript.stp
+ </literallayout>
+ So essentially what you need to do is build an SDK image or
+ image with 'tools-profile' as detailed in the
+ "<link linkend='profile-manual-general-setup'>General Setup</link>"
+ section of this manual, and boot the resulting target image.
+ </para>
+
+ <note>
+ If you have a build directory containing multiple machines,
+ you need to have the MACHINE you're connecting to selected
+ in local.conf, and the kernel in that machine's build
+ directory must match the kernel on the booted system exactly,
+ or you'll get the above 'crosstap' message when you try to
+ invoke a script.
+ </note>
+ </section>
+
+ <section id='running-a-script-on-a-target'>
+ <title>Running a Script on a Target</title>
+
+ <para>
+ Once you've done that, you should be able to run a systemtap
+ script on the target:
+ <literallayout class='monospaced'>
+ $ cd /path/to/yocto
+ $ source oe-init-build-env
+
+ ### Shell environment set up for builds. ###
+
+ You can now run 'bitbake &lt;target&gt;'
+
+ Common targets are:
+ core-image-minimal
+ core-image-sato
+ meta-toolchain
+ meta-ide-support
+
+ You can also run generated qemu images with a command like 'runqemu qemux86'
+
+ </literallayout>
+ Once you've done that, you can cd to whatever directory
+ contains your scripts and use 'crosstap' to run the script:
+ <literallayout class='monospaced'>
+ $ cd /path/to/my/systemap/script
+ $ crosstap root@192.168.7.2 trace_open.stp
+ </literallayout>
+ If you get an error connecting to the target e.g.:
+ <literallayout class='monospaced'>
+ $ crosstap root@192.168.7.2 trace_open.stp
+ error establishing ssh connection on remote 'root@192.168.7.2'
+ </literallayout>
+ Try ssh'ing to the target and see what happens:
+ <literallayout class='monospaced'>
+ $ ssh root@192.168.7.2
+ </literallayout>
+ A lot of the time, connection problems are due specifying a
+ wrong IP address or having a 'host key verification error'.
+ </para>
+
+ <para>
+ If everything worked as planned, you should see something
+ like this (enter the password when prompted, or press enter
+ if it's set up to use no password):
+ <literallayout class='monospaced'>
+ $ crosstap root@192.168.7.2 trace_open.stp
+ root@192.168.7.2's password:
+ matchbox-termin(1036) open ("/tmp/vte3FS2LW", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600)
+ matchbox-termin(1036) open ("/tmp/vteJMC7LW", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600)
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='systemtap-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ The SystemTap language reference can be found here:
+ <ulink url='http://sourceware.org/systemtap/langref/'>SystemTap Language Reference</ulink>
+ </para>
+
+ <para>
+ Links to other SystemTap documents, tutorials, and examples can be
+ found here:
+ <ulink url='http://sourceware.org/systemtap/documentation.html'>SystemTap documentation page</ulink>
+ </para>
+ </section>
+</section>
+
+<section id='profile-manual-sysprof'>
+ <title>Sysprof</title>
+
+ <para>
+ Sysprof is a very easy to use system-wide profiler that consists
+ of a single window with three panes and a few buttons which allow
+ you to start, stop, and view the profile from one place.
+ </para>
+
+ <section id='sysprof-setup'>
+ <title>Setup</title>
+
+ <para>
+ For this section, we'll assume you've already performed the
+ basic setup outlined in the General Setup section.
+ </para>
+
+ <para>
+ Sysprof is a GUI-based application that runs on the target
+ system. For the rest of this document we assume you've
+ ssh'ed to the host and will be running Sysprof on the
+ target (you can use the '-X' option to ssh and have the
+ Sysprof GUI run on the target but display remotely on the
+ host if you want).
+ </para>
+ </section>
+
+ <section id='sysprof-basic-usage'>
+ <title>Basic Usage</title>
+
+ <para>
+ To start profiling the system, you simply press the 'Start'
+ button. To stop profiling and to start viewing the profile data
+ in one easy step, press the 'Profile' button.
+ </para>
+
+ <para>
+ Once you've pressed the profile button, the three panes will
+ fill up with profiling data:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sysprof-copy-to-user.png" width="6in" depth="4in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ The left pane shows a list of functions and processes.
+ Selecting one of those expands that function in the right
+ pane, showing all its callees. Note that this caller-oriented
+ display is essentially the inverse of perf's default
+ callee-oriented callchain display.
+ </para>
+
+ <para>
+ In the screenshot above, we're focusing on __copy_to_user_ll()
+ and looking up the callchain we can see that one of the callers
+ of __copy_to_user_ll is sys_read() and the complete callpath
+ between them. Notice that this is essentially a portion of the
+ same information we saw in the perf display shown in the perf
+ section of this page.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sysprof-copy-from-user.png" width="6in" depth="4in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Similarly, the above is a snapshot of the Sysprof display of a
+ copy-from-user callchain.
+ </para>
+
+ <para>
+ Finally, looking at the third Sysprof pane in the lower left,
+ we can see a list of all the callers of a particular function
+ selected in the top left pane. In this case, the lower pane is
+ showing all the callers of __mark_inode_dirty:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sysprof-callers.png" width="6in" depth="4in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ Double-clicking on one of those functions will in turn change the
+ focus to the selected function, and so on.
+ </para>
+
+ <informalexample>
+ <emphasis>Tying it Together:</emphasis> If you like sysprof's 'caller-oriented'
+ display, you may be able to approximate it in other tools as
+ well. For example, 'perf report' has the -g (--call-graph)
+ option that you can experiment with; one of the options is
+ 'caller' for an inverted caller-based callgraph display.
+ </informalexample>
+ </section>
+
+ <section id='sysprof-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ There doesn't seem to be any documentation for Sysprof, but
+ maybe that's because it's pretty self-explanatory.
+ The Sysprof website, however, is here:
+ <ulink url='http://sysprof.com/'>Sysprof, System-wide Performance Profiler for Linux</ulink>
+ </para>
+ </section>
+</section>
+
+<section id='lttng-linux-trace-toolkit-next-generation'>
+ <title>LTTng (Linux Trace Toolkit, next generation)</title>
+
+ <section id='lttng-setup'>
+ <title>Setup</title>
+
+ <para>
+ For this section, we'll assume you've already performed the
+ basic setup outlined in the General Setup section.
+ </para>
+
+ <para>
+ LTTng is run on the target system by ssh'ing to it.
+ However, if you want to see the traces graphically,
+ install Eclipse as described in section
+ "<link linkend='manually-copying-a-trace-to-the-host-and-viewing-it-in-eclipse'>Manually copying a trace to the host and viewing it in Eclipse (i.e. using Eclipse without network support)</link>"
+ and follow the directions to manually copy traces to the host and
+ view them in Eclipse (i.e. using Eclipse without network support).
+ </para>
+
+ <note>
+ Be sure to download and install/run the 'SR1' or later Juno release
+ of eclipse e.g.:
+ <ulink url='http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-cpp-juno-SR1-linux-gtk-x86_64.tar.gz'>http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/SR1/eclipse-cpp-juno-SR1-linux-gtk-x86_64.tar.gz</ulink>
+ </note>
+ </section>
+
+ <section id='collecting-and-viewing-traces'>
+ <title>Collecting and Viewing Traces</title>
+
+ <para>
+ Once you've applied the above commits and built and booted your
+ image (you need to build the core-image-sato-sdk image or use one of the
+ other methods described in the General Setup section), you're
+ ready to start tracing.
+ </para>
+
+ <section id='collecting-and-viewing-a-trace-on-the-target-inside-a-shell'>
+ <title>Collecting and viewing a trace on the target (inside a shell)</title>
+
+ <para>
+ First, from the host, ssh to the target:
+ <literallayout class='monospaced'>
+ $ ssh -l root 192.168.1.47
+ The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
+ RSA key fingerprint is 23:bd:c8:b1:a8:71:52:00:ee:00:4f:64:9e:10:b9:7e.
+ Are you sure you want to continue connecting (yes/no)? yes
+ Warning: Permanently added '192.168.1.47' (RSA) to the list of known hosts.
+ root@192.168.1.47's password:
+ </literallayout>
+ Once on the target, use these steps to create a trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng create
+ Spawning a session daemon
+ Session auto-20121015-232120 created.
+ Traces will be written in /home/root/lttng-traces/auto-20121015-232120
+ </literallayout>
+ Enable the events you want to trace (in this case all
+ kernel events):
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng enable-event --kernel --all
+ All kernel events are enabled in channel channel0
+ </literallayout>
+ Start the trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng start
+ Tracing started for session auto-20121015-232120
+ </literallayout>
+ And then stop the trace after awhile or after running
+ a particular workload that you want to trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng stop
+ Tracing stopped for session auto-20121015-232120
+ </literallayout>
+ You can now view the trace in text form on the target:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng view
+ [23:21:56.989270399] (+?.?????????) sys_geteuid: { 1 }, { }
+ [23:21:56.989278081] (+0.000007682) exit_syscall: { 1 }, { ret = 0 }
+ [23:21:56.989286043] (+0.000007962) sys_pipe: { 1 }, { fildes = 0xB77B9E8C }
+ [23:21:56.989321802] (+0.000035759) exit_syscall: { 1 }, { ret = 0 }
+ [23:21:56.989329345] (+0.000007543) sys_mmap_pgoff: { 1 }, { addr = 0x0, len = 10485760, prot = 3, flags = 131362, fd = 4294967295, pgoff = 0 }
+ [23:21:56.989351694] (+0.000022349) exit_syscall: { 1 }, { ret = -1247805440 }
+ [23:21:56.989432989] (+0.000081295) sys_clone: { 1 }, { clone_flags = 0x411, newsp = 0xB5EFFFE4, parent_tid = 0xFFFFFFFF, child_tid = 0x0 }
+ [23:21:56.989477129] (+0.000044140) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 681660, vruntime = 43367983388 }
+ [23:21:56.989486697] (+0.000009568) sched_migrate_task: { 1 }, { comm = "lttng-consumerd", tid = 1193, prio = 20, orig_cpu = 1, dest_cpu = 1 }
+ [23:21:56.989508418] (+0.000021721) hrtimer_init: { 1 }, { hrtimer = 3970832076, clockid = 1, mode = 1 }
+ [23:21:56.989770462] (+0.000262044) hrtimer_cancel: { 1 }, { hrtimer = 3993865440 }
+ [23:21:56.989771580] (+0.000001118) hrtimer_cancel: { 0 }, { hrtimer = 3993812192 }
+ [23:21:56.989776957] (+0.000005377) hrtimer_expire_entry: { 1 }, { hrtimer = 3993865440, now = 79815980007057, function = 3238465232 }
+ [23:21:56.989778145] (+0.000001188) hrtimer_expire_entry: { 0 }, { hrtimer = 3993812192, now = 79815980008174, function = 3238465232 }
+ [23:21:56.989791695] (+0.000013550) softirq_raise: { 1 }, { vec = 1 }
+ [23:21:56.989795396] (+0.000003701) softirq_raise: { 0 }, { vec = 1 }
+ [23:21:56.989800635] (+0.000005239) softirq_raise: { 0 }, { vec = 9 }
+ [23:21:56.989807130] (+0.000006495) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 330710, vruntime = 43368314098 }
+ [23:21:56.989809993] (+0.000002863) sched_stat_runtime: { 0 }, { comm = "lttng-sessiond", tid = 1181, runtime = 1015313, vruntime = 36976733240 }
+ [23:21:56.989818514] (+0.000008521) hrtimer_expire_exit: { 0 }, { hrtimer = 3993812192 }
+ [23:21:56.989819631] (+0.000001117) hrtimer_expire_exit: { 1 }, { hrtimer = 3993865440 }
+ [23:21:56.989821866] (+0.000002235) hrtimer_start: { 0 }, { hrtimer = 3993812192, function = 3238465232, expires = 79815981000000, softexpires = 79815981000000 }
+ [23:21:56.989822984] (+0.000001118) hrtimer_start: { 1 }, { hrtimer = 3993865440, function = 3238465232, expires = 79815981000000, softexpires = 79815981000000 }
+ [23:21:56.989832762] (+0.000009778) softirq_entry: { 1 }, { vec = 1 }
+ [23:21:56.989833879] (+0.000001117) softirq_entry: { 0 }, { vec = 1 }
+ [23:21:56.989838069] (+0.000004190) timer_cancel: { 1 }, { timer = 3993871956 }
+ [23:21:56.989839187] (+0.000001118) timer_cancel: { 0 }, { timer = 3993818708 }
+ [23:21:56.989841492] (+0.000002305) timer_expire_entry: { 1 }, { timer = 3993871956, now = 79515980, function = 3238277552 }
+ [23:21:56.989842819] (+0.000001327) timer_expire_entry: { 0 }, { timer = 3993818708, now = 79515980, function = 3238277552 }
+ [23:21:56.989854831] (+0.000012012) sched_stat_runtime: { 1 }, { comm = "lttng-consumerd", tid = 1193, runtime = 49237, vruntime = 43368363335 }
+ [23:21:56.989855949] (+0.000001118) sched_stat_runtime: { 0 }, { comm = "lttng-sessiond", tid = 1181, runtime = 45121, vruntime = 36976778361 }
+ [23:21:56.989861257] (+0.000005308) sched_stat_sleep: { 1 }, { comm = "kworker/1:1", tid = 21, delay = 9451318 }
+ [23:21:56.989862374] (+0.000001117) sched_stat_sleep: { 0 }, { comm = "kworker/0:0", tid = 4, delay = 9958820 }
+ [23:21:56.989868241] (+0.000005867) sched_wakeup: { 0 }, { comm = "kworker/0:0", tid = 4, prio = 120, success = 1, target_cpu = 0 }
+ [23:21:56.989869358] (+0.000001117) sched_wakeup: { 1 }, { comm = "kworker/1:1", tid = 21, prio = 120, success = 1, target_cpu = 1 }
+ [23:21:56.989877460] (+0.000008102) timer_expire_exit: { 1 }, { timer = 3993871956 }
+ [23:21:56.989878577] (+0.000001117) timer_expire_exit: { 0 }, { timer = 3993818708 }
+ .
+ .
+ .
+ </literallayout>
+ You can now safely destroy the trace session (note that
+ this doesn't delete the trace - it's still there
+ in ~/lttng-traces):
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng destroy
+ Session auto-20121015-232120 destroyed at /home/root
+ </literallayout>
+ Note that the trace is saved in a directory of the same
+ name as returned by 'lttng create', under the ~/lttng-traces
+ directory (note that you can change this by supplying your
+ own name to 'lttng create'):
+ <literallayout class='monospaced'>
+ root@crownbay:~# ls -al ~/lttng-traces
+ drwxrwx--- 3 root root 1024 Oct 15 23:21 .
+ drwxr-xr-x 5 root root 1024 Oct 15 23:57 ..
+ drwxrwx--- 3 root root 1024 Oct 15 23:21 auto-20121015-232120
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='collecting-and-viewing-a-userspace-trace-on-the-target-inside-a-shell'>
+ <title>Collecting and viewing a userspace trace on the target (inside a shell)</title>
+
+ <para>
+ For LTTng userspace tracing, you need to have a properly
+ instrumented userspace program. For this example, we'll use
+ the 'hello' test program generated by the lttng-ust build.
+ </para>
+
+ <para>
+ The 'hello' test program isn't installed on the rootfs by
+ the lttng-ust build, so we need to copy it over manually.
+ First cd into the build directory that contains the hello
+ executable:
+ <literallayout class='monospaced'>
+ $ cd build/tmp/work/core2_32-poky-linux/lttng-ust/2.0.5-r0/git/tests/hello/.libs
+ </literallayout>
+ Copy that over to the target machine:
+ <literallayout class='monospaced'>
+ $ scp hello root@192.168.1.20:
+ </literallayout>
+ You now have the instrumented lttng 'hello world' test
+ program on the target, ready to test.
+ </para>
+
+ <para>
+ First, from the host, ssh to the target:
+ <literallayout class='monospaced'>
+ $ ssh -l root 192.168.1.47
+ The authenticity of host '192.168.1.47 (192.168.1.47)' can't be established.
+ RSA key fingerprint is 23:bd:c8:b1:a8:71:52:00:ee:00:4f:64:9e:10:b9:7e.
+ Are you sure you want to continue connecting (yes/no)? yes
+ Warning: Permanently added '192.168.1.47' (RSA) to the list of known hosts.
+ root@192.168.1.47's password:
+ </literallayout>
+ Once on the target, use these steps to create a trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng create
+ Session auto-20190303-021943 created.
+ Traces will be written in /home/root/lttng-traces/auto-20190303-021943
+ </literallayout>
+ Enable the events you want to trace (in this case all
+ userspace events):
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng enable-event --userspace --all
+ All UST events are enabled in channel channel0
+ </literallayout>
+ Start the trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng start
+ Tracing started for session auto-20190303-021943
+ </literallayout>
+ Run the instrumented hello world program:
+ <literallayout class='monospaced'>
+ root@crownbay:~# ./hello
+ Hello, World!
+ Tracing... done.
+ </literallayout>
+ And then stop the trace after awhile or after running a
+ particular workload that you want to trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng stop
+ Tracing stopped for session auto-20190303-021943
+ </literallayout>
+ You can now view the trace in text form on the target:
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng view
+ [02:31:14.906146544] (+?.?????????) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 0, intfield2 = 0x0, longfield = 0, netintfield = 0, netintfieldhex = 0x0, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 }
+ [02:31:14.906170360] (+0.000023816) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 1, intfield2 = 0x1, longfield = 1, netintfield = 1, netintfieldhex = 0x1, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 }
+ [02:31:14.906183140] (+0.000012780) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 2, intfield2 = 0x2, longfield = 2, netintfield = 2, netintfieldhex = 0x2, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 }
+ [02:31:14.906194385] (+0.000011245) hello:1424 ust_tests_hello:tptest: { cpu_id = 1 }, { intfield = 3, intfield2 = 0x3, longfield = 3, netintfield = 3, netintfieldhex = 0x3, arrfield1 = [ [0] = 1, [1] = 2, [2] = 3 ], arrfield2 = "test", _seqfield1_length = 4, seqfield1 = [ [0] = 116, [1] = 101, [2] = 115, [3] = 116 ], _seqfield2_length = 4, seqfield2 = "test", stringfield = "test", floatfield = 2222, doublefield = 2, boolfield = 1 }
+ .
+ .
+ .
+ </literallayout>
+ You can now safely destroy the trace session (note that
+ this doesn't delete the trace - it's still
+ there in ~/lttng-traces):
+ <literallayout class='monospaced'>
+ root@crownbay:~# lttng destroy
+ Session auto-20190303-021943 destroyed at /home/root
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='manually-copying-a-trace-to-the-host-and-viewing-it-in-eclipse'>
+ <title>Manually copying a trace to the host and viewing it in Eclipse (i.e. using Eclipse without network support)</title>
+
+ <para>
+ If you already have an LTTng trace on a remote target and
+ would like to view it in Eclipse on the host, you can easily
+ copy it from the target to the host and import it into
+ Eclipse to view it using the LTTng Eclipse plug-in already
+ bundled in the Eclipse (Juno SR1 or greater).
+ </para>
+
+ <para>
+ Using the trace we created in the previous section, archive
+ it and copy it to your host system:
+ <literallayout class='monospaced'>
+ root@crownbay:~/lttng-traces# tar zcvf auto-20121015-232120.tar.gz auto-20121015-232120
+ auto-20121015-232120/
+ auto-20121015-232120/kernel/
+ auto-20121015-232120/kernel/metadata
+ auto-20121015-232120/kernel/channel0_1
+ auto-20121015-232120/kernel/channel0_0
+
+ $ scp root@192.168.1.47:lttng-traces/auto-20121015-232120.tar.gz .
+ root@192.168.1.47's password:
+ auto-20121015-232120.tar.gz 100% 1566KB 1.5MB/s 00:01
+ </literallayout>
+ Unarchive it on the host:
+ <literallayout class='monospaced'>
+ $ gunzip -c auto-20121015-232120.tar.gz | tar xvf -
+ auto-20121015-232120/
+ auto-20121015-232120/kernel/
+ auto-20121015-232120/kernel/metadata
+ auto-20121015-232120/kernel/channel0_1
+ auto-20121015-232120/kernel/channel0_0
+ </literallayout>
+ We can now import the trace into Eclipse and view it:
+ <orderedlist>
+ <listitem><para>First, start eclipse and open the
+ 'LTTng Kernel' perspective by selecting the following
+ menu item:
+ <literallayout class='monospaced'>
+ Window | Open Perspective | Other...
+ </literallayout></para></listitem>
+ <listitem><para>In the dialog box that opens, select
+ 'LTTng Kernel' from the list.</para></listitem>
+ <listitem><para>Back at the main menu, select the
+ following menu item:
+ <literallayout class='monospaced'>
+ File | New | Project...
+ </literallayout></para></listitem>
+ <listitem><para>In the dialog box that opens, select
+ the 'Tracing | Tracing Project' wizard and press
+ 'Next>'.</para></listitem>
+ <listitem><para>Give the project a name and press
+ 'Finish'.</para></listitem>
+ <listitem><para>In the 'Project Explorer' pane under
+ the project you created, right click on the
+ 'Traces' item.</para></listitem>
+ <listitem><para>Select 'Import..." and in the dialog
+ that's displayed:</para></listitem>
+ <listitem><para>Browse the filesystem and find the
+ select the 'kernel' directory containing the trace
+ you copied from the target
+ e.g. auto-20121015-232120/kernel</para></listitem>
+ <listitem><para>'Checkmark' the directory in the tree
+ that's displayed for the trace</para></listitem>
+ <listitem><para>Below that, select 'Common Trace Format:
+ Kernel Trace' for the 'Trace Type'</para></listitem>
+ <listitem><para>Press 'Finish' to close the dialog
+ </para></listitem>
+ <listitem><para>Back in the 'Project Explorer' pane,
+ double-click on the 'kernel' item for the
+ trace you just imported under 'Traces'
+ </para></listitem>
+ </orderedlist>
+ You should now see your trace data displayed graphically
+ in several different views in Eclipse:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/lttngmain0.png" width="6in" depth="6in" align="center" scalefit="1" />
+ </para>
+
+ <para>
+ You can access extensive help information on how to use
+ the LTTng plug-in to search and analyze captured traces via
+ the Eclipse help system:
+ <literallayout class='monospaced'>
+ Help | Help Contents | LTTng Plug-in User Guide
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='collecting-and-viewing-a-trace-in-eclipse'>
+ <title>Collecting and viewing a trace in Eclipse</title>
+
+ <note>
+ This section on collecting traces remotely doesn't currently
+ work because of Eclipse 'RSE' connectivity problems. Manually
+ tracing on the target, copying the trace files to the host,
+ and viewing the trace in Eclipse on the host as outlined in
+ previous steps does work however - please use the manual
+ steps outlined above to view traces in Eclipse.
+ </note>
+
+ <para>
+ In order to trace a remote target, you also need to add
+ a 'tracing' group on the target and connect as a user
+ who's part of that group e.g:
+ <literallayout class='monospaced'>
+ # adduser tomz
+ # groupadd -r tracing
+ # usermod -a -G tracing tomz
+ </literallayout>
+ <orderedlist>
+ <listitem><para>First, start eclipse and open the
+ 'LTTng Kernel' perspective by selecting the following
+ menu item:
+ <literallayout class='monospaced'>
+ Window | Open Perspective | Other...
+ </literallayout></para></listitem>
+ <listitem><para>In the dialog box that opens, select
+ 'LTTng Kernel' from the list.</para></listitem>
+ <listitem><para>Back at the main menu, select the
+ following menu item:
+ <literallayout class='monospaced'>
+ File | New | Project...
+ </literallayout></para></listitem>
+ <listitem><para>In the dialog box that opens, select
+ the 'Tracing | Tracing Project' wizard and
+ press 'Next>'.</para></listitem>
+ <listitem><para>Give the project a name and press
+ 'Finish'. That should result in an entry in the
+ 'Project' subwindow.</para></listitem>
+ <listitem><para>In the 'Control' subwindow just below
+ it, press 'New Connection'.</para></listitem>
+ <listitem><para>Add a new connection, giving it the
+ hostname or IP address of the target system.
+ </para></listitem>
+ <listitem><para>Provide the username and password
+ of a qualified user (a member of the 'tracing' group)
+ or root account on the target system.
+ </para></listitem>
+ <listitem><para>Provide appropriate answers to whatever
+ else is asked for e.g. 'secure storage password'
+ can be anything you want.
+ If you get an 'RSE Error' it may be due to proxies.
+ It may be possible to get around the problem by
+ changing the following setting:
+ <literallayout class='monospaced'>
+ Window | Preferences | Network Connections
+ </literallayout>
+ Switch 'Active Provider' to 'Direct'
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='lltng-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ You can find the primary LTTng Documentation on the
+ <ulink url='https://lttng.org/docs/'>LTTng Documentation</ulink>
+ site.
+ The documentation on this site is appropriate for intermediate to
+ advanced software developers who are working in a Linux environment
+ and are interested in efficient software tracing.
+ </para>
+
+ <para>
+ For information on LTTng in general, visit the
+ <ulink url='http://lttng.org/lttng2.0'>LTTng Project</ulink>
+ site.
+ You can find a "Getting Started" link on this site that takes
+ you to an LTTng Quick Start.
+ </para>
+
+ <para>
+ Finally, you can access extensive help information on how to use
+ the LTTng plug-in to search and analyze captured traces via the
+ Eclipse help system:
+ <literallayout class='monospaced'>
+ Help | Help Contents | LTTng Plug-in User Guide
+ </literallayout>
+ </para>
+ </section>
+</section>
+
+<section id='profile-manual-blktrace'>
+ <title>blktrace</title>
+
+ <para>
+ blktrace is a tool for tracing and reporting low-level disk I/O.
+ blktrace provides the tracing half of the equation; its output can
+ be piped into the blkparse program, which renders the data in a
+ human-readable form and does some basic analysis:
+ </para>
+
+ <section id='blktrace-setup'>
+ <title>Setup</title>
+
+ <para>
+ For this section, we'll assume you've already performed the
+ basic setup outlined in the
+ "<link linkend='profile-manual-general-setup'>General Setup</link>"
+ section.
+ </para>
+
+ <para>
+ blktrace is an application that runs on the target system.
+ You can run the entire blktrace and blkparse pipeline on the
+ target, or you can run blktrace in 'listen' mode on the target
+ and have blktrace and blkparse collect and analyze the data on
+ the host (see the
+ "<link linkend='using-blktrace-remotely'>Using blktrace Remotely</link>"
+ section below).
+ For the rest of this section we assume you've ssh'ed to the
+ host and will be running blkrace on the target.
+ </para>
+ </section>
+
+ <section id='blktrace-basic-usage'>
+ <title>Basic Usage</title>
+
+ <para>
+ To record a trace, simply run the 'blktrace' command, giving it
+ the name of the block device you want to trace activity on:
+ <literallayout class='monospaced'>
+ root@crownbay:~# blktrace /dev/sdc
+ </literallayout>
+ In another shell, execute a workload you want to trace.
+ <literallayout class='monospaced'>
+ root@crownbay:/media/sdc# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA
+ </literallayout>
+ Press Ctrl-C in the blktrace shell to stop the trace. It will
+ display how many events were logged, along with the per-cpu file
+ sizes (blktrace records traces in per-cpu kernel buffers and
+ simply dumps them to userspace for blkparse to merge and sort
+ later).
+ <literallayout class='monospaced'>
+ ^C=== sdc ===
+ CPU 0: 7082 events, 332 KiB data
+ CPU 1: 1578 events, 74 KiB data
+ Total: 8660 events (dropped 0), 406 KiB data
+ </literallayout>
+ If you examine the files saved to disk, you see multiple files,
+ one per CPU and with the device name as the first part of the
+ filename:
+ <literallayout class='monospaced'>
+ root@crownbay:~# ls -al
+ drwxr-xr-x 6 root root 1024 Oct 27 22:39 .
+ drwxr-sr-x 4 root root 1024 Oct 26 18:24 ..
+ -rw-r--r-- 1 root root 339938 Oct 27 22:40 sdc.blktrace.0
+ -rw-r--r-- 1 root root 75753 Oct 27 22:40 sdc.blktrace.1
+ </literallayout>
+ To view the trace events, simply invoke 'blkparse' in the
+ directory containing the trace files, giving it the device name
+ that forms the first part of the filenames:
+ <literallayout class='monospaced'>
+ root@crownbay:~# blkparse sdc
+
+ 8,32 1 1 0.000000000 1225 Q WS 3417048 + 8 [jbd2/sdc-8]
+ 8,32 1 2 0.000025213 1225 G WS 3417048 + 8 [jbd2/sdc-8]
+ 8,32 1 3 0.000033384 1225 P N [jbd2/sdc-8]
+ 8,32 1 4 0.000043301 1225 I WS 3417048 + 8 [jbd2/sdc-8]
+ 8,32 1 0 0.000057270 0 m N cfq1225 insert_request
+ 8,32 1 0 0.000064813 0 m N cfq1225 add_to_rr
+ 8,32 1 5 0.000076336 1225 U N [jbd2/sdc-8] 1
+ 8,32 1 0 0.000088559 0 m N cfq workload slice:150
+ 8,32 1 0 0.000097359 0 m N cfq1225 set_active wl_prio:0 wl_type:1
+ 8,32 1 0 0.000104063 0 m N cfq1225 Not idling. st->count:1
+ 8,32 1 0 0.000112584 0 m N cfq1225 fifo= (null)
+ 8,32 1 0 0.000118730 0 m N cfq1225 dispatch_insert
+ 8,32 1 0 0.000127390 0 m N cfq1225 dispatched a request
+ 8,32 1 0 0.000133536 0 m N cfq1225 activate rq, drv=1
+ 8,32 1 6 0.000136889 1225 D WS 3417048 + 8 [jbd2/sdc-8]
+ 8,32 1 7 0.000360381 1225 Q WS 3417056 + 8 [jbd2/sdc-8]
+ 8,32 1 8 0.000377422 1225 G WS 3417056 + 8 [jbd2/sdc-8]
+ 8,32 1 9 0.000388876 1225 P N [jbd2/sdc-8]
+ 8,32 1 10 0.000397886 1225 Q WS 3417064 + 8 [jbd2/sdc-8]
+ 8,32 1 11 0.000404800 1225 M WS 3417064 + 8 [jbd2/sdc-8]
+ 8,32 1 12 0.000412343 1225 Q WS 3417072 + 8 [jbd2/sdc-8]
+ 8,32 1 13 0.000416533 1225 M WS 3417072 + 8 [jbd2/sdc-8]
+ 8,32 1 14 0.000422121 1225 Q WS 3417080 + 8 [jbd2/sdc-8]
+ 8,32 1 15 0.000425194 1225 M WS 3417080 + 8 [jbd2/sdc-8]
+ 8,32 1 16 0.000431968 1225 Q WS 3417088 + 8 [jbd2/sdc-8]
+ 8,32 1 17 0.000435251 1225 M WS 3417088 + 8 [jbd2/sdc-8]
+ 8,32 1 18 0.000440279 1225 Q WS 3417096 + 8 [jbd2/sdc-8]
+ 8,32 1 19 0.000443911 1225 M WS 3417096 + 8 [jbd2/sdc-8]
+ 8,32 1 20 0.000450336 1225 Q WS 3417104 + 8 [jbd2/sdc-8]
+ 8,32 1 21 0.000454038 1225 M WS 3417104 + 8 [jbd2/sdc-8]
+ 8,32 1 22 0.000462070 1225 Q WS 3417112 + 8 [jbd2/sdc-8]
+ 8,32 1 23 0.000465422 1225 M WS 3417112 + 8 [jbd2/sdc-8]
+ 8,32 1 24 0.000474222 1225 I WS 3417056 + 64 [jbd2/sdc-8]
+ 8,32 1 0 0.000483022 0 m N cfq1225 insert_request
+ 8,32 1 25 0.000489727 1225 U N [jbd2/sdc-8] 1
+ 8,32 1 0 0.000498457 0 m N cfq1225 Not idling. st->count:1
+ 8,32 1 0 0.000503765 0 m N cfq1225 dispatch_insert
+ 8,32 1 0 0.000512914 0 m N cfq1225 dispatched a request
+ 8,32 1 0 0.000518851 0 m N cfq1225 activate rq, drv=2
+ .
+ .
+ .
+ 8,32 0 0 58.515006138 0 m N cfq3551 complete rqnoidle 1
+ 8,32 0 2024 58.516603269 3 C WS 3156992 + 16 [0]
+ 8,32 0 0 58.516626736 0 m N cfq3551 complete rqnoidle 1
+ 8,32 0 0 58.516634558 0 m N cfq3551 arm_idle: 8 group_idle: 0
+ 8,32 0 0 58.516636933 0 m N cfq schedule dispatch
+ 8,32 1 0 58.516971613 0 m N cfq3551 slice expired t=0
+ 8,32 1 0 58.516982089 0 m N cfq3551 sl_used=13 disp=6 charge=13 iops=0 sect=80
+ 8,32 1 0 58.516985511 0 m N cfq3551 del_from_rr
+ 8,32 1 0 58.516990819 0 m N cfq3551 put_queue
+
+ CPU0 (sdc):
+ Reads Queued: 0, 0KiB Writes Queued: 331, 26,284KiB
+ Read Dispatches: 0, 0KiB Write Dispatches: 485, 40,484KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 0, 0KiB Writes Completed: 511, 41,000KiB
+ Read Merges: 0, 0KiB Write Merges: 13, 160KiB
+ Read depth: 0 Write depth: 2
+ IO unplugs: 23 Timer unplugs: 0
+ CPU1 (sdc):
+ Reads Queued: 0, 0KiB Writes Queued: 249, 15,800KiB
+ Read Dispatches: 0, 0KiB Write Dispatches: 42, 1,600KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 0, 0KiB Writes Completed: 16, 1,084KiB
+ Read Merges: 0, 0KiB Write Merges: 40, 276KiB
+ Read depth: 0 Write depth: 2
+ IO unplugs: 30 Timer unplugs: 1
+
+ Total (sdc):
+ Reads Queued: 0, 0KiB Writes Queued: 580, 42,084KiB
+ Read Dispatches: 0, 0KiB Write Dispatches: 527, 42,084KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 0, 0KiB Writes Completed: 527, 42,084KiB
+ Read Merges: 0, 0KiB Write Merges: 53, 436KiB
+ IO unplugs: 53 Timer unplugs: 1
+
+ Throughput (R/W): 0KiB/s / 719KiB/s
+ Events (sdc): 6,592 entries
+ Skips: 0 forward (0 - 0.0%)
+ Input file sdc.blktrace.0 added
+ Input file sdc.blktrace.1 added
+ </literallayout>
+ The report shows each event that was found in the blktrace data,
+ along with a summary of the overall block I/O traffic during
+ the run. You can look at the
+ <ulink url='http://linux.die.net/man/1/blkparse'>blkparse</ulink>
+ manpage to learn the
+ meaning of each field displayed in the trace listing.
+ </para>
+
+ <section id='blktrace-live-mode'>
+ <title>Live Mode</title>
+
+ <para>
+ blktrace and blkparse are designed from the ground up to
+ be able to operate together in a 'pipe mode' where the
+ stdout of blktrace can be fed directly into the stdin of
+ blkparse:
+ <literallayout class='monospaced'>
+ root@crownbay:~# blktrace /dev/sdc -o - | blkparse -i -
+ </literallayout>
+ This enables long-lived tracing sessions to run without
+ writing anything to disk, and allows the user to look for
+ certain conditions in the trace data in 'real-time' by
+ viewing the trace output as it scrolls by on the screen or
+ by passing it along to yet another program in the pipeline
+ such as grep which can be used to identify and capture
+ conditions of interest.
+ </para>
+
+ <para>
+ There's actually another blktrace command that implements
+ the above pipeline as a single command, so the user doesn't
+ have to bother typing in the above command sequence:
+ <literallayout class='monospaced'>
+ root@crownbay:~# btrace /dev/sdc
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='using-blktrace-remotely'>
+ <title>Using blktrace Remotely</title>
+
+ <para>
+ Because blktrace traces block I/O and at the same time
+ normally writes its trace data to a block device, and
+ in general because it's not really a great idea to make
+ the device being traced the same as the device the tracer
+ writes to, blktrace provides a way to trace without
+ perturbing the traced device at all by providing native
+ support for sending all trace data over the network.
+ </para>
+
+ <para>
+ To have blktrace operate in this mode, start blktrace on
+ the target system being traced with the -l option, along with
+ the device to trace:
+ <literallayout class='monospaced'>
+ root@crownbay:~# blktrace -l /dev/sdc
+ server: waiting for connections...
+ </literallayout>
+ On the host system, use the -h option to connect to the
+ target system, also passing it the device to trace:
+ <literallayout class='monospaced'>
+ $ blktrace -d /dev/sdc -h 192.168.1.43
+ blktrace: connecting to 192.168.1.43
+ blktrace: connected!
+ </literallayout>
+ On the target system, you should see this:
+ <literallayout class='monospaced'>
+ server: connection from 192.168.1.43
+ </literallayout>
+ In another shell, execute a workload you want to trace.
+ <literallayout class='monospaced'>
+ root@crownbay:/media/sdc# rm linux-2.6.19.2.tar.bz2; wget <ulink url='http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2'>http://downloads.yoctoproject.org/mirror/sources/linux-2.6.19.2.tar.bz2</ulink>; sync
+ Connecting to downloads.yoctoproject.org (140.211.169.59:80)
+ linux-2.6.19.2.tar.b 100% |*******************************| 41727k 0:00:00 ETA
+ </literallayout>
+ When it's done, do a Ctrl-C on the host system to
+ stop the trace:
+ <literallayout class='monospaced'>
+ ^C=== sdc ===
+ CPU 0: 7691 events, 361 KiB data
+ CPU 1: 4109 events, 193 KiB data
+ Total: 11800 events (dropped 0), 554 KiB data
+ </literallayout>
+ On the target system, you should also see a trace
+ summary for the trace just ended:
+ <literallayout class='monospaced'>
+ server: end of run for 192.168.1.43:sdc
+ === sdc ===
+ CPU 0: 7691 events, 361 KiB data
+ CPU 1: 4109 events, 193 KiB data
+ Total: 11800 events (dropped 0), 554 KiB data
+ </literallayout>
+ The blktrace instance on the host will save the target
+ output inside a hostname-timestamp directory:
+ <literallayout class='monospaced'>
+ $ ls -al
+ drwxr-xr-x 10 root root 1024 Oct 28 02:40 .
+ drwxr-sr-x 4 root root 1024 Oct 26 18:24 ..
+ drwxr-xr-x 2 root root 1024 Oct 28 02:40 192.168.1.43-2012-10-28-02:40:56
+ </literallayout>
+ cd into that directory to see the output files:
+ <literallayout class='monospaced'>
+ $ ls -l
+ -rw-r--r-- 1 root root 369193 Oct 28 02:44 sdc.blktrace.0
+ -rw-r--r-- 1 root root 197278 Oct 28 02:44 sdc.blktrace.1
+ </literallayout>
+ And run blkparse on the host system using the device name:
+ <literallayout class='monospaced'>
+ $ blkparse sdc
+
+ 8,32 1 1 0.000000000 1263 Q RM 6016 + 8 [ls]
+ 8,32 1 0 0.000036038 0 m N cfq1263 alloced
+ 8,32 1 2 0.000039390 1263 G RM 6016 + 8 [ls]
+ 8,32 1 3 0.000049168 1263 I RM 6016 + 8 [ls]
+ 8,32 1 0 0.000056152 0 m N cfq1263 insert_request
+ 8,32 1 0 0.000061600 0 m N cfq1263 add_to_rr
+ 8,32 1 0 0.000075498 0 m N cfq workload slice:300
+ .
+ .
+ .
+ 8,32 0 0 177.266385696 0 m N cfq1267 arm_idle: 8 group_idle: 0
+ 8,32 0 0 177.266388140 0 m N cfq schedule dispatch
+ 8,32 1 0 177.266679239 0 m N cfq1267 slice expired t=0
+ 8,32 1 0 177.266689297 0 m N cfq1267 sl_used=9 disp=6 charge=9 iops=0 sect=56
+ 8,32 1 0 177.266692649 0 m N cfq1267 del_from_rr
+ 8,32 1 0 177.266696560 0 m N cfq1267 put_queue
+
+ CPU0 (sdc):
+ Reads Queued: 0, 0KiB Writes Queued: 270, 21,708KiB
+ Read Dispatches: 59, 2,628KiB Write Dispatches: 495, 39,964KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 90, 2,752KiB Writes Completed: 543, 41,596KiB
+ Read Merges: 0, 0KiB Write Merges: 9, 344KiB
+ Read depth: 2 Write depth: 2
+ IO unplugs: 20 Timer unplugs: 1
+ CPU1 (sdc):
+ Reads Queued: 688, 2,752KiB Writes Queued: 381, 20,652KiB
+ Read Dispatches: 31, 124KiB Write Dispatches: 59, 2,396KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 0, 0KiB Writes Completed: 11, 764KiB
+ Read Merges: 598, 2,392KiB Write Merges: 88, 448KiB
+ Read depth: 2 Write depth: 2
+ IO unplugs: 52 Timer unplugs: 0
+
+ Total (sdc):
+ Reads Queued: 688, 2,752KiB Writes Queued: 651, 42,360KiB
+ Read Dispatches: 90, 2,752KiB Write Dispatches: 554, 42,360KiB
+ Reads Requeued: 0 Writes Requeued: 0
+ Reads Completed: 90, 2,752KiB Writes Completed: 554, 42,360KiB
+ Read Merges: 598, 2,392KiB Write Merges: 97, 792KiB
+ IO unplugs: 72 Timer unplugs: 1
+
+ Throughput (R/W): 15KiB/s / 238KiB/s
+ Events (sdc): 9,301 entries
+ Skips: 0 forward (0 - 0.0%)
+ </literallayout>
+ You should see the trace events and summary just as
+ you would have if you'd run the same command on the target.
+ </para>
+ </section>
+
+ <section id='tracing-block-io-via-ftrace'>
+ <title>Tracing Block I/O via 'ftrace'</title>
+
+ <para>
+ It's also possible to trace block I/O using only
+ <link linkend='the-trace-events-subsystem'>trace events subsystem</link>,
+ which can be useful for casual tracing
+ if you don't want to bother dealing with the userspace tools.
+ </para>
+
+ <para>
+ To enable tracing for a given device, use
+ /sys/block/xxx/trace/enable, where xxx is the device name.
+ This for example enables tracing for /dev/sdc:
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing# echo 1 > /sys/block/sdc/trace/enable
+ </literallayout>
+ Once you've selected the device(s) you want to trace,
+ selecting the 'blk' tracer will turn the blk tracer on:
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing# cat available_tracers
+ blk function_graph function nop
+
+ root@crownbay:/sys/kernel/debug/tracing# echo blk > current_tracer
+ </literallayout>
+ Execute the workload you're interested in:
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing# cat /media/sdc/testfile.txt
+ </literallayout>
+ And look at the output (note here that we're using
+ 'trace_pipe' instead of trace to capture this trace -
+ this allows us to wait around on the pipe for data to
+ appear):
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing# cat trace_pipe
+ cat-3587 [001] d..1 3023.276361: 8,32 Q R 1699848 + 8 [cat]
+ cat-3587 [001] d..1 3023.276410: 8,32 m N cfq3587 alloced
+ cat-3587 [001] d..1 3023.276415: 8,32 G R 1699848 + 8 [cat]
+ cat-3587 [001] d..1 3023.276424: 8,32 P N [cat]
+ cat-3587 [001] d..2 3023.276432: 8,32 I R 1699848 + 8 [cat]
+ cat-3587 [001] d..1 3023.276439: 8,32 m N cfq3587 insert_request
+ cat-3587 [001] d..1 3023.276445: 8,32 m N cfq3587 add_to_rr
+ cat-3587 [001] d..2 3023.276454: 8,32 U N [cat] 1
+ cat-3587 [001] d..1 3023.276464: 8,32 m N cfq workload slice:150
+ cat-3587 [001] d..1 3023.276471: 8,32 m N cfq3587 set_active wl_prio:0 wl_type:2
+ cat-3587 [001] d..1 3023.276478: 8,32 m N cfq3587 fifo= (null)
+ cat-3587 [001] d..1 3023.276483: 8,32 m N cfq3587 dispatch_insert
+ cat-3587 [001] d..1 3023.276490: 8,32 m N cfq3587 dispatched a request
+ cat-3587 [001] d..1 3023.276497: 8,32 m N cfq3587 activate rq, drv=1
+ cat-3587 [001] d..2 3023.276500: 8,32 D R 1699848 + 8 [cat]
+ </literallayout>
+ And this turns off tracing for the specified device:
+ <literallayout class='monospaced'>
+ root@crownbay:/sys/kernel/debug/tracing# echo 0 > /sys/block/sdc/trace/enable
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='blktrace-documentation'>
+ <title>Documentation</title>
+
+ <para>
+ Online versions of the man pages for the commands discussed
+ in this section can be found here:
+ <itemizedlist>
+ <listitem><para><ulink url='http://linux.die.net/man/8/blktrace'>http://linux.die.net/man/8/blktrace</ulink>
+ </para></listitem>
+ <listitem><para><ulink url='http://linux.die.net/man/1/blkparse'>http://linux.die.net/man/1/blkparse</ulink>
+ </para></listitem>
+ <listitem><para><ulink url='http://linux.die.net/man/8/btrace'>http://linux.die.net/man/8/btrace</ulink>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The above manpages, along with manpages for the other
+ blktrace utilities (btt, blkiomon, etc) can be found in the
+ /doc directory of the blktrace tools git repo:
+ <literallayout class='monospaced'>
+ $ git clone git://git.kernel.dk/blktrace.git
+ </literallayout>
+ </para>
+ </section>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/profile-manual/profile-manual.xml b/poky/documentation/profile-manual/profile-manual.xml
new file mode 100644
index 000000000..b64875b8c
--- /dev/null
+++ b/poky/documentation/profile-manual/profile-manual.xml
@@ -0,0 +1,163 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='profile-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/profile-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Profiling and Tracing Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">
+ Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by
+ Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Profiling and Tracing Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="profile-manual-intro.xml"/>
+
+ <xi:include href="profile-manual-arch.xml"/>
+
+ <xi:include href="profile-manual-usage.xml"/>
+
+ <xi:include href="profile-manual-examples.xml"/>
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/TODO b/poky/documentation/ref-manual/TODO
new file mode 100644
index 000000000..ee0db977c
--- /dev/null
+++ b/poky/documentation/ref-manual/TODO
@@ -0,0 +1,11 @@
+Handbook Todo List:
+
+ * Document adding a new IMAGE_FEATURE to the customising images section
+ * Add instructions about using zaurus/openmoko emulation
+ * Add component overview/block diagrams
+ * Software Deevelopment intro should mention its software development for
+ intended target and could be a different arch etc and thus special case.
+ * Expand insane.bbclass documentation to cover tests
+ * Document remaining classes (see list in ref-classes)
+ * Document formfactor
+
diff --git a/poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb b/poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb
new file mode 100644
index 000000000..5dfb0b30c
--- /dev/null
+++ b/poky/documentation/ref-manual/examples/hello-autotools/hello_2.3.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "GNU Helloworld application"
+SECTION = "examples"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=adefda309052235aa5d1e99ce7557010"
+
+SRC_URI = "${GNU_MIRROR}/hello/hello-${PV}.tar.bz2"
+
+inherit autotools
diff --git a/poky/documentation/ref-manual/examples/hello-single/files/helloworld.c b/poky/documentation/ref-manual/examples/hello-single/files/helloworld.c
new file mode 100644
index 000000000..fc7169b7b
--- /dev/null
+++ b/poky/documentation/ref-manual/examples/hello-single/files/helloworld.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("Hello world!\n");
+
+ return 0;
+}
diff --git a/poky/documentation/ref-manual/examples/hello-single/hello.bb b/poky/documentation/ref-manual/examples/hello-single/hello.bb
new file mode 100644
index 000000000..0812743e3
--- /dev/null
+++ b/poky/documentation/ref-manual/examples/hello-single/hello.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Simple helloworld application"
+SECTION = "examples"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "file://helloworld.c"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ${CC} helloworld.c -o helloworld
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 helloworld ${D}${bindir}
+}
diff --git a/poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb b/poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb
new file mode 100644
index 000000000..b58d4d7bd
--- /dev/null
+++ b/poky/documentation/ref-manual/examples/libxpm/libxpm_3.5.6.bb
@@ -0,0 +1,14 @@
+require xorg-lib-common.inc
+
+DESCRIPTION = "X11 Pixmap library"
+LICENSE = "X-BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3e07763d16963c3af12db271a31abaa5"
+DEPENDS += "libxext"
+PR = "r2"
+PE = "1"
+
+XORG_PN = "libXpm"
+
+PACKAGES =+ "sxpm cxpm"
+FILES_cxpm = "${bindir}/cxpm"
+FILES_sxpm = "${bindir}/sxpm"
diff --git a/poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb b/poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb
new file mode 100644
index 000000000..5d05a437a
--- /dev/null
+++ b/poky/documentation/ref-manual/examples/mtd-makefile/mtd-utils_1.0.0.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "Tools for managing memory technology devices."
+SECTION = "base"
+DEPENDS = "zlib"
+HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+
+SRC_URI = "ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-${PV}.tar.gz"
+
+CFLAGS_prepend = "-I ${S}/include "
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/poky/documentation/ref-manual/faq.xml b/poky/documentation/ref-manual/faq.xml
new file mode 100644
index 000000000..49ff86261
--- /dev/null
+++ b/poky/documentation/ref-manual/faq.xml
@@ -0,0 +1,835 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='faq'>
+<title>FAQ</title>
+<qandaset>
+ <qandaentry>
+ <question>
+ <para>
+ How does Poky differ from <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The term "<link link='poky'>Poky</link>"
+ refers to the specific reference build system that
+ the Yocto Project provides.
+ Poky is based on <link linkend='oe-core'>OE-Core</link>
+ and <link linkend='bitbake-term'>BitBake</link>.
+ Thus, the generic term used here for the build system is
+ the "OpenEmbedded build system."
+ Development in the Yocto Project using Poky is closely tied to OpenEmbedded, with
+ changes always being merged to OE-Core or BitBake first before being pulled back
+ into Poky.
+ This practice benefits both projects immediately.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para id='faq-not-meeting-requirements'>
+ My development system does not meet the
+ required Git, tar, and Python versions.
+ In particular, I do not have Python 3.4.0 or greater.
+ Can I still use the Yocto Project?
+ </para>
+ </question>
+ <answer>
+ <para>
+ You can get the required tools on your host development
+ system a couple different ways (i.e. building a tarball or
+ downloading a tarball).
+ See the
+ "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
+ section for steps on how to update your build tools.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How can you claim Poky / OpenEmbedded-Core is stable?
+ </para>
+ </question>
+ <answer>
+ <para>
+ There are three areas that help with stability;
+ <itemizedlist>
+ <listitem><para>The Yocto Project team keeps
+ <link linkend='oe-core'>OE-Core</link> small
+ and focused, containing around 830 recipes as opposed to the thousands
+ available in other OpenEmbedded community layers.
+ Keeping it small makes it easy to test and maintain.</para></listitem>
+ <listitem><para>The Yocto Project team runs manual and automated tests
+ using a small, fixed set of reference hardware as well as emulated
+ targets.</para></listitem>
+ <listitem><para>The Yocto Project uses an autobuilder,
+ which provides continuous build and integration tests.</para></listitem>
+ </itemizedlist>
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I get support for my board added to the Yocto Project?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Support for an additional board is added by creating a
+ Board Support Package (BSP) layer for it.
+ For more information on how to create a BSP layer, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual and the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ </para>
+ <para>
+ Usually, if the board is not completely exotic, adding support in
+ the Yocto Project is fairly straightforward.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ Are there any products built using the OpenEmbedded build system?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The software running on the <ulink url='http://vernier.com/labquest/'>Vernier LabQuest</ulink>
+ is built using the OpenEmbedded build system.
+ See the <ulink url='http://www.vernier.com/products/interfaces/labq/'>Vernier LabQuest</ulink>
+ website for more information.
+ There are a number of pre-production devices using the OpenEmbedded build system
+ and the Yocto Project team
+ announces them as soon as they are released.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ What does the OpenEmbedded build system produce as output?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Because you can use the same set of recipes to create output of
+ various formats, the output of an OpenEmbedded build depends on
+ how you start it.
+ Usually, the output is a flashable image ready for the target
+ device.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I add my package to the Yocto Project?
+ </para>
+ </question>
+ <answer>
+ <para>
+ To add a package, you need to create a BitBake recipe.
+ For information on how to create a BitBake recipe, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-writing-a-new-recipe'>Writing a New Recipe</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ Do I have to reflash my entire board with a new Yocto Project image when recompiling
+ a package?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The OpenEmbedded build system can build packages in various
+ formats such as IPK for OPKG, Debian package
+ (<filename>.deb</filename>), or RPM.
+ You can then upgrade the packages using the package tools on
+ the device, much like on a desktop distribution such as
+ Ubuntu or Fedora.
+ However, package management on the target is entirely optional.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ I see the error '<filename>chmod: XXXXX new permissions are r-xrwxrwx, not r-xr-xr-x</filename>'.
+ What is wrong?
+ </para>
+ </question>
+ <answer>
+ <para>
+ You are probably running the build on an NTFS filesystem.
+ Use <filename>ext2</filename>, <filename>ext3</filename>, or <filename>ext4</filename> instead.
+ </para>
+ </answer>
+ </qandaentry>
+
+<!-- <qandaentry>
+ <question>
+ <para>
+ How do I make the Yocto Project work in RHEL/CentOS?
+ </para>
+ </question>
+ <answer>
+ <para>
+ To get the Yocto Project working under RHEL/CentOS 5.1 you need to first
+ install some required packages.
+ The standard CentOS packages needed are:
+ <itemizedlist>
+ <listitem><para>"Development tools" (selected during installation)</para></listitem>
+ <listitem><para><filename>texi2html</filename></para></listitem>
+ <listitem><para><filename>compat-gcc-34</filename></para></listitem>
+ </itemizedlist>
+ On top of these, you need the following external packages:
+ <itemizedlist>
+ <listitem><para><filename>python-sqlite2</filename> from
+ <ulink url='http://dag.wieers.com/rpm/packages/python-sqlite2/'>DAG repository</ulink>
+ </para></listitem>
+ <listitem><para><filename>help2man</filename> from
+ <ulink url='http://centos.karan.org/el4/extras/stable/x86_64/RPMS/repodata/repoview/help2man-0-1.33.1-2.html'>Karan repository</ulink></para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Once these packages are installed, the OpenEmbedded build system will be able
+ to build standard images.
+ However, there might be a problem with the QEMU emulator segfaulting.
+ You can either disable the generation of binary locales by setting
+ <filename><link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'>ENABLE_BINARY_LOCALE_GENERATION</link>
+ </filename> to "0" or by removing the <filename>linux-2.6-execshield.patch</filename>
+ from the kernel and rebuilding it since that is the patch that causes the problems with QEMU.
+ </para>
+
+ <note>
+ <para>For information on distributions that the Yocto Project
+ uses during validation, see the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Distribution_Support'>Distribution Support</ulink>
+ Wiki page.</para>
+ <para>For notes about using the Yocto Project on a RHEL 4-based
+ host, see the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/BuildingOnRHEL4'>Building on RHEL4</ulink>
+ Wiki page.</para>
+ </note>
+ </answer>
+ </qandaentry> -->
+
+ <qandaentry>
+ <question>
+ <para>
+ I see lots of 404 responses for files when the OpenEmbedded
+ build system is trying to download sources.
+ Is something wrong?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Nothing is wrong.
+ The OpenEmbedded build system checks any configured source mirrors before downloading
+ from the upstream sources.
+ The build system does this searching for both source archives and
+ pre-checked out versions of SCM-managed software.
+ These checks help in large installations because it can reduce load on the SCM servers
+ themselves.
+ The address above is one of the default mirrors configured into the
+ build system.
+ Consequently, if an upstream source disappears, the team
+ can place sources there so builds continue to work.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ I have machine-specific data in a package for one machine only but the package is
+ being marked as machine-specific in all cases, how do I prevent this?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Set <filename><link linkend='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'>SRC_URI_OVERRIDES_PACKAGE_ARCH</link>
+ </filename> = "0" in the <filename>.bb</filename> file but make sure the package is
+ manually marked as
+ machine-specific for the case that needs it.
+ The code that handles
+ <filename>SRC_URI_OVERRIDES_PACKAGE_ARCH</filename> is in
+ the <filename>meta/classes/base.bbclass</filename> file.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para id='i-am-behind-a-firewall-and-need-to-use-a-proxy-server'>
+ I'm behind a firewall and need to use a proxy server. How do I do that?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Most source fetching by the OpenEmbedded build system is done
+ by <filename>wget</filename> and you therefore need to specify
+ the proxy settings in a <filename>.wgetrc</filename> file,
+ which can be in your home directory if you are a single user
+ or can be in <filename>/usr/local/etc/wgetrc</filename> as
+ a global user file.
+ </para>
+
+ <para>
+ Following is the applicable code for setting various proxy
+ types in the <filename>.wgetrc</filename> file.
+ By default, these settings are disabled with comments.
+ To use them, remove the comments:
+ <literallayout class='monospaced'>
+ # You can set the default proxies for Wget to use for http, https, and ftp.
+ # They will override the value in the environment.
+ #https_proxy = http://proxy.yoyodyne.com:18023/
+ #http_proxy = http://proxy.yoyodyne.com:18023/
+ #ftp_proxy = http://proxy.yoyodyne.com:18023/
+
+ # If you do not want to use proxy at all, set this to off.
+ #use_proxy = on
+ </literallayout>
+ The Yocto Project also includes a
+ <filename>meta-poky/conf/site.conf.sample</filename> file that
+ shows how to configure CVS and Git proxy servers if needed.
+ For more information on setting up various proxy types and
+ configuring proxy servers, see the
+ "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
+ Wiki page.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ What’s the difference between <replaceable>target</replaceable> and <replaceable>target</replaceable><filename>-native</filename>?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The <filename>*-native</filename> targets are designed to run on the system
+ being used for the build.
+ These are usually tools that are needed to assist the build in some way such as
+ <filename>quilt-native</filename>, which is used to apply patches.
+ The non-native version is the one that runs on the target device.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ I'm seeing random build failures. Help?!
+ </para>
+ </question>
+ <answer>
+ <para>
+ If the same build is failing in totally different and random
+ ways, the most likely explanation is:
+ <itemizedlist>
+ <listitem><para>The hardware you are running the build on
+ has some problem.</para></listitem>
+ <listitem><para>You are running the build under
+ virtualization, in which case the virtualization
+ probably has bugs.</para></listitem>
+ </itemizedlist>
+ The OpenEmbedded build system processes a massive amount of
+ data that causes lots of network, disk and CPU activity and
+ is sensitive to even single-bit failures in any of these areas.
+ True random failures have always been traced back to hardware
+ or virtualization issues.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ When I try to build a native recipe, the build fails with <filename>iconv.h</filename> problems.
+ </para>
+ </question>
+ <answer>
+ <para>
+ If you get an error message that indicates GNU
+ <filename>libiconv</filename> is not in use but
+ <filename>iconv.h</filename> has been included from
+ <filename>libiconv</filename>, you need to check to see if
+ you have a previously installed version of the header file
+ in <filename>/usr/local/include</filename>.
+ <literallayout class='monospaced'>
+ #error GNU libiconv not in use but included iconv.h is from libiconv
+ </literallayout>
+ If you find a previously installed file, you should either
+ uninstall it or temporarily rename it and try the build again.
+ </para>
+
+ <para>
+ This issue is just a single manifestation of "system
+ leakage" issues caused when the OpenEmbedded build system
+ finds and uses previously installed files during a native
+ build.
+ This type of issue might not be limited to
+ <filename>iconv.h</filename>.
+ Be sure that leakage cannot occur from
+ <filename>/usr/local/include</filename> and
+ <filename>/opt</filename> locations.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ What do we need to ship for license compliance?
+ </para>
+ </question>
+ <answer>
+ <para>
+ This is a difficult question and you need to consult your lawyer
+ for the answer for your specific case.
+ It is worth bearing in mind that for GPL compliance, there needs
+ to be enough information shipped to allow someone else to
+ rebuild and produce the same end result you are shipping.
+ This means sharing the source code, any patches applied to it,
+ and also any configuration information about how that package
+ was configured and built.
+ </para>
+
+ <para>
+ You can find more information on licensing in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#licensing'>Licensing</ulink>"
+ section in the Yocto Project Overview and Concepts Manual
+ and also in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I disable the cursor on my touchscreen device?
+ </para>
+ </question>
+ <answer>
+ <para>
+ You need to create a form factor file as described in the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>"
+ section in the Yocto Project Board Support Packages (BSP)
+ Developer's Guide.
+ Set the <filename>HAVE_TOUCHSCREEN</filename> variable equal to
+ one as follows:
+ <literallayout class='monospaced'>
+ HAVE_TOUCHSCREEN=1
+ </literallayout>
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I make sure connected network interfaces are brought up by default?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The default interfaces file provided by the netbase recipe does not
+ automatically bring up network interfaces.
+ Therefore, you will need to add a BSP-specific netbase that includes an interfaces
+ file.
+ See the "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-filelayout-misc-recipes'>Miscellaneous BSP-Specific Recipe Files</ulink>"
+ section in the Yocto Project Board Support Packages (BSP)
+ Developer's Guide for information on creating these types of
+ miscellaneous recipe files.
+ </para>
+ <para>
+ For example, add the following files to your layer:
+ <literallayout class='monospaced'>
+ meta-MACHINE/recipes-bsp/netbase/netbase/MACHINE/interfaces
+ meta-MACHINE/recipes-bsp/netbase/netbase_5.0.bbappend
+ </literallayout>
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I create images with more free space?
+ </para>
+ </question>
+ <answer>
+ <para>
+ By default, the OpenEmbedded build system creates images
+ that are 1.3 times the size of the populated root filesystem.
+ To affect the image size, you need to set various
+ configurations:
+ <itemizedlist>
+ <listitem><para><emphasis>Image Size:</emphasis>
+ The OpenEmbedded build system uses the
+ <link linkend='var-IMAGE_ROOTFS_SIZE'><filename>IMAGE_ROOTFS_SIZE</filename></link>
+ variable to define the size of the image in Kbytes.
+ The build system determines the size by taking into
+ account the initial root filesystem size before any
+ modifications such as requested size for the image and
+ any requested additional free disk space to be
+ added to the image.</para></listitem>
+ <listitem><para><emphasis>Overhead:</emphasis>
+ Use the
+ <link linkend='var-IMAGE_OVERHEAD_FACTOR'><filename>IMAGE_OVERHEAD_FACTOR</filename></link>
+ variable to define the multiplier that the build system
+ applies to the initial image size, which is 1.3 by
+ default.</para></listitem>
+ <listitem><para><emphasis>Additional Free Space:</emphasis>
+ Use the
+ <link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'><filename>IMAGE_ROOTFS_EXTRA_SPACE</filename></link>
+ variable to add additional free space to the image.
+ The build system adds this space to the image after
+ it determines its
+ <filename>IMAGE_ROOTFS_SIZE</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ Why don't you support directories with spaces in the pathnames?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The Yocto Project team has tried to do this before but too
+ many of the tools the OpenEmbedded build system depends on,
+ such as <filename>autoconf</filename>, break when they find
+ spaces in pathnames.
+ Until that situation changes, the team will not support spaces
+ in pathnames.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ How do I use an external toolchain?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The toolchain configuration is very flexible and customizable.
+ It is primarily controlled with the
+ <filename><link linkend='var-TCMODE'>TCMODE</link></filename>
+ variable.
+ This variable controls which <filename>tcmode-*.inc</filename>
+ file to include from the
+ <filename>meta/conf/distro/include</filename> directory within
+ the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+
+ <para>
+ The default value of <filename>TCMODE</filename> is "default",
+ which tells the OpenEmbedded build system to use its internally
+ built toolchain (i.e. <filename>tcmode-default.inc</filename>).
+ However, other patterns are accepted.
+ In particular, "external-*" refers to external toolchains.
+ One example is the Sourcery G++ Toolchain.
+ The support for this toolchain resides in the separate
+ <filename>meta-sourcery</filename> layer at
+ <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>.
+ </para>
+
+ <para>
+ In addition to the toolchain configuration, you also need a
+ corresponding toolchain recipe file.
+ This recipe file needs to package up any pre-built objects in
+ the toolchain such as <filename>libgcc</filename>,
+ <filename>libstdcc++</filename>, any locales, and
+ <filename>libc</filename>.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para id='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>
+ How does the OpenEmbedded build system obtain source code and
+ will it work behind my firewall or proxy server?
+ </para>
+ </question>
+ <answer>
+ <para>
+ The way the build system obtains source code is highly
+ configurable.
+ You can setup the build system to get source code in most
+ environments if HTTP transport is available.
+ </para>
+ <para>
+ When the build system searches for source code, it first
+ tries the local download directory.
+ If that location fails, Poky tries
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
+ the upstream source, and then
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ in that order.
+ </para>
+ <para>
+ Assuming your distribution is "poky", the OpenEmbedded build
+ system uses the Yocto Project source
+ <filename>PREMIRRORS</filename> by default for SCM-based
+ sources, upstreams for normal tarballs, and then falls back
+ to a number of other mirrors including the Yocto Project
+ source mirror if those fail.
+ </para>
+ <para>
+ As an example, you could add a specific server for the
+ build system to attempt before any others by adding something
+ like the following to the <filename>local.conf</filename>
+ configuration file:
+ <literallayout class='monospaced'>
+ PREMIRRORS_prepend = "\
+ git://.*/.* http://www.yoctoproject.org/sources/ \n \
+ ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
+ http://.*/.* http://www.yoctoproject.org/sources/ \n \
+ https://.*/.* http://www.yoctoproject.org/sources/ \n"
+ </literallayout>
+ </para>
+ <para>
+ These changes cause the build system to intercept Git, FTP,
+ HTTP, and HTTPS requests and direct them to the
+ <filename>http://</filename> sources mirror.
+ You can use <filename>file://</filename> URLs to point to
+ local directories or network shares as well.
+ </para>
+ <para>
+ Aside from the previous technique, these options also exist:
+ <literallayout class='monospaced'>
+ BB_NO_NETWORK = "1"
+ </literallayout>
+ This statement tells BitBake to issue an error instead of
+ trying to access the Internet.
+ This technique is useful if you want to ensure code builds
+ only from local sources.
+ </para>
+ <para>
+ Here is another technique:
+ <literallayout class='monospaced'>
+ BB_FETCH_PREMIRRORONLY = "1"
+ </literallayout>
+ This statement limits the build system to pulling source
+ from the <filename>PREMIRRORS</filename> only.
+ Again, this technique is useful for reproducing builds.
+ </para>
+ <para>
+ Here is another technique:
+ <literallayout class='monospaced'>
+ BB_GENERATE_MIRROR_TARBALLS = "1"
+ </literallayout>
+ This statement tells the build system to generate mirror
+ tarballs.
+ This technique is useful if you want to create a mirror server.
+ If not, however, the technique can simply waste time during
+ the build.
+ </para>
+ <para>
+ Finally, consider an example where you are behind an
+ HTTP-only firewall.
+ You could make the following changes to the
+ <filename>local.conf</filename> configuration file as long as
+ the <filename>PREMIRRORS</filename> server is current:
+ <literallayout class='monospaced'>
+ PREMIRRORS_prepend = "\
+ ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
+ http://.*/.* http://www.yoctoproject.org/sources/ \n \
+ https://.*/.* http://www.yoctoproject.org/sources/ \n"
+ BB_FETCH_PREMIRRORONLY = "1"
+ </literallayout>
+ These changes would cause the build system to successfully
+ fetch source over HTTP and any network accesses to anything
+ other than the <filename>PREMIRRORS</filename> would fail.
+ </para>
+ <para>
+ The build system also honors the standard shell environment
+ variables <filename>http_proxy</filename>,
+ <filename>ftp_proxy</filename>,
+ <filename>https_proxy</filename>, and
+ <filename>all_proxy</filename> to redirect requests through
+ proxy servers.
+ </para>
+ <note>
+ You can find more information on the
+ "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
+ Wiki page.
+ </note>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ Can I get rid of build output so I can start over?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Yes - you can easily do this.
+ When you use BitBake to build an image, all the build output
+ goes into the directory created when you run the
+ build environment setup script (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ By default, this
+ <link linkend='build-directory'>Build Directory</link>
+ is named <filename>build</filename> but can be named
+ anything you want.
+ </para>
+
+ <para>
+ Within the Build Directory, is the <filename>tmp</filename>
+ directory.
+ To remove all the build output yet preserve any source code or
+ downloaded files from previous builds, simply remove the
+ <filename>tmp</filename> directory.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ Why do <filename>${bindir}</filename> and <filename>${libdir}</filename> have strange values for <filename>-native</filename> recipes?
+ </para>
+ </question>
+ <answer>
+ <para>
+ Executables and libraries might need to be used from a
+ directory other than the directory into which they were
+ initially installed.
+ Complicating this situation is the fact that sometimes these
+ executables and libraries are compiled with the expectation
+ of being run from that initial installation target directory.
+ If this is the case, moving them causes problems.
+ </para>
+
+ <para>
+ This scenario is a fundamental problem for package maintainers
+ of mainstream Linux distributions as well as for the
+ OpenEmbedded build system.
+ As such, a well-established solution exists.
+ Makefiles, Autotools configuration scripts, and other build
+ systems are expected to respect environment variables such as
+ <filename>bindir</filename>, <filename>libdir</filename>,
+ and <filename>sysconfdir</filename> that indicate where
+ executables, libraries, and data reside when a program is
+ actually run.
+ They are also expected to respect a
+ <filename>DESTDIR</filename> environment variable, which is
+ prepended to all the other variables when the build system
+ actually installs the files.
+ It is understood that the program does not actually run from
+ within <filename>DESTDIR</filename>.
+ </para>
+
+ <para>
+ When the OpenEmbedded build system uses a recipe to build a
+ target-architecture program (i.e. one that is intended for
+ inclusion on the image being built), that program eventually
+ runs from the root file system of that image.
+ Thus, the build system provides a value of "/usr/bin" for
+ <filename>bindir</filename>, a value of "/usr/lib" for
+ <filename>libdir</filename>, and so forth.
+ </para>
+
+ <para>
+ Meanwhile, <filename>DESTDIR</filename> is a path within the
+ <link linkend='build-directory'>Build Directory</link>.
+ However, when the recipe builds a native program (i.e. one
+ that is intended to run on the build machine), that program
+ is never installed directly to the build machine's root
+ file system.
+ Consequently, the build system uses paths within the Build
+ Directory for <filename>DESTDIR</filename>,
+ <filename>bindir</filename> and related variables.
+ To better understand this, consider the following two paths
+ where the first is relatively normal and the second is not:
+ <note>
+ Due to these lengthy examples, the paths are artificially
+ broken across lines for readability.
+ </note>
+ <literallayout class='monospaced'>
+ /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/
+ 1.2.8-r0/sysroot-destdir/usr/bin
+
+ /home/maxtothemax/poky-bootchart2/build/tmp/work/x86_64-linux/
+ zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/
+ build/tmp/sysroots/x86_64-linux/usr/bin
+ </literallayout>
+ Even if the paths look unusual, they both are correct -
+ the first for a target and the second for a native recipe.
+ These paths are a consequence of the
+ <filename>DESTDIR</filename> mechanism and while they
+ appear strange, they are correct and in practice very effective.
+ </para>
+ </answer>
+ </qandaentry>
+
+ <qandaentry>
+ <question>
+ <para>
+ The files provided by my <filename>*-native</filename> recipe do
+ not appear to be available to other recipes.
+ Files are missing from the native sysroot, my recipe is
+ installing to the wrong place, or I am getting permissions
+ errors during the do_install task in my recipe! What is wrong?
+ </para>
+ </question>
+ <answer>
+ <para>
+ This situation results when a build system does
+ not recognize the environment variables supplied to it by
+ <link linkend='bitbake-term'>BitBake</link>.
+ The incident that prompted this FAQ entry involved a Makefile
+ that used an environment variable named
+ <filename>BINDIR</filename> instead of the more standard
+ variable <filename>bindir</filename>.
+ The makefile's hardcoded default value of "/usr/bin" worked
+ most of the time, but not for the recipe's
+ <filename>-native</filename> variant.
+ For another example, permissions errors might be caused
+ by a Makefile that ignores <filename>DESTDIR</filename> or uses
+ a different name for that environment variable.
+ Check the the build system to see if these kinds of
+ issues exist.
+ </para>
+ </answer>
+ </qandaentry>
+
+</qandaset>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/figures/build-workspace-directory.png b/poky/documentation/ref-manual/figures/build-workspace-directory.png
new file mode 100644
index 000000000..5387d33f0
--- /dev/null
+++ b/poky/documentation/ref-manual/figures/build-workspace-directory.png
Binary files differ
diff --git a/poky/documentation/ref-manual/figures/define-generic.png b/poky/documentation/ref-manual/figures/define-generic.png
new file mode 100644
index 000000000..bd22718a5
--- /dev/null
+++ b/poky/documentation/ref-manual/figures/define-generic.png
Binary files differ
diff --git a/poky/documentation/ref-manual/figures/poky-title.png b/poky/documentation/ref-manual/figures/poky-title.png
new file mode 100644
index 000000000..2893d8462
--- /dev/null
+++ b/poky/documentation/ref-manual/figures/poky-title.png
Binary files differ
diff --git a/poky/documentation/ref-manual/migration.xml b/poky/documentation/ref-manual/migration.xml
new file mode 100644
index 000000000..b06096800
--- /dev/null
+++ b/poky/documentation/ref-manual/migration.xml
@@ -0,0 +1,5684 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='migration'>
+<title>Migrating to a Newer Yocto Project Release</title>
+
+ <para>
+ This chapter provides information you can use to migrate work to a
+ newer Yocto Project release. You can find the same information in the
+ release notes for a given release.
+ </para>
+
+<section id='general-migration-considerations'>
+ <title>General Migration Considerations</title>
+
+ <para>
+ Some considerations are not tied to a specific Yocto Project
+ release.
+ This section presents information you should consider when
+ migrating to any new Yocto Project release.
+ <itemizedlist>
+ <listitem><para><emphasis>Dealing with Customized Recipes</emphasis>:
+ Issues could arise if you take older recipes that contain
+ customizations and simply copy them forward expecting them
+ to work after you migrate to new Yocto Project metadata.
+ For example, suppose you have a recipe in your layer that is
+ a customized version of a core recipe copied from the earlier
+ release, rather than through the use of an append file.
+ When you migrate to a newer version of Yocto Project, the
+ metadata (e.g. perhaps an include file used by the recipe)
+ could have changed in a way that would break the build.
+ Say, for example, a function is removed from an include file
+ and the customized recipe tries to call that function.
+ </para>
+
+ <para>You could "forward-port" all your customizations in your
+ recipe so that everything works for the new release.
+ However, this is not the optimal solution as you would have
+ to repeat this process with each new release if changes
+ occur that give rise to problems.</para>
+
+ <para>The better solution (where practical) is to use append
+ files (<filename>*.bbappend</filename>) to capture any
+ customizations you want to make to a recipe.
+ Doing so, isolates your changes from the main recipe making
+ them much more manageable.
+ However, sometimes it is not practical to use an append
+ file.
+ A good example of this is when introducing a newer or older
+ version of a recipe in another layer.</para>
+ </listitem>
+ <listitem><para><emphasis>Updating Append Files</emphasis>:
+ Since append files generally only contain your customizations,
+ they often do not need to be adjusted for new releases.
+ However, if the <filename>.bbappend</filename> file is
+ specific to a particular version of the recipe (i.e. its
+ name does not use the % wildcard) and the version of the
+ recipe to which it is appending has changed, then you will
+ at a minimum need to rename the append file to match the
+ name of the recipe file.
+ A mismatch between an append file and its corresponding
+ recipe file (<filename>.bb</filename>) will
+ trigger an error during parsing.</para>
+ <para>Depending on the type of customization the append file
+ applies, other incompatibilities might occur when you
+ upgrade.
+ For example, if your append file applies a patch and the
+ recipe to which it is appending is updated to a newer
+ version, the patch might no longer apply.
+ If this is the case and assuming the patch is still needed,
+ you must modify the patch file so that it does apply.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='moving-to-the-yocto-project-1.3-release'>
+ <title>Moving to the Yocto Project 1.3 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.3 Release from the prior release.
+ </para>
+
+ <section id='1.3-local-configuration'>
+ <title>Local Configuration</title>
+
+ <para>
+ Differences include changes for
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+ and <filename>bblayers.conf</filename>.
+ </para>
+
+ <section id='migration-1.3-sstate-mirrors'>
+ <title>SSTATE_MIRRORS</title>
+
+ <para>
+ The shared state cache (sstate-cache), as pointed to by
+ <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>,
+ by default now has two-character subdirectories to prevent
+ issues arising from too many files in the same directory.
+ Also, native sstate-cache packages, which are built to run
+ on the host system, will go into a subdirectory named using
+ the distro ID string.
+ If you copy the newly structured sstate-cache to a mirror
+ location (either local or remote) and then point to it in
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>,
+ you need to append "PATH" to the end of the mirror URL so that
+ the path used by BitBake before the mirror substitution is
+ appended to the path used to access the mirror.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS = "file://.* http://<replaceable>someserver</replaceable>.tld/share/sstate/PATH"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.3-bblayers-conf'>
+ <title>bblayers.conf</title>
+
+ <para>
+ The <filename>meta-yocto</filename> layer consists of two parts
+ that correspond to the Poky reference distribution and the
+ reference hardware Board Support Packages (BSPs), respectively:
+ <filename>meta-yocto</filename> and
+ <filename>meta-yocto-bsp</filename>.
+ When running BitBake for the first time after upgrading,
+ your <filename>conf/bblayers.conf</filename> file will be
+ updated to handle this change and you will be asked to
+ re-run or restart for the changes to take effect.
+ </para>
+ </section>
+ </section>
+
+ <section id='1.3-recipes'>
+ <title>Recipes</title>
+
+ <para>
+ Differences include changes for the following:
+ <itemizedlist>
+ <listitem><para>Python function whitespace</para></listitem>
+ <listitem><para><filename>proto=</filename> in <filename>SRC_URI</filename></para></listitem>
+ <listitem><para><filename>nativesdk</filename></para></listitem>
+ <listitem><para>Task recipes</para></listitem>
+ <listitem><para><filename>IMAGE_FEATURES</filename></para></listitem>
+ <listitem><para>Removed recipes</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='migration-1.3-python-function-whitespace'>
+ <title>Python Function Whitespace</title>
+
+ <para>
+ All Python functions must now use four spaces for indentation.
+ Previously, an inconsistent mix of spaces and tabs existed,
+ which made extending these functions using
+ <filename>_append</filename> or <filename>_prepend</filename>
+ complicated given that Python treats whitespace as
+ syntactically significant.
+ If you are defining or extending any Python functions (e.g.
+ <filename>populate_packages</filename>, <filename>do_unpack</filename>,
+ <filename>do_patch</filename> and so forth) in custom recipes
+ or classes, you need to ensure you are using consistent
+ four-space indentation.
+ </para>
+ </section>
+
+ <section id='migration-1.3-proto=-in-src-uri'>
+ <title>proto= in SRC_URI</title>
+
+ <para>
+ Any use of <filename>proto=</filename> in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ needs to be changed to <filename>protocol=</filename>.
+ In particular, this applies to the following URIs:
+ <itemizedlist>
+ <listitem><para><filename>svn://</filename></para></listitem>
+ <listitem><para><filename>bzr://</filename></para></listitem>
+ <listitem><para><filename>hg://</filename></para></listitem>
+ <listitem><para><filename>osc://</filename></para></listitem>
+ </itemizedlist>
+ Other URIs were already using <filename>protocol=</filename>.
+ This change improves consistency.
+ </para>
+ </section>
+
+ <section id='migration-1.3-nativesdk'>
+ <title>nativesdk</title>
+
+ <para>
+ The suffix <filename>nativesdk</filename> is now implemented
+ as a prefix, which simplifies a lot of the packaging code for
+ <filename>nativesdk</filename> recipes.
+ All custom <filename>nativesdk</filename> recipes, which are
+ relocatable packages that are native to
+ <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>,
+ and any references need to be updated to use
+ <filename>nativesdk-*</filename> instead of
+ <filename>*-nativesdk</filename>.
+ </para>
+ </section>
+
+ <section id='migration-1.3-task-recipes'>
+ <title>Task Recipes</title>
+
+ <para>
+ "Task" recipes are now known as "Package groups" and have
+ been renamed from <filename>task-*.bb</filename> to
+ <filename>packagegroup-*.bb</filename>.
+ Existing references to the previous <filename>task-*</filename>
+ names should work in most cases as there is an automatic
+ upgrade path for most packages.
+ However, you should update references in your own recipes and
+ configurations as they could be removed in future releases.
+ You should also rename any custom <filename>task-*</filename>
+ recipes to <filename>packagegroup-*</filename>, and change
+ them to inherit <filename>packagegroup</filename> instead of
+ <filename>task</filename>, as well as taking the opportunity
+ to remove anything now handled by
+ <filename>packagegroup.bbclass</filename>, such as providing
+ <filename>-dev</filename> and <filename>-dbg</filename>
+ packages, setting
+ <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>,
+ and so forth.
+ See the
+ "<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>"
+ section for further details.
+ </para>
+ </section>
+
+ <section id='migration-1.3-image-features'>
+ <title>IMAGE_FEATURES</title>
+
+ <para>
+ Image recipes that previously included "apps-console-core"
+ in <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ should now include "splash" instead to enable the boot-up
+ splash screen.
+ Retaining "apps-console-core" will still include the splash
+ screen but generates a warning.
+ The "apps-x11-core" and "apps-x11-games"
+ <filename>IMAGE_FEATURES</filename> features have been removed.
+ </para>
+ </section>
+
+ <section id='migration-1.3-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed.
+ For most of them, it is unlikely that you would have any
+ references to them in your own
+ <link linkend='metadata'>Metadata</link>.
+ However, you should check your metadata against this list to be sure:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>libx11-trim</filename></emphasis>:
+ Replaced by <filename>libx11</filename>, which has a negligible
+ size difference with modern Xorg.</para></listitem>
+ <listitem><para><emphasis><filename>xserver-xorg-lite</filename></emphasis>:
+ Use <filename>xserver-xorg</filename>, which has a negligible
+ size difference when DRI and GLX modules are not installed.</para></listitem>
+ <listitem><para><emphasis><filename>xserver-kdrive</filename></emphasis>:
+ Effectively unmaintained for many years.</para></listitem>
+ <listitem><para><emphasis><filename>mesa-xlib</filename></emphasis>:
+ No longer serves any purpose.</para></listitem>
+ <listitem><para><emphasis><filename>galago</filename></emphasis>:
+ Replaced by telepathy.</para></listitem>
+ <listitem><para><emphasis><filename>gail</filename></emphasis>:
+ Functionality was integrated into GTK+ 2.13.</para></listitem>
+ <listitem><para><emphasis><filename>eggdbus</filename></emphasis>:
+ No longer needed.</para></listitem>
+ <listitem><para><emphasis><filename>gcc-*-intermediate</filename></emphasis>:
+ The build has been restructured to avoid the need for
+ this step.</para></listitem>
+ <listitem><para><emphasis><filename>libgsmd</filename></emphasis>:
+ Unmaintained for many years.
+ Functionality now provided by
+ <filename>ofono</filename> instead.</para></listitem>
+ <listitem><para><emphasis>contacts, dates, tasks, eds-tools</emphasis>:
+ Largely unmaintained PIM application suite.
+ It has been moved to <filename>meta-gnome</filename>
+ in <filename>meta-openembedded</filename>.</para></listitem>
+ </itemizedlist>
+ In addition to the previously listed changes, the
+ <filename>meta-demoapps</filename> directory has also been removed
+ because the recipes in it were not being maintained and many
+ had become obsolete or broken.
+ Additionally, these recipes were not parsed in the default configuration.
+ Many of these recipes are already provided in an updated and
+ maintained form within the OpenEmbedded community layers such as
+ <filename>meta-oe</filename> and <filename>meta-gnome</filename>.
+ For the remainder, you can now find them in the
+ <filename>meta-extras</filename> repository, which is in the
+ Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>.
+ </para>
+ </section>
+ </section>
+
+ <section id='1.3-linux-kernel-naming'>
+ <title>Linux Kernel Naming</title>
+
+ <para>
+ The naming scheme for kernel output binaries has been changed to
+ now include
+ <link linkend='var-PE'><filename>PE</filename></link> as part of the
+ filename:
+ <literallayout class='monospaced'>
+ KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PE}-${PV}-${PR}-${MACHINE}-${DATETIME}"
+ </literallayout>
+ </para>
+
+ <para>
+ Because the <filename>PE</filename> variable is not set by default,
+ these binary files could result with names that include two dash
+ characters.
+ Here is an example:
+ <literallayout class='monospaced'>
+ bzImage--3.10.9+git0+cd502a8814_7144bcc4b8-r0-qemux86-64-20130830085431.bin
+ </literallayout>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-1.4-release'>
+ <title>Moving to the Yocto Project 1.4 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.4 Release from the prior release.
+ </para>
+
+ <section id='migration-1.4-bitbake'>
+ <title>BitBake</title>
+
+ <para>
+ Differences include the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Comment Continuation:</emphasis>
+ If a comment ends with a line continuation (\) character,
+ then the next line must also be a comment.
+ Any instance where this is not the case, now triggers
+ a warning.
+ You must either remove the continuation character, or be
+ sure the next line is a comment.
+ </para></listitem>
+ <listitem><para><emphasis>Package Name Overrides:</emphasis>
+ The runtime package specific variables
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
+ <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
+ <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
+ <link linkend='var-FILES'><filename>FILES</filename></link>,
+ <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>,
+ and the pre, post, install, and uninstall script functions
+ <filename>pkg_preinst</filename>,
+ <filename>pkg_postinst</filename>,
+ <filename>pkg_prerm</filename>, and
+ <filename>pkg_postrm</filename> should always have a
+ package name override.
+ For example, use <filename>RDEPENDS_${PN}</filename> for
+ the main package instead of <filename>RDEPENDS</filename>.
+ BitBake uses more strict checks when it parses recipes.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.4-build-behavior'>
+ <title>Build Behavior</title>
+
+ <para>
+ Differences include the following:
+ <itemizedlist>
+ <listitem><para><emphasis>Shared State Code:</emphasis>
+ The shared state code has been optimized to avoid running
+ unnecessary tasks.
+ For example, the following no longer populates the target
+ sysroot since that is not necessary:
+ <literallayout class='monospaced'>
+ $ bitbake -c rootfs <replaceable>some-image</replaceable>
+ </literallayout>
+ Instead, the system just needs to extract the output
+ package contents, re-create the packages, and construct
+ the root filesystem.
+ This change is unlikely to cause any problems unless
+ you have missing declared dependencies.
+ </para></listitem>
+ <listitem><para><emphasis>Scanning Directory Names:</emphasis>
+ When scanning for files in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
+ the build system now uses
+ <link linkend='var-FILESOVERRIDES'><filename>FILESOVERRIDES</filename></link>
+ instead of <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ for the directory names.
+ In general, the values previously in
+ <filename>OVERRIDES</filename> are now in
+ <filename>FILESOVERRIDES</filename> as well.
+ However, if you relied upon an additional value
+ you previously added to <filename>OVERRIDES</filename>,
+ you might now need to add it to
+ <filename>FILESOVERRIDES</filename> unless you are already
+ adding it through the
+ <link linkend='var-MACHINEOVERRIDES'><filename>MACHINEOVERRIDES</filename></link>
+ or <link linkend='var-DISTROOVERRIDES'><filename>DISTROOVERRIDES</filename></link>
+ variables, as appropriate.
+ For more related changes, see the
+ "<link linkend='migration-1.4-variables'>Variables</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+
+ <section id='migration-1.4-proxies-and-fetching-source'>
+ <title>Proxies and Fetching Source</title>
+
+ <para>
+ A new <filename>oe-git-proxy</filename> script has been added to
+ replace previous methods of handling proxies and fetching source
+ from Git.
+ See the <filename>meta-yocto/conf/site.conf.sample</filename> file
+ for information on how to use this script.
+ </para>
+ </section>
+
+ <section id='migration-1.4-custom-interfaces-file-netbase-change'>
+ <title>Custom Interfaces File (netbase change)</title>
+
+ <para>
+ If you have created your own custom
+ <filename>etc/network/interfaces</filename> file by creating
+ an append file for the <filename>netbase</filename> recipe,
+ you now need to create an append file for the
+ <filename>init-ifupdown</filename> recipe instead, which you can
+ find in the
+ <link linkend='source-directory'>Source Directory</link>
+ at <filename>meta/recipes-core/init-ifupdown</filename>.
+ For information on how to use append files, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='migration-1.4-remote-debugging'>
+ <title>Remote Debugging</title>
+
+ <para>
+ Support for remote debugging with the Eclipse IDE is now
+ separated into an image feature
+ (<filename>eclipse-debug</filename>) that corresponds to the
+ <filename>packagegroup-core-eclipse-debug</filename> package group.
+ Previously, the debugging feature was included through the
+ <filename>tools-debug</filename> image feature, which corresponds
+ to the <filename>packagegroup-core-tools-debug</filename>
+ package group.
+ </para>
+ </section>
+
+ <section id='migration-1.4-variables'>
+ <title>Variables</title>
+
+ <para>
+ The following variables have changed:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>SANITY_TESTED_DISTROS</filename>:</emphasis>
+ This variable now uses a distribution ID, which is composed
+ of the host distributor ID followed by the release.
+ Previously,
+ <link linkend='var-SANITY_TESTED_DISTROS'><filename>SANITY_TESTED_DISTROS</filename></link>
+ was composed of the description field.
+ For example, "Ubuntu 12.10" becomes "Ubuntu-12.10".
+ You do not need to worry about this change if you are not
+ specifically setting this variable, or if you are
+ specifically setting it to "".
+ </para></listitem>
+ <listitem><para><emphasis><filename>SRC_URI</filename>:</emphasis>
+ The <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>,
+ <filename>${</filename><link linkend='var-PF'><filename>PF</filename></link><filename>}</filename>,
+ <filename>${</filename><link linkend='var-P'><filename>P</filename></link><filename>}</filename>,
+ and <filename>FILE_DIRNAME</filename> directories have been
+ dropped from the default value of the
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ variable, which is used as the search path for finding files
+ referred to in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>.
+ If you have a recipe that relied upon these directories,
+ which would be unusual, then you will need to add the
+ appropriate paths within the recipe or, alternatively,
+ rearrange the files.
+ The most common locations are still covered by
+ <filename>${BP}</filename>, <filename>${BPN}</filename>,
+ and "files", which all remain in the default value of
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-target-package-management-with-rpm'>
+ <title>Target Package Management with RPM</title>
+
+ <para>
+ If runtime package management is enabled and the RPM backend
+ is selected, Smart is now installed for package download, dependency
+ resolution, and upgrades instead of Zypper.
+ For more information on how to use Smart, run the following command
+ on the target:
+ <literallayout class='monospaced'>
+ smart --help
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.4-recipes-moved'>
+ <title>Recipes Moved</title>
+
+ <para>
+ The following recipes were moved from their previous locations
+ because they are no longer used by anything in
+ the OpenEmbedded-Core:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>clutter-box2d</filename>:</emphasis>
+ Now resides in the <filename>meta-oe</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>evolution-data-server</filename>:</emphasis>
+ Now resides in the <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>gthumb</filename>:</emphasis>
+ Now resides in the <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>gtkhtml2</filename>:</emphasis>
+ Now resides in the <filename>meta-oe</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>gupnp</filename>:</emphasis>
+ Now resides in the <filename>meta-multimedia</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>gypsy</filename>:</emphasis>
+ Now resides in the <filename>meta-oe</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libcanberra</filename>:</emphasis>
+ Now resides in the <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libgdata</filename>:</emphasis>
+ Now resides in the <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libmusicbrainz</filename>:</emphasis>
+ Now resides in the <filename>meta-multimedia</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>metacity</filename>:</emphasis>
+ Now resides in the <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>polkit</filename>:</emphasis>
+ Now resides in the <filename>meta-oe</filename> layer.
+ </para></listitem>
+ <listitem><para><emphasis><filename>zeroconf</filename>:</emphasis>
+ Now resides in the <filename>meta-networking</filename> layer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.4-removals-and-renames'>
+ <title>Removals and Renames</title>
+
+ <para>
+ The following list shows what has been removed or renamed:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>evieext</filename>:</emphasis>
+ Removed because it has been removed from
+ <filename>xserver</filename> since 2008.
+ </para></listitem>
+ <listitem><para><emphasis>Gtk+ DirectFB:</emphasis>
+ Removed support because upstream Gtk+ no longer supports it
+ as of version 2.18.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libxfontcache / xfontcacheproto</filename>:</emphasis>
+ Removed because they were removed from the Xorg server in 2008.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libxp / libxprintapputil / libxprintutil / printproto</filename>:</emphasis>
+ Removed because the XPrint server was removed from
+ Xorg in 2008.
+ </para></listitem>
+ <listitem><para><emphasis><filename>libxtrap / xtrapproto</filename>:</emphasis>
+ Removed because their functionality was broken upstream.
+ </para></listitem>
+ <listitem><para><emphasis>linux-yocto 3.0 kernel:</emphasis>
+ Removed with linux-yocto 3.8 kernel being added.
+ The linux-yocto 3.2 and linux-yocto 3.4 kernels remain
+ as part of the release.
+ </para></listitem>
+ <listitem><para><emphasis><filename>lsbsetup</filename>:</emphasis>
+ Removed with functionality now provided by
+ <filename>lsbtest</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>matchbox-stroke</filename>:</emphasis>
+ Removed because it was never more than a proof-of-concept.
+ </para></listitem>
+ <listitem><para><emphasis><filename>matchbox-wm-2 / matchbox-theme-sato-2</filename>:</emphasis>
+ Removed because they are not maintained.
+ However, <filename>matchbox-wm</filename> and
+ <filename>matchbox-theme-sato</filename> are still
+ provided.
+ </para></listitem>
+ <listitem><para><emphasis><filename>mesa-dri</filename>:</emphasis>
+ Renamed to <filename>mesa</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>mesa-xlib</filename>:</emphasis>
+ Removed because it was no longer useful.
+ </para></listitem>
+ <listitem><para><emphasis><filename>mutter</filename>:</emphasis>
+ Removed because nothing ever uses it and the recipe is
+ very old.
+ </para></listitem>
+ <listitem><para><emphasis><filename>orinoco-conf</filename>:</emphasis>
+ Removed because it has become obsolete.
+ </para></listitem>
+ <listitem><para><emphasis><filename>update-modules</filename>:</emphasis>
+ Removed because it is no longer used.
+ The kernel module <filename>postinstall</filename> and
+ <filename>postrm</filename> scripts can now do the same
+ task without the use of this script.
+ </para></listitem>
+ <listitem><para><emphasis><filename>web</filename>:</emphasis>
+ Removed because it is not maintained. Superseded by
+ <filename>web-webkit</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>xf86bigfontproto</filename>:</emphasis>
+ Removed because upstream it has been disabled by default
+ since 2007.
+ Nothing uses <filename>xf86bigfontproto</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>xf86rushproto</filename>:</emphasis>
+ Removed because its dependency in
+ <filename>xserver</filename> was spurious and it was
+ removed in 2005.
+ </para></listitem>
+ <listitem><para><emphasis><filename>zypper / libzypp / sat-solver</filename>:</emphasis>
+ Removed and been functionally replaced with Smart
+ (<filename>python-smartpm</filename>) when RPM packaging
+ is used and package management is enabled on the target.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-1.5-release'>
+ <title>Moving to the Yocto Project 1.5 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.5 Release from the prior release.
+ </para>
+
+ <section id='migration-1.5-host-dependency-changes'>
+ <title>Host Dependency Changes</title>
+
+ <para>
+ The OpenEmbedded build system now has some additional requirements
+ on the host system:
+ <itemizedlist>
+ <listitem><para>Python 2.7.3+</para></listitem>
+ <listitem><para>Tar 1.24+</para></listitem>
+ <listitem><para>Git 1.7.8+</para></listitem>
+ <listitem><para>Patched version of Make if you are using
+ 3.82.
+ Most distributions that provide Make 3.82 use the patched
+ version.</para></listitem>
+ </itemizedlist>
+ If the Linux distribution you are using on your build host
+ does not provide packages for these, you can install and use
+ the Buildtools tarball, which provides an SDK-like environment
+ containing them.
+ </para>
+
+ <para>
+ For more information on this requirement, see the
+ "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='migration-1.5-atom-pc-bsp'>
+ <title><filename>atom-pc</filename> Board Support Package (BSP)</title>
+
+ <para>
+ The <filename>atom-pc</filename> hardware reference BSP has been
+ replaced by a <filename>genericx86</filename> BSP.
+ This BSP is not necessarily guaranteed to work on all x86
+ hardware, but it will run on a wider range of systems than the
+ <filename>atom-pc</filename> did.
+ <note>
+ Additionally, a <filename>genericx86-64</filename> BSP has
+ been added for 64-bit Atom systems.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-1.5-bitbake'>
+ <title>BitBake</title>
+
+ <para>
+ The following changes have been made that relate to BitBake:
+ <itemizedlist>
+ <listitem><para>
+ BitBake now supports a <filename>_remove</filename>
+ operator.
+ The addition of this operator means you will have to
+ rename any items in recipe space (functions, variables)
+ whose names currently contain
+ <filename>_remove_</filename> or end with
+ <filename>_remove</filename> to avoid unexpected behavior.
+ </para></listitem>
+ <listitem><para>
+ BitBake's global method pool has been removed.
+ This method is not particularly useful and led to clashes
+ between recipes containing functions that had the
+ same name.</para></listitem>
+ <listitem><para>
+ The "none" server backend has been removed.
+ The "process" server backend has been serving well as the
+ default for a long time now.</para></listitem>
+ <listitem><para>
+ The <filename>bitbake-runtask</filename> script has been
+ removed.</para></listitem>
+ <listitem><para>
+ <filename>${</filename><link linkend='var-P'><filename>P</filename></link><filename>}</filename>
+ and
+ <filename>${</filename><link linkend='var-PF'><filename>PF</filename></link><filename>}</filename>
+ are no longer added to
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ by default in <filename>bitbake.conf</filename>.
+ These version-specific <filename>PROVIDES</filename>
+ items were seldom used.
+ Attempting to use them could result in two versions being
+ built simultaneously rather than just one version due to
+ the way BitBake resolves dependencies.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.5-qa-warnings'>
+ <title>QA Warnings</title>
+
+ <para>
+ The following changes have been made to the package QA checks:
+ <itemizedlist>
+ <listitem><para>
+ If you have customized
+ <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
+ or <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link>
+ values in your configuration, check that they contain all of
+ the issues that you wish to be reported.
+ Previous Yocto Project versions contained a bug that meant
+ that any item not mentioned in <filename>ERROR_QA</filename>
+ or <filename>WARN_QA</filename> would be treated as a
+ warning.
+ Consequently, several important items were not already in
+ the default value of <filename>WARN_QA</filename>.
+ All of the possible QA checks are now documented in the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section.</para></listitem>
+ <listitem><para>
+ An additional QA check has been added to check if
+ <filename>/usr/share/info/dir</filename> is being installed.
+ Your recipe should delete this file within
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ if "make install" is installing it.
+ </para></listitem>
+ <listitem><para>
+ If you are using the buildhistory class, the check for the
+ package version going backwards is now controlled using a
+ standard QA check.
+ Thus, if you have customized your
+ <filename>ERROR_QA</filename> or
+ <filename>WARN_QA</filename> values and still wish to have
+ this check performed, you should add
+ "version-going-backwards" to your value for one or the
+ other variables depending on how you wish it to be handled.
+ See the documented QA checks in the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.5-directory-layout-changes'>
+ <title>Directory Layout Changes</title>
+
+ <para>
+ The following directory changes exist:
+ <itemizedlist>
+ <listitem><para>
+ Output SDK installer files are now named to include the
+ image name and tuning architecture through the
+ <link linkend='var-SDK_NAME'><filename>SDK_NAME</filename></link>
+ variable.</para></listitem>
+ <listitem><para>
+ Images and related files are now installed into a directory
+ that is specific to the machine, instead of a parent
+ directory containing output files for multiple machines.
+ The
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
+ variable continues to point to the directory containing
+ images for the current
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ and should be used anywhere there is a need to refer to
+ this directory.
+ The <filename>runqemu</filename> script now uses this
+ variable to find images and kernel binaries and will use
+ BitBake to determine the directory.
+ Alternatively, you can set the
+ <filename>DEPLOY_DIR_IMAGE</filename> variable in the
+ external environment.</para></listitem>
+ <listitem><para>
+ When buildhistory is enabled, its output is now written
+ under the
+ <link linkend='build-directory'>Build Directory</link>
+ rather than
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>.
+ Doing so makes it easier to delete
+ <filename>TMPDIR</filename> and preserve the build history.
+ Additionally, data for produced SDKs is now split by
+ <link linkend='var-IMAGE_NAME'><filename>IMAGE_NAME</filename></link>.
+ </para></listitem>
+ <listitem><para>
+ The <filename>pkgdata</filename> directory produced as
+ part of the packaging process has been collapsed into a
+ single machine-specific directory.
+ This directory is located under
+ <filename>sysroots</filename> and uses a machine-specific
+ name (i.e.
+ <filename>tmp/sysroots/<replaceable>machine</replaceable>/pkgdata</filename>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.5-shortened-git-srcrev-values'>
+ <title>Shortened Git <filename>SRCREV</filename> Values</title>
+
+ <para>
+ BitBake will now shorten revisions from Git repositories from the
+ normal 40 characters down to 10 characters within
+ <link linkend='var-SRCPV'><filename>SRCPV</filename></link>
+ for improved usability in path and file names.
+ This change should be safe within contexts where these revisions
+ are used because the chances of spatially close collisions
+ is very low.
+ Distant collisions are not a major issue in the way
+ the values are used.
+ </para>
+ </section>
+
+ <section id='migration-1.5-image-features'>
+ <title><filename>IMAGE_FEATURES</filename></title>
+
+ <para>
+ The following changes have been made that relate to
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>:
+ <itemizedlist>
+ <listitem><para>
+ The value of <filename>IMAGE_FEATURES</filename> is now
+ validated to ensure invalid feature items are not added.
+ Some users mistakenly add package names to this variable
+ instead of using
+ <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>
+ in order to have the package added to the image, which does
+ not work.
+ This change is intended to catch those kinds of situations.
+ Valid <filename>IMAGE_FEATURES</filename> are drawn from
+ <link linkend='var-PACKAGE_GROUP'><filename>PACKAGE_GROUP</filename></link>
+ definitions,
+ <link linkend='var-COMPLEMENTARY_GLOB'><filename>COMPLEMENTARY_GLOB</filename></link>
+ and a new "validitems" varflag on
+ <filename>IMAGE_FEATURES</filename>.
+ The "validitems" varflag change allows additional features
+ to be added if they are not provided using the previous
+ two mechanisms.
+ </para></listitem>
+ <listitem><para>
+ The previously deprecated "apps-console-core"
+ <filename>IMAGE_FEATURES</filename> item is no longer
+ supported.
+ Add "splash" to <filename>IMAGE_FEATURES</filename> if you
+ wish to have the splash screen enabled, since this is
+ all that apps-console-core was doing.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.5-run'>
+ <title><filename>/run</filename></title>
+
+ <para>
+ The <filename>/run</filename> directory from the Filesystem
+ Hierarchy Standard 3.0 has been introduced.
+ You can find some of the implications for this change
+ <ulink url='http://cgit.openembedded.org/openembedded-core/commit/?id=0e326280a15b0f2c4ef2ef4ec441f63f55b75873'>here</ulink>.
+ The change also means that recipes that install files to
+ <filename>/var/run</filename> must be changed.
+ You can find a guide on how to make these changes
+ <ulink url='http://permalink.gmane.org/gmane.comp.handhelds.openembedded/58530'>here</ulink>.
+ </para>
+ </section>
+
+ <section id='migration-1.5-removal-of-package-manager-database-within-image-recipes'>
+ <title>Removal of Package Manager Database Within Image Recipes</title>
+
+ <para>
+ The image <filename>core-image-minimal</filename> no longer adds
+ <filename>remove_packaging_data_files</filename> to
+ <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></link>.
+ This addition is now handled automatically when "package-management"
+ is not in
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
+ If you have custom image recipes that make this addition,
+ you should remove the lines, as they are not needed and might
+ interfere with correct operation of postinstall scripts.
+ </para>
+ </section>
+
+ <section id='migration-1.5-images-now-rebuild-only-on-changes-instead-of-every-time'>
+ <title>Images Now Rebuild Only on Changes Instead of Every Time</title>
+
+ <para>
+ The
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ and other related image
+ construction tasks are no longer marked as "nostamp".
+ Consequently, they will only be re-executed when their inputs have
+ changed.
+ Previous versions of the OpenEmbedded build system always rebuilt
+ the image when requested rather when necessary.
+ </para>
+ </section>
+
+ <section id='migration-1.5-task-recipes'>
+ <title>Task Recipes</title>
+
+ <para>
+ The previously deprecated <filename>task.bbclass</filename> has
+ now been dropped.
+ For recipes that previously inherited from this class, you should
+ rename them from <filename>task-*</filename> to
+ <filename>packagegroup-*</filename> and inherit packagegroup
+ instead.
+ </para>
+
+ <para>
+ For more information, see the
+ "<link linkend='ref-classes-packagegroup'><filename>packagegroup.bbclass</filename></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='migration-1.5-busybox'>
+ <title>BusyBox</title>
+
+ <para>
+ By default, we now split BusyBox into two binaries:
+ one that is suid root for those components that need it, and
+ another for the rest of the components.
+ Splitting BusyBox allows for optimization that eliminates the
+ <filename>tinylogin</filename> recipe as recommended by upstream.
+ You can disable this split by setting
+ <link linkend='var-BUSYBOX_SPLIT_SUID'><filename>BUSYBOX_SPLIT_SUID</filename></link>
+ to "0".
+ </para>
+ </section>
+
+ <section id='migration-1.5-automated-image-testing'>
+ <title>Automated Image Testing</title>
+
+ <para>
+ A new automated image testing framework has been added
+ through the
+ <link linkend='ref-classes-testimage*'><filename>testimage.bbclass</filename></link>
+ class.
+ This framework replaces the older
+ <filename>imagetest-qemu</filename> framework.
+ </para>
+
+ <para>
+ You can learn more about performing automated image tests in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='migration-1.5-build-history'>
+ <title>Build History</title>
+
+ <para>
+ Following are changes to Build History:
+ <itemizedlist>
+ <listitem><para>
+ Installed package sizes:
+ <filename>installed-package-sizes.txt</filename> for an
+ image now records the size of the files installed by each
+ package instead of the size of each compressed package
+ archive file.</para></listitem>
+ <listitem><para>
+ The dependency graphs (<filename>depends*.dot</filename>)
+ now use the actual package names instead of replacing
+ dashes, dots and plus signs with underscores.
+ </para></listitem>
+ <listitem><para>
+ The <filename>buildhistory-diff</filename> and
+ <filename>buildhistory-collect-srcrevs</filename>
+ utilities have improved command-line handling.
+ Use the <filename>--help</filename> option for
+ each utility for more information on the new syntax.
+ </para></listitem>
+ </itemizedlist>
+ For more information on Build History, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='migration-1.5-udev'>
+ <title><filename>udev</filename></title>
+
+ <para>
+ Following are changes to <filename>udev</filename>:
+ <itemizedlist>
+ <listitem><para>
+ <filename>udev</filename> no longer brings in
+ <filename>udev-extraconf</filename> automatically
+ through
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ since this was originally intended to be optional.
+ If you need the extra rules, then add
+ <filename>udev-extraconf</filename> to your image.
+ </para></listitem>
+ <listitem><para>
+ <filename>udev</filename> no longer brings in
+ <filename>pciutils-ids</filename> or
+ <filename>usbutils-ids</filename> through
+ <filename>RRECOMMENDS</filename>.
+ These are not needed by <filename>udev</filename> itself
+ and removing them saves around 350KB.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.5-removed-renamed-recipes'>
+ <title>Removed and Renamed Recipes</title>
+
+ <itemizedlist>
+ <listitem><para>
+ The <filename>linux-yocto</filename> 3.2 kernel has been
+ removed.</para></listitem>
+ <listitem><para>
+ <filename>libtool-nativesdk</filename> has been renamed to
+ <filename>nativesdk-libtool</filename>.</para></listitem>
+ <listitem><para>
+ <filename>tinylogin</filename> has been removed.
+ It has been replaced by a suid portion of Busybox.
+ See the
+ "<link linkend='migration-1.5-busybox'>BusyBox</link>" section
+ for more information.</para></listitem>
+ <listitem><para>
+ <filename>external-python-tarball</filename> has been renamed
+ to <filename>buildtools-tarball</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>web-webkit</filename> has been removed.
+ It has been functionally replaced by
+ <filename>midori</filename>.</para></listitem>
+ <listitem><para>
+ <filename>imake</filename> has been removed.
+ It is no longer needed by any other recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>transfig-native</filename> has been removed.
+ It is no longer needed by any other recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>anjuta-remote-run</filename> has been removed.
+ Anjuta IDE integration has not been officially supported for
+ several releases.</para></listitem>
+ </itemizedlist>
+ </section>
+
+ <section id='migration-1.5-other-changes'>
+ <title>Other Changes</title>
+
+ <para>
+ Following is a list of short entries describing other changes:
+ <itemizedlist>
+ <listitem><para>
+ <filename>run-postinsts</filename>: Make this generic.
+ </para></listitem>
+ <listitem><para>
+ <filename>base-files</filename>: Remove the unnecessary
+ <filename>media/</filename><replaceable>xxx</replaceable> directories.
+ </para></listitem>
+ <listitem><para>
+ <filename>alsa-state</filename>: Provide an empty
+ <filename>asound.conf</filename> by default.
+ </para></listitem>
+ <listitem><para>
+ <filename>classes/image</filename>: Ensure
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>
+ supports pre-renamed package names.</para></listitem>
+ <listitem><para>
+ <filename>classes/rootfs_rpm</filename>: Implement
+ <filename>BAD_RECOMMENDATIONS</filename> for RPM.
+ </para></listitem>
+ <listitem><para>
+ <filename>systemd</filename>: Remove
+ <filename>systemd_unitdir</filename> if
+ <filename>systemd</filename> is not in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ </para></listitem>
+ <listitem><para>
+ <filename>systemd</filename>: Remove
+ <filename>init.d</filename> dir if
+ <filename>systemd</filename> unit file is present and
+ <filename>sysvinit</filename> is not a distro feature.
+ </para></listitem>
+ <listitem><para>
+ <filename>libpam</filename>: Deny all services for the
+ <filename>OTHER</filename> entries.
+ </para></listitem>
+ <listitem><para>
+ <filename>image.bbclass</filename>: Move
+ <filename>runtime_mapping_rename</filename> to avoid
+ conflict with <filename>multilib</filename>.
+ See
+ <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=4993'><filename>YOCTO #4993</filename></ulink>
+ in Bugzilla for more information.
+ </para></listitem>
+ <listitem><para>
+ <filename>linux-dtb</filename>: Use kernel build system
+ to generate the <filename>dtb</filename> files.
+ </para></listitem>
+ <listitem><para>
+ <filename>kern-tools</filename>: Switch from guilt to
+ new <filename>kgit-s2q</filename> tool.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-1.6-release'>
+ <title>Moving to the Yocto Project 1.6 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.6 Release from the prior release.
+ </para>
+
+
+ <section id='migration-1.6-archiver-class'>
+ <title><filename>archiver</filename> Class</title>
+
+ <para>
+ The
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class has been rewritten and its configuration has been simplified.
+ For more details on the source archiver, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='migration-1.6-packaging-changes'>
+ <title>Packaging Changes</title>
+
+ <para>
+ The following packaging changes have been made:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>binutils</filename> recipe no longer produces
+ a <filename>binutils-symlinks</filename> package.
+ <filename>update-alternatives</filename> is now used to
+ handle the preferred <filename>binutils</filename>
+ variant on the target instead.
+ </para></listitem>
+ <listitem><para>
+ The tc (traffic control) utilities have been split out of
+ the main <filename>iproute2</filename> package and put
+ into the <filename>iproute2-tc</filename> package.
+ </para></listitem>
+ <listitem><para>
+ The <filename>gtk-engines</filename> schemas have been
+ moved to a dedicated
+ <filename>gtk-engines-schemas</filename> package.
+ </para></listitem>
+ <listitem><para>
+ The <filename>armv7a</filename> with thumb package
+ architecture suffix has changed.
+ The suffix for these packages with the thumb
+ optimization enabled is "t2" as it should be.
+ Use of this suffix was not the case in the 1.5 release.
+ Architecture names will change within package feeds as a
+ result.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.6-bitbake'>
+ <title>BitBake</title>
+
+ <para>
+ The following changes have been made to
+ <link linkend='bitbake-term'>BitBake</link>.
+ </para>
+
+ <section id='migration-1.6-matching-branch-requirement-for-git-fetching'>
+ <title>Matching Branch Requirement for Git Fetching</title>
+
+ <para>
+ When fetching source from a Git repository using
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>,
+ BitBake will now validate the
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ value against the branch.
+ You can specify the branch using the following form:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://server.name/repository;branch=<replaceable>branchname</replaceable>"
+ </literallayout>
+ If you do not specify a branch, BitBake looks
+ in the default "master" branch.
+ </para>
+
+ <para>
+ Alternatively, if you need to bypass this check (e.g.
+ if you are fetching a revision corresponding to a tag that
+ is not on any branch), you can add ";nobranch=1" to
+ the end of the URL within <filename>SRC_URI</filename>.
+ </para>
+ </section>
+
+ <section id='migration-1.6-bitbake-deps'>
+ <title>Python Definition substitutions</title>
+
+ <para>
+ BitBake had some previously deprecated Python definitions
+ within its <filename>bb</filename> module removed.
+ You should use their sub-module counterparts instead:
+ <itemizedlist>
+ <listitem><para><filename>bb.MalformedUrl</filename>:
+ Use <filename>bb.fetch.MalformedUrl</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.encodeurl</filename>:
+ Use <filename>bb.fetch.encodeurl</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.decodeurl</filename>:
+ Use <filename>bb.fetch.decodeurl</filename>
+ </para></listitem>
+ <listitem><para><filename>bb.mkdirhier</filename>:
+ Use <filename>bb.utils.mkdirhier</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.movefile</filename>:
+ Use <filename>bb.utils.movefile</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.copyfile</filename>:
+ Use <filename>bb.utils.copyfile</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.which</filename>:
+ Use <filename>bb.utils.which</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.vercmp_string</filename>:
+ Use <filename>bb.utils.vercmp_string</filename>.
+ </para></listitem>
+ <listitem><para><filename>bb.vercmp</filename>:
+ Use <filename>bb.utils.vercmp</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.6-bitbake-fetcher'>
+ <title>SVK Fetcher</title>
+
+ <para>
+ The SVK fetcher has been removed from BitBake.
+ </para>
+ </section>
+
+ <section id='migration-1.6-bitbake-console-output'>
+ <title>Console Output Error Redirection</title>
+
+ <para>
+ The BitBake console UI will now output errors to
+ <filename>stderr</filename> instead of
+ <filename>stdout</filename>.
+ Consequently, if you are piping or redirecting the output of
+ <filename>bitbake</filename> to somewhere else, and you wish
+ to retain the errors, you will need to add
+ <filename>2>&amp;1</filename> (or something similar) to the
+ end of your <filename>bitbake</filename> command line.
+ </para>
+ </section>
+
+ <section id='migration-1.6-task-taskname-overrides'>
+ <title><filename>task-</filename><replaceable>taskname</replaceable> Overrides</title>
+
+ <para>
+ <filename>task-</filename><replaceable>taskname</replaceable> overrides have been
+ adjusted so that tasks whose names contain underscores have the
+ underscores replaced by hyphens for the override so that they
+ now function properly.
+ For example, the task override for
+ <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>
+ is <filename>task-populate-sdk</filename>.
+ </para>
+ </section>
+ </section>
+
+ <section id='migration-1.6-variable-changes'>
+ <title>Changes to Variables</title>
+
+ <para>
+ The following variables have changed.
+ For information on the OpenEmbedded build system variables, see the
+ "<link linkend='ref-variables-glos'>Variables Glossary</link>" Chapter.
+ </para>
+
+ <section id='migration-1.6-variable-changes-TMPDIR'>
+ <title><filename>TMPDIR</filename></title>
+
+ <para>
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ can no longer be on an NFS mount.
+ NFS does not offer full POSIX locking and inode consistency
+ and can cause unexpected issues if used to store
+ <filename>TMPDIR</filename>.
+ </para>
+
+ <para>
+ The check for this occurs on startup.
+ If <filename>TMPDIR</filename> is detected on an NFS mount,
+ an error occurs.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-PRINC'>
+ <title><filename>PRINC</filename></title>
+
+ <para>
+ The <filename>PRINC</filename>
+ variable has been deprecated and triggers a warning if
+ detected during a build.
+ For
+ <link linkend='var-PR'><filename>PR</filename></link>
+ increments on changes, use the PR service instead.
+ You can find out more about this service in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>Working With a PR Service</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-IMAGE_TYPES'>
+ <title><filename>IMAGE_TYPES</filename></title>
+
+ <para>
+ The "sum.jffs2" option for
+ <link linkend='var-IMAGE_TYPES'><filename>IMAGE_TYPES</filename></link>
+ has been replaced by the "jffs2.sum" option, which fits the
+ processing order.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-COPY_LIC_MANIFEST'>
+ <title><filename>COPY_LIC_MANIFEST</filename></title>
+
+ <para>
+ The
+ <link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link>
+ variable must
+ now be set to "1" rather than any value in order to enable
+ it.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-COPY_LIC_DIRS'>
+ <title><filename>COPY_LIC_DIRS</filename></title>
+
+ <para>
+ The
+ <link linkend='var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></link>
+ variable must
+ now be set to "1" rather than any value in order to enable
+ it.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-PACKAGE_GROUP'>
+ <title><filename>PACKAGE_GROUP</filename></title>
+
+ <para>
+ The
+ <link linkend='var-PACKAGE_GROUP'><filename>PACKAGE_GROUP</filename></link>
+ variable has been renamed to
+ <link linkend='var-FEATURE_PACKAGES'><filename>FEATURE_PACKAGES</filename></link>
+ to more accurately reflect its purpose.
+ You can still use <filename>PACKAGE_GROUP</filename> but
+ the OpenEmbedded build system produces a warning message when
+ it encounters the variable.
+ </para>
+ </section>
+
+ <section id='migration-1.6-variable-changes-variable-entry-behavior'>
+ <title>Preprocess and Post Process Command Variable Behavior</title>
+
+ <para>
+ The following variables now expect a semicolon separated
+ list of functions to call and not arbitrary shell commands:
+ <literallayout class='monospaced'>
+ <link linkend='var-ROOTFS_PREPROCESS_COMMAND'>ROOTFS_PREPROCESS_COMMAND</link>
+ <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'>ROOTFS_POSTPROCESS_COMMAND</link>
+ <link linkend='var-SDK_POSTPROCESS_COMMAND'>SDK_POSTPROCESS_COMMAND</link>
+ <link linkend='var-POPULATE_SDK_POST_TARGET_COMMAND'>POPULATE_SDK_POST_TARGET_COMMAND</link>
+ <link linkend='var-POPULATE_SDK_POST_HOST_COMMAND'>POPULATE_SDK_POST_HOST_COMMAND</link>
+ <link linkend='var-IMAGE_POSTPROCESS_COMMAND'>IMAGE_POSTPROCESS_COMMAND</link>
+ <link linkend='var-IMAGE_PREPROCESS_COMMAND'>IMAGE_PREPROCESS_COMMAND</link>
+ <link linkend='var-ROOTFS_POSTUNINSTALL_COMMAND'>ROOTFS_POSTUNINSTALL_COMMAND</link>
+ <link linkend='var-ROOTFS_POSTINSTALL_COMMAND'>ROOTFS_POSTINSTALL_COMMAND</link>
+ </literallayout>
+ For migration purposes, you can simply wrap shell commands in
+ a shell function and then call the function.
+ Here is an example:
+ <literallayout class='monospaced'>
+ my_postprocess_function() {
+ echo "hello" > ${IMAGE_ROOTFS}/hello.txt
+ }
+ ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
+ </literallayout>
+ </para>
+ </section>
+ </section>
+
+ <section id='migration-1.6-package-test-ptest'>
+ <title>Package Test (ptest)</title>
+
+ <para>
+ Package Tests (ptest) are built but not installed by default.
+ For information on using Package Tests, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages with ptest</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For information on the <filename>ptest</filename> class, see the
+ "<link linkend='ref-classes-ptest'><filename>ptest.bbclass</filename></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='migration-1.6-build-changes'>
+ <title>Build Changes</title>
+
+ <para>
+ Separate build and source directories have been enabled
+ by default for selected recipes where it is known to work
+ (a whitelist) and for all recipes that inherit the
+ <link linkend='ref-classes-cmake'><filename>cmake</filename></link>
+ class.
+ In future releases the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class will enable a separate build directory by default as
+ well.
+ Recipes building Autotools-based
+ software that fails to build with a separate build directory
+ should be changed to inherit from the
+ <link linkend='ref-classes-autotools'><filename>autotools-brokensep</filename></link>
+ class instead of the <filename>autotools</filename> or
+ <filename>autotools_stage</filename>classes.
+ </para>
+ </section>
+
+ <section id='migration-1.6-building-qemu-native'>
+ <title><filename>qemu-native</filename></title>
+
+ <para>
+ <filename>qemu-native</filename> now builds without
+ SDL-based graphical output support by default.
+ The following additional lines are needed in your
+ <filename>local.conf</filename> to enable it:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG_pn-qemu-native = "sdl"
+ ASSUME_PROVIDED += "libsdl-native"
+ </literallayout>
+ <note>
+ The default <filename>local.conf</filename>
+ contains these statements.
+ Consequently, if you are building a headless system and using
+ a default <filename>local.conf</filename> file, you will need
+ comment these two lines out.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-1.6-core-image-basic'>
+ <title><filename>core-image-basic</filename></title>
+
+ <para>
+ <filename>core-image-basic</filename> has been renamed to
+ <filename>core-image-full-cmdline</filename>.
+ </para>
+
+ <para>
+ In addition to <filename>core-image-basic</filename> being renamed,
+ <filename>packagegroup-core-basic</filename> has been renamed to
+ <filename>packagegroup-core-full-cmdline</filename> to match.
+ </para>
+ </section>
+
+ <section id='migration-1.6-licensing'>
+ <title>Licensing</title>
+
+ <para>
+ The top-level <filename>LICENSE</filename> file has been changed
+ to better describe the license of the various components of
+ <link linkend='oe-core'>OE-Core</link>.
+ However, the licensing itself remains unchanged.
+ </para>
+
+ <para>
+ Normally, this change would not cause any side-effects.
+ However, some recipes point to this file within
+ <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>
+ (as <filename>${COREBASE}/LICENSE</filename>) and thus the
+ accompanying checksum must be changed from
+ 3f40d7994397109285ec7b81fdeb3b58 to
+ 4d92cd373abda3937c2bc47fbc49d690.
+ A better alternative is to have
+ <filename>LIC_FILES_CHKSUM</filename> point to a file
+ describing the license that is distributed with the source
+ that the recipe is building, if possible, rather than pointing
+ to <filename>${COREBASE}/LICENSE</filename>.
+ </para>
+ </section>
+
+ <section id='migration-1.6-cflags-options'>
+ <title><filename>CFLAGS</filename> Options</title>
+
+ <para>
+ The "-fpermissive" option has been removed from the default
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ value.
+ You need to take action on individual recipes that fail when
+ building with this option.
+ You need to either patch the recipes to fix the issues reported by
+ the compiler, or you need to add "-fpermissive" to
+ <filename>CFLAGS</filename> in the recipes.
+ </para>
+ </section>
+
+ <section id='migration-1.6-custom-images'>
+ <title>Custom Image Output Types</title>
+
+ <para>
+ Custom image output types, as selected using
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>,
+ must declare their dependencies on other image types (if any) using
+ a new
+ <link linkend='var-IMAGE_TYPEDEP'><filename>IMAGE_TYPEDEP</filename></link>
+ variable.
+ </para>
+ </section>
+
+ <section id='migration-1.6-do-package-write-task'>
+ <title>Tasks</title>
+
+ <para>
+ The <filename>do_package_write</filename> task has been removed.
+ The task is no longer needed.
+ </para>
+ </section>
+
+ <section id='migration-1.6-update-alternatives-provider'>
+ <title><filename>update-alternative</filename> Provider</title>
+
+ <para>
+ The default <filename>update-alternatives</filename> provider has
+ been changed from <filename>opkg</filename> to
+ <filename>opkg-utils</filename>.
+ This change resolves some troublesome circular dependencies.
+ The runtime package has also been renamed from
+ <filename>update-alternatives-cworth</filename>
+ to <filename>update-alternatives-opkg</filename>.
+ </para>
+ </section>
+
+ <section id='migration-1.6-virtclass-overrides'>
+ <title><filename>virtclass</filename> Overrides</title>
+
+ <para>
+ The <filename>virtclass</filename> overrides are now deprecated.
+ Use the equivalent class overrides instead (e.g.
+ <filename>virtclass-native</filename> becomes
+ <filename>class-native</filename>.)
+ </para>
+ </section>
+
+ <section id='migration-1.6-removed-renamed-recipes'>
+ <title>Removed and Renamed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para><filename>packagegroup-toolset-native</filename> -
+ This recipe is largely unused.
+ </para></listitem>
+ <listitem><para><filename>linux-yocto-3.8</filename> -
+ Support for the Linux yocto 3.8 kernel has been dropped.
+ Support for the 3.10 and 3.14 kernels have been added
+ with the <filename>linux-yocto-3.10</filename> and
+ <filename>linux-yocto-3.14</filename> recipes.
+ </para></listitem>
+ <listitem><para><filename>ocf-linux</filename> -
+ This recipe has been functionally replaced using
+ <filename>cryptodev-linux</filename>.
+ </para></listitem>
+ <listitem><para><filename>genext2fs</filename> -
+ <filename>genext2fs</filename> is no longer used by the
+ build system and is unmaintained upstream.
+ </para></listitem>
+ <listitem><para><filename>js</filename> -
+ This provided an ancient version of Mozilla's javascript
+ engine that is no longer needed.
+ </para></listitem>
+ <listitem><para><filename>zaurusd</filename> -
+ The recipe has been moved to the
+ <filename>meta-handheld</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>eglibc 2.17</filename> -
+ Replaced by the <filename>eglibc 2.19</filename>
+ recipe.
+ </para></listitem>
+ <listitem><para><filename>gcc 4.7.2</filename> -
+ Replaced by the now stable
+ <filename>gcc 4.8.2</filename>.
+ </para></listitem>
+ <listitem><para><filename>external-sourcery-toolchain</filename> -
+ this recipe is now maintained in the
+ <filename>meta-sourcery</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>linux-libc-headers-yocto 3.4+git</filename> -
+ Now using version 3.10 of the
+ <filename>linux-libc-headers</filename> by default.
+ </para></listitem>
+ <listitem><para><filename>meta-toolchain-gmae</filename> -
+ This recipe is obsolete.
+ </para></listitem>
+ <listitem><para><filename>packagegroup-core-sdk-gmae</filename> -
+ This recipe is obsolete.
+ </para></listitem>
+ <listitem><para><filename>packagegroup-core-standalone-gmae-sdk-target</filename> -
+ This recipe is obsolete.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.6-removed-classes'>
+ <title>Removed Classes</title>
+
+ <para>
+ The following classes have become obsolete and have been removed:
+ <itemizedlist>
+ <listitem><para><filename>module_strip</filename>
+ </para></listitem>
+ <listitem><para><filename>pkg_metainfo</filename>
+ </para></listitem>
+ <listitem><para><filename>pkg_distribute</filename>
+ </para></listitem>
+ <listitem><para><filename>image-empty</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.6-reference-bsps'>
+ <title>Reference Board Support Packages (BSPs)</title>
+
+ <para>
+ The following reference BSPs changes occurred:
+ <itemizedlist>
+ <listitem><para>The BeagleBoard
+ (<filename>beagleboard</filename>) ARM reference hardware
+ has been replaced by the BeagleBone
+ (<filename>beaglebone</filename>) hardware.
+ </para></listitem>
+ <listitem><para>The RouterStation Pro
+ (<filename>routerstationpro</filename>) MIPS reference
+ hardware has been replaced by the EdgeRouter Lite
+ (<filename>edgerouter</filename>) hardware.
+ </para></listitem>
+ </itemizedlist>
+ The previous reference BSPs for the
+ <filename>beagleboard</filename> and
+ <filename>routerstationpro</filename> machines are still available
+ in a new <filename>meta-yocto-bsp-old</filename> layer in the
+ <ulink url='&YOCTO_GIT_URL;'>Source Repositories</ulink>
+ at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto-bsp-old/'>http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto-bsp-old/</ulink>.
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-1.7-release'>
+ <title>Moving to the Yocto Project 1.7 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.7 Release from the prior release.
+ </para>
+
+ <section id='migration-1.7-changes-to-setting-qemu-packageconfig-options'>
+ <title>Changes to Setting QEMU <filename>PACKAGECONFIG</filename> Options in <filename>local.conf</filename></title>
+
+ <para>
+ The QEMU recipe now uses a number of
+ <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
+ options to enable various optional features.
+ The method used to set defaults for these options means that
+ existing
+ <filename>local.conf</filename> files will need to be be
+ modified to append to <filename>PACKAGECONFIG</filename> for
+ <filename>qemu-native</filename> and
+ <filename>nativesdk-qemu</filename> instead of setting it.
+ In other words, to enable graphical output for QEMU, you should
+ now have these lines in <filename>local.conf</filename>:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG_append_pn-qemu-native = " sdl"
+ PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.7-minimum-git-version'>
+ <title>Minimum Git version</title>
+
+ <para>
+ The minimum
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> version
+ required on the build host is now 1.7.8 because the
+ <filename>--list</filename> option is now required by
+ BitBake's Git fetcher.
+ As always, if your host distribution does not provide a version of
+ Git that meets this requirement, you can use the
+ <filename>buildtools-tarball</filename> that does.
+ See the
+ "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
+ section for more information.
+ </para>
+ </section>
+
+ <section id='migration-1.7-autotools-class-changes'>
+ <title>Autotools Class Changes</title>
+
+ <para>
+ The following
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class changes occurred:
+ <itemizedlist>
+ <listitem><para><emphasis>
+ A separate build directory is now used by default:</emphasis>
+ The <filename>autotools</filename> class has been changed
+ to use a directory for building
+ (<link linkend='var-B'><filename>B</filename></link>),
+ which is separate from the source directory
+ (<link linkend='var-S'><filename>S</filename></link>).
+ This is commonly referred to as
+ <filename>B != S</filename>, or an out-of-tree build.</para>
+ <para>If the software being built is already capable of
+ building in a directory separate from the source, you
+ do not need to do anything.
+ However, if the software is not capable of being built
+ in this manner, you will
+ need to either patch the software so that it can build
+ separately, or you will need to change the recipe to
+ inherit the
+ <link linkend='ref-classes-autotools'><filename>autotools-brokensep</filename></link>
+ class instead of the <filename>autotools</filename> or
+ <filename>autotools_stage</filename> classes.
+ </para></listitem>
+ <listitem><para><emphasis>
+ The <filename>--foreign</filename> option is
+ no longer passed to <filename>automake</filename> when
+ running <filename>autoconf</filename>:</emphasis>
+ This option tells <filename>automake</filename> that a
+ particular software package does not follow the GNU
+ standards and therefore should not be expected
+ to distribute certain files such as
+ <filename>ChangeLog</filename>,
+ <filename>AUTHORS</filename>, and so forth.
+ Because the majority of upstream software packages already
+ tell <filename>automake</filename> to enable foreign mode
+ themselves, the option is mostly superfluous.
+ However, some recipes will need patches for this change.
+ You can easily make the change by patching
+ <filename>configure.ac</filename> so that it passes
+ "foreign" to <filename>AM_INIT_AUTOMAKE()</filename>.
+ See
+ <ulink url='http://cgit.openembedded.org/openembedded-core/commit/?id=01943188f85ce6411717fb5bf702d609f55813f2'>this commit</ulink>
+ for an example showing how to make the patch.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.7-binary-configuration-scripts-disabled'>
+ <title>Binary Configuration Scripts Disabled</title>
+
+ <para>
+ Some of the core recipes that package binary configuration scripts
+ now disable the scripts due to the
+ scripts previously requiring error-prone path substitution.
+ Software that links against these libraries using these scripts
+ should use the much more robust <filename>pkg-config</filename>
+ instead.
+ The list of recipes changed in this version (and their
+ configuration scripts) is as follows:
+ <literallayout class='monospaced'>
+ directfb (directfb-config)
+ freetype (freetype-config)
+ gpgme (gpgme-config)
+ libassuan (libassuan-config)
+ libcroco (croco-6.0-config)
+ libgcrypt (libgcrypt-config)
+ libgpg-error (gpg-error-config)
+ libksba (ksba-config)
+ libpcap (pcap-config)
+ libpcre (pcre-config)
+ libpng (libpng-config, libpng16-config)
+ libsdl (sdl-config)
+ libusb-compat (libusb-config)
+ libxml2 (xml2-config)
+ libxslt (xslt-config)
+ ncurses (ncurses-config)
+ neon (neon-config)
+ npth (npth-config)
+ pth (pth-config)
+ taglib (taglib-config)
+ </literallayout>
+ Additionally, support for <filename>pkg-config</filename> has been
+ added to some recipes in the previous list in the rare cases
+ where the upstream software package does not already provide
+ it.
+ </para>
+ </section>
+
+ <section id='migration-1.7-glibc-replaces-eglibc'>
+ <title><filename>eglibc 2.19</filename> Replaced with <filename>glibc 2.20</filename></title>
+
+ <para>
+ Because <filename>eglibc</filename> and
+ <filename>glibc</filename> were already fairly close, this
+ replacement should not require any significant changes to other
+ software that links to <filename>eglibc</filename>.
+ However, there were a number of minor changes in
+ <filename>glibc 2.20</filename> upstream that could require
+ patching some software (e.g. the removal of the
+ <filename>_BSD_SOURCE</filename> feature test macro).
+ </para>
+
+ <para>
+ <filename>glibc 2.20</filename> requires version 2.6.32 or greater
+ of the Linux kernel.
+ Thus, older kernels will no longer be usable in conjunction with it.
+ </para>
+
+ <para>
+ For full details on the changes in <filename>glibc 2.20</filename>,
+ see the upstream release notes
+ <ulink url='https://sourceware.org/ml/libc-alpha/2014-09/msg00088.html'>here</ulink>.
+ </para>
+ </section>
+
+ <section id='migration-1.7-kernel-module-autoloading'>
+ <title>Kernel Module Autoloading</title>
+
+ <para>
+ The
+ <link linkend='var-module_autoload'><filename>module_autoload_*</filename></link>
+ variable is now deprecated and a new
+ <link linkend='var-KERNEL_MODULE_AUTOLOAD'><filename>KERNEL_MODULE_AUTOLOAD</filename></link>
+ variable should be used instead.
+ Also,
+ <link linkend='var-module_conf'><filename>module_conf_*</filename></link>
+ must now be used in conjunction with a new
+ <link linkend='var-KERNEL_MODULE_PROBECONF'><filename>KERNEL_MODULE_PROBECONF</filename></link>
+ variable.
+ The new variables no longer require you to specify the module name
+ as part of the variable name.
+ This change not only simplifies usage but also allows the values
+ of these variables to be appropriately incorporated into task
+ signatures and thus trigger the appropriate tasks to re-execute
+ when changed.
+ You should replace any references to
+ <filename>module_autoload_*</filename> with
+ <filename>KERNEL_MODULE_AUTOLOAD</filename>, and add any modules
+ for which <filename>module_conf_*</filename> is specified to
+ <filename>KERNEL_MODULE_PROBECONF</filename>.
+ </para>
+ </section>
+
+ <section id='migration-1.7-qa-check-changes'>
+ <title>QA Check Changes</title>
+
+ <para>
+ The following changes have occurred to the QA check process:
+ <itemizedlist>
+ <listitem><para>
+ Additional QA checks <filename>file-rdeps</filename>
+ and <filename>build-deps</filename> have been added in
+ order to verify that file dependencies are satisfied
+ (e.g. package contains a script requiring
+ <filename>/bin/bash</filename>) and build-time dependencies
+ are declared, respectively.
+ For more information, please see the
+ "<link linkend='ref-qa-checks'>QA Error and Warning Messages</link>"
+ chapter.
+ </para></listitem>
+ <listitem><para>
+ Package QA checks are now performed during a new
+ <link linkend='ref-tasks-package_qa'><filename>do_package_qa</filename></link>
+ task rather than being part of the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task.
+ This allows more parallel execution.
+ This change is unlikely to be an issue except for highly
+ customized recipes that disable packaging tasks themselves
+ by marking them as <filename>noexec</filename>.
+ For those packages, you will need to disable the
+ <filename>do_package_qa</filename> task as well.
+ </para></listitem>
+ <listitem><para>
+ Files being overwritten during the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task now trigger an error instead of a warning.
+ Recipes should not be overwriting files written to the
+ sysroot by other recipes.
+ If you have these types of recipes, you need to alter them
+ so that they do not overwrite these files.</para>
+ <para>You might now receive this error after changes in
+ configuration or metadata resulting in orphaned files
+ being left in the sysroot.
+ If you do receive this error, the way to resolve the issue
+ is to delete your
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ or to move it out of the way and then re-start the build.
+ Anything that has been fully built up to that point and
+ does not need rebuilding will be restored from the shared
+ state cache and the rest of the build will be able to
+ proceed as normal.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.7-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <filename>x-load</filename>:
+ This recipe has been superseded by
+ U-boot SPL for all Cortex-based TI SoCs.
+ For legacy boards, the <filename>meta-ti</filename>
+ layer, which contains a maintained recipe, should be used
+ instead.
+ </para></listitem>
+ <listitem><para>
+ <filename>ubootchart</filename>:
+ This recipe is obsolete.
+ A <filename>bootchart2</filename> recipe has been added
+ to functionally replace it.
+ </para></listitem>
+ <listitem><para>
+ <filename>linux-yocto 3.4</filename>:
+ Support for the linux-yocto 3.4 kernel has been dropped.
+ Support for the 3.10 and 3.14 kernels remains, while
+ support for version 3.17 has been added.
+ </para></listitem>
+ <listitem><para>
+ <filename>eglibc</filename> has been removed in favor of
+ <filename>glibc</filename>.
+ See the
+ "<link linkend='migration-1.7-glibc-replaces-eglibc'><filename>eglibc 2.19</filename> Replaced with <filename>glibc 2.20</filename></link>"
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.7-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following miscellaneous change occurred:
+ <itemizedlist>
+ <listitem><para>
+ The build history feature now writes
+ <filename>build-id.txt</filename> instead of
+ <filename>build-id</filename>.
+ Additionally, <filename>build-id.txt</filename>
+ now contains the full build header as printed by
+ BitBake upon starting the build.
+ You should manually remove old "build-id" files from your
+ existing build history repositories to avoid confusion.
+ For information on the build history feature, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-1.8-release'>
+ <title>Moving to the Yocto Project 1.8 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 1.8 Release from the prior release.
+ </para>
+
+ <section id='migration-1.8-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para><filename>owl-video</filename>:
+ Functionality replaced by <filename>gst-player</filename>.
+ </para></listitem>
+ <listitem><para><filename>gaku</filename>:
+ Functionality replaced by <filename>gst-player</filename>.
+ </para></listitem>
+ <listitem><para><filename>gnome-desktop</filename>:
+ This recipe is now available in
+ <filename>meta-gnome</filename> and is no longer needed.
+ </para></listitem>
+ <listitem><para><filename>gsettings-desktop-schemas</filename>:
+ This recipe is now available in
+ <filename>meta-gnome</filename> and is no longer needed.
+ </para></listitem>
+ <listitem><para><filename>python-argparse</filename>:
+ The <filename>argparse</filename> module is already
+ provided in the default Python distribution in a
+ package named <filename>python-argparse</filename>.
+ Consequently, the separate
+ <filename>python-argparse</filename> recipe is no
+ longer needed.
+ </para></listitem>
+ <listitem><para><filename>telepathy-python, libtelepathy, telepathy-glib, telepathy-idle, telepathy-mission-control</filename>:
+ All these recipes have moved to
+ <filename>meta-oe</filename> and are consequently no
+ longer needed by any recipes in OpenEmbedded-Core.
+ </para></listitem>
+ <listitem><para><filename>linux-yocto_3.10</filename> and <filename>linux-yocto_3.17</filename>:
+ Support for the linux-yocto 3.10 and 3.17 kernels has been
+ dropped.
+ Support for the 3.14 kernel remains, while support for
+ 3.19 kernel has been added.
+ </para></listitem>
+ <listitem><para><filename>poky-feed-config-opkg</filename>:
+ This recipe has become obsolete and is no longer needed.
+ Use <filename>distro-feed-config</filename> from
+ <filename>meta-oe</filename> instead.
+ </para></listitem>
+ <listitem><para><filename>libav 0.8.x</filename>:
+ <filename>libav 9.x</filename> is now used.
+ </para></listitem>
+ <listitem><para><filename>sed-native</filename>:
+ No longer needed.
+ A working version of <filename>sed</filename> is expected
+ to be provided by the host distribution.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.8-bluez'>
+ <title>BlueZ 4.x / 5.x Selection</title>
+
+ <para>
+ Proper built-in support for selecting BlueZ 5.x in preference
+ to the default of 4.x now exists.
+ To use BlueZ 5.x, simply add "bluez5" to your
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ value.
+ If you had previously added append files
+ (<filename>*.bbappend</filename>) to make this selection, you can
+ now remove them.
+ </para>
+
+ <para>
+ Additionally, a
+ <link linkend='ref-classes-bluetooth'><filename>bluetooth</filename></link>
+ class has been added to make selection of the appropriate bluetooth
+ support within a recipe a little easier.
+ If you wish to make use of this class in a recipe, add something
+ such as the following:
+ <literallayout class='monospaced'>
+ inherit bluetooth
+ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}
+ PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+ PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.8-kernel-build-changes'>
+ <title>Kernel Build Changes</title>
+
+ <para>
+ The kernel build process was changed to place the source
+ in a common shared work area and to place build artifacts
+ separately in the source code tree.
+ In theory, migration paths have been provided for most common
+ usages in kernel recipes but this might not work in all cases.
+ In particular, users need to ensure that
+ <filename>${S}</filename> (source files) and
+ <filename>${B}</filename> (build artifacts) are used
+ correctly in functions such as
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ and
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>.
+ For kernel recipes that do not inherit from
+ <filename>kernel-yocto</filename> or include
+ <filename>linux-yocto.inc</filename>, you might wish to
+ refer to the <filename>linux.inc</filename> file in the
+ <filename>meta-oe</filename> layer for the kinds of changes you
+ need to make.
+ For reference, here is the
+ <ulink url='http://cgit.openembedded.org/meta-openembedded/commit/meta-oe/recipes-kernel/linux/linux.inc?id=fc7132ede27ac67669448d3d2845ce7d46c6a1ee'>commit</ulink>
+ where the <filename>linux.inc</filename> file in
+ <filename>meta-oe</filename> was updated.
+ </para>
+
+ <para>
+ Recipes that rely on the kernel source code and do not inherit
+ the module classes might need to add explicit dependencies on
+ the <filename>do_shared_workdir</filename> kernel task, for example:
+ <literallayout class='monospaced'>
+ do_configure[depends] += "virtual/kernel:do_shared_workdir"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.8-ssl'>
+ <title>SSL 3.0 is Now Disabled in OpenSSL</title>
+
+ <para>
+ SSL 3.0 is now disabled when building OpenSSL.
+ Disabling SSL 3.0 avoids any lingering instances of the POODLE
+ vulnerability.
+ If you feel you must re-enable SSL 3.0, then you can add an
+ append file (<filename>*.bbappend</filename>) for the
+ <filename>openssl</filename> recipe to remove "-no-ssl3"
+ from
+ <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>.
+ </para>
+ </section>
+
+ <section id='migration-1.8-default-sysroot-poisoning'>
+ <title>Default Sysroot Poisoning</title>
+
+ <para>
+ <filename>gcc's</filename> default sysroot and include directories
+ are now "poisoned".
+ In other words, the sysroot and include directories are being
+ redirected to a non-existent location in order to catch when
+ host directories are being used due to the correct options not
+ being passed.
+ This poisoning applies both to the cross-compiler used within the
+ build and to the cross-compiler produced in the SDK.
+ </para>
+
+ <para>
+ If this change causes something in the build to fail, it almost
+ certainly means the various compiler flags and commands are not
+ being passed correctly to the underlying piece of software.
+ In such cases, you need to take corrective steps.
+ </para>
+ </section>
+
+ <section id='migration-1.8-rebuild-improvements'>
+ <title>Rebuild Improvements</title>
+
+ <para>
+ Changes have been made to the
+ <link linkend='ref-classes-base'><filename>base</filename></link>,
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>,
+ and
+ <link linkend='ref-classes-cmake'><filename>cmake</filename></link>
+ classes to clean out generated files when the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task needs to be re-executed.
+ </para>
+
+ <para>
+ One of the improvements is to attempt to run "make clean" during
+ the <filename>do_configure</filename> task if a
+ <filename>Makefile</filename> exists.
+ Some software packages do not provide a working clean target
+ within their make files.
+ If you have such recipes, you need to set
+ <link linkend='var-CLEANBROKEN'><filename>CLEANBROKEN</filename></link>
+ to "1" within the recipe, for example:
+ <literallayout class='monospaced'>
+ CLEANBROKEN = "1"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-1.8-qa-check-and-validation-changes'>
+ <title>QA Check and Validation Changes</title>
+
+ <para>
+ The following QA Check and Validation Changes have occurred:
+ <itemizedlist>
+ <listitem><para>
+ Usage of <filename>PRINC</filename>
+ previously triggered a warning.
+ It now triggers an error.
+ You should remove any remaining usage of
+ <filename>PRINC</filename> in any recipe or append file.
+ </para></listitem>
+ <listitem><para>
+ An additional QA check has been added to detect usage of
+ <filename>${D}</filename> in
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ values where
+ <link linkend='var-D'><filename>D</filename></link> values
+ should not be used at all.
+ The same check ensures that <filename>$D</filename> is used
+ in
+ <filename>pkg_preinst/pkg_postinst/pkg_prerm/pkg_postrm</filename>
+ functions instead of <filename>${D}</filename>.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-S'><filename>S</filename></link> now
+ needs to be set to a valid value within a recipe.
+ If <filename>S</filename> is not set in the recipe, the
+ directory is not automatically created.
+ If <filename>S</filename> does not point to a directory
+ that exists at the time the
+ <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
+ task finishes, a warning will be shown.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ is now validated for correct formatting of multiple
+ licenses.
+ If the format is invalid (e.g. multiple licenses are
+ specified with no operators to specify how the multiple
+ licenses interact), then a warning will be shown.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-1.8-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following miscellaneous changes have occurred:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>send-error-report</filename> script now
+ expects a "-s" option to be specified before the server
+ address.
+ This assumes a server address is being specified.
+ </para></listitem>
+ <listitem><para>
+ The <filename>oe-pkgdata-util</filename> script now
+ expects a "-p" option to be specified before the
+ <filename>pkgdata</filename> directory, which is now
+ optional.
+ If the <filename>pkgdata</filename> directory is not
+ specified, the script will run BitBake to query
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>
+ from the build environment.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.0-release'>
+ <title>Moving to the Yocto Project 2.0 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.0 Release from the prior release.
+ </para>
+
+ <section id='migration-2.0-gcc-5'>
+ <title>GCC 5</title>
+
+ <para>
+ The default compiler is now GCC 5.2.
+ This change has required fixes for compilation errors in a number
+ of other recipes.
+ </para>
+
+ <para>
+ One important example is a fix for when the Linux kernel freezes at
+ boot time on ARM when built with GCC 5.
+ If you are using your own kernel recipe or source tree and
+ building for ARM, you will likely need to apply this
+ <ulink url='https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=a077224fd35b2f7fbc93f14cf67074fc792fbac2'>patch</ulink>.
+ The standard <filename>linux-yocto</filename> kernel source tree
+ already has a workaround for the same issue.
+ </para>
+
+ <para>
+ For further details, see
+ <ulink url='https://gcc.gnu.org/gcc-5/changes.html'></ulink> and
+ the porting guide at
+ <ulink url='https://gcc.gnu.org/gcc-5/porting_to.html'></ulink>.
+ </para>
+
+ <para>
+ Alternatively, you can switch back to GCC 4.9 or 4.8 by
+ setting <filename>GCCVERSION</filename> in your configuration,
+ as follows:
+ <literallayout class='monospaced'>
+ GCCVERSION = "4.9%"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-2.0-Gstreamer-0.10-removed'>
+ <title>Gstreamer 0.10 Removed</title>
+
+ <para>
+ Gstreamer 0.10 has been removed in favor of Gstreamer 1.x.
+ As part of the change, recipes for Gstreamer 0.10 and related
+ software are now located
+ in <filename>meta-multimedia</filename>.
+ This change results in Qt4 having Phonon and Gstreamer
+ support in QtWebkit disabled by default.
+ </para>
+ </section>
+
+ <section id='migration-2.0-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been moved or removed:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bluez4</filename>: The recipe is obsolete and
+ has been moved due to <filename>bluez5</filename>
+ becoming fully integrated.
+ The <filename>bluez4</filename> recipe now resides in
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>gamin</filename>: The recipe is obsolete and
+ has been removed.
+ </para></listitem>
+ <listitem><para>
+ <filename>gnome-icon-theme</filename>: The recipe's
+ functionally has been replaced by
+ <filename>adwaita-icon-theme</filename>.
+ </para></listitem>
+ <listitem><para>
+ Gstreamer 0.10 Recipes: Recipes for Gstreamer 0.10 have
+ been removed in favor of the recipes for Gstreamer 1.x.
+ </para></listitem>
+ <listitem><para>
+ <filename>insserv</filename>: The recipe is obsolete and
+ has been removed.
+ </para></listitem>
+ <listitem><para>
+ <filename>libunique</filename>: The recipe is no longer
+ used and has been moved to <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>midori</filename>: The recipe's functionally
+ has been replaced by <filename>epiphany</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>python-gst</filename>: The recipe is obsolete
+ and has been removed since it only contains bindings for
+ Gstreamer 0.10.
+ </para></listitem>
+ <listitem><para>
+ <filename>qt-mobility</filename>: The recipe is obsolete and
+ has been removed since it requires
+ <filename>Gstreamer 0.10</filename>, which has been
+ replaced.
+ </para></listitem>
+ <listitem><para>
+ <filename>subversion</filename>: All 1.6.x versions of this
+ recipe have been removed.
+ </para></listitem>
+ <listitem><para>
+ <filename>webkit-gtk</filename>: The older 1.8.3 version
+ of this recipe has been removed in favor of
+ <filename>webkitgtk</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.0-bitbake-datastore-improvements'>
+ <title>BitBake datastore improvements</title>
+
+ <para>
+ The method by which BitBake's datastore handles overrides has
+ changed.
+ Overrides are now applied dynamically and
+ <filename>bb.data.update_data()</filename> is now a no-op.
+ Thus, <filename>bb.data.update_data()</filename> is no longer
+ required in order to apply the correct overrides.
+ In practice, this change is unlikely to require any changes to
+ Metadata.
+ However, these minor changes in behavior exist:
+ <itemizedlist>
+ <listitem><para>
+ All potential overrides are now visible in the variable
+ history as seen when you run the following:
+ <literallayout class='monospaced'>
+ $ bitbake -e
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <filename>d.delVar('</filename><replaceable>VARNAME</replaceable><filename>')</filename> and
+ <filename>d.setVar('</filename><replaceable>VARNAME</replaceable><filename>', None)</filename>
+ result in the variable and all of its overrides being
+ cleared out.
+ Before the change, only the non-overridden values
+ were cleared.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.0-shell-message-function-changes'>
+ <title>Shell Message Function Changes</title>
+
+ <para>
+ The shell versions of the BitBake message functions (i.e.
+ <filename>bbdebug</filename>, <filename>bbnote</filename>,
+ <filename>bbwarn</filename>, <filename>bbplain</filename>,
+ <filename>bberror</filename>, and <filename>bbfatal</filename>)
+ are now connected through to their BitBake equivalents
+ <filename>bb.debug()</filename>, <filename>bb.note()</filename>,
+ <filename>bb.warn()</filename>, <filename>bb.plain()</filename>,
+ <filename>bb.error()</filename>, and
+ <filename>bb.fatal()</filename>, respectively.
+ Thus, those message functions that you would expect to be printed
+ by the BitBake UI are now actually printed.
+ In practice, this change means two things:
+ <itemizedlist>
+ <listitem><para>
+ If you now see messages on the console that you did not
+ previously see as a result of this change, you might
+ need to clean up the calls to
+ <filename>bbwarn</filename>, <filename>bberror</filename>,
+ and so forth.
+ Or, you might want to simply remove the calls.
+ </para></listitem>
+ <listitem><para>
+ The <filename>bbfatal</filename> message function now
+ suppresses the full error log in the UI, which means any
+ calls to <filename>bbfatal</filename> where you still
+ wish to see the full error log should be replaced by
+ <filename>die</filename> or
+ <filename>bbfatal_log</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.0-extra-development-debug-package-cleanup'>
+ <title>Extra Development/Debug Package Cleanup</title>
+
+ <para>
+ The following recipes have had extra
+ <filename>dev/dbg</filename> packages removed:
+ <itemizedlist>
+ <listitem><para>
+ <filename>acl</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>apmd</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>aspell</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>attr</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>augeas</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>bzip2</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>cogl</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>curl</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>elfutils</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc-target</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>libgcc</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>libtool</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>libxmu</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>opkg</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>pciutils</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>rpm</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>sysfsutils</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>tiff</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>xz</filename>
+ </para></listitem>
+ </itemizedlist>
+ All of the above recipes now conform to the standard packaging
+ scheme where a single <filename>-dev</filename>,
+ <filename>-dbg</filename>, and <filename>-staticdev</filename>
+ package exists per recipe.
+ </para>
+ </section>
+
+ <section id='migration-2.0-recipe-maintenance-tracking-data-moved-to-oe-core'>
+ <title>Recipe Maintenance Tracking Data Moved to OE-Core</title>
+
+ <para>
+ Maintenance tracking data for recipes that was previously part
+ of <filename>meta-yocto</filename> has been moved to
+ <link linkend='oe-core'>OE-Core</link>.
+ The change includes <filename>package_regex.inc</filename> and
+ <filename>distro_alias.inc</filename>, which are typically enabled
+ when using the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class.
+ Additionally, the contents of
+ <filename>upstream_tracking.inc</filename> has now been split out
+ to the relevant recipes.
+ </para>
+ </section>
+
+ <section id='migration-2.0-automatic-stale-sysroot-file-cleanup'>
+ <title>Automatic Stale Sysroot File Cleanup</title>
+
+ <para>
+ Stale files from recipes that no longer exist in the current
+ configuration are now automatically removed from
+ sysroot as well as removed from
+ any other place managed by shared state.
+ This automatic cleanup means that the build system now properly
+ handles situations such as renaming the build system side of
+ recipes, removal of layers from
+ <filename>bblayers.conf</filename>, and
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ changes.
+ </para>
+
+ <para>
+ Additionally, work directories for old versions of recipes are
+ now pruned.
+ If you wish to disable pruning old work directories, you can set
+ the following variable in your configuration:
+ <literallayout class='monospaced'>
+ SSTATE_PRUNE_OBSOLETEWORKDIR = "0"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-2.0-linux-yocto-kernel-metadata-repository-now-split-from-source'>
+ <title><filename>linux-yocto</filename> Kernel Metadata Repository Now Split from Source</title>
+
+ <para>
+ The <filename>linux-yocto</filename> tree has up to now been a
+ combined set of kernel changes and configuration (meta) data
+ carried in a single tree.
+ While this format is effective at keeping kernel configuration and
+ source modifications synchronized, it is not always obvious to
+ developers how to manipulate the Metadata as compared to the
+ source.
+ </para>
+
+ <para>
+ Metadata processing has now been removed from the
+ <link linkend='ref-classes-kernel-yocto'><filename>kernel-yocto</filename></link>
+ class and the external Metadata repository
+ <filename>yocto-kernel-cache</filename>, which has always been used
+ to seed the <filename>linux-yocto</filename> "meta" branch.
+ This separate <filename>linux-yocto</filename> cache repository
+ is now the primary location for this data.
+ Due to this change, <filename>linux-yocto</filename> is no longer
+ able to process combined trees.
+ Thus, if you need to have your own combined kernel repository,
+ you must do the split there as well and update your recipes
+ accordingly.
+ See the <filename>meta/recipes-kernel/linux/linux-yocto_4.1.bb</filename>
+ recipe for an example.
+ </para>
+ </section>
+
+ <section id='migration-2.0-additional-qa-checks'>
+ <title>Additional QA checks</title>
+
+ <para>
+ The following QA checks have been added:
+ <itemizedlist>
+ <listitem><para>
+ Added a "host-user-contaminated" check for ownership
+ issues for packaged files outside of
+ <filename>/home</filename>.
+ The check looks for files that are incorrectly owned by the
+ user that ran BitBake instead of owned by a valid user in
+ the target system.
+ </para></listitem>
+ <listitem><para>
+ Added an "invalid-chars" check for invalid (non-UTF8)
+ characters in recipe metadata variable values
+ (i.e.
+ <link linkend='var-DESCRIPTION'><filename>DESCRIPTION</filename></link>,
+ <link linkend='var-SUMMARY'><filename>SUMMARY</filename></link>,
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>,
+ and
+ <link linkend='var-SECTION'><filename>SECTION</filename></link>).
+ Some package managers do not support these characters.
+ </para></listitem>
+ <listitem><para>
+ Added an "invalid-packageconfig" check for any options
+ specified in
+ <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
+ that do not match any <filename>PACKAGECONFIG</filename>
+ option defined for the recipe.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.0-miscellaneous'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ These additional changes exist:
+ <itemizedlist>
+ <listitem><para>
+ <filename>gtk-update-icon-cache</filename> has been
+ renamed to <filename>gtk-icon-utils</filename>.
+ </para></listitem>
+ <listitem><para>
+ The <filename>tools-profile</filename>
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ item as well as its corresponding packagegroup and
+ <filename>packagegroup-core-tools-profile</filename> no
+ longer bring in <filename>oprofile</filename>.
+ Bringing in <filename>oprofile</filename> was originally
+ added to aid compilation on resource-constrained
+ targets.
+ However, this aid has not been widely used and is not
+ likely to be used going forward due to the more powerful
+ target platforms and the existence of better
+ cross-compilation tools.
+ </para></listitem>
+ <listitem><para>
+ The
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable's default value now specifies
+ <filename>ext4</filename> instead of
+ <filename>ext3</filename>.
+ </para></listitem>
+ <listitem><para>
+ All support for the <filename>PRINC</filename>
+ variable has been removed.
+ </para></listitem>
+ <listitem><para>
+ The <filename>packagegroup-core-full-cmdline</filename>
+ packagegroup no longer brings in
+ <filename>lighttpd</filename> due to the fact that
+ bringing in <filename>lighttpd</filename> is not really in
+ line with the packagegroup's purpose, which is to add full
+ versions of command-line tools that by default are
+ provided by <filename>busybox</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.1-release'>
+ <title>Moving to the Yocto Project 2.1 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.1 Release from the prior release.
+ </para>
+
+ <section id='migration-2.1-variable-expansion-in-python-functions'>
+ <title>Variable Expansion in Python Functions</title>
+
+ <para>
+ Variable expressions, such as
+ <filename>${</filename><replaceable>VARNAME</replaceable><filename>}</filename>
+ no longer expand automatically within Python functions.
+ Suppressing expansion was done to allow Python functions to
+ construct shell scripts or other code for situations in which you
+ do not want such expressions expanded.
+ For any existing code that relies on these expansions, you need to
+ change the expansions to expand the value of individual
+ variables through <filename>d.getVar()</filename>.
+ To alternatively expand more complex expressions,
+ use <filename>d.expand()</filename>.
+ </para>
+ </section>
+
+ <section id='migration-2.1-overrides-must-now-be-lower-case'>
+ <title>Overrides Must Now be Lower-Case</title>
+
+ <para>
+ The convention for overrides has always been for them to be
+ lower-case characters.
+ This practice is now a requirement as BitBake's datastore now
+ assumes lower-case characters in order to give a slight performance
+ boost during parsing.
+ In practical terms, this requirement means that anything that ends
+ up in
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ must now appear in lower-case characters (e.g. values for
+ <filename>MACHINE</filename>, <filename>TARGET_ARCH</filename>,
+ <filename>DISTRO</filename>, and also recipe names if
+ <filename>_pn-</filename><replaceable>recipename</replaceable>
+ overrides are to be effective).
+ </para>
+ </section>
+
+ <section id='migration-2.1-expand-parameter-to-getvar-and-getvarflag-now-mandatory'>
+ <title>Expand Parameter to <filename>getVar()</filename> and
+ <filename>getVarFlag()</filename> is Now Mandatory</title>
+
+ <para>
+ The expand parameter to <filename>getVar()</filename> and
+ <filename>getVarFlag()</filename> previously defaulted to
+ False if not specified.
+ Now, however, no default exists so one must be specified.
+ You must change any <filename>getVar()</filename> calls that
+ do not specify the final expand parameter to calls that do specify
+ the parameter.
+ You can run the following <filename>sed</filename> command at the
+ base of a layer to make this change:
+ <literallayout class='monospaced'>
+ sed -e 's:\(\.getVar([^,()]*\)):\1, False):g' -i `grep -ril getVar *`
+ sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g' -i `grep -ril getVarFlag *`
+ </literallayout>
+ <note>
+ The reason for this change is that it prepares the way for
+ changing the default to True in a future Yocto Project release.
+ This future change is a much more sensible default than False.
+ However, the change needs to be made gradually as a sudden
+ change of the default would potentially cause side-effects
+ that would be difficult to detect.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.1-makefile-environment-changes'>
+ <title>Makefile Environment Changes</title>
+
+ <para>
+ <link linkend='var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></link>
+ now defaults to "" instead of "-e MAKEFLAGS=".
+ Setting <filename>EXTRA_OEMAKE</filename> to "-e MAKEFLAGS=" by
+ default was a historical accident that has required many classes
+ (e.g. <filename>autotools</filename>, <filename>module</filename>)
+ and recipes to override this default in order to work with
+ sensible build systems.
+ When upgrading to the release, you must edit any recipe that
+ relies upon this old default by either setting
+ <filename>EXTRA_OEMAKE</filename> back to "-e MAKEFLAGS=" or by
+ explicitly setting any required variable value overrides using
+ <filename>EXTRA_OEMAKE</filename>, which is typically only needed
+ when a Makefile sets a default value for a variable that is
+ inappropriate for cross-compilation using the "=" operator rather
+ than the "?=" operator.
+ </para>
+ </section>
+
+ <section id='migration-2.1-libexecdir-reverted-to-prefix-libexec'>
+ <title><filename>libexecdir</filename> Reverted to <filename>${prefix}/libexec</filename></title>
+
+ <para>
+ The use of <filename>${libdir}/${BPN}</filename> as
+ <filename>libexecdir</filename> is different as compared to all
+ other mainstream distributions, which either uses
+ <filename>${prefix}/libexec</filename> or
+ <filename>${libdir}</filename>.
+ The use is also contrary to the GNU Coding Standards
+ (i.e. <ulink url='https://www.gnu.org/prep/standards/html_node/Directory-Variables.html'></ulink>)
+ that suggest <filename>${prefix}/libexec</filename> and also
+ notes that any package-specific nesting should be done by the
+ package itself.
+ Finally, having <filename>libexecdir</filename> change between
+ recipes makes it very difficult for different recipes to invoke
+ binaries that have been installed into
+ <filename>libexecdir</filename>.
+ The Filesystem Hierarchy Standard
+ (i.e. <ulink url='http://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html'></ulink>)
+ now recognizes the use of <filename>${prefix}/libexec/</filename>,
+ giving distributions the choice between
+ <filename>${prefix}/lib</filename> or
+ <filename>${prefix}/libexec</filename> without breaking FHS.
+ </para>
+ </section>
+
+ <section id='migration-2.1-ac-cv-sizeof-off-t-no-longer-cached-in-site-files'>
+ <title><filename>ac_cv_sizeof_off_t</filename> is No Longer Cached in Site Files</title>
+
+ <para>
+ For recipes inheriting the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class, <filename>ac_cv_sizeof_off_t</filename> is no longer cached
+ in the site files for <filename>autoconf</filename>.
+ The reason for this change is because the
+ <filename>ac_cv_sizeof_off_t</filename> value is not necessarily
+ static per architecture as was previously assumed.
+ Rather, the value changes based on whether large file support is
+ enabled.
+ For most software that uses <filename>autoconf</filename>, this
+ change should not be a problem.
+ However, if you have a recipe that bypasses the standard
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task from the <filename>autotools</filename> class and the software
+ the recipe is building uses a very old version of
+ <filename>autoconf</filename>, the recipe might be incapable of
+ determining the correct size of <filename>off_t</filename> during
+ <filename>do_configure</filename>.
+ </para>
+
+ <para>
+ The best course of action is to patch the software as necessary
+ to allow the default implementation from the
+ <filename>autotools</filename> class to work such that
+ <filename>autoreconf</filename> succeeds and produces a working
+ configure script, and to remove the
+ overridden <filename>do_configure</filename> task such that the
+ default implementation does get used.
+ </para>
+ </section>
+
+ <section id='migration-2.1-image-generation-split-out-from-filesystem-generation'>
+ <title>Image Generation is Now Split Out from Filesystem Generation</title>
+
+ <para>
+ Previously, for image recipes the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task assembled the filesystem and then from that filesystem
+ generated images.
+ With this Yocto Project release, image generation is split into
+ separate
+ <link linkend='ref-tasks-image'><filename>do_image_*</filename></link>
+ tasks for clarity both in operation and in the code.
+ </para>
+
+ <para>
+ For most cases, this change does not present any problems.
+ However, if you have made customizations that directly modify the
+ <filename>do_rootfs</filename> task or that mention
+ <filename>do_rootfs</filename>, you might need to update those
+ changes.
+ In particular, if you had added any tasks after
+ <filename>do_rootfs</filename>, you should make edits so that
+ those tasks are after the
+ <link linkend='ref-tasks-image-complete'><filename>do_image_complete</filename></link>
+ task rather than after <filename>do_rootfs</filename>
+ so that the your added tasks
+ run at the correct time.
+ </para>
+
+ <para>
+ A minor part of this restructuring is that the post-processing
+ definitions and functions have been moved from the
+ <link linkend='ref-classes-image'><filename>image</filename></link>
+ class to the
+ <link linkend='ref-classes-rootfs*'><filename>rootfs-postcommands</filename></link>
+ class.
+ Functionally, however, they remain unchanged.
+ </para>
+ </section>
+
+ <section id='migration-2.1-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed in the 2.1 release:
+ <itemizedlist>
+ <listitem><para><filename>gcc</filename> version 4.8:
+ Versions 4.9 and 5.3 remain.
+ </para></listitem>
+ <listitem><para><filename>qt4</filename>:
+ All support for Qt 4.x has been moved out to a separate
+ <filename>meta-qt4</filename> layer because Qt 4 is no
+ longer supported upstream.
+ </para></listitem>
+ <listitem><para><filename>x11vnc</filename>:
+ Moved to the <filename>meta-oe</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>linux-yocto-3.14</filename>:
+ No longer supported.
+ </para></listitem>
+ <listitem><para><filename>linux-yocto-3.19</filename>:
+ No longer supported.
+ </para></listitem>
+ <listitem><para><filename>libjpeg</filename>:
+ Replaced by the <filename>libjpeg-turbo</filename> recipe.
+ </para></listitem>
+ <listitem><para><filename>pth</filename>:
+ Became obsolete.
+ </para></listitem>
+ <listitem><para><filename>liboil</filename>:
+ Recipe is no longer needed and has been moved to the
+ <filename>meta-multimedia</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>gtk-theme-torturer</filename>:
+ Recipe is no longer needed and has been moved to the
+ <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>gnome-mime-data</filename>:
+ Recipe is no longer needed and has been moved to the
+ <filename>meta-gnome</filename> layer.
+ </para></listitem>
+ <listitem><para><filename>udev</filename>:
+ Replaced by the <filename>eudev</filename> recipe for
+ compatibility when using <filename>sysvinit</filename>
+ with newer kernels.
+ </para></listitem>
+ <listitem><para><filename>python-pygtk</filename>:
+ Recipe became obsolete.
+ </para></listitem>
+ <listitem><para><filename>adt-installer</filename>:
+ Recipe became obsolete.
+ See the
+ "<link linkend='migration-2.1-adt-removed'>ADT Removed</link>"
+ section for more information.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-class-changes'>
+ <title>Class Changes</title>
+
+ <para>
+ The following classes have changed:
+ <itemizedlist>
+ <listitem><para><filename>autotools_stage</filename>:
+ Removed because the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class now provides its functionality.
+ Recipes that inherited from
+ <filename>autotools_stage</filename> should now inherit
+ from <filename>autotools</filename> instead.
+ </para></listitem>
+ <listitem><para><filename>boot-directdisk</filename>:
+ Merged into the <filename>image-vm</filename>
+ class.
+ The <filename>boot-directdisk</filename> class was rarely
+ directly used.
+ Consequently, this change should not cause any issues.
+ </para></listitem>
+ <listitem><para><filename>bootimg</filename>:
+ Merged into the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class.
+ The <filename>bootimg</filename> class was rarely
+ directly used.
+ Consequently, this change should not cause any issues.
+ </para></listitem>
+ <listitem><para><filename>packageinfo</filename>:
+ Removed due to its limited use by the Hob UI, which has
+ itself been removed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-build-system-ui-changes'>
+ <title>Build System User Interface Changes</title>
+
+ <para>
+ The following changes have been made to the build system user
+ interface:
+ <itemizedlist>
+ <listitem><para><emphasis>Hob GTK+-based UI</emphasis>:
+ Removed because it is unmaintained and based on the
+ outdated GTK+ 2 library.
+ The Toaster web-based UI is much more capable and is
+ actively maintained.
+ See the
+ "<ulink url='&YOCTO_DOCS_TOAST_URL;#using-the-toaster-web-interface'>Using the Toaster Web Interface</ulink>"
+ section in the Toaster User Manual for more
+ information on this interface.
+ </para></listitem>
+ <listitem><para><emphasis>"puccho" BitBake UI</emphasis>:
+ Removed because is unmaintained and no longer useful.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-adt-removed'>
+ <title>ADT Removed</title>
+
+ <para>
+ The Application Development Toolkit (ADT) has been removed
+ because its functionality almost completely overlapped with the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-using-the-standard-sdk'>standard SDK</ulink>
+ and the
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>extensible SDK</ulink>.
+ For information on these SDKs and how to build and use them, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ <note>
+ The Yocto Project Eclipse IDE Plug-in is still supported and
+ is not affected by this change.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.1-poky-reference-distribution-changes'>
+ <title>Poky Reference Distribution Changes</title>
+
+ <para>
+ The following changes have been made for the Poky distribution:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>meta-yocto</filename> layer has been renamed
+ to <filename>meta-poky</filename> to better match its
+ purpose, which is to provide the Poky reference
+ distribution.
+ The <filename>meta-yocto-bsp</filename> layer retains its
+ original name since it provides reference machines for
+ the Yocto Project and it is otherwise unrelated to Poky.
+ References to <filename>meta-yocto</filename> in your
+ <filename>conf/bblayers.conf</filename> should
+ automatically be updated, so you should not need to change
+ anything unless you are relying on this naming elsewhere.
+ </para></listitem>
+ <listitem><para>
+ The
+ <link linkend='ref-classes-uninative'><filename>uninative</filename></link>
+ class is now enabled by default in Poky.
+ This class attempts to isolate the build system from the
+ host distribution's C library and makes re-use of native
+ shared state artifacts across different host distributions
+ practical.
+ With this class enabled, a tarball containing a pre-built
+ C library is downloaded at the start of the build.</para>
+
+ <para>The <filename>uninative</filename> class is enabled
+ through the
+ <filename>meta/conf/distro/include/yocto-uninative.inc</filename>
+ file, which for those not using the Poky distribution, can
+ include to easily enable the same functionality.</para>
+
+ <para>Alternatively, if you wish to build your own
+ <filename>uninative</filename> tarball, you can do so by
+ building the <filename>uninative-tarball</filename> recipe,
+ making it available to your build machines
+ (e.g. over HTTP/HTTPS) and setting a similar configuration
+ as the one set by <filename>yocto-uninative.inc</filename>.
+ </para></listitem>
+ <listitem><para>
+ Static library generation, for most cases, is now disabled
+ by default in the Poky distribution.
+ Disabling this generation saves some build time as well
+ as the size used for build output artifacts.</para>
+
+ <para>Disabling this library generation is accomplished
+ through a
+ <filename>meta/conf/distro/include/no-static-libs.inc</filename>,
+ which for those not using the Poky distribution can
+ easily include to enable the same functionality.</para>
+
+ <para>Any recipe that needs to opt-out of having the
+ "--disable-static" option specified on the configure
+ command line either because it is not a supported option
+ for the configure script or because static libraries are
+ needed should set the following variable:
+ <literallayout class='monospaced'>
+ DISABLE_STATIC = ""
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The separate <filename>poky-tiny</filename> distribution
+ now uses the musl C library instead of a heavily pared
+ down <filename>glibc</filename>.
+ Using musl results in a smaller
+ distribution and facilitates much greater maintainability
+ because musl is designed to have a small footprint.</para>
+
+ <para>If you have used <filename>poky-tiny</filename> and
+ have customized the <filename>glibc</filename>
+ configuration you will need to redo those customizations
+ with musl when upgrading to the new release.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-packaging-changes'>
+ <title>Packaging Changes</title>
+
+ <para>
+ The following changes have been made to packaging:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>runuser</filename> and
+ <filename>mountpoint</filename> binaries, which were
+ previously in the main <filename>util-linux</filename>
+ package, have been split out into the
+ <filename>util-linux-runuser</filename> and
+ <filename>util-linux-mountpoint</filename> packages,
+ respectively.
+ </para></listitem>
+ <listitem><para>
+ The <filename>python-elementtree</filename> package has
+ been merged into the <filename>python-xml</filename>
+ package.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-tuning-file-changes'>
+ <title>Tuning File Changes</title>
+
+ <para>
+ The following changes have been made to the tuning files:
+ <itemizedlist>
+ <listitem><para>
+ The "no-thumb-interwork" tuning feature has been dropped
+ from the ARM tune include files.
+ Because interworking is required for ARM EABI, attempting
+ to disable it through a tuning feature no longer makes
+ sense.
+ <note>
+ Support for ARM OABI was deprecated in gcc 4.7.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ The <filename>tune-cortexm*.inc</filename> and
+ <filename>tune-cortexr4.inc</filename> files have been
+ removed because they are poorly tested.
+ Until the OpenEmbedded build system officially gains
+ support for CPUs without an MMU, these tuning files would
+ probably be better maintained in a separate layer
+ if needed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.1-supporting-gobject-introspection'>
+ <title>Supporting GObject Introspection</title>
+
+ <para>
+ This release supports generation of GLib Introspective
+ Repository (GIR) files through GObject introspection, which is
+ the standard mechanism for accessing GObject-based software from
+ runtime environments.
+ You can enable, disable, and test the generation of this data.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-gobject-introspection-support'>Enabling GObject Introspection Support</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for more information.
+ </para>
+ </section>
+
+ <section id='migration-2.1-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ These additional changes exist:
+ <itemizedlist>
+ <listitem><para>
+ The minimum Git version has been increased to 1.8.3.1.
+ If your host distribution does not provide a sufficiently
+ recent version, you can install the buildtools, which
+ will provide it.
+ See the
+ "<link linkend='required-git-tar-and-python-versions'>Required Git, tar, and Python Versions</link>"
+ section for more information on the buildtools tarball.
+ </para></listitem>
+ <listitem><para>
+ The buggy and incomplete support for the RPM version 4
+ package manager has been removed.
+ The well-tested and maintained support for RPM version 5
+ remains.
+ </para></listitem>
+ <listitem><para>
+ Previously, the following list of packages were removed
+ if package-management was not in
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>,
+ regardless of any dependencies:
+ <literallayout class='monospaced'>
+ update-rc.d
+ base-passwd
+ shadow
+ update-alternatives
+ run-postinsts
+ </literallayout>
+ With the Yocto Project 2.1 release, these packages are only
+ removed if "read-only-rootfs" is in
+ <filename>IMAGE_FEATURES</filename>, since they might
+ still be needed for a read-write image even in the absence
+ of a package manager (e.g. if users need to be added,
+ modified, or removed at runtime).
+ </para></listitem>
+ <listitem><para>
+ The
+ <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component'><filename>devtool modify</filename></ulink>
+ command now defaults to extracting the source since that
+ is most commonly expected.
+ The "-x" or "--extract" options are now no-ops.
+ If you wish to provide your own existing source tree, you
+ will now need to specify either the "-n" or
+ "--no-extract" options when running
+ <filename>devtool modify</filename>.
+ </para></listitem>
+ <listitem><para>
+ If the formfactor for a machine is either not supplied
+ or does not specify whether a keyboard is attached, then
+ the default is to assume a keyboard is attached rather
+ than assume no keyboard.
+ This change primarily affects the Sato UI.
+ </para></listitem>
+ <listitem><para>
+ The <filename>.debug</filename> directory packaging is
+ now automatic.
+ If your recipe builds software that installs binaries into
+ directories other than the standard ones, you no longer
+ need to take care of setting
+ <filename>FILES_${PN}-dbg</filename> to pick up the
+ resulting <filename>.debug</filename> directories as these
+ directories are automatically found and added.
+ </para></listitem>
+ <listitem><para>
+ Inaccurate disk and CPU percentage data has been dropped
+ from <filename>buildstats</filename> output.
+ This data has been replaced with
+ <filename>getrusage()</filename> data and corrected IO
+ statistics.
+ You will probably need to update any custom code that reads
+ the <filename>buildstats</filename> data.
+ </para></listitem>
+ <listitem><para>
+ The
+ <filename>meta/conf/distro/include/package_regex.inc</filename>
+ is now deprecated.
+ The contents of this file have been moved to individual
+ recipes.
+ <note><title>Tip</title>
+ Because this file will likely be removed in a future
+ Yocto Project release, it is suggested that you remove
+ any references to the file that might be in your
+ configuration.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ The <filename>v86d/uvesafb</filename> has been removed from
+ the <filename>genericx86</filename> and
+ <filename>genericx86-64</filename> reference machines,
+ which are provided by the
+ <filename>meta-yocto-bsp</filename> layer.
+ Most modern x86 boards do not rely on this file and it only
+ adds kernel error messages during startup.
+ If you do still need to support
+ <filename>uvesafb</filename>, you can
+ simply add <filename>v86d</filename> to your image.
+ </para></listitem>
+ <listitem><para>
+ Build sysroot paths are now removed from debug symbol
+ files.
+ Removing these paths means that remote GDB using an
+ unstripped build system sysroot will no longer work
+ (although this was never documented to work).
+ The supported method to accomplish something similar is
+ to set <filename>IMAGE_GEN_DEBUGFS</filename> to "1",
+ which will generate a companion debug image
+ containing unstripped binaries and associated debug
+ sources alongside the image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.2-release'>
+ <title>Moving to the Yocto Project 2.2 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.2 Release from the prior release.
+ </para>
+
+ <section id='migration-2.2-minimum-kernel-version'>
+ <title>Minimum Kernel Version</title>
+
+ <para>
+ The minimum kernel version for the target system and for SDK
+ is now 3.2.0, due to the upgrade
+ to <filename>glibc 2.24</filename>.
+ Specifically, for AArch64-based targets the version is
+ 3.14.
+ For Nios II-based targets, the minimum kernel version is 3.19.
+ <note>
+ For x86 and x86_64, you can reset
+ <link linkend='var-OLDEST_KERNEL'><filename>OLDEST_KERNEL</filename></link>
+ to anything down to 2.6.32 if desired.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.2-staging-directories-in-sysroot-simplified'>
+ <title>Staging Directories in Sysroot Has Been Simplified</title>
+
+ <para>
+ The way directories are staged in sysroot has been simplified and
+ introduces the new
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>,
+ <link linkend='var-SYSROOT_DIRS_NATIVE'><filename>SYSROOT_DIRS_NATIVE</filename></link>,
+ and
+ <link linkend='var-SYSROOT_DIRS_BLACKLIST'><filename>SYSROOT_DIRS_BLACKLIST</filename></link>.
+ See the
+ <ulink url='http://lists.openembedded.org/pipermail/openembedded-core/2016-May/121365.html'>v2 patch series on the OE-Core Mailing List</ulink>
+ for additional information.
+ </para>
+ </section>
+
+ <section id='migration-2.2-removal-of-old-images-from-tmp-deploy-now-enabled'>
+ <title>Removal of Old Images and Other Files in <filename>tmp/deploy</filename> Now Enabled</title>
+
+ <para>
+ Removal of old images and other files in
+ <filename>tmp/deploy/</filename> is now enabled by default due
+ to a new staging method used for those files.
+ As a result of this change, the
+ <filename>RM_OLD_IMAGE</filename> variable is now redundant.
+ </para>
+ </section>
+
+ <section id='migration-2.2-python-changes'>
+ <title>Python Changes</title>
+
+ <para>
+ The following changes for Python occurred:
+ </para>
+
+ <section id='migration-2.2-bitbake-now-requires-python-3.4'>
+ <title>BitBake Now Requires Python 3.4+</title>
+
+ <para>
+ BitBake requires Python 3.4 or greater.
+ </para>
+ </section>
+
+ <section id='migration-2.2-utf-8-locale-required-on-build-host'>
+ <title>UTF-8 Locale Required on Build Host</title>
+
+ <para>
+ A UTF-8 locale is required on the build host due to Python 3.
+ Since C.UTF-8 is not a standard, the default is en_US.UTF-8.
+ </para>
+ </section>
+
+ <section id='migration-2.2-metadata-now-must-use-python-3-syntax'>
+ <title>Metadata Must Now Use Python 3 Syntax</title>
+
+ <para>
+ The metadata is now required to use Python 3 syntax.
+ For help preparing metadata, see any of the many Python 3 porting
+ guides available.
+ Alternatively, you can reference the conversion commits for Bitbake
+ and you can use
+ <link linkend='oe-core'>OE-Core</link> as a guide for changes.
+ Following are particular areas of interest:
+ <literallayout class='monospaced'>
+ * subprocess command-line pipes needing locale decoding
+ * the syntax for octal values changed
+ * the <filename>iter*()</filename> functions changed name
+ * iterators now return views, not lists
+ * changed names for Python modules
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-2.2-target-python-recipes-switched-to-python-3'>
+ <title>Target Python Recipes Switched to Python 3</title>
+
+ <para>
+ Most target Python recipes have now been switched to Python 3.
+ Unfortunately, systems using RPM as a package manager and
+ providing online package-manager support through SMART still
+ require Python 2.
+ <note>
+ Python 2 and recipes that use it can still be built for the
+ target as with previous versions.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.2-buildtools-tarball-includes-python-3'>
+ <title><filename>buildtools-tarball</filename> Includes Python 3</title>
+
+ <para>
+ <filename>buildtools-tarball</filename> now includes Python 3.
+ </para>
+ </section>
+ </section>
+
+ <section id='migration-2.2-uclibc-replaced-by-musl'>
+ <title>uClibc Replaced by musl</title>
+
+ <para>
+ uClibc has been removed in favor of musl.
+ Musl has matured, is better maintained, and is compatible with a
+ wider range of applications as compared to uClibc.
+ </para>
+ </section>
+
+ <section id='migration-2.2-B-no-longer-default-working-directory-for-tasks'>
+ <title><filename>${B}</filename> No Longer Default Working Directory for Tasks</title>
+
+ <para>
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>
+ is no longer the default working directory for tasks.
+ Consequently, any custom tasks you define now need to either
+ have the
+ <filename>[</filename><ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>dirs</filename></ulink><filename>]</filename> flag set, or the task needs to change into the
+ appropriate working directory manually (e.g using
+ <filename>cd</filename> for a shell task).
+ <note>
+ The preferred method is to use the
+ <filename>[dirs]</filename> flag.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.2-runqemu-ported-to-python'>
+ <title><filename>runqemu</filename> Ported to Python</title>
+
+ <para>
+ <filename>runqemu</filename> has been ported to Python and has
+ changed behavior in some cases.
+ Previous usage patterns continue to be supported.
+ </para>
+
+ <para>
+ The new <filename>runqemu</filename> is a Python script.
+ Machine knowledge is no longer hardcoded into
+ <filename>runqemu</filename>.
+ You can choose to use the <filename>qemuboot</filename>
+ configuration file to define the BSP's own arguments and to make
+ it bootable with <filename>runqemu</filename>.
+ If you use a configuration file, use the following form:
+ <literallayout class='monospaced'>
+ <replaceable>image-name</replaceable>-<replaceable>machine</replaceable>.qemuboot.conf
+ </literallayout>
+ The configuration file enables fine-grained tuning of options
+ passed to QEMU without the <filename>runqemu</filename> script
+ hard-coding any knowledge about different machines.
+ Using a configuration file is particularly convenient when trying
+ to use QEMU with machines other than the
+ <filename>qemu*</filename> machines in
+ <link linkend='oe-core'>OE-Core</link>.
+ The <filename>qemuboot.conf</filename> file is generated by the
+ <filename>qemuboot</filename>
+ class when the root filesystem is being build (i.e.
+ build rootfs).
+ QEMU boot arguments can be set in BSP's configuration file and
+ the <filename>qemuboot</filename> class will save them to
+ <filename>qemuboot.conf</filename>.
+ </para>
+
+
+ <para>
+ If you want to use <filename>runqemu</filename> without a
+ configuration file, use the following command form:
+ <literallayout class='monospaced'>
+ $ runqemu <replaceable>machine</replaceable> <replaceable>rootfs</replaceable> <replaceable>kernel</replaceable> [<replaceable>options</replaceable>]
+ </literallayout>
+ Supported <replaceable>machines</replaceable> are as follows:
+ <literallayout class='monospaced'>
+ qemuarm
+ qemuarm64
+ qemux86
+ qemux86-64
+ qemuppc
+ qemumips
+ qemumips64
+ qemumipsel
+ qemumips64el
+ </literallayout>
+ Consider the following example, which uses the
+ <filename>qemux86-64</filename> machine,
+ provides a root filesystem, provides an image, and uses
+ the <filename>nographic</filename> option:
+ <literallayout class='monospaced'>
+$ runqemu qemux86-64 tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.ext4 tmp/deploy/images/qemux86-64/bzImage nographic
+ </literallayout>
+ </para>
+
+ <para>
+ Following is a list of variables that can be set in configuration
+ files such as <filename>bsp.conf</filename> to enable the BSP
+ to be booted by <filename>runqemu</filename>:
+ <note>
+ "QB" means "QEMU Boot".
+ </note>
+ <literallayout class='monospaced'>
+ QB_SYSTEM_NAME: QEMU name (e.g. "qemu-system-i386")
+ QB_OPT_APPEND: Options to append to QEMU (e.g. "-show-cursor")
+ QB_DEFAULT_KERNEL: Default kernel to boot (e.g. "bzImage")
+ QB_DEFAULT_FSTYPE: Default FSTYPE to boot (e.g. "ext4")
+ QB_MEM: Memory (e.g. "-m 512")
+ QB_MACHINE: QEMU machine (e.g. "-machine virt")
+ QB_CPU: QEMU cpu (e.g. "-cpu qemu32")
+ QB_CPU_KVM: Similar to QB_CPU except used for kvm support (e.g. "-cpu kvm64")
+ QB_KERNEL_CMDLINE_APPEND: Options to append to the kernel's -append
+ option (e.g. "console=ttyS0 console=tty")
+ QB_DTB: QEMU dtb name
+ QB_AUDIO_DRV: QEMU audio driver (e.g. "alsa", set it when support audio)
+ QB_AUDIO_OPT: QEMU audio option (e.g. "-soundhw ac97,es1370"), which is used
+ when QB_AUDIO_DRV is set.
+ QB_KERNEL_ROOT: Kernel's root (e.g. /dev/vda)
+ QB_TAP_OPT: Network option for 'tap' mode (e.g.
+ "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no -device virtio-net-device,netdev=net0").
+ runqemu will replace "@TAP@" with the one that is used, such as tap0, tap1 ...
+ QB_SLIRP_OPT: Network option for SLIRP mode (e.g. "-netdev user,id=net0 -device virtio-net-device,netdev=net0")
+ QB_ROOTFS_OPT: Used as rootfs (e.g.
+ "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0").
+ runqemu will replace "@ROOTFS@" with the one which is used, such as
+ core-image-minimal-qemuarm64.ext4.
+ QB_SERIAL_OPT: Serial port (e.g. "-serial mon:stdio")
+ QB_TCPSERIAL_OPT: tcp serial port option (e.g.
+ " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+ runqemu will replace "@PORT@" with the port number which is used.
+ </literallayout>
+ </para>
+
+ <para>
+ To use <filename>runqemu</filename>, set
+ <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link>
+ as follows and run <filename>runqemu</filename>:
+ <note>
+ For command-line syntax, use
+ <filename>runqemu help</filename>.
+ </note>
+ <literallayout class='monospaced'>
+ IMAGE_CLASSES += "qemuboot"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-2.2-default-linker-hash-style-changed'>
+ <title>Default Linker Hash Style Changed</title>
+
+ <para>
+ The default linker hash style for <filename>gcc-cross</filename>
+ is now "sysv" in order to catch recipes that are building software
+ without using the OpenEmbedded
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>.
+ This change could result in seeing some "No GNU_HASH in the elf
+ binary" QA issues when building such recipes.
+ You need to fix these recipes so that they use the expected
+ <filename>LDFLAGS</filename>.
+ Depending on how the software is built, the build system used by
+ the software (e.g. a Makefile) might need to be patched.
+ However, sometimes making this fix is as simple as adding the
+ following to the recipe:
+ <literallayout class='monospaced'>
+ TARGET_CC_ARCH += "${LDFLAGS}"
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='migration-2.2-kernel-image-base-name-no-longer-uses-kernel-imagetype'>
+ <title><filename>KERNEL_IMAGE_BASE_NAME</filename> no Longer Uses <filename>KERNEL_IMAGETYPE</filename></title>
+
+ <para>
+ The
+ <link linkend='var-KERNEL_IMAGE_BASE_NAME'><filename>KERNEL_IMAGE_BASE_NAME</filename></link>
+ variable no longer uses the
+ <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link>
+ variable to create the image's base name.
+ Because the OpenEmbedded build system can now build multiple kernel
+ image types, this part of the kernel image base name as been
+ removed leaving only the following:
+ <literallayout class='monospaced'>
+ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}
+ </literallayout>
+ If you have recipes or classes that use
+ <filename>KERNEL_IMAGE_BASE_NAME</filename> directly, you might
+ need to update the references to ensure they continue to work.
+ </para>
+ </section>
+
+ <section id='migration-2.2-bitbake-changes'>
+ <title>BitBake Changes</title>
+
+ <para>
+ The following changes took place for BitBake:
+ <itemizedlist>
+ <listitem><para>
+ The "goggle" UI and standalone image-writer tool have
+ been removed as they both require GTK+ 2.0 and
+ were not being maintained.
+ </para></listitem>
+ <listitem><para>
+ The Perforce fetcher now supports
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ for specifying the source revision to use, be it
+ <filename>${</filename><link linkend='var-AUTOREV'><filename>AUTOREV</filename></link><filename>}</filename>,
+ changelist number, p4date, or label, in preference to
+ separate
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ parameters to specify these.
+ This change is more in-line with how the other fetchers
+ work for source control systems.
+ Recipes that fetch from Perforce will need to be updated
+ to use <filename>SRCREV</filename> in place of specifying
+ the source revision within
+ <filename>SRC_URI</filename>.
+ </para></listitem>
+ <listitem><para>
+ Some of BitBake's internal code structures for accessing
+ the recipe cache needed to be changed to support the new
+ multi-configuration functionality.
+ These changes will affect external tools that use BitBake's
+ tinfoil module.
+ For information on these changes, see the changes made to
+ the scripts supplied with OpenEmbedded-Core:
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=189371f8393971d00bca0fceffd67cc07784f6ee'>1</ulink>
+ and
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4a5aa7ea4d07c2c90a1654b174873abb018acc67'>2</ulink>.
+ </para></listitem>
+ <listitem><para>
+ The task management code has been rewritten to avoid using
+ ID indirection in order to improve performance.
+ This change is unlikely to cause any problems for most
+ users.
+ However, the setscene verification function as pointed to
+ by <filename>BB_SETSCENE_VERIFY_FUNCTION</filename>
+ needed to change signature.
+ Consequently, a new variable named
+ <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
+ has been added allowing multiple versions of BitBake
+ to work with suitably written metadata, which includes
+ OpenEmbedded-Core and Poky.
+ Anyone with custom BitBake task scheduler code might also
+ need to update the code to handle the new structure.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.2-swabber-has-been-removed'>
+ <title>Swabber has Been Removed</title>
+
+ <para>
+ Swabber, a tool that was intended to detect host contamination in
+ the build process, has been removed, as it has been unmaintained
+ and unused for some time and was never particularly effective.
+ The OpenEmbedded build system has since incorporated a number of
+ mechanisms including enhanced QA checks that mean that there is
+ less of a need for such a tool.
+ </para>
+ </section>
+
+ <section id='migration-2.2-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <filename>augeas</filename>:
+ No longer needed and has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>directfb</filename>:
+ Unmaintained and has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>gcc</filename>:
+ Removed 4.9 version.
+ Versions 5.4 and 6.2 are still present.
+ </para></listitem>
+ <listitem><para>
+ <filename>gnome-doc-utils</filename>:
+ No longer needed.
+ </para></listitem>
+ <listitem><para>
+ <filename>gtk-doc-stub</filename>:
+ Replaced by <filename>gtk-doc</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>gtk-engines</filename>:
+ No longer needed and has been moved to
+ <filename>meta-gnome</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>gtk-sato-engine</filename>:
+ Became obsolete.
+ </para></listitem>
+ <listitem><para>
+ <filename>libglade</filename>:
+ No longer needed and has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>libmad</filename>:
+ Unmaintained and functionally replaced by
+ <filename>libmpg123</filename>.
+ <filename>libmad</filename> has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>libowl</filename>:
+ Became obsolete.
+ </para></listitem>
+ <listitem><para>
+ <filename>libxsettings-client</filename>:
+ No longer needed.
+ </para></listitem>
+ <listitem><para>
+ <filename>oh-puzzles</filename>:
+ Functionally replaced by
+ <filename>puzzles</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>oprofileui</filename>:
+ Became obsolete.
+ OProfile has been largely supplanted by perf.
+ </para></listitem>
+ <listitem><para>
+ <filename>packagegroup-core-directfb.bb</filename>:
+ Removed.
+ </para></listitem>
+ <listitem><para>
+ <filename>core-image-directfb.bb</filename>:
+ Removed.
+ </para></listitem>
+ <listitem><para>
+ <filename>pointercal</filename>:
+ No longer needed and has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>python-imaging</filename>:
+ No longer needed and moved to
+ <filename>meta-python</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>python-pyrex</filename>:
+ No longer needed and moved to
+ <filename>meta-python</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>sato-icon-theme</filename>:
+ Became obsolete.
+ </para></listitem>
+ <listitem><para>
+ <filename>swabber-native</filename>:
+ Swabber has been removed.
+ See the
+ <link linkend='migration-2.2-swabber-has-been-removed'>entry on Swabber</link>.
+ </para></listitem>
+ <listitem><para>
+ <filename>tslib</filename>:
+ No longer needed and has been moved to
+ <filename>meta-oe</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>uclibc</filename>:
+ Removed in favor of musl.
+ </para></listitem>
+ <listitem><para>
+ <filename>xtscal</filename>:
+ No longer needed and moved to
+ <filename>meta-oe</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.2-removed-classes'>
+ <title>Removed Classes</title>
+
+ <para>
+ The following classes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <filename>distutils-native-base</filename>:
+ No longer needed.
+ </para></listitem>
+ <listitem><para>
+ <filename>distutils3-native-base</filename>:
+ No longer needed.
+ </para></listitem>
+ <listitem><para>
+ <filename>sdl</filename>:
+ Only set
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ and
+ <link linkend='var-SECTION'><filename>SECTION</filename></link>,
+ which are better set within the recipe instead.
+ </para></listitem>
+ <listitem><para>
+ <filename>sip</filename>:
+ Mostly unused.
+ </para></listitem>
+ <listitem><para>
+ <filename>swabber</filename>:
+ See the
+ <link linkend='migration-2.2-swabber-has-been-removed'>entry on Swabber</link>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.2-minor-packaging-changes'>
+ <title>Minor Packaging Changes</title>
+
+ <para>
+ The following minor packaging changes have occurred:
+ <itemizedlist>
+ <listitem><para>
+ <filename>grub</filename>:
+ Split <filename>grub-editenv</filename> into its own
+ package.
+ </para></listitem>
+ <listitem><para>
+ <filename>systemd</filename>:
+ Split container and vm related units into a new package,
+ systemd-container.
+ </para></listitem>
+ <listitem><para>
+ <filename>util-linux</filename>:
+ Moved <filename>prlimit</filename> to a separate
+ <filename>util-linux-prlimit</filename> package.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.2-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following miscellaneous changes have occurred:
+ <itemizedlist>
+ <listitem><para>
+ <filename>package_regex.inc</filename>:
+ Removed because the definitions
+ <filename>package_regex.inc</filename> previously contained
+ have been moved to their respective recipes.
+ </para></listitem>
+ <listitem><para>
+ Both <filename>devtool add</filename> and
+ <filename>recipetool create</filename> now use a fixed
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ by default when fetching from a Git repository.
+ You can override this in either case to use
+ <filename>${</filename><link linkend='var-AUTOREV'><filename>AUTOREV</filename></link><filename>}</filename>
+ instead by using the <filename>-a</filename> or
+ <filename>&dash;&dash;autorev</filename> command-line
+ option
+ </para></listitem>
+ <listitem><para>
+ <filename>distcc</filename>:
+ GTK+ UI is now disabled by default.
+ </para></listitem>
+ <listitem><para>
+ <filename>packagegroup-core-tools-testapps</filename>:
+ Removed Piglit.
+ </para></listitem>
+ <listitem><para>
+ <filename>image.bbclass</filename>:
+ Renamed COMPRESS(ION) to CONVERSION.
+ This change means that
+ <filename>COMPRESSIONTYPES</filename>,
+ <filename>COMPRESS_DEPENDS</filename> and
+ <filename>COMPRESS_CMD</filename> are deprecated in favor
+ of <filename>CONVERSIONTYPES</filename>,
+ <filename>CONVERSION_DEPENDS</filename> and
+ <filename>CONVERSION_CMD</filename>.
+ The <filename>COMPRESS*</filename> variable names will
+ still work in the 2.2 release but metadata that does not
+ need to be backwards-compatible should be changed to
+ use the new names as the <filename>COMPRESS*</filename>
+ ones will be removed in a future release.
+ </para></listitem>
+ <listitem><para>
+ <filename>gtk-doc</filename>:
+ A full version of <filename>gtk-doc</filename> is now
+ made available.
+ However, some old software might not be capable of using
+ the current version of <filename>gtk-doc</filename>
+ to build documentation.
+ You need to change recipes that build such software so that
+ they explicitly disable building documentation with
+ <filename>gtk-doc</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.3-release'>
+ <title>Moving to the Yocto Project 2.3 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.3 Release from the prior release.
+ </para>
+
+ <section id='migration-2.3-recipe-specific-sysroots'>
+ <title>Recipe-specific Sysroots</title>
+
+ <para>
+ The OpenEmbedded build system now uses one sysroot per
+ recipe to resolve long-standing issues with configuration
+ script auto-detection of undeclared dependencies.
+ Consequently, you might find that some of your previously
+ written custom recipes are missing declared dependencies,
+ particularly those dependencies that are incidentally built
+ earlier in a typical build process and thus are already likely
+ to be present in the shared sysroot in previous releases.
+ </para>
+
+ <para>
+ Consider the following:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Declare Build-Time Dependencies:</emphasis>
+ Because of this new feature, you must explicitly
+ declare all build-time dependencies for your recipe.
+ If you do not declare these dependencies, they are not
+ populated into the sysroot for the recipe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Specify Pre-Installation and Post-Installation
+ Native Tool Dependencies:</emphasis>
+ You must specifically specify any special native tool
+ dependencies of <filename>pkg_preinst</filename> and
+ <filename>pkg_postinst</filename> scripts by using the
+ <link linkend='var-PACKAGE_WRITE_DEPS'><filename>PACKAGE_WRITE_DEPS</filename></link>
+ variable.
+ Specifying these dependencies ensures that these tools
+ are available if these scripts need to be run on the
+ build host during the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task.</para>
+
+ <para>As an example, see the <filename>dbus</filename>
+ recipe.
+ You will see that this recipe has a
+ <filename>pkg_postinst</filename> that calls
+ <filename>systemctl</filename> if "systemd" is in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ In the example,
+ <filename>systemd-systemctl-native</filename> is added to
+ <filename>PACKAGE_WRITE_DEPS</filename>, which is also
+ conditional on "systemd" being in
+ <filename>DISTRO_FEATURES</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Examine Recipes that Use
+ <filename>SSTATEPOSTINSTFUNCS</filename>:</emphasis>
+ You need to examine any recipe that uses
+ <filename>SSTATEPOSTINSTFUNCS</filename> and determine
+ steps to take.</para>
+
+ <para>Functions added to
+ <filename>SSTATEPOSTINSTFUNCS</filename> are still
+ called as they were in previous Yocto Project releases.
+ However, since a separate sysroot is now being populated
+ for every recipe and if existing functions being called
+ through <filename>SSTATEPOSTINSTFUNCS</filename> are
+ doing relocation, then you will need to change these
+ to use a post-installation script that is installed by a
+ function added to
+ <link linkend='var-SYSROOT_PREPROCESS_FUNCS'><filename>SYSROOT_PREPROCESS_FUNCS</filename></link>.
+ </para>
+
+ <para>For an example, see the
+ <filename>pixbufcache</filename> class in
+ <filename>meta/classes/</filename> in the Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>.
+ <note>
+ The <filename>SSTATEPOSTINSTFUNCS</filename> variable
+ itself is now deprecated in favor of the
+ <filename>do_populate_sysroot[postfuncs]</filename>
+ task.
+ Consequently, if you do still have any function or
+ functions that need to be called after the sysroot
+ component is created for a recipe, then you would be
+ well advised to take steps to use a post installation
+ script as described previously.
+ Taking these steps prepares your code for when
+ <filename>SSTATEPOSTINSTFUNCS</filename> is
+ removed in a future Yocto Project release.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Specify the Sysroot when Using Certain
+ External Scripts:</emphasis>
+ Because the shared sysroot is now gone, the scripts
+ <filename>oe-find-native-sysroot</filename> and
+ <filename>oe-run-native</filename> have been changed such
+ that you need to specify which recipe's
+ <link linkend='var-STAGING_DIR_NATIVE'><filename>STAGING_DIR_NATIVE</filename></link>
+ is used.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ You can find more information on how recipe-specific sysroots
+ work in the
+ "<link linkend='ref-classes-staging'><filename>staging.bbclass</filename></link>"
+ section.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.3-path-variable'>
+ <title><filename>PATH</filename> Variable</title>
+
+ <para>
+ Within the environment used to run build tasks, the environment
+ variable <filename>PATH</filename> is now sanitized such that
+ the normal native binary paths
+ (<filename>/bin</filename>, <filename>/sbin</filename>,
+ <filename>/usr/bin</filename> and so forth) are
+ removed and a directory containing symbolic links linking only
+ to the binaries from the host mentioned in the
+ <link linkend='var-HOSTTOOLS'><filename>HOSTTOOLS</filename></link>
+ and
+ <link linkend='var-HOSTTOOLS_NONFATAL'><filename>HOSTTOOLS_NONFATAL</filename></link>
+ variables is added to <filename>PATH</filename>.
+ </para>
+
+ <para>
+ Consequently, any native binaries provided by the host that you
+ need to call needs to be in one of these two variables at
+ the configuration level.
+ </para>
+
+ <para>
+ Alternatively, you can add a native recipe (i.e.
+ <filename>-native</filename>) that provides the
+ binary to the recipe's
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ value.
+ <note>
+ <filename>PATH</filename> is not sanitized in the same way
+ within <filename>devshell</filename>.
+ If it were, you would have difficulty running host tools for
+ development and debugging within the shell.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.3-scripts'>
+ <title>Changes to Scripts</title>
+
+ <para>
+ The following changes to scripts took place:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>oe-find-native-sysroot</filename>:</emphasis>
+ The usage for the
+ <filename>oe-find-native-sysroot</filename> script has
+ changed to the following:
+ <literallayout class='monospaced'>
+ $ . oe-find-native-sysroot <replaceable>recipe</replaceable>
+ </literallayout>
+ You must now supply a recipe for
+ <replaceable>recipe</replaceable> as part of the command.
+ Prior to the Yocto Project &DISTRO; release, it was not
+ necessary to provide the script with the command.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>oe-run-native</filename>:</emphasis>
+ The usage for the
+ <filename>oe-run-native</filename> script has changed
+ to the following:
+ <literallayout class='monospaced'>
+ $ oe-run-native <replaceable>native_recipe</replaceable> <replaceable>tool</replaceable>
+ </literallayout>
+ You must supply the name of the native recipe and the tool
+ you want to run as part of the command.
+ Prior to the Yocto Project &DISTRO; release, it was not
+ necessary to provide the native recipe with the command.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>cleanup-workdir</filename>:</emphasis>
+ The <filename>cleanup-workdir</filename> script has been
+ removed because the script was found to be deleting
+ files it should not have, which lead to broken build
+ trees.
+ Rather than trying to delete portions of
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ and getting it wrong, it is recommended that you
+ delete <filename>TMPDIR</filename> and have it restored
+ from shared state (sstate) on subsequent builds.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>wipe-sysroot</filename>:</emphasis>
+ The <filename>wipe-sysroot</filename> script has been
+ removed as it is no longer needed with recipe-specific
+ sysroots.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-functions'>
+ <title>Changes to Functions</title>
+
+ <para>
+ The previously deprecated
+ <filename>bb.data.getVar()</filename>,
+ <filename>bb.data.setVar()</filename>, and
+ related functions have been removed in favor of
+ <filename>d.getVar()</filename>,
+ <filename>d.setVar()</filename>, and so forth.
+ </para>
+
+ <para>
+ You need to fix any references to these old functions.
+ </para>
+ </section>
+
+ <section id='migration-2.3-bitbake-changes'>
+ <title>BitBake Changes</title>
+
+ <para>
+ The following changes took place for BitBake:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>BitBake's Graphical Dependency Explorer UI Replaced:</emphasis>
+ BitBake's graphical dependency explorer UI
+ <filename>depexp</filename> was replaced by
+ <filename>taskexp</filename> ("Task Explorer"), which
+ provides a graphical way of exploring the
+ <filename>task-depends.dot</filename> file.
+ The data presented by Task Explorer is much more
+ accurate than the data that was presented by
+ <filename>depexp</filename>.
+ Being able to visualize the data is an often requested
+ feature as standard <filename>*.dot</filename> file
+ viewers cannot usual cope with the size of
+ the <filename>task-depends.dot</filename> file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>BitBake "-g" Output Changes:</emphasis>
+ The <filename>package-depends.dot</filename> and
+ <filename>pn-depends.dot</filename> files as previously
+ generated using the <filename>bitbake -g</filename> command
+ have been removed.
+ A <filename>recipe-depends.dot</filename> file
+ is now generated as a collapsed version of
+ <filename>task-depends.dot</filename> instead.
+ </para>
+
+ <para>The reason for this change is because
+ <filename>package-depends.dot</filename> and
+ <filename>pn-depends.dot</filename> largely date back
+ to a time before task-based execution and do not take
+ into account task-level dependencies between recipes,
+ which could be misleading.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Mirror Variable Splitting Changes:</emphasis>
+ Mirror variables including
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>,
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
+ and
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+ can now separate values entirely with spaces.
+ Consequently, you no longer need "\\n".
+ BitBake looks for pairs of values, which simplifies usage.
+ There should be no change required to existing mirror
+ variable values themselves.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>The Subversion (SVN) Fetcher Uses an "ssh" Parameter and Not an "rsh" Parameter:</emphasis>
+ The SVN fetcher now takes an "ssh" parameter instead of an
+ "rsh" parameter.
+ This new optional parameter is used when the "protocol"
+ parameter is set to "svn+ssh".
+ You can only use the new parameter to specify the
+ <filename>ssh</filename> program used by SVN.
+ The SVN fetcher passes the new parameter through the
+ <filename>SVN_SSH</filename> environment variable during
+ the
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
+ task.</para>
+
+ <para>See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#svn-fetcher'>Subversion (SVN) Fetcher (svn://)</ulink>"
+ section in the BitBake User Manual for additional
+ information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>BB_SETSCENE_VERIFY_FUNCTION</filename>
+ and <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
+ Removed:</emphasis>
+ Because the mechanism they were part of is no longer
+ necessary with recipe-specific sysroots, the
+ <filename>BB_SETSCENE_VERIFY_FUNCTION</filename> and
+ <filename>BB_SETSCENE_VERIFY_FUNCTION2</filename>
+ variables have been removed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-absolute-symlinks'>
+ <title>Absolute Symbolic Links</title>
+
+ <para>
+ Absolute symbolic links (symlinks) within staged files are no
+ longer permitted and now trigger an error.
+ Any explicit creation of symlinks can use the
+ <filename>lnr</filename> script, which is a replacement for
+ <filename>ln -r</filename>.
+ </para>
+
+ <para>
+ If the build scripts in the software that the recipe is building
+ are creating a number of absolute symlinks that need to be
+ corrected, you can inherit
+ <filename>relative_symlinks</filename> within the recipe to turn
+ those absolute symlinks into relative symlinks.
+ </para>
+ </section>
+
+ <section id='migration-2.3-gplv2-and-gplv3-moves'>
+ <title>GPLv2 Versions of GPLv3 Recipes Moved</title>
+
+ <para>
+ Older GPLv2 versions of GPLv3 recipes have moved to a
+ separate <filename>meta-gplv2</filename> layer.
+ </para>
+
+ <para>
+ If you use
+ <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>
+ to exclude GPLv3 or set
+ <link linkend='var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></link>
+ to substitute a GPLv2 version of a GPLv3 recipe, then you must add
+ the <filename>meta-gplv2</filename> layer to your configuration.
+ <note>
+ You can find <filename>meta-gplv2</filename> layer in the
+ OpenEmbedded layer index at
+ <ulink url='https://layers.openembedded.org/layerindex/branch/master/layer/meta-gplv2/'></ulink>.
+ </note>
+ </para>
+
+ <para>
+ These relocated GPLv2 recipes do not receive the same level of
+ maintenance as other core recipes.
+ The recipes do not get security fixes and upstream no longer
+ maintains them.
+ In fact, the upstream community is actively hostile towards people
+ that use the old versions of the recipes.
+ Moving these recipes into a separate layer both makes the different
+ needs of the recipes clearer and clearly identifies the number of
+ these recipes.
+ <note>
+ The long-term solution might be to move to BSD-licensed
+ replacements of the GPLv3 components for those that need to
+ exclude GPLv3-licensed components from the target system.
+ This solution will be investigated for future Yocto
+ Project releases.
+ </note>
+ </para>
+ </section>
+
+ <section id='migration-2.3-package-management-changes'>
+ <title>Package Management Changes</title>
+
+ <para>
+ The following package management changes took place:
+ <itemizedlist>
+ <listitem><para>
+ Smart package manager is replaced by DNF package manager.
+ Smart has become unmaintained upstream, is not ported
+ to Python 3.x.
+ Consequently, Smart needed to be replaced.
+ DNF is the only feasible candidate.</para>
+ <para>The change in functionality is that the on-target
+ runtime package management from remote package feeds is
+ now done with a different tool that has a
+ different set of command-line options.
+ If you have scripts that call the
+ tool directly, or use its API, they need to be fixed.</para>
+ <para>For more information, see the
+ <ulink url='http://dnf.readthedocs.io/en/latest/'>DNF Documentation</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Rpm 5.x is replaced with Rpm 4.x.
+ This is done for two major reasons:
+ <itemizedlist>
+ <listitem><para>
+ DNF is API-incompatible with Rpm 5.x and porting
+ it and maintaining the port is non-trivial.
+ </para></listitem>
+ <listitem><para>
+ Rpm 5.x itself has limited maintenance upstream,
+ and the Yocto Project is one of the very few
+ remaining users.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ Berkeley DB 6.x is removed and Berkeley DB 5.x becomes
+ the default:
+ <itemizedlist>
+ <listitem><para>
+ Version 6.x of Berkeley DB has largely been
+ rejected by the open source community due to its
+ AGPLv3 license.
+ As a result, most mainstream open source projects
+ that require DB are still developed and tested with
+ DB 5.x.
+ </para></listitem>
+ <listitem><para>
+ In OE-core, the only thing that was requiring
+ DB 6.x was Rpm 5.x.
+ Thus, no reason exists to continue carrying DB 6.x
+ in OE-core.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <filename>createrepo</filename> is replaced with
+ <filename>createrepo_c</filename>.</para>
+ <para><filename>createrepo_c</filename> is the current
+ incarnation of the tool that generates remote repository
+ metadata.
+ It is written in C as compared to
+ <filename>createrepo</filename>, which is written in
+ Python.
+ <filename>createrepo_c</filename> is faster and is
+ maintained.
+ </para></listitem>
+ <listitem><para>
+ Architecture-independent RPM packages are "noarch"
+ instead of "all".</para>
+ <para>This change was made because too many places in
+ DNF/RPM4 stack already make that assumption.
+ Only the filenames and the architecture tag has changed.
+ Nothing else has changed in OE-core system, particularly
+ in the
+ <link linkend='ref-classes-allarch'><filename>allarch.bbclass</filename></link>
+ class.
+ </para></listitem>
+ <listitem><para>
+ Signing of remote package feeds using
+ <filename>PACKAGE_FEED_SIGN</filename>
+ is not currently supported.
+ This issue will be fully addressed in a future
+ Yocto Project release.
+ See <ulink url='https://bugzilla.yoctoproject.org/show_bug.cgi?id=11209'>defect 11209</ulink>
+ for more information on a solution to package feed
+ signing with RPM in the Yocto Project 2.3 release.
+ </para></listitem>
+ <listitem><para>
+ OPKG now uses the libsolv backend for resolving package
+ dependencies by default.
+ This is vastly superior to OPKG's internal ad-hoc solver
+ that was previously used.
+ This change does have a small impact on disk (around
+ 500 KB) and memory footprint.
+ <note>
+ For further details on this change, see the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?
+id=f4d4f99cfbc2396e49c1613a7d237b9e57f06f81'>commit message</ulink>.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>linux-yocto 4.8:</filename></emphasis>
+ Version 4.8 has been removed.
+ Versions 4.1 (LTSI), 4.4 (LTS), 4.9 (LTS/LTSI) and 4.10
+ are now present.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-smartpm:</filename></emphasis>
+ Functionally replaced by <filename>dnf</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>createrepo:</filename></emphasis>
+ Replaced by the <filename>createrepo-c</filename> recipe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>rpmresolve:</filename></emphasis>
+ No longer needed with the move to RPM 4 as RPM itself is
+ used instead.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gstreamer:</filename></emphasis>
+ Removed the GStreamer Git version recipes as they have
+ been stale.
+ <filename>1.10.</filename><replaceable>x</replaceable>
+ recipes are still present.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>alsa-conf-base:</filename></emphasis>
+ Merged into <filename>alsa-conf</filename> since
+ <filename>libasound</filename> depended on both.
+ Essentially, no way existed to install only one of these.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>tremor:</filename></emphasis>
+ Moved to <filename>meta-multimedia</filename>.
+ Fixed-integer Vorbis decoding is not
+ needed by current hardware.
+ Thus, GStreamer's ivorbis plugin has been disabled
+ by default eliminating the need for the
+ <filename>tremor</filename> recipe in
+ <link linkend='oe-core'>OE-Core</link>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gummiboot:</filename></emphasis>
+ Replaced by <filename>systemd-boot</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-wic-changes'>
+ <title>Wic Changes</title>
+
+ <para>
+ The following changes have been made to Wic:
+ <note>
+ For more information on Wic, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-partitioned-images-using-wic'>Creating Partitioned Images Using Wic</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Default Output Directory Changed:</emphasis>
+ Wic's default output directory is now the current directory
+ by default instead of the unusual
+ <filename>/var/tmp/wic</filename>.</para>
+
+ <para>The "-o" and "--outdir" options remain unchanged
+ and are used to specify your preferred output directory
+ if you do not want to use the default directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>fsimage Plug-in Removed:</emphasis>
+ The Wic fsimage plug-in has been removed as it duplicates
+ functionality of the rawcopy plug-in.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-qa-changes'>
+ <title>QA Changes</title>
+
+ <para>
+ The following QA checks have changed:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>unsafe-references-in-binaries</filename>:</emphasis>
+ The <filename>unsafe-references-in-binaries</filename>
+ QA check, which was disabled by default, has now been
+ removed.
+ This check was intended to detect binaries in
+ <filename>/bin</filename> that link to libraries in
+ <filename>/usr/lib</filename> and have the case where
+ the user has <filename>/usr</filename> on a separate
+ filesystem to <filename>/</filename>.</para>
+
+ <para>The removed QA check was buggy.
+ Additionally, <filename>/usr</filename> residing on a
+ separate partition from <filename>/</filename> is now
+ a rare configuration.
+ Consequently,
+ <filename>unsafe-references-in-binaries</filename> was
+ removed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>file-rdeps</filename>:</emphasis>
+ The <filename>file-rdeps</filename> QA check is now an
+ error by default instead of a warning.
+ Because it is an error instead of a warning, you need to
+ address missing runtime dependencies.</para>
+
+ <para>For additional information, see the
+ <link linkend='ref-classes-insane'><filename>insane</filename></link>
+ class and the
+ "<link linkend='qa-errors-and-warnings'>Errors and Warnings</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.3-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following miscellaneous changes have occurred:
+ <itemizedlist>
+ <listitem><para>
+ In this release, a number of recipes have been changed to
+ ignore the <filename>largefile</filename>
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ item, enabling large file support unconditionally.
+ This feature has always been enabled by default.
+ Disabling the feature has not been widely tested.
+ <note>
+ Future releases of the Yocto Project will remove
+ entirely the ability to disable the
+ <filename>largefile</filename> feature,
+ which would make it unconditionally enabled everywhere.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ If the
+ <link linkend='var-DISTRO_VERSION'><filename>DISTRO_VERSION</filename></link>
+ value contains the value of the
+ <link linkend='var-DATE'><filename>DATE</filename></link>
+ variable, which is the default between Poky releases,
+ the <filename>DATE</filename> value is explicitly excluded
+ from <filename>/etc/issue</filename> and
+ <filename>/etc/issue.net</filename>, which is displayed at
+ the login prompt, in order to avoid conflicts with
+ Multilib enabled.
+ Regardless, the <filename>DATE</filename> value is
+ inaccurate if the <filename>base-files</filename>
+ recipe is restored from shared state (sstate) rather
+ than rebuilt.</para>
+
+ <para>If you need the build date recorded in
+ <filename>/etc/issue*</filename> or anywhere else in your
+ image, a better method is to define a post-processing
+ function to do it and have the function called from
+ <link linkend='var-ROOTFS_POSTPROCESS_COMMAND'><filename>ROOTFS_POSTPROCESS_COMMAND</filename></link>.
+ Doing so ensures the value is always up-to-date with the
+ created image.
+ </para></listitem>
+ <listitem><para>
+ Dropbear's <filename>init</filename> script now disables
+ DSA host keys by default.
+ This change is in line with the systemd service
+ file, which supports RSA keys only, and with recent
+ versions of OpenSSH, which deprecates DSA host keys.
+ </para></listitem>
+ <listitem><para>
+ The
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class now correctly uses tabs as separators between all
+ columns in <filename>installed-package-sizes.txt</filename>
+ in order to aid import into other tools.
+ </para></listitem>
+ <listitem><para>
+ The <filename>USE_LDCONFIG</filename> variable has been
+ replaced with the "ldconfig"
+ <filename>DISTRO_FEATURES</filename> feature.
+ Distributions that previously set:
+ <literallayout class='monospaced'>
+ USE_LDCONFIG = "0"
+ </literallayout>
+ should now instead use the following:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_BACKFILL_CONSIDERED_append = " ldconfig"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ The default value of
+ <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+ now includes all versions of AGPL licenses in addition
+ to GPL and LGPL.
+ <note>
+ The default list is not intended to be guaranteed
+ as a complete safe list.
+ You should seek legal advice based on what you are
+ distributing if you are unsure.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Kernel module packages are now suffixed with the kernel
+ version in order to allow module packages from multiple
+ kernel versions to co-exist on a target system.
+ If you wish to return to the previous naming scheme
+ that does not include the version suffix, use the
+ following:
+ <literallayout class='monospaced'>
+ KERNEL_MODULE_PACKAGE_SUFFIX to ""
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Removal of <filename>libtool</filename>
+ <filename>*.la</filename> files is now enabled by default.
+ The <filename>*.la</filename> files are not actually
+ needed on Linux and relocating them is an unnecessary
+ burden.</para>
+
+ <para>If you need to preserve these
+ <filename>.la</filename> files (e.g. in a custom
+ distribution), you must change
+ <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
+ such that "remove-libtool" is not included in the value.
+ </para></listitem>
+ <listitem><para>
+ Extensible SDKs built for GCC 5+ now refuse to install on a
+ distribution where the host GCC version is 4.8 or 4.9.
+ This change resulted from the fact that the installation
+ is known to fail due to the way the
+ <filename>uninative</filename> shared state (sstate)
+ package is built.
+ See the
+ <link linkend='ref-classes-uninative'><filename>uninative</filename></link>
+ class for additional information.
+ </para></listitem>
+ <listitem><para>
+ All native and nativesdk recipes now use a separate
+ <filename>DISTRO_FEATURES</filename> value instead of
+ sharing the value used by recipes for the target, in order
+ to avoid unnecessary rebuilds.</para>
+
+ <para>The <filename>DISTRO_FEATURES</filename> for
+ <filename>native</filename> recipes is
+ <link linkend='var-DISTRO_FEATURES_NATIVE'><filename>DISTRO_FEATURES_NATIVE</filename></link>
+ added to an intersection of
+ <filename>DISTRO_FEATURES</filename> and
+ <link linkend='var-DISTRO_FEATURES_FILTER_NATIVE'><filename>DISTRO_FEATURES_FILTER_NATIVE</filename></link>.
+ </para>
+
+ <para>For nativesdk recipes, the
+ corresponding variables are
+ <link linkend='var-DISTRO_FEATURES_NATIVESDK'><filename>DISTRO_FEATURES_NATIVESDK</filename></link>
+ and
+ <link linkend='var-DISTRO_FEATURES_FILTER_NATIVESDK'><filename>DISTRO_FEATURES_FILTER_NATIVESDK</filename></link>.
+ </para></listitem>
+ <listitem><para>
+ The <filename>FILESDIR</filename>
+ variable, which was previously deprecated and rarely used,
+ has now been removed.
+ You should change any recipes that set
+ <filename>FILESDIR</filename> to set
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ instead.
+ </para></listitem>
+ <listitem><para>
+ The <filename>MULTIMACH_HOST_SYS</filename>
+ variable has been removed as it is no longer needed
+ with recipe-specific sysroots.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.4-release'>
+ <title>Moving to the Yocto Project 2.4 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.4 Release from the prior release.
+ </para>
+
+ <section id='migration-2.4-memory-resident-mode'>
+ <title>Memory Resident Mode</title>
+
+ <para>
+ A persistent mode is now available in BitBake's default operation,
+ replacing its previous "memory resident mode" (i.e.
+ <filename>oe-init-build-env-memres</filename>).
+ Now you only need to set
+ <link linkend='var-BB_SERVER_TIMEOUT'><filename>BB_SERVER_TIMEOUT</filename></link>
+ to a timeout (in seconds) and BitBake's server stays resident for
+ that amount of time between invocations.
+ The <filename>oe-init-build-env-memres</filename> script has been
+ removed since a separate environment setup script is no longer
+ needed.
+ </para>
+ </section>
+
+ <section id='migration-2.4-packaging-changes'>
+ <title>Packaging Changes</title>
+
+ <para>
+ This section provides information about packaging changes that have
+ ocurred:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>python3</filename> Changes:</emphasis>
+ <itemizedlist>
+ <listitem><para>
+ The main "python3" package now brings in all of the
+ standard Python 3 distribution rather than a subset.
+ This behavior matches what is expected based on
+ traditional Linux distributions.
+ If you wish to install a subset of Python 3, specify
+ <filename>python-core</filename> plus one or more of
+ the individual packages that are still produced.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python3</filename>:</emphasis>
+ The <filename>bz2.py</filename>,
+ <filename>lzma.py</filename>, and
+ <filename>_compression.py</filename> scripts have
+ been moved from the
+ <filename>python3-misc</filename> package to
+ the <filename>python3-compression</filename> package.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>binutils</filename>:</emphasis>
+ The <filename>libbfd</filename> library is now packaged in
+ a separate "libbfd" package.
+ This packaging saves space when certain tools
+ (e.g. <filename>perf</filename>) are installed.
+ In such cases, the tools only need
+ <filename>libbfd</filename> rather than all the packages in
+ <filename>binutils</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>util-linux</filename> Changes:</emphasis>
+ <itemizedlist>
+ <listitem><para>
+ The <filename>su</filename> program is now packaged
+ in a separate "util-linux-su" package, which is only
+ built when "pam" is listed in the
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ variable.
+ <filename>util-linux</filename> should not be
+ installed unless it is needed because
+ <filename>su</filename> is normally provided through
+ the shadow file format.
+ The main <filename>util-linux</filename> package has
+ runtime dependencies (i.e.
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>)
+ on the <filename>util-linux-su</filename> package
+ when "pam" is in
+ <filename>DISTRO_FEATURES</filename>.
+ </para></listitem>
+ <listitem><para>
+ The <filename>switch_root</filename> program is now
+ packaged in a separate "util-linux-switch-root"
+ package for small initramfs images that do not need
+ the whole <filename>util-linux</filename> package or
+ the busybox binary, which are both much larger than
+ <filename>switch_root</filename>.
+ The main <filename>util-linux</filename> package has
+ a recommended runtime dependency (i.e.
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>)
+ on the <filename>util-linux-switch-root</filename> package.
+ </para></listitem>
+ <listitem><para>
+ The <filename>ionice</filename> program is now
+ packaged in a separate "util-linux-ionice" package.
+ The main <filename>util-linux</filename> package has
+ a recommended runtime dependency (i.e.
+ <filename>RRECOMMENDS</filename>)
+ on the <filename>util-linux-ionice</filename> package.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>initscripts</filename>:</emphasis>
+ The <filename>sushell</filename> program is now packaged in
+ a separate "initscripts-sushell" package.
+ This packaging change allows systems to pull
+ <filename>sushell</filename> in when
+ <filename>selinux</filename> is enabled.
+ The change also eliminates needing to pull in the entire
+ <filename>initscripts</filename> package.
+ The main <filename>initscripts</filename> package has a
+ runtime dependency (i.e. <filename>RDEPENDS</filename>)
+ on the <filename>sushell</filename> package when
+ "selinux" is in <filename>DISTRO_FEATURES</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>glib-2.0</filename>:</emphasis>
+ The <filename>glib-2.0</filename> package now has a
+ recommended runtime dependency (i.e.
+ <filename>RRECOMMENDS</filename>) on the
+ <filename>shared-mime-info</filename> package, since large
+ portions of GIO are not useful without the MIME database.
+ You can remove the dependency by using the
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>
+ variable if <filename>shared-mime-info</filename> is too
+ large and is not required.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Go Standard Runtime:</emphasis>
+ The Go standard runtime has been split out from the main
+ <filename>go</filename> recipe into a separate
+ <filename>go-runtime</filename> recipe.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.4-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>acpitests</filename>:</emphasis>
+ This recipe is not maintained.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>autogen-native</filename>:</emphasis>
+ No longer required by Grub, oe-core, or meta-oe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>bdwgc</filename>:</emphasis>
+ Nothing in OpenEmbedded-Core requires this recipe.
+ It has moved to meta-oe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>byacc</filename>:</emphasis>
+ This recipe was only needed by rpm 5.x and has moved to
+ meta-oe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gcc (5.4)</filename>:</emphasis>
+ The 5.4 series dropped the recipe in favor of 6.3 / 7.2.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gnome-common</filename>:</emphasis>
+ Deprecated upstream and no longer needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>go-bootstrap-native</filename>:</emphasis>
+ Go 1.9 does its own bootstrapping so this recipe has been
+ removed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>guile</filename>:</emphasis>
+ This recipe was only needed by
+ <filename>autogen-native</filename> and
+ <filename>remake</filename>.
+ The recipe is no longer needed by either of these programs.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libclass-isa-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libdumpvalue-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libenv-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libfile-checktree-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libi18n-collate-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libiconv</filename>:</emphasis>
+ This recipe was only needed for <filename>uclibc</filename>,
+ which was removed in the previous release.
+ <filename>glibc</filename> and <filename>musl</filename>
+ have their own implementations.
+ <filename>meta-mingw</filename> still needs
+ <filename>libiconv</filename>, so it has
+ been moved to <filename>meta-mingw</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libpng12</filename>:</emphasis>
+ This recipe was previously needed for LSB. The current
+ <filename>libpng</filename> is 1.6.x.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libpod-plainer-perl</filename>:</emphasis>
+ This recipe was previously needed for LSB 4, no longer
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto (4.1)</filename>:</emphasis>
+ This recipe was removed in favor of 4.4, 4.9, 4.10 and 4.12.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>mailx</filename>:</emphasis>
+ This recipe was previously only needed for LSB
+ compatibility, and upstream is defunct.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>mesa (git version only)</filename>:</emphasis>
+ The git version recipe was stale with respect to the release
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>ofono (git version only)</filename>:</emphasis>
+ The git version recipe was stale with respect to the release
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>portmap</filename>:</emphasis>
+ This recipe is obsolete and is superseded by
+ <filename>rpcbind</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python3-pygpgme</filename>:</emphasis>
+ This recipe is old and unmaintained. It was previously
+ required by <filename>dnf</filename>, which has switched
+ to official <filename>gpgme</filename> Python bindings.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-async</filename>:</emphasis>
+ This recipe has been removed in favor of the Python 3
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-gitdb</filename>:</emphasis>
+ This recipe has been removed in favor of the Python 3
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-git</filename>:</emphasis>
+ This recipe was removed in favor of the Python 3
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-mako</filename>:</emphasis>
+ This recipe was removed in favor of the Python 3
+ version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-pexpect</filename>:</emphasis>
+ This recipe was removed in favor of the Python 3 version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-ptyprocess</filename>:</emphasis>
+ This recipe was removed in favor of Python the 3 version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-pycurl</filename>:</emphasis>
+ Nothing is using this recipe in OpenEmbedded-Core
+ (i.e. <filename>meta-oe</filename>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-six</filename>:</emphasis>
+ This recipe was removed in favor of the Python 3 version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>python-smmap</filename>:</emphasis>
+ This recipe was removed in favor of the Python 3 version.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>remake</filename>:</emphasis>
+ Using <filename>remake</filename> as the provider of
+ <filename>virtual/make</filename> is broken.
+ Consequently, this recipe is not needed in OpenEmbedded-Core.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.4-kernel-device-tree-move'>
+ <title>Kernel Device Tree Move</title>
+
+ <para>
+ Kernel Device Tree support is now easier to enable in a kernel
+ recipe.
+ The Device Tree code has moved to a
+ <link linkend='ref-classes-kernel-devicetree'><filename>kernel-devicetree</filename></link>
+ class.
+ Functionality is automatically enabled for any recipe that inherits
+ the
+ <link linkend='ref-classes-kernel'><filename>kernel</filename></link>
+ class and sets the
+ <link linkend='var-KERNEL_DEVICETREE'><filename>KERNEL_DEVICETREE</filename></link>
+ variable.
+ The previous mechanism for doing this,
+ <filename>meta/recipes-kernel/linux/linux-dtb.inc</filename>,
+ is still available to avoid breakage, but triggers a
+ deprecation warning.
+ Future releases of the Yocto Project will remove
+ <filename>meta/recipes-kernel/linux/linux-dtb.inc</filename>.
+ It is advisable to remove any <filename>require</filename>
+ statements that request
+ <filename>meta/recipes-kernel/linux/linux-dtb.inc</filename>
+ from any custom kernel recipes you might have.
+ This will avoid breakage in post 2.4 releases.
+ </para>
+ </section>
+
+ <section id='migration-2.4-package-qa-changes'>
+ <title>Package QA Changes</title>
+
+ <para>
+ The following package QA changes took place:
+ <itemizedlist>
+ <listitem><para>
+ The "unsafe-references-in-scripts" QA check has been
+ removed.
+ </para></listitem>
+ <listitem><para>
+ If you refer to <filename>${COREBASE}/LICENSE</filename>
+ within
+ <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>
+ you receive a warning because this file is a description of
+ the license for OE-Core.
+ Use <filename>${COMMON_LICENSE_DIR}/MIT</filename>
+ if your recipe is MIT-licensed and you cannot use the
+ preferred method of referring to a file within the source
+ tree.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.4-readme-changes'>
+ <title><filename>README</filename> File Changes</title>
+
+ <para>
+ The following are changes to <filename>README</filename> files:
+ <itemizedlist>
+ <listitem><para>
+ The main Poky <filename>README</filename> file has been
+ moved to the <filename>meta-poky</filename> layer and
+ has been renamed <filename>README.poky</filename>.
+ A symlink has been created so that references to the old
+ location work.
+ </para></listitem>
+ <listitem><para>
+ The <filename>README.hardware</filename> file has been moved
+ to <filename>meta-yocto-bsp</filename>.
+ A symlink has been created so that references to the old
+ location work.
+ </para></listitem>
+ <listitem><para>
+ A <filename>README.qemu</filename> file has been created
+ with coverage of the <filename>qemu*</filename> machines.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.4-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following are additional changes:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>ROOTFS_PKGMANAGE_BOOTSTRAP</filename>
+ variable and any references to it have been removed.
+ You should remove this variable from any custom recipes.
+ </para></listitem>
+ <listitem><para>
+ The <filename>meta-yocto</filename> directory has been
+ removed.
+ <note>
+ In the Yocto Project 2.1 release
+ <filename>meta-yocto</filename> was renamed to
+ <filename>meta-poky</filename> and the
+ <filename>meta-yocto</filename> subdirectory remained
+ to avoid breaking existing configurations.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ The <filename>maintainers.inc</filename> file, which tracks
+ maintainers by listing a primary person responsible for each
+ recipe in OE-Core, has been moved from
+ <filename>meta-poky</filename> to OE-Core (i.e. from
+ <filename>meta-poky/conf/distro/include</filename> to
+ <filename>meta/conf/distro/include</filename>).
+ </para></listitem>
+ <listitem><para>
+ The
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class now makes a single commit per build rather than one
+ commit per subdirectory in the repository.
+ This behavior assumes the commits are enabled with
+ <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link>
+ = "1", which is typical.
+ Previously, the <filename>buildhistory</filename> class made
+ one commit per subdirectory in the repository in order to
+ make it easier to see the changes for a particular
+ subdirectory.
+ To view a particular change, specify that subdirectory as
+ the last parameter on the <filename>git show</filename>
+ or <filename>git diff</filename> commands.
+ </para></listitem>
+ <listitem><para>
+ The <filename>x86-base.inc</filename> file, which is
+ included by all x86-based machine configurations, now sets
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ using <filename>?=</filename> to "live" rather than
+ appending with <filename>+=</filename>.
+ This change makes the default easier to override.
+ </para></listitem>
+ <listitem><para>
+ BitBake fires multiple "BuildStarted" events when
+ multiconfig is enabled (one per configuration).
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#events'>Events</ulink>"
+ section in the BitBake User Manual.
+ </para></listitem>
+ <listitem><para>
+ By default, the <filename>security_flags.inc</filename> file
+ sets a
+ <link linkend='var-GCCPIE'><filename>GCCPIE</filename></link>
+ variable with an option to enable Position Independent
+ Executables (PIE) within <filename>gcc</filename>.
+ Enabling PIE in the GNU C Compiler (GCC), makes Return
+ Oriented Programming (ROP) attacks much more difficult to
+ execute.
+ </para></listitem>
+ <listitem><para>
+ OE-Core now provides a
+ <filename>bitbake-layers</filename> plugin that implements
+ a "create-layer" subcommand.
+ The implementation of this subcommand has resulted in the
+ <filename>yocto-layer</filename> script being deprecated and
+ will likely be removed in the next Yocto Project release.
+ </para></listitem>
+ <listitem><para>
+ The <filename>vmdk</filename>, <filename>vdi</filename>,
+ and <filename>qcow2</filename> image file types are now
+ used in conjunction with the "wic" image type through
+ <filename>CONVERSION_CMD</filename>.
+ Consequently, the equivalent image types are now
+ <filename>wic.vmdk</filename>, <filename>wic.vdi</filename>,
+ and <filename>wic.qcow2</filename>, respectively.
+ </para></listitem>
+ <listitem><para>
+ <filename>do_image_&lt;type&gt;[depends]</filename> has
+ replaced <filename>IMAGE_DEPENDS_&lt;type&gt;</filename>.
+ If you have your own classes that implement custom image
+ types, then you need to update them.
+ </para></listitem>
+ <listitem><para>
+ OpenSSL 1.1 has been introduced.
+ However, the default is still 1.0.x through the
+ <link linkend='var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></link>
+ variable.
+ This preference is set is due to the remaining compatibility
+ issues with other software.
+ The
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ variable in the openssl 1.0 recipe now includes "openssl10"
+ as a marker that can be used in
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ within recipes that build software that still depend on
+ OpenSSL 1.0.
+ </para></listitem>
+ <listitem><para>
+ To ensure consistent behavior, BitBake's "-r" and "-R"
+ options (i.e. prefile and postfile), which are used to
+ read or post-read additional configuration files from the
+ command line, now only affect the current BitBake command.
+ Before these BitBake changes, these options would "stick"
+ for future executions.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+
+<section id='moving-to-the-yocto-project-2.5-release'>
+ <title>Moving to the Yocto Project 2.5 Release</title>
+
+ <para>
+ This section provides migration information for moving to the
+ Yocto Project 2.5 Release from the prior release.
+ </para>
+
+ <section id='migration-2.5-packaging-changes'>
+ <title>Packaging Changes</title>
+
+ <para>
+ This section provides information about packaging changes that have
+ occurred:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>bind-libs</filename>:</emphasis>
+ The libraries packaged by the bind recipe are in a
+ separate <filename>bind-libs</filename> package.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libfm-gtk</filename>:</emphasis>
+ The <filename>libfm</filename> GTK+ bindings are split into
+ a separate <filename>libfm-gtk</filename> package.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>flex-libfl</filename>:</emphasis>
+ The flex recipe splits out libfl into a separate
+ <filename>flex-libfl</filename> package to avoid too many
+ dependencies being pulled in where only the library is
+ needed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>grub-efi</filename>:</emphasis>
+ The <filename>grub-efi</filename> configuration is split
+ into a separate <filename>grub-bootconf</filename>
+ recipe.
+ However, the dependency relationship from
+ <filename>grub-efi</filename> is through a
+ virtual/grub-bootconf provider making it possible to have
+ your own recipe provide the dependency.
+ Alternatively, you can use a BitBake append file to bring
+ the configuration back into the
+ <filename>grub-efi</filename> recipe.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>armv7a Legacy Package Feed Support:</emphasis>
+ Legacy support is removed for transitioning from
+ <filename>armv7a</filename> to
+ <filename>armv7a-vfp-neon</filename> in package feeds,
+ which was previously enabled by setting
+ <filename>PKGARCHCOMPAT_ARMV7A</filename>.
+ This transition occurred in 2011 and active package feeds
+ should by now be updated to the new naming.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.5-removed-recipes'>
+ <title>Removed Recipes</title>
+
+ <para>
+ The following recipes have been removed:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>gcc</filename>:</emphasis>
+ The version 6.4 recipes are replaced by 7.x.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>gst-player</filename>:</emphasis>
+ Renamed to <filename>gst-examples</filename> as per
+ upstream.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>hostap-utils</filename>:</emphasis>
+ This software package is obsolete.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>latencytop</filename>:</emphasis>
+ This recipe is no longer maintained upstream.
+ The last release was in 2009.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>libpfm4</filename>:</emphasis>
+ The only file that requires this recipe is
+ <filename>oprofile</filename>, which has been removed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>linux-yocto</filename>:</emphasis>
+ The version 4.4, 4.9, and 4.10 recipes have been removed.
+ Versions 4.12, 4.14, and 4.15 remain.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>man</filename>:</emphasis>
+ This recipe has been replaced by modern
+ <filename>man-db</filename>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>mkelfimage</filename>:</emphasis>
+ This tool has been removed in the upstream coreboot project,
+ and is no longer needed with the removal of the ELF image
+ type.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>nativesdk-postinst-intercept</filename>:</emphasis>
+ This recipe is not maintained.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>neon</filename>:</emphasis>
+ This software package is no longer maintained upstream and
+ is no longer needed by anything in OpenEmbedded-Core.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>oprofile</filename>:</emphasis>
+ The functionality of this recipe is replaced by
+ <filename>perf</filename> and keeping compatibility on
+ an ongoing basis with <filename>musl</filename> is
+ difficult.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>pax</filename>:</emphasis>
+ This software package is obsolete.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>stat</filename>:</emphasis>
+ This software package is not maintained upstream.
+ <filename>coreutils</filename> provides a modern stat binary.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>zisofs-tools-native</filename>:</emphasis>
+ This recipe is no longer needed because the compressed
+ ISO image feature has been removed.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.5-scripts-and-tools-changes'>
+ <title>Scripts and Tools Changes</title>
+
+ <para>
+ The following are changes to scripts and tools:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>yocto-bsp</filename>,
+ <filename>yocto-kernel</filename>, and
+ <filename>yocto-layer</filename></emphasis>:
+ The <filename>yocto-bsp</filename>,
+ <filename>yocto-kernel</filename>, and
+ <filename>yocto-layer</filename> scripts previously shipped
+ with poky but not in OpenEmbedded-Core have been removed.
+ These scripts are not maintained and are outdated.
+ In many cases, they are also limited in scope.
+ The <filename>bitbake-layers create-layer</filename> command
+ is a direct replacement for <filename>yocto-layer</filename>.
+ See the documentation to create a BSP or kernel recipe in
+ the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-kernel-recipe-example'>BSP Kernel Recipe Example</ulink>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>devtool finish</filename>:</emphasis>
+ <filename>devtool finish</filename> now exits with an error
+ if there are uncommitted changes or a rebase/am in progress
+ in the recipe's source repository.
+ If this error occurs, there might be uncommitted changes
+ that will not be included in updates to the patches applied
+ by the recipe.
+ A -f/--force option is provided for situations that the
+ uncommitted changes are inconsequential and you want to
+ proceed regardless.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>scripts/oe-setup-rpmrepo</filename> script:</emphasis>
+ The functionality of
+ <filename>scripts/oe-setup-rpmrepo</filename> is replaced by
+ <filename>bitbake package-index</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>scripts/test-dependencies.sh</filename> script:</emphasis>
+ The script is largely made obsolete by the
+ recipe-specific sysroots functionality introduced in the
+ previous release.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.5-bitbake-changes'>
+ <title>BitBake Changes</title>
+
+ <para>
+ The following are BitBake changes:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>--runall</filename> option has changed.
+ There are two different behaviors people might want:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Behavior A:</emphasis>
+ For a given target (or set of targets) look through
+ the task graph and run task X only if it is present
+ and will be built.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Behavior B:</emphasis>
+ For a given target (or set of targets) look through
+ the task graph and run task X if any recipe in the
+ taskgraph has such a target, even if it is not in
+ the original task graph.
+ </para></listitem>
+ </itemizedlist>
+ The <filename>--runall</filename> option now performs
+ "Behavior B".
+ Previously <filename>--runall</filename> behaved like
+ "Behavior A".
+ A <filename>--runonly</filename> option has been added to
+ retain the ability to perform "Behavior A".
+ </para></listitem>
+ <listitem><para>
+ Several explicit "run this task for all recipes in the
+ dependency tree" tasks have been removed (e.g.
+ <filename>fetchall</filename>,
+ <filename>checkuriall</filename>, and the
+ <filename>*all</filename> tasks provided by the
+ <filename>distrodata</filename> and
+ <filename>archiver</filename> classes).
+ There is a BitBake option to complete this for any arbitrary
+ task. For example:
+ <literallayout class='monospaced'>
+ bitbake &lt;target&gt; -c fetchall
+ </literallayout>
+ should now be replaced with:
+ <literallayout class='monospaced'>
+ bitbake &lt;target&gt; --runall=fetch
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='migration-2.5-python-and-python3-changes'>
+ <title>Python and Python 3 Changes</title>
+
+ <para>
+ The following are auto-packaging changes to Python and Python 3:
+ </para>
+ <para>
+ The script-managed <filename>python-*-manifest.inc</filename> files
+ that were previously used to generate Python and Python 3
+ packages have been replaced with a JSON-based file that is
+ easier to read and maintain.
+ A new task is available for maintainers of the Python recipes to
+ update the JSON file when upgrading to new Python versions.
+ You can now edit the file directly instead of having to edit a
+ script and run it to update the file.
+ </para>
+ <para>
+ One particular change to note is that the Python recipes no longer
+ have build-time provides for their packages.
+ This assumes <filename>python-foo</filename> is one of the packages
+ provided by the Python recipe.
+ You can no longer run <filename>bitbake python-foo</filename> or
+ have a <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink> on
+ <filename>python-foo</filename>, but doing either of the following
+ causes the package to work as expected:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " python-foo"
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "python-foo"
+ </literallayout>
+ The earlier build-time provides behavior was a quirk of the way the
+ Python manifest file was created.
+ For more information on this change please see
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=8d94b9db221d1def42f091b991903faa2d1651ce'>this commit</ulink>.
+ </para>
+ </section>
+
+ <section id='migration-2.5-miscellaneous-changes'>
+ <title>Miscellaneous Changes</title>
+
+ <para>
+ The following are additional changes:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>kernel</filename> class supports building
+ packages for multiple kernels.
+ If your kernel recipe or <filename>.bbappend</filename> file
+ mentions packaging at all, you should replace references to
+ the kernel in package names with
+ <filename>${KERNEL_PACKAGE_NAME}</filename>.
+ For example, if you disable automatic installation of the
+ kernel image using
+ <filename>RDEPENDS_kernel-base = ""</filename> you can avoid
+ warnings using
+ <filename>RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""</filename>
+ instead.
+ </para></listitem>
+ <listitem><para>
+ The <filename>buildhistory</filename> class commits changes
+ to the repository by default so you no longer need to set
+ <filename>BUILDHISTORY_COMMIT = "1"</filename>.
+ If you want to disable commits you need to set
+ <filename>BUILDHISTORY_COMMIT = "0"</filename> in your
+ configuration.
+ </para></listitem>
+ <listitem><para>
+ The <filename>beaglebone</filename> reference machine has
+ been renamed to <filename>beaglebone-yocto</filename>.
+ The <filename>beaglebone-yocto</filename> BSP is a reference
+ implementation using only mainline components available in
+ OpenEmbedded-Core and <filename>meta-yocto-bsp</filename>,
+ whereas Texas Instruments maintains a full-featured BSP in
+ the <filename>meta-ti</filename> layer.
+ This rename avoids the previous name clash that existed
+ between the two BSPs.
+ </para></listitem>
+ <listitem><para>
+ The <filename>update-alternatives</filename> class no longer
+ works with SysV <filename>init</filename> scripts because
+ this usage has been problematic.
+ Also, the <filename>sysklogd</filename> recipe no longer
+ uses <filename>update-alternatives</filename> because it is
+ incompatible with other implementations.
+ </para></listitem>
+ <listitem><para>
+ By default, the <filename>cmake</filename> class uses
+ <filename>ninja</filename> instead of
+ <filename>make</filename> for building.
+ This improves build performance.
+ If a recipe is broken with <filename>ninja</filename>, then
+ the recipe can set
+ <filename>OECMAKE_GENERATOR = "Unix Makefiles"</filename>
+ to change back to <filename>make</filename>.
+ </para></listitem>
+ <listitem><para>
+ The previously deprecated <filename>base_*</filename>
+ functions have been removed in favor of their replacements
+ in <filename>meta/lib/oe</filename> and
+ <filename>bitbake/lib/bb</filename>.
+ These are typically used from recipes and classes.
+ Any references to the old functions must be updated.
+ The following table shows the removed functions and their
+ replacements:
+
+ <literallayout class='monospaced'>
+ <emphasis>Removed</emphasis> <emphasis>Replacement</emphasis>
+ ============================ ============================
+ base_path_join() oe.path.join()
+ base_path_relative() oe.path.relative()
+ base_path_out() oe.path.format_display()
+ base_read_file() oe.utils.read_file()
+ base_ifelse() oe.utils.ifelse()
+ base_conditional() oe.utils.conditional()
+ base_less_or_equal() oe.utils.less_or_equal()
+ base_version_less_or_equal() oe.utils.version_less_or_equal()
+ base_contains() bb.utils.contains()
+ base_both_contain() oe.utils.both_contain()
+ base_prune_suffix() oe.utils.prune_suffix()
+ oe_filter() oe.utils.str_filter()
+ oe_filter_out() oe.utils.str_filter_out() (or use the _remove operator).
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Using <filename>exit 1</filename> to explicitly defer a
+ postinstall script until first boot is now deprecated since
+ it is not an obvious mechanism and can mask actual errors.
+ If you want to explicitly defer a postinstall to first boot
+ on the target rather than at <filename>rootfs</filename>
+ creation time, use
+ <filename>pkg_postinst_ontarget()</filename>
+ or call
+ <filename>postinst-intercepts defer_to_first_boot</filename>
+ from <filename>pkg_postinst()</filename>.
+ Any failure of a <filename>pkg_postinst()</filename>
+ script (including <filename>exit 1</filename>)
+ will trigger a warning during
+ <filename>do_rootfs</filename>.
+ </para></listitem>
+ <listitem><para>
+ The <filename>elf</filename> image type has been removed.
+ This image type was removed because the
+ <filename>mkelfimage</filename> tool
+ that was required to create it is no longer provided by
+ coreboot upstream and required updating every time
+ <filename>binutils</filename> updated.
+ </para></listitem>
+ <listitem><para>
+ Support for .iso image compression (previously enabled
+ through <filename>COMPRESSISO = "1"</filename>) has been
+ removed.
+ The userspace tools (<filename>zisofs-tools</filename>) are
+ unmaintained and <filename>squashfs</filename> provides
+ better performance and compression.
+ In order to build a live image with squashfs+lz4 compression
+ enabled you should now set
+ <filename>LIVE_ROOTFS_TYPE = "squashfs-lz4"</filename>
+ and ensure that <filename>live</filename>
+ is in <filename>IMAGE_FSTYPES</filename>.
+ </para></listitem>
+ <listitem><para>
+ Recipes with an unconditional dependency on
+ <filename>libpam</filename> are only buildable with
+ <filename>pam</filename> in
+ <filename>DISTRO_FEATURES</filename>.
+ If the dependency is truly optional then it is recommended
+ that the dependency be conditional upon
+ <filename>pam</filename> being in
+ <filename>DISTRO_FEATURES</filename>.
+ </para></listitem>
+ <listitem><para>
+ For EFI-based machines, the bootloader
+ (<filename>grub-efi</filename> by default) is installed into
+ the image at /boot.
+ Wic can be used to split the bootloader into separate boot
+ and rootfs partitions if necessary.
+ </para></listitem>
+ <listitem><para>
+ Patches whose context does not match exactly (i.e. where
+ patch reports "fuzz" when applying) will generate a
+ warning.
+ For an example of this see
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=cc97bc08125b63821ce3f616771830f77c456f57'>this commit</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Layers are expected to set
+ <filename>LAYERSERIES_COMPAT_layername</filename>
+ to match the version(s) of OpenEmbedded-Core they are
+ compatible with.
+ This is specified as codenames using spaces to separate
+ multiple values (e.g. "rocko sumo").
+ If a layer does not set
+ <filename>LAYERSERIES_COMPAT_layername</filename>, a warning
+ will is shown.
+ If a layer sets a value that does not include the current
+ version ("sumo" for the 2.5 release), then an error will be
+ produced.
+ </para></listitem>
+ <listitem><para>
+ The <filename>TZ</filename> environment variable is set to
+ "UTC" within the build environment in order to fix
+ reproducibility problems in some recipes.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-classes.xml b/poky/documentation/ref-manual/ref-classes.xml
new file mode 100644
index 000000000..77f21ede7
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-classes.xml
@@ -0,0 +1,3900 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-classes'>
+<title>Classes</title>
+
+<para>
+ Class files are used to abstract common functionality and share it amongst
+ multiple recipe (<filename>.bb</filename>) files.
+ To use a class file, you simply make sure the recipe inherits the class.
+ In most cases, when a recipe inherits a class it is enough to enable its
+ features.
+ There are cases, however, where in the recipe you might need to set
+ variables or override some default behavior.
+</para>
+
+<para>
+ Any <link linkend='metadata'>Metadata</link> usually
+ found in a recipe can also be placed in a class file.
+ Class files are identified by the extension <filename>.bbclass</filename>
+ and are usually placed in a <filename>classes/</filename> directory beneath
+ the <filename>meta*/</filename> directory found in the
+ <link linkend='source-directory'>Source Directory</link>.
+ Class files can also be pointed to by
+ <link linkend='var-BUILDDIR'><filename>BUILDDIR</filename></link>
+ (e.g. <filename>build/</filename>) in the same way as
+ <filename>.conf</filename> files in the <filename>conf</filename> directory.
+ Class files are searched for in
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ using the same method by which <filename>.conf</filename> files are
+ searched.
+</para>
+
+<para>
+ This chapter discusses only the most useful and important classes.
+ Other classes do exist within the <filename>meta/classes</filename>
+ directory in the Source Directory.
+ You can reference the <filename>.bbclass</filename> files directly
+ for more information.
+</para>
+
+<section id='ref-classes-allarch'>
+ <title><filename>allarch.bbclass</filename></title>
+
+ <para>
+ The <filename>allarch</filename> class is inherited
+ by recipes that do not produce architecture-specific output.
+ The class disables functionality that is normally needed for recipes
+ that produce executable binaries (such as building the cross-compiler
+ and a C library as pre-requisites, and splitting out of debug symbols
+ during packaging).
+ <note>
+ <para>Unlike some distro recipes (e.g. Debian), OpenEmbedded recipes
+ that produce packages that depend on tunings through use of the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ and
+ <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>
+ variables, should never be configured for all architectures
+ using <filename>allarch</filename>.
+ This is the case even if the recipes do not produce
+ architecture-specific output.</para>
+ <para>Configuring such recipes for all architectures causes the
+ <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_*</filename></link>
+ tasks to have different signatures for the machines with different
+ tunings.
+ Additionally, unnecessary rebuilds occur every time an
+ image for a different <filename>MACHINE</filename> is built
+ even when the recipe never changes.</para>
+ </note>
+ </para>
+
+ <para>
+ By default, all recipes inherit the
+ <link linkend='ref-classes-base'><filename>base</filename></link> and
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ classes, which enable functionality
+ needed for recipes that produce executable output.
+ If your recipe, for example, only produces packages that contain
+ configuration files, media files, or scripts (e.g. Python and Perl),
+ then it should inherit the <filename>allarch</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-archiver'>
+ <title><filename>archiver.bbclass</filename></title>
+
+ <para>
+ The <filename>archiver</filename> class supports releasing
+ source code and other materials with the binaries.
+ </para>
+
+ <para>
+ For more details on the source archiver, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ You can also see the
+ <link linkend='var-ARCHIVER_MODE'><filename>ARCHIVER_MODE</filename></link>
+ variable for information about the variable flags (varflags)
+ that help control archive creation.
+ </para>
+</section>
+
+<section id='ref-classes-autotools'>
+ <title><filename>autotools*.bbclass</filename></title>
+
+ <para>
+ The <filename>autotools*</filename> classes support Autotooled
+ packages.
+ </para>
+
+ <para>
+ The <filename>autoconf</filename>, <filename>automake</filename>,
+ and <filename>libtool</filename> packages bring standardization.
+ This class defines a set of tasks (e.g.
+ <filename>configure</filename>, <filename>compile</filename> and
+ so forth) that
+ work for all Autotooled packages.
+ It should usually be enough to define a few standard variables
+ and then simply <filename>inherit autotools</filename>.
+ These classes can also work with software that emulates Autotools.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-autotooled-package'>Autotooled Package</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ By default, the <filename>autotools*</filename> classes
+ use out-of-tree builds (i.e.
+ <filename>autotools.bbclass</filename> building with
+ <filename>B != S</filename>).
+ </para>
+
+ <para>
+ If the software being built by a recipe does not support
+ using out-of-tree builds, you should have the recipe inherit the
+ <filename>autotools-brokensep</filename> class.
+ The <filename>autotools-brokensep</filename> class behaves the same
+ as the <filename>autotools</filename> class but builds with
+ <link linkend='var-B'><filename>B</filename></link> ==
+ <link linkend='var-S'><filename>S</filename></link>.
+ This method is useful when out-of-tree build support is either not
+ present or is broken.
+ <note>
+ It is recommended that out-of-tree support be fixed and used
+ if at all possible.
+ </note>
+ </para>
+
+ <para>
+ It's useful to have some idea of how the tasks defined by
+ the <filename>autotools*</filename> classes work and what they do
+ behind the scenes.
+ <itemizedlist>
+ <listitem><para><link linkend='ref-tasks-configure'><filename>do_configure</filename></link> -
+ Regenerates the
+ configure script (using <filename>autoreconf</filename>) and
+ then launches it with a standard set of arguments used during
+ cross-compilation.
+ You can pass additional parameters to
+ <filename>configure</filename> through the
+ <filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link></filename>
+ or
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>
+ variables.
+ </para></listitem>
+ <listitem><para><link linkend='ref-tasks-compile'><filename>do_compile</filename></link> -
+ Runs <filename>make</filename> with arguments that specify the
+ compiler and linker.
+ You can pass additional arguments through
+ the <filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link></filename>
+ variable.
+ </para></listitem>
+ <listitem><para><link linkend='ref-tasks-install'><filename>do_install</filename></link> -
+ Runs <filename>make install</filename> and passes in
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
+ as <filename>DESTDIR</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-base'>
+ <title><filename>base.bbclass</filename></title>
+
+ <para>
+ The <filename>base</filename> class is special in that every
+ <filename>.bb</filename> file implicitly inherits the class.
+ This class contains definitions for standard basic
+ tasks such as fetching, unpacking, configuring (empty by default),
+ compiling (runs any <filename>Makefile</filename> present), installing
+ (empty by default) and packaging (empty by default).
+ These classes are often overridden or extended by other classes
+ such as the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class or the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class.
+ </para>
+
+ <para>
+ The class also contains some commonly used functions such as
+ <filename>oe_runmake</filename>, which runs
+ <filename>make</filename> with the arguments specified in
+ <link linkend='var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></link>
+ variable as well as the arguments passed directly to
+ <filename>oe_runmake</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-bash-completion'>
+ <title><filename>bash-completion.bbclass</filename></title>
+
+ <para>
+ Sets up packaging and dependencies appropriate for recipes that
+ build software that includes bash-completion data.
+ </para>
+</section>
+
+<section id='ref-classes-bin-package'>
+ <title><filename>bin_package.bbclass</filename></title>
+
+ <para>
+ The <filename>bin_package</filename> class is a
+ helper class for recipes that extract the contents of a binary package
+ (e.g. an RPM) and install those contents rather than building the
+ binary from source.
+ The binary package is extracted and new packages in the configured
+ output package format are created.
+ Extraction and installation of proprietary binaries is a good example
+ use for this class.
+ <note>
+ For RPMs and other packages that do not contain a subdirectory,
+ you should specify an appropriate fetcher parameter to point to
+ the subdirectory.
+ For example, if BitBake is using the Git fetcher
+ (<filename>git://</filename>), the "subpath" parameter limits
+ the checkout to a specific subpath of the tree.
+ Here is an example where <filename>${BP}</filename> is used so that
+ the files are extracted into the subdirectory expected by the
+ default value of
+ <link linkend='var-S'><filename>S</filename></link>:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://example.com/downloads/somepackage.rpm;subpath=${BP}"
+ </literallayout>
+ See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bb-fetchers'>Fetchers</ulink>"
+ section in the BitBake User Manual for more information on
+ supported BitBake Fetchers.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-binconfig'>
+ <title><filename>binconfig.bbclass</filename></title>
+
+ <para>
+ The <filename>binconfig</filename> class helps to correct paths in
+ shell scripts.
+ </para>
+
+ <para>
+ Before <filename>pkg-config</filename> had become widespread, libraries
+ shipped shell scripts to give information about the libraries and
+ include paths needed to build software (usually named
+ <filename>LIBNAME-config</filename>).
+ This class assists any recipe using such scripts.
+ </para>
+
+ <para>
+ During staging, the OpenEmbedded build system installs such scripts
+ into the <filename>sysroots/</filename> directory.
+ Inheriting this class results in all paths in these scripts being
+ changed to point into the <filename>sysroots/</filename> directory so
+ that all builds that use the script use the correct directories
+ for the cross compiling layout.
+ See the
+ <link linkend='var-BINCONFIG_GLOB'><filename>BINCONFIG_GLOB</filename></link>
+ variable for more information.
+ </para>
+</section>
+
+<section id='ref-classes-binconfig-disabled'>
+ <title><filename>binconfig-disabled.bbclass</filename></title>
+
+ <para>
+ An alternative version of the
+ <link linkend='ref-classes-binconfig'><filename>binconfig</filename></link>
+ class, which disables binary configuration scripts by making them
+ return an error in favor of using <filename>pkg-config</filename>
+ to query the information.
+ The scripts to be disabled should be specified using the
+ <link linkend='var-BINCONFIG'><filename>BINCONFIG</filename></link>
+ variable within the recipe inheriting the class.
+ </para>
+</section>
+
+<section id='ref-classes-blacklist'>
+ <title><filename>blacklist.bbclass</filename></title>
+
+ <para>
+ The <filename>blacklist</filename> class prevents
+ the OpenEmbedded build system from building specific recipes
+ (blacklists them).
+ To use this class, inherit the class globally and set
+ <link linkend='var-PNBLACKLIST'><filename>PNBLACKLIST</filename></link>
+ for each recipe you wish to blacklist.
+ Specify the <link linkend='var-PN'><filename>PN</filename></link>
+ value as a variable flag (varflag) and provide a reason, which is
+ reported, if the package is requested to be built as the value.
+ For example, if you want to blacklist a recipe called "exoticware",
+ you add the following to your <filename>local.conf</filename>
+ or distribution configuration:
+ <literallayout class='monospaced'>
+ INHERIT += "blacklist"
+ PNBLACKLIST[exoticware] = "Not supported by our organization."
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-bluetooth'>
+ <title><filename>bluetooth.bbclass</filename></title>
+
+ <para>
+ The <filename>bluetooth</filename> class defines a variable that
+ expands to the recipe (package) providing core
+ bluetooth support on the platform.
+ </para>
+
+ <para>
+ For details on how the class works, see the
+ <filename>meta/classes/bluetooth.bbclass</filename> file in the Yocto
+ Project
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+</section>
+
+<section id='ref-classes-bugzilla'>
+ <title><filename>bugzilla.bbclass</filename></title>
+
+ <para>
+ The <filename>bugzilla</filename> class supports setting up an
+ instance of Bugzilla in which you can automatically files bug reports
+ in response to build failures.
+ For this class to work, you need to enable the XML-RPC interface in
+ the instance of Bugzilla.
+ </para>
+</section>
+
+<section id='ref-classes-buildhistory'>
+ <title><filename>buildhistory.bbclass</filename></title>
+
+ <para>
+ The <filename>buildhistory</filename> class records a
+ history of build output metadata, which can be used to detect possible
+ regressions as well as used for analysis of the build output.
+ For more information on using Build History, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-buildstats'>
+ <title><filename>buildstats.bbclass</filename></title>
+
+ <para>
+ The <filename>buildstats</filename> class records
+ performance statistics about each task executed during the build
+ (e.g. elapsed time, CPU usage, and I/O usage).
+ </para>
+
+ <para>
+ When you use this class, the output goes into the
+ <link linkend='var-BUILDSTATS_BASE'><filename>BUILDSTATS_BASE</filename></link>
+ directory, which defaults to <filename>${TMPDIR}/buildstats/</filename>.
+ You can analyze the elapsed time using
+ <filename>scripts/pybootchartgui/pybootchartgui.py</filename>, which
+ produces a cascading chart of the entire build process and can be
+ useful for highlighting bottlenecks.
+ </para>
+
+ <para>
+ Collecting build statistics is enabled by default through the
+ <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
+ variable from your <filename>local.conf</filename> file.
+ Consequently, you do not have to do anything to enable the class.
+ However, if you want to disable the class, simply remove "buildstats"
+ from the <filename>USER_CLASSES</filename> list.
+ </para>
+</section>
+
+<section id='ref-classes-buildstats-summary'>
+ <title><filename>buildstats-summary.bbclass</filename></title>
+
+ <para>
+ When inherited globally, prints statistics at the end of the build
+ on sstate re-use.
+ In order to function, this class requires the
+ <link linkend='ref-classes-buildstats'><filename>buildstats</filename></link>
+ class be enabled.
+ </para>
+</section>
+
+<section id='ref-classes-ccache'>
+ <title><filename>ccache.bbclass</filename></title>
+
+ <para>
+ The <filename>ccache</filename> class enables the C/C++ Compiler Cache
+ for the build.
+ This class is used to give a minor performance boost during the build.
+ However, using the class can lead to unexpected side-effects.
+ Thus, it is recommended that you do not use this class.
+ See <ulink url='http://ccache.samba.org/'></ulink> for information on
+ the C/C++ Compiler Cache.
+ </para>
+</section>
+
+<section id='ref-classes-chrpath'>
+ <title><filename>chrpath.bbclass</filename></title>
+
+ <para>
+ The <filename>chrpath</filename> class
+ is a wrapper around the "chrpath" utility, which is used during the
+ build process for <filename>nativesdk</filename>,
+ <filename>cross</filename>, and
+ <filename>cross-canadian</filename> recipes to change
+ <filename>RPATH</filename> records within binaries in order to make
+ them relocatable.
+ </para>
+</section>
+
+<section id='ref-classes-clutter'>
+ <title><filename>clutter.bbclass</filename></title>
+
+ <para>
+ The <filename>clutter</filename> class consolidates the
+ major and minor version naming and other common items used by Clutter
+ and related recipes.
+ <note>
+ Unlike some other classes related to specific libraries, recipes
+ building other software that uses Clutter do not need to
+ inherit this class unless they use the same recipe versioning
+ scheme that the Clutter and related recipes do.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-cmake'>
+ <title><filename>cmake.bbclass</filename></title>
+
+ <para>
+ The <filename>cmake</filename> class allows for
+ recipes that need to build software using the CMake build system.
+ You can use the
+ <link linkend='var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></link>
+ variable to specify additional configuration options to be passed on
+ the <filename>cmake</filename> command line.
+ </para>
+</section>
+
+<section id='ref-classes-cml1'>
+ <title><filename>cml1.bbclass</filename></title>
+
+ <para>
+ The <filename>cml1</filename> class provides basic support for the
+ Linux kernel style build configuration system.
+ </para>
+</section>
+
+<section id='ref-classes-compress_doc'>
+ <title><filename>compress_doc.bbclass</filename></title>
+
+ <para>
+ Enables compression for man pages and info pages.
+ This class is intended to be inherited globally.
+ The default compression mechanism is gz (gzip) but you can
+ select an alternative mechanism by setting the
+ <link linkend='var-DOC_COMPRESS'><filename>DOC_COMPRESS</filename></link>
+ variable.
+ </para>
+</section>
+
+<section id='ref-classes-copyleft_compliance'>
+ <title><filename>copyleft_compliance.bbclass</filename></title>
+
+ <para>
+ The <filename>copyleft_compliance</filename> class
+ preserves source code for the purposes of license compliance.
+ This class is an alternative to the <filename>archiver</filename>
+ class and is still used by some users even though it has been
+ deprecated in favor of the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-copyleft_filter'>
+ <title><filename>copyleft_filter.bbclass</filename></title>
+
+ <para>
+ A class used by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ and
+ <link linkend='ref-classes-copyleft_compliance'><filename>copyleft_compliance</filename></link>
+ classes for filtering licenses.
+ The <filename>copyleft_filter</filename> class is an internal class
+ and is not intended to be used directly.
+ </para>
+</section>
+
+<section id='ref-classes-core-image'>
+ <title><filename>core-image.bbclass</filename></title>
+
+ <para>
+ The <filename>core-image</filename> class
+ provides common definitions for the
+ <filename>core-image-*</filename> image recipes, such as support for
+ additional
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
+ </para>
+</section>
+
+<section id='ref-classes-cpan'>
+ <title><filename>cpan*.bbclass</filename></title>
+
+ <para>
+ The <filename>cpan*</filename> classes support Perl modules.
+ </para>
+
+ <para>
+ Recipes for Perl modules are simple.
+ These recipes usually only need to point to the source's archive and
+ then inherit the proper class file.
+ Building is split into two methods depending on which method the module
+ authors used.
+ <itemizedlist>
+ <listitem><para>Modules that use old
+ <filename>Makefile.PL</filename>-based build system require
+ <filename>cpan.bbclass</filename> in their recipes.
+ </para></listitem>
+ <listitem><para>Modules that use
+ <filename>Build.PL</filename>-based build system require
+ using <filename>cpan_build.bbclass</filename> in their recipes.
+ </para></listitem>
+ </itemizedlist>
+ Both build methods inherit the <filename>cpan-base</filename> class
+ for basic Perl support.
+ </para>
+</section>
+
+<section id='ref-classes-cross'>
+ <title><filename>cross.bbclass</filename></title>
+
+ <para>
+ The <filename>cross</filename> class provides support for the recipes
+ that build the cross-compilation tools.
+ </para>
+</section>
+
+<section id='ref-classes-cross-canadian'>
+ <title><filename>cross-canadian.bbclass</filename></title>
+
+ <para>
+ The <filename>cross-canadian</filename> class
+ provides support for the recipes that build the Canadian
+ Cross-compilation tools for SDKs.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for more
+ discussion on these cross-compilation tools.
+ </para>
+</section>
+
+<section id='ref-classes-crosssdk'>
+ <title><filename>crosssdk.bbclass</filename></title>
+
+ <para>
+ The <filename>crosssdk</filename> class
+ provides support for the recipes that build the cross-compilation
+ tools used for building SDKs.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for more
+ discussion on these cross-compilation tools.
+ </para>
+</section>
+
+<section id='ref-classes-debian'>
+ <title><filename>debian.bbclass</filename></title>
+
+ <para>
+ The <filename>debian</filename> class renames output packages so that
+ they follow the Debian naming policy (i.e. <filename>glibc</filename>
+ becomes <filename>libc6</filename> and <filename>glibc-devel</filename>
+ becomes <filename>libc6-dev</filename>.)
+ Renaming includes the library name and version as part of the package
+ name.
+ </para>
+
+ <para>
+ If a recipe creates packages for multiple libraries
+ (shared object files of <filename>.so</filename> type), use the
+ <link linkend='var-LEAD_SONAME'><filename>LEAD_SONAME</filename></link>
+ variable in the recipe to specify the library on which to apply the
+ naming scheme.
+ </para>
+</section>
+
+<section id='ref-classes-deploy'>
+ <title><filename>deploy.bbclass</filename></title>
+
+ <para>
+ The <filename>deploy</filename> class handles deploying files
+ to the
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
+ directory.
+ The main function of this class is to allow the deploy step to be
+ accelerated by shared state.
+ Recipes that inherit this class should define their own
+ <link linkend='ref-tasks-deploy'><filename>do_deploy</filename></link>
+ function to copy the files to be deployed to
+ <link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>,
+ and use <filename>addtask</filename> to add the task at the appropriate
+ place, which is usually after
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ or
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>.
+ The class then takes care of staging the files from
+ <filename>DEPLOYDIR</filename> to
+ <filename>DEPLOY_DIR_IMAGE</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-devshell'>
+ <title><filename>devshell.bbclass</filename></title>
+
+ <para>
+ The <filename>devshell</filename> class adds the
+ <filename>do_devshell</filename> task.
+ Distribution policy dictates whether to include this class.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" section
+ in the Yocto Project Development Tasks Manual for more information about
+ using <filename>devshell</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-distro_features_check'>
+ <title><filename>distro_features_check.bbclass</filename></title>
+
+ <para>
+ The <filename>distro_features_check</filename> class
+ allows individual recipes to check for required and conflicting
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ </para>
+
+ <para>
+ This class provides support for the
+ <link linkend='var-REQUIRED_DISTRO_FEATURES'><filename>REQUIRED_DISTRO_FEATURES</filename></link>
+ and
+ <link linkend='var-CONFLICT_DISTRO_FEATURES'><filename>CONFLICT_DISTRO_FEATURES</filename></link>
+ variables.
+ If any conditions specified in the recipe using the above variables are
+ not met, the recipe will be skipped.
+ </para>
+</section>
+
+<section id='ref-classes-distrodata'>
+ <title><filename>distrodata.bbclass</filename></title>
+
+ <para>
+ The <filename>distrodata</filename> class
+ provides for automatic checking for upstream recipe updates.
+ The class creates a comma-separated value (CSV) spreadsheet that
+ contains information about the recipes.
+ The information provides the
+ <link linkend='ref-tasks-distrodata'><filename>do_distrodata</filename></link>
+ and
+ <filename>do_distro_check</filename> tasks, which do upstream checking
+ and also verify if a package is used in multiple major distributions.
+ </para>
+
+ <para>
+ The class is not included by default.
+ To use it, you must set the
+ <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
+ variable:
+ <literallayout class='monospaced'>
+ INHERIT+= "distrodata"
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>distrodata</filename> class also provides the
+ <link linkend='ref-tasks-checkpkg'><filename>do_checkpkg</filename></link>
+ task, which can be used against a simple recipe or against an
+ image to get all its recipe information.
+ </para>
+</section>
+
+<section id='ref-classes-distutils'>
+ <title><filename>distutils*.bbclass</filename></title>
+
+ <para>
+ The <filename>distutils*</filename> classes support recipes for Python
+ version 2.x extensions, which are simple.
+ These recipes usually only need to point to the source's archive and
+ then inherit the proper class.
+ Building is split into two methods depending on which method the
+ module authors used.
+ <itemizedlist>
+ <listitem><para>Extensions that use an Autotools-based build system
+ require Autotools and the classes based on
+ <filename>distutils</filename> in their recipes.
+ </para></listitem>
+ <listitem><para>Extensions that use build systems based on
+ <filename>distutils</filename> require
+ the <filename>distutils</filename> class in their recipes.
+ </para></listitem>
+ <listitem><para>Extensions that use build systems based on
+ <filename>setuptools</filename> require the
+ <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link>
+ class in their recipes.
+ </para></listitem>
+ </itemizedlist>
+ The <filename>distutils-common-base</filename> class is required by
+ some of the <filename>distutils*</filename> classes to provide common
+ Python2 support.
+ </para>
+
+ <para>
+ The <filename>distutils-tools</filename> class supports recipes for
+ additional "distutils" tools.
+ </para>
+</section>
+
+<section id='ref-classes-distutils3'>
+ <title><filename>distutils3*.bbclass</filename></title>
+
+ <para>
+ The <filename>distutils3*</filename> classes support recipes for Python
+ version 3.x extensions, which are simple.
+ These recipes usually only need to point to the source's archive and
+ then inherit the proper class.
+ Building is split into three methods depending on which method the
+ module authors used.
+ <itemizedlist>
+ <listitem><para>Extensions that use an Autotools-based build system
+ require Autotools and
+ <filename>distutils</filename>-based classes in their recipes.
+ </para></listitem>
+ <listitem><para>Extensions that use
+ <filename>distutils</filename>-based build systems require
+ the <filename>distutils</filename> class in their recipes.
+ </para></listitem>
+ <listitem><para>Extensions that use build systems based on
+ <filename>setuptools3</filename> require the
+ <link linkend='ref-classes-setuptools'><filename>setuptools3</filename></link>
+ class in their recipes.
+ </para></listitem>
+ </itemizedlist>
+ The <filename>distutils3*</filename> classes either inherit their
+ corresponding <filename>distutils*</filename> class or replicate them
+ using a Python3 version instead (e.g.
+ <filename>distutils3-base</filename> inherits
+ <filename>distutils-common-base</filename>, which is the same as
+ <filename>distutils-base</filename> but inherits
+ <filename>python3native</filename> instead of
+ <filename>pythonnative</filename>).
+ </para>
+</section>
+
+<section id='ref-classes-externalsrc'>
+ <title><filename>externalsrc.bbclass</filename></title>
+
+ <para>
+ The <filename>externalsrc</filename> class supports building software
+ from source code that is external to the OpenEmbedded build system.
+ Building software from an external source tree means that the build
+ system's normal fetch, unpack, and patch process is not used.
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system uses the
+ <link linkend='var-S'><filename>S</filename></link> and
+ <link linkend='var-B'><filename>B</filename></link> variables to
+ locate unpacked recipe source code and to build it, respectively.
+ When your recipe inherits the <filename>externalsrc</filename> class,
+ you use the
+ <link linkend='var-EXTERNALSRC'><filename>EXTERNALSRC</filename></link>
+ and
+ <link linkend='var-EXTERNALSRC_BUILD'><filename>EXTERNALSRC_BUILD</filename></link>
+ variables to ultimately define <filename>S</filename> and
+ <filename>B</filename>.
+ </para>
+
+ <para>
+ By default, this class expects the source code to support recipe builds
+ that use the <link linkend='var-B'><filename>B</filename></link>
+ variable to point to the directory in which the OpenEmbedded build
+ system places the generated objects built from the recipes.
+ By default, the <filename>B</filename> directory is set to the
+ following, which is separate from the source directory
+ (<filename>S</filename>):
+ <literallayout class='monospaced'>
+ ${WORKDIR}/${BPN}/{PV}/
+ </literallayout>
+ See these variables for more information:
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
+ <link linkend='var-BPN'><filename>BPN</filename></link>, and
+ <link linkend='var-PV'><filename>PV</filename></link>,
+ </para>
+
+ <para>
+ For more information on the
+ <filename>externalsrc</filename> class, see the comments in
+ <filename>meta/classes/externalsrc.bbclass</filename> in the
+ <link linkend='source-directory'>Source Directory</link>.
+ For information on how to use the <filename>externalsrc</filename>
+ class, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-extrausers'>
+ <title><filename>extrausers.bbclass</filename></title>
+
+ <para>
+ The <filename>extrausers</filename> class allows
+ additional user and group configuration to be applied at the image
+ level.
+ Inheriting this class either globally or from an image recipe allows
+ additional user and group operations to be performed using the
+ <link linkend='var-EXTRA_USERS_PARAMS'><filename>EXTRA_USERS_PARAMS</filename></link>
+ variable.
+ <note>
+ The user and group operations added using the
+ <filename>extrausers</filename> class are not tied to a specific
+ recipe outside of the recipe for the image.
+ Thus, the operations can be performed across the image as a whole.
+ Use the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class to add user and group configuration to a specific recipe.
+ </note>
+ Here is an example that uses this class in an image recipe:
+ <literallayout class='monospaced'>
+ inherit extrausers
+ EXTRA_USERS_PARAMS = "\
+ useradd -p '' tester; \
+ groupadd developers; \
+ userdel nobody; \
+ groupdel -g video; \
+ groupmod -g 1020 developers; \
+ usermod -s /bin/sh tester; \
+ "
+ </literallayout>
+ Here is an example that adds two users named "tester-jim" and
+ "tester-sue" and assigns passwords:
+ <literallayout class='monospaced'>
+ inherit extrausers
+ EXTRA_USERS_PARAMS = "\
+ useradd -P tester01 tester-jim; \
+ useradd -P tester01 tester-sue; \
+ "
+ </literallayout>
+ Finally, here is an example that sets the root password to
+ "1876*18":
+ <literallayout class='monospaced'>
+ inherit extrausers
+ EXTRA_USERS_PARAMS = "\
+ usermod -P 1876*18 root; \
+ "
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-fontcache'>
+ <title><filename>fontcache.bbclass</filename></title>
+
+ <para>
+ The <filename>fontcache</filename> class generates the
+ proper post-install and post-remove (postinst and postrm)
+ scriptlets for font packages.
+ These scriptlets call <filename>fc-cache</filename> (part of
+ <filename>Fontconfig</filename>) to add the fonts to the font
+ information cache.
+ Since the cache files are architecture-specific,
+ <filename>fc-cache</filename> runs using QEMU if the postinst
+ scriptlets need to be run on the build host during image creation.
+ </para>
+
+ <para>
+ If the fonts being installed are in packages other than the main
+ package, set
+ <link linkend='var-FONT_PACKAGES'><filename>FONT_PACKAGES</filename></link>
+ to specify the packages containing the fonts.
+ </para>
+</section>
+
+<section id='ref-classes-fs-uuid'>
+ <title><filename>fs-uuid.bbclass</filename></title>
+
+ <para>
+ The <filename>fs-uuid</filename> class extracts UUID from
+ <filename>${</filename><link linkend='var-ROOTFS'><filename>ROOTFS</filename></link><filename>}</filename>,
+ which must have been built by the time that this function gets called.
+ The <filename>fs-uuid</filename> class only works on
+ <filename>ext</filename> file systems and depends on
+ <filename>tune2fs</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-gconf'>
+ <title><filename>gconf.bbclass</filename></title>
+
+ <para>
+ The <filename>gconf</filename> class provides common
+ functionality for recipes that need to install GConf schemas.
+ The schemas will be put into a separate package
+ (<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-gconf</filename>)
+ that is created automatically when this class is inherited.
+ This package uses the appropriate post-install and post-remove
+ (postinst/postrm) scriptlets to register and unregister the schemas
+ in the target image.
+ </para>
+</section>
+
+<section id='ref-classes-gettext'>
+ <title><filename>gettext.bbclass</filename></title>
+
+ <para>
+ The <filename>gettext</filename> class provides support for
+ building software that uses the GNU <filename>gettext</filename>
+ internationalization and localization system.
+ All recipes building software that use
+ <filename>gettext</filename> should inherit this class.
+ </para>
+</section>
+
+<section id='ref-classes-gnome'>
+ <title><filename>gnome.bbclass</filename></title>
+
+ <para>
+ The <filename>gnome</filename> class supports recipes that
+ build software from the GNOME stack.
+ This class inherits the
+ <link linkend='ref-classes-gnomebase'><filename>gnomebase</filename></link>,
+ <link linkend='ref-classes-gtk-icon-cache'><filename>gtk-icon-cache</filename></link>,
+ <link linkend='ref-classes-gconf'><filename>gconf</filename></link> and
+ <link linkend='ref-classes-mime'><filename>mime</filename></link> classes.
+ The class also disables GObject introspection where applicable.
+ </para>
+</section>
+
+<section id='ref-classes-gnomebase'>
+ <title><filename>gnomebase.bbclass</filename></title>
+
+ <para>
+ The <filename>gnomebase</filename> class is the base
+ class for recipes that build software from the GNOME stack.
+ This class sets
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link> to
+ download the source from the GNOME mirrors as well as extending
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ with the typical GNOME installation paths.
+ </para>
+</section>
+
+<section id='ref-classes-gobject-introspection'>
+ <title><filename>gobject-introspection.bbclass</filename></title>
+
+ <para>
+ Provides support for recipes building software that
+ supports GObject introspection.
+ This functionality is only enabled if the
+ "gobject-introspection-data" feature is in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ as well as "qemu-usermode" being in
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>.
+ <note>
+ This functionality is backfilled by default and,
+ if not applicable, should be disabled through
+ <link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link>
+ or
+ <link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></link>,
+ respectively.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-grub-efi'>
+ <title><filename>grub-efi.bbclass</filename></title>
+
+ <para>
+ The <filename>grub-efi</filename>
+ class provides <filename>grub-efi</filename>-specific functions for
+ building bootable images.
+ </para>
+
+ <para>
+ This class supports several variables:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-INITRD'><filename>INITRD</filename></link>:
+ Indicates list of filesystem images to concatenate and use
+ as an initial RAM disk (initrd) (optional).
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>:
+ Indicates a filesystem image to include as the root filesystem
+ (optional).</para></listitem>
+ <listitem><para>
+ <link linkend='var-GRUB_GFXSERIAL'><filename>GRUB_GFXSERIAL</filename></link>:
+ Set this to "1" to have graphics and serial in the boot menu.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-LABELS'><filename>LABELS</filename></link>:
+ A list of targets for the automatic configuration.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-APPEND'><filename>APPEND</filename></link>:
+ An override list of append strings for each
+ <filename>LABEL</filename>.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-GRUB_OPTS'><filename>GRUB_OPTS</filename></link>:
+ Additional options to add to the configuration (optional).
+ Options are delimited using semi-colon characters
+ (<filename>;</filename>).</para></listitem>
+ <listitem><para>
+ <link linkend='var-GRUB_TIMEOUT'><filename>GRUB_TIMEOUT</filename></link>:
+ Timeout before executing the default <filename>LABEL</filename>
+ (optional).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-gsettings'>
+ <title><filename>gsettings.bbclass</filename></title>
+
+ <para>
+ The <filename>gsettings</filename> class
+ provides common functionality for recipes that need to install
+ GSettings (glib) schemas.
+ The schemas are assumed to be part of the main package.
+ Appropriate post-install and post-remove (postinst/postrm)
+ scriptlets are added to register and unregister the schemas in the
+ target image.
+ </para>
+</section>
+
+<section id='ref-classes-gtk-doc'>
+ <title><filename>gtk-doc.bbclass</filename></title>
+
+ <para>
+ The <filename>gtk-doc</filename> class
+ is a helper class to pull in the appropriate
+ <filename>gtk-doc</filename> dependencies and disable
+ <filename>gtk-doc</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-gtk-icon-cache'>
+ <title><filename>gtk-icon-cache.bbclass</filename></title>
+
+ <para>
+ The <filename>gtk-icon-cache</filename> class
+ generates the proper post-install and post-remove (postinst/postrm)
+ scriptlets for packages that use GTK+ and install icons.
+ These scriptlets call <filename>gtk-update-icon-cache</filename> to add
+ the fonts to GTK+'s icon cache.
+ Since the cache files are architecture-specific,
+ <filename>gtk-update-icon-cache</filename> is run using QEMU if the
+ postinst scriptlets need to be run on the build host during image
+ creation.
+ </para>
+</section>
+
+<section id='ref-classes-gtk-immodules-cache'>
+ <title><filename>gtk-immodules-cache.bbclass</filename></title>
+
+ <para>
+ The <filename>gtk-immodules-cache</filename> class
+ generates the proper post-install and post-remove (postinst/postrm)
+ scriptlets for packages that install GTK+ input method modules for
+ virtual keyboards.
+ These scriptlets call <filename>gtk-update-icon-cache</filename> to add
+ the input method modules to the cache.
+ Since the cache files are architecture-specific,
+ <filename>gtk-update-icon-cache</filename> is run using QEMU if the
+ postinst scriptlets need to be run on the build host during image
+ creation.
+ </para>
+
+ <para>
+ If the input method modules being installed are in packages other than
+ the main package, set
+ <link linkend='var-GTKIMMODULES_PACKAGES'><filename>GTKIMMODULES_PACKAGES</filename></link>
+ to specify the packages containing the modules.
+ </para>
+</section>
+
+<section id='ref-classes-gzipnative'>
+ <title><filename>gzipnative.bbclass</filename></title>
+
+ <para>
+ The <filename>gzipnative</filename> class enables the use of
+ different native versions of <filename>gzip</filename>
+ and <filename>pigz</filename> rather than the versions of these tools
+ from the build host.
+ </para>
+</section>
+
+<section id='ref-classes-icecc'>
+ <title><filename>icecc.bbclass</filename></title>
+
+ <para>
+ The <filename>icecc</filename> class supports
+ <ulink url='https://github.com/icecc/icecream'>Icecream</ulink>, which
+ facilitates taking compile jobs and distributing them among remote
+ machines.
+ </para>
+
+ <para>
+ The class stages directories with symlinks from <filename>gcc</filename>
+ and <filename>g++</filename> to <filename>icecc</filename>, for both
+ native and cross compilers.
+ Depending on each configure or compile, the OpenEmbedded build system
+ adds the directories at the head of the <filename>PATH</filename> list
+ and then sets the <filename>ICECC_CXX</filename> and
+ <filename>ICEC_CC</filename> variables, which are the paths to the
+ <filename>g++</filename> and <filename>gcc</filename> compilers,
+ respectively.
+ </para>
+
+ <para>
+ For the cross compiler, the class creates a <filename>tar.gz</filename>
+ file that contains the Yocto Project toolchain and sets
+ <filename>ICECC_VERSION</filename>, which is the version of the
+ cross-compiler used in the cross-development toolchain, accordingly.
+ </para>
+
+ <para>
+ The class handles all three different compile stages
+ (i.e native ,cross-kernel and target) and creates the necessary
+ environment <filename>tar.gz</filename> file to be used by the remote
+ machines.
+ The class also supports SDK generation.
+ </para>
+
+ <para>
+ If <link linkend='var-ICECC_PATH'><filename>ICECC_PATH</filename></link>
+ is not set in your <filename>local.conf</filename> file, then the
+ class tries to locate the <filename>icecc</filename> binary
+ using <filename>which</filename>.
+
+ If
+ <link linkend='var-ICECC_ENV_EXEC'><filename>ICECC_ENV_EXEC</filename></link>
+ is set in your <filename>local.conf</filename> file, the variable should
+ point to the <filename>icecc-create-env</filename> script
+ provided by the user.
+ If you do not point to a user-provided script, the build system
+ uses the default script provided by the recipe
+ <filename>icecc-create-env-native.bb</filename>.
+ <note>
+ This script is a modified version and not the one that comes with
+ <filename>icecc</filename>.
+ </note>
+ </para>
+
+ <para>
+ If you do not want the Icecream distributed compile support to apply
+ to specific recipes or classes, you can effectively "blacklist" them
+ by listing the recipes and classes using the
+ <link linkend='var-ICECC_USER_PACKAGE_BL'><filename>ICECC_USER_PACKAGE_BL</filename></link>
+ and
+ <link linkend='var-ICECC_USER_CLASS_BL'><filename>ICECC_USER_CLASS_BL</filename></link>,
+ variables, respectively, in your <filename>local.conf</filename> file.
+ Doing so causes the OpenEmbedded build system to handle these
+ compilations locally.
+ </para>
+
+ <para>
+ Additionally, you can list recipes using the
+ <link linkend='var-ICECC_USER_PACKAGE_WL'><filename>ICECC_USER_PACKAGE_WL</filename></link>
+ variable in your <filename>local.conf</filename> file to force
+ <filename>icecc</filename> to be enabled for recipes using an empty
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>
+ variable.
+ </para>
+
+ <para>
+ Inheriting the <filename>icecc</filename> class changes all sstate
+ signatures.
+ Consequently, if a development team has a dedicated build system
+ that populates
+ <link linkend='var-SSTATE_MIRRORS'><filename>STATE_MIRRORS</filename></link>
+ and they want to reuse sstate from
+ <filename>STATE_MIRRORS</filename>, then all developers and the
+ build system need to either inherit the <filename>icecc</filename>
+ class or nobody should.
+ </para>
+
+ <para>
+ At the distribution level, you can inherit the
+ <filename>icecc</filename> class to be sure that all builders start
+ with the same sstate signatures.
+ After inheriting the class, you can then disable the feature by setting
+ the
+ <link linkend='var-ICECC_DISABLED'><filename>ICECC_DISABLED</filename></link>
+ variable to "1" as follows:
+ <literallayout class='monospaced'>
+ INHERIT_DISTRO_append = " icecc"
+ ICECC_DISABLED ??= "1"
+ </literallayout>
+ This practice makes sure everyone is using the same signatures but also
+ requires individuals that do want to use Icecream to enable the feature
+ individually as follows in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ ICECC_DISABLED = ""
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-image'>
+ <title><filename>image.bbclass</filename></title>
+
+ <para>
+ The <filename>image</filename> class helps support creating images
+ in different formats.
+ First, the root filesystem is created from packages using
+ one of the <filename>rootfs*.bbclass</filename>
+ files (depending on the package format used) and then one or more image
+ files are created.
+ <itemizedlist>
+ <listitem><para>The
+ <filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link></filename>
+ variable controls the types of images to generate.
+ </para></listitem>
+ <listitem><para>The
+ <filename><link linkend='var-IMAGE_INSTALL'>IMAGE_INSTALL</link></filename>
+ variable controls the list of packages to install into the
+ image.</para></listitem>
+ </itemizedlist>
+ For information on customizing images, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage'>Customizing Images</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For information on how images are created, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>"
+ section in the Yocto Project Overview and Concpets Manual.
+ </para>
+</section>
+
+<section id='ref-classes-image-buildinfo'>
+ <title><filename>image-buildinfo.bbclass</filename></title>
+
+ <para>
+ The <filename>image-buildinfo</filename> class writes information
+ to the target filesystem on <filename>/etc/build</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-image_types'>
+ <title><filename>image_types.bbclass</filename></title>
+
+ <para>
+ The <filename>image_types</filename> class defines all of
+ the standard image output types that you can enable through the
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable.
+ You can use this class as a reference on how to add support for custom
+ image output types.
+ </para>
+
+ <para>
+ By default, this class is enabled through the
+ <link linkend='var-IMAGE_CLASSES'><filename>IMAGE_CLASSES</filename></link>
+ variable in
+ <link linkend='ref-classes-image'><filename>image.bbclass</filename></link>.
+ If you define your own image types using a custom BitBake class and
+ then use <filename>IMAGE_CLASSES</filename> to enable it, the custom
+ class must either inherit <filename>image_types</filename> or
+ <filename>image_types</filename> must also appear in
+ <filename>IMAGE_CLASSES</filename>.
+ </para>
+
+ <para>
+ This class also handles conversion and compression of images.
+ <note>
+ To build a VMware VMDK image, you need to add "wic.vmdk" to
+ <filename>IMAGE_FSTYPES</filename>.
+ This would also be similar for Virtual Box Virtual Disk Image
+ ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-image-live'>
+ <title><filename>image-live.bbclass</filename></title>
+
+ <para>
+ This class controls building "live" (i.e. HDDIMG and ISO) images.
+ Live images contain syslinux for legacy booting, as well as the
+ bootloader specified by
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ if
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>
+ contains "efi".
+ </para>
+
+ <para>
+ Normally, you do not use this class directly.
+ Instead, you add "live" to
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>.
+ You can selectively build just one of these types through the
+ <link linkend='var-NOISO'><filename>NOISO</filename></link>
+ and
+ <link linkend='var-NOHDD'><filename>NOHDD</filename></link> variables.
+ For example, if you were building an ISO image, you would add "live"
+ to <filename>IMAGE_FSTYPES</filename>, set the
+ <filename>NOISO</filename> variable to "0" and the build system would
+ use the <filename>image-live</filename> class to build the ISO image.
+ </para>
+</section>
+
+<section id='ref-classes-image-mklibs'>
+ <title><filename>image-mklibs.bbclass</filename></title>
+
+ <para>
+ The <filename>image-mklibs</filename> class
+ enables the use of the <filename>mklibs</filename> utility during the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task, which optimizes the size of
+ libraries contained in the image.
+ </para>
+
+ <para>
+ By default, the class is enabled in the
+ <filename>local.conf.template</filename> using the
+ <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
+ variable as follows:
+ <literallayout class='monospaced'>
+ USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-image-prelink'>
+ <title><filename>image-prelink.bbclass</filename></title>
+
+ <para>
+ The <filename>image-prelink</filename> class
+ enables the use of the <filename>prelink</filename> utility during
+ the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task, which optimizes the dynamic
+ linking of shared libraries to reduce executable startup time.
+ </para>
+
+ <para>
+ By default, the class is enabled in the
+ <filename>local.conf.template</filename> using the
+ <link linkend='var-USER_CLASSES'><filename>USER_CLASSES</filename></link>
+ variable as follows:
+ <literallayout class='monospaced'>
+ USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-insane'>
+ <title><filename>insane.bbclass</filename></title>
+
+ <para>
+ The <filename>insane</filename> class adds a step to the package
+ generation process so that output quality assurance checks are
+ generated by the OpenEmbedded build system.
+ A range of checks are performed that check the build's output
+ for common problems that show up during runtime.
+ Distribution policy usually dictates whether to include this class.
+ </para>
+
+ <para>
+ You can configure the sanity checks so that specific test failures
+ either raise a warning or an error message.
+ Typically, failures for new tests generate a warning.
+ Subsequent failures for the same test would then generate an error
+ message once the metadata is in a known and good condition.
+ See the
+ "<link linkend='ref-qa-checks'>QA Error and Warning Messages</link>"
+ Chapter for a list of all the warning and error messages
+ you might encounter using a default configuration.
+ </para>
+
+ <para>
+ Use the
+ <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and
+ <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
+ variables to control the behavior of
+ these checks at the global level (i.e. in your custom distro
+ configuration).
+ However, to skip one or more checks in recipes, you should use
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>.
+ For example, to skip the check for symbolic link
+ <filename>.so</filename> files in the main package of a recipe,
+ add the following to the recipe.
+ You need to realize that the package name override, in this example
+ <filename>${PN}</filename>, must be used:
+ <literallayout class='monospaced'>
+ INSANE_SKIP_${PN} += "dev-so"
+ </literallayout>
+ Please keep in mind that the QA checks exist in order to detect real
+ or potential problems in the packaged output.
+ So exercise caution when disabling these checks.
+ </para>
+
+ <para>
+ The following list shows the tests you can list with the
+ <filename>WARN_QA</filename> and <filename>ERROR_QA</filename>
+ variables:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>already-stripped:</filename></emphasis>
+ Checks that produced binaries have not already been
+ stripped prior to the build system extracting debug symbols.
+ It is common for upstream software projects to default to
+ stripping debug symbols for output binaries.
+ In order for debugging to work on the target using
+ <filename>-dbg</filename> packages, this stripping must be
+ disabled.
+ </para></listitem>
+ <listitem><para><emphasis><filename>arch:</filename></emphasis>
+ Checks the Executable and Linkable Format (ELF) type, bit size,
+ and endianness of any binaries to ensure they match the target
+ architecture.
+ This test fails if any binaries do not match the type since
+ there would be an incompatibility.
+ The test could indicate that the
+ wrong compiler or compiler options have been used.
+ Sometimes software, like bootloaders, might need to bypass
+ this check.
+ </para></listitem>
+ <listitem><para><emphasis><filename>buildpaths:</filename></emphasis>
+ Checks for paths to locations on the build host inside the
+ output files.
+ Currently, this test triggers too many false positives and
+ thus is not normally enabled.
+ </para></listitem>
+ <listitem><para><emphasis><filename>build-deps:</filename></emphasis>
+ Determines if a build-time dependency that is specified through
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>,
+ explicit
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ or task-level dependencies exists to match any runtime
+ dependency.
+ This determination is particularly useful to discover where
+ runtime dependencies are detected and added during packaging.
+ If no explicit dependency has been specified within the
+ metadata, at the packaging stage it is too late to ensure that
+ the dependency is built, and thus you can end up with an
+ error when the package is installed into the image during the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task because the auto-detected dependency was not satisfied.
+ An example of this would be where the
+ <link linkend='ref-classes-update-rc.d'><filename>update-rc.d</filename></link>
+ class automatically adds a dependency on the
+ <filename>initscripts-functions</filename> package to packages
+ that install an initscript that refers to
+ <filename>/etc/init.d/functions</filename>.
+ The recipe should really have an explicit
+ <filename>RDEPENDS</filename> for the package in question on
+ <filename>initscripts-functions</filename> so that the
+ OpenEmbedded build system is able to ensure that the
+ <filename>initscripts</filename> recipe is actually built and
+ thus the <filename>initscripts-functions</filename> package is
+ made available.
+ </para></listitem>
+ <listitem><para><emphasis><filename>compile-host-path:</filename></emphasis>
+ Checks the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ log for indications
+ that paths to locations on the build host were used.
+ Using such paths might result in host contamination of the
+ build output.
+ </para></listitem>
+ <listitem><para><emphasis><filename>debug-deps:</filename></emphasis>
+ Checks that all packages except <filename>-dbg</filename>
+ packages do not depend on <filename>-dbg</filename>
+ packages, which would cause a packaging bug.
+ </para></listitem>
+ <listitem><para><emphasis><filename>debug-files:</filename></emphasis>
+ Checks for <filename>.debug</filename> directories in anything but the
+ <filename>-dbg</filename> package.
+ The debug files should all be in the <filename>-dbg</filename> package.
+ Thus, anything packaged elsewhere is incorrect packaging.</para></listitem>
+ <listitem><para><emphasis><filename>dep-cmp:</filename></emphasis>
+ Checks for invalid version comparison statements in runtime
+ dependency relationships between packages (i.e. in
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
+ <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
+ and
+ <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>
+ variable values).
+ Any invalid comparisons might trigger failures or undesirable
+ behavior when passed to the package manager.
+ </para></listitem>
+ <listitem><para><emphasis><filename>desktop:</filename></emphasis>
+ Runs the <filename>desktop-file-validate</filename> program
+ against any <filename>.desktop</filename> files to validate
+ their contents against the specification for
+ <filename>.desktop</filename> files.</para></listitem>
+ <listitem><para><emphasis><filename>dev-deps:</filename></emphasis>
+ Checks that all packages except <filename>-dev</filename>
+ or <filename>-staticdev</filename> packages do not depend on
+ <filename>-dev</filename> packages, which would be a
+ packaging bug.</para></listitem>
+ <listitem><para><emphasis><filename>dev-so:</filename></emphasis>
+ Checks that the <filename>.so</filename> symbolic links are in the
+ <filename>-dev</filename> package and not in any of the other packages.
+ In general, these symlinks are only useful for development purposes.
+ Thus, the <filename>-dev</filename> package is the correct location for
+ them.
+ Some very rare cases do exist for dynamically loaded modules where
+ these symlinks are needed instead in the main package.
+ </para></listitem>
+ <listitem><para><emphasis><filename>file-rdeps:</filename></emphasis>
+ Checks that file-level dependencies identified by the
+ OpenEmbedded build system at packaging time are satisfied.
+ For example, a shell script might start with the line
+ <filename>#!/bin/bash</filename>.
+ This line would translate to a file dependency on
+ <filename>/bin/bash</filename>.
+ Of the three package managers that the OpenEmbedded build
+ system supports, only RPM directly handles file-level
+ dependencies, resolving them automatically to packages
+ providing the files.
+ However, the lack of that functionality in the other two
+ package managers does not mean the dependencies do not still
+ need resolving.
+ This QA check attempts to ensure that explicitly declared
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ exist to handle any file-level dependency detected in
+ packaged files.
+ </para></listitem>
+ <listitem><para><emphasis><filename>files-invalid:</filename></emphasis>
+ Checks for
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable values that contain "//", which is invalid.
+ </para></listitem>
+ <listitem><para id='insane-host-user-contaminated'>
+ <emphasis><filename>host-user-contaminated:</filename></emphasis>
+ Checks that no package produced by the recipe contains any
+ files outside of <filename>/home</filename> with a user or
+ group ID that matches the user running BitBake.
+ A match usually indicates that the files are being installed
+ with an incorrect UID/GID, since target IDs are independent
+ from host IDs.
+ For additional information, see the section describing the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task.
+ </para></listitem>
+ <listitem><para><emphasis><filename>incompatible-license:</filename></emphasis>
+ Report when packages are excluded from being created due to
+ being marked with a license that is in
+ <link linkend='var-INCOMPATIBLE_LICENSE'><filename>INCOMPATIBLE_LICENSE</filename></link>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>install-host-path:</filename></emphasis>
+ Checks the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ log for indications
+ that paths to locations on the build host were used.
+ Using such paths might result in host contamination of the
+ build output.
+ </para></listitem>
+ <listitem><para><emphasis><filename>installed-vs-shipped:</filename></emphasis>
+ Reports when files have been installed within
+ <filename>do_install</filename> but have not been included in
+ any package by way of the
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable.
+ Files that do not appear in any package cannot be present in
+ an image later on in the build process.
+ Ideally, all installed files should be packaged or not
+ installed at all.
+ These files can be deleted at the end of
+ <filename>do_install</filename> if the files are not
+ needed in any package.
+ </para></listitem>
+ <listitem><para><emphasis><filename>invalid-chars:</filename></emphasis>
+ Checks that the recipe metadata variables
+ <link linkend='var-DESCRIPTION'><filename>DESCRIPTION</filename></link>,
+ <link linkend='var-SUMMARY'><filename>SUMMARY</filename></link>,
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>,
+ and
+ <link linkend='var-SECTION'><filename>SECTION</filename></link>
+ do not contain non-UTF-8 characters.
+ Some package managers do not support such characters.
+ </para></listitem>
+ <listitem><para><emphasis><filename>invalid-packageconfig:</filename></emphasis>
+ Checks that no undefined features are being added to
+ <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>.
+ For example, any name "foo" for which the following form
+ does not exist:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG[foo] = "..."
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis><filename>la:</filename></emphasis>
+ Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
+ paths.
+ Any <filename>.la</filename> file containing these paths is incorrect since
+ <filename>libtool</filename> adds the correct sysroot prefix when using the
+ files automatically itself.</para></listitem>
+ <listitem><para><emphasis><filename>ldflags:</filename></emphasis>
+ Ensures that the binaries were linked with the
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ options provided by the build system.
+ If this test fails, check that the <filename>LDFLAGS</filename> variable
+ is being passed to the linker command.</para></listitem>
+ <listitem><para><emphasis><filename>libdir:</filename></emphasis>
+ Checks for libraries being installed into incorrect
+ (possibly hardcoded) installation paths.
+ For example, this test will catch recipes that install
+ <filename>/lib/bar.so</filename> when
+ <filename>${base_libdir}</filename> is "lib32".
+ Another example is when recipes install
+ <filename>/usr/lib64/foo.so</filename> when
+ <filename>${libdir}</filename> is "/usr/lib".
+ </para></listitem>
+ <listitem><para><emphasis><filename>libexec:</filename></emphasis>
+ Checks if a package contains files in
+ <filename>/usr/libexec</filename>.
+ This check is not performed if the
+ <filename>libexecdir</filename> variable has been set
+ explicitly to <filename>/usr/libexec</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>packages-list:</filename></emphasis>
+ Checks for the same package being listed multiple times through
+ the <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ variable value.
+ Installing the package in this manner can cause errors during
+ packaging.
+ </para></listitem>
+ <listitem><para><emphasis><filename>perm-config:</filename></emphasis>
+ Reports lines in <filename>fs-perms.txt</filename> that have
+ an invalid format.
+ </para></listitem>
+ <listitem><para><emphasis><filename>perm-line:</filename></emphasis>
+ Reports lines in <filename>fs-perms.txt</filename> that have
+ an invalid format.
+ </para></listitem>
+ <listitem><para><emphasis><filename>perm-link:</filename></emphasis>
+ Reports lines in <filename>fs-perms.txt</filename> that
+ specify 'link' where the specified target already exists.
+ </para></listitem>
+ <listitem><para><emphasis><filename>perms:</filename></emphasis>
+ Currently, this check is unused but reserved.
+ </para></listitem>
+ <listitem><para><emphasis><filename>pkgconfig:</filename></emphasis>
+ Checks <filename>.pc</filename> files for any
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>/<link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ paths.
+ Any <filename>.pc</filename> file containing these paths is incorrect
+ since <filename>pkg-config</filename> itself adds the correct sysroot prefix
+ when the files are accessed.</para></listitem>
+ <listitem><para><emphasis><filename>pkgname:</filename></emphasis>
+ Checks that all packages in
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ have names that do not contain invalid characters (i.e.
+ characters other than 0-9, a-z, ., +, and -).
+ </para></listitem>
+ <listitem><para><emphasis><filename>pkgv-undefined:</filename></emphasis>
+ Checks to see if the <filename>PKGV</filename> variable
+ is undefined during
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>pkgvarcheck:</filename></emphasis>
+ Checks through the variables
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
+ <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
+ <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
+ <link linkend='var-FILES'><filename>FILES</filename></link>,
+ <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>,
+ <filename>pkg_preinst</filename>,
+ <filename>pkg_postinst</filename>,
+ <filename>pkg_prerm</filename>
+ and <filename>pkg_postrm</filename>, and reports if there are
+ variable sets that are not package-specific.
+ Using these variables without a package suffix is bad practice,
+ and might unnecessarily complicate dependencies of other packages
+ within the same recipe or have other unintended consequences.
+ </para></listitem>
+ <listitem><para><emphasis><filename>pn-overrides:</filename></emphasis>
+ Checks that a recipe does not have a name
+ (<link linkend='var-PN'><filename>PN</filename></link>) value
+ that appears in
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
+ If a recipe is named such that its <filename>PN</filename>
+ value matches something already in
+ <filename>OVERRIDES</filename> (e.g. <filename>PN</filename>
+ happens to be the same as
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ or
+ <link linkend='var-DISTRO'><filename>DISTRO</filename></link>),
+ it can have unexpected consequences.
+ For example, assignments such as
+ <filename>FILES_${PN} = "xyz"</filename> effectively turn into
+ <filename>FILES = "xyz"</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>rpaths:</filename></emphasis>
+ Checks for rpaths in the binaries that contain build system paths such
+ as <filename>TMPDIR</filename>.
+ If this test fails, bad <filename>-rpath</filename> options are being
+ passed to the linker commands and your binaries have potential security
+ issues.</para></listitem>
+ <listitem><para><emphasis><filename>split-strip:</filename></emphasis>
+ Reports that splitting or stripping debug symbols from binaries
+ has failed.
+ </para></listitem>
+ <listitem><para><emphasis><filename>staticdev:</filename></emphasis>
+ Checks for static library files (<filename>*.a</filename>) in
+ non-<filename>staticdev</filename> packages.
+ </para></listitem>
+ <listitem><para><emphasis><filename>symlink-to-sysroot:</filename></emphasis>
+ Checks for symlinks in packages that point into
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ on the host.
+ Such symlinks will work on the host, but are clearly invalid
+ when running on the target.
+ </para></listitem>
+ <listitem><para><emphasis><filename>textrel:</filename></emphasis>
+ Checks for ELF binaries that contain relocations in their
+ <filename>.text</filename> sections, which can result in a
+ performance impact at runtime.
+ See the explanation for the
+ <link linkend='qa-issue-textrel'><filename>ELF binary</filename></link>
+ message for more information regarding runtime performance issues.
+ </para></listitem>
+<!--
+This check was removed for YP 2.3 release
+
+ <listitem><para><emphasis><filename>unsafe-references-in-binaries:</filename></emphasis>
+ Reports when a binary installed in
+ <filename>${base_libdir}</filename>,
+ <filename>${base_bindir}</filename>, or
+ <filename>${base_sbindir}</filename>, depends on another
+ binary installed under <filename>${exec_prefix}</filename>.
+ This dependency is a concern if you want the system to remain
+ basically operable if <filename>/usr</filename> is mounted
+ separately and is not mounted.
+ <note>
+ Defaults for binaries installed in
+ <filename>${base_libdir}</filename>,
+ <filename>${base_bindir}</filename>, and
+ <filename>${base_sbindir}</filename> are
+ <filename>/lib</filename>, <filename>/bin</filename>, and
+ <filename>/sbin</filename>, respectively.
+ The default for a binary installed
+ under <filename>${exec_prefix}</filename> is
+ <filename>/usr</filename>.
+ </note>
+ </para></listitem>
+-->
+ <listitem><para><emphasis><filename>useless-rpaths:</filename></emphasis>
+ Checks for dynamic library load paths (rpaths) in the binaries that
+ by default on a standard system are searched by the linker (e.g.
+ <filename>/lib</filename> and <filename>/usr/lib</filename>).
+ While these paths will not cause any breakage, they do waste space and
+ are unnecessary.</para></listitem>
+ <listitem><para><emphasis><filename>var-undefined:</filename></emphasis>
+ Reports when variables fundamental to packaging (i.e.
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>,
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>,
+ <link linkend='var-D'><filename>D</filename></link>,
+ <link linkend='var-PN'><filename>PN</filename></link>, and
+ <link linkend='var-PKGD'><filename>PKGD</filename></link>) are
+ undefined during
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>version-going-backwards:</filename></emphasis>
+ If Build History is enabled, reports when a package
+ being written out has a lower version than the previously
+ written package under the same name.
+ If you are placing output packages into a feed and
+ upgrading packages on a target system using that feed, the
+ version of a package going backwards can result in the target
+ system not correctly upgrading to the "new" version of the
+ package.
+ <note>
+ If you are not using runtime package management on your
+ target system, then you do not need to worry about
+ this situation.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis><filename>xorg-driver-abi:</filename></emphasis>
+ Checks that all packages containing Xorg drivers have ABI
+ dependencies.
+ The <filename>xserver-xorg</filename> recipe provides driver
+ ABI names.
+ All drivers should depend on the ABI versions that they have
+ been built against.
+ Driver recipes that include
+ <filename>xorg-driver-input.inc</filename>
+ or <filename>xorg-driver-video.inc</filename> will
+ automatically get these versions.
+ Consequently, you should only need to explicitly add
+ dependencies to binary driver recipes.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-insserv'>
+ <title><filename>insserv.bbclass</filename></title>
+
+ <para>
+ The <filename>insserv</filename> class
+ uses the <filename>insserv</filename> utility to update the order of
+ symbolic links in <filename>/etc/rc?.d/</filename> within an image
+ based on dependencies specified by LSB headers in the
+ <filename>init.d</filename> scripts themselves.
+ </para>
+</section>
+
+<section id='ref-classes-kernel'>
+ <title><filename>kernel.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel</filename> class handles building Linux kernels.
+ The class contains code to build all kernel trees.
+ All needed headers are staged into the
+ <filename><link linkend='var-STAGING_KERNEL_DIR'>STAGING_KERNEL_DIR</link></filename>
+ directory to allow out-of-tree module builds using
+ the
+ <link linkend='ref-classes-module'><filename>module</filename></link>
+ class.
+ </para>
+
+ <para>
+ This means that each built kernel module is packaged separately and
+ inter-module dependencies are created by parsing the
+ <filename>modinfo</filename> output.
+ If all modules are required, then installing the
+ <filename>kernel-modules</filename> package installs all packages with
+ modules and various other kernel packages such as
+ <filename>kernel-vmlinux</filename>.
+ </para>
+
+ <para>
+ The <filename>kernel</filename> class contains logic that allows
+ you to embed an initial RAM filesystem (initramfs) image when
+ you build the kernel image.
+ For information on how to build an initramfs, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ Various other classes are used by the <filename>kernel</filename>
+ and <filename>module</filename> classes internally including the
+ <link linkend='ref-classes-kernel-arch'><filename>kernel-arch</filename></link>,
+ <link linkend='ref-classes-module-base'><filename>module-base</filename></link>,
+ and
+ <link linkend='ref-classes-linux-kernel-base'><filename>linux-kernel-base</filename></link>
+ classes.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-arch'>
+ <title><filename>kernel-arch.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-arch</filename> class
+ sets the <filename>ARCH</filename> environment variable for Linux
+ kernel compilation (including modules).
+ </para>
+</section>
+
+<section id='ref-classes-kernel-devicetree'>
+ <title><filename>kernel-devicetree.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-devicetree</filename> class, which is inherited by
+ the
+ <link linkend='ref-classes-kernel'><filename>kernel</filename></link>
+ class, supports device tree generation.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-fitimage'>
+ <title><filename>kernel-fitimage.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-fitimage</filename> class provides support to
+ pack zImages.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-grub'>
+ <title><filename>kernel-grub.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-grub</filename> class updates the boot area and
+ the boot menu with the kernel as the priority boot mechanism while
+ installing a RPM to update the kernel on a deployed target.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-module-split'>
+ <title><filename>kernel-module-split.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-module-split</filename> class
+ provides common functionality for splitting Linux kernel modules into
+ separate packages.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-uboot'>
+ <title><filename>kernel-uboot.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-uboot</filename> class provides support for
+ building from vmlinux-style kernel sources.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-uimage'>
+ <title><filename>kernel-uimage.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-uimage</filename> class provides support to
+ pack uImage.
+ </para>
+</section>
+
+<section id='ref-classes-kernel-yocto'>
+ <title><filename>kernel-yocto.bbclass</filename></title>
+
+ <para>
+ The <filename>kernel-yocto</filename> class
+ provides common functionality for building from linux-yocto style
+ kernel source repositories.
+ </para>
+</section>
+
+<section id='ref-classes-kernelsrc'>
+ <title><filename>kernelsrc.bbclass</filename></title>
+
+ <para>
+ The <filename>kernelsrc</filename> class sets the Linux kernel
+ source and version.
+ </para>
+</section>
+
+<section id='ref-classes-lib_package'>
+ <title><filename>lib_package.bbclass</filename></title>
+
+ <para>
+ The <filename>lib_package</filename> class
+ supports recipes that build libraries and produce executable
+ binaries, where those binaries should not be installed by default
+ along with the library.
+ Instead, the binaries are added to a separate
+ <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-bin</filename>
+ package to make their installation optional.
+ </para>
+</section>
+
+<section id='ref-classes-libc*'>
+ <title><filename>libc*.bbclass</filename></title>
+
+ <para>
+ The <filename>libc*</filename> classes support recipes that build
+ packages with <filename>libc</filename>:
+ <itemizedlist>
+ <listitem><para>The <filename>libc-common</filename> class
+ provides common support for building with
+ <filename>libc</filename>.
+ </para></listitem>
+ <listitem><para>The <filename>libc-package</filename> class
+ supports packaging up <filename>glibc</filename> and
+ <filename>eglibc</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-license'>
+ <title><filename>license.bbclass</filename></title>
+
+ <para>
+ The <filename>license</filename> class provides license
+ manifest creation and license exclusion.
+ This class is enabled by default using the default value for the
+ <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
+ variable.
+ </para>
+</section>
+
+<section id='ref-classes-linux-kernel-base'>
+ <title><filename>linux-kernel-base.bbclass</filename></title>
+
+ <para>
+ The <filename>linux-kernel-base</filename> class
+ provides common functionality for recipes that build out of the Linux
+ kernel source tree.
+ These builds goes beyond the kernel itself.
+ For example, the Perf recipe also inherits this class.
+ </para>
+</section>
+
+<section id='ref-classes-linuxloader'>
+ <title><filename>linuxloader.bbclass</filename></title>
+
+ <para>
+ Provides the function <filename>linuxloader()</filename>, which gives
+ the value of the dynamic loader/linker provided on the platform.
+ This value is used by a number of other classes.
+ </para>
+</section>
+
+<section id='ref-classes-logging'>
+ <title><filename>logging.bbclass</filename></title>
+
+ <para>
+ The <filename>logging</filename> class provides the standard
+ shell functions used to log messages for various BitBake severity levels
+ (i.e. <filename>bbplain</filename>, <filename>bbnote</filename>,
+ <filename>bbwarn</filename>, <filename>bberror</filename>,
+ <filename>bbfatal</filename>, and <filename>bbdebug</filename>).
+ </para>
+
+ <para>
+ This class is enabled by default since it is inherited by
+ the <filename>base</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-meta'>
+ <title><filename>meta.bbclass</filename></title>
+
+ <para>
+ The <filename>meta</filename> class is inherited by recipes
+ that do not build any output packages themselves, but act as a "meta"
+ target for building other recipes.
+ </para>
+</section>
+
+<section id='ref-classes-metadata_scm'>
+ <title><filename>metadata_scm.bbclass</filename></title>
+
+ <para>
+ The <filename>metadata_scm</filename> class provides functionality for
+ querying the branch and revision of a Source Code Manager (SCM)
+ repository.
+ </para>
+
+ <para>
+ The <link linkend='ref-classes-base'><filename>base</filename></link>
+ class uses this class to print the revisions of each layer before
+ starting every build.
+ The <filename>metadata_scm</filename> class is enabled by default
+ because it is inherited by the <filename>base</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-migrate_localcount'>
+ <title><filename>migrate_localcount.bbclass</filename></title>
+
+ <para>
+ The <filename>migrate_localcount</filename> class verifies a recipe's
+ localcount data and increments it appropriately.
+ </para>
+</section>
+
+<section id='ref-classes-mime'>
+ <title><filename>mime.bbclass</filename></title>
+
+ <para>
+ The <filename>mime</filename> class generates the proper
+ post-install and post-remove (postinst/postrm) scriptlets for packages
+ that install MIME type files.
+ These scriptlets call <filename>update-mime-database</filename> to add
+ the MIME types to the shared database.
+ </para>
+</section>
+
+<section id='ref-classes-mirrors'>
+ <title><filename>mirrors.bbclass</filename></title>
+
+ <para>
+ The <filename>mirrors</filename> class sets up some standard
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link> entries
+ for source code mirrors.
+ These mirrors provide a fall-back path in case the upstream source
+ specified in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ within recipes is unavailable.
+ </para>
+
+ <para>
+ This class is enabled by default since it is inherited by the
+ <link linkend='ref-classes-base'><filename>base</filename></link> class.
+ </para>
+</section>
+
+<section id='ref-classes-module'>
+ <title><filename>module.bbclass</filename></title>
+
+ <para>
+ The <filename>module</filename> class provides support for building
+ out-of-tree Linux kernel modules.
+ The class inherits the
+ <link linkend='ref-classes-module-base'><filename>module-base</filename></link>
+ and
+ <link linkend='ref-classes-kernel-module-split'><filename>kernel-module-split</filename></link>
+ classes, and implements the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ and
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ tasks.
+ The class provides everything needed to build and package a kernel
+ module.
+ </para>
+
+ <para>
+ For general information on out-of-tree Linux kernel modules, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+</section>
+
+<section id='ref-classes-module-base'>
+ <title><filename>module-base.bbclass</filename></title>
+
+ <para>
+ The <filename>module-base</filename> class provides the base
+ functionality for building Linux kernel modules.
+ Typically, a recipe that builds software that includes one or
+ more kernel modules and has its own means of building
+ the module inherits this class as opposed to inheriting the
+ <link linkend='ref-classes-module'><filename>module</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-multilib*'>
+ <title><filename>multilib*.bbclass</filename></title>
+
+ <para>
+ The <filename>multilib*</filename> classes provide support
+ for building libraries with different target optimizations or target
+ architectures and installing them side-by-side in the same image.
+ </para>
+
+ <para>
+ For more information on using the Multilib feature, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Combining Multiple Versions of Library Files into One Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-native'>
+ <title><filename>native.bbclass</filename></title>
+
+ <para>
+ The <filename>native</filename> class provides common
+ functionality for recipes that wish to build tools to run on the build
+ host (i.e. tools that use the compiler or other tools from the
+ build host).
+ </para>
+
+ <para>
+ You can create a recipe that builds tools that run natively on the
+ host a couple different ways:
+ <itemizedlist>
+ <listitem><para>Create a <replaceable>myrecipe</replaceable><filename>-native.bb</filename>
+ that inherits the <filename>native</filename> class.
+ If you use this method, you must order the inherit statement
+ in the recipe after all other inherit statements so that the
+ <filename>native</filename> class is inherited last.
+ </para></listitem>
+ <listitem><para>Create or modify a target recipe that contains
+ the following:
+ <literallayout class='monospaced'>
+ <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "native"
+ </literallayout>
+ Inside the recipe, use <filename>_class-native</filename> and
+ <filename>_class-target</filename> overrides to specify any
+ functionality specific to the respective native or target
+ case.</para></listitem>
+ </itemizedlist>
+ <note><title>Warning</title>
+ When creating a recipe, you must follow this naming convention:
+ <literallayout class='monospaced'>
+ native-<replaceable>myrecipe</replaceable>.bb
+ </literallayout>
+ Not doing so can lead to subtle problems because code exists
+ that depends on the naming convention.
+ </note>
+ </para>
+
+ <para>
+ Although applied differently, the <filename>native</filename> class is
+ used with both methods.
+ The advantage of the second method is that you do not need to have two
+ separate recipes (assuming you need both) for native and target.
+ All common parts of the recipe are automatically shared.
+ </para>
+</section>
+
+<section id='ref-classes-nativesdk'>
+ <title><filename>nativesdk.bbclass</filename></title>
+
+ <para>
+ The <filename>nativesdk</filename> class provides common
+ functionality for recipes that wish to build tools to run as part of
+ an SDK (i.e. tools that run on
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>).
+ </para>
+
+ <para>
+ You can create a recipe that builds tools that run on the SDK machine
+ a couple different ways:
+ <itemizedlist>
+ <listitem><para>Create a
+ <filename>nativesdk-</filename><replaceable>myrecipe</replaceable><filename>.bb</filename>
+ recipe that inherits the <filename>nativesdk</filename> class.
+ If you use this method, you must order the inherit statement
+ in the recipe after all other inherit statements so that the
+ <filename>nativesdk</filename> class is inherited last.
+ </para></listitem>
+ <listitem><para>Create a <filename>nativesdk</filename> variant
+ of any recipe by adding the following:
+ <literallayout class='monospaced'>
+ <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link> = "nativesdk"
+ </literallayout>
+ Inside the recipe, use <filename>_class-nativesdk</filename> and
+ <filename>_class-target</filename> overrides to specify any
+ functionality specific to the respective SDK machine or target
+ case.</para></listitem>
+ </itemizedlist>
+ <note><title>Warning</title>
+ When creating a recipe, you must follow this naming convention:
+ <literallayout class='monospaced'>
+ nativesdk-<replaceable>myrecipe</replaceable>.bb
+ </literallayout>
+ Not doing so can lead to subtle problems because code exists
+ that depends on the naming convention.
+ </note>
+ </para>
+
+ <para>
+ Although applied differently, the <filename>nativesdk</filename> class
+ is used with both methods.
+ The advantage of the second method is that you do not need to have two
+ separate recipes (assuming you need both) for the SDK machine and the
+ target.
+ All common parts of the recipe are automatically shared.
+ </para>
+</section>
+
+<section id='ref-classes-nopackages'>
+ <title><filename>nopackages.bbclass</filename></title>
+
+ <para>
+ Disables packaging tasks for those recipes and classes where
+ packaging is not needed.
+ </para>
+</section>
+
+<section id='ref-classes-npm'>
+ <title><filename>npm.bbclass</filename></title>
+
+ <para>
+ Provides support for building Node.js software fetched using the npm
+ package manager.
+ <note>
+ Currently, recipes inheriting this class must use the
+ <filename>npm://</filename> fetcher to have dependencies fetched
+ and packaged automatically.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-oelint'>
+ <title><filename>oelint.bbclass</filename></title>
+
+ <para>
+ The <filename>oelint</filename> class is an
+ obsolete lint checking tool that exists in
+ <filename>meta/classes</filename> in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+
+ <para>
+ A number of classes exist that could be generally useful in
+ OE-Core but are never actually used within OE-Core itself.
+ The <filename>oelint</filename> class is one such example.
+ However, being aware of this class can reduce the proliferation of
+ different versions of similar classes across multiple layers.
+ </para>
+</section>
+
+<section id='ref-classes-own-mirrors'>
+ <title><filename>own-mirrors.bbclass</filename></title>
+
+ <para>
+ The <filename>own-mirrors</filename> class makes it
+ easier to set up your own
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ from which to first fetch source before attempting to fetch it from the
+ upstream specified in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ within each recipe.
+ </para>
+
+ <para>
+ To use this class, inherit it globally and specify
+ <link linkend='var-SOURCE_MIRROR_URL'><filename>SOURCE_MIRROR_URL</filename></link>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ INHERIT += "own-mirrors"
+ SOURCE_MIRROR_URL = "http://example.com/my-source-mirror"
+ </literallayout>
+ You can specify only a single URL in
+ <filename>SOURCE_MIRROR_URL</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-package'>
+ <title><filename>package.bbclass</filename></title>
+
+ <para>
+ The <filename>package</filename> class supports generating
+ packages from a build's output.
+ The core generic functionality is in
+ <filename>package.bbclass</filename>.
+ The code specific to particular package types resides in these
+ package-specific classes:
+ <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>,
+ <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>,
+ <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>,
+ and
+ <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link>.
+ <note><title>Warning</title>
+ The <filename>package_tar</filename> class is broken and not
+ supported.
+ It is recommended that you do not use this class.
+ </note>
+ </para>
+
+ <para>
+ You can control the list of resulting package formats by using the
+ <filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link></filename>
+ variable defined in your <filename>conf/local.conf</filename>
+ configuration file, which is located in the
+ <link linkend='build-directory'>Build Directory</link>.
+ When defining the variable, you can specify one or more package types.
+ Since images are generated from packages, a packaging class is
+ needed to enable image generation.
+ The first class listed in this variable is used for image generation.
+ </para>
+
+ <para>
+ If you take the optional step to set up a repository (package feed)
+ on the development host that can be used by DNF, you can
+ install packages from the feed while you are running the image
+ on the target (i.e. runtime installation of packages).
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-runtime-package-management'>Using Runtime Package Management</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ The package-specific class you choose can affect build-time performance
+ and has space ramifications.
+ In general, building a package with IPK takes about thirty percent less
+ time as compared to using RPM to build the same or similar package.
+ This comparison takes into account a complete build of the package with
+ all dependencies previously built.
+ The reason for this discrepancy is because the RPM package manager
+ creates and processes more
+ <link linkend='metadata'>Metadata</link> than the
+ IPK package manager.
+ Consequently, you might consider setting
+ <filename>PACKAGE_CLASSES</filename> to "package_ipk" if you are
+ building smaller systems.
+ </para>
+
+ <para>
+ Before making your package manager decision, however, you should
+ consider some further things about using RPM:
+ <itemizedlist>
+ <listitem><para>
+ RPM starts to provide more abilities than IPK due to
+ the fact that it processes more Metadata.
+ For example, this information includes individual file types,
+ file checksum generation and evaluation on install, sparse file
+ support, conflict detection and resolution for Multilib systems,
+ ACID style upgrade, and repackaging abilities for rollbacks.
+ </para></listitem>
+ <listitem><para>
+ For smaller systems, the extra space used for the Berkeley
+ Database and the amount of metadata when using RPM can affect
+ your ability to perform on-device upgrades.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can find additional information on the effects of the package
+ class at these two Yocto Project mailing list links:
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006362.html'>
+ https://lists.yoctoproject.org/pipermail/poky/2011-May/006362.html</ulink></para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/pipermail/poky/2011-May/006363.html'>
+ https://lists.yoctoproject.org/pipermail/poky/2011-May/006363.html</ulink></para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-package_deb'>
+ <title><filename>package_deb.bbclass</filename></title>
+
+ <para>
+ The <filename>package_deb</filename> class
+ provides support for creating packages that use the Debian
+ (i.e. <filename>.deb</filename>) file format.
+ The class ensures the packages are written out in a
+ <filename>.deb</filename> file format to the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link><filename>}</filename>
+ directory.
+ </para>
+
+ <para>
+ This class inherits the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class and is enabled through the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable in the <filename>local.conf</filename> file.
+ </para>
+</section>
+
+<section id='ref-classes-package_ipk'>
+ <title><filename>package_ipk.bbclass</filename></title>
+
+ <para>
+ The <filename>package_ipk</filename> class
+ provides support for creating packages that use the IPK
+ (i.e. <filename>.ipk</filename>) file format.
+ The class ensures the packages are written out in a
+ <filename>.ipk</filename> file format to the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link><filename>}</filename>
+ directory.
+ </para>
+
+ <para>
+ This class inherits the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class and is enabled through the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable in the <filename>local.conf</filename> file.
+ </para>
+</section>
+
+<section id='ref-classes-package_rpm'>
+ <title><filename>package_rpm.bbclass</filename></title>
+
+ <para>
+ The <filename>package_rpm</filename> class
+ provides support for creating packages that use the RPM
+ (i.e. <filename>.rpm</filename>) file format.
+ The class ensures the packages are written out in a
+ <filename>.rpm</filename> file format to the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link><filename>}</filename>
+ directory.
+ </para>
+
+ <para>
+ This class inherits the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class and is enabled through the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable in the <filename>local.conf</filename> file.
+ </para>
+</section>
+
+<section id='ref-classes-package_tar'>
+ <title><filename>package_tar.bbclass</filename></title>
+
+ <para>
+ The <filename>package_tar</filename> class
+ provides support for creating tarballs.
+ The class ensures the packages are written out in a
+ tarball format to the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link><filename>}</filename>
+ directory.
+ </para>
+
+ <para>
+ This class inherits the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class and is enabled through the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable in the <filename>local.conf</filename> file.
+ <note>
+ You cannot specify the <filename>package_tar</filename> class
+ first using the <filename>PACKAGE_CLASSES</filename> variable.
+ You must use <filename>.deb</filename>,
+ <filename>.ipk</filename>, or <filename>.rpm</filename> file
+ formats for your image or SDK.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-packagedata'>
+ <title><filename>packagedata.bbclass</filename></title>
+
+ <para>
+ The <filename>packagedata</filename> class provides
+ common functionality for reading <filename>pkgdata</filename> files
+ found in
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>.
+ These files contain information about each output package produced by
+ the OpenEmbedded build system.
+ </para>
+
+ <para>
+ This class is enabled by default because it is inherited by the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-packagegroup'>
+ <title><filename>packagegroup.bbclass</filename></title>
+
+ <para>
+ The <filename>packagegroup</filename> class sets default values
+ appropriate for package group recipes (e.g.
+ <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename>,
+ <filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>,
+ <filename><link linkend='var-ALLOW_EMPTY'>ALLOW_EMPTY</link></filename>,
+ and so forth).
+ It is highly recommended that all package group recipes inherit this class.
+ </para>
+
+ <para>
+ For information on how to use this class, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-customtasks'>Customizing Images Using Custom Package Groups</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ Previously, this class was called the <filename>task</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-patch'>
+ <title><filename>patch.bbclass</filename></title>
+
+ <para>
+ The <filename>patch</filename> class provides all functionality for
+ applying patches during the
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ task.
+ </para>
+
+ <para>
+ This class is enabled by default because it is inherited by the
+ <link linkend='ref-classes-base'><filename>base</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-perlnative'>
+ <title><filename>perlnative.bbclass</filename></title>
+
+ <para>
+ When inherited by a recipe, the <filename>perlnative</filename> class
+ supports using the native version of Perl built by the build system
+ rather than using the version provided by the build host.
+ </para>
+</section>
+
+<section id='ref-classes-pixbufcache'>
+ <title><filename>pixbufcache.bbclass</filename></title>
+
+ <para>
+ The <filename>pixbufcache</filename> class generates the proper
+ post-install and post-remove (postinst/postrm) scriptlets for packages
+ that install pixbuf loaders, which are used with
+ <filename>gdk-pixbuf</filename>.
+ These scriptlets call <filename>update_pixbuf_cache</filename>
+ to add the pixbuf loaders to the cache.
+ Since the cache files are architecture-specific,
+ <filename>update_pixbuf_cache</filename> is run using QEMU if the
+ postinst scriptlets need to be run on the build host during image
+ creation.
+ </para>
+
+ <para>
+ If the pixbuf loaders being installed are in packages other
+ than the recipe's main package, set
+ <link linkend='var-PIXBUF_PACKAGES'><filename>PIXBUF_PACKAGES</filename></link>
+ to specify the packages containing the loaders.
+ </para>
+</section>
+
+<section id='ref-classes-pkgconfig'>
+ <title><filename>pkgconfig.bbclass</filename></title>
+
+ <para>
+ The <filename>pkgconfig</filename> class provides a standard way to get
+ header and library information by using <filename>pkg-config</filename>.
+ This class aims to smooth integration of
+ <filename>pkg-config</filename> into libraries that use it.
+ </para>
+
+ <para>
+ During staging, BitBake installs <filename>pkg-config</filename>
+ data into the <filename>sysroots/</filename> directory.
+ By making use of sysroot functionality within
+ <filename>pkg-config</filename>, the <filename>pkgconfig</filename>
+ class no longer has to manipulate the files.
+ </para>
+</section>
+
+<section id='ref-classes-populate-sdk'>
+ <title><filename>populate_sdk.bbclass</filename></title>
+
+ <para>
+ The <filename>populate_sdk</filename> class provides support for
+ SDK-only recipes.
+ For information on advantages gained when building a cross-development
+ toolchain using the
+ <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>
+ task, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para>
+</section>
+
+<section id='ref-classes-populate-sdk-*'>
+ <title><filename>populate_sdk_*.bbclass</filename></title>
+
+ <para>
+ The <filename>populate_sdk_*</filename> classes support SDK creation
+ and consist of the following classes:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>populate_sdk_base</filename>:</emphasis>
+ The base class supporting SDK creation under all package
+ managers (i.e. DEB, RPM, and opkg).</para></listitem>
+ <listitem><para><emphasis><filename>populate_sdk_deb</filename>:</emphasis>
+ Supports creation of the SDK given the Debian package manager.
+ </para></listitem>
+ <listitem><para><emphasis><filename>populate_sdk_rpm</filename>:</emphasis>
+ Supports creation of the SDK given the RPM package manager.
+ </para></listitem>
+ <listitem><para><emphasis><filename>populate_sdk_ipk</filename>:</emphasis>
+ Supports creation of the SDK given the opkg (IPK format)
+ package manager.
+ </para></listitem>
+ <listitem><para><emphasis><filename>populate_sdk_ext</filename>:</emphasis>
+ Supports extensible SDK creation under all package managers.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The <filename>populate_sdk_base</filename> class inherits the
+ appropriate <filename>populate_sdk_*</filename> (i.e.
+ <filename>deb</filename>, <filename>rpm</filename>, and
+ <filename>ipk</filename>) based on
+ <link linkend='var-IMAGE_PKGTYPE'><filename>IMAGE_PKGTYPE</filename></link>.
+ </para>
+
+ <para>
+ The base class ensures all source and destination directories are
+ established and then populates the SDK.
+ After populating the SDK, the <filename>populate_sdk_base</filename>
+ class constructs two sysroots:
+ <filename>${</filename><link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link><filename>}-nativesdk</filename>,
+ which contains the cross-compiler and associated tooling, and the
+ target, which contains a target root filesystem that is configured for
+ the SDK usage.
+ These two images reside in
+ <link linkend='var-SDK_OUTPUT'><filename>SDK_OUTPUT</filename></link>,
+ which consists of the following:
+ <literallayout class='monospaced'>
+ ${SDK_OUTPUT}/${SDK_ARCH}<replaceable>-nativesdk-pkgs</replaceable>
+ ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/<replaceable>target-pkgs</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ Finally, the base populate SDK class creates the toolchain
+ environment setup script, the tarball of the SDK, and the installer.
+ </para>
+
+ <para>
+ The respective <filename>populate_sdk_deb</filename>,
+ <filename>populate_sdk_rpm</filename>, and
+ <filename>populate_sdk_ipk</filename> classes each support the
+ specific type of SDK.
+ These classes are inherited by and used with the
+ <filename>populate_sdk_base</filename> class.
+ </para>
+
+ <para>
+ For more information on the cross-development toolchain
+ generation, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ For information on advantages gained when building a
+ cross-development toolchain using the
+ <link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>
+ task, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para>
+</section>
+
+<section id='ref-classes-prexport'>
+ <title><filename>prexport.bbclass</filename></title>
+
+ <para>
+ The <filename>prexport</filename> class provides functionality for
+ exporting
+ <link linkend='var-PR'><filename>PR</filename></link> values.
+ <note>
+ This class is not intended to be used directly.
+ Rather, it is enabled when using
+ "<filename>bitbake-prserv-tool export</filename>".
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-primport'>
+ <title><filename>primport.bbclass</filename></title>
+
+ <para>
+ The <filename>primport</filename> class provides functionality for
+ importing
+ <link linkend='var-PR'><filename>PR</filename></link> values.
+ <note>
+ This class is not intended to be used directly.
+ Rather, it is enabled when using
+ "<filename>bitbake-prserv-tool import</filename>".
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-prserv'>
+ <title><filename>prserv.bbclass</filename></title>
+
+ <para>
+ The <filename>prserv</filename> class provides functionality for
+ using a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>PR service</ulink>
+ in order to automatically manage the incrementing of the
+ <link linkend='var-PR'><filename>PR</filename></link> variable for
+ each recipe.
+ </para>
+
+ <para>
+ This class is enabled by default because it is inherited by the
+ <link linkend='ref-classes-package'><filename>package</filename></link>
+ class.
+ However, the OpenEmbedded build system will not enable the
+ functionality of this class unless
+ <link linkend='var-PRSERV_HOST'><filename>PRSERV_HOST</filename></link>
+ has been set.
+ </para>
+</section>
+
+<section id='ref-classes-ptest'>
+ <title><filename>ptest.bbclass</filename></title>
+
+ <para>
+ The <filename>ptest</filename> class provides functionality for
+ packaging and installing runtime tests for recipes that build software
+ that provides these tests.
+ </para>
+
+ <para>
+ This class is intended to be inherited by individual recipes.
+ However, the class' functionality is largely disabled unless "ptest"
+ appears in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information on ptest.
+ </para>
+</section>
+
+<section id='ref-classes-ptest-gnome'>
+ <title><filename>ptest-gnome.bbclass</filename></title>
+
+ <para>
+ Enables package tests (ptests) specifically for GNOME packages,
+ which have tests intended to be executed with
+ <filename>gnome-desktop-testing</filename>.
+ </para>
+
+ <para>
+ For information on setting up and running ptests, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-python-dir'>
+ <title><filename>python-dir.bbclass</filename></title>
+
+ <para>
+ The <filename>python-dir</filename> class provides the base version,
+ location, and site package location for Python.
+ </para>
+</section>
+
+<section id='ref-classes-python3native'>
+ <title><filename>python3native.bbclass</filename></title>
+
+ <para>
+ The <filename>python3native</filename> class supports using the
+ native version of Python 3 built by the build system rather than
+ support of the version provided by the build host.
+ </para>
+</section>
+
+<section id='ref-classes-pythonnative'>
+ <title><filename>pythonnative.bbclass</filename></title>
+
+ <para>
+ When inherited by a recipe, the <filename>pythonnative</filename> class
+ supports using the native version of Python built by the build system
+ rather than using the version provided by the build host.
+ </para>
+</section>
+
+<section id='ref-classes-qemu'>
+ <title><filename>qemu.bbclass</filename></title>
+
+ <para>
+ The <filename>qemu</filename> class provides functionality for recipes
+ that either need QEMU or test for the existence of QEMU.
+ Typically, this class is used to run programs for a target system on
+ the build host using QEMU's application emulation mode.
+ </para>
+</section>
+
+<section id='ref-classes-recipe_sanity'>
+ <title><filename>recipe_sanity.bbclass</filename></title>
+
+ <para>
+ The <filename>recipe_sanity</filename> class checks for the presence
+ of any host system recipe prerequisites that might affect the
+ build (e.g. variables that are set or software that is present).
+ </para>
+</section>
+
+<section id='ref-classes-relocatable'>
+ <title><filename>relocatable.bbclass</filename></title>
+
+ <para>
+ The <filename>relocatable</filename> class enables relocation of
+ binaries when they are installed into the sysroot.
+ </para>
+
+ <para>
+ This class makes use of the
+ <link linkend='ref-classes-chrpath'><filename>chrpath</filename></link>
+ class and is used by both the
+ <link linkend='ref-classes-cross'><filename>cross</filename></link>
+ and
+ <link linkend='ref-classes-native'><filename>native</filename></link>
+ classes.
+ </para>
+</section>
+
+<section id='ref-classes-remove-libtool'>
+ <title><filename>remove-libtool.bbclass</filename></title>
+
+ <para>
+ The <filename>remove-libtool</filename> class adds a post function
+ to the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task to remove all <filename>.la</filename> files installed by
+ <filename>libtool</filename>.
+ Removing these files results in them being absent from both the
+ sysroot and target packages.
+ </para>
+
+ <para>
+ If a recipe needs the <filename>.la</filename> files to be installed,
+ then the recipe can override the removal by setting
+ <filename>REMOVE_LIBTOOL_LA</filename> to "0" as follows:
+ <literallayout class='monospaced'>
+ REMOVE_LIBTOOL_LA = "0"
+ </literallayout>
+ <note>
+ The <filename>remove-libtool</filename> class is not enabled by
+ default.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-report-error'>
+ <title><filename>report-error.bbclass</filename></title>
+
+ <para>
+ The <filename>report-error</filename> class supports enabling the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>error reporting tool</ulink>,
+ which allows you to submit build error information to a central
+ database.
+ </para>
+
+ <para>
+ The class collects debug information for recipe, recipe version, task,
+ machine, distro, build system, target system, host distro, branch,
+ commit, and log.
+ From the information, report files using a JSON format are created and
+ stored in
+ <filename>${</filename><link linkend='var-LOG_DIR'><filename>LOG_DIR</filename></link><filename>}/error-report</filename>.
+ </para>
+</section>
+
+<section id='ref-classes-rm-work'>
+ <title><filename>rm_work.bbclass</filename></title>
+
+ <para>
+ The <filename>rm_work</filename> class supports deletion of temporary
+ workspace, which can ease your hard drive demands during builds.
+ </para>
+
+ <para>
+ The OpenEmbedded build system can use a substantial amount of disk
+ space during the build process.
+ A portion of this space is the work files under the
+ <filename>${TMPDIR}/work</filename> directory for each recipe.
+ Once the build system generates the packages for a recipe, the work
+ files for that recipe are no longer needed.
+ However, by default, the build system preserves these files
+ for inspection and possible debugging purposes.
+ If you would rather have these files deleted to save disk space
+ as the build progresses, you can enable <filename>rm_work</filename>
+ by adding the following to your <filename>local.conf</filename> file,
+ which is found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ <literallayout class='monospaced'>
+ INHERIT += "rm_work"
+ </literallayout>
+ If you are modifying and building source code out of the work directory
+ for a recipe, enabling <filename>rm_work</filename> will potentially
+ result in your changes to the source being lost.
+ To exclude some recipes from having their work directories deleted by
+ <filename>rm_work</filename>, you can add the names of the recipe or
+ recipes you are working on to the <filename>RM_WORK_EXCLUDE</filename>
+ variable, which can also be set in your <filename>local.conf</filename>
+ file.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RM_WORK_EXCLUDE += "busybox glibc"
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-rootfs*'>
+ <title><filename>rootfs*.bbclass</filename></title>
+
+ <para>
+ The <filename>rootfs*</filename> classes support creating
+ the root filesystem for an image and consist of the following classes:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>rootfs-postcommands</filename> class, which
+ defines filesystem post-processing functions for image recipes.
+ </para></listitem>
+ <listitem><para>
+ The <filename>rootfs_deb</filename> class, which supports
+ creation of root filesystems for images built using
+ <filename>.deb</filename> packages.</para></listitem>
+ <listitem><para>
+ The <filename>rootfs_rpm</filename> class, which supports
+ creation of root filesystems for images built using
+ <filename>.rpm</filename> packages.</para></listitem>
+ <listitem><para>
+ The <filename>rootfs_ipk</filename> class, which supports
+ creation of root filesystems for images built using
+ <filename>.ipk</filename> packages.</para></listitem>
+ <listitem><para>
+ The <filename>rootfsdebugfiles</filename> class, which installs
+ additional files found on the build host directly into the
+ root filesystem.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The root filesystem is created from packages using one of the
+ <filename>rootfs*.bbclass</filename> files as determined by the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable.
+ </para>
+
+ <para>
+ For information on how root filesystem images are created, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+</section>
+
+<section id='ref-classes-sanity'>
+ <title><filename>sanity.bbclass</filename></title>
+
+ <para>
+ The <filename>sanity</filename> class checks to see if prerequisite
+ software is present on the host system so that users can be notified
+ of potential problems that might affect their build.
+ The class also performs basic user configuration checks from
+ the <filename>local.conf</filename> configuration file to
+ prevent common mistakes that cause build failures.
+ Distribution policy usually determines whether to include this class.
+ </para>
+</section>
+
+<section id='ref-classes-scons'>
+ <title><filename>scons.bbclass</filename></title>
+
+ <para>
+ The <filename>scons</filename> class supports recipes that need to
+ build software that uses the SCons build system.
+ You can use the
+ <link linkend='var-EXTRA_OESCONS'><filename>EXTRA_OESCONS</filename></link>
+ variable to specify additional configuration options you want to pass
+ SCons command line.
+ </para>
+</section>
+
+<section id='ref-classes-sdl'>
+ <title><filename>sdl.bbclass</filename></title>
+
+ <para>
+ The <filename>sdl</filename> class supports recipes that need to build
+ software that uses the Simple DirectMedia Layer (SDL) library.
+ </para>
+</section>
+
+<section id='ref-classes-setuptools'>
+ <title><filename>setuptools.bbclass</filename></title>
+
+ <para>
+ The <filename>setuptools</filename> class supports Python
+ version 2.x extensions that use build systems based on
+ <filename>setuptools</filename>.
+ If your recipe uses these build systems, the recipe needs to
+ inherit the <filename>setuptools</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-setuptools3'>
+ <title><filename>setuptools3.bbclass</filename></title>
+
+ <para>
+ The <filename>setuptools3</filename> class supports Python
+ version 3.x extensions that use build systems based on
+ <filename>setuptools3</filename>.
+ If your recipe uses these build systems, the recipe needs to
+ inherit the <filename>setuptools3</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-sign_rpm'>
+ <title><filename>sign_rpm.bbclass</filename></title>
+
+ <para>
+ The <filename>sign_rpm</filename> class supports generating signed
+ RPM packages.
+ </para>
+</section>
+
+<section id='ref-classes-sip'>
+ <title><filename>sip.bbclass</filename></title>
+
+ <para>
+ The <filename>sip</filename> class
+ supports recipes that build or package SIP-based Python bindings.
+ </para>
+</section>
+
+<section id='ref-classes-siteconfig'>
+ <title><filename>siteconfig.bbclass</filename></title>
+
+ <para>
+ The <filename>siteconfig</filename> class
+ provides functionality for handling site configuration.
+ The class is used by the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class to accelerate the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task.
+ </para>
+</section>
+
+<section id='ref-classes-siteinfo'>
+ <title><filename>siteinfo.bbclass</filename></title>
+
+ <para>
+ The <filename>siteinfo</filename> class provides information about
+ the targets that might be needed by other classes or recipes.
+ </para>
+
+ <para>
+ As an example, consider Autotools, which can require tests that must
+ execute on the target hardware.
+ Since this is not possible in general when cross compiling, site
+ information is used to provide cached test results so these tests can
+ be skipped over but still make the correct values available.
+ The
+ <filename><link linkend='structure-meta-site'>meta/site directory</link></filename>
+ contains test results sorted into different categories such as
+ architecture, endianness, and the <filename>libc</filename> used.
+ Site information provides a list of files containing data relevant to
+ the current build in the
+ <filename><link linkend='var-CONFIG_SITE'>CONFIG_SITE</link></filename> variable
+ that Autotools automatically picks up.
+ </para>
+
+ <para>
+ The class also provides variables like
+ <filename><link linkend='var-SITEINFO_ENDIANNESS'>SITEINFO_ENDIANNESS</link></filename>
+ and <filename><link linkend='var-SITEINFO_BITS'>SITEINFO_BITS</link></filename>
+ that can be used elsewhere in the metadata.
+ </para>
+
+ <para>
+ Because the
+ <link linkend='ref-classes-base'><filename>base</filename></link> class
+ includes the <filename>siteinfo</filename> class, it is always active.
+ </para>
+</section>
+
+<section id='ref-classes-spdx'>
+ <title><filename>spdx.bbclass</filename></title>
+
+ <para>
+ The <filename>spdx</filename> class integrates real-time license
+ scanning, generation of SPDX standard output, and verification
+ of license information during the build.
+ <note>
+ This class is currently at the prototype stage in the 1.6
+ release.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-sstate'>
+ <title><filename>sstate.bbclass</filename></title>
+
+ <para>
+ The <filename>sstate</filename> class provides support for Shared
+ State (sstate).
+ By default, the class is enabled through the
+ <link linkend='var-INHERIT_DISTRO'><filename>INHERIT_DISTRO</filename></link>
+ variable's default value.
+ </para>
+
+ <para>
+ For more information on sstate, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>Shared State Cache</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+</section>
+
+<section id='ref-classes-staging'>
+ <title><filename>staging.bbclass</filename></title>
+
+ <para>
+ The <filename>staging</filename> class installs files into individual
+ recipe work directories for sysroots.
+ The class contains the following key tasks:
+ <itemizedlist>
+ <listitem><para>
+ The
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task, which is responsible for handing the files that end up
+ in the recipe sysroots.
+ </para></listitem>
+ <listitem><para>
+ The
+ <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+ task (a "partner" task to the
+ <filename>populate_sysroot</filename> task), which installs
+ the files into the individual recipe work directories (i.e.
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ The code in the <filename>staging</filename> class is complex and
+ basically works in two stages:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Stage One:</emphasis>
+ The first stage addresses recipes that have files they want
+ to share with other recipes that have dependencies on the
+ originating recipe.
+ Normally these dependencies are installed through the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task into
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>.
+ The <filename>do_populate_sysroot</filename> task copies
+ a subset of these files into
+ <filename>${SYSROOT_DESTDIR}</filename>.
+ This subset of files is controlled by the
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>,
+ <link linkend='var-SYSROOT_DIRS_NATIVE'><filename>SYSROOT_DIRS_NATIVE</filename></link>,
+ and
+ <link linkend='var-SYSROOT_DIRS_BLACKLIST'><filename>SYSROOT_DIRS_BLACKLIST</filename></link>
+ variables.
+ <note>
+ Additionally, a recipe can customize the files further by
+ declaring a processing function in the
+ <link linkend='var-SYSROOT_PREPROCESS_FUNCS'><filename>SYSROOT_PREPROCESS_FUNCS</filename></link>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ A shared state (sstate) object is built from these files
+ and the files are placed into a subdirectory of
+ <link linkend='structure-build-tmp-sysroots-components'><filename>tmp/sysroots-components/</filename></link>.
+ The files are scanned for hardcoded paths to the original
+ installation location.
+ If the location is found in text files, the hardcoded
+ locations are replaced by tokens and a list of the files
+ needing such replacements is created.
+ These adjustments are referred to as "FIXMEs".
+ The list of files that are scanned for paths is controlled by
+ the
+ <link linkend='var-SSTATE_SCAN_FILES'><filename>SSTATE_SCAN_FILES</filename></link>
+ variable.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Stage Two:</emphasis>
+ The second stage addresses recipes that want to use something
+ from another recipe and declare a dependency on that recipe
+ through the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable.
+ The recipe will have a
+ <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+ task and when
+ this task executes, it creates the
+ <filename>recipe-sysroot</filename> and
+ <filename>recipe-sysroot-native</filename> in the recipe
+ work directory (i.e.
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+ The OpenEmbedded build system creates hard links to copies of the
+ relevant files from <filename>sysroots-components</filename>
+ into the recipe work directory.
+ <note>
+ If hard links are not possible, the build system uses
+ actual copies.
+ </note>
+ The build system then addresses any "FIXMEs" to paths as
+ defined from the list created in the first stage.
+ </para>
+
+ <para>
+ Finally, any files in <filename>${bindir}</filename>
+ within the sysroot that have the prefix
+ "<filename>postinst-</filename>" are executed.
+ <note>
+ Although such sysroot post installation scripts are not
+ recommended for general use, the files do allow some issues
+ such as user creation and module indexes to be addressed.
+ </note>
+ </para>
+
+ <para>
+ Because recipes can have other dependencies outside of
+ <filename>DEPENDS</filename> (e.g.
+ <filename>do_unpack[depends] += "tar-native:do_populate_sysroot"</filename>),
+ the sysroot creation function
+ <filename>extend_recipe_sysroot</filename> is also added as
+ a pre-function for those tasks whose dependencies are not
+ through <filename>DEPENDS</filename> but operate similarly.
+ </para>
+
+ <para>
+ When installing dependencies into the sysroot, the code
+ traverses the dependency graph and processes dependencies
+ in exactly the same way as the dependencies would or would not
+ be when installed from sstate.
+ This processing means, for example, a native tool would have
+ its native dependencies added but a target library would not
+ have its dependencies traversed or installed.
+ The same sstate dependency code is used so that
+ builds should be identical regardless of whether sstate
+ was used or not.
+ For a closer look, see the
+ <filename>setscene_depvalid()</filename> function in the
+ <link linkend='ref-classes-sstate'><filename>sstate</filename></link>
+ class.
+ </para>
+
+ <para>
+ The build system is careful to maintain manifests of the files
+ it installs so that any given dependency can be installed as
+ needed.
+ The sstate hash of the installed item is also stored so that
+ if it changes, the build system can reinstall it.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-syslinux'>
+ <title><filename>syslinux.bbclass</filename></title>
+
+ <para>
+ The <filename>syslinux</filename> class provides syslinux-specific
+ functions for building bootable images.
+ </para>
+
+ <para>
+ The class supports the following variables:
+ <itemizedlist>
+ <listitem><para><link linkend='var-INITRD'><filename>INITRD</filename></link>:
+ Indicates list of filesystem images to concatenate and use as
+ an initial RAM disk (initrd).
+ This variable is optional.</para></listitem>
+ <listitem><para><link linkend='var-ROOTFS'><filename>ROOTFS</filename></link>:
+ Indicates a filesystem image to include as the root filesystem.
+ This variable is optional.</para></listitem>
+ <listitem><para><link linkend='var-AUTO_SYSLINUXMENU'><filename>AUTO_SYSLINUXMENU</filename></link>:
+ Enables creating an automatic menu when set to "1".
+ </para></listitem>
+ <listitem><para><link linkend='var-LABELS'><filename>LABELS</filename></link>:
+ Lists targets for automatic configuration.
+ </para></listitem>
+ <listitem><para><link linkend='var-APPEND'><filename>APPEND</filename></link>:
+ Lists append string overrides for each label.
+ </para></listitem>
+ <listitem><para><link linkend='var-SYSLINUX_OPTS'><filename>SYSLINUX_OPTS</filename></link>:
+ Lists additional options to add to the syslinux file.
+ Semicolon characters separate multiple options.
+ </para></listitem>
+ <listitem><para><link linkend='var-SYSLINUX_SPLASH'><filename>SYSLINUX_SPLASH</filename></link>:
+ Lists a background for the VGA boot menu when you are using the
+ boot menu.</para></listitem>
+ <listitem><para><link linkend='var-SYSLINUX_DEFAULT_CONSOLE'><filename>SYSLINUX_DEFAULT_CONSOLE</filename></link>:
+ Set to "console=ttyX" to change kernel boot default console.
+ </para></listitem>
+ <listitem><para><link linkend='var-SYSLINUX_SERIAL'><filename>SYSLINUX_SERIAL</filename></link>:
+ Sets an alternate serial port.
+ Or, turns off serial when the variable is set with an
+ empty string.</para></listitem>
+ <listitem><para><link linkend='var-SYSLINUX_SERIAL_TTY'><filename>SYSLINUX_SERIAL_TTY</filename></link>:
+ Sets an alternate "console=tty..." kernel boot argument.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='ref-classes-systemd'>
+ <title><filename>systemd.bbclass</filename></title>
+
+ <para>
+ The <filename>systemd</filename> class provides support for recipes
+ that install systemd unit files.
+ </para>
+
+ <para>
+ The functionality for this class is disabled unless you have "systemd"
+ in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ </para>
+
+ <para>
+ Under this class, the recipe or Makefile (i.e. whatever the recipe is
+ calling during the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task) installs unit files into
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}${systemd_unitdir}/system</filename>.
+ If the unit files being installed go into packages other than the
+ main package, you need to set
+ <link linkend='var-SYSTEMD_PACKAGES'><filename>SYSTEMD_PACKAGES</filename></link>
+ in your recipe to identify the packages in which the files will be
+ installed.
+ </para>
+
+ <para>
+ You should set
+ <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link>
+ to the name of the service file.
+ You should also use a package name override to indicate the package
+ to which the value applies.
+ If the value applies to the recipe's main package, use
+ <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>.
+ Here is an example from the connman recipe:
+ <literallayout class='monospaced'>
+ SYSTEMD_SERVICE_${PN} = "connman.service"
+ </literallayout>
+ Services are set up to start on boot automatically unless
+ you have set
+ <link linkend='var-SYSTEMD_AUTO_ENABLE'><filename>SYSTEMD_AUTO_ENABLE</filename></link>
+ to "disable".
+ </para>
+
+ <para>
+ For more information on <filename>systemd</filename>, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#selecting-an-initialization-manager'>Selecting an Initialization Manager</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-systemd-boot'>
+ <title><filename>systemd-boot.bbclass</filename></title>
+
+ <para>
+ The <filename>systemd-boot</filename> class provides functions specific
+ to the systemd-boot bootloader for building bootable images.
+ This is an internal class and is not intended to be used directly.
+ <note>
+ The <filename>systemd-boot</filename> class is a result from
+ merging the <filename>gummiboot</filename> class used in previous
+ Yocto Project releases with the <filename>systemd</filename>
+ project.
+ </note>
+ Set the
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ variable to "systemd-boot" to use this class.
+ Doing so creates a standalone EFI bootloader that is not dependent
+ on systemd.
+ </para>
+
+ <para>
+ For information on more variables used and supported in this class,
+ see the
+ <link linkend='var-SYSTEMD_BOOT_CFG'><filename>SYSTEMD_BOOT_CFG</filename></link>,
+ <link linkend='var-SYSTEMD_BOOT_ENTRIES'><filename>SYSTEMD_BOOT_ENTRIES</filename></link>,
+ and
+ <link linkend='var-SYSTEMD_BOOT_TIMEOUT'><filename>SYSTEMD_BOOT_TIMEOUT</filename></link>
+ variables.
+ </para>
+
+ <para>
+ You can also see the
+ <ulink url='http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/'>Systemd-boot documentation</ulink>
+ for more information.
+ </para>
+</section>
+
+<section id='ref-classes-terminal'>
+ <title><filename>terminal.bbclass</filename></title>
+
+ <para>
+ The <filename>terminal</filename> class provides support for starting
+ a terminal session.
+ The
+ <link linkend='var-OE_TERMINAL'><filename>OE_TERMINAL</filename></link>
+ variable controls which terminal emulator is used for the session.
+ </para>
+
+ <para>
+ Other classes use the <filename>terminal</filename> class anywhere a
+ separate terminal session needs to be started.
+ For example, the
+ <link linkend='ref-classes-patch'><filename>patch</filename></link>
+ class assuming
+ <link linkend='var-PATCHRESOLVE'><filename>PATCHRESOLVE</filename></link>
+ is set to "user", the
+ <link linkend='ref-classes-cml1'><filename>cml1</filename></link>
+ class, and the
+ <link linkend='ref-classes-devshell'><filename>devshell</filename></link>
+ class all use the <filename>terminal</filename> class.
+ </para>
+</section>
+
+<section id='ref-classes-testimage*'>
+ <title><filename>testimage*.bbclass</filename></title>
+
+ <para>
+ The <filename>testimage*</filename> classes support running
+ automated tests against images using QEMU and on actual hardware.
+ The classes handle loading the tests and starting the image.
+ To use the classes, you need to perform steps to set up the
+ environment.
+ </para>
+
+ <para>
+ The tests are commands that run on the target system over
+ <filename>ssh</filename>.
+ Each test is written in Python and makes use of the
+ <filename>unittest</filename> module.
+ </para>
+
+ <para>
+ The <filename>testimage.bbclass</filename> runs tests on an image
+ when called using the following:
+ <literallayout class='monospaced'>
+ $ bitbake -c testimage <replaceable>image</replaceable>
+ </literallayout>
+ The <filename>testimage-auto</filename> class runs tests on an image
+ after the image is constructed (i.e.
+ <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link>
+ must be set to "1").
+ </para>
+
+ <para>
+ For information on how to enable, run, and create new tests, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='ref-classes-testsdk'>
+ <title><filename>testsdk.bbclass</filename></title>
+
+ <para>
+ This class supports running automated tests against
+ software development kits (SDKs).
+ The <filename>testsdk</filename> class runs tests on an SDK when
+ called using the following:
+ <literallayout class='monospaced'>
+ $ bitbake -c testsdk image
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-texinfo'>
+ <title><filename>texinfo.bbclass</filename></title>
+
+ <para>
+ This class should be inherited by recipes whose upstream packages
+ invoke the <filename>texinfo</filename> utilities at build-time.
+ Native and cross recipes are made to use the dummy scripts provided
+ by <filename>texinfo-dummy-native</filename>, for improved performance.
+ Target architecture recipes use the genuine
+ Texinfo utilities.
+ By default, they use the Texinfo utilities on the host system.
+ <note>
+ If you want to use the Texinfo recipe shipped with the build
+ system, you can remove "texinfo-native" from
+ <link linkend='var-ASSUME_PROVIDED'><filename>ASSUME_PROVIDED</filename></link>
+ and makeinfo from
+ <link linkend='var-SANITY_REQUIRED_UTILITIES'><filename>SANITY_REQUIRED_UTILITIES</filename></link>.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-tinderclient'>
+ <title><filename>tinderclient.bbclass</filename></title>
+
+ <para>
+ The <filename>tinderclient</filename> class submits build results to
+ an external Tinderbox instance.
+ <note>
+ This class is currently unmaintained.
+ </note>
+ </para>
+</section>
+
+<section id='ref-classes-toaster'>
+ <title><filename>toaster.bbclass</filename></title>
+
+ <para>
+ The <filename>toaster</filename> class collects information about
+ packages and images and sends them as events that the BitBake
+ user interface can receive.
+ The class is enabled when the Toaster user interface is running.
+ </para>
+
+ <para>
+ This class is not intended to be used directly.
+ </para>
+</section>
+
+<section id='ref-classes-toolchain-scripts'>
+ <title><filename>toolchain-scripts.bbclass</filename></title>
+
+ <para>
+ The <filename>toolchain-scripts</filename> class provides the scripts
+ used for setting up the environment for installed SDKs.
+ </para>
+</section>
+
+<section id='ref-classes-typecheck'>
+ <title><filename>typecheck.bbclass</filename></title>
+
+ <para>
+ The <filename>typecheck</filename> class provides support for
+ validating the values of variables set at the configuration level
+ against their defined types.
+ The OpenEmbedded build system allows you to define the type of a
+ variable using the "type" varflag.
+ Here is an example:
+ <literallayout class='monospaced'>
+ IMAGE_FEATURES[type] = "list"
+ </literallayout>
+ </para>
+</section>
+
+<section id='ref-classes-uboot-config'>
+ <title><filename>uboot-config.bbclass</filename></title>
+
+ <para>
+ The <filename>uboot-config</filename> class provides support for
+ U-Boot configuration for a machine.
+ Specify the machine in your recipe as follows:
+ <literallayout class='monospaced'>
+ UBOOT_CONFIG ??= &lt;default&gt;
+ UBOOT_CONFIG[foo] = "config,images"
+ </literallayout>
+ You can also specify the machine using this method:
+ <literallayout class='monospaced'>
+ UBOOT_MACHINE = "config"
+ </literallayout>
+ See the
+ <link linkend='var-UBOOT_CONFIG'><filename>UBOOT_CONFIG</filename></link>
+ and
+ <link linkend='var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></link>
+ variables for additional information.
+ </para>
+</section>
+
+<section id='ref-classes-uninative'>
+ <title><filename>uninative.bbclass</filename></title>
+
+ <para>
+ Attempts to isolate the build system from the host
+ distribution's C library in order to make re-use of native shared state
+ artifacts across different host distributions practical.
+ With this class enabled, a tarball containing a pre-built C library
+ is downloaded at the start of the build.
+ In the Poky reference distribution this is enabled by default
+ through
+ <filename>meta/conf/distro/include/yocto-uninative.inc</filename>.
+ Other distributions that do not derive from poky can also
+ "<filename>require conf/distro/include/yocto-uninative.inc</filename>"
+ to use this.
+ Alternatively if you prefer, you can build the uninative-tarball recipe
+ yourself, publish the resulting tarball (e.g. via HTTP) and set
+ <filename>UNINATIVE_URL</filename> and
+ <filename>UNINATIVE_CHECKSUM</filename> appropriately.
+ For an example, see the
+ <filename>meta/conf/distro/include/yocto-uninative.inc</filename>.
+ </para>
+
+ <para>
+ The <filename>uninative</filename> class is also used unconditionally
+ by the extensible SDK.
+ When building the extensible SDK,
+ <filename>uninative-tarball</filename> is built and the resulting
+ tarball is included within the SDK.
+ </para>
+</section>
+
+<section id='ref-classes-update-alternatives'>
+ <title><filename>update-alternatives.bbclass</filename></title>
+
+ <para>
+ The <filename>update-alternatives</filename> class helps the
+ alternatives system when multiple sources provide the same command.
+ This situation occurs when several programs that have the same or
+ similar function are installed with the same name.
+ For example, the <filename>ar</filename> command is available from the
+ <filename>busybox</filename>, <filename>binutils</filename> and
+ <filename>elfutils</filename> packages.
+ The <filename>update-alternatives</filename> class handles
+ renaming the binaries so that multiple packages can be installed
+ without conflicts.
+ The <filename>ar</filename> command still works regardless of which
+ packages are installed or subsequently removed.
+ The class renames the conflicting binary in each package and symlinks
+ the highest priority binary during installation or removal of packages.
+ </para>
+
+ <para>
+ To use this class, you need to define a number of variables:
+ <itemizedlist>
+ <listitem><para><link linkend='var-ALTERNATIVE'><filename>ALTERNATIVE</filename></link>
+ </para></listitem>
+ <listitem><para><link linkend='var-ALTERNATIVE_LINK_NAME'><filename>ALTERNATIVE_LINK_NAME</filename></link>
+ </para></listitem>
+ <listitem><para><link linkend='var-ALTERNATIVE_TARGET'><filename>ALTERNATIVE_TARGET</filename></link>
+ </para></listitem>
+ <listitem><para><link linkend='var-ALTERNATIVE_PRIORITY'><filename>ALTERNATIVE_PRIORITY</filename></link>
+ </para></listitem>
+ </itemizedlist>
+ These variables list alternative commands needed by a package,
+ provide pathnames for links, default links for targets, and
+ so forth.
+ For details on how to use this class, see the comments in the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/classes/update-alternatives.bbclass'><filename>update-alternatives.bbclass</filename></ulink>
+ file.
+ </para>
+
+ <note>
+ You can use the <filename>update-alternatives</filename> command
+ directly in your recipes.
+ However, this class simplifies things in most cases.
+ </note>
+</section>
+
+<section id='ref-classes-update-rc.d'>
+ <title><filename>update-rc.d.bbclass</filename></title>
+
+ <para>
+ The <filename>update-rc.d</filename> class uses
+ <filename>update-rc.d</filename> to safely install an
+ initialization script on behalf of the package.
+ The OpenEmbedded build system takes care of details such as making
+ sure the script is stopped before a package is removed and started when
+ the package is installed.
+ </para>
+
+ <para>
+ Three variables control this class:
+ <filename><link linkend='var-INITSCRIPT_PACKAGES'>INITSCRIPT_PACKAGES</link></filename>,
+ <filename><link linkend='var-INITSCRIPT_NAME'>INITSCRIPT_NAME</link></filename> and
+ <filename><link linkend='var-INITSCRIPT_PARAMS'>INITSCRIPT_PARAMS</link></filename>.
+ See the variable links for details.
+ </para>
+</section>
+
+<section id='ref-classes-useradd'>
+ <title><filename>useradd*.bbclass</filename></title>
+
+ <para>
+ The <filename>useradd*</filename> classes support the addition of users
+ or groups for usage by the package on the target.
+ For example, if you have packages that contain system services that
+ should be run under their own user or group, you can use these classes
+ to enable creation of the user or group.
+ The
+ <filename>meta-skeleton/recipes-skeleton/useradd/useradd-example.bb</filename>
+ recipe in the <link linkend='source-directory'>Source Directory</link>
+ provides a simple example that shows how to add three
+ users and groups to two packages.
+ See the <filename>useradd-example.bb</filename> recipe for more
+ information on how to use these classes.
+ </para>
+
+ <para>
+ The <filename>useradd_base</filename> class provides basic
+ functionality for user or groups settings.
+ </para>
+
+ <para>
+ The <filename>useradd*</filename> classes support the
+ <link linkend='var-USERADD_PACKAGES'><filename>USERADD_PACKAGES</filename></link>,
+ <link linkend='var-USERADD_PARAM'><filename>USERADD_PARAM</filename></link>,
+ <link linkend='var-GROUPADD_PARAM'><filename>GROUPADD_PARAM</filename></link>,
+ and
+ <link linkend='var-GROUPMEMS_PARAM'><filename>GROUPMEMS_PARAM</filename></link>
+ variables.
+ </para>
+
+ <para>
+ The <filename>useradd-staticids</filename> class supports the addition
+ of users or groups that have static user identification
+ (<filename>uid</filename>) and group identification
+ (<filename>gid</filename>) values.
+ </para>
+
+ <para>
+ The default behavior of the OpenEmbedded build system for assigning
+ <filename>uid</filename> and <filename>gid</filename> values when
+ packages add users and groups during package install time is to
+ add them dynamically.
+ This works fine for programs that do not care what the values of the
+ resulting users and groups become.
+ In these cases, the order of the installation determines the final
+ <filename>uid</filename> and <filename>gid</filename> values.
+ However, if non-deterministic
+ <filename>uid</filename> and <filename>gid</filename> values are a
+ problem, you can override the default, dynamic application of these
+ values by setting static values.
+ When you set static values, the OpenEmbedded build system looks in
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link> for
+ <filename>files/passwd</filename> and <filename>files/group</filename>
+ files for the values.
+ </para>
+
+ <para>
+ To use static <filename>uid</filename> and <filename>gid</filename>
+ values, you need to set some variables.
+ See the
+ <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>,
+ <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>,
+ <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link>,
+ and
+ <link linkend='var-USERADD_ERROR_DYNAMIC'><filename>USERADD_ERROR_DYNAMIC</filename></link>
+ variables.
+ You can also see the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class for additional information.
+ </para>
+
+ <note><title>Notes</title>
+ You do not use the <filename>useradd-staticids</filename>
+ class directly.
+ You either enable or disable the class by setting the
+ <filename>USERADDEXTENSION</filename> variable.
+ If you enable or disable the class in a configured system,
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ might contain incorrect <filename>uid</filename> and
+ <filename>gid</filename> values.
+ Deleting the <filename>TMPDIR</filename> directory
+ will correct this condition.
+ </note>
+</section>
+
+<section id='ref-classes-utility-tasks'>
+ <title><filename>utility-tasks.bbclass</filename></title>
+
+ <para>
+ The <filename>utility-tasks</filename> class provides support for
+ various "utility" type tasks that are applicable to all recipes,
+ such as
+ <link linkend='ref-tasks-clean'><filename>do_clean</filename></link> and
+ <link linkend='ref-tasks-listtasks'><filename>do_listtasks</filename></link>.
+ </para>
+
+ <para>
+ This class is enabled by default because it is inherited by
+ the
+ <link linkend='ref-classes-base'><filename>base</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-utils'>
+ <title><filename>utils.bbclass</filename></title>
+
+ <para>
+ The <filename>utils</filename> class provides some useful Python
+ functions that are typically used in inline Python expressions
+ (e.g. <filename>${@...}</filename>).
+ One example use is for <filename>bb.utils.contains()</filename>.
+ </para>
+
+ <para>
+ This class is enabled by default because it is inherited by the
+ <link linkend='ref-classes-base'><filename>base</filename></link>
+ class.
+ </para>
+</section>
+
+<section id='ref-classes-vala'>
+ <title><filename>vala.bbclass</filename></title>
+
+ <para>
+ The <filename>vala</filename> class supports recipes that need to
+ build software written using the Vala programming language.
+ </para>
+</section>
+
+<section id='ref-classes-waf'>
+ <title><filename>waf.bbclass</filename></title>
+
+ <para>
+ The <filename>waf</filename> class supports recipes that need to build
+ software that uses the Waf build system.
+ You can use the
+ <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>
+ or
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>
+ variables to specify additional configuration options to be passed on
+ the Waf command line.
+ </para>
+</section>
+
+<!-- Undocumented classes are:
+ image-empty.bbclass (possibly being dropped)
+ migrate_localcount.bbclass (still need a description)
+-->
+
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-devtool-reference.xml b/poky/documentation/ref-manual/ref-devtool-reference.xml
new file mode 100644
index 000000000..b974d0f59
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-devtool-reference.xml
@@ -0,0 +1,734 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-devtool-reference'>
+ <title><filename>devtool</filename> Quick Reference</title>
+
+ <para>
+ The <filename>devtool</filename> command-line tool provides a number
+ of features that help you build, test, and package software.
+ This command is available alongside the <filename>bitbake</filename>
+ command.
+ Additionally, the <filename>devtool</filename> command is a key
+ part of the extensible SDK.
+ </para>
+
+ <para>
+ This chapter provides a Quick Reference for the
+ <filename>devtool</filename> command.
+ For more information on how to apply the command when using the
+ extensible SDK, see the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-extensible'>Using the Extensible SDK</ulink>"
+ chapter in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para>
+
+ <section id='devtool-getting-help'>
+ <title>Getting Help</title>
+
+ <para>
+ The <filename>devtool</filename> command line is organized
+ similarly to Git in that it has a number of sub-commands for
+ each function.
+ You can run <filename>devtool --help</filename> to see all
+ the commands:
+ <literallayout class='monospaced'>
+ $ devtool --help
+ NOTE: Starting bitbake server...
+ usage: devtool [--basepath BASEPATH] [--bbpath BBPATH] [-d] [-q]
+ [--color COLOR] [-h]
+ &lt;subcommand&gt; ...
+
+ OpenEmbedded development tool
+
+ options:
+ --basepath BASEPATH Base directory of SDK / build directory
+ --bbpath BBPATH Explicitly specify the BBPATH, rather than getting it
+ from the metadata
+ -d, --debug Enable debug output
+ -q, --quiet Print only errors
+ --color COLOR Colorize output (where COLOR is auto, always, never)
+ -h, --help show this help message and exit
+
+ subcommands:
+ Beginning work on a recipe:
+ add Add a new recipe
+ modify Modify the source for an existing recipe
+ upgrade Upgrade an existing recipe
+ Getting information:
+ status Show workspace status
+ search Search available recipes
+ latest-version Report the latest version of an existing recipe
+ Working on a recipe in the workspace:
+ build Build a recipe
+ rename Rename a recipe file in the workspace
+ edit-recipe Edit a recipe file
+ find-recipe Find a recipe file
+ configure-help Get help on configure script options
+ update-recipe Apply changes from external source tree to recipe
+ reset Remove a recipe from your workspace
+ finish Finish working on a recipe in your workspace
+ Testing changes on target:
+ deploy-target Deploy recipe output files to live target machine
+ undeploy-target Undeploy recipe output files in live target machine
+ build-image Build image including workspace recipe packages
+ Advanced:
+ create-workspace Set up workspace in an alternative location
+ export Export workspace into a tar archive
+ import Import exported tar archive into workspace
+ extract Extract the source for an existing recipe
+ sync Synchronize the source tree for an existing recipe
+ Use devtool &lt;subcommand&gt; --help to get help on a specific command
+ </literallayout>
+ </para>
+
+ <para>
+ As directed in the general help output, you can get more
+ syntax on a specific command by providing the command
+ name and using <filename>--help</filename>:
+ <literallayout class='monospaced'>
+ $ devtool add --help
+ NOTE: Starting bitbake server...
+ usage: devtool add [-h] [--same-dir | --no-same-dir] [--fetch URI]
+ [--fetch-dev] [--version VERSION] [--no-git]
+ [--srcrev SRCREV | --autorev] [--srcbranch SRCBRANCH]
+ [--binary] [--also-native] [--src-subdir SUBDIR]
+ [--mirrors] [--provides PROVIDES]
+ [recipename] [srctree] [fetchuri]
+
+ Adds a new recipe to the workspace to build a specified source tree. Can
+ optionally fetch a remote URI and unpack it to create the source tree.
+
+ arguments:
+ recipename Name for new recipe to add (just name - no version,
+ path or extension). If not specified, will attempt to
+ auto-detect it.
+ srctree Path to external source tree. If not specified, a
+ subdirectory of
+ /home/scottrif/poky/build/workspace/sources will be
+ used.
+ fetchuri Fetch the specified URI and extract it to create the
+ source tree
+
+ options:
+ -h, --help show this help message and exit
+ --same-dir, -s Build in same directory as source
+ --no-same-dir Force build in a separate build directory
+ --fetch URI, -f URI Fetch the specified URI and extract it to create the
+ source tree (deprecated - pass as positional argument
+ instead)
+ --fetch-dev For npm, also fetch devDependencies
+ --version VERSION, -V VERSION
+ Version to use within recipe (PV)
+ --no-git, -g If fetching source, do not set up source tree as a git
+ repository
+ --srcrev SRCREV, -S SRCREV
+ Source revision to fetch if fetching from an SCM such
+ as git (default latest)
+ --autorev, -a When fetching from a git repository, set SRCREV in the
+ recipe to a floating revision instead of fixed
+ --srcbranch SRCBRANCH, -B SRCBRANCH
+ Branch in source repository if fetching from an SCM
+ such as git (default master)
+ --binary, -b Treat the source tree as something that should be
+ installed verbatim (no compilation, same directory
+ structure). Useful with binary packages e.g. RPMs.
+ --also-native Also add native variant (i.e. support building recipe
+ for the build host as well as the target machine)
+ --src-subdir SUBDIR Specify subdirectory within source tree to use
+ --mirrors Enable PREMIRRORS and MIRRORS for source tree fetching
+ (disable by default).
+ --provides PROVIDES, -p PROVIDES
+ Specify an alias for the item provided by the recipe.
+ E.g. virtual/libgl
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-the-workspace-layer-structure'>
+ <title>The Workspace Layer Structure</title>
+
+ <para>
+ <filename>devtool</filename> uses a "Workspace" layer
+ in which to accomplish builds.
+ This layer is not specific to any single
+ <filename>devtool</filename> command but is rather a common
+ working area used across the tool.
+ </para>
+
+ <para>
+ The following figure shows the workspace structure:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/build-workspace-directory.png"
+ width="6in" depth="5in" align="left" scale="70" />
+ </para>
+
+ <para>
+ <literallayout class='monospaced'>
+ attic - A directory created if devtool believes it must preserve
+ anything when you run "devtool reset". For example, if you
+ run "devtool add", make changes to the recipe, and then
+ run "devtool reset", devtool takes notice that the file has
+ been changed and moves it into the attic should you still
+ want the recipe.
+
+ README - Provides information on what is in workspace layer and how to
+ manage it.
+
+ .devtool_md5 - A checksum file used by devtool.
+
+ appends - A directory that contains *.bbappend files, which point to
+ external source.
+
+ conf - A configuration directory that contains the layer.conf file.
+
+ recipes - A directory containing recipes. This directory contains a
+ folder for each directory added whose name matches that of the
+ added recipe. devtool places the <replaceable>recipe</replaceable>.bb file
+ within that sub-directory.
+
+ sources - A directory containing a working copy of the source files used
+ when building the recipe. This is the default directory used
+ as the location of the source tree when you do not provide a
+ source tree path. This directory contains a folder for each
+ set of source files matched to a corresponding recipe.
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-adding-a-new-recipe-to-the-workspace'>
+ <title>Adding a New Recipe to the Workspace Layer</title>
+
+ <para>
+ Use the <filename>devtool add</filename> command to add a new recipe
+ to the workspace layer.
+ The recipe you add should not exist -
+ <filename>devtool</filename> creates it for you.
+ The source files the recipe uses should exist in an external
+ area.
+ </para>
+
+ <para>
+ The following example creates and adds a new recipe named
+ <filename>jackson</filename> to a workspace layer the tool creates.
+ The source code built by the recipes resides in
+ <filename>/home/<replaceable>user</replaceable>/sources/jackson</filename>:
+ <literallayout class='monospaced'>
+ $ devtool add jackson /home/<replaceable>user</replaceable>/sources/jackson
+ </literallayout>
+ </para>
+
+ <para>
+ If you add a recipe and the workspace layer does not exist,
+ the command creates the layer and populates it as
+ described in
+ "<link linkend='devtool-the-workspace-layer-structure'>The Workspace Layer Structure</link>"
+ section.
+ </para>
+
+ <para>
+ Running <filename>devtool add</filename> when the
+ workspace layer exists causes the tool to add the recipe,
+ append files, and source files into the existing workspace layer.
+ The <filename>.bbappend</filename> file is created to point
+ to the external source tree.
+ <note>
+ If your recipe has runtime dependencies defined, you must be sure
+ that these packages exist on the target hardware before attempting
+ to run your application.
+ If dependent packages (e.g. libraries) do not exist on the target,
+ your application, when run, will fail to find those functions.
+ For more information, see the
+ "<link linkend='devtool-deploying-your-software-on-the-target-machine'>Deploying Your Software on the Target Machine</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ By default, <filename>devtool add</filename> uses the latest
+ revision (i.e. master) when unpacking files from a remote URI.
+ In some cases, you might want to specify a source revision by
+ branch, tag, or commit hash. You can specify these options when
+ using the <filename>devtool add</filename> command:
+ <itemizedlist>
+ <listitem><para>
+ To specify a source branch, use the
+ <filename>--srcbranch</filename> option:
+ <literallayout class='monospaced'>
+ $ devtool add --srcbranch &DISTRO_NAME_NO_CAP; jackson /home/<replaceable>user</replaceable>/sources/jackson
+ </literallayout>
+ In the previous example, you are checking out the
+ &DISTRO_NAME_NO_CAP; branch.
+ </para></listitem>
+ <listitem><para>
+ To specify a specific tag or commit hash, use the
+ <filename>--srcrev</filename> option:
+ <literallayout class='monospaced'>
+ $ devtool add --srcrev &DISTRO_REL_TAG; jackson /home/<replaceable>user</replaceable>/sources/jackson
+ $ devtool add --srcrev <replaceable>some_commit_hash</replaceable> /home/<replaceable>user</replaceable>/sources/jackson
+ </literallayout>
+ The previous examples check out the &DISTRO_REL_TAG; tag
+ and the commit associated with the
+ <replaceable>some_commit_hash</replaceable> hash.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ If you prefer to use the latest revision every time the recipe is
+ built, use the options <filename>--autorev</filename>
+ or <filename>-a</filename>.
+ </note>
+ </para>
+ </section>
+
+ <section id='devtool-extracting-the-source-for-an-existing-recipe'>
+ <title>Extracting the Source for an Existing Recipe</title>
+
+ <para>
+ Use the <filename>devtool extract</filename> command to
+ extract the source for an existing recipe.
+ When you use this command, you must supply the root name
+ of the recipe (i.e. no version, paths, or extensions), and
+ you must supply the directory to which you want the source
+ extracted.
+ </para>
+
+ <para>
+ Additional command options let you control the name of a
+ development branch into which you can checkout the source
+ and whether or not to keep a temporary directory, which is
+ useful for debugging.
+ </para>
+ </section>
+
+ <section id='devtool-synchronizing-a-recipes-extracted-source-tree'>
+ <title>Synchronizing a Recipe's Extracted Source Tree</title>
+
+ <para>
+ Use the <filename>devtool sync</filename> command to
+ synchronize a previously extracted source tree for an
+ existing recipe.
+ When you use this command, you must supply the root name
+ of the recipe (i.e. no version, paths, or extensions), and
+ you must supply the directory to which you want the source
+ extracted.
+ </para>
+
+ <para>
+ Additional command options let you control the name of a
+ development branch into which you can checkout the source
+ and whether or not to keep a temporary directory, which is
+ useful for debugging.
+ </para>
+ </section>
+
+ <section id='devtool-modifying-a-recipe'>
+ <title>Modifying an Existing Recipe</title>
+
+ <para>
+ Use the <filename>devtool modify</filename> command to begin
+ modifying the source of an existing recipe.
+ This command is very similar to the
+ <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>add</filename></link>
+ command except that it does not physically create the
+ recipe in the workspace layer because the recipe already
+ exists in an another layer.
+ </para>
+
+ <para>
+ The <filename>devtool modify</filename> command extracts the
+ source for a recipe, sets it up as a Git repository if the
+ source had not already been fetched from Git, checks out a
+ branch for development, and applies any patches from the recipe
+ as commits on top.
+ You can use the following command to checkout the source
+ files:
+ <literallayout class='monospaced'>
+ $ devtool modify <replaceable>recipe</replaceable>
+ </literallayout>
+ Using the above command form, <filename>devtool</filename> uses
+ the existing recipe's
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ statement to locate the upstream source, extracts the source
+ into the default sources location in the workspace.
+ The default development branch used is "devtool".
+ </para>
+ </section>
+
+ <section id='devtool-edit-an-existing-recipe'>
+ <title>Edit an Existing Recipe</title>
+
+ <para>
+ Use the <filename>devtool edit-recipe</filename> command
+ to run the default editor, which is identified using the
+ <filename>EDITOR</filename> variable, on the specified recipe.
+ </para>
+
+ <para>
+ When you use the <filename>devtool edit-recipe</filename>
+ command, you must supply the root name of the recipe
+ (i.e. no version, paths, or extensions).
+ Also, the recipe file itself must reside in the workspace
+ as a result of the <filename>devtool add</filename> or
+ <filename>devtool upgrade</filename> commands.
+ However, you can override that requirement by using the
+ "-a" or "--any-recipe" option.
+ Using either of these options allows you to edit any recipe
+ regardless of its location.
+ </para>
+ </section>
+
+ <section id='devtool-updating-a-recipe'>
+ <title>Updating a Recipe</title>
+
+ <para>
+ Use the <filename>devtool update-recipe</filename> command to
+ update your recipe with patches that reflect changes you make
+ to the source files.
+ For example, if you know you are going to work on some
+ code, you could first use the
+ <link linkend='devtool-modifying-a-recipe'><filename>devtool modify</filename></link>
+ command to extract the code and set up the workspace.
+ After which, you could modify, compile, and test the code.
+ </para>
+
+ <para>
+ When you are satisfied with the results and you have committed
+ your changes to the Git repository, you can then
+ run the <filename>devtool update-recipe</filename> to create the
+ patches and update the recipe:
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ If you run the <filename>devtool update-recipe</filename>
+ without committing your changes, the command ignores the
+ changes.
+ </para>
+
+ <para>
+ Often, you might want to apply customizations made to your
+ software in your own layer rather than apply them to the
+ original recipe.
+ If so, you can use the
+ <filename>-a</filename> or <filename>--append</filename>
+ option with the <filename>devtool update-recipe</filename>
+ command.
+ These options allow you to specify the layer into which to
+ write an append file:
+ <literallayout class='monospaced'>
+ $ devtool update-recipe <replaceable>recipe</replaceable> -a <replaceable>base-layer-directory</replaceable>
+ </literallayout>
+ The <filename>*.bbappend</filename> file is created at the
+ appropriate path within the specified layer directory, which
+ may or may not be in your <filename>bblayers.conf</filename>
+ file.
+ If an append file already exists, the command updates it
+ appropriately.
+ </para>
+ </section>
+
+ <section id='devtool-upgrading-a-recipe'>
+ <title>Upgrading a Recipe</title>
+
+ <para>
+ As software matures, upstream recipes are upgraded to newer
+ versions.
+ As a developer, you need to keep your local recipes up-to-date
+ with the upstream version releases.
+ Several methods exist by which you can upgrade recipes.
+ You can read about them in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-upgrading-recipes'>Upgrading Recipes</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ This section overviews the <filename>devtool upgrade</filename>
+ command.
+ </para>
+
+ <para>
+ The <filename>devtool upgrade</filename> command
+ upgrades an existing recipe to a more recent version of the
+ recipe upstream.
+ The command puts the upgraded recipe file along with any associated
+ files into a "workspace" and, if necessary, extracts the source
+ tree to a specified location.
+ During the upgrade, patches associated with the recipe are
+ rebased or added as needed.
+ </para>
+
+ <para>
+ When you use the <filename>devtool upgrade</filename> command,
+ you must supply the root name of the recipe (i.e. no version,
+ paths, or extensions), and you must supply the directory
+ to which you want the source extracted.
+ Additional command options let you control things such as
+ the version number to which you want to upgrade (i.e. the
+ <link linkend='var-PV'><filename>PV</filename></link>),
+ the source revision to which you want to upgrade (i.e. the
+ <link linkend='var-SRCREV'><filename>SRCREV</filename></link>),
+ whether or not to apply patches, and so forth.
+ </para>
+
+ <para>
+ You can read more on the <filename>devtool upgrade</filename>
+ workflow in the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ You can also see an example of how to use
+ <filename>devtool upgrade</filename> in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-using-devtool-upgrade'>Using <filename>devtool upgrade</filename></ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='devtool-resetting-a-recipe'>
+ <title>Resetting a Recipe</title>
+
+ <para>
+ Use the <filename>devtool reset</filename> command to remove a
+ recipe and its configuration (e.g. the corresponding
+ <filename>.bbappend</filename> file) from the workspace layer.
+ Realize that this command deletes the recipe and the
+ append file.
+ The command does not physically move them for you.
+ Consequently, you must be sure to physically relocate your
+ updated recipe and the append file outside of the workspace
+ layer before running the <filename>devtool reset</filename>
+ command.
+ </para>
+
+ <para>
+ If the <filename>devtool reset</filename> command detects that
+ the recipe or the append files have been modified, the
+ command preserves the modified files in a separate "attic"
+ subdirectory under the workspace layer.
+ </para>
+
+ <para>
+ Here is an example that resets the workspace directory that
+ contains the <filename>mtr</filename> recipe:
+ <literallayout class='monospaced'>
+ $ devtool reset mtr
+ NOTE: Cleaning sysroot for recipe mtr...
+ NOTE: Leaving source tree /home/scottrif/poky/build/workspace/sources/mtr as-is; if you no
+ longer need it then please delete it manually
+ $
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-building-your-recipe'>
+ <title>Building Your Recipe</title>
+
+ <para>
+ Use the <filename>devtool build</filename> command to cause the
+ OpenEmbedded build system to build your recipe.
+ The <filename>devtool build</filename> command is equivalent to
+ <filename>bitbake -c populate_sysroot</filename>.
+ </para>
+
+ <para>
+ When you use the <filename>devtool build</filename> command,
+ you must supply the root name of the recipe (i.e. no version,
+ paths, or extensions).
+ You can use either the "-s" or the "--disable-parallel-make"
+ option to disable parallel makes during the build.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ devtool build <replaceable>recipe</replaceable>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-building-your-image'>
+ <title>Building Your Image</title>
+
+ <para>
+ Use the <filename>devtool build-image</filename> command
+ to build an image, extending it to include packages from
+ recipes in the workspace.
+ Using this command is useful when you want an image that
+ ready for immediate deployment onto a device for testing.
+ For proper integration into a final image, you need to
+ edit your custom image recipe appropriately.
+ </para>
+
+ <para>
+ When you use the <filename>devtool build-image</filename>
+ command, you must supply the name of the image.
+ This command has no command line options:
+ <literallayout class='monospaced'>
+ $ devtool build-image <replaceable>image</replaceable>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-deploying-your-software-on-the-target-machine'>
+ <title>Deploying Your Software on the Target Machine</title>
+
+ <para>
+ Use the <filename>devtool deploy-target</filename> command to
+ deploy the recipe's build output to the live target machine:
+ <literallayout class='monospaced'>
+ $ devtool deploy-target <replaceable>recipe</replaceable>&nbsp;<replaceable>target</replaceable>
+ </literallayout>
+ The <replaceable>target</replaceable> is the address of the
+ target machine, which must be running an SSH server (i.e.
+ <filename>user@hostname[:destdir]</filename>).
+ </para>
+
+ <para>
+ This command deploys all files installed during the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task.
+ Furthermore, you do not need to have package management enabled
+ within the target machine.
+ If you do, the package manager is bypassed.
+ <note><title>Notes</title>
+ <para>
+ The <filename>deploy-target</filename>
+ functionality is for development only.
+ You should never use it to update an image that will be
+ used in production.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ Some conditions exist that could prevent a deployed application
+ from behaving as expected.
+ When both of the following conditions exist, your application has
+ the potential to not behave correctly when run on the target:
+ <itemizedlist>
+ <listitem><para>
+ You are deploying a new application to the target and
+ the recipe you used to build the application had
+ correctly defined runtime dependencies.
+ </para></listitem>
+ <listitem><para>
+ The target does not physically have the packages on which
+ the application depends installed.
+ </para></listitem>
+ </itemizedlist>
+ If both of these conditions exist, your application will not
+ behave as expected.
+ The reason for this misbehavior is because the
+ <filename>devtool deploy-target</filename> command does not deploy
+ the packages (e.g. libraries) on which your new application
+ depends.
+ The assumption is that the packages are already on the target.
+ Consequently, when a runtime call is made in the application
+ for a dependent function (e.g. a library call), the function
+ cannot be found.
+ </para>
+
+ <para>
+ To be sure you have all the dependencies local to the target, you
+ need to be sure that the packages are pre-deployed (installed)
+ on the target before attempting to run your application.
+ </para>
+ </section>
+
+ <section id='devtool-removing-your-software-from-the-target-machine'>
+ <title>Removing Your Software from the Target Machine</title>
+
+ <para>
+ Use the <filename>devtool undeploy-target</filename> command to
+ remove deployed build output from the target machine.
+ For the <filename>devtool undeploy-target</filename> command to
+ work, you must have previously used the
+ <link linkend='devtool-deploying-your-software-on-the-target-machine'><filename>devtool deploy-target</filename></link>
+ command.
+ <literallayout class='monospaced'>
+ $ devtool undeploy-target <replaceable>recipe</replaceable>&nbsp;<replaceable>target</replaceable>
+ </literallayout>
+ The <replaceable>target</replaceable> is the address of the
+ target machine, which must be running an SSH server (i.e.
+ <filename>user@hostname</filename>).
+ </para>
+ </section>
+
+ <section id='devtool-creating-the-workspace'>
+ <title>Creating the Workspace Layer in an Alternative Location</title>
+
+ <para>
+ Use the <filename>devtool create-workspace</filename> command to
+ create a new workspace layer in your
+ <link linkend='build-directory'>Build Directory</link>.
+ When you create a new workspace layer, it is populated with the
+ <filename>README</filename> file and the
+ <filename>conf</filename> directory only.
+ </para>
+
+ <para>
+ The following example creates a new workspace layer in your
+ current working and by default names the workspace layer
+ "workspace":
+ <literallayout class='monospaced'>
+ $ devtool create-workspace
+ </literallayout>
+ </para>
+
+ <para>
+ You can create a workspace layer anywhere by supplying
+ a pathname with the command.
+ The following command creates a new workspace layer named
+ "new-workspace":
+ <literallayout class='monospaced'>
+ $ devtool create-workspace /home/scottrif/new-workspace
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-get-the-status-of-the-recipes-in-your-workspace'>
+ <title>Get the Status of the Recipes in Your Workspace</title>
+
+ <para>
+ Use the <filename>devtool status</filename> command to
+ list the recipes currently in your workspace.
+ Information includes the paths to their respective
+ external source trees.
+ </para>
+
+ <para>
+ The <filename>devtool status</filename> command has no
+ command-line options:
+ <literallayout class='monospaced'>
+ $ devtool status
+ </literallayout>
+ Following is sample output after using
+ <link linkend='devtool-adding-a-new-recipe-to-the-workspace'><filename>devtool add</filename></link>
+ to create and add the <filename>mtr_0.86.bb</filename> recipe
+ to the <filename>workspace</filename> directory:
+ <literallayout class='monospaced'>
+ $ devtool status
+ mtr: /home/scottrif/poky/build/workspace/sources/mtr (/home/scottrif/poky/build/workspace/recipes/mtr/mtr_0.86.bb)
+ $
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='devtool-search-for-available-target-recipes'>
+ <title>Search for Available Target Recipes</title>
+
+ <para>
+ Use the <filename>devtool search</filename> command to
+ search for available target recipes.
+ The command matches the recipe name, package name,
+ description, and installed files.
+ The command displays the recipe name as a result of a
+ match.
+ </para>
+
+ <para>
+ When you use the <filename>devtool search</filename> command,
+ you must supply a <replaceable>keyword</replaceable>.
+ The command uses the <replaceable>keyword</replaceable> when
+ searching for a match.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-features.xml b/poky/documentation/ref-manual/ref-features.xml
new file mode 100644
index 000000000..cb74df6da
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-features.xml
@@ -0,0 +1,482 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-features'>
+ <title>Features</title>
+
+ <para>
+ This chapter provides a reference of shipped machine and distro features
+ you can include as part of your image, a reference on image features you can
+ select, and a reference on feature backfilling.
+ </para>
+
+ <para>
+ Features provide a mechanism for working out which packages
+ should be included in the generated images.
+ Distributions can select which features they want to support through the
+ <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename>
+ variable, which is set or appended to in a distribution's configuration file such as
+ <filename>poky.conf</filename>,
+ <filename>poky-tiny.conf</filename>,
+ <filename>poky-lsb.conf</filename> and so forth.
+ Machine features are set in the
+ <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename>
+ variable, which is set in the machine configuration file and
+ specifies the hardware features for a given machine.
+ </para>
+
+ <para>
+ These two variables combine to work out which kernel modules,
+ utilities, and other packages to include.
+ A given distribution can support a selected subset of features so some machine features might not
+ be included if the distribution itself does not support them.
+ </para>
+
+ <para>
+ One method you can use to determine which recipes are checking to see if a
+ particular feature is contained or not is to <filename>grep</filename> through
+ the <link linkend='metadata'>Metadata</link>
+ for the feature.
+ Here is an example that discovers the recipes whose build is potentially
+ changed based on a given feature:
+ <literallayout class='monospaced'>
+ $ cd poky
+ $ git grep 'contains.*MACHINE_FEATURES.*<replaceable>feature</replaceable>'
+ </literallayout>
+ </para>
+
+ <section id='ref-features-machine'>
+ <title>Machine Features</title>
+
+ <para>
+ The items below are features you can use with
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>.
+ Features do not have a one-to-one correspondence to packages, and they can
+ go beyond simply controlling the installation of a package or packages.
+ Sometimes a feature can influence how certain recipes are built.
+ For example, a feature might determine whether a particular configure option
+ is specified within the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task for a particular recipe.
+ </para>
+
+ <para>
+ This feature list only represents features as shipped with the Yocto Project metadata:
+ <itemizedlist>
+ <listitem><para><emphasis>acpi:</emphasis> Hardware has ACPI (x86/x86_64 only)
+ </para></listitem>
+ <listitem><para><emphasis>alsa:</emphasis> Hardware has ALSA audio drivers
+ </para></listitem>
+ <listitem><para><emphasis>apm:</emphasis> Hardware uses APM (or APM emulation)
+ </para></listitem>
+ <listitem><para><emphasis>bluetooth:</emphasis> Hardware has integrated BT
+ </para></listitem>
+ <listitem><para><emphasis>efi:</emphasis> Support for booting through EFI
+ </para></listitem>
+ <listitem><para><emphasis>ext2:</emphasis> Hardware HDD or Microdrive
+ </para></listitem>
+ <listitem><para><emphasis>irda:</emphasis> Hardware has IrDA support
+ </para></listitem>
+ <listitem><para><emphasis>keyboard:</emphasis> Hardware has a keyboard
+ </para></listitem>
+ <listitem><para><emphasis>pcbios:</emphasis> Support for booting through BIOS
+ </para></listitem>
+ <listitem><para><emphasis>pci:</emphasis> Hardware has a PCI bus
+ </para></listitem>
+ <listitem><para><emphasis>pcmcia:</emphasis> Hardware has PCMCIA or CompactFlash sockets
+ </para></listitem>
+ <listitem><para><emphasis>phone:</emphasis> Mobile phone (voice) support
+ </para></listitem>
+ <listitem><para><emphasis>qvga:</emphasis> Machine has a QVGA (320x240) display
+ </para></listitem>
+ <listitem><para><emphasis>rtc:</emphasis> Machine has a Real-Time Clock
+ </para></listitem>
+ <listitem><para><emphasis>screen:</emphasis> Hardware has a screen
+ </para></listitem>
+ <listitem><para><emphasis>serial:</emphasis> Hardware has serial support (usually RS232)
+ </para></listitem>
+ <listitem><para><emphasis>touchscreen:</emphasis> Hardware has a touchscreen
+ </para></listitem>
+ <listitem><para><emphasis>usbgadget:</emphasis> Hardware is USB gadget device capable
+ </para></listitem>
+ <listitem><para><emphasis>usbhost:</emphasis> Hardware is USB Host capable
+ </para></listitem>
+ <listitem><para><emphasis>vfat:</emphasis> FAT file system support
+ </para></listitem>
+ <listitem><para><emphasis>wifi:</emphasis> Hardware has integrated WiFi
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-features-distro'>
+ <title>Distro Features</title>
+
+ <para>
+ The items below are features you can use with
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ to enable features across your distribution.
+ Features do not have a one-to-one correspondence to packages,
+ and they can go beyond simply controlling the installation of a
+ package or packages.
+ In most cases, the presence or absence of a feature translates to
+ the appropriate option supplied to the configure script during the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task for the recipes that optionally
+ support the feature.
+ </para>
+
+ <para>
+ Some distro features are also machine features.
+ These select features make sense to be controlled both at
+ the machine and distribution configuration level.
+ See the
+ <link linkend='var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></link>
+ variable for more information.
+ </para>
+
+ <para>
+ This list only represents features as shipped with the Yocto Project metadata:
+ <itemizedlist>
+ <listitem><para><emphasis>alsa:</emphasis> Include ALSA support
+ (OSS compatibility kernel modules installed if available).
+ </para></listitem>
+ <listitem><para><emphasis>api-documentation:</emphasis>
+ Enables generation of API documentation during recipe
+ builds.
+ The resulting documentation is added to SDK tarballs
+ when the
+ <filename>bitbake -c populate_sdk</filename> command
+ is used.
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#adding-api-documentation-to-the-standard-sdk'>Adding API Documentation to the Standard SDK</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual.
+ </para></listitem>
+ <listitem><para><emphasis>bluetooth:</emphasis> Include
+ bluetooth support (integrated BT only).</para></listitem>
+ <listitem><para><emphasis>bluez5:</emphasis> Include
+ BlueZ Version 5, which provides core Bluetooth layers and
+ protocols support.
+ <note>
+ The default value for the
+ <filename>DISTRO FEATURES</filename> variable includes
+ "bluetooth", which causes bluez5 to be backfilled in
+ for bluetooth support.
+ If you do not want bluez5 backfilled and would rather
+ use bluez4, you need to use the
+ <link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link>
+ variable as follows:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_BACKFILL_CONSIDERED = "bluez5"
+ </literallayout>
+ Setting this variable tells the OpenEmbedded build
+ system that you have considered but ruled
+ out using the bluez5 feature and that bluez4 will be
+ used.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>cramfs:</emphasis> Include CramFS
+ support.</para></listitem>
+ <listitem><para><emphasis>directfb:</emphasis>
+ Include DirectFB support.
+ </para></listitem>
+ <listitem><para><emphasis>ext2:</emphasis> Include tools for
+ supporting for devices with internal HDD/Microdrive for
+ storing files (instead of Flash only devices).
+ </para></listitem>
+ <listitem><para><emphasis>ipsec:</emphasis> Include IPSec
+ support.</para></listitem>
+ <listitem><para><emphasis>ipv6:</emphasis> Include IPv6 support.
+ </para></listitem>
+ <listitem><para><emphasis>irda:</emphasis> Include IrDA support.
+ </para></listitem>
+ <listitem><para><emphasis>keyboard:</emphasis> Include keyboard
+ support (e.g. keymaps will be loaded during boot).
+ </para></listitem>
+ <listitem><para><emphasis>ldconfig:</emphasis>
+ Include support for ldconfig and
+ <filename>ld.so.conf</filename> on the target.
+ </para></listitem>
+ <listitem><para><emphasis>nfs:</emphasis> Include NFS client
+ support (for mounting NFS exports on device).
+ </para></listitem>
+ <listitem><para><emphasis>opengl:</emphasis>
+ Include the Open Graphics Library, which is a
+ cross-language, multi-platform application programming
+ interface used for rendering two and three-dimensional
+ graphics.</para></listitem>
+ <listitem><para><emphasis>pci:</emphasis> Include PCI bus
+ support.</para></listitem>
+ <listitem><para><emphasis>pcmcia:</emphasis> Include
+ PCMCIA/CompactFlash support.</para></listitem>
+ <listitem><para><emphasis>ppp:</emphasis> Include PPP dialup
+ support.</para></listitem>
+ <listitem><para><emphasis>ptest:</emphasis> Enables building
+ the package tests where supported by individual recipes.
+ For more information on package tests, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Testing Packages With ptest</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para><emphasis>smbfs:</emphasis> Include SMB networks
+ client support (for mounting Samba/Microsoft Windows shares
+ on device).</para></listitem>
+ <listitem><para><emphasis>systemd:</emphasis> Include support
+ for this <filename>init</filename> manager, which is a full
+ replacement of for <filename>init</filename> with parallel
+ starting of services, reduced shell overhead, and other
+ features.
+ This <filename>init</filename> manager is used by many
+ distributions.</para></listitem>
+ <listitem><para><emphasis>usbgadget:</emphasis> Include USB
+ Gadget Device support (for USB networking/serial/storage).
+ </para></listitem>
+ <listitem><para><emphasis>usbhost:</emphasis> Include USB Host
+ support (allows to connect external keyboard, mouse,
+ storage, network etc).</para></listitem>
+ <listitem><para><emphasis>wayland:</emphasis> Include the
+ Wayland display server protocol and the library that
+ supports it.</para></listitem>
+ <listitem><para><emphasis>wifi:</emphasis> Include WiFi support
+ (integrated only).</para></listitem>
+ <listitem><para><emphasis>x11:</emphasis> Include the X server
+ and libraries.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-features-image'>
+ <title>Image Features</title>
+
+ <para>
+ The contents of images generated by the OpenEmbedded build system
+ can be controlled by the
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ and
+ <link linkend='var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></link>
+ variables that you typically configure in your image recipes.
+ Through these variables, you can add several different
+ predefined packages such as development utilities or packages with
+ debug information needed to investigate application problems or
+ profile applications.
+ </para>
+
+ <para>
+ The following image features are available for all images:
+ <itemizedlist>
+ <listitem><para><emphasis>allow-empty-password:</emphasis>
+ Allows Dropbear and OpenSSH to accept root logins
+ and logins from accounts having an empty password string.
+ </para></listitem>
+ <listitem><para><emphasis>dbg-pkgs:</emphasis>
+ Installs debug symbol packages for all packages installed
+ in a given image.
+ </para></listitem>
+ <listitem><para><emphasis>debug-tweaks:</emphasis>
+ Makes an image suitable for development (e.g.
+ allows root logins without passwords and enables
+ post-installation logging).
+ See the 'allow-empty-password', 'empty-root-password',
+ and 'post-install-logging' features in this list for
+ additional information.
+ </para></listitem>
+ <listitem><para><emphasis>dev-pkgs:</emphasis>
+ Installs development packages (headers and extra library
+ links) for all packages installed in a given image.
+ </para></listitem>
+ <listitem><para><emphasis>doc-pkgs:</emphasis> Installs
+ documentation packages for all packages installed in a
+ given image.
+ </para></listitem>
+ <listitem><para><emphasis>empty-root-password:</emphasis>
+ Sets the root password to an empty string, which allows
+ logins with a blank password.
+ </para></listitem>
+ <listitem><para><emphasis>package-management:</emphasis>
+ Installs package management tools and preserves the package
+ manager database.
+ </para></listitem>
+ <listitem><para><emphasis>post-install-logging:</emphasis>
+ Enables logging postinstall script runs to
+ the <filename>/var/log/postinstall.log</filename> file
+ on first boot of the image on the target system.
+ <note>
+ To make the <filename>/var/log</filename> directory
+ on the target persistent, use the
+ <link linkend='var-VOLATILE_LOG_DIR'><filename>VOLATILE_LOG_DIR</filename></link>
+ variable by setting it to "no".
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>ptest-pkgs:</emphasis>
+ Installs ptest packages for all ptest-enabled recipes.
+ </para></listitem>
+ <listitem><para><emphasis>read-only-rootfs:</emphasis>
+ Creates an image whose root filesystem is read-only.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>Creating a Read-Only Root Filesystem</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ more information.
+ </para></listitem>
+ <listitem><para><emphasis>splash:</emphasis>
+ Enables showing a splash screen during boot.
+ By default, this screen is provided by
+ <filename>psplash</filename>, which does allow
+ customization.
+ If you prefer to use an alternative splash screen package,
+ you can do so by setting the <filename>SPLASH</filename>
+ variable to a different package name (or names) within the
+ image recipe or at the distro configuration level.
+ </para></listitem>
+ <listitem><para><emphasis>staticdev-pkgs:</emphasis>
+ Installs static development packages, which are
+ static libraries (i.e. <filename>*.a</filename> files), for
+ all packages installed in a given image.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Some image features are available only when you inherit the
+ <link linkend='ref-classes-core-image'><filename>core-image</filename></link>
+ class.
+ The current list of these valid features is as follows:
+ <itemizedlist>
+ <listitem><para><emphasis>eclipse-debug:</emphasis> Provides
+ Eclipse remote debugging support.
+ </para></listitem>
+ <listitem><para><emphasis>hwcodecs:</emphasis> Installs
+ hardware acceleration codecs.
+ </para></listitem>
+ <listitem><para><emphasis>nfs-server:</emphasis>
+ Installs an NFS server.
+ </para></listitem>
+ <listitem><para><emphasis>perf:</emphasis>
+ Installs profiling tools such as
+ <filename>perf</filename>, <filename>systemtap</filename>,
+ and <filename>LTTng</filename>.
+ For general information on user-space tools, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para></listitem>
+ <listitem><para><emphasis>ssh-server-dropbear:</emphasis>
+ Installs the Dropbear minimal SSH server.
+ </para></listitem>
+ <listitem><para><emphasis>ssh-server-openssh:</emphasis>
+ Installs the OpenSSH SSH server, which is more
+ full-featured than Dropbear.
+ Note that if both the OpenSSH SSH server and the Dropbear
+ minimal SSH server are present in
+ <filename>IMAGE_FEATURES</filename>, then OpenSSH will take
+ precedence and Dropbear will not be installed.
+ </para></listitem>
+ <listitem><para><emphasis>tools-debug:</emphasis>
+ Installs debugging tools such as
+ <filename>strace</filename> and <filename>gdb</filename>.
+ For information on GDB, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-gdb-remotedebug'>Debugging With the GNU Project Debugger (GDB) Remotely</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For information on tracing and profiling, see the
+ <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>tools-sdk:</emphasis>
+ Installs a full SDK that runs on the device.
+ </para></listitem>
+ <listitem><para><emphasis>tools-testapps:</emphasis>
+ Installs device testing tools (e.g. touchscreen debugging).
+ </para></listitem>
+ <listitem><para><emphasis>x11:</emphasis>
+ Installs the X server.
+ </para></listitem>
+ <listitem><para><emphasis>x11-base:</emphasis>
+ Installs the X server with a minimal environment.
+ </para></listitem>
+ <listitem><para><emphasis>x11-sato:</emphasis>
+ Installs the OpenedHand Sato environment.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ </section>
+
+ <section id='ref-features-backfill'>
+ <title>Feature Backfilling</title>
+
+ <para>
+ Sometimes it is necessary in the OpenEmbedded build system to extend
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>
+ or <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ to control functionality that was previously enabled and not able
+ to be disabled.
+ For these cases, we need to add an
+ additional feature item to appear in one of these variables,
+ but we do not want to force developers who have existing values
+ of the variables in their configuration to add the new feature
+ in order to retain the same overall level of functionality.
+ Thus, the OpenEmbedded build system has a mechanism to
+ automatically "backfill" these added features into existing
+ distro or machine configurations.
+ You can see the list of features for which this is done by
+ finding the
+ <link linkend='var-DISTRO_FEATURES_BACKFILL'><filename>DISTRO_FEATURES_BACKFILL</filename></link>
+ and <link linkend='var-MACHINE_FEATURES_BACKFILL'><filename>MACHINE_FEATURES_BACKFILL</filename></link>
+ variables in the <filename>meta/conf/bitbake.conf</filename> file.
+ </para>
+
+ <para>
+ Because such features are backfilled by default into all
+ configurations as described in the previous paragraph, developers
+ who wish to disable the new features need to be able to selectively
+ prevent the backfilling from occurring.
+ They can do this by adding the undesired feature or features to the
+ <link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename></link>
+ or <link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename></link>
+ variables for distro features and machine features respectively.
+ </para>
+
+ <para>
+ Here are two examples to help illustrate feature backfilling:
+ <itemizedlist>
+ <listitem><para><emphasis>The "pulseaudio" distro feature option</emphasis>:
+ Previously, PulseAudio support was enabled within the Qt and
+ GStreamer frameworks.
+ Because of this, the feature is backfilled and thus
+ enabled for all distros through the
+ <filename>DISTRO_FEATURES_BACKFILL</filename>
+ variable in the <filename>meta/conf/bitbake.conf</filename> file.
+ However, your distro needs to disable the feature.
+ You can disable the feature without affecting
+ other existing distro configurations that need PulseAudio support
+ by adding "pulseaudio" to
+ <filename>DISTRO_FEATURES_BACKFILL_CONSIDERED</filename>
+ in your distro's <filename>.conf</filename> file.
+ Adding the feature to this variable when it also
+ exists in the <filename>DISTRO_FEATURES_BACKFILL</filename>
+ variable prevents the build system from adding the feature to
+ your configuration's <filename>DISTRO_FEATURES</filename>, effectively disabling
+ the feature for that particular distro.</para></listitem>
+ <listitem><para><emphasis>The "rtc" machine feature option</emphasis>:
+ Previously, real time clock (RTC) support was enabled for all
+ target devices.
+ Because of this, the feature is backfilled and thus enabled
+ for all machines through the <filename>MACHINE_FEATURES_BACKFILL</filename>
+ variable in the <filename>meta/conf/bitbake.conf</filename> file.
+ However, your target device does not have this capability.
+ You can disable RTC support for your device without
+ affecting other machines that need RTC support
+ by adding the feature to your machine's
+ <filename>MACHINE_FEATURES_BACKFILL_CONSIDERED</filename>
+ list in the machine's <filename>.conf</filename> file.
+ Adding the feature to this variable when it also
+ exists in the <filename>MACHINE_FEATURES_BACKFILL</filename>
+ variable prevents the build system from adding the feature to
+ your configuration's <filename>MACHINE_FEATURES</filename>, effectively
+ disabling RTC support for that particular machine.</para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
+
+<!--
+vim: expandtab tw=80 ts=4 spell spelllang=en_gb
+-->
diff --git a/poky/documentation/ref-manual/ref-images.xml b/poky/documentation/ref-manual/ref-images.xml
new file mode 100644
index 000000000..1f96186c6
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-images.xml
@@ -0,0 +1,169 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-images'>
+ <title>Images</title>
+
+ <para>
+ The OpenEmbedded build system provides several example
+ images to satisfy different needs.
+ When you issue the <filename>bitbake</filename> command you provide a “top-level†recipe
+ that essentially begins the build for the type of image you want.
+ </para>
+
+ <note>
+ Building an image without GNU General Public License Version 3 (GPLv3),
+ GNU Lesser General Public License Version 3 (LGPLv3), and the
+ GNU Affero General Public License Version 3 (AGPL-3.0) components
+ is only supported for minimal and base images.
+ Furthermore, if you are going to build an image using non-GPLv3 and
+ similarly licensed components, you must make the following changes in
+ the <filename>local.conf</filename> file before using the BitBake
+ command to build the minimal or base image:
+ <literallayout class='monospaced'>
+ 1. Comment out the EXTRA_IMAGE_FEATURES line
+ 2. Set INCOMPATIBLE_LICENSE = "GPL-3.0 LGPL-3.0 AGPL-3.0"
+ </literallayout>
+ </note>
+
+ <para>
+ From within the <filename>poky</filename> Git repository, you can use
+ the following command to display the list of directories within the
+ <link linkend='source-directory'>Source Directory</link>
+ that contain image recipe files:
+ <literallayout class='monospaced'>
+ $ ls meta*/recipes*/images/*.bb
+ </literallayout>
+ </para>
+
+ <para>
+ Following is a list of supported recipes:
+ <itemizedlist>
+ <listitem><para>
+ <filename>build-appliance-image</filename>:
+ An example virtual machine that contains all the pieces
+ required to run builds using the build system as well as the
+ build system itself.
+ You can boot and run the image using either the
+ <ulink url='http://www.vmware.com/products/player/overview.html'>VMware Player</ulink>
+ or
+ <ulink url='http://www.vmware.com/products/workstation/overview.html'>VMware Workstation</ulink>.
+ For more information on this image, see the
+ <ulink url='&YOCTO_HOME_URL;/software-item/build-appliance/'>Build Appliance</ulink>
+ page on the Yocto Project website.
+ </para></listitem>
+ <listitem><para><filename>core-image-base</filename>:
+ A console-only image that fully supports the target device hardware.</para></listitem>
+ <listitem><para><filename>core-image-clutter</filename>:
+ An image with support for the Open GL-based toolkit Clutter, which enables development of
+ rich and animated graphical user interfaces.</para></listitem>
+ <listitem><para><filename>core-image-full-cmdline</filename>:
+ A console-only image with more full-featured Linux system
+ functionality installed.</para></listitem>
+ <listitem><para><filename>core-image-lsb</filename>:
+ An image that conforms to the Linux Standard Base (LSB)
+ specification.
+ This image requires a distribution configuration that
+ enables LSB compliance (e.g. <filename>poky-lsb</filename>).
+ If you build <filename>core-image-lsb</filename> without that
+ configuration, the image will not be LSB-compliant.
+ </para></listitem>
+ <listitem><para><filename>core-image-lsb-dev</filename>:
+ A <filename>core-image-lsb</filename> image that is suitable for development work
+ using the host.
+ The image includes headers and libraries you can use in a host development
+ environment.
+ This image requires a distribution configuration that
+ enables LSB compliance (e.g. <filename>poky-lsb</filename>).
+ If you build <filename>core-image-lsb-dev</filename> without that
+ configuration, the image will not be LSB-compliant.
+ </para></listitem>
+ <listitem><para><filename>core-image-lsb-sdk</filename>:
+ A <filename>core-image-lsb</filename> that includes everything in
+ the cross-toolchain but also includes development headers and libraries
+ to form a complete standalone SDK.
+ This image requires a distribution configuration that
+ enables LSB compliance (e.g. <filename>poky-lsb</filename>).
+ If you build <filename>core-image-lsb-sdk</filename> without that
+ configuration, the image will not be LSB-compliant.
+ This image is suitable for development using the target.</para></listitem>
+ <listitem><para><filename>core-image-minimal</filename>:
+ A small image just capable of allowing a device to boot.</para></listitem>
+ <listitem><para><filename>core-image-minimal-dev</filename>:
+ A <filename>core-image-minimal</filename> image suitable for development work
+ using the host.
+ The image includes headers and libraries you can use in a host development
+ environment.
+ </para></listitem>
+ <listitem><para id='images-core-image-minimal-initramfs'><filename>core-image-minimal-initramfs</filename>:
+ A <filename>core-image-minimal</filename> image that has the Minimal RAM-based
+ Initial Root Filesystem (initramfs) as part of the kernel,
+ which allows the system to find the first “init†program more efficiently.
+ See the
+ <link linkend='var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></link>
+ variable for additional information helpful when working with
+ initramfs images.
+ </para></listitem>
+ <listitem><para><filename>core-image-minimal-mtdutils</filename>:
+ A <filename>core-image-minimal</filename> image that has support
+ for the Minimal MTD Utilities, which let the user interact with the
+ MTD subsystem in the kernel to perform operations on flash devices.
+ </para></listitem>
+ <listitem><para><filename>core-image-rt</filename>:
+ A <filename>core-image-minimal</filename> image plus a real-time test suite and
+ tools appropriate for real-time use.</para></listitem>
+ <listitem><para><filename>core-image-rt-sdk</filename>:
+ A <filename>core-image-rt</filename> image that includes everything in
+ the cross-toolchain.
+ The image also includes development headers and libraries to form a complete
+ stand-alone SDK and is suitable for development using the target.
+ </para></listitem>
+ <listitem><para><filename>core-image-sato</filename>:
+ An image with Sato support, a mobile environment and visual style that works well
+ with mobile devices.
+ The image supports X11 with a Sato theme and applications such as
+ a terminal, editor, file manager, media player, and so forth.
+ </para></listitem>
+ <listitem><para><filename>core-image-sato-dev</filename>:
+ A <filename>core-image-sato</filename> image suitable for development
+ using the host.
+ The image includes libraries needed to build applications on the device itself,
+ testing and profiling tools, and debug symbols.
+ This image was formerly <filename>core-image-sdk</filename>.
+ </para></listitem>
+ <listitem><para><filename>core-image-sato-sdk</filename>:
+ A <filename>core-image-sato</filename> image that includes everything in
+ the cross-toolchain.
+ The image also includes development headers and libraries to form a complete standalone SDK
+ and is suitable for development using the target.</para></listitem>
+ <listitem><para><filename>core-image-testmaster</filename>:
+ A "master" image designed to be used for automated runtime testing.
+ Provides a "known good" image that is deployed to a separate
+ partition so that you can boot into it and use it to deploy a
+ second image to be tested.
+ You can find more information about runtime testing in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para><filename>core-image-testmaster-initramfs</filename>:
+ A RAM-based Initial Root Filesystem (initramfs) image tailored for
+ use with the <filename>core-image-testmaster</filename> image.
+ </para></listitem>
+ <listitem><para><filename>core-image-weston</filename>:
+ A very basic Wayland image with a terminal.
+ This image provides the Wayland protocol libraries and the
+ reference Weston compositor.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-using-wayland-and-weston'>Using Wayland and Weston</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para><filename>core-image-x11</filename>:
+ A very basic X11 image with a terminal.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-kickstart.xml b/poky/documentation/ref-manual/ref-kickstart.xml
new file mode 100644
index 000000000..a58f9d7c9
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-kickstart.xml
@@ -0,0 +1,334 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-kickstart'>
+<title>OpenEmbedded Kickstart (<filename>.wks</filename>) Reference</title>
+
+ <section id='openembedded-kickstart-wks-reference'>
+ <title>Introduction</title>
+
+ <para>
+ The current Wic implementation supports only the basic kickstart
+ partitioning commands:
+ <filename>partition</filename> (or <filename>part</filename>
+ for short) and <filename>bootloader</filename>.
+ <note>
+ Future updates will implement more commands and options.
+ If you use anything that is not specifically supported, results
+ can be unpredictable.
+ </note>
+ </para>
+
+ <para>
+ This chapter provides a reference on the available kickstart
+ commands.
+ The information lists the commands, their syntax, and meanings.
+ Kickstart commands are based on the Fedora kickstart versions but
+ with modifications to reflect Wic capabilities.
+ You can see the original documentation for those commands at the
+ following link:
+ <literallayout class='monospaced'>
+ <ulink url='http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html'>http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html</ulink>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='command-part-or-partition'>
+ <title>Command: part or partition</title>
+
+ <para>
+ Either of these commands creates a partition on the system and uses
+ the following syntax:
+ <literallayout class='monospaced'>
+ part [<replaceable>mntpoint</replaceable>]
+ partition [<replaceable>mntpoint</replaceable>]
+ </literallayout>
+ If you do not provide <replaceable>mntpoint</replaceable>, Wic
+ creates a partition but does not mount it.
+ </para>
+
+ <para>
+ The <filename><replaceable>mntpoint</replaceable></filename> is
+ where the partition is mounted and must be in one of the
+ following forms:
+ <itemizedlist>
+ <listitem><para>
+ <filename>/<replaceable>path</replaceable></filename>:
+ For example, "/", "/usr", or "/home"
+ </para></listitem>
+ <listitem><para>
+ <filename>swap</filename>:
+ The created partition is used as swap space
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Specifying a <replaceable>mntpoint</replaceable> causes the
+ partition to automatically be mounted.
+ Wic achieves this by adding entries to the filesystem table (fstab)
+ during image generation.
+ In order for Wic to generate a valid fstab, you must also provide
+ one of the <filename>--ondrive</filename>,
+ <filename>--ondisk</filename>, or
+ <filename>--use-uuid</filename> partition options as part of the
+ command.
+ <note>
+ The mount program must understand the PARTUUID syntax you use
+ with <filename>--use-uuid</filename> and non-root
+ <replaceable>mountpoint</replaceable>, including swap.
+ The busybox versions of these application are currently
+ excluded.
+ </note>
+ Here is an example that uses "/" as the
+ <replaceable>mountpoint</replaceable>.
+ The command uses <filename>--ondisk</filename> to force the
+ partition onto the
+ <filename>sdb</filename> disk:
+ <literallayout class='monospaced'>
+ part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024
+ </literallayout>
+ </para>
+
+ <para>
+ Here is a list that describes other supported options you can use
+ with the <filename>part</filename> and
+ <filename>partition</filename> commands:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>--size</filename>:</emphasis>
+ The minimum partition size in MBytes.
+ Specify an integer value such as 500.
+ Do not append the number with "MB".
+ You do not need this option if you use
+ <filename>--source</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--fixed-size</filename>:</emphasis>
+ The exact partition size in MBytes.
+ You cannot specify with <filename>--size</filename>.
+ An error occurs when assembling the disk image if the
+ partition data is larger than
+ <filename>--fixed-size</filename>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--source</filename>:</emphasis>
+ This option is a Wic-specific option that names the source
+ of the data that populates the partition.
+ The most common value for this option is "rootfs", but you
+ can use any value that maps to a valid source plug-in.
+ For information on the source plug-ins, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#wic-using-the-wic-plug-ins-interface'>Using the Wic Plug-Ins Interface</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>If you use <filename>--source rootfs</filename>, Wic
+ creates a partition as large as needed and fills it with
+ the contents of the root filesystem pointed to by the
+ <filename>-r</filename> command-line option or the
+ equivalent rootfs derived from the <filename>-e</filename>
+ command-line option.
+ The filesystem type used to create the partition is driven
+ by the value of the <filename>--fstype</filename> option
+ specified for the partition.
+ See the entry on <filename>--fstype</filename> that follows
+ for more information.</para>
+
+ <para>If you use
+ <filename>--source <replaceable>plugin-name</replaceable></filename>,
+ Wic creates a partition as large as needed and fills it
+ with the contents of the partition that is generated by the
+ specified plug-in name using the data pointed to by the
+ <filename>-r</filename> command-line option or the
+ equivalent rootfs derived from the <filename>-e</filename>
+ command-line option.
+ Exactly what those contents are and filesystem type used are
+ dependent on the given plug-in implementation.
+ </para>
+
+ <para>If you do not use the <filename>--source</filename>
+ option, the <filename>wic</filename> command creates an
+ empty partition.
+ Consequently, you must use the <filename>--size</filename>
+ option to specify the size of the empty partition.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--ondisk</filename> or <filename>--ondrive</filename>:</emphasis>
+ Forces the partition to be created on a particular disk.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--fstype</filename>:</emphasis>
+ Sets the file system type for the partition.
+ Valid values are:
+ <itemizedlist>
+ <listitem><para>
+ <filename>ext4</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>ext3</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>ext2</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>btrfs</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>squashfs</filename>
+ </para></listitem>
+ <listitem><para>
+ <filename>swap</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--fsoptions</filename>:</emphasis>
+ Specifies a free-form string of options to be used when
+ mounting the filesystem.
+ This string is copied into the
+ <filename>/etc/fstab</filename> file of the installed
+ system and should be enclosed in quotes.
+ If not specified, the default string is "defaults".
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--label label</filename>:</emphasis>
+ Specifies the label to give to the filesystem to be made on
+ the partition.
+ If the given label is already in use by another filesystem,
+ a new label is created for the partition.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--active</filename>:</emphasis>
+ Marks the partition as active.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--align (in KBytes)</filename>:</emphasis>
+ This option is a Wic-specific option that says to start
+ partitions on boundaries given
+ <replaceable>x</replaceable> KBytes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--no-table</filename>:</emphasis>
+ This option is a Wic-specific option.
+ Using the option reserves space for the partition and
+ causes it to become populated.
+ However, the partition is not added to the partition table.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--exclude-path</filename>:</emphasis>
+ This option is a Wic-specific option that excludes the given
+ relative path from the resulting image.
+ This option is only effective with the rootfs source
+ plug-in.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--extra-space</filename>:</emphasis>
+ This option is a Wic-specific option that adds extra space
+ after the space filled by the content of the partition.
+ The final size can exceed the size specified by the
+ <filename>--size</filename> option.
+ The default value is 10 Mbytes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--overhead-factor</filename>:</emphasis>
+ This option is a Wic-specific option that multiplies the
+ size of the partition by the option's value.
+ You must supply a value greater than or equal to "1".
+ The default value is "1.3".
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--part-name</filename>:</emphasis>
+ This option is a Wic-specific option that specifies a name
+ for GPT partitions.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--part-type</filename>:</emphasis>
+ This option is a Wic-specific option that specifies the
+ partition type globally unique identifier (GUID) for GPT
+ partitions.
+ You can find the list of partition type GUIDs at
+ <ulink url='http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs'></ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--use-uuid</filename>:</emphasis>
+ This option is a Wic-specific option that causes Wic to
+ generate a random GUID for the partition.
+ The generated identifier is used in the bootloader
+ configuration to specify the root partition.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--uuid</filename>:</emphasis>
+ This option is a Wic-specific option that specifies the
+ partition UUID.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--fsuuid</filename>:</emphasis>
+ This option is a Wic-specific option that specifies the
+ filesystem UUID.
+ You can generate or modify
+ <link linkend='var-WKS_FILE'><filename>WKS_FILE</filename></link>
+ with this option if a preconfigured filesystem UUID is
+ added to the kernel command line in the bootloader
+ configuration before you run Wic.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--system-id</filename>:</emphasis>
+ This option is a Wic-specific option that specifies the
+ partition system ID, which is a one byte long, hexadecimal
+ parameter with or without the 0x prefix.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--mkfs-extraopts</filename>:</emphasis>
+ This option specifies additional options to pass to the
+ <filename>mkfs</filename> utility.
+ Some default options for certain filesystems do not take
+ effect.
+ See Wic's help on kickstart
+ (i.e. <filename>wic help kickstart</filename>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='command-bootloader'>
+ <title>Command: bootloader</title>
+
+ <para>
+ This command specifies how the bootloader should be configured and
+ supports the following options:
+ <note>
+ Bootloader functionality and boot partitions are implemented by
+ the various <filename>--source</filename> plug-ins that
+ implement bootloader functionality.
+ The bootloader command essentially provides a means of
+ modifying bootloader configuration.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>--timeout</filename>:</emphasis>
+ Specifies the number of seconds before the bootloader times
+ out and boots the default option.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--append</filename>:</emphasis>
+ Specifies kernel parameters.
+ These parameters will be added to the syslinux
+ <filename>APPEND</filename> or <filename>grub</filename>
+ kernel command line.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>--configfile</filename>:</emphasis>
+ Specifies a user-defined configuration file for the
+ bootloader.
+ You can provide a full pathname for the file or a file that
+ exists in the <filename>canned-wks</filename> folder.
+ This option overrides all other bootloader options.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-manual-customization.xsl b/poky/documentation/ref-manual/ref-manual-customization.xsl
new file mode 100644
index 000000000..c58dd905b
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-manual-customization.xsl
@@ -0,0 +1,29 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+ <xsl:include href="../template/gloss-permalinks.xsl"/>
+ <xsl:include href="../template/qa-code-permalinks.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'ref-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl b/poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..f3b752155
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/ref-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/ref-manual/ref-manual.xml b/poky/documentation/ref-manual/ref-manual.xml
new file mode 100644
index 000000000..169a31e99
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-manual.xml
@@ -0,0 +1,221 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='ref-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/poky-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Reference Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>4.0+git</revnumber>
+ <date>24 November 2010</date>
+ <revremark>Released with the Yocto Project 0.9 Release</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.0</revnumber>
+ <date>6 April 2011</date>
+ <revremark>Released with the Yocto Project 1.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.0.1</revnumber>
+ <date>23 May 2011</date>
+ <revremark>Released with the Yocto Project 1.0.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.1</revnumber>
+ <date>6 October 2011</date>
+ <revremark>Released with the Yocto Project 1.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.2</revnumber>
+ <date>April 2012</date>
+ <revremark>Released with the Yocto Project 1.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.3</revnumber>
+ <date>October 2012</date>
+ <revremark>Released with the Yocto Project 1.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.4</revnumber>
+ <date>April 2013</date>
+ <revremark>Released with the Yocto Project 1.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5</revnumber>
+ <date>October 2013</date>
+ <revremark>Released with the Yocto Project 1.5 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.5.1</revnumber>
+ <date>January 2014</date>
+ <revremark>Released with the Yocto Project 1.5.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.6</revnumber>
+ <date>April 2014</date>
+ <revremark>Released with the Yocto Project 1.6 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.7</revnumber>
+ <date>October 2014</date>
+ <revremark>Released with the Yocto Project 1.7 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Reference Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="ref-system-requirements.xml"/>
+
+ <xi:include href="ref-terms.xml"/>
+
+ <xi:include href="ref-release-process.xml"/>
+
+ <xi:include href="migration.xml"/>
+
+ <xi:include href="ref-structure.xml"/>
+
+ <xi:include href="ref-classes.xml"/>
+
+ <xi:include href="ref-tasks.xml"/>
+
+ <xi:include href="ref-devtool-reference.xml"/>
+
+ <xi:include href="ref-kickstart.xml"/>
+
+ <xi:include href="ref-qa-checks.xml"/>
+
+ <xi:include href="ref-images.xml"/>
+
+ <xi:include href="ref-features.xml"/>
+
+ <xi:include href="ref-variables.xml"/>
+
+ <xi:include href="ref-varlocality.xml"/>
+
+ <xi:include href="faq.xml"/>
+
+ <xi:include href="resources.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-qa-checks.xml b/poky/documentation/ref-manual/ref-qa-checks.xml
new file mode 100644
index 000000000..515106ae6
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-qa-checks.xml
@@ -0,0 +1,1199 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-qa-checks'>
+<title>QA Error and Warning Messages</title>
+
+<section id='qa-introduction'>
+ <title>Introduction</title>
+
+ <para>
+ When building a recipe, the OpenEmbedded build system performs
+ various QA checks on the output to ensure that common issues are
+ detected and reported.
+ Sometimes when you create a new recipe to build new software,
+ it will build with no problems.
+ When this is not the case, or when you have QA issues building any
+ software, it could take a little time to resolve them.
+ </para>
+
+ <para>
+ While it is tempting to ignore a QA message or even to
+ disable QA checks, it is best to try and resolve any
+ reported QA issues.
+ This chapter provides a list of the QA messages and brief explanations
+ of the issues you could encounter so that you can properly resolve
+ problems.
+ </para>
+
+ <para>
+ The next section provides a list of all QA error and warning
+ messages based on a default configuration.
+ Each entry provides the message or error form along with an
+ explanation.
+ <note>
+ <title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ At the end of each message, the name of the associated
+ QA test (as listed in the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section) appears within square brackets.
+ </para></listitem>
+ <listitem><para>
+ As mentioned, this list of error and warning messages is for
+ QA checks only.
+ The list does not cover all possible build errors or
+ warnings you could encounter.
+ </para></listitem>
+ <listitem><para>
+ Because some QA checks are disabled by default, this list
+ does not include all possible QA check errors and warnings.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+</section>
+
+<section id='qa-errors-and-warnings'>
+ <title>Errors and Warnings</title>
+
+<!--
+This section uses the <para><code> construct to enable permalinks for the
+various QA issue and warning messages. The file templates/qa-code-permalinks.xsl
+is used to locate the construct and generate the permalink. This solution
+leverages the fact that right now this section in the ref-manual is the only
+place is all the YP docs that uses the <para><code> construct. If, in the
+future, that construct were to appear in the ref-manual, a generic permalink
+would be generated for the text between <code></code>. If a better solution
+can be found then it should be implemented. I can't find one at the moment.
+-->
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-libexec'>
+ <code>
+ &lt;packagename&gt;: &lt;path&gt; is using libexec please relocate to &lt;libexecdir&gt; [libexec]
+ </code>
+ </para>
+
+ <para>
+ The specified package contains files in
+ <filename>/usr/libexec</filename> when the distro
+ configuration uses a different path for
+ <filename>&lt;libexecdir&gt;</filename>
+ By default, <filename>&lt;libexecdir&gt;</filename> is
+ <filename>$prefix/libexec</filename>.
+ However, this default can be changed (e.g.
+ <filename>${libdir}</filename>).
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-rpaths'>
+ <code>
+ package &lt;packagename&gt; contains bad RPATH &lt;rpath&gt; in file &lt;file&gt; [rpaths]
+ </code>
+ </para>
+
+ <para>
+ The specified binary produced by the recipe contains dynamic
+ library load paths (rpaths) that contain build system paths
+ such as
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
+ which are incorrect for the target and could potentially
+ be a security issue.
+ Check for bad <filename>-rpath</filename> options being
+ passed to the linker in your
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ log.
+ Depending on the build system used by the software being
+ built, there might be a configure option to disable rpath
+ usage completely within the build of the software.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-useless-rpaths'>
+ <code>
+ &lt;packagename&gt;: &lt;file&gt; contains probably-redundant RPATH &lt;rpath&gt; [useless-rpaths]
+ </code>
+ </para>
+
+ <para>
+ The specified binary produced by the recipe contains dynamic
+ library load paths (rpaths) that on a standard system are
+ searched by default by the linker (e.g.
+ <filename>/lib</filename> and <filename>/usr/lib</filename>).
+ While these paths will not cause any breakage, they do waste
+ space and are unnecessary.
+ Depending on the build system used by the software being
+ built, there might be a configure option to disable rpath
+ usage completely within the build of the software.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-file-rdeps'>
+ <code>
+ &lt;packagename&gt; requires &lt;files&gt;, but no providers in its RDEPENDS [file-rdeps]
+ </code>
+ </para>
+
+ <para>
+ A file-level dependency has been identified from the
+ specified package on the specified files, but there is
+ no explicit corresponding entry in
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>.
+ If particular files are required at runtime then
+ <filename>RDEPENDS</filename> should be declared in the
+ recipe to ensure the packages providing them are built.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-build-deps'>
+ <code>
+ &lt;packagename1&gt; rdepends on &lt;packagename2&gt;, but it isn't a build dependency? [build-deps]
+ </code>
+ </para>
+
+ <para>
+ A runtime dependency exists between the two specified
+ packages, but there is nothing explicit within the recipe
+ to enable the OpenEmbedded build system to ensure that
+ dependency is satisfied.
+ This condition is usually triggered by an
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ value being added at the packaging stage rather than up
+ front, which is usually automatic based on the contents of
+ the package.
+ In most cases, you should change the recipe to add an
+ explicit <filename>RDEPENDS</filename> for the dependency.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-dev-so'>
+ <code>
+ non -dev/-dbg/nativesdk- package contains symlink .so: &lt;packagename&gt; path '&lt;path&gt;' [dev-so]
+ </code>
+ </para>
+
+ <para>
+ Symlink <filename>.so</filename> files are for development
+ only, and should therefore go into the
+ <filename>-dev</filename> package.
+ This situation might occur if you add
+ <filename>*.so*</filename> rather than
+ <filename>*.so.*</filename> to a non-dev package.
+ Change
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ (and possibly
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>)
+ such that the specified <filename>.so</filename> file goes
+ into an appropriate <filename>-dev</filename> package.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-staticdev'>
+ <code>
+ non -staticdev package contains static .a library: &lt;packagename&gt; path '&lt;path&gt;' [staticdev]
+ </code>
+ </para>
+
+ <para>
+ Static <filename>.a</filename> library files should go into
+ a <filename>-staticdev</filename> package.
+ Change
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ (and possibly
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>)
+ such that the specified <filename>.a</filename> file goes
+ into an appropriate <filename>-staticdev</filename> package.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-libdir'>
+ <code>
+ &lt;packagename&gt;: found library in wrong location [libdir]
+ </code>
+ </para>
+
+ <para>
+ The specified file may have been installed into an incorrect
+ (possibly hardcoded) installation path.
+ For example, this test will catch recipes that install
+ <filename>/lib/bar.so</filename> when
+ <filename>${base_libdir}</filename> is "lib32".
+ Another example is when recipes install
+ <filename>/usr/lib64/foo.so</filename> when
+ <filename>${libdir}</filename> is "/usr/lib".
+ False positives occasionally exist.
+ For these cases add "libdir" to
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>
+ for the package.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-debug-files'>
+ <code>
+ non debug package contains .debug directory: &lt;packagename&gt; path &lt;path&gt; [debug-files]
+ </code>
+ </para>
+
+ <para>
+ The specified package contains a
+ <filename>.debug</filename> directory, which should not
+ appear in anything but the <filename>-dbg</filename>
+ package.
+ This situation might occur if you add a path which contains
+ a <filename>.debug</filename> directory and do not
+ explicitly add the <filename>.debug</filename> directory
+ to the <filename>-dbg</filename> package.
+ If this is the case, add the <filename>.debug</filename>
+ directory explicitly to
+ <filename>FILES_${PN}-dbg</filename>.
+ See
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ for additional information on <filename>FILES</filename>.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-arch'>
+ <code>
+ Architecture did not match (&lt;machine_arch&gt; to &lt;file_arch&gt;) on &lt;file&gt; [arch]
+ </code>
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system checks the
+ Executable and Linkable Format (ELF) type, bit size, and
+ endianness of any binaries to ensure they match the
+ target architecture.
+ This test fails if any binaries do not match the type since
+ there would be an incompatibility.
+ The test could indicate that the wrong compiler or compiler
+ options have been used.
+ Sometimes software, like bootloaders, might need to
+ bypass this check.
+ If the file you receive the error for is firmware
+ that is not intended to be executed within the target
+ operating system or is intended to run on a separate
+ processor within the device, you can add "arch" to
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>
+ for the package.
+ Another option is to check the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ log and verify that the compiler options being used
+ are correct.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-arch-bit-size-no-match'>
+ <code>
+ Bit size did not match (&lt;machine_bits&gt; to &lt;file_bits&gt;) &lt;recipe&gt; on &lt;file&gt; [arch]
+ </code>
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system checks
+ the Executable and Linkable Format (ELF) type,
+ bit size, and endianness of any binaries to ensure
+ they match the target architecture.
+ This test fails if any binaries do not match the type since
+ there would be an incompatibility.
+ The test could indicate that the wrong compiler or compiler
+ options have been used.
+ Sometimes software, like bootloaders, might need to
+ bypass this check.
+ If the file you receive the error for is firmware that
+ is not intended to be executed within the target
+ operating system or is intended to run on a separate
+ processor within the device, you can add "arch" to
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>
+ for the package.
+ Another option is to check the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ log and verify that the compiler options being used are
+ correct.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-arch-endianness-no-match'>
+ <code>
+ Endianness did not match (&lt;machine_endianness&gt; to &lt;file_endianness&gt;) on &lt;file&gt; [arch]
+ </code>
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system checks
+ the Executable and Linkable Format (ELF) type, bit
+ size, and endianness of any binaries to ensure they
+ match the target architecture.
+ This test fails if any binaries do not match the type since
+ there would be an incompatibility.
+ The test could indicate that the wrong compiler or compiler
+ options have been used.
+ Sometimes software, like bootloaders, might need to
+ bypass this check.
+ If the file you receive the error for is firmware
+ that is not intended to be executed within the target
+ operating system or is intended to run on a separate
+ processor within the device, you can add "arch" to
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>
+ for the package.
+ Another option is to check the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ log and verify that the compiler options being used
+ are correct.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-textrel'>
+ <code>
+ ELF binary '&lt;file&gt;' has relocations in .text [textrel]
+ </code>
+ </para>
+
+ <para>
+ The specified ELF binary contains relocations in its
+ <filename>.text</filename> sections.
+ This situation can result in a performance impact
+ at runtime.
+ </para>
+
+ <para>
+ Typically, the way to solve this performance issue is to
+ add "-fPIC" or "-fpic" to the compiler command-line
+ options.
+ For example, given software that reads
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ when you build it, you could add the following to your
+ recipe:
+ <literallayout class='monospaced'>
+ CFLAGS_append = " -fPIC "
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on text relocations at runtime, see
+ <ulink url='http://www.akkadia.org/drepper/textrelocs.html'></ulink>.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-ldflags'>
+ <code>
+ No GNU_HASH in the elf binary: '&lt;file&gt;' [ldflags]
+ </code>
+ </para>
+
+ <para>
+ This indicates that binaries produced when building the
+ recipe have not been linked with the
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ options provided by the build system.
+ Check to be sure that the <filename>LDFLAGS</filename>
+ variable is being passed to the linker command.
+ A common workaround for this situation is to pass in
+ <filename>LDFLAGS</filename> using
+ <link linkend='var-TARGET_CC_ARCH'><filename>TARGET_CC_ARCH</filename></link>
+ within the recipe as follows:
+ <literallayout class='monospaced'>
+ TARGET_CC_ARCH += "${LDFLAGS}"
+ </literallayout>
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-xorg-driver-abi'>
+ <code>
+ Package &lt;packagename&gt; contains Xorg driver (&lt;driver&gt;) but no xorg-abi- dependencies [xorg-driver-abi]
+ </code>
+ </para>
+
+ <para>
+ The specified package contains an Xorg driver, but does not
+ have a corresponding ABI package dependency.
+ The xserver-xorg recipe provides driver ABI names.
+ All drivers should depend on the ABI versions that they have
+ been built against.
+ Driver recipes that include
+ <filename>xorg-driver-input.inc</filename> or
+ <filename>xorg-driver-video.inc</filename> will
+ automatically get these versions.
+ Consequently, you should only need to explicitly add
+ dependencies to binary driver recipes.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-infodir'>
+ <code>
+ The /usr/share/info/dir file is not meant to be shipped in a particular package. [infodir]
+ </code>
+ </para>
+
+ <para>
+ The <filename>/usr/share/info/dir</filename> should not be
+ packaged.
+ Add the following line to your
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task or to your <filename>do_install_append</filename>
+ within the recipe as follows:
+ <literallayout class='monospaced'>
+ rm ${D}${infodir}/dir
+ </literallayout>
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-symlink-to-sysroot'>
+ <code>
+ Symlink &lt;path&gt; in &lt;packagename&gt; points to TMPDIR [symlink-to-sysroot]
+ </code>
+ </para>
+
+ <para>
+ The specified symlink points into
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ on the host.
+ Such symlinks will work on the host.
+ However, they are clearly invalid when running on
+ the target.
+ You should either correct the symlink to use a relative
+ path or remove the symlink.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-la'>
+ <code>
+ &lt;file&gt; failed sanity test (workdir) in path &lt;path&gt; [la]
+ </code>
+ </para>
+
+ <para>
+ The specified <filename>.la</filename> file contains
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ paths.
+ Any <filename>.la</filename> file containing these paths
+ is incorrect since <filename>libtool</filename> adds the
+ correct sysroot prefix when using the files automatically
+ itself.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-pkgconfig'>
+ <code>
+ &lt;file&gt; failed sanity test (tmpdir) in path &lt;path&gt; [pkgconfig]
+ </code>
+ </para>
+
+ <para>
+ The specified <filename>.pc</filename> file contains
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>/</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ paths.
+ Any <filename>.pc</filename> file containing these paths is
+ incorrect since <filename>pkg-config</filename> itself adds
+ the correct sysroot prefix when the files are accessed.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-debug-deps'>
+ <code>
+ &lt;packagename&gt; rdepends on &lt;debug_packagename&gt; [debug-deps]
+ </code>
+ </para>
+
+ <para>
+ A dependency exists between the specified non-dbg package
+ (i.e. a package whose name does not end in
+ <filename>-dbg</filename>) and a package that is a
+ <filename>dbg</filename> package.
+ The <filename>dbg</filename> packages contain
+ debug symbols and are brought in using several
+ different methods:
+ <itemizedlist>
+ <listitem><para>
+ Using the <filename>dbg-pkgs</filename>
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ value.
+ </para></listitem>
+ <listitem><para>
+ Using
+ <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>.
+ </para></listitem>
+ <listitem><para>
+ As a dependency of another
+ <filename>dbg</filename> package that was brought
+ in using one of the above methods.
+ </para></listitem>
+ </itemizedlist>
+ The dependency might have been automatically added
+ because the <filename>dbg</filename> package erroneously
+ contains files that it should not contain (e.g. a
+ non-symlink <filename>.so</filename> file) or it might
+ have been added manually (e.g. by adding to
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>).
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-dev-deps'>
+ <code>
+ &lt;packagename&gt; rdepends on &lt;dev_packagename&gt; [dev-deps]
+ </code>
+ </para>
+
+ <para>
+ A dependency exists between the specified non-dev package
+ (a package whose name does not end in
+ <filename>-dev</filename>) and a package that is a
+ <filename>dev</filename> package.
+ The <filename>dev</filename> packages contain development
+ headers and are usually brought in using several different
+ methods:
+ <itemizedlist>
+ <listitem><para>
+ Using the <filename>dev-pkgs</filename>
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ value.
+ </para></listitem>
+ <listitem><para>
+ Using
+ <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>.
+ </para></listitem>
+ <listitem><para>
+ As a dependency of another
+ <filename>dev</filename> package that was brought
+ in using one of the above methods.
+ </para></listitem>
+ </itemizedlist>
+ The dependency might have been automatically added (because
+ the <filename>dev</filename> package erroneously contains
+ files that it should not have (e.g. a non-symlink
+ <filename>.so</filename> file) or it might have been added
+ manually (e.g. by adding to
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>).
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-dep-cmp'>
+ <code>
+ &lt;var&gt;_&lt;packagename&gt; is invalid: &lt;comparison&gt; (&lt;value&gt;) only comparisons &lt;, =, &gt;, &lt;=, and &gt;= are allowed [dep-cmp]
+ </code>
+ </para>
+
+ <para>
+ If you are adding a versioned dependency relationship to one
+ of the dependency variables
+ (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
+ <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
+ or
+ <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>),
+ you must only use the named comparison operators.
+ Change the versioned dependency values you are adding
+ to match those listed in the message.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-compile-host-path'>
+ <code>
+ &lt;recipename&gt;: The compile log indicates that host include and/or library paths were used. Please check the log '&lt;logfile&gt;' for more information. [compile-host-path]
+ </code>
+ </para>
+
+ <para>
+ The log for the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ task indicates that paths on the host were searched
+ for files, which is not appropriate when cross-compiling.
+ Look for "is unsafe for cross-compilation" or "CROSS COMPILE
+ Badness" in the specified log file.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-install-host-path'>
+ <code>
+ &lt;recipename&gt;: The install log indicates that host include and/or library paths were used. Please check the log '&lt;logfile&gt;' for more information. [install-host-path]
+ </code>
+ </para>
+
+ <para>
+ The log for the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task indicates that paths on the host were searched
+ for files, which is not appropriate when cross-compiling.
+ Look for "is unsafe for cross-compilation"
+ or "CROSS COMPILE Badness" in the specified log file.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-autoconf-log'>
+ <code>
+ This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities. Rerun configure task after fixing this. The path was '&lt;path&gt;'
+ </code>
+ </para>
+
+ <para>
+ The log for the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task indicates that paths on the host were searched
+ for files, which is not appropriate when cross-compiling.
+ Look for "is unsafe for cross-compilation" or
+ "CROSS COMPILE Badness" in the specified log file.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-pkgname'>
+ <code>
+ &lt;packagename&gt; doesn't match the [a-z0-9.+-]+ regex [pkgname]
+ </code>
+ </para>
+
+ <para>
+ The convention within the OpenEmbedded build system
+ (sometimes enforced by the package manager itself) is to
+ require that package names are all lower case
+ and to allow a restricted set of characters.
+ If your recipe name does not match this, or you add
+ packages to
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ that do not conform to the convention, then you
+ will receive this error.
+ Rename your recipe.
+ Or, if you have added a non-conforming package name to
+ <filename>PACKAGES</filename>, change the package name
+ appropriately.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-unknown-configure-option'>
+ <code>
+ &lt;recipe&gt;: configure was passed unrecognized options: &lt;options&gt; [unknown-configure-option]
+ </code>
+ </para>
+
+ <para>
+ The configure script is reporting that the specified
+ options are unrecognized.
+ This situation could be because the options
+ were previously valid but have been removed from the
+ configure script.
+ Or, there was a mistake when the options were added
+ and there is another option that should be used instead.
+ If you are unsure, consult the upstream build
+ documentation, the
+ <filename>./configure --help</filename> output,
+ and the upstream change log or release notes.
+ Once you have worked out what the appropriate
+ change is, you can update
+ <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>,
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>,
+ or the individual
+ <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
+ option values accordingly.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-pn-overrides'>
+ <code>
+ Recipe &lt;recipefile&gt; has PN of "&lt;recipename&gt;" which is in OVERRIDES, this can result in unexpected behavior. [pn-overrides]
+ </code>
+ </para>
+
+ <para>
+ The specified recipe has a name
+ (<link linkend='var-PN'><filename>PN</filename></link>)
+ value that appears in
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
+ If a recipe is named such that its <filename>PN</filename>
+ value matches something already in
+ <filename>OVERRIDES</filename> (e.g. <filename>PN</filename>
+ happens to be the same as
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ or
+ <link linkend='var-DISTRO'><filename>DISTRO</filename></link>),
+ it can have unexpected consequences.
+ For example, assignments such as
+ <filename>FILES_${PN} = "xyz"</filename> effectively
+ turn into <filename>FILES = "xyz"</filename>.
+ Rename your recipe (or if <filename>PN</filename> is being
+ set explicitly, change the <filename>PN</filename> value) so
+ that the conflict does not occur.
+ See
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ for additional information.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-pkgvarcheck'>
+ <code>
+ &lt;recipefile&gt;: Variable &lt;variable&gt; is set as not being package specific, please fix this. [pkgvarcheck]
+ </code>
+ </para>
+
+ <para>
+ Certain variables
+ (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>,
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>,
+ <link linkend='var-RSUGGESTS'><filename>RSUGGESTS</filename></link>,
+ <link linkend='var-RCONFLICTS'><filename>RCONFLICTS</filename></link>,
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>,
+ <link linkend='var-RREPLACES'><filename>RREPLACES</filename></link>,
+ <link linkend='var-FILES'><filename>FILES</filename></link>,
+ <filename>pkg_preinst</filename>,
+ <filename>pkg_postinst</filename>,
+ <filename>pkg_prerm</filename>,
+ <filename>pkg_postrm</filename>, and
+ <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>)
+ should always be set specific to a package (i.e. they
+ should be set with a package name override such as
+ <filename>RDEPENDS_${PN} = "value"</filename> rather than
+ <filename>RDEPENDS = "value"</filename>).
+ If you receive this error, correct any assignments to these
+ variables within your recipe.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-already-stripped'>
+ <code>
+ File '&lt;file&gt;' from &lt;recipename&gt; was already stripped, this will prevent future debugging! [already-stripped]
+ </code>
+ </para>
+
+ <para>
+ Produced binaries have already been stripped prior to the
+ build system extracting debug symbols.
+ It is common for upstream software projects to default to
+ stripping debug symbols for output binaries.
+ In order for debugging to work on the target using
+ <filename>-dbg</filename> packages, this stripping must be
+ disabled.
+ </para>
+
+ <para>
+ Depending on the build system used by the software being
+ built, disabling this stripping could be as easy as
+ specifying an additional configure option.
+ If not, disabling stripping might involve patching
+ the build scripts.
+ In the latter case, look for references to "strip" or
+ "STRIP", or the "-s" or "-S" command-line options being
+ specified on the linker command line (possibly
+ through the compiler command line if preceded with "-Wl,").
+ <note>
+ Disabling stripping here does not mean that the final
+ packaged binaries will be unstripped.
+ Once the OpenEmbedded build system splits out debug
+ symbols to the <filename>-dbg</filename> package,
+ it will then strip the symbols from the binaries.
+ </note>
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-packages-list'>
+ <code>
+ &lt;packagename&gt; is listed in PACKAGES multiple times, this leads to packaging errors. [packages-list]
+ </code>
+ </para>
+
+ <para>
+ Package names must appear only once in the
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ variable.
+ You might receive this error if you are attempting to add a
+ package to <filename>PACKAGES</filename> that is
+ already in the variable's value.
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-files-invalid'>
+ <code>
+ FILES variable for package &lt;packagename&gt; contains '//' which is invalid. Attempting to fix this but you should correct the metadata. [files-invalid]
+ </code>
+ </para>
+
+ <para>
+ The string "//" is invalid in a Unix path.
+ Correct all occurrences where this string appears in a
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable so that there is only a single "/".
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-installed-vs-shipped'>
+ <code>
+ &lt;recipename&gt;: Files/directories were installed but not shipped in any package [installed-vs-shipped]
+ </code>
+ </para>
+
+ <para>
+ Files have been installed within the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task but have not been included in any package by way of the
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable.
+ Files that do not appear in any package cannot be present in
+ an image later on in the build process.
+ You need to do one of the following:
+ <itemizedlist>
+ <listitem><para>
+ Add the files to <filename>FILES</filename> for the
+ package you want them to appear in (e.g.
+ <filename>FILES_${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename> for the main
+ package).
+ </para></listitem>
+ <listitem><para>
+ Delete the files at the end of the
+ <filename>do_install</filename> task if the files
+ are not needed in any package.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ &nbsp;
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para id='qa-issue-old-and-new-package-and-version-names'>
+ <code>
+ &lt;oldpackage&gt;-&lt;oldpkgversion&gt; was registered as shlib provider for &lt;library&gt;, changing it to &lt;newpackage&gt;-&lt;newpkgversion&gt; because it was built later
+ </code>
+ </para>
+
+ <para>
+ This message means that both
+ <filename>&lt;oldpackage&gt;</filename> and
+ <filename>&lt;newpackage&gt;</filename> provide the specified
+ shared library.
+ You can expect this message when a recipe has been renamed.
+ However, if that is not the case, the message might indicate
+ that a private version of a library is being erroneously
+ picked up as the provider for a common library.
+ If that is the case, you should add the library's
+ <filename>.so</filename> file name to
+ <link linkend='var-PRIVATE_LIBS'><filename>PRIVATE_LIBS</filename></link>
+ in the recipe that provides
+ the private version of the library.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='configuring-and-disabling-qa-checks'>
+ <title>Configuring and Disabling QA Checks</title>
+
+ <para>
+ You can configure the QA checks globally so that specific check
+ failures either raise a warning or an error message, using the
+ <link linkend='var-WARN_QA'><filename>WARN_QA</filename></link> and
+ <link linkend='var-ERROR_QA'><filename>ERROR_QA</filename></link>
+ variables, respectively.
+ You can also disable checks within a particular recipe using
+ <link linkend='var-INSANE_SKIP'><filename>INSANE_SKIP</filename></link>.
+ For information on how to work with the QA checks, see the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section.
+ <note><title>Tip</title>
+ Please keep in mind that the QA checks exist in order to
+ detect real or potential problems in the packaged output.
+ So exercise caution when disabling these checks.
+ </note>
+ </para>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-release-process.xml b/poky/documentation/ref-manual/ref-release-process.xml
new file mode 100644
index 000000000..c665cd938
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-release-process.xml
@@ -0,0 +1,255 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-release-process'>
+<title>Yocto Project Releases and the Stable Release Process</title>
+
+<para>
+ The Yocto Project release process is predictable and consists of both
+ major and minor (point) releases.
+ This brief chapter provides information on how releases are named, their
+ life cycle, and their stability.
+</para>
+
+<section id='major-and-minor-release-cadence'>
+ <title>Major and Minor Release Cadence</title>
+
+ <para>
+ The Yocto Project delivers major releases (e.g. &DISTRO;) using a six
+ month cadence roughly timed each April and October of the year.
+ Following are examples of some major YP releases with their codenames
+ also shown.
+ See the
+ "<link linkend='major-release-codenames'>Major Release Codenames</link>"
+ section for information on codenames used with major releases.
+ <literallayout class='monospaced'>
+ 2.2 (Morty)
+ 2.1 (Krogoth)
+ 2.0 (Jethro)
+ </literallayout>
+ While the cadence is never perfect, this timescale facilitates
+ regular releases that have strong QA cycles while not overwhelming
+ users with too many new releases.
+ The cadence is predictable and avoids many major holidays in various
+ geographies.
+ </para>
+
+ <para>
+ The Yocto project delivers minor (point) releases on an unscheduled
+ basis and are usually driven by the accumulation of enough significant
+ fixes or enhancements to the associated major release.
+ Following are some example past point releases:
+ <literallayout class='monospaced'>
+ 2.1.1
+ 2.1.2
+ 2.2.1
+ </literallayout>
+ The point release indicates a point in the major release branch where
+ a full QA cycle and release process validates the content of the new
+ branch.
+ <note>
+ Realize that there can be patches merged onto the stable release
+ branches as and when they become available.
+ </note>
+ </para>
+</section>
+
+<section id='major-release-codenames'>
+ <title>Major Release Codenames</title>
+
+ <para>
+ Each major release receives a codename that identifies the release in
+ the
+ <ulink url='&YOCTO_DOCS_OM_URL;#yocto-project-repositories'>Yocto Project Source Repositories</ulink>.
+ The concept is that branches of
+ <link linkend='metadata'>Metadata</link>
+ with the same codename are likely to be compatible and thus
+ work together.
+ <note>
+ Codenames are associated with major releases because a Yocto
+ Project release number (e.g. &DISTRO;) could conflict with
+ a given layer or company versioning scheme.
+ Codenames are unique, interesting, and easily identifiable.
+ </note>
+ Releases are given a nominal release version as well but the codename
+ is used in repositories for this reason.
+ You can find information on Yocto Project releases and codenames at
+ <ulink url='https://wiki.yoctoproject.org/wiki/Releases'></ulink>.
+ </para>
+</section>
+
+<section id='stable-release-process'>
+ <title>Stable Release Process</title>
+
+ <para>
+ Once released, the release enters the stable release process at which
+ time a person is assigned as the maintainer for that stable release.
+ This maintainer monitors activity for the release by investigating
+ and handling nominated patches and backport activity.
+ Only fixes and enhancements that have first been applied on the
+ "master" branch (i.e. the current, in-development branch) are
+ considered for backporting to a stable release.
+ <note>
+ The current Yocto Project policy regarding backporting is to
+ consider bug fixes and security fixes only.
+ Policy dictates that features are not backported to a stable
+ release.
+ This policy means generic recipe version upgrades are unlikely to
+ be accepted for backporting.
+ The exception to this policy occurs when a strong reason exists
+ such as the fix happens to also be the preferred upstream approach.
+ </note>
+ </para>
+
+ <para>
+ Stable release branches have strong maintenance for about a year after
+ their initial release.
+ Should significant issues be found for any release regardless of its
+ age, fixes could be backported to older releases.
+ For issues that are not backported given an older release,
+ Community LTS trees and branches exist where
+ community members share patches for older releases.
+ However, these types of patches do not go through the same release
+ process as do point releases.
+ You can find more information about stable branch maintenance at
+ <ulink url='https://wiki.yoctoproject.org/wiki/Stable_branch_maintenance'></ulink>.
+ </para>
+</section>
+
+<section id='testing-and-quality-assurance'>
+ <title>Testing and Quality Assurance</title>
+
+ <para>
+ Part of the Yocto Project development and release process is quality
+ assurance through the execution of test strategies.
+ Test strategies provide the Yocto Project team a way to ensure a
+ release is validated.
+ Additionally, because the test strategies are visible to you as a
+ developer, you can validate your projects.
+ This section overviews the available test infrastructure used in the
+ Yocto Project.
+ For information on how to run available tests on your projects, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ The QA/testing infrastructure is woven into the project to the point
+ where core developers take some of it for granted.
+ The infrastructure consists of the following pieces:
+ <itemizedlist>
+ <listitem><para>
+ <filename>bitbake-selftest</filename>:
+ A standalone command that runs unit tests on key pieces of
+ BitBake and its fetchers.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='ref-classes-sanity'><filename>sanity.bbclass</filename></link>:
+ This automatically included class checks the build environment
+ for missing tools (e.g. <filename>gcc</filename>) or common
+ misconfigurations such as
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ set incorrectly.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>:
+ This class checks the generated output from builds for sanity.
+ For example, if building for an ARM target, did the build
+ produce ARM binaries.
+ If, for example, the build produced PPC binaries then there
+ is a problem.
+ </para></listitem>
+ <listitem><para>
+ <link linkend='ref-classes-testimage*'><filename>testimage.bbclass</filename></link>:
+ This class performs runtime testing of images after they are
+ built.
+ The tests are usually used with
+ <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>QEMU</ulink>
+ to boot the images and check the combined runtime result
+ boot operation and functions.
+ However, the test can also use the IP address of a machine to
+ test.
+ </para></listitem>
+ <listitem><para>
+ <ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'><filename>ptest</filename></ulink>:
+ Runs tests against packages produced during the build for a
+ given piece of software.
+ The test allows the packages to be be run within a target
+ image.
+ </para></listitem>
+ <listitem><para>
+ <filename>oe-selftest</filename>:
+ Tests combination BitBake invocations.
+ These tests operate outside the OpenEmbedded build system
+ itself.
+ The <filename>oe-selftest</filename> can run all tests by
+ default or can run selected tests or test suites.
+ <note>
+ Running <filename>oe-selftest</filename> requires
+ host packages beyond the "Essential" grouping.
+ See the
+ "<link linkend='required-packages-for-the-host-development-system'>Required Packages for the Host Development System</link>"
+ section for more information.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Originally, much of this testing was done manually.
+ However, significant effort has been made to automate the tests so
+ that more people can use them and the Yocto Project development team
+ can run them faster and more efficiently.
+ </para>
+
+ <para>
+ The Yocto Project's main Autobuilder
+ (<filename>autobuilder.yoctoproject.org</filename>) publicly tests
+ each Yocto Project release's code in the
+ <link linkend='oe-core'>OE-Core</link>, Poky, and BitBake
+ repositories.
+ The testing occurs for both the current state of the
+ "master" branch and also for submitted patches.
+ Testing for submitted patches usually occurs in the
+ "ross/mut" branch in the <filename>poky-contrib</filename> repository
+ (i.e. the master-under-test branch) or in the "master-next" branch
+ in the <filename>poky</filename> repository.
+ <note>
+ You can find all these branches in the Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>.
+ </note>
+ Testing within these public branches ensures in a publicly visible way
+ that all of the main supposed architectures and recipes in OE-Core
+ successfully build and behave properly.
+ </para>
+
+ <para>
+ Various features such as <filename>multilib</filename>, sub
+ architectures (e.g. <filename>x32</filename>,
+ <filename>poky-tiny</filename>, <filename>musl</filename>,
+ <filename>no-x11</filename> and and so forth),
+ <filename>bitbake-selftest</filename>, and
+ <filename>oe-selftest</filename> are tested as part of
+ the QA process of a release.
+ Complete testing and validation for a release takes the Autobuilder
+ workers several hours.
+ <note>
+ The Autobuilder workers are non-homogeneous, which means regular
+ testing across a variety of Linux distributions occurs.
+ The Autobuilder is limited to only testing QEMU-based setups and
+ not real hardware.
+ </note>
+ </para>
+
+ <para>
+ Finally, in addition to the Autobuilder's tests, the Yocto Project
+ QA team also performs testing on a variety of platforms, which includes
+ actual hardware, to ensure expected results.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-structure.xml b/poky/documentation/ref-manual/ref-structure.xml
new file mode 100644
index 000000000..8e0c9f5b6
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-structure.xml
@@ -0,0 +1,1122 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-structure'>
+
+<title>Source Directory Structure</title>
+
+<para>
+ The <link linkend='source-directory'>Source Directory</link>
+ consists of several components.
+ Understanding them and knowing where they are located is key to using the
+ Yocto Project well.
+ This chapter describes the Source Directory and gives information about
+ the various files and directories.
+</para>
+
+<para>
+ For information on how to establish a local Source Directory on your
+ development system, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#locating-yocto-project-source-files'>Locating Yocto Project Source Files</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+</para>
+
+<note>
+ The OpenEmbedded build system does not support file or directory names that
+ contain spaces.
+ Be sure that the Source Directory you use does not contain these types
+ of names.
+</note>
+
+<section id='structure-core'>
+ <title>Top-Level Core Components</title>
+
+ <para>
+ This section describes the top-level components of the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+
+ <section id='structure-core-bitbake'>
+ <title><filename>bitbake/</filename></title>
+
+ <para>
+ This directory includes a copy of BitBake for ease of use.
+ The copy usually matches the current stable BitBake release from
+ the BitBake project.
+ BitBake, a
+ <link linkend='metadata'>Metadata</link>
+ interpreter, reads the Yocto Project Metadata and runs the tasks
+ defined by that data.
+ Failures are usually from the Metadata and not from BitBake itself.
+ Consequently, most users do not need to worry about BitBake.
+ </para>
+
+ <para>
+ When you run the <filename>bitbake</filename> command, the
+ main BitBake executable, which resides in the
+ <filename>bitbake/bin/</filename> directory, starts.
+ Sourcing the environment setup script (i.e.
+ <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>)
+ places the <filename>scripts</filename> and
+ <filename>bitbake/bin</filename> directories (in that order) into
+ the shell's <filename>PATH</filename> environment variable.
+ </para>
+
+ <para>
+ For more information on BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para>
+ </section>
+
+ <section id='structure-core-build'>
+ <title><filename>build/</filename></title>
+
+ <para>
+ This directory contains user configuration files and the output
+ generated by the OpenEmbedded build system in its standard configuration where
+ the source tree is combined with the output.
+ The
+ <link linkend='build-directory'>Build Directory</link>
+ is created initially when you <filename>source</filename>
+ the OpenEmbedded build environment setup script
+ (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ </para>
+
+ <para>
+ It is also possible to place output and configuration
+ files in a directory separate from the
+ <link linkend='source-directory'>Source Directory</link>
+ by providing a directory name when you <filename>source</filename>
+ the setup script.
+ For information on separating output from your local
+ Source Directory files, see the
+ "<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='handbook'>
+ <title><filename>documentation/</filename></title>
+
+ <para>
+ This directory holds the source for the Yocto Project documentation
+ as well as templates and tools that allow you to generate PDF and HTML
+ versions of the manuals.
+ Each manual is contained in a sub-folder.
+ For example, the files for this manual reside in
+ the <filename>ref-manual/</filename> directory.
+ </para>
+ </section>
+
+ <section id='structure-core-meta'>
+ <title><filename>meta/</filename></title>
+
+ <para>
+ This directory contains the OpenEmbedded-Core metadata.
+ The directory holds recipes, common classes, and machine
+ configuration for emulated targets (<filename>qemux86</filename>,
+ <filename>qemuarm</filename>, and so forth.)
+ </para>
+ </section>
+
+ <section id='structure-core-meta-poky'>
+ <title><filename>meta-poky/</filename></title>
+
+ <para>
+ This directory contains the configuration for the Poky
+ reference distribution.
+ </para>
+ </section>
+
+ <section id='structure-core-meta-yocto-bsp'>
+ <title><filename>meta-yocto-bsp/</filename></title>
+
+ <para>
+ This directory contains the Yocto Project reference
+ hardware Board Support Packages (BSPs).
+ For more information on BSPs, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ </para>
+ </section>
+
+ <section id='structure-meta-selftest'>
+ <title><filename>meta-selftest/</filename></title>
+
+ <para>
+ This directory adds additional recipes and append files
+ used by the OpenEmbedded selftests to verify the behavior
+ of the build system.
+ </para>
+
+ <para>
+ You do not have to add this layer to your
+ <filename>bblayers.conf</filename> file unless you want to run the
+ selftests.
+ </para>
+ </section>
+
+ <section id='structure-meta-skeleton'>
+ <title><filename>meta-skeleton/</filename></title>
+
+ <para>
+ This directory contains template recipes for BSP and kernel development.
+ </para>
+ </section>
+
+ <section id='structure-core-scripts'>
+ <title><filename>scripts/</filename></title>
+
+ <para>
+ This directory contains various integration scripts that implement
+ extra functionality in the Yocto Project environment (e.g. QEMU scripts).
+ The <link linkend="structure-core-script"><filename>&OE_INIT_FILE;</filename></link>
+ script appends this directory to the shell's
+ <filename>PATH</filename> environment variable.
+ </para>
+
+ <para>
+ The <filename>scripts</filename> directory has useful scripts that assist in contributing
+ back to the Yocto Project, such as <filename>create-pull-request</filename> and
+ <filename>send-pull-request</filename>.
+ </para>
+ </section>
+
+ <section id='structure-core-script'>
+ <title><filename>&OE_INIT_FILE;</filename></title>
+
+ <para>
+ This script sets up the OpenEmbedded build environment.
+ Running this script with the <filename>source</filename> command in
+ a shell makes changes to <filename>PATH</filename> and sets other
+ core BitBake variables based on the current working directory.
+ You need to run an environment setup script before running BitBake
+ commands.
+ The script uses other scripts within the
+ <filename>scripts</filename> directory to do the bulk of the work.
+ </para>
+
+ <para>
+ When you run this script, your Yocto Project environment is set
+ up, a
+ <link linkend='build-directory'>Build Directory</link>
+ is created, your working directory becomes the Build Directory,
+ and you are presented with a list of common BitBake targets.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env
+
+ ### Shell environment set up for builds. ###
+
+ You can now run 'bitbake &lt;target&gt;'
+
+ Common targets are:
+ core-image-minimal
+ core-image-sato
+ meta-toolchain
+ meta-ide-support
+
+ You can also run generated qemu images with a command like 'runqemu qemux86'
+ </literallayout>
+ The script gets its default list of common targets from the
+ <filename>conf-notes.txt</filename> file, which is found in the
+ <filename>meta-poky</filename> directory within the
+ <link linkend='source-directory'>Source Directory</link>.
+ Should you have custom distributions, it is very easy to modify
+ this configuration file to include your targets for your
+ distribution.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information.
+ </para>
+
+ <para>
+ By default, running this script without a Build Directory
+ argument creates the <filename>build</filename> directory
+ in your current working directory.
+ If you provide a Build Directory argument when you
+ <filename>source</filename> the script, you direct the OpenEmbedded
+ build system to create a Build Directory of your choice.
+ For example, the following command creates a Build Directory named
+ <filename>mybuilds</filename> that is outside of the
+ <link linkend='source-directory'>Source Directory</link>:
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE; ~/mybuilds
+ </literallayout>
+ The OpenEmbedded build system uses the template configuration
+ files, which are found by default in the
+ <filename>meta-poky/conf</filename> directory in the
+ Source Directory.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-custom-template-configuration-directory'>Creating a Custom Template Configuration Directory</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information.
+ <note>
+ The OpenEmbedded build system does not support file or directory names that
+ contain spaces.
+ If you attempt to run the <filename>&OE_INIT_FILE;</filename> script
+ from a Source Directory that contains spaces in either the filenames
+ or directory names, the script returns an error indicating no such
+ file or directory.
+ Be sure to use a Source Directory free of names containing spaces.
+ </note>
+ </para>
+ </section>
+
+ <section id='structure-basic-top-level'>
+ <title><filename>LICENSE, README, and README.hardware</filename></title>
+
+ <para>
+ These files are standard top-level files.
+ </para>
+ </section>
+</section>
+
+<section id='structure-build'>
+ <title>The Build Directory - <filename>build/</filename></title>
+
+ <para>
+ The OpenEmbedded build system creates the
+ <link linkend='build-directory'>Build Directory</link>
+ when you run the build environment setup scripts (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ </para>
+
+ <para>
+ If you do not give the Build Directory a specific name when you run
+ a setup script, the name defaults to <filename>build</filename>.
+ </para>
+
+ <para>
+ The
+ <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link> variable
+ points to the Build Directory.
+ </para>
+
+ <section id='structure-build-buildhistory'>
+ <title><filename>build/buildhistory</filename></title>
+
+ <para>
+ The OpenEmbedded build system creates this directory when you
+ enable the build history feature.
+ The directory tracks build information into image, packages, and
+ SDK subdirectories.
+ For information on the build history feature, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='structure-build-conf-local.conf'>
+ <title><filename>build/conf/local.conf</filename></title>
+
+ <para>
+ This configuration file contains all the local user configurations
+ for your build environment.
+ The <filename>local.conf</filename> file contains documentation on
+ the various configuration options.
+ Any variable set here overrides any variable set elsewhere within
+ the environment unless that variable is hard-coded within a file
+ (e.g. by using '=' instead of '?=').
+ Some variables are hard-coded for various reasons but these
+ variables are relatively rare.
+ </para>
+
+ <para>
+ Edit this file to set the
+ <filename><link linkend='var-MACHINE'>MACHINE</link></filename>
+ for which you want to build, which package types you wish to use
+ (<link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>),
+ and the location from which you want to access downloaded files
+ (<filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>).
+ </para>
+
+ <para>
+ If <filename>local.conf</filename> is not present when you
+ start the build, the OpenEmbedded build system creates it from
+ <filename>local.conf.sample</filename> when
+ you <filename>source</filename> the top-level build environment
+ setup script (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ </para>
+
+ <para>
+ The source <filename>local.conf.sample</filename> file used
+ depends on the <filename>$TEMPLATECONF</filename> script variable,
+ which defaults to <filename>meta-poky/conf</filename>
+ when you are building from the Yocto Project development
+ environment and defaults to <filename>meta/conf</filename> when
+ you are building from the OpenEmbedded-Core environment.
+ Because the script variable points to the source of the
+ <filename>local.conf.sample</filename> file, this implies that
+ you can configure your build environment from any layer by setting
+ the variable in the top-level build environment setup script as
+ follows:
+ <literallayout class='monospaced'>
+ TEMPLATECONF=<replaceable>your_layer</replaceable>/conf
+ </literallayout>
+ Once the build process gets the sample file, it uses
+ <filename>sed</filename> to substitute final
+ <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
+ values for all <filename>##OEROOT##</filename> values.
+ <note>
+ You can see how the <filename>TEMPLATECONF</filename> variable
+ is used by looking at the
+ <filename>scripts/oe-setup-builddir</filename> script in the
+ <link linkend='source-directory'>Source Directory</link>.
+ You can find the Yocto Project version of the
+ <filename>local.conf.sample</filename> file in the
+ <filename>meta-poky/conf</filename> directory.
+ </note>
+ </para>
+ </section>
+
+ <section id='structure-build-conf-bblayers.conf'>
+ <title><filename>build/conf/bblayers.conf</filename></title>
+
+ <para>
+ This configuration file defines
+ <ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>layers</ulink>,
+ which are directory trees, traversed (or walked) by BitBake.
+ The <filename>bblayers.conf</filename> file uses the
+ <link linkend='var-BBLAYERS'><filename>BBLAYERS</filename></link>
+ variable to list the layers BitBake tries to find.
+ </para>
+
+ <para>
+ If <filename>bblayers.conf</filename> is not present when you
+ start the build, the OpenEmbedded build system creates it from
+ <filename>bblayers.conf.sample</filename> when
+ you <filename>source</filename> the top-level build environment
+ setup script (i.e.
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ </para>
+
+ <para>
+ The source <filename>bblayers.conf.sample</filename> file used
+ depends on the <filename>$TEMPLATECONF</filename> script variable,
+ which defaults to <filename>meta-poky/conf</filename>
+ when you are building from the Yocto Project development
+ environment and defaults to <filename>meta/conf</filename> when
+ you are building from the OpenEmbedded-Core environment.
+ Because the script variable points to the source of the
+ <filename>bblayers.conf.sample</filename> file, this implies that
+ you can base your build from any layer by setting the variable in
+ the top-level build environment setup script as follows:
+ <literallayout class='monospaced'>
+ TEMPLATECONF=<replaceable>your_layer</replaceable>/conf
+ </literallayout>
+ Once the build process gets the sample file, it uses
+ <filename>sed</filename> to substitute final
+ <filename>${</filename><link linkend='var-OEROOT'><filename>OEROOT</filename></link><filename>}</filename>
+ values for all <filename>##OEROOT##</filename> values.
+ <note>
+ You can see how the <filename>TEMPLATECONF</filename> variable
+ <filename>scripts/oe-setup-builddir</filename> script in the
+ <link linkend='source-directory'>Source Directory</link>.
+ You can find the Yocto Project version of the
+ <filename>bblayers.conf.sample</filename> file in the
+ <filename>meta-poky/conf</filename> directory.
+ </note>
+ </para>
+ </section>
+
+ <section id='structure-build-conf-sanity_info'>
+ <title><filename>build/conf/sanity_info</filename></title>
+
+ <para>
+ This file indicates the state of the sanity checks and is created
+ during the build.
+ </para>
+ </section>
+
+ <section id='structure-build-downloads'>
+ <title><filename>build/downloads/</filename></title>
+
+ <para>
+ This directory contains downloaded upstream source tarballs.
+ You can reuse the directory for multiple builds or move
+ the directory to another location.
+ You can control the location of this directory through the
+ <filename><link linkend='var-DL_DIR'>DL_DIR</link></filename> variable.
+ </para>
+ </section>
+
+ <section id='structure-build-sstate-cache'>
+ <title><filename>build/sstate-cache/</filename></title>
+
+ <para>
+ This directory contains the shared state cache.
+ You can reuse the directory for multiple builds or move
+ the directory to another location.
+ You can control the location of this directory through the
+ <filename><link linkend='var-SSTATE_DIR'>SSTATE_DIR</link></filename> variable.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp'>
+ <title><filename>build/tmp/</filename></title>
+
+ <para>
+ The OpenEmbedded build system creates and uses this directory
+ for all the build system's output.
+ The
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ variable points to this directory.
+ </para>
+
+ <para>
+ BitBake creates this directory if it does not exist.
+ As a last resort, to clean up a build and start it from scratch
+ (other than the downloads), you can remove everything in the
+ <filename>tmp</filename> directory or get rid of the
+ directory completely.
+ If you do, you should also completely remove the
+ <filename>build/sstate-cache</filename> directory.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-buildstats'>
+ <title><filename>build/tmp/buildstats/</filename></title>
+
+ <para>
+ This directory stores the build statistics.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-cache'>
+ <title><filename>build/tmp/cache/</filename></title>
+
+ <para>
+ When BitBake parses the metadata (recipes and configuration files),
+ it caches the results in <filename>build/tmp/cache/</filename>
+ to speed up future builds.
+ The results are stored on a per-machine basis.
+ </para>
+
+ <para>
+ During subsequent builds, BitBake checks each recipe (together
+ with, for example, any files included or appended to it) to see
+ if they have been modified.
+ Changes can be detected, for example, through file modification
+ time (mtime) changes and hashing of file contents.
+ If no changes to the file are detected, then the parsed result
+ stored in the cache is reused.
+ If the file has changed, it is reparsed.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy'>
+ <title><filename>build/tmp/deploy/</filename></title>
+
+ <para>
+ This directory contains any "end result" output from the
+ OpenEmbedded build process.
+ The <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>
+ variable points to this directory.
+ For more detail on the contents of the <filename>deploy</filename>
+ directory, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-dev-environment'>Application Development SDK</ulink>"
+ sections in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-deb'>
+ <title><filename>build/tmp/deploy/deb/</filename></title>
+
+ <para>
+ This directory receives any <filename>.deb</filename> packages produced by
+ the build process.
+ The packages are sorted into feeds for different architecture types.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-rpm'>
+ <title><filename>build/tmp/deploy/rpm/</filename></title>
+
+ <para>
+ This directory receives any <filename>.rpm</filename> packages produced by
+ the build process.
+ The packages are sorted into feeds for different architecture types.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-ipk'>
+ <title><filename>build/tmp/deploy/ipk/</filename></title>
+
+ <para>
+ This directory receives <filename>.ipk</filename> packages produced by
+ the build process.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-licenses'>
+ <title><filename>build/tmp/deploy/licenses/</filename></title>
+
+ <para>
+ This directory receives package licensing information.
+ For example, the directory contains sub-directories for <filename>bash</filename>,
+ <filename>busybox</filename>, and <filename>glibc</filename> (among others) that in turn
+ contain appropriate <filename>COPYING</filename> license files with other licensing information.
+ For information on licensing, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-open-source-license-compliance-during-your-products-lifecycle'>Maintaining Open Source License Compliance During Your Product's Lifecycle</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-images'>
+ <title><filename>build/tmp/deploy/images/</filename></title>
+
+ <para>
+ This directory receives complete filesystem images.
+ If you want to flash the resulting image from a build onto a device, look here for the image.
+ </para>
+
+ <para>
+ Be careful when deleting files in this directory.
+ You can safely delete old images from this directory (e.g.
+ <filename>core-image-*</filename>).
+ However, the kernel (<filename>*zImage*</filename>, <filename>*uImage*</filename>, etc.),
+ bootloader and other supplementary files might be deployed here prior to building an
+ image.
+ Because these files are not directly produced from the image, if you
+ delete them they will not be automatically re-created when you build the image again.
+ </para>
+
+ <para>
+ If you do accidentally delete files here, you will need to force them to be
+ re-created.
+ In order to do that, you will need to know the target that produced them.
+ For example, these commands rebuild and re-create the kernel files:
+ <literallayout class='monospaced'>
+ $ bitbake -c clean virtual/kernel
+ $ bitbake virtual/kernel
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-deploy-sdk'>
+ <title><filename>build/tmp/deploy/sdk/</filename></title>
+
+ <para>
+ The OpenEmbedded build system creates this directory to hold
+ toolchain installer scripts, which when executed, install the
+ sysroot that matches your target hardware.
+ You can find out more about these installers in the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
+ section in the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-sstate-control'>
+ <title><filename>build/tmp/sstate-control/</filename></title>
+
+ <para>
+ The OpenEmbedded build system uses this directory for the
+ shared state manifest files.
+ The shared state code uses these files to record the files
+ installed by each sstate task so that the files can be removed
+ when cleaning the recipe or when a newer version is about to
+ be installed.
+ The build system also uses the manifests to detect and produce
+ a warning when files from one task are overwriting those from
+ another.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-sysroots-components'>
+ <title><filename>build/tmp/sysroots-components/</filename></title>
+
+ <para>
+ This directory is the location of the sysroot contents that the
+ task
+ <link linkend='ref-tasks-prepare_recipe_sysroot'><filename>do_prepare_recipe_sysroot</filename></link>
+ links or copies into the recipe-specific sysroot for each
+ recipe listed in
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
+ Population of this directory is handled through shared state, while
+ the path is specified by the
+ <link linkend='var-COMPONENTS_DIR'><filename>COMPONENTS_DIR</filename></link>
+ variable. Apart from a few unusual circumstances, handling of the
+ <filename>sysroots-components</filename> directory should be
+ automatic, and recipes should not directly reference
+ <filename>build/tmp/sysroots-components</filename>.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-sysroots'>
+ <title><filename>build/tmp/sysroots/</filename></title>
+
+ <para>
+ Previous versions of the OpenEmbedded build system used to
+ create a global shared sysroot per machine along with a native
+ sysroot.
+ Beginning with the &DISTRO; version of the Yocto Project,
+ sysroots exist in recipe-specific
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ directories.
+ Thus, the <filename>build/tmp/sysroots/</filename> directory
+ is unused.
+ <note>
+ The <filename>build/tmp/sysroots/</filename> directory
+ can still be populated using the
+ <filename>bitbake build-sysroots</filename> command and can
+ be used for compatibility in some cases.
+ However, in general it is not recommended to populate
+ this directory.
+ Individual recipe-specific sysroots should be used.
+ </note>
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-stamps'>
+ <title><filename>build/tmp/stamps/</filename></title>
+
+ <para>
+ This directory holds information that BitBake uses for
+ accounting purposes to track what tasks have run and when they
+ have run.
+ The directory is sub-divided by architecture, package name, and
+ version.
+ Following is an example:
+ <literallayout class='monospaced'>
+ stamps/all-poky-linux/distcc-config/1.0-r0.do_build-2fdd....2do
+ </literallayout>
+ Although the files in the directory are empty of data,
+ BitBake uses the filenames and timestamps for tracking purposes.
+ </para>
+
+ <para>
+ For information on how BitBake uses stamp files to determine if
+ a task should be rerun, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#stamp-files-and-the-rerunning-of-tasks'>Stamp Files and the Rerunning of Tasks</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-log'>
+ <title><filename>build/tmp/log/</filename></title>
+
+ <para>
+ This directory contains general logs that are not otherwise placed using the
+ package's <filename><link linkend='var-WORKDIR'>WORKDIR</link></filename>.
+ Examples of logs are the output from the
+ <filename>do_check_pkg</filename> or
+ <filename>do_distro_check</filename> tasks.
+ Running a build does not necessarily mean this directory is created.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-work'>
+ <title><filename>build/tmp/work/</filename></title>
+
+ <para>
+ This directory contains architecture-specific work sub-directories
+ for packages built by BitBake.
+ All tasks execute from the appropriate work directory.
+ For example, the source for a particular package is unpacked,
+ patched, configured and compiled all within its own work directory.
+ Within the work directory, organization is based on the package group
+ and version for which the source is being compiled
+ as defined by the
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>.
+ </para>
+
+ <para>
+ It is worth considering the structure of a typical work directory.
+ As an example, consider <filename>linux-yocto-kernel-3.0</filename>
+ on the machine <filename>qemux86</filename>
+ built within the Yocto Project.
+ For this package, a work directory of
+ <filename>tmp/work/qemux86-poky-linux/linux-yocto/3.0+git1+&lt;.....&gt;</filename>,
+ referred to as the <filename>WORKDIR</filename>, is created.
+ Within this directory, the source is unpacked to
+ <filename>linux-qemux86-standard-build</filename> and then patched by Quilt.
+ (See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-a-quilt-workflow'>Using Quilt in Your Workflow</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information.)
+ Within the <filename>linux-qemux86-standard-build</filename> directory,
+ standard Quilt directories <filename>linux-3.0/patches</filename>
+ and <filename>linux-3.0/.pc</filename> are created,
+ and standard Quilt commands can be used.
+ </para>
+
+ <para>
+ There are other directories generated within <filename>WORKDIR</filename>.
+ The most important directory is <filename>WORKDIR/temp/</filename>,
+ which has log files for each task (<filename>log.do_*.pid</filename>)
+ and contains the scripts BitBake runs for each task
+ (<filename>run.do_*.pid</filename>).
+ The <filename>WORKDIR/image/</filename> directory is where "make
+ install" places its output that is then split into sub-packages
+ within <filename>WORKDIR/packages-split/</filename>.
+ </para>
+ </section>
+
+ <section id='structure-build-tmp-work-tunearch-recipename-version'>
+ <title><filename>build/tmp/work/<replaceable>tunearch</replaceable>/<replaceable>recipename</replaceable>/<replaceable>version</replaceable>/</filename></title>
+
+ <para>
+ The recipe work directory - <filename>${WORKDIR}</filename>.
+ </para>
+
+ <para>
+ As described earlier in the
+ "<link linkend='structure-build-tmp-sysroots'><filename>build/tmp/sysroots/</filename></link>"
+ section, beginning with the &DISTRO; release of the Yocto
+ Project, the OpenEmbedded build system builds each recipe in its
+ own work directory (i.e.
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>).
+ The path to the work directory is constructed using the
+ architecture of the given build (e.g.
+ <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>,
+ <link linkend='var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></link>,
+ or "allarch"), the recipe name, and the version of the recipe (i.e.
+ <link linkend='var-PE'><filename>PE</filename></link><filename>:</filename><link linkend='var-PV'><filename>PV</filename></link><filename>-</filename><link linkend='var-PR'><filename>PR</filename></link>).
+ </para>
+
+ <para>
+ A number of key subdirectories exist within each recipe
+ work directory:
+ <itemizedlist>
+ <listitem><para>
+ <filename>${WORKDIR}/temp</filename>:
+ Contains the log files of each task executed for this
+ recipe, the "run" files for each executed task, which
+ contain the code run, and a
+ <filename>log.task_order</filename> file, which lists the
+ order in which tasks were executed.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/image</filename>:
+ Contains the output of the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task, which corresponds to the
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
+ variable in that task.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/pseudo</filename>:
+ Contains the pseudo database and log for any tasks executed
+ under pseudo for the recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/sysroot-destdir</filename>:
+ Contains the output of the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/package</filename>:
+ Contains the output of the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task before the output is split into individual packages.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/packages-split</filename>:
+ Contains the output of the <filename>do_package</filename>
+ task after the output has been split into individual
+ packages.
+ Subdirectories exist for each individual package created
+ by the recipe.
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/recipe-sysroot</filename>:
+ A directory populated with the target dependencies of the
+ recipe.
+ This directory looks like the target filesystem and
+ contains libraries that the recipe might need to link
+ against (e.g. the C library).
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/recipe-sysroot-native</filename>:
+ A directory populated with the native dependencies of the
+ recipe.
+ This directory contains the tools the recipe needs to build
+ (e.g. the compiler, Autoconf, libtool, and so forth).
+ </para></listitem>
+ <listitem><para>
+ <filename>${WORKDIR}/build</filename>:
+ This subdirectory applies only to recipes that support
+ builds where the source is separate from the
+ build artifacts.
+ The OpenEmbedded build system uses this directory as a
+ separate build directory (i.e.
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='structure-build-work-shared'>
+ <title><filename>build/tmp/work-shared/</filename></title>
+
+ <para>
+ For efficiency, the OpenEmbedded build system creates and uses
+ this directory to hold recipes that share a work directory with
+ other recipes.
+ In practice, this is only used for <filename>gcc</filename>
+ and its variants (e.g. <filename>gcc-cross</filename>,
+ <filename>libgcc</filename>, <filename>gcc-runtime</filename>,
+ and so forth).
+ </para>
+ </section>
+</section>
+
+<section id='structure-meta'>
+ <title>The Metadata - <filename>meta/</filename></title>
+
+ <para>
+ As mentioned previously,
+ <link linkend='metadata'>Metadata</link> is the core
+ of the Yocto Project.
+ Metadata has several important subdivisions:
+ </para>
+
+ <section id='structure-meta-classes'>
+ <title><filename>meta/classes/</filename></title>
+
+ <para>
+ This directory contains the <filename>*.bbclass</filename> files.
+ Class files are used to abstract common code so it can be reused by multiple
+ packages.
+ Every package inherits the <filename>base.bbclass</filename> file.
+ Examples of other important classes are <filename>autotools.bbclass</filename>, which
+ in theory allows any Autotool-enabled package to work with the Yocto Project with minimal effort.
+ Another example is <filename>kernel.bbclass</filename> that contains common code and functions
+ for working with the Linux kernel.
+ Functions like image generation or packaging also have their specific class files
+ such as <filename>image.bbclass</filename>, <filename>rootfs_*.bbclass</filename> and
+ <filename>package*.bbclass</filename>.
+ </para>
+
+ <para>
+ For reference information on classes, see the
+ "<link linkend='ref-classes'>Classes</link>" chapter.
+ </para>
+ </section>
+
+ <section id='structure-meta-conf'>
+ <title><filename>meta/conf/</filename></title>
+
+ <para>
+ This directory contains the core set of configuration files that start from
+ <filename>bitbake.conf</filename> and from which all other configuration
+ files are included.
+ See the include statements at the end of the
+ <filename>bitbake.conf</filename> file and you will note that even
+ <filename>local.conf</filename> is loaded from there.
+ While <filename>bitbake.conf</filename> sets up the defaults, you can often override
+ these by using the (<filename>local.conf</filename>) file, machine file or
+ the distribution configuration file.
+ </para>
+ </section>
+
+ <section id='structure-meta-conf-machine'>
+ <title><filename>meta/conf/machine/</filename></title>
+
+ <para>
+ This directory contains all the machine configuration files.
+ If you set <filename>MACHINE = "qemux86"</filename>,
+ the OpenEmbedded build system looks for a <filename>qemux86.conf</filename> file in this
+ directory.
+ The <filename>include</filename> directory contains various data common to multiple machines.
+ If you want to add support for a new machine to the Yocto Project, look in this directory.
+ </para>
+ </section>
+
+ <section id='structure-meta-conf-distro'>
+ <title><filename>meta/conf/distro/</filename></title>
+
+ <para>
+ The contents of this directory controls any distribution-specific
+ configurations.
+ For the Yocto Project, the <filename>defaultsetup.conf</filename> is the main file here.
+ This directory includes the versions and the
+ <filename>SRCDATE</filename> definitions for applications that are configured here.
+ An example of an alternative configuration might be <filename>poky-bleeding.conf</filename>.
+ Although this file mainly inherits its configuration from Poky.
+ </para>
+ </section>
+
+ <section id='structure-meta-conf-machine-sdk'>
+ <title><filename>meta/conf/machine-sdk/</filename></title>
+
+ <para>
+ The OpenEmbedded build system searches this directory for
+ configuration files that correspond to the value of
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>.
+ By default, 32-bit and 64-bit x86 files ship with the Yocto
+ Project that support some SDK hosts.
+ However, it is possible to extend that support to other SDK hosts
+ by adding additional configuration files in this subdirectory
+ within another layer.
+ </para>
+ </section>
+
+ <section id='structure-meta-files'>
+ <title><filename>meta/files/</filename></title>
+
+ <para>
+ This directory contains common license files and several text files
+ used by the build system.
+ The text files contain minimal device information and
+ lists of files and directories with known permissions.
+ </para>
+ </section>
+
+ <section id='structure-meta-lib'>
+ <title><filename>meta/lib/</filename></title>
+
+ <para>
+ This directory contains OpenEmbedded Python library code
+ used during the build process.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-bsp'>
+ <title><filename>meta/recipes-bsp/</filename></title>
+
+ <para>
+ This directory contains anything linking to specific hardware or hardware
+ configuration information such as "u-boot" and "grub".
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-connectivity'>
+ <title><filename>meta/recipes-connectivity/</filename></title>
+
+ <para>
+ This directory contains libraries and applications related to communication with other devices.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-core'>
+ <title><filename>meta/recipes-core/</filename></title>
+
+ <para>
+ This directory contains what is needed to build a basic working Linux image
+ including commonly used dependencies.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-devtools'>
+ <title><filename>meta/recipes-devtools/</filename></title>
+
+ <para>
+ This directory contains tools that are primarily used by the build system.
+ The tools, however, can also be used on targets.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-extended'>
+ <title><filename>meta/recipes-extended/</filename></title>
+
+ <para>
+ This directory contains non-essential applications that add features compared to the
+ alternatives in core.
+ You might need this directory for full tool functionality or for Linux Standard Base (LSB)
+ compliance.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-gnome'>
+ <title><filename>meta/recipes-gnome/</filename></title>
+
+ <para>
+ This directory contains all things related to the GTK+ application framework.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-graphics'>
+ <title><filename>meta/recipes-graphics/</filename></title>
+
+ <para>
+ This directory contains X and other graphically related system libraries
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-kernel'>
+ <title><filename>meta/recipes-kernel/</filename></title>
+
+ <para>
+ This directory contains the kernel and generic applications and libraries that
+ have strong kernel dependencies.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-lsb4'>
+ <title><filename>meta/recipes-lsb4/</filename></title>
+
+ <para>
+ This directory contains recipes specifically added to support
+ the Linux Standard Base (LSB) version 4.x.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-multimedia'>
+ <title><filename>meta/recipes-multimedia/</filename></title>
+
+ <para>
+ This directory contains codecs and support utilities for audio, images and video.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-rt'>
+ <title><filename>meta/recipes-rt/</filename></title>
+
+ <para>
+ This directory contains package and image recipes for using and testing
+ the <filename>PREEMPT_RT</filename> kernel.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-sato'>
+ <title><filename>meta/recipes-sato/</filename></title>
+
+ <para>
+ This directory contains the Sato demo/reference UI/UX and its associated applications
+ and configuration data.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-support'>
+ <title><filename>meta/recipes-support/</filename></title>
+
+ <para>
+ This directory contains recipes used by other recipes, but that are
+ not directly included in images (i.e. dependencies of other
+ recipes).
+ </para>
+ </section>
+
+ <section id='structure-meta-site'>
+ <title><filename>meta/site/</filename></title>
+
+ <para>
+ This directory contains a list of cached results for various architectures.
+ Because certain "autoconf" test results cannot be determined when cross-compiling due to
+ the tests not able to run on a live system, the information in this directory is
+ passed to "autoconf" for the various architectures.
+ </para>
+ </section>
+
+ <section id='structure-meta-recipes-txt'>
+ <title><filename>meta/recipes.txt</filename></title>
+
+ <para>
+ This file is a description of the contents of <filename>recipes-*</filename>.
+ </para>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-style.css b/poky/documentation/ref-manual/ref-style.css
new file mode 100644
index 000000000..7077e4b70
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-style.css
@@ -0,0 +1,1032 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/poky-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+/* Use this set when you decide to get the images in for variables.
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 0em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: 0em;
+ margin-left: 15.5em;
+ margin-bottom: 2em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+.glossdeffirst {
+ text-indent: -70px;
+}
+*/
+
+/* Start of non-image set */
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: 0em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+.glossdeffirst {
+ text-indent: 0px;
+}
+
+/* End of non-image set */
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+.writernotes {
+ color: red;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-image: url("figures/poky-title.png");
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/ref-manual/ref-system-requirements.xml b/poky/documentation/ref-manual/ref-system-requirements.xml
new file mode 100644
index 000000000..aea1fdf18
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-system-requirements.xml
@@ -0,0 +1,490 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-manual-system-requirements'>
+<title>System Requirements</title>
+
+ <para>
+ Welcome to the Yocto Project Reference Manual!
+ This manual provides reference information for the current release
+ of the Yocto Project.
+ The manual is best used after you have an understanding
+ of the basics of the Yocto Project.
+ The manual is neither meant to be read as a starting point to the
+ Yocto Project nor read from start to finish.
+ Use this manual to find variable definitions, class
+ descriptions, and so forth as needed during the course of using
+ the Yocto Project.
+ </para>
+
+ <para>
+ For introductory information on the Yocto Project, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink> and the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#overview-development-environment'>Yocto Project Development Environment</ulink>"
+ chapter in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <para>
+ If you want to use the Yocto Project to quickly build an image
+ without having to understand concepts, work through the
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>
+ document.
+ You can find "how-to" information in the
+ <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Tasks Manual</ulink>.
+ You can find Yocto Project overview and conceptual information in the
+ <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>.
+ <note><title>Tip</title>
+ For more information about the Yocto Project Documentation set,
+ see the
+ "<link linkend='resources-links-and-related-documentation'>Links and Related Documentation</link>"
+ section.
+ </note>
+ </para>
+
+ <section id='detailed-supported-distros'>
+ <title>Supported Linux Distributions</title>
+
+ <para>
+ Currently, the Yocto Project is supported on the following
+ distributions:
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Yocto Project releases are tested against the stable
+ Linux distributions in the following list.
+ The Yocto Project should work on other distributions but
+ validation is not performed against them.
+ </para></listitem>
+ <listitem><para>
+ In particular, the Yocto Project does not support
+ and currently has no plans to support
+ rolling-releases or development distributions due to
+ their constantly changing nature.
+ We welcome patches and bug reports, but keep in mind
+ that our priority is on the supported platforms listed
+ below.
+ </para></listitem>
+ <listitem><para>
+ If you encounter problems, please go to
+ <ulink url='&YOCTO_BUGZILLA_URL;'>Yocto Project Bugzilla</ulink>
+ and submit a bug.
+ We are interested in hearing about your experience.
+ For information on how to submit a bug, see the
+ Yocto Project
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla wiki page</ulink>
+ and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#submitting-a-defect-against-the-yocto-project'>Submitting a Defect Against the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ <itemizedlist>
+<!--
+ <listitem><para>Ubuntu 10.04</para></listitem>
+ <listitem><para>Ubuntu 11.10</para></listitem>
+ <listitem><para>Ubuntu 12.04 (LTS)</para></listitem>
+ <listitem><para>Ubuntu 13.10</para></listitem>
+ <listitem><para>Ubuntu 14.04 (LTS)</para></listitem> -->
+ <listitem><para>Ubuntu 14.10</para></listitem>
+ <listitem><para>Ubuntu 15.04</para></listitem>
+ <listitem><para>Ubuntu 15.10</para></listitem>
+ <listitem><para>Ubuntu 16.04 (LTS)</para></listitem>
+<!-- <listitem><para>Fedora 16 (Verne)</para></listitem>
+ <listitem><para>Fedora 17 (Spherical)</para></listitem>
+ <listitem><para>Fedora release 19 (Schrödinger's Cat)</para></listitem>
+ <listitem><para>Fedora release 20 (Heisenbug)</para></listitem> -->
+ <listitem><para>Fedora release 22</para></listitem>
+ <listitem><para>Fedora release 23</para></listitem>
+<!-- <listitem><para>Fedora release 24</para></listitem>
+ <listitem><para>CentOS release 5.6 (Final)</para></listitem>
+ <listitem><para>CentOS release 5.7 (Final)</para></listitem>
+ <listitem><para>CentOS release 5.8 (Final)</para></listitem>
+ <listitem><para>CentOS release 6.3 (Final)</para></listitem>
+ <listitem><para>CentOS release 6.x</para></listitem> -->
+ <listitem><para>CentOS release 7.x</para></listitem>
+<!-- <listitem><para>Debian GNU/Linux 6.0 (Squeeze)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.x (Wheezy)</para></listitem> -->
+ <listitem><para>Debian GNU/Linux 8.x (Jessie)</para></listitem>
+ <listitem><para>Debian GNU/Linux 9.x (Stretch)</para></listitem>
+<!-- <listitem><para>Debian GNU/Linux 7.1 (Wheezy)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.2 (Wheezy)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.3 (Wheezy)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.4 (Wheezy)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.5 (Wheezy)</para></listitem>
+ <listitem><para>Debian GNU/Linux 7.6 (Wheezy)</para></listitem> -->
+<!-- <listitem><para>openSUSE 11.4</para></listitem>
+ <listitem><para>openSUSE 12.1</para></listitem>
+ <listitem><para>openSUSE 12.2</para></listitem>
+ <listitem><para>openSUSE 12.3</para></listitem>
+ <listitem><para>openSUSE 13.1</para></listitem> -->
+ <listitem><para>openSUSE 13.2</para></listitem>
+ <listitem><para>openSUSE 42.1</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <note>
+ While the Yocto Project Team attempts to ensure all Yocto Project
+ releases are one hundred percent compatible with each officially
+ supported Linux distribution, instances might exist where you
+ encounter a problem while using the Yocto Project on a specific
+ distribution.
+ </note>
+ </section>
+
+ <section id='required-packages-for-the-host-development-system'>
+ <title>Required Packages for the Host Development System</title>
+
+ <para>
+ The list of packages you need on the host development system can
+ be large when covering all build scenarios using the Yocto Project.
+ This section provides required packages according to
+ Linux distribution and function.
+ </para>
+
+ <section id='ubuntu-packages'>
+ <title>Ubuntu and Debian</title>
+
+ <para>
+ The following list shows the required packages by function
+ given a supported Ubuntu or Debian Linux distribution:
+ <note>
+ If your build system has the
+ <filename>oss4-dev</filename> package installed, you
+ might experience QEMU build failures due to the package
+ installing its own custom
+ <filename>/usr/include/linux/soundcard.h</filename> on
+ the Debian system.
+ If you run into this situation, either of the following
+ solutions exist:
+ <literallayout class='monospaced'>
+ $ sudo apt-get build-dep qemu
+ $ sudo apt-get remove oss4-dev
+ </literallayout>
+ </note>
+ <itemizedlist>
+ <listitem><para><emphasis>Essentials:</emphasis>
+ Packages needed to build an image on a headless
+ system:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install &UBUNTU_HOST_PACKAGES_ESSENTIAL;
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
+ Packages recommended if the host system has graphics
+ support or if you are going to use the Eclipse
+ IDE:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install libsdl1.2-dev xterm
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Documentation:</emphasis>
+ Packages needed if you are going to build out the
+ Yocto Project documentation manuals:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install make xsltproc docbook-utils fop dblatex xmlto
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
+ Packages needed if you are going to run
+ <filename>oe-selftest</filename>:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install python-git
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='fedora-packages'>
+ <title>Fedora Packages</title>
+
+ <para>
+ The following list shows the required packages by function
+ given a supported Fedora Linux distribution:
+ <itemizedlist>
+ <listitem><para><emphasis>Essentials:</emphasis>
+ Packages needed to build an image for a headless
+ system:
+ <literallayout class='monospaced'>
+ $ sudo dnf install &FEDORA_HOST_PACKAGES_ESSENTIAL;
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
+ Packages recommended if the host system has graphics
+ support or if you are going to use the Eclipse
+ IDE:
+ <literallayout class='monospaced'>
+ $ sudo dnf install SDL-devel xterm
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Documentation:</emphasis>
+ Packages needed if you are going to build out the
+ Yocto Project documentation manuals:
+ <literallayout class='monospaced'>
+ $ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
+ docbook-dtds docbook-utils fop libxslt dblatex xmlto
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
+ Packages needed if you are going to run
+ <filename>oe-selftest</filename>:
+ <literallayout class='monospaced'>
+ $ sudo dnf install python3-GitPython
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='opensuse-packages'>
+ <title>openSUSE Packages</title>
+
+ <para>
+ The following list shows the required packages by function
+ given a supported openSUSE Linux distribution:
+ <itemizedlist>
+ <listitem><para><emphasis>Essentials:</emphasis>
+ Packages needed to build an image for a headless
+ system:
+ <literallayout class='monospaced'>
+ $ sudo zypper install &OPENSUSE_HOST_PACKAGES_ESSENTIAL;
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
+ Packages recommended if the host system has graphics
+ support or if you are going to use the Eclipse
+ IDE:
+ <literallayout class='monospaced'>
+ $ sudo zypper install libSDL-devel xterm
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Documentation:</emphasis>
+ Packages needed if you are going to build out the
+ Yocto Project documentation manuals:
+ <literallayout class='monospaced'>
+ $ sudo zypper install make dblatex xmlto
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
+ Packages needed if you are going to run
+ <filename>oe-selftest</filename>:
+ <literallayout class='monospaced'>
+ $ sudo zypper install python-GitPython
+ </literallayout></para></listitem>
+ </itemizedlist>
+ <note>
+ Sanity testing, through the
+ <link linkend='ref-classes-testimage*'>testimage</link>
+ classes, does not work on systems using the
+ <ulink url='https://en.opensuse.org/Portal:Wicked'>Wicked</ulink>
+ network manager.
+ </note>
+ </para>
+ </section>
+
+ <section id='centos-packages'>
+ <title>CentOS Packages</title>
+
+ <para>
+ The following list shows the required packages by function
+ given a supported CentOS Linux distribution:
+ <itemizedlist>
+ <listitem><para><emphasis>Essentials:</emphasis>
+ Packages needed to build an image for a headless
+ system:
+ <literallayout class='monospaced'>
+ $ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
+ </literallayout>
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Extra Packages for Enterprise Linux
+ (i.e. <filename>epel-release</filename>)
+ is a collection of packages from Fedora
+ built on RHEL/CentOS for easy installation
+ of packages not included in enterprise
+ Linux by default.
+ You need to install these packages
+ separately.
+ </para></listitem>
+ <listitem><para>
+ The <filename>makecache</filename> command
+ consumes additional Metadata from
+ <filename>epel-release</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
+ Packages recommended if the host system has graphics
+ support or if you are going to use the Eclipse
+ IDE:
+ <literallayout class='monospaced'>
+ $ sudo yum install SDL-devel xterm
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Documentation:</emphasis>
+ Packages needed if you are going to build out the
+ Yocto Project documentation manuals:
+ <literallayout class='monospaced'>
+ $ sudo yum install make docbook-style-dsssl docbook-style-xsl \
+ docbook-dtds docbook-utils fop libxslt dblatex xmlto
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
+ Packages needed if you are going to run
+ <filename>oe-selftest</filename>:
+ <literallayout class='monospaced'>
+ $ sudo yum install GitPython
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='required-git-tar-and-python-versions'>
+ <title>Required Git, tar, and Python Versions</title>
+
+ <para>
+ In order to use the build system, your host development system
+ must meet the following version requirements for Git, tar, and
+ Python:
+ <itemizedlist>
+ <listitem><para>Git 1.8.3.1 or greater</para></listitem>
+ <listitem><para>tar 1.27 or greater</para></listitem>
+ <listitem><para>Python 3.4.0 or greater</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ If your host development system does not meet all these requirements,
+ you can resolve this by installing a <filename>buildtools</filename>
+ tarball that contains these tools.
+ You can get the tarball one of two ways: download a pre-built
+ tarball or use BitBake to build the tarball.
+ </para>
+
+ <section id='downloading-a-pre-built-buildtools-tarball'>
+ <title>Downloading a Pre-Built <filename>buildtools</filename> Tarball</title>
+
+ <para>
+ Downloading and running a pre-built buildtools installer is
+ the easiest of the two methods by which you can get these tools:
+ <orderedlist>
+ <listitem><para>
+ Locate and download the <filename>*.sh</filename> at
+ <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/buildtools/'></ulink>.
+ </para></listitem>
+ <listitem><para>
+ Execute the installation script.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ sh ~/Downloads/x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
+ </literallayout>
+ During execution, a prompt appears that allows you to
+ choose the installation directory.
+ For example, you could choose the following:
+ <literallayout class='monospaced'>
+ /home/<replaceable>your-username</replaceable>/buildtools
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Source the tools environment setup script by using a
+ command like the following:
+ <literallayout class='monospaced'>
+ $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
+ </literallayout>
+ Of course, you need to supply your installation directory and be
+ sure to use the right file (i.e. i585 or x86-64).
+ </para>
+ <para>
+ After you have sourced the setup script,
+ the tools are added to <filename>PATH</filename>
+ and any other environment variables required to run the
+ tools are initialized.
+ The results are working versions versions of Git, tar,
+ Python and <filename>chrpath</filename>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='building-your-own-buildtools-tarball'>
+ <title>Building Your Own <filename>buildtools</filename> Tarball</title>
+
+ <para>
+ Building and running your own buildtools installer applies
+ only when you have a build host that can already run BitBake.
+ In this case, you use that machine to build the
+ <filename>.sh</filename> file and then
+ take steps to transfer and run it on a
+ machine that does not meet the minimal Git, tar, and Python
+ requirements.
+ </para>
+
+ <para>
+ Here are the steps to take to build and run your own
+ buildtools installer:
+ <orderedlist>
+ <listitem><para>
+ On the machine that is able to run BitBake,
+ be sure you have set up your build environment with
+ the setup script
+ (<link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ </para></listitem>
+ <listitem><para>
+ Run the BitBake command to build the tarball:
+ <literallayout class='monospaced'>
+ $ bitbake buildtools-tarball
+ </literallayout>
+ <note>
+ The
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>
+ variable in your <filename>local.conf</filename> file
+ determines whether you build tools for a 32-bit
+ or 64-bit system.
+ </note>
+ Once the build completes, you can find the
+ <filename>.sh</filename> file that installs
+ the tools in the <filename>tmp/deploy/sdk</filename>
+ subdirectory of the
+ <link linkend='build-directory'>Build Directory</link>.
+ The installer file has the string "buildtools"
+ in the name.
+ </para></listitem>
+ <listitem><para>
+ Transfer the <filename>.sh</filename> file from the
+ build host to the machine that does not meet the
+ Git, tar, or Python requirements.
+ </para></listitem>
+ <listitem><para>
+ On the machine that does not meet the requirements,
+ run the <filename>.sh</filename> file
+ to install the tools.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ sh ~/Downloads/x86_64-buildtools-nativesdk-standalone-&DISTRO;.sh
+ </literallayout>
+ During execution, a prompt appears that allows you to
+ choose the installation directory.
+ For example, you could choose the following:
+ <literallayout class='monospaced'>
+ /home/<replaceable>your_username</replaceable>/buildtools
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Source the tools environment setup script by using a
+ command like the following:
+ <literallayout class='monospaced'>
+ $ source /home/<replaceable>your_username</replaceable>/buildtools/environment-setup-i586-poky-linux
+ </literallayout>
+ Of course, you need to supply your installation directory and be
+ sure to use the right file (i.e. i585 or x86-64).
+ </para>
+ <para>
+ After you have sourced the setup script,
+ the tools are added to <filename>PATH</filename>
+ and any other environment variables required to run the
+ tools are initialized.
+ The results are working versions versions of Git, tar,
+ Python and <filename>chrpath</filename>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-tasks.xml b/poky/documentation/ref-manual/ref-tasks.xml
new file mode 100644
index 000000000..e6cf68670
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-tasks.xml
@@ -0,0 +1,1155 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-tasks'>
+<title>Tasks</title>
+
+<para>
+ Tasks are units of execution for BitBake.
+ Recipes (<filename>.bb</filename> files) use tasks to complete
+ configuring, compiling, and packaging software.
+ This chapter provides a reference of the tasks defined in the
+ OpenEmbedded build system.
+</para>
+
+<section id='normal-recipe-build-tasks'>
+ <title>Normal Recipe Build Tasks</title>
+
+ <para>
+ The following sections describe normal tasks associated with building
+ a recipe.
+ For more information on tasks and dependencies, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
+ "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
+ sections in the BitBake User Manual.
+ </para>
+
+ <section id='ref-tasks-build'>
+ <title><filename>do_build</filename></title>
+
+ <para>
+ The default task for all recipes.
+ This task depends on all other normal tasks
+ required to build a recipe.
+ </para>
+ </section>
+
+ <section id='ref-tasks-compile'>
+ <title><filename>do_compile</filename></title>
+
+ <para>
+ Compiles the source code.
+ This task runs with the current working directory set
+ to
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
+ </para>
+
+ <para>
+ The default behavior of this task is to run the
+ <filename>oe_runmake</filename> function if a makefile
+ (<filename>Makefile</filename>, <filename>makefile</filename>,
+ or <filename>GNUmakefile</filename>) is found.
+ If no such file is found, the <filename>do_compile</filename>
+ task does nothing.
+ </para>
+ </section>
+
+ <section id='ref-tasks-compile_ptest_base'>
+ <title><filename>do_compile_ptest_base</filename></title>
+
+ <para>
+ Compiles the runtime test suite included in the software being
+ built.
+ </para>
+ </section>
+
+ <section id='ref-tasks-configure'>
+ <title><filename>do_configure</filename></title>
+
+ <para>
+ Configures the source by enabling and disabling any build-time and
+ configuration options for the software being built.
+ The task runs with the current working directory set to
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
+ </para>
+
+ <para>
+ The default behavior of this task is to run
+ <filename>oe_runmake clean</filename> if a makefile
+ (<filename>Makefile</filename>, <filename>makefile</filename>,
+ or <filename>GNUmakefile</filename>) is found and
+ <link linkend='var-CLEANBROKEN'><filename>CLEANBROKEN</filename></link>
+ is not set to "1".
+ If no such file is found or the <filename>CLEANBROKEN</filename>
+ variable is set to "1", the <filename>do_configure</filename>
+ task does nothing.
+ </para>
+ </section>
+
+ <section id='ref-tasks-configure_ptest_base'>
+ <title><filename>do_configure_ptest_base</filename></title>
+
+ <para>
+ Configures the runtime test suite included in the software being
+ built.
+ </para>
+ </section>
+
+ <section id='ref-tasks-deploy'>
+ <title><filename>do_deploy</filename></title>
+
+ <para>
+ Writes output files that are to be deployed to
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link><filename>}</filename>.
+ The task runs with the current working directory set to
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
+ </para>
+
+ <para>
+ Recipes implementing this task should inherit the
+ <link linkend='ref-classes-deploy'><filename>deploy</filename></link>
+ class and should write the output to
+ <filename>${</filename><link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link><filename>}</filename>,
+ which is not to be confused with <filename>${DEPLOY_DIR}</filename>.
+ The <filename>deploy</filename> class sets up
+ <filename>do_deploy</filename> as a shared state (sstate) task that
+ can be accelerated through sstate use.
+ The sstate mechanism takes care of copying the output from
+ <filename>${DEPLOYDIR}</filename> to
+ <filename>${DEPLOY_DIR_IMAGE}</filename>.
+ <note>
+ <title>Caution</title>
+ Do not write the output directly to
+ <filename>${DEPLOY_DIR_IMAGE}</filename>, as this causes
+ the sstate mechanism to malfunction.
+ </note>
+ </para>
+
+ <para>
+ The <filename>do_deploy</filename> task is not added as a task
+ by default and consequently needs to be added manually.
+ If you want the task to run after
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
+ you can add it by doing the following:
+ <literallayout class='monospaced'>
+ addtask deploy after do_compile
+ </literallayout>
+ Adding <filename>do_deploy</filename> after other tasks works the
+ same way.
+ <note>
+ You do not need to add <filename>before do_build</filename>
+ to the <filename>addtask</filename> command (though it is
+ harmless), because the
+ <link linkend='ref-classes-base'><filename>base</filename></link>
+ class contains the following:
+ <literallayout class='monospaced'>
+ do_build[recrdeptask] += "do_deploy"
+ </literallayout>
+ See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
+ section in the BitBake User Manual for more information.
+ </note>
+ </para>
+
+ <para>
+ If the <filename>do_deploy</filename> task re-executes, any
+ previous output is removed (i.e. "cleaned").
+ </para>
+ </section>
+
+ <section id='ref-tasks-distrodata'>
+ <title><filename>do_distrodata</filename></title>
+
+ <para>
+ Provides information about the recipe.
+ </para>
+
+ <para>
+ The <filename>distrodata</filename> task is included as part of the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class.
+ </para>
+
+ <para>
+ To build the <filename>distrodata</filename> task, use the
+ <filename>bitbake</filename> command with the "-c" option and
+ task name:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-minimal -c distrodata
+ </literallayout>
+ By default, the results are stored in
+ <link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link>
+ (e.g. <filename>$BUILD_DIR/tmp/log</filename>).
+ </para>
+ </section>
+
+ <section id='ref-tasks-fetch'>
+ <title><filename>do_fetch</filename></title>
+
+ <para>
+ Fetches the source code.
+ This task uses the
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ variable and the argument's prefix to determine the correct
+ fetcher module.
+ </para>
+ </section>
+
+ <section id='ref-tasks-image'>
+ <title><filename>do_image</filename></title>
+
+ <para>
+ Starts the image generation process.
+ The <filename>do_image</filename> task runs after the
+ OpenEmbedded build system has run the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task during which packages are identified for installation into
+ the image and the root filesystem is created, complete with
+ post-processing.
+ </para>
+
+ <para>
+ The <filename>do_image</filename> task performs pre-processing
+ on the image through the
+ <link linkend='var-IMAGE_PREPROCESS_COMMAND'><filename>IMAGE_PREPROCESS_COMMAND</filename></link>
+ and dynamically generates supporting
+ <filename>do_image_*</filename> tasks as needed.
+ </para>
+
+ <para>
+ For more information on image creation, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-image-complete'>
+ <title><filename>do_image_complete</filename></title>
+
+ <para>
+ Completes the image generation process.
+ The <filename>do_image_complete</filename> task runs after the
+ OpenEmbedded build system has run the
+ <link linkend='ref-tasks-image'><filename>do_image</filename></link>
+ task during which image pre-processing occurs and through
+ dynamically generated <filename>do_image_*</filename> tasks the
+ image is constructed.
+ </para>
+
+ <para>
+ The <filename>do_image_complete</filename> task performs
+ post-processing on the image through the
+ <link linkend='var-IMAGE_POSTPROCESS_COMMAND'><filename>IMAGE_POSTPROCESS_COMMAND</filename></link>.
+ </para>
+
+ <para>
+ For more information on image creation, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-install'>
+ <title><filename>do_install</filename></title>
+
+ <para>
+ Copies files that are to be packaged into the holding area
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>.
+ This task runs with the current working directory set to
+ <filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>,
+ which is the compilation directory.
+ The <filename>do_install</filename> task, as well as other tasks
+ that either directly or indirectly depend on the installed files
+ (e.g.
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>,
+ <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_*</filename></link>,
+ and
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>),
+ run under
+ <ulink url='&YOCTO_DOCS_OM_URL;#fakeroot-and-pseudo'>fakeroot</ulink>.
+ <note>
+ <title>Caution</title>
+
+ <para>
+ When installing files, be careful not to set the owner and
+ group IDs of the installed files to unintended values.
+ Some methods of copying files, notably when using the
+ recursive <filename>cp</filename> command, can preserve the
+ UID and/or GID of the original file, which is usually not
+ what you want.
+ The
+ <link linkend='insane-host-user-contaminated'><filename>host-user-contaminated</filename></link>
+ QA check checks for files that probably have the wrong
+ ownership.
+ </para>
+
+ <para>
+ Safe methods for installing files include the following:
+ <itemizedlist>
+ <listitem><para>
+ The <filename>install</filename> utility.
+ This utility is the preferred method.
+ </para></listitem>
+ <listitem><para>
+ The <filename>cp</filename> command with the
+ "--no-preserve=ownership" option.
+ </para></listitem>
+ <listitem><para>
+ The <filename>tar</filename> command with the
+ "--no-same-owner" option.
+ See the <filename>bin_package.bbclass</filename>
+ file in the <filename>meta/classes</filename>
+ directory of the
+ <link linkend='source-directory'>Source Directory</link>
+ for an example.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </note>
+ </para>
+ </section>
+
+ <section id='ref-tasks-install_ptest_base'>
+ <title><filename>do_install_ptest_base</filename></title>
+
+ <para>
+ Copies the runtime test suite files from the compilation directory
+ to a holding area.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package'>
+ <title><filename>do_package</filename></title>
+
+ <para>
+ Analyzes the content of the holding area
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
+ and splits the content into subsets based on available packages
+ and files.
+ This task makes use of the
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ and
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variables.
+ </para>
+
+ <para>
+ The <filename>do_package</filename> task, in conjunction with the
+ <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>
+ task, also saves some important package metadata.
+ For additional information, see the
+ <link linkend='var-PKGDESTWORK'><filename>PKGDESTWORK</filename></link>
+ variable and the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_qa'>
+ <title><filename>do_package_qa</filename></title>
+
+ <para>
+ Runs QA checks on packaged files.
+ For more information on these checks, see the
+ <link linkend='ref-classes-insane'><filename>insane</filename></link>
+ class.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_write_deb'>
+ <title><filename>do_package_write_deb</filename></title>
+
+ <para>
+ Creates Debian packages (i.e. <filename>*.deb</filename> files) and
+ places them in the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_DEB'><filename>DEPLOY_DIR_DEB</filename></link><filename>}</filename>
+ directory in the package feeds area.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_write_ipk'>
+ <title><filename>do_package_write_ipk</filename></title>
+
+ <para>
+ Creates IPK packages (i.e. <filename>*.ipk</filename> files) and
+ places them in the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_IPK'><filename>DEPLOY_DIR_IPK</filename></link><filename>}</filename>
+ directory in the package feeds area.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_write_rpm'>
+ <title><filename>do_package_write_rpm</filename></title>
+
+ <para>
+ Creates RPM packages (i.e. <filename>*.rpm</filename> files) and
+ places them in the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_RPM'><filename>DEPLOY_DIR_RPM</filename></link><filename>}</filename>
+ directory in the package feeds area.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_write_tar'>
+ <title><filename>do_package_write_tar</filename></title>
+
+ <para>
+ Creates tarballs and places them in the
+ <filename>${</filename><link linkend='var-DEPLOY_DIR_TAR'><filename>DEPLOY_DIR_TAR</filename></link><filename>}</filename>
+ directory in the package feeds area.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-packagedata'>
+ <title><filename>do_packagedata</filename></title>
+
+ <para>
+ Saves package metadata generated by the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task in
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>
+ to make it available globally.
+ </para>
+ </section>
+
+ <section id='ref-tasks-patch'>
+ <title><filename>do_patch</filename></title>
+
+ <para>
+ Locates patch files and applies them to the source code.
+ </para>
+
+ <para>
+ After fetching and unpacking source files, the build system
+ uses the recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements to locate and apply patch files to the source code.
+ <note>
+ The build system uses the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILESPATH'><filename>FILESPATH</filename></ulink>
+ variable to determine the default set of directories when
+ searching for patches.
+ </note>
+ Patch files, by default, are <filename>*.patch</filename> and
+ <filename>*.diff</filename> files created and kept in a
+ subdirectory of the directory holding the recipe file.
+ For example, consider the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta/recipes-connectivity/bluez5'><filename>bluez5</filename></ulink>
+ recipe from the OE-Core layer (i.e.
+ <filename>poky/meta</filename>):
+ <literallayout class='monospaced'>
+ poky/meta/recipes-connectivity/bluez5
+ </literallayout>
+ This recipe has two patch files located here:
+ <literallayout class='monospaced'>
+ poky/meta/recipes-connectivity/bluez5/bluez5
+ </literallayout>
+ </para>
+
+ <para>
+ In the <filename>bluez5</filename> recipe, the
+ <filename>SRC_URI</filename> statements point to the source and
+ patch files needed to build the package.
+ <note>
+ In the case for the <filename>bluez5_5.48.bb</filename>
+ recipe, the <filename>SRC_URI</filename> statements are from an
+ include file <filename>bluez5.inc</filename>.
+ </note>
+ </para>
+
+ <para>
+ As mentioned earlier, the build system treats files whose file
+ types are <filename>.patch</filename> and
+ <filename>.diff</filename> as patch files.
+ However, you can use the "apply=yes" parameter with the
+ <filename>SRC_URI</filename> statement to indicate any file as a
+ patch file:
+ <literallayout class='monospaced'>
+ SRC_URI = " \
+ git://<replaceable>path_to_repo</replaceable>/<replaceable>some_package</replaceable> \
+ file://<replaceable>file</replaceable>;apply=yes \
+ "
+ </literallayout>
+ </para>
+
+ <para>
+ Conversely, if you have a directory full of patch files and you
+ want to exclude some so that the <filename>do_patch</filename>
+ task does not apply them during the patch phase, you can use
+ the "apply=no" parameter with the <filename>SRC_URI</filename>
+ statement:
+ <literallayout class='monospaced'>
+ SRC_URI = " \
+ git://<replaceable>path_to_repo</replaceable>/<replaceable>some_package</replaceable> \
+ file://<replaceable>path_to_lots_of_patch_files</replaceable> \
+ file://<replaceable>path_to_lots_of_patch_files</replaceable>/<replaceable>patch_file5</replaceable>;apply=no \
+ "
+ </literallayout>
+ In the previous example, assuming all the files in the directory
+ holding the patch files end with either <filename>.patch</filename>
+ or <filename>.diff</filename>, every file would be applied as a
+ patch by default except for the
+ <replaceable>patch_file5</replaceable> patch.
+ </para>
+
+ <para>
+ You can find out more about the patching process in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>Patching</ulink>"
+ section in the Yocto Project Overview and Concepts Manual and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-populate_lic'>
+ <title><filename>do_populate_lic</filename></title>
+
+ <para>
+ Writes license information for the recipe that is collected later
+ when the image is constructed.
+ </para>
+ </section>
+
+ <section id='ref-tasks-populate_sdk'>
+ <title><filename>do_populate_sdk</filename></title>
+
+ <para>
+ Creates the file and directory structure for an installable SDK.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-generation-dev-environment'>SDK Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for more
+ information.
+ </para>
+ </section>
+
+ <section id='ref-tasks-populate_sysroot'>
+ <title><filename>do_populate_sysroot</filename></title>
+
+ <para>
+ Stages (copies) a subset of the files installed by the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task into the appropriate sysroot.
+ For information on how to access these files from other recipes,
+ see the
+ <link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR*</filename></link>
+ variables.
+ Directories that would typically not be needed by other recipes at
+ build time (e.g. <filename>/etc</filename>) are not copied by
+ default.
+ </para>
+
+ <para>
+ For information on what directories are copied by default, see the
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS*</filename></link>
+ variables.
+ You can change these variables inside your recipe if you need
+ to make additional (or fewer) directories available to other
+ recipes at build time.
+ </para>
+
+ <para>
+ The <filename>do_populate_sysroot</filename> task is a
+ shared state (sstate) task, which means that the task can
+ be accelerated through sstate use.
+ Realize also that if the task is re-executed, any previous output
+ is removed (i.e. "cleaned").
+ </para>
+ </section>
+
+ <section id='ref-tasks-prepare_recipe_sysroot'>
+ <title><filename>do_prepare_recipe_sysroot</filename></title>
+
+ <para>
+ Installs the files into the individual recipe specific sysroots
+ (i.e. <filename>recipe-sysroot</filename> and
+ <filename>recipe-sysroot-native</filename> under
+ <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>
+ based upon the dependencies specified by
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>).
+ See the
+ "<link linkend='ref-classes-staging'><filename>staging</filename></link>"
+ class for more information.
+ </para>
+ </section>
+
+ <section id='ref-tasks-rm_work'>
+ <title><filename>do_rm_work</filename></title>
+
+ <para>
+ Removes work files after the OpenEmbedded build system has
+ finished with them.
+ You can learn more by looking at the
+ "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>"
+ section.
+ </para>
+ </section>
+
+ <section id='ref-tasks-rm_work_all'>
+ <title><filename>do_rm_work_all</filename></title>
+
+ <para>
+ Top-level task for removing work files after the build system has
+ finished with them.
+ </para>
+ </section>
+
+ <section id='ref-tasks-unpack'>
+ <title><filename>do_unpack</filename></title>
+
+ <para>
+ Unpacks the source code into a working directory pointed to
+ by
+ <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}</filename>.
+ The
+ <link linkend='var-S'><filename>S</filename></link> variable also
+ plays a role in where unpacked source files ultimately reside.
+ For more information on how source files are unpacked, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#source-fetching-dev-environment'>Source Fetching</ulink>"
+ section in the Yocto Project Overview and Concepts Manual and also
+ see the <filename>WORKDIR</filename> and
+ <filename>S</filename> variable descriptions.
+ </para>
+ </section>
+</section>
+
+<section id='manually-called-tasks'>
+ <title>Manually Called Tasks</title>
+
+ <para>
+ These tasks are typically manually triggered (e.g. by using the
+ <filename>bitbake -c</filename> command-line option):
+ </para>
+
+ <section id='ref-tasks-checkpkg'>
+ <title><filename>do_checkpkg</filename></title>
+
+ <para>
+ Provides information about the recipe including its upstream
+ version and status.
+ The upstream version and status reveals whether or not a version
+ of the recipe exists upstream and a status of not updated, updated,
+ or unknown.
+ </para>
+
+ <para>
+ The <filename>checkpkg</filename> task is included as part of the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class.
+ </para>
+
+ <para>
+ To build the <filename>checkpkg</filename> task, use the
+ <filename>bitbake</filename> command with the "-c" option and
+ task name:
+ <literallayout class='monospaced'>
+ $ bitbake core-image-minimal -c checkpkg
+ </literallayout>
+ By default, the results are stored in
+ <link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link>
+ (e.g. <filename>$BUILD_DIR/tmp/log</filename>).
+ </para>
+ </section>
+
+ <section id='ref-tasks-checkuri'>
+ <title><filename>do_checkuri</filename></title>
+
+ <para>
+ Validates the
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ value.
+ </para>
+ </section>
+
+ <section id='ref-tasks-clean'>
+ <title><filename>do_clean</filename></title>
+
+ <para>
+ Removes all output files for a target from the
+ <link linkend='ref-tasks-unpack'><filename>do_unpack</filename></link>
+ task forward (i.e. <filename>do_unpack</filename>,
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>,
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>,
+ and
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>).
+ </para>
+
+ <para>
+ You can run this task using BitBake as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -c clean <replaceable>recipe</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ Running this task does not remove the
+ <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>
+ cache files.
+ Consequently, if no changes have been made and the recipe is
+ rebuilt after cleaning, output files are simply restored from the
+ sstate cache.
+ If you want to remove the sstate cache files for the recipe,
+ you need to use the
+ <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
+ task instead (i.e. <filename>bitbake -c cleansstate</filename> <replaceable>recipe</replaceable>).
+ </para>
+ </section>
+
+ <section id='ref-tasks-cleanall'>
+ <title><filename>do_cleanall</filename></title>
+
+ <para>
+ Removes all output files, shared state
+ (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>)
+ cache, and downloaded source files for a target (i.e. the contents
+ of
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>).
+ Essentially, the <filename>do_cleanall</filename> task is
+ identical to the
+ <link linkend='ref-tasks-cleansstate'><filename>do_cleansstate</filename></link>
+ task with the added removal of downloaded source files.
+ </para>
+
+ <para>
+ You can run this task using BitBake as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -c cleanall <replaceable>recipe</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ Typically, you would not normally use the
+ <filename>cleanall</filename> task.
+ Do so only if you want to start fresh with the
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>
+ task.
+ </para>
+ </section>
+
+ <section id='ref-tasks-cleansstate'>
+ <title><filename>do_cleansstate</filename></title>
+
+ <para>
+ Removes all output files and shared state
+ (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>)
+ cache for a target.
+ Essentially, the <filename>do_cleansstate</filename> task is
+ identical to the
+ <link linkend='ref-tasks-clean'><filename>do_clean</filename></link>
+ task with the added removal of shared state
+ (<ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>sstate</ulink>)
+ cache.
+ </para>
+
+ <para>
+ You can run this task using BitBake as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -c cleansstate <replaceable>recipe</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ When you run the <filename>do_cleansstate</filename> task,
+ the OpenEmbedded build system no longer uses any
+ sstate.
+ Consequently, building the recipe from scratch is guaranteed.
+ <note>
+ The <filename>do_cleansstate</filename> task cannot remove
+ sstate from a remote sstate mirror.
+ If you need to build a target from scratch using remote
+ mirrors, use the "-f" option as follows:
+ <literallayout class='monospaced'>
+ $ bitbake -f -c do_cleansstate <replaceable>target</replaceable>
+ </literallayout>
+ </note>
+ </para>
+ </section>
+
+ <section id='ref-tasks-devpyshell'>
+ <title><filename>do_devpyshell</filename></title>
+
+ <para>
+ Starts a shell in which an interactive Python interpreter allows
+ you to interact with the BitBake build environment.
+ From within this shell, you can directly examine and set
+ bits from the data store and execute functions as if within
+ the BitBake environment.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devpyshell'>Using a Development Python Shell</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information about using <filename>devpyshell</filename>.
+ </para>
+ </section>
+
+ <section id='ref-tasks-devshell'>
+ <title><filename>do_devshell</filename></title>
+
+ <para>
+ Starts a shell whose environment is set up for
+ development, debugging, or both.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>"
+ section in the Yocto Project Development Tasks Manual for more
+ information about using <filename>devshell</filename>.
+ </para>
+ </section>
+
+ <section id='ref-tasks-listtasks'>
+ <title><filename>do_listtasks</filename></title>
+
+ <para>
+ Lists all defined tasks for a target.
+ </para>
+ </section>
+
+ <section id='ref-tasks-package_index'>
+ <title><filename>do_package_index</filename></title>
+
+ <para>
+ Creates or updates the index in the
+ <ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>
+ area.
+ <note>
+ This task is not triggered with the
+ <filename>bitbake -c</filename> command-line option as
+ are the other tasks in this section.
+ Because this task is specifically for the
+ <filename>package-index</filename> recipe,
+ you run it using
+ <filename>bitbake package-index</filename>.
+ </note>
+ </para>
+ </section>
+</section>
+
+<section id='image-related-tasks'>
+ <title>Image-Related Tasks</title>
+
+ <para>
+ The following tasks are applicable to image recipes.
+ </para>
+
+ <section id='ref-tasks-bootimg'>
+ <title><filename>do_bootimg</filename></title>
+
+ <para>
+ Creates a bootable live image.
+ See the
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable for additional information on live image types.
+ </para>
+ </section>
+
+ <section id='ref-tasks-bundle_initramfs'>
+ <title><filename>do_bundle_initramfs</filename></title>
+
+ <para>
+ Combines an initial RAM disk (initramfs) image and kernel
+ together to form a single image.
+ The
+ <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link>
+ variable has some more information about these types of images.
+ </para>
+ </section>
+
+ <section id='ref-tasks-rootfs'>
+ <title><filename>do_rootfs</filename></title>
+
+ <para>
+ Creates the root filesystem (file and directory structure) for an
+ image.
+ See the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual for more
+ information on how the root filesystem is created.
+ </para>
+ </section>
+
+ <section id='ref-tasks-testimage'>
+ <title><filename>do_testimage</filename></title>
+
+ <para>
+ Boots an image and performs runtime tests within the image.
+ For information on automatically testing images, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-testimage_auto'>
+ <title><filename>do_testimage_auto</filename></title>
+
+ <para>
+ Boots an image and performs runtime tests within the image
+ immediately after it has been built.
+ This task is enabled when you set
+ <link linkend='var-TEST_IMAGE'><filename>TEST_IMAGE</filename></link>
+ equal to "1".
+ </para>
+
+ <para>
+ For information on automatically testing images, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+</section>
+
+<section id='kernel-related-tasks'>
+ <title>Kernel-Related Tasks</title>
+
+ <para>
+ The following tasks are applicable to kernel recipes.
+ Some of these tasks (e.g. the
+ <link linkend='ref-tasks-menuconfig'><filename>do_menuconfig</filename></link>
+ task) are also applicable to recipes that use
+ Linux kernel style configuration such as the BusyBox recipe.
+ </para>
+
+ <section id='ref-tasks-compile_kernelmodules'>
+ <title><filename>do_compile_kernelmodules</filename></title>
+
+ <para>
+ Runs the step that builds the kernel modules (if needed).
+ Building a kernel consists of two steps: 1) the kernel
+ (<filename>vmlinux</filename>) is built, and 2) the modules
+ are built (i.e. <filename>make modules</filename>).
+ </para>
+ </section>
+
+ <section id='ref-tasks-diffconfig'>
+ <title><filename>do_diffconfig</filename></title>
+
+ <para>
+ When invoked by the user, this task creates a file containing the
+ differences between the original config as produced by
+ <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link>
+ task and the changes made by the user with other methods
+ (i.e. using
+ (<link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>).
+ Once the file of differences is created, it can be used to create
+ a config fragment that only contains the differences.
+ You can invoke this task from the command line as follows:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c diffconfig
+ </literallayout>
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#creating-config-fragments'>Creating Configuration Fragments</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_checkout'>
+ <title><filename>do_kernel_checkout</filename></title>
+
+ <para>
+ Converts the newly unpacked kernel source into a form with which
+ the OpenEmbedded build system can work.
+ Because the kernel source can be fetched in several different ways,
+ the <filename>do_kernel_checkout</filename> task makes sure that
+ subsequent tasks are given a clean working tree copy of the kernel
+ with the correct branches checked out.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_configcheck'>
+ <title><filename>do_kernel_configcheck</filename></title>
+
+ <para>
+ Validates the configuration produced by the
+ <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>
+ task.
+ The <filename>do_kernel_configcheck</filename> task produces
+ warnings when a requested configuration does not appear in the
+ final <filename>.config</filename> file or when you override a
+ policy configuration in a hardware configuration fragment.
+ You can run this task explicitly and view the output by using
+ the following command:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c kernel_configcheck -f
+ </literallayout>
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#validating-configuration'>Validating Configuration</ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_configme'>
+ <title><filename>do_kernel_configme</filename></title>
+
+ <para>
+ After the kernel is patched by the
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ task, the <filename>do_kernel_configme</filename> task assembles
+ and merges all the kernel config fragments into a merged
+ configuration that can then be passed to the kernel configuration
+ phase proper.
+ This is also the time during which user-specified defconfigs
+ are applied if present, and where configuration modes such as
+ <filename>--allnoconfig</filename> are applied.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_menuconfig'>
+ <title><filename>do_kernel_menuconfig</filename></title>
+
+ <para>
+ Invoked by the user to manipulate the
+ <filename>.config</filename> file used to build a linux-yocto
+ recipe.
+ This task starts the Linux kernel configuration tool, which you
+ then use to modify the kernel configuration.
+ <note>
+ You can also invoke this tool from the command line as
+ follows:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c menuconfig
+ </literallayout>
+ </note>
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-menuconfig'>Using <filename>menuconfig</filename></ulink>"
+ section in the Yocto Project Linux Kernel Development Manual
+ for more information on this configuration tool.
+ </para>
+ </section>
+
+ <section id='ref-tasks-kernel_metadata'>
+ <title><filename>do_kernel_metadata</filename></title>
+
+ <para>
+ Collects all the features required for a given kernel build,
+ whether the features come from
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ or from Git repositories.
+ After collection, the <filename>do_kernel_metadata</filename> task
+ processes the features into a series of config fragments and
+ patches, which can then be applied by subsequent tasks such as
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ and
+ <link linkend='ref-tasks-kernel_configme'><filename>do_kernel_configme</filename></link>.
+ </para>
+ </section>
+
+ <section id='ref-tasks-menuconfig'>
+ <title><filename>do_menuconfig</filename></title>
+
+ <para>
+ Runs <filename>make menuconfig</filename> for the kernel.
+ For information on <filename>menuconfig</filename>, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-menuconfig'>Using&nbsp;&nbsp;<filename>menuconfig</filename></ulink>"
+ section in the Yocto Project Linux Kernel Development Manual.
+ </para>
+ </section>
+
+ <section id='ref-tasks-savedefconfig'>
+ <title><filename>do_savedefconfig</filename></title>
+
+ <para>
+ When invoked by the user, creates a defconfig file that can be
+ used instead of the default defconfig.
+ The saved defconfig contains the differences between the default
+ defconfig and the changes made by the user using other methods
+ (i.e. the
+ <link linkend='ref-tasks-kernel_menuconfig'><filename>do_kernel_menuconfig</filename></link>
+ task.
+ You can invoke the task using the following command:
+ <literallayout class='monospaced'>
+ $ bitbake linux-yocto -c savedefconfig
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='ref-tasks-shared_workdir'>
+ <title><filename>do_shared_workdir</filename></title>
+
+ <para>
+ After the kernel has been compiled but before the kernel modules
+ have been compiled, this task copies files required for module
+ builds and which are generated from the kernel build into the
+ shared work directory.
+ With these copies successfully copied, the
+ <link linkend='ref-tasks-compile_kernelmodules'><filename>do_compile_kernelmodules</filename></link>
+ task can successfully build the kernel modules in the next step
+ of the build.
+ </para>
+ </section>
+
+ <section id='ref-tasks-sizecheck'>
+ <title><filename>do_sizecheck</filename></title>
+
+ <para>
+ After the kernel has been built, this task checks the size of the
+ stripped kernel image against
+ <link linkend='var-KERNEL_IMAGE_MAXSIZE'><filename>KERNEL_IMAGE_MAXSIZE</filename></link>.
+ If that variable was set and the size of the stripped kernel
+ exceeds that size, the kernel build produces a warning to that
+ effect.
+ </para>
+ </section>
+
+ <section id='ref-tasks-strip'>
+ <title><filename>do_strip</filename></title>
+
+ <para>
+ If
+ <filename>KERNEL_IMAGE_STRIP_EXTRA_SECTIONS</filename> is defined,
+ this task strips the sections named in that variable from
+ <filename>vmlinux</filename>.
+ This stripping is typically used to remove nonessential sections
+ such as <filename>.comment</filename> sections from a
+ size-sensitive configuration.
+ </para>
+ </section>
+
+ <section id='ref-tasks-validate_branches'>
+ <title><filename>do_validate_branches</filename></title>
+
+ <para>
+ After the kernel is unpacked but before it is patched, this task
+ makes sure that the machine and metadata branches as specified
+ by the <link linkend='var-SRCREV'><filename>SRCREV</filename></link>
+ variables actually exist on the specified branches.
+ If these branches do not exist and
+ <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link>
+ is not being used, the <filename>do_validate_branches</filename>
+ task fails during the build.
+ </para>
+ </section>
+</section>
+
+<section id='miscellaneous-tasks'>
+ <title>Miscellaneous Tasks</title>
+
+ <para>
+ The following sections describe miscellaneous tasks.
+ </para>
+
+ <section id='ref-tasks-spdx'>
+ <title><filename>do_spdx</filename></title>
+
+ <para>
+ A build stage that takes the source code and scans it on a remote
+ FOSSOLOGY server in order to produce an SPDX document.
+ This task applies only to the
+ <link linkend='ref-classes-spdx'><filename>spdx</filename></link>
+ class.
+ </para>
+ </section>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-terms.xml b/poky/documentation/ref-manual/ref-terms.xml
new file mode 100644
index 000000000..cc09d3f8a
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-terms.xml
@@ -0,0 +1,507 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-terms'>
+<title>Yocto Project Terms</title>
+
+ <para>
+ Following is a list of terms and definitions users new to the Yocto
+ Project development environment might find helpful.
+ While some of these terms are universal, the list includes them
+ just in case:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Append Files:</emphasis>
+ Files that append build information to a recipe file.
+ Append files are known as BitBake append files and
+ <filename>.bbappend</filename> files.
+ The OpenEmbedded build system expects every append file to have
+ a corresponding recipe (<filename>.bb</filename>) file.
+ Furthermore, the append file and corresponding recipe file
+ must use the same root filename.
+ The filenames can differ only in the file type suffix used
+ (e.g.
+ <filename>formfactor_0.0.bb</filename> and
+ <filename>formfactor_0.0.bbappend</filename>).</para>
+
+ <para>Information in append files extends or overrides the
+ information in the similarly-named recipe file.
+ For an example of an append file in use, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ <note>
+ Append files can also use wildcard patterns in their
+ version numbers so they can be applied to more than one
+ version of the underlying recipe file.
+ </note>
+ </para></listitem>
+ <listitem><para id='bitbake-term'>
+ <emphasis>BitBake:</emphasis>
+ The task executor and scheduler used by the OpenEmbedded build
+ system to build images.
+ For more information on BitBake, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para></listitem>
+ <listitem><para id='board-support-package-bsp-term'>
+ <emphasis>Board Support Package (BSP):</emphasis>
+ A group of drivers, definitions, and other components that
+ provide support for a specific hardware configuration.
+ For more information on BSPs, see the
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>.
+ </para></listitem>
+ <listitem>
+ <para id='build-directory'>
+ <emphasis>Build Directory:</emphasis>
+ This term refers to the area used by the OpenEmbedded build
+ system for builds.
+ The area is created when you <filename>source</filename> the
+ setup environment script that is found in the Source Directory
+ (i.e. <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>).
+ The
+ <link linkend='var-TOPDIR'><filename>TOPDIR</filename></link>
+ variable points to the Build Directory.</para>
+
+ <para>You have a lot of flexibility when creating the Build
+ Directory.
+ Following are some examples that show how to create the
+ directory.
+ The examples assume your
+ <link linkend='source-directory'>Source Directory</link> is
+ named <filename>poky</filename>:
+ <itemizedlist>
+ <listitem><para>Create the Build Directory inside your
+ Source Directory and let the name of the Build
+ Directory default to <filename>build</filename>:
+ <literallayout class='monospaced'>
+ $ cd $HOME/poky
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Create the Build Directory inside your
+ home directory and specifically name it
+ <filename>test-builds</filename>:
+ <literallayout class='monospaced'>
+ $ cd $HOME
+ $ source poky/&OE_INIT_FILE; test-builds
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Provide a directory path and specifically name the
+ Build Directory.
+ Any intermediate folders in the pathname must exist.
+ This next example creates a Build Directory named
+ <filename>YP-&POKYVERSION;</filename>
+ in your home directory within the existing
+ directory <filename>mybuilds</filename>:
+ <literallayout class='monospaced'>
+ $cd $HOME
+ $ source $HOME/poky/&OE_INIT_FILE; $HOME/mybuilds/YP-&POKYVERSION;
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ By default, the Build Directory contains
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
+ which is a temporary directory the build system uses for
+ its work.
+ <filename>TMPDIR</filename> cannot be under NFS.
+ Thus, by default, the Build Directory cannot be under NFS.
+ However, if you need the Build Directory to be under NFS,
+ you can set this up by setting <filename>TMPDIR</filename>
+ in your <filename>local.conf</filename> file
+ to use a local drive.
+ Doing so effectively separates <filename>TMPDIR</filename>
+ from <filename>TOPDIR</filename>, which is the Build
+ Directory.
+ </note>
+ </para></listitem>
+ <listitem><para id='hardware-build-system-term'>
+ <emphasis>Build Host:</emphasis>
+ The system used to build images in a Yocto Project
+ Development environment.
+ The build system is sometimes referred to as the
+ development host.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Classes:</emphasis>
+ Files that provide for logic encapsulation and inheritance so
+ that commonly used patterns can be defined once and then
+ easily used in multiple recipes.
+ For reference information on the Yocto Project classes, see the
+ "<link linkend='ref-classes'>Classes</link>" chapter.
+ Class files end with the <filename>.bbclass</filename>
+ filename extension.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Configuration File:</emphasis>
+ Files that hold global definitions of variables,
+ user-defined variables, and hardware configuration
+ information.
+ These files tell the OpenEmbedded build system what to
+ build and what to put into the image to support a
+ particular platform.</para>
+
+ <para>Configuration files end with a <filename>.conf</filename>
+ filename extension.
+ The <filename>conf/local.conf</filename> configuration file in
+ the
+ <link linkend='build-directory'>Build Directory</link>
+ contains user-defined variables that affect every build.
+ The <filename>meta-poky/conf/distro/poky.conf</filename>
+ configuration file defines Yocto "distro" configuration
+ variables used only when building with this policy.
+ Machine configuration files, which
+ are located throughout the
+ <link linkend='source-directory'>Source Directory</link>, define
+ variables for specific hardware and are only used when building
+ for that target (e.g. the
+ <filename>machine/beaglebone.conf</filename> configuration
+ file defines variables for the Texas Instruments ARM Cortex-A8
+ development board).
+ </para></listitem>
+ <listitem><para id='term-container-layer'>
+ <emphasis>Container Layer:</emphasis>
+ Layers that hold other layers.
+ An example of a container layer is the
+ <filename>meta-intel</filename> layer.
+ This layer contains BSP layers for the Intel-core2-32
+ <trademark class='registered'>Intel</trademark> Common Core
+ (Intel-core2-32) and the Intel-corei7-64
+ <trademark class='registered'>Intel</trademark> Common Core
+ (Intel-corei7-64).
+ the <filename>meta-intel</filename> layer also contains
+ the <filename>common/</filename> directory, which contains
+ common content across those layers.
+ </para></listitem>
+ <listitem><para id='cross-development-toolchain'>
+ <emphasis>Cross-Development Toolchain:</emphasis>
+ In general, a cross-development toolchain is a collection of
+ software development tools and utilities that run on one
+ architecture and allow you to develop software for a
+ different, or targeted, architecture.
+ These toolchains contain cross-compilers, linkers, and
+ debuggers that are specific to the target architecture.</para>
+
+ <para>The Yocto Project supports two different cross-development
+ toolchains:
+ <itemizedlist>
+ <listitem><para>
+ A toolchain only used by and within
+ BitBake when building an image for a target
+ architecture.
+ </para></listitem>
+ <listitem><para>A relocatable toolchain used outside of
+ BitBake by developers when developing applications
+ that will run on a targeted device.
+ </para></listitem>
+ </itemizedlist></para>
+
+ <para>Creation of these toolchains is simple and automated.
+ For information on toolchain concepts as they apply to the
+ Yocto Project, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ You can also find more information on using the
+ relocatable toolchain in the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Extensible Software Development Kit (eSDK):</emphasis>
+ A custom SDK for application developers.
+ This eSDK allows developers to incorporate their library
+ and programming changes back into the image to make
+ their code available to other application developers.</para>
+
+ <para>For information on the eSDK, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Image:</emphasis>
+ An image is an artifact of the BitBake build process given
+ a collection of recipes and related Metadata.
+ Images are the binary output that run on specific hardware or
+ QEMU and are used for specific use-cases.
+ For a list of the supported image types that the Yocto Project
+ provides, see the
+ "<link linkend='ref-images'>Images</link>"
+ chapter.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Layer:</emphasis>
+ A collection of related recipes.
+ Layers allow you to consolidate related metadata to
+ customize your build.
+ Layers also isolate information used when building
+ for multiple architectures.
+ Layers are hierarchical in their ability to override
+ previous specifications.
+ You can include any number of available layers from the
+ Yocto Project and customize the build by adding your
+ layers after them.
+ You can search the Layer Index for layers used within
+ Yocto Project.</para>
+
+ <para>For introductory information on layers, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ For more detailed information on layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For a discussion specifically on BSP Layers, see the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#bsp-layers'>BSP Layers</ulink>"
+ section in the Yocto Project Board Support Packages (BSP)
+ Developer's Guide.
+ </para></listitem>
+ <listitem><para id='metadata'>
+ <emphasis>Metadata:</emphasis>
+ A key element of the Yocto Project is the Metadata that
+ is used to construct a Linux distribution and is contained
+ in the files that the
+ <link linkend='build-system-term'>OpenEmbedded build system</link>
+ parses when building an image.
+ In general, Metadata includes recipes, configuration
+ files, and other information that refers to the build
+ instructions themselves, as well as the data used to
+ control what things get built and the effects of the
+ build.
+ Metadata also includes commands and data used to
+ indicate what versions of software are used, from
+ where they are obtained, and changes or additions to the
+ software itself (patches or auxiliary files) that
+ are used to fix bugs or customize the software for use
+ in a particular situation.
+ OpenEmbedded-Core is an important set of validated
+ metadata.</para>
+
+ <para>In the context of the kernel ("kernel Metadata"), the
+ term refers to the kernel config fragments and features
+ contained in the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/yocto-kernel-cache'><filename>yocto-kernel-cache</filename></ulink>
+ Git repository.
+ </para></listitem>
+ <listitem><para id='oe-core'>
+ <emphasis>OpenEmbedded-Core (OE-Core):</emphasis>
+ OE-Core is metadata comprised of foundational recipes,
+ classes, and associated files that are meant to be
+ common among many different OpenEmbedded-derived systems,
+ including the Yocto Project.
+ OE-Core is a curated subset of an original repository
+ developed by the OpenEmbedded community that has been
+ pared down into a smaller, core set of continuously
+ validated recipes.
+ The result is a tightly controlled and an quality-assured
+ core set of recipes.</para>
+
+ <para>You can see the Metadata in the
+ <filename>meta</filename> directory of the Yocto Project
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi'>Source Repositories</ulink>.
+ </para></listitem>
+ <listitem><para id='build-system-term'>
+ <emphasis>OpenEmbedded Build System:</emphasis>
+ The build system specific to the Yocto Project.
+ The OpenEmbedded build system is based on another project known
+ as "Poky", which uses
+ <link linkend='bitbake-term'>BitBake</link> as the task
+ executor.
+ Throughout the Yocto Project documentation set, the
+ OpenEmbedded build system is sometimes referred to simply
+ as "the build system".
+ If other build systems, such as a host or target build system
+ are referenced, the documentation clearly states the
+ difference.
+ <note>
+ For some historical information about Poky, see the
+ <link linkend='poky'>Poky</link> term.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Package:</emphasis>
+ In the context of the Yocto Project, this term refers to a
+ recipe's packaged output produced by BitBake (i.e. a
+ "baked recipe").
+ A package is generally the compiled binaries produced from the
+ recipe's sources.
+ You "bake" something by running it through BitBake.</para>
+
+ <para>It is worth noting that the term "package" can,
+ in general, have subtle meanings.
+ For example, the packages referred to in the
+ "<link linkend='required-packages-for-the-host-development-system'>Required Packages for the Host Development System</link>"
+ section are compiled binaries that, when installed, add
+ functionality to your Linux distribution.</para>
+
+ <para>Another point worth noting is that historically within
+ the Yocto Project, recipes were referred to as packages - thus,
+ the existence of several BitBake variables that are seemingly
+ mis-named,
+ (e.g. <link linkend='var-PR'><filename>PR</filename></link>,
+ <link linkend='var-PV'><filename>PV</filename></link>, and
+ <link linkend='var-PE'><filename>PE</filename></link>).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Package Groups:</emphasis>
+ Arbitrary groups of software Recipes.
+ You use package groups to hold recipes that, when built,
+ usually accomplish a single task.
+ For example, a package group could contain the recipes for a
+ company’s proprietary or value-add software.
+ Or, the package group could contain the recipes that enable
+ graphics.
+ A package group is really just another recipe.
+ Because package group files are recipes, they end with the
+ <filename>.bb</filename> filename extension.
+ </para></listitem>
+ <listitem><para id='poky'>
+ <emphasis>Poky:</emphasis>
+ Poky, which is pronounced <emphasis>Pock</emphasis>-ee,
+ is a reference embedded distribution and a reference
+ test configuration.
+ Poky provides the following:
+ <itemizedlist>
+ <listitem><para>
+ A base-level functional distro used to illustrate
+ how to customize a distribution.
+ </para></listitem>
+ <listitem><para>
+ A means by which to test the Yocto Project
+ components (i.e. Poky is used to validate
+ the Yocto Project).
+ </para></listitem>
+ <listitem><para>
+ A vehicle through which you can download
+ the Yocto Project.
+ </para></listitem>
+ </itemizedlist>
+ Poky is not a product level distro.
+ Rather, it is a good starting point for customization.
+ <note>
+ Poky began an open-source
+ project initially developed by OpenedHand.
+ OpenedHand developed Poky from the existing
+ OpenEmbedded build system to create a commercially
+ supportable build system for embedded Linux.
+ After Intel Corporation acquired OpenedHand, the
+ poky project became the basis for the Yocto Project's
+ build system.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Recipe:</emphasis>
+ A set of instructions for building packages.
+ A recipe describes where you get source code, which patches
+ to apply, how to configure the source, how to compile it and so on.
+ Recipes also describe dependencies for libraries or for other
+ recipes.
+ Recipes represent the logical unit of execution, the software
+ to build, the images to build, and use the
+ <filename>.bb</filename> file extension.
+ </para></listitem>
+ <listitem><para id='reference-kit-term'>
+ <emphasis>Reference Kit:</emphasis>
+ A working example of a system, which includes a
+ <link linkend='board-support-package-bsp-term'>BSP</link>
+ as well as a
+ <link linkend='hardware-build-system-term'>build host</link>
+ and other components, that can work on specific hardware.
+ </para></listitem>
+ <listitem>
+ <para id='source-directory'>
+ <emphasis>Source Directory:</emphasis>
+ This term refers to the directory structure created as a result
+ of creating a local copy of the <filename>poky</filename> Git
+ repository <filename>git://git.yoctoproject.org/poky</filename>
+ or expanding a released <filename>poky</filename> tarball.
+ <note>
+ Creating a local copy of the <filename>poky</filename>
+ Git repository is the recommended method for setting up
+ your Source Directory.
+ </note>
+ Sometimes you might hear the term "poky directory" used to refer
+ to this directory structure.
+ <note>
+ The OpenEmbedded build system does not support file or
+ directory names that contain spaces.
+ Be sure that the Source Directory you use does not contain
+ these types of names.
+ </note></para>
+
+ <para>The Source Directory contains BitBake, Documentation,
+ Metadata and other files that all support the Yocto Project.
+ Consequently, you must have the Source Directory in place on
+ your development system in order to do any development using
+ the Yocto Project.</para>
+
+ <para>When you create a local copy of the Git repository, you
+ can name the repository anything you like.
+ Throughout much of the documentation, "poky"
+ is used as the name of the top-level folder of the local copy of
+ the poky Git repository.
+ So, for example, cloning the <filename>poky</filename> Git
+ repository results in a local Git repository whose top-level
+ folder is also named "poky".</para>
+
+ <para>While it is not recommended that you use tarball expansion
+ to set up the Source Directory, if you do, the top-level
+ directory name of the Source Directory is derived from the
+ Yocto Project release tarball.
+ For example, downloading and unpacking
+ <filename>&YOCTO_POKY_TARBALL;</filename> results in a
+ Source Directory whose root folder is named
+ <filename>&YOCTO_POKY;</filename>.</para>
+
+ <para>It is important to understand the differences between the
+ Source Directory created by unpacking a released tarball as
+ compared to cloning
+ <filename>git://git.yoctoproject.org/poky</filename>.
+ When you unpack a tarball, you have an exact copy of the files
+ based on the time of release - a fixed release point.
+ Any changes you make to your local files in the Source Directory
+ are on top of the release and will remain local only.
+ On the other hand, when you clone the <filename>poky</filename>
+ Git repository, you have an active development repository with
+ access to the upstream repository's branches and tags.
+ In this case, any local changes you make to the local
+ Source Directory can be later applied to active development
+ branches of the upstream <filename>poky</filename> Git
+ repository.</para>
+
+ <para>For more information on concepts related to Git
+ repositories, branches, and tags, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#repositories-tags-and-branches'>Repositories, Tags, and Branches</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para></listitem>
+ <listitem><para><emphasis>Task:</emphasis>
+ A unit of execution for BitBake (e.g.
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>,
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>,
+ and so forth).
+ </para></listitem>
+ <listitem><para id='toaster-term'><emphasis>Toaster:</emphasis>
+ A web interface to the Yocto Project's
+ <link linkend='build-system-term'>OpenEmbedded Build System</link>.
+ The interface enables you to configure and run your builds.
+ Information about builds is collected and stored in a database.
+ For information on Toaster, see the
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Upstream:</emphasis>
+ A reference to source code or repositories
+ that are not local to the development system but located in a
+ master area that is controlled by the maintainer of the source
+ code.
+ For example, in order for a developer to work on a particular
+ piece of code, they need to first get a copy of it from an
+ "upstream" source.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-variables.xml b/poky/documentation/ref-manual/ref-variables.xml
new file mode 100644
index 000000000..1c55a92d1
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-variables.xml
@@ -0,0 +1,16652 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<!-- Dummy chapter -->
+<chapter id='ref-variables-glos'>
+
+<title>Variables Glossary</title>
+
+<para>
+ This chapter lists common variables used in the OpenEmbedded build system and gives an overview
+ of their function and contents.
+</para>
+
+<glossary id='ref-variables-glossary'>
+
+
+ <para>
+ <link linkend='var-ABIEXTENSION'>A</link>
+ <link linkend='var-B'>B</link>
+ <link linkend='var-CACHE'>C</link>
+ <link linkend='var-D'>D</link>
+ <link linkend='var-EFI_PROVIDER'>E</link>
+ <link linkend='var-FEATURE_PACKAGES'>F</link>
+ <link linkend='var-GCCPIE'>G</link>
+ <link linkend='var-HOMEPAGE'>H</link>
+ <link linkend='var-ICECC_DISABLED'>I</link>
+<!-- <link linkend='var-glossary-j'>J</link> -->
+ <link linkend='var-KARCH'>K</link>
+ <link linkend='var-LABELS'>L</link>
+ <link linkend='var-MACHINE'>M</link>
+ <link linkend='var-NATIVELSBSTRING'>N</link>
+ <link linkend='var-OBJCOPY'>O</link>
+ <link linkend='var-P'>P</link>
+<!-- <link linkend='var-glossary-q'>Q</link> -->
+ <link linkend='var-RANLIB'>R</link>
+ <link linkend='var-S'>S</link>
+ <link linkend='var-T'>T</link>
+ <link linkend='var-UBOOT_CONFIG'>U</link>
+ <link linkend='var-VOLATILE_LOG_DIR'>V</link>
+ <link linkend='var-WARN_QA'>W</link>
+ <link linkend='var-XSERVER'>X</link>
+<!-- <link linkend='var-glossary-y'>Y</link> -->
+<!-- <link linkend='var-glossary-z'>Z</link>-->
+ </para>
+
+ <glossdiv id='var-glossary-a'><title>A</title>
+
+ <glossentry id='var-ABIEXTENSION'><glossterm>ABIEXTENSION</glossterm>
+ <info>
+ ABIEXTENSION[doc] = "Extension to the Application Binary Interface (ABI) field of the GNU canonical architecture name (e.g. "eabi")."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extension to the Application Binary Interface (ABI)
+ field of the GNU canonical architecture name
+ (e.g. "eabi").
+ </para>
+
+ <para>
+ ABI extensions are set in the machine include files.
+ For example, the
+ <filename>meta/conf/machine/include/arm/arch-arm.inc</filename>
+ file sets the following extension:
+ <literallayout class='monospaced'>
+ ABIEXTENSION = "eabi"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ALLOW_EMPTY'><glossterm>ALLOW_EMPTY</glossterm>
+ <info>
+ ALLOW_EMPTY[doc] = "Specifies whether to produce an output package even if it is empty."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies whether to produce an output package even if it is
+ empty.
+ By default, BitBake does not produce empty packages.
+ This default behavior can cause issues when there is an
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link> or
+ some other hard runtime requirement on the existence of the package.
+ </para>
+
+ <para>
+ Like all package-controlling variables, you must always use them in
+ conjunction with a package name override, as in:
+ <literallayout class='monospaced'>
+ ALLOW_EMPTY_${PN} = "1"
+ ALLOW_EMPTY_${PN}-dev = "1"
+ ALLOW_EMPTY_${PN}-staticdev = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ALTERNATIVE'><glossterm>ALTERNATIVE</glossterm>
+ <info>
+ ALTERNATIVE[doc] = "Lists commands in a package that need an alternative binary naming scheme."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists commands in a package that need an alternative
+ binary naming scheme.
+ Sometimes the same command is provided in multiple packages.
+ When this occurs, the OpenEmbedded build system needs to
+ use the alternatives system to create a different binary
+ naming scheme so the commands can co-exist.
+ </para>
+
+ <para>
+ To use the variable, list out the package's commands
+ that also exist as part of another package.
+ For example, if the <filename>busybox</filename> package
+ has four commands that also exist as part of another
+ package, you identify them as follows:
+ <literallayout class='monospaced'>
+ ALTERNATIVE_busybox = "sh sed test bracket"
+ </literallayout>
+ For more information on the alternatives system, see the
+ "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ALTERNATIVE_LINK_NAME'><glossterm>ALTERNATIVE_LINK_NAME</glossterm>
+ <info>
+ ALTERNATIVE_LINK_NAME[doc] = "Used by the alternatives system to map duplicated commands to actual locations."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used by the alternatives system to map duplicated commands
+ to actual locations.
+ For example, if the <filename>bracket</filename> command
+ provided by the <filename>busybox</filename> package is
+ duplicated through another package, you must use the
+ <filename>ALTERNATIVE_LINK_NAME</filename> variable to
+ specify the actual location:
+ <literallayout class='monospaced'>
+ ALTERNATIVE_LINK_NAME[bracket] = "/usr/bin/["
+ </literallayout>
+ </para>
+
+ <para>
+ In this example, the binary for the
+ <filename>bracket</filename> command (i.e.
+ <filename>[</filename>) from the
+ <filename>busybox</filename> package resides in
+ <filename>/usr/bin/</filename>.
+ <note>
+ If <filename>ALTERNATIVE_LINK_NAME</filename> is not
+ defined, it defaults to
+ <filename>${bindir}/<replaceable>name</replaceable></filename>.
+ </note>
+ </para>
+
+ <para>
+ For more information on the alternatives system, see the
+ "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ALTERNATIVE_PRIORITY'><glossterm>ALTERNATIVE_PRIORITY</glossterm>
+ <info>
+ ALTERNATIVE_PRIORITY[doc] = "Used by the alternatives system to create default priorities for duplicated commands."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used by the alternatives system to create default
+ priorities for duplicated commands.
+ You can use the variable to create a single default
+ regardless of the command name or package, a default for
+ specific duplicated commands regardless of the package, or
+ a default for specific commands tied to particular packages.
+ Here are the available syntax forms:
+ <literallayout class='monospaced'>
+ ALTERNATIVE_PRIORITY = "<replaceable>priority</replaceable>"
+ ALTERNATIVE_PRIORITY[<replaceable>name</replaceable>] = "<replaceable>priority</replaceable>"
+ ALTERNATIVE_PRIORITY_<replaceable>pkg</replaceable>[<replaceable>name</replaceable>] = "<replaceable>priority</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on the alternatives system, see the
+ "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ALTERNATIVE_TARGET'><glossterm>ALTERNATIVE_TARGET</glossterm>
+ <info>
+ ALTERNATIVE_TARGET[doc] = "Used by the alternatives system to create default link locations for duplicated commands."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used by the alternatives system to create default link
+ locations for duplicated commands.
+ You can use the variable to create a single default
+ location for all duplicated commands regardless of the
+ command name or package, a default for
+ specific duplicated commands regardless of the package, or
+ a default for specific commands tied to particular packages.
+ Here are the available syntax forms:
+ <literallayout class='monospaced'>
+ ALTERNATIVE_TARGET = "<replaceable>target</replaceable>"
+ ALTERNATIVE_TARGET[<replaceable>name</replaceable>] = "<replaceable>target</replaceable>"
+ ALTERNATIVE_TARGET_<replaceable>pkg</replaceable>[<replaceable>name</replaceable>] = "<replaceable>target</replaceable>"
+ </literallayout>
+ <note>
+ <para>
+ If <filename>ALTERNATIVE_TARGET</filename> is not
+ defined, it inherits the value from the
+ <link linkend='var-ALTERNATIVE_LINK_NAME'><filename>ALTERNATIVE_LINK_NAME</filename></link>
+ variable.
+ </para>
+
+ <para>
+ If <filename>ALTERNATIVE_LINK_NAME</filename> and
+ <filename>ALTERNATIVE_TARGET</filename> are the
+ same, the target for
+ <filename>ALTERNATIVE_TARGET</filename>
+ has "<filename>.{BPN}</filename>" appended to it.
+ </para>
+
+ <para>
+ Finally, if the file referenced has not been
+ renamed, the alternatives system will rename it to
+ avoid the need to rename alternative files in the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task while
+ retaining support for the command if necessary.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ For more information on the alternatives system, see the
+ "<link linkend='ref-classes-update-alternatives'><filename>update-alternatives.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-APPEND'><glossterm>APPEND</glossterm>
+ <info>
+ APPEND[doc] = "An override list of append strings for target specified using LABELS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An override list of append strings for each target
+ specified with
+ <link linkend='var-LABELS'><filename>LABELS</filename></link>.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link>
+ class for more information on how this variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AR'><glossterm>AR</glossterm>
+ <info>
+ AR[doc] = "Minimal command and arguments to run 'ar'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run
+ <filename>ar</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ARCHIVER_MODE'><glossterm>ARCHIVER_MODE</glossterm>
+ <info>
+ ARCHIVER_MODE[doc] = "Controls archive creation used when releasing source files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used with the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class, determines the type of information used to create
+ a released archive.
+ You can use this variable to create archives of patched
+ source, original source, configured source, and so forth
+ by employing the following variable flags (varflags):
+ <literallayout class='monospaced'>
+ ARCHIVER_MODE[src] = "original" # Uses original (unpacked) source
+ # files.
+
+ ARCHIVER_MODE[src] = "patched" # Uses patched source files. This is
+ # the default.
+
+ ARCHIVER_MODE[src] = "configured" # Uses configured source files.
+
+ ARCHIVER_MODE[diff] = "1" # Uses patches between do_unpack and
+ # do_patch.
+
+ ARCHIVER_MODE[diff-exclude] ?= "<replaceable>file</replaceable> <replaceable>file</replaceable> ..." # Lists files and directories to
+ # exclude from diff.
+
+ ARCHIVER_MODE[dumpdata] = "1" # Uses environment data.
+
+ ARCHIVER_MODE[recipe] = "1" # Uses recipe and include files.
+
+ ARCHIVER_MODE[srpm] = "1" # Uses RPM package files.
+ </literallayout>
+ For information on how the variable works, see the
+ <filename>meta/classes/archiver.bbclass</filename> file
+ in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AS'><glossterm>AS</glossterm>
+ <info>
+ AS[doc] = "Minimal command and arguments to run the assembler."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run the
+ assembler.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ASSUME_PROVIDED'><glossterm>ASSUME_PROVIDED</glossterm>
+ <info>
+ ASSUME_PROVIDED[doc] = "Lists recipe names (PN values) BitBake does not attempt to build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists recipe names
+ (<link linkend='var-PN'><filename>PN</filename></link>
+ values) BitBake does not attempt to build.
+ Instead, BitBake assumes these recipes have already been
+ built.
+ </para>
+
+ <para>
+ In OpenEmbedded-Core, <filename>ASSUME_PROVIDED</filename>
+ mostly specifies native tools that should not be built.
+ An example is <filename>git-native</filename>, which when
+ specified, allows for the Git binary from the host to be
+ used rather than building <filename>git-native</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ASSUME_SHLIBS'><glossterm>ASSUME_SHLIBS</glossterm>
+ <info>
+ ASSUME_SHLIBS[doc] = Provides additional shlibs provider mapping information, which adds to or overwrites the information provided automatically by the system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Provides additional <filename>shlibs</filename> provider
+ mapping information, which adds to or overwrites the
+ information provided automatically by the system.
+ Separate multiple entries using spaces.
+ </para>
+
+ <para>
+ As an example, use the following form to add an
+ <filename>shlib</filename> provider of
+ <replaceable>shlibname</replaceable> in
+ <replaceable>packagename</replaceable> with the optional
+ <replaceable>version</replaceable>:
+ <literallayout class='monospaced'>
+ <replaceable>shlibname:packagename</replaceable>[_<replaceable>version</replaceable>]
+ </literallayout>
+ </para>
+
+ <para>
+ Here is an example that adds a shared library named
+ <filename>libEGL.so.1</filename> as being provided by
+ the <filename>libegl-implementation</filename> package:
+ <literallayout class='monospaced'>
+ ASSUME_SHLIBS = "libEGL.so.1:libegl-implementation"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AUTHOR'><glossterm>AUTHOR</glossterm>
+ <info>
+ AUTHOR[doc] = "Email address used to contact the original author or authors in order to send patches and forward bugs."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The email address used to contact the original author
+ or authors in order to send patches and forward bugs.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AUTO_LIBNAME_PKGS'><glossterm>AUTO_LIBNAME_PKGS</glossterm>
+ <info>
+ AUTO_LIBNAME_PKGS[doc] = "Specifies which packages should be checked for libraries and renamed according to Debian library package naming."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class is inherited, which is the default behavior,
+ <filename>AUTO_LIBNAME_PKGS</filename> specifies which
+ packages should be checked for libraries and renamed
+ according to Debian library package naming.
+ </para>
+
+ <para>
+ The default value is "${PACKAGES}", which causes the
+ debian class to act on all packages that are
+ explicitly generated by the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AUTO_SYSLINUXMENU'><glossterm>AUTO_SYSLINUXMENU</glossterm>
+ <info>
+ AUTO_SYSLINUXMENU[doc] = "Enables creating an automatic menu for the syslinux bootloader."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Enables creating an automatic menu for the syslinux
+ bootloader.
+ You must set this variable in your recipe.
+ The
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class checks this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AUTOREV'><glossterm>AUTOREV</glossterm>
+ <info>
+ AUTOREV[doc] = "When SRCREV is set to the value of this variable, it specifies to use the latest source revision in the repository."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When
+ <filename><link linkend='var-SRCREV'>SRCREV</link></filename>
+ is set to the value of this variable, it specifies to use
+ the latest source revision in the repository.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SRCREV = "${AUTOREV}"
+ </literallayout>
+ </para>
+
+ <para>
+ If you use the previous statement to retrieve the latest
+ version of software, you need to be sure
+ <link linkend='var-PV'><filename>PV</filename></link>
+ contains
+ <filename>${</filename><link linkend='var-SRCPV'><filename>SRCPV</filename></link><filename>}</filename>.
+ For example, suppose you have a kernel recipe that
+ inherits the
+ <link linkend='ref-classes-kernel'>kernel</link> class
+ and you use the previous statement.
+ In this example, <filename>${SRCPV}</filename> does not
+ automatically get into <filename>PV</filename>.
+ Consequently, you need to change <filename>PV</filename>
+ in your recipe so that it does contain
+ <filename>${SRCPV}</filename>.
+ </para>
+
+ <para>
+ For more information see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-AVAILTUNES'><glossterm>AVAILTUNES</glossterm>
+ <info>
+ AVAILTUNES[doc] = "The list of defined CPU and Application Binary Interface (ABI) tunings (i.e. "tunes") available for use by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of defined CPU and Application Binary Interface
+ (ABI) tunings (i.e. "tunes") available for use by the
+ OpenEmbedded build system.
+ </para>
+
+ <para>
+ The list simply presents the tunes that are available.
+ Not all tunes may be compatible with a particular
+ machine configuration, or with each other in a
+ <ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Multilib</ulink>
+ configuration.
+ </para>
+
+ <para>
+ To add a tune to the list, be sure to append it with
+ spaces using the "+=" BitBake operator.
+ Do not simply replace the list by using the "=" operator.
+ See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#basic-syntax'>Basic Syntax</ulink>"
+ section in the BitBake User Manual for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-b'><title>B</title>
+
+ <glossentry id='var-B'><glossterm>B</glossterm>
+ <info>
+ B[doc] = "The Build Directory. The OpenEmbedded build system places generated objects into the Build Directory during a recipe's build process."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory within the
+ <link linkend='build-directory'>Build Directory</link>
+ in which the OpenEmbedded build system places generated
+ objects during a recipe's build process.
+ By default, this directory is the same as the <link linkend='var-S'><filename>S</filename></link>
+ directory, which is defined as:
+ <literallayout class='monospaced'>
+ S = "${WORKDIR}/${BP}"
+ </literallayout>
+ </para>
+
+ <para>
+ You can separate the (<filename>S</filename>) directory
+ and the directory pointed to by the <filename>B</filename>
+ variable.
+ Most Autotools-based recipes support separating these
+ directories.
+ The build system defaults to using separate directories for
+ <filename>gcc</filename> and some kernel recipes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BAD_RECOMMENDATIONS'><glossterm>BAD_RECOMMENDATIONS</glossterm>
+ <info>
+ BAD_RECOMMENDATIONS[doc] = "A list of packages not to install despite being recommended by a recipe. Support for this variable exists only when using the IPK packaging backend."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists "recommended-only" packages to not install.
+ Recommended-only packages are packages installed only
+ through the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variable.
+ You can prevent any of these "recommended" packages from
+ being installed by listing them with the
+ <filename>BAD_RECOMMENDATIONS</filename> variable:
+ <literallayout class='monospaced'>
+ BAD_RECOMMENDATIONS = "<replaceable>package_name</replaceable> <replaceable>package_name</replaceable> <replaceable>package_name</replaceable> ..."
+ </literallayout>
+ </para>
+
+ <para>
+ You can set this variable globally in your
+ <filename>local.conf</filename> file or you can attach it to
+ a specific image recipe by using the recipe name override:
+ <literallayout class='monospaced'>
+ BAD_RECOMMENDATIONS_pn-<replaceable>target_image</replaceable> = "<replaceable>package_name</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ It is important to realize that if you choose to not install
+ packages using this variable and some other packages are
+ dependent on them (i.e. listed in a recipe's
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable), the OpenEmbedded build system ignores your
+ request and will install the packages to avoid dependency
+ errors.
+ </para>
+
+ <para>
+ Support for this variable exists only when using the
+ IPK and RPM packaging backend.
+ Support does not exist for DEB.
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link>
+ and the
+ <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link>
+ variables for related information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BASE_LIB'><glossterm>BASE_LIB</glossterm>
+ <info>
+ BASE_LIB[doc] = "The library directory name for the CPU or Application Binary Interface (ABI) tune."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The library directory name for the CPU or Application
+ Binary Interface (ABI) tune.
+ The <filename>BASE_LIB</filename> applies only in the
+ Multilib context.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#combining-multiple-versions-library-files-into-one-image'>Combining Multiple Versions of Library Files into One Image</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ information on Multilib.
+ </para>
+
+ <para>
+ The <filename>BASE_LIB</filename> variable is defined in
+ the machine include files in the
+ <link linkend='source-directory'>Source Directory</link>.
+ If Multilib is not being used, the value defaults to "lib".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BASE_WORKDIR'><glossterm>BASE_WORKDIR</glossterm>
+ <info>
+ BASE_WORKDIR[doc] = "Points to the base of the work directory for all recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the base of the work directory for all recipes.
+ The default value is "${TMPDIR}/work".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_ALLOWED_NETWORKS'><glossterm>BB_ALLOWED_NETWORKS</glossterm>
+ <info>
+ BB_ALLOWED_NETWORKS[doc] = "A list of hosts that the fetcher is allowed to use to obtain the required source code."
+ </info>
+ <glossdef>
+ <para>
+ Specifies a space-delimited list of hosts that the fetcher
+ is allowed to use to obtain the required source code.
+ Following are considerations surrounding this variable:
+ <itemizedlist>
+ <listitem><para>
+ This host list is only used if
+ <filename>BB_NO_NETWORK</filename> is either not
+ set or set to "0".
+ </para></listitem>
+ <listitem><para>
+ Limited support for wildcard matching against the
+ beginning of host names exists.
+ For example, the following setting matches
+ <filename>git.gnu.org</filename>,
+ <filename>ftp.gnu.org</filename>, and
+ <filename>foo.git.gnu.org</filename>.
+ <literallayout class='monospaced'>
+ BB_ALLOWED_NETWORKS = "*.gnu.org"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Mirrors not in the host list are skipped and
+ logged in debug.
+ </para></listitem>
+ <listitem><para>
+ Attempts to access networks not in the host list
+ cause a failure.
+ </para></listitem>
+ </itemizedlist>
+ Using <filename>BB_ALLOWED_NETWORKS</filename> in
+ conjunction with
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ is very useful.
+ Adding the host you want to use to
+ <filename>PREMIRRORS</filename> results in the source code
+ being fetched from an allowed location and avoids raising
+ an error when a host that is not allowed is in a
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ statement.
+ This is because the fetcher does not attempt to use the
+ host listed in <filename>SRC_URI</filename> after a
+ successful fetch from the
+ <filename>PREMIRRORS</filename> occurs.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DANGLINGAPPENDS_WARNONLY'><glossterm>BB_DANGLINGAPPENDS_WARNONLY</glossterm>
+ <info>
+ BB_DANGLINGAPPENDS_WARNONLY[doc] = "Defines how BitBake handles situations where an append file (.bbappend) has no corresponding recipe file (.bb)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines how BitBake handles situations where an append
+ file (<filename>.bbappend</filename>) has no
+ corresponding recipe file (<filename>.bb</filename>).
+ This condition often occurs when layers get out of sync
+ (e.g. <filename>oe-core</filename> bumps a
+ recipe version and the old recipe no longer exists and the
+ other layer has not been updated to the new version
+ of the recipe yet).
+ </para>
+
+ <para>
+ The default fatal behavior is safest because it is
+ the sane reaction given something is out of sync.
+ It is important to realize when your changes are no longer
+ being applied.
+ </para>
+
+ <para>
+ You can change the default behavior by setting this
+ variable to "1", "yes", or "true"
+ in your <filename>local.conf</filename> file, which is
+ located in the
+ <link linkend='build-directory'>Build Directory</link>:
+ Here is an example:
+ <literallayout class='monospaced'>
+ BB_DANGLINGAPPENDS_WARNONLY = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DISKMON_DIRS'><glossterm>BB_DISKMON_DIRS</glossterm>
+ <info>
+ BB_DISKMON_DIRS[doc] = "Monitors disk space and available inodes during the build and allows you to control the build based on these parameters."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Monitors disk space and available inodes during the build
+ and allows you to control the build based on these
+ parameters.
+ </para>
+
+ <para>
+ Disk space monitoring is disabled by default.
+ To enable monitoring, add the <filename>BB_DISKMON_DIRS</filename>
+ variable to your <filename>conf/local.conf</filename> file found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ Use the following form:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "<replaceable>action</replaceable>,<replaceable>dir</replaceable>,<replaceable>threshold</replaceable> [...]"
+
+ where:
+
+ <replaceable>action</replaceable> is:
+ ABORT: Immediately abort the build when
+ a threshold is broken.
+ STOPTASKS: Stop the build after the currently
+ executing tasks have finished when
+ a threshold is broken.
+ WARN: Issue a warning but continue the
+ build when a threshold is broken.
+ Subsequent warnings are issued as
+ defined by the BB_DISKMON_WARNINTERVAL
+ variable, which must be defined in
+ the conf/local.conf file.
+
+ <replaceable>dir</replaceable> is:
+ Any directory you choose. You can specify one or
+ more directories to monitor by separating the
+ groupings with a space. If two directories are
+ on the same device, only the first directory
+ is monitored.
+
+ <replaceable>threshold</replaceable> is:
+ Either the minimum available disk space,
+ the minimum number of free inodes, or
+ both. You must specify at least one. To
+ omit one or the other, simply omit the value.
+ Specify the threshold using G, M, K for Gbytes,
+ Mbytes, and Kbytes, respectively. If you do
+ not specify G, M, or K, Kbytes is assumed by
+ default. Do not use GB, MB, or KB.
+ </literallayout>
+ </para>
+
+ <para>
+ Here are some examples:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "ABORT,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
+ BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G"
+ BB_DISKMON_DIRS = "ABORT,${TMPDIR},,100K"
+ </literallayout>
+ The first example works only if you also provide
+ the <link linkend='var-BB_DISKMON_WARNINTERVAL'><filename>BB_DISKMON_WARNINTERVAL</filename></link> variable
+ in the <filename>conf/local.conf</filename>.
+ This example causes the build system to immediately
+ abort when either the disk space in <filename>${TMPDIR}</filename> drops
+ below 1 Gbyte or the available free inodes drops below
+ 100 Kbytes.
+ Because two directories are provided with the variable, the
+ build system also issue a
+ warning when the disk space in the
+ <filename>${SSTATE_DIR}</filename> directory drops
+ below 1 Gbyte or the number of free inodes drops
+ below 100 Kbytes.
+ Subsequent warnings are issued during intervals as
+ defined by the <filename>BB_DISKMON_WARNINTERVAL</filename>
+ variable.
+ </para>
+
+ <para>
+ The second example stops the build after all currently
+ executing tasks complete when the minimum disk space
+ in the <filename>${<link linkend='var-TMPDIR'>TMPDIR</link>}</filename>
+ directory drops below 1 Gbyte.
+ No disk monitoring occurs for the free inodes in this case.
+ </para>
+
+ <para>
+ The final example immediately aborts the build when the
+ number of free inodes in the <filename>${TMPDIR}</filename> directory
+ drops below 100 Kbytes.
+ No disk space monitoring for the directory itself occurs
+ in this case.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_DISKMON_WARNINTERVAL'><glossterm>BB_DISKMON_WARNINTERVAL</glossterm>
+ <info>
+ BB_DISKMON_WARNINTERVAL[doc] = "Defines the disk space and free inode warning intervals. To set these intervals, define the variable in the conf/local.conf file in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the disk space and free inode warning intervals.
+ To set these intervals, define the variable in your
+ <filename>conf/local.conf</filename> file in the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+
+ <para>
+ If you are going to use the
+ <filename>BB_DISKMON_WARNINTERVAL</filename> variable, you must
+ also use the
+ <link linkend='var-BB_DISKMON_DIRS'><filename>BB_DISKMON_DIRS</filename></link> variable
+ and define its action as "WARN".
+ During the build, subsequent warnings are issued each time
+ disk space or number of free inodes further reduces by
+ the respective interval.
+ </para>
+
+ <para>
+ If you do not provide a <filename>BB_DISKMON_WARNINTERVAL</filename>
+ variable and you do use <filename>BB_DISKMON_DIRS</filename> with
+ the "WARN" action, the disk monitoring interval defaults to
+ the following:
+ <literallayout class='monospaced'>
+ BB_DISKMON_WARNINTERVAL = "50M,5K"
+ </literallayout>
+ </para>
+
+ <para>
+ When specifying the variable in your configuration file,
+ use the following form:
+ <literallayout class='monospaced'>
+ BB_DISKMON_WARNINTERVAL = "<replaceable>disk_space_interval</replaceable>,<replaceable>disk_inode_interval</replaceable>"
+
+ where:
+
+ <replaceable>disk_space_interval</replaceable> is:
+ An interval of memory expressed in either
+ G, M, or K for Gbytes, Mbytes, or Kbytes,
+ respectively. You cannot use GB, MB, or KB.
+
+ <replaceable>disk_inode_interval</replaceable> is:
+ An interval of free inodes expressed in either
+ G, M, or K for Gbytes, Mbytes, or Kbytes,
+ respectively. You cannot use GB, MB, or KB.
+ </literallayout>
+ </para>
+
+ <para>
+ Here is an example:
+ <literallayout class='monospaced'>
+ BB_DISKMON_DIRS = "WARN,${SSTATE_DIR},1G,100K"
+ BB_DISKMON_WARNINTERVAL = "50M,5K"
+ </literallayout>
+ These variables cause the OpenEmbedded build system to
+ issue subsequent warnings each time the available
+ disk space further reduces by 50 Mbytes or the number
+ of free inodes further reduces by 5 Kbytes in the
+ <filename>${SSTATE_DIR}</filename> directory.
+ Subsequent warnings based on the interval occur each time
+ a respective interval is reached beyond the initial warning
+ (i.e. 1 Gbytes and 100 Kbytes).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_GENERATE_MIRROR_TARBALLS'><glossterm>BB_GENERATE_MIRROR_TARBALLS</glossterm>
+ <info>
+ BB_GENERATE_MIRROR_TARBALLS[doc] = "Causes tarballs of the Git repositories to be placed in the DL_DIR directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes tarballs of the Git repositories, including the
+ Git metadata, to be placed in the
+ <link linkend='var-DL_DIR'><filename>DL_DIR</filename></link>
+ directory.
+ </para>
+
+ <para>
+ For performance reasons, creating and placing tarballs of
+ the Git repositories is not the default action by the
+ OpenEmbedded build system.
+ <literallayout class='monospaced'>
+ BB_GENERATE_MIRROR_TARBALLS = "1"
+ </literallayout>
+ Set this variable in your <filename>local.conf</filename>
+ file in the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_NUMBER_THREADS'><glossterm>BB_NUMBER_THREADS</glossterm>
+ <info>
+ BB_NUMBER_THREADS[doc] = "The maximum number of tasks BitBake should run in parallel at any one time. This variable is automatically configured to be equal to the number of build system cores."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The maximum number of tasks BitBake should run in parallel
+ at any one time.
+ The OpenEmbedded build system automatically configures
+ this variable to be equal to the number of cores on the
+ build system.
+ For example, a system with a dual core processor that
+ also uses hyper-threading causes the
+ <filename>BB_NUMBER_THREADS</filename> variable to default
+ to "4".
+ </para>
+
+ <para>
+ For single socket systems (i.e. one CPU), you should not
+ have to override this variable to gain optimal parallelism
+ during builds.
+ However, if you have very large systems that employ
+ multiple physical CPUs, you might want to make sure the
+ <filename>BB_NUMBER_THREADS</filename> variable is not
+ set higher than "20".
+ </para>
+
+ <para>
+ For more information on speeding up builds, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#speeding-up-a-build'>Speeding Up a Build</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BB_SERVER_TIMEOUT'><glossterm>BB_SERVER_TIMEOUT</glossterm>
+ <info>
+ BB_SERVER_TIMEOUT [doc] = "Specifies the time (in seconds) after which to unload the BitBake server due to inactivity."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the time (in seconds) after which to unload the
+ BitBake server due to inactivity.
+ Set <filename>BB_SERVER_TIMEOUT</filename> to determine how
+ long the BitBake server stays resident between invocations.
+ </para>
+
+ <para>
+ For example, the following statement in your
+ <filename>local.conf</filename> file instructs the server
+ to be unloaded after 20 seconds of inactivity:
+ <literallayout class='monospaced'>
+ BB_SERVER_TIMEOUT = "20"
+ </literallayout>
+ If you want the server to never be unloaded, set
+ <filename>BB_SERVER_TIMEOUT</filename> to "-1".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBCLASSEXTEND'><glossterm>BBCLASSEXTEND</glossterm>
+ <info>
+ BBCLASSEXTEND[doc] = "Allows you to extend a recipe so that it builds variants of the software. Common variants for recipes are 'native', 'cross', 'nativesdk', and multilibs."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Allows you to extend a recipe so that it builds variants of the software.
+ Common variants for recipes exist such as "natives" like <filename>quilt-native</filename>,
+ which is a copy of Quilt built to run on the build system;
+ "crosses" such as <filename>gcc-cross</filename>,
+ which is a compiler built to run on the build machine but produces binaries
+ that run on the target <link linkend='var-MACHINE'><filename>MACHINE</filename></link>;
+ "nativesdk", which targets the SDK machine instead of <filename>MACHINE</filename>;
+ and "mulitlibs" in the form "<filename>multilib:</filename><replaceable>multilib_name</replaceable>".
+ </para>
+
+ <para>
+ To build a different variant of the recipe with a minimal amount of code, it usually
+ is as simple as adding the following to your recipe:
+ <literallayout class='monospaced'>
+ BBCLASSEXTEND =+ "native nativesdk"
+ BBCLASSEXTEND =+ "multilib:<replaceable>multilib_name</replaceable>"
+ </literallayout>
+ <note>
+ <para>
+ Internally, the <filename>BBCLASSEXTEND</filename>
+ mechanism generates recipe variants by rewriting
+ variable values and applying overrides such as
+ <filename>_class-native</filename>.
+ For example, to generate a native version of a recipe,
+ a
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ on "foo" is rewritten to a <filename>DEPENDS</filename>
+ on "foo-native".
+ </para>
+
+ <para>
+ Even when using <filename>BBCLASSEXTEND</filename>, the
+ recipe is only parsed once.
+ Parsing once adds some limitations.
+ For example, it is not possible to
+ include a different file depending on the variant,
+ since <filename>include</filename> statements are
+ processed when the recipe is parsed.
+ </para>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_COLLECTIONS'><glossterm>BBFILE_COLLECTIONS</glossterm>
+ <info>
+ BBFILE_COLLECTIONS[doc] = "Lists the names of configured layers. These names are used to find the other BBFILE_* variables."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the names of configured layers.
+ These names are used to find the other <filename>BBFILE_*</filename>
+ variables.
+ Typically, each layer will append its name to this variable in its
+ <filename>conf/layer.conf</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_PATTERN'><glossterm>BBFILE_PATTERN</glossterm>
+ <info>
+ BBFILE_PATTERN[doc] = "Variable that expands to match files from BBFILES in a particular layer. This variable is used in the layer.conf file and must be suffixed with the name of a layer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Variable that expands to match files from
+ <link linkend='var-BBFILES'><filename>BBFILES</filename></link>
+ in a particular layer.
+ This variable is used in the <filename>conf/layer.conf</filename> file and must
+ be suffixed with the name of the specific layer (e.g.
+ <filename>BBFILE_PATTERN_emenlow</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILE_PRIORITY'><glossterm>BBFILE_PRIORITY</glossterm>
+ <info>
+ BBFILE_PRIORITY[doc] = "Assigns the priority for recipe files in each layer. Setting this variable allows you to prioritize a layer against other layers that contain the same recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Assigns the priority for recipe files in each layer.
+ </para>
+
+ <para>
+ This variable is useful in situations where the same recipe appears in
+ more than one layer.
+ Setting this variable allows you to prioritize a
+ layer against other layers that contain the same recipe - effectively
+ letting you control the precedence for the multiple layers.
+ The precedence established through this variable stands regardless of a
+ recipe's version
+ (<link linkend='var-PV'><filename>PV</filename></link> variable).
+ For example, a layer that has a recipe with a higher <filename>PV</filename> value but for
+ which the <filename>BBFILE_PRIORITY</filename> is set to have a lower precedence still has a
+ lower precedence.
+ </para>
+
+ <para>
+ A larger value for the <filename>BBFILE_PRIORITY</filename> variable results in a higher
+ precedence.
+ For example, the value 6 has a higher precedence than the value 5.
+ If not specified, the <filename>BBFILE_PRIORITY</filename> variable is set based on layer
+ dependencies (see the
+ <filename><link linkend='var-LAYERDEPENDS'>LAYERDEPENDS</link></filename> variable for
+ more information.
+ The default priority, if unspecified
+ for a layer with no dependencies, is the lowest defined priority + 1
+ (or 1 if no priorities are defined).
+ </para>
+ <tip>
+ You can use the command <filename>bitbake-layers show-layers</filename> to list
+ all configured layers along with their priorities.
+ </tip>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm>
+ <info>
+ BBFILES[doc] = "List of recipe files used by BitBake to build software."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ List of recipe files used by BitBake to build software.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBFILES_DYNAMIC'><glossterm>BBFILES_DYNAMIC</glossterm>
+ <info>
+ BBFILES_DYNAMIC[doc] = "Activates content when identified layers are present."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Activates content when identified layers are present.
+ You identify the layers by the collections that the layers
+ define.
+ </para>
+
+ <para>
+ Use the <filename>BBFILES_DYNAMIC</filename> variable to
+ avoid <filename>.bbappend</filename> files whose
+ corresponding <filename>.bb</filename> file is in a layer
+ that attempts to modify other layers through
+ <filename>.bbappend</filename> but does not want to
+ introduce a hard dependency on those other layers.
+ </para>
+
+ <para>
+ Use the following form for
+ <filename>BBFILES_DYNAMIC</filename>:
+ <literallayout class='monospaced'>
+ <replaceable>collection_name</replaceable>:<replaceable>filename_pattern</replaceable>
+ </literallayout>
+ The following example identifies two collection names and
+ two filename patterns:
+ <literallayout class='monospaced'>
+ BBFILES_DYNAMIC += " \
+ clang-layer:${LAYERDIR}/bbappends/meta-clang/*/*/*.bbappend \
+ core:${LAYERDIR}/bbappends/openembedded-core/meta/*/*/*.bbappend \
+ "
+ </literallayout>
+ This next example shows an error message that occurs
+ because invalid entries are found, which cause parsing to
+ abort:
+ <literallayout class='monospaced'>
+ ERROR: BBFILES_DYNAMIC entries must be of the form &lt;collection name&gt;:&lt;filename pattern&gt;, not:
+ /work/my-layer/bbappends/meta-security-isafw/*/*/*.bbappend
+ /work/my-layer/bbappends/openembedded-core/meta/*/*/*.bbappend
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBINCLUDELOGS'><glossterm>BBINCLUDELOGS</glossterm>
+ <info>
+ BBINCLUDELOGS[doc] = "Variable that controls how BitBake displays logs on build failure."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Variable that controls how BitBake displays logs on build failure.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBINCLUDELOGS_LINES'><glossterm>BBINCLUDELOGS_LINES</glossterm>
+ <info>
+ BBINCLUDELOGS_LINES[doc] = "Amount of log lines printed on failure."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If
+ <link linkend='var-BBINCLUDELOGS'><filename>BBINCLUDELOGS</filename></link>
+ is set, specifies the maximum number of lines from the
+ task log file to print when reporting a failed task.
+ If you do not set <filename>BBINCLUDELOGS_LINES</filename>,
+ the entire log is printed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBLAYERS'><glossterm>BBLAYERS</glossterm>
+ <info>
+ BBLAYERS[doc] = "Lists the layers to enable during the build. This variable is defined in the bblayers.conf configuration file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the layers to enable during the build.
+ This variable is defined in the <filename>bblayers.conf</filename> configuration
+ file in the
+ <link linkend='build-directory'>Build Directory</link>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ BBLAYERS = " \
+ /home/scottrif/poky/meta \
+ /home/scottrif/poky/meta-poky \
+ /home/scottrif/poky/meta-yocto-bsp \
+ /home/scottrif/poky/meta-mykernel \
+ "
+ </literallayout>
+ </para>
+
+ <para>
+ This example enables four layers, one of which is a custom, user-defined layer
+ named <filename>meta-mykernel</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBMASK'><glossterm>BBMASK</glossterm>
+ <info>
+ BBMASK[doc] = "Prevents BitBake from processing specific recipes or recipe append files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Prevents BitBake from processing recipes and recipe
+ append files.
+ </para>
+
+ <para>
+ You can use the <filename>BBMASK</filename> variable
+ to "hide" these <filename>.bb</filename> and
+ <filename>.bbappend</filename> files.
+ BitBake ignores any recipe or recipe append files that
+ match any of the expressions.
+ It is as if BitBake does not see them at all.
+ Consequently, matching files are not parsed or otherwise
+ used by BitBake.</para>
+ <para>
+ The values you provide are passed to Python's regular
+ expression compiler.
+ The expressions are compared against the full paths to
+ the files.
+ For complete syntax information, see Python's
+ documentation for the appropriate release at
+ <ulink url='http://docs.python.org/release/'></ulink>.
+ </para>
+
+ <para>
+ The following example uses a complete regular expression
+ to tell BitBake to ignore all recipe and recipe append
+ files in the <filename>meta-ti/recipes-misc/</filename>
+ directory:
+ <literallayout class='monospaced'>
+ BBMASK = "meta-ti/recipes-misc/"
+ </literallayout>
+ If you want to mask out multiple directories or recipes,
+ you can specify multiple regular expression fragments.
+ This next example masks out multiple directories and
+ individual recipes:
+ <literallayout class='monospaced'>
+ BBMASK += "/meta-ti/recipes-misc/ meta-ti/recipes-ti/packagegroup/"
+ BBMASK += "/meta-oe/recipes-support/"
+ BBMASK += "/meta-foo/.*/openldap"
+ BBMASK += "opencv.*\.bbappend"
+ BBMASK += "lzma"
+ </literallayout>
+ <note>
+ When specifying a directory name, use the trailing
+ slash character to ensure you match just that directory
+ name.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBMULTICONFIG'><glossterm>BBMULTICONFIG</glossterm>
+ <info>
+ BBMULTICONFIG[doc] = "Specifies each separate configuration when you are building targets with multiple configurations."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies each separate configuration when you are
+ building targets with multiple configurations.
+ Use this variable in your
+ <filename>conf/local.conf</filename> configuration file.
+ Specify a <replaceable>multiconfigname</replaceable> for
+ each configuration file you are using.
+ For example, the following line specifies three
+ configuration files:
+ <literallayout class='monospaced'>
+ BBMULTIFONFIG = "configA configB configC"
+ </literallayout>
+ Each configuration file you use must reside in the
+ <link linkend='build-directory'>Build Directory</link>
+ <filename>conf/multiconfig</filename> directory
+ (e.g.
+ <replaceable>build_directory</replaceable><filename>/conf/multiconfig/configA.conf</filename>).
+ </para>
+
+ <para>
+ For information on how to use
+ <filename>BBMULTICONFIG</filename> in an environment that
+ supports building targets with multiple configurations,
+ see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-building-targets-with-multiple-configurations'>Building Targets with Multiple Configurations</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBPATH'><glossterm>BBPATH</glossterm>
+ <info>
+ BBPATH[doc] = "Used by BitBake to locate .bbclass and configuration files. This variable is analogous to the PATH variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used by BitBake to locate
+ <filename>.bbclass</filename> and configuration files.
+ This variable is analogous to the
+ <filename>PATH</filename> variable.
+ <note>
+ If you run BitBake from a directory outside of the
+ <link linkend='build-directory'>Build Directory</link>,
+ you must be sure to set
+ <filename>BBPATH</filename> to point to the
+ Build Directory.
+ Set the variable as you would any environment variable
+ and then run BitBake:
+ <literallayout class='monospaced'>
+ $ BBPATH = "<replaceable>build_directory</replaceable>"
+ $ export BBPATH
+ $ bitbake <replaceable>target</replaceable>
+ </literallayout>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BBSERVER'><glossterm>BBSERVER</glossterm>
+ <info>
+ BBSERVER[doc] = "Points to the BitBake remote server."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If defined in the BitBake environment,
+ <filename>BBSERVER</filename> points to the BitBake
+ remote server.
+ </para>
+
+ <para>
+ Use the following format to export the variable to the
+ BitBake environment:
+ <literallayout class='monospaced'>
+ export BBSERVER=localhost:$port"
+ </literallayout>
+ </para>
+
+ <para>
+ By default, <filename>BBSERVER</filename> also appears in
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-BB_HASHBASE_WHITELIST'><filename>BB_HASHBASE_WHITELIST</filename></ulink>.
+ Consequently, <filename>BBSERVER</filename> is excluded
+ from checksum and dependency data.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BINCONFIG'><glossterm>BINCONFIG</glossterm>
+ <info>
+ BINCONFIG[doc] = "When inheriting the binconfig-disabled class, this variable specifies binary configuration scripts to disable in favor of using pkg-config to query the information."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-binconfig-disabled'><filename>binconfig-disabled</filename></link>
+ class, this variable specifies binary configuration
+ scripts to disable in favor of using
+ <filename>pkg-config</filename> to query the information.
+ The <filename>binconfig-disabled</filename> class will
+ modify the specified scripts to return an error so that
+ calls to them can be easily found and replaced.
+ </para>
+
+ <para>
+ To add multiple scripts, separate them by spaces.
+ Here is an example from the <filename>libpng</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BINCONFIG_GLOB'><glossterm>BINCONFIG_GLOB</glossterm>
+ <info>
+ BINCONFIG_GLOB[doc] = "When inheriting binconfig.bbclass from a recipe, this variable specifies a wildcard for configuration scripts that need editing."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-binconfig'><filename>binconfig</filename></link>
+ class, this variable specifies a wildcard for
+ configuration scripts that need editing.
+ The scripts are edited to correct any paths that have been
+ set up during compilation so that they are correct for
+ use when installed into the sysroot and called by the
+ build processes of other recipes.
+ </para>
+
+ <para>
+ For more information on how this variable works, see
+ <filename>meta/classes/binconfig.bbclass</filename> in the
+ <link linkend='source-directory'>Source Directory</link>.
+ You can also find general information on the class in the
+ "<link linkend='ref-classes-binconfig'><filename>binconfig.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BP'><glossterm>BP</glossterm>
+ <info>
+ BP[doc] = "The base recipe name and version but without any special recipe name suffix (i.e. -native, lib64-, and so forth). BP is comprised of ${BPN}-${PV}"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The base recipe name and version but without any special
+ recipe name suffix (i.e. <filename>-native</filename>, <filename>lib64-</filename>,
+ and so forth).
+ <filename>BP</filename> is comprised of the following:
+ <literallayout class="monospaced">
+ ${BPN}-${PV}
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BPN'><glossterm>BPN</glossterm>
+ <info>
+ BPN[doc] = "This variable is a version of the PN variable but removes common suffixes and prefixes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable is a version of the
+ <link linkend='var-PN'><filename>PN</filename></link>
+ variable with common prefixes and suffixes
+ removed, such as <filename>nativesdk-</filename>,
+ <filename>-cross</filename>,
+ <filename>-native</filename>, and multilib's
+ <filename>lib64-</filename> and
+ <filename>lib32-</filename>.
+ The exact lists of prefixes and suffixes removed are
+ specified by the
+ <link linkend='var-MLPREFIX'><filename>MLPREFIX</filename></link>
+ and
+ <link linkend='var-SPECIAL_PKGSUFFIX'><filename>SPECIAL_PKGSUFFIX</filename></link>
+ variables, respectively.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUGTRACKER'><glossterm>BUGTRACKER</glossterm>
+ <info>
+ BUGTRACKER[doc] = "Specifies a URL for an upstream bug tracking website for a recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a URL for an upstream bug tracking website for
+ a recipe.
+ The OpenEmbedded build system does not use this variable.
+ Rather, the variable is a useful pointer in case a bug
+ in the software being built needs to be manually reported.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_ARCH'><glossterm>BUILD_ARCH</glossterm>
+ <info>
+ BUILD_ARCH[doc] = "The name of the building architecture (e.g. i686)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the architecture of the build host
+ (e.g. <filename>i686</filename>).
+ The OpenEmbedded build system sets the value of
+ <filename>BUILD_ARCH</filename> from the machine name
+ reported by the <filename>uname</filename> command.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_AS_ARCH'><glossterm>BUILD_AS_ARCH</glossterm>
+ <info>
+ BUILD_AS_ARCH[doc] = "Specifies the architecture-specific assembler flags for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the architecture-specific assembler flags for
+ the build host. By default, the value of
+ <filename>BUILD_AS_ARCH</filename> is empty.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_CC_ARCH'><glossterm>BUILD_CC_ARCH</glossterm>
+ <info>
+ BUILD_CC_ARCH[doc] = "Specifies the architecture-specific C compiler flags for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the architecture-specific C compiler flags for
+ the build host. By default, the value of
+ <filename>BUILD_CC_ARCH</filename> is empty.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_CCLD'><glossterm>BUILD_CCLD</glossterm>
+ <info>
+ BUILD_CCLD[doc] = "Specifies the linker command to be used for the build host when the C compiler is being used as the linker."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the linker command to be used for the build host
+ when the C compiler is being used as the linker. By default,
+ <filename>BUILD_CCLD</filename> points to GCC and passes as
+ arguments the value of
+ <link linkend='var-BUILD_CC_ARCH'><filename>BUILD_CC_ARCH</filename></link>,
+ assuming <filename>BUILD_CC_ARCH</filename> is set.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_CFLAGS'><glossterm>BUILD_CFLAGS</glossterm>
+ <info>
+ BUILD_CFLAGS[doc] = "Specifies the flags to pass to the C compiler when building for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C compiler when building
+ for the build host.
+ When building in the <filename>-native</filename> context,
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_CPPFLAGS'><glossterm>BUILD_CPPFLAGS</glossterm>
+ <info>
+ BUILD_CPPFLAGS[doc] = "Specifies the flags to pass to the C preprocessor (i.e. to both the C and the C++ compilers) when building for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C preprocessor
+ (i.e. to both the C and the C++ compilers) when building
+ for the build host.
+ When building in the <filename>-native</filename> context,
+ <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_CXXFLAGS'><glossterm>BUILD_CXXFLAGS</glossterm>
+ <info>
+ BUILD_CXXFLAGS[doc] = "Specifies the flags to pass to the C++ compiler when building for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C++ compiler when
+ building for the build host.
+ When building in the <filename>-native</filename> context,
+ <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_FC'><glossterm>BUILD_FC</glossterm>
+ <info>
+ BUILD_FC[doc] = "Specifies the Fortran compiler command for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the Fortran compiler command for the build host.
+ By default, <filename>BUILD_FC</filename> points to
+ Gfortran and passes as arguments the value of
+ <link linkend='var-BUILD_CC_ARCH'><filename>BUILD_CC_ARCH</filename></link>,
+ assuming <filename>BUILD_CC_ARCH</filename> is set.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_LD'><glossterm>BUILD_LD</glossterm>
+ <info>
+ BUILD_LD[doc] = "Specifies the linker command for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the linker command for the build host. By default,
+ <filename>BUILD_LD</filename> points to the GNU linker (ld)
+ and passes as arguments the value of
+ <link linkend='var-BUILD_LD_ARCH'><filename>BUILD_LD_ARCH</filename></link>,
+ assuming <filename>BUILD_LD_ARCH</filename> is set.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_LD_ARCH'><glossterm>BUILD_LD_ARCH</glossterm>
+ <info>
+ BUILD_LD_ARCH[doc] = "Specifies architecture-specific linker flags for the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific linker flags for the build
+ host. By default, the value of
+ <filename>BUILD_LD_ARCH</filename> is empty.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_LDFLAGS'><glossterm>BUILD_LDFLAGS</glossterm>
+ <info>
+ BUILD_LDFLAGS[doc] = "Specifies the flags to pass to the linker when building for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the linker when building
+ for the build host.
+ When building in the <filename>-native</filename> context,
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_OPTIMIZATION'><glossterm>BUILD_OPTIMIZATION</glossterm>
+ <info>
+ BUILD_OPTIMIZATION[doc] = "Specifies the optimization flags passed to the C compiler when building for the build host or the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the optimization flags passed to the C compiler
+ when building for the build host or the SDK.
+ The flags are passed through the
+ <link linkend='var-BUILD_CFLAGS'><filename>BUILD_CFLAGS</filename></link>
+ and
+ <link linkend='var-BUILDSDK_CFLAGS'><filename>BUILDSDK_CFLAGS</filename></link>
+ default values.
+ </para>
+
+ <para>
+ The default value of the
+ <filename>BUILD_OPTIMIZATION</filename> variable is
+ "-O2 -pipe".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_OS'><glossterm>BUILD_OS</glossterm>
+ <info>
+ BUILD_OS[doc] = "The operating system (in lower case) of the building architecture (e.g. Linux)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the operating system in use on the build
+ host (e.g. "linux").
+ The OpenEmbedded build system sets the value of
+ <filename>BUILD_OS</filename> from the OS reported by
+ the <filename>uname</filename> command - the first word,
+ converted to lower-case characters.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_PREFIX'><glossterm>BUILD_PREFIX</glossterm>
+ <info>
+ BUILD_PREFIX[doc] = "The toolchain binary prefix used for native recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The toolchain binary prefix used for native recipes.
+ The OpenEmbedded build system uses the
+ <filename>BUILD_PREFIX</filename> value to set the
+ <link linkend='var-TARGET_PREFIX'><filename>TARGET_PREFIX</filename></link>
+ when building for <filename>native</filename> recipes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_STRIP'><glossterm>BUILD_STRIP</glossterm>
+ <info>
+ BUILD_STRIP[doc] = "Specifies the command to be used to strip debugging symbols from binaries produced for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the command to be used to strip debugging symbols
+ from binaries produced for the build host. By default,
+ <filename>BUILD_STRIP</filename> points to
+ <filename>${</filename><link linkend='var-BUILD_PREFIX'><filename>BUILD_PREFIX</filename></link><filename>}strip</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_SYS'><glossterm>BUILD_SYS</glossterm>
+ <info>
+ BUILD_SYS[doc] = "The toolchain binary prefix used for native recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the system, including the architecture and
+ the operating system, to use when building for the build
+ host (i.e. when building <filename>native</filename>
+ recipes).
+ </para>
+
+ <para>
+ The OpenEmbedded build system automatically sets this
+ variable based on
+ <link linkend='var-BUILD_ARCH'><filename>BUILD_ARCH</filename></link>,
+ <link linkend='var-BUILD_VENDOR'><filename>BUILD_VENDOR</filename></link>,
+ and
+ <link linkend='var-BUILD_OS'><filename>BUILD_OS</filename></link>.
+ You do not need to set the <filename>BUILD_SYS</filename>
+ variable yourself.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILD_VENDOR'><glossterm>BUILD_VENDOR</glossterm>
+ <info>
+ BUILD_VENDOR[doc] = "The vendor name to use when building for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the vendor name to use when building for the
+ build host.
+ The default value is an empty string ("").
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDDIR'><glossterm>BUILDDIR</glossterm>
+ <info>
+ BUILDDIR[doc] = "Points to the location of the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the location of the
+ <link linkend='build-directory'>Build Directory</link>.
+ You can define this directory indirectly through the
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>
+ script by passing in a Build Directory path when you run
+ the script.
+ If you run the script and do not provide a Build Directory
+ path, the <filename>BUILDDIR</filename> defaults to
+ <filename>build</filename> in the current directory.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_COMMIT'><glossterm>BUILDHISTORY_COMMIT</glossterm>
+ <info>
+ BUILDHISTORY_COMMIT[doc] = "When inheriting the buildhistory class, this variable specifies whether or not to commit the build history output in a local Git repository."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable specifies whether or not to commit the
+ build history output in a local Git repository.
+ If set to "1", this local repository will be maintained
+ automatically by the
+ <filename>buildhistory</filename>
+ class and a commit will be created on every
+ build for changes to each top-level subdirectory of the
+ build history output (images, packages, and sdk).
+ If you want to track changes to build history over
+ time, you should set this value to "1".
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ does not commit the build history output in a local
+ Git repository:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_COMMIT ?= "0"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_COMMIT_AUTHOR'><glossterm>BUILDHISTORY_COMMIT_AUTHOR</glossterm>
+ <info>
+ BUILDHISTORY_COMMIT_AUTHOR[doc] = "When inheriting the buildhistory class, this variable specifies the author to use for each Git commit."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable specifies the author to use for each
+ Git commit.
+ In order for the <filename>BUILDHISTORY_COMMIT_AUTHOR</filename>
+ variable to work, the
+ <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link>
+ variable must be set to "1".
+ </para>
+
+ <para>
+ Git requires that the value you provide for the
+ <filename>BUILDHISTORY_COMMIT_AUTHOR</filename> variable
+ takes the form of "name <replaceable>email@host</replaceable>".
+ Providing an email address or host that is not valid does
+ not produce an error.
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ sets the variable as follows:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory &lt;buildhistory@${DISTRO}&gt;"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_DIR'><glossterm>BUILDHISTORY_DIR</glossterm>
+ <info>
+ BUILDHISTORY_DIR[doc] = "When inheriting the buildhistory class, this variable specifies the directory in which build history information is kept."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable specifies the directory in which
+ build history information is kept.
+ For more information on how the variable works, see the
+ <filename>buildhistory.class</filename>.
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ sets the directory as follows:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_FEATURES'><glossterm>BUILDHISTORY_FEATURES</glossterm>
+ <info>
+ BUILDHISTORY_FEATURES[doc] = "When inheriting the buildhistory class, this variable specifies the build history features to be enabled."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable specifies the build history features
+ to be enabled.
+ For more information on how build history works, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#maintaining-build-output-quality'>Maintaining Build Output Quality</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ You can specify these features in the form of a
+ space-separated list:
+ <itemizedlist>
+ <listitem><para><emphasis>image:</emphasis>
+ Analysis of the contents of images, which
+ includes the list of installed packages among other
+ things.
+ </para></listitem>
+ <listitem><para><emphasis>package:</emphasis>
+ Analysis of the contents of individual packages.
+ </para></listitem>
+ <listitem><para><emphasis>sdk:</emphasis>
+ Analysis of the contents of the software
+ development kit (SDK).
+ </para></listitem>
+ <listitem><para><emphasis>task:</emphasis>
+ Save output file signatures for
+ <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>shared state</ulink>
+ (sstate) tasks.
+ This saves one file per task and lists the SHA-256
+ checksums for each file staged (i.e. the output of
+ the task).
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ enables the following features:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_FEATURES ?= "image package sdk"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_IMAGE_FILES'><glossterm>BUILDHISTORY_IMAGE_FILES</glossterm>
+ <info>
+ BUILDHISTORY_IMAGE_FILES[doc] = "When inheriting the buildhistory class, this variable specifies a list of paths to files copied from the image contents into the build history directory under an "image-files" directory in the directory for the image, so that you can track the contents of each file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable specifies a list of paths to files
+ copied from the
+ image contents into the build history directory under
+ an "image-files" directory in the directory for
+ the image, so that you can track the contents of each file.
+ The default is to copy <filename>/etc/passwd</filename>
+ and <filename>/etc/group</filename>, which allows you to
+ monitor for changes in user and group entries.
+ You can modify the list to include any file.
+ Specifying an invalid path does not produce an error.
+ Consequently, you can include files that might
+ not always be present.
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ provides paths to the following files:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDHISTORY_PUSH_REPO'><glossterm>BUILDHISTORY_PUSH_REPO</glossterm>
+ <info>
+ BUILDHISTORY_PUSH_REPO[doc] = "When inheriting the buildhistory class, this variable optionally specifies a remote repository to which build history pushes Git changes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-buildhistory'><filename>buildhistory</filename></link>
+ class, this variable optionally specifies a remote
+ repository to which build history pushes Git changes.
+ In order for <filename>BUILDHISTORY_PUSH_REPO</filename>
+ to work,
+ <link linkend='var-BUILDHISTORY_COMMIT'><filename>BUILDHISTORY_COMMIT</filename></link>
+ must be set to "1".
+ </para>
+
+ <para>
+ The repository should correspond to a remote
+ address that specifies a repository as understood by
+ Git, or alternatively to a remote name that you have
+ set up manually using <filename>git remote</filename>
+ within the local repository.
+ </para>
+
+ <para>
+ By default, the <filename>buildhistory</filename> class
+ sets the variable as follows:
+ <literallayout class='monospaced'>
+ BUILDHISTORY_PUSH_REPO ?= ""
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDSDK_CFLAGS'><glossterm>BUILDSDK_CFLAGS</glossterm>
+ <info>
+ BUILDSDK_CFLAGS[doc] = "Specifies the flags to pass to the C compiler when building for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C compiler when building
+ for the SDK.
+ When building in the <filename>nativesdk-</filename>
+ context,
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDSDK_CPPFLAGS'><glossterm>BUILDSDK_CPPFLAGS</glossterm>
+ <info>
+ BUILDSDK_CPPFLAGS[doc] = "Specifies the flags to pass to the C pre-processor (i.e. to both the C and the C++ compilers) when building for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C pre-processor
+ (i.e. to both the C and the C++ compilers) when building
+ for the SDK.
+ When building in the <filename>nativesdk-</filename>
+ context,
+ <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDSDK_CXXFLAGS'><glossterm>BUILDSDK_CXXFLAGS</glossterm>
+ <info>
+ BUILDSDK_CXXFLAGS[doc] = "Specifies the flags to pass to the C++ compiler when building for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C++ compiler when
+ building for the SDK.
+ When building in the <filename>nativesdk-</filename>
+ context,
+ <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDSDK_LDFLAGS'><glossterm>BUILDSDK_LDFLAGS</glossterm>
+ <info>
+ BUILDSDK_LDFLAGS[doc] = "Specifies the flags to pass to the linker when building for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the linker when building
+ for the SDK.
+ When building in the <filename>nativesdk-</filename>
+ context,
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUILDSTATS_BASE'><glossterm>BUILDSTATS_BASE</glossterm>
+ <info>
+ BUILDSTATS_BASE[doc] = "Points to the location of the directory that holds build statistics when you use and enable the buildstats class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the location of the directory that holds build
+ statistics when you use and enable the
+ <link linkend='ref-classes-buildstats'><filename>buildstats</filename></link>
+ class.
+ The <filename>BUILDSTATS_BASE</filename> directory defaults
+ to
+ <filename>${</filename><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>}/buildstats/</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-BUSYBOX_SPLIT_SUID'><glossterm>BUSYBOX_SPLIT_SUID</glossterm>
+ <info>
+ BUSYBOX_SPLIT_SUID[doc] = "For the BusyBox recipe, specifies whether to split the output executable file into two parts: one for features that require setuid root, and one for the remaining features."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For the BusyBox recipe, specifies whether to split the
+ output executable file into two parts: one for features
+ that require <filename>setuid root</filename>, and one for
+ the remaining features (i.e. those that do not require
+ <filename>setuid root</filename>).
+ </para>
+
+ <para>
+ The <filename>BUSYBOX_SPLIT_SUID</filename> variable
+ defaults to "1", which results in a single output
+ executable file.
+ Set the variable to "0" to split the output file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-c'><title>C</title>
+
+ <glossentry id='var-CACHE'><glossterm>CACHE</glossterm>
+ <info>
+ CACHE[doc] = "The directory BitBake uses to store a cache of the metadata."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the directory BitBake uses to store a cache
+ of the
+ <link linkend='metadata'>Metadata</link>
+ so it does not need to be parsed every time BitBake is
+ started.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CC'><glossterm>CC</glossterm>
+ <info>
+ CC[doc] = "Minimum command and arguments to run the C compiler."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run the C
+ compiler.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CFLAGS'><glossterm>CFLAGS</glossterm>
+ <info>
+ CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as TARGET_CFLAGS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C compiler.
+ This variable is exported to an environment
+ variable and thus made visible to the software being
+ built during the compilation step.
+ </para>
+
+ <para>
+ Default initialization for <filename>CFLAGS</filename>
+ varies depending on what is being built:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-TARGET_CFLAGS'><filename>TARGET_CFLAGS</filename></link>
+ when building for the target
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILD_CFLAGS'><filename>BUILD_CFLAGS</filename></link>
+ when building for the build host (i.e.
+ <filename>-native</filename>)
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILDSDK_CFLAGS'><filename>BUILDSDK_CFLAGS</filename></link>
+ when building for an SDK (i.e.
+ <filename>nativesdk-</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CLASSOVERRIDE'><glossterm>CLASSOVERRIDE</glossterm>
+ <info>
+ CLASSOVERRIDE[doc] = "An internal variable specifying the special class override that should currently apply (e.g. "class-target", "class-native", and so forth)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An internal variable specifying the special class override
+ that should currently apply (e.g. "class-target",
+ "class-native", and so forth).
+ The classes that use this variable (e.g.
+ <link linkend='ref-classes-native'><filename>native</filename></link>,
+ <link linkend='ref-classes-nativesdk'><filename>nativesdk</filename></link>,
+ and so forth) set the variable to appropriate values.
+ <note>
+ <filename>CLASSOVERRIDE</filename> gets its default
+ "class-target" value from the
+ <filename>bitbake.conf</filename> file.
+ </note>
+ </para>
+
+ <para>
+ As an example, the following override allows you to install
+ extra files, but only when building for the target:
+ <literallayout class='monospaced'>
+ do_install_append_class-target() {
+ install my-extra-file ${D}${sysconfdir}
+ }
+ </literallayout>
+ Here is an example where <filename>FOO</filename>
+ is set to "native" when building for the build host, and
+ to "other" when not building for the build host:
+ <literallayout class='monospaced'>
+ FOO_class-native = "native"
+ FOO = "other"
+ </literallayout>
+ The underlying mechanism behind
+ <filename>CLASSOVERRIDE</filename> is simply that it is
+ included in the default value of
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CLEANBROKEN'><glossterm>CLEANBROKEN</glossterm>
+ <info>
+ CLEANBROKEN[doc] = "Prevents the build system from running 'make clean' during the do_configure task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "1" within a recipe,
+ <filename>CLEANBROKEN</filename> specifies that
+ the <filename>make clean</filename> command does
+ not work for the software being built.
+ Consequently, the OpenEmbedded build system will not try
+ to run <filename>make clean</filename> during the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task, which is the default behavior.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMBINED_FEATURES'><glossterm>COMBINED_FEATURES</glossterm>
+ <info>
+ COMBINED_FEATURES[doc] = "A set of features common between MACHINE_FEATURES and DISTRO_FEATURES."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Provides a list of hardware features that are enabled in
+ both
+ <link linkend='var-MACHINE_FEATURES'><filename>MACHINE_FEATURES</filename></link>
+ and
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ This select list of features contains features that make
+ sense to be controlled both at the machine and distribution
+ configuration level.
+ For example, the "bluetooth" feature requires hardware
+ support but should also be optional at the distribution
+ level, in case the hardware supports Bluetooth but you
+ do not ever intend to use it.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMMON_LICENSE_DIR'><glossterm>COMMON_LICENSE_DIR</glossterm>
+ <info>
+ COMMON_LICENSE_DIR[doc] = "Points to meta/files/common-licenses in the Source Directory, which is where generic license files reside."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to <filename>meta/files/common-licenses</filename>
+ in the
+ <link linkend='source-directory'>Source Directory</link>,
+ which is where generic license files reside.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMPATIBLE_HOST'><glossterm>COMPATIBLE_HOST</glossterm>
+ <info>
+ COMPATIBLE_HOST[doc] = "A regular expression that resolves to one or more hosts (when the recipe is native) or one or more targets (when the recipe is non-native) with which a recipe is compatible."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A regular expression that resolves to one or more hosts
+ (when the recipe is native) or one or more targets (when
+ the recipe is non-native) with which a recipe is compatible.
+ The regular expression is matched against
+ <link linkend="var-HOST_SYS"><filename>HOST_SYS</filename></link>.
+ You can use the variable to stop recipes from being built
+ for classes of systems with which the recipes are not
+ compatible.
+ Stopping these builds is particularly useful with kernels.
+ The variable also helps to increase parsing speed
+ since the build system skips parsing recipes not
+ compatible with the current system.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMPATIBLE_MACHINE'><glossterm>COMPATIBLE_MACHINE</glossterm>
+ <info>
+ COMPATIBLE_MACHINE[doc] = "A regular expression that resolves to one or more target machines with which a recipe is compatible."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A regular expression that resolves to one or more
+ target machines with which a recipe is compatible.
+ The regular expression is matched against
+ <link linkend="var-MACHINEOVERRIDES"><filename>MACHINEOVERRIDES</filename></link>.
+ You can use the variable to stop recipes from being built
+ for machines with which the recipes are not compatible.
+ Stopping these builds is particularly useful with kernels.
+ The variable also helps to increase parsing speed
+ since the build system skips parsing recipes not
+ compatible with the current machine.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMPLEMENTARY_GLOB'><glossterm>COMPLEMENTARY_GLOB</glossterm>
+ <info>
+ COMPLEMENTARY_GLOB[doc] = "Defines wildcards to match when installing a list of complementary packages for all the packages installed in an image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines wildcards to match when installing a list of
+ complementary packages for all the packages explicitly
+ (or implicitly) installed in an image.
+ The resulting list of complementary packages is associated
+ with an item that can be added to
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
+ An example usage of this is the "dev-pkgs" item that when
+ added to <filename>IMAGE_FEATURES</filename> will
+ install -dev packages (containing headers and other
+ development files) for every package in the image.
+ </para>
+
+ <para>
+ To add a new feature item pointing to a wildcard, use a
+ variable flag to specify the feature item name and
+ use the value to specify the wildcard.
+ Here is an example:
+ <literallayout class='monospaced'>
+ COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev'
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COMPONENTS_DIR'><glossterm>COMPONENTS_DIR</glossterm>
+ <info>
+ COMPONENTS_DIR[doc] = "Stores sysroot components for each recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Stores sysroot components for each recipe.
+ The OpenEmbedded build system uses
+ <filename>COMPONENTS_DIR</filename> when constructing
+ recipe-specific sysroots for other recipes.
+ </para>
+
+ <para>
+ The default is
+ "<filename>${</filename><link linkend='var-STAGING_DIR'><filename>STAGING_DIR</filename></link><filename>}-components</filename>."
+ (i.e. "<filename>${</filename><link linkend='var-TMPDIR'><filename>TMPDIR</filename></link><filename>}/sysroots-components</filename>").
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONF_VERSION'><glossterm>CONF_VERSION</glossterm>
+ <info>
+ CONF_VERSION[doc] = "Tracks the version of local.conf. Increased each time build/conf/ changes incompatibly."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Tracks the version of the local configuration file
+ (i.e. <filename>local.conf</filename>).
+ The value for <filename>CONF_VERSION</filename>
+ increments each time <filename>build/conf/</filename>
+ compatibility changes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFFILES'><glossterm>CONFFILES</glossterm>
+ <info>
+ CONFFILES[doc] = "Identifies editable or configurable files that are part of a package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Identifies editable or configurable files that are part of a package.
+ If the Package Management System (PMS) is being used to update
+ packages on the target system, it is possible that
+ configuration files you have changed after the original installation
+ and that you now want to remain unchanged are overwritten.
+ In other words, editable files might exist in the package that you do not
+ want reset as part of the package update process.
+ You can use the <filename>CONFFILES</filename> variable to list the files in the
+ package that you wish to prevent the PMS from overwriting during this update process.
+ </para>
+
+ <para>
+ To use the <filename>CONFFILES</filename> variable, provide a package name
+ override that identifies the resulting package.
+ Then, provide a space-separated list of files.
+ Here is an example:
+ <literallayout class='monospaced'>
+ CONFFILES_${PN} += "${sysconfdir}/file1 \
+ ${sysconfdir}/file2 ${sysconfdir}/file3"
+ </literallayout>
+ </para>
+
+ <para>
+ A relationship exists between the <filename>CONFFILES</filename> and
+ <filename><link linkend='var-FILES'>FILES</link></filename> variables.
+ The files listed within <filename>CONFFILES</filename> must be a subset of
+ the files listed within <filename>FILES</filename>.
+ Because the configuration files you provide with <filename>CONFFILES</filename>
+ are simply being identified so that the PMS will not overwrite them,
+ it makes sense that
+ the files must already be included as part of the package through the
+ <filename>FILES</filename> variable.
+ </para>
+
+ <note>
+ When specifying paths as part of the <filename>CONFFILES</filename> variable,
+ it is good practice to use appropriate path variables.
+ For example, <filename>${sysconfdir}</filename> rather than
+ <filename>/etc</filename> or <filename>${bindir}</filename> rather
+ than <filename>/usr/bin</filename>.
+ You can find a list of these variables at the top of the
+ <filename>meta/conf/bitbake.conf</filename> file in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFIG_INITRAMFS_SOURCE'><glossterm>CONFIG_INITRAMFS_SOURCE</glossterm>
+ <info>
+ CONFIG_INITRAMFS_SOURCE[doc] = "Identifies the initial RAM filesystem (initramfs) source files. The OpenEmbedded build system receives and uses this kernel Kconfig variable as an environment variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Identifies the initial RAM filesystem (initramfs) source
+ files.
+ The OpenEmbedded build system receives and uses
+ this kernel Kconfig variable as an environment variable.
+ By default, the variable is set to null ("").
+ </para>
+
+ <para>
+ The <filename>CONFIG_INITRAMFS_SOURCE</filename> can be
+ either a single cpio archive with a
+ <filename>.cpio</filename> suffix or a
+ space-separated list of directories and files for building
+ the initramfs image.
+ A cpio archive should contain a filesystem archive
+ to be used as an initramfs image.
+ Directories should contain a filesystem layout to be
+ included in the initramfs image.
+ Files should contain entries according to the format
+ described by the
+ <filename>usr/gen_init_cpio</filename> program in the
+ kernel tree.
+ </para>
+
+ <para>
+ If you specify multiple directories and files, the
+ initramfs image will be the aggregate of all of them.
+ </para>
+
+ <para>
+ For information on creating an initramfs, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFIG_SITE'><glossterm>CONFIG_SITE</glossterm>
+ <info>
+ CONFIG_SITE[doc] = "A list of files that contains autoconf test results relevant to the current build. This variable is used by the Autotools utilities when running configure."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of files that contains <filename>autoconf</filename> test results relevant
+ to the current build.
+ This variable is used by the Autotools utilities when running
+ <filename>configure</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFIGURE_FLAGS'><glossterm>CONFIGURE_FLAGS</glossterm>
+ <info>
+ CONFIGURE_FLAGS[doc] = "The minimal arguments for GNU configure."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal arguments for GNU configure.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CONFLICT_DISTRO_FEATURES'><glossterm>CONFLICT_DISTRO_FEATURES</glossterm>
+ <info>
+ CONFLICT_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that would be in conflict should the recipe be built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-distro_features_check'><filename>distro_features_check</filename></link>
+ class, this
+ variable identifies distribution features that would
+ be in conflict should the recipe
+ be built.
+ In other words, if the
+ <filename>CONFLICT_DISTRO_FEATURES</filename> variable
+ lists a feature that also appears in
+ <filename>DISTRO_FEATURES</filename> within the
+ current configuration, an error occurs and the
+ build stops.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPYLEFT_LICENSE_EXCLUDE'><glossterm>COPYLEFT_LICENSE_EXCLUDE</glossterm>
+ <info>
+ COPYLEFT_LICENSE_EXCLUDE[doc] = "Licenses to exclude in the source archived by the archiver class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list of licenses to exclude from the
+ source archived by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ In other words, if a license in a recipe's
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ value is in the value of
+ <filename>COPYLEFT_LICENSE_EXCLUDE</filename>, then its
+ source is not archived by the class.
+ <note>
+ The <filename>COPYLEFT_LICENSE_EXCLUDE</filename>
+ variable takes precedence over the
+ <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+ variable.
+ </note>
+ The default value, which is "CLOSED Proprietary", for
+ <filename>COPYLEFT_LICENSE_EXCLUDE</filename> is set
+ by the
+ <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+ class, which is inherited by the
+ <filename>archiver</filename> class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPYLEFT_LICENSE_INCLUDE'><glossterm>COPYLEFT_LICENSE_INCLUDE</glossterm>
+ <info>
+ COPYLEFT_LICENSE_INCLUDE[doc] = "Licenses to include in the source archived by the archiver class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list of licenses to include in the
+ source archived by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ In other words, if a license in a recipe's
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ value is in the value of
+ <filename>COPYLEFT_LICENSE_INCLUDE</filename>, then its
+ source is archived by the class.
+ </para>
+
+ <para>
+ The default value is set by the
+ <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+ class, which is inherited by the
+ <filename>archiver</filename> class.
+ The default value includes "GPL*", "LGPL*", and "AGPL*".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPYLEFT_PN_EXCLUDE'><glossterm>COPYLEFT_PN_EXCLUDE</glossterm>
+ <info>
+ COPYLEFT_PN_EXCLUDE[doc] = "Recipes to exclude in the source archived by the archiver class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recipes to exclude in the source archived
+ by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ The <filename>COPYLEFT_PN_EXCLUDE</filename> variable
+ overrides the license inclusion and exclusion caused
+ through the
+ <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+ and
+ <link linkend='var-COPYLEFT_LICENSE_EXCLUDE'><filename>COPYLEFT_LICENSE_EXCLUDE</filename></link>
+ variables, respectively.
+ </para>
+
+ <para>
+ The default value, which is "" indicating to not explicitly
+ exclude any recipes by name, for
+ <filename>COPYLEFT_PN_EXCLUDE</filename> is set
+ by the
+ <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+ class, which is inherited by the
+ <filename>archiver</filename> class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPYLEFT_PN_INCLUDE'><glossterm>COPYLEFT_PN_INCLUDE</glossterm>
+ <info>
+ COPYLEFT_PN_INCLUDE[doc] = "Recipes to include in the source archived by the archiver class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recipes to include in the source archived
+ by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ The <filename>COPYLEFT_PN_INCLUDE</filename> variable
+ overrides the license inclusion and exclusion caused
+ through the
+ <link linkend='var-COPYLEFT_LICENSE_INCLUDE'><filename>COPYLEFT_LICENSE_INCLUDE</filename></link>
+ and
+ <link linkend='var-COPYLEFT_LICENSE_EXCLUDE'><filename>COPYLEFT_LICENSE_EXCLUDE</filename></link>
+ variables, respectively.
+ </para>
+
+ <para>
+ The default value, which is "" indicating to not explicitly
+ include any recipes by name, for
+ <filename>COPYLEFT_PN_INCLUDE</filename> is set
+ by the
+ <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+ class, which is inherited by the
+ <filename>archiver</filename> class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPYLEFT_RECIPE_TYPES'><glossterm>COPYLEFT_RECIPE_TYPES</glossterm>
+ <info>
+ COPYLEFT_RECIPE_TYPES[doc] = "Recipe types to include in the source archived by the archiver class."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list of recipe types to include
+ in the source archived by the
+ <link linkend='ref-classes-archiver'><filename>archiver</filename></link>
+ class.
+ Recipe types are <filename>target</filename>,
+ <filename>native</filename>,
+ <filename>nativesdk</filename>,
+ <filename>cross</filename>,
+ <filename>crosssdk</filename>, and
+ <filename>cross-canadian</filename>.
+ </para>
+
+ <para>
+ The default value, which is "target*", for
+ <filename>COPYLEFT_RECIPE_TYPES</filename> is set
+ by the
+ <link linkend='ref-classes-copyleft_filter'><filename>copyleft_filter</filename></link>
+ class, which is inherited by the
+ <filename>archiver</filename> class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPY_LIC_DIRS'><glossterm>COPY_LIC_DIRS</glossterm>
+ <info>
+ COPY_LIC_DIRS[doc] = "If set to "1" along with the COPY_LIC_MANIFEST variable, the OpenEmbedded build system copies into the image the license files, which are located in /usr/share/common-licenses, for each package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "1" along with the
+ <link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link>
+ variable, the OpenEmbedded build system copies
+ into the image the license files, which are located in
+ <filename>/usr/share/common-licenses</filename>,
+ for each package.
+ The license files are placed
+ in directories within the image itself during build time.
+ <note>
+ The <filename>COPY_LIC_DIRS</filename> does not
+ offer a path for adding licenses for newly installed
+ packages to an image, which might be most suitable
+ for read-only filesystems that cannot be upgraded.
+ See the
+ <link linkend='var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></link>
+ variable for additional information.
+ You can also reference the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for information on providing license text.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COPY_LIC_MANIFEST'><glossterm>COPY_LIC_MANIFEST</glossterm>
+ <info>
+ COPY_LIC_MANIFEST[doc] = "If set to "1", the OpenEmbedded build system copies the license manifest for the image to /usr/share/common-licenses/license.manifest within the image itself."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "1", the OpenEmbedded build system copies
+ the license manifest for the image to
+ <filename>/usr/share/common-licenses/license.manifest</filename>
+ within the image itself during build time.
+ <note>
+ The <filename>COPY_LIC_MANIFEST</filename> does not
+ offer a path for adding licenses for newly installed
+ packages to an image, which might be most suitable
+ for read-only filesystems that cannot be upgraded.
+ See the
+ <link linkend='var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></link>
+ variable for additional information.
+ You can also reference the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for information on providing license text.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CORE_IMAGE_EXTRA_INSTALL'><glossterm>CORE_IMAGE_EXTRA_INSTALL</glossterm>
+ <info>
+ CORE_IMAGE_EXTRA_INSTALL[doc] = "Specifies the list of packages to be added to the image. You should only set this variable in the conf/local.conf file in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the list of packages to be added to the image.
+ You should only set this variable in the
+ <filename>local.conf</filename> configuration file found
+ in the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+
+ <para>
+ This variable replaces <filename>POKY_EXTRA_INSTALL</filename>, which is no longer supported.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COREBASE'><glossterm>COREBASE</glossterm>
+ <info>
+ COREBASE[doc] = "Specifies the parent directory of the OpenEmbedded-Core Metadata layer (i.e. meta)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the parent directory of the OpenEmbedded-Core
+ Metadata layer (i.e. <filename>meta</filename>).
+ </para>
+
+ <para>
+ It is an important distinction that
+ <filename>COREBASE</filename> points to the parent of this
+ layer and not the layer itself.
+ Consider an example where you have cloned the Poky Git
+ repository and retained the <filename>poky</filename>
+ name for your local copy of the repository.
+ In this case, <filename>COREBASE</filename> points to
+ the <filename>poky</filename> folder because it is the
+ parent directory of the <filename>poky/meta</filename>
+ layer.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-COREBASE_FILES'><glossterm>COREBASE_FILES</glossterm>
+ <info>
+ COREBASE_FILES[doc] = "Lists files from the COREBASE directory that should be copied other than the layers listed in the bblayers.conf file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists files from the
+ <link linkend='var-COREBASE'><filename>COREBASE</filename></link>
+ directory that should be copied other than the layers
+ listed in the <filename>bblayers.conf</filename> file.
+ The <filename>COREBASE_FILES</filename> variable exists
+ for the purpose of copying metadata from the
+ OpenEmbedded build system into the extensible
+ SDK.
+ </para>
+
+ <para>
+ Explicitly listing files in <filename>COREBASE</filename>
+ is needed because it typically contains build
+ directories and other files that should not normally
+ be copied into the extensible SDK.
+ Consequently, the value of
+ <filename>COREBASE_FILES</filename> is used in order to
+ only copy the files that are actually needed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CPP'><glossterm>CPP</glossterm>
+ <info>
+ CPP[doc] = "Minimum command and arguments to run the C preprocessor."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run the C
+ preprocessor.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CPPFLAGS'><glossterm>CPPFLAGS</glossterm>
+ <info>
+ CPPFLAGS[doc] = "Specifies the flags to pass to the C pre-processor (i.e. to both the C and the C++ compilers)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C pre-processor
+ (i.e. to both the C and the C++ compilers).
+ This variable is exported to an environment
+ variable and thus made visible to the software being
+ built during the compilation step.
+ </para>
+
+ <para>
+ Default initialization for <filename>CPPFLAGS</filename>
+ varies depending on what is being built:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-TARGET_CPPFLAGS'><filename>TARGET_CPPFLAGS</filename></link>
+ when building for the target
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILD_CPPFLAGS'><filename>BUILD_CPPFLAGS</filename></link>
+ when building for the build host (i.e.
+ <filename>-native</filename>)
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILDSDK_CPPFLAGS'><filename>BUILDSDK_CPPFLAGS</filename></link>
+ when building for an SDK (i.e.
+ <filename>nativesdk-</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CROSS_COMPILE'><glossterm>CROSS_COMPILE</glossterm>
+ <info>
+ CROSS_COMPILE[doc] = "The toolchain binary prefix for the target tools."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The toolchain binary prefix for the target tools.
+ The <filename>CROSS_COMPILE</filename> variable is the
+ same as the
+ <link linkend='var-TARGET_PREFIX'><filename>TARGET_PREFIX</filename></link>
+ variable.
+ <note>
+ The OpenEmbedded build system sets the
+ <filename>CROSS_COMPILE</filename> variable only in
+ certain contexts (e.g. when building for kernel
+ and kernel module recipes).
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CVSDIR'><glossterm>CVSDIR</glossterm>
+ <info>
+ CVSDIR[doc] = "The directory where cvs checkouts will be stored in."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory in which files checked out under the
+ CVS system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CXX'><glossterm>CXX</glossterm>
+ <info>
+ CXX[doc] = "Minimum command and arguments to run the C++ compiler."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run the C++
+ compiler.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-CXXFLAGS'><glossterm>CXXFLAGS</glossterm>
+ <info>
+ CXXFLAGS[doc] = "Specifies the flags to pass to the C++ compiler."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C++ compiler.
+ This variable is exported to an environment
+ variable and thus made visible to the software being
+ built during the compilation step.
+ </para>
+
+ <para>
+ Default initialization for <filename>CXXFLAGS</filename>
+ varies depending on what is being built:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-TARGET_CXXFLAGS'><filename>TARGET_CXXFLAGS</filename></link>
+ when building for the target
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILD_CXXFLAGS'><filename>BUILD_CXXFLAGS</filename></link>
+ when building for the build host (i.e.
+ <filename>-native</filename>)
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILDSDK_CXXFLAGS'><filename>BUILDSDK_CXXFLAGS</filename></link>
+ when building for an SDK (i.e.
+ <filename>nativesdk-</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-d'><title>D</title>
+
+ <glossentry id='var-D'><glossterm>D</glossterm>
+ <info>
+ D[doc] = "The destination directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The destination directory.
+ The location in the
+ <link linkend='build-directory'>Build Directory</link>
+ where components are installed by the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task.
+ This location defaults to:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/image
+ </literallayout>
+ <note><title>Caution</title>
+ Tasks that read from or write to this directory should
+ run under
+ <ulink url='&YOCTO_DOCS_OM_URL;#fakeroot-and-pseudo'>fakeroot</ulink>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DATE'><glossterm>DATE</glossterm>
+ <info>
+ DATE[doc] = "The date the build was started using YMD format."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The date the build was started.
+ Dates appear using the year, month, and day (YMD) format
+ (e.g. "20150209" for February 9th, 2015).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DATETIME'><glossterm>DATETIME</glossterm>
+ <info>
+ DATETIME[doc] = "The date and time the build was started."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The date and time on which the current build started.
+ The format is suitable for timestamps.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEBIAN_NOAUTONAME'><glossterm>DEBIAN_NOAUTONAME</glossterm>
+ <info>
+ DEBIAN_NOAUTONAME[doc] = "Prevents a particular package from being renamed according to Debian package naming."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class is inherited, which is the default behavior,
+ <filename>DEBIAN_NOAUTONAME</filename> specifies a
+ particular package should not be renamed according to
+ Debian library package naming.
+ You must use the package name as an override when you
+ set this variable.
+ Here is an example from the <filename>fontconfig</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ DEBIAN_NOAUTONAME_fontconfig-utils = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEBIANNAME'><glossterm>DEBIANNAME</glossterm>
+ <info>
+ DEBIANNAME[doc] = "Allows you to override the library name for an individual package for Debian library package renaming."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class is inherited, which is the default behavior,
+ <filename>DEBIANNAME</filename> allows you to override the
+ library name for an individual package.
+ Overriding the library name in these cases is rare.
+ You must use the package name as an override when you
+ set this variable.
+ Here is an example from the <filename>dbus</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ DEBIANNAME_${PN} = "dbus-1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEBUG_BUILD'><glossterm>DEBUG_BUILD</glossterm>
+ <info>
+ DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies to build packages with debugging information.
+ This influences the value of the
+ <filename><link linkend='var-SELECTED_OPTIMIZATION'>SELECTED_OPTIMIZATION</link></filename>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEBUG_OPTIMIZATION'><glossterm>DEBUG_OPTIMIZATION</glossterm>
+ <info>
+ DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-O -fno-omit-frame-pointer -g'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The options to pass in
+ <filename><link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link></filename>
+ and <filename><link linkend='var-CFLAGS'>CFLAGS</link></filename> when compiling
+ a system for debugging.
+ This variable defaults to "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEFAULT_PREFERENCE'><glossterm>DEFAULT_PREFERENCE</glossterm>
+ <info>
+ DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a weak bias for recipe selection priority.
+ </para>
+
+ <para>
+ The most common usage of this is variable is to set
+ it to "-1" within a recipe for a development version of a
+ piece of software.
+ Using the variable in this way causes the stable version
+ of the recipe to build by default in the absence of
+ <filename><link linkend='var-PREFERRED_VERSION'>PREFERRED_VERSION</link></filename>
+ being used to build the development version.
+ </para>
+
+ <note>
+ The bias provided by <filename>DEFAULT_PREFERENCE</filename>
+ is weak and is overridden by
+ <filename><link linkend='var-BBFILE_PRIORITY'>BBFILE_PRIORITY</link></filename>
+ if that variable is different between two layers
+ that contain different versions of the same recipe.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEFAULTTUNE'><glossterm>DEFAULTTUNE</glossterm>
+ <info>
+ DEFAULTTUNE[doc] = "The default CPU and Application Binary Interface (ABI) tunings (i.e. the "tune") used by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The default CPU and Application Binary Interface (ABI)
+ tunings (i.e. the "tune") used by the OpenEmbedded build
+ system.
+ The <filename>DEFAULTTUNE</filename> helps define
+ <link linkend='var-TUNE_FEATURES'><filename>TUNE_FEATURES</filename></link>.
+ </para>
+
+ <para>
+ The default tune is either implicitly or explicitly set
+ by the machine
+ (<link linkend='var-MACHINE'><filename>MACHINE</filename></link>).
+ However, you can override the setting using available tunes
+ as defined with
+ <link linkend='var-AVAILTUNES'><filename>AVAILTUNES</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPENDS'><glossterm>DEPENDS</glossterm>
+ <info>
+ DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists a recipe's build-time dependencies.
+ These are dependencies on other recipes whose
+ contents (e.g. headers and shared libraries) are needed
+ by the recipe at build time.
+ </para>
+
+ <para>
+ As an example, consider a recipe <filename>foo</filename>
+ that contains the following assignment:
+ <literallayout class='monospaced'>
+ DEPENDS = "bar"
+ </literallayout>
+ The practical effect of the previous assignment is that
+ all files installed by bar will be available in the
+ appropriate staging sysroot, given by the
+ <link linkend='var-STAGING_DIR'><filename>STAGING_DIR*</filename></link>
+ variables, by the time the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task for <filename>foo</filename> runs.
+ This mechanism is implemented by having
+ <filename>do_configure</filename> depend on the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task of each recipe listed in <filename>DEPENDS</filename>,
+ through a
+ <filename>[</filename><ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'><filename>deptask</filename></ulink><filename>]</filename>
+ declaration in the
+ <link linkend='ref-classes-base'><filename>base</filename></link>
+ class.
+ <note>
+ It seldom is necessary to reference, for example,
+ <filename>STAGING_DIR_HOST</filename> explicitly.
+ The standard classes and build-related variables are
+ configured to automatically use the appropriate staging
+ sysroots.
+ </note>
+ As another example, <filename>DEPENDS</filename> can also
+ be used to add utilities that run on the build machine
+ during the build.
+ For example, a recipe that makes use of a code generator
+ built by the recipe <filename>codegen</filename> might have
+ the following:
+ <literallayout class='monospaced'>
+ DEPENDS = "codegen-native"
+ </literallayout>
+ For more information, see the
+ <link linkend='ref-classes-native'><filename>native</filename></link>
+ class and the
+ <link linkend='var-EXTRANATIVEPATH'><filename>EXTRANATIVEPATH</filename></link>
+ variable.
+ <note>
+ <title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ <filename>DEPENDS</filename> is a list of
+ recipe names.
+ Or, to be more precise, it is a list of
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ names, which usually match recipe names.
+ Putting a package name such as "foo-dev" in
+ <filename>DEPENDS</filename> does not make
+ sense.
+ Use "foo" instead, as this will put files
+ from all the packages that make up
+ <filename>foo</filename>, which includes
+ those from <filename>foo-dev</filename>, into
+ the sysroot.
+ </para></listitem>
+ <listitem><para>
+ One recipe having another recipe in
+ <filename>DEPENDS</filename> does not by itself
+ add any runtime dependencies between the
+ packages produced by the two recipes.
+ However, as explained in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and
+ Concepts Manual, runtime dependencies will
+ often be added automatically, meaning
+ <filename>DEPENDS</filename> alone is
+ sufficient for most recipes.
+ </para></listitem>
+ <listitem><para>
+ Counterintuitively,
+ <filename>DEPENDS</filename> is often necessary
+ even for recipes that install precompiled
+ components.
+ For example, if <filename>libfoo</filename>
+ is a precompiled library that links against
+ <filename>libbar</filename>, then
+ linking against <filename>libfoo</filename>
+ requires both <filename>libfoo</filename>
+ and <filename>libbar</filename> to be available
+ in the sysroot.
+ Without a <filename>DEPENDS</filename> from the
+ recipe that installs <filename>libfoo</filename>
+ to the recipe that installs
+ <filename>libbar</filename>, other recipes might
+ fail to link against
+ <filename>libfoo</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ For information on runtime dependencies, see the
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable.
+ You can also see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
+ "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
+ sections in the BitBake User Manual for additional
+ information on tasks and dependencies.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR'><glossterm>DEPLOY_DIR</glossterm>
+ <info>
+ DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs, and other output files that are ready to be used outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the general area that the OpenEmbedded build
+ system uses to place images, packages, SDKs, and other output
+ files that are ready to be used outside of the build system.
+ By default, this directory resides within the
+ <link linkend='build-directory'>Build Directory</link>
+ as <filename>${TMPDIR}/deploy</filename>.
+ </para>
+
+ <para>
+ For more information on the structure of the Build
+ Directory, see
+ "<link linkend='structure-build'>The Build Directory - <filename>build/</filename></link>"
+ section.
+ For more detail on the contents of the
+ <filename>deploy</filename> directory, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>",
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>",
+ and
+ "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-dev-environment'>Application Development SDK</ulink>"
+ sections all in the Yocto Project Overview and Concepts
+ Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR_DEB'><glossterm>DEPLOY_DIR_DEB</glossterm>
+ <info>
+ DEPLOY_DIR_DEB[doc] = "Points to a Debian-specific area that the OpenEmbedded build system uses to place images, packages, SDKs, and other output files that are ready to be used outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the area that the OpenEmbedded build system uses
+ to place Debian packages that are ready to be used outside
+ of the build system.
+ This variable applies only when
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ contains "package_deb".
+ </para>
+
+ <para>
+ The BitBake configuration file initially defines the
+ <filename>DEPLOY_DIR_DEB</filename> variable as a
+ sub-folder of
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ <literallayout class='monospaced'>
+ DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>
+ class uses the
+ <filename>DEPLOY_DIR_DEB</filename> variable to make sure
+ the
+ <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_deb</filename></link>
+ task writes Debian packages into the appropriate folder.
+ For more information on how packaging works, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR_IMAGE'><glossterm>DEPLOY_DIR_IMAGE</glossterm>
+ <info>
+ DEPLOY_DIR_IMAGE[doc] = "Points to the area that the OpenEmbedded build system uses to place images and other associated output files that are ready to be deployed onto the target machine."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the area that the OpenEmbedded build system uses
+ to place images and other associated output files that are
+ ready to be deployed onto the target machine.
+ The directory is machine-specific as it contains the
+ <filename>${MACHINE}</filename> name.
+ By default, this directory resides within the
+ <link linkend='build-directory'>Build Directory</link>
+ as <filename>${DEPLOY_DIR}/images/${MACHINE}/</filename>.
+ </para>
+
+ <para>
+ For more information on the structure of the Build
+ Directory, see
+ "<link linkend='structure-build'>The Build Directory - <filename>build/</filename></link>"
+ section.
+ For more detail on the contents of the
+ <filename>deploy</filename> directory, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#images-dev-environment'>Images</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_OM_URL;#sdk-dev-environment'>Application Development SDK</ulink>"
+ sections both in the Yocto Project Overview and Concepts
+ Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR_IPK'><glossterm>DEPLOY_DIR_IPK</glossterm>
+ <info>
+ DEPLOY_DIR_IPK[doc] = "Points to a IPK-specific area that the OpenEmbedded build system uses to place images, packages, SDKs, and other output files that are ready to be used outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the area that the OpenEmbedded build system uses
+ to place IPK packages that are ready to be used outside of
+ the build system.
+ This variable applies only when
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ contains "package_ipk".
+ </para>
+
+ <para>
+ The BitBake configuration file initially defines this
+ variable as a sub-folder of
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ <literallayout class='monospaced'>
+ DEPLOY_DIR_IPK = "${DEPLOY_DIR}/ipk"
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>
+ class uses the
+ <filename>DEPLOY_DIR_IPK</filename> variable to make sure
+ the
+ <link linkend='ref-tasks-package_write_ipk'><filename>do_package_write_ipk</filename></link>
+ task writes IPK packages into the appropriate folder.
+ For more information on how packaging works, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR_RPM'><glossterm>DEPLOY_DIR_RPM</glossterm>
+ <info>
+ DEPLOY_DIR_RPM[doc] = "Points to a RPM-specific area that the OpenEmbedded build system uses to place images, packages, SDKs, and other output files that are ready to be used outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the area that the OpenEmbedded build system uses
+ to place RPM packages that are ready to be used outside
+ of the build system.
+ This variable applies only when
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ contains "package_rpm".
+ </para>
+
+ <para>
+ The BitBake configuration file initially defines this
+ variable as a sub-folder of
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ <literallayout class='monospaced'>
+ DEPLOY_DIR_RPM = "${DEPLOY_DIR}/rpm"
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>
+ class uses the
+ <filename>DEPLOY_DIR_RPM</filename> variable to make sure
+ the
+ <link linkend='ref-tasks-package_write_rpm'><filename>do_package_write_rpm</filename></link>
+ task writes RPM packages into the appropriate folder.
+ For more information on how packaging works, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOY_DIR_TAR'><glossterm>DEPLOY_DIR_TAR</glossterm>
+ <info>
+ DEPLOY_DIR_TAR[doc] = "Points to a tarball area that the OpenEmbedded build system uses to place images, packages, SDKs, and other output files that are ready to be used outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the area that the OpenEmbedded build system uses
+ to place tarballs that are ready to be used outside of
+ the build system.
+ This variable applies only when
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ contains "package_tar".
+ </para>
+
+ <para>
+ The BitBake configuration file initially defines this
+ variable as a sub-folder of
+ <link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link>:
+ <literallayout class='monospaced'>
+ DEPLOY_DIR_TAR = "${DEPLOY_DIR}/tar"
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link>
+ class uses the
+ <filename>DEPLOY_DIR_TAR</filename> variable to make sure
+ the
+ <link linkend='ref-tasks-package_write_tar'><filename>do_package_write_tar</filename></link>
+ task writes TAR packages into the appropriate folder.
+ For more information on how packaging works, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#package-feeds-dev-environment'>Package Feeds</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DEPLOYDIR'><glossterm>DEPLOYDIR</glossterm>
+ <info>
+ DEPLOYDIR[doc] = "For recipes that inherit the deploy class, the DEPLOYDIR points to a temporary work area for deployed files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-deploy'><filename>deploy</filename></link>
+ class, the <filename>DEPLOYDIR</filename> points to a
+ temporary work area for deployed files that is set in the
+ <filename>deploy</filename> class as follows:
+ <literallayout class='monospaced'>
+ DEPLOYDIR = "${WORKDIR}/deploy-${<link linkend='var-PN'><filename>PN</filename></link>}"
+ </literallayout>
+ </para>
+
+ <para>
+ Recipes inheriting the <filename>deploy</filename> class
+ should copy files to be deployed into
+ <filename>DEPLOYDIR</filename>, and the class will take
+ care of copying them into
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
+ afterwards.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DESCRIPTION'><glossterm>DESCRIPTION</glossterm>
+ <info>
+ DESCRIPTION[doc] = "The package description used by package managers. If not set, DESCRIPTION takes the value of the SUMMARY variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The package description used by package managers.
+ If not set, <filename>DESCRIPTION</filename> takes
+ the value of the
+ <link linkend='var-SUMMARY'><filename>SUMMARY</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISK_SIGNATURE'><glossterm>DISK_SIGNATURE</glossterm>
+ <info>
+ DISK_SIGNATURE[doc] = "A 32-bit MBR disk signature used by directdisk images."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A 32-bit MBR disk signature used by
+ <filename>directdisk</filename> images.
+ </para>
+
+ <para>
+ By default, the signature is set to an automatically
+ generated random value that allows the OpenEmbedded
+ build system to create a boot loader.
+ You can override the signature in the image recipe
+ by setting <filename>DISK_SIGNATURE</filename> to an
+ 8-digit hex string.
+ You might want to override
+ <filename>DISK_SIGNATURE</filename> if you want the disk
+ signature to remain constant between image builds.
+ </para>
+
+ <para>
+ When using Linux 3.8 or later, you can use
+ <filename>DISK_SIGNATURE</filename> to specify the root
+ by UUID to allow the kernel to locate the root device
+ even if the device name changes due to differences in
+ hardware configuration.
+ By default, <filename>ROOT_VM</filename> is set
+ as follows:
+ <literallayout class='monospaced'>
+ ROOT_VM ?= "root=/dev/sda2"
+ </literallayout>
+ However, you can change this to locate the root device
+ using the disk signature instead:
+ <literallayout class='monospaced'>
+ ROOT_VM = "root=PARTUUID=${DISK_SIGNATURE}-02"
+ </literallayout>
+ </para>
+
+ <para>
+ As previously mentioned, it is possible to set the
+ <filename>DISK_SIGNATURE</filename> variable in your
+ <filename>local.conf</filename> file to a fixed
+ value if you do not want <filename>syslinux.cfg</filename>
+ changing for each build.
+ You might find this useful when you want to upgrade the
+ root filesystem on a device without having to recreate or
+ modify the master boot record.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO'><glossterm>DISTRO</glossterm>
+ <info>
+ DISTRO[doc] = "The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ 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
+ <filename>.conf</filename>.
+ For example, the distribution configuration file for the
+ Poky distribution is named <filename>poky.conf</filename>
+ and resides in the
+ <filename>meta-poky/conf/distro</filename> directory of
+ the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+
+ <para>
+ Within that <filename>poky.conf</filename> file, the
+ <filename>DISTRO</filename> variable is set as follows:
+ <literallayout class='monospaced'>
+ DISTRO = "poky"
+ </literallayout>
+ </para>
+
+ <para>
+ Distribution configuration files are located in a
+ <filename>conf/distro</filename> directory within the
+ <link linkend='metadata'>Metadata</link>
+ that contains the distribution configuration.
+ The value for <filename>DISTRO</filename> must not contain
+ spaces, and is typically all lower-case.
+ <note>
+ If the <filename>DISTRO</filename> variable is blank, a set
+ of default configurations are used, which are specified
+ within
+ <filename>meta/conf/distro/defaultsetup.conf</filename>
+ also in the Source Directory.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_CODENAME'><glossterm>DISTRO_CODENAME</glossterm>
+ <info>
+ DISTRO_CODENAME[doc] = "Specifies a codename for the distribution being built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a codename for the distribution being built.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_EXTRA_RDEPENDS'><glossterm>DISTRO_EXTRA_RDEPENDS</glossterm>
+ <info>
+ DISTRO_EXTRA_RDEPENDS[doc] = "Specifies a list of distro-specific packages to add to all images. The variable only applies to the images that include packagegroup-base."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of distro-specific packages to add to all images.
+ This variable takes affect through
+ <filename>packagegroup-base</filename> so the
+ variable only really applies to the more full-featured
+ images that include <filename>packagegroup-base</filename>.
+ You can use this variable to keep distro policy out of
+ generic images.
+ As with all other distro variables, you set this variable
+ in the distro <filename>.conf</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_EXTRA_RRECOMMENDS'><glossterm>DISTRO_EXTRA_RRECOMMENDS</glossterm>
+ <info>
+ DISTRO_EXTRA_RRECOMMENDS[doc] = "Specifies a list of distro-specific packages to add to all images if the packages exist. The list of packages are automatically installed but you can remove them."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of distro-specific packages to add to all images
+ if the packages exist.
+ The packages might not exist or be empty (e.g. kernel modules).
+ The list of packages are automatically installed but you can
+ remove them.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES'><glossterm>DISTRO_FEATURES</glossterm>
+ <info>
+ DISTRO_FEATURES[doc] = "The features enabled for the distribution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The software support you want in your distribution for
+ various features.
+ You define your distribution features in the distribution
+ configuration file.
+ </para>
+
+ <para>
+ In most cases, the presence or absence of a feature in
+ <filename>DISTRO_FEATURES</filename> is translated to the
+ appropriate option supplied to the configure script
+ during the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task for recipes that optionally support the feature.
+ For example, specifying "x11" in
+ <filename>DISTRO_FEATURES</filename>, causes
+ every piece of software built for the target that can
+ optionally support X11 to have its X11 support enabled.
+ </para>
+
+ <para>
+ Two more examples are Bluetooth and NFS support.
+ For a more complete list of features that ships with the
+ Yocto Project and that you can provide with this variable,
+ see the
+ "<link linkend='ref-features-distro'>Distro Features</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_BACKFILL'><glossterm>DISTRO_FEATURES_BACKFILL</glossterm>
+ <info>
+ DISTRO_FEATURES_BACKFILL[doc] = "Features to be added to DISTRO_FEATURES if not also present in DISTRO_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and it is not intended to be user-configurable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Features to be added to
+ <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename>
+ if not also present in
+ <filename><link linkend='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'>DISTRO_FEATURES_BACKFILL_CONSIDERED</link></filename>.
+ </para>
+
+ <para>
+ This variable is set in the <filename>meta/conf/bitbake.conf</filename> file.
+ It is not intended to be user-configurable.
+ It is best to just reference the variable to see which distro features are
+ being backfilled for all distro configurations.
+ See the <link linkend='ref-features-backfill'>Feature Backfilling</link> section for
+ more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_BACKFILL_CONSIDERED'><glossterm>DISTRO_FEATURES_BACKFILL_CONSIDERED</glossterm>
+ <info>
+ DISTRO_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from DISTRO_FEATURES_BACKFILL that should not be backfilled (i.e. added to DISTRO_FEATURES) during the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Features from
+ <filename><link linkend='var-DISTRO_FEATURES_BACKFILL'>DISTRO_FEATURES_BACKFILL</link></filename>
+ that should not be backfilled (i.e. added to
+ <filename><link linkend='var-DISTRO_FEATURES'>DISTRO_FEATURES</link></filename>)
+ during the build.
+ See the "<link linkend='ref-features-backfill'>Feature Backfilling</link>" section for
+ more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_DEFAULT'><glossterm>DISTRO_FEATURES_DEFAULT</glossterm>
+ <info>
+ DISTRO_FEATURES_DEFAULT[doc] = "Provides the default list of distro features with the exception of any libc-specific features."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A convenience variable that gives you the default
+ list of distro features with the exception of any
+ features specific to the C library
+ (<filename>libc</filename>).
+ </para>
+
+ <para>
+ When creating a custom distribution, you might find it
+ useful to be able to reuse the default
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ options without the need to write out the full set.
+ Here is an example that uses
+ <filename>DISTRO_FEATURES_DEFAULT</filename> from a
+ custom distro configuration file:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} myfeature"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_FILTER_NATIVE'><glossterm>DISTRO_FEATURES_FILTER_NATIVE</glossterm>
+ <info>
+ DISTRO_FEATURES_FILTER_NATIVE[doc] = "Specifies a list of features that if present in the target DISTRO_FEATURES value should be included in DISTRO_FEATURES when building native recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of features that if present in
+ the target
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ value should be included in
+ <filename>DISTRO_FEATURES</filename> when building native
+ recipes.
+ This variable is used in addition to the features
+ filtered using the
+ <link linkend='var-DISTRO_FEATURES_NATIVE'><filename>DISTRO_FEATURES_NATIVE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_FILTER_NATIVESDK'><glossterm>DISTRO_FEATURES_FILTER_NATIVESDK</glossterm>
+ <info>
+ DISTRO_FEATURES_FILTER_NATIVESDK[doc] = "Specifies a list of features that if present in the target DISTRO_FEATURES value should be included in DISTRO_FEATURES when building nativesdk recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of features that if present in the target
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ value should be included in
+ <filename>DISTRO_FEATURES</filename> when building
+ nativesdk recipes.
+ This variable is used in addition to the features
+ filtered using the
+ <link linkend='var-DISTRO_FEATURES_NATIVESDK'><filename>DISTRO_FEATURES_NATIVESDK</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_LIBC'><glossterm>DISTRO_FEATURES_LIBC</glossterm>
+ <info>
+ DISTRO_FEATURES_LIBC[doc] = "Specifies the list of distro features that are specific to the C library (libc)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A convenience variable that specifies the list of distro
+ features that are specific to the C library
+ (<filename>libc</filename>).
+ Typically, these features are prefixed with "libc-" and
+ control which features are enabled at during the build
+ within the C library itself.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_NATIVE'><glossterm>DISTRO_FEATURES_NATIVE</glossterm>
+ <info>
+ DISTRO_FEATURES_NATIVE[doc] = "Specifies a list of features that should be included in DISTRO_FEATURES when building native recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of features that should be included in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ when building native recipes.
+ This variable is used in addition to the features
+ filtered using the
+ <link linkend='var-DISTRO_FEATURES_FILTER_NATIVE'><filename>DISTRO_FEATURES_FILTER_NATIVE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_FEATURES_NATIVESDK'><glossterm>DISTRO_FEATURES_NATIVESDK</glossterm>
+ <info>
+ DISTRO_FEATURES_NATIVESDK[doc] = "Specifies a list of features that should be included in DISTRO_FEATURES when building nativesdk recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of features that should be included in
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>
+ when building nativesdk recipes.
+ This variable is used in addition to the features
+ filtered using the
+ <link linkend='var-DISTRO_FEATURES_FILTER_NATIVESDK'><filename>DISTRO_FEATURES_FILTER_NATIVESDK</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_NAME'><glossterm>DISTRO_NAME</glossterm>
+ <info>
+ DISTRO_NAME[doc] = "The long name of the distribution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The long name of the distribution.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTRO_VERSION'><glossterm>DISTRO_VERSION</glossterm>
+ <info>
+ DISTRO_VERSION[doc] = "The version of the distribution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The version of the distribution.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DISTROOVERRIDES'><glossterm>DISTROOVERRIDES</glossterm>
+ <info>
+ DISTROOVERRIDES[doc] = "A colon-separated list of overrides specific to the current distribution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A colon-separated list of overrides specific to the
+ current distribution.
+ By default, this list includes the value of
+ <link linkend='var-DISTRO'><filename>DISTRO</filename></link>.
+ </para>
+
+ <para>
+ You can extend <filename>DISTROOVERRIDES</filename>
+ to add extra overrides that should apply to
+ the distribution.
+ </para>
+
+ <para>
+ The underlying mechanism behind
+ <filename>DISTROOVERRIDES</filename> is simply that it
+ is included in the default value of
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DL_DIR'><glossterm>DL_DIR</glossterm>
+ <info>
+ DL_DIR[doc] = "The central download directory used by the build process to store downloads. By default, the directory is 'downloads' in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The central download directory used by the build process to
+ store downloads.
+ By default, <filename>DL_DIR</filename> gets files
+ suitable for mirroring for everything except Git
+ repositories.
+ If you want tarballs of Git repositories, use the
+ <link linkend='var-BB_GENERATE_MIRROR_TARBALLS'><filename>BB_GENERATE_MIRROR_TARBALLS</filename></link>
+ variable.
+ </para>
+
+ <para>
+ You can set this directory by defining the
+ <filename>DL_DIR</filename> variable in the
+ <filename>conf/local.conf</filename> file.
+ This directory is self-maintaining and you should not have
+ to touch it.
+ By default, the directory is <filename>downloads</filename>
+ in the
+ <link linkend='build-directory'>Build Directory</link>.
+ <literallayout class='monospaced'>
+ #DL_DIR ?= "${TOPDIR}/downloads"
+ </literallayout>
+ To specify a different download directory, simply remove
+ the comment from the line and provide your directory.
+ </para>
+
+ <para>
+ During a first build, the system downloads many different
+ source code tarballs from various upstream projects.
+ Downloading can take a while, particularly if your network
+ connection is slow.
+ Tarballs are all stored in the directory defined by
+ <filename>DL_DIR</filename> and the build system looks there
+ first to find source tarballs.
+ <note>
+ When wiping and rebuilding, you can preserve this
+ directory to speed up this part of subsequent
+ builds.
+ </note>
+ </para>
+
+ <para>
+ You can safely share this directory between multiple builds
+ on the same development machine.
+ For additional information on how the build process gets
+ source files when working behind a firewall or proxy server,
+ see this specific question in the
+ "<link linkend='how-does-the-yocto-project-obtain-source-code-and-will-it-work-behind-my-firewall-or-proxy-server'>FAQ</link>"
+ chapter.
+ You can also refer to the
+ "<ulink url='&YOCTO_WIKI_URL;/wiki/Working_Behind_a_Network_Proxy'>Working Behind a Network Proxy</ulink>"
+ Wiki page.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-DOC_COMPRESS'><glossterm>DOC_COMPRESS</glossterm>
+ <info>
+ DOC_COMPRESS[doc] = "When inheriting the compress_doc class, this variable sets the compression policy used when the OpenEmbedded build system compresses man pages and info pages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-compress_doc'><filename>compress_doc</filename></link>
+ class, this variable sets the compression policy used when
+ the OpenEmbedded build system compresses man pages and info
+ pages.
+ By default, the compression method used is gz (gzip).
+ Other policies available are xz and bz2.
+ </para>
+
+ <para>
+ For information on policies and on how to use this
+ variable, see the comments in the
+ <filename>meta/classes/compress_doc.bbclass</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-e'><title>E</title>
+
+ <glossentry id='var-EFI_PROVIDER'><glossterm>EFI_PROVIDER</glossterm>
+ <info>
+ EFI_PROVIDER[doc] = "When building bootable images (i.e. where hddimg, iso, or wic.vmdk is in IMAGE_FSTYPES), the EFI_PROVIDER variable specifies the EFI bootloader to use."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When building bootable images (i.e. where
+ <filename>hddimg</filename>, <filename>iso</filename>,
+ or <filename>wic.vmdk</filename> is in
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>),
+ the <filename>EFI_PROVIDER</filename> variable specifies
+ the EFI bootloader to use.
+ The default is "grub-efi", but "systemd-boot" can be used
+ instead.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-systemd-boot'><filename>systemd-boot</filename></link>
+ and
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ classes for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ENABLE_BINARY_LOCALE_GENERATION'><glossterm>ENABLE_BINARY_LOCALE_GENERATION</glossterm>
+ <info>
+ ENABLE_BINARY_LOCALE_GENERATION[doc] = "Controls which locales for glibc are generated during the build. The variable is useful if the target device has 64Mbytes of RAM or less."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Variable that controls which locales for
+ <filename>glibc</filename> are generated during the
+ build (useful if the target device has 64Mbytes
+ of RAM or less).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ERR_REPORT_DIR'><glossterm>ERR_REPORT_DIR</glossterm>
+ <info>
+ ERR_REPORT_DIR[doc] = "When used with the report-error class, specifies the path used for storing the debug files created by the error reporting tool, which allows you to submit build errors you encounter to a central database."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used with the
+ <link linkend='ref-classes-report-error'><filename>report-error</filename></link>
+ class, specifies the path used for storing the debug files
+ created by the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#using-the-error-reporting-tool'>error reporting tool</ulink>,
+ which allows you to submit build errors you encounter to a
+ central database.
+ By default, the value of this variable is
+ <filename>${</filename><link linkend='var-LOG_DIR'><filename>LOG_DIR</filename></link><filename>}/error-report</filename>.
+ </para>
+
+ <para>
+ You can set <filename>ERR_REPORT_DIR</filename> to the path
+ you want the error reporting tool to store the debug files
+ as follows in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ ERR_REPORT_DIR = "<replaceable>path</replaceable>"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ERROR_QA'><glossterm>ERROR_QA</glossterm>
+ <info>
+ ERROR_QA[doc] = "Specifies the quality assurance checks whose failures are reported as errors by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the quality assurance checks whose failures are
+ reported as errors by the OpenEmbedded build system.
+ You set this variable in your distribution configuration
+ file.
+ For a list of the checks you can control with this variable,
+ see the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXCLUDE_FROM_SHLIBS'><glossterm>EXCLUDE_FROM_SHLIBS</glossterm>
+ <info>
+ EXCLUDE_FROM_SHLIBS[doc] = "Causes the OpenEmbedded build system's shared libraries resolver to exclude an entire package when scanning for shared libraries."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Triggers the OpenEmbedded build system's shared libraries
+ resolver to exclude an entire package when scanning for
+ shared libraries.
+ <note>
+ The shared libraries resolver's functionality results
+ in part from the internal function
+ <filename>package_do_shlibs</filename>, which is part of
+ the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task.
+ You should be aware that the shared libraries resolver
+ might implicitly define some dependencies between
+ packages.
+ </note>
+ The <filename>EXCLUDE_FROM_SHLIBS</filename> variable is
+ similar to the
+ <link linkend='var-PRIVATE_LIBS'><filename>PRIVATE_LIBS</filename></link>
+ variable, which excludes a package's particular libraries
+ only and not the whole package.
+ </para>
+
+ <para>
+ Use the
+ <filename>EXCLUDE_FROM_SHLIBS</filename> variable by
+ setting it to "1" for a particular package:
+ <literallayout class='monospaced'>
+ EXCLUDE_FROM_SHLIBS = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXCLUDE_FROM_WORLD'><glossterm>EXCLUDE_FROM_WORLD</glossterm>
+ <info>
+ EXCLUDE_FROM_WORLD[doc] = "Directs BitBake to exclude a recipe from world builds (i.e. bitbake world)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Directs BitBake to exclude a recipe from world builds (i.e.
+ <filename>bitbake world</filename>).
+ During world builds, BitBake locates, parses and builds all
+ recipes found in every layer exposed in the
+ <filename>bblayers.conf</filename> configuration file.
+ </para>
+
+ <para>
+ To exclude a recipe from a world build using this variable,
+ set the variable to "1" in the recipe.
+ </para>
+
+ <note>
+ Recipes added to <filename>EXCLUDE_FROM_WORLD</filename>
+ may still be built during a world build in order to satisfy
+ dependencies of other recipes.
+ Adding a recipe to <filename>EXCLUDE_FROM_WORLD</filename>
+ only ensures that the recipe is not explicitly added
+ to the list of build targets in a world build.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTENDPE'><glossterm>EXTENDPE</glossterm>
+ <info>
+ EXTENDPE[doc] = "Used with file and pathnames to create a prefix for a recipe's version based on the recipe's PE value. If PE is set and greater than zero for a recipe, EXTENDPE becomes that value."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used with file and pathnames to create a prefix for a recipe's
+ version based on the recipe's
+ <link linkend='var-PE'><filename>PE</filename></link> value.
+ If <filename>PE</filename> is set and greater than zero for a recipe,
+ <filename>EXTENDPE</filename> becomes that value (e.g if
+ <filename>PE</filename> is equal to "1" then <filename>EXTENDPE</filename>
+ becomes "1_").
+ If a recipe's <filename>PE</filename> is not set (the default) or is equal to
+ zero, <filename>EXTENDPE</filename> becomes "".</para>
+ <para>See the <link linkend='var-STAMP'><filename>STAMP</filename></link>
+ variable for an example.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTENDPKGV'><glossterm>EXTENDPKGV</glossterm>
+ <info>
+ EXTENDPKGV[doc] = "The full package version specification as it appears on the final packages produced by a recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The full package version specification as it appears on the
+ final packages produced by a recipe.
+ The variable's value is normally used to fix a runtime
+ dependency to the exact same version of another package
+ in the same recipe:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN}-additional-module = "${PN} (= ${EXTENDPKGV})"
+ </literallayout>
+ </para>
+
+ <para>
+ The dependency relationships are intended to force the
+ package manager to upgrade these types of packages in
+ lock-step.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTERNAL_KERNEL_TOOLS'><glossterm>EXTERNAL_KERNEL_TOOLS</glossterm>
+ <info>
+ EXTERNAL_KERNEL_TOOLS[doc] = "Indicates kernel tools are external to the source tree."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When set, the <filename>EXTERNAL_KERNEL_TOOLS</filename>
+ variable indicates that these tools are not in the
+ source tree.
+ </para>
+
+ <para>
+ When kernel tools are available in the tree, they are
+ preferred over any externally installed tools.
+ Setting the <filename>EXTERNAL_KERNEL_TOOLS</filename>
+ variable tells the OpenEmbedded build system to prefer
+ the installed external tools.
+ See the
+ <link linkend='ref-classes-kernel-yocto'><filename>kernel-yocto</filename></link>
+ class in <filename>meta/classes</filename> to see how
+ the variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTERNALSRC'><glossterm>EXTERNALSRC</glossterm>
+ <info>
+ EXTERNALSRC[doc] = "If externalsrc.bbclass is inherited, this variable points to the source tree, which is outside of the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-externalsrc'><filename>externalsrc</filename></link>
+ class, this variable points to the source tree, which is
+ outside of the OpenEmbedded build system.
+ When set, this variable sets the
+ <link linkend='var-S'><filename>S</filename></link>
+ variable, which is what the OpenEmbedded build system uses
+ to locate unpacked recipe source code.
+ </para>
+
+ <para>
+ For more information on
+ <filename>externalsrc.bbclass</filename>, see the
+ "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>"
+ section.
+ You can also find information on how to use this variable
+ in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTERNALSRC_BUILD'><glossterm>EXTERNALSRC_BUILD</glossterm>
+ <info>
+ EXTERNALSRC_BUILD[doc] = "If externalsrc.bbclass is inherited, this variable points to the directory in which the recipe's source code is built, which is outside of the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-externalsrc'><filename>externalsrc</filename></link>
+ class, this variable points to the directory in which the
+ recipe's source code is built, which is outside of the
+ OpenEmbedded build system.
+ When set, this variable sets the
+ <link linkend='var-B'><filename>B</filename></link>
+ variable, which is what the OpenEmbedded build system uses
+ to locate the Build Directory.
+ </para>
+
+ <para>
+ For more information on
+ <filename>externalsrc.bbclass</filename>, see the
+ "<link linkend='ref-classes-externalsrc'><filename>externalsrc.bbclass</filename></link>"
+ section.
+ You can also find information on how to use this variable
+ in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-software-from-an-external-source'>Building Software from an External Source</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_AUTORECONF'><glossterm>EXTRA_AUTORECONF</glossterm>
+ <info>
+ EXTRA_AUTORECONF[doc] = "Extra options passed to the autoreconf command, which is executed during do_configure."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For recipes inheriting the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class, you can use <filename>EXTRA_AUTORECONF</filename> to
+ specify extra options to pass to the
+ <filename>autoreconf</filename> command that is
+ executed during the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task.
+ </para>
+
+ <para>
+ The default value is "--exclude=autopoint".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_IMAGE_FEATURES'><glossterm>EXTRA_IMAGE_FEATURES</glossterm>
+ <info>
+ EXTRA_IMAGE_FEATURES[doc] = "The list of additional features to include in an image. Configure this variable in the conf/local.conf file in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of additional features to include in an image.
+ When listing more than one feature, separate them with
+ a space.
+ </para>
+
+ <para>
+ Typically, you configure this variable in your
+ <filename>local.conf</filename> file, which is found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ Although you can use this variable from within a recipe,
+ best practices dictate that you do not.
+ <note>
+ To enable primary features from within the image
+ recipe, use the
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ Here are some examples of features you can add:
+ <literallayout class='monospaced'>
+"dbg-pkgs" - Adds -dbg packages for all installed packages
+ including symbol information for debugging and
+ profiling.
+
+"debug-tweaks" - Makes an image suitable for debugging.
+ For example, allows root logins without
+ passwords and enables post-installation
+ logging. See the 'allow-empty-password'
+ and 'post-install-logging' features in
+ the "<link linkend='ref-features-image'>Image Features</link>" section for
+ more information.
+
+"dev-pkgs" - Adds -dev packages for all installed packages.
+ This is useful if you want to develop against
+ the libraries in the image.
+
+"read-only-rootfs" - Creates an image whose root
+ filesystem is read-only. See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-a-read-only-root-filesystem'>Creating a Read-Only Root Filesystem</ulink>"
+ section in the Yocto Project
+ Development Tasks Manual for
+ more information
+
+"tools-debug" - Adds debugging tools such as gdb and
+ strace.
+
+"tools-sdk" - Adds development tools such as gcc, make,
+ pkgconfig and so forth.
+
+"tools-testapps" - Adds useful testing tools such as
+ ts_print, aplay, arecord and so
+ forth.
+
+ </literallayout>
+ </para>
+
+ <para>
+ For a complete list of image features that ships with the
+ Yocto Project, see the
+ "<link linkend="ref-features-image">Image Features</link>"
+ section.
+ </para>
+
+ <para>
+ For an example that shows how to customize your image by
+ using this variable, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_IMAGECMD'><glossterm>EXTRA_IMAGECMD</glossterm>
+ <info>
+ EXTRA_IMAGECMD[doc] = "Specifies additional options for the image creation command that has been specified in IMAGE_CMD. When setting this variable, you should use an override for the associated image type."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies additional options for the image
+ creation command that has been specified in
+ <link linkend='var-IMAGE_CMD'><filename>IMAGE_CMD</filename></link>.
+ When setting this variable, use an override for the
+ associated image type.
+ Here is an example:
+ <literallayout class='monospaced'>
+ EXTRA_IMAGECMD_ext3 ?= "-i 4096"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_IMAGEDEPENDS'><glossterm>EXTRA_IMAGEDEPENDS</glossterm>
+ <info>
+ EXTRA_IMAGEDEPENDS[doc] = "A list of recipes to build that do not provide packages for installing into the root filesystem. Use this variable to list recipes that are required to build the final image, but not needed in the root filesystem."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recipes to build that do not provide packages
+ for installing into the root filesystem.
+ </para>
+
+ <para>
+ Sometimes a recipe is required to build the final image but is not
+ needed in the root filesystem.
+ You can use the <filename>EXTRA_IMAGEDEPENDS</filename> variable to
+ list these recipes and thus specify the dependencies.
+ A typical example is a required bootloader in a machine configuration.
+ </para>
+
+ <note>
+ To add packages to the root filesystem, see the various
+ <filename>*<link linkend='var-RDEPENDS'>RDEPENDS</link></filename>
+ and <filename>*<link linkend='var-RRECOMMENDS'>RRECOMMENDS</link></filename>
+ variables.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRANATIVEPATH'><glossterm>EXTRANATIVEPATH</glossterm>
+ <info>
+ EXTRANATIVEPATH[doc] = "A list of subdirectories of ${STAGING_BINDIR_NATIVE} added to the beginning of the environment variable PATH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of subdirectories of
+ <filename>${</filename><link linkend='var-STAGING_BINDIR_NATIVE'><filename>STAGING_BINDIR_NATIVE</filename></link><filename>}</filename>
+ added to the beginning of the environment variable
+ <filename>PATH</filename>.
+ As an example, the following prepends
+ "${STAGING_BINDIR_NATIVE}/foo:${STAGING_BINDIR_NATIVE}/bar:"
+ to <filename>PATH</filename>:
+ <literallayout class='monospaced'>
+ EXTRANATIVEPATH = "foo bar"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_OECMAKE'><glossterm>EXTRA_OECMAKE</glossterm>
+ <info>
+ EXTRA_OECMAKE[doc] = "Additional cmake options."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Additional <filename>cmake</filename> options.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_OECONF'><glossterm>EXTRA_OECONF</glossterm>
+ <info>
+ EXTRA_OECONF[doc] = "Additional configure script options."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Additional <filename>configure</filename> script options.
+ See
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>
+ for additional information on passing configure script
+ options.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_OEMAKE'><glossterm>EXTRA_OEMAKE</glossterm>
+ <info>
+ EXTRA_OEMAKE[doc] = "Additional GNU make options."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Additional GNU <filename>make</filename> options.
+ </para>
+
+ <para>
+ Because the <filename>EXTRA_OEMAKE</filename> defaults to
+ "", you need to set the variable to specify any required
+ GNU options.
+ </para>
+
+ <para>
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>
+ and
+ <link linkend='var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></link>
+ also make use of
+ <filename>EXTRA_OEMAKE</filename> to pass the required
+ flags.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_OESCONS'><glossterm>EXTRA_OESCONS</glossterm>
+ <info>
+ EXTRA_OESCONS[doc] = "When a recipe inherits the scons class, this variable specifies additional configuration options you want to pass to the scons command line."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-scons'><filename>scons</filename></link>
+ class, this variable specifies additional configuration
+ options you want to pass to the
+ <filename>scons</filename> command line.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-EXTRA_USERS_PARAMS'><glossterm>EXTRA_USERS_PARAMS</glossterm>
+ <info>
+ EXTRA_USERS_PARAMS[doc] = "When a recipe inherits the extrausers class, this variable provides image level user and group operations."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-extrausers'><filename>extrausers</filename></link>
+ class, this variable provides image level user and group
+ operations.
+ This is a more global method of providing user and group
+ configuration as compared to using the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class, which ties user and group configurations to a
+ specific recipe.
+ </para>
+
+ <para>
+ The set list of commands you can configure using the
+ <filename>EXTRA_USERS_PARAMS</filename> is shown in the
+ <filename>extrausers</filename> class.
+ These commands map to the normal Unix commands of the same
+ names:
+ <literallayout class='monospaced'>
+ # EXTRA_USERS_PARAMS = "\
+ # useradd -p '' tester; \
+ # groupadd developers; \
+ # userdel nobody; \
+ # groupdel -g video; \
+ # groupmod -g 1020 developers; \
+ # usermod -s /bin/sh tester; \
+ # "
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-f'><title>F</title>
+
+ <glossentry id='var-FEATURE_PACKAGES'><glossterm>FEATURE_PACKAGES</glossterm>
+ <info>
+ FEATURE_PACKAGES[doc] = "Defines one or more packages to include in an image when a specific item is included in IMAGE_FEATURES. When setting the value, FEATURE_PACKAGES should have the name of the feature item as an override."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines one or more packages to include in an image when
+ a specific item is included in
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
+ When setting the value, <filename>FEATURE_PACKAGES</filename>
+ should have the name of the feature item as an override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ FEATURE_PACKAGES_widget = "<replaceable>package1</replaceable> <replaceable>package2</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ In this example, if "widget" were added to
+ <filename>IMAGE_FEATURES</filename>, <replaceable>package1</replaceable> and
+ <replaceable>package2</replaceable> would be included in the image.
+ <note>
+ Packages installed by features defined through
+ <filename>FEATURE_PACKAGES</filename> are often package
+ groups.
+ While similarly named, you should not confuse the
+ <filename>FEATURE_PACKAGES</filename> variable with
+ package groups, which are discussed elsewhere in the
+ documentation.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FEED_DEPLOYDIR_BASE_URI'><glossterm>FEED_DEPLOYDIR_BASE_URI</glossterm>
+ <info>
+ FEED_DEPLOYDIR_BASE_URI[doc] = "Allow to serve ipk deploy directory as an ad hoc feed (bogofeed). Set to base URL of the directory as exported by HTTP. Set of ad hoc feed configs will be generated in the image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the base URL of the server and location within
+ the document-root that provides the metadata and
+ packages required by OPKG to support runtime package
+ management of IPK packages.
+ You set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ Consider the following example:
+ <literallayout class='monospaced'>
+ FEED_DEPLOYDIR_BASE_URI = "http://192.168.7.1/BOARD-dir"
+ </literallayout>
+ This example assumes you are serving your packages over
+ HTTP and your databases are located in a directory
+ named <filename>BOARD-dir</filename>, which is underneath
+ your HTTP server's document-root.
+ In this case, the OpenEmbedded build system generates a set
+ of configuration files for you in your target that work
+ with the feed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILES'><glossterm>FILES</glossterm>
+ <info>
+ FILES[doc] = "The list of directories or files that are placed in a package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of files and directories that are placed in a
+ package.
+ The
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ variable lists the packages generated by a recipe.
+ </para>
+
+ <para>
+ To use the <filename>FILES</filename> variable, provide a
+ package name override that identifies the resulting package.
+ Then, provide a space-separated list of files or paths
+ that identify the files you want included as part of the
+ resulting package.
+ Here is an example:
+ <literallayout class='monospaced'>
+ FILES_${PN} += "${bindir}/mydir1 ${bindir}/mydir2/myfile"
+ </literallayout>
+ </para>
+
+ <note>
+ When specifying paths as part of the
+ <filename>FILES</filename> variable, it is good practice
+ to use appropriate path variables.
+ For example, use <filename>${sysconfdir}</filename> rather
+ than <filename>/etc</filename>, or
+ <filename>${bindir}</filename> rather than
+ <filename>/usr/bin</filename>.
+ You can find a list of these variables at the top of the
+ <filename>meta/conf/bitbake.conf</filename> file in the
+ <link linkend='source-directory'>Source Directory</link>.
+ You will also find the default values of the various
+ <filename>FILES_*</filename> variables in this file.
+ </note>
+
+ <para>
+ If some of the files you provide with the
+ <filename>FILES</filename> variable are editable and you
+ know they should not be overwritten during the package
+ update process by the Package Management System (PMS), you
+ can identify these files so that the PMS will not
+ overwrite them.
+ See the
+ <link linkend='var-CONFFILES'><filename>CONFFILES</filename></link>
+ variable for information on how to identify these files to
+ the PMS.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILES_SOLIBSDEV'><glossterm>FILES_SOLIBSDEV</glossterm>
+ <info>
+ FILES_SOLIBSDEV[doc] = "Defines the full path name of the development symbolic link (symlink) for shared libraries on the target platform."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the file specification to match
+ <link linkend='var-SOLIBSDEV'><filename>SOLIBSDEV</filename></link>.
+ In other words, <filename>FILES_SOLIBSDEV</filename>
+ defines the full path name of the development symbolic link
+ (symlink) for shared libraries on the target platform.
+ </para>
+
+ <para>
+ The following statement from the
+ <filename>bitbake.conf</filename> shows how it is set:
+ <literallayout class='monospaced'>
+ FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILESEXTRAPATHS'><glossterm>FILESEXTRAPATHS</glossterm>
+ <info>
+ FILESEXTRAPATHS[doc] = "Extends the search path the OpenEmbedded build system uses when looking for files and patches as it processes recipes and append files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extends the search path the OpenEmbedded build system uses
+ when looking for files and patches as it processes recipes
+ and append files.
+ The default directories BitBake uses when it processes
+ recipes are initially defined by the
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ variable.
+ You can extend <filename>FILESPATH</filename> variable
+ by using <filename>FILESEXTRAPATHS</filename>.
+ </para>
+
+ <para>
+ Best practices dictate that you accomplish this by using
+ <filename>FILESEXTRAPATHS</filename> from within a
+ <filename>.bbappend</filename> file and that you prepend
+ paths as follows:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ </literallayout>
+ In the above example, the build system first looks for files
+ in a directory that has the same name as the corresponding
+ append file.
+ <note>
+ <para>When extending
+ <filename>FILESEXTRAPATHS</filename>,
+ be sure to use the immediate expansion
+ (<filename>:=</filename>) operator.
+ Immediate expansion makes sure that BitBake evaluates
+ <link linkend='var-THISDIR'><filename>THISDIR</filename></link>
+ at the time the directive is encountered rather than at
+ some later time when expansion might result in a
+ directory that does not contain the files you need.
+ </para>
+
+ <para>Also, include the trailing separating colon
+ character if you are prepending.
+ The trailing colon character is necessary because you
+ are directing BitBake to extend the path by prepending
+ directories to the search path.</para>
+ </note>
+ Here is another common use:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+ </literallayout>
+ In this example, the build system extends the
+ <filename>FILESPATH</filename> variable to include a
+ directory named <filename>files</filename> that is in the
+ same directory as the corresponding append file.
+ </para>
+
+ <para>
+ This next example specifically adds three paths:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend := "path_1:path_2:path_3:"
+ </literallayout>
+ </para>
+
+ <para>
+ A final example shows how you can extend the search path
+ and include a
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>-specific
+ override, which is useful in a BSP layer:
+ <literallayout class='monospaced'>
+ FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/${PN}:"
+ </literallayout>
+ The previous statement appears in the
+ <filename>linux-yocto-dev.bbappend</filename> file, which
+ is found in the Yocto Project
+ <ulink url='&YOCTO_DOCS_OM_URL;#source-repositories'>Source Repositories</ulink>
+ in
+ <filename>meta-intel/common/recipes-kernel/linux</filename>.
+ Here, the machine override is a special
+ <link linkend='var-PACKAGE_ARCH'><filename>PACKAGE_ARCH</filename></link>
+ definition for multiple <filename>meta-intel</filename>
+ machines.
+ <note>
+ For a layer that supports a single BSP, the override
+ could just be the value of <filename>MACHINE</filename>.
+ </note>
+ </para>
+
+ <para>
+ By prepending paths in <filename>.bbappend</filename>
+ files, you allow multiple append files that reside in
+ different layers but are used for the same recipe to
+ correctly extend the path.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILESOVERRIDES'><glossterm>FILESOVERRIDES</glossterm>
+ <info>
+ FILESOVERRIDES[doc] = "A subset of OVERRIDES used by the OpenEmbedded build system for creating FILESPATH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A subset of <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ used by the OpenEmbedded build system for creating
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>.
+ You can find more information on how overrides are handled
+ in the
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
+ </para>
+
+ <para>
+ By default, the <filename>FILESOVERRIDES</filename>
+ variable is defined as:
+ <literallayout class='monospaced'>
+ FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
+ </literallayout>
+
+ <note>
+ Do not hand-edit the <filename>FILESOVERRIDES</filename>
+ variable.
+ The values match up with expected overrides and are
+ used in an expected manner by the build system.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILESPATH'><glossterm>FILESPATH</glossterm>
+ <info>
+ FILESPATH[doc] = "The default set of directories the OpenEmbedded build system uses when searching for patches and files. It is defined in the base.bbclass class found in meta/classes in the Source Directory. Do not hand-edit the FILESPATH variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The default set of directories the OpenEmbedded build system
+ uses when searching for patches and files.
+ During the build process, BitBake searches each directory in
+ <filename>FILESPATH</filename> in the specified order when
+ looking for files and patches specified by each
+ <filename>file://</filename> URI in a recipe's
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>
+ statements.
+ </para>
+
+ <para>
+ The default value for the <filename>FILESPATH</filename>
+ variable is defined in the <filename>base.bbclass</filename>
+ class found in <filename>meta/classes</filename> in the
+ <link linkend='source-directory'>Source Directory</link>:
+ <literallayout class='monospaced'>
+ FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", \
+ "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
+ </literallayout>
+ <note>
+ Do not hand-edit the <filename>FILESPATH</filename>
+ variable.
+ If you want the build system to look in directories
+ other than the defaults, extend the
+ <filename>FILESPATH</filename> variable by using the
+ <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link>
+ variable.
+ </note>
+ Be aware that the default <filename>FILESPATH</filename>
+ directories do not map to directories in custom layers
+ where append files (<filename>.bbappend</filename>)
+ are used.
+ If you want the build system to find patches or files
+ that reside with your append files, you need to extend
+ the <filename>FILESPATH</filename> variable by using
+ the <filename>FILESEXTRAPATHS</filename> variable.
+ </para>
+
+ <para>
+ You can find out more about the patching process in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>Patching</ulink>"
+ section in the Yocto Project Overview and Concepts Manual
+ and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-patching-code'>Patching Code</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ See the
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ task as well.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FILESYSTEM_PERMS_TABLES'><glossterm>FILESYSTEM_PERMS_TABLES</glossterm>
+ <info>
+ FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Allows you to define your own file permissions settings table as part of
+ your configuration for the packaging process.
+ For example, suppose you need a consistent set of custom permissions for
+ a set of groups and users across an entire work project.
+ It is best to do this in the packages themselves but this is not always
+ possible.
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system uses the <filename>fs-perms.txt</filename>, which
+ is located in the <filename>meta/files</filename> folder in the
+ <link linkend='source-directory'>Source Directory</link>.
+ If you create your own file permissions setting table, you should place it in your
+ layer or the distro's layer.
+ </para>
+
+ <para>
+ You define the <filename>FILESYSTEM_PERMS_TABLES</filename> variable in the
+ <filename>conf/local.conf</filename> file, which is found in the
+ <link linkend='build-directory'>Build Directory</link>, to
+ point to your custom <filename>fs-perms.txt</filename>.
+ You can specify more than a single file permissions setting table.
+ The paths you specify to these files must be defined within the
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link> variable.
+ </para>
+
+ <para>
+ For guidance on how to create your own file permissions settings table file,
+ examine the existing <filename>fs-perms.txt</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FONT_EXTRA_RDEPENDS'><glossterm>FONT_EXTRA_RDEPENDS</glossterm>
+ <info>
+ FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-fontcache'><filename>fontcache</filename></link>
+ class, this variable specifies the runtime dependencies
+ for font packages.
+ By default, the <filename>FONT_EXTRA_RDEPENDS</filename>
+ is set to "fontconfig-utils".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FONT_PACKAGES'><glossterm>FONT_PACKAGES</glossterm>
+ <info>
+ FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-fontcache'><filename>fontcache</filename></link>
+ class, this variable identifies packages containing font
+ files that need to be cached by Fontconfig.
+ By default, the <filename>fontcache</filename> class assumes
+ that fonts are in the recipe's main package
+ (i.e. <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>).
+ Use this variable if fonts you need are in a package
+ other than that main package.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FORCE_RO_REMOVE'><glossterm>FORCE_RO_REMOVE</glossterm>
+ <info>
+ FORCE_RO_REMOVE[doc] = "Forces the removal of the packages listed in ROOTFS_RO_UNNEEDED during the generation of the root filesystem."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Forces the removal of the packages listed in
+ <filename>ROOTFS_RO_UNNEEDED</filename> during the
+ generation of the root filesystem.
+ </para>
+
+ <para>
+ Set the variable to "1" to force the removal of these
+ packages.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-FULL_OPTIMIZATION'><glossterm>FULL_OPTIMIZATION</glossterm>
+ <info>
+ FULL_OPTIMIZATION[doc]= "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The options to pass in
+ <filename><link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link></filename>
+ and <filename><link linkend='var-CFLAGS'>CFLAGS</link></filename>
+ when compiling an optimized system.
+ This variable defaults to
+ "-O2 -pipe ${DEBUG_FLAGS}".
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-g'><title>G</title>
+
+ <glossentry id='var-GCCPIE'><glossterm>GCCPIE</glossterm>
+ <info>
+ GCCPIE[doc] = "Enables Position Independent Executables (PIE) within the GNU C Compiler (GCC)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Enables Position Independent Executables (PIE) within the
+ GNU C Compiler (GCC).
+ Enabling PIE in the GCC makes Return Oriented Programming
+ (ROP) attacks much more difficult to
+ execute.
+ </para>
+
+ <para>
+ By default the <filename>security_flags.inc</filename>
+ file enables PIE by setting the variable as follows:
+ <literallayout class='monospaced'>
+ GCCPIE ?= "--enable-default-pie"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GDB'><glossterm>GDB</glossterm>
+ <info>
+ GDB[doc] = "The minimal command and arguments to run the GNU Debugger."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run the GNU Debugger.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GITDIR'><glossterm>GITDIR</glossterm>
+ <info>
+ GITDIR[doc] = "The directory where Git clones will be stored."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory in which a local copy of a Git repository
+ is stored when it is cloned.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GLIBC_GENERATE_LOCALES'><glossterm>GLIBC_GENERATE_LOCALES</glossterm>
+ <info>
+ GLIBC_GENERATE_LOCALES[doc]= "Specifies the list of GLIBC locales to generate should you not wish to generate all LIBC locals, which can be time consuming."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the list of GLIBC locales to generate should you
+ not wish to generate all LIBC locals, which can be time
+ consuming.
+ <note>
+ If you specifically remove the locale
+ <filename>en_US.UTF-8</filename>, you must set
+ <link linkend='var-IMAGE_LINGUAS'><filename>IMAGE_LINGUAS</filename></link>
+ appropriately.
+ </note>
+ </para>
+
+ <para>
+ You can set <filename>GLIBC_GENERATE_LOCALES</filename>
+ in your <filename>local.conf</filename> file.
+ By default, all locales are generated.
+ <literallayout class='monospaced'>
+ GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 en_US.UTF-8"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GROUPADD_PARAM'><glossterm>GROUPADD_PARAM</glossterm>
+ <info>
+ GROUPADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupadd command if you wish to add a group to the system when the package is installed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class, this variable
+ specifies for a package what parameters should be passed
+ to the <filename>groupadd</filename> command
+ if you wish to add a group to the system when the package
+ is installed.
+ </para>
+
+ <para>
+ Here is an example from the <filename>dbus</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ GROUPADD_PARAM_${PN} = "-r netdev"
+ </literallayout>
+ For information on the standard Linux shell command
+ <filename>groupadd</filename>, see
+ <ulink url='http://linux.die.net/man/8/groupadd'></ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GROUPMEMS_PARAM'><glossterm>GROUPMEMS_PARAM</glossterm>
+ <info>
+ GROUPMEMS_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupmems command if you wish to modify the members of a group when the package is installed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class, this variable
+ specifies for a package what parameters should be passed
+ to the <filename>groupmems</filename> command
+ if you wish to modify the members of a group when the
+ package is installed.
+ </para>
+
+ <para>
+ For information on the standard Linux shell command
+ <filename>groupmems</filename>, see
+ <ulink url='http://linux.die.net/man/8/groupmems'></ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GRUB_GFXSERIAL'><glossterm>GRUB_GFXSERIAL</glossterm>
+ <info>
+ GRUB_GFXSERIAL[doc] = "Configures the GNU GRand Unified Bootloader (GRUB) to have graphics and serial in the boot menu."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Configures the GNU GRand Unified Bootloader (GRUB) to have
+ graphics and serial in the boot menu.
+ Set this variable to "1" in your
+ <filename>local.conf</filename> or distribution
+ configuration file to enable graphics and serial
+ in the menu.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link>
+ class for more information on how this variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GRUB_OPTS'><glossterm>GRUB_OPTS</glossterm>
+ <info>
+ GRUB_OPTS[doc] = "Additional options to add to the GNU GRand Unified Bootloader (GRUB) configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Additional options to add to the GNU GRand Unified
+ Bootloader (GRUB) configuration.
+ Use a semi-colon character (<filename>;</filename>) to
+ separate multiple options.
+ </para>
+
+ <para>
+ The <filename>GRUB_OPTS</filename> variable is optional.
+ See the
+ <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link>
+ class for more information on how this variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GRUB_TIMEOUT'><glossterm>GRUB_TIMEOUT</glossterm>
+ <info>
+ GRUB_TIMEOUT[doc] = "Specifies the timeout before executing the default LABEL in the GNU GRand Unified Bootloader (GRUB)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the timeout before executing the default
+ <filename>LABEL</filename> in the GNU GRand Unified
+ Bootloader (GRUB).
+ </para>
+
+ <para>
+ The <filename>GRUB_TIMEOUT</filename> variable is optional.
+ See the
+ <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link>
+ class for more information on how this variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-GTKIMMODULES_PACKAGES'><glossterm>GTKIMMODULES_PACKAGES</glossterm>
+ <info>
+ GTKIMMODULES_PACKAGES[doc] = "For recipes that inherit the gtk-immodules-cache class, this variable specifies the packages that contain the GTK+ input method modules being installed when the modules are in packages other than the main package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-gtk-immodules-cache'><filename>gtk-immodules-cache</filename></link>
+ class, this variable specifies the packages that contain the
+ GTK+ input method modules being installed when the modules
+ are in packages other than the main package.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-h'><title>H</title>
+
+ <glossentry id='var-HOMEPAGE'><glossterm>HOMEPAGE</glossterm>
+ <info>
+ HOMEPAGE[doc] = "Website where more information about the software the recipe is building can be found."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Website where more information about the software the recipe is building
+ can be found.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_ARCH'><glossterm>HOST_ARCH</glossterm>
+ <info>
+ HOST_ARCH[doc] = "The name of the target architecture. Normally same as the TARGET_ARCH."
+
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The name of the target architecture, which is normally
+ the same as
+ <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>.
+ The OpenEmbedded build system supports many
+ architectures.
+ Here is an example list of architectures supported.
+ This list is by no means complete as the architecture
+ is configurable:
+ <literallayout class='monospaced'>
+ arm
+ i586
+ x86_64
+ powerpc
+ powerpc64
+ mips
+ mipsel
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_CC_ARCH'><glossterm>HOST_CC_ARCH</glossterm>
+ <info>
+ HOST_CC_ARCH[doc] = "The name of the host architecture. Normally same as the TARGET_CC_ARCH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific compiler flags that are
+ passed to the C compiler.
+ </para>
+
+ <para>
+ Default initialization for <filename>HOST_CC_ARCH</filename>
+ varies depending on what is being built:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-TARGET_CC_ARCH'><filename>TARGET_CC_ARCH</filename></link>
+ when building for the target
+ </para></listitem>
+ <listitem><para>
+ <filename>BUILD_CC_ARCH</filename>
+ when building for the build host (i.e.
+ <filename>-native</filename>)
+ </para></listitem>
+ <listitem><para>
+ <filename>BUILDSDK_CC_ARCH</filename>
+ when building for an SDK (i.e.
+ <filename>nativesdk-</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_OS'><glossterm>HOST_OS</glossterm>
+ <info>
+ HOST_OS[doc] = "The name of the target operating system. Normally the same as the TARGET_OS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the target operating system, which
+ is normally the same as the
+ <link linkend='var-TARGET_OS'><filename>TARGET_OS</filename></link>.
+ The variable can be set to "linux" for <filename>glibc</filename>-based systems and
+ to "linux-musl" for <filename>musl</filename>.
+ For ARM/EABI targets, there are also "linux-gnueabi" and
+ "linux-musleabi" values possible.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_PREFIX'><glossterm>HOST_PREFIX</glossterm>
+ <info>
+ HOST_PREFIX[doc] = "The prefix for the cross compile toolchain. Normally same as the TARGET_PREFIX."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the prefix for the cross-compile toolchain.
+ <filename>HOST_PREFIX</filename> is normally the same as
+ <link linkend='var-TARGET_PREFIX'><filename>TARGET_PREFIX</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_SYS'><glossterm>HOST_SYS</glossterm>
+ <info>
+ HOST_SYS[doc] = "Specifies the system, including the architecture and the operating system, for which the build is occurring in the context of the current recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the system, including the architecture and the
+ operating system, for which the build is occurring
+ in the context of the current recipe.
+ </para>
+
+ <para>
+ The OpenEmbedded build system automatically sets this
+ variable based on
+ <link linkend='var-HOST_ARCH'><filename>HOST_ARCH</filename></link>,
+ <link linkend='var-HOST_VENDOR'><filename>HOST_VENDOR</filename></link>,
+ and
+ <link linkend='var-HOST_OS'><filename>HOST_OS</filename></link>
+ variables.
+ <note>
+ You do not need to set the variable yourself.
+ </note>
+ </para>
+
+ <para>
+ Consider these two examples:
+ <itemizedlist>
+ <listitem><para>Given a native recipe on a 32-bit
+ x86 machine running Linux, the value is
+ "i686-linux".
+ </para></listitem>
+ <listitem><para>Given a recipe being built for a
+ little-endian MIPS target running Linux,
+ the value might be "mipsel-linux".
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOSTTOOLS'><glossterm>HOSTTOOLS</glossterm>
+ <info>
+ HOSTTOOLS[doc] = "A space-separated list (filter) of tools on the build host that should be allowed to be called from within build tasks."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list (filter) of tools on the build host
+ that should be allowed to be called from within build tasks.
+ Using this filter helps reduce the possibility of host
+ contamination.
+ If a tool specified in the value of
+ <filename>HOSTTOOLS</filename> is not found on the
+ build host, the OpenEmbedded build system produces
+ an error and the build is not started.
+ </para>
+
+ <para>
+ For additional information, see
+ <link linkend='var-HOSTTOOLS_NONFATAL'><filename>HOSTTOOLS_NONFATAL</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOSTTOOLS_NONFATAL'><glossterm>HOSTTOOLS_NONFATAL</glossterm>
+ <info>
+ HOSTTOOLS_NONFATAL[doc] = "A space-separated list (filter) of tools on the build host that should be allowed to be called from within build tasks."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list (filter) of tools on the build host
+ that should be allowed to be called from within build tasks.
+ Using this filter helps reduce the possibility of host
+ contamination.
+ Unlike
+ <link linkend='var-HOSTTOOLS'><filename>HOSTTOOLS</filename></link>,
+ the OpenEmbedded build system does not produce an error
+ if a tool specified in the value of
+ <filename>HOSTTOOLS_NONFATAL</filename> is not found on the
+ build host.
+ Thus, you can use <filename>HOSTTOOLS_NONFATAL</filename>
+ to filter optional host tools.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-HOST_VENDOR'><glossterm>HOST_VENDOR</glossterm>
+ <info>
+ HOST_VENDOR[doc] = "The name of the vendor. Normally same as the TARGET_VENDOR."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the vendor.
+ <filename>HOST_VENDOR</filename> is normally the same as
+ <link linkend='var-TARGET_VENDOR'><filename>TARGET_VENDOR</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-i'><title>I</title>
+
+ <glossentry id='var-ICECC_DISABLED'><glossterm>ICECC_DISABLED</glossterm>
+ <info>
+ ICECC_DISABLED[doc] = "Disables or enables the icecc (Icecream) function."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Disables or enables the <filename>icecc</filename>
+ (Icecream) function.
+ For more information on this function and best practices
+ for using this variable, see the
+ "<link linkend='ref-classes-icecc'><filename>icecc.bbclass</filename></link>"
+ section.
+ </para>
+
+ <para>
+ Setting this variable to "1" in your
+ <filename>local.conf</filename> disables the function:
+ <literallayout class='monospaced'>
+ ICECC_DISABLED ??= "1"
+ </literallayout>
+ To enable the function, set the variable as follows:
+ <literallayout class='monospaced'>
+ ICECC_DISABLED = ""
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_ENV_EXEC'><glossterm>ICECC_ENV_EXEC</glossterm>
+ <info>
+ ICECC_ENV_EXEC[doc] = "Points to the icecc-create-env script that you provide."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the <filename>icecc-create-env</filename> script
+ that you provide.
+ This variable is used by the
+ <link linkend='ref-classes-icecc'><filename>icecc</filename></link>
+ class.
+ You set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ If you do not point to a script that you provide, the
+ OpenEmbedded build system uses the default script provided
+ by the <filename>icecc-create-env.bb</filename> recipe,
+ which is a modified version and not the one that comes with
+ <filename>icecc</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_PARALLEL_MAKE'><glossterm>ICECC_PARALLEL_MAKE</glossterm>
+ <info>
+ ICECC_PARALLEL_MAKE[doc] = "Extra options passed to the make command during the do_compile task that specify parallel compilation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extra options passed to the <filename>make</filename>
+ command during the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ task that specify parallel compilation.
+ This variable usually takes the form of
+ "-j <replaceable>x</replaceable>", where
+ <replaceable>x</replaceable> represents the maximum
+ number of parallel threads <filename>make</filename> can
+ run.
+ <note>
+ The options passed affect builds on all enabled
+ machines on the network, which are machines running the
+ <filename>iceccd</filename> daemon.
+ </note>
+ </para>
+
+ <para>
+ If your enabled machines support multiple cores,
+ coming up with the maximum number of parallel threads
+ that gives you the best performance could take some
+ experimentation since machine speed, network lag,
+ available memory, and existing machine loads can all
+ affect build time.
+ Consequently, unlike the
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>
+ variable, there is no rule-of-thumb for setting
+ <filename>ICECC_PARALLEL_MAKE</filename> to achieve
+ optimal performance.
+ </para>
+
+ <para>
+ If you do not set <filename>ICECC_PARALLEL_MAKE</filename>,
+ the build system does not use it (i.e. the system does
+ not detect and assign the number of cores as is done with
+ <filename>PARALLEL_MAKE</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_PATH'><glossterm>ICECC_PATH</glossterm>
+ <info>
+ ICECC_PATH[doc] = "The location of the icecc binary."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location of the <filename>icecc</filename> binary.
+ You can set this variable in your
+ <filename>local.conf</filename> file.
+ If your <filename>local.conf</filename> file does not define
+ this variable, the
+ <link linkend='ref-classes-icecc'><filename>icecc</filename></link>
+ class attempts to define it by locating
+ <filename>icecc</filename> using <filename>which</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_USER_CLASS_BL'><glossterm>ICECC_USER_CLASS_BL</glossterm>
+ <info>
+ ICECC_USER_CLASS_BL[doc] = "Identifies user classes that you do not want the Icecream distributed compile support to consider."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Identifies user classes that you do not want the
+ Icecream distributed compile support to consider.
+ This variable is used by the
+ <link linkend='ref-classes-icecc'><filename>icecc</filename></link>
+ class.
+ You set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ When you list classes using this variable, you are
+ "blacklisting" them from distributed compilation across
+ remote hosts.
+ Any classes you list will be distributed and compiled
+ locally.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_USER_PACKAGE_BL'><glossterm>ICECC_USER_PACKAGE_BL</glossterm>
+ <info>
+ ICECC_USER_PACKAGE_BL[doc] = "Identifies user recipes that you do not want the Icecream distributed compile support to consider."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Identifies user recipes that you do not want the
+ Icecream distributed compile support to consider.
+ This variable is used by the
+ <link linkend='ref-classes-icecc'><filename>icecc</filename></link>
+ class.
+ You set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ When you list packages using this variable, you are
+ "blacklisting" them from distributed compilation across
+ remote hosts.
+ Any packages you list will be distributed and compiled
+ locally.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ICECC_USER_PACKAGE_WL'><glossterm>ICECC_USER_PACKAGE_WL</glossterm>
+ <info>
+ ICECC_USER_PACKAGE_WL[doc] = "Identifies user recipes that use an empty PARALLEL_MAKE variable that you want to force remote distributed compilation on using the Icecream distributed compile support."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Identifies user recipes that use an empty
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>
+ variable that you want to force remote distributed
+ compilation on using the Icecream distributed compile
+ support.
+ This variable is used by the
+ <link linkend='ref-classes-icecc'><filename>icecc</filename></link>
+ class.
+ You set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_BASENAME'><glossterm>IMAGE_BASENAME</glossterm>
+ <info>
+ IMAGE_BASENAME[doc] = "The base name of image output files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The base name of image output files.
+ This variable defaults to the recipe name
+ (<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_BOOT_FILES'><glossterm>IMAGE_BOOT_FILES</glossterm>
+ <info>
+ IMAGE_BOOT_FILES[doc] = "A space-separated list of files from ${DEPLOY_DIR_IMAGE} to place in boot partition."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list of files installed into the
+ boot partition when preparing an image using the Wic tool
+ with the <filename>bootimg-partition</filename> source
+ plugin.
+ By default, the files are installed under the same name as
+ the source files.
+ To change the installed name, separate it from the
+ original name with a semi-colon (;).
+ Source files need to be located in
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>.
+ Here are two examples:
+
+ <literallayout class="monospaced">
+ IMAGE_BOOT_FILES = "u-boot.img uImage;kernel"
+ IMAGE_BOOT_FILES = "u-boot.${UBOOT_SUFFIX} ${KERNEL_IMAGETYPE}"
+ </literallayout>
+ </para>
+
+ <para>
+ Alternatively, source files can be picked up using
+ a glob pattern.
+ In this case, the destination file must have the same name
+ as the base name of the source file path.
+ To install files into a directory within the
+ target location, pass its name after a semi-colon
+ (;).
+ Here are two examples:
+ <literallayout class="monospaced">
+ IMAGE_BOOT_FILES = "bcm2835-bootfiles/*"
+ IMAGE_BOOT_FILES = "bcm2835-bootfiles/*;boot/"
+ </literallayout>
+ The first example installs all files from
+ <filename>${DEPLOY_DIR_IMAGE}/bcm2835-bootfiles</filename>
+ into the root of the target partition.
+ The second example installs the same files into a
+ <filename>boot</filename> directory within the
+ target partition.
+ </para>
+
+ <para>
+ You can find information on how to use the Wic tool in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-partitioned-images-using-wic'>Creating Partitioned Images Using Wic</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ Reference material for Wic is located in the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-kickstart'>OpenEmbedded Kickstart (.wks) Reference</ulink>"
+ chapter.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_CLASSES'><glossterm>IMAGE_CLASSES</glossterm>
+ <info>
+ IMAGE_CLASSES[doc] = "A list of classes that all images should inherit."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ 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.
+ </para>
+
+ <para>
+ The default value for <filename>IMAGE_CLASSES</filename> is
+ <filename>image_types</filename>.
+ You can set this variable in your
+ <filename>local.conf</filename> or in a distribution
+ configuration file.
+ </para>
+
+ <para>
+ For more information, see
+ <filename>meta/classes/image_types.bbclass</filename> in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_CMD'><glossterm>IMAGE_CMD</glossterm>
+ <info>
+ IMAGE_CMD[doc] = "Specifies the command to create the image file for a specific image type, which corresponds to the value set set in IMAGE_FSTYPES, (e.g. ext3, btrfs, and so forth)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the command to create the image file for a
+ specific image type, which corresponds to the value set
+ set in
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>,
+ (e.g. <filename>ext3</filename>,
+ <filename>btrfs</filename>, and so forth).
+ When setting this variable, you should use
+ an override for the associated type.
+ Here is an example:
+ <literallayout class='monospaced'>
+ IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} \
+ --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
+ ${EXTRA_IMAGECMD}"
+ </literallayout>
+ </para>
+
+ <para>
+ You typically do not need to set this variable unless
+ you are adding support for a new image type.
+ For more examples on how to set this variable, see the
+ <link linkend='ref-classes-image_types'><filename>image_types</filename></link>
+ class file, which is
+ <filename>meta/classes/image_types.bbclass</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_DEVICE_TABLES'><glossterm>IMAGE_DEVICE_TABLES</glossterm>
+ <info>
+ IMAGE_DEVICE_TABLES[doc] = "Specifies one or more files that contain custom device tables that are passed to the makedevs command as part of creating an image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies one or more files that contain custom device
+ tables that are passed to the
+ <filename>makedevs</filename> command as part of creating
+ an image.
+ These files list basic device nodes that should be
+ created under <filename>/dev</filename> within the image.
+ If <filename>IMAGE_DEVICE_TABLES</filename> is not set,
+ <filename>files/device_table-minimal.txt</filename> is
+ used, which is located by
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>.
+ For details on how you should write device table files,
+ see <filename>meta/files/device_table-minimal.txt</filename>
+ as an example.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_FEATURES'><glossterm>IMAGE_FEATURES</glossterm>
+ <info>
+ IMAGE_FEATURES[doc] = "The primary list of features to include in an image. Configure this variable in an image recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The primary list of features to include in an image.
+ Typically, you configure this variable in an image recipe.
+ Although you can use this variable from your
+ <filename>local.conf</filename> file, which is found in the
+ <link linkend='build-directory'>Build Directory</link>,
+ best practices dictate that you do not.
+ <note>
+ To enable extra features from outside the image recipe,
+ use the
+ <filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES</link></filename> variable.
+ </note>
+ </para>
+
+ <para>
+ For a list of image features that ships with the Yocto
+ Project, see the
+ "<link linkend="ref-features-image">Image Features</link>"
+ section.
+ </para>
+
+ <para>
+ For an example that shows how to customize your image by
+ using this variable, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_FSTYPES'><glossterm>IMAGE_FSTYPES</glossterm>
+ <info>
+ IMAGE_FSTYPES[doc] = "Formats of root filesystem images that you want to have created."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the formats the OpenEmbedded build system uses
+ during the build when creating the root filesystem.
+ For example, setting <filename>IMAGE_FSTYPES</filename>
+ as follows causes the build system to create root
+ filesystems using two formats: <filename>.ext3</filename>
+ and <filename>.tar.bz2</filename>:
+ <literallayout class='monospaced'>
+ IMAGE_FSTYPES = "ext3 tar.bz2"
+ </literallayout>
+ </para>
+
+ <para>
+ For the complete list of supported image formats from which
+ you can choose, see
+ <link linkend='var-IMAGE_TYPES'><filename>IMAGE_TYPES</filename></link>.
+ </para>
+
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ If you add "live" to
+ <filename>IMAGE_FSTYPES</filename> inside an image
+ recipe, be sure that you do so prior to the
+ "inherit image" line of the recipe or the live
+ image will not build.
+ </para></listitem>
+ <listitem><para>
+ Due to the way the OpenEmbedded build system
+ processes this variable, you cannot update its
+ contents by using <filename>_append</filename> or
+ <filename>_prepend</filename>.
+ You must use the <filename>+=</filename>
+ operator to add one or more options to the
+ <filename>IMAGE_FSTYPES</filename> variable.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_INSTALL'><glossterm>IMAGE_INSTALL</glossterm>
+ <info>
+ IMAGE_INSTALL[doc] = "Used by recipes to specify the packages to install into an image through image.bbclass."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Used by recipes to specify the packages to install into an
+ image through the
+ <link linkend='ref-classes-image'><filename>image</filename></link>
+ class.
+ Use the <filename>IMAGE_INSTALL</filename> variable with
+ care to avoid ordering issues.
+ </para>
+
+ <para>
+ Image recipes set <filename>IMAGE_INSTALL</filename>
+ to specify the packages to install into an image through
+ <filename>image.bbclass</filename>.
+ Additionally, "helper" classes such as the
+ <link linkend='ref-classes-core-image'><filename>core-image</filename></link>
+ class exist that can take lists used with
+ <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename>
+ and turn them into auto-generated entries in
+ <filename>IMAGE_INSTALL</filename> in addition to its
+ default contents.
+ </para>
+
+ <para>
+ When you use this variable, it is best to use it as follows:
+ <literallayout class='monospaced'>
+ IMAGE_INSTALL_append = " <replaceable>package-name</replaceable>"
+ </literallayout>
+ Be sure to include the space between the quotation character
+ and the start of the package name or names.
+ <note><title>Caution</title>
+ <itemizedlist>
+ <listitem><para>
+ When working with a
+ <link linkend='images-core-image-minimal-initramfs'><filename>core-image-minimal-initramfs</filename></link>
+ image, do not use the
+ <filename>IMAGE_INSTALL</filename> variable to
+ specify packages for installation.
+ Instead, use the
+ <link linkend='var-PACKAGE_INSTALL'><filename>PACKAGE_INSTALL</filename></link>
+ variable, which allows the initial RAM
+ filesystem (initramfs) recipe to use a fixed
+ set of packages and not be affected by
+ <filename>IMAGE_INSTALL</filename>.
+ For information on creating an initramfs, see
+ the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual.
+ </para></listitem>
+ <listitem><para>
+ Using <filename>IMAGE_INSTALL</filename> with
+ the
+ <ulink url='&YOCTO_DOCS_BB_URL;#appending-and-prepending'><filename>+=</filename></ulink>
+ BitBake operator within the
+ <filename>/conf/local.conf</filename> file or
+ from within an image recipe is not recommended.
+ Use of this operator in these ways can cause
+ ordering issues.
+ Since <filename>core-image.bbclass</filename>
+ sets <filename>IMAGE_INSTALL</filename> to a
+ default value using the
+ <ulink url='&YOCTO_DOCS_BB_URL;#setting-a-default-value'><filename>?=</filename></ulink>
+ operator, using a <filename>+=</filename>
+ operation against
+ <filename>IMAGE_INSTALL</filename> results in
+ unexpected behavior when used within
+ <filename>conf/local.conf</filename>.
+ Furthermore, the same operation from within
+ an image recipe may or may not succeed
+ depending on the specific situation.
+ In both these cases, the behavior is contrary
+ to how most users expect the
+ <filename>+=</filename> operator to work.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_LINGUAS'><glossterm>IMAGE_LINGUAS</glossterm>
+ <info>
+ IMAGE_LINGUAS[doc] = "Specifies the list of locales to install into the image during the root filesystem construction process."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the list of locales to install into the image
+ during the root filesystem construction process.
+ The OpenEmbedded build system automatically splits locale
+ files, which are used for localization, into separate
+ packages.
+ Setting the <filename>IMAGE_LINGUAS</filename> variable
+ ensures that any locale packages that correspond to packages
+ already selected for installation into the image are also
+ installed.
+ Here is an example:
+ <literallayout class='monospaced'>
+ IMAGE_LINGUAS = "pt-br de-de"
+ </literallayout>
+ </para>
+
+ <para>
+ In this example, the build system ensures any Brazilian
+ Portuguese and German locale files that correspond to
+ packages in the image are installed (i.e.
+ <filename>*-locale-pt-br</filename>
+ and <filename>*-locale-de-de</filename> as well as
+ <filename>*-locale-pt</filename>
+ and <filename>*-locale-de</filename>, since some software
+ packages only provide locale files by language and not by
+ country-specific language).
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-GLIBC_GENERATE_LOCALES'><filename>GLIBC_GENERATE_LOCALES</filename></link>
+ variable for information on generating GLIBC locales.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_MANIFEST'><glossterm>IMAGE_MANIFEST</glossterm>
+ <info>
+ IMAGE_MANIFEST[doc] = "The manifest file for the image. This file lists all the installed packages that make up the image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The manifest file for the image.
+ This file lists all the installed packages that make up
+ the image.
+ The file contains package information on a line-per-package
+ basis as follows:
+ <literallayout class='monospaced'>
+ <replaceable>packagename</replaceable> <replaceable>packagearch</replaceable> <replaceable>version</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-image'><filename>image</filename></link>
+ class defines the manifest file as follows:
+ <literallayout class='monospaced'>
+ IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest"
+ </literallayout>
+ The location is derived using the
+ <link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link>
+ and
+ <link linkend='var-IMAGE_NAME'><filename>IMAGE_NAME</filename></link>
+ variables.
+ You can find information on how the image
+ is created in the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#image-generation-dev-environment'>Image Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_NAME'><glossterm>IMAGE_NAME</glossterm>
+ <info>
+ IMAGE_NAME[doc] = "The name of the output image files minus the extension."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The name of the output image files minus the extension.
+ This variable is derived using the
+ <link linkend='var-IMAGE_BASENAME'><filename>IMAGE_BASENAME</filename></link>,
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>,
+ and
+ <link linkend='var-DATETIME'><filename>DATETIME</filename></link>
+ variables:
+ <literallayout class='monospaced'>
+ IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_OVERHEAD_FACTOR'><glossterm>IMAGE_OVERHEAD_FACTOR</glossterm>
+ <info>
+ IMAGE_OVERHEAD_FACTOR[doc] = "Defines a multiplier that the build system applies to the initial image size for cases when the multiplier times the returned disk usage value for the image is greater than the sum of IMAGE_ROOTFS_SIZE and IMAGE_ROOTFS_EXTRA_SPACE."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines a multiplier that the build system applies to the initial image
+ size for cases when the multiplier times the returned disk usage value
+ for the image is greater than the sum of
+ <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename>
+ and
+ <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename>.
+ The result of the multiplier applied to the initial image size creates
+ free disk space in the image as overhead.
+ By default, the build process uses a multiplier of 1.3 for this variable.
+ This default value results in 30% free disk space added to the image when this
+ method is used to determine the final generated image size.
+ You should be aware that post install scripts and the package management
+ system uses disk space inside this overhead area.
+ Consequently, the multiplier does not produce an image with
+ all the theoretical free disk space.
+ See <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename>
+ for information on how the build system determines the overall image size.
+ </para>
+
+ <para>
+ The default 30% free disk space typically gives the image enough room to boot
+ and allows for basic post installs while still leaving a small amount of
+ free disk space.
+ If 30% free space is inadequate, you can increase the default value.
+ For example, the following setting gives you 50% free space added to the image:
+ <literallayout class='monospaced'>
+ IMAGE_OVERHEAD_FACTOR = "1.5"
+ </literallayout>
+ </para>
+
+ <para>
+ Alternatively, you can ensure a specific amount of free disk space is added
+ to the image by using the
+ <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_PKGTYPE'><glossterm>IMAGE_PKGTYPE</glossterm>
+ <info>
+ IMAGE_PKGTYPE[doc] = "Defines the package type (i.e. DEB, RPM, IPK, or TAR) used by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the package type (i.e. DEB, RPM, IPK, or TAR) used
+ by the OpenEmbedded build system.
+ The variable is defined appropriately by the
+ <link linkend='ref-classes-package_deb'><filename>package_deb</filename></link>,
+ <link linkend='ref-classes-package_rpm'><filename>package_rpm</filename></link>,
+ <link linkend='ref-classes-package_ipk'><filename>package_ipk</filename></link>,
+ or
+ <link linkend='ref-classes-package_tar'><filename>package_tar</filename></link>
+ class.
+ <note><title>Warning</title>
+ The <filename>package_tar</filename> class is broken
+ and is not supported.
+ It is recommended that you do not use it.
+ </note>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_*</filename></link>
+ and
+ <link linkend='ref-classes-image'><filename>image</filename></link>
+ classes use the <filename>IMAGE_PKGTYPE</filename> for
+ packaging up images and SDKs.
+ </para>
+
+ <para>
+ You should not set the <filename>IMAGE_PKGTYPE</filename>
+ manually.
+ Rather, the variable is set indirectly through the
+ appropriate
+ <link linkend='ref-classes-package'><filename>package_*</filename></link>
+ class using the
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>
+ variable.
+ The OpenEmbedded build system uses the first package type
+ (e.g. DEB, RPM, or IPK) that appears with the variable
+ <note>
+ Files using the <filename>.tar</filename> format are
+ never used as a substitute packaging format for DEB,
+ RPM, and IPK formatted files for your image or SDK.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_POSTPROCESS_COMMAND'><glossterm>IMAGE_POSTPROCESS_COMMAND</glossterm>
+ <info>
+ IMAGE_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system creates the final image output files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call once the
+ OpenEmbedded build system creates the final image
+ output files.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ IMAGE_POSTPROCESS_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within the function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_PREPROCESS_COMMAND'><glossterm>IMAGE_PREPROCESS_COMMAND</glossterm>
+ <info>
+ IMAGE_PREPROCESS_COMMAND[doc] = "Specifies a list of functions to call before the OpenEmbedded build system creates the final image output files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call before the
+ OpenEmbedded build system creates the final image
+ output files.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ IMAGE_PREPROCESS_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within the function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_ROOTFS'><glossterm>IMAGE_ROOTFS</glossterm>
+ <info>
+ IMAGE_ROOTFS[doc] = "The location of the root filesystem while it is under construction (i.e. during do_rootfs)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location of the root filesystem while it is under
+ construction (i.e. during the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task).
+ This variable is not configurable.
+ Do not change it.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_ROOTFS_ALIGNMENT'><glossterm>IMAGE_ROOTFS_ALIGNMENT</glossterm>
+ <info>
+ IMAGE_ROOTFS_ALIGNMENT[doc] = "Specifies the alignment for the output image file in Kbytes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the alignment for the output image file in
+ Kbytes.
+ If the size of the image is not a multiple of
+ this value, then the size is rounded up to the nearest
+ multiple of the value.
+ The default value is "1".
+ See
+ <link linkend='var-IMAGE_ROOTFS_SIZE'><filename>IMAGE_ROOTFS_SIZE</filename></link>
+ for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_ROOTFS_EXTRA_SPACE'><glossterm>IMAGE_ROOTFS_EXTRA_SPACE</glossterm>
+ <info>
+ IMAGE_ROOTFS_EXTRA_SPACE[doc] = "Defines additional free disk space created in the image in Kbytes. By default, this variable is set to '0'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines additional free disk space created in the image in Kbytes.
+ By default, this variable is set to "0".
+ This free disk space is added to the image after the build system determines
+ the image size as described in
+ <filename><link linkend='var-IMAGE_ROOTFS_SIZE'>IMAGE_ROOTFS_SIZE</link></filename>.
+ </para>
+
+ <para>
+ This variable is particularly useful when you want to ensure that a
+ specific amount of free disk space is available on a device after an image
+ is installed and running.
+ For example, to be sure 5 Gbytes of free disk space is available, set the
+ variable as follows:
+ <literallayout class='monospaced'>
+ IMAGE_ROOTFS_EXTRA_SPACE = "5242880"
+ </literallayout>
+ </para>
+
+ <para>
+ For example, the Yocto Project Build Appliance specifically requests 40 Gbytes
+ of extra space with the line:
+ <literallayout class='monospaced'>
+ IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_ROOTFS_SIZE'><glossterm>IMAGE_ROOTFS_SIZE</glossterm>
+ <info>
+ IMAGE_ROOTFS_SIZE[doc] = "Defines the size in Kbytes for the generated image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the size in Kbytes for the generated image.
+ The OpenEmbedded build system determines the final size for the generated
+ image using an algorithm that takes into account the initial disk space used
+ for the generated image, a requested size for the image, and requested
+ additional free disk space to be added to the image.
+ Programatically, the build system determines the final size of the
+ generated image as follows:
+ <literallayout class='monospaced'>
+ if (image-du * overhead) &lt; rootfs-size:
+ internal-rootfs-size = rootfs-size + xspace
+ else:
+ internal-rootfs-size = (image-du * overhead) + xspace
+
+ where:
+
+ image-du = Returned value of the du command on
+ the image.
+
+ overhead = IMAGE_OVERHEAD_FACTOR
+
+ rootfs-size = IMAGE_ROOTFS_SIZE
+
+ internal-rootfs-size = Initial root filesystem
+ size before any modifications.
+
+ xspace = IMAGE_ROOTFS_EXTRA_SPACE
+ </literallayout>
+ </para>
+
+ <para>
+ See the <link linkend='var-IMAGE_OVERHEAD_FACTOR'><filename>IMAGE_OVERHEAD_FACTOR</filename></link>
+ and <link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'><filename>IMAGE_ROOTFS_EXTRA_SPACE</filename></link>
+ variables for related information.
+<!-- In the above example, <filename>overhead</filename> is defined by the
+ <filename><link linkend='var-IMAGE_OVERHEAD_FACTOR'>IMAGE_OVERHEAD_FACTOR</link></filename>
+ variable, <filename>xspace</filename> is defined by the
+ <filename><link linkend='var-IMAGE_ROOTFS_EXTRA_SPACE'>IMAGE_ROOTFS_EXTRA_SPACE</link></filename>
+ variable, and <filename>du</filename> is the results of the disk usage command
+ on the initially generated image. -->
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_TYPEDEP'><glossterm>IMAGE_TYPEDEP</glossterm>
+ <info>
+ IMAGE_TYPEDEP[doc] = "Specifies a dependency from one image type on another."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a dependency from one image type on another.
+ Here is an example from the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class:
+ <literallayout class='monospaced'>
+ IMAGE_TYPEDEP_live = "ext3"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, the variable ensures that when
+ "live" is listed with the
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable, the OpenEmbedded build system produces an
+ <filename>ext3</filename> image first since one of the
+ components of the live
+ image is an <filename>ext3</filename>
+ formatted partition containing the root
+ filesystem.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IMAGE_TYPES'><glossterm>IMAGE_TYPES</glossterm>
+ <info>
+ IMAGE_TYPES[doc] = "Specifies the complete list of supported image types by default."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the complete list of supported image types
+ by default:
+ <literallayout class='monospaced'>
+ btrfs
+ cpio
+ cpio.gz
+ cpio.lz4
+ cpio.lzma
+ cpio.xz
+ cramfs
+ elf
+ ext2
+ ext2.bz2
+ ext2.gz
+ ext2.lzma
+ ext3
+ ext3.gz
+ ext4
+ ext4.gz
+ hdddirect
+ hddimg
+ iso
+ jffs2
+ jffs2.sum
+ multiubi
+ squashfs
+ squashfs-lzo
+ squashfs-xz
+ tar
+ tar.bz2
+ tar.gz
+ tar.lz4
+ tar.xz
+ ubi
+ ubifs
+ wic
+ wic.bz2
+ wic.gz
+ wic.lzma
+ </literallayout>
+ </para>
+
+ <para>
+ For more information about these types of images, see
+ <filename>meta/classes/image_types*.bbclass</filename>
+ in the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INC_PR'><glossterm>INC_PR</glossterm>
+ <info>
+ INC_PR[doc] = "Helps define the recipe revision for recipes that share a common include file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Helps define the recipe revision for recipes that share
+ a common <filename>include</filename> file.
+ You can think of this variable as part of the recipe revision
+ as set from within an include file.
+ </para>
+
+ <para>
+ Suppose, for example, you have a set of recipes that
+ are used across several projects.
+ And, within each of those recipes the revision
+ (its <link linkend='var-PR'><filename>PR</filename></link>
+ value) is set accordingly.
+ In this case, when the revision of those recipes changes,
+ the burden is on you to find all those recipes and
+ be sure that they get changed to reflect the updated
+ version of the recipe.
+ In this scenario, it can get complicated when recipes
+ that are used in many places and provide common functionality
+ are upgraded to a new revision.
+ </para>
+
+ <para>
+ A more efficient way of dealing with this situation is
+ to set the <filename>INC_PR</filename> variable inside
+ the <filename>include</filename> files that the recipes
+ share and then expand the <filename>INC_PR</filename>
+ variable within the recipes to help
+ define the recipe revision.
+ </para>
+
+ <para>
+ The following provides an example that shows how to use
+ the <filename>INC_PR</filename> variable
+ given a common <filename>include</filename> file that
+ defines the variable.
+ Once the variable is defined in the
+ <filename>include</filename> file, you can use the
+ variable to set the <filename>PR</filename> values in
+ each recipe.
+ You will notice that when you set a recipe's
+ <filename>PR</filename> you can provide more granular
+ revisioning by appending values to the
+ <filename>INC_PR</filename> variable:
+ <literallayout class='monospaced'>
+recipes-graphics/xorg-font/xorg-font-common.inc:INC_PR = "r2"
+recipes-graphics/xorg-font/encodings_1.0.4.bb:PR = "${INC_PR}.1"
+recipes-graphics/xorg-font/font-util_1.3.0.bb:PR = "${INC_PR}.0"
+recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
+ </literallayout>
+ The first line of the example establishes the baseline
+ revision to be used for all recipes that use the
+ <filename>include</filename> file.
+ The remaining lines in the example are from individual
+ recipes and show how the <filename>PR</filename> value
+ is set.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INCOMPATIBLE_LICENSE'><glossterm>INCOMPATIBLE_LICENSE</glossterm>
+ <info>
+ INCOMPATIBLE_LICENSE[doc] = "Specifies a space-separated list of license names (as they would appear in LICENSE) that should be excluded from the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a space-separated list of license names
+ (as they would appear in
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>)
+ that should be excluded from the build.
+ Recipes that provide no alternatives to listed incompatible
+ licenses are not built.
+ Packages that are individually licensed with the specified
+ incompatible licenses will be deleted.
+ </para>
+
+ <note>
+ This functionality is only regularly tested using
+ the following setting:
+ <literallayout class='monospaced'>
+ INCOMPATIBLE_LICENSE = "GPL-3.0 LGPL-3.0 AGPL-3.0"
+ </literallayout>
+ Although you can use other settings, you might be required
+ to remove dependencies on or provide alternatives to
+ components that are required to produce a functional system
+ image.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INHERIT'><glossterm>INHERIT</glossterm>
+ <info>
+ INHERIT[doc] = "Causes the named class or classes to be inherited globally."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes the named class or classes to be inherited globally.
+ Anonymous functions in the class or classes
+ are not executed for the
+ base configuration and in each individual recipe.
+ The OpenEmbedded build system ignores changes to
+ <filename>INHERIT</filename> in individual recipes.
+ </para>
+
+ <para>
+ For more information on <filename>INHERIT</filename>, see
+ the
+ "<ulink url="&YOCTO_DOCS_BB_URL;#inherit-configuration-directive"><filename>INHERIT</filename> Configuration Directive</ulink>"
+ section in the Bitbake User Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INHERIT_DISTRO'><glossterm>INHERIT_DISTRO</glossterm>
+ <info>
+ INHERIT_DISTRO[doc] = "Lists classes that will be inherited at the distribution level. It is unlikely that you want to edit this variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists classes that will be inherited at the
+ distribution level.
+ It is unlikely that you want to edit this variable.
+ </para>
+
+ <para>
+ The default value of the variable is set as follows in the
+ <filename>meta/conf/distro/defaultsetup.conf</filename>
+ file:
+ <literallayout class='monospaced'>
+ INHERIT_DISTRO ?= "debian devshell sstate license"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INHIBIT_DEFAULT_DEPS'><glossterm>INHIBIT_DEFAULT_DEPS</glossterm>
+ <info>
+ INHIBIT_DEFAULT_DEPS[doc] = "Prevents the default dependencies, namely the C compiler and standard C library (libc), from being added to DEPENDS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Prevents the default dependencies, namely the C compiler
+ and standard C library (libc), from being added to
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
+ This variable is usually used within recipes that do not
+ require any compilation using the C compiler.
+ </para>
+
+ <para>
+ Set the variable to "1" to prevent the default dependencies
+ from being added.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INHIBIT_PACKAGE_DEBUG_SPLIT'><glossterm>INHIBIT_PACKAGE_DEBUG_SPLIT</glossterm>
+ <info>
+ INHIBIT_PACKAGE_DEBUG_SPLIT[doc] = "If set to "1", prevents the OpenEmbedded build system from splitting out debug information during packaging"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Prevents the OpenEmbedded build system from splitting
+ out debug information during packaging.
+ By default, the build system splits out debugging
+ information during the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task.
+ For more information on how debug information is split out,
+ see the
+ <link linkend='var-PACKAGE_DEBUG_SPLIT_STYLE'><filename>PACKAGE_DEBUG_SPLIT_STYLE</filename></link>
+ variable.
+ </para>
+
+ <para>
+ To prevent the build system from splitting out
+ debug information during packaging, set the
+ <filename>INHIBIT_PACKAGE_DEBUG_SPLIT</filename> variable
+ as follows:
+ <literallayout class='monospaced'>
+ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INHIBIT_PACKAGE_STRIP'><glossterm>INHIBIT_PACKAGE_STRIP</glossterm>
+ <info>
+ INHIBIT_PACKAGE_STRIP[doc] = "If set to "1", causes the build to not strip binaries in resulting packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "1", causes the build to not strip binaries in
+ resulting packages and prevents the
+ <filename>-dbg</filename> package from containing the
+ source files.
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system strips
+ binaries and puts the debugging symbols into
+ <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-dbg</filename>.
+ Consequently, you should not set
+ <filename>INHIBIT_PACKAGE_STRIP</filename> when you plan
+ to debug in general.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRAMFS_FSTYPES'><glossterm>INITRAMFS_FSTYPES</glossterm>
+ <info>
+ INITRAMFS_FSTYPES[doc] = "Defines the format for the output image of an initial RAM filesystem (initramfs), which is used during boot."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the format for the output image of an initial
+ RAM filesystem (initramfs), which is used during boot.
+ Supported formats are the same as those supported by the
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ variable.
+ </para>
+
+ <para>
+ The default value of this variable, which is set in the
+ <filename>meta/conf/bitbake.conf</filename> configuration
+ file in the
+ <link linkend='source-directory'>Source Directory</link>,
+ is "cpio.gz".
+ The Linux kernel's initramfs mechanism, as opposed to the
+ initial RAM filesystem
+ <ulink url='https://en.wikipedia.org/wiki/Initrd'>initrd</ulink>
+ mechanism, expects an optionally compressed cpio
+ archive.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRAMFS_IMAGE'><glossterm>INITRAMFS_IMAGE</glossterm>
+ <info>
+ INITRAMFS_IMAGE[doc] = "Specifies the PROVIDES name of an image recipe that is used to build an initial RAM filesystem (initramfs) image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ name of an image recipe that is used to build an initial
+ RAM filesystem (initramfs) image.
+ In other words, the <filename>INITRAMFS_IMAGE</filename>
+ variable causes an additional recipe to be built as
+ a dependency to whatever root filesystem recipe you
+ might be using (e.g. <filename>core-image-sato</filename>).
+ The initramfs image recipe you provide should set
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ to
+ <link linkend='var-INITRAMFS_FSTYPES'><filename>INITRAMFS_FSTYPES</filename></link>.
+ </para>
+
+ <para>
+ An initramfs image provides a temporary root filesystem
+ used for early system initialization (e.g. loading of
+ modules needed to locate and mount the "real" root
+ filesystem).
+ <note>
+ See the <filename>meta/recipes-core/images/core-image-minimal-initramfs.bb</filename>
+ recipe in the
+ <link linkend='source-directory'>Source Directory</link>
+ for an example initramfs recipe.
+ To select this sample recipe as the one built
+ to provide the initramfs image,
+ set <filename>INITRAMFS_IMAGE</filename> to
+ "core-image-minimal-initramfs".
+ </note>
+ </para>
+
+ <para>
+ You can also find more information by referencing the
+ <filename>meta-poky/conf/local.conf.sample.extended</filename>
+ configuration file in the Source Directory,
+ the
+ <link linkend='ref-classes-image'><filename>image</filename></link>
+ class, and the
+ <link linkend='ref-classes-kernel'><filename>kernel</filename></link>
+ class to see how to use the
+ <filename>INITRAMFS_IMAGE</filename> variable.
+ </para>
+
+ <para>
+ If <filename>INITRAMFS_IMAGE</filename> is empty, which is
+ the default, then no initramfs image is built.
+ </para>
+
+ <para>
+ For more information, you can also see the
+ <link linkend='var-INITRAMFS_IMAGE_BUNDLE'><filename>INITRAMFS_IMAGE_BUNDLE</filename></link>
+ variable, which allows the generated image to be bundled
+ inside the kernel image.
+ Additionally, for information on creating an initramfs
+ image, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRAMFS_IMAGE_BUNDLE'><glossterm>INITRAMFS_IMAGE_BUNDLE</glossterm>
+ <info>
+ INITRAMFS_IMAGE_BUNDLE[doc] = "Controls whether or not the image recipe specified by INITRAMFS_IMAGE is run through an extra pass (do_bundle_initramfs) during kernel compilation in order to build a single binary that contains both the kernel image and the initial RAM filesystem (initramfs)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Controls whether or not the image recipe specified by
+ <link linkend='var-INITRAMFS_IMAGE'><filename>INITRAMFS_IMAGE</filename></link>
+ is run through an extra pass
+ (<link linkend='ref-tasks-bundle_initramfs'><filename>do_bundle_initramfs</filename></link>)
+ during kernel compilation in order to build a single binary
+ that contains both the kernel image and the initial RAM
+ filesystem (initramfs) image.
+ This makes use of the
+ <link linkend='var-CONFIG_INITRAMFS_SOURCE'><filename>CONFIG_INITRAMFS_SOURCE</filename></link>
+ kernel feature.
+ <note>
+ Using an extra compilation pass to bundle the initramfs
+ avoids a circular dependency between the kernel recipe and
+ the initramfs recipe should the initramfs include kernel
+ modules.
+ Should that be the case, the initramfs recipe depends on
+ the kernel for the kernel modules, and the kernel depends
+ on the initramfs recipe since the initramfs is bundled
+ inside the kernel image.
+ </note>
+ </para>
+
+ <para>
+ The combined binary is deposited into the
+ <filename>tmp/deploy</filename> directory, which is part
+ of the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+
+ <para>
+ Setting the variable to "1" in a configuration file causes the
+ OpenEmbedded build system to generate a kernel image with the
+ initramfs specified in <filename>INITRAMFS_IMAGE</filename>
+ bundled within:
+ <literallayout class='monospaced'>
+ INITRAMFS_IMAGE_BUNDLE = "1"
+ </literallayout>
+ By default, the
+ <link linkend='ref-classes-kernel'><filename>kernel</filename></link>
+ class sets this variable to a null string as follows:
+ <literallayout class='monospaced'>
+ INITRAMFS_IMAGE_BUNDLE ?= ""
+ </literallayout>
+ <note>
+ You must set the
+ <filename>INITRAMFS_IMAGE_BUNDLE</filename> variable in
+ a configuration file.
+ You cannot set the variable in a recipe file.
+ </note>
+ See the
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/tree/meta-poky/conf/local.conf.sample.extended'><filename>local.conf.sample.extended</filename></ulink>
+ file for additional information.
+ Also, for information on creating an initramfs, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRD'><glossterm>INITRD</glossterm>
+ <info>
+ INITRD[doc] = "Indicates a list of filesystem images to concatenate and use as an initial RAM disk (initrd)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Indicates list of filesystem images to concatenate and use
+ as an initial RAM disk (<filename>initrd</filename>).
+ </para>
+
+ <para>
+ The <filename>INITRD</filename> variable is an optional
+ variable used with the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITRD_IMAGE'><glossterm>INITRD_IMAGE</glossterm>
+ <info>
+ INITRD_IMAGE[doc] = "When building a "live" bootable image (i.e. when IMAGE_FSTYPES contains "live"), INITRD_IMAGE specifies the image recipe that should be built to provide the initial RAM disk image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When building a "live" bootable image (i.e. when
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ contains "live"), <filename>INITRD_IMAGE</filename>
+ specifies the image recipe that should be built
+ to provide the initial RAM disk image.
+ The default value is "core-image-minimal-initramfs".
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITSCRIPT_NAME'><glossterm>INITSCRIPT_NAME</glossterm>
+ <info>
+ INITSCRIPT_NAME[doc] = "The filename of the initialization script as installed to ${sysconfdir}/init.d."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The filename of the initialization script as installed to
+ <filename>${sysconfdir}/init.d</filename>.
+ </para>
+
+ <para>
+ This variable is used in recipes when using <filename>update-rc.d.bbclass</filename>.
+ The variable is mandatory.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITSCRIPT_PACKAGES'><glossterm>INITSCRIPT_PACKAGES</glossterm>
+ <info>
+ INITSCRIPT_PACKAGES[doc] = "A list of the packages that contain initscripts. This variable is used in recipes when using update-rc.d.bbclass. The variable is optional and defaults to the PN variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of the packages that contain initscripts.
+ If multiple packages are specified, you need to append the package name
+ to the other <filename>INITSCRIPT_*</filename> as an override.
+ </para>
+
+ <para>
+ This variable is used in recipes when using <filename>update-rc.d.bbclass</filename>.
+ The variable is optional and defaults to the
+ <link linkend='var-PN'><filename>PN</filename></link> variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INITSCRIPT_PARAMS'><glossterm>INITSCRIPT_PARAMS</glossterm>
+ <info>
+ INITSCRIPT_PARAMS[doc] = "Specifies the options to pass to update-rc.d. The variable is mandatory and is used in recipes when using update-rc.d.bbclass."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the options to pass to <filename>update-rc.d</filename>.
+ Here is an example:
+ <literallayout class='monospaced'>
+ INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+ </literallayout>
+ </para>
+
+ <para>
+ In this example, the script has a runlevel of 99,
+ starts the script in initlevels 2 and 5, and
+ stops the script in levels 0, 1 and 6.
+ </para>
+
+ <para>
+ The variable's default value is "defaults", which is
+ set in the
+ <link linkend='ref-classes-update-rc.d'><filename>update-rc.d</filename></link>
+ class.
+ </para>
+
+ <para>
+ The value in
+ <filename>INITSCRIPT_PARAMS</filename> is passed through
+ to the <filename>update-rc.d</filename> command.
+ For more information on valid parameters, please see the
+ <filename>update-rc.d</filename> manual page at
+ <ulink url='http://www.tin.org/bin/man.cgi?section=8&amp;topic=update-rc.d'></ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INSANE_SKIP'><glossterm>INSANE_SKIP</glossterm>
+ <info>
+ INSANE_SKIP[doc] = "Specifies the QA checks to skip for a specific package within a recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the QA checks to skip for a specific package
+ within a recipe.
+ For example, to skip the check for symbolic link
+ <filename>.so</filename> files in the main package of a
+ recipe, add the following to the recipe.
+ The package name override must be used, which in this
+ example is <filename>${PN}</filename>:
+ <literallayout class='monospaced'>
+ INSANE_SKIP_${PN} += "dev-so"
+ </literallayout>
+ </para>
+
+ <para>
+ See the "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section for a list of the valid QA checks you can
+ specify using this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-INSTALL_TIMEZONE_FILE'><glossterm>INSTALL_TIMEZONE_FILE</glossterm>
+ <info>
+ INSTALL_TIMEZONE_FILE[doc] = "Enables installation of the /etc/timezone file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ By default, the <filename>tzdata</filename> recipe packages
+ an <filename>/etc/timezone</filename> file.
+ Set the <filename>INSTALL_TIMEZONE_FILE</filename>
+ variable to "0" at the configuration level to disable this
+ behavior.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-IPK_FEED_URIS'><glossterm>IPK_FEED_URIS</glossterm>
+ <info>
+ IPK_FEED_URIS[doc] = "List of ipkg feed records to put into generated image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the IPK backend is in use and package management
+ is enabled on the target, you can use this variable to
+ set up <filename>opkg</filename> in the target image
+ to point to package feeds on a nominated server.
+ Once the feed is established, you can perform
+ installations or upgrades using the package manager
+ at runtime.
+ </para>
+ </glossdef>
+ </glossentry>
+
+<!--
+ <glossentry id='var-INTERCEPT_DIR'><glossterm>INTERCEPT_DIR</glossterm>
+ <glossdef>
+ <para>
+ An environment variable that defines the directory where
+ post installation hooks are installed for the
+ post install environment.
+ This variable is fixed as follows:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/intercept_scripts
+ </literallayout>
+ </para>
+
+ <para>
+ After installation of a target's root filesystem,
+ post installation scripts, which are essentially bash scripts,
+ are all executed just a single time.
+ Limiting execution of these scripts minimizes installation
+ time that would be lengthened due to certain packages
+ triggering redundant operations.
+ For example, consider the installation of font packages
+ as a common example.
+ Without limiting the execution of post installation scripts,
+ all font directories would be rescanned to create the
+ cache after each individual font package was installed.
+ </para>
+
+ <para>
+ Do not edit the <filename>INTERCEPT_DIR</filename>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+-->
+
+ </glossdiv>
+
+<!-- <glossdiv id='var-glossary-j'><title>J</title>-->
+<!-- </glossdiv>-->
+
+ <glossdiv id='var-glossary-k'><title>K</title>
+
+ <glossentry id='var-KARCH'><glossterm>KARCH</glossterm>
+ <info>
+ KARCH[doc] = "Defines the kernel architecture used when assembling the configuration. You define the KARCH variable in the BSP Descriptions."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the kernel architecture used when assembling
+ the configuration.
+ Architectures supported for this release are:
+ <literallayout class='monospaced'>
+ powerpc
+ i386
+ x86_64
+ arm
+ qemu
+ mips
+ </literallayout>
+ </para>
+
+ <para>
+ You define the <filename>KARCH</filename> variable in the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#bsp-descriptions'>BSP Descriptions</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KBRANCH'><glossterm>KBRANCH</glossterm>
+ <info>
+ KBRANCH[doc] = "A regular expression used by the build process to explicitly identify the kernel branch that is validated, patched, and configured during a build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A regular expression used by the build process to explicitly
+ identify the kernel branch that is validated, patched,
+ and configured during a build.
+ You must set this variable to ensure the exact kernel
+ branch you want is being used by the build process.
+ </para>
+
+ <para>
+ Values for this variable are set in the kernel's recipe
+ file and the kernel's append file.
+ For example, if you are using the
+ <filename>linux-yocto_4.12</filename> kernel, the kernel
+ recipe file is the
+ <filename>meta/recipes-kernel/linux/linux-yocto_4.12.bb</filename>
+ file.
+ <filename>KBRANCH</filename> is set as follows in that
+ kernel recipe file:
+ <literallayout class='monospaced'>
+ KBRANCH ?= "standard/base"
+ </literallayout>
+ </para>
+
+ <para>
+ This variable is also used from the kernel's append file
+ to identify the kernel branch specific to a particular
+ machine or target hardware.
+ Continuing with the previous kernel example, the kernel's
+ append file (i.e.
+ <filename>linux-yocto_4.12.bbappend</filename>) is located
+ in the BSP layer for a given machine.
+ For example, the append file for the Beaglebone,
+ EdgeRouter, and generic versions of both 32 and 64-bit IA
+ machines (<filename>meta-yocto-bsp</filename>) is named
+ <filename>meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend</filename>.
+ Here are the related statements from that append file:
+ <literallayout class='monospaced'>
+ KBRANCH_genericx86 = "standard/base"
+ KBRANCH_genericx86-64 = "standard/base"
+ KBRANCH_edgerouter = "standard/edgerouter"
+ KBRANCH_beaglebone = "standard/beaglebone"
+ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+ </literallayout>
+ The <filename>KBRANCH</filename> statements identify
+ the kernel branch to use when building for each
+ supported BSP.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KBUILD_DEFCONFIG'><glossterm>KBUILD_DEFCONFIG</glossterm>
+ <info>
+ KBUILD_DEFCONFIG[doc] = "Specifies an "in-tree" kernel configuration file for use during a kernel build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used with the
+ <link linkend='ref-classes-kernel-yocto'><filename>kernel-yocto</filename></link>
+ class, specifies an "in-tree" kernel configuration file
+ for use during a kernel build.
+ </para>
+
+ <para>
+ Typically, when using a <filename>defconfig</filename> to
+ configure a kernel during a build, you place the
+ file in your layer in the same manner as you would
+ place patch files and configuration fragment files (i.e.
+ "out-of-tree").
+ However, if you want to use a <filename>defconfig</filename>
+ file that is part of the kernel tree (i.e. "in-tree"),
+ you can use the
+ <filename>KBUILD_DEFCONFIG</filename> variable and append
+ the
+ <link linkend='var-KMACHINE'><filename>KMACHINE</filename></link>
+ variable to point to the <filename>defconfig</filename>
+ file.
+ </para>
+
+ <para>
+ To use the variable, set it in the append file for your
+ kernel recipe using the following form:
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_<replaceable>KMACHINE</replaceable> ?= <replaceable>defconfig_file</replaceable>
+ </literallayout>
+ Here is an example from a "raspberrypi2"
+ <filename>KMACHINE</filename> build that uses a
+ <filename>defconfig</filename> file named
+ "bcm2709_defconfig":
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_raspberrypi2 = "bcm2709_defconfig"
+ </literallayout>
+ As an alternative, you can use the following within your
+ append file:
+ <literallayout class='monospaced'>
+ KBUILD_DEFCONFIG_pn-linux-yocto ?= <replaceable>defconfig_file</replaceable>
+ </literallayout>
+ For more information on how to use the
+ <filename>KBUILD_DEFCONFIG</filename> variable, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-an-in-tree-defconfig-file'>Using an "In-Tree" <filename>defconfig</filename> File</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_ALT_IMAGETYPE'><glossterm>KERNEL_ALT_IMAGETYPE</glossterm>
+ <info>
+ KERNEL_ALT_IMAGETYPE[doc] = "Specifies an alternate kernel image type for creation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies an alternate kernel image type for creation in
+ addition to the kernel image type specified using the
+ <link linkend='var-KERNEL_IMAGETYPE'><filename>KERNEL_IMAGETYPE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_CLASSES'><glossterm>KERNEL_CLASSES</glossterm>
+ <info>
+ KERNEL_CLASSES[doc] = "A list of classes defining kernel image types that kernel class should inherit."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of classes defining kernel image types that the
+ <link linkend='ref-classes-kernel'><filename>kernel</filename></link>
+ class should inherit.
+ You typically append this variable to enable extended image
+ types.
+ An example is the "kernel-fitimage", which enables
+ fitImage support and resides in
+ <filename>meta/classes/kernel-fitimage.bbclass</filename>.
+ You can register custom kernel image types with the
+ <filename>kernel</filename> class using this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_DEVICETREE'><glossterm>KERNEL_DEVICETREE</glossterm>
+ <info>
+ KERNEL_DEVICETREE[doc] = "Specifies the name of the generated Linux kernel device tree (i.e. the .dtb) file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the generated Linux kernel device tree
+ (i.e. the <filename>.dtb</filename>) file.
+ <note>
+ Legacy support exists for specifying the full path
+ to the device tree.
+ However, providing just the <filename>.dtb</filename>
+ file is preferred.
+ </note>
+ In order to use this variable, you must have the include
+ files in your kernel recipe:
+ <literallayout class='monospaced'>
+ require recipes-kernel/linux/linux-dtb.inc
+ </literallayout>
+ or
+ <literallayout class='monospaced'>
+ require recipes-kernel/linux/linux-yocto.inc
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_EXTRA_ARGS'><glossterm>KERNEL_EXTRA_ARGS</glossterm>
+ <info>
+ KERNEL_EXTRA_ARGS[doc] = "Specifies additional make command-line arguments the OpenEmbedded build system passes on when compiling the kernel."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies additional <filename>make</filename>
+ command-line arguments the OpenEmbedded build system
+ passes on when compiling the kernel.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_FEATURES'><glossterm>KERNEL_FEATURES</glossterm>
+ <info>
+ KERNEL_FEATURES[doc] = "Includes additional kernel metadata. The metadata you add through this variable includes config fragments and features descriptions."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Includes additional kernel metadata.
+ In the OpenEmbedded build system, the default Board Support
+ Packages (BSPs)
+ <link linkend='metadata'>Metadata</link>
+ is provided through
+ the <link linkend='var-KMACHINE'><filename>KMACHINE</filename></link>
+ and
+ <link linkend='var-KBRANCH'><filename>KBRANCH</filename></link>
+ variables.
+ You can use the <filename>KERNEL_FEATURES</filename>
+ variable from within the kernel recipe or kernel append
+ file to further add metadata for all BSPs or specific
+ BSPs.
+ </para>
+
+ <para>
+ The metadata you add through this variable includes config
+ fragments and features descriptions,
+ which usually includes patches as well as config fragments.
+ You typically override the
+ <filename>KERNEL_FEATURES</filename> variable for a
+ specific machine.
+ In this way, you can provide validated, but optional,
+ sets of kernel configurations and features.
+ </para>
+
+ <para>
+ For example, the following example from the
+ <filename>linux-yocto-rt_4.12</filename> kernel recipe
+ adds "netfilter" and "taskstats" features to all BSPs
+ as well as "virtio" configurations to all QEMU machines.
+ The last two statements add specific configurations to
+ targeted machine types:
+ <literallayout class='monospaced'>
+ KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+ KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+ KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+ KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+ KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
+ </literallayout></para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_IMAGE_BASE_NAME'><glossterm>KERNEL_IMAGE_BASE_NAME</glossterm>
+ <info>
+ KERNEL_IMAGE_BASE_NAME[doc] = "The base name of the kernel image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The base name of the kernel image.
+ This variable is set in the
+ <link linkend='ref-classes-kernel'>kernel</link> class
+ as follows:
+ <literallayout class='monospaced'>
+ KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+ </literallayout>
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-PKGE'><filename>PKGE</filename></link>,
+ <link linkend='var-PKGV'><filename>PKGV</filename></link>,
+ <link linkend='var-PKGR'><filename>PKGR</filename></link>,
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>,
+ and
+ <link linkend='var-DATETIME'><filename>DATETIME</filename></link>
+ variables for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_IMAGE_MAXSIZE'><glossterm>KERNEL_IMAGE_MAXSIZE</glossterm>
+ <info>
+ KERNEL_IMAGE_MAXSIZE[doc] = "The maximum allowable size in kilobytes of the kernel image file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the maximum size of the kernel image file in
+ kilobytes.
+ If <filename>KERNEL_IMAGE_MAXSIZE</filename> is set,
+ the size of the kernel image file is checked against
+ the set value during the
+ <link linkend='ref-tasks-sizecheck'><filename>do_sizecheck</filename></link>
+ task.
+ The task fails if the kernel image file is larger than
+ the setting.
+ </para>
+
+ <para>
+ <filename>KERNEL_IMAGE_MAXSIZE</filename> is useful for
+ target devices that have a limited amount of space in
+ which the kernel image must be stored.
+ </para>
+
+ <para>
+ By default, this variable is not set, which means the
+ size of the kernel image is not checked.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_IMAGETYPE'><glossterm>KERNEL_IMAGETYPE</glossterm>
+ <info>
+ KERNEL_IMAGETYPE[doc] = "The type of kernel to build for a device, usually set by the machine configuration files and defaults to 'zImage'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The type of kernel to build for a device, usually set by the
+ machine configuration files and defaults to "zImage".
+ This variable is used
+ when building the kernel and is passed to <filename>make</filename> as the target to
+ build.
+ </para>
+
+ <para>
+ If you want to build an alternate kernel image type, use the
+ <link linkend='var-KERNEL_ALT_IMAGETYPE'><filename>KERNEL_ALT_IMAGETYPE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_MODULE_AUTOLOAD'><glossterm>KERNEL_MODULE_AUTOLOAD</glossterm>
+ <info>
+ KERNEL_MODULE_AUTOLOAD[doc] = "Lists kernel modules that need to be auto-loaded during boot"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists kernel modules that need to be auto-loaded during
+ boot.
+ <note>
+ This variable replaces the deprecated
+ <link linkend='var-module_autoload'><filename>module_autoload</filename></link>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ You can use the <filename>KERNEL_MODULE_AUTOLOAD</filename>
+ variable anywhere that it can be
+ recognized by the kernel recipe or by an out-of-tree kernel
+ module recipe (e.g. a machine configuration file, a
+ distribution configuration file, an append file for the
+ recipe, or the recipe itself).
+ </para>
+
+ <para>
+ Specify it as follows:
+ <literallayout class='monospaced'>
+ KERNEL_MODULE_AUTOLOAD += "<replaceable>module_name1</replaceable> <replaceable>module_name2</replaceable> <replaceable>module_name3</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ Including <filename>KERNEL_MODULE_AUTOLOAD</filename> causes
+ the OpenEmbedded build system to populate the
+ <filename>/etc/modules-load.d/modname.conf</filename>
+ file with the list of modules to be auto-loaded on boot.
+ The modules appear one-per-line in the file.
+ Here is an example of the most common use case:
+ <literallayout class='monospaced'>
+ KERNEL_MODULE_AUTOLOAD += "<replaceable>module_name</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on how to populate the
+ <filename>modname.conf</filename> file with
+ <filename>modprobe.d</filename> syntax lines, see the
+ <link linkend='var-KERNEL_MODULE_PROBECONF'><filename>KERNEL_MODULE_PROBECONF</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_MODULE_PROBECONF'><glossterm>KERNEL_MODULE_PROBECONF</glossterm>
+ <info>
+ KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Provides a list of modules for which the OpenEmbedded
+ build system expects to find
+ <filename>module_conf_</filename><replaceable>modname</replaceable>
+ values that specify configuration for each of the modules.
+ For information on how to provide those module
+ configurations, see the
+ <link linkend='var-module_conf'><filename>module_conf_*</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_PATH'><glossterm>KERNEL_PATH</glossterm>
+ <info>
+ KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location of the kernel sources.
+ This variable is set to the value of the
+ <link linkend='var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></link>
+ within the
+ <link linkend='ref-classes-module'><filename>module</filename></link>
+ class.
+ For information on how this variable is used, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para>
+
+ <para>
+ To help maximize compatibility with out-of-tree drivers
+ used to build modules, the OpenEmbedded build system also
+ recognizes and uses the
+ <link linkend='var-KERNEL_SRC'><filename>KERNEL_SRC</filename></link>
+ variable, which is identical to the
+ <filename>KERNEL_PATH</filename> variable.
+ Both variables are common variables used by external
+ Makefiles to point to the kernel source directory.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_SRC'><glossterm>KERNEL_SRC</glossterm>
+ <info>
+ KERNEL_SRC[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location of the kernel sources.
+ This variable is set to the value of the
+ <link linkend='var-STAGING_KERNEL_DIR'><filename>STAGING_KERNEL_DIR</filename></link>
+ within the
+ <link linkend='ref-classes-module'><filename>module</filename></link>
+ class.
+ For information on how this variable is used, see the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#incorporating-out-of-tree-modules'>Incorporating Out-of-Tree Modules</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual.
+ </para>
+
+ <para>
+ To help maximize compatibility with out-of-tree drivers
+ used to build modules, the OpenEmbedded build system also
+ recognizes and uses the
+ <link linkend='var-KERNEL_PATH'><filename>KERNEL_PATH</filename></link>
+ variable, which is identical to the
+ <filename>KERNEL_SRC</filename> variable.
+ Both variables are common variables used by external
+ Makefiles to point to the kernel source directory.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNEL_VERSION'><glossterm>KERNEL_VERSION</glossterm>
+ <info>
+ KERNEL_VERSION[doc] = "Specifies the version of the kernel as extracted from version.h or utsrelease.h within the kernel sources."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the version of the kernel as extracted from
+ <filename>version.h</filename> or
+ <filename>utsrelease.h</filename> within the kernel sources.
+ Effects of setting this variable do not take affect until
+ the kernel has been configured.
+ Consequently, attempting to refer to this variable in
+ contexts prior to configuration will not work.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KERNELDEPMODDEPEND'><glossterm>KERNELDEPMODDEPEND</glossterm>
+ <info>
+ KERNELDEPMODDEPEND[doc] = "Specifies whether or not to use the data referenced through the PKGDATA_DIR directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies whether the data referenced through
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>
+ is needed or not.
+ The <filename>KERNELDEPMODDEPEND</filename> does not
+ control whether or not that data exists,
+ but simply whether or not it is used.
+ If you do not need to use the data, set the
+ <filename>KERNELDEPMODDEPEND</filename> variable in your
+ <filename>initramfs</filename> recipe.
+ Setting the variable there when the data is not needed
+ avoids a potential dependency loop.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KFEATURE_DESCRIPTION'><glossterm>KFEATURE_DESCRIPTION</glossterm>
+ <info>
+ KFEATURE_DESCRIPTION[doc] = "Provides a short description of a configuration fragment. You use this variable in the .scc file that describes a configuration fragment file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Provides a short description of a configuration fragment.
+ You use this variable in the <filename>.scc</filename>
+ file that describes a configuration fragment file.
+ Here is the variable used in a file named
+ <filename>smp.scc</filename> to describe SMP being
+ enabled:
+ <literallayout class='monospaced'>
+ define KFEATURE_DESCRIPTION "Enable SMP"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KMACHINE'><glossterm>KMACHINE</glossterm>
+ <info>
+ KMACHINE[doc] = "The machine as known by the kernel."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The machine as known by the kernel.
+ Sometimes the machine name used by the kernel does not
+ match the machine name used by the OpenEmbedded build
+ system.
+ For example, the machine name that the OpenEmbedded build
+ system understands as
+ <filename>core2-32-intel-common</filename> goes by a
+ different name in the Linux Yocto kernel.
+ The kernel understands that machine as
+ <filename>intel-core2-32</filename>.
+ For cases like these, the <filename>KMACHINE</filename>
+ variable maps the kernel machine name to the OpenEmbedded
+ build system machine name.
+ </para>
+
+ <para>
+ These mappings between different names occur in the
+ Yocto Linux Kernel's <filename>meta</filename> branch.
+ As an example take a look in the
+ <filename>common/recipes-kernel/linux/linux-yocto_3.19.bbappend</filename>
+ file:
+ <literallayout class='monospaced'>
+ LINUX_VERSION_core2-32-intel-common = "3.19.0"
+ COMPATIBLE_MACHINE_core2-32-intel-common = "${MACHINE}"
+ SRCREV_meta_core2-32-intel-common = "8897ef68b30e7426bc1d39895e71fb155d694974"
+ SRCREV_machine_core2-32-intel-common = "43b9eced9ba8a57add36af07736344dcc383f711"
+ KMACHINE_core2-32-intel-common = "intel-core2-32"
+ KBRANCH_core2-32-intel-common = "standard/base"
+ KERNEL_FEATURES_append_core2-32-intel-common = "${KERNEL_FEATURES_INTEL_COMMON}"
+ </literallayout>
+ The <filename>KMACHINE</filename> statement says that
+ the kernel understands the machine name as
+ "intel-core2-32".
+ However, the OpenEmbedded build system understands the
+ machine as "core2-32-intel-common".
+ </para>
+
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-KTYPE'><glossterm>KTYPE</glossterm>
+ <info>
+ KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the kernel type to be used in assembling the
+ configuration.
+ The linux-yocto recipes define "standard", "tiny",
+ and "preempt-rt" kernel types.
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#kernel-types'>Kernel Types</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual for more information on kernel types.
+ </para>
+
+ <para>
+ You define the <filename>KTYPE</filename> variable in the
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#bsp-descriptions'>BSP Descriptions</ulink>.
+ The value you use must match the value used for the
+ <link linkend='var-LINUX_KERNEL_TYPE'><filename>LINUX_KERNEL_TYPE</filename></link>
+ value used by the kernel recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-l'><title>L</title>
+
+ <glossentry id='var-LABELS'><glossterm>LABELS</glossterm>
+ <info>
+ LABELS[doc] = "Provides a list of targets for automatic configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Provides a list of targets for automatic configuration.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-grub-efi'><filename>grub-efi</filename></link>
+ class for more information on how this variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERDEPENDS'><glossterm>LAYERDEPENDS</glossterm>
+ <info>
+ LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, on which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the layers, separated by spaces, on which this
+ recipe depends.
+ Optionally, you can specify a specific layer version for a
+ dependency by adding it to the end of the layer name.
+ Here is an example:
+ <literallayout class='monospaced'>
+ LAYERDEPENDS_mylayer = "anotherlayer (=3)"
+ </literallayout>
+ In this previous example, version 3 of "anotherlayer"
+ is compared against
+ <link linkend='var-LAYERVERSION'><filename>LAYERVERSION</filename></link><filename>_anotherlayer</filename>.
+ </para>
+
+ <para>
+ An error is produced if any dependency is missing or
+ the version numbers (if specified) do not match exactly.
+ This variable is used in the
+ <filename>conf/layer.conf</filename> file and must be
+ suffixed with the name of the specific layer (e.g.
+ <filename>LAYERDEPENDS_mylayer</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERDIR'><glossterm>LAYERDIR</glossterm>
+ <info>
+ LAYERDIR[doc] = "When used inside the layer.conf configuration file, this variable provides the path of the current layer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used inside the <filename>layer.conf</filename> configuration
+ file, this variable provides the path of the current layer.
+ This variable is not available outside of <filename>layer.conf</filename>
+ and references are expanded immediately when parsing of the file completes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERRECOMMENDS'><glossterm>LAYERRECOMMENDS</glossterm>
+ <info>
+ LAYERRECOMMENDS[doc] = "Lists the layers, separated by spaces, recommended for use with this layer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the layers, separated by spaces, recommended for
+ use with this layer.
+ </para>
+
+ <para>
+ Optionally, you can specify a specific layer version for a
+ recommendation by adding the version to the end of the
+ layer name.
+ Here is an example:
+ <literallayout class='monospaced'>
+ LAYERRECOMMENDS_mylayer = "anotherlayer (=3)"
+ </literallayout>
+ In this previous example, version 3 of "anotherlayer" is
+ compared against
+ <filename>LAYERVERSION_anotherlayer</filename>.
+ </para>
+
+ <para>
+ This variable is used in the
+ <filename>conf/layer.conf</filename> file and must be
+ suffixed with the name of the specific layer (e.g.
+ <filename>LAYERRECOMMENDS_mylayer</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERSERIES_COMPAT'><glossterm>LAYERSERIES_COMPAT</glossterm>
+ <info>
+ LAYERSERIES_COMPAT[doc] = "Lists the OpenEmbedded-Core versions for which a layer is compatible."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists the versions of the
+ <link linkend='oe-core'>OpenEmbedded-Core</link> for which
+ a layer is compatible.
+ Using the <filename>LAYERSERIES_COMPAT</filename> variable
+ allows the layer maintainer to indicate which combinations
+ of the layer and OE-Core can be expected to work.
+ The variable gives the system a way to detect when a layer
+ has not been tested with new releases of OE-Core (e.g.
+ the layer is not maintained).
+ </para>
+
+ <para>
+ To specify the OE-Core versions for which a layer is
+ compatible, use this variable in your layer's
+ <filename>conf/layer.conf</filename> configuration file.
+ For the list, use the Yocto Project
+ <ulink url='https://wiki.yoctoproject.org/wiki/Releases'>Release Name</ulink>
+ (e.g. &DISTRO_NAME_NO_CAP;).
+ To specify multiple OE-Core versions for the layer,
+ use a space-separated list:
+ <literallayout class='monospaced'>
+ LAYERSERIES_COMPAT_<replaceable>layer_root_name</replaceable> = "&DISTRO_NAME_NO_CAP; &DISTRO_NAME_NO_CAP_MINUS_ONE;"
+ </literallayout>
+ <note>
+ Setting <filename>LAYERSERIES_COMPAT</filename> is
+ required by the Yocto Project Compatible version 2
+ standard.
+ The OpenEmbedded build system produces a warning if
+ the variable is not set for any given layer.
+ </note>
+ </para>
+
+ <para>
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-your-own-layer'>Creating Your Own Layer</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LAYERVERSION'><glossterm>LAYERVERSION</glossterm>
+ <info>
+ LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Optionally specifies the version of a layer as a single number.
+ You can use this within
+ <link linkend='var-LAYERDEPENDS'><filename>LAYERDEPENDS</filename></link>
+ for another layer in order to depend on a specific version
+ of the layer.
+ This variable is used in the <filename>conf/layer.conf</filename> file
+ and must be suffixed with the name of the specific layer (e.g.
+ <filename>LAYERVERSION_mylayer</filename>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LD'><glossterm>LD</glossterm>
+ <info>
+ LD[doc] = "Minimal command and arguments to run the linker."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments used to run the
+ linker.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LDFLAGS'><glossterm>LDFLAGS</glossterm>
+ <info>
+ LDFLAGS[doc] = "Specifies the flags to pass to the linker."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the linker.
+ This variable is exported to an environment
+ variable and thus made visible to the software being
+ built during the compilation step.
+ </para>
+
+ <para>
+ Default initialization for <filename>LDFLAGS</filename>
+ varies depending on what is being built:
+ <itemizedlist>
+ <listitem><para>
+ <link linkend='var-TARGET_LDFLAGS'><filename>TARGET_LDFLAGS</filename></link>
+ when building for the target
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILD_LDFLAGS'><filename>BUILD_LDFLAGS</filename></link>
+ when building for the build host (i.e.
+ <filename>-native</filename>)
+ </para></listitem>
+ <listitem><para>
+ <link linkend='var-BUILDSDK_LDFLAGS'><filename>BUILDSDK_LDFLAGS</filename></link>
+ when building for an SDK (i.e.
+ <filename>nativesdk-</filename>)
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LEAD_SONAME'><glossterm>LEAD_SONAME</glossterm>
+ <info>
+ LEAD_SONAME[doc] = "Specifies the lead (or primary) compiled library file (i.e. .so) that the debian class applies its naming policy to given a recipe that packages multiple libraries."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the lead (or primary) compiled library file
+ (i.e. <filename>.so</filename>) that the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class applies its naming policy to given a recipe that
+ packages multiple libraries.
+ </para>
+
+ <para>
+ This variable works in conjunction with the
+ <filename>debian</filename> class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LIC_FILES_CHKSUM'><glossterm>LIC_FILES_CHKSUM</glossterm>
+ <info>
+ LIC_FILES_CHKSUM[doc] = "Checksums of the license text in the recipe source code."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Checksums of the license text in the recipe source code.
+ </para>
+
+ <para>
+ This variable tracks changes in license text of the source
+ code files.
+ If the license text is changed, it will trigger a build
+ failure, which gives the developer an opportunity to review any
+ license change.
+ </para>
+
+ <para>
+ This variable must be defined for all recipes (unless
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ is set to "CLOSED").</para>
+ <para>For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#usingpoky-configuring-LIC_FILES_CHKSUM'>Tracking License Changes</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE'><glossterm>LICENSE</glossterm>
+ <info>
+ LICENSE[doc] = "The list of source licenses for the recipe. The logical operators &amp;, '|', and parentheses can be used."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of source licenses for the recipe.
+ Follow these rules:
+ <itemizedlist>
+ <listitem><para>Do not use spaces within individual
+ license names.</para></listitem>
+ <listitem><para>Separate license names using
+ | (pipe) when there is a choice between licenses.
+ </para></listitem>
+ <listitem><para>Separate license names using
+ &amp; (ampersand) when multiple licenses exist
+ that cover different parts of the source.
+ </para></listitem>
+ <listitem><para>You can use spaces between license
+ names.</para></listitem>
+ <listitem><para>For standard licenses, use the names
+ of the files in
+ <filename>meta/files/common-licenses/</filename>
+ or the
+ <link linkend='var-SPDXLICENSEMAP'><filename>SPDXLICENSEMAP</filename></link>
+ flag names defined in
+ <filename>meta/conf/licenses.conf</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Here are some examples:
+ <literallayout class='monospaced'>
+ LICENSE = "LGPLv2.1 | GPLv3"
+ LICENSE = "MPL-1 &amp; LGPLv2.1"
+ LICENSE = "GPLv2+"
+ </literallayout>
+ The first example is from the recipes for Qt, which the user
+ may choose to distribute under either the LGPL version
+ 2.1 or GPL version 3.
+ The second example is from Cairo where two licenses cover
+ different parts of the source code.
+ The final example is from <filename>sysstat</filename>,
+ which presents a single license.
+ </para>
+
+ <para>
+ You can also specify licenses on a per-package basis to
+ handle situations where components of the output have
+ different licenses.
+ For example, a piece of software whose code is
+ licensed under GPLv2 but has accompanying documentation
+ licensed under the GNU Free Documentation License 1.2 could
+ be specified as follows:
+ <literallayout class='monospaced'>
+ LICENSE = "GFDL-1.2 &amp; GPLv2"
+ LICENSE_${PN} = "GPLv2"
+ LICENSE_${PN}-doc = "GFDL-1.2"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE_CREATE_PACKAGE'><glossterm>LICENSE_CREATE_PACKAGE</glossterm>
+ <info>
+ LICENSE_CREATE_PACKAGE[doc] = "Creates an extra package (i.e. ${PN}-lic) for each recipe and adds that package to the RRECOMMENDS+${PN}."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Setting <filename>LICENSE_CREATE_PACKAGE</filename>
+ to "1" causes the OpenEmbedded build system to create
+ an extra package (i.e.
+ <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-lic</filename>)
+ for each recipe and to add those packages to the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link><filename>_${PN}</filename>.
+ </para>
+
+ <para>
+ The <filename>${PN}-lic</filename> package installs a
+ directory in <filename>/usr/share/licenses</filename>
+ named <filename>${PN}</filename>, which is the recipe's
+ base name, and installs files in that directory that
+ contain license and copyright information (i.e. copies of
+ the appropriate license files from
+ <filename>meta/common-licenses</filename> that match the
+ licenses specified in the
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ variable of the recipe metadata and copies of files marked
+ in
+ <link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>
+ as containing license text).
+ </para>
+
+ <para>
+ For related information on providing license text, see the
+ <link linkend='var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></link>
+ variable, the
+ <link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link>
+ variable, and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE_FLAGS'><glossterm>LICENSE_FLAGS</glossterm>
+ <info>
+ LICENSE_FLAGS[doc] = "Specifies additional flags for a recipe you must whitelist through LICENSE_FLAGS_WHITELIST in order to allow the recipe to be built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies additional flags for a recipe you must
+ whitelist through
+ <link linkend='var-LICENSE_FLAGS_WHITELIST'><filename>LICENSE_FLAGS_WHITELIST</filename></link>
+ in order to allow the recipe to be built.
+ When providing multiple flags, separate them with
+ spaces.
+ </para>
+
+ <para>
+ This value is independent of
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ and is typically used to mark recipes that might
+ require additional licenses in order to be used in a
+ commercial product.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE_FLAGS_WHITELIST'><glossterm>LICENSE_FLAGS_WHITELIST</glossterm>
+ <info>
+ LICENSE_FLAGS_WHITELIST[doc] = "Lists license flags that when specified in LICENSE_FLAGS within a recipe should not prevent that recipe from being built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists license flags that when specified in
+ <link linkend='var-LICENSE_FLAGS'><filename>LICENSE_FLAGS</filename></link>
+ within a recipe should not prevent that recipe from being
+ built.
+ This practice is otherwise known as "whitelisting"
+ license flags.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#enabling-commercially-licensed-recipes'>Enabling Commercially Licensed Recipes</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LICENSE_PATH'><glossterm>LICENSE_PATH</glossterm>
+ <info>
+ LICENSE_PATH[doc] = "Path to additional licenses used during the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Path to additional licenses used during the build.
+ By default, the OpenEmbedded build system uses <filename>COMMON_LICENSE_DIR</filename>
+ to define the directory that holds common license text used during the build.
+ The <filename>LICENSE_PATH</filename> variable allows you to extend that
+ location to other areas that have additional licenses:
+ <literallayout class='monospaced'>
+ LICENSE_PATH += "<replaceable>path-to-additional-common-licenses</replaceable>"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LINUX_KERNEL_TYPE'><glossterm>LINUX_KERNEL_TYPE</glossterm>
+ <info>
+ LINUX_KERNEL_TYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the kernel type to be used in assembling the
+ configuration.
+ The linux-yocto recipes define "standard", "tiny", and
+ "preempt-rt" kernel types.
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#kernel-types'>Kernel Types</ulink>"
+ section in the Yocto Project Linux Kernel Development
+ Manual for more information on kernel types.
+ </para>
+
+ <para>
+ If you do not specify a
+ <filename>LINUX_KERNEL_TYPE</filename>, it defaults to
+ "standard".
+ Together with
+ <link linkend='var-KMACHINE'><filename>KMACHINE</filename></link>,
+ the <filename>LINUX_KERNEL_TYPE</filename> variable
+ defines the search
+ arguments used by the kernel tools to find the appropriate
+ description within the kernel
+ <link linkend='metadata'>Metadata</link>
+ with which to build out the sources and configuration.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LINUX_VERSION'><glossterm>LINUX_VERSION</glossterm>
+ <info>
+ LINUX_VERSION[doc] = "The Linux version from kernel.org on which the Linux kernel image being built using the OpenEmbedded build system is based. You define this variable in the kernel recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The Linux version from <filename>kernel.org</filename>
+ on which the Linux kernel image being built using the
+ OpenEmbedded build system is based.
+ You define this variable in the kernel recipe.
+ For example, the <filename>linux-yocto-3.4.bb</filename>
+ kernel recipe found in
+ <filename>meta/recipes-kernel/linux</filename>
+ defines the variables as follows:
+ <literallayout class='monospaced'>
+ LINUX_VERSION ?= "3.4.24"
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>LINUX_VERSION</filename> variable is used to
+ define <link linkend='var-PV'><filename>PV</filename></link>
+ for the recipe:
+ <literallayout class='monospaced'>
+ PV = "${LINUX_VERSION}+git${SRCPV}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LINUX_VERSION_EXTENSION'><glossterm>LINUX_VERSION_EXTENSION</glossterm>
+ <info>
+ LINUX_VERSION_EXTENSION[doc] = "A string extension compiled into the version string of the Linux kernel built with the OpenEmbedded build system. You define this variable in the kernel recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A string extension compiled into the version
+ string of the Linux kernel built with the OpenEmbedded
+ build system.
+ You define this variable in the kernel recipe.
+ For example, the linux-yocto kernel recipes all define
+ the variable as follows:
+ <literallayout class='monospaced'>
+ LINUX_VERSION_EXTENSION ?= "-yocto-${<link linkend='var-LINUX_KERNEL_TYPE'>LINUX_KERNEL_TYPE</link>}"
+ </literallayout>
+ </para>
+
+ <para>
+ Defining this variable essentially sets the
+ Linux kernel configuration item
+ <filename>CONFIG_LOCALVERSION</filename>, which is visible
+ through the <filename>uname</filename> command.
+ Here is an example that shows the extension assuming it
+ was set as previously shown:
+ <literallayout class='monospaced'>
+ $ uname -r
+ 3.7.0-rc8-custom
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-LOG_DIR'><glossterm>LOG_DIR</glossterm>
+ <info>
+ LOG_DIR[doc] = "Specifies the directory to which the OpenEmbedded build system writes overall log files. The default directory is ${TMPDIR}/log"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the directory to which the OpenEmbedded build
+ system writes overall log files.
+ The default directory is <filename>${TMPDIR}/log</filename>.
+ </para>
+
+ <para>
+ For the directory containing logs specific to each task,
+ see the <link linkend='var-T'><filename>T</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-m'><title>M</title>
+
+ <glossentry id='var-MACHINE'><glossterm>MACHINE</glossterm>
+ <info>
+ MACHINE[doc] = "Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the target device for which the image is built.
+ You define <filename>MACHINE</filename> in the
+ <filename>local.conf</filename> file found in the
+ <link linkend='build-directory'>Build Directory</link>.
+ By default, <filename>MACHINE</filename> is set to
+ "qemux86", which is an x86-based architecture machine to
+ be emulated using QEMU:
+ <literallayout class='monospaced'>
+ MACHINE ?= "qemux86"
+ </literallayout>
+ </para>
+
+ <para>
+ The variable corresponds to a machine configuration file of the
+ same name, through which machine-specific configurations are set.
+ Thus, when <filename>MACHINE</filename> is set to "qemux86" there
+ exists the corresponding <filename>qemux86.conf</filename> machine
+ configuration file, which can be found in the
+ <link linkend='source-directory'>Source Directory</link>
+ in <filename>meta/conf/machine</filename>.
+ </para>
+
+ <para>
+ The list of machines supported by the Yocto Project as
+ shipped include the following:
+ <literallayout class='monospaced'>
+ MACHINE ?= "qemuarm"
+ MACHINE ?= "qemuarm64"
+ MACHINE ?= "qemumips"
+ MACHINE ?= "qemumips64"
+ MACHINE ?= "qemuppc"
+ MACHINE ?= "qemux86"
+ MACHINE ?= "qemux86-64"
+ MACHINE ?= "genericx86"
+ MACHINE ?= "genericx86-64"
+ MACHINE ?= "beaglebone"
+ MACHINE ?= "mpc8315e-rdb"
+ MACHINE ?= "edgerouter"
+ </literallayout>
+ The last five are Yocto Project reference hardware boards, which
+ are provided in the <filename>meta-yocto-bsp</filename> layer.
+ <note>Adding additional Board Support Package (BSP) layers
+ to your configuration adds new possible settings for
+ <filename>MACHINE</filename>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_ARCH'><glossterm>MACHINE_ARCH</glossterm>
+ <info>
+ MACHINE_ARCH[doc] = "Specifies the name of the machine-specific architecture. This variable is set automatically from MACHINE or TUNE_PKGARCH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the machine-specific architecture.
+ This variable is set automatically from
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>
+ or
+ <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>.
+ You should not hand-edit the
+ <filename>MACHINE_ARCH</filename> variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</glossterm>
+ <info>
+ MACHINE_ESSENTIAL_EXTRA_RDEPENDS[doc] = "A list of required machine-specific packages to install as part of the image being built. Because this is a 'machine-essential' variable, the list of packages are essential for the machine to boot."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of required machine-specific packages to install as part of
+ the image being built.
+ The build process depends on these packages being present.
+ Furthermore, because this is a "machine-essential" variable, the list of
+ packages are essential for the machine to boot.
+ The impact of this variable affects images based on
+ <filename>packagegroup-core-boot</filename>,
+ including the <filename>core-image-minimal</filename> image.
+ </para>
+
+ <para>
+ This variable is similar to the
+ <filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link></filename>
+ variable with the exception that the image being built has a build
+ dependency on the variable's list of packages.
+ In other words, the image will not build if a file in this list is not found.
+ </para>
+
+ <para>
+ As an example, suppose the machine for which you are building requires
+ <filename>example-init</filename> to be run during boot to initialize the hardware.
+ In this case, you would use the following in the machine's
+ <filename>.conf</filename> configuration file:
+ <literallayout class='monospaced'>
+ MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "example-init"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><glossterm>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</glossterm>
+ <info>
+ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS[doc] = "A list of recommended machine-specific packages to install as part of the image being built. Because this is a 'machine-essential' variable, the list of packages are essential for the machine to boot."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recommended machine-specific packages to install as part of
+ the image being built.
+ The build process does not depend on these packages being present.
+ However, because this is a "machine-essential" variable, the list of
+ packages are essential for the machine to boot.
+ The impact of this variable affects images based on
+ <filename>packagegroup-core-boot</filename>,
+ including the <filename>core-image-minimal</filename> image.
+ </para>
+
+ <para>
+ This variable is similar to the
+ <filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS</link></filename>
+ variable with the exception that the image being built does not have a build
+ dependency on the variable's list of packages.
+ In other words, the image will still build if a package in this list is not found.
+ Typically, this variable is used to handle essential kernel modules, whose
+ functionality may be selected to be built into the kernel rather than as a module,
+ in which case a package will not be produced.
+ </para>
+
+ <para>
+ Consider an example where you have a custom kernel where a specific touchscreen
+ driver is required for the machine to be usable.
+ However, the driver can be built as a module or
+ into the kernel depending on the kernel configuration.
+ If the driver is built as a module, you want it to be installed.
+ But, when the driver is built into the kernel, you still want the
+ build to succeed.
+ This variable sets up a "recommends" relationship so that in the latter case,
+ the build will not fail due to the missing package.
+ To accomplish this, assuming the package for the module was called
+ <filename>kernel-module-ab123</filename>, you would use the
+ following in the machine's <filename>.conf</filename> configuration
+ file:
+ <literallayout class='monospaced'>
+ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-module-ab123"
+ </literallayout>
+ <note>
+ In this example, the
+ <filename>kernel-module-ab123</filename> recipe
+ needs to explicitly set its
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ variable to ensure that BitBake does not use the
+ kernel recipe's
+ <link linkend='var-PACKAGES_DYNAMIC'><filename>PACKAGES_DYNAMIC</filename></link>
+ variable to satisfy the dependency.
+ </note>
+ </para>
+
+ <para>
+ Some examples of these machine essentials are flash, screen, keyboard, mouse,
+ or touchscreen drivers (depending on the machine).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_EXTRA_RDEPENDS'><glossterm>MACHINE_EXTRA_RDEPENDS</glossterm>
+ <info>
+ MACHINE_EXTRA_RDEPENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for the machine to boot. However, the build process for more fully-featured images depends on the packages being present."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of machine-specific packages to install as part of the
+ image being built that are not essential for the machine to boot.
+ However, the build process for more fully-featured images
+ depends on the packages being present.
+ </para>
+
+ <para>
+ This variable affects all images based on
+ <filename>packagegroup-base</filename>, which does not include the
+ <filename>core-image-minimal</filename> or <filename>core-image-full-cmdline</filename>
+ images.
+ </para>
+
+ <para>
+ The variable is similar to the
+ <filename><link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS</link></filename>
+ variable with the exception that the image being built has a build
+ dependency on the variable's list of packages.
+ In other words, the image will not build if a file in this list is not found.
+ </para>
+
+ <para>
+ An example is a machine that has WiFi capability but is not
+ essential for the machine to boot the image.
+ However, if you are building a more fully-featured image, you want to enable
+ the WiFi.
+ The package containing the firmware for the WiFi hardware is always
+ expected to exist, so it is acceptable for the build process to depend upon
+ finding the package.
+ In this case, assuming the package for the firmware was called
+ <filename>wifidriver-firmware</filename>, you would use the following in the
+ <filename>.conf</filename> file for the machine:
+ <literallayout class='monospaced'>
+ MACHINE_EXTRA_RDEPENDS += "wifidriver-firmware"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_EXTRA_RRECOMMENDS'><glossterm>MACHINE_EXTRA_RRECOMMENDS</glossterm>
+ <info>
+ MACHINE_EXTRA_RRECOMMENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for booting the machine. The image being built has no build dependencies on the packages in this list."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of machine-specific packages to install as part of the
+ image being built that are not essential for booting the machine.
+ The image being built has no build dependency on this list of packages.
+ </para>
+
+ <para>
+ This variable affects only images based on
+ <filename>packagegroup-base</filename>, which does not include the
+ <filename>core-image-minimal</filename> or <filename>core-image-full-cmdline</filename>
+ images.
+ </para>
+
+ <para>
+ This variable is similar to the
+ <filename><link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS</link></filename>
+ variable with the exception that the image being built does not have a build
+ dependency on the variable's list of packages.
+ In other words, the image will build if a file in this list is not found.
+ </para>
+
+ <para>
+ An example is a machine that has WiFi capability but is not essential
+ For the machine to boot the image.
+ However, if you are building a more fully-featured image, you want to enable
+ WiFi.
+ In this case, the package containing the WiFi kernel module will not be produced
+ if the WiFi driver is built into the kernel, in which case you still want the
+ build to succeed instead of failing as a result of the package not being found.
+ To accomplish this, assuming the package for the module was called
+ <filename>kernel-module-examplewifi</filename>, you would use the
+ following in the <filename>.conf</filename> file for the machine:
+ <literallayout class='monospaced'>
+ MACHINE_EXTRA_RRECOMMENDS += "kernel-module-examplewifi"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_FEATURES'><glossterm>MACHINE_FEATURES</glossterm>
+ <info>
+ MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE supports."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the list of hardware features the
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link> is capable
+ of supporting.
+ For related information on enabling features, see the
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>,
+ <link linkend='var-COMBINED_FEATURES'><filename>COMBINED_FEATURES</filename></link>,
+ and
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ variables.
+ </para>
+
+ <para>
+ For a list of hardware features supported by the Yocto
+ Project as shipped, see the
+ "<link linkend='ref-features-machine'>Machine Features</link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_FEATURES_BACKFILL'><glossterm>MACHINE_FEATURES_BACKFILL</glossterm>
+ <info>
+ MACHINE_FEATURES_BACKFILL[doc] = "Features to be added to MACHINE_FEATURES if not also present in MACHINE_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and is not intended to be user-configurable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Features to be added to
+ <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename>
+ if not also present in
+ <filename><link linkend='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'>MACHINE_FEATURES_BACKFILL_CONSIDERED</link></filename>.
+ </para>
+
+ <para>
+ This variable is set in the <filename>meta/conf/bitbake.conf</filename> file.
+ It is not intended to be user-configurable.
+ It is best to just reference the variable to see which machine features are
+ being backfilled for all machine configurations.
+ See the "<link linkend='ref-features-backfill'>Feature Backfilling</link>" section for
+ more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINE_FEATURES_BACKFILL_CONSIDERED'><glossterm>MACHINE_FEATURES_BACKFILL_CONSIDERED</glossterm>
+ <info>
+ MACHINE_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from MACHINE_FEATURES_BACKFILL that should not be backfilled (i.e. added to MACHINE_FEATURES) during the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Features from
+ <filename><link linkend='var-MACHINE_FEATURES_BACKFILL'>MACHINE_FEATURES_BACKFILL</link></filename>
+ that should not be backfilled (i.e. added to
+ <filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link></filename>)
+ during the build.
+ See the "<link linkend='ref-features-backfill'>Feature Backfilling</link>" section for
+ more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MACHINEOVERRIDES'><glossterm>MACHINEOVERRIDES</glossterm>
+ <info>
+ MACHINEOVERRIDES[doc] = "A colon-separated list of overrides that apply to the current machine."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A colon-separated list of overrides that apply to the
+ current machine.
+ By default, this list includes the value of
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>.
+ </para>
+
+ <para>
+ You can extend <filename>MACHINEOVERRIDES</filename>
+ to add extra overrides that should apply to a machine.
+ For example, all machines emulated in QEMU (e.g.
+ <filename>qemuarm</filename>, <filename>qemux86</filename>,
+ and so forth) include a file named
+ <filename>meta/conf/machine/include/qemu.inc</filename>
+ that prepends the following override to
+ <filename>MACHINEOVERRIDES</filename>:
+ <literallayout class='monospaced'>
+ MACHINEOVERRIDES =. "qemuall:"
+ </literallayout>
+ This override allows variables to be overriden for all
+ machines emulated in QEMU, like in the following example
+ from the <filename>connman-conf</filename> recipe:
+ <literallayout class='monospaced'>
+ SRC_URI_append_qemuall = "file://wired.config \
+ file://wired-setup \
+ "
+ </literallayout>
+ The underlying mechanism behind
+ <filename>MACHINEOVERRIDES</filename> is simply that it is
+ included in the default value of
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MAINTAINER'><glossterm>MAINTAINER</glossterm>
+ <info>
+ MAINTAINER[doc] = "The email address of the distribution maintainer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The email address of the distribution maintainer.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MIRRORS'><glossterm>MIRRORS</glossterm>
+ <info>
+ MIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies additional paths from which the OpenEmbedded
+ build system gets source code.
+ When the build system searches for source code, it first
+ tries the local download directory.
+ If that location fails, the build system tries locations
+ defined by
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>,
+ the upstream source, and then locations specified by
+ <filename>MIRRORS</filename> in that order.
+ </para>
+
+ <para>
+ Assuming your distribution
+ (<link linkend='var-DISTRO'><filename>DISTRO</filename></link>)
+ is "poky", the default value for
+ <filename>MIRRORS</filename> is defined in the
+ <filename>conf/distro/poky.conf</filename> file in the
+ <filename>meta-poky</filename> Git repository.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MLPREFIX'><glossterm>MLPREFIX</glossterm>
+ <info>
+ MLPREFIX[doc] = "Specifies a prefix has been added to PN to create a special version of a recipe or package (i.e. a Multilib version)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a prefix has been added to
+ <link linkend='var-PN'><filename>PN</filename></link> to create a special version
+ of a recipe or package (i.e. a Multilib version).
+ The variable is used in places where the prefix needs to be
+ added to or removed from a the name (e.g. the
+ <link linkend='var-BPN'><filename>BPN</filename></link> variable).
+ <filename>MLPREFIX</filename> gets set when a prefix has been
+ added to <filename>PN</filename>.
+ <note>
+ The "ML" in <filename>MLPREFIX</filename> stands for
+ "MultiLib".
+ This representation is historical and comes from
+ a time when <filename>nativesdk</filename> was a suffix
+ rather than a prefix on the recipe name.
+ When <filename>nativesdk</filename> was turned into a
+ prefix, it made sense to set
+ <filename>MLPREFIX</filename> for it as well.
+ </note>
+ </para>
+
+ <para>
+ To help understand when <filename>MLPREFIX</filename>
+ might be needed, consider when
+ <link linkend='var-BBCLASSEXTEND'><filename>BBCLASSEXTEND</filename></link>
+ is used to provide a <filename>nativesdk</filename> version
+ of a recipe in addition to the target version.
+ If that recipe declares build-time dependencies on tasks in
+ other recipes by using
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>,
+ then a dependency on "foo" will automatically get rewritten
+ to a dependency on "nativesdk-foo".
+ However, dependencies like the following will not get
+ rewritten automatically:
+ <literallayout class='monospaced'>
+ do_foo[depends] += "<replaceable>recipe</replaceable>:do_foo"
+ </literallayout>
+ If you want such a dependency to also get transformed,
+ you can do the following:
+ <literallayout class='monospaced'>
+ do_foo[depends] += "${MLPREFIX}<replaceable>recipe</replaceable>:do_foo"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-module_autoload'><glossterm>module_autoload</glossterm>
+ <info>
+ module_autoload[doc] = "This variable has been replaced by the KERNEL_MODULE_AUTOLOAD variable. You should replace all occurrences of module_autoload with additions to KERNEL_MODULE_AUTOLOAD."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable has been replaced by the
+ <filename>KERNEL_MODULE_AUTOLOAD</filename> variable.
+ You should replace all occurrences of
+ <filename>module_autoload</filename> with additions to
+ <filename>KERNEL_MODULE_AUTOLOAD</filename>, for example:
+ <literallayout class='monospaced'>
+ module_autoload_rfcomm = "rfcomm"
+ </literallayout>
+ </para>
+
+ <para>
+ should now be replaced with:
+ <literallayout class='monospaced'>
+ KERNEL_MODULE_AUTOLOAD += "rfcomm"
+ </literallayout>
+ See the
+ <link linkend='var-KERNEL_MODULE_AUTOLOAD'><filename>KERNEL_MODULE_AUTOLOAD</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-module_conf'><glossterm>module_conf</glossterm>
+ <info>
+ module_conf[doc] = "Specifies modprobe.d syntax lines for inclusion in the /etc/modprobe.d/modname.conf file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies
+ <ulink url='http://linux.die.net/man/5/modprobe.d'><filename>modprobe.d</filename></ulink>
+ syntax lines for inclusion in the
+ <filename>/etc/modprobe.d/modname.conf</filename> file.
+ </para>
+
+ <para>
+ You can use this variable anywhere that it can be
+ recognized by the kernel recipe or out-of-tree kernel
+ module recipe (e.g. a machine configuration file, a
+ distribution configuration file, an append file for the
+ recipe, or the recipe itself).
+ If you use this variable, you must also be sure to list
+ the module name in the
+ <link linkend='var-KERNEL_MODULE_AUTOLOAD'><filename>KERNEL_MODULE_AUTOLOAD</filename></link>
+ variable.
+ </para>
+
+ <para>
+ Here is the general syntax:
+ <literallayout class='monospaced'>
+ module_conf_<replaceable>module_name</replaceable> = "<replaceable>modprobe.d-syntax</replaceable>"
+ </literallayout>
+ You must use the kernel module name override.
+ </para>
+
+ <para>
+ Run <filename>man modprobe.d</filename> in the shell to
+ find out more information on the exact syntax
+ you want to provide with <filename>module_conf</filename>.
+ </para>
+
+ <para>
+ Including <filename>module_conf</filename> causes the
+ OpenEmbedded build system to populate the
+ <filename>/etc/modprobe.d/modname.conf</filename>
+ file with <filename>modprobe.d</filename> syntax lines.
+ Here is an example that adds the options
+ <filename>arg1</filename> and <filename>arg2</filename>
+ to a module named <filename>mymodule</filename>:
+ <literallayout class='monospaced'>
+ module_conf_mymodule = "options mymodule arg1=val1 arg2=val2"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on how to specify kernel modules to
+ auto-load on boot, see the
+ <link linkend='var-KERNEL_MODULE_AUTOLOAD'><filename>KERNEL_MODULE_AUTOLOAD</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MODULE_IMAGE_BASE_NAME'><glossterm>MODULE_IMAGE_BASE_NAME</glossterm>
+ <info>
+ MODULE_IMAGE_BASE_NAME[doc] = "The base name of the kernel modules tarball."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The base name of the kernel modules tarball.
+ This variable is set in the
+ <link linkend='ref-classes-kernel'>kernel</link> class
+ as follows:
+ <literallayout class='monospaced'>
+ MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+ </literallayout>
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-PKGE'><filename>PKGE</filename></link>,
+ <link linkend='var-PKGV'><filename>PKGV</filename></link>,
+ <link linkend='var-PKGR'><filename>PKGR</filename></link>,
+ <link linkend='var-MACHINE'><filename>MACHINE</filename></link>,
+ and
+ <link linkend='var-DATETIME'><filename>DATETIME</filename></link>
+ variables for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-MODULE_TARBALL_DEPLOY'><glossterm>MODULE_TARBALL_DEPLOY</glossterm>
+ <info>
+ MODULE_TARBALL_DEPLOY[doc] = "Controls creation of the modules-*.tgz file. Set this variable to "0" to disable creation of this file, which contains all of the kernel modules resulting from a kernel build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Controls creation of the <filename>modules-*.tgz</filename>
+ file.
+ Set this variable to "0" to disable creation of this
+ file, which contains all of the kernel modules resulting
+ from a kernel build.
+ </para>
+ </glossdef>
+ </glossentry>
+
+<!--
+ <glossentry id='var-MULTIMACH_HOST_SYS'><glossterm>MULTIMACH_HOST_SYS</glossterm>
+ <info>
+ MULTIMACH_HOST_SYS[doc] = "Separates files for different machines such that you can build for multiple host machines using the same output directories."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+-->
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+<!--
+ Serves the same purpose as
+ <link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>,
+ but for the "HOST" system, in situations that involve a
+ "HOST" and a "TARGET" system.
+ See the
+ <link linkend='var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></link>
+ variable for more information.
+ </para>
+
+ <para>
+ The default value of this variable is:
+ <literallayout class='monospaced'>
+ ${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+-->
+
+ <glossentry id='var-MULTIMACH_TARGET_SYS'><glossterm>MULTIMACH_TARGET_SYS</glossterm>
+ <info>
+ MULTIMACH_TARGET_SYS[doc] = "Separates files for different machines such that you can build for multiple target machines using the same output directories."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Uniquely identifies the type of the target system for
+ which packages are being built.
+ This variable allows output for different types of target
+ systems to be put into different subdirectories of the same
+ output directory.
+ </para>
+
+ <para>
+ The default value of this variable is:
+ <literallayout class='monospaced'>
+ ${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}
+ </literallayout>
+ Some classes (e.g.
+ <link linkend='ref-classes-cross-canadian'><filename>cross-canadian</filename></link>)
+ modify the <filename>MULTIMACH_TARGET_SYS</filename> value.
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-STAMP'><filename>STAMP</filename></link>
+ variable for an example.
+ See the
+ <link linkend='var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-n'><title>N</title>
+
+ <glossentry id='var-NATIVELSBSTRING'><glossterm>NATIVELSBSTRING</glossterm>
+ <info>
+ NATIVELSBSTRING[doc] = "A string identifying the host distribution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A string identifying the host distribution.
+ Strings consist of the host distributor ID
+ followed by the release, as reported by the
+ <filename>lsb_release</filename> tool
+ or as read from <filename>/etc/lsb-release</filename>.
+ For example, when running a build on Ubuntu 12.10, the value
+ is "Ubuntu-12.10".
+ If this information is unable to be determined, the value
+ resolves to "Unknown".
+ </para>
+
+ <para>
+ This variable is used by default to isolate native shared
+ state packages for different distributions (e.g. to avoid
+ problems with <filename>glibc</filename> version
+ incompatibilities).
+ Additionally, the variable is checked against
+ <link linkend='var-SANITY_TESTED_DISTROS'><filename>SANITY_TESTED_DISTROS</filename></link>
+ if that variable is set.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-NM'><glossterm>NM</glossterm>
+ <info>
+ NM[doc] = "Minimal command and arguments to run 'nm'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run
+ <filename>nm</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-NO_RECOMMENDATIONS'><glossterm>NO_RECOMMENDATIONS</glossterm>
+ <info>
+ NO_RECOMMENDATIONS[doc] = "When set to '1', no recommended packages will be installed. Some recommended packages might be required for certain system functionality, such as kernel-modules. It is up to the user to add packages to IMAGE_INSTALL as needed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Prevents installation of all "recommended-only" packages.
+ Recommended-only packages are packages installed only
+ through the
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ variable).
+ Setting the <filename>NO_RECOMMENDATIONS</filename> variable
+ to "1" turns this feature on:
+ <literallayout class='monospaced'>
+ NO_RECOMMENDATIONS = "1"
+ </literallayout>
+ </para>
+
+ <para>
+ You can set this variable globally in your
+ <filename>local.conf</filename> file or you can attach it to
+ a specific image recipe by using the recipe name override:
+ <literallayout class='monospaced'>
+ NO_RECOMMENDATIONS_pn-<replaceable>target_image</replaceable> = "1"
+ </literallayout>
+ </para>
+
+ <para>
+ It is important to realize that if you choose to not install
+ packages using this variable and some other packages are
+ dependent on them (i.e. listed in a recipe's
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable), the OpenEmbedded build system ignores your
+ request and will install the packages to avoid dependency
+ errors.
+ <note>
+ Some recommended packages might be required for certain
+ system functionality, such as kernel modules.
+ It is up to you to add packages with the
+ <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>
+ variable.
+ </note>
+ </para>
+
+ <para>
+ Support for this variable exists only when using the
+ IPK and RPM packaging backend.
+ Support does not exist for DEB.
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>
+ and the
+ <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link>
+ variables for related information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-NOAUTOPACKAGEDEBUG'><glossterm>NOAUTOPACKAGEDEBUG</glossterm>
+ <info>
+ NOAUTOPACKAGEDEBUG[doc] = "Disables auto package from splitting .debug files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Disables auto package from splitting
+ <filename>.debug</filename> files. If a recipe requires
+ <filename>FILES_${PN}-dbg</filename> to be set manually,
+ the <filename>NOAUTOPACKAGEDEBUG</filename> can be defined
+ allowing you to define the content of the debug package.
+ For example:
+ <literallayout class='monospaced'>
+ NOAUTOPACKAGEDEBUG = "1"
+ FILES_${PN}-dev = "${includedir}/${QT_DIR_NAME}/Qt/*"
+ FILES_${PN}-dbg = "/usr/src/debug/"
+ FILES_${QT_BASE_NAME}-demos-doc = "${docdir}/${QT_DIR_NAME}/qch/qt.qch"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-NOHDD'><glossterm>NOHDD</glossterm>
+ <info>
+ NOHDD[doc] = "Causes the OpenEmbedded build system to skip building the .hddimg image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes the OpenEmbedded build system to skip building the
+ <filename>.hddimg</filename> image.
+ The <filename>NOHDD</filename> variable is used with the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class.
+ Set the variable to "1" to prevent the
+ <filename>.hddimg</filename> image from being built.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-NOISO'><glossterm>NOISO</glossterm>
+ <info>
+ NOISO[doc] = "Causes the OpenEmbedded build system to skip building the ISO image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Causes the OpenEmbedded build system to skip building the
+ ISO image.
+ The <filename>NOISO</filename> variable is used with the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class.
+ Set the variable to "1" to prevent the ISO image from
+ being built.
+ To enable building an ISO image, set the variable to "0".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-o'><title>O</title>
+
+ <glossentry id='var-OBJCOPY'><glossterm>OBJCOPY</glossterm>
+ <info>
+ OBJCOPY[doc] = "Minimal command and arguments to run 'objcopy'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run
+ <filename>objcopy</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OBJDUMP'><glossterm>OBJDUMP</glossterm>
+ <info>
+ OBJDUMP[doc] = "Minimal command and arguments to run 'objdump'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run
+ <filename>objdump</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OE_BINCONFIG_EXTRA_MANGLE'><glossterm>OE_BINCONFIG_EXTRA_MANGLE</glossterm>
+ <info>
+ OE_BINCONFIG_EXTRA_MANGLE[doc] = "When a recipe inherits the binconfig.bbclass class, this variable specifies additional arguments passed to the "sed" command."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-binconfig'><filename>binconfig</filename></link>
+ class, this variable
+ specifies additional arguments passed to the "sed" command.
+ The sed command alters any paths in configuration scripts
+ that have been set up during compilation.
+ Inheriting this class results in all paths in these scripts
+ being changed to point into the
+ <filename>sysroots/</filename> directory so that all builds
+ that use the script will use the correct directories
+ for the cross compiling layout.
+ </para>
+
+ <para>
+ See the <filename>meta/classes/binconfig.bbclass</filename>
+ in the
+ <link linkend='source-directory'>Source Directory</link>
+ for details on how this class applies these additional
+ sed command arguments.
+ For general information on the
+ <filename>binconfig</filename> class, see the
+ "<link linkend='ref-classes-binconfig'><filename>binconfig.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OE_IMPORTS'><glossterm>OE_IMPORTS</glossterm>
+ <info>
+ OE_IMPORTS[doc] = "An internal variable used to tell the OpenEmbedded build system what Python modules to import for every Python function run by the system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An internal variable used to tell the OpenEmbedded build
+ system what Python modules to import for every Python
+ function run by the system.
+ </para>
+
+ <note>
+ Do not set this variable.
+ It is for internal use only.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OE_INIT_ENV_SCRIPT'><glossterm>OE_INIT_ENV_SCRIPT</glossterm>
+ <info>
+ OE_INIT_ENV_SCRIPT[doc] = "The name of the build environment setup script for the purposes of setting up the environment within the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The name of the build environment setup script for the
+ purposes of setting up the environment within the
+ extensible SDK.
+ The default value is "oe-init-build-env".
+ </para>
+
+ <para>
+ If you use a custom script to set up your build
+ environment, set the
+ <filename>OE_INIT_ENV_SCRIPT</filename> variable to its
+ name.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OE_TERMINAL'><glossterm>OE_TERMINAL</glossterm>
+ <info>
+ OE_TERMINAL[doc] = "Controls how the OpenEmbedded build system spawns interactive terminals on the host development system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Controls how the OpenEmbedded build system spawns
+ interactive terminals on the host development system
+ (e.g. using the BitBake command with the
+ <filename>-c devshell</filename> command-line option).
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-appdev-devshell'>Using a Development Shell</ulink>" section
+ in the Yocto Project Development Tasks Manual.
+ </para>
+
+ <para>
+ You can use the following values for the
+ <filename>OE_TERMINAL</filename> variable:
+ <literallayout class='monospaced'>
+ auto
+ gnome
+ xfce
+ rxvt
+ screen
+ konsole
+ none
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OEROOT'><glossterm>OEROOT</glossterm>
+ <info>
+ OEROOT[doc] = "The directory from which the top-level build environment setup script is sourced."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory from which the top-level build environment
+ setup script is sourced.
+ The Yocto Project provides a top-level build environment
+ setup script:
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>.
+ When you run this script, the
+ <filename>OEROOT</filename> variable resolves to the
+ directory that contains the script.
+ </para>
+
+ <para>
+ For additional information on how this variable is used,
+ see the initialization script.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OLDEST_KERNEL'><glossterm>OLDEST_KERNEL</glossterm>
+ <info>
+ OLDEST_KERNEL[doc] = "Declares the oldest version of the Linux kernel that the produced binaries must support."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Declares the oldest version of the Linux kernel that the
+ produced binaries must support.
+ This variable is passed into the build of the Embedded
+ GNU C Library (<filename>glibc</filename>).
+ </para>
+
+ <para>
+ The default for this variable comes from the
+ <filename>meta/conf/bitbake.conf</filename> configuration
+ file.
+ You can override this default by setting the variable
+ in a custom distribution configuration file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-OVERRIDES'><glossterm>OVERRIDES</glossterm>
+ <info>
+ OVERRIDES[doc] = "A colon-separated list of overrides that currently apply."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A colon-separated list of overrides that currently apply.
+ Overrides are a BitBake mechanism that allows variables to
+ be selectively overridden at the end of parsing.
+ The set of overrides in <filename>OVERRIDES</filename>
+ represents the "state" during building, which includes
+ the current recipe being built, the machine for which
+ it is being built, and so forth.
+ </para>
+
+ <para>
+ As an example, if the string "an-override" appears as an
+ element in the colon-separated list in
+ <filename>OVERRIDES</filename>, then the following
+ assignment will override <filename>FOO</filename> with the
+ value "overridden" at the end of parsing:
+ <literallayout class='monospaced'>
+ FOO_an-override = "overridden"
+ </literallayout>
+ See the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#conditional-syntax-overrides'>Conditional Syntax (Overrides)</ulink>"
+ section in the BitBake User Manual for more information on
+ the overrides mechanism.
+ </para>
+
+ <para>
+ The default value of <filename>OVERRIDES</filename>
+ includes the values of the
+ <link linkend='var-CLASSOVERRIDE'><filename>CLASSOVERRIDE</filename></link>,
+ <link linkend='var-MACHINEOVERRIDES'><filename>MACHINEOVERRIDES</filename></link>,
+ and
+ <link linkend='var-DISTROOVERRIDES'><filename>DISTROOVERRIDES</filename></link>
+ variables.
+ Another important override included by default is
+ <filename>pn-${PN}</filename>.
+ This override allows variables to be set for a single
+ recipe within configuration (<filename>.conf</filename>)
+ files.
+ Here is an example:
+ <literallayout class='monospaced'>
+ FOO_pn-myrecipe = "myrecipe-specific value"
+ </literallayout>
+ <note><title>Tip</title>
+ An easy way to see what overrides apply is to search for
+ <filename>OVERRIDES</filename> in the output of the
+ <filename>bitbake -e</filename> command.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-debugging-viewing-variable-values'>Viewing Variable Values</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual for more information.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+ </glossdiv>
+
+ <glossdiv id='var-glossary-p'><title>P</title>
+
+ <glossentry id='var-P'><glossterm>P</glossterm>
+ <info>
+ P[doc] = "The recipe name and version. P is comprised of ${PN}-${PV}."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The recipe name and version.
+ <filename>P</filename> is comprised of the following:
+ <literallayout class='monospaced'>
+ ${PN}-${PV}
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_ARCH'><glossterm>PACKAGE_ARCH</glossterm>
+ <info>
+ PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The architecture of the resulting package or packages.
+ </para>
+
+ <para>
+ By default, the value of this variable is set to
+ <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>
+ when building for the target,
+ <link linkend='var-BUILD_ARCH'><filename>BUILD_ARCH</filename></link>
+ when building for the
+ build host, and "${SDK_ARCH}-${SDKPKGSUFFIX}" when building
+ for the SDK.
+ <note>
+ See
+ <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>
+ for more information.
+ </note>
+ However, if your recipe's output packages are built
+ specific to the target machine rather than generally for
+ the architecture of the machine, you should set
+ <filename>PACKAGE_ARCH</filename> to the value of
+ <link linkend='var-MACHINE_ARCH'><filename>MACHINE_ARCH</filename></link>
+ in the recipe as follows:
+ <literallayout class='monospaced'>
+ PACKAGE_ARCH = "${MACHINE_ARCH}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_ARCHS'><glossterm>PACKAGE_ARCHS</glossterm>
+ <info>
+ PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of architectures compatible with
+ the target machine.
+ This variable is set automatically and should not
+ normally be hand-edited.
+ Entries are separated using spaces and listed in order
+ of priority.
+ The default value for
+ <filename>PACKAGE_ARCHS</filename> is "all any noarch
+ ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_BEFORE_PN'><glossterm>PACKAGE_BEFORE_PN</glossterm>
+ <info>
+ PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Enables easily adding packages to
+ <filename><link linkend='var-PACKAGES'>PACKAGES</link></filename>
+ before <filename>${<link linkend='var-PN'>PN</link>}</filename>
+ so that those added packages can pick up files that would normally be
+ included in the default package.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_CLASSES'><glossterm>PACKAGE_CLASSES</glossterm>
+ <info>
+ PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable, which is set in the
+ <filename>local.conf</filename> configuration file found in
+ the <filename>conf</filename> folder of the
+ <link linkend='build-directory'>Build Directory</link>,
+ specifies the package manager the OpenEmbedded build system
+ uses when packaging data.
+ </para>
+
+ <para>
+ You can provide one or more of the following arguments for
+ the variable:
+ <literallayout class='monospaced'>
+ PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk package_tar"
+ </literallayout>
+ <note><title>Warning</title>
+ While it is a legal option, the
+ <filename>package_tar</filename> class has limited
+ functionality due to no support for package
+ dependencies by that backend.
+ Therefore, it is recommended that you do not use it.
+ </note>
+ The build system uses only the first argument in the list
+ as the package manager when creating your image or SDK.
+ However, packages will be created using any additional
+ packaging classes you specify.
+ For example, if you use the following in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ PACKAGE_CLASSES ?= "package_ipk"
+ </literallayout>
+ The OpenEmbedded build system uses the IPK package manager
+ to create your image or SDK.
+ </para>
+
+ <para>
+ For information on packaging and build performance effects
+ as a result of the package manager in use, see the
+ "<link linkend='ref-classes-package'><filename>package.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_DEBUG_SPLIT_STYLE'><glossterm>PACKAGE_DEBUG_SPLIT_STYLE</glossterm>
+ <info>
+ PACKAGE_DEBUG_SPLIT_STYLE[doc] = "Determines how to split up the binary and debug information when creating *-dbg packages to be used with the GNU Project Debugger (GDB)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Determines how to split up the binary and debug information
+ when creating <filename>*-dbg</filename> packages to be
+ used with the GNU Project Debugger (GDB).
+ </para>
+
+ <para>
+ With the
+ <filename>PACKAGE_DEBUG_SPLIT_STYLE</filename> variable,
+ you can control where debug information, which can include
+ or exclude source files, is stored:
+ <itemizedlist>
+ <listitem><para>
+ ".debug": Debug symbol files are placed next
+ to the binary in a <filename>.debug</filename>
+ directory on the target.
+ For example, if a binary is installed into
+ <filename>/bin</filename>, the corresponding debug
+ symbol files are installed in
+ <filename>/bin/.debug</filename>.
+ Source files are placed in
+ <filename>/usr/src/debug</filename>.
+ This is the default behavior.
+ </para></listitem>
+ <listitem><para>
+ "debug-file-directory": Debug symbol files are
+ placed under <filename>/usr/lib/debug</filename>
+ on the target, and separated by the path from where
+ the binary is installed.
+ For example, if a binary is installed in
+ <filename>/bin</filename>, the corresponding debug
+ symbols are installed in
+ <filename>/usr/lib/debug/bin</filename>.
+ Source files are placed in
+ <filename>/usr/src/debug</filename>.
+ </para></listitem>
+ <listitem><para>
+ "debug-without-src": The same behavior as
+ ".debug" previously described with the exception
+ that no source files are installed.
+ </para></listitem>.
+ </itemizedlist>
+ </para>
+
+ <para>
+ You can find out more about debugging using GDB by reading
+ the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#platdev-gdb-remotedebug'>Debugging With the GNU Project Debugger (GDB) Remotely</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_EXCLUDE_COMPLEMENTARY'><glossterm>PACKAGE_EXCLUDE_COMPLEMENTARY</glossterm>
+ <info>
+ PACKAGE_EXCLUDE_COMPLEMENTARY[doc] = "Prevents specific packages from being installed when you are installing complementary packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Prevents specific packages from being installed when
+ you are installing complementary packages.
+ </para>
+
+ <para>
+ You might find that you want to prevent installing certain
+ packages when you are installing complementary packages.
+ For example, if you are using
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>
+ to install <filename>dev-pkgs</filename>, you might not want
+ to install all packages from a particular multilib.
+ If you find yourself in this situation, you can use the
+ <filename>PACKAGE_EXCLUDE_COMPLEMENTARY</filename> variable
+ to specify regular expressions to match the packages you
+ want to exclude.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_EXCLUDE'><glossterm>PACKAGE_EXCLUDE</glossterm>
+ <info>
+ PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists packages that should not be installed into an image.
+ For example:
+ <literallayout class='monospaced'>
+ PACKAGE_EXCLUDE = "<replaceable>package_name</replaceable> <replaceable>package_name</replaceable> <replaceable>package_name</replaceable> ..."
+ </literallayout>
+ </para>
+
+ <para>
+ You can set this variable globally in your
+ <filename>local.conf</filename> file or you can attach it to
+ a specific image recipe by using the recipe name override:
+ <literallayout class='monospaced'>
+ PACKAGE_EXCLUDE_pn-<replaceable>target_image</replaceable> = "<replaceable>package_name</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ If you choose to not install
+ a package using this variable and some other package is
+ dependent on it (i.e. listed in a recipe's
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ variable), the OpenEmbedded build system generates a fatal
+ installation error.
+ Because the build system halts the process with a fatal
+ error, you can use the variable with an iterative
+ development process to remove specific components from a
+ system.
+ </para>
+
+ <para>
+ Support for this variable exists only when using the
+ IPK and RPM packaging backend.
+ Support does not exist for DEB.
+ </para>
+
+ <para>
+ See the
+ <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link>
+ and the
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>
+ variables for related information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_EXTRA_ARCHS'><glossterm>PACKAGE_EXTRA_ARCHS</glossterm>
+ <info>
+ PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the list of architectures compatible with the device CPU.
+ This variable is useful when you build for several different devices that use
+ miscellaneous processors such as XScale and ARM926-EJS.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_FEED_ARCHS'><glossterm>PACKAGE_FEED_ARCHS</glossterm>
+ <info>
+ PACKAGE_FEED_ARCHS[doc] = "Optionally specifies user-defined package architectures when constructing package feed URIs."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Optionally specifies the package architectures used as
+ part of the package feed URIs during the build.
+ When used, the <filename>PACKAGE_FEED_ARCHS</filename>
+ variable is appended to the final package feed URI, which
+ is constructed using the
+ <link linkend='var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></link>
+ and
+ <link linkend='var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></link>
+ variables.
+ <note><title>Tip</title>
+ You can use the <filename>PACKAGE_FEEDS_ARCHS</filename>
+ variable to whitelist specific package architectures.
+ If you do not need to whitelist specific architectures,
+ which is a common case, you can omit this variable.
+ Omitting the variable results in all available
+ architectures for the current machine being included
+ into remote package feeds.
+ </note>
+ </para>
+
+ <para>
+ Consider the following example where the
+ <filename>PACKAGE_FEED_URIS</filename>,
+ <filename>PACKAGE_FEED_BASE_PATHS</filename>, and
+ <filename>PACKAGE_FEED_ARCHS</filename> variables are
+ defined in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ PACKAGE_FEED_URIS = "https://example.com/packagerepos/release \
+ https://example.com/packagerepos/updates"
+ PACKAGE_FEED_BASE_PATHS = "rpm rpm-dev"
+ PACKAGE_FEED_ARCHS = "all core2-64"
+ </literallayout>
+ Given these settings, the resulting package feeds are
+ as follows:
+ <literallayout class='monospaced'>
+ https://example.com/packagerepos/release/rpm/all
+ https://example.com/packagerepos/release/rpm/core2-64
+ https://example.com/packagerepos/release/rpm-dev/all
+ https://example.com/packagerepos/release/rpm-dev/core2-64
+ https://example.com/packagerepos/updates/rpm/all
+ https://example.com/packagerepos/updates/rpm/core2-64
+ https://example.com/packagerepos/updates/rpm-dev/all
+ https://example.com/packagerepos/updates/rpm-dev/core2-64
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_FEED_BASE_PATHS'><glossterm>PACKAGE_FEED_BASE_PATHS</glossterm>
+ <info>
+ PACKAGE_FEED_BASE_PATHS[doc] = "Specifies base path used when constructing package feed URIs."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the base path used when constructing package feed
+ URIs.
+ The <filename>PACKAGE_FEED_BASE_PATHS</filename> variable
+ makes up the middle portion of a package feed URI used
+ by the OpenEmbedded build system.
+ The base path lies between the
+ <link linkend='var-PACKAGE_FEED_URIS'><filename>PACKAGE_FEED_URIS</filename></link>
+ and
+ <link linkend='var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></link>
+ variables.
+ </para>
+
+ <para>
+ Consider the following example where the
+ <filename>PACKAGE_FEED_URIS</filename>,
+ <filename>PACKAGE_FEED_BASE_PATHS</filename>, and
+ <filename>PACKAGE_FEED_ARCHS</filename> variables are
+ defined in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ PACKAGE_FEED_URIS = "https://example.com/packagerepos/release \
+ https://example.com/packagerepos/updates"
+ PACKAGE_FEED_BASE_PATHS = "rpm rpm-dev"
+ PACKAGE_FEED_ARCHS = "all core2-64"
+ </literallayout>
+ Given these settings, the resulting package feeds are
+ as follows:
+ <literallayout class='monospaced'>
+ https://example.com/packagerepos/release/rpm/all
+ https://example.com/packagerepos/release/rpm/core2-64
+ https://example.com/packagerepos/release/rpm-dev/all
+ https://example.com/packagerepos/release/rpm-dev/core2-64
+ https://example.com/packagerepos/updates/rpm/all
+ https://example.com/packagerepos/updates/rpm/core2-64
+ https://example.com/packagerepos/updates/rpm-dev/all
+ https://example.com/packagerepos/updates/rpm-dev/core2-64
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_FEED_URIS'><glossterm>PACKAGE_FEED_URIS</glossterm>
+ <info>
+ PACKAGE_FEED_URIS[doc] = "Specifies the front portion of the package feed URI used by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the front portion of the package feed URI
+ used by the OpenEmbedded build system.
+ Each final package feed URI is comprised of
+ <filename>PACKAGE_FEED_URIS</filename>,
+ <link linkend='var-PACKAGE_FEED_BASE_PATHS'><filename>PACKAGE_FEED_BASE_PATHS</filename></link>,
+ and
+ <link linkend='var-PACKAGE_FEED_ARCHS'><filename>PACKAGE_FEED_ARCHS</filename></link>
+ variables.
+ </para>
+
+ <para>
+ Consider the following example where the
+ <filename>PACKAGE_FEED_URIS</filename>,
+ <filename>PACKAGE_FEED_BASE_PATHS</filename>, and
+ <filename>PACKAGE_FEED_ARCHS</filename> variables are
+ defined in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ PACKAGE_FEED_URIS = "https://example.com/packagerepos/release \
+ https://example.com/packagerepos/updates"
+ PACKAGE_FEED_BASE_PATHS = "rpm rpm-dev"
+ PACKAGE_FEED_ARCHS = "all core2-64"
+ </literallayout>
+ Given these settings, the resulting package feeds are
+ as follows:
+ <literallayout class='monospaced'>
+ https://example.com/packagerepos/release/rpm/all
+ https://example.com/packagerepos/release/rpm/core2-64
+ https://example.com/packagerepos/release/rpm-dev/all
+ https://example.com/packagerepos/release/rpm-dev/core2-64
+ https://example.com/packagerepos/updates/rpm/all
+ https://example.com/packagerepos/updates/rpm/core2-64
+ https://example.com/packagerepos/updates/rpm-dev/all
+ https://example.com/packagerepos/updates/rpm-dev/core2-64
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_GROUP'><glossterm>PACKAGE_GROUP</glossterm>
+ <info>
+ PACKAGE_GROUP[doc] = "Defines one or more packages to include in an image when a specific item is included in IMAGE_FEATURES."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The <filename>PACKAGE_GROUP</filename> variable has been
+ renamed to
+ <link linkend='var-FEATURE_PACKAGES'><filename>FEATURE_PACKAGES</filename></link>.
+ See the variable description for
+ <filename>FEATURE_PACKAGES</filename> for information.
+ </para>
+
+ <para>
+ If if you use the <filename>PACKAGE_GROUP</filename>
+ variable, the OpenEmbedded build system issues a warning
+ message.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_INSTALL'><glossterm>PACKAGE_INSTALL</glossterm>
+ <info>
+ PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The final list of packages passed to the package manager
+ for installation into the image.
+ </para>
+
+ <para>
+ Because the package manager controls actual installation
+ of all packages, the list of packages passed using
+ <filename>PACKAGE_INSTALL</filename> is not the final list
+ of packages that are actually installed.
+ This variable is internal to the image construction
+ code.
+ Consequently, in general, you should use the
+ <link linkend='var-IMAGE_INSTALL'><filename>IMAGE_INSTALL</filename></link>
+ variable to specify packages for installation.
+ The exception to this is when working with
+ the
+ <link linkend='images-core-image-minimal-initramfs'><filename>core-image-minimal-initramfs</filename></link>
+ image.
+ When working with an initial RAM filesystem (initramfs)
+ image, use the <filename>PACKAGE_INSTALL</filename>
+ variable.
+ For information on creating an initramfs, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#building-an-initramfs-image'>Building an Initial RAM Filesystem (initramfs) Image</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_INSTALL_ATTEMPTONLY'><glossterm>PACKAGE_INSTALL_ATTEMPTONLY</glossterm>
+ <info>
+ PACKAGE_INSTALL_ATTEMPTONLY[doc] = "List of packages attempted to be installed when creating an image. If a listed package fails to install, the build system does not generate an error. This variable is generally not user-defined."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of packages the OpenEmbedded build
+ system attempts to install when creating an image.
+ If a listed package fails to install, the build system
+ does not generate an error.
+ This variable is generally not user-defined.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_PREPROCESS_FUNCS'><glossterm>PACKAGE_PREPROCESS_FUNCS</glossterm>
+ <info>
+ PACKAGE_PREPROCESS_FUNCS[doc] = "Specifies a list of functions run to pre-process the PKGD directory prior to splitting the files out to individual packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions run to pre-process the
+ <link linkend='var-PKGD'><filename>PKGD</filename></link>
+ directory prior to splitting the files out to individual
+ packages.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGE_WRITE_DEPS'><glossterm>PACKAGE_WRITE_DEPS</glossterm>
+ <info>
+ PACKAGE_WRITE_DEPS[doc] = "Specifies post-installation and pre-installation script dependencies on native/cross tools."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of dependencies for post-installation and
+ pre-installation scripts on native/cross tools.
+ If your post-installation or pre-installation script can
+ execute at rootfs creation time rather than on the
+ target but depends on a native tool in order to execute,
+ you need to list the tools in
+ <filename>PACKAGE_WRITE_DEPENDS</filename>.
+ </para>
+
+ <para>
+ For information on running post-installation scripts, see
+ the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-post-installation-scripts'>Post-Installation Scripts</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGECONFIG'><glossterm>PACKAGECONFIG</glossterm>
+ <info>
+ PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable provides a means of enabling or disabling
+ features of a recipe on a per-recipe basis.
+ <filename>PACKAGECONFIG</filename> blocks are defined
+ in recipes when you specify features and then arguments
+ that define feature behaviors.
+ Here is the basic block structure:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG ??= "f1 f2 f3 ..."
+ PACKAGECONFIG[f1] = "--with-f1,--without-f1,build-deps-f1,rt-deps-f1"
+ PACKAGECONFIG[f2] = "--with-f2,--without-f2,build-deps-f2,rt-deps-f2"
+ PACKAGECONFIG[f3] = "--with-f3,--without-f3,build-deps-f3,rt-deps-f3"
+ </literallayout>
+ </para>
+
+ <para>
+ The <filename>PACKAGECONFIG</filename>
+ variable itself specifies a space-separated list of the
+ features to enable.
+ Following the features, you can determine the behavior of
+ each feature by providing up to four order-dependent
+ arguments, which are separated by commas.
+ You can omit any argument you like but must retain the
+ separating commas.
+ The order is important and specifies the following:
+ <orderedlist>
+ <listitem><para>Extra arguments
+ that should be added to the configure script
+ argument list
+ (<link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>
+ or
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>)
+ if the feature is enabled.</para></listitem>
+ <listitem><para>Extra arguments
+ that should be added to <filename>EXTRA_OECONF</filename>
+ or <filename>PACKAGECONFIG_CONFARGS</filename>
+ if the feature is disabled.
+ </para></listitem>
+ <listitem><para>Additional build dependencies
+ (<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>)
+ that should be added if the feature is enabled.
+ </para></listitem>
+ <listitem><para>Additional runtime dependencies
+ (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>)
+ that should be added if the feature is enabled.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Consider the following
+ <filename>PACKAGECONFIG</filename> block taken from the
+ <filename>librsvg</filename> recipe.
+ In this example the feature is <filename>croco</filename>,
+ which has three arguments that determine the feature's
+ behavior.
+ <literallayout class='monospaced'>
+ PACKAGECONFIG ??= "croco"
+ PACKAGECONFIG[croco] = "--with-croco,--without-croco,libcroco"
+ </literallayout>
+ The <filename>--with-croco</filename> and
+ <filename>libcroco</filename> arguments apply only if
+ the feature is enabled.
+ In this case, <filename>--with-croco</filename> is
+ added to the configure script argument list and
+ <filename>libcroco</filename> is added to
+ <filename>DEPENDS</filename>.
+ On the other hand, if the feature is disabled say through
+ a <filename>.bbappend</filename> file in another layer, then
+ the second argument <filename>--without-croco</filename> is
+ added to the configure script rather than
+ <filename>--with-croco</filename>.
+ </para>
+
+ <para>
+ The basic <filename>PACKAGECONFIG</filename> structure
+ previously described holds true regardless of whether you
+ are creating a block or changing a block.
+ When creating a block, use the structure inside your
+ recipe.
+ </para>
+
+ <para>
+ If you want to change an existing
+ <filename>PACKAGECONFIG</filename> block, you can do so
+ one of two ways:
+ <itemizedlist>
+ <listitem><para><emphasis>Append file:</emphasis>
+ Create an append file named
+ <replaceable>recipename</replaceable><filename>.bbappend</filename>
+ in your layer and override the value of
+ <filename>PACKAGECONFIG</filename>.
+ You can either completely override the variable:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG="f4 f5"
+ </literallayout>
+ Or, you can just append the variable:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG_append = " f4"
+ </literallayout></para></listitem>
+ <listitem><para><emphasis>Configuration file:</emphasis>
+ This method is identical to changing the block
+ through an append file except you edit your
+ <filename>local.conf</filename> or
+ <filename><replaceable>mydistro</replaceable>.conf</filename> file.
+ As with append files previously described,
+ you can either completely override the variable:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG_pn-<replaceable>recipename</replaceable>="f4 f5"
+ </literallayout>
+ Or, you can just amend the variable:
+ <literallayout class='monospaced'>
+ PACKAGECONFIG_append_pn-<replaceable>recipename</replaceable> = " f4"
+ </literallayout></para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGECONFIG_CONFARGS'><glossterm>PACKAGECONFIG_CONFARGS</glossterm>
+ <info>
+ PACKAGECONFIG_CONFARGS[doc] = "A space-separated list of configuration options generated from the PACKAGECONFIG setting."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A space-separated list of configuration options generated
+ from the
+ <link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>
+ setting.
+ </para>
+
+ <para>
+ Classes such as
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ and
+ <link linkend='ref-classes-cmake'><filename>cmake</filename></link>
+ use <filename>PACKAGECONFIG_CONFARGS</filename> to pass
+ <filename>PACKAGECONFIG</filename> options to
+ <filename>configure</filename> and
+ <filename>cmake</filename>, respectively.
+ If you are using
+ <filename>PACKAGECONFIG</filename> but not a class that
+ handles the <filename>do_configure</filename> task, then
+ you need to use
+ <filename>PACKAGECONFIG_CONFARGS</filename> appropriately.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGEGROUP_DISABLE_COMPLEMENTARY'><glossterm>PACKAGEGROUP_DISABLE_COMPLEMENTARY</glossterm>
+ <info>
+ PACKAGEGROUP_DISABLE_COMPLEMENTARY[doc] = "Prevents automatic creation of the normal complementary packages such as -dev and -dbg in a packagegroup recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For recipes inheriting the
+ <link linkend='ref-classes-packagegroup'><filename>packagegroup</filename></link>
+ class, setting
+ <filename>PACKAGEGROUP_DISABLE_COMPLEMENTARY</filename> to
+ "1" specifies that the normal complementary packages
+ (i.e. <filename>-dev</filename>,
+ <filename>-dbg</filename>, and so forth) should not be
+ automatically created by the
+ <filename>packagegroup</filename> recipe, which is the
+ default behavior.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGES'><glossterm>PACKAGES</glossterm>
+ <info>
+ PACKAGES[doc] = "The list of packages the recipe creates."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of packages the recipe creates.
+ The default value is the following:
+ <literallayout class='monospaced'>
+ ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}
+ </literallayout>
+ </para>
+
+ <para>
+ During packaging, the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task goes through <filename>PACKAGES</filename> and uses
+ the
+ <link linkend='var-FILES'><filename>FILES</filename></link>
+ variable corresponding to each package to assign files to
+ the package.
+ If a file matches the <filename>FILES</filename> variable
+ for more than one package in <filename>PACKAGES</filename>,
+ it will be assigned to the earliest (leftmost) package.
+ </para>
+
+ <para>
+ Packages in the variable's list that are empty (i.e. where
+ none of the patterns in
+ <filename>FILES_</filename><replaceable>pkg</replaceable>
+ match any files installed by the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task) are not generated, unless generation is forced through
+ the
+ <link linkend='var-ALLOW_EMPTY'><filename>ALLOW_EMPTY</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGES_DYNAMIC'><glossterm>PACKAGES_DYNAMIC</glossterm>
+ <info>
+ PACKAGES_DYNAMIC[doc] = "A promise that your recipe satisfies runtime dependencies for optional modules that are found in other recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A promise that your recipe satisfies runtime dependencies
+ for optional modules that are found in other recipes.
+ <filename>PACKAGES_DYNAMIC</filename>
+ does not actually satisfy the dependencies, it only states that
+ they should be satisfied.
+ For example, if a hard, runtime dependency
+ (<link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>)
+ of another package is satisfied
+ at build time through the <filename>PACKAGES_DYNAMIC</filename>
+ variable, but a package with the module name is never actually
+ produced, then the other package will be broken.
+ Thus, if you attempt to include that package in an image,
+ you will get a dependency failure from the packaging system
+ during the
+ <link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>
+ task.
+ </para>
+
+ <para>
+ Typically, if there is a chance that such a situation can
+ occur and the package that is not created is valid
+ without the dependency being satisfied, then you should use
+ <link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link>
+ (a soft runtime dependency) instead of
+ <filename>RDEPENDS</filename>.
+ </para>
+
+ <para>
+ For an example of how to use the <filename>PACKAGES_DYNAMIC</filename>
+ variable when you are splitting packages, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#handling-optional-module-packaging'>Handling Optional Module Packaging</ulink>" section
+ in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PACKAGESPLITFUNCS'><glossterm>PACKAGESPLITFUNCS</glossterm>
+ <info>
+ PACKAGESPLITFUNCS[doc] = "Specifies a list of functions run to perform additional splitting of files into individual packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions run to perform additional
+ splitting of files into individual packages.
+ Recipes can either prepend to this variable or prepend
+ to the <filename>populate_packages</filename> function
+ in order to perform additional package splitting.
+ In either case, the function should set
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>,
+ <link linkend='var-FILES'><filename>FILES</filename></link>,
+ <link linkend='var-RDEPENDS'><filename>RDEPENDS</filename></link>
+ and other packaging variables appropriately in order to
+ perform the desired splitting.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PARALLEL_MAKE'><glossterm>PARALLEL_MAKE</glossterm>
+ <info>
+ PARALLEL_MAKE[doc] = "Specifies extra options that are passed to the make command during the compile tasks. This variable is usually in the form -j x, where x represents the maximum number of parallel threads make can run."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extra options passed to the <filename>make</filename>
+ command during the
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>
+ task in order to specify parallel compilation on the local
+ build host.
+ This variable is usually in the form "-j <replaceable>x</replaceable>",
+ where <replaceable>x</replaceable> represents the maximum
+ number of parallel threads <filename>make</filename> can
+ run.
+ <note><title>Caution</title>
+ In order for <filename>PARALLEL_MAKE</filename> to be
+ effective, <filename>make</filename> must be called
+ with
+ <filename>${</filename><link linkend='var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></link><filename>}</filename>.
+ An easy way to ensure this is to use the
+ <filename>oe_runmake</filename> function.
+ </note>
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system automatically
+ sets this variable to be equal to the number of cores the
+ build system uses.
+ <note>
+ If the software being built experiences dependency
+ issues during the <filename>do_compile</filename>
+ task that result in race conditions, you can clear
+ the <filename>PARALLEL_MAKE</filename> variable within
+ the recipe as a workaround.
+ For information on addressing race conditions, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#debugging-parallel-make-races'>Debugging Parallel Make Races</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </note>
+ For single socket systems (i.e. one CPU), you should not
+ have to override this variable to gain optimal parallelism
+ during builds.
+ However, if you have very large systems that employ
+ multiple physical CPUs, you might want to make sure the
+ <filename>PARALLEL_MAKE</filename> variable is not
+ set higher than "-j 20".
+ </para>
+
+ <para>
+ For more information on speeding up builds, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#speeding-up-a-build'>Speeding Up a Build</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PARALLEL_MAKEINST'><glossterm>PARALLEL_MAKEINST</glossterm>
+ <info>
+ PARALLEL_MAKEINST[doc] = "Extra options passed to the make install command during the do_install task in order to specify parallel installation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extra options passed to the
+ <filename>make install</filename> command during the
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task in order to specify parallel installation.
+ This variable defaults to the value of
+ <link linkend='var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></link>.
+ <note><title>Notes and Cautions</title>
+ <para>In order for <filename>PARALLEL_MAKEINST</filename>
+ to be
+ effective, <filename>make</filename> must be called
+ with
+ <filename>${</filename><link linkend='var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></link><filename>}</filename>.
+ An easy way to ensure this is to use the
+ <filename>oe_runmake</filename> function.</para>
+
+ <para>If the software being built experiences
+ dependency issues during the
+ <filename>do_install</filename> task that result in
+ race conditions, you can clear the
+ <filename>PARALLEL_MAKEINST</filename> variable within
+ the recipe as a workaround.
+ For information on addressing race conditions, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#debugging-parallel-make-races'>Debugging Parallel Make Races</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PATCHRESOLVE'><glossterm>PATCHRESOLVE</glossterm>
+ <info>
+ PATCHRESOLVE[doc] = "Enable or disable interactive patch resolution."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Determines the action to take when a patch fails.
+ You can set this variable to one of two values: "noop" and
+ "user".
+ </para>
+
+ <para>
+ The default value of "noop" causes the build to simply fail
+ when the OpenEmbedded build system cannot successfully
+ apply a patch.
+ Setting the value to "user" causes the build system to
+ launch a shell and places you in the right location so that
+ you can manually resolve the conflicts.
+ </para>
+
+ <para>
+ Set this variable in your
+ <filename>local.conf</filename> file.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PATCHTOOL'><glossterm>PATCHTOOL</glossterm>
+ <info>
+ PATCHTOOL[doc] = "Specifies the utility used to apply patches for a recipe during do_patch."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the utility used to apply patches for a recipe
+ during the
+ <link linkend='ref-tasks-patch'><filename>do_patch</filename></link>
+ task.
+ You can specify one of three utilities: "patch", "quilt", or
+ "git".
+ The default utility used is "quilt" except for the
+ quilt-native recipe itself.
+ Because the quilt tool is not available at the
+ time quilt-native is being patched, it uses "patch".
+ </para>
+
+ <para>
+ If you wish to use an alternative patching tool, set the
+ variable in the recipe using one of the following:
+ <literallayout class='monospaced'>
+ PATCHTOOL = "patch"
+ PATCHTOOL = "quilt"
+ PATCHTOOL = "git"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PE'><glossterm>PE</glossterm>
+ <info>
+ PE[doc] = "The epoch of the recipe. The default value is '0'. The field is used to make upgrades possible when the versioning scheme changes in some backwards incompatible way."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The epoch of the recipe.
+ By default, this variable is unset.
+ The variable is used to make upgrades possible when the
+ versioning scheme changes in some backwards incompatible
+ way.
+ </para>
+
+ <para>
+ <filename>PE</filename> is the default value of the
+ <link linkend='var-PKGE'><filename>PKGE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PF'><glossterm>PF</glossterm>
+ <info>
+ PF[doc] = "Specifies the recipe or package name and includes all version and revision numbers. This variable is comprised of ${PN}-${EXTENDPE}${PV}-${PR}."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the recipe or package name and includes all version and revision
+ numbers (i.e. <filename>glibc-2.13-r20+svnr15508/</filename> and
+ <filename>bash-4.2-r1/</filename>).
+ This variable is comprised of the following:
+ <literallayout class='monospaced'>
+ ${<link linkend='var-PN'>PN</link>}-${<link linkend='var-EXTENDPE'>EXTENDPE</link>}${<link linkend='var-PV'>PV</link>}-${<link linkend='var-PR'>PR</link>}
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PIXBUF_PACKAGES'><glossterm>PIXBUF_PACKAGES</glossterm>
+ <info>
+ PIXBUF_PACKAGES[doc] = "When a recipe inherits the pixbufcache class, this variable identifies packages that contain the pixbuf loaders used with gdk-pixbuf."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-pixbufcache'><filename>pixbufcache</filename></link>
+ class, this variable identifies packages that contain
+ the pixbuf loaders used with
+ <filename>gdk-pixbuf</filename>.
+ By default, the <filename>pixbufcache</filename> class
+ assumes that the loaders are in the recipe's main package
+ (i.e. <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>).
+ Use this variable if the loaders you need are in a package
+ other than that main package.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKG'><glossterm>PKG</glossterm>
+ <info>
+ PKG[doc] = "The name of the resulting package created by the OpenEmbedded build system. When you use this variable, you must use a package name override."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The name of the resulting package created by the
+ OpenEmbedded build system.
+ <note>
+ When using the <filename>PKG</filename> variable, you
+ must use a package name override.
+ </note>
+ </para>
+
+ <para>
+ For example, when the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class renames the output package, it does so by setting
+ <filename>PKG_<replaceable>packagename</replaceable></filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKG_CONFIG_PATH'><glossterm>PKG_CONFIG_PATH</glossterm>
+ <info>
+ PKG_CONFIG_PATH[doc] = "Path to pkg-config files for the current build context."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The path to <filename>pkg-config</filename> files for the
+ current build context.
+ <filename>pkg-config</filename> reads this variable
+ from the environment.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGD'><glossterm>PKGD</glossterm>
+ <info>
+ PKGD[doc] = "Points to the destination directory for files to be packaged before they are split into individual packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the destination directory for files to be
+ packaged before they are split into individual packages.
+ This directory defaults to the following:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/package
+ </literallayout>
+ </para>
+
+ <para>
+ Do not change this default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGDATA_DIR'><glossterm>PKGDATA_DIR</glossterm>
+ <info>
+ PKGDATA_DIR[doc] = "Points to a shared, global-state directory that holds data generated during the packaging process."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to a shared, global-state directory that holds data
+ generated during the packaging process.
+ During the packaging process, the
+ <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>
+ task packages data for each recipe and installs it into
+ this temporary, shared area.
+ This directory defaults to the following, which you should
+ not change:
+ <literallayout class='monospaced'>
+ ${STAGING_DIR_HOST}/pkgdata
+ </literallayout>
+ For examples of how this data is used, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and Concepts Manual
+ and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#viewing-package-information-with-oe-pkgdata-util'>Viewing Package Information with <filename>oe-pkgdata-util</filename></ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For more information on the shared, global-state directory,
+ see
+ <link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGDEST'><glossterm>PKGDEST</glossterm>
+ <info>
+ PKGDEST[doc] = "Points to the parent directory for files to be packaged after they have been split into individual packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the parent directory for files to be packaged
+ after they have been split into individual packages.
+ This directory defaults to the following:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/packages-split
+ </literallayout>
+ </para>
+
+ <para>
+ Under this directory, the build system creates
+ directories for each package specified in
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>.
+ Do not change this default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGDESTWORK'><glossterm>PKGDESTWORK</glossterm>
+ <info>
+ PKGDESTWORK[doc] = "Points to a temporary work area where the do_package task saves package metadata."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to a temporary work area where the
+ <link linkend='ref-tasks-package'><filename>do_package</filename></link>
+ task saves package metadata.
+ The <filename>PKGDESTWORK</filename> location defaults to
+ the following:
+ <literallayout class='monospaced'>
+ ${WORKDIR}/pkgdata
+ </literallayout>
+ Do not change this default.
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-tasks-packagedata'><filename>do_packagedata</filename></link>
+ task copies the package metadata from
+ <filename>PKGDESTWORK</filename> to
+ <link linkend='var-PKGDATA_DIR'><filename>PKGDATA_DIR</filename></link>
+ to make it available globally.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGE'><glossterm>PKGE</glossterm>
+ <info>
+ PKGE[doc] = "The epoch of the package(s) built by the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The epoch of the package(s) built by the recipe.
+ By default, <filename>PKGE</filename> is set to
+ <link linkend='var-PE'><filename>PE</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGR'><glossterm>PKGR</glossterm>
+ <info>
+ PKGR[doc] = "The revision of the package(s) built by the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The revision of the package(s) built by the recipe.
+ By default, <filename>PKGR</filename> is set to
+ <link linkend='var-PR'><filename>PR</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PKGV'><glossterm>PKGV</glossterm>
+ <info>
+ PKGV[doc] = "The version of the package(s) built by the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The version of the package(s) built by the
+ recipe.
+ By default, <filename>PKGV</filename> is set to
+ <link linkend='var-PV'><filename>PV</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PN'><glossterm>PN</glossterm>
+ <info>
+ PN[doc] = "PN refers to a recipe name in the context of a file used by the OpenEmbedded build system as input to create a package.
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable can have two separate functions depending on the context: a recipe
+ name or a resulting package name.
+ </para>
+
+ <para>
+ <filename>PN</filename> refers to a recipe name in the context of a file used
+ by the OpenEmbedded build system as input to create a package.
+ The name is normally extracted from the recipe file name.
+ For example, if the recipe is named
+ <filename>expat_2.0.1.bb</filename>, then the default value of <filename>PN</filename>
+ will be "expat".
+ </para>
+
+ <para>
+ The variable refers to a package name in the context of a file created or produced by the
+ OpenEmbedded build system.
+ </para>
+
+ <para>
+ If applicable, the <filename>PN</filename> variable also contains any special
+ suffix or prefix.
+ For example, using <filename>bash</filename> to build packages for the native
+ machine, <filename>PN</filename> is <filename>bash-native</filename>.
+ Using <filename>bash</filename> to build packages for the target and for Multilib,
+ <filename>PN</filename> would be <filename>bash</filename> and
+ <filename>lib64-bash</filename>, respectively.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PNBLACKLIST'><glossterm>PNBLACKLIST</glossterm>
+ <info>
+ PNBLACKLIST[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists recipes you do not want the OpenEmbedded build system
+ to build.
+ This variable works in conjunction with the
+ <link linkend='ref-classes-blacklist'><filename>blacklist</filename></link>
+ class, which the recipe must inherit globally.
+ </para>
+
+ <para>
+ To prevent a recipe from being built, inherit the class
+ globally and use the variable in your
+ <filename>local.conf</filename> file.
+ Here is an example that prevents
+ <filename>myrecipe</filename> from being built:
+ <literallayout class='monospaced'>
+ INHERIT += "blacklist"
+ PNBLACKLIST[myrecipe] = "Not supported by our organization."
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-POPULATE_SDK_POST_HOST_COMMAND'><glossterm>POPULATE_SDK_POST_HOST_COMMAND</glossterm>
+ <info>
+ POPULATE_SDK_POST_HOST_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created host part of the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call once the
+ OpenEmbedded build system has created the host part of
+ the SDK.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ POPULATE_SDK_POST_HOST_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the SDK path to a command
+ within a function, you can use
+ <filename>${SDK_DIR}</filename>, which points to
+ the parent directory used by the OpenEmbedded build
+ system when creating SDK output.
+ See the
+ <link linkend='var-SDK_DIR'><filename>SDK_DIR</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-POPULATE_SDK_POST_TARGET_COMMAND'><glossterm>POPULATE_SDK_POST_TARGET_COMMAND</glossterm>
+ <info>
+ POPULATE_SDK_POST_TARGET_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created target part of the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call once the
+ OpenEmbedded build system has created the target part of
+ the SDK.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ POPULATE_SDK_POST_TARGET_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the SDK path to a command
+ within a function, you can use
+ <filename>${SDK_DIR}</filename>, which points to
+ the parent directory used by the OpenEmbedded build
+ system when creating SDK output.
+ See the
+ <link linkend='var-SDK_DIR'><filename>SDK_DIR</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PR'><glossterm>PR</glossterm>
+ <info>
+ PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The revision of the recipe. The default value for this
+ variable is "r0".
+ Subsequent revisions of the recipe conventionally have the
+ values "r1", "r2", and so forth.
+ When
+ <link linkend='var-PV'><filename>PV</filename></link>
+ increases, <filename>PR</filename> is conventionally reset
+ to "r0".
+ <note>
+ The OpenEmbedded build system does not need the aid of
+ <filename>PR</filename> to know when to rebuild a
+ recipe.
+ The build system uses the task
+ <ulink url='&YOCTO_DOCS_OM_URL;#overview-checksums'>input checksums</ulink>
+ along with the
+ <link linkend='structure-build-tmp-stamps'>stamp</link>
+ and
+ <ulink url='&YOCTO_DOCS_OM_URL;#shared-state-cache'>shared state cache</ulink>
+ mechanisms.
+ </note>
+ The <filename>PR</filename> variable primarily becomes
+ significant when a package manager dynamically installs
+ packages on an already built image.
+ In this case, <filename>PR</filename>, which is the default
+ value of
+ <link linkend='var-PKGR'><filename>PKGR</filename></link>,
+ helps the package manager distinguish which package is the
+ most recent one in cases where many packages have the same
+ <filename>PV</filename> (i.e. <filename>PKGV</filename>).
+ A component having many packages with the same
+ <filename>PV</filename> usually means that the packages all
+ install the same upstream version, but with later
+ (<filename>PR</filename>) version packages including
+ packaging fixes.
+ <note>
+ <filename>PR</filename> does not need to be increased
+ for changes that do not change the package contents or
+ metadata.
+ </note>
+ Because manually managing <filename>PR</filename> can be
+ cumbersome and error-prone, an automated solution exists.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>Working With a PR Service</ulink>"
+ section in the Yocto Project Development Tasks Manual
+ for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREFERRED_PROVIDER'><glossterm>PREFERRED_PROVIDER</glossterm>
+ <info>
+ PREFERRED_PROVIDER[doc] = "If multiple recipes provide an item, this variable determines which recipe should be given preference."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If multiple recipes provide the same item, this variable
+ determines which recipe is preferred and thus provides
+ the item (i.e. the preferred provider).
+ You should always suffix this variable with the name of the
+ provided item.
+ And, you should define the variable using the preferred
+ recipe's name
+ (<link linkend='var-PN'><filename>PN</filename></link>).
+ Here is a common example:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+ </literallayout>
+ In the previous example, multiple recipes are providing
+ "virtual/kernel".
+ The <filename>PREFERRED_PROVIDER</filename> variable is
+ set with the name (<filename>PN</filename>) of the recipe
+ you prefer to provide "virtual/kernel".
+ </para>
+
+ <para>
+ Following are more examples:
+ <literallayout class='monospaced'>
+ PREFERRED_PROVIDER_virtual/xserver = "xserver-xf86"
+ PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+ </literallayout>
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#metadata-virtual-providers'>Using Virtual Providers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ <note>
+ If you use a <filename>virtual/*</filename> item
+ with <filename>PREFERRED_PROVIDER</filename>, then any
+ recipe that
+ <link linkend='var-PROVIDES'><filename>PROVIDES</filename></link>
+ that item but is not selected (defined) by
+ <filename>PREFERRED_PROVIDER</filename> is prevented
+ from building, which is usually desirable since this
+ mechanism is designed to select between mutually
+ exclusive alternative providers.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREFERRED_VERSION'><glossterm>PREFERRED_VERSION</glossterm>
+ <info>
+ PREFERRED_VERSION[doc] = "If there are multiple versions of recipes available, this variable determines which recipe should be given preference."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If there are multiple versions of recipes available, this
+ variable determines which recipe should be given preference.
+ You must always suffix the variable with the
+ <link linkend='var-PN'><filename>PN</filename></link>
+ you want to select, and you should set the
+ <link linkend='var-PV'><filename>PV</filename></link>
+ accordingly for precedence.
+ You can use the "<filename>%</filename>" character as a
+ wildcard to match any number of characters, which can be
+ useful when specifying versions that contain long revision
+ numbers that could potentially change.
+ Here are two examples:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_python = "3.4.0"
+ PREFERRED_VERSION_linux-yocto = "4.12%"
+ </literallayout>
+ <note>
+ The specified version is matched against
+ <link linkend='var-PV'><filename>PV</filename></link>,
+ which does not necessarily match the version part of
+ the recipe's filename.
+ For example, consider two recipes
+ <filename>foo_1.2.bb</filename> and
+ <filename>foo_git.bb</filename> where
+ <filename>foo_git.bb</filename> contains the following
+ assignment:
+ <literallayout class='monospaced'>
+ PV = "1.1+git${SRCPV}"
+ </literallayout>
+ In this case, the correct way to select
+ <filename>foo_git.bb</filename> is by using an
+ assignment such as the following:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_foo = "1.1+git%"
+ </literallayout>
+ Compare that previous example against the following
+ incorrect example, which does not work:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_foo = "git"
+ </literallayout>
+ </note>
+ Sometimes the <filename>PREFERRED_VERSION</filename>
+ variable can be set by configuration files in a way that
+ is hard to change.
+ You can use
+ <link linkend='var-OVERRIDES'><filename>OVERRIDES</filename></link>
+ to set a machine-specific override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_linux-yocto_qemux86 = "4.12%"
+ </literallayout>
+ Although not recommended, worst case, you can also use the
+ "forcevariable" override, which is the strongest override
+ possible.
+ Here is an example:
+ <literallayout class='monospaced'>
+ PREFERRED_VERSION_linux-yocto_forcevariable = "4.12%"
+ </literallayout>
+ <note>
+ The <filename>_forcevariable</filename> override is
+ not handled specially.
+ This override only works because the default value of
+ <filename>OVERRIDES</filename> includes
+ "forcevariable".
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PREMIRRORS'><glossterm>PREMIRRORS</glossterm>
+ <info>
+ PREMIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies additional paths from which the OpenEmbedded
+ build system gets source code.
+ When the build system searches for source code, it first
+ tries the local download directory.
+ If that location fails, the build system tries locations
+ defined by <filename>PREMIRRORS</filename>, the upstream
+ source, and then locations specified by
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ in that order.
+ </para>
+
+ <para>
+ Assuming your distribution
+ (<link linkend='var-DISTRO'><filename>DISTRO</filename></link>)
+ is "poky", the default value for
+ <filename>PREMIRRORS</filename> is defined in the
+ <filename>conf/distro/poky.conf</filename> file in the
+ <filename>meta-poky</filename> Git repository.
+ </para>
+
+ <para>
+ Typically, you could add a specific server for the
+ build system to attempt before any others by adding
+ something like the following to the
+ <filename>local.conf</filename> configuration file in the
+ <link linkend='build-directory'>Build Directory</link>:
+ <literallayout class='monospaced'>
+ PREMIRRORS_prepend = "\
+ git://.*/.* http://www.yoctoproject.org/sources/ \n \
+ ftp://.*/.* http://www.yoctoproject.org/sources/ \n \
+ http://.*/.* http://www.yoctoproject.org/sources/ \n \
+ https://.*/.* http://www.yoctoproject.org/sources/ \n"
+ </literallayout>
+ These changes cause the build system to intercept
+ Git, FTP, HTTP, and HTTPS requests and direct them to
+ the <filename>http://</filename> sources mirror.
+ You can use <filename>file://</filename> URLs to point
+ to local directories or network shares as well.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PRIORITY'><glossterm>PRIORITY</glossterm>
+ <info>
+ PRIORITY[doc] = "Indicates the importance of a package. The default value is 'optional'. Other standard values are 'required', 'standard', and 'extra'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Indicates the importance of a package.
+ </para>
+
+ <para>
+ <filename>PRIORITY</filename> is considered to be part of
+ the distribution policy because the importance of any given
+ recipe depends on the purpose for which the distribution
+ is being produced.
+ Thus, <filename>PRIORITY</filename> is not normally set
+ within recipes.
+ </para>
+
+ <para>
+ You can set <filename>PRIORITY</filename> to "required",
+ "standard", "extra", and "optional", which is the default.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PRIVATE_LIBS'><glossterm>PRIVATE_LIBS</glossterm>
+ <info>
+ PRIVATE_LIBS[doc] = "Specifies libraries installed within a recipe that should be ignored by the OpenEmbedded build system's shared library resolver."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies libraries installed within a recipe that
+ should be ignored by the OpenEmbedded build system's
+ shared library resolver.
+ This variable is typically used when software being
+ built by a recipe has its own private versions of a
+ library normally provided by another recipe.
+ In this case, you would not want the package containing
+ the private libraries to be set as a dependency on other
+ unrelated packages that should instead depend on the
+ package providing the standard version of the library.
+ </para>
+
+ <para>
+ Libraries specified in this variable should be specified
+ by their file name.
+ For example, from the Firefox recipe in meta-browser:
+ <literallayout class='monospaced'>
+ PRIVATE_LIBS = "libmozjs.so \
+ libxpcom.so \
+ libnspr4.so \
+ libxul.so \
+ libmozalloc.so \
+ libplc4.so \
+ libplds4.so"
+ </literallayout>
+ </para>
+
+ <para>
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PROVIDES'><glossterm>PROVIDES</glossterm>
+ <info>
+ PROVIDES[doc] = "A list of aliases that a recipe also provides. These aliases are useful for satisfying dependencies of other recipes during the build as specified by DEPENDS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of aliases by which a particular recipe can be
+ known.
+ By default, a recipe's own
+ <filename><link linkend='var-PN'>PN</link></filename>
+ is implicitly already in its <filename>PROVIDES</filename>
+ list.
+ If a recipe uses <filename>PROVIDES</filename>, the
+ additional aliases are synonyms for the recipe and can
+ be useful satisfying dependencies of other recipes during
+ the build as specified by
+ <filename><link linkend='var-DEPENDS'>DEPENDS</link></filename>.
+ </para>
+
+ <para>
+ Consider the following example
+ <filename>PROVIDES</filename> statement from a recipe
+ file <filename>libav_0.8.11.bb</filename>:
+ <literallayout class='monospaced'>
+ PROVIDES += "libpostproc"
+ </literallayout>
+ The <filename>PROVIDES</filename> statement results in
+ the "libav" recipe also being known as "libpostproc".
+ </para>
+
+ <para>
+ In addition to providing recipes under alternate names,
+ the <filename>PROVIDES</filename> mechanism is also used
+ to implement virtual targets.
+ A virtual target is a name that corresponds to some
+ particular functionality (e.g. a Linux kernel).
+ Recipes that provide the functionality in question list the
+ virtual target in <filename>PROVIDES</filename>.
+ Recipes that depend on the functionality in question can
+ include the virtual target in <filename>DEPENDS</filename>
+ to leave the choice of provider open.
+ </para>
+
+ <para>
+ Conventionally, virtual targets have names on the form
+ "virtual/function" (e.g. "virtual/kernel").
+ The slash is simply part of the name and has no
+ syntactical significance.
+ </para>
+
+ <para>
+ The
+ <link linkend='var-PREFERRED_PROVIDER'><filename>PREFERRED_PROVIDER</filename></link>
+ variable is used to select which particular recipe
+ provides a virtual target.
+ <note>
+ <para>A corresponding mechanism for virtual runtime
+ dependencies (packages) exists.
+ However, the mechanism does not depend on any special
+ functionality beyond ordinary variable assignments.
+ For example,
+ <filename>VIRTUAL-RUNTIME_dev_manager</filename>
+ refers to the package of the component that manages
+ the <filename>/dev</filename> directory.</para>
+
+ <para>Setting the "preferred provider" for runtime
+ dependencies is as simple as using the following
+ assignment in a configuration file:</para>
+ <literallayout class='monospaced'>
+ VIRTUAL-RUNTIME_dev_manager = "udev"
+ </literallayout>
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PRSERV_HOST'><glossterm>PRSERV_HOST</glossterm>
+ <info>
+ PRSERV_HOST[doc] = "The network based PR service host and port."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The network based
+ <link linkend='var-PR'><filename>PR</filename></link>
+ service host and port.
+ </para>
+
+ <para>
+ The <filename>conf/local.conf.sample.extended</filename>
+ configuration file in the
+ <link linkend='source-directory'>Source Directory</link>
+ shows how the <filename>PRSERV_HOST</filename> variable is
+ set:
+ <literallayout class='monospaced'>
+ PRSERV_HOST = "localhost:0"
+ </literallayout>
+ You must set the variable if you want to automatically
+ start a local
+ <ulink url='&YOCTO_DOCS_DEV_URL;#working-with-a-pr-service'>PR service</ulink>.
+ You can set <filename>PRSERV_HOST</filename> to other
+ values to use a remote PR service.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PTEST_ENABLED'><glossterm>PTEST_ENABLED</glossterm>
+ <info>
+ PRSERV_HOST[doc] = "Specifies whether or not Package Test (ptest) functionality is enabled when building a recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies whether or not
+ <ulink url='&YOCTO_DOCS_DEV_URL;#testing-packages-with-ptest'>Package Test</ulink>
+ (ptest) functionality is enabled when building a recipe.
+ You should not set this variable directly.
+ Enabling and disabling building Package Tests
+ at build time should be done by adding "ptest" to (or
+ removing it from)
+ <link linkend='var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PV'><glossterm>PV</glossterm>
+ <info>
+ PV[doc] = "The version of the recipe. The version is normally extracted from the recipe filename."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The version of the recipe.
+ The version is normally extracted from the recipe filename.
+ For example, if the recipe is named
+ <filename>expat_2.0.1.bb</filename>, then the default value
+ of <filename>PV</filename> will be "2.0.1".
+ <filename>PV</filename> is generally not overridden within
+ a recipe unless it is building an unstable (i.e.
+ development) version from a source code repository
+ (e.g. Git or Subversion).
+ </para>
+
+ <para>
+ <filename>PV</filename> is the default value of the
+ <link linkend='var-PKGV'><filename>PKGV</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PYTHON_ABI'><glossterm>PYTHON_ABI</glossterm>
+ <info>
+ PYTHON_ABI[doc] = "When used by recipes that inherit the distutils3, setuptools3, distutils, or setuptools classes, denotes the Application Binary Interface (ABI) currently in use for Python."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used by recipes that inherit the
+ <link linkend='ref-classes-distutils3'><filename>distutils3</filename></link>,
+ <link linkend='ref-classes-setuptools3'><filename>setuptools3</filename></link>,
+ <link linkend='ref-classes-distutils'><filename>distutils</filename></link>,
+ or
+ <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link>
+ classes, denotes the Application Binary Interface (ABI)
+ currently in use for Python.
+ By default, the ABI is "m".
+ You do not have to set this variable as the OpenEmbedded
+ build system sets it for you.
+ </para>
+
+ <para>
+ The OpenEmbedded build system uses the ABI to construct
+ directory names used when installing the Python headers
+ and libraries in sysroot
+ (e.g. <filename>.../python3.3m/...</filename>).
+ </para>
+
+ <para>
+ Recipes that inherit the <filename>distutils</filename>
+ class during cross-builds also use this variable to
+ locate the headers and libraries of the appropriate Python
+ that the extension is targeting.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-PYTHON_PN'><glossterm>PYTHON_PN</glossterm>
+ <info>
+ PYTHON_PN[doc] = "When used by recipes that inherit the distutils3, setuptools3, distutils, or setuptools classes, specifies the major Python version being built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When used by recipes that inherit the
+ <link linkend='ref-classes-distutils3'><filename>distutils3</filename></link>,
+ <link linkend='ref-classes-setuptools3'><filename>setuptools3</filename></link>,
+ <link linkend='ref-classes-distutils'><filename>distutils</filename></link>,
+ or
+ <link linkend='ref-classes-setuptools'><filename>setuptools</filename></link>
+ classes, specifies the major Python version being built.
+ For Python 2.x, <filename>PYTHON_PN</filename> would
+ be "python2". For Python 3.x, the variable would be
+ "python3".
+ You do not have to set this variable as the
+ OpenEmbedded build system automatically sets it for you.
+ </para>
+
+ <para>
+ The variable allows recipes to use common infrastructure
+ such as the following:
+ <literallayout class='monospaced'>
+ DEPENDS += "${PYTHON_PN}-native"
+ </literallayout>
+ In the previous example, the version of the dependency
+ is <filename>PYTHON_PN</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-r'><title>R</title>
+
+ <glossentry id='var-RANLIB'><glossterm>RANLIB</glossterm>
+ <info>
+ RANLIB[doc] = "Minimal command and arguments to run 'ranlib'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run
+ <filename>ranlib</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RCONFLICTS'><glossterm>RCONFLICTS</glossterm>
+ <info>
+ RCONFLICTS[doc] = "The list of packages that conflict with another package. Note that the package will not be installed if the conflicting packages are not first removed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of packages that conflict with packages.
+ Note that packages will not be installed if conflicting
+ packages are not first removed.
+ </para>
+
+ <para>
+ Like all package-controlling variables, you must always use
+ them in conjunction with a package name override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RCONFLICTS_${PN} = "<replaceable>another_conflicting_package_name</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ BitBake, which the OpenEmbedded build system uses, supports
+ specifying versioned dependencies.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RCONFLICTS</filename> variable:
+ <literallayout class='monospaced'>
+ RCONFLICTS_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <filename>operator</filename>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For example, the following sets up a dependency on version
+ 1.2 or greater of the package <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RCONFLICTS_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RDEPENDS'><glossterm>RDEPENDS</glossterm>
+ <info>
+ RDEPENDS[doc] = "Lists runtime dependencies of a package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists runtime dependencies of a package.
+ These dependencies are other packages that must be
+ installed in order for the package to function correctly.
+ As an example, the following assignment declares that the
+ package <filename>foo</filename> needs the packages
+ <filename>bar</filename> and <filename>baz</filename> to
+ be installed:
+ <literallayout class='monospaced'>
+ RDEPENDS_foo = "bar baz"
+ </literallayout>
+ The most common types of package runtime dependencies are
+ automatically detected and added.
+ Therefore, most recipes do not need to set
+ <filename>RDEPENDS</filename>.
+ For more information, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#automatically-added-runtime-dependencies'>Automatically Added Runtime Dependencies</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <para>
+ The practical effect of the above
+ <filename>RDEPENDS</filename> assignment is that
+ <filename>bar</filename> and <filename>baz</filename>
+ will be declared as dependencies inside the package
+ <filename>foo</filename> when it is written out by one of
+ the
+ <link linkend='ref-tasks-package_write_deb'><filename>do_package_write_*</filename></link>
+ tasks.
+ Exactly how this is done depends on which package format
+ is used, which is determined by
+ <link linkend='var-PACKAGE_CLASSES'><filename>PACKAGE_CLASSES</filename></link>.
+ When the corresponding package manager installs the
+ package, it will know to also install the packages on
+ which it depends.
+ </para>
+
+ <para>
+ To ensure that the packages <filename>bar</filename> and
+ <filename>baz</filename> get built, the previous
+ <filename>RDEPENDS</filename> assignment also causes a task
+ dependency to be added.
+ This dependency is from the recipe's
+ <link linkend='ref-tasks-build'><filename>do_build</filename></link>
+ (not to be confused with
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>)
+ task to the <filename>do_package_write_*</filename>
+ task of the recipes that build <filename>bar</filename> and
+ <filename>baz</filename>.
+ </para>
+
+ <para>
+ The names of the packages you list within
+ <filename>RDEPENDS</filename> must be the names of other
+ packages - they cannot be recipe names.
+ Although package names and recipe names usually match,
+ the important point here is that you are
+ providing package names within the
+ <filename>RDEPENDS</filename> variable.
+ For an example of the default list of packages created from
+ a recipe, see the
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ variable.
+ </para>
+
+ <para>
+ Because the <filename>RDEPENDS</filename> variable applies
+ to packages being built, you should always use the variable
+ in a form with an attached package name (remember that a
+ single recipe can build multiple packages).
+ For example, suppose you are building a development package
+ that depends on the <filename>perl</filename> package.
+ In this case, you would use the following
+ <filename>RDEPENDS</filename> statement:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN}-dev += "perl"
+ </literallayout>
+ In the example, the development package depends on
+ the <filename>perl</filename> package.
+ Thus, the <filename>RDEPENDS</filename> variable has the
+ <filename>${PN}-dev</filename> package name as part of the
+ variable.
+ <note>
+ <title>Caution</title>
+ <filename>RDEPENDS_${PN}-dev</filename> includes
+ <filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>
+ by default.
+ This default is set in the BitBake configuration file
+ (<filename>meta/conf/bitbake.conf</filename>).
+ Be careful not to accidentally remove
+ <filename>${PN}</filename> when modifying
+ <filename>RDEPENDS_${PN}-dev</filename>.
+ Use the "+=" operator rather than the "=" operator.
+ </note>
+ </para>
+
+ <para>
+ The package names you use with
+ <filename>RDEPENDS</filename> must appear as they would in
+ the <filename>PACKAGES</filename> variable.
+ The
+ <link linkend='var-PKG'><filename>PKG</filename></link>
+ variable allows a different name to be used for
+ the final package (e.g. the
+ <link linkend='ref-classes-debian'><filename>debian</filename></link>
+ class uses this to rename packages), but this final package
+ name cannot be used with <filename>RDEPENDS</filename>,
+ which makes sense as <filename>RDEPENDS</filename> is meant
+ to be independent of the package format used.
+ </para>
+
+ <para>
+ BitBake, which the OpenEmbedded build system uses, supports
+ specifying versioned dependencies.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RDEPENDS</filename> variable:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <replaceable>operator</replaceable>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For <replaceable>version</replaceable>, provide the version
+ number.
+ <note><title>Tip</title>
+ You can use
+ <link linkend='var-EXTENDPKGV'><filename>EXTENDPKGV</filename></link>
+ to provide a full package version specification.
+ </note>
+ For example, the following sets up a dependency on version
+ 1.2 or greater of the package <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on build-time dependencies, see the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable.
+ You can also see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#tasks'>Tasks</ulink>" and
+ "<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
+ sections in the BitBake User Manual for additional
+ information on tasks and dependencies.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-REQUIRED_DISTRO_FEATURES'><glossterm>REQUIRED_DISTRO_FEATURES</glossterm>
+ <info>
+ REQUIRED_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that must exist in the current configuration in order for the OpenEmbedded build system to build the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-distro_features_check'><filename>distro_features_check</filename></link>
+ class, this
+ variable identifies distribution features that must
+ exist in the current configuration in order for the
+ OpenEmbedded build system to build the recipe.
+ In other words, if the
+ <filename>REQUIRED_DISTRO_FEATURES</filename> variable
+ lists a feature that does not appear in
+ <filename>DISTRO_FEATURES</filename> within the
+ current configuration, an error occurs and the
+ build stops.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RM_WORK_EXCLUDE'><glossterm>RM_WORK_EXCLUDE</glossterm>
+ <info>
+ RM_WORK_EXCLUDE[doc] = "With rm_work enabled, this variable specifies a list of packages whose work directories should not be removed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ With <filename>rm_work</filename> enabled, this
+ variable specifies a list of recipes whose work directories
+ should not be removed.
+ See the "<link linkend='ref-classes-rm-work'><filename>rm_work.bbclass</filename></link>"
+ section for more details.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOT_HOME'><glossterm>ROOT_HOME</glossterm>
+ <info>
+ ROOT_HOME[doc] = "Defines the root home directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the root home directory.
+ By default, this directory is set as follows in the
+ BitBake configuration file:
+ <literallayout class='monospaced'>
+ ROOT_HOME ??= "/home/root"
+ </literallayout>
+ <note>
+ This default value is likely used because some
+ embedded solutions prefer to have a read-only root
+ filesystem and prefer to keep writeable data in one
+ place.
+ </note>
+ </para>
+
+ <para>
+ You can override the default by setting the variable
+ in any layer or in the <filename>local.conf</filename> file.
+ Because the default is set using a "weak" assignment
+ (i.e. "??="), you can use either of the following forms
+ to define your override:
+ <literallayout class='monospaced'>
+ ROOT_HOME = "/root"
+ ROOT_HOME ?= "/root"
+ </literallayout>
+ These override examples use <filename>/root</filename>,
+ which is probably the most commonly used override.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOTFS'><glossterm>ROOTFS</glossterm>
+ <info>
+ ROOTFS[doc] = "Indicates a filesystem image to include as the root filesystem."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Indicates a filesystem image to include as the root
+ filesystem.
+ </para>
+
+ <para>
+ The <filename>ROOTFS</filename> variable is an optional
+ variable used with the
+ <link linkend='ref-classes-image-live'><filename>image-live</filename></link>
+ class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOTFS_POSTINSTALL_COMMAND'><glossterm>ROOTFS_POSTINSTALL_COMMAND</glossterm>
+ <info>
+ ROOTFS_POSTINSTALL_COMMAND[doc] = "Specifies a list of functions to call after installing packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call after the
+ OpenEmbedded build system has installed packages.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ ROOTFS_POSTINSTALL_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within a function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOTFS_POSTPROCESS_COMMAND'><glossterm>ROOTFS_POSTPROCESS_COMMAND</glossterm>
+ <info>
+ ROOTFS_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system has created the root filesystem."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call once the
+ OpenEmbedded build system has created the root filesystem.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ ROOTFS_POSTPROCESS_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within a function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOTFS_POSTUNINSTALL_COMMAND'><glossterm>ROOTFS_POSTUNINSTALL_COMMAND</glossterm>
+ <info>
+ ROOTFS_POSTUNINSTALL_COMMAND[doc] = "Specifies a list of functions to call after removal of unneeded packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call after the
+ OpenEmbedded build system has removed unnecessary
+ packages.
+ When runtime package management is disabled in the
+ image, several packages are removed including
+ <filename>base-passwd</filename>,
+ <filename>shadow</filename>, and
+ <filename>update-alternatives</filename>.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ ROOTFS_POSTUNINSTALL_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within a function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-ROOTFS_PREPROCESS_COMMAND'><glossterm>ROOTFS_PREPROCESS_COMMAND</glossterm>
+ <info>
+ ROOTFS_PREPROCESS_COMMAND[doc] = "Specifies a list of functions to call before the OpenEmbedded build system has created the root filesystem."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call before the
+ OpenEmbedded build system has created the root filesystem.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ ROOTFS_PREPROCESS_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass the root filesystem path to a command
+ within a function, you can use
+ <filename>${IMAGE_ROOTFS}</filename>, which points to
+ the directory that becomes the root filesystem image.
+ See the
+ <link linkend='var-IMAGE_ROOTFS'><filename>IMAGE_ROOTFS</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RPROVIDES'><glossterm>RPROVIDES</glossterm>
+ <info>
+ RPROVIDES[doc] = "A list of package name aliases that a package also provides. These aliases are useful for satisfying runtime dependencies of other packages both during the build and on the target."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of package name aliases that a package also provides.
+ These aliases are useful for satisfying runtime dependencies
+ of other packages both during the build and on the target
+ (as specified by
+ <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename>).
+ <note>
+ A package's own name is implicitly already in its
+ <filename>RPROVIDES</filename> list.
+ </note>
+ </para>
+
+ <para>
+ As with all package-controlling variables, you must always
+ use the variable in conjunction with a package name override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RPROVIDES_${PN} = "widget-abi-2"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RRECOMMENDS'><glossterm>RRECOMMENDS</glossterm>
+ <info>
+ RRECOMMENDS[doc] = "A list of packages that extends the usability of a package being built. The package being built does not depend on this list of packages in order to successfully build, but needs them for the extended usability."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of packages that extends the usability of a package
+ being built.
+ The package being built does not depend on this list of
+ packages in order to successfully build, but rather
+ uses them for extended usability.
+ To specify runtime dependencies for packages, see the
+ <filename><link linkend='var-RDEPENDS'>RDEPENDS</link></filename>
+ variable.
+ </para>
+
+ <para>
+ The package manager will automatically install the
+ <filename>RRECOMMENDS</filename> list of packages when
+ installing the built package.
+ However, you can prevent listed packages from being
+ installed by using the
+ <link linkend='var-BAD_RECOMMENDATIONS'><filename>BAD_RECOMMENDATIONS</filename></link>,
+ <link linkend='var-NO_RECOMMENDATIONS'><filename>NO_RECOMMENDATIONS</filename></link>,
+ and
+ <link linkend='var-PACKAGE_EXCLUDE'><filename>PACKAGE_EXCLUDE</filename></link>
+ variables.
+ </para>
+
+ <para>
+ Packages specified in
+ <filename>RRECOMMENDS</filename> need not actually be
+ produced.
+ However, a recipe must exist that provides each package,
+ either through the
+ <link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
+ or
+ <link linkend='var-PACKAGES_DYNAMIC'><filename>PACKAGES_DYNAMIC</filename></link>
+ variables or the
+ <link linkend='var-RPROVIDES'><filename>RPROVIDES</filename></link>
+ variable, or an error will occur during the build.
+ If such a recipe does exist and the package is not produced,
+ the build continues without error.
+ </para>
+
+ <para>
+ Because the <filename>RRECOMMENDS</filename> variable
+ applies to packages being built, you should always attach
+ an override to the variable to specify the particular
+ package whose usability is being extended.
+ For example, suppose you are building a development package
+ that is extended to support wireless functionality.
+ In this case, you would use the following:
+ <literallayout class='monospaced'>
+ RRECOMMENDS_${PN}-dev += "<replaceable>wireless_package_name</replaceable>"
+ </literallayout>
+ In the example, the package name
+ (<filename>${<link linkend='var-PN'>PN</link>}-dev</filename>)
+ must appear as it would in the
+ <filename>PACKAGES</filename> namespace before any renaming
+ of the output package by classes such as
+ <filename>debian.bbclass</filename>.
+ </para>
+
+ <para>
+ BitBake, which the OpenEmbedded build system uses, supports
+ specifying versioned recommends.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RRECOMMENDS</filename> variable:
+ <literallayout class='monospaced'>
+ RRECOMMENDS_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <filename>operator</filename>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For example, the following sets up a recommend on version
+ 1.2 or greater of the package <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RRECOMMENDS_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RREPLACES'><glossterm>RREPLACES</glossterm>
+ <info>
+ RREPLACES[doc] = "A list of packages replaced by a package. The package manager uses this variable to determine which package should be installed to replace other package(s) during an upgrade."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of packages replaced by a package.
+ The package manager uses this variable to determine which
+ package should be installed to replace other package(s)
+ during an upgrade.
+ In order to also have the other package(s) removed at the
+ same time, you must add the name of the other
+ package to the
+ <filename><link linkend='var-RCONFLICTS'>RCONFLICTS</link></filename> variable.
+ </para>
+
+ <para>
+ As with all package-controlling variables, you must use
+ this variable in conjunction with a package name
+ override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RREPLACES_${PN} = "<replaceable>other_package_being_replaced</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ BitBake, which the OpenEmbedded build system uses, supports
+ specifying versioned replacements.
+ Although the syntax varies depending on the packaging
+ format, BitBake hides these differences from you.
+ Here is the general syntax to specify versions with
+ the <filename>RREPLACES</filename> variable:
+ <literallayout class='monospaced'>
+ RREPLACES_${PN} = "<replaceable>package</replaceable> (<replaceable>operator</replaceable> <replaceable>version</replaceable>)"
+ </literallayout>
+ For <filename>operator</filename>, you can specify the
+ following:
+ <literallayout class='monospaced'>
+ =
+ &lt;
+ &gt;
+ &lt;=
+ &gt;=
+ </literallayout>
+ For example, the following sets up a replacement using
+ version 1.2 or greater of the package
+ <filename>foo</filename>:
+ <literallayout class='monospaced'>
+ RREPLACES_${PN} = "foo (>= 1.2)"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-RSUGGESTS'><glossterm>RSUGGESTS</glossterm>
+ <info>
+ RSUGGESTS[doc] = "A list of additional packages that you can suggest for installation by the package manager at the time a package is installed. Not all package managers support this functionality."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of additional packages that you can suggest for
+ installation by the package manager at the time a package
+ is installed.
+ Not all package managers support this functionality.
+ </para>
+
+ <para>
+ As with all package-controlling variables, you must always
+ use this variable in conjunction with a package name
+ override.
+ Here is an example:
+ <literallayout class='monospaced'>
+ RSUGGESTS_${PN} = "<replaceable>useful_package</replaceable> <replaceable>another_package</replaceable>"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-s'><title>S</title>
+
+ <glossentry id='var-S'><glossterm>S</glossterm>
+ <info>
+ S[doc] = "The location in the Build Directory where unpacked package source code resides."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location in the
+ <link linkend='build-directory'>Build Directory</link>
+ where unpacked recipe source code resides.
+ By default, this directory is
+ <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}/${</filename><link linkend='var-BPN'><filename>BPN</filename></link><filename>}-${</filename><link linkend='var-PV'><filename>PV</filename></link><filename>}</filename>,
+ where <filename>${BPN}</filename> is the base recipe name
+ and <filename>${PV}</filename> is the recipe version.
+ If the source tarball extracts the code to a directory
+ named anything other than <filename>${BPN}-${PV}</filename>,
+ or if the source code is fetched from an SCM such as
+ Git or Subversion, then you must set <filename>S</filename>
+ in the recipe so that the OpenEmbedded build system
+ knows where to find the unpacked source.
+ </para>
+
+ <para>
+ As an example, assume a
+ <link linkend='source-directory'>Source Directory</link>
+ top-level folder named <filename>poky</filename> and a
+ default Build Directory at <filename>poky/build</filename>.
+ In this case, the work directory the build system uses
+ to keep the unpacked recipe for <filename>db</filename>
+ is the following:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/db/5.1.19-r3/db-5.1.19
+ </literallayout>
+ The unpacked source code resides in the
+ <filename>db-5.1.19</filename> folder.
+ </para>
+
+ <para>
+ This next example assumes a Git repository.
+ By default, Git repositories are cloned to
+ <filename>${WORKDIR}/git</filename> during
+ <link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>.
+ Since this path is different from the default value of
+ <filename>S</filename>, you must set it specifically
+ so the source can be located:
+ <literallayout class='monospaced'>
+ SRC_URI = "git://path/to/repo.git"
+ S = "${WORKDIR}/git"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SANITY_REQUIRED_UTILITIES'><glossterm>SANITY_REQUIRED_UTILITIES</glossterm>
+ <info>
+ SANITY_REQUIRED_UTILITIES[doc] = "Specifies a list of command-line utilities that should be checked for during the initial sanity checking process when running BitBake."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of command-line utilities that should be
+ checked for during the initial sanity checking process when
+ running BitBake.
+ If any of the utilities are not installed on the build host,
+ then BitBake immediately exits with an error.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SANITY_TESTED_DISTROS'><glossterm>SANITY_TESTED_DISTROS</glossterm>
+ <info>
+ SANITY_TESTED_DISTROS[doc] = "A list of the host distribution identifiers that the build system has been tested against."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of the host distribution identifiers that the
+ build system has been tested against.
+ Identifiers consist of the host distributor ID
+ followed by the release,
+ as reported by the <filename>lsb_release</filename> tool
+ or as read from <filename>/etc/lsb-release</filename>.
+ Separate the list items with explicit newline
+ characters (<filename>\n</filename>).
+ If <filename>SANITY_TESTED_DISTROS</filename> is not empty
+ and the current value of
+ <link linkend='var-NATIVELSBSTRING'><filename>NATIVELSBSTRING</filename></link>
+ does not appear in the list, then the build system reports
+ a warning that indicates the current host distribution has
+ not been tested as a build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_ARCH'><glossterm>SDK_ARCH</glossterm>
+ <info>
+ SDK_ARCH[doc] = "The target architecture for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The target architecture for the SDK.
+ Typically, you do not directly set this variable.
+ Instead, use
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_DEPLOY'><glossterm>SDK_DEPLOY</glossterm>
+ <info>
+ SDK_DEPLOY[doc] = "The directory set up and used by the populate_sdk_base to which the SDK is deployed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory set up and used by the
+ <link linkend='ref-classes-populate-sdk'><filename>populate_sdk_base</filename></link>
+ class to which the SDK is deployed.
+ The <filename>populate_sdk_base</filename> class defines
+ <filename>SDK_DEPLOY</filename> as follows:
+ <literallayout class='monospaced'>
+ SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_DIR'><glossterm>SDK_DIR</glossterm>
+ <info>
+ SDK_DIR[doc] = "The parent directory used by the OpenEmbedded build system when creating SDK output."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The parent directory used by the OpenEmbedded build system
+ when creating SDK output.
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link>
+ class defines the variable as follows:
+ <literallayout class='monospaced'>
+ SDK_DIR = "${WORKDIR}/sdk"
+ </literallayout>
+ <note>
+ The <filename>SDK_DIR</filename> directory is a
+ temporary directory as it is part of
+ <filename>WORKDIR</filename>.
+ The final output directory is
+ <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_EXT_TYPE'><glossterm>SDK_EXT_TYPE</glossterm>
+ <info>
+ SDK_EXT_TYPE[doc] = "Controls whether or not shared state artifacts are copied into the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Controls whether or not shared state artifacts are copied
+ into the extensible SDK.
+ The default value of "full" copies all of the required
+ shared state artifacts into the extensible SDK.
+ The value "minimal" leaves these artifacts out of the
+ SDK.
+ <note>
+ If you set the variable to "minimal", you need to
+ ensure
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+ is set in the SDK's configuration to enable the
+ artifacts to be fetched as needed.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_HOST_MANIFEST'><glossterm>SDK_HOST_MANIFEST</glossterm>
+ <info>
+ SDK_HOST_MANIFEST[doc] = "The manifest file for the host part of the SDK. This file lists all the installed packages that make up the host part of the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The manifest file for the host part of the SDK.
+ This file lists all the installed packages that make up
+ the host part of the SDK.
+ The file contains package information on a line-per-package
+ basis as follows:
+ <literallayout class='monospaced'>
+ <replaceable>packagename</replaceable> <replaceable>packagearch</replaceable> <replaceable>version</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link>
+ class defines the manifest file as follows:
+ <literallayout class='monospaced'>
+ SDK_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"
+ </literallayout>
+ The location is derived using the
+ <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>
+ and
+ <link linkend='var-TOOLCHAIN_OUTPUTNAME'><filename>TOOLCHAIN_OUTPUTNAME</filename></link>
+ variables.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_INCLUDE_PKGDATA'><glossterm>SDK_INCLUDE_PKGDATA</glossterm>
+ <info>
+ SDK_INCLUDE_PKGDATA[doc] = "When set to "1", specifies to include the packagedata for all recipes in the "world" target in the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When set to "1", specifies to include the packagedata for
+ all recipes in the "world" target in the extensible SDK.
+ Including this data allows the
+ <filename>devtool search</filename> command to find these
+ recipes in search results, as well as allows the
+ <filename>devtool add</filename> command to map
+ dependencies more effectively.
+ <note>
+ Enabling the <filename>SDK_INCLUDE_PKGDATA</filename>
+ variable significantly increases build time because
+ all of world needs to be built.
+ Enabling the variable also slightly increases the size
+ of the extensible SDK.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_INCLUDE_TOOLCHAIN'><glossterm>SDK_INCLUDE_TOOLCHAIN</glossterm>
+ <info>
+ SDK_INCLUDE_TOOLCHAIN[doc] = "When set to "1", specifies to include the toolchain in the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When set to "1", specifies to include the toolchain in the
+ extensible SDK.
+ Including the toolchain is useful particularly when
+ <link linkend='var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></link>
+ is set to "minimal" to keep the SDK reasonably small
+ but you still want to provide a usable toolchain.
+ For example, suppose you want to use the toolchain from an
+ IDE (e.g. Eclipse) or from other tools and you do not
+ want to perform additional steps to install the toolchain.
+ </para>
+
+ <para>
+ The <filename>SDK_INCLUDE_TOOLCHAIN</filename> variable
+ defaults to "0" if <filename>SDK_EXT_TYPE</filename>
+ is set to "minimal", and defaults to "1" if
+ <filename>SDK_EXT_TYPE</filename> is set to "full".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_INHERIT_BLACKLIST'><glossterm>SDK_INHERIT_BLACKLIST</glossterm>
+ <info>
+ SDK_INHERIT_BLACKLIST[doc] = "A list of classes to remove from the INHERIT value globally within the extensible SDK configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of classes to remove from the
+ <link linkend='var-INHERIT'><filename>INHERIT</filename></link>
+ value globally within the extensible SDK configuration.
+ The default value is "buildhistory icecc".
+ </para>
+
+ <para>
+ Some classes are not generally applicable within
+ the extensible SDK context and you can use this variable
+ to disable them.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_LOCAL_CONF_BLACKLIST'><glossterm>SDK_LOCAL_CONF_BLACKLIST</glossterm>
+ <info>
+ SDK_LOCAL_CONF_BLACKLIST[doc] = "A list of variables not allowed through from the build system configuration into the extensible SDK configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of variables not allowed through from the build
+ system configuration into the extensible SDK configuration.
+ Usually, these are variables that are specific to the
+ machine on which the build system is running and thus
+ would be potentially problematic within the extensible SDK.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_LOCAL_CONF_WHITELIST'><glossterm>SDK_LOCAL_CONF_WHITELIST</glossterm>
+ <info>
+ SDK_LOCAL_CONF_WHITELIST[doc] = "A list of variables allowed through from the build system configuration into the extensible SDK configuration."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of variables allowed through from the build system
+ configuration into the extensible SDK configuration.
+ This list overrides the variables specified using the
+ <link linkend='var-SDK_LOCAL_CONF_BLACKLIST'><filename>SDK_LOCAL_CONF_BLACKLIST</filename></link>
+ variable as well as any variables identified by automatic
+ blacklisting due to the "/" character being found at the
+ start of the value, which is usually indicative of being a
+ path and thus might not be valid on the system where the
+ SDK is installed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_NAME'><glossterm>SDK_NAME</glossterm>
+ <info>
+ SDK_NAME[doc] = "The base name for SDK output files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The base name for SDK output files.
+ The name is derived from the
+ <link linkend='var-DISTRO'><filename>DISTRO</filename></link>,
+ <link linkend='var-TCLIBC'><filename>TCLIBC</filename></link>,
+ <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>,
+ <link linkend='var-IMAGE_BASENAME'><filename>IMAGE_BASENAME</filename></link>,
+ and
+ <link linkend='var-TUNE_PKGARCH'><filename>TUNE_PKGARCH</filename></link>
+ variables:
+ <literallayout class='monospaced'>
+ SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_OS'><glossterm>SDK_OS</glossterm>
+ <info>
+ SDK_OS[doc] = "The operating system for which the SDK will be built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the operating system for which the SDK
+ will be built.
+ The default value is the value of
+ <link linkend='var-BUILD_OS'><filename>BUILD_OS</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_OUTPUT'><glossterm>SDK_OUTPUT</glossterm>
+ <info>
+ SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build system when creating SDK output."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location used by the OpenEmbedded build system when
+ creating SDK output.
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link>
+ class defines the variable as follows:
+ <literallayout class='monospaced'>
+ SDK_DIR = "${WORKDIR}/sdk"
+ SDK_OUTPUT = "${SDK_DIR}/image"
+ SDK_DEPLOY = "${DEPLOY_DIR}/sdk"
+ </literallayout>
+ <note>
+ The <filename>SDK_OUTPUT</filename> directory is a
+ temporary directory as it is part of
+ <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ by way of
+ <link linkend='var-SDK_DIR'><filename>SDK_DIR</filename></link>.
+ The final output directory is
+ <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_PACKAGE_ARCHS'><glossterm>SDK_PACKAGE_ARCHS</glossterm>
+ <info>
+ SDK_PACKAGE_ARCHS[doc] = "Specifies a list of architectures compatible with the SDK machine. This variable is set automatically and should not normally be hand-edited."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of architectures compatible with
+ the SDK machine.
+ This variable is set automatically and should not
+ normally be hand-edited.
+ Entries are separated using spaces and listed in order
+ of priority.
+ The default value for
+ <filename>SDK_PACKAGE_ARCHS</filename> is "all any noarch
+ ${SDK_ARCH}-${SDKPKGSUFFIX}".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_POSTPROCESS_COMMAND'><glossterm>SDK_POSTPROCESS_COMMAND</glossterm>
+ <info>
+ SDK_POSTPROCESS_COMMAND[doc] = "Specifies a list of functions to call once the OpenEmbedded build system creates the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of functions to call once the
+ OpenEmbedded build system creates the SDK.
+ You can specify functions separated by semicolons:
+ <literallayout class='monospaced'>
+ SDK_POSTPROCESS_COMMAND += "<replaceable>function</replaceable>; ... "
+ </literallayout>
+ </para>
+
+ <para>
+ If you need to pass an SDK path to a command within a
+ function, you can use
+ <filename>${SDK_DIR}</filename>, which points to
+ the parent directory used by the OpenEmbedded build system
+ when creating SDK output.
+ See the
+ <link linkend='var-SDK_DIR'><filename>SDK_DIR</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_PREFIX'><glossterm>SDK_PREFIX</glossterm>
+ <info>
+ SDK_PREFIX[doc] = "The toolchain binary prefix used for nativesdk recipes."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The toolchain binary prefix used for
+ <filename>nativesdk</filename> recipes.
+ The OpenEmbedded build system uses the
+ <filename>SDK_PREFIX</filename> value to set the
+ <link linkend='var-TARGET_PREFIX'><filename>TARGET_PREFIX</filename></link>
+ when building <filename>nativesdk</filename> recipes.
+ The default value is "${SDK_SYS}-".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_RECRDEP_TASKS'><glossterm>SDK_RECRDEP_TASKS</glossterm>
+ <info>
+ SDK_RECRDEP_TASKS[doc] = "A list of shared state tasks added to the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of shared state tasks added to the extensible SDK.
+ By default, the following tasks are added:
+ <literallayout class='monospaced'>
+ do_populate_lic
+ do_package_qa
+ do_populate_sysroot
+ do_deploy
+ </literallayout>
+ Despite the default value of "" for the
+ <filename>SDK_RECRDEP_TASKS</filename> variable, the
+ above four tasks are always added to the SDK.
+ To specify tasks beyond these four, you need to use
+ the <filename>SDK_RECRDEP_TASKS</filename> variable (e.g.
+ you are defining additional tasks that are needed in
+ order to build
+ <link linkend='var-SDK_TARGETS'><filename>SDK_TARGETS</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_SYS'><glossterm>SDK_SYS</glossterm>
+ <info>
+ SDK_SYS[doc] = "Specifies the system, including the architecture and the operating system, for which the SDK will be built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the system, including the architecture and the
+ operating system, for which the SDK will be built.
+ </para>
+
+ <para>
+ The OpenEmbedded build system automatically sets this
+ variable based on
+ <link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>,
+ <link linkend='var-SDK_VENDOR'><filename>SDK_VENDOR</filename></link>,
+ and
+ <link linkend='var-SDK_OS'><filename>SDK_OS</filename></link>.
+ You do not need to set the <filename>SDK_SYS</filename>
+ variable yourself.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_TARGET_MANIFEST'><glossterm>SDK_TARGET_MANIFEST</glossterm>
+ <info>
+ SDK_TARGET_MANIFEST[doc] = "The manifest file for the target part of the SDK. This file lists all the installed packages that make up the target part of the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The manifest file for the target part of the SDK.
+ This file lists all the installed packages that make up
+ the target part of the SDK.
+ The file contains package information on a line-per-package
+ basis as follows:
+ <literallayout class='monospaced'>
+ <replaceable>packagename</replaceable> <replaceable>packagearch</replaceable> <replaceable>version</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link>
+ class defines the manifest file as follows:
+ <literallayout class='monospaced'>
+ SDK_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
+ </literallayout>
+ The location is derived using the
+ <link linkend='var-SDK_DEPLOY'><filename>SDK_DEPLOY</filename></link>
+ and
+ <link linkend='var-TOOLCHAIN_OUTPUTNAME'><filename>TOOLCHAIN_OUTPUTNAME</filename></link>
+ variables.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_TARGETS'><glossterm>SDK_TARGETS</glossterm>
+ <info>
+ SDK_TARGETS[doc] = "A list of targets to install from shared state as part of the standard or extensible SDK installation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of targets to install from shared state as part of
+ the standard or extensible SDK installation.
+ The default value is "${PN}" (i.e. the image from which
+ the SDK is built).
+ </para>
+
+ <para>
+ The <filename>SDK_TARGETS</filename> variable is an
+ internal variable and typically would not be changed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_TITLE'><glossterm>SDK_TITLE</glossterm>
+ <info>
+ SDK_TITLE[doc] = "Specifies a title to be printed when running the SDK installer."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a title to be printed when running the SDK
+ installer.
+ The <filename>SDK_TITLE</filename> variable defaults to
+ "<replaceable>distro</replaceable> SDK" for the standard
+ SDK and "<replaceable>distro</replaceable> Extensible SDK"
+ for the extensible SDK, where
+ <replaceable>distro</replaceable> is the first one of
+ <link linkend='var-DISTRO_NAME'><filename>DISTRO_NAME</filename></link>
+ or
+ <link linkend='var-DISTRO'><filename>DISTRO</filename></link>
+ that is set in your configuration.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_UPDATE_URL'><glossterm>SDK_UPDATE_URL</glossterm>
+ <info>
+ SDK_UPDATE_URL[doc] = "An optional URL for an update server for the extensible SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An optional URL for an update server for the extensible
+ SDK.
+ If set, the value is used as the default update server when
+ running <filename>devtool sdk-update</filename> within the
+ extensible SDK.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_VENDOR'><glossterm>SDK_VENDOR</glossterm>
+ <info>
+ SDK_VENDOR[doc] = "Specifies the name of the SDK vendor."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the SDK vendor.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDK_VERSION'><glossterm>SDK_VERSION</glossterm>
+ <info>
+ SDK_VERSION[doc] = "Specifies the version for the SDK."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the version of the SDK.
+ The distribution configuration file (e.g.
+ <filename>/meta-poky/conf/distro/poky.conf</filename>)
+ defines the <filename>SDK_VERSION</filename> as follows:
+ <literallayout class='monospaced'>
+ SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
+ </literallayout>
+ </para>
+
+ <para>
+ For additional information, see the
+ <link linkend='var-DISTRO_VERSION'><filename>DISTRO_VERSION</filename></link>
+ and
+ <link linkend='var-DATE'><filename>DATE</filename></link>
+ variables.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDKIMAGE_FEATURES'><glossterm>SDKIMAGE_FEATURES</glossterm>
+ <info>
+ SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However, this variable applies to the SDK generated from an image using the command 'bitbake -c populate_sdk imagename'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Equivalent to
+ <filename><link linkend='var-IMAGE_FEATURES'>IMAGE_FEATURES</link></filename>.
+ However, this variable applies to the SDK generated from an
+ image using the following command:
+ <literallayout class='monospaced'>
+ $ bitbake -c populate_sdk <replaceable>imagename</replaceable>
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDKMACHINE'><glossterm>SDKMACHINE</glossterm>
+ <info>
+ SDKMACHINE[doc] = "Specifies the architecture (i.e. i686 or x86_64) for which to build SDK items."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The machine for which the SDK is built.
+ In other words, the SDK is built such that it
+ runs on the target you specify with the
+ <filename>SDKMACHINE</filename> value.
+ The value points to a corresponding
+ <filename>.conf</filename> file under
+ <filename>conf/machine-sdk/</filename>.
+ </para>
+
+ <para>
+ You can use "i686" and "x86_64" as possible values
+ for this variable. The variable defaults to "i686"
+ and is set in the local.conf file in the Build Directory.
+ <literallayout class='monospaced'>
+ SDKMACHINE ?= "i686"
+ </literallayout>
+ <note>
+ You cannot set the <filename>SDKMACHINE</filename>
+ variable in your distribution configuration file.
+ If you do, the configuration will not take affect.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDKPATH'><glossterm>SDKPATH</glossterm>
+ <info>
+ SDKPATH[doc] = "Defines the path offered to the user for installation of the SDK that is generated by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the path offered to the user for installation
+ of the SDK that is generated by the OpenEmbedded build
+ system.
+ The path appears as the default location for installing
+ the SDK when you run the SDK's installation script.
+ You can override the offered path when you run the
+ script.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SDKTARGETSYSROOT'><glossterm>SDKTARGETSYSROOT</glossterm>
+ <info>
+ SDKTARGETSYSROOT[doc] = "Full path to the sysroot used for cross-compilation within an SDK as it will be when installed into the default SDKPATH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The full path to the sysroot used for cross-compilation
+ within an SDK as it will be when installed into the
+ default
+ <link linkend='var-SDKPATH'><filename>SDKPATH</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SECTION'><glossterm>SECTION</glossterm>
+ <info>
+ SECTION[doc] = "The section in which packages should be categorized. Package management utilities can make use of this variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The section in which packages should be categorized.
+ Package management utilities can make use of this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SELECTED_OPTIMIZATION'><glossterm>SELECTED_OPTIMIZATION</glossterm>
+ <info>
+ SELECTED_OPTIMIZATION[doc] = "The variable takes the value of FULL_OPTIMIZATION unless DEBUG_BUILD = '1'. In this case, the value of DEBUG_OPTIMIZATION is used."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the optimization flags passed to the C compiler
+ when building for the target.
+ The flags are passed through the default value of the
+ <link linkend='var-TARGET_CFLAGS'><filename>TARGET_CFLAGS</filename></link>
+ variable.
+ </para>
+
+ <para>
+ The <filename>SELECTED_OPTIMIZATION</filename> variable
+ takes the value of
+ <filename><link linkend='var-FULL_OPTIMIZATION'>FULL_OPTIMIZATION</link></filename>
+ unless <filename><link linkend='var-DEBUG_BUILD'>DEBUG_BUILD</link></filename> = "1".
+ If that is the case, the value of
+ <filename><link linkend='var-DEBUG_OPTIMIZATION'>DEBUG_OPTIMIZATION</link></filename> is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SERIAL_CONSOLE'><glossterm>SERIAL_CONSOLE</glossterm>
+ <info>
+ SERIAL_CONSOLE[doc] = "Defines the serial consoles (TTYs) to enable using getty."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines a serial console (TTY) to enable using
+ <ulink url='https://en.wikipedia.org/wiki/Getty_(Unix)'>getty</ulink>.
+ Provide a value that specifies the baud rate followed by
+ the TTY device name separated by a space.
+ You cannot specify more than one TTY device:
+ <literallayout class='monospaced'>
+ SERIAL_CONSOLE = "115200 ttyS0"
+ </literallayout>
+ <note>
+ The <filename>SERIAL_CONSOLE</filename> variable
+ is deprecated.
+ Please use the
+ <link linkend='var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></link>
+ variable.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SERIAL_CONSOLES'><glossterm>SERIAL_CONSOLES</glossterm>
+ <info>
+ SERIAL_CONSOLES[doc] = "Defines the serial consoles (TTYs) to enable using getty."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines a serial console (TTY) to enable using
+ <ulink url='https://en.wikipedia.org/wiki/Getty_(Unix)'>getty</ulink>.
+ Provide a value that specifies the baud rate followed by
+ the TTY device name separated by a semicolon.
+ Use spaces to separate multiple devices:
+ <literallayout class='monospaced'>
+ SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SERIAL_CONSOLES_CHECK'><glossterm>SERIAL_CONSOLES_CHECK</glossterm>
+ <info>
+ SERIAL_CONSOLES_CHECK[doc] = "Selected SERIAL_CONSOLES to check against /proc/console before enabling using getty. Supported only by SysVinit."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies serial consoles, which must be listed in
+ <link linkend='var-SERIAL_CONSOLES'><filename>SERIAL_CONSOLES</filename></link>,
+ to check against <filename>/proc/console</filename>
+ before enabling them using getty.
+ This variable allows aliasing in the format:
+ &lt;device&gt;:&lt;alias&gt;.
+ If a device was listed as "sclp_line0"
+ in <filename>/dev/</filename> and "ttyS0" was listed
+ in <filename>/proc/console</filename>, you would do the
+ following:
+ <literallayout class='monospaced'>
+ SERIAL_CONSOLES_CHECK = "slcp_line0:ttyS0"
+ </literallayout>
+ This variable is currently only supported with SysVinit
+ (i.e. not with systemd).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS'><glossterm>SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS</glossterm>
+ <info>
+ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that should not be used to determine signatures of tasks from one recipe when they depend on tasks from another recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recipe dependencies that should not be used to
+ determine signatures of tasks from one recipe when they
+ depend on tasks from another recipe.
+ For example:
+ <literallayout class='monospaced'>
+ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "intone->mplayer2"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, <filename>intone</filename>
+ depends on <filename>mplayer2</filename>.
+ </para>
+
+ <para>
+ You can use the special token <filename>"*"</filename> on
+ the left-hand side of the dependency to match all
+ recipes except the one on the right-hand side.
+ Here is an example:
+ <literallayout class='monospaced'>
+ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += "*->quilt-native"
+ </literallayout>
+ </para>
+
+ <para>
+ In the previous example, all recipes except
+ <filename>quilt-native</filename> ignore task
+ signatures from the <filename>quilt-native</filename>
+ recipe when determining their task signatures.
+ </para>
+
+ <para>
+ Use of this variable is one mechanism to remove dependencies
+ that affect task signatures and thus force rebuilds when a
+ recipe changes.
+ <note><title>Caution</title>
+ If you add an inappropriate dependency for a recipe
+ relationship, the software might break during
+ runtime if the interface of the second recipe was
+ changed after the first recipe had been built.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SIGGEN_EXCLUDERECIPES_ABISAFE'><glossterm>SIGGEN_EXCLUDERECIPES_ABISAFE</glossterm>
+ <info>
+ SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of recipes that are completely stable and will
+ never change.
+ The ABI for the recipes in the list are presented by
+ output from the tasks run to build the recipe.
+ Use of this variable is one way to remove dependencies from
+ one recipe on another that affect task signatures and
+ thus force rebuilds when the recipe changes.
+ <note><title>Caution</title>
+ If you add an inappropriate variable to this list,
+ the software might break at runtime if the
+ interface of the recipe was changed after the other
+ had been built.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SITEINFO_BITS'><glossterm>SITEINFO_BITS</glossterm>
+ <info>
+ SITEINFO_BITS[doc] = "Specifies the number of bits for the target system CPU."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the number of bits for the target system CPU.
+ The value should be either "32" or "64".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SITEINFO_ENDIANNESS'><glossterm>SITEINFO_ENDIANNESS</glossterm>
+ <info>
+ SITEINFO_ENDIANNESS[doc] = "Specifies the endian byte order of the target system. The value should be either 'le' for 'little-endian' or 'be' for 'big-endian'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the endian byte order of the target system.
+ The value should be either "le" for little-endian or "be" for big-endian.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SKIP_FILEDEPS'><glossterm>SKIP_FILEDEPS</glossterm>
+ <info>
+ SKIP_FILEDEPS[doc] = "Enables you to remove all files from
+ the "Provides" section of an RPM package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Enables removal of all files from the "Provides" section of
+ an RPM package.
+ Removal of these files is required for packages containing
+ prebuilt binaries and libraries such as
+ <filename>libstdc++</filename> and
+ <filename>glibc</filename>.
+ </para>
+
+ <para>
+ To enable file removal, set the variable to "1" in your
+ <filename>conf/local.conf</filename> configuration file
+ in your:
+ <link linkend='build-directory'>Build Directory</link>.
+ <literallayout class='monospaced'>
+ SKIP_FILEDEPS = "1"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SOC_FAMILY'><glossterm>SOC_FAMILY</glossterm>
+ <info>
+ SOC_FAMILY[doc] = "Groups together machines based upon the same family of SOC (System On Chip). You typically set this variable in a common .inc file that you include in the configuration files of all the machines."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Groups together machines based upon the same family
+ of SOC (System On Chip).
+ You typically set this variable in a common
+ <filename>.inc</filename> file that you include in the
+ configuration files of all the machines.
+ <note>
+ You must include
+ <filename>conf/machine/include/soc-family.inc</filename>
+ for this variable to appear in
+ <link linkend='var-MACHINEOVERRIDES'><filename>MACHINEOVERRIDES</filename></link>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SOLIBS'><glossterm>SOLIBS</glossterm>
+ <info>
+ SOLIBS[doc] = "Defines the suffix for shared libraries used on the target platform."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the suffix for shared libraries used on the
+ target platform.
+ By default, this suffix is ".so.*" for all Linux-based
+ systems and is defined in the
+ <filename>meta/conf/bitbake.conf</filename> configuration
+ file.
+ </para>
+
+ <para>
+ You will see this variable referenced in the default values
+ of <filename>FILES_${PN}</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SOLIBSDEV'><glossterm>SOLIBSDEV</glossterm>
+ <info>
+ SOLIBSDEV[doc] = "Defines the suffix for the development symbolic link (symlink) for shared libraries on the target platform."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines the suffix for the development symbolic link
+ (symlink) for shared libraries on the target platform.
+ By default, this suffix is ".so" for Linux-based
+ systems and is defined in the
+ <filename>meta/conf/bitbake.conf</filename> configuration
+ file.
+ </para>
+
+ <para>
+ You will see this variable referenced in the default values
+ of <filename>FILES_${PN}-dev</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SOURCE_MIRROR_FETCH'><glossterm>SOURCE_MIRROR_FETCH</glossterm>
+ <info>
+ SOURCE_MIRROR_FETCH[doc] = "Set as part of a source mirror generation script to skip COMPATIBLE_MACHINE and COMPATIBLE_HOST checks."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When you are fetching files to create a mirror of sources
+ (i.e. creating a source mirror), setting
+ <filename>SOURCE_MIRROR_FETCH</filename> to "1" in your
+ <filename>local.conf</filename> configuration file ensures
+ the source for all recipes are fetched regardless of
+ whether or not a recipe is compatible with the
+ configuration.
+ A recipe is considered incompatible with the currently
+ configured machine when either or both the
+ <link linkend='var-COMPATIBLE_MACHINE'><filename>COMPATIBLE_MACHINE</filename></link>
+ variable and
+ <link linkend='var-COMPATIBLE_HOST'><filename>COMPATIBLE_HOST</filename></link>
+ variables specify compatibility with a machine other
+ than that of the current machine or host.
+ <note><title>Warning</title>
+ Do not set the
+ <filename>SOURCE_MIRROR_FETCH</filename> variable
+ unless you are creating a source mirror.
+ In other words, do not set the variable during a
+ normal build.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SOURCE_MIRROR_URL'><glossterm>SOURCE_MIRROR_URL</glossterm>
+ <info>
+ SOURCE_MIRROR_URL[doc] = "URL to source mirror that will be used before fetching from original SRC_URI."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Defines your own
+ <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ from which to first fetch source before attempting to fetch
+ from the upstream specified in
+ <link linkend='var-SRC_URI'><filename>SRC_URI</filename></link>.
+ </para>
+
+ <para>
+ To use this variable, you must globally inherit the
+ <link linkend='ref-classes-own-mirrors'><filename>own-mirrors</filename></link>
+ class and then provide the URL to your mirrors.
+ Here is the general syntax:
+ <literallayout class='monospaced'>
+ INHERIT += "own-mirrors"
+ SOURCE_MIRROR_URL = "http://<replaceable>example</replaceable>.com/<replaceable>my_source_mirror</replaceable>"
+ </literallayout>
+ <note>
+ You can specify only a single URL in
+ <filename>SOURCE_MIRROR_URL</filename>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SPDXLICENSEMAP'><glossterm>SPDXLICENSEMAP</glossterm>
+ <info>
+ SPDXLICENSEMAP[doc] = "Maps commonly used license names to their SPDX counterparts found in meta/files/common-licenses/."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Maps commonly used license names to their SPDX counterparts
+ found in <filename>meta/files/common-licenses/</filename>.
+ For the default <filename>SPDXLICENSEMAP</filename>
+ mappings, see the
+ <filename>meta/conf/licenses.conf</filename> file.
+ </para>
+
+ <para>
+ For additional information, see the
+ <link linkend='var-LICENSE'><filename>LICENSE</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SPECIAL_PKGSUFFIX'><glossterm>SPECIAL_PKGSUFFIX</glossterm>
+ <info>
+ SPECIAL_PKGSUFFIX[doc] = "A list of prefixes for PN used by the OpenEmbedded build system to create variants of recipes or packages. The list specifies the prefixes to strip off during certain circumstances such as the generation of the BPN variable."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of prefixes for <link linkend='var-PN'><filename>PN</filename></link> used by the
+ OpenEmbedded build system to create variants of recipes or packages.
+ The list specifies the prefixes to strip off during certain circumstances
+ such as the generation of the <link linkend='var-BPN'><filename>BPN</filename></link> variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SPL_BINARY'><glossterm>SPL_BINARY</glossterm>
+ <info>
+ SPL_BINARY[doc] = "The file type of the Secondary Program Loader (SPL)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The file type for the Secondary Program Loader (SPL).
+ Some devices use an SPL from which to boot (e.g. the
+ BeagleBone development board).
+ For such cases, you can declare the file type of the
+ SPL binary in the <filename>u-boot.inc</filename> include
+ file, which is used in the U-Boot recipe.
+ </para>
+
+ <para>
+ The SPL file type is set to "null" by default in the
+ <filename>u-boot.inc</filename> file as follows:
+ <literallayout class='monospaced'>
+ # Some versions of u-boot build an SPL (Second Program Loader) image that
+ # should be packaged along with the u-boot binary as well as placed in the
+ # deploy directory. For those versions they can set the following variables
+ # to allow packaging the SPL.
+ SPL_BINARY ?= ""
+ SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
+ SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}"
+ SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
+ </literallayout>
+ The <filename>SPL_BINARY</filename> variable helps form
+ various <filename>SPL_*</filename> variables used by
+ the OpenEmbedded build system.
+ </para>
+
+ <para>
+ See the BeagleBone machine configuration example in the
+ "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-bitbake-layers-script'>Creating a new BSP Layer Using the <filename>bitbake-layers</filename> Script</ulink>"
+ section in the Yocto Project Board Support Package
+ Developer's Guide for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRC_URI'><glossterm>SRC_URI</glossterm>
+ <info>
+ SRC_URI[doc] = "The list of source files - local or remote. This variable tells the OpenEmbedded build system what bits to pull in for the build and how to pull them in."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The list of source files - local or remote.
+ This variable tells the OpenEmbedded build system which bits
+ to pull in for the build and how to pull them in.
+ For example, if the recipe or append file only needs to
+ fetch a tarball from the Internet, the recipe or
+ append file uses a single <filename>SRC_URI</filename>
+ entry.
+ On the other hand, if the recipe or append file needs to
+ fetch a tarball, apply two patches, and include a custom
+ file, the recipe or append file would include four
+ instances of the variable.
+ </para>
+
+ <para>
+ The following list explains the available URI protocols.
+ URI protocols are highly dependent on particular BitBake
+ Fetcher submodules.
+ Depending on the fetcher BitBake uses, various URL
+ parameters are employed.
+ For specifics on the supported Fetchers, see the
+ "<ulink url='&YOCTO_DOCS_BB_URL;#bb-fetchers'>Fetchers</ulink>"
+ section in the BitBake User Manual.
+ <itemizedlist>
+ <listitem><para><emphasis><filename>file://</filename> -</emphasis>
+ Fetches files, which are usually files shipped with
+ the
+ <link linkend='metadata'>Metadata</link>,
+ from the local machine (e.g.
+ <ulink url='&YOCTO_DOCS_OM_URL;#patching-dev-environment'>patch</ulink>
+ files).
+ The path is relative to the
+ <link linkend='var-FILESPATH'><filename>FILESPATH</filename></link>
+ variable.
+ Thus, the build system searches, in order, from the
+ following directories, which are assumed to be a
+ subdirectories of the directory in which the
+ recipe file (<filename>.bb</filename>) or
+ append file (<filename>.bbappend</filename>)
+ resides:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>${BPN}</filename> -</emphasis>
+ The base recipe name without any special
+ suffix or version numbers.
+ </para></listitem>
+ <listitem><para><emphasis><filename>${BP}</filename> -</emphasis>
+ <filename>${<link linkend='var-BPN'>BPN</link>}-${PV}</filename>.
+ The base recipe name and version but without
+ any special package name suffix.
+ </para></listitem>
+ <listitem><para><emphasis>files -</emphasis>
+ Files within a directory, which is named
+ <filename>files</filename> and is also
+ alongside the recipe or append file.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ If you want the build system to pick up files
+ specified through a
+ <filename>SRC_URI</filename>
+ statement from your append file, you need to be
+ sure to extend the
+ <filename>FILESPATH</filename>
+ variable by also using the
+ <link linkend='var-FILESEXTRAPATHS'><filename>FILESEXTRAPATHS</filename></link>
+ variable from within your append file.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis><filename>bzr://</filename> -</emphasis> Fetches files from a
+ Bazaar revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>git://</filename> -</emphasis> Fetches files from a
+ Git revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>osc://</filename> -</emphasis> Fetches files from
+ an OSC (OpenSUSE Build service) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>repo://</filename> -</emphasis> Fetches files from
+ a repo (Git) repository.</para></listitem>
+ <listitem><para><emphasis><filename>ccrc://</filename> -</emphasis>
+ Fetches files from a ClearCase repository.
+ </para></listitem>
+ <listitem><para><emphasis><filename>http://</filename> -</emphasis> Fetches files from
+ the Internet using <filename>http</filename>.</para></listitem>
+ <listitem><para><emphasis><filename>https://</filename> -</emphasis> Fetches files
+ from the Internet using <filename>https</filename>.</para></listitem>
+ <listitem><para><emphasis><filename>ftp://</filename> -</emphasis> Fetches files
+ from the Internet using <filename>ftp</filename>.</para></listitem>
+ <listitem><para><emphasis><filename>cvs://</filename> -</emphasis> Fetches files from
+ a CVS revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>hg://</filename> -</emphasis> Fetches files from
+ a Mercurial (<filename>hg</filename>) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>p4://</filename> -</emphasis> Fetches files from
+ a Perforce (<filename>p4</filename>) revision control repository.</para></listitem>
+ <listitem><para><emphasis><filename>ssh://</filename> -</emphasis> Fetches files from
+ a secure shell.</para></listitem>
+ <listitem><para><emphasis><filename>svn://</filename> -</emphasis> Fetches files from
+ a Subversion (<filename>svn</filename>) revision control repository.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Standard and recipe-specific options for <filename>SRC_URI</filename> exist.
+ Here are standard options:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>apply</filename> -</emphasis> Whether to apply
+ the patch or not.
+ The default action is to apply the patch.</para></listitem>
+ <listitem><para><emphasis><filename>striplevel</filename> -</emphasis> Which
+ striplevel to use when applying the patch.
+ The default level is 1.</para></listitem>
+ <listitem><para><emphasis><filename>patchdir</filename> -</emphasis> Specifies
+ the directory in which the patch should be applied.
+ The default is <filename>${</filename><link linkend='var-S'><filename>S</filename></link><filename>}</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Here are options specific to recipes building code from a revision control system:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>mindate</filename> -</emphasis>
+ Apply the patch only if
+ <link linkend='var-SRCDATE'><filename>SRCDATE</filename></link>
+ is equal to or greater than <filename>mindate</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>maxdate</filename> -</emphasis>
+ Apply the patch only if <filename>SRCDATE</filename>
+ is not later than <filename>mindate</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>minrev</filename> -</emphasis>
+ Apply the patch only if <filename>SRCREV</filename>
+ is equal to or greater than <filename>minrev</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>maxrev</filename> -</emphasis>
+ Apply the patch only if <filename>SRCREV</filename>
+ is not later than <filename>maxrev</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>rev</filename> -</emphasis>
+ Apply the patch only if <filename>SRCREV</filename>
+ is equal to <filename>rev</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>notrev</filename> -</emphasis>
+ Apply the patch only if <filename>SRCREV</filename>
+ is not equal to <filename>rev</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Here are some additional options worth mentioning:
+ <itemizedlist>
+ <listitem><para><emphasis><filename>unpack</filename> -</emphasis> Controls
+ whether or not to unpack the file if it is an archive.
+ The default action is to unpack the file.</para></listitem>
+ <listitem><para><emphasis><filename>destsuffix</filename> -</emphasis> Places the file
+ (or extracts its contents) into the specified
+ subdirectory of <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ when the Git fetcher is used.
+ </para></listitem>
+ <listitem><para><emphasis><filename>subdir</filename> -</emphasis> Places the file
+ (or extracts its contents) into the specified
+ subdirectory of <filename>WORKDIR</filename>
+ when the local (<filename>file://</filename>)
+ fetcher is used.
+ </para></listitem>
+ <listitem><para><emphasis><filename>localdir</filename> -</emphasis> Places the file
+ (or extracts its contents) into the specified
+ subdirectory of <filename>WORKDIR</filename> when
+ the CVS fetcher is used.
+ </para></listitem>
+ <listitem><para><emphasis><filename>subpath</filename> -</emphasis>
+ Limits the checkout to a specific subpath of the
+ tree when using the Git fetcher is used.
+ </para></listitem>
+ <listitem><para><emphasis><filename>name</filename> -</emphasis> Specifies a
+ name to be used for association with <filename>SRC_URI</filename> checksums
+ when you have more than one file specified in <filename>SRC_URI</filename>.
+ </para></listitem>
+ <listitem><para><emphasis><filename>downloadfilename</filename> -</emphasis> Specifies
+ the filename used when storing the downloaded file.</para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRC_URI_OVERRIDES_PACKAGE_ARCH'><glossterm>SRC_URI_OVERRIDES_PACKAGE_ARCH</glossterm>
+ <info>
+ SRC_URI_OVERRIDES_PACKAGE_ARCH[doc] = "By default, the OpenEmbedded build system automatically detects whether SRC_URI contains files that are machine-specific. If so, the build system automatically changes PACKAGE_ARCH. Setting this variable to '0' disables this behavior."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ By default, the OpenEmbedded build system automatically detects whether
+ <filename><link linkend='var-SRC_URI'>SRC_URI</link></filename>
+ contains files that are machine-specific.
+ If so, the build system automatically changes
+ <filename><link linkend='var-PACKAGE_ARCH'>PACKAGE_ARCH</link></filename>.
+ Setting this variable to "0" disables this behavior.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCDATE'><glossterm>SRCDATE</glossterm>
+ <info>
+ SRCDATE[doc] = "The date of the source code used to build the package. This variable applies only if the source was fetched from a Source Code Manager (SCM)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The date of the source code used to build the package.
+ This variable applies only if the source was fetched from a Source Code Manager (SCM).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCPV'><glossterm>SRCPV</glossterm>
+ <info>
+ SRCPV[doc] = "Returns the version string of the current package. This string is used to help define the value of PV."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Returns the version string of the current package.
+ This string is used to help define the value of
+ <link linkend='var-PV'><filename>PV</filename></link>.
+ </para>
+
+ <para>
+ The <filename>SRCPV</filename> variable is defined in the
+ <filename>meta/conf/bitbake.conf</filename> configuration
+ file in the
+ <link linkend='source-directory'>Source Directory</link>
+ as follows:
+ <literallayout class='monospaced'>
+ SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+ </literallayout>
+ </para>
+
+ <para>
+ Recipes that need to define <filename>PV</filename> do so
+ with the help of the <filename>SRCPV</filename>.
+ For example, the <filename>ofono</filename> recipe
+ (<filename>ofono_git.bb</filename>) located in
+ <filename>meta/recipes-connectivity</filename> in the
+ Source Directory defines <filename>PV</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ PV = "0.12-git${SRCPV}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SRCREV'><glossterm>SRCREV</glossterm>
+ <info>
+ SRCREV[doc] = "The revision of the source code used to build the package. This variable applies to Subversion, Git, Mercurial, and Bazaar only."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The revision of the source code used to build the package.
+ This variable applies to Subversion, Git, Mercurial, and
+ Bazaar only.
+ Note that if you want to build a fixed revision and you
+ want to avoid performing a query on the remote repository
+ every time BitBake parses your recipe, you should specify
+ a <filename>SRCREV</filename> that is a
+ full revision identifier and not just a tag.
+ <note>
+ For information on limitations when inheriting the
+ latest revision of software using
+ <filename>SRCREV</filename>, see the
+ <link linkend='var-AUTOREV'><filename>AUTOREV</filename></link>
+ variable description and the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#automatically-incrementing-a-binary-package-revision-number'>Automatically Incrementing a Binary Package Revision Number</ulink>"
+ section, which is in the Yocto Project Development
+ Tasks Manual.
+ </note>
+ </para>
+
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SSTATE_DIR'><glossterm>SSTATE_DIR</glossterm>
+ <info>
+ SSTATE_DIR[doc] = "The directory for the shared state cache."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory for the shared state cache.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SSTATE_MIRROR_ALLOW_NETWORK'><glossterm>SSTATE_MIRROR_ALLOW_NETWORK</glossterm>
+ <info>
+ SSTATE_MIRROR_ALLOW_NETWORK[doc] = "If set to "1", allows fetches from mirrors that are specified in SSTATE_MIRRORS to work even when fetching from the network is disabled by setting BB_NO_NETWORK to "1"."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "1", allows fetches from
+ mirrors that are specified in
+ <link linkend='var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></link>
+ to work even when fetching from the network is
+ disabled by setting <filename>BB_NO_NETWORK</filename>
+ to "1".
+ Using the
+ <filename>SSTATE_MIRROR_ALLOW_NETWORK</filename>
+ variable is useful if you have set
+ <filename>SSTATE_MIRRORS</filename> to point to an
+ internal server for your shared state cache, but
+ you want to disable any other fetching from the network.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SSTATE_MIRRORS'><glossterm>SSTATE_MIRRORS</glossterm>
+ <info>
+ SSTATE_MIRRORS[doc] = "Configures the OpenEmbedded build system to search other mirror locations for prebuilt cache data objects before building out the data. You can specify a filesystem directory or a remote URL such as HTTP or FTP."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Configures the OpenEmbedded build system to search other
+ mirror locations for prebuilt cache data objects before
+ building out the data.
+ This variable works like fetcher
+ <link linkend='var-MIRRORS'><filename>MIRRORS</filename></link>
+ and <link linkend='var-PREMIRRORS'><filename>PREMIRRORS</filename></link>
+ and points to the cache locations to check for the shared
+ objects.
+ </para>
+
+ <para>
+ You can specify a filesystem directory or a remote URL such
+ as HTTP or FTP.
+ The locations you specify need to contain the shared state
+ cache (sstate-cache) results from previous builds.
+ The sstate-cache you point to can also be from builds on
+ other machines.
+ </para>
+
+ <para>
+ If a mirror uses the same structure as
+ <link linkend='var-SSTATE_DIR'><filename>SSTATE_DIR</filename></link>,
+ you need to add
+ "PATH" at the end as shown in the examples below.
+ The build system substitutes the correct path within the
+ directory structure.
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS ?= "\
+ file://.* http://<replaceable>someserver</replaceable>.tld/share/sstate/PATH;downloadfilename=PATH \n \
+ file://.* file:///<replaceable>some-local-dir</replaceable>/sstate/PATH"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SSTATE_SCAN_FILES'><glossterm>SSTATE_SCAN_FILES</glossterm>
+ <info>
+ SSTATE_SCAN_FILES[doc] = "Controls the list of files the OpenEmbedded build system scans for hardcoded installation paths."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Controls the list of files the OpenEmbedded build system
+ scans for hardcoded installation paths. The variable uses a
+ space-separated list of filenames (not paths) with standard
+ wildcard characters allowed.
+ </para>
+
+ <para>
+ During a build, the OpenEmbedded build system creates a
+ shared state (sstate) object during the first stage of
+ preparing the sysroots. That object is scanned for
+ hardcoded paths for original installation locations.
+ The list of files that are scanned for paths is controlled
+ by the <filename>SSTATE_SCAN_FILES</filename> variable.
+ Typically, recipes add files they want to be scanned to the
+ value of <filename>SSTATE_SCAN_FILES</filename> rather than
+ the variable being comprehensively set. The
+ <link linkend='ref-classes-sstate'><filename>sstate</filename></link>
+ class specifies the default list of files.
+ </para>
+
+ <para>
+ For details on the process, see the
+ <link linkend='ref-classes-staging'><filename>staging</filename></link>
+ class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_BASE_LIBDIR_NATIVE'><glossterm>STAGING_BASE_LIBDIR_NATIVE</glossterm>
+ <info>
+ STAGING_BASE_LIBDIR_NATIVE[doc] = "Specifies the path to the /lib subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/lib</filename>
+ subdirectory of the sysroot directory for the
+ build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_BASELIBDIR'><glossterm>STAGING_BASELIBDIR</glossterm>
+ <info>
+ STAGING_BASELIBDIR[doc] = "Specifies the path to the /lib subdirectory of the sysroot directory for the target for which the current recipe is being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/lib</filename>
+ subdirectory of the sysroot directory for the target
+ for which the current recipe is being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_BINDIR'><glossterm>STAGING_BINDIR</glossterm>
+ <info>
+ STAGING_BINDIR[doc] = "Specifies the path to the /usr/bin subdirectory of the sysroot directory for the target for which the current recipe is being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the
+ <filename>/usr/bin</filename> subdirectory of the
+ sysroot directory for the target for which the current
+ recipe is being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_BINDIR_CROSS'><glossterm>STAGING_BINDIR_CROSS</glossterm>
+ <info>
+ STAGING_BINDIR_CROSS[doc] = "Specifies the path to the directory containing binary configuration scripts. These scripts provide configuration information for other software that wants to make use of libraries or include files provided by the software associated with the script."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the directory containing binary
+ configuration scripts.
+ These scripts provide configuration information for
+ other software that wants to make use of libraries or
+ include files provided by the software associated with
+ the script.
+ <note>
+ This style of build configuration has been largely
+ replaced by <filename>pkg-config</filename>.
+ Consequently, if <filename>pkg-config</filename>
+ is supported by the library to which you are linking,
+ it is recommended you use
+ <filename>pkg-config</filename> instead of a
+ provided configuration script.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_BINDIR_NATIVE'><glossterm>STAGING_BINDIR_NATIVE</glossterm>
+ <info>
+ STAGING_BINDIR_NATIVE[doc] = "Specifies the path to the /usr/bin subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the
+ <filename>/usr/bin</filename> subdirectory of the
+ sysroot directory for the build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DATADIR'><glossterm>STAGING_DATADIR</glossterm>
+ <info>
+ STAGING_DATADIR[doc] = "Specifies the path to the /usr/share subdirectory of the sysroot directory for the target for which the current recipe is being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr/share</filename>
+ subdirectory of the sysroot directory for the target
+ for which the current recipe is being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DATADIR_NATIVE'><glossterm>STAGING_DATADIR_NATIVE</glossterm>
+ <info>
+ STAGING_DATADIR_NATIVE[doc] = "Specifies the path to the /usr/share subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr/share</filename>
+ subdirectory of the sysroot directory for the build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DIR'><glossterm>STAGING_DIR</glossterm>
+ <info>
+ STAGING_DIR[doc] = "Helps construct the recipe-sysroots directory, which is used during packaging."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Helps construct the <filename>recipe-sysroots</filename>
+ directory, which is used during packaging.
+ </para>
+
+ <para>
+ For information on how staging for recipe-specific
+ sysroots occurs, see the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task, the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#new-sharing-files-between-recipes'>Sharing Files Between Recipes</ulink>"
+ section in the Yocto Project Development Tasks Manual, the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#configuration-compilation-and-staging-dev-environment'>Configuration, Compilation, and Staging</ulink>"
+ section in the Yocto Project Overview and Concepts Manual,
+ and the
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>
+ variable.
+ <note>
+ Recipes should never write files directly under
+ the <filename>STAGING_DIR</filename> directory because
+ the OpenEmbedded build system
+ manages the directory automatically.
+ Instead, files should be installed to
+ <filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
+ within your recipe's
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>
+ task and then the OpenEmbedded build system will
+ stage a subset of those files into the sysroot.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DIR_HOST'><glossterm>STAGING_DIR_HOST</glossterm>
+ <info>
+ STAGING_DIR_HOST[doc] = "Specifies the path to the sysroot directory for the system that the component is built to run on."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the sysroot directory for the system
+ on which the component is built to run (the system that
+ hosts the component).
+ For most recipes, this sysroot is the one in which that
+ recipe's
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task copies files.
+ Exceptions include <filename>-native</filename> recipes,
+ where the <filename>do_populate_sysroot</filename> task
+ instead uses
+ <link linkend='var-STAGING_DIR_NATIVE'><filename>STAGING_DIR_NATIVE</filename></link>.
+ Depending on the type of recipe and the build target,
+ <filename>STAGING_DIR_HOST</filename> can have the
+ following values:
+ <itemizedlist>
+ <listitem><para>
+ For recipes building for the target machine, the
+ value is
+ "${<link linkend='var-STAGING_DIR'>STAGING_DIR</link>}/${<link linkend='var-MACHINE'>MACHINE</link>}".
+ </para></listitem>
+ <listitem><para>
+ For native recipes building for the build host, the
+ value is empty given the assumption that when
+ building for the build host, the build host's own
+ directories should be used.
+ <note>
+ <para><filename>-native</filename> recipes are
+ not installed into host paths like such as
+ <filename>/usr</filename>.
+ Rather, these recipes are installed into
+ <filename>STAGING_DIR_NATIVE</filename>.
+ When compiling <filename>-native</filename>
+ recipes, standard build environment variables
+ such as
+ <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link>
+ and
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ are set up so that both host paths and
+ <filename>STAGING_DIR_NATIVE</filename> are
+ searched for libraries and headers using, for
+ example, GCC's <filename>-isystem</filename>
+ option.</para>
+
+ <para>Thus, the emphasis is that the
+ <filename>STAGING_DIR*</filename> variables
+ should be viewed as input variables by tasks
+ such as
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>,
+ <link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
+ and
+ <link linkend='ref-tasks-install'><filename>do_install</filename></link>.
+ Having the real system root correspond to
+ <filename>STAGING_DIR_HOST</filename> makes
+ conceptual sense for
+ <filename>-native</filename> recipes, as
+ they make use of host headers and libraries.
+ </para>
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DIR_NATIVE'><glossterm>STAGING_DIR_NATIVE</glossterm>
+ <info>
+ STAGING_DIR_NATIVE[doc] = "Specifies the path to the sysroot directory used when building components that run on the build host itself."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the sysroot directory used when
+ building components that run on the build host itself.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_DIR_TARGET'><glossterm>STAGING_DIR_TARGET</glossterm>
+ <info>
+ STAGING_DIR_TARGET[doc] = "Specifies the path to the sysroot used for the system for which the component generates code."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the sysroot used for the system for
+ which the component generates code.
+ For components that do not generate code, which is the
+ majority, <filename>STAGING_DIR_TARGET</filename> is set
+ to match
+ <link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>.
+ </para>
+
+ <para>
+ Some recipes build binaries that can run on the target
+ system but those binaries in turn generate code for
+ another different system (e.g. cross-canadian recipes).
+ Using terminology from GNU, the primary system is referred
+ to as the "HOST" and the secondary, or different, system is
+ referred to as the "TARGET".
+ Thus, the binaries run on the "HOST" system
+ and generate binaries for the "TARGET" system.
+ The <filename>STAGING_DIR_HOST</filename> variable points
+ to the sysroot used for the "HOST" system, while
+ <filename>STAGING_DIR_TARGET</filename>
+ points to the sysroot used for the "TARGET" system.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_ETCDIR_NATIVE'><glossterm>STAGING_ETCDIR_NATIVE</glossterm>
+ <info>
+ STAGING_ETCDIR_NATIVE[doc] = "Specifies the path to the /etc subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/etc</filename>
+ subdirectory of the sysroot directory for the
+ build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_EXECPREFIXDIR'><glossterm>STAGING_EXECPREFIXDIR</glossterm>
+ <info>
+ STAGING_EXECPREFIXDIR[doc] = "Specifies the path to the /usr subdirectory of the sysroot directory for the target for which the current recipe is being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr</filename>
+ subdirectory of the sysroot directory for the target
+ for which the current recipe is being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_INCDIR'><glossterm>STAGING_INCDIR</glossterm>
+ <info>
+ STAGING_INCDIR[doc] = "Specifies the path to the /usr/include subdirectory of the sysroot directory for the target for which the current recipe being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the
+ <filename>/usr/include</filename> subdirectory of the
+ sysroot directory for the target for which the current
+ recipe being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_INCDIR_NATIVE'><glossterm>STAGING_INCDIR_NATIVE</glossterm>
+ <info>
+ STAGING_INCDIR_NATIVE[doc] = "Specifies the path to the /usr/include subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr/include</filename>
+ subdirectory of the sysroot directory for the build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_KERNEL_BUILDDIR'><glossterm>STAGING_KERNEL_BUILDDIR</glossterm>
+ <info>
+ STAGING_KERNEL_BUILDDIR[doc] = "Points to the directory containing the kernel build artifacts."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the directory containing the kernel build
+ artifacts.
+ Recipes building software that needs to access kernel
+ build artifacts
+ (e.g. <filename>systemtap-uprobes</filename>) can look in
+ the directory specified with the
+ <filename>STAGING_KERNEL_BUILDDIR</filename> variable to
+ find these artifacts after the kernel has been built.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_KERNEL_DIR'><glossterm>STAGING_KERNEL_DIR</glossterm>
+ <info>
+ STAGING_KERNEL_DIR[doc] = "The directory with kernel headers that are required to build out-of-tree modules."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory with kernel headers that are required to build out-of-tree
+ modules.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_LIBDIR'><glossterm>STAGING_LIBDIR</glossterm>
+ <info>
+ STAGING_LIBDIR[doc] = "Specifies the path to the /usr/lib subdirectory of the sysroot directory for the target for which the current recipe is being built (STAGING_DIR_HOST)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr/lib</filename>
+ subdirectory of the sysroot directory for the target for
+ which the current recipe is being built
+ (<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAGING_LIBDIR_NATIVE'><glossterm>STAGING_LIBDIR_NATIVE</glossterm>
+ <info>
+ STAGING_LIBDIR_NATIVE[doc] = "Specifies the path to the /usr/lib subdirectory of the sysroot directory for the build host."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the path to the <filename>/usr/lib</filename>
+ subdirectory of the sysroot directory for the build host.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAMP'><glossterm>STAMP</glossterm>
+ <info>
+ STAMP[doc] = "Specifies the base path used to create recipe stamp files. The path to an actual stamp file is constructed by evaluating this string and then appending additional information."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the base path used to create recipe stamp files.
+ The path to an actual stamp file is constructed by evaluating this
+ string and then appending additional information.
+ Currently, the default assignment for <filename>STAMP</filename>
+ as set in the <filename>meta/conf/bitbake.conf</filename> file
+ is:
+ <literallayout class='monospaced'>
+ STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on how BitBake uses stamp files to determine
+ if a task should be rerun, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#stamp-files-and-the-rerunning-of-tasks'>Stamp Files and the Rerunning of Tasks</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ </para>
+
+ <para>
+ See <link linkend='var-STAMPS_DIR'><filename>STAMPS_DIR</filename></link>,
+ <link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>,
+ <link linkend='var-PN'><filename>PN</filename></link>,
+ <link linkend='var-EXTENDPE'><filename>EXTENDPE</filename></link>,
+ <link linkend='var-PV'><filename>PV</filename></link>, and
+ <link linkend='var-PR'><filename>PR</filename></link> for related variable
+ information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STAMPS_DIR'><glossterm>STAMPS_DIR</glossterm>
+ <info>
+ STAMPS_DIR[doc] = "Specifies the base directory in which the OpenEmbedded build system places stamps."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the base directory in which the OpenEmbedded
+ build system places stamps.
+ The default directory is
+ <filename>${TMPDIR}/stamps</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-STRIP'><glossterm>STRIP</glossterm>
+ <info>
+ STRIP[doc] = "Minimal command and arguments to run 'strip' (strip symbols)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The minimal command and arguments to run
+ <filename>strip</filename>, which is used to strip
+ symbols.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SUMMARY'><glossterm>SUMMARY</glossterm>
+ <info>
+ SUMMARY[doc] = "The short (80 characters or less) summary of the binary package for packaging systems such as opkg, rpm, or dpkg. By default, SUMMARY is used to define the DESCRIPTION variable if DESCRIPTION is not set in the recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The short (72 characters or less) summary of the binary package for packaging
+ systems such as <filename>opkg</filename>, <filename>rpm</filename>, or
+ <filename>dpkg</filename>.
+ By default, <filename>SUMMARY</filename> is used to define
+ the <link linkend='var-DESCRIPTION'><filename>DESCRIPTION</filename></link>
+ variable if <filename>DESCRIPTION</filename> is not set
+ in the recipe.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SVNDIR'><glossterm>SVNDIR</glossterm>
+ <info>
+ SVNDIR[doc] = "The directory where Subversion checkouts are stored."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory in which files checked out of a Subversion
+ system are stored.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSLINUX_DEFAULT_CONSOLE'><glossterm>SYSLINUX_DEFAULT_CONSOLE</glossterm>
+ <info>
+ SYSLINUX_DEFAULT_CONSOLE[doc] = "Specifies the kernel boot default console."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the kernel boot default console.
+ If you want to use a console other than the default,
+ set this variable in your recipe as follows where "X" is
+ the console number you want to use:
+ <literallayout class='monospaced'>
+ SYSLINUX_DEFAULT_CONSOLE = "console=ttyX"
+ </literallayout>
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class initially sets this variable to null but then checks
+ for a value later.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSLINUX_OPTS'><glossterm>SYSLINUX_OPTS</glossterm>
+ <info>
+ SYSLINUX_OPTS[doc] = "Lists additional options to add to the syslinux file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Lists additional options to add to the syslinux file.
+ You need to set this variable in your recipe.
+ If you want to list multiple options, separate the options
+ with a semicolon character (<filename>;</filename>).
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class uses this variable to create a set of options.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSLINUX_SERIAL'><glossterm>SYSLINUX_SERIAL</glossterm>
+ <info>
+ SYSLINUX_SERIAL[doc] = "Specifies the alternate serial port or turns it off."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the alternate serial port or turns it off.
+ To turn off serial, set this variable to an empty string
+ in your recipe.
+ The variable's default value is set in the
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class as follows:
+ <literallayout class='monospaced'>
+ SYSLINUX_SERIAL ?= "0 115200"
+ </literallayout>
+ </para>
+
+ <para>
+ The class checks for and uses the variable as needed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSLINUX_SPLASH'><glossterm>SYSLINUX_SPLASH</glossterm>
+ <info>
+ SYSLINUX_SPLASH[doc] = "An .LSS file used as the background for the VGA boot menu when you use the boot menu."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An <filename>.LSS</filename> file used as the background
+ for the VGA boot menu when you use the boot menu.
+ You need to set this variable in your recipe.
+ </para>
+
+ <para>
+ The
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class checks for this variable and if found, the
+ OpenEmbedded build system installs the splash screen.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSLINUX_SERIAL_TTY'><glossterm>SYSLINUX_SERIAL_TTY</glossterm>
+ <info>
+ SYSLINUX_SERIAL_TTY[doc] = "Specifies the alternate console=tty... kernel boot argument."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the alternate console=tty... kernel boot argument.
+ The variable's default value is set in the
+ <link linkend='ref-classes-syslinux'><filename>syslinux</filename></link>
+ class as follows:
+ <literallayout class='monospaced'>
+ SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200"
+ </literallayout>
+ </para>
+
+ <para>
+ The class checks for and uses the variable as needed.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSROOT_DESTDIR'><glossterm>SYSROOT_DESTDIR</glossterm>
+ <info>
+ SYSROOT_DESTDIR[doc] = "Points to the temporary work directory (default ${WORKDIR}/sysroot-destdir) where the files populated into the sysroot are assembled during the do_populate_sysroot task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the temporary directory under the work directory
+ (default
+ "<filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}/sysroot-destdir</filename>")
+ where the files populated into the sysroot are assembled
+ during the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSROOT_DIRS'><glossterm>SYSROOT_DIRS</glossterm>
+ <info>
+ SYSROOT_DIRS[doc] = "Directories that are staged into the sysroot by the do_populate_sysroot task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Directories that are staged into the sysroot by the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task.
+ By default, the following directories are staged:
+ <literallayout class='monospaced'>
+ SYSROOT_DIRS = " \
+ ${includedir} \
+ ${libdir} \
+ ${base_libdir} \
+ ${nonarch_base_libdir} \
+ ${datadir} \
+ "
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSROOT_DIRS_BLACKLIST'><glossterm>SYSROOT_DIRS_BLACKLIST</glossterm>
+ <info>
+ SYSROOT_DIRS_BLACKLIST[doc] = "Directories that are not staged into the sysroot by the do_populate_sysroot task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Directories that are not staged into the sysroot by the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task.
+ You can use this variable to exclude certain subdirectories
+ of directories listed in
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>
+ from staging.
+ By default, the following directories are not staged:
+ <literallayout class='monospaced'>
+ SYSROOT_DIRS_BLACKLIST = " \
+ ${mandir} \
+ ${docdir} \
+ ${infodir} \
+ ${datadir}/locale \
+ ${datadir}/applications \
+ ${datadir}/fonts \
+ ${datadir}/pixmaps \
+ "
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSROOT_DIRS_NATIVE'><glossterm>SYSROOT_DIRS_NATIVE</glossterm>
+ <info>
+ SYSROOT_DIRS_NATIVE[doc] = "Extra directories staged into the sysroot by the do_populate_sysroot task for -native recipes, in addition to those specified in SYSROOT_DIRS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Extra directories staged into the sysroot by the
+ <link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
+ task for <filename>-native</filename> recipes, in addition
+ to those specified in
+ <link linkend='var-SYSROOT_DIRS'><filename>SYSROOT_DIRS</filename></link>.
+ By default, the following extra directories are staged:
+ <literallayout class='monospaced'>
+ SYSROOT_DIRS_NATIVE = " \
+ ${bindir} \
+ ${sbindir} \
+ ${base_bindir} \
+ ${base_sbindir} \
+ ${libexecdir} \
+ ${sysconfdir} \
+ ${localstatedir} \
+ "
+ </literallayout>
+ <note>
+ Programs built by <filename>-native</filename> recipes
+ run directly from the sysroot
+ (<link linkend='var-STAGING_DIR_NATIVE'><filename>STAGING_DIR_NATIVE</filename></link>),
+ which is why additional directories containing program
+ executables and supporting files need to be staged.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSROOT_PREPROCESS_FUNCS'><glossterm>SYSROOT_PREPROCESS_FUNCS</glossterm>
+ <info>
+ SYSROOT_PREPROCESS_FUNCS[doc] = "A list of functions to execute after files are staged into the sysroot. These functions are usually used to apply additional processing on the staged files, or to stage additional files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of functions to execute after files are staged into
+ the sysroot.
+ These functions are usually used to apply additional
+ processing on the staged files, or to stage additional
+ files.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_AUTO_ENABLE'><glossterm>SYSTEMD_AUTO_ENABLE</glossterm>
+ <info>
+ SYSTEMD_AUTO_ENABLE[doc] = "For recipes that inherit the systemd class, this variable specifies whether the specified service in SYSTEMD_SERVICE should start automatically or not."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-systemd'><filename>systemd</filename></link>
+ class, this variable specifies whether the specified service
+ in
+ <link linkend='var-SYSTEMD_SERVICE'><filename>SYSTEMD_SERVICE</filename></link>
+ should start automatically or not.
+ By default, the service is enabled to automatically start
+ at boot time.
+ The default setting is in the
+ <link linkend='ref-classes-systemd'><filename>systemd</filename></link>
+ class as follows:
+ <literallayout class='monospaced'>
+ SYSTEMD_AUTO_ENABLE ??= "enable"
+ </literallayout>
+ </para>
+
+ <para>
+ You can disable the service by setting the variable to
+ "disable".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_BOOT_CFG'><glossterm>SYSTEMD_BOOT_CFG</glossterm>
+ <info>
+ SYSTEMD_BOOT_CFG[doc] = "When EFI_PROVIDER is set to "systemd-boot", the SYSTEMD_BOOT_CFG variable specifies the configuration file that should be used."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ is set to "systemd-boot", the
+ <filename>SYSTEMD_BOOT_CFG</filename> variable specifies the
+ configuration file that should be used.
+ By default, the
+ <link linkend='ref-classes-systemd-boot'><filename>systemd-boot</filename></link>
+ class sets the <filename>SYSTEMD_BOOT_CFG</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ SYSTEMD_BOOT_CFG ?= "${<link linkend='var-S'>S</link>}/loader.conf"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Systemd-boot, see the
+ <ulink url='http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/'>Systemd-boot documentation</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_BOOT_ENTRIES'><glossterm>SYSTEMD_BOOT_ENTRIES</glossterm>
+ <info>
+ SYSTEMD_BOOT_ENTRIES[doc] = "When EFI_PROVIDER is set to "systemd-boot", the SYSTEMD_BOOT_ENTRIES variable specifies a list of entry files (*.conf) to install that contain one boot entry per file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ is set to "systemd-boot", the
+ <filename>SYSTEMD_BOOT_ENTRIES</filename> variable specifies
+ a list of entry files
+ (<filename>*.conf</filename>) to install that contain
+ one boot entry per file.
+ By default, the
+ <link linkend='ref-classes-systemd-boot'><filename>systemd-boot</filename></link>
+ class sets the <filename>SYSTEMD_BOOT_ENTRIES</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ SYSTEMD_BOOT_ENTRIES ?= ""
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Systemd-boot, see the
+ <ulink url='http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/'>Systemd-boot documentation</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_BOOT_TIMEOUT'><glossterm>SYSTEMD_BOOT_TIMEOUT</glossterm>
+ <info>
+ SYSTEMD_BOOT_TIMEOUT[doc] = "When EFI_PROVIDER is set to "systemd-boot", the SYSTEMD_BOOT_TIMEOUT variable specifies the boot menu timeout in seconds."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When
+ <link linkend='var-EFI_PROVIDER'><filename>EFI_PROVIDER</filename></link>
+ is set to "systemd-boot", the
+ <filename>SYSTEMD_BOOT_TIMEOUT</filename> variable specifies
+ the boot menu timeout in seconds.
+ By default, the
+ <link linkend='ref-classes-systemd-boot'><filename>systemd-boot</filename></link>
+ class sets the <filename>SYSTEMD_BOOT_TIMEOUT</filename> as
+ follows:
+ <literallayout class='monospaced'>
+ SYSTEMD_BOOT_TIMEOUT ?= "10"
+ </literallayout>
+ </para>
+
+ <para>
+ For information on Systemd-boot, see the
+ <ulink url='http://www.freedesktop.org/wiki/Software/systemd/systemd-boot/'>Systemd-boot documentation</ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_PACKAGES'><glossterm>SYSTEMD_PACKAGES</glossterm>
+ <info>
+ SYSTEMD_PACKAGES[doc] = "For recipes that inherit the systemd class, this variable locates the systemd unit files when they are not found in the main recipe's package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-systemd'><filename>systemd</filename></link>
+ class, this variable locates the systemd unit files when
+ they are not found in the main recipe's package.
+ By default, the
+ <filename>SYSTEMD_PACKAGES</filename> variable is set
+ such that the systemd unit files are assumed to reside in
+ the recipes main package:
+ <literallayout class='monospaced'>
+ SYSTEMD_PACKAGES ?= "${PN}"
+ </literallayout>
+ </para>
+
+ <para>
+ If these unit files are not in this recipe's main
+ package, you need to use
+ <filename>SYSTEMD_PACKAGES</filename> to list the package
+ or packages in which the build system can find the systemd
+ unit files.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSTEMD_SERVICE'><glossterm>SYSTEMD_SERVICE</glossterm>
+ <info>
+ SYSTEMD_SERVICE[doc] = "For recipes that inherit the systemd class, this variable specifies the systemd service name for a package."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-systemd'><filename>systemd</filename></link>
+ class, this variable specifies the systemd service name for
+ a package.
+ </para>
+
+ <para>
+ When you specify this file in your recipe, use a package
+ name override to indicate the package to which the value
+ applies.
+ Here is an example from the connman recipe:
+ <literallayout class='monospaced'>
+ SYSTEMD_SERVICE_${PN} = "connman.service"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-SYSVINIT_ENABLED_GETTYS'><glossterm>SYSVINIT_ENABLED_GETTYS</glossterm>
+ <info>
+ SYSVINIT_ENABLED_GETTYS[doc] = "Specifies which virtual terminals should run a getty, the default is '1'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When using
+ <ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-enabling-system-services'>SysVinit</ulink>,
+ specifies a space-separated list of the virtual terminals
+ that should run a
+ <ulink url='http://en.wikipedia.org/wiki/Getty_%28Unix%29'>getty</ulink>
+ (allowing login), assuming
+ <link linkend='var-USE_VT'><filename>USE_VT</filename></link>
+ is not set to "0".
+ </para>
+
+ <para>
+ The default value for
+ <filename>SYSVINIT_ENABLED_GETTYS</filename> is "1"
+ (i.e. only run a getty on the first virtual terminal).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-t'><title>T</title>
+
+ <glossentry id='var-T'><glossterm>T</glossterm>
+ <info>
+ T[doc] = "This variable points to a directory were BitBake places temporary files, which consist mostly of task logs and scripts, when building a particular recipe."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable points to a directory were BitBake places
+ temporary files, which consist mostly of task logs and
+ scripts, when building a particular recipe.
+ The variable is typically set as follows:
+ <literallayout class='monospaced'>
+ T = "${WORKDIR}/temp"
+ </literallayout>
+ </para>
+
+ <para>
+ The <link linkend='var-WORKDIR'><filename>WORKDIR</filename></link>
+ is the directory into which BitBake unpacks and builds the
+ recipe.
+ The default <filename>bitbake.conf</filename> file sets this variable.</para>
+ <para>The <filename>T</filename> variable is not to be confused with
+ the <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link> variable,
+ which points to the root of the directory tree where BitBake
+ places the output of an entire build.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_ARCH'><glossterm>TARGET_ARCH</glossterm>
+ <info>
+ TARGET_ARCH[doc] = "The architecture of the device being built. The OpenEmbedded build system supports the following architectures: arm, mips, ppc, x86, x86-64."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The target machine's architecture.
+ The OpenEmbedded build system supports many
+ architectures.
+ Here is an example list of architectures supported.
+ This list is by no means complete as the architecture
+ is configurable:
+ <literallayout class='monospaced'>
+ arm
+ i586
+ x86_64
+ powerpc
+ powerpc64
+ mips
+ mipsel
+ </literallayout>
+ </para>
+
+ <para>
+ For additional information on machine architectures, see
+ the
+ <link linkend='var-TUNE_ARCH'><filename>TUNE_ARCH</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_AS_ARCH'><glossterm>TARGET_AS_ARCH</glossterm>
+ <info>
+ TARGET_AS_ARCH[doc] = "Specifies architecture-specific assembler flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific assembler flags for the
+ target system.
+ <filename>TARGET_AS_ARCH</filename> is initialized from
+ <link linkend='var-TUNE_ASARGS'><filename>TUNE_ASARGS</filename></link>
+ by default in the BitBake configuration file
+ (<filename>meta/conf/bitbake.conf</filename>):
+ <literallayout class='monospaced'>
+ TARGET_AS_ARCH = "${TUNE_ASARGS}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_CC_ARCH'><glossterm>TARGET_CC_ARCH</glossterm>
+ <info>
+ TARGET_CC_ARCH[doc] = "Specifies architecture-specific C compiler flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific C compiler flags for the
+ target system.
+ <filename>TARGET_CC_ARCH</filename> is initialized from
+ <link linkend='var-TUNE_CCARGS'><filename>TUNE_CCARGS</filename></link>
+ by default.
+ <note>
+ It is a common workaround to append
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ to <filename>TARGET_CC_ARCH</filename>
+ in recipes that build software for the target that
+ would not otherwise respect the exported
+ <filename>LDFLAGS</filename> variable.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_CC_KERNEL_ARCH'><glossterm>TARGET_CC_KERNEL_ARCH</glossterm>
+ <info>
+ TARGET_CC_KERNEL_ARCH[doc] = "This is a specific kernel compiler flag for a CPU or Application Binary Interface (ABI) tune."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This is a specific kernel compiler flag for a CPU or
+ Application Binary Interface (ABI) tune.
+ The flag is used rarely and only for cases where a
+ userspace
+ <link linkend='var-TUNE_CCARGS'><filename>TUNE_CCARGS</filename></link>
+ is not compatible with the kernel compilation.
+ The <filename>TARGET_CC_KERNEL_ARCH</filename> variable
+ allows the kernel (and associated modules) to use a
+ different configuration.
+ See the
+ <filename>meta/conf/machine/include/arm/feature-arm-thumb.inc</filename>
+ file in the
+ <link linkend='source-directory'>Source Directory</link>
+ for an example.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_CFLAGS'><glossterm>TARGET_CFLAGS</glossterm>
+ <info>
+ TARGET_CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as CFLAGS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C compiler when building
+ for the target.
+ When building in the target context,
+ <link linkend='var-CFLAGS'><filename>CFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+
+ <para>
+ Additionally, the SDK's environment setup script sets
+ the <filename>CFLAGS</filename> variable in the environment
+ to the <filename>TARGET_CFLAGS</filename> value so that
+ executables built using the SDK also have the flags
+ applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_CPPFLAGS'><glossterm>TARGET_CPPFLAGS</glossterm>
+ <info>
+ TARGET_CPPFLAGS[doc] = "Specifies the flags to pass to the C pre-processor (i.e. to both the C and the C++ compilers) when building for the target."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C pre-processor
+ (i.e. to both the C and the C++ compilers) when building
+ for the target.
+ When building in the target context,
+ <link linkend='var-CPPFLAGS'><filename>CPPFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+
+ <para>
+ Additionally, the SDK's environment setup script sets
+ the <filename>CPPFLAGS</filename> variable in the
+ environment to the <filename>TARGET_CPPFLAGS</filename>
+ value so that executables built using the SDK also have
+ the flags applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_CXXFLAGS'><glossterm>TARGET_CXXFLAGS</glossterm>
+ <info>
+ TARGET_CXXFLAGS[doc] = "Specifies the flags to pass to the C++ compiler when building for the target."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the C++ compiler when
+ building for the target.
+ When building in the target context,
+ <link linkend='var-CXXFLAGS'><filename>CXXFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+
+ <para>
+ Additionally, the SDK's environment setup script sets
+ the <filename>CXXFLAGS</filename> variable in the
+ environment to the <filename>TARGET_CXXFLAGS</filename>
+ value so that executables built using the SDK also have
+ the flags applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_FPU'><glossterm>TARGET_FPU</glossterm>
+ <info>
+ TARGET_FPU[doc] = "Specifies the method for handling FPU code. For FPU-less targets, which include most ARM CPUs, the variable must be set to 'soft'. If not, the kernel emulation gets used, which results in a performance penalty."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the method for handling FPU code.
+ For FPU-less targets, which include most ARM CPUs, the variable must be
+ set to "soft".
+ If not, the kernel emulation gets used, which results in a performance penalty.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_LD_ARCH'><glossterm>TARGET_LD_ARCH</glossterm>
+ <info>
+ TARGET_LD_ARCH[doc] = "Specifies architecture-specific linker flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific linker flags for the
+ target system.
+ <filename>TARGET_LD_ARCH</filename> is initialized from
+ <link linkend='var-TUNE_LDARGS'><filename>TUNE_LDARGS</filename></link>
+ by default in the BitBake configuration file
+ (<filename>meta/conf/bitbake.conf</filename>):
+ <literallayout class='monospaced'>
+ TARGET_LD_ARCH = "${TUNE_LDARGS}"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_LDFLAGS'><glossterm>TARGET_LDFLAGS</glossterm>
+ <info>
+ TARGET_LDFLAGS[doc] = "Specifies the flags to pass to the linker when building for the target."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the flags to pass to the linker when building
+ for the target.
+ When building in the target context,
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ is set to the value of this variable by default.
+ </para>
+
+ <para>
+ Additionally, the SDK's environment setup script sets
+ the
+ <link linkend='var-LDFLAGS'><filename>LDFLAGS</filename></link>
+ variable in the environment to the
+ <filename>TARGET_LDFLAGS</filename> value so that
+ executables built using the SDK also have the flags
+ applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_OS'><glossterm>TARGET_OS</glossterm>
+ <info>
+ TARGET_OS[doc] = "Specifies the target's operating system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the target's operating system.
+ The variable can be set to "linux" for glibc-based systems
+ (GNU C Library) and to "linux-musl" for musl libc.
+ For ARM/EABI targets, "linux-gnueabi" and "linux-musleabi"
+ possible values exist.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_PREFIX'><glossterm>TARGET_PREFIX</glossterm>
+ <info>
+ TARGET_PREFIX[doc] = "The prefix used for the toolchain binary target tools."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the prefix used for the toolchain binary target
+ tools.
+ </para>
+
+ <para>
+ Depending on the type of recipe and the build target,
+ <filename>TARGET_PREFIX</filename> is set as follows:
+ <itemizedlist>
+ <listitem><para>
+ For recipes building for the target machine,
+ the value is
+ "${<link linkend='var-TARGET_SYS'>TARGET_SYS</link>}-".
+ </para></listitem>
+ <listitem><para>
+ For native recipes, the build system sets the
+ variable to the value of
+ <filename>BUILD_PREFIX</filename>.
+ </para></listitem>
+ <listitem><para>
+ For native SDK recipes
+ (<filename>nativesdk</filename>), the
+ build system sets the variable to the value of
+ <filename>SDK_PREFIX</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_SYS'><glossterm>TARGET_SYS</glossterm>
+ <info>
+ TARGET_SYS[doc] = "The target system is comprised of TARGET_ARCH,TARGET_VENDOR and TARGET_OS."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the system, including the architecture and the
+ operating system, for which the build is occurring in
+ the context of the current recipe.
+ </para>
+
+ <para>
+ The OpenEmbedded build system automatically sets this
+ variable based on
+ <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>,
+ <link linkend='var-TARGET_VENDOR'><filename>TARGET_VENDOR</filename></link>,
+ and
+ <link linkend='var-TARGET_OS'><filename>TARGET_OS</filename></link>
+ variables.
+ <note>
+ You do not need to set the
+ <filename>TARGET_SYS</filename> variable yourself.
+ </note>
+ </para>
+
+ <para>
+ Consider these two examples:
+ <itemizedlist>
+ <listitem><para>
+ Given a native recipe on a 32-bit, x86 machine
+ running Linux, the value is "i686-linux".
+ </para></listitem>
+ <listitem><para>
+ Given a recipe being built for a little-endian,
+ MIPS target running Linux, the value might be
+ "mipsel-linux".
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TARGET_VENDOR'><glossterm>TARGET_VENDOR</glossterm>
+ <info>
+ TARGET_VENDOR[doc] = "The name of the target vendor."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the name of the target vendor.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TCLIBCAPPEND'><glossterm>TCLIBCAPPEND</glossterm>
+ <info>
+ TCLIBCAPPEND[doc] = "Specifies a suffix appended to TMPDIR that identifies the libc variant for the build."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a suffix to be appended onto the
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ value.
+ The suffix identifies the <filename>libc</filename> variant
+ for building.
+ When you are building for multiple variants with the same
+ <link linkend='build-directory'>Build Directory</link>,
+ this mechanism ensures that output for different
+ <filename>libc</filename> variants is kept separate to
+ avoid potential conflicts.
+ </para>
+
+ <para>
+ In the <filename>defaultsetup.conf</filename> file, the
+ default value of <filename>TCLIBCAPPEND</filename> is
+ "-${TCLIBC}".
+ However, distros such as poky, which normally only support
+ one <filename>libc</filename> variant, set
+ <filename>TCLIBCAPPEND</filename> to "" in their distro
+ configuration file resulting in no suffix being applied.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TCLIBC'><glossterm>TCLIBC</glossterm>
+ <info>
+ TCLIBC[doc] = "Specifies GNU standard C library (libc) variant to use during the build process. You can select 'glibc' or 'musl'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the GNU standard C library (<filename>libc</filename>)
+ variant to use during the build process.
+ This variable replaces <filename>POKYLIBC</filename>, which is no longer
+ supported.
+ </para>
+
+ <para>
+ You can select "glibc" or "musl".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TCMODE'><glossterm>TCMODE</glossterm>
+ <info>
+ TCMODE[doc] = "Enables an external toolchain (where provided by an additional layer) if set to a value other than 'default'."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the toolchain selector.
+ <filename>TCMODE</filename> controls the characteristics
+ of the generated packages and images by telling the
+ OpenEmbedded build system which toolchain profile to use.
+ By default, the OpenEmbedded build system builds its own
+ internal toolchain.
+ The variable's default value is "default", which uses
+ that internal toolchain.
+ <note>
+ If <filename>TCMODE</filename> is set to a value
+ other than "default", then it is your responsibility
+ to ensure that the toolchain is compatible with the
+ default toolchain.
+ Using older or newer versions of these components
+ might cause build problems.
+ See the Release Notes for the Yocto Project release
+ for the specific components with which the toolchain
+ must be compatible.
+ To access the Release Notes, go to the
+ <ulink url='&YOCTO_HOME_URL;/software-overview/downloads/'>Downloads</ulink>
+ page on the Yocto Project website and click on the
+ "RELEASE INFORMATION" link for the appropriate
+ release.
+ </note>
+ </para>
+
+ <para>
+ The <filename>TCMODE</filename> variable is similar to
+ <link linkend='var-TCLIBC'><filename>TCLIBC</filename></link>,
+ which controls the variant of the GNU standard C library
+ (<filename>libc</filename>) used during the build process:
+ <filename>glibc</filename> or <filename>musl</filename>.
+ </para>
+
+ <para>
+ With additional layers, it is possible to use a pre-compiled
+ external toolchain.
+ One example is the Sourcery G++ Toolchain.
+ The support for this toolchain resides in the separate
+ <trademark class='registered'>Mentor Graphics</trademark>
+ <filename>meta-sourcery</filename> layer at
+ <ulink url='http://github.com/MentorEmbedded/meta-sourcery/'></ulink>.
+ </para>
+
+ <para>
+ The layer's <filename>README</filename> file contains
+ information on how to use the Sourcery G++ Toolchain as
+ an external toolchain.
+ In summary, you must be sure to add the layer to your
+ <filename>bblayers.conf</filename> file in front of the
+ <filename>meta</filename> layer and then set the
+ <filename>EXTERNAL_TOOLCHAIN</filename>
+ variable in your <filename>local.conf</filename> file
+ to the location in which you installed the toolchain.
+ </para>
+
+ <para>
+ The fundamentals used for this example apply to any
+ external toolchain.
+ You can use <filename>meta-sourcery</filename> as a
+ template for adding support for other external toolchains.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_EXPORT_DIR'><glossterm>TEST_EXPORT_DIR</glossterm>
+ <info>
+ TEST_EXPORT_DIR[doc] = "The location the OpenEmbedded build system uses to export tests when the TEST_EXPORT_ONLY variable is set to "1"."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The location the OpenEmbedded build system uses to export
+ tests when the
+ <link linkend='var-TEST_EXPORT_ONLY'><filename>TEST_EXPORT_ONLY</filename></link>
+ variable is set to "1".
+ </para>
+
+ <para>
+ The <filename>TEST_EXPORT_DIR</filename> variable defaults
+ to <filename>"${TMPDIR}/testimage/${PN}"</filename>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_EXPORT_ONLY'><glossterm>TEST_EXPORT_ONLY</glossterm>
+ <info>
+ TEST_EXPORT_ONLY[doc] = "Specifies to export the tests only. Set this variable to "1" if you do not want to run the tests but you want them to be exported in a manner that you to run them outside of the build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies to export the tests only.
+ Set this variable to "1" if you do not want to run the
+ tests but you want them to be exported in a manner that
+ you to run them outside of the build system.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_IMAGE'><glossterm>TEST_IMAGE</glossterm>
+ <info>
+ TEST_IMAGE[doc] = "Enables test booting of virtual machine images under the QEMU emulator after any root filesystems are created and runs tests against those images."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Automatically runs the series of automated tests for
+ images when an image is successfully built.
+ </para>
+
+ <para>
+ These tests are written in Python making use of the
+ <filename>unittest</filename> module, and the majority of
+ them run commands on the target system over
+ <filename>ssh</filename>.
+ You can set this variable to "1" in your
+ <filename>local.conf</filename> file in the
+ <link linkend='build-directory'>Build Directory</link>
+ to have the OpenEmbedded build system automatically run
+ these tests after an image successfully builds:
+ <literallayout class='monospaced'>
+ TEST_IMAGE = "1"
+ </literallayout>
+ For more information on enabling, running, and writing
+ these tests, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual and
+ the
+ "<link linkend='ref-classes-testimage*'><filename>testimage*.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_LOG_DIR'><glossterm>TEST_LOG_DIR</glossterm>
+ <info>
+ TEST_LOG_DIR[doc] = "Holds the SSH log and the boot log for QEMU machines. The TEST_LOG_DIR variable defaults to "${WORKDIR}/testimage"."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Holds the SSH log and the boot log for QEMU machines.
+ The <filename>TEST_LOG_DIR</filename> variable defaults
+ to <filename>"${WORKDIR}/testimage"</filename>.
+ <note>
+ Actual test results reside in the task log
+ (<filename>log.do_testimage</filename>), which is in
+ the <filename>${WORKDIR}/temp/</filename> directory.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_POWERCONTROL_CMD'><glossterm>TEST_POWERCONTROL_CMD</glossterm>
+ <info>
+ TEST_POWERCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to control the power of the target machine under test"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For automated hardware testing, specifies the command to
+ use to control the power of the target machine under test.
+ Typically, this command would point to a script that
+ performs the appropriate action (e.g. interacting
+ with a web-enabled power strip).
+ The specified command should expect to receive as the last
+ argument "off", "on" or "cycle" specifying to power off,
+ on, or cycle (power off and then power on) the device,
+ respectively.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_POWERCONTROL_EXTRA_ARGS'><glossterm>TEST_POWERCONTROL_EXTRA_ARGS</glossterm>
+ <info>
+ TEST_POWERCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_POWERCONTROL_CMD"
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For automated hardware testing, specifies additional
+ arguments to pass through to the command specified in
+ <link linkend='var-TEST_POWERCONTROL_CMD'><filename>TEST_POWERCONTROL_CMD</filename></link>.
+ Setting <filename>TEST_POWERCONTROL_EXTRA_ARGS</filename>
+ is optional.
+ You can use it if you wish, for example, to separate the
+ machine-specific and non-machine-specific parts of the
+ arguments.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_QEMUBOOT_TIMEOUT'><glossterm>TEST_QEMUBOOT_TIMEOUT</glossterm>
+ <info>
+ TEST_QEMUBOOT_TIMEOUT[doc] = "The time in seconds allowed for an image to boot before automated runtime tests begin to run against an image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The time in seconds allowed for an image to boot before
+ automated runtime tests begin to run against an
+ image.
+ The default timeout period to allow the boot process to
+ reach the login prompt is 500 seconds.
+ You can specify a different value in the
+ <filename>local.conf</filename> file.
+ </para>
+
+ <para>
+ For more information on testing images, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_SERIALCONTROL_CMD'><glossterm>TEST_SERIALCONTROL_CMD</glossterm>
+ <info>
+ TEST_SERIALCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to connect to the serial console of the target machine under test."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For automated hardware testing, specifies the command
+ to use to connect to the serial console of the target
+ machine under test.
+ This command simply needs to connect to the serial console
+ and forward that connection to standard input and output
+ as any normal terminal program does.
+ </para>
+
+ <para>
+ For example, to use the Picocom terminal program on
+ serial device <filename>/dev/ttyUSB0</filename> at
+ 115200bps, you would set the variable as follows:
+ <literallayout class='monospaced'>
+ TEST_SERIALCONTROL_CMD = "picocom /dev/ttyUSB0 -b 115200"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_SERIALCONTROL_EXTRA_ARGS'><glossterm>TEST_SERIALCONTROL_EXTRA_ARGS</glossterm>
+ <info>
+ TEST_SERIALCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_SERIALCONTROL_CMD."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For automated hardware testing, specifies additional
+ arguments to pass through to the command specified in
+ <link linkend='var-TEST_SERIALCONTROL_CMD'><filename>TEST_SERIALCONTROL_CMD</filename></link>.
+ Setting <filename>TEST_SERIALCONTROL_EXTRA_ARGS</filename>
+ is optional.
+ You can use it if you wish, for example, to separate the
+ machine-specific and non-machine-specific parts of the
+ command.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_SERVER_IP'><glossterm>TEST_SERVER_IP</glossterm>
+ <info>
+ TEST_SERVER_IP[doc] = "The IP address of the build machine (host machine). This IP address is usually automatically detected."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The IP address of the build machine (host machine).
+ This IP address is usually automatically detected.
+ However, if detection fails, this variable needs to be set
+ to the IP address of the build machine (i.e. where
+ the build is taking place).
+ <note>
+ The <filename>TEST_SERVER_IP</filename> variable
+ is only used for a small number of tests such as
+ the "dnf" test suite, which needs to download
+ packages from
+ <filename>WORKDIR/oe-rootfs-repo</filename>.
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_TARGET'><glossterm>TEST_TARGET</glossterm>
+ <info>
+ TEST_TARGET[doc] = "For automated runtime testing, specifies the method of deploying the image and running tests on the target machine."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the target controller to use when running tests
+ against a test image.
+ The default controller to use is "qemu":
+ <literallayout class='monospaced'>
+ TEST_TARGET = "qemu"
+ </literallayout>
+ </para>
+
+ <para>
+ A target controller is a class that defines how an
+ image gets deployed on a target and how a target is started.
+ A layer can extend the controllers by adding a module
+ in the layer's <filename>/lib/oeqa/controllers</filename>
+ directory and by inheriting the
+ <filename>BaseTarget</filename> class, which is an abstract
+ class that cannot be used as a value of
+ <filename>TEST_TARGET</filename>.
+ </para>
+
+ <para>
+ You can provide the following arguments with
+ <filename>TEST_TARGET</filename>:
+ <itemizedlist>
+ <listitem><para><emphasis>"qemu" and "QemuTarget":</emphasis>
+ Boots a QEMU image and runs the tests.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#qemu-image-enabling-tests'>Enabling Runtime Tests on QEMU</ulink>"
+ section in the Yocto Project Development Tasks
+ Manual for more information.
+ </para></listitem>
+ <listitem><para><emphasis>"simpleremote" and "SimpleRemoteTarget":</emphasis>
+ Runs the tests on target hardware that is already
+ up and running.
+ The hardware can be on the network or it can be
+ a device running an image on QEMU.
+ You must also set
+ <link linkend='var-TEST_TARGET_IP'><filename>TEST_TARGET_IP</filename></link>
+ when you use "simpleremote" or "SimpleRemoteTarget".
+ <note>
+ This argument is defined in
+ <filename>meta/lib/oeqa/targetcontrol.py</filename>.
+ The small caps names are kept for compatibility
+ reasons.
+ </note>
+ </para></listitem>
+ <listitem><para><emphasis>"GummibootTarget":</emphasis>
+ Automatically deploys and runs tests on an
+ EFI-enabled machine that has a master image
+ installed.
+ <note>
+ This argument is defined in
+ <filename>meta/lib/oeqa/controllers/masterimage.py</filename>.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For information on running tests on hardware, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#hardware-image-enabling-tests'>Enabling Runtime Tests on Hardware</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_TARGET_IP'><glossterm>TEST_TARGET_IP</glossterm>
+ <info>
+ TEST_TARGET_IP[doc] = "The IP address of your hardware under test."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The IP address of your hardware under test.
+ The <filename>TEST_TARGET_IP</filename> variable has no
+ effect when
+ <link linkend='var-TEST_TARGET'><filename>TEST_TARGET</filename></link>
+ is set to "qemu".
+ </para>
+
+ <para>
+ When you specify the IP address, you can also include a
+ port.
+ Here is an example:
+ <literallayout class='monospaced'>
+ TEST_TARGET_IP = "192.168.1.4:2201"
+ </literallayout>
+ Specifying a port is useful when SSH is started on a
+ non-standard port or in cases when your hardware under test
+ is behind a firewall or network that is not directly
+ accessible from your host and you need to do port address
+ translation.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TEST_SUITES'><glossterm>TEST_SUITES</glossterm>
+ <info>
+ TEST_SUITES[doc] = "An ordered list of tests (modules) to run against an image when performing automated runtime testing."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An ordered list of tests (modules) to run against
+ an image when performing automated runtime testing.
+ </para>
+
+ <para>
+ The OpenEmbedded build system provides a core set of tests
+ that can be used against images.
+ <note>
+ Currently, there is only support for running these tests
+ under QEMU.
+ </note>
+ Tests include <filename>ping</filename>,
+ <filename>ssh</filename>, <filename>df</filename> among
+ others.
+ You can add your own tests to the list of tests by
+ appending <filename>TEST_SUITES</filename> as follows:
+ <literallayout class='monospaced'>
+ TEST_SUITES_append = " <replaceable>mytest</replaceable>"
+ </literallayout>
+ Alternatively, you can provide the "auto" option to
+ have all applicable tests run against the image.
+ <literallayout class='monospaced'>
+ TEST_SUITES_append = " auto"
+ </literallayout>
+ Using this option causes the build system to automatically
+ run tests that are applicable to the image.
+ Tests that are not applicable are skipped.
+ </para>
+
+ <para>
+ The order in which tests are run is important.
+ Tests that depend on another test must appear later in the
+ list than the test on which they depend.
+ For example, if you append the list of tests with two
+ tests (<filename>test_A</filename> and
+ <filename>test_B</filename>) where
+ <filename>test_B</filename> is dependent on
+ <filename>test_A</filename>, then you must order the tests
+ as follows:
+ <literallayout class='monospaced'>
+ TEST_SUITES = " test_A test_B"
+ </literallayout>
+ </para>
+
+ <para>
+ For more information on testing images, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#performing-automated-runtime-testing'>Performing Automated Runtime Testing</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-THISDIR'><glossterm>THISDIR</glossterm>
+ <info>
+ THISDIR[doc] = "The directory in which the file BitBake is currently parsing is located."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The directory in which the file BitBake is currently
+ parsing is located.
+ Do not manually set this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TIME'><glossterm>TIME</glossterm>
+ <info>
+ TIME[doc] = "The time the build was started using HMS format."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The time the build was started.
+ Times appear using the hour, minute, and second (HMS)
+ format (e.g. "140159" for one minute and fifty-nine
+ seconds past 1400 hours).
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TMPDIR'><glossterm>TMPDIR</glossterm>
+ <info>
+ TMPDIR[doc] = "The temporary directory the OpenEmbedded build system uses when it does its work building images. By default, the TMPDIR variable is named tmp within the Build Directory."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable is the base directory the OpenEmbedded
+ build system uses for all build output and intermediate
+ files (other than the shared state cache).
+ By default, the <filename>TMPDIR</filename> variable points
+ to <filename>tmp</filename> within the
+ <link linkend='build-directory'>Build Directory</link>.
+ </para>
+
+ <para>
+ If you want to establish this directory in a location other
+ than the default, you can uncomment and edit the following
+ statement in the
+ <filename>conf/local.conf</filename> file in the
+ <link linkend='source-directory'>Source Directory</link>:
+ <literallayout class='monospaced'>
+ #TMPDIR = "${TOPDIR}/tmp"
+ </literallayout>
+ An example use for this scenario is to set
+ <filename>TMPDIR</filename> to a local disk, which does
+ not use NFS, while having the Build Directory use NFS.
+ </para>
+
+ <para>
+ The filesystem used by <filename>TMPDIR</filename> must
+ have standard filesystem semantics (i.e. mixed-case files
+ are unique, POSIX file locking, and persistent inodes).
+ Due to various issues with NFS and bugs in some
+ implementations, NFS does not meet this minimum
+ requirement.
+ Consequently, <filename>TMPDIR</filename> cannot be on
+ NFS.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TOOLCHAIN_HOST_TASK'><glossterm>TOOLCHAIN_HOST_TASK</glossterm>
+ <info>
+ TOOLCHAIN_HOST_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when building an SDK, which contains a cross-development environment."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable lists packages the OpenEmbedded build system
+ uses when building an SDK, which contains a
+ cross-development environment.
+ The packages specified by this variable are part of the
+ toolchain set that runs on the
+ <link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>,
+ and each package should usually have the prefix
+ <filename>nativesdk-</filename>.
+ For example, consider the following command when
+ building an SDK:
+ <literallayout class='monospaced'>
+ $ bitbake -c populate_sdk <replaceable>imagename</replaceable>
+ </literallayout>
+ In this case, a default list of packages is set in this
+ variable, but you can add additional packages to the list.
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-adding-individual-packages'>Adding Individual Packages to the Standard SDK</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual
+ for more information.
+ </para>
+
+ <para>
+ For background information on cross-development toolchains
+ in the Yocto Project development environment, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TOOLCHAIN_OUTPUTNAME'><glossterm>TOOLCHAIN_OUTPUTNAME</glossterm>
+ <info>
+ TOOLCHAIN_OUTPUTNAME[doc] = "Defines the name used for the toolchain output."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable defines the name used for the toolchain
+ output.
+ The
+ <link linkend='ref-classes-populate-sdk-*'><filename>populate_sdk_base</filename></link>
+ class sets the
+ <filename>TOOLCHAIN_OUTPUTNAME</filename> variable as
+ follows:
+ <literallayout class='monospaced'>
+ TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
+ </literallayout>
+ See the
+ <link linkend='var-SDK_NAME'><filename>SDK_NAME</filename></link>
+ and
+ <link linkend='var-SDK_VERSION'><filename>SDK_VERSION</filename></link>
+ variables for additional information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TOOLCHAIN_TARGET_TASK'><glossterm>TOOLCHAIN_TARGET_TASK</glossterm>
+ <info>
+ TOOLCHAIN_TARGET_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when it creates the target part of an SDK, which includes libraries and headers."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ This variable lists packages the OpenEmbedded build system
+ uses when it creates the target part of an SDK
+ (i.e. the part built for the target hardware), which
+ includes libraries and headers.
+ Use this variable to add individual packages to the
+ part of the SDK that runs on the target.
+ See the
+ "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-adding-individual-packages'>Adding Individual Packages to the Standard SDK</ulink>"
+ section in the Yocto Project Application Development and
+ the Extensible Software Development Kit (eSDK) manual for
+ more information.
+ </para>
+
+ <para>
+ For background information on cross-development toolchains
+ in the Yocto Project development environment, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ For information on setting up a cross-development
+ environment, see the
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TOPDIR'><glossterm>TOPDIR</glossterm>
+ <info>
+ TOPDIR[doc] = "The Build Directory. BitBake automatically sets this variable. The OpenEmbedded build system uses the Build Directory when building images."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The top-level
+ <link linkend='build-directory'>Build Directory</link>.
+ BitBake automatically sets this variable when you
+ initialize your build environment using
+ <link linkend='structure-core-script'><filename>&OE_INIT_FILE;</filename></link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TRANSLATED_TARGET_ARCH'><glossterm>TRANSLATED_TARGET_ARCH</glossterm>
+ <info>
+ TRANSLATED_TARGET_ARCH[doc] = "A sanitized version of TARGET_ARCH. This variable is used where the architecture is needed in a value where underscores are not allowed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A sanitized version of
+ <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>.
+ This variable is used where the architecture is needed in
+ a value where underscores are not allowed, for example
+ within package filenames.
+ In this case, dash characters replace any underscore
+ characters used in <filename>TARGET_ARCH</filename>.
+ </para>
+
+ <para>
+ Do not edit this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_ARCH'><glossterm>TUNE_ARCH</glossterm>
+ <info>
+ TUNE_ARCH[doc] = "The GNU canonical architecture for a specific architecture (i.e. arm, armeb, mips, mips64, and so forth)."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The GNU canonical architecture for a specific architecture
+ (i.e. <filename>arm</filename>,
+ <filename>armeb</filename>,
+ <filename>mips</filename>,
+ <filename>mips64</filename>, and so forth).
+ BitBake uses this value to setup configuration.
+ </para>
+
+ <para>
+ <filename>TUNE_ARCH</filename> definitions are specific to
+ a given architecture.
+ The definitions can be a single static definition, or
+ can be dynamically adjusted.
+ You can see details for a given CPU family by looking at
+ the architecture's <filename>README</filename> file.
+ For example, the
+ <filename>meta/conf/machine/include/mips/README</filename>
+ file in the
+ <link linkend='source-directory'>Source Directory</link>
+ provides information for <filename>TUNE_ARCH</filename>
+ specific to the <filename>mips</filename> architecture.
+ </para>
+
+ <para>
+ <filename>TUNE_ARCH</filename> is tied closely to
+ <link linkend='var-TARGET_ARCH'><filename>TARGET_ARCH</filename></link>,
+ which defines the target machine's architecture.
+ The BitBake configuration file
+ (<filename>meta/conf/bitbake.conf</filename>) sets
+ <filename>TARGET_ARCH</filename> as follows:
+ <literallayout class='monospaced'>
+ TARGET_ARCH = "${TUNE_ARCH}"
+ </literallayout>
+ </para>
+
+ <para>
+ The following list, which is by no means complete since
+ architectures are configurable, shows supported machine
+ architectures:
+ <literallayout class='monospaced'>
+ arm
+ i586
+ x86_64
+ powerpc
+ powerpc64
+ mips
+ mipsel
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_ASARGS'><glossterm>TUNE_ASARGS</glossterm>
+ <info>
+ TUNE_ASARGS[doc] = "Specifies architecture-specific assembler flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific assembler flags for
+ the target system.
+ The set of flags is based on the selected tune features.
+ <filename>TUNE_ASARGS</filename> is set using
+ the tune include files, which are typically under
+ <filename>meta/conf/machine/include/</filename> and are
+ influenced through
+ <link linkend='var-TUNE_FEATURES'><filename>TUNE_FEATURES</filename></link>.
+ For example, the
+ <filename>meta/conf/machine/include/x86/arch-x86.inc</filename>
+ file defines the flags for the x86 architecture as follows:
+ <literallayout class='monospaced'>
+ TUNE_ASARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-x32", "", d)}"
+ </literallayout>
+ <note>
+ Board Support Packages (BSPs) select the tune.
+ The selected tune, in turn, affects the tune variables
+ themselves (i.e. the tune can supply its own
+ set of flags).
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_CCARGS'><glossterm>TUNE_CCARGS</glossterm>
+ <info>
+ TUNE_CCARGS[doc] = "Specifies architecture-specific C compiler flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific C compiler flags for
+ the target system.
+ The set of flags is based on the selected tune features.
+ <filename>TUNE_CCARGS</filename> is set using
+ the tune include files, which are typically under
+ <filename>meta/conf/machine/include/</filename> and are
+ influenced through
+ <link linkend='var-TUNE_FEATURES'><filename>TUNE_FEATURES</filename></link>.
+ <note>
+ Board Support Packages (BSPs) select the tune.
+ The selected tune, in turn, affects the tune variables
+ themselves (i.e. the tune can supply its own
+ set of flags).
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_LDARGS'><glossterm>TUNE_LDARGS</glossterm>
+ <info>
+ TUNE_LDARGS[doc] = "Specifies architecture-specific linker flags for the target system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies architecture-specific linker flags for
+ the target system.
+ The set of flags is based on the selected tune features.
+ <filename>TUNE_LDARGS</filename> is set using
+ the tune include files, which are typically under
+ <filename>meta/conf/machine/include/</filename> and are
+ influenced through
+ <link linkend='var-TUNE_FEATURES'><filename>TUNE_FEATURES</filename></link>.
+ For example, the
+ <filename>meta/conf/machine/include/x86/arch-x86.inc</filename>
+ file defines the flags for the x86 architecture as follows:
+ <literallayout class='monospaced'>
+ TUNE_LDARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-m elf32_x86_64", "", d)}"
+ </literallayout>
+ <note>
+ Board Support Packages (BSPs) select the tune.
+ The selected tune, in turn, affects the tune variables
+ themselves (i.e. the tune can supply its own
+ set of flags).
+ </note>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_FEATURES'><glossterm>TUNE_FEATURES</glossterm>
+ <info>
+ TUNE_FEATURES[doc] = "Features used to "tune" a compiler for optimal use given a specific processor."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Features used to "tune" a compiler for optimal use
+ given a specific processor.
+ The features are defined within the tune files and allow
+ arguments (i.e. <filename>TUNE_*ARGS</filename>) to be
+ dynamically generated based on the features.
+ </para>
+
+ <para>
+ The OpenEmbedded build system verifies the features
+ to be sure they are not conflicting and that they are
+ supported.
+ </para>
+
+ <para>
+ The BitBake configuration file
+ (<filename>meta/conf/bitbake.conf</filename>) defines
+ <filename>TUNE_FEATURES</filename> as follows:
+ <literallayout class='monospaced'>
+ TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}"
+ </literallayout>
+ See the
+ <link linkend='var-DEFAULTTUNE'><filename>DEFAULTTUNE</filename></link>
+ variable for more information.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNE_PKGARCH'><glossterm>TUNE_PKGARCH</glossterm>
+ <info>
+ TUNE_PKGARCH[doc] = "The package architecture understood by the packaging system to define the architecture, ABI, and tuning of output packages."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The package architecture understood by the packaging
+ system to define the architecture, ABI, and tuning of
+ output packages.
+ The specific tune is defined using the "_tune" override
+ as follows:
+ <literallayout class='monospaced'>
+ TUNE_PKGARCH_tune-<replaceable>tune</replaceable> = "<replaceable>tune</replaceable>"
+ </literallayout>
+ </para>
+
+ <para>
+ These tune-specific package architectures are defined in
+ the machine include files.
+ Here is an example of the "core2-32" tuning as used
+ in the
+ <filename>meta/conf/machine/include/tune-core2.inc</filename>
+ file:
+ <literallayout class='monospaced'>
+ TUNE_PKGARCH_tune-core2-32 = "core2-32"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNEABI'><glossterm>TUNEABI</glossterm>
+ <info>
+ TUNEABI[doc] = "An underlying ABI used by a particular tuning in a given toolchain layer. This feature allows providers using prebuilt libraries to check compatibility of a tuning against their selection of libraries."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ An underlying Application Binary Interface (ABI) used by
+ a particular tuning in a given toolchain layer.
+ Providers that use prebuilt libraries can use the
+ <filename>TUNEABI</filename>,
+ <link linkend='var-TUNEABI_OVERRIDE'><filename>TUNEABI_OVERRIDE</filename></link>,
+ and
+ <link linkend='var-TUNEABI_WHITELIST'><filename>TUNEABI_WHITELIST</filename></link>
+ variables to check compatibility of tunings against their
+ selection of libraries.
+ </para>
+
+ <para>
+ If <filename>TUNEABI</filename> is undefined, then every
+ tuning is allowed.
+ See the
+ <link linkend='ref-classes-sanity'><filename>sanity</filename></link>
+ class to see how the variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNEABI_OVERRIDE'><glossterm>TUNEABI_OVERRIDE</glossterm>
+ <info>
+ TUNEABI_OVERRIDE[doc] = "If set, ignores TUNEABI_WHITELIST."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set, the OpenEmbedded system ignores the
+ <link linkend='var-TUNEABI_WHITELIST'><filename>TUNEABI_WHITELIST</filename></link>
+ variable.
+ Providers that use prebuilt libraries can use the
+ <filename>TUNEABI_OVERRIDE</filename>,
+ <filename>TUNEABI_WHITELIST</filename>,
+ and
+ <link linkend='var-TUNEABI'><filename>TUNEABI</filename></link>
+ variables to check compatibility of a tuning against their
+ selection of libraries.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-sanity'><filename>sanity</filename></link>
+ class to see how the variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNEABI_WHITELIST'><glossterm>TUNEABI_WHITELIST</glossterm>
+ <info>
+ TUNEABI_WHITELIST[doc] = "A whitelist of permissible TUNEABI values. If the variable is not set, all values are allowed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A whitelist of permissible
+ <link linkend='var-TUNEABI'><filename>TUNEABI</filename></link>
+ values.
+ If <filename>TUNEABI_WHITELIST</filename> is not set,
+ all tunes are allowed.
+ Providers that use prebuilt libraries can use the
+ <filename>TUNEABI_WHITELIST</filename>,
+ <link linkend='var-TUNEABI_OVERRIDE'><filename>TUNEABI_OVERRIDE</filename></link>,
+ and <filename>TUNEABI</filename> variables to check
+ compatibility of a tuning against their selection of
+ libraries.
+ </para>
+
+ <para>
+ See the
+ <link linkend='ref-classes-sanity'><filename>sanity</filename></link>
+ class to see how the variable is used.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNECONFLICTS'><glossterm>TUNECONFLICTS[<replaceable>feature</replaceable>]</glossterm>
+ <info>
+ TUNECONFLICTS[doc] = "Specifies CPU or Application Binary Interface (ABI) tuning features that conflict with specified feature."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies CPU or Application Binary Interface (ABI)
+ tuning features that conflict with <replaceable>feature</replaceable>.
+ </para>
+
+ <para>
+ Known tuning conflicts are specified in the machine include
+ files in the
+ <link linkend='source-directory'>Source Directory</link>.
+ Here is an example from the
+ <filename>meta/conf/machine/include/mips/arch-mips.inc</filename>
+ include file that lists the "o32" and "n64" features as
+ conflicting with the "n32" feature:
+ <literallayout class='monospaced'>
+ TUNECONFLICTS[n32] = "o32 n64"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-TUNEVALID'><glossterm>TUNEVALID[<replaceable>feature</replaceable>]</glossterm>
+ <info>
+ TUNEVALID[doc] = "Descriptions, stored as flags, of valid tuning features."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a valid CPU or Application Binary Interface (ABI)
+ tuning feature.
+ The specified feature is stored as a flag.
+ Valid features are specified in the machine include files
+ (e.g. <filename>meta/conf/machine/include/arm/arch-arm.inc</filename>).
+ Here is an example from that file:
+ <literallayout class='monospaced'>
+ TUNEVALID[bigendian] = "Enable big-endian mode."
+ </literallayout>
+ </para>
+
+ <para>
+ See the machine include files in the
+ <link linkend='source-directory'>Source Directory</link>
+ for these features.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-u'><title>U</title>
+
+ <glossentry id='var-UBOOT_CONFIG'><glossterm>UBOOT_CONFIG</glossterm>
+ <info>
+ UBOOT_CONFIG[doc] = "Configures the UBOOT_MACHINE and can also define IMAGE_FSTYPES for individual cases."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Configures the
+ <link linkend='var-UBOOT_MACHINE'><filename>UBOOT_MACHINE</filename></link>
+ and can also define
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ for individual cases.
+ </para>
+
+ <para>
+ Following is an example from the
+ <filename>meta-fsl-arm</filename> layer.
+ <literallayout class='monospaced'>
+ 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"
+ </literallayout>
+ In this example, "sd" is selected as the configuration
+ of the possible four for the
+ <filename>UBOOT_MACHINE</filename>.
+ The "sd" configuration defines "mx6qsabreauto_config"
+ as the value for <filename>UBOOT_MACHINE</filename>, while
+ the "sdcard" specifies the
+ <filename>IMAGE_FSTYPES</filename> to use for the U-boot
+ image.
+ </para>
+
+ <para>
+ For more information on how the
+ <filename>UBOOT_CONFIG</filename> is handled, see the
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/uboot-config.bbclass'><filename>uboot-config</filename></ulink>
+ class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_ENTRYPOINT'><glossterm>UBOOT_ENTRYPOINT</glossterm>
+ <info>
+ UBOOT_ENTRYPOINT[doc] = "Specifies the entry point for the U-Boot image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the entry point for the U-Boot image.
+ During U-Boot image creation, the
+ <filename>UBOOT_ENTRYPOINT</filename> variable is passed
+ as a command-line parameter to the
+ <filename>uboot-mkimage</filename> utility.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_LOADADDRESS'><glossterm>UBOOT_LOADADDRESS</glossterm>
+ <info>
+ UBOOT_LOADADDRESS[doc] = "Specifies the load address for the U-Boot image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the load address for the U-Boot image.
+ During U-Boot image creation, the
+ <filename>UBOOT_LOADADDRESS</filename> variable is passed
+ as a command-line parameter to the
+ <filename>uboot-mkimage</filename> utility.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_LOCALVERSION'><glossterm>UBOOT_LOCALVERSION</glossterm>
+ <info>
+ UBOOT_LOCALVERSION[doc] = "Appends a string to the name of the local version of the U-Boot image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Appends a string to the name of the local version of the
+ U-Boot image.
+ For example, assuming the version of the U-Boot image
+ built was "2013.10, the full version string reported by
+ U-Boot would be "2013.10-yocto" given the following
+ statement:
+ <literallayout class='monospaced'>
+ UBOOT_LOCALVERSION = "-yocto"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_MACHINE'><glossterm>UBOOT_MACHINE</glossterm>
+ <info>
+ UBOOT_MACHINE[doc] = "Specifies the value passed on the make command line when building a U-Boot image."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the value passed on the
+ <filename>make</filename> command line when building
+ a U-Boot image.
+ The value indicates the target platform configuration.
+ You typically set this variable from the machine
+ configuration file (i.e.
+ <filename>conf/machine/<replaceable>machine_name</replaceable>.conf</filename>).
+ </para>
+
+ <para>
+ Please see the "Selection of Processor Architecture and
+ Board Type" section in the U-Boot README for valid values
+ for this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_MAKE_TARGET'><glossterm>UBOOT_MAKE_TARGET</glossterm>
+ <info>
+ UBOOT_MAKE_TARGET[doc] = "Specifies the target called in the Makefile."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the target called in the
+ <filename>Makefile</filename>.
+ The default target is "all".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_SUFFIX'><glossterm>UBOOT_SUFFIX</glossterm>
+ <info>
+ UBOOT_SUFFIX[doc] = "Points to the generated U-Boot extension."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Points to the generated U-Boot extension.
+ For example, <filename>u-boot.sb</filename> has a
+ <filename>.sb</filename> extension.
+ </para>
+
+ <para>
+ The default U-Boot extension is
+ <filename>.bin</filename>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UBOOT_TARGET'><glossterm>UBOOT_TARGET</glossterm>
+ <info>
+ UBOOT_TARGET[doc] = "Specifies the target used for building U-Boot."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the target used for building U-Boot.
+ The target is passed directly as part of the "make" command
+ (e.g. SPL and AIS).
+ If you do not specifically set this variable, the
+ OpenEmbedded build process passes and uses "all" for the
+ target during the U-Boot building process.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UNKNOWN_CONFIGURE_WHITELIST'><glossterm>UNKNOWN_CONFIGURE_WHITELIST</glossterm>
+ <info>
+ UNKNOWN_CONFIGURE_WHITELIST[doc] = "Specifies a list of options that, if reported by the configure script as being invalid, should not generate a warning during the do_configure task."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a list of options that, if reported by the
+ configure script as being invalid, should not generate a
+ warning during the
+ <link linkend='ref-tasks-configure'><filename>do_configure</filename></link>
+ task.
+ Normally, invalid configure options are simply not passed
+ to the configure script (e.g. should be removed from
+ <link linkend='var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></link>
+ or
+ <link linkend='var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></link>).
+ However, common options, for example, exist that are passed
+ to all configure scripts at a class level that might not
+ be valid for some configure scripts.
+ It follows that no benefit exists in seeing a warning about
+ these options.
+ For these cases, the options are added to
+ <filename>UNKNOWN_CONFIGURE_WHITELIST</filename>.
+ </para>
+
+ <para>
+ The configure arguments check that uses
+ <filename>UNKNOWN_CONFIGURE_WHITELIST</filename> is part
+ of the
+ <link linkend='ref-classes-insane'><filename>insane</filename></link>
+ class and is only enabled if the recipe inherits the
+ <link linkend='ref-classes-autotools'><filename>autotools</filename></link>
+ class.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UPDATERCPN'><glossterm>UPDATERCPN</glossterm>
+ <info>
+ UPDATERCPN[doc] = "Specifies the package that contains the initscript that is enabled."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ For recipes inheriting the
+ <link linkend='ref-classes-update-rc.d'><filename>update-rc.d</filename></link>
+ class, <filename>UPDATERCPN</filename> specifies
+ the package that contains the initscript that is
+ enabled.
+ </para>
+
+ <para>
+ The default value is "${PN}".
+ Given that almost all recipes that install initscripts
+ package them in the main package for the recipe, you
+ rarely need to set this variable in individual recipes.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UPSTREAM_CHECK_GITTAGREGEX'><glossterm>UPSTREAM_CHECK_GITTAGREGEX</glossterm>
+ <info>
+ UPSTREAM_CHECK_GITTAGREGEX[doc] = "Filters relevant Git tags when fetching source from an upstream Git repository."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class is enabled globally, you can perform a per-recipe
+ check for what the latest upstream source code version is
+ by calling
+ <filename>bitbake -c checkpkg</filename> <replaceable>recipe</replaceable>.
+ If the recipe source code is provided from Git
+ repositories, the OpenEmbedded build system determines the
+ latest upstream version by picking the latest tag from the
+ list of all repository tags.
+ You can use the
+ <filename>UPSTREAM_CHECK_GITTAGREGEX</filename>
+ variable to provide a regular expression to filter only the
+ relevant tags should the default filter not work
+ correctly.
+ <literallayout class='monospaced'>
+ UPSTREAM_CHECK_GITTAGREGEX = "git_tag_regex"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UPSTREAM_CHECK_REGEX'><glossterm>UPSTREAM_CHECK_REGEX</glossterm>
+ <info>
+ UPSTREAM_CHECK_REGEX[doc] = "The regular expression the package checking system uses to parse the page pointed to by UPSTREAM_CHECK_URI."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class is enabled globally, use the
+ <filename>UPSTREAM_CHECK_REGEX</filename> variable to
+ specify a different regular expression instead of the
+ default one when the package checking system is parsing
+ the page found using
+ <link linkend='var-UPSTREAM_CHECK_URI'><filename>UPSTREAM_CHECK_URI</filename></link>.
+ <literallayout class='monospaced'>
+ UPSTREAM_CHECK_REGEX = "package_regex"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-UPSTREAM_CHECK_URI'><glossterm>UPSTREAM_CHECK_URI</glossterm>
+ <info>
+ UPSTREAM_CHECK_URI[doc] = "The URL used by the package checking system to get the latest version of the package when source files are fetched from an upstream Git repository."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When the
+ <link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
+ class is enabled globally, you can perform a per-recipe
+ check for what the latest upstream source code version is
+ by calling <filename>bitbake -c checkpkg</filename>
+ <replaceable>recipe</replaceable>.
+ If the source code is provided from tarballs, the latest
+ version is determined by fetching the directory listing
+ where the tarball is and attempting to find a later tarball.
+ When this approach does not work, you can use
+ <filename>UPSTREAM_CHECK_URI</filename> to
+ provide a different URI that contains the link to the
+ latest tarball.
+ <literallayout class='monospaced'>
+ UPSTREAM_CHECK_URI = "recipe_url"
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USE_DEVFS'><glossterm>USE_DEVFS</glossterm>
+ <info>
+ USE_DEVFS[doc] = "Determines if devtmpfs is used for /dev population."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Determines if <filename>devtmpfs</filename> is used for
+ <filename>/dev</filename> population.
+ The default value used for <filename>USE_DEVFS</filename>
+ is "1" when no value is specifically set.
+ Typically, you would set <filename>USE_DEVFS</filename>
+ to "0" for a statically populated <filename>/dev</filename>
+ directory.
+ </para>
+
+ <para>
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#selecting-dev-manager'>Selecting a Device Manager</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ information on how to use this variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USE_VT'><glossterm>USE_VT</glossterm>
+ <info>
+ USE_VT[doc] = "When using SysVinit, determines whether or not to run a getty on any virtual terminals in order to enable logging in through those terminals."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When using
+ <ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-enabling-system-services'>SysVinit</ulink>,
+ determines whether or not to run a
+ <ulink url='http://en.wikipedia.org/wiki/Getty_%28Unix%29'>getty</ulink>
+ on any virtual terminals in order to enable logging in
+ through those terminals.
+ </para>
+
+ <para>
+ The default value used for <filename>USE_VT</filename>
+ is "1" when no default value is specifically set.
+ Typically, you would set <filename>USE_VT</filename>
+ to "0" in the machine configuration file for machines
+ that do not have a graphical display attached and
+ therefore do not need virtual terminal functionality.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USER_CLASSES'><glossterm>USER_CLASSES</glossterm>
+ <info>
+ USER_CLASSES[doc] = "List of additional classes to use when building images that enable extra features."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ A list of classes to globally inherit.
+ These classes are used by the OpenEmbedded build system
+ to enable extra features (e.g.
+ <filename>buildstats</filename>,
+ <filename>image-mklibs</filename>, and so forth).
+ </para>
+
+ <para>
+ The default list is set in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+ </literallayout>
+ For more information, see
+ <filename>meta-poky/conf/local.conf.sample</filename> in
+ the
+ <link linkend='source-directory'>Source Directory</link>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_ERROR_DYNAMIC'><glossterm>USERADD_ERROR_DYNAMIC</glossterm>
+ <info>
+ USERADD_ERROR_DYNAMIC[doc] = "If set to 'error', forces the OpenEmbedded build system to produce an error if the user identification (uid) and group identification (gid) values are not defined in files/passwd and files/group files. If set to 'warn', a warning will be issued instead."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ If set to "error", forces the OpenEmbedded build system to
+ produce an error if the user identification
+ (<filename>uid</filename>) and group identification
+ (<filename>gid</filename>) values are not defined
+ in <filename>files/passwd</filename>
+ and <filename>files/group</filename> files.
+ If set to "warn", a warning will be issued instead.
+ </para>
+
+ <para>
+ The default behavior for the build system is to dynamically
+ apply <filename>uid</filename> and
+ <filename>gid</filename> values.
+ Consequently, the <filename>USERADD_ERROR_DYNAMIC</filename>
+ variable is by default not set.
+ If you plan on using statically assigned
+ <filename>gid</filename> and <filename>uid</filename>
+ values, you should set
+ the <filename>USERADD_ERROR_DYNAMIC</filename> variable in
+ your <filename>local.conf</filename> file as
+ follows:
+ <literallayout class='monospaced'>
+ USERADD_ERROR_DYNAMIC = "error"
+ </literallayout>
+ Overriding the default behavior implies you are going to
+ also take steps to set static <filename>uid</filename> and
+ <filename>gid</filename> values through use of the
+ <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>,
+ <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>,
+ and
+ <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link>
+ variables.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_GID_TABLES'><glossterm>USERADD_GID_TABLES</glossterm>
+ <info>
+ USERADD_GID_TABLES[doc] = "Specifies a password file to use for obtaining static group identification (gid) values when the OpenEmbedded build system adds a group to the system during package installation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a password file to use for obtaining static
+ group identification (<filename>gid</filename>) values
+ when the OpenEmbedded build system adds a group to the
+ system during package installation.
+ </para>
+
+ <para>
+ When applying static group identification
+ (<filename>gid</filename>) values, the OpenEmbedded build
+ system looks in
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ for a <filename>files/group</filename> file and then applies
+ those <filename>uid</filename> values.
+ Set the variable as follows in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ USERADD_GID_TABLES = "files/group"
+ </literallayout>
+ </para>
+
+ <note>
+ Setting the
+ <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>
+ variable to "useradd-staticids" causes the build system
+ to use static <filename>gid</filename> values.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_PACKAGES'><glossterm>USERADD_PACKAGES</glossterm>
+ <info>
+ USERADD_PACKAGES[doc] = "When a recipe inherits the useradd class, this variable specifies the individual packages within the recipe that require users and/or groups to be added."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class, this variable
+ specifies the individual packages within the recipe that
+ require users and/or groups to be added.
+ </para>
+
+ <para>
+ You must set this variable if the recipe inherits the
+ class.
+ For example, the following enables adding a user for the
+ main package in a recipe:
+ <literallayout class='monospaced'>
+ USERADD_PACKAGES = "${PN}"
+ </literallayout>
+ <note>
+ If follows that if you are going to use the
+ <filename>USERADD_PACKAGES</filename> variable,
+ you need to set one or more of the
+ <link linkend='var-USERADD_PARAM'><filename>USERADD_PARAM</filename></link>,
+ <link linkend='var-GROUPADD_PARAM'><filename>GROUPADD_PARAM</filename></link>,
+ or
+ <link linkend='var-GROUPMEMS_PARAM'><filename>GROUPMEMS_PARAM</filename></link>
+ variables.
+ </note>
+ </para>
+
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_PARAM'><glossterm>USERADD_PARAM</glossterm>
+ <info>
+ USERADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should pass to the useradd command if you add a user to the system when the package is installed."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When inheriting the
+ <link linkend='ref-classes-useradd'><filename>useradd</filename></link>
+ class, this variable
+ specifies for a package what parameters should pass
+ to the <filename>useradd</filename> command
+ if you add a user to the system when the package
+ is installed.
+ </para>
+
+ <para>
+ Here is an example from the <filename>dbus</filename>
+ recipe:
+ <literallayout class='monospaced'>
+ USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+ --no-create-home --shell /bin/false \
+ --user-group messagebus"
+ </literallayout>
+ For information on the standard Linux shell command
+ <filename>useradd</filename>, see
+ <ulink url='http://linux.die.net/man/8/useradd'></ulink>.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADD_UID_TABLES'><glossterm>USERADD_UID_TABLES</glossterm>
+ <info>
+ USERADD_UID_TABLES[doc] = "Specifies a password file to use for obtaining static user identification (uid) values when the OpenEmbedded build system adds a user to the system during package installation."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies a password file to use for obtaining static
+ user identification (<filename>uid</filename>) values
+ when the OpenEmbedded build system adds a user to the
+ system during package installation.
+ </para>
+
+ <para>
+ When applying static user identification
+ (<filename>uid</filename>) values, the OpenEmbedded build
+ system looks in
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>
+ for a <filename>files/passwd</filename> file and then applies
+ those <filename>uid</filename> values.
+ Set the variable as follows in your
+ <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ USERADD_UID_TABLES = "files/passwd"
+ </literallayout>
+ </para>
+
+ <note>
+ Setting the
+ <link linkend='var-USERADDEXTENSION'><filename>USERADDEXTENSION</filename></link>
+ variable to "useradd-staticids" causes the build system
+ to use static <filename>uid</filename> values.
+ </note>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-USERADDEXTENSION'><glossterm>USERADDEXTENSION</glossterm>
+ <info>
+ USERADDEXTENSION[doc] = "When set to 'useradd-staticids', causes the OpenEmbedded build system to base all user and group additions on a static passwd and group files found in BBPATH."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ When set to "useradd-staticids", causes the
+ OpenEmbedded build system to base all user and group
+ additions on a static
+ <filename>passwd</filename> and
+ <filename>group</filename> files found in
+ <link linkend='var-BBPATH'><filename>BBPATH</filename></link>.
+ </para>
+
+ <para>
+ To use static user identification (<filename>uid</filename>)
+ and group identification (<filename>gid</filename>)
+ values, set the variable
+ as follows in your <filename>local.conf</filename> file:
+ <literallayout class='monospaced'>
+ USERADDEXTENSION = "useradd-staticids"
+ </literallayout>
+ <note>
+ Setting this variable to use static
+ <filename>uid</filename> and <filename>gid</filename>
+ values causes the OpenEmbedded build system to employ
+ the
+ <link linkend='ref-classes-useradd'><filename>useradd-staticids</filename></link>
+ class.
+ </note>
+ </para>
+
+ <para>
+ If you use static <filename>uid</filename> and
+ <filename>gid</filename> information, you must also
+ specify the <filename>files/passwd</filename> and
+ <filename>files/group</filename> files by setting the
+ <link linkend='var-USERADD_UID_TABLES'><filename>USERADD_UID_TABLES</filename></link>
+ and
+ <link linkend='var-USERADD_GID_TABLES'><filename>USERADD_GID_TABLES</filename></link>
+ variables.
+ Additionally, you should also set the
+ <link linkend='var-USERADD_ERROR_DYNAMIC'><filename>USERADD_ERROR_DYNAMIC</filename></link>
+ variable.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-v'><title>V</title>
+
+ <glossentry id='var-VOLATILE_LOG_DIR'><glossterm>VOLATILE_LOG_DIR</glossterm>
+ <info>
+ VOLATILE_LOG_DIR[doc] = "Specifies the persistence of the target's /var/log directory, which is used to house postinstall target log files."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the persistence of the target's
+ <filename>/var/log</filename> directory, which is used to
+ house postinstall target log files.
+ </para>
+
+ <para>
+ By default, <filename>VOLATILE_LOG_DIR</filename> is set
+ to "yes", which means the file is not persistent.
+ You can override this setting by setting the
+ variable to "no" to make the log directory persistent.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-w'><title>W</title>
+
+ <glossentry id='var-WARN_QA'><glossterm>WARN_QA</glossterm>
+ <info>
+ WARN_QA[doc] = "Specifies the quality assurance checks whose failures are reported as warnings by the OpenEmbedded build system."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the quality assurance checks whose failures are
+ reported as warnings by the OpenEmbedded build system.
+ You set this variable in your distribution configuration
+ file.
+ For a list of the checks you can control with this variable,
+ see the
+ "<link linkend='ref-classes-insane'><filename>insane.bbclass</filename></link>"
+ section.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-WKS_FILE_DEPENDS'><glossterm>WKS_FILE_DEPENDS</glossterm>
+ <info>
+ WKS_FILE_DEPENDS[doc] = "Lists a recipe's build-time dependencies specific to Wic."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+ When placed in the recipe that builds your image, this
+ variable lists build-time dependencies.
+ The <filename>WKS_FILE_DEPENDS</filename> variable is only
+ applicable when Wic images are active (i.e. when
+ <link linkend='var-IMAGE_FSTYPES'><filename>IMAGE_FSTYPES</filename></link>
+ contains entries related to Wic).
+ If your recipe does not create Wic images, the variable
+ has no effect.
+ </para>
+
+ <para>
+ The <filename>WKS_FILE_DEPENDS</filename> variable is
+ similar to the
+ <link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
+ variable.
+ When you use the variable in your recipe that builds the
+ Wic image, dependencies you list in the
+ <filename>WIC_FILE_DEPENDS</filename> variable are added to
+ the <filename>DEPENDS</filename> variable.
+ </para>
+
+ <para>
+ With the <filename>WKS_FILE_DEPENDS</filename> variable,
+ you have the possibility to specify a list of additional
+ dependencies (e.g. native tools, bootloaders, and so forth),
+ that are required to build Wic images.
+ Following is an example:
+ <literallayout class='monospaced'>
+ WKS_FILE_DEPENDS = "<replaceable>some-native-tool</replaceable>"
+ </literallayout>
+ In the previous example,
+ <replaceable>some-native-tool</replaceable> would be
+ replaced with an actual native tool on which the build
+ would depend.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-WKS_FILE'><glossterm>WKS_FILE</glossterm>
+ <info>
+ WKS_FILE[doc] = "Specifies the name of the wic kickstart file."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+ Specifies the location of the Wic
+ kickstart file that is used by the OpenEmbedded build
+ system to create a partitioned image
+ (<replaceable>image</replaceable><filename>.wic</filename>).
+ For information on how to create a partitioned image, see
+ the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#creating-partitioned-images-using-wic'>Creating Partitioned Images Using Wic</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ For details on the kickstart file format, see the
+ "<link linkend='ref-kickstart'>OpenEmbedded Kickstart (<filename>.wks</filename>) Reference</link>
+ Chapter.
+ </para>
+ </glossdef>
+ </glossentry>
+
+ <glossentry id='var-WORKDIR'><glossterm>WORKDIR</glossterm>
+ <info>
+ WORKDIR[doc] = "The pathname of the working directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and changes as different packages are built."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ The pathname of the work directory in which the OpenEmbedded
+ build system builds a recipe.
+ This directory is located within the
+ <link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>
+ directory structure and is specific to the recipe being
+ built and the system for which it is being built.
+ </para>
+
+ <para>
+ The <filename>WORKDIR</filename> directory is defined as
+ follows:
+ <literallayout class='monospaced'>
+ ${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}
+ </literallayout>
+ The actual directory depends on several things:
+ <itemizedlist>
+ <listitem><filename>TMPDIR</filename>:
+ The top-level build output directory</listitem>
+ <listitem><link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>:
+ The target system identifier</listitem>
+ <listitem><link linkend='var-PN'><filename>PN</filename></link>:
+ The recipe name</listitem>
+ <listitem><link linkend='var-EXTENDPE'><filename>EXTENDPE</filename></link>:
+ The epoch - (if
+ <link linkend='var-PE'><filename>PE</filename></link>
+ is not specified, which is usually the case for most
+ recipes, then <filename>EXTENDPE</filename> is blank)</listitem>
+ <listitem><link linkend='var-PV'><filename>PV</filename></link>:
+ The recipe version</listitem>
+ <listitem><link linkend='var-PR'><filename>PR</filename></link>:
+ The recipe revision</listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ As an example, assume a Source Directory top-level folder
+ name <filename>poky</filename>, a default Build Directory at
+ <filename>poky/build</filename>, and a
+ <filename>qemux86-poky-linux</filename> machine target
+ system.
+ Furthermore, suppose your recipe is named
+ <filename>foo_1.3.0-r0.bb</filename>.
+ In this case, the work directory the build system uses to
+ build the package would be as follows:
+ <literallayout class='monospaced'>
+ poky/build/tmp/work/qemux86-poky-linux/foo/1.3.0-r0
+ </literallayout>
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+ <glossdiv id='var-glossary-x'><title>X</title>
+
+ <glossentry id='var-XSERVER'><glossterm>XSERVER</glossterm>
+ <info>
+ XSERVER[doc] = "Specifies the packages that should be installed
+ to provide an X server and drivers for the current machine."
+ </info>
+ <glossdef>
+ <para role="glossdeffirst">
+<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
+ Specifies the packages that should be installed to
+ provide an X server and drivers for the current machine,
+ assuming your image directly includes
+ <filename>packagegroup-core-x11-xserver</filename> or,
+ perhaps indirectly, includes "x11-base" in
+ <link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
+ </para>
+
+ <para>
+ The default value of <filename>XSERVER</filename>, if not
+ specified in the machine configuration, is
+ "xserver-xorg xf86-video-fbdev xf86-input-evdev".
+ </para>
+ </glossdef>
+ </glossentry>
+
+ </glossdiv>
+
+<!-- <glossdiv id='var-glossary-y'><title>Y</title>-->
+<!-- </glossdiv>-->
+
+<!-- <glossdiv id='var-glossary-z'><title>Z</title>-->
+<!-- </glossdiv>-->
+
+</glossary>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/ref-manual/ref-varlocality.xml b/poky/documentation/ref-manual/ref-varlocality.xml
new file mode 100644
index 000000000..54524d5b6
--- /dev/null
+++ b/poky/documentation/ref-manual/ref-varlocality.xml
@@ -0,0 +1,198 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='ref-varlocality'>
+ <title>Variable Context</title>
+
+ <para>
+ While you can use most variables in almost any context such as
+ <filename>.conf</filename>, <filename>.bbclass</filename>,
+ <filename>.inc</filename>, and <filename>.bb</filename> files,
+ some variables are often associated with a particular locality or context.
+ This chapter describes some common associations.
+ </para>
+
+ <section id='ref-varlocality-configuration'>
+ <title>Configuration</title>
+
+ <para>
+ The following subsections provide lists of variables whose context is
+ configuration: distribution, machine, and local.
+ </para>
+
+ <section id='ref-varlocality-config-distro'>
+ <title>Distribution (Distro)</title>
+
+ <para>
+ This section lists variables whose configuration context is the
+ distribution, or distro.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-DISTRO'>DISTRO</link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-DISTRO_NAME'>DISTRO_NAME</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-DISTRO_VERSION'>DISTRO_VERSION</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MAINTAINER'>MAINTAINER</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-TARGET_OS'>TARGET_OS</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-TARGET_FPU'>TARGET_FPU</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-TCMODE'>TCMODE</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-TCLIBC'>TCLIBC</link></filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-varlocality-config-machine'>
+ <title>Machine</title>
+
+ <para>
+ This section lists variables whose configuration context is the
+ machine.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-TARGET_ARCH'>TARGET_ARCH</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-SERIAL_CONSOLES'>SERIAL_CONSOLES</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-PACKAGE_EXTRA_ARCHS'>PACKAGE_EXTRA_ARCHS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-IMAGE_FSTYPES'>IMAGE_FSTYPES</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE_FEATURES'>MACHINE_FEATURES</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE_EXTRA_RDEPENDS'>MACHINE_EXTRA_RDEPENDS
+ </link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE_EXTRA_RRECOMMENDS'>MACHINE_EXTRA_RRECOMMENDS
+ </link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RDEPENDS'>MACHINE_ESSENTIAL_EXTRA_RDEPENDS
+ </link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'>
+ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</link></filename></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-varlocality-config-local'>
+ <title>Local</title>
+
+ <para>
+ This section lists variables whose configuration context is the
+ local configuration through the <filename>local.conf</filename>
+ file.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-DISTRO'>DISTRO</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-MACHINE'>MACHINE</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-DL_DIR'>DL_DIR</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-BBFILES'>BBFILES</link></filename>
+ </para></listitem>
+ <listitem><para><filename><link linkend='var-EXTRA_IMAGE_FEATURES'>EXTRA_IMAGE_FEATURES
+ </link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-PACKAGE_CLASSES'>PACKAGE_CLASSES</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-BB_NUMBER_THREADS'>BB_NUMBER_THREADS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-BBINCLUDELOGS'>BBINCLUDELOGS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-ENABLE_BINARY_LOCALE_GENERATION'>
+ ENABLE_BINARY_LOCALE_GENERATION</link></filename></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='ref-varlocality-recipes'>
+ <title>Recipes</title>
+
+ <para>
+ The following subsections provide lists of variables whose context is
+ recipes: required, dependencies, path, and extra build information.
+ </para>
+
+ <section id='ref-varlocality-recipe-required'>
+ <title>Required</title>
+
+ <para>
+ This section lists variables that are required for recipes.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-LICENSE'>LICENSE</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-LIC_FILES_CHKSUM'>LIC_FILES_CHKSUM</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-SRC_URI'>SRC_URI</link></filename> - used
+ in recipes that fetch local or remote files.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-varlocality-recipe-dependencies'>
+ <title>Dependencies</title>
+
+ <para>
+ This section lists variables that define recipe dependencies.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-DEPENDS'>DEPENDS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-RDEPENDS'>RDEPENDS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-RRECOMMENDS'>RRECOMMENDS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-RCONFLICTS'>RCONFLICTS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-RREPLACES'>RREPLACES</link>
+ </filename></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-varlocality-recipe-paths'>
+ <title>Paths</title>
+
+ <para>
+ This section lists variables that define recipe paths.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-WORKDIR'>WORKDIR</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-S'>S</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-FILES'>FILES</link>
+ </filename></para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='ref-varlocality-recipe-build'>
+ <title>Extra Build Information</title>
+
+ <para>
+ This section lists variables that define extra build information for recipes.
+ <itemizedlist>
+ <listitem><para><filename><link linkend='var-DEFAULT_PREFERENCE'>DEFAULT_PREFERENCE
+ </link></filename></para></listitem>
+ <listitem><para><filename><link linkend='var-EXTRA_OECMAKE'>EXTRA_OECMAKE</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-EXTRA_OECONF'>EXTRA_OECONF</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-EXTRA_OEMAKE'>EXTRA_OEMAKE</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-PACKAGECONFIG_CONFARGS'>PACKAGECONFIG_CONFARGS</link>
+ </filename></para></listitem>
+ <listitem><para><filename><link linkend='var-PACKAGES'>PACKAGES</link></filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4 spell spelllang=en_gb
+-->
diff --git a/poky/documentation/ref-manual/resources.xml b/poky/documentation/ref-manual/resources.xml
new file mode 100644
index 000000000..be0469616
--- /dev/null
+++ b/poky/documentation/ref-manual/resources.xml
@@ -0,0 +1,305 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='resources'>
+<title>Contributions and Additional Information</title>
+
+<section id='resources-intro'>
+ <title>Introduction</title>
+ <para>
+ The Yocto Project team is happy for people to experiment with the
+ Yocto Project.
+ A number of places exist to find help if you run into difficulties
+ or find bugs.
+ This presents information about contributing and participating in
+ the Yocto Project.
+ </para>
+</section>
+
+<section id='resources-contributions'>
+ <title>Contributions</title>
+
+ <para>
+ The Yocto Project gladly accepts contributions.
+ You can submit changes to the project either by creating and sending
+ pull requests,
+ or by submitting patches through email.
+ For information on how to do both as well as information on how
+ to identify the maintainer for each area of code, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#how-to-submit-a-change'>Submitting a Change to the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+</section>
+
+<section id='resources-bugtracker'>
+ <title>Yocto Project Bugzilla</title>
+
+ <para>
+ The Yocto Project uses its own implementation of
+ <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink> to
+ track defects (bugs).
+ Implementations of Bugzilla work well for group development because
+ they track bugs and code changes, can be used to communicate changes
+ and problems with developers, can be used to submit and review patches,
+ and can be used to manage quality assurance.
+ </para>
+
+ <para>
+ Sometimes it is helpful to submit, investigate, or track a bug against
+ the Yocto Project itself (e.g. when discovering an issue with some
+ component of the build system that acts contrary to the documentation
+ or your expectations).
+ </para>
+
+ <para>
+ A general procedure and guidelines exist for when you use Bugzilla to
+ submit a bug.
+ For information on how to use Bugzilla to submit a bug against the
+ Yocto Project, see the following:
+ <itemizedlist>
+ <listitem><para>
+ The
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#submitting-a-defect-against-the-yocto-project'>Submitting a Defect Against the Yocto Project</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para></listitem>
+ <listitem><para>
+ The Yocto Project
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla wiki page</ulink>
+ </para></listitem>
+ </itemizedlist>
+ For information on Bugzilla in general, see
+ <ulink url='http://www.bugzilla.org/about/'></ulink>.
+ </para>
+</section>
+
+<section id='resources-mailinglist'>
+ <title>Mailing lists</title>
+
+ <para>
+ A number of mailing lists maintained by the Yocto Project exist
+ as well as related OpenEmbedded mailing lists for discussion,
+ patch submission and announcements.
+ To subscribe to one of the following mailing lists, click on the
+ appropriate URL in the following list and follow the instructions:
+ <itemizedlist>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto'></ulink> -
+ General Yocto Project discussion mailing list. </para></listitem>
+ <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/openembedded-core'></ulink> -
+ Discussion mailing list about OpenEmbedded-Core (the core metadata).</para></listitem>
+ <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/openembedded-devel'></ulink> -
+ Discussion mailing list about OpenEmbedded.</para></listitem>
+ <listitem><para><ulink url='&OE_LISTS_URL;/listinfo/bitbake-devel'></ulink> -
+ Discussion mailing list about the
+ <link linkend='bitbake-term'>BitBake</link>
+ build tool.</para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/poky'></ulink> -
+ Discussion mailing list about
+ <link linkend='poky'>Poky</link>.
+ </para></listitem>
+ <listitem><para><ulink url='&YOCTO_LISTS_URL;/listinfo/yocto-announce'></ulink> -
+ Mailing list to receive official Yocto Project release and milestone
+ announcements.</para></listitem>
+ </itemizedlist>
+ </para>
+ For more Yocto Project-related mailing lists, see the
+ <ulink url='&YOCTO_HOME_URL;'>Yocto Project Website</ulink>.
+</section>
+
+<section id='resources-irc'>
+ <title>Internet Relay Chat (IRC)</title>
+
+ <para>
+ Two IRC channels on freenode are available for the Yocto Project and Poky discussions:
+ <itemizedlist>
+ <listitem><para><filename>#yocto</filename></para></listitem>
+ <listitem><para><filename>#poky</filename></para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='resources-links-and-related-documentation'>
+ <title>Links and Related Documentation</title>
+
+ <para>
+ Here is a list of resources you might find helpful:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_HOME_URL;'>The Yocto Project website</ulink>:
+ </emphasis> The home site for the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Main_Page'>The Yocto Project Main Wiki Page</ulink>:
+ </emphasis>
+ The main wiki page for the Yocto Project.
+ This page contains information about project planning,
+ release engineering, QA &amp; automation, a reference
+ site map, and other resources related to the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&OE_HOME_URL;'>OpenEmbedded</ulink>:
+ </emphasis>
+ The build system used by the Yocto Project.
+ This project is the upstream, generic, embedded distribution
+ from which the Yocto Project derives its build system (Poky)
+ and to which it contributes.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='http://www.openembedded.org/wiki/BitBake'>
+ BitBake</ulink>:
+ </emphasis> The tool used to process metadata.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual:</ulink>
+ </emphasis>
+ A comprehensive guide to the BitBake tool.
+ If you want information on BitBake, see this manual.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_BRIEF_URL;'>Yocto Project Quick Build</ulink>:
+ </emphasis>
+ This short document lets you experience building an image using
+ the Yocto Project without having to understand any concepts or
+ details.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_OM_URL;'>Yocto Project Overview and Concepts Manual</ulink>:
+ </emphasis>
+ This manual provides overview and conceptual information
+ about the Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_DEV_URL;'>Yocto Project Development Tasks Manual</ulink>:
+ </emphasis>
+ This manual is a "how-to" guide that presents procedures
+ useful to both application and system developers who use the
+ Yocto Project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
+ manual:</emphasis>
+ This guide provides information that lets you get going
+ with the standard or extensible SDK.
+ An SDK, with its cross-development toolchains, allows you
+ to develop projects inside or outside of the Yocto Project
+ environment.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_BSP_URL;'>Yocto Project Board Support Package (BSP) Developer's Guide</ulink>:
+ </emphasis>
+ This guide defines the structure for BSP components.
+ Having a commonly understood structure encourages
+ standardization.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;'>Yocto Project Linux Kernel Development Manual</ulink>:
+ </emphasis>
+ This manual describes how to work with Linux Yocto kernels as
+ well as provides a bit of conceptual information on the
+ construction of the Yocto Linux kernel tree.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_REF_URL;'>Yocto Project Reference Manual</ulink>:
+ </emphasis>
+ This manual provides reference material such as variable,
+ task, and class descriptions.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_MM_URL;'>Yocto Project Mega-Manual</ulink>:
+ </emphasis>
+ This manual is simply a single HTML file comprised of the
+ bulk of the Yocto Project manuals.
+ The Mega-Manual primarily exists as a vehicle by which you can
+ easily search for phrases and terms used in the Yocto Project
+ documentation set.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_PROF_URL;'>Yocto Project Profiling and Tracing Manual</ulink>:
+ </emphasis>
+ This manual presents a set of common and generally useful
+ tracing and profiling schemes along with their applications
+ (as appropriate) to each tool.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_TOAST_URL;'>Toaster User Manual</ulink>:
+ </emphasis>
+ This manual introduces and describes how to set up and use
+ Toaster.
+ Toaster is an Application Programming Interface (API) and
+ web-based interface to the
+ <link linkend='build-system-term'>OpenEmbedded Build System</link>,
+ which uses BitBake, that reports build information.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_DOCS_SDK_URL;#adt-eclipse'>Eclipse IDE Yocto Plug-in</ulink>:
+ </emphasis>
+ Instructions that demonstrate how an application developer
+ uses the Eclipse Yocto Project Plug-in feature within
+ the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_WIKI_URL;/wiki/FAQ'>FAQ</ulink>:
+ </emphasis>
+ A list of commonly asked questions and their answers.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Release Notes:</emphasis>
+ Features, updates and known issues for the current
+ release of the Yocto Project.
+ To access the Release Notes, go to the
+ <ulink url='&YOCTO_HOME_URL;/software-overview/downloads/'>Downloads</ulink>
+ page on the Yocto Project website and click on the
+ "RELEASE INFORMATION" link for the appropriate release.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_BUGZILLA_URL;'>Bugzilla</ulink>:
+ </emphasis>
+ The bug tracking application the Yocto Project uses.
+ If you find problems with the Yocto Project, you should report
+ them using this application.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Bugzilla_Configuration_and_Bug_Tracking'>Bugzilla Configuration and Bug Tracking Wiki Page</ulink>:
+ </emphasis>
+ Information on how to get set up and use the Yocto Project
+ implementation of Bugzilla for logging and tracking Yocto
+ Project defects.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Internet Relay Chat (IRC):</emphasis>
+ Two IRC channels on freenode are available
+ for Yocto Project and Poky discussions: <filename>#yocto</filename> and
+ <filename>#poky</filename>, respectively.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <ulink url='http://wiki.qemu.org/Index.html'>Quick EMUlator (QEMU)</ulink>:
+ </emphasis>
+ An open-source machine emulator and virtualizer.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/figures/sdk-autotools-flow.png b/poky/documentation/sdk-manual/figures/sdk-autotools-flow.png
new file mode 100644
index 000000000..ec6685f8b
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-autotools-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png b/poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png
new file mode 100644
index 000000000..e7d6173d2
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-devtool-add-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png b/poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png
new file mode 100644
index 000000000..18ba8b7e6
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-devtool-modify-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-devtool-upgrade-flow.png b/poky/documentation/sdk-manual/figures/sdk-devtool-upgrade-flow.png
new file mode 100644
index 000000000..7d4f395e2
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-devtool-upgrade-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png b/poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png
new file mode 100644
index 000000000..9f986e0d4
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-eclipse-dev-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-environment.png b/poky/documentation/sdk-manual/figures/sdk-environment.png
new file mode 100644
index 000000000..78b8cad39
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-environment.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png b/poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
new file mode 100644
index 000000000..99e07ce6f
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-installed-extensible-sdk-directory.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png b/poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
new file mode 100644
index 000000000..d4af85020
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-installed-standard-sdk-directory.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-makefile-flow.png b/poky/documentation/sdk-manual/figures/sdk-makefile-flow.png
new file mode 100644
index 000000000..0ccb4180a
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-makefile-flow.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/figures/sdk-title.png b/poky/documentation/sdk-manual/figures/sdk-title.png
new file mode 100644
index 000000000..e69e03935
--- /dev/null
+++ b/poky/documentation/sdk-manual/figures/sdk-title.png
Binary files differ
diff --git a/poky/documentation/sdk-manual/sdk-appendix-customizing-standard.xml b/poky/documentation/sdk-manual/sdk-appendix-customizing-standard.xml
new file mode 100644
index 000000000..f20891c80
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-appendix-customizing-standard.xml
@@ -0,0 +1,58 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='sdk-appendix-customizing-standard'>
+
+<title>Customizing the Standard SDK</title>
+
+<para>
+ This appendix presents customizations you can apply to the standard SDK.
+</para>
+
+<section id='sdk-adding-individual-packages'>
+ <title>Adding Individual Packages to the Standard SDK</title>
+
+ <para>
+ When you build a standard SDK using the
+ <filename>bitbake -c populate_sdk</filename>, a default set of
+ packages is included in the resulting SDK.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_HOST_TASK'><filename>TOOLCHAIN_HOST_TASK</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></ulink>
+ variables control the set of packages adding to the SDK.
+ </para>
+
+ <para>
+ If you want to add individual packages to the toolchain that runs on
+ the host, simply add those packages to the
+ <filename>TOOLCHAIN_HOST_TASK</filename> variable.
+ Similarly, if you want to add packages to the default set that is
+ part of the toolchain that runs on the target, add the packages to the
+ <filename>TOOLCHAIN_TARGET_TASK</filename> variable.
+ </para>
+</section>
+
+<section id='adding-api-documentation-to-the-standard-sdk'>
+ <title>Adding API Documentation to the Standard SDK</title>
+
+ <para>
+ You can include API documentation as well as any other
+ documentation provided by recipes with the standard SDK by
+ adding "api-documentation" to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_FEATURES'><filename>DISTRO_FEATURES</filename></ulink>
+ variable:
+ <literallayout class='monospaced'>
+ DISTRO_FEATURES_append = " api-documentation"
+ </literallayout>
+ Setting this variable as shown here causes the OpenEmbedded build
+ system to build the documentation and then include it in the standard
+ SDK.
+ </para>
+</section>
+
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-appendix-customizing.xml b/poky/documentation/sdk-manual/sdk-appendix-customizing.xml
new file mode 100644
index 000000000..5b56e738d
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-appendix-customizing.xml
@@ -0,0 +1,398 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='sdk-appendix-customizing'>
+
+<title>Customizing the Extensible SDK</title>
+
+<para>
+ This appendix presents customizations you can apply to the extensible SDK.
+</para>
+
+<section id='sdk-configuring-the-extensible-sdk'>
+ <title>Configuring the Extensible SDK</title>
+
+ <para>
+ The extensible SDK primarily consists of a pre-configured copy of
+ the OpenEmbedded build system from which it was produced.
+ Thus, the SDK's configuration is derived using that build system and
+ the following filters, which the OpenEmbedded build system applies
+ against <filename>local.conf</filename> and
+ <filename>auto.conf</filename> if they are present:
+ <itemizedlist>
+ <listitem><para>
+ Variables whose values start with "/" are excluded since the
+ assumption is that those values are paths that are likely to
+ be specific to the build host.
+ </para></listitem>
+ <listitem><para>
+ Variables listed in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_BLACKLIST'><filename>SDK_LOCAL_CONF_BLACKLIST</filename></ulink>
+ are excluded.
+ The default value blacklists
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONF_VERSION'><filename>CONF_VERSION</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-BB_NUMBER_THREADS'><filename>BB_NUMBER_THREADS</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKE'><filename>PARALLEL_MAKE</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PRSERV_HOST'><filename>PRSERV_HOST</filename></ulink>,
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>.
+ </para></listitem>
+ <listitem><para>
+ Variables listed in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_LOCAL_CONF_WHITELIST'><filename>SDK_LOCAL_CONF_WHITELIST</filename></ulink>
+ are included.
+ Including a variable in the value of
+ <filename>SDK_LOCAL_CONF_WHITELIST</filename> overrides either
+ of the above two conditions.
+ The default value is blank.
+ </para></listitem>
+ <listitem><para>
+ Classes inherited globally with
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHERIT'><filename>INHERIT</filename></ulink>
+ that are listed in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></ulink>
+ are disabled.
+ Using <filename>SDK_INHERIT_BLACKLIST</filename> to disable
+ these classes is is the typical method to disable classes that
+ are problematic or unnecessary in the SDK context.
+ The default value blacklists the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-buildhistory'><filename>buildhistory</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-icecc'><filename>icecc</filename></ulink>
+ classes.
+ </para></listitem>
+ </itemizedlist>
+ Additionally, the contents of <filename>conf/sdk-extra.conf</filename>,
+ when present, are appended to the end of
+ <filename>conf/local.conf</filename> within the produced SDK, without
+ any filtering.
+ The <filename>sdk-extra.conf</filename> file is particularly useful
+ if you want to set a variable value just for the SDK and not the
+ OpenEmbedded build system used to create the SDK.
+ </para>
+</section>
+
+<section id='adjusting-the-extensible-sdk-to-suit-your-build-system-setup'>
+ <title>Adjusting the Extensible SDK to Suit Your Build System Setup</title>
+
+ <para>
+ In most cases, the extensible SDK defaults should work.
+ However, some cases exist for which you might consider making
+ adjustments:
+ <itemizedlist>
+ <listitem><para>
+ If your SDK configuration inherits additional classes
+ using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-INHERIT'><filename>INHERIT</filename></ulink>
+ variable and you do not need or want those classes enabled in
+ the SDK, you can blacklist them by adding them to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INHERIT_BLACKLIST'><filename>SDK_INHERIT_BLACKLIST</filename></ulink>
+ variable.
+ The default value of <filename>SDK_INHERIT_BLACKLIST</filename>
+ is set using the "?=" operator.
+ Consequently, you will need to either set the complete value
+ using "=" or append the value using "_append".
+ </para></listitem>
+ <listitem><para>
+ If you have classes or recipes that add additional tasks to
+ the standard build flow (i.e. that execute as part of building
+ the recipe as opposed to needing to be called explicitly), then
+ you need to do one of the following:
+ <itemizedlist>
+ <listitem><para>
+ Ensure the tasks are shared state tasks (i.e. their
+ output is saved to and can be restored from the shared
+ state cache), or that the tasks are able to be
+ produced quickly from a task that is a shared state
+ task and add the task name to the value of
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_RECRDEP_TASKS'><filename>SDK_RECRDEP_TASKS</filename></ulink>.
+ </para></listitem>
+ <listitem><para>
+ Disable the tasks if they are added by a class and
+ you do not need the functionality the class provides
+ in the extensible SDK.
+ To disable the tasks, add the class to
+ <filename>SDK_INHERIT_BLACKLIST</filename> as previously
+ described.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ Generally, you want to have a shared state mirror set up so
+ users of the SDK can add additional items to the SDK after
+ installation without needing to build the items from source.
+ See the
+ "<link linkend='sdk-providing-additional-installable-extensible-sdk-content'>Providing Additional Installable Extensible SDK Content</link>"
+ section for information.
+ </para></listitem>
+ <listitem><para>
+ If you want users of the SDK to be able to easily update the
+ SDK, you need to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_UPDATE_URL'><filename>SDK_UPDATE_URL</filename></ulink>
+ variable.
+ For more information, see the
+ "<link linkend='sdk-providing-updates-after-installing-the-extensible-sdk'>Providing Updates After Installing the Extensible SDK</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ If you have adjusted the list of files and directories that
+ appear in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COREBASE'><filename>COREBASE</filename></ulink>
+ (other than layers that are enabled through
+ <filename>bblayers.conf</filename>), then you must list these
+ files in
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-COREBASE_FILES'><filename>COREBASE_FILES</filename></ulink>
+ so that the files are copied into the SDK.
+ </para></listitem>
+ <listitem><para>
+ If your OpenEmbedded build system setup uses a different
+ environment setup script other than
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>,
+ then you must set
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-OE_INIT_ENV_SCRIPT'><filename>OE_INIT_ENV_SCRIPT</filename></ulink>
+ to point to the environment setup script you use.
+ <note>
+ You must also reflect this change in the value used for the
+ <filename>COREBASE_FILES</filename> variable as previously
+ described.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+</section>
+
+<section id='sdk-changing-the-appearance-of-the-extensible-sdk'>
+ <title>Changing the Appearance of the Extensible SDK</title>
+
+ <para>
+ You can change the title shown by the SDK installer by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_TITLE'><filename>SDK_TITLE</filename></ulink>
+ variable.
+ By default, this title is derived from
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO_NAME'><filename>DISTRO_NAME</filename></ulink>
+ when it is set.
+ If the <filename>DISTRO_NAME</filename> variable is not set, the title
+ is derived from the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>
+ variable.
+ </para>
+</section>
+
+<section id='sdk-providing-updates-after-installing-the-extensible-sdk'>
+ <title>Providing Updates After Installing the Extensible SDK</title>
+
+ <para>
+ When you make changes to your configuration or to the metadata and
+ if you want those changes to be reflected in installed SDKs, you need
+ to perform additional steps to make it possible for those that use
+ the SDK to update their installations with the
+ <filename>devtool sdk-update</filename> command:
+ <orderedlist>
+ <listitem><para>
+ Arrange to be created a directory that can be shared over
+ HTTP or HTTPS.
+ </para></listitem>
+ <listitem><para>
+ Set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_UPDATE_URL'><filename>SDK_UPDATE_URL</filename></ulink>
+ variable to point to the corresponding HTTP or HTTPS URL.
+ Setting this variable causes any SDK built to default to that
+ URL and thus, the user does not have to pass the URL to the
+ <filename>devtool sdk-update</filename> command.
+ </para></listitem>
+ <listitem><para>
+ Build the extensible SDK normally (i.e., use the
+ <filename>bitbake -c populate_sdk_ext</filename> <replaceable>imagename</replaceable>
+ command).
+ </para></listitem>
+ <listitem><para>
+ Publish the SDK using the following command:
+ <literallayout class='monospaced'>
+ $ oe-publish-sdk <replaceable>some_path</replaceable>/sdk-installer.sh <replaceable>path_to_shared/http_directory</replaceable>
+ </literallayout>
+ You must repeat this step each time you rebuild the SDK
+ with changes that you want to make available through the
+ update mechanism.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ Completing the above steps allows users of the existing SDKs to
+ simply run <filename>devtool sdk-update</filename> to retrieve the
+ latest updates.
+ See the
+ "<link linkend='sdk-updating-the-extensible-sdk'>Updating the Extensible SDK</link>"
+ section for further information.
+ </para>
+</section>
+
+<section id='sdk-providing-additional-installable-extensible-sdk-content'>
+ <title>Providing Additional Installable Extensible SDK Content</title>
+
+ <para>
+ If you want the users of the extensible SDK you are building to be
+ able to add items to the SDK without needing to build the
+ items from source, you need to do a number of things:
+ <orderedlist>
+ <listitem><para>
+ Ensure the additional items you want the user to be able to
+ install are actually built.
+ You can ensure these items are built a number of different
+ ways: 1) Build them explicitly, perhaps using one or more
+ "meta" recipes that depend on lists of other recipes to keep
+ things tidy, or 2) Build the "world" target and set
+ <filename>EXCLUDE_FROM_WORLD_pn-</filename><replaceable>recipename</replaceable>
+ for the recipes you do not want built.
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXCLUDE_FROM_WORLD'><filename>EXCLUDE_FROM_WORLD</filename></ulink>
+ variable for additional information.
+ </para></listitem>
+ <listitem><para>
+ Expose the <filename>sstate-cache</filename> directory
+ produced by the build.
+ Typically, you expose this directory over HTTP or HTTPS.
+ </para></listitem>
+ <listitem><para>
+ Set the appropriate configuration so that the produced SDK
+ knows how to find the configuration.
+ The variable you need to set is
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SSTATE_MIRRORS'><filename>SSTATE_MIRRORS</filename></ulink>:
+ <literallayout class='monospaced'>
+ SSTATE_MIRRORS = "file://.* http://<replaceable>example</replaceable>.com/<replaceable>some_path</replaceable>/sstate-cache/PATH"
+ </literallayout>
+ You can set the <filename>SSTATE_MIRRORS</filename> variable
+ in two different places:
+ <itemizedlist>
+ <listitem><para>
+ If the mirror value you are setting is appropriate to
+ be set for both the OpenEmbedded build system that is
+ actually building the SDK and the SDK itself (i.e. the
+ mirror is accessible in both places or it will fail
+ quickly on the OpenEmbedded build system side, and its
+ contents will not interfere with the build), then you
+ can set the variable in your
+ <filename>local.conf</filename> or custom distro
+ configuration file.
+ You can then "whitelist" the variable through
+ to the SDK by adding the following:
+ <literallayout class='monospaced'>
+ SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Alternatively, if you just want to set the
+ <filename>SSTATE_MIRRORS</filename> variable's value
+ for the SDK alone, create a
+ <filename>conf/sdk-extra.conf</filename> either in
+ your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ or within any layer and put your
+ <filename>SSTATE_MIRRORS</filename> setting within
+ that file.
+ <note>
+ This second option is the safest option should
+ you have any doubts as to which method to use when
+ setting <filename>SSTATE_MIRRORS</filename>.
+ </note>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='sdk-minimizing-the-size-of-the-extensible-sdk-installer-download'>
+ <title>Minimizing the Size of the Extensible SDK Installer Download</title>
+
+ <para>
+ By default, the extensible SDK bundles the shared state artifacts for
+ everything needed to reconstruct the image for which the SDK was built.
+ This bundling can lead to an SDK installer file that is a Gigabyte or
+ more in size.
+ If the size of this file causes a problem, you can build an SDK that
+ has just enough in it to install and provide access to the
+ <filename>devtool command</filename> by setting the following in your
+ configuration:
+ <literallayout class='monospaced'>
+ SDK_EXT_TYPE = "minimal"
+ </literallayout>
+ Setting
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></ulink>
+ to "minimal" produces an SDK installer that is around 35 Mbytes in
+ size, which downloads and installs quickly.
+ You need to realize, though, that the minimal installer does not
+ install any libraries or tools out of the box.
+ These must be installed either "on the fly" or through actions you
+ perform using <filename>devtool</filename> or explicitly with the
+ <filename>devtool sdk-install</filename> command.
+ </para>
+
+ <para>
+ In most cases, when building a minimal SDK you will need to also enable
+ bringing in the information on a wider range of packages produced by
+ the system.
+ This is particularly true so that <filename>devtool add</filename>
+ is able to effectively map dependencies it discovers in a source tree
+ to the appropriate recipes.
+ Also so that the <filename>devtool search</filename> command
+ is able to return useful results.
+ </para>
+
+ <para>
+ To facilitate this wider range of information, you would additionally
+ set the following:
+ <literallayout class='monospaced'>
+ SDK_INCLUDE_PKGDATA = "1"
+ </literallayout>
+ See the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_PKGDATA'><filename>SDK_INCLUDE_PKGDATA</filename></ulink>
+ variable for additional information.
+ </para>
+
+ <para>
+ Setting the <filename>SDK_INCLUDE_PKGDATA</filename> variable as
+ shown causes the "world" target to be built so that information
+ for all of the recipes included within it are available.
+ Having these recipes available increases build time significantly and
+ increases the size of the SDK installer by 30-80 Mbytes depending on
+ how many recipes are included in your configuration.
+ </para>
+
+ <para>
+ You can use
+ <filename>EXCLUDE_FROM_WORLD_pn-</filename><replaceable>recipename</replaceable>
+ for recipes you want to exclude.
+ However, it is assumed that you would need to be building the "world"
+ target if you want to provide additional items to the SDK.
+ Consequently, building for "world" should not represent undue
+ overhead in most cases.
+ <note>
+ If you set <filename>SDK_EXT_TYPE</filename> to "minimal",
+ then providing a shared state mirror is mandatory so that items
+ can be installed as needed.
+ See the
+ "<link linkend='sdk-providing-additional-installable-extensible-sdk-content'>Providing Additional Installable Extensible SDK Content</link>"
+ section for more information.
+ </note>
+ </para>
+
+ <para>
+ You can explicitly control whether or not to include the toolchain
+ when you build an SDK by setting the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_TOOLCHAIN'><filename>SDK_INCLUDE_TOOLCHAIN</filename></ulink>
+ variable to "1".
+ In particular, it is useful to include the toolchain when you
+ have set <filename>SDK_EXT_TYPE</filename> to
+ "minimal", which by default, excludes the toolchain.
+ Also, it is helpful if you are building a small SDK for use with
+ an IDE, such as <trademark class='trade'>Eclipse</trademark>, or some
+ other tool where you do not want to take extra steps to install a
+ toolchain.
+ </para>
+</section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-appendix-neon.xml b/poky/documentation/sdk-manual/sdk-appendix-neon.xml
new file mode 100644
index 000000000..f648047ef
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-appendix-neon.xml
@@ -0,0 +1,905 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='sdk-appendix-neon-yp-eclipse-plug-in'>
+ <title>Using <trademark class='trade'>Eclipse</trademark> Neon</title>
+
+ <para>
+ This release of the Yocto Project supports both the Oxygen and Neon
+ versions of the Eclipse IDE.
+ This appendix presents information that describes how to obtain and
+ configure the Neon version of Eclipse.
+ It also provides a basic project example that you can work through
+ from start to finish.
+ For general information on using the Eclipse IDE and the Yocto
+ Project Eclipse Plug-In, see the
+ "<link linkend='sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></link>"
+ Chapter.
+ </para>
+
+ <section id='neon-setting-up-the-eclipse-ide'>
+ <title>Setting Up the Neon Version of the Eclipse IDE</title>
+
+ <para>
+ To develop within the Eclipse IDE, you need to do the following:
+ <orderedlist>
+ <listitem><para>Install the Neon version of the Eclipse
+ IDE.</para></listitem>
+ <listitem><para>Configure the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>Install the Eclipse Yocto Plug-in.
+ </para></listitem>
+ <listitem><para>Configure the Eclipse Yocto Plug-in.
+ </para></listitem>
+ </orderedlist>
+ <note>
+ Do not install Eclipse from your distribution's package
+ repository.
+ Be sure to install Eclipse from the official Eclipse
+ download site as directed in the next section.
+ </note>
+ </para>
+
+ <section id='neon-installing-eclipse-ide'>
+ <title>Installing the Neon Eclipse IDE</title>
+
+ <para>
+ Follow these steps to locate, install, and configure
+ Neon Eclipse:
+ <orderedlist>
+ <listitem><para><emphasis>Locate the Neon Download:</emphasis>
+ Open a browser and go to
+ <ulink url='http://www.eclipse.org/neon/'>http://www.eclipse.org/neon/</ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Download the Tarball:</emphasis>
+ Click the "Download" button and then use the "Eclipse
+ IDE for C/C++ Developers"
+ appropriate for your development system.
+ </para></listitem>
+ <listitem><para><emphasis>Unpack the Tarball:</emphasis>
+ Move to a clean directory and unpack the tarball.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ tar -xzvf ~/Downloads/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz
+ </literallayout>
+ Everything unpacks into a folder named "Eclipse".
+ </para></listitem>
+ <listitem><para><emphasis>Launch Eclipse:</emphasis>
+ The following commands launch Eclipse assuming you
+ unpacked it in your home directory:
+ <literallayout class='monospaced'>
+ $ cd ~/eclipse
+ $ ./eclipse
+ </literallayout>
+ Accept the default "workspace" once Eclipse launches.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-configuring-the-neon-eclipse-ide'>
+ <title>Configuring the Neon Eclipse IDE</title>
+
+ <para>
+ Follow these steps to configure the Neon Eclipse IDE.
+ <note>
+ Depending on how you installed Eclipse and what you have
+ already done, some of the options will not appear.
+ If you cannot find an option as directed by the manual,
+ it has already been installed.
+ </note>
+ <orderedlist>
+ <listitem><para>Be sure Eclipse is running and
+ you are in your workbench.
+ </para></listitem>
+ <listitem><para>Select "Install New Software" from
+ the "Help" pull-down menu.
+ </para></listitem>
+ <listitem><para>Select
+ "Neon - http://download.eclipse.org/releases/neon"
+ from the "Work with:" pull-down menu.
+ </para></listitem>
+ <listitem><para>Expand the box next to
+ "Linux Tools" and select the following
+ <literallayout class='monospaced'>
+ C/C++ Remote (Over TCF/TE) Run/Debug Launcher
+ TM Terminal
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Expand the box next to "Mobile and
+ Device Development" and select the following
+ boxes:
+ <literallayout class='monospaced'>
+ C/C++ Remote (Over TCF/TE) Run/Debug Launcher
+ Remote System Explorer User Actions
+ TM Terminal
+ TCF Remote System Explorer add-in
+ TCF Target Explorer
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Expand the box next to
+ "Programming Languages" and select the
+ following box:
+ <literallayout class='monospaced'>
+ C/C++ Development Tools SDK
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Complete the installation by clicking through
+ appropriate "Next" and "Finish" buttons.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-installing-the-eclipse-yocto-plug-in'>
+ <title>Installing or Accessing the Neon Eclipse Yocto Plug-in</title>
+
+ <para>
+ You can install the Eclipse Yocto Plug-in into the Eclipse
+ IDE one of two ways: use the Yocto Project's Eclipse
+ Update site to install the pre-built plug-in or build and
+ install the plug-in from the latest source code.
+ </para>
+
+ <section id='neon-new-software'>
+ <title>Installing the Pre-built Plug-in from the Yocto Project Eclipse Update Site</title>
+
+ <para>
+ To install the Neon Eclipse Yocto Plug-in from the update
+ site, follow these steps:
+ <orderedlist>
+ <listitem><para>Start up the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>In Eclipse, select "Install New
+ Software" from the "Help" menu.
+ </para></listitem>
+ <listitem><para>Click "Add..." in the "Work with:"
+ area.
+ </para></listitem>
+ <listitem><para>Enter
+ <filename>&ECLIPSE_DL_PLUGIN_URL;/neon</filename>
+ in the URL field and provide a meaningful name
+ in the "Name" field.
+ </para></listitem>
+ <listitem><para>Click "OK" to have the entry added
+ to the "Work with:" drop-down list.
+ </para></listitem>
+ <listitem><para>Select the entry for the plug-in
+ from the "Work with:" drop-down list.
+ </para></listitem>
+ <listitem><para>Check the boxes next to the following:
+ <literallayout class='monospaced'>
+ Yocto Project SDK Plug-in
+ Yocto Project Documentation plug-in
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Complete the remaining software
+ installation steps and then restart the Eclipse
+ IDE to finish the installation of the plug-in.
+ <note>
+ You can click "OK" when prompted about
+ installing software that contains unsigned
+ content.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-zip-file-method'>
+ <title>Installing the Plug-in Using the Latest Source Code</title>
+
+ <para>
+ To install the Neon Eclipse Yocto Plug-in from the latest
+ source code, follow these steps:
+ <orderedlist>
+ <listitem><para>Be sure your development system
+ has JDK 1.8+
+ </para></listitem>
+ <listitem><para>install X11-related packages:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install xauth
+ </literallayout>
+ </para></listitem>
+ <listitem><para>In a new terminal shell, create a Git
+ repository with:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/eclipse-yocto
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Use Git to checkout the correct
+ tag:
+ <literallayout class='monospaced'>
+ $ cd ~/eclipse-yocto
+ $ git checkout neon/yocto-&DISTRO;
+ </literallayout>
+ This creates a local tag named
+ <filename>neon/yocto-&DISTRO;</filename> based on
+ the branch <filename>origin/neon-master</filename>.
+ This puts you in a detached HEAD state, which
+ is fine since you are only going to be building
+ and not developing.
+ </para></listitem>
+ <listitem><para>Change to the
+ <filename>scripts</filename>
+ directory within the Git repository:
+ <literallayout class='monospaced'>
+ $ cd scripts
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Set up the local build environment
+ by running the setup script:
+ <literallayout class='monospaced'>
+ $ ./setup.sh
+ </literallayout>
+ When the script finishes execution,
+ it prompts you with instructions on how to run
+ the <filename>build.sh</filename> script, which
+ is also in the <filename>scripts</filename>
+ directory of the Git repository created
+ earlier.
+ </para></listitem>
+ <listitem><para>Run the <filename>build.sh</filename>
+ script as directed.
+ Be sure to provide the tag name, documentation
+ branch, and a release name.</para>
+ <para>
+ Following is an example:
+ <literallayout class='monospaced'>
+ $ ECLIPSE_HOME=/home/scottrif/eclipse-yocto/scripts/eclipse ./build.sh -l neon/yocto-&DISTRO; master yocto-&DISTRO; 2>&amp;1 | tee build.log
+ </literallayout>
+ The previous example command adds the tag you
+ need for <filename>neon/yocto-&DISTRO;</filename>
+ to <filename>HEAD</filename>, then tells the
+ build script to use the local (-l) Git checkout
+ for the build.
+ After running the script, the file
+ <filename>org.yocto.sdk-</filename><replaceable>release</replaceable><filename>-</filename><replaceable>date</replaceable><filename>-archive.zip</filename>
+ is in the current directory.
+ </para></listitem>
+ <listitem><para>If necessary, start the Eclipse IDE
+ and be sure you are in the Workbench.
+ </para></listitem>
+ <listitem><para>Select "Install New Software" from
+ the "Help" pull-down menu.
+ </para></listitem>
+ <listitem><para>Click "Add".
+ </para></listitem>
+ <listitem><para>Provide anything you want in the
+ "Name" field.
+ </para></listitem>
+ <listitem><para>Click "Archive" and browse to the
+ ZIP file you built earlier.
+ This ZIP file should not be "unzipped", and must
+ be the <filename>*archive.zip</filename> file
+ created by running the
+ <filename>build.sh</filename> script.
+ </para></listitem>
+ <listitem><para>Click the "OK" button.
+ </para></listitem>
+ <listitem><para>Check the boxes that appear in
+ the installation window to install the
+ following:
+ <literallayout class='monospaced'>
+ Yocto Project SDK Plug-in
+ Yocto Project Documentation plug-in
+ </literallayout>
+ </para></listitem>
+ <listitem><para>Finish the installation by clicking
+ through the appropriate buttons.
+ You can click "OK" when prompted about
+ installing software that contains unsigned
+ content.
+ </para></listitem>
+ <listitem><para>Restart the Eclipse IDE if
+ necessary.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ At this point you should be able to configure the
+ Eclipse Yocto Plug-in as described in the
+ "<link linkend='neon-configuring-the-eclipse-yocto-plug-in'>Configuring the Neon Eclipse Yocto Plug-in</link>"
+ section.</para>
+ </section>
+ </section>
+
+ <section id='neon-configuring-the-eclipse-yocto-plug-in'>
+ <title>Configuring the Neon Eclipse Yocto Plug-in</title>
+
+ <para>
+ Configuring the Neon Eclipse Yocto Plug-in involves setting the
+ Cross Compiler options and the Target options.
+ The configurations you choose become the default settings
+ for all projects.
+ You do have opportunities to change them later when
+ you configure the project (see the following section).
+ </para>
+
+ <para>
+ To start, you need to do the following from within the
+ Eclipse IDE:
+ <itemizedlist>
+ <listitem><para>Choose "Preferences" from the
+ "Window" menu to display the Preferences Dialog.
+ </para></listitem>
+ <listitem><para>Click "Yocto Project SDK" to display
+ the configuration screen.
+ </para></listitem>
+ </itemizedlist>
+ The following sub-sections describe how to configure the
+ the plug-in.
+ <note>
+ Throughout the descriptions, a start-to-finish example for
+ preparing a QEMU image for use with Eclipse is referenced
+ as the "wiki" and is linked to the example on the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'> Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
+ wiki page.
+ </note>
+ </para>
+
+ <section id='neon-configuring-the-cross-compiler-options'>
+ <title>Configuring the Cross-Compiler Options</title>
+
+ <para>
+ Cross Compiler options enable Eclipse to use your specific
+ cross compiler toolchain.
+ To configure these options, you must select
+ the type of toolchain, point to the toolchain, specify
+ the sysroot location, and select the target
+ architecture.
+ <itemizedlist>
+ <listitem><para><emphasis>Selecting the Toolchain Type:</emphasis>
+ Choose between
+ <filename>Standalone pre-built toolchain</filename>
+ and
+ <filename>Build system derived toolchain</filename>
+ for Cross Compiler Options.
+ <itemizedlist>
+ <listitem><para><emphasis>
+ <filename>Standalone Pre-built Toolchain:</filename></emphasis>
+ Select this type when you are using
+ a stand-alone cross-toolchain.
+ For example, suppose you are an
+ application developer and do not
+ need to build a target image.
+ Instead, you just want to use an
+ architecture-specific toolchain on
+ an existing kernel and target root
+ filesystem.
+ In other words, you have downloaded
+ and installed a pre-built toolchain
+ for an existing image.
+ </para></listitem>
+ <listitem><para><emphasis>
+ <filename>Build System Derived Toolchain:</filename></emphasis>
+ Select this type if you built the
+ toolchain as part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ When you select
+ <filename>Build system derived toolchain</filename>,
+ you are using the toolchain built and
+ bundled inside the Build Directory.
+ For example, suppose you created a
+ suitable image using the steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ In this situation, you would select the
+ <filename>Build system derived toolchain</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para><emphasis>Specify the Toolchain Root Location:</emphasis>
+ If you are using a stand-alone pre-built
+ toolchain, you should be pointing to where it is
+ installed (e.g.
+ <filename>/opt/poky/&DISTRO;</filename>).
+ See the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section for information about how the SDK is
+ installed.</para>
+ <para>If you are using a build system derived
+ toolchain, the path you provide for the
+ <filename>Toolchain Root Location</filename>
+ field is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ from which you run the
+ <filename>bitbake</filename> command (e.g
+ <filename>/home/scottrif/poky/build</filename>).</para>
+ <para>For more information, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Specify Sysroot Location:</emphasis>
+ This location is where the root filesystem for
+ the target hardware resides.
+ </para>
+ <para>This location depends on where you
+ separately extracted and installed the
+ target filesystem when you either built
+ it or downloaded it.
+ <note>
+ If you downloaded the root filesystem
+ for the target hardware rather than
+ built it, you must download the
+ <filename>sato-sdk</filename> image
+ in order to build any c/c++ projects.
+ </note>
+ As an example, suppose you prepared an image
+ using the steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ If so, the <filename>MY_QEMU_ROOTFS</filename>
+ directory is found in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ and you would browse to and select that directory
+ (e.g. <filename>/home/scottrif/build/MY_QEMU_ROOTFS</filename>).
+ </para>
+ <para>For more information on how to install the
+ toolchain and on how to extract and install the
+ sysroot filesystem, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ </para></listitem>
+ <listitem><para><emphasis>Select the Target Architecture:</emphasis>
+ The target architecture is the type of hardware
+ you are going to use or emulate.
+ Use the pull-down
+ <filename>Target Architecture</filename> menu
+ to make your selection.
+ The pull-down menu should have the supported
+ architectures.
+ If the architecture you need is not listed in
+ the menu, you will need to build the image.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-building-a-simple-image'>Building a Simple Image</ulink>"
+ section of the Yocto Project Development Tasks
+ Manual for more information.
+ You can also see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='neon-configuring-the-target-options'>
+ <title>Configuring the Target Options</title>
+
+ <para>
+ You can choose to emulate hardware using the QEMU
+ emulator, or you can choose to run your image on actual
+ hardware.
+ <itemizedlist>
+ <listitem><para><emphasis>QEMU:</emphasis>
+ Select this option if you will be using the
+ QEMU emulator.
+ If you are using the emulator, you also need to
+ locate the kernel and specify any custom
+ options.</para>
+ <para>If you selected the
+ <filename>Build system derived toolchain</filename>,
+ the target kernel you built will be located in
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in
+ <filename>tmp/deploy/images/<replaceable>machine</replaceable></filename>
+ directory.
+ As an example, suppose you performed the steps in
+ the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ In this case, you specify your Build Directory path
+ followed by the image (e.g.
+ <filename>/home/scottrif/poky/build/tmp/deploy/images/qemux86/bzImage-qemux86.bin</filename>).
+ </para>
+ <para>If you selected the standalone pre-built
+ toolchain, the pre-built image you downloaded is
+ located in the directory you specified when you
+ downloaded the image.</para>
+ <para>Most custom options are for advanced QEMU
+ users to further customize their QEMU instance.
+ These options are specified between paired
+ angled brackets.
+ Some options must be specified outside the
+ brackets.
+ In particular, the options
+ <filename>serial</filename>,
+ <filename>nographic</filename>, and
+ <filename>kvm</filename> must all be outside the
+ brackets.
+ Use the <filename>man qemu</filename> command
+ to get help on all the options and their use.
+ The following is an example:
+ <literallayout class='monospaced'>
+ serial ‘&lt;-m 256 -full-screen&gt;’
+ </literallayout></para>
+ <para>
+ Regardless of the mode, Sysroot is already
+ defined as part of the Cross-Compiler Options
+ configuration in the
+ <filename>Sysroot Location:</filename> field.
+ </para></listitem>
+ <listitem><para><emphasis>External HW:</emphasis>
+ Select this option if you will be using actual
+ hardware.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Click the "Apply" and "OK" to save your plug-in
+ configurations.
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='neon-creating-the-project'>
+ <title>Creating the Project</title>
+
+ <para>
+ You can create two types of projects: Autotools-based, or
+ Makefile-based.
+ This section describes how to create Autotools-based projects
+ from within the Eclipse IDE.
+ For information on creating Makefile-based projects in a
+ terminal window, see the
+ "<link linkend='makefile-based-projects'>Makefile-Based Projects</link>"
+ section.
+ <note>
+ Do not use special characters in project names
+ (e.g. spaces, underscores, etc.). Doing so can
+ cause the configuration to fail.
+ </note>
+ </para>
+
+ <para>
+ To create a project based on a Yocto template and then display
+ the source code, follow these steps:
+ <orderedlist>
+ <listitem><para>Select "C Project" from the "File -> New" menu.
+ </para></listitem>
+ <listitem><para>Expand <filename>Yocto Project SDK Autotools Project</filename>.
+ </para></listitem>
+ <listitem><para>Select <filename>Hello World ANSI C Autotools Projects</filename>.
+ This is an Autotools-based project based on a Yocto
+ template.
+ </para></listitem>
+ <listitem><para>Put a name in the <filename>Project name:</filename>
+ field.
+ Do not use hyphens as part of the name
+ (e.g. <filename>hello</filename>).
+ </para></listitem>
+ <listitem><para>Click "Next".
+ </para></listitem>
+ <listitem><para>Add appropriate information in the various
+ fields.
+ </para></listitem>
+ <listitem><para>Click "Finish".
+ </para></listitem>
+ <listitem><para>If the "open perspective" prompt appears,
+ click "Yes" so that you are in the C/C++ perspective.
+ </para></listitem>
+ <listitem><para>The left-hand navigation pane shows your
+ project.
+ You can display your source by double clicking the
+ project's source file.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-configuring-the-cross-toolchains'>
+ <title>Configuring the Cross-Toolchains</title>
+
+ <para>
+ The earlier section,
+ "<link linkend='neon-configuring-the-eclipse-yocto-plug-in'>Configuring the Neon Eclipse Yocto Plug-in</link>",
+ sets up the default project configurations.
+ You can override these settings for a given project by following
+ these steps:
+ <orderedlist>
+ <listitem><para>Select "Yocto Project Settings" from
+ the "Project -> Properties" menu.
+ This selection brings up the Yocto Project Settings
+ Dialog and allows you to make changes specific to an
+ individual project.</para>
+ <para>By default, the Cross Compiler Options and Target
+ Options for a project are inherited from settings you
+ provided using the Preferences Dialog as described
+ earlier in the
+ "<link linkend='neon-configuring-the-eclipse-yocto-plug-in'>Configuring the Neon Eclipse Yocto Plug-in</link>" section.
+ The Yocto Project Settings Dialog allows you to override
+ those default settings for a given project.
+ </para></listitem>
+ <listitem><para>Make or verify your configurations for the
+ project and click "OK".
+ </para></listitem>
+ <listitem><para>Right-click in the navigation pane and
+ select "Reconfigure Project" from the pop-up menu.
+ This selection reconfigures the project by running
+ <filename>autogen.sh</filename> in the workspace for
+ your project.
+ The script also runs <filename>libtoolize</filename>,
+ <filename>aclocal</filename>,
+ <filename>autoconf</filename>,
+ <filename>autoheader</filename>,
+ <filename>automake --a</filename>, and
+ <filename>./configure</filename>.
+ Click on the "Console" tab beneath your source code to
+ see the results of reconfiguring your project.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-building-the-project'>
+ <title>Building the Project</title>
+
+ <para>
+ To build the project select "Build All" from the
+ "Project" menu.
+ The console should update and you can note the cross-compiler
+ you are using.
+ <note>
+ When building "Yocto Project SDK Autotools" projects, the
+ Eclipse IDE might display error messages for
+ Functions/Symbols/Types that cannot be "resolved", even when
+ the related include file is listed at the project navigator and
+ when the project is able to build.
+ For these cases only, it is recommended to add a new linked
+ folder to the appropriate sysroot.
+ Use these steps to add the linked folder:
+ <orderedlist>
+ <listitem><para>
+ Select the project.
+ </para></listitem>
+ <listitem><para>
+ Select "Folder" from the
+ <filename>File > New</filename> menu.
+ </para></listitem>
+ <listitem><para>
+ In the "New Folder" Dialog, select "Link to alternate
+ location (linked folder)".
+ </para></listitem>
+ <listitem><para>
+ Click "Browse" to navigate to the include folder inside
+ the same sysroot location selected in the Yocto Project
+ configuration preferences.
+ </para></listitem>
+ <listitem><para>
+ Click "OK".
+ </para></listitem>
+ <listitem><para>
+ Click "Finish" to save the linked folder.
+ </para></listitem>
+ </orderedlist>
+ </note>
+ </para>
+ </section>
+
+ <section id='neon-starting-qemu-in-user-space-nfs-mode'>
+ <title>Starting QEMU in User-Space NFS Mode</title>
+
+ <para>
+ To start the QEMU emulator from within Eclipse, follow these
+ steps:
+ <note>
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Tasks Manual
+ for more information on using QEMU.
+ </note>
+ <orderedlist>
+ <listitem><para>Expose and select "External Tools
+ Configurations ..." from the "Run -> External Tools" menu.
+ </para></listitem>
+ <listitem><para>
+ Locate and select your image in the navigation panel to
+ the left (e.g. <filename>qemu_i586-poky-linux</filename>).
+ </para></listitem>
+ <listitem><para>
+ Click "Run" to launch QEMU.
+ <note>
+ The host on which you are running QEMU must have
+ the <filename>rpcbind</filename> utility running to be
+ able to make RPC calls on a server on that machine.
+ If QEMU does not invoke and you receive error messages
+ involving <filename>rpcbind</filename>, follow the
+ suggestions to get the service running.
+ As an example, on a new Ubuntu 16.04 LTS installation,
+ you must do the following in order to get QEMU to
+ launch:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install rpcbind
+ </literallayout>
+ After installing <filename>rpcbind</filename>, you
+ need to edit the
+ <filename>/etc/init.d/rpcbind</filename> file to
+ include the following line:
+ <literallayout class='monospaced'>
+ OPTIONS="-i -w"
+ </literallayout>
+ After modifying the file, you need to start the
+ service:
+ <literallayout class='monospaced'>
+ $ sudo service portmap restart
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para>If needed, enter your host root password in
+ the shell window at the prompt.
+ This sets up a <filename>Tap 0</filename> connection
+ needed for running in user-space NFS mode.
+ </para></listitem>
+ <listitem><para>Wait for QEMU to launch.
+ </para></listitem>
+ <listitem><para>Once QEMU launches, you can begin operating
+ within that environment.
+ One useful task at this point would be to determine the
+ IP Address for the user-space NFS by using the
+ <filename>ifconfig</filename> command.
+ The IP address of the QEMU machine appears in the
+ xterm window.
+ You can use this address to help you see which particular
+ IP address the instance of QEMU is using.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-deploying-and-debugging-the-application'>
+ <title>Deploying and Debugging the Application</title>
+
+ <para>
+ Once the QEMU emulator is running the image, you can deploy
+ your application using the Eclipse IDE and then use
+ the emulator to perform debugging.
+ Follow these steps to deploy the application.
+ <note>
+ Currently, Eclipse does not support SSH port forwarding.
+ Consequently, if you need to run or debug a remote
+ application using the host display, you must create a
+ tunneling connection from outside Eclipse and keep
+ that connection alive during your work.
+ For example, in a new terminal, run the following:
+ <literallayout class='monospaced'>
+ $ ssh -XY <replaceable>user_name</replaceable>@<replaceable>remote_host_ip</replaceable>
+ </literallayout>
+ Using the above form, here is an example:
+ <literallayout class='monospaced'>
+ $ ssh -XY root@192.168.7.2
+ </literallayout>
+ After running the command, add the command to be executed
+ in Eclipse's run configuration before the application
+ as follows:
+ <literallayout class='monospaced'>
+ export DISPLAY=:10.0
+ </literallayout>
+ Be sure to not destroy the connection during your QEMU
+ session (i.e. do not
+ exit out of or close that shell).
+ </note>
+ <orderedlist>
+ <listitem><para>Select "Debug Configurations..." from the
+ "Run" menu.</para></listitem>
+ <listitem><para>In the left area, expand
+ <filename>C/C++Remote Application</filename>.
+ </para></listitem>
+ <listitem><para>Locate your project and select it to bring
+ up a new tabbed view in the Debug Configurations Dialog.
+ </para></listitem>
+ <listitem><para>Click on the "Debugger" tab to see the
+ cross-tool debugger you are using.
+ Be sure to change to the debugger perspective in Eclipse.
+ </para></listitem>
+ <listitem><para>Click on the "Main" tab.
+ </para></listitem>
+ <listitem><para>Create a new connection to the QEMU instance
+ by clicking on "new".</para></listitem>
+ <listitem><para>Select <filename>SSH</filename>, which means
+ Secure Socket Shell.
+ Optionally, you can select a TCF connection instead.
+ </para></listitem>
+ <listitem><para>Click "Next".
+ </para></listitem>
+ <listitem><para>Clear out the "Connection name" field and
+ enter any name you want for the connection.
+ </para></listitem>
+ <listitem><para>Put the IP address for the connection in
+ the "Host" field.
+ For QEMU, the default is <filename>192.168.7.2</filename>.
+ However, if a previous QEMU session did not exit
+ cleanly, the IP address increments (e.g.
+ <filename>192.168.7.3</filename>).
+ <note>
+ You can find the IP address for the current QEMU
+ session by looking in the xterm that opens when
+ you launch QEMU.
+ </note>
+ </para></listitem>
+ <listitem><para>Enter <filename>root</filename>, which
+ is the default for QEMU, for the "User" field.
+ Be sure to leave the password field empty.
+ </para></listitem>
+ <listitem><para>Click "Finish" to close the
+ New Connections Dialog.
+ </para></listitem>
+ <listitem><para>If necessary, use the drop-down menu now in the
+ "Connection" field and pick the IP Address you entered.
+ </para></listitem>
+ <listitem><para>Assuming you are connecting as the root user,
+ which is the default for QEMU x86-64 SDK images provided by
+ the Yocto Project, in the "Remote Absolute File Path for
+ C/C++ Application" field, browse to
+ <filename>/home/root/</filename><replaceable>ProjectName</replaceable>
+ (e.g. <filename>/home/root/hello</filename>).
+ You could also browse to any other path you have write
+ access to on the target such as
+ <filename>/usr/bin</filename>.
+ This location is where your application will be located on
+ the QEMU system.
+ If you fail to browse to and specify an appropriate
+ location, QEMU will not understand what to remotely
+ launch.
+ Eclipse is helpful in that it auto fills your application
+ name for you assuming you browsed to a directory.
+ <note><title>Tips</title>
+ <itemizedlist>
+ <listitem><para>
+ If you are prompted to provide a username
+ and to optionally set a password, be sure
+ you provide "root" as the username and you
+ leave the password field blank.
+ </para></listitem>
+ <listitem><para>
+ If browsing to a directory fails or times
+ out, but you can
+ <filename>ssh</filename> into your QEMU
+ or target from the command line and you
+ have proxies set up, it is likely that
+ Eclipse is sending the SSH traffic to a
+ proxy.
+ In this case, either use TCF , or click on
+ "Configure proxy settings" in the
+ connection dialog and add the target IP
+ address to the "bypass proxy" section.
+ You might also need to change
+ "Active Provider" from Native to Manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Be sure you change to the "Debug" perspective in Eclipse.
+ </para></listitem>
+ <listitem><para>Click "Debug"
+ </para></listitem>
+ <listitem><para>Accept the debug perspective.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='neon-using-Linuxtools'>
+ <title>Using Linuxtools</title>
+
+ <para>
+ As mentioned earlier in the manual, performance tools exist
+ (Linuxtools) that enhance your development experience.
+ These tools are aids in developing and debugging applications and
+ images.
+ You can run these tools from within the Eclipse IDE through the
+ "Linuxtools" menu.
+ </para>
+
+ <para>
+ For information on how to configure and use these tools, see
+ <ulink url='http://www.eclipse.org/linuxtools/'>http://www.eclipse.org/linuxtools/</ulink>.
+ </para>
+ </section>
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-appendix-obtain.xml b/poky/documentation/sdk-manual/sdk-appendix-obtain.xml
new file mode 100644
index 000000000..aa06358a0
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-appendix-obtain.xml
@@ -0,0 +1,429 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<appendix id='sdk-appendix-obtain'>
+
+<title>Obtaining the SDK</title>
+
+<section id='sdk-locating-pre-built-sdk-installers'>
+ <title>Locating Pre-Built SDK Installers</title>
+
+ <para>
+ You can use existing, pre-built toolchains by locating and running
+ an SDK installer script that ships with the Yocto Project.
+ Using this method, you select and download an architecture-specific
+ SDK installer and then run the script to hand-install the
+ toolchain.
+ </para>
+
+ <para>
+ Follow these steps to locate and hand-install the toolchain:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Go to the Installers Directory:</emphasis>
+ Go to <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'></ulink>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Open the Folder for Your Development System:</emphasis>
+ Open the folder that matches your host development system
+ (i.e. <filename>i686</filename> for 32-bit machines or
+ <filename>x86_64</filename> for 64-bit machines).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Locate and Download the SDK Installer:</emphasis>
+ You need to find and download the installer appropriate for
+ your development system, target hardware, and image type.
+ </para>
+
+ <para>The installer files (<filename>*.sh</filename>) follow
+ this naming convention:
+ <literallayout class='monospaced'>
+ poky-eglibc-<replaceable>host_system</replaceable>-core-image-<replaceable>type</replaceable>-<replaceable>arch</replaceable>-toolchain-ext-<replaceable>release</replaceable>.sh
+
+ Where:
+ <replaceable>host_system</replaceable> is a string representing your development system:
+ i686 or x86_64.
+
+ <replaceable>type</replaceable> is a string representing either a "sato" or "minimal"
+ image.
+
+ <replaceable>arch</replaceable> is a string representing the target architecture:
+ aarch64, armv5e, core2-64, coretexa8hf-neon, i586, mips3242,
+ mips64, or ppc7400.
+
+ <replaceable>release</replaceable> is the version of Yocto Project.
+
+ NOTE:
+ The standard SDK installer does not have the "-ext" string as
+ part of the filename.
+
+ </literallayout>
+ The toolchains provided by the Yocto Project are based off of
+ the <filename>core-image-sato</filename> and
+ <filename>core-image-minimal</filename> images and contain
+ libraries appropriate for developing against those images.
+ </para>
+
+ <para>For example, if your host development system is a
+ 64-bit x86 system and you are need an extended SDK for a
+ 64-bit core2 target, go into the <filename>x86_64</filename>
+ folder and download the following installer:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Run the Installer:</emphasis>
+ Be sure you have execution privileges and run the installer.
+ Following is an example from the <filename>Downloads</filename>
+ directory:
+ <literallayout class='monospaced'>
+ $ ~/Downloads/poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
+ </literallayout>
+ During execution of the script, you choose the root location
+ for the toolchain.
+ See the
+ "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
+ section and the
+ "<link linkend='sdk-installed-extensible-sdk-directory-structure'>Installed Extensible SDK Directory Structure</link>"
+ section for more information.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='sdk-building-an-sdk-installer'>
+ <title>Building an SDK Installer</title>
+
+ <para>
+ As an alternative to locating and downloading a SDK installer,
+ you can build the SDK installer.
+ Follow these steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Set Up the Build Environment:</emphasis>
+ Be sure you are set up to use BitBake in a shell.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</ulink>"
+ section in the Yocto Project Development Tasks Manual for
+ information on how to get a build host ready that is either a
+ native Linux machine or a machine that uses CROPS.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Clone the <filename>poky</filename> Repository:</emphasis>
+ You need to have a local copy of the Yocto Project
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (i.e. a local <filename>poky</filename> repository).
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#cloning-the-poky-repository'>Cloning the <filename>poky</filename> Repository</ulink>"
+ and possibly the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checking-out-by-branch-in-poky'>Checking Out by Branch in Poky</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#checkout-out-by-tag-in-poky'>Checking Out by Tag in Poky</ulink>"
+ sections all in the Yocto Project Development Tasks Manual for
+ information on how to clone the <filename>poky</filename>
+ repository and check out the appropriate branch for your work.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Initialize the Build Environment:</emphasis>
+ While in the root directory of the Source Directory (i.e.
+ <filename>poky</filename>), run the
+ <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>&OE_INIT_FILE;</filename></ulink>
+ environment setup script to define the OpenEmbedded
+ build environment on your build host.
+ <literallayout class='monospaced'>
+ $ source &OE_INIT_FILE;
+ </literallayout>
+ Among other things, the script creates the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ which is <filename>build</filename> in this case
+ and is located in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>.
+ After the script runs, your current working directory
+ is set to the <filename>build</filename> directory.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Sure You Are Building an Installer for the Correct Machine:</emphasis>
+ Check to be sure that your
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
+ variable in the <filename>local.conf</filename> file in your
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ matches the architecture for which you are building.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make Sure Your SDK Machine is Correctly Set:</emphasis>
+ If you are building a toolchain designed to run on an
+ architecture that differs from your current development host
+ machine (i.e. the build machine), be sure that the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>
+ variable in the <filename>local.conf</filename> file in your
+ Build Directory is correctly set.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the SDK Installer:</emphasis>
+ To build the SDK installer for a standard SDK and populate
+ the SDK image, use the following command form.
+ Be sure to replace <replaceable>image</replaceable> with
+ an image (e.g. "core-image-sato"):
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c populate_sdk
+ </literallayout>
+ You can do the same for the extensible SDK using this command
+ form:
+ <literallayout class='monospaced'>
+ $ bitbake <replaceable>image</replaceable> -c populate_sdk_ext
+ </literallayout>
+ These commands result in a SDK installer that contains the
+ sysroot that matches your target root filesystem.</para>
+
+ <para>When the <filename>bitbake</filename> command completes,
+ the SDK installer will be in
+ <filename>tmp/deploy/sdk</filename> in the Build Directory.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ By default, this toolchain does not build static
+ binaries.
+ If you want to use the toolchain to build these
+ types of libraries, you need to be sure your SDK
+ has the appropriate static development libraries.
+ Use the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-TOOLCHAIN_TARGET_TASK'><filename>TOOLCHAIN_TARGET_TASK</filename></ulink>
+ variable inside your <filename>local.conf</filename>
+ file to install the appropriate library packages
+ in the SDK.
+ Following is an example using
+ <filename>libc</filename> static development
+ libraries:
+ <literallayout class='monospaced'>
+ TOOLCHAIN_TARGET_TASK_append = " libc-staticdev"
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ For additional information on building the
+ installer, see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an <trademark class='trade'>Eclipse</trademark> Debug Capable Image</ulink>
+ wiki page.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Run the Installer:</emphasis>
+ You can now run the SDK installer from
+ <filename>tmp/deploy/sdk</filename> in the Build Directory.
+ Following is an example:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build/tmp/deploy/sdk
+ $ ./poky-glibc-x86_64-core-image-sato-core2-64-toolchain-ext-&DISTRO;.sh
+ </literallayout>
+ During execution of the script, you choose the root location
+ for the toolchain.
+ See the
+ "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
+ section and the
+ "<link linkend='sdk-installed-extensible-sdk-directory-structure'>Installed Extensible SDK Directory Structure</link>"
+ section for more information.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='sdk-extracting-the-root-filesystem'>
+ <title>Extracting the Root Filesystem</title>
+
+ <para>
+ After installing the toolchain, for some use cases you
+ might need to separately extract a root filesystem:
+ <itemizedlist>
+ <listitem><para>
+ You want to boot the image using NFS.
+ </para></listitem>
+ <listitem><para>
+ You want to use the root filesystem as the
+ target sysroot.
+ For example, the Eclipse IDE environment with the Eclipse
+ Yocto Plug-in installed allows you to use QEMU to boot
+ under NFS.
+ </para></listitem>
+ <listitem><para>
+ You want to develop your target application
+ using the root filesystem as the target sysroot.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Follow these steps to extract the root filesystem:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Locate and Download the Tarball for the Pre-Built
+ Root Filesystem Image File:</emphasis>
+ You need to find and download the root filesystem image
+ file that is appropriate for your target system.
+ These files are kept in the
+ <ulink url='&YOCTO_DL_URL;/releases/yocto/yocto-&DISTRO;/machines/'>Index of Releases</ulink>
+ in the "machines" directory.</para>
+
+ <para>The "machines" directory contains tarballs
+ (<filename>*.tar.bz2</filename>) for supported machines.
+ The directory also contains flattened root filesystem
+ image files (<filename>*.ext4</filename>), which you can use
+ with QEMU directly.</para>
+
+ <para>The pre-built root filesystem image files
+ follow these naming conventions:
+ <literallayout class='monospaced'>
+ core-image-<replaceable>profile</replaceable>-<replaceable>arch</replaceable>.tar.bz2
+
+ Where:
+ <replaceable>profile</replaceable> is the filesystem image's profile:
+ lsb, lsb-dev, lsb-sdk, lsb-qt3, minimal, minimal-dev, sato,
+ sato-dev, sato-sdk, minimal-initramfs, or sdk-ptest. For
+ information on these types of image profiles, see the
+ "Images" chapter in the Yocto Project Reference Manual.
+
+ <replaceable>arch</replaceable> is a string representing the target architecture:
+ beaglebone, edgerouter, genericx86, genericx86-64, mpc8315e-rdb,
+ qemuarm, qemuarm64, qemumips, qemumips64, qemuppc, qemux86, or
+ qemux86-64.
+
+ </literallayout>
+ The root filesystems provided by the Yocto Project are based
+ off of the <filename>core-image-sato</filename> and
+ <filename>core-image-minimal</filename> images.
+ </para>
+
+ <para>For example, if your target hardware system is a
+ BeagleBone board and your image is a
+ <filename>core-image-minimal</filename> image, you need
+ to download the following root filesystem image file:
+ <literallayout class='monospaced'>
+ core-image-minimal-beaglebone.tar.bz2
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Initialize the Cross-Development Environment:</emphasis>
+ You must <filename>source</filename>
+ the cross-development environment setup script to establish
+ necessary environment variables.</para>
+
+ <para>This script is located in the top-level directory in
+ which you installed the toolchain (e.g.
+ <filename>poky_sdk</filename>).</para>
+
+ <para>Following is an example for the Core2 64-bit
+ architecture:
+ <literallayout class='monospaced'>
+ $ source ~/poky_sdk/environment-setup-core2-64-poky-linux
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Extract the Root Filesystem:</emphasis>
+ Use the <filename>runqemu-extract-sdk</filename> command
+ and provide the root filesystem image.</para>
+
+ <para>Following is an example command that extracts the root
+ filesystem from a previously built root filesystem image that
+ was downloaded from the
+ <ulink url='&YOCTO_DOCS_OM_URL;#index-downloads'>Index of Releases</ulink>.
+ This command extracts the root filesystem into the
+ <filename>core2-64-sato</filename> directory:
+ <literallayout class='monospaced'>
+ $ runqemu-extract-sdk ~/Downloads/core-image-sato-core2-64.tar.bz2 ~/core2-64-sato
+ </literallayout>
+ You could now point to the target sysroot at
+ <filename>core2-64-sato</filename>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+</section>
+
+<section id='sdk-installed-standard-sdk-directory-structure'>
+ <title>Installed Standard SDK Directory Structure</title>
+
+ <para>
+ The following figure shows the resulting directory structure after
+ you install the Standard SDK by running the <filename>*.sh</filename>
+ SDK installation script:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-installed-standard-sdk-directory.png" scale="60" align="center" />
+ </para>
+
+ <para>
+ The installed SDK consists of an environment setup script for the SDK,
+ a configuration file for the target, a version file for the target,
+ and the root filesystem (<filename>sysroots</filename>) needed to
+ develop objects for the target system.
+ </para>
+
+ <para>
+ Within the figure, italicized text is used to indicate replaceable
+ portions of the file or directory name.
+ For example,
+ <replaceable>install_dir</replaceable>/<replaceable>version</replaceable>
+ is the directory where the SDK is installed.
+ By default, this directory is <filename>/opt/poky/</filename>.
+ And, <replaceable>version</replaceable> represents the specific
+ snapshot of the SDK (e.g. <filename>&DISTRO;</filename>).
+ Furthermore, <replaceable>target</replaceable> represents the target
+ architecture (e.g. <filename>i586</filename>) and
+ <replaceable>host</replaceable> represents the development system's
+ architecture (e.g. <filename>x86_64</filename>).
+ Thus, the complete names of the two directories within the
+ <filename>sysroots</filename> could be
+ <filename>i586-poky-linux</filename> and
+ <filename>x86_64-pokysdk-linux</filename> for the target and host,
+ respectively.
+ </para>
+</section>
+
+<section id='sdk-installed-extensible-sdk-directory-structure'>
+ <title>Installed Extensible SDK Directory Structure</title>
+
+ <para>
+ The following figure shows the resulting directory structure after
+ you install the Extensible SDK by running the <filename>*.sh</filename>
+ SDK installation script:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-installed-extensible-sdk-directory.png" scale="60" align="center" />
+ </para>
+
+ <para>
+ The installed directory structure for the extensible SDK is quite
+ different than the installed structure for the standard SDK.
+ The extensible SDK does not separate host and target parts in the
+ same manner as does the standard SDK.
+ The extensible SDK uses an embedded copy of the OpenEmbedded
+ build system, which has its own sysroots.
+ </para>
+
+ <para>
+ Of note in the directory structure are an environment setup script
+ for the SDK, a configuration file for the target, a version file for
+ the target, and a log file for the OpenEmbedded build system
+ preparation script run by the installer.
+ </para>
+
+ <para>
+ Within the figure, italicized text is used to indicate replaceable
+ portions of the file or directory name.
+ For example,
+ <replaceable>install_dir</replaceable> is the directory where the SDK
+ is installed, which is <filename>poky_sdk</filename> by default.
+ <replaceable>target</replaceable> represents the target
+ architecture (e.g. <filename>i586</filename>) and
+ <replaceable>host</replaceable> represents the development system's
+ architecture (e.g. <filename>x86_64</filename>).
+ </para>
+</section>
+
+</appendix>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-eclipse-project.xml b/poky/documentation/sdk-manual/sdk-eclipse-project.xml
new file mode 100644
index 000000000..3eb85e8ab
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-eclipse-project.xml
@@ -0,0 +1,1219 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='sdk-eclipse-project'>
+
+ <title>Developing Applications Using <trademark class='trade'>Eclipse</trademark></title>
+
+ <para>
+ If you are familiar with the popular Eclipse IDE, you can use an
+ Eclipse Yocto Plug-in to allow you to develop, deploy, and test your
+ application all from within Eclipse.
+ This chapter describes general workflow using the SDK and Eclipse
+ and how to configure and set up Eclipse.
+ </para>
+
+ <section id='workflow-using-eclipse'>
+ <title>Workflow Using <trademark class='trade'>Eclipse</trademark></title>
+
+ <para>
+ The following figure and supporting list summarize the
+ general workflow for application development that uses the
+ SDK within the Eclipse IDE.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-eclipse-dev-flow.png"
+ width="7in" depth="7in" align="center" scale="100" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Prepare the Host System for the Yocto Project</emphasis>:
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>"
+ and
+ "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>"
+ sections both in the Yocto Project Reference Manual for
+ requirements.
+ In particular, be sure your host system has the
+ <filename>xterm</filename> package installed.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Secure the Yocto Project Kernel Target
+ Image</emphasis>:
+ You must have a target kernel image that has been built
+ using the OpenEmbedded build system.</para>
+ <para>Depending on whether the Yocto Project has a
+ pre-built image that matches your target architecture
+ and where you are going to run the image while you
+ develop your application (QEMU or real hardware), the
+ area from which you get the image differs.
+ <itemizedlist>
+ <listitem><para>
+ Download the image from
+ <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink>
+ if your target architecture is supported and
+ you are going to develop and test your
+ application on actual hardware.
+ </para></listitem>
+ <listitem><para>
+ Download the image from
+ <ulink url='&YOCTO_QEMU_DL_URL;'>
+ <filename>machines/qemu</filename></ulink> if
+ your target architecture is supported and you
+ are going to develop and test your application
+ using the
+ <ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>QEMU Emulator</ulink>.
+ </para></listitem>
+ <listitem><para>
+ Build your image if you cannot find a pre-built
+ image that matches your target architecture.
+ If your target architecture is similar to a
+ supported architecture, you can modify the
+ kernel image before you build it.
+ See the
+ "<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</ulink>"
+ section in the Yocto Project Linux Kernel
+ Development Manual for an example.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem>
+ <para><emphasis>Install the SDK</emphasis>:
+ The SDK provides a target-specific cross-development
+ toolchain, the root filesystem, the QEMU emulator, and
+ other tools that can help you develop your application.
+ For information on how to install the SDK, see the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Secure the Target Root Filesystem
+ and the Cross-Development Toolchain</emphasis>:
+ You need to find and download the appropriate root
+ filesystem and the cross-development toolchain.</para>
+ <para>You can find the tarballs for the root filesystem
+ in the same area used for the kernel image.
+ Depending on the type of image you are running, the
+ root filesystem you need differs.
+ For example, if you are developing an application that
+ runs on an image that supports Sato, you need to get a
+ root filesystem that supports Sato.</para>
+ <para>You can find the cross-development toolchains at
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'><filename>toolchains</filename></ulink>.
+ Be sure to get the correct toolchain for your
+ development host and your target architecture.
+ See the "<link linkend='sdk-locating-pre-built-sdk-installers'>Locating Pre-Built SDK Installers</link>"
+ section for information and the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section for installation information.
+ <note>
+ As an alternative to downloading an SDK, you can
+ build the SDK installer.
+ For information on building the installer, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ Another helpful resource for building an installer
+ is the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>"
+ wiki page.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create and Build Your Application</emphasis>:
+ At this point, you need to have source files for your
+ application.
+ Once you have the files, you can use the Eclipse IDE
+ to import them and build the project.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Deploy the Image With the Application</emphasis>:
+ Using the Eclipse IDE, you can deploy your image to the
+ hardware or to QEMU through the project's preferences.
+ You can also use Eclipse to load and test your image
+ under QEMU.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Tasks Manual
+ for information on using QEMU.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Test and Debug the Application</emphasis>:
+ Once your application is deployed, you need to test it.
+ Within the Eclipse IDE, you can use the debugging
+ environment along with supported performance enhancing
+ <ulink url='http://www.eclipse.org/linuxtools/'>Linux Tools</ulink>.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='adt-eclipse'>
+ <title>Working Within Eclipse</title>
+
+ <para>
+ The Eclipse IDE is a popular development environment and it
+ fully supports development using the Yocto Project.
+ </para>
+
+ <para>
+ When you install and configure the Eclipse Yocto Project
+ Plug-in into the Eclipse IDE, you maximize your Yocto
+ Project experience.
+ Installing and configuring the Plug-in results in an
+ environment that has extensions specifically designed to let
+ you more easily develop software.
+ These extensions allow for cross-compilation, deployment, and
+ execution of your output into a QEMU emulation session as well
+ as actual target hardware.
+ You can also perform cross-debugging and profiling.
+ The environment also supports performance enhancing
+ <ulink url='http://www.eclipse.org/linuxtools/'>tools</ulink>
+ that allow you to perform remote profiling, tracing,
+ collection of power data, collection of latency data, and
+ collection of performance data.
+ <note>
+ This release of the Yocto Project supports both the Oxygen
+ and Neon versions of the Eclipse IDE.
+ This section provides information on how to use the Oxygen
+ release with the Yocto Project.
+ For information on how to use the Neon version of Eclipse
+ with the Yocto Project, see
+ "<link linkend='sdk-appendix-neon-yp-eclipse-plug-in'>Appendix D</link>".
+ </note>
+ </para>
+
+ <section id='oxygen-setting-up-the-eclipse-ide'>
+ <title>Setting Up the Oxygen Version of the Eclipse IDE</title>
+
+ <para>
+ To develop within the Eclipse IDE, you need to do the
+ following:
+ <orderedlist>
+ <listitem><para>
+ Install the Oxygen version of the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>
+ Configure the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>
+ Install the Eclipse Yocto Plug-in.
+ </para></listitem>
+ <listitem><para>
+ Configure the Eclipse Yocto Plug-in.
+ </para></listitem>
+ </orderedlist>
+ <note>
+ Do not install Eclipse from your distribution's package
+ repository.
+ Be sure to install Eclipse from the official Eclipse
+ download site as directed in the next section.
+ </note>
+ </para>
+
+ <section id='oxygen-installing-eclipse-ide'>
+ <title>Installing the Oxygen Eclipse IDE</title>
+
+ <para>
+ Follow these steps to locate, install, and configure
+ Oxygen Eclipse:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Locate the Oxygen Download:</emphasis>
+ Open a browser and go to
+ <ulink url='http://www.eclipse.org/oxygen/'>http://www.eclipse.org/oxygen/</ulink>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download the Tarball:</emphasis>
+ Click through the "Download" buttons to
+ download the file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Unpack the Tarball:</emphasis>
+ Move to a clean directory and unpack the
+ tarball.
+ Here is an example:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ tar -xzvf ~/Downloads/eclipse-inst-linux64.tar.gz
+ </literallayout>
+ Everything unpacks into a folder named
+ "eclipse-installer".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Launch the Installer:</emphasis>
+ Use the following commands to launch the
+ installer:
+ <literallayout class='monospaced'>
+ $ cd ~/eclipse-installer
+ $ ./eclipse-inst
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select Your IDE:</emphasis>
+ From the list, select the "Eclipse IDE for
+ C/C++ Developers".
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Install the Software:</emphasis>
+ Click "Install" to begin the installation.
+ Accept all the certificates and any license
+ agreements.
+ Click "Install" again to finish the installation.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Launch Oxygen:</emphasis>
+ Accept the default "workspace" and click the
+ "Launch" button.
+ You should see the Eclipse welcome page from which
+ can click "workbench" to enter your workspace.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-configuring-the-eclipse-ide'>
+ <title>Configuring the Oxygen Eclipse IDE</title>
+
+ <para>
+ Follow these steps to configure the Oxygen Eclipse IDE.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ Depending on how you installed Eclipse and what
+ you have already done, some of the options will
+ not appear.
+ If you cannot find an option as directed by the
+ manual, it has already been installed.
+ </para></listitem>
+ <listitem><para>
+ If you want to see all items regardless of
+ whether they are installed or not, deselect the
+ "Hide items that are already installed"
+ check box.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ <orderedlist>
+ <listitem><para>
+ Be sure Eclipse is running and you are in your
+ workbench.
+ Just click "workbench" if you are not in your
+ default workspace.
+ </para></listitem>
+ <listitem><para>
+ Select "Install New Software" from the "Help"
+ pull-down menu.
+ </para></listitem>
+ <listitem><para>
+ Select
+ "Oxygen - http://download.eclipse.org/releases/oxygen"
+ from the "Work with:" pull-down menu.
+ </para></listitem>
+ <listitem><para>
+ Expand the box next to "Linux Tools" and select
+ the following:
+ <literallayout class='monospaced'>
+ C/C++ Remote (Over TCF/TE) Run/Debug Launcher
+ TM Terminal
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Expand the box next to "Mobile and Device
+ Development" and select the following
+ boxes:
+ <literallayout class='monospaced'>
+ C/C++ Remote (Over TCF/TE) Run/Debug Launcher
+ Remote System Explorer User Actions
+ TM Terminal
+ TCF Remote System Explorer add-in
+ TCF Target Explorer
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Expand the box next to "Programming Languages"
+ and select the following box:
+ <literallayout class='monospaced'>
+ C/C++ Development Tools SDK
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Complete the installation by clicking through
+ appropriate "Next" and "Finish" buttons and then
+ restart the Eclipse IDE.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-installing-the-eclipse-yocto-plug-in'>
+ <title>Installing or Accessing the Oxygen Eclipse Yocto Plug-in</title>
+
+ <para>
+ You can install the Eclipse Yocto Plug-in into the
+ Eclipse IDE one of two ways: use the Yocto Project's
+ Eclipse Update site to install the pre-built plug-in,
+ or build and install the plug-in from the latest
+ source code.
+ </para>
+
+ <section id='oxygen-new-software'>
+ <title>Installing the Pre-built Plug-in from the Yocto Project Eclipse Update Site</title>
+
+ <para>
+ To install the Oxygen Eclipse Yocto Plug-in from the
+ update site, follow these steps:
+ <orderedlist>
+ <listitem><para>
+ Start up the Eclipse IDE.
+ </para></listitem>
+ <listitem><para>
+ In Eclipse, select "Install New
+ Software" from the "Help" menu.
+ </para></listitem>
+ <listitem><para>
+ Click "Add..." in the "Work with:" area.
+ </para></listitem>
+ <listitem><para>
+ Enter
+ <filename>&ECLIPSE_DL_PLUGIN_URL;/oxygen</filename>
+ in the URL field and provide a meaningful
+ name in the "Name" field.
+ </para></listitem>
+ <listitem><para>
+ Click "OK" to have the entry automatically
+ populate the "Work with:" field and to have
+ the items for installation appear in the window
+ below.
+ </para></listitem>
+ <listitem><para>
+ Check the boxes next to the following:
+ <literallayout class='monospaced'>
+ Yocto Project SDK Plug-in
+ Yocto Project Documentation plug-in
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Complete the remaining software
+ installation steps and then restart the
+ Eclipse IDE to finish the installation of
+ the plug-in.
+ <note>
+ You can click "OK" when prompted about
+ installing software that contains
+ unsigned content.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-zip-file-method'>
+ <title>Installing the Plug-in Using the Latest Source Code</title>
+
+ <para>
+ To install the Oxygen Eclipse Yocto Plug-in from the
+ latest source code, follow these steps:
+ <orderedlist>
+ <listitem><para>
+ Be sure your build host has JDK version 1.8
+ or greater.
+ On a Linux build host you can determine the
+ version using the following command:
+ <literallayout class='monospaced'>
+ $ java -version
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Install X11-related packages:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install xauth
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ In a new terminal shell, create a
+ Git repository with:
+ <literallayout class='monospaced'>
+ $ cd ~
+ $ git clone git://git.yoctoproject.org/eclipse-yocto
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Use Git to create the correct tag:
+ <literallayout class='monospaced'>
+ $ cd ~/eclipse-yocto
+ $ git checkout -b oxygen/&DISTRO_NAME_NO_CAP; remotes/origin/oxygen/&DISTRO_NAME_NO_CAP;
+ </literallayout>
+ This creates a local tag named
+ <filename>oxygen/&DISTRO_NAME_NO_CAP;</filename>
+ based on the branch
+ <filename>origin/oxygen/&DISTRO_NAME_NO_CAP;</filename>.
+ You are put into a detached HEAD state,
+ which is fine since you are only going to
+ be building and not developing.
+ </para></listitem>
+ <listitem><para>
+ Change to the <filename>scripts</filename>
+ directory within the Git repository:
+ <literallayout class='monospaced'>
+ $ cd scripts
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Set up the local build environment
+ by running the setup script:
+ <literallayout class='monospaced'>
+ $ ./setup.sh
+ </literallayout>
+ When the script finishes execution,
+ it prompts you with instructions on how to
+ run the <filename>build.sh</filename>
+ script, which is also in the
+ <filename>scripts</filename> directory of
+ the Git repository created earlier.
+ </para></listitem>
+ <listitem><para>
+ Run the <filename>build.sh</filename>
+ script as directed.
+ Be sure to provide the tag name,
+ documentation branch, and a release name.
+ </para>
+ <para>
+ Following is an example:
+ <literallayout class='monospaced'>
+ $ ECLIPSE_HOME=/home/scottrif/eclipse-yocto/scripts/eclipse ./build.sh -l oxygen/&DISTRO_NAME_NO_CAP; master yocto-&DISTRO; 2>&amp;1 | tee build.log
+ </literallayout>
+ The previous example command adds the tag
+ you need for
+ <filename>oxygen/&DISTRO_NAME_NO_CAP;</filename>
+ to <filename>HEAD</filename>, then tells
+ the build script to use the local (-l) Git
+ checkout for the build.
+ After running the script, the file
+ <filename>org.yocto.sdk-</filename><replaceable>release</replaceable><filename>-</filename><replaceable>date</replaceable><filename>-archive.zip</filename>
+ is in the current directory.
+ </para></listitem>
+ <listitem><para>
+ If necessary, start the Eclipse IDE
+ and be sure you are in the Workbench.
+ </para></listitem>
+ <listitem><para>
+ Select "Install New Software" from
+ the "Help" pull-down menu.
+ </para></listitem>
+ <listitem><para>
+ Click "Add".
+ </para></listitem>
+ <listitem><para>
+ Provide anything you want in the
+ "Name" field.
+ </para></listitem>
+ <listitem><para>
+ Click "Archive" and browse to the
+ ZIP file you built earlier.
+ This ZIP file should not be "unzipped", and
+ must be the
+ <filename>*archive.zip</filename> file
+ created by running the
+ <filename>build.sh</filename> script.
+ </para></listitem>
+ <listitem><para>
+ Click the "OK" button.
+ </para></listitem>
+ <listitem><para>
+ Check the boxes that appear in
+ the installation window to install the
+ following:
+ <literallayout class='monospaced'>
+ Yocto Project SDK Plug-in
+ Yocto Project Documentation plug-in
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Finish the installation by clicking
+ through the appropriate buttons.
+ You can click "OK" when prompted about
+ installing software that contains unsigned
+ content.
+ </para></listitem>
+ <listitem><para>
+ Restart the Eclipse IDE if necessary.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ At this point you should be able to configure the
+ Eclipse Yocto Plug-in as described in the
+ "<link linkend='oxygen-configuring-the-eclipse-yocto-plug-in'>Configuring the Oxygen Eclipse Yocto Plug-in</link>"
+ section.
+ </para>
+ </section>
+ </section>
+
+ <section id='oxygen-configuring-the-eclipse-yocto-plug-in'>
+ <title>Configuring the Oxygen Eclipse Yocto Plug-in</title>
+
+ <para>
+ Configuring the Oxygen Eclipse Yocto Plug-in involves
+ setting the Cross Compiler options and the Target
+ options.
+ The configurations you choose become the default
+ settings for all projects.
+ You do have opportunities to change them later when
+ you configure the project (see the following section).
+ </para>
+
+ <para>
+ To start, you need to do the following from within the
+ Eclipse IDE:
+ <orderedlist>
+ <listitem><para>
+ Choose "Preferences" from the "Window" menu to
+ display the Preferences Dialog.
+ </para></listitem>
+ <listitem><para>
+ Click "Yocto Project SDK" to display
+ the configuration screen.
+ </para></listitem>
+ </orderedlist>
+ The following sub-sections describe how to configure
+ the plug-in.
+ <note>
+ Throughout the descriptions, a start-to-finish
+ example for preparing a QEMU image for use with
+ Eclipse is referenced as the "wiki" and is linked
+ to the example on the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'> Cookbook guide to Making an Eclipse Debug Capable Image</ulink>"
+ wiki page.
+ </note>
+ </para>
+
+ <section id='oxygen-configuring-the-cross-compiler-options'>
+ <title>Configuring the Cross-Compiler Options</title>
+
+ <para>
+ Cross Compiler options enable Eclipse to use your
+ specific cross compiler toolchain.
+ To configure these options, you must select
+ the type of toolchain, point to the toolchain,
+ specify the sysroot location, and select the target
+ architecture.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Selecting the Toolchain
+ Type:</emphasis>
+ Choose between
+ <filename>Standalone pre-built toolchain</filename>
+ and
+ <filename>Build system derived toolchain</filename>
+ for Cross Compiler Options.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>
+ <filename>Standalone Pre-built Toolchain:</filename>
+ </emphasis>
+ Select this type when you are using
+ a stand-alone cross-toolchain.
+ For example, suppose you are an
+ application developer and do not
+ need to build a target image.
+ Instead, you just want to use an
+ architecture-specific toolchain on
+ an existing kernel and target root
+ filesystem.
+ In other words, you have downloaded
+ and installed a pre-built toolchain
+ for an existing image.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>
+ <filename>Build System Derived Toolchain:</filename>
+ </emphasis>
+ Select this type if you built the
+ toolchain as part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ When you select
+ <filename>Build system derived toolchain</filename>,
+ you are using the toolchain built
+ and bundled inside the Build
+ Directory.
+ For example, suppose you created a
+ suitable image using the steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ In this situation, you would select
+ the
+ <filename>Build system derived toolchain</filename>.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Specify the Toolchain Root
+ Location:</emphasis>
+ If you are using a stand-alone pre-built
+ toolchain, you should be pointing to where
+ it is installed (e.g.
+ <filename>/opt/poky/&DISTRO;</filename>).
+ See the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section for information about how the SDK is
+ installed.</para>
+ <para>If you are using a build system
+ derived toolchain, the path you provide for
+ the
+ <filename>Toolchain Root Location</filename>
+ field is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ from which you run the
+ <filename>bitbake</filename> command (e.g
+ <filename>/home/scottrif/poky/build</filename>).
+ </para>
+ <para>For more information, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Specify Sysroot Location:
+ </emphasis>
+ This location is where the root filesystem
+ for the target hardware resides.
+ </para>
+ <para>This location depends on where you
+ separately extracted and installed the
+ target filesystem when you either built
+ it or downloaded it.
+ <note>
+ If you downloaded the root filesystem
+ for the target hardware rather than
+ built it, you must download the
+ <filename>sato-sdk</filename> image
+ in order to build any c/c++ projects.
+ </note>
+ As an example, suppose you prepared an
+ image using the steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ If so, the
+ <filename>MY_QEMU_ROOTFS</filename>
+ directory is found in the Build Directory
+ and you would browse to and select that
+ directory (e.g.
+ <filename>/home/scottrif/poky/build/MY_QEMU_ROOTFS</filename>).
+ </para>
+ <para>For more information on how to
+ install the toolchain and on how to extract
+ and install the sysroot filesystem, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Select the Target Architecture:
+ </emphasis>
+ The target architecture is the type of
+ hardware you are going to use or emulate.
+ Use the pull-down
+ <filename>Target Architecture</filename>
+ menu to make your selection.
+ The pull-down menu should have the
+ supported architectures.
+ If the architecture you need is not listed
+ in the menu, you will need to build the
+ image.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-building-a-simple-image'>Building a Simple Image</ulink>"
+ section of the Yocto Project Development Tasks
+ Manual for more information.
+ You can also see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-configuring-the-target-options'>
+ <title>Configuring the Target Options</title>
+
+ <para>
+ You can choose to emulate hardware using the QEMU
+ emulator, or you can choose to run your image on
+ actual hardware.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>QEMU:</emphasis>
+ Select this option if you will be using the
+ QEMU emulator.
+ If you are using the emulator, you also
+ need to locate the kernel and specify any
+ custom options.</para>
+ <para>If you selected the
+ <filename>Build system derived toolchain</filename>,
+ the target kernel you built will be located
+ in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ in
+ <filename>tmp/deploy/images/<replaceable>machine</replaceable></filename>
+ directory.
+ As an example, suppose you performed the
+ steps in the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>wiki</ulink>.
+ In this case, you specify your Build
+ Directory path followed by the image (e.g.
+ <filename>/home/scottrif/poky/build/tmp/deploy/images/qemux86/bzImage-qemux86.bin</filename>).
+ </para>
+ <para>If you selected the standalone
+ pre-built toolchain, the pre-built image
+ you downloaded is located in the directory
+ you specified when you downloaded the
+ image.</para>
+ <para>Most custom options are for advanced
+ QEMU users to further customize their QEMU
+ instance.
+ These options are specified between paired
+ angled brackets.
+ Some options must be specified outside the
+ brackets.
+ In particular, the options
+ <filename>serial</filename>,
+ <filename>nographic</filename>, and
+ <filename>kvm</filename> must all be
+ outside the brackets.
+ Use the <filename>man qemu</filename>
+ command to get help on all the options and
+ their use.
+ The following is an example:
+ <literallayout class='monospaced'>
+ serial ‘&lt;-m 256 -full-screen&gt;’
+ </literallayout></para>
+ <para>
+ Regardless of the mode, Sysroot is already
+ defined as part of the Cross-Compiler
+ Options configuration in the
+ <filename>Sysroot Location:</filename>
+ field.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>External HW:</emphasis>
+ Select this option if you will be using
+ actual hardware.</para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Click "Apply and Close" to save your plug-in
+ configurations.
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='oxygen-creating-the-project'>
+ <title>Creating the Project</title>
+
+ <para>
+ You can create two types of projects: Autotools-based, or
+ Makefile-based.
+ This section describes how to create Autotools-based
+ projects from within the Eclipse IDE.
+ For information on creating Makefile-based projects in a
+ terminal window, see the
+ "<link linkend='makefile-based-projects'>Makefile-Based Projects</link>"
+ section.
+ <note>
+ Do not use special characters in project names
+ (e.g. spaces, underscores, etc.). Doing so can
+ cause configuration to fail.
+ </note>
+ </para>
+
+ <para>
+ To create a project based on a Yocto template and then
+ display the source code, follow these steps:
+ <orderedlist>
+ <listitem><para>
+ Select "C/C++ Project" from the "File -> New" menu.
+ </para></listitem>
+ <listitem><para>
+ Select "C Managed Build" from the available options and
+ click "Next".
+ </para></listitem>
+ <listitem><para>
+ Expand "Yocto Project SDK Autotools Project".
+ </para></listitem>
+ <listitem><para>
+ Select "Hello World ANSI C Autotools Projects".
+ This is an Autotools-based project based on a Yocto
+ template.
+ </para></listitem>
+ <listitem><para>
+ Put a name in the "Project name:" field.
+ Do not use hyphens as part of the name
+ (e.g. <filename>hello</filename>).
+ </para></listitem>
+ <listitem><para>
+ Click "Next".
+ </para></listitem>
+ <listitem><para>
+ Add appropriate information in the various fields.
+ </para></listitem>
+ <listitem><para>
+ Click "Finish".
+ </para></listitem>
+ <listitem><para>
+ If the "open perspective" prompt appears,
+ click "Yes" so that you in the C/C++ perspective.
+ </para></listitem>
+ <listitem><para>The left-hand navigation pane shows
+ your project.
+ You can display your source by double clicking the
+ project's source file.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-configuring-the-cross-toolchains'>
+ <title>Configuring the Cross-Toolchains</title>
+
+ <para>
+ The earlier section,
+ "<link linkend='oxygen-configuring-the-eclipse-yocto-plug-in'>Configuring the Oxygen Eclipse Yocto Plug-in</link>",
+ sets up the default project configurations.
+ You can override these settings for a given project by
+ following these steps:
+ <orderedlist>
+ <listitem><para>
+ Select "Yocto Project Settings" from
+ the "Project -> Properties" menu.
+ This selection brings up the Yocto Project Settings
+ Dialog and allows you to make changes specific to
+ an individual project.</para>
+ <para>By default, the Cross Compiler Options and
+ Target Options for a project are inherited from
+ settings you provided using the Preferences Dialog
+ as described earlier in the
+ "<link linkend='oxygen-configuring-the-eclipse-yocto-plug-in'>Configuring the Oxygen Eclipse Yocto Plug-in</link>"
+ section.
+ The Yocto Project Settings Dialog allows you to
+ override those default settings for a given
+ project.
+ </para></listitem>
+ <listitem><para>
+ Make or verify your configurations for the
+ project and click "Apply and Close".
+ </para></listitem>
+ <listitem><para>
+ Right-click in the navigation pane and select
+ "Reconfigure Project" from the pop-up menu.
+ This selection reconfigures the project by running
+ <ulink url='https://en.wikipedia.org/wiki/GNU_Build_System'>Autotools GNU utility programs</ulink>
+ such as Autoconf, Automake, and so forth in the
+ workspace for your project.
+ Click on the "Console" tab beneath your source code
+ to see the results of reconfiguring your project.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-building-the-project'>
+ <title>Building the Project</title>
+ <para>
+ To build the project select "Build All" from the
+ "Project" menu.
+ The console should update and you can note the
+ cross-compiler you are using (i.e.
+ <filename>i586-poky-linux-gcc</filename> in this example).
+ <note>
+ When building "Yocto Project SDK Autotools" projects,
+ the Eclipse IDE might display error messages for
+ Functions/Symbols/Types that cannot be "resolved",
+ even when the related include file is listed at the
+ project navigator and when the project is able to
+ build.
+ For these cases only, it is recommended to add a new
+ linked folder to the appropriate sysroot.
+ Use these steps to add the linked folder:
+ <orderedlist>
+ <listitem><para>
+ Select the project.
+ </para></listitem>
+ <listitem><para>
+ Select "Folder" from the "File -> New" menu.
+ </para></listitem>
+ <listitem><para>
+ In the "New Folder" Dialog, click the "Advanced"
+ button and then activate "Link to
+ alternate location (linked folder)" button.
+ </para></listitem>
+ <listitem><para>
+ Click "Browse" to navigate to the include
+ folder inside the same sysroot location
+ selected in the Yocto Project
+ configuration preferences.
+ </para></listitem>
+ <listitem><para>
+ Click "Finish" to save the linked folder.
+ </para></listitem>
+ </orderedlist>
+ </note>
+ </para>
+ </section>
+
+ <section id='oxygen-starting-qemu-in-user-space-nfs-mode'>
+ <title>Starting QEMU in User-Space NFS Mode</title>
+
+ <para>
+ To start the QEMU emulator from within Eclipse, follow
+ these steps:
+ <note>
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Tasks Manual
+ for more information on using QEMU.
+ </note>
+ <orderedlist>
+ <listitem><para>Expose and select "External Tools
+ Configurations ..." from the "Run -> External
+ Tools" menu.
+ </para></listitem>
+ <listitem><para>
+ Locate and select your image in the navigation
+ panel to the left
+ (e.g. <filename>qemu_i586-poky-linux</filename>).
+ </para></listitem>
+ <listitem><para>
+ Click "Run" to launch QEMU.
+ <note>
+ The host on which you are running QEMU must
+ have the <filename>rpcbind</filename> utility
+ running to be able to make RPC calls on a
+ server on that machine.
+ If QEMU does not invoke and you receive error
+ messages involving
+ <filename>rpcbind</filename>, follow the
+ suggestions to get the service running.
+ As an example, on a new Ubuntu 16.04 LTS
+ installation, you must do the following in a new
+ shell in order to get QEMU to launch:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install rpcbind
+ </literallayout>
+ After installing <filename>rpcbind</filename>,
+ you need to edit the
+ <filename>/etc/init.d/rpcbind</filename> file
+ to include the following line:
+ <literallayout class='monospaced'>
+ OPTIONS="-i -w"
+ </literallayout>
+ After modifying the file, you need to start the
+ service:
+ <literallayout class='monospaced'>
+ $ sudo service portmap restart
+ </literallayout>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ If needed, enter your host root password in
+ the shell window at the prompt.
+ This sets up a <filename>Tap 0</filename>
+ connection needed for running in user-space NFS
+ mode.
+ </para></listitem>
+ <listitem><para>
+ Wait for QEMU to launch.
+ </para></listitem>
+ <listitem><para>
+ Once QEMU launches, you can begin operating
+ within that environment.
+ One useful task at this point would be to determine
+ the IP Address for the user-space NFS by using the
+ <filename>ifconfig</filename> command.
+ The IP address of the QEMU machine appears in the
+ xterm window.
+ You can use this address to help you see which
+ particular
+ IP address the instance of QEMU is using.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-deploying-and-debugging-the-application'>
+ <title>Deploying and Debugging the Application</title>
+
+ <para>
+ Once the QEMU emulator is running the image, you can deploy
+ your application using the Eclipse IDE and then use
+ the emulator to perform debugging.
+ Follow these steps to deploy the application.
+ <note>
+ Currently, Eclipse does not support SSH port
+ forwarding.
+ Consequently, if you need to run or debug a remote
+ application using the host display, you must create a
+ tunneling connection from outside Eclipse and keep
+ that connection alive during your work.
+ For example, in a new terminal, run the following:
+ <literallayout class='monospaced'>
+ $ ssh -XY <replaceable>user_name</replaceable>@<replaceable>remote_host_ip</replaceable>
+ </literallayout>
+ Using the above form, here is an example:
+ <literallayout class='monospaced'>
+ $ ssh -XY root@192.168.7.2
+ </literallayout>
+ After running the command, add the command to be
+ executed in Eclipse's run configuration before the
+ application as follows:
+ <literallayout class='monospaced'>
+ export DISPLAY=:10.0
+ </literallayout>
+ Be sure to not destroy the connection during your QEMU
+ session (i.e. do not
+ exit out of or close that shell).
+ </note>
+ <orderedlist>
+ <listitem><para>
+ Select "Debug Configurations..." from the
+ "Run" menu.
+ </para></listitem>
+ <listitem><para>
+ In the left area, expand
+ <filename>C/C++Remote Application</filename>.
+ </para></listitem>
+ <listitem><para>
+ Locate your project and select it to bring
+ up a new tabbed view in the Debug Configurations
+ Dialog.
+ </para></listitem>
+ <listitem><para>
+ Click on the "Debugger" tab to see the
+ cross-tool debugger you are using.
+ Be sure to change to the debugger perspective in
+ Eclipse.
+ </para></listitem>
+ <listitem><para>
+ Click on the "Main" tab.
+ </para></listitem>
+ <listitem><para>
+ Create a new connection to the QEMU instance
+ by clicking on "new".</para></listitem>
+ <listitem><para>Select <filename>SSH</filename>, which
+ means Secure Socket Shell and then click "OK".
+ Optionally, you can select a TCF connection
+ instead.
+ </para></listitem>
+ <listitem><para>
+ Clear out the "Connection name" field and
+ enter any name you want for the connection.
+ </para></listitem>
+ <listitem><para>
+ Put the IP address for the connection in
+ the "Host" field.
+ For QEMU, the default is
+ <filename>192.168.7.2</filename>.
+ However, if a previous QEMU session did not exit
+ cleanly, the IP address increments (e.g.
+ <filename>192.168.7.3</filename>).
+ <note>
+ You can find the IP address for the current
+ QEMU session by looking in the xterm that
+ opens when you launch QEMU.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Enter <filename>root</filename>, which
+ is the default for QEMU, for the "User" field.
+ Be sure to leave the password field empty.
+ </para></listitem>
+ <listitem><para>
+ Click "Finish" to close the New Connections Dialog.
+ </para></listitem>
+ <listitem><para>
+ If necessary, use the drop-down menu now in the
+ "Connection" field and pick the IP Address you
+ entered.
+ </para></listitem>
+ <listitem><para>
+ Assuming you are connecting as the root
+ user, which is the default for QEMU x86-64 SDK
+ images provided by the Yocto Project, in the
+ "Remote Absolute File Path for C/C++ Application"
+ field, browse to
+ <filename>/home/root/</filename><replaceable>ProjectName</replaceable>
+ (e.g. <filename>/home/root/hello</filename>).
+ You could also browse to any other path you have
+ write access to on the target such as
+ <filename>/usr/bin</filename>.
+ This location is where your application will be
+ located on the QEMU system.
+ If you fail to browse to and specify an appropriate
+ location, QEMU will not understand what to remotely
+ launch.
+ Eclipse is helpful in that it auto fills your
+ application name for you assuming you browsed to a
+ directory.
+ <note><title>Tips</title>
+ <itemizedlist>
+ <listitem><para>
+ If you are prompted to provide a username
+ and to optionally set a password, be sure
+ you provide "root" as the username and you
+ leave the password field blank.
+ </para></listitem>
+ <listitem><para>
+ If browsing to a directory fails or times
+ out, but you can
+ <filename>ssh</filename> into your QEMU
+ or target from the command line and you
+ have proxies set up, it is likely that
+ Eclipse is sending the SSH traffic to a
+ proxy.
+ In this case, either use TCF , or click on
+ "Configure proxy settings" in the
+ connection dialog and add the target IP
+ address to the "bypass proxy" section.
+ You might also need to change
+ "Active Provider" from Native to Manual.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Be sure you change to the "Debug" perspective in
+ Eclipse.
+ </para></listitem>
+ <listitem><para>
+ Click "Debug"
+ </para></listitem>
+ <listitem><para>
+ Accept the debug perspective.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='oxygen-using-Linuxtools'>
+ <title>Using Linuxtools</title>
+
+ <para>
+ As mentioned earlier in the manual, performance tools exist
+ (Linuxtools) that enhance your development experience.
+ These tools are aids in developing and debugging
+ applications and images.
+ You can run these tools from within the Eclipse IDE through
+ the "Linuxtools" menu.
+ </para>
+
+ <para>
+ For information on how to configure and use these tools,
+ see
+ <ulink url='http://www.eclipse.org/linuxtools/'>http://www.eclipse.org/linuxtools/</ulink>.
+ </para>
+ </section>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-extensible.xml b/poky/documentation/sdk-manual/sdk-extensible.xml
new file mode 100644
index 000000000..5215a9d09
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-extensible.xml
@@ -0,0 +1,1785 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='sdk-extensible'>
+
+ <title>Using the Extensible SDK</title>
+
+ <para>
+ This chapter describes the extensible SDK and how to install it.
+ Information covers the pieces of the SDK, how to install it, and
+ presents a look at using the <filename>devtool</filename>
+ functionality.
+ The extensible SDK makes it easy to add new applications and libraries
+ to an image, modify the source for an existing component, test
+ changes on the target hardware, and ease integration into the rest of
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ <note>
+ For a side-by-side comparison of main features supported for an
+ extensible SDK as compared to a standard SDK, see the
+ "<link linkend='sdk-manual-intro'>Introduction</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ In addition to the functionality available through
+ <filename>devtool</filename>, you can alternatively make use of the
+ toolchain directly, for example from Makefile, Autotools, and
+ <trademark class='trade'>Eclipse</trademark>-based projects.
+ See the
+ "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>"
+ chapter for more information.
+ </para>
+
+ <section id='sdk-extensible-sdk-intro'>
+ <title>Why use the Extensible SDK and What is in It?</title>
+
+ <para>
+ The extensible SDK provides a cross-development toolchain and
+ libraries tailored to the contents of a specific image.
+ You would use the Extensible SDK if you want a toolchain experience
+ supplemented with the powerful set of <filename>devtool</filename>
+ commands tailored for the Yocto Project environment.
+ </para>
+
+ <para>
+ The installed extensible SDK consists of several files and
+ directories.
+ Basically, it contains an SDK environment setup script, some
+ configuration files, an internal build system, and the
+ <filename>devtool</filename> functionality.
+ </para>
+ </section>
+
+ <section id='sdk-installing-the-extensible-sdk'>
+ <title>Installing the Extensible SDK</title>
+
+ <para>
+ The first thing you need to do is install the SDK on your
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink>
+ by running the <filename>*.sh</filename> installation script.
+ </para>
+
+ <para>
+ You can download a tarball installer, which includes the
+ pre-built toolchain, the <filename>runqemu</filename>
+ script, the internal build system, <filename>devtool</filename>,
+ and support files from the appropriate
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink>
+ directory within the Index of Releases.
+ Toolchains are available for several 32-bit and 64-bit
+ architectures with the <filename>x86_64</filename> directories,
+ respectively.
+ The toolchains the Yocto Project provides are based off the
+ <filename>core-image-sato</filename> and
+ <filename>core-image-minimal</filename> images and contain
+ libraries appropriate for developing against that image.
+ </para>
+
+ <para>
+ The names of the tarball installer scripts are such that a
+ string representing the host system appears first in the
+ filename and then is immediately followed by a string
+ representing the target architecture.
+ An extensible SDK has the string "-ext" as part of the name.
+ Following is the general form:
+ <literallayout class='monospaced'>
+ poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-ext-<replaceable>release_version</replaceable>.sh
+
+ Where:
+ <replaceable>host_system</replaceable> is a string representing your development system:
+
+ i686 or x86_64.
+
+ <replaceable>image_type</replaceable> is the image for which the SDK was built:
+
+ core-image-sato or core-image-minimal
+
+ <replaceable>arch</replaceable> is a string representing the tuned target architecture:
+
+ aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon
+
+ <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project:
+
+ &DISTRO;, &DISTRO;+snapshot
+ </literallayout>
+ For example, the following SDK installer is for a 64-bit
+ development host system and a i586-tuned target architecture
+ based off the SDK for <filename>core-image-sato</filename> and
+ using the current &DISTRO; snapshot:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-i586-toolchain-ext-&DISTRO;.sh
+ </literallayout>
+ <note>
+ As an alternative to downloading an SDK, you can build the
+ SDK installer.
+ For information on building the installer, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ Another helpful resource for building an installer is the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
+ wiki page.
+ This wiki page focuses on development when using the Eclipse
+ IDE.
+ </note>
+ </para>
+
+ <para>
+ The SDK and toolchains are self-contained and by default are
+ installed into the <filename>poky_sdk</filename> folder in your
+ home directory.
+ You can choose to install the extensible SDK in any location when
+ you run the installer.
+ However, because files need to be written under that directory
+ during the normal course of operation, the location you choose
+ for installation must be writable for whichever
+ users need to use the SDK.
+ </para>
+
+ <para>
+ The following command shows how to run the installer given a
+ toolchain tarball for a 64-bit x86 development host system and
+ a 64-bit x86 target architecture.
+ The example assumes the SDK installer is located in
+ <filename>~/Downloads/</filename> and has execution rights.
+ <note>
+ If you do not have write permissions for the directory
+ into which you are installing the SDK, the installer
+ notifies you and exits.
+ For that case, set up the proper permissions in the directory
+ and run the installer again.
+ </note>
+ <literallayout class='monospaced'>
+ $ ./Downloads/poky-glibc-x86_64-core-image-minimal-core2-64-toolchain-ext-2.5.sh
+ Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.5
+ ==========================================================================
+ Enter target directory for SDK (default: ~/poky_sdk):
+ You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed[Y/n]? Y
+ Extracting SDK..............done
+ Setting it up...
+ Extracting buildtools...
+ Preparing build system...
+ Parsing recipes: 100% |##################################################################| Time: 0:00:52
+ Initialising tasks: 100% |###############################################################| Time: 0:00:00
+ Checking sstate mirror object availability: 100% |#######################################| Time: 0:00:00
+ Loading cache: 100% |####################################################################| Time: 0:00:00
+ Initialising tasks: 100% |###############################################################| Time: 0:00:00
+ done
+ SDK has been successfully set up and is ready to be used.
+ Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
+ $ . /home/scottrif/poky_sdk/environment-setup-core2-64-poky-linux
+
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='sdk-running-the-extensible-sdk-environment-setup-script'>
+ <title>Running the Extensible SDK Environment Setup Script</title>
+
+ <para>
+ Once you have the SDK installed, you must run the SDK environment
+ setup script before you can actually use the SDK.
+ This setup script resides in the directory you chose when you
+ installed the SDK, which is either the default
+ <filename>poky_sdk</filename> directory or the directory you
+ chose during installation.
+ </para>
+
+ <para>
+ Before running the script, be sure it is the one that matches the
+ architecture for which you are developing.
+ Environment setup scripts begin with the string
+ "<filename>environment-setup</filename>" and include as part of
+ their name the tuned target architecture.
+ As an example, the following commands set the working directory
+ to where the SDK was installed and then source the environment
+ setup script.
+ In this example, the setup script is for an IA-based
+ target machine using i586 tuning:
+ <literallayout class='monospaced'>
+ $ cd /home/scottrif/poky_sdk
+ $ source environment-setup-core2-64-poky-linux
+ SDK environment now set up; additionally you may now run devtool to perform development tasks.
+ Run devtool --help for further details.
+ </literallayout>
+ Running the setup script defines many environment variables needed
+ in order to use the SDK (e.g. <filename>PATH</filename>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink>,
+ and so forth).
+ If you want to see all the environment variables the script
+ exports, examine the installation file itself.
+ </para>
+ </section>
+
+ <section id='using-devtool-in-your-sdk-workflow'>
+ <title>Using <filename>devtool</filename> in Your SDK Workflow</title>
+
+ <para>
+ The cornerstone of the extensible SDK is a command-line tool
+ called <filename>devtool</filename>.
+ This tool provides a number of features that help
+ you build, test and package software within the extensible SDK, and
+ optionally integrate it into an image built by the OpenEmbedded
+ build system.
+ <note><title>Tip</title>
+ The use of <filename>devtool</filename> is not limited to
+ the extensible SDK.
+ You can use <filename>devtool</filename> to help you easily
+ develop any project whose build output must be part of an
+ image built using the build system.
+ </note>
+ </para>
+
+ <para>
+ The <filename>devtool</filename> command line is organized
+ similarly to
+ <ulink url='&YOCTO_DOCS_OM_URL;#git'>Git</ulink> in that it
+ has a number of sub-commands for each function.
+ You can run <filename>devtool --help</filename> to see all the
+ commands.
+ <note>
+ See the
+ "<ulink url='&YOCTO_DOCS_REF_URL;#ref-devtool-reference'><filename>devtool</filename>&nbsp;Quick Reference</ulink>"
+ in the Yocto Project Reference Manual for a
+ <filename>devtool</filename> quick reference.
+ </note>
+ </para>
+
+ <para>
+ Three <filename>devtool</filename> subcommands exist that provide
+ entry-points into development:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>devtool add</filename></emphasis>:
+ Assists in adding new software to be built.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>devtool modify</filename></emphasis>:
+ Sets up an environment to enable you to modify the source of
+ an existing component.
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>devtool upgrade</filename></emphasis>:
+ Updates an existing recipe so that you can build it for
+ an updated set of source files.
+ </para></listitem>
+ </itemizedlist>
+ As with the build system, "recipes" represent software packages
+ within <filename>devtool</filename>.
+ When you use <filename>devtool add</filename>, a recipe is
+ automatically created.
+ When you use <filename>devtool modify</filename>, the specified
+ existing recipe is used in order to determine where to get the
+ source code and how to patch it.
+ In both cases, an environment is set up so that when you build the
+ recipe a source tree that is under your control is used in order to
+ allow you to make changes to the source as desired.
+ By default, new recipes and the source go into a "workspace"
+ directory under the SDK.
+ </para>
+
+ <para>
+ The remainder of this section presents the
+ <filename>devtool add</filename>,
+ <filename>devtool modify</filename>, and
+ <filename>devtool upgrade</filename> workflows.
+ </para>
+
+ <section id='sdk-use-devtool-to-add-an-application'>
+ <title>Use <filename>devtool add</filename> to Add an Application</title>
+
+ <para>
+ The <filename>devtool add</filename> command generates
+ a new recipe based on existing source code.
+ This command takes advantage of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>
+ layer that many <filename>devtool</filename> commands
+ use.
+ The command is flexible enough to allow you to extract source
+ code into both the workspace or a separate local Git repository
+ and to use existing code that does not need to be extracted.
+ </para>
+
+ <para>
+ Depending on your particular scenario, the arguments and options
+ you use with <filename>devtool add</filename> form different
+ combinations.
+ The following diagram shows common development flows
+ you would use with the <filename>devtool add</filename>
+ command:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-devtool-add-flow.png" align="center" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para><emphasis>Generating the New Recipe</emphasis>:
+ The top part of the flow shows three scenarios by which
+ you could use <filename>devtool add</filename> to
+ generate a recipe based on existing source code.</para>
+
+ <para>In a shared development environment, it is
+ typical for other developers to be responsible for
+ various areas of source code.
+ As a developer, you are probably interested in using
+ that source code as part of your development within
+ the Yocto Project.
+ All you need is access to the code, a recipe, and a
+ controlled area in which to do your work.</para>
+
+ <para>Within the diagram, three possible scenarios
+ feed into the <filename>devtool add</filename> workflow:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Left</emphasis>:
+ The left scenario in the figure represents a
+ common situation where the source code does not
+ exist locally and needs to be extracted.
+ In this situation, the source code is extracted
+ to the default workspace - you do not
+ want the files in some specific location
+ outside of the workspace.
+ Thus, everything you need will be located in
+ the workspace:
+ <literallayout class='monospaced'>
+ $ devtool add <replaceable>recipe fetchuri</replaceable>
+ </literallayout>
+ With this command, <filename>devtool</filename>
+ extracts the upstream source files into a local
+ Git repository within the
+ <filename>sources</filename> folder.
+ The command then creates a recipe named
+ <replaceable>recipe</replaceable> and a
+ corresponding append file in the workspace.
+ If you do not provide
+ <replaceable>recipe</replaceable>, the command
+ makes an attempt to determine the recipe name.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Middle</emphasis>:
+ The middle scenario in the figure also
+ represents a situation where the source code
+ does not exist locally.
+ In this case, the code is again upstream
+ and needs to be extracted to some
+ local area - this time outside of the default
+ workspace.
+ <note>
+ If required, <filename>devtool</filename>
+ always creates
+ a Git repository locally during the
+ extraction.
+ </note>
+ Furthermore, the first positional argument
+ <replaceable>srctree</replaceable> in this
+ case identifies where the
+ <filename>devtool add</filename> command
+ will locate the extracted code outside of the
+ workspace.
+ You need to specify an empty directory:
+ <literallayout class='monospaced'>
+ $ devtool add <replaceable>recipe srctree fetchuri</replaceable>
+ </literallayout>
+ In summary, the source code is pulled from
+ <replaceable>fetchuri</replaceable> and
+ extracted into the location defined by
+ <replaceable>srctree</replaceable> as a local
+ Git repository.</para>
+
+ <para>Within workspace,
+ <filename>devtool</filename> creates a
+ recipe named <replaceable>recipe</replaceable>
+ along with an associated append file.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Right</emphasis>:
+ The right scenario in the figure represents a
+ situation where the
+ <replaceable>srctree</replaceable> has been
+ previously prepared outside of the
+ <filename>devtool</filename> workspace.</para>
+
+ <para>The following command provides a new
+ recipe name and identifies the existing source
+ tree location:
+ <literallayout class='monospaced'>
+ $ devtool add <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ The command examines the source code and
+ creates a recipe named
+ <replaceable>recipe</replaceable> for the code
+ and places the recipe into the workspace.
+ </para>
+
+ <para>Because the extracted source code already
+ exists, <filename>devtool</filename> does not
+ try to relocate the source code into the
+ workspace - only the new recipe is placed
+ in the workspace.</para>
+
+ <para>Aside from a recipe folder, the command
+ also creates an associated append folder and
+ places an initial
+ <filename>*.bbappend</filename> file within.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Recipe</emphasis>:
+ You can use <filename>devtool edit-recipe</filename>
+ to open up the editor as defined by the
+ <filename>$EDITOR</filename> environment variable
+ and modify the file:
+ <literallayout class='monospaced'>
+ $ devtool edit-recipe <replaceable>recipe</replaceable>
+ </literallayout>
+ From within the editor, you can make modifications to
+ the recipe that take affect when you build it later.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
+ The next step you take depends on what you are going
+ to do with the new code.</para>
+
+ <para>If you need to eventually move the build output
+ to the target hardware, use the following
+ <filename>devtool</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build <replaceable>recipe</replaceable>
+ </literallayout></para>
+
+ <para>On the other hand, if you want an image to
+ contain the recipe's packages from the workspace
+ for immediate deployment onto a device (e.g. for
+ testing purposes), you can use
+ the <filename>devtool build-image</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build-image <replaceable>image</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Deploy the Build Output</emphasis>:
+ When you use the <filename>devtool build</filename>
+ command to build out your recipe, you probably want to
+ see if the resulting build output works as expected
+ on the target hardware.
+ <note>
+ This step assumes you have a previously built
+ image that is already either running in QEMU or
+ is running on actual hardware.
+ Also, it is assumed that for deployment of the
+ image to the target, SSH is installed in the image
+ and, if the image is running on real hardware,
+ you have network access to and from your
+ development machine.
+ </note>
+ You can deploy your build output to that target
+ hardware by using the
+ <filename>devtool deploy-target</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool deploy-target <replaceable>recipe target</replaceable>
+ </literallayout>
+ The <replaceable>target</replaceable> is a live target
+ machine running as an SSH server.</para>
+
+ <para>You can, of course, also deploy the image you
+ build to actual hardware by using the
+ <filename>devtool build-image</filename> command.
+ However, <filename>devtool</filename> does not provide
+ a specific command that allows you to deploy the
+ image to actual hardware.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Finish Your Work With the Recipe</emphasis>:
+ The <filename>devtool finish</filename> command creates
+ any patches corresponding to commits in the local
+ Git repository, moves the new recipe to a more permanent
+ layer, and then resets the recipe so that the recipe is
+ built normally rather than from the workspace.
+ <literallayout class='monospaced'>
+ $ devtool finish <replaceable>recipe layer</replaceable>
+ </literallayout>
+ <note>
+ Any changes you want to turn into patches must be
+ committed to the Git repository in the source tree.
+ </note></para>
+
+ <para>As mentioned, the
+ <filename>devtool finish</filename> command moves the
+ final recipe to its permanent layer.
+ </para>
+
+ <para>As a final process of the
+ <filename>devtool finish</filename> command, the state
+ of the standard layers and the upstream source is
+ restored so that you can build the recipe from those
+ areas rather than the workspace.
+ <note>
+ You can use the <filename>devtool reset</filename>
+ command to put things back should you decide you
+ do not want to proceed with your work.
+ If you do use this command, realize that the source
+ tree is preserved.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='sdk-devtool-use-devtool-modify-to-modify-the-source-of-an-existing-component'>
+ <title>Use <filename>devtool modify</filename> to Modify the Source of an Existing Component</title>
+
+ <para>
+ The <filename>devtool modify</filename> command prepares the
+ way to work on existing code that already has a local recipe in
+ place that is used to build the software.
+ The command is flexible enough to allow you to extract code
+ from an upstream source, specify the existing recipe, and
+ keep track of and gather any patch files from other developers
+ that are associated with the code.
+ </para>
+
+ <para>
+ Depending on your particular scenario, the arguments and options
+ you use with <filename>devtool modify</filename> form different
+ combinations.
+ The following diagram shows common development flows for the
+ <filename>devtool modify</filename> command:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-devtool-modify-flow.png" align="center" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Preparing to Modify the Code</emphasis>:
+ The top part of the flow shows three scenarios by which
+ you could use <filename>devtool modify</filename> to
+ prepare to work on source files.
+ Each scenario assumes the following:
+ <itemizedlist>
+ <listitem><para>
+ The recipe exists locally in a layer external
+ to the <filename>devtool</filename> workspace.
+ </para></listitem>
+ <listitem><para>
+ The source files exist either upstream in an
+ un-extracted state or locally in a previously
+ extracted state.
+ </para></listitem>
+ </itemizedlist>
+ The typical situation is where another developer has
+ created a layer for use with the Yocto Project and
+ their recipe already resides in that layer.
+ Furthermore, their source code is readily available
+ either upstream or locally.
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Left</emphasis>:
+ The left scenario in the figure represents a
+ common situation where the source code does
+ not exist locally and it needs to be extracted
+ from an upstream source.
+ In this situation, the source is extracted
+ into the default <filename>devtool</filename>
+ workspace location.
+ The recipe, in this scenario, is in its own
+ layer outside the workspace
+ (i.e.
+ <filename>meta-</filename><replaceable>layername</replaceable>).
+ </para>
+
+ <para>The following command identifies the
+ recipe and, by default, extracts the source
+ files:
+ <literallayout class='monospaced'>
+ $ devtool modify <replaceable>recipe</replaceable>
+ </literallayout>
+ Once <filename>devtool</filename>locates the
+ recipe, <filename>devtool</filename> uses the
+ recipe's
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ statements to locate the source code and any
+ local patch files from other developers.</para>
+
+ <para>With this scenario, no
+ <replaceable>srctree</replaceable> argument
+ exists.
+ Consequently, the default behavior of the
+ <filename>devtool modify</filename> command is
+ to extract the source files pointed to by the
+ <filename>SRC_URI</filename> statements into a
+ local Git structure.
+ Furthermore, the location for the extracted
+ source is the default area within the
+ <filename>devtool</filename> workspace.
+ The result is that the command sets up both
+ the source code and an append file within the
+ workspace while the recipe remains in its
+ original location.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Middle</emphasis>:
+ The middle scenario in the figure represents a
+ situation where the source code also does not
+ exist locally.
+ In this case, the code is again upstream
+ and needs to be extracted to some
+ local area as a Git repository.
+ The recipe, in this scenario, is again local
+ and in its own layer outside the workspace.
+ </para>
+
+ <para>The following command tells
+ <filename>devtool</filename> what recipe with
+ which to work and, in this case, identifies a
+ local area for the extracted source files that
+ is outside of the default
+ <filename>devtool</filename> workspace:
+ <literallayout class='monospaced'>
+ $ devtool modify <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ <note>
+ You cannot provide a URL for
+ <replaceable>srctree</replaceable> using
+ the <filename>devtool</filename> command.
+ </note>
+ As with all extractions, the command uses
+ the recipe's <filename>SRC_URI</filename>
+ statements to locate the source files and any
+ associated patch files.
+ Once the files are located, the command by
+ default extracts them into
+ <replaceable>srctree</replaceable>.</para>
+
+ <para>Within workspace,
+ <filename>devtool</filename> creates an append
+ file for the recipe.
+ The recipe remains in its original location but
+ the source files are extracted to the location
+ you provide with
+ <replaceable>srctree</replaceable>.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Right</emphasis>:
+ The right scenario in the figure represents a
+ situation where the source tree
+ (<replaceable>srctree</replaceable>) already
+ exists locally as a previously extracted Git
+ structure outside of the
+ <filename>devtool</filename> workspace.
+ In this example, the recipe also exists
+ elsewhere locally in its own layer.
+ </para>
+
+ <para>The following command tells
+ <filename>devtool</filename> the recipe
+ with which to work, uses the "-n" option to
+ indicate source does not need to be extracted,
+ and uses <replaceable>srctree</replaceable> to
+ point to the previously extracted source files:
+ <literallayout class='monospaced'>
+ $ devtool modify -n <replaceable>recipe srctree</replaceable>
+ </literallayout>
+ </para>
+
+ <para>Once the command finishes, it creates only
+ an append file for the recipe in the
+ <filename>devtool</filename> workspace.
+ The recipe and the source code remain in their
+ original locations.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Edit the Source</emphasis>:
+ Once you have used the
+ <filename>devtool modify</filename> command, you are
+ free to make changes to the source files.
+ You can use any editor you like to make and save
+ your source code modifications.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
+ The next step you take depends on what you are going
+ to do with the new code.</para>
+
+ <para>If you need to eventually move the build output
+ to the target hardware, use the following
+ <filename>devtool</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build <replaceable>recipe</replaceable>
+ </literallayout></para>
+
+ <para>On the other hand, if you want an image to
+ contain the recipe's packages from the workspace
+ for immediate deployment onto a device (e.g. for
+ testing purposes), you can use
+ the <filename>devtool build-image</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build-image <replaceable>image</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Deploy the Build Output</emphasis>:
+ When you use the <filename>devtool build</filename>
+ command to build out your recipe, you probably want to
+ see if the resulting build output works as expected
+ on target hardware.
+ <note>
+ This step assumes you have a previously built
+ image that is already either running in QEMU or
+ running on actual hardware.
+ Also, it is assumed that for deployment of the image
+ to the target, SSH is installed in the image and if
+ the image is running on real hardware that you have
+ network access to and from your development machine.
+ </note>
+ You can deploy your build output to that target
+ hardware by using the
+ <filename>devtool deploy-target</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool deploy-target <replaceable>recipe target</replaceable>
+ </literallayout>
+ The <replaceable>target</replaceable> is a live target
+ machine running as an SSH server.</para>
+
+ <para>You can, of course, use other methods to deploy
+ the image you built using the
+ <filename>devtool build-image</filename> command to
+ actual hardware.
+ <filename>devtool</filename> does not provide
+ a specific command to deploy the image to actual
+ hardware.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Finish Your Work With the Recipe</emphasis>:
+ The <filename>devtool finish</filename> command creates
+ any patches corresponding to commits in the local
+ Git repository, updates the recipe to point to them
+ (or creates a <filename>.bbappend</filename> file to do
+ so, depending on the specified destination layer), and
+ then resets the recipe so that the recipe is built
+ normally rather than from the workspace.
+ <literallayout class='monospaced'>
+ $ devtool finish <replaceable>recipe layer</replaceable>
+ </literallayout>
+ <note>
+ Any changes you want to turn into patches must be
+ staged and committed within the local Git
+ repository before you use the
+ <filename>devtool finish</filename> command.
+ </note></para>
+
+ <para>Because there is no need to move the recipe,
+ <filename>devtool finish</filename> either updates the
+ original recipe in the original layer or the command
+ creates a <filename>.bbappend</filename> file in a
+ different layer as provided by
+ <replaceable>layer</replaceable>.</para>
+
+ <para>As a final process of the
+ <filename>devtool finish</filename> command, the state
+ of the standard layers and the upstream source is
+ restored so that you can build the recipe from those
+ areas rather than from the workspace.
+ <note>
+ You can use the <filename>devtool reset</filename>
+ command to put things back should you decide you
+ do not want to proceed with your work.
+ If you do use this command, realize that the source
+ tree is preserved.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='sdk-devtool-use-devtool-upgrade-to-create-a-version-of-the-recipe-that-supports-a-newer-version-of-the-software'>
+ <title>Use <filename>devtool upgrade</filename> to Create a Version of the Recipe that Supports a Newer Version of the Software</title>
+
+ <para>
+ The <filename>devtool upgrade</filename> command upgrades
+ an existing recipe to that of a more up-to-date version
+ found upstream.
+ Throughout the life of software, recipes continually undergo
+ version upgrades by their upstream publishers.
+ You can use the <filename>devtool upgrade</filename>
+ workflow to make sure your recipes you are using for builds
+ are up-to-date with their upstream counterparts.
+ <note>
+ Several methods exist by which you can upgrade recipes -
+ <filename>devtool upgrade</filename> happens to be one.
+ You can read about all the methods by which you can
+ upgrade recipes in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#gs-upgrading-recipes'>Upgrading Recipes</ulink>"
+ section of the Yocto Project Development Tasks Manual.
+ </note>
+ </para>
+
+ <para>
+ The <filename>devtool upgrade</filename> command is flexible
+ enough to allow you to specify source code revision and
+ versioning schemes, extract code into or out of the
+ <filename>devtool</filename>
+ <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>,
+ and work with any source file forms that the fetchers support.
+ </para>
+
+ <para>
+ The following diagram shows the common development flow
+ used with the <filename>devtool upgrade</filename> command:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/sdk-devtool-upgrade-flow.png" align="center" />
+ </para>
+
+ <para>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Initiate the Upgrade</emphasis>:
+ The top part of the flow shows the typical scenario by
+ which you use the <filename>devtool upgrade</filename>
+ command.
+ The following conditions exist:
+ <itemizedlist>
+ <listitem><para>
+ The recipe exists in a local layer external
+ to the <filename>devtool</filename> workspace.
+ </para></listitem>
+ <listitem><para>
+ The source files for the new release
+ exist in the same location pointed to by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ in the recipe (e.g. a tarball with the new
+ version number in the name, or as a different
+ revision in the upstream Git repository).
+ </para></listitem>
+ </itemizedlist>
+ A common situation is where third-party software has
+ undergone a revision so that it has been upgraded.
+ The recipe you have access to is likely in your own
+ layer.
+ Thus, you need to upgrade the recipe to use the
+ newer version of the software:
+ <literallayout class='monospaced'>
+ $ devtool upgrade -V <replaceable>version recipe</replaceable>
+ </literallayout>
+ By default, the <filename>devtool upgrade</filename>
+ command extracts source code into the
+ <filename>sources</filename> directory in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#devtool-the-workspace-layer-structure'>workspace</ulink>.
+ If you want the code extracted to any other location,
+ you need to provide the
+ <replaceable>srctree</replaceable> positional argument
+ with the command as follows:
+ <literallayout class='monospaced'>
+ $ devtool upgrade -V <replaceable>version recipe srctree</replaceable>
+ </literallayout>
+ <note>
+ In this example, the "-V" option specifies the new
+ version.
+ If you don't use "-V", the command upgrades the
+ recipe to the latest version.
+ </note>
+ If the source files pointed to by the
+ <filename>SRC_URI</filename> statement in the recipe
+ are in a Git repository, you must provide the "-S"
+ option and specify a revision for the software.</para>
+
+ <para>Once <filename>devtool</filename> locates the
+ recipe, it uses the <filename>SRC_URI</filename>
+ variable to locate the source code and any local patch
+ files from other developers.
+ The result is that the command sets up the source
+ code, the new version of the recipe, and an append file
+ all within the workspace.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Resolve any Conflicts created by the Upgrade</emphasis>:
+ Conflicts could exist due to the software being
+ upgraded to a new version.
+ Conflicts occur if your recipe specifies some patch
+ files in <filename>SRC_URI</filename> that conflict
+ with changes made in the new version of the software.
+ For such cases, you need to resolve the conflicts
+ by editing the source and following the normal
+ <filename>git rebase</filename> conflict resolution
+ process.</para>
+
+ <para>Before moving onto the next step, be sure to
+ resolve any such conflicts created through use of a
+ newer or different version of the software.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Build the Recipe or Rebuild the Image</emphasis>:
+ The next step you take depends on what you are going
+ to do with the new code.</para>
+
+ <para>If you need to eventually move the build output
+ to the target hardware, use the following
+ <filename>devtool</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build <replaceable>recipe</replaceable>
+ </literallayout></para>
+
+ <para>On the other hand, if you want an image to
+ contain the recipe's packages from the workspace
+ for immediate deployment onto a device (e.g. for
+ testing purposes), you can use
+ the <filename>devtool build-image</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool build-image <replaceable>image</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Deploy the Build Output</emphasis>:
+ When you use the <filename>devtool build</filename>
+ command or <filename>bitbake</filename> to build
+ your recipe, you probably want to see if the resulting
+ build output works as expected on target hardware.
+ <note>
+ This step assumes you have a previously built
+ image that is already either running in QEMU or
+ running on actual hardware.
+ Also, it is assumed that for deployment of the
+ image to the target, SSH is installed in the image
+ and if the image is running on real hardware that
+ you have network access to and from your
+ development machine.
+ </note>
+ You can deploy your build output to that target
+ hardware by using the
+ <filename>devtool deploy-target</filename> command:
+ <literallayout class='monospaced'>
+ $ devtool deploy-target <replaceable>recipe target</replaceable>
+ </literallayout>
+ The <replaceable>target</replaceable> is a live target
+ machine running as an SSH server.</para>
+
+ <para>You can, of course, also deploy the image you
+ build using the
+ <filename>devtool build-image</filename> command
+ to actual hardware.
+ However, <filename>devtool</filename> does not provide
+ a specific command that allows you to do this.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Finish Your Work With the Recipe</emphasis>:
+ The <filename>devtool finish</filename> command creates
+ any patches corresponding to commits in the local
+ Git repository, moves the new recipe to a more
+ permanent layer, and then resets the recipe so that
+ the recipe is built normally rather than from the
+ workspace.
+ If you specify a destination layer that is the same as
+ the original source, then the old version of the
+ recipe and associated files will be removed prior to
+ adding the new version.
+ <literallayout class='monospaced'>
+ $ devtool finish <replaceable>recipe layer</replaceable>
+ </literallayout>
+ <note>
+ Any changes you want to turn into patches must be
+ committed to the Git repository in the source tree.
+ </note></para>
+
+ <para>As a final process of the
+ <filename>devtool finish</filename> command, the state
+ of the standard layers and the upstream source is
+ restored so that you can build the recipe from those
+ areas rather than the workspace.
+ <note>
+ You can use the <filename>devtool reset</filename>
+ command to put things back should you decide you
+ do not want to proceed with your work.
+ If you do use this command, realize that the source
+ tree is preserved.
+ </note>
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='sdk-a-closer-look-at-devtool-add'>
+ <title>A Closer Look at <filename>devtool add</filename></title>
+
+ <para>
+ The <filename>devtool add</filename> command automatically creates
+ a recipe based on the source tree you provide with the command.
+ Currently, the command has support for the following:
+ <itemizedlist>
+ <listitem><para>
+ Autotools (<filename>autoconf</filename> and
+ <filename>automake</filename>)
+ </para></listitem>
+ <listitem><para>
+ CMake
+ </para></listitem>
+ <listitem><para>
+ Scons
+ </para></listitem>
+ <listitem><para>
+ <filename>qmake</filename>
+ </para></listitem>
+ <listitem><para>
+ Plain <filename>Makefile</filename>
+ </para></listitem>
+ <listitem><para>
+ Out-of-tree kernel module
+ </para></listitem>
+ <listitem><para>
+ Binary package (i.e. "-b" option)
+ </para></listitem>
+ <listitem><para>
+ Node.js module
+ </para></listitem>
+ <listitem><para>
+ Python modules that use <filename>setuptools</filename>
+ or <filename>distutils</filename>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Apart from binary packages, the determination of how a source tree
+ should be treated is automatic based on the files present within
+ that source tree.
+ For example, if a <filename>CMakeLists.txt</filename> file is found,
+ then the source tree is assumed to be using
+ CMake and is treated accordingly.
+ <note>
+ In most cases, you need to edit the automatically generated
+ recipe in order to make it build properly.
+ Typically, you would go through several edit and build cycles
+ until the recipe successfully builds.
+ Once the recipe builds, you could use possible further
+ iterations to test the recipe on the target device.
+ </note>
+ </para>
+
+ <para>
+ The remainder of this section covers specifics regarding how parts
+ of the recipe are generated.
+ </para>
+
+ <section id='sdk-name-and-version'>
+ <title>Name and Version</title>
+
+ <para>
+ If you do not specify a name and version on the command
+ line, <filename>devtool add</filename> uses various metadata
+ within the source tree in an attempt to determine
+ the name and version of the software being built.
+ Based on what the tool determines, <filename>devtool</filename>
+ sets the name of the created recipe file accordingly.
+ </para>
+
+ <para>
+ If <filename>devtool</filename> cannot determine the name and
+ version, the command prints an error.
+ For such cases, you must re-run the command and provide
+ the name and version, just the name, or just the version as
+ part of the command line.
+ </para>
+
+ <para>
+ Sometimes the name or version determined from the source tree
+ might be incorrect.
+ For such a case, you must reset the recipe:
+ <literallayout class='monospaced'>
+ $ devtool reset -n <replaceable>recipename</replaceable>
+ </literallayout>
+ After running the <filename>devtool reset</filename> command,
+ you need to run <filename>devtool add</filename> again and
+ provide the name or the version.
+ </para>
+ </section>
+
+ <section id='sdk-dependency-detection-and-mapping'>
+ <title>Dependency Detection and Mapping</title>
+
+ <para>
+ The <filename>devtool add</filename> command attempts to
+ detect build-time dependencies and map them to other recipes
+ in the system.
+ During this mapping, the command fills in the names of those
+ recipes as part of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DEPENDS'><filename>DEPENDS</filename></ulink>
+ variable within the recipe.
+ If a dependency cannot be mapped, <filename>devtool</filename>
+ places a comment in the recipe indicating such.
+ The inability to map a dependency can result from naming not
+ being recognized or because the dependency simply is not
+ available.
+ For cases where the dependency is not available, you must use
+ the <filename>devtool add</filename> command to add an
+ additional recipe that satisfies the dependency.
+ Once you add that recipe, you need to update the
+ <filename>DEPENDS</filename> variable in the original recipe
+ to include the new recipe.
+ </para>
+
+ <para>
+ If you need to add runtime dependencies, you can do so by
+ adding the following to your recipe:
+ <literallayout class='monospaced'>
+ RDEPENDS_${PN} += "<replaceable>dependency1 dependency2 ...</replaceable>"
+ </literallayout>
+ <note>
+ The <filename>devtool add</filename> command often cannot
+ distinguish between mandatory and optional dependencies.
+ Consequently, some of the detected dependencies might
+ in fact be optional.
+ When in doubt, consult the documentation or the configure
+ script for the software the recipe is building for further
+ details.
+ In some cases, you might find you can substitute the
+ dependency with an option that disables the associated
+ functionality passed to the configure script.
+ </note>
+ </para>
+ </section>
+
+ <section id='sdk-license-detection'>
+ <title>License Detection</title>
+
+ <para>
+ The <filename>devtool add</filename> command attempts to
+ determine if the software you are adding is able to be
+ distributed under a common, open-source license.
+ If so, the command sets the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE'><filename>LICENSE</filename></ulink>
+ value accordingly.
+ You should double-check the value added by the command against
+ the documentation or source files for the software you are
+ building and, if necessary, update that
+ <filename>LICENSE</filename> value.
+ </para>
+
+ <para>
+ The <filename>devtool add</filename> command also sets the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></ulink>
+ value to point to all files that appear to be license-related.
+ Realize that license statements often appear in comments at
+ the top of source files or within the documentation.
+ In such cases, the command does not recognize those license
+ statements.
+ Consequently, you might need to amend the
+ <filename>LIC_FILES_CHKSUM</filename> variable to point to one
+ or more of those comments if present.
+ Setting <filename>LIC_FILES_CHKSUM</filename> is particularly
+ important for third-party software.
+ The mechanism attempts to ensure correct licensing should you
+ upgrade the recipe to a newer upstream version in future.
+ Any change in licensing is detected and you receive an error
+ prompting you to check the license text again.
+ </para>
+
+ <para>
+ If the <filename>devtool add</filename> command cannot
+ determine licensing information, <filename>devtool</filename>
+ sets the <filename>LICENSE</filename> value to "CLOSED" and
+ leaves the <filename>LIC_FILES_CHKSUM</filename> value unset.
+ This behavior allows you to continue with development even
+ though the settings are unlikely to be correct in all cases.
+ You should check the documentation or source files for the
+ software you are building to determine the actual license.
+ </para>
+ </section>
+
+ <section id='sdk-adding-makefile-only-software'>
+ <title>Adding Makefile-Only Software</title>
+
+ <para>
+ The use of Make by itself is very common in both proprietary
+ and open-source software.
+ Unfortunately, Makefiles are often not written with
+ cross-compilation in mind.
+ Thus, <filename>devtool add</filename> often cannot do very
+ much to ensure that these Makefiles build correctly.
+ It is very common, for example, to explicitly call
+ <filename>gcc</filename> instead of using the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>
+ variable.
+ Usually, in a cross-compilation environment,
+ <filename>gcc</filename> is the compiler for the build host
+ and the cross-compiler is named something similar to
+ <filename>arm-poky-linux-gnueabi-gcc</filename> and might
+ require arguments (e.g. to point to the associated sysroot
+ for the target machine).
+ </para>
+
+ <para>
+ When writing a recipe for Makefile-only software, keep the
+ following in mind:
+ <itemizedlist>
+ <listitem><para>
+ You probably need to patch the Makefile to use
+ variables instead of hardcoding tools within the
+ toolchain such as <filename>gcc</filename> and
+ <filename>g++</filename>.
+ </para></listitem>
+ <listitem><para>
+ The environment in which Make runs is set up with
+ various standard variables for compilation (e.g.
+ <filename>CC</filename>, <filename>CXX</filename>, and
+ so forth) in a similar manner to the environment set
+ up by the SDK's environment setup script.
+ One easy way to see these variables is to run the
+ <filename>devtool build</filename> command on the
+ recipe and then look in
+ <filename>oe-logs/run.do_compile</filename>.
+ Towards the top of this file, a list of environment
+ variables exists that are being set.
+ You can take advantage of these variables within the
+ Makefile.
+ </para></listitem>
+ <listitem><para>
+ If the Makefile sets a default for a variable using "=",
+ that default overrides the value set in the environment,
+ which is usually not desirable.
+ For this case, you can either patch the Makefile
+ so it sets the default using the "?=" operator, or
+ you can alternatively force the value on the
+ <filename>make</filename> command line.
+ To force the value on the command line, add the
+ variable setting to
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ within the recipe.
+ Here is an example using <filename>EXTRA_OEMAKE</filename>:
+ <literallayout class='monospaced'>
+ EXTRA_OEMAKE += "'CC=${CC}' 'CXX=${CXX}'"
+ </literallayout>
+ In the above example, single quotes are used around the
+ variable settings as the values are likely to contain
+ spaces because required default options are passed to
+ the compiler.
+ </para></listitem>
+ <listitem><para>
+ Hardcoding paths inside Makefiles is often problematic
+ in a cross-compilation environment.
+ This is particularly true because those hardcoded paths
+ often point to locations on the build host and thus
+ will either be read-only or will introduce
+ contamination into the cross-compilation because they
+ are specific to the build host rather than the target.
+ Patching the Makefile to use prefix variables or other
+ path variables is usually the way to handle this
+ situation.
+ </para></listitem>
+ <listitem><para>
+ Sometimes a Makefile runs target-specific commands such
+ as <filename>ldconfig</filename>.
+ For such cases, you might be able to apply patches that
+ remove these commands from the Makefile.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='sdk-adding-native-tools'>
+ <title>Adding Native Tools</title>
+
+ <para>
+ Often, you need to build additional tools that run on the
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>
+ as opposed to the target.
+ You should indicate this requirement by using one of the
+ following methods when you run
+ <filename>devtool add</filename>:
+ <itemizedlist>
+ <listitem><para>
+ Specify the name of the recipe such that it ends
+ with "-native".
+ Specifying the name like this produces a recipe that
+ only builds for the build host.
+ </para></listitem>
+ <listitem><para>
+ Specify the "&dash;&dash;also-native" option with the
+ <filename>devtool add</filename> command.
+ Specifying this option creates a recipe file that still
+ builds for the target but also creates a variant with
+ a "-native" suffix that builds for the build host.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ If you need to add a tool that is shipped as part of a
+ source tree that builds code for the target, you can
+ typically accomplish this by building the native and target
+ parts separately rather than within the same compilation
+ process.
+ Realize though that with the "&dash;&dash;also-native"
+ option, you can add the tool using just one recipe file.
+ </note>
+ </para>
+ </section>
+
+ <section id='sdk-adding-node-js-modules'>
+ <title>Adding Node.js Modules</title>
+
+ <para>
+ You can use the <filename>devtool add</filename> command two
+ different ways to add Node.js modules: 1) Through
+ <filename>npm</filename> and, 2) from a repository or local
+ source.
+ </para>
+
+ <para>
+ Use the following form to add Node.js modules through
+ <filename>npm</filename>:
+ <literallayout class='monospaced'>
+ $ devtool add "npm://registry.npmjs.org;name=forever;version=0.15.1"
+ </literallayout>
+ The name and version parameters are mandatory.
+ Lockdown and shrinkwrap files are generated and pointed to by
+ the recipe in order to freeze the version that is fetched for
+ the dependencies according to the first time.
+ This also saves checksums that are verified on future fetches.
+ Together, these behaviors ensure the reproducibility and
+ integrity of the build.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ You must use quotes around the URL.
+ The <filename>devtool add</filename> does not require
+ the quotes, but the shell considers ";" as a splitter
+ between multiple commands.
+ Thus, without the quotes,
+ <filename>devtool add</filename> does not receive the
+ other parts, which results in several "command not
+ found" errors.
+ </para></listitem>
+ <listitem><para>
+ In order to support adding Node.js modules, a
+ <filename>nodejs</filename> recipe must be part
+ of your SDK.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <para>
+ As mentioned earlier, you can also add Node.js modules
+ directly from a repository or local source tree.
+ To add modules this way, use <filename>devtool add</filename>
+ in the following form:
+ <literallayout class='monospaced'>
+ $ devtool add https://github.com/diversario/node-ssdp
+ </literallayout>
+ In this example, <filename>devtool</filename> fetches the
+ specified Git repository, detects the code as Node.js
+ code, fetches dependencies using <filename>npm</filename>, and
+ sets
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-SRC_URI'><filename>SRC_URI</filename></ulink>
+ accordingly.
+ </para>
+ </section>
+ </section>
+
+ <section id='sdk-working-with-recipes'>
+ <title>Working With Recipes</title>
+
+ <para>
+ When building a recipe using the
+ <filename>devtool build</filename> command, the typical build
+ progresses as follows:
+ <orderedlist>
+ <listitem><para>
+ Fetch the source
+ </para></listitem>
+ <listitem><para>
+ Unpack the source
+ </para></listitem>
+ <listitem><para>
+ Configure the source
+ </para></listitem>
+ <listitem><para>
+ Compile the source
+ </para></listitem>
+ <listitem><para>
+ Install the build output
+ </para></listitem>
+ <listitem><para>
+ Package the installed output
+ </para></listitem>
+ </orderedlist>
+ For recipes in the workspace, fetching and unpacking is disabled
+ as the source tree has already been prepared and is persistent.
+ Each of these build steps is defined as a function (task), usually
+ with a "do_" prefix (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-fetch'><filename>do_fetch</filename></ulink>,
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-unpack'><filename>do_unpack</filename></ulink>,
+ and so forth).
+ These functions are typically shell scripts but can instead be
+ written in Python.
+ </para>
+
+ <para>
+ If you look at the contents of a recipe, you will see that the
+ recipe does not include complete instructions for building the
+ software.
+ Instead, common functionality is encapsulated in classes inherited
+ with the <filename>inherit</filename> directive.
+ This technique leaves the recipe to describe just the things that
+ are specific to the software being built.
+ A
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-base'><filename>base</filename></ulink>
+ class exists that is implicitly inherited by all recipes and
+ provides the functionality that most recipes typically need.
+ </para>
+
+ <para>
+ The remainder of this section presents information useful when
+ working with recipes.
+ </para>
+
+ <section id='sdk-finding-logs-and-work-files'>
+ <title>Finding Logs and Work Files</title>
+
+ <para>
+ After the first run of the <filename>devtool build</filename>
+ command, recipes that were previously created using the
+ <filename>devtool add</filename> command or whose sources were
+ modified using the <filename>devtool modify</filename>
+ command contain symbolic links created within the source tree:
+ <itemizedlist>
+ <listitem><para>
+ <filename>oe-logs</filename>:
+ This link points to the directory in which log files
+ and run scripts for each build step are created.
+ </para></listitem>
+ <listitem><para>
+ <filename>oe-workdir</filename>:
+ This link points to the temporary work area for the
+ recipe.
+ The following locations under
+ <filename>oe-workdir</filename> are particularly
+ useful:
+ <itemizedlist>
+ <listitem><para>
+ <filename>image/</filename>:
+ Contains all of the files installed during
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ stage.
+ Within a recipe, this directory is referred
+ to by the expression
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>.
+ </para></listitem>
+ <listitem><para>
+ <filename>sysroot-destdir/</filename>:
+ Contains a subset of files installed within
+ <filename>do_install</filename> that have
+ been put into the shared sysroot.
+ For more information, see the
+ "<link linkend='sdk-sharing-files-between-recipes'>Sharing Files Between Recipes</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <filename>packages-split/</filename>:
+ Contains subdirectories for each package
+ produced by the recipe.
+ For more information, see the
+ "<link linkend='sdk-packaging'>Packaging</link>"
+ section.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ You can use these links to get more information on what is
+ happening at each build step.
+ </para>
+ </section>
+
+ <section id='sdk-setting-configure-arguments'>
+ <title>Setting Configure Arguments</title>
+
+ <para>
+ If the software your recipe is building uses GNU autoconf,
+ then a fixed set of arguments is passed to it to enable
+ cross-compilation plus any extras specified by
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECONF'><filename>EXTRA_OECONF</filename></ulink>
+ or
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ set within the recipe.
+ If you wish to pass additional options, add them to
+ <filename>EXTRA_OECONF</filename> or
+ <filename>PACKAGECONFIG_CONFARGS</filename>.
+ Other supported build tools have similar variables
+ (e.g.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink>
+ for CMake,
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OESCONS'><filename>EXTRA_OESCONS</filename></ulink>
+ for Scons, and so forth).
+ If you need to pass anything on the <filename>make</filename>
+ command line, you can use <filename>EXTRA_OEMAKE</filename> or the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
+ variables to do so.
+ </para>
+
+ <para>
+ You can use the <filename>devtool configure-help</filename> command
+ to help you set the arguments listed in the previous paragraph.
+ The command determines the exact options being passed, and shows
+ them to you along with any custom arguments specified through
+ <filename>EXTRA_OECONF</filename> or
+ <filename>PACKAGECONFIG_CONFARGS</filename>.
+ If applicable, the command also shows you the output of the
+ configure script's "&dash;&dash;help" option as a reference.
+ </para>
+ </section>
+
+ <section id='sdk-sharing-files-between-recipes'>
+ <title>Sharing Files Between Recipes</title>
+
+ <para>
+ Recipes often need to use files provided by other recipes on
+ the
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>build host</ulink>.
+ For example, an application linking to a common library needs
+ access to the library itself and its associated headers.
+ The way this access is accomplished within the extensible SDK is
+ through the sysroot.
+ One sysroot exists per "machine" for which the SDK is being
+ built.
+ In practical terms, this means a sysroot exists for the target
+ machine, and a sysroot exists for the build host.
+ </para>
+
+ <para>
+ Recipes should never write files directly into the sysroot.
+ Instead, files should be installed into standard locations
+ during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task within the
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink><filename>}</filename>
+ directory.
+ A subset of these files automatically goes into the sysroot.
+ The reason for this limitation is that almost all files that go
+ into the sysroot are cataloged in manifests in order to ensure
+ they can be removed later when a recipe is modified or removed.
+ Thus, the sysroot is able to remain free from stale files.
+ </para>
+ </section>
+
+ <section id='sdk-packaging'>
+ <title>Packaging</title>
+
+ <para>
+ Packaging is not always particularly relevant within the
+ extensible SDK.
+ However, if you examine how build output gets into the final image
+ on the target device, it is important to understand packaging
+ because the contents of the image are expressed in terms of
+ packages and not recipes.
+ </para>
+
+ <para>
+ During the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-package'><filename>do_package</filename></ulink>
+ task, files installed during the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task are split into one main package, which is almost always
+ named the same as the recipe, and into several other packages.
+ This separation exists because not all of those installed files
+ are useful in every image.
+ For example, you probably do not need any of the documentation
+ installed in a production image.
+ Consequently, for each recipe the documentation files are
+ separated into a <filename>-doc</filename> package.
+ Recipes that package software containing optional modules or
+ plugins might undergo additional package splitting as well.
+ </para>
+
+ <para>
+ After building a recipe, you can see where files have gone by
+ looking in the <filename>oe-workdir/packages-split</filename>
+ directory, which contains a subdirectory for each package.
+ Apart from some advanced cases, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGES'><filename>PACKAGES</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-FILES'><filename>FILES</filename></ulink>
+ variables controls splitting.
+ The <filename>PACKAGES</filename> variable lists all of the
+ packages to be produced, while the <filename>FILES</filename>
+ variable specifies which files to include in each package by
+ using an override to specify the package.
+ For example, <filename>FILES_${PN}</filename> specifies the
+ files to go into the main package (i.e. the main package has
+ the same name as the recipe and
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-PN'><filename>PN</filename></ulink><filename>}</filename>
+ evaluates to the recipe name).
+ The order of the <filename>PACKAGES</filename> value is
+ significant.
+ For each installed file, the first package whose
+ <filename>FILES</filename> value matches the file is the
+ package into which the file goes.
+ Defaults exist for both the <filename>PACKAGES</filename> and
+ <filename>FILES</filename> variables.
+ Consequently, you might find you do not even need to set these
+ variables in your recipe unless the software the recipe is
+ building installs files into non-standard locations.
+ </para>
+ </section>
+ </section>
+
+ <section id='sdk-restoring-the-target-device-to-its-original-state'>
+ <title>Restoring the Target Device to its Original State</title>
+
+ <para>
+ If you use the <filename>devtool deploy-target</filename>
+ command to write a recipe's build output to the target, and
+ you are working on an existing component of the system, then you
+ might find yourself in a situation where you need to restore the
+ original files that existed prior to running the
+ <filename>devtool deploy-target</filename> command.
+ Because the <filename>devtool deploy-target</filename> command
+ backs up any files it overwrites, you can use the
+ <filename>devtool undeploy-target</filename> command to restore
+ those files and remove any other files the recipe deployed.
+ Consider the following example:
+ <literallayout class='monospaced'>
+ $ devtool undeploy-target lighttpd root@192.168.7.2
+ </literallayout>
+ If you have deployed multiple applications, you can remove them
+ all using the "-a" option thus restoring the target device to its
+ original state:
+ <literallayout class='monospaced'>
+ $ devtool undeploy-target -a root@192.168.7.2
+ </literallayout>
+ Information about files deployed to the target as well as any
+ backed up files are stored on the target itself.
+ This storage, of course, requires some additional space
+ on the target machine.
+ <note>
+ The <filename>devtool deploy-target</filename> and
+ <filename>devtool undeploy-target</filename> commands do not
+ currently interact with any package management system on the
+ target device (e.g. RPM or OPKG).
+ Consequently, you should not intermingle
+ <filename>devtool deploy-target</filename> and package
+ manager operations on the target device.
+ Doing so could result in a conflicting set of files.
+ </note>
+ </para>
+ </section>
+
+ <section id='sdk-installing-additional-items-into-the-extensible-sdk'>
+ <title>Installing Additional Items Into the Extensible SDK</title>
+
+ <para>
+ Out of the box the extensible SDK typically only comes with a small
+ number of tools and libraries.
+ A minimal SDK starts mostly empty and is populated on-demand.
+ Sometimes you must explicitly install extra items into the SDK.
+ If you need these extra items, you can first search for the items
+ using the <filename>devtool search</filename> command.
+ For example, suppose you need to link to libGL but you are not sure
+ which recipe provides libGL.
+ You can use the following command to find out:
+ <literallayout class='monospaced'>
+ $ devtool search libGL
+ mesa A free implementation of the OpenGL API
+ </literallayout>
+ Once you know the recipe (i.e. <filename>mesa</filename> in this
+ example), you can install it:
+ <literallayout class='monospaced'>
+ $ devtool sdk-install mesa
+ </literallayout>
+ By default, the <filename>devtool sdk-install</filename> command
+ assumes the item is available in pre-built form from your SDK
+ provider.
+ If the item is not available and it is acceptable to build the item
+ from source, you can add the "-s" option as follows:
+ <literallayout class='monospaced'>
+ $ devtool sdk-install -s mesa
+ </literallayout>
+ It is important to remember that building the item from source
+ takes significantly longer than installing the pre-built artifact.
+ Also, if no recipe exists for the item you want to add to the SDK,
+ you must instead add the item using the
+ <filename>devtool add</filename> command.
+ </para>
+ </section>
+
+ <section id='sdk-updating-the-extensible-sdk'>
+ <title>Updating the Extensible SDK</title>
+
+ <para>
+ If you are working with an extensible SDK that gets occasionally
+ updated (e.g. typically when that SDK has been provided to you by
+ another party), then you will need to manually pull down those
+ updates to your installed SDK.
+ </para>
+
+ <para>
+ To update your installed SDK, run the following:
+ <literallayout class='monospaced'>
+ $ devtool sdk-update
+ </literallayout>
+ The previous command assumes your SDK provider has set the default
+ update URL for you.
+ If that URL has not been set, you need to specify it yourself as
+ follows:
+ <literallayout class='monospaced'>
+ $ devtool sdk-update <replaceable>path_to_update_directory</replaceable>
+ </literallayout>
+ <note>
+ The URL needs to point specifically to a published SDK and not an
+ SDK installer that you would download and install.
+ </note>
+ </para>
+ </section>
+
+ <section id='sdk-creating-a-derivative-sdk-with-additional-components'>
+ <title>Creating a Derivative SDK With Additional Components</title>
+
+ <para>
+ You might need to produce an SDK that contains your own custom
+ libraries.
+ A good example would be if you were a vendor with customers that
+ use your SDK to build their own platform-specific software and
+ those customers need an SDK that has custom libraries.
+ In such a case, you can produce a derivative SDK based on the
+ currently installed SDK fairly easily by following these steps:
+ <orderedlist>
+ <listitem><para>
+ If necessary, install an extensible SDK that
+ you want to use as a base for your derivative SDK.
+ </para></listitem>
+ <listitem><para>
+ Source the environment script for the SDK.
+ </para></listitem>
+ <listitem><para>
+ Add the extra libraries or other components you want by
+ using the <filename>devtool add</filename> command.
+ </para></listitem>
+ <listitem><para>
+ Run the <filename>devtool build-sdk</filename> command.
+ </para></listitem>
+ </orderedlist>
+ The previous steps take the recipes added to the workspace and
+ construct a new SDK installer that contains those recipes and the
+ resulting binary artifacts.
+ The recipes go into their own separate layer in the constructed
+ derivative SDK, which leaves the workspace clean and ready for
+ users to add their own recipes.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-intro.xml b/poky/documentation/sdk-manual/sdk-intro.xml
new file mode 100644
index 000000000..8642be61a
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-intro.xml
@@ -0,0 +1,417 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='sdk-intro'>
+<title>Introduction</title>
+
+<section id='sdk-manual-intro'>
+ <title>Introduction</title>
+
+ <para>
+ Welcome to the Yocto Project Application Development and the
+ Extensible Software Development Kit (eSDK) manual.
+ This manual provides information that explains how to use both the
+ Yocto Project extensible and standard SDKs to develop
+ applications and images.
+ Additionally, the manual also provides information on how to use
+ the popular <trademark class='trade'>Eclipse</trademark> IDE as part
+ of your application development workflow within the SDK environment.
+ <note>
+ Prior to the 2.0 Release of the Yocto Project, application
+ development was primarily accomplished through the use of the
+ Application Development Toolkit (ADT) and the availability
+ of stand-alone cross-development toolchains and other tools.
+ With the 2.1 Release of the Yocto Project, application development
+ has transitioned to within a tool-rich extensible SDK and the more
+ traditional standard SDK.
+ </note>
+ </para>
+
+ <para>
+ All SDKs consist of the following:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Cross-Development Toolchain</emphasis>:
+ This toolchain contains a compiler, debugger, and various
+ miscellaneous tools.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Libraries, Headers, and Symbols</emphasis>:
+ The libraries, headers, and symbols are specific to the image
+ (i.e. they match the image).
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Environment Setup Script</emphasis>:
+ This <filename>*.sh</filename> file, once run, sets up the
+ cross-development environment by defining variables and
+ preparing for SDK use.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ Additionally, an extensible SDK has tools that allow you to easily add
+ new applications and libraries to an image, modify the source of an
+ existing component, test changes on the target hardware, and easily
+ integrate an application into the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ </para>
+
+ <para>
+ You can use an SDK to independently develop and test code
+ that is destined to run on some target machine.
+ SDKs are completely self-contained.
+ The binaries are linked against their own copy of
+ <filename>libc</filename>, which results in no dependencies
+ on the target system.
+ To achieve this, the pointer to the dynamic loader is
+ configured at install time since that path cannot be dynamically
+ altered.
+ This is the reason for a wrapper around the
+ <filename>populate_sdk</filename> and
+ <filename>populate_sdk_ext</filename> archives.
+ </para>
+
+ <para>
+ Another feature for the SDKs is that only one set of cross-compiler
+ toolchain binaries are produced for any given architecture.
+ This feature takes advantage of the fact that the target hardware can
+ be passed to <filename>gcc</filename> as a set of compiler options.
+ Those options are set up by the environment script and contained in
+ variables such as
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>
+ and
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink>.
+ This reduces the space needed for the tools.
+ Understand, however, that every target still needs a sysroot because
+ those binaries are target-specific.
+ </para>
+
+ <para>
+ The SDK development environment consists of the following:
+ <itemizedlist>
+ <listitem><para>
+ The self-contained SDK, which is an
+ architecture-specific cross-toolchain and
+ matching sysroots (target and native) all built by the
+ OpenEmbedded build system (e.g. the SDK).
+ The toolchain and sysroots are based on a
+ <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
+ configuration and extensions,
+ which allows you to cross-develop on the host machine for the
+ target hardware.
+ Additionally, the extensible SDK contains the
+ <filename>devtool</filename> functionality.
+ </para></listitem>
+ <listitem><para>
+ The Quick EMUlator (QEMU), which lets you simulate
+ target hardware.
+ QEMU is not literally part of the SDK.
+ You must build and include this emulator separately.
+ However, QEMU plays an important role in the development
+ process that revolves around use of the SDK.
+ </para></listitem>
+ <listitem><para>
+ The Eclipse IDE Yocto Plug-in.
+ This plug-in is available for you if you are an Eclipse
+ user.
+ In the same manner as QEMU, the plug-in is not literally part
+ of the SDK but is rather available for use as part of the
+ development process.
+ </para></listitem>
+ <listitem><para>
+ Various performance-related
+ <ulink url='http://www.eclipse.org/linuxtools/index.php'>tools</ulink>
+ that can enhance your development experience.
+ These tools are also separate from the actual SDK but can be
+ independently obtained and used in the development process.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ In summary, the extensible and standard SDK share many features.
+ However, the extensible SDK has powerful development tools to help you
+ more quickly develop applications.
+ Following is a table that summarizes the primary differences between
+ the standard and extensible SDK types when considering which to
+ build:
+ <informaltable frame='none'>
+ <tgroup cols='3' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth='1*'/>
+ <colspec colname='c2' colwidth='1*'/>
+ <colspec colname='c3' colwidth='1*'/>
+ <thead>
+ <row>
+ <entry align="left"><emphasis>Feature</emphasis></entry>
+ <entry align="left"><emphasis>Standard SDK</emphasis></entry>
+ <entry align="left"><emphasis>Extensible SDK</emphasis></entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry align="left">Toolchain</entry>
+ <entry align="left">Yes</entry>
+ <entry align="left">Yes*</entry>
+ </row>
+ <row>
+ <entry align="left">Debugger</entry>
+ <entry align="left">Yes</entry>
+ <entry align="left">Yes*</entry>
+ </row>
+ <row>
+ <entry align="left">Size</entry>
+ <entry align="left">100+ MBytes</entry>
+ <entry align="left">1+ GBytes (or 300+ MBytes for minimal w/toolchain)</entry>
+ </row>
+ <row>
+ <entry align="left"><filename>devtool</filename></entry>
+ <entry align="left">No</entry>
+ <entry align="left">Yes</entry>
+ </row>
+ <row>
+ <entry align="left">Build Images</entry>
+ <entry align="left">No</entry>
+ <entry align="left">Yes</entry>
+ </row>
+ <row>
+ <entry align="left">Updateable</entry>
+ <entry align="left">No</entry>
+ <entry align="left">Yes</entry>
+ </row>
+ <row>
+ <entry align="left">Managed Sysroot**</entry>
+ <entry align="left">No</entry>
+ <entry align="left">Yes</entry>
+ </row>
+ <row>
+ <entry align="left">Installed Packages</entry>
+ <entry align="left">No***</entry>
+ <entry align="left">Yes****</entry>
+ </row>
+ <row>
+ <entry align="left">Construction</entry>
+ <entry align="left">Packages</entry>
+ <entry align="left">Shared State</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <literallayout class='monospaced'>
+ * Extensible SDK contains the toolchain and debugger if <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></ulink> is "full" or <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_TOOLCHAIN'><filename>SDK_INCLUDE_TOOLCHAIN</filename></ulink> is "1", which is the default.
+
+ ** Sysroot is managed through the use of <filename>devtool</filename>. Thus, it is less likely that you will corrupt your SDK sysroot when you try to add additional libraries.
+
+ *** You can add runtime package management to the standard SDK but it is not supported by default.
+
+ **** You must build and make the shared state available to extensible SDK users for "packages" you want to enable users to install.
+ </literallayout>
+ </para>
+
+ <section id='the-cross-development-toolchain'>
+ <title>The Cross-Development Toolchain</title>
+
+ <para>
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain'>Cross-Development Toolchain</ulink>
+ consists of a cross-compiler, cross-linker, and cross-debugger
+ that are used to develop user-space applications for targeted
+ hardware.
+ Additionally, for an extensible SDK, the toolchain also has
+ built-in <filename>devtool</filename> functionality.
+ This toolchain is created by running a SDK installer script
+ or through a
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
+ that is based on your metadata configuration or extension for
+ your targeted device.
+ The cross-toolchain works with a matching target sysroot.
+ </para>
+ </section>
+
+ <section id='sysroot'>
+ <title>Sysroots</title>
+
+ <para>
+ The native and target sysroots contain needed headers and libraries
+ for generating binaries that run on the target architecture.
+ The target sysroot is based on the target root filesystem image
+ that is built by the OpenEmbedded build system and uses the same
+ metadata configuration used to build the cross-toolchain.
+ </para>
+ </section>
+
+ <section id='the-qemu-emulator'>
+ <title>The QEMU Emulator</title>
+
+ <para>
+ The QEMU emulator allows you to simulate your hardware while
+ running your application or image.
+ QEMU is not part of the SDK but is made available a number of
+ different ways:
+ <itemizedlist>
+ <listitem><para>
+ If you have cloned the <filename>poky</filename> Git
+ repository to create a
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ and you have sourced the environment setup script, QEMU is
+ installed and automatically available.
+ </para></listitem>
+ <listitem><para>
+ If you have downloaded a Yocto Project release and unpacked
+ it to create a Source Directory and you have sourced the
+ environment setup script, QEMU is installed and
+ automatically available.
+ </para></listitem>
+ <listitem><para>
+ If you have installed the cross-toolchain tarball and you
+ have sourced the toolchain's setup environment script, QEMU
+ is also installed and automatically available.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='eclipse-overview'>
+ <title><trademark class='trade'>Eclipse</trademark> Yocto Plug-in</title>
+
+ <para>
+ The Eclipse IDE is a popular development environment and it fully
+ supports development using the Yocto Project.
+ When you install and configure the Eclipse Yocto Project Plug-in
+ into the Eclipse IDE, you maximize your Yocto Project experience.
+ Installing and configuring the Plug-in results in an environment
+ that has extensions specifically designed to let you more easily
+ develop software.
+ These extensions allow for cross-compilation, deployment, and
+ execution of your output into a QEMU emulation session.
+ You can also perform cross-debugging and profiling.
+ The environment also supports many performance-related
+ <ulink url='http://www.eclipse.org/linuxtools/index.php'>tools</ulink>
+ that enhance your development experience.
+ <note>
+ Previous releases of the Eclipse Yocto Plug-in supported
+ "user-space tools" (i.e. LatencyTOP, PowerTOP, Perf, SystemTap,
+ and Lttng-ust) that also added to the development experience.
+ These tools have been deprecated with the release of the
+ Eclipse Yocto Plug-in.
+ </note>
+ </para>
+
+ <para>
+ For information about the application development workflow that
+ uses the Eclipse IDE and for a detailed example of how to install
+ and configure the Eclipse Yocto Project Plug-in, see the
+ "<link linkend='sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></link>"
+ Chapter.
+ </para>
+ </section>
+
+ <section id='performance-enhancing-tools'>
+ <title>Performance Enhancing Tools</title>
+
+ <para>
+ Supported performance enhancing tools are available that let you
+ profile, debug, and perform tracing on your projects developed
+ using Eclipse.
+ For information on these tools see
+ <ulink url='http://www.eclipse.org/linuxtools/'>http://www.eclipse.org/linuxtools/</ulink>.
+ </para>
+ </section>
+</section>
+
+<section id='sdk-development-model'>
+ <title>SDK Development Model</title>
+
+ <para>
+ Fundamentally, the SDK fits into the development process as follows:
+ <imagedata fileref="figures/sdk-environment.png" align="center" width="6in" depth="5in" scalefit="100" />
+ The SDK is installed on any machine and can be used to develop
+ applications, images, and kernels.
+ An SDK can even be used by a QA Engineer or Release Engineer.
+ The fundamental concept is that the machine that has the SDK installed
+ does not have to be associated with the machine that has the
+ Yocto Project installed.
+ A developer can independently compile and test an object on their
+ machine and then, when the object is ready for integration into an
+ image, they can simply make it available to the machine that has the
+ Yocto Project.
+ Once the object is available, the image can be rebuilt using the
+ Yocto Project to produce the modified image.
+ </para>
+
+ <para>
+ You just need to follow these general steps:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Install the SDK for your target hardware:</emphasis>
+ For information on how to install the SDK, see the
+ "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
+ section.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Download or Build the Target Image:</emphasis>
+ The Yocto Project supports several target architectures
+ and has many pre-built kernel images and root filesystem
+ images.</para>
+
+ <para>If you are going to develop your application on
+ hardware, go to the
+ <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink>
+ download area and choose a target machine area
+ from which to download the kernel image and root filesystem.
+ This download area could have several files in it that
+ support development using actual hardware.
+ For example, the area might contain
+ <filename>.hddimg</filename> files that combine the
+ kernel image with the filesystem, boot loaders, and
+ so forth.
+ Be sure to get the files you need for your particular
+ development process.</para>
+
+ <para>If you are going to develop your application and
+ then run and test it using the QEMU emulator, go to the
+ <ulink url='&YOCTO_QEMU_DL_URL;'><filename>machines/qemu</filename></ulink>
+ download area.
+ From this area, go down into the directory for your
+ target architecture (e.g. <filename>qemux86_64</filename>
+ for an <trademark class='registered'>Intel</trademark>-based
+ 64-bit architecture).
+ Download the kernel, root filesystem, and any other files you
+ need for your process.
+ <note>
+ To use the root filesystem in QEMU, you need to extract it.
+ See the
+ "<link linkend='sdk-extracting-the-root-filesystem'>Extracting the Root Filesystem</link>"
+ section for information on how to extract the root
+ filesystem.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Develop and Test your Application:</emphasis>
+ At this point, you have the tools to develop your application.
+ If you need to separately install and use the QEMU emulator,
+ you can go to
+ <ulink url='http://wiki.qemu.org/Main_Page'>QEMU Home Page</ulink>
+ to download and learn about the emulator.
+ See the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
+ chapter in the Yocto Project Development Tasks Manual
+ for information on using QEMU within the Yocto
+ Project.
+ </para></listitem>
+ </orderedlist>
+ </para>
+
+ <para>
+ The remainder of this manual describes how to use the extensible
+ and standard SDKs.
+ Information also exists in appendix form that describes how you can
+ build, install, and modify an SDK.
+ </para>
+</section>
+
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-manual-customization.xsl b/poky/documentation/sdk-manual/sdk-manual-customization.xsl
new file mode 100644
index 000000000..efa8a84bb
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-manual-customization.xsl
@@ -0,0 +1,26 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'sdk-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel">A</xsl:param>
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl b/poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl
new file mode 100644
index 000000000..77ba5f571
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-manual-eclipse-customization.xsl
@@ -0,0 +1,35 @@
+<?xml version='1.0'?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/eclipse/eclipse3.xsl" />
+
+ <xsl:import
+ href="http://docbook.sourceforge.net/release/xsl/1.76.1/eclipse/eclipse3.xsl" />
+
+-->
+
+ <xsl:param name="chunker.output.indent" select="'yes'"/>
+ <xsl:param name="chunk.quietly" select="1"/>
+ <xsl:param name="chunk.first.sections" select="1"/>
+ <xsl:param name="chunk.section.depth" select="10"/>
+ <xsl:param name="use.id.as.filename" select="1"/>
+ <xsl:param name="ulink.target" select="'_self'" />
+ <xsl:param name="base.dir" select="'html/adt-manual/'"/>
+ <xsl:param name="html.stylesheet" select="'../book.css'"/>
+ <xsl:param name="eclipse.manifest" select="0"/>
+ <xsl:param name="create.plugin.xml" select="0"/>
+ <xsl:param name="suppress.navigation" select="1"/>
+ <xsl:param name="generate.index" select="0"/>
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="1" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+</xsl:stylesheet>
diff --git a/poky/documentation/sdk-manual/sdk-manual.xml b/poky/documentation/sdk-manual/sdk-manual.xml
new file mode 100644
index 000000000..e858b9b1c
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-manual.xml
@@ -0,0 +1,141 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='sdk-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/sdk-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Yocto Project Application Development and the Extensible Software Development Kit (eSDK)
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Scott</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>srifenbark@gmail.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</emphasis>
+ manual is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="sdk-intro.xml"/>
+
+ <xi:include href="sdk-extensible.xml"/>
+
+ <xi:include href="sdk-using.xml"/>
+
+ <xi:include href="sdk-working-projects.xml"/>
+
+ <xi:include href="sdk-eclipse-project.xml"/>
+
+ <xi:include href="sdk-appendix-obtain.xml"/>
+
+ <xi:include href="sdk-appendix-customizing.xml"/>
+
+ <xi:include href="sdk-appendix-customizing-standard.xml"/>
+
+ <xi:include href="sdk-appendix-neon.xml"/>
+
+<!-- <index id='index'>
+ <title>Index</title>
+ </index>
+-->
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-style.css b/poky/documentation/sdk-manual/sdk-style.css
new file mode 100644
index 000000000..52518964c
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-style.css
@@ -0,0 +1,988 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/sdk-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.writernotes {
+ color: #ff0000;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/sdk-manual/sdk-using.xml b/poky/documentation/sdk-manual/sdk-using.xml
new file mode 100644
index 000000000..dd220c340
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-using.xml
@@ -0,0 +1,205 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='sdk-using-the-standard-sdk'>
+ <title>Using the Standard SDK</title>
+
+ <para>
+ This chapter describes the standard SDK and how to install it.
+ Information includes unique installation and setup aspects for the
+ standard SDK.
+ <note>
+ For a side-by-side comparison of main features supported for a
+ standard SDK as compared to an extensible SDK, see the
+ "<link linkend='sdk-manual-intro'>Introduction</link>"
+ section.
+ </note>
+ </para>
+
+ <para>
+ You can use a standard SDK to work on Makefile, Autotools, and
+ <trademark class='trade'>Eclipse</trademark>-based projects.
+ See the
+ "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>"
+ chapter for more information.
+ </para>
+
+ <section id='sdk-standard-sdk-intro'>
+ <title>Why use the Standard SDK and What is in It?</title>
+
+ <para>
+ The Standard SDK provides a cross-development toolchain and
+ libraries tailored to the contents of a specific image.
+ You would use the Standard SDK if you want a more traditional
+ toolchain experience as compared to the extensible SDK, which
+ provides an internal build system and the
+ <filename>devtool</filename> functionality.
+ </para>
+
+ <para>
+ The installed Standard SDK consists of several files and
+ directories.
+ Basically, it contains an SDK environment setup script, some
+ configuration files, and host and target root filesystems to
+ support usage.
+ You can see the directory structure in the
+ "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
+ section.
+ </para>
+ </section>
+
+ <section id='sdk-installing-the-sdk'>
+ <title>Installing the SDK</title>
+
+ <para>
+ The first thing you need to do is install the SDK on your
+ <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink>
+ by running the <filename>*.sh</filename> installation script.
+ </para>
+
+ <para>
+ You can download a tarball installer, which includes the
+ pre-built toolchain, the <filename>runqemu</filename>
+ script, and support files from the appropriate
+ <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink>
+ directory within the Index of Releases.
+ Toolchains are available for several 32-bit and 64-bit
+ architectures with the <filename>x86_64</filename> directories,
+ respectively.
+ The toolchains the Yocto Project provides are based off the
+ <filename>core-image-sato</filename> and
+ <filename>core-image-minimal</filename> images and contain
+ libraries appropriate for developing against that image.
+ </para>
+
+ <para>
+ The names of the tarball installer scripts are such that a
+ string representing the host system appears first in the
+ filename and then is immediately followed by a string
+ representing the target architecture.
+ <literallayout class='monospaced'>
+ poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-<replaceable>release_version</replaceable>.sh
+
+ Where:
+ <replaceable>host_system</replaceable> is a string representing your development system:
+
+ i686 or x86_64.
+
+ <replaceable>image_type</replaceable> is the image for which the SDK was built:
+
+ core-image-minimal or core-image-sato.
+
+ <replaceable>arch</replaceable> is a string representing the tuned target architecture:
+
+ aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
+
+ <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project:
+
+ &DISTRO;, &DISTRO;+snapshot
+ </literallayout>
+ For example, the following SDK installer is for a 64-bit
+ development host system and a i586-tuned target architecture
+ based off the SDK for <filename>core-image-sato</filename> and
+ using the current &DISTRO; snapshot:
+ <literallayout class='monospaced'>
+ poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ </literallayout>
+ <note>
+ As an alternative to downloading an SDK, you can build the
+ SDK installer.
+ For information on building the installer, see the
+ "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>"
+ section.
+ Another helpful resource for building an installer is the
+ <ulink url='https://wiki.yoctoproject.org/wiki/TipsAndTricks/RunningEclipseAgainstBuiltImage'>Cookbook guide to Making an Eclipse Debug Capable Image</ulink>
+ wiki page.
+ This wiki page focuses on development when using the Eclipse
+ IDE.
+ </note>
+ </para>
+
+ <para>
+ The SDK and toolchains are self-contained and by default are
+ installed into the <filename>poky_sdk</filename> folder in your
+ home directory.
+ You can choose to install the extensible SDK in any location when
+ you run the installer.
+ However, because files need to be written under that directory
+ during the normal course of operation, the location you choose
+ for installation must be writable for whichever
+ users need to use the SDK.
+ </para>
+
+ <para>
+ The following command shows how to run the installer given a
+ toolchain tarball for a 64-bit x86 development host system and
+ a 64-bit x86 target architecture.
+ The example assumes the SDK installer is located in
+ <filename>~/Downloads/</filename> and has execution rights.
+ <note>
+ If you do not have write permissions for the directory
+ into which you are installing the SDK, the installer
+ notifies you and exits.
+ For that case, set up the proper permissions in the directory
+ and run the installer again.
+ </note>
+ <literallayout class='monospaced'>
+ $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
+ Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
+ ===============================================================
+ Enter target directory for SDK (default: /opt/poky/&DISTRO;):
+ You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed[Y/n]? Y
+ Extracting SDK........................................ ..............................done
+ Setting it up...done
+ SDK has been successfully set up and is ready to be used.
+ Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
+ $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ </literallayout>
+ </para>
+
+ <para>
+ Again, reference the
+ "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>"
+ section for more details on the resulting directory structure of
+ the installed SDK.
+ </para>
+ </section>
+
+ <section id='sdk-running-the-sdk-environment-setup-script'>
+ <title>Running the SDK Environment Setup Script</title>
+
+ <para>
+ Once you have the SDK installed, you must run the SDK environment
+ setup script before you can actually use the SDK.
+ This setup script resides in the directory you chose when you
+ installed the SDK, which is either the default
+ <filename>/opt/poky/&DISTRO;</filename> directory or the directory
+ you chose during installation.
+ </para>
+
+ <para>
+ Before running the script, be sure it is the one that matches the
+ architecture for which you are developing.
+ Environment setup scripts begin with the string
+ "<filename>environment-setup</filename>" and include as part of
+ their name the tuned target architecture.
+ As an example, the following commands set the working directory
+ to where the SDK was installed and then source the environment
+ setup script.
+ In this example, the setup script is for an IA-based
+ target machine using i586 tuning:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ </literallayout>
+ When you run the setup script, the same environment variables are
+ defined as are when you run the setup script for an extensible SDK.
+ See the
+ "<link linkend='sdk-running-the-extensible-sdk-environment-setup-script'>Running the Extensible SDK Environment Setup Script</link>"
+ section for more information.
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/sdk-manual/sdk-working-projects.xml b/poky/documentation/sdk-manual/sdk-working-projects.xml
new file mode 100644
index 000000000..d8cc4229d
--- /dev/null
+++ b/poky/documentation/sdk-manual/sdk-working-projects.xml
@@ -0,0 +1,514 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='sdk-working-projects'>
+
+ <title>Using the SDK Toolchain Directly</title>
+
+ <para>
+ You can use the SDK toolchain directly with Makefile,
+ Autotools, and <trademark class='trade'>Eclipse</trademark>-based
+ projects.
+ This chapter covers the first two, while the
+ "<link linkend='sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></link>"
+ Chapter covers the latter.
+ </para>
+
+ <section id='autotools-based-projects'>
+ <title>Autotools-Based Projects</title>
+
+ <para>
+ Once you have a suitable
+ <ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain'>cross-development toolchain</ulink>
+ installed, it is very easy to develop a project using the
+ <ulink url='https://en.wikipedia.org/wiki/GNU_Build_System'>GNU Autotools-based</ulink>
+ workflow, which is outside of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ </para>
+
+ <para>
+ The following figure presents a simple Autotools workflow.
+ <imagedata fileref="figures/sdk-autotools-flow.png" width="7in" height="8in" align="center" />
+ </para>
+
+ <para>
+ Follow these steps to create a simple Autotools-based
+ "Hello World" project:
+ <note>
+ For more information on the GNU Autotools workflow,
+ see the same example on the
+ <ulink url='https://developer.gnome.org/anjuta-build-tutorial/stable/create-autotools.html.en'>GNOME Developer</ulink>
+ site.
+ </note>
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create a Working Directory and Populate It:</emphasis>
+ Create a clean directory for your project and then make
+ that directory your working location.
+ <literallayout class='monospaced'>
+ $ mkdir $HOME/helloworld
+ $ cd $HOME/helloworld
+ </literallayout>
+ After setting up the directory, populate it with files
+ needed for the flow.
+ You need a project source file, a file to help with
+ configuration, and a file to help create the Makefile,
+ and a README file:
+ <filename>hello.c</filename>,
+ <filename>configure.ac</filename>,
+ <filename>Makefile.am</filename>, and
+ <filename>README</filename>, respectively.</para>
+
+ <para> Use the following command to create an empty README
+ file, which is required by GNU Coding Standards:
+ <literallayout class='monospaced'>
+ $ touch README
+ </literallayout>
+ Create the remaining three files as follows:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>hello.c</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ #include &lt;stdio.h&gt;
+
+ main()
+ {
+ printf("Hello World!\n");
+ }
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>configure.ac</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ AC_INIT(hello,0.1)
+ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_FILES(Makefile)
+ AC_OUTPUT
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>Makefile.am</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ bin_PROGRAMS = hello
+ hello_SOURCES = hello.c
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Source the Cross-Toolchain
+ Environment Setup File:</emphasis>
+ As described earlier in the manual, installing the
+ cross-toolchain creates a cross-toolchain
+ environment setup script in the directory that the SDK
+ was installed.
+ Before you can use the tools to develop your project,
+ you must source this setup script.
+ The script begins with the string "environment-setup"
+ and contains the machine architecture, which is
+ followed by the string "poky-linux".
+ For this example, the command sources a script from the
+ default SDK installation directory that uses the
+ 32-bit Intel x86 Architecture and the
+ &DISTRO_NAME; Yocto Project release:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the <filename>configure</filename> Script:</emphasis>
+ Use the <filename>autoreconf</filename> command to
+ generate the <filename>configure</filename> script.
+ <literallayout class='monospaced'>
+ $ autoreconf
+ </literallayout>
+ The <filename>autoreconf</filename> tool takes care
+ of running the other Autotools such as
+ <filename>aclocal</filename>,
+ <filename>autoconf</filename>, and
+ <filename>automake</filename>.
+ <note>
+ If you get errors from
+ <filename>configure.ac</filename>, which
+ <filename>autoreconf</filename> runs, that indicate
+ missing files, you can use the "-i" option, which
+ ensures missing auxiliary files are copied to the build
+ host.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Cross-Compile the Project:</emphasis>
+ This command compiles the project using the
+ cross-compiler.
+ The
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CONFIGURE_FLAGS'><filename>CONFIGURE_FLAGS</filename></ulink>
+ environment variable provides the minimal arguments for
+ GNU configure:
+ <literallayout class='monospaced'>
+ $ ./configure ${CONFIGURE_FLAGS}
+ </literallayout>
+ For an Autotools-based project, you can use the
+ cross-toolchain by just passing the appropriate host
+ option to <filename>configure.sh</filename>.
+ The host option you use is derived from the name of the
+ environment setup script found in the directory in which
+ you installed the cross-toolchain.
+ For example, the host option for an ARM-based target that
+ uses the GNU EABI is
+ <filename>armv5te-poky-linux-gnueabi</filename>.
+ You will notice that the name of the script is
+ <filename>environment-setup-armv5te-poky-linux-gnueabi</filename>.
+ Thus, the following command works to update your project
+ and rebuild it using the appropriate cross-toolchain tools:
+ <literallayout class='monospaced'>
+ $ ./configure --host=armv5te-poky-linux-gnueabi --with-libtool-sysroot=<replaceable>sysroot_dir</replaceable>
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make and Install the Project:</emphasis>
+ These two commands generate and install the project
+ into the destination directory:
+ <literallayout class='monospaced'>
+ $ make
+ $ make install DESTDIR=./tmp
+ </literallayout>
+ <note>
+ To learn about environment variables established
+ when you run the cross-toolchain environment setup
+ script and how they are used or overridden when
+ the Makefile, see the
+ "<link linkend='makefile-based-projects'>Makefile-Based Projects</link>"
+ section.
+ </note>
+ This next command is a simple way to verify the
+ installation of your project.
+ Running the command prints the architecture on which
+ the binary file can run.
+ This architecture should be the same architecture that
+ the installed cross-toolchain supports.
+ <literallayout class='monospaced'>
+ $ file ./tmp/usr/local/bin/hello
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Execute Your Project:</emphasis>
+ To execute the project, you would need to run it on your
+ target hardware.
+ If your target hardware happens to be your build host,
+ you could run the project as follows:
+ <literallayout class='monospaced'>
+ $ ./tmp/usr/local/bin/hello
+ </literallayout>
+ As expected, the project displays the "Hello World!"
+ message.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+
+ <section id='makefile-based-projects'>
+ <title>Makefile-Based Projects</title>
+
+ <para>
+ Simple Makefile-based projects use and interact with the
+ cross-toolchain environment variables established when you run
+ the cross-toolchain environment setup script.
+ The environment variables are subject to general
+ <filename>make</filename> rules.
+ </para>
+
+ <para>
+ This section presents a simple Makefile development flow and
+ provides an example that lets you see how you can use
+ cross-toolchain environment variables and Makefile variables
+ during development.
+ <imagedata fileref="figures/sdk-makefile-flow.png" width="6in" height="7in" align="center" />
+ </para>
+
+ <para>
+ The main point of this section is to explain the following three
+ cases regarding variable behavior:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis>Case 1 - No Variables Set in the
+ <filename>Makefile</filename> Map to Equivalent
+ Environment Variables Set in the SDK Setup Script:</emphasis>
+ Because matching variables are not specifically set in the
+ <filename>Makefile</filename>, the variables retain their
+ values based on the environment setup script.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Case 2 - Variables Are Set in the Makefile that
+ Map to Equivalent Environment Variables from the SDK
+ Setup Script:</emphasis>
+ Specifically setting matching variables in the
+ <filename>Makefile</filename> during the build results in
+ the environment settings of the variables being
+ overwritten.
+ In this case, the variables you set in the
+ <filename>Makefile</filename> are used.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Case 3 - Variables Are Set Using the Command Line
+ that Map to Equivalent Environment Variables from the
+ SDK Setup Script:</emphasis>
+ Executing the <filename>Makefile</filename> from the
+ command line results in the environment variables being
+ overwritten.
+ In this case, the command-line content is used.
+ </para></listitem>
+ </itemizedlist>
+ <note>
+ Regardless of how you set your variables, if you use
+ the "-e" option with <filename>make</filename>, the
+ variables from the SDK setup script take precedence:
+ <literallayout class='monospaced'>
+ $ make -e <replaceable>target</replaceable>
+ </literallayout>
+ </note>
+ </para>
+
+ <para>
+ The remainder of this section presents a simple Makefile example
+ that demonstrates these variable behaviors.
+ </para>
+
+ <para>
+ In a new shell environment variables are not established for the
+ SDK until you run the setup script.
+ For example, the following commands show a null value for the
+ compiler variable (i.e.
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>).
+ <literallayout class='monospaced'>
+ $ echo ${CC}
+
+ $
+ </literallayout>
+ Running the SDK setup script for a 64-bit build host and an
+ i586-tuned target architecture for a
+ <filename>core-image-sato</filename> image using the current
+ &DISTRO; Yocto Project release and then echoing that variable
+ shows the value established through the script:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ $ echo ${CC}
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux
+ </literallayout>
+ </para>
+
+ <para>
+ To illustrate variable use, work through this simple "Hello World!"
+ example:
+ <orderedlist>
+ <listitem><para>
+ <emphasis>Create a Working Directory and Populate It:</emphasis>
+ Create a clean directory for your project and then make
+ that directory your working location.
+ <literallayout class='monospaced'>
+ $ mkdir $HOME/helloworld
+ $ cd $HOME/helloworld
+ </literallayout>
+ After setting up the directory, populate it with files
+ needed for the flow.
+ You need a <filename>main.c</filename> file from which you
+ call your function, a <filename>module.h</filename> file
+ to contain headers, and a <filename>module.c</filename>
+ that defines your function.
+ </para>
+
+ <para>Create the three files as follows:
+ <itemizedlist>
+ <listitem><para>
+ <emphasis><filename>main.c</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ #include "module.h"
+ void sample_func();
+ int main()
+ {
+ sample_func();
+ return 0;
+ }
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>module.h</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ #include &lt;stdio.h&gt;
+ void sample_func();
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis><filename>module.c</filename>:</emphasis>
+ <literallayout class='monospaced'>
+ #include "module.h"
+ void sample_func()
+ {
+ printf("Hello World!");
+ printf("\n");
+ }
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Source the Cross-Toolchain Environment Setup File:</emphasis>
+ As described earlier in the manual, installing the
+ cross-toolchain creates a cross-toolchain environment setup
+ script in the directory that the SDK was installed.
+ Before you can use the tools to develop your project,
+ you must source this setup script.
+ The script begins with the string "environment-setup"
+ and contains the machine architecture, which is
+ followed by the string "poky-linux".
+ For this example, the command sources a script from the
+ default SDK installation directory that uses the
+ 32-bit Intel x86 Architecture and the
+ &DISTRO_NAME; Yocto Project release:
+ <literallayout class='monospaced'>
+ $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Create the <filename>Makefile</filename>:</emphasis>
+ For this example, the Makefile contains two lines that
+ can be used to set the <filename>CC</filename> variable.
+ One line is identical to the value that is set when you
+ run the SDK environment setup script, and the other line
+ sets <filename>CC</filename> to "gcc", the default GNU
+ compiler on the build host:
+ <literallayout class='monospaced'>
+ # CC=i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux
+ # CC="gcc"
+ all: main.o module.o
+ ${CC} main.o module.o -o target_bin
+ main.o: main.c module.h
+ ${CC} -I . -c main.c
+ module.o: module.c module.h
+ ${CC} -I . -c module.c
+ clean:
+ rm -rf *.o
+ rm target_bin
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Make the Project:</emphasis>
+ Use the <filename>make</filename> command to create the
+ binary output file.
+ Because variables are commented out in the Makefile,
+ the value used for <filename>CC</filename> is the value
+ set when the SDK environment setup file was run:
+ <literallayout class='monospaced'>
+ $ make
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
+ </literallayout>
+ From the results of the previous command, you can see that
+ the compiler used was the compiler established through
+ the <filename>CC</filename> variable defined in the
+ setup script.</para>
+
+ <para>You can override the <filename>CC</filename>
+ environment variable with the same variable as set from
+ the Makefile by uncommenting the line in the Makefile
+ and running <filename>make</filename> again.
+ <literallayout class='monospaced'>
+ $ make clean
+ rm -rf *.o
+ rm target_bin
+ #
+ # Edit the Makefile by uncommenting the line that sets CC to "gcc"
+ #
+ $ make
+ gcc -I . -c main.c
+ gcc -I . -c module.c
+ gcc main.o module.o -o target_bin
+ </literallayout>
+ As shown in the previous example, the cross-toolchain
+ compiler is not used.
+ Rather, the default compiler is used.</para>
+
+ <para>This next case shows how to override a variable
+ by providing the variable as part of the command line.
+ Go into the Makefile and re-insert the comment character
+ so that running <filename>make</filename> uses
+ the established SDK compiler.
+ However, when you run <filename>make</filename>, use a
+ command-line argument to set <filename>CC</filename>
+ to "gcc":
+ <literallayout class='monospaced'>
+ $ make clean
+ rm -rf *.o
+ rm target_bin
+ #
+ # Edit the Makefile to comment out the line setting CC to "gcc"
+ #
+ $ make
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
+ $ make clean
+ rm -rf *.o
+ rm target_bin
+ $ make CC="gcc"
+ gcc -I . -c main.c
+ gcc -I . -c module.c
+ gcc main.o module.o -o target_bin
+ </literallayout>
+ In the previous case, the command-line argument overrides
+ the SDK environment variable.</para>
+
+ <para>In this last case, edit Makefile again to use the
+ "gcc" compiler but then use the "-e" option on the
+ <filename>make</filename> command line:
+ <literallayout class='monospaced'>
+ $ make clean
+ rm -rf *.o
+ rm target_bin
+ #
+ # Edit the Makefile to use "gcc"
+ #
+ $ make
+ gcc -I . -c main.c
+ gcc -I . -c module.c
+ gcc main.o module.o -o target_bin
+ $ make clean
+ rm -rf *.o
+ rm target_bin
+ $ make -e
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c main.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux -I . -c module.c
+ i586-poky-linux-gcc -m32 -march=i586 --sysroot=/opt/poky/2.5/sysroots/i586-poky-linux main.o module.o -o target_bin
+ </literallayout>
+ In the previous case, the "-e" option forces
+ <filename>make</filename> to use the SDK environment
+ variables regardless of the values in the Makefile.
+ </para></listitem>
+ <listitem><para>
+ <emphasis>Execute Your Project:</emphasis>
+ To execute the project (i.e.
+ <filename>target_bin</filename>), use the following
+ command:
+ <literallayout class='monospaced'>
+ $ ./target_bin
+ Hello World!
+ </literallayout>
+ <note>
+ If you used the cross-toolchain compiler to build
+ <filename>target_bin</filename> and your build host
+ differs in architecture from that of the target
+ machine, you need to run your project on the target
+ device.
+ </note>
+ As expected, the project displays the "Hello World!"
+ message.
+ </para></listitem>
+ </orderedlist>
+ </para>
+ </section>
+</chapter>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/template/Vera.ttf b/poky/documentation/template/Vera.ttf
new file mode 100644
index 000000000..58cd6b5e6
--- /dev/null
+++ b/poky/documentation/template/Vera.ttf
Binary files differ
diff --git a/poky/documentation/template/Vera.xml b/poky/documentation/template/Vera.xml
new file mode 100644
index 000000000..3c82043e3
--- /dev/null
+++ b/poky/documentation/template/Vera.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics type="TYPE0"><font-name>BitstreamVeraSans</font-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>928</ascender><descender>-235</descender><bbox><left>-183</left><bottom>-235</bottom><right>1287</right><top>928</top></bbox><flags>32</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="600"/><wx w="0"/><wx w="317"/><wx w="317"/><wx w="400"/><wx w="459"/><wx w="837"/><wx w="636"/><wx w="950"/><wx w="779"/><wx w="274"/><wx w="390"/><wx w="390"/><wx w="500"/><wx w="837"/><wx w="317"/><wx w="360"/><wx w="317"/><wx w="336"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="636"/><wx w="336"/><wx w="336"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="530"/><wx w="1000"/><wx w="684"/><wx w="686"/><wx w="698"/><wx w="770"/><wx w="631"/><wx w="575"/><wx w="774"/><wx w="751"/><wx w="294"/><wx w="294"/><wx w="655"/><wx w="557"/><wx w="862"/><wx w="748"/><wx w="787"/><wx w="603"/><wx w="787"/><wx w="694"/><wx w="634"/><wx w="610"/><wx w="731"/><wx w="684"/><wx w="988"/><wx w="685"/><wx w="610"/><wx w="685"/><wx w="390"/><wx w="336"/><wx w="390"/><wx w="837"/><wx w="500"/><wx w="500"/><wx w="612"/><wx w="634"/><wx w="549"/><wx w="634"/><wx w="615"/><wx w="352"/><wx w="634"/><wx w="633"/><wx w="277"/><wx w="277"/><wx w="579"/><wx w="277"/><wx w="974"/><wx w="633"/><wx w="611"/><wx w="634"/><wx w="634"/><wx w="411"/><wx w="520"/><wx w="392"/><wx w="633"/><wx w="591"/><wx w="817"/><wx w="591"/><wx w="591"/><wx w="524"/><wx w="636"/><wx w="336"/><wx w="636"/><wx w="837"/><wx w="684"/><wx w="684"/><wx w="698"/><wx w="631"/><wx w="748"/><wx w="787"/><wx w="731"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="612"/><wx w="549"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="615"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="277"/><wx w="633"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="611"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="633"/><wx w="500"/><wx w="500"/><wx w="636"/><wx w="636"/><wx w="500"/><wx w="589"/><wx w="636"/><wx w="629"/><wx w="1000"/><wx w="1000"/><wx w="1000"/><wx w="500"/><wx w="500"/><wx w="837"/><wx w="974"/><wx w="787"/><wx w="833"/><wx w="837"/><wx w="837"/><wx w="837"/><wx w="636"/><wx w="636"/><wx w="517"/><wx w="673"/><wx w="756"/><wx w="588"/><wx w="520"/><wx w="471"/><wx w="471"/><wx w="764"/><wx w="981"/><wx w="611"/><wx w="530"/><wx w="400"/><wx w="837"/><wx w="637"/><wx w="636"/><wx w="837"/><wx w="668"/><wx w="611"/><wx w="611"/><wx w="1000"/><wx w="636"/><wx w="684"/><wx w="684"/><wx w="787"/><wx w="1069"/><wx w="1022"/><wx w="500"/><wx w="1000"/><wx w="518"/><wx w="518"/><wx w="317"/><wx w="317"/><wx w="837"/><wx w="494"/><wx w="591"/><wx w="610"/><wx w="166"/><wx w="636"/><wx w="399"/><wx w="399"/><wx w="629"/><wx w="629"/><wx w="500"/><wx w="317"/><wx w="317"/><wx w="518"/><wx w="1341"/><wx w="684"/><wx w="631"/><wx w="684"/><wx w="631"/><wx w="631"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="294"/><wx w="787"/><wx w="787"/><wx w="787"/><wx w="731"/><wx w="731"/><wx w="731"/><wx w="277"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="562"/><wx w="284"/><wx w="634"/><wx w="520"/><wx w="685"/><wx w="524"/><wx w="336"/><wx w="774"/><wx w="611"/><wx w="610"/><wx w="591"/><wx w="604"/><wx w="634"/><wx w="837"/><wx w="837"/><wx w="400"/><wx w="400"/><wx w="400"/><wx w="969"/><wx w="969"/><wx w="969"/><wx w="774"/><wx w="634"/><wx w="294"/><wx w="634"/><wx w="520"/><wx w="698"/><wx w="549"/><wx w="698"/><wx w="549"/><wx w="634"/><wx w="360"/><wx w="317"/><wx w="636"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="500"/><wx w="400"/><wx w="500"/><wx w="500"/></cid-widths></multibyte-extras><kerning kpx1="246"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="235"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="43"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-35" kpx2="197"/><pair kern="-30" kpx2="181"/></kerning><kerning kpx1="16"><pair kern="36" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-21" kpx2="199"/><pair kern="18" kpx2="123"/><pair kern="27" kpx2="208"/><pair kern="-118" kpx2="187"/><pair kern="-49" kpx2="59"/><pair kern="18" kpx2="124"/><pair kern="-21" kpx2="201"/><pair kern="-118" kpx2="60"/><pair kern="36" kpx2="52"/><pair kern="18" kpx2="125"/><pair kern="36" kpx2="42"/><pair kern="-118" kpx2="234"/><pair kern="18" kpx2="122"/><pair kern="27" kpx2="210"/><pair kern="-21" kpx2="36"/><pair kern="18" kpx2="82"/><pair kern="-40" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="27" kpx2="175"/><pair kern="27" kpx2="50"/><pair kern="27" kpx2="209"/><pair kern="27" kpx2="103"/><pair kern="-21" kpx2="98"/><pair kern="55" kpx2="45"/><pair kern="-21" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-26" kpx2="89"/><pair kern="18" kpx2="121"/><pair kern="-58" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-21" kpx2="174"/></kerning><kerning kpx1="112"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="123"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="251"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="213"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="208"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="187"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="113"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="144"><pair kern="-40" kpx2="180"/><pair kern="-54" kpx2="197"/><pair kern="-44" kpx2="181"/></kerning><kerning kpx1="59"><pair kern="-72" kpx2="100"/><pair kern="-63" kpx2="210"/><pair kern="-17" kpx2="55"/><pair kern="-44" kpx2="114"/><pair kern="-44" kpx2="72"/><pair kern="-63" kpx2="175"/><pair kern="-49" kpx2="16"/><pair kern="-63" kpx2="50"/><pair kern="-63" kpx2="209"/><pair kern="-44" kpx2="112"/><pair kern="-72" kpx2="251"/><pair kern="-63" kpx2="103"/><pair kern="-63" kpx2="208"/><pair kern="-44" kpx2="113"/><pair kern="-40" kpx2="181"/><pair kern="-77" kpx2="180"/><pair kern="-54" kpx2="169"/><pair kern="-21" kpx2="197"/><pair kern="-72" kpx2="38"/><pair kern="-72" kpx2="253"/><pair kern="-44" kpx2="115"/></kerning><kerning kpx1="73"><pair kern="31" kpx2="180"/><pair kern="-17" kpx2="90"/><pair kern="-72" kpx2="17"/><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="169"/><pair kern="-114" kpx2="197"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="87"/><pair kern="-54" kpx2="16"/><pair kern="-35" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="41"><pair kern="-17" kpx2="227"/><pair kern="-54" kpx2="126"/><pair kern="-91" kpx2="107"/><pair kern="-91" kpx2="235"/><pair kern="-54" kpx2="72"/><pair kern="-91" kpx2="199"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="112"/><pair kern="-54" kpx2="113"/><pair kern="-17" kpx2="54"/><pair kern="-21" kpx2="180"/><pair kern="-91" kpx2="105"/><pair kern="-54" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-91" kpx2="201"/><pair kern="-72" kpx2="85"/><pair kern="-91" kpx2="106"/><pair kern="-77" kpx2="29"/><pair kern="-35" kpx2="125"/><pair kern="-54" kpx2="115"/><pair kern="-54" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-91" kpx2="68"/><pair kern="-91" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-91" kpx2="186"/><pair kern="-17" kpx2="55"/><pair kern="-54" kpx2="114"/><pair kern="-54" kpx2="127"/><pair kern="-91" kpx2="108"/><pair kern="-91" kpx2="98"/><pair kern="-72" kpx2="76"/><pair kern="-160" kpx2="17"/><pair kern="-54" kpx2="128"/><pair kern="-91" kpx2="173"/><pair kern="-91" kpx2="109"/><pair kern="-183" kpx2="197"/><pair kern="-91" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-91" kpx2="110"/><pair kern="-91" kpx2="174"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="124"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="169"><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="235"/><pair kern="-17" kpx2="58"/><pair kern="-17" kpx2="186"/><pair kern="-54" kpx2="55"/><pair kern="-17" kpx2="251"/><pair kern="-72" kpx2="187"/><pair kern="-17" kpx2="39"/><pair kern="73" kpx2="144"/><pair kern="-17" kpx2="45"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-72" kpx2="60"/><pair kern="-17" kpx2="89"/><pair kern="-17" kpx2="253"/><pair kern="-54" kpx2="57"/><pair kern="-17" kpx2="37"/><pair kern="-17" kpx2="42"/><pair kern="-72" kpx2="234"/></kerning><kerning kpx1="201"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="60"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="85"><pair kern="-21" kpx2="254"/><pair kern="-21" kpx2="72"/><pair kern="-63" kpx2="16"/><pair kern="-21" kpx2="112"/><pair kern="-21" kpx2="123"/><pair kern="-17" kpx2="80"/><pair kern="-21" kpx2="113"/><pair kern="-17" kpx2="71"/><pair kern="-21" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-21" kpx2="252"/><pair kern="-21" kpx2="70"/><pair kern="-17" kpx2="85"/><pair kern="-17" kpx2="29"/><pair kern="-21" kpx2="125"/><pair kern="-21" kpx2="115"/><pair kern="-21" kpx2="111"/><pair kern="-21" kpx2="122"/><pair kern="-21" kpx2="82"/><pair kern="-17" kpx2="75"/><pair kern="-21" kpx2="114"/><pair kern="-26" kpx2="91"/><pair kern="-17" kpx2="81"/><pair kern="41" kpx2="181"/><pair kern="-91" kpx2="17"/><pair kern="-151" kpx2="197"/><pair kern="-17" kpx2="74"/><pair kern="-17" kpx2="84"/><pair kern="-21" kpx2="121"/><pair kern="-17" kpx2="247"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="61"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="234"><pair kern="-114" kpx2="126"/><pair kern="-137" kpx2="107"/><pair kern="-132" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-118" kpx2="16"/><pair kern="-132" kpx2="123"/><pair kern="-132" kpx2="112"/><pair kern="-54" kpx2="251"/><pair kern="-54" kpx2="208"/><pair kern="-132" kpx2="113"/><pair kern="-54" kpx2="180"/><pair kern="-137" kpx2="105"/><pair kern="-114" kpx2="129"/><pair kern="-132" kpx2="124"/><pair kern="-109" kpx2="169"/><pair kern="-77" kpx2="201"/><pair kern="-54" kpx2="253"/><pair kern="-137" kpx2="106"/><pair kern="-132" kpx2="29"/><pair kern="-132" kpx2="125"/><pair kern="-72" kpx2="170"/><pair kern="-132" kpx2="115"/><pair kern="-114" kpx2="88"/><pair kern="-132" kpx2="122"/><pair kern="-54" kpx2="100"/><pair kern="-137" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-77" kpx2="36"/><pair kern="-132" kpx2="82"/><pair kern="-132" kpx2="114"/><pair kern="-54" kpx2="175"/><pair kern="-114" kpx2="127"/><pair kern="-54" kpx2="50"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-137" kpx2="108"/><pair kern="-77" kpx2="98"/><pair kern="-35" kpx2="76"/><pair kern="-17" kpx2="181"/><pair kern="-202" kpx2="17"/><pair kern="-114" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-137" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-54" kpx2="38"/><pair kern="-132" kpx2="121"/><pair kern="-137" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="100"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="122"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="47"><pair kern="-17" kpx2="126"/><pair kern="-91" kpx2="235"/><pair kern="-49" kpx2="104"/><pair kern="-17" kpx2="72"/><pair kern="22" kpx2="199"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-49" kpx2="213"/><pair kern="-35" kpx2="208"/><pair kern="-132" kpx2="187"/><pair kern="-17" kpx2="113"/><pair kern="-202" kpx2="180"/><pair kern="-17" kpx2="129"/><pair kern="-17" kpx2="124"/><pair kern="22" kpx2="201"/><pair kern="-132" kpx2="60"/><pair kern="-49" kpx2="211"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="115"/><pair kern="-132" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-17" kpx2="122"/><pair kern="-35" kpx2="210"/><pair kern="22" kpx2="36"/><pair kern="-17" kpx2="82"/><pair kern="-91" kpx2="58"/><pair kern="-91" kpx2="186"/><pair kern="-137" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-35" kpx2="175"/><pair kern="-17" kpx2="127"/><pair kern="-35" kpx2="50"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="22" kpx2="98"/><pair kern="-262" kpx2="181"/><pair kern="-17" kpx2="128"/><pair kern="22" kpx2="173"/><pair kern="-49" kpx2="212"/><pair kern="-91" kpx2="92"/><pair kern="-17" kpx2="121"/><pair kern="-109" kpx2="57"/><pair kern="22" kpx2="174"/><pair kern="-49" kpx2="56"/></kerning><kerning kpx1="210"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="58"><pair kern="-35" kpx2="126"/><pair kern="-63" kpx2="107"/><pair kern="-17" kpx2="235"/><pair kern="-58" kpx2="72"/><pair kern="-54" kpx2="199"/><pair kern="-40" kpx2="16"/><pair kern="-58" kpx2="112"/><pair kern="-58" kpx2="123"/><pair kern="-58" kpx2="113"/><pair kern="-17" kpx2="180"/><pair kern="-63" kpx2="105"/><pair kern="-35" kpx2="129"/><pair kern="-58" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-54" kpx2="201"/><pair kern="-44" kpx2="85"/><pair kern="-63" kpx2="106"/><pair kern="-58" kpx2="29"/><pair kern="-58" kpx2="125"/><pair kern="-17" kpx2="170"/><pair kern="-58" kpx2="115"/><pair kern="-35" kpx2="88"/><pair kern="-58" kpx2="122"/><pair kern="-63" kpx2="68"/><pair kern="-54" kpx2="36"/><pair kern="-58" kpx2="82"/><pair kern="-17" kpx2="186"/><pair kern="-58" kpx2="114"/><pair kern="-35" kpx2="127"/><pair kern="-63" kpx2="108"/><pair kern="-54" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-114" kpx2="17"/><pair kern="-35" kpx2="128"/><pair kern="-54" kpx2="173"/><pair kern="-63" kpx2="109"/><pair kern="-128" kpx2="197"/><pair kern="-17" kpx2="92"/><pair kern="-58" kpx2="121"/><pair kern="-63" kpx2="110"/><pair kern="-54" kpx2="174"/></kerning><kerning kpx1="82"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="186"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="175"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="209"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="103"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="81"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="98"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="212"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="229"><pair kern="-17" kpx2="180"/><pair kern="-17" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="38"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="121"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="57"><pair kern="-67" kpx2="126"/><pair kern="-77" kpx2="107"/><pair kern="-26" kpx2="235"/><pair kern="-77" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-58" kpx2="16"/><pair kern="-77" kpx2="123"/><pair kern="-77" kpx2="112"/><pair kern="-17" kpx2="208"/><pair kern="-77" kpx2="113"/><pair kern="-77" kpx2="105"/><pair kern="-67" kpx2="129"/><pair kern="-77" kpx2="124"/><pair kern="-86" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-77" kpx2="106"/><pair kern="-81" kpx2="29"/><pair kern="-77" kpx2="125"/><pair kern="-54" kpx2="170"/><pair kern="-77" kpx2="115"/><pair kern="-67" kpx2="88"/><pair kern="-77" kpx2="122"/><pair kern="-77" kpx2="68"/><pair kern="-17" kpx2="210"/><pair kern="-63" kpx2="36"/><pair kern="-77" kpx2="82"/><pair kern="-26" kpx2="186"/><pair kern="-77" kpx2="114"/><pair kern="-17" kpx2="175"/><pair kern="-67" kpx2="127"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-77" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-21" kpx2="76"/><pair kern="-128" kpx2="17"/><pair kern="-67" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-77" kpx2="109"/><pair kern="-137" kpx2="197"/><pair kern="-26" kpx2="92"/><pair kern="-77" kpx2="121"/><pair kern="-77" kpx2="110"/><pair kern="-63" kpx2="174"/></kerning><kerning kpx1="37"><pair kern="-17" kpx2="227"/><pair kern="-17" kpx2="246"/><pair kern="-17" kpx2="251"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-17" kpx2="54"/><pair kern="-54" kpx2="180"/><pair kern="-30" kpx2="169"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-54" kpx2="181"/><pair kern="-40" kpx2="197"/><pair kern="-17" kpx2="38"/><pair kern="-30" kpx2="57"/><pair kern="-17" kpx2="249"/></kerning><kerning kpx1="120"><pair kern="-72" kpx2="180"/><pair kern="-44" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="249"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="227"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="51"><pair kern="-17" kpx2="126"/><pair kern="-44" kpx2="107"/><pair kern="-35" kpx2="72"/><pair kern="-63" kpx2="199"/><pair kern="-21" kpx2="16"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="112"/><pair kern="-21" kpx2="187"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="86"/><pair kern="18" kpx2="180"/><pair kern="-44" kpx2="105"/><pair kern="-17" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="169"/><pair kern="-63" kpx2="201"/><pair kern="-17" kpx2="85"/><pair kern="-21" kpx2="60"/><pair kern="-44" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-21" kpx2="234"/><pair kern="-17" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-44" kpx2="68"/><pair kern="-63" kpx2="36"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-17" kpx2="250"/><pair kern="-17" kpx2="127"/><pair kern="-44" kpx2="108"/><pair kern="-63" kpx2="98"/><pair kern="-17" kpx2="81"/><pair kern="-21" kpx2="76"/><pair kern="18" kpx2="181"/><pair kern="-155" kpx2="17"/><pair kern="-17" kpx2="128"/><pair kern="-63" kpx2="173"/><pair kern="-44" kpx2="109"/><pair kern="-160" kpx2="197"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="228"/><pair kern="-44" kpx2="110"/><pair kern="-63" kpx2="174"/><pair kern="-17" kpx2="120"/></kerning><kerning kpx1="104"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="72"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="199"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="54"><pair kern="18" kpx2="173"/><pair kern="18" kpx2="36"/><pair kern="18" kpx2="201"/><pair kern="18" kpx2="199"/><pair kern="18" kpx2="174"/><pair kern="18" kpx2="98"/></kerning><kerning kpx1="180"><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="246"/><pair kern="-30" kpx2="43"/><pair kern="-72" kpx2="123"/><pair kern="-35" kpx2="251"/><pair kern="-35" kpx2="208"/><pair kern="-188" kpx2="144"/><pair kern="-58" kpx2="59"/><pair kern="-35" kpx2="73"/><pair kern="-30" kpx2="41"/><pair kern="-72" kpx2="124"/><pair kern="-54" kpx2="85"/><pair kern="-128" kpx2="201"/><pair kern="-17" kpx2="61"/><pair kern="-35" kpx2="100"/><pair kern="-72" kpx2="122"/><pair kern="-30" kpx2="47"/><pair kern="-35" kpx2="210"/><pair kern="-72" kpx2="82"/><pair kern="-35" kpx2="186"/><pair kern="-35" kpx2="175"/><pair kern="-35" kpx2="209"/><pair kern="-35" kpx2="103"/><pair kern="-128" kpx2="98"/><pair kern="-54" kpx2="81"/><pair kern="-17" kpx2="229"/><pair kern="-35" kpx2="38"/><pair kern="-72" kpx2="121"/><pair kern="-30" kpx2="37"/><pair kern="-54" kpx2="120"/><pair kern="-30" kpx2="51"/><pair kern="-128" kpx2="199"/><pair kern="-30" kpx2="53"/><pair kern="-30" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-35" kpx2="253"/><pair kern="-35" kpx2="52"/><pair kern="-72" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-35" kpx2="90"/><pair kern="-128" kpx2="36"/><pair kern="-35" kpx2="50"/><pair kern="-30" kpx2="39"/><pair kern="-30" kpx2="236"/><pair kern="-30" kpx2="45"/><pair kern="-128" kpx2="173"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="89"/><pair kern="-30" kpx2="46"/><pair kern="-128" kpx2="174"/></kerning><kerning kpx1="53"><pair kern="-21" kpx2="107"/><pair kern="-54" kpx2="235"/><pair kern="-40" kpx2="16"/><pair kern="-44" kpx2="112"/><pair kern="-44" kpx2="123"/><pair kern="-49" kpx2="251"/><pair kern="-44" kpx2="113"/><pair kern="-63" kpx2="187"/><pair kern="-44" kpx2="129"/><pair kern="-44" kpx2="124"/><pair kern="-54" kpx2="169"/><pair kern="-63" kpx2="60"/><pair kern="-40" kpx2="201"/><pair kern="-21" kpx2="106"/><pair kern="-30" kpx2="29"/><pair kern="-63" kpx2="234"/><pair kern="-49" kpx2="100"/><pair kern="-44" kpx2="122"/><pair kern="-21" kpx2="68"/><pair kern="-40" kpx2="58"/><pair kern="-44" kpx2="82"/><pair kern="-54" kpx2="186"/><pair kern="-40" kpx2="98"/><pair kern="-63" kpx2="181"/><pair kern="-35" kpx2="17"/><pair kern="-49" kpx2="38"/><pair kern="-44" kpx2="121"/><pair kern="-54" kpx2="57"/><pair kern="-44" kpx2="126"/><pair kern="-44" kpx2="72"/><pair kern="-40" kpx2="199"/><pair kern="-72" kpx2="180"/><pair kern="-21" kpx2="105"/><pair kern="-49" kpx2="253"/><pair kern="-44" kpx2="125"/><pair kern="-44" kpx2="115"/><pair kern="-17" kpx2="170"/><pair kern="-44" kpx2="88"/><pair kern="-40" kpx2="36"/><pair kern="-44" kpx2="114"/><pair kern="-72" kpx2="55"/><pair kern="-44" kpx2="127"/><pair kern="-21" kpx2="108"/><pair kern="-44" kpx2="128"/><pair kern="-40" kpx2="173"/><pair kern="-21" kpx2="109"/><pair kern="-54" kpx2="92"/><pair kern="-17" kpx2="197"/><pair kern="-21" kpx2="110"/><pair kern="-40" kpx2="174"/></kerning><kerning kpx1="137"><pair kern="-54" kpx2="180"/><pair kern="-40" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="233"><pair kern="-44" kpx2="180"/><pair kern="-35" kpx2="197"/><pair kern="-54" kpx2="181"/></kerning><kerning kpx1="253"><pair kern="-17" kpx2="169"/><pair kern="-17" kpx2="60"/><pair kern="-17" kpx2="187"/><pair kern="18" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-17" kpx2="234"/></kerning><kerning kpx1="211"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning><kerning kpx1="78"><pair kern="-17" kpx2="107"/><pair kern="-30" kpx2="126"/><pair kern="-35" kpx2="235"/><pair kern="-35" kpx2="72"/><pair kern="-35" kpx2="112"/><pair kern="-35" kpx2="123"/><pair kern="-35" kpx2="113"/><pair kern="-17" kpx2="105"/><pair kern="-30" kpx2="129"/><pair kern="-35" kpx2="124"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="115"/><pair kern="-30" kpx2="88"/><pair kern="-35" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-35" kpx2="82"/><pair kern="-35" kpx2="114"/><pair kern="-35" kpx2="186"/><pair kern="-30" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-30" kpx2="128"/><pair kern="-17" kpx2="109"/><pair kern="-35" kpx2="92"/><pair kern="-35" kpx2="121"/><pair kern="-17" kpx2="110"/></kerning><kerning kpx1="52"><pair kern="-21" kpx2="180"/><pair kern="-63" kpx2="197"/><pair kern="27" kpx2="16"/><pair kern="-17" kpx2="181"/></kerning><kerning kpx1="125"><pair kern="-72" kpx2="180"/><pair kern="-17" kpx2="17"/><pair kern="-63" kpx2="197"/><pair kern="18" kpx2="16"/><pair kern="-30" kpx2="91"/><pair kern="-35" kpx2="181"/></kerning><kerning kpx1="42"><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="169"/><pair kern="-26" kpx2="197"/><pair kern="-35" kpx2="55"/><pair kern="-49" kpx2="60"/><pair kern="-49" kpx2="187"/><pair kern="-21" kpx2="181"/><pair kern="-17" kpx2="170"/><pair kern="-49" kpx2="234"/></kerning><kerning kpx1="170"><pair kern="-17" kpx2="235"/><pair kern="-35" kpx2="199"/><pair kern="-17" kpx2="251"/><pair kern="-109" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-54" kpx2="59"/><pair kern="-109" kpx2="60"/><pair kern="-35" kpx2="201"/><pair kern="-17" kpx2="253"/><pair kern="-109" kpx2="234"/><pair kern="-17" kpx2="90"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="210"/><pair kern="-35" kpx2="36"/><pair kern="-54" kpx2="58"/><pair kern="-91" kpx2="55"/><pair kern="-17" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="50"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="-17" kpx2="39"/><pair kern="-35" kpx2="98"/><pair kern="-17" kpx2="45"/><pair kern="-35" kpx2="173"/><pair kern="-17" kpx2="92"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="89"/><pair kern="-86" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="174"/></kerning><kerning kpx1="115"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="90"><pair kern="-91" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-104" kpx2="197"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="36"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="55"><pair kern="-165" kpx2="107"/><pair kern="-155" kpx2="235"/><pair kern="-91" kpx2="16"/><pair kern="-169" kpx2="112"/><pair kern="-169" kpx2="123"/><pair kern="-58" kpx2="251"/><pair kern="-169" kpx2="113"/><pair kern="-165" kpx2="86"/><pair kern="-151" kpx2="129"/><pair kern="-169" kpx2="124"/><pair kern="-91" kpx2="169"/><pair kern="-169" kpx2="252"/><pair kern="-169" kpx2="70"/><pair kern="-146" kpx2="85"/><pair kern="-77" kpx2="201"/><pair kern="-165" kpx2="106"/><pair kern="-109" kpx2="29"/><pair kern="-58" kpx2="100"/><pair kern="-169" kpx2="122"/><pair kern="-165" kpx2="68"/><pair kern="-169" kpx2="82"/><pair kern="-155" kpx2="186"/><pair kern="-165" kpx2="250"/><pair kern="-77" kpx2="98"/><pair kern="-21" kpx2="181"/><pair kern="-118" kpx2="17"/><pair kern="-58" kpx2="38"/><pair kern="-169" kpx2="121"/><pair kern="-165" kpx2="228"/><pair kern="-169" kpx2="254"/><pair kern="-151" kpx2="126"/><pair kern="-169" kpx2="72"/><pair kern="-77" kpx2="199"/><pair kern="-165" kpx2="105"/><pair kern="-58" kpx2="253"/><pair kern="-169" kpx2="125"/><pair kern="-169" kpx2="115"/><pair kern="-54" kpx2="170"/><pair kern="-151" kpx2="88"/><pair kern="-169" kpx2="111"/><pair kern="-165" kpx2="90"/><pair kern="-77" kpx2="36"/><pair kern="-17" kpx2="55"/><pair kern="-169" kpx2="114"/><pair kern="-151" kpx2="127"/><pair kern="-165" kpx2="108"/><pair kern="-30" kpx2="76"/><pair kern="-151" kpx2="128"/><pair kern="-77" kpx2="173"/><pair kern="-165" kpx2="109"/><pair kern="-155" kpx2="92"/><pair kern="-128" kpx2="197"/><pair kern="-165" kpx2="110"/><pair kern="-77" kpx2="174"/></kerning><kerning kpx1="114"><pair kern="-17" kpx2="91"/></kerning><kerning kpx1="50"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="27" kpx2="16"/><pair kern="-54" kpx2="187"/><pair kern="-17" kpx2="98"/><pair kern="-17" kpx2="181"/><pair kern="-63" kpx2="59"/><pair kern="-40" kpx2="17"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="29"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="91"><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="111"/><pair kern="-30" kpx2="122"/><pair kern="-30" kpx2="82"/><pair kern="-30" kpx2="114"/><pair kern="-30" kpx2="72"/><pair kern="-30" kpx2="112"/><pair kern="-30" kpx2="123"/><pair kern="-30" kpx2="113"/><pair kern="-30" kpx2="124"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-30" kpx2="121"/><pair kern="-30" kpx2="125"/><pair kern="-30" kpx2="115"/></kerning><kerning kpx1="39"><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="199"/><pair kern="-17" kpx2="98"/><pair kern="-54" kpx2="187"/><pair kern="-26" kpx2="181"/><pair kern="-21" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="169"/><pair kern="-91" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-54" kpx2="60"/><pair kern="-17" kpx2="57"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="170"/><pair kern="-54" kpx2="234"/></kerning><kerning kpx1="236"><pair kern="-17" kpx2="180"/><pair kern="-72" kpx2="17"/><pair kern="-91" kpx2="197"/><pair kern="-35" kpx2="29"/></kerning><kerning kpx1="45"><pair kern="-35" kpx2="180"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="36"/><pair kern="-17" kpx2="169"/><pair kern="-54" kpx2="197"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="199"/><pair kern="-35" kpx2="16"/><pair kern="-17" kpx2="174"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="173"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="197"><pair kern="-35" kpx2="246"/><pair kern="-54" kpx2="235"/><pair kern="-35" kpx2="43"/><pair kern="-35" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-183" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="18" kpx2="144"/><pair kern="-35" kpx2="59"/><pair kern="-17" kpx2="73"/><pair kern="-35" kpx2="41"/><pair kern="-35" kpx2="124"/><pair kern="-35" kpx2="85"/><pair kern="-183" kpx2="60"/><pair kern="18" kpx2="201"/><pair kern="-183" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-35" kpx2="122"/><pair kern="-35" kpx2="47"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="82"/><pair kern="-123" kpx2="58"/><pair kern="-54" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-35" kpx2="81"/><pair kern="18" kpx2="98"/><pair kern="-54" kpx2="38"/><pair kern="-35" kpx2="121"/><pair kern="-183" kpx2="57"/><pair kern="-35" kpx2="37"/><pair kern="-35" kpx2="120"/><pair kern="-35" kpx2="51"/><pair kern="18" kpx2="199"/><pair kern="-35" kpx2="53"/><pair kern="-35" kpx2="137"/><pair kern="-35" kpx2="233"/><pair kern="-54" kpx2="253"/><pair kern="-54" kpx2="52"/><pair kern="-35" kpx2="125"/><pair kern="-35" kpx2="42"/><pair kern="-95" kpx2="90"/><pair kern="18" kpx2="36"/><pair kern="-137" kpx2="55"/><pair kern="-54" kpx2="50"/><pair kern="-35" kpx2="39"/><pair kern="-35" kpx2="236"/><pair kern="22" kpx2="45"/><pair kern="18" kpx2="173"/><pair kern="-54" kpx2="92"/><pair kern="-114" kpx2="89"/><pair kern="-35" kpx2="46"/><pair kern="18" kpx2="174"/></kerning><kerning kpx1="92"><pair kern="-142" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-146" kpx2="197"/><pair kern="-17" kpx2="16"/><pair kern="-72" kpx2="29"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="89"><pair kern="-77" kpx2="17"/><pair kern="-17" kpx2="169"/><pair kern="-132" kpx2="197"/><pair kern="-26" kpx2="16"/><pair kern="-54" kpx2="29"/><pair kern="-17" kpx2="181"/><pair kern="-17" kpx2="170"/></kerning><kerning kpx1="46"><pair kern="-17" kpx2="107"/><pair kern="-72" kpx2="235"/><pair kern="-104" kpx2="16"/><pair kern="-49" kpx2="112"/><pair kern="-49" kpx2="123"/><pair kern="-54" kpx2="251"/><pair kern="-26" kpx2="213"/><pair kern="-49" kpx2="113"/><pair kern="-35" kpx2="187"/><pair kern="-54" kpx2="208"/><pair kern="-49" kpx2="129"/><pair kern="-49" kpx2="124"/><pair kern="-63" kpx2="169"/><pair kern="-35" kpx2="60"/><pair kern="-17" kpx2="201"/><pair kern="-17" kpx2="106"/><pair kern="-35" kpx2="234"/><pair kern="-54" kpx2="100"/><pair kern="-49" kpx2="122"/><pair kern="-17" kpx2="68"/><pair kern="-54" kpx2="210"/><pair kern="-35" kpx2="58"/><pair kern="-49" kpx2="82"/><pair kern="-72" kpx2="186"/><pair kern="-54" kpx2="175"/><pair kern="-54" kpx2="209"/><pair kern="-54" kpx2="103"/><pair kern="-17" kpx2="98"/><pair kern="-30" kpx2="181"/><pair kern="-26" kpx2="212"/><pair kern="-54" kpx2="38"/><pair kern="-49" kpx2="121"/><pair kern="-49" kpx2="126"/><pair kern="-26" kpx2="104"/><pair kern="-49" kpx2="72"/><pair kern="-17" kpx2="199"/><pair kern="-30" kpx2="180"/><pair kern="-17" kpx2="105"/><pair kern="-54" kpx2="253"/><pair kern="-26" kpx2="211"/><pair kern="-49" kpx2="125"/><pair kern="-49" kpx2="115"/><pair kern="-49" kpx2="88"/><pair kern="-17" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-49" kpx2="114"/><pair kern="-54" kpx2="50"/><pair kern="-49" kpx2="127"/><pair kern="-17" kpx2="108"/><pair kern="-49" kpx2="128"/><pair kern="-17" kpx2="173"/><pair kern="-17" kpx2="109"/><pair kern="-72" kpx2="92"/><pair kern="-17" kpx2="110"/><pair kern="-17" kpx2="174"/><pair kern="-26" kpx2="56"/></kerning><kerning kpx1="174"><pair kern="-17" kpx2="246"/><pair kern="-67" kpx2="235"/><pair kern="-21" kpx2="16"/><pair kern="-17" kpx2="112"/><pair kern="-17" kpx2="123"/><pair kern="-17" kpx2="251"/><pair kern="-17" kpx2="113"/><pair kern="-77" kpx2="187"/><pair kern="-17" kpx2="208"/><pair kern="-35" kpx2="73"/><pair kern="-17" kpx2="124"/><pair kern="-35" kpx2="169"/><pair kern="-17" kpx2="252"/><pair kern="-17" kpx2="70"/><pair kern="-77" kpx2="60"/><pair kern="27" kpx2="201"/><pair kern="-17" kpx2="29"/><pair kern="-77" kpx2="234"/><pair kern="-17" kpx2="100"/><pair kern="-17" kpx2="122"/><pair kern="-17" kpx2="210"/><pair kern="-17" kpx2="82"/><pair kern="-54" kpx2="58"/><pair kern="-67" kpx2="186"/><pair kern="-17" kpx2="175"/><pair kern="-17" kpx2="209"/><pair kern="-17" kpx2="103"/><pair kern="27" kpx2="98"/><pair kern="-123" kpx2="181"/><pair kern="-17" kpx2="17"/><pair kern="-17" kpx2="38"/><pair kern="-17" kpx2="84"/><pair kern="-17" kpx2="121"/><pair kern="-63" kpx2="57"/><pair kern="-17" kpx2="254"/><pair kern="-17" kpx2="87"/><pair kern="-17" kpx2="72"/><pair kern="27" kpx2="199"/><pair kern="-17" kpx2="71"/><pair kern="-128" kpx2="180"/><pair kern="-17" kpx2="253"/><pair kern="-17" kpx2="52"/><pair kern="-17" kpx2="125"/><pair kern="-17" kpx2="42"/><pair kern="-17" kpx2="115"/><pair kern="-40" kpx2="90"/><pair kern="-17" kpx2="111"/><pair kern="27" kpx2="36"/><pair kern="-77" kpx2="55"/><pair kern="-17" kpx2="114"/><pair kern="-17" kpx2="50"/><pair kern="27" kpx2="173"/><pair kern="-67" kpx2="92"/><pair kern="22" kpx2="197"/><pair kern="-58" kpx2="89"/><pair kern="27" kpx2="174"/></kerning><kerning kpx1="56"><pair kern="-17" kpx2="229"/><pair kern="-17" kpx2="61"/></kerning></font-metrics> \ No newline at end of file
diff --git a/poky/documentation/template/VeraMoBd.ttf b/poky/documentation/template/VeraMoBd.ttf
new file mode 100644
index 000000000..9be6547ed
--- /dev/null
+++ b/poky/documentation/template/VeraMoBd.ttf
Binary files differ
diff --git a/poky/documentation/template/VeraMoBd.xml b/poky/documentation/template/VeraMoBd.xml
new file mode 100644
index 000000000..9b33107a4
--- /dev/null
+++ b/poky/documentation/template/VeraMoBd.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Bold</font-name><full-name>Bitstream Vera Sans Mono Bold</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-19</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file
diff --git a/poky/documentation/template/VeraMono.ttf b/poky/documentation/template/VeraMono.ttf
new file mode 100644
index 000000000..139f0b431
--- /dev/null
+++ b/poky/documentation/template/VeraMono.ttf
Binary files differ
diff --git a/poky/documentation/template/VeraMono.xml b/poky/documentation/template/VeraMono.xml
new file mode 100644
index 000000000..3a0a86659
--- /dev/null
+++ b/poky/documentation/template/VeraMono.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><font-metrics metrics-version="2" type="TYPE0"><font-name>BitstreamVeraSansMono-Roman</font-name><full-name>Bitstream Vera Sans Mono</full-name><family-name>Bitstream Vera Sans Mono</family-name><embed/><cap-height>729</cap-height><x-height>546</x-height><ascender>759</ascender><descender>-240</descender><bbox><left>-4</left><bottom>-235</bottom><right>605</right><top>928</top></bbox><flags>34</flags><stemv>0</stemv><italicangle>0</italicangle><subtype>TYPE0</subtype><multibyte-extras><cid-type>CIDFontType2</cid-type><default-width>0</default-width><bfranges><bf gi="3" ue="126" us="32"/><bf gi="172" ue="160" us="160"/><bf gi="163" ue="161" us="161"/><bf gi="132" ue="163" us="162"/><bf gi="189" ue="164" us="164"/><bf gi="150" ue="165" us="165"/><bf gi="231" ue="166" us="166"/><bf gi="134" ue="167" us="167"/><bf gi="142" ue="168" us="168"/><bf gi="139" ue="169" us="169"/><bf gi="157" ue="170" us="170"/><bf gi="169" ue="171" us="171"/><bf gi="164" ue="172" us="172"/><bf gi="256" ue="173" us="173"/><bf gi="138" ue="174" us="174"/><bf gi="217" ue="175" us="175"/><bf gi="131" ue="176" us="176"/><bf gi="147" ue="177" us="177"/><bf gi="241" ue="179" us="178"/><bf gi="141" ue="180" us="180"/><bf gi="151" ue="181" us="181"/><bf gi="136" ue="182" us="182"/><bf gi="195" ue="183" us="183"/><bf gi="221" ue="184" us="184"/><bf gi="240" ue="185" us="185"/><bf gi="158" ue="186" us="186"/><bf gi="170" ue="187" us="187"/><bf gi="243" ue="190" us="188"/><bf gi="162" ue="191" us="191"/><bf gi="173" ue="192" us="192"/><bf gi="201" ue="193" us="193"/><bf gi="199" ue="194" us="194"/><bf gi="174" ue="195" us="195"/><bf gi="98" ue="197" us="196"/><bf gi="144" ue="198" us="198"/><bf gi="100" ue="199" us="199"/><bf gi="203" ue="200" us="200"/><bf gi="101" ue="201" us="201"/><bf gi="200" ue="202" us="202"/><bf gi="202" ue="203" us="203"/><bf gi="207" ue="204" us="204"/><bf gi="204" ue="207" us="205"/><bf gi="232" ue="208" us="208"/><bf gi="102" ue="209" us="209"/><bf gi="210" ue="210" us="210"/><bf gi="208" ue="212" us="211"/><bf gi="175" ue="213" us="213"/><bf gi="103" ue="214" us="214"/><bf gi="239" ue="215" us="215"/><bf gi="145" ue="216" us="216"/><bf gi="213" ue="217" us="217"/><bf gi="211" ue="219" us="218"/><bf gi="104" ue="220" us="220"/><bf gi="234" ue="221" us="221"/><bf gi="236" ue="222" us="222"/><bf gi="137" ue="223" us="223"/><bf gi="106" ue="224" us="224"/><bf gi="105" ue="225" us="225"/><bf gi="107" ue="226" us="226"/><bf gi="109" ue="227" us="227"/><bf gi="108" ue="228" us="228"/><bf gi="110" ue="229" us="229"/><bf gi="160" ue="230" us="230"/><bf gi="111" ue="231" us="231"/><bf gi="113" ue="232" us="232"/><bf gi="112" ue="233" us="233"/><bf gi="114" ue="235" us="234"/><bf gi="117" ue="236" us="236"/><bf gi="116" ue="237" us="237"/><bf gi="118" ue="239" us="238"/><bf gi="233" ue="240" us="240"/><bf gi="120" ue="241" us="241"/><bf gi="122" ue="242" us="242"/><bf gi="121" ue="243" us="243"/><bf gi="123" ue="244" us="244"/><bf gi="125" ue="245" us="245"/><bf gi="124" ue="246" us="246"/><bf gi="184" ue="247" us="247"/><bf gi="161" ue="248" us="248"/><bf gi="127" ue="249" us="249"/><bf gi="126" ue="250" us="250"/><bf gi="128" ue="252" us="251"/><bf gi="235" ue="253" us="253"/><bf gi="237" ue="254" us="254"/><bf gi="186" ue="255" us="255"/><bf gi="251" ue="263" us="262"/><bf gi="253" ue="269" us="268"/><bf gi="0" ue="270" us="270"/><bf gi="0" ue="271" us="271"/><bf gi="0" ue="272" us="272"/><bf gi="255" ue="273" us="273"/><bf gi="246" ue="287" us="286"/><bf gi="248" ue="304" us="304"/><bf gi="214" ue="305" us="305"/><bf gi="225" ue="322" us="321"/><bf gi="176" ue="339" us="338"/><bf gi="249" ue="351" us="350"/><bf gi="227" ue="353" us="352"/><bf gi="187" ue="376" us="376"/><bf gi="229" ue="382" us="381"/><bf gi="166" ue="402" us="402"/><bf gi="215" ue="710" us="710"/><bf gi="224" ue="711" us="711"/><bf gi="218" ue="730" us="728"/><bf gi="223" ue="731" us="731"/><bf gi="216" ue="732" us="732"/><bf gi="222" ue="733" us="733"/><bf gi="159" ue="937" us="937"/><bf gi="155" ue="960" us="960"/><bf gi="178" ue="8212" us="8211"/><bf gi="0" ue="8213" us="8213"/><bf gi="0" ue="8214" us="8214"/><bf gi="0" ue="8215" us="8215"/><bf gi="182" ue="8217" us="8216"/><bf gi="196" ue="8218" us="8218"/><bf gi="0" ue="8219" us="8219"/><bf gi="180" ue="8221" us="8220"/><bf gi="197" ue="8222" us="8222"/><bf gi="0" ue="8223" us="8223"/><bf gi="130" ue="8224" us="8224"/><bf gi="194" ue="8225" us="8225"/><bf gi="135" ue="8226" us="8226"/><bf gi="0" ue="8227" us="8227"/><bf gi="0" ue="8228" us="8228"/><bf gi="0" ue="8229" us="8229"/><bf gi="171" ue="8230" us="8230"/><bf gi="198" ue="8240" us="8240"/><bf gi="190" ue="8250" us="8249"/><bf gi="258" ue="8364" us="8364"/><bf gi="140" ue="8482" us="8482"/><bf gi="152" ue="8706" us="8706"/><bf gi="0" ue="8707" us="8707"/><bf gi="0" ue="8708" us="8708"/><bf gi="0" ue="8709" us="8709"/><bf gi="168" ue="8710" us="8710"/><bf gi="154" ue="8719" us="8719"/><bf gi="0" ue="8720" us="8720"/><bf gi="153" ue="8721" us="8721"/><bf gi="238" ue="8722" us="8722"/><bf gi="0" ue="8723" us="8723"/><bf gi="0" ue="8724" us="8724"/><bf gi="188" ue="8725" us="8725"/><bf gi="0" ue="8726" us="8726"/><bf gi="0" ue="8727" us="8727"/><bf gi="0" ue="8728" us="8728"/><bf gi="257" ue="8729" us="8729"/><bf gi="165" ue="8730" us="8730"/><bf gi="0" ue="8731" us="8731"/><bf gi="0" ue="8732" us="8732"/><bf gi="0" ue="8733" us="8733"/><bf gi="146" ue="8734" us="8734"/><bf gi="156" ue="8747" us="8747"/><bf gi="167" ue="8776" us="8776"/><bf gi="143" ue="8800" us="8800"/><bf gi="0" ue="8801" us="8801"/><bf gi="0" ue="8802" us="8802"/><bf gi="0" ue="8803" us="8803"/><bf gi="148" ue="8805" us="8804"/><bf gi="185" ue="9674" us="9674"/><bf gi="192" ue="64258" us="64257"/><bf gi="0" ue="65535" us="65535"/></bfranges><cid-widths start-index="0"><wx w="602"/><wx w="0"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/><wx w="602"/></cid-widths></multibyte-extras></font-metrics> \ No newline at end of file
diff --git a/poky/documentation/template/component.title.xsl b/poky/documentation/template/component.title.xsl
new file mode 100644
index 000000000..ee21d59ad
--- /dev/null
+++ b/poky/documentation/template/component.title.xsl
@@ -0,0 +1,39 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="component.title">
+ <xsl:param name="node" select="."/>
+
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="ancestor::d:section">
+ <xsl:value-of select="count(ancestor::d:section)+1"/>
+ </xsl:when>
+ <xsl:when test="ancestor::sect5">6</xsl:when>
+ <xsl:when test="ancestor::sect4">5</xsl:when>
+ <xsl:when test="ancestor::sect3">4</xsl:when>
+ <xsl:when test="ancestor::sect2">3</xsl:when>
+ <xsl:when test="ancestor::sect1">2</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="h{$level+1}" namespace="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="class">title</xsl:attribute>
+ <xsl:if test="$generate.id.attributes = 0">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:apply-templates select="$node" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/division.title.xsl b/poky/documentation/template/division.title.xsl
new file mode 100644
index 000000000..6c265970d
--- /dev/null
+++ b/poky/documentation/template/division.title.xsl
@@ -0,0 +1,24 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="division.title">
+ <xsl:param name="node" select="."/>
+
+ <h1>
+ <xsl:attribute name="class">title</xsl:attribute>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="$node" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </h1>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/draft.png b/poky/documentation/template/draft.png
new file mode 100644
index 000000000..53051a9dd
--- /dev/null
+++ b/poky/documentation/template/draft.png
Binary files differ
diff --git a/poky/documentation/template/embedded_video.xsl b/poky/documentation/template/embedded_video.xsl
new file mode 100644
index 000000000..dfb33c344
--- /dev/null
+++ b/poky/documentation/template/embedded_video.xsl
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook">
+
+ <xsl:output method="html" />
+
+ <xsl:template match="/d:chapter/d:section/d:mediaobject">
+ <xsl:for-each select=".">
+ <xsl:variable name="vid_url">
+ <xsl:value-of select="./d:videoobject/d:videodata/@fileref" />
+ </xsl:variable>
+ <div style="text-align: center; margin: auto">
+ <object type="application/x-shockwave-flash" width="640" height="420" data="{$vid_url}?color2=FBE9EC&amp;showsearch=0&amp;version=3&amp;modestbranding=1&amp;fs=1">
+ <param name="movie" value="{$vid_url}?color2=FBE9EC&amp;showsearch=0&amp;version=3&amp;modestbranding=1&amp;fs=1" />
+ <param name="allowFullScreen" value="true" />
+ <param name="allowscriptaccess" value="always" />
+ </object>
+ </div>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/fop-config.xml b/poky/documentation/template/fop-config.xml
new file mode 100644
index 000000000..09cc5ca0f
--- /dev/null
+++ b/poky/documentation/template/fop-config.xml
@@ -0,0 +1,58 @@
+<fop version="1.0">
+
+ <!-- Strict user configuration -->
+ <strict-configuration>true</strict-configuration>
+
+ <!-- Strict FO validation -->
+ <strict-validation>true</strict-validation>
+
+ <!--
+ Set the baseDir so common/openedhand.svg references in plans still
+ work ok. Note, relative file references to current dir should still work.
+ -->
+ <base>../template</base>
+ <font-base>../template</font-base>
+
+ <!-- Source resolution in dpi (dots/pixels per inch) for determining the
+ size of pixels in SVG and bitmap images, default: 72dpi -->
+ <!-- <source-resolution>72</source-resolution> -->
+ <!-- Target resolution in dpi (dots/pixels per inch) for specifying the
+ target resolution for generated bitmaps, default: 72dpi -->
+ <!-- <target-resolution>72</target-resolution> -->
+
+ <!-- default page-height and page-width, in case
+ value is specified as auto -->
+ <default-page-settings height="11in" width="8.26in"/>
+
+ <!-- <use-cache>false</use-cache> -->
+
+ <renderers>
+ <renderer mime="application/pdf">
+ <fonts>
+ <font metrics-file="VeraMono.xml"
+ kerning="yes"
+ embed-url="VeraMono.ttf">
+ <font-triplet name="veramono" style="normal" weight="normal"/>
+ </font>
+
+ <font metrics-file="VeraMoBd.xml"
+ kerning="yes"
+ embed-url="VeraMoBd.ttf">
+ <font-triplet name="veramono" style="normal" weight="bold"/>
+ </font>
+
+ <font metrics-file="Vera.xml"
+ kerning="yes"
+ embed-url="Vera.ttf">
+ <font-triplet name="verasans" style="normal" weight="normal"/>
+ <font-triplet name="verasans" style="normal" weight="bold"/>
+ <font-triplet name="verasans" style="italic" weight="normal"/>
+ <font-triplet name="verasans" style="italic" weight="bold"/>
+ </font>
+
+ <auto-detect/>
+ </fonts>
+ </renderer>
+ </renderers>
+</fop>
+
diff --git a/poky/documentation/template/formal.object.heading.xsl b/poky/documentation/template/formal.object.heading.xsl
new file mode 100644
index 000000000..1a5e69780
--- /dev/null
+++ b/poky/documentation/template/formal.object.heading.xsl
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="d">
+
+ <xsl:template name="formal.object.heading">
+ <xsl:param name="object" select="."/>
+ <xsl:param name="title">
+ <xsl:apply-templates select="$object" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ </xsl:param>
+ <p class="title">
+ <b><xsl:copy-of select="$title"/></b>
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$object"/>
+ </xsl:call-template>
+ </p>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/gloss-permalinks.xsl b/poky/documentation/template/gloss-permalinks.xsl
new file mode 100644
index 000000000..6bf58116f
--- /dev/null
+++ b/poky/documentation/template/gloss-permalinks.xsl
@@ -0,0 +1,14 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:template match="glossentry/glossterm">
+ <xsl:apply-imports/>
+ <xsl:if test="$generate.permalink != 0">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/ohand-color.svg b/poky/documentation/template/ohand-color.svg
new file mode 100644
index 000000000..e42ff9c6f
--- /dev/null
+++ b/poky/documentation/template/ohand-color.svg
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="141.17999"
+ height="55.34"
+ id="svg2207"
+ sodipodi:version="0.32"
+ inkscape:version="0.45"
+ version="1.0"
+ sodipodi:docname="ohand-color.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ sodipodi:docbase="/home/mallum/Projects/admin/oh-doc-tools/common"
+ sodipodi:modified="true">
+ <defs
+ id="defs3" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.2"
+ inkscape:cx="160"
+ inkscape:cy="146.21189"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ height="55.34px"
+ width="141.18px"
+ inkscape:window-width="772"
+ inkscape:window-height="581"
+ inkscape:window-x="5"
+ inkscape:window-y="48" />
+ <metadata
+ id="metadata2211">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g2094"
+ style="fill:#6d6d70;fill-opacity:1"
+ inkscape:export-filename="/home/mallum/Desktop/g2126.png"
+ inkscape:export-xdpi="312.71841"
+ inkscape:export-ydpi="312.71841"
+ transform="matrix(0.5954767,0,0,0.5954767,31.793058,-18.471052)">
+ <g
+ id="g19"
+ style="fill:#6d6d70;fill-opacity:1">
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path21"
+ d="M 48.693,50.633 C 40.282,50.633 33.439,57.477 33.439,65.888 L 33.439,81.142 L 41.066,81.142 L 41.066,65.888 C 41.066,61.684 44.486,58.261 48.692,58.261 C 52.897,58.261 56.32,61.684 56.32,65.888 C 56.32,70.093 52.897,73.516 48.692,73.516 C 45.677,73.516 43.065,71.756 41.828,69.211 L 41.828,79.504 C 43.892,80.549 46.224,81.142 48.692,81.142 C 57.103,81.142 63.947,74.3 63.947,65.888 C 63.948,57.477 57.104,50.633 48.693,50.633 z " />
+ </g>
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path23"
+ d="M 18.486,50.557 C 26.942,50.557 33.819,57.435 33.819,65.888 C 33.819,74.344 26.942,81.223 18.486,81.223 C 10.032,81.223 3.152,74.344 3.152,65.888 C 3.152,57.435 10.032,50.557 18.486,50.557 z M 18.486,73.556 C 22.713,73.556 26.153,70.118 26.153,65.888 C 26.153,61.661 22.713,58.222 18.486,58.222 C 14.258,58.222 10.819,61.661 10.819,65.888 C 10.82,70.117 14.259,73.556 18.486,73.556 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path25"
+ d="M 94.074,107.465 L 94.074,96.016 C 94.074,87.605 87.233,80.763 78.822,80.763 C 70.41,80.763 63.567,87.605 63.567,96.016 C 63.567,104.427 70.41,111.269 78.822,111.269 C 81.289,111.269 83.621,110.676 85.685,109.631 L 85.685,99.339 C 84.448,101.885 81.836,103.644 78.822,103.644 C 74.615,103.644 71.194,100.221 71.194,96.016 C 71.194,91.81 74.615,88.388 78.822,88.388 C 83.026,88.388 86.448,91.81 86.448,96.016 L 86.448,107.456 C 86.448,109.562 88.156,111.268 90.262,111.268 C 92.364,111.269 94.068,109.566 94.074,107.465 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path27"
+ d="M 124.197,95.814 C 124.088,87.496 117.293,80.762 108.949,80.762 C 100.59,80.762 93.783,87.52 93.697,95.856 L 93.693,95.856 L 93.695,107.456 C 93.695,109.562 95.402,111.268 97.509,111.268 C 99.611,111.268 101.316,109.566 101.321,107.464 L 101.321,95.994 L 101.321,95.994 C 101.333,91.798 104.747,88.388 108.948,88.388 C 113.147,88.388 116.563,91.798 116.575,95.994 L 116.575,107.456 C 116.575,109.562 118.282,111.268 120.387,111.268 C 122.492,111.268 124.201,109.562 124.201,107.456 L 124.201,95.814 L 124.197,95.814 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path29"
+ d="M 63.946,96.005 L 63.946,95.854 L 63.943,95.854 L 63.943,95.815 L 63.942,95.815 C 63.833,87.497 57.037,80.761 48.693,80.761 C 48.682,80.761 48.671,80.763 48.658,80.763 C 48.382,80.763 48.107,80.772 47.833,80.786 C 47.75,80.791 47.668,80.799 47.586,80.806 C 47.378,80.822 47.172,80.838 46.968,80.862 C 46.884,80.873 46.801,80.882 46.719,80.893 C 46.508,80.92 46.298,80.952 46.091,80.987 C 46.024,80.999 45.958,81.01 45.891,81.024 C 45.649,81.068 45.406,81.119 45.168,81.175 C 45.14,81.183 45.112,81.189 45.085,81.195 C 43.656,81.542 42.306,82.092 41.065,82.812 L 41.065,80.761 L 33.438,80.761 L 33.438,95.857 L 33.435,95.857 L 33.435,107.457 C 33.435,109.563 35.142,111.269 37.248,111.269 C 39.093,111.269 40.632,109.958 40.984,108.217 C 41.036,107.963 41.065,107.702 41.065,107.435 L 41.065,95.873 C 41.086,94.732 41.357,93.65 41.828,92.685 L 41.828,92.693 C 42.598,91.106 43.905,89.824 45.511,89.085 C 45.519,89.08 45.529,89.076 45.536,89.073 C 45.849,88.928 46.174,88.807 46.508,88.707 C 46.523,88.704 46.536,88.699 46.55,88.696 C 46.699,88.651 46.85,88.614 47.004,88.576 C 47.025,88.575 47.046,88.567 47.069,88.562 C 47.234,88.527 47.402,88.495 47.572,88.469 C 47.586,88.468 47.6,88.466 47.615,88.463 C 47.763,88.443 47.916,88.427 48.067,88.415 C 48.106,88.41 48.145,88.407 48.186,88.404 C 48.352,88.393 48.52,88.386 48.691,88.386 C 52.888,88.387 56.304,91.797 56.316,95.992 L 56.316,107.454 C 56.316,109.56 58.023,111.266 60.13,111.266 C 61.976,111.266 63.516,109.954 63.867,108.211 C 63.919,107.963 63.946,107.706 63.946,107.442 L 63.946,96.024 C 63.946,96.021 63.947,96.018 63.947,96.015 C 63.948,96.011 63.946,96.008 63.946,96.005 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path31"
+ d="M 180.644,50.633 C 178.539,50.633 176.832,52.341 176.832,54.447 L 176.832,65.887 C 176.832,70.092 173.41,73.513 169.203,73.513 C 164.998,73.513 161.576,70.092 161.576,65.887 C 161.576,61.683 164.998,58.26 169.203,58.26 C 172.219,58.26 174.83,60.019 176.068,62.565 L 176.068,52.271 C 174.004,51.225 171.673,50.632 169.203,50.632 C 160.793,50.632 153.951,57.476 153.951,65.887 C 153.951,74.298 160.793,81.141 169.203,81.141 C 177.615,81.141 184.459,74.298 184.459,65.887 L 184.459,54.447 C 184.458,52.341 182.751,50.633 180.644,50.633 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path33"
+ d="M 124.203,77.339 L 124.203,65.687 L 124.197,65.687 C 124.088,57.371 117.293,50.633 108.949,50.633 C 100.592,50.633 93.783,57.393 93.697,65.731 L 93.695,65.731 L 93.695,65.877 C 93.695,65.882 93.693,65.885 93.693,65.888 C 93.693,65.891 93.695,65.896 93.695,65.899 L 93.695,77.33 C 93.695,79.435 95.402,81.142 97.509,81.142 C 99.614,81.142 101.321,79.435 101.321,77.33 L 101.321,65.868 C 101.333,61.672 104.747,58.261 108.948,58.261 C 113.147,58.261 116.563,61.672 116.575,65.868 L 116.575,65.868 L 116.575,77.329 C 116.575,79.434 118.282,81.141 120.389,81.141 C 122.492,81.142 124.197,79.44 124.203,77.339 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path35"
+ d="M 150.517,80.761 C 148.41,80.761 146.703,82.469 146.703,84.575 L 146.703,96.015 C 146.703,100.22 143.283,103.643 139.076,103.643 C 134.871,103.643 131.449,100.22 131.449,96.015 C 131.449,91.808 134.871,88.387 139.076,88.387 C 142.092,88.387 144.703,90.145 145.941,92.692 L 145.941,82.397 C 143.875,81.353 141.545,80.76 139.076,80.76 C 130.666,80.76 123.822,87.604 123.822,96.015 C 123.822,104.426 130.666,111.268 139.076,111.268 C 147.486,111.268 154.33,104.426 154.33,96.015 L 154.33,84.575 C 154.33,82.469 152.623,80.761 150.517,80.761 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path37"
+ d="M 82.625,77.345 C 82.625,75.247 80.923,73.547 78.826,73.547 L 78.826,81.142 C 80.922,81.142 82.625,79.442 82.625,77.345 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path39"
+ d="M 90.252,69.685 C 92.35,69.685 94.048,67.987 94.048,65.888 L 86.453,65.888 C 86.453,67.986 88.154,69.685 90.252,69.685 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path41"
+ d="M 93.832,77.329 C 93.832,75.223 92.125,73.516 90.018,73.516 L 78.825,73.516 C 74.619,73.516 71.199,70.093 71.199,65.888 C 71.199,61.684 74.619,58.261 78.825,58.261 C 83.032,58.261 86.453,61.684 86.453,65.888 C 86.453,68.904 84.694,71.514 82.149,72.752 L 92.442,72.752 C 93.488,70.689 94.08,68.356 94.08,65.888 C 94.08,57.477 87.237,50.633 78.826,50.633 C 70.415,50.633 63.571,57.477 63.571,65.888 C 63.571,74.3 70.415,81.142 78.826,81.142 L 90.018,81.142 C 92.125,81.142 93.832,79.435 93.832,77.329 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path43"
+ d="M 142.869,77.345 C 142.869,75.247 141.168,73.547 139.07,73.547 L 139.07,81.142 C 141.167,81.142 142.869,79.442 142.869,77.345 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path45"
+ d="M 150.496,69.685 C 152.594,69.685 154.293,67.987 154.293,65.888 L 146.699,65.888 C 146.699,67.986 148.398,69.685 150.496,69.685 z " />
+ <path
+ style="fill:#6d6d70;fill-opacity:1"
+ id="path47"
+ d="M 154.076,77.329 C 154.076,75.223 152.367,73.516 150.262,73.516 L 139.07,73.516 C 134.865,73.516 131.443,70.093 131.443,65.888 C 131.443,61.684 134.865,58.261 139.07,58.261 C 143.275,58.261 146.699,61.684 146.699,65.888 C 146.699,68.904 144.939,71.514 142.392,72.752 L 152.687,72.752 C 153.73,70.689 154.324,68.356 154.324,65.888 C 154.324,57.477 147.48,50.633 139.07,50.633 C 130.66,50.633 123.816,57.477 123.816,65.888 C 123.816,74.3 130.66,81.142 139.07,81.142 L 150.261,81.142 C 152.367,81.142 154.076,79.435 154.076,77.329 z " />
+ </g>
+ <g
+ id="g2126"
+ transform="matrix(0.7679564,0,0,0.7679564,-66.520631,11.42903)"
+ inkscape:export-xdpi="312.71841"
+ inkscape:export-ydpi="312.71841"
+ style="fill:#35992a;fill-opacity:1">
+ <g
+ transform="translate(86.33975,4.23985e-2)"
+ style="fill:#35992a;fill-opacity:1"
+ id="g2114">
+ <g
+ style="fill:#35992a;fill-opacity:1"
+ id="g2116">
+ <path
+ id="path2118"
+ transform="translate(-86.33975,-4.239934e-2)"
+ d="M 89.96875,0.03125 C 87.962748,0.031250001 86.34375,1.6815001 86.34375,3.6875 L 86.34375,17.71875 L 86.34375,19.6875 L 86.34375,28.90625 C 86.343752,39.06825 94.61925,47.34375 104.78125,47.34375 L 113.375,47.34375 L 123.1875,47.34375 L 127.15625,47.34375 C 129.16325,47.343749 130.8125,45.72475 130.8125,43.71875 C 130.8125,41.71275 129.16325,40.09375 127.15625,40.09375 L 123.1875,40.09375 L 123.1875,19.6875 L 123.1875,14.65625 L 123.1875,3.6875 C 123.1875,1.6815 121.5675,0.03125 119.5625,0.03125 C 117.5555,0.031250001 115.9375,1.6815001 115.9375,3.6875 L 115.9375,14.28125 C 115.1185,13.65425 114.26275,13.109 113.34375,12.625 L 113.34375,3.6875 C 113.34475,1.6815 111.6925,0.03125 109.6875,0.03125 C 107.6825,0.031250001 106.0625,1.6815001 106.0625,3.6875 L 106.0625,10.5625 C 105.6305,10.5325 105.22025,10.5 104.78125,10.5 C 104.34125,10.5 103.90075,10.5325 103.46875,10.5625 L 103.46875,3.6875 C 103.46975,1.6815 101.84975,0.03125 99.84375,0.03125 C 97.837749,0.031250001 96.21875,1.6815001 96.21875,3.6875 L 96.21875,12.625 C 95.299754,13.109 94.41375,13.65425 93.59375,14.28125 L 93.59375,3.6875 C 93.59475,1.6815 91.97475,0.03125 89.96875,0.03125 z M 104.78125,14.34375 C 112.80825,14.34375 119.3125,20.87925 119.3125,28.90625 C 119.3125,36.93325 112.80825,43.46875 104.78125,43.46875 C 96.754254,43.46875 90.21875,36.93425 90.21875,28.90625 C 90.218752,20.87825 96.753253,14.34375 104.78125,14.34375 z "
+ style="fill:#35992a;fill-opacity:1" />
+ </g>
+ </g>
+ <path
+ style="fill:#35992a;fill-opacity:1"
+ id="path2122"
+ d="M 112.04875,28.913399 C 112.04875,24.899399 108.78275,21.634399 104.76975,21.634399 C 100.75675,21.634399 97.490753,24.900399 97.490753,28.913399 C 97.490753,32.926399 100.75675,36.192399 104.76975,36.192399 C 108.78275,36.192399 112.04875,32.927399 112.04875,28.913399 z " />
+ </g>
+ </g>
+</svg>
diff --git a/poky/documentation/template/permalinks.xsl b/poky/documentation/template/permalinks.xsl
new file mode 100644
index 000000000..d2a1c1452
--- /dev/null
+++ b/poky/documentation/template/permalinks.xsl
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:param name="generate.permalink" select="1"/>
+ <xsl:param name="permalink.text">¶</xsl:param>
+
+ <xsl:template name="permalink">
+ <xsl:param name="node"/>
+
+ <xsl:if test="$generate.permalink != '0'">
+ <span class="permalink">
+ <a alt="Permalink" title="Permalink">
+ <xsl:attribute name="href">
+ <xsl:call-template name="href.target">
+ <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:copy-of select="$permalink.text"/>
+ </a>
+ </span>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/poky-db-pdf.xsl b/poky/documentation/template/poky-db-pdf.xsl
new file mode 100644
index 000000000..f8a3df103
--- /dev/null
+++ b/poky/documentation/template/poky-db-pdf.xsl
@@ -0,0 +1,64 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" />
+
+ <!-- check project-plan.sh for how this is generated, needed to tweak
+ the cover page
+ -->
+ <xsl:include href="/tmp/titlepage.xsl"/>
+
+ <!-- To force a page break in document, i.e per section add a
+ <?hard-pagebreak?> tag.
+ -->
+ <xsl:template match="processing-instruction('hard-pagebreak')">
+ <fo:block break-before='page' />
+ </xsl:template>
+
+ <!--Fix for defualt indent getting TOC all wierd..
+ See http://sources.redhat.com/ml/docbook-apps/2005-q1/msg00455.html
+ FIXME: must be a better fix
+ -->
+ <xsl:param name="body.start.indent" select="'0'"/>
+ <!--<xsl:param name="title.margin.left" select="'0'"/>-->
+
+ <!-- stop long-ish header titles getting wrapped -->
+ <xsl:param name="header.column.widths">1 10 1</xsl:param>
+
+ <!-- customise headers and footers a little -->
+
+ <xsl:template name="head.sep.rule">
+ <xsl:if test="$header.rule != 0">
+ <xsl:attribute name="border-bottom-width">0.5pt</xsl:attribute>
+ <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
+ <xsl:attribute name="border-bottom-color">#999999</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="foot.sep.rule">
+ <xsl:if test="$footer.rule != 0">
+ <xsl:attribute name="border-top-width">0.5pt</xsl:attribute>
+ <xsl:attribute name="border-top-style">solid</xsl:attribute>
+ <xsl:attribute name="border-top-color">#999999</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:attribute-set name="header.content.properties">
+ <xsl:attribute name="color">#999999</xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="footer.content.properties">
+ <xsl:attribute name="color">#999999</xsl:attribute>
+ </xsl:attribute-set>
+
+
+ <!-- general settings -->
+
+ <xsl:param name="fop1.extensions" select="1"></xsl:param>
+ <xsl:param name="paper.type" select="'A4'"></xsl:param>
+ <xsl:param name="section.autolabel" select="1"></xsl:param>
+ <xsl:param name="body.font.family" select="'verasans'"></xsl:param>
+ <xsl:param name="title.font.family" select="'verasans'"></xsl:param>
+ <xsl:param name="monospace.font.family" select="'veramono'"></xsl:param>
+
+</xsl:stylesheet>
diff --git a/poky/documentation/template/poky-ref-manual.png b/poky/documentation/template/poky-ref-manual.png
new file mode 100644
index 000000000..2085edb46
--- /dev/null
+++ b/poky/documentation/template/poky-ref-manual.png
Binary files differ
diff --git a/poky/documentation/template/poky.svg b/poky/documentation/template/poky.svg
new file mode 100644
index 000000000..a4ea5e2f4
--- /dev/null
+++ b/poky/documentation/template/poky.svg
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="158.56076"
+ height="79.284424"
+ viewBox="-40.981 -92.592 300 300"
+ id="svg2"
+ xml:space="preserve">
+<defs
+ id="defs4">
+</defs>
+<path
+ d="M -36.585379,54.412576 L -36.585379,54.421305 L -36.582469,54.421305 L -36.582469,54.243829 C -36.57956,54.302018 -36.585379,54.357297 -36.585379,54.412576 z "
+ style="fill:#6ac7bd"
+ id="path6" />
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g8">
+ <g
+ id="g10">
+ <path
+ d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 0.001,48.479 L 0.001,48.482 C 0.003,62.001 10.962,72.96 24.482,72.96 L 24.482,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z M 24.482,50.928 C 23.13,50.928 22.034,49.832 22.034,48.48 C 22.034,47.128 23.13,46.032 24.482,46.032 C 25.834,46.032 26.93,47.128 26.93,48.48 C 26.93,49.832 25.834,50.928 24.482,50.928 z "
+ style="fill:#ef412a"
+ id="path12" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g14">
+ <g
+ id="g16">
+ <path
+ d="M 119.96,48.842 C 120.024,47.548 121.086,46.516 122.397,46.516 C 123.707,46.516 124.768,47.548 124.833,48.843 C 137.211,47.62 146.879,37.181 146.879,24.483 L 122.397,24.483 C 122.396,10.961 111.435,0 97.915,0 L 97.915,24.485 C 97.917,37.183 107.584,47.619 119.96,48.842 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z M 119.949,48.963 L 97.915,48.963 L 97.915,73.442 L 97.915,73.442 C 110.613,73.442 121.052,63.774 122.275,51.399 C 120.981,51.334 119.949,50.274 119.949,48.963 z "
+ style="fill:#a9c542"
+ id="path18" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g20">
+ <g
+ id="g22">
+ <path
+ d="M 168.912,48.967 C 168.912,47.656 169.945,46.596 171.24,46.531 C 170.018,34.152 159.579,24.482 146.879,24.482 L 146.879,48.963 C 146.879,62.484 157.84,73.444 171.361,73.444 L 171.361,51.414 C 170.007,51.415 168.912,50.319 168.912,48.967 z M 195.841,48.978 C 195.841,48.973 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.776,46.595 173.808,47.656 173.808,48.967 C 173.808,50.278 172.776,51.339 171.481,51.403 C 172.679,63.59 182.814,73.146 195.244,73.445 L 171.361,73.445 L 171.361,97.927 L 171.364,97.927 C 184.879,97.925 195.834,86.973 195.842,73.46 L 195.844,73.46 L 195.844,48.979 L 195.841,48.978 z M 195.832,48.964 L 195.842,48.964 L 195.842,48.978 L 195.832,48.964 z "
+ style="fill:#f9c759"
+ id="path24" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g26">
+ <g
+ id="g28">
+ <path
+ d="M 70.994,48.479 L 48.962,48.479 L 48.962,48.481 L 70.995,48.481 C 70.995,48.481 70.994,48.48 70.994,48.479 z M 73.44,24.001 L 73.437,24.001 L 73.437,46.032 C 73.439,46.032 73.44,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 C 72.091,50.928 70.996,49.834 70.994,48.483 L 48.958,48.483 L 48.958,48.486 C 48.96,62.005 59.919,72.964 73.437,72.964 C 86.955,72.964 97.914,62.005 97.916,48.486 L 97.916,48.483 C 97.916,34.963 86.958,24.003 73.44,24.001 z "
+ style="fill:#6ac7bd"
+ id="path30" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g32">
+ <g
+ id="g34">
+ <path
+ d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 22.034,48.476 C 22.036,47.125 23.131,46.031 24.482,46.031 C 25.834,46.031 26.93,47.127 26.93,48.479 C 26.93,49.831 25.834,50.927 24.482,50.927 L 24.482,72.937 C 24.469,59.427 13.514,48.479 0,48.479 L 0,72.96 L 24.481,72.96 L 24.481,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z "
+ style="fill:#ef412a"
+ id="path36" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g38">
+ <g
+ id="g40">
+ <path
+ d="M 122.397,46.516 C 123.707,46.516 124.768,47.548 124.833,48.843 C 137.211,47.62 146.879,37.181 146.879,24.483 L 122.397,24.483 L 122.397,46.516 L 122.397,46.516 z M 97.915,0 L 97.915,24.482 L 122.396,24.482 C 122.396,10.961 111.435,0 97.915,0 z M 122.275,46.528 C 121.052,34.151 110.613,24.482 97.914,24.482 L 97.914,48.964 L 97.914,48.964 L 97.914,73.443 L 97.914,73.443 C 110.612,73.443 121.051,63.775 122.274,51.4 C 120.98,51.335 119.948,50.275 119.948,48.964 C 119.949,47.653 120.98,46.593 122.275,46.528 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z "
+ style="fill:#a9c542"
+ id="path42" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g44">
+ <g
+ id="g46">
+ <path
+ d="M 173.795,49.1 C 173.724,50.389 172.666,51.415 171.36,51.415 C 170.006,51.415 168.911,50.319 168.911,48.967 C 168.911,47.656 169.944,46.596 171.239,46.531 C 170.017,34.152 159.578,24.482 146.878,24.482 L 146.878,48.963 C 146.878,62.484 157.839,73.444 171.36,73.444 L 171.36,97.926 L 171.363,97.926 C 184.878,97.924 195.833,86.972 195.841,73.459 L 195.842,73.459 L 195.842,73.443 L 195.841,73.443 C 195.833,60.753 186.167,50.322 173.795,49.1 z M 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.775,46.595 173.806,47.655 173.808,48.964 L 195.841,48.964 L 195.841,48.979 C 195.841,48.974 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 z "
+ style="fill:#f9c759"
+ id="path48" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g50">
+ <g
+ id="g52">
+ <path
+ d="M 71.007,48.347 C 71.075,47.105 72.062,46.117 73.304,46.046 C 72.509,38.02 67.85,31.133 61.201,27.284 C 57.601,25.2 53.424,24 48.965,24 L 48.962,24 C 48.962,28.46 50.161,32.638 52.245,36.24 C 56.093,42.891 62.98,47.552 71.007,48.347 z M 48.962,48.418 C 48.962,48.438 48.961,48.456 48.961,48.476 L 48.961,48.479 L 48.962,48.479 L 48.962,48.418 z M 70.995,48.482 C 70.995,48.481 70.995,48.481 70.995,48.48 L 48.962,48.48 L 48.962,48.482 L 70.995,48.482 z M 73.44,24.001 L 73.437,24.001 L 73.437,46.032 C 73.439,46.032 73.44,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 C 72.091,50.928 70.996,49.834 70.994,48.483 L 48.958,48.483 L 48.958,48.486 C 48.96,62.005 59.919,72.964 73.437,72.964 C 86.955,72.964 97.914,62.005 97.916,48.486 L 97.916,48.483 C 97.916,34.963 86.958,24.003 73.44,24.001 z "
+ style="fill:#6ac7bd"
+ id="path54" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g56">
+ <g
+ id="g58">
+ <path
+ d="M 24.482,23.998 L 24.482,23.995 C 10.961,23.994 0,34.955 0,48.476 L 22.034,48.476 C 22.036,47.125 23.131,46.031 24.482,46.031 C 25.834,46.031 26.93,47.127 26.93,48.479 C 26.93,49.831 25.834,50.927 24.482,50.927 C 23.171,50.927 22.11,49.894 22.046,48.6 C 9.669,49.824 0.001,60.262 0.001,72.96 L 0,72.96 L 0,97.442 L 0.003,97.442 C 13.523,97.44 24.482,86.48 24.482,72.961 L 24.485,72.961 C 38.005,72.959 48.963,62 48.963,48.479 L 48.963,48.476 C 48.962,34.957 38.001,23.998 24.482,23.998 z "
+ style="fill:#ef412a"
+ id="path60" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g62">
+ <g
+ id="g64">
+ <path
+ d="M 119.949,48.963 C 119.949,47.611 121.045,46.515 122.397,46.515 C 123.707,46.515 124.768,47.547 124.833,48.842 C 137.211,47.619 146.879,37.18 146.879,24.482 L 122.397,24.482 C 122.396,10.961 111.435,0 97.915,0 L 97.915,24.482 L 122.394,24.482 C 108.874,24.484 97.916,35.444 97.916,48.963 L 97.916,48.963 L 97.916,73.442 L 97.916,73.442 C 110.614,73.442 121.053,63.774 122.276,51.399 C 120.981,51.334 119.949,50.274 119.949,48.963 z M 124.833,49.084 C 124.769,50.379 123.707,51.411 122.397,51.411 L 122.396,51.411 L 122.396,73.444 L 146.878,73.444 L 146.878,73.441 C 146.876,60.745 137.208,50.308 124.833,49.084 z "
+ style="fill:#a9c542"
+ id="path66" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g68">
+ <g
+ id="g70">
+ <path
+ d="M 195.841,48.979 L 195.835,48.964 L 195.841,48.964 L 195.841,48.979 C 195.841,48.974 195.842,48.969 195.842,48.964 L 195.842,24.482 L 195.838,24.482 C 183.14,24.484 172.702,34.154 171.482,46.531 C 172.776,46.595 173.808,47.656 173.808,48.967 C 173.808,50.319 172.712,51.415 171.361,51.415 C 170.007,51.415 168.912,50.319 168.912,48.967 C 168.912,47.656 169.945,46.596 171.24,46.531 C 170.018,34.152 159.579,24.482 146.879,24.482 L 146.879,48.963 C 146.879,62.484 157.84,73.444 171.361,73.444 L 171.361,97.926 L 171.364,97.926 C 184.883,97.924 195.843,86.963 195.843,73.444 L 171.959,73.444 C 185.203,73.126 195.841,62.299 195.841,48.979 z "
+ style="fill:#f9c759"
+ id="path72" />
+ </g>
+</g>
+<g
+ transform="matrix(2.9094193,0,0,2.9094193,-179.03055,-86.624435)"
+ style="opacity:0.65"
+ id="g74">
+ <g
+ id="g76">
+ <path
+ d="M 73.44,24.001 L 73.437,24.001 C 59.919,24.003 48.96,34.959 48.958,48.476 L 48.958,48.479 L 48.961,48.479 L 48.961,48.481 L 48.957,48.482 L 48.957,48.485 C 48.959,62.004 59.918,72.963 73.436,72.963 C 86.954,72.963 97.913,62.004 97.915,48.485 L 97.915,48.482 C 97.916,34.963 86.958,24.003 73.44,24.001 z M 73.442,50.928 C 72.09,50.928 70.994,49.832 70.994,48.48 C 70.994,47.128 72.09,46.032 73.442,46.032 C 74.794,46.032 75.89,47.128 75.89,48.48 C 75.89,49.832 74.794,50.928 73.442,50.928 z "
+ style="fill:#6ac7bd"
+ id="path78" />
+ </g>
+</g>
+</svg> \ No newline at end of file
diff --git a/poky/documentation/template/qa-code-permalinks.xsl b/poky/documentation/template/qa-code-permalinks.xsl
new file mode 100644
index 000000000..a309095c6
--- /dev/null
+++ b/poky/documentation/template/qa-code-permalinks.xsl
@@ -0,0 +1,23 @@
+<!--
+This XSL sheet enables creation of permalinks for <para><code>
+constructs. Right now, this construct occurs only in the ref-manual
+book's qa issues and warnings chapter. However, if the construct
+were to appear anywhere in that ref-manual, a permalink would be
+generated. I don't foresee any <para><code> constructs being used
+in the future but if they are then a permalink with a generically
+numbered permalink would be generated.
+-->
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:template match="para/code">
+ <xsl:apply-imports/>
+ <xsl:if test="$generate.permalink != 0">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/section.title.xsl b/poky/documentation/template/section.title.xsl
new file mode 100644
index 000000000..5c6ff9a96
--- /dev/null
+++ b/poky/documentation/template/section.title.xsl
@@ -0,0 +1,55 @@
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="d">
+
+ <xsl:template name="section.title">
+ <xsl:variable name="section"
+ select="(ancestor::section |
+ ancestor::simplesect|
+ ancestor::sect1|
+ ancestor::sect2|
+ ancestor::sect3|
+ ancestor::sect4|
+ ancestor::sect5)[last()]"/>
+
+ <xsl:variable name="renderas">
+ <xsl:choose>
+ <xsl:when test="$section/@renderas = 'sect1'">1</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect2'">2</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect3'">3</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect4'">4</xsl:when>
+ <xsl:when test="$section/@renderas = 'sect5'">5</xsl:when>
+ <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="$renderas != ''">
+ <xsl:value-of select="$renderas"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="section.level">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="section.heading">
+ <xsl:with-param name="section" select="$section"/>
+ <xsl:with-param name="level" select="$level"/>
+ <xsl:with-param name="title">
+ <xsl:apply-templates select="$section" mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ <xsl:if test="$level &gt; 0">
+ <xsl:call-template name="permalink">
+ <xsl:with-param name="node" select="$section"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/poky/documentation/template/titlepage.templates.xml b/poky/documentation/template/titlepage.templates.xml
new file mode 100644
index 000000000..f53f14700
--- /dev/null
+++ b/poky/documentation/template/titlepage.templates.xml
@@ -0,0 +1,1227 @@
+<!DOCTYPE t:templates [
+<!ENTITY hsize0 "10pt">
+<!ENTITY hsize1 "12pt">
+<!ENTITY hsize2 "14.4pt">
+<!ENTITY hsize3 "17.28pt">
+<!ENTITY hsize4 "20.736pt">
+<!ENTITY hsize5 "24.8832pt">
+<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
+<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
+<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
+<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
+<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
+<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
+]>
+<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
+ xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- ********************************************************************
+ $Id: titlepage.templates.xml,v 1.23 2003/12/16 00:30:49 bobstayton Exp $
+ ********************************************************************
+
+ This file is part of the DocBook XSL Stylesheet distribution.
+ See ../README or http://docbook.sf.net/ for copyright
+ and other information.
+
+ ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="article" t:wrapper="fo:block"
+ font-family="{$title.fontset}">
+
+ <t:titlepage-content t:side="recto"
+ text-align="center">
+
+ <mediaobject/>
+
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::article[1]"
+ keep-with-next="always"
+ font-size="&hsize5;"
+ font-weight="bold"/>
+
+ <subtitle param:node="ancestor-or-self::article[1]"
+ keep-with-next="always"
+ font-size="&hsize3;"
+ font-weight="bold"
+ space-after="0.8em"/>
+
+ <corpauthor space-before="0.5em"
+ font-size="&hsize3;"/>
+ <authorgroup space-before="0.5em"
+ font-size="&hsize2;"/>
+ <author space-before="0.5em"
+ font-size="&hsize2;"
+ space-after="0.8em"/>
+
+ <email font-size="&hsize2;"/>
+
+ <othercredit space-before="0.5em"/>
+ <releaseinfo space-before="0.5em"/>
+ <copyright space-before="0.5em"/>
+ <legalnotice text-align="start"
+ margin-left="0.5in"
+ margin-right="0.5in"
+ font-family="{$body.fontset}"/>
+ <pubdate space-before="0.5em"/>
+ <para></para>
+ <revision space-before="0.5em"/>
+ <revhistory space-before="0.5em"/>
+ <abstract space-before="0.5em"
+ text-align="start"
+ margin-left="0.5in"
+ margin-right="0.5in"
+ font-family="{$body.fontset}"/>
+
+ <para></para>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="set" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::set[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"
+ text-align="center"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="book" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+
+ <mediaobject/>
+
+ <subtitle
+ text-align="center"
+ font-size="&hsize4;"
+ space-before="&hsize4space;"
+ font-family="{$title.fontset}"/>
+ <corpauthor font-size="&hsize3;"
+ keep-with-next="always"
+ space-before="2in"/>
+ <authorgroup space-before="2in"/>
+ <author font-size="&hsize3;"
+ space-before="&hsize2space;"
+ keep-with-next="always"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ <corpauthor/>
+ <authorgroup t:named-template="verso.authorgroup"/>
+ <author/>
+ <othercredit/>
+ <pubdate space-before="1em"/>
+ <copyright/>
+ <abstract/>
+ <legalnotice font-size="8pt"/>
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ <fo:block break-after="page"/>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ <fo:block break-after="page"/>
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="part" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::part[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ text-align="center"
+ font-size="&hsize4;"
+ space-before="&hsize4space;"
+ font-weight='bold'
+ font-style='italic'
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="partintro" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ text-align="center"
+ font-size="&hsize5;"
+ font-weight="bold"
+ space-before="1em"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ text-align="center"
+ font-size="&hsize2;"
+ font-weight="bold"
+ font-style="italic"
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="reference" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="division.title"
+ param:node="ancestor-or-self::reference[1]"
+ text-align="center"
+ font-size="&hsize5;"
+ space-before="&hsize5space;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"
+ text-align="center"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsynopsisdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsection" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect1" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect2" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="refsect3" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="dedication" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::dedication[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="preface" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::preface[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="chapter" t:wrapper="fo:block"
+ font-family="{$title.fontset}">
+ <t:titlepage-content t:side="recto" margin-left="{$title.margin.left}">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::chapter[1]"
+ font-size="&hsize5;"
+ font-weight="bold"/>
+
+ <subtitle space-before="0.5em"
+ font-style="italic"
+ font-size="&hsize2;"
+ font-weight="bold"/>
+
+ <corpauthor space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <authorgroup space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <author space-before="0.5em"
+ space-after="0.5em"
+ font-size="&hsize2;"/>
+
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="appendix" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:named-template="component.title"
+ param:node="ancestor-or-self::appendix[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+<t:titlepage t:element="section" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect1" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect2" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect3" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect4" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="sect5" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<t:titlepage t:element="simplesect" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ margin-left="{$title.margin.left}"
+ font-family="{$title.fontset}"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ <corpauthor/>
+ <authorgroup/>
+ <author/>
+ <othercredit/>
+ <releaseinfo/>
+ <copyright/>
+ <legalnotice/>
+ <pubdate/>
+ <revision/>
+ <revhistory/>
+ <abstract/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="bibliography" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::bibliography[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="bibliodiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::bibliodiv[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize4;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="glossary" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::glossary[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="glossdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:named-template="component.title"
+ param:node="ancestor-or-self::glossdiv[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize4;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="index" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::index[1]"
+ param:pagewide="1"
+ margin-left="0pt"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <!-- The indexdiv.title template is used so that manual and -->
+ <!-- automatically generated indexdiv titles get the same -->
+ <!-- formatting. -->
+
+ <t:titlepage t:element="indexdiv" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title t:force="1"
+ t:named-template="indexdiv.title"
+ param:title="title"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="setindex" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::setindex[1]"
+ param:pagewide="1"
+ margin-left="0pt"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="colophon" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="component.title"
+ param:node="ancestor-or-self::colophon[1]"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize5;"
+ font-family="{$title.fontset}"
+ font-weight="bold"/>
+ <subtitle
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+ <t:titlepage t:element="table.of.contents" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'TableofContents'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.tables" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofTables'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.figures" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofFigures'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.examples" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofExamples'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.equations" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofEquations'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.procedures" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofProcedures'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+ <t:titlepage t:element="list.of.unknowns" t:wrapper="fo:block">
+ <t:titlepage-content t:side="recto">
+ <title
+ t:force="1"
+ t:named-template="gentext"
+ param:key="'ListofUnknown'"
+ space-before.minimum="1em"
+ space-before.optimum="1.5em"
+ space-before.maximum="2em"
+ space-after="0.5em"
+ margin-left="{$title.margin.left}"
+ font-size="&hsize3;"
+ font-weight="bold"
+ font-family="{$title.fontset}"/>
+ </t:titlepage-content>
+
+ <t:titlepage-content t:side="verso">
+ </t:titlepage-content>
+
+ <t:titlepage-separator>
+ </t:titlepage-separator>
+
+ <t:titlepage-before t:side="recto">
+ </t:titlepage-before>
+
+ <t:titlepage-before t:side="verso">
+ </t:titlepage-before>
+ </t:titlepage>
+
+<!-- ==================================================================== -->
+
+</t:templates>
diff --git a/poky/documentation/template/yocto-project-qs.png b/poky/documentation/template/yocto-project-qs.png
new file mode 100644
index 000000000..333442e0d
--- /dev/null
+++ b/poky/documentation/template/yocto-project-qs.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/add-variable.png b/poky/documentation/toaster-manual/figures/add-variable.png
new file mode 100644
index 000000000..6bdcca705
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/add-variable.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/bash-oecore.png b/poky/documentation/toaster-manual/figures/bash-oecore.png
new file mode 100644
index 000000000..801a5d911
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/bash-oecore.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/compatible-layers.png b/poky/documentation/toaster-manual/figures/compatible-layers.png
new file mode 100644
index 000000000..38436b075
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/compatible-layers.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/hosted-service.png b/poky/documentation/toaster-manual/figures/hosted-service.png
new file mode 100644
index 000000000..01fea7b24
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/hosted-service.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/import-layer.png b/poky/documentation/toaster-manual/figures/import-layer.png
new file mode 100644
index 000000000..436ec7af4
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/import-layer.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/new-project.png b/poky/documentation/toaster-manual/figures/new-project.png
new file mode 100644
index 000000000..dbc50b991
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/new-project.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/set-variable.png b/poky/documentation/toaster-manual/figures/set-variable.png
new file mode 100644
index 000000000..d36b52754
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/set-variable.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/simple-configuration.png b/poky/documentation/toaster-manual/figures/simple-configuration.png
new file mode 100644
index 000000000..e8fce2bf1
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/simple-configuration.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/toaster-title.png b/poky/documentation/toaster-manual/figures/toaster-title.png
new file mode 100644
index 000000000..b7ea39cd8
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/toaster-title.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/figures/variable-added.png b/poky/documentation/toaster-manual/figures/variable-added.png
new file mode 100644
index 000000000..518f25fa1
--- /dev/null
+++ b/poky/documentation/toaster-manual/figures/variable-added.png
Binary files differ
diff --git a/poky/documentation/toaster-manual/toaster-manual-customization.xsl b/poky/documentation/toaster-manual/toaster-manual-customization.xsl
new file mode 100644
index 000000000..d78694ac1
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-customization.xsl
@@ -0,0 +1,28 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
+
+ <xsl:import href="http://downloads.yoctoproject.org/mirror/docbook-mirror/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+<!--
+
+ <xsl:import href="../template/1.76.1/docbook-xsl-1.76.1/xhtml/docbook.xsl" />
+
+ <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.76.1/xhtml/docbook.xsl" />
+
+-->
+
+ <xsl:include href="../template/permalinks.xsl"/>
+ <xsl:include href="../template/section.title.xsl"/>
+ <xsl:include href="../template/component.title.xsl"/>
+ <xsl:include href="../template/division.title.xsl"/>
+ <xsl:include href="../template/formal.object.heading.xsl"/>
+ <xsl:include href="../template/embedded_video.xsl"/>
+
+ <xsl:param name="html.stylesheet" select="'toaster-manual-style.css'" />
+ <xsl:param name="chapter.autolabel" select="1" />
+ <xsl:param name="appendix.autolabel" select="A" />
+ <xsl:param name="section.autolabel" select="1" />
+ <xsl:param name="section.label.includes.component.label" select="1" />
+ <xsl:param name="generate.id.attributes" select="1" />
+
+</xsl:stylesheet>
diff --git a/poky/documentation/toaster-manual/toaster-manual-intro.xml b/poky/documentation/toaster-manual/toaster-manual-intro.xml
new file mode 100644
index 000000000..e84964c4e
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-intro.xml
@@ -0,0 +1,164 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='toaster-manual-intro'>
+<title>Introduction</title>
+
+ <para>
+ Toaster is a web interface to the Yocto Project's
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
+ The interface enables you to configure and run your builds.
+ Information about builds is collected and stored in a database.
+ You can use Toaster to configure and start builds on multiple
+ remote build servers.
+ </para>
+
+ <section id='intro-features'>
+ <title>Toaster Features</title>
+
+ <para>
+ Toaster allows you to configure and run builds, and it
+ provides extensive information about the build process.
+ <itemizedlist>
+ <listitem><para id='toaster-build-features'>
+ <emphasis>Configure and Run Builds:</emphasis>
+ You can use the Toaster web interface to configure and
+ start your builds.
+ Builds started using the Toaster web interface are
+ organized into projects.
+ When you create a project, you are asked to select a
+ release, or version of the build system you want to
+ use for the project builds.
+ As shipped, Toaster supports Yocto Project releases 1.8
+ and beyond.
+ With the Toaster web interface, you can:
+ <itemizedlist>
+ <listitem><para>
+ Browse layers listed in the various
+ <link linkend='layer-source'>layer sources</link>
+ that are available in your project (e.g. the
+ OpenEmbedded Layer Index at
+ <ulink url='http://layers.openembedded.org/layerindex/'></ulink>).
+ </para></listitem>
+ <listitem><para>
+ Browse images, recipes, and machines provided by
+ those layers.
+ </para></listitem>
+ <listitem><para>
+ Import your own layers for building.
+ </para></listitem>
+ <listitem><para>
+ Add and remove layers from your configuration.
+ </para></listitem>
+ <listitem><para>
+ Set configuration variables.
+ </para></listitem>
+ <listitem><para>
+ Select a target or multiple targets to build.
+ </para></listitem>
+ <listitem><para>
+ Start your builds.
+ </para></listitem>
+ </itemizedlist>
+ Toaster also allows you to configure and run your builds
+ from the command line, and switch between the command line and
+ the web interface at any time.
+ Builds started from the command line appear within a special
+ Toaster project called "Command line builds".
+ </para></listitem>
+ <listitem><para id='toaster-analysis-features'>
+ <emphasis>Information About the Build Process:</emphasis>
+ Toaster also records extensive information about your builds.
+ Toaster collects data for builds you start from the web
+ interface and from the command line as long as Toaster
+ is running.
+ <note>
+ You must start Toaster before the build or it will not
+ collect build data.
+ </note></para>
+ <para>With Toaster you can:
+ <itemizedlist>
+ <listitem><para>
+ See what was built (recipes and packages) and what
+ packages were installed into your final image.
+ </para></listitem>
+ <listitem><para>
+ Browse the directory structure of your image.
+ </para></listitem>
+ <listitem><para>
+ See the value of all variables in your build
+ configuration, and which files set each value.
+ </para></listitem>
+ <listitem><para>
+ Examine error, warning, and trace messages to aid
+ in debugging.
+ </para></listitem>
+ <listitem><para>
+ See information about the BitBake tasks executed
+ and reused during your build, including those that
+ used shared state.
+ </para></listitem>
+ <listitem><para>
+ See dependency relationships between recipes,
+ packages, and tasks.
+ </para></listitem>
+ <listitem><para>
+ See performance information such as build time,
+ task time, CPU usage, and disk I/O.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ For an overview of Toaster shipped with the Yocto Project &DISTRO;
+ Release, see the
+ "<ulink url='https://youtu.be/BlXdOYLgPxA'>Toaster - Yocto Project 2.2</ulink>"
+ video.
+ </para>
+ </section>
+
+ <section id='toaster-installation-options'>
+ <title>Installation Options</title>
+
+ <para>
+ You can set Toaster up to run as a local instance or as a shared
+ hosted service.
+ </para>
+
+ <para>
+ When Toaster is set up as a local instance, all the components
+ reside on a single build host.
+ Fundamentally, a local instance of Toaster is suited for a single
+ user developing on a single build host.
+ </para>
+
+ <para>
+ <imagedata fileref="figures/simple-configuration.png" align="center" width="6in" depth="1.5in" />
+ </para>
+
+ <para>
+ Toaster as a hosted service is suited for multiple users
+ developing across several build hosts.
+ When Toaster is set up as a hosted service, its components can
+ be spread across several machines:
+ </para>
+
+ <para>
+ <imagedata fileref="figures/hosted-service.png" align="center" width="6in" depth="3.5in" />
+ </para>
+ </section>
+
+<!--THIS EXTRA INFORMATION PROBABLY WILL GO AWAY
+ For additional information on installing and running Toaster, see the
+ "<ulink url='https://wiki.yoctoproject.org/wiki/Toaster#Installation_and_Running'>Installation and Running</ulink>"
+ section of the "Toaster" wiki page.
+ For complete information on the API and its search operation
+ URI, parameters, and responses, see the
+ <ulink url='https://wiki.yoctoproject.org/wiki/REST_API_Contracts'>REST API Contracts</ulink>
+ Wiki page.
+ </para>
+-->
+</chapter>
diff --git a/poky/documentation/toaster-manual/toaster-manual-reference.xml b/poky/documentation/toaster-manual/toaster-manual-reference.xml
new file mode 100644
index 000000000..7440580e7
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-reference.xml
@@ -0,0 +1,836 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='toaster-manual-reference'>
+
+<title>Concepts and Reference</title>
+
+ <para>
+ In order to configure and use Toaster, you should understand some
+ concepts and have some basic command reference material available.
+ This final chapter provides conceptual information on layer sources,
+ releases, and JSON configuration files.
+ Also provided is a quick look at some useful
+ <filename>manage.py</filename> commands that are Toaster-specific.
+ Information on <filename>manage.py</filename> commands does exist
+ across the Web and the information in this manual by no means
+ attempts to provide a command comprehensive reference.
+ </para>
+
+ <section id='layer-source'>
+ <title>Layer Source</title>
+
+ <para>
+ In general, a "layer source" is a source of information about
+ existing layers.
+ In particular, we are concerned with layers that you can use
+ with the Yocto Project and Toaster.
+ This chapter describes a particular type of layer source called
+ a "layer index."
+ </para>
+
+ <para>
+ A layer index is a web application that contains information
+ about a set of custom layers.
+ A good example of an existing layer index is the
+ OpenEmbedded Layer Index.
+ A public instance of this layer index exists at
+ <ulink url='http://layers.openembedded.org'></ulink>.
+ You can find the code for this layer index's web application at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>.
+ </para>
+
+ <para>
+ When you tie a layer source into Toaster, it can query the layer
+ source through a
+ <ulink url='http://en.wikipedia.org/wiki/Representational_state_transfer'>REST</ulink>
+ API, store the information about the layers in the Toaster
+ database, and then show the information to users.
+ Users are then able to view that information and build layers
+ from Toaster itself without worrying about cloning or editing
+ the BitBake layers configuration file
+ <filename>bblayers.conf</filename>.
+ </para>
+
+ <para>
+ Tying a layer source into Toaster is convenient when you have
+ many custom layers that need to be built on a regular basis by
+ a community of developers.
+ In fact, Toaster comes pre-configured with the OpenEmbedded
+ Metadata Index.
+ <note>
+ You do not have to use a layer source to use Toaster.
+ Tying into a layer source is optional.
+ </note>
+ </para>
+
+ <section id='layer-source-using-with-toaster'>
+ <title>Setting Up and Using a Layer Source</title>
+
+ <para>
+ To use your own layer source, you need to set up the layer
+ source and then tie it into Toaster.
+ This section describes how to tie into a layer index in a manner
+ similar to the way Toaster ties into the OpenEmbedded Metadata
+ Index.
+ </para>
+
+ <section id='understanding-your-layers'>
+ <title>Understanding Your Layers</title>
+
+ <para>
+ The obvious first step for using a layer index is to have
+ several custom layers that developers build and access using
+ the Yocto Project on a regular basis.
+ This set of layers needs to exist and you need to be
+ familiar with where they reside.
+ You will need that information when you set up the
+ code for the web application that "hooks" into your set of
+ layers.
+ </para>
+
+ <para>
+ For general information on layers, see the
+ "<ulink url='&YOCTO_DOCS_OM_URL;#the-yocto-project-layer-model'>The Yocto Project Layer Model</ulink>"
+ section in the Yocto Project Overview and Concepts Manual.
+ For information on how to create layers, see the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#understanding-and-creating-layers'>Understanding and Creating Layers</ulink>"
+ section in the Yocto Project Development Tasks Manual.
+ </para>
+ </section>
+
+ <section id='configuring-toaster-to-hook-into-your-layer-source'>
+ <title>Configuring Toaster to Hook Into Your Layer Index</title>
+
+ <para>
+ If you want Toaster to use your layer index, you must host
+ the web application in a server to which Toaster can
+ connect.
+ You also need to give Toaster the information about your
+ layer index.
+ In other words, you have to configure Toaster to use your
+ layer index.
+ This section describes two methods by which you can
+ configure and use your layer index.
+ </para>
+
+ <para>
+ In the previous section, the code for the OpenEmbedded
+ Metadata Index (i.e.
+ <ulink url='http://layers.openembedded.org'></ulink>) was
+ referenced.
+ You can use this code, which is at
+ <ulink url='http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/'></ulink>,
+ as a base to create your own layer index.
+ </para>
+
+ <section id='use-the-administration-interface'>
+ <title>Use the Administration Interface</title>
+
+ <para>
+ Access the administration interface through a
+ browser by entering the URL of your Toaster instance and
+ adding "<filename>/admin</filename>" to the end of the
+ URL.
+ As an example, if you are running Toaster locally, use
+ the following URL:
+ <literallayout class='monospaced'>
+ http://127.0.0.1:8000/admin
+ </literallayout>
+ </para>
+
+ <para>
+ The administration interface has a "Layer sources"
+ section that includes an "Add layer source" button.
+ Click that button and provide the required information.
+ Make sure you select "layerindex" as the layer source type.
+ </para>
+ </section>
+
+ <section id='use-the-fixture-feature'>
+ <title>Use the Fixture Feature</title>
+
+ <para>
+ The Django fixture feature overrides the default layer
+ server when you use it to specify a custom URL. To use
+ the fixture feature, create (or edit) the file
+ <filename>bitbake/lib/toaster.orm/fixtures/custom.xml</filename>,
+ and then set the following Toaster setting to your
+ custom URL:
+ <literallayout class='monospaced'>
+ &lt;?xml version="1.0" ?&gt;
+ &lt;django-objects version="1.0"&gt;
+ &lt;object model="orm.toastersetting" pk="100"&gt;
+ &lt;field name="name" type="CharField"&gt;CUSTOM_LAYERINDEX_SERVER&lt;/field&gt;
+ &lt;field name="value" type="CharField"&gt;https://layers.my_organization.org/layerindex/branch/master/layers/&lt;/field&gt;
+ &lt;/object&gt;
+ &lt;django-objects&gt;
+ </literallayout>
+ When you start Toaster for the first time, or if you
+ delete the file <filename>toaster.sqlite</filename> and restart,
+ the database will populate cleanly from this layer index server.
+ </para>
+
+ <para>
+ Once the information has been updated, verify the new layer
+ information is available by using the Toaster web interface.
+ To do that, visit the "All compatible layers" page inside a
+ Toaster project. The layers from your layer source should be
+ listed there.
+ </para>
+
+ <para>
+ If you change the information in your layer index server,
+ refresh the Toaster database by running the following command:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py lsupdates
+ </literallayout>
+ If Toaster can reach the API URL, you should see a message
+ telling you that Toaster is updating the layer source information.
+ </para>
+ </section>
+ </section>
+ </section>
+ </section>
+
+ <section id='toaster-releases'>
+ <title>Releases</title>
+
+ <para>
+ When you create a Toaster project using the web interface,
+ you are asked to choose a "Release."
+ In the context of Toaster, the term "Release" refers to a set of
+ layers and a BitBake version the OpenEmbedded build system uses
+ to build something.
+ As shipped, Toaster is pre-configured with releases that
+ correspond to Yocto Project release branches.
+ However, you can modify, delete, and create new releases
+ according to your needs.
+ This section provides some background information on releases.
+ </para>
+
+ <section id='toaster-releases-supported'>
+ <title>Pre-Configured Releases</title>
+
+ <para>
+ As shipped, Toaster is configured to use a specific set of
+ releases.
+ Of course, you can always configure Toaster to use any
+ release.
+ For example, you might want your project to build against a
+ specific commit of any of the "out-of-the-box" releases.
+ Or, you might want your project to build against different
+ revisions of OpenEmbedded and BitBake.
+ </para>
+
+ <para>
+ As shipped, Toaster is configured to work with the following
+ releases:
+ <itemizedlist>
+ <listitem><para><emphasis>
+ Yocto Project &DISTRO; "&DISTRO_NAME;" or OpenEmbedded "&DISTRO_NAME;":</emphasis>
+ This release causes your Toaster projects to build
+ against the head of the &DISTRO_NAME_NO_CAP; branch at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/?h=rocko'></ulink>
+ or <ulink url='http://git.openembedded.org/openembedded-core/commit/?h=rocko'></ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Yocto Project "Master" or OpenEmbedded "Master":</emphasis>
+ This release causes your Toaster Projects to
+ build against the head of the master branch, which is
+ where active development takes place, at
+ <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/poky/log/'></ulink>
+ or
+ <ulink url='http://git.openembedded.org/openembedded-core/log/'></ulink>.
+ </para></listitem>
+ <listitem><para><emphasis>Local Yocto Project or Local OpenEmbedded:</emphasis>
+ This release causes your Toaster Projects to
+ build against the head of the <filename>poky</filename>
+ or <filename>openembedded-core</filename> clone you
+ have local to the machine running Toaster.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ </section>
+
+ <section id='configuring-toaster'>
+ <title>Configuring Toaster</title>
+
+ <para>
+ In order to use Toaster, you must configure the database with the
+ default content. The following subsections describe various aspects
+ of Toaster configuration.
+ </para>
+
+ <section id='configuring-the-workflow'>
+ <title>Configuring the Workflow</title>
+
+ <para>
+ The
+ <filename>bldcontrol/management/commands/checksettings.py</filename>
+ file controls workflow configuration.
+ The following steps outline the process to initially populate
+ this database.
+ <orderedlist>
+ <listitem><para>
+ The default project settings are set from
+ <filename>orm/fixtures/settings.xml</filename>.
+ </para></listitem>
+ <listitem><para>
+ The default project distro and layers are added
+ from <filename>orm/fixtures/poky.xml</filename> if poky
+ is installed.
+ If poky is not installed, they are added
+ from <filename>orm/fixtures/oe-core.xml</filename>.
+ </para></listitem>
+ <listitem><para>
+ If the <filename>orm/fixtures/custom.xml</filename> file
+ exists, then its values are added.
+ </para></listitem>
+ <listitem><para>
+ The layer index is then scanned and added to the database.
+ </para></listitem>
+ </orderedlist>
+ Once these steps complete, Toaster is set up and ready to use.
+ </para>
+ </section>
+
+ <section id='customizing-pre-set-data'>
+ <title>Customizing Pre-Set Data</title>
+
+ <para>
+ The pre-set data for Toaster is easily customizable. You can
+ create the <filename>orm/fixtures/custom.xml</filename> file
+ to customize the values that go into to the database.
+ Customization is additive,
+ and can either extend or completely replace the existing values.
+ </para>
+
+ <para>
+ You use the <filename>orm/fixtures/custom.xml</filename> file
+ to change the default project settings for the machine, distro,
+ file images, and layers.
+ When creating a new project, you can use the file to define
+ the offered alternate project release selections.
+ For example, you can add one or more additional selections that
+ present custom layer sets or distros, and any other local or proprietary
+ content.
+ </para>
+
+ <para>
+ Additionally, you can completely disable the content from the
+ <filename>oe-core.xml</filename> and <filename>poky.xml</filename>
+ files by defining the section shown below in the
+ <filename>settings.xml</filename> file.
+ For example, this option is particularly useful if your custom
+ configuration defines fewer releases or layers than the default
+ fixture files.
+ </para>
+
+ <para>
+ The following example sets "name" to "CUSTOM_XML_ONLY" and its value
+ to "True".
+ <literallayout class='monospaced'>
+ &lt;object model="orm.toastersetting" pk="99"&gt;
+ &lt;field type="CharField" name="name"&gt;CUSTOM_XML_ONLY&lt;/field&gt;
+ &lt;field type="CharField" name="value"&gt;True&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='understanding-fixture-file-format'>
+ <title>Understanding Fixture File Format</title>
+
+ <para>
+ The following is an overview of the file format used by the
+ <filename>oe-core.xml</filename>, <filename>poky.xml</filename>,
+ and <filename>custom.xml</filename> files.
+ </para>
+
+ <para>
+ The following subsections describe each of the sections in the
+ fixture files, and outline an example section of the XML code.
+ you can use to help understand this information and create a local
+ <filename>custom.xml</filename> file.
+ </para>
+
+ <section id='defining-the-default-distro-and-other-values'>
+ <title>Defining the Default Distro and Other Values</title>
+
+ <para>
+ This section defines the default distro value for new projects.
+ By default, it reserves the first Toaster Setting record "1".
+ The following demonstrates how to set the project default value
+ for
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-DISTRO'><filename>DISTRO</filename></ulink>:
+ <literallayout class='monospaced'>
+ &lt;!-- Set the project default value for DISTRO --&gt;
+ &lt;object model="orm.toastersetting" pk="1"&gt;
+ &lt;field type="CharField" name="name"&gt;DEFCONF_DISTRO&lt;/field&gt;
+ &lt;field type="CharField" name="value"&gt;poky&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ You can override other default project values by adding
+ additional Toaster Setting sections such as any of the
+ settings coming from the <filename>settings.xml</filename>
+ file.
+ Also, you can add custom values that are included in the
+ BitBake environment.
+ The "pk" values must be unique.
+ By convention, values that set default project values have a
+ "DEFCONF" prefix.
+ </para>
+ </section>
+
+ <section id='defining-bitbake-version'>
+ <title>Defining BitBake Version</title>
+
+ <para>
+ The following defines which version of BitBake is used
+ for the following release selection:
+ <literallayout class='monospaced'>
+ &lt;!-- Bitbake versions which correspond to the metadata release --&gt;
+ &lt;object model="orm.bitbakeversion" pk="1"&gt;
+ &lt;field type="CharField" name="name"&gt;rocko&lt;/field&gt;
+ &lt;field type="CharField" name="giturl"&gt;git://git.yoctoproject.org/poky&lt;/field&gt;
+ &lt;field type="CharField" name="branch"&gt;rocko&lt;/field&gt;
+ &lt;field type="CharField" name="dirpath"&gt;bitbake&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='defining-releases'>
+ <title>Defining Release</title>
+
+ <para>
+ The following defines the releases when you create a new
+ project.
+ <literallayout class='monospaced'>
+ &lt;!-- Releases available --&gt;
+ &lt;object model="orm.release" pk="1"&gt;
+ &lt;field type="CharField" name="name"&gt;rocko&lt;/field&gt;
+ &lt;field type="CharField" name="description"&gt;Yocto Project 2.4 "Rocko"&lt;/field&gt;
+ &lt;field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version"&gt;1&lt;/field&gt;
+ &lt;field type="CharField" name="branch_name"&gt;rocko&lt;/field&gt;
+ &lt;field type="TextField" name="helptext"&gt;Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?h=rocko"&gt;Yocto Project Rocko branch&lt;/a&gt;.&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ The "pk" value must match the above respective BitBake
+ version record.
+ </para>
+ </section>
+
+ <section id='defining-the-release-default-layer-names'>
+ <title>Defining the Release Default Layer Names</title>
+
+ <para>
+ The following defines the default layers for each release:
+ <literallayout class='monospaced'>
+ &lt;!-- Default project layers for each release --&gt;
+ &lt;object model="orm.releasedefaultlayer" pk="1"&gt;
+ &lt;field rel="ManyToOneRel" to="orm.release" name="release"&gt;1&lt;/field&gt;
+ &lt;field type="CharField" name="layer_name"&gt;openembedded-core&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ The 'pk' values in the example above should start at "1" and increment
+ uniquely.
+ You can use the same layer name in multiple releases.
+ </para>
+ </section>
+
+ <section id='defining-layer-definitions'>
+ <title>Defining Layer Definitions</title>
+
+ <para>
+ Layer definitions are the most complex.
+ The following defines each of the layers, and then defines the exact layer
+ version of the layer used for each respective release.
+ You must have one <filename>orm.layer</filename>
+ entry for each layer.
+ Then, with each entry you need a set of
+ <filename>orm.layer_version</filename> entries that connects
+ the layer with each release that includes the layer.
+ In general all releases include the layer.
+ <literallayout class='monospaced'>
+ &lt;object model="orm.layer" pk="1"&gt;
+ &lt;field type="CharField" name="name"&gt;openembedded-core&lt;/field&gt;
+ &lt;field type="CharField" name="layer_index_url"&gt;&lt;/field&gt;
+ &lt;field type="CharField" name="vcs_url"&gt;git://git.yoctoproject.org/poky&lt;/field&gt;
+ &lt;field type="CharField" name="vcs_web_url"&gt;http://git.yoctoproject.org/cgit/cgit.cgi/poky&lt;/field&gt;
+ &lt;field type="CharField" name="vcs_web_tree_base_url"&gt;http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%&lt;/field&gt;
+ &lt;field type="CharField" name="vcs_web_file_base_url"&gt;http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/%path%?h=%branch%&lt;/field&gt;
+ &lt;/object&gt;
+ &lt;object model="orm.layer_version" pk="1"&gt;
+ &lt;field rel="ManyToOneRel" to="orm.layer" name="layer"&gt;1&lt;/field&gt;
+ &lt;field type="IntegerField" name="layer_source"&gt;0&lt;/field&gt;
+ &lt;field rel="ManyToOneRel" to="orm.release" name="release"&gt;1&lt;/field&gt;
+ &lt;field type="CharField" name="branch"&gt;rocko&lt;/field&gt;
+ &lt;field type="CharField" name="dirpath"&gt;meta&lt;/field&gt;
+ &lt;/object&gt;
+ &lt;object model="orm.layer_version" pk="2"&gt;
+ &lt;field rel="ManyToOneRel" to="orm.layer" name="layer"&gt;1&lt;/field&gt;
+ &lt;field type="IntegerField" name="layer_source"&gt;0&lt;/field&gt;
+ &lt;field rel="ManyToOneRel" to="orm.release" name="release"&gt;2&lt;/field&gt;
+ &lt;field type="CharField" name="branch"&gt;HEAD&lt;/field&gt;
+ &lt;field type="CharField" name="commit"&gt;HEAD&lt;/field&gt;
+ &lt;field type="CharField" name="dirpath"&gt;meta&lt;/field&gt;
+ &lt;/object&gt;
+ &lt;object model="orm.layer_version" pk="3"&gt;
+ &lt;field rel="ManyToOneRel" to="orm.layer" name="layer"&gt;1&lt;/field&gt;
+ &lt;field type="IntegerField" name="layer_source"&gt;0&lt;/field&gt;
+ &lt;field rel="ManyToOneRel" to="orm.release" name="release"&gt;3&lt;/field&gt;
+
+ &lt;field type="CharField" name="branch"&gt;master&lt;/field&gt;
+ &lt;field type="CharField" name="dirpath"&gt;meta&lt;/field&gt;
+ &lt;/object&gt;
+ </literallayout>
+ The layer "pk" values above must be unique, and typically start at "1".
+ The layer version "pk" values must also be unique across all layers,
+ and typically start at "1".
+ </para>
+ </section>
+ </section>
+ </section>
+
+ <section id='remote-toaster-monitoring'>
+ <title>Remote Toaster Monitoring</title>
+
+ <para>
+ Toaster has an API that allows remote management applications to
+ directly query the state of the Toaster server and its builds
+ in a machine-to-machine manner.
+ This API uses the
+ <ulink url='http://en.wikipedia.org/wiki/Representational_state_transfer'>REST</ulink>
+ interface and the transfer of JSON files.
+ For example, you might
+ monitor a build inside a container through well supported
+ known HTTP ports in order to easily access a Toaster server
+ inside the container.
+ In this example, when you use this direct JSON API, you avoid
+ having web page parsing against the display the user sees.
+ </para>
+
+ <section id='checking-health'>
+ <title>Checking Health</title>
+
+ <para>
+ Before you use remote Toaster monitoring, you should do
+ a health check.
+ To do this, ping the Toaster server using the following call
+ to see if it is still alive:
+ <literallayout class='monospaced'>
+ http://<replaceable>host</replaceable>:<replaceable>port</replaceable>/health
+ </literallayout>
+ Be sure to provide values for <replaceable>host</replaceable>
+ and <replaceable>port</replaceable>.
+ If the server is alive, you will get the response HTML:
+ <literallayout class='monospaced'>
+ &lt;!DOCTYPE html&gt;
+ &lt;html lang="en"&gt;
+ &lt;head&gt;&lt;title&gt;Toaster Health&lt;/title&gt;&lt;/head&gt;
+ &lt;body&gt;Ok&lt;/body&gt;
+ &lt;/html&gt;
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='determining-status-of-builds-in-progress'>
+ <title>Determining Status of Builds in Progress</title>
+
+ <para>
+ Sometimes it is useful to determine the status of a build
+ in progress.
+ To get the status of pending builds, use the following call:
+ <literallayout class='monospaced'>
+ http://<replaceable>host</replaceable>:<replaceable>port</replaceable>/toastergui/api/building
+ </literallayout>
+ Be sure to provide values for <replaceable>host</replaceable>
+ and <replaceable>port</replaceable>.
+ The output is a JSON file that itemizes all builds in
+ progress.
+ This file includes the time in seconds since each
+ respective build started as well as the progress of the
+ cloning, parsing, and task execution.
+ The following is sample output for a build in progress:
+ <literallayout class='monospaced'>
+ {"count": 1,
+ "building": [
+ {"machine": "beaglebone",
+ "seconds": "463.869",
+ "task": "927:2384",
+ "distro": "poky",
+ "clone": "1:1",
+ "id": 2,
+ "start": "2017-09-22T09:31:44.887Z",
+ "name": "20170922093200",
+ "parse": "818:818",
+ "project": "my_rocko",
+ "target": "core-image-minimal"
+ }]
+ }
+ </literallayout>
+ The JSON data for this query is returned in a single line.
+ In the previous example the line has been artificially split for readability.
+ </para>
+ </section>
+
+ <section id='checking-status-of-builds-completed'>
+ <title>Checking Status of Builds Completed</title>
+
+ <para>
+ Once a build is completed, you get the status when you use
+ the following call:
+ <literallayout class='monospaced'>
+ http://<replaceable>host</replaceable>:<replaceable>port</replaceable>/toastergui/api/builds
+ </literallayout>
+ Be sure to provide values for <replaceable>host</replaceable>
+ and <replaceable>port</replaceable>.
+ The output is a JSON file that itemizes all complete builds,
+ and includes build summary information.
+ The following is sample output for a completed build:
+ <literallayout class='monospaced'>
+ {"count": 1,
+ "builds": [
+ {"distro": "poky",
+ "errors": 0,
+ "machine":
+ "beaglebone",
+ "project": "my_rocko",
+ "stop": "2017-09-22T09:26:36.017Z",
+ "target": "quilt-native",
+ "seconds": "78.193",
+ "outcome": "Succeeded",
+ "id": 1,
+ "start": "2017-09-22T09:25:17.824Z",
+ "warnings": 1,
+ "name": "20170922092618"
+ }]
+ }
+ </literallayout>
+ The JSON data for this query is returned in a single line.
+ In the previous example the line has been artificially split for readability.
+ </para>
+ </section>
+
+ <section id='determining-status-of-a-specific-build'>
+ <title>Determining Status of a Specific Build</title>
+
+ <para>
+ Sometimes it is useful to determine the status of a specific
+ build.
+ To get the status of a specific build, use the following
+ call:
+ <literallayout class='monospaced'>
+ http://<replaceable>host</replaceable>:<replaceable>port</replaceable>/toastergui/api/build/<replaceable>ID</replaceable>
+ </literallayout>
+ Be sure to provide values for <replaceable>host</replaceable>,
+ <replaceable>port</replaceable>, and <replaceable>ID</replaceable>.
+ You can find the value for <replaceable>ID</replaceable> from the
+ Builds Completed query. See the
+ "<link linkend='checking-status-of-builds-completed'>Checking Status of Builds Completed</link>"
+ section for more information.
+ </para>
+
+ <para>
+ The output is a JSON file that itemizes the specific build
+ and includes build summary information.
+ The following is sample output for a specific build:
+ <literallayout class='monospaced'>
+ {"build":
+ {"distro": "poky",
+ "errors": 0,
+ "machine": "beaglebone",
+ "project": "my_rocko",
+ "stop": "2017-09-22T09:26:36.017Z",
+ "target": "quilt-native",
+ "seconds": "78.193",
+ "outcome": "Succeeded",
+ "id": 1,
+ "start": "2017-09-22T09:25:17.824Z",
+ "warnings": 1,
+ "name": "20170922092618",
+ "cooker_log": "/opt/user/poky/build-toaster-2/tmp/log/cooker/beaglebone/build_20170922_022607.991.log"
+ }
+ }
+ </literallayout>
+ The JSON data for this query is returned in a single line.
+ In the previous example the line has been artificially split for readability.
+ </para>
+ </section>
+ </section>
+
+ <section id='toaster-useful-commands'>
+ <title>Useful Commands</title>
+
+ <para>
+ In addition to the web user interface and the scripts that start
+ and stop Toaster, command-line commands exist through the
+ <filename>manage.py</filename> management script.
+ You can find general documentation on
+ <filename>manage.py</filename> at the
+ <ulink url='https://docs.djangoproject.com/en/1.7/topics/settings/'>Django</ulink>
+ site.
+ However, several <filename>manage.py</filename> commands have been
+ created that are specific to Toaster and are used to control
+ configuration and back-end tasks.
+ You can locate these commands in the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>) at
+ <filename>bitbake/lib/manage.py</filename>.
+ This section documents those commands.
+ <note><title>Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ When using <filename>manage.py</filename> commands given
+ a default configuration, you must be sure that your
+ working directory is set to the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ Using <filename>manage.py</filename> commands from the
+ Build Directory allows Toaster to find the
+ <filename>toaster.sqlite</filename> file, which is located
+ in the Build Directory.
+ </para></listitem>
+ <listitem><para>
+ For non-default database configurations, it is possible
+ that you can use <filename>manage.py</filename> commands
+ from a directory other than the Build Directory.
+ To do so, the
+ <filename>toastermain/settings.py</filename> file must be
+ configured to point to the correct database backend.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+ </para>
+
+ <section id='toaster-command-buildslist'>
+ <title><filename>buildslist</filename></title>
+
+ <para>
+ The <filename>buildslist</filename> command lists all builds
+ that Toaster has recorded.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py buildslist
+ </literallayout>
+ The command returns a list, which includes numeric
+ identifications, of the builds that Toaster has recorded in the
+ current database.
+ </para>
+
+ <para>
+ You need to run the <filename>buildslist</filename> command
+ first to identify existing builds in the database before
+ using the
+ <link linkend='toaster-command-builddelete'><filename>builddelete</filename></link>
+ command.
+ Here is an example that assumes default repository and build
+ directory names:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ python ../bitbake/lib/toaster/manage.py buildslist
+ </literallayout>
+ If your Toaster database had only one build, the above
+ <filename>buildslist</filename> command would return something
+ like the following:
+ <literallayout class='monospaced'>
+ 1: qemux86 poky core-image-minimal
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='toaster-command-builddelete'>
+ <title><filename>builddelete</filename></title>
+
+ <para>
+ The <filename>builddelete</filename> command deletes data
+ associated with a build.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py builddelete <replaceable>build_id</replaceable>
+ </literallayout>
+ The command deletes all the build data for the specified
+ <replaceable>build_id</replaceable>.
+ This command is useful for removing old and unused data from
+ the database.
+ </para>
+
+ <para>
+ Prior to running the <filename>builddelete</filename>
+ command, you need to get the ID associated with builds
+ by using the
+ <link linkend='toaster-command-buildslist'><filename>buildslist</filename></link>
+ command.
+ </para>
+ </section>
+
+ <section id='toaster-command-perf'>
+ <title><filename>perf</filename></title>
+
+ <para>
+ The <filename>perf</filename> command measures Toaster
+ performance.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py perf
+ </literallayout>
+ The command is a sanity check that returns page loading
+ times in order to identify performance problems.
+ </para>
+ </section>
+
+ <section id='toaster-command-checksettings'>
+ <title><filename>checksettings</filename></title>
+
+ <para>
+ The <filename>checksettings</filename> command verifies
+ existing Toaster settings.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py checksettings
+ </literallayout>
+ Toaster uses settings that are based on the
+ database to configure the building tasks.
+ The <filename>checksettings</filename> command verifies that
+ the database settings are valid in the sense that they have
+ the minimal information needed to start a build.
+ </para>
+
+ <para>
+ In order for the <filename>checksettings</filename> command
+ to work, the database must be correctly set up and not have
+ existing data.
+ To be sure the database is ready, you can run the following:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/mana​ge.py syncdb
+ $ bitbake/lib/toaster/mana​ge.py migrate orm
+ $ bitbake/lib/toaster/mana​ge.py migrate bldcontrol
+ </literallayout>
+ After running these commands, you can run the
+ <filename>checksettings</filename> command.
+ </para>
+ </section>
+
+ <section id='toaster-command-runbuilds'>
+ <title><filename>runbuilds</filename></title>
+
+ <para>
+ The <filename>runbuilds</filename> command launches
+ scheduled builds.
+ Access the command as follows:
+ <literallayout class='monospaced'>
+ $ bitbake/lib/toaster/manage.py runbuilds
+ </literallayout>
+ The <filename>runbuilds</filename> command checks if
+ scheduled builds exist in the database and then launches them
+ per schedule.
+ The command returns after the builds start but before they
+ complete.
+ The Toaster Logging Interface records and updates the database
+ when the builds complete.
+ </para>
+ </section>
+ </section>
+</chapter>
diff --git a/poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml b/poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml
new file mode 100644
index 000000000..b4caebbe0
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-setup-and-use.xml
@@ -0,0 +1,843 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='toaster-manual-setup-and-use'>
+
+<title>Setting Up and Using Toaster</title>
+
+ <section id='starting-toaster-for-local-development'>
+ <title>Starting Toaster for Local Development</title>
+
+ <para>
+ Once you have set up the Yocto Project and installed the
+ Toaster system dependencies as described in the
+ "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>"
+ chapter, you are ready to start Toaster.
+ </para>
+
+ <para>
+ Navigate to the root of your
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky</filename>):
+ <literallayout class='monospaced'>
+ $ cd poky
+ </literallayout>
+ Once in that directory, source the build environment script:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env
+ </literallayout>
+ Next, from the build directory (e.g.
+ <filename>poky/build</filename>), start Toaster using this
+ command:
+ <literallayout class='monospaced'>
+ $ source toaster start
+ </literallayout>
+ You can now run your builds from the command line, or with
+ Toaster as explained in section
+ "<link linkend='using-the-toaster-web-interface'>Using the Toaster Web Interface</link>".
+ </para>
+
+ <para>
+ To access the Toaster web interface, open your favorite
+ browser and enter the following:
+ <literallayout class='monospaced'>
+ http://127.0.0.1:8000
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-a-different-port'>
+ <title>Setting a Different Port</title>
+
+ <para>
+ By default, Toaster starts on port 8000.
+ You can use the <filename>WEBPORT</filename> parameter to
+ set a different port.
+ For example, the following command sets the port to "8400":
+ <literallayout class='monospaced'>
+ $ source toaster start webport=8400
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-up-toaster-without-a-web-server'>
+ <title>Setting Up Toaster Without a Web Server</title>
+
+ <para>
+ You can start a Toaster environment without starting its
+ web server. This is useful for the following:
+ <itemizedlist>
+ <listitem><para>
+ Capturing a command-line build’s statistics into
+ the Toaster database for examination later.
+ </para></listitem>
+ <listitem><para>
+ Capturing a command-line build’s statistics when
+ the Toaster server is already running.
+ </para></listitem>
+ <listitem><para>
+ Having one instance of the Toaster web server
+ track and capture multiple command-line builds,
+ where each build is started in its own “nowebâ€
+ Toaster environment.
+ </para></listitem>
+ </itemizedlist>
+ The following commands show how to start a Toaster environment
+ without starting its web server, perform BitBake operations,
+ and then shut down the Toaster environment.
+ Once the build is complete, you can close the Toaster environment.
+ Before closing the environment, however, you should allow a few
+ minutes to ensure the complete transfer of its BitBake build
+ statistics to the Toaster database.
+ If you have a separate Toaster web server instance running, you
+ can watch this command-line build’s progress and examine the
+ results as soon as they are posted:
+ <literallayout class='monospaced'>
+ $ source toaster start noweb
+ $ bitbake <replaceable>target</replaceable>
+ $ source toaster stop
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-up-toaster-without-a-build-server'>
+ <title>Setting Up Toaster Without a Build Server</title>
+
+ <para>
+ You can start a Toaster environment with the
+ “New Projects†feature disabled.
+ Doing so is useful for the following:
+ <itemizedlist>
+ <listitem><para>
+ Sharing your build results over the web server while
+ blocking others from starting builds on your host.
+ </para></listitem>
+ <listitem><para>
+ Allowing only local command-line builds to be captured
+ into the Toaster database.
+ </para></listitem>
+ </itemizedlist>
+ Use the following command to set up Toaster without a
+ build server:
+ <literallayout class='monospaced'>
+ $ source toaster start nobuild webport=<replaceable>port</replaceable>
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='setting-up-external-access'>
+ <title>Setting up External Access</title>
+
+ <para>
+ By default, Toaster binds to the loop back address
+ (i.e. localhost), which does not allow access from
+ external hosts. To allow external access, use the
+ <filename>WEBPORT</filename> parameter to open an
+ address that connects to the network, specifically the
+ IP address that your NIC uses to connect to the network.
+ You can also bind to all IP addresses the computer
+ supports by using the shortcut
+ "0.0.0.0:<replaceable>port</replaceable>".
+ </para>
+
+ <para>
+ The following example binds to all IP addresses on the
+ host:
+ <literallayout class='monospaced'>
+ $ source toaster start webport=0.0.0.0:8400
+ </literallayout>
+ This example binds to a specific IP address on the host's
+ NIC:
+ <literallayout class='monospaced'>
+ $ source toaster start webport=192.168.1.1:8400
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='the-directory-for-cloning-layers'>
+ <title>The Directory for Cloning Layers</title>
+
+ <para>
+ Toaster creates a <filename>_toaster_clones</filename>
+ directory inside your Source Directory
+ (i.e. <filename>poky</filename>) to clone any layers
+ needed for your builds.
+ </para>
+
+ <para>
+ Alternatively, if you would like all of your Toaster related
+ files and directories to be in a particular location other than
+ the default, you can set the <filename>TOASTER_DIR</filename>
+ environment variable, which takes precedence over your current
+ working directory.
+ Setting this environment variable causes Toaster to create and use
+ <filename>$TOASTER_DIR./_toaster_clones</filename>.
+ </para>
+ </section>
+
+ <section id='toaster-the-build-directory'>
+ <title>The Build Directory</title>
+
+ <para>
+ Toaster creates a build directory within your Source
+ Directory (e.g. <filename>poky</filename>) to execute
+ the builds.
+ </para>
+
+ <para>
+ Alternatively, if you would like all of your Toaster related files
+ and directories to be in a particular location, you can set
+ the <filename>TOASTER_DIR</filename> environment variable,
+ which takes precedence over your current working directory.
+ Setting this environment variable causes Toaster to use
+ <filename>$TOASTER_DIR/build</filename> as the build directory.
+ </para>
+ </section>
+
+ <section id='toaster-creating-a-django-super-user'>
+ <title>Creating a Django Superuser</title>
+
+ <para>
+ Toaster is built on the
+ <ulink url='https://www.djangoproject.com/'>Django framework</ulink>.
+ Django provides an administration interface you can use
+ to edit Toaster configuration parameters.
+ </para>
+
+ <para>
+ To access the Django administration interface, you must
+ create a superuser by following these steps:
+ <orderedlist>
+ <listitem><para>
+ If you used <filename>pip3</filename>, which is
+ recommended, to set up the Toaster system dependencies,
+ you need be sure the local user path is in your
+ <filename>PATH</filename> list.
+ To append the pip3 local user path, use the following
+ command:
+ <literallayout class='monospaced'>
+ $ export PATH=$PATH:$HOME/.local/bin
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ From the directory containing the Toaster database,
+ which by default is the
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>,
+ invoke the <filename>createsuperuser</filename> command
+ from <filename>manage.py</filename>:
+ <literallayout class='monospaced'>
+ $ cd ~/poky/build
+ $ ../bitbake/lib/toaster/manage.py createsuperuser
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Django prompts you for the username, which you need to
+ provide.
+ </para></listitem>
+ <listitem><para>
+ Django prompts you for an email address, which is
+ optional.
+ </para></listitem>
+ <listitem><para>
+ Django prompts you for a password, which you must provide.
+ </para></listitem>
+ <listitem><para>
+ Django prompts you to re-enter your password for verification.
+ </para></listitem>
+ </orderedlist>
+ After completing these steps, the following confirmation message
+ appears:
+ <literallayout class='monospaced'>
+ Superuser created successfully.
+ </literallayout>
+ </para>
+
+ <para>
+ Creating a superuser allows you to access the Django administration
+ interface through a browser.
+ The URL for this interface is the same as the URL used for the
+ Toaster instance with "/admin" on the end.
+ For example, if you are running Toaster locally, use the
+ following URL:
+ <literallayout class='monospaced'>
+ http://127.0.0.1:8000/admin
+ </literallayout>
+ You can use the Django administration interface to set Toaster
+ configuration parameters such as the build directory, layer sources,
+ default variable values, and BitBake versions.
+ </para>
+ </section>
+
+ <section id='toaster-setting-up-a-production-instance-of-toaster'>
+ <title>Setting Up a Production Instance of Toaster</title>
+
+ <para>
+ You can use a production instance of Toaster to share the
+ Toaster instance with remote users, multiple users, or both.
+ The production instance is also the setup that can handle
+ heavier loads on the web service.
+ Use the instructions in the following sections to set up
+ Toaster to run builds through the Toaster web interface.
+ </para>
+
+ <section id='toaster-production-instance-requirements'>
+ <title>Requirements</title>
+
+ <para>
+ Be sure you meet the following requirements:
+ <note>
+ You must comply with all Apache,
+ <filename>mod-wsgi</filename>, and Mysql requirements.
+ </note>
+ <itemizedlist>
+ <listitem><para>
+ Have all the build requirements as described in the
+ "<link linkend='toaster-manual-start'>Preparing to Use Toaster</link>"
+ chapter.
+ </para></listitem>
+ <listitem><para>
+ Have an Apache webserver.
+ </para></listitem>
+ <listitem><para>
+ Have <filename>mod-wsgi</filename> for the Apache
+ webserver.
+ </para></listitem>
+ <listitem><para>
+ Use the Mysql database server.
+ </para></listitem>
+ <listitem><para>
+ If you are using Ubuntu 16.04, run the following:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install apache2 libapache2-mod-wsgi-py3 mysql-server python3-pip libmysqlclient-dev
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you are using Fedora 24 or a RedHat distribution, run
+ the following:
+ <literallayout class='monospaced'>
+ $ sudo dnf install httpd python3-mod_wsgi python3-pip mariadb-server mariadb-devel python3-devel
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ If you are using openSUSE Leap 42.1, run
+ the following:
+ <literallayout class='monospaced'>
+ $ sudo zypper install apache2 apache2-mod_wsgi-python3 python3-pip mariadb mariadb-client python3-devel
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='toaster-installation-steps'>
+ <title>Installation</title>
+
+ <para>
+ Perform the following steps to install Toaster:
+ <orderedlist>
+ <listitem><para>
+ Create toaster user and set its home directory to
+ <filename>/var/www/toaster</filename>:
+ <literallayout class='monospaced'>
+ $ sudo /usr/sbin/useradd toaster -md /var/www/toaster -s /bin/false
+ $ sudo su - toaster -s /bin/bash
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Checkout a copy of <filename>poky</filename>
+ into the web server directory.
+ You will be using <filename>/var/www/toaster</filename>:
+ <literallayout class='monospaced'>
+ $ git clone git://git.yoctoproject.org/poky
+ $ git checkout &DISTRO_NAME_NO_CAP;
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Install Toaster
+ dependencies using the --user flag which
+ keeps the Python packages
+ isolated from your system-provided packages:
+ <literallayout class='monospaced'>
+ $ cd /var/www/toaster/
+ $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
+ $ pip3 install --user mysqlclient
+ </literallayout>
+ <note>
+ Isolating these packages is not required but is
+ recommended.
+ Alternatively, you can use your operating system's
+ package manager to install the packages.
+ </note>
+ </para></listitem>
+ <listitem><para>
+ Configure Toaster by editing
+ <filename>/var/www/toaster/poky/bitbake/lib/toaster/toastermain/settings.py</filename>
+ as follows:
+ <itemizedlist>
+ <listitem><para>
+ Edit the
+ <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#databases'>DATABASES</ulink>
+ settings:
+ <literallayout class='monospaced'>
+ DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': 'toaster_data',
+ 'USER': 'toaster',
+ 'PASSWORD': 'yourpasswordhere',
+ 'HOST': 'localhost',
+ 'PORT': '3306',
+ }
+ }
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Edit the
+ <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-SECRET_KEY'>SECRET_KEY</ulink>:
+ <literallayout class='monospaced'>
+ SECRET_KEY = '<replaceable>your_secret_key</replaceable>'
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Edit the
+ <ulink url='https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATIC_ROOT'>STATIC_ROOT</ulink>:
+ <literallayout class='monospaced'>
+ STATIC_ROOT = '/var/www/toaster/static_files/'
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem><para>
+ Add the database and user to the <filename>mysql</filename>
+ server defined earlier:
+ <literallayout class='monospaced'>
+ $ mysql -u root -p
+ mysql> CREATE DATABASE toaster_data;
+ mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
+ mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
+ mysql> quit
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Get Toaster to create the database schema,
+ default data, and gather the statically-served files:
+ <literallayout class='monospaced'>
+ $ cd /var/www/toaster/poky/
+ $ ./bitbake/lib/toaster/manage.py migrate
+ $ TOASTER_DIR=`pwd` TEMPLATECONF='poky' \
+ ./bitbake/lib/toaster/manage.py checksettings
+ $ ./bitbake/lib/toaster/manage.py collectstatic
+ </literallayout>
+ In the previous example, from the <filename>poky</filename>
+ directory, the <filename>migrate</filename> command
+ ensures the database schema changes have propagated
+ correctly (i.e. migrations).
+ The next line sets the Toaster root directory
+ <filename>TOASTER_DIR</filename> and the location
+ of the Toaster configuration file
+ <filename>TOASTER_CONF</filename>, which is relative to
+ <filename>TOASTER_DIR</filename>.
+ The <filename>TEMPLATECONF</filename> value reflects the
+ contents of <filename>poky/.templateconf</filename>, and
+ by default, should include the string "poky".
+ For more information on the Toaster configuration
+ file, see the
+ "<link linkend='configuring-toaster'>Configuring Toaster</link>"
+ section.</para>
+
+ <para>This line also runs the <filename>checksettings</filename>
+ command, which configures the location of the Toaster
+ <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>.
+ The Toaster root directory <filename>TOASTER_DIR</filename>
+ determines where the Toaster build directory
+ is created on the file system.
+ In the example above,
+ <filename>TOASTER_DIR</filename> is set as follows:
+ <literallayout class="monospaced">
+ /var/www/toaster/poky
+ </literallayout>
+ This setting causes the Toaster build directory to be:
+ <literallayout class="monospaced">
+ /var/www/toaster/poky/build
+ </literallayout></para>
+
+ <para>Finally, the <filename>collectstatic</filename> command
+ is a Django framework command that collects all the
+ statically served files into a designated directory to
+ be served up by the Apache web server as defined by
+ <filename>STATIC_ROOT</filename>.
+ </para></listitem>
+ <listitem><para>
+ Test and/or use the Mysql integration with Toaster’s
+ Django web server.
+ At this point, you can start up the normal Toaster
+ Django web server with the Toaster database in Mysql.
+ You can use this web server to confirm that the database
+ migration and data population from the Layer Index is
+ complete.</para>
+
+ <para>To start the default Toaster Django web server with
+ the Toaster database now in Mysql, use the standard
+ start commands:
+ <literallayout class='monospaced'>
+ $ source oe-init-build-env
+ $ source toaster start
+ </literallayout>
+ Additionally, if Django is sufficient for your requirements,
+ you can use it for your release system and migrate later
+ to Apache as your requirements change.
+ </para></listitem>
+ <listitem><para>
+ Add an Apache configuration file for Toaster to your Apache web
+ server's configuration directory.
+ If you are using Ubuntu or Debian, put the file here:
+ <literallayout class='monospaced'>
+ /etc/apache2/conf-available/toaster.conf
+ </literallayout>
+ If you are using Fedora or RedHat, put it here:
+ <literallayout class='monospaced'>
+ /etc/httpd/conf.d/toaster.conf
+ </literallayout>
+ If you are using OpenSUSE, put it here:
+ <literallayout class='monospaced'>
+ /etc/apache2/conf.d/toaster.conf
+ </literallayout>
+ Following is a sample Apache configuration for Toaster
+ you can follow:
+ <literallayout class='monospaced'>
+ Alias /static /var/www/toaster/static_files
+ &lt;Directory /var/www/toaster/static_files&gt;
+ &lt;IfModule mod_access_compat.c&gt;
+ Order allow,deny
+ Allow from all
+ &lt;/IfModule&gt;
+ &lt;IfModule !mod_access_compat.c&gt;
+ Require all granted
+ &lt;/IfModule&gt;
+ &lt;/Directory&gt;
+
+ &lt;Directory /var/www/toaster/poky/bitbake/lib/toaster/toastermain&gt;
+ &lt;Files "wsgi.py"&gt;
+ Require all granted
+ &lt;/Files&gt;
+ &lt;/Directory&gt;
+
+ WSGIDaemonProcess toaster_wsgi python-path=/var/www/toaster/poky/bitbake/lib/toaster:/var/www/toaster/.local/lib/python3.4/site-packages
+
+ WSGIScriptAlias / "/var/www/toaster/poky/bitbake/lib/toaster/toastermain/wsgi.py"
+ &lt;Location /&gt;
+ WSGIProcessGroup toaster_wsgi
+ &lt;/Location&gt;
+ </literallayout>
+ If you are using Ubuntu or Debian,
+ you will need to enable the config and module for Apache:
+ <literallayout class='monospaced'>
+ $ sudo a2enmod wsgi
+ $ sudo a2enconf toaster
+ $ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
+ </literallayout>
+ Finally, restart Apache to make sure all new configuration
+ is loaded.
+ For Ubuntu, Debian, and OpenSUSE use:
+ <literallayout class='monospaced'>
+ $ sudo service apache2 restart
+ </literallayout>
+ For Fedora and RedHat use:
+ <literallayout class='monospaced'>
+ $ sudo service httpd restart
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Prepare the systemd service to run Toaster builds.
+ Here is a sample configuration file for the service:
+ <literallayout class='monospaced'>
+ [Unit]
+ Description=Toaster runbuilds
+
+ [Service]
+ Type=forking
+ User=toaster
+ ExecStart=/usr/bin/screen -d -m -S runbuilds /var/www/toaster/poky/bitbake/lib/toaster/runbuilds-service.sh start
+ ExecStop=/usr/bin/screen -S runbuilds -X quit
+ WorkingDirectory=/var/www/toaster/poky
+
+ [Install]
+ WantedBy=multi-user.target
+ </literallayout>
+ Prepare the <filename>runbuilds-service.sh</filename>
+ script that you need to place in the
+ <filename>/var/www/toaster/poky/bitbake/lib/toaster/</filename>
+ directory by setting up executable permissions:
+ <literallayout class='monospaced'>
+ #!/bin/bash
+
+ #export http_proxy=http://proxy.host.com:8080
+ #export https_proxy=http://proxy.host.com:8080
+ #export GIT_PROXY_COMMAND=$HOME/bin/gitproxy
+
+ cd ~/poky/
+ source ./oe-init-build-env build
+ source ../bitbake/bin/toaster $1 noweb
+ [ "$1" == 'start' ] &amp;&amp; /bin/bash
+ </literallayout>
+ </para></listitem>
+ <listitem><para>
+ Run the service:
+ <literallayout class='monospaced'>
+ # service runbuilds start
+ </literallayout>
+ Since the service is running in a detached screen
+ session, you can attach to it using this command:
+ <literallayout class='monospaced'>
+ $ sudo su - toaster
+ $ screen -rS runbuilds
+ </literallayout>
+ You can detach from the service again using "Ctrl-a"
+ followed by "d" key combination.
+ </para></listitem>
+ </orderedlist>
+ You can now open up a browser and start using Toaster.
+ </para>
+ </section>
+ </section>
+
+ <section id='using-the-toaster-web-interface'>
+ <title>Using the Toaster Web Interface</title>
+
+ <para>
+ The Toaster web interface allows you to do the following:
+ <itemizedlist>
+ <listitem><para>
+ Browse published layers in the
+ <ulink url='http://layers.openembedded.org'>OpenEmbedded Layer Index</ulink>
+ that are available for your selected version of the build
+ system.
+ </para></listitem>
+ <listitem><para>
+ Import your own layers for building.
+ </para></listitem>
+ <listitem><para>
+ Add and remove layers from your configuration.
+ </para></listitem>
+ <listitem><para>
+ Set configuration variables.
+ </para></listitem>
+ <listitem><para>
+ Select a target or multiple targets to build.
+ </para></listitem>
+ <listitem><para>
+ Start your builds.
+ </para></listitem>
+ <listitem><para>
+ See what was built (recipes and packages) and what
+ packages were installed into your final image.
+ </para></listitem>
+ <listitem><para>
+ Browse the directory structure of your image.
+ </para></listitem>
+ <listitem><para>
+ See the value of all variables in your build configuration,
+ and which files set each value.
+ </para></listitem>
+ <listitem><para>
+ Examine error, warning and trace messages to aid in
+ debugging.
+ </para></listitem>
+ <listitem><para>
+ See information about the BitBake tasks executed and
+ reused during your build, including those that used
+ shared state.
+ </para></listitem>
+ <listitem><para>
+ See dependency relationships between recipes, packages
+ and tasks.
+ </para></listitem>
+ <listitem><para>
+ See performance information such as build time, task time,
+ CPU usage, and disk I/O.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+
+ <section id='web-interface-videos'>
+ <title>Toaster Web Interface Videos</title>
+
+ <para>
+ Following are several videos that show how to use the Toaster GUI:
+ <itemizedlist>
+ <listitem><para><emphasis>Build Configuration:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=qYgDZ8YzV6w'>video</ulink>
+ overviews and demonstrates build configuration for Toaster.
+ </para></listitem>
+ <listitem><para><emphasis>Build Custom Layers:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=QJzaE_XjX5c'>video</ulink>
+ shows you how to build custom layers that are used with
+ Toaster.
+ </para></listitem>
+ <listitem><para><emphasis>Toaster Homepage and Table Controls:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=QEARDnrR1Xw'>video</ulink>
+ goes over the Toaster entry page, and provides
+ an overview of the data manipulation capabilities of
+ Toaster, which include search, sorting and filtering by
+ different criteria.
+ </para></listitem>
+ <listitem><para><emphasis>Build Dashboard:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=KKqHYcnp2gE'>video</ulink>
+ shows you the build dashboard, a page providing an
+ overview of the information available for a selected build.
+ </para></listitem>
+ <listitem><para><emphasis>Image Information:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=XqYGFsmA0Rw'>video</ulink>
+ walks through the information Toaster provides
+ about images: packages installed and root file system.
+ </para></listitem>
+ <listitem><para><emphasis>Configuration:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=UW-j-T2TzIg'>video</ulink>
+ provides Toaster build configuration information.
+ </para></listitem>
+ <listitem><para><emphasis>Tasks:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=D4-9vGSxQtw'>video</ulink>
+ shows the information Toaster provides about the
+ tasks run by the build system.
+ </para></listitem>
+ <listitem><para><emphasis>Recipes and Packages Built:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=x-6dx4huNnw'>video</ulink>
+ shows the information Toaster provides about recipes
+ and packages built.
+ </para></listitem>
+ <listitem><para><emphasis>Performance Data:</emphasis>
+ This
+ <ulink url='https://www.youtube.com/watch?v=qWGMrJoqusQ'>video</ulink>
+ shows the build performance data provided by
+ Toaster.
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id='a-note-on-the-local-yocto-project-release'>
+ <title>Additional Information About the Local Yocto Project Release</title>
+
+ <para>
+ This section only applies if you have set up Toaster
+ for local development, as explained in the
+ "<link linkend='starting-toaster-for-local-development'>Starting Toaster for Local Development</link>"
+ section.
+ </para>
+
+ <para>
+ When you create a project in Toaster, you will be asked to
+ provide a name and to select a Yocto Project release.
+ One of the release options you will find is called
+ "Local Yocto Project".
+ <imagedata fileref="figures/new-project.png" align="center" width="9in" />
+ </para>
+
+ <para>
+ When you select the "Local Yocto Project" release, Toaster
+ will run your builds using the local Yocto
+ Project clone you have in your computer: the same clone
+ you are using to run Toaster.
+ Unless you manually update
+ this clone, your builds will always use the same Git revision.
+ </para>
+
+ <para>
+ If you select any of the other release options, Toaster
+ will fetch the tip of your selected release from the upstream
+ <ulink url='https://git.yoctoproject.org'>Yocto Project repository</ulink>
+ every time you run a build.
+ Fetching this tip effectively
+ means that if your selected release is updated upstream, the
+ Git revision you are using for your builds will change.
+ If you are doing development locally, you might not want this
+ change to happen.
+ In that case, the "Local Yocto Project"
+ release might be the right choice.
+ </para>
+
+ <para>
+ However, the "Local Yocto Project" release
+ will not provide you with any compatible layers, other than the
+ three core layers that come with the Yocto Project:
+ <itemizedlist>
+ <listitem><para>
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/openembedded-core/'>openembedded-core</ulink>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-poky/'>meta-poky</ulink>
+ </para></listitem>
+ <listitem><para>
+ <ulink url='http://layers.openembedded.org/layerindex/branch/master/layer/meta-yocto-bsp/'>meta-yocto-bsp</ulink>
+ </para></listitem>
+ </itemizedlist>
+ <imagedata fileref="figures/compatible-layers.png" align="center" width="9in" />
+ </para>
+
+ <para>
+ If you want to build any other layers, you will need to
+ manually import them into your Toaster project, using the
+ "Import layer" page.
+ <imagedata fileref="figures/import-layer.png" align="center" width="9in" />
+ </para>
+
+ </section>
+
+ <section id='toaster-web-interface-preferred-version'>
+ <title>Building a Specific Recipe Given Multiple Versions</title>
+
+ <para>
+ Occasionally, a layer might provide more than one version of
+ the same recipe.
+ For example, the <filename>openembedded-core</filename> layer
+ provides two versions of the <filename>bash</filename> recipe
+ (i.e. 3.2.48 and 4.3.30-r0) and two versions of the
+ <filename>which</filename> recipe (i.e. 2.21 and 2.18).
+ The following figure shows this exact scenario:
+ <imagedata fileref="figures/bash-oecore.png" align="center" width="9in" depth="6in" />
+ </para>
+
+ <para>
+ By default, the OpenEmbedded build system builds one of the
+ two recipes.
+ For the <filename>bash</filename> case, version 4.3.30-r0 is
+ built by default.
+ Unfortunately, Toaster as it exists, is not able to override
+ the default recipe version.
+ If you would like to build bash 3.2.48, you need to set the
+ <ulink url='&YOCTO_DOCS_REF_URL;#var-PREFERRED_VERSION'><filename>PREFERRED_VERSION</filename></ulink>
+ variable.
+ You can do so from Toaster, using the "Add variable" form,
+ which is available in the "BitBake variables" page of the
+ project configuration section as shown in the following screen:
+ <imagedata fileref="figures/add-variable.png" align="center" width="9in" depth="6in" />
+ </para>
+
+ <para>
+ To specify <filename>bash</filename> 3.2.48 as the version to build,
+ enter "PREFERRED_VERSION_bash" in the "Variable" field, and "3.2.48"
+ in the "Value" field.
+ Next, click the "Add variable" button:
+ <imagedata fileref="figures/set-variable.png" align="center" width="9in" depth="6in" />
+ </para>
+
+ <para>
+ After clicking the "Add variable" button, the settings for
+ <filename>PREFERRED_VERSION</filename> are added to the bottom
+ of the BitBake variables list.
+ With these settings, the OpenEmbedded build system builds the
+ desired version of the recipe rather than the default version:
+ <imagedata fileref="figures/variable-added.png" align="center" width="9in" depth="6in" />
+ </para>
+ </section>
+ </section>
+</chapter>
diff --git a/poky/documentation/toaster-manual/toaster-manual-start.xml b/poky/documentation/toaster-manual/toaster-manual-start.xml
new file mode 100644
index 000000000..45f604617
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-start.xml
@@ -0,0 +1,115 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<chapter id='toaster-manual-start'>
+
+<title>Preparing to Use Toaster</title>
+
+ <para>
+ This chapter describes how you need to prepare your system in order to
+ use Toaster.
+ </para>
+
+ <section id='toaster-setting-up-the-basic-system-requirements'>
+ <title>Setting Up the Basic System Requirements</title>
+
+ <para>
+ Before you can use Toaster, you need to first set up your
+ build system to run the Yocto Project.
+ To do this, follow the instructions in the
+ "<ulink url='&YOCTO_DOCS_DEV_URL;#setting-up-the-development-host-to-use-the-yocto-project'>Preparing the Build Host</ulink>"
+ section of the Yocto Project Development Tasks
+ Manual.
+ For Ubuntu/Debian, you might also need to do an additional install
+ of pip3.
+ <literallayout class='monospaced'>
+ $ sudo apt-get install python3-pip
+ </literallayout>
+ </para>
+ </section>
+
+ <section id='toaster-establishing-toaster-system-dependencies'>
+ <title>Establishing Toaster System Dependencies</title>
+
+ <para>
+ Toaster requires extra Python dependencies in order to run.
+ A Toaster requirements file named
+ <filename>toaster-requirements.txt</filename> defines the
+ Python dependencies.
+ The requirements file is located in the
+ <filename>bitbake</filename> directory, which is located in the
+ root directory of the
+ <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
+ (e.g. <filename>poky/bitbake/toaster-requirements.txt</filename>).
+ The dependencies appear in a <filename>pip</filename>,
+ install-compatible format.
+ </para>
+
+ <section id='toaster-load-packages'>
+ <title>Install Toaster Packages</title>
+
+ <para>
+ You need to install the packages that Toaster requires.
+ Use this command:
+ <literallayout class='monospaced'>
+ $ pip3 install --user -r bitbake/toaster-requirements.txt
+ </literallayout>
+ The previous command installs the necessary Toaster modules
+ into a local python 3 cache in your
+ <filename>$HOME</filename> directory.
+ The caches is actually located in
+ <filename>$HOME/.local</filename>.
+ To see what packages have been installed into your
+ <filename>$HOME</filename> directory, do the following:
+ <literallayout class='monospaced'>
+ $ pip3 list installed --local
+ </literallayout>
+ If you need to remove something, the following works:
+ <literallayout class='monospaced'>
+ $ pip3 uninstall PackageNameToUninstall
+ </literallayout>
+ </para>
+ </section>
+
+<!-- Commenting this section out for now in case it needs to be used again.
+
+ <section id='toaster-install-daemon'>
+ <title>Install <filename>daemon</filename></title>
+
+ <para>
+ Toaster depends on
+ <ulink url='http://www.libslack.org/daemon/'><filename>daemon</filename></ulink>.
+ Depending on your distribution, how you install
+ <filename>daemon</filename> differs:
+ <itemizedlist>
+ <listitem><para><emphasis>Debian-Based Systems:</emphasis>
+ If you are running a Debian-based distribution,
+ install <filename>daemon</filename> using the
+ following command:
+ <literallayout class='monospaced'>
+ $ sudo apt-get install daemon​
+ </literallayout>
+ </para></listitem>
+ <listitem><para><emphasis>Non-Debian-Based Systems:</emphasis>
+ If you are not running a Debian-based distribution
+ (Redhat-based distribution such as Fedora),
+ you need to download ​the file relevant to the
+ architecture and then install
+ <filename>daemon</filename> manually.
+ Following are the commands for 64-bit distributions:
+ <literallayout class='monospaced'>
+ $ wget http://libslack.org/daemon/download/daemon-0.6.4-1.x86_64.rpm
+ $ sudo rpm -i daemon-0.6.4-1.x86_64.rpm
+ </literallayout>
+ Here are the commands for a 32-bit distribution:
+ <literallayout class='monospaced'>
+ $ wget http://libslack.org/daemon/download/daemon-0.6.4-1.i686.rpm
+ $ sudo rpm -i ​daemon-0.6.4-1.i686.rpm​
+ </literallayout>
+ </para></listitem>
+ </itemizedlist>
+ </para>
+ </section> -->
+ </section>
+</chapter>
diff --git a/poky/documentation/toaster-manual/toaster-manual-style.css b/poky/documentation/toaster-manual/toaster-manual-style.css
new file mode 100644
index 000000000..6d6b9fb65
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual-style.css
@@ -0,0 +1,984 @@
+/*
+ Generic XHTML / DocBook XHTML CSS Stylesheet.
+
+ Browser wrangling and typographic design by
+ Oyvind Kolas / pippin@gimp.org
+
+ Customised for Poky by
+ Matthew Allum / mallum@o-hand.com
+
+ Thanks to:
+ Liam R. E. Quin
+ William Skaggs
+ Jakub Steiner
+
+ Structure
+ ---------
+
+ The stylesheet is divided into the following sections:
+
+ Positioning
+ Margins, paddings, width, font-size, clearing.
+ Decorations
+ Borders, style
+ Colors
+ Colors
+ Graphics
+ Graphical backgrounds
+ Nasty IE tweaks
+ Workarounds needed to make it work in internet explorer,
+ currently makes the stylesheet non validating, but up until
+ this point it is validating.
+ Mozilla extensions
+ Transparency for footer
+ Rounded corners on boxes
+
+*/
+
+
+ /*************** /
+ / Positioning /
+/ ***************/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ width: 80%;
+ margin: 0em auto;
+ padding: 2em 5em 5em 5em;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.authorgroup {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ padding-top: 256px;
+ background-image: url("figures/toaster-title.png");
+ background-position: left top;
+ margin-top: -256px;
+ padding-right: 50px;
+ margin-left: 0px;
+ text-align: right;
+ width: 740px;
+}
+
+h3.author {
+ margin: 0em 0me 0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-weight: normal;
+ font-size: 100%;
+ color: #333;
+ clear: both;
+}
+
+.author tt.email {
+ font-size: 66%;
+}
+
+.titlepage hr {
+ width: 0em;
+ clear: both;
+}
+
+.revhistory {
+ padding-top: 2em;
+ clear: both;
+}
+
+.toc,
+.list-of-tables,
+.list-of-examples,
+.list-of-figures {
+ padding: 1.33em 0em 2.5em 0em;
+ color: #00557D;
+}
+
+.toc p,
+.list-of-tables p,
+.list-of-figures p,
+.list-of-examples p {
+ padding: 0em 0em 0em 0em;
+ padding: 0em 0em 0.3em;
+ margin: 1.5em 0em 0em 0em;
+}
+
+.toc p b,
+.list-of-tables p b,
+.list-of-figures p b,
+.list-of-examples p b{
+ font-size: 100.0%;
+ font-weight: bold;
+}
+
+.toc dl,
+.list-of-tables dl,
+.list-of-figures dl,
+.list-of-examples dl {
+ margin: 0em 0em 0.5em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dt {
+ margin: 0em 0em 0em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.toc dd {
+ margin: 0em 0em 0em 2.6em;
+ padding: 0em 0em 0em 0em;
+}
+
+div.glossary dl,
+div.variablelist dl {
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ font-weight: normal;
+ width: 20em;
+ text-align: right;
+}
+
+.variablelist dl dt {
+ margin-top: 0.5em;
+}
+
+.glossary dl dd,
+.variablelist dl dd {
+ margin-top: -1em;
+ margin-left: 25.5em;
+}
+
+.glossary dd p,
+.variablelist dd p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+
+div.calloutlist table td {
+ padding: 0em 0em 0em 0em;
+ margin: 0em 0em 0em 0em;
+}
+
+div.calloutlist table td p {
+ margin-top: 0em;
+ margin-bottom: 1em;
+}
+
+div p.copyright {
+ text-align: left;
+}
+
+div.legalnotice p.legalnotice-title {
+ margin-bottom: 0em;
+}
+
+p {
+ line-height: 1.5em;
+ margin-top: 0em;
+
+}
+
+dl {
+ padding-top: 0em;
+}
+
+hr {
+ border: solid 1px;
+}
+
+
+.mediaobject,
+.mediaobjectco {
+ text-align: center;
+}
+
+img {
+ border: none;
+}
+
+ul {
+ padding: 0em 0em 0em 1.5em;
+}
+
+ul li {
+ padding: 0em 0em 0em 0em;
+}
+
+ul li p {
+ text-align: left;
+}
+
+table {
+ width :100%;
+}
+
+th {
+ padding: 0.25em;
+ text-align: left;
+ font-weight: normal;
+ vertical-align: top;
+}
+
+td {
+ padding: 0.25em;
+ vertical-align: top;
+}
+
+p a[id] {
+ margin: 0px;
+ padding: 0px;
+ display: inline;
+ background-image: none;
+}
+
+a {
+ text-decoration: underline;
+ color: #444;
+}
+
+pre {
+ overflow: auto;
+}
+
+a:hover {
+ text-decoration: underline;
+ /*font-weight: bold;*/
+}
+
+/* This style defines how the permalink character
+ appears by itself and when hovered over with
+ the mouse. */
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+
+div.informalfigure,
+div.informalexample,
+div.informaltable,
+div.figure,
+div.table,
+div.example {
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+}
+
+
+div.informalfigure p.title b,
+div.informalexample p.title b,
+div.informaltable p.title b,
+div.figure p.title b,
+div.example p.title b,
+div.table p.title b{
+ padding-top: 0em;
+ margin-top: 0em;
+ font-size: 100%;
+ font-weight: normal;
+}
+
+.mediaobject .caption,
+.mediaobject .caption p {
+ text-align: center;
+ font-size: 80%;
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+.epigraph {
+ padding-left: 55%;
+ margin-bottom: 1em;
+}
+
+.epigraph p {
+ text-align: left;
+}
+
+.epigraph .quote {
+ font-style: italic;
+}
+.epigraph .attribution {
+ font-style: normal;
+ text-align: right;
+}
+
+span.application {
+ font-style: italic;
+}
+
+.programlisting {
+ font-family: monospace;
+ font-size: 80%;
+ white-space: pre;
+ margin: 1.33em 0em;
+ padding: 1.33em;
+}
+
+.tip,
+.warning,
+.caution,
+.note {
+ margin-top: 1em;
+ margin-bottom: 1em;
+
+}
+
+/* force full width of table within div */
+.tip table,
+.warning table,
+.caution table,
+.note table {
+ border: none;
+ width: 100%;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ padding: 0.8em 0.0em 0.0em 0.0em;
+ margin : 0em 0em 0em 0em;
+}
+
+.tip p,
+.warning p,
+.caution p,
+.note p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ padding-right: 1em;
+ text-align: left;
+}
+
+.acronym {
+ text-transform: uppercase;
+}
+
+b.keycap,
+.keycap {
+ padding: 0.09em 0.3em;
+ margin: 0em;
+}
+
+.itemizedlist li {
+ clear: none;
+}
+
+.filename {
+ font-size: medium;
+ font-family: Courier, monospace;
+}
+
+
+div.navheader, div.heading{
+ position: absolute;
+ left: 0em;
+ top: 0em;
+ width: 100%;
+ background-color: #cdf;
+ width: 100%;
+}
+
+div.navfooter, div.footing{
+ position: fixed;
+ left: 0em;
+ bottom: 0em;
+ background-color: #eee;
+ width: 100%;
+}
+
+
+div.navheader td,
+div.navfooter td {
+ font-size: 66%;
+}
+
+div.navheader table th {
+ /*font-family: Georgia, Times, serif;*/
+ /*font-size: x-large;*/
+ font-size: 80%;
+}
+
+div.navheader table {
+ border-left: 0em;
+ border-right: 0em;
+ border-top: 0em;
+ width: 100%;
+}
+
+div.navfooter table {
+ border-left: 0em;
+ border-right: 0em;
+ border-bottom: 0em;
+ width: 100%;
+}
+
+div.navheader table td a,
+div.navfooter table td a {
+ color: #777;
+ text-decoration: none;
+}
+
+/* normal text in the footer */
+div.navfooter table td {
+ color: black;
+}
+
+div.navheader table td a:visited,
+div.navfooter table td a:visited {
+ color: #444;
+}
+
+
+/* links in header and footer */
+div.navheader table td a:hover,
+div.navfooter table td a:hover {
+ text-decoration: underline;
+ background-color: transparent;
+ color: #33a;
+}
+
+div.navheader hr,
+div.navfooter hr {
+ display: none;
+}
+
+
+.qandaset tr.question td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+
+.qandaset tr.answer td p {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+}
+.answer td {
+ padding-bottom: 1.5em;
+}
+
+.emphasis {
+ font-weight: bold;
+}
+
+
+ /************* /
+ / decorations /
+/ *************/
+
+.titlepage {
+}
+
+.part .title {
+}
+
+.subtitle {
+ border: none;
+}
+
+/*
+h1 {
+ border: none;
+}
+
+h2 {
+ border-top: solid 0.2em;
+ border-bottom: solid 0.06em;
+}
+
+h3 {
+ border-top: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h4 {
+ border: 0em;
+ border-bottom: solid 0.06em;
+}
+
+h5 {
+ border: 0em;
+}
+*/
+
+.programlisting {
+ border: solid 1px;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example {
+ border: 1px solid;
+}
+
+
+
+.tip,
+.warning,
+.caution,
+.note {
+ border: 1px solid;
+}
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom: 1px solid;
+}
+
+.question td {
+ border-top: 1px solid black;
+}
+
+.answer {
+}
+
+
+b.keycap,
+.keycap {
+ border: 1px solid;
+}
+
+
+div.navheader, div.heading{
+ border-bottom: 1px solid;
+}
+
+
+div.navfooter, div.footing{
+ border-top: 1px solid;
+}
+
+ /********* /
+ / colors /
+/ *********/
+
+body {
+ color: #333;
+ background: white;
+}
+
+a {
+ background: transparent;
+}
+
+a:hover {
+ background-color: #dedede;
+}
+
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7,
+h8 {
+ background-color: transparent;
+}
+
+hr {
+ border-color: #aaa;
+}
+
+
+.tip, .warning, .caution, .note {
+ border-color: #fff;
+}
+
+
+.tip table th,
+.warning table th,
+.caution table th,
+.note table th {
+ border-bottom-color: #fff;
+}
+
+
+.warning {
+ background-color: #f0f0f2;
+}
+
+.caution {
+ background-color: #f0f0f2;
+}
+
+.tip {
+ background-color: #f0f0f2;
+}
+
+.note {
+ background-color: #f0f0f2;
+}
+
+.glossary dl dt,
+.variablelist dl dt,
+.variablelist dl dt span.term {
+ color: #044;
+}
+
+div.figure,
+div.table,
+div.example,
+div.informalfigure,
+div.informaltable,
+div.informalexample {
+ border-color: #aaa;
+}
+
+pre.programlisting {
+ color: black;
+ background-color: #fff;
+ border-color: #aaa;
+ border-width: 2px;
+}
+
+.guimenu,
+.guilabel,
+.guimenuitem {
+ background-color: #eee;
+}
+
+
+b.keycap,
+.keycap {
+ background-color: #eee;
+ border-color: #999;
+}
+
+
+div.navheader {
+ border-color: black;
+}
+
+
+div.navfooter {
+ border-color: black;
+}
+
+
+ /*********** /
+ / graphics /
+/ ***********/
+
+/*
+body {
+ background-image: url("images/body_bg.jpg");
+ background-attachment: fixed;
+}
+
+.navheader,
+.note,
+.tip {
+ background-image: url("images/note_bg.jpg");
+ background-attachment: fixed;
+}
+
+.warning,
+.caution {
+ background-image: url("images/warning_bg.jpg");
+ background-attachment: fixed;
+}
+
+.figure,
+.informalfigure,
+.example,
+.informalexample,
+.table,
+.informaltable {
+ background-image: url("images/figure_bg.jpg");
+ background-attachment: fixed;
+}
+
+*/
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+h7{
+}
+
+/*
+Example of how to stick an image as part of the title.
+
+div.article .titlepage .title
+{
+ background-image: url("figures/white-on-black.png");
+ background-position: center;
+ background-repeat: repeat-x;
+}
+*/
+
+div.preface .titlepage .title,
+div.colophon .title,
+div.chapter .titlepage .title,
+div.article .titlepage .title
+{
+}
+
+div.section div.section .titlepage .title,
+div.sect2 .titlepage .title {
+ background: none;
+}
+
+
+h1.title {
+ background-color: transparent;
+ background-repeat: no-repeat;
+ height: 256px;
+ text-indent: -9000px;
+ overflow:hidden;
+}
+
+h2.subtitle {
+ background-color: transparent;
+ text-indent: -9000px;
+ overflow:hidden;
+ width: 0px;
+ display: none;
+}
+
+ /*************************************** /
+ / pippin.gimp.org specific alterations /
+/ ***************************************/
+
+/*
+div.heading, div.navheader {
+ color: #777;
+ font-size: 80%;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ height: 50px;
+ background: url('/gfx/heading_bg.png') transparent;
+ background-repeat: repeat-x;
+ background-attachment: fixed;
+ border: none;
+}
+
+div.heading a {
+ color: #444;
+}
+
+div.footing, div.navfooter {
+ border: none;
+ color: #ddd;
+ font-size: 80%;
+ text-align:right;
+
+ width: 100%;
+ padding-top: 10px;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+
+ background: url('/gfx/footing_bg.png') transparent;
+}
+*/
+
+
+
+ /****************** /
+ / nasty ie tweaks /
+/ ******************/
+
+/*
+div.heading, div.navheader {
+ width:expression(document.body.clientWidth + "px");
+}
+
+div.footing, div.navfooter {
+ width:expression(document.body.clientWidth + "px");
+ margin-left:expression("-5em");
+}
+body {
+ padding:expression("4em 5em 0em 5em");
+}
+*/
+
+ /**************************************** /
+ / mozilla vendor specific css extensions /
+/ ****************************************/
+/*
+div.navfooter, div.footing{
+ -moz-opacity: 0.8em;
+}
+
+div.figure,
+div.table,
+div.informalfigure,
+div.informaltable,
+div.informalexample,
+div.example,
+.tip,
+.warning,
+.caution,
+.note {
+ -moz-border-radius: 0.5em;
+}
+
+b.keycap,
+.keycap {
+ -moz-border-radius: 0.3em;
+}
+*/
+
+table tr td table tr td {
+ display: none;
+}
+
+
+hr {
+ display: none;
+}
+
+table {
+ border: 0em;
+}
+
+ .photo {
+ float: right;
+ margin-left: 1.5em;
+ margin-bottom: 1.5em;
+ margin-top: 0em;
+ max-width: 17em;
+ border: 1px solid gray;
+ padding: 3px;
+ background: white;
+}
+ .seperator {
+ padding-top: 2em;
+ clear: both;
+ }
+
+ #validators {
+ margin-top: 5em;
+ text-align: right;
+ color: #777;
+ }
+ @media print {
+ body {
+ font-size: 8pt;
+ }
+ .noprint {
+ display: none;
+ }
+ }
+
+
+.tip,
+.note {
+ background: #f0f0f2;
+ color: #333;
+ padding: 20px;
+ margin: 20px;
+}
+
+.tip h3,
+.note h3 {
+ padding: 0em;
+ margin: 0em;
+ font-size: 2em;
+ font-weight: bold;
+ color: #333;
+}
+
+.tip a,
+.note a {
+ color: #333;
+ text-decoration: underline;
+}
+
+.footnote {
+ font-size: small;
+ color: #333;
+}
+
+/* Changes the announcement text */
+.tip h3,
+.warning h3,
+.caution h3,
+.note h3 {
+ font-size:large;
+ color: #00557D;
+}
diff --git a/poky/documentation/toaster-manual/toaster-manual.xml b/poky/documentation/toaster-manual/toaster-manual.xml
new file mode 100644
index 000000000..188874488
--- /dev/null
+++ b/poky/documentation/toaster-manual/toaster-manual.xml
@@ -0,0 +1,137 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
+
+<book id='toaster-manual' lang='en'
+ xmlns:xi="http://www.w3.org/2003/XInclude"
+ xmlns="http://docbook.org/ns/docbook"
+ >
+ <bookinfo>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref='figures/toaster-title.png'
+ format='SVG'
+ align='left' scalefit='1' width='100%'/>
+ </imageobject>
+ </mediaobject>
+
+ <title>
+ Toaster User Manual
+ </title>
+
+ <authorgroup>
+ <author>
+ <firstname>Kristi</firstname> <surname>Rifenbark</surname>
+ <affiliation>
+ <orgname>Scotty's Documentation Services, INC</orgname>
+ </affiliation>
+ <email>kristi@buzzcollectivemarketing.com</email>
+ </author>
+ </authorgroup>
+
+ <revhistory>
+ <revision>
+ <revnumber>1.8</revnumber>
+ <date>April 2015</date>
+ <revremark>Released with the Yocto Project 1.8 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.0</revnumber>
+ <date>October 2015</date>
+ <revremark>Released with the Yocto Project 2.0 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.1</revnumber>
+ <date>April 2016</date>
+ <revremark>Released with the Yocto Project 2.1 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.2</revnumber>
+ <date>October 2016</date>
+ <revremark>Released with the Yocto Project 2.2 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.3</revnumber>
+ <date>May 2017</date>
+ <revremark>Released with the Yocto Project 2.3 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.4</revnumber>
+ <date>October 2017</date>
+ <revremark>Released with the Yocto Project 2.4 Release.</revremark>
+ </revision>
+ <revision>
+ <revnumber>2.5</revnumber>
+ <date>May 2018</date>
+ <revremark>Released with the Yocto Project 2.5 Release.</revremark>
+ </revision>
+ </revhistory>
+
+ <copyright>
+ <year>&COPYRIGHT_YEAR;</year>
+ <holder>Linux Foundation</holder>
+ </copyright>
+
+ <legalnotice>
+ <para>
+ Permission is granted to copy, distribute and/or modify this document under
+ the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England &amp; Wales</ulink> as published by Creative Commons.
+ </para>
+ <note><title>Manual Notes</title>
+ <itemizedlist>
+ <listitem><para>
+ This version of the
+ <emphasis>Toaster User Manual</emphasis>
+ is for the &YOCTO_DOC_VERSION; release of the
+ Yocto Project.
+ To be sure you have the latest version of the manual
+ for this release, go to the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual from that site.
+ Manuals from the site are more up-to-date than manuals
+ derived from the Yocto Project released TAR files.
+ </para></listitem>
+ <listitem><para>
+ If you located this manual through a web search, the
+ version of the manual might not be the one you want
+ (e.g. the search might have returned a manual much
+ older than the Yocto Project version with which you
+ are working).
+ You can see all Yocto Project major releases by
+ visiting the
+ <ulink url='&YOCTO_WIKI_URL;/wiki/Releases'>Releases</ulink>
+ page.
+ If you need a version of this manual for a different
+ Yocto Project release, visit the
+ <ulink url='&YOCTO_HOME_URL;/documentation'>Yocto Project documentation page</ulink>
+ and select the manual set by using the
+ "ACTIVE RELEASES DOCUMENTATION" or "DOCUMENTS ARCHIVE"
+ pull-down menus.
+ </para></listitem>
+ <listitem><para>
+ To report any inaccuracies or problems with this
+ manual, send an email to the Yocto Project
+ discussion group at
+ <filename>yocto@yoctoproject.com</filename> or log into
+ the freenode <filename>#yocto</filename> channel.
+ </para></listitem>
+ </itemizedlist>
+ </note>
+
+ </legalnotice>
+
+ </bookinfo>
+
+ <xi:include href="toaster-manual-intro.xml"/>
+
+ <xi:include href="toaster-manual-start.xml"/>
+
+ <xi:include href="toaster-manual-setup-and-use.xml"/>
+
+ <xi:include href="toaster-manual-reference.xml"/>
+
+</book>
+<!--
+vim: expandtab tw=80 ts=4
+-->
diff --git a/poky/documentation/tools/eclipse-help.sed b/poky/documentation/tools/eclipse-help.sed
new file mode 100644
index 000000000..ab5c9affd
--- /dev/null
+++ b/poky/documentation/tools/eclipse-help.sed
@@ -0,0 +1,18 @@
+# Process poky-ref-manual and yocto-project-qs manual (<word>-<word>-<word> style)
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/poky-ref-manual/poky-ref-manual.html#faq"
+# -> "link" href="../poky-ref-manual/faq.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*-[a-z]*)/[a-z]*-[a-z]*-[a-z]*.html#([^"]*)"/@"link" href="../1/2.html"@g
+
+# Processes all other manuals (<word>-<word> style)
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html#faq"
+# -> "link" href="../kernel-manual/faq.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*)/[a-z]*-[a-z]*.html#([^"]*)"@"link" href="../1/2.html"@g
+
+# Process cases where just an external manual is referenced without an id anchor
+# For example:
+# "ulink" href="http://www.yoctoproject.org/docs/1.3/kernel-manual/kernel-manual.html
+# -> "link" href="../kernel-manual/index.html"
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*-[a-z]*)/[a-z]*-[a-z]*-[a-z]*.html"@"link" href="../1/index.html"@g
+s@"ulink" href="http://www.yoctoproject.org/docs/[^/]*/([a-z]*-[a-z]*)/[a-z]*-[a-z]*.html"@"link" href="../1/index.html"@g
diff --git a/poky/documentation/tools/mega-manual.sed b/poky/documentation/tools/mega-manual.sed
new file mode 100644
index 000000000..64fa4d219
--- /dev/null
+++ b/poky/documentation/tools/mega-manual.sed
@@ -0,0 +1,40 @@
+# Processes poky-ref-manual and yocto-project-qs manual (<word>-<word>-<word> style).
+# This style is for manual folders like "yocto-project-qs" and "poky-ref-manual".
+# This is the old way that did it. Can't do that now that we have "bitbake-user-manual" strings
+# in the mega-manual.
+# s@"ulink" href="http://www.yoctoproject.org/docs/2.5/[a-z]*-[a-z]*-[a-z]*/[a-z]*-[a-z]*-[a-z]*.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/yocto-project-qs/yocto-project-qs.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/poky-ref-manual/poky-ref-manual.html#@"link" href="#@g
+
+# Processes all other manuals (<word>-<word> style) except for the BitBake User Manual because
+# it is not included in the mega-manual.
+# This style is for manual folders that use two word, which is the standard now (e.g. "ref-manual").
+# This was the one-liner that worked before we introduced the BitBake User Manual, which is
+# not in the mega-manual.
+# s@"ulink" href="http://www.yoctoproject.org/docs/2.5/[a-z]*-[a-z]*/[a-z]*-[a-z]*.html#@"link" href="#@g
+
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/sdk-manual/sdk-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/overview-manual/overview-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/brief-yoctoprojectqs/brief-yoctoprojectqs.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/kernel-dev/kernel-dev.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/profile-manual/profile-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html#@"link" href="#@g
+s@"ulink" href="http://www.yoctoproject.org/docs/2.5/toaster-manual/toaster-manual.html#@"link" href="#@g
+
+# Process cases where just an external manual is referenced without an id anchor
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/brief-yoctoprojectqs/brief-yoctoprojectqs.html" target="_top">Yocto Project Quick Build</a>@Yocto Project Quick Build@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/yocto-project-qs/yocto-project-qs.html" target="_top">Yocto Project Quick Start</a>@Yocto Project Quick Start@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html" target="_top">Yocto Project Development Tasks Manual</a>@Yocto Project Development Tasks Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/overview-manual/overview-manual.html" target="_top">Yocto Project Overview and Concepts Manual</a>@Yocto project Overview and Concepts Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/sdk-manual/sdk-manual.html" target="_top">Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</a>@Yocto Project Application Development and the Extensible Software Development Kit (eSDK)@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html" target="_top">Yocto Project Board Support Package (BSP) Developer's Guide</a>@Yocto Project Board Support Package (BSP) Developer's Guide@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/profile-manual/profile-manual.html" target="_top">Yocto Project Profiling and Tracing Manual</a>@Yocto Project Profiling and Tracing Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/kernel-dev/kernel-dev.html" target="_top">Yocto Project Linux Kernel Development Manual</a>@Yocto Project Linux Kernel Development Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html" target="_top">Yocto Project Reference Manual</a>@Yocto Project Reference Manual@g
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/toaster-manual/toaster-manual.html" target="_top">Toaster User Manual</a>@Toaster User Manual@g
+
+# Process a single, rouge occurrence of a linked reference to the Mega-Manual.
+s@<a class="ulink" href="http://www.yoctoproject.org/docs/2.5/mega-manual/mega-manual.html" target="_top">Yocto Project Mega-Manual</a>@Yocto Project Mega-Manual@g
+
diff --git a/poky/documentation/tools/poky-docbook-to-pdf b/poky/documentation/tools/poky-docbook-to-pdf
new file mode 100755
index 000000000..f55fd278a
--- /dev/null
+++ b/poky/documentation/tools/poky-docbook-to-pdf
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+if [ -z "$1" -o -z "$2" ]; then
+ echo "usage: [-v] $0 <docbook file> <templatedir>"
+ echo
+ echo "*NOTE* you need xsltproc, fop and nwalsh docbook stylesheets"
+ echo " installed for this to work!"
+ echo
+ exit 0
+fi
+
+FO=`echo $1 | sed s/.xml/.fo/` || exit 1
+PDF=`echo $1 | sed s/.xml/.pdf/` || exit 1
+TEMPLATEDIR=$2
+
+##
+# These URI should be rewritten by your distribution's xml catalog to
+# match your localy installed XSL stylesheets.
+XSL_BASE_URI="http://docbook.sourceforge.net/release/xsl/current"
+
+# Creates a temporary XSL stylesheet based on titlepage.xsl
+xsltproc -o /tmp/titlepage.xsl \
+ --xinclude \
+ $XSL_BASE_URI/template/titlepage.xsl \
+ $TEMPLATEDIR/titlepage.templates.xml || exit 1
+
+# Creates the file needed for FOP
+xsltproc --xinclude \
+ --stringparam hyphenate false \
+ --stringparam formal.title.placement "figure after" \
+ --stringparam ulink.show 1 \
+ --stringparam body.font.master 9 \
+ --stringparam title.font.master 11 \
+ --stringparam draft.watermark.image "$TEMPLATEDIR/draft.png" \
+ --stringparam chapter.autolabel 1 \
+ --stringparam appendix.autolabel A \
+ --stringparam section.autolabel 1 \
+ --stringparam section.label.includes.component.label 1 \
+ --output $FO \
+ $TEMPLATEDIR/poky-db-pdf.xsl \
+ $1 || exit 1
+
+# Invokes the Java version of FOP. Uses the additional configuration file common/fop-config.xml
+fop -c $TEMPLATEDIR/fop-config.xml -fo $FO -pdf $PDF || exit 1
+
+rm -f $FO
+rm -f /tmp/titlepage.xsl
+
+echo
+echo " #### Success! $PDF ready. ####"
+echo
diff --git a/poky/documentation/tools/update-documentation-conf b/poky/documentation/tools/update-documentation-conf
new file mode 100644
index 000000000..3f8d28009
--- /dev/null
+++ b/poky/documentation/tools/update-documentation-conf
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+
+# documentation.conf update script
+#
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+import sys
+import os
+import argparse
+import re
+from lxml import etree
+import logging
+
+def logger_create(name):
+ logger = logging.getLogger(name)
+ loggerhandler = logging.StreamHandler()
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(loggerhandler)
+ logger.setLevel(logging.INFO)
+ return logger
+logger = logger_create('docconfupdater')
+
+def main():
+ parser = argparse.ArgumentParser(description="documentation.conf updater")
+ parser.add_argument('basepath', help='Path to OE-Core base directory')
+ parser.add_argument('-q', '--quiet', help='Print only warnings/errors', action='store_true')
+
+ args = parser.parse_args()
+
+ if args.quiet:
+ logger.setLevel(logging.WARN)
+
+ if not os.path.isdir(args.basepath):
+ logger.error('Specified base path %s not found')
+ return 1
+
+ doc_conf = os.path.join(args.basepath, 'meta', 'conf', 'documentation.conf')
+ if not os.path.exists(doc_conf):
+ logger.error('Unable to find %s' % doc_conf)
+ return 1
+
+ allowed_flags = ['doc']
+ flag_re = re.compile(r'\[(.+?)\]')
+
+ infos = {}
+ tree = etree.parse('ref-manual/ref-variables.xml')
+ root = tree.getroot()
+ for glossary in root.findall('glossary'):
+ for glossdiv in glossary.findall('glossdiv'):
+ for glossentry in glossdiv.findall('glossentry'):
+ info = glossentry.find('info')
+ if info is not None:
+ infoline = ' '.join(info.text.split())
+ infolinesplit = infoline.split('=', 1)
+ if len(infoline) < 2:
+ logger.warn('Invalid info line (no = character), ignoring: %s' % infoline)
+ continue
+ flags = flag_re.findall(infolinesplit[0])
+ if not flags:
+ logger.warn('Invalid info line (no varflag), ignoring: %s' % infoline)
+ continue
+ for flag in flags:
+ if flag not in allowed_flags:
+ logger.warn('Invalid info line (varflag %s not in allowed list), ignoring: %s' % (flag, infoline))
+ continue
+ infos[infolinesplit[0].rstrip()] = infolinesplit[1].lstrip()
+
+ if not infos:
+ logger.error('ERROR: Unable to find any info tags in the glossary')
+ return 1
+
+ def sortkey(key):
+ # Underscores sort undesirably, so replace them
+ return key.split('[')[0].replace('_', '-')
+
+ changed = False
+ lines = []
+ invars = False
+ lastletter = None
+ added = []
+ with open(doc_conf, 'r') as dcf:
+ for line in dcf:
+ if not invars:
+ if line.startswith('#') and 'DESCRIPTIONS FOR VARIABLES' in line:
+ invars = True
+ elif not line.startswith('#'):
+ linesplit = line.split('=', 1)
+ if len(linesplit) > 1:
+ key = linesplit[0].rstrip()
+ lastletter = key[0]
+ # Find anything in the dict that should come before the current key
+ for dkey in sorted(infos.keys()):
+ if sortkey(dkey) < sortkey(key):
+ lines.append('%s = %s\n' % (dkey, infos[dkey]))
+ added.append(dkey)
+ del infos[dkey]
+ changed = True
+ newvalue = infos.get(key, None)
+ if newvalue:
+ del infos[key]
+ if newvalue != linesplit[1].strip():
+ lines.append('%s = %s\n' % (key, newvalue))
+ changed = True
+ continue
+ elif key in added:
+ # We already added a new value for this key, so skip it
+ continue
+ elif lastletter:
+ # Ensure we write out anything anything left over for this letter
+ for dkey in sorted(infos.keys()):
+ if dkey[0] == lastletter:
+ lines.append('%s = %s\n' % (dkey, infos[dkey]))
+ del infos[dkey]
+ changed = True
+ elif dkey[0] > lastletter:
+ # List is sorted, so we're done
+ break
+ lastletter = None
+ lines.append(line)
+
+ if not invars:
+ logger.error('ERROR: Unable to find variables section in documentation.conf')
+ return 1
+
+ if infos:
+ changed = True
+ # Write out anything left over
+ lines.append('\n\n')
+ for key in sorted(infos.keys()):
+ lines.append('%s = %s\n' % (key, infos[key]))
+
+ if changed:
+ logger.info('Updating %s' % doc_conf)
+ with open(doc_conf, 'w') as dcf:
+ for line in lines:
+ dcf.write(line)
+ else:
+ logger.info('No changes required')
+
+ return 0
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc(5)
+ sys.exit(ret)
+
+
diff --git a/poky/meta-poky/README.poky b/poky/meta-poky/README.poky
new file mode 100644
index 000000000..0a4284318
--- /dev/null
+++ b/poky/meta-poky/README.poky
@@ -0,0 +1,58 @@
+Poky
+====
+
+Poky is an integration of various components to form a complete prepackaged
+build system and development environment. It features support for building
+customised embedded device style images. There are reference demo images
+featuring a X11/Matchbox/GTK themed UI called Sato. The system supports
+cross-architecture application development using QEMU emulation and a
+standalone toolchain and SDK with IDE integration.
+
+Additional information on the specifics of hardware that Poky supports
+is available in README.hardware. Further hardware support can easily be added
+in the form of layers which extend the systems capabilities in a modular way.
+
+As an integration layer Poky consists of several upstream projects such as
+BitBake, OpenEmbedded-Core, Yocto documentation and various sources of information
+e.g. for the hardware support. Poky is in turn a component of the Yocto Project.
+
+The Yocto Project has extensive documentation about the system including a
+reference manual which can be found at:
+ http://yoctoproject.org/documentation
+
+OpenEmbedded-Core is a layer containing the core metadata for current versions
+of OpenEmbedded. It is distro-less (can build a functional image with
+DISTRO = "nodistro") and contains only emulated machine support.
+
+For information about OpenEmbedded, see the OpenEmbedded website:
+ http://www.openembedded.org/
+
+Where to Send Patches
+=====================
+
+As Poky is an integration repository (built using a tool called combo-layer),
+patches against the various components should be sent to their respective
+upstreams:
+
+bitbake:
+ Git repository: http://git.openembedded.org/bitbake/
+ Mailing list: bitbake-devel@lists.openembedded.org
+
+documentation:
+ Git repository: http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/
+ Mailing list: yocto@yoctoproject.org
+
+meta-poky, meta-yocto-bsp:
+ Git repository: http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto(-bsp)
+ Mailing list: poky@yoctoproject.org
+
+Everything else should be sent to the OpenEmbedded Core mailing list. If in
+doubt, check the oe-core git repository for the content you intend to modify.
+Before sending, be sure the patches apply cleanly to the current oe-core git
+repository.
+
+ Git repository: http://git.openembedded.org/openembedded-core/
+ Mailing list: openembedded-core@lists.openembedded.org
+
+Note: The scripts directory should be treated with extra care as it is a mix of
+oe-core and poky-specific files from meta-poky.
diff --git a/poky/meta-poky/classes/poky-sanity.bbclass b/poky/meta-poky/classes/poky-sanity.bbclass
new file mode 100644
index 000000000..81cd2eb6a
--- /dev/null
+++ b/poky/meta-poky/classes/poky-sanity.bbclass
@@ -0,0 +1,46 @@
+# Provide some extensions to sanity.bbclass to handle poky-specific conf file upgrades
+
+python poky_update_bblayersconf() {
+ current_version = int(d.getVar('POKY_BBLAYERS_CONF_VERSION', True) or -1)
+ latest_version = int(d.getVar('REQUIRED_POKY_BBLAYERS_CONF_VERSION', True) or -1)
+ if current_version == -1 or latest_version == -1:
+ # one or the other missing => malformed configuration
+ raise NotImplementedError("You need to update bblayers.conf manually for this version transition")
+
+ success = True
+
+ # check for out of date templateconf.cfg file
+ lines = []
+ fn = os.path.join(d.getVar('TOPDIR', True), 'conf/templateconf.cfg')
+
+ lines = sanity_conf_read(fn)
+ index, meta_yocto_line = sanity_conf_find_line(r'^meta-yocto/', lines)
+ if meta_yocto_line:
+ lines[index] = meta_yocto_line.replace('meta-yocto', 'meta-poky')
+ with open(fn, "w") as f:
+ f.write(''.join(lines))
+ bb.note("Your conf/templateconf.cfg file was updated from meta-yocto to meta-poky")
+
+ # add any additional layer checks/changes here
+
+ if success:
+ current_version = latest_version
+ bblayers_fn = bblayers_conf_file(d)
+ lines = sanity_conf_read(bblayers_fn)
+ # sanity_conf_update() will erroneously find a match when the var name
+ # is used in a comment, so do our own here. The code below can be
+ # removed when sanity_conf_update() is fixed in OE-Core.
+ #sanity_conf_update(bblayers_fn, lines, 'POKY_BBLAYERS_CONF_VERSION', current_version)
+ index, line = sanity_conf_find_line(r'^POKY_BBLAYERS_CONF_VERSION', lines)
+ lines[index] = 'POKY_BBLAYERS_CONF_VERSION = "%d"\n' % current_version
+ with open(bblayers_fn, "w") as f:
+ f.write(''.join(lines))
+ bb.note("Your conf/bblayers.conf has been automatically updated.")
+ if success:
+ return
+
+ raise NotImplementedError("You need to update bblayers.conf manually for this version transition")
+}
+
+# ensure our function runs after the OE-Core one
+BBLAYERS_CONF_UPDATE_FUNCS += "conf/bblayers.conf:POKY_BBLAYERS_CONF_VERSION:REQUIRED_POKY_BBLAYERS_CONF_VERSION:poky_update_bblayersconf"
diff --git a/poky/meta-poky/conf/bblayers.conf.sample b/poky/meta-poky/conf/bblayers.conf.sample
new file mode 100644
index 000000000..8b1cbdfc5
--- /dev/null
+++ b/poky/meta-poky/conf/bblayers.conf.sample
@@ -0,0 +1,12 @@
+# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+POKY_BBLAYERS_CONF_VERSION = "2"
+
+BBPATH = "${TOPDIR}"
+BBFILES ?= ""
+
+BBLAYERS ?= " \
+ ##OEROOT##/meta \
+ ##OEROOT##/meta-poky \
+ ##OEROOT##/meta-yocto-bsp \
+ "
diff --git a/poky/meta-poky/conf/conf-notes.txt b/poky/meta-poky/conf/conf-notes.txt
new file mode 100644
index 000000000..f1a4f4da1
--- /dev/null
+++ b/poky/meta-poky/conf/conf-notes.txt
@@ -0,0 +1,12 @@
+
+### Shell environment set up for builds. ###
+
+You can now run 'bitbake <target>'
+
+Common targets are:
+ core-image-minimal
+ core-image-sato
+ meta-toolchain
+ meta-ide-support
+
+You can also run generated qemu images with a command like 'runqemu qemux86'
diff --git a/poky/meta-poky/conf/distro/include/poky-floating-revisions.inc b/poky/meta-poky/conf/distro/include/poky-floating-revisions.inc
new file mode 100644
index 000000000..a3da043d9
--- /dev/null
+++ b/poky/meta-poky/conf/distro/include/poky-floating-revisions.inc
@@ -0,0 +1,58 @@
+#
+# Package Versions for cutting edge testing:
+#
+
+#SRCREV_pn-opkg-native ?= "${AUTOREV}"
+#SRCREV_pn-opkg-sdk ?= "${AUTOREV}"
+#SRCREV_pn-opkg ?= "${AUTOREV}"
+#SRCREV_pn-opkg-utils-native ?= "${AUTOREV}"
+#SRCREV_pn-opkg-utils ?= "${AUTOREV}"
+SRCREV_pn-gconf-dbus ?= "${AUTOREV}"
+SRCREV_pn-matchbox-common ?= "${AUTOREV}"
+SRCREV_pn-matchbox-config-gtk ?= "${AUTOREV}"
+SRCREV_pn-matchbox-desktop ?= "${AUTOREV}"
+SRCREV_pn-matchbox-keyboard ?= "${AUTOREV}"
+SRCREV_pn-matchbox-panel-2 ?= "${AUTOREV}"
+SRCREV_pn-matchbox-themes-extra ?= "${AUTOREV}"
+SRCREV_pn-matchbox-terminal ?= "${AUTOREV}"
+SRCREV_pn-matchbox-wm ?= "${AUTOREV}"
+SRCREV_pn-settings-daemon ?= "${AUTOREV}"
+SRCREV_pn-screenshot ?= "${AUTOREV}"
+SRCREV_pn-libfakekey ?= "${AUTOREV}"
+SRCREV_pn-psplash ?= "${AUTOREV}"
+SRCREV_pn-gtk-sato-engine ?= "${AUTOREV}"
+SRCREV_pn-matchbox-theme-sato ?= "${AUTOREV}"
+SRCREV_pn-sato-icon-theme ?= "${AUTOREV}"
+SRCREV_pn-matchbox-desktop-sato ?= "${AUTOREV}"
+SRCREV_pn-oh-puzzles ?= "${AUTOREV}"
+SRCREV_pn-libowl ?= "${AUTOREV}"
+SRCREV_pn-fstests ?= "${AUTOREV}"
+SRCREV_pn-xvideo-tests ?= "${AUTOREV}"
+SRCREV_pn-clutter ?= "${AUTOREV}"
+SRCREV_pn-clutter-gst ?= "${AUTOREV}"
+SRCREV_pn-libmatchbox ?= "${AUTOREV}"
+SRCREV_pn-ofono ?= "${AUTOREV}"
+
+SRCREV_pn-dri2proto = "${AUTOREV}"
+#PREFERRED_VERSION_dri2proto ?= "1.99.1+git%"
+SRCREV_pn-libdrm = "${AUTOREV}"
+#PREFERRED_VERSION_libdrm ?= "2.4.0+git%"
+SRCREV_pn-libxcb = "${AUTOREV}"
+#PREFERRED_VERSION_libxcb ?= "1.1.90.1+gitr%"
+SRCREV_pn-lib-proto = "${AUTOREV}"
+#PREFERRED_VERSION_xcb-proto ?= "1.2+gitr%"
+SRCREV_pn-libxcb-sdk = "${AUTOREV}"
+#PREFERRED_VERSION_libxcb-sdk ?= "1.1.90.1+gitr%"
+SRCREV_pn-xf86-input-evdev = "${AUTOREV}"
+#PREFERRED_VERSION_xf86-input-evdev ?= "2.0.4"
+SRCREV_pn-xf86-input-mouse = "${AUTOREV}"
+#PREFERRED_VERSION_xf86-input-mouse ?= "1.3.0+git%"
+SRCREV_pn-xf86-input-keyboard = "${AUTOREV}"
+#PREFERRED_VERSION_xf86-input-keyboard ?= "1.3.1+git%"
+SRCREV_pn-xf86-input-synaptics = "${AUTOREV}"
+#PREFERRED_VERSION_xf86-input-synaptics ?= "0.15.2+git%"
+
+#SRCDATE_oprofile ?= "${DATE}"
+
+PREFERRED_VERSION_oprofile ?= "0.9.4+cvs${SRCDATE_oprofile}"
+
diff --git a/poky/meta-poky/conf/distro/include/poky-world-exclude.inc b/poky/meta-poky/conf/distro/include/poky-world-exclude.inc
new file mode 100644
index 000000000..1a2dea585
--- /dev/null
+++ b/poky/meta-poky/conf/distro/include/poky-world-exclude.inc
@@ -0,0 +1,4 @@
+#
+# Things we exlude fromw world testing within the reference distro
+#
+
diff --git a/poky/meta-poky/conf/distro/poky-bleeding.conf b/poky/meta-poky/conf/distro/poky-bleeding.conf
new file mode 100644
index 000000000..2d3e046a4
--- /dev/null
+++ b/poky/meta-poky/conf/distro/poky-bleeding.conf
@@ -0,0 +1,11 @@
+PREFERRED_VERSION_glib-2.0 ?= "2.17.4"
+PREFERRED_VERSION_glib-2.0-native ?= "2.17.4"
+PREFERRED_VERSION_atk ?= "1.22.0"
+PREFERRED_VERSION_pango ?= "1.21.2"
+PREFERRED_VERSION_gtk+ ?= "2.13.3"
+
+require conf/distro/include/poky-floating-revisions.inc
+require conf/distro/poky.conf
+
+DISTRO = "poky-bleeding"
+DISTROOVERRIDES = "poky"
diff --git a/poky/meta-poky/conf/distro/poky-lsb.conf b/poky/meta-poky/conf/distro/poky-lsb.conf
new file mode 100644
index 000000000..ecfe5d2f4
--- /dev/null
+++ b/poky/meta-poky/conf/distro/poky-lsb.conf
@@ -0,0 +1,15 @@
+
+require conf/distro/poky.conf
+require conf/distro/include/security_flags.inc
+
+DISTRO = "poky-lsb"
+DISTROOVERRIDES = "poky:linuxstdbase"
+
+DISTRO_FEATURES_append = " pam largefile opengl"
+PREFERRED_PROVIDER_virtual/libx11 = "libx11"
+
+# Ensure the kernel nfs server is enabled
+KERNEL_FEATURES_append_pn-linux-yocto = " features/nfsd/nfsd-enable.scc"
+
+# Use the LTSI Kernel for LSB Testing
+PREFERRED_VERSION_linux-yocto_linuxstdbase ?= "4.14%"
diff --git a/poky/meta-poky/conf/distro/poky-tiny.conf b/poky/meta-poky/conf/distro/poky-tiny.conf
new file mode 100644
index 000000000..7b22a13ca
--- /dev/null
+++ b/poky/meta-poky/conf/distro/poky-tiny.conf
@@ -0,0 +1,132 @@
+# Distribution definition for: poky-tiny
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This file is released under the MIT license as described in
+# ../meta/COPYING.MIT.
+#
+# Poky-tiny is intended to define a tiny Linux system comprised of a
+# Linux kernel tailored to support each specific MACHINE and busybox.
+# Poky-tiny sets some basic policy to ensure a usable system while still
+# keeping the rootfs and kernel image as small as possible.
+#
+# The policies defined are intended to meet the following goals:
+# o Serial consoles only (no framebuffer or VGA console)
+# o Basic support for IPV4 networking
+# o Single user ash shell
+# o Static images (no support for adding packages or libraries later)
+# o Read-only or RAMFS root filesystem
+# o Combined Linux kernel + rootfs in under 4MB
+# o Allow the user to select between eglibc or uclibc with the TCLIBC variable
+#
+# This is currently a partial definition, the following tasks remain:
+# [ ] Integrate linux-yocto-tiny ktype into linux-yocto
+# [ ] Define linux-yocto-tiny configs for all supported BSPs
+# [ ] Drop ldconfig from the installation
+# [ ] Modify the runqemu scripts to work with ext2 parameter:
+# runqemu qemux86 qemuparams="-nographic" bootparams="console=ttyS0,115200 root=0800"
+# [ ] Modify busybox to allow for DISTRO_FEATURES-like confiruration
+
+require conf/distro/poky.conf
+DISTRO = "poky-tiny"
+DISTROOVERRIDES = "poky:poky-tiny"
+TCLIBC = "musl"
+# FIXME: consider adding a new "tiny" feature
+#DISTRO_FEATURES_append = " tiny"
+
+# Distro config is evaluated after the machine config, so we have to explicitly
+# set the kernel provider to override a machine config.
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
+PREFERRED_VERSION_linux-yocto-tiny ?= "4.14%"
+
+# We can use packagegroup-core-boot, but in the future we may need a new packagegroup-core-tiny
+#POKY_DEFAULT_EXTRA_RDEPENDS += "packagegroup-core-boot"
+# Drop kernel-module-af-packet from RRECOMMENDS
+POKY_DEFAULT_EXTRA_RRECOMMENDS = ""
+
+# FIXME: what should we do with this?
+TCLIBCAPPEND = ""
+
+# Disable wide char support for ncurses as we don't include it in
+# in the LIBC features below.
+# Leave native enable to avoid build failures
+ENABLE_WIDEC = "false"
+ENABLE_WIDEC_class-native = "true"
+
+# Drop native language support. This removes the
+# eglibc->bash->gettext->libc-posix-clang-wchar dependency.
+USE_NLS="no"
+
+# Comment out any of the lines below to disable them in the build
+# DISTRO_FEATURES options:
+# alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci
+DISTRO_FEATURES_TINY = "pci"
+DISTRO_FEATURES_NET = "ipv4 ipv6"
+DISTRO_FEATURES_USB = "usbhost"
+#DISTRO_FEATURES_USBGADGET = "usbgadget"
+#DISTRO_FEATURES_WIFI = "wifi"
+
+DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \
+ ${DISTRO_FEATURES_NET} \
+ ${DISTRO_FEATURES_USB} \
+ ${DISTRO_FEATURES_USBGADGET} \
+ ${DISTRO_FEATURES_WIFI} \
+ "
+
+# Enable LFS - see bug YOCTO #5865
+DISTRO_FEATURES_append_libc-uclibc = " largefile"
+DISTRO_FEATURES_append_libc-musl = " largefile"
+
+DISTRO_FEATURES_class-native = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
+
+# enable mdev/busybox for init
+VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+VIRTUAL-RUNTIME_login_manager = "busybox"
+VIRTUAL-RUNTIME_init_manager = "busybox"
+VIRTUAL-RUNTIME_initscripts = "initscripts"
+VIRTUAL-RUNTIME_keymaps = "keymaps"
+DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in
+# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and
+# netbase.
+
+# By default we only support initramfs. We don't build live as that
+# pulls in a lot of dependencies for the live image and the installer, like
+# udev, grub, etc. These pull in gettext, which fails to build with wide
+# character support.
+IMAGE_FSTYPES = "cpio.gz"
+
+QB_DEFAULT_FSTYPE = "${IMAGE_FSTYPES}"
+
+# Drop v86d from qemu dependency list (we support serial)
+# Drop grub from meta-intel BSPs
+# FIXME: A different mechanism is needed here. We could define -tiny
+# variants of all compatible machines, but that leads to a lot
+# more machine configs to maintain long term.
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS = ""
+
+# The mtrace script included by eglibc is a perl script. This means the system
+# will build perl in case this package is installed. Since we don't care about
+# this script for the purposes of tiny, remove the dependency from here.
+RDEPENDS_${PN}-mtrace_pn-eglibc = ""
+
+PNBLACKLIST[build-appliance-image] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-base] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-clutter] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-full-cmdline] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-lsb] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-lsb-dev] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-lsb-sdk] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-rt] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-rt-sdk] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-sato] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-sato-dev] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-sato-sdk] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-x11] = "not buildable with poky-tiny"
+PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny"
+
+# Disable python usage in opkg-utils since it won't build with tiny config
+PACKAGECONFIG_remove_pn-opkg-utils = "python"
diff --git a/poky/meta-poky/conf/distro/poky.conf b/poky/meta-poky/conf/distro/poky.conf
new file mode 100644
index 000000000..7b1f24e0d
--- /dev/null
+++ b/poky/meta-poky/conf/distro/poky.conf
@@ -0,0 +1,101 @@
+DISTRO = "poky"
+DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
+DISTRO_VERSION = "2.5"
+DISTRO_CODENAME = "sumo"
+SDK_VENDOR = "-pokysdk"
+SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
+
+MAINTAINER = "Poky <poky@yoctoproject.org>"
+
+TARGET_VENDOR = "-poky"
+
+LOCALCONF_VERSION = "1"
+
+DISTRO_VERSION[vardepsexclude] = "DATE"
+SDK_VERSION[vardepsexclude] = "DATE"
+
+# Override these in poky based distros
+POKY_DEFAULT_DISTRO_FEATURES = "largefile opengl ptest multiarch wayland vulkan"
+POKY_DEFAULT_EXTRA_RDEPENDS = "packagegroup-core-boot"
+POKY_DEFAULT_EXTRA_RRECOMMENDS = "kernel-module-af-packet"
+
+DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
+
+PREFERRED_VERSION_linux-yocto ?= "4.14%"
+
+SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
+SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"
+
+DISTRO_EXTRA_RDEPENDS += " ${POKY_DEFAULT_EXTRA_RDEPENDS}"
+DISTRO_EXTRA_RRECOMMENDS += " ${POKY_DEFAULT_EXTRA_RRECOMMENDS}"
+
+POKYQEMUDEPS = "${@bb.utils.contains("INCOMPATIBLE_LICENSE", "GPL-3.0", "", "packagegroup-core-device-devel",d)}"
+DISTRO_EXTRA_RDEPENDS_append_qemuarm = " ${POKYQEMUDEPS}"
+DISTRO_EXTRA_RDEPENDS_append_qemuarm64 = " ${POKYQEMUDEPS}"
+DISTRO_EXTRA_RDEPENDS_append_qemumips = " ${POKYQEMUDEPS}"
+DISTRO_EXTRA_RDEPENDS_append_qemuppc = " ${POKYQEMUDEPS}"
+DISTRO_EXTRA_RDEPENDS_append_qemux86 = " ${POKYQEMUDEPS}"
+DISTRO_EXTRA_RDEPENDS_append_qemux86-64 = " ${POKYQEMUDEPS}"
+
+TCLIBCAPPEND = ""
+
+QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el nios2 ppc x86_64"
+# Other QEMU_TARGETS "sh4"
+
+PREMIRRORS ??= "\
+bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+gitsm://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+hg://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+osc://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+p4://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
+
+MIRRORS =+ "\
+ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+http://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
+
+# The CONNECTIVITY_CHECK_URI's are used to test whether we can succesfully
+# fetch from the network (and warn you if not). To disable the test set
+# the variable to be empty.
+# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
+CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/"
+
+SANITY_TESTED_DISTROS ?= " \
+ poky-2.4 \n \
+ poky-2.5 \n \
+ ubuntu-15.04 \n \
+ ubuntu-16.04 \n \
+ ubuntu-16.10 \n \
+ ubuntu-17.04 \n \
+ fedora-26 \n \
+ centos-7 \n \
+ debian-8 \n \
+ debian-9 \n \
+ opensuse-42.1 \n \
+ opensuse-42.2 \n \
+ "
+#
+# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in
+# an incompatible way. Such changes should usually be detailed in the commit
+# that breaks the format and have been previously discussed on the mailing list
+# with general agreement from the core team.
+#
+OELAYOUT_ABI = "12"
+
+# add poky sanity bbclass
+INHERIT += "poky-sanity"
+
+# QA check settings - a little stricter than the OE-Core defaults
+WARN_TO_ERROR_QA = "already-stripped compile-host-path install-host-path \
+ installed-vs-shipped ldflags pn-overrides rpaths staticdev \
+ useless-rpaths"
+WARN_QA_remove = "${WARN_TO_ERROR_QA}"
+ERROR_QA_append = " ${WARN_TO_ERROR_QA}"
+
+require conf/distro/include/poky-world-exclude.inc
+require conf/distro/include/no-static-libs.inc
+require conf/distro/include/yocto-uninative.inc
+INHERIT += "uninative"
diff --git a/poky/meta-poky/conf/layer.conf b/poky/meta-poky/conf/layer.conf
new file mode 100644
index 000000000..3761f87c6
--- /dev/null
+++ b/poky/meta-poky/conf/layer.conf
@@ -0,0 +1,20 @@
+# 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 += "yocto"
+BBFILE_PATTERN_yocto = "^${LAYERDIR}/"
+BBFILE_PRIORITY_yocto = "5"
+
+LAYERSERIES_COMPAT_yocto = "sumo"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_yocto = "3"
+
+LAYERDEPENDS_yocto = "core"
+
+REQUIRED_POKY_BBLAYERS_CONF_VERSION = "2"
diff --git a/poky/meta-poky/conf/local.conf.sample b/poky/meta-poky/conf/local.conf.sample
new file mode 100644
index 000000000..aa8df40b8
--- /dev/null
+++ b/poky/meta-poky/conf/local.conf.sample
@@ -0,0 +1,247 @@
+#
+# This file is your local configuration file and is where all local user settings
+# are placed. The comments in this file give some guide to the options a new user
+# to the system might want to change but pretty much any configuration option can
+# be set in this file. More adventurous users can look at local.conf.extended
+# which contains other examples of configuration which can be placed in this file
+# but new users likely won't need any of them initially.
+#
+# Lines starting with the '#' character are commented out and in some cases the
+# default values are provided as comments to show people example syntax. Enabling
+# the option is a question of removing the # character and making any change to the
+# variable as required.
+
+#
+# Machine Selection
+#
+# You need to select a specific machine to target the build with. There are a selection
+# of emulated machines available which can boot and run in the QEMU emulator:
+#
+#MACHINE ?= "qemuarm"
+#MACHINE ?= "qemuarm64"
+#MACHINE ?= "qemumips"
+#MACHINE ?= "qemumips64"
+#MACHINE ?= "qemuppc"
+#MACHINE ?= "qemux86"
+#MACHINE ?= "qemux86-64"
+#
+# There are also the following hardware board target machines included for
+# demonstration purposes:
+#
+#MACHINE ?= "beaglebone-yocto"
+#MACHINE ?= "genericx86"
+#MACHINE ?= "genericx86-64"
+#MACHINE ?= "mpc8315e-rdb"
+#MACHINE ?= "edgerouter"
+#
+# This sets the default machine to be qemux86 if no other machine is selected:
+MACHINE ??= "qemux86"
+
+#
+# Where to place downloads
+#
+# During a first build the system will download many different source code tarballs
+# from various upstream projects. This can take a while, particularly if your network
+# connection is slow. These are all stored in DL_DIR. When wiping and rebuilding you
+# can preserve this directory to speed up this part of subsequent builds. This directory
+# is safe to share between multiple builds on the same machine too.
+#
+# The default is a downloads directory under TOPDIR which is the build directory.
+#
+#DL_DIR ?= "${TOPDIR}/downloads"
+
+#
+# Where to place shared-state files
+#
+# BitBake has the capability to accelerate builds based on previously built output.
+# This is done using "shared state" files which can be thought of as cache objects
+# and this option determines where those files are placed.
+#
+# You can wipe out TMPDIR leaving this directory intact and the build would regenerate
+# from these files if no changes were made to the configuration. If changes were made
+# to the configuration, only shared state files where the state was still valid would
+# be used (done using checksums).
+#
+# The default is a sstate-cache directory under TOPDIR.
+#
+#SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+
+#
+# Where to place the build output
+#
+# This option specifies where the bulk of the building work should be done and
+# where BitBake should place its temporary files and output. Keep in mind that
+# this includes the extraction and compilation of many applications and the toolchain
+# which can use Gigabytes of hard disk space.
+#
+# The default is a tmp directory under TOPDIR.
+#
+#TMPDIR = "${TOPDIR}/tmp"
+
+#
+# Default policy config
+#
+# The distribution setting controls which policy settings are used as defaults.
+# The default value is fine for general Yocto project use, at least initially.
+# Ultimately when creating custom policy, people will likely end up subclassing
+# these defaults.
+#
+DISTRO ?= "poky"
+# As an example of a subclass there is a "bleeding" edge policy configuration
+# where many versions are set to the absolute latest code from the upstream
+# source control systems. This is just mentioned here as an example, its not
+# useful to most new users.
+# DISTRO ?= "poky-bleeding"
+
+#
+# Package Management configuration
+#
+# This variable lists which packaging formats to enable. Multiple package backends
+# can be enabled at once and the first item listed in the variable will be used
+# to generate the root filesystems.
+# Options are:
+# - 'package_deb' for debian style deb files
+# - 'package_ipk' for ipk files are used by opkg (a debian style embedded package manager)
+# - 'package_rpm' for rpm style packages
+# E.g.: PACKAGE_CLASSES ?= "package_rpm package_deb package_ipk"
+# We default to rpm:
+PACKAGE_CLASSES ?= "package_rpm"
+
+#
+# SDK target architecture
+#
+# This variable specifies the architecture to build SDK items for and means
+# you can build the SDK packages for architectures other than the machine you are
+# running the build on (i.e. building i686 packages on an x86_64 host).
+# Supported values are i686 and x86_64
+#SDKMACHINE ?= "i686"
+
+#
+# Extra image configuration defaults
+#
+# The EXTRA_IMAGE_FEATURES variable allows extra packages to be added to the generated
+# images. Some of these options are added to certain image types automatically. The
+# variable can contain the following options:
+# "dbg-pkgs" - add -dbg packages for all installed packages
+# (adds symbol information for debugging/profiling)
+# "dev-pkgs" - add -dev packages for all installed packages
+# (useful if you want to develop against libs in the image)
+# "ptest-pkgs" - add -ptest packages for all ptest-enabled packages
+# (useful if you want to run the package test suites)
+# "tools-sdk" - add development tools (gcc, make, pkgconfig etc.)
+# "tools-debug" - add debugging tools (gdb, strace)
+# "eclipse-debug" - add Eclipse remote debugging support
+# "tools-profile" - add profiling tools (oprofile, lttng, valgrind)
+# "tools-testapps" - add useful testing tools (ts_print, aplay, arecord etc.)
+# "debug-tweaks" - make an image suitable for development
+# e.g. ssh root access has a blank password
+# There are other application targets that can be used here too, see
+# meta/classes/image.bbclass and meta/classes/core-image.bbclass for more details.
+# We default to enabling the debugging tweaks.
+EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
+
+#
+# Additional image features
+#
+# The following is a list of additional classes to use when building images which
+# enable extra features. Some available options which can be included in this variable
+# are:
+# - 'buildstats' collect build statistics
+# - 'image-mklibs' to reduce shared library files size for an image
+# - 'image-prelink' in order to prelink the filesystem image
+# NOTE: if listing mklibs & prelink both, then make sure mklibs is before prelink
+# NOTE: mklibs also needs to be explicitly enabled for a given image, see local.conf.extended
+USER_CLASSES ?= "buildstats image-mklibs image-prelink"
+
+#
+# Runtime testing of images
+#
+# The build system can test booting virtual machine images under qemu (an emulator)
+# after any root filesystems are created and run tests against those images. To
+# enable this uncomment this line. See classes/testimage(-auto).bbclass for
+# further details.
+#TEST_IMAGE = "1"
+#
+# Interactive shell configuration
+#
+# Under certain circumstances the system may need input from you and to do this it
+# can launch an interactive shell. It needs to do this since the build is
+# multithreaded and needs to be able to handle the case where more than one parallel
+# process may require the user's attention. The default is iterate over the available
+# terminal types to find one that works.
+#
+# Examples of the occasions this may happen are when resolving patches which cannot
+# be applied, to use the devshell or the kernel menuconfig
+#
+# Supported values are auto, gnome, xfce, rxvt, screen, konsole (KDE 3.x only), none
+# Note: currently, Konsole support only works for KDE 3.x due to the way
+# newer Konsole versions behave
+#OE_TERMINAL = "auto"
+# By default disable interactive patch resolution (tasks will just fail instead):
+PATCHRESOLVE = "noop"
+
+#
+# Disk Space Monitoring during the build
+#
+# Monitor the disk space during the build. If there is less that 1GB of space or less
+# than 100K inodes in any key build location (TMPDIR, DL_DIR, SSTATE_DIR), gracefully
+# shutdown the build. If there is less that 100MB or 1K inodes, perform a hard abort
+# of the build. The reason for this is that running completely out of space can corrupt
+# files and damages the build in ways which may not be easily recoverable.
+# It's necesary to monitor /tmp, if there is no space left the build will fail
+# with very exotic errors.
+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"
+
+#
+# Shared-state files from other locations
+#
+# As mentioned above, shared state files are prebuilt cache data objects which can
+# used to accelerate build time. This variable can be used to configure the system
+# to search other mirror locations for these objects before it builds the data itself.
+#
+# This can be a filesystem directory, or a remote url such as http or ftp. These
+# would contain the sstate-cache results from previous builds (possibly from other
+# machines). This variable works like fetcher MIRRORS/PREMIRRORS and points to the
+# cache locations to check for the shared objects.
+# NOTE: if the mirror uses the same structure as SSTATE_DIR, you need to add PATH
+# at the end as shown in the examples below. This will be substituted with the
+# correct path within the directory structure.
+#SSTATE_MIRRORS ?= "\
+#file://.* http://someserver.tld/share/sstate/PATH;downloadfilename=PATH \n \
+#file://.* file:///some/local/dir/sstate/PATH"
+
+#
+# Yocto Project SState Mirror
+#
+# The Yocto Project has prebuilt artefacts available for its releases, you can enable
+# use of these by uncommenting the following line. This will mean the build uses
+# the network to check for artefacts at the start of builds, which does slow it down
+# equally, it will also speed up the builds by not having to build things if they are
+# present in the cache. It assumes you can download something faster than you can build it
+# which will depend on your network.
+#
+#SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/2.5/PATH;downloadfilename=PATH"
+
+#
+# Qemu configuration
+#
+# By default qemu will build with a builtin VNC server where graphical output can be
+# seen. The two lines below enable the SDL backend too. By default libsdl-native will
+# be built, if you want to use your host's libSDL instead of the minimal libsdl built
+# by libsdl-native then uncomment the ASSUME_PROVIDED line below.
+PACKAGECONFIG_append_pn-qemu-native = " sdl"
+PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
+#ASSUME_PROVIDED += "libsdl-native"
+
+# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
+# track the version of this file when it was generated. This can safely be ignored if
+# this doesn't mean anything to you.
+CONF_VERSION = "1"
diff --git a/poky/meta-poky/conf/local.conf.sample.extended b/poky/meta-poky/conf/local.conf.sample.extended
new file mode 100644
index 000000000..0560de857
--- /dev/null
+++ b/poky/meta-poky/conf/local.conf.sample.extended
@@ -0,0 +1,394 @@
+# BBMASK contains regular expressions that can be used to tell BitBake to ignore
+# certain recipes.
+#BBMASK = ""
+
+#
+# Parallelism Options
+#
+# These two options control how much parallelism BitBake should use. The first
+# option determines how many tasks bitbake should run in parallel:
+#
+#BB_NUMBER_THREADS ?= "4"
+#
+# Default to setting automatically based on cpu count
+#BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+#
+# The second option controls how many processes make should run in parallel when
+# running compile tasks:
+#
+#PARALLEL_MAKE ?= "-j 4"
+#
+# Default to setting automatically based on cpu count
+#PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
+#
+# For a quad-core machine, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
+# be appropriate for example.
+
+
+# glibc configurability is used to reduce minimal image's size.
+# the all supported glibc options are listed in DISTRO_FEATURES_LIBC
+# and disabled by default. Uncomment and copy the DISTRO_FEATURES_LIBC
+# and DISTRO_FEATURES definitions to local.conf to enable the options.
+#DISTRO_FEATURES_LIBC = "ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \
+# libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \
+# libc-getlogin libc-idn libc-inet libc-inet-anl libc-libm libc-locales libc-locale-code \
+# libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \
+# libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \
+# libc-posix-wchar-io"
+
+#DISTRO_FEATURES = "alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci ${DISTRO_FEATURES_LIBC}"
+
+# If you want to get an image based on directfb without x11, Please copy this variable to build/conf/local.conf
+#DISTRO_FEATURES = "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g directfb ${DISTRO_FEATURES_LIBC}"
+
+# ENABLE_BINARY_LOCALE_GENERATION controls the generation of binary locale
+# packages at build time using qemu-native. Disabling it (by setting it to 0)
+# will save some build time at the expense of breaking i18n on devices with
+# less than 128MB RAM.
+#ENABLE_BINARY_LOCALE_GENERATION = "1"
+
+# If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert
+# glibc-binary-localedata-XX-YY to be a meta package depending on
+# glibc-binary-localedata-XX-YY-lc-address and so on. This enables
+# saving quite some space if someone doesn't need LC_COLLATE for
+# example.
+#GLIBC_SPLIT_LC_PACKAGES = "1"
+
+# Set GLIBC_GENERATE_LOCALES to the locales you wish to generate should you not
+# wish to perform the time-consuming step of generating all LIBC locales.
+# NOTE: If removing en_US.UTF-8 you will also need to uncomment, and set
+# appropriate value for IMAGE_LINGUAS.
+# WARNING: this may break localisation!
+#GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 en_US.UTF-8"
+#IMAGE_LINGUAS ?= "en-gb"
+
+# The following are used to control options related to debugging.
+#
+# Uncomment this to change the optimization to make debugging easer, at the
+# possible cost of performance.
+# DEBUG_BUILD = "1"
+#
+# Uncomment this to disable the stripping of the installed binaries
+# INHIBIT_PACKAGE_STRIP = "1"
+#
+# Uncomment this to disable the split of the debug information into -dbg files
+# INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+#
+# When splitting debug information, the following controls the results of the
+# file splitting.
+#
+# .debug (default):
+# When splitting the debug information will be placed into
+# a .debug directory in the same dirname of the binary produced:
+# /bin/foo -> /bin/.debug/foo
+#
+# debug-file-directory:
+# When splitting the debug information will be placed into
+# a central debug-file-directory, /usr/lib/debug:
+# /bin/foo -> /usr/lib/debug/bin/foo.debug
+#
+# Any source code referenced in the debug symbols will be copied
+# and made available within the /usr/src/debug directory
+#
+#PACKAGE_DEBUG_SPLIT_STYLE = '.debug'
+# PACKAGE_DEBUG_SPLIT_STYLE = 'debug-file-directory'
+
+# Uncomment these to build a package such that you can use gprof to profile it.
+# NOTE: This will only work with 'linux' targets, not
+# 'linux-uclibc', as uClibc doesn't provide the necessary
+# object files. Also, don't build glibc itself with these
+# flags, or it'll fail to build.
+#
+# PROFILE_OPTIMIZATION = "-pg"
+# SELECTED_OPTIMIZATION = "${PROFILE_OPTIMIZATION}"
+# LDFLAGS =+ "-pg"
+
+# TCMODE controls the characteristics of the generated packages/images by
+# telling poky which toolchain 'profile' to use.
+#
+# The default is "default" which uses the internal toolchain. With
+# additional layers, it is possible to set this to use a precompiled
+# external toolchain. One example is the Sourcery G++ Toolchain, support
+# for which is now in the separate meta-sourcery layer:
+#
+# http://github.com/MentorEmbedded/meta-sourcery/
+#
+# meta-sourcery can be used as a template for adding support for other
+# external toolchains. See the link above for further details.
+#
+# TCMODE points the system to a file in conf/distro/include/tcmode-${TCMODE}.inc,
+# so for meta-sourcery which has conf/distro/include/tcmode-external-sourcery.inc
+# you would set it as follows:
+#
+# TCMODE ?= "external-sourcery"
+
+# mklibs library size optimization is more useful to smaller images,
+# and less useful for bigger images. Also mklibs library optimization
+# can break the ABI compatibility, so should not be applied to the
+# images which are to be extended or upgraded later.
+#This enabled mklibs library size optimization just for the specified image.
+#MKLIBS_OPTIMIZED_IMAGES ?= "core-image-minimal"
+#This enable mklibs library size optimization will be for all the images.
+#MKLIBS_OPTIMIZED_IMAGES ?= "all"
+
+# Uncomment this if your host distribution provides the help2man tool.
+#ASSUME_PROVIDED += "help2man-native"
+
+# This value is currently used by pseudo to determine if the recipe should
+# build both the 32-bit and 64-bit wrapper libraries on a 64-bit build system.
+#
+# Pseudo will attempt to determine if a 32-bit wrapper is necessary, but
+# it doesn't always guess properly. If you have 32-bit executables on
+# your 64-bit build system, you likely want to set this to "0",
+# otherwise you could end up with incorrect file attributes on the
+# target filesystem.
+#
+# Default is to not build 32 bit libs on 64 bit systems, uncomment this
+# if you need the 32 bits libs
+#NO32LIBS = "0"
+
+# Uncomment the following lines to enable multilib builds
+#require conf/multilib.conf
+#MULTILIBS = "multilib:lib32"
+#DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
+
+# Set RPM_PREFER_ELF_ARCH to configure preferred ABI when using rpm packaging
+# backend to generate a rootfs, choices are:
+# 1: ELF32 wins
+# 2: ELF64 wins
+# 4: ELF64 N32 wins (for mips64 or mips64el only)
+#RPM_PREFER_ELF_ARCH ?= "2"
+
+# The network based PR service host and port
+# Uncomment the following lines to enable PRservice.
+# Set PRSERV_HOST to 'localhost:0' to automatically
+# start local PRService.
+# Set to other values to use remote PRService.
+#PRSERV_HOST = "localhost:0"
+
+# Additional image generation features
+#
+# The following is a list of classes to import to use in the generation of images
+# currently an example class is image_types_uboot
+# IMAGE_CLASSES = " image_types_uboot"
+
+# The following options will build a companion 'debug filesystem' in addition
+# to the normal deployable filesystem. This companion system allows a
+# debugger to know the symbols and related sources. It can be used to
+# debug a remote 'production' system without having to add the debug symbols
+# and sources to remote system. If IMAGE_FSTYPES_DEBUGFS is not defined, it
+# defaults to IMAGE_FSTYPES.
+#IMAGE_GEN_DEBUGFS = "1"
+#IMAGE_FSTYPES_DEBUGFS = "tar.gz"
+
+# Incremental rpm image generation, the rootfs would be totally removed
+# and re-created in the second generation by default, but with
+# INC_RPM_IMAGE_GEN = "1", the rpm based rootfs would be kept, and will
+# do update(remove/add some pkgs) on it. NOTE: This is not suggested
+# when you want to create a productive rootfs
+#INC_RPM_IMAGE_GEN = "1"
+
+# This is a list of packages that require a commercial license to ship
+# product. If shipped as part of an image these packages may have
+# implications so they are disabled by default. To enable them,
+# un-comment the below as appropriate.
+#LICENSE_FLAGS_WHITELIST = "commercial_gst-fluendo-mp3 \
+# commercial_gst-openmax \
+# commercial_gst-plugins-ugly \
+# commercial_lame \
+# commercial_libmad \
+# commercial_libomxil \
+# commercial_mpeg2dec"
+
+
+#
+# Disk space monitor, take action when the disk space or the amount of
+# inode is running low, it is enabled when BB_DISKMON_DIRS is set.
+#
+# Set the directory for the monitor, the format is:
+# "action,directory,minimum_space,minimum_free_inode"
+#
+# The "action" must be set and should be one of:
+# ABORT: Immediately abort
+# STOPTASKS: The new tasks can't be executed any more, will stop the build
+# when the running tasks have been done.
+# WARN: show warnings (see BB_DISKMON_WARNINTERVAL for more information)
+#
+# The "directory" must be set, any directory is OK.
+#
+# Either "minimum_space" or "minimum_free_inode" (or both of them)
+# should be set, otherwise the monitor would not be enabled,
+# the unit can be G, M, K or none, but do NOT use GB, MB or KB
+# (B is not needed).
+#BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},1G,100K WARN,${SSTATE_DIR},1G,100K"
+#
+# Set disk space and inode interval (only works when the action is "WARN",
+# the unit can be G, M, or K, but do NOT use the GB, MB or KB
+# (B is not needed), the format is:
+# "disk_space_interval,disk_inode_interval", the default value is
+# "50M,5K" which means that it would warn when the free space is
+# lower than the minimum space(or inode), and would repeat the warning
+# when the disk space reduces 50M (or the amount of inode reduces 5k).
+#BB_DISKMON_WARNINTERVAL = "50M,5K"
+
+# Archive the source and put them to ${DEPLOY_DIR}/sources/.
+#
+#INHERIT += "archiver"
+#
+# The tarball for the patched source will be created by default, and you
+# can configure the archiver as follow:
+#
+# Create archive for:
+# 1) original (or unpacked) source:
+#ARCHIVER_MODE[src] = "original"
+# 2) patched source: (default)
+#ARCHIVER_MODE[src] = "patched"
+# 3) configured source:
+#ARCHIVER_MODE[src] = "configured"
+#
+# 4) the patches between do_unpack and do_patch:
+#ARCHIVER_MODE[diff] = "1"
+# set the files that you'd like to exclude from the diff:
+#ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+#
+# 5) the environment data, similar to 'bitbake -e recipe':
+#ARCHIVER_MODE[dumpdata] = "1"
+#
+# 6) the recipe (.bb and .inc):
+#ARCHIVER_MODE[recipe] = "1"
+#
+# 7) Whether output the .src.rpm package:
+#ARCHIVER_MODE[srpm] = "1"
+#
+# 8) Filter the license, the recipe whose license in
+# COPYLEFT_LICENSE_INCLUDE will be included, and in
+# COPYLEFT_LICENSE_EXCLUDE will be excluded.
+#COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
+#COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
+#
+# 9) Config the recipe type that will be archived, the type can be
+# target, native, nativesdk, cross, crosssdk and cross-canadian,
+# you can set one or more types. Archive all types by default.
+#COPYLEFT_RECIPE_TYPES = 'target'
+#
+
+#
+# GCC/LD FLAGS to enable more secure code generation
+#
+# By including the security_flags include file you enable flags
+# to the compiler and linker that cause them to generate more secure
+# code, this is enabled by default in the poky-lsb distro.
+# This does affect compile speed slightly.
+#
+# Use the following line to enable the security compiler and linker flags to your build
+#require conf/distro/include/security_flags.inc
+
+# Image level user/group configuration.
+# Inherit extrausers to make the setting of EXTRA_USERS_PARAMS effective.
+#INHERIT += "extrausers"
+# User / group settings
+# The settings are sperated by the ; character.
+# Each setting is actually a command. The supported commands are useradd,
+# groupadd, userdel, groupdel, usermod and groupmod.
+#EXTRA_USERS_PARAMS = "\
+#useradd -p '' tester; \
+#groupadd developers; \
+#userdel nobody; \
+#groupdel video; \
+#groupmod -g 1020 developers; \
+#usermod -s /bin/sh tester; \
+#"
+
+# Various packages dynamically add users and groups to the system at package
+# install time. For programs that do not care what the uid/gid is of the
+# resulting users/groups, the order of the install will determine the final
+# uid/gid. This can lead to non-deterministic uid/gid values from one build
+# to another. Use the following settings to specify that all user/group adds
+# should be created based on a static passwd/group file.
+#
+# Note, if you enable or disable the useradd-staticids in a configured system,
+# the TMPDIR may contain incorrect uid/gid values. Clearing the TMPDIR
+# will correct this condition.
+#
+# By default the system looks in the BBPATH for files/passwd and files/group
+# the default can be overriden by spefying USERADD_UID/GID_TABLES.
+#
+#USERADDEXTENSION = "useradd-staticids"
+#USERADD_UID_TABLES = "files/passwd"
+#USERADD_GID_TABLES = "files/group"
+#
+# In order to prevent generating a system where a dynamicly assigned uid/gid
+# can exist, you should enable the following setting. This will force the
+# system to error out if the user/group name is not defined in the
+# files/passwd or files/group (or specified replacements.)
+#USERADD_ERROR_DYNAMIC = "1"
+
+# Enabling FORTRAN
+# Note this is not officially supported and is just illustrated here to
+# show an example of how it can be done
+# You'll also need your fortran recipe to depend on libgfortran
+#FORTRAN_forcevariable = ",fortran"
+#RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"
+
+#
+# Kernel image features
+#
+# The INITRAMFS_IMAGE image variable will cause an additional recipe to
+# be built as a dependency to the what ever rootfs recipe you might be
+# using such as core-image-sato. The initramfs might be needed for
+# the initial boot of of the target system such as to load kernel
+# modules prior to mounting the root file system.
+#
+# INITRAMFS_IMAGE_BUNDLE variable controls if the image recipe
+# specified by the INITRAMFS_IMAGE will be run through an extra pass
+# through the kernel compilation in order to build a single binary
+# which contains both the kernel image and the initramfs. The
+# combined binary will be deposited into the tmp/deploy directory.
+# NOTE: You can set INITRAMFS_IMAGE in an image recipe, but
+# INITRAMFS_IMAGE_BUNDLE can only be set in a conf file.
+#
+#INITRAMFS_IMAGE = "core-image-minimal-initramfs"
+#INITRAMFS_IMAGE_BUNDLE = "1"
+
+#
+# IPK Hierarchical feed
+#
+# In some cases it may be desirable not to have all package files in the same
+# directory. An example would be when package feeds are to be uploaded to a
+# shared webhosting service or transferred to a Windows machine which may have
+# problems with directories containing multiple thousands of files.
+#
+# If the IPK_HIERARCHICAL_FEED variable is set to "1", packages will be split
+# between subdirectories in a similar way to how Debian package feeds are
+# organised. In the hierarchical feed, package files are written to
+# <outdir>/<arch>/<pkg_prefix>/<pkg_subdir>, where pkg_prefix is the first
+# letter of the package file name for non-lib packages or "lib" plus the 4th
+# letter of the package file name for lib packages (eg, 'l' for less, 'libc' for
+# libc6). pkg_subdir is the root of the package file name, discarding the
+# version and architecture parts and the common suffixes '-dbg', '-dev', '-doc',
+# '-staticdev', '-locale' and '-locale-*' which are listed in
+# meta/conf/bitbake.conf.
+#
+# If IPK_HIERARCHICAL_FEED is unset or set to any other value, the traditional
+# feed layout is used where package files are placed in <outdir>/<arch>/.
+#
+#IPK_HIERARCHICAL_FEED = "1"
+#
+
+#
+# Use busybox/mdev for system initialization
+#
+#VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
+#VIRTUAL-RUNTIME_login_manager = "busybox"
+#VIRTUAL-RUNTIME_init_manager = "busybox"
+#VIRTUAL-RUNTIME_initscripts = "initscripts"
+#VIRTUAL-RUNTIME_keymaps = "keymaps"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+
+#
+# Use systemd for system initialization
+#
+#DISTRO_FEATURES_append = " systemd"
+#DISTRO_FEATURES_BACKFILL_CONSIDERED += "sysvinit"
+#VIRTUAL-RUNTIME_init_manager = "systemd"
+#VIRTUAL-RUNTIME_initscripts = "systemd-compat-units"
diff --git a/poky/meta-poky/conf/site.conf.sample b/poky/meta-poky/conf/site.conf.sample
new file mode 100644
index 000000000..6cfefc574
--- /dev/null
+++ b/poky/meta-poky/conf/site.conf.sample
@@ -0,0 +1,31 @@
+#
+# local.conf covers user settings, site.conf covers site specific information
+# such as proxy server addresses and optionally any shared download location
+#
+# SITE_CONF_VERSION is increased each time build/conf/site.conf
+# changes incompatibly
+SCONF_VERSION = "1"
+
+# Uncomment to cause CVS to use the proxy host specified
+#CVS_PROXY_HOST = "proxy.example.com"
+#CVS_PROXY_PORT = "81"
+
+# For svn, you need to create ~/.subversion/servers containing:
+#[global]
+#http-proxy-host = proxy.example.com
+#http-proxy-port = 81
+#
+
+# To use git with a proxy, you must use an external git proxy command, such as
+# the one provided by scripts/oe-git-proxy. To use this script, copy it to
+# your PATH and uncomment the following:
+#GIT_PROXY_COMMAND ?= "oe-git-proxy"
+#ALL_PROXY ?= "socks://socks.example.com:1080"
+#or
+#ALL_PROXY ?= "https://proxy.example.com:8080"
+# If you wish to use certain hosts without the proxy, specify them in NO_PROXY.
+# See the script for details on syntax.
+
+# Uncomment this to use a shared download directory
+#DL_DIR = "/some/shared/download/directory/"
+
diff --git a/poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig b/poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig
new file mode 100644
index 000000000..0a5d5c918
--- /dev/null
+++ b/poky/meta-poky/recipes-core/busybox/busybox/poky-tiny/defconfig
@@ -0,0 +1,1009 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.19.3
+# Wed Nov 30 09:33:16 2011
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+CONFIG_FEATURE_COMPRESS_USAGE=y
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_INSTALL_NO_USR is not set
+CONFIG_LOCALE_SUPPORT=y
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+CONFIG_FEATURE_PIDFILE=y
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SUID_CONFIG=y
+CONFIG_FEATURE_SUID_CONFIG_QUIET=y
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+CONFIG_FEATURE_SYSLOG=y
+CONFIG_FEATURE_HAVE_RPC=y
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_EXTRA_CFLAGS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_FEATURE_SYSTEMD=y
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SIZE_VS_SPEED=2
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+CONFIG_FEATURE_USERNAME_COMPLETION=y
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_FEATURE_SEAMLESS_XZ is not set
+CONFIG_FEATURE_SEAMLESS_LZMA=y
+CONFIG_FEATURE_SEAMLESS_BZ2=y
+CONFIG_FEATURE_SEAMLESS_GZ=y
+CONFIG_FEATURE_SEAMLESS_Z=y
+CONFIG_AR=y
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+CONFIG_BUNZIP2=y
+# CONFIG_BZIP2 is not set
+CONFIG_CPIO=y
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GUNZIP=y
+CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM2CPIO is not set
+# CONFIG_RPM is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_AUTODETECT=y
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set
+# CONFIG_FEATURE_TAR_SELINUX is not set
+# CONFIG_UNCOMPRESS is not set
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZ is not set
+CONFIG_UNZIP=y
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+CONFIG_ID=y
+CONFIG_GROUPS=y
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+CONFIG_TOUCH=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+# CONFIG_BASE64 is not set
+CONFIG_WHO=y
+CONFIG_USERS=y
+# CONFIG_CAL is not set
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_HOSTID is not set
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+CONFIG_OD=y
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+# CONFIG_STAT is not set
+# CONFIG_FEATURE_STAT_FORMAT is not set
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+# CONFIG_FGCONSOLE is not set
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+# CONFIG_KBD_MODE is not set
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Common options for loadfont and setfont
+#
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_RUN_PARTS=y
+CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_PATCH=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=1024
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+CONFIG_FEATURE_VI_OPTIMIZE_CURSOR=y
+CONFIG_AWK=y
+# CONFIG_FEATURE_AWK_LIBM is not set
+CONFIG_CMP=y
+CONFIG_DIFF=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_ED is not set
+CONFIG_SED=y
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_MAXDEPTH=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_USER=y
+CONFIG_FEATURE_FIND_GROUP=y
+CONFIG_FEATURE_FIND_NOT=y
+CONFIG_FEATURE_FIND_DEPTH=y
+CONFIG_FEATURE_FIND_PAREN=y
+CONFIG_FEATURE_FIND_SIZE=y
+CONFIG_FEATURE_FIND_PRUNE=y
+# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_PATH=y
+CONFIG_FEATURE_FIND_REGEX=y
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+# CONFIG_MESG is not set
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_FIRST_SYSTEM_ID=0
+CONFIG_LAST_SYSTEM_ID=0
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_PAM is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODINFO is not set
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+CONFIG_INSMOD=y
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+CONFIG_MODPROBE=y
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+# CONFIG_DEPMOD is not set
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
+CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
+CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
+
+#
+# Linux System Utilities
+#
+# CONFIG_BLOCKDEV is not set
+# CONFIG_REV is not set
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+CONFIG_FLOCK=y
+# CONFIG_FREERAMDISK is not set
+CONFIG_FSCK_MINIX=y
+# CONFIG_MKFS_EXT2 is not set
+CONFIG_MKFS_MINIX=y
+CONFIG_FEATURE_MINIX2=y
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+CONFIG_FEATURE_MOUNT_NFS=y
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+CONFIG_SWAPONOFF=y
+# CONFIG_FEATURE_SWAPON_PRI is not set
+CONFIG_SWITCH_ROOT=y
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_CONSPY is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_SETSERIAL is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_SMALL is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+CONFIG_MICROCOM=y
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+CONFIG_SETSID=y
+CONFIG_STRINGS=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WALL is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_WHOIS is not set
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_USE_SENDFILE is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+CONFIG_IFUPDOWN=y
+CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
+CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+CONFIG_NETSTAT=y
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_TCPSVD is not set
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+CONFIG_TFTP=y
+# CONFIG_TFTPD is not set
+
+#
+# Common options for tftp/tftpd
+#
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+CONFIG_UDHCPD=y
+# CONFIG_DHCPRELAY is not set
+CONFIG_DUMPLEASES=y
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
+CONFIG_UDHCPC=y
+CONFIG_FEATURE_UDHCPC_ARPING=y
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
+# CONFIG_UDPSVD is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_ZCIP is not set
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+# CONFIG_IOSTAT is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+CONFIG_UPTIME=y
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+CONFIG_FREE=y
+CONFIG_FUSER=y
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_PGREP is not set
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PKILL is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+CONFIG_RENICE=y
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+# CONFIG_FEATURE_SHOW_THREADS is not set
+CONFIG_WATCH=y
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
+# Shells
+#
+CONFIG_ASH=y
+CONFIG_ASH_BASH_COMPAT=y
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_BUILTIN_ECHO=y
+CONFIG_ASH_BUILTIN_PRINTF=y
+CONFIG_ASH_BUILTIN_TEST=y
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+CONFIG_CTTYHACK=y
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_MSH is not set
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
+# CONFIG_FEATURE_BASH_IS_HUSH is not set
+CONFIG_FEATURE_BASH_IS_NONE=y
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+CONFIG_FEATURE_SH_HISTFILESIZE=y
+
+#
+# System Logging Utilities
+#
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_SYSLOGD_DUP=y
+CONFIG_FEATURE_SYSLOGD_CFG=y
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_KLOGD=y
+CONFIG_FEATURE_KLOGD_KLOGCTL=y
+CONFIG_LOGGER=y
diff --git a/poky/meta-poky/recipes-core/busybox/busybox_%.bbappend b/poky/meta-poky/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 000000000..000578744
--- /dev/null
+++ b/poky/meta-poky/recipes-core/busybox/busybox_%.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+
diff --git a/poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h b/poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 000000000..e84dac933
--- /dev/null
+++ b/poky/meta-poky/recipes-core/psplash/files/psplash-poky-img.h
@@ -0,0 +1,914 @@
+/* Yocto Project logo for psplash
+ *
+ * Created using make-image-header.sh (distributed with psplash)
+ */
+
+/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */
+
+#define POKY_IMG_ROWSTRIDE (1708)
+#define POKY_IMG_WIDTH (427)
+#define POKY_IMG_HEIGHT (214)
+#define POKY_IMG_BYTES_PER_PIXEL (4) /* 3:RGB, 4:RGBA */
+#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\237\350\354\340\377\1\350\354\342\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\254\350\354\340\377\2\241\243" \
+ "\244\377;AC\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\252\350\354\340\377\2\275\277\277\377LQR\377\202.46\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\250\350\354\340" \
+ "\377\2\321\322\323\377]ac\377\204.46\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\246\350\354\340\377\3\346\347\347\377" \
+ "w{|\377/57\377\205.46\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\245\350\354\340\377\2\223\226\227\3775;=\377\207.46" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\243" \
+ "\350\354\340\377\2\253\255\256\377BHJ\377\211.46\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\241\350\354\340\377\2\304" \
+ "\306\306\377PUW\377\213.46\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\240\350\354\340\377\1\306\310\311\377\215.46\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\240\350" \
+ "\354\340\377\1\302\303\304\377\215.46\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\240\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\240\350\354\340\377\1\302\303\304\377\215.46\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\240\350\354\340\377\1\302\303" \
+ "\304\377\215.46\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\240\350\354\340\377\1\302\303\304\377\215.46\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\240\350\354\340\377" \
+ "\1\302\303\304\377\215.46\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\240\350\354\340\377\1\302\303\304\377\215.46\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\240\350" \
+ "\354\340\377\1\302\303\304\377\215.46\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\240\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\240\350\354\340\377\1\302\303\304\377\215.46\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\240\350\354\340\377\1\302\303" \
+ "\304\377\215.46\377\377\350\354\340\377\305\350\354\340\377\1\346\347" \
+ "\347\377\256\350\354\340\377\1\341\342\343\377\377\350\354\340\377\252" \
+ "\350\354\340\377\1\302\303\304\377\215.46\377\377\350\354\340\377\304" \
+ "\350\354\340\377\3\220\223\224\3775;=\377\244\247\250\377\254\350\354" \
+ "\340\377\4\302\303\304\377179\377\205\210\212\377\350\354\342\377\377" \
+ "\350\354\340\377\250\350\354\340\377\1\302\303\304\377\215.46\377\377" \
+ "\350\354\340\377\302\350\354\340\377\2\250\253\253\377>DF\377\202.46" \
+ "\377\1@FG\377\254\350\354\340\377\1Y^`\377\202.46\377\2;AC\377\241\243" \
+ "\244\377\377\350\354\340\377\247\350\354\340\377\1\302\303\304\377\215" \
+ ".46\377\377\350\354\340\377\300\350\354\340\377\2\303\305\305\377PUW" \
+ "\377\205.46\377\1\230\233\234\377\252\350\354\340\377\1\303\305\305\377" \
+ "\205.46\377\2LQR\377\275\277\277\377\244\350\354\340\377\16\350\352\351" \
+ "\377\313\314\315\377\254\257\257\377\224\227\230\377\214\220\221\377" \
+ "\202\205\206\377w{|\377uy{\377\202\205\206\377\213\216\217\377\223\226" \
+ "\227\377\253\255\256\377\310\312\312\377\346\346\347\377\362\350\354" \
+ "\340\377\1\302\303\304\377\215.46\377\267\350\354\340\377\16\352\354" \
+ "\345\377\315\316\317\377\257\262\263\377\225\230\231\377\216\221\222" \
+ "\377\202\205\206\377x|}\377txy\377\202\205\206\377\211\214\215\377\221" \
+ "\224\225\377\247\252\253\377\305\306\307\377\342\343\343\377\370\350" \
+ "\354\340\377\2\327\330\330\377bgh\377\207.46\377\1""9\77A\377\252\350" \
+ "\354\340\377\1]ac\377\207.46\377\2bgh\377\327\330\330\377\236\350\354" \
+ "\340\377\4\323\324\324\377\237\242\243\377kop\3779>@\377\216.46\377\4" \
+ "7=\77\377fjl\377\232\235\236\377\316\317\320\377\303\350\354\340\377" \
+ "\7\352\354\346\377\332\333\334\377\303\305\305\377\271\273\274\377\263" \
+ "\265\266\377\253\256\257\377\247\252\253\377\244\235\240\241\377\1}\200" \
+ "\202\377\215.46\377\1\227\232\233\377\221\235\240\241\377\1\335\336\336" \
+ "\377\240\350\354\340\377\4\330\332\332\377\244\247\250\377ptu\377>CE" \
+ "\377\216.46\377\4""4:<\377_de\377\224\230\231\377\311\312\313\377\362" \
+ "\350\354\340\377\3\352\353\347\377~\202\203\377068\377\211.46\377\1\216" \
+ "\221\222\377\250\350\354\340\377\1\306\310\311\377\211.46\377\3""068" \
+ "\377~\202\203\377\352\353\347\377\231\350\354\340\377\3\332\333\334\377" \
+ "\214\220\221\377CIJ\377\226.46\377\3>CE\377\207\212\213\377\321\322\323" \
+ "\377\272\350\354\340\377\6\324\325\325\377\257\261\262\377\213\217\220" \
+ "\377gkl\377FKM\37728:\377\313.46\377\1\265\267\270\377\235\350\354\340" \
+ "\377\3\341\342\342\377\224\230\231\377JOQ\377\226.46\377\3""9\77A\377" \
+ "}\200\202\377\312\313\314\377\356\350\354\340\377\2\225\230\231\3778" \
+ ">\77\377\213.46\377\2""5;=\377\350\352\351\377\247\350\354\340\377\1" \
+ "_de\377\213.46\377\2""8>\77\377\232\235\236\377\226\350\354\340\377\2" \
+ "\264\266\266\377V[]\377\234.46\377\2PUV\377\253\256\257\377\264\350\354" \
+ "\340\377\4\322\323\324\377\235\237\240\377gkl\3776<>\377\321.46\377\1" \
+ "\265\267\270\377\233\350\354\340\377\2\277\301\302\377`ef\377\234.46" \
+ "\377\2GMN\377\240\243\244\377\354\350\354\340\377\1BHJ\377\215.46\377" \
+ "\1\202\205\206\377\246\350\354\340\377\1\311\312\313\377\215.46\377\1" \
+ "CIJ\377\224\350\354\340\377\2\241\243\244\377FKM\377\240.46\377\2@FG" \
+ "\377\231\233\234\377\257\350\354\340\377\3\325\326\327\377\214\220\221" \
+ "\377EJL\377\325.46\377\1\265\267\270\377\231\350\354\340\377\2\255\257" \
+ "\260\377NSU\377\240.46\377\3""9\77A\377\220\223\224\377\350\354\342\377" \
+ "\351\350\354\340\377\1\251\253\254\377\215.46\377\2""179\377\341\342" \
+ "\343\377\245\350\354\340\377\1bfh\377\215.46\377\1\244\247\250\377\222" \
+ "\350\354\340\377\2\275\277\277\377LQR\377\244.46\377\2BHJ\377\264\267" \
+ "\267\377\253\350\354\340\377\2\253\256\257\377PUV\377\330.46\377\1\265" \
+ "\267\270\377\227\350\354\340\377\2\313\314\315\377UY[\377\244.46\377" \
+ "\2;AC\377\247\252\253\377\351\350\354\340\377\1LQS\377\215.46\377\1x" \
+ "|}\377\244\350\354\340\377\1\314\316\316\377\215.46\377\1BGI\377\221" \
+ "\350\354\340\377\2\346\347\347\377hmn\377\250.46\377\2]ac\377\340\341" \
+ "\341\377\247\350\354\340\377\2\235\237\240\377BGI\377\332.46\377\1\265" \
+ "\267\270\377\225\350\354\340\377\2\350\354\342\377txz\377\250.46\377" \
+ "\2PUW\377\324\326\326\377\347\350\354\340\377\1\270\272\272\377\215." \
+ "46\377\2""068\377\330\332\332\377\243\350\354\340\377\1eik\377\215.4" \
+ "6\377\1\242\244\245\377\220\350\354\340\377\2\275\277\277\377=BD\377" \
+ "\252.46\377\2""8>\77\377\261\263\264\377\244\350\354\340\377\2\265\267" \
+ "\270\377BHJ\377\334.46\377\1\265\267\270\377\224\350\354\340\377\2\313" \
+ "\315\315\377EJL\377\252.46\377\2""28:\377\240\243\244\377\347\350\354" \
+ "\340\377\1V[]\377\215.46\377\1kpq\377\242\350\354\340\377\1\316\317\320" \
+ "\377\215.46\377\1@FG\377\220\350\354\340\377\1\210\214\215\377\256.4" \
+ "6\377\1y}\177\377\241\350\354\340\377\2\336\337\337\377aeg\377\336.4" \
+ "6\377\1\265\267\270\377\223\350\354\340\377\2\231\234\235\377068\377" \
+ "\255.46\377\1imo\377\346\350\354\340\377\1\304\306\306\377\216.46\377" \
+ "\1\317\321\321\377\241\350\354\340\377\1glm\377\215.46\377\1\236\241" \
+ "\242\377\217\350\354\340\377\1ptu\377\260.46\377\1chi\377\237\350\354" \
+ "\340\377\2\264\267\267\3778>\77\377\337.46\377\1\265\267\270\377\222" \
+ "\350\354\340\377\1\202\205\206\377\260.46\377\2TYZ\377\352\353\347\377" \
+ "\345\350\354\340\377\1chi\377\215.46\377\1bfh\377\240\350\354\340\377" \
+ "\1\321\322\323\377\215.46\377\1>DF\377\217\350\354\340\377\1_de\377\262" \
+ ".46\377\2TYZ\377\352\353\347\377\234\350\354\340\377\1\202\205\206\377" \
+ "\341.46\377\1\265\267\270\377\221\350\354\340\377\1ptv\377\262.46\377" \
+ "\2HMO\377\337\340\340\377\344\350\354\340\377\2\322\323\324\377/57\377" \
+ "\215.46\377\1\304\306\306\377\237\350\354\340\377\1kop\377\215.46\377" \
+ "\1\234\237\240\377\216\350\354\340\377\1aeg\377\264.46\377\1SXY\377\233" \
+ "\350\354\340\377\1fjl\377\342.46\377\1\265\267\270\377\220\350\354\340" \
+ "\377\1ptu\377\264.46\377\2EJL\377\350\351\351\377\344\350\354\340\377" \
+ "\1ptv\377\215.46\377\1V[]\377\236\350\354\340\377\1\324\326\326\377\215" \
+ ".46\377\1=BD\377\216\350\354\340\377\1nrs\377\226.46\377\12=BD\377`e" \
+ "f\377\200\204\205\377\220\223\224\377\233\236\237\377\234\237\240\377" \
+ "\220\223\224\377\202\205\206\377bgh\377>DF\377\226.46\377\1dij\377\231" \
+ "\350\354\340\377\1_de\377\231.46\377\3""39;\377EJL\377Y^`\377\202fjl" \
+ "\377\1swx\377\244txy\377\1_de\377\215.46\377\1ptu\377\221txy\377\1\316" \
+ "\317\320\377\217\350\354\340\377\1\204\210\211\377\226.46\377\12""9\77" \
+ "A\377[`a\377}\200\202\377\220\223\224\377\231\234\235\377\235\240\241" \
+ "\377\220\223\224\377\205\210\212\377fjl\377BHJ\377\226.46\377\1SXY\377" \
+ "\344\350\354\340\377\2\335\336\336\377068\377\215.46\377\1\271\273\274" \
+ "\377\235\350\354\340\377\1lqr\377\215.46\377\1\231\233\234\377\215\350" \
+ "\354\340\377\1\207\213\214\377\224.46\377\3PUW\377\234\237\240\377\327" \
+ "\330\330\377\212\350\354\340\377\3\332\333\334\377\236\241\242\377PU" \
+ "V\377\224.46\377\1x|}\377\227\350\354\340\377\1[`a\377\225.46\377\5K" \
+ "PR\377\177\203\204\377\247\252\253\377\311\312\313\377\352\354\346\377" \
+ "\252\350\354\340\377\1\302\303\304\377\215.46\377\241\350\354\340\377" \
+ "\1\237\242\243\377\224.46\377\3JOQ\377\226\231\232\377\320\322\322\377" \
+ "\212\350\354\340\377\3\336\337\337\377\242\245\246\377Y]_\377\224.46" \
+ "\377\1eik\377\344\350\354\340\377\1~\201\202\377\215.46\377\1OTV\377" \
+ "\234\350\354\340\377\2\326\327\330\377/57\377\214.46\377\1;AC\377\215" \
+ "\350\354\340\377\1\271\273\274\377\222.46\377\3/57\377ptu\377\314\316" \
+ "\316\377\220\350\354\340\377\2\312\313\314\377jnp\377\223.46\377\1\254" \
+ "\257\257\377\225\350\354\340\377\1y|~\377\222.46\377\4/57\377]ac\377" \
+ "\247\252\253\377\346\347\347\377\257\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\240\350\354\340\377\2\316\317\320\377068\377\222.46\377\2" \
+ "fjl\377\305\306\307\377\220\350\354\340\377\3\323\324\324\377txy\377" \
+ "068\377\222.46\377\1\225\230\231\377\343\350\354\340\377\2\347\350\350" \
+ "\3775:<\377\215.46\377\1\256\260\261\377\233\350\354\340\377\1ptu\377" \
+ "\215.46\377\1\226\231\232\377\214\350\354\340\377\2\344\345\345\377:" \
+ "@B\377\221.46\377\2gkl\377\332\333\334\377\224\350\354\340\377\2\324" \
+ "\326\326\377^ce\377\221.46\377\2""6<>\377\335\336\337\377\223\350\354" \
+ "\340\377\1\235\240\241\377\221.46\377\3""39;\377\177\203\204\377\341" \
+ "\342\342\377\262\350\354\340\377\1\302\303\304\377\215.46\377\237\350" \
+ "\354\340\377\2\350\354\342\377FKM\377\221.46\377\2[`a\377\321\322\323" \
+ "\377\224\350\354\340\377\2\335\336\337\377kop\377\221.46\377\2""068\377" \
+ "\314\316\316\377\343\350\354\340\377\1\213\217\220\377\215.46\377\1F" \
+ "KM\377\232\350\354\340\377\2\331\332\333\377/57\377\214.46\377\1:@B\377" \
+ "\215\350\354\340\377\1^ce\377\220.46\377\2;AC\377\265\267\270\377\230" \
+ "\350\354\340\377\2\251\253\254\3775;=\377\220.46\377\1Y]_\377\222\350" \
+ "\354\340\377\2\325\326\327\377068\377\220.46\377\2ptu\377\346\346\347" \
+ "\377\264\350\354\340\377\1\302\303\304\377\215.46\377\237\350\354\340" \
+ "\377\1txz\377\220.46\377\2""6<>\377\250\253\253\377\230\350\354\340\377" \
+ "\2\270\272\272\377<BC\377\220.46\377\1GMN\377\343\350\354\340\377\2\350" \
+ "\354\342\3779\77A\377\215.46\377\1\244\247\250\377\231\350\354\340\377" \
+ "\1rvw\377\215.46\377\1\223\226\227\377\214\350\354\340\377\1\261\263" \
+ "\264\377\220.46\377\2X]^\377\344\345\345\377\232\350\354\340\377\2\327" \
+ "\330\330\377HMO\377\220.46\377\1\255\257\260\377\221\350\354\340\377" \
+ "\1UY[\377\217.46\377\2<BC\377\274\276\276\377\266\350\354\340\377\1\302" \
+ "\303\304\377\215.46\377\236\350\354\340\377\1\311\312\313\377\220.46" \
+ "\377\2LQS\377\330\332\332\377\232\350\354\340\377\2\342\343\343\377S" \
+ "XY\377\220.46\377\1\224\230\231\377\343\350\354\340\377\1\230\233\234" \
+ "\377\215.46\377\1@FG\377\230\350\354\340\377\2\332\333\334\377068\377" \
+ "\214.46\377\1""9>@\377\215\350\354\340\377\1AFH\377\217.46\377\1gkl\377" \
+ "\235\350\354\340\377\2\352\353\347\377OTV\377\217.46\377\1\77EG\377\220" \
+ "\350\354\340\377\1\232\235\236\377\217.46\377\2MRT\377\340\341\341\377" \
+ "\267\350\354\340\377\1\302\303\304\377\215.46\377\236\350\354\340\377" \
+ "\1OTV\377\217.46\377\2W\\]\377\350\354\342\377\235\350\354\340\377\1" \
+ "\\ab\377\217.46\377\2""5:<\377\346\346\347\377\343\350\354\340\377\1" \
+ "AFH\377\215.46\377\1\230\233\234\377\227\350\354\340\377\1uy{\377\215" \
+ ".46\377\1\220\224\225\377\214\350\354\340\377\1\217\222\223\377\217." \
+ "46\377\1imo\377\237\350\354\340\377\2\352\354\346\377LQR\377\217.46\377" \
+ "\1\220\224\225\377\217\350\354\340\377\1""9>@\377\216.46\377\2OTV\377" \
+ "\351\354\343\377\270\350\354\340\377\1\302\303\304\377\215.46\377\235" \
+ "\350\354\340\377\1\246\251\252\377\217.46\377\1[`a\377\240\350\354\340" \
+ "\377\1[`a\377\217.46\377\1{\177\200\377\343\350\354\340\377\1\246\251" \
+ "\252\377\215.46\377\2""9\77A\377\350\354\342\377\225\350\354\340\377" \
+ "\2\335\336\337\377068\377\214.46\377\2""8>\77\377\351\354\343\377\214" \
+ "\350\354\340\377\1""9>@\377\216.46\377\1QVX\377\241\350\354\340\377\2" \
+ "\341\342\343\377\77EG\377\216.46\377\1;AC\377\216\350\354\340\377\1\224" \
+ "\230\231\377\216.46\377\2GLN\377\350\351\351\377\271\350\354\340\377" \
+ "\1\302\303\304\377\215.46\377\235\350\354\340\377\1GLN\377\216.46\377" \
+ "\2EJL\377\350\351\351\377\240\350\354\340\377\2\351\354\343\377JOQ\377" \
+ "\216.46\377\2""179\377\346\347\347\377\343\350\354\340\377\1INP\377\215" \
+ ".46\377\1\216\221\222\377\225\350\354\340\377\1x|}\377\215.46\377\1\216" \
+ "\221\222\377\214\350\354\340\377\1\230\233\234\377\216.46\377\2""7=\77" \
+ "\377\337\340\340\377\242\350\354\340\377\2\312\313\314\377068\377\216" \
+ ".46\377\1\242\244\245\377\215\350\354\340\377\1;AC\377\215.46\377\2""0" \
+ "68\377\316\317\320\377\272\350\354\340\377\1\302\303\304\377\215.46\377" \
+ "\234\350\354\340\377\1\257\261\262\377\216.46\377\2""068\377\317\320" \
+ "\320\377\242\350\354\340\377\2\330\332\332\3775:<\377\216.46\377\1\213" \
+ "\216\217\377\343\350\354\340\377\1\264\266\266\377\215.46\377\2""5;=" \
+ "\377\350\352\351\377\223\350\354\340\377\2\337\340\340\377068\377\214" \
+ ".46\377\2""6<>\377\352\354\346\377\214\350\354\340\377\1>DF\377\216." \
+ "46\377\1\246\250\251\377\244\350\354\340\377\1\216\221\222\377\216.4" \
+ "6\377\1GLN\377\214\350\354\340\377\1\246\251\252\377\216.46\377\1\223" \
+ "\226\227\377\273\350\354\340\377\1\302\303\304\377\215.46\377\234\350" \
+ "\354\340\377\1OTV\377\216.46\377\1\220\223\224\377\244\350\354\340\377" \
+ "\1\244\247\250\377\216.46\377\1""8>\77\377\344\350\354\340\377\1UY[\377" \
+ "\215.46\377\1\202\205\206\377\223\350\354\340\377\1z~\177\377\215.46" \
+ "\377\1\213\216\217\377\214\350\354\340\377\1\271\273\274\377\216.46\377" \
+ "\1Z_a\377\246\350\354\340\377\1JOQ\377\216.46\377\1\310\312\312\377\213" \
+ "\350\354\340\377\1[`a\377\215.46\377\1BHJ\377\274\350\354\340\377\1\302" \
+ "\303\304\377\215.46\377\233\350\354\340\377\1\320\322\322\377\216.46" \
+ "\377\1HMO\377\246\350\354\340\377\1\\ab\377\216.46\377\1\260\263\263" \
+ "\377\343\350\354\340\377\1\302\303\304\377\215.46\377\2""179\377\341" \
+ "\342\342\377\221\350\354\340\377\2\341\342\343\377179\377\214.46\377" \
+ "\2""5;=\377\352\353\347\377\214\350\354\340\377\1nrs\377\216.46\377\1" \
+ "\316\317\320\377\246\350\354\340\377\1\273\275\276\377\216.46\377\1|" \
+ "\200\201\377\212\350\354\340\377\1\341\342\343\377\216.46\377\1\253\255" \
+ "\256\377\274\350\354\340\377\1\302\303\304\377\215.46\377\233\350\354" \
+ "\340\377\1\204\210\211\377\216.46\377\1\270\272\272\377\246\350\354\340" \
+ "\377\2\321\322\323\377/57\377\215.46\377\1eik\377\344\350\354\340\377" \
+ "\1_de\377\215.46\377\1x|}\377\221\350\354\340\377\1~\201\202\377\215" \
+ ".46\377\1\210\214\215\377\214\350\354\340\377\2\350\354\342\37728:\377" \
+ "\215.46\377\1hmn\377\250\350\354\340\377\1X]^\377\215.46\377\1""9>@\377" \
+ "\212\350\354\340\377\1\231\234\235\377\215.46\377\1;AC\377\275\350\354" \
+ "\340\377\1\302\303\304\377\215.46\377\233\350\354\340\377\1=BD\377\215" \
+ ".46\377\1PUW\377\250\350\354\340\377\1ost\377\215.46\377\2""068\377\351" \
+ "\352\350\377\343\350\354\340\377\1\316\317\320\377\215.46\377\2""068" \
+ "\377\330\332\332\377\217\350\354\340\377\2\343\344\344\377179\377\214" \
+ ".46\377\2""4:<\377\350\352\351\377\214\350\354\340\377\1\265\267\270" \
+ "\377\216.46\377\1\305\306\307\377\250\350\354\340\377\1\271\273\273\377" \
+ "\216.46\377\1\303\305\305\377\211\350\354\340\377\1eik\377\215.46\377" \
+ "\1\207\212\213\377\275\350\354\340\377\1\302\303\304\377\215.46\377\232" \
+ "\350\354\340\377\1\313\314\315\377\216.46\377\1\260\263\263\377\250\350" \
+ "\354\340\377\1\317\320\320\377\216.46\377\1\254\257\257\377\344\350\354" \
+ "\340\377\1nrs\377\215.46\377\1kpq\377\217\350\354\340\377\1\200\204\205" \
+ "\377\215.46\377\1\205\210\212\377\215\350\354\340\377\1\201\204\206\377" \
+ "\215.46\377\1MRT\377\252\350\354\340\377\1BHJ\377\215.46\377\1\217\222" \
+ "\223\377\211\350\354\340\377\1""6<>\377\215.46\377\1\312\313\314\377" \
+ "\275\350\354\340\377\1\302\303\304\377\215.46\377\232\350\354\340\377" \
+ "\1\226\231\232\377\215.46\377\1=BD\377\252\350\354\340\377\1W\\]\377" \
+ "\215.46\377\1x|}\377\344\350\354\340\377\2\333\334\334\377068\377\215" \
+ ".46\377\1\317\320\320\377\215\350\354\340\377\2\345\346\346\37739;\377" \
+ "\214.46\377\2""39;\377\347\350\350\377\215\350\354\340\377\1LQR\377\215" \
+ ".46\377\1\225\230\231\377\252\350\354\340\377\1\211\214\215\377\215." \
+ "46\377\1\\ab\377\210\350\354\340\377\1\321\322\323\377\215.46\377\1:" \
+ "@B\377\276\350\354\340\377\1\302\303\304\377\215.46\377\232\350\354\340" \
+ "\377\1bgh\377\215.46\377\1\177\203\204\377\252\350\354\340\377\1\237" \
+ "\242\243\377\215.46\377\1DIK\377\345\350\354\340\377\1z~\177\377\215" \
+ ".46\377\1bfh\377\215\350\354\340\377\1\203\207\210\377\215.46\377\1\203" \
+ "\207\210\377\215\350\354\340\377\1\352\354\346\377\216.46\377\1\335\336" \
+ "\336\377\252\350\354\340\377\1\316\317\320\377\215.46\377\1""179\377" \
+ "\210\350\354\340\377\1\246\251\252\377\215.46\377\1imo\377\276\350\354" \
+ "\340\377\1\302\303\304\377\215.46\377\232\350\354\340\377\1""5:<\377" \
+ "\215.46\377\1\306\310\311\377\252\350\354\340\377\1\344\345\345\377\216" \
+ ".46\377\1\344\345\345\377\252\350\354\340\377\5\304\336\373\377\236\311" \
+ "\370\377\220\301\367\377\234\310\370\377\273\331\372\377\265\350\354" \
+ "\340\377\2\344\345\345\37739;\377\215.46\377\1\304\306\306\377\213\350" \
+ "\354\340\377\2\347\350\350\37739;\377\214.46\377\2""28:\377\345\346\346" \
+ "\377\215\350\354\340\377\1\313\315\315\377\215.46\377\1@FG\377\254\350" \
+ "\354\340\377\1""6<>\377\215.46\377\1\331\332\333\377\207\350\354\340" \
+ "\377\1\212\215\216\377\215.46\377\1\222\225\226\377\276\350\354\340\377" \
+ "\1\302\303\304\377\215.46\377\231\350\354\340\377\1\341\342\343\377\215" \
+ ".46\377\1""28:\377\254\350\354\340\377\1HMO\377\215.46\377\1\302\304" \
+ "\305\377\250\350\354\340\377\2\262\324\371\377[\244\363\377\205O\235" \
+ "\362\377\2U\240\362\377\236\311\370\377\264\350\354\340\377\1\211\214" \
+ "\215\377\215.46\377\1V[]\377\213\350\354\340\377\1\205\210\212\377\215" \
+ ".46\377\1\200\204\205\377\216\350\354\340\377\1\253\256\257\377\215." \
+ "46\377\1quw\377\254\350\354\340\377\1chi\377\215.46\377\1\275\277\277" \
+ "\377\207\350\354\340\377\1mqs\377\215.46\377\1\270\272\272\377\276\350" \
+ "\354\340\377\1\302\303\304\377\215.46\377\231\350\354\340\377\1\302\304" \
+ "\305\377\215.46\377\1[`a\377\254\350\354\340\377\1y}\177\377\215.46\377" \
+ "\1\246\250\251\377\247\350\354\340\377\1\214\277\366\377\211O\235\362" \
+ "\377\1u\262\365\377\263\350\354\340\377\2\352\354\345\3779>@\377\215" \
+ ".46\377\1\271\273\273\377\211\350\354\340\377\2\350\352\351\3775:<\377" \
+ "\214.46\377\2""179\377\343\344\344\377\216\350\354\340\377\1\217\222" \
+ "\223\377\215.46\377\1\231\233\234\377\254\350\354\340\377\1\212\215\216" \
+ "\377\215.46\377\1\235\240\241\377\207\350\354\340\377\1QVX\377\215.4" \
+ "6\377\1\320\322\322\377\276\350\354\340\377\1\302\303\304\377\215.46" \
+ "\377\231\350\354\340\377\1\246\250\251\377\215.46\377\1\202\205\206\377" \
+ "\254\350\354\340\377\1\237\242\243\377\215.46\377\1\207\212\213\377\246" \
+ "\350\354\340\377\1\236\311\370\377\213O\235\362\377\1\177\270\366\377" \
+ "\263\350\354\340\377\1\225\230\231\377\215.46\377\1OTV\377\211\350\354" \
+ "\340\377\1\210\214\215\377\215.46\377\1}\200\202\377\217\350\354\340" \
+ "\377\1y|~\377\215.46\377\1\264\267\267\377\254\350\354\340\377\1\246" \
+ "\251\252\377\215.46\377\1\206\211\212\377\207\350\354\340\377\1;AC\377" \
+ "\215.46\377\1\347\350\350\377\276\350\354\340\377\1\302\303\304\377\215" \
+ ".46\377\231\350\354\340\377\1\216\221\222\377\215.46\377\1\235\240\241" \
+ "\377\254\350\354\340\377\1\274\276\276\377\215.46\377\1nrs\377\245\350" \
+ "\354\340\377\2\342\357\375\377Q\236\362\377\214O\235\362\377\1\304\336" \
+ "\373\377\263\350\354\340\377\1>DF\377\215.46\377\1\256\260\261\377\207" \
+ "\350\354\340\377\2\352\353\347\3775;=\377\214.46\377\2""179\377\341\342" \
+ "\342\377\217\350\354\340\377\1kpq\377\215.46\377\1\313\315\315\377\254" \
+ "\350\354\340\377\1\276\300\301\377\215.46\377\1{\177\200\377\207\350" \
+ "\354\340\377\1""179\377\215.46\377\277\350\354\340\377\1\302\303\304" \
+ "\377\215.46\377\231\350\354\340\377\1\204\210\211\377\215.46\377\1\267" \
+ "\271\272\377\254\350\354\340\377\1\326\327\330\377\215.46\377\1eik\377" \
+ "\245\350\354\340\377\1\232\307\370\377\215O\235\362\377\1z\265\365\377" \
+ "\263\350\354\340\377\1\243\246\247\377\215.46\377\1FKM\377\207\350\354" \
+ "\340\377\1\213\216\217\377\215.46\377\1y}\177\377\220\350\354\340\377" \
+ "\1bgh\377\215.46\377\1\332\333\334\377\254\350\354\340\377\1\314\316" \
+ "\316\377\215.46\377\1quw\377\207\350\354\340\377\216.46\377\277\350\354" \
+ "\340\377\1\302\303\304\377\215.46\377\231\350\354\340\377\1y|~\377\215" \
+ ".46\377\1\302\303\304\377\254\350\354\340\377\1\341\342\343\377\215." \
+ "46\377\1[`a\377\245\350\354\340\377\1i\254\364\377\215O\235\362\377\1" \
+ "Q\236\362\377\264\350\354\340\377\1GMN\377\215.46\377\1\243\246\247\377" \
+ "\205\350\354\340\377\2\352\354\346\3776<>\377\214.46\377\2""068\377\337" \
+ "\340\340\377\220\350\354\340\377\1Y^`\377\215.46\377\1\341\342\343\377" \
+ "\254\350\354\340\377\1\324\326\326\377\215.46\377\1hmn\377\207\350\354" \
+ "\340\377\215.46\377\1""8>\77\377\277\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\231\350\354\340\377\1ptu\377\215.46\377\1\314\316\316\377" \
+ "\254\350\354\340\377\1\351\352\350\377\215.46\377\1QVX\377\245\350\354" \
+ "\340\377\1U\240\362\377\216O\235\362\377\1\344\360\375\377\263\350\354" \
+ "\340\377\1\260\263\263\377\215.46\377\1@FG\377\205\350\354\340\377\1" \
+ "\216\221\222\377\215.46\377\1w{|\377\221\350\354\340\377\1Y]_\377\215" \
+ ".46\377\1\342\343\343\377\254\350\354\340\377\1\325\326\327\377\215." \
+ "46\377\1glm\377\206\350\354\340\377\1\351\352\350\377\215.46\377\1""5" \
+ ";=\377\277\350\354\340\377\1\302\303\304\377\215.46\377\231\350\354\340" \
+ "\377\1ptu\377\215.46\377\1\315\316\317\377\254\350\354\340\377\1\352" \
+ "\353\347\377\215.46\377\1QVX\377\245\350\354\340\377\1U\240\362\377\216" \
+ "O\235\362\377\1\345\361\375\377\264\350\354\340\377\1PUW\377\215.46\377" \
+ "\1\230\233\234\377\203\350\354\340\377\2\351\354\343\3778>\77\377\214" \
+ ".46\377\2""068\377\335\336\336\377\221\350\354\340\377\1bfh\377\215." \
+ "46\377\1\332\333\334\377\254\350\354\340\377\1\314\316\316\377\215.4" \
+ "6\377\1quw\377\207\350\354\340\377\216.46\377\277\350\354\340\377\1\302" \
+ "\303\304\377\215.46\377\231\350\354\340\377\1x|}\377\215.46\377\1\302" \
+ "\303\304\377\254\350\354\340\377\1\341\342\343\377\215.46\377\1Z_a\377" \
+ "\245\350\354\340\377\1l\255\364\377\215O\235\362\377\1R\237\362\377\265" \
+ "\350\354\340\377\1\275\277\300\377\215.46\377\2""9\77A\377\350\354\342" \
+ "\377\202\350\354\340\377\1\220\224\225\377\215.46\377\1txz\377\222\350" \
+ "\354\340\377\1kpq\377\215.46\377\1\314\316\316\377\254\350\354\340\377" \
+ "\1\277\301\302\377\215.46\377\1z~\177\377\207\350\354\340\377\216.46" \
+ "\377\1\352\354\345\377\276\350\354\340\377\1\302\303\304\377\215.46\377" \
+ "\231\350\354\340\377\1\204\210\211\377\215.46\377\1\271\273\273\377\254" \
+ "\350\354\340\377\1\327\330\330\377\215.46\377\1dij\377\245\350\354\340" \
+ "\377\1\236\311\370\377\215O\235\362\377\1\177\270\366\377\266\350\354" \
+ "\340\377\1]ac\377\215.46\377\4\215\220\221\377\350\354\340\377\350\354" \
+ "\342\3779>@\377\214.46\377\2/57\377\332\333\334\377\222\350\354\340\377" \
+ "\1w{|\377\215.46\377\1\265\267\270\377\254\350\354\340\377\1\250\253" \
+ "\253\377\215.46\377\1\205\210\212\377\207\350\354\340\377\1""068\377" \
+ "\215.46\377\1\341\342\342\377\276\350\354\340\377\1\302\303\304\377\215" \
+ ".46\377\231\350\354\340\377\1\215\220\221\377\215.46\377\1\237\242\243" \
+ "\377\254\350\354\340\377\1\276\300\301\377\215.46\377\1mqs\377\245\350" \
+ "\354\340\377\2\350\362\375\377S\237\362\377\214O\235\362\377\1\315\343" \
+ "\373\377\266\350\354\340\377\1\313\315\315\377\215.46\377\3""5;=\377" \
+ "\350\352\351\377\223\226\227\377\215.46\377\1quw\377\223\350\354\340" \
+ "\377\1\216\221\222\377\215.46\377\1\231\234\235\377\254\350\354\340\377" \
+ "\1\214\220\221\377\215.46\377\1\234\237\240\377\207\350\354\340\377\1" \
+ "AFH\377\215.46\377\1\321\322\323\377\276\350\354\340\377\1\302\303\304" \
+ "\377\215.46\377\231\350\354\340\377\1\244\247\250\377\215.46\377\1\203" \
+ "\207\210\377\254\350\354\340\377\1\241\243\244\377\215.46\377\1\205\210" \
+ "\212\377\246\350\354\340\377\1\253\320\371\377\213O\235\362\377\1\214" \
+ "\277\366\377\270\350\354\340\377\1imo\377\215.46\377\2uy{\377:@B\377" \
+ "\214.46\377\2/57\377\330\332\332\377\223\350\354\340\377\1\252\254\255" \
+ "\377\215.46\377\1txy\377\254\350\354\340\377\1gkl\377\215.46\377\1\272" \
+ "\274\275\377\207\350\354\340\377\1W\\]\377\215.46\377\1\251\253\254\377" \
+ "\276\350\354\340\377\1\302\303\304\377\215.46\377\231\350\354\340\377" \
+ "\1\301\302\303\377\215.46\377\1^ce\377\254\350\354\340\377\1}\200\202" \
+ "\377\215.46\377\1\243\246\247\377\247\350\354\340\377\1\231\306\367\377" \
+ "\211O\235\362\377\1\200\270\366\377\271\350\354\340\377\2\327\330\330" \
+ "\377068\377\232.46\377\1nrs\377\224\350\354\340\377\1\311\312\313\377" \
+ "\215.46\377\1CIJ\377\254\350\354\340\377\1""8>\77\377\215.46\377\1\330" \
+ "\331\331\377\207\350\354\340\377\1kpq\377\215.46\377\1\177\203\204\377" \
+ "\276\350\354\340\377\1\302\303\304\377\215.46\377\231\350\354\340\377" \
+ "\1\337\340\340\377\215.46\377\1""4:<\377\254\350\354\340\377\1LQR\377" \
+ "\215.46\377\1\301\302\303\377\250\350\354\340\377\2\303\336\373\377d" \
+ "\251\364\377\205O\235\362\377\2Z\243\363\377\260\323\371\377\273\350" \
+ "\354\340\377\1x|}\377\231.46\377\2/57\377\325\326\327\377\224\350\354" \
+ "\340\377\1\351\352\350\377\216.46\377\1\340\341\341\377\252\350\354\340" \
+ "\377\1\321\322\323\377\215.46\377\1""068\377\210\350\354\340\377\1\213" \
+ "\217\220\377\215.46\377\1V[]\377\276\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\232\350\354\340\377\1""39;\377\215.46\377\1\312\313\314\377" \
+ "\252\350\354\340\377\1\350\351\351\377\216.46\377\1\341\342\342\377\252" \
+ "\350\354\340\377\5\323\346\374\377\255\321\371\377\236\311\370\377\251" \
+ "\317\371\377\313\342\373\377\275\350\354\340\377\2\342\343\343\37728" \
+ ":\377\230.46\377\1kpq\377\226\350\354\340\377\1INP\377\215.46\377\1\232" \
+ "\235\236\377\252\350\354\340\377\1\214\220\221\377\215.46\377\1X]^\377" \
+ "\210\350\354\340\377\1\261\263\264\377\215.46\377\1""179\377\276\350" \
+ "\354\340\377\1\302\303\304\377\215.46\377\232\350\354\340\377\1_de\377" \
+ "\215.46\377\1\204\210\211\377\252\350\354\340\377\1\243\246\247\377\215" \
+ ".46\377\1BGI\377\356\350\354\340\377\1\204\210\211\377\230.46\377\1\323" \
+ "\324\324\377\226\350\354\340\377\1}\200\202\377\215.46\377\1QVX\377\252" \
+ "\350\354\340\377\1GLN\377\215.46\377\1\214\220\221\377\210\350\354\340" \
+ "\377\1\330\331\331\377\216.46\377\1\253\256\257\377\275\350\354\340\377" \
+ "\1\302\303\304\377\215.46\377\232\350\354\340\377\1\224\227\230\377\215" \
+ ".46\377\1\77EG\377\252\350\354\340\377\1[`a\377\215.46\377\1txz\377\356" \
+ "\350\354\340\377\2\352\353\347\3776<>\377\226.46\377\1imo\377\227\350" \
+ "\354\340\377\1\262\264\265\377\216.46\377\1\313\314\315\377\250\350\354" \
+ "\340\377\1\276\300\301\377\216.46\377\1\300\302\302\377\211\350\354\340" \
+ "\377\1;AC\377\215.46\377\1_de\377\275\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\232\350\354\340\377\1\306\310\311\377\216.46\377\1\265\267" \
+ "\270\377\250\350\354\340\377\1\324\325\325\377\216.46\377\1\251\253\254" \
+ "\377\357\350\354\340\377\1\223\226\227\377\226.46\377\1\320\322\322\377" \
+ "\227\350\354\340\377\2\352\354\350\377179\377\215.46\377\1ost\377\250" \
+ "\350\354\340\377\1]ac\377\215.46\377\1""6<>\377\212\350\354\340\377\1" \
+ "mqs\377\215.46\377\2/57\377\341\342\343\377\274\350\354\340\377\1\302" \
+ "\303\304\377\215.46\377\233\350\354\340\377\1""9\77A\377\215.46\377\1" \
+ "V[]\377\250\350\354\340\377\1txz\377\215.46\377\2/57\377\346\346\347" \
+ "\377\360\350\354\340\377\1=BD\377\224.46\377\1fjl\377\231\350\354\340" \
+ "\377\1imo\377\215.46\377\2/57\377\324\325\325\377\246\350\354\340\377" \
+ "\1\303\305\305\377\216.46\377\1x|}\377\212\350\354\340\377\1\246\251" \
+ "\252\377\216.46\377\1y}\177\377\274\350\354\340\377\1\302\303\304\377" \
+ "\215.46\377\233\350\354\340\377\1\200\204\205\377\216.46\377\1\276\300" \
+ "\301\377\246\350\354\340\377\2\330\331\331\377068\377\215.46\377\1`e" \
+ "f\377\361\350\354\340\377\1\237\242\243\377\224.46\377\1\316\317\320" \
+ "\377\231\350\354\340\377\1\264\267\267\377\216.46\377\1aeg\377\246\350" \
+ "\354\340\377\1OTV\377\216.46\377\1\303\305\305\377\212\350\354\340\377" \
+ "\2\351\352\350\377068\377\215.46\377\2/57\377\323\324\324\377\273\350" \
+ "\354\340\377\1\302\303\304\377\215.46\377\233\350\354\340\377\1\313\315" \
+ "\315\377\216.46\377\1NSU\377\246\350\354\340\377\1chi\377\216.46\377" \
+ "\1\253\256\257\377\362\350\354\340\377\1DIK\377\222.46\377\1chi\377\233" \
+ "\350\354\340\377\1;AC\377\216.46\377\1\257\262\263\377\244\350\354\340" \
+ "\377\1\230\233\234\377\216.46\377\1BHJ\377\214\350\354\340\377\1aeg\377" \
+ "\216.46\377\1]ac\377\273\350\354\340\377\1\302\303\304\377\215.46\377" \
+ "\234\350\354\340\377\1JOQ\377\216.46\377\1\231\233\234\377\244\350\354" \
+ "\340\377\1\256\260\261\377\216.46\377\1""5;=\377\363\350\354\340\377" \
+ "\1\256\260\261\377\222.46\377\1\313\314\315\377\233\350\354\340\377\1" \
+ "\224\227\230\377\216.46\377\2:@B\377\346\346\347\377\242\350\354\340" \
+ "\377\2\322\323\324\377179\377\216.46\377\1\235\240\241\377\214\350\354" \
+ "\340\377\1\262\264\265\377\217.46\377\1\220\223\224\377\272\350\354\340" \
+ "\377\1\302\303\304\377\215.46\377\234\350\354\340\377\1\252\254\255\377" \
+ "\216.46\377\2""39;\377\326\327\330\377\242\350\354\340\377\2\340\341" \
+ "\341\3778>\77\377\216.46\377\1\207\212\213\377\364\350\354\340\377\1" \
+ "OTV\377\220.46\377\1`ef\377\234\350\354\340\377\2\350\354\342\3778>\77" \
+ "\377\216.46\377\1Y]_\377\241\350\354\340\377\2\350\351\351\377EJL\377" \
+ "\216.46\377\1;AC\377\216\350\354\340\377\1BHJ\377\216.46\377\2/57\377" \
+ "\264\267\267\377\271\350\354\340\377\1\302\303\304\377\215.46\377\235" \
+ "\350\354\340\377\1EJL\377\216.46\377\2KPR\377\351\354\343\377\241\350" \
+ "\354\340\377\1NSU\377\216.46\377\2""179\377\346\346\347\377\364\350\354" \
+ "\340\377\1\272\274\275\377\220.46\377\1\307\311\311\377\235\350\354\340" \
+ "\377\1\220\223\224\377\217.46\377\1swx\377\240\350\354\340\377\1SXY\377" \
+ "\217.46\377\1\220\224\225\377\216\350\354\340\377\1\233\236\237\377\217" \
+ ".46\377\2""6<>\377\301\302\303\377\270\350\354\340\377\1\302\303\304" \
+ "\377\215.46\377\1\352\354\350\377\234\350\354\340\377\1\246\251\252\377" \
+ "\217.46\377\1bfh\377\240\350\354\340\377\1chi\377\217.46\377\1z~\177" \
+ "\377\366\350\354\340\377\1Y]_\377\216.46\377\1^ce\377\237\350\354\340" \
+ "\377\1BGI\377\217.46\377\1lqr\377\235\350\354\340\377\2\352\354\350\377" \
+ "SXY\377\217.46\377\1BGI\377\220\350\354\340\377\1@FG\377\217.46\377\2" \
+ "068\377\246\251\252\377\267\350\354\340\377\1\302\303\304\377\215.46" \
+ "\377\1\335\336\337\377\235\350\354\340\377\1QVX\377\217.46\377\1\\ab" \
+ "\377\236\350\354\340\377\1_de\377\217.46\377\2""6<>\377\346\347\347\377" \
+ "\366\350\354\340\377\1\311\312\313\377\216.46\377\1\304\306\306\377\237" \
+ "\350\354\340\377\1\265\267\270\377\220.46\377\2W\\]\377\344\345\345\377" \
+ "\232\350\354\340\377\2\326\327\330\377HMO\377\220.46\377\1\261\263\264" \
+ "\377\220\350\354\340\377\1\247\252\253\377\221.46\377\1\202\206\207\377" \
+ "\242\350\354\340\377\2\264\267\267\377\276\300\301\377\222\350\354\340" \
+ "\377\1\310\312\312\377\215.46\377\1\267\271\272\377\235\350\354\340\377" \
+ "\2\314\316\316\377/57\377\217.46\377\2LQS\377\330\331\331\377\232\350" \
+ "\354\340\377\2\341\342\342\377SXY\377\220.46\377\1\231\233\234\377\367" \
+ "\350\354\340\377\2\341\342\343\377068\377\214.46\377\1[`a\377\241\350" \
+ "\354\340\377\1eik\377\220.46\377\2;AC\377\263\265\266\377\230\350\354" \
+ "\340\377\2\246\251\252\3775:<\377\220.46\377\1]ac\377\222\350\354\340" \
+ "\377\1Y]_\377\221.46\377\2BHJ\377\264\267\267\377\235\350\354\340\377" \
+ "\5\331\332\333\377\207\213\214\377=BD\377.46\377FKM\377\222\350\354\340" \
+ "\377\1\327\330\330\377\215.46\377\1uy{\377\220\350\354\340\377\1\350" \
+ "\354\342\377\215\350\354\340\377\1|\200\201\377\220.46\377\2""5:<\377" \
+ "\245\247\250\377\230\350\354\340\377\2\265\267\270\377;AC\377\220.46" \
+ "\377\1KPR\377\370\350\354\340\377\1\205\210\212\377\215.46\377\1\302" \
+ "\303\304\377\241\350\354\340\377\2\350\351\351\377>DF\377\221.46\377" \
+ "\2fjl\377\335\336\336\377\224\350\354\340\377\2\327\330\330\377^bd\377" \
+ "\221.46\377\2""9\77A\377\342\343\343\377\222\350\354\340\377\2\332\333" \
+ "\334\37739;\377\222.46\377\2W\\]\377\257\262\263\377\230\350\354\340" \
+ "\377\3\320\322\322\377\217\222\223\377MRT\377\205.46\377\1\246\250\251" \
+ "\377\221\350\354\340\377\1\347\350\350\377\215.46\377\2""179\377\324" \
+ "\326\326\377\215\350\354\340\377\3\235\240\241\377CIJ\377txz\377\216" \
+ "\350\354\340\377\1KPR\377\221.46\377\2[`a\377\324\325\325\377\224\350" \
+ "\354\340\377\2\341\342\342\377kop\377\221.46\377\2""39;\377\323\324\324" \
+ "\377\367\350\354\340\377\2\350\354\342\3775;=\377\214.46\377\1Y]_\377" \
+ "\243\350\354\340\377\2\303\305\305\377/57\377\221.46\377\3""068\377{" \
+ "\177\200\377\332\333\334\377\220\350\354\340\377\3\325\326\327\377tx" \
+ "z\377/57\377\222.46\377\1\270\272\272\377\224\350\354\340\377\1\244\247" \
+ "\250\377\224.46\377\3>DF\377\206\211\212\377\277\301\302\377\221\350" \
+ "\354\340\377\4\325\326\327\377\245\247\250\377txy\377BGI\377\210.46\377" \
+ "\1BGI\377\222\350\354\340\377\1/57\377\215.46\377\2CIJ\377\330\332\332" \
+ "\377\211\350\354\340\377\3\302\304\305\377|\200\201\3777=\77\377\202" \
+ ".46\377\2""068\377\332\333\334\377\215\350\354\340\377\2\326\327\330" \
+ "\3774:<\377\221.46\377\3/57\377ptv\377\320\322\322\377\220\350\354\340" \
+ "\377\3\336\337\337\377\201\204\206\377179\377\222.46\377\1\237\242\243" \
+ "\377\370\350\354\340\377\1\224\227\230\377\215.46\377\1\277\301\302\377" \
+ "\244\350\354\340\377\1\224\227\230\377\224.46\377\3TYZ\377\232\235\236" \
+ "\377\317\320\320\377\212\350\354\340\377\3\321\322\323\377\232\235\236" \
+ "\377SXY\377\224.46\377\1\207\212\213\377\226\350\354\340\377\1vz{\377" \
+ "\226.46\377\21""179\377\\ab\377~\201\202\377\233\236\237\377\272\274" \
+ "\275\377\313\315\315\377\325\326\327\377\333\334\334\377\343\344\344" \
+ "\377\331\332\333\377\315\316\317\377\301\302\303\377\264\266\266\377" \
+ "\224\230\231\377uy{\377V[]\3776<>\377\215.46\377\1\236\241\242\377\221" \
+ "\350\354\340\377\1PUW\377\216.46\377\12""179\377y}\177\377\274\276\276" \
+ "\377\337\340\340\377\343\344\344\377\332\333\334\377\305\306\307\377" \
+ "\235\237\240\377rvw\377<BC\377\206.46\377\1quw\377\216\350\354\340\377" \
+ "\1\253\256\257\377\224.46\377\3NSU\377\223\226\227\377\312\313\314\377" \
+ "\212\350\354\340\377\3\327\330\330\377\241\243\244\377]ac\377\224.46" \
+ "\377\1ptu\377\371\350\354\340\377\1=BD\377\214.46\377\1V[]\377\246\350" \
+ "\354\340\377\1|\200\201\377\226.46\377\12""39;\377PUV\377nrs\377~\201" \
+ "\202\377\207\212\213\377\210\214\215\377~\202\203\377ost\377RWY\3774" \
+ ":<\377\226.46\377\1nrs\377\230\350\354\340\377\1aeg\377\263.46\377\1" \
+ ">CE\377\221\350\354\340\377\1\204\210\211\377\236.46\377\2/57\377\330" \
+ "\331\331\377\216\350\354\340\377\1\220\224\225\377\226.46\377\12""28" \
+ ":\377LQS\377kop\377|\200\201\377\205\210\212\377\211\214\215\377\200" \
+ "\204\205\377ptv\377UZ\\\3776<>\377\226.46\377\1[`a\377\371\350\354\340" \
+ "\377\1\225\230\231\377\215.46\377\1\274\276\276\377\247\350\354\340\377" \
+ "\1nrs\377\264.46\377\1[`a\377\232\350\354\340\377\1UZ\\\377\263.46\377" \
+ "\1\231\233\234\377\220\350\354\340\377\1\270\272\272\377\237.46\377\1" \
+ "ost\377\217\350\354\340\377\1\204\210\211\377\264.46\377\2PUW\377\351" \
+ "\354\343\377\370\350\354\340\377\2\350\354\342\3779>@\377\214.46\377" \
+ "\1TYZ\377\251\350\354\340\377\1nrs\377\262.46\377\1bfh\377\234\350\354" \
+ "\340\377\1_de\377\262.46\377\1:@B\377\221\350\354\340\377\1BHJ\377\236" \
+ ".46\377\2/57\377\326\327\330\377\217\350\354\340\377\1\177\203\204\377" \
+ "\262.46\377\2SXY\377\351\352\350\377\371\350\354\340\377\1\213\217\220" \
+ "\377\215.46\377\1\271\273\274\377\252\350\354\340\377\1\177\203\204\377" \
+ "\260.46\377\1quw\377\236\350\354\340\377\1rvw\377\262.46\377\1\222\225" \
+ "\226\377\220\350\354\340\377\1\231\234\235\377\237.46\377\1mqs\377\220" \
+ "\350\354\340\377\1\224\227\230\377\260.46\377\1bfh\377\372\350\354\340" \
+ "\377\2\350\352\351\3775:<\377\214.46\377\1QVX\377\254\350\354\340\377" \
+ "\2\231\233\234\377068\377\254.46\377\2/57\377\214\220\221\377\240\350" \
+ "\354\340\377\2\237\242\243\377068\377\260.46\377\2""7=\77\377\352\354" \
+ "\345\377\220\350\354\340\377\1BHJ\377\237.46\377\1\323\324\324\377\220" \
+ "\350\354\340\377\2\253\256\257\3774:<\377\255.46\377\1y|~\377\373\350" \
+ "\354\340\377\1\202\205\206\377\215.46\377\1\266\270\271\377\255\350\354" \
+ "\340\377\2\312\313\314\377CIJ\377\252.46\377\2>CE\377\277\301\302\377" \
+ "\242\350\354\340\377\2\322\323\324\377PUV\377\260.46\377\1\213\216\217" \
+ "\377\220\350\354\340\377\2\307\311\311\377/57\377\236.46\377\1jnp\377" \
+ "\221\350\354\340\377\2\330\331\331\377LQS\377\252.46\377\2""6<>\377\257" \
+ "\262\263\377\373\350\354\340\377\2\342\343\343\377179\377\214.46\377" \
+ "\1NSU\377\257\350\354\340\377\2\351\354\343\377quw\377\250.46\377\2f" \
+ "jl\377\346\347\347\377\245\350\354\340\377\2\224\230\231\3775;=\377\255" \
+ ".46\377\2W\\]\377\265\267\270\377\221\350\354\340\377\1\227\232\233\377" \
+ "\237.46\377\1\321\322\323\377\222\350\354\340\377\2\200\204\205\377/" \
+ "57\377\247.46\377\2Y^`\377\335\336\336\377\374\350\354\340\377\1ptu\377" \
+ "\215.46\377\1\264\267\267\377\261\350\354\340\377\2\304\306\306\377L" \
+ "QR\377\244.46\377\2FKM\377\271\273\274\377\250\350\354\340\377\3\346" \
+ "\347\347\377|\200\201\37728:\377\250.46\377\3""28:\377vz{\377\317\321" \
+ "\321\377\224\350\354\340\377\1\235\237\240\377\234.46\377\3/57\377qu" \
+ "w\377\341\342\342\377\223\350\354\340\377\2\321\322\323\377V[]\377\244" \
+ ".46\377\2>DF\377\253\256\257\377\375\350\354\340\377\1\306\307\310\377" \
+ "\215.46\377\1MRT\377\264\350\354\340\377\2\242\245\246\377CIJ\377\240" \
+ ".46\377\2>CE\377\231\233\234\377\254\350\354\340\377\3\346\346\347\377" \
+ "\207\213\214\377:@B\377\243.46\377\4/57\377Y^`\377\235\240\241\377\352" \
+ "\353\347\377\227\350\354\340\377\2\266\270\271\377>CE\377\230.46\377" \
+ "\3""179\377quw\377\324\326\326\377\227\350\354\340\377\2\255\257\260" \
+ "\377KPR\377\240.46\377\3""9>@\377\215\220\221\377\350\354\342\377\376" \
+ "\350\354\340\377\1OTV\377\215.46\377\1\262\264\265\377\266\350\354\340" \
+ "\377\2\252\254\255\377KPR\377\234.46\377\2DIK\377\242\244\245\377\261" \
+ "\350\354\340\377\3\256\260\261\377dij\377068\377\235.46\377\4""068\377" \
+ "`ef\377\243\246\247\377\346\347\347\377\233\350\354\340\377\3\352\354" \
+ "\345\377z~\177\37728:\377\224.46\377\3HMO\377\224\230\231\377\350\351" \
+ "\351\377\233\350\354\340\377\2\265\267\270\377SXY\377\234.46\377\2>C" \
+ "E\377\226\231\232\377\377\350\354\340\377\2\350\354\340\377\227\232\233" \
+ "\377\215.46\377\1PUW\377\271\350\354\340\377\3\317\320\320\377\210\214" \
+ "\215\377BHJ\377\226.46\377\3>CE\377\201\204\206\377\312\313\314\377\265" \
+ "\350\354\340\377\4\350\354\342\377\257\261\262\377x|}\377BHJ\377\226" \
+ ".46\377\5""6<>\377`ef\377\220\223\224\377\277\301\302\377\350\354\342" \
+ "\377\240\350\354\340\377\3\347\350\350\377\220\223\224\377HMO\377\216" \
+ ".46\377\4""179\377[`a\377\224\227\230\377\326\327\330\377\240\350\354" \
+ "\340\377\3\330\331\331\377\220\223\224\377HMO\377\226.46\377\3""9>@\377" \
+ "z~\177\377\301\302\303\377\377\350\354\340\377\202\350\354\340\377\2" \
+ "\332\333\334\37739;\377\215.46\377\1\275\277\277\377\274\350\354\340" \
+ "\377\4\326\327\330\377\244\247\250\377swx\377CIJ\377\216.46\377\4@FG" \
+ "\377nrs\377\240\243\244\377\321\322\323\377\274\350\354\340\377\7\350" \
+ "\352\351\377\306\307\310\377\242\244\245\377\177\203\204\377Y^`\377B" \
+ "HJ\3775;=\377\211.46\377\6CIJ\377_de\377z~\177\377\226\231\232\377\262" \
+ "\264\265\377\325\326\327\377\250\350\354\340\377\6\336\337\337\377\246" \
+ "\251\252\377\205\210\212\377fjl\377LQS\377DIK\377\202<BC\377\6GLN\377" \
+ "SXY\377eik\377\204\210\211\377\242\245\246\377\311\312\313\377\247\350" \
+ "\354\340\377\4\333\334\334\377\251\253\254\377x|}\377HMO\377\216.46\377" \
+ "\4;AC\377imo\377\232\235\236\377\314\316\316\377\377\350\354\340\377" \
+ "\205\350\354\340\377\1UZ\\\377\215.46\377\1\\ab\377\302\350\354\340\377" \
+ "\14\330\331\331\377\274\276\276\377\244\247\250\377\235\237\240\377\220" \
+ "\223\224\377\210\214\215\377\207\212\213\377\220\223\224\377\234\237" \
+ "\240\377\243\246\247\377\271\273\273\377\326\327\330\377\311\350\354" \
+ "\340\377\5\352\354\345\377\340\341\341\377\325\326\327\377\341\342\342" \
+ "\377\343\344\344\377\353\350\354\340\377\15\333\334\334\377\276\300\301" \
+ "\377\246\250\251\377\235\240\241\377\220\224\225\377\211\214\215\377" \
+ "\205\210\212\377\220\223\224\377\232\235\236\377\242\244\245\377\265" \
+ "\267\270\377\323\324\324\377\350\354\342\377\377\350\354\340\377\210" \
+ "\350\354\340\377\1\205\210\212\377\216.46\377\1\313\315\315\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\235\350\354\340" \
+ "\377\1\264\267\267\377\216.46\377\1txz\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\235\350\354\340\377\2\322\323\324\377" \
+ "5:<\377\215.46\377\2""9>@\377\350\352\351\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\234\350\354\340\377\2\334\335\335" \
+ "\377\77EG\377\216.46\377\1\243\246\247\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\234\350\354\340\377\2\335\336\337\377" \
+ "@FG\377\216.46\377\1V[]\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\234\350\354\340\377\2\336\337\337\377BGI\377\216.46" \
+ "\377\2""6<>\377\335\336\336\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\233\350\354\340\377\2\333\334\334\377BHJ\377\217" \
+ ".46\377\1\252\254\255\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\233\350\354\340\377\2\277\301\302\3779>@\377\217.46" \
+ "\377\1ptu\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\233\350\354\340\377\2\215\220\221\377/57\377\217.46\377\1LQS\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\232\350" \
+ "\354\340\377\2\304\306\306\377PUW\377\220.46\377\2\77EG\377\341\342\343" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\230" \
+ "\350\354\340\377\2\335\336\336\377imo\377\221.46\377\2""5:<\377\322\323" \
+ "\324\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\227\350\354\340\377\3\312\313\314\377vz{\377179\377\221.46\377\2""2" \
+ "8:\377\275\277\277\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\225\350\354\340\377\3\341\342\343\377\237\242\243\377MR" \
+ "T\377\223.46\377\2""068\377\271\273\274\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\223\350\354\340\377\3\310\312\312\377" \
+ "\215\220\221\377OTV\377\225.46\377\2""068\377\264\267\267\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\221\350\354\340" \
+ "\377\3\217\222\223\377Y^`\377179\377\227.46\377\2""5:<\377\275\277\300" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\222" \
+ "\350\354\340\377\1\201\204\206\377\230.46\377\2;AC\377\313\315\315\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\223\350" \
+ "\354\340\377\2\341\342\343\377179\377\226.46\377\2NSU\377\335\336\337" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\225" \
+ "\350\354\340\377\1x|}\377\225.46\377\1ptu\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\227\350\354\340\377\2\333\334\334" \
+ "\377/57\377\222.46\377\2""9>@\377\252\254\255\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\231\350\354\340\377\1ptu\377" \
+ "\221.46\377\2eik\377\344\345\345\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\232\350\354\340\377\1\324\325\325\377\217" \
+ ".46\377\2PUW\377\275\277\277\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\235\350\354\340\377\1gkl\377\214.46\377\2LQ" \
+ "S\377\260\263\263\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\237\350\354\340\377\1\313\315\315\377\211.46\377\3""068" \
+ "\377jnp\377\275\277\277\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\242\350\354\340\377\1^ce\377\205.46\377\4""8>\77\377" \
+ "kpq\377\253\255\256\377\350\352\351\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\244\350\354\340\377\6\302\304\305\377.4" \
+ "6\377;AC\377bgh\377\224\230\231\377\314\316\316\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\251\350\354\340\377\1\345\346" \
+ "\346\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\337\350\354\340\377\1\352\354\350\377\210\325\326\327\377\1\341" \
+ "\342\342\377\232\350\354\340\377\1\341\342\343\377\207\325\326\327\377" \
+ "\1\343\344\344\377\244\350\354\340\377\2\314\316\316\377\267\271\272" \
+ "\377\202\244\247\250\377\2\267\271\272\377\315\316\317\377\236\350\354" \
+ "\340\377\1\350\351\351\377\204\343\344\344\377\224\350\354\340\377\1" \
+ "\332\333\334\377\217\325\326\327\377\232\350\354\340\377\3\300\302\302" \
+ "\377\235\237\240\377\206\211\212\377\202\202\205\206\377\3\212\215\216" \
+ "\377\242\245\246\377\307\311\311\377\225\350\354\340\377\1\344\345\345" \
+ "\377\223\325\326\327\377\1\335\336\336\377\377\350\354\340\377\302\350" \
+ "\354\340\377\1\235\237\240\377\212.46\377\3KPR\377\213\216\217\377\335" \
+ "\336\337\377\226\350\354\340\377\1kpq\377\211.46\377\3BGI\377txy\377" \
+ "\271\273\273\377\235\350\354\340\377\3\265\267\270\377lqr\3776<>\377" \
+ "\206.46\377\3""6<>\377nrs\377\270\272\272\377\233\350\354\340\377\1S" \
+ "XY\377\204.46\377\224\350\354\340\377\1GLN\377\217.46\377\1\331\332\333" \
+ "\377\226\350\354\340\377\3\267\271\272\377fjl\377068\377\210.46\377\4" \
+ "068\377aeg\377\246\251\252\377\350\354\342\377\221\350\354\340\377\1" \
+ "x|}\377\223.46\377\1SXY\377\377\350\354\340\377\302\350\354\340\377\1" \
+ "\235\237\240\377\214.46\377\2""179\377\213\217\220\377\225\350\354\340" \
+ "\377\1kpq\377\214.46\377\2PUW\377\326\327\330\377\231\350\354\340\377" \
+ "\2\275\277\300\377PUV\377\214.46\377\2RWY\377\277\301\302\377\231\350" \
+ "\354\340\377\1SXY\377\204.46\377\224\350\354\340\377\1GLN\377\217.46" \
+ "\377\1\332\333\334\377\224\350\354\340\377\2\312\313\314\377QVX\377\216" \
+ ".46\377\2""6<>\377\207\213\214\377\220\350\354\340\377\1txz\377\223." \
+ "46\377\1SXY\377\377\350\354\340\377\302\350\354\340\377\1\235\237\240" \
+ "\377\216.46\377\1swx\377\224\350\354\340\377\1kpq\377\215.46\377\2""7" \
+ "=\77\377\317\321\321\377\227\350\354\340\377\1\210\214\215\377\220.4" \
+ "6\377\1\211\214\215\377\230\350\354\340\377\1SXY\377\204.46\377\224\350" \
+ "\354\340\377\1GLN\377\217.46\377\1\334\335\335\377\223\350\354\340\377" \
+ "\2\225\230\231\377068\377\220.46\377\1JOQ\377\220\350\354\340\377\1k" \
+ "pq\377\223.46\377\1SXY\377\377\350\354\340\377\302\350\354\340\377\1" \
+ "\235\237\240\377\204.46\377\1@FG\377\202JOQ\377\2FKM\377068\377\206." \
+ "46\377\1\257\261\262\377\223\350\354\340\377\1kpq\377\204.46\377\1GL" \
+ "N\377\202JOQ\377\1AFH\377\206.46\377\1GMN\377\226\350\354\340\377\1g" \
+ "lm\377\207.46\377\4<BC\377QVX\377RWY\377>CE\377\207.46\377\1glm\377\227" \
+ "\350\354\340\377\1SXY\377\204.46\377\224\350\354\340\377\1GLN\377\203" \
+ ".46\377\1/57\377\213<BC\377\1\350\351\351\377\222\350\354\340\377\1\204" \
+ "\210\211\377\207.46\377\6INP\377fjl\377txy\377imo\377QVX\37728:\377\205" \
+ ".46\377\1\255\257\260\377\220\350\354\340\377\1uy{\377\206<BC\377\1;" \
+ "AC\377\204.46\377\1""068\377\207<BC\377\1^ce\377\377\350\354\340\377" \
+ "\302\350\354\340\377\1\235\237\240\377\204.46\377\1\265\267\270\377\204" \
+ "\350\354\340\377\2\250\253\253\3776<>\377\204.46\377\1SXY\377\223\350" \
+ "\354\340\377\1kpq\377\204.46\377\1\346\347\347\377\203\350\354\340\377" \
+ "\2\352\354\345\377\207\213\214\377\205.46\377\1\271\273\274\377\224\350" \
+ "\354\340\377\1z~\177\377\205.46\377\3""5;=\377\213\217\220\377\327\330" \
+ "\330\377\204\350\354\340\377\3\334\335\335\377\223\226\227\3778>\77\377" \
+ "\205.46\377\1y|~\377\226\350\354\340\377\1SXY\377\204.46\377\224\350" \
+ "\354\340\377\1GLN\377\203.46\377\1:@B\377\235\350\354\340\377\1\240\243" \
+ "\244\377\205.46\377\3:@B\377\224\230\231\377\344\345\345\377\206\350" \
+ "\354\340\377\5\306\307\310\377\202\205\206\377:@B\377.46\377GMN\377\231" \
+ "\350\354\340\377\204.46\377\1SXY\377\377\350\354\340\377\312\350\354" \
+ "\340\377\1\235\237\240\377\204.46\377\1\265\267\270\377\205\350\354\340" \
+ "\377\1\255\257\260\377\205.46\377\1\351\354\343\377\222\350\354\340\377" \
+ "\1kpq\377\204.46\377\1\346\347\347\377\205\350\354\340\377\1z~\177\377" \
+ "\204.46\377\1\210\214\215\377\223\350\354\340\377\1\257\262\263\377\205" \
+ ".46\377\2^bd\377\350\352\351\377\210\350\354\340\377\2\351\354\343\377" \
+ "glm\377\205.46\377\1\253\256\257\377\225\350\354\340\377\1SXY\377\204" \
+ ".46\377\224\350\354\340\377\1GLN\377\203.46\377\1:@B\377\234\350\354" \
+ "\340\377\2\332\333\334\37728:\377\204.46\377\2[`a\377\347\350\350\377" \
+ "\213\350\354\340\377\2\237\242\243\377\264\266\266\377\231\350\354\340" \
+ "\377\204.46\377\1SXY\377\377\350\354\340\377\312\350\354\340\377\1\235" \
+ "\237\240\377\204.46\377\1\265\267\270\377\206\350\354\340\377\205.46" \
+ "\377\1\330\331\331\377\222\350\354\340\377\1kpq\377\204.46\377\1\346" \
+ "\347\347\377\205\350\354\340\377\1\310\312\312\377\204.46\377\1quw\377" \
+ "\223\350\354\340\377\1BGI\377\204.46\377\1gkl\377\214\350\354\340\377" \
+ "\1txy\377\204.46\377\1AFH\377\225\350\354\340\377\1SXY\377\204.46\377" \
+ "\224\350\354\340\377\1GLN\377\203.46\377\1:@B\377\234\350\354\340\377" \
+ "\1jnp\377\204.46\377\1UZ\\\377\250\350\354\340\377\204.46\377\1SXY\377" \
+ "\377\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377" \
+ "\1\265\267\270\377\205\350\354\340\377\1\352\354\345\377\205.46\377\1" \
+ "\340\341\341\377\222\350\354\340\377\1kpq\377\204.46\377\1\346\347\347" \
+ "\377\205\350\354\340\377\1\271\273\273\377\204.46\377\1\201\204\206\377" \
+ "\222\350\354\340\377\1\234\237\240\377\204.46\377\1CIJ\377\216\350\354" \
+ "\340\377\1PUV\377\204.46\377\1\233\236\237\377\224\350\354\340\377\1" \
+ "SXY\377\204.46\377\224\350\354\340\377\1GLN\377\203.46\377\1:@B\377\233" \
+ "\350\354\340\377\1\341\342\342\377\204.46\377\2""179\377\335\336\337" \
+ "\377\250\350\354\340\377\204.46\377\1SXY\377\377\350\354\340\377\312" \
+ "\350\354\340\377\1\235\237\240\377\204.46\377\1\265\267\270\377\205\350" \
+ "\354\340\377\1\222\225\226\377\204.46\377\1""068\377\223\350\354\340" \
+ "\377\1kpq\377\204.46\377\1\346\347\347\377\205\350\354\340\377\1bfh\377" \
+ "\204.46\377\1\235\237\240\377\222\350\354\340\377\1V[]\377\204.46\377" \
+ "\1\253\256\257\377\216\350\354\340\377\1\273\275\276\377\204.46\377\1" \
+ "TYZ\377\224\350\354\340\377\1SXY\377\204.46\377\224\350\354\340\377\1" \
+ "GLN\377\203.46\377\1:@B\377\233\350\354\340\377\1\231\233\234\377\204" \
+ ".46\377\1y}\177\377\251\350\354\340\377\204.46\377\1SXY\377\377\350\354" \
+ "\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\265\267\270" \
+ "\377\203\350\354\340\377\3\345\346\346\377\206\211\212\377/57\377\204" \
+ ".46\377\1[`a\377\223\350\354\340\377\1kpq\377\204.46\377\1\346\347\347" \
+ "\377\203\350\354\340\377\2\323\324\324\377fjl\377\204.46\377\2/57\377" \
+ "\336\337\337\377\221\350\354\340\377\1\345\346\346\377\204.46\377\1""9" \
+ "\77A\377\220\350\354\340\377\1BHJ\377\204.46\377\1\341\342\342\377\223" \
+ "\350\354\340\377\1SXY\377\204.46\377\224\350\354\340\377\1GLN\377\203" \
+ ".46\377\1:@B\377\233\350\354\340\377\1gkl\377\204.46\377\1\300\302\302" \
+ "\377\251\350\354\340\377\204.46\377\1SXY\377\377\350\354\340\377\312" \
+ "\350\354\340\377\1\235\237\240\377\204.46\377\1""7=\77\377\203<BC\377" \
+ "\1/57\377\206.46\377\1\257\262\263\377\223\350\354\340\377\1kpq\377\204" \
+ ".46\377\1:@B\377\202<BC\377\1""9>@\377\206.46\377\1\200\204\205\377\222" \
+ "\350\354\340\377\1\302\303\304\377\204.46\377\1rvw\377\220\350\354\340" \
+ "\377\1~\202\203\377\204.46\377\1\274\276\276\377\223\350\354\340\377" \
+ "\1SXY\377\204.46\377\224\350\354\340\377\1GLN\377\203.46\377\1""179\377" \
+ "\211fjl\377\1\311\312\313\377\221\350\354\340\377\1@FG\377\204.46\377" \
+ "\1\352\354\345\377\251\350\354\340\377\204.46\377\1SXY\377\377\350\354" \
+ "\340\377\312\350\354\340\377\1\235\237\240\377\216.46\377\1eik\377\224" \
+ "\350\354\340\377\1kpq\377\215.46\377\1ptv\377\223\350\354\340\377\1\256" \
+ "\260\261\377\204.46\377\1\217\222\223\377\220\350\354\340\377\1\235\237" \
+ "\240\377\204.46\377\1\246\250\251\377\223\350\354\340\377\1SXY\377\204" \
+ ".46\377\224\350\354\340\377\1GLN\377\215.46\377\1\265\267\270\377\221" \
+ "\350\354\340\377\1""179\377\203.46\377\1""39;\377\252\350\354\340\377" \
+ "\204.46\377\1SXY\377\377\350\354\340\377\312\350\354\340\377\1\235\237" \
+ "\240\377\215.46\377\1ptu\377\225\350\354\340\377\1kpq\377\213.46\377" \
+ "\2:@B\377\255\257\260\377\224\350\354\340\377\1\236\241\242\377\204." \
+ "46\377\1\235\237\240\377\220\350\354\340\377\1\251\253\254\377\204.4" \
+ "6\377\1\231\233\234\377\223\350\354\340\377\1SXY\377\204.46\377\224\350" \
+ "\354\340\377\1GLN\377\215.46\377\1\265\267\270\377\221\350\354\340\377" \
+ "\204.46\377\1:@B\377\252\350\354\340\377\204.46\377\1SXY\377\377\350" \
+ "\354\340\377\312\350\354\340\377\1\235\237\240\377\212.46\377\3""8>\77" \
+ "\377ost\377\310\312\312\377\226\350\354\340\377\1kpq\377\213.46\377\2" \
+ "7=\77\377\352\354\350\377\224\350\354\340\377\1\257\262\263\377\204." \
+ "46\377\1\214\220\221\377\220\350\354\340\377\1\231\234\235\377\204.4" \
+ "6\377\1\251\253\254\377\223\350\354\340\377\1SXY\377\204.46\377\224\350" \
+ "\354\340\377\1GLN\377\215.46\377\1\265\267\270\377\221\350\354\340\377" \
+ "\1""5;=\377\203.46\377\1""068\377\252\350\354\340\377\204.46\377\1SX" \
+ "Y\377\377\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204." \
+ "46\377\1x|}\377\202\253\256\257\377\3\254\257\257\377\300\302\302\377" \
+ "\326\327\330\377\231\350\354\340\377\1kpq\377\204.46\377\1\302\303\304" \
+ "\377\202\325\326\327\377\1\204\210\211\377\204.46\377\1\202\206\207\377" \
+ "\224\350\354\340\377\1\304\306\306\377\204.46\377\1kpq\377\220\350\354" \
+ "\340\377\1z~\177\377\204.46\377\1\275\277\277\377\223\350\354\340\377" \
+ "\1SXY\377\204.46\377\224\350\354\340\377\1GLN\377\203.46\377\1""6<>\377" \
+ "\211\271\273\274\377\1\346\347\347\377\221\350\354\340\377\1INP\377\204" \
+ ".46\377\1\331\332\333\377\251\350\354\340\377\204.46\377\1SXY\377\377" \
+ "\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\251" \
+ "\253\254\377\236\350\354\340\377\1kpq\377\204.46\377\1\346\347\347\377" \
+ "\202\350\354\340\377\2\350\354\342\3779\77A\377\203.46\377\2""179\377" \
+ "\336\337\337\377\223\350\354\340\377\2\351\352\350\377068\377\203.46" \
+ "\377\1""5;=\377\220\350\354\340\377\1=BD\377\203.46\377\2/57\377\347" \
+ "\350\350\377\223\350\354\340\377\1SXY\377\204.46\377\224\350\354\340" \
+ "\377\1GLN\377\203.46\377\1:@B\377\233\350\354\340\377\1swx\377\204.4" \
+ "6\377\1\235\240\241\377\251\350\354\340\377\204.46\377\1SXY\377\377\350" \
+ "\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\251\253" \
+ "\254\377\236\350\354\340\377\1kpq\377\204.46\377\1\346\347\347\377\203" \
+ "\350\354\340\377\1\224\230\231\377\204.46\377\1ptu\377\224\350\354\340" \
+ "\377\1\\ab\377\204.46\377\1\242\244\245\377\216\350\354\340\377\1\260" \
+ "\263\263\377\204.46\377\1Y^`\377\224\350\354\340\377\1SXY\377\204.46" \
+ "\377\224\350\354\340\377\1GLN\377\203.46\377\1:@B\377\233\350\354\340" \
+ "\377\1\250\253\253\377\204.46\377\1HMO\377\251\350\354\340\377\204.4" \
+ "6\377\1SXY\377\377\350\354\340\377\312\350\354\340\377\1\235\237\240" \
+ "\377\204.46\377\1\251\253\254\377\236\350\354\340\377\1kpq\377\204.4" \
+ "6\377\1\346\347\347\377\204\350\354\340\377\1<BC\377\204.46\377\1\317" \
+ "\320\320\377\223\350\354\340\377\1\245\247\250\377\204.46\377\2<BC\377" \
+ "\346\347\347\377\214\350\354\340\377\2\351\354\343\377FKM\377\204.46" \
+ "\377\1\243\246\247\377\224\350\354\340\377\1SXY\377\204.46\377\224\350" \
+ "\354\340\377\1GLN\377\203.46\377\1:@B\377\234\350\354\340\377\1""5:<" \
+ "\377\204.46\377\1\230\233\234\377\250\350\354\340\377\204.46\377\1SX" \
+ "Y\377\377\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204." \
+ "46\377\1\251\253\254\377\236\350\354\340\377\1kpq\377\204.46\377\1\346" \
+ "\347\347\377\204\350\354\340\377\1\233\236\237\377\204.46\377\1^bd\377" \
+ "\224\350\354\340\377\1INP\377\204.46\377\1W\\]\377\214\350\354\340\377" \
+ "\1chi\377\204.46\377\1HMO\377\225\350\354\340\377\1SXY\377\204.46\377" \
+ "\224\350\354\340\377\1GLN\377\203.46\377\1:@B\377\234\350\354\340\377" \
+ "\1\205\210\212\377\204.46\377\2""068\377\267\271\272\377\215\350\354" \
+ "\340\377\1\330\332\332\377\231\350\354\340\377\204.46\377\1SXY\377\377" \
+ "\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\251" \
+ "\253\254\377\236\350\354\340\377\1kpq\377\204.46\377\1\346\347\347\377" \
+ "\205\350\354\340\377\1@FG\377\204.46\377\1\274\276\276\377\223\350\354" \
+ "\340\377\1\274\276\276\377\205.46\377\2MRT\377\327\330\330\377\210\350" \
+ "\354\340\377\2\335\336\336\377UY[\377\205.46\377\1\272\274\275\377\225" \
+ "\350\354\340\377\1=BD\377\203.46\377\1""6<>\377\224\350\354\340\377\1" \
+ "GLN\377\203.46\377\1:@B\377\235\350\354\340\377\1AFH\377\204.46\377\2" \
+ "/57\377\217\222\223\377\212\350\354\340\377\4\274\276\276\377bgh\377" \
+ ".46\377\327\330\330\377\230\350\354\340\377\204.46\377\1SXY\377\377\350" \
+ "\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\251\253" \
+ "\254\377\236\350\354\340\377\1kpq\377\204.46\377\1\346\347\347\377\205" \
+ "\350\354\340\377\1\240\243\244\377\204.46\377\1MRT\377\224\350\354\340" \
+ "\377\1\220\224\225\377\205.46\377\3""068\377y}\177\377\302\304\305\377" \
+ "\204\350\354\340\377\3\306\307\310\377\200\204\205\377179\377\205.46" \
+ "\377\1\220\223\224\377\223\350\354\340\377\3\306\307\310\377\257\261" \
+ "\262\377hmn\377\204.46\377\1_de\377\224\350\354\340\377\1GLN\377\203" \
+ ".46\377\1""9>@\377\213\343\344\344\377\222\350\354\340\377\2\313\315" \
+ "\315\37739;\377\205.46\377\12@FG\377\212\215\216\377\302\303\304\377" \
+ "\341\342\342\377\350\354\340\377\347\350\350\377\320\322\322\377\253" \
+ "\256\257\377w{|\377=BD\377\203.46\377\1\212\215\216\377\230\350\354\340" \
+ "\377\204.46\377\1SXY\377\377\350\354\340\377\312\350\354\340\377\1\235" \
+ "\237\240\377\204.46\377\1\264\266\266\377\236\350\354\340\377\1kpq\377" \
+ "\204.46\377\1\346\347\347\377\206\350\354\340\377\1BHJ\377\204.46\377" \
+ "\1\251\253\254\377\224\350\354\340\377\1txz\377\210.46\377\2""7=\77\377" \
+ "8>\77\377\210.46\377\1txz\377\224\350\354\340\377\1SXY\377\206.46\377" \
+ "\1\251\253\254\377\224\350\354\340\377\1GLN\377\217.46\377\1\320\322" \
+ "\322\377\222\350\354\340\377\2\276\300\301\3775;=\377\221.46\377\1@F" \
+ "G\377\230\350\354\340\377\204.46\377\1SXY\377\377\350\354\340\377\312" \
+ "\350\354\340\377\1\235\237\240\377\204.46\377\1\265\267\270\377\236\350" \
+ "\354\340\377\1kpq\377\204.46\377\1\346\347\347\377\206\350\354\340\377" \
+ "\1\246\251\252\377\204.46\377\1AFH\377\225\350\354\340\377\2\232\235" \
+ "\236\377068\377\216.46\377\2""068\377\232\235\236\377\225\350\354\340" \
+ "\377\1X]^\377\205.46\377\1LQS\377\225\350\354\340\377\1GLN\377\217.4" \
+ "6\377\1\316\317\320\377\223\350\354\340\377\2\324\325\325\377NSU\377" \
+ "\220.46\377\2""068\377\321\322\323\377\227\350\354\340\377\204.46\377" \
+ "\1SXY\377\377\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204" \
+ ".46\377\1\265\267\270\377\236\350\354\340\377\1kpq\377\204.46\377\1\346" \
+ "\347\347\377\207\350\354\340\377\1GLN\377\204.46\377\1\226\231\232\377" \
+ "\225\350\354\340\377\2\317\320\320\377`ef\377\214.46\377\2bgh\377\317" \
+ "\321\321\377\226\350\354\340\377\1_de\377\204.46\377\2:@B\377\332\333" \
+ "\334\377\225\350\354\340\377\1GLN\377\217.46\377\1\316\317\320\377\225" \
+ "\350\354\340\377\2\236\241\242\377BGI\377\214.46\377\3""8>\77\377~\201" \
+ "\202\377\335\336\337\377\230\350\354\340\377\204.46\377\1SXY\377\377" \
+ "\350\354\340\377\312\350\354\340\377\1\235\237\240\377\204.46\377\1\265" \
+ "\267\270\377\236\350\354\340\377\1kpq\377\204.46\377\1\346\347\347\377" \
+ "\207\350\354\340\377\1\254\257\257\377\204.46\377\2""8>\77\377\352\354" \
+ "\350\377\226\350\354\340\377\3\311\312\313\377\200\204\205\377EJL\377" \
+ "\206.46\377\3EJL\377\203\207\210\377\313\314\315\377\230\350\354\340" \
+ "\377\1_de\377\202.46\377\3/57\377fjl\377\342\343\343\377\226\350\354" \
+ "\340\377\1SXY\377\217<BC\377\1\307\311\311\377\227\350\354\340\377\4" \
+ "\275\277\300\377~\201\202\377OTV\377068\377\204.46\377\4""39;\377QVX" \
+ "\377\201\204\206\377\270\272\272\377\233\350\354\340\377\204.46\377\1" \
+ "SXY\377\377\350\354\340\377\377\350\354\340\377\234\350\354\340\377\2" \
+ "\345\346\346\377\317\321\321\377\202\275\277\300\377\2\317\321\321\377" \
+ "\345\346\346\377\233\350\354\340\377\4\302\304\305\377\255\257\260\377" \
+ "\301\302\303\377\346\346\347\377\304\350\354\340\377\4\346\347\347\377" \
+ "\327\330\330\377\335\336\337\377\347\350\350\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354" \
+ "\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377" \
+ "\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350" \
+ "\354\340\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340" \
+ "\377\377\350\354\340\377\377\350\354\340\377\377\350\354\340\377\377" \
+ "\350\354\340\377\377\350\354\340\377\246\350\354\340\377")
+
+
diff --git a/poky/meta-poky/recipes-core/psplash/psplash_git.bbappend b/poky/meta-poky/recipes-core/psplash/psplash_git.bbappend
new file mode 100644
index 000000000..433ef6697
--- /dev/null
+++ b/poky/meta-poky/recipes-core/psplash/psplash_git.bbappend
@@ -0,0 +1,2 @@
+FILESEXTRAPATHS_prepend_poky := "${THISDIR}/files:"
+
diff --git a/poky/meta-poky/recipes-core/tiny-init/files/init b/poky/meta-poky/recipes-core/tiny-init/files/init
new file mode 100644
index 000000000..9140e9558
--- /dev/null
+++ b/poky/meta-poky/recipes-core/tiny-init/files/init
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Mount the Linux kernel virtual filesystems
+mount none -t proc /proc
+mount none -t sysfs /sys
+
+# Ensure devtmpfs is mounted, it must be done manually with initramfs
+mount none -t devtmpfs /dev
+
+# Setup PTY infrastructure
+mkdir /dev/pts
+mount none -t devpts /dev/pts
+
+ifup lo
+
+# Allow for distro or local customizations
+if [ -f /etc/rc.local ] ; then
+ . /etc/rc.local
+fi
+
+# Become session leader and try to find a real tty (e.g. ttyS0)
+while true; do
+ setsid cttyhack sh
+ echo "Console sh exited with $?, respawning..."
+ sleep 1
+done
diff --git a/poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample b/poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample
new file mode 100644
index 000000000..d9e198a20
--- /dev/null
+++ b/poky/meta-poky/recipes-core/tiny-init/files/rc.local.sample
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Start services and customize the boot process here.
+echo "Running /etc/rc.local..."
+
+# Use init scripts included with packages such as dropbear
+#/etc/init.d/dropbear start
+
+# Spawn a getty manually
+#setsid /sbin/getty 115200 ttyS2
+
+# Print a banner
+#echo "You are running a poky-tiny image brought to you by the Yocto Project."
+
+# Setup a debugging environment
+#mkdir /debugfs
+#mount none -t debugfs /debugfs
+
+# Load modules (note: linux-yocto-tiny does not have module support by default)
+#modprobe yourdriver
+
+# DO NOT run any long running tasks or loops as these will delay
+# the /init script and the console shell.
diff --git a/poky/meta-poky/recipes-core/tiny-init/tiny-init.bb b/poky/meta-poky/recipes-core/tiny-init/tiny-init.bb
new file mode 100644
index 000000000..4d4e34dc8
--- /dev/null
+++ b/poky/meta-poky/recipes-core/tiny-init/tiny-init.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Poky-tiny init"
+DESCRIPTION = "Basic init system for poky-tiny"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r2"
+
+RDEPENDS_${PN} = "busybox"
+
+SRC_URI = "file://init \
+ file://rc.local.sample \
+ "
+
+S = "${WORKDIR}"
+
+do_configure() {
+ :
+}
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0755 ${WORKDIR}/init ${D}
+ install -m 0755 ${WORKDIR}/rc.local.sample ${D}${sysconfdir}
+}
+
+FILES_${PN} = "/init ${sysconfdir}/rc.local.sample"
diff --git a/poky/meta-selftest/COPYING.MIT b/poky/meta-selftest/COPYING.MIT
new file mode 100644
index 000000000..89de35479
--- /dev/null
+++ b/poky/meta-selftest/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/poky/meta-selftest/README b/poky/meta-selftest/README
new file mode 100644
index 000000000..11a6fee2d
--- /dev/null
+++ b/poky/meta-selftest/README
@@ -0,0 +1,3 @@
+This layer is intended as test layer, used by scripts/oe-selftest
+and it's probably a mistake to include it in your builds (unless you
+want to run the script).
diff --git a/poky/meta-selftest/classes/test_events.bbclass b/poky/meta-selftest/classes/test_events.bbclass
new file mode 100644
index 000000000..35324eb40
--- /dev/null
+++ b/poky/meta-selftest/classes/test_events.bbclass
@@ -0,0 +1,16 @@
+python test1_eventhandler() {
+ bb.note("Test for bb.event.BuildStarted")
+}
+python test2_eventhandler() {
+ bb.note("Test for bb.event.BuildCompleted")
+}
+python test3_eventhandler() {
+ bb.note("Test for bb.event.InvalidEvent")
+}
+
+addhandler test1_eventhandler
+test1_eventhandler[eventmask] = "bb.event.BuildStarted"
+addhandler test2_eventhandler
+test2_eventhandler[eventmask] = "bb.event.BuildCompleted"
+addhandler test3_eventhandler
+test3_eventhandler[eventmask] = "bb.event.InvalidEvent"
diff --git a/poky/meta-selftest/conf/layer.conf b/poky/meta-selftest/conf/layer.conf
new file mode 100644
index 000000000..f574a505d
--- /dev/null
+++ b/poky/meta-selftest/conf/layer.conf
@@ -0,0 +1,12 @@
+# 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 += "selftest"
+BBFILE_PATTERN_selftest = "^${LAYERDIR}/"
+BBFILE_PRIORITY_selftest = "5"
+
+LAYERSERIES_COMPAT_selftest = "sumo"
diff --git a/poky/meta-selftest/conf/machine/qemux86copy.conf b/poky/meta-selftest/conf/machine/qemux86copy.conf
new file mode 100644
index 000000000..76c13fdcb
--- /dev/null
+++ b/poky/meta-selftest/conf/machine/qemux86copy.conf
@@ -0,0 +1,3 @@
+require conf/machine/qemux86.conf
+
+MACHINEOVERRIDES .= ":qemux86"
diff --git a/poky/meta-selftest/files/signing/key.passphrase b/poky/meta-selftest/files/signing/key.passphrase
new file mode 100644
index 000000000..5271a5268
--- /dev/null
+++ b/poky/meta-selftest/files/signing/key.passphrase
@@ -0,0 +1 @@
+test123
diff --git a/poky/meta-selftest/files/signing/key.pub b/poky/meta-selftest/files/signing/key.pub
new file mode 100644
index 000000000..e197bb381
--- /dev/null
+++ b/poky/meta-selftest/files/signing/key.pub
@@ -0,0 +1,30 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQENBFYeMycBCADISkEj+u+3SkGbmC4b09StA3Fk4J8bKZrTTpQqUhOH4QFIQpso
+q96Q907h/ABAgB+IV0SGIeN866E7BqToqoXZ74X6EoyXWdndaMaFZSj+oNqqg6Gi
+hVsuGNpvRyyXSCYW8w9H2lFx09UufFrUxoSeP2iVdJJaUAmb8e00PCwkYrS2BZEa
+tO2VgllbaqczldmlUGnkIZt8YUSQSI/xZBDYUvbcZYBaOnDH1SDQl26f+bgyeIyS
+TW5TZb96o4tMfiifgPoqAapAxQLahG0WtjF/n1yNV5wUNQYsEQf6/h6W2rHGsCP5
+6FVFnr/ZPVam9iHUxL4lvJSI8dEH37s9GmarABEBAAG0LXRlc3R1c2VyIChub2Nv
+bW1lbnQpIDx0ZXN0dXNlckB0ZXN0ZW1haWwuY29tPokBOAQTAQIAIgUCVh4zJwIb
+AwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQezExa11krVLM2wf/fW1C8DPx
+tZEyl6iPXFjNotslo+t2TL6jPefC22KmbokJCtCnxcopBjQRuhUSNDTkXkUdVagy
+TaaYILV8XGajTmcVGQTaKeh+j6TM6CBGApQB5KhHvZCyvNBrGcNyuiex0Sm/rIhS
+fZre6ptZM/026W2kLwwJESXzHJEqCoFmU6aSOUCVyiDgMfcNw6c4NmEoqZtLdnxU
+B7Nac98o933AIvaaQMGtKIOcyOM7P/dyv8eMc38z2ew5bEB8E9aSdg5koXb3zIt5
+IKea631k4INAsFFyLMQNSmmKV7RK0miF5b4hGyekrYZRtiic5+dq5aWnVka4hBfi
+x31euxwQE87gQLkBDQRWHjMnAQgAt7C9QCFPWzLGQuQ/YaQub+8s2lYNQnmfwDHm
+5PuON+Wj/f5GyQhHKsbdUAPZ7GsjFIQnva7xNYYF/IvpC+0saB5NLMkBzjfIsg92
+6MkadAKlOR2o9gKlF59mulsJmJqNFTXiRcVXvpUnU8WB9ECmm321XfYHhk+4EMay
+H3OUZ0k6dEmvrWBTKNTR7M0z6j/jW+8J3vP3L9k1H+OV0EZwAKXfbh1lN4H467jY
+3gA7FU1WDmA06HphoSaFUEGTuXGtrRP0eksCUj3BtVygXnyQb379dISDOWcs/9Ke
+v3KMrZWgDnA4pH1eQpjycBhwKOCHYyhSSVOwCS3DGkaaklmQZwARAQABiQEfBBgB
+AgAJBQJWHjMnAhsMAAoJEHsxMWtdZK1SoPsIAKadG/tvS5COCyF8FuriL89Ysfov
+kMRKeb9hsMDbKX2lm3UtoS5ErmpkEUO/SbazQYm6/vYc8noQquqhkIdCljIvpWDv
+17tXEFfTGA493dlTTEWFt5bvzbQN6OhBu3904lAE4JGtlOOa9OKDeguwXbneLOyl
+dnlj2f7rw05cB9t/RDu7T11dTI39BMTUUm1lpWxYJk41o59b9g+fpJZkiIAJwnN3
+MwM1u9/AWfTqjNRgMAO5dIYceceTwGogujG+xz93flt+NjQhILG0T9jd0DFBgIAX
+Zq4PzX5aFDKjGoFaOOZ6r+kppBLH/HN6okMGIcfqaPPdnJI1MXFQvFzUNpo=
+=2cSJ
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/poky/meta-selftest/files/signing/key.secret b/poky/meta-selftest/files/signing/key.secret
new file mode 100644
index 000000000..d30d7cd61
--- /dev/null
+++ b/poky/meta-selftest/files/signing/key.secret
@@ -0,0 +1,59 @@
+-----BEGIN PGP PRIVATE KEY BLOCK-----
+Version: GnuPG v1
+
+lQO+BFYeMycBCADISkEj+u+3SkGbmC4b09StA3Fk4J8bKZrTTpQqUhOH4QFIQpso
+q96Q907h/ABAgB+IV0SGIeN866E7BqToqoXZ74X6EoyXWdndaMaFZSj+oNqqg6Gi
+hVsuGNpvRyyXSCYW8w9H2lFx09UufFrUxoSeP2iVdJJaUAmb8e00PCwkYrS2BZEa
+tO2VgllbaqczldmlUGnkIZt8YUSQSI/xZBDYUvbcZYBaOnDH1SDQl26f+bgyeIyS
+TW5TZb96o4tMfiifgPoqAapAxQLahG0WtjF/n1yNV5wUNQYsEQf6/h6W2rHGsCP5
+6FVFnr/ZPVam9iHUxL4lvJSI8dEH37s9GmarABEBAAH+AwMCLgbvBp7KeMdgcmpy
+Eheo+Xi7oLtKh5qc2LsxJnvszt4Q+0+v+dO+nlsRBuZAAo6EryyzH/HcncEoTQeG
+FvB6Si0IA79a7sdWLz6GmI/gfQUYeR1A7amjbFTu/OGGZIxd9uUrsoNu3Hs5UbeI
+0KjrhDYQrEt3GktF0WfAWnOkO3sONbXTKRxATw0YqT96wfPHmTK22qHVKodi2O6O
+yNnQ2JotGTiSCYB9geQ0jrYMotJlFrMC0UqIAip2iP/zLwXpCMjEJud5hY4aEDtQ
+JkDtQjPb2ICO98AqY6H/I7v1UAzUXJq7tIHTtA2d/9FJ++4wXqWJl3v7pKOOW323
+xpYZgPCtG+Ebx1NAGhze8rncsP+AjtC3dbHWBr6xpVtfw+AJCuSMB9ZR2SXE5NJD
+SlTzjsDbbCiCcTvfb+PfIpsMuTadWt+B+sI+LUsK4AaKRItinUz8ozn6ym3gyKA3
+rasW+ZVo9p7LiTX2JjS1K8h+7Sim2WlqTMvk+IzSDdoVRf6SUQ5JXOyxs3p5V5Tb
+2EyOuWfN6Fw4Xt3Pso09mSXGg1w6wmqW4nAslsL7U9alTzfNp6wZs5BaXWHRwnyu
+LzHATIkHbKbHZYZTJXguZm2jDJiDAIcdX6gpkUYZJpY7c69aMRUe1Xb/3YK4BhbG
+qpY0ams3ZwOe0EUz9Y1WLOFz7GqiKC5MBJLwcI483e6frVMMWNnyAH2yYau+n9st
+zI/L0nsk8+wpt9ORNq+BT78SL6WznfUdl4OTaJUdzighjBEmlCX5s0hI/09HqpbA
+ZdwDrBXmqFlN4BknZ3FCgGecBcG1hrXu80wH+qzA9lFKwJeKyFVGYX2ZPFyMxKJs
+1q2emoEqLg0r/ePJvYXpgXIH9ENTphRGTY6z57m8ouMw+TvqI55SOyIqqPTSqgxU
+B7QtdGVzdHVzZXIgKG5vY29tbWVudCkgPHRlc3R1c2VyQHRlc3RlbWFpbC5jb20+
+iQE4BBMBAgAiBQJWHjMnAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRB7
+MTFrXWStUszbB/99bULwM/G1kTKXqI9cWM2i2yWj63ZMvqM958LbYqZuiQkK0KfF
+yikGNBG6FRI0NOReRR1VqDJNppggtXxcZqNOZxUZBNop6H6PpMzoIEYClAHkqEe9
+kLK80GsZw3K6J7HRKb+siFJ9mt7qm1kz/TbpbaQvDAkRJfMckSoKgWZTppI5QJXK
+IOAx9w3Dpzg2YSipm0t2fFQHs1pz3yj3fcAi9ppAwa0og5zI4zs/93K/x4xzfzPZ
+7DlsQHwT1pJ2DmShdvfMi3kgp5rrfWTgg0CwUXIsxA1KaYpXtErSaIXlviEbJ6St
+hlG2KJzn52rlpadWRriEF+LHfV67HBATzuBAnQO+BFYeMycBCAC3sL1AIU9bMsZC
+5D9hpC5v7yzaVg1CeZ/AMebk+4435aP9/kbJCEcqxt1QA9nsayMUhCe9rvE1hgX8
+i+kL7SxoHk0syQHON8iyD3boyRp0AqU5Haj2AqUXn2a6WwmYmo0VNeJFxVe+lSdT
+xYH0QKabfbVd9geGT7gQxrIfc5RnSTp0Sa+tYFMo1NHszTPqP+Nb7wne8/cv2TUf
+45XQRnAApd9uHWU3gfjruNjeADsVTVYOYDToemGhJoVQQZO5ca2tE/R6SwJSPcG1
+XKBefJBvfv10hIM5Zyz/0p6/coytlaAOcDikfV5CmPJwGHAo4IdjKFJJU7AJLcMa
+RpqSWZBnABEBAAH+AwMCLgbvBp7KeMdgJ20scZrWqLVyIfNqsfu0ATH/tYIBbry9
+8RsBTZ4PBs6/X44fjMGPet1XuEv1R7IOiWO75K8+grdrWPTI9sP502d8Zv0rL007
+K02rpairfWbjVe/wDCtYDvodOptRqVpj32OiZLpfdzxCNy5C5GYrcp84/zBC25C5
+OeDvOhTBJt6ZdkExQFl4/KvpkISs7HbXoawa8WRlAbc81BxMHV21FusNzH0jlieG
+tT4VW3kD2+FphfpmYMnY/e4IviFZ9QQrTA2ZYHd6M4MSTRzmOvC0I6akkKyITc1X
+xdlCBXLbHMJm69cUxkp8sPSl668KXtbfSDSGqT50LHYOImcDVGboUWcIB7FLl+lT
+lCeQv32O8J/wGYBIEPsBZsPdIEu8/rZPe97/BCyiurPf7s9JCpq6C2heUdTV5DS9
+PKbyTlp7HrYLTJvgyAPXPwKZ8Y5YHZTMljWIb04rc5p7yVOOWiu4RZH28dYF63BR
+yX+hKBjK1tyEqI3xf+/ukib/4VuvAOUCoH/BqyHelT40Qg1qt3P75fkH/ZRNq2gi
+O2axGdlH5xrTOmLh7qGgr+rCAq5wmh6S3RDGT0PE4q/biGOtB2CI+fYin6Z0VC4H
+9mVOMz0v9EW15Ra87JkAOA/PAxIlPOrq5SvHseBx7iTL3vWeQzvQfCqeTrJ48AQY
+a7A7fMjQOZKCO9UuRIWm87JwOFIKb3JtauOGRFEHFDnlze5FBObUAyKP/dHpLwmm
+O4k9smJSCid740UvNbpUpS4xAjen89dQTBtWXxipTpX/iXmsnSbrThUG1mYjEU+q
+k5EF54KGfYSe4OJtm4dw/b5XL56CZJ79qBcD2kkjBA8o+/fxJKtnfTvPxGi0NZ2g
+sg3EAxem8+SOvcRGr2RmFfWa28+Q1jNIXs+mL4kBHwQYAQIACQUCVh4zJwIbDAAK
+CRB7MTFrXWStUqD7CACmnRv7b0uQjgshfBbq4i/PWLH6L5DESnm/YbDA2yl9pZt1
+LaEuRK5qZBFDv0m2s0GJuv72HPJ6EKrqoZCHQpYyL6Vg79e7VxBX0xgOPd3ZU0xF
+hbeW7820DejoQbt/dOJQBOCRrZTjmvTig3oLsF253izspXZ5Y9n+68NOXAfbf0Q7
+u09dXUyN/QTE1FJtZaVsWCZONaOfW/YPn6SWZIiACcJzdzMDNbvfwFn06ozUYDAD
+uXSGHHnHk8BqILoxvsc/d35bfjY0ISCxtE/Y3dAxQYCAF2auD81+WhQyoxqBWjjm
+eq/pKaQSx/xzeqJDBiHH6mjz3ZySNTFxULxc1Daa
+=b+vR
+-----END PGP PRIVATE KEY BLOCK-----
diff --git a/poky/meta-selftest/files/static-group b/poky/meta-selftest/files/static-group
new file mode 100644
index 000000000..9213b8e9b
--- /dev/null
+++ b/poky/meta-selftest/files/static-group
@@ -0,0 +1,14 @@
+messagebus:x:500:
+systemd-bus-proxy:x:501:
+systemd-network:x:502:
+systemd-resolve:x:503:
+systemd-timesync:x:504:
+polkitd:x:505:
+lock:x:506:
+systemd-journal:x:507:
+netdev:x:508:
+avahi:x:509:
+avahi-autoipd:x:510:
+rpc:x:511:
+rpcuser:x:513:
+
diff --git a/poky/meta-selftest/files/static-passwd b/poky/meta-selftest/files/static-passwd
new file mode 100644
index 000000000..412f85d46
--- /dev/null
+++ b/poky/meta-selftest/files/static-passwd
@@ -0,0 +1,11 @@
+messagebus:x:500:500::/var/lib/dbus:/bin/false
+systemd-bus-proxy:x:501:501::/:/bin/nologin
+systemd-network:x:502:502::/:/bin/nologin
+systemd-resolve:x:503:503::/:/bin/nologin
+systemd-timesync:x:504:504::/:/bin/nologin
+polkitd:x:505:505::/:/bin/nologin
+avahi:x:509:509::/:/bin/nologin
+avahi-autoipd:x:510:510::/:/bin/nologin
+rpc:x:511:511::/:/bin/nologin
+distcc:x:512:nogroup::/:/bin/nologin
+rpcuser:x:513:513::/var/lib/nfs:/bin/nologin
diff --git a/poky/meta-selftest/lib/devtool/__init__.py b/poky/meta-selftest/lib/devtool/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-selftest/lib/devtool/__init__.py
diff --git a/poky/meta-selftest/lib/devtool/bbpath.py b/poky/meta-selftest/lib/devtool/bbpath.py
new file mode 100644
index 000000000..5e8ffb3af
--- /dev/null
+++ b/poky/meta-selftest/lib/devtool/bbpath.py
@@ -0,0 +1,44 @@
+import argparse
+
+already_loaded = False
+kept_context = None
+
+def plugin_name(filename):
+ return os.path.splitext(os.path.basename(filename))[0]
+
+def plugin_init(plugins):
+ global already_loaded
+ already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins)
+
+def print_name(args, config, basepath, workspace):
+ print (__file__)
+
+def print_bbdir(args, config, basepath, workspace):
+ print (__file__.replace('/lib/devtool/bbpath.py',''))
+
+def print_registered(args, config, basepath, workspace):
+ global kept_context
+ print(kept_context.loaded)
+
+def multiloaded(args, config, basepath, workspace):
+ global already_loaded
+ print("yes" if already_loaded else "no")
+
+def register_commands(subparsers, context):
+ global kept_context
+ kept_context = context
+ if 'loaded' in context.__dict__:
+ context.loaded += 1
+ else:
+ context.loaded = 1
+
+ def addparser(name, helptxt, func):
+ parser = subparsers.add_parser(name, help=helptxt,
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser.set_defaults(func=func)
+ return parser
+
+ addparser('pluginfile', 'Print the filename of this plugin', print_name)
+ addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir)
+ addparser('count', 'How many times have this plugin been registered.', print_registered)
+ addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded)
diff --git a/poky/meta-selftest/lib/devtool/test.py b/poky/meta-selftest/lib/devtool/test.py
new file mode 100644
index 000000000..31190f58e
--- /dev/null
+++ b/poky/meta-selftest/lib/devtool/test.py
@@ -0,0 +1,11 @@
+import argparse
+
+def selftest_reverse(args, config, basepath, workspace):
+ """Reverse the value passed to verify the plugin is executing."""
+ print(args.value[::-1])
+
+def register_commands(subparsers, context):
+ parser_build = subparsers.add_parser('selftest-reverse', help='Reverse value (for selftest)',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser_build.add_argument('value', help='Value to reverse')
+ parser_build.set_defaults(func=selftest_reverse)
diff --git a/poky/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py b/poky/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
new file mode 100644
index 000000000..81c50ed97
--- /dev/null
+++ b/poky/meta-selftest/lib/oeqa/runtime/cases/dnf_runtime.py
@@ -0,0 +1,47 @@
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.cases.dnf import DnfTest
+from oeqa.utils.httpserver import HTTPService
+
+class DnfSelftest(DnfTest):
+
+ @classmethod
+ def setUpClass(cls):
+ import tempfile
+ cls.temp_dir = tempfile.TemporaryDirectory(prefix="oeqa-remotefeeds-")
+ cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-rootfs-repo'),
+ cls.tc.target.server_ip)
+ cls.repo_server.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.repo_server.stop()
+ cls.temp_dir.cleanup()
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ def test_verify_package_feeds(self):
+ """
+ Summary: Check correct setting of PACKAGE_FEED_URIS var
+ Expected: 1. Feeds were correctly set for dnf
+ 2. Update recovers packages from host's repo
+ Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ """
+ # When we created an image, we had to supply fake ip and port
+ # for the feeds. Now we can patch the real ones into the config file.
+ temp_file = os.path.join(self.temp_dir.name, 'tmp.repo')
+ self.tc.target.copyFrom("/etc/yum.repos.d/oe-remote-repo.repo", temp_file)
+ fixed_config = open(temp_file, "r").read().replace("bogus_ip", self.tc.target.server_ip).replace("bogus_port", str(self.repo_server.port))
+ with open(temp_file, "w") as f:
+ f.write(fixed_config)
+ self.tc.target.copyTo(temp_file, "/etc/yum.repos.d/oe-remote-repo.repo")
+
+ import re
+ # Use '-y' for non-interactive mode: automatically import the feed signing key
+ output_makecache = self.dnf('-vy makecache')
+ self.assertTrue(re.match(r".*Failed to synchronize cache", output_makecache, re.DOTALL) is None, msg = "dnf makecache failed to synchronize repo: %s" %(output_makecache))
+ self.assertTrue(re.match(r".*Metadata cache created", output_makecache, re.DOTALL) is not None, msg = "dnf makecache failed: %s" %(output_makecache))
+
+ output_repoinfo = self.dnf('-v repoinfo')
+ matchobj = re.match(r".*Repo-pkgs\s*:\s*(?P<n_pkgs>[0-9]+)", output_repoinfo, re.DOTALL)
+ self.assertTrue(matchobj is not None, msg = "Could not find the amount of packages in dnf repoinfo output: %s" %(output_repoinfo))
+ self.assertTrue(int(matchobj.group('n_pkgs')) > 0, msg = "Amount of remote packages is not more than zero: %s\n" %(output_repoinfo))
diff --git a/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json b/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json
new file mode 100644
index 000000000..e5ae46ecd
--- /dev/null
+++ b/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.json
@@ -0,0 +1,6 @@
+{
+ "test_install_package": {
+ "pkg": "socat",
+ "rm": true
+ }
+}
diff --git a/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py b/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py
new file mode 100644
index 000000000..19de74062
--- /dev/null
+++ b/poky/meta-selftest/lib/oeqa/runtime/cases/selftest.py
@@ -0,0 +1,31 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class Selftest(OERuntimeTestCase):
+
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_install_package(self):
+ """
+ Summary: Check basic package installation functionality.
+ Expected: 1. Before the test socat must be installed using scp.
+ 2. After the test socat must be uninstalled using ssh.
+ This can't be checked in this test.
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+
+ (status, output) = self.target.run("socat -V")
+ self.assertEqual(status, 0, msg="socat is not installed")
+
+ @OETestDepends(['selftest.Selftest.test_install_package'])
+ def test_verify_uninstall(self):
+ """
+ Summary: Check basic package installation functionality.
+ Expected: 1. test_install_package must uninstall socat.
+ This test is just to verify that.
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+
+ (status, output) = self.target.run("socat -V")
+ self.assertNotEqual(status, 0, msg="socat is still installed")
diff --git a/poky/meta-selftest/lib/oeqa/selftest/cases/external-layer.py b/poky/meta-selftest/lib/oeqa/selftest/cases/external-layer.py
new file mode 100644
index 000000000..59b1afab7
--- /dev/null
+++ b/poky/meta-selftest/lib/oeqa/selftest/cases/external-layer.py
@@ -0,0 +1,16 @@
+#from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.case import OESelftestTestCase
+#from oeqa.utils.decorators import testcase
+
+
+class ImportedTests(OESelftestTestCase):
+
+ def test_unconditional_pass(self):
+ """
+ Summary: Doesn't check anything, used to check import test from other layers.
+ Expected: 1. Pass unconditionally
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com
+ """
+
+ self.assertEqual(True, True, msg = "Impossible to fail this test")
diff --git a/poky/meta-selftest/lib/recipetool/bbpath.py b/poky/meta-selftest/lib/recipetool/bbpath.py
new file mode 100644
index 000000000..783b2dc76
--- /dev/null
+++ b/poky/meta-selftest/lib/recipetool/bbpath.py
@@ -0,0 +1,41 @@
+import argparse
+
+already_loaded = False
+register_count = 0
+
+def plugin_name(filename):
+ return os.path.splitext(os.path.basename(filename))[0]
+
+def plugin_init(plugins):
+ global already_loaded
+ already_loaded = plugin_name(__file__) in (plugin_name(p.__name__) for p in plugins)
+
+def print_name(opts):
+ print (__file__)
+
+def print_bbdir(opts):
+ print (__file__.replace('/lib/recipetool/bbpath.py',''))
+
+def print_registered(opts):
+ #global kept_context
+ #print(kept_context.loaded)
+ print ("1")
+
+def multiloaded(opts):
+ global already_loaded
+ print("yes" if already_loaded else "no")
+
+def register_commands(subparsers):
+ global register_count
+ register_count += 1
+
+ def addparser(name, helptxt, func):
+ parser = subparsers.add_parser(name, help=helptxt,
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser.set_defaults(func=func)
+ return parser
+
+ addparser('pluginfile', 'Print the filename of this plugin', print_name)
+ addparser('bbdir', 'Print the BBPATH directory of this plugin', print_bbdir)
+ addparser('count', 'How many times have this plugin been registered.', print_registered)
+ addparser('multiloaded', 'How many times have this plugin been initialized', multiloaded)
diff --git a/poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb b/poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
new file mode 100644
index 000000000..073cf5665
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/aspell/aspell_0.0.0.1.bb
@@ -0,0 +1,32 @@
+# This recipe is a copy from the oe-core one.
+# It has a lower and invalid version number in order not to be accidentally used by bitbake.
+# It is used for tests that require overlayed recipe files.
+
+SUMMARY = "GNU Aspell spell-checker"
+SECTION = "console/utils"
+
+LICENSE = "LGPLv2 | LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz"
+SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7"
+SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1"
+
+EXCLUDE_FROM_WORLD = "1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses"
+
+PACKAGES += "libaspell libpspell libpspell-dev aspell-utils"
+
+FILES_${PN}-dbg += "${libdir}/aspell-0.60/.debu*"
+FILES_libaspell = "${libdir}/libaspell.so.* ${libdir}/aspell*"
+FILES_aspell-utils = "${bindir}/word-list-compress ${bindir}/aspell-import ${bindir}/run-with-aspell ${bindir}/pre*"
+FILES_${PN} = "${bindir}/aspell"
+FILES_libpspell = "${libdir}/libpspell.so.*"
+FILES_libpspell-dev = "${libdir}/libpspell* ${bindir}/pspell-config ${includedir}/pspell"
+
+ARM_INSTRUCTION_SET = "arm"
+inherit autotools gettext
diff --git a/poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend b/poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/aspell/aspell_0.60.6.1.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests.
+include test_recipe.inc
diff --git a/poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb b/poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb
new file mode 100644
index 000000000..f8dd2290b
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/container-image/container-image-testpkg.bb
@@ -0,0 +1,8 @@
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ touch ${D}${bindir}/theapp
+}
diff --git a/poky/meta-selftest/recipes-test/container-image/container-test-image.bb b/poky/meta-selftest/recipes-test/container-image/container-test-image.bb
new file mode 100644
index 000000000..d5f939c6e
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/container-image/container-test-image.bb
@@ -0,0 +1,8 @@
+IMAGE_INSTALL += "container-image-testpkg"
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "container"
+IMAGE_LINGUAS = ""
+
+inherit core-image
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1 b/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1
new file mode 100644
index 000000000..f4bdcfc83
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file1
@@ -0,0 +1 @@
+The first file
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2 b/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2
new file mode 100644
index 000000000..a7e2414bd
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-local/file2
@@ -0,0 +1 @@
+The second file
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb b/poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
new file mode 100644
index 000000000..b377cb760
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-local_6.03.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/syslinux-${PV}.tar.xz \
+ file://file1 \
+ file://file2"
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+S = "${WORKDIR}/syslinux-${PV}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
new file mode 100644
index 000000000..3f7123cda
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly.bb
@@ -0,0 +1,7 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://file1 \
+ file://file2"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1 b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
new file mode 100644
index 000000000..f4bdcfc83
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file1
@@ -0,0 +1 @@
+The first file
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2 b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
new file mode 100644
index 000000000..a7e2414bd
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-localonly/file2
@@ -0,0 +1 @@
+The second file
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb b/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
new file mode 100644
index 000000000..fc3799590
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb
@@ -0,0 +1,18 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libxres libxext virtual/libx11 ncurses"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-0.4.tar.gz \
+ file://readme.patch.gz \
+ "
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+S = "${WORKDIR}/xrestop-0.4"
+
+SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b"
+SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257"
+
+inherit autotools pkgconfig
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz b/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
new file mode 100644
index 000000000..4752492cc
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gz
Binary files differ
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
new file mode 100644
index 000000000..3f6956524
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir.bb
@@ -0,0 +1,9 @@
+LICENSE = "CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://devtool-test-subdir.tar.gz \
+ file://testfile;subdir=${BPN}"
+
+S = "${WORKDIR}/${BPN}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
new file mode 100644
index 000000000..3d44f803c
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gz
Binary files differ
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
new file mode 100644
index 000000000..12b519c0d
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile
@@ -0,0 +1 @@
+Modified version
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch
new file mode 100644
index 000000000..4ea3d74f0
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch
@@ -0,0 +1,25 @@
+From 1478846ebfac690684e9c48049d08e0065f97a36 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 24 Feb 2016 17:43:03 +1300
+Subject: [PATCH] Add a note line to the quick reference
+
+A test patch so we have a file to move around.
+---
+ doc/quickref.1.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/doc/quickref.1.in b/doc/quickref.1.in
+index 389008b..226615c 100644
+--- a/doc/quickref.1.in
++++ b/doc/quickref.1.in
+@@ -560,6 +560,7 @@ you want, at runtime, to change the parameters of.
+ .P
+ If you find any other problems, please report them.
+
++NOTE: this is an important note.
+
+ .SH REPORTING BUGS
+ Report bugs in
+--
+2.5.0
+
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
new file mode 100644
index 000000000..333ecac7e
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Pipe viewer test recipe for devtool upgrade test"
+LICENSE = "Artistic-2.0"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02"
+
+SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz \
+ file://0001-Add-a-note-line-to-the-quick-reference.patch"
+UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml"
+RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature"
+
+SRC_URI[md5sum] = "9365d86bd884222b4bf1039b5a9ed1bd"
+SRC_URI[sha256sum] = "681bcca9784bf3cb2207e68236d1f68e2aa7b80f999b5750dc77dcd756e81fbc"
+
+PR = "r5"
+
+S = "${WORKDIR}/pv-${PV}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit autotools
+
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
new file mode 100644
index 000000000..9d94f671d
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded
@@ -0,0 +1,18 @@
+SUMMARY = "Pipe viewer test recipe for devtool upgrade test"
+LICENSE = "Artistic-2.0"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02"
+
+SRC_URI = "http://www.ivarch.com/programs/sources/pv-${PV}.tar.gz \
+ file://0001-Add-a-note-line-to-the-quick-reference.patch"
+UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml"
+RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature"
+
+SRC_URI[md5sum] = "062bca5ff33df1dd09472e7fc3bbe332"
+SRC_URI[sha256sum] = "9dd45391806b0ed215abee4c5ac1597d018c386fe9c1f5afd2f6bc3b07fd82c3"
+
+S = "${WORKDIR}/pv-${PV}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit autotools
+
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
new file mode 100644
index 000000000..07b83276f
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A simple tool to wait for a specific signal over DBus"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "dbus"
+
+# Note: this is intentionally not the latest version in the original .bb
+SRCREV = "1a3e1343761b30750bed70e0fd688f6d3c7b3717"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/dbus-wait"
+UPSTREAM_CHECK_COMMITS = "1"
+RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature"
+
+S = "${WORKDIR}/git"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit autotools pkgconfig
diff --git a/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
new file mode 100644
index 000000000..32ec4b14f
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded
@@ -0,0 +1,21 @@
+SUMMARY = "A simple tool to wait for a specific signal over DBus"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "dbus"
+
+# Note: this is intentionally not the latest version in the original .bb
+SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/dbus-wait"
+UPSTREAM_CHECK_COMMITS = "1"
+RECIPE_NO_UPDATE_REASON = "This recipe is used to test devtool upgrade feature"
+
+S = "${WORKDIR}/git"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit autotools pkgconfig
diff --git a/poky/meta-selftest/recipes-test/emptytest/emptytest.bb b/poky/meta-selftest/recipes-test/emptytest/emptytest.bb
new file mode 100644
index 000000000..905c6694f
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/emptytest/emptytest.bb
@@ -0,0 +1,7 @@
+include test_recipe.inc
+
+# Set LICENSE to something so that bitbake -p that is ran at the beginning
+# is successful since test_recipe.inc has not yet been modified.
+LICENSE = ""
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta-selftest/recipes-test/error/error.bb b/poky/meta-selftest/recipes-test/error/error.bb
new file mode 100644
index 000000000..3c22e7cbe
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/error/error.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Error Test case that fails on do_compile"
+DESCRIPTION = "This generates a compile time error to be used to for testing."
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+EXCLUDE_FROM_WORLD = "1"
+
+do_compile() {
+ bbfatal "Failing as expected.";
+}
diff --git a/poky/meta-selftest/recipes-test/images/error-image.bb b/poky/meta-selftest/recipes-test/images/error-image.bb
new file mode 100644
index 000000000..13d9cc010
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/images/error-image.bb
@@ -0,0 +1,8 @@
+SUMMARY = "An image that includes the error recipe and will therefore fail"
+DESCRIPTION = "This generates an error. Not currently used by oe-selftest"
+
+IMAGE_INSTALL = "error"
+
+IMAGE_LINGUAS = " "
+
+inherit core-image
diff --git a/poky/meta-selftest/recipes-test/images/oe-selftest-image.bb b/poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
new file mode 100644
index 000000000..5d4d10eef
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/images/oe-selftest-image.bb
@@ -0,0 +1,9 @@
+SUMMARY = "An image used during oe-selftest tests"
+
+IMAGE_INSTALL = "packagegroup-core-boot dropbear"
+IMAGE_FEATURES = "debug-tweaks"
+
+IMAGE_LINGUAS = " "
+
+inherit core-image
+
diff --git a/poky/meta-selftest/recipes-test/images/test-empty-image.bb b/poky/meta-selftest/recipes-test/images/test-empty-image.bb
new file mode 100644
index 000000000..88d8d612e
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/images/test-empty-image.bb
@@ -0,0 +1,6 @@
+SUMMARY = "An empty image."
+IMAGE_INSTALL = ""
+IMAGE_LINGUAS = ""
+PACKAGE_INSTALL = ""
+
+inherit image
diff --git a/poky/meta-selftest/recipes-test/images/wic-image-minimal.bb b/poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
new file mode 100644
index 000000000..e1da203b5
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/images/wic-image-minimal.bb
@@ -0,0 +1,15 @@
+SUMMARY = "An example of partitioned image."
+
+SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks"
+
+IMAGE_INSTALL = "packagegroup-core-boot"
+
+IMAGE_FSTYPES = "wic"
+
+WKS_FILE_DEPENDS = "syslinux syslinux-native dosfstools-native mtools-native gptfdisk-native"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "2000"
+
+inherit image
diff --git a/poky/meta-selftest/recipes-test/images/wic-image-minimal.wks b/poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
new file mode 100644
index 000000000..ae69cb6e3
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/images/wic-image-minimal.wks
@@ -0,0 +1,10 @@
+# short-description: Example of partitioned image with complex layout
+# long-description: This image contains boot partition and 3 rootfs partitions
+# created from core-image-minimal and wic-image-minimal image recipes.
+
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part /media --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label uuid-test --align 1024 --use-uuid --fsuuid 2c71ef06-a81d-4735-9d3a-379b69c6bdba
+part /mnt --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
+
+bootloader --ptable gpt --timeout=0 --append="rootwait console=tty0"
diff --git a/poky/meta-selftest/recipes-test/m4/m4_%.bbappend b/poky/meta-selftest/recipes-test/m4/m4_%.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/m4/m4_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests.
+include test_recipe.inc
diff --git a/poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch b/poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch
new file mode 100644
index 000000000..b1d5eab2b
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/man-db/files/0001-Test-patch-here.patch
@@ -0,0 +1,22 @@
+From efc8831f33106e6b48de8e612c2d816fe7d1ae68 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 9 Feb 2018 17:37:48 +0200
+Subject: [PATCH] Test patch here!
+
+This is an invalid patch used by oe-selftest
+---
+ README | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/README b/README
+index 48fff57..26d1234 100644
+--- a/README
++++ b/README
+@@ -1,3 +1,4 @@
++This is a test patch for purposes of oe-selftest
+ THIS LINE MAKES THIS PATCH INVALID README for the man-db manual pager suite
+ ========================================
+
+--
+2.15.1
+
diff --git a/poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend b/poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/man-db/man-db_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests.
+include test_recipe.inc
diff --git a/poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb b/poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
new file mode 100644
index 000000000..913bfabf8
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Packages to exercise postinstall functions"
+LICENSE = "MIT"
+
+inherit allarch
+
+PACKAGES = "${PN}-rootfs ${PN}-delayed-a ${PN}-delayed-b ${PN}-rootfs-failing"
+
+ALLOW_EMPTY_${PN}-rootfs = "1"
+ALLOW_EMPTY_${PN}-delayed-a = "1"
+ALLOW_EMPTY_${PN}-delayed-b = "1"
+ALLOW_EMPTY_${PN}-rootfs-failing = "1"
+
+RDEPENDS_${PN}-delayed-a = "${PN}-rootfs"
+RDEPENDS_${PN}-delayed-b = "${PN}-delayed-a"
+
+TESTDIR = "${sysconfdir}/postinst-test"
+
+# At rootfs time touch $TESTDIR/rootfs. Errors if the file already exists, or
+# if the function runs on first boot.
+pkg_postinst_${PN}-rootfs () {
+ set -e
+
+ if [ -z "$D" ]; then
+ echo "${PN}-rootfs should have finished at rootfs time"
+ exit 1
+ fi
+
+ if [ -e $D${TESTDIR}/rootfs ]; then
+ echo "$D${TESTDIR}/rootfs exists, but should not"
+ exit 1
+ fi
+
+ mkdir -p $D${TESTDIR}
+ touch $D${TESTDIR}/rootfs
+}
+
+# Depends on rootfs, delays until first boot, verifies that the rootfs file was
+# written.
+pkg_postinst_ontarget_${PN}-delayed-a () {
+ set -e
+
+ if [ ! -e ${TESTDIR}/rootfs ]; then
+ echo "${PN}-delayed-a: ${TESTDIR}/rootfs not found"
+ exit 1
+ fi
+
+ touch ${TESTDIR}/delayed-a
+}
+
+# Depends on delayed-a, delays until first boot, verifies that the delayed-a file was
+# written. This verifies the ordering between delayed postinsts.
+pkg_postinst_ontarget_${PN}-delayed-b () {
+ set -e
+
+ if [ ! -e ${TESTDIR}/delayed-a ]; then
+ echo "${PN}-delayed-b: ${TESTDIR}/delayed-a not found"
+ exit 1
+ fi
+
+ touch ${TESTDIR}/delayed-b
+}
+
+# This scriptlet intentionally includes a bogus command in the middle to test
+# that we catch and report such errors properly.
+pkg_postinst_${PN}-rootfs-failing () {
+ mkdir -p $D${TESTDIR}
+ touch $D${TESTDIR}/rootfs-before-failure
+ run_a_really_broken_command
+ # Scriptlet execution should stop here; the following commands are NOT supposed to run.
+ # (oe-selftest checks for it).
+ touch $D${TESTDIR}/rootfs-after-failure
+}
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/add-file.patch b/poky/meta-selftest/recipes-test/recipetool/files/add-file.patch
new file mode 100644
index 000000000..bdc99c94f
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/add-file.patch
@@ -0,0 +1,8 @@
+diff --git a/file2 b/file2
+new file mode 100644
+index 0000000..049b42e
+--- /dev/null
++++ b/file2
+@@ -0,0 +1,2 @@
++Test file 2
++456
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/file1 b/poky/meta-selftest/recipes-test/recipetool/files/file1
new file mode 100644
index 000000000..7571aa7a8
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/file1
@@ -0,0 +1,2 @@
+First test file
+123
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/installscript.sh b/poky/meta-selftest/recipes-test/recipetool/files/installscript.sh
new file mode 100644
index 000000000..9de30d69c
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/installscript.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Third file" > $1/selftest-replaceme-scripted
+
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func
new file mode 100644
index 000000000..2802bb348
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-func
@@ -0,0 +1 @@
+A file installed by a function called by do_install
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile
new file mode 100644
index 000000000..996298bf1
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-globfile
@@ -0,0 +1 @@
+A file matched by a glob in do_install
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile
new file mode 100644
index 000000000..585ae3e9b
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-inst-todir-globfile
@@ -0,0 +1 @@
+A file matched by a glob in do_install to a directory
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig
new file mode 100644
index 000000000..593d6a0bb
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-orig
@@ -0,0 +1 @@
+Straight through with same nam
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile
new file mode 100644
index 000000000..1e20a2b03
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-src-globfile
@@ -0,0 +1 @@
+A file matched by a glob in SRC_URI
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir
new file mode 100644
index 000000000..85bd5eba4
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/selftest-replaceme-todir
@@ -0,0 +1 @@
+File in SRC_URI installed just to directory path
diff --git a/poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir b/poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir
new file mode 100644
index 000000000..d516b4951
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/files/subdir/fileinsubdir
@@ -0,0 +1 @@
+A file in a subdirectory
diff --git a/poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb b/poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
new file mode 100644
index 000000000..7375c4793
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Test recipe for recipetool appendfile"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://installscript.sh \
+ file://selftest-replaceme-orig \
+ file://selftest-replaceme-todir \
+ file://file1 \
+ file://add-file.patch \
+ file://subdir \
+ file://selftest-replaceme-src-glob* \
+ file://selftest-replaceme-inst-globfile \
+ file://selftest-replaceme-inst-todir-globfile \
+ file://selftest-replaceme-inst-func"
+
+EXCLUDE_FROM_WORLD = "1"
+
+install_extrafunc() {
+ install -m 0644 ${WORKDIR}/selftest-replaceme-inst-func ${D}${datadir}/selftest-replaceme-inst-func
+}
+
+do_install() {
+ install -d ${D}${datadir}/
+ install -m 0644 ${WORKDIR}/selftest-replaceme-orig ${D}${datadir}/selftest-replaceme-orig
+ install -m 0644 ${WORKDIR}/selftest-replaceme-todir ${D}${datadir}
+ install -m 0644 ${WORKDIR}/file1 ${D}${datadir}/selftest-replaceme-renamed
+ install -m 0644 ${WORKDIR}/subdir/fileinsubdir ${D}${datadir}/selftest-replaceme-subdir
+ install -m 0644 ${WORKDIR}/selftest-replaceme-src-globfile ${D}${datadir}/selftest-replaceme-src-globfile
+ cp ${WORKDIR}/selftest-replaceme-inst-glob* ${D}${datadir}/selftest-replaceme-inst-globfile
+ cp ${WORKDIR}/selftest-replaceme-inst-todir-glob* ${D}${datadir}
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${S}/file2 ${D}${sysconfdir}/selftest-replaceme-patched
+ sh ${WORKDIR}/installscript.sh ${D}${datadir}
+ install_extrafunc
+}
+
+pkg_postinst_${PN} () {
+ echo "Test file installed by postinst" > $D${datadir}/selftest-replaceme-postinst
+}
+
+FILES_${PN} += "${datadir}"
+
diff --git a/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb b/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb
new file mode 100644
index 000000000..8e0d1cdd8
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Line-oriented text editor -- selftest GPLv2 version"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \
+ file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e"
+
+PR = "r2"
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632"
+SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e"
+
+inherit autotools texinfo
+
+S = "${WORKDIR}/ed-${PV}"
+
+EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'"
+
+CONFIGUREOPTS_remove = "--disable-dependency-tracking"
+CONFIGUREOPTS_remove = "--disable-silent-rules"
+EXTRA_OECONF_remove = "--disable-static"
diff --git a/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb b/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
new file mode 100644
index 000000000..8a2b565ce
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Line-oriented text editor -- selftest variant"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \
+ file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \
+ file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.lz"
+RECIPE_NO_UPDATE_REASON = "This recipe is used in selftest and shouldn't be updated otherwise"
+
+SRC_URI[md5sum] = "7f4a54fa7f366479f03654b8af645fd0"
+SRC_URI[sha256sum] = "ffb97eb8f2a2b5a71a9b97e3872adce953aa1b8958e04c5b7bf11d556f32552a"
+
+S = "${WORKDIR}/ed-${PV}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit texinfo
+
+do_configure() {
+ ${S}/configure
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+}
diff --git a/poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend b/poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend
new file mode 100644
index 000000000..205720982
--- /dev/null
+++ b/poky/meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend
@@ -0,0 +1,2 @@
+# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests.
+include test_recipe.inc
diff --git a/poky/meta-selftest/wic/test_rawcopy_plugin.wks.in b/poky/meta-selftest/wic/test_rawcopy_plugin.wks.in
new file mode 100644
index 000000000..83be4be91
--- /dev/null
+++ b/poky/meta-selftest/wic/test_rawcopy_plugin.wks.in
@@ -0,0 +1,6 @@
+# short-description: This file is used in oe-selftest wic module to test rawcopy plugin
+
+part /boot --active --source bootimg-pcbios
+part / --source rawcopy --sourceparams="file=core-image-minimal-${MACHINE}.ext4" --use-uuid
+
+bootloader --timeout=0 --append="console=ttyS0,115200n8"
diff --git a/poky/meta-selftest/wic/wictestdisk.wks b/poky/meta-selftest/wic/wictestdisk.wks
new file mode 100644
index 000000000..d4de24d83
--- /dev/null
+++ b/poky/meta-selftest/wic/wictestdisk.wks
@@ -0,0 +1,7 @@
+# short-description: image for use in machine agnostic wic test cases
+
+# /boot is intentionally an empty partition
+part /boot --ondisk sda --label boot --active --align 1024 --size 16
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+# bootloader is intentionally left out
diff --git a/poky/meta-skeleton/COPYING.MIT b/poky/meta-skeleton/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/poky/meta-skeleton/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/poky/meta-skeleton/conf/layer.conf b/poky/meta-skeleton/conf/layer.conf
new file mode 100644
index 000000000..4e8692e3e
--- /dev/null
+++ b/poky/meta-skeleton/conf/layer.conf
@@ -0,0 +1,17 @@
+# 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 += "skeleton"
+BBFILE_PATTERN_skeleton = "^${LAYERDIR}/"
+BBFILE_PRIORITY_skeleton = "1"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_skeleton = "1"
+
+LAYERDEPENDS_skeleton = "core"
+
+LAYERSERIES_COMPAT_skeleton = "sumo"
diff --git a/poky/meta-skeleton/conf/multilib-example.conf b/poky/meta-skeleton/conf/multilib-example.conf
new file mode 100644
index 000000000..da6da7f1f
--- /dev/null
+++ b/poky/meta-skeleton/conf/multilib-example.conf
@@ -0,0 +1,13 @@
+#
+# Sample multilib configuration which the user can either add in local.conf
+# or specific in an configuration file like this, then require it.
+#
+# This configuration specifies an x86 64 bit machine as the main machine
+# type and then adds a multilib in the "lib32" directory where those
+# libraries are compiled with the "x86" tune.
+#
+
+MACHINE = "qemux86-64"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
diff --git a/poky/meta-skeleton/conf/multilib-example2.conf b/poky/meta-skeleton/conf/multilib-example2.conf
new file mode 100644
index 000000000..2596f61d9
--- /dev/null
+++ b/poky/meta-skeleton/conf/multilib-example2.conf
@@ -0,0 +1,13 @@
+#
+# Sample multilib configuration which the user can either add in local.conf
+# or specific in an configuration file like this, then require it.
+#
+# This configuration specifies an x86 64 bit machine as the main machine
+# type and then adds a multilib in the "libx32" directory where those
+# libraries are compiled with the "x86-64-x32" tune.
+#
+
+MACHINE = "qemux86-64"
+require conf/multilib.conf
+MULTILIBS = "multilib:libx32"
+DEFAULTTUNE_virtclass-multilib-libx32 = "x86-64-x32"
diff --git a/poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg b/poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg
new file mode 100644
index 000000000..f840ecd26
--- /dev/null
+++ b/poky/meta-skeleton/recipes-core/busybox/busybox/no_rfkill.cfg
@@ -0,0 +1 @@
+# CONFIG_RFKILL is not set
diff --git a/poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend b/poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend
new file mode 100644
index 000000000..64cdefc76
--- /dev/null
+++ b/poky/meta-skeleton/recipes-core/busybox/busybox_%.bbappend
@@ -0,0 +1,12 @@
+# Example use of configuration fragments for busybox, which uses the same
+# mechanism as the linux-yocto kernel recipe.
+#
+# The entries here will override any entries in the base busybox recipe
+#
+# More details can be found in the Kernel Dev Manual
+# http://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#changing-the-configuration
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+ file://no_rfkill.cfg \
+ "
diff --git a/poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING b/poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING
new file mode 100644
index 000000000..6d45519c8
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/hello-mod/files/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile b/poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile
new file mode 100644
index 000000000..4ded35fbc
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/hello-mod/files/Makefile
@@ -0,0 +1,14 @@
+obj-m := hello.o
+
+SRC := $(shell pwd)
+
+all:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
+
+modules_install:
+ $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
+
+clean:
+ rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
+ rm -f Module.markers Module.symvers modules.order
+ rm -rf .tmp_versions Modules.symvers
diff --git a/poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c b/poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
new file mode 100644
index 000000000..f3c0d372e
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/hello-mod/files/hello.c
@@ -0,0 +1,33 @@
+/******************************************************************************
+ *
+ * Copyright (C) 2011 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *****************************************************************************/
+
+#include <linux/module.h>
+
+int init_module(void)
+{
+ printk("Hello World!\n");
+ return 0;
+}
+
+void cleanup_module(void)
+{
+ printk("Goodbye Cruel World!\n");
+}
+
+MODULE_LICENSE("GPL");
diff --git a/poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb b/poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
new file mode 100644
index 000000000..3d3344650
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Example of how to build an external Linux kernel module"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+inherit module
+
+SRC_URI = "file://Makefile \
+ file://hello.c \
+ file://COPYING \
+ "
+
+S = "${WORKDIR}"
+
+# The inherit of module.bbclass will automatically name module packages with
+# "kernel-module-" prefix as required by the oe-core build environment.
+
+RPROVIDES_${PN} += "kernel-module-hello"
diff --git a/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
new file mode 100644
index 000000000..6194d4f8d
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb
@@ -0,0 +1,71 @@
+# linux-yocto-custom.bb:
+#
+# An example kernel recipe that uses the linux-yocto and oe-core
+# kernel classes to apply a subset of yocto kernel management to git
+# managed kernel repositories.
+#
+# To use linux-yocto-custom in your layer, copy this recipe (optionally
+# rename it as well) and modify it appropriately for your machine. i.e.:
+#
+# COMPATIBLE_MACHINE_yourmachine = "yourmachine"
+#
+# You must also provide a Linux kernel configuration. The most direct
+# method is to copy your .config to files/defconfig in your layer,
+# in the same directory as the copy (and rename) of this recipe and
+# add file://defconfig to your SRC_URI.
+#
+# To use the yocto kernel tooling to generate a BSP configuration
+# using modular configuration fragments, see the yocto-bsp and
+# yocto-kernel tools documentation.
+#
+# Warning:
+#
+# Building this example without providing a defconfig or BSP
+# configuration will result in build or boot errors. This is not a
+# bug.
+#
+#
+# Notes:
+#
+# patches: patches can be merged into to the source git tree itself,
+# added via the SRC_URI, or controlled via a BSP
+# configuration.
+#
+# defconfig: When a defconfig is provided, the linux-yocto configuration
+# uses the filename as a trigger to use a 'allnoconfig' baseline
+# before merging the defconfig into the build.
+#
+# If the defconfig file was created with make_savedefconfig,
+# not all options are specified, and should be restored with their
+# defaults, not set to 'n'. To properly expand a defconfig like
+# this, specify: KCONFIG_MODE="--alldefconfig" in the kernel
+# recipe.
+#
+# example configuration addition:
+# SRC_URI += "file://smp.cfg"
+# example patch addition (for kernel v4.x only):
+# SRC_URI += "file://0001-linux-version-tweak.patch"
+# example feature addition (for kernel v4.x only):
+# SRC_URI += "file://feature.scc"
+#
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+# Override SRC_URI in a copy of this recipe to point at a different source
+# tree if you do not want to build from Linus' tree.
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;nocheckout=1;name=machine"
+
+LINUX_VERSION ?= "4.2"
+LINUX_VERSION_EXTENSION_append = "-custom"
+
+# Modify SRCREV to a different commit hash in a copy of this recipe to
+# build a different release of the Linux kernel.
+# tag: v4.2 64291f7db5bd8150a74ad2036f1037e6a0428df2
+SRCREV_machine="64291f7db5bd8150a74ad2036f1037e6a0428df2"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+# Override COMPATIBLE_MACHINE to include your machine in a copy of this recipe
+# file. Leaving it empty here ensures an early explicit build failure.
+COMPATIBLE_MACHINE = "(^$)"
diff --git a/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch
new file mode 100644
index 000000000..1c88315cd
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch
@@ -0,0 +1,29 @@
+From fb2c401374d4efe89e8da795e21d96fac038639d Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Mon, 11 Jun 2012 15:31:42 -0400
+Subject: [PATCH] linux: version tweak
+
+Upstream-Status: Inappropriate [example code]
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c361593..099e8ff 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,7 +2,7 @@ VERSION = 4
+ PATCHLEVEL = 2
+ SUBLEVEL = 0
+ EXTRAVERSION =
+-NAME = Hurr durr I'ma sheep
++NAME = Hurr durr I'ma customized sheep
+
+ # *DOCUMENTATION*
+ # To see a list of typical targets execute "make help"
+--
+2.1.4
+
diff --git a/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc
new file mode 100644
index 000000000..aad5af49f
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/feature.scc
@@ -0,0 +1 @@
+patch 0001-linux-version-tweak.patch
diff --git a/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg
new file mode 100644
index 000000000..0c26a8626
--- /dev/null
+++ b/poky/meta-skeleton/recipes-kernel/linux/linux-yocto-custom/smp.cfg
@@ -0,0 +1 @@
+# CONFIG_SMP is not set
diff --git a/poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb b/poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb
new file mode 100644
index 000000000..f13186f93
--- /dev/null
+++ b/poky/meta-skeleton/recipes-multilib/images/core-image-multilib-example.bb
@@ -0,0 +1,13 @@
+#
+# An example of a multilib image
+#
+# This example includes a lib32 version of bash into an otherwise standard
+# sato image. It assumes a "lib32" multilib has been enabled in the user's
+# configuration (see the example conf files for examples of this.)
+#
+
+# First include a base image to base things off
+require recipes-sato/images/core-image-sato.bb
+
+# Now add the multilib packages we want to install
+IMAGE_INSTALL += "lib32-bash"
diff --git a/poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT b/poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT
new file mode 100644
index 000000000..ec3e17113
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/service/service/COPYRIGHT
@@ -0,0 +1,15 @@
+Sysvinit is Copyright (C) 1991-2004 Miquel van Smoorenburg
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/poky/meta-skeleton/recipes-skeleton/service/service/skeleton b/poky/meta-skeleton/recipes-skeleton/service/service/skeleton
new file mode 100644
index 000000000..a3edc9d08
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/service/service/skeleton
@@ -0,0 +1,193 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: skeleton
+# Required-Start: $local_fs
+# Should-Start:
+# Required-Stop: $local_fs
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Example initscript
+# Description: This file should be used to construct scripts to be
+# placed in /etc/init.d
+### END INIT INFO
+
+# The definition of actions: (From LSB 3.1.0)
+# start start the service
+# stop stop the service
+# restart stop and restart the service if the service is already running,
+# otherwise start the service
+# try-restart restart the service if the service is already running
+# reload cause the configuration of the service to be reloaded without
+# actually stopping and restarting the service
+# force-reload cause the configuration to be reloaded if the service supports
+# this, otherwise restart the service if it is running
+# status print the current status of the service
+
+# The start, stop, restart, force-reload, and status actions shall be supported
+# by all init scripts; the reload and the try-restart actions are optional
+
+# Common steps to convert this skeleton into a real init script
+# 1) cp skeleton <the_real_name>
+# 2) Set DESC and NAME
+# 3) Check whether the daemon app is /usr/sbin/$NAME, if not, set it.
+# 4) Set DAEMON_ARGS if there is any
+# 5) Remove the useless code
+
+# NOTE: The skeleton doesn't support the daemon which is a script unless the
+# pidof supports "-x" option, please see more comments for pidofproc ()
+# in /etc/init.d/functions
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+DESC="skeleton"
+NAME="skeleton-test"
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+
+. /etc/init.d/functions || exit 1
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+#
+# Function that starts the daemon/service
+#
+do_start() {
+ local status pid
+
+ status=0
+ pid=`pidofproc $NAME` || status=$?
+ case $status in
+ 0)
+ echo "$DESC already running ($pid)."
+ exit 1
+ ;;
+ *)
+ echo "Starting $DESC ..."
+ exec $DAEMON $DAEMON_ARGS >/dev/null 2>&1 || status=$?
+ echo "ERROR: Failed to start $DESC."
+ exit $status
+ ;;
+ esac
+
+ # Add code here, if necessary, that waits for the process to be ready
+ # to handle requests from services started subsequently which depend
+ # on this one. As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop() {
+ local pid status
+
+ status=0
+ pid=`pidofproc $NAME` || status=$?
+ case $status in
+ 0)
+ # Exit when fail to stop, the kill would complain when fail
+ kill -s 15 $pid >/dev/null && rm -f $PIDFILE && \
+ echo "Stopped $DESC ($pid)." || exit $?
+ ;;
+ *)
+ echo "$DESC is not running; none killed." >&2
+ ;;
+ esac
+
+ # Wait for children to finish too if this is a daemon that forks
+ # and if the daemon is only ever run from this initscript.
+ # If the above conditions are not satisfied then add some other code
+ # that waits for the process to drop all resources that could be
+ # needed by services started subsequently. A last resort is to
+ # sleep for some time.
+ return $status
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+ local pid status
+
+ status=0
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ pid=`pidofproc $NAME` || status=$?
+ case $status in
+ 0)
+ echo "Reloading $DESC ..."
+ kill -s 1 $pid || exit $?
+ ;;
+ *)
+ echo "$DESC is not running; none reloaded." >&2
+ ;;
+ esac
+ exit $status
+}
+
+
+#
+# Function that shows the daemon/service status
+#
+status_of_proc () {
+ local pid status
+
+ status=0
+ # pidof output null when no program is running, so no "2>/dev/null".
+ pid=`pidofproc $NAME` || status=$?
+ case $status in
+ 0)
+ echo "$DESC is running ($pid)."
+ exit 0
+ ;;
+ *)
+ echo "$DESC is not running." >&2
+ exit $status
+ ;;
+ esac
+}
+
+case "$1" in
+start)
+ do_start
+ ;;
+stop)
+ do_stop || exit $?
+ ;;
+status)
+ status_of_proc
+ ;;
+restart)
+ # Always start the service regardless the status of do_stop
+ do_stop
+ do_start
+ ;;
+try-restart|force-reload)
+ # force-reload is the same as reload or try-restart according
+ # to its definition, the reload is not implemented here, so
+ # force-reload is the alias of try-restart here, but it should
+ # be the alias of reload if reload is implemented.
+ #
+ # Only start the service when do_stop succeeds
+ do_stop && do_start
+ ;;
+#reload)
+ # If the "reload" action is implemented properly, then let the
+ # force-reload be the alias of reload, and remove it from
+ # try-restart|force-reload)
+ #
+ #do_reload
+ #;;
+*)
+ echo "Usage: $0 {start|stop|status|restart|try-restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
diff --git a/poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c b/poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
new file mode 100644
index 000000000..96c67ac11
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
@@ -0,0 +1,12 @@
+#include <unistd.h>
+
+/* This demo does nothing except for testing /etc/init.d/skeleton */
+
+int main(int argc, char *argv[])
+{
+ daemon(0, 0);
+ while (1) {
+ sleep(1);
+ }
+ return 0;
+}
diff --git a/poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb b/poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb
new file mode 100644
index 000000000..6416618dc
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/service/service_0.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "The canonical example of init scripts"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
+
+SRC_URI = "file://skeleton \
+ file://skeleton_test.c \
+ file://COPYRIGHT \
+ "
+
+do_compile () {
+ ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/init.d
+ cat ${WORKDIR}/skeleton | \
+ sed -e 's,/etc,${sysconfdir},g' \
+ -e 's,/usr/sbin,${sbindir},g' \
+ -e 's,/var,${localstatedir},g' \
+ -e 's,/usr/bin,${bindir},g' \
+ -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/skeleton
+ chmod a+x ${D}${sysconfdir}/init.d/skeleton
+
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
+}
+
+RDEPENDS_${PN} = "initscripts"
+
+CONFFILES_${PN} += "${sysconfdir}/init.d/skeleton"
diff --git a/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
new file mode 100644
index 000000000..7c5b9d050
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Example recipe for using inherit useradd"
+DESCRIPTION = "This recipe serves as an example for using features from useradd.bbclass"
+SECTION = "examples"
+PR = "r1"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://file1 \
+ file://file2 \
+ file://file3 \
+ file://file4"
+
+S = "${WORKDIR}"
+
+PACKAGES =+ "${PN}-user3"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit useradd
+
+# You must set USERADD_PACKAGES when you inherit useradd. This
+# lists which output packages will include the user/group
+# creation code.
+USERADD_PACKAGES = "${PN} ${PN}-user3"
+
+# You must also set USERADD_PARAM and/or GROUPADD_PARAM when
+# you inherit useradd.
+
+# USERADD_PARAM specifies command line options to pass to the
+# useradd command. Multiple users can be created by separating
+# the commands with a semicolon. Here we'll create two users,
+# user1 and user2:
+USERADD_PARAM_${PN} = "-u 1200 -d /home/user1 -r -s /bin/bash user1; -u 1201 -d /home/user2 -r -s /bin/bash user2"
+
+# user3 will be managed in the useradd-example-user3 pacakge:
+# As an example, we use the -P option to set clear text password for user3
+USERADD_PARAM_${PN}-user3 = "-u 1202 -d /home/user3 -r -s /bin/bash -P 'user3' user3"
+
+# GROUPADD_PARAM works the same way, which you set to the options
+# you'd normally pass to the groupadd command. This will create
+# groups group1 and group2:
+GROUPADD_PARAM_${PN} = "-g 880 group1; -g 890 group2"
+
+# Likewise, we'll manage group3 in the useradd-example-user3 package:
+GROUPADD_PARAM_${PN}-user3 = "-g 900 group3"
+
+do_install () {
+ install -d -m 755 ${D}${datadir}/user1
+ install -d -m 755 ${D}${datadir}/user2
+ install -d -m 755 ${D}${datadir}/user3
+
+ install -p -m 644 file1 ${D}${datadir}/user1/
+ install -p -m 644 file2 ${D}${datadir}/user1/
+
+ install -p -m 644 file2 ${D}${datadir}/user2/
+ install -p -m 644 file3 ${D}${datadir}/user2/
+
+ install -p -m 644 file3 ${D}${datadir}/user3/
+ install -p -m 644 file4 ${D}${datadir}/user3/
+
+ # The new users and groups are created before the do_install
+ # step, so you are now free to make use of them:
+ chown -R user1 ${D}${datadir}/user1
+ chown -R user2 ${D}${datadir}/user2
+ chown -R user3 ${D}${datadir}/user3
+
+ chgrp -R group1 ${D}${datadir}/user1
+ chgrp -R group2 ${D}${datadir}/user2
+ chgrp -R group3 ${D}${datadir}/user3
+}
+
+FILES_${PN} = "${datadir}/user1/* ${datadir}/user2/*"
+FILES_${PN}-user3 = "${datadir}/user3/*"
+
+# Prevents do_package failures with:
+# debugsources.list: No such file or directory:
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
diff --git a/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1 b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file1
diff --git a/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2 b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file2
diff --git a/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3 b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file3
diff --git a/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4 b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-skeleton/recipes-skeleton/useradd/useradd-example/file4
diff --git a/poky/meta-yocto-bsp/README.hardware b/poky/meta-yocto-bsp/README.hardware
new file mode 100644
index 000000000..d8d2a0cac
--- /dev/null
+++ b/poky/meta-yocto-bsp/README.hardware
@@ -0,0 +1,407 @@
+ Yocto Project Hardware Reference BSPs README
+ ============================================
+
+This file gives details about using the Yocto Project hardware reference BSPs.
+The machines supported can be seen in the conf/machine/ directory and are listed
+below. There is one per supported hardware architecture and these are primarily
+used to validate that the Yocto Project works on the hardware arctectures of
+those machines.
+
+If you are in doubt about using Poky/OpenEmbedded/Yocto Project with your hardware,
+consult the documentation for your board/device.
+
+Support for additional devices is normally added by adding BSP layers to your
+configuration. For more information please see the Yocto Board Support Package
+(BSP) Developer's Guide - documentation source is in documentation/bspguide or
+download the PDF from:
+
+ http://yoctoproject.org/documentation
+
+Note that these reference BSPs use the linux-yocto kernel and in general don't
+pull in binary module support for the platforms. This means some device functionality
+may be limited compared to a 'full' BSP which may be available.
+
+
+Hardware Reference Boards
+=========================
+
+The following boards are supported by the meta-yocto-bsp layer:
+
+ * Texas Instruments Beaglebone (beaglebone-yocto)
+ * Freescale MPC8315E-RDB (mpc8315e-rdb)
+ * Ubiquiti Networks EdgeRouter Lite (edgerouter)
+ * General IA platforms (genericx86 and genericx86-64)
+
+For more information see the board's section below. The appropriate MACHINE
+variable value corresponding to the board is given in brackets.
+
+Reference Board Maintenance
+===========================
+
+Send pull requests, patches, comments or questions about meta-yocto-bsps to poky@yoctoproject.org
+
+Maintainers: Kevin Hao <kexin.hao@windriver.com>
+ Bruce Ashfield <bruce.ashfield@windriver.com>
+
+Consumer Devices
+================
+
+The following consumer devices are supported by the meta-yocto-bsp layer:
+
+ * Intel x86 based PCs and devices (genericx86)
+ * Ubiquiti Networks EdgeRouter Lite (edgerouter)
+
+For more information see the device's section below. The appropriate MACHINE
+variable value corresponding to the device is given in brackets.
+
+
+
+ Specific Hardware Documentation
+ ===============================
+
+
+Intel x86 based PCs and devices (genericx86*)
+=============================================
+
+The genericx86 and genericx86-64 MACHINE are tested on the following platforms:
+
+Intel Xeon/Core i-Series:
+ + Intel NUC5 Series - ix-52xx Series SOC (Broadwell)
+ + Intel NUC6 Series - ix-62xx Series SOC (Skylake)
+ + Intel Shumway Xeon Server
+
+Intel Atom platforms:
+ + MinnowBoard MAX - E3825 SOC (Bay Trail)
+ + MinnowBoard MAX - Turbot (ADI Engineering) - E3826 SOC (Bay Trail)
+ - These boards can be either 32bot or 64bit modes depending on firmware
+ - See minnowboard.org for details
+ + Intel Braswell SOC
+
+and is likely to work on many unlisted Atom/Core/Xeon based devices. The MACHINE
+type supports ethernet, wifi, sound, and Intel/vesa graphics by default in
+addition to common PC input devices, busses, and so on.
+
+Depending on the device, it can boot from a traditional hard-disk, a USB device,
+or over the network. Writing generated images to physical media is
+straightforward with a caveat for USB devices. The following examples assume the
+target boot device is /dev/sdb, be sure to verify this and use the correct
+device as the following commands are run as root and are not reversable.
+
+USB Device:
+ 1. Build a live image. This image type consists of a simple filesystem
+ without a partition table, which is suitable for USB keys, and with the
+ default setup for the genericx86 machine, this image type is built
+ automatically for any image you build. For example:
+
+ $ bitbake core-image-minimal
+
+ 2. Use the "dd" utility to write the image to the raw block device. For
+ example:
+
+ # dd if=core-image-minimal-genericx86.hddimg of=/dev/sdb
+
+ If the device fails to boot with "Boot error" displayed, or apparently
+ stops just after the SYSLINUX version banner, it is likely the BIOS cannot
+ understand the physical layout of the disk (or rather it expects a
+ particular layout and cannot handle anything else). There are two possible
+ solutions to this problem:
+
+ 1. Change the BIOS USB Device setting to HDD mode. The label will vary by
+ device, but the idea is to force BIOS to read the Cylinder/Head/Sector
+ geometry from the device.
+
+ 2. Use a ".wic" image with an EFI partition
+
+ a) With a default grub-efi bootloader:
+ # dd if=core-image-minimal-genericx86-64.wic of=/dev/sdb
+
+ b) Use systemd-boot instead
+ - Build an image with EFI_PROVIDER="systemd-boot" then use the above
+ dd command to write the image to a USB stick.
+
+
+Texas Instruments Beaglebone (beaglebone-yocto)
+=========================================
+
+The Beaglebone is an ARM Cortex-A8 development board with USB, Ethernet, 2D/3D
+accelerated graphics, audio, serial, JTAG, and SD/MMC. The Black adds a faster
+CPU, more RAM, eMMC flash and a micro HDMI port. The beaglebone MACHINE is
+tested on the following platforms:
+
+ o Beaglebone Black A6
+ o Beaglebone A6 (the original "White" model)
+
+The Beaglebone Black has eMMC, while the White does not. Pressing the USER/BOOT
+button when powering on will temporarily change the boot order. But for the sake
+of simplicity, these instructions assume you have erased the eMMC on the Black,
+so its boot behavior matches that of the White and boots off of SD card. To do
+this, issue the following commands from the u-boot prompt:
+
+ # mmc dev 1
+ # mmc erase 0 512
+
+To further tailor these instructions for your board, please refer to the
+documentation at http://www.beagleboard.org/bone and http://www.beagleboard.org/black
+
+From a Linux system with access to the image files perform the following steps:
+
+ 1. Build an image. For example:
+
+ $ bitbake core-image-minimal
+
+ 2. Use the "dd" utility to write the image to the SD card. For example:
+
+ # dd core-image-minimal-beaglebone-yocto.wic of=/dev/sdb
+
+ 3. Insert the SD card into the Beaglebone and boot the board.
+
+Freescale MPC8315E-RDB (mpc8315e-rdb)
+=====================================
+
+The MPC8315 PowerPC reference platform (MPC8315E-RDB) is aimed at hardware and
+software development of network attached storage (NAS) and digital media server
+applications. The MPC8315E-RDB features the PowerQUICC II Pro processor, which
+includes a built-in security accelerator.
+
+(Note: you may find it easier to order MPC8315E-RDBA; this appears to be the
+same board in an enclosure with accessories. In any case it is fully
+compatible with the instructions given here.)
+
+Setup instructions
+------------------
+
+You will need the following:
+* NFS root setup on your workstation
+* TFTP server installed on your workstation
+* Straight-thru 9-conductor serial cable (DB9, M/F) connected from your
+ PC to UART1
+* Ethernet connected to the first ethernet port on the board
+
+--- Preparation ---
+
+Note: if you have altered your board's ethernet MAC address(es) from the
+defaults, or you need to do so because you want multiple boards on the same
+network, then you will need to change the values in the dts file (patch
+linux/arch/powerpc/boot/dts/mpc8315erdb.dts within the kernel source). If
+you have left them at the factory default then you shouldn't need to do
+anything here.
+
+Note: To boot from USB disk you need u-boot that supports 'ext2load usb'
+command. You need to setup TFTP server, load u-boot from there and
+flash it to NOR flash.
+
+Beware! Flashing bootloader is potentially dangerous operation that can
+brick your device if done incorrectly. Please, make sure you understand
+what below commands mean before executing them.
+
+Load the new u-boot.bin from TFTP server to memory address 200000
+=> tftp 200000 u-boot.bin
+
+Disable flash protection
+=> protect off all
+
+Erase the old u-boot from fe000000 to fe06ffff in NOR flash.
+The size is 0x70000 (458752 bytes)
+=> erase fe000000 fe06ffff
+
+Copy the new u-boot from address 200000 to fe000000
+the size is 0x70000. It has to be greater or equal to u-boot.bin size
+=> cp.b 200000 fe000000 70000
+
+Enable flash protection again
+=> protect on all
+
+Reset the board
+=> reset
+
+--- Booting from USB disk ---
+
+ 1. Flash partitioned image to the USB disk
+
+ # dd if=core-image-minimal-mpc8315e-rdb.wic of=/dev/sdb
+
+ 2. Plug USB disk into the MPC8315 board
+
+ 3. Connect the board's first serial port to your workstation and then start up
+ your favourite serial terminal so that you will be able to interact with
+ the serial console. If you don't have a favourite, picocom is suggested:
+
+ $ picocom /dev/ttyUSB0 -b 115200
+
+ 4. Power up or reset the board and press a key on the terminal when prompted
+ to get to the U-Boot command line
+
+ 5. Optional. Load the u-boot.bin from the USB disk:
+
+ => usb start
+ => ext2load usb 0:1 200000 u-boot.bin
+
+ and flash it to NOR flash as described above.
+
+ 6. Load the kernel and dtb from the first partition of the USB disk:
+
+ => usb start
+ => ext2load usb 0:1 1000000 uImage
+ => ext2load usb 0:1 2000000 dtb
+
+ 7. Set bootargs and boot up the device
+
+ => setenv bootargs root=/dev/sdb2 rw rootwait console=ttyS0,115200
+ => bootm 1000000 - 2000000
+
+
+--- Booting from NFS root ---
+
+Load the kernel and dtb (device tree blob), and boot the system as follows:
+
+ 1. Get the kernel (uImage-mpc8315e-rdb.bin) and dtb (uImage-mpc8315e-rdb.dtb)
+ files from the tmp/deploy directory, and make them available on your TFTP
+ server.
+
+ 2. Connect the board's first serial port to your workstation and then start up
+ your favourite serial terminal so that you will be able to interact with
+ the serial console. If you don't have a favourite, picocom is suggested:
+
+ $ picocom /dev/ttyUSB0 -b 115200
+
+ 3. Power up or reset the board and press a key on the terminal when prompted
+ to get to the U-Boot command line
+
+ 4. Set up the environment in U-Boot:
+
+ => setenv ipaddr <board ip>
+ => setenv serverip <tftp server ip>
+ => setenv bootargs root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:255.255.255.0:mpc8315e:eth0:off console=ttyS0,115200
+
+ 5. Download the kernel and dtb, and boot:
+
+ => tftp 1000000 uImage-mpc8315e-rdb.bin
+ => tftp 2000000 uImage-mpc8315e-rdb.dtb
+ => bootm 1000000 - 2000000
+
+--- Booting from JFFS2 root ---
+
+ 1. First boot the board with NFS root.
+
+ 2. Erase the MTD partition which will be used as root:
+
+ $ flash_eraseall /dev/mtd3
+
+ 3. Copy the JFFS2 image to the MTD partition:
+
+ $ flashcp core-image-minimal-mpc8315e-rdb.jffs2 /dev/mtd3
+
+ 4. Then reboot the board and set up the environment in U-Boot:
+
+ => setenv bootargs root=/dev/mtdblock3 rootfstype=jffs2 console=ttyS0,115200
+
+
+Ubiquiti Networks EdgeRouter Lite (edgerouter)
+==============================================
+
+The EdgeRouter Lite is part of the EdgeMax series. It is a MIPS64 router
+(based on the Cavium Octeon processor) with 512MB of RAM, which uses an
+internal USB pendrive for storage.
+
+Setup instructions
+------------------
+
+You will need the following:
+* RJ45 -> serial ("rollover") cable connected from your PC to the CONSOLE
+ port on the device
+* Ethernet connected to the first ethernet port on the board
+
+If using NFS as part of the setup process, you will also need:
+* NFS root setup on your workstation
+* TFTP server installed on your workstation (if fetching the kernel from
+ TFTP, see below).
+
+--- Preparation ---
+
+Build an image (e.g. core-image-minimal) using "edgerouter" as the MACHINE.
+In the following instruction it is based on core-image-minimal. Another target
+may be similiar with it.
+
+--- Booting from NFS root / kernel via TFTP ---
+
+Load the kernel, and boot the system as follows:
+
+ 1. Get the kernel (vmlinux) file from the tmp/deploy/images/edgerouter
+ directory, and make them available on your TFTP server.
+
+ 2. Connect the board's first serial port to your workstation and then start up
+ your favourite serial terminal so that you will be able to interact with
+ the serial console. If you don't have a favourite, picocom is suggested:
+
+ $ picocom /dev/ttyS0 -b 115200
+
+ 3. Power up or reset the board and press a key on the terminal when prompted
+ to get to the U-Boot command line
+
+ 4. Set up the environment in U-Boot:
+
+ => setenv ipaddr <board ip>
+ => setenv serverip <tftp server ip>
+
+ 5. Download the kernel and boot:
+
+ => tftp tftp $loadaddr vmlinux
+ => bootoctlinux $loadaddr coremask=0x3 root=/dev/nfs rw nfsroot=<nfsroot ip>:<rootfs path> ip=<board ip>:<server ip>:<gateway ip>:<netmask>:edgerouter:eth0:off mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)
+
+--- Booting from USB disk ---
+
+To boot from the USB disk, you either need to remove it from the edgerouter
+box and populate it from another computer, or use a previously booted NFS
+image and populate from the edgerouter itself.
+
+Type 1: Use partitioned image
+-----------------------------
+
+Steps:
+
+ 1. Remove the USB disk from the edgerouter and insert it into a computer
+ that has access to your build artifacts.
+
+ 2. Flash the image.
+
+ # dd if=core-image-minimal-edgerouter.wic of=/dev/sdb
+
+ 3. Insert USB disk into the edgerouter and boot it.
+
+Type 2: NFS
+-----------
+
+Note: If you place the kernel on the ext3 partition, you must re-create the
+ ext3 filesystem, since the factory u-boot can only handle 128 byte inodes and
+ cannot read the partition otherwise.
+
+ These boot instructions assume that you have recreated the ext3 filesystem with
+ 128 byte inodes, you have an updated uboot or you are running and image capable
+ of making the filesystem on the board itself.
+
+
+ 1. Boot from NFS root
+
+ 2. Mount the USB disk partition 2 and then extract the contents of
+ tmp/deploy/core-image-XXXX.tar.bz2 into it.
+
+ Before starting, copy core-image-minimal-xxx.tar.bz2 and vmlinux into
+ rootfs path on your workstation.
+
+ and then,
+
+ # mount /dev/sda2 /media/sda2
+ # tar -xvjpf core-image-minimal-XXX.tar.bz2 -C /media/sda2
+ # cp vmlinux /media/sda2/boot/vmlinux
+ # umount /media/sda2
+ # reboot
+
+ 3. Reboot the board and press a key on the terminal when prompted to get to the U-Boot
+ command line:
+
+ # reboot
+
+ 4. Load the kernel and boot:
+
+ => ext2load usb 0:2 $loadaddr boot/vmlinux
+ => bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rw rootwait mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)
diff --git a/poky/meta-yocto-bsp/conf/layer.conf b/poky/meta-yocto-bsp/conf/layer.conf
new file mode 100644
index 000000000..6472238e6
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/layer.conf
@@ -0,0 +1,12 @@
+# 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 += "yoctobsp"
+BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
+BBFILE_PRIORITY_yoctobsp = "5"
+LAYERVERSION_yoctobsp = "4"
+LAYERSERIES_COMPAT_yoctobsp = "sumo"
diff --git a/poky/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf b/poky/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf
new file mode 100644
index 000000000..ae682a47d
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/beaglebone-yocto.conf
@@ -0,0 +1,40 @@
+#@TYPE: Machine
+#@NAME: Beaglebone-yocto machine
+#@DESCRIPTION: Reference machine configuration for http://beagleboard.org/bone and http://beagleboard.org/black boards
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-video-modesetting \
+ "
+
+MACHINE_EXTRA_RRECOMMENDS = "kernel-modules kernel-devicetree"
+
+EXTRA_IMAGEDEPENDS += "u-boot"
+
+DEFAULTTUNE ?= "cortexa8hf-neon"
+include conf/machine/include/tune-cortexa8.inc
+
+IMAGE_FSTYPES += "tar.bz2 jffs2 wic wic.bmap"
+EXTRA_IMAGECMD_jffs2 = "-lnp "
+WKS_FILE ?= "beaglebone-yocto.wks"
+IMAGE_INSTALL_append = " kernel-devicetree kernel-image-zimage"
+do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
+
+SERIAL_CONSOLE = "115200 ttyO0"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ?= "4.15%"
+
+KERNEL_IMAGETYPE = "zImage"
+KERNEL_DEVICETREE = "am335x-bone.dtb am335x-boneblack.dtb am335x-bonegreen.dtb"
+KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+
+SPL_BINARY = "MLO"
+UBOOT_SUFFIX = "img"
+UBOOT_MACHINE = "am335x_boneblack_config"
+UBOOT_ENTRYPOINT = "0x80008000"
+UBOOT_LOADADDRESS = "0x80008000"
+
+MACHINE_FEATURES = "usbgadget usbhost vfat alsa"
+
+IMAGE_BOOT_FILES ?= "u-boot.${UBOOT_SUFFIX} MLO"
diff --git a/poky/meta-yocto-bsp/conf/machine/edgerouter.conf b/poky/meta-yocto-bsp/conf/machine/edgerouter.conf
new file mode 100644
index 000000000..61f2145fd
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/edgerouter.conf
@@ -0,0 +1,26 @@
+#@TYPE: Machine
+#@NAME: Edgerouter
+#@DESCRIPTION: Edgerouter
+
+require conf/machine/include/tune-mips64.inc
+
+MACHINE_FEATURES = "pci ext2 ext3 serial"
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ?= "4.15%"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+USE_VT ?= "0"
+
+MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2 wic wic.bmap"
+JFFS2_ERASEBLOCK = "0x10000"
+
+WKS_FILE ?= "edgerouter.wks"
+IMAGE_BOOT_FILES ?= "vmlinux;vmlinux.64"
+do_image_wic[depends] += "mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/poky/meta-yocto-bsp/conf/machine/genericx86-64.conf b/poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
new file mode 100644
index 000000000..12f7c0d20
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/genericx86-64.conf
@@ -0,0 +1,10 @@
+#@TYPE: Machine
+#@NAME: Generic X86_64.
+
+#@DESCRIPTION: Machine configuration for generic X86_64 (64-bit) PCs and servers. Supports a moderately wide range of drivers that should boot and be usable on "typical" hardware.
+
+DEFAULTTUNE ?= "core2-64"
+require conf/machine/include/tune-core2.inc
+require conf/machine/include/genericx86-common.inc
+
+SERIAL_CONSOLES_CHECK = "ttyS0"
diff --git a/poky/meta-yocto-bsp/conf/machine/genericx86.conf b/poky/meta-yocto-bsp/conf/machine/genericx86.conf
new file mode 100644
index 000000000..798b62ec2
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/genericx86.conf
@@ -0,0 +1,10 @@
+#@TYPE: Machine
+#@NAME: Generic X86.
+
+#@DESCRIPTION: Machine configuration for generic X86 (32-bit) PCs. Supports a moderately wide range of drivers that should boot and be usable on "typical" hardware.
+
+DEFAULTTUNE ?= "core2-32"
+require conf/machine/include/tune-core2.inc
+require conf/machine/include/genericx86-common.inc
+
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "gma500-gfx-check"
diff --git a/poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc b/poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
new file mode 100644
index 000000000..e35685cb2
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/include/genericx86-common.inc
@@ -0,0 +1,25 @@
+include conf/machine/include/x86-base.inc
+require conf/machine/include/qemuboot-x86.inc
+MACHINE_FEATURES += "wifi efi pcbios"
+
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "${XSERVER_X86_BASE} \
+ ${XSERVER_X86_EXT} \
+ ${XSERVER_X86_I915} \
+ ${XSERVER_X86_I965} \
+ ${XSERVER_X86_FBDEV} \
+ ${XSERVER_X86_VESA} \
+ ${XSERVER_X86_MODESETTING} \
+ "
+
+MACHINE_EXTRA_RRECOMMENDS += "linux-firmware eee-acpi-scripts"
+
+GLIBC_ADDONS = "nptl"
+
+EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
+
+IMAGE_FSTYPES += "wic wic.bmap"
+WKS_FILE ?= "genericx86.wks"
+do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot"
+do_image_wic[recrdeptask] += "do_bootimg"
diff --git a/poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf b/poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
new file mode 100644
index 000000000..34f12303a
--- /dev/null
+++ b/poky/meta-yocto-bsp/conf/machine/mpc8315e-rdb.conf
@@ -0,0 +1,35 @@
+#@TYPE: Machine
+#@DESCRIPTION: Machine configuration for running
+
+TARGET_FPU = ""
+
+require conf/machine/include/tune-ppce300c3.inc
+
+KERNEL_IMAGETYPE = "uImage"
+
+EXTRA_IMAGEDEPENDS += "u-boot"
+UBOOT_MACHINE = "MPC8315ERDB_config"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+
+MACHINE_FEATURES = "keyboard pci ext2 ext3 serial"
+
+PREFERRED_VERSION_linux-yocto ?= "4.15%"
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+XSERVER ?= "xserver-xorg \
+ xf86-video-fbdev"
+
+UBOOT_ENTRYPOINT = "0x00000000"
+
+KERNEL_DEVICETREE = "mpc8315erdb.dtb"
+
+MACHINE_EXTRA_RRECOMMENDS = "kernel-modules"
+
+IMAGE_FSTYPES ?= "jffs2 tar.bz2"
+JFFS2_ERASEBLOCK = "0x4000"
+
+IMAGE_FSTYPES += "wic wic.bmap"
+WKS_FILE ?= 'mpc8315e-rdb.wks'
+IMAGE_BOOT_FILES ?= "u-boot.bin uImage uImage-mpc8315erdb.dtb;dtb"
diff --git a/poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py b/poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-yocto-bsp/lib/oeqa/controllers/__init__.py
diff --git a/poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py b/poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
new file mode 100644
index 000000000..0f1aeb398
--- /dev/null
+++ b/poky/meta-yocto-bsp/lib/oeqa/controllers/beaglebonetarget.py
@@ -0,0 +1,98 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module adds support to testimage.bbclass to deploy images and run
+# tests on a BeagleBone (original "white" or Black models). The device must
+# be set up as per README.hardware and the master image should be deployed
+# onto the card so that it boots into it by default. For booting into the
+# image under test we interact with u-boot over serial, so for the
+# BeagleBone Black you will need an additional TTL serial cable since a
+# serial interface isn't automatically provided over the USB connection as
+# it is on the original BeagleBone ("white") version. The separate ext3
+# partition that will contain the image to be tested must be labelled
+# "testrootfs" so that the deployment code below can find it.
+#
+# NOTE: for the BeagleBone "white" (original version) you may need to use
+# a script which handles the serial device disappearing on power down, such
+# as scripts/contrib/serdevtry in OE-Core.
+
+import os
+import bb
+import time
+import subprocess
+import sys
+import pexpect
+
+import oeqa.utils.sshcontrol as sshcontrol
+from oeqa.controllers.masterimage import MasterImageHardwareTarget
+
+
+class BeagleBoneTarget(MasterImageHardwareTarget):
+
+ dtbs = {'uImage-am335x-bone.dtb': 'am335x-bone.dtb', 'uImage-am335x-boneblack.dtb': 'am335x-boneblack.dtb'}
+
+ @classmethod
+ def get_extra_files(self):
+ return list(self.dtbs.keys())
+
+ def __init__(self, d):
+ super(BeagleBoneTarget, self).__init__(d)
+
+ self.image_fstype = self.get_image_fstype(d)
+ self.deploy_cmds = [
+ 'mkdir -p /mnt/testrootfs',
+ 'mount -L testrootfs /mnt/testrootfs',
+ 'rm -rf /mnt/testrootfs/*',
+ 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
+ '[ -e /mnt/testrootfs/boot/uImage ] || [ -L /mnt/testrootfs/boot/uImage ] || cp ~/test-kernel /mnt/testrootfs/boot/uImage',
+ ]
+
+ for _, dtbfn in self.dtbs.iteritems():
+ # Kernel and dtb files may not be in the image, so copy them if not
+ self.deploy_cmds.append('[ -e /mnt/testrootfs/boot/{0} ] || cp ~/{0} /mnt/testrootfs/boot/'.format(dtbfn))
+
+ if not self.serialcontrol_cmd:
+ bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
+
+
+ def _deploy(self):
+ self.master.run("umount /boot; umount /mnt/testrootfs;")
+ self.master.ignore_status = False
+ # Kernel and dtb files may not be in the image, so copy them just in case
+ self.master.copy_to(self.kernel, "~/test-kernel")
+ kernelpath = os.path.dirname(self.kernel)
+ for dtborig, dtbfn in self.dtbs.iteritems():
+ dtbfile = os.path.join(kernelpath, dtborig)
+ if os.path.exists(dtbfile):
+ self.master.copy_to(dtbfile, "~/%s" % dtbfn)
+ self.master.copy_to(self.rootfs, "~/test-rootfs.%s" % self.image_fstype)
+ for cmd in self.deploy_cmds:
+ self.master.run(cmd)
+
+ def _start(self, params=None):
+ self.power_cycle(self.master)
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ # We'd wait for "U-Boot" here but sometimes we connect too late on BeagleBone white to see it
+ serialconn.expect("NAND:")
+ serialconn.expect("MMC:")
+ serialconn.sendline("a")
+ serialconn.expect("U-Boot#")
+ serialconn.sendline("setenv bootpart 0:3")
+ serialconn.expect("U-Boot#")
+ serialconn.sendline("setenv mmcroot /dev/mmcblk0p3 ro")
+ serialconn.expect("U-Boot#")
+ serialconn.sendline("boot")
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
+
+ def _wait_until_booted(self):
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
diff --git a/poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py b/poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
new file mode 100644
index 000000000..9c47b5b04
--- /dev/null
+++ b/poky/meta-yocto-bsp/lib/oeqa/controllers/edgeroutertarget.py
@@ -0,0 +1,90 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module adds support to testimage.bbclass to deploy images and run
+# tests on a Ubiquiti Networks EdgeRouter Lite. The device must be set up
+# to boot into the master image already - the easiest way to do that is as
+# follows:
+#
+# 1. Take out the internal USB drive and plug it into your PC
+# 2. Repartition the USB drive so that you have three partitions in this
+# order:
+# 1: vfat, labelled "boot" (it will need to be formatted with mkfs.vfat
+# for this to be possible, since FAT partitions formatted under
+# DOS/Windows will only support uppercase labels)
+# 2: ext3 (for master image) labelled "testmaster"
+# 3: ext3 (for image under test) labelled "testrootfs"
+# 3. Copy the kernel to be used by the master image to the FAT partition
+# (it should be named "vmlinux.64" with the factory u-boot configuration)
+# 4. Install the master image onto the "testmaster" ext3 partition. If
+# you do this by just extracting the contents of an image onto the
+# partition, you will also likely need to create the master image marker
+# file /etc/masterimage within this partition so that we can tell when
+# we're booted into it that it is the master image.
+# 5. Put the USB drive back into the device, and ensure the console port
+# and first ethernet port are connected before powering on
+#
+# TEST_SERIALCONTROL_CMD will need to be set in local.conf so that we can
+# interact with u-boot over the serial console port.
+
+import os
+import bb
+import time
+import subprocess
+import sys
+import pexpect
+
+import oeqa.utils.sshcontrol as sshcontrol
+from oeqa.controllers.masterimage import MasterImageHardwareTarget
+
+
+class EdgeRouterTarget(MasterImageHardwareTarget):
+
+ def __init__(self, d):
+ super(EdgeRouterTarget, self).__init__(d)
+
+ self.image_fstype = self.get_image_fstype(d)
+ self.deploy_cmds = [
+ 'mount -L boot /boot',
+ 'mkdir -p /mnt/testrootfs',
+ 'mount -L testrootfs /mnt/testrootfs',
+ 'cp ~/test-kernel /boot',
+ 'rm -rf /mnt/testrootfs/*',
+ 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype
+ ]
+ if not self.serialcontrol_cmd:
+ bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
+
+
+ def _deploy(self):
+ self.master.run("umount /mnt/testrootfs;")
+ self.master.ignore_status = False
+ self.master.copy_to(self.kernel, "~/test-kernel")
+ self.master.copy_to(self.rootfs, "~/test-rootfs.%s" % self.image_fstype)
+ for cmd in self.deploy_cmds:
+ self.master.run(cmd)
+
+ def _start(self, params=None):
+ self.power_cycle(self.master)
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ serialconn.expect("U-Boot")
+ serialconn.sendline("a")
+ serialconn.expect("Octeon ubnt_e100#")
+ serialconn.sendline("fatload usb 0:1 $loadaddr test-kernel")
+ serialconn.expect(" bytes read")
+ serialconn.expect("Octeon ubnt_e100#")
+ serialconn.sendline("bootoctlinux $loadaddr coremask=0x3 root=/dev/sda3 rw rootwait mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)")
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
+
+ def _wait_until_booted(self):
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
diff --git a/poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py b/poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
new file mode 100644
index 000000000..7bc807d2b
--- /dev/null
+++ b/poky/meta-yocto-bsp/lib/oeqa/controllers/grubtarget.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module adds support to testimage.bbclass to deploy images and run
+# tests on a Generic PC that boots using grub bootloader. The device must
+# be set up as per README.hardware and the master image should be deployed
+# onto the harddisk so that it boots into it by default.For booting into the
+# image under test we interact with grub over serial, so for the
+# Generic PC you will need an additional serial cable and device under test
+# needs to have a serial interface. The separate ext3
+# partition that will contain the image to be tested must be labelled
+# "testrootfs" so that the deployment code below can find it.
+
+import os
+import bb
+import time
+import subprocess
+import sys
+import pexpect
+
+import oeqa.utils.sshcontrol as sshcontrol
+from oeqa.controllers.masterimage import MasterImageHardwareTarget
+
+class GrubTarget(MasterImageHardwareTarget):
+
+ def __init__(self, d):
+ super(GrubTarget, self).__init__(d)
+ self.deploy_cmds = [
+ 'mount -L boot /boot',
+ 'mkdir -p /mnt/testrootfs',
+ 'mount -L testrootfs /mnt/testrootfs',
+ 'cp ~/test-kernel /boot',
+ 'rm -rf /mnt/testrootfs/*',
+ 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
+ ]
+
+ if not self.serialcontrol_cmd:
+ bb.fatal("This TEST_TARGET needs a TEST_SERIALCONTROL_CMD defined in local.conf.")
+
+
+ def _deploy(self):
+ # make sure these aren't mounted
+ self.master.run("umount /boot; umount /mnt/testrootfs;")
+ self.master.ignore_status = False
+ # Kernel files may not be in the image, so copy them just in case
+ self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
+ self.master.copy_to(self.kernel, "~/test-kernel")
+ for cmd in self.deploy_cmds:
+ self.master.run(cmd)
+
+ def _start(self, params=None):
+ self.power_cycle(self.master)
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ serialconn.expect("GNU GRUB version 2.00")
+ serialconn.expect("Linux")
+ serialconn.sendline("x")
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
+
+ def _wait_until_booted(self):
+ try:
+ serialconn = pexpect.spawn(self.serialcontrol_cmd, env=self.origenv, logfile=sys.stdout)
+ serialconn.expect("login:", timeout=120)
+ serialconn.close()
+ except pexpect.ExceptionPexpect as e:
+ bb.fatal('Serial interaction failed: %s' % str(e))
+
diff --git a/poky/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py b/poky/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
new file mode 100644
index 000000000..dd5eeec16
--- /dev/null
+++ b/poky/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
@@ -0,0 +1,98 @@
+import os
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+
+class Systemdboot(OESelftestTestCase):
+ def _common_setup(self):
+ """
+ Common setup for test cases: 1445, 1528
+ """
+
+ # Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in conf/local.conf
+ features = 'EFI_PROVIDER = "systemd-boot"\n'
+ features += 'MACHINE = "genericx86-64"'
+ self.append_config(features)
+
+ def _common_build(self):
+ """
+ Common build for test cases: 1445 , 1528
+ """
+
+ # Build a genericx86-64/efi systemdboot image
+ bitbake('mtools-native core-image-minimal')
+
+
+ @OETestID(1445)
+ def test_efi_systemdboot_images_can_be_built(self):
+ """
+ Summary: Check if systemd-boot images can be built correctly
+ Expected: 1. File systemd-boot.efi should be available in $poky/build/tmp/deploy/images/genericx86-64
+ 2. 'systemd-boot" can be built correctly
+ Product: oe-core
+ Author: Jose Perez Carranza <jose.perez.carranza@intel.com>
+ AutomatedBy: Jose Perez Carranza <jose.perez.carranza@intel.com>
+ """
+
+ # We'd use DEPLOY_DIR_IMAGE here, except that we need its value for
+ # MACHINE="genericx86-64 which is probably not the one configured
+ systemdbootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'systemd-bootx64.efi')
+
+ self._common_setup()
+
+ # Ensure we're actually testing that this gets built and not that
+ # it was around from an earlier build
+ bitbake('-c cleansstate systemd-boot')
+ runCmd('rm -f %s' % systemdbootfile)
+
+ self._common_build()
+
+ found = os.path.isfile(systemdbootfile)
+ self.assertTrue(found, 'Systemd-Boot file %s not found' % systemdbootfile)
+
+ @OETestID(1528)
+ @OETestDepends(['systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built'])
+ def test_image_efi_file(self):
+
+ """
+ Summary: Check if EFI bootloader for systemd is correctly build
+ Dependencies: Image was built correctly on testcase 1445
+ Steps: 1. Copy bootx64.efi file form the hddimg created
+ under build/tmp/deploy/images/genericx86-64
+ 2. Check bootx64.efi was copied form hddimg
+ 3. Verify the checksums from the copied and previously
+ created file are equal.
+ Expected : Systemd-bootx64.efi and bootx64.efi should be the same
+ hence checksums should be equal.
+ Product: oe-core
+ Author: Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
+ AutomatedBy: Jose Perez Carranza <jose.perez.carranza at linux-intel.com>
+ """
+
+ systemdbootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64',
+ 'systemd-bootx64.efi')
+ systemdbootimage = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64',
+ 'core-image-minimal-genericx86-64.hddimg')
+ imagebootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64',
+ 'bootx64.efi')
+ mcopynative = os.path.join(get_bb_var('STAGING_BINDIR_NATIVE'), 'mcopy')
+
+ #Clean environment before start the test
+ if os.path.isfile(imagebootfile):
+ runCmd('rm -f %s' % imagebootfile)
+
+ #Step 1
+ runCmd('%s -i %s ::EFI/BOOT/bootx64.efi %s' % (mcopynative ,systemdbootimage,
+ imagebootfile))
+
+ #Step 2
+ found = os.path.isfile(imagebootfile)
+ self.assertTrue(found, 'bootx64.efi file %s was not copied from image'
+ % imagebootfile)
+
+ #Step 3
+ result = runCmd('md5sum %s %s' % (systemdbootfile, imagebootfile))
+ self.assertEqual(result.output.split()[0], result.output.split()[2],
+ '%s was not correclty generated' % imagebootfile)
diff --git a/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone-yocto/machconfig b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone-yocto/machconfig
new file mode 100644
index 000000000..ffce01227
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/beaglebone-yocto/machconfig
@@ -0,0 +1,3 @@
+# Assume a USB mouse and keyboard are connected
+HAVE_TOUCHSCREEN=0
+HAVE_KEYBOARD=1
diff --git a/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig
new file mode 100644
index 000000000..a81a23bf5
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86-64/machconfig
@@ -0,0 +1,6 @@
+HAVE_TOUCHSCREEN=0
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_DPI=133
diff --git a/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig
new file mode 100644
index 000000000..a81a23bf5
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor/genericx86/machconfig
@@ -0,0 +1,6 @@
+HAVE_TOUCHSCREEN=0
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_DPI=133
diff --git a/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
new file mode 100644
index 000000000..74d33c871
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.conf
@@ -0,0 +1,2 @@
+# Mimic modprobe's install funcitonality with busybox's modprobe
+install gma500_gfx dmesg | grep gma500_gfx_checked || { /etc/modprobe.d/gma500-gfx-check.sh || modprobe gma500_gfx; }
diff --git a/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
new file mode 100644
index 000000000..75cda99f5
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check/gma500-gfx-check.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Check for devices we wish to avoid gma500_gfx for
+DEVICES="0x8119 0x4108"
+
+# Checked flag to avoid infinite modprobe
+echo "gma500_gfx_checked" >> /dev/kmsg;
+
+for DEVICE in $DEVICES; do
+ if udevadm trigger --subsystem-match=pci --verbose --attr-match=device=$DEVICE | grep "pci" >> /dev/null ; then
+ echo "Found $DEVICE, avoiding gma500_gfx module" >> /dev/kmsg;
+ exit 0
+ fi
+done
+exit 1
diff --git a/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
new file mode 100644
index 000000000..00680de89
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-bsp/gma500-gfx-check/gma500-gfx-check_1.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Intel gma500_gfx fix for certain hardware"
+DESCRIPTION = "Avoid inserting gma500_gfx module for certain hardware devices."
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://gma500-gfx-check.conf \
+ file://gma500-gfx-check.sh "
+
+do_install(){
+ install -d ${D}${sysconfdir}/modprobe.d/
+ install -m 755 ${WORKDIR}/gma500-gfx-check.sh ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.sh
+ install -m 644 ${WORKDIR}/gma500-gfx-check.conf ${D}${sysconfdir}/modprobe.d/gma500-gfx-check.conf
+}
+
+FILES_${PN}="${sysconfdir}/modprobe.d/gma500-gfx-check.conf \
+ ${sysconfdir}/modprobe.d/gma500-gfx-check.sh"
+
+COMPATIBLE_MACHINE = "genericx86"
diff --git a/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone-yocto/xorg.conf b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone-yocto/xorg.conf
new file mode 100644
index 000000000..2f40dae15
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/beaglebone-yocto/xorg.conf
@@ -0,0 +1,20 @@
+Section "Monitor"
+ Identifier "Builtin Default Monitor"
+EndSection
+
+Section "Device"
+ Identifier "Builtin Default fbdev Device 0"
+ Driver "modesetting"
+EndSection
+
+Section "Screen"
+ Identifier "Builtin Default fbdev Screen 0"
+ DefaultDepth 16
+ Device "Builtin Default fbdev Device 0"
+ Monitor "Builtin Default Monitor"
+EndSection
+
+Section "ServerLayout"
+ Identifier "Builtin Default Layout"
+ Screen "Builtin Default fbdev Screen 0"
+EndSection
diff --git a/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86-64/xorg.conf
diff --git a/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config/genericx86/xorg.conf
diff --git a/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
new file mode 100644
index 000000000..72d991c7e
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
diff --git a/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
new file mode 100644
index 000000000..e28360b69
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.12.bbappend
@@ -0,0 +1,28 @@
+KBRANCH_genericx86 = "standard/base"
+KBRANCH_genericx86-64 = "standard/base"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+KBRANCH_edgerouter = "standard/edgerouter"
+KBRANCH_beaglebone-yocto = "standard/beaglebone"
+KMACHINE_beaglebone-yocto = "beaglebone"
+KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
+
+SRCREV_machine_genericx86 ?= "97e710ef0545c19d3c10bd81a61bdca9fe543b81"
+SRCREV_machine_genericx86-64 ?= "97e710ef0545c19d3c10bd81a61bdca9fe543b81"
+SRCREV_machine_edgerouter ?= "97e710ef0545c19d3c10bd81a61bdca9fe543b81"
+SRCREV_machine_beaglebone-yocto ?= "97e710ef0545c19d3c10bd81a61bdca9fe543b81"
+SRCREV_machine_mpc8315e-rdb ?= "55fcfbee2560f57a490c5724ac5b5cb49bacb01c"
+
+
+COMPATIBLE_MACHINE_genericx86 = "genericx86"
+COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
+COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+LINUX_VERSION_genericx86 = "4.12.21"
+LINUX_VERSION_genericx86-64 = "4.12.21"
+LINUX_VERSION_edgerouter = "4.12.21"
+LINUX_VERSION_beaglebone-yocto = "4.12.21"
+LINUX_VERSION_mpc8315e-rdb = "4.12.21"
diff --git a/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.14.bbappend b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.14.bbappend
new file mode 100644
index 000000000..5130707dd
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.14.bbappend
@@ -0,0 +1,27 @@
+KBRANCH_genericx86 = "v4.14/standard/base"
+KBRANCH_genericx86-64 = "v4.14/standard/base"
+KBRANCH_edgerouter = "v4.14/standard/edgerouter"
+KBRANCH_beaglebone-yocto = "v4.14/standard/beaglebone"
+KBRANCH_mpc8315e-rdb = "v4.14/standard/fsl-mpc8315e-rdb"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+KMACHINE_beaglebone-yocto ?= "beaglebone"
+
+SRCREV_machine_genericx86 ?= "1d50ce210b0536eb9a66d1e56ae215f92176444a"
+SRCREV_machine_genericx86-64 ?= "1d50ce210b0536eb9a66d1e56ae215f92176444a"
+SRCREV_machine_edgerouter ?= "f2dc94f77d19ab65a832bad6f42662c509d2ef9e"
+SRCREV_machine_beaglebone-yocto ?= "6c1a02d4a9c227eca356911715a52cf92457ec16"
+SRCREV_machine_mpc8315e-rdb ?= "7e9a0b017be7b685e094638f4bdaa33a7df8f7c0"
+
+COMPATIBLE_MACHINE_genericx86 = "genericx86"
+COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
+COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+LINUX_VERSION_genericx86 = "4.14.30"
+LINUX_VERSION_genericx86-64 = "4.14.30"
+LINUX_VERSION_edgerouter = "4.14.30"
+LINUX_VERSION_beaglebone-yocto = "4.14.30"
+LINUX_VERSION_mpc8315e-rdb = "4.14.30"
diff --git a/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.15.bbappend b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.15.bbappend
new file mode 100644
index 000000000..c0c6ad92d
--- /dev/null
+++ b/poky/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_4.15.bbappend
@@ -0,0 +1,27 @@
+KBRANCH_genericx86 = "v4.15/standard/base"
+KBRANCH_genericx86-64 = "v4.15/standard/base"
+KBRANCH_edgerouter = "v4.15/standard/edgerouter"
+KBRANCH_beaglebone-yocto = "v4.15/standard/beaglebone"
+KBRANCH_mpc8315e-rdb = "v4.15/standard/fsl-mpc8315e-rdb"
+
+KMACHINE_genericx86 ?= "common-pc"
+KMACHINE_genericx86-64 ?= "common-pc-64"
+KMACHINE_beaglebone-yocto ?= "beaglebone"
+
+SRCREV_machine_genericx86 ?= "f73fd8783a3e7529902366ba75aafb81c19ec3c9"
+SRCREV_machine_genericx86-64 ?= "f73fd8783a3e7529902366ba75aafb81c19ec3c9"
+SRCREV_machine_edgerouter ?= "f73fd8783a3e7529902366ba75aafb81c19ec3c9"
+SRCREV_machine_beaglebone-yocto ?= "f73fd8783a3e7529902366ba75aafb81c19ec3c9"
+SRCREV_machine_mpc8315e-rdb ?= "cc2711c4f3b83b5cd78358e7c949fdbb6076e25b"
+
+COMPATIBLE_MACHINE_genericx86 = "genericx86"
+COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
+COMPATIBLE_MACHINE_edgerouter = "edgerouter"
+COMPATIBLE_MACHINE_beaglebone-yocto = "beaglebone-yocto"
+COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
+
+LINUX_VERSION_genericx86 = "4.15.13"
+LINUX_VERSION_genericx86-64 = "4.15.13"
+LINUX_VERSION_edgerouter = "4.15.13"
+LINUX_VERSION_beaglebone-yocto = "4.15.13"
+LINUX_VERSION_mpc8315e-rdb = "4.15.13"
diff --git a/poky/meta-yocto-bsp/wic/beaglebone-yocto.wks b/poky/meta-yocto-bsp/wic/beaglebone-yocto.wks
new file mode 100644
index 000000000..967cad78b
--- /dev/null
+++ b/poky/meta-yocto-bsp/wic/beaglebone-yocto.wks
@@ -0,0 +1,6 @@
+# short-description: Create SD card image for Beaglebone
+# long-description: Creates a partitioned SD card image for Beaglebone.
+# Boot files are located in the first vfat partition.
+
+part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
diff --git a/poky/meta-yocto-bsp/wic/edgerouter.wks b/poky/meta-yocto-bsp/wic/edgerouter.wks
new file mode 100644
index 000000000..7176fe436
--- /dev/null
+++ b/poky/meta-yocto-bsp/wic/edgerouter.wks
@@ -0,0 +1,4 @@
+# short-description: Create SD card image for Edgerouter
+# long-description: Create a partitioned SD card image for MIPS64 Edgerouter reference hardware.
+part /boot --source bootimg-partition --ondisk sda --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk sda --fstype=ext4 --label root --align 4
diff --git a/poky/meta-yocto-bsp/wic/genericx86.wks b/poky/meta-yocto-bsp/wic/genericx86.wks
new file mode 100644
index 000000000..dab719c58
--- /dev/null
+++ b/poky/meta-yocto-bsp/wic/genericx86.wks
@@ -0,0 +1,7 @@
+# short-description: Create an EFI disk image for genericx86*
+# long-description: Creates a partitioned EFI disk image for genericx86* machines
+part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
diff --git a/poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks b/poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks
new file mode 100644
index 000000000..d0cb607ff
--- /dev/null
+++ b/poky/meta-yocto-bsp/wic/mpc8315e-rdb.wks
@@ -0,0 +1,4 @@
+# short-description: Create SD card image for MPC8315E-RDB
+# long-description: Create a partitioned SD card image for Freescale MPC8315E-RDB reference hardware.
+part /boot --source bootimg-partition --ondisk sdb --fstype=ext3 --label boot
+part / --source rootfs --ondisk sdb --fstype=ext3 --label root
diff --git a/poky/meta/COPYING.GPLv2 b/poky/meta/COPYING.GPLv2
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/poky/meta/COPYING.GPLv2
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/poky/meta/COPYING.MIT b/poky/meta/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/poky/meta/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/poky/meta/classes/allarch.bbclass b/poky/meta/classes/allarch.bbclass
new file mode 100644
index 000000000..51ba509cd
--- /dev/null
+++ b/poky/meta/classes/allarch.bbclass
@@ -0,0 +1,51 @@
+#
+# This class is used for architecture independent recipes/data files (usually scripts)
+#
+
+PACKAGE_ARCH = "all"
+
+python () {
+ # Allow this class to be included but overridden - only set
+ # the values if we're still "all" package arch.
+ if d.getVar("PACKAGE_ARCH") == "all":
+ # No need for virtual/libc or a cross compiler
+ d.setVar("INHIBIT_DEFAULT_DEPS","1")
+
+ # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
+ # naming anyway
+ d.setVar("baselib", "lib")
+ d.setVar("TARGET_ARCH", "allarch")
+ d.setVar("TARGET_OS", "linux")
+ d.setVar("TARGET_CC_ARCH", "none")
+ d.setVar("TARGET_LD_ARCH", "none")
+ d.setVar("TARGET_AS_ARCH", "none")
+ d.setVar("TARGET_FPU", "")
+ d.setVar("TARGET_PREFIX", "")
+ # Expand PACKAGE_EXTRA_ARCHS since the staging code needs this
+ # (this removes any dependencies from the hash perspective)
+ d.setVar("PACKAGE_EXTRA_ARCHS", d.getVar("PACKAGE_EXTRA_ARCHS"))
+ d.setVar("SDK_ARCH", "none")
+ d.setVar("SDK_CC_ARCH", "none")
+ d.setVar("TARGET_CPPFLAGS", "none")
+ d.setVar("TARGET_CFLAGS", "none")
+ d.setVar("TARGET_CXXFLAGS", "none")
+ d.setVar("TARGET_LDFLAGS", "none")
+ d.setVar("POPULATESYSROOTDEPS", "")
+
+ # Avoid this being unnecessarily different due to nuances of
+ # the target machine that aren't important for "all" arch
+ # packages.
+ d.setVar("LDFLAGS", "")
+
+ # No need to do shared library processing or debug symbol handling
+ d.setVar("EXCLUDE_FROM_SHLIBS", "1")
+ d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
+ d.setVar("INHIBIT_PACKAGE_STRIP", "1")
+
+ # These multilib values shouldn't change allarch packages so exclude them
+ d.appendVarFlag("emit_pkgdata", "vardepsexclude", " MULTILIB_VARIANTS")
+ d.appendVarFlag("write_specfile", "vardepsexclude", " MULTILIBS")
+ elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
+ bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE"))
+}
+
diff --git a/poky/meta/classes/archiver.bbclass b/poky/meta/classes/archiver.bbclass
new file mode 100644
index 000000000..31c9b7eb4
--- /dev/null
+++ b/poky/meta/classes/archiver.bbclass
@@ -0,0 +1,474 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# This bbclass is used for creating archive for:
+# 1) original (or unpacked) source: ARCHIVER_MODE[src] = "original"
+# 2) patched source: ARCHIVER_MODE[src] = "patched" (default)
+# 3) configured source: ARCHIVER_MODE[src] = "configured"
+# 4) The patches between do_unpack and do_patch:
+# ARCHIVER_MODE[diff] = "1"
+# And you can set the one that you'd like to exclude from the diff:
+# ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+# 5) The environment data, similar to 'bitbake -e recipe':
+# ARCHIVER_MODE[dumpdata] = "1"
+# 6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"
+# 7) Whether output the .src.rpm package:
+# ARCHIVER_MODE[srpm] = "1"
+# 8) Filter the license, the recipe whose license in
+# COPYLEFT_LICENSE_INCLUDE will be included, and in
+# COPYLEFT_LICENSE_EXCLUDE will be excluded.
+# COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
+# COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
+# 9) The recipe type that will be archived:
+# COPYLEFT_RECIPE_TYPES = 'target'
+#
+
+# Don't filter the license by default
+COPYLEFT_LICENSE_INCLUDE ?= ''
+COPYLEFT_LICENSE_EXCLUDE ?= ''
+# Create archive for all the recipe types
+COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
+inherit copyleft_filter
+
+ARCHIVER_MODE[srpm] ?= "0"
+ARCHIVER_MODE[src] ?= "patched"
+ARCHIVER_MODE[diff] ?= "0"
+ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+ARCHIVER_MODE[dumpdata] ?= "0"
+ARCHIVER_MODE[recipe] ?= "0"
+
+DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources"
+ARCHIVER_TOPDIR ?= "${WORKDIR}/deploy-sources"
+ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/"
+ARCHIVER_WORKDIR = "${WORKDIR}/archiver-work/"
+
+do_dumpdata[dirs] = "${ARCHIVER_OUTDIR}"
+do_ar_recipe[dirs] = "${ARCHIVER_OUTDIR}"
+do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}"
+do_deploy_archives[dirs] = "${WORKDIR}"
+
+# This is a convenience for the shell script to use it
+
+
+python () {
+ pn = d.getVar('PN')
+ assume_provided = (d.getVar("ASSUME_PROVIDED") or "").split()
+ if pn in assume_provided:
+ for p in d.getVar("PROVIDES").split():
+ if p != pn:
+ pn = p
+ break
+
+ included, reason = copyleft_should_include(d)
+ if not included:
+ bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
+ return
+ else:
+ bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
+
+
+ # glibc-locale: do_fetch, do_unpack and do_patch tasks have been deleted,
+ # so avoid archiving source here.
+ if pn.startswith('glibc-locale'):
+ return
+
+ # We just archive gcc-source for all the gcc related recipes
+ if d.getVar('BPN') in ['gcc', 'libgcc'] \
+ and not pn.startswith('gcc-source'):
+ bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn)
+ return
+
+ ar_src = d.getVarFlag('ARCHIVER_MODE', 'src')
+ ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata')
+ ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe')
+
+ if ar_src == "original":
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % pn)
+ # 'patched' and 'configured' invoke do_unpack_and_patch because
+ # do_ar_patched resp. do_ar_configured depend on it, but for 'original'
+ # we have to add it explicitly.
+ if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_unpack_and_patch' % pn)
+ elif ar_src == "patched":
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_patched' % pn)
+ elif ar_src == "configured":
+ # We can't use "addtask do_ar_configured after do_configure" since it
+ # will cause the deptask of do_populate_sysroot to run not matter what
+ # archives we need, so we add the depends here.
+
+ # There is a corner case with "gcc-source-${PV}" recipes, they don't have
+ # the "do_configure" task, so we need to use "do_preconfigure"
+ if pn.startswith("gcc-source-"):
+ d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn)
+ else:
+ d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn)
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn)
+
+ elif ar_src:
+ bb.fatal("Invalid ARCHIVER_MODE[src]: %s" % ar_src)
+
+ if ar_dumpdata == "1":
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_dumpdata' % pn)
+
+ if ar_recipe == "1":
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_recipe' % pn)
+
+ # Output the SRPM package
+ if d.getVarFlag('ARCHIVER_MODE', 'srpm') == "1" and d.getVar('PACKAGES'):
+ if "package_rpm" in d.getVar('PACKAGE_CLASSES'):
+ d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn)
+ if ar_dumpdata == "1":
+ d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_dumpdata' % pn)
+ if ar_recipe == "1":
+ d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_recipe' % pn)
+ if ar_src == "original":
+ d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_original' % pn)
+ elif ar_src == "patched":
+ d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn)
+ elif ar_src == "configured":
+ d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn)
+ else:
+ bb.fatal("ARCHIVER_MODE[srpm] needs package_rpm in PACKAGE_CLASSES")
+}
+
+# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/.
+# Files in SRC_URI are copied directly, anything that's a directory
+# (e.g. git repositories) is "unpacked" and then put into a tarball.
+python do_ar_original() {
+
+ import shutil, tempfile
+
+ if d.getVarFlag('ARCHIVER_MODE', 'src') != "original":
+ return
+
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+ bb.note('Archiving the original source...')
+ urls = d.getVar("SRC_URI").split()
+ # destsuffix (git fetcher) and subdir (everything else) are allowed to be
+ # absolute paths (for example, destsuffix=${S}/foobar).
+ # That messes with unpacking inside our tmpdir below, because the fetchers
+ # will then unpack in that directory and completely ignore the tmpdir.
+ # That breaks parallel tasks relying on ${S}, like do_compile.
+ #
+ # To solve this, we remove these parameters from all URLs.
+ # We do this even for relative paths because it makes the content of the
+ # archives more useful (no extra paths that are only used during
+ # compilation).
+ for i, url in enumerate(urls):
+ decoded = bb.fetch2.decodeurl(url)
+ for param in ('destsuffix', 'subdir'):
+ if param in decoded[5]:
+ del decoded[5][param]
+ encoded = bb.fetch2.encodeurl(decoded)
+ urls[i] = encoded
+ fetch = bb.fetch2.Fetch(urls, d)
+ tarball_suffix = {}
+ for url in fetch.urls:
+ local = fetch.localpath(url).rstrip("/");
+ if os.path.isfile(local):
+ shutil.copy(local, ar_outdir)
+ elif os.path.isdir(local):
+ tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR'))
+ fetch.unpack(tmpdir, (url,))
+ # To handle recipes with more than one source, we add the "name"
+ # URL parameter as suffix. We treat it as an error when
+ # there's more than one URL without a name, or a name gets reused.
+ # This is an additional safety net, in practice the name has
+ # to be set when using the git fetcher, otherwise SRCREV cannot
+ # be set separately for each URL.
+ params = bb.fetch2.decodeurl(url)[5]
+ type = bb.fetch2.decodeurl(url)[0]
+ location = bb.fetch2.decodeurl(url)[2]
+ name = params.get('name', '')
+ if type.lower() == 'file':
+ name_tmp = location.rstrip("*").rstrip("/")
+ name = os.path.basename(name_tmp)
+ else:
+ if name in tarball_suffix:
+ if not name:
+ bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
+ else:
+ bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
+ tarball_suffix[name] = url
+ create_tarball(d, tmpdir + '/.', name, ar_outdir)
+
+ # Emit patch series files for 'original'
+ bb.note('Writing patch series files...')
+ for patch in src_patches(d):
+ _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+ patchdir = parm.get('patchdir')
+ if patchdir:
+ series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_'))
+ else:
+ series = os.path.join(ar_outdir, 'series')
+
+ with open(series, 'a') as s:
+ s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
+}
+
+python do_ar_patched() {
+
+ if d.getVarFlag('ARCHIVER_MODE', 'src') != 'patched':
+ return
+
+ # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+ ar_workdir = d.getVar('ARCHIVER_WORKDIR')
+ bb.note('Archiving the patched source...')
+ d.setVar('WORKDIR', ar_workdir)
+ create_tarball(d, d.getVar('S'), 'patched', ar_outdir)
+}
+
+python do_ar_configured() {
+ import shutil
+
+ # Forcibly expand the sysroot paths as we're about to change WORKDIR
+ d.setVar('STAGING_DIR_HOST', d.getVar('STAGING_DIR_HOST'))
+ d.setVar('STAGING_DIR_TARGET', d.getVar('STAGING_DIR_TARGET'))
+ d.setVar('RECIPE_SYSROOT', d.getVar('RECIPE_SYSROOT'))
+ d.setVar('RECIPE_SYSROOT_NATIVE', d.getVar('RECIPE_SYSROOT_NATIVE'))
+
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+ if d.getVarFlag('ARCHIVER_MODE', 'src') == 'configured':
+ bb.note('Archiving the configured source...')
+ pn = d.getVar('PN')
+ # "gcc-source-${PV}" recipes don't have "do_configure"
+ # task, so we need to run "do_preconfigure" instead
+ if pn.startswith("gcc-source-"):
+ d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
+ bb.build.exec_func('do_preconfigure', d)
+
+ # The libtool-native's do_configure will remove the
+ # ${STAGING_DATADIR}/aclocal/libtool.m4, so we can't re-run the
+ # do_configure, we archive the already configured ${S} to
+ # instead of.
+ elif pn != 'libtool-native':
+ # Change the WORKDIR to make do_configure run in another dir.
+ d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR'))
+ if bb.data.inherits_class('kernel-yocto', d):
+ bb.build.exec_func('do_kernel_configme', d)
+ if bb.data.inherits_class('cmake', d):
+ bb.build.exec_func('do_generate_toolchain_file', d)
+ prefuncs = d.getVarFlag('do_configure', 'prefuncs')
+ for func in (prefuncs or '').split():
+ if func != "sysroot_cleansstate":
+ bb.build.exec_func(func, d)
+ bb.build.exec_func('do_configure', d)
+ postfuncs = d.getVarFlag('do_configure', 'postfuncs')
+ for func in (postfuncs or '').split():
+ if func != "do_qa_configure":
+ bb.build.exec_func(func, d)
+ srcdir = d.getVar('S')
+ builddir = d.getVar('B')
+ if srcdir != builddir:
+ if os.path.exists(builddir):
+ oe.path.copytree(builddir, os.path.join(srcdir, \
+ 'build.%s.ar_configured' % d.getVar('PF')))
+ create_tarball(d, srcdir, 'configured', ar_outdir)
+}
+
+def create_tarball(d, srcdir, suffix, ar_outdir):
+ """
+ create the tarball from srcdir
+ """
+ import tarfile
+
+ # Make sure we are only creating a single tarball for gcc sources
+ if (d.getVar('SRC_URI') == ""):
+ return
+
+ # For the kernel archive, srcdir may just be a link to the
+ # work-shared location. Use os.path.realpath to make sure
+ # that we archive the actual directory and not just the link.
+ srcdir = os.path.realpath(srcdir)
+
+ bb.utils.mkdirhier(ar_outdir)
+ if suffix:
+ filename = '%s-%s.tar.gz' % (d.getVar('PF'), suffix)
+ else:
+ filename = '%s.tar.gz' % d.getVar('PF')
+ tarname = os.path.join(ar_outdir, filename)
+
+ bb.note('Creating %s' % tarname)
+ tar = tarfile.open(tarname, 'w:gz')
+ tar.add(srcdir, arcname=os.path.basename(srcdir))
+ tar.close()
+
+# creating .diff.gz between source.orig and source
+def create_diff_gz(d, src_orig, src, ar_outdir):
+
+ import subprocess
+
+ if not os.path.isdir(src) or not os.path.isdir(src_orig):
+ return
+
+ # The diff --exclude can't exclude the file with path, so we copy
+ # the patched source, and remove the files that we'd like to
+ # exclude.
+ src_patched = src + '.patched'
+ oe.path.copyhardlinktree(src, src_patched)
+ for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude').split():
+ bb.utils.remove(os.path.join(src_orig, i), recurse=True)
+ bb.utils.remove(os.path.join(src_patched, i), recurse=True)
+
+ dirname = os.path.dirname(src)
+ basename = os.path.basename(src)
+ bb.utils.mkdirhier(ar_outdir)
+ cwd = os.getcwd()
+ try:
+ os.chdir(dirname)
+ out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF'))
+ diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
+ subprocess.check_call(diff_cmd, shell=True)
+ bb.utils.remove(src_patched, recurse=True)
+ finally:
+ os.chdir(cwd)
+
+def is_work_shared(d):
+ pn = d.getVar('PN')
+ return bb.data.inherits_class('kernel', d) or pn.startswith('gcc-source')
+
+# Run do_unpack and do_patch
+python do_unpack_and_patch() {
+ if d.getVarFlag('ARCHIVER_MODE', 'src') not in \
+ [ 'patched', 'configured'] and \
+ d.getVarFlag('ARCHIVER_MODE', 'diff') != '1':
+ return
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+ ar_workdir = d.getVar('ARCHIVER_WORKDIR')
+ ar_sysroot_native = d.getVar('STAGING_DIR_NATIVE')
+ pn = d.getVar('PN')
+
+ # The kernel class functions require it to be on work-shared, so we dont change WORKDIR
+ if not is_work_shared(d):
+ # Change the WORKDIR to make do_unpack do_patch run in another dir.
+ d.setVar('WORKDIR', ar_workdir)
+ # Restore the original path to recipe's native sysroot (it's relative to WORKDIR).
+ d.setVar('STAGING_DIR_NATIVE', ar_sysroot_native)
+
+ # The changed 'WORKDIR' also caused 'B' changed, create dir 'B' for the
+ # possibly requiring of the following tasks (such as some recipes's
+ # do_patch required 'B' existed).
+ bb.utils.mkdirhier(d.getVar('B'))
+
+ bb.build.exec_func('do_unpack', d)
+
+ # Save the original source for creating the patches
+ if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
+ src = d.getVar('S').rstrip('/')
+ src_orig = '%s.orig' % src
+ oe.path.copytree(src, src_orig)
+
+ # Make sure gcc and kernel sources are patched only once
+ if not (d.getVar('SRC_URI') == "" or is_work_shared(d)):
+ bb.build.exec_func('do_patch', d)
+
+ # Create the patches
+ if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
+ bb.note('Creating diff gz...')
+ create_diff_gz(d, src_orig, src, ar_outdir)
+ bb.utils.remove(src_orig, recurse=True)
+}
+
+# BBINCLUDED is special (excluded from basehash signature
+# calculation). Using it in a task signature can cause "basehash
+# changed" errors.
+#
+# Depending on BBINCLUDED also causes do_ar_recipe to run again
+# for unrelated changes, like adding or removing buildhistory.bbclass.
+#
+# For these reasons we ignore the dependency completely. The versioning
+# of the output file ensures that we create it each time the recipe
+# gets rebuilt, at least as long as a PR server is used. We also rely
+# on that mechanism to catch changes in the file content, because the
+# file content is not part of of the task signature either.
+do_ar_recipe[vardepsexclude] += "BBINCLUDED"
+python do_ar_recipe () {
+ """
+ archive the recipe, including .bb and .inc.
+ """
+ import re
+ import shutil
+
+ require_re = re.compile( r"require\s+(.+)" )
+ include_re = re.compile( r"include\s+(.+)" )
+ bbfile = d.getVar('FILE')
+ outdir = os.path.join(d.getVar('WORKDIR'), \
+ '%s-recipe' % d.getVar('PF'))
+ bb.utils.mkdirhier(outdir)
+ shutil.copy(bbfile, outdir)
+
+ pn = d.getVar('PN')
+ bbappend_files = d.getVar('BBINCLUDED').split()
+ # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
+ # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
+ bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
+ bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
+ for file in bbappend_files:
+ if bbappend_re.match(file) or bbappend_re1.match(file):
+ shutil.copy(file, outdir)
+
+ dirname = os.path.dirname(bbfile)
+ bbpath = '%s:%s' % (dirname, d.getVar('BBPATH'))
+ f = open(bbfile, 'r')
+ for line in f.readlines():
+ incfile = None
+ if require_re.match(line):
+ incfile = require_re.match(line).group(1)
+ elif include_re.match(line):
+ incfile = include_re.match(line).group(1)
+ if incfile:
+ incfile = d.expand(incfile)
+ incfile = bb.utils.which(bbpath, incfile)
+ if incfile:
+ shutil.copy(incfile, outdir)
+
+ create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR'))
+ bb.utils.remove(outdir, recurse=True)
+}
+
+python do_dumpdata () {
+ """
+ dump environment data to ${PF}-showdata.dump
+ """
+
+ dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR'), \
+ '%s-showdata.dump' % d.getVar('PF'))
+ bb.note('Dumping metadata into %s' % dumpfile)
+ with open(dumpfile, "w") as f:
+ # emit variables and shell functions
+ bb.data.emit_env(f, d, True)
+ # emit the metadata which isn't valid shell
+ for e in d.keys():
+ if d.getVarFlag(e, "python", False):
+ f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, False)))
+}
+
+SSTATETASKS += "do_deploy_archives"
+do_deploy_archives () {
+ echo "Deploying source archive files from ${ARCHIVER_TOPDIR} to ${DEPLOY_DIR_SRC}."
+}
+python do_deploy_archives_setscene () {
+ sstate_setscene(d)
+}
+do_deploy_archives[dirs] = "${ARCHIVER_TOPDIR}"
+do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}"
+do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}"
+addtask do_deploy_archives_setscene
+
+addtask do_ar_original after do_unpack
+addtask do_unpack_and_patch after do_patch
+addtask do_ar_patched after do_unpack_and_patch
+addtask do_ar_configured after do_unpack_and_patch
+addtask do_dumpdata
+addtask do_ar_recipe
+addtask do_deploy_archives before do_build
+
+python () {
+ # Add tasks in the correct order, specifically for linux-yocto to avoid race condition.
+ # sstatesig.py:sstate_rundepfilter has special support that excludes this dependency
+ # so that do_kernel_configme does not need to run again when do_unpack_and_patch
+ # gets added or removed (by adding or removing archiver.bbclass).
+ if bb.data.inherits_class('kernel-yocto', d):
+ bb.build.addtask('do_kernel_configme', 'do_configure', 'do_unpack_and_patch', d)
+}
diff --git a/poky/meta/classes/autotools-brokensep.bbclass b/poky/meta/classes/autotools-brokensep.bbclass
new file mode 100644
index 000000000..71cf97a39
--- /dev/null
+++ b/poky/meta/classes/autotools-brokensep.bbclass
@@ -0,0 +1,5 @@
+# Autotools class for recipes where separate build dir doesn't work
+# Ideally we should fix software so it does work. Standard autotools supports
+# this.
+inherit autotools
+B = "${S}"
diff --git a/poky/meta/classes/autotools.bbclass b/poky/meta/classes/autotools.bbclass
new file mode 100644
index 000000000..cc857acc3
--- /dev/null
+++ b/poky/meta/classes/autotools.bbclass
@@ -0,0 +1,255 @@
+def autotools_dep_prepend(d):
+ if d.getVar('INHIBIT_AUTOTOOLS_DEPS'):
+ return ''
+
+ pn = d.getVar('PN')
+ deps = ''
+
+ if pn in ['autoconf-native', 'automake-native', 'help2man-native']:
+ return deps
+ deps += 'autoconf-native automake-native '
+
+ if not pn in ['libtool', 'libtool-native'] and not pn.endswith("libtool-cross"):
+ deps += 'libtool-native '
+ if not bb.data.inherits_class('native', d) \
+ and not bb.data.inherits_class('nativesdk', d) \
+ and not bb.data.inherits_class('cross', d) \
+ and not d.getVar('INHIBIT_DEFAULT_DEPS'):
+ deps += 'libtool-cross '
+
+ return deps + 'gnu-config-native '
+
+DEPENDS_prepend = "${@autotools_dep_prepend(d)} "
+
+inherit siteinfo
+
+# Space separated list of shell scripts with variables defined to supply test
+# results for autoconf tests we cannot run at build time.
+export CONFIG_SITE = "${@siteinfo_get_files(d)}"
+
+acpaths ?= "default"
+EXTRA_AUTORECONF = "--exclude=autopoint"
+
+export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
+
+# When building tools for use at build-time it's recommended for the build
+# system to use these variables when cross-compiling.
+# (http://sources.redhat.com/autobook/autobook/autobook_270.html)
+export CPP_FOR_BUILD = "${BUILD_CPP}"
+export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}"
+
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+
+export CXX_FOR_BUILD = "${BUILD_CXX}"
+export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+
+export LD_FOR_BUILD = "${BUILD_LD}"
+export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"
+
+def append_libtool_sysroot(d):
+ # Only supply libtool sysroot option for non-native packages
+ if not bb.data.inherits_class('native', d):
+ return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
+ return ""
+
+CONFIGUREOPTS = " --build=${BUILD_SYS} \
+ --host=${HOST_SYS} \
+ --target=${TARGET_SYS} \
+ --prefix=${prefix} \
+ --exec_prefix=${exec_prefix} \
+ --bindir=${bindir} \
+ --sbindir=${sbindir} \
+ --libexecdir=${libexecdir} \
+ --datadir=${datadir} \
+ --sysconfdir=${sysconfdir} \
+ --sharedstatedir=${sharedstatedir} \
+ --localstatedir=${localstatedir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --oldincludedir=${oldincludedir} \
+ --infodir=${infodir} \
+ --mandir=${mandir} \
+ --disable-silent-rules \
+ ${CONFIGUREOPT_DEPTRACK} \
+ ${@append_libtool_sysroot(d)}"
+CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
+
+CACHED_CONFIGUREVARS ?= ""
+
+AUTOTOOLS_SCRIPT_PATH ?= "${S}"
+CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"
+
+AUTOTOOLS_AUXDIR ?= "${AUTOTOOLS_SCRIPT_PATH}"
+
+oe_runconf () {
+ # Use relative path to avoid buildpaths in files
+ cfgscript_name="`basename ${CONFIGURE_SCRIPT}`"
+ cfgscript=`python3 -c "import os; print(os.path.relpath(os.path.dirname('${CONFIGURE_SCRIPT}'), '.'))"`/$cfgscript_name
+ if [ -x "$cfgscript" ] ; then
+ bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
+ if ! ${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"; then
+ bbnote "The following config.log files may provide further information."
+ bbnote `find ${B} -ignore_readdir_race -type f -name config.log`
+ bbfatal_log "configure failed"
+ fi
+ else
+ bbfatal "no configure script found at $cfgscript"
+ fi
+}
+
+CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
+
+autotools_preconfigure() {
+ if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+ if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+ if [ "${S}" != "${B}" ]; then
+ echo "Previously configured separate build directory detected, cleaning ${B}"
+ rm -rf ${B}
+ mkdir -p ${B}
+ else
+ # At least remove the .la files since automake won't automatically
+ # regenerate them even if CFLAGS/LDFLAGS are different
+ cd ${S}
+ if [ "${CLEANBROKEN}" != "1" -a \( -e Makefile -o -e makefile -o -e GNUmakefile \) ]; then
+ oe_runmake clean
+ fi
+ find ${S} -ignore_readdir_race -name \*.la -delete
+ fi
+ fi
+ fi
+}
+
+autotools_postconfigure(){
+ if [ -n "${CONFIGURESTAMPFILE}" ]; then
+ mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+ echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+ fi
+}
+
+EXTRACONFFUNCS ??= ""
+
+EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
+
+do_configure[prefuncs] += "autotools_preconfigure autotools_aclocals ${EXTRACONFFUNCS}"
+do_configure[postfuncs] += "autotools_postconfigure"
+
+ACLOCALDIR = "${STAGING_DATADIR}/aclocal"
+ACLOCALEXTRAPATH = ""
+ACLOCALEXTRAPATH_class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
+ACLOCALEXTRAPATH_class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
+
+python autotools_aclocals () {
+ # Refresh variable with cache files
+ d.setVar("CONFIG_SITE", siteinfo_get_files(d, sysrootcache=True))
+}
+
+CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in ${S}/acinclude.m4 Makefile.am"
+
+autotools_do_configure() {
+ # WARNING: gross hack follows:
+ # An autotools built package generally needs these scripts, however only
+ # automake or libtoolize actually install the current versions of them.
+ # This is a problem in builds that do not use libtool or automake, in the case
+ # where we -need- the latest version of these scripts. e.g. running a build
+ # for a package whose autotools are old, on an x86_64 machine, which the old
+ # config.sub does not support. Work around this by installing them manually
+ # regardless.
+
+ PRUNE_M4=""
+
+ for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
+ rm -f `dirname $ac`/configure
+ done
+ if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
+ olddir=`pwd`
+ cd ${AUTOTOOLS_SCRIPT_PATH}
+ mkdir -p ${ACLOCALDIR}
+ ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
+ if [ x"${acpaths}" = xdefault ]; then
+ acpaths=
+ for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
+ grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
+ acpaths="$acpaths -I $i"
+ done
+ else
+ acpaths="${acpaths}"
+ fi
+ acpaths="$acpaths ${ACLOCALEXTRAPATH}"
+ AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'`
+ automake --version
+ echo "AUTOV is $AUTOV"
+ if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
+ ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
+ fi
+ # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
+ # like it was auto-generated. Work around this by blowing it away
+ # by hand, unless the package specifically asked not to run aclocal.
+ if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
+ rm -f aclocal.m4
+ fi
+ if [ -e configure.in ]; then
+ CONFIGURE_AC=configure.in
+ else
+ CONFIGURE_AC=configure.ac
+ fi
+ if grep -q "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC; then
+ if grep -q "sed.*POTFILES" $CONFIGURE_AC; then
+ : do nothing -- we still have an old unmodified configure.ac
+ else
+ bbnote Executing glib-gettextize --force --copy
+ echo "no" | glib-gettextize --force --copy
+ fi
+ elif [ "${BPN}" != "gettext" ] && grep -q "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC; then
+ # We'd call gettextize here if it wasn't so broken...
+ cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
+ if [ -d ${S}/po/ ]; then
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
+ if [ ! -e ${S}/po/remove-potcdate.sin ]; then
+ cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
+ fi
+ fi
+ PRUNE_M4="$PRUNE_M4 gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4"
+ fi
+ mkdir -p m4
+ if grep -q "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC; then
+ if ! echo "${DEPENDS}" | grep -q intltool-native; then
+ bbwarn "Missing DEPENDS on intltool-native"
+ fi
+ PRUNE_M4="$PRUNE_M4 intltool.m4"
+ bbnote Executing intltoolize --copy --force --automake
+ intltoolize --copy --force --automake
+ fi
+
+ for i in $PRUNE_M4; do
+ find ${S} -ignore_readdir_race -name $i -delete
+ done
+
+ bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
+ ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
+ cd $olddir
+ fi
+ if [ -e ${CONFIGURE_SCRIPT} ]; then
+ oe_runconf
+ else
+ bbnote "nothing to configure"
+ fi
+}
+
+autotools_do_compile() {
+ oe_runmake
+}
+
+autotools_do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+}
+
+inherit siteconfig
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
+
+B = "${WORKDIR}/build"
diff --git a/poky/meta/classes/base.bbclass b/poky/meta/classes/base.bbclass
new file mode 100644
index 000000000..bb1f4b753
--- /dev/null
+++ b/poky/meta/classes/base.bbclass
@@ -0,0 +1,704 @@
+BB_DEFAULT_TASK ?= "build"
+CLASSOVERRIDE ?= "class-target"
+
+inherit patch
+inherit staging
+
+inherit mirrors
+inherit utils
+inherit utility-tasks
+inherit metadata_scm
+inherit logging
+
+OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license"
+OE_IMPORTS[type] = "list"
+
+def oe_import(d):
+ import sys
+
+ bbpath = d.getVar("BBPATH").split(":")
+ sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
+
+ def inject(name, value):
+ """Make a python object accessible from the metadata"""
+ if hasattr(bb.utils, "_context"):
+ bb.utils._context[name] = value
+ else:
+ __builtins__[name] = value
+
+ import oe.data
+ for toimport in oe.data.typed_value("OE_IMPORTS", d):
+ imported = __import__(toimport)
+ inject(toimport.split(".", 1)[0], imported)
+
+ return ""
+
+# We need the oe module name space early (before INHERITs get added)
+OE_IMPORTED := "${@oe_import(d)}"
+
+def lsb_distro_identifier(d):
+ adjust = d.getVar('LSB_DISTRO_ADJUST')
+ adjust_func = None
+ if adjust:
+ try:
+ adjust_func = globals()[adjust]
+ except KeyError:
+ pass
+ return oe.lsb.distro_identifier(adjust_func)
+
+die() {
+ bbfatal_log "$*"
+}
+
+oe_runmake_call() {
+ bbnote ${MAKE} ${EXTRA_OEMAKE} "$@"
+ ${MAKE} ${EXTRA_OEMAKE} "$@"
+}
+
+oe_runmake() {
+ oe_runmake_call "$@" || die "oe_runmake failed"
+}
+
+
+def base_dep_prepend(d):
+ if d.getVar('INHIBIT_DEFAULT_DEPS', False):
+ return ""
+ return "${BASE_DEFAULT_DEPS}"
+
+BASE_DEFAULT_DEPS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
+
+BASEDEPENDS = ""
+BASEDEPENDS_class-target = "${@base_dep_prepend(d)}"
+BASEDEPENDS_class-nativesdk = "${@base_dep_prepend(d)}"
+
+DEPENDS_prepend="${BASEDEPENDS} "
+
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
+# THISDIR only works properly with imediate expansion as it has to run
+# in the context of the location its used (:=)
+THISDIR = "${@os.path.dirname(d.getVar('FILE'))}"
+
+def extra_path_elements(d):
+ path = ""
+ elements = (d.getVar('EXTRANATIVEPATH') or "").split()
+ for e in elements:
+ path = path + "${STAGING_BINDIR_NATIVE}/" + e + ":"
+ return path
+
+PATH_prepend = "${@extra_path_elements(d)}"
+
+def get_lic_checksum_file_list(d):
+ filelist = []
+ lic_files = d.getVar("LIC_FILES_CHKSUM") or ''
+ tmpdir = d.getVar("TMPDIR")
+ s = d.getVar("S")
+ b = d.getVar("B")
+ workdir = d.getVar("WORKDIR")
+
+ urls = lic_files.split()
+ for url in urls:
+ # We only care about items that are absolute paths since
+ # any others should be covered by SRC_URI.
+ try:
+ path = bb.fetch.decodeurl(url)[2]
+ if not path:
+ raise bb.fetch.MalformedUrl(url)
+
+ if path[0] == '/':
+ if path.startswith((tmpdir, s, b, workdir)):
+ continue
+ filelist.append(path + ":" + str(os.path.exists(path)))
+ except bb.fetch.MalformedUrl:
+ bb.fatal(d.getVar('PN') + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+ return " ".join(filelist)
+
+def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
+ tools = d.getVar(toolsvar).split()
+ origbbenv = d.getVar("BB_ORIGENV", False)
+ path = origbbenv.getVar("PATH")
+ bb.utils.mkdirhier(dest)
+ notfound = []
+ for tool in tools:
+ desttool = os.path.join(dest, tool)
+ if not os.path.exists(desttool):
+ srctool = bb.utils.which(path, tool, executable=True)
+ if "ccache" in srctool:
+ srctool = bb.utils.which(path, tool, executable=True, direction=1)
+ if srctool:
+ os.symlink(srctool, desttool)
+ else:
+ notfound.append(tool)
+ if notfound and fatal:
+ bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % " ".join(notfound))
+
+addtask fetch
+do_fetch[dirs] = "${DL_DIR}"
+do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
+do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"
+do_fetch[vardeps] += "SRCREV"
+python base_do_fetch() {
+
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.download()
+ except bb.fetch2.BBFetchException as e:
+ bb.fatal(str(e))
+}
+
+addtask unpack after do_fetch
+do_unpack[dirs] = "${WORKDIR}"
+
+do_unpack[cleandirs] = "${@d.getVar('S') if d.getVar('S') != d.getVar('WORKDIR') else os.path.join('${S}', 'patches')}"
+
+python base_do_unpack() {
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.unpack(d.getVar('WORKDIR'))
+ except bb.fetch2.BBFetchException as e:
+ bb.fatal(str(e))
+}
+
+def get_layers_branch_rev(d):
+ layers = (d.getVar("BBLAYERS") or "").split()
+ layers_branch_rev = ["%-20s = \"%s:%s\"" % (os.path.basename(i), \
+ base_get_metadata_git_branch(i, None).strip(), \
+ base_get_metadata_git_revision(i, None)) \
+ for i in layers]
+ i = len(layers_branch_rev)-1
+ p1 = layers_branch_rev[i].find("=")
+ s1 = layers_branch_rev[i][p1:]
+ while i > 0:
+ p2 = layers_branch_rev[i-1].find("=")
+ s2= layers_branch_rev[i-1][p2:]
+ if s1 == s2:
+ layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
+ i -= 1
+ else:
+ i -= 1
+ p1 = layers_branch_rev[i].find("=")
+ s1= layers_branch_rev[i][p1:]
+ return layers_branch_rev
+
+
+BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
+BUILDCFG_FUNCS[type] = "list"
+
+def buildcfg_vars(d):
+ statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
+ for var in statusvars:
+ value = d.getVar(var)
+ if value is not None:
+ yield '%-20s = "%s"' % (var, value)
+
+def buildcfg_neededvars(d):
+ needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
+ pesteruser = []
+ for v in needed_vars:
+ val = d.getVar(v)
+ if not val or val == 'INVALID':
+ pesteruser.append(v)
+
+ if pesteruser:
+ bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+
+addhandler base_eventhandler
+base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.MultiConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.runqueue.sceneQueueComplete bb.event.RecipeParsed"
+python base_eventhandler() {
+ import bb.runqueue
+
+ if isinstance(e, bb.event.ConfigParsed):
+ if not d.getVar("NATIVELSBSTRING", False):
+ d.setVar("NATIVELSBSTRING", lsb_distro_identifier(d))
+ d.setVar('BB_VERSION', bb.__version__)
+ # Works with the line in layer.conf which changes PATH to point here
+ setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS', d)
+ setup_hosttools_dir(d.getVar('HOSTTOOLS_DIR'), 'HOSTTOOLS_NONFATAL', d, fatal=False)
+
+ if isinstance(e, bb.event.MultiConfigParsed):
+ # We need to expand SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS in each of the multiconfig data stores
+ # own contexts so the variables get expanded correctly for that arch, then inject back into
+ # the main data store.
+ deps = []
+ for config in e.mcdata:
+ deps.append(e.mcdata[config].getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS"))
+ deps = " ".join(deps)
+ e.mcdata[''].setVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", deps)
+
+ if isinstance(e, bb.event.BuildStarted):
+ localdata = bb.data.createCopy(d)
+ statuslines = []
+ for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
+ g = globals()
+ if func not in g:
+ bb.warn("Build configuration function '%s' does not exist" % func)
+ else:
+ flines = g[func](localdata)
+ if flines:
+ statuslines.extend(flines)
+
+ statusheader = d.getVar('BUILDCFG_HEADER')
+ if statusheader:
+ bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
+
+ # This code is to silence warnings where the SDK variables overwrite the
+ # target ones and we'd see dulpicate key names overwriting each other
+ # for various PREFERRED_PROVIDERS
+ if isinstance(e, bb.event.RecipePreFinalise):
+ if d.getVar("TARGET_PREFIX") == d.getVar("SDK_PREFIX"):
+ d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils")
+ d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial")
+ d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc")
+ d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++")
+ d.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs")
+
+ if isinstance(e, bb.runqueue.sceneQueueComplete):
+ completions = d.expand("${STAGING_DIR}/sstatecompletions")
+ if os.path.exists(completions):
+ cmds = set()
+ with open(completions, "r") as f:
+ cmds = set(f)
+ d.setVar("completion_function", "\n".join(cmds))
+ d.setVarFlag("completion_function", "func", "1")
+ bb.debug(1, "Executing SceneQueue Completion commands: %s" % "\n".join(cmds))
+ bb.build.exec_func("completion_function", d)
+ os.remove(completions)
+
+ if isinstance(e, bb.event.RecipeParsed):
+ #
+ # If we have multiple providers of virtual/X and a PREFERRED_PROVIDER_virtual/X is set
+ # skip parsing for all the other providers which will mean they get uninstalled from the
+ # sysroot since they're now "unreachable". This makes switching virtual/kernel work in
+ # particular.
+ #
+ pn = d.getVar('PN')
+ source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False)
+ if not source_mirror_fetch:
+ provs = (d.getVar("PROVIDES") or "").split()
+ multiwhitelist = (d.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
+ for p in provs:
+ if p.startswith("virtual/") and p not in multiwhitelist:
+ profprov = d.getVar("PREFERRED_PROVIDER_" + p)
+ if profprov and pn != profprov:
+ raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (p, profprov, pn))
+}
+
+CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
+CLEANBROKEN = "0"
+
+addtask configure after do_patch
+do_configure[dirs] = "${B}"
+do_prepare_recipe_sysroot[deptask] = "do_populate_sysroot"
+base_do_configure() {
+ if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+ if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+ cd ${B}
+ if [ "${CLEANBROKEN}" != "1" -a \( -e Makefile -o -e makefile -o -e GNUmakefile \) ]; then
+ oe_runmake clean
+ fi
+ find ${B} -ignore_readdir_race -name \*.la -delete
+ fi
+ fi
+ if [ -n "${CONFIGURESTAMPFILE}" ]; then
+ mkdir -p `dirname ${CONFIGURESTAMPFILE}`
+ echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+ fi
+}
+
+addtask compile after do_configure
+do_compile[dirs] = "${B}"
+base_do_compile() {
+ if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+ oe_runmake || die "make failed"
+ else
+ bbnote "nothing to compile"
+ fi
+}
+
+addtask install after do_compile
+do_install[dirs] = "${B}"
+# Remove and re-create ${D} so that is it guaranteed to be empty
+do_install[cleandirs] = "${D}"
+
+base_do_install() {
+ :
+}
+
+base_do_package() {
+ :
+}
+
+addtask build after do_populate_sysroot
+do_build[noexec] = "1"
+do_build[recrdeptask] += "do_deploy"
+do_build () {
+ :
+}
+
+def set_packagetriplet(d):
+ archs = []
+ tos = []
+ tvs = []
+
+ archs.append(d.getVar("PACKAGE_ARCHS").split())
+ tos.append(d.getVar("TARGET_OS"))
+ tvs.append(d.getVar("TARGET_VENDOR"))
+
+ def settriplet(d, varname, archs, tos, tvs):
+ triplets = []
+ for i in range(len(archs)):
+ for arch in archs[i]:
+ triplets.append(arch + tvs[i] + "-" + tos[i])
+ triplets.reverse()
+ d.setVar(varname, " ".join(triplets))
+
+ settriplet(d, "PKGTRIPLETS", archs, tos, tvs)
+
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+
+ archs.append(localdata.getVar("PACKAGE_ARCHS").split())
+ tos.append(localdata.getVar("TARGET_OS"))
+ tvs.append(localdata.getVar("TARGET_VENDOR"))
+
+ settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs)
+
+python () {
+ import string, re
+
+ # Handle backfilling
+ oe.utils.features_backfill("DISTRO_FEATURES", d)
+ oe.utils.features_backfill("MACHINE_FEATURES", d)
+
+ # Handle PACKAGECONFIG
+ #
+ # These take the form:
+ #
+ # PACKAGECONFIG ??= "<default options>"
+ # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends"
+ pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+ if pkgconfigflags:
+ pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+ pn = d.getVar("PN")
+
+ mlprefix = d.getVar("MLPREFIX")
+
+ def expandFilter(appends, extension, prefix):
+ appends = bb.utils.explode_deps(d.expand(" ".join(appends)))
+ newappends = []
+ for a in appends:
+ if a.endswith("-native") or ("-cross-" in a):
+ newappends.append(a)
+ elif a.startswith("virtual/"):
+ subs = a.split("/", 1)[1]
+ if subs.startswith(prefix):
+ newappends.append(a + extension)
+ else:
+ newappends.append("virtual/" + prefix + subs + extension)
+ else:
+ if a.startswith(prefix):
+ newappends.append(a + extension)
+ else:
+ newappends.append(prefix + a + extension)
+ return newappends
+
+ def appendVar(varname, appends):
+ if not appends:
+ return
+ if varname.find("DEPENDS") != -1:
+ if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross-canadian', d) :
+ appends = expandFilter(appends, "", "nativesdk-")
+ elif bb.data.inherits_class('native', d):
+ appends = expandFilter(appends, "-native", "")
+ elif mlprefix:
+ appends = expandFilter(appends, "", mlprefix)
+ varname = d.expand(varname)
+ d.appendVar(varname, " " + " ".join(appends))
+
+ extradeps = []
+ extrardeps = []
+ extrarrecs = []
+ extraconf = []
+ for flag, flagval in sorted(pkgconfigflags.items()):
+ items = flagval.split(",")
+ num = len(items)
+ if num > 5:
+ bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend can be specified!"
+ % (d.getVar('PN'), flag))
+
+ if flag in pkgconfig:
+ if num >= 3 and items[2]:
+ extradeps.append(items[2])
+ if num >= 4 and items[3]:
+ extrardeps.append(items[3])
+ if num >= 5 and items[4]:
+ extrarrecs.append(items[4])
+ if num >= 1 and items[0]:
+ extraconf.append(items[0])
+ elif num >= 2 and items[1]:
+ extraconf.append(items[1])
+ appendVar('DEPENDS', extradeps)
+ appendVar('RDEPENDS_${PN}', extrardeps)
+ appendVar('RRECOMMENDS_${PN}', extrarrecs)
+ appendVar('PACKAGECONFIG_CONFARGS', extraconf)
+
+ pn = d.getVar('PN')
+ license = d.getVar('LICENSE')
+ if license == "INVALID" and pn != "defaultpkgname":
+ bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
+
+ if bb.data.inherits_class('license', d):
+ check_license_format(d)
+ unmatched_license_flag = check_license_flags(d)
+ if unmatched_license_flag:
+ bb.debug(1, "Skipping %s because it has a restricted license not"
+ " whitelisted in LICENSE_FLAGS_WHITELIST" % pn)
+ raise bb.parse.SkipRecipe("because it has a restricted license not"
+ " whitelisted in LICENSE_FLAGS_WHITELIST")
+
+ # If we're building a target package we need to use fakeroot (pseudo)
+ # in order to capture permissions, owners, groups and special files
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ d.setVarFlag('do_unpack', 'umask', '022')
+ d.setVarFlag('do_configure', 'umask', '022')
+ d.setVarFlag('do_compile', 'umask', '022')
+ d.appendVarFlag('do_install', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+ d.setVarFlag('do_install', 'fakeroot', '1')
+ d.setVarFlag('do_install', 'umask', '022')
+ d.appendVarFlag('do_package', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+ d.setVarFlag('do_package', 'fakeroot', '1')
+ d.setVarFlag('do_package', 'umask', '022')
+ d.setVarFlag('do_package_setscene', 'fakeroot', '1')
+ d.appendVarFlag('do_package_setscene', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+ d.setVarFlag('do_devshell', 'fakeroot', '1')
+ d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+
+ need_machine = d.getVar('COMPATIBLE_MACHINE')
+ if need_machine:
+ import re
+ compat_machines = (d.getVar('MACHINEOVERRIDES') or "").split(":")
+ for m in compat_machines:
+ if re.match(need_machine, m):
+ break
+ else:
+ raise bb.parse.SkipRecipe("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE'))
+
+ source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False)
+ if not source_mirror_fetch:
+ need_host = d.getVar('COMPATIBLE_HOST')
+ if need_host:
+ import re
+ this_host = d.getVar('HOST_SYS')
+ if not re.match(need_host, this_host):
+ raise bb.parse.SkipRecipe("incompatible with host %s (not in COMPATIBLE_HOST)" % this_host)
+
+ bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
+
+ check_license = False if pn.startswith("nativesdk-") else True
+ for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}",
+ "-crosssdk-${SDK_SYS}", "-crosssdk-initial-${SDK_SYS}",
+ "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
+ if pn.endswith(d.expand(t)):
+ check_license = False
+ if pn.startswith("gcc-source-"):
+ check_license = False
+
+ if check_license and bad_licenses:
+ bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+
+ whitelist = []
+ incompatwl = []
+ for lic in bad_licenses:
+ spdx_license = return_spdx(d, lic)
+ for w in ["LGPLv2_WHITELIST_", "WHITELIST_"]:
+ whitelist.extend((d.getVar(w + lic) or "").split())
+ if spdx_license:
+ whitelist.extend((d.getVar(w + spdx_license) or "").split())
+ '''
+ We need to track what we are whitelisting and why. If pn is
+ incompatible we need to be able to note that the image that
+ is created may infact contain incompatible licenses despite
+ INCOMPATIBLE_LICENSE being set.
+ '''
+ incompatwl.extend((d.getVar(w + lic) or "").split())
+ if spdx_license:
+ incompatwl.extend((d.getVar(w + spdx_license) or "").split())
+
+ if not pn in whitelist:
+ pkgs = d.getVar('PACKAGES').split()
+ skipped_pkgs = []
+ unskipped_pkgs = []
+ for pkg in pkgs:
+ if incompatible_license(d, bad_licenses, pkg):
+ skipped_pkgs.append(pkg)
+ else:
+ unskipped_pkgs.append(pkg)
+ all_skipped = skipped_pkgs and not unskipped_pkgs
+ if unskipped_pkgs:
+ for pkg in skipped_pkgs:
+ bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + license)
+ mlprefix = d.getVar('MLPREFIX')
+ d.setVar('LICENSE_EXCLUSION-' + mlprefix + pkg, 1)
+ for pkg in unskipped_pkgs:
+ bb.debug(1, "INCLUDING the package " + pkg)
+ elif all_skipped or incompatible_license(d, bad_licenses):
+ bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, license))
+ raise bb.parse.SkipRecipe("it has an incompatible license: %s" % license)
+ elif pn in whitelist:
+ if pn in incompatwl:
+ bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+
+ # Try to verify per-package (LICENSE_<pkg>) values. LICENSE should be a
+ # superset of all per-package licenses. We do not do advanced (pattern)
+ # matching of license expressions - just check that all license strings
+ # in LICENSE_<pkg> are found in LICENSE.
+ license_set = oe.license.list_licenses(license)
+ for pkg in d.getVar('PACKAGES').split():
+ pkg_license = d.getVar('LICENSE_' + pkg)
+ if pkg_license:
+ unlisted = oe.license.list_licenses(pkg_license) - license_set
+ if unlisted:
+ bb.warn("LICENSE_%s includes licenses (%s) that are not "
+ "listed in LICENSE" % (pkg, ' '.join(unlisted)))
+
+ needsrcrev = False
+ srcuri = d.getVar('SRC_URI')
+ for uri in srcuri.split():
+ (scheme, _ , path) = bb.fetch.decodeurl(uri)[:3]
+
+ # HTTP/FTP use the wget fetcher
+ if scheme in ("http", "https", "ftp"):
+ d.appendVarFlag('do_fetch', 'depends', ' wget-native:do_populate_sysroot')
+
+ # Svn packages should DEPEND on subversion-native
+ if scheme == "svn":
+ needsrcrev = True
+ d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
+
+ # Git packages should DEPEND on git-native
+ elif scheme in ("git", "gitsm"):
+ needsrcrev = True
+ d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
+
+ # Mercurial packages should DEPEND on mercurial-native
+ elif scheme == "hg":
+ needsrcrev = True
+ d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
+
+ # Perforce packages support SRCREV = "${AUTOREV}"
+ elif scheme == "p4":
+ needsrcrev = True
+
+ # OSC packages should DEPEND on osc-native
+ elif scheme == "osc":
+ d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
+
+ elif scheme == "npm":
+ d.appendVarFlag('do_fetch', 'depends', ' nodejs-native:do_populate_sysroot')
+
+ # *.lz4 should DEPEND on lz4-native for unpacking
+ if path.endswith('.lz4'):
+ d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot')
+
+ # *.lz should DEPEND on lzip-native for unpacking
+ elif path.endswith('.lz'):
+ d.appendVarFlag('do_unpack', 'depends', ' lzip-native:do_populate_sysroot')
+
+ # *.xz should DEPEND on xz-native for unpacking
+ elif path.endswith('.xz') or path.endswith('.txz'):
+ d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+ # .zip should DEPEND on unzip-native for unpacking
+ elif path.endswith('.zip') or path.endswith('.jar'):
+ d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+
+ # file is needed by rpm2cpio.sh
+ elif path.endswith('.rpm'):
+ d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+ # *.deb should DEPEND on xz-native for unpacking
+ elif path.endswith('.deb'):
+ d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+ if needsrcrev:
+ d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+
+ set_packagetriplet(d)
+
+ # 'multimachine' handling
+ mach_arch = d.getVar('MACHINE_ARCH')
+ pkg_arch = d.getVar('PACKAGE_ARCH')
+
+ if (pkg_arch == mach_arch):
+ # Already machine specific - nothing further to do
+ return
+
+ #
+ # We always try to scan SRC_URI for urls with machine overrides
+ # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+ #
+ override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH')
+ if override != '0':
+ paths = []
+ fpaths = (d.getVar('FILESPATH') or '').split(':')
+ machine = d.getVar('MACHINE')
+ for p in fpaths:
+ if os.path.basename(p) == machine and os.path.isdir(p):
+ paths.append(p)
+
+ if len(paths) != 0:
+ for s in srcuri.split():
+ if not s.startswith("file://"):
+ continue
+ fetcher = bb.fetch2.Fetch([s], d)
+ local = fetcher.localpath(s)
+ for mp in paths:
+ if local.startswith(mp):
+ #bb.note("overriding PACKAGE_ARCH from %s to %s for %s" % (pkg_arch, mach_arch, pn))
+ d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
+ return
+
+ packages = d.getVar('PACKAGES').split()
+ for pkg in packages:
+ pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg)
+
+ # We could look for != PACKAGE_ARCH here but how to choose
+ # if multiple differences are present?
+ # Look through PACKAGE_ARCHS for the priority order?
+ if pkgarch and pkgarch == mach_arch:
+ d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
+ bb.warn("Recipe %s is marked as only being architecture specific but seems to have machine specific packages?! The recipe may as well mark itself as machine specific directly." % d.getVar("PN"))
+}
+
+addtask cleansstate after do_clean
+python do_cleansstate() {
+ sstate_clean_cachefiles(d)
+}
+addtask cleanall after do_cleansstate
+do_cleansstate[nostamp] = "1"
+
+python do_cleanall() {
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.clean()
+ except bb.fetch2.BBFetchException as e:
+ bb.fatal(str(e))
+}
+do_cleanall[nostamp] = "1"
+
+
+EXPORT_FUNCTIONS do_fetch do_unpack do_configure do_compile do_install do_package
diff --git a/poky/meta/classes/bash-completion.bbclass b/poky/meta/classes/bash-completion.bbclass
new file mode 100644
index 000000000..80ee9b487
--- /dev/null
+++ b/poky/meta/classes/bash-completion.bbclass
@@ -0,0 +1,7 @@
+DEPENDS_append_class-target = " bash-completion"
+
+PACKAGES += "${PN}-bash-completion"
+
+FILES_${PN}-bash-completion = "${datadir}/bash-completion ${sysconfdir}/bash_completion.d"
+
+RDEPENDS_${PN}-bash-completion = "bash-completion"
diff --git a/poky/meta/classes/bin_package.bbclass b/poky/meta/classes/bin_package.bbclass
new file mode 100644
index 000000000..cbc9b1fa1
--- /dev/null
+++ b/poky/meta/classes/bin_package.bbclass
@@ -0,0 +1,39 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Common variable and task for the binary package recipe.
+# Basic principle:
+# * The files have been unpacked to ${S} by base.bbclass
+# * Skip do_configure and do_compile
+# * Use do_install to install the files to ${D}
+#
+# Note:
+# The "subdir" parameter in the SRC_URI is useful when the input package
+# is rpm, ipk, deb and so on, for example:
+#
+# SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0"
+#
+# Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise
+# they would be in ${WORKDIR}.
+#
+
+# Skip the unwanted steps
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+# Install the files to ${D}
+bin_package_do_install () {
+ # Do it carefully
+ [ -d "${S}" ] || exit 1
+ if [ -z "$(ls -A ${S})" ]; then
+ bbfatal bin_package has nothing to install. Be sure the SRC_URI unpacks into S.
+ fi
+ cd ${S}
+ tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
+ | tar --no-same-owner -xpf - -C ${D}
+}
+
+FILES_${PN} = "/"
+
+EXPORT_FUNCTIONS do_install
diff --git a/poky/meta/classes/binconfig-disabled.bbclass b/poky/meta/classes/binconfig-disabled.bbclass
new file mode 100644
index 000000000..096b670e1
--- /dev/null
+++ b/poky/meta/classes/binconfig-disabled.bbclass
@@ -0,0 +1,30 @@
+#
+# Class to disable binconfig files instead of installing them
+#
+
+# The list of scripts which should be disabled.
+BINCONFIG ?= ""
+
+FILES_${PN}-dev += "${bindir}/*-config"
+
+do_install_append () {
+ for x in ${BINCONFIG}; do
+ # Make the disabled script emit invalid parameters for those configure
+ # scripts which call it without checking the return code.
+ echo "#!/bin/sh" > ${D}$x
+ echo "echo 'ERROR: $x should not be used, use an alternative such as pkg-config' >&2" >> ${D}$x
+ echo "echo '--should-not-have-used-$x'" >> ${D}$x
+ echo "exit 1" >> ${D}$x
+ chmod +x ${D}$x
+ done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
+
+binconfig_disabled_sysroot_preprocess () {
+ for x in ${BINCONFIG}; do
+ configname=`basename $x`
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+ install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
+ done
+}
diff --git a/poky/meta/classes/binconfig.bbclass b/poky/meta/classes/binconfig.bbclass
new file mode 100644
index 000000000..39c3e2b17
--- /dev/null
+++ b/poky/meta/classes/binconfig.bbclass
@@ -0,0 +1,63 @@
+FILES_${PN}-dev += "${bindir}/*-config"
+
+# The namespaces can clash here hence the two step replace
+def get_binconfig_mangle(d):
+ s = "-e ''"
+ if not bb.data.inherits_class('native', d):
+ optional_quote = r"\(\"\?\)"
+ s += " -e 's:=%s${base_libdir}:=\\1OEBASELIBDIR:;'" % optional_quote
+ s += " -e 's:=%s${libdir}:=\\1OELIBDIR:;'" % optional_quote
+ s += " -e 's:=%s${includedir}:=\\1OEINCDIR:;'" % optional_quote
+ s += " -e 's:=%s${datadir}:=\\1OEDATADIR:'" % optional_quote
+ s += " -e 's:=%s${prefix}/:=\\1OEPREFIX/:'" % optional_quote
+ s += " -e 's:=%s${exec_prefix}/:=\\1OEEXECPREFIX/:'" % optional_quote
+ s += " -e 's:-L${libdir}:-LOELIBDIR:;'"
+ s += " -e 's:-I${includedir}:-IOEINCDIR:;'"
+ s += " -e 's:-L${WORKDIR}:-LOELIBDIR:'"
+ s += " -e 's:-I${WORKDIR}:-IOEINCDIR:'"
+ s += " -e 's:OEBASELIBDIR:${STAGING_BASELIBDIR}:;'"
+ s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
+ s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
+ s += " -e 's:OEDATADIR:${STAGING_DATADIR}:'"
+ s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${prefix}:'"
+ s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${exec_prefix}:'"
+ if d.getVar("OE_BINCONFIG_EXTRA_MANGLE", False):
+ s += d.getVar("OE_BINCONFIG_EXTRA_MANGLE")
+
+ return s
+
+BINCONFIG_GLOB ?= "*-config"
+
+PACKAGE_PREPROCESS_FUNCS += "binconfig_package_preprocess"
+
+binconfig_package_preprocess () {
+ for config in `find ${PKGD} -name '${BINCONFIG_GLOB}'`; do
+ sed -i \
+ -e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
+ -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+ -e 's:${STAGING_INCDIR}:${includedir}:g;' \
+ -e 's:${STAGING_DATADIR}:${datadir}:' \
+ -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
+ $config
+ done
+ for lafile in `find ${PKGD} -name "*.la"` ; do
+ sed -i \
+ -e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
+ -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+ -e 's:${STAGING_INCDIR}:${includedir}:g;' \
+ -e 's:${STAGING_DATADIR}:${datadir}:' \
+ -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
+ $lafile
+ done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_sysroot_preprocess"
+
+binconfig_sysroot_preprocess () {
+ for config in `find ${S} -name '${BINCONFIG_GLOB}'` `find ${B} -name '${BINCONFIG_GLOB}'`; do
+ configname=`basename $config`
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+ sed ${@get_binconfig_mangle(d)} $config > ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
+ chmod u+x ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
+ done
+}
diff --git a/poky/meta/classes/blacklist.bbclass b/poky/meta/classes/blacklist.bbclass
new file mode 100644
index 000000000..dc794228f
--- /dev/null
+++ b/poky/meta/classes/blacklist.bbclass
@@ -0,0 +1,20 @@
+# anonymous support class from originally from angstrom
+#
+# To use the blacklist, a distribution should include this
+# class in the INHERIT_DISTRO
+#
+# No longer use ANGSTROM_BLACKLIST, instead use a table of
+# recipes in PNBLACKLIST
+#
+# Features:
+#
+# * To add a package to the blacklist, set:
+# PNBLACKLIST[pn] = "message"
+#
+
+python () {
+ blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN'))
+
+ if blacklist:
+ raise bb.parse.SkipRecipe("Recipe is blacklisted: %s" % (blacklist))
+}
diff --git a/poky/meta/classes/bluetooth.bbclass b/poky/meta/classes/bluetooth.bbclass
new file mode 100644
index 000000000..f88b4ae5b
--- /dev/null
+++ b/poky/meta/classes/bluetooth.bbclass
@@ -0,0 +1,14 @@
+# Avoid code duplication in bluetooth-dependent recipes.
+
+# Define a variable that expands to the recipe (package) providing core
+# bluetooth support on the platform:
+# "" if bluetooth is not in DISTRO_FEATURES
+# else "bluez5" if bluez5 is in DISTRO_FEATURES
+# else "bluez4"
+
+# Use this with:
+# inherit bluetooth
+# PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}
+# PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4"
+
+BLUEZ ?= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez5', 'bluez4', d), '', d)}"
diff --git a/poky/meta/classes/bugzilla.bbclass b/poky/meta/classes/bugzilla.bbclass
new file mode 100644
index 000000000..8909c2734
--- /dev/null
+++ b/poky/meta/classes/bugzilla.bbclass
@@ -0,0 +1,187 @@
+#
+# Small event handler to automatically open URLs and file
+# bug reports at a bugzilla of your choiche
+# it uses XML-RPC interface, so you must have it enabled
+#
+# Before using you must define BUGZILLA_USER, BUGZILLA_PASS credentials,
+# BUGZILLA_XMLRPC - uri of xmlrpc.cgi,
+# BUGZILLA_PRODUCT, BUGZILLA_COMPONENT - a place in BTS for build bugs
+# BUGZILLA_VERSION - version against which to report new bugs
+#
+
+def bugzilla_find_bug_report(debug_file, server, args, bugname):
+ args['summary'] = bugname
+ bugs = server.Bug.search(args)
+ if len(bugs['bugs']) == 0:
+ print >> debug_file, "Bugs not found"
+ return (False,None)
+ else: # silently pick the first result
+ print >> debug_file, "Result of bug search is "
+ print >> debug_file, bugs
+ status = bugs['bugs'][0]['status']
+ id = bugs['bugs'][0]['id']
+ return (not status in ["CLOSED", "RESOLVED", "VERIFIED"],id)
+
+def bugzilla_file_bug(debug_file, server, args, name, text, version):
+ args['summary'] = name
+ args['comment'] = text
+ args['version'] = version
+ args['op_sys'] = 'Linux'
+ args['platform'] = 'Other'
+ args['severity'] = 'normal'
+ args['priority'] = 'Normal'
+ try:
+ return server.Bug.create(args)['id']
+ except Exception, e:
+ print >> debug_file, repr(e)
+ return None
+
+def bugzilla_reopen_bug(debug_file, server, args, bug_number):
+ args['ids'] = [bug_number]
+ args['status'] = "CONFIRMED"
+ try:
+ server.Bug.update(args)
+ return True
+ except Exception, e:
+ print >> debug_file, repr(e)
+ return False
+
+def bugzilla_create_attachment(debug_file, server, args, bug_number, text, file_name, log, logdescription):
+ args['ids'] = [bug_number]
+ args['file_name'] = file_name
+ args['summary'] = logdescription
+ args['content_type'] = "text/plain"
+ args['data'] = log
+ args['comment'] = text
+ try:
+ server.Bug.add_attachment(args)
+ return True
+ except Exception, e:
+ print >> debug_file, repr(e)
+ return False
+
+def bugzilla_add_comment(debug_file, server, args, bug_number, text):
+ args['id'] = bug_number
+ args['comment'] = text
+ try:
+ server.Bug.add_comment(args)
+ return True
+ except Exception, e:
+ print >> debug_file, repr(e)
+ return False
+
+addhandler bugzilla_eventhandler
+bugzilla_eventhandler[eventmask] = "bb.event.MsgNote bb.build.TaskFailed"
+python bugzilla_eventhandler() {
+ import glob
+ import xmlrpclib, httplib
+
+ class ProxiedTransport(xmlrpclib.Transport):
+ def __init__(self, proxy, use_datetime = 0):
+ xmlrpclib.Transport.__init__(self, use_datetime)
+ self.proxy = proxy
+ self.user = None
+ self.password = None
+
+ def set_user(self, user):
+ self.user = user
+
+ def set_password(self, password):
+ self.password = password
+
+ def make_connection(self, host):
+ self.realhost = host
+ return httplib.HTTP(self.proxy)
+
+ def send_request(self, connection, handler, request_body):
+ connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
+ if self.user != None:
+ if self.password != None:
+ auth = "%s:%s" % (self.user, self.password)
+ else:
+ auth = self.user
+ connection.putheader("Proxy-authorization", "Basic " + base64.encodestring(auth))
+
+ event = e
+ data = e.data
+ name = bb.event.getName(event)
+ if name == "MsgNote":
+ # avoid recursion
+ return
+
+ if name == "TaskFailed":
+ xmlrpc = data.getVar("BUGZILLA_XMLRPC")
+ user = data.getVar("BUGZILLA_USER")
+ passw = data.getVar("BUGZILLA_PASS")
+ product = data.getVar("BUGZILLA_PRODUCT")
+ compon = data.getVar("BUGZILLA_COMPONENT")
+ version = data.getVar("BUGZILLA_VERSION")
+
+ proxy = data.getVar('http_proxy')
+ if (proxy):
+ import urllib2
+ s, u, p, hostport = urllib2._parse_proxy(proxy)
+ transport = ProxiedTransport(hostport)
+ else:
+ transport = None
+
+ server = xmlrpclib.ServerProxy(xmlrpc, transport=transport, verbose=0)
+ args = {
+ 'Bugzilla_login': user,
+ 'Bugzilla_password': passw,
+ 'product': product,
+ 'component': compon}
+
+ # evil hack to figure out what is going on
+ debug_file = open(os.path.join(data.getVar("TMPDIR"),"..","bugzilla-log"),"a")
+
+ file = None
+ bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN"),
+ "pv" : data.getVar("PV"),
+ }
+ log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T'), event.task))
+ text = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN"), data.getVar('DATETIME'), data.getVar('MACHINE') )
+ if len(log_file) != 0:
+ print >> debug_file, "Adding log file %s" % log_file[0]
+ file = open(log_file[0], 'r')
+ log = file.read()
+ file.close();
+ else:
+ print >> debug_file, "No log file found for the glob"
+ log = None
+
+ (bug_open, bug_number) = bugzilla_find_bug_report(debug_file, server, args.copy(), bugname)
+ print >> debug_file, "Bug is open: %s and bug number: %s" % (bug_open, bug_number)
+
+ # The bug is present and still open, attach an error log
+ if not bug_number:
+ bug_number = bugzilla_file_bug(debug_file, server, args.copy(), bugname, text, version)
+ if not bug_number:
+ print >> debug_file, "Couldn't acquire a new bug_numer, filing a bugreport failed"
+ else:
+ print >> debug_file, "The new bug_number: '%s'" % bug_number
+ elif not bug_open:
+ if not bugzilla_reopen_bug(debug_file, server, args.copy(), bug_number):
+ print >> debug_file, "Failed to reopen the bug #%s" % bug_number
+ else:
+ print >> debug_file, "Reopened the bug #%s" % bug_number
+
+ if bug_number and log:
+ print >> debug_file, "The bug is known as '%s'" % bug_number
+ desc = "Build log for machine %s" % (data.getVar('MACHINE'))
+ if not bugzilla_create_attachment(debug_file, server, args.copy(), bug_number, text, log_file[0], log, desc):
+ print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number
+ else:
+ print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, compon, bug_number)
+ else:
+ print >> debug_file, "Not trying to create an attachment for bug #%s" % bug_number
+ if not bugzilla_add_comment(debug_file, server, args.copy(), bug_number, text, ):
+ print >> debug_file, "Failed to create a comment the build log for bug #%s" % bug_number
+ else:
+ print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, compon, bug_number)
+
+ # store bug number for oestats-client
+ if bug_number:
+ data.setVar('OESTATS_BUG_NUMBER', bug_number)
+}
+
diff --git a/poky/meta/classes/buildhistory.bbclass b/poky/meta/classes/buildhistory.bbclass
new file mode 100644
index 000000000..63980f72a
--- /dev/null
+++ b/poky/meta/classes/buildhistory.bbclass
@@ -0,0 +1,944 @@
+#
+# Records history of build output in order to detect regressions
+#
+# Based in part on testlab.bbclass and packagehistory.bbclass
+#
+# Copyright (C) 2011-2016 Intel Corporation
+# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org>
+#
+
+BUILDHISTORY_FEATURES ?= "image package sdk"
+BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory"
+BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}"
+BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}"
+
+# Setting this to non-empty will remove the old content of the buildhistory as part of
+# the current bitbake invocation and replace it with information about what was built
+# during the build.
+#
+# This is meant to be used in continuous integration (CI) systems when invoking bitbake
+# for full world builds. The effect in that case is that information about packages
+# that no longer get build also gets removed from the buildhistory, which is not
+# the case otherwise.
+#
+# The advantage over manually cleaning the buildhistory outside of bitbake is that
+# the "version-going-backwards" check still works. When relying on that, be careful
+# about failed world builds: they will lead to incomplete information in the
+# buildhistory because information about packages that could not be built will
+# also get removed. A CI system should handle that by discarding the buildhistory
+# of failed builds.
+#
+# The expected usage is via auto.conf, but passing via the command line also works
+# with: BB_ENV_EXTRAWHITE=BUILDHISTORY_RESET BUILDHISTORY_RESET=1
+BUILDHISTORY_RESET ?= ""
+
+BUILDHISTORY_OLD_DIR = "${BUILDHISTORY_DIR}/${@ "old" if "${BUILDHISTORY_RESET}" else ""}"
+BUILDHISTORY_OLD_DIR_PACKAGE = "${BUILDHISTORY_OLD_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}"
+BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}${SDK_EXT}/${IMAGE_BASENAME}"
+BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group"
+BUILDHISTORY_SDK_FILES ?= "conf/local.conf conf/bblayers.conf conf/auto.conf conf/locked-sigs.inc conf/devtool.conf"
+BUILDHISTORY_COMMIT ?= "1"
+BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
+BUILDHISTORY_PUSH_REPO ?= ""
+
+SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory"
+# We want to avoid influencing the signatures of sstate tasks - first the function itself:
+sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
+# then the value added to SSTATEPOSTINSTFUNCS:
+SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
+
+# Similarly for our function that gets the output signatures
+SSTATEPOSTUNPACKFUNCS_append = " buildhistory_emit_outputsigs"
+sstate_installpkgdir[vardepsexclude] += "buildhistory_emit_outputsigs"
+SSTATEPOSTUNPACKFUNCS[vardepvalueexclude] .= "| buildhistory_emit_outputsigs"
+
+# All items excepts those listed here will be removed from a recipe's
+# build history directory by buildhistory_emit_pkghistory(). This is
+# necessary because some of these items (package directories, files that
+# we no longer emit) might be obsolete.
+#
+# When extending build history, derive your class from buildhistory.bbclass
+# and extend this list here with the additional files created by the derived
+# class.
+BUILDHISTORY_PRESERVE = "latest latest_srcrev"
+
+PATCH_GIT_USER_EMAIL ?= "buildhistory@oe"
+PATCH_GIT_USER_NAME ?= "OpenEmbedded"
+
+#
+# Write out metadata about this package for comparison when writing future packages
+#
+python buildhistory_emit_pkghistory() {
+ if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
+ return 0
+
+ if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+ return 0
+
+ import re
+ import json
+ import errno
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
+ oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')
+
+ class RecipeInfo:
+ def __init__(self, name):
+ self.name = name
+ self.pe = "0"
+ self.pv = "0"
+ self.pr = "r0"
+ self.depends = ""
+ self.packages = ""
+ self.srcrev = ""
+ self.layer = ""
+
+
+ class PackageInfo:
+ def __init__(self, name):
+ self.name = name
+ self.pe = "0"
+ self.pv = "0"
+ self.pr = "r0"
+ # pkg/pkge/pkgv/pkgr should be empty because we want to be able to default them
+ self.pkg = ""
+ self.pkge = ""
+ self.pkgv = ""
+ self.pkgr = ""
+ self.size = 0
+ self.depends = ""
+ self.rprovides = ""
+ self.rdepends = ""
+ self.rrecommends = ""
+ self.rsuggests = ""
+ self.rreplaces = ""
+ self.rconflicts = ""
+ self.files = ""
+ self.filelist = ""
+ # Variables that need to be written to their own separate file
+ self.filevars = dict.fromkeys(['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm'])
+
+ # Should check PACKAGES here to see if anything removed
+
+ def readPackageInfo(pkg, histfile):
+ pkginfo = PackageInfo(pkg)
+ with open(histfile, "r") as f:
+ for line in f:
+ lns = line.split('=', 1)
+ name = lns[0].strip()
+ value = lns[1].strip(" \t\r\n").strip('"')
+ if name == "PE":
+ pkginfo.pe = value
+ elif name == "PV":
+ pkginfo.pv = value
+ elif name == "PR":
+ pkginfo.pr = value
+ elif name == "PKG":
+ pkginfo.pkg = value
+ elif name == "PKGE":
+ pkginfo.pkge = value
+ elif name == "PKGV":
+ pkginfo.pkgv = value
+ elif name == "PKGR":
+ pkginfo.pkgr = value
+ elif name == "RPROVIDES":
+ pkginfo.rprovides = value
+ elif name == "RDEPENDS":
+ pkginfo.rdepends = value
+ elif name == "RRECOMMENDS":
+ pkginfo.rrecommends = value
+ elif name == "RSUGGESTS":
+ pkginfo.rsuggests = value
+ elif name == "RREPLACES":
+ pkginfo.rreplaces = value
+ elif name == "RCONFLICTS":
+ pkginfo.rconflicts = value
+ elif name == "PKGSIZE":
+ pkginfo.size = int(value)
+ elif name == "FILES":
+ pkginfo.files = value
+ elif name == "FILELIST":
+ pkginfo.filelist = value
+ # Apply defaults
+ if not pkginfo.pkg:
+ pkginfo.pkg = pkginfo.name
+ if not pkginfo.pkge:
+ pkginfo.pkge = pkginfo.pe
+ if not pkginfo.pkgv:
+ pkginfo.pkgv = pkginfo.pv
+ if not pkginfo.pkgr:
+ pkginfo.pkgr = pkginfo.pr
+ return pkginfo
+
+ def getlastpkgversion(pkg):
+ try:
+ histfile = os.path.join(oldpkghistdir, pkg, "latest")
+ return readPackageInfo(pkg, histfile)
+ except EnvironmentError:
+ return None
+
+ def sortpkglist(string):
+ pkgiter = re.finditer(r'[a-zA-Z0-9.+-]+( \([><=]+[^)]+\))?', string, 0)
+ pkglist = [p.group(0) for p in pkgiter]
+ pkglist.sort()
+ return ' '.join(pkglist)
+
+ def sortlist(string):
+ items = string.split(' ')
+ items.sort()
+ return ' '.join(items)
+
+ pn = d.getVar('PN')
+ pe = d.getVar('PE') or "0"
+ pv = d.getVar('PV')
+ pr = d.getVar('PR')
+ layer = bb.utils.get_file_layer(d.getVar('FILE'), d)
+
+ pkgdata_dir = d.getVar('PKGDATA_DIR')
+ packages = ""
+ try:
+ with open(os.path.join(pkgdata_dir, pn)) as f:
+ for line in f.readlines():
+ if line.startswith('PACKAGES: '):
+ packages = oe.utils.squashspaces(line.split(': ', 1)[1])
+ break
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ # Probably a -cross recipe, just ignore
+ return 0
+ else:
+ raise
+
+ packagelist = packages.split()
+ preserve = d.getVar('BUILDHISTORY_PRESERVE').split()
+ if not os.path.exists(pkghistdir):
+ bb.utils.mkdirhier(pkghistdir)
+ else:
+ # Remove files for packages that no longer exist
+ for item in os.listdir(pkghistdir):
+ if item not in preserve:
+ if item not in packagelist:
+ itempath = os.path.join(pkghistdir, item)
+ if os.path.isdir(itempath):
+ for subfile in os.listdir(itempath):
+ os.unlink(os.path.join(itempath, subfile))
+ os.rmdir(itempath)
+ else:
+ os.unlink(itempath)
+
+ rcpinfo = RecipeInfo(pn)
+ rcpinfo.pe = pe
+ rcpinfo.pv = pv
+ rcpinfo.pr = pr
+ rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS') or ""))
+ rcpinfo.packages = packages
+ rcpinfo.layer = layer
+ write_recipehistory(rcpinfo, d)
+
+ pkgdest = d.getVar('PKGDEST')
+ for pkg in packagelist:
+ pkgdata = {}
+ with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
+ for line in f.readlines():
+ item = line.rstrip('\n').split(': ', 1)
+ key = item[0]
+ if key.endswith('_' + pkg):
+ key = key[:-len(pkg)-1]
+ pkgdata[key] = item[1]
+
+ pkge = pkgdata.get('PKGE', '0')
+ pkgv = pkgdata['PKGV']
+ pkgr = pkgdata['PKGR']
+ #
+ # Find out what the last version was
+ # Make sure the version did not decrease
+ #
+ lastversion = getlastpkgversion(pkg)
+ if lastversion:
+ last_pkge = lastversion.pkge
+ last_pkgv = lastversion.pkgv
+ last_pkgr = lastversion.pkgr
+ r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr))
+ if r < 0:
+ msg = "Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)
+ package_qa_handle_error("version-going-backwards", msg, d)
+
+ pkginfo = PackageInfo(pkg)
+ # Apparently the version can be different on a per-package basis (see Python)
+ pkginfo.pe = pkgdata.get('PE', '0')
+ pkginfo.pv = pkgdata['PV']
+ pkginfo.pr = pkgdata['PR']
+ pkginfo.pkg = pkgdata['PKG']
+ pkginfo.pkge = pkge
+ pkginfo.pkgv = pkgv
+ pkginfo.pkgr = pkgr
+ pkginfo.rprovides = sortpkglist(oe.utils.squashspaces(pkgdata.get('RPROVIDES', "")))
+ pkginfo.rdepends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RDEPENDS', "")))
+ pkginfo.rrecommends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RRECOMMENDS', "")))
+ pkginfo.rsuggests = sortpkglist(oe.utils.squashspaces(pkgdata.get('RSUGGESTS', "")))
+ pkginfo.rreplaces = sortpkglist(oe.utils.squashspaces(pkgdata.get('RREPLACES', "")))
+ pkginfo.rconflicts = sortpkglist(oe.utils.squashspaces(pkgdata.get('RCONFLICTS', "")))
+ pkginfo.files = oe.utils.squashspaces(pkgdata.get('FILES', ""))
+ for filevar in pkginfo.filevars:
+ pkginfo.filevars[filevar] = pkgdata.get(filevar, "")
+
+ # Gather information about packaged files
+ val = pkgdata.get('FILES_INFO', '')
+ dictval = json.loads(val)
+ filelist = list(dictval.keys())
+ filelist.sort()
+ pkginfo.filelist = " ".join(filelist)
+
+ pkginfo.size = int(pkgdata['PKGSIZE'])
+
+ write_pkghistory(pkginfo, d)
+
+ # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
+ bb.build.exec_func("buildhistory_list_pkg_files", d)
+}
+
+python buildhistory_emit_outputsigs() {
+ if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+ return
+
+ import hashlib
+
+ taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task', 'output')
+ bb.utils.mkdirhier(taskoutdir)
+ currenttask = d.getVar('BB_CURRENTTASK')
+ pn = d.getVar('PN')
+ taskfile = os.path.join(taskoutdir, '%s.%s' % (pn, currenttask))
+
+ cwd = os.getcwd()
+ filesigs = {}
+ for root, _, files in os.walk(cwd):
+ for fname in files:
+ if fname == 'fixmepath':
+ continue
+ fullpath = os.path.join(root, fname)
+ try:
+ if os.path.islink(fullpath):
+ sha256 = hashlib.sha256(os.readlink(fullpath).encode('utf-8')).hexdigest()
+ elif os.path.isfile(fullpath):
+ sha256 = bb.utils.sha256_file(fullpath)
+ else:
+ continue
+ except OSError:
+ bb.warn('buildhistory: unable to read %s to get output signature' % fullpath)
+ continue
+ filesigs[os.path.relpath(fullpath, cwd)] = sha256
+ with open(taskfile, 'w') as f:
+ for fpath, fsig in sorted(filesigs.items(), key=lambda item: item[0]):
+ f.write('%s %s\n' % (fpath, fsig))
+}
+
+
+def write_recipehistory(rcpinfo, d):
+ bb.debug(2, "Writing recipe history")
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
+
+ infofile = os.path.join(pkghistdir, "latest")
+ with open(infofile, "w") as f:
+ if rcpinfo.pe != "0":
+ f.write(u"PE = %s\n" % rcpinfo.pe)
+ f.write(u"PV = %s\n" % rcpinfo.pv)
+ f.write(u"PR = %s\n" % rcpinfo.pr)
+ f.write(u"DEPENDS = %s\n" % rcpinfo.depends)
+ f.write(u"PACKAGES = %s\n" % rcpinfo.packages)
+ f.write(u"LAYER = %s\n" % rcpinfo.layer)
+
+ write_latest_srcrev(d, pkghistdir)
+
+def write_pkghistory(pkginfo, d):
+ bb.debug(2, "Writing package history for package %s" % pkginfo.name)
+
+ pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
+
+ pkgpath = os.path.join(pkghistdir, pkginfo.name)
+ if not os.path.exists(pkgpath):
+ bb.utils.mkdirhier(pkgpath)
+
+ infofile = os.path.join(pkgpath, "latest")
+ with open(infofile, "w") as f:
+ if pkginfo.pe != "0":
+ f.write(u"PE = %s\n" % pkginfo.pe)
+ f.write(u"PV = %s\n" % pkginfo.pv)
+ f.write(u"PR = %s\n" % pkginfo.pr)
+
+ if pkginfo.pkg != pkginfo.name:
+ f.write(u"PKG = %s\n" % pkginfo.pkg)
+ if pkginfo.pkge != pkginfo.pe:
+ f.write(u"PKGE = %s\n" % pkginfo.pkge)
+ if pkginfo.pkgv != pkginfo.pv:
+ f.write(u"PKGV = %s\n" % pkginfo.pkgv)
+ if pkginfo.pkgr != pkginfo.pr:
+ f.write(u"PKGR = %s\n" % pkginfo.pkgr)
+ f.write(u"RPROVIDES = %s\n" % pkginfo.rprovides)
+ f.write(u"RDEPENDS = %s\n" % pkginfo.rdepends)
+ f.write(u"RRECOMMENDS = %s\n" % pkginfo.rrecommends)
+ if pkginfo.rsuggests:
+ f.write(u"RSUGGESTS = %s\n" % pkginfo.rsuggests)
+ if pkginfo.rreplaces:
+ f.write(u"RREPLACES = %s\n" % pkginfo.rreplaces)
+ if pkginfo.rconflicts:
+ f.write(u"RCONFLICTS = %s\n" % pkginfo.rconflicts)
+ f.write(u"PKGSIZE = %d\n" % pkginfo.size)
+ f.write(u"FILES = %s\n" % pkginfo.files)
+ f.write(u"FILELIST = %s\n" % pkginfo.filelist)
+
+ for filevar in pkginfo.filevars:
+ filevarpath = os.path.join(pkgpath, "latest.%s" % filevar)
+ val = pkginfo.filevars[filevar]
+ if val:
+ with open(filevarpath, "w") as f:
+ f.write(val)
+ else:
+ if os.path.exists(filevarpath):
+ os.unlink(filevarpath)
+
+#
+# rootfs_type can be: image, sdk_target, sdk_host
+#
+def buildhistory_list_installed(d, rootfs_type="image"):
+ from oe.rootfs import image_list_installed_packages
+ from oe.sdk import sdk_list_installed_packages
+ from oe.utils import format_pkg_list
+
+ process_list = [('file', 'bh_installed_pkgs.txt'),\
+ ('deps', 'bh_installed_pkgs_deps.txt')]
+
+ if rootfs_type == "image":
+ pkgs = image_list_installed_packages(d)
+ else:
+ pkgs = sdk_list_installed_packages(d, rootfs_type == "sdk_target")
+
+ for output_type, output_file in process_list:
+ output_file_full = os.path.join(d.getVar('WORKDIR'), output_file)
+
+ with open(output_file_full, 'w') as output:
+ output.write(format_pkg_list(pkgs, output_type))
+
+python buildhistory_list_installed_image() {
+ buildhistory_list_installed(d)
+}
+
+python buildhistory_list_installed_sdk_target() {
+ buildhistory_list_installed(d, "sdk_target")
+}
+
+python buildhistory_list_installed_sdk_host() {
+ buildhistory_list_installed(d, "sdk_host")
+}
+
+buildhistory_get_installed() {
+ mkdir -p $1
+
+ # Get list of installed packages
+ pkgcache="$1/installed-packages.tmp"
+ cat ${WORKDIR}/bh_installed_pkgs.txt | sort > $pkgcache && rm ${WORKDIR}/bh_installed_pkgs.txt
+
+ cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt
+ if [ -s $pkgcache ] ; then
+ cat $pkgcache | awk '{ print $2 }' | xargs -n1 basename > $1/installed-packages.txt
+ else
+ printf "" > $1/installed-packages.txt
+ fi
+
+ # Produce dependency graph
+ # First, quote each name to handle characters that cause issues for dot
+ sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp &&
+ rm ${WORKDIR}/bh_installed_pkgs_deps.txt
+ # Remove lines with rpmlib(...) and config(...) dependencies, change the
+ # delimiter from pipe to "->", set the style for recommend lines and
+ # turn versioned dependencies into edge labels.
+ sed -i -e '/rpmlib(/d' \
+ -e '/config(/d' \
+ -e 's:|: -> :' \
+ -e 's:"\[REC\]":[style=dotted]:' \
+ -e 's:"\([<>=]\+\)" "\([^"]*\)":[label="\1 \2"]:' \
+ $1/depends.tmp
+ # Add header, sorted and de-duped contents and footer and then delete the temp file
+ printf "digraph depends {\n node [shape=plaintext]\n" > $1/depends.dot
+ cat $1/depends.tmp | sort -u >> $1/depends.dot
+ echo "}" >> $1/depends.dot
+ rm $1/depends.tmp
+
+ # Produce installed package sizes list
+ oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" -n -f $pkgcache > $1/installed-package-sizes.tmp
+ cat $1/installed-package-sizes.tmp | awk '{print $2 "\tKiB\t" $1}' | sort -n -r > $1/installed-package-sizes.txt
+ rm $1/installed-package-sizes.tmp
+
+ # We're now done with the cache, delete it
+ rm $pkgcache
+
+ if [ "$2" != "sdk" ] ; then
+ # Produce some cut-down graphs (for readability)
+ grep -v kernel-image $1/depends.dot | grep -v kernel-3 | grep -v kernel-4 > $1/depends-nokernel.dot
+ grep -v libc6 $1/depends-nokernel.dot | grep -v libgcc > $1/depends-nokernel-nolibc.dot
+ grep -v update- $1/depends-nokernel-nolibc.dot > $1/depends-nokernel-nolibc-noupdate.dot
+ grep -v kernel-module $1/depends-nokernel-nolibc-noupdate.dot > $1/depends-nokernel-nolibc-noupdate-nomodules.dot
+ fi
+
+ # add complementary package information
+ if [ -e ${WORKDIR}/complementary_pkgs.txt ]; then
+ cp ${WORKDIR}/complementary_pkgs.txt $1
+ fi
+}
+
+buildhistory_get_image_installed() {
+ # Anything requiring the use of the packaging system should be done in here
+ # in case the packaging files are going to be removed for this image
+
+ if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
+ return
+ fi
+
+ buildhistory_get_installed ${BUILDHISTORY_DIR_IMAGE}
+}
+
+buildhistory_get_sdk_installed() {
+ # Anything requiring the use of the packaging system should be done in here
+ # in case the packaging files are going to be removed for this SDK
+
+ if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
+ return
+ fi
+
+ buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk
+}
+
+buildhistory_get_sdk_installed_host() {
+ buildhistory_get_sdk_installed host
+}
+
+buildhistory_get_sdk_installed_target() {
+ buildhistory_get_sdk_installed target
+}
+
+buildhistory_list_files() {
+ # List the files in the specified directory, but exclude date/time etc.
+ # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
+ if [ "$3" = "fakeroot" ] ; then
+ ( cd $1 && ${FAKEROOTENV} ${FAKEROOTCMD} find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+ else
+ ( cd $1 && find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+ fi
+}
+
+buildhistory_list_pkg_files() {
+ # Create individual files-in-package for each recipe's package
+ for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do
+ pkgname=$(basename $pkgdir)
+ outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname"
+ outfile="$outfolder/files-in-package.txt"
+ # Make sure the output folder exists so we can create the file
+ if [ ! -d $outfolder ] ; then
+ bbdebug 2 "Folder $outfolder does not exist, file $outfile not created"
+ continue
+ fi
+ buildhistory_list_files $pkgdir $outfile fakeroot
+ done
+}
+
+buildhistory_get_imageinfo() {
+ if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
+ return
+ fi
+
+ mkdir -p ${BUILDHISTORY_DIR_IMAGE}
+ buildhistory_list_files ${IMAGE_ROOTFS} ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt
+
+ # Collect files requested in BUILDHISTORY_IMAGE_FILES
+ rm -rf ${BUILDHISTORY_DIR_IMAGE}/image-files
+ for f in ${BUILDHISTORY_IMAGE_FILES}; do
+ if [ -f ${IMAGE_ROOTFS}/$f ] ; then
+ mkdir -p ${BUILDHISTORY_DIR_IMAGE}/image-files/`dirname $f`
+ cp ${IMAGE_ROOTFS}/$f ${BUILDHISTORY_DIR_IMAGE}/image-files/$f
+ fi
+ done
+
+ # Record some machine-readable meta-information about the image
+ printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+ cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END
+${@buildhistory_get_imagevars(d)}
+END
+ imagesize=`du -ks ${IMAGE_ROOTFS} | awk '{ print $1 }'`
+ echo "IMAGESIZE = $imagesize" >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+
+ # Add some configuration information
+ echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id.txt
+
+ cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id.txt <<END
+${@buildhistory_get_build_id(d)}
+END
+}
+
+buildhistory_get_sdkinfo() {
+ if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
+ return
+ fi
+
+ buildhistory_list_files ${SDK_OUTPUT} ${BUILDHISTORY_DIR_SDK}/files-in-sdk.txt
+
+ # Collect files requested in BUILDHISTORY_SDK_FILES
+ rm -rf ${BUILDHISTORY_DIR_SDK}/sdk-files
+ for f in ${BUILDHISTORY_SDK_FILES}; do
+ if [ -f ${SDK_OUTPUT}/${SDKPATH}/$f ] ; then
+ mkdir -p ${BUILDHISTORY_DIR_SDK}/sdk-files/`dirname $f`
+ cp ${SDK_OUTPUT}/${SDKPATH}/$f ${BUILDHISTORY_DIR_SDK}/sdk-files/$f
+ fi
+ done
+
+ # Record some machine-readable meta-information about the SDK
+ printf "" > ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
+ cat >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt <<END
+${@buildhistory_get_sdkvars(d)}
+END
+ sdksize=`du -ks ${SDK_OUTPUT} | awk '{ print $1 }'`
+ echo "SDKSIZE = $sdksize" >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
+}
+
+python buildhistory_get_extra_sdkinfo() {
+ import operator
+ from oe.sdk import get_extra_sdkinfo
+
+ sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')
+ extra_info = get_extra_sdkinfo(sstate_dir)
+
+ if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext' and \
+ "sdk" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+ with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-package-sizes.txt'), 'w') as f:
+ filesizes_sorted = sorted(extra_info['filesizes'].items(), key=operator.itemgetter(1, 0), reverse=True)
+ for fn, size in filesizes_sorted:
+ f.write('%10d KiB %s\n' % (size, fn))
+ with open(d.expand('${BUILDHISTORY_DIR_SDK}/sstate-task-sizes.txt'), 'w') as f:
+ tasksizes_sorted = sorted(extra_info['tasksizes'].items(), key=operator.itemgetter(1, 0), reverse=True)
+ for task, size in tasksizes_sorted:
+ f.write('%10d KiB %s\n' % (size, task))
+}
+
+# By using ROOTFS_POSTUNINSTALL_COMMAND we get in after uninstallation of
+# unneeded packages but before the removal of packaging files
+ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_list_installed_image ;"
+ROOTFS_POSTUNINSTALL_COMMAND += "buildhistory_get_image_installed ;"
+ROOTFS_POSTUNINSTALL_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_image ;| buildhistory_get_image_installed ;"
+ROOTFS_POSTUNINSTALL_COMMAND[vardepsexclude] += "buildhistory_list_installed_image buildhistory_get_image_installed"
+
+IMAGE_POSTPROCESS_COMMAND += "buildhistory_get_imageinfo ;"
+IMAGE_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_imageinfo ;"
+IMAGE_POSTPROCESS_COMMAND[vardepsexclude] += "buildhistory_get_imageinfo"
+
+# We want these to be the last run so that we get called after complementary package installation
+POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target;"
+POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_get_sdk_installed_target;"
+POPULATE_SDK_POST_TARGET_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_target;| buildhistory_get_sdk_installed_target;"
+
+POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host;"
+POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_get_sdk_installed_host;"
+POPULATE_SDK_POST_HOST_COMMAND[vardepvalueexclude] .= "| buildhistory_list_installed_sdk_host;| buildhistory_get_sdk_installed_host;"
+
+SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
+SDK_POSTPROCESS_COMMAND[vardepvalueexclude] .= "| buildhistory_get_sdkinfo ; buildhistory_get_extra_sdkinfo; "
+
+python buildhistory_write_sigs() {
+ if not "task" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+ return
+
+ # Create sigs file
+ if hasattr(bb.parse.siggen, 'dump_siglist'):
+ taskoutdir = os.path.join(d.getVar('BUILDHISTORY_DIR'), 'task')
+ bb.utils.mkdirhier(taskoutdir)
+ bb.parse.siggen.dump_siglist(os.path.join(taskoutdir, 'tasksigs.txt'))
+}
+
+def buildhistory_get_build_id(d):
+ if d.getVar('BB_WORKERCONTEXT') != '1':
+ return ""
+ localdata = bb.data.createCopy(d)
+ statuslines = []
+ for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
+ g = globals()
+ if func not in g:
+ bb.warn("Build configuration function '%s' does not exist" % func)
+ else:
+ flines = g[func](localdata)
+ if flines:
+ statuslines.extend(flines)
+
+ statusheader = d.getVar('BUILDCFG_HEADER')
+ return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
+
+def buildhistory_get_metadata_revs(d):
+ # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want
+ layers = (d.getVar("BBLAYERS") or "").split()
+ medadata_revs = ["%-17s = %s:%s" % (os.path.basename(i), \
+ base_get_metadata_git_branch(i, None).strip(), \
+ base_get_metadata_git_revision(i, None)) \
+ for i in layers]
+ return '\n'.join(medadata_revs)
+
+def outputvars(vars, listvars, d):
+ vars = vars.split()
+ listvars = listvars.split()
+ ret = ""
+ for var in vars:
+ value = d.getVar(var) or ""
+ if var in listvars:
+ # Squash out spaces
+ value = oe.utils.squashspaces(value)
+ ret += "%s = %s\n" % (var, value)
+ return ret.rstrip('\n')
+
+def buildhistory_get_imagevars(d):
+ if d.getVar('BB_WORKERCONTEXT') != '1':
+ return ""
+ imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
+ listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS PACKAGE_EXCLUDE"
+ return outputvars(imagevars, listvars, d)
+
+def buildhistory_get_sdkvars(d):
+ if d.getVar('BB_WORKERCONTEXT') != '1':
+ return ""
+ sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE"
+ if d.getVar('BB_CURRENTTASK') == 'populate_sdk_ext':
+ # Extensible SDK uses some additional variables
+ sdkvars += " SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST SDK_UPDATE_URL SDK_EXT_TYPE SDK_RECRDEP_TASKS SDK_INCLUDE_PKGDATA SDK_INCLUDE_TOOLCHAIN"
+ listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE SDK_LOCAL_CONF_WHITELIST SDK_LOCAL_CONF_BLACKLIST SDK_INHERIT_BLACKLIST"
+ return outputvars(sdkvars, listvars, d)
+
+
+def buildhistory_get_cmdline(d):
+ argv = d.getVar('BB_CMDLINE', False)
+ if argv:
+ if argv[0].endswith('bin/bitbake'):
+ bincmd = 'bitbake'
+ else:
+ bincmd = argv[0]
+ return '%s %s' % (bincmd, ' '.join(argv[1:]))
+ return ''
+
+
+buildhistory_single_commit() {
+ if [ "$3" = "" ] ; then
+ commitopts="${BUILDHISTORY_DIR}/ --allow-empty"
+ shortlogprefix="No changes: "
+ else
+ commitopts=""
+ shortlogprefix=""
+ fi
+ if [ "${BUILDHISTORY_BUILD_FAILURES}" = "0" ] ; then
+ result="succeeded"
+ else
+ result="failed"
+ fi
+ case ${BUILDHISTORY_BUILD_INTERRUPTED} in
+ 1)
+ result="$result (interrupted)"
+ ;;
+ 2)
+ result="$result (force interrupted)"
+ ;;
+ esac
+ commitmsgfile=`mktemp`
+ cat > $commitmsgfile << END
+${shortlogprefix}Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2
+
+cmd: $1
+
+result: $result
+
+metadata revisions:
+END
+ cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile
+ git commit $commitopts -F $commitmsgfile --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+ rm $commitmsgfile
+}
+
+buildhistory_commit() {
+ if [ ! -d ${BUILDHISTORY_DIR} ] ; then
+ # Code above that creates this dir never executed, so there can't be anything to commit
+ return
+ fi
+
+ # Create a machine-readable list of metadata revisions for each layer
+ cat > ${BUILDHISTORY_DIR}/metadata-revs <<END
+${@buildhistory_get_metadata_revs(d)}
+END
+
+ ( cd ${BUILDHISTORY_DIR}/
+ # Initialise the repo if necessary
+ if [ ! -e .git ] ; then
+ git init -q
+ else
+ git tag -f build-minus-3 build-minus-2 > /dev/null 2>&1 || true
+ git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true
+ git tag -f build-minus-1 > /dev/null 2>&1 || true
+ fi
+
+ check_git_config
+
+ # Check if there are new/changed files to commit (other than metadata-revs)
+ repostatus=`git status --porcelain | grep -v " metadata-revs$"`
+ HOSTNAME=`hostname 2>/dev/null || echo unknown`
+ CMDLINE="${@buildhistory_get_cmdline(d)}"
+ if [ "$repostatus" != "" ] ; then
+ git add -A .
+ # porcelain output looks like "?? packages/foo/bar"
+ # Ensure we commit metadata-revs with the first commit
+ buildhistory_single_commit "$CMDLINE" "$HOSTNAME" dummy
+ git gc --auto --quiet
+ else
+ buildhistory_single_commit "$CMDLINE" "$HOSTNAME"
+ fi
+ if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
+ git push -q ${BUILDHISTORY_PUSH_REPO}
+ fi) || true
+}
+
+python buildhistory_eventhandler() {
+ if e.data.getVar('BUILDHISTORY_FEATURES').strip():
+ reset = e.data.getVar("BUILDHISTORY_RESET")
+ olddir = e.data.getVar("BUILDHISTORY_OLD_DIR")
+ if isinstance(e, bb.event.BuildStarted):
+ if reset:
+ import shutil
+ # Clean up after potentially interrupted build.
+ if os.path.isdir(olddir):
+ shutil.rmtree(olddir)
+ rootdir = e.data.getVar("BUILDHISTORY_DIR")
+ entries = [ x for x in os.listdir(rootdir) if not x.startswith('.') ]
+ bb.utils.mkdirhier(olddir)
+ for entry in entries:
+ os.rename(os.path.join(rootdir, entry),
+ os.path.join(olddir, entry))
+ elif isinstance(e, bb.event.BuildCompleted):
+ if reset:
+ import shutil
+ shutil.rmtree(olddir)
+ if e.data.getVar("BUILDHISTORY_COMMIT") == "1":
+ bb.note("Writing buildhistory")
+ bb.build.exec_func("buildhistory_write_sigs", d)
+ localdata = bb.data.createCopy(e.data)
+ localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures))
+ interrupted = getattr(e, '_interrupted', 0)
+ localdata.setVar('BUILDHISTORY_BUILD_INTERRUPTED', str(interrupted))
+ bb.build.exec_func("buildhistory_commit", localdata)
+ else:
+ bb.note("No commit since BUILDHISTORY_COMMIT != '1'")
+}
+
+addhandler buildhistory_eventhandler
+buildhistory_eventhandler[eventmask] = "bb.event.BuildCompleted bb.event.BuildStarted"
+
+
+# FIXME this ought to be moved into the fetcher
+def _get_srcrev_values(d):
+ """
+ Return the version strings for the current recipe
+ """
+
+ scms = []
+ fetcher = bb.fetch.Fetch(d.getVar('SRC_URI').split(), d)
+ urldata = fetcher.ud
+ for u in urldata:
+ if urldata[u].method.supports_srcrev():
+ scms.append(u)
+
+ autoinc_templ = 'AUTOINC+'
+ dict_srcrevs = {}
+ dict_tag_srcrevs = {}
+ for scm in scms:
+ ud = urldata[scm]
+ for name in ud.names:
+ try:
+ rev = ud.method.sortable_revision(ud, d, name)
+ except TypeError:
+ # support old bitbake versions
+ rev = ud.method.sortable_revision(scm, ud, d, name)
+ # Clean this up when we next bump bitbake version
+ if type(rev) != str:
+ autoinc, rev = rev
+ elif rev.startswith(autoinc_templ):
+ rev = rev[len(autoinc_templ):]
+ dict_srcrevs[name] = rev
+ if 'tag' in ud.parm:
+ tag = ud.parm['tag'];
+ key = name+'_'+tag
+ dict_tag_srcrevs[key] = rev
+ return (dict_srcrevs, dict_tag_srcrevs)
+
+do_fetch[postfuncs] += "write_srcrev"
+do_fetch[vardepsexclude] += "write_srcrev"
+python write_srcrev() {
+ write_latest_srcrev(d, d.getVar('BUILDHISTORY_DIR_PACKAGE'))
+}
+
+def write_latest_srcrev(d, pkghistdir):
+ srcrevfile = os.path.join(pkghistdir, 'latest_srcrev')
+
+ srcrevs, tag_srcrevs = _get_srcrev_values(d)
+ if srcrevs:
+ if not os.path.exists(pkghistdir):
+ bb.utils.mkdirhier(pkghistdir)
+ old_tag_srcrevs = {}
+ if os.path.exists(srcrevfile):
+ with open(srcrevfile) as f:
+ for line in f:
+ if line.startswith('# tag_'):
+ key, value = line.split("=", 1)
+ key = key.replace('# tag_', '').strip()
+ value = value.replace('"', '').strip()
+ old_tag_srcrevs[key] = value
+ with open(srcrevfile, 'w') as f:
+ orig_srcrev = d.getVar('SRCREV', False) or 'INVALID'
+ if orig_srcrev != 'INVALID':
+ f.write('# SRCREV = "%s"\n' % orig_srcrev)
+ if len(srcrevs) > 1:
+ for name, srcrev in srcrevs.items():
+ orig_srcrev = d.getVar('SRCREV_%s' % name, False)
+ if orig_srcrev:
+ f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
+ f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
+ else:
+ f.write('SRCREV = "%s"\n' % next(iter(srcrevs.values())))
+ if len(tag_srcrevs) > 0:
+ for name, srcrev in tag_srcrevs.items():
+ f.write('# tag_%s = "%s"\n' % (name, srcrev))
+ if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
+ pkg = d.getVar('PN')
+ bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev))
+
+ else:
+ if os.path.exists(srcrevfile):
+ os.remove(srcrevfile)
+
+do_testimage[postfuncs] += "write_ptest_result"
+do_testimage[vardepsexclude] += "write_ptest_result"
+
+python write_ptest_result() {
+ write_latest_ptest_result(d, d.getVar('BUILDHISTORY_DIR'))
+}
+
+def write_latest_ptest_result(d, histdir):
+ import glob
+ import subprocess
+ test_log_dir = d.getVar('TEST_LOG_DIR')
+ input_ptest = os.path.join(test_log_dir, 'ptest_log')
+ output_ptest = os.path.join(histdir, 'ptest')
+ if os.path.exists(input_ptest):
+ try:
+ # Lock it avoid race issue
+ lock = bb.utils.lockfile(output_ptest + "/ptest.lock")
+ bb.utils.mkdirhier(output_ptest)
+ oe.path.copytree(input_ptest, output_ptest)
+ # Sort test result
+ for result in glob.glob('%s/pass.fail.*' % output_ptest):
+ bb.debug(1, 'Processing %s' % result)
+ cmd = ['sort', result, '-o', result]
+ bb.debug(1, 'Running %s' % cmd)
+ ret = subprocess.call(cmd)
+ if ret != 0:
+ bb.error('Failed to run %s!' % cmd)
+ finally:
+ bb.utils.unlockfile(lock)
diff --git a/poky/meta/classes/buildstats-summary.bbclass b/poky/meta/classes/buildstats-summary.bbclass
new file mode 100644
index 000000000..f9b241b6c
--- /dev/null
+++ b/poky/meta/classes/buildstats-summary.bbclass
@@ -0,0 +1,40 @@
+# Summarize sstate usage at the end of the build
+python buildstats_summary () {
+ import collections
+ import os.path
+
+ bsdir = e.data.expand("${BUILDSTATS_BASE}/${BUILDNAME}")
+ if not os.path.exists(bsdir):
+ return
+
+ sstatetasks = (e.data.getVar('SSTATETASKS') or '').split()
+ built = collections.defaultdict(lambda: [set(), set()])
+ for pf in os.listdir(bsdir):
+ taskdir = os.path.join(bsdir, pf)
+ if not os.path.isdir(taskdir):
+ continue
+
+ tasks = os.listdir(taskdir)
+ for t in sstatetasks:
+ no_sstate, sstate = built[t]
+ if t in tasks:
+ no_sstate.add(pf)
+ elif t + '_setscene' in tasks:
+ sstate.add(pf)
+
+ header_printed = False
+ for t in sstatetasks:
+ no_sstate, sstate = built[t]
+ if no_sstate | sstate:
+ if not header_printed:
+ header_printed = True
+ bb.note("Build completion summary:")
+
+ sstate_count = len(sstate)
+ no_sstate_count = len(no_sstate)
+ total_count = sstate_count + no_sstate_count
+ bb.note(" {0}: {1:.1f}% sstate reuse({2} setscene, {3} scratch)".format(
+ t, round(100 * sstate_count / total_count, 1), sstate_count, no_sstate_count))
+}
+addhandler buildstats_summary
+buildstats_summary[eventmask] = "bb.event.BuildCompleted"
diff --git a/poky/meta/classes/buildstats.bbclass b/poky/meta/classes/buildstats.bbclass
new file mode 100644
index 000000000..960653c70
--- /dev/null
+++ b/poky/meta/classes/buildstats.bbclass
@@ -0,0 +1,219 @@
+BUILDSTATS_BASE = "${TMPDIR}/buildstats/"
+
+################################################################################
+# Build statistics gathering.
+#
+# The CPU and Time gathering/tracking functions and bbevent inspiration
+# were written by Christopher Larson.
+#
+################################################################################
+
+def get_buildprocess_cputime(pid):
+ with open("/proc/%d/stat" % pid, "r") as f:
+ fields = f.readline().rstrip().split()
+ # 13: utime, 14: stime, 15: cutime, 16: cstime
+ return sum(int(field) for field in fields[13:16])
+
+def get_process_cputime(pid):
+ import resource
+ with open("/proc/%d/stat" % pid, "r") as f:
+ fields = f.readline().rstrip().split()
+ stats = {
+ 'utime' : fields[13],
+ 'stime' : fields[14],
+ 'cutime' : fields[15],
+ 'cstime' : fields[16],
+ }
+ iostats = {}
+ if os.path.isfile("/proc/%d/io" % pid):
+ with open("/proc/%d/io" % pid, "r") as f:
+ while True:
+ i = f.readline().strip()
+ if not i:
+ break
+ if not ":" in i:
+ # one more extra line is appended (empty or containing "0")
+ # most probably due to race condition in kernel while
+ # updating IO stats
+ break
+ i = i.split(": ")
+ iostats[i[0]] = i[1]
+ resources = resource.getrusage(resource.RUSAGE_SELF)
+ childres = resource.getrusage(resource.RUSAGE_CHILDREN)
+ return stats, iostats, resources, childres
+
+def get_cputime():
+ with open("/proc/stat", "r") as f:
+ fields = f.readline().rstrip().split()[1:]
+ return sum(int(field) for field in fields)
+
+def set_timedata(var, d, server_time):
+ d.setVar(var, server_time)
+
+def get_timedata(var, d, end_time):
+ oldtime = d.getVar(var, False)
+ if oldtime is None:
+ return
+ return end_time - oldtime
+
+def set_buildtimedata(var, d):
+ import time
+ time = time.time()
+ cputime = get_cputime()
+ proctime = get_buildprocess_cputime(os.getpid())
+ d.setVar(var, (time, cputime, proctime))
+
+def get_buildtimedata(var, d):
+ import time
+ timedata = d.getVar(var, False)
+ if timedata is None:
+ return
+ oldtime, oldcpu, oldproc = timedata
+ procdiff = get_buildprocess_cputime(os.getpid()) - oldproc
+ cpudiff = get_cputime() - oldcpu
+ end_time = time.time()
+ timediff = end_time - oldtime
+ if cpudiff > 0:
+ cpuperc = float(procdiff) * 100 / cpudiff
+ else:
+ cpuperc = None
+ return timediff, cpuperc
+
+def write_task_data(status, logfile, e, d):
+ bn = d.getVar('BUILDNAME')
+ bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
+ with open(os.path.join(logfile), "a") as f:
+ elapsedtime = get_timedata("__timedata_task", d, e.time)
+ if elapsedtime:
+ f.write(d.expand("${PF}: %s\n" % e.task))
+ f.write(d.expand("Elapsed time: %0.2f seconds\n" % elapsedtime))
+ cpu, iostats, resources, childres = get_process_cputime(os.getpid())
+ if cpu:
+ f.write("utime: %s\n" % cpu['utime'])
+ f.write("stime: %s\n" % cpu['stime'])
+ f.write("cutime: %s\n" % cpu['cutime'])
+ f.write("cstime: %s\n" % cpu['cstime'])
+ for i in iostats:
+ f.write("IO %s: %s\n" % (i, iostats[i]))
+ rusages = ["ru_utime", "ru_stime", "ru_maxrss", "ru_minflt", "ru_majflt", "ru_inblock", "ru_oublock", "ru_nvcsw", "ru_nivcsw"]
+ for i in rusages:
+ f.write("rusage %s: %s\n" % (i, getattr(resources, i)))
+ for i in rusages:
+ f.write("Child rusage %s: %s\n" % (i, getattr(childres, i)))
+ if status is "passed":
+ f.write("Status: PASSED \n")
+ else:
+ f.write("Status: FAILED \n")
+ f.write("Ended: %0.2f \n" % e.time)
+
+python run_buildstats () {
+ import bb.build
+ import bb.event
+ import time, subprocess, platform
+
+ bn = d.getVar('BUILDNAME')
+ bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
+ taskdir = os.path.join(bsdir, d.getVar('PF'))
+
+ if isinstance(e, bb.event.BuildStarted):
+ ########################################################################
+ # If the kernel was not configured to provide I/O statistics, issue
+ # a one time warning.
+ ########################################################################
+ if not os.path.isfile("/proc/%d/io" % os.getpid()):
+ bb.warn("The Linux kernel on your build host was not configured to provide process I/O statistics. (CONFIG_TASK_IO_ACCOUNTING is not set)")
+
+ ########################################################################
+ # at first pass make the buildstats hierarchy and then
+ # set the buildname
+ ########################################################################
+ bb.utils.mkdirhier(bsdir)
+ set_buildtimedata("__timedata_build", d)
+ build_time = os.path.join(bsdir, "build_stats")
+ # write start of build into build_time
+ with open(build_time, "a") as f:
+ host_info = platform.uname()
+ f.write("Host Info: ")
+ for x in host_info:
+ if x:
+ f.write(x + " ")
+ f.write("\n")
+ f.write("Build Started: %0.2f \n" % time.time())
+
+ elif isinstance(e, bb.event.BuildCompleted):
+ build_time = os.path.join(bsdir, "build_stats")
+ with open(build_time, "a") as f:
+ ########################################################################
+ # Write build statistics for the build
+ ########################################################################
+ timedata = get_buildtimedata("__timedata_build", d)
+ if timedata:
+ time, cpu = timedata
+ # write end of build and cpu used into build_time
+ f.write("Elapsed time: %0.2f seconds \n" % (time))
+ if cpu:
+ f.write("CPU usage: %0.1f%% \n" % cpu)
+
+ if isinstance(e, bb.build.TaskStarted):
+ set_timedata("__timedata_task", d, e.time)
+ bb.utils.mkdirhier(taskdir)
+ # write into the task event file the name and start time
+ with open(os.path.join(taskdir, e.task), "a") as f:
+ f.write("Event: %s \n" % bb.event.getName(e))
+ f.write("Started: %0.2f \n" % e.time)
+
+ elif isinstance(e, bb.build.TaskSucceeded):
+ write_task_data("passed", os.path.join(taskdir, e.task), e, d)
+ if e.task == "do_rootfs":
+ bs = os.path.join(bsdir, "build_stats")
+ with open(bs, "a") as f:
+ rootfs = d.getVar('IMAGE_ROOTFS')
+ if os.path.isdir(rootfs):
+ try:
+ rootfs_size = subprocess.check_output(["du", "-sh", rootfs],
+ stderr=subprocess.STDOUT).decode('utf-8')
+ f.write("Uncompressed Rootfs size: %s" % rootfs_size)
+ except subprocess.CalledProcessError as err:
+ bb.warn("Failed to get rootfs size: %s" % err.output.decode('utf-8'))
+
+ elif isinstance(e, bb.build.TaskFailed):
+ # Can have a failure before TaskStarted so need to mkdir here too
+ bb.utils.mkdirhier(taskdir)
+ write_task_data("failed", os.path.join(taskdir, e.task), e, d)
+ ########################################################################
+ # Lets make things easier and tell people where the build failed in
+ # build_status. We do this here because BuildCompleted triggers no
+ # matter what the status of the build actually is
+ ########################################################################
+ build_status = os.path.join(bsdir, "build_stats")
+ with open(build_status, "a") as f:
+ f.write(d.expand("Failed at: ${PF} at task: %s \n" % e.task))
+}
+
+addhandler run_buildstats
+run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed"
+
+python runqueue_stats () {
+ import buildstats
+ from bb import event, runqueue
+ # We should not record any samples before the first task has started,
+ # because that's the first activity shown in the process chart.
+ # Besides, at that point we are sure that the build variables
+ # are available that we need to find the output directory.
+ # The persistent SystemStats is stored in the datastore and
+ # closed when the build is done.
+ system_stats = d.getVar('_buildstats_system_stats', False)
+ if not system_stats and isinstance(e, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted)):
+ system_stats = buildstats.SystemStats(d)
+ d.setVar('_buildstats_system_stats', system_stats)
+ if system_stats:
+ # Ensure that we sample at important events.
+ done = isinstance(e, bb.event.BuildCompleted)
+ system_stats.sample(e, force=done)
+ if done:
+ system_stats.close()
+ d.delVar('_buildstats_system_stats')
+}
+
+addhandler runqueue_stats
+runqueue_stats[eventmask] = "bb.runqueue.sceneQueueTaskStarted bb.runqueue.runQueueTaskStarted bb.event.HeartbeatEvent bb.event.BuildCompleted bb.event.MonitorDiskEvent"
diff --git a/poky/meta/classes/ccache.bbclass b/poky/meta/classes/ccache.bbclass
new file mode 100644
index 000000000..960902065
--- /dev/null
+++ b/poky/meta/classes/ccache.bbclass
@@ -0,0 +1,11 @@
+CCACHE = "${@bb.utils.which(d.getVar('PATH'), 'ccache') and 'ccache '}"
+export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_TARGET_SYS}/${PN}"
+
+# We need to stop ccache considering the current directory or the
+# debug-prefix-map target directory to be significant when calculating
+# its hash. Without this the cache would be invalidated every time
+# ${PV} or ${PR} change.
+export CCACHE_NOHASHDIR ?= "1"
+
+DEPENDS_append_class-target = " ccache-native"
+DEPENDS[vardepvalueexclude] = " ccache-native"
diff --git a/poky/meta/classes/chrpath.bbclass b/poky/meta/classes/chrpath.bbclass
new file mode 100644
index 000000000..ad3c3975a
--- /dev/null
+++ b/poky/meta/classes/chrpath.bbclass
@@ -0,0 +1,123 @@
+CHRPATH_BIN ?= "chrpath"
+PREPROCESS_RELOCATE_DIRS ?= ""
+
+def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d):
+ import subprocess as sub
+
+ p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ # If returned successfully, process stdout for results
+ if p.returncode != 0:
+ return
+
+ out = out.decode('utf-8')
+
+ # Handle RUNPATH as well as RPATH
+ out = out.replace("RUNPATH=","RPATH=")
+ # Throw away everything other than the rpath list
+ curr_rpath = out.partition("RPATH=")[2]
+ #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
+ rpaths = curr_rpath.strip().split(":")
+ new_rpaths = []
+ modified = False
+ for rpath in rpaths:
+ # If rpath is already dynamic copy it to new_rpath and continue
+ if rpath.find("$ORIGIN") != -1:
+ new_rpaths.append(rpath)
+ continue
+ rpath = os.path.normpath(rpath)
+ if baseprefix not in rpath and tmpdir not in rpath:
+ # Skip standard search paths
+ if rpath in ['/lib', '/usr/lib', '/lib64/', '/usr/lib64']:
+ bb.warn("Skipping RPATH %s as is a standard search path for %s" % (rpath, fpath))
+ modified = True
+ continue
+ new_rpaths.append(rpath)
+ continue
+ new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/"))))
+ modified = True
+
+ # if we have modified some rpaths call chrpath to update the binary
+ if modified:
+ args = ":".join(new_rpaths)
+ #bb.note("Setting rpath for %s to %s" %(fpath, args))
+ p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ if p.returncode != 0:
+ bb.fatal("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN'), p.returncode, out, err))
+
+def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d):
+ import subprocess as sub
+
+ p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ # If returned successfully, process stdout for results
+ if p.returncode != 0:
+ return
+ for l in out.split("\n"):
+ if "(compatibility" not in l:
+ continue
+ rpath = l.partition("(compatibility")[0].strip()
+ if baseprefix not in rpath:
+ continue
+
+ newpath = "@loader_path/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/")))
+ p = sub.Popen([d.expand("${HOST_PREFIX}install_name_tool"), '-change', rpath, newpath, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+
+def process_dir (rootdir, directory, d):
+ import stat
+
+ rootdir = os.path.normpath(rootdir)
+ cmd = d.expand('${CHRPATH_BIN}')
+ tmpdir = os.path.normpath(d.getVar('TMPDIR', False))
+ baseprefix = os.path.normpath(d.expand('${base_prefix}'))
+ hostos = d.getVar("HOST_OS")
+
+ #bb.debug("Checking %s for binaries to process" % directory)
+ if not os.path.exists(directory):
+ return
+
+ if "linux" in hostos:
+ process_file = process_file_linux
+ elif "darwin" in hostos:
+ process_file = process_file_darwin
+ else:
+ # Relocations not supported
+ return
+
+ dirs = os.listdir(directory)
+ for file in dirs:
+ fpath = directory + "/" + file
+ fpath = os.path.normpath(fpath)
+ if os.path.islink(fpath):
+ # Skip symlinks
+ continue
+
+ if os.path.isdir(fpath):
+ process_dir(rootdir, fpath, d)
+ else:
+ #bb.note("Testing %s for relocatability" % fpath)
+
+ # We need read and write permissions for chrpath, if we don't have
+ # them then set them temporarily. Take a copy of the files
+ # permissions so that we can restore them afterwards.
+ perms = os.stat(fpath)[stat.ST_MODE]
+ if os.access(fpath, os.W_OK|os.R_OK):
+ perms = None
+ else:
+ # Temporarily make the file writeable so we can chrpath it
+ os.chmod(fpath, perms|stat.S_IRWXU)
+ process_file(cmd, fpath, rootdir, baseprefix, tmpdir, d)
+
+ if perms:
+ os.chmod(fpath, perms)
+
+def rpath_replace (path, d):
+ bindirs = d.expand("${bindir} ${sbindir} ${base_sbindir} ${base_bindir} ${libdir} ${base_libdir} ${libexecdir} ${PREPROCESS_RELOCATE_DIRS}").split()
+
+ for bindir in bindirs:
+ #bb.note ("Processing directory " + bindir)
+ directory = path + "/" + bindir
+ process_dir (path, directory, d)
+
diff --git a/poky/meta/classes/clutter.bbclass b/poky/meta/classes/clutter.bbclass
new file mode 100644
index 000000000..167407dfd
--- /dev/null
+++ b/poky/meta/classes/clutter.bbclass
@@ -0,0 +1,22 @@
+
+def get_minor_dir(v):
+ import re
+ m = re.match("^([0-9]+)\.([0-9]+)", v)
+ return "%s.%s" % (m.group(1), m.group(2))
+
+def get_real_name(n):
+ import re
+ m = re.match("^([a-z]+(-[a-z]+)?)(-[0-9]+\.[0-9]+)?", n)
+ return "%s" % (m.group(1))
+
+VERMINOR = "${@get_minor_dir("${PV}")}"
+REALNAME = "${@get_real_name("${BPN}")}"
+
+CLUTTER_SRC_FTP = "${GNOME_MIRROR}/${REALNAME}/${VERMINOR}/${REALNAME}-${PV}.tar.xz;name=archive"
+
+CLUTTER_SRC_GIT = "git://git.gnome.org/${REALNAME}"
+
+SRC_URI = "${CLUTTER_SRC_FTP}"
+S = "${WORKDIR}/${REALNAME}-${PV}"
+
+inherit autotools pkgconfig gtk-doc gettext
diff --git a/poky/meta/classes/cmake.bbclass b/poky/meta/classes/cmake.bbclass
new file mode 100644
index 000000000..fcfd5dda4
--- /dev/null
+++ b/poky/meta/classes/cmake.bbclass
@@ -0,0 +1,175 @@
+# Path to the CMake file to process.
+OECMAKE_SOURCEPATH ??= "${S}"
+
+DEPENDS_prepend = "cmake-native "
+B = "${WORKDIR}/build"
+
+# We need to unset CCACHE otherwise cmake gets too confused
+CCACHE = ""
+
+# What CMake generator to use.
+# The supported options are "Unix Makefiles" or "Ninja".
+OECMAKE_GENERATOR ?= "Ninja"
+
+python() {
+ generator = d.getVar("OECMAKE_GENERATOR")
+ if generator == "Unix Makefiles":
+ args = "-G 'Unix Makefiles' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE")
+ d.setVar("OECMAKE_GENERATOR_ARGS", args)
+ d.setVarFlag("do_compile", "progress", "percent")
+ elif generator == "Ninja":
+ d.appendVar("DEPENDS", " ninja-native")
+ d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja")
+ d.setVarFlag("do_compile", "progress", "outof:^\[(\d+)/(\d+)\]\s+")
+ else:
+ bb.fatal("Unknown CMake Generator %s" % generator)
+}
+# C/C++ Compiler (without cpu arch/tune arguments)
+OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_AR ?= "${AR}"
+
+# Compiler flags
+OECMAKE_C_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CFLAGS}"
+OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS}"
+OECMAKE_C_FLAGS_RELEASE ?= "-DNDEBUG"
+OECMAKE_CXX_FLAGS_RELEASE ?= "-DNDEBUG"
+OECMAKE_C_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CPPFLAGS} ${LDFLAGS}"
+OECMAKE_CXX_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS} ${LDFLAGS}"
+CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
+CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
+
+OECMAKE_RPATH ?= ""
+OECMAKE_PERLNATIVE_DIR ??= ""
+OECMAKE_EXTRA_ROOT_PATH ?= ""
+
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
+
+EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}"
+
+EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} "
+EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} "
+
+OECMAKE_TARGET_COMPILE ?= "all"
+OECMAKE_TARGET_INSTALL ?= "install"
+
+FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake"
+
+# CMake expects target architectures in the format of uname(2),
+# which do not always match TARGET_ARCH, so all the necessary
+# conversions should happen here.
+def map_target_arch_to_uname_arch(target_arch):
+ if target_arch == "powerpc":
+ return "ppc"
+ if target_arch == "powerpc64":
+ return "ppc64"
+ return target_arch
+
+cmake_do_generate_toolchain_file() {
+ if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+ cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )"
+ fi
+ cat > ${WORKDIR}/toolchain.cmake <<EOF
+# CMake system name must be something like "Linux".
+# This is important for cross-compiling.
+$cmake_crosscompiling
+set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
+set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} )
+set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
+set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
+set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} )
+set( CMAKE_AR ${OECMAKE_AR} CACHE FILEPATH "Archiver" )
+set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" )
+set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "CXXFLAGS" )
+set( CMAKE_ASM_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "ASM FLAGS" )
+set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "Additional CFLAGS for release" )
+set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "Additional CXXFLAGS for release" )
+set( CMAKE_ASM_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "Additional ASM FLAGS for release" )
+set( CMAKE_C_LINK_FLAGS "${OECMAKE_C_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+
+# only search in the paths provided so cmake doesnt pick
+# up libraries and tools from the native build machine
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+# Use qt.conf settings
+set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
+
+# We need to set the rpath to the correct directory as cmake does not provide any
+# directory as rpath by default
+set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} )
+
+# Use native cmake modules
+list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
+
+# add for non /usr/lib libdir, e.g. /usr/lib64
+set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
+
+EOF
+}
+
+addtask generate_toolchain_file after do_patch before do_configure
+
+CONFIGURE_FILES = "CMakeLists.txt"
+
+cmake_do_configure() {
+ if [ "${OECMAKE_BUILDPATH}" ]; then
+ bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+ fi
+
+ if [ "${S}" != "${B}" ]; then
+ rm -rf ${B}
+ mkdir -p ${B}
+ cd ${B}
+ else
+ find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete
+ fi
+
+ # Just like autotools cmake can use a site file to cache result that need generated binaries to run
+ if [ -e ${WORKDIR}/site-file.cmake ] ; then
+ oecmake_sitefile="-C ${WORKDIR}/site-file.cmake"
+ else
+ oecmake_sitefile=
+ fi
+
+ cmake \
+ ${OECMAKE_GENERATOR_ARGS} \
+ $oecmake_sitefile \
+ ${OECMAKE_SOURCEPATH} \
+ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+ -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+ -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix'))} \
+ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+ -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \
+ -DCMAKE_INSTALL_SO_NO_EXE=0 \
+ -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+ -DCMAKE_VERBOSE_MAKEFILE=1 \
+ -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
+ ${EXTRA_OECMAKE} \
+ -Wno-dev
+}
+
+cmake_runcmake_build() {
+ bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
+ eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD}
+}
+
+cmake_do_compile() {
+ cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE}
+}
+
+cmake_do_install() {
+ DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL}
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file
diff --git a/poky/meta/classes/cml1.bbclass b/poky/meta/classes/cml1.bbclass
new file mode 100644
index 000000000..926747f2b
--- /dev/null
+++ b/poky/meta/classes/cml1.bbclass
@@ -0,0 +1,79 @@
+cml1_do_configure() {
+ set -e
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ oe_runmake oldconfig
+}
+
+EXPORT_FUNCTIONS do_configure
+addtask configure after do_unpack do_patch before do_compile
+
+inherit terminal
+
+OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC"
+HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
+HOSTLDFLAGS = "${BUILD_LDFLAGS}"
+CROSS_CURSES_LIB = "-lncurses -ltinfo"
+CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
+TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
+
+KCONFIG_CONFIG_COMMAND ??= "menuconfig"
+python do_menuconfig() {
+ import shutil
+
+ try:
+ mtime = os.path.getmtime(".config")
+ shutil.copy(".config", ".config.orig")
+ except OSError:
+ mtime = 0
+
+ oe_terminal("${SHELL} -c \"make %s; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"" % d.getVar('KCONFIG_CONFIG_COMMAND'),
+ d.getVar('PN') + ' Configuration', d)
+
+ # FIXME this check can be removed when the minimum bitbake version has been bumped
+ if hasattr(bb.build, 'write_taint'):
+ try:
+ newmtime = os.path.getmtime(".config")
+ except OSError:
+ newmtime = 0
+
+ if newmtime > mtime:
+ bb.note("Configuration changed, recompile will be forced")
+ bb.build.write_taint('do_compile', d)
+}
+do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
+do_menuconfig[nostamp] = "1"
+do_menuconfig[dirs] = "${B}"
+addtask menuconfig after do_configure
+
+python do_diffconfig() {
+ import shutil
+ import subprocess
+
+ workdir = d.getVar('WORKDIR')
+ fragment = workdir + '/fragment.cfg'
+ configorig = '.config.orig'
+ config = '.config'
+
+ try:
+ md5newconfig = bb.utils.md5_file(configorig)
+ md5config = bb.utils.md5_file(config)
+ isdiff = md5newconfig != md5config
+ except IOError as e:
+ bb.fatal("No config files found. Did you do menuconfig ?\n%s" % e)
+
+ if isdiff:
+ statement = 'diff --unchanged-line-format= --old-line-format= --new-line-format="%L" ' + configorig + ' ' + config + '>' + fragment
+ subprocess.call(statement, shell=True)
+ # No need to check the exit code as we know it's going to be
+ # non-zero, but that's what we expect.
+ shutil.copy(configorig, config)
+
+ bb.plain("Config fragment has been dumped into:\n %s" % fragment)
+ else:
+ if os.path.exists(fragment):
+ os.unlink(fragment)
+}
+
+do_diffconfig[nostamp] = "1"
+do_diffconfig[dirs] = "${B}"
+addtask diffconfig
diff --git a/poky/meta/classes/compress_doc.bbclass b/poky/meta/classes/compress_doc.bbclass
new file mode 100644
index 000000000..069d53492
--- /dev/null
+++ b/poky/meta/classes/compress_doc.bbclass
@@ -0,0 +1,260 @@
+# Compress man pages in ${mandir} and info pages in ${infodir}
+#
+# 1. The doc will be compressed to gz format by default.
+#
+# 2. It will automatically correct the compressed doc which is not
+# in ${DOC_COMPRESS} but in ${DOC_COMPRESS_LIST} to the format
+# of ${DOC_COMPRESS} policy
+#
+# 3. It is easy to add a new type compression by editing
+# local.conf, such as:
+# DOC_COMPRESS_LIST_append = ' abc'
+# DOC_COMPRESS = 'abc'
+# DOC_COMPRESS_CMD[abc] = 'abc compress cmd ***'
+# DOC_DECOMPRESS_CMD[abc] = 'abc decompress cmd ***'
+
+# All supported compression policy
+DOC_COMPRESS_LIST ?= "gz xz bz2"
+
+# Compression policy, must be one of ${DOC_COMPRESS_LIST}
+DOC_COMPRESS ?= "gz"
+
+# Compression shell command
+DOC_COMPRESS_CMD[gz] ?= 'gzip -v -9 -n'
+DOC_COMPRESS_CMD[bz2] ?= "bzip2 -v -9"
+DOC_COMPRESS_CMD[xz] ?= "xz -v"
+
+# Decompression shell command
+DOC_DECOMPRESS_CMD[gz] ?= 'gunzip -v'
+DOC_DECOMPRESS_CMD[bz2] ?= "bunzip2 -v"
+DOC_DECOMPRESS_CMD[xz] ?= "unxz -v"
+
+PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives"
+python package_do_compress_doc() {
+ compress_mode = d.getVar('DOC_COMPRESS')
+ compress_list = (d.getVar('DOC_COMPRESS_LIST') or '').split()
+ if compress_mode not in compress_list:
+ bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list))
+
+ dvar = d.getVar('PKGD')
+ compress_cmds = {}
+ decompress_cmds = {}
+ for mode in compress_list:
+ compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode)
+ decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode)
+
+ mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
+ if os.path.exists(mandir):
+ # Decompress doc files which format is not compress_mode
+ decompress_doc(mandir, compress_mode, decompress_cmds)
+ compress_doc(mandir, compress_mode, compress_cmds)
+
+ infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
+ if os.path.exists(infodir):
+ # Decompress doc files which format is not compress_mode
+ decompress_doc(infodir, compress_mode, decompress_cmds)
+ compress_doc(infodir, compress_mode, compress_cmds)
+}
+
+def _get_compress_format(file, compress_format_list):
+ for compress_format in compress_format_list:
+ compress_suffix = '.' + compress_format
+ if file.endswith(compress_suffix):
+ return compress_format
+
+ return ''
+
+# Collect hardlinks to dict, each element in dict lists hardlinks
+# which points to the same doc file.
+# {hardlink10: [hardlink11, hardlink12],,,}
+# The hardlink10, hardlink11 and hardlink12 are the same file.
+def _collect_hardlink(hardlink_dict, file):
+ for hardlink in hardlink_dict:
+ # Add to the existed hardlink
+ if os.path.samefile(hardlink, file):
+ hardlink_dict[hardlink].append(file)
+ return hardlink_dict
+
+ hardlink_dict[file] = []
+ return hardlink_dict
+
+def _process_hardlink(hardlink_dict, compress_mode, shell_cmds, decompress=False):
+ for target in hardlink_dict:
+ if decompress:
+ compress_format = _get_compress_format(target, shell_cmds.keys())
+ cmd = "%s -f %s" % (shell_cmds[compress_format], target)
+ bb.note('decompress hardlink %s' % target)
+ else:
+ cmd = "%s -f %s" % (shell_cmds[compress_mode], target)
+ bb.note('compress hardlink %s' % target)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.warn("de/compress file failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+ return
+
+ for hardlink_dup in hardlink_dict[target]:
+ if decompress:
+ # Remove compress suffix
+ compress_suffix = '.' + compress_format
+ new_hardlink = hardlink_dup[:-len(compress_suffix)]
+ new_target = target[:-len(compress_suffix)]
+ else:
+ # Append compress suffix
+ compress_suffix = '.' + compress_mode
+ new_hardlink = hardlink_dup + compress_suffix
+ new_target = target + compress_suffix
+
+ bb.note('hardlink %s-->%s' % (new_hardlink, new_target))
+ if not os.path.exists(new_hardlink):
+ os.link(new_target, new_hardlink)
+ if os.path.exists(hardlink_dup):
+ os.unlink(hardlink_dup)
+
+def _process_symlink(file, compress_format, decompress=False):
+ compress_suffix = '.' + compress_format
+ if decompress:
+ # Remove compress suffix
+ new_linkname = file[:-len(compress_suffix)]
+ new_source = os.readlink(file)[:-len(compress_suffix)]
+ else:
+ # Append compress suffix
+ new_linkname = file + compress_suffix
+ new_source = os.readlink(file) + compress_suffix
+
+ bb.note('symlink %s-->%s' % (new_linkname, new_source))
+ if not os.path.exists(new_linkname):
+ os.symlink(new_source, new_linkname)
+
+ os.unlink(file)
+
+def _is_info(file):
+ flags = '.info .info-'.split()
+ for flag in flags:
+ if flag in os.path.basename(file):
+ return True
+
+ return False
+
+def _is_man(file):
+ import re
+
+ # It refers MANSECT-var in man(1.6g)'s man.config
+ # ".1:.1p:.8:.2:.3:.3p:.4:.5:.6:.7:.9:.0p:.tcl:.n:.l:.p:.o"
+ # Not start with '.', and contain the above colon-seperate element
+ p = re.compile(r'[^\.]+\.([1-9lnop]|0p|tcl)')
+ if p.search(file):
+ return True
+
+ return False
+
+def _is_compress_doc(file, compress_format_list):
+ compress_format = _get_compress_format(file, compress_format_list)
+ compress_suffix = '.' + compress_format
+ if file.endswith(compress_suffix):
+ # Remove the compress suffix
+ uncompress_file = file[:-len(compress_suffix)]
+ if _is_info(uncompress_file) or _is_man(uncompress_file):
+ return True, compress_format
+
+ return False, ''
+
+def compress_doc(topdir, compress_mode, compress_cmds):
+ hardlink_dict = {}
+ for root, dirs, files in os.walk(topdir):
+ for f in files:
+ file = os.path.join(root, f)
+ if os.path.isdir(file):
+ continue
+
+ if _is_info(file) or _is_man(file):
+ # Symlink
+ if os.path.islink(file):
+ _process_symlink(file, compress_mode)
+ # Hardlink
+ elif os.lstat(file).st_nlink > 1:
+ _collect_hardlink(hardlink_dict, file)
+ # Normal file
+ elif os.path.isfile(file):
+ cmd = "%s %s" % (compress_cmds[compress_mode], file)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+ continue
+ bb.note('compress file %s' % file)
+
+ _process_hardlink(hardlink_dict, compress_mode, compress_cmds)
+
+# Decompress doc files which format is not compress_mode
+def decompress_doc(topdir, compress_mode, decompress_cmds):
+ hardlink_dict = {}
+ decompress = True
+ for root, dirs, files in os.walk(topdir):
+ for f in files:
+ file = os.path.join(root, f)
+ if os.path.isdir(file):
+ continue
+
+ res, compress_format = _is_compress_doc(file, decompress_cmds.keys())
+ # Decompress files which format is not compress_mode
+ if res and compress_mode!=compress_format:
+ # Symlink
+ if os.path.islink(file):
+ _process_symlink(file, compress_format, decompress)
+ # Hardlink
+ elif os.lstat(file).st_nlink > 1:
+ _collect_hardlink(hardlink_dict, file)
+ # Normal file
+ elif os.path.isfile(file):
+ cmd = "%s %s" % (decompress_cmds[compress_format], file)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.warn("decompress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+ continue
+ bb.note('decompress file %s' % file)
+
+ _process_hardlink(hardlink_dict, compress_mode, decompress_cmds, decompress)
+
+python compress_doc_updatealternatives () {
+ if not bb.data.inherits_class('update-alternatives', d):
+ return
+
+ mandir = d.getVar("mandir")
+ infodir = d.getVar("infodir")
+ compress_mode = d.getVar('DOC_COMPRESS')
+ for pkg in (d.getVar('PACKAGES') or "").split():
+ old_names = (d.getVar('ALTERNATIVE_%s' % pkg) or "").split()
+ new_names = []
+ for old_name in old_names:
+ old_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name)
+ old_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name) or \
+ d.getVarFlag('ALTERNATIVE_TARGET', old_name) or \
+ d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or \
+ d.getVar('ALTERNATIVE_TARGET') or \
+ old_link
+ # Sometimes old_target is specified as relative to the link name.
+ old_target = os.path.join(os.path.dirname(old_link), old_target)
+
+ # The updatealternatives used for compress doc
+ if mandir in old_target or infodir in old_target:
+ new_name = old_name + '.' + compress_mode
+ new_link = old_link + '.' + compress_mode
+ new_target = old_target + '.' + compress_mode
+ d.delVarFlag('ALTERNATIVE_LINK_NAME', old_name)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', new_name, new_link)
+ if d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name):
+ d.delVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name)
+ d.setVarFlag('ALTERNATIVE_TARGET_%s' % pkg, new_name, new_target)
+ elif d.getVarFlag('ALTERNATIVE_TARGET', old_name):
+ d.delVarFlag('ALTERNATIVE_TARGET', old_name)
+ d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
+ elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg):
+ d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
+ elif d.getVar('ALTERNATIVE_TARGET'):
+ d.setVar('ALTERNATIVE_TARGET', new_target)
+
+ new_names.append(new_name)
+
+ if new_names:
+ d.setVar('ALTERNATIVE_%s' % pkg, ' '.join(new_names))
+}
+
diff --git a/poky/meta/classes/copyleft_compliance.bbclass b/poky/meta/classes/copyleft_compliance.bbclass
new file mode 100644
index 000000000..eabf12ce7
--- /dev/null
+++ b/poky/meta/classes/copyleft_compliance.bbclass
@@ -0,0 +1,64 @@
+# Deploy sources for recipes for compliance with copyleft-style licenses
+# Defaults to using symlinks, as it's a quick operation, and one can easily
+# follow the links when making use of the files (e.g. tar with the -h arg).
+#
+# vi:sts=4:sw=4:et
+
+inherit copyleft_filter
+
+COPYLEFT_SOURCES_DIR ?= '${DEPLOY_DIR}/copyleft_sources'
+
+python do_prepare_copyleft_sources () {
+ """Populate a tree of the recipe sources and emit patch series files"""
+ import os.path
+ import shutil
+
+ p = d.getVar('P')
+ included, reason = copyleft_should_include(d)
+ if not included:
+ bb.debug(1, 'copyleft: %s is excluded: %s' % (p, reason))
+ return
+ else:
+ bb.debug(1, 'copyleft: %s is included: %s' % (p, reason))
+
+ sources_dir = d.getVar('COPYLEFT_SOURCES_DIR')
+ dl_dir = d.getVar('DL_DIR')
+ src_uri = d.getVar('SRC_URI').split()
+ fetch = bb.fetch2.Fetch(src_uri, d)
+ ud = fetch.ud
+
+ pf = d.getVar('PF')
+ dest = os.path.join(sources_dir, pf)
+ shutil.rmtree(dest, ignore_errors=True)
+ bb.utils.mkdirhier(dest)
+
+ for u in ud.values():
+ local = os.path.normpath(fetch.localpath(u.url))
+ if local.endswith('.bb'):
+ continue
+ elif local.endswith('/'):
+ local = local[:-1]
+
+ if u.mirrortarball:
+ tarball_path = os.path.join(dl_dir, u.mirrortarball)
+ if os.path.exists(tarball_path):
+ local = tarball_path
+
+ oe.path.symlink(local, os.path.join(dest, os.path.basename(local)), force=True)
+
+ patches = src_patches(d)
+ for patch in patches:
+ _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+ patchdir = parm.get('patchdir')
+ if patchdir:
+ series = os.path.join(dest, 'series.subdir.%s' % patchdir.replace('/', '_'))
+ else:
+ series = os.path.join(dest, 'series')
+
+ with open(series, 'a') as s:
+ s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
+}
+
+addtask prepare_copyleft_sources after do_fetch before do_build
+do_prepare_copyleft_sources[dirs] = "${WORKDIR}"
+do_build[recrdeptask] += 'do_prepare_copyleft_sources'
diff --git a/poky/meta/classes/copyleft_filter.bbclass b/poky/meta/classes/copyleft_filter.bbclass
new file mode 100644
index 000000000..c36bce431
--- /dev/null
+++ b/poky/meta/classes/copyleft_filter.bbclass
@@ -0,0 +1,79 @@
+# Filter the license, the copyleft_should_include returns True for the
+# COPYLEFT_LICENSE_INCLUDE recipe, and False for the
+# COPYLEFT_LICENSE_EXCLUDE.
+#
+# By default, includes all GPL and LGPL, and excludes CLOSED and Proprietary.
+#
+# vi:sts=4:sw=4:et
+
+COPYLEFT_LICENSE_INCLUDE ?= 'GPL* LGPL* AGPL*'
+COPYLEFT_LICENSE_INCLUDE[type] = 'list'
+COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which include licenses'
+
+COPYLEFT_LICENSE_EXCLUDE ?= 'CLOSED Proprietary'
+COPYLEFT_LICENSE_EXCLUDE[type] = 'list'
+COPYLEFT_LICENSE_EXCLUDE[doc] = 'Space separated list of globs which exclude licenses'
+
+COPYLEFT_RECIPE_TYPE ?= '${@copyleft_recipe_type(d)}'
+COPYLEFT_RECIPE_TYPE[doc] = 'The "type" of the current recipe (e.g. target, native, cross)'
+
+COPYLEFT_RECIPE_TYPES ?= 'target'
+COPYLEFT_RECIPE_TYPES[type] = 'list'
+COPYLEFT_RECIPE_TYPES[doc] = 'Space separated list of recipe types to include'
+
+COPYLEFT_AVAILABLE_RECIPE_TYPES = 'target native nativesdk cross crosssdk cross-canadian'
+COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list'
+COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types'
+
+COPYLEFT_PN_INCLUDE ?= ''
+COPYLEFT_PN_INCLUDE[type] = 'list'
+COPYLEFT_PN_INCLUDE[doc] = 'Space separated list of recipe names to include'
+
+COPYLEFT_PN_EXCLUDE ?= ''
+COPYLEFT_PN_EXCLUDE[type] = 'list'
+COPYLEFT_PN_EXCLUDE[doc] = 'Space separated list of recipe names to exclude'
+
+def copyleft_recipe_type(d):
+ for recipe_type in oe.data.typed_value('COPYLEFT_AVAILABLE_RECIPE_TYPES', d):
+ if oe.utils.inherits(d, recipe_type):
+ return recipe_type
+ return 'target'
+
+def copyleft_should_include(d):
+ """
+ Determine if this recipe's sources should be deployed for compliance
+ """
+ import ast
+ import oe.license
+ from fnmatch import fnmatchcase as fnmatch
+
+ recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE')
+ if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d):
+ included, motive = False, 'recipe type "%s" is excluded' % recipe_type
+ else:
+ included, motive = False, 'recipe did not match anything'
+
+ include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d)
+ exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d)
+
+ try:
+ is_included, reason = oe.license.is_included(d.getVar('LICENSE'), include, exclude)
+ except oe.license.LicenseError as exc:
+ bb.fatal('%s: %s' % (d.getVar('PF'), exc))
+ else:
+ if is_included:
+ if reason:
+ included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason)
+ else:
+ included, motive = False, 'recipe does not include a copyleft license'
+ else:
+ included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason)
+
+ if any(fnmatch(d.getVar('PN'), name) \
+ for name in oe.data.typed_value('COPYLEFT_PN_INCLUDE', d)):
+ included, motive = True, 'recipe included by name'
+ if any(fnmatch(d.getVar('PN'), name) \
+ for name in oe.data.typed_value('COPYLEFT_PN_EXCLUDE', d)):
+ included, motive = False, 'recipe excluded by name'
+
+ return included, motive
diff --git a/poky/meta/classes/core-image.bbclass b/poky/meta/classes/core-image.bbclass
new file mode 100644
index 000000000..a9a2cec68
--- /dev/null
+++ b/poky/meta/classes/core-image.bbclass
@@ -0,0 +1,72 @@
+# Common code for generating core reference images
+#
+# Copyright (C) 2007-2011 Linux Foundation
+
+# IMAGE_FEATURES control content of the core reference images
+#
+# By default we install packagegroup-core-boot and packagegroup-base-extended packages;
+# this gives us working (console only) rootfs.
+#
+# Available IMAGE_FEATURES:
+#
+# - x11 - X server
+# - x11-base - X server with minimal environment
+# - x11-sato - OpenedHand Sato environment
+# - tools-debug - debugging tools
+# - eclipse-debug - Eclipse remote debugging support
+# - tools-profile - profiling tools
+# - tools-testapps - tools usable to make some device tests
+# - tools-sdk - SDK (C/C++ compiler, autotools, etc.)
+# - nfs-server - NFS server
+# - nfs-client - NFS client
+# - ssh-server-dropbear - SSH server (dropbear)
+# - ssh-server-openssh - SSH server (openssh)
+# - hwcodecs - Install hardware acceleration codecs
+# - package-management - installs package management tools and preserves the package manager database
+# - debug-tweaks - makes an image suitable for development, e.g. allowing passwordless root logins
+# - empty-root-password
+# - allow-empty-password
+# - post-install-logging
+# - dev-pkgs - development packages (headers, etc.) for all installed packages in the rootfs
+# - dbg-pkgs - debug symbol packages for all installed packages in the rootfs
+# - doc-pkgs - documentation packages for all installed packages in the rootfs
+# - ptest-pkgs - ptest packages for all ptest-enabled recipes
+# - read-only-rootfs - tweaks an image to support read-only rootfs
+# - splash - bootup splash screen
+#
+FEATURE_PACKAGES_x11 = "packagegroup-core-x11"
+FEATURE_PACKAGES_x11-base = "packagegroup-core-x11-base"
+FEATURE_PACKAGES_x11-sato = "packagegroup-core-x11-sato"
+FEATURE_PACKAGES_tools-debug = "packagegroup-core-tools-debug"
+FEATURE_PACKAGES_eclipse-debug = "packagegroup-core-eclipse-debug"
+FEATURE_PACKAGES_tools-profile = "packagegroup-core-tools-profile"
+FEATURE_PACKAGES_tools-testapps = "packagegroup-core-tools-testapps"
+FEATURE_PACKAGES_tools-sdk = "packagegroup-core-sdk packagegroup-core-standalone-sdk-target"
+FEATURE_PACKAGES_nfs-server = "packagegroup-core-nfs-server"
+FEATURE_PACKAGES_nfs-client = "packagegroup-core-nfs-client"
+FEATURE_PACKAGES_ssh-server-dropbear = "packagegroup-core-ssh-dropbear"
+FEATURE_PACKAGES_ssh-server-openssh = "packagegroup-core-ssh-openssh"
+FEATURE_PACKAGES_hwcodecs = "${MACHINE_HWCODECS}"
+
+
+# IMAGE_FEATURES_REPLACES_foo = 'bar1 bar2'
+# Including image feature foo would replace the image features bar1 and bar2
+IMAGE_FEATURES_REPLACES_ssh-server-openssh = "ssh-server-dropbear"
+
+# IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2'
+# An error exception would be raised if both image features foo and bar1(or bar2) are included
+
+MACHINE_HWCODECS ??= ""
+
+CORE_IMAGE_BASE_INSTALL = '\
+ packagegroup-core-boot \
+ packagegroup-base-extended \
+ \
+ ${CORE_IMAGE_EXTRA_INSTALL} \
+ '
+
+CORE_IMAGE_EXTRA_INSTALL ?= ""
+
+IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
+
+inherit image
diff --git a/poky/meta/classes/cpan-base.bbclass b/poky/meta/classes/cpan-base.bbclass
new file mode 100644
index 000000000..577fcd63c
--- /dev/null
+++ b/poky/meta/classes/cpan-base.bbclass
@@ -0,0 +1,18 @@
+#
+# cpan-base providers various perl related information needed for building
+# cpan modules
+#
+FILES_${PN} += "${libdir}/perl ${datadir}/perl"
+
+DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
+RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
+
+inherit perl-version
+
+def is_target(d):
+ if not bb.data.inherits_class('native', d):
+ return "yes"
+ return "no"
+
+PERLLIBDIRS = "${libdir}/perl"
+PERLLIBDIRS_class-native = "${libdir}/perl-native"
diff --git a/poky/meta/classes/cpan.bbclass b/poky/meta/classes/cpan.bbclass
new file mode 100644
index 000000000..8e079e0d5
--- /dev/null
+++ b/poky/meta/classes/cpan.bbclass
@@ -0,0 +1,55 @@
+#
+# This is for perl modules that use the old Makefile.PL build system
+#
+inherit cpan-base perlnative
+
+EXTRA_CPANFLAGS ?= ""
+EXTRA_PERLFLAGS ?= ""
+
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+
+# Env var which tells perl where the perl include files are
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/"
+
+cpan_do_configure () {
+ export PERL5LIB="${PERL_ARCHLIB}"
+ yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL INSTALLDIRS=vendor ${EXTRA_CPANFLAGS}
+
+ # Makefile.PLs can exit with success without generating a
+ # Makefile, e.g. in cases of missing configure time
+ # dependencies. This is considered a best practice by
+ # cpantesters.org. See:
+ # * http://wiki.cpantesters.org/wiki/CPANAuthorNotes
+ # * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html
+ [ -e Makefile ] || bbfatal "No Makefile was generated by Makefile.PL"
+
+ if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+ . ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh
+ # Use find since there can be a Makefile generated for each Makefile.PL
+ for f in `find -name Makefile.PL`; do
+ f2=`echo $f | sed -e 's/.PL//'`
+ test -f $f2 || continue
+ sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
+ -e 's/perl.real/perl/' \
+ -e "s|^\(CCFLAGS =.*\)|\1 ${CFLAGS}|" \
+ $f2
+ done
+ fi
+}
+
+cpan_do_compile () {
+ oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
+}
+
+cpan_do_install () {
+ oe_runmake DESTDIR="${D}" install_vendor
+ for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do
+ sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT
+ done
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/poky/meta/classes/cpan_build.bbclass b/poky/meta/classes/cpan_build.bbclass
new file mode 100644
index 000000000..fac074d61
--- /dev/null
+++ b/poky/meta/classes/cpan_build.bbclass
@@ -0,0 +1,40 @@
+#
+# This is for perl modules that use the new Build.PL build system
+#
+inherit cpan-base perlnative
+
+EXTRA_CPAN_BUILD_FLAGS ?= ""
+
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/"
+export LD = "${CCLD}"
+
+cpan_build_do_configure () {
+ if [ "${@is_target(d)}" = "yes" ]; then
+ # build for target
+ . ${STAGING_LIBDIR}/perl/config.sh
+ fi
+
+ perl Build.PL --installdirs vendor --destdir ${D} \
+ ${EXTRA_CPAN_BUILD_FLAGS}
+
+ # Build.PLs can exit with success without generating a
+ # Build, e.g. in cases of missing configure time
+ # dependencies. This is considered a best practice by
+ # cpantesters.org. See:
+ # * http://wiki.cpantesters.org/wiki/CPANAuthorNotes
+ # * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html
+ [ -e Build ] || bbfatal "No Build was generated by Build.PL"
+}
+
+cpan_build_do_compile () {
+ perl Build verbose=1
+}
+
+cpan_build_do_install () {
+ perl Build install --destdir ${D}
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/poky/meta/classes/cross-canadian.bbclass b/poky/meta/classes/cross-canadian.bbclass
new file mode 100644
index 000000000..ee8aa6142
--- /dev/null
+++ b/poky/meta/classes/cross-canadian.bbclass
@@ -0,0 +1,192 @@
+#
+# NOTE - When using this class the user is responsible for ensuring that
+# TRANSLATED_TARGET_ARCH is added into PN. This ensures that if the TARGET_ARCH
+# is changed, another nativesdk xxx-canadian-cross can be installed
+#
+
+
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency. No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+CLASSOVERRIDE = "class-cross-canadian"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+#
+# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
+#
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
+BASECANADIANEXTRAOS ?= "linux-musl"
+CANADIANEXTRAOS = "${BASECANADIANEXTRAOS}"
+CANADIANEXTRAVENDOR = ""
+MODIFYTOS ??= "1"
+python () {
+ archs = d.getVar('PACKAGE_ARCHS').split()
+ sdkarchs = []
+ for arch in archs:
+ sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
+ d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
+
+ # Allow the following code segment to be disabled, e.g. meta-environment
+ if d.getVar("MODIFYTOS") != "1":
+ return
+
+ if d.getVar("TCLIBC") == "baremetal":
+ return
+
+ tos = d.getVar("TARGET_OS")
+ whitelist = []
+ extralibcs = [""]
+ if "musl" in d.getVar("BASECANADIANEXTRAOS"):
+ extralibcs.append("musl")
+ for variant in ["", "spe", "x32", "eabi", "n32", "_ilp32"]:
+ for libc in extralibcs:
+ entry = "linux"
+ if variant and libc:
+ entry = entry + "-" + libc + variant
+ elif variant:
+ entry = entry + "-gnu" + variant
+ elif libc:
+ entry = entry + "-" + libc
+ whitelist.append(entry)
+ if tos not in whitelist:
+ bb.fatal("Building cross-candian for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS"))
+
+ for n in ["PROVIDES", "DEPENDS"]:
+ d.setVar(n, d.getVar(n))
+ d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN"))
+ for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
+ n = prefix + "_FOR_TARGET"
+ d.setVar(n, d.getVar(n))
+ # This is a bit ugly. We need to zero LIBC/ABI extension which will change TARGET_OS
+ # however we need the old value in some variables. We expand those here first.
+ tarch = d.getVar("TARGET_ARCH")
+ if tarch == "x86_64":
+ d.setVar("LIBCEXTENSION", "")
+ d.setVar("ABIEXTENSION", "")
+ d.appendVar("CANADIANEXTRAOS", " linux-gnux32")
+ for extraos in d.getVar("BASECANADIANEXTRAOS").split():
+ d.appendVar("CANADIANEXTRAOS", " " + extraos + "x32")
+ elif tarch == "powerpc":
+ # PowerPC can build "linux" and "linux-gnuspe"
+ d.setVar("LIBCEXTENSION", "")
+ d.setVar("ABIEXTENSION", "")
+ d.appendVar("CANADIANEXTRAOS", " linux-gnuspe")
+ for extraos in d.getVar("BASECANADIANEXTRAOS").split():
+ d.appendVar("CANADIANEXTRAOS", " " + extraos + "spe")
+ elif tarch == "mips64":
+ d.appendVar("CANADIANEXTRAOS", " linux-gnun32")
+ for extraos in d.getVar("BASECANADIANEXTRAOS").split():
+ d.appendVar("CANADIANEXTRAOS", " " + extraos + "n32")
+ if tarch == "arm" or tarch == "armeb":
+ d.appendVar("CANADIANEXTRAOS", " linux-gnueabi linux-musleabi")
+ d.setVar("TARGET_OS", "linux-gnueabi")
+ else:
+ d.setVar("TARGET_OS", "linux")
+
+ # Also need to handle multilib target vendors
+ vendors = d.getVar("CANADIANEXTRAVENDOR")
+ if not vendors:
+ vendors = all_multilib_tune_values(d, 'TARGET_VENDOR')
+ origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL")
+ if origvendor:
+ d.setVar("TARGET_VENDOR", origvendor)
+ if origvendor not in vendors.split():
+ vendors = origvendor + " " + vendors
+ d.setVar("CANADIANEXTRAVENDOR", vendors)
+}
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGING_DIR_HOST = "${RECIPE_SYSROOT}"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
+
+PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
+PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+HOST_LD_ARCH = "${SDK_LD_ARCH}"
+HOST_AS_ARCH = "${SDK_AS_ARCH}"
+
+#assign DPKG_ARCH
+DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH'), '')}"
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS} \
+ -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
+ -Wl,-rpath,${libdir}/.. "
+
+#
+# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
+# binaries
+#
+DEPENDS_append = " chrpath-replacement-native"
+EXTRANATIVEPATH += "chrpath-native"
+
+# Path mangling needed by the cross packaging
+# Note that we use := here to ensure that libdir and includedir are
+# target paths.
+target_base_prefix := "${base_prefix}"
+target_prefix := "${prefix}"
+target_exec_prefix := "${exec_prefix}"
+target_base_libdir = "${target_base_prefix}/${baselib}"
+target_libdir = "${target_exec_prefix}/${baselib}"
+target_includedir := "${includedir}"
+
+# Change to place files in SDKPATH
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+bindir = "${exec_prefix}/bin/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+sbindir = "${bindir}"
+base_bindir = "${bindir}"
+base_sbindir = "${bindir}"
+libdir = "${exec_prefix}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+libexecdir = "${exec_prefix}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+FILES_${PN} = "${prefix}"
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
+
+# We have to us TARGET_ARCH but we care about the absolute value
+# and not any particular tune that is enabled.
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
+# If MLPREFIX is set by multilib code, shlibs
+# points to the wrong place so force it
+SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs2"
+SHLIBSWORKDIR = "${PKGDATA_DIR}/nativesdk-shlibs2"
+
+cross_canadian_bindirlinks () {
+ for i in linux ${CANADIANEXTRAOS}
+ do
+ for v in ${CANADIANEXTRAVENDOR}
+ do
+ d=${D}${bindir}/../${TARGET_ARCH}$v-$i
+ if [ -d $d ];
+ then
+ continue
+ fi
+ install -d $d
+ for j in `ls ${D}${bindir}`
+ do
+ p=${TARGET_ARCH}$v-$i-`echo $j | sed -e s,${TARGET_PREFIX},,`
+ ln -s ../${TARGET_SYS}/$j $d/$p
+ done
+ done
+ done
+}
diff --git a/poky/meta/classes/cross.bbclass b/poky/meta/classes/cross.bbclass
new file mode 100644
index 000000000..4e85cab2d
--- /dev/null
+++ b/poky/meta/classes/cross.bbclass
@@ -0,0 +1,97 @@
+inherit relocatable
+
+# Cross packages are built indirectly via dependency,
+# no need for them to be a direct target of 'world'
+EXCLUDE_FROM_WORLD = "1"
+
+CLASSOVERRIDE = "class-cross"
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+PACKAGES_DYNAMIC_class-native = ""
+
+HOST_ARCH = "${BUILD_ARCH}"
+HOST_VENDOR = "${BUILD_VENDOR}"
+HOST_OS = "${BUILD_OS}"
+HOST_PREFIX = "${BUILD_PREFIX}"
+HOST_CC_ARCH = "${BUILD_CC_ARCH}"
+HOST_LD_ARCH = "${BUILD_LD_ARCH}"
+HOST_AS_ARCH = "${BUILD_AS_ARCH}"
+
+export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir} /lib /lib64 /usr/lib /usr/lib64"
+
+STAGING_DIR_HOST = "${RECIPE_SYSROOT_NATIVE}"
+
+PACKAGE_ARCH = "${BUILD_ARCH}"
+
+MULTIMACH_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+
+export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = ""
+
+TARGET_CPPFLAGS = ""
+TARGET_CFLAGS = ""
+TARGET_CXXFLAGS = ""
+TARGET_LDFLAGS = ""
+
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXXFLAGS = "${BUILD_CFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
+LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}"
+
+TOOLCHAIN_OPTIONS = ""
+
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
+# Path mangling needed by the cross packaging
+# Note that we use := here to ensure that libdir and includedir are
+# target paths.
+target_base_prefix := "${root_prefix}"
+target_prefix := "${prefix}"
+target_exec_prefix := "${exec_prefix}"
+target_base_libdir = "${target_base_prefix}/${baselib}"
+target_libdir = "${target_exec_prefix}/${baselib}"
+target_includedir := "${includedir}"
+
+# Overrides for paths
+CROSS_TARGET_SYS_DIR = "${TARGET_SYS}"
+prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+base_prefix = "${STAGING_DIR_NATIVE}"
+exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+bindir = "${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}"
+sbindir = "${bindir}"
+base_bindir = "${bindir}"
+base_sbindir = "${bindir}"
+libdir = "${exec_prefix}/lib/${CROSS_TARGET_SYS_DIR}"
+libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+USE_NLS = "no"
+
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export FC = "${BUILD_FC}"
+export CPP = "${BUILD_CPP}"
+export LD = "${BUILD_LD}"
+export CCLD = "${BUILD_CCLD}"
+export AR = "${BUILD_AR}"
+export AS = "${BUILD_AS}"
+export RANLIB = "${BUILD_RANLIB}"
+export STRIP = "${BUILD_STRIP}"
+export NM = "${BUILD_NM}"
+
+inherit nopackages
+
+python do_addto_recipe_sysroot () {
+ bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask addto_recipe_sysroot after do_populate_sysroot
diff --git a/poky/meta/classes/crosssdk.bbclass b/poky/meta/classes/crosssdk.bbclass
new file mode 100644
index 000000000..ddb98d22b
--- /dev/null
+++ b/poky/meta/classes/crosssdk.bbclass
@@ -0,0 +1,44 @@
+inherit cross
+
+CLASSOVERRIDE = "class-crosssdk"
+MACHINEOVERRIDES = ""
+PACKAGE_ARCH = "${SDK_ARCH}"
+python () {
+ # set TUNE_PKGARCH to SDK_ARCH
+ d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH'))
+}
+
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+TARGET_LD_ARCH = "${SDK_LD_ARCH}"
+TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILD_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
+TARGET_FPU = ""
+
+
+target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}"
+target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}"
+target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}"
+target_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+target_exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+baselib = "lib"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+# Need to force this to ensure consitency across architectures
+EXTRA_OECONF_GCC_FLOAT = ""
+
+USE_NLS = "no"
diff --git a/poky/meta/classes/cve-check.bbclass b/poky/meta/classes/cve-check.bbclass
new file mode 100644
index 000000000..537659df1
--- /dev/null
+++ b/poky/meta/classes/cve-check.bbclass
@@ -0,0 +1,290 @@
+# This class is used to check recipes against public CVEs.
+#
+# In order to use this class just inherit the class in the
+# local.conf file and it will add the cve_check task for
+# every recipe. The task can be used per recipe, per image,
+# or using the special cases "world" and "universe". The
+# cve_check task will print a warning for every unpatched
+# CVE found and generate a file in the recipe WORKDIR/cve
+# directory. If an image is build it will generate a report
+# in DEPLOY_DIR_IMAGE for all the packages used.
+#
+# Example:
+# bitbake -c cve_check openssl
+# bitbake core-image-sato
+# bitbake -k -c cve_check universe
+#
+# DISCLAIMER
+#
+# This class/tool is meant to be used as support and not
+# the only method to check against CVEs. Running this tool
+# doesn't guarantee your packages are free of CVEs.
+
+# The product name that the CVE database uses. Defaults to BPN, but may need to
+# be overriden per recipe (for example tiff.bb sets CVE_PRODUCT=libtiff).
+CVE_PRODUCT ??= "${BPN}"
+CVE_VERSION ??= "${PV}"
+
+CVE_CHECK_DB_DIR ?= "${DL_DIR}/CVE_CHECK"
+CVE_CHECK_DB_FILE ?= "${CVE_CHECK_DB_DIR}/nvd.db"
+
+CVE_CHECK_LOG ?= "${T}/cve.log"
+CVE_CHECK_TMP_FILE ?= "${TMPDIR}/cve_check"
+
+CVE_CHECK_DIR ??= "${DEPLOY_DIR}/cve"
+CVE_CHECK_MANIFEST ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cve"
+CVE_CHECK_COPY_FILES ??= "1"
+CVE_CHECK_CREATE_MANIFEST ??= "1"
+
+# Whitelist for packages (PN)
+CVE_CHECK_PN_WHITELIST = "\
+ glibc-locale \
+"
+
+# Whitelist for CVE and version of package
+CVE_CHECK_CVE_WHITELIST = "{\
+ 'CVE-2014-2524': ('6.3','5.2',), \
+}"
+
+python do_cve_check () {
+ """
+ Check recipe for patched and unpatched CVEs
+ """
+
+ if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE")):
+ patched_cves = get_patches_cves(d)
+ patched, unpatched = check_cves(d, patched_cves)
+ if patched or unpatched:
+ cve_data = get_cve_info(d, patched + unpatched)
+ cve_write_data(d, patched, unpatched, cve_data)
+ else:
+ bb.note("Failed to update CVE database, skipping CVE check")
+}
+
+addtask cve_check after do_unpack before do_build
+do_cve_check[depends] = "cve-check-tool-native:do_populate_sysroot cve-check-tool-native:do_populate_cve_db"
+do_cve_check[nostamp] = "1"
+
+python cve_check_cleanup () {
+ """
+ Delete the file used to gather all the CVE information.
+ """
+
+ bb.utils.remove(e.data.getVar("CVE_CHECK_TMP_FILE"))
+}
+
+addhandler cve_check_cleanup
+cve_check_cleanup[eventmask] = "bb.cooker.CookerExit"
+
+python cve_check_write_rootfs_manifest () {
+ """
+ Create CVE manifest when building an image
+ """
+
+ import shutil
+
+ if d.getVar("CVE_CHECK_COPY_FILES") == "1":
+ deploy_file = os.path.join(d.getVar("CVE_CHECK_DIR"), d.getVar("PN"))
+ if os.path.exists(deploy_file):
+ bb.utils.remove(deploy_file)
+
+ if os.path.exists(d.getVar("CVE_CHECK_TMP_FILE")):
+ bb.note("Writing rootfs CVE manifest")
+ deploy_dir = d.getVar("DEPLOY_DIR_IMAGE")
+ link_name = d.getVar("IMAGE_LINK_NAME")
+ manifest_name = d.getVar("CVE_CHECK_MANIFEST")
+ cve_tmp_file = d.getVar("CVE_CHECK_TMP_FILE")
+
+ shutil.copyfile(cve_tmp_file, manifest_name)
+
+ if manifest_name and os.path.exists(manifest_name):
+ manifest_link = os.path.join(deploy_dir, "%s.cve" % link_name)
+ # If we already have another manifest, update symlinks
+ if os.path.exists(os.path.realpath(manifest_link)):
+ os.remove(manifest_link)
+ os.symlink(os.path.basename(manifest_name), manifest_link)
+ bb.plain("Image CVE report stored in: %s" % manifest_name)
+}
+
+ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"
+do_rootfs[recrdeptask] += "${@'do_cve_check' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"
+
+def get_patches_cves(d):
+ """
+ Get patches that solve CVEs using the "CVE: " tag.
+ """
+
+ import re
+
+ pn = d.getVar("PN")
+ cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+")
+
+ # Matches last CVE-1234-211432 in the file name, also if written
+ # with small letters. Not supporting multiple CVE id's in a single
+ # file name.
+ cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)")
+
+ patched_cves = set()
+ bb.debug(2, "Looking for patches that solves CVEs for %s" % pn)
+ for url in src_patches(d):
+ patch_file = bb.fetch.decodeurl(url)[2]
+
+ # Check patch file name for CVE ID
+ fname_match = cve_file_name_match.search(patch_file)
+ if fname_match:
+ cve = fname_match.group(1).upper()
+ patched_cves.add(cve)
+ bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file))
+
+ with open(patch_file, "r", encoding="utf-8") as f:
+ try:
+ patch_text = f.read()
+ except UnicodeDecodeError:
+ bb.debug(1, "Failed to read patch %s using UTF-8 encoding"
+ " trying with iso8859-1" % patch_file)
+ f.close()
+ with open(patch_file, "r", encoding="iso8859-1") as f:
+ patch_text = f.read()
+
+ # Search for the "CVE: " line
+ match = cve_match.search(patch_text)
+ if match:
+ # Get only the CVEs without the "CVE: " tag
+ cves = patch_text[match.start()+5:match.end()]
+ for cve in cves.split():
+ bb.debug(2, "Patch %s solves %s" % (patch_file, cve))
+ patched_cves.add(cve)
+ elif not fname_match:
+ bb.debug(2, "Patch %s doesn't solve CVEs" % patch_file)
+
+ return patched_cves
+
+def check_cves(d, patched_cves):
+ """
+ Run cve-check-tool looking for patched and unpatched CVEs.
+ """
+
+ import ast, csv, tempfile, subprocess, io
+
+ cves_patched = []
+ cves_unpatched = []
+ bpn = d.getVar("CVE_PRODUCT")
+ # If this has been unset then we're not scanning for CVEs here (for example, image recipes)
+ if not bpn:
+ return ([], [])
+ pv = d.getVar("CVE_VERSION").split("+git")[0]
+ cves = " ".join(patched_cves)
+ cve_db_dir = d.getVar("CVE_CHECK_DB_DIR")
+ cve_whitelist = ast.literal_eval(d.getVar("CVE_CHECK_CVE_WHITELIST"))
+ cve_cmd = "cve-check-tool"
+ cmd = [cve_cmd, "--no-html", "--csv", "--not-affected", "-t", "faux", "-d", cve_db_dir]
+
+ # If the recipe has been whitlisted we return empty lists
+ if d.getVar("PN") in d.getVar("CVE_CHECK_PN_WHITELIST").split():
+ bb.note("Recipe has been whitelisted, skipping check")
+ return ([], [])
+
+ try:
+ # Write the faux CSV file to be used with cve-check-tool
+ fd, faux = tempfile.mkstemp(prefix="cve-faux-")
+ with os.fdopen(fd, "w") as f:
+ f.write("%s,%s,%s," % (bpn, pv, cves))
+ cmd.append(faux)
+
+ output = subprocess.check_output(cmd).decode("utf-8")
+ bb.debug(2, "Output of command %s:\n%s" % ("\n".join(cmd), output))
+ except subprocess.CalledProcessError as e:
+ bb.warn("Couldn't check for CVEs: %s (output %s)" % (e, e.output))
+ finally:
+ os.remove(faux)
+
+ for row in csv.reader(io.StringIO(output)):
+ # Third row has the unpatched CVEs
+ if row[2]:
+ for cve in row[2].split():
+ # Skip if the CVE has been whitlisted for the current version
+ if pv in cve_whitelist.get(cve,[]):
+ bb.note("%s-%s has been whitelisted for %s" % (bpn, pv, cve))
+ else:
+ cves_unpatched.append(cve)
+ bb.debug(2, "%s-%s is not patched for %s" % (bpn, pv, cve))
+ # Fourth row has patched CVEs
+ if row[3]:
+ for cve in row[3].split():
+ cves_patched.append(cve)
+ bb.debug(2, "%s-%s is patched for %s" % (bpn, pv, cve))
+
+ return (cves_patched, cves_unpatched)
+
+def get_cve_info(d, cves):
+ """
+ Get CVE information from the database used by cve-check-tool.
+
+ Unfortunately the only way to get CVE info is set the output to
+ html (hard to parse) or query directly the database.
+ """
+
+ try:
+ import sqlite3
+ except ImportError:
+ from pysqlite2 import dbapi2 as sqlite3
+
+ cve_data = {}
+ db_file = d.getVar("CVE_CHECK_DB_FILE")
+ placeholder = ",".join("?" * len(cves))
+ query = "SELECT * FROM NVD WHERE id IN (%s)" % placeholder
+ conn = sqlite3.connect(db_file)
+ cur = conn.cursor()
+ for row in cur.execute(query, tuple(cves)):
+ cve_data[row[0]] = {}
+ cve_data[row[0]]["summary"] = row[1]
+ cve_data[row[0]]["score"] = row[2]
+ cve_data[row[0]]["modified"] = row[3]
+ cve_data[row[0]]["vector"] = row[4]
+ conn.close()
+
+ return cve_data
+
+def cve_write_data(d, patched, unpatched, cve_data):
+ """
+ Write CVE information in WORKDIR; and to CVE_CHECK_DIR, and
+ CVE manifest if enabled.
+ """
+
+ cve_file = d.getVar("CVE_CHECK_LOG")
+ nvd_link = "https://web.nvd.nist.gov/view/vuln/detail?vulnId="
+ write_string = ""
+ unpatched_cves = []
+ bb.utils.mkdirhier(os.path.dirname(cve_file))
+
+ for cve in sorted(cve_data):
+ write_string += "PACKAGE NAME: %s\n" % d.getVar("PN")
+ write_string += "PACKAGE VERSION: %s\n" % d.getVar("PV")
+ write_string += "CVE: %s\n" % cve
+ if cve in patched:
+ write_string += "CVE STATUS: Patched\n"
+ else:
+ unpatched_cves.append(cve)
+ write_string += "CVE STATUS: Unpatched\n"
+ write_string += "CVE SUMMARY: %s\n" % cve_data[cve]["summary"]
+ write_string += "CVSS v2 BASE SCORE: %s\n" % cve_data[cve]["score"]
+ write_string += "VECTOR: %s\n" % cve_data[cve]["vector"]
+ write_string += "MORE INFORMATION: %s%s\n\n" % (nvd_link, cve)
+
+ if unpatched_cves:
+ bb.warn("Found unpatched CVE (%s), for more information check %s" % (" ".join(unpatched_cves),cve_file))
+
+ with open(cve_file, "w") as f:
+ bb.note("Writing file %s with CVE information" % cve_file)
+ f.write(write_string)
+
+ if d.getVar("CVE_CHECK_COPY_FILES") == "1":
+ cve_dir = d.getVar("CVE_CHECK_DIR")
+ bb.utils.mkdirhier(cve_dir)
+ deploy_file = os.path.join(cve_dir, d.getVar("PN"))
+ with open(deploy_file, "w") as f:
+ f.write(write_string)
+
+ if d.getVar("CVE_CHECK_CREATE_MANIFEST") == "1":
+ with open(d.getVar("CVE_CHECK_TMP_FILE"), "a") as f:
+ f.write("%s" % write_string)
diff --git a/poky/meta/classes/debian.bbclass b/poky/meta/classes/debian.bbclass
new file mode 100644
index 000000000..989ea8f8d
--- /dev/null
+++ b/poky/meta/classes/debian.bbclass
@@ -0,0 +1,146 @@
+# Debian package renaming only occurs when a package is built
+# We therefore have to make sure we build all runtime packages
+# before building the current package to make the packages runtime
+# depends are correct
+#
+# Custom library package names can be defined setting
+# DEBIANNAME_ + pkgname to the desired name.
+#
+# Better expressed as ensure all RDEPENDS package before we package
+# This means we can't have circular RDEPENDS/RRECOMMENDS
+
+AUTO_LIBNAME_PKGS = "${PACKAGES}"
+
+inherit package
+
+DEBIANRDEP = "do_packagedata"
+do_package_write_ipk[rdeptask] = "${DEBIANRDEP}"
+do_package_write_deb[rdeptask] = "${DEBIANRDEP}"
+do_package_write_tar[rdeptask] = "${DEBIANRDEP}"
+do_package_write_rpm[rdeptask] = "${DEBIANRDEP}"
+
+python () {
+ if not d.getVar("PACKAGES"):
+ d.setVar("DEBIANRDEP", "")
+}
+
+python debian_package_name_hook () {
+ import glob, copy, stat, errno, re, pathlib, subprocess
+
+ pkgdest = d.getVar("PKGDEST")
+ packages = d.getVar('PACKAGES')
+ so_re = re.compile("lib.*\.so")
+
+ def socrunch(s):
+ s = s.lower().replace('_', '-')
+ m = re.match("^(.*)(.)\.so\.(.*)$", s)
+ if m is None:
+ return None
+ if m.group(2) in '0123456789':
+ bin = '%s%s-%s' % (m.group(1), m.group(2), m.group(3))
+ else:
+ bin = m.group(1) + m.group(2) + m.group(3)
+ dev = m.group(1) + m.group(2)
+ return (bin, dev)
+
+ def isexec(path):
+ try:
+ s = os.stat(path)
+ except (os.error, AttributeError):
+ return 0
+ return (s[stat.ST_MODE] & stat.S_IEXEC)
+
+ def add_rprovides(pkg, d):
+ newpkg = d.getVar('PKG_' + pkg)
+ if newpkg and newpkg != pkg:
+ provs = (d.getVar('RPROVIDES_' + pkg) or "").split()
+ if pkg not in provs:
+ d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV") + ")")
+
+ def auto_libname(packages, orig_pkg):
+ p = lambda var: pathlib.PurePath(d.getVar(var))
+ libdirs = (p("base_libdir"), p("libdir"))
+ bindirs = (p("base_bindir"), p("base_sbindir"), p("bindir"), p("sbindir"))
+
+ sonames = []
+ has_bins = 0
+ has_libs = 0
+ for f in pkgfiles[orig_pkg]:
+ # This is .../packages-split/orig_pkg/
+ pkgpath = pathlib.PurePath(pkgdest, orig_pkg)
+ # Strip pkgpath off the full path to a file in the package, re-root
+ # so it is absolute, and then get the parent directory of the file.
+ path = pathlib.PurePath("/") / (pathlib.PurePath(f).relative_to(pkgpath).parent)
+ if path in bindirs:
+ has_bins = 1
+ if path in libdirs:
+ has_libs = 1
+ if so_re.match(os.path.basename(f)):
+ try:
+ cmd = [d.expand("${TARGET_PREFIX}objdump"), "-p", f]
+ output = subprocess.check_output(cmd).decode("utf-8")
+ for m in re.finditer("\s+SONAME\s+([^\s]+)", output):
+ if m.group(1) not in sonames:
+ sonames.append(m.group(1))
+ except subprocess.CalledProcessError:
+ pass
+ bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames))
+ soname = None
+ if len(sonames) == 1:
+ soname = sonames[0]
+ elif len(sonames) > 1:
+ lead = d.getVar('LEAD_SONAME')
+ if lead:
+ r = re.compile(lead)
+ filtered = []
+ for s in sonames:
+ if r.match(s):
+ filtered.append(s)
+ if len(filtered) == 1:
+ soname = filtered[0]
+ elif len(filtered) > 1:
+ bb.note("Multiple matches (%s) for LEAD_SONAME '%s'" % (", ".join(filtered), lead))
+ else:
+ bb.note("Multiple libraries (%s) found, but LEAD_SONAME '%s' doesn't match any of them" % (", ".join(sonames), lead))
+ else:
+ bb.note("Multiple libraries (%s) found and LEAD_SONAME not defined" % ", ".join(sonames))
+
+ if has_libs and not has_bins and soname:
+ soname_result = socrunch(soname)
+ if soname_result:
+ (pkgname, devname) = soname_result
+ for pkg in packages.split():
+ if (d.getVar('PKG_' + pkg, False) or d.getVar('DEBIAN_NOAUTONAME_' + pkg, False)):
+ add_rprovides(pkg, d)
+ continue
+ debian_pn = d.getVar('DEBIANNAME_' + pkg, False)
+ if debian_pn:
+ newpkg = debian_pn
+ elif pkg == orig_pkg:
+ newpkg = pkgname
+ else:
+ newpkg = pkg.replace(orig_pkg, devname, 1)
+ mlpre=d.getVar('MLPREFIX')
+ if mlpre:
+ if not newpkg.find(mlpre) == 0:
+ newpkg = mlpre + newpkg
+ if newpkg != pkg:
+ bb.note("debian: renaming %s to %s" % (pkg, newpkg))
+ d.setVar('PKG_' + pkg, newpkg)
+ add_rprovides(pkg, d)
+ else:
+ add_rprovides(orig_pkg, d)
+
+ # reversed sort is needed when some package is substring of another
+ # ie in ncurses we get without reverse sort:
+ # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libtic orig_pkg ncurses-libtic debian_pn None newpkg libtic5
+ # and later
+ # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw
+ # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5
+ for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS') or "").split(), reverse=True):
+ auto_libname(packages, pkg)
+}
+
+EXPORT_FUNCTIONS package_name_hook
+
+DEBIAN_NAMES = "1"
diff --git a/poky/meta/classes/deploy.bbclass b/poky/meta/classes/deploy.bbclass
new file mode 100644
index 000000000..6d5290878
--- /dev/null
+++ b/poky/meta/classes/deploy.bbclass
@@ -0,0 +1,11 @@
+DEPLOYDIR = "${WORKDIR}/deploy-${PN}"
+SSTATETASKS += "do_deploy"
+do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"
+do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+
+python do_deploy_setscene () {
+ sstate_setscene(d)
+}
+addtask do_deploy_setscene
+do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+do_deploy[stamp-extra-info] = "${MACHINE_ARCH}"
diff --git a/poky/meta/classes/devshell.bbclass b/poky/meta/classes/devshell.bbclass
new file mode 100644
index 000000000..fdf7dc100
--- /dev/null
+++ b/poky/meta/classes/devshell.bbclass
@@ -0,0 +1,155 @@
+inherit terminal
+
+DEVSHELL = "${SHELL}"
+
+python do_devshell () {
+ if d.getVarFlag("do_devshell", "manualfakeroot"):
+ d.prependVar("DEVSHELL", "pseudo ")
+ fakeenv = d.getVar("FAKEROOTENV").split()
+ for f in fakeenv:
+ k = f.split("=")
+ d.setVar(k[0], k[1])
+ d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
+ d.delVarFlag("do_devshell", "fakeroot")
+
+ oe_terminal(d.getVar('DEVSHELL'), 'OpenEmbedded Developer Shell', d)
+}
+
+addtask devshell after do_patch do_prepare_recipe_sysroot
+
+# The directory that the terminal starts in
+DEVSHELL_STARTDIR ?= "${S}"
+do_devshell[dirs] = "${DEVSHELL_STARTDIR}"
+do_devshell[nostamp] = "1"
+
+# devshell and fakeroot/pseudo need careful handling since only the final
+# command should run under fakeroot emulation, any X connection should
+# be done as the normal user. We therfore carefully construct the envionment
+# manually
+python () {
+ if d.getVarFlag("do_devshell", "fakeroot"):
+ # We need to signal our code that we want fakeroot however we
+ # can't manipulate the environment and variables here yet (see YOCTO #4795)
+ d.setVarFlag("do_devshell", "manualfakeroot", "1")
+ d.delVarFlag("do_devshell", "fakeroot")
+}
+
+def devpyshell(d):
+
+ import code
+ import select
+ import signal
+ import termios
+
+ m, s = os.openpty()
+ sname = os.ttyname(s)
+
+ def noechoicanon(fd):
+ old = termios.tcgetattr(fd)
+ old[3] = old[3] &~ termios.ECHO &~ termios.ICANON
+ # &~ termios.ISIG
+ termios.tcsetattr(fd, termios.TCSADRAIN, old)
+
+ # No echo or buffering over the pty
+ noechoicanon(s)
+
+ pid = os.fork()
+ if pid:
+ os.close(m)
+ oe_terminal("oepydevshell-internal.py %s %d" % (sname, pid), 'OpenEmbedded Developer PyShell', d)
+ os._exit(0)
+ else:
+ os.close(s)
+
+ os.dup2(m, sys.stdin.fileno())
+ os.dup2(m, sys.stdout.fileno())
+ os.dup2(m, sys.stderr.fileno())
+
+ bb.utils.nonblockingfd(sys.stdout)
+ bb.utils.nonblockingfd(sys.stderr)
+ bb.utils.nonblockingfd(sys.stdin)
+
+ _context = {
+ "os": os,
+ "bb": bb,
+ "time": time,
+ "d": d,
+ }
+
+ ps1 = "pydevshell> "
+ ps2 = "... "
+ buf = []
+ more = False
+
+ i = code.InteractiveInterpreter(locals=_context)
+ print("OE PyShell (PN = %s)\n" % d.getVar("PN"))
+
+ def prompt(more):
+ if more:
+ prompt = ps2
+ else:
+ prompt = ps1
+ sys.stdout.write(prompt)
+ sys.stdout.flush()
+
+ # Restore Ctrl+C since bitbake masks this
+ def signal_handler(signal, frame):
+ raise KeyboardInterrupt
+ signal.signal(signal.SIGINT, signal_handler)
+
+ child = None
+
+ prompt(more)
+ while True:
+ try:
+ try:
+ (r, _, _) = select.select([sys.stdin], [], [], 1)
+ if not r:
+ continue
+ line = sys.stdin.readline().strip()
+ if not line:
+ prompt(more)
+ continue
+ except EOFError as e:
+ sys.stdout.write("\n")
+ sys.stdout.flush()
+ except (OSError, IOError) as e:
+ if e.errno == 11:
+ continue
+ if e.errno == 5:
+ return
+ raise
+ else:
+ if not child:
+ child = int(line)
+ continue
+ buf.append(line)
+ source = "\n".join(buf)
+ more = i.runsource(source, "<pyshell>")
+ if not more:
+ buf = []
+ prompt(more)
+ except KeyboardInterrupt:
+ i.write("\nKeyboardInterrupt\n")
+ buf = []
+ more = False
+ prompt(more)
+ except SystemExit:
+ # Easiest way to ensure everything exits
+ os.kill(child, signal.SIGTERM)
+ break
+
+python do_devpyshell() {
+ import signal
+
+ try:
+ devpyshell(d)
+ except SystemExit:
+ # Stop the SIGTERM above causing an error exit code
+ return
+ finally:
+ return
+}
+addtask devpyshell after do_patch
+
+do_devpyshell[nostamp] = "1"
diff --git a/poky/meta/classes/devtool-source.bbclass b/poky/meta/classes/devtool-source.bbclass
new file mode 100644
index 000000000..56882a41d
--- /dev/null
+++ b/poky/meta/classes/devtool-source.bbclass
@@ -0,0 +1,221 @@
+# Development tool - source extraction helper class
+#
+# NOTE: this class is intended for use by devtool and should not be
+# inherited manually.
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+DEVTOOL_TEMPDIR ?= ""
+DEVTOOL_PATCH_SRCDIR = "${DEVTOOL_TEMPDIR}/patchworkdir"
+
+
+python() {
+ tempdir = d.getVar('DEVTOOL_TEMPDIR')
+
+ if not tempdir:
+ bb.fatal('devtool-source class is for internal use by devtool only')
+
+ # Make a subdir so we guard against WORKDIR==S
+ workdir = os.path.join(tempdir, 'workdir')
+ d.setVar('WORKDIR', workdir)
+ if not d.getVar('S').startswith(workdir):
+ # Usually a shared workdir recipe (kernel, gcc)
+ # Try to set a reasonable default
+ if bb.data.inherits_class('kernel', d):
+ d.setVar('S', '${WORKDIR}/source')
+ else:
+ d.setVar('S', '${WORKDIR}/%s' % os.path.basename(d.getVar('S')))
+ if bb.data.inherits_class('kernel', d):
+ # We don't want to move the source to STAGING_KERNEL_DIR here
+ d.setVar('STAGING_KERNEL_DIR', '${S}')
+
+ d.setVar('STAMPS_DIR', os.path.join(tempdir, 'stamps'))
+ d.setVar('T', os.path.join(tempdir, 'temp'))
+
+ # Hook in pre/postfuncs
+ is_kernel_yocto = bb.data.inherits_class('kernel-yocto', d)
+ if is_kernel_yocto:
+ unpacktask = 'do_kernel_checkout'
+ d.appendVarFlag('do_configure', 'postfuncs', ' devtool_post_configure')
+ else:
+ unpacktask = 'do_unpack'
+ d.appendVarFlag(unpacktask, 'postfuncs', ' devtool_post_unpack')
+ d.prependVarFlag('do_patch', 'prefuncs', ' devtool_pre_patch')
+ d.appendVarFlag('do_patch', 'postfuncs', ' devtool_post_patch')
+
+ # NOTE: in order for the patch stuff to be fully functional,
+ # PATCHTOOL and PATCH_COMMIT_FUNCTIONS need to be set; we can't
+ # do that here because we can't guarantee the order of the anonymous
+ # functions, so it gets done in the bbappend we create.
+}
+
+
+python devtool_post_unpack() {
+ import oe.recipeutils
+ import shutil
+ sys.path.insert(0, os.path.join(d.getVar('COREBASE'), 'scripts', 'lib'))
+ import scriptutils
+ from devtool import setup_git_repo
+
+ tempdir = d.getVar('DEVTOOL_TEMPDIR')
+ workdir = d.getVar('WORKDIR')
+ srcsubdir = d.getVar('S')
+
+ def _move_file(src, dst):
+ """Move a file. Creates all the directory components of destination path."""
+ dst_d = os.path.dirname(dst)
+ if dst_d:
+ bb.utils.mkdirhier(dst_d)
+ shutil.move(src, dst)
+
+ def _ls_tree(directory):
+ """Recursive listing of files in a directory"""
+ ret = []
+ for root, dirs, files in os.walk(directory):
+ ret.extend([os.path.relpath(os.path.join(root, fname), directory) for
+ fname in files])
+ return ret
+
+ # Move local source files into separate subdir
+ recipe_patches = [os.path.basename(patch) for patch in
+ oe.recipeutils.get_recipe_patches(d)]
+ local_files = oe.recipeutils.get_recipe_local_files(d)
+
+ # Ignore local files with subdir={BP}
+ srcabspath = os.path.abspath(srcsubdir)
+ local_files = [fname for fname in local_files if
+ os.path.exists(os.path.join(workdir, fname)) and
+ (srcabspath == workdir or not
+ os.path.join(workdir, fname).startswith(srcabspath +
+ os.sep))]
+ if local_files:
+ for fname in local_files:
+ _move_file(os.path.join(workdir, fname),
+ os.path.join(tempdir, 'oe-local-files', fname))
+ with open(os.path.join(tempdir, 'oe-local-files', '.gitignore'),
+ 'w') as f:
+ f.write('# Ignore local files, by default. Remove this file '
+ 'if you want to commit the directory to Git\n*\n')
+
+ if srcsubdir == workdir:
+ # Find non-patch non-local sources that were "unpacked" to srctree
+ # directory
+ src_files = [fname for fname in _ls_tree(workdir) if
+ os.path.basename(fname) not in recipe_patches]
+ srcsubdir = d.getVar('DEVTOOL_PATCH_SRCDIR')
+ # Move source files to S
+ for path in src_files:
+ _move_file(os.path.join(workdir, path),
+ os.path.join(srcsubdir, path))
+ elif os.path.dirname(srcsubdir) != workdir:
+ # Handle if S is set to a subdirectory of the source
+ srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0])
+
+ scriptutils.git_convert_standalone_clone(srcsubdir)
+
+ # Make sure that srcsubdir exists
+ bb.utils.mkdirhier(srcsubdir)
+ if not os.listdir(srcsubdir):
+ bb.warn("No source unpacked to S - either the %s recipe "
+ "doesn't use any source or the correct source "
+ "directory could not be determined" % d.getVar('PN'))
+
+ devbranch = d.getVar('DEVTOOL_DEVBRANCH')
+ setup_git_repo(srcsubdir, d.getVar('PV'), devbranch, d=d)
+
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srcsubdir)
+ initial_rev = stdout.rstrip()
+ with open(os.path.join(tempdir, 'initial_rev'), 'w') as f:
+ f.write(initial_rev)
+
+ with open(os.path.join(tempdir, 'srcsubdir'), 'w') as f:
+ f.write(srcsubdir)
+}
+
+python devtool_pre_patch() {
+ if d.getVar('S') == d.getVar('WORKDIR'):
+ d.setVar('S', '${DEVTOOL_PATCH_SRCDIR}')
+}
+
+python devtool_post_patch() {
+ import shutil
+ tempdir = d.getVar('DEVTOOL_TEMPDIR')
+ with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f:
+ srcsubdir = f.read()
+ with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
+ initial_rev = f.read()
+
+ def rm_patches():
+ patches_dir = os.path.join(srcsubdir, 'patches')
+ if os.path.exists(patches_dir):
+ shutil.rmtree(patches_dir)
+ # Restore any "patches" directory that was actually part of the source tree
+ try:
+ bb.process.run('git checkout -- patches', cwd=srcsubdir)
+ except bb.process.ExecutionError:
+ pass
+
+ extra_overrides = d.getVar('DEVTOOL_EXTRA_OVERRIDES')
+ if extra_overrides:
+ extra_override_list = extra_overrides.split(':')
+ devbranch = d.getVar('DEVTOOL_DEVBRANCH')
+ default_overrides = d.getVar('OVERRIDES').split(':')
+ no_overrides = []
+ # First, we may have some overrides that are referred to in the recipe set in
+ # our configuration, so we need to make a branch that excludes those
+ for override in default_overrides:
+ if override not in extra_override_list:
+ no_overrides.append(override)
+ if default_overrides != no_overrides:
+ # Some overrides are active in the current configuration, so
+ # we need to create a branch where none of the overrides are active
+ bb.process.run('git checkout %s -b devtool-no-overrides' % initial_rev, cwd=srcsubdir)
+ # Run do_patch function with the override applied
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('OVERRIDES', ':'.join(no_overrides))
+ bb.build.exec_func('do_patch', localdata)
+ rm_patches()
+ # Now we need to reconcile the dev branch with the no-overrides one
+ # (otherwise we'd likely be left with identical commits that have different hashes)
+ bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
+ bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
+ else:
+ bb.process.run('git checkout %s -b devtool-no-overrides' % devbranch, cwd=srcsubdir)
+
+ for override in extra_override_list:
+ localdata = bb.data.createCopy(d)
+ if override in default_overrides:
+ bb.process.run('git branch devtool-override-%s %s' % (override, devbranch), cwd=srcsubdir)
+ else:
+ # Reset back to the initial commit on a new branch
+ bb.process.run('git checkout %s -b devtool-override-%s' % (initial_rev, override), cwd=srcsubdir)
+ # Run do_patch function with the override applied
+ localdata.appendVar('OVERRIDES', ':%s' % override)
+ bb.build.exec_func('do_patch', localdata)
+ rm_patches()
+ # Now we need to reconcile the new branch with the no-overrides one
+ # (otherwise we'd likely be left with identical commits that have different hashes)
+ bb.process.run('git rebase devtool-no-overrides', cwd=srcsubdir)
+ bb.process.run('git checkout %s' % devbranch, cwd=srcsubdir)
+ bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
+}
+
+python devtool_post_configure() {
+ import shutil
+ tempdir = d.getVar('DEVTOOL_TEMPDIR')
+ shutil.copy2(os.path.join(d.getVar('B'), '.config'), tempdir)
+}
diff --git a/poky/meta/classes/devupstream.bbclass b/poky/meta/classes/devupstream.bbclass
new file mode 100644
index 000000000..7780c5482
--- /dev/null
+++ b/poky/meta/classes/devupstream.bbclass
@@ -0,0 +1,48 @@
+# Class for use in BBCLASSEXTEND to make it easier to have a single recipe that
+# can build both stable tarballs and snapshots from upstream source
+# repositories.
+#
+# Usage:
+# BBCLASSEXTEND = "devupstream:target"
+# SRC_URI_class-devupstream = "git://git.example.com/example"
+# SRCREV_class-devupstream = "abcdef"
+#
+# If the first entry in SRC_URI is a git: URL then S is rewritten to
+# WORKDIR/git.
+#
+# There are a few caveats that remain to be solved:
+# - You can't build native or nativesdk recipes using for example
+# devupstream:native, you can only build target recipes.
+# - If the fetcher requires native tools (such as subversion-native) then
+# bitbake won't be able to add them automatically.
+
+CLASSOVERRIDE .= ":class-devupstream"
+
+python devupstream_virtclass_handler () {
+ # Do nothing if this is inherited, as it's for BBCLASSEXTEND
+ if "devupstream" not in (d.getVar('BBCLASSEXTEND') or ""):
+ bb.error("Don't inherit devupstream, use BBCLASSEXTEND")
+ return
+
+ variant = d.getVar("BBEXTENDVARIANT")
+ if variant not in ("target"):
+ bb.error("Pass the variant when using devupstream, for example devupstream:target")
+ return
+
+ # Develpment releases are never preferred by default
+ d.setVar("DEFAULT_PREFERENCE", "-1")
+
+ uri = bb.fetch2.URI(d.getVar("SRC_URI").split()[0])
+
+ if uri.scheme == "git":
+ d.setVar("S", "${WORKDIR}/git")
+
+ # Modify the PV if the recipe hasn't already overridden it
+ pv = d.getVar("PV")
+ proto_marker = "+" + uri.scheme
+ if proto_marker not in pv:
+ d.setVar("PV", pv + proto_marker + "${SRCPV}")
+}
+
+addhandler devupstream_virtclass_handler
+devupstream_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
diff --git a/poky/meta/classes/distro_features_check.bbclass b/poky/meta/classes/distro_features_check.bbclass
new file mode 100644
index 000000000..9b78b03ef
--- /dev/null
+++ b/poky/meta/classes/distro_features_check.bbclass
@@ -0,0 +1,37 @@
+# Allow checking of required and conflicting DISTRO_FEATURES
+#
+# ANY_OF_DISTRO_FEATURES: ensure at least one item on this list is included
+# in DISTRO_FEATURES.
+# REQUIRED_DISTRO_FEATURES: ensure every item on this list is included
+# in DISTRO_FEATURES.
+# CONFLICT_DISTRO_FEATURES: ensure no item in this list is included in
+# DISTRO_FEATURES.
+#
+# Copyright 2013 (C) O.S. Systems Software LTDA.
+
+python () {
+ # Assume at least one var is set.
+ distro_features = (d.getVar('DISTRO_FEATURES') or "").split()
+
+ any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES')
+ if any_of_distro_features:
+ any_of_distro_features = any_of_distro_features.split()
+ if set.isdisjoint(set(any_of_distro_features),set(distro_features)):
+ raise bb.parse.SkipRecipe("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features)
+
+ required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES')
+ if required_distro_features:
+ required_distro_features = required_distro_features.split()
+ for f in required_distro_features:
+ if f in distro_features:
+ continue
+ else:
+ raise bb.parse.SkipRecipe("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f)
+
+ conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES')
+ if conflict_distro_features:
+ conflict_distro_features = conflict_distro_features.split()
+ for f in conflict_distro_features:
+ if f in distro_features:
+ raise bb.parse.SkipRecipe("conflicting distro feature '%s' (in DISTRO_FEATURES)" % f)
+}
diff --git a/poky/meta/classes/distrodata.bbclass b/poky/meta/classes/distrodata.bbclass
new file mode 100644
index 000000000..59ee8cea6
--- /dev/null
+++ b/poky/meta/classes/distrodata.bbclass
@@ -0,0 +1,427 @@
+include conf/distro/include/upstream_tracking.inc
+include conf/distro/include/distro_alias.inc
+include conf/distro/include/maintainers.inc
+
+addhandler distro_eventhandler
+distro_eventhandler[eventmask] = "bb.event.BuildStarted"
+python distro_eventhandler() {
+ import oe.distro_check as dc
+ import csv
+ logfile = dc.create_log_file(e.data, "distrodata.csv")
+
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ writer = csv.writer(f)
+ writer.writerow(['Package', 'Description', 'Owner', 'License',
+ 'VerMatch', 'Version', 'Upstream', 'Reason', 'Recipe Status',
+ 'Distro 1', 'Distro 2', 'Distro 3'])
+ f.close()
+ bb.utils.unlockfile(lf)
+
+ return
+}
+
+addtask distrodata_np
+do_distrodata_np[nostamp] = "1"
+python do_distrodata_np() {
+ localdata = bb.data.createCopy(d)
+ pn = d.getVar("PN")
+ bb.note("Package Name: %s" % pn)
+
+ import oe.distro_check as dist_check
+ tmpdir = d.getVar('TMPDIR')
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ datetime = localdata.getVar('DATETIME')
+ dist_check.update_distro_data(distro_check_dir, datetime, localdata)
+
+ if pn.find("-native") != -1:
+ pnstripped = pn.split("-native")
+ bb.note("Native Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.find("-crosssdk") != -1:
+ pnstripped = pn.split("-crosssdk")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
+
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ """generate package information from .bb file"""
+ pname = localdata.getVar('PN')
+ pcurver = localdata.getVar('PV')
+ pdesc = localdata.getVar('DESCRIPTION')
+ if pdesc is not None:
+ pdesc = pdesc.replace(',','')
+ pdesc = pdesc.replace('\n','')
+
+ pgrp = localdata.getVar('SECTION')
+ plicense = localdata.getVar('LICENSE').replace(',','_')
+
+ rstatus = localdata.getVar('RECIPE_COLOR')
+ if rstatus is not None:
+ rstatus = rstatus.replace(',','')
+
+ pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION')
+ if pcurver == pupver:
+ vermatch="1"
+ else:
+ vermatch="0"
+ noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON')
+ if noupdate_reason is None:
+ noupdate="0"
+ else:
+ noupdate="1"
+ noupdate_reason = noupdate_reason.replace(',','')
+
+ maintainer = localdata.getVar('RECIPE_MAINTAINER')
+ rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE')
+ result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
+
+ bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s,%s\n" % \
+ (pname, pdesc, maintainer, plicense, vermatch, pcurver, pupver, noupdate_reason, rstatus))
+ line = pn
+ for i in result:
+ line = line + "," + i
+ bb.note("%s\n" % line)
+}
+do_distrodata_np[vardepsexclude] = "DATETIME"
+
+addtask distrodata
+do_distrodata[nostamp] = "1"
+python do_distrodata() {
+ import csv
+ logpath = d.getVar('LOG_DIR')
+ bb.utils.mkdirhier(logpath)
+ logfile = os.path.join(logpath, "distrodata.csv")
+
+ import oe.distro_check as dist_check
+ localdata = bb.data.createCopy(d)
+ tmpdir = d.getVar('TMPDIR')
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ datetime = localdata.getVar('DATETIME')
+ dist_check.update_distro_data(distro_check_dir, datetime, localdata)
+
+ pn = d.getVar("PN")
+ bb.note("Package Name: %s" % pn)
+
+ if pn.find("-native") != -1:
+ pnstripped = pn.split("-native")
+ bb.note("Native Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.find("-crosssdk") != -1:
+ pnstripped = pn.split("-crosssdk")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ """generate package information from .bb file"""
+ pname = localdata.getVar('PN')
+ pcurver = localdata.getVar('PV')
+ pdesc = localdata.getVar('DESCRIPTION')
+ if pdesc is not None:
+ pdesc = pdesc.replace(',','')
+ pdesc = pdesc.replace('\n','')
+
+ pgrp = localdata.getVar('SECTION')
+ plicense = localdata.getVar('LICENSE').replace(',','_')
+
+ rstatus = localdata.getVar('RECIPE_COLOR')
+ if rstatus is not None:
+ rstatus = rstatus.replace(',','')
+
+ pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION')
+ if pcurver == pupver:
+ vermatch="1"
+ else:
+ vermatch="0"
+
+ noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON')
+ if noupdate_reason is None:
+ noupdate="0"
+ else:
+ noupdate="1"
+ noupdate_reason = noupdate_reason.replace(',','')
+
+ maintainer = localdata.getVar('RECIPE_MAINTAINER')
+ rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE')
+ # do the comparison
+ result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
+
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ row = [pname, pdesc, maintainer, plicense, vermatch, pcurver, pupver, noupdate_reason, rstatus]
+ row.extend(result)
+
+ writer = csv.writer(f)
+ writer.writerow(row)
+ f.close()
+ bb.utils.unlockfile(lf)
+}
+do_distrodata[vardepsexclude] = "DATETIME"
+
+addhandler checkpkg_eventhandler
+checkpkg_eventhandler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted"
+python checkpkg_eventhandler() {
+ import csv
+
+ def parse_csv_file(filename):
+ package_dict = {}
+
+ with open(filename, "r") as f:
+ reader = csv.reader(f, delimiter='\t')
+ for row in reader:
+ pn = row[0]
+
+ if reader.line_num == 1:
+ header = row
+ continue
+
+ if not pn in package_dict.keys():
+ package_dict[pn] = row
+ f.close()
+
+ with open(filename, "w") as f:
+ writer = csv.writer(f, delimiter='\t')
+ writer.writerow(header)
+ for pn in package_dict.keys():
+ writer.writerow(package_dict[pn])
+ f.close()
+
+ del package_dict
+
+ if bb.event.getName(e) == "BuildStarted":
+ import oe.distro_check as dc
+ logfile = dc.create_log_file(e.data, "checkpkg.csv")
+
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ writer = csv.writer(f, delimiter='\t')
+ headers = ['Package', 'Version', 'Upver', 'License', 'Section',
+ 'Home', 'Release', 'Depends', 'BugTracker', 'PE', 'Description',
+ 'Status', 'Tracking', 'URI', 'MAINTAINER', 'NoUpReason']
+ writer.writerow(headers)
+ f.close()
+ bb.utils.unlockfile(lf)
+ elif bb.event.getName(e) == "BuildCompleted":
+ import os
+ filename = "tmp/log/checkpkg.csv"
+ if os.path.isfile(filename):
+ lf = bb.utils.lockfile("%s.lock"%filename)
+ parse_csv_file(filename)
+ bb.utils.unlockfile(lf)
+ return
+}
+
+addtask checkpkg
+do_checkpkg[nostamp] = "1"
+python do_checkpkg() {
+ localdata = bb.data.createCopy(d)
+ import csv
+ import re
+ import tempfile
+ import subprocess
+ import oe.recipeutils
+ from bb.utils import vercmp_string
+ from bb.fetch2 import FetchError, NoMethodError, decodeurl
+
+ def get_upstream_version_and_status():
+
+ # set if the upstream check fails reliably, e.g. absent git tags, or weird version format used on our or on upstream side.
+ upstream_version_unknown = localdata.getVar('UPSTREAM_VERSION_UNKNOWN')
+ # set if the upstream check cannot be reliably performed due to transient network failures, or server behaving weirdly.
+ # This one should be used sparingly, as it completely excludes a recipe from upstream checking.
+ upstream_check_unreliable = localdata.getVar('UPSTREAM_CHECK_UNRELIABLE')
+
+ if upstream_check_unreliable == "1":
+ return "N/A", "CHECK_IS_UNRELIABLE"
+
+ uv = oe.recipeutils.get_recipe_upstream_version(localdata)
+ pupver = uv['version'] if uv['version'] else "N/A"
+ pversion = uv['current_version']
+ revision = uv['revision'] if uv['revision'] else "N/A"
+
+ if pupver == "N/A":
+ pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN"
+ else:
+ cmp = vercmp_string(pversion, pupver)
+ if cmp == -1:
+ pstatus = "UPDATE" if not upstream_version_unknown else "KNOWN_BROKEN"
+ elif cmp == 0:
+ pstatus = "MATCH" if not upstream_version_unknown else "KNOWN_BROKEN"
+ else:
+ pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN"
+
+ return pversion, pupver, pstatus, revision
+
+
+ """initialize log files."""
+ logpath = d.getVar('LOG_DIR')
+ bb.utils.mkdirhier(logpath)
+ logfile = os.path.join(logpath, "checkpkg.csv")
+
+ """generate package information from .bb file"""
+ pname = d.getVar('PN')
+
+ if pname.find("-native") != -1:
+ if d.getVar('BBCLASSEXTEND'):
+ return
+ pnstripped = pname.split("-native")
+ bb.note("Native Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pname.startswith("nativesdk-"):
+ if d.getVar('BBCLASSEXTEND'):
+ return
+ pnstripped = pname.replace("nativesdk-", "")
+ bb.note("NativeSDK Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES'))
+
+ if pname.find("-cross") != -1:
+ pnstripped = pname.split("-cross")
+ bb.note("cross Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ if pname.find("-initial") != -1:
+ pnstripped = pname.split("-initial")
+ bb.note("initial Split: %s" % pnstripped)
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+
+ pdesc = localdata.getVar('DESCRIPTION')
+ pgrp = localdata.getVar('SECTION')
+ plicense = localdata.getVar('LICENSE')
+ psection = localdata.getVar('SECTION')
+ phome = localdata.getVar('HOMEPAGE')
+ prelease = localdata.getVar('PR')
+ pdepends = localdata.getVar('DEPENDS')
+ pbugtracker = localdata.getVar('BUGTRACKER')
+ ppe = localdata.getVar('PE')
+ psrcuri = localdata.getVar('SRC_URI')
+ maintainer = localdata.getVar('RECIPE_MAINTAINER')
+
+ pversion, pupver, pstatus, prevision = get_upstream_version_and_status()
+
+ if psrcuri:
+ psrcuri = psrcuri.split()[0]
+ else:
+ psrcuri = "none"
+ pdepends = "".join(pdepends.split("\t"))
+ pdesc = "".join(pdesc.split("\t"))
+ no_upgr_reason = d.getVar('RECIPE_NO_UPDATE_REASON')
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ writer = csv.writer(f, delimiter='\t')
+ writer.writerow([pname, pversion, pupver, plicense, psection, phome,
+ prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, prevision,
+ psrcuri, maintainer, no_upgr_reason])
+ f.close()
+ bb.utils.unlockfile(lf)
+}
+
+addhandler distro_check_eventhandler
+distro_check_eventhandler[eventmask] = "bb.event.BuildStarted"
+python distro_check_eventhandler() {
+ """initialize log files."""
+ import oe.distro_check as dc
+ result_file = dc.create_log_file(e.data, "distrocheck.csv")
+ return
+}
+
+addtask distro_check
+do_distro_check[nostamp] = "1"
+do_distro_check[vardepsexclude] += "DATETIME"
+python do_distro_check() {
+ """checks if the package is present in other public Linux distros"""
+ import oe.distro_check as dc
+ import shutil
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk',d):
+ return
+
+ localdata = bb.data.createCopy(d)
+ tmpdir = d.getVar('TMPDIR')
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ logpath = d.getVar('LOG_DIR')
+ bb.utils.mkdirhier(logpath)
+ result_file = os.path.join(logpath, "distrocheck.csv")
+ datetime = localdata.getVar('DATETIME')
+ dc.update_distro_data(distro_check_dir, datetime, localdata)
+
+ # do the comparison
+ result = dc.compare_in_distro_packages_list(distro_check_dir, d)
+
+ # save the results
+ dc.save_distro_check_result(result, datetime, result_file, d)
+}
+
+#
+#Check Missing License Text.
+#Use this task to generate the missing license text data for pkg-report system,
+#then we can search those recipes which license text isn't exsit in common-licenses directory
+#
+addhandler checklicense_eventhandler
+checklicense_eventhandler[eventmask] = "bb.event.BuildStarted"
+python checklicense_eventhandler() {
+ """initialize log files."""
+ import csv
+ import oe.distro_check as dc
+ logfile = dc.create_log_file(e.data, "missinglicense.csv")
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ writer = csv.writer(f, delimiter='\t')
+ writer.writerow(['Package', 'License', 'MissingLicense'])
+ f.close()
+ bb.utils.unlockfile(lf)
+ return
+}
+
+addtask checklicense
+do_checklicense[nostamp] = "1"
+python do_checklicense() {
+ import csv
+ import shutil
+ logpath = d.getVar('LOG_DIR')
+ bb.utils.mkdirhier(logpath)
+ pn = d.getVar('PN')
+ logfile = os.path.join(logpath, "missinglicense.csv")
+ generic_directory = d.getVar('COMMON_LICENSE_DIR')
+ license_types = d.getVar('LICENSE')
+ for license_type in ((license_types.replace('+', '').replace('|', '&')
+ .replace('(', '').replace(')', '').replace(';', '')
+ .replace(',', '').replace(" ", "").split("&"))):
+ if not os.path.isfile(os.path.join(generic_directory, license_type)):
+ lf = bb.utils.lockfile("%s.lock" % logfile)
+ with open(logfile, "a") as f:
+ writer = csv.writer(f, delimiter='\t')
+ writer.writerow([pn, license_types, license_type])
+ f.close()
+ bb.utils.unlockfile(lf)
+ return
+}
diff --git a/poky/meta/classes/distrooverrides.bbclass b/poky/meta/classes/distrooverrides.bbclass
new file mode 100644
index 000000000..9f4db0d77
--- /dev/null
+++ b/poky/meta/classes/distrooverrides.bbclass
@@ -0,0 +1,32 @@
+# Turns certain DISTRO_FEATURES into overrides with the same
+# name plus a df- prefix. Ensures that these special
+# distro features remain set also for native and nativesdk
+# recipes, so that these overrides can also be used there.
+#
+# This makes it simpler to write .bbappends that only change the
+# task signatures of the recipe if the change is really enabled,
+# for example with:
+# do_install_append_df-my-feature () { ... }
+# where "my-feature" is a DISTRO_FEATURE.
+#
+# The class is meant to be used in a layer.conf or distro
+# .inc file with:
+# INHERIT += "distrooverrides"
+# DISTRO_FEATURES_OVERRIDES += "my-feature"
+#
+# Beware that this part of OVERRIDES changes during parsing, so usage
+# of these overrides should be limited to .bb and .bbappend files,
+# because then DISTRO_FEATURES is final.
+
+DISTRO_FEATURES_OVERRIDES ?= ""
+DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature> entries. \
+Each entry is added to OVERRIDES as df-<feature> if <feature> is in DISTRO_FEATURES."
+
+DISTRO_FEATURES_FILTER_NATIVE_append = " ${DISTRO_FEATURES_OVERRIDES}"
+DISTRO_FEATURES_FILTER_NATIVESDK_append = " ${DISTRO_FEATURES_OVERRIDES}"
+
+# If DISTRO_FEATURES_OVERRIDES or DISTRO_FEATURES show up in a task
+# signature because of this line, then the task dependency on
+# OVERRIDES itself should be fixed. Excluding these two variables
+# with DISTROOVERRIDES[vardepsexclude] would just work around the problem.
+DISTROOVERRIDES .= "${@ ''.join([':df-' + x for x in sorted(set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) & set((d.getVar('DISTRO_FEATURES') or '').split()))]) }"
diff --git a/poky/meta/classes/distutils-base.bbclass b/poky/meta/classes/distutils-base.bbclass
new file mode 100644
index 000000000..9f398d705
--- /dev/null
+++ b/poky/meta/classes/distutils-base.bbclass
@@ -0,0 +1,4 @@
+DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+inherit distutils-common-base pythonnative
diff --git a/poky/meta/classes/distutils-common-base.bbclass b/poky/meta/classes/distutils-common-base.bbclass
new file mode 100644
index 000000000..824a1b68b
--- /dev/null
+++ b/poky/meta/classes/distutils-common-base.bbclass
@@ -0,0 +1,13 @@
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+FILES_${PN} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
+
+FILES_${PN}-staticdev += "\
+ ${PYTHON_SITEPACKAGES_DIR}/*.a \
+"
+FILES_${PN}-dev += "\
+ ${datadir}/pkgconfig \
+ ${libdir}/pkgconfig \
+ ${PYTHON_SITEPACKAGES_DIR}/*.la \
+"
diff --git a/poky/meta/classes/distutils-tools.bbclass b/poky/meta/classes/distutils-tools.bbclass
new file mode 100644
index 000000000..6f2880ea0
--- /dev/null
+++ b/poky/meta/classes/distutils-tools.bbclass
@@ -0,0 +1,73 @@
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+ --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+ --install-data=${D}/${datadir}"
+
+distutils_do_compile() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py build_ext execution failed."
+}
+
+distutils_stage_headers() {
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install_headers execution failed."
+}
+
+distutils_stage_all() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+
+distutils_do_install() {
+ echo "Beginning ${PN} Install ..."
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ echo "Step 2 of ${PN} Install ..."
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install execution failed."
+
+ echo "Step 3 of ${PN} Install ..."
+ # support filenames with *spaces*
+ find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \
+ sed -i -e s:${D}::g $i
+ done
+
+ echo "Step 4 of ${PN} Install ..."
+ if test -e ${D}${bindir} ; then
+ for i in ${D}${bindir}/* ; do \
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ echo "Step 4 of ${PN} Install ..."
+ if test -e ${D}${sbindir}; then
+ for i in ${D}${sbindir}/* ; do \
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ echo "Step 5 of ${PN} Install ..."
+ rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+
+ #
+ # FIXME: Bandaid against wrong datadir computation
+ #
+ if [ -e ${D}${datadir}/share ]; then
+ mv -f ${D}${datadir}/share/* ${D}${datadir}/
+ fi
+}
+
+#EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/poky/meta/classes/distutils.bbclass b/poky/meta/classes/distutils.bbclass
new file mode 100644
index 000000000..1930c3529
--- /dev/null
+++ b/poky/meta/classes/distutils.bbclass
@@ -0,0 +1,82 @@
+inherit distutils-base
+
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+ --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+ --install-data=${D}/${datadir}"
+
+distutils_do_compile() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py build execution failed."
+}
+
+distutils_stage_headers() {
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install_headers execution failed."
+}
+
+distutils_stage_all() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+
+distutils_do_install() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install execution failed."
+
+ # support filenames with *spaces*
+ # only modify file if it contains path and recompile it
+ find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \; -exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
+
+ if test -e ${D}${bindir} ; then
+ for i in ${D}${bindir}/* ; do \
+ if [ ${PN} != "${BPN}-native" ]; then
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${USRBINPATH}/env\ python:g $i
+ fi
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ if [ -e ${D}${sbindir} ]; then
+ for i in ${D}${sbindir}/* ; do \
+ if [ ${PN} != "${BPN}-native" ]; then
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${USRBINPATH}/env\ python:g $i
+ fi
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+ rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/site.py*
+
+ #
+ # FIXME: Bandaid against wrong datadir computation
+ #
+ if [ -e ${D}${datadir}/share ]; then
+ mv -f ${D}${datadir}/share/* ${D}${datadir}/
+ rmdir ${D}${datadir}/share
+ fi
+
+ # Fix backport modules
+ if [ -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py ] && [ -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py ]; then
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
+ fi
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/poky/meta/classes/distutils3-base.bbclass b/poky/meta/classes/distutils3-base.bbclass
new file mode 100644
index 000000000..7dbf07ac4
--- /dev/null
+++ b/poky/meta/classes/distutils3-base.bbclass
@@ -0,0 +1,5 @@
+DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES') == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+inherit distutils-common-base python3native
+
diff --git a/poky/meta/classes/distutils3.bbclass b/poky/meta/classes/distutils3.bbclass
new file mode 100644
index 000000000..6c3030688
--- /dev/null
+++ b/poky/meta/classes/distutils3.bbclass
@@ -0,0 +1,76 @@
+inherit distutils3-base
+
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_BUILD_EXT_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+ --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+ --install-data=${D}/${datadir}"
+
+distutils3_do_compile() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \
+ build ${DISTUTILS_BUILD_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py build_ext execution failed."
+}
+distutils3_do_compile[vardepsexclude] = "MACHINE"
+
+distutils3_stage_headers() {
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install_headers execution failed."
+}
+distutils3_stage_headers[vardepsexclude] = "MACHINE"
+
+distutils3_stage_all() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+ PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+distutils3_stage_all[vardepsexclude] = "MACHINE"
+
+distutils3_do_install() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+ bbfatal_log "${PYTHON_PN} setup.py install execution failed."
+
+ # support filenames with *spaces*
+ find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \;
+
+ if test -e ${D}${bindir} ; then
+ for i in ${D}${bindir}/* ; do \
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:${USRBINPATH}/env\ ${PYTHON_PN}:g $i
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ if test -e ${D}${sbindir}; then
+ for i in ${D}${sbindir}/* ; do \
+ sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:${USRBINPATH}/env\ ${PYTHON_PN}:g $i
+ sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+ done
+ fi
+
+ rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+
+ #
+ # FIXME: Bandaid against wrong datadir computation
+ #
+ if [ -e ${D}${datadir}/share ]; then
+ mv -f ${D}${datadir}/share/* ${D}${datadir}/
+ rmdir ${D}${datadir}/share
+ fi
+}
+distutils3_do_install[vardepsexclude] = "MACHINE"
+
+EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/poky/meta/classes/externalsrc.bbclass b/poky/meta/classes/externalsrc.bbclass
new file mode 100644
index 000000000..c9f5cf767
--- /dev/null
+++ b/poky/meta/classes/externalsrc.bbclass
@@ -0,0 +1,240 @@
+# Copyright (C) 2012 Linux Foundation
+# Author: Richard Purdie
+# Some code and influence taken from srctree.bbclass:
+# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# externalsrc.bbclass enables use of an existing source tree, usually external to
+# the build system to build a piece of software rather than the usual fetch/unpack/patch
+# process.
+#
+# To use, add externalsrc to the global inherit and set EXTERNALSRC to point at the
+# directory you want to use containing the sources e.g. from local.conf for a recipe
+# called "myrecipe" you would do:
+#
+# INHERIT += "externalsrc"
+# EXTERNALSRC_pn-myrecipe = "/path/to/my/source/tree"
+#
+# In order to make this class work for both target and native versions (or with
+# multilibs/cross or other BBCLASSEXTEND variants), B is set to point to a separate
+# directory under the work directory (split source and build directories). This is
+# the default, but the build directory can be set to the source directory if
+# circumstances dictate by setting EXTERNALSRC_BUILD to the same value, e.g.:
+#
+# EXTERNALSRC_BUILD_pn-myrecipe = "/path/to/my/source/tree"
+#
+
+SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch"
+EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}"
+
+python () {
+ externalsrc = d.getVar('EXTERNALSRC')
+ externalsrcbuild = d.getVar('EXTERNALSRC_BUILD')
+
+ if externalsrc and not externalsrc.startswith("/"):
+ bb.error("EXTERNALSRC must be an absolute path")
+ if externalsrcbuild and not externalsrcbuild.startswith("/"):
+ bb.error("EXTERNALSRC_BUILD must be an absolute path")
+
+ # If this is the base recipe and EXTERNALSRC is set for it or any of its
+ # derivatives, then enable BB_DONT_CACHE to force the recipe to always be
+ # re-parsed so that the file-checksums function for do_compile is run every
+ # time.
+ bpn = d.getVar('BPN')
+ if bpn == d.getVar('PN'):
+ classextend = (d.getVar('BBCLASSEXTEND') or '').split()
+ if (externalsrc or
+ ('native' in classextend and
+ d.getVar('EXTERNALSRC_pn-%s-native' % bpn)) or
+ ('nativesdk' in classextend and
+ d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn)) or
+ ('cross' in classextend and
+ d.getVar('EXTERNALSRC_pn-%s-cross' % bpn))):
+ d.setVar('BB_DONT_CACHE', '1')
+
+ if externalsrc:
+ import oe.recipeutils
+ import oe.path
+
+ d.setVar('S', externalsrc)
+ if externalsrcbuild:
+ d.setVar('B', externalsrcbuild)
+ else:
+ d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
+
+ local_srcuri = []
+ fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d)
+ for url in fetch.urls:
+ url_data = fetch.ud[url]
+ parm = url_data.parm
+ if (url_data.type == 'file' or
+ 'type' in parm and parm['type'] == 'kmeta'):
+ local_srcuri.append(url)
+
+ d.setVar('SRC_URI', ' '.join(local_srcuri))
+
+ if '{SRCPV}' in d.getVar('PV', False):
+ # Dummy value because the default function can't be called with blank SRC_URI
+ d.setVar('SRCPV', '999')
+
+ tasks = filter(lambda k: d.getVarFlag(k, "task"), d.keys())
+
+ for task in tasks:
+ if task.endswith("_setscene"):
+ # sstate is never going to work for external source trees, disable it
+ bb.build.deltask(task, d)
+ else:
+ # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time
+ d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock")
+
+ # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
+ cleandirs = oe.recipeutils.split_var_value(d.getVarFlag(task, 'cleandirs', False) or '')
+ setvalue = False
+ for cleandir in cleandirs[:]:
+ if oe.path.is_path_parent(externalsrc, d.expand(cleandir)):
+ cleandirs.remove(cleandir)
+ setvalue = True
+ if setvalue:
+ d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
+
+ fetch_tasks = ['do_fetch', 'do_unpack']
+ # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one
+ # Note that we cannot use d.appendVarFlag() here because deps is expected to be a list object, not a string
+ d.setVarFlag('do_configure', 'deps', (d.getVarFlag('do_configure', 'deps', False) or []) + ['do_unpack'])
+
+ for task in d.getVar("SRCTREECOVEREDTASKS").split():
+ if local_srcuri and task in fetch_tasks:
+ continue
+ bb.build.deltask(task, d)
+
+ d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
+ d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")
+
+ d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')
+ d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}')
+
+ # We don't want the workdir to go away
+ d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN'))
+
+ bb.build.addtask('do_buildclean',
+ 'do_clean' if d.getVar('S') == d.getVar('B') else None,
+ None, d)
+
+ # If B=S the same builddir is used even for different architectures.
+ # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that
+ # change of do_configure task hash is correctly detected and stamps are
+ # invalidated if e.g. MACHINE changes.
+ if d.getVar('S') == d.getVar('B'):
+ configstamp = '${TMPDIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}/configure.sstate'
+ d.setVar('CONFIGURESTAMPFILE', configstamp)
+ d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}')
+ d.setVar('STAMPCLEAN', '${STAMPS_DIR}/work-shared/${PN}/*-*')
+}
+
+python externalsrc_configure_prefunc() {
+ s_dir = d.getVar('S')
+ # Create desired symlinks
+ symlinks = (d.getVar('EXTERNALSRC_SYMLINKS') or '').split()
+ newlinks = []
+ for symlink in symlinks:
+ symsplit = symlink.split(':', 1)
+ lnkfile = os.path.join(s_dir, symsplit[0])
+ target = d.expand(symsplit[1])
+ if len(symsplit) > 1:
+ if os.path.islink(lnkfile):
+ # Link already exists, leave it if it points to the right location already
+ if os.readlink(lnkfile) == target:
+ continue
+ os.unlink(lnkfile)
+ elif os.path.exists(lnkfile):
+ # File/dir exists with same name as link, just leave it alone
+ continue
+ os.symlink(target, lnkfile)
+ newlinks.append(symsplit[0])
+ # Hide the symlinks from git
+ try:
+ git_exclude_file = os.path.join(s_dir, '.git/info/exclude')
+ if os.path.exists(git_exclude_file):
+ with open(git_exclude_file, 'r+') as efile:
+ elines = efile.readlines()
+ for link in newlinks:
+ if link in elines or '/'+link in elines:
+ continue
+ efile.write('/' + link + '\n')
+ except IOError as ioe:
+ bb.note('Failed to hide EXTERNALSRC_SYMLINKS from git')
+}
+
+python externalsrc_compile_prefunc() {
+ # Make it obvious that this is happening, since forgetting about it could lead to much confusion
+ bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC')))
+}
+
+do_buildclean[dirs] = "${S} ${B}"
+do_buildclean[nostamp] = "1"
+do_buildclean[doc] = "Call 'make clean' or equivalent in ${B}"
+externalsrc_do_buildclean() {
+ if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+ rm -f ${@' '.join([x.split(':')[0] for x in (d.getVar('EXTERNALSRC_SYMLINKS') or '').split()])}
+ if [ "${CLEANBROKEN}" != "1" ]; then
+ oe_runmake clean || die "make failed"
+ fi
+ else
+ bbnote "nothing to do - no makefile found"
+ fi
+}
+
+def srctree_hash_files(d, srcdir=None):
+ import shutil
+ import subprocess
+ import tempfile
+
+ s_dir = srcdir or d.getVar('EXTERNALSRC')
+ git_dir = None
+
+ try:
+ git_dir = os.path.join(s_dir,
+ subprocess.check_output(['git', '-C', s_dir, 'rev-parse', '--git-dir'], stderr=subprocess.DEVNULL).decode("utf-8").rstrip())
+ except subprocess.CalledProcessError:
+ pass
+
+ ret = " "
+ if git_dir is not None:
+ oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
+ with tempfile.NamedTemporaryFile(prefix='oe-devtool-index') as tmp_index:
+ # Clone index
+ shutil.copyfile(os.path.join(git_dir, 'index'), tmp_index.name)
+ # Update our custom index
+ env = os.environ.copy()
+ env['GIT_INDEX_FILE'] = tmp_index.name
+ subprocess.check_output(['git', 'add', '-A', '.'], cwd=s_dir, env=env)
+ sha1 = subprocess.check_output(['git', 'write-tree'], cwd=s_dir, env=env).decode("utf-8")
+ with open(oe_hash_file, 'w') as fobj:
+ fobj.write(sha1)
+ ret = oe_hash_file + ':True'
+ else:
+ ret = s_dir + '/*:True'
+ return ret
+
+def srctree_configure_hash_files(d):
+ """
+ Get the list of files that should trigger do_configure to re-execute,
+ based on the value of CONFIGURE_FILES
+ """
+ in_files = (d.getVar('CONFIGURE_FILES') or '').split()
+ out_items = []
+ search_files = []
+ for entry in in_files:
+ if entry.startswith('/'):
+ out_items.append('%s:%s' % (entry, os.path.exists(entry)))
+ else:
+ search_files.append(entry)
+ if search_files:
+ s_dir = d.getVar('EXTERNALSRC')
+ for root, _, files in os.walk(s_dir):
+ for f in files:
+ if f in search_files:
+ out_items.append('%s:True' % os.path.join(root, f))
+ return ' '.join(out_items)
+
+EXPORT_FUNCTIONS do_buildclean
diff --git a/poky/meta/classes/extrausers.bbclass b/poky/meta/classes/extrausers.bbclass
new file mode 100644
index 000000000..7709407b6
--- /dev/null
+++ b/poky/meta/classes/extrausers.bbclass
@@ -0,0 +1,69 @@
+# This bbclass is mainly used for image level user/group configuration.
+# Inherit this class if you want to make EXTRA_USERS_PARAMS effective.
+
+# Below is an example showing how to use this functionality.
+# INHERIT += "extrausers"
+# EXTRA_USERS_PARAMS = "\
+# useradd -p '' tester; \
+# groupadd developers; \
+# userdel nobody; \
+# groupdel -g video; \
+# groupmod -g 1020 developers; \
+# usermod -s /bin/sh tester; \
+# "
+
+
+inherit useradd_base
+
+PACKAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS'))]}"
+
+# Image level user / group settings
+ROOTFS_POSTPROCESS_COMMAND_append = " set_user_group;"
+
+# Image level user / group settings
+set_user_group () {
+ user_group_settings="${EXTRA_USERS_PARAMS}"
+ export PSEUDO="${FAKEROOTENV} ${STAGING_DIR_NATIVE}${bindir}/pseudo"
+ setting=`echo $user_group_settings | cut -d ';' -f1`
+ remaining=`echo $user_group_settings | cut -d ';' -f2-`
+ while test "x$setting" != "x"; do
+ cmd=`echo $setting | cut -d ' ' -f1`
+ opts=`echo $setting | cut -d ' ' -f2-`
+ # Different from useradd.bbclass, there's no file locking issue here, as
+ # this setting is actually a serial process. So we only retry once.
+ case $cmd in
+ useradd)
+ perform_useradd "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ groupadd)
+ perform_groupadd "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ userdel)
+ perform_userdel "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ groupdel)
+ perform_groupdel "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ usermod)
+ perform_usermod "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ groupmod)
+ perform_groupmod "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts"
+ ;;
+ *)
+ bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd"
+ ;;
+ esac
+ # Avoid infinite loop if the last parameter doesn't end with ';'
+ if [ "$setting" = "$remaining" ]; then
+ break
+ fi
+ # iterate to the next setting
+ setting=`echo $remaining | cut -d ';' -f1`
+ remaining=`echo $remaining | cut -d ';' -f2-`
+ done
+}
+
+USERADDEXTENSION ?= ""
+
+inherit ${USERADDEXTENSION}
diff --git a/poky/meta/classes/fontcache.bbclass b/poky/meta/classes/fontcache.bbclass
new file mode 100644
index 000000000..e76331131
--- /dev/null
+++ b/poky/meta/classes/fontcache.bbclass
@@ -0,0 +1,56 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for font
+# packages.
+#
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+inherit qemu
+
+FONT_PACKAGES ??= "${PN}"
+FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+FONTCONFIG_CACHE_PARAMS ?= "-v"
+# You can change this to e.g. FC_DEBUG=16 to debug fc-cache issues,
+# something has to be set, because qemuwrapper is using this variable after -E
+# multiple variables aren't allowed because for qemu they are separated
+# by comma and in -n "$D" case they should be separated by space
+FONTCONFIG_CACHE_ENV ?= "FC_DEBUG=1"
+fontcache_common() {
+if [ -n "$D" ] ; then
+ $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} \
+ 'bindir="${bindir}"' \
+ 'libdir="${libdir}"' \
+ 'base_libdir="${base_libdir}"' \
+ 'fontconfigcachedir="${FONTCONFIG_CACHE_DIR}"' \
+ 'fontconfigcacheparams="${FONTCONFIG_CACHE_PARAMS}"' \
+ 'fontconfigcacheenv="${FONTCONFIG_CACHE_ENV}"'
+else
+ ${FONTCONFIG_CACHE_ENV} fc-cache ${FONTCONFIG_CACHE_PARAMS}
+fi
+}
+
+python () {
+ font_pkgs = d.getVar('FONT_PACKAGES').split()
+ deps = d.getVar("FONT_EXTRA_RDEPENDS")
+
+ for pkg in font_pkgs:
+ if deps: d.appendVar('RDEPENDS_' + pkg, ' '+deps)
+}
+
+python add_fontcache_postinsts() {
+ for pkg in d.getVar('FONT_PACKAGES').split():
+ bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('fontcache_common')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('fontcache_common')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+PACKAGEFUNCS =+ "add_fontcache_postinsts"
diff --git a/poky/meta/classes/fs-uuid.bbclass b/poky/meta/classes/fs-uuid.bbclass
new file mode 100644
index 000000000..9b53dfba7
--- /dev/null
+++ b/poky/meta/classes/fs-uuid.bbclass
@@ -0,0 +1,24 @@
+# Extract UUID from ${ROOTFS}, which must have been built
+# by the time that this function gets called. Only works
+# on ext file systems and depends on tune2fs.
+def get_rootfs_uuid(d):
+ import subprocess
+ rootfs = d.getVar('ROOTFS')
+ output = subprocess.check_output(['tune2fs', '-l', rootfs])
+ for line in output.split('\n'):
+ if line.startswith('Filesystem UUID:'):
+ uuid = line.split()[-1]
+ bb.note('UUID of %s: %s' % (rootfs, uuid))
+ return uuid
+ bb.fatal('Could not determine filesystem UUID of %s' % rootfs)
+
+# Replace the special <<uuid-of-rootfs>> inside a string (like the
+# root= APPEND string in a syslinux.cfg or systemd-boot entry) with the
+# actual UUID of the rootfs. Does nothing if the special string
+# is not used.
+def replace_rootfs_uuid(d, string):
+ UUID_PLACEHOLDER = '<<uuid-of-rootfs>>'
+ if UUID_PLACEHOLDER in string:
+ uuid = get_rootfs_uuid(d)
+ string = string.replace(UUID_PLACEHOLDER, uuid)
+ return string
diff --git a/poky/meta/classes/gconf.bbclass b/poky/meta/classes/gconf.bbclass
new file mode 100644
index 000000000..4e0ee2e7d
--- /dev/null
+++ b/poky/meta/classes/gconf.bbclass
@@ -0,0 +1,71 @@
+DEPENDS += "gconf"
+PACKAGE_WRITE_DEPS += "gconf-native"
+
+# These are for when gconftool is used natively and the prefix isn't necessarily
+# the sysroot. TODO: replicate the postinst logic for -native packages going
+# into sysroot as they won't be running their own install-time schema
+# registration (disabled below) nor the postinst script (as they don't happen).
+export GCONF_SCHEMA_INSTALL_SOURCE = "xml:merged:${STAGING_DIR_NATIVE}${sysconfdir}/gconf/gconf.xml.defaults"
+export GCONF_BACKEND_DIR = "${STAGING_LIBDIR_NATIVE}/GConf/2"
+
+# Disable install-time schema registration as we're a packaging system so this
+# happens in the postinst script, not at install time. Set both the configure
+# script option and the traditional envionment variable just to make sure.
+EXTRA_OECONF += "--disable-schemas-install"
+export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL = "1"
+
+gconf_postinst() {
+if [ "x$D" != "x" ]; then
+ export GCONF_CONFIG_SOURCE="xml::$D${sysconfdir}/gconf/gconf.xml.defaults"
+else
+ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
+fi
+
+SCHEMA_LOCATION=$D/etc/gconf/schemas
+for SCHEMA in ${SCHEMA_FILES}; do
+ if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
+ HOME=$D/root gconftool-2 \
+ --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
+ fi
+done
+}
+
+gconf_prerm() {
+SCHEMA_LOCATION=/etc/gconf/schemas
+for SCHEMA in ${SCHEMA_FILES}; do
+ if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
+ HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
+ gconftool-2 \
+ --makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
+ fi
+done
+}
+
+python populate_packages_append () {
+ import re
+ packages = d.getVar('PACKAGES').split()
+ pkgdest = d.getVar('PKGDEST')
+
+ for pkg in packages:
+ schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
+ schemas = []
+ schema_re = re.compile(".*\.schemas$")
+ if os.path.exists(schema_dir):
+ for f in os.listdir(schema_dir):
+ if schema_re.match(f):
+ schemas.append(f)
+ if schemas != []:
+ bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
+ d.setVar('SCHEMA_FILES', " ".join(schemas))
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gconf_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ prerm = d.getVar('pkg_prerm_%s' % pkg)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += d.getVar('gconf_prerm')
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+ d.appendVar("RDEPENDS_%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf')
+}
diff --git a/poky/meta/classes/gettext.bbclass b/poky/meta/classes/gettext.bbclass
new file mode 100644
index 000000000..be2ef3b31
--- /dev/null
+++ b/poky/meta/classes/gettext.bbclass
@@ -0,0 +1,22 @@
+def gettext_dependencies(d):
+ if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
+ return ""
+ if d.getVar('USE_NLS') == 'no':
+ return "gettext-minimal-native"
+ return "gettext-native"
+
+def gettext_oeconf(d):
+ if d.getVar('USE_NLS') == 'no':
+ return '--disable-nls'
+ # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
+ if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
+ return '--disable-nls'
+ return "--enable-nls"
+
+BASEDEPENDS_append = " ${@gettext_dependencies(d)}"
+EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"
+
+# Without this, msgfmt from gettext-native will not find ITS files
+# provided by target recipes (for example, polkit.its).
+GETTEXTDATADIRS_append_class-target = ":${STAGING_DATADIR}/gettext"
+export GETTEXTDATADIRS
diff --git a/poky/meta/classes/gio-module-cache.bbclass b/poky/meta/classes/gio-module-cache.bbclass
new file mode 100644
index 000000000..e429bd319
--- /dev/null
+++ b/poky/meta/classes/gio-module-cache.bbclass
@@ -0,0 +1,38 @@
+PACKAGE_WRITE_DEPS += "qemu-native"
+inherit qemu
+
+GIO_MODULE_PACKAGES ??= "${PN}"
+
+gio_module_cache_common() {
+if [ "x$D" != "x" ]; then
+ $INTERCEPT_DIR/postinst_intercept update_gio_module_cache ${PKG} \
+ mlprefix=${MLPREFIX} \
+ binprefix=${MLPREFIX} \
+ libdir=${libdir} \
+ libexecdir=${libexecdir} \
+ base_libdir=${base_libdir} \
+ bindir=${bindir}
+else
+ ${libexecdir}/${MLPREFIX}gio-querymodules ${libdir}/gio/modules/
+fi
+}
+
+python populate_packages_append () {
+ packages = d.getVar('GIO_MODULE_PACKAGES').split()
+
+ for pkg in packages:
+ bb.note("adding gio-module-cache postinst and postrm scripts to %s" % pkg)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gio_module_cache_common')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gio_module_cache_common')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
diff --git a/poky/meta/classes/glide.bbclass b/poky/meta/classes/glide.bbclass
new file mode 100644
index 000000000..db421745b
--- /dev/null
+++ b/poky/meta/classes/glide.bbclass
@@ -0,0 +1,9 @@
+# Handle Glide Vendor Package Management use
+#
+# Copyright 2018 (C) O.S. Systems Software LTDA.
+
+DEPENDS_append = " glide-native"
+
+do_compile_prepend() {
+ ( cd ${B}/src/${GO_IMPORT} && glide install )
+}
diff --git a/poky/meta/classes/gnome.bbclass b/poky/meta/classes/gnome.bbclass
new file mode 100644
index 000000000..c6202bbb7
--- /dev/null
+++ b/poky/meta/classes/gnome.bbclass
@@ -0,0 +1 @@
+inherit gnomebase gtk-icon-cache gconf mime
diff --git a/poky/meta/classes/gnomebase.bbclass b/poky/meta/classes/gnomebase.bbclass
new file mode 100644
index 000000000..efcb6caae
--- /dev/null
+++ b/poky/meta/classes/gnomebase.bbclass
@@ -0,0 +1,30 @@
+def gnome_verdir(v):
+ return oe.utils.trim_version(v, 2)
+
+GNOME_COMPRESS_TYPE ?= "xz"
+SECTION ?= "x11/gnome"
+GNOMEBN ?= "${BPN}"
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
+
+FILES_${PN} += "${datadir}/application-registry \
+ ${datadir}/mime-info \
+ ${datadir}/mime/packages \
+ ${datadir}/mime/application \
+ ${datadir}/gnome-2.0 \
+ ${datadir}/polkit* \
+ ${datadir}/GConf \
+ ${datadir}/glib-2.0/schemas \
+ ${datadir}/appdata \
+ ${datadir}/icons \
+"
+
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+GNOMEBASEBUILDCLASS ??= "autotools"
+inherit ${GNOMEBASEBUILDCLASS} pkgconfig
+
+do_install_append() {
+ rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
+ rm -rf ${D}${localstatedir}/scrollkeeper/*
+ rm -f ${D}${datadir}/applications/*.cache
+}
diff --git a/poky/meta/classes/go.bbclass b/poky/meta/classes/go.bbclass
new file mode 100644
index 000000000..d33d83ea7
--- /dev/null
+++ b/poky/meta/classes/go.bbclass
@@ -0,0 +1,181 @@
+inherit goarch ptest
+
+GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
+
+GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
+GOROOT_class-nativesdk = "${STAGING_DIR_TARGET}${libdir}/go"
+GOROOT = "${STAGING_LIBDIR}/go"
+export GOROOT
+export GOROOT_FINAL = "${libdir}/go"
+
+DEPENDS_GOLANG_class-target = "virtual/${TARGET_PREFIX}go virtual/${TARGET_PREFIX}go-runtime"
+DEPENDS_GOLANG_class-native = "go-native"
+DEPENDS_GOLANG_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk virtual/${TARGET_PREFIX}go-runtime"
+
+DEPENDS_append = " ${DEPENDS_GOLANG}"
+
+GO_LINKSHARED ?= "${@'-linkshared' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_LINK = "${@'-Wl,-rpath-link=${STAGING_DIR_TARGET}${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH = "${@'-r ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
+GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}"
+GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}"
+GO_LINKMODE ?= ""
+GO_LINKMODE_class-nativesdk = "--linkmode=external"
+GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
+export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
+export GOPATH_OMIT_IN_ACTIONID ?= "1"
+export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
+export GOPTESTFLAGS ?= ""
+GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
+
+export GO = "${HOST_PREFIX}go"
+GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
+GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
+export GOTOOLDIR
+
+export CGO_ENABLED ?= "1"
+export CGO_CFLAGS ?= "${CFLAGS}"
+export CGO_CPPFLAGS ?= "${CPPFLAGS}"
+export CGO_CXXFLAGS ?= "${CXXFLAGS}"
+export CGO_LDFLAGS ?= "${LDFLAGS}"
+
+GO_INSTALL ?= "${GO_IMPORT}/..."
+GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
+
+B = "${WORKDIR}/build"
+export GOPATH = "${B}"
+export GOCACHE = "off"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+
+python go_do_unpack() {
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ for url in fetcher.urls:
+ if fetcher.ud[url].type == 'git':
+ if fetcher.ud[url].parm.get('destsuffix') is None:
+ s_dirname = os.path.basename(d.getVar('S'))
+ fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src',
+ d.getVar('GO_IMPORT')) + '/'
+ fetcher.unpack(d.getVar('WORKDIR'))
+ except bb.fetch2.BBFetchException as e:
+ raise bb.build.FuncFailed(e)
+}
+
+go_list_packages() {
+ ${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
+ egrep -v '${GO_INSTALL_FILTEROUT}'
+}
+
+go_list_package_tests() {
+ ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
+ grep -v '\[\]$' | \
+ egrep -v '${GO_INSTALL_FILTEROUT}' | \
+ awk '{ print $1 }'
+}
+
+go_do_configure() {
+ ln -snf ${S}/src ${B}/
+}
+do_configure[dirs] =+ "${GOTMPDIR}"
+
+go_do_compile() {
+ export TMPDIR="${GOTMPDIR}"
+ if [ -n "${GO_INSTALL}" ]; then
+ if [ -n "${GO_LINKSHARED}" ]; then
+ ${GO} install ${GOBUILDFLAGS} `go_list_packages`
+ rm -rf ${B}/bin
+ fi
+ ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
+ fi
+}
+do_compile[dirs] =+ "${GOTMPDIR}"
+do_compile[cleandirs] = "${B}/bin ${B}/pkg"
+
+do_compile_ptest_base() {
+ export TMPDIR="${GOTMPDIR}"
+ rm -f ${B}/.go_compiled_tests.list
+ go_list_package_tests | while read pkg; do
+ cd ${B}/src/$pkg
+ ${GO} test ${GOPTESTBUILDFLAGS} $pkg
+ find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec echo $pkg/{} \; | \
+ sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
+ done
+ do_compile_ptest
+}
+do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
+
+go_do_install() {
+ install -d ${D}${libdir}/go/src/${GO_IMPORT}
+ tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' --exclude 'testdata' . | \
+ tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
+ tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
+
+ if [ -n "`ls ${B}/${GO_BUILD_BINDIR}/`" ]; then
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/${GO_BUILD_BINDIR}/* ${D}${bindir}/
+ fi
+}
+
+go_make_ptest_wrapper() {
+ cat >${D}${PTEST_PATH}/run-ptest <<EOF
+#!/bin/sh
+RC=0
+run_test() (
+ cd "\$1"
+ ((((./\$2 ${GOPTESTFLAGS}; echo \$? >&3) | sed -r -e"s,^(PASS|SKIP|FAIL)\$,\\1: \$1/\$2," >&4) 3>&1) | (read rc; exit \$rc)) 4>&1
+ exit \$?)
+EOF
+
+}
+
+go_stage_testdata() {
+ oldwd="$PWD"
+ cd ${S}/src
+ find ${GO_IMPORT} -depth -type d -name testdata | while read d; do
+ if echo "$d" | grep -q '/vendor/'; then
+ continue
+ fi
+ parent=`dirname $d`
+ install -d ${D}${PTEST_PATH}/$parent
+ cp --preserve=mode,timestamps -R $d ${D}${PTEST_PATH}/$parent/
+ done
+ cd "$oldwd"
+}
+
+do_install_ptest_base() {
+ test -f "${B}/.go_compiled_tests.list" || exit 0
+ install -d ${D}${PTEST_PATH}
+ go_stage_testdata
+ go_make_ptest_wrapper
+ havetests=""
+ while read test; do
+ testdir=`dirname $test`
+ testprog=`basename $test`
+ install -d ${D}${PTEST_PATH}/$testdir
+ install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
+ echo "run_test $testdir $testprog || RC=1" >> ${D}${PTEST_PATH}/run-ptest
+ havetests="yes"
+ done < ${B}/.go_compiled_tests.list
+ if [ -n "$havetests" ]; then
+ echo "exit \$RC" >> ${D}${PTEST_PATH}/run-ptest
+ chmod +x ${D}${PTEST_PATH}/run-ptest
+ else
+ rm -rf ${D}${PTEST_PATH}
+ fi
+ do_install_ptest
+ chown -R root:root ${D}${PTEST_PATH}
+}
+
+EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
+
+FILES_${PN}-dev = "${libdir}/go/src"
+FILES_${PN}-staticdev = "${libdir}/go/pkg"
+
+INSANE_SKIP_${PN} += "ldflags"
+INSANE_SKIP_${PN}-ptest += "ldflags"
diff --git a/poky/meta/classes/goarch.bbclass b/poky/meta/classes/goarch.bbclass
new file mode 100644
index 000000000..f54c5169e
--- /dev/null
+++ b/poky/meta/classes/goarch.bbclass
@@ -0,0 +1,100 @@
+BUILD_GOOS = "${@go_map_os(d.getVar('BUILD_OS'), d)}"
+BUILD_GOARCH = "${@go_map_arch(d.getVar('BUILD_ARCH'), d)}"
+BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"
+HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"
+HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
+HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
+TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
+TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
+TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
+GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"
+
+# Go supports dynamic linking on a limited set of architectures.
+# See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go
+GO_DYNLINK = ""
+GO_DYNLINK_arm = "1"
+GO_DYNLINK_aarch64 = "1"
+GO_DYNLINK_x86 = "1"
+GO_DYNLINK_x86-64 = "1"
+GO_DYNLINK_powerpc64 = "1"
+GO_DYNLINK_class-native = ""
+GO_DYNLINK_class-nativesdk = ""
+
+# define here because everybody inherits this class
+#
+COMPATIBLE_HOST_linux-gnux32 = "null"
+COMPATIBLE_HOST_linux-muslx32 = "null"
+COMPATIBLE_HOST_powerpc = "null"
+COMPATIBLE_HOST_powerpc64 = "null"
+COMPATIBLE_HOST_mipsarchn32 = "null"
+ARM_INSTRUCTION_SET = "arm"
+TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_NOPIE_CFLAGS ??= ""
+
+def go_map_arch(a, d):
+ import re
+ if re.match('i.86', a):
+ return '386'
+ elif a == 'x86_64':
+ return 'amd64'
+ elif re.match('arm.*', a):
+ return 'arm'
+ elif re.match('aarch64.*', a):
+ return 'arm64'
+ elif re.match('mips64el.*', a):
+ return 'mips64le'
+ elif re.match('mips64.*', a):
+ return 'mips64'
+ elif a == 'mips':
+ return 'mips'
+ elif a == 'mipsel':
+ return 'mipsle'
+ elif re.match('p(pc|owerpc)(64)', a):
+ return 'ppc64'
+ elif re.match('p(pc|owerpc)(64el)', a):
+ return 'ppc64le'
+ else:
+ raise bb.parse.SkipRecipe("Unsupported CPU architecture: %s" % a)
+
+def go_map_arm(a, f, d):
+ import re
+ if re.match('arm.*', a):
+ if 'armv7' in f:
+ return '7'
+ elif 'armv6' in f:
+ return '6'
+ elif 'armv5' in f:
+ return '5'
+ return ''
+
+def go_map_386(a, f, d):
+ import re
+ if re.match('i.86', a):
+ if ('core2' in f) or ('corei7' in f):
+ return 'sse2'
+ else:
+ return '387'
+ return ''
+
+def go_map_mips(a, f, d):
+ import re
+ if a == 'mips' or a == 'mipsel':
+ if 'fpu-hard' in f:
+ return 'hardfloat'
+ else:
+ return 'softfloat'
+ return ''
+
+def go_map_os(o, d):
+ if o.startswith('linux'):
+ return 'linux'
+ return o
+
+
diff --git a/poky/meta/classes/gobject-introspection-data.bbclass b/poky/meta/classes/gobject-introspection-data.bbclass
new file mode 100644
index 000000000..2ef684626
--- /dev/null
+++ b/poky/meta/classes/gobject-introspection-data.bbclass
@@ -0,0 +1,7 @@
+# This variable is set to True if gobject-introspection-data is in
+# DISTRO_FEATURES and qemu-usermode is in MACHINE_FEATURES, and False otherwise.
+#
+# It should be used in recipes to determine whether introspection data should be built,
+# so that qemu use can be avoided when necessary.
+GI_DATA_ENABLED ?= "${@bb.utils.contains('DISTRO_FEATURES', 'gobject-introspection-data', \
+ bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d), 'False', d)}"
diff --git a/poky/meta/classes/gobject-introspection.bbclass b/poky/meta/classes/gobject-introspection.bbclass
new file mode 100644
index 000000000..b6160b88b
--- /dev/null
+++ b/poky/meta/classes/gobject-introspection.bbclass
@@ -0,0 +1,43 @@
+# Inherit this class in recipes to enable building their introspection files
+
+# python3native is inherited to prevent introspection tools being run with
+# host's python 3 (they need to be run with native python 3)
+#
+# This also sets up autoconf-based recipes to build introspection data (or not),
+# depending on distro and machine features (see gobject-introspection-data class).
+inherit python3native gobject-introspection-data
+EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
+
+# When building native recipes, disable introspection, as it is not necessary,
+# pulls in additional dependencies, and makes build times longer
+EXTRA_OECONF_prepend_class-native = "--disable-introspection "
+EXTRA_OECONF_prepend_class-nativesdk = "--disable-introspection "
+
+UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
+
+# Generating introspection data depends on a combination of native and target
+# introspection tools, and qemu to run the target tools.
+DEPENDS_append_class-target = " gobject-introspection gobject-introspection-native qemu-native prelink-native"
+
+# Even though introspection is disabled on -native, gobject-introspection package is still
+# needed for m4 macros.
+DEPENDS_append_class-native = " gobject-introspection-native"
+DEPENDS_append_class-nativesdk = " gobject-introspection-native"
+
+# This is used by introspection tools to find .gir includes
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+do_configure_prepend_class-target () {
+ # introspection.m4 pre-packaged with upstream tarballs does not yet
+ # have our fixes
+ mkdir -p ${S}/m4
+ cp ${STAGING_DIR_TARGET}/${datadir}/aclocal/introspection.m4 ${S}/m4
+}
+
+# .typelib files are needed at runtime and so they go to the main package (so
+# they'll be together with libraries they support).
+FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
+
+# .gir files go to dev package, as they're needed for developing (but not for
+# running) things that depends on introspection.
+FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"
diff --git a/poky/meta/classes/godep.bbclass b/poky/meta/classes/godep.bbclass
new file mode 100644
index 000000000..c82401c31
--- /dev/null
+++ b/poky/meta/classes/godep.bbclass
@@ -0,0 +1,8 @@
+DEPENDS_append = " go-dep-native"
+
+do_compile_prepend() {
+ rm -f ${WORKDIR}/build/src/${GO_IMPORT}/Gopkg.toml
+ rm -f ${WORKDIR}/build/src/${GO_IMPORT}/Gopkg.lock
+ ( cd ${WORKDIR}/build/src/${GO_IMPORT} && dep init && dep ensure )
+}
+
diff --git a/poky/meta/classes/grub-efi-cfg.bbclass b/poky/meta/classes/grub-efi-cfg.bbclass
new file mode 100644
index 000000000..5eeee6c2e
--- /dev/null
+++ b/poky/meta/classes/grub-efi-cfg.bbclass
@@ -0,0 +1,114 @@
+# grub-efi.bbclass
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# Released under the MIT license (see packages/COPYING)
+
+# Provide grub-efi specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${GRUB_GFXSERIAL} - set this to 1 to have graphics and serial in the boot menu
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
+# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
+# ${GRUB_ROOT} - grub's root device.
+
+GRUB_SERIAL ?= "console=ttyS0,115200"
+GRUB_CFG_VM = "${S}/grub_vm.cfg"
+GRUB_CFG_LIVE = "${S}/grub_live.cfg"
+GRUB_TIMEOUT ?= "10"
+#FIXME: build this from the machine config
+GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
+
+EFIDIR = "/EFI/BOOT"
+GRUB_ROOT ?= "${ROOT}"
+APPEND ?= ""
+
+# Need UUID utility code.
+inherit fs-uuid
+
+python build_efi_cfg() {
+ import sys
+
+ workdir = d.getVar('WORKDIR')
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ gfxserial = d.getVar('GRUB_GFXSERIAL') or ""
+
+ labels = d.getVar('LABELS')
+ if not labels:
+ bb.debug(1, "LABELS not defined, nothing to do")
+ return
+
+ if labels == []:
+ bb.debug(1, "No labels, nothing to do")
+ return
+
+ cfile = d.getVar('GRUB_CFG')
+ if not cfile:
+ bb.fatal('Unable to read GRUB_CFG')
+
+ try:
+ cfgfile = open(cfile, 'w')
+ except OSError:
+ bb.fatal('Unable to open %s' % cfile)
+
+ cfgfile.write('# Automatically created by OE\n')
+
+ opts = d.getVar('GRUB_OPTS')
+ if opts:
+ for opt in opts.split(';'):
+ cfgfile.write('%s\n' % opt)
+
+ cfgfile.write('default=%s\n' % (labels.split()[0]))
+
+ timeout = d.getVar('GRUB_TIMEOUT')
+ if timeout:
+ cfgfile.write('timeout=%s\n' % timeout)
+ else:
+ cfgfile.write('timeout=50\n')
+
+ root = d.getVar('GRUB_ROOT')
+ if not root:
+ bb.fatal('GRUB_ROOT not defined')
+
+ if gfxserial == "1":
+ btypes = [ [ " graphics console", "" ],
+ [ " serial console", d.getVar('GRUB_SERIAL') or "" ] ]
+ else:
+ btypes = [ [ "", "" ] ]
+
+ for label in labels.split():
+ localdata = d.createCopy()
+
+ for btype in btypes:
+ cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
+ lb = label
+ if label == "install":
+ lb = "install-efi"
+ kernel = localdata.getVar('KERNEL_IMAGETYPE')
+ cfgfile.write('linux /%s LABEL=%s' % (kernel, lb))
+
+ cfgfile.write(' %s' % replace_rootfs_uuid(d, root))
+
+ append = localdata.getVar('APPEND')
+ initrd = localdata.getVar('INITRD')
+
+ if append:
+ append = replace_rootfs_uuid(d, append)
+ cfgfile.write(' %s' % (append))
+
+ cfgfile.write(' %s' % btype[1])
+ cfgfile.write('\n')
+
+ if initrd:
+ cfgfile.write('initrd /initrd')
+ cfgfile.write('\n}\n')
+
+ cfgfile.close()
+}
diff --git a/poky/meta/classes/grub-efi.bbclass b/poky/meta/classes/grub-efi.bbclass
new file mode 100644
index 000000000..90badc03a
--- /dev/null
+++ b/poky/meta/classes/grub-efi.bbclass
@@ -0,0 +1,39 @@
+inherit grub-efi-cfg
+
+efi_populate() {
+ # DEST must be the root of the image so that EFIDIR is not
+ # nested under a top level directory.
+ DEST=$1
+
+ install -d ${DEST}${EFIDIR}
+
+ GRUB_IMAGE="grub-efi-bootia32.efi"
+ DEST_IMAGE="bootia32.efi"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ GRUB_IMAGE="grub-efi-bootx64.efi"
+ DEST_IMAGE="bootx64.efi"
+ fi
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}/${DEST_IMAGE}
+ EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+ printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh
+
+ install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg
+}
+
+efi_iso_populate() {
+ iso_dir=$1
+ efi_populate $iso_dir
+ # Build a EFI directory to create efi.img
+ mkdir -p ${EFIIMGDIR}/${EFIDIR}
+ cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+ cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
+ EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+ printf 'fs0:%s\%s\n' "$EFIPATH" "$GRUB_IMAGE" > ${EFIIMGDIR}/startup.nsh
+ if [ -f "$iso_dir/initrd" ] ; then
+ cp $iso_dir/initrd ${EFIIMGDIR}
+ fi
+}
+
+efi_hddimg_populate() {
+ efi_populate $1
+}
diff --git a/poky/meta/classes/gsettings.bbclass b/poky/meta/classes/gsettings.bbclass
new file mode 100644
index 000000000..eae3dc799
--- /dev/null
+++ b/poky/meta/classes/gsettings.bbclass
@@ -0,0 +1,38 @@
+# A bbclass to handle installed GSettings (glib) schemas, updated the compiled
+# form on package install and remove.
+#
+# The compiled schemas are platform-agnostic, so we can depend on
+# glib-2.0-native for the native tool and run the postinst script when the
+# rootfs builds to save a little time on first boot.
+
+# TODO use a trigger so that this runs once per package operation run
+
+
+RDEPENDS_${PN} += "glib-2.0-utils"
+
+FILES_${PN} += "${datadir}/glib-2.0/schemas"
+
+PACKAGE_WRITE_DEPS += "glib-2.0-native"
+
+gsettings_postinstrm () {
+ glib-compile-schemas $D${datadir}/glib-2.0/schemas
+}
+
+python populate_packages_append () {
+ pkg = d.getVar('PN')
+ bb.note("adding gsettings postinst scripts to %s" % pkg)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gsettings_postinstrm')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ bb.note("adding gsettings postrm scripts to %s" % pkg)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gsettings_postinstrm')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
diff --git a/poky/meta/classes/gtk-doc.bbclass b/poky/meta/classes/gtk-doc.bbclass
new file mode 100644
index 000000000..b4f675490
--- /dev/null
+++ b/poky/meta/classes/gtk-doc.bbclass
@@ -0,0 +1,68 @@
+# Helper class to pull in the right gtk-doc dependencies and configure
+# gtk-doc to enable or disable documentation building (which requries the
+# use of usermode qemu).
+
+# This variable is set to True if api-documentation is in
+# DISTRO_FEATURES and qemu-usermode is in MACHINE_FEATURES, and False otherwise.
+#
+# It should be used in recipes to determine whether gtk-doc based documentation should be built,
+# so that qemu use can be avoided when necessary.
+GTKDOC_ENABLED ?= "${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', \
+ bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d), 'False', d)}"
+
+EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GTKDOC_ENABLED', 'True', '--enable-gtk-doc --enable-gtk-doc-html --disable-gtk-doc-pdf', \
+ '--disable-gtk-doc', d)} "
+
+# When building native recipes, disable gtkdoc, as it is not necessary,
+# pulls in additional dependencies, and makes build times longer
+EXTRA_OECONF_prepend_class-native = "--disable-gtk-doc "
+EXTRA_OECONF_prepend_class-nativesdk = "--disable-gtk-doc "
+
+# Even though gtkdoc is disabled on -native, gtk-doc package is still
+# needed for m4 macros.
+DEPENDS_append = " gtk-doc-native"
+
+# The documentation directory, where the infrastructure will be copied.
+# gtkdocize has a default of "." so to handle out-of-tree builds set this to $S.
+GTKDOC_DOCDIR ?= "${S}"
+
+export STAGING_DIR_HOST
+
+inherit python3native pkgconfig qemu
+DEPENDS_append = "${@' qemu-native' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
+
+do_configure_prepend () {
+ # Need to use ||true as this is only needed if configure.ac both exists
+ # and uses GTK_DOC_CHECK.
+ gtkdocize --srcdir ${S} --docdir ${GTKDOC_DOCDIR} || true
+}
+
+do_compile_prepend_class-target () {
+ if [ ${GTKDOC_ENABLED} = True ]; then
+ # Write out a qemu wrapper that will be given to gtkdoc-scangobj so that it
+ # can run target helper binaries through that.
+ qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['\$GIR_EXTRA_LIBS_PATH','$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
+ cat > ${B}/gtkdoc-qemuwrapper << EOF
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
+
+GIR_EXTRA_LIBS_PATH=\`find ${B} -name *.so -printf "%h\n"|sort|uniq| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
+GIR_EXTRA_LIBS_PATH=\`find ${B} -name .libs| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH
+
+if [ -d ".libs" ]; then
+ $qemu_binary ".libs/\$@"
+else
+ $qemu_binary "\$@"
+fi
+
+if [ \$? -ne 0 ]; then
+ echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help."
+ echo "(typically like this: GIR_EXTRA_LIBS_PATH=\"$""{B}/something/.libs\" )"
+ exit 1
+fi
+EOF
+ chmod +x ${B}/gtkdoc-qemuwrapper
+ fi
+}
diff --git a/poky/meta/classes/gtk-icon-cache.bbclass b/poky/meta/classes/gtk-icon-cache.bbclass
new file mode 100644
index 000000000..d87167aec
--- /dev/null
+++ b/poky/meta/classes/gtk-icon-cache.bbclass
@@ -0,0 +1,66 @@
+FILES_${PN} += "${datadir}/icons/hicolor"
+
+DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"
+
+PACKAGE_WRITE_DEPS += "gtk-icon-utils-native gdk-pixbuf-native"
+
+gtk_icon_cache_postinst() {
+if [ "x$D" != "x" ]; then
+ $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} \
+ mlprefix=${MLPREFIX} \
+ libdir_native=${libdir_native}
+else
+
+ # Update the pixbuf loaders in case they haven't been registered yet
+ ${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
+
+ for icondir in /usr/share/icons/* ; do
+ if [ -d $icondir ] ; then
+ gtk-update-icon-cache -fqt $icondir
+ fi
+ done
+fi
+}
+
+gtk_icon_cache_postrm() {
+if [ "x$D" != "x" ]; then
+ $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} \
+ mlprefix=${MLPREFIX} \
+ libdir=${libdir}
+else
+ for icondir in /usr/share/icons/* ; do
+ if [ -d $icondir ] ; then
+ gtk-update-icon-cache -qt $icondir
+ fi
+ done
+fi
+}
+
+python populate_packages_append () {
+ packages = d.getVar('PACKAGES').split()
+ pkgdest = d.getVar('PKGDEST')
+
+ for pkg in packages:
+ icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir'))
+ if not os.path.exists(icon_dir):
+ continue
+
+ bb.note("adding hicolor-icon-theme dependency to %s" % pkg)
+ rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme"
+ d.appendVar('RDEPENDS_%s' % pkg, rdepends)
+
+ bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gtk_icon_cache_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gtk_icon_cache_postrm')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
diff --git a/poky/meta/classes/gtk-immodules-cache.bbclass b/poky/meta/classes/gtk-immodules-cache.bbclass
new file mode 100644
index 000000000..3d82dbe9e
--- /dev/null
+++ b/poky/meta/classes/gtk-immodules-cache.bbclass
@@ -0,0 +1,89 @@
+# This class will update the inputmethod module cache for virtual keyboards
+#
+# Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+
+inherit qemu
+
+GTKIMMODULES_PACKAGES ?= "${PN}"
+
+gtk_immodule_cache_postinst() {
+if [ "x$D" != "x" ]; then
+ if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so)
+ ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \
+ $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
+ fi
+ if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so)
+ ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \
+ $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
+ fi
+
+ [ $? -ne 0 ] && exit 1
+ exit 0
+fi
+if [ ! -z `which gtk-query-immodules-2.0` ]; then
+ gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
+fi
+if [ ! -z `which gtk-query-immodules-3.0` ]; then
+ gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+fi
+}
+
+gtk_immodule_cache_postrm() {
+if [ "x$D" != "x" ]; then
+ if [ -x $D${bindir}/gtk-query-immodules-2.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-2.0/*/immodules/*.so)
+ ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-2.0')} \
+ $IMFILES > $D${libdir}/gtk-2.0/2.10.0/immodules.cache 2>/dev/null &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-2.0/2.10.0/immodules.cache
+ fi
+ if [ -x $D${bindir}/gtk-query-immodules-3.0 ]; then
+ IMFILES=$(ls $D${libdir}/gtk-3.0/*/immodules/*.so)
+ ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-3.0')} \
+ $IMFILES > $D${libdir}/gtk-3.0/3.0.0/immodules.cache 2>/dev/null &&
+ sed -i -e "s:$D::" $D${libdir}/gtk-3.0/3.0.0/immodules.cache
+ fi
+
+ [ $? -ne 0 ] && exit 1
+ exit 0
+fi
+if [ ! -z `which gtk-query-immodules-2.0` ]; then
+ gtk-query-immodules-2.0 > ${libdir}/gtk-2.0/2.10.0/immodules.cache
+fi
+if [ ! -z `which gtk-query-immodules-3.0` ]; then
+ gtk-query-immodules-3.0 > ${libdir}/gtk-3.0/3.0.0/immodules.cache
+fi
+}
+
+python populate_packages_append () {
+ gtkimmodules_pkgs = d.getVar('GTKIMMODULES_PACKAGES').split()
+
+ for pkg in gtkimmodules_pkgs:
+ bb.note("adding gtk-immodule-cache postinst and postrm scripts to %s" % pkg)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('gtk_immodule_cache_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('gtk_immodule_cache_postrm')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+python __anonymous() {
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES', False)
+ if not gtkimmodules_check:
+ bb_filename = d.getVar('FILE', False)
+ bb.fatal("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
+}
+
diff --git a/poky/meta/classes/icecc.bbclass b/poky/meta/classes/icecc.bbclass
new file mode 100644
index 000000000..0ca8de86c
--- /dev/null
+++ b/poky/meta/classes/icecc.bbclass
@@ -0,0 +1,416 @@
+# IceCream distributed compiling support
+#
+# Stages directories with symlinks from gcc/g++ to icecc, for both
+# native and cross compilers. Depending on each configure or compile,
+# the directories are added at the head of the PATH list and ICECC_CXX
+# and ICEC_CC are set.
+#
+# For the cross compiler, creates a tar.gz of our toolchain and sets
+# ICECC_VERSION accordingly.
+#
+# The class now handles all 3 different compile 'stages' (i.e native ,cross-kernel and target) creating the
+# necessary environment tar.gz file to be used by the remote machines.
+# It also supports meta-toolchain generation
+#
+# If ICECC_PATH is not set in local.conf then the class will try to locate it using 'bb.utils.which'
+# but nothing is sure ;)
+#
+# If ICECC_ENV_EXEC is set in local.conf, then it should point to the icecc-create-env script provided by the user
+# or the default one provided by icecc-create-env.bb will be used
+# (NOTE that this is a modified version of the script need it and *not the one that comes with icecc*
+#
+# User can specify if specific packages or packages belonging to class should not use icecc to distribute
+# compile jobs to remote machines, but handled locally, by defining ICECC_USER_CLASS_BL and ICECC_USER_PACKAGE_BL
+# with the appropriate values in local.conf. In addition the user can force to enable icecc for packages
+# which set an empty PARALLEL_MAKE variable by defining ICECC_USER_PACKAGE_WL.
+#
+#########################################################################################
+#Error checking is kept to minimum so double check any parameters you pass to the class
+###########################################################################################
+
+BB_HASHBASE_WHITELIST += "ICECC_PARALLEL_MAKE ICECC_DISABLED ICECC_USER_PACKAGE_BL \
+ ICECC_USER_CLASS_BL ICECC_USER_PACKAGE_WL ICECC_PATH ICECC_ENV_EXEC \
+ ICECC_CARET_WORKAROUND ICECC_CFLAGS ICECC_ENV_VERSION \
+ ICECC_DEBUG ICECC_LOGFILE ICECC_REPEAT_RATE ICECC_PREFERRED_HOST \
+ ICECC_CLANG_REMOTE_CPP ICECC_IGNORE_UNVERIFIED ICECC_TEST_SOCKET \
+ ICECC_ENV_DEBUG \
+ "
+
+ICECC_ENV_EXEC ?= "${STAGING_BINDIR_NATIVE}/icecc-create-env"
+
+# This version can be incremented when changes are made to the environment that
+# invalidate the version on the compile nodes. Changing it will cause a new
+# environment to be created.
+#
+# A useful thing to do for testing Icecream changes locally is to add a
+# subversion in local.conf:
+# ICECC_ENV_VERSION_append = "-my-ver-1"
+ICECC_ENV_VERSION = "2"
+
+# Default to disabling the caret workaround, If set to "1" in local.conf, icecc
+# will locally recompile any files that have warnings, which can adversely
+# affect performance.
+#
+# See: https://github.com/icecc/icecream/issues/190
+export ICECC_CARET_WORKAROUND ??= "0"
+
+ICECC_CFLAGS = ""
+CFLAGS += "${ICECC_CFLAGS}"
+CXXFLAGS += "${ICECC_CFLAGS}"
+
+# Debug flags when generating environments
+ICECC_ENV_DEBUG ??= ""
+
+def icecc_dep_prepend(d):
+ # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
+ # we need that built is the responsibility of the patch function / class, not
+ # the application.
+ if not d.getVar('INHIBIT_DEFAULT_DEPS'):
+ return "icecc-create-env-native"
+ return ""
+
+DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
+
+get_cross_kernel_cc[vardepsexclude] += "KERNEL_CC"
+def get_cross_kernel_cc(bb,d):
+ kernel_cc = d.getVar('KERNEL_CC')
+
+ # evaluate the expression by the shell if necessary
+ if '`' in kernel_cc or '$(' in kernel_cc:
+ import subprocess
+ kernel_cc = subprocess.check_output("echo %s" % kernel_cc, shell=True).decode("utf-8")[:-1]
+
+ kernel_cc = kernel_cc.replace('ccache', '').strip()
+ kernel_cc = kernel_cc.split(' ')[0]
+ kernel_cc = kernel_cc.strip()
+ return kernel_cc
+
+def get_icecc(d):
+ return d.getVar('ICECC_PATH') or bb.utils.which(os.getenv("PATH"), "icecc")
+
+def create_path(compilers, bb, d):
+ """
+ Create Symlinks for the icecc in the staging directory
+ """
+ staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
+ if icecc_is_kernel(bb, d):
+ staging += "-kernel"
+
+ #check if the icecc path is set by the user
+ icecc = get_icecc(d)
+
+ # Create the dir if necessary
+ try:
+ os.stat(staging)
+ except:
+ try:
+ os.makedirs(staging)
+ except:
+ pass
+
+ for compiler in compilers:
+ gcc_path = os.path.join(staging, compiler)
+ try:
+ os.stat(gcc_path)
+ except:
+ try:
+ os.symlink(icecc, gcc_path)
+ except:
+ pass
+
+ return staging
+
+def use_icecc(bb,d):
+ if d.getVar('ICECC_DISABLED') == "1":
+ # don't even try it, when explicitly disabled
+ return "no"
+
+ # allarch recipes don't use compiler
+ if icecc_is_allarch(bb, d):
+ return "no"
+
+ if icecc_is_cross_canadian(bb, d):
+ return "no"
+
+ pn = d.getVar('PN')
+
+ system_class_blacklist = []
+ user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL') or "none").split()
+ package_class_blacklist = system_class_blacklist + user_class_blacklist
+
+ for black in package_class_blacklist:
+ if bb.data.inherits_class(black, d):
+ bb.debug(1, "%s: class %s found in blacklist, disable icecc" % (pn, black))
+ return "no"
+
+ # "system" recipe blacklist contains a list of packages that can not distribute compile tasks
+ # for one reason or the other
+ # this is the old list (which doesn't seem to be valid anymore, because I was able to build
+ # all these with icecc enabled)
+ # system_package_blacklist = [ "glibc", "gcc", "bind", "u-boot", "dhcp-forwarder", "enchant", "connman", "orbit2" ]
+ # when adding new entry, please document why (how it failed) so that we can re-evaluate it later
+ # e.g. when there is new version
+ # building libgcc-initial with icecc fails with CPP sanity check error if host sysroot contains cross gcc built for another target tune/variant
+ system_package_blacklist = ["libgcc-initial"]
+ user_package_blacklist = (d.getVar('ICECC_USER_PACKAGE_BL') or "").split()
+ user_package_whitelist = (d.getVar('ICECC_USER_PACKAGE_WL') or "").split()
+ package_blacklist = system_package_blacklist + user_package_blacklist
+
+ if pn in package_blacklist:
+ bb.debug(1, "%s: found in blacklist, disable icecc" % pn)
+ return "no"
+
+ if pn in user_package_whitelist:
+ bb.debug(1, "%s: found in whitelist, enable icecc" % pn)
+ return "yes"
+
+ if d.getVar('PARALLEL_MAKE') == "":
+ bb.debug(1, "%s: has empty PARALLEL_MAKE, disable icecc" % pn)
+ return "no"
+
+ return "yes"
+
+def icecc_is_allarch(bb, d):
+ return d.getVar("PACKAGE_ARCH") == "all" or bb.data.inherits_class('allarch', d)
+
+def icecc_is_kernel(bb, d):
+ return \
+ bb.data.inherits_class("kernel", d);
+
+def icecc_is_native(bb, d):
+ return \
+ bb.data.inherits_class("cross", d) or \
+ bb.data.inherits_class("native", d);
+
+def icecc_is_cross_canadian(bb, d):
+ return bb.data.inherits_class("cross-canadian", d)
+
+def icecc_dir(bb, d):
+ return d.expand('${TMPDIR}/work-shared/ice')
+
+# Don't pollute allarch signatures with TARGET_FPU
+icecc_version[vardepsexclude] += "TARGET_FPU"
+def icecc_version(bb, d):
+ if use_icecc(bb, d) == "no":
+ return ""
+
+ parallel = d.getVar('ICECC_PARALLEL_MAKE') or ""
+ if not d.getVar('PARALLEL_MAKE') == "" and parallel:
+ d.setVar("PARALLEL_MAKE", parallel)
+
+ # Disable showing the caret in the GCC compiler output if the workaround is
+ # disabled
+ if d.getVar('ICECC_CARET_WORKAROUND') == '0':
+ d.setVar('ICECC_CFLAGS', '-fno-diagnostics-show-caret')
+
+ if icecc_is_native(bb, d):
+ archive_name = "local-host-env"
+ elif d.expand('${HOST_PREFIX}') == "":
+ bb.fatal(d.expand("${PN}"), " NULL prefix")
+ else:
+ prefix = d.expand('${HOST_PREFIX}' )
+ distro = d.expand('${DISTRO}')
+ target_sys = d.expand('${TARGET_SYS}')
+ float = d.getVar('TARGET_FPU') or "hard"
+ archive_name = prefix + distro + "-" + target_sys + "-" + float
+ if icecc_is_kernel(bb, d):
+ archive_name += "-kernel"
+
+ import socket
+ ice_dir = icecc_dir(bb, d)
+ tar_file = os.path.join(ice_dir, "{archive}-{version}-@VERSION@-{hostname}.tar.gz".format(
+ archive=archive_name,
+ version=d.getVar('ICECC_ENV_VERSION'),
+ hostname=socket.gethostname()
+ ))
+
+ return tar_file
+
+def icecc_path(bb,d):
+ if use_icecc(bb, d) == "no":
+ # don't create unnecessary directories when icecc is disabled
+ return
+
+ if icecc_is_kernel(bb, d):
+ return create_path( [get_cross_kernel_cc(bb,d), ], bb, d)
+
+ else:
+ prefix = d.expand('${HOST_PREFIX}')
+ return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
+
+def icecc_get_external_tool(bb, d, tool):
+ external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
+ target_prefix = d.expand('${TARGET_PREFIX}')
+ return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
+
+def icecc_get_tool_link(tool, d):
+ import subprocess
+ return subprocess.check_output("readlink -f %s" % tool, shell=True).decode("utf-8")[:-1]
+
+def icecc_get_path_tool(tool, d):
+ # This is a little ugly, but we want to make sure we add an actual
+ # compiler to the toolchain, not ccache. Some distros (e.g. Fedora)
+ # have ccache enabled by default using symlinks PATH, meaning ccache
+ # would be found first when looking for the compiler.
+ paths = os.getenv("PATH").split(':')
+ while True:
+ p, hist = bb.utils.which(':'.join(paths), tool, history=True)
+ if not p or os.path.basename(icecc_get_tool_link(p, d)) != 'ccache':
+ return p
+ paths = paths[len(hist):]
+
+ return ""
+
+# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
+icecc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
+def icecc_get_tool(bb, d, tool):
+ if icecc_is_native(bb, d):
+ return icecc_get_path_tool(tool, d)
+ elif icecc_is_kernel(bb, d):
+ return icecc_get_path_tool(get_cross_kernel_cc(bb, d), d)
+ else:
+ ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
+ target_sys = d.expand('${TARGET_SYS}')
+ for p in ice_dir.split(':'):
+ tool_bin = os.path.join(p, "%s-%s" % (target_sys, tool))
+ if os.path.isfile(tool_bin):
+ return tool_bin
+ external_tool_bin = icecc_get_external_tool(bb, d, tool)
+ if os.path.isfile(external_tool_bin):
+ return external_tool_bin
+ return ""
+
+def icecc_get_and_check_tool(bb, d, tool):
+ # Check that g++ or gcc is not a symbolic link to icecc binary in
+ # PATH or icecc-create-env script will silently create an invalid
+ # compiler environment package.
+ t = icecc_get_tool(bb, d, tool)
+ if t:
+ link_path = icecc_get_tool_link(tool, d)
+ if link_path == get_icecc(d):
+ bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d)))
+ return ""
+ else:
+ return t
+ else:
+ return t
+
+wait_for_file() {
+ local TIME_ELAPSED=0
+ local FILE_TO_TEST=$1
+ local TIMEOUT=$2
+ until [ -f "$FILE_TO_TEST" ]
+ do
+ TIME_ELAPSED=`expr $TIME_ELAPSED + 1`
+ if [ $TIME_ELAPSED -gt $TIMEOUT ]
+ then
+ return 1
+ fi
+ sleep 1
+ done
+}
+
+def set_icecc_env():
+ # dummy python version of set_icecc_env
+ return
+
+set_icecc_env() {
+ if [ "${@use_icecc(bb, d)}" = "no" ]
+ then
+ return
+ fi
+ ICECC_VERSION="${@icecc_version(bb, d)}"
+ if [ "x${ICECC_VERSION}" = "x" ]
+ then
+ bbwarn "Cannot use icecc: could not get ICECC_VERSION"
+ return
+ fi
+
+ ICE_PATH="${@icecc_path(bb, d)}"
+ if [ "x${ICE_PATH}" = "x" ]
+ then
+ bbwarn "Cannot use icecc: could not get ICE_PATH"
+ return
+ fi
+
+ ICECC_CC="${@icecc_get_and_check_tool(bb, d, "gcc")}"
+ ICECC_CXX="${@icecc_get_and_check_tool(bb, d, "g++")}"
+ # cannot use icecc_get_and_check_tool here because it assumes as without target_sys prefix
+ ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
+ if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
+ then
+ bbwarn "Cannot use icecc: could not get ICECC_CC or ICECC_CXX"
+ return
+ fi
+
+ ICE_VERSION=`$ICECC_CC -dumpversion`
+ ICECC_VERSION=`echo ${ICECC_VERSION} | sed -e "s/@VERSION@/$ICE_VERSION/g"`
+ if [ ! -x "${ICECC_ENV_EXEC}" ]
+ then
+ bbwarn "Cannot use icecc: invalid ICECC_ENV_EXEC"
+ return
+ fi
+
+ ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
+ # for target recipes should return something like:
+ # /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as
+ # and just "as" for native, if it returns "as" in current directory (for whatever reason) use "as" from PATH
+ if [ "`dirname "${ICECC_AS}"`" = "." ]
+ then
+ ICECC_AS="${ICECC_WHICH_AS}"
+ fi
+
+ if [ ! -f "${ICECC_VERSION}.done" ]
+ then
+ mkdir -p "`dirname "${ICECC_VERSION}"`"
+
+ # the ICECC_VERSION generation step must be locked by a mutex
+ # in order to prevent race conditions
+ if flock -n "${ICECC_VERSION}.lock" \
+ ${ICECC_ENV_EXEC} ${ICECC_ENV_DEBUG} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}"
+ then
+ touch "${ICECC_VERSION}.done"
+ elif [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]
+ then
+ # locking failed so wait for ${ICECC_VERSION}.done to appear
+ bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
+ return
+ fi
+ fi
+
+ # Don't let ccache find the icecream compiler links that have been created, otherwise
+ # it can end up invoking icecream recursively.
+ export CCACHE_PATH="$PATH"
+ export CCACHE_DISBALE="1"
+
+ export ICECC_VERSION ICECC_CC ICECC_CXX
+ export PATH="$ICE_PATH:$PATH"
+
+ bbnote "Using icecc"
+}
+
+do_configure_prepend() {
+ set_icecc_env
+}
+
+do_compile_prepend() {
+ set_icecc_env
+}
+
+do_compile_kernelmodules_prepend() {
+ set_icecc_env
+}
+
+do_install_prepend() {
+ set_icecc_env
+}
+
+# IceCream is not (currently) supported in the extensible SDK
+ICECC_SDK_HOST_TASK = "nativesdk-icecc-toolchain"
+ICECC_SDK_HOST_TASK_task-populate-sdk-ext = ""
+
+# Don't include IceCream in uninative tarball
+ICECC_SDK_HOST_TASK_pn-uninative-tarball = ""
+
+# Add the toolchain scripts to the SDK
+TOOLCHAIN_HOST_TASK_append = " ${ICECC_SDK_HOST_TASK}"
diff --git a/poky/meta/classes/image-buildinfo.bbclass b/poky/meta/classes/image-buildinfo.bbclass
new file mode 100644
index 000000000..213fb9cf9
--- /dev/null
+++ b/poky/meta/classes/image-buildinfo.bbclass
@@ -0,0 +1,85 @@
+#
+# Writes build information to target filesystem on /etc/build
+#
+# Copyright (C) 2014 Intel Corporation
+# Author: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@intel.com>
+#
+# Licensed under the MIT license, see COPYING.MIT for details
+#
+# Usage: add INHERIT += "image-buildinfo" to your conf file
+#
+
+# Desired variables to display
+IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION"
+
+# Desired location of the output file in the image.
+IMAGE_BUILDINFO_FILE ??= "${sysconfdir}/build"
+
+# From buildhistory.bbclass
+def image_buildinfo_outputvars(vars, listvars, d):
+ vars = vars.split()
+ listvars = listvars.split()
+ ret = ""
+ for var in vars:
+ value = d.getVar(var) or ""
+ if (d.getVarFlag(var, 'type') == "list"):
+ value = oe.utils.squashspaces(value)
+ ret += "%s = %s\n" % (var, value)
+ return ret.rstrip('\n')
+
+# Gets git branch's status (clean or dirty)
+def get_layer_git_status(path):
+ import subprocess
+ try:
+ subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e;
+ git diff --quiet --no-ext-diff
+ git diff --quiet --no-ext-diff --cached""" % path,
+ shell=True,
+ stderr=subprocess.STDOUT)
+ return ""
+ except subprocess.CalledProcessError as ex:
+ # Silently treat errors as "modified", without checking for the
+ # (expected) return code 1 in a modified git repo. For example, we get
+ # output and a 129 return code when a layer isn't a git repo at all.
+ return "-- modified"
+
+# Returns layer revisions along with their respective status
+def get_layer_revs(d):
+ layers = (d.getVar("BBLAYERS") or "").split()
+ medadata_revs = ["%-17s = %s:%s %s" % (os.path.basename(i), \
+ base_get_metadata_git_branch(i, None).strip(), \
+ base_get_metadata_git_revision(i, None), \
+ get_layer_git_status(i)) \
+ for i in layers]
+ return '\n'.join(medadata_revs)
+
+def buildinfo_target(d):
+ # Get context
+ if d.getVar('BB_WORKERCONTEXT') != '1':
+ return ""
+ # Single and list variables to be read
+ vars = (d.getVar("IMAGE_BUILDINFO_VARS") or "")
+ listvars = (d.getVar("IMAGE_BUILDINFO_LVARS") or "")
+ return image_buildinfo_outputvars(vars, listvars, d)
+
+# Write build information to target filesystem
+python buildinfo () {
+ with open(d.expand('${IMAGE_ROOTFS}${IMAGE_BUILDINFO_FILE}'), 'w') as build:
+ build.writelines((
+ '''-----------------------
+Build Configuration: |
+-----------------------
+''',
+ buildinfo_target(d),
+ '''
+-----------------------
+Layer Revisions: |
+-----------------------
+''',
+ get_layer_revs(d),
+ '''
+'''
+ ))
+}
+
+IMAGE_PREPROCESS_COMMAND += "buildinfo;"
diff --git a/poky/meta/classes/image-combined-dbg.bbclass b/poky/meta/classes/image-combined-dbg.bbclass
new file mode 100644
index 000000000..f4772f7ea
--- /dev/null
+++ b/poky/meta/classes/image-combined-dbg.bbclass
@@ -0,0 +1,9 @@
+IMAGE_PREPROCESS_COMMAND_append = " combine_dbg_image; "
+
+combine_dbg_image () {
+ if [ "${IMAGE_GEN_DEBUGFS}" = "1" -a -e ${IMAGE_ROOTFS}-dbg ]; then
+ # copy target files into -dbg rootfs, so it can be used for
+ # debug purposes directly
+ tar -C ${IMAGE_ROOTFS} -cf - . | tar -C ${IMAGE_ROOTFS}-dbg -xf -
+ fi
+}
diff --git a/poky/meta/classes/image-container.bbclass b/poky/meta/classes/image-container.bbclass
new file mode 100644
index 000000000..f002858bd
--- /dev/null
+++ b/poky/meta/classes/image-container.bbclass
@@ -0,0 +1,21 @@
+ROOTFS_BOOTSTRAP_INSTALL = ""
+IMAGE_TYPES_MASKED += "container"
+IMAGE_TYPEDEP_container = "tar.bz2"
+
+python __anonymous() {
+ if "container" in d.getVar("IMAGE_FSTYPES") and \
+ d.getVar("IMAGE_CONTAINER_NO_DUMMY") != "1" and \
+ "linux-dummy" not in d.getVar("PREFERRED_PROVIDER_virtual/kernel"):
+ msg = '"container" is in IMAGE_FSTYPES, but ' \
+ 'PREFERRED_PROVIDER_virtual/kernel is not "linux-dummy". ' \
+ 'Unless a particular kernel is needed, using linux-dummy will ' \
+ 'prevent a kernel from being built, which can reduce ' \
+ 'build times. If you don\'t want to use "linux-dummy", set ' \
+ '"IMAGE_CONTAINER_NO_DUMMY" to "1".'
+
+ # Raising skip recipe was Paul's clever idea. It causes the error to
+ # only be shown for the recipes actually requested to build, rather
+ # than bb.fatal which would appear for all recipes inheriting the
+ # class.
+ raise bb.parse.SkipRecipe(msg)
+}
diff --git a/poky/meta/classes/image-live.bbclass b/poky/meta/classes/image-live.bbclass
new file mode 100644
index 000000000..966277c67
--- /dev/null
+++ b/poky/meta/classes/image-live.bbclass
@@ -0,0 +1,266 @@
+# Copyright (C) 2004, Advanced Micro Devices, Inc. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Creates a bootable image using syslinux, your kernel and an optional
+# initrd
+
+#
+# End result is two things:
+#
+# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
+# an initrd and a rootfs image. These can be written to harddisks directly and
+# also booted on USB flash disks (write them there with dd).
+#
+# 2. A CD .iso image
+
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
+# an hdd)
+
+# External variables (also used by syslinux.bbclass)
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${NOISO} - skip building the ISO image if set to 1
+# ${NOHDD} - skip building the HDD image if set to 1
+# ${HDDIMG_ID} - FAT image volume-id
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+
+inherit live-vm-common
+
+do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
+ mtools-native:do_populate_sysroot \
+ cdrtools-native:do_populate_sysroot \
+ virtual/kernel:do_deploy \
+ ${MLPREFIX}syslinux:do_populate_sysroot \
+ syslinux-native:do_populate_sysroot \
+ ${PN}:do_image_${@d.getVar('LIVE_ROOTFS_TYPE').replace('-', '_')} \
+ "
+
+
+LABELS_LIVE ?= "boot install"
+ROOT_LIVE ?= "root=/dev/ram0"
+INITRD_IMAGE_LIVE ?= "${MLPREFIX}core-image-minimal-initramfs"
+INITRD_LIVE ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz"
+
+LIVE_ROOTFS_TYPE ?= "ext4"
+ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.${LIVE_ROOTFS_TYPE}"
+
+IMAGE_TYPEDEP_live = "${LIVE_ROOTFS_TYPE}"
+IMAGE_TYPEDEP_iso = "${LIVE_ROOTFS_TYPE}"
+IMAGE_TYPEDEP_hddimg = "${LIVE_ROOTFS_TYPE}"
+IMAGE_TYPES_MASKED += "live hddimg iso"
+
+python() {
+ image_b = d.getVar('IMAGE_BASENAME')
+ initrd_i = d.getVar('INITRD_IMAGE_LIVE')
+ if image_b == initrd_i:
+ bb.error('INITRD_IMAGE_LIVE %s cannot use image live, hddimg or iso.' % initrd_i)
+ bb.fatal('Check IMAGE_FSTYPES and INITRAMFS_FSTYPES settings.')
+ elif initrd_i:
+ d.appendVarFlag('do_bootimg', 'depends', ' %s:do_image_complete' % initrd_i)
+}
+
+HDDDIR = "${S}/hddimg"
+ISODIR = "${S}/iso"
+EFIIMGDIR = "${S}/efi_img"
+COMPACT_ISODIR = "${S}/iso.z"
+
+ISOLINUXDIR ?= "/isolinux"
+ISO_BOOTIMG = "isolinux/isolinux.bin"
+ISO_BOOTCAT = "isolinux/boot.cat"
+MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
+
+BOOTIMG_VOLUME_ID ?= "boot"
+BOOTIMG_EXTRA_SPACE ?= "512"
+
+populate_live() {
+ populate_kernel $1
+ if [ -s "${ROOTFS}" ]; then
+ install -m 0644 ${ROOTFS} $1/rootfs.img
+ fi
+}
+
+build_iso() {
+ # Only create an ISO if we have an INITRD and NOISO was not set
+ if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+ bbnote "ISO image will not be created."
+ return
+ fi
+ # ${INITRD} is a list of multiple filesystem images
+ for fs in ${INITRD}
+ do
+ if [ ! -s "$fs" ]; then
+ bbwarn "ISO image will not be created. $fs is invalid."
+ return
+ fi
+ done
+
+ populate_live ${ISODIR}
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_iso_populate ${ISODIR}
+ fi
+ if [ "${EFI}" = "1" ]; then
+ efi_iso_populate ${ISODIR}
+ build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
+ fi
+
+ # EFI only
+ if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then
+ # Work around bug in isohybrid where it requires isolinux.bin
+ # In the boot catalog, even though it is not used
+ mkdir -p ${ISODIR}/${ISOLINUXDIR}
+ install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
+ fi
+
+ # We used to have support for zisofs; this is a relic of that
+ mkisofs_compress_opts="-r"
+
+ # Check the size of ${ISODIR}/rootfs.img, use mkisofs -iso-level 3
+ # when it exceeds 3.8GB, the specification is 4G - 1 bytes, we need
+ # leave a few space for other files.
+ mkisofs_iso_level=""
+
+ if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+ rootfs_img_size=`stat -c '%s' ${ISODIR}/rootfs.img`
+ # 4080218931 = 3.8 * 1024 * 1024 * 1024
+ if [ $rootfs_img_size -gt 4080218931 ]; then
+ bbnote "${ISODIR}/rootfs.img execeeds 3.8GB, using '-iso-level 3' for mkisofs"
+ mkisofs_iso_level="-iso-level 3"
+ fi
+ fi
+
+ if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
+ # PCBIOS only media
+ mkisofs -V ${BOOTIMG_VOLUME_ID} \
+ -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso \
+ -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+ $mkisofs_compress_opts \
+ ${MKISOFS_OPTIONS} $mkisofs_iso_level ${ISODIR}
+ else
+ # EFI only OR EFI+PCBIOS
+ mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
+ -o ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso \
+ -b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+ $mkisofs_compress_opts ${MKISOFS_OPTIONS} $mkisofs_iso_level \
+ -eltorito-alt-boot -eltorito-platform efi \
+ -b efi.img -no-emul-boot \
+ ${ISODIR}
+ isohybrid_args="-u"
+ fi
+
+ isohybrid $isohybrid_args ${IMGDEPLOYDIR}/${IMAGE_NAME}.iso
+}
+
+build_fat_img() {
+ FATSOURCEDIR=$1
+ FATIMG=$2
+
+ # Calculate the size required for the final image including the
+ # data and filesystem overhead.
+ # Sectors: 512 bytes
+ # Blocks: 1024 bytes
+
+ # Determine the sector count just for the data
+ SECTORS=$(expr $(du --apparent-size -ks ${FATSOURCEDIR} | cut -f 1) \* 2)
+
+ # Account for the filesystem overhead. This includes directory
+ # entries in the clusters as well as the FAT itself.
+ # Assumptions:
+ # FAT32 (12 or 16 may be selected by mkdosfs, but the extra
+ # padding will be minimal on those smaller images and not
+ # worth the logic here to caclulate the smaller FAT sizes)
+ # < 16 entries per directory
+ # 8.3 filenames only
+
+ # 32 bytes per dir entry
+ DIR_BYTES=$(expr $(find ${FATSOURCEDIR} | tail -n +2 | wc -l) \* 32)
+ # 32 bytes for every end-of-directory dir entry
+ DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 32))
+ # 4 bytes per FAT entry per sector of data
+ FAT_BYTES=$(expr $SECTORS \* 4)
+ # 4 bytes per FAT entry per end-of-cluster list
+ FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 4))
+
+ # Use a ceiling function to determine FS overhead in sectors
+ DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
+ # There are two FATs on the image
+ FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
+ SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
+
+ # Determine the final size in blocks accounting for some padding
+ BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+
+ # mkdosfs will sometimes use FAT16 when it is not appropriate,
+ # resulting in a boot failure from SYSLINUX. Use FAT32 for
+ # images larger than 512MB, otherwise let mkdosfs decide.
+ if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
+ FATSIZE="-F 32"
+ fi
+
+ # mkdosfs will fail if ${FATIMG} exists. Since we are creating an
+ # new image, it is safe to delete any previous image.
+ if [ -e ${FATIMG} ]; then
+ rm ${FATIMG}
+ fi
+
+ if [ -z "${HDDIMG_ID}" ]; then
+ mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} ${MKDOSFS_EXTRAOPTS} -C ${FATIMG} \
+ ${BLOCKS}
+ else
+ mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} ${MKDOSFS_EXTRAOPTS} -C ${FATIMG} \
+ ${BLOCKS} -i ${HDDIMG_ID}
+ fi
+
+ # Copy FATSOURCEDIR recursively into the image file directly
+ mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/
+}
+
+build_hddimg() {
+ # Create an HDD image
+ if [ "${NOHDD}" != "1" ] ; then
+ populate_live ${HDDDIR}
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_populate ${HDDDIR}
+ fi
+ if [ "${EFI}" = "1" ]; then
+ efi_hddimg_populate ${HDDDIR}
+ fi
+
+ # Check the size of ${HDDDIR}/rootfs.img, error out if it
+ # exceeds 4GB, it is the single file's max size of FAT fs.
+ if [ -f ${HDDDIR}/rootfs.img ]; then
+ rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img`
+ max_size=`expr 4 \* 1024 \* 1024 \* 1024`
+ if [ $rootfs_img_size -gt $max_size ]; then
+ bberror "${HDDDIR}/rootfs.img execeeds 4GB,"
+ bberror "this doesn't work on FAT filesystem, you can try either of:"
+ bberror "1) Reduce the size of rootfs.img"
+ bbfatal "2) Use iso, vmdk or vdi to instead of hddimg\n"
+ fi
+ fi
+
+ build_fat_img ${HDDDIR} ${IMGDEPLOYDIR}/${IMAGE_NAME}.hddimg
+
+ if [ "${PCBIOS}" = "1" ]; then
+ syslinux_hddimg_install
+ fi
+
+ chmod 644 ${IMGDEPLOYDIR}/${IMAGE_NAME}.hddimg
+ fi
+}
+
+python do_bootimg() {
+ set_live_vm_vars(d, 'LIVE')
+ if d.getVar("PCBIOS") == "1":
+ bb.build.exec_func('build_syslinux_cfg', d)
+ if d.getVar("EFI") == "1":
+ bb.build.exec_func('build_efi_cfg', d)
+ bb.build.exec_func('build_hddimg', d)
+ bb.build.exec_func('build_iso', d)
+ bb.build.exec_func('create_symlinks', d)
+}
+do_bootimg[subimages] = "hddimg iso"
+do_bootimg[imgsuffix] = "."
+
+addtask bootimg before do_image_complete
diff --git a/poky/meta/classes/image-mklibs.bbclass b/poky/meta/classes/image-mklibs.bbclass
new file mode 100644
index 000000000..5f6df1b17
--- /dev/null
+++ b/poky/meta/classes/image-mklibs.bbclass
@@ -0,0 +1,56 @@
+do_rootfs[depends] += "mklibs-native:do_populate_sysroot"
+
+IMAGE_PREPROCESS_COMMAND += "mklibs_optimize_image; "
+
+inherit linuxloader
+
+mklibs_optimize_image_doit() {
+ rm -rf ${WORKDIR}/mklibs
+ mkdir -p ${WORKDIR}/mklibs/dest
+ cd ${IMAGE_ROOTFS}
+ du -bs > ${WORKDIR}/mklibs/du.before.mklibs.txt
+
+ # Build a list of dynamically linked executable ELF files.
+ # Omit libc/libpthread as a special case because it has an interpreter
+ # but is primarily what we intend to strip down.
+ for i in `find . -type f -executable ! -name 'libc-*' ! -name 'libpthread-*'`; do
+ file $i | grep -q ELF || continue
+ ${HOST_PREFIX}readelf -l $i | grep -q INTERP || continue
+ echo $i
+ done > ${WORKDIR}/mklibs/executables.list
+
+ dynamic_loader=$(linuxloader)
+
+ mklibs -v \
+ --ldlib ${dynamic_loader} \
+ --libdir ${baselib} \
+ --sysroot ${PKG_CONFIG_SYSROOT_DIR} \
+ --gcc-options "--sysroot=${PKG_CONFIG_SYSROOT_DIR}" \
+ --root ${IMAGE_ROOTFS} \
+ --target `echo ${TARGET_PREFIX} | sed 's/-$//' ` \
+ -d ${WORKDIR}/mklibs/dest \
+ `cat ${WORKDIR}/mklibs/executables.list`
+
+ cd ${WORKDIR}/mklibs/dest
+ for i in *
+ do
+ cp $i `find ${IMAGE_ROOTFS} -name $i`
+ done
+
+ cd ${IMAGE_ROOTFS}
+ du -bs > ${WORKDIR}/mklibs/du.after.mklibs.txt
+
+ echo rootfs size before mklibs optimization: `cat ${WORKDIR}/mklibs/du.before.mklibs.txt`
+ echo rootfs size after mklibs optimization: `cat ${WORKDIR}/mklibs/du.after.mklibs.txt`
+}
+
+mklibs_optimize_image() {
+ for img in ${MKLIBS_OPTIMIZED_IMAGES}
+ do
+ if [ "${img}" = "${PN}" ] || [ "${img}" = "all" ]
+ then
+ mklibs_optimize_image_doit
+ break
+ fi
+ done
+}
diff --git a/poky/meta/classes/image-prelink.bbclass b/poky/meta/classes/image-prelink.bbclass
new file mode 100644
index 000000000..6a8afa8fa
--- /dev/null
+++ b/poky/meta/classes/image-prelink.bbclass
@@ -0,0 +1,64 @@
+do_rootfs[depends] += "prelink-native:do_populate_sysroot"
+
+IMAGE_PREPROCESS_COMMAND_append_libc-glibc = " prelink_setup; prelink_image; "
+
+python prelink_setup () {
+ oe.utils.write_ld_so_conf(d)
+}
+
+inherit linuxloader
+
+prelink_image () {
+# export PSEUDO_DEBUG=4
+# /bin/env | /bin/grep PSEUDO
+# echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+# echo "LD_PRELOAD=$LD_PRELOAD"
+
+ pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
+ echo "Size before prelinking $pre_prelink_size."
+
+ # We need a prelink conf on the filesystem, add one if it's missing
+ if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf ]; then
+ cp ${STAGING_ETCDIR_NATIVE}/prelink.conf \
+ ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf
+ dummy_prelink_conf=true;
+ else
+ dummy_prelink_conf=false;
+ fi
+
+ # We need a ld.so.conf with pathnames in,prelink conf on the filesystem, add one if it's missing
+ ldsoconf=${IMAGE_ROOTFS}${sysconfdir}/ld.so.conf
+ if [ -e $ldsoconf ]; then
+ cp $ldsoconf $ldsoconf.prelink
+ fi
+ cat ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf >> $ldsoconf
+
+ dynamic_loader=$(linuxloader)
+
+ # prelink!
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ bbnote " prelink: BUILD_REPRODUCIBLE_BINARIES..."
+ if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
+ export PRELINK_TIMESTAMP=`git log -1 --pretty=%ct `
+ else
+ export PRELINK_TIMESTAMP=$REPRODUCIBLE_TIMESTAMP_ROOTFS
+ fi
+ ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -am -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader
+ else
+ ${STAGING_SBINDIR_NATIVE}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf --dynamic-linker $dynamic_loader
+ fi
+
+ # Remove the prelink.conf if we had to add it.
+ if [ "$dummy_prelink_conf" = "true" ]; then
+ rm -f ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf
+ fi
+
+ if [ -e $ldsoconf.prelink ]; then
+ mv $ldsoconf.prelink $ldsoconf
+ else
+ rm $ldsoconf
+ fi
+
+ pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
+ echo "Size after prelinking $pre_prelink_size."
+}
diff --git a/poky/meta/classes/image.bbclass b/poky/meta/classes/image.bbclass
new file mode 100644
index 000000000..2247b305d
--- /dev/null
+++ b/poky/meta/classes/image.bbclass
@@ -0,0 +1,678 @@
+inherit rootfs_${IMAGE_PKGTYPE}
+
+# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
+# in the non-Linux SDK_OS case, such as mingw32
+SDKEXTCLASS ?= "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
+inherit ${SDKEXTCLASS}
+
+TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+POPULATE_SDK_POST_TARGET_COMMAND += "rootfs_sysroot_relativelinks; "
+
+LICENSE ?= "MIT"
+PACKAGES = ""
+DEPENDS += "${MLPREFIX}qemuwrapper-cross depmodwrapper-cross"
+RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
+RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+TESTIMAGECLASS = "${@oe.utils.conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}"
+inherit ${TESTIMAGECLASS}
+
+# IMAGE_FEATURES may contain any available package group
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging"
+
+# Generate companion debugfs?
+IMAGE_GEN_DEBUGFS ?= "0"
+
+# rootfs bootstrap install
+ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
+
+# These packages will be removed from a read-only rootfs after all other
+# packages have been installed
+ROOTFS_RO_UNNEEDED ??= "update-rc.d base-passwd shadow ${VIRTUAL-RUNTIME_update-alternatives} ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# packages to install from features
+FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+FEATURE_INSTALL[vardepvalue] = "${FEATURE_INSTALL}"
+FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+FEATURE_INSTALL_OPTIONAL[vardepvalue] = "${FEATURE_INSTALL_OPTIONAL}"
+
+# Define some very basic feature package groups
+FEATURE_PACKAGES_package-management = "${ROOTFS_PKGMANAGE}"
+SPLASH ?= "psplash"
+FEATURE_PACKAGES_splash = "${SPLASH}"
+
+IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
+
+def check_image_features(d):
+ valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems') or "").split()
+ valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys()
+ for var in d:
+ if var.startswith("PACKAGE_GROUP_"):
+ bb.warn("PACKAGE_GROUP is deprecated, please use FEATURE_PACKAGES instead")
+ valid_features.append(var[14:])
+ elif var.startswith("FEATURE_PACKAGES_"):
+ valid_features.append(var[17:])
+ valid_features.sort()
+
+ features = set(oe.data.typed_value('IMAGE_FEATURES', d))
+ for feature in features:
+ if feature not in valid_features:
+ if bb.utils.contains('EXTRA_IMAGE_FEATURES', feature, True, False, d):
+ raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES (added via EXTRA_IMAGE_FEATURES) is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+ else:
+ raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+
+IMAGE_INSTALL ?= ""
+IMAGE_INSTALL[type] = "list"
+export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"
+PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
+
+IMGDEPLOYDIR = "${WORKDIR}/deploy-${PN}-image-complete"
+
+# Images are generally built explicitly, do not need to be part of world.
+EXCLUDE_FROM_WORLD = "1"
+
+USE_DEVFS ?= "1"
+USE_DEPMOD ?= "1"
+
+PID = "${@os.getpid()}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+LDCONFIGDEPEND ?= "ldconfig-native:do_populate_sysroot"
+LDCONFIGDEPEND_libc-musl = ""
+
+# This is needed to have depmod data in PKGDATA_DIR,
+# but if you're building small initramfs image
+# e.g. to include it in your kernel, you probably
+# don't want this dependency, which is causing dependency loop
+KERNELDEPMODDEPEND ?= "virtual/kernel:do_packagedata"
+
+do_rootfs[depends] += " \
+ makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND} \
+ virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot \
+ ${KERNELDEPMODDEPEND} \
+"
+do_rootfs[recrdeptask] += "do_packagedata"
+
+def rootfs_command_variables(d):
+ return ['ROOTFS_POSTPROCESS_COMMAND','ROOTFS_PREPROCESS_COMMAND','ROOTFS_POSTINSTALL_COMMAND','ROOTFS_POSTUNINSTALL_COMMAND','OPKG_PREPROCESS_COMMANDS','OPKG_POSTPROCESS_COMMANDS','IMAGE_POSTPROCESS_COMMAND',
+ 'IMAGE_PREPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS','DEB_PREPROCESS_COMMANDS','DEB_POSTPROCESS_COMMANDS']
+
+python () {
+ variables = rootfs_command_variables(d) + sdk_command_variables(d)
+ for var in variables:
+ if d.getVar(var, False):
+ d.setVarFlag(var, 'func', '1')
+}
+
+def rootfs_variables(d):
+ from oe.rootfs import variable_depends
+ variables = ['IMAGE_DEVICE_TABLE','IMAGE_DEVICE_TABLES','BUILD_IMAGES_FROM_FEEDS','IMAGE_TYPES_MASKED','IMAGE_ROOTFS_ALIGNMENT','IMAGE_OVERHEAD_FACTOR','IMAGE_ROOTFS_SIZE','IMAGE_ROOTFS_EXTRA_SPACE',
+ 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS',
+ 'MULTILIBRE_ALLOW_REP','MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS',
+ 'PACKAGE_ARCHS','PACKAGE_CLASSES','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS',
+ 'CONVERSIONTYPES', 'IMAGE_GEN_DEBUGFS', 'ROOTFS_RO_UNNEEDED', 'IMGDEPLOYDIR', 'PACKAGE_EXCLUDE_COMPLEMENTARY', 'REPRODUCIBLE_TIMESTAMP_ROOTFS']
+ variables.extend(rootfs_command_variables(d))
+ variables.extend(variable_depends(d))
+ return " ".join(variables)
+
+do_rootfs[vardeps] += "${@rootfs_variables(d)}"
+
+do_build[depends] += "virtual/kernel:do_deploy"
+
+def build_live(d):
+ if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
+ d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
+ d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
+ if d.getVar('NOISO') == "0" or d.getVar('NOHDD') == "0":
+ return "image-live"
+ return ""
+ return "image-live"
+
+IMAGE_TYPE_live = "${@build_live(d)}"
+inherit ${IMAGE_TYPE_live}
+
+IMAGE_TYPE_container = '${@bb.utils.contains("IMAGE_FSTYPES", "container", "image-container", "", d)}'
+inherit ${IMAGE_TYPE_container}
+
+IMAGE_TYPE_wic = "image_types_wic"
+inherit ${IMAGE_TYPE_wic}
+
+python () {
+ def extraimage_getdepends(task):
+ deps = ""
+ for dep in (d.getVar('EXTRA_IMAGEDEPENDS') or "").split():
+ deps += " %s:%s" % (dep, task)
+ return deps
+
+ d.appendVarFlag('do_image', 'depends', extraimage_getdepends('do_populate_lic'))
+ d.appendVarFlag('do_image_complete', 'depends', extraimage_getdepends('do_populate_sysroot'))
+
+ deps = " " + imagetypes_getdepends(d)
+ d.appendVarFlag('do_rootfs', 'depends', deps)
+
+ #process IMAGE_FEATURES, we must do this before runtime_mapping_rename
+ #Check for replaces image features
+ features = set(oe.data.typed_value('IMAGE_FEATURES', d))
+ remain_features = features.copy()
+ for feature in features:
+ replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature) or "").split())
+ remain_features -= replaces
+
+ #Check for conflict image features
+ for feature in remain_features:
+ conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature) or "").split())
+ temp = conflicts & remain_features
+ if temp:
+ bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN'), feature, ' '.join(list(temp))))
+
+ d.setVar('IMAGE_FEATURES', ' '.join(sorted(list(remain_features))))
+
+ check_image_features(d)
+}
+
+IMAGE_CLASSES += "image_types"
+inherit ${IMAGE_CLASSES}
+
+IMAGE_POSTPROCESS_COMMAND ?= ""
+
+# some default locales
+IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
+
+LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}"
+
+# Prefer image, but use the fallback files for lookups if the image ones
+# aren't yet available.
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
+
+inherit rootfs-postcommands
+
+PACKAGE_EXCLUDE ??= ""
+PACKAGE_EXCLUDE[type] = "list"
+
+fakeroot python do_rootfs () {
+ from oe.rootfs import create_rootfs
+ from oe.manifest import create_manifest
+ import logging
+
+ logger = d.getVar('BB_TASK_LOGGER', False)
+ if logger:
+ logcatcher = bb.utils.LogCatcher()
+ logger.addHandler(logcatcher)
+ else:
+ logcatcher = None
+
+ # NOTE: if you add, remove or significantly refactor the stages of this
+ # process then you should recalculate the weightings here. This is quite
+ # easy to do - just change the MultiStageProgressReporter line temporarily
+ # to pass debug=True as the last parameter and you'll get a printout of
+ # the weightings as well as a map to the lines where next_stage() was
+ # called. Of course this isn't critical, but it helps to keep the progress
+ # reporting accurate.
+ stage_weights = [1, 203, 354, 186, 65, 4228, 1, 353, 49, 330, 382, 23, 1]
+ progress_reporter = bb.progress.MultiStageProgressReporter(d, stage_weights)
+ progress_reporter.next_stage()
+
+ # Handle package exclusions
+ excl_pkgs = d.getVar("PACKAGE_EXCLUDE").split()
+ inst_pkgs = d.getVar("PACKAGE_INSTALL").split()
+ inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY").split()
+
+ d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
+ d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
+
+ for pkg in excl_pkgs:
+ if pkg in inst_pkgs:
+ bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+ inst_pkgs.remove(pkg)
+
+ if pkg in inst_attempt_pkgs:
+ bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+ inst_attempt_pkgs.remove(pkg)
+
+ d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+ d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
+
+ # Ensure we handle package name remapping
+ # We have to delay the runtime_mapping_rename until just before rootfs runs
+ # otherwise, the multilib renaming could step in and squash any fixups that
+ # may have occurred.
+ pn = d.getVar('PN')
+ runtime_mapping_rename("PACKAGE_INSTALL", pn, d)
+ runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d)
+ runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d)
+
+ # Generate the initial manifest
+ create_manifest(d)
+
+ progress_reporter.next_stage()
+
+ # generate rootfs
+ d.setVarFlag('REPRODUCIBLE_TIMESTAMP_ROOTFS', 'export', '1')
+ create_rootfs(d, progress_reporter=progress_reporter, logcatcher=logcatcher)
+
+ progress_reporter.finish()
+}
+do_rootfs[dirs] = "${TOPDIR}"
+do_rootfs[cleandirs] += "${S} ${IMGDEPLOYDIR}"
+do_rootfs[umask] = "022"
+addtask rootfs after do_prepare_recipe_sysroot
+
+fakeroot python do_image () {
+ from oe.utils import execute_pre_post_process
+
+ d.setVarFlag('REPRODUCIBLE_TIMESTAMP_ROOTFS', 'export', '1')
+ pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND")
+
+ execute_pre_post_process(d, pre_process_cmds)
+}
+do_image[dirs] = "${TOPDIR}"
+do_image[umask] = "022"
+addtask do_image after do_rootfs
+
+fakeroot python do_image_complete () {
+ from oe.utils import execute_pre_post_process
+
+ post_process_cmds = d.getVar("IMAGE_POSTPROCESS_COMMAND")
+
+ execute_pre_post_process(d, post_process_cmds)
+}
+do_image_complete[dirs] = "${TOPDIR}"
+do_image_complete[umask] = "022"
+SSTATETASKS += "do_image_complete"
+SSTATE_SKIP_CREATION_task-image-complete = '1'
+do_image_complete[sstate-inputdirs] = "${IMGDEPLOYDIR}"
+do_image_complete[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+do_image_complete[stamp-extra-info] = "${MACHINE_ARCH}"
+addtask do_image_complete after do_image before do_build
+python do_image_complete_setscene () {
+ sstate_setscene(d)
+}
+addtask do_image_complete_setscene
+
+# Add image-level QA/sanity checks to IMAGE_QA_COMMANDS
+#
+# IMAGE_QA_COMMANDS += " \
+# image_check_everything_ok \
+# "
+# This task runs all functions in IMAGE_QA_COMMANDS after the rootfs
+# construction has completed in order to validate the resulting image.
+#
+# The functions should use ${IMAGE_ROOTFS} to find the unpacked rootfs
+# directory, which if QA passes will be the basis for the images.
+fakeroot python do_image_qa () {
+ from oe.utils import ImageQAFailed
+
+ qa_cmds = (d.getVar('IMAGE_QA_COMMANDS') or '').split()
+ qamsg = ""
+
+ for cmd in qa_cmds:
+ try:
+ bb.build.exec_func(cmd, d)
+ except oe.utils.ImageQAFailed as e:
+ qamsg = qamsg + '\tImage QA function %s failed: %s\n' % (e.name, e.description)
+ except bb.build.FuncFailed as e:
+ qamsg = qamsg + '\tImage QA function %s failed' % e.name
+ if e.logfile:
+ qamsg = qamsg + ' (log file is located at %s)' % e.logfile
+ qamsg = qamsg + '\n'
+
+ if qamsg:
+ imgname = d.getVar('IMAGE_NAME')
+ bb.fatal("QA errors found whilst validating image: %s\n%s" % (imgname, qamsg))
+}
+addtask do_image_qa after do_rootfs before do_image
+
+SSTATETASKS += "do_image_qa"
+SSTATE_SKIP_CREATION_task-image-qa = '1'
+do_image_qa[sstate-inputdirs] = ""
+do_image_qa[sstate-outputdirs] = ""
+python do_image_qa_setscene () {
+ sstate_setscene(d)
+}
+addtask do_image_qa_setscene
+
+def setup_debugfs_variables(d):
+ d.appendVar('IMAGE_ROOTFS', '-dbg')
+ d.appendVar('IMAGE_LINK_NAME', '-dbg')
+ d.appendVar('IMAGE_NAME','-dbg')
+ d.setVar('IMAGE_BUILDING_DEBUGFS', 'true')
+ debugfs_image_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS')
+ if debugfs_image_fstypes:
+ d.setVar('IMAGE_FSTYPES', debugfs_image_fstypes)
+
+python setup_debugfs () {
+ setup_debugfs_variables(d)
+}
+
+python () {
+ vardeps = set()
+ # We allow CONVERSIONTYPES to have duplicates. That avoids breaking
+ # derived distros when OE-core or some other layer independently adds
+ # the same type. There is still only one command for each type, but
+ # presumably the commands will do the same when the type is the same,
+ # even when added in different places.
+ #
+ # Without de-duplication, gen_conversion_cmds() below
+ # would create the same compression command multiple times.
+ ctypes = set(d.getVar('CONVERSIONTYPES').split())
+ old_overrides = d.getVar('OVERRIDES', False)
+
+ def _image_base_type(type):
+ basetype = type
+ for ctype in ctypes:
+ if type.endswith("." + ctype):
+ basetype = type[:-len("." + ctype)]
+ break
+
+ if basetype != type:
+ # New base type itself might be generated by a conversion command.
+ basetype = _image_base_type(basetype)
+
+ return basetype
+
+ basetypes = {}
+ alltypes = d.getVar('IMAGE_FSTYPES').split()
+ typedeps = {}
+
+ if d.getVar('IMAGE_GEN_DEBUGFS') == "1":
+ debugfs_fstypes = d.getVar('IMAGE_FSTYPES_DEBUGFS').split()
+ for t in debugfs_fstypes:
+ alltypes.append("debugfs_" + t)
+
+ def _add_type(t):
+ baset = _image_base_type(t)
+ input_t = t
+ if baset not in basetypes:
+ basetypes[baset]= []
+ if t not in basetypes[baset]:
+ basetypes[baset].append(t)
+ debug = ""
+ if t.startswith("debugfs_"):
+ t = t[8:]
+ debug = "debugfs_"
+ deps = (d.getVar('IMAGE_TYPEDEP_' + t) or "").split()
+ vardeps.add('IMAGE_TYPEDEP_' + t)
+ if baset not in typedeps:
+ typedeps[baset] = set()
+ deps = [debug + dep for dep in deps]
+ for dep in deps:
+ if dep not in alltypes:
+ alltypes.append(dep)
+ _add_type(dep)
+ basedep = _image_base_type(dep)
+ typedeps[baset].add(basedep)
+
+ if baset != input_t:
+ _add_type(baset)
+
+ for t in alltypes[:]:
+ _add_type(t)
+
+ d.appendVarFlag('do_image', 'vardeps', ' '.join(vardeps))
+
+ maskedtypes = (d.getVar('IMAGE_TYPES_MASKED') or "").split()
+ maskedtypes = [dbg + t for t in maskedtypes for dbg in ("", "debugfs_")]
+
+ for t in basetypes:
+ vardeps = set()
+ cmds = []
+ subimages = []
+ realt = t
+
+ if t in maskedtypes:
+ continue
+
+ localdata = bb.data.createCopy(d)
+ debug = ""
+ if t.startswith("debugfs_"):
+ setup_debugfs_variables(localdata)
+ debug = "setup_debugfs "
+ realt = t[8:]
+ localdata.setVar('OVERRIDES', '%s:%s' % (realt, old_overrides))
+ localdata.setVar('type', realt)
+ # Delete DATETIME so we don't expand any references to it now
+ # This means the task's hash can be stable rather than having hardcoded
+ # date/time values. It will get expanded at execution time.
+ # Similarly TMPDIR since otherwise we see QA stamp comparision problems
+ # Expand PV else it can trigger get_srcrev which can fail due to these variables being unset
+ localdata.setVar('PV', d.getVar('PV'))
+ localdata.delVar('DATETIME')
+ localdata.delVar('DATE')
+ localdata.delVar('TMPDIR')
+ vardepsexclude = (d.getVarFlag('IMAGE_CMD_' + realt, 'vardepsexclude', True) or '').split()
+ for dep in vardepsexclude:
+ localdata.delVar(dep)
+
+ image_cmd = localdata.getVar("IMAGE_CMD")
+ vardeps.add('IMAGE_CMD_' + realt)
+ if image_cmd:
+ cmds.append("\t" + image_cmd)
+ else:
+ bb.fatal("No IMAGE_CMD defined for IMAGE_FSTYPES entry '%s' - possibly invalid type name or missing support class" % t)
+ cmds.append(localdata.expand("\tcd ${IMGDEPLOYDIR}"))
+
+ # Since a copy of IMAGE_CMD_xxx will be inlined within do_image_xxx,
+ # prevent a redundant copy of IMAGE_CMD_xxx being emitted as a function.
+ d.delVarFlag('IMAGE_CMD_' + realt, 'func')
+
+ rm_tmp_images = set()
+ def gen_conversion_cmds(bt):
+ for ctype in sorted(ctypes):
+ if bt.endswith("." + ctype):
+ type = bt[0:-len(ctype) - 1]
+ if type.startswith("debugfs_"):
+ type = type[8:]
+ # Create input image first.
+ gen_conversion_cmds(type)
+ localdata.setVar('type', type)
+ cmd = "\t" + (localdata.getVar("CONVERSION_CMD_" + ctype) or localdata.getVar("COMPRESS_CMD_" + ctype))
+ if cmd not in cmds:
+ cmds.append(cmd)
+ vardeps.add('CONVERSION_CMD_' + ctype)
+ vardeps.add('COMPRESS_CMD_' + ctype)
+ subimage = type + "." + ctype
+ if subimage not in subimages:
+ subimages.append(subimage)
+ if type not in alltypes:
+ rm_tmp_images.add(localdata.expand("${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"))
+
+ for bt in basetypes[t]:
+ gen_conversion_cmds(bt)
+
+ localdata.setVar('type', realt)
+ if t not in alltypes:
+ rm_tmp_images.add(localdata.expand("${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"))
+ else:
+ subimages.append(realt)
+
+ # Clean up after applying all conversion commands. Some of them might
+ # use the same input, therefore we cannot delete sooner without applying
+ # some complex dependency analysis.
+ for image in sorted(rm_tmp_images):
+ cmds.append("\trm " + image)
+
+ after = 'do_image'
+ for dep in typedeps[t]:
+ after += ' do_image_%s' % dep.replace("-", "_").replace(".", "_")
+
+ task = "do_image_%s" % t.replace("-", "_").replace(".", "_")
+
+ d.setVar(task, '\n'.join(cmds))
+ d.setVarFlag(task, 'func', '1')
+ d.setVarFlag(task, 'fakeroot', '1')
+
+ d.appendVarFlag(task, 'prefuncs', ' ' + debug + ' set_image_size')
+ d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
+ d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
+ d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
+ d.appendVarFlag(task, 'vardepsexclude', 'DATETIME DATE ' + ' '.join(vardepsexclude))
+
+ bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
+ bb.build.addtask(task, 'do_image_complete', after, d)
+}
+
+#
+# Compute the rootfs size
+#
+def get_rootfs_size(d):
+ import subprocess
+
+ rootfs_alignment = int(d.getVar('IMAGE_ROOTFS_ALIGNMENT'))
+ overhead_factor = float(d.getVar('IMAGE_OVERHEAD_FACTOR'))
+ rootfs_req_size = int(d.getVar('IMAGE_ROOTFS_SIZE'))
+ rootfs_extra_space = eval(d.getVar('IMAGE_ROOTFS_EXTRA_SPACE'))
+ rootfs_maxsize = d.getVar('IMAGE_ROOTFS_MAXSIZE')
+ image_fstypes = d.getVar('IMAGE_FSTYPES') or ''
+ initramfs_fstypes = d.getVar('INITRAMFS_FSTYPES') or ''
+ initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE')
+
+ output = subprocess.check_output(['du', '-ks',
+ d.getVar('IMAGE_ROOTFS')])
+ size_kb = int(output.split()[0])
+
+ base_size = size_kb * overhead_factor
+ bb.debug(1, '%f = %d * %f' % (base_size, size_kb, overhead_factor))
+ base_size2 = max(base_size, rootfs_req_size) + rootfs_extra_space
+ bb.debug(1, '%f = max(%f, %d)[%f] + %d' % (base_size2, base_size, rootfs_req_size, max(base_size, rootfs_req_size), overhead_factor))
+
+ base_size = base_size2
+ if base_size != int(base_size):
+ base_size = int(base_size + 1)
+ else:
+ base_size = int(base_size)
+ bb.debug(1, '%f = int(%f)' % (base_size, base_size2))
+
+ base_size_saved = base_size
+ base_size += rootfs_alignment - 1
+ base_size -= base_size % rootfs_alignment
+ bb.debug(1, '%d = aligned(%d)' % (base_size, base_size_saved))
+
+ # Do not check image size of the debugfs image. This is not supposed
+ # to be deployed, etc. so it doesn't make sense to limit the size
+ # of the debug.
+ if (d.getVar('IMAGE_BUILDING_DEBUGFS') or "") == "true":
+ bb.debug(1, 'returning debugfs size %d' % (base_size))
+ return base_size
+
+ # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
+ if rootfs_maxsize:
+ rootfs_maxsize_int = int(rootfs_maxsize)
+ if base_size > rootfs_maxsize_int:
+ bb.fatal("The rootfs size %d(K) overrides IMAGE_ROOTFS_MAXSIZE: %d(K)" % \
+ (base_size, rootfs_maxsize_int))
+
+ # Check the initramfs size against INITRAMFS_MAXSIZE (if set)
+ if image_fstypes == initramfs_fstypes != '' and initramfs_maxsize:
+ initramfs_maxsize_int = int(initramfs_maxsize)
+ if base_size > initramfs_maxsize_int:
+ bb.error("The initramfs size %d(K) overrides INITRAMFS_MAXSIZE: %d(K)" % \
+ (base_size, initramfs_maxsize_int))
+ bb.error("You can set INITRAMFS_MAXSIZE a larger value. Usually, it should")
+ bb.fatal("be less than 1/2 of ram size, or you may fail to boot it.\n")
+
+ bb.debug(1, 'returning %d' % (base_size))
+ return base_size
+
+python set_image_size () {
+ rootfs_size = get_rootfs_size(d)
+ d.setVar('ROOTFS_SIZE', str(rootfs_size))
+ d.setVarFlag('ROOTFS_SIZE', 'export', '1')
+}
+
+#
+# Create symlinks to the newly created image
+#
+python create_symlinks() {
+
+ deploy_dir = d.getVar('IMGDEPLOYDIR')
+ img_name = d.getVar('IMAGE_NAME')
+ link_name = d.getVar('IMAGE_LINK_NAME')
+ manifest_name = d.getVar('IMAGE_MANIFEST')
+ taskname = d.getVar("BB_CURRENTTASK")
+ subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
+ imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix') or d.expand("${IMAGE_NAME_SUFFIX}.")
+
+ if not link_name:
+ return
+ for type in subimages:
+ dst = os.path.join(deploy_dir, link_name + "." + type)
+ src = img_name + imgsuffix + type
+ if os.path.exists(os.path.join(deploy_dir, src)):
+ bb.note("Creating symlink: %s -> %s" % (dst, src))
+ if os.path.islink(dst):
+ os.remove(dst)
+ os.symlink(src, dst)
+ else:
+ bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src))
+}
+
+MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|"
+MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py"
+MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+deltask do_populate_sysroot
+do_package[noexec] = "1"
+deltask do_package_qa
+do_packagedata[noexec] = "1"
+deltask do_package_write_ipk
+deltask do_package_write_deb
+deltask do_package_write_rpm
+
+# Prepare the root links to point to the /usr counterparts.
+create_merged_usr_symlinks() {
+ root="$1"
+ install -d $root${base_bindir} $root${base_sbindir} $root${base_libdir}
+ lnr $root${base_bindir} $root/bin
+ lnr $root${base_sbindir} $root/sbin
+ lnr $root${base_libdir} $root/${baselib}
+
+ if [ "${nonarch_base_libdir}" != "${base_libdir}" ]; then
+ install -d $root${nonarch_base_libdir}
+ lnr $root${nonarch_base_libdir} $root/lib
+ fi
+
+ # create base links for multilibs
+ multi_libdirs="${@d.getVar('MULTILIB_VARIANTS')}"
+ for d in $multi_libdirs; do
+ install -d $root${exec_prefix}/$d
+ lnr $root${exec_prefix}/$d $root/$d
+ done
+}
+
+create_merged_usr_symlinks_rootfs() {
+ create_merged_usr_symlinks ${IMAGE_ROOTFS}
+}
+
+create_merged_usr_symlinks_sdk() {
+ create_merged_usr_symlinks ${SDK_OUTPUT}${SDKTARGETSYSROOT}
+}
+
+ROOTFS_PREPROCESS_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_rootfs; ', '',d)}"
+POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'create_merged_usr_symlinks_sdk; ', '',d)}"
+
+reproducible_final_image_task () {
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
+ REPRODUCIBLE_TIMESTAMP_ROOTFS=`git log -1 --pretty=%ct`
+ fi
+ # Set mtime of all files to a reproducible value
+ bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"
+ find ${IMAGE_ROOTFS} -exec touch -h --date=@$REPRODUCIBLE_TIMESTAMP_ROOTFS {} \;
+ fi
+}
+IMAGE_PREPROCESS_COMMAND_append = " reproducible_final_image_task; "
+
+CVE_PRODUCT = ""
diff --git a/poky/meta/classes/image_types.bbclass b/poky/meta/classes/image_types.bbclass
new file mode 100644
index 000000000..00a00d318
--- /dev/null
+++ b/poky/meta/classes/image_types.bbclass
@@ -0,0 +1,326 @@
+# IMAGE_NAME is the base name for everything produced when building images.
+# The actual image that contains the rootfs has an additional suffix (.rootfs
+# by default) followed by additional suffices which describe the format (.ext4,
+# .ext4.xz, etc.).
+IMAGE_NAME_SUFFIX ??= ".rootfs"
+
+# The default aligment of the size of the rootfs is set to 1KiB. In case
+# you're using the SD card emulation of a QEMU system simulator you may
+# set this value to 2048 (2MiB alignment).
+IMAGE_ROOTFS_ALIGNMENT ?= "1"
+
+def imagetypes_getdepends(d):
+ def adddep(depstr, deps):
+ for d in (depstr or "").split():
+ # Add task dependency if not already present
+ if ":" not in d:
+ d += ":do_populate_sysroot"
+ deps.add(d)
+
+ # Take a type in the form of foo.bar.car and split it into the items
+ # needed for the image deps "foo", and the conversion deps ["bar", "car"]
+ def split_types(typestring):
+ types = typestring.split(".")
+ return types[0], types[1:]
+
+ fstypes = set((d.getVar('IMAGE_FSTYPES') or "").split())
+ fstypes |= set((d.getVar('IMAGE_FSTYPES_DEBUGFS') or "").split())
+
+ deprecated = set()
+ deps = set()
+ for typestring in fstypes:
+ basetype, resttypes = split_types(typestring)
+
+ var = "IMAGE_DEPENDS_%s" % basetype
+ if d.getVar(var) is not None:
+ deprecated.add(var)
+
+ for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype) or "").split():
+ base, rest = split_types(typedepends)
+ resttypes += rest
+
+ var = "IMAGE_DEPENDS_%s" % base
+ if d.getVar(var) is not None:
+ deprecated.add(var)
+
+ for ctype in resttypes:
+ adddep(d.getVar("CONVERSION_DEPENDS_%s" % ctype), deps)
+ adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype), deps)
+
+ if deprecated:
+ bb.fatal('Deprecated variable(s) found: "%s". '
+ 'Use do_image_<type>[depends] += "<recipe>:<task>" instead' % ', '.join(deprecated))
+
+ # Sort the set so that ordering is consistant
+ return " ".join(sorted(deps))
+
+XZ_COMPRESSION_LEVEL ?= "-3"
+XZ_INTEGRITY_CHECK ?= "crc32"
+XZ_THREADS ?= "-T 0"
+
+ZIP_COMPRESSION_LEVEL ?= "-9"
+
+JFFS2_SUM_EXTRA_ARGS ?= ""
+IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.jffs2 ${EXTRA_IMAGECMD}"
+
+IMAGE_CMD_cramfs = "mkfs.cramfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cramfs ${EXTRA_IMAGECMD}"
+
+oe_mkext234fs () {
+ fstype=$1
+ extra_imagecmd=""
+
+ if [ $# -gt 1 ]; then
+ shift
+ extra_imagecmd=$@
+ fi
+
+ # If generating an empty image the size of the sparse block should be large
+ # enough to allocate an ext4 filesystem using 4096 bytes per inode, this is
+ # about 60K, so dd needs a minimum count of 60, with bs=1024 (bytes per IO)
+ eval local COUNT=\"0\"
+ eval local MIN_COUNT=\"60\"
+ if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then
+ eval COUNT=\"$MIN_COUNT\"
+ fi
+ # Create a sparse image block
+ bbdebug 1 Executing "dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024"
+ dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
+ bbdebug 1 "Actual Rootfs size: `du -s ${IMAGE_ROOTFS}`"
+ bbdebug 1 "Actual Partion size: `stat -c '%s' ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype`"
+ bbdebug 1 Executing "mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}"
+ mkfs.$fstype -F $extra_imagecmd ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype -d ${IMAGE_ROOTFS}
+ # Error codes 0-3 indicate successfull operation of fsck (no errors or errors corrected)
+ fsck.$fstype -pvfD ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.$fstype || [ $? -le 3 ]
+}
+
+IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+
+MIN_BTRFS_SIZE ?= "16384"
+IMAGE_CMD_btrfs () {
+ size=${ROOTFS_SIZE}
+ if [ ${size} -lt ${MIN_BTRFS_SIZE} ] ; then
+ size=${MIN_BTRFS_SIZE}
+ bbwarn "Rootfs size is too small for BTRFS. Filesystem will be extended to ${size}K"
+ fi
+ dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs seek=${size} count=0 bs=1024
+ mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.btrfs
+}
+
+IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs ${EXTRA_IMAGECMD} -noappend"
+IMAGE_CMD_squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-xz ${EXTRA_IMAGECMD} -noappend -comp xz"
+IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lzo ${EXTRA_IMAGECMD} -noappend -comp lzo"
+IMAGE_CMD_squashfs-lz4 = "mksquashfs ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.squashfs-lz4 ${EXTRA_IMAGECMD} -noappend -comp lz4"
+
+# By default, tar from the host is used, which can be quite old. If
+# you need special parameters (like --xattrs) which are only supported
+# by GNU tar upstream >= 1.27, then override that default:
+# IMAGE_CMD_TAR = "tar --xattrs --xattrs-include=*"
+# do_image_tar[depends] += "tar-replacement-native:do_populate_sysroot"
+# EXTRANATIVEPATH += "tar-native"
+#
+# The GNU documentation does not specify whether --xattrs-include is necessary.
+# In practice, it turned out to be not needed when creating archives and
+# required when extracting, but it seems prudent to use it in both cases.
+IMAGE_CMD_TAR ?= "tar"
+# ignore return code 1 "file changed as we read it" as other tasks(e.g. do_image_wic) may be hardlinking rootfs
+IMAGE_CMD_tar = "${IMAGE_CMD_TAR} --numeric-owner -cf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.tar -C ${IMAGE_ROOTFS} . || [ $? -eq 1 ]"
+
+do_image_cpio[cleandirs] += "${WORKDIR}/cpio_append"
+IMAGE_CMD_cpio () {
+ (cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+ # We only need the /init symlink if we're building the real
+ # image. The -dbg image doesn't need it! By being clever
+ # about this we also avoid 'touch' below failing, as it
+ # might be trying to touch /sbin/init on the host since both
+ # the normal and the -dbg image share the same WORKDIR
+ if [ "${IMAGE_BUILDING_DEBUGFS}" != "true" ]; then
+ if [ ! -L ${IMAGE_ROOTFS}/init ] && [ ! -e ${IMAGE_ROOTFS}/init ]; then
+ if [ -L ${IMAGE_ROOTFS}/sbin/init ] || [ -e ${IMAGE_ROOTFS}/sbin/init ]; then
+ ln -sf /sbin/init ${WORKDIR}/cpio_append/init
+ else
+ touch ${WORKDIR}/cpio_append/init
+ fi
+ (cd ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.cpio)
+ fi
+ fi
+}
+
+UBI_VOLNAME ?= "${MACHINE}-rootfs"
+
+multiubi_mkfs() {
+ local mkubifs_args="$1"
+ local ubinize_args="$2"
+
+ # Added prompt error message for ubi and ubifs image creation.
+ if [ -z "$mkubifs_args"] || [ -z "$ubinize_args" ]; then
+ bbfatal "MKUBIFS_ARGS and UBINIZE_ARGS have to be set, see http://www.linux-mtd.infradead.org/faq/ubifs.html for details"
+ fi
+
+ if [ -z "$3" ]; then
+ local vname=""
+ else
+ local vname="_$3"
+ fi
+
+ echo \[ubifs\] > ubinize${vname}-${IMAGE_NAME}.cfg
+ echo mode=ubi >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo image=${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo vol_id=0 >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo vol_type=dynamic >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo vol_name=${UBI_VOLNAME} >> ubinize${vname}-${IMAGE_NAME}.cfg
+ echo vol_flags=autoresize >> ubinize${vname}-${IMAGE_NAME}.cfg
+ mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ${mkubifs_args}
+ ubinize -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubi ${ubinize_args} ubinize${vname}-${IMAGE_NAME}.cfg
+
+ # Cleanup cfg file
+ mv ubinize${vname}-${IMAGE_NAME}.cfg ${IMGDEPLOYDIR}/
+
+ # Create own symlinks for 'named' volumes
+ if [ -n "$vname" ]; then
+ cd ${IMGDEPLOYDIR}
+ if [ -e ${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs ]; then
+ ln -sf ${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubifs \
+ ${IMAGE_LINK_NAME}${vname}.ubifs
+ fi
+ if [ -e ${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubi ]; then
+ ln -sf ${IMAGE_NAME}${vname}${IMAGE_NAME_SUFFIX}.ubi \
+ ${IMAGE_LINK_NAME}${vname}.ubi
+ fi
+ cd -
+ fi
+}
+
+IMAGE_CMD_multiubi () {
+ # Split MKUBIFS_ARGS_<name> and UBINIZE_ARGS_<name>
+ for name in ${MULTIUBI_BUILD}; do
+ eval local mkubifs_args=\"\$MKUBIFS_ARGS_${name}\"
+ eval local ubinize_args=\"\$UBINIZE_ARGS_${name}\"
+
+ multiubi_mkfs "${mkubifs_args}" "${ubinize_args}" "${name}"
+ done
+}
+
+IMAGE_CMD_ubi () {
+ multiubi_mkfs "${MKUBIFS_ARGS}" "${UBINIZE_ARGS}"
+}
+
+IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.ubifs ${MKUBIFS_ARGS}"
+
+MIN_F2FS_SIZE ?= "524288"
+IMAGE_CMD_f2fs () {
+ # We need to add additional smarts here form devices smaller than 1.5G
+ # Need to scale appropriately between 40M -> 1.5G as the "overprovision
+ # ratio" goes down as the device gets bigger (70% -> 4.5%), below about
+ # 500M the standard IMAGE_OVERHEAD_FACTOR does not work, so add additional
+ # space here when under 500M
+ size=${ROOTFS_SIZE}
+ if [ ${size} -lt ${MIN_F2FS_SIZE} ] ; then
+ size=${MIN_F2FS_SIZE}
+ bbwarn "Rootfs size is too small for F2FS. Filesystem will be extended to ${size}K"
+ fi
+ dd if=/dev/zero of=${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs seek=${size} count=0 bs=1024
+ mkfs.f2fs ${EXTRA_IMAGECMD} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
+ sload.f2fs -f ${IMAGE_ROOTFS} ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.f2fs
+}
+
+EXTRA_IMAGECMD = ""
+
+inherit siteinfo kernel-arch
+JFFS2_ENDIANNESS ?= "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
+JFFS2_ERASEBLOCK ?= "0x40000"
+EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
+
+# Change these if you want default mkfs behavior (i.e. create minimal inode number)
+EXTRA_IMAGECMD_ext2 ?= "-i 4096"
+EXTRA_IMAGECMD_ext3 ?= "-i 4096"
+EXTRA_IMAGECMD_ext4 ?= "-i 4096"
+EXTRA_IMAGECMD_btrfs ?= "-n 4096"
+EXTRA_IMAGECMD_f2fs ?= ""
+
+do_image_jffs2[depends] += "mtd-utils-native:do_populate_sysroot"
+do_image_cramfs[depends] += "util-linux-native:do_populate_sysroot"
+do_image_ext2[depends] += "e2fsprogs-native:do_populate_sysroot"
+do_image_ext3[depends] += "e2fsprogs-native:do_populate_sysroot"
+do_image_ext4[depends] += "e2fsprogs-native:do_populate_sysroot"
+do_image_btrfs[depends] += "btrfs-tools-native:do_populate_sysroot"
+do_image_squashfs[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_xz[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_lzo[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_squashfs_lz4[depends] += "squashfs-tools-native:do_populate_sysroot"
+do_image_ubi[depends] += "mtd-utils-native:do_populate_sysroot"
+do_image_ubifs[depends] += "mtd-utils-native:do_populate_sysroot"
+do_image_multiubi[depends] += "mtd-utils-native:do_populate_sysroot"
+do_image_f2fs[depends] += "f2fs-tools-native:do_populate_sysroot"
+
+# This variable is available to request which values are suitable for IMAGE_FSTYPES
+IMAGE_TYPES = " \
+ jffs2 jffs2.sum \
+ cramfs \
+ ext2 ext2.gz ext2.bz2 ext2.lzma \
+ ext3 ext3.gz \
+ ext4 ext4.gz \
+ btrfs \
+ iso \
+ hddimg \
+ squashfs squashfs-xz squashfs-lzo squashfs-lz4 \
+ ubi ubifs multiubi \
+ tar tar.gz tar.bz2 tar.xz tar.lz4 \
+ cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+ wic wic.gz wic.bz2 wic.lzma \
+ container \
+ f2fs \
+"
+
+# Compression is a special case of conversion. The old variable
+# names are still supported for backward-compatibility. When defining
+# new compression or conversion commands, use CONVERSIONTYPES and
+# CONVERSION_CMD/DEPENDS.
+COMPRESSIONTYPES ?= ""
+
+CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vdi qcow2 ${COMPRESSIONTYPES}"
+CONVERSION_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+CONVERSION_CMD_gz = "pigz -f -9 -n -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz"
+CONVERSION_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+CONVERSION_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.xz"
+CONVERSION_CMD_lz4 = "lz4 -9 -z -l ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.lz4"
+CONVERSION_CMD_lzo = "lzop -9 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+CONVERSION_CMD_zip = "zip ${ZIP_COMPRESSION_LEVEL} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.zip ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}"
+CONVERSION_CMD_sum = "sumtool -i ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
+CONVERSION_CMD_md5sum = "md5sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.md5sum"
+CONVERSION_CMD_sha1sum = "sha1sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha1sum"
+CONVERSION_CMD_sha224sum = "sha224sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha224sum"
+CONVERSION_CMD_sha256sum = "sha256sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha256sum"
+CONVERSION_CMD_sha384sum = "sha384sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha384sum"
+CONVERSION_CMD_sha512sum = "sha512sum ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sha512sum"
+CONVERSION_CMD_bmap = "bmaptool create ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} -o ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.bmap"
+CONVERSION_CMD_u-boot = "mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C none -n ${IMAGE_NAME} -d ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.u-boot"
+CONVERSION_CMD_vmdk = "qemu-img convert -O vmdk ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vmdk"
+CONVERSION_CMD_vdi = "qemu-img convert -O vdi ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.vdi"
+CONVERSION_CMD_qcow2 = "qemu-img convert -O qcow2 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.qcow2"
+CONVERSION_DEPENDS_lzma = "xz-native"
+CONVERSION_DEPENDS_gz = "pigz-native"
+CONVERSION_DEPENDS_bz2 = "pbzip2-native"
+CONVERSION_DEPENDS_xz = "xz-native"
+CONVERSION_DEPENDS_lz4 = "lz4-native"
+CONVERSION_DEPENDS_lzo = "lzop-native"
+CONVERSION_DEPENDS_zip = "zip-native"
+CONVERSION_DEPENDS_sum = "mtd-utils-native"
+CONVERSION_DEPENDS_bmap = "bmap-tools-native"
+CONVERSION_DEPENDS_u-boot = "u-boot-mkimage-native"
+CONVERSION_DEPENDS_vmdk = "qemu-native"
+CONVERSION_DEPENDS_vdi = "qemu-native"
+CONVERSION_DEPENDS_qcow2 = "qemu-native"
+
+RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
+RUNNABLE_MACHINE_PATTERNS ?= "qemu"
+
+DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso"
+
+# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
+# images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hdddirect, hddimg, iso, etc.
+IMAGE_TYPES_MASKED ?= ""
+
+# bmap requires python3 to be in the PATH
+EXTRANATIVEPATH += "${@'python3-native' if d.getVar('IMAGE_FSTYPES').find('.bmap') else ''}"
diff --git a/poky/meta/classes/image_types_wic.bbclass b/poky/meta/classes/image_types_wic.bbclass
new file mode 100644
index 000000000..5b40a9e91
--- /dev/null
+++ b/poky/meta/classes/image_types_wic.bbclass
@@ -0,0 +1,129 @@
+# The WICVARS variable is used to define list of bitbake variables used in wic code
+# variables from this list is written to <image>.env file
+WICVARS ?= "\
+ BBLAYERS IMGDEPLOYDIR DEPLOY_DIR_IMAGE FAKEROOTCMD IMAGE_BASENAME IMAGE_BOOT_FILES \
+ IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD INITRD_LIVE ISODIR RECIPE_SYSROOT_NATIVE \
+ ROOTFS_SIZE STAGING_DATADIR STAGING_DIR STAGING_LIBDIR TARGET_SYS"
+
+WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
+WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
+WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
+WKS_FULL_PATH = "${@wks_search(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) or ''}"
+
+def wks_search(files, search_path):
+ for f in files:
+ if os.path.isabs(f):
+ if os.path.exists(f):
+ return f
+ else:
+ searched = bb.utils.which(search_path, f)
+ if searched:
+ return searched
+
+WIC_CREATE_EXTRA_ARGS ?= ""
+
+IMAGE_CMD_wic () {
+ out="${IMGDEPLOYDIR}/${IMAGE_NAME}"
+ wks="${WKS_FULL_PATH}"
+ if [ -z "$wks" ]; then
+ bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
+ fi
+
+ BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR}/${MACHINE}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/" ${WIC_CREATE_EXTRA_ARGS}
+ mv "$out/$(basename "${wks%.wks}")"*.direct "$out${IMAGE_NAME_SUFFIX}.wic"
+ rm -rf "$out/"
+}
+IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES TOPDIR"
+
+# Rebuild when the wks file or vars in WICVARS change
+USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
+WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
+do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
+do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
+
+# We ensure all artfacts are deployed (e.g virtual/bootloader)
+do_image_wic[recrdeptask] += "do_deploy"
+
+WKS_FILE_DEPENDS_DEFAULT = "syslinux-native bmap-tools-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native"
+WKS_FILE_DEPENDS_BOOTLOADERS = ""
+WKS_FILE_DEPENDS_BOOTLOADERS_x86 = "syslinux grub-efi systemd-boot"
+WKS_FILE_DEPENDS_BOOTLOADERS_x86-64 = "syslinux grub-efi systemd-boot"
+WKS_FILE_DEPENDS_BOOTLOADERS_x86-x32 = "syslinux grub-efi"
+
+WKS_FILE_DEPENDS ??= "${WKS_FILE_DEPENDS_DEFAULT} ${WKS_FILE_DEPENDS_BOOTLOADERS}"
+
+DEPENDS += "${@ '${WKS_FILE_DEPENDS}' if d.getVar('USING_WIC') else '' }"
+
+python do_write_wks_template () {
+ """Write out expanded template contents to WKS_FULL_PATH."""
+ import re
+
+ template_body = d.getVar('_WKS_TEMPLATE')
+
+ # Remove any remnant variable references left behind by the expansion
+ # due to undefined variables
+ expand_var_regexp = re.compile(r"\${[^{}@\n\t :]+}")
+ while True:
+ new_body = re.sub(expand_var_regexp, '', template_body)
+ if new_body == template_body:
+ break
+ else:
+ template_body = new_body
+
+ wks_file = d.getVar('WKS_FULL_PATH')
+ with open(wks_file, 'w') as f:
+ f.write(template_body)
+}
+
+python () {
+ if d.getVar('USING_WIC'):
+ wks_file_u = d.getVar('WKS_FULL_PATH', False)
+ wks_file = d.expand(wks_file_u)
+ base, ext = os.path.splitext(wks_file)
+ if ext == '.in' and os.path.exists(wks_file):
+ wks_out_file = os.path.join(d.getVar('WORKDIR'), os.path.basename(base))
+ d.setVar('WKS_FULL_PATH', wks_out_file)
+ d.setVar('WKS_TEMPLATE_PATH', wks_file_u)
+ d.setVar('WKS_FILE_CHECKSUM', '${WKS_TEMPLATE_PATH}:True')
+
+ # We need to re-parse each time the file changes, and bitbake
+ # needs to be told about that explicitly.
+ bb.parse.mark_dependency(d, wks_file)
+
+ try:
+ with open(wks_file, 'r') as f:
+ body = f.read()
+ except (IOError, OSError) as exc:
+ pass
+ else:
+ # Previously, I used expandWithRefs to get the dependency list
+ # and add it to WICVARS, but there's no point re-parsing the
+ # file in process_wks_template as well, so just put it in
+ # a variable and let the metadata deal with the deps.
+ d.setVar('_WKS_TEMPLATE', body)
+ bb.build.addtask('do_write_wks_template', 'do_image_wic', None, d)
+ bb.build.addtask('do_image_wic', 'do_image_complete', None, d)
+}
+
+#
+# Write environment variables used by wic
+# to tmp/sysroots/<machine>/imgdata/<image>.env
+#
+python do_rootfs_wicenv () {
+ wicvars = d.getVar('WICVARS')
+ if not wicvars:
+ return
+
+ stdir = d.getVar('STAGING_DIR')
+ outdir = os.path.join(stdir, d.getVar('MACHINE'), 'imgdata')
+ bb.utils.mkdirhier(outdir)
+ basename = d.getVar('IMAGE_BASENAME')
+ with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
+ for var in wicvars.split():
+ value = d.getVar(var)
+ if value:
+ envf.write('%s="%s"\n' % (var, value.strip()))
+}
+addtask do_rootfs_wicenv after do_image before do_image_wic
+do_rootfs_wicenv[vardeps] += "${WICVARS}"
+do_rootfs_wicenv[prefuncs] = 'set_image_size'
diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass
new file mode 100644
index 000000000..fa1546084
--- /dev/null
+++ b/poky/meta/classes/insane.bbclass
@@ -0,0 +1,1317 @@
+# BB Class inspired by ebuild.sh
+#
+# This class will test files after installation for certain
+# security issues and other kind of issues.
+#
+# Checks we do:
+# -Check the ownership and permissions
+# -Check the RUNTIME path for the $TMPDIR
+# -Check if .la files wrongly point to workdir
+# -Check if .pc files wrongly point to workdir
+# -Check if packages contains .debug directories or .so files
+# where they should be in -dev or -dbg
+# -Check if config.log contains traces to broken autoconf tests
+# -Check invalid characters (non-utf8) on some package metadata
+# -Ensure that binaries in base_[bindir|sbindir|libdir] do not link
+# into exec_prefix
+# -Check that scripts in base_[bindir|sbindir|libdir] do not reference
+# files under exec_prefix
+# -Check if the package name is upper case
+
+QA_SANE = "True"
+
+# Elect whether a given type of error is a warning or error, they may
+# have been set by other files.
+WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
+ textrel already-stripped incompatible-license files-invalid \
+ installed-vs-shipped compile-host-path install-host-path \
+ pn-overrides infodir build-deps \
+ unknown-configure-option symlink-to-sysroot multilib \
+ invalid-packageconfig host-user-contaminated uppercase-pn \
+ "
+ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
+ perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
+ split-strip packages-list pkgv-undefined var-undefined \
+ version-going-backwards expanded-d invalid-chars \
+ license-checksum dev-elf file-rdeps \
+ "
+# Add usrmerge QA check based on distro feature
+ERROR_QA_append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
+
+FAKEROOT_QA = "host-user-contaminated"
+FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
+enabled tests are listed here, the do_package_qa task will run under fakeroot."
+
+ALL_QA = "${WARN_QA} ${ERROR_QA}"
+
+UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static"
+
+#
+# dictionary for elf headers
+#
+# feel free to add and correct.
+#
+# TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
+def package_qa_get_machine_dict(d):
+ machdata = {
+ "darwin9" : {
+ "arm" : (40, 0, 0, True, 32),
+ },
+ "eabi" : {
+ "arm" : (40, 0, 0, True, 32),
+ },
+ "elf" : {
+ "aarch64" : (183, 0, 0, True, 64),
+ "aarch64_be" :(183, 0, 0, False, 64),
+ "i586" : (3, 0, 0, True, 32),
+ "x86_64": (62, 0, 0, True, 64),
+ "epiphany": (4643, 0, 0, True, 32),
+ "mips": ( 8, 0, 0, False, 32),
+ "mipsel": ( 8, 0, 0, True, 32),
+ "microblaze": (189, 0, 0, False, 32),
+ "microblazeeb":(189, 0, 0, False, 32),
+ "microblazeel":(189, 0, 0, True, 32),
+ "riscv32": (243, 0, 0, True, 32),
+ "riscv64": (243, 0, 0, True, 64),
+ },
+ "linux" : {
+ "aarch64" : (183, 0, 0, True, 64),
+ "aarch64_be" :(183, 0, 0, False, 64),
+ "arm" : (40, 97, 0, True, 32),
+ "armeb": (40, 97, 0, False, 32),
+ "powerpc": (20, 0, 0, False, 32),
+ "powerpc64": (21, 0, 0, False, 64),
+ "i386": ( 3, 0, 0, True, 32),
+ "i486": ( 3, 0, 0, True, 32),
+ "i586": ( 3, 0, 0, True, 32),
+ "i686": ( 3, 0, 0, True, 32),
+ "x86_64": (62, 0, 0, True, 64),
+ "ia64": (50, 0, 0, True, 64),
+ "alpha": (36902, 0, 0, True, 64),
+ "hppa": (15, 3, 0, False, 32),
+ "m68k": ( 4, 0, 0, False, 32),
+ "mips": ( 8, 0, 0, False, 32),
+ "mipsel": ( 8, 0, 0, True, 32),
+ "mips64": ( 8, 0, 0, False, 64),
+ "mips64el": ( 8, 0, 0, True, 64),
+ "mipsisa32r6": ( 8, 0, 0, False, 32),
+ "mipsisa32r6el": ( 8, 0, 0, True, 32),
+ "mipsisa64r6": ( 8, 0, 0, False, 64),
+ "mipsisa64r6el": ( 8, 0, 0, True, 64),
+ "nios2": (113, 0, 0, True, 32),
+ "riscv32": (243, 0, 0, True, 32),
+ "riscv64": (243, 0, 0, True, 64),
+ "s390": (22, 0, 0, False, 32),
+ "sh4": (42, 0, 0, True, 32),
+ "sparc": ( 2, 0, 0, False, 32),
+ "microblaze": (189, 0, 0, False, 32),
+ "microblazeeb":(189, 0, 0, False, 32),
+ "microblazeel":(189, 0, 0, True, 32),
+ },
+ "linux-musl" : {
+ "aarch64" : (183, 0, 0, True, 64),
+ "aarch64_be" :(183, 0, 0, False, 64),
+ "arm" : ( 40, 97, 0, True, 32),
+ "armeb": ( 40, 97, 0, False, 32),
+ "powerpc": ( 20, 0, 0, False, 32),
+ "i386": ( 3, 0, 0, True, 32),
+ "i486": ( 3, 0, 0, True, 32),
+ "i586": ( 3, 0, 0, True, 32),
+ "i686": ( 3, 0, 0, True, 32),
+ "x86_64": ( 62, 0, 0, True, 64),
+ "mips": ( 8, 0, 0, False, 32),
+ "mipsel": ( 8, 0, 0, True, 32),
+ "mips64": ( 8, 0, 0, False, 64),
+ "mips64el": ( 8, 0, 0, True, 64),
+ "microblaze": (189, 0, 0, False, 32),
+ "microblazeeb":(189, 0, 0, False, 32),
+ "microblazeel":(189, 0, 0, True, 32),
+ "riscv32": (243, 0, 0, True, 32),
+ "riscv64": (243, 0, 0, True, 64),
+ "sh4": ( 42, 0, 0, True, 32),
+ },
+ "uclinux-uclibc" : {
+ "bfin": ( 106, 0, 0, True, 32),
+ },
+ "linux-gnueabi" : {
+ "arm" : (40, 0, 0, True, 32),
+ "armeb" : (40, 0, 0, False, 32),
+ },
+ "linux-musleabi" : {
+ "arm" : (40, 0, 0, True, 32),
+ "armeb" : (40, 0, 0, False, 32),
+ },
+ "linux-gnuspe" : {
+ "powerpc": (20, 0, 0, False, 32),
+ },
+ "linux-muslspe" : {
+ "powerpc": (20, 0, 0, False, 32),
+ },
+ "linux-gnu" : {
+ "powerpc": (20, 0, 0, False, 32),
+ "sh4": (42, 0, 0, True, 32),
+ },
+ "linux-gnu_ilp32" : {
+ "aarch64" : (183, 0, 0, True, 32),
+ },
+ "linux-gnux32" : {
+ "x86_64": (62, 0, 0, True, 32),
+ },
+ "linux-muslx32" : {
+ "x86_64": (62, 0, 0, True, 32),
+ },
+ "linux-gnun32" : {
+ "mips64": ( 8, 0, 0, False, 32),
+ "mips64el": ( 8, 0, 0, True, 32),
+ "mipsisa64r6": ( 8, 0, 0, False, 32),
+ "mipsisa64r6el":( 8, 0, 0, True, 32),
+ },
+ }
+
+ # Add in any extra user supplied data which may come from a BSP layer, removing the
+ # need to always change this class directly
+ extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS") or "").split()
+ for m in extra_machdata:
+ call = m + "(machdata, d)"
+ locs = { "machdata" : machdata, "d" : d}
+ machdata = bb.utils.better_eval(call, locs)
+
+ return machdata
+
+
+def package_qa_clean_path(path, d, pkg=None):
+ """
+ Remove redundant paths from the path for display. If pkg isn't set then
+ TMPDIR is stripped, otherwise PKGDEST/pkg is stripped.
+ """
+ if pkg:
+ path = path.replace(os.path.join(d.getVar("PKGDEST"), pkg), "/")
+ return path.replace(d.getVar("TMPDIR"), "/").replace("//", "/")
+
+def package_qa_write_error(type, error, d):
+ logfile = d.getVar('QA_LOGFILE')
+ if logfile:
+ p = d.getVar('P')
+ with open(logfile, "a+") as f:
+ f.write("%s: %s [%s]\n" % (p, error, type))
+
+def package_qa_handle_error(error_class, error_msg, d):
+ if error_class in (d.getVar("ERROR_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
+ bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
+ d.setVar("QA_SANE", False)
+ return False
+ elif error_class in (d.getVar("WARN_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
+ bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
+ else:
+ bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
+ return True
+
+def package_qa_add_message(messages, section, new_msg):
+ if section not in messages:
+ messages[section] = new_msg
+ else:
+ messages[section] = messages[section] + "\n" + new_msg
+
+QAPATHTEST[libexec] = "package_qa_check_libexec"
+def package_qa_check_libexec(path,name, d, elf, messages):
+
+ # Skip the case where the default is explicitly /usr/libexec
+ libexec = d.getVar('libexecdir')
+ if libexec == "/usr/libexec":
+ return True
+
+ if 'libexec' in path.split(os.path.sep):
+ package_qa_add_message(messages, "libexec", "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d), libexec))
+ return False
+
+ return True
+
+QAPATHTEST[rpaths] = "package_qa_check_rpath"
+def package_qa_check_rpath(file,name, d, elf, messages):
+ """
+ Check for dangerous RPATHs
+ """
+ if not elf:
+ return
+
+ if os.path.islink(file):
+ return
+
+ bad_dirs = [d.getVar('BASE_WORKDIR'), d.getVar('STAGING_DIR_TARGET')]
+
+ phdrs = elf.run_objdump("-p", d)
+
+ import re
+ rpath_re = re.compile("\s+RPATH\s+(.*)")
+ for line in phdrs.split("\n"):
+ m = rpath_re.match(line)
+ if m:
+ rpath = m.group(1)
+ for dir in bad_dirs:
+ if dir in rpath:
+ package_qa_add_message(messages, "rpaths", "package %s contains bad RPATH %s in file %s" % (name, rpath, file))
+
+QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths"
+def package_qa_check_useless_rpaths(file, name, d, elf, messages):
+ """
+ Check for RPATHs that are useless but not dangerous
+ """
+ def rpath_eq(a, b):
+ return os.path.normpath(a) == os.path.normpath(b)
+
+ if not elf:
+ return
+
+ if os.path.islink(file):
+ return
+
+ libdir = d.getVar("libdir")
+ base_libdir = d.getVar("base_libdir")
+
+ phdrs = elf.run_objdump("-p", d)
+
+ import re
+ rpath_re = re.compile("\s+RPATH\s+(.*)")
+ for line in phdrs.split("\n"):
+ m = rpath_re.match(line)
+ if m:
+ rpath = m.group(1)
+ if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
+ # The dynamic linker searches both these places anyway. There is no point in
+ # looking there again.
+ package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath))
+
+QAPATHTEST[dev-so] = "package_qa_check_dev"
+def package_qa_check_dev(path, name, d, elf, messages):
+ """
+ Check for ".so" library symlinks in non-dev packages
+ """
+
+ if not name.endswith("-dev") and not name.endswith("-dbg") and not name.endswith("-ptest") and not name.startswith("nativesdk-") and path.endswith(".so") and os.path.islink(path):
+ package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package contains symlink .so: %s path '%s'" % \
+ (name, package_qa_clean_path(path,d)))
+
+QAPATHTEST[dev-elf] = "package_qa_check_dev_elf"
+def package_qa_check_dev_elf(path, name, d, elf, messages):
+ """
+ Check that -dev doesn't contain real shared libraries. The test has to
+ check that the file is not a link and is an ELF object as some recipes
+ install link-time .so files that are linker scripts.
+ """
+ if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf:
+ package_qa_add_message(messages, "dev-elf", "-dev package contains non-symlink .so: %s path '%s'" % \
+ (name, package_qa_clean_path(path,d)))
+
+QAPATHTEST[staticdev] = "package_qa_check_staticdev"
+def package_qa_check_staticdev(path, name, d, elf, messages):
+ """
+ Check for ".a" library in non-staticdev packages
+ There are a number of exceptions to this rule, -pic packages can contain
+ static libraries, the _nonshared.a belong with their -dev packages and
+ libgcc.a, libgcov.a will be skipped in their packages
+ """
+
+ if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a"):
+ package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
+ (name, package_qa_clean_path(path,d)))
+
+def package_qa_check_libdir(d):
+ """
+ Check for wrong library installation paths. For instance, catch
+ recipes installing /lib/bar.so when ${base_libdir}="lib32" or
+ installing in /usr/lib64 when ${libdir}="/usr/lib"
+ """
+ import re
+
+ pkgdest = d.getVar('PKGDEST')
+ base_libdir = d.getVar("base_libdir") + os.sep
+ libdir = d.getVar("libdir") + os.sep
+ libexecdir = d.getVar("libexecdir") + os.sep
+ exec_prefix = d.getVar("exec_prefix") + os.sep
+
+ messages = []
+
+ # The re's are purposely fuzzy, as some there are some .so.x.y.z files
+ # that don't follow the standard naming convention. It checks later
+ # that they are actual ELF files
+ lib_re = re.compile("^/lib.+\.so(\..+)?$")
+ exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
+
+ for root, dirs, files in os.walk(pkgdest):
+ if root == pkgdest:
+ # Skip subdirectories for any packages with libdir in INSANE_SKIP
+ skippackages = []
+ for package in dirs:
+ if 'libdir' in (d.getVar('INSANE_SKIP_' + package) or "").split():
+ bb.note("Package %s skipping libdir QA test" % (package))
+ skippackages.append(package)
+ elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory' and package.endswith("-dbg"):
+ bb.note("Package %s skipping libdir QA test for PACKAGE_DEBUG_SPLIT_STYLE equals debug-file-directory" % (package))
+ skippackages.append(package)
+ for package in skippackages:
+ dirs.remove(package)
+ for file in files:
+ full_path = os.path.join(root, file)
+ rel_path = os.path.relpath(full_path, pkgdest)
+ if os.sep in rel_path:
+ package, rel_path = rel_path.split(os.sep, 1)
+ rel_path = os.sep + rel_path
+ if lib_re.match(rel_path):
+ if base_libdir not in rel_path:
+ # make sure it's an actual ELF file
+ elf = oe.qa.ELFFile(full_path)
+ try:
+ elf.open()
+ messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+ except (oe.qa.NotELFFileError):
+ pass
+ if exec_re.match(rel_path):
+ if libdir not in rel_path and libexecdir not in rel_path:
+ # make sure it's an actual ELF file
+ elf = oe.qa.ELFFile(full_path)
+ try:
+ elf.open()
+ messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+ except (oe.qa.NotELFFileError):
+ pass
+
+ if messages:
+ package_qa_handle_error("libdir", "\n".join(messages), d)
+
+QAPATHTEST[debug-files] = "package_qa_check_dbg"
+def package_qa_check_dbg(path, name, d, elf, messages):
+ """
+ Check for ".debug" files or directories outside of the dbg package
+ """
+
+ if not "-dbg" in name and not "-ptest" in name:
+ if '.debug' in path.split(os.path.sep):
+ package_qa_add_message(messages, "debug-files", "non debug package contains .debug directory: %s path %s" % \
+ (name, package_qa_clean_path(path,d)))
+
+QAPATHTEST[perms] = "package_qa_check_perm"
+def package_qa_check_perm(path,name,d, elf, messages):
+ """
+ Check the permission of files
+ """
+ return
+
+QAPATHTEST[arch] = "package_qa_check_arch"
+def package_qa_check_arch(path,name,d, elf, messages):
+ """
+ Check if archs are compatible
+ """
+ import re
+
+ if not elf:
+ return
+
+ target_os = d.getVar('TARGET_OS')
+ target_arch = d.getVar('TARGET_ARCH')
+ provides = d.getVar('PROVIDES')
+ bpn = d.getVar('BPN')
+
+ if target_arch == "allarch":
+ pn = d.getVar('PN')
+ package_qa_add_message(messages, "arch", pn + ": Recipe inherits the allarch class, but has packaged architecture-specific binaries")
+ return
+
+ # FIXME: Cross package confuse this check, so just skip them
+ for s in ['cross', 'nativesdk', 'cross-canadian']:
+ if bb.data.inherits_class(s, d):
+ return
+
+ # avoid following links to /usr/bin (e.g. on udev builds)
+ # we will check the files pointed to anyway...
+ if os.path.islink(path):
+ return
+
+ #if this will throw an exception, then fix the dict above
+ (machine, osabi, abiversion, littleendian, bits) \
+ = package_qa_get_machine_dict(d)[target_os][target_arch]
+
+ # Check the architecture and endiannes of the binary
+ is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \
+ (target_os == "linux-gnux32" or target_os == "linux-muslx32" or target_os == "linux-gnu_ilp32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
+ if not ((machine == elf.machine()) or is_32):
+ package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \
+ (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d)))
+ elif not ((bits == elf.abiSize()) or is_32):
+ package_qa_add_message(messages, "arch", "Bit size did not match (%d to %d) %s on %s" % \
+ (bits, elf.abiSize(), bpn, package_qa_clean_path(path,d)))
+ elif not littleendian == elf.isLittleEndian():
+ package_qa_add_message(messages, "arch", "Endiannes did not match (%d to %d) on %s" % \
+ (littleendian, elf.isLittleEndian(), package_qa_clean_path(path,d)))
+
+QAPATHTEST[desktop] = "package_qa_check_desktop"
+def package_qa_check_desktop(path, name, d, elf, messages):
+ """
+ Run all desktop files through desktop-file-validate.
+ """
+ if path.endswith(".desktop"):
+ desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE'),'desktop-file-validate')
+ output = os.popen("%s %s" % (desktop_file_validate, path))
+ # This only produces output on errors
+ for l in output:
+ package_qa_add_message(messages, "desktop", "Desktop file issue: " + l.strip())
+
+QAPATHTEST[textrel] = "package_qa_textrel"
+def package_qa_textrel(path, name, d, elf, messages):
+ """
+ Check if the binary contains relocations in .text
+ """
+
+ if not elf:
+ return
+
+ if os.path.islink(path):
+ return
+
+ phdrs = elf.run_objdump("-p", d)
+ sane = True
+
+ import re
+ textrel_re = re.compile("\s+TEXTREL\s+")
+ for line in phdrs.split("\n"):
+ if textrel_re.match(line):
+ sane = False
+
+ if not sane:
+ package_qa_add_message(messages, "textrel", "ELF binary '%s' has relocations in .text" % path)
+
+QAPATHTEST[ldflags] = "package_qa_hash_style"
+def package_qa_hash_style(path, name, d, elf, messages):
+ """
+ Check if the binary has the right hash style...
+ """
+
+ if not elf:
+ return
+
+ if os.path.islink(path):
+ return
+
+ gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS')
+ if not gnu_hash:
+ gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS')
+ if not gnu_hash:
+ return
+
+ sane = False
+ has_syms = False
+
+ phdrs = elf.run_objdump("-p", d)
+
+ # If this binary has symbols, we expect it to have GNU_HASH too.
+ for line in phdrs.split("\n"):
+ if "SYMTAB" in line:
+ has_syms = True
+ if "GNU_HASH" in line:
+ sane = True
+ if "[mips32]" in line or "[mips64]" in line:
+ sane = True
+
+ if has_syms and not sane:
+ package_qa_add_message(messages, "ldflags", "No GNU_HASH in the elf binary: '%s'" % path)
+
+
+QAPATHTEST[buildpaths] = "package_qa_check_buildpaths"
+def package_qa_check_buildpaths(path, name, d, elf, messages):
+ """
+ Check for build paths inside target files and error if not found in the whitelist
+ """
+ # Ignore .debug files, not interesting
+ if path.find(".debug") != -1:
+ return
+
+ # Ignore symlinks
+ if os.path.islink(path):
+ return
+
+ # Ignore ipk and deb's CONTROL dir
+ if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
+ return
+
+ tmpdir = d.getVar('TMPDIR')
+ with open(path, 'rb') as f:
+ file_content = f.read().decode('utf-8', errors='ignore')
+ if tmpdir in file_content:
+ package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))
+
+
+QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi"
+def package_qa_check_xorg_driver_abi(path, name, d, elf, messages):
+ """
+ Check that all packages containing Xorg drivers have ABI dependencies
+ """
+
+ # Skip dev, dbg or nativesdk packages
+ if name.endswith("-dev") or name.endswith("-dbg") or name.startswith("nativesdk-"):
+ return
+
+ driverdir = d.expand("${libdir}/xorg/modules/drivers/")
+ if driverdir in path and path.endswith(".so"):
+ mlprefix = d.getVar('MLPREFIX') or ''
+ for rdep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + name) or ""):
+ if rdep.startswith("%sxorg-abi-" % mlprefix):
+ return
+ package_qa_add_message(messages, "xorg-driver-abi", "Package %s contains Xorg driver (%s) but no xorg-abi- dependencies" % (name, os.path.basename(path)))
+
+QAPATHTEST[infodir] = "package_qa_check_infodir"
+def package_qa_check_infodir(path, name, d, elf, messages):
+ """
+ Check that /usr/share/info/dir isn't shipped in a particular package
+ """
+ infodir = d.expand("${infodir}/dir")
+
+ if infodir in path:
+ package_qa_add_message(messages, "infodir", "The /usr/share/info/dir file is not meant to be shipped in a particular package.")
+
+QAPATHTEST[symlink-to-sysroot] = "package_qa_check_symlink_to_sysroot"
+def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages):
+ """
+ Check that the package doesn't contain any absolute symlinks to the sysroot.
+ """
+ if os.path.islink(path):
+ target = os.readlink(path)
+ if os.path.isabs(target):
+ tmpdir = d.getVar('TMPDIR')
+ if target.startswith(tmpdir):
+ trimmed = path.replace(os.path.join (d.getVar("PKGDEST"), name), "")
+ package_qa_add_message(messages, "symlink-to-sysroot", "Symlink %s in %s points to TMPDIR" % (trimmed, name))
+
+# Check license variables
+do_populate_lic[postfuncs] += "populate_lic_qa_checksum"
+python populate_lic_qa_checksum() {
+ """
+ Check for changes in the license files.
+ """
+ import tempfile
+ sane = True
+
+ lic_files = d.getVar('LIC_FILES_CHKSUM') or ''
+ lic = d.getVar('LICENSE')
+ pn = d.getVar('PN')
+
+ if lic == "CLOSED":
+ return
+
+ if not lic_files and d.getVar('SRC_URI'):
+ sane = package_qa_handle_error("license-checksum", pn + ": Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM)", d)
+
+ srcdir = d.getVar('S')
+ corebase_licensefile = d.getVar('COREBASE') + "/LICENSE"
+ for url in lic_files.split():
+ try:
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+ except bb.fetch.MalformedUrl:
+ sane = package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url, d)
+ continue
+ srclicfile = os.path.join(srcdir, path)
+ if not os.path.isfile(srclicfile):
+ package_qa_handle_error("license-checksum", pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile, d)
+ continue
+
+ if (srclicfile == corebase_licensefile):
+ bb.warn("${COREBASE}/LICENSE is not a valid license file, please use '${COMMON_LICENSE_DIR}/MIT' for a MIT License file in LIC_FILES_CHKSUM. This will become an error in the future")
+
+ recipemd5 = parm.get('md5', '')
+ beginline, endline = 0, 0
+ if 'beginline' in parm:
+ beginline = int(parm['beginline'])
+ if 'endline' in parm:
+ endline = int(parm['endline'])
+
+ if (not beginline) and (not endline):
+ md5chksum = bb.utils.md5_file(srclicfile)
+ with open(srclicfile, 'rb') as f:
+ license = f.read()
+ else:
+ fi = open(srclicfile, 'rb')
+ fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False)
+ tmplicfile = fo.name;
+ lineno = 0
+ linesout = 0
+ license = []
+ for line in fi:
+ lineno += 1
+ if (lineno >= beginline):
+ if ((lineno <= endline) or not endline):
+ fo.write(line)
+ license.append(line)
+ linesout += 1
+ else:
+ break
+ fo.flush()
+ fo.close()
+ fi.close()
+ md5chksum = bb.utils.md5_file(tmplicfile)
+ license = b''.join(license)
+ os.unlink(tmplicfile)
+
+ if recipemd5 == md5chksum:
+ bb.note (pn + ": md5 checksum matched for ", url)
+ else:
+ if recipemd5:
+ msg = pn + ": The LIC_FILES_CHKSUM does not match for " + url
+ msg = msg + "\n" + pn + ": The new md5 checksum is " + md5chksum
+ try:
+ license_lines = license.decode('utf-8').split('\n')
+ except:
+ # License text might not be valid UTF-8, in which
+ # case we don't know how to include it in our output
+ # and have to skip it.
+ pass
+ else:
+ max_lines = int(d.getVar('QA_MAX_LICENSE_LINES') or 20)
+ if not license_lines or license_lines[-1] != '':
+ # Ensure that our license text ends with a line break
+ # (will be added with join() below).
+ license_lines.append('')
+ remove = len(license_lines) - max_lines
+ if remove > 0:
+ start = max_lines // 2
+ end = start + remove - 1
+ del license_lines[start:end]
+ license_lines.insert(start, '...')
+ msg = msg + "\n" + pn + ": Here is the selected license text:" + \
+ "\n" + \
+ "{:v^70}".format(" beginline=%d " % beginline if beginline else "") + \
+ "\n" + "\n".join(license_lines) + \
+ "{:^^70}".format(" endline=%d " % endline if endline else "")
+ if beginline:
+ if endline:
+ srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
+ else:
+ srcfiledesc = "%s (beginning on line %d)" % (srclicfile, beginline)
+ elif endline:
+ srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline)
+ else:
+ srcfiledesc = srclicfile
+ msg = msg + "\n" + pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic)
+
+ else:
+ msg = pn + ": LIC_FILES_CHKSUM is not specified for " + url
+ msg = msg + "\n" + pn + ": The md5 checksum is " + md5chksum
+ sane = package_qa_handle_error("license-checksum", msg, d)
+
+ if not sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
+
+def package_qa_check_staged(path,d):
+ """
+ Check staged la and pc files for common problems like references to the work
+ directory.
+
+ As this is run after every stage we should be able to find the one
+ responsible for the errors easily even if we look at every .pc and .la file.
+ """
+
+ sane = True
+ tmpdir = d.getVar('TMPDIR')
+ workdir = os.path.join(tmpdir, "work")
+ recipesysroot = d.getVar("RECIPE_SYSROOT")
+
+ if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
+ pkgconfigcheck = workdir
+ else:
+ pkgconfigcheck = tmpdir
+
+ # find all .la and .pc files
+ # read the content
+ # and check for stuff that looks wrong
+ for root, dirs, files in os.walk(path):
+ for file in files:
+ path = os.path.join(root,file)
+ if file.endswith(".la"):
+ with open(path) as f:
+ file_content = f.read()
+ file_content = file_content.replace(recipesysroot, "")
+ if workdir in file_content:
+ error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
+ sane = package_qa_handle_error("la", error_msg, d)
+ elif file.endswith(".pc"):
+ with open(path) as f:
+ file_content = f.read()
+ file_content = file_content.replace(recipesysroot, "")
+ if pkgconfigcheck in file_content:
+ error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
+ sane = package_qa_handle_error("pkgconfig", error_msg, d)
+
+ return sane
+
+# Run all package-wide warnfuncs and errorfuncs
+def package_qa_package(warnfuncs, errorfuncs, package, d):
+ warnings = {}
+ errors = {}
+
+ for func in warnfuncs:
+ func(package, d, warnings)
+ for func in errorfuncs:
+ func(package, d, errors)
+
+ for w in warnings:
+ package_qa_handle_error(w, warnings[w], d)
+ for e in errors:
+ package_qa_handle_error(e, errors[e], d)
+
+ return len(errors) == 0
+
+# Run all recipe-wide warnfuncs and errorfuncs
+def package_qa_recipe(warnfuncs, errorfuncs, pn, d):
+ warnings = {}
+ errors = {}
+
+ for func in warnfuncs:
+ func(pn, d, warnings)
+ for func in errorfuncs:
+ func(pn, d, errors)
+
+ for w in warnings:
+ package_qa_handle_error(w, warnings[w], d)
+ for e in errors:
+ package_qa_handle_error(e, errors[e], d)
+
+ return len(errors) == 0
+
+# Walk over all files in a directory and call func
+def package_qa_walk(warnfuncs, errorfuncs, package, d):
+ import oe.qa
+
+ #if this will throw an exception, then fix the dict above
+ target_os = d.getVar('TARGET_OS')
+ target_arch = d.getVar('TARGET_ARCH')
+
+ warnings = {}
+ errors = {}
+ for path in pkgfiles[package]:
+ elf = oe.qa.ELFFile(path)
+ try:
+ elf.open()
+ except (IOError, oe.qa.NotELFFileError):
+ # IOError can happen if the packaging control files disappear,
+ elf = None
+ for func in warnfuncs:
+ func(path, package, d, elf, warnings)
+ for func in errorfuncs:
+ func(path, package, d, elf, errors)
+
+ for w in warnings:
+ package_qa_handle_error(w, warnings[w], d)
+ for e in errors:
+ package_qa_handle_error(e, errors[e], d)
+
+def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
+ # Don't do this check for kernel/module recipes, there aren't too many debug/development
+ # packages and you can get false positives e.g. on kernel-module-lirc-dev
+ if bb.data.inherits_class("kernel", d) or bb.data.inherits_class("module-base", d):
+ return
+
+ if not "-dbg" in pkg and not "packagegroup-" in pkg and not "-image" in pkg:
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES') + ':' + pkg)
+
+ # Now check the RDEPENDS
+ rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS') or "")
+
+ # Now do the sanity check!!!
+ if "build-deps" not in skip:
+ for rdepend in rdepends:
+ if "-dbg" in rdepend and "debug-deps" not in skip:
+ error_msg = "%s rdepends on %s" % (pkg,rdepend)
+ package_qa_handle_error("debug-deps", error_msg, d)
+ if (not "-dev" in pkg and not "-staticdev" in pkg) and rdepend.endswith("-dev") and "dev-deps" not in skip:
+ error_msg = "%s rdepends on %s" % (pkg, rdepend)
+ package_qa_handle_error("dev-deps", error_msg, d)
+ if rdepend not in packages:
+ rdep_data = oe.packagedata.read_subpkgdata(rdepend, d)
+ if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+ continue
+ if not rdep_data or not 'PN' in rdep_data:
+ pkgdata_dir = d.getVar("PKGDATA_DIR")
+ try:
+ possibles = os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdepend))
+ except OSError:
+ possibles = []
+ for p in possibles:
+ rdep_data = oe.packagedata.read_subpkgdata(p, d)
+ if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+ break
+ if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+ continue
+ if rdep_data and 'PN' in rdep_data:
+ error_msg = "%s rdepends on %s, but it isn't a build dependency, missing %s in DEPENDS or PACKAGECONFIG?" % (pkg, rdepend, rdep_data['PN'])
+ else:
+ error_msg = "%s rdepends on %s, but it isn't a build dependency?" % (pkg, rdepend)
+ package_qa_handle_error("build-deps", error_msg, d)
+
+ if "file-rdeps" not in skip:
+ ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
+ if bb.data.inherits_class('nativesdk', d):
+ ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl', 'perl'])
+ # For Saving the FILERDEPENDS
+ filerdepends = {}
+ rdep_data = oe.packagedata.read_subpkgdata(pkg, d)
+ for key in rdep_data:
+ if key.startswith("FILERDEPENDS_"):
+ for subkey in bb.utils.explode_deps(rdep_data[key]):
+ if subkey not in ignored_file_rdeps and \
+ not subkey.startswith('perl('):
+ # We already know it starts with FILERDEPENDS_
+ filerdepends[subkey] = key[13:]
+
+ if filerdepends:
+ next = rdepends
+ done = rdepends[:]
+ # Find all the rdepends on the dependency chain
+ while next:
+ new = []
+ for rdep in next:
+ rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
+ sub_rdeps = rdep_data.get("RDEPENDS_" + rdep)
+ if not sub_rdeps:
+ continue
+ for sub_rdep in bb.utils.explode_deps(sub_rdeps):
+ if sub_rdep in done:
+ continue
+ if oe.packagedata.has_subpkgdata(sub_rdep, d):
+ # It's a new rdep
+ done.append(sub_rdep)
+ new.append(sub_rdep)
+ next = new
+
+ # Add the rprovides of itself
+ if pkg not in done:
+ done.insert(0, pkg)
+
+ # The python is not a package, but python-core provides it, so
+ # skip checking /usr/bin/python if python is in the rdeps, in
+ # case there is a RDEPENDS_pkg = "python" in the recipe.
+ for py in [ d.getVar('MLPREFIX') + "python", "python" ]:
+ if py in done:
+ filerdepends.pop("/usr/bin/python",None)
+ done.remove(py)
+ for rdep in done:
+ # The file dependencies may contain package names, e.g.,
+ # perl
+ filerdepends.pop(rdep,None)
+
+ # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO
+ rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
+ for key in rdep_data:
+ if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_"):
+ for subkey in bb.utils.explode_deps(rdep_data[key]):
+ filerdepends.pop(subkey,None)
+ # Add the files list to the rprovides
+ if key == "FILES_INFO":
+ # Use eval() to make it as a dict
+ for subkey in eval(rdep_data[key]):
+ filerdepends.pop(subkey,None)
+ if not filerdepends:
+ # Break if all the file rdepends are met
+ break
+ if filerdepends:
+ for key in filerdepends:
+ error_msg = "%s contained in package %s requires %s, but no providers found in RDEPENDS_%s?" % \
+ (filerdepends[key].replace("_%s" % pkg, "").replace("@underscore@", "_"), pkg, key, pkg)
+ package_qa_handle_error("file-rdeps", error_msg, d)
+package_qa_check_rdepends[vardepsexclude] = "OVERRIDES"
+
+def package_qa_check_deps(pkg, pkgdest, d):
+
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('OVERRIDES', pkg)
+
+ def check_valid_deps(var):
+ try:
+ rvar = bb.utils.explode_dep_versions2(localdata.getVar(var) or "")
+ except ValueError as e:
+ bb.fatal("%s_%s: %s" % (var, pkg, e))
+ for dep in rvar:
+ for v in rvar[dep]:
+ if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')):
+ error_msg = "%s_%s is invalid: %s (%s) only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v)
+ package_qa_handle_error("dep-cmp", error_msg, d)
+
+ check_valid_deps('RDEPENDS')
+ check_valid_deps('RRECOMMENDS')
+ check_valid_deps('RSUGGESTS')
+ check_valid_deps('RPROVIDES')
+ check_valid_deps('RREPLACES')
+ check_valid_deps('RCONFLICTS')
+
+QAPKGTEST[usrmerge] = "package_qa_check_usrmerge"
+def package_qa_check_usrmerge(pkg, d, messages):
+ pkgdest = d.getVar('PKGDEST')
+ pkg_dir = pkgdest + os.sep + pkg + os.sep
+ merged_dirs = ['bin', 'sbin', 'lib'] + d.getVar('MULTILIB_VARIANTS').split()
+ for f in merged_dirs:
+ if os.path.exists(pkg_dir + f) and not os.path.islink(pkg_dir + f):
+ msg = "%s package is not obeying usrmerge distro feature. /%s should be relocated to /usr." % (pkg, f)
+ package_qa_add_message(messages, "usrmerge", msg)
+ return False
+ return True
+
+QAPKGTEST[expanded-d] = "package_qa_check_expanded_d"
+def package_qa_check_expanded_d(package, d, messages):
+ """
+ Check for the expanded D (${D}) value in pkg_* and FILES
+ variables, warn the user to use it correctly.
+ """
+ sane = True
+ expanded_d = d.getVar('D')
+
+ for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
+ bbvar = d.getVar(var + "_" + package) or ""
+ if expanded_d in bbvar:
+ if var == 'FILES':
+ package_qa_add_message(messages, "expanded-d", "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % package)
+ sane = False
+ else:
+ package_qa_add_message(messages, "expanded-d", "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, package))
+ sane = False
+ return sane
+
+def package_qa_check_encoding(keys, encode, d):
+ def check_encoding(key, enc):
+ sane = True
+ value = d.getVar(key)
+ if value:
+ try:
+ s = value.encode(enc)
+ except UnicodeDecodeError as e:
+ error_msg = "%s has non %s characters" % (key,enc)
+ sane = False
+ package_qa_handle_error("invalid-chars", error_msg, d)
+ return sane
+
+ for key in keys:
+ sane = check_encoding(key, encode)
+ if not sane:
+ break
+
+HOST_USER_UID := "${@os.getuid()}"
+HOST_USER_GID := "${@os.getgid()}"
+
+QAPATHTEST[host-user-contaminated] = "package_qa_check_host_user"
+def package_qa_check_host_user(path, name, d, elf, messages):
+ """Check for paths outside of /home which are owned by the user running bitbake."""
+
+ if not os.path.lexists(path):
+ return
+
+ dest = d.getVar('PKGDEST')
+ pn = d.getVar('PN')
+ home = os.path.join(dest, 'home')
+ if path == home or path.startswith(home + os.sep):
+ return
+
+ try:
+ stat = os.lstat(path)
+ except OSError as exc:
+ import errno
+ if exc.errno != errno.ENOENT:
+ raise
+ else:
+ rootfs_path = path[len(dest):]
+ check_uid = int(d.getVar('HOST_USER_UID'))
+ if stat.st_uid == check_uid:
+ package_qa_add_message(messages, "host-user-contaminated", "%s: %s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_uid))
+ return False
+
+ check_gid = int(d.getVar('HOST_USER_GID'))
+ if stat.st_gid == check_gid:
+ package_qa_add_message(messages, "host-user-contaminated", "%s: %s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_gid))
+ return False
+ return True
+
+
+# The PACKAGE FUNC to scan each package
+python do_package_qa () {
+ import subprocess
+ import oe.packagedata
+
+ bb.note("DO PACKAGE QA")
+
+ bb.build.exec_func("read_subpackage_metadata", d)
+
+ # Check non UTF-8 characters on recipe's metadata
+ package_qa_check_encoding(['DESCRIPTION', 'SUMMARY', 'LICENSE', 'SECTION'], 'utf-8', d)
+
+ logdir = d.getVar('T')
+ pn = d.getVar('PN')
+
+ # Check the compile log for host contamination
+ compilelog = os.path.join(logdir,"log.do_compile")
+
+ if os.path.exists(compilelog):
+ statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % compilelog
+ if subprocess.call(statement, shell=True) == 0:
+ msg = "%s: The compile log indicates that host include and/or library paths were used.\n \
+ Please check the log '%s' for more information." % (pn, compilelog)
+ package_qa_handle_error("compile-host-path", msg, d)
+
+ # Check the install log for host contamination
+ installlog = os.path.join(logdir,"log.do_install")
+
+ if os.path.exists(installlog):
+ statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % installlog
+ if subprocess.call(statement, shell=True) == 0:
+ msg = "%s: The install log indicates that host include and/or library paths were used.\n \
+ Please check the log '%s' for more information." % (pn, installlog)
+ package_qa_handle_error("install-host-path", msg, d)
+
+ # Scan the packages...
+ pkgdest = d.getVar('PKGDEST')
+ packages = set((d.getVar('PACKAGES') or '').split())
+
+ cpath = oe.cachedpath.CachedPath()
+ global pkgfiles
+ pkgfiles = {}
+ for pkg in packages:
+ pkgfiles[pkg] = []
+ for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
+ for file in files:
+ pkgfiles[pkg].append(walkroot + os.sep + file)
+
+ # no packages should be scanned
+ if not packages:
+ return
+
+ import re
+ # The package name matches the [a-z0-9.+-]+ regular expression
+ pkgname_pattern = re.compile("^[a-z0-9.+-]+$")
+
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ taskdeps = set()
+ for dep in taskdepdata:
+ taskdeps.add(taskdepdata[dep][0])
+
+ def parse_test_matrix(matrix_name):
+ testmatrix = d.getVarFlags(matrix_name) or {}
+ g = globals()
+ warnchecks = []
+ for w in (d.getVar("WARN_QA") or "").split():
+ if w in skip:
+ continue
+ if w in testmatrix and testmatrix[w] in g:
+ warnchecks.append(g[testmatrix[w]])
+
+ errorchecks = []
+ for e in (d.getVar("ERROR_QA") or "").split():
+ if e in skip:
+ continue
+ if e in testmatrix and testmatrix[e] in g:
+ errorchecks.append(g[testmatrix[e]])
+ return warnchecks, errorchecks
+
+ for package in packages:
+ skip = set((d.getVar('INSANE_SKIP') or "").split() +
+ (d.getVar('INSANE_SKIP_' + package) or "").split())
+ if skip:
+ bb.note("Package %s skipping QA tests: %s" % (package, str(skip)))
+
+ bb.note("Checking Package: %s" % package)
+ # Check package name
+ if not pkgname_pattern.match(package):
+ package_qa_handle_error("pkgname",
+ "%s doesn't match the [a-z0-9.+-]+ regex" % package, d)
+
+ warn_checks, error_checks = parse_test_matrix("QAPATHTEST")
+ package_qa_walk(warn_checks, error_checks, package, d)
+
+ warn_checks, error_checks = parse_test_matrix("QAPKGTEST")
+ package_qa_package(warn_checks, error_checks, package, d)
+
+ package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d)
+ package_qa_check_deps(package, pkgdest, d)
+
+ warn_checks, error_checks = parse_test_matrix("QARECIPETEST")
+ package_qa_recipe(warn_checks, error_checks, pn, d)
+
+ if 'libdir' in d.getVar("ALL_QA").split():
+ package_qa_check_libdir(d)
+
+ qa_sane = d.getVar("QA_SANE")
+ if not qa_sane:
+ bb.fatal("QA run found fatal errors. Please consider fixing them.")
+ bb.note("DONE with PACKAGE QA")
+}
+
+# binutils is used for most checks, so need to set as dependency
+# POPULATESYSROOTDEPS is defined in staging class.
+do_package_qa[depends] += "${POPULATESYSROOTDEPS}"
+do_package_qa[vardepsexclude] = "BB_TASKDEPDATA"
+do_package_qa[rdeptask] = "do_packagedata"
+addtask do_package_qa after do_packagedata do_package before do_build
+
+SSTATETASKS += "do_package_qa"
+do_package_qa[sstate-inputdirs] = ""
+do_package_qa[sstate-outputdirs] = ""
+python do_package_qa_setscene () {
+ sstate_setscene(d)
+}
+addtask do_package_qa_setscene
+
+python do_qa_staging() {
+ bb.note("QA checking staging")
+
+ if not package_qa_check_staged(d.expand('${SYSROOT_DESTDIR}${libdir}'), d):
+ bb.fatal("QA staging was broken by the package built above")
+}
+
+python do_qa_configure() {
+ import subprocess
+
+ ###########################################################################
+ # Check config.log for cross compile issues
+ ###########################################################################
+
+ configs = []
+ workdir = d.getVar('WORKDIR')
+
+ if bb.data.inherits_class('autotools', d):
+ bb.note("Checking autotools environment for common misconfiguration")
+ for root, dirs, files in os.walk(workdir):
+ statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \
+ os.path.join(root,"config.log")
+ if "config.log" in files:
+ if subprocess.call(statement, shell=True) == 0:
+ bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+Rerun configure task after fixing this.""")
+
+ if "configure.ac" in files:
+ configs.append(os.path.join(root,"configure.ac"))
+ if "configure.in" in files:
+ configs.append(os.path.join(root, "configure.in"))
+
+ ###########################################################################
+ # Check gettext configuration and dependencies are correct
+ ###########################################################################
+
+ cnf = d.getVar('EXTRA_OECONF') or ""
+ if "gettext" not in d.getVar('P') and "gcc-runtime" not in d.getVar('P') and "--disable-nls" not in cnf:
+ ml = d.getVar("MLPREFIX") or ""
+ if bb.data.inherits_class('cross-canadian', d):
+ gt = "nativesdk-gettext"
+ else:
+ gt = "gettext-native"
+ deps = bb.utils.explode_deps(d.getVar('DEPENDS') or "")
+ if gt not in deps:
+ for config in configs:
+ gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
+ if subprocess.call(gnu, shell=True) == 0:
+ bb.fatal("""%s required but not in DEPENDS for file %s.
+Missing inherit gettext?""" % (gt, config))
+
+ ###########################################################################
+ # Check unrecognised configure options (with a white list)
+ ###########################################################################
+ if bb.data.inherits_class("autotools", d):
+ bb.note("Checking configure output for unrecognised options")
+ try:
+ flag = "WARNING: unrecognized options:"
+ log = os.path.join(d.getVar('B'), 'config.log')
+ output = subprocess.check_output(['grep', '-F', flag, log]).decode("utf-8").replace(', ', ' ')
+ options = set()
+ for line in output.splitlines():
+ options |= set(line.partition(flag)[2].split())
+ whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST").split())
+ options -= whitelist
+ if options:
+ pn = d.getVar('PN')
+ error_msg = pn + ": configure was passed unrecognised options: " + " ".join(options)
+ package_qa_handle_error("unknown-configure-option", error_msg, d)
+ except subprocess.CalledProcessError:
+ pass
+
+ # Check invalid PACKAGECONFIG
+ pkgconfig = (d.getVar("PACKAGECONFIG") or "").split()
+ if pkgconfig:
+ pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+ for pconfig in pkgconfig:
+ if pconfig not in pkgconfigflags:
+ pn = d.getVar('PN')
+ error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
+ package_qa_handle_error("invalid-packageconfig", error_msg, d)
+
+ qa_sane = d.getVar("QA_SANE")
+ if not qa_sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
+
+python do_qa_unpack() {
+ src_uri = d.getVar('SRC_URI')
+ s_dir = d.getVar('S')
+ if src_uri and not os.path.exists(s_dir):
+ bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir))
+}
+
+# The Staging Func, to check all staging
+#addtask qa_staging after do_populate_sysroot before do_build
+do_populate_sysroot[postfuncs] += "do_qa_staging "
+
+# Check broken config.log files, for packages requiring Gettext which
+# don't have it in DEPENDS.
+#addtask qa_configure after do_configure before do_compile
+do_configure[postfuncs] += "do_qa_configure "
+
+# Check does S exist.
+do_unpack[postfuncs] += "do_qa_unpack"
+
+python () {
+ import re
+
+ tests = d.getVar('ALL_QA').split()
+ if "desktop" in tests:
+ d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
+
+ ###########################################################################
+ # Check various variables
+ ###########################################################################
+
+ # Checking ${FILESEXTRAPATHS}
+ extrapaths = (d.getVar("FILESEXTRAPATHS") or "")
+ if '__default' not in extrapaths.split(":"):
+ msg = "FILESEXTRAPATHS-variable, must always use _prepend (or _append)\n"
+ msg += "type of assignment, and don't forget the colon.\n"
+ msg += "Please assign it with the format of:\n"
+ msg += " FILESEXTRAPATHS_append := \":${THISDIR}/Your_Files_Path\" or\n"
+ msg += " FILESEXTRAPATHS_prepend := \"${THISDIR}/Your_Files_Path:\"\n"
+ msg += "in your bbappend file\n\n"
+ msg += "Your incorrect assignment is:\n"
+ msg += "%s\n" % extrapaths
+ bb.warn(msg)
+
+ overrides = d.getVar('OVERRIDES').split(':')
+ pn = d.getVar('PN')
+ if pn in overrides:
+ msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn)
+ package_qa_handle_error("pn-overrides", msg, d)
+ prog = re.compile('[A-Z]')
+ if prog.search(pn):
+ package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d)
+
+ issues = []
+ if (d.getVar('PACKAGES') or "").split():
+ for dep in (d.getVar('QADEPENDS') or "").split():
+ d.appendVarFlag('do_package_qa', 'depends', " %s:do_populate_sysroot" % dep)
+ for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY':
+ if d.getVar(var, False):
+ issues.append(var)
+
+ fakeroot_tests = d.getVar('FAKEROOT_QA').split()
+ if set(tests) & set(fakeroot_tests):
+ d.setVarFlag('do_package_qa', 'fakeroot', '1')
+ d.appendVarFlag('do_package_qa', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+ else:
+ d.setVarFlag('do_package_qa', 'rdeptask', '')
+ for i in issues:
+ package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE"), i), d)
+ qa_sane = d.getVar("QA_SANE")
+ if not qa_sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
diff --git a/poky/meta/classes/kernel-arch.bbclass b/poky/meta/classes/kernel-arch.bbclass
new file mode 100644
index 000000000..09793fc9c
--- /dev/null
+++ b/poky/meta/classes/kernel-arch.bbclass
@@ -0,0 +1,66 @@
+#
+# set the ARCH environment variable for kernel compilation (including
+# modules). return value must match one of the architecture directories
+# in the kernel source "arch" directory
+#
+
+valid_archs = "alpha cris ia64 \
+ i386 x86 \
+ m68knommu m68k ppc powerpc powerpc64 ppc64 \
+ sparc sparc64 \
+ arm aarch64 \
+ m32r mips \
+ sh sh64 um h8300 \
+ parisc s390 v850 \
+ avr32 blackfin \
+ microblaze \
+ nios2 arc riscv xtensa"
+
+def map_kernel_arch(a, d):
+ import re
+
+ valid_archs = d.getVar('valid_archs').split()
+
+ if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
+ elif re.match('armeb$', a): return 'arm'
+ elif re.match('aarch64$', a): return 'arm64'
+ elif re.match('aarch64_be$', a): return 'arm64'
+ elif re.match('aarch64_ilp32$', a): return 'arm64'
+ elif re.match('aarch64_be_ilp32$', a): return 'arm64'
+ elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'mips'
+ elif re.match('riscv(32|64|)(eb|)$', a): return 'riscv'
+ elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc'
+ elif re.match('sh(3|4)$', a): return 'sh'
+ elif re.match('bfin', a): return 'blackfin'
+ elif re.match('microblazee[bl]', a): return 'microblaze'
+ elif a in valid_archs: return a
+ else:
+ if not d.getVar("TARGET_OS").startswith("linux"):
+ return a
+ bb.error("cannot map '%s' to a linux kernel architecture" % a)
+
+export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}"
+
+def map_uboot_arch(a, d):
+ import re
+
+ if re.match('p(pc|owerpc)(|64)', a): return 'ppc'
+ elif re.match('i.86$', a): return 'x86'
+ return a
+
+export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH'), d)}"
+
+# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
+# specific options necessary for building the kernel and modules.
+TARGET_CC_KERNEL_ARCH ?= ""
+HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
+TARGET_LD_KERNEL_ARCH ?= ""
+HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
+TARGET_AR_KERNEL_ARCH ?= ""
+HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
+
+KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH}"
+KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
+KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
+TOOLCHAIN = "gcc"
+
diff --git a/poky/meta/classes/kernel-devicetree.bbclass b/poky/meta/classes/kernel-devicetree.bbclass
new file mode 100644
index 000000000..4f80cc62e
--- /dev/null
+++ b/poky/meta/classes/kernel-devicetree.bbclass
@@ -0,0 +1,112 @@
+# Support for device tree generation
+PACKAGES_append = " \
+ ${KERNEL_PACKAGE_NAME}-devicetree \
+ ${@[d.getVar('KERNEL_PACKAGE_NAME') + '-image-zimage-bundle', ''][d.getVar('KERNEL_DEVICETREE_BUNDLE') != '1']} \
+"
+FILES_${KERNEL_PACKAGE_NAME}-devicetree = "/${KERNEL_IMAGEDEST}/*.dtb /${KERNEL_IMAGEDEST}/*.dtbo"
+FILES_${KERNEL_PACKAGE_NAME}-image-zimage-bundle = "/${KERNEL_IMAGEDEST}/zImage-*.dtb.bin"
+
+# Generate kernel+devicetree bundle
+KERNEL_DEVICETREE_BUNDLE ?= "0"
+
+normalize_dtb () {
+ DTB="$1"
+ if echo ${DTB} | grep -q '/dts/'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ echo "${DTB}"
+}
+
+get_real_dtb_path_in_kernel () {
+ DTB="$1"
+ DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+ if [ ! -e "${DTB_PATH}" ]; then
+ DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+ fi
+ echo "${DTB_PATH}"
+}
+
+do_configure_append() {
+ if [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
+ if echo ${KERNEL_IMAGETYPE_FOR_MAKE} | grep -q 'zImage'; then
+ case "${ARCH}" in
+ "arm")
+ config="${B}/.config"
+ if ! grep -q 'CONFIG_ARM_APPENDED_DTB=y' $config; then
+ bbwarn 'CONFIG_ARM_APPENDED_DTB is NOT enabled in the kernel. Enabling it to allow the kernel to boot with the Device Tree appended!'
+ sed -i "/CONFIG_ARM_APPENDED_DTB[ =]/d" $config
+ echo "CONFIG_ARM_APPENDED_DTB=y" >> $config
+ echo "# CONFIG_ARM_ATAG_DTB_COMPAT is not set" >> $config
+ fi
+ ;;
+ *)
+ bberror "KERNEL_DEVICETREE_BUNDLE is not supported for ${ARCH}. Currently it is only supported for 'ARM'."
+ esac
+ else
+ bberror 'The KERNEL_DEVICETREE_BUNDLE requires the KERNEL_IMAGETYPE to contain zImage.'
+ fi
+ fi
+}
+
+do_compile_append() {
+ for DTB in ${KERNEL_DEVICETREE}; do
+ DTB=`normalize_dtb "${DTB}"`
+ oe_runmake ${DTB}
+ done
+}
+
+do_install_append() {
+ for DTB in ${KERNEL_DEVICETREE}; do
+ DTB=`normalize_dtb "${DTB}"`
+ DTB_EXT=${DTB##*.}
+ DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT}
+ for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
+ symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
+ DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ ln -sf ${DTB_BASE_NAME}.${DTB_EXT} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT}
+
+ if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
+ cat ${D}/${KERNEL_IMAGEDEST}/$type \
+ ${D}/${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} \
+ > ${D}/${KERNEL_IMAGEDEST}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ fi
+ done
+ done
+}
+
+do_deploy_append() {
+ for DTB in ${KERNEL_DEVICETREE}; do
+ DTB=`normalize_dtb "${DTB}"`
+ DTB_EXT=${DTB##*.}
+ DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
+ for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
+ base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
+ symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
+ DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+ DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
+ install -d ${DEPLOYDIR}
+ install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
+ ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
+ ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}
+
+ if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
+ cat ${DEPLOYDIR}/$type \
+ ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
+ > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
+ ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin
+
+ if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
+ cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
+ ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
+ > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
+ ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
+ ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
+ fi
+ fi
+ done
+ done
+}
diff --git a/poky/meta/classes/kernel-fitimage.bbclass b/poky/meta/classes/kernel-fitimage.bbclass
new file mode 100644
index 000000000..50a91e199
--- /dev/null
+++ b/poky/meta/classes/kernel-fitimage.bbclass
@@ -0,0 +1,487 @@
+inherit kernel-uboot uboot-sign
+
+python __anonymous () {
+ kerneltypes = d.getVar('KERNEL_IMAGETYPES') or ""
+ if 'fitImage' in kerneltypes.split():
+ depends = d.getVar("DEPENDS")
+ depends = "%s u-boot-mkimage-native dtc-native" % depends
+ d.setVar("DEPENDS", depends)
+
+ uarch = d.getVar("UBOOT_ARCH")
+ if uarch == "arm64":
+ replacementtype = "Image"
+ elif uarch == "mips":
+ replacementtype = "vmlinuz.bin"
+ elif uarch == "x86":
+ replacementtype = "bzImage"
+ elif uarch == "microblaze":
+ replacementtype = "linux.bin"
+ else:
+ replacementtype = "zImage"
+
+ # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
+ # to kernel.bbclass . We have to override it, since we pack zImage
+ # (at least for now) into the fitImage .
+ typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
+ if 'fitImage' in typeformake.split():
+ d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('fitImage', replacementtype))
+
+ image = d.getVar('INITRAMFS_IMAGE')
+ if image:
+ d.appendVarFlag('do_assemble_fitimage_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
+
+ # Verified boot will sign the fitImage and append the public key to
+ # U-Boot dtb. We ensure the U-Boot dtb is deployed before assembling
+ # the fitImage:
+ if d.getVar('UBOOT_SIGN_ENABLE') == "1":
+ uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
+ d.appendVarFlag('do_assemble_fitimage', 'depends', ' %s:do_deploy' % uboot_pn)
+}
+
+# Options for the device tree compiler passed to mkimage '-D' feature:
+UBOOT_MKIMAGE_DTCOPTS ??= ""
+
+#
+# Emit the fitImage ITS header
+#
+# $1 ... .its filename
+fitimage_emit_fit_header() {
+ cat << EOF >> ${1}
+/dts-v1/;
+
+/ {
+ description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";
+ #address-cells = <1>;
+EOF
+}
+
+#
+# Emit the fitImage section bits
+#
+# $1 ... .its filename
+# $2 ... Section bit type: imagestart - image section start
+# confstart - configuration section start
+# sectend - section end
+# fitend - fitimage end
+#
+fitimage_emit_section_maint() {
+ case $2 in
+ imagestart)
+ cat << EOF >> ${1}
+
+ images {
+EOF
+ ;;
+ confstart)
+ cat << EOF >> ${1}
+
+ configurations {
+EOF
+ ;;
+ sectend)
+ cat << EOF >> ${1}
+ };
+EOF
+ ;;
+ fitend)
+ cat << EOF >> ${1}
+};
+EOF
+ ;;
+ esac
+}
+
+#
+# Emit the fitImage ITS kernel section
+#
+# $1 ... .its filename
+# $2 ... Image counter
+# $3 ... Path to kernel image
+# $4 ... Compression type
+fitimage_emit_section_kernel() {
+
+ kernel_csum="sha1"
+
+ ENTRYPOINT="${UBOOT_ENTRYPOINT}"
+ if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+ ENTRYPOINT=`${HOST_PREFIX}nm vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
+ fi
+
+ cat << EOF >> ${1}
+ kernel@${2} {
+ description = "Linux kernel";
+ data = /incbin/("${3}");
+ type = "kernel";
+ arch = "${UBOOT_ARCH}";
+ os = "linux";
+ compression = "${4}";
+ load = <${UBOOT_LOADADDRESS}>;
+ entry = <${ENTRYPOINT}>;
+ hash@1 {
+ algo = "${kernel_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS DTB section
+#
+# $1 ... .its filename
+# $2 ... Image counter
+# $3 ... Path to DTB image
+fitimage_emit_section_dtb() {
+
+ dtb_csum="sha1"
+
+ cat << EOF >> ${1}
+ fdt@${2} {
+ description = "Flattened Device Tree blob";
+ data = /incbin/("${3}");
+ type = "flat_dt";
+ arch = "${UBOOT_ARCH}";
+ compression = "none";
+ hash@1 {
+ algo = "${dtb_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS setup section
+#
+# $1 ... .its filename
+# $2 ... Image counter
+# $3 ... Path to setup image
+fitimage_emit_section_setup() {
+
+ setup_csum="sha1"
+
+ cat << EOF >> ${1}
+ setup@${2} {
+ description = "Linux setup.bin";
+ data = /incbin/("${3}");
+ type = "x86_setup";
+ arch = "${UBOOT_ARCH}";
+ os = "linux";
+ compression = "none";
+ load = <0x00090000>;
+ entry = <0x00090000>;
+ hash@1 {
+ algo = "${setup_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS ramdisk section
+#
+# $1 ... .its filename
+# $2 ... Image counter
+# $3 ... Path to ramdisk image
+fitimage_emit_section_ramdisk() {
+
+ ramdisk_csum="sha1"
+ ramdisk_ctype="none"
+ ramdisk_loadline=""
+ ramdisk_entryline=""
+
+ if [ -n "${UBOOT_RD_LOADADDRESS}" ]; then
+ ramdisk_loadline="load = <${UBOOT_RD_LOADADDRESS}>;"
+ fi
+ if [ -n "${UBOOT_RD_ENTRYPOINT}" ]; then
+ ramdisk_entryline="entry = <${UBOOT_RD_ENTRYPOINT}>;"
+ fi
+
+ case $3 in
+ *.gz)
+ ramdisk_ctype="gzip"
+ ;;
+ *.bz2)
+ ramdisk_ctype="bzip2"
+ ;;
+ *.lzma)
+ ramdisk_ctype="lzma"
+ ;;
+ *.lzo)
+ ramdisk_ctype="lzo"
+ ;;
+ *.lz4)
+ ramdisk_ctype="lz4"
+ ;;
+ esac
+
+ cat << EOF >> ${1}
+ ramdisk@${2} {
+ description = "${INITRAMFS_IMAGE}";
+ data = /incbin/("${3}");
+ type = "ramdisk";
+ arch = "${UBOOT_ARCH}";
+ os = "linux";
+ compression = "${ramdisk_ctype}";
+ ${ramdisk_loadline}
+ ${ramdisk_entryline}
+ hash@1 {
+ algo = "${ramdisk_csum}";
+ };
+ };
+EOF
+}
+
+#
+# Emit the fitImage ITS configuration section
+#
+# $1 ... .its filename
+# $2 ... Linux kernel ID
+# $3 ... DTB image name
+# $4 ... ramdisk ID
+# $5 ... config ID
+# $6 ... default flag
+fitimage_emit_section_config() {
+
+ conf_csum="sha1"
+ if [ -n "${UBOOT_SIGN_ENABLE}" ] ; then
+ conf_sign_keyname="${UBOOT_SIGN_KEYNAME}"
+ fi
+
+ # Test if we have any DTBs at all
+ conf_desc="Linux kernel"
+ kernel_line="kernel = \"kernel@${2}\";"
+ fdt_line=""
+ ramdisk_line=""
+ setup_line=""
+ default_line=""
+
+ if [ -n "${3}" ]; then
+ conf_desc="${conf_desc}, FDT blob"
+ fdt_line="fdt = \"fdt@${3}\";"
+ fi
+
+ if [ -n "${4}" ]; then
+ conf_desc="${conf_desc}, ramdisk"
+ ramdisk_line="ramdisk = \"ramdisk@${4}\";"
+ fi
+
+ if [ -n "${5}" ]; then
+ conf_desc="${conf_desc}, setup"
+ setup_line="setup = \"setup@${5}\";"
+ fi
+
+ if [ "${6}" = "1" ]; then
+ default_line="default = \"conf@${3}\";"
+ fi
+
+ cat << EOF >> ${1}
+ ${default_line}
+ conf@${3} {
+ description = "${6} ${conf_desc}";
+ ${kernel_line}
+ ${fdt_line}
+ ${ramdisk_line}
+ ${setup_line}
+ hash@1 {
+ algo = "${conf_csum}";
+ };
+EOF
+
+ if [ ! -z "${conf_sign_keyname}" ] ; then
+
+ sign_line="sign-images = \"kernel\""
+
+ if [ -n "${3}" ]; then
+ sign_line="${sign_line}, \"fdt\""
+ fi
+
+ if [ -n "${4}" ]; then
+ sign_line="${sign_line}, \"ramdisk\""
+ fi
+
+ if [ -n "${5}" ]; then
+ sign_line="${sign_line}, \"setup\""
+ fi
+
+ sign_line="${sign_line};"
+
+ cat << EOF >> ${1}
+ signature@1 {
+ algo = "${conf_csum},rsa2048";
+ key-name-hint = "${conf_sign_keyname}";
+ ${sign_line}
+ };
+EOF
+ fi
+
+ cat << EOF >> ${1}
+ };
+EOF
+}
+
+#
+# Assemble fitImage
+#
+# $1 ... .its filename
+# $2 ... fitImage name
+# $3 ... include ramdisk
+fitimage_assemble() {
+ kernelcount=1
+ dtbcount=""
+ DTBS=""
+ ramdiskcount=${3}
+ setupcount=""
+ rm -f ${1} arch/${ARCH}/boot/${2}
+
+ fitimage_emit_fit_header ${1}
+
+ #
+ # Step 1: Prepare a kernel image section.
+ #
+ fitimage_emit_section_maint ${1} imagestart
+
+ uboot_prep_kimage
+ fitimage_emit_section_kernel ${1} "${kernelcount}" linux.bin "${linux_comp}"
+
+ #
+ # Step 2: Prepare a DTB image section
+ #
+ if [ -n "${KERNEL_DEVICETREE}" ]; then
+ dtbcount=1
+ for DTB in ${KERNEL_DEVICETREE}; do
+ if echo ${DTB} | grep -q '/dts/'; then
+ bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+ DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+ fi
+ DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
+ if [ ! -e "${DTB_PATH}" ]; then
+ DTB_PATH="arch/${ARCH}/boot/${DTB}"
+ fi
+
+ DTB=$(echo "${DTB}" | tr '/' '_')
+ DTBS="${DTBS} ${DTB}"
+ fitimage_emit_section_dtb ${1} ${DTB} ${DTB_PATH}
+ done
+ fi
+
+ #
+ # Step 3: Prepare a setup section. (For x86)
+ #
+ if [ -e arch/${ARCH}/boot/setup.bin ]; then
+ setupcount=1
+ fitimage_emit_section_setup ${1} "${setupcount}" arch/${ARCH}/boot/setup.bin
+ fi
+
+ #
+ # Step 4: Prepare a ramdisk section.
+ #
+ if [ "x${ramdiskcount}" = "x1" ] ; then
+ # Find and use the first initramfs image archive type we find
+ for img in cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.gz cpio; do
+ initramfs_path="${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.${img}"
+ echo "Using $initramfs_path"
+ if [ -e "${initramfs_path}" ]; then
+ fitimage_emit_section_ramdisk ${1} "${ramdiskcount}" "${initramfs_path}"
+ break
+ fi
+ done
+ fi
+
+ fitimage_emit_section_maint ${1} sectend
+
+ # Force the first Kernel and DTB in the default config
+ kernelcount=1
+ if [ -n "${dtbcount}" ]; then
+ dtbcount=1
+ fi
+
+ #
+ # Step 5: Prepare a configurations section
+ #
+ fitimage_emit_section_maint ${1} confstart
+
+ if [ -n "${DTBS}" ]; then
+ i=1
+ for DTB in ${DTBS}; do
+ fitimage_emit_section_config ${1} "${kernelcount}" "${DTB}" "${ramdiskcount}" "${setupcount}" "`expr ${i} = ${dtbcount}`"
+ i=`expr ${i} + 1`
+ done
+ fi
+
+ fitimage_emit_section_maint ${1} sectend
+
+ fitimage_emit_section_maint ${1} fitend
+
+ #
+ # Step 6: Assemble the image
+ #
+ uboot-mkimage \
+ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
+ -f ${1} \
+ arch/${ARCH}/boot/${2}
+
+ #
+ # Step 7: Sign the image and add public key to U-Boot dtb
+ #
+ if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
+ uboot-mkimage \
+ ${@'-D "${UBOOT_MKIMAGE_DTCOPTS}"' if len('${UBOOT_MKIMAGE_DTCOPTS}') else ''} \
+ -F -k "${UBOOT_SIGN_KEYDIR}" \
+ -K "${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_BINARY}" \
+ -r arch/${ARCH}/boot/${2}
+ fi
+}
+
+do_assemble_fitimage() {
+ if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
+ cd ${B}
+ fitimage_assemble fit-image.its fitImage
+ fi
+}
+
+addtask assemble_fitimage before do_install after do_compile
+
+do_assemble_fitimage_initramfs() {
+ if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage" && \
+ test -n "${INITRAMFS_IMAGE}" ; then
+ cd ${B}
+ fitimage_assemble fit-image-${INITRAMFS_IMAGE}.its fitImage-${INITRAMFS_IMAGE} 1
+ fi
+}
+
+addtask assemble_fitimage_initramfs before do_deploy after do_install
+
+
+kernel_do_deploy[vardepsexclude] = "DATETIME"
+kernel_do_deploy_append() {
+ # Update deploy directory
+ if echo ${KERNEL_IMAGETYPES} | grep -wq "fitImage"; then
+ cd ${B}
+ echo "Copying fit-image.its source file..."
+ its_base_name="fitImage-its-${PV}-${PR}-${MACHINE}-${DATETIME}"
+ its_symlink_name=fitImage-its-${MACHINE}
+ install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its
+ linux_bin_base_name="fitImage-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}"
+ linux_bin_symlink_name=fitImage-linux.bin-${MACHINE}
+ install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin
+
+ if [ -n "${INITRAMFS_IMAGE}" ]; then
+ echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
+ its_initramfs_base_name="fitImage-its-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
+ its_initramfs_symlink_name=fitImage-its-${INITRAMFS_IMAGE_NAME}
+ install -m 0644 fit-image-${INITRAMFS_IMAGE}.its ${DEPLOYDIR}/${its_initramfs_base_name}.its
+ fit_initramfs_base_name="fitImage-${INITRAMFS_IMAGE_NAME}-${PV}-${PR}-${DATETIME}"
+ fit_initramfs_symlink_name=fitImage-${INITRAMFS_IMAGE_NAME}
+ install -m 0644 arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} ${DEPLOYDIR}/${fit_initramfs_base_name}.bin
+ fi
+
+ cd ${DEPLOYDIR}
+ ln -sf ${its_base_name}.its ${its_symlink_name}.its
+ ln -sf ${linux_bin_base_name}.bin ${linux_bin_symlink_name}.bin
+
+ if [ -n "${INITRAMFS_IMAGE}" ]; then
+ ln -sf ${its_initramfs_base_name}.its ${its_initramfs_symlink_name}.its
+ ln -sf ${fit_initramfs_base_name}.bin ${fit_initramfs_symlink_name}.bin
+ fi
+ fi
+}
diff --git a/poky/meta/classes/kernel-grub.bbclass b/poky/meta/classes/kernel-grub.bbclass
new file mode 100644
index 000000000..5d92f3b63
--- /dev/null
+++ b/poky/meta/classes/kernel-grub.bbclass
@@ -0,0 +1,105 @@
+#
+# While installing a rpm to update kernel on a deployed target, it will update
+# the boot area and the boot menu with the kernel as the priority but allow
+# you to fall back to the original kernel as well.
+#
+# - In kernel-image's preinstall scriptlet, it backs up original kernel to avoid
+# probable confliction with the new one.
+#
+# - In kernel-image's postinstall scriptlet, it modifies grub's config file to
+# updates the new kernel as the boot priority.
+#
+
+python __anonymous () {
+ import re
+
+ preinst = '''
+ # Parsing confliction
+ [ -f "$D/boot/grub/menu.list" ] && grubcfg="$D/boot/grub/menu.list"
+ [ -f "$D/boot/grub/grub.cfg" ] && grubcfg="$D/boot/grub/grub.cfg"
+ if [ -n "$grubcfg" ]; then
+ # Dereference symlink to avoid confliction with new kernel name.
+ if grep -q "/KERNEL_IMAGETYPE \+root=" $grubcfg; then
+ if [ -L "$D/boot/KERNEL_IMAGETYPE" ]; then
+ kimage=`realpath $D/boot/KERNEL_IMAGETYPE 2>/dev/null`
+ if [ -f "$D$kimage" ]; then
+ sed -i "s:KERNEL_IMAGETYPE \+root=:${kimage##*/} root=:" $grubcfg
+ fi
+ fi
+ fi
+
+ # Rename old kernel if it conflicts with new kernel name.
+ if grep -q "/KERNEL_IMAGETYPE-${KERNEL_VERSION} \+root=" $grubcfg; then
+ if [ -f "$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}" ]; then
+ timestamp=`date +%s`
+ kimage="$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}-$timestamp-back"
+ sed -i "s:KERNEL_IMAGETYPE-${KERNEL_VERSION} \+root=:${kimage##*/} root=:" $grubcfg
+ mv "$D/boot/KERNEL_IMAGETYPE-${KERNEL_VERSION}" "$kimage"
+ fi
+ fi
+ fi
+'''
+
+ postinst = '''
+ get_new_grub_cfg() {
+ grubcfg="$1"
+ old_image="$2"
+ title="Update KERNEL_IMAGETYPE-${KERNEL_VERSION}-${PV}"
+ if [ "${grubcfg##*/}" = "grub.cfg" ]; then
+ rootfs=`grep " *linux \+[^ ]\+ \+root=" $grubcfg -m 1 | \
+ sed "s#${old_image}#${old_image%/*}/KERNEL_IMAGETYPE-${KERNEL_VERSION}#"`
+
+ echo "menuentry \"$title\" {"
+ echo " set root=(hd0,1)"
+ echo "$rootfs"
+ echo "}"
+ elif [ "${grubcfg##*/}" = "menu.list" ]; then
+ rootfs=`grep "kernel \+[^ ]\+ \+root=" $grubcfg -m 1 | \
+ sed "s#${old_image}#${old_image%/*}/KERNEL_IMAGETYPE-${KERNEL_VERSION}#"`
+
+ echo "default 0"
+ echo "timeout 30"
+ echo "title $title"
+ echo "root (hd0,0)"
+ echo "$rootfs"
+ fi
+ }
+
+ get_old_grub_cfg() {
+ grubcfg="$1"
+ if [ "${grubcfg##*/}" = "grub.cfg" ]; then
+ cat "$grubcfg"
+ elif [ "${grubcfg##*/}" = "menu.list" ]; then
+ sed -e '/^default/d' -e '/^timeout/d' "$grubcfg"
+ fi
+ }
+
+ if [ -f "$D/boot/grub/grub.cfg" ]; then
+ grubcfg="$D/boot/grub/grub.cfg"
+ old_image=`grep ' *linux \+[^ ]\+ \+root=' -m 1 "$grubcfg" | awk '{print $2}'`
+ elif [ -f "$D/boot/grub/menu.list" ]; then
+ grubcfg="$D/boot/grub/menu.list"
+ old_image=`grep '^kernel \+[^ ]\+ \+root=' -m 1 "$grubcfg" | awk '{print $2}'`
+ fi
+
+ # Don't update grubcfg at first install while old bzImage doesn't exist.
+ if [ -f "$D/boot/${old_image##*/}" ]; then
+ grubcfgtmp="$grubcfg.tmp"
+ get_new_grub_cfg "$grubcfg" "$old_image" > $grubcfgtmp
+ get_old_grub_cfg "$grubcfg" >> $grubcfgtmp
+ mv $grubcfgtmp $grubcfg
+ echo "Caution! Update kernel may affect kernel-module!"
+ fi
+'''
+
+ imagetypes = d.getVar('KERNEL_IMAGETYPES')
+ imagetypes = re.sub(r'\.gz$', '', imagetypes)
+
+ for type in imagetypes.split():
+ typelower = type.lower()
+ preinst_append = preinst.replace('KERNEL_IMAGETYPE', type)
+ postinst_prepend = postinst.replace('KERNEL_IMAGETYPE', type)
+ d.setVar('pkg_preinst_kernel-image-' + typelower + '_append', preinst_append)
+ d.setVar('pkg_postinst_kernel-image-' + typelower + '_prepend', postinst_prepend)
+}
+
diff --git a/poky/meta/classes/kernel-module-split.bbclass b/poky/meta/classes/kernel-module-split.bbclass
new file mode 100644
index 000000000..67ab4161d
--- /dev/null
+++ b/poky/meta/classes/kernel-module-split.bbclass
@@ -0,0 +1,158 @@
+pkg_postinst_modules () {
+if [ -z "$D" ]; then
+ depmod -a ${KERNEL_VERSION}
+else
+ # image.bbclass will call depmodwrapper after everything is installed,
+ # no need to do it here as well
+ :
+fi
+}
+
+pkg_postrm_modules () {
+if [ -z "$D" ]; then
+ depmod -a ${KERNEL_VERSION}
+else
+ depmodwrapper -a -b $D ${KERNEL_VERSION}
+fi
+}
+
+autoload_postinst_fragment() {
+if [ x"$D" = "x" ]; then
+ modprobe %s || true
+fi
+}
+
+PACKAGE_WRITE_DEPS += "kmod-native depmodwrapper-cross"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_module_packages "
+
+KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-modules"
+
+KERNEL_MODULE_PACKAGE_PREFIX ?= ""
+KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${KERNEL_VERSION}"
+KERNEL_MODULE_PROVIDE_VIRTUAL ?= "1"
+
+python split_kernel_module_packages () {
+ import re
+
+ modinfoexp = re.compile("([^=]+)=(.*)")
+
+ def extract_modinfo(file):
+ import tempfile, subprocess
+ tempfile.tempdir = d.getVar("WORKDIR")
+ tf = tempfile.mkstemp()
+ tmpfile = tf[1]
+ cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX") or "", file, tmpfile)
+ subprocess.check_call(cmd, shell=True)
+ f = open(tmpfile)
+ l = f.read().split("\000")
+ f.close()
+ os.close(tf[0])
+ os.unlink(tmpfile)
+ vals = {}
+ for i in l:
+ m = modinfoexp.match(i)
+ if not m:
+ continue
+ vals[m.group(1)] = m.group(2)
+ return vals
+
+ def frob_metadata(file, pkg, pattern, format, basename):
+ vals = extract_modinfo(file)
+
+ dvar = d.getVar('PKGD')
+
+ # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
+ # appropriate modprobe commands to the postinst
+ autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD") or "").split()
+ autoload = d.getVar('module_autoload_%s' % basename)
+ if autoload and autoload == basename:
+ bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename)
+ if autoload and basename not in autoloadlist:
+ bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
+ if basename in autoloadlist:
+ name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
+ f = open(name, 'w')
+ if autoload:
+ for m in autoload.split():
+ f.write('%s\n' % m)
+ else:
+ f.write('%s\n' % basename)
+ f.close()
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ bb.fatal("pkg_postinst_%s not defined" % pkg)
+ postinst += d.getVar('autoload_postinst_fragment') % (autoload or basename)
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ # Write out any modconf fragment
+ modconflist = (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()
+ modconf = d.getVar('module_conf_%s' % basename)
+ if modconf and basename in modconflist:
+ name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
+ f = open(name, 'w')
+ f.write("%s\n" % modconf)
+ f.close()
+ elif modconf:
+ bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
+
+ files = d.getVar('FILES_%s' % pkg)
+ files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
+ d.setVar('FILES_%s' % pkg, files)
+
+ if "description" in vals:
+ old_desc = d.getVar('DESCRIPTION_' + pkg) or ""
+ d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
+
+ rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
+ modinfo_deps = []
+ if "depends" in vals and vals["depends"] != "":
+ for dep in vals["depends"].split(","):
+ on = legitimize_package_name(dep)
+ dependency_pkg = format % on
+ modinfo_deps.append(dependency_pkg)
+ for dep in modinfo_deps:
+ if not dep in rdepends:
+ rdepends[dep] = []
+ d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+
+ # Avoid automatic -dev recommendations for modules ending with -dev.
+ d.setVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', 1)
+
+ # Provide virtual package without postfix
+ providevirt = d.getVar('KERNEL_MODULE_PROVIDE_VIRTUAL')
+ if providevirt == "1":
+ postfix = format.split('%s')[1]
+ d.setVar('RPROVIDES_' + pkg, pkg.replace(postfix, ''))
+
+ kernel_package_name = d.getVar("KERNEL_PACKAGE_NAME") or "kernel"
+ kernel_version = d.getVar("KERNEL_VERSION")
+
+ module_regex = '^(.*)\.k?o$'
+
+ module_pattern_prefix = d.getVar('KERNEL_MODULE_PACKAGE_PREFIX')
+ module_pattern_suffix = d.getVar('KERNEL_MODULE_PACKAGE_SUFFIX')
+ module_pattern = module_pattern_prefix + kernel_package_name + '-module-%s' + module_pattern_suffix
+
+ postinst = d.getVar('pkg_postinst_modules')
+ postrm = d.getVar('pkg_postrm_modules')
+
+ modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, kernel_version))
+ if modules:
+ metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE')
+ d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
+
+ # If modules-load.d and modprobe.d are empty at this point, remove them to
+ # avoid warnings. removedirs only raises an OSError if an empty
+ # directory cannot be removed.
+ dvar = d.getVar('PKGD')
+ for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar), "%s/etc" % (dvar)]:
+ if len(os.listdir(dir)) == 0:
+ os.rmdir(dir)
+}
+
+do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()))}'
diff --git a/poky/meta/classes/kernel-uboot.bbclass b/poky/meta/classes/kernel-uboot.bbclass
new file mode 100644
index 000000000..2364053f3
--- /dev/null
+++ b/poky/meta/classes/kernel-uboot.bbclass
@@ -0,0 +1,30 @@
+uboot_prep_kimage() {
+ if [ -e arch/${ARCH}/boot/compressed/vmlinux ]; then
+ vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
+ linux_suffix=""
+ linux_comp="none"
+ elif [ -e arch/${ARCH}/boot/Image ] ; then
+ vmlinux_path="vmlinux"
+ linux_suffix=""
+ linux_comp="none"
+ elif [ -e arch/${ARCH}/boot/vmlinuz.bin ]; then
+ rm -f linux.bin
+ cp -l arch/${ARCH}/boot/vmlinuz.bin linux.bin
+ vmlinux_path=""
+ linux_suffix=""
+ linux_comp="none"
+ else
+ vmlinux_path="vmlinux"
+ linux_suffix=".gz"
+ linux_comp="gzip"
+ fi
+
+ [ -n "${vmlinux_path}" ] && ${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
+
+ if [ "${linux_comp}" != "none" ] ; then
+ gzip -9 linux.bin
+ mv -f "linux.bin${linux_suffix}" linux.bin
+ fi
+
+ echo "${linux_comp}"
+}
diff --git a/poky/meta/classes/kernel-uimage.bbclass b/poky/meta/classes/kernel-uimage.bbclass
new file mode 100644
index 000000000..1d8656e76
--- /dev/null
+++ b/poky/meta/classes/kernel-uimage.bbclass
@@ -0,0 +1,35 @@
+inherit kernel-uboot
+
+python __anonymous () {
+ if "uImage" in (d.getVar('KERNEL_IMAGETYPES') or "").split():
+ depends = d.getVar("DEPENDS")
+ depends = "%s u-boot-mkimage-native" % depends
+ d.setVar("DEPENDS", depends)
+
+ # Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
+ # to kernel.bbclass . We override the variable here, since we need
+ # to build uImage using the kernel build system if and only if
+ # KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into
+ # the uImage .
+ if d.getVar("KEEPUIMAGE") != 'yes':
+ typeformake = d.getVar("KERNEL_IMAGETYPE_FOR_MAKE") or ""
+ if "uImage" in typeformake.split():
+ d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake.replace('uImage', 'vmlinux'))
+
+ # Enable building of uImage with mkimage
+ bb.build.addtask('do_uboot_mkimage', 'do_install', 'do_kernel_link_images', d)
+}
+
+do_uboot_mkimage[dirs] += "${B}"
+do_uboot_mkimage() {
+ uboot_prep_kimage
+
+ ENTRYPOINT=${UBOOT_ENTRYPOINT}
+ if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then
+ ENTRYPOINT=`${HOST_PREFIX}nm ${B}/vmlinux | \
+ awk '$3=="${UBOOT_ENTRYSYMBOL}" {print "0x"$1;exit}'`
+ fi
+
+ uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${B}/arch/${ARCH}/boot/uImage
+ rm -f linux.bin
+}
diff --git a/poky/meta/classes/kernel-yocto.bbclass b/poky/meta/classes/kernel-yocto.bbclass
new file mode 100644
index 000000000..82d80741a
--- /dev/null
+++ b/poky/meta/classes/kernel-yocto.bbclass
@@ -0,0 +1,406 @@
+# remove tasks that modify the source tree in case externalsrc is inherited
+SRCTREECOVEREDTASKS += "do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
+PATCH_GIT_USER_EMAIL ?= "kernel-yocto@oe"
+PATCH_GIT_USER_NAME ?= "OpenEmbedded"
+
+# returns local (absolute) path names for all valid patches in the
+# src_uri
+def find_patches(d):
+ patches = src_patches(d)
+ patch_list=[]
+ for p in patches:
+ _, _, local, _, _, _ = bb.fetch.decodeurl(p)
+ patch_list.append(local)
+
+ return patch_list
+
+# returns all the elements from the src uri that are .scc files
+def find_sccs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ base, ext = os.path.splitext(os.path.basename(s))
+ if ext and ext in [".scc", ".cfg"]:
+ sources_list.append(s)
+ elif base and base in 'defconfig':
+ sources_list.append(s)
+
+ return sources_list
+
+# check the SRC_URI for "kmeta" type'd git repositories. Return the name of
+# the repository as it will be found in WORKDIR
+def find_kernel_feature_dirs(d):
+ feature_dirs=[]
+ fetch = bb.fetch2.Fetch([], d)
+ for url in fetch.urls:
+ urldata = fetch.ud[url]
+ parm = urldata.parm
+ type=""
+ if "type" in parm:
+ type = parm["type"]
+ if "destsuffix" in parm:
+ destdir = parm["destsuffix"]
+ if type == "kmeta":
+ feature_dirs.append(destdir)
+
+ return feature_dirs
+
+# find the master/machine source branch. In the same way that the fetcher proceses
+# git repositories in the SRC_URI we take the first repo found, first branch.
+def get_machine_branch(d, default):
+ fetch = bb.fetch2.Fetch([], d)
+ for url in fetch.urls:
+ urldata = fetch.ud[url]
+ parm = urldata.parm
+ if "branch" in parm:
+ branches = urldata.parm.get("branch").split(',')
+ btype = urldata.parm.get("type")
+ if btype != "kmeta":
+ return branches[0]
+
+ return default
+
+do_kernel_metadata() {
+ set +e
+ cd ${S}
+ export KMETA=${KMETA}
+
+ # if kernel tools are available in-tree, they are preferred
+ # and are placed on the path before any external tools. Unless
+ # the external tools flag is set, in that case we do nothing.
+ if [ -f "${S}/scripts/util/configme" ]; then
+ if [ -z "${EXTERNAL_KERNEL_TOOLS}" ]; then
+ PATH=${S}/scripts/util:${PATH}
+ fi
+ fi
+
+ machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+ machine_srcrev="${SRCREV_machine}"
+ if [ -z "${machine_srcrev}" ]; then
+ # fallback to SRCREV if a non machine_meta tree is being built
+ machine_srcrev="${SRCREV}"
+ fi
+
+ # In a similar manner to the kernel itself:
+ #
+ # defconfig: $(obj)/conf
+ # ifeq ($(KBUILD_DEFCONFIG),)
+ # $< --defconfig $(Kconfig)
+ # else
+ # @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+ # $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+ # endif
+ #
+ # If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it
+ # from the source tree, into a common location and normalized "defconfig" name,
+ # where the rest of the process will include and incoroporate it into the build
+ #
+ # If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI),
+ # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take
+ # precendence.
+ #
+ if [ -n "${KBUILD_DEFCONFIG}" ]; then
+ if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
+ if [ -f "${WORKDIR}/defconfig" ]; then
+ # If the two defconfig's are different, warn that we didn't overwrite the
+ # one already placed in WORKDIR by the fetcher.
+ cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
+ if [ $? -ne 0 ]; then
+ bbwarn "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped"
+ else
+ cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+ fi
+ else
+ cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+ fi
+ sccs="${WORKDIR}/defconfig"
+ else
+ bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
+ fi
+ fi
+
+ sccs_from_src_uri="${@" ".join(find_sccs(d))}"
+ patches="${@" ".join(find_patches(d))}"
+ feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
+
+ # a quick check to make sure we don't have duplicate defconfigs
+ # If there's a defconfig in the SRC_URI, did we also have one from
+ # the KBUILD_DEFCONFIG processing above ?
+ if [ -n "$sccs" ]; then
+ # we did have a defconfig from above. remove any that might be in the src_uri
+ sccs_from_src_uri=$(echo $sccs_from_src_uri | awk '{ if ($0!="defconfig") { print $0 } }' RS=' ')
+ fi
+ sccs="$sccs $sccs_from_src_uri"
+
+ # check for feature directories/repos/branches that were part of the
+ # SRC_URI. If they were supplied, we convert them into include directives
+ # for the update part of the process
+ for f in ${feat_dirs}; do
+ if [ -d "${WORKDIR}/$f/meta" ]; then
+ includes="$includes -I${WORKDIR}/$f/kernel-meta"
+ elif [ -d "${WORKDIR}/$f" ]; then
+ includes="$includes -I${WORKDIR}/$f"
+ fi
+ done
+ for s in ${sccs} ${patches}; do
+ sdir=$(dirname $s)
+ includes="$includes -I${sdir}"
+ # if a SRC_URI passed patch or .scc has a subdir of "kernel-meta",
+ # then we add it to the search path
+ if [ -d "${sdir}/kernel-meta" ]; then
+ includes="$includes -I${sdir}/kernel-meta"
+ fi
+ done
+
+ # expand kernel features into their full path equivalents
+ bsp_definition=$(spp ${includes} --find -DKMACHINE=${KMACHINE} -DKTYPE=${LINUX_KERNEL_TYPE})
+ if [ -z "$bsp_definition" ]; then
+ echo "$sccs" | grep -q defconfig
+ if [ $? -ne 0 ]; then
+ bbfatal_log "Could not locate BSP definition for ${KMACHINE}/${LINUX_KERNEL_TYPE} and no defconfig was provided"
+ fi
+ fi
+ meta_dir=$(kgit --meta)
+
+ # run1: pull all the configuration fragments, no matter where they come from
+ elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`"
+ if [ -n "${elements}" ]; then
+ echo "${bsp_definition}" > ${S}/${meta_dir}/bsp_definition
+ scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+ if [ $? -ne 0 ]; then
+ bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
+ fi
+ fi
+
+ # run2: only generate patches for elements that have been passed on the SRC_URI
+ elements="`echo -n ${sccs} ${patches} ${KERNEL_FEATURES}`"
+ if [ -n "${elements}" ]; then
+ scc --force -o ${S}/${meta_dir}:patch --cmds patch ${includes} ${sccs} ${patches} ${KERNEL_FEATURES}
+ if [ $? -ne 0 ]; then
+ bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
+ fi
+ fi
+}
+
+do_patch() {
+ set +e
+ cd ${S}
+
+ check_git_config
+ meta_dir=$(kgit --meta)
+ (cd ${meta_dir}; ln -sf patch.queue series)
+ if [ -f "${meta_dir}/series" ]; then
+ kgit-s2q --gen -v --patches .kernel-meta/
+ if [ $? -ne 0 ]; then
+ bberror "Could not apply patches for ${KMACHINE}."
+ bbfatal_log "Patch failures can be resolved in the linux source directory ${S})"
+ fi
+ fi
+
+ if [ -f "${meta_dir}/merge.queue" ]; then
+ # we need to merge all these branches
+ for b in $(cat ${meta_dir}/merge.queue); do
+ git show-ref --verify --quiet refs/heads/${b}
+ if [ $? -eq 0 ]; then
+ bbnote "Merging branch ${b}"
+ git merge -q --no-ff -m "Merge branch ${b}" ${b}
+ else
+ bbfatal "branch ${b} does not exist, cannot merge"
+ fi
+ done
+ fi
+}
+
+do_kernel_checkout() {
+ set +e
+
+ source_dir=`echo ${S} | sed 's%/$%%'`
+ source_workdir="${WORKDIR}/git"
+ if [ -d "${WORKDIR}/git/" ]; then
+ # case: git repository
+ # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
+ if [ "${source_dir}" != "${source_workdir}" ]; then
+ if [ -d "${source_workdir}/.git" ]; then
+ # regular git repository with .git
+ rm -rf ${S}
+ mv ${WORKDIR}/git ${S}
+ else
+ # create source for bare cloned git repository
+ git clone ${WORKDIR}/git ${S}
+ rm -rf ${WORKDIR}/git
+ fi
+ fi
+ cd ${S}
+ else
+ # case: we have no git repository at all.
+ # To support low bandwidth options for building the kernel, we'll just
+ # convert the tree to a git repo and let the rest of the process work unchanged
+
+ # if ${S} hasn't been set to the proper subdirectory a default of "linux" is
+ # used, but we can't initialize that empty directory. So check it and throw a
+ # clear error
+
+ cd ${S}
+ if [ ! -f "Makefile" ]; then
+ bberror "S is not set to the linux source directory. Check "
+ bbfatal "the recipe and set S to the proper extracted subdirectory"
+ fi
+ rm -f .gitignore
+ git init
+ check_git_config
+ git add .
+ git commit -q -m "baseline commit: creating repo for ${PN}-${PV}"
+ git clean -d -f
+ fi
+
+ # convert any remote branches to local tracking ones
+ for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
+ b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
+ git show-ref --quiet --verify -- "refs/heads/$b"
+ if [ $? -ne 0 ]; then
+ git branch $b $i > /dev/null
+ fi
+ done
+
+ # Create a working tree copy of the kernel by checking out a branch
+ machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+
+ # checkout and clobber any unimportant files
+ git checkout -f ${machine_branch}
+}
+do_kernel_checkout[dirs] = "${S}"
+
+addtask kernel_checkout before do_kernel_metadata after do_unpack
+addtask kernel_metadata after do_validate_branches do_unpack before do_patch
+do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
+do_validate_branches[depends] = "kern-tools-native:do_populate_sysroot"
+
+do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}binutils:do_populate_sysroot"
+do_kernel_configme[depends] += "virtual/${TARGET_PREFIX}gcc:do_populate_sysroot"
+do_kernel_configme[depends] += "bc-native:do_populate_sysroot bison-native:do_populate_sysroot"
+do_kernel_configme[dirs] += "${S} ${B}"
+do_kernel_configme() {
+ set +e
+
+ # translate the kconfig_mode into something that merge_config.sh
+ # understands
+ case ${KCONFIG_MODE} in
+ *allnoconfig)
+ config_flags="-n"
+ ;;
+ *alldefconfig)
+ config_flags=""
+ ;;
+ *)
+ if [ -f ${WORKDIR}/defconfig ]; then
+ config_flags="-n"
+ fi
+ ;;
+ esac
+
+ cd ${S}
+
+ meta_dir=$(kgit --meta)
+ configs="$(scc --configs -o ${meta_dir})"
+ if [ $? -ne 0 ]; then
+ bberror "${configs}"
+ bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)"
+ fi
+
+ CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1
+ if [ $? -ne 0 ]; then
+ bbfatal_log "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
+ fi
+
+ echo "# Global settings from linux recipe" >> ${B}/.config
+ echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
+}
+
+addtask kernel_configme before do_configure after do_patch
+
+python do_kernel_configcheck() {
+ import re, string, sys
+
+ # if KMETA isn't set globally by a recipe using this routine, we need to
+ # set the default to 'meta'. Otherwise, kconf_check is not passed a valid
+ # meta-series for processing
+ kmeta = d.getVar("KMETA") or "meta"
+ if not os.path.exists(kmeta):
+ kmeta = "." + kmeta
+
+ pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH'), "${S}/scripts/util/")
+
+ cmd = d.expand("scc --configs -o ${S}/.kernel-meta")
+ ret, configs = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
+
+ cmd = d.expand("cd ${S}; kconf_check --report -o ${S}/%s/cfg/ ${B}/.config ${S} %s" % (kmeta,configs))
+ ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
+
+ config_check_visibility = int(d.getVar("KCONF_AUDIT_LEVEL") or 0)
+ bsp_check_visibility = int(d.getVar("KCONF_BSP_AUDIT_LEVEL") or 0)
+
+ # if config check visibility is non-zero, report dropped configuration values
+ mismatch_file = d.expand("${S}/%s/cfg/mismatch.txt" % kmeta)
+ if os.path.exists(mismatch_file):
+ if config_check_visibility:
+ with open (mismatch_file, "r") as myfile:
+ results = myfile.read()
+ bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results)
+}
+
+# Ensure that the branches (BSP and meta) are on the locations specified by
+# their SRCREV values. If they are NOT on the right commits, the branches
+# are corrected to the proper commit.
+do_validate_branches() {
+ set +e
+ cd ${S}
+
+ machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+ machine_srcrev="${SRCREV_machine}"
+
+ # if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
+ # check and we can exit early
+ if [ "${machine_srcrev}" = "AUTOINC" ]; then
+ bbnote "SRCREV validation is not required for AUTOREV"
+ elif [ "${machine_srcrev}" = "" ]; then
+ if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then
+ # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe
+ # that doesn't use the SRCREV_FORMAT "machine_meta" is being built. In
+ # this case, we need to reset to the give SRCREV before heading to patching
+ bbnote "custom recipe is being built, forcing SRCREV to ${SRCREV}"
+ force_srcrev="${SRCREV}"
+ fi
+ else
+ git cat-file -t ${machine_srcrev} > /dev/null
+ if [ $? -ne 0 ]; then
+ bberror "${machine_srcrev} is not a valid commit ID."
+ bbfatal_log "The kernel source tree may be out of sync"
+ fi
+ force_srcrev=${machine_srcrev}
+ fi
+
+ git checkout -q -f ${machine_branch}
+ if [ -n "${force_srcrev}" ]; then
+ # see if the branch we are about to patch has been properly reset to the defined
+ # SRCREV .. if not, we reset it.
+ branch_head=`git rev-parse HEAD`
+ if [ "${force_srcrev}" != "${branch_head}" ]; then
+ current_branch=`git rev-parse --abbrev-ref HEAD`
+ git branch "$current_branch-orig"
+ git reset --hard ${force_srcrev}
+ # We've checked out HEAD, make sure we cleanup kgit-s2q fence post check
+ # so the patches are applied as expected otherwise no patching
+ # would be done in some corner cases.
+ kgit-s2q --clean
+ fi
+ fi
+}
+
+OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
+KBUILD_OUTPUT = "${B}"
+
+python () {
+ # If diffconfig is available, ensure it runs after kernel_configme
+ if 'do_diffconfig' in d:
+ bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d)
+}
diff --git a/poky/meta/classes/kernel.bbclass b/poky/meta/classes/kernel.bbclass
new file mode 100644
index 000000000..727851401
--- /dev/null
+++ b/poky/meta/classes/kernel.bbclass
@@ -0,0 +1,713 @@
+inherit linux-kernel-base kernel-module-split
+
+KERNEL_PACKAGE_NAME ??= "kernel"
+KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
+
+PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native bison-native"
+PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
+
+do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot"
+
+CVE_PRODUCT ?= "linux_kernel"
+
+S = "${STAGING_KERNEL_DIR}"
+B = "${WORKDIR}/build"
+KBUILD_OUTPUT = "${B}"
+OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
+
+# we include gcc above, we dont need virtual/libc
+INHIBIT_DEFAULT_DEPS = "1"
+
+KERNEL_IMAGETYPE ?= "zImage"
+INITRAMFS_IMAGE ?= ""
+INITRAMFS_IMAGE_NAME ?= "${@['${INITRAMFS_IMAGE}-${MACHINE}', ''][d.getVar('INITRAMFS_IMAGE') == '']}"
+INITRAMFS_TASK ?= ""
+INITRAMFS_IMAGE_BUNDLE ?= ""
+
+# KERNEL_VERSION is extracted from source code. It is evaluated as
+# None for the first parsing, since the code has not been fetched.
+# After the code is fetched, it will be evaluated as real version
+# number and cause kernel to be rebuilt. To avoid this, make
+# KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on
+# LINUX_VERSION which is a constant.
+KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}"
+KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}"
+KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
+KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
+
+python __anonymous () {
+ pn = d.getVar("PN")
+ kpn = d.getVar("KERNEL_PACKAGE_NAME")
+
+ # XXX Remove this after bug 11905 is resolved
+ # FILES_${KERNEL_PACKAGE_NAME}-dev doesn't expand correctly
+ if kpn == pn:
+ bb.warn("Some packages (E.g. *-dev) might be missing due to "
+ "bug 11905 (variable KERNEL_PACKAGE_NAME == PN)")
+
+ # The default kernel recipe builds in a shared location defined by
+ # bitbake/distro confs: STAGING_KERNEL_DIR and STAGING_KERNEL_BUILDDIR.
+ # Set these variables to directories under ${WORKDIR} in alternate
+ # kernel recipes (I.e. where KERNEL_PACKAGE_NAME != kernel) so that they
+ # may build in parallel with the default kernel without clobbering.
+ if kpn != "kernel":
+ workdir = d.getVar("WORKDIR")
+ sourceDir = os.path.join(workdir, 'kernel-source')
+ artifactsDir = os.path.join(workdir, 'kernel-build-artifacts')
+ d.setVar("STAGING_KERNEL_DIR", sourceDir)
+ d.setVar("STAGING_KERNEL_BUILDDIR", artifactsDir)
+
+ # Merge KERNEL_IMAGETYPE and KERNEL_ALT_IMAGETYPE into KERNEL_IMAGETYPES
+ type = d.getVar('KERNEL_IMAGETYPE') or ""
+ alttype = d.getVar('KERNEL_ALT_IMAGETYPE') or ""
+ types = d.getVar('KERNEL_IMAGETYPES') or ""
+ kname = d.getVar('KERNEL_PACKAGE_NAME') or "kernel"
+ if type not in types.split():
+ types = (type + ' ' + types).strip()
+ if alttype not in types.split():
+ types = (alttype + ' ' + types).strip()
+ d.setVar('KERNEL_IMAGETYPES', types)
+
+ # some commonly used kernel images aren't generated by the kernel build system, such as vmlinux.gz
+ # typeformake lists only valid kernel make targets, and post processing can be done after the kernel
+ # is built (such as using gzip to compress vmlinux)
+ typeformake = types.replace('vmlinux.gz', 'vmlinux')
+ d.setVar('KERNEL_IMAGETYPE_FOR_MAKE', typeformake)
+
+ for type in types.split():
+ typelower = type.lower()
+ imagedest = d.getVar('KERNEL_IMAGEDEST')
+
+ d.appendVar('PACKAGES', ' %s-image-%s' % (kname, typelower))
+
+ d.setVar('FILES_' + kname + '-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}' + ' /' + imagedest + '/' + type)
+
+ d.appendVar('RDEPENDS_%s-image' % kname, ' %s-image-%s' % (kname, typelower))
+
+ d.setVar('PKG_%s-image-%s' % (kname,typelower), '%s-image-%s-${KERNEL_VERSION_PKG_NAME}' % (kname, typelower))
+
+ d.setVar('ALLOW_EMPTY_%s-image-%s' % (kname, typelower), '1')
+
+ image = d.getVar('INITRAMFS_IMAGE')
+ if image:
+ d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_image_complete')
+
+ # NOTE: setting INITRAMFS_TASK is for backward compatibility
+ # The preferred method is to set INITRAMFS_IMAGE, because
+ # this INITRAMFS_TASK has circular dependency problems
+ # if the initramfs requires kernel modules
+ image_task = d.getVar('INITRAMFS_TASK')
+ if image_task:
+ d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
+}
+
+# Here we pull in all various kernel image types which we support.
+#
+# In case you're wondering why kernel.bbclass inherits the other image
+# types instead of the other way around, the reason for that is to
+# maintain compatibility with various currently existing meta-layers.
+# By pulling in the various kernel image types here, we retain the
+# original behavior of kernel.bbclass, so no meta-layers should get
+# broken.
+#
+# KERNEL_CLASSES by default pulls in kernel-uimage.bbclass, since this
+# used to be the default behavior when only uImage was supported. This
+# variable can be appended by users who implement support for new kernel
+# image types.
+
+KERNEL_CLASSES ?= " kernel-uimage "
+inherit ${KERNEL_CLASSES}
+
+# Old style kernels may set ${S} = ${WORKDIR}/git for example
+# We need to move these over to STAGING_KERNEL_DIR. We can't just
+# create the symlink in advance as the git fetcher can't cope with
+# the symlink.
+do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
+do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
+base_do_unpack_append () {
+ s = d.getVar("S")
+ if s[-1] == '/':
+ # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
+ s=s[:-1]
+ kernsrc = d.getVar("STAGING_KERNEL_DIR")
+ if s != kernsrc:
+ bb.utils.mkdirhier(kernsrc)
+ bb.utils.remove(kernsrc, recurse=True)
+ if d.getVar("EXTERNALSRC"):
+ # With EXTERNALSRC S will not be wiped so we can symlink to it
+ os.symlink(s, kernsrc)
+ else:
+ import shutil
+ shutil.move(s, kernsrc)
+ os.symlink(kernsrc, s)
+}
+
+inherit kernel-arch deploy
+
+PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-module-.*"
+PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-image-.*"
+PACKAGES_DYNAMIC += "^${KERNEL_PACKAGE_NAME}-firmware-.*"
+
+export OS = "${TARGET_OS}"
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+export KBUILD_BUILD_VERSION = "1"
+export KBUILD_BUILD_USER = "oe-user"
+export KBUILD_BUILD_HOST = "oe-host"
+
+KERNEL_RELEASE ?= "${KERNEL_VERSION}"
+
+# The directory where built kernel lies in the kernel tree
+KERNEL_OUTPUT_DIR ?= "arch/${ARCH}/boot"
+KERNEL_IMAGEDEST = "boot"
+
+#
+# configuration
+#
+export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE") or "ttyS0"}"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}"
+
+KERNEL_LOCALVERSION ?= ""
+
+# kernels are generally machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# U-Boot support
+UBOOT_ENTRYPOINT ?= "20008000"
+UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
+
+# Some Linux kernel configurations need additional parameters on the command line
+KERNEL_EXTRA_ARGS ?= ""
+
+EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
+KERNEL_ALT_IMAGETYPE ??= ""
+
+copy_initramfs() {
+ echo "Copying initramfs into ./usr ..."
+ # In case the directory is not created yet from the first pass compile:
+ mkdir -p ${B}/usr
+ # Find and use the first initramfs image archive type we find
+ rm -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
+ for img in cpio cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do
+ if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img" ]; then
+ cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.$img ${B}/usr/.
+ case $img in
+ *gz)
+ echo "gzip decompressing image"
+ gunzip -f ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+ break
+ ;;
+ *lz4)
+ echo "lz4 decompressing image"
+ lz4 -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+ break
+ ;;
+ *lzo)
+ echo "lzo decompressing image"
+ lzop -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+ break
+ ;;
+ *lzma)
+ echo "lzma decompressing image"
+ lzma -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+ break
+ ;;
+ *xz)
+ echo "xz decompressing image"
+ xz -df ${B}/usr/${INITRAMFS_IMAGE_NAME}.$img
+ break
+ ;;
+ esac
+ fi
+ done
+ echo "Finished copy of initramfs into ./usr"
+}
+
+INITRAMFS_BASE_NAME ?= "initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+do_bundle_initramfs () {
+ if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+ echo "Creating a kernel image with a bundled initramfs..."
+ copy_initramfs
+ # Backing up kernel image relies on its type(regular file or symbolic link)
+ tmp_path=""
+ for type in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
+ if [ -h ${KERNEL_OUTPUT_DIR}/$type ] ; then
+ linkpath=`readlink -n ${KERNEL_OUTPUT_DIR}/$type`
+ realpath=`readlink -fn ${KERNEL_OUTPUT_DIR}/$type`
+ mv -f $realpath $realpath.bak
+ tmp_path=$tmp_path" "$type"#"$linkpath"#"$realpath
+ elif [ -f ${KERNEL_OUTPUT_DIR}/$type ]; then
+ mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.bak
+ tmp_path=$tmp_path" "$type"##"
+ fi
+ done
+ use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
+ kernel_do_compile
+ # Restoring kernel image
+ for tp in $tmp_path ; do
+ type=`echo $tp|cut -d "#" -f 1`
+ linkpath=`echo $tp|cut -d "#" -f 2`
+ realpath=`echo $tp|cut -d "#" -f 3`
+ if [ -n "$realpath" ]; then
+ mv -f $realpath $realpath.initramfs
+ mv -f $realpath.bak $realpath
+ ln -sf $linkpath.initramfs ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs
+ else
+ mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs
+ mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type
+ fi
+ done
+ fi
+}
+do_bundle_initramfs[dirs] = "${B}"
+
+python do_devshell_prepend () {
+ os.environ["LDFLAGS"] = ''
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+
+get_cc_option () {
+ # Check if KERNEL_CC supports the option "file-prefix-map".
+ # This option allows us to build images with __FILE__ values that do not
+ # contain the host build path.
+ if ${KERNEL_CC} -Q --help=joined | grep -q "\-ffile-prefix-map=<old=new>"; then
+ echo "-ffile-prefix-map=${S}=/kernel-source/"
+ fi
+}
+
+kernel_do_compile() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ # kernel sources do not use do_unpack, so SOURCE_DATE_EPOCH may not
+ # be set....
+ if [ "$SOURCE_DATE_EPOCH" = "0" ]; then
+ olddir=`pwd`
+ cd ${S}
+ SOURCE_DATE_EPOCH=`git log -1 --pretty=%ct`
+ # git repo not guaranteed, so fall back to REPRODUCIBLE_TIMESTAMP_ROOTFS
+ if [ $? -ne 0 ]; then
+ SOURCE_DATE_EPOCH=${REPRODUCIBLE_TIMESTAMP_ROOTFS}
+ fi
+ cd $olddir
+ fi
+
+ ts=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH`
+ export KBUILD_BUILD_TIMESTAMP="$ts"
+ export KCONFIG_NOTIMESTAMP=1
+ bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
+ fi
+ # The $use_alternate_initrd is only set from
+ # do_bundle_initramfs() This variable is specifically for the
+ # case where we are making a second pass at the kernel
+ # compilation and we want to force the kernel build to use a
+ # different initramfs image. The way to do that in the kernel
+ # is to specify:
+ # make ...args... CONFIG_INITRAMFS_SOURCE=some_other_initramfs.cpio
+ if [ "$use_alternate_initrd" = "" ] && [ "${INITRAMFS_TASK}" != "" ] ; then
+ # The old style way of copying an prebuilt image and building it
+ # is turned on via INTIRAMFS_TASK != ""
+ copy_initramfs
+ use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE_NAME}.cpio
+ fi
+ cc_extra=$(get_cc_option)
+ for typeformake in ${KERNEL_IMAGETYPE_FOR_MAKE} ; do
+ oe_runmake ${typeformake} CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
+ done
+ # vmlinux.gz is not built by kernel
+ if (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux\.gz"); then
+ mkdir -p "${KERNEL_OUTPUT_DIR}"
+ gzip -9cn < ${B}/vmlinux > "${KERNEL_OUTPUT_DIR}/vmlinux.gz"
+ fi
+}
+
+do_compile_kernelmodules() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
+ cc_extra=$(get_cc_option)
+ oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC} $cc_extra " LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
+
+ # Module.symvers gets updated during the
+ # building of the kernel modules. We need to
+ # update this in the shared workdir since some
+ # external kernel modules has a dependency on
+ # other kernel modules and will look at this
+ # file to do symbol lookups
+ cp ${B}/Module.symvers ${STAGING_KERNEL_BUILDDIR}/
+ else
+ bbnote "no modules to compile"
+ fi
+}
+addtask compile_kernelmodules after do_compile before do_strip
+
+kernel_do_install() {
+ #
+ # First install the modules
+ #
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+ if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
+ oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
+ rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+ rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
+ # If the kernel/ directory is empty remove it to prevent QA issues
+ rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
+ else
+ bbnote "no modules to install"
+ fi
+
+ #
+ # Install various kernel output (zImage, map file, config, module support files)
+ #
+ install -d ${D}/${KERNEL_IMAGEDEST}
+ install -d ${D}/boot
+ for type in ${KERNEL_IMAGETYPES} ; do
+ install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} ${D}/${KERNEL_IMAGEDEST}/${type}-${KERNEL_VERSION}
+ if [ "${KERNEL_PACKAGE_NAME}" = "kernel" ]; then
+ ln -sf ${type}-${KERNEL_VERSION} ${D}/${KERNEL_IMAGEDEST}/${type}
+ fi
+ done
+ install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
+ install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
+ install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
+ [ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
+ install -d ${D}${sysconfdir}/modules-load.d
+ install -d ${D}${sysconfdir}/modprobe.d
+}
+do_install[prefuncs] += "package_get_auto_pr"
+
+# Must be ran no earlier than after do_kernel_checkout or else Makefile won't be in ${S}/Makefile
+do_kernel_version_sanity_check() {
+ if [ "x${KERNEL_VERSION_SANITY_SKIP}" = "x1" ]; then
+ exit 0
+ fi
+
+ # The Makefile determines the kernel version shown at runtime
+ # Don't use KERNEL_VERSION because the headers it grabs the version from aren't generated until do_compile
+ VERSION=$(grep "^VERSION =" ${S}/Makefile | sed s/.*=\ *//)
+ PATCHLEVEL=$(grep "^PATCHLEVEL =" ${S}/Makefile | sed s/.*=\ *//)
+ SUBLEVEL=$(grep "^SUBLEVEL =" ${S}/Makefile | sed s/.*=\ *//)
+ EXTRAVERSION=$(grep "^EXTRAVERSION =" ${S}/Makefile | sed s/.*=\ *//)
+
+ # Build a string for regex and a plain version string
+ reg="^${VERSION}\.${PATCHLEVEL}"
+ vers="${VERSION}.${PATCHLEVEL}"
+ if [ -n "${SUBLEVEL}" ]; then
+ # Ignoring a SUBLEVEL of zero is fine
+ if [ "${SUBLEVEL}" = "0" ]; then
+ reg="${reg}(\.${SUBLEVEL})?"
+ else
+ reg="${reg}\.${SUBLEVEL}"
+ vers="${vers}.${SUBLEVEL}"
+ fi
+ fi
+ vers="${vers}${EXTRAVERSION}"
+ reg="${reg}${EXTRAVERSION}"
+
+ if [ -z `echo ${PV} | grep -E "${reg}"` ]; then
+ bbfatal "Package Version (${PV}) does not match of kernel being built (${vers}). Please update the PV variable to match the kernel source or set KERNEL_VERSION_SANITY_SKIP=\"1\" in your recipe."
+ fi
+ exit 0
+}
+
+addtask shared_workdir after do_compile before do_compile_kernelmodules
+addtask shared_workdir_setscene
+
+do_shared_workdir_setscene () {
+ exit 1
+}
+
+emit_depmod_pkgdata() {
+ # Stash data for depmod
+ install -d ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/
+ echo "${KERNEL_VERSION}" > ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/${KERNEL_PACKAGE_NAME}-abiversion
+ cp ${B}/System.map ${PKGDESTWORK}/${KERNEL_PACKAGE_NAME}-depmod/System.map-${KERNEL_VERSION}
+}
+
+PACKAGEFUNCS += "emit_depmod_pkgdata"
+
+do_shared_workdir[cleandirs] += " ${STAGING_KERNEL_BUILDDIR}"
+do_shared_workdir () {
+ cd ${B}
+
+ kerneldir=${STAGING_KERNEL_BUILDDIR}
+ install -d $kerneldir
+
+ #
+ # Store the kernel version in sysroots for module-base.bbclass
+ #
+
+ echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion
+
+ # Copy files required for module builds
+ cp System.map $kerneldir/System.map-${KERNEL_VERSION}
+ cp Module.symvers $kerneldir/
+ cp .config $kerneldir/
+ mkdir -p $kerneldir/include/config
+ cp include/config/kernel.release $kerneldir/include/config/kernel.release
+ if [ -e certs/signing_key.pem ]; then
+ # The signing_key.* files are stored in the certs/ dir in
+ # newer Linux kernels
+ mkdir -p $kerneldir/certs
+ cp certs/signing_key.* $kerneldir/certs/
+ elif [ -e signing_key.priv ]; then
+ cp signing_key.* $kerneldir/
+ fi
+
+ # We can also copy over all the generated files and avoid special cases
+ # like version.h, but we've opted to keep this small until file creep starts
+ # to happen
+ if [ -e include/linux/version.h ]; then
+ mkdir -p $kerneldir/include/linux
+ cp include/linux/version.h $kerneldir/include/linux/version.h
+ fi
+
+ # As of Linux kernel version 3.0.1, the clean target removes
+ # arch/powerpc/lib/crtsavres.o which is present in
+ # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+ if [ ${ARCH} = "powerpc" ]; then
+ if [ -e arch/powerpc/lib/crtsavres.o ]; then
+ mkdir -p $kerneldir/arch/powerpc/lib/
+ cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+ fi
+ fi
+
+ if [ -d include/generated ]; then
+ mkdir -p $kerneldir/include/generated/
+ cp -fR include/generated/* $kerneldir/include/generated/
+ fi
+
+ if [ -d arch/${ARCH}/include/generated ]; then
+ mkdir -p $kerneldir/arch/${ARCH}/include/generated/
+ cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
+ fi
+}
+
+# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
+sysroot_stage_all () {
+ :
+}
+
+KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} CC="${KERNEL_CC}" O=${B} oldnoconfig"
+
+python check_oldest_kernel() {
+ oldest_kernel = d.getVar('OLDEST_KERNEL')
+ kernel_version = d.getVar('KERNEL_VERSION')
+ tclibc = d.getVar('TCLIBC')
+ if tclibc == 'glibc':
+ kernel_version = kernel_version.split('-', 1)[0]
+ if oldest_kernel and kernel_version:
+ if bb.utils.vercmp_string(kernel_version, oldest_kernel) < 0:
+ bb.warn('%s: OLDEST_KERNEL is "%s" but the version of the kernel you are building is "%s" - therefore %s as built may not be compatible with this kernel. Either set OLDEST_KERNEL to an older version, or build a newer kernel.' % (d.getVar('PN'), oldest_kernel, kernel_version, tclibc))
+}
+
+check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION"
+do_configure[prefuncs] += "check_oldest_kernel"
+
+kernel_do_configure() {
+ # fixes extra + in /lib/modules/2.6.37+
+ # $ scripts/setlocalversion . => +
+ # $ make kernelversion => 2.6.37
+ # $ make kernelrelease => 2.6.37+
+ touch ${B}/.scmversion ${S}/.scmversion
+
+ if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
+ mv "${S}/.config" "${B}/.config"
+ fi
+
+ # Copy defconfig to .config if .config does not exist. This allows
+ # recipes to manage the .config themselves in do_configure_prepend().
+ if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
+ cp "${WORKDIR}/defconfig" "${B}/.config"
+ fi
+
+ ${KERNEL_CONFIG_COMMAND}
+}
+
+do_savedefconfig() {
+ bbplain "Saving defconfig to:\n${B}/defconfig"
+ oe_runmake -C ${B} savedefconfig
+}
+do_savedefconfig[nostamp] = "1"
+addtask savedefconfig after do_configure
+
+inherit cml1
+
+KCONFIG_CONFIG_COMMAND_append = " HOSTLDFLAGS='${BUILD_LDFLAGS}'"
+
+EXPORT_FUNCTIONS do_compile do_install do_configure
+
+# kernel-base becomes kernel-${KERNEL_VERSION}
+# kernel-image becomes kernel-image-${KERNEL_VERSION}
+PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules"
+FILES_${PN} = ""
+FILES_${KERNEL_PACKAGE_NAME}-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_${KERNEL_PACKAGE_NAME}-image = ""
+FILES_${KERNEL_PACKAGE_NAME}-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
+FILES_${KERNEL_PACKAGE_NAME}-vmlinux = "/boot/vmlinux-${KERNEL_VERSION_NAME}"
+FILES_${KERNEL_PACKAGE_NAME}-modules = ""
+RDEPENDS_${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base"
+# Allow machines to override this dependency if kernel image files are
+# not wanted in images as standard
+RDEPENDS_${KERNEL_PACKAGE_NAME}-base ?= "${KERNEL_PACKAGE_NAME}-image"
+PKG_${KERNEL_PACKAGE_NAME}-image = "${KERNEL_PACKAGE_NAME}-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RDEPENDS_${KERNEL_PACKAGE_NAME}-image += "${@oe.utils.conditional('KERNEL_IMAGETYPE', 'vmlinux', '${KERNEL_PACKAGE_NAME}-vmlinux', '', d)}"
+PKG_${KERNEL_PACKAGE_NAME}-base = "${KERNEL_PACKAGE_NAME}-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RPROVIDES_${KERNEL_PACKAGE_NAME}-base += "${KERNEL_PACKAGE_NAME}-${KERNEL_VERSION}"
+ALLOW_EMPTY_${KERNEL_PACKAGE_NAME} = "1"
+ALLOW_EMPTY_${KERNEL_PACKAGE_NAME}-base = "1"
+ALLOW_EMPTY_${KERNEL_PACKAGE_NAME}-image = "1"
+ALLOW_EMPTY_${KERNEL_PACKAGE_NAME}-modules = "1"
+DESCRIPTION_${KERNEL_PACKAGE_NAME}-modules = "Kernel modules meta package"
+
+pkg_postinst_${KERNEL_PACKAGE_NAME}-base () {
+ if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
+ mkdir -p $D/lib/modules/${KERNEL_VERSION}
+ fi
+ if [ -n "$D" ]; then
+ depmodwrapper -a -b $D ${KERNEL_VERSION}
+ else
+ depmod -a ${KERNEL_VERSION}
+ fi
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
+
+python split_kernel_packages () {
+ do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex='^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='${KERNEL_PACKAGE_NAME}-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+}
+
+# Many scripts want to look in arch/$arch/boot for the bootable
+# image. This poses a problem for vmlinux and vmlinuz based
+# booting. This task arranges to have vmlinux and vmlinuz appear
+# in the normalized directory location.
+do_kernel_link_images() {
+ if [ ! -d "${B}/arch/${ARCH}/boot" ]; then
+ mkdir ${B}/arch/${ARCH}/boot
+ fi
+ cd ${B}/arch/${ARCH}/boot
+ ln -sf ../../../vmlinux
+ if [ -f ../../../vmlinuz ]; then
+ ln -sf ../../../vmlinuz
+ fi
+ if [ -f ../../../vmlinuz.bin ]; then
+ ln -sf ../../../vmlinuz.bin
+ fi
+}
+addtask kernel_link_images after do_compile before do_strip
+
+do_strip() {
+ if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
+ if ! (echo "${KERNEL_IMAGETYPES}" | grep -wq "vmlinux"); then
+ bbwarn "image type(s) will not be stripped (not supported): ${KERNEL_IMAGETYPES}"
+ return
+ fi
+
+ cd ${B}
+ headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT_DIR}/vmlinux | \
+ grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \
+ sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \
+ gawk '{print $1}'`
+
+ for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
+ if ! (echo "$headers" | grep -q "^$str$"); then
+ bbwarn "Section not found: $str";
+ fi
+
+ "$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT_DIR}/vmlinux
+ }; done
+
+ bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \
+ "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}"
+ fi;
+}
+do_strip[dirs] = "${B}"
+
+addtask strip before do_sizecheck after do_kernel_link_images
+
+# Support checking the kernel size since some kernels need to reside in partitions
+# with a fixed length or there is a limit in transferring the kernel to memory.
+# If more than one image type is enabled, warn on any that don't fit but only fail
+# if none fit.
+do_sizecheck() {
+ if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
+ invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
+ if [ -n "$invalid" ]; then
+ die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integer (The unit is Kbytes)"
+ fi
+ at_least_one_fits=
+ for type in ${KERNEL_IMAGETYPES} ; do
+ size=`du -ks ${B}/${KERNEL_OUTPUT_DIR}/$type | awk '{print $1}'`
+ if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+ bbwarn "This kernel $type (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device."
+ else
+ at_least_one_fits=y
+ fi
+ done
+ if [ -z "$at_least_one_fits" ]; then
+ die "All kernel images are too big for your device. Please reduce the size of the kernel by making more of it modular."
+ fi
+ fi
+}
+do_sizecheck[dirs] = "${B}"
+
+addtask sizecheck before do_install after do_strip
+
+KERNEL_IMAGE_BASE_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${MACHINE}"
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+# Don't include the DATETIME variable in the sstate package signatures
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+kernel_do_deploy() {
+ deployDir="${DEPLOYDIR}"
+ if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then
+ deployDir="${DEPLOYDIR}/${KERNEL_DEPLOYSUBDIR}"
+ mkdir "$deployDir"
+ fi
+
+ for type in ${KERNEL_IMAGETYPES} ; do
+ base_name=${type}-${KERNEL_IMAGE_BASE_NAME}
+ install -m 0644 ${KERNEL_OUTPUT_DIR}/${type} $deployDir/${base_name}.bin
+ done
+ if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
+ mkdir -p ${D}/lib
+ tar -cvzf $deployDir/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
+ ln -sf ${MODULE_TARBALL_BASE_NAME} $deployDir/${MODULE_TARBALL_SYMLINK_NAME}
+ fi
+
+ for type in ${KERNEL_IMAGETYPES} ; do
+ base_name=${type}-${KERNEL_IMAGE_BASE_NAME}
+ symlink_name=${type}-${KERNEL_IMAGE_SYMLINK_NAME}
+ ln -sf ${base_name}.bin $deployDir/${symlink_name}.bin
+ ln -sf ${base_name}.bin $deployDir/${type}
+ done
+
+ cd ${B}
+ # Update deploy directory
+ for type in ${KERNEL_IMAGETYPES} ; do
+ if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
+ echo "Copying deploy ${type} kernel-initramfs image and setting up links..."
+ initramfs_base_name=${type}-${INITRAMFS_BASE_NAME}
+ initramfs_symlink_name=${type}-initramfs-${MACHINE}
+ install -m 0644 ${KERNEL_OUTPUT_DIR}/${type}.initramfs $deployDir/${initramfs_base_name}.bin
+ ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin
+ fi
+ done
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+do_deploy[prefuncs] += "package_get_auto_pr"
+
+addtask deploy after do_populate_sysroot do_packagedata
+
+EXPORT_FUNCTIONS do_deploy
+
+# Add using Device Tree support
+inherit kernel-devicetree
diff --git a/poky/meta/classes/kernelsrc.bbclass b/poky/meta/classes/kernelsrc.bbclass
new file mode 100644
index 000000000..675d40ec9
--- /dev/null
+++ b/poky/meta/classes/kernelsrc.bbclass
@@ -0,0 +1,10 @@
+S = "${STAGING_KERNEL_DIR}"
+deltask do_fetch
+deltask do_unpack
+do_patch[depends] += "virtual/kernel:do_patch"
+do_patch[noexec] = "1"
+do_package[depends] += "virtual/kernel:do_populate_sysroot"
+KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}"
+
+inherit linux-kernel-base
+
diff --git a/poky/meta/classes/lib_package.bbclass b/poky/meta/classes/lib_package.bbclass
new file mode 100644
index 000000000..8849f5904
--- /dev/null
+++ b/poky/meta/classes/lib_package.bbclass
@@ -0,0 +1,7 @@
+#
+# ${PN}-bin is defined in bitbake.conf
+#
+# We need to allow the other packages to be greedy with what they
+# want out of /usr/bin and /usr/sbin before ${PN}-bin gets greedy.
+#
+PACKAGE_BEFORE_PN = "${PN}-bin"
diff --git a/poky/meta/classes/libc-common.bbclass b/poky/meta/classes/libc-common.bbclass
new file mode 100644
index 000000000..9ea2c0374
--- /dev/null
+++ b/poky/meta/classes/libc-common.bbclass
@@ -0,0 +1,41 @@
+do_install() {
+ oe_runmake install_root=${D} install
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ install -m 0644 ${S}/sunrpc/rpcsvc/$h ${D}/${includedir}/rpcsvc/
+ done
+ install -Dm 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/ld.so.conf
+ install -d ${D}${localedir}
+ make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED"
+ # get rid of some broken files...
+ for i in ${GLIBC_BROKEN_LOCALES}; do
+ sed -i "/$i/d" ${WORKDIR}/SUPPORTED
+ done
+ rm -f ${D}${sysconfdir}/rpc
+ rm -rf ${D}${datadir}/zoneinfo
+ rm -rf ${D}${libexecdir}/getconf
+}
+
+def get_libc_fpu_setting(bb, d):
+ if d.getVar('TARGET_FPU') in [ 'soft', 'ppc-efd' ]:
+ return "--without-fp"
+ return ""
+
+python populate_packages_prepend () {
+ if d.getVar('DEBIAN_NAMES'):
+ pkgs = d.getVar('PACKAGES').split()
+ bpn = d.getVar('BPN')
+ prefix = d.getVar('MLPREFIX') or ""
+ # Set the base package...
+ d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
+ libcprefix = prefix + bpn + '-'
+ for p in pkgs:
+ # And all the subpackages.
+ if p.startswith(libcprefix):
+ renamed = p.replace(bpn, 'libc6', 1)
+ d.setVar('PKG_' + p, renamed)
+ # For backward compatibility with old -dbg package
+ d.appendVar('RPROVIDES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+ d.appendVar('RCONFLICTS_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+ d.appendVar('RREPLACES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+}
diff --git a/poky/meta/classes/libc-package.bbclass b/poky/meta/classes/libc-package.bbclass
new file mode 100644
index 000000000..2e7cd2529
--- /dev/null
+++ b/poky/meta/classes/libc-package.bbclass
@@ -0,0 +1,380 @@
+#
+# This class knows how to package up [e]glibc. Its shared since prebuild binary toolchains
+# may need packaging and its pointless to duplicate this code.
+#
+# Caller should set GLIBC_INTERNAL_USE_BINARY_LOCALE to one of:
+# "compile" - Use QEMU to generate the binary locale files
+# "precompiled" - The binary locale files are pregenerated and already present
+# "ondevice" - The device will build the locale files upon first boot through the postinst
+
+GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
+
+GLIBC_SPLIT_LC_PACKAGES ?= "0"
+
+python __anonymous () {
+ enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION")
+
+ pn = d.getVar("PN")
+ if pn.endswith("-initial"):
+ enabled = False
+
+ if enabled and int(enabled):
+ import re
+
+ target_arch = d.getVar("TARGET_ARCH")
+ binary_arches = d.getVar("BINARY_LOCALE_ARCHES") or ""
+ use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or ""
+
+ for regexp in binary_arches.split(" "):
+ r = re.compile(regexp)
+
+ if r.match(target_arch):
+ depends = d.getVar("DEPENDS")
+ if use_cross_localedef == "1" :
+ depends = "%s cross-localedef-native" % depends
+ else:
+ depends = "%s qemu-native" % depends
+ d.setVar("DEPENDS", depends)
+ d.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile")
+ break
+
+ # try to fix disable charsets/locales/locale-code compile fail
+ if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
+ bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
+ bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
+ d.setVar('PACKAGE_NO_GCONV', '0')
+ else:
+ d.setVar('PACKAGE_NO_GCONV', '1')
+}
+
+OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+
+locale_base_postinst() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s %s
+}
+
+locale_base_postrm() {
+#!/bin/sh
+localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s %s
+}
+
+LOCALETREESRC ?= "${PKGD}"
+
+do_prep_locale_tree() {
+ treedir=${WORKDIR}/locale-tree
+ rm -rf $treedir
+ mkdir -p $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${localedir}
+ tar -cf - -C ${LOCALETREESRC}${datadir} -p i18n | tar -xf - -C $treedir/${datadir}
+ # unzip to avoid parsing errors
+ for i in $treedir/${datadir}/i18n/charmaps/*gz; do
+ gunzip $i
+ done
+ tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir}
+ if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/lib/libgcc_s.* ]; then
+ tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -p libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
+ fi
+ install -m 0755 ${LOCALETREESRC}${bindir}/localedef $treedir/${base_bindir}
+}
+
+do_collect_bins_from_locale_tree() {
+ treedir=${WORKDIR}/locale-tree
+
+ parent=$(dirname ${localedir})
+ mkdir -p ${PKGD}/$parent
+ tar -cf - -C $treedir/$parent -p $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent
+}
+
+inherit qemu
+
+python package_do_split_gconvs () {
+ import re
+ if (d.getVar('PACKAGE_NO_GCONV') == '1'):
+ bb.note("package requested not splitting gconvs")
+ return
+
+ if not d.getVar('PACKAGES'):
+ return
+
+ mlprefix = d.getVar("MLPREFIX") or ""
+
+ bpn = d.getVar('BPN')
+ libdir = d.getVar('libdir')
+ if not libdir:
+ bb.error("libdir not defined")
+ return
+ datadir = d.getVar('datadir')
+ if not datadir:
+ bb.error("datadir not defined")
+ return
+
+ gconv_libdir = oe.path.join(libdir, "gconv")
+ charmap_dir = oe.path.join(datadir, "i18n", "charmaps")
+ locales_dir = oe.path.join(datadir, "i18n", "locales")
+ binary_locales_dir = d.getVar('localedir')
+
+ def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
+ deps = []
+ f = open(fn, "rb")
+ c_re = re.compile('^copy "(.*)"')
+ i_re = re.compile('^include "(\w+)".*')
+ for l in f.readlines():
+ l = l.decode("latin-1")
+ m = c_re.match(l) or i_re.match(l)
+ if m:
+ dp = legitimize_package_name('%s%s-gconv-%s' % (mlprefix, bpn, m.group(1)))
+ if not dp in deps:
+ deps.append(dp)
+ f.close()
+ if deps != []:
+ d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+ if bpn != 'glibc':
+ d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+ do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
+ description='gconv module for character set %s', hook=calc_gconv_deps, \
+ extra_depends=bpn+'-gconv')
+
+ def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group):
+ deps = []
+ f = open(fn, "rb")
+ c_re = re.compile('^copy "(.*)"')
+ i_re = re.compile('^include "(\w+)".*')
+ for l in f.readlines():
+ l = l.decode("latin-1")
+ m = c_re.match(l) or i_re.match(l)
+ if m:
+ dp = legitimize_package_name('%s%s-charmap-%s' % (mlprefix, bpn, m.group(1)))
+ if not dp in deps:
+ deps.append(dp)
+ f.close()
+ if deps != []:
+ d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+ if bpn != 'glibc':
+ d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+ do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
+ description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='')
+
+ def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
+ deps = []
+ f = open(fn, "rb")
+ c_re = re.compile('^copy "(.*)"')
+ i_re = re.compile('^include "(\w+)".*')
+ for l in f.readlines():
+ l = l.decode("latin-1")
+ m = c_re.match(l) or i_re.match(l)
+ if m:
+ dp = legitimize_package_name(mlprefix+bpn+'-localedata-%s' % m.group(1))
+ if not dp in deps:
+ deps.append(dp)
+ f.close()
+ if deps != []:
+ d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+ if bpn != 'glibc':
+ d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+ do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \
+ description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
+ d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv')
+
+ use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE")
+
+ dot_re = re.compile("(.*)\.(.*)")
+
+ # Read in supported locales and associated encodings
+ supported = {}
+ with open(oe.path.join(d.getVar('WORKDIR'), "SUPPORTED")) as f:
+ for line in f.readlines():
+ try:
+ locale, charset = line.rstrip().split()
+ except ValueError:
+ continue
+ supported[locale] = charset
+
+ # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales
+ to_generate = d.getVar('GLIBC_GENERATE_LOCALES')
+ if not to_generate or to_generate == 'all':
+ to_generate = sorted(supported.keys())
+ else:
+ to_generate = to_generate.split()
+ for locale in to_generate:
+ if locale not in supported:
+ if '.' in locale:
+ charset = locale.split('.')[1]
+ else:
+ charset = 'UTF-8'
+ bb.warn("Unsupported locale '%s', assuming encoding '%s'" % (locale, charset))
+ supported[locale] = charset
+
+ def output_locale_source(name, pkgname, locale, encoding):
+ d.setVar('RDEPENDS_%s' % pkgname, '%slocaledef %s-localedata-%s %s-charmap-%s' % \
+ (mlprefix, mlprefix+bpn, legitimize_package_name(locale), mlprefix+bpn, legitimize_package_name(encoding)))
+ d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst') \
+ % (locale, encoding, locale))
+ d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm') % \
+ (locale, encoding, locale))
+
+ def output_locale_binary_rdepends(name, pkgname, locale, encoding):
+ dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
+ if lcsplit and int(lcsplit):
+ d.appendVar('PACKAGES', ' ' + dep)
+ d.setVar('ALLOW_EMPTY_%s' % dep, '1')
+ d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
+
+ commands = {}
+
+ def output_locale_binary(name, pkgname, locale, encoding):
+ treedir = oe.path.join(d.getVar("WORKDIR"), "locale-tree")
+ ldlibdir = oe.path.join(treedir, d.getVar("base_libdir"))
+ path = d.getVar("PATH")
+ i18npath = oe.path.join(treedir, datadir, "i18n")
+ gconvpath = oe.path.join(treedir, "iconvdata")
+ outputpath = oe.path.join(treedir, binary_locales_dir)
+
+ use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF") or "0"
+ if use_cross_localedef == "1":
+ target_arch = d.getVar('TARGET_ARCH')
+ locale_arch_options = { \
+ "arm": " --uint32-align=4 --little-endian ", \
+ "armeb": " --uint32-align=4 --big-endian ", \
+ "aarch64": " --uint32-align=4 --little-endian ", \
+ "aarch64_be": " --uint32-align=4 --big-endian ", \
+ "sh4": " --uint32-align=4 --big-endian ", \
+ "powerpc": " --uint32-align=4 --big-endian ", \
+ "powerpc64": " --uint32-align=4 --big-endian ", \
+ "mips": " --uint32-align=4 --big-endian ", \
+ "mipsisa32r6": " --uint32-align=4 --big-endian ", \
+ "mips64": " --uint32-align=4 --big-endian ", \
+ "mipsisa64r6": " --uint32-align=4 --big-endian ", \
+ "mipsel": " --uint32-align=4 --little-endian ", \
+ "mipsisa32r6el": " --uint32-align=4 --little-endian ", \
+ "mips64el":" --uint32-align=4 --little-endian ", \
+ "mipsisa64r6el":" --uint32-align=4 --little-endian ", \
+ "i586": " --uint32-align=4 --little-endian ", \
+ "i686": " --uint32-align=4 --little-endian ", \
+ "x86_64": " --uint32-align=4 --little-endian " }
+
+ if target_arch in locale_arch_options:
+ localedef_opts = locale_arch_options[target_arch]
+ else:
+ bb.error("locale_arch_options not found for target_arch=" + target_arch)
+ bb.fatal("unknown arch:" + target_arch + " for locale_arch_options")
+
+ localedef_opts += " --force --no-archive --prefix=%s \
+ --inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \
+ % (treedir, treedir, datadir, locale, encoding, outputpath, name)
+
+ cmd = "PATH=\"%s\" I18NPATH=\"%s\" GCONV_PATH=\"%s\" cross-localedef %s" % \
+ (path, i18npath, gconvpath, localedef_opts)
+ else: # earlier slower qemu way
+ qemu = qemu_target_binary(d)
+ localedef_opts = "--force --no-archive --prefix=%s \
+ --inputfile=%s/i18n/locales/%s --charmap=%s %s" \
+ % (treedir, datadir, locale, encoding, name)
+
+ qemu_options = d.getVar('QEMU_OPTIONS')
+
+ cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \
+ -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \
+ (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts)
+
+ commands["%s/%s" % (outputpath, name)] = cmd
+
+ bb.note("generating locale %s (%s)" % (locale, encoding))
+
+ def output_locale(name, locale, encoding):
+ pkgname = d.getVar('MLPREFIX', False) + 'locale-base-' + legitimize_package_name(name)
+ d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
+ d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES')))
+ rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name))
+ m = re.match("(.*)_(.*)", name)
+ if m:
+ rprovides += ' %svirtual-locale-%s' % (mlprefix, m.group(1))
+ d.setVar('RPROVIDES_%s' % pkgname, rprovides)
+
+ if use_bin == "compile":
+ output_locale_binary_rdepends(name, pkgname, locale, encoding)
+ output_locale_binary(name, pkgname, locale, encoding)
+ elif use_bin == "precompiled":
+ output_locale_binary_rdepends(name, pkgname, locale, encoding)
+ else:
+ output_locale_source(name, pkgname, locale, encoding)
+
+ if use_bin == "compile":
+ bb.note("preparing tree for binary locale generation")
+ bb.build.exec_func("do_prep_locale_tree", d)
+
+ utf8_only = int(d.getVar('LOCALE_UTF8_ONLY') or 0)
+ utf8_is_default = int(d.getVar('LOCALE_UTF8_IS_DEFAULT') or 0)
+
+ encodings = {}
+ for locale in to_generate:
+ charset = supported[locale]
+ if utf8_only and charset != 'UTF-8':
+ continue
+
+ m = dot_re.match(locale)
+ if m:
+ base = m.group(1)
+ else:
+ base = locale
+
+ # Non-precompiled locales may be renamed so that the default
+ # (non-suffixed) encoding is always UTF-8, i.e., instead of en_US and
+ # en_US.UTF-8, we have en_US and en_US.ISO-8859-1. This implicitly
+ # contradicts SUPPORTED.
+ if use_bin == "precompiled" or not utf8_is_default:
+ output_locale(locale, base, charset)
+ else:
+ if charset == 'UTF-8':
+ output_locale(base, base, charset)
+ else:
+ output_locale('%s.%s' % (base, charset), base, charset)
+
+ def metapkg_hook(file, pkg, pattern, format, basename):
+ name = basename.split('/', 1)[0]
+ metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
+ d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
+
+ if use_bin == "compile":
+ makefile = oe.path.join(d.getVar("WORKDIR"), "locale-tree", "Makefile")
+ m = open(makefile, "w")
+ m.write("all: %s\n\n" % " ".join(commands.keys()))
+ for cmd in commands:
+ m.write(cmd + ":\n")
+ m.write("\t" + commands[cmd] + "\n\n")
+ m.close()
+ d.setVar("EXTRA_OEMAKE", "-C %s ${PARALLEL_MAKE}" % (os.path.dirname(makefile)))
+ bb.note("Executing binary locale generation makefile")
+ bb.build.exec_func("oe_runmake", d)
+ bb.note("collecting binary locales from locale tree")
+ bb.build.exec_func("do_collect_bins_from_locale_tree", d)
+
+ if use_bin in ('compile', 'precompiled'):
+ lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
+ if lcsplit and int(lcsplit):
+ do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', recursive=True,
+ hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
+ else:
+ do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+ output_pattern=bpn+'-binary-localedata-%s', \
+ description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+ else:
+ bb.note("generation of binary locales disabled. this may break i18n!")
+
+}
+
+# We want to do this indirection so that we can safely 'return'
+# from the called function even though we're prepending
+python populate_packages_prepend () {
+ bb.build.exec_func('package_do_split_gconvs', d)
+}
diff --git a/poky/meta/classes/license.bbclass b/poky/meta/classes/license.bbclass
new file mode 100644
index 000000000..06dd4a8c1
--- /dev/null
+++ b/poky/meta/classes/license.bbclass
@@ -0,0 +1,684 @@
+# Populates LICENSE_DIRECTORY as set in distro config with the license files as set by
+# LIC_FILES_CHKSUM.
+# TODO:
+# - There is a real issue revolving around license naming standards.
+
+LICENSE_DIRECTORY ??= "${DEPLOY_DIR}/licenses"
+LICSSTATEDIR = "${WORKDIR}/license-destdir/"
+
+# Create extra package with license texts and add it to RRECOMMENDS_${PN}
+LICENSE_CREATE_PACKAGE[type] = "boolean"
+LICENSE_CREATE_PACKAGE ??= "0"
+LICENSE_PACKAGE_SUFFIX ??= "-lic"
+LICENSE_FILES_DIRECTORY ??= "${datadir}/licenses/"
+
+addtask populate_lic after do_patch before do_build
+do_populate_lic[dirs] = "${LICSSTATEDIR}/${PN}"
+do_populate_lic[cleandirs] = "${LICSSTATEDIR}"
+
+python write_package_manifest() {
+ # Get list of installed packages
+ license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}')
+ bb.utils.mkdirhier(license_image_dir)
+ from oe.rootfs import image_list_installed_packages
+ from oe.utils import format_pkg_list
+
+ pkgs = image_list_installed_packages(d)
+ output = format_pkg_list(pkgs)
+ open(os.path.join(license_image_dir, 'package.manifest'),
+ 'w+').write(output)
+}
+
+python write_deploy_manifest() {
+ license_deployed_manifest(d)
+}
+
+python license_create_manifest() {
+ import oe.packagedata
+ from oe.rootfs import image_list_installed_packages
+
+ build_images_from_feeds = d.getVar('BUILD_IMAGES_FROM_FEEDS')
+ if build_images_from_feeds == "1":
+ return 0
+
+ pkg_dic = {}
+ for pkg in sorted(image_list_installed_packages(d)):
+ pkg_info = os.path.join(d.getVar('PKGDATA_DIR'),
+ 'runtime-reverse', pkg)
+ pkg_name = os.path.basename(os.readlink(pkg_info))
+
+ pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
+ if not "LICENSE" in pkg_dic[pkg_name].keys():
+ pkg_lic_name = "LICENSE_" + pkg_name
+ pkg_dic[pkg_name]["LICENSE"] = pkg_dic[pkg_name][pkg_lic_name]
+
+ rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+ d.getVar('IMAGE_NAME'), 'license.manifest')
+ write_license_files(d, rootfs_license_manifest, pkg_dic)
+}
+
+def write_license_files(d, license_manifest, pkg_dic):
+ import re
+
+ bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split()
+ bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
+ bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+
+ with open(license_manifest, "w") as license_file:
+ for pkg in sorted(pkg_dic):
+ if bad_licenses:
+ try:
+ (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \
+ oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"],
+ bad_licenses, canonical_license, d)
+ except oe.license.LicenseError as exc:
+ bb.fatal('%s: %s' % (d.getVar('P'), exc))
+ else:
+ pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', ' ', pkg_dic[pkg]["LICENSE"])
+ pkg_dic[pkg]["LICENSES"] = re.sub(' *', ' ', pkg_dic[pkg]["LICENSES"])
+ pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split()
+
+ if not "IMAGE_MANIFEST" in pkg_dic[pkg]:
+ # Rootfs manifest
+ license_file.write("PACKAGE NAME: %s\n" % pkg)
+ license_file.write("PACKAGE VERSION: %s\n" % pkg_dic[pkg]["PV"])
+ license_file.write("RECIPE NAME: %s\n" % pkg_dic[pkg]["PN"])
+ license_file.write("LICENSE: %s\n\n" % pkg_dic[pkg]["LICENSE"])
+
+ # If the package doesn't contain any file, that is, its size is 0, the license
+ # isn't relevant as far as the final image is concerned. So doing license check
+ # doesn't make much sense, skip it.
+ if pkg_dic[pkg]["PKGSIZE_%s" % pkg] == "0":
+ continue
+ else:
+ # Image manifest
+ license_file.write("RECIPE NAME: %s\n" % pkg_dic[pkg]["PN"])
+ license_file.write("VERSION: %s\n" % pkg_dic[pkg]["PV"])
+ license_file.write("LICENSE: %s\n" % pkg_dic[pkg]["LICENSE"])
+ license_file.write("FILES: %s\n\n" % pkg_dic[pkg]["FILES"])
+
+ for lic in pkg_dic[pkg]["LICENSES"]:
+ lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+ pkg_dic[pkg]["PN"], "generic_%s" %
+ re.sub('\+', '', lic))
+ # add explicity avoid of CLOSED license because isn't generic
+ if lic == "CLOSED":
+ continue
+
+ if not os.path.exists(lic_file):
+ bb.warn("The license listed %s was not in the "\
+ "licenses collected for recipe %s"
+ % (lic, pkg_dic[pkg]["PN"]))
+
+ # Two options here:
+ # - Just copy the manifest
+ # - Copy the manifest and the license directories
+ # With both options set we see a .5 M increase in core-image-minimal
+ copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST')
+ copy_lic_dirs = d.getVar('COPY_LIC_DIRS')
+ if copy_lic_manifest == "1":
+ rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'),
+ 'usr', 'share', 'common-licenses')
+ bb.utils.mkdirhier(rootfs_license_dir)
+ rootfs_license_manifest = os.path.join(rootfs_license_dir,
+ os.path.split(license_manifest)[1])
+ if not os.path.exists(rootfs_license_manifest):
+ os.link(license_manifest, rootfs_license_manifest)
+
+ if copy_lic_dirs == "1":
+ for pkg in sorted(pkg_dic):
+ pkg_rootfs_license_dir = os.path.join(rootfs_license_dir, pkg)
+ bb.utils.mkdirhier(pkg_rootfs_license_dir)
+ pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+ pkg_dic[pkg]["PN"])
+
+ pkg_manifest_licenses = [canonical_license(d, lic) \
+ for lic in pkg_dic[pkg]["LICENSES"]]
+
+ licenses = os.listdir(pkg_license_dir)
+ for lic in licenses:
+ rootfs_license = os.path.join(rootfs_license_dir, lic)
+ pkg_license = os.path.join(pkg_license_dir, lic)
+ pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic)
+
+ if re.match("^generic_.*$", lic):
+ generic_lic = canonical_license(d,
+ re.search("^generic_(.*)$", lic).group(1))
+
+ # Do not copy generic license into package if isn't
+ # declared into LICENSES of the package.
+ if not re.sub('\+$', '', generic_lic) in \
+ [re.sub('\+', '', lic) for lic in \
+ pkg_manifest_licenses]:
+ continue
+
+ if oe.license.license_ok(generic_lic,
+ bad_licenses) == False:
+ continue
+
+ if not os.path.exists(rootfs_license):
+ os.link(pkg_license, rootfs_license)
+
+ if not os.path.exists(pkg_rootfs_license):
+ os.symlink(os.path.join('..', lic), pkg_rootfs_license)
+ else:
+ if (oe.license.license_ok(canonical_license(d,
+ lic), bad_licenses) == False or
+ os.path.exists(pkg_rootfs_license)):
+ continue
+
+ os.link(pkg_license, pkg_rootfs_license)
+
+
+def license_deployed_manifest(d):
+ """
+ Write the license manifest for the deployed recipes.
+ The deployed recipes usually includes the bootloader
+ and extra files to boot the target.
+ """
+
+ dep_dic = {}
+ man_dic = {}
+ lic_dir = d.getVar("LICENSE_DIRECTORY")
+
+ dep_dic = get_deployed_dependencies(d)
+ for dep in dep_dic.keys():
+ man_dic[dep] = {}
+ # It is necessary to mark this will be used for image manifest
+ man_dic[dep]["IMAGE_MANIFEST"] = True
+ man_dic[dep]["PN"] = dep
+ man_dic[dep]["FILES"] = \
+ " ".join(get_deployed_files(dep_dic[dep]))
+ with open(os.path.join(lic_dir, dep, "recipeinfo"), "r") as f:
+ for line in f.readlines():
+ key,val = line.split(": ", 1)
+ man_dic[dep][key] = val[:-1]
+
+ lic_manifest_dir = os.path.join(d.getVar('LICENSE_DIRECTORY'),
+ d.getVar('IMAGE_NAME'))
+ bb.utils.mkdirhier(lic_manifest_dir)
+ image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest')
+ write_license_files(d, image_license_manifest, man_dic)
+
+def get_deployed_dependencies(d):
+ """
+ Get all the deployed dependencies of an image
+ """
+
+ deploy = {}
+ # Get all the dependencies for the current task (rootfs).
+ # Also get EXTRA_IMAGEDEPENDS because the bootloader is
+ # usually in this var and not listed in rootfs.
+ # At last, get the dependencies from boot classes because
+ # it might contain the bootloader.
+ taskdata = d.getVar("BB_TASKDEPDATA", False)
+ depends = list(set([dep[0] for dep
+ in list(taskdata.values())
+ if not dep[0].endswith("-native")]))
+ extra_depends = d.getVar("EXTRA_IMAGEDEPENDS")
+ boot_depends = get_boot_dependencies(d)
+ depends.extend(extra_depends.split())
+ depends.extend(boot_depends)
+ depends = list(set(depends))
+
+ # To verify what was deployed it checks the rootfs dependencies against
+ # the SSTATE_MANIFESTS for "deploy" task.
+ # The manifest file name contains the arch. Because we are not running
+ # in the recipe context it is necessary to check every arch used.
+ sstate_manifest_dir = d.getVar("SSTATE_MANIFESTS")
+ archs = list(set(d.getVar("SSTATE_ARCHS").split()))
+ for dep in depends:
+ # Some recipes have an arch on their own, so we try that first.
+ special_arch = d.getVar("PACKAGE_ARCH_pn-%s" % dep)
+ if special_arch:
+ sstate_manifest_file = os.path.join(sstate_manifest_dir,
+ "manifest-%s-%s.deploy" % (special_arch, dep))
+ if os.path.exists(sstate_manifest_file):
+ deploy[dep] = sstate_manifest_file
+ continue
+
+ for arch in archs:
+ sstate_manifest_file = os.path.join(sstate_manifest_dir,
+ "manifest-%s-%s.deploy" % (arch, dep))
+ if os.path.exists(sstate_manifest_file):
+ deploy[dep] = sstate_manifest_file
+ break
+
+ return deploy
+get_deployed_dependencies[vardepsexclude] = "BB_TASKDEPDATA"
+
+def get_boot_dependencies(d):
+ """
+ Return the dependencies from boot tasks
+ """
+
+ depends = []
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ # Only bootimg includes the depends flag
+ boot_depends_string = d.getVarFlag("do_bootimg", "depends") or ""
+ boot_depends = [dep.split(":")[0] for dep
+ in boot_depends_string.split()
+ if not dep.split(":")[0].endswith("-native")]
+ for dep in boot_depends:
+ info_file = os.path.join(d.getVar("LICENSE_DIRECTORY"),
+ dep, "recipeinfo")
+ # If the recipe and dependency name is the same
+ if os.path.exists(info_file):
+ depends.append(dep)
+ # We need to search for the provider of the dependency
+ else:
+ for taskdep in taskdepdata.values():
+ # The fifth field contains what the task provides
+ if dep in taskdep[4]:
+ info_file = os.path.join(
+ d.getVar("LICENSE_DIRECTORY"),
+ taskdep[0], "recipeinfo")
+ if os.path.exists(info_file):
+ depends.append(taskdep[0])
+ break
+ return depends
+get_boot_dependencies[vardepsexclude] = "BB_TASKDEPDATA"
+
+def get_deployed_files(man_file):
+ """
+ Get the files deployed from the sstate manifest
+ """
+
+ dep_files = []
+ excluded_files = []
+ with open(man_file, "r") as manifest:
+ all_files = manifest.read()
+ for f in all_files.splitlines():
+ if ((not (os.path.islink(f) or os.path.isdir(f))) and
+ not os.path.basename(f) in excluded_files):
+ dep_files.append(os.path.basename(f))
+ return dep_files
+
+python do_populate_lic() {
+ """
+ Populate LICENSE_DIRECTORY with licenses.
+ """
+ lic_files_paths = find_license_files(d)
+
+ # The base directory we wrangle licenses to
+ destdir = os.path.join(d.getVar('LICSSTATEDIR'), d.getVar('PN'))
+ copy_license_files(lic_files_paths, destdir)
+ info = get_recipe_info(d)
+ with open(os.path.join(destdir, "recipeinfo"), "w") as f:
+ for key in sorted(info.keys()):
+ f.write("%s: %s\n" % (key, info[key]))
+}
+
+# it would be better to copy them in do_install_append, but find_license_filesa is python
+python perform_packagecopy_prepend () {
+ enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
+ if d.getVar('CLASSOVERRIDE') == 'class-target' and enabled:
+ lic_files_paths = find_license_files(d)
+
+ # LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
+ destdir = d.getVar('D') + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY'), d.getVar('PN'))
+ copy_license_files(lic_files_paths, destdir)
+ add_package_and_files(d)
+}
+perform_packagecopy[vardeps] += "LICENSE_CREATE_PACKAGE"
+
+def get_recipe_info(d):
+ info = {}
+ info["PV"] = d.getVar("PV")
+ info["PR"] = d.getVar("PR")
+ info["LICENSE"] = d.getVar("LICENSE")
+ return info
+
+def add_package_and_files(d):
+ packages = d.getVar('PACKAGES')
+ files = d.getVar('LICENSE_FILES_DIRECTORY')
+ pn = d.getVar('PN')
+ pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False))
+ if pn_lic in packages.split():
+ bb.warn("%s package already existed in %s." % (pn_lic, pn))
+ else:
+ # first in PACKAGES to be sure that nothing else gets LICENSE_FILES_DIRECTORY
+ d.setVar('PACKAGES', "%s %s" % (pn_lic, packages))
+ d.setVar('FILES_' + pn_lic, files)
+ rrecommends_pn = d.getVar('RRECOMMENDS_' + pn)
+ if rrecommends_pn:
+ d.setVar('RRECOMMENDS_' + pn, "%s %s" % (pn_lic, rrecommends_pn))
+ else:
+ d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic))
+
+def copy_license_files(lic_files_paths, destdir):
+ import shutil
+ import errno
+
+ bb.utils.mkdirhier(destdir)
+ for (basename, path, beginline, endline) in lic_files_paths:
+ try:
+ src = path
+ dst = os.path.join(destdir, basename)
+ if os.path.exists(dst):
+ os.remove(dst)
+ if os.path.islink(src):
+ src = os.path.realpath(src)
+ canlink = os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev) and beginline is None and endline is None
+ if canlink:
+ try:
+ os.link(src, dst)
+ except OSError as err:
+ if err.errno == errno.EXDEV:
+ # Copy license files if hard-link is not possible even if st_dev is the
+ # same on source and destination (docker container with device-mapper?)
+ canlink = False
+ else:
+ raise
+ # Only chown if we did hardling, and, we're running under pseudo
+ if canlink and os.environ.get('PSEUDO_DISABLED') == '0':
+ os.chown(dst,0,0)
+ if not canlink:
+ begin_idx = int(beginline)-1 if beginline is not None else None
+ end_idx = int(endline) if endline is not None else None
+ if begin_idx is None and end_idx is None:
+ shutil.copyfile(src, dst)
+ else:
+ with open(src, 'rb') as src_f:
+ with open(dst, 'wb') as dst_f:
+ dst_f.write(b''.join(src_f.readlines()[begin_idx:end_idx]))
+
+ except Exception as e:
+ bb.warn("Could not copy license file %s to %s: %s" % (src, dst, e))
+
+def find_license_files(d):
+ """
+ Creates list of files used in LIC_FILES_CHKSUM and generic LICENSE files.
+ """
+ import shutil
+ import oe.license
+ from collections import defaultdict, OrderedDict
+
+ # All the license files for the package
+ lic_files = d.getVar('LIC_FILES_CHKSUM') or ""
+ pn = d.getVar('PN')
+ # The license files are located in S/LIC_FILE_CHECKSUM.
+ srcdir = d.getVar('S')
+ # Directory we store the generic licenses as set in the distro configuration
+ generic_directory = d.getVar('COMMON_LICENSE_DIR')
+ # List of basename, path tuples
+ lic_files_paths = []
+ # hash for keep track generic lics mappings
+ non_generic_lics = {}
+ # Entries from LIC_FILES_CHKSUM
+ lic_chksums = {}
+ license_source_dirs = []
+ license_source_dirs.append(generic_directory)
+ try:
+ additional_lic_dirs = d.getVar('LICENSE_PATH').split()
+ for lic_dir in additional_lic_dirs:
+ license_source_dirs.append(lic_dir)
+ except:
+ pass
+
+ class FindVisitor(oe.license.LicenseVisitor):
+ def visit_Str(self, node):
+ #
+ # Until I figure out what to do with
+ # the two modifiers I support (or greater = +
+ # and "with exceptions" being *
+ # we'll just strip out the modifier and put
+ # the base license.
+ find_license(node.s.replace("+", "").replace("*", ""))
+ self.generic_visit(node)
+
+ def find_license(license_type):
+ try:
+ bb.utils.mkdirhier(gen_lic_dest)
+ except:
+ pass
+ spdx_generic = None
+ license_source = None
+ # If the generic does not exist we need to check to see if there is an SPDX mapping to it,
+ # unless NO_GENERIC_LICENSE is set.
+ for lic_dir in license_source_dirs:
+ if not os.path.isfile(os.path.join(lic_dir, license_type)):
+ if d.getVarFlag('SPDXLICENSEMAP', license_type) != None:
+ # Great, there is an SPDXLICENSEMAP. We can copy!
+ bb.debug(1, "We need to use a SPDXLICENSEMAP for %s" % (license_type))
+ spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type)
+ license_source = lic_dir
+ break
+ elif os.path.isfile(os.path.join(lic_dir, license_type)):
+ spdx_generic = license_type
+ license_source = lic_dir
+ break
+
+ non_generic_lic = d.getVarFlag('NO_GENERIC_LICENSE', license_type)
+ if spdx_generic and license_source:
+ # we really should copy to generic_ + spdx_generic, however, that ends up messing the manifest
+ # audit up. This should be fixed in emit_pkgdata (or, we actually got and fix all the recipes)
+
+ lic_files_paths.append(("generic_" + license_type, os.path.join(license_source, spdx_generic),
+ None, None))
+
+ # The user may attempt to use NO_GENERIC_LICENSE for a generic license which doesn't make sense
+ # and should not be allowed, warn the user in this case.
+ if d.getVarFlag('NO_GENERIC_LICENSE', license_type):
+ bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type))
+
+ elif non_generic_lic and non_generic_lic in lic_chksums:
+ # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source
+ # of the package rather than the license_source_dirs.
+ lic_files_paths.append(("generic_" + license_type,
+ os.path.join(srcdir, non_generic_lic), None, None))
+ non_generic_lics[non_generic_lic] = license_type
+ else:
+ # Add explicity avoid of CLOSED license because this isn't generic
+ if license_type != 'CLOSED':
+ # And here is where we warn people that their licenses are lousy
+ bb.warn("%s: No generic license file exists for: %s in any provider" % (pn, license_type))
+ pass
+
+ if not generic_directory:
+ bb.fatal("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
+
+ for url in lic_files.split():
+ try:
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+ except bb.fetch.MalformedUrl:
+ bb.fatal("%s: LIC_FILES_CHKSUM contains an invalid URL: %s" % (d.getVar('PF'), url))
+ # We want the license filename and path
+ chksum = parm.get('md5', None)
+ beginline = parm.get('beginline')
+ endline = parm.get('endline')
+ lic_chksums[path] = (chksum, beginline, endline)
+
+ v = FindVisitor()
+ try:
+ v.visit_string(d.getVar('LICENSE'))
+ except oe.license.InvalidLicense as exc:
+ bb.fatal('%s: %s' % (d.getVar('PF'), exc))
+ except SyntaxError:
+ bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF')))
+ # Add files from LIC_FILES_CHKSUM to list of license files
+ lic_chksum_paths = defaultdict(OrderedDict)
+ for path, data in sorted(lic_chksums.items()):
+ lic_chksum_paths[os.path.basename(path)][data] = (os.path.join(srcdir, path), data[1], data[2])
+ for basename, files in lic_chksum_paths.items():
+ if len(files) == 1:
+ # Don't copy again a LICENSE already handled as non-generic
+ if basename in non_generic_lics:
+ continue
+ data = list(files.values())[0]
+ lic_files_paths.append(tuple([basename] + list(data)))
+ else:
+ # If there are multiple different license files with identical
+ # basenames we rename them to <file>.0, <file>.1, ...
+ for i, data in enumerate(files.values()):
+ lic_files_paths.append(tuple(["%s.%d" % (basename, i)] + list(data)))
+
+ return lic_files_paths
+
+def return_spdx(d, license):
+ """
+ This function returns the spdx mapping of a license if it exists.
+ """
+ return d.getVarFlag('SPDXLICENSEMAP', license)
+
+def canonical_license(d, license):
+ """
+ Return the canonical (SPDX) form of the license if available (so GPLv3
+ becomes GPL-3.0), for the license named 'X+', return canonical form of
+ 'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+),
+ or the passed license if there is no canonical form.
+ """
+ lic = d.getVarFlag('SPDXLICENSEMAP', license) or ""
+ if not lic and license.endswith('+'):
+ lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'))
+ if lic:
+ lic += '+'
+ return lic or license
+
+def expand_wildcard_licenses(d, wildcard_licenses):
+ """
+ Return actual spdx format license names if wildcard used. We expand
+ wildcards from SPDXLICENSEMAP flags and SRC_DISTRIBUTE_LICENSES values.
+ """
+ import fnmatch
+ licenses = []
+ spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
+ for wld_lic in wildcard_licenses:
+ spdxflags = fnmatch.filter(spdxmapkeys, wld_lic)
+ licenses += [d.getVarFlag('SPDXLICENSEMAP', flag) for flag in spdxflags]
+
+ spdx_lics = (d.getVar('SRC_DISTRIBUTE_LICENSES', False) or '').split()
+ for wld_lic in wildcard_licenses:
+ licenses += fnmatch.filter(spdx_lics, wld_lic)
+
+ licenses = list(set(licenses))
+ return licenses
+
+def incompatible_license_contains(license, truevalue, falsevalue, d):
+ license = canonical_license(d, license)
+ bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE') or "").split()
+ bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+ return truevalue if license in bad_licenses else falsevalue
+
+def incompatible_license(d, dont_want_licenses, package=None):
+ """
+ This function checks if a recipe has only incompatible licenses. It also
+ take into consideration 'or' operand. dont_want_licenses should be passed
+ as canonical (SPDX) names.
+ """
+ import oe.license
+ license = d.getVar("LICENSE_%s" % package) if package else None
+ if not license:
+ license = d.getVar('LICENSE')
+
+ # Handles an "or" or two license sets provided by
+ # flattened_licenses(), pick one that works if possible.
+ def choose_lic_set(a, b):
+ return a if all(oe.license.license_ok(canonical_license(d, lic),
+ dont_want_licenses) for lic in a) else b
+
+ try:
+ licenses = oe.license.flattened_licenses(license, choose_lic_set)
+ except oe.license.LicenseError as exc:
+ bb.fatal('%s: %s' % (d.getVar('P'), exc))
+ return any(not oe.license.license_ok(canonical_license(d, l), \
+ dont_want_licenses) for l in licenses)
+
+def check_license_flags(d):
+ """
+ This function checks if a recipe has any LICENSE_FLAGS that
+ aren't whitelisted.
+
+ If it does, it returns the first LICENSE_FLAGS item missing from the
+ whitelist, or all of the LICENSE_FLAGS if there is no whitelist.
+
+ If everything is is properly whitelisted, it returns None.
+ """
+
+ def license_flag_matches(flag, whitelist, pn):
+ """
+ Return True if flag matches something in whitelist, None if not.
+
+ Before we test a flag against the whitelist, we append _${PN}
+ to it. We then try to match that string against the
+ whitelist. This covers the normal case, where we expect
+ LICENSE_FLAGS to be a simple string like 'commercial', which
+ the user typically matches exactly in the whitelist by
+ explicitly appending the package name e.g 'commercial_foo'.
+ If we fail the match however, we then split the flag across
+ '_' and append each fragment and test until we either match or
+ run out of fragments.
+ """
+ flag_pn = ("%s_%s" % (flag, pn))
+ for candidate in whitelist:
+ if flag_pn == candidate:
+ return True
+
+ flag_cur = ""
+ flagments = flag_pn.split("_")
+ flagments.pop() # we've already tested the full string
+ for flagment in flagments:
+ if flag_cur:
+ flag_cur += "_"
+ flag_cur += flagment
+ for candidate in whitelist:
+ if flag_cur == candidate:
+ return True
+ return False
+
+ def all_license_flags_match(license_flags, whitelist):
+ """ Return first unmatched flag, None if all flags match """
+ pn = d.getVar('PN')
+ split_whitelist = whitelist.split()
+ for flag in license_flags.split():
+ if not license_flag_matches(flag, split_whitelist, pn):
+ return flag
+ return None
+
+ license_flags = d.getVar('LICENSE_FLAGS')
+ if license_flags:
+ whitelist = d.getVar('LICENSE_FLAGS_WHITELIST')
+ if not whitelist:
+ return license_flags
+ unmatched_flag = all_license_flags_match(license_flags, whitelist)
+ if unmatched_flag:
+ return unmatched_flag
+ return None
+
+def check_license_format(d):
+ """
+ This function checks if LICENSE is well defined,
+ Validate operators in LICENSES.
+ No spaces are allowed between LICENSES.
+ """
+ pn = d.getVar('PN')
+ licenses = d.getVar('LICENSE')
+ from oe.license import license_operator, license_operator_chars, license_pattern
+
+ elements = list(filter(lambda x: x.strip(), license_operator.split(licenses)))
+ for pos, element in enumerate(elements):
+ if license_pattern.match(element):
+ if pos > 0 and license_pattern.match(elements[pos - 1]):
+ bb.warn('%s: LICENSE value "%s" has an invalid format - license names ' \
+ 'must be separated by the following characters to indicate ' \
+ 'the license selection: %s' %
+ (pn, licenses, license_operator_chars))
+ elif not license_operator.match(element):
+ bb.warn('%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \
+ 'in the valid list of separators (%s)' %
+ (pn, licenses, element, license_operator_chars))
+
+SSTATETASKS += "do_populate_lic"
+do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
+do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
+
+ROOTFS_POSTPROCESS_COMMAND_prepend = "write_package_manifest; license_create_manifest; "
+do_rootfs[recrdeptask] += "do_populate_lic"
+
+IMAGE_POSTPROCESS_COMMAND_prepend = "write_deploy_manifest; "
+do_image[recrdeptask] += "do_populate_lic"
+
+python do_populate_lic_setscene () {
+ sstate_setscene(d)
+}
+addtask do_populate_lic_setscene
diff --git a/poky/meta/classes/linux-kernel-base.bbclass b/poky/meta/classes/linux-kernel-base.bbclass
new file mode 100644
index 000000000..89ce71605
--- /dev/null
+++ b/poky/meta/classes/linux-kernel-base.bbclass
@@ -0,0 +1,41 @@
+# parse kernel ABI version out of <linux/version.h>
+def get_kernelversion_headers(p):
+ import re
+
+ fn = p + '/include/linux/utsrelease.h'
+ if not os.path.isfile(fn):
+ # after 2.6.33-rc1
+ fn = p + '/include/generated/utsrelease.h'
+ if not os.path.isfile(fn):
+ fn = p + '/include/linux/version.h'
+
+ try:
+ f = open(fn, 'r')
+ except IOError:
+ return None
+
+ l = f.readlines()
+ f.close()
+ r = re.compile("#define UTS_RELEASE \"(.*)\"")
+ for s in l:
+ m = r.match(s)
+ if m:
+ return m.group(1)
+ return None
+
+
+def get_kernelversion_file(p):
+ fn = p + '/kernel-abiversion'
+
+ try:
+ with open(fn, 'r') as f:
+ return f.readlines()[0].strip()
+ except IOError:
+ return None
+
+def linux_module_packages(s, d):
+ suffix = ""
+ return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split()))
+
+# that's all
+
diff --git a/poky/meta/classes/linuxloader.bbclass b/poky/meta/classes/linuxloader.bbclass
new file mode 100644
index 000000000..8f30eb32e
--- /dev/null
+++ b/poky/meta/classes/linuxloader.bbclass
@@ -0,0 +1,70 @@
+LDSO_TCLIBC = "glibc"
+LDSO_TCLIBC_libc-musl = "musl"
+LDSO_TCLIBC_libc-baremetal = "musl"
+
+linuxloader_glibc () {
+ case ${TARGET_ARCH} in
+ powerpc | microblaze )
+ dynamic_loader="${base_libdir}/ld.so.1"
+ ;;
+ mipsisa32r6el | mipsisa32r6 | mipsisa64r6el | mipsisa64r6)
+ dynamic_loader="${base_libdir}/ld-linux-mipsn8.so.1"
+ ;;
+ mips* )
+ dynamic_loader="${base_libdir}/ld.so.1"
+ ;;
+ powerpc64)
+ dynamic_loader="${base_libdir}/ld64.so.1"
+ ;;
+ x86_64)
+ dynamic_loader="${base_libdir}/ld-linux-x86-64.so.2"
+ ;;
+ i*86 )
+ dynamic_loader="${base_libdir}/ld-linux.so.2"
+ ;;
+ arm )
+ dynamic_loader="${base_libdir}/ld-linux.so.3"
+ ;;
+ * )
+ dynamic_loader="/unknown_dynamic_linker"
+ ;;
+ esac
+ echo $dynamic_loader
+}
+
+linuxloader_musl () {
+ case ${TARGET_ARCH} in
+ microblaze* )
+ dynamic_loader="${base_libdir}/ld-musl-microblaze${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el' ,d)}.so.1"
+ ;;
+ mips* )
+ dynamic_loader="${base_libdir}/ld-musl-mips${ABIEXTENSION}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
+ ;;
+ powerpc )
+ dynamic_loader="${base_libdir}/ld-musl-powerpc${@['', '-sf'][d.getVar('TARGET_FPU') == 'soft']}.so.1"
+ ;;
+ powerpc64 )
+ dynamic_loader="${base_libdir}/ld-musl-powerpc64.so.1"
+ ;;
+ x86_64 )
+ dynamic_loader="${base_libdir}/ld-musl-x86_64.so.1"
+ ;;
+ i*86 )
+ dynamic_loader="${base_libdir}/ld-musl-i386.so.1"
+ ;;
+ arm* )
+ dynamic_loader="${base_libdir}/ld-musl-arm${ARMPKGSFX_ENDIAN}${ARMPKGSFX_EABI}.so.1"
+ ;;
+ aarch64* )
+ dynamic_loader="${base_libdir}/ld-musl-aarch64${ARMPKGSFX_ENDIAN_64}.so.1"
+ ;;
+ * )
+ dynamic_loader="/unknown_dynamic_linker"
+ ;;
+ esac
+ echo $dynamic_loader
+}
+
+linuxloader () {
+ linuxloader_${LDSO_TCLIBC}
+}
diff --git a/poky/meta/classes/live-vm-common.bbclass b/poky/meta/classes/live-vm-common.bbclass
new file mode 100644
index 000000000..68105d9b8
--- /dev/null
+++ b/poky/meta/classes/live-vm-common.bbclass
@@ -0,0 +1,61 @@
+# Some of the vars for vm and live image are conflicted, this function
+# is used for fixing the problem.
+def set_live_vm_vars(d, suffix):
+ vars = ['GRUB_CFG', 'SYSLINUX_CFG', 'ROOT', 'LABELS', 'INITRD']
+ for var in vars:
+ var_with_suffix = var + '_' + suffix
+ if d.getVar(var):
+ bb.warn('Found potential conflicted var %s, please use %s rather than %s' % \
+ (var, var_with_suffix, var))
+ elif d.getVar(var_with_suffix):
+ d.setVar(var, d.getVar(var_with_suffix))
+
+
+EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
+EFI_PROVIDER ?= "grub-efi"
+EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
+
+MKDOSFS_EXTRAOPTS ??= "-S 512"
+
+# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
+# contain "efi". This way legacy is supported by default if neither is
+# specified, maintaining the original behavior.
+def pcbios(d):
+ pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
+ if pcbios == "0":
+ pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d)
+ return pcbios
+
+PCBIOS = "${@pcbios(d)}"
+PCBIOS_CLASS = "${@['','syslinux'][d.getVar('PCBIOS') == '1']}"
+
+inherit ${EFI_CLASS}
+inherit ${PCBIOS_CLASS}
+
+populate_kernel() {
+ dest=$1
+ install -d $dest
+
+ # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
+ bbnote "Trying to install ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} as $dest/${KERNEL_IMAGETYPE}"
+ if [ -e ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ]; then
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} $dest/${KERNEL_IMAGETYPE}
+ else
+ bbwarn "${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} doesn't exist"
+ fi
+
+ # initrd is made of concatenation of multiple filesystem images
+ if [ -n "${INITRD}" ]; then
+ rm -f $dest/initrd
+ for fs in ${INITRD}
+ do
+ if [ -s "$fs" ]; then
+ cat $fs >> $dest/initrd
+ else
+ bbfatal "$fs is invalid. initrd image creation failed."
+ fi
+ done
+ chmod 0644 $dest/initrd
+ fi
+}
+
diff --git a/poky/meta/classes/logging.bbclass b/poky/meta/classes/logging.bbclass
new file mode 100644
index 000000000..a0c94e98c
--- /dev/null
+++ b/poky/meta/classes/logging.bbclass
@@ -0,0 +1,101 @@
+# The following logging mechanisms are to be used in bash functions of recipes.
+# They are intended to map one to one in intention and output format with the
+# python recipe logging functions of a similar naming convention: bb.plain(),
+# bb.note(), etc.
+
+LOGFIFO = "${T}/fifo.${@os.getpid()}"
+
+# Print the output exactly as it is passed in. Typically used for output of
+# tasks that should be seen on the console. Use sparingly.
+# Output: logs console
+bbplain() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbplain $*" > ${LOGFIFO}
+ else
+ echo "$*"
+ fi
+}
+
+# Notify the user of a noteworthy condition.
+# Output: logs
+bbnote() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbnote $*" > ${LOGFIFO}
+ else
+ echo "NOTE: $*"
+ fi
+}
+
+# Print a warning to the log. Warnings are non-fatal, and do not
+# indicate a build failure.
+# Output: logs console
+bbwarn() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbwarn $*" > ${LOGFIFO}
+ else
+ echo "WARNING: $*"
+ fi
+}
+
+# Print an error to the log. Errors are non-fatal in that the build can
+# continue, but they do indicate a build failure.
+# Output: logs console
+bberror() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bberror $*" > ${LOGFIFO}
+ else
+ echo "ERROR: $*"
+ fi
+}
+
+# Print a fatal error to the log. Fatal errors indicate build failure
+# and halt the build, exiting with an error code.
+# Output: logs console
+bbfatal() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbfatal $*" > ${LOGFIFO}
+ else
+ echo "ERROR: $*"
+ fi
+ exit 1
+}
+
+# Like bbfatal, except prevents the suppression of the error log by
+# bitbake's UI.
+# Output: logs console
+bbfatal_log() {
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbfatal_log $*" > ${LOGFIFO}
+ else
+ echo "ERROR: $*"
+ fi
+ exit 1
+}
+
+# Print debug messages. These are appropriate for progress checkpoint
+# messages to the logs. Depending on the debug log level, they may also
+# go to the console.
+# Output: logs console
+# Usage: bbdebug 1 "first level debug message"
+# bbdebug 2 "second level debug message"
+bbdebug() {
+ USAGE='Usage: bbdebug [123] "message"'
+ if [ $# -lt 2 ]; then
+ bbfatal "$USAGE"
+ fi
+
+ # Strip off the debug level and ensure it is an integer
+ DBGLVL=$1; shift
+ NONDIGITS=$(echo "$DBGLVL" | tr -d "[:digit:]")
+ if [ "$NONDIGITS" ]; then
+ bbfatal "$USAGE"
+ fi
+
+ # All debug output is printed to the logs
+ if [ -p ${LOGFIFO} ] ; then
+ printf "%b\0" "bbdebug $DBGLVL $*" > ${LOGFIFO}
+ else
+ echo "DEBUG: $*"
+ fi
+}
+
diff --git a/poky/meta/classes/manpages.bbclass b/poky/meta/classes/manpages.bbclass
new file mode 100644
index 000000000..d16237b89
--- /dev/null
+++ b/poky/meta/classes/manpages.bbclass
@@ -0,0 +1,5 @@
+# Inherit this class to enable or disable building and installation of manpages
+# depending on whether 'api-documentation' is in DISTRO_FEATURES. Such building
+# tends to pull in the entire XML stack and other tools, so it's not enabled
+# by default.
+PACKAGECONFIG_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}"
diff --git a/poky/meta/classes/meson.bbclass b/poky/meta/classes/meson.bbclass
new file mode 100644
index 000000000..2d7ee4fff
--- /dev/null
+++ b/poky/meta/classes/meson.bbclass
@@ -0,0 +1,130 @@
+inherit python3native
+
+DEPENDS_append = " meson-native ninja-native"
+
+# As Meson enforces out-of-tree builds we can just use cleandirs
+B = "${WORKDIR}/build"
+do_configure[cleandirs] = "${B}"
+
+# Where the meson.build build configuration is
+MESON_SOURCEPATH = "${S}"
+
+def noprefix(var, d):
+ return d.getVar(var).replace(d.getVar('prefix') + '/', '', 1)
+
+MESONOPTS = " --prefix ${prefix} \
+ --buildtype plain \
+ --bindir ${@noprefix('bindir', d)} \
+ --sbindir ${@noprefix('sbindir', d)} \
+ --datadir ${@noprefix('datadir', d)} \
+ --libdir ${@noprefix('libdir', d)} \
+ --libexecdir ${@noprefix('libexecdir', d)} \
+ --includedir ${@noprefix('includedir', d)} \
+ --mandir ${@noprefix('mandir', d)} \
+ --infodir ${@noprefix('infodir', d)} \
+ --sysconfdir ${sysconfdir} \
+ --localstatedir ${localstatedir} \
+ --sharedstatedir ${sharedstatedir}"
+
+MESON_TOOLCHAIN_ARGS = "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
+MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
+MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
+
+# both are required but not used by meson
+MESON_HOST_ENDIAN = "bogus-endian"
+MESON_TARGET_ENDIAN = "bogus-endian"
+
+EXTRA_OEMESON += "${PACKAGECONFIG_CONFARGS}"
+
+MESON_CROSS_FILE = ""
+MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
+MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
+
+def meson_array(var, d):
+ return "', '".join(d.getVar(var).split()).join(("'", "'"))
+
+addtask write_config before do_configure
+do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
+do_write_config() {
+ # This needs to be Py to split the args into single-element lists
+ cat >${WORKDIR}/meson.cross <<EOF
+[binaries]
+c = [${@meson_array('CC', d)}]
+cpp = [${@meson_array('CXX', d)}]
+ar = [${@meson_array('AR', d)}]
+nm = [${@meson_array('NM', d)}]
+ld = [${@meson_array('LD', d)}]
+strip = [${@meson_array('STRIP', d)}]
+readelf = [${@meson_array('READELF', d)}]
+pkgconfig = 'pkg-config'
+
+[properties]
+needs_exe_wrapper = true
+c_args = [${@meson_array('MESON_C_ARGS', d)}]
+c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
+cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}]
+cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}]
+gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
+
+[host_machine]
+system = '${HOST_OS}'
+cpu_family = '${HOST_ARCH}'
+cpu = '${HOST_ARCH}'
+endian = '${MESON_HOST_ENDIAN}'
+
+[target_machine]
+system = '${TARGET_OS}'
+cpu_family = '${TARGET_ARCH}'
+cpu = '${TARGET_ARCH}'
+endian = '${MESON_TARGET_ENDIAN}'
+EOF
+}
+
+CONFIGURE_FILES = "meson.build"
+
+meson_do_configure() {
+ if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
+ cat ${B}/meson-logs/meson-log.txt
+ bbfatal_log meson failed
+ fi
+}
+
+meson_do_configure_prepend_class-target() {
+ # Set these so that meson uses the native tools for its build sanity tests,
+ # which require executables to be runnable. The cross file will still
+ # override these for the target build. Note that we do *not* set CFLAGS,
+ # LDFLAGS, etc. as they will be slurped in by meson and applied to the
+ # target build, causing errors.
+ export CC="${BUILD_CC}"
+ export CXX="${BUILD_CXX}"
+ export LD="${BUILD_LD}"
+ export AR="${BUILD_AR}"
+}
+
+meson_do_configure_prepend_class-nativesdk() {
+ # Set these so that meson uses the native tools for its build sanity tests,
+ # which require executables to be runnable. The cross file will still
+ # override these for the nativesdk build. Note that we do *not* set CFLAGS,
+ # LDFLAGS, etc. as they will be slurped in by meson and applied to the
+ # nativesdk build, causing errors.
+ export CC="${BUILD_CC}"
+ export CXX="${BUILD_CXX}"
+ export LD="${BUILD_LD}"
+ export AR="${BUILD_AR}"
+}
+
+meson_do_configure_prepend_class-native() {
+ export PKG_CONFIG="pkg-config-native"
+}
+
+do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
+meson_do_compile() {
+ ninja ${PARALLEL_MAKE}
+}
+
+meson_do_install() {
+ DESTDIR='${D}' ninja ${PARALLEL_MAKEINST} install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/poky/meta/classes/meta.bbclass b/poky/meta/classes/meta.bbclass
new file mode 100644
index 000000000..5e6890238
--- /dev/null
+++ b/poky/meta/classes/meta.bbclass
@@ -0,0 +1,4 @@
+
+PACKAGES = ""
+
+do_build[recrdeptask] = "do_build"
diff --git a/poky/meta/classes/metadata_scm.bbclass b/poky/meta/classes/metadata_scm.bbclass
new file mode 100644
index 000000000..fa791f04c
--- /dev/null
+++ b/poky/meta/classes/metadata_scm.bbclass
@@ -0,0 +1,82 @@
+METADATA_BRANCH ?= "${@base_detect_branch(d)}"
+METADATA_REVISION ?= "${@base_detect_revision(d)}"
+
+def base_detect_revision(d):
+ path = base_get_scmbasepath(d)
+
+ scms = [base_get_metadata_git_revision]
+
+ for scm in scms:
+ rev = scm(path, d)
+ if rev != "<unknown>":
+ return rev
+
+ return "<unknown>"
+
+def base_detect_branch(d):
+ path = base_get_scmbasepath(d)
+
+ scms = [base_get_metadata_git_branch]
+
+ for scm in scms:
+ rev = scm(path, d)
+ if rev != "<unknown>":
+ return rev.strip()
+
+ return "<unknown>"
+
+def base_get_scmbasepath(d):
+ return os.path.join(d.getVar('COREBASE'), 'meta')
+
+def base_get_metadata_monotone_branch(path, d):
+ monotone_branch = "<unknown>"
+ try:
+ with open("%s/_MTN/options" % path) as f:
+ monotone_branch = f.read().strip()
+ if monotone_branch.startswith( "database" ):
+ monotone_branch_words = monotone_branch.split()
+ monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
+ except:
+ pass
+ return monotone_branch
+
+def base_get_metadata_monotone_revision(path, d):
+ monotone_revision = "<unknown>"
+ try:
+ with open("%s/_MTN/revision" % path) as f:
+ monotone_revision = f.read().strip()
+ if monotone_revision.startswith( "format_version" ):
+ monotone_revision_words = monotone_revision.split()
+ monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
+ except IOError:
+ pass
+ return monotone_revision
+
+def base_get_metadata_svn_revision(path, d):
+ # This only works with older subversion. For newer versions
+ # this function will need to be fixed by someone interested
+ revision = "<unknown>"
+ try:
+ with open("%s/.svn/entries" % path) as f:
+ revision = f.readlines()[3].strip()
+ except (IOError, IndexError):
+ pass
+ return revision
+
+def base_get_metadata_git_branch(path, d):
+ import bb.process
+
+ try:
+ rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
+ except bb.process.ExecutionError:
+ rev = '<unknown>'
+ return rev.strip()
+
+def base_get_metadata_git_revision(path, d):
+ import bb.process
+
+ try:
+ rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
+ except bb.process.ExecutionError:
+ rev = '<unknown>'
+ return rev.strip()
diff --git a/poky/meta/classes/migrate_localcount.bbclass b/poky/meta/classes/migrate_localcount.bbclass
new file mode 100644
index 000000000..810a54131
--- /dev/null
+++ b/poky/meta/classes/migrate_localcount.bbclass
@@ -0,0 +1,46 @@
+PRSERV_DUMPDIR ??= "${LOG_DIR}/db"
+LOCALCOUNT_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv-localcount-exports.inc"
+
+python migrate_localcount_handler () {
+ import bb.event
+ if not e.data:
+ return
+
+ pv = e.data.getVar('PV')
+ if not 'AUTOINC' in pv:
+ return
+
+ localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
+ pn = e.data.getVar('PN')
+ revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
+ counts = localcounts.get_by_pattern('%%-%s_count' % pn)
+ if not revs or not counts:
+ return
+
+ if len(revs) != len(counts):
+ bb.warn("The number of revs and localcounts don't match in %s" % pn)
+ return
+
+ version = e.data.getVar('PRAUTOINX')
+ srcrev = bb.fetch2.get_srcrev(e.data)
+ base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
+ pkgarch = e.data.getVar('PACKAGE_ARCH')
+ value = max(int(count) for count in counts)
+
+ if len(revs) == 1:
+ if srcrev != ('AUTOINC+%s' % revs[0]):
+ value += 1
+ else:
+ value += 1
+
+ bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR'))
+ df = e.data.getVar('LOCALCOUNT_DUMPFILE')
+ flock = bb.utils.lockfile("%s.lock" % df)
+ with open(df, 'a') as fd:
+ fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
+ (base_ver, pkgarch, srcrev, str(value)))
+ bb.utils.unlockfile(flock)
+}
+
+addhandler migrate_localcount_handler
+migrate_localcount_handler[eventmask] = "bb.event.RecipeParsed"
diff --git a/poky/meta/classes/mime.bbclass b/poky/meta/classes/mime.bbclass
new file mode 100644
index 000000000..0df15831c
--- /dev/null
+++ b/poky/meta/classes/mime.bbclass
@@ -0,0 +1,57 @@
+DEPENDS += "shared-mime-info"
+PACKAGE_WRITE_DEPS += "shared-mime-info-native"
+
+mime_postinst() {
+if [ "$1" = configure ]; then
+ UPDATEMIMEDB=`which update-mime-database`
+ if [ -x "$UPDATEMIMEDB" ] ; then
+ echo "Updating MIME database... this may take a while."
+ $UPDATEMIMEDB $D${datadir}/mime
+ else
+ echo "Missing update-mime-database, update of mime database failed!"
+ exit 1
+ fi
+fi
+}
+
+mime_postrm() {
+if [ "$1" = remove ] || [ "$1" = upgrade ]; then
+ UPDATEMIMEDB=`which update-mime-database`
+ if [ -x "$UPDATEMIMEDB" ] ; then
+ echo "Updating MIME database... this may take a while."
+ $UPDATEMIMEDB $D${datadir}/mime
+ else
+ echo "Missing update-mime-database, update of mime database failed!"
+ exit 1
+ fi
+fi
+}
+
+python populate_packages_append () {
+ import re
+ packages = d.getVar('PACKAGES').split()
+ pkgdest = d.getVar('PKGDEST')
+
+ for pkg in packages:
+ mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
+ mimes = []
+ mime_re = re.compile(".*\.xml$")
+ if os.path.exists(mime_dir):
+ for f in os.listdir(mime_dir):
+ if mime_re.match(f):
+ mimes.append(f)
+ if mimes:
+ bb.note("adding mime postinst and postrm scripts to %s" % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('mime_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ postrm = d.getVar('pkg_postrm_%s' % pkg)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('mime_postrm')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+ bb.note("adding shared-mime-info-data dependency to %s" % pkg)
+ d.appendVar('RDEPENDS_' + pkg, " shared-mime-info-data")
+}
diff --git a/poky/meta/classes/mirrors.bbclass b/poky/meta/classes/mirrors.bbclass
new file mode 100644
index 000000000..b331afc5d
--- /dev/null
+++ b/poky/meta/classes/mirrors.bbclass
@@ -0,0 +1,75 @@
+MIRRORS += "\
+${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20120328T092752Z/debian/pool \n \
+${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20110127T084257Z/debian/pool \n \
+${DEBIAN_MIRROR} http://snapshot.debian.org/archive/debian-archive/20090802T004153Z/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.de.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.au.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.cl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.hr.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.fi.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.hk.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.hu.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.ie.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.it.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.jp.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.no.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.pl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.ro.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.si.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.es.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.se.debian.org/debian/pool \n \
+${DEBIAN_MIRROR} http://ftp.tr.debian.org/debian/pool \n \
+${GNU_MIRROR} https://mirrors.kernel.org/gnu \n \
+${KERNELORG_MIRROR} http://www.kernel.org/pub \n \
+${GNUPG_MIRROR} ftp://ftp.gnupg.org/gcrypt \n \
+${GNUPG_MIRROR} ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt \n \
+${GNUPG_MIRROR} ftp://mirrors.dotsrc.org/gcrypt \n \
+ftp://dante.ctan.org/tex-archive ftp://ftp.fu-berlin.de/tex/CTAN \n \
+ftp://dante.ctan.org/tex-archive http://sunsite.sut.ac.jp/pub/archives/ctan/ \n \
+ftp://dante.ctan.org/tex-archive http://ctan.unsw.edu.au/ \n \
+ftp://ftp.gnutls.org/gcrypt/gnutls ${GNUPG_MIRROR}/gnutls \n \
+http://ftp.info-zip.org/pub/infozip/src/ http://mirror.switch.ch/ftp/mirror/infozip/src/ \n \
+http://ftp.info-zip.org/pub/infozip/src/ ftp://sunsite.icm.edu.pl/pub/unix/archiving/info-zip/src/ \n \
+http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/ http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/ \n \
+${APACHE_MIRROR} http://www.us.apache.org/dist \n \
+${APACHE_MIRROR} http://archive.apache.org/dist \n \
+http://downloads.sourceforge.net/watchdog/ http://fossies.org/linux/misc/ \n \
+${SAVANNAH_GNU_MIRROR} http://download-mirror.savannah.gnu.org/releases \n \
+${SAVANNAH_NONGNU_MIRROR} http://download-mirror.savannah.nongnu.org/releases \n \
+ftp://sourceware.org/pub http://mirrors.kernel.org/sourceware \n \
+ftp://sourceware.org/pub http://gd.tuwien.ac.at/gnu/sourceware \n \
+ftp://sourceware.org/pub http://ftp.gwdg.de/pub/linux/sources.redhat.com/sourceware \n \
+cvs://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+svn://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+git://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+hg://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+bzr://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+p4://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+osc://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+https?$://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+ftp://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+npm://.*/?.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+cvs://.*/.* http://sources.openembedded.org/ \n \
+svn://.*/.* http://sources.openembedded.org/ \n \
+git://.*/.* http://sources.openembedded.org/ \n \
+hg://.*/.* http://sources.openembedded.org/ \n \
+bzr://.*/.* http://sources.openembedded.org/ \n \
+p4://.*/.* http://sources.openembedded.org/ \n \
+osc://.*/.* http://sources.openembedded.org/ \n \
+https?$://.*/.* http://sources.openembedded.org/ \n \
+ftp://.*/.* http://sources.openembedded.org/ \n \
+npm://.*/?.* http://sources.openembedded.org/ \n \
+${CPAN_MIRROR} http://cpan.metacpan.org/ \n \
+${CPAN_MIRROR} http://search.cpan.org/CPAN/ \n \
+"
+
+# Use MIRRORS to provide git repo fallbacks using the https protocol, for cases
+# where git native protocol fetches may fail due to local firewall rules, etc.
+
+MIRRORS += "\
+git://salsa.debian.org/.* git://salsa.debian.org/PATH;protocol=https \n \
+git://git.gnome.org/.* git://git.gnome.org/browse/PATH;protocol=https \n \
+git://git.savannah.gnu.org/.* git://git.savannah.gnu.org/git/PATH;protocol=https \n \
+git://git.yoctoproject.org/.* git://git.yoctoproject.org/git/PATH;protocol=https \n \
+git://.*/.* git://HOST/PATH;protocol=https \n \
+"
diff --git a/poky/meta/classes/module-base.bbclass b/poky/meta/classes/module-base.bbclass
new file mode 100644
index 000000000..27bd69ff3
--- /dev/null
+++ b/poky/meta/classes/module-base.bbclass
@@ -0,0 +1,21 @@
+inherit kernel-arch
+
+# We do the dependency this way because the output is not preserved
+# in sstate, so we must force do_compile to run (once).
+do_configure[depends] += "make-mod-scripts:do_compile"
+
+export OS = "${TARGET_OS}"
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+
+# This points to the build artefacts from the main kernel build
+# such as .config and System.map
+# Confusingly it is not the module build output (which is ${B}) but
+# we didn't pick the name.
+export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}"
+
+export KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
+KERNEL_OBJECT_SUFFIX = ".ko"
+
+# kernel modules are generally machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/poky/meta/classes/module.bbclass b/poky/meta/classes/module.bbclass
new file mode 100644
index 000000000..e34496024
--- /dev/null
+++ b/poky/meta/classes/module.bbclass
@@ -0,0 +1,73 @@
+inherit module-base kernel-module-split pkgconfig
+
+EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
+
+MODULES_INSTALL_TARGET ?= "modules_install"
+MODULES_MODULE_SYMVERS_LOCATION ?= ""
+
+python __anonymous () {
+ depends = d.getVar('DEPENDS')
+ extra_symbols = []
+ for dep in depends.split():
+ if dep.startswith("kernel-module-"):
+ extra_symbols.append("${STAGING_INCDIR}/" + dep + "/Module.symvers")
+ d.setVar('KBUILD_EXTRA_SYMBOLS', " ".join(extra_symbols))
+}
+
+python do_devshell_prepend () {
+ os.environ['CFLAGS'] = ''
+ os.environ['CPPFLAGS'] = ''
+ os.environ['CXXFLAGS'] = ''
+ os.environ['LDFLAGS'] = ''
+
+ os.environ['KERNEL_PATH'] = d.getVar('STAGING_KERNEL_DIR')
+ os.environ['KERNEL_SRC'] = d.getVar('STAGING_KERNEL_DIR')
+ os.environ['KERNEL_VERSION'] = d.getVar('KERNEL_VERSION')
+ os.environ['CC'] = d.getVar('KERNEL_CC')
+ os.environ['LD'] = d.getVar('KERNEL_LD')
+ os.environ['AR'] = d.getVar('KERNEL_AR')
+ os.environ['O'] = d.getVar('STAGING_KERNEL_BUILDDIR')
+ kbuild_extra_symbols = d.getVar('KBUILD_EXTRA_SYMBOLS')
+ if kbuild_extra_symbols:
+ os.environ['KBUILD_EXTRA_SYMBOLS'] = kbuild_extra_symbols
+ else:
+ os.environ['KBUILD_EXTRA_SYMBOLS'] = ''
+}
+
+module_do_compile() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \
+ KERNEL_VERSION=${KERNEL_VERSION} \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}" \
+ O=${STAGING_KERNEL_BUILDDIR} \
+ KBUILD_EXTRA_SYMBOLS="${KBUILD_EXTRA_SYMBOLS}" \
+ ${MAKE_TARGETS}
+}
+
+module_do_install() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ oe_runmake DEPMOD=echo MODLIB="${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}" \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ O=${STAGING_KERNEL_BUILDDIR} \
+ ${MODULES_INSTALL_TARGET}
+
+ if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then
+ bbwarn "Module.symvers not found in ${B}/${MODULES_MODULE_SYMVERS_LOCATION}"
+ bbwarn "Please consider setting MODULES_MODULE_SYMVERS_LOCATION to a"
+ bbwarn "directory below B to get correct inter-module dependencies"
+ else
+ install -Dm0644 "${B}/${MODULES_MODULE_SYMVERS_LOCATION}"/Module.symvers ${D}${includedir}/${BPN}/Module.symvers
+ # Module.symvers contains absolute path to the build directory.
+ # While it doesn't actually seem to matter which path is specified,
+ # clear them out to avoid confusion
+ sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers
+ fi
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+# add all splitted modules to PN RDEPENDS, PN can be empty now
+KERNEL_MODULES_META_PACKAGE = "${PN}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
diff --git a/poky/meta/classes/multilib.bbclass b/poky/meta/classes/multilib.bbclass
new file mode 100644
index 000000000..519c1a55b
--- /dev/null
+++ b/poky/meta/classes/multilib.bbclass
@@ -0,0 +1,153 @@
+python multilib_virtclass_handler () {
+ cls = e.data.getVar("BBEXTENDCURR")
+ variant = e.data.getVar("BBEXTENDVARIANT")
+ if cls != "multilib" or not variant:
+ return
+
+ localdata = bb.data.createCopy(e.data)
+ localdata.delVar('TMPDIR')
+ e.data.setVar('STAGING_KERNEL_DIR', localdata.getVar('STAGING_KERNEL_DIR'))
+
+ # There should only be one kernel in multilib configs
+ # We also skip multilib setup for module packages.
+ provides = (e.data.getVar("PROVIDES") or "").split()
+ if "virtual/kernel" in provides or bb.data.inherits_class('module-base', e.data) or "make-mod-scripts" in e.data.getVar("PN"):
+ raise bb.parse.SkipRecipe("We shouldn't have multilib variants for the kernel")
+
+ save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME") or ""
+ for name in save_var_name.split():
+ val=e.data.getVar(name)
+ if val:
+ e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
+
+ overrides = e.data.getVar("OVERRIDES", False)
+ pn = e.data.getVar("PN", False)
+ overrides = overrides.replace("pn-${PN}", "pn-${PN}:pn-" + pn)
+ e.data.setVar("OVERRIDES", overrides)
+
+ if bb.data.inherits_class('image', e.data):
+ e.data.setVar("MLPREFIX", variant + "-")
+ e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
+ e.data.setVar('SDKTARGETSYSROOT', e.data.getVar('SDKTARGETSYSROOT'))
+ target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False)
+ if target_vendor:
+ e.data.setVar("TARGET_VENDOR", target_vendor)
+ return
+
+ if bb.data.inherits_class('cross-canadian', e.data):
+ e.data.setVar("MLPREFIX", variant + "-")
+ override = ":virtclass-multilib-" + variant
+ e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
+ return
+
+ if bb.data.inherits_class('native', e.data):
+ raise bb.parse.SkipRecipe("We can't extend native recipes")
+
+ if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
+ raise bb.parse.SkipRecipe("We can't extend nativesdk recipes")
+
+ if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
+ raise bb.parse.SkipRecipe("Don't extend allarch recipes which are not packagegroups")
+
+
+ # Expand this since this won't work correctly once we set a multilib into place
+ e.data.setVar("ALL_MULTILIB_PACKAGE_ARCHS", e.data.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
+
+ override = ":virtclass-multilib-" + variant
+
+ blacklist = e.data.getVarFlag('PNBLACKLIST', e.data.getVar('PN'))
+ if blacklist:
+ pn_new = variant + "-" + e.data.getVar('PN')
+ if not e.data.getVarFlag('PNBLACKLIST', pn_new):
+ e.data.setVarFlag('PNBLACKLIST', pn_new, blacklist)
+
+ e.data.setVar("MLPREFIX", variant + "-")
+ e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
+ e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
+
+ # Expand the WHITELISTs with multilib prefix
+ for whitelist in ["WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
+ pkgs = e.data.getVar(whitelist)
+ for pkg in pkgs.split():
+ pkgs += " " + variant + "-" + pkg
+ e.data.setVar(whitelist, pkgs)
+
+ # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
+ newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
+ if newtune:
+ e.data.setVar("DEFAULTTUNE", newtune)
+}
+
+addhandler multilib_virtclass_handler
+multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
+
+python __anonymous () {
+ variant = d.getVar("BBEXTENDVARIANT")
+
+ import oe.classextend
+
+ clsextend = oe.classextend.ClassExtender(variant, d)
+
+ if bb.data.inherits_class('image', d):
+ clsextend.map_depends_variable("PACKAGE_INSTALL")
+ clsextend.map_depends_variable("LINGUAS_INSTALL")
+ clsextend.map_depends_variable("RDEPENDS")
+ pinstall = d.getVar("LINGUAS_INSTALL") + " " + d.getVar("PACKAGE_INSTALL")
+ d.setVar("PACKAGE_INSTALL", pinstall)
+ d.setVar("LINGUAS_INSTALL", "")
+ # FIXME, we need to map this to something, not delete it!
+ d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
+ bb.build.deltask('do_populate_sdk', d)
+ bb.build.deltask('do_populate_sdk_ext', d)
+ return
+
+ clsextend.map_depends_variable("DEPENDS")
+ clsextend.map_variable("PROVIDES")
+
+ if bb.data.inherits_class('cross-canadian', d):
+ return
+
+ clsextend.rename_packages()
+ clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
+
+ clsextend.map_packagevars()
+ clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
+ clsextend.map_variable("INITSCRIPT_PACKAGES")
+ clsextend.map_variable("USERADD_PACKAGES")
+ clsextend.map_variable("SYSTEMD_PACKAGES")
+}
+
+PACKAGEFUNCS_append = " do_package_qa_multilib"
+
+python do_package_qa_multilib() {
+
+ def check_mlprefix(pkg, var, mlprefix):
+ values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg)) or d.getVar(var) or "")
+ candidates = []
+ for i in values:
+ if i.startswith('virtual/'):
+ i = i[len('virtual/'):]
+ if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)) and \
+ (not 'cross-canadian' in i) and (not i.startswith("nativesdk-")) and \
+ (not i.startswith("rtld")) and (not i.startswith('kernel-vmlinux')):
+ candidates.append(i)
+ if len(candidates) > 0:
+ msg = "%s package %s - suspicious values '%s' in %s" \
+ % (d.getVar('PN'), pkg, ' '.join(candidates), var)
+ package_qa_handle_error("multilib", msg, d)
+
+ ml = d.getVar('MLPREFIX')
+ if not ml:
+ return
+
+ packages = d.getVar('PACKAGES')
+ for pkg in packages.split():
+ check_mlprefix(pkg, 'RDEPENDS', ml)
+ check_mlprefix(pkg, 'RPROVIDES', ml)
+ check_mlprefix(pkg, 'RRECOMMENDS', ml)
+ check_mlprefix(pkg, 'RSUGGESTS', ml)
+ check_mlprefix(pkg, 'RREPLACES', ml)
+ check_mlprefix(pkg, 'RCONFLICTS', ml)
+}
diff --git a/poky/meta/classes/multilib_global.bbclass b/poky/meta/classes/multilib_global.bbclass
new file mode 100644
index 000000000..d2ec1adfe
--- /dev/null
+++ b/poky/meta/classes/multilib_global.bbclass
@@ -0,0 +1,202 @@
+def preferred_ml_updates(d):
+ # If any PREFERRED_PROVIDER or PREFERRED_VERSION are set,
+ # we need to mirror these variables in the multilib case;
+ multilibs = d.getVar('MULTILIBS') or ""
+ if not multilibs:
+ return
+
+ prefixes = []
+ for ext in multilibs.split():
+ eext = ext.split(':')
+ if len(eext) > 1 and eext[0] == 'multilib':
+ prefixes.append(eext[1])
+
+ versions = []
+ providers = []
+ rproviders = []
+ for v in d.keys():
+ if v.startswith("PREFERRED_VERSION_"):
+ versions.append(v)
+ if v.startswith("PREFERRED_PROVIDER_"):
+ providers.append(v)
+ if v.startswith("PREFERRED_RPROVIDER_"):
+ rproviders.append(v)
+
+ for v in versions:
+ val = d.getVar(v, False)
+ pkg = v.replace("PREFERRED_VERSION_", "")
+ if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")):
+ continue
+ if '-cross-' in pkg and '${' in pkg:
+ for p in prefixes:
+ localdata = bb.data.createCopy(d)
+ override = ":virtclass-multilib-" + p
+ localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+ if "-canadian-" in pkg:
+ newname = localdata.expand(v)
+ else:
+ newname = localdata.expand(v).replace("PREFERRED_VERSION_", "PREFERRED_VERSION_" + p + '-')
+ if newname != v:
+ newval = localdata.expand(val)
+ d.setVar(newname, newval)
+ # Avoid future variable key expansion
+ vexp = d.expand(v)
+ if v != vexp and d.getVar(v, False):
+ d.renameVar(v, vexp)
+ continue
+ for p in prefixes:
+ newname = "PREFERRED_VERSION_" + p + "-" + pkg
+ if not d.getVar(newname, False):
+ d.setVar(newname, val)
+
+ for prov in providers:
+ val = d.getVar(prov, False)
+ pkg = prov.replace("PREFERRED_PROVIDER_", "")
+ if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")):
+ continue
+ if 'cross-canadian' in pkg:
+ for p in prefixes:
+ localdata = bb.data.createCopy(d)
+ override = ":virtclass-multilib-" + p
+ localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+ newname = localdata.expand(prov)
+ if newname != prov:
+ newval = localdata.expand(val)
+ d.setVar(newname, newval)
+ # Avoid future variable key expansion
+ provexp = d.expand(prov)
+ if prov != provexp and d.getVar(prov, False):
+ d.renameVar(prov, provexp)
+ continue
+ virt = ""
+ if pkg.startswith("virtual/"):
+ pkg = pkg.replace("virtual/", "")
+ virt = "virtual/"
+ for p in prefixes:
+ newval = None
+ if pkg != "kernel":
+ newval = p + "-" + val
+
+ # implement variable keys
+ localdata = bb.data.createCopy(d)
+ override = ":virtclass-multilib-" + p
+ localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+ newname = localdata.expand(prov)
+ if newname != prov and not d.getVar(newname, False):
+ d.setVar(newname, localdata.expand(newval))
+
+ # implement alternative multilib name
+ newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg)
+ if not d.getVar(newname, False) and newval != None:
+ d.setVar(newname, localdata.expand(newval))
+ # Avoid future variable key expansion
+ provexp = d.expand(prov)
+ if prov != provexp and d.getVar(prov, False):
+ d.renameVar(prov, provexp)
+
+ for prov in rproviders:
+ val = d.getVar(prov, False)
+ pkg = prov.replace("PREFERRED_RPROVIDER_", "")
+ for p in prefixes:
+ newval = p + "-" + val
+
+ # implement variable keys
+ localdata = bb.data.createCopy(d)
+ override = ":virtclass-multilib-" + p
+ localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+ newname = localdata.expand(prov)
+ if newname != prov and not d.getVar(newname, False):
+ d.setVar(newname, localdata.expand(newval))
+
+ # implement alternative multilib name
+ newname = localdata.expand("PREFERRED_RPROVIDER_" + p + "-" + pkg)
+ if not d.getVar(newname, False) and newval != None:
+ d.setVar(newname, localdata.expand(newval))
+ # Avoid future variable key expansion
+ provexp = d.expand(prov)
+ if prov != provexp and d.getVar(prov, False):
+ d.renameVar(prov, provexp)
+
+ def translate_provide(prefix, prov):
+ if not prov.startswith("virtual/"):
+ return prefix + "-" + prov
+ if prov == "virtual/kernel":
+ return prov
+ prov = prov.replace("virtual/", "")
+ return "virtual/" + prefix + "-" + prov
+
+ mp = (d.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
+ extramp = []
+ for p in mp:
+ if p.endswith("-native") or "-crosssdk-" in p or p.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in p:
+ continue
+ for pref in prefixes:
+ extramp.append(translate_provide(pref, p))
+ d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp))
+
+ abisafe = (d.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
+ extras = []
+ for p in prefixes:
+ for a in abisafe:
+ extras.append(p + "-" + a)
+ d.appendVar("SIGGEN_EXCLUDERECIPES_ABISAFE", " " + " ".join(extras))
+
+ siggen_exclude = (d.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
+ extras = []
+ for p in prefixes:
+ for a in siggen_exclude:
+ a1, a2 = a.split("->")
+ extras.append(translate_provide(p, a1) + "->" + translate_provide(p, a2))
+ d.appendVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", " " + " ".join(extras))
+
+python multilib_virtclass_handler_vendor () {
+ if isinstance(e, bb.event.ConfigParsed):
+ for v in e.data.getVar("MULTILIB_VARIANTS").split():
+ if e.data.getVar("TARGET_VENDOR_virtclass-multilib-" + v, False) is None:
+ e.data.setVar("TARGET_VENDOR_virtclass-multilib-" + v, e.data.getVar("TARGET_VENDOR", False) + "ml" + v)
+ preferred_ml_updates(e.data)
+}
+addhandler multilib_virtclass_handler_vendor
+multilib_virtclass_handler_vendor[eventmask] = "bb.event.ConfigParsed"
+
+python multilib_virtclass_handler_global () {
+ variant = e.data.getVar("BBEXTENDVARIANT")
+ if variant:
+ return
+
+ if bb.data.inherits_class('kernel', e.data) or \
+ bb.data.inherits_class('module-base', e.data) or \
+ (bb.data.inherits_class('allarch', e.data) and\
+ not bb.data.inherits_class('packagegroup', e.data)):
+ variants = (e.data.getVar("MULTILIB_VARIANTS") or "").split()
+
+ import oe.classextend
+ clsextends = []
+ for variant in variants:
+ clsextends.append(oe.classextend.ClassExtender(variant, e.data))
+
+ # Process PROVIDES
+ origprovs = provs = e.data.getVar("PROVIDES") or ""
+ for clsextend in clsextends:
+ provs = provs + " " + clsextend.map_variable("PROVIDES", setvar=False)
+ e.data.setVar("PROVIDES", provs)
+
+ # Process RPROVIDES
+ origrprovs = rprovs = e.data.getVar("RPROVIDES") or ""
+ for clsextend in clsextends:
+ rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES", setvar=False)
+ if rprovs.strip():
+ e.data.setVar("RPROVIDES", rprovs)
+
+ # Process RPROVIDES_${PN}...
+ for pkg in (e.data.getVar("PACKAGES") or "").split():
+ origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg) or ""
+ for clsextend in clsextends:
+ rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES_%s" % pkg, setvar=False)
+ rprovs = rprovs + " " + clsextend.extname + "-" + pkg
+ e.data.setVar("RPROVIDES_%s" % pkg, rprovs)
+}
+
+addhandler multilib_virtclass_handler_global
+multilib_virtclass_handler_global[eventmask] = "bb.event.RecipeParsed"
+
diff --git a/poky/meta/classes/multilib_header.bbclass b/poky/meta/classes/multilib_header.bbclass
new file mode 100644
index 000000000..e03f5b13b
--- /dev/null
+++ b/poky/meta/classes/multilib_header.bbclass
@@ -0,0 +1,52 @@
+inherit siteinfo
+
+# If applicable on the architecture, this routine will rename the header and
+# add a unique identifier to the name for the ABI/bitsize that is being used.
+# A wrapper will be generated for the architecture that knows how to call
+# all of the ABI variants for that given architecture.
+#
+oe_multilib_header() {
+
+ case ${HOST_OS} in
+ *-musl*)
+ return
+ ;;
+ *)
+ esac
+ # For MIPS: "n32" is a special case, which needs to be
+ # distinct from both 64-bit and 32-bit.
+ case ${TARGET_ARCH} in
+ mips*) case "${MIPSPKGSFX_ABI}" in
+ "-n32")
+ ident=n32
+ ;;
+ *)
+ ident=${SITEINFO_BITS}
+ ;;
+ esac
+ ;;
+ *) ident=${SITEINFO_BITS}
+ esac
+ for each_header in "$@" ; do
+ if [ ! -f "${D}/${includedir}/$each_header" ]; then
+ bberror "oe_multilib_header: Unable to find header $each_header."
+ continue
+ fi
+ stem=$(echo $each_header | sed 's#\.h$##')
+ # if mips64/n32 set ident to n32
+ mv ${D}/${includedir}/$each_header ${D}/${includedir}/${stem}-${ident}.h
+
+ sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h > ${D}/${includedir}/$each_header
+ done
+}
+
+# Dependencies on arch variables like MIPSPKGSFX_ABI can be problematic.
+# We don't need multilib headers for native builds so brute force things.
+oe_multilib_header_class-native () {
+ return
+}
+
+# Nor do we need multilib headers for nativesdk builds.
+oe_multilib_header_class-nativesdk () {
+ return
+}
diff --git a/poky/meta/classes/native.bbclass b/poky/meta/classes/native.bbclass
new file mode 100644
index 000000000..a911f2aeb
--- /dev/null
+++ b/poky/meta/classes/native.bbclass
@@ -0,0 +1,192 @@
+# We want native packages to be relocatable
+inherit relocatable
+
+# Native packages are built indirectly via dependency,
+# no need for them to be a direct target of 'world'
+EXCLUDE_FROM_WORLD = "1"
+
+PACKAGES = ""
+PACKAGES_class-native = ""
+PACKAGES_DYNAMIC = ""
+PACKAGES_DYNAMIC_class-native = ""
+PACKAGE_ARCH = "${BUILD_ARCH}"
+
+# used by cmake class
+OECMAKE_RPATH = "${libdir}"
+OECMAKE_RPATH_class-native = "${libdir}"
+
+# When this class has packaging enabled, setting
+# RPROVIDES becomes unnecessary.
+RPROVIDES = "${PN}"
+
+TARGET_ARCH = "${BUILD_ARCH}"
+TARGET_OS = "${BUILD_OS}"
+TARGET_VENDOR = "${BUILD_VENDOR}"
+TARGET_PREFIX = "${BUILD_PREFIX}"
+TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
+TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
+TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILD_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
+TARGET_FPU = ""
+
+HOST_ARCH = "${BUILD_ARCH}"
+HOST_OS = "${BUILD_OS}"
+HOST_VENDOR = "${BUILD_VENDOR}"
+HOST_PREFIX = "${BUILD_PREFIX}"
+HOST_CC_ARCH = "${BUILD_CC_ARCH}"
+HOST_LD_ARCH = "${BUILD_LD_ARCH}"
+HOST_AS_ARCH = "${BUILD_AS_ARCH}"
+
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXXFLAGS = "${BUILD_CXXFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
+LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE} "
+
+STAGING_BINDIR = "${STAGING_BINDIR_NATIVE}"
+STAGING_BINDIR_CROSS = "${STAGING_BINDIR_NATIVE}"
+
+# native pkg doesn't need the TOOLCHAIN_OPTIONS.
+TOOLCHAIN_OPTIONS = ""
+
+# Don't build ptest natively
+PTEST_ENABLED = "0"
+
+# Don't use site files for native builds
+export CONFIG_SITE = "${COREBASE}/meta/site/native"
+
+# set the compiler as well. It could have been set to something else
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export FC = "${BUILD_FC}"
+export CPP = "${BUILD_CPP}"
+export LD = "${BUILD_LD}"
+export CCLD = "${BUILD_CCLD}"
+export AR = "${BUILD_AR}"
+export AS = "${BUILD_AS}"
+export RANLIB = "${BUILD_RANLIB}"
+export STRIP = "${BUILD_STRIP}"
+export NM = "${BUILD_NM}"
+
+# Path prefixes
+base_prefix = "${STAGING_DIR_NATIVE}"
+prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+
+bindir = "${STAGING_BINDIR_NATIVE}"
+sbindir = "${STAGING_SBINDIR_NATIVE}"
+libdir = "${STAGING_LIBDIR_NATIVE}"
+includedir = "${STAGING_INCDIR_NATIVE}"
+sysconfdir = "${STAGING_ETCDIR_NATIVE}"
+datadir = "${STAGING_DATADIR_NATIVE}"
+
+baselib = "lib"
+
+export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir} /lib /lib64 /usr/lib /usr/lib64"
+
+NATIVE_PACKAGE_PATH_SUFFIX ?= ""
+bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+
+# Since we actually install these into situ there is no staging prefix
+STAGING_DIR_HOST = ""
+STAGING_DIR_TARGET = ""
+PKG_CONFIG_DIR = "${libdir}/pkgconfig"
+
+EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
+PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
+PKG_CONFIG_SYSROOT_DIR = ""
+PKG_CONFIG_SYSTEM_LIBRARY_PATH[unexport] = "1"
+PKG_CONFIG_SYSTEM_INCLUDE_PATH[unexport] = "1"
+
+# we dont want libc-*libc to kick in for native recipes
+LIBCOVERRIDE = ""
+CLASSOVERRIDE = "class-native"
+MACHINEOVERRIDES = ""
+MACHINE_FEATURES = ""
+
+PATH_prepend = "${COREBASE}/scripts/native-intercept:"
+
+# This class encodes staging paths into its scripts data so can only be
+# reused if we manipulate the paths.
+SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
+
+python native_virtclass_handler () {
+ pn = e.data.getVar("PN")
+ if not pn.endswith("-native"):
+ return
+
+ # Set features here to prevent appends and distro features backfill
+ # from modifying native distro features
+ features = set(d.getVar("DISTRO_FEATURES_NATIVE").split())
+ filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split())
+ d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
+
+ classextend = e.data.getVar('BBCLASSEXTEND') or ""
+ if "native" not in classextend:
+ return
+
+ def map_dependencies(varname, d, suffix = ""):
+ if suffix:
+ varname = varname + "_" + suffix
+ deps = d.getVar(varname)
+ if not deps:
+ return
+ deps = bb.utils.explode_deps(deps)
+ newdeps = []
+ for dep in deps:
+ if dep == pn:
+ continue
+ elif "-cross-" in dep:
+ newdeps.append(dep.replace("-cross", "-native"))
+ elif not dep.endswith("-native"):
+ newdeps.append(dep + "-native")
+ else:
+ newdeps.append(dep)
+ d.setVar(varname, " ".join(newdeps))
+
+ e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
+
+ map_dependencies("DEPENDS", e.data)
+ for pkg in [e.data.getVar("PN"), "", "${PN}"]:
+ map_dependencies("RDEPENDS", e.data, pkg)
+ map_dependencies("RRECOMMENDS", e.data, pkg)
+ map_dependencies("RSUGGESTS", e.data, pkg)
+ map_dependencies("RPROVIDES", e.data, pkg)
+ map_dependencies("RREPLACES", e.data, pkg)
+
+ provides = e.data.getVar("PROVIDES")
+ nprovides = []
+ for prov in provides.split():
+ if prov.find(pn) != -1:
+ nprovides.append(prov)
+ elif not prov.endswith("-native"):
+ nprovides.append(prov.replace(prov, prov + "-native"))
+ else:
+ nprovides.append(prov)
+ e.data.setVar("PROVIDES", ' '.join(nprovides))
+
+
+}
+
+addhandler native_virtclass_handler
+native_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+python do_addto_recipe_sysroot () {
+ bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask addto_recipe_sysroot after do_populate_sysroot
+
+inherit nopackages
+
+do_packagedata[stamp-extra-info] = ""
+do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "no"
diff --git a/poky/meta/classes/nativesdk.bbclass b/poky/meta/classes/nativesdk.bbclass
new file mode 100644
index 000000000..69fb45c8a
--- /dev/null
+++ b/poky/meta/classes/nativesdk.bbclass
@@ -0,0 +1,109 @@
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency. No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
+
+# libc for the SDK can be different to that of the target
+NATIVESDKLIBC ?= "libc-glibc"
+LIBCOVERRIDE = ":${NATIVESDKLIBC}"
+CLASSOVERRIDE = "class-nativesdk"
+MACHINEOVERRIDES = ""
+
+MULTILIBS = ""
+
+#
+# Update PACKAGE_ARCH and PACKAGE_ARCHS
+#
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
+PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
+
+#
+# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
+# binaries
+#
+DEPENDS_append = " chrpath-replacement-native"
+EXTRANATIVEPATH += "chrpath-native"
+
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${SDK_SYS}"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+HOST_LD_ARCH = "${SDK_LD_ARCH}"
+HOST_AS_ARCH = "${SDK_AS_ARCH}"
+#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+TARGET_LD_ARCH = "${SDK_LD_ARCH}"
+TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILDSDK_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}"
+TARGET_FPU = ""
+EXTRA_OECONF_GCC_FLOAT = ""
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
+# Change to place files in SDKPATH
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+baselib = "lib"
+sbindir = "${bindir}"
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
+python nativesdk_virtclass_handler () {
+ pn = e.data.getVar("PN")
+ if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
+ return
+
+ # Set features here to prevent appends and distro features backfill
+ # from modifying nativesdk distro features
+ features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
+ filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
+ d.setVar("DISTRO_FEATURES", " ".join(sorted(features | filtered)))
+
+ e.data.setVar("MLPREFIX", "nativesdk-")
+ e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-nativesdk", "").replace("nativesdk-", ""))
+ e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
+}
+
+python () {
+ pn = d.getVar("PN")
+ if not pn.startswith("nativesdk-"):
+ return
+
+ import oe.classextend
+
+ clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
+ clsextend.rename_packages()
+ clsextend.rename_package_variables((d.getVar("PACKAGEVARS") or "").split())
+
+ clsextend.map_depends_variable("DEPENDS")
+ clsextend.map_packagevars()
+ clsextend.map_variable("PROVIDES")
+ clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
+}
+
+addhandler nativesdk_virtclass_handler
+nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
+
+OLDEST_KERNEL = "${SDK_OLDEST_KERNEL}"
diff --git a/poky/meta/classes/nopackages.bbclass b/poky/meta/classes/nopackages.bbclass
new file mode 100644
index 000000000..559f5078b
--- /dev/null
+++ b/poky/meta/classes/nopackages.bbclass
@@ -0,0 +1,12 @@
+deltask do_package
+deltask do_package_write_rpm
+deltask do_package_write_ipk
+deltask do_package_write_deb
+deltask do_package_qa
+deltask do_packagedata
+deltask do_package_setscene
+deltask do_package_write_rpm_setscene
+deltask do_package_write_ipk_setscene
+deltask do_package_write_deb_setscene
+deltask do_package_qa_setscene
+deltask do_packagedata_setscene
diff --git a/poky/meta/classes/npm.bbclass b/poky/meta/classes/npm.bbclass
new file mode 100644
index 000000000..c351ff086
--- /dev/null
+++ b/poky/meta/classes/npm.bbclass
@@ -0,0 +1,90 @@
+DEPENDS_prepend = "nodejs-native "
+RDEPENDS_${PN}_prepend = "nodejs "
+S = "${WORKDIR}/npmpkg"
+
+def node_pkgname(d):
+ bpn = d.getVar('BPN')
+ if bpn.startswith("node-"):
+ return bpn[5:]
+ return bpn
+
+NPMPN ?= "${@node_pkgname(d)}"
+
+NPM_INSTALLDIR = "${D}${libdir}/node_modules/${NPMPN}"
+
+# function maps arch names to npm arch names
+def npm_oe_arch_map(target_arch, d):
+ import re
+ if re.match('p(pc|owerpc)(|64)', target_arch): return 'ppc'
+ elif re.match('i.86$', target_arch): return 'ia32'
+ elif re.match('x86_64$', target_arch): return 'x64'
+ elif re.match('arm64$', target_arch): return 'arm'
+ return target_arch
+
+NPM_ARCH ?= "${@npm_oe_arch_map(d.getVar('TARGET_ARCH'), d)}"
+NPM_INSTALL_DEV = "0"
+
+npm_do_compile() {
+ # Copy in any additionally fetched modules
+ if [ -d ${WORKDIR}/node_modules ] ; then
+ cp -a ${WORKDIR}/node_modules ${S}/
+ fi
+ # changing the home directory to the working directory, the .npmrc will
+ # be created in this directory
+ export HOME=${WORKDIR}
+ if [ "${NPM_INSTALL_DEV}" = "1" ]; then
+ npm config set dev true
+ else
+ npm config set dev false
+ fi
+ npm set cache ${WORKDIR}/npm_cache
+ # clear cache before every build
+ npm cache clear --force
+ # Install pkg into ${S} without going to the registry
+ if [ "${NPM_INSTALL_DEV}" = "1" ]; then
+ npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --no-registry install
+ else
+ npm --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry install
+ fi
+}
+
+npm_do_install() {
+ # changing the home directory to the working directory, the .npmrc will
+ # be created in this directory
+ export HOME=${WORKDIR}
+ mkdir -p ${NPM_INSTALLDIR}/
+ npm pack .
+ npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${NPMPN}-${PV}.tgz
+ if [ -d ${D}${prefix}/etc ] ; then
+ # This will be empty
+ rmdir ${D}${prefix}/etc
+ fi
+}
+
+python populate_packages_prepend () {
+ instdir = d.expand('${D}${libdir}/node_modules/${NPMPN}')
+ extrapackages = oe.package.npm_split_package_dirs(instdir)
+ pkgnames = extrapackages.keys()
+ d.prependVar('PACKAGES', '%s ' % ' '.join(pkgnames))
+ for pkgname in pkgnames:
+ pkgrelpath, pdata = extrapackages[pkgname]
+ pkgpath = '${libdir}/node_modules/${NPMPN}/' + pkgrelpath
+ # package names can't have underscores but npm packages sometimes use them
+ oe_pkg_name = pkgname.replace('_', '-')
+ expanded_pkgname = d.expand(oe_pkg_name)
+ d.setVar('FILES_%s' % expanded_pkgname, pkgpath)
+ if pdata:
+ version = pdata.get('version', None)
+ if version:
+ d.setVar('PKGV_%s' % expanded_pkgname, version)
+ description = pdata.get('description', None)
+ if description:
+ d.setVar('SUMMARY_%s' % expanded_pkgname, description.replace(u"\u2018", "'").replace(u"\u2019", "'"))
+ d.appendVar('RDEPENDS_%s' % d.getVar('PN'), ' %s' % ' '.join(pkgnames).replace('_', '-'))
+}
+
+FILES_${PN} += " \
+ ${libdir}/node_modules/${NPMPN} \
+"
+
+EXPORT_FUNCTIONS do_compile do_install
diff --git a/poky/meta/classes/oelint.bbclass b/poky/meta/classes/oelint.bbclass
new file mode 100644
index 000000000..2589d3405
--- /dev/null
+++ b/poky/meta/classes/oelint.bbclass
@@ -0,0 +1,84 @@
+addtask lint before do_build
+do_lint[nostamp] = "1"
+python do_lint() {
+ pkgname = d.getVar("PN")
+
+ ##############################
+ # Test that DESCRIPTION exists
+ #
+ description = d.getVar("DESCRIPTION", False)
+ if description[1:10] == '{SUMMARY}':
+ bb.warn("%s: DESCRIPTION is not set" % pkgname)
+
+
+ ##############################
+ # Test that HOMEPAGE exists
+ #
+ homepage = d.getVar("HOMEPAGE", False)
+ if homepage == '':
+ bb.warn("%s: HOMEPAGE is not set" % pkgname)
+ elif not homepage.startswith("http://") and not homepage.startswith("https://"):
+ bb.warn("%s: HOMEPAGE doesn't start with http:// or https://" % pkgname)
+
+
+ ##############################
+ # Test for valid SECTION
+ #
+ section = d.getVar("SECTION", False)
+ if section == '':
+ bb.warn("%s: SECTION is not set" % pkgname)
+ elif not section.islower():
+ bb.warn("%s: SECTION should only use lower case" % pkgname)
+
+
+ ##############################
+ # Check that all patches have Signed-off-by and Upstream-Status
+ #
+ srcuri = d.getVar("SRC_URI", False).split()
+ fpaths = (d.getVar('FILESPATH') or '').split(':')
+
+ def findPatch(patchname):
+ for dir in fpaths:
+ patchpath = dir + patchname
+ if os.path.exists(patchpath):
+ return patchpath
+
+ def findKey(path, key):
+ ret = True
+ f = open('%s' % path, mode = 'r')
+ line = f.readline()
+ while line:
+ if line.find(key) != -1:
+ ret = False
+ line = f.readline()
+ f.close()
+ return ret
+
+ def checkPN(pkgname, varname, str):
+ if str.find("{PN}") != -1:
+ bb.warn("%s: should use BPN instead of PN in %s" % (pkgname, varname))
+ if str.find("{P}") != -1:
+ bb.warn("%s: should use BP instead of P in %s" % (pkgname, varname))
+
+ length = len("file://")
+ for item in srcuri:
+ if item.startswith("file://"):
+ item = item[length:]
+ if item.endswith(".patch") or item.endswith(".diff"):
+ path = findPatch(item)
+ if findKey(path, "Signed-off-by"):
+ bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item))
+ if findKey(path, "Upstream-Status"):
+ bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item))
+
+
+ ##############################
+ # Check for ${PN} or ${P} usage in SRC_URI or S
+ # Should use ${BPN} or ${BP} instead to avoid breaking multilib
+ #
+ for s in srcuri:
+ if not s.startswith("file://"):
+ checkPN(pkgname, 'SRC_URI', s)
+
+ checkPN(pkgname, 'S', d.getVar('S', False))
+}
diff --git a/poky/meta/classes/own-mirrors.bbclass b/poky/meta/classes/own-mirrors.bbclass
new file mode 100644
index 000000000..a77783513
--- /dev/null
+++ b/poky/meta/classes/own-mirrors.bbclass
@@ -0,0 +1,13 @@
+PREMIRRORS_prepend = " \
+cvs://.*/.* ${SOURCE_MIRROR_URL} \n \
+svn://.*/.* ${SOURCE_MIRROR_URL} \n \
+git://.*/.* ${SOURCE_MIRROR_URL} \n \
+gitsm://.*/.* ${SOURCE_MIRROR_URL} \n \
+hg://.*/.* ${SOURCE_MIRROR_URL} \n \
+bzr://.*/.* ${SOURCE_MIRROR_URL} \n \
+p4://.*/.* ${SOURCE_MIRROR_URL} \n \
+osc://.*/.* ${SOURCE_MIRROR_URL} \n \
+https?$://.*/.* ${SOURCE_MIRROR_URL} \n \
+ftp://.*/.* ${SOURCE_MIRROR_URL} \n \
+npm://.*/?.* ${SOURCE_MIRROR_URL} \n \
+"
diff --git a/poky/meta/classes/package.bbclass b/poky/meta/classes/package.bbclass
new file mode 100644
index 000000000..edeffa978
--- /dev/null
+++ b/poky/meta/classes/package.bbclass
@@ -0,0 +1,2281 @@
+#
+# Packaging process
+#
+# Executive summary: This class iterates over the functions listed in PACKAGEFUNCS
+# Taking D and splitting it up into the packages listed in PACKAGES, placing the
+# resulting output in PKGDEST.
+#
+# There are the following default steps but PACKAGEFUNCS can be extended:
+#
+# a) package_get_auto_pr - get PRAUTO from remote PR service
+#
+# b) perform_packagecopy - Copy D into PKGD
+#
+# c) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
+#
+# d) split_and_strip_files - split the files into runtime and debug and strip them.
+# Debug files include debug info split, and associated sources that end up in -dbg packages
+#
+# e) fixup_perms - Fix up permissions in the package before we split it.
+#
+# f) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
+# Also triggers the binary stripping code to put files in -dbg packages.
+#
+# g) package_do_filedeps - Collect perfile run-time dependency metadata
+# The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with
+# a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg
+#
+# h) package_do_shlibs - Look at the shared libraries generated and autotmatically add any
+# dependencies found. Also stores the package name so anyone else using this library
+# knows which package to depend on.
+#
+# i) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
+#
+# j) read_shlibdeps - Reads the stored shlibs information into the metadata
+#
+# k) package_depchains - Adds automatic dependencies to -dbg and -dev packages
+#
+# l) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later
+# packaging steps
+
+inherit packagedata
+inherit chrpath
+
+# Need the package_qa_handle_error() in insane.bbclass
+inherit insane
+
+PKGD = "${WORKDIR}/package"
+PKGDEST = "${WORKDIR}/packages-split"
+
+LOCALE_SECTION ?= ''
+
+ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}"
+
+# rpm is used for the per-file dependency identification
+# dwarfsrcfiles is used to determine the list of debug source files
+PACKAGE_DEPENDS += "rpm-native dwarfsrcfiles-native"
+
+
+# If your postinstall can execute at rootfs creation time rather than on
+# target but depends on a native/cross tool in order to execute, you need to
+# list that tool in PACKAGE_WRITE_DEPENDS. Target package dependencies belong
+# in the package dependencies as normal, this is just for native/cross support
+# tools at rootfs build time.
+PACKAGE_WRITE_DEPS ??= ""
+
+def legitimize_package_name(s):
+ """
+ Make sure package names are legitimate strings
+ """
+ import re
+
+ def fixutf(m):
+ cp = m.group(1)
+ if cp:
+ return ('\\u%s' % cp).encode('latin-1').decode('unicode_escape')
+
+ # Handle unicode codepoints encoded as <U0123>, as in glibc locale files.
+ s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s)
+
+ # Remaining package name validity fixes
+ return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-')
+
+def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False, aux_files_pattern_verbatim=None, allow_links=False, summary=None):
+ """
+ Used in .bb files to split up dynamically generated subpackages of a
+ given package, usually plugins or modules.
+
+ Arguments:
+ root -- the path in which to search
+ file_regex -- regular expression to match searched files. Use
+ parentheses () to mark the part of this expression
+ that should be used to derive the module name (to be
+ substituted where %s is used in other function
+ arguments as noted below)
+ output_pattern -- pattern to use for the package names. Must include %s.
+ description -- description to set for each package. Must include %s.
+ postinst -- postinstall script to use for all packages (as a
+ string)
+ recursive -- True to perform a recursive search - default False
+ hook -- a hook function to be called for every match. The
+ function will be called with the following arguments
+ (in the order listed):
+ f: full path to the file/directory match
+ pkg: the package name
+ file_regex: as above
+ output_pattern: as above
+ modulename: the module name derived using file_regex
+ extra_depends -- extra runtime dependencies (RDEPENDS) to be set for
+ all packages. The default value of None causes a
+ dependency on the main package (${PN}) - if you do
+ not want this, pass '' for this parameter.
+ aux_files_pattern -- extra item(s) to be added to FILES for each
+ package. Can be a single string item or a list of
+ strings for multiple items. Must include %s.
+ postrm -- postrm script to use for all packages (as a string)
+ allow_dirs -- True allow directories to be matched - default False
+ prepend -- if True, prepend created packages to PACKAGES instead
+ of the default False which appends them
+ match_path -- match file_regex on the whole relative path to the
+ root rather than just the file name
+ aux_files_pattern_verbatim -- extra item(s) to be added to FILES for
+ each package, using the actual derived module name
+ rather than converting it to something legal for a
+ package name. Can be a single string item or a list
+ of strings for multiple items. Must include %s.
+ allow_links -- True to allow symlinks to be matched - default False
+ summary -- Summary to set for each package. Must include %s;
+ defaults to description if not set.
+
+ """
+
+ dvar = d.getVar('PKGD')
+ root = d.expand(root)
+ output_pattern = d.expand(output_pattern)
+ extra_depends = d.expand(extra_depends)
+
+ # If the root directory doesn't exist, don't error out later but silently do
+ # no splitting.
+ if not os.path.exists(dvar + root):
+ return []
+
+ ml = d.getVar("MLPREFIX")
+ if ml:
+ if not output_pattern.startswith(ml):
+ output_pattern = ml + output_pattern
+
+ newdeps = []
+ for dep in (extra_depends or "").split():
+ if dep.startswith(ml):
+ newdeps.append(dep)
+ else:
+ newdeps.append(ml + dep)
+ if newdeps:
+ extra_depends = " ".join(newdeps)
+
+
+ packages = d.getVar('PACKAGES').split()
+ split_packages = set()
+
+ if postinst:
+ postinst = '#!/bin/sh\n' + postinst + '\n'
+ if postrm:
+ postrm = '#!/bin/sh\n' + postrm + '\n'
+ if not recursive:
+ objs = os.listdir(dvar + root)
+ else:
+ objs = []
+ for walkroot, dirs, files in os.walk(dvar + root):
+ for file in files:
+ relpath = os.path.join(walkroot, file).replace(dvar + root + '/', '', 1)
+ if relpath:
+ objs.append(relpath)
+
+ if extra_depends == None:
+ extra_depends = d.getVar("PN")
+
+ if not summary:
+ summary = description
+
+ for o in sorted(objs):
+ import re, stat
+ if match_path:
+ m = re.match(file_regex, o)
+ else:
+ m = re.match(file_regex, os.path.basename(o))
+
+ if not m:
+ continue
+ f = os.path.join(dvar + root, o)
+ mode = os.lstat(f).st_mode
+ if not (stat.S_ISREG(mode) or (allow_links and stat.S_ISLNK(mode)) or (allow_dirs and stat.S_ISDIR(mode))):
+ continue
+ on = legitimize_package_name(m.group(1))
+ pkg = output_pattern % on
+ split_packages.add(pkg)
+ if not pkg in packages:
+ if prepend:
+ packages = [pkg] + packages
+ else:
+ packages.append(pkg)
+ oldfiles = d.getVar('FILES_' + pkg)
+ newfile = os.path.join(root, o)
+ # These names will be passed through glob() so if the filename actually
+ # contains * or ? (rare, but possible) we need to handle that specially
+ newfile = newfile.replace('*', '[*]')
+ newfile = newfile.replace('?', '[?]')
+ if not oldfiles:
+ the_files = [newfile]
+ if aux_files_pattern:
+ if type(aux_files_pattern) is list:
+ for fp in aux_files_pattern:
+ the_files.append(fp % on)
+ else:
+ the_files.append(aux_files_pattern % on)
+ if aux_files_pattern_verbatim:
+ if type(aux_files_pattern_verbatim) is list:
+ for fp in aux_files_pattern_verbatim:
+ the_files.append(fp % m.group(1))
+ else:
+ the_files.append(aux_files_pattern_verbatim % m.group(1))
+ d.setVar('FILES_' + pkg, " ".join(the_files))
+ else:
+ d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
+ if extra_depends != '':
+ d.appendVar('RDEPENDS_' + pkg, ' ' + extra_depends)
+ if not d.getVar('DESCRIPTION_' + pkg):
+ d.setVar('DESCRIPTION_' + pkg, description % on)
+ if not d.getVar('SUMMARY_' + pkg):
+ d.setVar('SUMMARY_' + pkg, summary % on)
+ if postinst:
+ d.setVar('pkg_postinst_' + pkg, postinst)
+ if postrm:
+ d.setVar('pkg_postrm_' + pkg, postrm)
+ if callable(hook):
+ hook(f, pkg, file_regex, output_pattern, m.group(1))
+
+ d.setVar('PACKAGES', ' '.join(packages))
+ return list(split_packages)
+
+PACKAGE_DEPENDS += "file-native"
+
+python () {
+ if d.getVar('PACKAGES') != '':
+ deps = ""
+ for dep in (d.getVar('PACKAGE_DEPENDS') or "").split():
+ deps += " %s:do_populate_sysroot" % dep
+ d.appendVarFlag('do_package', 'depends', deps)
+
+ # shlibs requires any DEPENDS to have already packaged for the *.list files
+ d.appendVarFlag('do_package', 'deptask', " do_packagedata")
+}
+
+# Get a list of files from file vars by searching files under current working directory
+# The list contains symlinks, directories and normal files.
+def files_from_filevars(filevars):
+ import os,glob
+ cpath = oe.cachedpath.CachedPath()
+ files = []
+ for f in filevars:
+ if os.path.isabs(f):
+ f = '.' + f
+ if not f.startswith("./"):
+ f = './' + f
+ globbed = glob.glob(f)
+ if globbed:
+ if [ f ] != globbed:
+ files += globbed
+ continue
+ files.append(f)
+
+ symlink_paths = []
+ for ind, f in enumerate(files):
+ # Handle directory symlinks. Truncate path to the lowest level symlink
+ parent = ''
+ for dirname in f.split('/')[:-1]:
+ parent = os.path.join(parent, dirname)
+ if dirname == '.':
+ continue
+ if cpath.islink(parent):
+ bb.warn("FILES contains file '%s' which resides under a "
+ "directory symlink. Please fix the recipe and use the "
+ "real path for the file." % f[1:])
+ symlink_paths.append(f)
+ files[ind] = parent
+ f = parent
+ break
+
+ if not cpath.islink(f):
+ if cpath.isdir(f):
+ newfiles = [ os.path.join(f,x) for x in os.listdir(f) ]
+ if newfiles:
+ files += newfiles
+
+ return files, symlink_paths
+
+# Called in package_<rpm,ipk,deb>.bbclass to get the correct list of configuration files
+def get_conffiles(pkg, d):
+ pkgdest = d.getVar('PKGDEST')
+ root = os.path.join(pkgdest, pkg)
+ cwd = os.getcwd()
+ os.chdir(root)
+
+ conffiles = d.getVar('CONFFILES_%s' % pkg);
+ if conffiles == None:
+ conffiles = d.getVar('CONFFILES')
+ if conffiles == None:
+ conffiles = ""
+ conffiles = conffiles.split()
+ conf_orig_list = files_from_filevars(conffiles)[0]
+
+ # Remove links and directories from conf_orig_list to get conf_list which only contains normal files
+ conf_list = []
+ for f in conf_orig_list:
+ if os.path.isdir(f):
+ continue
+ if os.path.islink(f):
+ continue
+ if not os.path.exists(f):
+ continue
+ conf_list.append(f)
+
+ # Remove the leading './'
+ for i in range(0, len(conf_list)):
+ conf_list[i] = conf_list[i][1:]
+
+ os.chdir(cwd)
+ return conf_list
+
+def checkbuildpath(file, d):
+ tmpdir = d.getVar('TMPDIR')
+ with open(file) as f:
+ file_content = f.read()
+ if tmpdir in file_content:
+ return True
+
+ return False
+
+def parse_debugsources_from_dwarfsrcfiles_output(dwarfsrcfiles_output):
+ debugfiles = {}
+
+ for line in dwarfsrcfiles_output.splitlines():
+ if line.startswith("\t"):
+ debugfiles[os.path.normpath(line.split()[0])] = ""
+
+ return debugfiles.keys()
+
+def append_source_info(file, sourcefile, d, fatal=True):
+ cmd = "'dwarfsrcfiles' '%s'" % (file)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ # 255 means a specific file wasn't fully parsed to get the debug file list, which is not a fatal failure
+ if retval != 0 and retval != 255:
+ msg = "dwarfsrcfiles failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")
+ if fatal:
+ bb.fatal(msg)
+ bb.note(msg)
+
+ debugsources = parse_debugsources_from_dwarfsrcfiles_output(output)
+ # filenames are null-separated - this is an artefact of the previous use
+ # of rpm's debugedit, which was writing them out that way, and the code elsewhere
+ # is still assuming that.
+ debuglistoutput = '\0'.join(debugsources) + '\0'
+ open(sourcefile, 'a').write(debuglistoutput)
+
+
+def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
+ # Function to split a single file into two components, one is the stripped
+ # target system binary, the other contains any debugging information. The
+ # two files are linked to reference each other.
+ #
+ # sourcefile is also generated containing a list of debugsources
+
+ import stat
+
+ dvar = d.getVar('PKGD')
+ objcopy = d.getVar("OBJCOPY")
+
+ # We ignore kernel modules, we don't generate debug info files.
+ if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
+ return 1
+
+ newmode = None
+ if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
+ origmode = os.stat(file)[stat.ST_MODE]
+ newmode = origmode | stat.S_IWRITE | stat.S_IREAD
+ os.chmod(file, newmode)
+
+ # We need to extract the debug src information here...
+ if debugsrcdir:
+ append_source_info(file, sourcefile, d)
+
+ bb.utils.mkdirhier(os.path.dirname(debugfile))
+
+ cmd = "'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+ # Set the debuglink to have the view of the file path on the target
+ cmd = "'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+ if newmode:
+ os.chmod(file, origmode)
+
+ return 0
+
+def copydebugsources(debugsrcdir, d):
+ # The debug src information written out to sourcefile is further processed
+ # and copied to the destination here.
+
+ import stat
+
+ sourcefile = d.expand("${WORKDIR}/debugsources.list")
+ if debugsrcdir and os.path.isfile(sourcefile):
+ dvar = d.getVar('PKGD')
+ strip = d.getVar("STRIP")
+ objcopy = d.getVar("OBJCOPY")
+ workdir = d.getVar("WORKDIR")
+ workparentdir = os.path.dirname(os.path.dirname(workdir))
+ workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
+
+ # If build path exists in sourcefile, it means toolchain did not use
+ # -fdebug-prefix-map to compile
+ if checkbuildpath(sourcefile, d):
+ localsrc_prefix = workparentdir + "/"
+ else:
+ localsrc_prefix = "/usr/src/debug/"
+
+ nosuchdir = []
+ basepath = dvar
+ for p in debugsrcdir.split("/"):
+ basepath = basepath + "/" + p
+ if not cpath.exists(basepath):
+ nosuchdir.append(basepath)
+ bb.utils.mkdirhier(basepath)
+ cpath.updatecache(basepath)
+
+ # Ignore files from the recipe sysroots (target and native)
+ processdebugsrc = "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '((<internal>|<built-in>)$|/.*recipe-sysroot.*/)' | "
+ # We need to ignore files that are not actually ours
+ # we do this by only paying attention to items from this package
+ processdebugsrc += "fgrep -zw '%s' | "
+ # Remove prefix in the source paths
+ processdebugsrc += "sed 's#%s##g' | "
+ processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+
+ cmd = processdebugsrc % (sourcefile, workbasedir, localsrc_prefix, workparentdir, dvar, debugsrcdir)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ # Can "fail" if internal headers/transient sources are attempted
+ #if retval:
+ # bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd))
+
+ # cpio seems to have a bug with -lL together and symbolic links are just copied, not dereferenced.
+ # Work around this by manually finding and copying any symbolic links that made it through.
+ cmd = "find %s%s -type l -print0 -delete | sed s#%s%s/##g | (cd '%s' ; cpio -pd0mL --no-preserve-owner '%s%s' 2>/dev/null)" % (dvar, debugsrcdir, dvar, debugsrcdir, workparentdir, dvar, debugsrcdir)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("debugsrc symlink fixup failed with exit code %s (cmd was %s)" % (retval, cmd))
+
+ # The copy by cpio may have resulted in some empty directories! Remove these
+ cmd = "find %s%s -empty -type d -delete" % (dvar, debugsrcdir)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("empty directory removal failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+ # Also remove debugsrcdir if its empty
+ for p in nosuchdir[::-1]:
+ if os.path.exists(p) and not os.listdir(p):
+ os.rmdir(p)
+
+#
+# Package data handling routines
+#
+
+def get_package_mapping (pkg, basepkg, d):
+ import oe.packagedata
+
+ data = oe.packagedata.read_subpkgdata(pkg, d)
+ key = "PKG_%s" % pkg
+
+ if key in data:
+ # Have to avoid undoing the write_extra_pkgs(global_variants...)
+ if bb.data.inherits_class('allarch', d) and data[key] == basepkg:
+ return pkg
+ return data[key]
+
+ return pkg
+
+def get_package_additional_metadata (pkg_type, d):
+ base_key = "PACKAGE_ADD_METADATA"
+ for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
+ if d.getVar(key, False) is None:
+ continue
+ d.setVarFlag(key, "type", "list")
+ if d.getVarFlag(key, "separator") is None:
+ d.setVarFlag(key, "separator", "\\n")
+ metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
+ return "\n".join(metadata_fields).strip()
+
+def runtime_mapping_rename (varname, pkg, d):
+ #bb.note("%s before: %s" % (varname, d.getVar(varname)))
+
+ new_depends = {}
+ deps = bb.utils.explode_dep_versions2(d.getVar(varname) or "")
+ for depend in deps:
+ new_depend = get_package_mapping(depend, pkg, d)
+ new_depends[new_depend] = deps[depend]
+
+ d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
+
+ #bb.note("%s after: %s" % (varname, d.getVar(varname)))
+
+#
+# Package functions suitable for inclusion in PACKAGEFUNCS
+#
+
+python package_get_auto_pr() {
+ import oe.prservice
+ import re
+
+ # Support per recipe PRSERV_HOST
+ pn = d.getVar('PN')
+ host = d.getVar("PRSERV_HOST_" + pn)
+ if not (host is None):
+ d.setVar("PRSERV_HOST", host)
+
+ pkgv = d.getVar("PKGV")
+
+ # PR Server not active, handle AUTOINC
+ if not d.getVar('PRSERV_HOST'):
+ if 'AUTOINC' in pkgv:
+ d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
+ return
+
+ auto_pr = None
+ pv = d.getVar("PV")
+ version = d.getVar("PRAUTOINX")
+ pkgarch = d.getVar("PACKAGE_ARCH")
+ checksum = d.getVar("BB_TASKHASH")
+
+ if d.getVar('PRSERV_LOCKDOWN'):
+ auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch) or d.getVar('PRAUTO_' + version) or None
+ if auto_pr is None:
+ bb.fatal("Can NOT get PRAUTO from lockdown exported file")
+ d.setVar('PRAUTO',str(auto_pr))
+ return
+
+ try:
+ conn = d.getVar("__PRSERV_CONN")
+ if conn is None:
+ conn = oe.prservice.prserv_make_conn(d)
+ if conn is not None:
+ if "AUTOINC" in pkgv:
+ srcpv = bb.fetch2.get_srcrev(d)
+ base_ver = "AUTOINC-%s" % version[:version.find(srcpv)]
+ value = conn.getPR(base_ver, pkgarch, srcpv)
+ d.setVar("PKGV", pkgv.replace("AUTOINC", str(value)))
+
+ auto_pr = conn.getPR(version, pkgarch, checksum)
+ except Exception as e:
+ bb.fatal("Can NOT get PRAUTO, exception %s" % str(e))
+ if auto_pr is None:
+ bb.fatal("Can NOT get PRAUTO from remote PR service")
+ d.setVar('PRAUTO',str(auto_pr))
+}
+
+LOCALEBASEPN ??= "${PN}"
+
+python package_do_split_locales() {
+ if (d.getVar('PACKAGE_NO_LOCALE') == '1'):
+ bb.debug(1, "package requested not splitting locales")
+ return
+
+ packages = (d.getVar('PACKAGES') or "").split()
+
+ datadir = d.getVar('datadir')
+ if not datadir:
+ bb.note("datadir not defined")
+ return
+
+ dvar = d.getVar('PKGD')
+ pn = d.getVar('LOCALEBASEPN')
+
+ if pn + '-locale' in packages:
+ packages.remove(pn + '-locale')
+
+ localedir = os.path.join(dvar + datadir, 'locale')
+
+ if not cpath.isdir(localedir):
+ bb.debug(1, "No locale files in this package")
+ return
+
+ locales = os.listdir(localedir)
+
+ summary = d.getVar('SUMMARY') or pn
+ description = d.getVar('DESCRIPTION') or ""
+ locale_section = d.getVar('LOCALE_SECTION')
+ mlprefix = d.getVar('MLPREFIX') or ""
+ for l in sorted(locales):
+ ln = legitimize_package_name(l)
+ pkg = pn + '-locale-' + ln
+ packages.append(pkg)
+ d.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l))
+ d.setVar('RRECOMMENDS_' + pkg, '%svirtual-locale-%s' % (mlprefix, ln))
+ d.setVar('RPROVIDES_' + pkg, '%s-locale %s%s-translation' % (pn, mlprefix, ln))
+ d.setVar('SUMMARY_' + pkg, '%s - %s translations' % (summary, l))
+ d.setVar('DESCRIPTION_' + pkg, '%s This package contains language translation files for the %s locale.' % (description, l))
+ if locale_section:
+ d.setVar('SECTION_' + pkg, locale_section)
+
+ d.setVar('PACKAGES', ' '.join(packages))
+
+ # Disabled by RP 18/06/07
+ # Wildcards aren't supported in debian
+ # They break with ipkg since glibc-locale* will mean that
+ # glibc-localedata-translit* won't install as a dependency
+ # for some other package which breaks meta-toolchain
+ # Probably breaks since virtual-locale- isn't provided anywhere
+ #rdep = (d.getVar('RDEPENDS_%s' % pn) or "").split()
+ #rdep.append('%s-locale*' % pn)
+ #d.setVar('RDEPENDS_%s' % pn, ' '.join(rdep))
+}
+
+python perform_packagecopy () {
+ dest = d.getVar('D')
+ dvar = d.getVar('PKGD')
+
+ # Start by package population by taking a copy of the installed
+ # files to operate on
+ # Preserve sparse files and hard links
+ cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (dest, dvar)
+ (retval, output) = oe.utils.getstatusoutput(cmd)
+ if retval:
+ bb.fatal("file copy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+ # replace RPATHs for the nativesdk binaries, to make them relocatable
+ if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross-canadian', d):
+ rpath_replace (dvar, d)
+}
+perform_packagecopy[cleandirs] = "${PKGD}"
+perform_packagecopy[dirs] = "${PKGD}"
+
+# We generate a master list of directories to process, we start by
+# seeding this list with reasonable defaults, then load from
+# the fs-perms.txt files
+python fixup_perms () {
+ import pwd, grp
+
+ # init using a string with the same format as a line as documented in
+ # the fs-perms.txt file
+ # <path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
+ # <path> link <link target>
+ #
+ # __str__ can be used to print out an entry in the input format
+ #
+ # if fs_perms_entry.path is None:
+ # an error occurred
+ # if fs_perms_entry.link, you can retrieve:
+ # fs_perms_entry.path = path
+ # fs_perms_entry.link = target of link
+ # if not fs_perms_entry.link, you can retrieve:
+ # fs_perms_entry.path = path
+ # fs_perms_entry.mode = expected dir mode or None
+ # fs_perms_entry.uid = expected uid or -1
+ # fs_perms_entry.gid = expected gid or -1
+ # fs_perms_entry.walk = 'true' or something else
+ # fs_perms_entry.fmode = expected file mode or None
+ # fs_perms_entry.fuid = expected file uid or -1
+ # fs_perms_entry_fgid = expected file gid or -1
+ class fs_perms_entry():
+ def __init__(self, line):
+ lsplit = line.split()
+ if len(lsplit) == 3 and lsplit[1].lower() == "link":
+ self._setlink(lsplit[0], lsplit[2])
+ elif len(lsplit) == 8:
+ self._setdir(lsplit[0], lsplit[1], lsplit[2], lsplit[3], lsplit[4], lsplit[5], lsplit[6], lsplit[7])
+ else:
+ msg = "Fixup Perms: invalid config line %s" % line
+ package_qa_handle_error("perm-config", msg, d)
+ self.path = None
+ self.link = None
+
+ def _setdir(self, path, mode, uid, gid, walk, fmode, fuid, fgid):
+ self.path = os.path.normpath(path)
+ self.link = None
+ self.mode = self._procmode(mode)
+ self.uid = self._procuid(uid)
+ self.gid = self._procgid(gid)
+ self.walk = walk.lower()
+ self.fmode = self._procmode(fmode)
+ self.fuid = self._procuid(fuid)
+ self.fgid = self._procgid(fgid)
+
+ def _setlink(self, path, link):
+ self.path = os.path.normpath(path)
+ self.link = link
+
+ def _procmode(self, mode):
+ if not mode or (mode and mode == "-"):
+ return None
+ else:
+ return int(mode,8)
+
+ # Note uid/gid -1 has special significance in os.lchown
+ def _procuid(self, uid):
+ if uid is None or uid == "-":
+ return -1
+ elif uid.isdigit():
+ return int(uid)
+ else:
+ return pwd.getpwnam(uid).pw_uid
+
+ def _procgid(self, gid):
+ if gid is None or gid == "-":
+ return -1
+ elif gid.isdigit():
+ return int(gid)
+ else:
+ return grp.getgrnam(gid).gr_gid
+
+ # Use for debugging the entries
+ def __str__(self):
+ if self.link:
+ return "%s link %s" % (self.path, self.link)
+ else:
+ mode = "-"
+ if self.mode:
+ mode = "0%o" % self.mode
+ fmode = "-"
+ if self.fmode:
+ fmode = "0%o" % self.fmode
+ uid = self._mapugid(self.uid)
+ gid = self._mapugid(self.gid)
+ fuid = self._mapugid(self.fuid)
+ fgid = self._mapugid(self.fgid)
+ return "%s %s %s %s %s %s %s %s" % (self.path, mode, uid, gid, self.walk, fmode, fuid, fgid)
+
+ def _mapugid(self, id):
+ if id is None or id == -1:
+ return "-"
+ else:
+ return "%d" % id
+
+ # Fix the permission, owner and group of path
+ def fix_perms(path, mode, uid, gid, dir):
+ if mode and not os.path.islink(path):
+ #bb.note("Fixup Perms: chmod 0%o %s" % (mode, dir))
+ os.chmod(path, mode)
+ # -1 is a special value that means don't change the uid/gid
+ # if they are BOTH -1, don't bother to lchown
+ if not (uid == -1 and gid == -1):
+ #bb.note("Fixup Perms: lchown %d:%d %s" % (uid, gid, dir))
+ os.lchown(path, uid, gid)
+
+ # Return a list of configuration files based on either the default
+ # files/fs-perms.txt or the contents of FILESYSTEM_PERMS_TABLES
+ # paths are resolved via BBPATH
+ def get_fs_perms_list(d):
+ str = ""
+ bbpath = d.getVar('BBPATH')
+ fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES') or ""
+ for conf_file in fs_perms_tables.split():
+ str += " %s" % bb.utils.which(bbpath, conf_file)
+ return str
+
+
+
+ dvar = d.getVar('PKGD')
+
+ fs_perms_table = {}
+ fs_link_table = {}
+
+ # By default all of the standard directories specified in
+ # bitbake.conf will get 0755 root:root.
+ target_path_vars = [ 'base_prefix',
+ 'prefix',
+ 'exec_prefix',
+ 'base_bindir',
+ 'base_sbindir',
+ 'base_libdir',
+ 'datadir',
+ 'sysconfdir',
+ 'servicedir',
+ 'sharedstatedir',
+ 'localstatedir',
+ 'infodir',
+ 'mandir',
+ 'docdir',
+ 'bindir',
+ 'sbindir',
+ 'libexecdir',
+ 'libdir',
+ 'includedir',
+ 'oldincludedir' ]
+
+ for path in target_path_vars:
+ dir = d.getVar(path) or ""
+ if dir == "":
+ continue
+ fs_perms_table[dir] = fs_perms_entry(d.expand("%s 0755 root root false - - -" % (dir)))
+
+ # Now we actually load from the configuration files
+ for conf in get_fs_perms_list(d).split():
+ if os.path.exists(conf):
+ f = open(conf)
+ for line in f:
+ if line.startswith('#'):
+ continue
+ lsplit = line.split()
+ if len(lsplit) == 0:
+ continue
+ if len(lsplit) != 8 and not (len(lsplit) == 3 and lsplit[1].lower() == "link"):
+ msg = "Fixup perms: %s invalid line: %s" % (conf, line)
+ package_qa_handle_error("perm-line", msg, d)
+ continue
+ entry = fs_perms_entry(d.expand(line))
+ if entry and entry.path:
+ if entry.link:
+ fs_link_table[entry.path] = entry
+ if entry.path in fs_perms_table:
+ fs_perms_table.pop(entry.path)
+ else:
+ fs_perms_table[entry.path] = entry
+ if entry.path in fs_link_table:
+ fs_link_table.pop(entry.path)
+ f.close()
+
+ # Debug -- list out in-memory table
+ #for dir in fs_perms_table:
+ # bb.note("Fixup Perms: %s: %s" % (dir, str(fs_perms_table[dir])))
+ #for link in fs_link_table:
+ # bb.note("Fixup Perms: %s: %s" % (link, str(fs_link_table[link])))
+
+ # We process links first, so we can go back and fixup directory ownership
+ # for any newly created directories
+ # Process in sorted order so /run gets created before /run/lock, etc.
+ for entry in sorted(fs_link_table.values(), key=lambda x: x.link):
+ link = entry.link
+ dir = entry.path
+ origin = dvar + dir
+ if not (cpath.exists(origin) and cpath.isdir(origin) and not cpath.islink(origin)):
+ continue
+
+ if link[0] == "/":
+ target = dvar + link
+ ptarget = link
+ else:
+ target = os.path.join(os.path.dirname(origin), link)
+ ptarget = os.path.join(os.path.dirname(dir), link)
+ if os.path.exists(target):
+ msg = "Fixup Perms: Unable to correct directory link, target already exists: %s -> %s" % (dir, ptarget)
+ package_qa_handle_error("perm-link", msg, d)
+ continue
+
+ # Create path to move directory to, move it, and then setup the symlink
+ bb.utils.mkdirhier(os.path.dirname(target))
+ #bb.note("Fixup Perms: Rename %s -> %s" % (dir, ptarget))
+ os.rename(origin, target)
+ #bb.note("Fixup Perms: Link %s -> %s" % (dir, link))
+ os.symlink(link, origin)
+
+ for dir in fs_perms_table:
+ origin = dvar + dir
+ if not (cpath.exists(origin) and cpath.isdir(origin)):
+ continue
+
+ fix_perms(origin, fs_perms_table[dir].mode, fs_perms_table[dir].uid, fs_perms_table[dir].gid, dir)
+
+ if fs_perms_table[dir].walk == 'true':
+ for root, dirs, files in os.walk(origin):
+ for dr in dirs:
+ each_dir = os.path.join(root, dr)
+ fix_perms(each_dir, fs_perms_table[dir].mode, fs_perms_table[dir].uid, fs_perms_table[dir].gid, dir)
+ for f in files:
+ each_file = os.path.join(root, f)
+ fix_perms(each_file, fs_perms_table[dir].fmode, fs_perms_table[dir].fuid, fs_perms_table[dir].fgid, dir)
+}
+
+python split_and_strip_files () {
+ import stat, errno
+
+ dvar = d.getVar('PKGD')
+ pn = d.getVar('PN')
+ targetos = d.getVar('TARGET_OS')
+
+ oldcwd = os.getcwd()
+ os.chdir(dvar)
+
+ # We default to '.debug' style
+ if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory':
+ # Single debug-file-directory style debug info
+ debugappend = ".debug"
+ debugdir = ""
+ debuglibdir = "/usr/lib/debug"
+ debugsrcdir = "/usr/src/debug"
+ elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src':
+ # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
+ debugappend = ""
+ debugdir = "/.debug"
+ debuglibdir = ""
+ debugsrcdir = ""
+ elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg':
+ debugappend = ""
+ debugdir = "/.debug"
+ debuglibdir = ""
+ debugsrcdir = "/usr/src/debug"
+ else:
+ # Original OE-core, a.k.a. ".debug", style debug info
+ debugappend = ""
+ debugdir = "/.debug"
+ debuglibdir = ""
+ debugsrcdir = "/usr/src/debug"
+
+ sourcefile = d.expand("${WORKDIR}/debugsources.list")
+ bb.utils.remove(sourcefile)
+
+ # Return type (bits):
+ # 0 - not elf
+ # 1 - ELF
+ # 2 - stripped
+ # 4 - executable
+ # 8 - shared library
+ # 16 - kernel module
+ def isELF(path):
+ type = 0
+ ret, result = oe.utils.getstatusoutput("file -b '%s'" % path)
+
+ if ret:
+ msg = "split_and_strip_files: 'file %s' failed" % path
+ package_qa_handle_error("split-strip", msg, d)
+ return type
+
+ # Not stripped
+ if "ELF" in result:
+ type |= 1
+ if "not stripped" not in result:
+ type |= 2
+ if "executable" in result:
+ type |= 4
+ if "shared" in result:
+ type |= 8
+ return type
+
+ def isStaticLib(path):
+ if path.endswith('.a') and not os.path.islink(path):
+ with open(path, 'rb') as fh:
+ # The magic must include the first slash to avoid
+ # matching golang static libraries
+ magic = b'!<arch>\x0a/'
+ start = fh.read(len(magic))
+ return start == magic
+ return False
+
+ #
+ # First lets figure out all of the files we may have to process ... do this only once!
+ #
+ elffiles = {}
+ symlinks = {}
+ kernmods = []
+ staticlibs = []
+ inodes = {}
+ libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir"))
+ baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir"))
+ skipfiles = (d.getVar("INHIBIT_PACKAGE_STRIP_FILES") or "").split()
+ if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1' or \
+ d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
+ for root, dirs, files in cpath.walk(dvar):
+ for f in files:
+ file = os.path.join(root, f)
+ if file.endswith(".ko") and file.find("/lib/modules/") != -1:
+ kernmods.append(file)
+ continue
+ if isStaticLib(file):
+ staticlibs.append(file)
+ continue
+
+ # Skip debug files
+ if debugappend and file.endswith(debugappend):
+ continue
+ if debugdir and debugdir in os.path.dirname(file[len(dvar):]):
+ continue
+
+ if file in skipfiles:
+ continue
+
+ try:
+ ltarget = cpath.realpath(file, dvar, False)
+ s = cpath.lstat(ltarget)
+ except OSError as e:
+ (err, strerror) = e.args
+ if err != errno.ENOENT:
+ raise
+ # Skip broken symlinks
+ continue
+ if not s:
+ continue
+ # Check its an executable
+ if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \
+ or ((file.startswith(libdir) or file.startswith(baselibdir)) and (".so" in f or ".node" in f)):
+ # If it's a symlink, and points to an ELF file, we capture the readlink target
+ if cpath.islink(file):
+ target = os.readlink(file)
+ if isELF(ltarget):
+ #bb.note("Sym: %s (%d)" % (ltarget, isELF(ltarget)))
+ symlinks[file] = target
+ continue
+
+ # It's a file (or hardlink), not a link
+ # ...but is it ELF, and is it already stripped?
+ elf_file = isELF(file)
+ if elf_file & 1:
+ if elf_file & 2:
+ if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split():
+ bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
+ else:
+ msg = "File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn)
+ package_qa_handle_error("already-stripped", msg, d)
+ continue
+
+ # At this point we have an unstripped elf file. We need to:
+ # a) Make sure any file we strip is not hardlinked to anything else outside this tree
+ # b) Only strip any hardlinked file once (no races)
+ # c) Track any hardlinks between files so that we can reconstruct matching debug file hardlinks
+
+ # Use a reference of device ID and inode number to identify files
+ file_reference = "%d_%d" % (s.st_dev, s.st_ino)
+ if file_reference in inodes:
+ os.unlink(file)
+ os.link(inodes[file_reference][0], file)
+ inodes[file_reference].append(file)
+ else:
+ inodes[file_reference] = [file]
+ # break hardlink
+ bb.utils.copyfile(file, file)
+ elffiles[file] = elf_file
+ # Modified the file so clear the cache
+ cpath.updatecache(file)
+
+ #
+ # First lets process debug splitting
+ #
+ if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT') != '1'):
+ for file in elffiles:
+ src = file[len(dvar):]
+ dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+ fpath = dvar + dest
+
+ # Split the file...
+ bb.utils.mkdirhier(os.path.dirname(fpath))
+ #bb.note("Split %s -> %s" % (file, fpath))
+ # Only store off the hard link reference if we successfully split!
+ splitdebuginfo(file, fpath, debugsrcdir, sourcefile, d)
+
+ if debugsrcdir and not targetos.startswith("mingw"):
+ for file in staticlibs:
+ append_source_info(file, sourcefile, d, fatal=False)
+
+ # Hardlink our debug symbols to the other hardlink copies
+ for ref in inodes:
+ if len(inodes[ref]) == 1:
+ continue
+ for file in inodes[ref][1:]:
+ src = file[len(dvar):]
+ dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+ fpath = dvar + dest
+ target = inodes[ref][0][len(dvar):]
+ ftarget = dvar + debuglibdir + os.path.dirname(target) + debugdir + "/" + os.path.basename(target) + debugappend
+ bb.utils.mkdirhier(os.path.dirname(fpath))
+ #bb.note("Link %s -> %s" % (fpath, ftarget))
+ os.link(ftarget, fpath)
+
+ # Create symlinks for all cases we were able to split symbols
+ for file in symlinks:
+ src = file[len(dvar):]
+ dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+ fpath = dvar + dest
+ # Skip it if the target doesn't exist
+ try:
+ s = os.stat(fpath)
+ except OSError as e:
+ (err, strerror) = e.args
+ if err != errno.ENOENT:
+ raise
+ continue
+
+ ltarget = symlinks[file]
+ lpath = os.path.dirname(ltarget)
+ lbase = os.path.basename(ltarget)
+ ftarget = ""
+ if lpath and lpath != ".":
+ ftarget += lpath + debugdir + "/"
+ ftarget += lbase + debugappend
+ if lpath.startswith(".."):
+ ftarget = os.path.join("..", ftarget)
+ bb.utils.mkdirhier(os.path.dirname(fpath))
+ #bb.note("Symlink %s -> %s" % (fpath, ftarget))
+ os.symlink(ftarget, fpath)
+
+ # Process the debugsrcdir if requested...
+ # This copies and places the referenced sources for later debugging...
+ copydebugsources(debugsrcdir, d)
+ #
+ # End of debug splitting
+ #
+
+ #
+ # Now lets go back over things and strip them
+ #
+ if (d.getVar('INHIBIT_PACKAGE_STRIP') != '1'):
+ strip = d.getVar("STRIP")
+ sfiles = []
+ for file in elffiles:
+ elf_file = int(elffiles[file])
+ #bb.note("Strip %s" % file)
+ sfiles.append((file, elf_file, strip))
+ for f in kernmods:
+ sfiles.append((f, 16, strip))
+
+ oe.utils.multiprocess_exec(sfiles, oe.package.runstrip)
+
+ #
+ # End of strip
+ #
+ os.chdir(oldcwd)
+}
+
+python populate_packages () {
+ import glob, re
+
+ workdir = d.getVar('WORKDIR')
+ outdir = d.getVar('DEPLOY_DIR')
+ dvar = d.getVar('PKGD')
+ packages = d.getVar('PACKAGES')
+ pn = d.getVar('PN')
+
+ bb.utils.mkdirhier(outdir)
+ os.chdir(dvar)
+
+ autodebug = not (d.getVar("NOAUTOPACKAGEDEBUG") or False)
+
+ split_source_package = (d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-with-srcpkg')
+
+ # If debug-with-srcpkg mode is enabled then the src package is added
+ # into the package list and the source directory as its main content
+ if split_source_package:
+ src_package_name = ('%s-src' % d.getVar('PN'))
+ packages += (' ' + src_package_name)
+ d.setVar('FILES_%s' % src_package_name, '/usr/src/debug')
+
+ # Sanity check PACKAGES for duplicates
+ # Sanity should be moved to sanity.bbclass once we have the infrastructure
+ package_list = []
+
+ for pkg in packages.split():
+ if pkg in package_list:
+ msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
+ package_qa_handle_error("packages-list", msg, d)
+ # If debug-with-srcpkg mode is enabled then the src package will have
+ # priority over dbg package when assigning the files.
+ # This allows src package to include source files and remove them from dbg.
+ elif split_source_package and pkg.endswith("-src"):
+ package_list.insert(0, pkg)
+ elif autodebug and pkg.endswith("-dbg") and not split_source_package:
+ package_list.insert(0, pkg)
+ else:
+ package_list.append(pkg)
+ d.setVar('PACKAGES', ' '.join(package_list))
+ pkgdest = d.getVar('PKGDEST')
+
+ seen = []
+
+ # os.mkdir masks the permissions with umask so we have to unset it first
+ oldumask = os.umask(0)
+
+ debug = []
+ for root, dirs, files in cpath.walk(dvar):
+ dir = root[len(dvar):]
+ if not dir:
+ dir = os.sep
+ for f in (files + dirs):
+ path = "." + os.path.join(dir, f)
+ if "/.debug/" in path or path.endswith("/.debug"):
+ debug.append(path)
+
+ for pkg in package_list:
+ root = os.path.join(pkgdest, pkg)
+ bb.utils.mkdirhier(root)
+
+ filesvar = d.getVar('FILES_%s' % pkg) or ""
+ if "//" in filesvar:
+ msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg
+ package_qa_handle_error("files-invalid", msg, d)
+ filesvar.replace("//", "/")
+
+ origfiles = filesvar.split()
+ files, symlink_paths = files_from_filevars(origfiles)
+
+ if autodebug and pkg.endswith("-dbg"):
+ files.extend(debug)
+
+ for file in files:
+ if (not cpath.islink(file)) and (not cpath.exists(file)):
+ continue
+ if file in seen:
+ continue
+ seen.append(file)
+
+ def mkdir(src, dest, p):
+ src = os.path.join(src, p)
+ dest = os.path.join(dest, p)
+ fstat = cpath.stat(src)
+ os.mkdir(dest, fstat.st_mode)
+ os.chown(dest, fstat.st_uid, fstat.st_gid)
+ if p not in seen:
+ seen.append(p)
+ cpath.updatecache(dest)
+
+ def mkdir_recurse(src, dest, paths):
+ if cpath.exists(dest + '/' + paths):
+ return
+ while paths.startswith("./"):
+ paths = paths[2:]
+ p = "."
+ for c in paths.split("/"):
+ p = os.path.join(p, c)
+ if not cpath.exists(os.path.join(dest, p)):
+ mkdir(src, dest, p)
+
+ if cpath.isdir(file) and not cpath.islink(file):
+ mkdir_recurse(dvar, root, file)
+ continue
+
+ mkdir_recurse(dvar, root, os.path.dirname(file))
+ fpath = os.path.join(root,file)
+ if not cpath.islink(file):
+ os.link(file, fpath)
+ continue
+ ret = bb.utils.copyfile(file, fpath)
+ if ret is False or ret == 0:
+ bb.fatal("File population failed")
+
+ # Check if symlink paths exist
+ for file in symlink_paths:
+ if not os.path.exists(os.path.join(root,file)):
+ bb.fatal("File '%s' cannot be packaged into '%s' because its "
+ "parent directory structure does not exist. One of "
+ "its parent directories is a symlink whose target "
+ "directory is not included in the package." %
+ (file, pkg))
+
+ os.umask(oldumask)
+ os.chdir(workdir)
+
+ # Handle LICENSE_EXCLUSION
+ package_list = []
+ for pkg in packages.split():
+ if d.getVar('LICENSE_EXCLUSION-' + pkg):
+ msg = "%s has an incompatible license. Excluding from packaging." % pkg
+ package_qa_handle_error("incompatible-license", msg, d)
+ else:
+ package_list.append(pkg)
+ d.setVar('PACKAGES', ' '.join(package_list))
+
+ unshipped = []
+ for root, dirs, files in cpath.walk(dvar):
+ dir = root[len(dvar):]
+ if not dir:
+ dir = os.sep
+ for f in (files + dirs):
+ path = os.path.join(dir, f)
+ if ('.' + path) not in seen:
+ unshipped.append(path)
+
+ if unshipped != []:
+ msg = pn + ": Files/directories were installed but not shipped in any package:"
+ if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn) or "").split():
+ bb.note("Package %s skipping QA tests: installed-vs-shipped" % pn)
+ else:
+ for f in unshipped:
+ msg = msg + "\n " + f
+ msg = msg + "\nPlease set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.\n"
+ msg = msg + "%s: %d installed and not shipped files." % (pn, len(unshipped))
+ package_qa_handle_error("installed-vs-shipped", msg, d)
+}
+populate_packages[dirs] = "${D}"
+
+python package_fixsymlinks () {
+ import errno
+ pkgdest = d.getVar('PKGDEST')
+ packages = d.getVar("PACKAGES", False).split()
+
+ dangling_links = {}
+ pkg_files = {}
+ for pkg in packages:
+ dangling_links[pkg] = []
+ pkg_files[pkg] = []
+ inst_root = os.path.join(pkgdest, pkg)
+ for path in pkgfiles[pkg]:
+ rpath = path[len(inst_root):]
+ pkg_files[pkg].append(rpath)
+ rtarget = cpath.realpath(path, inst_root, True, assume_dir = True)
+ if not cpath.lexists(rtarget):
+ dangling_links[pkg].append(os.path.normpath(rtarget[len(inst_root):]))
+
+ newrdepends = {}
+ for pkg in dangling_links:
+ for l in dangling_links[pkg]:
+ found = False
+ bb.debug(1, "%s contains dangling link %s" % (pkg, l))
+ for p in packages:
+ if l in pkg_files[p]:
+ found = True
+ bb.debug(1, "target found in %s" % p)
+ if p == pkg:
+ break
+ if pkg not in newrdepends:
+ newrdepends[pkg] = []
+ newrdepends[pkg].append(p)
+ break
+ if found == False:
+ bb.note("%s contains dangling symlink to %s" % (pkg, l))
+
+ for pkg in newrdepends:
+ rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
+ for p in newrdepends[pkg]:
+ if p not in rdepends:
+ rdepends[p] = []
+ d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+}
+
+
+python package_package_name_hook() {
+ """
+ A package_name_hook function can be used to rewrite the package names by
+ changing PKG. For an example, see debian.bbclass.
+ """
+ pass
+}
+
+EXPORT_FUNCTIONS package_name_hook
+
+
+PKGDESTWORK = "${WORKDIR}/pkgdata"
+
+python emit_pkgdata() {
+ from glob import glob
+ import json
+
+ def process_postinst_on_target(pkg, mlprefix):
+ defer_fragment = """
+if [ -n "$D" ]; then
+ $INTERCEPT_DIR/postinst_intercept delay_to_first_boot %s mlprefix=%s
+ exit 0
+fi
+""" % (pkg, mlprefix)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ postinst_ontarget = d.getVar('pkg_postinst_ontarget_%s' % pkg)
+
+ if postinst_ontarget:
+ bb.debug(1, 'adding deferred pkg_postinst_ontarget() to pkg_postinst() for %s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += defer_fragment
+ postinst += postinst_ontarget
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ def add_set_e_to_scriptlets(pkg):
+ for scriptlet_name in ('pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm'):
+ scriptlet = d.getVar('%s_%s' % (scriptlet_name, pkg))
+ if scriptlet:
+ scriptlet_split = scriptlet.split('\n')
+ if scriptlet_split[0].startswith("#!"):
+ scriptlet = scriptlet_split[0] + "\nset -e\n" + "\n".join(scriptlet_split[1:])
+ else:
+ scriptlet = "set -e\n" + "\n".join(scriptlet_split[0:])
+ d.setVar('%s_%s' % (scriptlet_name, pkg), scriptlet)
+
+ def write_if_exists(f, pkg, var):
+ def encode(str):
+ import codecs
+ c = codecs.getencoder("unicode_escape")
+ return c(str)[0].decode("latin1")
+
+ val = d.getVar('%s_%s' % (var, pkg))
+ if val:
+ f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
+ return val
+ val = d.getVar('%s' % (var))
+ if val:
+ f.write('%s: %s\n' % (var, encode(val)))
+ return val
+
+ def write_extra_pkgs(variants, pn, packages, pkgdatadir):
+ for variant in variants:
+ with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd:
+ fd.write("PACKAGES: %s\n" % ' '.join(
+ map(lambda pkg: '%s-%s' % (variant, pkg), packages.split())))
+
+ def write_extra_runtime_pkgs(variants, packages, pkgdatadir):
+ for variant in variants:
+ for pkg in packages.split():
+ ml_pkg = "%s-%s" % (variant, pkg)
+ subdata_file = "%s/runtime/%s" % (pkgdatadir, ml_pkg)
+ with open(subdata_file, 'w') as fd:
+ fd.write("PKG_%s: %s" % (ml_pkg, pkg))
+
+ packages = d.getVar('PACKAGES')
+ pkgdest = d.getVar('PKGDEST')
+ pkgdatadir = d.getVar('PKGDESTWORK')
+
+ # Take shared lock since we're only reading, not writing
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
+
+ data_file = pkgdatadir + d.expand("/${PN}" )
+ f = open(data_file, 'w')
+ f.write("PACKAGES: %s\n" % packages)
+ f.close()
+
+ pn = d.getVar('PN')
+ global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS') or "").split()
+ variants = (d.getVar('MULTILIB_VARIANTS') or "").split()
+
+ if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+ write_extra_pkgs(variants, pn, packages, pkgdatadir)
+
+ if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
+ write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
+
+ workdir = d.getVar('WORKDIR')
+
+ for pkg in packages.split():
+ pkgval = d.getVar('PKG_%s' % pkg)
+ if pkgval is None:
+ pkgval = pkg
+ d.setVar('PKG_%s' % pkg, pkg)
+
+ pkgdestpkg = os.path.join(pkgdest, pkg)
+ files = {}
+ total_size = 0
+ seen = set()
+ for f in pkgfiles[pkg]:
+ relpth = os.path.relpath(f, pkgdestpkg)
+ fstat = os.lstat(f)
+ files[os.sep + relpth] = fstat.st_size
+ if fstat.st_ino not in seen:
+ seen.add(fstat.st_ino)
+ total_size += fstat.st_size
+ d.setVar('FILES_INFO', json.dumps(files))
+
+ subdata_file = pkgdatadir + "/runtime/%s" % pkg
+ sf = open(subdata_file, 'w')
+ write_if_exists(sf, pkg, 'PN')
+ write_if_exists(sf, pkg, 'PE')
+ write_if_exists(sf, pkg, 'PV')
+ write_if_exists(sf, pkg, 'PR')
+ write_if_exists(sf, pkg, 'PKGE')
+ write_if_exists(sf, pkg, 'PKGV')
+ write_if_exists(sf, pkg, 'PKGR')
+ write_if_exists(sf, pkg, 'LICENSE')
+ write_if_exists(sf, pkg, 'DESCRIPTION')
+ write_if_exists(sf, pkg, 'SUMMARY')
+ write_if_exists(sf, pkg, 'RDEPENDS')
+ rprov = write_if_exists(sf, pkg, 'RPROVIDES')
+ write_if_exists(sf, pkg, 'RRECOMMENDS')
+ write_if_exists(sf, pkg, 'RSUGGESTS')
+ write_if_exists(sf, pkg, 'RREPLACES')
+ write_if_exists(sf, pkg, 'RCONFLICTS')
+ write_if_exists(sf, pkg, 'SECTION')
+ write_if_exists(sf, pkg, 'PKG')
+ write_if_exists(sf, pkg, 'ALLOW_EMPTY')
+ write_if_exists(sf, pkg, 'FILES')
+ write_if_exists(sf, pkg, 'CONFFILES')
+ process_postinst_on_target(pkg, d.getVar("MLPREFIX"))
+ add_set_e_to_scriptlets(pkg)
+ write_if_exists(sf, pkg, 'pkg_postinst')
+ write_if_exists(sf, pkg, 'pkg_postrm')
+ write_if_exists(sf, pkg, 'pkg_preinst')
+ write_if_exists(sf, pkg, 'pkg_prerm')
+ write_if_exists(sf, pkg, 'FILERPROVIDESFLIST')
+ write_if_exists(sf, pkg, 'FILES_INFO')
+ for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split():
+ write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
+
+ write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
+ for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split():
+ write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
+
+ sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
+ sf.close()
+
+ # Symlinks needed for rprovides lookup
+ if rprov:
+ for p in rprov.strip().split():
+ subdata_sym = pkgdatadir + "/runtime-rprovides/%s/%s" % (p, pkg)
+ bb.utils.mkdirhier(os.path.dirname(subdata_sym))
+ oe.path.symlink("../../runtime/%s" % pkg, subdata_sym, True)
+
+ allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg)
+ if not allow_empty:
+ allow_empty = d.getVar('ALLOW_EMPTY')
+ root = "%s/%s" % (pkgdest, pkg)
+ os.chdir(root)
+ g = glob('*')
+ if g or allow_empty == "1":
+ # Symlinks needed for reverse lookups (from the final package name)
+ subdata_sym = pkgdatadir + "/runtime-reverse/%s" % pkgval
+ oe.path.symlink("../runtime/%s" % pkg, subdata_sym, True)
+
+ packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
+ open(packagedfile, 'w').close()
+
+ if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+ write_extra_runtime_pkgs(variants, packages, pkgdatadir)
+
+ if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d):
+ write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
+
+ bb.utils.unlockfile(lf)
+}
+emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides"
+
+ldconfig_postinst_fragment() {
+if [ x"$D" = "x" ]; then
+ if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
+fi
+}
+
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps --alldeps"
+
+# Collect perfile run-time dependency metadata
+# Output:
+# FILERPROVIDESFLIST_pkg - list of all files w/ deps
+# FILERPROVIDES_filepath_pkg - per file dep
+#
+# FILERDEPENDSFLIST_pkg - list of all files w/ deps
+# FILERDEPENDS_filepath_pkg - per file dep
+
+python package_do_filedeps() {
+ if d.getVar('SKIP_FILEDEPS') == '1':
+ return
+
+ pkgdest = d.getVar('PKGDEST')
+ packages = d.getVar('PACKAGES')
+ rpmdeps = d.getVar('RPMDEPS')
+
+ def chunks(files, n):
+ return [files[i:i+n] for i in range(0, len(files), n)]
+
+ pkglist = []
+ for pkg in packages.split():
+ if d.getVar('SKIP_FILEDEPS_' + pkg) == '1':
+ continue
+ if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-') or pkg.endswith('-src'):
+ continue
+ for files in chunks(pkgfiles[pkg], 100):
+ pkglist.append((pkg, files, rpmdeps, pkgdest))
+
+ processed = oe.utils.multiprocess_exec( pkglist, oe.package.filedeprunner)
+
+ provides_files = {}
+ requires_files = {}
+
+ for result in processed:
+ (pkg, provides, requires) = result
+
+ if pkg not in provides_files:
+ provides_files[pkg] = []
+ if pkg not in requires_files:
+ requires_files[pkg] = []
+
+ for file in provides:
+ provides_files[pkg].append(file)
+ key = "FILERPROVIDES_" + file + "_" + pkg
+ d.setVar(key, " ".join(provides[file]))
+
+ for file in requires:
+ requires_files[pkg].append(file)
+ key = "FILERDEPENDS_" + file + "_" + pkg
+ d.setVar(key, " ".join(requires[file]))
+
+ for pkg in requires_files:
+ d.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files[pkg]))
+ for pkg in provides_files:
+ d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg]))
+}
+
+SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs2"
+SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2"
+
+python package_do_shlibs() {
+ import re, pipes
+ import subprocess as sub
+
+ exclude_shlibs = d.getVar('EXCLUDE_FROM_SHLIBS', False)
+ if exclude_shlibs:
+ bb.note("not generating shlibs")
+ return
+
+ lib_re = re.compile("^.*\.so")
+ libdir_re = re.compile(".*/%s$" % d.getVar('baselib'))
+
+ packages = d.getVar('PACKAGES')
+ targetos = d.getVar('TARGET_OS')
+
+ workdir = d.getVar('WORKDIR')
+
+ ver = d.getVar('PKGV')
+ if not ver:
+ msg = "PKGV not defined"
+ package_qa_handle_error("pkgv-undefined", msg, d)
+ return
+
+ pkgdest = d.getVar('PKGDEST')
+
+ shlibswork_dir = d.getVar('SHLIBSWORKDIR')
+
+ # Take shared lock since we're only reading, not writing
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
+
+ def linux_so(file, needed, sonames, renames, pkgver):
+ needs_ldconfig = False
+ ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
+ cmd = d.getVar('OBJDUMP') + " -p " + pipes.quote(file) + " 2>/dev/null"
+ fd = os.popen(cmd)
+ lines = fd.readlines()
+ fd.close()
+ rpath = []
+ for l in lines:
+ m = re.match("\s+RPATH\s+([^\s]*)", l)
+ if m:
+ rpaths = m.group(1).replace("$ORIGIN", ldir).split(":")
+ rpath = list(map(os.path.normpath, rpaths))
+ for l in lines:
+ m = re.match("\s+NEEDED\s+([^\s]*)", l)
+ if m:
+ dep = m.group(1)
+ if dep not in needed[pkg]:
+ needed[pkg].append((dep, file, rpath))
+ m = re.match("\s+SONAME\s+([^\s]*)", l)
+ if m:
+ this_soname = m.group(1)
+ prov = (this_soname, ldir, pkgver)
+ if not prov in sonames:
+ # if library is private (only used by package) then do not build shlib for it
+ if not private_libs or this_soname not in private_libs:
+ sonames.append(prov)
+ if libdir_re.match(os.path.dirname(file)):
+ needs_ldconfig = True
+ if snap_symlinks and (os.path.basename(file) != this_soname):
+ renames.append((file, os.path.join(os.path.dirname(file), this_soname)))
+ return needs_ldconfig
+
+ def darwin_so(file, needed, sonames, renames, pkgver):
+ if not os.path.exists(file):
+ return
+ ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
+
+ def get_combinations(base):
+ #
+ # Given a base library name, find all combinations of this split by "." and "-"
+ #
+ combos = []
+ options = base.split(".")
+ for i in range(1, len(options) + 1):
+ combos.append(".".join(options[0:i]))
+ options = base.split("-")
+ for i in range(1, len(options) + 1):
+ combos.append("-".join(options[0:i]))
+ return combos
+
+ if (file.endswith('.dylib') or file.endswith('.so')) and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-src'):
+ # Drop suffix
+ name = os.path.basename(file).rsplit(".",1)[0]
+ # Find all combinations
+ combos = get_combinations(name)
+ for combo in combos:
+ if not combo in sonames:
+ prov = (combo, ldir, pkgver)
+ sonames.append(prov)
+ if file.endswith('.dylib') or file.endswith('.so'):
+ rpath = []
+ p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ # If returned successfully, process stdout for results
+ if p.returncode == 0:
+ for l in out.split("\n"):
+ l = l.strip()
+ if l.startswith('path '):
+ rpath.append(l.split()[1])
+
+ p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ # If returned successfully, process stdout for results
+ if p.returncode == 0:
+ for l in out.split("\n"):
+ l = l.strip()
+ if not l or l.endswith(":"):
+ continue
+ if "is not an object file" in l:
+ continue
+ name = os.path.basename(l.split()[0]).rsplit(".", 1)[0]
+ if name and name not in needed[pkg]:
+ needed[pkg].append((name, file, []))
+
+ def mingw_dll(file, needed, sonames, renames, pkgver):
+ if not os.path.exists(file):
+ return
+
+ if file.endswith(".dll"):
+ # assume all dlls are shared objects provided by the package
+ sonames.append((os.path.basename(file), os.path.dirname(file).replace(pkgdest + "/" + pkg, ''), pkgver))
+
+ if (file.endswith(".dll") or file.endswith(".exe")):
+ # use objdump to search for "DLL Name: .*\.dll"
+ p = sub.Popen([d.expand("${HOST_PREFIX}objdump"), "-p", file], stdout = sub.PIPE, stderr= sub.PIPE)
+ out, err = p.communicate()
+ # process the output, grabbing all .dll names
+ if p.returncode == 0:
+ for m in re.finditer("DLL Name: (.*?\.dll)$", out.decode(), re.MULTILINE | re.IGNORECASE):
+ dllname = m.group(1)
+ if dllname:
+ needed[pkg].append((dllname, file, []))
+
+ if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS') == "1":
+ snap_symlinks = True
+ else:
+ snap_symlinks = False
+
+ use_ldconfig = bb.utils.contains('DISTRO_FEATURES', 'ldconfig', True, False, d)
+
+ needed = {}
+ shlib_provider = oe.package.read_shlib_providers(d)
+
+ for pkg in packages.split():
+ private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or ""
+ private_libs = private_libs.split()
+ needs_ldconfig = False
+ bb.debug(2, "calculating shlib provides for %s" % pkg)
+
+ pkgver = d.getVar('PKGV_' + pkg)
+ if not pkgver:
+ pkgver = d.getVar('PV_' + pkg)
+ if not pkgver:
+ pkgver = ver
+
+ needed[pkg] = []
+ sonames = list()
+ renames = list()
+ for file in pkgfiles[pkg]:
+ soname = None
+ if cpath.islink(file):
+ continue
+ if targetos == "darwin" or targetos == "darwin8":
+ darwin_so(file, needed, sonames, renames, pkgver)
+ elif targetos.startswith("mingw"):
+ mingw_dll(file, needed, sonames, renames, pkgver)
+ elif os.access(file, os.X_OK) or lib_re.match(file):
+ ldconfig = linux_so(file, needed, sonames, renames, pkgver)
+ needs_ldconfig = needs_ldconfig or ldconfig
+ for (old, new) in renames:
+ bb.note("Renaming %s to %s" % (old, new))
+ os.rename(old, new)
+ pkgfiles[pkg].remove(old)
+
+ shlibs_file = os.path.join(shlibswork_dir, pkg + ".list")
+ if len(sonames):
+ fd = open(shlibs_file, 'w')
+ for s in sonames:
+ if s[0] in shlib_provider and s[1] in shlib_provider[s[0]]:
+ (old_pkg, old_pkgver) = shlib_provider[s[0]][s[1]]
+ if old_pkg != pkg:
+ bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver))
+ bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0]))
+ fd.write(s[0] + ':' + s[1] + ':' + s[2] + '\n')
+ if s[0] not in shlib_provider:
+ shlib_provider[s[0]] = {}
+ shlib_provider[s[0]][s[1]] = (pkg, pkgver)
+ fd.close()
+ if needs_ldconfig and use_ldconfig:
+ bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('ldconfig_postinst_fragment')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+ bb.debug(1, 'LIBNAMES: pkg %s sonames %s' % (pkg, sonames))
+
+ bb.utils.unlockfile(lf)
+
+ assumed_libs = d.getVar('ASSUME_SHLIBS')
+ if assumed_libs:
+ libdir = d.getVar("libdir")
+ for e in assumed_libs.split():
+ l, dep_pkg = e.split(":")
+ lib_ver = None
+ dep_pkg = dep_pkg.rsplit("_", 1)
+ if len(dep_pkg) == 2:
+ lib_ver = dep_pkg[1]
+ dep_pkg = dep_pkg[0]
+ if l not in shlib_provider:
+ shlib_provider[l] = {}
+ shlib_provider[l][libdir] = (dep_pkg, lib_ver)
+
+ libsearchpath = [d.getVar('libdir'), d.getVar('base_libdir')]
+
+ for pkg in packages.split():
+ bb.debug(2, "calculating shlib requirements for %s" % pkg)
+
+ private_libs = d.getVar('PRIVATE_LIBS_' + pkg) or d.getVar('PRIVATE_LIBS') or ""
+ private_libs = private_libs.split()
+
+ deps = list()
+ for n in needed[pkg]:
+ # if n is in private libraries, don't try to search provider for it
+ # this could cause problem in case some abc.bb provides private
+ # /opt/abc/lib/libfoo.so.1 and contains /usr/bin/abc depending on system library libfoo.so.1
+ # but skipping it is still better alternative than providing own
+ # version and then adding runtime dependency for the same system library
+ if private_libs and n[0] in private_libs:
+ bb.debug(2, '%s: Dependency %s covered by PRIVATE_LIBS' % (pkg, n[0]))
+ continue
+ if n[0] in shlib_provider.keys():
+ shlib_provider_path = []
+ for k in shlib_provider[n[0]].keys():
+ shlib_provider_path.append(k)
+ match = None
+ for p in n[2] + shlib_provider_path + libsearchpath:
+ if p in shlib_provider[n[0]]:
+ match = p
+ break
+ if match:
+ (dep_pkg, ver_needed) = shlib_provider[n[0]][match]
+
+ bb.debug(2, '%s: Dependency %s requires package %s (used by files: %s)' % (pkg, n[0], dep_pkg, n[1]))
+
+ if dep_pkg == pkg:
+ continue
+
+ if ver_needed:
+ dep = "%s (>= %s)" % (dep_pkg, ver_needed)
+ else:
+ dep = dep_pkg
+ if not dep in deps:
+ deps.append(dep)
+ continue
+ bb.note("Couldn't find shared library provider for %s, used by files: %s" % (n[0], n[1]))
+
+ deps_file = os.path.join(pkgdest, pkg + ".shlibdeps")
+ if os.path.exists(deps_file):
+ os.remove(deps_file)
+ if len(deps):
+ fd = open(deps_file, 'w')
+ for dep in deps:
+ fd.write(dep + '\n')
+ fd.close()
+}
+
+python package_do_pkgconfig () {
+ import re
+
+ packages = d.getVar('PACKAGES')
+ workdir = d.getVar('WORKDIR')
+ pkgdest = d.getVar('PKGDEST')
+
+ shlibs_dirs = d.getVar('SHLIBSDIRS').split()
+ shlibswork_dir = d.getVar('SHLIBSWORKDIR')
+
+ pc_re = re.compile('(.*)\.pc$')
+ var_re = re.compile('(.*)=(.*)')
+ field_re = re.compile('(.*): (.*)')
+
+ pkgconfig_provided = {}
+ pkgconfig_needed = {}
+ for pkg in packages.split():
+ pkgconfig_provided[pkg] = []
+ pkgconfig_needed[pkg] = []
+ for file in pkgfiles[pkg]:
+ m = pc_re.match(file)
+ if m:
+ pd = bb.data.init()
+ name = m.group(1)
+ pkgconfig_provided[pkg].append(name)
+ if not os.access(file, os.R_OK):
+ continue
+ f = open(file, 'r')
+ lines = f.readlines()
+ f.close()
+ for l in lines:
+ m = var_re.match(l)
+ if m:
+ name = m.group(1)
+ val = m.group(2)
+ pd.setVar(name, pd.expand(val))
+ continue
+ m = field_re.match(l)
+ if m:
+ hdr = m.group(1)
+ exp = pd.expand(m.group(2))
+ if hdr == 'Requires':
+ pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
+
+ # Take shared lock since we're only reading, not writing
+ lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
+
+ for pkg in packages.split():
+ pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist")
+ if pkgconfig_provided[pkg] != []:
+ f = open(pkgs_file, 'w')
+ for p in pkgconfig_provided[pkg]:
+ f.write('%s\n' % p)
+ f.close()
+
+ # Go from least to most specific since the last one found wins
+ for dir in reversed(shlibs_dirs):
+ if not os.path.exists(dir):
+ continue
+ for file in os.listdir(dir):
+ m = re.match('^(.*)\.pclist$', file)
+ if m:
+ pkg = m.group(1)
+ fd = open(os.path.join(dir, file))
+ lines = fd.readlines()
+ fd.close()
+ pkgconfig_provided[pkg] = []
+ for l in lines:
+ pkgconfig_provided[pkg].append(l.rstrip())
+
+ for pkg in packages.split():
+ deps = []
+ for n in pkgconfig_needed[pkg]:
+ found = False
+ for k in pkgconfig_provided.keys():
+ if n in pkgconfig_provided[k]:
+ if k != pkg and not (k in deps):
+ deps.append(k)
+ found = True
+ if found == False:
+ bb.note("couldn't find pkgconfig module '%s' in any package" % n)
+ deps_file = os.path.join(pkgdest, pkg + ".pcdeps")
+ if len(deps):
+ fd = open(deps_file, 'w')
+ for dep in deps:
+ fd.write(dep + '\n')
+ fd.close()
+
+ bb.utils.unlockfile(lf)
+}
+
+def read_libdep_files(d):
+ pkglibdeps = {}
+ packages = d.getVar('PACKAGES').split()
+ for pkg in packages:
+ pkglibdeps[pkg] = {}
+ for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
+ depsfile = d.expand("${PKGDEST}/" + pkg + extension)
+ if os.access(depsfile, os.R_OK):
+ fd = open(depsfile)
+ lines = fd.readlines()
+ fd.close()
+ for l in lines:
+ l.rstrip()
+ deps = bb.utils.explode_dep_versions2(l)
+ for dep in deps:
+ if not dep in pkglibdeps[pkg]:
+ pkglibdeps[pkg][dep] = deps[dep]
+ return pkglibdeps
+
+python read_shlibdeps () {
+ pkglibdeps = read_libdep_files(d)
+
+ packages = d.getVar('PACKAGES').split()
+ for pkg in packages:
+ rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg) or "")
+ for dep in pkglibdeps[pkg]:
+ # Add the dep if it's not already there, or if no comparison is set
+ if dep not in rdepends:
+ rdepends[dep] = []
+ for v in pkglibdeps[pkg][dep]:
+ if v not in rdepends[dep]:
+ rdepends[dep].append(v)
+ d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+}
+
+python package_depchains() {
+ """
+ For a given set of prefix and postfix modifiers, make those packages
+ RRECOMMENDS on the corresponding packages for its RDEPENDS.
+
+ Example: If package A depends upon package B, and A's .bb emits an
+ A-dev package, this would make A-dev Recommends: B-dev.
+
+ If only one of a given suffix is specified, it will take the RRECOMMENDS
+ based on the RDEPENDS of *all* other packages. If more than one of a given
+ suffix is specified, its will only use the RDEPENDS of the single parent
+ package.
+ """
+
+ packages = d.getVar('PACKAGES')
+ postfixes = (d.getVar('DEPCHAIN_POST') or '').split()
+ prefixes = (d.getVar('DEPCHAIN_PRE') or '').split()
+
+ def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
+
+ #bb.note('depends for %s is %s' % (base, depends))
+ rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
+
+ for depend in depends:
+ if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
+ #bb.note("Skipping %s" % depend)
+ continue
+ if depend.endswith('-dev'):
+ depend = depend[:-4]
+ if depend.endswith('-dbg'):
+ depend = depend[:-4]
+ pkgname = getname(depend, suffix)
+ #bb.note("Adding %s for %s" % (pkgname, depend))
+ if pkgname not in rreclist and pkgname != pkg:
+ rreclist[pkgname] = []
+
+ #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+ d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
+
+ def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
+
+ #bb.note('rdepends for %s is %s' % (base, rdepends))
+ rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg) or "")
+
+ for depend in rdepends:
+ if depend.find('virtual-locale-') != -1:
+ #bb.note("Skipping %s" % depend)
+ continue
+ if depend.endswith('-dev'):
+ depend = depend[:-4]
+ if depend.endswith('-dbg'):
+ depend = depend[:-4]
+ pkgname = getname(depend, suffix)
+ #bb.note("Adding %s for %s" % (pkgname, depend))
+ if pkgname not in rreclist and pkgname != pkg:
+ rreclist[pkgname] = []
+
+ #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+ d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
+
+ def add_dep(list, dep):
+ if dep not in list:
+ list.append(dep)
+
+ depends = []
+ for dep in bb.utils.explode_deps(d.getVar('DEPENDS') or ""):
+ add_dep(depends, dep)
+
+ rdepends = []
+ for pkg in packages.split():
+ for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg) or ""):
+ add_dep(rdepends, dep)
+
+ #bb.note('rdepends is %s' % rdepends)
+
+ def post_getname(name, suffix):
+ return '%s%s' % (name, suffix)
+ def pre_getname(name, suffix):
+ return '%s%s' % (suffix, name)
+
+ pkgs = {}
+ for pkg in packages.split():
+ for postfix in postfixes:
+ if pkg.endswith(postfix):
+ if not postfix in pkgs:
+ pkgs[postfix] = {}
+ pkgs[postfix][pkg] = (pkg[:-len(postfix)], post_getname)
+
+ for prefix in prefixes:
+ if pkg.startswith(prefix):
+ if not prefix in pkgs:
+ pkgs[prefix] = {}
+ pkgs[prefix][pkg] = (pkg[:-len(prefix)], pre_getname)
+
+ if "-dbg" in pkgs:
+ pkglibdeps = read_libdep_files(d)
+ pkglibdeplist = []
+ for pkg in pkglibdeps:
+ for k in pkglibdeps[pkg]:
+ add_dep(pkglibdeplist, k)
+ dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS') == '1') or (bb.data.inherits_class('packagegroup', d)))
+
+ for suffix in pkgs:
+ for pkg in pkgs[suffix]:
+ if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'):
+ continue
+ (base, func) = pkgs[suffix][pkg]
+ if suffix == "-dev":
+ pkg_adddeprrecs(pkg, base, suffix, func, depends, d)
+ elif suffix == "-dbg":
+ if not dbgdefaultdeps:
+ pkg_addrrecs(pkg, base, suffix, func, pkglibdeplist, d)
+ continue
+ if len(pkgs[suffix]) == 1:
+ pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
+ else:
+ rdeps = []
+ for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base) or ""):
+ add_dep(rdeps, dep)
+ pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
+}
+
+# Since bitbake can't determine which variables are accessed during package
+# iteration, we need to list them here:
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE SKIP_FILEDEPS PRIVATE_LIBS"
+
+def gen_packagevar(d):
+ ret = []
+ pkgs = (d.getVar("PACKAGES") or "").split()
+ vars = (d.getVar("PACKAGEVARS") or "").split()
+ for p in pkgs:
+ for v in vars:
+ ret.append(v + "_" + p)
+
+ # Ensure that changes to INCOMPATIBLE_LICENSE re-run do_package for
+ # affected recipes.
+ ret.append('LICENSE_EXCLUSION-%s' % p)
+ return " ".join(ret)
+
+PACKAGE_PREPROCESS_FUNCS ?= ""
+# Functions for setting up PKGD
+PACKAGEBUILDPKGD ?= " \
+ perform_packagecopy \
+ ${PACKAGE_PREPROCESS_FUNCS} \
+ split_and_strip_files \
+ fixup_perms \
+ "
+# Functions which split PKGD up into separate packages
+PACKAGESPLITFUNCS ?= " \
+ package_do_split_locales \
+ populate_packages"
+# Functions which process metadata based on split packages
+PACKAGEFUNCS += " \
+ package_fixsymlinks \
+ package_name_hook \
+ package_do_filedeps \
+ package_do_shlibs \
+ package_do_pkgconfig \
+ read_shlibdeps \
+ package_depchains \
+ emit_pkgdata"
+
+python do_package () {
+ # Change the following version to cause sstate to invalidate the package
+ # cache. This is useful if an item this class depends on changes in a
+ # way that the output of this class changes. rpmdeps is a good example
+ # as any change to rpmdeps requires this to be rerun.
+ # PACKAGE_BBCLASS_VERSION = "2"
+
+ # Init cachedpath
+ global cpath
+ cpath = oe.cachedpath.CachedPath()
+
+ ###########################################################################
+ # Sanity test the setup
+ ###########################################################################
+
+ packages = (d.getVar('PACKAGES') or "").split()
+ if len(packages) < 1:
+ bb.debug(1, "No packages to build, skipping do_package")
+ return
+
+ workdir = d.getVar('WORKDIR')
+ outdir = d.getVar('DEPLOY_DIR')
+ dest = d.getVar('D')
+ dvar = d.getVar('PKGD')
+ pn = d.getVar('PN')
+
+ if not workdir or not outdir or not dest or not dvar or not pn:
+ msg = "WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package"
+ package_qa_handle_error("var-undefined", msg, d)
+ return
+
+ bb.build.exec_func("package_get_auto_pr", d)
+
+ ###########################################################################
+ # Optimisations
+ ###########################################################################
+
+ # Continually expanding complex expressions is inefficient, particularly
+ # when we write to the datastore and invalidate the expansion cache. This
+ # code pre-expands some frequently used variables
+
+ def expandVar(x, d):
+ d.setVar(x, d.getVar(x))
+
+ for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
+ expandVar(x, d)
+
+ ###########################################################################
+ # Setup PKGD (from D)
+ ###########################################################################
+
+ for f in (d.getVar('PACKAGEBUILDPKGD') or '').split():
+ bb.build.exec_func(f, d)
+
+ ###########################################################################
+ # Split up PKGD into PKGDEST
+ ###########################################################################
+
+ cpath = oe.cachedpath.CachedPath()
+
+ for f in (d.getVar('PACKAGESPLITFUNCS') or '').split():
+ bb.build.exec_func(f, d)
+
+ ###########################################################################
+ # Process PKGDEST
+ ###########################################################################
+
+ # Build global list of files in each split package
+ global pkgfiles
+ pkgfiles = {}
+ packages = d.getVar('PACKAGES').split()
+ pkgdest = d.getVar('PKGDEST')
+ for pkg in packages:
+ pkgfiles[pkg] = []
+ for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
+ for file in files:
+ pkgfiles[pkg].append(walkroot + os.sep + file)
+
+ for f in (d.getVar('PACKAGEFUNCS') or '').split():
+ bb.build.exec_func(f, d)
+
+ qa_sane = d.getVar("QA_SANE")
+ if not qa_sane:
+ bb.fatal("Fatal QA errors found, failing task.")
+}
+
+do_package[dirs] = "${SHLIBSWORKDIR} ${PKGDESTWORK} ${D}"
+do_package[vardeps] += "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}"
+addtask package after do_install
+
+SSTATETASKS += "do_package"
+do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
+do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
+do_package_setscene[dirs] = "${STAGING_DIR}"
+
+python do_package_setscene () {
+ sstate_setscene(d)
+}
+addtask do_package_setscene
+
+do_packagedata () {
+ :
+}
+
+addtask packagedata before do_build after do_package
+
+SSTATETASKS += "do_packagedata"
+# PACKAGELOCK protects readers of PKGDATA_DIR against writes
+# whilst code is reading in do_package
+PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
+do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
+do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
+do_packagedata[sstate-lockfile] = "${PACKAGELOCK}"
+do_packagedata[stamp-extra-info] = "${MACHINE_ARCH}"
+
+python do_packagedata_setscene () {
+ sstate_setscene(d)
+}
+addtask do_packagedata_setscene
+
+#
+# Helper functions for the package writing classes
+#
+
+def mapping_rename_hook(d):
+ """
+ Rewrite variables to account for package renaming in things
+ like debian.bbclass or manual PKG variable name changes
+ """
+ pkg = d.getVar("PKG")
+ runtime_mapping_rename("RDEPENDS", pkg, d)
+ runtime_mapping_rename("RRECOMMENDS", pkg, d)
+ runtime_mapping_rename("RSUGGESTS", pkg, d)
diff --git a/poky/meta/classes/package_deb.bbclass b/poky/meta/classes/package_deb.bbclass
new file mode 100644
index 000000000..2e8d17d3c
--- /dev/null
+++ b/poky/meta/classes/package_deb.bbclass
@@ -0,0 +1,370 @@
+#
+# Copyright 2006-2008 OpenedHand Ltd.
+#
+
+inherit package
+
+IMAGE_PKGTYPE ?= "deb"
+
+DPKG_ARCH ?= "${@debian_arch_map(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'))}"
+DPKG_ARCH[vardepvalue] = "${DPKG_ARCH}"
+
+PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
+
+APTCONF_TARGET = "${WORKDIR}"
+
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
+
+def debian_arch_map(arch, tune):
+ tune_features = tune.split()
+ if arch == "allarch":
+ return "all"
+ if arch in ["i586", "i686"]:
+ return "i386"
+ if arch == "x86_64":
+ if "mx32" in tune_features:
+ return "x32"
+ return "amd64"
+ if arch.startswith("mips"):
+ endian = ["el", ""]["bigendian" in tune_features]
+ if "n64" in tune_features:
+ return "mips64" + endian
+ if "n32" in tune_features:
+ return "mipsn32" + endian
+ return "mips" + endian
+ if arch == "powerpc":
+ return arch + ["", "spe"]["spe" in tune_features]
+ if arch == "aarch64":
+ return "arm64"
+ if arch == "arm":
+ return arch + ["el", "hf"]["callconvention-hard" in tune_features]
+ return arch
+
+python do_package_deb () {
+
+ import multiprocessing
+ import traceback
+
+ class DebianWritePkgProcess(multiprocessing.Process):
+ def __init__(self, *args, **kwargs):
+ multiprocessing.Process.__init__(self, *args, **kwargs)
+ self._pconn, self._cconn = multiprocessing.Pipe()
+ self._exception = None
+
+ def run(self):
+ try:
+ multiprocessing.Process.run(self)
+ self._cconn.send(None)
+ except Exception as e:
+ tb = traceback.format_exc()
+ self._cconn.send((e, tb))
+
+ @property
+ def exception(self):
+ if self._pconn.poll():
+ self._exception = self._pconn.recv()
+ return self._exception
+
+ oldcwd = os.getcwd()
+
+ packages = d.getVar('PACKAGES')
+ if not packages:
+ bb.debug(1, "PACKAGES not defined, nothing to package")
+ return
+
+ tmpdir = d.getVar('TMPDIR')
+ if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
+
+ max_process = int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1)
+ launched = []
+ error = None
+ pkgs = packages.split()
+ while not error and pkgs:
+ if len(launched) < max_process:
+ p = DebianWritePkgProcess(target=deb_write_pkg, args=(pkgs.pop(), d))
+ p.start()
+ launched.append(p)
+ for q in launched:
+ # The finished processes are joined when calling is_alive()
+ if not q.is_alive():
+ launched.remove(q)
+ if q.exception:
+ error, traceback = q.exception
+ break
+
+ for p in launched:
+ p.join()
+
+ os.chdir(oldcwd)
+
+ if error:
+ raise error
+}
+do_package_deb[vardeps] += "deb_write_pkg"
+do_package_deb[vardepsexclude] = "BB_NUMBER_THREADS"
+
+def deb_write_pkg(pkg, d):
+ import re, copy
+ import textwrap
+ import subprocess
+ import collections
+ import codecs
+
+ outdir = d.getVar('PKGWRITEDIRDEB')
+ pkgdest = d.getVar('PKGDEST')
+
+ def cleanupcontrol(root):
+ for p in ['CONTROL', 'DEBIAN']:
+ p = os.path.join(root, p)
+ if os.path.exists(p):
+ bb.utils.prunedir(p)
+
+ localdata = bb.data.createCopy(d)
+ root = "%s/%s" % (pkgdest, pkg)
+
+ lf = bb.utils.lockfile(root + ".lock")
+ try:
+
+ localdata.setVar('ROOT', '')
+ localdata.setVar('ROOT_%s' % pkg, root)
+ pkgname = localdata.getVar('PKG_%s' % pkg)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ basedir = os.path.join(os.path.dirname(root))
+
+ pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH'))
+ bb.utils.mkdirhier(pkgoutdir)
+
+ os.chdir(root)
+ cleanupcontrol(root)
+ from glob import glob
+ g = glob('*')
+ if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
+ bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
+ return
+
+ controldir = os.path.join(root, 'DEBIAN')
+ bb.utils.mkdirhier(controldir)
+ os.chmod(controldir, 0o755)
+
+ ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
+
+ fields = []
+ pe = d.getVar('PKGE')
+ if pe and int(pe) > 0:
+ fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
+ else:
+ fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
+ fields.append(["Description: %s\n", ['DESCRIPTION']])
+ fields.append(["Section: %s\n", ['SECTION']])
+ fields.append(["Priority: %s\n", ['PRIORITY']])
+ fields.append(["Maintainer: %s\n", ['MAINTAINER']])
+ fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
+ fields.append(["OE: %s\n", ['PN']])
+ fields.append(["PackageArch: %s\n", ['PACKAGE_ARCH']])
+ if d.getVar('HOMEPAGE'):
+ fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+
+ # Package, Version, Maintainer, Description - mandatory
+ # Section, Priority, Essential, Architecture, Source, Depends, Pre-Depends, Recommends, Suggests, Conflicts, Replaces, Provides - Optional
+
+
+ def pullData(l, d):
+ l2 = []
+ for i in l:
+ data = d.getVar(i)
+ if data is None:
+ raise KeyError(i)
+ if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH') == 'all':
+ data = 'all'
+ elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
+ # The params in deb package control don't allow character
+ # `_', so change the arch's `_' to `-'. Such as `x86_64'
+ # -->`x86-64'
+ data = data.replace('_', '-')
+ l2.append(data)
+ return l2
+
+ ctrlfile.write("Package: %s\n" % pkgname)
+ if d.getVar('PACKAGE_ARCH') == "all":
+ ctrlfile.write("Multi-Arch: foreign\n")
+ # check for required fields
+ for (c, fs) in fields:
+ # Special behavior for description...
+ if 'DESCRIPTION' in fs:
+ summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "."
+ ctrlfile.write('Description: %s\n' % summary)
+ description = localdata.getVar('DESCRIPTION') or "."
+ description = textwrap.dedent(description).strip()
+ if '\\n' in description:
+ # Manually indent
+ for t in description.split('\\n'):
+ ctrlfile.write(' %s\n' % (t.strip() or '.'))
+ else:
+ # Auto indent
+ ctrlfile.write('%s\n' % textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))
+
+ else:
+ ctrlfile.write(c % tuple(pullData(fs, localdata)))
+
+ # more fields
+
+ custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+ if custom_fields_chunk:
+ ctrlfile.write(custom_fields_chunk)
+ ctrlfile.write("\n")
+
+ mapping_rename_hook(localdata)
+
+ def debian_cmp_remap(var):
+ # dpkg does not allow for '(', ')' or ':' in a dependency name
+ # Replace any instances of them with '__'
+ #
+ # In debian '>' and '<' do not mean what it appears they mean
+ # '<' = less or equal
+ # '>' = greater or equal
+ # adjust these to the '<<' and '>>' equivalents
+ #
+ for dep in list(var.keys()):
+ if '(' in dep or '/' in dep:
+ newdep = re.sub(r'[(:)/]', '__', dep)
+ if newdep.startswith("__"):
+ newdep = "A" + newdep
+ if newdep != dep:
+ var[newdep] = var[dep]
+ del var[dep]
+ for dep in var:
+ for i, v in enumerate(var[dep]):
+ if (v or "").startswith("< "):
+ var[dep][i] = var[dep][i].replace("< ", "<< ")
+ elif (v or "").startswith("> "):
+ var[dep][i] = var[dep][i].replace("> ", ">> ")
+
+ rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
+ debian_cmp_remap(rdepends)
+ for dep in list(rdepends.keys()):
+ if dep == pkg:
+ del rdepends[dep]
+ continue
+ if '*' in dep:
+ del rdepends[dep]
+ rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
+ debian_cmp_remap(rrecommends)
+ for dep in list(rrecommends.keys()):
+ if '*' in dep:
+ del rrecommends[dep]
+ rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
+ debian_cmp_remap(rsuggests)
+ # Deliberately drop version information here, not wanted/supported by deb
+ rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
+ # Remove file paths if any from rprovides, debian does not support custom providers
+ for key in list(rprovides.keys()):
+ if key.startswith('/'):
+ del rprovides[key]
+ rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
+ debian_cmp_remap(rprovides)
+ rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
+ debian_cmp_remap(rreplaces)
+ rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "")
+ debian_cmp_remap(rconflicts)
+ if rdepends:
+ ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
+ if rsuggests:
+ ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
+ if rrecommends:
+ ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
+ if rprovides:
+ ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
+ if rreplaces:
+ ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
+ if rconflicts:
+ ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
+ ctrlfile.close()
+
+ for script in ["preinst", "postinst", "prerm", "postrm"]:
+ scriptvar = localdata.getVar('pkg_%s' % script)
+ if not scriptvar:
+ continue
+ scriptvar = scriptvar.strip()
+ scriptfile = open(os.path.join(controldir, script), 'w')
+
+ if scriptvar.startswith("#!"):
+ pos = scriptvar.find("\n") + 1
+ scriptfile.write(scriptvar[:pos])
+ else:
+ pos = 0
+ scriptfile.write("#!/bin/sh\n")
+
+ # Prevent the prerm/postrm scripts from being run during an upgrade
+ if script in ('prerm', 'postrm'):
+ scriptfile.write('[ "$1" != "upgrade" ] || exit 0\n')
+
+ scriptfile.write(scriptvar[pos:])
+ scriptfile.write('\n')
+ scriptfile.close()
+ os.chmod(os.path.join(controldir, script), 0o755)
+
+ conffiles_str = ' '.join(get_conffiles(pkg, d))
+ if conffiles_str:
+ conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+ for f in conffiles_str.split():
+ if os.path.exists(oe.path.join(root, f)):
+ conffiles.write('%s\n' % f)
+ conffiles.close()
+
+ os.chdir(basedir)
+ subprocess.check_output("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH"), root, pkgoutdir),
+ stderr=subprocess.STDOUT,
+ shell=True)
+
+ finally:
+ cleanupcontrol(root)
+ bb.utils.unlockfile(lf)
+
+# Otherwise allarch packages may change depending on override configuration
+deb_write_pkg[vardepsexclude] = "OVERRIDES"
+
+# Indirect references to these vars
+do_package_write_deb[vardeps] += "PKGV PKGR PKGV DESCRIPTION SECTION PRIORITY MAINTAINER DPKG_ARCH PN HOMEPAGE"
+
+SSTATETASKS += "do_package_write_deb"
+do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
+
+python do_package_write_deb_setscene () {
+ tmpdir = d.getVar('TMPDIR')
+
+ if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
+
+ sstate_setscene(d)
+}
+addtask do_package_write_deb_setscene
+
+python () {
+ if d.getVar('PACKAGES') != '':
+ deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
+ d.appendVarFlag('do_package_write_deb', 'depends', deps)
+ d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
+}
+
+python do_package_write_deb () {
+ bb.build.exec_func("read_subpackage_metadata", d)
+ bb.build.exec_func("do_package_deb", d)
+}
+do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[umask] = "022"
+do_package_write_deb[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
+addtask package_write_deb after do_packagedata do_package
+
+
+PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_deb"
diff --git a/poky/meta/classes/package_ipk.bbclass b/poky/meta/classes/package_ipk.bbclass
new file mode 100644
index 000000000..a0b34fa7a
--- /dev/null
+++ b/poky/meta/classes/package_ipk.bbclass
@@ -0,0 +1,328 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "ipk"
+
+IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
+IPKGCONF_SDK = "${WORKDIR}/opkg-sdk.conf"
+
+PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
+
+# Program to be used to build opkg packages
+OPKGBUILDCMD ??= "opkg-build -Z xz"
+
+OPKG_ARGS += "--force_postinstall --prefer-arch-to-version"
+OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS") == "1"]}"
+OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE') or "").split())][(d.getVar("PACKAGE_EXCLUDE") or "").strip() != ""]}"
+
+OPKGLIBDIR = "${localstatedir}/lib"
+
+python do_package_ipk () {
+ import multiprocessing
+ import traceback
+
+ class IPKWritePkgProcess(multiprocessing.Process):
+ def __init__(self, *args, **kwargs):
+ multiprocessing.Process.__init__(self, *args, **kwargs)
+ self._pconn, self._cconn = multiprocessing.Pipe()
+ self._exception = None
+
+ def run(self):
+ try:
+ multiprocessing.Process.run(self)
+ self._cconn.send(None)
+ except Exception as e:
+ tb = traceback.format_exc()
+ self._cconn.send((e, tb))
+
+ @property
+ def exception(self):
+ if self._pconn.poll():
+ self._exception = self._pconn.recv()
+ return self._exception
+
+
+ oldcwd = os.getcwd()
+
+ workdir = d.getVar('WORKDIR')
+ outdir = d.getVar('PKGWRITEDIRIPK')
+ tmpdir = d.getVar('TMPDIR')
+ pkgdest = d.getVar('PKGDEST')
+ if not workdir or not outdir or not tmpdir:
+ bb.error("Variables incorrectly set, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES')
+ if not packages or packages == '':
+ bb.debug(1, "No packages; nothing to do")
+ return
+
+ # We're about to add new packages so the index needs to be checked
+ # so remove the appropriate stamp file.
+ if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
+
+ max_process = int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1)
+ launched = []
+ error = None
+ pkgs = packages.split()
+ while not error and pkgs:
+ if len(launched) < max_process:
+ p = IPKWritePkgProcess(target=ipk_write_pkg, args=(pkgs.pop(), d))
+ p.start()
+ launched.append(p)
+ for q in launched:
+ # The finished processes are joined when calling is_alive()
+ if not q.is_alive():
+ launched.remove(q)
+ if q.exception:
+ error, traceback = q.exception
+ break
+
+ for p in launched:
+ p.join()
+
+ os.chdir(oldcwd)
+
+ if error:
+ raise error
+}
+do_package_ipk[vardeps] += "ipk_write_pkg"
+do_package_ipk[vardepsexclude] = "BB_NUMBER_THREADS"
+
+def ipk_write_pkg(pkg, d):
+ import re, copy
+ import subprocess
+ import textwrap
+ import collections
+
+ def cleanupcontrol(root):
+ for p in ['CONTROL', 'DEBIAN']:
+ p = os.path.join(root, p)
+ if os.path.exists(p):
+ bb.utils.prunedir(p)
+
+ outdir = d.getVar('PKGWRITEDIRIPK')
+ pkgdest = d.getVar('PKGDEST')
+ recipesource = os.path.basename(d.getVar('FILE'))
+
+ localdata = bb.data.createCopy(d)
+ root = "%s/%s" % (pkgdest, pkg)
+
+ lf = bb.utils.lockfile(root + ".lock")
+ try:
+ localdata.setVar('ROOT', '')
+ localdata.setVar('ROOT_%s' % pkg, root)
+ pkgname = localdata.getVar('PKG_%s' % pkg)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ basedir = os.path.join(os.path.dirname(root))
+ arch = localdata.getVar('PACKAGE_ARCH')
+
+ if localdata.getVar('IPK_HIERARCHICAL_FEED', False) == "1":
+ # Spread packages across subdirectories so each isn't too crowded
+ if pkgname.startswith('lib'):
+ pkg_prefix = 'lib' + pkgname[3]
+ else:
+ pkg_prefix = pkgname[0]
+
+ # Keep -dbg, -dev, -doc, -staticdev, -locale and -locale-* packages
+ # together. These package suffixes are taken from the definitions of
+ # PACKAGES and PACKAGES_DYNAMIC in meta/conf/bitbake.conf
+ if pkgname[-4:] in ('-dbg', '-dev', '-doc'):
+ pkg_subdir = pkgname[:-4]
+ elif pkgname.endswith('-staticdev'):
+ pkg_subdir = pkgname[:-10]
+ elif pkgname.endswith('-locale'):
+ pkg_subdir = pkgname[:-7]
+ elif '-locale-' in pkgname:
+ pkg_subdir = pkgname[:pkgname.find('-locale-')]
+ else:
+ pkg_subdir = pkgname
+
+ pkgoutdir = "%s/%s/%s/%s" % (outdir, arch, pkg_prefix, pkg_subdir)
+ else:
+ pkgoutdir = "%s/%s" % (outdir, arch)
+
+ bb.utils.mkdirhier(pkgoutdir)
+ os.chdir(root)
+ cleanupcontrol(root)
+ from glob import glob
+ g = glob('*')
+ if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
+ bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
+ return
+
+ controldir = os.path.join(root, 'CONTROL')
+ bb.utils.mkdirhier(controldir)
+ ctrlfile = open(os.path.join(controldir, 'control'), 'w')
+
+ fields = []
+ pe = d.getVar('PKGE')
+ if pe and int(pe) > 0:
+ fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
+ else:
+ fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
+ fields.append(["Description: %s\n", ['DESCRIPTION']])
+ fields.append(["Section: %s\n", ['SECTION']])
+ fields.append(["Priority: %s\n", ['PRIORITY']])
+ fields.append(["Maintainer: %s\n", ['MAINTAINER']])
+ fields.append(["License: %s\n", ['LICENSE']])
+ fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
+ fields.append(["OE: %s\n", ['PN']])
+ if d.getVar('HOMEPAGE'):
+ fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+
+ def pullData(l, d):
+ l2 = []
+ for i in l:
+ l2.append(d.getVar(i))
+ return l2
+
+ ctrlfile.write("Package: %s\n" % pkgname)
+ # check for required fields
+ for (c, fs) in fields:
+ for f in fs:
+ if localdata.getVar(f, False) is None:
+ raise KeyError(f)
+ # Special behavior for description...
+ if 'DESCRIPTION' in fs:
+ summary = localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or "."
+ ctrlfile.write('Description: %s\n' % summary)
+ description = localdata.getVar('DESCRIPTION') or "."
+ description = textwrap.dedent(description).strip()
+ if '\\n' in description:
+ # Manually indent: multiline description includes a leading space
+ for t in description.split('\\n'):
+ ctrlfile.write(' %s\n' % (t.strip() or ' .'))
+ else:
+ # Auto indent
+ ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+ else:
+ ctrlfile.write(c % tuple(pullData(fs, localdata)))
+ # more fields
+
+ custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
+ if custom_fields_chunk is not None:
+ ctrlfile.write(custom_fields_chunk)
+ ctrlfile.write("\n")
+
+ mapping_rename_hook(localdata)
+
+ def debian_cmp_remap(var):
+ # In debian '>' and '<' do not mean what it appears they mean
+ # '<' = less or equal
+ # '>' = greater or equal
+ # adjust these to the '<<' and '>>' equivalents
+ #
+ for dep in var:
+ for i, v in enumerate(var[dep]):
+ if (v or "").startswith("< "):
+ var[dep][i] = var[dep][i].replace("< ", "<< ")
+ elif (v or "").startswith("> "):
+ var[dep][i] = var[dep][i].replace("> ", ">> ")
+
+ rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS") or "")
+ debian_cmp_remap(rdepends)
+ rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") or "")
+ debian_cmp_remap(rrecommends)
+ rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS") or "")
+ debian_cmp_remap(rsuggests)
+ # Deliberately drop version information here, not wanted/supported by ipk
+ rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES") or ""), [])
+ rprovides = collections.OrderedDict(sorted(rprovides.items(), key=lambda x: x[0]))
+ debian_cmp_remap(rprovides)
+ rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES") or "")
+ debian_cmp_remap(rreplaces)
+ rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS") or "")
+ debian_cmp_remap(rconflicts)
+
+ if rdepends:
+ ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
+ if rsuggests:
+ ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
+ if rrecommends:
+ ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
+ if rprovides:
+ ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
+ if rreplaces:
+ ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
+ if rconflicts:
+ ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
+ ctrlfile.write("Source: %s\n" % recipesource)
+ ctrlfile.close()
+
+ for script in ["preinst", "postinst", "prerm", "postrm"]:
+ scriptvar = localdata.getVar('pkg_%s' % script)
+ if not scriptvar:
+ continue
+ scriptfile = open(os.path.join(controldir, script), 'w')
+ scriptfile.write(scriptvar)
+ scriptfile.close()
+ os.chmod(os.path.join(controldir, script), 0o755)
+
+ conffiles_str = ' '.join(get_conffiles(pkg, d))
+ if conffiles_str:
+ conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+ for f in conffiles_str.split():
+ if os.path.exists(oe.path.join(root, f)):
+ conffiles.write('%s\n' % f)
+ conffiles.close()
+
+ os.chdir(basedir)
+ subprocess.check_output("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH"),
+ d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir),
+ stderr=subprocess.STDOUT,
+ shell=True)
+
+ if d.getVar('IPK_SIGN_PACKAGES') == '1':
+ ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
+ ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, d.getVar('PACKAGE_ARCH'))
+ sign_ipk(d, ipk_to_sign)
+
+ finally:
+ cleanupcontrol(root)
+ bb.utils.unlockfile(lf)
+
+# Otherwise allarch packages may change depending on override configuration
+ipk_write_pkg[vardepsexclude] = "OVERRIDES"
+
+
+SSTATETASKS += "do_package_write_ipk"
+do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}"
+
+python do_package_write_ipk_setscene () {
+ tmpdir = d.getVar('TMPDIR')
+
+ if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
+ os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
+
+ sstate_setscene(d)
+}
+addtask do_package_write_ipk_setscene
+
+python () {
+ if d.getVar('PACKAGES') != '':
+ deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot xz-native:do_populate_sysroot'
+ d.appendVarFlag('do_package_write_ipk', 'depends', deps)
+ d.setVarFlag('do_package_write_ipk', 'fakeroot', "1")
+}
+
+python do_package_write_ipk () {
+ bb.build.exec_func("read_subpackage_metadata", d)
+ bb.build.exec_func("do_package_ipk", d)
+}
+do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[umask] = "022"
+do_package_write_ipk[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
+addtask package_write_ipk after do_packagedata do_package
+
+PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_ipk"
diff --git a/poky/meta/classes/package_rpm.bbclass b/poky/meta/classes/package_rpm.bbclass
new file mode 100644
index 000000000..21ada348a
--- /dev/null
+++ b/poky/meta/classes/package_rpm.bbclass
@@ -0,0 +1,746 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "rpm"
+
+RPM="rpm"
+RPMBUILD="rpmbuild"
+
+PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
+
+# Maintaining the perfile dependencies has singificant overhead when writing the
+# packages. When set, this value merges them for efficiency.
+MERGEPERFILEDEPS = "1"
+
+# Filter dependencies based on a provided function.
+def filter_deps(var, f):
+ import collections
+
+ depends_dict = bb.utils.explode_dep_versions2(var)
+ newdeps_dict = collections.OrderedDict()
+ for dep in depends_dict:
+ if f(dep):
+ newdeps_dict[dep] = depends_dict[dep]
+ return bb.utils.join_deps(newdeps_dict, commasep=False)
+
+# Filter out absolute paths (typically /bin/sh and /usr/bin/env) and any perl
+# dependencies for nativesdk packages.
+def filter_nativesdk_deps(srcname, var):
+ if var and srcname.startswith("nativesdk-"):
+ var = filter_deps(var, lambda dep: not dep.startswith('/') and dep != 'perl' and not dep.startswith('perl('))
+ return var
+
+# Construct per file dependencies file
+def write_rpm_perfiledata(srcname, d):
+ workdir = d.getVar('WORKDIR')
+ packages = d.getVar('PACKAGES')
+ pkgd = d.getVar('PKGD')
+
+ def dump_filerdeps(varname, outfile, d):
+ outfile.write("#!/usr/bin/env python\n\n")
+ outfile.write("# Dependency table\n")
+ outfile.write('deps = {\n')
+ for pkg in packages.split():
+ dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
+ dependsflist = (d.getVar(dependsflist_key) or "")
+ for dfile in dependsflist.split():
+ key = "FILE" + varname + "_" + dfile + "_" + pkg
+ deps = filter_nativesdk_deps(srcname, d.getVar(key) or "")
+ depends_dict = bb.utils.explode_dep_versions(deps)
+ file = dfile.replace("@underscore@", "_")
+ file = file.replace("@closebrace@", "]")
+ file = file.replace("@openbrace@", "[")
+ file = file.replace("@tab@", "\t")
+ file = file.replace("@space@", " ")
+ file = file.replace("@at@", "@")
+ outfile.write('"' + pkgd + file + '" : "')
+ for dep in depends_dict:
+ ver = depends_dict[dep]
+ if dep and ver:
+ ver = ver.replace("(","")
+ ver = ver.replace(")","")
+ outfile.write(dep + " " + ver + " ")
+ else:
+ outfile.write(dep + " ")
+ outfile.write('",\n')
+ outfile.write('}\n\n')
+ outfile.write("import sys\n")
+ outfile.write("while 1:\n")
+ outfile.write("\tline = sys.stdin.readline().strip()\n")
+ outfile.write("\tif not line:\n")
+ outfile.write("\t\tsys.exit(0)\n")
+ outfile.write("\tif line in deps:\n")
+ outfile.write("\t\tprint(deps[line] + '\\n')\n")
+
+ # OE-core dependencies a.k.a. RPM requires
+ outdepends = workdir + "/" + srcname + ".requires"
+
+ dependsfile = open(outdepends, 'w')
+
+ dump_filerdeps('RDEPENDS', dependsfile, d)
+
+ dependsfile.close()
+ os.chmod(outdepends, 0o755)
+
+ # OE-core / RPM Provides
+ outprovides = workdir + "/" + srcname + ".provides"
+
+ providesfile = open(outprovides, 'w')
+
+ dump_filerdeps('RPROVIDES', providesfile, d)
+
+ providesfile.close()
+ os.chmod(outprovides, 0o755)
+
+ return (outdepends, outprovides)
+
+
+python write_specfile () {
+ import oe.packagedata
+
+ # append information for logs and patches to %prep
+ def add_prep(d,spec_files_bottom):
+ if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+ spec_files_bottom.append('%%prep -n %s' % d.getVar('PN') )
+ spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"")
+ spec_files_bottom.append('')
+
+ # append the name of tarball to key word 'SOURCE' in xxx.spec.
+ def tail_source(d):
+ if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+ ar_outdir = d.getVar('ARCHIVER_OUTDIR')
+ if not os.path.exists(ar_outdir):
+ return
+ source_list = os.listdir(ar_outdir)
+ source_number = 0
+ for source in source_list:
+ # The rpmbuild doesn't need the root permission, but it needs
+ # to know the file's user and group name, the only user and
+ # group in fakeroot is "root" when working in fakeroot.
+ f = os.path.join(ar_outdir, source)
+ os.chown(f, 0, 0)
+ spec_preamble_top.append('Source%s: %s' % (source_number, source))
+ source_number += 1
+
+ # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release
+ # This format is similar to OE, however there are restrictions on the
+ # characters that can be in a field. In the Version field, "-"
+ # characters are not allowed. "-" is allowed in the Release field.
+ #
+ # We translate the "-" in the version to a "+", by loading the PKGV
+ # from the dependent recipe, replacing the - with a +, and then using
+ # that value to do a replace inside of this recipe's dependencies.
+ # This preserves the "-" separator between the version and release, as
+ # well as any "-" characters inside of the release field.
+ #
+ # All of this has to happen BEFORE the mapping_rename_hook as
+ # after renaming we cannot look up the dependencies in the packagedata
+ # store.
+ def translate_vers(varname, d):
+ depends = d.getVar(varname)
+ if depends:
+ depends_dict = bb.utils.explode_dep_versions2(depends)
+ newdeps_dict = {}
+ for dep in depends_dict:
+ verlist = []
+ for ver in depends_dict[dep]:
+ if '-' in ver:
+ subd = oe.packagedata.read_subpkgdata_dict(dep, d)
+ if 'PKGV' in subd:
+ pv = subd['PV']
+ pkgv = subd['PKGV']
+ reppv = pkgv.replace('-', '+')
+ ver = ver.replace(pv, reppv).replace(pkgv, reppv)
+ if 'PKGR' in subd:
+ # Make sure PKGR rather than PR in ver
+ pr = '-' + subd['PR']
+ pkgr = '-' + subd['PKGR']
+ if pkgr not in ver:
+ ver = ver.replace(pr, pkgr)
+ verlist.append(ver)
+ else:
+ verlist.append(ver)
+ newdeps_dict[dep] = verlist
+ depends = bb.utils.join_deps(newdeps_dict)
+ d.setVar(varname, depends.strip())
+
+ # We need to change the style the dependency from BB to RPM
+ # This needs to happen AFTER the mapping_rename_hook
+ def print_deps(variable, tag, array, d):
+ depends = variable
+ if depends:
+ depends_dict = bb.utils.explode_dep_versions2(depends)
+ for dep in depends_dict:
+ for ver in depends_dict[dep]:
+ ver = ver.replace('(', '')
+ ver = ver.replace(')', '')
+ array.append("%s: %s %s" % (tag, dep, ver))
+ if not len(depends_dict[dep]):
+ array.append("%s: %s" % (tag, dep))
+
+ def walk_files(walkpath, target, conffiles, dirfiles):
+ # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories
+ # when packaging. We just ignore these files which are created in
+ # packages-split/ and not package/
+ # We have the odd situation where the CONTROL/DEBIAN directory can be removed in the middle of
+ # of the walk, the isdir() test would then fail and the walk code would assume its a file
+ # hence we check for the names in files too.
+ for rootpath, dirs, files in os.walk(walkpath):
+ path = rootpath.replace(walkpath, "")
+ if path.endswith("DEBIAN") or path.endswith("CONTROL"):
+ continue
+ path = path.replace("%", "%%%%%%%%")
+ path = path.replace("[", "?")
+ path = path.replace("]", "?")
+
+ # Treat all symlinks to directories as normal files.
+ # os.walk() lists them as directories.
+ def move_to_files(dir):
+ if os.path.islink(os.path.join(rootpath, dir)):
+ files.append(dir)
+ return True
+ else:
+ return False
+ dirs[:] = [dir for dir in dirs if not move_to_files(dir)]
+
+ # Directory handling can happen in two ways, either DIRFILES is not set at all
+ # in which case we fall back to the older behaviour of packages owning all their
+ # directories
+ if dirfiles is None:
+ for dir in dirs:
+ if dir == "CONTROL" or dir == "DEBIAN":
+ continue
+ dir = dir.replace("%", "%%%%%%%%")
+ dir = dir.replace("[", "?")
+ dir = dir.replace("]", "?")
+ # All packages own the directories their files are in...
+ target.append('%dir "' + path + '/' + dir + '"')
+ else:
+ # packages own only empty directories or explict directory.
+ # This will prevent the overlapping of security permission.
+ if path and not files and not dirs:
+ target.append('%dir "' + path + '"')
+ elif path and path in dirfiles:
+ target.append('%dir "' + path + '"')
+
+ for file in files:
+ if file == "CONTROL" or file == "DEBIAN":
+ continue
+ file = file.replace("%", "%%%%%%%%")
+ file = file.replace("[", "?")
+ file = file.replace("]", "?")
+ if conffiles.count(path + '/' + file):
+ target.append('%config "' + path + '/' + file + '"')
+ else:
+ target.append('"' + path + '/' + file + '"')
+
+ # Prevent the prerm/postrm scripts from being run during an upgrade
+ def wrap_uninstall(scriptvar):
+ scr = scriptvar.strip()
+ if scr.startswith("#!"):
+ pos = scr.find("\n") + 1
+ else:
+ pos = 0
+ scr = scr[:pos] + 'if [ "$1" = "0" ] ; then\n' + scr[pos:] + '\nfi'
+ return scr
+
+ def get_perfile(varname, pkg, d):
+ deps = []
+ dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
+ dependsflist = (d.getVar(dependsflist_key) or "")
+ for dfile in dependsflist.split():
+ key = "FILE" + varname + "_" + dfile + "_" + pkg
+ depends = d.getVar(key)
+ if depends:
+ deps.append(depends)
+ return " ".join(deps)
+
+ def append_description(spec_preamble, text):
+ """
+ Add the description to the spec file.
+ """
+ import textwrap
+ dedent_text = textwrap.dedent(text).strip()
+ # Bitbake saves "\n" as "\\n"
+ if '\\n' in dedent_text:
+ for t in dedent_text.split('\\n'):
+ spec_preamble.append(t.strip())
+ else:
+ spec_preamble.append('%s' % textwrap.fill(dedent_text, width=75))
+
+ packages = d.getVar('PACKAGES')
+ if not packages or packages == '':
+ bb.debug(1, "No packages; nothing to do")
+ return
+
+ pkgdest = d.getVar('PKGDEST')
+ if not pkgdest:
+ bb.fatal("No PKGDEST")
+
+ outspecfile = d.getVar('OUTSPECFILE')
+ if not outspecfile:
+ bb.fatal("No OUTSPECFILE")
+
+ # Construct the SPEC file...
+ srcname = d.getVar('PN')
+ srcsummary = (d.getVar('SUMMARY') or d.getVar('DESCRIPTION') or ".")
+ srcversion = d.getVar('PKGV').replace('-', '+')
+ srcrelease = d.getVar('PKGR')
+ srcepoch = (d.getVar('PKGE') or "")
+ srclicense = d.getVar('LICENSE')
+ srcsection = d.getVar('SECTION')
+ srcmaintainer = d.getVar('MAINTAINER')
+ srchomepage = d.getVar('HOMEPAGE')
+ srcdescription = d.getVar('DESCRIPTION') or "."
+ srccustomtagschunk = get_package_additional_metadata("rpm", d)
+
+ srcdepends = d.getVar('DEPENDS')
+ srcrdepends = []
+ srcrrecommends = []
+ srcrsuggests = []
+ srcrprovides = []
+ srcrreplaces = []
+ srcrconflicts = []
+ srcrobsoletes = []
+
+ srcrpreinst = []
+ srcrpostinst = []
+ srcrprerm = []
+ srcrpostrm = []
+
+ spec_preamble_top = []
+ spec_preamble_bottom = []
+
+ spec_scriptlets_top = []
+ spec_scriptlets_bottom = []
+
+ spec_files_top = []
+ spec_files_bottom = []
+
+ perfiledeps = (d.getVar("MERGEPERFILEDEPS") or "0") == "0"
+ extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA") or "0") == "1"
+
+ for pkg in packages.split():
+ localdata = bb.data.createCopy(d)
+
+ root = "%s/%s" % (pkgdest, pkg)
+
+ localdata.setVar('ROOT', '')
+ localdata.setVar('ROOT_%s' % pkg, root)
+ pkgname = localdata.getVar('PKG_%s' % pkg)
+ if not pkgname:
+ pkgname = pkg
+ localdata.setVar('PKG', pkgname)
+
+ localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+ conffiles = get_conffiles(pkg, d)
+ dirfiles = localdata.getVar('DIRFILES')
+ if dirfiles is not None:
+ dirfiles = dirfiles.split()
+
+ splitname = pkgname
+
+ splitsummary = (localdata.getVar('SUMMARY') or localdata.getVar('DESCRIPTION') or ".")
+ splitversion = (localdata.getVar('PKGV') or "").replace('-', '+')
+ splitrelease = (localdata.getVar('PKGR') or "")
+ splitepoch = (localdata.getVar('PKGE') or "")
+ splitlicense = (localdata.getVar('LICENSE') or "")
+ splitsection = (localdata.getVar('SECTION') or "")
+ splitdescription = (localdata.getVar('DESCRIPTION') or ".")
+ splitcustomtagschunk = get_package_additional_metadata("rpm", localdata)
+
+ translate_vers('RDEPENDS', localdata)
+ translate_vers('RRECOMMENDS', localdata)
+ translate_vers('RSUGGESTS', localdata)
+ translate_vers('RPROVIDES', localdata)
+ translate_vers('RREPLACES', localdata)
+ translate_vers('RCONFLICTS', localdata)
+
+ # Map the dependencies into their final form
+ mapping_rename_hook(localdata)
+
+ splitrdepends = localdata.getVar('RDEPENDS')
+ splitrrecommends = localdata.getVar('RRECOMMENDS')
+ splitrsuggests = localdata.getVar('RSUGGESTS')
+ splitrprovides = localdata.getVar('RPROVIDES')
+ splitrreplaces = localdata.getVar('RREPLACES')
+ splitrconflicts = localdata.getVar('RCONFLICTS')
+ splitrobsoletes = []
+
+ splitrpreinst = localdata.getVar('pkg_preinst')
+ splitrpostinst = localdata.getVar('pkg_postinst')
+ splitrprerm = localdata.getVar('pkg_prerm')
+ splitrpostrm = localdata.getVar('pkg_postrm')
+
+
+ if not perfiledeps:
+ # Add in summary of per file dependencies
+ splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d)
+ splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d)
+
+ splitrdepends = filter_nativesdk_deps(srcname, splitrdepends)
+
+ # Gather special src/first package data
+ if srcname == splitname:
+ archiving = d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and \
+ bb.data.inherits_class('archiver', d)
+ if archiving and srclicense != splitlicense:
+ bb.warn("The SRPM produced may not have the correct overall source license in the License tag. This is due to the LICENSE for the primary package and SRPM conflicting.")
+
+ srclicense = splitlicense
+ srcrdepends = splitrdepends
+ srcrrecommends = splitrrecommends
+ srcrsuggests = splitrsuggests
+ srcrprovides = splitrprovides
+ srcrreplaces = splitrreplaces
+ srcrconflicts = splitrconflicts
+
+ srcrpreinst = splitrpreinst
+ srcrpostinst = splitrpostinst
+ srcrprerm = splitrprerm
+ srcrpostrm = splitrpostrm
+
+ file_list = []
+ walk_files(root, file_list, conffiles, dirfiles)
+ if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
+ bb.note("Not creating empty RPM package for %s" % splitname)
+ else:
+ bb.note("Creating RPM package for %s" % splitname)
+ spec_files_top.append('%files')
+ if extra_pkgdata:
+ package_rpm_extra_pkgdata(splitname, spec_files_top, localdata)
+ spec_files_top.append('%defattr(-,-,-,-)')
+ if file_list:
+ bb.note("Creating RPM package for %s" % splitname)
+ spec_files_top.extend(file_list)
+ else:
+ bb.note("Creating EMPTY RPM Package for %s" % splitname)
+ spec_files_top.append('')
+ continue
+
+ # Process subpackage data
+ spec_preamble_bottom.append('%%package -n %s' % splitname)
+ spec_preamble_bottom.append('Summary: %s' % splitsummary)
+ if srcversion != splitversion:
+ spec_preamble_bottom.append('Version: %s' % splitversion)
+ if srcrelease != splitrelease:
+ spec_preamble_bottom.append('Release: %s' % splitrelease)
+ if srcepoch != splitepoch:
+ spec_preamble_bottom.append('Epoch: %s' % splitepoch)
+ spec_preamble_bottom.append('License: %s' % splitlicense)
+ spec_preamble_bottom.append('Group: %s' % splitsection)
+
+ if srccustomtagschunk != splitcustomtagschunk:
+ spec_preamble_bottom.append(splitcustomtagschunk)
+
+ # Replaces == Obsoletes && Provides
+ robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes or "")
+ rprovides = bb.utils.explode_dep_versions2(splitrprovides or "")
+ rreplaces = bb.utils.explode_dep_versions2(splitrreplaces or "")
+ for dep in rreplaces:
+ if not dep in robsoletes:
+ robsoletes[dep] = rreplaces[dep]
+ if not dep in rprovides:
+ rprovides[dep] = rreplaces[dep]
+ splitrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
+ splitrprovides = bb.utils.join_deps(rprovides, commasep=False)
+
+ print_deps(splitrdepends, "Requires", spec_preamble_bottom, d)
+ if splitrpreinst:
+ print_deps(splitrdepends, "Requires(pre)", spec_preamble_bottom, d)
+ if splitrpostinst:
+ print_deps(splitrdepends, "Requires(post)", spec_preamble_bottom, d)
+ if splitrprerm:
+ print_deps(splitrdepends, "Requires(preun)", spec_preamble_bottom, d)
+ if splitrpostrm:
+ print_deps(splitrdepends, "Requires(postun)", spec_preamble_bottom, d)
+
+ print_deps(splitrrecommends, "Recommends", spec_preamble_bottom, d)
+ print_deps(splitrsuggests, "Suggests", spec_preamble_bottom, d)
+ print_deps(splitrprovides, "Provides", spec_preamble_bottom, d)
+ print_deps(splitrobsoletes, "Obsoletes", spec_preamble_bottom, d)
+ print_deps(splitrconflicts, "Conflicts", spec_preamble_bottom, d)
+
+ spec_preamble_bottom.append('')
+
+ spec_preamble_bottom.append('%%description -n %s' % splitname)
+ append_description(spec_preamble_bottom, splitdescription)
+
+ spec_preamble_bottom.append('')
+
+ # Now process scriptlets
+ if splitrpreinst:
+ spec_scriptlets_bottom.append('%%pre -n %s' % splitname)
+ spec_scriptlets_bottom.append('# %s - preinst' % splitname)
+ spec_scriptlets_bottom.append(splitrpreinst)
+ spec_scriptlets_bottom.append('')
+ if splitrpostinst:
+ spec_scriptlets_bottom.append('%%post -n %s' % splitname)
+ spec_scriptlets_bottom.append('# %s - postinst' % splitname)
+ spec_scriptlets_bottom.append(splitrpostinst)
+ spec_scriptlets_bottom.append('')
+ if splitrprerm:
+ spec_scriptlets_bottom.append('%%preun -n %s' % splitname)
+ spec_scriptlets_bottom.append('# %s - prerm' % splitname)
+ scriptvar = wrap_uninstall(splitrprerm)
+ spec_scriptlets_bottom.append(scriptvar)
+ spec_scriptlets_bottom.append('')
+ if splitrpostrm:
+ spec_scriptlets_bottom.append('%%postun -n %s' % splitname)
+ spec_scriptlets_bottom.append('# %s - postrm' % splitname)
+ scriptvar = wrap_uninstall(splitrpostrm)
+ spec_scriptlets_bottom.append(scriptvar)
+ spec_scriptlets_bottom.append('')
+
+ # Now process files
+ file_list = []
+ walk_files(root, file_list, conffiles, dirfiles)
+ if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
+ bb.note("Not creating empty RPM package for %s" % splitname)
+ else:
+ spec_files_bottom.append('%%files -n %s' % splitname)
+ if extra_pkgdata:
+ package_rpm_extra_pkgdata(splitname, spec_files_bottom, localdata)
+ spec_files_bottom.append('%defattr(-,-,-,-)')
+ if file_list:
+ bb.note("Creating RPM package for %s" % splitname)
+ spec_files_bottom.extend(file_list)
+ else:
+ bb.note("Creating EMPTY RPM Package for %s" % splitname)
+ spec_files_bottom.append('')
+
+ del localdata
+
+ add_prep(d,spec_files_bottom)
+ spec_preamble_top.append('Summary: %s' % srcsummary)
+ spec_preamble_top.append('Name: %s' % srcname)
+ spec_preamble_top.append('Version: %s' % srcversion)
+ spec_preamble_top.append('Release: %s' % srcrelease)
+ if srcepoch and srcepoch.strip() != "":
+ spec_preamble_top.append('Epoch: %s' % srcepoch)
+ spec_preamble_top.append('License: %s' % srclicense)
+ spec_preamble_top.append('Group: %s' % srcsection)
+ spec_preamble_top.append('Packager: %s' % srcmaintainer)
+ if srchomepage:
+ spec_preamble_top.append('URL: %s' % srchomepage)
+ if srccustomtagschunk:
+ spec_preamble_top.append(srccustomtagschunk)
+ tail_source(d)
+
+ # Replaces == Obsoletes && Provides
+ robsoletes = bb.utils.explode_dep_versions2(srcrobsoletes or "")
+ rprovides = bb.utils.explode_dep_versions2(srcrprovides or "")
+ rreplaces = bb.utils.explode_dep_versions2(srcrreplaces or "")
+ for dep in rreplaces:
+ if not dep in robsoletes:
+ robsoletes[dep] = rreplaces[dep]
+ if not dep in rprovides:
+ rprovides[dep] = rreplaces[dep]
+ srcrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
+ srcrprovides = bb.utils.join_deps(rprovides, commasep=False)
+
+ print_deps(srcdepends, "BuildRequires", spec_preamble_top, d)
+ print_deps(srcrdepends, "Requires", spec_preamble_top, d)
+ if srcrpreinst:
+ print_deps(srcrdepends, "Requires(pre)", spec_preamble_top, d)
+ if srcrpostinst:
+ print_deps(srcrdepends, "Requires(post)", spec_preamble_top, d)
+ if srcrprerm:
+ print_deps(srcrdepends, "Requires(preun)", spec_preamble_top, d)
+ if srcrpostrm:
+ print_deps(srcrdepends, "Requires(postun)", spec_preamble_top, d)
+
+ print_deps(srcrrecommends, "Recommends", spec_preamble_top, d)
+ print_deps(srcrsuggests, "Suggests", spec_preamble_top, d)
+ print_deps(srcrprovides + (" /bin/sh" if srcname.startswith("nativesdk-") else ""), "Provides", spec_preamble_top, d)
+ print_deps(srcrobsoletes, "Obsoletes", spec_preamble_top, d)
+ print_deps(srcrconflicts, "Conflicts", spec_preamble_top, d)
+
+ spec_preamble_top.append('')
+
+ spec_preamble_top.append('%description')
+ append_description(spec_preamble_top, srcdescription)
+
+ spec_preamble_top.append('')
+
+ if srcrpreinst:
+ spec_scriptlets_top.append('%pre')
+ spec_scriptlets_top.append('# %s - preinst' % srcname)
+ spec_scriptlets_top.append(srcrpreinst)
+ spec_scriptlets_top.append('')
+ if srcrpostinst:
+ spec_scriptlets_top.append('%post')
+ spec_scriptlets_top.append('# %s - postinst' % srcname)
+ spec_scriptlets_top.append(srcrpostinst)
+ spec_scriptlets_top.append('')
+ if srcrprerm:
+ spec_scriptlets_top.append('%preun')
+ spec_scriptlets_top.append('# %s - prerm' % srcname)
+ scriptvar = wrap_uninstall(srcrprerm)
+ spec_scriptlets_top.append(scriptvar)
+ spec_scriptlets_top.append('')
+ if srcrpostrm:
+ spec_scriptlets_top.append('%postun')
+ spec_scriptlets_top.append('# %s - postrm' % srcname)
+ scriptvar = wrap_uninstall(srcrpostrm)
+ spec_scriptlets_top.append(scriptvar)
+ spec_scriptlets_top.append('')
+
+ # Write the SPEC file
+ specfile = open(outspecfile, 'w')
+
+ # RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
+ # of the generated spec file
+ external_preamble = d.getVar("RPMSPEC_PREAMBLE")
+ if external_preamble:
+ specfile.write(external_preamble + "\n")
+
+ for line in spec_preamble_top:
+ specfile.write(line + "\n")
+
+ for line in spec_preamble_bottom:
+ specfile.write(line + "\n")
+
+ for line in spec_scriptlets_top:
+ specfile.write(line + "\n")
+
+ for line in spec_scriptlets_bottom:
+ specfile.write(line + "\n")
+
+ for line in spec_files_top:
+ specfile.write(line + "\n")
+
+ for line in spec_files_bottom:
+ specfile.write(line + "\n")
+
+ specfile.close()
+}
+# Otherwise allarch packages may change depending on override configuration
+write_specfile[vardepsexclude] = "OVERRIDES"
+
+python do_package_rpm () {
+ workdir = d.getVar('WORKDIR')
+ tmpdir = d.getVar('TMPDIR')
+ pkgd = d.getVar('PKGD')
+ pkgdest = d.getVar('PKGDEST')
+ if not workdir or not pkgd or not tmpdir:
+ bb.error("Variables incorrectly set, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES')
+ if not packages or packages == '':
+ bb.debug(1, "No packages; nothing to do")
+ return
+
+ # Construct the spec file...
+ # If the spec file already exist, and has not been stored into
+ # pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
+ # so remove it before doing rpmbuild src.rpm.
+ srcname = d.getVar('PN')
+ outspecfile = workdir + "/" + srcname + ".spec"
+ if os.path.isfile(outspecfile):
+ os.remove(outspecfile)
+ d.setVar('OUTSPECFILE', outspecfile)
+ bb.build.exec_func('write_specfile', d)
+
+ perfiledeps = (d.getVar("MERGEPERFILEDEPS") or "0") == "0"
+ if perfiledeps:
+ outdepends, outprovides = write_rpm_perfiledata(srcname, d)
+
+ # Setup the rpmbuild arguments...
+ rpmbuild = d.getVar('RPMBUILD')
+ targetsys = d.getVar('TARGET_SYS')
+ targetvendor = d.getVar('HOST_VENDOR')
+
+ # Too many places in dnf stack assume that arch-independent packages are "noarch".
+ # Let's not fight against this.
+ package_arch = (d.getVar('PACKAGE_ARCH') or "").replace("-", "_")
+ if package_arch == "all":
+ package_arch = "noarch"
+
+ sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX') or "nativesdk").replace("-", "_")
+ d.setVar('PACKAGE_ARCH_EXTEND', package_arch)
+ pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}')
+ d.setVar('RPM_PKGWRITEDIR', pkgwritedir)
+ bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR'))
+ pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-linux')
+ bb.utils.mkdirhier(pkgwritedir)
+ os.chmod(pkgwritedir, 0o755)
+
+ cmd = rpmbuild
+ cmd = cmd + " --noclean --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
+ cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
+ cmd = cmd + " --define '_builddir " + d.getVar('B') + "'"
+ cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
+ cmd = cmd + " --define '_use_internal_dependency_generator 0'"
+ cmd = cmd + " --define '_binaries_in_noarch_packages_terminate_build 0'"
+ cmd = cmd + " --define '_build_id_links none'"
+ cmd = cmd + " --define '_binary_payload w6T.xzdio'"
+ cmd = cmd + " --define '_source_payload w6T.xzdio'"
+ cmd = cmd + " --define 'clamp_mtime_to_source_date_epoch 1'"
+ cmd = cmd + " --define '_buildhost reproducible'"
+ if perfiledeps:
+ cmd = cmd + " --define '__find_requires " + outdepends + "'"
+ cmd = cmd + " --define '__find_provides " + outprovides + "'"
+ else:
+ cmd = cmd + " --define '__find_requires %{nil}'"
+ cmd = cmd + " --define '__find_provides %{nil}'"
+ cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
+ cmd = cmd + " --define 'debug_package %{nil}'"
+ cmd = cmd + " --define '_tmppath " + workdir + "'"
+ if d.getVarFlag('ARCHIVER_MODE', 'srpm') == '1' and bb.data.inherits_class('archiver', d):
+ cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR') + "'"
+ cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR') + "'"
+ cmdsrpm = cmdsrpm + " -bs " + outspecfile
+ # Build the .src.rpm
+ d.setVar('SBUILDSPEC', cmdsrpm + "\n")
+ d.setVarFlag('SBUILDSPEC', 'func', '1')
+ bb.build.exec_func('SBUILDSPEC', d)
+ cmd = cmd + " -bb " + outspecfile
+
+ # rpm 4 creates various empty directories in _topdir, let's clean them up
+ cleanupcmd = "rm -rf %s/BUILDROOT %s/SOURCES %s/SPECS %s/SRPMS" % (workdir, workdir, workdir, workdir)
+
+ # Build the rpm package!
+ d.setVar('BUILDSPEC', cmd + "\n" + cleanupcmd + "\n")
+ d.setVarFlag('BUILDSPEC', 'func', '1')
+ bb.build.exec_func('BUILDSPEC', d)
+
+ if d.getVar('RPM_SIGN_PACKAGES') == '1':
+ bb.build.exec_func("sign_rpm", d)
+}
+
+python () {
+ if d.getVar('PACKAGES') != '':
+ deps = ' rpm-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
+ d.appendVarFlag('do_package_write_rpm', 'depends', deps)
+ d.setVarFlag('do_package_write_rpm', 'fakeroot', '1')
+}
+
+SSTATETASKS += "do_package_write_rpm"
+do_package_write_rpm[sstate-inputdirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[sstate-outputdirs] = "${DEPLOY_DIR_RPM}"
+# Take a shared lock, we can write multiple packages at the same time...
+# but we need to stop the rootfs/solver from running while we do...
+do_package_write_rpm[sstate-lockfile-shared] += "${DEPLOY_DIR_RPM}/rpm.lock"
+
+python do_package_write_rpm_setscene () {
+ sstate_setscene(d)
+}
+addtask do_package_write_rpm_setscene
+
+python do_package_write_rpm () {
+ bb.build.exec_func("read_subpackage_metadata", d)
+ bb.build.exec_func("do_package_rpm", d)
+}
+
+do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[cleandirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[umask] = "022"
+do_package_write_rpm[depends] += "${@oe.utils.build_depends_string(d.getVar('PACKAGE_WRITE_DEPS'), 'do_populate_sysroot')}"
+addtask package_write_rpm after do_packagedata do_package
+
+PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "createrepo-c-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_rpm"
diff --git a/poky/meta/classes/package_tar.bbclass b/poky/meta/classes/package_tar.bbclass
new file mode 100644
index 000000000..ce3ab4c8e
--- /dev/null
+++ b/poky/meta/classes/package_tar.bbclass
@@ -0,0 +1,73 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "tar"
+
+python do_package_tar () {
+ import subprocess
+
+ oldcwd = os.getcwd()
+
+ workdir = d.getVar('WORKDIR')
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ outdir = d.getVar('DEPLOY_DIR_TAR')
+ if not outdir:
+ bb.error("DEPLOY_DIR_TAR not defined, unable to package")
+ return
+
+ dvar = d.getVar('D')
+ if not dvar:
+ bb.error("D not defined, unable to package")
+ return
+
+ packages = d.getVar('PACKAGES')
+ if not packages:
+ bb.debug(1, "PACKAGES not defined, nothing to package")
+ return
+
+ pkgdest = d.getVar('PKGDEST')
+
+ bb.utils.mkdirhier(outdir)
+ bb.utils.mkdirhier(dvar)
+
+ for pkg in packages.split():
+ localdata = bb.data.createCopy(d)
+ root = "%s/%s" % (pkgdest, pkg)
+
+ overrides = localdata.getVar('OVERRIDES', False)
+ localdata.setVar('OVERRIDES', '%s:%s' % (overrides, pkg))
+
+ bb.utils.mkdirhier(root)
+ basedir = os.path.dirname(root)
+ tarfn = localdata.expand("${DEPLOY_DIR_TAR}/${PKG}-${PKGV}-${PKGR}.tar.gz")
+ os.chdir(root)
+ dlist = os.listdir(root)
+ if not dlist:
+ bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
+ continue
+ args = "tar -cz --exclude=CONTROL --exclude=DEBIAN -f".split()
+ ret = subprocess.call(args + [tarfn] + dlist)
+ if ret != 0:
+ bb.error("Creation of tar %s failed." % tarfn)
+
+ os.chdir(oldcwd)
+}
+
+python () {
+ if d.getVar('PACKAGES') != '':
+ deps = (d.getVarFlag('do_package_write_tar', 'depends') or "").split()
+ deps.append('tar-native:do_populate_sysroot')
+ deps.append('virtual/fakeroot-native:do_populate_sysroot')
+ d.setVarFlag('do_package_write_tar', 'depends', " ".join(deps))
+ d.setVarFlag('do_package_write_tar', 'fakeroot', "1")
+}
+
+
+python do_package_write_tar () {
+ bb.build.exec_func("read_subpackage_metadata", d)
+ bb.build.exec_func("do_package_tar", d)
+}
+do_package_write_tar[dirs] = "${D}"
+addtask package_write_tar before do_build after do_packagedata do_package
diff --git a/poky/meta/classes/packagedata.bbclass b/poky/meta/classes/packagedata.bbclass
new file mode 100644
index 000000000..a903e5cfd
--- /dev/null
+++ b/poky/meta/classes/packagedata.bbclass
@@ -0,0 +1,34 @@
+python read_subpackage_metadata () {
+ import oe.packagedata
+
+ vars = {
+ "PN" : d.getVar('PN'),
+ "PE" : d.getVar('PE'),
+ "PV" : d.getVar('PV'),
+ "PR" : d.getVar('PR'),
+ }
+
+ data = oe.packagedata.read_pkgdata(vars["PN"], d)
+
+ for key in data.keys():
+ d.setVar(key, data[key])
+
+ for pkg in d.getVar('PACKAGES').split():
+ sdata = oe.packagedata.read_subpkgdata(pkg, d)
+ for key in sdata.keys():
+ if key in vars:
+ if sdata[key] != vars[key]:
+ if key == "PN":
+ bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (vars[key], pkg, sdata[key]))
+ bb.fatal("Recipe %s is trying to change %s from '%s' to '%s'. This will cause do_package_write_* failures since the incorrect data will be used and they will be unable to find the right workdir." % (vars["PN"], key, vars[key], sdata[key]))
+ continue
+ #
+ # If we set unsuffixed variables here there is a chance they could clobber override versions
+ # of that variable, e.g. DESCRIPTION could clobber DESCRIPTION_<pkgname>
+ # We therefore don't clobber for the unsuffixed variable versions
+ #
+ if key.endswith("_" + pkg):
+ d.setVar(key, sdata[key])
+ else:
+ d.setVar(key, sdata[key], parsing=True)
+}
diff --git a/poky/meta/classes/packagefeed-stability.bbclass b/poky/meta/classes/packagefeed-stability.bbclass
new file mode 100644
index 000000000..564860256
--- /dev/null
+++ b/poky/meta/classes/packagefeed-stability.bbclass
@@ -0,0 +1,252 @@
+# Class to avoid copying packages into the feed if they haven't materially changed
+#
+# Copyright (C) 2015 Intel Corporation
+# Released under the MIT license (see COPYING.MIT for details)
+#
+# This class effectively intercepts packages as they are written out by
+# do_package_write_*, causing them to be written into a different
+# directory where we can compare them to whatever older packages might
+# be in the "real" package feed directory, and avoid copying the new
+# package to the feed if it has not materially changed. The idea is to
+# avoid unnecessary churn in the packages when dependencies trigger task
+# reexecution (and thus repackaging). Enabling the class is simple:
+#
+# INHERIT += "packagefeed-stability"
+#
+# Caveats:
+# 1) Latest PR values in the build system may not match those in packages
+# seen on the target (naturally)
+# 2) If you rebuild from sstate without the existing package feed present,
+# you will lose the "state" of the package feed i.e. the preserved old
+# package versions. Not the end of the world, but would negate the
+# entire purpose of this class.
+#
+# Note that running -c cleanall on a recipe will purposely delete the old
+# package files so they will definitely be copied the next time.
+
+python() {
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d):
+ return
+ # Package backend agnostic intercept
+ # This assumes that the package_write task is called package_write_<pkgtype>
+ # and that the directory in which packages should be written is
+ # pointed to by the variable DEPLOY_DIR_<PKGTYPE>
+ for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split():
+ if pkgclass.startswith('package_'):
+ pkgtype = pkgclass.split('_', 1)[1]
+ pkgwritefunc = 'do_package_write_%s' % pkgtype
+ sstate_outputdirs = d.getVarFlag(pkgwritefunc, 'sstate-outputdirs', False)
+ deploydirvar = 'DEPLOY_DIR_%s' % pkgtype.upper()
+ deploydirvarref = '${' + deploydirvar + '}'
+ pkgcomparefunc = 'do_package_compare_%s' % pkgtype
+
+ if bb.data.inherits_class('image', d):
+ d.appendVarFlag('do_rootfs', 'recrdeptask', ' ' + pkgcomparefunc)
+
+ if bb.data.inherits_class('populate_sdk_base', d):
+ d.appendVarFlag('do_populate_sdk', 'recrdeptask', ' ' + pkgcomparefunc)
+
+ if bb.data.inherits_class('populate_sdk_ext', d):
+ d.appendVarFlag('do_populate_sdk_ext', 'recrdeptask', ' ' + pkgcomparefunc)
+
+ d.appendVarFlag('do_build', 'recrdeptask', ' ' + pkgcomparefunc)
+
+ if d.getVarFlag(pkgwritefunc, 'noexec') or not d.getVarFlag(pkgwritefunc, 'task'):
+ # Packaging is disabled for this recipe, we shouldn't do anything
+ continue
+
+ if deploydirvarref in sstate_outputdirs:
+ deplor_dir_pkgtype = d.expand(deploydirvarref + '-prediff')
+ # Set intermediate output directory
+ d.setVarFlag(pkgwritefunc, 'sstate-outputdirs', sstate_outputdirs.replace(deploydirvarref, deplor_dir_pkgtype))
+ # Update SSTATE_DUPWHITELIST to avoid shared location conflicted error
+ d.appendVar('SSTATE_DUPWHITELIST', ' %s' % deplor_dir_pkgtype)
+
+ d.setVar(pkgcomparefunc, d.getVar('do_package_compare', False))
+ d.setVarFlags(pkgcomparefunc, d.getVarFlags('do_package_compare', False))
+ d.appendVarFlag(pkgcomparefunc, 'depends', ' build-compare-native:do_populate_sysroot')
+ bb.build.addtask(pkgcomparefunc, 'do_build', 'do_packagedata ' + pkgwritefunc, d)
+}
+
+# This isn't the real task function - it's a template that we use in the
+# anonymous python code above
+fakeroot python do_package_compare () {
+ currenttask = d.getVar('BB_CURRENTTASK')
+ pkgtype = currenttask.rsplit('_', 1)[1]
+ package_compare_impl(pkgtype, d)
+}
+
+def package_compare_impl(pkgtype, d):
+ import errno
+ import fnmatch
+ import glob
+ import subprocess
+ import oe.sstatesig
+
+ pn = d.getVar('PN')
+ deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper())
+ prepath = deploydir + '-prediff/'
+
+ # Find out PKGR values are
+ pkgdatadir = d.getVar('PKGDATA_DIR')
+ packages = []
+ try:
+ with open(os.path.join(pkgdatadir, pn), 'r') as f:
+ for line in f:
+ if line.startswith('PACKAGES:'):
+ packages = line.split(':', 1)[1].split()
+ break
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ pass
+
+ if not packages:
+ bb.debug(2, '%s: no packages, nothing to do' % pn)
+ return
+
+ pkgrvalues = {}
+ rpkgnames = {}
+ rdepends = {}
+ pkgvvalues = {}
+ for pkg in packages:
+ with open(os.path.join(pkgdatadir, 'runtime', pkg), 'r') as f:
+ for line in f:
+ if line.startswith('PKGR:'):
+ pkgrvalues[pkg] = line.split(':', 1)[1].strip()
+ if line.startswith('PKGV:'):
+ pkgvvalues[pkg] = line.split(':', 1)[1].strip()
+ elif line.startswith('PKG_%s:' % pkg):
+ rpkgnames[pkg] = line.split(':', 1)[1].strip()
+ elif line.startswith('RDEPENDS_%s:' % pkg):
+ rdepends[pkg] = line.split(':', 1)[1].strip()
+
+ # Prepare a list of the runtime package names for packages that were
+ # actually produced
+ rpkglist = []
+ for pkg, rpkg in rpkgnames.items():
+ if os.path.exists(os.path.join(pkgdatadir, 'runtime', pkg + '.packaged')):
+ rpkglist.append((rpkg, pkg))
+ rpkglist.sort(key=lambda x: len(x[0]), reverse=True)
+
+ pvu = d.getVar('PV', False)
+ if '$' + '{SRCPV}' in pvu:
+ pvprefix = pvu.split('$' + '{SRCPV}', 1)[0]
+ else:
+ pvprefix = None
+
+ pkgwritetask = 'package_write_%s' % pkgtype
+ files = []
+ docopy = False
+ manifest, _ = oe.sstatesig.sstate_get_manifest_filename(pkgwritetask, d)
+ mlprefix = d.getVar('MLPREFIX')
+ # Copy recipe's all packages if one of the packages are different to make
+ # they have the same PR.
+ with open(manifest, 'r') as f:
+ for line in f:
+ if line.startswith(prepath):
+ srcpath = line.rstrip()
+ if os.path.isfile(srcpath):
+ destpath = os.path.join(deploydir, os.path.relpath(srcpath, prepath))
+
+ # This is crude but should work assuming the output
+ # package file name starts with the package name
+ # and rpkglist is sorted by length (descending)
+ pkgbasename = os.path.basename(destpath)
+ pkgname = None
+ for rpkg, pkg in rpkglist:
+ if mlprefix and pkgtype == 'rpm' and rpkg.startswith(mlprefix):
+ rpkg = rpkg[len(mlprefix):]
+ if pkgbasename.startswith(rpkg):
+ pkgr = pkgrvalues[pkg]
+ destpathspec = destpath.replace(pkgr, '*')
+ if pvprefix:
+ pkgv = pkgvvalues[pkg]
+ if pkgv.startswith(pvprefix):
+ pkgvsuffix = pkgv[len(pvprefix):]
+ if '+' in pkgvsuffix:
+ newpkgv = pvprefix + '*+' + pkgvsuffix.split('+', 1)[1]
+ destpathspec = destpathspec.replace(pkgv, newpkgv)
+ pkgname = pkg
+ break
+ else:
+ bb.warn('Unable to map %s back to package' % pkgbasename)
+ destpathspec = destpath
+
+ oldfile = None
+ if not docopy:
+ oldfiles = glob.glob(destpathspec)
+ if oldfiles:
+ oldfile = oldfiles[-1]
+ result = subprocess.call(['pkg-diff.sh', oldfile, srcpath])
+ if result != 0:
+ docopy = True
+ bb.note("%s and %s are different, will copy packages" % (oldfile, srcpath))
+ else:
+ docopy = True
+ bb.note("No old packages found for %s, will copy packages" % pkgname)
+
+ files.append((pkgname, pkgbasename, srcpath, destpath))
+
+ # Remove all the old files and copy again if docopy
+ if docopy:
+ bb.note('Copying packages for recipe %s' % pn)
+ pcmanifest = os.path.join(prepath, d.expand('pkg-compare-manifest-${MULTIMACH_TARGET_SYS}-${PN}'))
+ try:
+ with open(pcmanifest, 'r') as f:
+ for line in f:
+ fn = line.rstrip()
+ if fn:
+ try:
+ os.remove(fn)
+ bb.note('Removed old package %s' % fn)
+ except OSError as e:
+ if e.errno == errno.ENOENT:
+ pass
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ pass
+
+ # Create new manifest
+ with open(pcmanifest, 'w') as f:
+ for pkgname, pkgbasename, srcpath, destpath in files:
+ destdir = os.path.dirname(destpath)
+ bb.utils.mkdirhier(destdir)
+ # Remove allarch rpm pkg if it is already existed (for
+ # multilib), they're identical in theory, but sstate.bbclass
+ # copies it again, so keep align with that.
+ if os.path.exists(destpath) and pkgtype == 'rpm' \
+ and d.getVar('PACKAGE_ARCH') == 'all':
+ os.unlink(destpath)
+ if (os.stat(srcpath).st_dev == os.stat(destdir).st_dev):
+ # Use a hard link to save space
+ os.link(srcpath, destpath)
+ else:
+ shutil.copyfile(srcpath, destpath)
+ f.write('%s\n' % destpath)
+ else:
+ bb.note('Not copying packages for recipe %s' % pn)
+
+do_cleansstate[postfuncs] += "pfs_cleanpkgs"
+python pfs_cleanpkgs () {
+ import errno
+ for pkgclass in (d.getVar('PACKAGE_CLASSES') or '').split():
+ if pkgclass.startswith('package_'):
+ pkgtype = pkgclass.split('_', 1)[1]
+ deploydir = d.getVar('DEPLOY_DIR_%s' % pkgtype.upper())
+ prepath = deploydir + '-prediff'
+ pcmanifest = os.path.join(prepath, d.expand('pkg-compare-manifest-${MULTIMACH_TARGET_SYS}-${PN}'))
+ try:
+ with open(pcmanifest, 'r') as f:
+ for line in f:
+ fn = line.rstrip()
+ if fn:
+ try:
+ os.remove(fn)
+ except OSError as e:
+ if e.errno == errno.ENOENT:
+ pass
+ os.remove(pcmanifest)
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ pass
+}
diff --git a/poky/meta/classes/packagegroup.bbclass b/poky/meta/classes/packagegroup.bbclass
new file mode 100644
index 000000000..d540d4214
--- /dev/null
+++ b/poky/meta/classes/packagegroup.bbclass
@@ -0,0 +1,59 @@
+# Class for packagegroup (package group) recipes
+
+# By default, only the packagegroup package itself is in PACKAGES.
+# -dbg and -dev flavours are handled by the anonfunc below.
+# This means that packagegroup recipes used to build multiple packagegroup
+# packages have to modify PACKAGES after inheriting packagegroup.bbclass.
+PACKAGES = "${PN}"
+
+# By default, packagegroup packages do not depend on a certain architecture.
+# Only if dependencies are modified by MACHINE_FEATURES, packages
+# need to be set to MACHINE_ARCH after inheriting packagegroup.bbclass
+PACKAGE_ARCH ?= "all"
+
+# Fully expanded - so it applies the overrides as well
+PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
+
+LICENSE ?= "MIT"
+
+inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
+
+# This automatically adds -dbg and -dev flavours of all PACKAGES
+# to the list. Their dependencies (RRECOMMENDS) are handled as usual
+# by package_depchains in a following step.
+# Also mark all packages as ALLOW_EMPTY
+python () {
+ packages = d.getVar('PACKAGES').split()
+ if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY') != '1':
+ types = ['', '-dbg', '-dev']
+ if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+ types.append('-ptest')
+ packages = [pkg + suffix for pkg in packages
+ for suffix in types]
+ d.setVar('PACKAGES', ' '.join(packages))
+ for pkg in packages:
+ d.setVar('ALLOW_EMPTY_%s' % pkg, '1')
+}
+
+# We don't want to look at shared library dependencies for the
+# dbg packages
+DEPCHAIN_DBGDEFAULTDEPS = "1"
+
+# We only need the packaging tasks - disable the rest
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+
+python () {
+ if bb.data.inherits_class('nativesdk', d):
+ return
+ initman = d.getVar("VIRTUAL-RUNTIME_init_manager")
+ if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
+ bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
+}
+
+CVE_PRODUCT = ""
diff --git a/poky/meta/classes/patch.bbclass b/poky/meta/classes/patch.bbclass
new file mode 100644
index 000000000..2fc6925e4
--- /dev/null
+++ b/poky/meta/classes/patch.bbclass
@@ -0,0 +1,159 @@
+# Copyright (C) 2006 OpenedHand LTD
+
+# Point to an empty file so any user's custom settings don't break things
+QUILTRCFILE ?= "${STAGING_ETCDIR_NATIVE}/quiltrc"
+
+PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
+
+PATCH_GIT_USER_NAME ?= "OpenEmbedded"
+PATCH_GIT_USER_EMAIL ?= "oe.patch@oe"
+
+inherit terminal
+
+python () {
+ if d.getVar('PATCHTOOL') == 'git' and d.getVar('PATCH_COMMIT_FUNCTIONS') == '1':
+ extratasks = bb.build.tasksbetween('do_unpack', 'do_patch', d)
+ try:
+ extratasks.remove('do_unpack')
+ except ValueError:
+ # For some recipes do_unpack doesn't exist, ignore it
+ pass
+
+ d.appendVarFlag('do_patch', 'prefuncs', ' patch_task_patch_prefunc')
+ for task in extratasks:
+ d.appendVarFlag(task, 'postfuncs', ' patch_task_postfunc')
+}
+
+python patch_task_patch_prefunc() {
+ # Prefunc for do_patch
+ srcsubdir = d.getVar('S')
+
+ workdir = os.path.abspath(d.getVar('WORKDIR'))
+ testsrcdir = os.path.abspath(srcsubdir)
+ if (testsrcdir + os.sep).startswith(workdir + os.sep):
+ # Double-check that either workdir or S or some directory in-between is a git repository
+ found = False
+ while testsrcdir != '/':
+ if os.path.exists(os.path.join(testsrcdir, '.git')):
+ found = True
+ break
+ if testsrcdir == workdir:
+ break
+ testsrcdir = os.path.dirname(testsrcdir)
+ if not found:
+ bb.fatal('PATCHTOOL = "git" set for source tree that is not a git repository. Refusing to continue as that may result in commits being made in your metadata repository.')
+
+ patchdir = os.path.join(srcsubdir, 'patches')
+ if os.path.exists(patchdir):
+ if os.listdir(patchdir):
+ d.setVar('PATCH_HAS_PATCHES_DIR', '1')
+ else:
+ os.rmdir(patchdir)
+}
+
+python patch_task_postfunc() {
+ # Prefunc for task functions between do_unpack and do_patch
+ import oe.patch
+ import shutil
+ func = d.getVar('BB_RUNTASK')
+ srcsubdir = d.getVar('S')
+
+ if os.path.exists(srcsubdir):
+ if func == 'do_patch':
+ haspatches = (d.getVar('PATCH_HAS_PATCHES_DIR') == '1')
+ patchdir = os.path.join(srcsubdir, 'patches')
+ if os.path.exists(patchdir):
+ shutil.rmtree(patchdir)
+ if haspatches:
+ stdout, _ = bb.process.run('git status --porcelain patches', cwd=srcsubdir)
+ if stdout:
+ bb.process.run('git checkout patches', cwd=srcsubdir)
+ stdout, _ = bb.process.run('git status --porcelain .', cwd=srcsubdir)
+ if stdout:
+ useroptions = []
+ oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
+ bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(useroptions), func, oe.patch.GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
+}
+
+def src_patches(d, all=False, expand=True):
+ import oe.patch
+ return oe.patch.src_patches(d, all, expand)
+
+def should_apply(parm, d):
+ """Determine if we should apply the given patch"""
+ import oe.patch
+ return oe.patch.should_apply(parm, d)
+
+should_apply[vardepsexclude] = "DATE SRCDATE"
+
+python patch_do_patch() {
+ import oe.patch
+
+ patchsetmap = {
+ "patch": oe.patch.PatchTree,
+ "quilt": oe.patch.QuiltTree,
+ "git": oe.patch.GitApplyTree,
+ }
+
+ cls = patchsetmap[d.getVar('PATCHTOOL') or 'quilt']
+
+ resolvermap = {
+ "noop": oe.patch.NOOPResolver,
+ "user": oe.patch.UserResolver,
+ }
+
+ rcls = resolvermap[d.getVar('PATCHRESOLVE') or 'user']
+
+ classes = {}
+
+ s = d.getVar('S')
+
+ os.putenv('PATH', d.getVar('PATH'))
+
+ # We must use one TMPDIR per process so that the "patch" processes
+ # don't generate the same temp file name.
+
+ import tempfile
+ process_tmpdir = tempfile.mkdtemp()
+ os.environ['TMPDIR'] = process_tmpdir
+
+ for patch in src_patches(d):
+ _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+
+ if "patchdir" in parm:
+ patchdir = parm["patchdir"]
+ if not os.path.isabs(patchdir):
+ patchdir = os.path.join(s, patchdir)
+ else:
+ patchdir = s
+
+ if not patchdir in classes:
+ patchset = cls(patchdir, d)
+ resolver = rcls(patchset, oe_terminal)
+ classes[patchdir] = (patchset, resolver)
+ patchset.Clean()
+ else:
+ patchset, resolver = classes[patchdir]
+
+ bb.note("Applying patch '%s' (%s)" % (parm['patchname'], oe.path.format_display(local, d)))
+ try:
+ patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
+ except Exception as exc:
+ bb.utils.remove(process_tmpdir, True)
+ bb.fatal(str(exc))
+ try:
+ resolver.Resolve()
+ except bb.BBHandledException as e:
+ bb.utils.remove(process_tmpdir, True)
+ bb.fatal(str(e))
+
+ bb.utils.remove(process_tmpdir, True)
+ del os.environ['TMPDIR']
+}
+patch_do_patch[vardepsexclude] = "PATCHRESOLVE"
+
+addtask patch after do_unpack
+do_patch[dirs] = "${WORKDIR}"
+do_patch[depends] = "${PATCHDEPENDENCY}"
+
+EXPORT_FUNCTIONS do_patch
diff --git a/poky/meta/classes/perl-version.bbclass b/poky/meta/classes/perl-version.bbclass
new file mode 100644
index 000000000..fafe68a77
--- /dev/null
+++ b/poky/meta/classes/perl-version.bbclass
@@ -0,0 +1,24 @@
+PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
+
+# Determine the staged version of perl from the perl configuration file
+# Assign vardepvalue, because otherwise signature is changed before and after
+# perl is built (from None to real version in config.sh).
+get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
+def get_perl_version(d):
+ import re
+ cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
+ try:
+ f = open(cfg, 'r')
+ except IOError:
+ return None
+ l = f.readlines();
+ f.close();
+ r = re.compile("^version='(\d*\.\d*\.\d*)'")
+ for s in l:
+ m = r.match(s)
+ if m:
+ return m.group(1)
+ return None
+
+PERLVERSION := "${@get_perl_version(d)}"
+PERLVERSION[vardepvalue] = ""
diff --git a/poky/meta/classes/perlnative.bbclass b/poky/meta/classes/perlnative.bbclass
new file mode 100644
index 000000000..cc8de8b38
--- /dev/null
+++ b/poky/meta/classes/perlnative.bbclass
@@ -0,0 +1,3 @@
+EXTRANATIVEPATH += "perl-native"
+DEPENDS += "perl-native"
+OECMAKE_PERLNATIVE_DIR = "${STAGING_BINDIR_NATIVE}/perl-native"
diff --git a/poky/meta/classes/pixbufcache.bbclass b/poky/meta/classes/pixbufcache.bbclass
new file mode 100644
index 000000000..b3e507f61
--- /dev/null
+++ b/poky/meta/classes/pixbufcache.bbclass
@@ -0,0 +1,64 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for pixbuf
+# packages.
+#
+
+DEPENDS += "qemu-native"
+inherit qemu
+
+PIXBUF_PACKAGES ??= "${PN}"
+
+PACKAGE_WRITE_DEPS += "qemu-native gdk-pixbuf-native"
+
+pixbufcache_common() {
+if [ "x$D" != "x" ]; then
+ $INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
+ bindir=${bindir} base_libdir=${base_libdir}
+else
+
+ # Update the pixbuf loaders in case they haven't been registered yet
+ ${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
+
+ if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then
+ for icondir in /usr/share/icons/*; do
+ if [ -d ${icondir} ]; then
+ gtk-update-icon-cache -t -q ${icondir}
+ fi
+ done
+ fi
+fi
+}
+
+python populate_packages_append() {
+ pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES').split()
+
+ for pkg in pixbuf_pkgs:
+ bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg)
+ postinst = d.getVar('pkg_postinst_%s' % pkg) or d.getVar('pkg_postinst')
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += d.getVar('pixbufcache_common')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg) or d.getVar('pkg_postrm')
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += d.getVar('pixbufcache_common')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+gdkpixbuf_complete() {
+GDK_PIXBUF_FATAL_LOADER=1 ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache || exit 1
+}
+
+DEPENDS_append_class-native = " gdk-pixbuf-native"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " pixbufcache_sstate_postinst"
+
+# See base.bbclass for the other half of this
+pixbufcache_sstate_postinst() {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+ echo '#!/bin/sh' > $dest
+ echo "${gdkpixbuf_complete}" >> $dest
+ chmod 0755 $dest
+}
diff --git a/poky/meta/classes/pkgconfig.bbclass b/poky/meta/classes/pkgconfig.bbclass
new file mode 100644
index 000000000..ad1f84f50
--- /dev/null
+++ b/poky/meta/classes/pkgconfig.bbclass
@@ -0,0 +1,2 @@
+DEPENDS_prepend = "pkgconfig-native "
+
diff --git a/poky/meta/classes/populate_sdk.bbclass b/poky/meta/classes/populate_sdk.bbclass
new file mode 100644
index 000000000..f64a911b7
--- /dev/null
+++ b/poky/meta/classes/populate_sdk.bbclass
@@ -0,0 +1,7 @@
+# The majority of populate_sdk is located in populate_sdk_base
+# This chunk simply facilitates compatibility with SDK only recipes.
+
+inherit populate_sdk_base
+
+addtask populate_sdk after do_install before do_build
+
diff --git a/poky/meta/classes/populate_sdk_base.bbclass b/poky/meta/classes/populate_sdk_base.bbclass
new file mode 100644
index 000000000..3da350747
--- /dev/null
+++ b/poky/meta/classes/populate_sdk_base.bbclass
@@ -0,0 +1,309 @@
+inherit meta
+
+# Wildcards specifying complementary packages to install for every package that has been explicitly
+# installed into the rootfs
+COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev'
+COMPLEMENTARY_GLOB[staticdev-pkgs] = '*-staticdev'
+COMPLEMENTARY_GLOB[doc-pkgs] = '*-doc'
+COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
+COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest'
+
+def complementary_globs(featurevar, d):
+ all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
+ globs = []
+ features = set((d.getVar(featurevar) or '').split())
+ for name, glob in all_globs.items():
+ if name in features:
+ globs.append(glob)
+ return ' '.join(globs)
+
+SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}"
+SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
+
+PACKAGE_ARCHS_append_task-populate-sdk = " sdk-provides-dummy-target"
+SDK_PACKAGE_ARCHS += "sdk-provides-dummy-${SDKPKGSUFFIX}"
+
+# List of locales to install, or "all" for all of them, or unset for none.
+SDKIMAGE_LINGUAS ?= "all"
+
+inherit rootfs_${IMAGE_PKGTYPE}
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDK_DEPLOY = "${DEPLOY_DIR}/sdk"
+
+SDKDEPLOYDIR = "${WORKDIR}/${SDKMACHINE}-deploy-${PN}-populate-sdk"
+
+B_task-populate-sdk = "${SDK_DIR}"
+
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
+TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"
+TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
+ ${@multilib_pkg_extend(d, 'target-sdk-provides-dummy')}"
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
+
+SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
+SDK_DEPENDS = "virtual/fakeroot-native xz-native cross-localedef-native ${MLPREFIX}qemuwrapper-cross"
+SDK_DEPENDS_append_libc-glibc = " nativesdk-glibc-locale"
+
+# We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
+# could be set to the MACHINE_ARCH
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+PID = "${@os.getpid()}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+SDK_PACKAGING_FUNC ?= "create_shar"
+SDK_PRE_INSTALL_COMMAND ?= ""
+SDK_POST_INSTALL_COMMAND ?= ""
+SDK_RELOCATE_AFTER_INSTALL ?= "1"
+
+SDKEXTPATH ?= "~/${@d.getVar('DISTRO')}_sdk"
+SDK_TITLE ?= "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} SDK"
+
+SDK_TARGET_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
+SDK_HOST_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"
+SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"
+SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"
+
+python write_target_sdk_manifest () {
+ from oe.sdk import sdk_list_installed_packages
+ from oe.utils import format_pkg_list
+ sdkmanifestdir = os.path.dirname(d.getVar("SDK_TARGET_MANIFEST"))
+ pkgs = sdk_list_installed_packages(d, True)
+ if not os.path.exists(sdkmanifestdir):
+ bb.utils.mkdirhier(sdkmanifestdir)
+ with open(d.getVar('SDK_TARGET_MANIFEST'), 'w') as output:
+ output.write(format_pkg_list(pkgs, 'ver'))
+}
+
+python write_sdk_test_data() {
+ from oe.data import export2json
+ testdata = "%s/%s.testdata.json" % (d.getVar('SDKDEPLOYDIR'), d.getVar('TOOLCHAIN_OUTPUTNAME'))
+ bb.utils.mkdirhier(os.path.dirname(testdata))
+ export2json(d, testdata)
+}
+
+python write_host_sdk_manifest () {
+ from oe.sdk import sdk_list_installed_packages
+ from oe.utils import format_pkg_list
+ sdkmanifestdir = os.path.dirname(d.getVar("SDK_HOST_MANIFEST"))
+ pkgs = sdk_list_installed_packages(d, False)
+ if not os.path.exists(sdkmanifestdir):
+ bb.utils.mkdirhier(sdkmanifestdir)
+ with open(d.getVar('SDK_HOST_MANIFEST'), 'w') as output:
+ output.write(format_pkg_list(pkgs, 'ver'))
+}
+
+POPULATE_SDK_POST_TARGET_COMMAND_append = " write_sdk_test_data ; "
+POPULATE_SDK_POST_TARGET_COMMAND_append_task-populate-sdk = " write_target_sdk_manifest ; "
+POPULATE_SDK_POST_HOST_COMMAND_append_task-populate-sdk = " write_host_sdk_manifest; "
+SDK_PACKAGING_COMMAND = "${@'${SDK_PACKAGING_FUNC};' if '${SDK_PACKAGING_FUNC}' else ''}"
+SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; tar_sdk; ${SDK_PACKAGING_COMMAND} "
+
+def populate_sdk_common(d):
+ from oe.sdk import populate_sdk
+ from oe.manifest import create_manifest, Manifest
+
+ # Handle package exclusions
+ excl_pkgs = (d.getVar("PACKAGE_EXCLUDE") or "").split()
+ inst_pkgs = (d.getVar("PACKAGE_INSTALL") or "").split()
+ inst_attempt_pkgs = (d.getVar("PACKAGE_INSTALL_ATTEMPTONLY") or "").split()
+
+ d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
+ d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
+
+ for pkg in excl_pkgs:
+ if pkg in inst_pkgs:
+ bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+ inst_pkgs.remove(pkg)
+
+ if pkg in inst_attempt_pkgs:
+ bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s). It will be removed from the list." % (pkg, d.getVar('PN'), inst_pkgs))
+ inst_attempt_pkgs.remove(pkg)
+
+ d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+ d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
+
+ pn = d.getVar('PN')
+ runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
+ runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
+
+ ld = bb.data.createCopy(d)
+ ld.setVar("PKGDATA_DIR", "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}/pkgdata")
+ runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld)
+ runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld)
+ d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK"))
+ d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY"))
+
+ # create target/host SDK manifests
+ create_manifest(d, manifest_dir=d.getVar('SDK_DIR'),
+ manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
+ create_manifest(d, manifest_dir=d.getVar('SDK_DIR'),
+ manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
+
+ populate_sdk(d)
+
+fakeroot python do_populate_sdk() {
+ populate_sdk_common(d)
+}
+SSTATETASKS += "do_populate_sdk"
+SSTATE_SKIP_CREATION_task-populate-sdk = '1'
+do_populate_sdk[cleandirs] = "${SDKDEPLOYDIR}"
+do_populate_sdk[sstate-inputdirs] = "${SDKDEPLOYDIR}"
+do_populate_sdk[sstate-outputdirs] = "${SDK_DEPLOY}"
+do_populate_sdk[stamp-extra-info] = "${MACHINE_ARCH}${SDKMACHINE}"
+
+fakeroot create_sdk_files() {
+ cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+ # Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+ # Escape special characters like '+' and '.' in the SDKPATH
+ escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+ sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+}
+
+python check_sdk_sysroots() {
+ # Fails build if there are broken or dangling symlinks in SDK sysroots
+
+ if d.getVar('CHECK_SDK_SYSROOTS') != '1':
+ # disabled, bail out
+ return
+
+ def norm_path(path):
+ return os.path.abspath(path)
+
+ # Get scan root
+ SCAN_ROOT = norm_path("%s/%s/sysroots/" % (d.getVar('SDK_OUTPUT'),
+ d.getVar('SDKPATH')))
+
+ bb.note('Checking SDK sysroots at ' + SCAN_ROOT)
+
+ def check_symlink(linkPath):
+ if not os.path.islink(linkPath):
+ return
+
+ linkDirPath = os.path.dirname(linkPath)
+
+ targetPath = os.readlink(linkPath)
+ if not os.path.isabs(targetPath):
+ targetPath = os.path.join(linkDirPath, targetPath)
+ targetPath = norm_path(targetPath)
+
+ if SCAN_ROOT != os.path.commonprefix( [SCAN_ROOT, targetPath] ):
+ bb.error("Escaping symlink {0!s} --> {1!s}".format(linkPath, targetPath))
+ return
+
+ if not os.path.exists(targetPath):
+ bb.error("Broken symlink {0!s} --> {1!s}".format(linkPath, targetPath))
+ return
+
+ if os.path.isdir(targetPath):
+ dir_walk(targetPath)
+
+ def walk_error_handler(e):
+ bb.error(str(e))
+
+ def dir_walk(rootDir):
+ for dirPath,subDirEntries,fileEntries in os.walk(rootDir, followlinks=False, onerror=walk_error_handler):
+ entries = subDirEntries + fileEntries
+ for e in entries:
+ ePath = os.path.join(dirPath, e)
+ check_symlink(ePath)
+
+ # start
+ dir_walk(SCAN_ROOT)
+}
+
+SDKTAROPTS = "--owner=root --group=root"
+
+fakeroot tar_sdk() {
+ # Package it up
+ mkdir -p ${SDKDEPLOYDIR}
+ cd ${SDK_OUTPUT}/${SDKPATH}
+ tar ${SDKTAROPTS} -cf - . | xz -T 0 > ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
+}
+
+fakeroot create_shar() {
+ # copy in the template shar extractor script
+ cp ${COREBASE}/meta/files/toolchain-shar-extract.sh ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ rm -f ${T}/pre_install_command ${T}/post_install_command
+
+ if [ ${SDK_RELOCATE_AFTER_INSTALL} -eq 1 ] ; then
+ cp ${COREBASE}/meta/files/toolchain-shar-relocate.sh ${T}/post_install_command
+ fi
+ cat << "EOF" >> ${T}/pre_install_command
+${SDK_PRE_INSTALL_COMMAND}
+EOF
+
+ cat << "EOF" >> ${T}/post_install_command
+${SDK_POST_INSTALL_COMMAND}
+EOF
+ sed -i -e '/@SDK_PRE_INSTALL_COMMAND@/r ${T}/pre_install_command' \
+ -e '/@SDK_POST_INSTALL_COMMAND@/r ${T}/post_install_command' \
+ ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # substitute variables
+ sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
+ -e 's#@SDKPATH@#${SDKPATH}#g' \
+ -e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
+ -e 's#@OLDEST_KERNEL@#${SDK_OLDEST_KERNEL}#g' \
+ -e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
+ -e 's#@SDK_TITLE@#${@d.getVar("SDK_TITLE").replace('&', '\&')}#g' \
+ -e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
+ -e '/@SDK_PRE_INSTALL_COMMAND@/d' \
+ -e '/@SDK_POST_INSTALL_COMMAND@/d' \
+ -e 's#@SDK_GCC_VER@#${@oe.utils.host_gcc_version(d)}#g' \
+ ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # add execution permission
+ chmod +x ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # append the SDK tarball
+ cat ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz >> ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+ # delete the old tarball, we don't need it anymore
+ rm ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
+}
+
+populate_sdk_log_check() {
+ for target in $*
+ do
+ lf_path="`dirname ${BB_LOGFILE}`/log.do_$target.${PID}"
+
+ echo "log_check: Using $lf_path as logfile"
+
+ if [ -e "$lf_path" ]; then
+ ${IMAGE_PKGTYPE}_log_check $target $lf_path
+ else
+ echo "Cannot find logfile [$lf_path]"
+ fi
+ echo "Logfile is clean"
+ done
+}
+
+def sdk_command_variables(d):
+ return ['OPKG_PREPROCESS_COMMANDS','OPKG_POSTPROCESS_COMMANDS','POPULATE_SDK_POST_HOST_COMMAND','POPULATE_SDK_PRE_TARGET_COMMAND','POPULATE_SDK_POST_TARGET_COMMAND','SDK_POSTPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS','RPM_POSTPROCESS_COMMANDS']
+
+def sdk_variables(d):
+ variables = ['BUILD_IMAGES_FROM_FEEDS','SDK_OS','SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT',
+ 'SDKTARGETSYSROOT','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS','PACKAGE_ARCHS',
+ 'PACKAGE_CLASSES','TARGET_VENDOR','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI', 'PACKAGE_EXCLUDE_COMPLEMENTARY']
+ variables.extend(sdk_command_variables(d))
+ return " ".join(variables)
+
+do_populate_sdk[vardeps] += "${@sdk_variables(d)}"
+
+do_populate_sdk[file-checksums] += "${COREBASE}/meta/files/toolchain-shar-relocate.sh:True \
+ ${COREBASE}/meta/files/toolchain-shar-extract.sh:True"
+
+do_populate_sdk[dirs] = "${PKGDATA_DIR} ${TOPDIR}"
+do_populate_sdk[depends] += "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS').split()])} ${@d.getVarFlag('do_rootfs', 'depends', False)}"
+do_populate_sdk[rdepends] = "${@' '.join([x + ':do_package_write_${IMAGE_PKGTYPE} ' + x + ':do_packagedata' for x in d.getVar('SDK_RDEPENDS').split()])}"
+do_populate_sdk[recrdeptask] += "do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb"
+addtask populate_sdk
diff --git a/poky/meta/classes/populate_sdk_ext.bbclass b/poky/meta/classes/populate_sdk_ext.bbclass
new file mode 100644
index 000000000..e1bba49ea
--- /dev/null
+++ b/poky/meta/classes/populate_sdk_ext.bbclass
@@ -0,0 +1,727 @@
+# Extensible SDK
+
+inherit populate_sdk_base
+
+# NOTE: normally you cannot use task overrides for this kind of thing - this
+# only works because of get_sdk_ext_rdepends()
+
+TOOLCHAIN_HOST_TASK_task-populate-sdk-ext = " \
+ meta-environment-extsdk-${MACHINE} \
+ "
+
+TOOLCHAIN_TARGET_TASK_task-populate-sdk-ext = ""
+
+SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0"
+
+SDK_EXT = ""
+SDK_EXT_task-populate-sdk-ext = "-ext"
+
+# Options are full or minimal
+SDK_EXT_TYPE ?= "full"
+SDK_INCLUDE_PKGDATA ?= "0"
+SDK_INCLUDE_TOOLCHAIN ?= "${@'1' if d.getVar('SDK_EXT_TYPE') == 'full' else '0'}"
+
+SDK_RECRDEP_TASKS ?= ""
+
+SDK_LOCAL_CONF_WHITELIST ?= ""
+SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION \
+ BB_NUMBER_THREADS \
+ BB_NUMBER_PARSE_THREADS \
+ PARALLEL_MAKE \
+ PRSERV_HOST \
+ SSTATE_MIRRORS \
+ DL_DIR \
+ SSTATE_DIR \
+ TMPDIR \
+ BB_SERVER_TIMEOUT \
+ "
+SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
+SDK_UPDATE_URL ?= ""
+
+SDK_TARGETS ?= "${PN}"
+
+def get_sdk_install_targets(d, images_only=False):
+ sdk_install_targets = ''
+ if images_only or d.getVar('SDK_EXT_TYPE') != 'minimal':
+ sdk_install_targets = d.getVar('SDK_TARGETS')
+
+ depd = d.getVar('BB_TASKDEPDATA', False)
+ tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
+ tasklist.remove('do_build')
+ for v in depd.values():
+ if v[1] in tasklist:
+ if v[0] not in sdk_install_targets:
+ sdk_install_targets += ' {}'.format(v[0])
+
+ if not images_only:
+ if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
+ sdk_install_targets += ' meta-world-pkgdata:do_allpackagedata'
+ if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1':
+ sdk_install_targets += ' meta-extsdk-toolchain:do_populate_sysroot'
+
+ return sdk_install_targets
+
+get_sdk_install_targets[vardepsexclude] = "BB_TASKDEPDATA"
+
+OE_INIT_ENV_SCRIPT ?= "oe-init-build-env"
+
+# The files from COREBASE that you want preserved in the COREBASE copied
+# into the sdk. This allows someone to have their own setup scripts in
+# COREBASE be preserved as well as untracked files.
+COREBASE_FILES ?= " \
+ oe-init-build-env \
+ scripts \
+ LICENSE \
+ .templateconf \
+"
+
+SDK_DIR_task-populate-sdk-ext = "${WORKDIR}/sdk-ext"
+B_task-populate-sdk-ext = "${SDK_DIR}"
+TOOLCHAINEXT_OUTPUTNAME ?= "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
+TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${TOOLCHAINEXT_OUTPUTNAME}"
+
+SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"
+SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"
+
+python write_target_sdk_ext_manifest () {
+ from oe.sdk import get_extra_sdkinfo
+ sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')
+ extra_info = get_extra_sdkinfo(sstate_dir)
+
+ target = d.getVar('TARGET_SYS')
+ target_multimach = d.getVar('MULTIMACH_TARGET_SYS')
+ real_target_multimach = d.getVar('REAL_MULTIMACH_TARGET_SYS')
+
+ pkgs = {}
+ with open(d.getVar('SDK_EXT_TARGET_MANIFEST'), 'w') as f:
+ for fn in extra_info['filesizes']:
+ info = fn.split(':')
+ if info[2] in (target, target_multimach, real_target_multimach) \
+ or info[5] == 'allarch':
+ if not info[1] in pkgs:
+ f.write("%s %s %s\n" % (info[1], info[2], info[3]))
+ pkgs[info[1]] = {}
+}
+python write_host_sdk_ext_manifest () {
+ from oe.sdk import get_extra_sdkinfo
+ sstate_dir = d.expand('${SDK_OUTPUT}/${SDKPATH}/sstate-cache')
+ extra_info = get_extra_sdkinfo(sstate_dir)
+ host = d.getVar('BUILD_SYS')
+ with open(d.getVar('SDK_EXT_HOST_MANIFEST'), 'w') as f:
+ for fn in extra_info['filesizes']:
+ info = fn.split(':')
+ if info[2] == host:
+ f.write("%s %s %s\n" % (info[1], info[2], info[3]))
+}
+
+SDK_POSTPROCESS_COMMAND_append_task-populate-sdk-ext = "write_target_sdk_ext_manifest; write_host_sdk_ext_manifest; "
+
+SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME') or d.getVar('DISTRO')} Extensible SDK"
+
+def clean_esdk_builddir(d, sdkbasepath):
+ """Clean up traces of the fake build for create_filtered_tasklist()"""
+ import shutil
+ cleanpaths = 'cache conf/sanity_info tmp'.split()
+ for pth in cleanpaths:
+ fullpth = os.path.join(sdkbasepath, pth)
+ if os.path.isdir(fullpth):
+ shutil.rmtree(fullpth)
+ elif os.path.isfile(fullpth):
+ os.remove(fullpth)
+
+def create_filtered_tasklist(d, sdkbasepath, tasklistfile, conf_initpath):
+ """
+ Create a filtered list of tasks. Also double-checks that the build system
+ within the SDK basically works and required sstate artifacts are available.
+ """
+ import tempfile
+ import shutil
+ import oe.copy_buildsystem
+
+ # Create a temporary build directory that we can pass to the env setup script
+ shutil.copyfile(sdkbasepath + '/conf/local.conf', sdkbasepath + '/conf/local.conf.bak')
+ try:
+ with open(sdkbasepath + '/conf/local.conf', 'a') as f:
+ # Force the use of sstate from the build system
+ f.write('\nSSTATE_DIR_forcevariable = "%s"\n' % d.getVar('SSTATE_DIR'))
+ f.write('SSTATE_MIRRORS_forcevariable = "file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n')
+ # Ensure TMPDIR is the default so that clean_esdk_builddir() can delete it
+ f.write('TMPDIR_forcevariable = "${TOPDIR}/tmp"\n')
+ f.write('TCLIBCAPPEND_forcevariable = ""\n')
+ # Drop uninative if the build isn't using it (or else NATIVELSBSTRING will
+ # be different and we won't be able to find our native sstate)
+ if not bb.data.inherits_class('uninative', d):
+ f.write('INHERIT_remove = "uninative"\n')
+
+ # Unfortunately the default SDKPATH (or even a custom value) may contain characters that bitbake
+ # will not allow in its COREBASE path, so we need to rename the directory temporarily
+ temp_sdkbasepath = d.getVar('SDK_OUTPUT') + '/tmp-renamed-sdk'
+ # Delete any existing temp dir
+ try:
+ shutil.rmtree(temp_sdkbasepath)
+ except FileNotFoundError:
+ pass
+ os.rename(sdkbasepath, temp_sdkbasepath)
+ cmdprefix = '. %s .; ' % conf_initpath
+ logfile = d.getVar('WORKDIR') + '/tasklist_bb_log.txt'
+ try:
+ oe.copy_buildsystem.check_sstate_task_list(d, get_sdk_install_targets(d), tasklistfile, cmdprefix=cmdprefix, cwd=temp_sdkbasepath, logfile=logfile)
+ except bb.process.ExecutionError as e:
+ msg = 'Failed to generate filtered task list for extensible SDK:\n%s' % e.stdout.rstrip()
+ if 'attempted to execute unexpectedly and should have been setscened' in e.stdout:
+ msg += '\n----------\n\nNOTE: "attempted to execute unexpectedly and should have been setscened" errors indicate this may be caused by missing sstate artifacts that were likely produced in earlier builds, but have been subsequently deleted for some reason.\n'
+ bb.fatal(msg)
+ os.rename(temp_sdkbasepath, sdkbasepath)
+ # Clean out residue of running bitbake, which check_sstate_task_list()
+ # will effectively do
+ clean_esdk_builddir(d, sdkbasepath)
+ finally:
+ os.replace(sdkbasepath + '/conf/local.conf.bak', sdkbasepath + '/conf/local.conf')
+
+python copy_buildsystem () {
+ import re
+ import shutil
+ import glob
+ import oe.copy_buildsystem
+
+ oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT')
+
+ conf_bbpath = ''
+ conf_initpath = ''
+ core_meta_subdir = ''
+
+ # Copy in all metadata layers + bitbake (as repositories)
+ buildsystem = oe.copy_buildsystem.BuildSystem('extensible SDK', d)
+ baseoutpath = d.getVar('SDK_OUTPUT') + '/' + d.getVar('SDKPATH')
+
+ # Determine if we're building a derivative extensible SDK (from devtool build-sdk)
+ derivative = (d.getVar('SDK_DERIVATIVE') or '') == '1'
+ if derivative:
+ workspace_name = 'orig-workspace'
+ else:
+ workspace_name = None
+ layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers', workspace_name)
+
+ sdkbblayers = []
+ corebase = os.path.basename(d.getVar('COREBASE'))
+ for layer in layers_copied:
+ if corebase == os.path.basename(layer):
+ conf_bbpath = os.path.join('layers', layer, 'bitbake')
+ else:
+ sdkbblayers.append(layer)
+
+ for path in os.listdir(baseoutpath + '/layers'):
+ relpath = os.path.join('layers', path, oe_init_env_script)
+ if os.path.exists(os.path.join(baseoutpath, relpath)):
+ conf_initpath = relpath
+
+ relpath = os.path.join('layers', path, 'scripts', 'devtool')
+ if os.path.exists(os.path.join(baseoutpath, relpath)):
+ scriptrelpath = os.path.dirname(relpath)
+
+ relpath = os.path.join('layers', path, 'meta')
+ if os.path.exists(os.path.join(baseoutpath, relpath, 'lib', 'oe')):
+ core_meta_subdir = relpath
+
+ d.setVar('oe_init_build_env_path', conf_initpath)
+ d.setVar('scriptrelpath', scriptrelpath)
+
+ # Write out config file for devtool
+ import configparser
+ config = configparser.SafeConfigParser()
+ config.add_section('General')
+ config.set('General', 'bitbake_subdir', conf_bbpath)
+ config.set('General', 'init_path', conf_initpath)
+ config.set('General', 'core_meta_subdir', core_meta_subdir)
+ config.add_section('SDK')
+ config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS'))
+ updateurl = d.getVar('SDK_UPDATE_URL')
+ if updateurl:
+ config.set('SDK', 'updateserver', updateurl)
+ bb.utils.mkdirhier(os.path.join(baseoutpath, 'conf'))
+ with open(os.path.join(baseoutpath, 'conf', 'devtool.conf'), 'w') as f:
+ config.write(f)
+
+ unlockedsigs = os.path.join(baseoutpath, 'conf', 'unlocked-sigs.inc')
+ with open(unlockedsigs, 'w') as f:
+ pass
+
+ # Create a layer for new recipes / appends
+ bbpath = d.getVar('BBPATH')
+ bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')])
+
+ # Create bblayers.conf
+ bb.utils.mkdirhier(baseoutpath + '/conf')
+ with open(baseoutpath + '/conf/bblayers.conf', 'w') as f:
+ f.write('# WARNING: this configuration has been automatically generated and in\n')
+ f.write('# most cases should not be edited. If you need more flexibility than\n')
+ f.write('# this configuration provides, it is strongly suggested that you set\n')
+ f.write('# up a proper instance of the full build system and use that instead.\n\n')
+
+ # LCONF_VERSION may not be set, for example when using meta-poky
+ # so don't error if it isn't found
+ lconf_version = d.getVar('LCONF_VERSION', False)
+ if lconf_version is not None:
+ f.write('LCONF_VERSION = "%s"\n\n' % lconf_version)
+
+ f.write('BBPATH = "$' + '{TOPDIR}"\n')
+ f.write('SDKBASEMETAPATH = "$' + '{TOPDIR}"\n')
+ f.write('BBLAYERS := " \\\n')
+ for layerrelpath in sdkbblayers:
+ f.write(' $' + '{SDKBASEMETAPATH}/layers/%s \\\n' % layerrelpath)
+ f.write(' $' + '{SDKBASEMETAPATH}/workspace \\\n')
+ f.write(' "\n')
+
+ # Copy uninative tarball
+ # For now this is where uninative.bbclass expects the tarball
+ if bb.data.inherits_class('uninative', d):
+ uninative_file = d.expand('${UNINATIVE_DLDIR}/' + d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH")) + '/${UNINATIVE_TARBALL}')
+ uninative_checksum = bb.utils.sha256_file(uninative_file)
+ uninative_outdir = '%s/downloads/uninative/%s' % (baseoutpath, uninative_checksum)
+ bb.utils.mkdirhier(uninative_outdir)
+ shutil.copy(uninative_file, uninative_outdir)
+
+ env_whitelist = (d.getVar('BB_ENV_EXTRAWHITE') or '').split()
+ env_whitelist_values = {}
+
+ # Create local.conf
+ builddir = d.getVar('TOPDIR')
+ if derivative and os.path.exists(builddir + '/conf/auto.conf'):
+ shutil.copyfile(builddir + '/conf/auto.conf', baseoutpath + '/conf/auto.conf')
+ if derivative:
+ shutil.copyfile(builddir + '/conf/local.conf', baseoutpath + '/conf/local.conf')
+ else:
+ local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST') or '').split()
+ local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST') or '').split()
+ def handle_var(varname, origvalue, op, newlines):
+ if varname in local_conf_blacklist or (origvalue.strip().startswith('/') and not varname in local_conf_whitelist):
+ newlines.append('# Removed original setting of %s\n' % varname)
+ return None, op, 0, True
+ else:
+ if varname in env_whitelist:
+ env_whitelist_values[varname] = origvalue
+ return origvalue, op, 0, True
+ varlist = ['[^#=+ ]*']
+ oldlines = []
+ if os.path.exists(builddir + '/conf/auto.conf'):
+ with open(builddir + '/conf/auto.conf', 'r') as f:
+ oldlines += f.readlines()
+ with open(builddir + '/conf/local.conf', 'r') as f:
+ oldlines += f.readlines()
+ (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
+
+ with open(baseoutpath + '/conf/local.conf', 'w') as f:
+ f.write('# WARNING: this configuration has been automatically generated and in\n')
+ f.write('# most cases should not be edited. If you need more flexibility than\n')
+ f.write('# this configuration provides, it is strongly suggested that you set\n')
+ f.write('# up a proper instance of the full build system and use that instead.\n\n')
+ for line in newlines:
+ if line.strip() and not line.startswith('#'):
+ f.write(line)
+ # Write a newline just in case there's none at the end of the original
+ f.write('\n')
+
+ f.write('TMPDIR = "${TOPDIR}/tmp"\n')
+ f.write('TCLIBCAPPEND = ""\n')
+ f.write('DL_DIR = "${TOPDIR}/downloads"\n')
+
+ f.write('INHERIT += "%s"\n' % 'uninative')
+ f.write('UNINATIVE_CHECKSUM[%s] = "%s"\n\n' % (d.getVar('BUILD_ARCH'), uninative_checksum))
+ f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False))
+
+ # Some classes are not suitable for SDK, remove them from INHERIT
+ f.write('INHERIT_remove = "%s"\n' % d.getVar('SDK_INHERIT_BLACKLIST', False))
+
+ # Bypass the default connectivity check if any
+ f.write('CONNECTIVITY_CHECK_URIS = ""\n\n')
+
+ # This warning will come out if reverse dependencies for a task
+ # don't have sstate as well as the task itself. We already know
+ # this will be the case for the extensible sdk, so turn off the
+ # warning.
+ f.write('SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK = "none"\n\n')
+
+ # Warn if the sigs in the locked-signature file don't match
+ # the sig computed from the metadata.
+ f.write('SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n\n')
+
+ # We want to be able to set this without a full reparse
+ f.write('BB_HASHCONFIG_WHITELIST_append = " SIGGEN_UNLOCKED_RECIPES"\n\n')
+
+ # Set up whitelist for run on install
+ f.write('BB_SETSCENE_ENFORCE_WHITELIST = "%:* *:do_shared_workdir *:do_rm_work wic-tools:* *:do_addto_recipe_sysroot"\n\n')
+
+ # Hide the config information from bitbake output (since it's fixed within the SDK)
+ f.write('BUILDCFG_HEADER = ""\n\n')
+
+ f.write('# Provide a flag to indicate we are in the EXT_SDK Context\n')
+ f.write('WITHIN_EXT_SDK = "1"\n\n')
+
+ # Map gcc-dependent uninative sstate cache for installer usage
+ f.write('SSTATE_MIRRORS += " file://universal/(.*) file://universal-4.9/\\1 file://universal-4.9/(.*) file://universal-4.8/\\1"\n\n')
+
+ # Allow additional config through sdk-extra.conf
+ fn = bb.cookerdata.findConfigFile('sdk-extra.conf', d)
+ if fn:
+ with open(fn, 'r') as xf:
+ for line in xf:
+ f.write(line)
+
+ # If you define a sdk_extraconf() function then it can contain additional config
+ # (Though this is awkward; sdk-extra.conf should probably be used instead)
+ extraconf = (d.getVar('sdk_extraconf') or '').strip()
+ if extraconf:
+ # Strip off any leading / trailing spaces
+ for line in extraconf.splitlines():
+ f.write(line.strip() + '\n')
+
+ f.write('require conf/locked-sigs.inc\n')
+ f.write('require conf/unlocked-sigs.inc\n')
+
+ # Write a templateconf.cfg
+ with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
+ f.write('meta/conf\n')
+
+ # Ensure any variables set from the external environment (by way of
+ # BB_ENV_EXTRAWHITE) are set in the SDK's configuration
+ extralines = []
+ for name, value in env_whitelist_values.items():
+ actualvalue = d.getVar(name) or ''
+ if value != actualvalue:
+ extralines.append('%s = "%s"\n' % (name, actualvalue))
+ if extralines:
+ with open(baseoutpath + '/conf/local.conf', 'a') as f:
+ f.write('\n')
+ f.write('# Extra settings from environment:\n')
+ for line in extralines:
+ f.write(line)
+ f.write('\n')
+
+ # Filter the locked signatures file to just the sstate tasks we are interested in
+ excluded_targets = get_sdk_install_targets(d, images_only=True)
+ sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
+ lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
+ oe.copy_buildsystem.prune_lockedsigs([],
+ excluded_targets.split(),
+ sigfile,
+ lockedsigs_pruned)
+
+ sstate_out = baseoutpath + '/sstate-cache'
+ bb.utils.remove(sstate_out, True)
+
+ # uninative.bbclass sets NATIVELSBSTRING to 'universal%s' % oe.utils.host_gcc_version(d)
+ fixedlsbstring = "universal%s" % oe.utils.host_gcc_version(d)
+
+ sdk_include_toolchain = (d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1')
+ sdk_ext_type = d.getVar('SDK_EXT_TYPE')
+ if sdk_ext_type != 'minimal' or sdk_include_toolchain or derivative:
+ # Create the filtered task list used to generate the sstate cache shipped with the SDK
+ tasklistfn = d.getVar('WORKDIR') + '/tasklist.txt'
+ create_filtered_tasklist(d, baseoutpath, tasklistfn, conf_initpath)
+ else:
+ tasklistfn = None
+
+ # Add packagedata if enabled
+ if d.getVar('SDK_INCLUDE_PKGDATA') == '1':
+ lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base.inc'
+ lockedsigs_copy = d.getVar('WORKDIR') + '/locked-sigs-copy.inc'
+ shutil.move(lockedsigs_pruned, lockedsigs_base)
+ oe.copy_buildsystem.merge_lockedsigs(['do_packagedata'],
+ lockedsigs_base,
+ d.getVar('STAGING_DIR_HOST') + '/world-pkgdata/locked-sigs-pkgdata.inc',
+ lockedsigs_pruned,
+ lockedsigs_copy)
+
+ if sdk_include_toolchain:
+ lockedsigs_base = d.getVar('WORKDIR') + '/locked-sigs-base2.inc'
+ lockedsigs_toolchain = d.expand("${STAGING_DIR}/${TUNE_PKGARCH}/meta-extsdk-toolchain/locked-sigs/locked-sigs-extsdk-toolchain.inc")
+ shutil.move(lockedsigs_pruned, lockedsigs_base)
+ oe.copy_buildsystem.merge_lockedsigs([],
+ lockedsigs_base,
+ lockedsigs_toolchain,
+ lockedsigs_pruned)
+ oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_toolchain,
+ d.getVar('SSTATE_DIR'),
+ sstate_out, d,
+ fixedlsbstring,
+ filterfile=tasklistfn)
+
+ if sdk_ext_type == 'minimal':
+ if derivative:
+ # Assume the user is not going to set up an additional sstate
+ # mirror, thus we need to copy the additional artifacts (from
+ # workspace recipes) into the derivative SDK
+ lockedsigs_orig = d.getVar('TOPDIR') + '/conf/locked-sigs.inc'
+ if os.path.exists(lockedsigs_orig):
+ lockedsigs_extra = d.getVar('WORKDIR') + '/locked-sigs-extra.inc'
+ oe.copy_buildsystem.merge_lockedsigs(None,
+ lockedsigs_orig,
+ lockedsigs_pruned,
+ None,
+ lockedsigs_extra)
+ oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_extra,
+ d.getVar('SSTATE_DIR'),
+ sstate_out, d,
+ fixedlsbstring,
+ filterfile=tasklistfn)
+ else:
+ oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
+ d.getVar('SSTATE_DIR'),
+ sstate_out, d,
+ fixedlsbstring,
+ filterfile=tasklistfn)
+
+ # We don't need sstate do_package files
+ for root, dirs, files in os.walk(sstate_out):
+ for name in files:
+ if name.endswith("_package.tgz"):
+ f = os.path.join(root, name)
+ os.remove(f)
+
+ # Write manifest file
+ # Note: at the moment we cannot include the env setup script here to keep
+ # it updated, since it gets modified during SDK installation (see
+ # sdk_ext_postinst() below) thus the checksum we take here would always
+ # be different.
+ manifest_file_list = ['conf/*']
+ manifest_file = os.path.join(baseoutpath, 'conf', 'sdk-conf-manifest')
+ with open(manifest_file, 'w') as f:
+ for item in manifest_file_list:
+ for fn in glob.glob(os.path.join(baseoutpath, item)):
+ if fn == manifest_file:
+ continue
+ chksum = bb.utils.sha256_file(fn)
+ f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath)))
+}
+
+def get_current_buildtools(d):
+ """Get the file name of the current buildtools installer"""
+ import glob
+ btfiles = glob.glob(os.path.join(d.getVar('SDK_DEPLOY'), '*-buildtools-nativesdk-standalone-*.sh'))
+ btfiles.sort(key=os.path.getctime)
+ return os.path.basename(btfiles[-1])
+
+def get_sdk_required_utilities(buildtools_fn, d):
+ """Find required utilities that aren't provided by the buildtools"""
+ sanity_required_utilities = (d.getVar('SANITY_REQUIRED_UTILITIES') or '').split()
+ sanity_required_utilities.append(d.expand('${BUILD_PREFIX}gcc'))
+ sanity_required_utilities.append(d.expand('${BUILD_PREFIX}g++'))
+ buildtools_installer = os.path.join(d.getVar('SDK_DEPLOY'), buildtools_fn)
+ filelist, _ = bb.process.run('%s -l' % buildtools_installer)
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('SDKPATH', '.')
+ sdkpathnative = localdata.getVar('SDKPATHNATIVE')
+ sdkbindirs = [localdata.getVar('bindir_nativesdk'),
+ localdata.getVar('sbindir_nativesdk'),
+ localdata.getVar('base_bindir_nativesdk'),
+ localdata.getVar('base_sbindir_nativesdk')]
+ for line in filelist.splitlines():
+ splitline = line.split()
+ if len(splitline) > 5:
+ fn = splitline[5]
+ if not fn.startswith('./'):
+ fn = './%s' % fn
+ if fn.startswith(sdkpathnative):
+ relpth = '/' + os.path.relpath(fn, sdkpathnative)
+ for bindir in sdkbindirs:
+ if relpth.startswith(bindir):
+ relpth = os.path.relpath(relpth, bindir)
+ if relpth in sanity_required_utilities:
+ sanity_required_utilities.remove(relpth)
+ break
+ return ' '.join(sanity_required_utilities)
+
+install_tools() {
+ install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
+ scripts="devtool recipetool oe-find-native-sysroot runqemu* wic"
+ for script in $scripts; do
+ for scriptfn in `find ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath} -maxdepth 1 -executable -name "$script"`; do
+ lnr ${scriptfn} ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/`basename $scriptfn`
+ done
+ done
+ # We can't use the same method as above because files in the sysroot won't exist at this point
+ # (they get populated from sstate on installation)
+ unfsd_path="${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/unfsd"
+ if [ "${SDK_INCLUDE_TOOLCHAIN}" = "1" -a ! -e $unfsd_path ] ; then
+ binrelpath=${@os.path.relpath(d.getVar('STAGING_BINDIR_NATIVE'), d.getVar('TMPDIR'))}
+ lnr ${SDK_OUTPUT}/${SDKPATH}/tmp/$binrelpath/unfsd $unfsd_path
+ fi
+ touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
+
+ # find latest buildtools-tarball and install it
+ install ${SDK_DEPLOY}/${SDK_BUILDTOOLS_INSTALLER} ${SDK_OUTPUT}/${SDKPATH}
+
+ install -m 0644 ${COREBASE}/meta/files/ext-sdk-prepare.py ${SDK_OUTPUT}/${SDKPATH}
+}
+do_populate_sdk_ext[file-checksums] += "${COREBASE}/meta/files/ext-sdk-prepare.py:True"
+
+sdk_ext_preinst() {
+ # Since bitbake won't run as root it doesn't make sense to try and install
+ # the extensible sdk as root.
+ if [ "`id -u`" = "0" ]; then
+ echo "ERROR: The extensible sdk cannot be installed as root."
+ exit 1
+ fi
+ if ! command -v locale > /dev/null; then
+ echo "ERROR: The installer requires the locale command, please install it first"
+ exit 1
+ fi
+ # Check setting of LC_ALL set above
+ canonicalised_locale=`echo $LC_ALL | sed 's/UTF-8/utf8/'`
+ if ! locale -a | grep -q $canonicalised_locale ; then
+ echo "ERROR: the installer requires the $LC_ALL locale to be installed (but not selected), please install it first"
+ exit 1
+ fi
+ # The relocation script used by buildtools installer requires python
+ if ! command -v python > /dev/null; then
+ echo "ERROR: The installer requires python, please install it first"
+ exit 1
+ fi
+ missing_utils=""
+ for util in ${SDK_REQUIRED_UTILITIES}; do
+ if ! command -v $util > /dev/null; then
+ missing_utils="$missing_utils $util"
+ fi
+ done
+ if [ -n "$missing_utils" ] ; then
+ echo "ERROR: the SDK requires the following missing utilities, please install them: $missing_utils"
+ exit 1
+ fi
+ SDK_EXTENSIBLE="1"
+ if [ "$publish" = "1" ] ; then
+ EXTRA_TAR_OPTIONS="$EXTRA_TAR_OPTIONS --exclude=ext-sdk-prepare.py"
+ if [ "${SDK_EXT_TYPE}" = "minimal" ] ; then
+ EXTRA_TAR_OPTIONS="$EXTRA_TAR_OPTIONS --exclude=sstate-cache"
+ fi
+ fi
+}
+SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}"
+
+# FIXME this preparation should be done as part of the SDK construction
+sdk_ext_postinst() {
+ printf "\nExtracting buildtools...\n"
+ cd $target_sdk_dir
+ env_setup_script="$target_sdk_dir/environment-setup-${REAL_MULTIMACH_TARGET_SYS}"
+ printf "buildtools\ny" | ./${SDK_BUILDTOOLS_INSTALLER} > buildtools.log || { printf 'ERROR: buildtools installation failed:\n' ; cat buildtools.log ; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+
+ # Delete the buildtools tar file since it won't be used again
+ rm -f ./${SDK_BUILDTOOLS_INSTALLER}
+ # We don't need the log either since it succeeded
+ rm -f buildtools.log
+
+ # Make sure when the user sets up the environment, they also get
+ # the buildtools-tarball tools in their path.
+ echo ". $target_sdk_dir/buildtools/environment-setup*" >> $env_setup_script
+
+ # Allow bitbake environment setup to be ran as part of this sdk.
+ echo "export OE_SKIP_SDK_CHECK=1" >> $env_setup_script
+ # Work around runqemu not knowing how to get this information within the eSDK
+ echo "export DEPLOY_DIR_IMAGE=$target_sdk_dir/tmp/${@os.path.relpath(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('TMPDIR'))}" >> $env_setup_script
+
+ # A bit of another hack, but we need this in the path only for devtool
+ # so put it at the end of $PATH.
+ echo "export PATH=$target_sdk_dir/sysroots/${SDK_SYS}${bindir_nativesdk}:\$PATH" >> $env_setup_script
+
+ echo "printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script
+
+ # Warn if trying to use external bitbake and the ext SDK together
+ echo "(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.') || true" >> $env_setup_script
+
+ if [ "$prepare_buildsystem" != "no" ]; then
+ printf "Preparing build system...\n"
+ # dash which is /bin/sh on Ubuntu will not preserve the
+ # current working directory when first ran, nor will it set $1 when
+ # sourcing a script. That is why this has to look so ugly.
+ LOGFILE="$target_sdk_dir/preparing_build_system.log"
+ sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && python $target_sdk_dir/ext-sdk-prepare.py $LOGFILE '${SDK_INSTALL_TARGETS}'" || { echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
+ rm $target_sdk_dir/ext-sdk-prepare.py
+ fi
+ echo done
+}
+
+SDK_POST_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_postinst}"
+
+SDK_POSTPROCESS_COMMAND_prepend_task-populate-sdk-ext = "copy_buildsystem; install_tools; "
+
+SDK_INSTALL_TARGETS = ""
+fakeroot python do_populate_sdk_ext() {
+ # FIXME hopefully we can remove this restriction at some point, but uninative
+ # currently forces this upon us
+ if d.getVar('SDK_ARCH') != d.getVar('BUILD_ARCH'):
+ bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH'), d.getVar('BUILD_ARCH')))
+
+ d.setVar('SDK_INSTALL_TARGETS', get_sdk_install_targets(d))
+ buildtools_fn = get_current_buildtools(d)
+ d.setVar('SDK_REQUIRED_UTILITIES', get_sdk_required_utilities(buildtools_fn, d))
+ d.setVar('SDK_BUILDTOOLS_INSTALLER', buildtools_fn)
+ d.setVar('SDKDEPLOYDIR', '${SDKEXTDEPLOYDIR}')
+ # ESDKs have a libc from the buildtools so ensure we don't ship linguas twice
+ d.delVar('SDKIMAGE_LINGUAS')
+ populate_sdk_common(d)
+}
+
+def get_ext_sdk_depends(d):
+ # Note: the deps varflag is a list not a string, so we need to specify expand=False
+ deps = d.getVarFlag('do_image_complete', 'deps', False)
+ pn = d.getVar('PN')
+ deplist = ['%s:%s' % (pn, dep) for dep in deps]
+ tasklist = bb.build.tasksbetween('do_image_complete', 'do_build', d)
+ tasklist.append('do_rootfs')
+ for task in tasklist:
+ deplist.extend((d.getVarFlag(task, 'depends') or '').split())
+ return ' '.join(deplist)
+
+python do_sdk_depends() {
+ # We have to do this separately in its own task so we avoid recursing into
+ # dependencies we don't need to (e.g. buildtools-tarball) and bringing those
+ # into the SDK's sstate-cache
+ import oe.copy_buildsystem
+ sigfile = d.getVar('WORKDIR') + '/locked-sigs.inc'
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
+addtask sdk_depends
+
+do_sdk_depends[dirs] = "${WORKDIR}"
+do_sdk_depends[depends] = "${@get_ext_sdk_depends(d)} meta-extsdk-toolchain:do_populate_sysroot"
+do_sdk_depends[recrdeptask] = "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
+do_sdk_depends[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy ${SDK_RECRDEP_TASKS}"
+do_sdk_depends[rdepends] = "${@get_sdk_ext_rdepends(d)}"
+
+def get_sdk_ext_rdepends(d):
+ localdata = d.createCopy()
+ localdata.appendVar('OVERRIDES', ':task-populate-sdk-ext')
+ return localdata.getVarFlag('do_populate_sdk', 'rdepends')
+
+do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
+
+do_populate_sdk_ext[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends', False)} \
+ buildtools-tarball:do_populate_sdk \
+ ${@'meta-world-pkgdata:do_collect_packagedata' if d.getVar('SDK_INCLUDE_PKGDATA') == '1' else ''} \
+ ${@'meta-extsdk-toolchain:do_locked_sigs' if d.getVar('SDK_INCLUDE_TOOLCHAIN') == '1' else ''}"
+
+# We must avoid depending on do_build here if rm_work.bbclass is active,
+# because otherwise do_rm_work may run before do_populate_sdk_ext itself.
+# We can't mark do_populate_sdk_ext and do_sdk_depends as having to
+# run before do_rm_work, because then they would also run as part
+# of normal builds.
+do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':' + (d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build') for x in d.getVar('SDK_TARGETS').split()])}"
+
+# Make sure code changes can result in rebuild
+do_populate_sdk_ext[vardeps] += "copy_buildsystem \
+ sdk_ext_postinst"
+
+# Since any change in the metadata of any layer should cause a rebuild of the
+# sdk(since the layers are put in the sdk) set the task to nostamp so it
+# always runs.
+do_populate_sdk_ext[nostamp] = "1"
+
+SDKEXTDEPLOYDIR = "${WORKDIR}/deploy-${PN}-populate-sdk-ext"
+
+SSTATETASKS += "do_populate_sdk_ext"
+SSTATE_SKIP_CREATION_task-populate-sdk-ext = '1'
+do_populate_sdk_ext[cleandirs] = "${SDKEXTDEPLOYDIR}"
+do_populate_sdk_ext[sstate-inputdirs] = "${SDKEXTDEPLOYDIR}"
+do_populate_sdk_ext[sstate-outputdirs] = "${SDK_DEPLOY}"
+do_populate_sdk_ext[stamp-extra-info] = "${MACHINE_ARCH}"
+
+addtask populate_sdk_ext after do_sdk_depends
diff --git a/poky/meta/classes/prexport.bbclass b/poky/meta/classes/prexport.bbclass
new file mode 100644
index 000000000..6dcf99e29
--- /dev/null
+++ b/poky/meta/classes/prexport.bbclass
@@ -0,0 +1,59 @@
+PRSERV_DUMPOPT_VERSION = "${PRAUTOINX}"
+PRSERV_DUMPOPT_PKGARCH = ""
+PRSERV_DUMPOPT_CHECKSUM = ""
+PRSERV_DUMPOPT_COL = "0"
+
+PRSERV_DUMPDIR ??= "${LOG_DIR}/db"
+PRSERV_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv.inc"
+
+python prexport_handler () {
+ import bb.event
+ if not e.data or bb.data.inherits_class('native', e.data) or \
+ bb.data.inherits_class('crosssdk', e.data):
+ return
+
+ if isinstance(e, bb.event.RecipeParsed):
+ import oe.prservice
+ #get all PR values for the current PRAUTOINX
+ ver = e.data.getVar('PRSERV_DUMPOPT_VERSION')
+ ver = ver.replace('%','-')
+ retval = oe.prservice.prserv_dump_db(e.data)
+ if not retval:
+ bb.fatal("prexport_handler: export failed!")
+ (metainfo, datainfo) = retval
+ if not datainfo:
+ bb.note("prexport_handler: No AUTOPR values found for %s" % ver)
+ return
+ oe.prservice.prserv_export_tofile(e.data, None, datainfo, False)
+ if 'AUTOINC' in ver:
+ import re
+ srcpv = bb.fetch2.get_srcrev(e.data)
+ base_ver = "AUTOINC-%s" % ver[:ver.find(srcpv)]
+ e.data.setVar('PRSERV_DUMPOPT_VERSION', base_ver)
+ retval = oe.prservice.prserv_dump_db(e.data)
+ if not retval:
+ bb.fatal("prexport_handler: export failed!")
+ (metainfo, datainfo) = retval
+ oe.prservice.prserv_export_tofile(e.data, None, datainfo, False)
+ elif isinstance(e, bb.event.ParseStarted):
+ import bb.utils
+ import oe.prservice
+ oe.prservice.prserv_check_avail(e.data)
+ #remove dumpfile
+ bb.utils.remove(e.data.getVar('PRSERV_DUMPFILE'))
+ elif isinstance(e, bb.event.ParseCompleted):
+ import oe.prservice
+ #dump meta info of tables
+ d = e.data.createCopy()
+ d.setVar('PRSERV_DUMPOPT_COL', "1")
+ retval = oe.prservice.prserv_dump_db(d)
+ if not retval:
+ bb.error("prexport_handler: export failed!")
+ return
+ (metainfo, datainfo) = retval
+ oe.prservice.prserv_export_tofile(d, metainfo, None, True)
+
+}
+
+addhandler prexport_handler
+prexport_handler[eventmask] = "bb.event.RecipeParsed bb.event.ParseStarted bb.event.ParseCompleted"
diff --git a/poky/meta/classes/primport.bbclass b/poky/meta/classes/primport.bbclass
new file mode 100644
index 000000000..8ed45f03f
--- /dev/null
+++ b/poky/meta/classes/primport.bbclass
@@ -0,0 +1,21 @@
+python primport_handler () {
+ import bb.event
+ if not e.data:
+ return
+
+ if isinstance(e, bb.event.ParseCompleted):
+ import oe.prservice
+ #import all exported AUTOPR values
+ imported = oe.prservice.prserv_import_db(e.data)
+ if imported is None:
+ bb.fatal("import failed!")
+
+ for (version, pkgarch, checksum, value) in imported:
+ bb.note("imported (%s,%s,%s,%d)" % (version, pkgarch, checksum, value))
+ elif isinstance(e, bb.event.ParseStarted):
+ import oe.prservice
+ oe.prservice.prserv_check_avail(e.data)
+}
+
+addhandler primport_handler
+primport_handler[eventmask] = "bb.event.ParseCompleted bb.event.ParseStarted"
diff --git a/poky/meta/classes/ptest-gnome.bbclass b/poky/meta/classes/ptest-gnome.bbclass
new file mode 100644
index 000000000..478a33474
--- /dev/null
+++ b/poky/meta/classes/ptest-gnome.bbclass
@@ -0,0 +1,8 @@
+inherit ptest
+
+EXTRA_OECONF_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-installed-tests', '--disable-installed-tests', d)}"
+
+FILES_${PN}-ptest += "${libexecdir}/installed-tests/ \
+ ${datadir}/installed-tests/"
+
+RDEPENDS_${PN}-ptest += "gnome-desktop-testing"
diff --git a/poky/meta/classes/ptest-perl.bbclass b/poky/meta/classes/ptest-perl.bbclass
new file mode 100644
index 000000000..a4bc40b51
--- /dev/null
+++ b/poky/meta/classes/ptest-perl.bbclass
@@ -0,0 +1,30 @@
+inherit ptest
+
+FILESEXTRAPATHS_prepend := "${COREBASE}/meta/files:"
+
+SRC_URI += "file://ptest-perl/run-ptest"
+
+do_install_ptest_perl() {
+ install -d ${D}${PTEST_PATH}
+ if [ ! -f ${D}${PTEST_PATH}/run-ptest ]; then
+ install -m 0755 ${WORKDIR}/ptest-perl/run-ptest ${D}${PTEST_PATH}
+ fi
+ cp -r ${B}/t ${D}${PTEST_PATH}
+ chown -R root:root ${D}${PTEST_PATH}
+}
+
+FILES_${PN}-ptest_prepend = "${PTEST_PATH}/t/* ${PTEST_PATH}/run-ptest "
+
+RDEPENDS_${PN}-ptest_prepend = "perl "
+
+addtask install_ptest_perl after do_install_ptest_base before do_package
+
+python () {
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ d.setVarFlag('do_install_ptest_perl', 'fakeroot', '1')
+
+ # Remove all '*ptest_perl' tasks when ptest is not enabled
+ if not(d.getVar('PTEST_ENABLED') == "1"):
+ for i in ['do_install_ptest_perl']:
+ bb.build.deltask(i, d)
+}
diff --git a/poky/meta/classes/ptest.bbclass b/poky/meta/classes/ptest.bbclass
new file mode 100644
index 000000000..c19f65b9b
--- /dev/null
+++ b/poky/meta/classes/ptest.bbclass
@@ -0,0 +1,67 @@
+SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files"
+DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION} \
+This package contains a test directory ${PTEST_PATH} for package test purposes."
+
+PTEST_PATH ?= "${libdir}/${BPN}/ptest"
+FILES_${PN}-ptest = "${PTEST_PATH}"
+SECTION_${PN}-ptest = "devel"
+ALLOW_EMPTY_${PN}-ptest = "1"
+PTEST_ENABLED = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}"
+PTEST_ENABLED_class-native = ""
+PTEST_ENABLED_class-nativesdk = ""
+PTEST_ENABLED_class-cross-canadian = ""
+RDEPENDS_${PN}-ptest_class-native = ""
+RDEPENDS_${PN}-ptest_class-nativesdk = ""
+RRECOMMENDS_${PN}-ptest += "ptest-runner"
+
+PACKAGES =+ "${@bb.utils.contains('PTEST_ENABLED', '1', '${PN}-ptest', '', d)}"
+
+do_configure_ptest() {
+ :
+}
+
+do_configure_ptest_base() {
+ do_configure_ptest
+}
+
+do_compile_ptest() {
+ :
+}
+
+do_compile_ptest_base() {
+ do_compile_ptest
+}
+
+do_install_ptest() {
+ :
+}
+
+do_install_ptest_base() {
+ if [ -f ${WORKDIR}/run-ptest ]; then
+ install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+ fi
+ if grep -q install-ptest: Makefile; then
+ oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+ fi
+ do_install_ptest
+ chown -R root:root ${D}${PTEST_PATH}
+}
+
+do_configure_ptest_base[dirs] = "${B}"
+do_compile_ptest_base[dirs] = "${B}"
+do_install_ptest_base[dirs] = "${B}"
+do_install_ptest_base[cleandirs] = "${D}${PTEST_PATH}"
+
+addtask configure_ptest_base after do_configure before do_compile
+addtask compile_ptest_base after do_compile before do_install
+addtask install_ptest_base after do_install before do_package do_populate_sysroot
+
+python () {
+ if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ d.setVarFlag('do_install_ptest_base', 'fakeroot', '1')
+
+ # Remove all '*ptest_base' tasks when ptest is not enabled
+ if not(d.getVar('PTEST_ENABLED') == "1"):
+ for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
+ bb.build.deltask(i, d)
+}
diff --git a/poky/meta/classes/pypi.bbclass b/poky/meta/classes/pypi.bbclass
new file mode 100644
index 000000000..e5d7ab3ce
--- /dev/null
+++ b/poky/meta/classes/pypi.bbclass
@@ -0,0 +1,26 @@
+def pypi_package(d):
+ bpn = d.getVar('BPN')
+ if bpn.startswith('python-'):
+ return bpn[7:]
+ elif bpn.startswith('python3-'):
+ return bpn[8:]
+ return bpn
+
+PYPI_PACKAGE ?= "${@pypi_package(d)}"
+PYPI_PACKAGE_EXT ?= "tar.gz"
+
+def pypi_src_uri(d):
+ package = d.getVar('PYPI_PACKAGE')
+ package_ext = d.getVar('PYPI_PACKAGE_EXT')
+ pv = d.getVar('PV')
+ return 'https://files.pythonhosted.org/packages/source/%s/%s/%s-%s.%s' % (package[0], package, package, pv, package_ext)
+
+PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
+
+HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
+SECTION = "devel/python"
+SRC_URI += "${PYPI_SRC_URI}"
+S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
+
+UPSTREAM_CHECK_URI ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
+UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)"
diff --git a/poky/meta/classes/python-dir.bbclass b/poky/meta/classes/python-dir.bbclass
new file mode 100644
index 000000000..a11dc350b
--- /dev/null
+++ b/poky/meta/classes/python-dir.bbclass
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION = "2.7"
+PYTHON_ABI = ""
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/poky/meta/classes/python3-dir.bbclass b/poky/meta/classes/python3-dir.bbclass
new file mode 100644
index 000000000..06bb046d9
--- /dev/null
+++ b/poky/meta/classes/python3-dir.bbclass
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION = "3.5"
+PYTHON_ABI = "m"
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python3"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/poky/meta/classes/python3native.bbclass b/poky/meta/classes/python3native.bbclass
new file mode 100644
index 000000000..89665efee
--- /dev/null
+++ b/poky/meta/classes/python3native.bbclass
@@ -0,0 +1,16 @@
+inherit python3-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
+EXTRANATIVEPATH += "${PYTHON_PN}-native"
+DEPENDS_append = " ${PYTHON_PN}-native "
+
+# python-config and other scripts are using distutils modules
+# which we patch to access these variables
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# suppress host user's site-packages dirs.
+export PYTHONNOUSERSITE = "1"
+
+# autoconf macros will use their internal default preference otherwise
+export PYTHON
diff --git a/poky/meta/classes/pythonnative.bbclass b/poky/meta/classes/pythonnative.bbclass
new file mode 100644
index 000000000..4cc8b2769
--- /dev/null
+++ b/poky/meta/classes/pythonnative.bbclass
@@ -0,0 +1,19 @@
+
+inherit python-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
+# PYTHON_EXECUTABLE is used by cmake
+PYTHON_EXECUTABLE="${PYTHON}"
+EXTRANATIVEPATH += "${PYTHON_PN}-native"
+DEPENDS_append = " ${PYTHON_PN}-native "
+
+# python-config and other scripts are using distutils modules
+# which we patch to access these variables
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# suppress host user's site-packages dirs.
+export PYTHONNOUSERSITE = "1"
+
+# autoconf macros will use their internal default preference otherwise
+export PYTHON
diff --git a/poky/meta/classes/qemu.bbclass b/poky/meta/classes/qemu.bbclass
new file mode 100644
index 000000000..f5c578012
--- /dev/null
+++ b/poky/meta/classes/qemu.bbclass
@@ -0,0 +1,64 @@
+#
+# This class contains functions for recipes that need QEMU or test for its
+# existence.
+#
+
+def qemu_target_binary(data):
+ package_arch = data.getVar("PACKAGE_ARCH")
+ qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch) or "")
+ if qemu_target_binary:
+ return qemu_target_binary
+
+ target_arch = data.getVar("TARGET_ARCH")
+ if target_arch in ("i486", "i586", "i686"):
+ target_arch = "i386"
+ elif target_arch == "powerpc":
+ target_arch = "ppc"
+ elif target_arch == "powerpc64":
+ target_arch = "ppc64"
+
+ return "qemu-" + target_arch
+
+def qemu_wrapper_cmdline(data, rootfs_path, library_paths):
+ import string
+
+ qemu_binary = qemu_target_binary(data)
+ if qemu_binary == "qemu-allarch":
+ qemu_binary = "qemuwrapper"
+
+ qemu_options = data.getVar("QEMU_OPTIONS")
+
+ return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
+ + " -E LD_LIBRARY_PATH=" + ":".join(library_paths) + " "
+
+# Next function will return a string containing the command that is needed to
+# to run a certain binary through qemu. For example, in order to make a certain
+# postinstall scriptlet run at do_rootfs time and running the postinstall is
+# architecture dependent, we can run it through qemu. For example, in the
+# postinstall scriptlet, we could use the following:
+#
+# ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments]
+#
+def qemu_run_binary(data, rootfs_path, binary):
+ libdir = rootfs_path + data.getVar("libdir", False)
+ base_libdir = rootfs_path + data.getVar("base_libdir", False)
+
+ return qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir]) + rootfs_path + binary
+
+# QEMU_EXTRAOPTIONS is not meant to be directly used, the extensions are
+# PACKAGE_ARCH, *NOT* overrides.
+# In some cases (e.g. ppc) simply being arch specific (apparently) isn't good
+# enough and a PACKAGE_ARCH specific -cpu option is needed (hence we have to do
+# this dance). For others (e.g. arm) a -cpu option is not necessary, since the
+# qemu-arm default CPU supports all required architecture levels.
+
+QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}"
+QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
+
+QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
+QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_ppce5500 = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_ppc64e5500 = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400"
diff --git a/poky/meta/classes/qemuboot.bbclass b/poky/meta/classes/qemuboot.bbclass
new file mode 100644
index 000000000..15a9e63f2
--- /dev/null
+++ b/poky/meta/classes/qemuboot.bbclass
@@ -0,0 +1,124 @@
+# Help runqemu boot target board, "QB" means Qemu Boot, the following
+# vars can be set in conf files, such as <bsp.conf> to make it can be
+# boot by runqemu:
+#
+# QB_SYSTEM_NAME: qemu name, e.g., "qemu-system-i386"
+#
+# QB_OPT_APPEND: options to append to qemu, e.g., "-show-cursor"
+#
+# QB_DEFAULT_KERNEL: default kernel to boot, e.g., "bzImage"
+#
+# QB_DEFAULT_FSTYPE: default FSTYPE to boot, e.g., "ext4"
+#
+# QB_MEM: memory, e.g., "-m 512"
+#
+# QB_MACHINE: qemu machine, e.g., "-machine virt"
+#
+# QB_CPU: qemu cpu, e.g., "-cpu qemu32"
+#
+# QB_CPU_KVM: the similar to QB_CPU, but used when kvm, e.g., '-cpu kvm64',
+# set it when support kvm.
+#
+# QB_KERNEL_CMDLINE_APPEND: options to append to kernel's -append
+# option, e.g., "console=ttyS0 console=tty"
+#
+# QB_DTB: qemu dtb name
+#
+# QB_AUDIO_DRV: qemu audio driver, e.g., "alsa", set it when support audio
+#
+# QB_AUDIO_OPT: qemu audio option, e.g., "-soundhw ac97,es1370", used
+# when QB_AUDIO_DRV is set.
+#
+# QB_KERNEL_ROOT: kernel's root, e.g., /dev/vda
+#
+# QB_NETWORK_DEVICE: network device, e.g., "-device virtio-net-pci,netdev=net0,mac=@MAC@",
+# it needs work with QB_TAP_OPT and QB_SLIRP_OPT.
+# Note, runqemu will replace @MAC@ with a predefined mac, you can set
+# a custom one, but that may cause conflicts when multiple qemus are
+# running on the same host.
+#
+# QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
+# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
+# Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
+#
+# QB_SLIRP_OPT: network option for SLIRP mode, e.g., -netdev user,id=net0"
+#
+# QB_ROOTFS_OPT: used as rootfs, e.g.,
+# "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
+# Note, runqemu will replace "@ROOTFS@" with the one which is used, such as core-image-minimal-qemuarm64.ext4.
+#
+# QB_SERIAL_OPT: serial port, e.g., "-serial mon:stdio"
+#
+# QB_TCPSERIAL_OPT: tcp serial port option, e.g.,
+# " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
+# Note, runqemu will replace "@PORT@" with the port number which is used.
+#
+# Usage:
+# IMAGE_CLASSES += "qemuboot"
+# See "runqemu help" for more info
+
+QB_MEM ?= "-m 256"
+QB_SERIAL_OPT ?= "-serial mon:stdio -serial null"
+QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}"
+QB_DEFAULT_FSTYPE ?= "ext4"
+QB_OPT_APPEND ?= "-show-cursor"
+QB_NETWORK_DEVICE ?= "-device virtio-net-pci,netdev=net0,mac=@MAC@"
+
+# This should be kept align with ROOT_VM
+QB_DRIVE_TYPE ?= "/dev/sd"
+
+# Create qemuboot.conf
+addtask do_write_qemuboot_conf after do_rootfs before do_image
+IMGDEPLOYDIR ?= "${WORKDIR}/deploy-${PN}-image-complete"
+
+def qemuboot_vars(d):
+ build_vars = ['MACHINE', 'TUNE_ARCH', 'DEPLOY_DIR_IMAGE',
+ 'KERNEL_IMAGETYPE', 'IMAGE_NAME', 'IMAGE_LINK_NAME',
+ 'STAGING_DIR_NATIVE', 'STAGING_BINDIR_NATIVE',
+ 'STAGING_DIR_HOST']
+ return build_vars + [k for k in d.keys() if k.startswith('QB_')]
+
+do_write_qemuboot_conf[vardeps] += "${@' '.join(qemuboot_vars(d))}"
+do_write_qemuboot_conf[vardepsexclude] += "TOPDIR"
+python do_write_qemuboot_conf() {
+ import configparser
+
+ qemuboot = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_NAME'))
+ qemuboot_link = "%s/%s.qemuboot.conf" % (d.getVar('IMGDEPLOYDIR'), d.getVar('IMAGE_LINK_NAME'))
+ finalpath = d.getVar("DEPLOY_DIR_IMAGE")
+ topdir = d.getVar('TOPDIR')
+ cf = configparser.ConfigParser()
+ cf.add_section('config_bsp')
+ for k in sorted(qemuboot_vars(d)):
+ # qemu-helper-native sysroot is not removed by rm_work and
+ # contains all tools required by runqemu
+ if k == 'STAGING_BINDIR_NATIVE':
+ val = os.path.join(d.getVar('BASE_WORKDIR'), d.getVar('BUILD_SYS'),
+ 'qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/')
+ else:
+ val = d.getVar(k)
+ # we only want to write out relative paths so that we can relocate images
+ # and still run them
+ if val.startswith(topdir):
+ val = os.path.relpath(val, finalpath)
+ cf.set('config_bsp', k, '%s' % val)
+
+ # QB_DEFAULT_KERNEL's value of KERNEL_IMAGETYPE is the name of a symlink
+ # to the kernel file, which hinders relocatability of the qb conf.
+ # Read the link and replace it with the full filename of the target.
+ kernel_link = os.path.join(d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('QB_DEFAULT_KERNEL'))
+ kernel = os.path.realpath(kernel_link)
+ # we only want to write out relative paths so that we can relocate images
+ # and still run them
+ kernel = os.path.relpath(kernel, finalpath)
+ cf.set('config_bsp', 'QB_DEFAULT_KERNEL', kernel)
+
+ bb.utils.mkdirhier(os.path.dirname(qemuboot))
+ with open(qemuboot, 'w') as f:
+ cf.write(f)
+
+ if qemuboot_link != qemuboot:
+ if os.path.lexists(qemuboot_link):
+ os.remove(qemuboot_link)
+ os.symlink(os.path.basename(qemuboot), qemuboot_link)
+}
diff --git a/poky/meta/classes/recipe_sanity.bbclass b/poky/meta/classes/recipe_sanity.bbclass
new file mode 100644
index 000000000..7fa4a849e
--- /dev/null
+++ b/poky/meta/classes/recipe_sanity.bbclass
@@ -0,0 +1,149 @@
+def __note(msg, d):
+ bb.note("%s: recipe_sanity: %s" % (d.getVar("P"), msg))
+
+__recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS"
+def bad_runtime_vars(cfgdata, d):
+ if bb.data.inherits_class("native", d) or \
+ bb.data.inherits_class("cross", d):
+ return
+
+ for var in d.getVar("__recipe_sanity_badruntimevars").split():
+ val = d.getVar(var, False)
+ if val and val != cfgdata.get(var):
+ __note("%s should be %s_${PN}" % (var, var), d)
+
+__recipe_sanity_reqvars = "DESCRIPTION"
+__recipe_sanity_reqdiffvars = ""
+def req_vars(cfgdata, d):
+ for var in d.getVar("__recipe_sanity_reqvars").split():
+ if not d.getVar(var, False):
+ __note("%s should be set" % var, d)
+
+ for var in d.getVar("__recipe_sanity_reqdiffvars").split():
+ val = d.getVar(var, False)
+ cfgval = cfgdata.get(var)
+
+ if not val:
+ __note("%s should be set" % var, d)
+ elif val == cfgval:
+ __note("%s should be defined to something other than default (%s)" % (var, cfgval), d)
+
+def var_renames_overwrite(cfgdata, d):
+ renames = d.getVar("__recipe_sanity_renames", False)
+ if renames:
+ for (key, newkey, oldvalue, newvalue) in renames:
+ if oldvalue != newvalue and oldvalue != cfgdata.get(newkey):
+ __note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d)
+
+def incorrect_nonempty_PACKAGES(cfgdata, d):
+ if bb.data.inherits_class("native", d) or \
+ bb.data.inherits_class("cross", d):
+ if d.getVar("PACKAGES"):
+ return True
+
+def can_use_autotools_base(cfgdata, d):
+ cfg = d.getVar("do_configure")
+ if not bb.data.inherits_class("autotools", d):
+ return False
+
+ for i in ["autoreconf"] + ["%s_do_configure" % cls for cls in ["gnomebase", "gnome", "e", "autotools", "efl", "gpephone", "openmoko", "openmoko2", "xfce", "xlibs"]]:
+ if cfg.find(i) != -1:
+ return False
+
+ for clsfile in d.getVar("__inherit_cache", False):
+ (base, _) = os.path.splitext(os.path.basename(clsfile))
+ if cfg.find("%s_do_configure" % base) != -1:
+ __note("autotools_base usage needs verification, spotted %s_do_configure" % base, d)
+
+ return True
+
+def can_delete_FILESPATH(cfgdata, d):
+ expected = cfgdata.get("FILESPATH")
+ expectedpaths = d.expand(expected)
+ unexpanded = d.getVar("FILESPATH", False)
+ filespath = d.getVar("FILESPATH").split(":")
+ filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
+ for fp in filespath:
+ if not fp in expectedpaths:
+ # __note("Path %s in FILESPATH not in the expected paths %s" %
+ # (fp, expectedpaths), d)
+ return False
+ return expected != unexpanded
+
+def can_delete_others(p, cfgdata, d):
+ for k in ["S", "PV", "PN", "DESCRIPTION", "DEPENDS",
+ "SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
+ #for k in cfgdata:
+ unexpanded = d.getVar(k, False)
+ cfgunexpanded = cfgdata.get(k)
+ if not cfgunexpanded:
+ continue
+
+ try:
+ expanded = d.getVar(k)
+ cfgexpanded = d.expand(cfgunexpanded)
+ except bb.fetch.ParameterError:
+ continue
+
+ if unexpanded != cfgunexpanded and \
+ cfgexpanded == expanded:
+ __note("candidate for removal of %s" % k, d)
+ bb.debug(1, "%s: recipe_sanity: cfg's '%s' and d's '%s' both expand to %s" %
+ (p, cfgunexpanded, unexpanded, expanded))
+
+python do_recipe_sanity () {
+ p = d.getVar("P")
+ p = "%s %s %s" % (d.getVar("PN"), d.getVar("PV"), d.getVar("PR"))
+
+ sanitychecks = [
+ (can_delete_FILESPATH, "candidate for removal of FILESPATH"),
+ #(can_use_autotools_base, "candidate for use of autotools_base"),
+ (incorrect_nonempty_PACKAGES, "native or cross recipe with non-empty PACKAGES"),
+ ]
+ cfgdata = d.getVar("__recipe_sanity_cfgdata", False)
+
+ for (func, msg) in sanitychecks:
+ if func(cfgdata, d):
+ __note(msg, d)
+
+ can_delete_others(p, cfgdata, d)
+ var_renames_overwrite(cfgdata, d)
+ req_vars(cfgdata, d)
+ bad_runtime_vars(cfgdata, d)
+}
+do_recipe_sanity[nostamp] = "1"
+addtask recipe_sanity
+
+do_recipe_sanity_all[nostamp] = "1"
+do_recipe_sanity_all[recrdeptask] = "do_recipe_sanity_all do_recipe_sanity"
+do_recipe_sanity_all () {
+ :
+}
+addtask recipe_sanity_all after do_recipe_sanity
+
+python recipe_sanity_eh () {
+ d = e.data
+
+ cfgdata = {}
+ for k in d.keys():
+ if not isinstance(d.getVar(k, False), bb.data_smart.DataSmart):
+ cfgdata[k] = d.getVar(k, False)
+
+ d.setVar("__recipe_sanity_cfgdata", cfgdata)
+ #d.setVar("__recipe_sanity_cfgdata", d)
+
+ # Sick, very sick..
+ from bb.data_smart import DataSmart
+ old = DataSmart.renameVar
+ def myrename(self, key, newkey):
+ oldvalue = self.getVar(newkey, 0)
+ old(self, key, newkey)
+ newvalue = self.getVar(newkey, 0)
+ if oldvalue:
+ renames = self.getVar("__recipe_sanity_renames", 0) or set()
+ renames.add((key, newkey, oldvalue, newvalue))
+ self.setVar("__recipe_sanity_renames", renames)
+ DataSmart.renameVar = myrename
+}
+addhandler recipe_sanity_eh
+recipe_sanity_eh[eventmask] = "bb.event.ConfigParsed"
diff --git a/poky/meta/classes/relative_symlinks.bbclass b/poky/meta/classes/relative_symlinks.bbclass
new file mode 100644
index 000000000..315773734
--- /dev/null
+++ b/poky/meta/classes/relative_symlinks.bbclass
@@ -0,0 +1,5 @@
+do_install[postfuncs] += "install_relative_symlinks"
+
+python install_relative_symlinks () {
+ oe.path.replace_absolute_symlinks(d.getVar('D'), d)
+}
diff --git a/poky/meta/classes/relocatable.bbclass b/poky/meta/classes/relocatable.bbclass
new file mode 100644
index 000000000..582812c1c
--- /dev/null
+++ b/poky/meta/classes/relocatable.bbclass
@@ -0,0 +1,18 @@
+inherit chrpath
+
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess relocatable_native_pcfiles"
+
+python relocatable_binaries_preprocess() {
+ rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
+}
+
+relocatable_native_pcfiles () {
+ if [ -d ${SYSROOT_DESTDIR}${libdir}/pkgconfig ]; then
+ rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('libdir') + "/pkgconfig")}
+ sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${libdir}/pkgconfig/*.pc
+ fi
+ if [ -d ${SYSROOT_DESTDIR}${datadir}/pkgconfig ]; then
+ rel=${@os.path.relpath(d.getVar('base_prefix'), d.getVar('datadir') + "/pkgconfig")}
+ sed -i -e "s:${base_prefix}:\${pcfiledir}/$rel:g" ${SYSROOT_DESTDIR}${datadir}/pkgconfig/*.pc
+ fi
+}
diff --git a/poky/meta/classes/remove-libtool.bbclass b/poky/meta/classes/remove-libtool.bbclass
new file mode 100644
index 000000000..3fd0cd58f
--- /dev/null
+++ b/poky/meta/classes/remove-libtool.bbclass
@@ -0,0 +1,11 @@
+# This class removes libtool .la files after do_install
+
+REMOVE_LIBTOOL_LA ?= "1"
+
+remove_libtool_la() {
+ if [ "${REMOVE_LIBTOOL_LA}" != "0" ]; then
+ find "${D}" -ignore_readdir_race -name "*.la" -delete
+ fi
+}
+
+do_install[postfuncs] += "remove_libtool_la"
diff --git a/poky/meta/classes/report-error.bbclass b/poky/meta/classes/report-error.bbclass
new file mode 100644
index 000000000..1c55abfbf
--- /dev/null
+++ b/poky/meta/classes/report-error.bbclass
@@ -0,0 +1,109 @@
+#
+# Collects debug information in order to create error report files.
+#
+# Copyright (C) 2013 Intel Corporation
+# Author: Andreea Brandusa Proca <andreea.b.proca@intel.com>
+#
+# Licensed under the MIT license, see COPYING.MIT for details
+
+ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
+
+def errorreport_getdata(e):
+ import codecs
+ logpath = e.data.getVar('ERR_REPORT_DIR')
+ datafile = os.path.join(logpath, "error-report.txt")
+ with codecs.open(datafile, 'r', 'utf-8') as f:
+ data = f.read()
+ return data
+
+def errorreport_savedata(e, newdata, file):
+ import json
+ import codecs
+ logpath = e.data.getVar('ERR_REPORT_DIR')
+ datafile = os.path.join(logpath, file)
+ with codecs.open(datafile, 'w', 'utf-8') as f:
+ json.dump(newdata, f, indent=4, sort_keys=True)
+ return datafile
+
+python errorreport_handler () {
+ import json
+ import codecs
+
+ def nativelsb():
+ nativelsbstr = e.data.getVar("NATIVELSBSTRING")
+ # provide a bit more host info in case of uninative build
+ if e.data.getVar('UNINATIVE_URL') != 'unset':
+ return '/'.join([nativelsbstr, lsb_distro_identifier(e.data)])
+ return nativelsbstr
+
+ logpath = e.data.getVar('ERR_REPORT_DIR')
+ datafile = os.path.join(logpath, "error-report.txt")
+
+ if isinstance(e, bb.event.BuildStarted):
+ bb.utils.mkdirhier(logpath)
+ data = {}
+ machine = e.data.getVar("MACHINE")
+ data['machine'] = machine
+ data['build_sys'] = e.data.getVar("BUILD_SYS")
+ data['nativelsb'] = nativelsb()
+ data['distro'] = e.data.getVar("DISTRO")
+ data['target_sys'] = e.data.getVar("TARGET_SYS")
+ data['failures'] = []
+ data['component'] = " ".join(e.getPkgs())
+ data['branch_commit'] = str(base_detect_branch(e.data)) + ": " + str(base_detect_revision(e.data))
+ lock = bb.utils.lockfile(datafile + '.lock')
+ errorreport_savedata(e, data, "error-report.txt")
+ bb.utils.unlockfile(lock)
+
+ elif isinstance(e, bb.build.TaskFailed):
+ task = e.task
+ taskdata={}
+ log = e.data.getVar('BB_LOGFILE')
+ taskdata['package'] = e.data.expand("${PF}")
+ taskdata['task'] = task
+ if log:
+ try:
+ logFile = codecs.open(log, 'r', 'utf-8')
+ logdata = logFile.read()
+
+ # Replace host-specific paths so the logs are cleaner
+ for d in ("TOPDIR", "TMPDIR"):
+ s = e.data.getVar(d)
+ if s:
+ logdata = logdata.replace(s, d)
+
+ logFile.close()
+ except:
+ logdata = "Unable to read log file"
+
+ else:
+ logdata = "No Log"
+
+ # server will refuse failures longer than param specified in project.settings.py
+ # MAX_UPLOAD_SIZE = "5242880"
+ # use lower value, because 650 chars can be spent in task, package, version
+ max_logdata_size = 5242000
+ # upload last max_logdata_size characters
+ if len(logdata) > max_logdata_size:
+ logdata = "..." + logdata[-max_logdata_size:]
+ taskdata['log'] = logdata
+ lock = bb.utils.lockfile(datafile + '.lock')
+ jsondata = json.loads(errorreport_getdata(e))
+ jsondata['failures'].append(taskdata)
+ errorreport_savedata(e, jsondata, "error-report.txt")
+ bb.utils.unlockfile(lock)
+
+ elif isinstance(e, bb.event.BuildCompleted):
+ lock = bb.utils.lockfile(datafile + '.lock')
+ jsondata = json.loads(errorreport_getdata(e))
+ bb.utils.unlockfile(lock)
+ failures = jsondata['failures']
+ if(len(failures) > 0):
+ filename = "error_report_" + e.data.getVar("BUILDNAME")+".txt"
+ datafile = errorreport_savedata(e, jsondata, filename)
+ bb.note("The errors for this build are stored in %s\nYou can send the errors to a reports server by running:\n send-error-report %s [-s server]" % (datafile, datafile))
+ bb.note("The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.")
+}
+
+addhandler errorreport_handler
+errorreport_handler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskFailed"
diff --git a/poky/meta/classes/reproducible_build.bbclass b/poky/meta/classes/reproducible_build.bbclass
new file mode 100644
index 000000000..2df805330
--- /dev/null
+++ b/poky/meta/classes/reproducible_build.bbclass
@@ -0,0 +1,150 @@
+#
+# reproducible_build.bbclass
+#
+# This bbclass is mainly responsible to determine SOURCE_DATE_EPOCH on a per recipe base.
+# We need to set a recipe specific SOURCE_DATE_EPOCH in each recipe environment for various tasks.
+# One way would be to modify all recipes one-by-one to specify SOURCE_DATE_EPOCH explicitly,
+# but that is not realistic as there are hundreds (probably thousands) of recipes in various meta-layers.
+# Therefore we do it this class.
+# After sources are unpacked but before they are patched, we try to determine the value for SOURCE_DATE_EPOCH.
+#
+# There are 4 ways to determine SOURCE_DATE_EPOCH:
+#
+# 1. Use value from __source_date_epoch.txt file if this file exists.
+# This file was most likely created in the previous build by one of the following methods 2,3,4.
+# In principle, it could actually provided by a recipe via SRC_URI
+#
+# If the file does not exist, first try to determine the value for SOURCE_DATE_EPOCH:
+#
+# 2. If we detected a folder .git, use .git last commit date timestamp, as git does not allow checking out
+# files and preserving their timestamps.
+#
+# 3. Use the mtime of "known" files such as NEWS, CHANGLELOG, ...
+# This will work fine for any well kept repository distributed via tarballs.
+#
+# 4. If the above steps fail, we need to check all package source files and use the youngest file of the source tree.
+#
+# Once the value of SOURCE_DATE_EPOCH is determined, it is stored in the recipe ${WORKDIR}/source_date_epoch folder
+# in a text file "__source_date_epoch.txt'. If this file is found by other recipe task, the value is exported in
+# the SOURCE_DATE_EPOCH variable in the task environment. This is done in an anonymous python function,
+# so SOURCE_DATE_EPOCH is guaranteed to exist for all tasks the may use it (do_configure, do_compile, do_package, ...)
+
+BUILD_REPRODUCIBLE_BINARIES ??= '1'
+inherit ${@oe.utils.ifelse(d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1', 'reproducible_build_simple', '')}
+
+SDE_DIR ="${WORKDIR}/source-date-epoch"
+SDE_FILE = "${SDE_DIR}/__source_date_epoch.txt"
+
+SSTATETASKS += "do_deploy_source_date_epoch"
+
+do_deploy_source_date_epoch () {
+ echo "Deploying SDE to ${SDE_DIR}."
+}
+
+python do_deploy_source_date_epoch_setscene () {
+ sstate_setscene(d)
+}
+
+do_deploy_source_date_epoch[dirs] = "${SDE_DIR}"
+do_deploy_source_date_epoch[sstate-plaindirs] = "${SDE_DIR}"
+addtask do_deploy_source_date_epoch_setscene
+addtask do_deploy_source_date_epoch before do_configure after do_patch
+
+def get_source_date_epoch_known_files(d, path):
+ source_date_epoch = 0
+ known_files = set(["NEWS", "ChangeLog", "Changelog", "CHANGES"])
+ for file in known_files:
+ filepath = os.path.join(path,file)
+ if os.path.isfile(filepath):
+ mtime = int(os.path.getmtime(filepath))
+ # There may be more than one "known_file" present, if so, use the youngest one
+ if mtime > source_date_epoch:
+ source_date_epoch = mtime
+ return source_date_epoch
+
+def find_git_folder(path):
+ exclude = set(["temp", "license-destdir", "patches", "recipe-sysroot-native", "recipe-sysroot", "pseudo", "build", "image", "sysroot-destdir"])
+ for root, dirs, files in os.walk(path, topdown=True):
+ dirs[:] = [d for d in dirs if d not in exclude]
+ if '.git' in dirs:
+ #bb.warn("found root:%s" % (str(root)))
+ return root
+
+def get_source_date_epoch_git(d, path):
+ source_date_epoch = 0
+ if "git://" in d.getVar('SRC_URI'):
+ gitpath = find_git_folder(d.getVar('WORKDIR'))
+ if gitpath != None:
+ import subprocess
+ if os.path.isdir(os.path.join(gitpath,".git")):
+ try:
+ source_date_epoch = int(subprocess.check_output(['git','log','-1','--pretty=%ct'], cwd=path))
+ #bb.warn("JB *** gitpath:%s sde: %d" % (gitpath,source_date_epoch))
+ bb.debug(1, "git repo path:%s sde: %d" % (gitpath,source_date_epoch))
+ except subprocess.CalledProcessError as grepexc:
+ #bb.warn( "Expected git repository not found, (path: %s) error:%d" % (gitpath, grepexc.returncode))
+ bb.debug(1, "Expected git repository not found, (path: %s) error:%d" % (gitpath, grepexc.returncode))
+ else:
+ bb.warn("Failed to find a git repository for path:%s" % (path))
+ return source_date_epoch
+
+python do_create_source_date_epoch_stamp() {
+ path = d.getVar('S')
+ if not os.path.isdir(path):
+ bb.warn("Unable to determine source_date_epoch! path:%s" % path)
+ return
+
+ epochfile = d.getVar('SDE_FILE')
+ if os.path.isfile(epochfile):
+ bb.debug(1, " path: %s reusing __source_date_epoch.txt" % epochfile)
+ return
+
+ # Try to detect/find a git repository
+ source_date_epoch = get_source_date_epoch_git(d, path)
+ if source_date_epoch == 0:
+ source_date_epoch = get_source_date_epoch_known_files(d, path)
+ if source_date_epoch == 0:
+ # Do it the hard way: check all files and find the youngest one...
+ filename_dbg = None
+ exclude = set(["temp", "license-destdir", "patches", "recipe-sysroot-native", "recipe-sysroot", "pseudo", "build", "image", "sysroot-destdir"])
+ for root, dirs, files in os.walk(path, topdown=True):
+ files = [f for f in files if not f[0] == '.']
+ dirs[:] = [d for d in dirs if d not in exclude]
+
+ for fname in files:
+ filename = os.path.join(root, fname)
+ try:
+ mtime = int(os.path.getmtime(filename))
+ except ValueError:
+ mtime = 0
+ if mtime > source_date_epoch:
+ source_date_epoch = mtime
+ filename_dbg = filename
+
+ if filename_dbg != None:
+ bb.debug(1," SOURCE_DATE_EPOCH %d derived from: %s" % (source_date_epoch, filename_dbg))
+
+ if source_date_epoch == 0:
+ # empty folder, not a single file ...
+ # kernel source do_unpack is special cased
+ if not bb.data.inherits_class('kernel', d):
+ bb.debug(1, "Unable to determine source_date_epoch! path:%s" % path)
+
+ bb.utils.mkdirhier(d.getVar('SDE_DIR'))
+ with open(epochfile, 'w') as f:
+ f.write(str(source_date_epoch))
+}
+
+BB_HASHBASE_WHITELIST += "SOURCE_DATE_EPOCH"
+
+python () {
+ if d.getVar('BUILD_REPRODUCIBLE_BINARIES') == '1':
+ d.appendVarFlag("do_unpack", "postfuncs", " do_create_source_date_epoch_stamp")
+ epochfile = d.getVar('SDE_FILE')
+ source_date_epoch = "0"
+ if os.path.isfile(epochfile):
+ with open(epochfile, 'r') as f:
+ source_date_epoch = f.read()
+ bb.debug(1, "source_date_epoch stamp found ---> stamp %s" % source_date_epoch)
+ d.setVar('SOURCE_DATE_EPOCH', source_date_epoch)
+}
diff --git a/poky/meta/classes/reproducible_build_simple.bbclass b/poky/meta/classes/reproducible_build_simple.bbclass
new file mode 100644
index 000000000..8a60deef3
--- /dev/null
+++ b/poky/meta/classes/reproducible_build_simple.bbclass
@@ -0,0 +1,10 @@
+# Setup default environment for reproducible builds.
+
+BUILD_REPRODUCIBLE_BINARIES = "1"
+
+export PYTHONHASHSEED = "0"
+export PERL_HASH_SEED = "0"
+export SOURCE_DATE_EPOCH ??= "1520598896"
+
+REPRODUCIBLE_TIMESTAMP_ROOTFS ??= "1520598896"
+
diff --git a/poky/meta/classes/rm_work.bbclass b/poky/meta/classes/rm_work.bbclass
new file mode 100644
index 000000000..31d99e455
--- /dev/null
+++ b/poky/meta/classes/rm_work.bbclass
@@ -0,0 +1,189 @@
+#
+# Removes source after build
+#
+# To use it add that line to conf/local.conf:
+#
+# INHERIT += "rm_work"
+#
+# To inhibit rm_work for some recipes, specify them in RM_WORK_EXCLUDE.
+# For example, in conf/local.conf:
+#
+# RM_WORK_EXCLUDE += "icu-native icu busybox"
+#
+# Recipes can also configure which entries in their ${WORKDIR}
+# are preserved besides temp, which already gets excluded by default
+# because it contains logs:
+# do_install_append () {
+# echo "bar" >${WORKDIR}/foo
+# }
+# RM_WORK_EXCLUDE_ITEMS += "foo"
+RM_WORK_EXCLUDE_ITEMS = "temp"
+
+# Use the completion scheduler by default when rm_work is active
+# to try and reduce disk usage
+BB_SCHEDULER ?= "completion"
+
+# Run the rm_work task in the idle scheduling class
+BB_TASK_IONICE_LEVEL_task-rm_work = "3.0"
+
+do_rm_work () {
+ # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+ for p in ${RM_WORK_EXCLUDE}; do
+ if [ "$p" = "${PN}" ]; then
+ bbnote "rm_work: Skipping ${PN} since it is in RM_WORK_EXCLUDE"
+ exit 0
+ fi
+ done
+
+ # Need to add pseudo back or subsqeuent work in this workdir
+ # might fail since setscene may not rerun to recreate it
+ mkdir -p ${WORKDIR}/pseudo/
+
+ excludes='${RM_WORK_EXCLUDE_ITEMS}'
+
+ # Change normal stamps into setscene stamps as they better reflect the
+ # fact WORKDIR is now empty
+ # Also leave noexec stamps since setscene stamps don't cover them
+ cd `dirname ${STAMP}`
+ for i in `basename ${STAMP}`*
+ do
+ for j in ${SSTATETASKS} do_shared_workdir
+ do
+ case $i in
+ *do_setscene*)
+ break
+ ;;
+ *sigdata*|*sigbasedata*)
+ i=dummy
+ break
+ ;;
+ *do_package_write*)
+ i=dummy
+ break
+ ;;
+ *do_image_complete*)
+ mv $i `echo $i | sed -e "s#do_image_complete#do_image_complete_setscene#"`
+ i=dummy
+ break
+ ;;
+ *do_rootfs*|*do_image*|*do_bootimg*|*do_write_qemuboot_conf*)
+ i=dummy
+ break
+ ;;
+ *do_build*)
+ i=dummy
+ break
+ ;;
+ *do_addto_recipe_sysroot*)
+ # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used
+ excludes="$excludes recipe-sysroot-native"
+ i=dummy
+ break
+ ;;
+ # We remove do_package entirely, including any
+ # sstate version since otherwise we'd need to leave 'plaindirs' around
+ # such as 'packages' and 'packages-split' and these can be large. No end
+ # of chain tasks depend directly on do_package anymore.
+ *do_package|*do_package.*|*do_package_setscene.*)
+ rm -f $i;
+ i=dummy
+ break
+ ;;
+ *_setscene*)
+ i=dummy
+ break
+ ;;
+ *$j|*$j.*)
+ mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"`
+ i=dummy
+ break
+ ;;
+ esac
+ done
+ rm -f $i
+ done
+
+ cd ${WORKDIR}
+ for dir in *
+ do
+ # Retain only logs and other files in temp, safely ignore
+ # failures of removing pseudo folers on NFS2/3 server.
+ if [ $dir = 'pseudo' ]; then
+ rm -rf $dir 2> /dev/null || true
+ elif ! echo "$excludes" | grep -q -w "$dir"; then
+ rm -rf $dir
+ fi
+ done
+}
+do_rm_work_all () {
+ :
+}
+do_rm_work_all[recrdeptask] = "do_rm_work"
+do_rm_work_all[noexec] = "1"
+addtask rm_work_all after before do_build
+
+do_populate_sdk[postfuncs] += "rm_work_populatesdk"
+rm_work_populatesdk () {
+ :
+}
+rm_work_populatesdk[cleandirs] = "${WORKDIR}/sdk"
+
+do_image_complete[postfuncs] += "rm_work_rootfs"
+rm_work_rootfs () {
+ :
+}
+rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs"
+
+# This task can be used instead of do_build to trigger building
+# without also invoking do_rm_work. It only exists when rm_work.bbclass
+# is active, otherwise do_build needs to be used.
+#
+# The intended usage is
+# ${@ d.getVar('RM_WORK_BUILD_WITHOUT') or 'do_build'}
+# in places that previously used just 'do_build'.
+RM_WORK_BUILD_WITHOUT = "do_build_without_rm_work"
+do_build_without_rm_work () {
+ :
+}
+do_build_without_rm_work[noexec] = "1"
+
+# We have to add these tasks already now, because all tasks are
+# meant to be defined before the RecipeTaskPreProcess event triggers.
+# The inject_rm_work event handler then merely changes task dependencies.
+addtask do_rm_work
+addtask do_build_without_rm_work
+addhandler inject_rm_work
+inject_rm_work[eventmask] = "bb.event.RecipeTaskPreProcess"
+python inject_rm_work() {
+ if bb.data.inherits_class('kernel', d):
+ d.appendVar("RM_WORK_EXCLUDE", ' ' + d.getVar("PN"))
+ # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+ excludes = (d.getVar("RM_WORK_EXCLUDE") or "").split()
+ pn = d.getVar("PN")
+
+ # Determine what do_build depends upon, without including do_build
+ # itself or our own special do_rm_work_all.
+ deps = set(bb.build.preceedtask('do_build', True, d))
+ deps.difference_update(('do_build', 'do_rm_work_all'))
+
+ # deps can be empty if do_build doesn't exist, e.g. *-inital recipes
+ if not deps:
+ deps = ["do_populate_sysroot", "do_populate_lic"]
+
+ if pn in excludes:
+ d.delVarFlag('rm_work_rootfs', 'cleandirs')
+ d.delVarFlag('rm_work_populatesdk', 'cleandirs')
+ else:
+ # Inject do_rm_work into the tasks of the current recipe such that do_build
+ # depends on it and that it runs after all other tasks that block do_build,
+ # i.e. after all work on the current recipe is done. The reason for taking
+ # this approach instead of making do_rm_work depend on do_build is that
+ # do_build inherits additional runtime dependencies on
+ # other recipes and thus will typically run much later than completion of
+ # work in the recipe itself.
+ # In practice, addtask() here merely updates the dependencies.
+ bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d)
+
+ # Always update do_build_without_rm_work dependencies.
+ bb.build.addtask('do_build_without_rm_work', '', ' '.join(deps), d)
+}
diff --git a/poky/meta/classes/rm_work_and_downloads.bbclass b/poky/meta/classes/rm_work_and_downloads.bbclass
new file mode 100644
index 000000000..7c00bea59
--- /dev/null
+++ b/poky/meta/classes/rm_work_and_downloads.bbclass
@@ -0,0 +1,33 @@
+# Author: Patrick Ohly <patrick.ohly@intel.com>
+# Copyright: Copyright (C) 2015 Intel Corporation
+#
+# This file is licensed under the MIT license, see COPYING.MIT in
+# this source distribution for the terms.
+
+# This class is used like rm_work:
+# INHERIT += "rm_work_and_downloads"
+#
+# In addition to removing local build directories of a recipe, it also
+# removes the downloaded source. This is achieved by making the DL_DIR
+# recipe-specific. While reducing disk usage, it increases network usage (for
+# example, compiling the same source for target and host implies downloading
+# the source twice).
+#
+# Because the "do_fetch" task does not get re-run after removing the downloaded
+# sources, this class is also not suitable for incremental builds.
+#
+# Where it works well is in well-connected build environments with limited
+# disk space (like TravisCI).
+
+inherit rm_work
+
+# This would ensure that the existing do_rm_work() removes the downloads,
+# but does not work because some recipes have a circular dependency between
+# WORKDIR and DL_DIR (via ${SRCPV}?).
+# DL_DIR = "${WORKDIR}/downloads"
+
+# Instead go up one level and remove ourself.
+DL_DIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/downloads"
+do_rm_work_append () {
+ rm -rf ${DL_DIR}
+}
diff --git a/poky/meta/classes/rootfs-postcommands.bbclass b/poky/meta/classes/rootfs-postcommands.bbclass
new file mode 100644
index 000000000..552220953
--- /dev/null
+++ b/poky/meta/classes/rootfs-postcommands.bbclass
@@ -0,0 +1,351 @@
+
+# Zap the root password if debug-tweaks feature is not enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'empty-root-password' ], "", "zap_empty_root_password ; ",d)}'
+
+# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-empty-password' ], "ssh_allow_empty_password; ", "",d)}'
+
+# Enable postinst logging if debug-tweaks is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'post-install-logging' ], "postinst_enable_logging; ", "",d)}'
+
+# Create /etc/timestamp during image construction to give a reasonably sane default time setting
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
+
+# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
+
+# We also need to do the same for the kernel boot parameters,
+# otherwise kernel or initramfs end up mounting the rootfs read/write
+# (the default) if supported by the underlying storage.
+#
+# We do this with _append because the default value might get set later with ?=
+# and we don't want to disable such a default that by setting a value here.
+APPEND_append = '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", " ro", "", d)}'
+
+# Generates test data file with data store variables expanded in json format
+ROOTFS_POSTPROCESS_COMMAND += "write_image_test_data ; "
+
+# Write manifest
+IMAGE_MANIFEST = "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.manifest"
+ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
+# Set default postinst log file
+POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
+# Set default target for systemd images
+SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; systemd_create_users;", "", d)}'
+
+ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
+
+# Disable DNS lookups, the SSH_DISABLE_DNS_LOOKUP can be overridden to allow
+# distros to choose not to take this change
+SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; "
+ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}"
+
+# Sort the user and group entries in /etc by ID in order to make the content
+# deterministic. Package installs are not deterministic, causing the ordering
+# of entries to change between builds. In case that this isn't desired,
+# the command can be overridden.
+#
+# Note that useradd-staticids.bbclass has to be used to ensure that
+# the numeric IDs of dynamically created entries remain stable.
+#
+# We want this to run as late as possible, in particular after
+# systemd_sysusers_create and set_user_group. Using _append is not
+# enough for that, set_user_group is added that way and would end
+# up running after us.
+SORT_PASSWD_POSTPROCESS_COMMAND ??= " sort_passwd; "
+python () {
+ d.appendVar('ROOTFS_POSTPROCESS_COMMAND', '${SORT_PASSWD_POSTPROCESS_COMMAND}')
+ d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'rootfs_reproducible;')
+}
+
+systemd_create_users () {
+ for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
+ [ -e $conffile ] || continue
+ grep -v "^#" $conffile | sed -e '/^$/d' | while read type name id comment; do
+ if [ "$type" = "u" ]; then
+ useradd_params="--shell /sbin/nologin"
+ [ "$id" != "-" ] && useradd_params="$useradd_params --uid $id"
+ [ "$comment" != "-" ] && useradd_params="$useradd_params --comment $comment"
+ useradd_params="$useradd_params --system $name"
+ eval useradd --root ${IMAGE_ROOTFS} $useradd_params || true
+ elif [ "$type" = "g" ]; then
+ groupadd_params=""
+ [ "$id" != "-" ] && groupadd_params="$groupadd_params --gid $id"
+ groupadd_params="$groupadd_params --system $name"
+ eval groupadd --root ${IMAGE_ROOTFS} $groupadd_params || true
+ elif [ "$type" = "m" ]; then
+ group=$id
+ if [ ! `grep -q "^${group}:" ${IMAGE_ROOTFS}${sysconfdir}/group` ]; then
+ eval groupadd --root ${IMAGE_ROOTFS} --system $group
+ fi
+ if [ ! `grep -q "^${name}:" ${IMAGE_ROOTFS}${sysconfdir}/passwd` ]; then
+ eval useradd --root ${IMAGE_ROOTFS} --shell /sbin/nologin --system $name
+ fi
+ eval usermod --root ${IMAGE_ROOTFS} -a -G $group $name
+ fi
+ done
+ done
+}
+
+#
+# A hook function to support read-only-rootfs IMAGE_FEATURES
+#
+read_only_rootfs_hook () {
+ # Tweak the mount option and fs_passno for rootfs in fstab
+ if [ -f ${IMAGE_ROOTFS}/etc/fstab ]; then
+ sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
+ fi
+
+ # If we're using openssh and the /etc/ssh directory has no pre-generated keys,
+ # we should configure openssh to use the configuration file /etc/ssh/sshd_config_readonly
+ # and the keys under /var/run/ssh.
+ if [ -d ${IMAGE_ROOTFS}/etc/ssh ]; then
+ if [ -e ${IMAGE_ROOTFS}/etc/ssh/ssh_host_rsa_key ]; then
+ echo "SYSCONFDIR=\${SYSCONFDIR:-/etc/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ echo "SSHD_OPTS=" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ else
+ echo "SYSCONFDIR=\${SYSCONFDIR:-/var/run/ssh}" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ echo "SSHD_OPTS='-f /etc/ssh/sshd_config_readonly'" >> ${IMAGE_ROOTFS}/etc/default/ssh
+ fi
+ fi
+
+ # Also tweak the key location for dropbear in the same way.
+ if [ -d ${IMAGE_ROOTFS}/etc/dropbear ]; then
+ if [ -e ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ]; then
+ echo "DROPBEAR_RSAKEY_DIR=/etc/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ else
+ echo "DROPBEAR_RSAKEY_DIR=/var/lib/dropbear" >> ${IMAGE_ROOTFS}/etc/default/dropbear
+ fi
+ fi
+
+
+ if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
+ # Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes
+ if [ -e ${IMAGE_ROOTFS}/etc/default/rcS ]; then
+ sed -i 's/ROOTFS_READ_ONLY=no/ROOTFS_READ_ONLY=yes/' ${IMAGE_ROOTFS}/etc/default/rcS
+ fi
+ # Run populate-volatile.sh at rootfs time to set up basic files
+ # and directories to support read-only rootfs.
+ if [ -x ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh ]; then
+ ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
+ fi
+ fi
+}
+
+#
+# This function is intended to disallow empty root password if 'debug-tweaks' is not in IMAGE_FEATURES.
+#
+zap_empty_root_password () {
+ if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
+ sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
+ fi
+ if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
+ sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
+ fi
+}
+
+#
+# allow dropbear/openssh to accept root logins and logins from accounts with an empty password string
+#
+ssh_allow_empty_password () {
+ for config in sshd_config sshd_config_readonly; do
+ if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/$config ]; then
+ sed -i 's/^[#[:space:]]*PermitRootLogin.*/PermitRootLogin yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/$config
+ sed -i 's/^[#[:space:]]*PermitEmptyPasswords.*/PermitEmptyPasswords yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/$config
+ fi
+ done
+
+ if [ -e ${IMAGE_ROOTFS}${sbindir}/dropbear ] ; then
+ if grep -q DROPBEAR_EXTRA_ARGS ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear 2>/dev/null ; then
+ if ! grep -q "DROPBEAR_EXTRA_ARGS=.*-B" ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear ; then
+ sed -i 's/^DROPBEAR_EXTRA_ARGS="*\([^"]*\)"*/DROPBEAR_EXTRA_ARGS="\1 -B"/' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear
+ fi
+ else
+ printf '\nDROPBEAR_EXTRA_ARGS="-B"\n' >> ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear
+ fi
+ fi
+
+ if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then
+ for f in `find ${IMAGE_ROOTFS}${sysconfdir}/pam.d/* -type f -exec test -e {} \; -print`
+ do
+ sed -i 's/nullok_secure/nullok/' $f
+ done
+ fi
+}
+
+ssh_disable_dns_lookup () {
+ if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
+ sed -i -e 's:#UseDNS yes:UseDNS no:' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
+ fi
+}
+
+python sort_passwd () {
+ import rootfspostcommands
+ rootfspostcommands.sort_passwd(d.expand('${IMAGE_ROOTFS}${sysconfdir}'))
+}
+
+#
+# Enable postinst logging if debug-tweaks is enabled
+#
+postinst_enable_logging () {
+ mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/default
+ echo "POSTINST_LOGGING=1" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
+ echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
+}
+
+#
+# Modify systemd default target
+#
+set_systemd_default_target () {
+ if [ -d ${IMAGE_ROOTFS}${sysconfdir}/systemd/system -a -e ${IMAGE_ROOTFS}${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ]; then
+ ln -sf ${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/default.target
+ fi
+}
+
+# If /var/volatile is not empty, we have seen problems where programs such as the
+# journal make assumptions based on the contents of /var/volatile. The journal
+# would then write to /var/volatile before it was mounted, thus hiding the
+# items previously written.
+#
+# This change is to attempt to fix those types of issues in a way that doesn't
+# affect users that may not be using /var/volatile.
+empty_var_volatile () {
+ if [ -e ${IMAGE_ROOTFS}/etc/fstab ]; then
+ match=`awk '$1 !~ "#" && $2 ~ /\/var\/volatile/{print $2}' ${IMAGE_ROOTFS}/etc/fstab 2> /dev/null`
+ if [ -n "$match" ]; then
+ find ${IMAGE_ROOTFS}/var/volatile -mindepth 1 -delete
+ fi
+ fi
+}
+
+# Turn any symbolic /sbin/init link into a file
+remove_init_link () {
+ if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
+ LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init`
+ rm ${IMAGE_ROOTFS}/sbin/init
+ cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init
+ fi
+}
+
+make_zimage_symlink_relative () {
+ if [ -L ${IMAGE_ROOTFS}/boot/zImage ]; then
+ (cd ${IMAGE_ROOTFS}/boot/ && for i in `ls zImage-* | sort`; do ln -sf $i zImage; done)
+ fi
+}
+
+python write_image_manifest () {
+ from oe.rootfs import image_list_installed_packages
+ from oe.utils import format_pkg_list
+
+ deploy_dir = d.getVar('IMGDEPLOYDIR')
+ link_name = d.getVar('IMAGE_LINK_NAME')
+ manifest_name = d.getVar('IMAGE_MANIFEST')
+
+ if not manifest_name:
+ return
+
+ pkgs = image_list_installed_packages(d)
+ with open(manifest_name, 'w+') as image_manifest:
+ image_manifest.write(format_pkg_list(pkgs, "ver"))
+ image_manifest.write("\n")
+
+ if os.path.exists(manifest_name):
+ manifest_link = deploy_dir + "/" + link_name + ".manifest"
+ if os.path.lexists(manifest_link):
+ os.remove(manifest_link)
+ os.symlink(os.path.basename(manifest_name), manifest_link)
+}
+
+# Can be used to create /etc/timestamp during image construction to give a reasonably
+# sane default time setting
+rootfs_update_timestamp () {
+ if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
+ # Convert UTC into %4Y%2m%2d%2H%2M%2S
+ sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
+ else
+ sformatted=`date -u +%4Y%2m%2d%2H%2M%2S`
+ fi
+ echo $sformatted > ${IMAGE_ROOTFS}/etc/timestamp
+ bbnote "rootfs_update_timestamp: set /etc/timestamp to $sformatted"
+}
+
+# Prevent X from being started
+rootfs_no_x_startup () {
+ if [ -f ${IMAGE_ROOTFS}/etc/init.d/xserver-nodm ]; then
+ chmod a-x ${IMAGE_ROOTFS}/etc/init.d/xserver-nodm
+ fi
+}
+
+rootfs_trim_schemas () {
+ for schema in ${IMAGE_ROOTFS}/etc/gconf/schemas/*.schemas
+ do
+ # Need this in case no files exist
+ if [ -e $schema ]; then
+ oe-trim-schemas $schema > $schema.new
+ mv $schema.new $schema
+ fi
+ done
+}
+
+rootfs_check_host_user_contaminated () {
+ contaminated="${WORKDIR}/host-user-contaminated.txt"
+ HOST_USER_UID="$(PSEUDO_UNLOAD=1 id -u)"
+ HOST_USER_GID="$(PSEUDO_UNLOAD=1 id -g)"
+
+ find "${IMAGE_ROOTFS}" -wholename "${IMAGE_ROOTFS}/home" -prune \
+ -user "$HOST_USER_UID" -o -group "$HOST_USER_GID" >"$contaminated"
+
+ if [ -s "$contaminated" ]; then
+ echo "WARNING: Paths in the rootfs are owned by the same user or group as the user running bitbake. See the logfile for the specific paths."
+ cat "$contaminated" | sed "s,^, ,"
+ fi
+}
+
+# Make any absolute links in a sysroot relative
+rootfs_sysroot_relativelinks () {
+ sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
+}
+
+# Generated test data json file
+python write_image_test_data() {
+ from oe.data import export2json
+
+ testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME'))
+ testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
+
+ bb.utils.mkdirhier(os.path.dirname(testdata))
+ searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
+ export2json(d, testdata,searchString=searchString,replaceString="")
+
+ if testdata_link != testdata:
+ if os.path.lexists(testdata_link):
+ os.remove(testdata_link)
+ os.symlink(os.path.basename(testdata), testdata_link)
+}
+write_image_test_data[vardepsexclude] += "TOPDIR"
+
+# Check for unsatisfied recommendations (RRECOMMENDS)
+python rootfs_log_check_recommends() {
+ log_path = d.expand("${T}/log.do_rootfs")
+ with open(log_path, 'r') as log:
+ for line in log:
+ if 'log_check' in line:
+ continue
+
+ if 'unsatisfied recommendation for' in line:
+ bb.warn('[log_check] %s: %s' % (d.getVar('PN'), line))
+}
+
+# Perform any additional adjustments needed to make rootf binary reproducible
+rootfs_reproducible () {
+ if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" != "" ]; then
+ # Convert UTC into %4Y%2m%2d%2H%2M%2S
+ sformatted=`date -u -d @${REPRODUCIBLE_TIMESTAMP_ROOTFS} +%4Y%2m%2d%2H%2M%2S`
+ echo $sformatted > ${IMAGE_ROOTFS}/etc/version
+ bbnote "rootfs_reproducible: set /etc/version to $sformatted"
+
+ find ${IMAGE_ROOTFS}/etc/gconf -name '%gconf.xml' -print0 | xargs -0r \
+ sed -i -e 's@\bmtime="[0-9][0-9]*"@mtime="'${REPRODUCIBLE_TIMESTAMP_ROOTFS}'"@g'
+ fi
+}
diff --git a/poky/meta/classes/rootfs_deb.bbclass b/poky/meta/classes/rootfs_deb.bbclass
new file mode 100644
index 000000000..9ee1dfc86
--- /dev/null
+++ b/poky/meta/classes/rootfs_deb.bbclass
@@ -0,0 +1,35 @@
+#
+# Copyright 2006-2007 Openedhand Ltd.
+#
+
+ROOTFS_PKGMANAGE = "dpkg apt"
+
+do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
+do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot bzip2-native:do_populate_sysroot"
+do_rootfs[recrdeptask] += "do_package_write_deb"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+
+do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+do_populate_sdk_ext[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+
+python rootfs_deb_bad_recommendations() {
+ if d.getVar("BAD_RECOMMENDATIONS"):
+ bb.warn("Debian package install does not support BAD_RECOMMENDATIONS")
+}
+do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations"
+
+DEB_POSTPROCESS_COMMANDS = ""
+
+opkglibdir = "${localstatedir}/lib/opkg"
+
+python () {
+ # Map TARGET_ARCH to Debian's ideas about architectures
+ darch = d.getVar('SDK_ARCH')
+ if darch in ["x86", "i486", "i586", "i686", "pentium"]:
+ d.setVar('DEB_SDK_ARCH', 'i386')
+ elif darch == "x86_64":
+ d.setVar('DEB_SDK_ARCH', 'amd64')
+ elif darch == "arm":
+ d.setVar('DEB_SDK_ARCH', 'armel')
+}
diff --git a/poky/meta/classes/rootfs_ipk.bbclass b/poky/meta/classes/rootfs_ipk.bbclass
new file mode 100644
index 000000000..52b468d85
--- /dev/null
+++ b/poky/meta/classes/rootfs_ipk.bbclass
@@ -0,0 +1,38 @@
+#
+# Creates a root filesystem out of IPKs
+#
+# This rootfs can be mounted via root-nfs or it can be put into an cramfs/jffs etc.
+# See image.bbclass for a usage of this.
+#
+
+EXTRAOPKGCONFIG ?= ""
+ROOTFS_PKGMANAGE = "opkg ${EXTRAOPKGCONFIG}"
+
+do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
+do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
+do_rootfs[recrdeptask] += "do_package_write_ipk"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+
+do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
+do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
+do_populate_sdk_ext[lockfiles] += "${WORKDIR}/ipk.lock"
+
+OPKG_PREPROCESS_COMMANDS = ""
+
+OPKG_POSTPROCESS_COMMANDS = ""
+
+OPKGLIBDIR = "${localstatedir}/lib"
+
+MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
+
+python () {
+
+ if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
+ flags = d.getVarFlag('do_rootfs', 'recrdeptask')
+ flags = flags.replace("do_package_write_ipk", "")
+ flags = flags.replace("do_deploy", "")
+ flags = flags.replace("do_populate_sysroot", "")
+ d.setVarFlag('do_rootfs', 'recrdeptask', flags)
+ d.setVar('OPKG_PREPROCESS_COMMANDS', "")
+ d.setVar('OPKG_POSTPROCESS_COMMANDS', '')
+}
diff --git a/poky/meta/classes/rootfs_rpm.bbclass b/poky/meta/classes/rootfs_rpm.bbclass
new file mode 100644
index 000000000..7f305f51c
--- /dev/null
+++ b/poky/meta/classes/rootfs_rpm.bbclass
@@ -0,0 +1,39 @@
+#
+# Creates a root filesystem out of rpm packages
+#
+
+ROOTFS_PKGMANAGE = "rpm dnf"
+
+# dnf is using our custom distutils, and so will fail without these
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+# Add 100Meg of extra space for dnf
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "dnf", " + 102400", "" ,d)}"
+
+# Dnf is python based, so be sure python3-native is available to us.
+EXTRANATIVEPATH += "python3-native"
+
+# opkg is needed for update-alternatives
+RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
+ dnf-native:do_populate_sysroot \
+ createrepo-c-native:do_populate_sysroot \
+ opkg-native:do_populate_sysroot"
+
+do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
+do_populate_sdk[depends] += "${RPMROOTFSDEPENDS}"
+
+do_rootfs[recrdeptask] += "do_package_write_rpm"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+
+python () {
+ if d.getVar('BUILD_IMAGES_FROM_FEEDS'):
+ flags = d.getVarFlag('do_rootfs', 'recrdeptask')
+ flags = flags.replace("do_package_write_rpm", "")
+ flags = flags.replace("do_deploy", "")
+ flags = flags.replace("do_populate_sysroot", "")
+ d.setVarFlag('do_rootfs', 'recrdeptask', flags)
+ d.setVar('RPM_PREPROCESS_COMMANDS', '')
+ d.setVar('RPM_POSTPROCESS_COMMANDS', '')
+
+}
diff --git a/poky/meta/classes/rootfsdebugfiles.bbclass b/poky/meta/classes/rootfsdebugfiles.bbclass
new file mode 100644
index 000000000..e2ba4e364
--- /dev/null
+++ b/poky/meta/classes/rootfsdebugfiles.bbclass
@@ -0,0 +1,41 @@
+# This class installs additional files found on the build host
+# directly into the rootfs.
+#
+# One use case is to install a constant ssh host key in
+# an image that gets created for just one machine. This
+# solves two issues:
+# - host key generation on the device can stall when the
+# kernel has not gathered enough entropy yet (seen in practice
+# under qemu)
+# - ssh complains by default when the host key changes
+#
+# For dropbear, with the ssh host key store along side the local.conf:
+# 1. Extend local.conf:
+# INHERIT += "rootfsdebugfiles"
+# ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;"
+# 2. Boot the image once, copy the dropbear_rsa_host_key from
+# the device into your build conf directory.
+# 3. A optional parameter can be used to set file mode
+# of the copied target, for instance:
+# ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key 0600;"
+# in case they might be required to have a specific mode. (Shoundn't be too open, for example)
+#
+# Do not use for production images! It bypasses several
+# core build mechanisms (updating the image when one
+# of the files changes, license tracking in the image
+# manifest, ...).
+
+ROOTFS_DEBUG_FILES ?= ""
+ROOTFS_DEBUG_FILES[doc] = "Lists additional files or directories to be installed with 'cp -a' in the format 'source1 target1;source2 target2;...'"
+
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files ;"
+rootfs_debug_files () {
+ #!/bin/sh -e
+ echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target mode; do
+ if [ -e "$source" ]; then
+ mkdir -p $(dirname $target)
+ cp -a $source $target
+ [ -n "$mode" ] && chmod $mode $target
+ fi
+ done
+}
diff --git a/poky/meta/classes/sanity.bbclass b/poky/meta/classes/sanity.bbclass
new file mode 100644
index 000000000..e0e57ceec
--- /dev/null
+++ b/poky/meta/classes/sanity.bbclass
@@ -0,0 +1,970 @@
+#
+# Sanity check the users setup for common misconfigurations
+#
+
+SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \
+ gzip gawk chrpath wget cpio perl file which"
+
+def bblayers_conf_file(d):
+ return os.path.join(d.getVar('TOPDIR'), 'conf/bblayers.conf')
+
+def sanity_conf_read(fn):
+ with open(fn, 'r') as f:
+ lines = f.readlines()
+ return lines
+
+def sanity_conf_find_line(pattern, lines):
+ import re
+ return next(((index, line)
+ for index, line in enumerate(lines)
+ if re.search(pattern, line)), (None, None))
+
+def sanity_conf_update(fn, lines, version_var_name, new_version):
+ index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines)
+ lines[index] = '%s = "%d"\n' % (version_var_name, new_version)
+ with open(fn, "w") as f:
+ f.write(''.join(lines))
+
+# Functions added to this variable MUST throw a NotImplementedError exception unless
+# they successfully changed the config version in the config file. Exceptions
+# are used since exec_func doesn't handle return values.
+BBLAYERS_CONF_UPDATE_FUNCS += " \
+ conf/bblayers.conf:LCONF_VERSION:LAYER_CONF_VERSION:oecore_update_bblayers \
+ conf/local.conf:CONF_VERSION:LOCALCONF_VERSION:oecore_update_localconf \
+ conf/site.conf:SCONF_VERSION:SITE_CONF_VERSION:oecore_update_siteconf \
+"
+
+SANITY_DIFF_TOOL ?= "meld"
+
+SANITY_LOCALCONF_SAMPLE ?= "${COREBASE}/meta*/conf/local.conf.sample"
+python oecore_update_localconf() {
+ # Check we are using a valid local.conf
+ current_conf = d.getVar('CONF_VERSION')
+ conf_version = d.getVar('LOCALCONF_VERSION')
+
+ failmsg = """Your version of local.conf was generated from an older/newer version of
+local.conf.sample and there have been updates made to this file. Please compare the two
+files and merge any changes before continuing.
+
+Matching the version numbers will remove this message.
+
+\"${SANITY_DIFF_TOOL} conf/local.conf ${SANITY_LOCALCONF_SAMPLE}\"
+
+is a good way to visualise the changes."""
+ failmsg = d.expand(failmsg)
+
+ raise NotImplementedError(failmsg)
+}
+
+SANITY_SITECONF_SAMPLE ?= "${COREBASE}/meta*/conf/site.conf.sample"
+python oecore_update_siteconf() {
+ # If we have a site.conf, check it's valid
+ current_sconf = d.getVar('SCONF_VERSION')
+ sconf_version = d.getVar('SITE_CONF_VERSION')
+
+ failmsg = """Your version of site.conf was generated from an older version of
+site.conf.sample and there have been updates made to this file. Please compare the two
+files and merge any changes before continuing.
+
+Matching the version numbers will remove this message.
+
+\"${SANITY_DIFF_TOOL} conf/site.conf ${SANITY_SITECONF_SAMPLE}\"
+
+is a good way to visualise the changes."""
+ failmsg = d.expand(failmsg)
+
+ raise NotImplementedError(failmsg)
+}
+
+SANITY_BBLAYERCONF_SAMPLE ?= "${COREBASE}/meta*/conf/bblayers.conf.sample"
+python oecore_update_bblayers() {
+ # bblayers.conf is out of date, so see if we can resolve that
+
+ current_lconf = int(d.getVar('LCONF_VERSION'))
+ lconf_version = int(d.getVar('LAYER_CONF_VERSION'))
+
+ failmsg = """Your version of bblayers.conf has the wrong LCONF_VERSION (has ${LCONF_VERSION}, expecting ${LAYER_CONF_VERSION}).
+Please compare your file against bblayers.conf.sample and merge any changes before continuing.
+"${SANITY_DIFF_TOOL} conf/bblayers.conf ${SANITY_BBLAYERCONF_SAMPLE}"
+
+is a good way to visualise the changes."""
+ failmsg = d.expand(failmsg)
+
+ if not current_lconf:
+ raise NotImplementedError(failmsg)
+
+ lines = []
+
+ if current_lconf < 4:
+ raise NotImplementedError(failmsg)
+
+ bblayers_fn = bblayers_conf_file(d)
+ lines = sanity_conf_read(bblayers_fn)
+
+ if current_lconf == 4 and lconf_version > 4:
+ topdir_var = '$' + '{TOPDIR}'
+ index, bbpath_line = sanity_conf_find_line('BBPATH', lines)
+ if bbpath_line:
+ start = bbpath_line.find('"')
+ if start != -1 and (len(bbpath_line) != (start + 1)):
+ if bbpath_line[start + 1] == '"':
+ lines[index] = (bbpath_line[:start + 1] +
+ topdir_var + bbpath_line[start + 1:])
+ else:
+ if not topdir_var in bbpath_line:
+ lines[index] = (bbpath_line[:start + 1] +
+ topdir_var + ':' + bbpath_line[start + 1:])
+ else:
+ raise NotImplementedError(failmsg)
+ else:
+ index, bbfiles_line = sanity_conf_find_line('BBFILES', lines)
+ if bbfiles_line:
+ lines.insert(index, 'BBPATH = "' + topdir_var + '"\n')
+ else:
+ raise NotImplementedError(failmsg)
+
+ current_lconf += 1
+ sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+ bb.note("Your conf/bblayers.conf has been automatically updated.")
+ return
+
+ elif current_lconf == 5 and lconf_version > 5:
+ # Null update, to avoid issues with people switching between poky and other distros
+ current_lconf = 6
+ sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+ bb.note("Your conf/bblayers.conf has been automatically updated.")
+ return
+
+ status.addresult()
+
+ elif current_lconf == 6 and lconf_version > 6:
+ # Handle rename of meta-yocto -> meta-poky
+ # This marks the start of separate version numbers but code is needed in OE-Core
+ # for the migration, one last time.
+ layers = d.getVar('BBLAYERS').split()
+ layers = [ os.path.basename(path) for path in layers ]
+ if 'meta-yocto' in layers:
+ found = False
+ while True:
+ index, meta_yocto_line = sanity_conf_find_line(r'.*meta-yocto[\'"\s\n]', lines)
+ if meta_yocto_line:
+ lines[index] = meta_yocto_line.replace('meta-yocto', 'meta-poky')
+ found = True
+ else:
+ break
+ if not found:
+ raise NotImplementedError(failmsg)
+ index, meta_yocto_line = sanity_conf_find_line('LCONF_VERSION.*\n', lines)
+ if meta_yocto_line:
+ lines[index] = 'POKY_BBLAYERS_CONF_VERSION = "1"\n'
+ else:
+ raise NotImplementedError(failmsg)
+ with open(bblayers_fn, "w") as f:
+ f.write(''.join(lines))
+ bb.note("Your conf/bblayers.conf has been automatically updated.")
+ return
+ current_lconf += 1
+ sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+ bb.note("Your conf/bblayers.conf has been automatically updated.")
+ return
+
+ raise NotImplementedError(failmsg)
+}
+
+def raise_sanity_error(msg, d, network_error=False):
+ if d.getVar("SANITY_USE_EVENTS") == "1":
+ try:
+ bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d)
+ except TypeError:
+ bb.event.fire(bb.event.SanityCheckFailed(msg), d)
+ return
+
+ bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
+ Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
+ Following is the list of potential problems / advisories:
+
+ %s""" % msg)
+
+# Check flags associated with a tuning.
+def check_toolchain_tune_args(data, tune, multilib, errs):
+ found_errors = False
+ if check_toolchain_args_present(data, tune, multilib, errs, 'CCARGS'):
+ found_errors = True
+ if check_toolchain_args_present(data, tune, multilib, errs, 'ASARGS'):
+ found_errors = True
+ if check_toolchain_args_present(data, tune, multilib, errs, 'LDARGS'):
+ found_errors = True
+
+ return found_errors
+
+def check_toolchain_args_present(data, tune, multilib, tune_errors, which):
+ args_set = (data.getVar("TUNE_%s" % which) or "").split()
+ args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune)) or "").split()
+ args_missing = []
+
+ # If no args are listed/required, we are done.
+ if not args_wanted:
+ return
+ for arg in args_wanted:
+ if arg not in args_set:
+ args_missing.append(arg)
+
+ found_errors = False
+ if args_missing:
+ found_errors = True
+ tune_errors.append("TUNEABI for %s requires '%s' in TUNE_%s (%s)." %
+ (tune, ' '.join(args_missing), which, ' '.join(args_set)))
+ return found_errors
+
+# Check a single tune for validity.
+def check_toolchain_tune(data, tune, multilib):
+ tune_errors = []
+ if not tune:
+ return "No tuning found for %s multilib." % multilib
+ localdata = bb.data.createCopy(data)
+ if multilib != "default":
+ # Apply the overrides so we can look at the details.
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib
+ localdata.setVar("OVERRIDES", overrides)
+ bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib))
+ features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune) or "").split()
+ if not features:
+ return "Tuning '%s' has no defined features, and cannot be used." % tune
+ valid_tunes = localdata.getVarFlags('TUNEVALID') or {}
+ conflicts = localdata.getVarFlags('TUNECONFLICTS') or {}
+ # [doc] is the documentation for the variable, not a real feature
+ if 'doc' in valid_tunes:
+ del valid_tunes['doc']
+ if 'doc' in conflicts:
+ del conflicts['doc']
+ for feature in features:
+ if feature in conflicts:
+ for conflict in conflicts[feature].split():
+ if conflict in features:
+ tune_errors.append("Feature '%s' conflicts with '%s'." %
+ (feature, conflict))
+ if feature in valid_tunes:
+ bb.debug(2, " %s: %s" % (feature, valid_tunes[feature]))
+ else:
+ tune_errors.append("Feature '%s' is not defined." % feature)
+ whitelist = localdata.getVar("TUNEABI_WHITELIST")
+ if whitelist:
+ tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune)
+ if not tuneabi:
+ tuneabi = tune
+ if True not in [x in whitelist.split() for x in tuneabi.split()]:
+ tune_errors.append("Tuning '%s' (%s) cannot be used with any supported tuning/ABI." %
+ (tune, tuneabi))
+ else:
+ if not check_toolchain_tune_args(localdata, tuneabi, multilib, tune_errors):
+ bb.debug(2, "Sanity check: Compiler args OK for %s." % tune)
+ if tune_errors:
+ return "Tuning '%s' has the following errors:\n" % tune + '\n'.join(tune_errors)
+
+def check_toolchain(data):
+ tune_error_set = []
+ deftune = data.getVar("DEFAULTTUNE")
+ tune_errors = check_toolchain_tune(data, deftune, 'default')
+ if tune_errors:
+ tune_error_set.append(tune_errors)
+
+ multilibs = (data.getVar("MULTILIB_VARIANTS") or "").split()
+ global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS") or "").split()
+
+ if multilibs:
+ seen_libs = []
+ seen_tunes = []
+ for lib in multilibs:
+ if lib in seen_libs:
+ tune_error_set.append("The multilib '%s' appears more than once." % lib)
+ else:
+ seen_libs.append(lib)
+ if not lib in global_multilibs:
+ tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib)
+ tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib)
+ if tune in seen_tunes:
+ tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune)
+ else:
+ seen_libs.append(tune)
+ if tune == deftune:
+ tune_error_set.append("Multilib '%s' (%s) is also the default tuning." % (lib, deftune))
+ else:
+ tune_errors = check_toolchain_tune(data, tune, lib)
+ if tune_errors:
+ tune_error_set.append(tune_errors)
+ if tune_error_set:
+ return "Toolchain tunings invalid:\n" + '\n'.join(tune_error_set) + "\n"
+
+ return ""
+
+def check_conf_exists(fn, data):
+ bbpath = []
+ fn = data.expand(fn)
+ vbbpath = data.getVar("BBPATH", False)
+ if vbbpath:
+ bbpath += vbbpath.split(":")
+ for p in bbpath:
+ currname = os.path.join(data.expand(p), fn)
+ if os.access(currname, os.R_OK):
+ return True
+ return False
+
+def check_create_long_filename(filepath, pathname):
+ import string, random
+ testfile = os.path.join(filepath, ''.join(random.choice(string.ascii_letters) for x in range(200)))
+ try:
+ if not os.path.exists(filepath):
+ bb.utils.mkdirhier(filepath)
+ f = open(testfile, "w")
+ f.close()
+ os.remove(testfile)
+ except IOError as e:
+ import errno
+ err, strerror = e.args
+ if err == errno.ENAMETOOLONG:
+ return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
+ else:
+ return "Failed to create a file in %s: %s.\n" % (pathname, strerror)
+ except OSError as e:
+ errno, strerror = e.args
+ return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror)
+ return ""
+
+def check_path_length(filepath, pathname, limit):
+ if len(filepath) > limit:
+ return "The length of %s is longer than %s, this would cause unexpected errors, please use a shorter path.\n" % (pathname, limit)
+ return ""
+
+def get_filesystem_id(path):
+ status, result = oe.utils.getstatusoutput("stat -f -c '%s' '%s'" % ("%t", path))
+ if status == 0:
+ return result
+ else:
+ bb.warn("Can't get the filesystem id of: %s" % path)
+ return None
+
+# Check that the path isn't located on nfs.
+def check_not_nfs(path, name):
+ # The nfs' filesystem id is 6969
+ if get_filesystem_id(path) == "6969":
+ return "The %s: %s can't be located on nfs.\n" % (name, path)
+ return ""
+
+# Check that the path is on a case-sensitive file system
+def check_case_sensitive(path, name):
+ import tempfile
+ with tempfile.NamedTemporaryFile(prefix='TmP', dir=path) as tmp_file:
+ if os.path.exists(tmp_file.name.lower()):
+ return "The %s (%s) can't be on a case-insensitive file system.\n" % (name, path)
+ return ""
+
+# Check that path isn't a broken symlink
+def check_symlink(lnk, data):
+ if os.path.islink(lnk) and not os.path.exists(lnk):
+ raise_sanity_error("%s is a broken symlink." % lnk, data)
+
+def check_connectivity(d):
+ # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
+ # using the same syntax as for SRC_URI. If the variable is not set
+ # the check is skipped
+ test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS') or "").split()
+ retval = ""
+
+ bbn = d.getVar('BB_NO_NETWORK')
+ if bbn not in (None, '0', '1'):
+ return 'BB_NO_NETWORK should be "0" or "1", but it is "%s"' % bbn
+
+ # Only check connectivity if network enabled and the
+ # CONNECTIVITY_CHECK_URIS are set
+ network_enabled = not (bbn == '1')
+ check_enabled = len(test_uris)
+ if check_enabled and network_enabled:
+ # Take a copy of the data store and unset MIRRORS and PREMIRRORS
+ data = bb.data.createCopy(d)
+ data.delVar('PREMIRRORS')
+ data.delVar('MIRRORS')
+ try:
+ fetcher = bb.fetch2.Fetch(test_uris, data)
+ fetcher.checkstatus()
+ except Exception as err:
+ # Allow the message to be configured so that users can be
+ # pointed to a support mechanism.
+ msg = data.getVar('CONNECTIVITY_CHECK_MSG') or ""
+ if len(msg) == 0:
+ msg = "%s.\n" % err
+ msg += " Please ensure your host's network is configured correctly,\n"
+ msg += " or set BB_NO_NETWORK = \"1\" to disable network access if\n"
+ msg += " all required sources are on local disk.\n"
+ retval = msg
+
+ return retval
+
+def check_supported_distro(sanity_data):
+ from fnmatch import fnmatch
+
+ tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS')
+ if not tested_distros:
+ return
+
+ try:
+ distro = oe.lsb.distro_identifier()
+ except Exception:
+ distro = None
+
+ if not distro:
+ bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.')
+
+ for supported in [x.strip() for x in tested_distros.split('\\n')]:
+ if fnmatch(distro, supported):
+ return
+
+ bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro)
+
+# Checks we should only make if MACHINE is set correctly
+def check_sanity_validmachine(sanity_data):
+ messages = ""
+
+ # Check TUNE_ARCH is set
+ if sanity_data.getVar('TUNE_ARCH') == 'INVALID':
+ messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n'
+
+ # Check TARGET_OS is set
+ if sanity_data.getVar('TARGET_OS') == 'INVALID':
+ messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n'
+
+ # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS
+ pkgarchs = sanity_data.getVar('PACKAGE_ARCHS')
+ tunepkg = sanity_data.getVar('TUNE_PKGARCH')
+ defaulttune = sanity_data.getVar('DEFAULTTUNE')
+ tunefound = False
+ seen = {}
+ dups = []
+
+ for pa in pkgarchs.split():
+ if seen.get(pa, 0) == 1:
+ dups.append(pa)
+ else:
+ seen[pa] = 1
+ if pa == tunepkg:
+ tunefound = True
+
+ if len(dups):
+ messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
+
+ if tunefound == False:
+ messages = messages + "Error, the PACKAGE_ARCHS variable (%s) for DEFAULTTUNE (%s) does not contain TUNE_PKGARCH (%s)." % (pkgarchs, defaulttune, tunepkg)
+
+ return messages
+
+# Patch before 2.7 can't handle all the features in git-style diffs. Some
+# patches may incorrectly apply, and others won't apply at all.
+def check_patch_version(sanity_data):
+ from distutils.version import LooseVersion
+ import re, subprocess
+
+ try:
+ result = subprocess.check_output(["patch", "--version"], stderr=subprocess.STDOUT, universal_newlines=True)
+ version = re.search(r"[0-9.]+", result.splitlines()[0]).group()
+ if LooseVersion(version) < LooseVersion("2.7"):
+ return "Your version of patch is older than 2.7 and has bugs which will break builds. Please install a newer version of patch.\n"
+ else:
+ return None
+ except subprocess.CalledProcessError as e:
+ return "Unable to execute patch --version, exit code %d:\n%s\n" % (e.returncode, e.output)
+
+# Unpatched versions of make 3.82 are known to be broken. See GNU Savannah Bug 30612.
+# Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate.
+def check_make_version(sanity_data):
+ from distutils.version import LooseVersion
+ status, result = oe.utils.getstatusoutput("make --version")
+ if status != 0:
+ return "Unable to execute make --version, exit code %d\n" % status
+ version = result.split()[2]
+ if LooseVersion(version) == LooseVersion("3.82"):
+ # Construct a test file
+ f = open("makefile_test", "w")
+ f.write("makefile_test.a: makefile_test_a.c makefile_test_b.c makefile_test.a( makefile_test_a.c makefile_test_b.c)\n")
+ f.write("\n")
+ f.write("makefile_test_a.c:\n")
+ f.write(" touch $@\n")
+ f.write("\n")
+ f.write("makefile_test_b.c:\n")
+ f.write(" touch $@\n")
+ f.close()
+
+ # Check if make 3.82 has been patched
+ status,result = oe.utils.getstatusoutput("make -f makefile_test")
+
+ os.remove("makefile_test")
+ if os.path.exists("makefile_test_a.c"):
+ os.remove("makefile_test_a.c")
+ if os.path.exists("makefile_test_b.c"):
+ os.remove("makefile_test_b.c")
+ if os.path.exists("makefile_test.a"):
+ os.remove("makefile_test.a")
+
+ if status != 0:
+ return "Your version of make 3.82 is broken. Please revert to 3.81 or install a patched version.\n"
+ return None
+
+
+# Tar version 1.24 and onwards handle overwriting symlinks correctly
+# but earlier versions do not; this needs to work properly for sstate
+def check_tar_version(sanity_data):
+ from distutils.version import LooseVersion
+ status, result = oe.utils.getstatusoutput("tar --version")
+ if status != 0:
+ return "Unable to execute tar --version, exit code %d\n" % status
+ version = result.split()[3]
+ if LooseVersion(version) < LooseVersion("1.24"):
+ return "Your version of tar is older than 1.24 and has bugs which will break builds. Please install a newer version of tar.\n"
+ return None
+
+# We use git parameters and functionality only found in 1.7.8 or later
+# The kernel tools assume git >= 1.8.3.1 (verified needed > 1.7.9.5) see #6162
+# The git fetcher also had workarounds for git < 1.7.9.2 which we've dropped
+def check_git_version(sanity_data):
+ from distutils.version import LooseVersion
+ status, result = oe.utils.getstatusoutput("git --version 2> /dev/null")
+ if status != 0:
+ return "Unable to execute git --version, exit code %d\n" % status
+ version = result.split()[2]
+ if LooseVersion(version) < LooseVersion("1.8.3.1"):
+ return "Your version of git is older than 1.8.3.1 and has bugs which will break builds. Please install a newer version of git.\n"
+ return None
+
+# Check the required perl modules which may not be installed by default
+def check_perl_modules(sanity_data):
+ ret = ""
+ modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper" )
+ errresult = ''
+ for m in modules:
+ status, result = oe.utils.getstatusoutput("perl -e 'use %s'" % m)
+ if status != 0:
+ errresult += result
+ ret += "%s " % m
+ if ret:
+ return "Required perl module(s) not found: %s\n\n%s\n" % (ret, errresult)
+ return None
+
+def sanity_check_conffiles(d):
+ funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS').split()
+ for func in funcs:
+ conffile, current_version, required_version, func = func.split(":")
+ if check_conf_exists(conffile, d) and d.getVar(current_version) is not None and \
+ d.getVar(current_version) != d.getVar(required_version):
+ try:
+ bb.build.exec_func(func, d, pythonexception=True)
+ except NotImplementedError as e:
+ bb.fatal(str(e))
+ d.setVar("BB_INVALIDCONF", True)
+
+def sanity_handle_abichanges(status, d):
+ #
+ # Check the 'ABI' of TMPDIR
+ #
+ import subprocess
+
+ current_abi = d.getVar('OELAYOUT_ABI')
+ abifile = d.getVar('SANITY_ABIFILE')
+ if os.path.exists(abifile):
+ with open(abifile, "r") as f:
+ abi = f.read().strip()
+ if not abi.isdigit():
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+ elif int(abi) <= 11 and current_abi == "12":
+ status.addresult("The layout of TMPDIR changed for Recipe Specific Sysroots.\nConversion doesn't make sense and this change will rebuild everything so please delete TMPDIR (%s).\n" % d.getVar("TMPDIR"))
+ elif (abi != current_abi):
+ # Code to convert from one ABI to another could go here if possible.
+ status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi))
+ else:
+ with open(abifile, "w") as f:
+ f.write(current_abi)
+
+def check_sanity_sstate_dir_change(sstate_dir, data):
+ # Sanity checks to be done when the value of SSTATE_DIR changes
+
+ # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
+ testmsg = ""
+ if sstate_dir != "":
+ testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR")
+ # If we don't have permissions to SSTATE_DIR, suggest the user set it as an SSTATE_MIRRORS
+ try:
+ err = testmsg.split(': ')[1].strip()
+ if err == "Permission denied.":
+ testmsg = testmsg + "You could try using %s in SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir)
+ except IndexError:
+ pass
+ return testmsg
+
+def check_sanity_version_change(status, d):
+ # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes
+ # In other words, these tests run once in a given build directory and then
+ # never again until the sanity version or host distrubution id/version changes.
+
+ # Check the python install is complete. glib-2.0-natives requries
+ # xml.parsers.expat
+ try:
+ import xml.parsers.expat
+ except ImportError:
+ status.addresult('Your python is not a full install. Please install the module xml.parsers.expat (python-xml on openSUSE and SUSE Linux).\n')
+ import stat
+
+ status.addresult(check_make_version(d))
+ status.addresult(check_patch_version(d))
+ status.addresult(check_tar_version(d))
+ status.addresult(check_git_version(d))
+ status.addresult(check_perl_modules(d))
+
+ missing = ""
+
+ if not check_app_exists("${MAKE}", d):
+ missing = missing + "GNU make,"
+
+ if not check_app_exists('${BUILD_CC}', d):
+ missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC")
+
+ if not check_app_exists('${BUILD_CXX}', d):
+ missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX")
+
+ required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES')
+
+ for util in required_utilities.split():
+ if not check_app_exists(util, d):
+ missing = missing + "%s," % util
+
+ if missing:
+ missing = missing.rstrip(',')
+ status.addresult("Please install the following missing utilities: %s\n" % missing)
+
+ assume_provided = d.getVar('ASSUME_PROVIDED').split()
+ # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
+ if "diffstat-native" not in assume_provided:
+ status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n')
+
+ # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
+ tmpdir = d.getVar('TMPDIR')
+ status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
+ tmpdirmode = os.stat(tmpdir).st_mode
+ if (tmpdirmode & stat.S_ISGID):
+ status.addresult("TMPDIR is setgid, please don't build in a setgid directory")
+ if (tmpdirmode & stat.S_ISUID):
+ status.addresult("TMPDIR is setuid, please don't build in a setuid directory")
+
+ # Some third-party software apparently relies on chmod etc. being suid root (!!)
+ import stat
+ suid_check_bins = "chown chmod mknod".split()
+ for bin_cmd in suid_check_bins:
+ bin_path = bb.utils.which(os.environ["PATH"], bin_cmd)
+ if bin_path:
+ bin_stat = os.stat(bin_path)
+ if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID:
+ status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path)
+
+ # Check that we can fetch from various network transports
+ netcheck = check_connectivity(d)
+ status.addresult(netcheck)
+ if netcheck:
+ status.network_error = True
+
+ nolibs = d.getVar('NO32LIBS')
+ if not nolibs:
+ lib32path = '/lib'
+ if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ):
+ lib32path = '/lib32'
+
+ if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'):
+ status.addresult("You have a 32-bit libc, but no 32-bit headers. You must install the 32-bit libc headers.\n")
+
+ bbpaths = d.getVar('BBPATH').split(":")
+ if ("." in bbpaths or "./" in bbpaths or "" in bbpaths):
+ status.addresult("BBPATH references the current directory, either through " \
+ "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\
+ "layer configuration is adding empty elements to BBPATH.\n\t "\
+ "Please check your layer.conf files and other BBPATH " \
+ "settings to remove the current working directory " \
+ "references.\n" \
+ "Parsed BBPATH is" + str(bbpaths));
+
+ oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF')
+ if not oes_bb_conf:
+ status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n')
+
+ # The length of TMPDIR can't be longer than 410
+ status.addresult(check_path_length(tmpdir, "TMPDIR", 410))
+
+ # Check that TMPDIR isn't located on nfs
+ status.addresult(check_not_nfs(tmpdir, "TMPDIR"))
+
+ # Check for case-insensitive file systems (such as Linux in Docker on
+ # macOS with default HFS+ file system)
+ status.addresult(check_case_sensitive(tmpdir, "TMPDIR"))
+
+def sanity_check_locale(d):
+ """
+ Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists.
+ """
+ import locale
+ try:
+ locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
+ except locale.Error:
+ raise_sanity_error("Your system needs to support the en_US.UTF-8 locale.", d)
+
+def check_sanity_everybuild(status, d):
+ import os, stat
+ # Sanity tests which test the users environment so need to run at each build (or are so cheap
+ # it makes sense to always run them.
+
+ if 0 == os.getuid():
+ raise_sanity_error("Do not use Bitbake as root.", d)
+
+ # Check the Python version, we now have a minimum of Python 3.4
+ import sys
+ if sys.hexversion < 0x03040000:
+ status.addresult('The system requires at least Python 3.4 to run. Please update your Python interpreter.\n')
+
+ # Check the bitbake version meets minimum requirements
+ from distutils.version import LooseVersion
+ minversion = d.getVar('BB_MIN_VERSION')
+ if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
+ status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__))
+
+ sanity_check_locale(d)
+
+ paths = d.getVar('PATH').split(":")
+ if "." in paths or "./" in paths or "" in paths:
+ status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
+
+ # Check that the DISTRO is valid, if set
+ # need to take into account DISTRO renaming DISTRO
+ distro = d.getVar('DISTRO')
+ if distro and distro != "nodistro":
+ if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ):
+ status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO"))
+
+ # Check that these variables don't use tilde-expansion as we don't do that
+ for v in ("TMPDIR", "DL_DIR", "SSTATE_DIR"):
+ if d.getVar(v).startswith("~"):
+ status.addresult("%s uses ~ but Bitbake will not expand this, use an absolute path or variables." % v)
+
+ # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't
+ # set, since so much relies on it being set.
+ dldir = d.getVar('DL_DIR')
+ if not dldir:
+ status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n")
+ if os.path.exists(dldir) and not os.access(dldir, os.W_OK):
+ status.addresult("DL_DIR: %s exists but you do not appear to have write access to it. \n" % dldir)
+ check_symlink(dldir, d)
+
+ # Check that the MACHINE is valid, if it is set
+ machinevalid = True
+ if d.getVar('MACHINE'):
+ if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
+ status.addresult('MACHINE=%s is invalid. Please set a valid MACHINE in your local.conf, environment or other configuration file.\n' % (d.getVar('MACHINE')))
+ machinevalid = False
+ else:
+ status.addresult(check_sanity_validmachine(d))
+ else:
+ status.addresult('Please set a MACHINE in your local.conf or environment\n')
+ machinevalid = False
+ if machinevalid:
+ status.addresult(check_toolchain(d))
+
+ # Check that the SDKMACHINE is valid, if it is set
+ if d.getVar('SDKMACHINE'):
+ if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d):
+ status.addresult('Specified SDKMACHINE value is not valid\n')
+ elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}":
+ status.addresult('SDKMACHINE is set, but SDK_ARCH has not been changed as a result - SDKMACHINE may have been set too late (e.g. in the distro configuration)\n')
+
+ check_supported_distro(d)
+
+ omask = os.umask(0o022)
+ if omask & 0o755:
+ status.addresult("Please use a umask which allows a+rx and u+rwx\n")
+ os.umask(omask)
+
+ if d.getVar('TARGET_ARCH') == "arm":
+ # This path is no longer user-readable in modern (very recent) Linux
+ try:
+ if os.path.exists("/proc/sys/vm/mmap_min_addr"):
+ f = open("/proc/sys/vm/mmap_min_addr", "r")
+ try:
+ if (int(f.read().strip()) > 65536):
+ status.addresult("/proc/sys/vm/mmap_min_addr is not <= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n")
+ finally:
+ f.close()
+ except:
+ pass
+
+ oeroot = d.getVar('COREBASE')
+ if oeroot.find('+') != -1:
+ status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.")
+ if oeroot.find('@') != -1:
+ status.addresult("Error, you have an invalid character (@) in your COREBASE directory path. Please move the installation to a directory which doesn't include any @ characters.")
+ if oeroot.find(' ') != -1:
+ status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.")
+
+ # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
+ import re
+ mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
+ protocols = ['http', 'ftp', 'file', 'https', \
+ 'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \
+ 'bzr', 'cvs', 'npm', 'sftp', 'ssh', 's3' ]
+ for mirror_var in mirror_vars:
+ mirrors = (d.getVar(mirror_var) or '').replace('\\n', ' ').split()
+
+ # Split into pairs
+ if len(mirrors) % 2 != 0:
+ bb.warn('Invalid mirror variable value for %s: %s, should contain paired members.' % (mirror_var, str(mirrors)))
+ continue
+ mirrors = list(zip(*[iter(mirrors)]*2))
+
+ for mirror_entry in mirrors:
+ pattern, mirror = mirror_entry
+
+ decoded = bb.fetch2.decodeurl(pattern)
+ try:
+ pattern_scheme = re.compile(decoded[0])
+ except re.error as exc:
+ bb.warn('Invalid scheme regex (%s) in %s; %s' % (pattern, mirror_var, mirror_entry))
+ continue
+
+ if not any(pattern_scheme.match(protocol) for protocol in protocols):
+ bb.warn('Invalid protocol (%s) in %s: %s' % (decoded[0], mirror_var, mirror_entry))
+ continue
+
+ if not any(mirror.startswith(protocol + '://') for protocol in protocols):
+ bb.warn('Invalid protocol in %s: %s' % (mirror_var, mirror_entry))
+ continue
+
+ if mirror.startswith('file://'):
+ import urllib
+ check_symlink(urllib.parse.urlparse(mirror).path, d)
+ # SSTATE_MIRROR ends with a /PATH string
+ if mirror.endswith('/PATH'):
+ # remove /PATH$ from SSTATE_MIRROR to get a working
+ # base directory path
+ mirror_base = urllib.parse.urlparse(mirror[:-1*len('/PATH')]).path
+ check_symlink(mirror_base, d)
+
+ # Check that TMPDIR hasn't changed location since the last time we were run
+ tmpdir = d.getVar('TMPDIR')
+ checkfile = os.path.join(tmpdir, "saved_tmpdir")
+ if os.path.exists(checkfile):
+ with open(checkfile, "r") as f:
+ saved_tmpdir = f.read().strip()
+ if (saved_tmpdir != tmpdir):
+ status.addresult("Error, TMPDIR has changed location. You need to either move it back to %s or rebuild\n" % saved_tmpdir)
+ else:
+ bb.utils.mkdirhier(tmpdir)
+ # Remove setuid, setgid and sticky bits from TMPDIR
+ try:
+ os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID)
+ os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID)
+ os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX)
+ except OSError as exc:
+ bb.warn("Unable to chmod TMPDIR: %s" % exc)
+ with open(checkfile, "w") as f:
+ f.write(tmpdir)
+
+ # If /bin/sh is a symlink, check that it points to dash or bash
+ if os.path.islink('/bin/sh'):
+ real_sh = os.path.realpath('/bin/sh')
+ # Due to update-alternatives, the shell name may take various
+ # forms, such as /bin/dash, bin/bash, /bin/bash.bash ...
+ if '/dash' not in real_sh and '/bash' not in real_sh:
+ status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
+
+def check_sanity(sanity_data):
+ class SanityStatus(object):
+ def __init__(self):
+ self.messages = ""
+ self.network_error = False
+
+ def addresult(self, message):
+ if message:
+ self.messages = self.messages + message
+
+ status = SanityStatus()
+
+ tmpdir = sanity_data.getVar('TMPDIR')
+ sstate_dir = sanity_data.getVar('SSTATE_DIR')
+
+ check_symlink(sstate_dir, sanity_data)
+
+ # Check saved sanity info
+ last_sanity_version = 0
+ last_tmpdir = ""
+ last_sstate_dir = ""
+ last_nativelsbstr = ""
+ sanityverfile = sanity_data.expand("${TOPDIR}/conf/sanity_info")
+ if os.path.exists(sanityverfile):
+ with open(sanityverfile, 'r') as f:
+ for line in f:
+ if line.startswith('SANITY_VERSION'):
+ last_sanity_version = int(line.split()[1])
+ if line.startswith('TMPDIR'):
+ last_tmpdir = line.split()[1]
+ if line.startswith('SSTATE_DIR'):
+ last_sstate_dir = line.split()[1]
+ if line.startswith('NATIVELSBSTRING'):
+ last_nativelsbstr = line.split()[1]
+
+ check_sanity_everybuild(status, sanity_data)
+
+ sanity_version = int(sanity_data.getVar('SANITY_VERSION') or 1)
+ network_error = False
+ # NATIVELSBSTRING var may have been overridden with "universal", so
+ # get actual host distribution id and version
+ nativelsbstr = lsb_distro_identifier(sanity_data)
+ if last_sanity_version < sanity_version or last_nativelsbstr != nativelsbstr:
+ check_sanity_version_change(status, sanity_data)
+ status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
+ else:
+ if last_sstate_dir != sstate_dir:
+ status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
+
+ if os.path.exists(os.path.dirname(sanityverfile)) and not status.messages:
+ with open(sanityverfile, 'w') as f:
+ f.write("SANITY_VERSION %s\n" % sanity_version)
+ f.write("TMPDIR %s\n" % tmpdir)
+ f.write("SSTATE_DIR %s\n" % sstate_dir)
+ f.write("NATIVELSBSTRING %s\n" % nativelsbstr)
+
+ sanity_handle_abichanges(status, sanity_data)
+
+ if status.messages != "":
+ raise_sanity_error(sanity_data.expand(status.messages), sanity_data, status.network_error)
+
+# Create a copy of the datastore and finalise it to ensure appends and
+# overrides are set - the datastore has yet to be finalised at ConfigParsed
+def copy_data(e):
+ sanity_data = bb.data.createCopy(e.data)
+ sanity_data.finalize()
+ return sanity_data
+
+addhandler config_reparse_eventhandler
+config_reparse_eventhandler[eventmask] = "bb.event.ConfigParsed"
+python config_reparse_eventhandler() {
+ sanity_check_conffiles(e.data)
+}
+
+addhandler check_sanity_eventhandler
+check_sanity_eventhandler[eventmask] = "bb.event.SanityCheck bb.event.NetworkTest"
+python check_sanity_eventhandler() {
+ if bb.event.getName(e) == "SanityCheck":
+ sanity_data = copy_data(e)
+ check_sanity(sanity_data)
+ if e.generateevents:
+ sanity_data.setVar("SANITY_USE_EVENTS", "1")
+ bb.event.fire(bb.event.SanityCheckPassed(), e.data)
+ elif bb.event.getName(e) == "NetworkTest":
+ sanity_data = copy_data(e)
+ if e.generateevents:
+ sanity_data.setVar("SANITY_USE_EVENTS", "1")
+ bb.event.fire(bb.event.NetworkTestFailed() if check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data)
+
+ return
+}
diff --git a/poky/meta/classes/scons.bbclass b/poky/meta/classes/scons.bbclass
new file mode 100644
index 000000000..b9ae19d58
--- /dev/null
+++ b/poky/meta/classes/scons.bbclass
@@ -0,0 +1,17 @@
+DEPENDS += "python-scons-native"
+
+EXTRA_OESCONS ?= ""
+
+do_configure[noexec] = "1"
+
+scons_do_compile() {
+ ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
+ die "scons build execution failed."
+}
+
+scons_do_install() {
+ ${STAGING_BINDIR_NATIVE}/scons install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \
+ die "scons install execution failed."
+}
+
+EXPORT_FUNCTIONS do_compile do_install
diff --git a/poky/meta/classes/setuptools.bbclass b/poky/meta/classes/setuptools.bbclass
new file mode 100644
index 000000000..56343b1c7
--- /dev/null
+++ b/poky/meta/classes/setuptools.bbclass
@@ -0,0 +1,8 @@
+inherit distutils
+
+DEPENDS += "python-distribute-native"
+
+DISTUTILS_INSTALL_ARGS = "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
diff --git a/poky/meta/classes/setuptools3.bbclass b/poky/meta/classes/setuptools3.bbclass
new file mode 100644
index 000000000..de6dd9440
--- /dev/null
+++ b/poky/meta/classes/setuptools3.bbclass
@@ -0,0 +1,8 @@
+inherit distutils3
+
+DEPENDS += "python3-setuptools-native"
+
+DISTUTILS_INSTALL_ARGS = "--root=${D} \
+ --prefix=${prefix} \
+ --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+ --install-data=${datadir}"
diff --git a/poky/meta/classes/sign_ipk.bbclass b/poky/meta/classes/sign_ipk.bbclass
new file mode 100644
index 000000000..e5057b779
--- /dev/null
+++ b/poky/meta/classes/sign_ipk.bbclass
@@ -0,0 +1,52 @@
+# Class for generating signed IPK packages.
+#
+# Configuration variables used by this class:
+# IPK_GPG_PASSPHRASE_FILE
+# Path to a file containing the passphrase of the signing key.
+# IPK_GPG_NAME
+# Name of the key to sign with.
+# IPK_GPG_BACKEND
+# Optional variable for specifying the backend to use for signing.
+# Currently the only available option is 'local', i.e. local signing
+# on the build host.
+# IPK_GPG_SIGNATURE_TYPE
+# Optional variable for specifying the type of gpg signatures, can be:
+# 1. Ascii armored (ASC), default if not set
+# 2. Binary (BIN)
+# GPG_BIN
+# Optional variable for specifying the gpg binary/wrapper to use for
+# signing.
+# GPG_PATH
+# Optional variable for specifying the gnupg "home" directory:
+#
+
+inherit sanity
+
+IPK_SIGN_PACKAGES = '1'
+IPK_GPG_BACKEND ?= 'local'
+IPK_GPG_SIGNATURE_TYPE ?= 'ASC'
+
+python () {
+ # Check configuration
+ for var in ('IPK_GPG_NAME', 'IPK_GPG_PASSPHRASE_FILE'):
+ if not d.getVar(var):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ sigtype = d.getVar("IPK_GPG_SIGNATURE_TYPE")
+ if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
+ raise_sanity_error("Bad value for IPK_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype)
+}
+
+def sign_ipk(d, ipk_to_sign):
+ from oe.gpg_sign import get_signer
+
+ bb.debug(1, 'Signing ipk: %s' % ipk_to_sign)
+
+ signer = get_signer(d, d.getVar('IPK_GPG_BACKEND'))
+ sig_type = d.getVar('IPK_GPG_SIGNATURE_TYPE')
+ is_ascii_sig = (sig_type.upper() != "BIN")
+
+ signer.detach_sign(ipk_to_sign,
+ d.getVar('IPK_GPG_NAME'),
+ d.getVar('IPK_GPG_PASSPHRASE_FILE'),
+ armor=is_ascii_sig)
diff --git a/poky/meta/classes/sign_package_feed.bbclass b/poky/meta/classes/sign_package_feed.bbclass
new file mode 100644
index 000000000..7ff3a35a2
--- /dev/null
+++ b/poky/meta/classes/sign_package_feed.bbclass
@@ -0,0 +1,46 @@
+# Class for signing package feeds
+#
+# Related configuration variables that will be used after this class is
+# iherited:
+# PACKAGE_FEED_PASSPHRASE_FILE
+# Path to a file containing the passphrase of the signing key.
+# PACKAGE_FEED_GPG_NAME
+# Name of the key to sign with. May be key id or key name.
+# PACKAGE_FEED_GPG_BACKEND
+# Optional variable for specifying the backend to use for signing.
+# Currently the only available option is 'local', i.e. local signing
+# on the build host.
+# PACKAGE_FEED_GPG_SIGNATURE_TYPE
+# Optional variable for specifying the type of gpg signature, can be:
+# 1. Ascii armored (ASC), default if not set
+# 2. Binary (BIN)
+# This variable is only available for IPK feeds. It is ignored on
+# other packaging backends.
+# GPG_BIN
+# Optional variable for specifying the gpg binary/wrapper to use for
+# signing.
+# GPG_PATH
+# Optional variable for specifying the gnupg "home" directory:
+#
+inherit sanity
+
+PACKAGE_FEED_SIGN = '1'
+PACKAGE_FEED_GPG_BACKEND ?= 'local'
+PACKAGE_FEED_GPG_SIGNATURE_TYPE ?= 'ASC'
+
+# Make feed signing key to be present in rootfs
+FEATURE_PACKAGES_package-management_append = " signing-keys-packagefeed"
+
+python () {
+ # Check sanity of configuration
+ for var in ('PACKAGE_FEED_GPG_NAME', 'PACKAGE_FEED_GPG_PASSPHRASE_FILE'):
+ if not d.getVar(var):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ sigtype = d.getVar("PACKAGE_FEED_GPG_SIGNATURE_TYPE")
+ if sigtype.upper() != "ASC" and sigtype.upper() != "BIN":
+ raise_sanity_error("Bad value for PACKAGE_FEED_GPG_SIGNATURE_TYPE (%s), use either ASC or BIN" % sigtype)
+}
+
+do_package_index[depends] += "signing-keys:do_deploy"
+do_rootfs[depends] += "signing-keys:do_populate_sysroot gnupg-native:do_populate_sysroot"
diff --git a/poky/meta/classes/sign_rpm.bbclass b/poky/meta/classes/sign_rpm.bbclass
new file mode 100644
index 000000000..64ae7ce30
--- /dev/null
+++ b/poky/meta/classes/sign_rpm.bbclass
@@ -0,0 +1,71 @@
+# Class for generating signed RPM packages.
+#
+# Configuration variables used by this class:
+# RPM_GPG_PASSPHRASE
+# The passphrase of the signing key.
+# RPM_GPG_NAME
+# Name of the key to sign with. May be key id or key name.
+# RPM_GPG_BACKEND
+# Optional variable for specifying the backend to use for signing.
+# Currently the only available option is 'local', i.e. local signing
+# on the build host.
+# RPM_FILE_CHECKSUM_DIGEST
+# Optional variable for specifying the algorithm for generating file
+# checksum digest.
+# RPM_FSK_PATH
+# Optional variable for the file signing key.
+# RPM_FSK_PASSWORD
+# Optional variable for the file signing key password.
+# GPG_BIN
+# Optional variable for specifying the gpg binary/wrapper to use for
+# signing.
+# RPM_GPG_SIGN_CHUNK
+# Optional variable indicating the number of packages used per gpg
+# invocation
+# GPG_PATH
+# Optional variable for specifying the gnupg "home" directory:
+
+inherit sanity
+
+RPM_SIGN_PACKAGES='1'
+RPM_SIGN_FILES ?= '0'
+RPM_GPG_BACKEND ?= 'local'
+# SHA-256 is used by default
+RPM_FILE_CHECKSUM_DIGEST ?= '8'
+RPM_GPG_SIGN_CHUNK ?= "${BB_NUMBER_THREADS}"
+
+
+python () {
+ if d.getVar('RPM_GPG_PASSPHRASE_FILE'):
+ raise_sanity_error('RPM_GPG_PASSPHRASE_FILE is replaced by RPM_GPG_PASSPHRASE', d)
+ # Check configuration
+ for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'):
+ if not d.getVar(var):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+
+ if d.getVar('RPM_SIGN_FILES') == '1':
+ for var in ('RPM_FSK_PATH', 'RPM_FSK_PASSWORD'):
+ if not d.getVar(var):
+ raise_sanity_error("You need to define %s in the config" % var, d)
+}
+
+python sign_rpm () {
+ import glob
+ from oe.gpg_sign import get_signer
+
+ signer = get_signer(d, d.getVar('RPM_GPG_BACKEND'))
+ rpms = glob.glob(d.getVar('RPM_PKGWRITEDIR') + '/*')
+
+ signer.sign_rpms(rpms,
+ d.getVar('RPM_GPG_NAME'),
+ d.getVar('RPM_GPG_PASSPHRASE'),
+ d.getVar('RPM_FILE_CHECKSUM_DIGEST'),
+ int(d.getVar('RPM_GPG_SIGN_CHUNK')),
+ d.getVar('RPM_FSK_PATH'),
+ d.getVar('RPM_FSK_PASSWORD'))
+}
+
+do_package_index[depends] += "signing-keys:do_deploy"
+do_rootfs[depends] += "signing-keys:do_populate_sysroot"
+
+PACKAGE_WRITE_DEPS += "gnupg-native"
diff --git a/poky/meta/classes/siteconfig.bbclass b/poky/meta/classes/siteconfig.bbclass
new file mode 100644
index 000000000..bb491d299
--- /dev/null
+++ b/poky/meta/classes/siteconfig.bbclass
@@ -0,0 +1,33 @@
+python siteconfig_do_siteconfig () {
+ shared_state = sstate_state_fromvars(d)
+ if shared_state['task'] != 'populate_sysroot':
+ return
+ if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME'), 'site_config')):
+ bb.debug(1, "No site_config directory, skipping do_siteconfig")
+ return
+ sstate_install(shared_state, d)
+ bb.build.exec_func('do_siteconfig_gencache', d)
+ sstate_clean(shared_state, d)
+}
+
+EXTRASITECONFIG ?= ""
+
+siteconfig_do_siteconfig_gencache () {
+ mkdir -p ${WORKDIR}/site_config_${MACHINE}
+ gen-site-config ${FILE_DIRNAME}/site_config \
+ >${WORKDIR}/site_config_${MACHINE}/configure.ac
+ cd ${WORKDIR}/site_config_${MACHINE}
+ autoconf
+ rm -f ${BPN}_cache
+ CONFIG_SITE="" ${EXTRASITECONFIG} ./configure ${CONFIGUREOPTS} --cache-file ${BPN}_cache
+ sed -n -e "/ac_cv_c_bigendian/p" -e "/ac_cv_sizeof_/p" \
+ -e "/ac_cv_type_/p" -e "/ac_cv_header_/p" -e "/ac_cv_func_/p" \
+ < ${BPN}_cache > ${BPN}_config
+ mkdir -p ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
+ cp ${BPN}_config ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
+
+}
+
+do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig "
+
+EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache
diff --git a/poky/meta/classes/siteinfo.bbclass b/poky/meta/classes/siteinfo.bbclass
new file mode 100644
index 000000000..86bb853be
--- /dev/null
+++ b/poky/meta/classes/siteinfo.bbclass
@@ -0,0 +1,194 @@
+# This class exists to provide information about the targets that
+# may be needed by other classes and/or recipes. If you add a new
+# target this will probably need to be updated.
+
+#
+# Returns information about 'what' for the named target 'target'
+# where 'target' == "<arch>-<os>"
+#
+# 'what' can be one of
+# * target: Returns the target name ("<arch>-<os>")
+# * endianness: Return "be" for big endian targets, "le" for little endian
+# * bits: Returns the bit size of the target, either "32" or "64"
+# * libc: Returns the name of the c library used by the target
+#
+# It is an error for the target not to exist.
+# If 'what' doesn't exist then an empty value is returned
+#
+def siteinfo_data(d):
+ archinfo = {
+ "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch
+ "aarch64": "endian-little bit-64 arm-common arm-64",
+ "aarch64_be": "endian-big bit-64 arm-common arm-64",
+ "arm": "endian-little bit-32 arm-common arm-32",
+ "armeb": "endian-big bit-32 arm-common arm-32",
+ "avr32": "endian-big bit-32 avr32-common",
+ "bfin": "endian-little bit-32 bfin-common",
+ "epiphany": "endian-little bit-32",
+ "i386": "endian-little bit-32 ix86-common",
+ "i486": "endian-little bit-32 ix86-common",
+ "i586": "endian-little bit-32 ix86-common",
+ "i686": "endian-little bit-32 ix86-common",
+ "ia64": "endian-little bit-64",
+ "microblaze": "endian-big bit-32 microblaze-common",
+ "microblazeeb": "endian-big bit-32 microblaze-common",
+ "microblazeel": "endian-little bit-32 microblaze-common",
+ "mips": "endian-big bit-32 mips-common",
+ "mips64": "endian-big bit-64 mips-common",
+ "mips64el": "endian-little bit-64 mips-common",
+ "mipsisa64r6": "endian-big bit-64 mips-common",
+ "mipsisa64r6el": "endian-little bit-64 mips-common",
+ "mipsel": "endian-little bit-32 mips-common",
+ "mipsisa32r6": "endian-big bit-32 mips-common",
+ "mipsisa32r6el": "endian-little bit-32 mips-common",
+ "powerpc": "endian-big bit-32 powerpc-common",
+ "nios2": "endian-little bit-32 nios2-common",
+ "powerpc64": "endian-big bit-64 powerpc-common",
+ "ppc": "endian-big bit-32 powerpc-common",
+ "ppc64": "endian-big bit-64 powerpc-common",
+ "ppc64le" : "endian-little bit-64 powerpc-common",
+ "riscv32": "endian-little bit-32 riscv-common",
+ "riscv64": "endian-little bit-64 riscv-common",
+ "sh3": "endian-little bit-32 sh-common",
+ "sh4": "endian-little bit-32 sh-common",
+ "sparc": "endian-big bit-32",
+ "viac3": "endian-little bit-32 ix86-common",
+ "x86_64": "endian-little", # bitinfo specified in targetinfo
+ }
+ osinfo = {
+ "darwin": "common-darwin",
+ "darwin9": "common-darwin",
+ "linux": "common-linux common-glibc",
+ "linux-gnu": "common-linux common-glibc",
+ "linux-gnu_ilp32": "common-linux common-glibc",
+ "linux-gnux32": "common-linux common-glibc",
+ "linux-gnun32": "common-linux common-glibc",
+ "linux-gnueabi": "common-linux common-glibc",
+ "linux-gnuspe": "common-linux common-glibc",
+ "linux-musl": "common-linux common-musl",
+ "linux-muslx32": "common-linux common-musl",
+ "linux-musleabi": "common-linux common-musl",
+ "linux-muslspe": "common-linux common-musl",
+ "uclinux-uclibc": "common-uclibc",
+ "cygwin": "common-cygwin",
+ "mingw32": "common-mingw",
+ }
+ targetinfo = {
+ "aarch64-linux-gnu": "aarch64-linux",
+ "aarch64_be-linux-gnu": "aarch64_be-linux",
+ "aarch64-linux-gnu_ilp32": "bit-32 aarch64_be-linux arm-32",
+ "aarch64_be-linux-gnu_ilp32": "bit-32 aarch64_be-linux arm-32",
+ "aarch64-linux-musl": "aarch64-linux",
+ "aarch64_be-linux-musl": "aarch64_be-linux",
+ "arm-linux-gnueabi": "arm-linux",
+ "arm-linux-musleabi": "arm-linux",
+ "armeb-linux-gnueabi": "armeb-linux",
+ "armeb-linux-musleabi": "armeb-linux",
+ "microblazeeb-linux" : "microblaze-linux",
+ "microblazeeb-linux-musl" : "microblaze-linux",
+ "microblazeel-linux" : "microblaze-linux",
+ "microblazeel-linux-musl" : "microblaze-linux",
+ "mips-linux-musl": "mips-linux",
+ "mipsel-linux-musl": "mipsel-linux",
+ "mips64-linux-musl": "mips64-linux",
+ "mips64el-linux-musl": "mips64el-linux",
+ "mips64-linux-gnun32": "mips-linux bit-32",
+ "mips64el-linux-gnun32": "mipsel-linux bit-32",
+ "mipsisa64r6-linux-gnun32": "mipsisa32r6-linux bit-32",
+ "mipsisa64r6el-linux-gnun32": "mipsisa32r6el-linux bit-32",
+ "powerpc-linux": "powerpc32-linux",
+ "powerpc-linux-musl": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-gnuspe": "powerpc-linux powerpc32-linux",
+ "powerpc-linux-muslspe": "powerpc-linux powerpc32-linux",
+ "powerpc64-linux-gnuspe": "powerpc-linux powerpc64-linux",
+ "powerpc64-linux-muslspe": "powerpc-linux powerpc64-linux",
+ "powerpc64-linux": "powerpc-linux",
+ "powerpc64-linux-musl": "powerpc-linux",
+ "riscv32-linux": "riscv32-linux",
+ "riscv32-linux-musl": "riscv32-linux",
+ "riscv64-linux": "riscv64-linux",
+ "riscv64-linux-musl": "riscv64-linux",
+ "x86_64-cygwin": "bit-64",
+ "x86_64-darwin": "bit-64",
+ "x86_64-darwin9": "bit-64",
+ "x86_64-linux": "bit-64",
+ "x86_64-linux-musl": "x86_64-linux bit-64",
+ "x86_64-linux-muslx32": "bit-32 ix86-common x32-linux",
+ "x86_64-elf": "bit-64",
+ "x86_64-linux-gnu": "bit-64 x86_64-linux",
+ "x86_64-linux-gnux32": "bit-32 ix86-common x32-linux",
+ "x86_64-mingw32": "bit-64",
+ }
+
+ # Add in any extra user supplied data which may come from a BSP layer, removing the
+ # need to always change this class directly
+ extra_siteinfo = (d.getVar("SITEINFO_EXTRA_DATAFUNCS") or "").split()
+ for m in extra_siteinfo:
+ call = m + "(archinfo, osinfo, targetinfo, d)"
+ locs = { "archinfo" : archinfo, "osinfo" : osinfo, "targetinfo" : targetinfo, "d" : d}
+ archinfo, osinfo, targetinfo = bb.utils.better_eval(call, locs)
+
+ hostarch = d.getVar("HOST_ARCH")
+ hostos = d.getVar("HOST_OS")
+ target = "%s-%s" % (hostarch, hostos)
+
+ sitedata = []
+ if hostarch in archinfo:
+ sitedata.extend(archinfo[hostarch].split())
+ if hostos in osinfo:
+ sitedata.extend(osinfo[hostos].split())
+ if target in targetinfo:
+ sitedata.extend(targetinfo[target].split())
+ sitedata.append(target)
+ sitedata.append("common")
+
+ bb.debug(1, "SITE files %s" % sitedata);
+ return sitedata
+
+python () {
+ sitedata = set(siteinfo_data(d))
+ if "endian-little" in sitedata:
+ d.setVar("SITEINFO_ENDIANNESS", "le")
+ elif "endian-big" in sitedata:
+ d.setVar("SITEINFO_ENDIANNESS", "be")
+ else:
+ bb.error("Unable to determine endianness for architecture '%s'" %
+ d.getVar("HOST_ARCH"))
+ bb.fatal("Please add your architecture to siteinfo.bbclass")
+
+ if "bit-32" in sitedata:
+ d.setVar("SITEINFO_BITS", "32")
+ elif "bit-64" in sitedata:
+ d.setVar("SITEINFO_BITS", "64")
+ else:
+ bb.error("Unable to determine bit size for architecture '%s'" %
+ d.getVar("HOST_ARCH"))
+ bb.fatal("Please add your architecture to siteinfo.bbclass")
+}
+
+def siteinfo_get_files(d, sysrootcache = False):
+ sitedata = siteinfo_data(d)
+ sitefiles = ""
+ for path in d.getVar("BBPATH").split(":"):
+ for element in sitedata:
+ filename = os.path.join(path, "site", element)
+ if os.path.exists(filename):
+ sitefiles += filename + " "
+
+ if not sysrootcache:
+ return sitefiles
+
+ # Now check for siteconfig cache files in sysroots
+ path_siteconfig = d.getVar('SITECONFIG_SYSROOTCACHE')
+ if path_siteconfig and os.path.isdir(path_siteconfig):
+ for i in os.listdir(path_siteconfig):
+ if not i.endswith("_config"):
+ continue
+ filename = os.path.join(path_siteconfig, i)
+ sitefiles += filename + " "
+ return sitefiles
+
+#
+# Make some information available via variables
+#
+SITECONFIG_SYSROOTCACHE = "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
diff --git a/poky/meta/classes/spdx.bbclass b/poky/meta/classes/spdx.bbclass
new file mode 100644
index 000000000..c5f544d2a
--- /dev/null
+++ b/poky/meta/classes/spdx.bbclass
@@ -0,0 +1,364 @@
+# This class integrates real-time license scanning, generation of SPDX standard
+# output and verifiying license info during the building process.
+# It is a combination of efforts from the OE-Core, SPDX and Fossology projects.
+#
+# For more information on FOSSology:
+# http://www.fossology.org
+#
+# For more information on FOSSologySPDX commandline:
+# https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-SPDX-Web-API
+#
+# For more information on SPDX:
+# http://www.spdx.org
+#
+
+# SPDX file will be output to the path which is defined as[SPDX_MANIFEST_DIR]
+# in ./meta/conf/licenses.conf.
+
+SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
+
+# If ${S} isn't actually the top-level source directory, set SPDX_S to point at
+# the real top-level directory.
+SPDX_S ?= "${S}"
+
+python do_spdx () {
+ import os, sys
+ import json, shutil
+
+ info = {}
+ info['workdir'] = d.getVar('WORKDIR')
+ info['sourcedir'] = d.getVar('SPDX_S')
+ info['pn'] = d.getVar('PN')
+ info['pv'] = d.getVar('PV')
+ info['spdx_version'] = d.getVar('SPDX_VERSION')
+ info['data_license'] = d.getVar('DATA_LICENSE')
+
+ sstatedir = d.getVar('SPDXSSTATEDIR')
+ sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] + ".spdx")
+
+ manifest_dir = d.getVar('SPDX_MANIFEST_DIR')
+ info['outfile'] = os.path.join(manifest_dir, info['pn'] + ".spdx" )
+
+ info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR')
+ info['tar_file'] = os.path.join(info['workdir'], info['pn'] + ".tar.gz" )
+
+ # Make sure important dirs exist
+ try:
+ bb.utils.mkdirhier(manifest_dir)
+ bb.utils.mkdirhier(sstatedir)
+ bb.utils.mkdirhier(info['spdx_temp_dir'])
+ except OSError as e:
+ bb.error("SPDX: Could not set up required directories: " + str(e))
+ return
+
+ ## get everything from cache. use it to decide if
+ ## something needs to be rerun
+ cur_ver_code = get_ver_code(info['sourcedir'])
+ cache_cur = False
+ if os.path.exists(sstatefile):
+ ## cache for this package exists. read it in
+ cached_spdx = get_cached_spdx(sstatefile)
+
+ if cached_spdx['PackageVerificationCode'] == cur_ver_code:
+ bb.warn("SPDX: Verification code for " + info['pn']
+ + "is same as cache's. do nothing")
+ cache_cur = True
+ else:
+ local_file_info = setup_foss_scan(info, True, cached_spdx['Files'])
+ else:
+ local_file_info = setup_foss_scan(info, False, None)
+
+ if cache_cur:
+ spdx_file_info = cached_spdx['Files']
+ foss_package_info = cached_spdx['Package']
+ foss_license_info = cached_spdx['Licenses']
+ else:
+ ## setup fossology command
+ foss_server = d.getVar('FOSS_SERVER')
+ foss_flags = d.getVar('FOSS_WGET_FLAGS')
+ foss_full_spdx = d.getVar('FOSS_FULL_SPDX') == "true" or False
+ foss_command = "wget %s --post-file=%s %s"\
+ % (foss_flags, info['tar_file'], foss_server)
+
+ foss_result = run_fossology(foss_command, foss_full_spdx)
+ if foss_result is not None:
+ (foss_package_info, foss_file_info, foss_license_info) = foss_result
+ spdx_file_info = create_spdx_doc(local_file_info, foss_file_info)
+ ## write to cache
+ write_cached_spdx(sstatefile, cur_ver_code, foss_package_info,
+ spdx_file_info, foss_license_info)
+ else:
+ bb.error("SPDX: Could not communicate with FOSSology server. Command was: " + foss_command)
+ return
+
+ ## Get document and package level information
+ spdx_header_info = get_header_info(info, cur_ver_code, foss_package_info)
+
+ ## CREATE MANIFEST
+ create_manifest(info, spdx_header_info, spdx_file_info, foss_license_info)
+
+ ## clean up the temp stuff
+ shutil.rmtree(info['spdx_temp_dir'], ignore_errors=True)
+ if os.path.exists(info['tar_file']):
+ remove_file(info['tar_file'])
+}
+addtask spdx after do_patch before do_configure
+
+def create_manifest(info, header, files, licenses):
+ import codecs
+ with codecs.open(info['outfile'], mode='w', encoding='utf-8') as f:
+ # Write header
+ f.write(header + '\n')
+
+ # Write file data
+ for chksum, block in files.iteritems():
+ f.write("FileName: " + block['FileName'] + '\n')
+ for key, value in block.iteritems():
+ if not key == 'FileName':
+ f.write(key + ": " + value + '\n')
+ f.write('\n')
+
+ # Write license data
+ for id, block in licenses.iteritems():
+ f.write("LicenseID: " + id + '\n')
+ for key, value in block.iteritems():
+ f.write(key + ": " + value + '\n')
+ f.write('\n')
+
+def get_cached_spdx(sstatefile):
+ import json
+ import codecs
+ cached_spdx_info = {}
+ with codecs.open(sstatefile, mode='r', encoding='utf-8') as f:
+ try:
+ cached_spdx_info = json.load(f)
+ except ValueError as e:
+ cached_spdx_info = None
+ return cached_spdx_info
+
+def write_cached_spdx(sstatefile, ver_code, package_info, files, license_info):
+ import json
+ import codecs
+ spdx_doc = {}
+ spdx_doc['PackageVerificationCode'] = ver_code
+ spdx_doc['Files'] = {}
+ spdx_doc['Files'] = files
+ spdx_doc['Package'] = {}
+ spdx_doc['Package'] = package_info
+ spdx_doc['Licenses'] = {}
+ spdx_doc['Licenses'] = license_info
+ with codecs.open(sstatefile, mode='w', encoding='utf-8') as f:
+ f.write(json.dumps(spdx_doc))
+
+def setup_foss_scan(info, cache, cached_files):
+ import errno, shutil
+ import tarfile
+ file_info = {}
+ cache_dict = {}
+
+ for f_dir, f in list_files(info['sourcedir']):
+ full_path = os.path.join(f_dir, f)
+ abs_path = os.path.join(info['sourcedir'], full_path)
+ dest_dir = os.path.join(info['spdx_temp_dir'], f_dir)
+ dest_path = os.path.join(info['spdx_temp_dir'], full_path)
+
+ checksum = hash_file(abs_path)
+ if not checksum is None:
+ file_info[checksum] = {}
+ ## retain cache information if it exists
+ if cache and checksum in cached_files:
+ file_info[checksum] = cached_files[checksum]
+ ## have the file included in what's sent to the FOSSology server
+ else:
+ file_info[checksum]['FileName'] = full_path
+ try:
+ bb.utils.mkdirhier(dest_dir)
+ shutil.copyfile(abs_path, dest_path)
+ except OSError as e:
+ bb.warn("SPDX: mkdirhier failed: " + str(e))
+ except shutil.Error as e:
+ bb.warn("SPDX: copyfile failed: " + str(e))
+ except IOError as e:
+ bb.warn("SPDX: copyfile failed: " + str(e))
+ else:
+ bb.warn("SPDX: Could not get checksum for file: " + f)
+
+ with tarfile.open(info['tar_file'], "w:gz") as tar:
+ tar.add(info['spdx_temp_dir'], arcname=os.path.basename(info['spdx_temp_dir']))
+
+ return file_info
+
+def remove_file(file_name):
+ try:
+ os.remove(file_name)
+ except OSError as e:
+ pass
+
+def list_files(dir):
+ for root, subFolders, files in os.walk(dir):
+ for f in files:
+ rel_root = os.path.relpath(root, dir)
+ yield rel_root, f
+ return
+
+def hash_file(file_name):
+ try:
+ with open(file_name, 'rb') as f:
+ data_string = f.read()
+ sha1 = hash_string(data_string)
+ return sha1
+ except:
+ return None
+
+def hash_string(data):
+ import hashlib
+ sha1 = hashlib.sha1()
+ sha1.update(data)
+ return sha1.hexdigest()
+
+def run_fossology(foss_command, full_spdx):
+ import string, re
+ import subprocess
+
+ try:
+ foss_output = subprocess.check_output(foss_command.split(),
+ stderr=subprocess.STDOUT).decode('utf-8')
+ except subprocess.CalledProcessError as e:
+ return None
+
+ foss_output = string.replace(foss_output, '\r', '')
+
+ # Package info
+ package_info = {}
+ if full_spdx:
+ # All mandatory, only one occurrence
+ package_info['PackageCopyrightText'] = re.findall('PackageCopyrightText: (.*?</text>)', foss_output, re.S)[0]
+ package_info['PackageLicenseDeclared'] = re.findall('PackageLicenseDeclared: (.*)', foss_output)[0]
+ package_info['PackageLicenseConcluded'] = re.findall('PackageLicenseConcluded: (.*)', foss_output)[0]
+ # These may be more than one
+ package_info['PackageLicenseInfoFromFiles'] = re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output)
+ else:
+ DEFAULT = "NOASSERTION"
+ package_info['PackageCopyrightText'] = "<text>" + DEFAULT + "</text>"
+ package_info['PackageLicenseDeclared'] = DEFAULT
+ package_info['PackageLicenseConcluded'] = DEFAULT
+ package_info['PackageLicenseInfoFromFiles'] = []
+
+ # File info
+ file_info = {}
+ records = []
+ # FileName is also in PackageFileName, so we match on FileType as well.
+ records = re.findall('FileName:.*?FileType:.*?</text>', foss_output, re.S)
+ for rec in records:
+ chksum = re.findall('FileChecksum: SHA1: (.*)\n', rec)[0]
+ file_info[chksum] = {}
+ file_info[chksum]['FileCopyrightText'] = re.findall('FileCopyrightText: '
+ + '(.*?</text>)', rec, re.S )[0]
+ fields = ['FileName', 'FileType', 'LicenseConcluded', 'LicenseInfoInFile']
+ for field in fields:
+ file_info[chksum][field] = re.findall(field + ': (.*)', rec)[0]
+
+ # Licenses
+ license_info = {}
+ licenses = []
+ licenses = re.findall('LicenseID:.*?LicenseName:.*?\n', foss_output, re.S)
+ for lic in licenses:
+ license_id = re.findall('LicenseID: (.*)\n', lic)[0]
+ license_info[license_id] = {}
+ license_info[license_id]['ExtractedText'] = re.findall('ExtractedText: (.*?</text>)', lic, re.S)[0]
+ license_info[license_id]['LicenseName'] = re.findall('LicenseName: (.*)', lic)[0]
+
+ return (package_info, file_info, license_info)
+
+def create_spdx_doc(file_info, scanned_files):
+ import json
+ ## push foss changes back into cache
+ for chksum, lic_info in scanned_files.iteritems():
+ if chksum in file_info:
+ file_info[chksum]['FileType'] = lic_info['FileType']
+ file_info[chksum]['FileChecksum: SHA1'] = chksum
+ file_info[chksum]['LicenseInfoInFile'] = lic_info['LicenseInfoInFile']
+ file_info[chksum]['LicenseConcluded'] = lic_info['LicenseConcluded']
+ file_info[chksum]['FileCopyrightText'] = lic_info['FileCopyrightText']
+ else:
+ bb.warn("SPDX: " + lic_info['FileName'] + " : " + chksum
+ + " : is not in the local file info: "
+ + json.dumps(lic_info, indent=1))
+ return file_info
+
+def get_ver_code(dirname):
+ chksums = []
+ for f_dir, f in list_files(dirname):
+ hash = hash_file(os.path.join(dirname, f_dir, f))
+ if not hash is None:
+ chksums.append(hash)
+ else:
+ bb.warn("SPDX: Could not hash file: " + path)
+ ver_code_string = ''.join(chksums).lower()
+ ver_code = hash_string(ver_code_string)
+ return ver_code
+
+def get_header_info(info, spdx_verification_code, package_info):
+ """
+ Put together the header SPDX information.
+ Eventually this needs to become a lot less
+ of a hardcoded thing.
+ """
+ from datetime import datetime
+ import os
+ head = []
+ DEFAULT = "NOASSERTION"
+
+ package_checksum = hash_file(info['tar_file'])
+ if package_checksum is None:
+ package_checksum = DEFAULT
+
+ ## document level information
+ head.append("## SPDX Document Information")
+ head.append("SPDXVersion: " + info['spdx_version'])
+ head.append("DataLicense: " + info['data_license'])
+ head.append("DocumentComment: <text>SPDX for "
+ + info['pn'] + " version " + info['pv'] + "</text>")
+ head.append("")
+
+ ## Creator information
+ ## Note that this does not give time in UTC.
+ now = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
+ head.append("## Creation Information")
+ ## Tools are supposed to have a version, but FOSSology+SPDX provides none.
+ head.append("Creator: Tool: FOSSology+SPDX")
+ head.append("Created: " + now)
+ head.append("CreatorComment: <text>UNO</text>")
+ head.append("")
+
+ ## package level information
+ head.append("## Package Information")
+ head.append("PackageName: " + info['pn'])
+ head.append("PackageVersion: " + info['pv'])
+ head.append("PackageFileName: " + os.path.basename(info['tar_file']))
+ head.append("PackageSupplier: Person:" + DEFAULT)
+ head.append("PackageDownloadLocation: " + DEFAULT)
+ head.append("PackageSummary: <text></text>")
+ head.append("PackageOriginator: Person:" + DEFAULT)
+ head.append("PackageChecksum: SHA1: " + package_checksum)
+ head.append("PackageVerificationCode: " + spdx_verification_code)
+ head.append("PackageDescription: <text>" + info['pn']
+ + " version " + info['pv'] + "</text>")
+ head.append("")
+ head.append("PackageCopyrightText: "
+ + package_info['PackageCopyrightText'])
+ head.append("")
+ head.append("PackageLicenseDeclared: "
+ + package_info['PackageLicenseDeclared'])
+ head.append("PackageLicenseConcluded: "
+ + package_info['PackageLicenseConcluded'])
+
+ for licref in package_info['PackageLicenseInfoFromFiles']:
+ head.append("PackageLicenseInfoFromFiles: " + licref)
+ head.append("")
+
+ ## header for file level
+ head.append("## File Information")
+ head.append("")
+
+ return '\n'.join(head)
diff --git a/poky/meta/classes/sstate.bbclass b/poky/meta/classes/sstate.bbclass
new file mode 100644
index 000000000..0b2885014
--- /dev/null
+++ b/poky/meta/classes/sstate.bbclass
@@ -0,0 +1,1070 @@
+SSTATE_VERSION = "3"
+
+SSTATE_MANIFESTS ?= "${TMPDIR}/sstate-control"
+SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
+
+def generate_sstatefn(spec, hash, d):
+ if not hash:
+ hash = "INVALID"
+ return hash[:2] + "/" + spec + hash
+
+SSTATE_PKGARCH = "${PACKAGE_ARCH}"
+SSTATE_PKGSPEC = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
+SSTATE_SWSPEC = "sstate:${PN}::${PV}:${PR}::${SSTATE_VERSION}:"
+SSTATE_PKGNAME = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC'), d.getVar('BB_TASKHASH'), d)}"
+SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
+SSTATE_EXTRAPATH = ""
+SSTATE_EXTRAPATHWILDCARD = ""
+SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
+
+# explicitly make PV to depend on evaluated value of PV variable
+PV[vardepvalue] = "${PV}"
+
+# We don't want the sstate to depend on things like the distro string
+# of the system, we let the sstate paths take care of this.
+SSTATE_EXTRAPATH[vardepvalue] = ""
+
+# For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical)
+SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"
+# Avoid docbook/sgml catalog warnings for now
+SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
+# sdk-provides-dummy-nativesdk and nativesdk-buildtools-perl-dummy overlap for different SDKMACHINE
+SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/sdk_provides_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-nativesdk/"
+SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/buildtools_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/buildtools-dummy-nativesdk/"
+# Archive the sources for many architectures in one deploy folder
+SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
+
+SSTATE_SCAN_FILES ?= "*.la *-config *_config postinst-*"
+SSTATE_SCAN_CMD ??= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES").split())}" \) -type f'
+SSTATE_SCAN_CMD_NATIVE ??= 'grep -Irl -e ${RECIPE_SYSROOT} -e ${RECIPE_SYSROOT_NATIVE} -e ${HOSTTOOLS_DIR} ${SSTATE_BUILDDIR}'
+
+BB_HASHFILENAME = "False ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}"
+
+SSTATE_ARCHS = " \
+ ${BUILD_ARCH} \
+ ${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
+ ${BUILD_ARCH}_${TARGET_ARCH} \
+ ${SDK_ARCH}_${SDK_OS} \
+ ${SDK_ARCH}_${PACKAGE_ARCH} \
+ allarch \
+ ${PACKAGE_ARCH} \
+ ${PACKAGE_EXTRA_ARCHS} \
+ ${MACHINE_ARCH}"
+
+SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
+
+SSTATECREATEFUNCS = "sstate_hardcode_path"
+SSTATEPOSTCREATEFUNCS = ""
+SSTATEPREINSTFUNCS = ""
+SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
+SSTATEPOSTINSTFUNCS = ""
+EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR"
+SSTATECLEANFUNCS = ""
+
+# Check whether sstate exists for tasks that support sstate and are in the
+# locked signatures file.
+SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK ?= 'error'
+
+# Check whether the task's computed hash matches the task's hash in the
+# locked signatures file.
+SIGGEN_LOCKEDSIGS_TASKSIG_CHECK ?= "error"
+
+# The GnuPG key ID and passphrase to use to sign sstate archives (or unset to
+# not sign)
+SSTATE_SIG_KEY ?= ""
+SSTATE_SIG_PASSPHRASE ?= ""
+# Whether to verify the GnUPG signatures when extracting sstate archives
+SSTATE_VERIFY_SIG ?= "0"
+
+python () {
+ if bb.data.inherits_class('native', d):
+ d.setVar('SSTATE_PKGARCH', d.getVar('BUILD_ARCH', False))
+ elif bb.data.inherits_class('crosssdk', d):
+ d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"))
+ elif bb.data.inherits_class('cross', d):
+ d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${TARGET_ARCH}"))
+ elif bb.data.inherits_class('nativesdk', d):
+ d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${SDK_OS}"))
+ elif bb.data.inherits_class('cross-canadian', d):
+ d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
+ elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
+ d.setVar('SSTATE_PKGARCH', "allarch")
+ else:
+ d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
+
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d):
+ d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
+ d.setVar('BB_HASHFILENAME', "True ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}")
+ d.setVar('SSTATE_EXTRAPATHWILDCARD', "*/")
+
+ unique_tasks = sorted(set((d.getVar('SSTATETASKS') or "").split()))
+ d.setVar('SSTATETASKS', " ".join(unique_tasks))
+ for task in unique_tasks:
+ d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
+ d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
+}
+
+def sstate_init(task, d):
+ ss = {}
+ ss['task'] = task
+ ss['dirs'] = []
+ ss['plaindirs'] = []
+ ss['lockfiles'] = []
+ ss['lockfiles-shared'] = []
+ return ss
+
+def sstate_state_fromvars(d, task = None):
+ if task is None:
+ task = d.getVar('BB_CURRENTTASK')
+ if not task:
+ bb.fatal("sstate code running without task context?!")
+ task = task.replace("_setscene", "")
+
+ if task.startswith("do_"):
+ task = task[3:]
+ inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs') or "").split()
+ outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs') or "").split()
+ plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs') or "").split()
+ lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile') or "").split()
+ lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared') or "").split()
+ interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs') or "").split()
+ fixmedir = d.getVarFlag("do_" + task, 'sstate-fixmedir') or ""
+ if not task or len(inputs) != len(outputs):
+ bb.fatal("sstate variables not setup correctly?!")
+
+ if task == "populate_lic":
+ d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
+ d.setVar("SSTATE_EXTRAPATH", "")
+ d.setVar('SSTATE_EXTRAPATHWILDCARD', "")
+
+ ss = sstate_init(task, d)
+ for i in range(len(inputs)):
+ sstate_add(ss, inputs[i], outputs[i], d)
+ ss['lockfiles'] = lockfiles
+ ss['lockfiles-shared'] = lockfilesshared
+ ss['plaindirs'] = plaindirs
+ ss['interceptfuncs'] = interceptfuncs
+ ss['fixmedir'] = fixmedir
+ return ss
+
+def sstate_add(ss, source, dest, d):
+ if not source.endswith("/"):
+ source = source + "/"
+ if not dest.endswith("/"):
+ dest = dest + "/"
+ source = os.path.normpath(source)
+ dest = os.path.normpath(dest)
+ srcbase = os.path.basename(source)
+ ss['dirs'].append([srcbase, source, dest])
+ return ss
+
+def sstate_install(ss, d):
+ import oe.path
+ import oe.sstatesig
+ import subprocess
+
+ sharedfiles = []
+ shareddirs = []
+ bb.utils.mkdirhier(d.expand("${SSTATE_MANIFESTS}"))
+
+ sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+
+ manifest, d2 = oe.sstatesig.sstate_get_manifest_filename(ss['task'], d)
+
+ if os.access(manifest, os.R_OK):
+ bb.fatal("Package already staged (%s)?!" % manifest)
+
+ d.setVar("SSTATE_INST_POSTRM", manifest + ".postrm")
+
+ locks = []
+ for lock in ss['lockfiles-shared']:
+ locks.append(bb.utils.lockfile(lock, True))
+ for lock in ss['lockfiles']:
+ locks.append(bb.utils.lockfile(lock))
+
+ for state in ss['dirs']:
+ bb.debug(2, "Staging files from %s to %s" % (state[1], state[2]))
+ for walkroot, dirs, files in os.walk(state[1]):
+ for file in files:
+ srcpath = os.path.join(walkroot, file)
+ dstpath = srcpath.replace(state[1], state[2])
+ #bb.debug(2, "Staging %s to %s" % (srcpath, dstpath))
+ sharedfiles.append(dstpath)
+ for dir in dirs:
+ srcdir = os.path.join(walkroot, dir)
+ dstdir = srcdir.replace(state[1], state[2])
+ #bb.debug(2, "Staging %s to %s" % (srcdir, dstdir))
+ if os.path.islink(srcdir):
+ sharedfiles.append(dstdir)
+ continue
+ if not dstdir.endswith("/"):
+ dstdir = dstdir + "/"
+ shareddirs.append(dstdir)
+
+ # Check the file list for conflicts against files which already exist
+ whitelist = (d.getVar("SSTATE_DUPWHITELIST") or "").split()
+ match = []
+ for f in sharedfiles:
+ if os.path.exists(f) and not os.path.islink(f):
+ f = os.path.normpath(f)
+ realmatch = True
+ for w in whitelist:
+ w = os.path.normpath(w)
+ if f.startswith(w):
+ realmatch = False
+ break
+ if realmatch:
+ match.append(f)
+ sstate_search_cmd = "grep -rlF '%s' %s --exclude=master.list | sed -e 's:^.*/::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
+ search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
+ if search_output:
+ match.append(" (matched in %s)" % search_output.decode('utf-8').rstrip())
+ else:
+ match.append(" (not matched to any task)")
+ if match:
+ bb.error("The recipe %s is trying to install files into a shared " \
+ "area when those files already exist. Those files and their manifest " \
+ "location are:\n %s\nPlease verify which recipe should provide the " \
+ "above files.\n\nThe build has stopped, as continuing in this scenario WILL " \
+ "break things - if not now, possibly in the future (we've seen builds fail " \
+ "several months later). If the system knew how to recover from this " \
+ "automatically it would, however there are several different scenarios " \
+ "which can result in this and we don't know which one this is. It may be " \
+ "you have switched providers of something like virtual/kernel (e.g. from " \
+ "linux-yocto to linux-yocto-dev), in that case you need to execute the " \
+ "clean task for both recipes and it will resolve this error. It may be " \
+ "you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning " \
+ "those recipes should again resolve this error, however switching " \
+ "DISTRO_FEATURES on an existing build directory is not supported - you " \
+ "should really clean out tmp and rebuild (reusing sstate should be safe). " \
+ "It could be the overlapping files detected are harmless in which case " \
+ "adding them to SSTATE_DUPWHITELIST may be the correct solution. It could " \
+ "also be your build is including two different conflicting versions of " \
+ "things (e.g. bluez 4 and bluez 5 and the correct solution for that would " \
+ "be to resolve the conflict. If in doubt, please ask on the mailing list, " \
+ "sharing the error and filelist above." % \
+ (d.getVar('PN'), "\n ".join(match)))
+ bb.fatal("If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.")
+
+ if ss['fixmedir'] and os.path.exists(ss['fixmedir'] + "/fixmepath.cmd"):
+ sharedfiles.append(ss['fixmedir'] + "/fixmepath.cmd")
+ sharedfiles.append(ss['fixmedir'] + "/fixmepath")
+
+ # Write out the manifest
+ f = open(manifest, "w")
+ for file in sharedfiles:
+ f.write(file + "\n")
+
+ # We want to ensure that directories appear at the end of the manifest
+ # so that when we test to see if they should be deleted any contents
+ # added by the task will have been removed first.
+ dirs = sorted(shareddirs, key=len)
+ # Must remove children first, which will have a longer path than the parent
+ for di in reversed(dirs):
+ f.write(di + "\n")
+ f.close()
+
+ # Append to the list of manifests for this PACKAGE_ARCH
+
+ i = d2.expand("${SSTATE_MANIFESTS}/index-${SSTATE_MANMACH}")
+ l = bb.utils.lockfile(i + ".lock")
+ filedata = d.getVar("STAMP") + " " + d2.getVar("SSTATE_MANFILEPREFIX") + " " + d.getVar("WORKDIR") + "\n"
+ manifests = []
+ if os.path.exists(i):
+ with open(i, "r") as f:
+ manifests = f.readlines()
+ if filedata not in manifests:
+ with open(i, "a+") as f:
+ f.write(filedata)
+ bb.utils.unlockfile(l)
+
+ # Run the actual file install
+ for state in ss['dirs']:
+ if os.path.exists(state[1]):
+ oe.path.copyhardlinktree(state[1], state[2])
+
+ for postinst in (d.getVar('SSTATEPOSTINSTFUNCS') or '').split():
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(postinst, d, (sstateinst,))
+
+ for lock in locks:
+ bb.utils.unlockfile(lock)
+
+sstate_install[vardepsexclude] += "SSTATE_DUPWHITELIST STATE_MANMACH SSTATE_MANFILEPREFIX"
+sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}"
+
+def sstate_installpkg(ss, d):
+ from oe.gpg_sign import get_signer
+
+ sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+ sstatefetch = d.getVar('SSTATE_PKGNAME') + '_' + ss['task'] + ".tgz"
+ sstatepkg = d.getVar('SSTATE_PKG') + '_' + ss['task'] + ".tgz"
+
+ if not os.path.exists(sstatepkg):
+ pstaging_fetch(sstatefetch, sstatepkg, d)
+
+ if not os.path.isfile(sstatepkg):
+ bb.note("Staging package %s does not exist" % sstatepkg)
+ return False
+
+ sstate_clean(ss, d)
+
+ d.setVar('SSTATE_INSTDIR', sstateinst)
+ d.setVar('SSTATE_PKG', sstatepkg)
+
+ if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
+ signer = get_signer(d, 'local')
+ if not signer.verify(sstatepkg + '.sig'):
+ bb.warn("Cannot verify signature on sstate package %s" % sstatepkg)
+
+ # Empty sstateinst directory, ensure its clean
+ if os.path.exists(sstateinst):
+ oe.path.remove(sstateinst)
+ bb.utils.mkdirhier(sstateinst)
+
+ sstateinst = d.getVar("SSTATE_INSTDIR")
+ d.setVar('SSTATE_FIXMEDIR', ss['fixmedir'])
+
+ for f in (d.getVar('SSTATEPREINSTFUNCS') or '').split() + ['sstate_unpack_package']:
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(f, d, (sstateinst,))
+
+ return sstate_installpkgdir(ss, d)
+
+def sstate_installpkgdir(ss, d):
+ import oe.path
+ import subprocess
+
+ sstateinst = d.getVar("SSTATE_INSTDIR")
+ d.setVar('SSTATE_FIXMEDIR', ss['fixmedir'])
+
+ for f in (d.getVar('SSTATEPOSTUNPACKFUNCS') or '').split():
+ # All hooks should run in the SSTATE_INSTDIR
+ bb.build.exec_func(f, d, (sstateinst,))
+
+ def prepdir(dir):
+ # remove dir if it exists, ensure any parent directories do exist
+ if os.path.exists(dir):
+ oe.path.remove(dir)
+ bb.utils.mkdirhier(dir)
+ oe.path.remove(dir)
+
+ for state in ss['dirs']:
+ prepdir(state[1])
+ os.rename(sstateinst + state[0], state[1])
+ sstate_install(ss, d)
+
+ for plain in ss['plaindirs']:
+ workdir = d.getVar('WORKDIR')
+ src = sstateinst + "/" + plain.replace(workdir, '')
+ dest = plain
+ bb.utils.mkdirhier(src)
+ prepdir(dest)
+ os.rename(src, dest)
+
+ return True
+
+python sstate_hardcode_path_unpack () {
+ # Fixup hardcoded paths
+ #
+ # Note: The logic below must match the reverse logic in
+ # sstate_hardcode_path(d)
+ import subprocess
+
+ sstateinst = d.getVar('SSTATE_INSTDIR')
+ sstatefixmedir = d.getVar('SSTATE_FIXMEDIR')
+ fixmefn = sstateinst + "fixmepath"
+ if os.path.isfile(fixmefn):
+ staging_target = d.getVar('RECIPE_SYSROOT')
+ staging_host = d.getVar('RECIPE_SYSROOT_NATIVE')
+
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross-canadian', d):
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRHOST:%s:g'" % (staging_host)
+ elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (staging_target, staging_host)
+ else:
+ sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g'" % (staging_target)
+
+ extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES') or ''
+ for fixmevar in extra_staging_fixmes.split():
+ fixme_path = d.getVar(fixmevar)
+ sstate_sed_cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
+
+ # Add sstateinst to each filename in fixmepath, use xargs to efficiently call sed
+ sstate_hardcode_cmd = "sed -e 's:^:%s:g' %s | xargs %s" % (sstateinst, fixmefn, sstate_sed_cmd)
+
+ # Defer do_populate_sysroot relocation command
+ if sstatefixmedir:
+ bb.utils.mkdirhier(sstatefixmedir)
+ with open(sstatefixmedir + "/fixmepath.cmd", "w") as f:
+ sstate_hardcode_cmd = sstate_hardcode_cmd.replace(fixmefn, sstatefixmedir + "/fixmepath")
+ sstate_hardcode_cmd = sstate_hardcode_cmd.replace(sstateinst, "FIXMEFINALSSTATEINST")
+ sstate_hardcode_cmd = sstate_hardcode_cmd.replace(staging_host, "FIXMEFINALSSTATEHOST")
+ sstate_hardcode_cmd = sstate_hardcode_cmd.replace(staging_target, "FIXMEFINALSSTATETARGET")
+ f.write(sstate_hardcode_cmd)
+ bb.utils.copyfile(fixmefn, sstatefixmedir + "/fixmepath")
+ return
+
+ bb.note("Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd))
+ subprocess.check_call(sstate_hardcode_cmd, shell=True)
+
+ # Need to remove this or we'd copy it into the target directory and may
+ # conflict with another writer
+ os.remove(fixmefn)
+}
+
+def sstate_clean_cachefile(ss, d):
+ import oe.path
+
+ sstatepkgfile = d.getVar('SSTATE_PATHSPEC') + "*_" + ss['task'] + ".tgz*"
+ bb.note("Removing %s" % sstatepkgfile)
+ oe.path.remove(sstatepkgfile)
+
+def sstate_clean_cachefiles(d):
+ for task in (d.getVar('SSTATETASKS') or "").split():
+ ld = d.createCopy()
+ ss = sstate_state_fromvars(ld, task)
+ sstate_clean_cachefile(ss, ld)
+
+def sstate_clean_manifest(manifest, d, prefix=None):
+ import oe.path
+
+ mfile = open(manifest)
+ entries = mfile.readlines()
+ mfile.close()
+
+ for entry in entries:
+ entry = entry.strip()
+ if prefix and not entry.startswith("/"):
+ entry = prefix + "/" + entry
+ bb.debug(2, "Removing manifest: %s" % entry)
+ # We can race against another package populating directories as we're removing them
+ # so we ignore errors here.
+ try:
+ if entry.endswith("/"):
+ if os.path.islink(entry[:-1]):
+ os.remove(entry[:-1])
+ elif os.path.exists(entry) and len(os.listdir(entry)) == 0:
+ os.rmdir(entry[:-1])
+ else:
+ os.remove(entry)
+ except OSError:
+ pass
+
+ postrm = manifest + ".postrm"
+ if os.path.exists(manifest + ".postrm"):
+ import subprocess
+ os.chmod(postrm, 0o755)
+ subprocess.check_call(postrm, shell=True)
+ oe.path.remove(postrm)
+
+ oe.path.remove(manifest)
+
+def sstate_clean(ss, d):
+ import oe.path
+ import glob
+
+ d2 = d.createCopy()
+ stamp_clean = d.getVar("STAMPCLEAN")
+ extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info')
+ if extrainf:
+ d2.setVar("SSTATE_MANMACH", extrainf)
+ wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
+ else:
+ wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
+
+ manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
+
+ if os.path.exists(manifest):
+ locks = []
+ for lock in ss['lockfiles-shared']:
+ locks.append(bb.utils.lockfile(lock))
+ for lock in ss['lockfiles']:
+ locks.append(bb.utils.lockfile(lock))
+
+ sstate_clean_manifest(manifest, d)
+
+ for lock in locks:
+ bb.utils.unlockfile(lock)
+
+ # Remove the current and previous stamps, but keep the sigdata.
+ #
+ # The glob() matches do_task* which may match multiple tasks, for
+ # example: do_package and do_package_write_ipk, so we need to
+ # exactly match *.do_task.* and *.do_task_setscene.*
+ rm_stamp = '.do_%s.' % ss['task']
+ rm_setscene = '.do_%s_setscene.' % ss['task']
+ # For BB_SIGNATURE_HANDLER = "noop"
+ rm_nohash = ".do_%s" % ss['task']
+ for stfile in glob.glob(wildcard_stfile):
+ # Keep the sigdata
+ if ".sigdata." in stfile or ".sigbasedata." in stfile:
+ continue
+ # Preserve taint files in the stamps directory
+ if stfile.endswith('.taint'):
+ continue
+ if rm_stamp in stfile or rm_setscene in stfile or \
+ stfile.endswith(rm_nohash):
+ oe.path.remove(stfile)
+
+ # Removes the users/groups created by the package
+ for cleanfunc in (d.getVar('SSTATECLEANFUNCS') or '').split():
+ bb.build.exec_func(cleanfunc, d)
+
+sstate_clean[vardepsexclude] = "SSTATE_MANFILEPREFIX"
+
+CLEANFUNCS += "sstate_cleanall"
+
+python sstate_cleanall() {
+ bb.note("Removing shared state for package %s" % d.getVar('PN'))
+
+ manifest_dir = d.getVar('SSTATE_MANIFESTS')
+ if not os.path.exists(manifest_dir):
+ return
+
+ tasks = d.getVar('SSTATETASKS').split()
+ for name in tasks:
+ ld = d.createCopy()
+ shared_state = sstate_state_fromvars(ld, name)
+ sstate_clean(shared_state, ld)
+}
+
+python sstate_hardcode_path () {
+ import subprocess, platform
+
+ # Need to remove hardcoded paths and fix these when we install the
+ # staging packages.
+ #
+ # Note: the logic in this function needs to match the reverse logic
+ # in sstate_installpkg(ss, d)
+
+ staging_target = d.getVar('RECIPE_SYSROOT')
+ staging_host = d.getVar('RECIPE_SYSROOT_NATIVE')
+ sstate_builddir = d.getVar('SSTATE_BUILDDIR')
+
+ sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % staging_host
+ if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross-canadian', d):
+ sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
+ elif bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d):
+ sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging_host)
+ sstate_sed_cmd += " -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % staging_target
+ else:
+ sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging_host)
+ sstate_sed_cmd += " -e 's:%s:FIXMESTAGINGDIRTARGET:g'" % staging_target
+
+ extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES') or ''
+ for fixmevar in extra_staging_fixmes.split():
+ fixme_path = d.getVar(fixmevar)
+ sstate_sed_cmd += " -e 's:%s:FIXME_%s:g'" % (fixme_path, fixmevar)
+ sstate_grep_cmd += " -e '%s'" % (fixme_path)
+
+ fixmefn = sstate_builddir + "fixmepath"
+
+ sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD')
+ sstate_filelist_cmd = "tee %s" % (fixmefn)
+
+ # fixmepath file needs relative paths, drop sstate_builddir prefix
+ sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %s" % (sstate_builddir, fixmefn)
+
+ xargs_no_empty_run_cmd = '--no-run-if-empty'
+ if platform.system() == 'Darwin':
+ xargs_no_empty_run_cmd = ''
+
+ # Limit the fixpaths and sed operations based on the initial grep search
+ # This has the side effect of making sure the vfs cache is hot
+ sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, xargs_no_empty_run_cmd, sstate_sed_cmd)
+
+ bb.note("Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd))
+ subprocess.check_output(sstate_hardcode_cmd, shell=True, cwd=sstate_builddir)
+
+ # If the fixmefn is empty, remove it..
+ if os.stat(fixmefn).st_size == 0:
+ os.remove(fixmefn)
+ else:
+ bb.note("Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd))
+ subprocess.check_output(sstate_filelist_relative_cmd, shell=True)
+}
+
+def sstate_package(ss, d):
+ import oe.path
+
+ tmpdir = d.getVar('TMPDIR')
+
+ sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
+ sstatepkg = d.getVar('SSTATE_PKG') + '_'+ ss['task'] + ".tgz"
+ bb.utils.remove(sstatebuild, recurse=True)
+ bb.utils.mkdirhier(sstatebuild)
+ bb.utils.mkdirhier(os.path.dirname(sstatepkg))
+ for state in ss['dirs']:
+ if not os.path.exists(state[1]):
+ continue
+ srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
+ # Find and error for absolute symlinks. We could attempt to relocate but its not
+ # clear where the symlink is relative to in this context. We could add that markup
+ # to sstate tasks but there aren't many of these so better just avoid them entirely.
+ for walkroot, dirs, files in os.walk(state[1]):
+ for file in files + dirs:
+ srcpath = os.path.join(walkroot, file)
+ if not os.path.islink(srcpath):
+ continue
+ link = os.readlink(srcpath)
+ if not os.path.isabs(link):
+ continue
+ if not link.startswith(tmpdir):
+ continue
+ bb.error("sstate found an absolute path symlink %s pointing at %s. Please replace this with a relative link." % (srcpath, link))
+ bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
+ os.rename(state[1], sstatebuild + state[0])
+
+ workdir = d.getVar('WORKDIR')
+ for plain in ss['plaindirs']:
+ pdir = plain.replace(workdir, sstatebuild)
+ bb.utils.mkdirhier(plain)
+ bb.utils.mkdirhier(pdir)
+ os.rename(plain, pdir)
+
+ d.setVar('SSTATE_BUILDDIR', sstatebuild)
+ d.setVar('SSTATE_PKG', sstatepkg)
+ d.setVar('SSTATE_INSTDIR', sstatebuild)
+
+ if d.getVar('SSTATE_SKIP_CREATION') == '1':
+ return
+
+ for f in (d.getVar('SSTATECREATEFUNCS') or '').split() + \
+ ['sstate_create_package', 'sstate_sign_package'] + \
+ (d.getVar('SSTATEPOSTCREATEFUNCS') or '').split():
+ # All hooks should run in SSTATE_BUILDDIR.
+ bb.build.exec_func(f, d, (sstatebuild,))
+
+ bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
+
+ return
+
+def pstaging_fetch(sstatefetch, sstatepkg, d):
+ import bb.fetch2
+
+ # Only try and fetch if the user has configured a mirror
+ mirrors = d.getVar('SSTATE_MIRRORS')
+ if not mirrors:
+ return
+
+ # Copy the data object and override DL_DIR and SRC_URI
+ localdata = bb.data.createCopy(d)
+
+ dldir = localdata.expand("${SSTATE_DIR}")
+ bb.utils.mkdirhier(dldir)
+
+ localdata.delVar('MIRRORS')
+ localdata.setVar('FILESPATH', dldir)
+ localdata.setVar('DL_DIR', dldir)
+ localdata.setVar('PREMIRRORS', mirrors)
+
+ # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+ # we'll want to allow network access for the current set of fetches.
+ if localdata.getVar('BB_NO_NETWORK') == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK') == "1":
+ localdata.delVar('BB_NO_NETWORK')
+
+ # Try a fetch from the sstate mirror, if it fails just return and
+ # we will build the package
+ uris = ['file://{0};downloadfilename={0}'.format(sstatefetch),
+ 'file://{0}.siginfo;downloadfilename={0}.siginfo'.format(sstatefetch)]
+ if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False):
+ uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)]
+
+ for srcuri in uris:
+ localdata.setVar('SRC_URI', srcuri)
+ try:
+ fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+ fetcher.download()
+
+ except bb.fetch2.BBFetchException:
+ break
+
+def sstate_setscene(d):
+ shared_state = sstate_state_fromvars(d)
+ accelerate = sstate_installpkg(shared_state, d)
+ if not accelerate:
+ bb.fatal("No suitable staging package found")
+
+python sstate_task_prefunc () {
+ shared_state = sstate_state_fromvars(d)
+ sstate_clean(shared_state, d)
+}
+sstate_task_prefunc[dirs] = "${WORKDIR}"
+
+python sstate_task_postfunc () {
+ shared_state = sstate_state_fromvars(d)
+
+ for intercept in shared_state['interceptfuncs']:
+ bb.build.exec_func(intercept, d, (d.getVar("WORKDIR"),))
+
+ omask = os.umask(0o002)
+ if omask != 0o002:
+ bb.note("Using umask 0o002 (not %0o) for sstate packaging" % omask)
+ sstate_package(shared_state, d)
+ os.umask(omask)
+
+ sstateinst = d.getVar("SSTATE_INSTDIR")
+ d.setVar('SSTATE_FIXMEDIR', shared_state['fixmedir'])
+
+ sstate_installpkgdir(shared_state, d)
+
+ bb.utils.remove(d.getVar("SSTATE_BUILDDIR"), recurse=True)
+}
+sstate_task_postfunc[dirs] = "${WORKDIR}"
+
+
+#
+# Shell function to generate a sstate package from a directory
+# set as SSTATE_BUILDDIR. Will be run from within SSTATE_BUILDDIR.
+#
+sstate_create_package () {
+ TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
+ # Need to handle empty directories
+ if [ "$(ls -A)" ]; then
+ set +e
+ tar -czf $TFILE *
+ ret=$?
+ if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then
+ exit 1
+ fi
+ set -e
+ else
+ tar -cz --file=$TFILE --files-from=/dev/null
+ fi
+ chmod 0664 $TFILE
+ mv -f $TFILE ${SSTATE_PKG}
+}
+
+python sstate_sign_package () {
+ from oe.gpg_sign import get_signer
+
+ if d.getVar('SSTATE_SIG_KEY'):
+ signer = get_signer(d, 'local')
+ sstate_pkg = d.getVar('SSTATE_PKG')
+ if os.path.exists(sstate_pkg + '.sig'):
+ os.unlink(sstate_pkg + '.sig')
+ signer.detach_sign(sstate_pkg, d.getVar('SSTATE_SIG_KEY', False), None,
+ d.getVar('SSTATE_SIG_PASSPHRASE'), armor=False)
+}
+
+#
+# Shell function to decompress and prepare a package for installation
+# Will be run from within SSTATE_INSTDIR.
+#
+sstate_unpack_package () {
+ tar -xvzf ${SSTATE_PKG}
+ # update .siginfo atime on local/NFS mirror
+ [ -w ${SSTATE_PKG}.siginfo ] && [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo
+ # Use "! -w ||" to return true for read only files
+ [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG}
+ [ ! -w ${SSTATE_PKG}.sig ] || [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig
+ [ ! -w ${SSTATE_PKG}.siginfo ] || [ ! -e ${SSTATE_PKG}.siginfo ] || touch --no-dereference ${SSTATE_PKG}.siginfo
+}
+
+BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
+
+def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
+
+ ret = []
+ missed = []
+ extension = ".tgz"
+ if siginfo:
+ extension = extension + ".siginfo"
+
+ def getpathcomponents(task, d):
+ # Magic data from BB_HASHFILENAME
+ splithashfn = sq_hashfn[task].split(" ")
+ spec = splithashfn[1]
+ if splithashfn[0] == "True":
+ extrapath = d.getVar("NATIVELSBSTRING") + "/"
+ else:
+ extrapath = ""
+
+ tname = sq_task[task][3:]
+
+ if tname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and splithashfn[2]:
+ spec = splithashfn[2]
+ extrapath = ""
+
+ return spec, extrapath, tname
+
+
+ for task in range(len(sq_fn)):
+
+ spec, extrapath, tname = getpathcomponents(task, d)
+
+ sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+
+ if os.path.exists(sstatefile):
+ bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
+ ret.append(task)
+ continue
+ else:
+ missed.append(task)
+ bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile)
+
+ mirrors = d.getVar("SSTATE_MIRRORS")
+ if mirrors:
+ # Copy the data object and override DL_DIR and SRC_URI
+ localdata = bb.data.createCopy(d)
+
+ dldir = localdata.expand("${SSTATE_DIR}")
+ localdata.delVar('MIRRORS')
+ localdata.setVar('FILESPATH', dldir)
+ localdata.setVar('DL_DIR', dldir)
+ localdata.setVar('PREMIRRORS', mirrors)
+
+ bb.debug(2, "SState using premirror of: %s" % mirrors)
+
+ # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+ # we'll want to allow network access for the current set of fetches.
+ if localdata.getVar('BB_NO_NETWORK') == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK') == "1":
+ localdata.delVar('BB_NO_NETWORK')
+
+ from bb.fetch2 import FetchConnectionCache
+ def checkstatus_init(thread_worker):
+ thread_worker.connection_cache = FetchConnectionCache()
+
+ def checkstatus_end(thread_worker):
+ thread_worker.connection_cache.close_connections()
+
+ def checkstatus(thread_worker, arg):
+ (task, sstatefile) = arg
+
+ localdata2 = bb.data.createCopy(localdata)
+ srcuri = "file://" + sstatefile
+ localdata.setVar('SRC_URI', srcuri)
+ bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
+
+ try:
+ fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2,
+ connection_cache=thread_worker.connection_cache)
+ fetcher.checkstatus()
+ bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
+ ret.append(task)
+ if task in missed:
+ missed.remove(task)
+ except:
+ missed.append(task)
+ bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
+ pass
+ bb.event.fire(bb.event.ProcessProgress(msg, len(tasklist) - thread_worker.tasks.qsize()), d)
+
+ tasklist = []
+ for task in range(len(sq_fn)):
+ if task in ret:
+ continue
+ spec, extrapath, tname = getpathcomponents(task, d)
+ sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+ tasklist.append((task, sstatefile))
+
+ if tasklist:
+ msg = "Checking sstate mirror object availability"
+ bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
+
+ import multiprocessing
+ nproc = min(multiprocessing.cpu_count(), len(tasklist))
+
+ bb.event.enable_threadlock()
+ pool = oe.utils.ThreadedPool(nproc, len(tasklist),
+ worker_init=checkstatus_init, worker_end=checkstatus_end)
+ for t in tasklist:
+ pool.add_task(checkstatus, t)
+ pool.start()
+ pool.wait_completion()
+ bb.event.disable_threadlock()
+
+ bb.event.fire(bb.event.ProcessFinished(msg), d)
+
+ inheritlist = d.getVar("INHERIT")
+ if "toaster" in inheritlist:
+ evdata = {'missed': [], 'found': []};
+ for task in missed:
+ spec, extrapath, tname = getpathcomponents(task, d)
+ sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+ evdata['missed'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
+ for task in ret:
+ spec, extrapath, tname = getpathcomponents(task, d)
+ sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+ evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
+ bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
+
+ if hasattr(bb.parse.siggen, "checkhashes"):
+ bb.parse.siggen.checkhashes(missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d)
+
+ return ret
+
+BB_SETSCENE_DEPVALID = "setscene_depvalid"
+
+def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
+ # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME]
+ # task is included in taskdependees too
+ # Return - False - We need this dependency
+ # - True - We can skip this dependency
+
+ def logit(msg, log):
+ if log is not None:
+ log.append(msg)
+ else:
+ bb.debug(2, msg)
+
+ logit("Considering setscene task: %s" % (str(taskdependees[task])), log)
+
+ def isNativeCross(x):
+ return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x or x.endswith("-cross")
+
+ # We only need to trigger populate_lic through direct dependencies
+ if taskdependees[task][1] == "do_populate_lic":
+ return True
+
+ # stash_locale and gcc_stash_builddir are never needed as a dependency for built objects
+ if taskdependees[task][1] == "do_stash_locale" or taskdependees[task][1] == "do_gcc_stash_builddir":
+ return True
+
+ # We only need to trigger packagedata through direct dependencies
+ # but need to preserve packagedata on packagedata links
+ if taskdependees[task][1] == "do_packagedata":
+ for dep in taskdependees:
+ if taskdependees[dep][1] == "do_packagedata":
+ return False
+ return True
+
+ for dep in taskdependees:
+ logit(" considering dependency: %s" % (str(taskdependees[dep])), log)
+ if task == dep:
+ continue
+ if dep in notneeded:
+ continue
+ # do_package_write_* and do_package doesn't need do_package
+ if taskdependees[task][1] == "do_package" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
+ continue
+ # do_package_write_* need do_populate_sysroot as they're mainly postinstall dependencies
+ if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+ return False
+ # do_package/packagedata/package_qa don't need do_populate_sysroot
+ if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_packagedata', 'do_package_qa']:
+ continue
+ # Native/Cross packages don't exist and are noexec anyway
+ if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package', 'do_package_qa']:
+ continue
+
+ # This is due to the [depends] in useradd.bbclass complicating matters
+ # The logic *is* reversed here due to the way hard setscene dependencies are injected
+ if (taskdependees[task][1] == 'do_package' or taskdependees[task][1] == 'do_populate_sysroot') and taskdependees[dep][0].endswith(('shadow-native', 'shadow-sysroot', 'base-passwd', 'pseudo-native')) and taskdependees[dep][1] == 'do_populate_sysroot':
+ continue
+
+ # Consider sysroot depending on sysroot tasks
+ if taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot':
+ # base-passwd/shadow-sysroot don't need their dependencies
+ if taskdependees[dep][0].endswith(("base-passwd", "shadow-sysroot")):
+ continue
+ # Nothing need depend on libc-initial/gcc-cross-initial
+ if "-initial" in taskdependees[task][0]:
+ continue
+ # For meta-extsdk-toolchain we want all sysroot dependencies
+ if taskdependees[dep][0] == 'meta-extsdk-toolchain':
+ return False
+ # Native/Cross populate_sysroot need their dependencies
+ if isNativeCross(taskdependees[task][0]) and isNativeCross(taskdependees[dep][0]):
+ return False
+ # Target populate_sysroot depended on by cross tools need to be installed
+ if isNativeCross(taskdependees[dep][0]):
+ return False
+ # Native/cross tools depended upon by target sysroot are not needed
+ # Add an exception for shadow-native as required by useradd.bbclass
+ if isNativeCross(taskdependees[task][0]) and taskdependees[task][0] != 'shadow-native':
+ continue
+ # Target populate_sysroot need their dependencies
+ return False
+
+ if taskdependees[task][1] == 'do_shared_workdir':
+ continue
+
+ if taskdependees[dep][1] == "do_populate_lic":
+ continue
+
+
+ # Safe fallthrough default
+ logit(" Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])), log)
+ return False
+ return True
+
+addhandler sstate_eventhandler
+sstate_eventhandler[eventmask] = "bb.build.TaskSucceeded"
+python sstate_eventhandler() {
+ d = e.data
+ # When we write an sstate package we rewrite the SSTATE_PKG
+ spkg = d.getVar('SSTATE_PKG')
+ if not spkg.endswith(".tgz"):
+ taskname = d.getVar("BB_RUNTASK")[3:]
+ spec = d.getVar('SSTATE_PKGSPEC')
+ swspec = d.getVar('SSTATE_SWSPEC')
+ if taskname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and swspec:
+ d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
+ d.setVar("SSTATE_EXTRAPATH", "")
+ sstatepkg = d.getVar('SSTATE_PKG')
+ bb.siggen.dump_this_task(sstatepkg + '_' + taskname + ".tgz" ".siginfo", d)
+}
+
+SSTATE_PRUNE_OBSOLETEWORKDIR = "1"
+
+# Event handler which removes manifests and stamps file for
+# recipes which are no longer reachable in a build where they
+# once were.
+# Also optionally removes the workdir of those tasks/recipes
+#
+addhandler sstate_eventhandler2
+sstate_eventhandler2[eventmask] = "bb.event.ReachableStamps"
+python sstate_eventhandler2() {
+ import glob
+ d = e.data
+ stamps = e.stamps.values()
+ removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1")
+ preservestampfile = d.expand('${SSTATE_MANIFESTS}/preserve-stamps')
+ preservestamps = []
+ if os.path.exists(preservestampfile):
+ with open(preservestampfile, 'r') as f:
+ preservestamps = f.readlines()
+ seen = []
+ for a in sorted(list(set(d.getVar("SSTATE_ARCHS").split()))):
+ toremove = []
+ i = d.expand("${SSTATE_MANIFESTS}/index-" + a)
+ if not os.path.exists(i):
+ continue
+ with open(i, "r") as f:
+ lines = f.readlines()
+ for l in lines:
+ (stamp, manifest, workdir) = l.split()
+ if stamp not in stamps and stamp not in preservestamps:
+ toremove.append(l)
+ if stamp not in seen:
+ bb.debug(2, "Stamp %s is not reachable, removing related manifests" % stamp)
+ seen.append(stamp)
+
+ if toremove:
+ msg = "Removing %d recipes from the %s sysroot" % (len(toremove), a)
+ bb.event.fire(bb.event.ProcessStarted(msg, len(toremove)), d)
+
+ removed = 0
+ for r in toremove:
+ (stamp, manifest, workdir) = r.split()
+ for m in glob.glob(manifest + ".*"):
+ if m.endswith(".postrm"):
+ continue
+ sstate_clean_manifest(m, d)
+ bb.utils.remove(stamp + "*")
+ if removeworkdir:
+ bb.utils.remove(workdir, recurse = True)
+ lines.remove(r)
+ removed = removed + 1
+ bb.event.fire(bb.event.ProcessProgress(msg, removed), d)
+
+ bb.event.fire(bb.event.ProcessFinished(msg), d)
+
+ with open(i, "w") as f:
+ for l in lines:
+ f.write(l)
+ if preservestamps:
+ os.remove(preservestampfile)
+}
diff --git a/poky/meta/classes/staging.bbclass b/poky/meta/classes/staging.bbclass
new file mode 100644
index 000000000..3fcbc9f15
--- /dev/null
+++ b/poky/meta/classes/staging.bbclass
@@ -0,0 +1,591 @@
+# These directories will be staged in the sysroot
+SYSROOT_DIRS = " \
+ ${includedir} \
+ ${libdir} \
+ ${base_libdir} \
+ ${nonarch_base_libdir} \
+ ${datadir} \
+"
+
+# These directories are also staged in the sysroot when they contain files that
+# are usable on the build system
+SYSROOT_DIRS_NATIVE = " \
+ ${bindir} \
+ ${sbindir} \
+ ${base_bindir} \
+ ${base_sbindir} \
+ ${libexecdir} \
+ ${sysconfdir} \
+ ${localstatedir} \
+"
+SYSROOT_DIRS_append_class-native = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS_append_class-cross = " ${SYSROOT_DIRS_NATIVE}"
+SYSROOT_DIRS_append_class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
+
+# These directories will not be staged in the sysroot
+SYSROOT_DIRS_BLACKLIST = " \
+ ${mandir} \
+ ${docdir} \
+ ${infodir} \
+ ${datadir}/locale \
+ ${datadir}/applications \
+ ${datadir}/fonts \
+ ${datadir}/pixmaps \
+ ${libdir}/${PN}/ptest \
+"
+
+sysroot_stage_dir() {
+ src="$1"
+ dest="$2"
+ # if the src doesn't exist don't do anything
+ if [ ! -d "$src" ]; then
+ return
+ fi
+
+ mkdir -p "$dest"
+ (
+ cd $src
+ find . -print0 | cpio --null -pdlu $dest
+ )
+}
+
+sysroot_stage_dirs() {
+ from="$1"
+ to="$2"
+
+ for dir in ${SYSROOT_DIRS}; do
+ sysroot_stage_dir "$from$dir" "$to$dir"
+ done
+
+ # Remove directories we do not care about
+ for dir in ${SYSROOT_DIRS_BLACKLIST}; do
+ rm -rf "$to$dir"
+ done
+}
+
+sysroot_stage_all() {
+ sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
+}
+
+python sysroot_strip () {
+ inhibit_sysroot = d.getVar('INHIBIT_SYSROOT_STRIP')
+ if inhibit_sysroot and oe.types.boolean(inhibit_sysroot):
+ return 0
+
+ dstdir = d.getVar('SYSROOT_DESTDIR')
+ pn = d.getVar('PN')
+ libdir = os.path.abspath(dstdir + os.sep + d.getVar("libdir"))
+ base_libdir = os.path.abspath(dstdir + os.sep + d.getVar("base_libdir"))
+ qa_already_stripped = 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn) or "").split()
+ strip_cmd = d.getVar("STRIP")
+
+ oe.package.strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir,
+ qa_already_stripped=qa_already_stripped)
+}
+
+do_populate_sysroot[dirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[umask] = "022"
+
+addtask populate_sysroot after do_install
+
+SYSROOT_PREPROCESS_FUNCS ?= ""
+SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir"
+
+python do_populate_sysroot () {
+ bb.build.exec_func("sysroot_stage_all", d)
+ bb.build.exec_func("sysroot_strip", d)
+ for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS') or '').split():
+ bb.build.exec_func(f, d)
+ pn = d.getVar("PN")
+ multiprov = d.getVar("MULTI_PROVIDER_WHITELIST").split()
+ provdir = d.expand("${SYSROOT_DESTDIR}${base_prefix}/sysroot-providers/")
+ bb.utils.mkdirhier(provdir)
+ for p in d.getVar("PROVIDES").split():
+ if p in multiprov:
+ continue
+ p = p.replace("/", "_")
+ with open(provdir + p, "w") as f:
+ f.write(pn)
+}
+
+do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}"
+do_populate_sysroot[vardepsexclude] += "MULTI_PROVIDER_WHITELIST"
+
+POPULATESYSROOTDEPS = ""
+POPULATESYSROOTDEPS_class-target = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
+POPULATESYSROOTDEPS_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
+do_populate_sysroot[depends] += "${POPULATESYSROOTDEPS}"
+
+SSTATETASKS += "do_populate_sysroot"
+do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+do_populate_sysroot[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+
+python do_populate_sysroot_setscene () {
+ sstate_setscene(d)
+}
+addtask do_populate_sysroot_setscene
+
+def staging_copyfile(c, target, dest, postinsts, seendirs):
+ import errno
+
+ destdir = os.path.dirname(dest)
+ if destdir not in seendirs:
+ bb.utils.mkdirhier(destdir)
+ seendirs.add(destdir)
+ if "/usr/bin/postinst-" in c:
+ postinsts.append(dest)
+ if os.path.islink(c):
+ linkto = os.readlink(c)
+ if os.path.lexists(dest):
+ if not os.path.islink(dest):
+ raise OSError(errno.EEXIST, "Link %s already exists as a file" % dest, dest)
+ if os.readlink(dest) == linkto:
+ return dest
+ raise OSError(errno.EEXIST, "Link %s already exists to a different location? (%s vs %s)" % (dest, os.readlink(dest), linkto), dest)
+ os.symlink(linkto, dest)
+ #bb.warn(c)
+ else:
+ try:
+ os.link(c, dest)
+ except OSError as err:
+ if err.errno == errno.EXDEV:
+ bb.utils.copyfile(c, dest)
+ else:
+ raise
+ return dest
+
+def staging_copydir(c, target, dest, seendirs):
+ if dest not in seendirs:
+ bb.utils.mkdirhier(dest)
+ seendirs.add(dest)
+
+def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d):
+ import subprocess
+
+ if not fixme:
+ return
+ cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative)
+ for fixmevar in ['COMPONENTS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']:
+ fixme_path = d.getVar(fixmevar)
+ cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
+ bb.debug(2, cmd)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+
+
+def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
+ import glob
+ import subprocess
+ import errno
+
+ fixme = []
+ postinsts = []
+ seendirs = set()
+ stagingdir = d.getVar("STAGING_DIR")
+ if native:
+ pkgarchs = ['${BUILD_ARCH}', '${BUILD_ARCH}_*']
+ targetdir = nativesysroot
+ else:
+ pkgarchs = ['${MACHINE_ARCH}']
+ pkgarchs = pkgarchs + list(reversed(d.getVar("PACKAGE_EXTRA_ARCHS").split()))
+ pkgarchs.append('allarch')
+ targetdir = targetsysroot
+
+ bb.utils.mkdirhier(targetdir)
+ for pkgarch in pkgarchs:
+ for manifest in glob.glob(d.expand("${SSTATE_MANIFESTS}/manifest-%s-*.populate_sysroot" % pkgarch)):
+ if manifest.endswith("-initial.populate_sysroot"):
+ # skip glibc-initial and libgcc-initial due to file overlap
+ continue
+ tmanifest = targetdir + "/" + os.path.basename(manifest)
+ if os.path.exists(tmanifest):
+ continue
+ try:
+ os.link(manifest, tmanifest)
+ except OSError as err:
+ if err.errno == errno.EXDEV:
+ bb.utils.copyfile(manifest, tmanifest)
+ else:
+ raise
+ with open(manifest, "r") as f:
+ for l in f:
+ l = l.strip()
+ if l.endswith("/fixmepath"):
+ fixme.append(l)
+ continue
+ if l.endswith("/fixmepath.cmd"):
+ continue
+ dest = l.replace(stagingdir, "")
+ dest = targetdir + "/" + "/".join(dest.split("/")[3:])
+ if l.endswith("/"):
+ staging_copydir(l, targetdir, dest, seendirs)
+ continue
+ try:
+ staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+ except FileExistsError:
+ continue
+
+ staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
+ for p in postinsts:
+ subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
+
+#
+# Manifests here are complicated. The main sysroot area has the unpacked sstate
+# which us unrelocated and tracked by the main sstate manifests. Each recipe
+# specific sysroot has manifests for each dependency that is installed there.
+# The task hash is used to tell whether the data needs to be reinstalled. We
+# use a symlink to point to the currently installed hash. There is also a
+# "complete" stamp file which is used to mark if installation completed. If
+# something fails (e.g. a postinst), this won't get written and we would
+# remove and reinstall the dependency. This also means partially installed
+# dependencies should get cleaned up correctly.
+#
+
+python extend_recipe_sysroot() {
+ import copy
+ import subprocess
+ import errno
+ import collections
+ import glob
+
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ mytaskname = d.getVar("BB_RUNTASK")
+ if mytaskname.endswith("_setscene"):
+ mytaskname = mytaskname.replace("_setscene", "")
+ workdir = d.getVar("WORKDIR")
+ #bb.warn(str(taskdepdata))
+ pn = d.getVar("PN")
+
+ stagingdir = d.getVar("STAGING_DIR")
+ sharedmanifests = d.getVar("COMPONENTS_DIR") + "/manifests"
+ recipesysroot = d.getVar("RECIPE_SYSROOT")
+ recipesysrootnative = d.getVar("RECIPE_SYSROOT_NATIVE")
+ current_variant = d.getVar("BBEXTENDVARIANT")
+
+ # Detect bitbake -b usage
+ nodeps = d.getVar("BB_LIMITEDDEPS") or False
+ if nodeps:
+ lock = bb.utils.lockfile(recipesysroot + "/sysroot.lock")
+ staging_populate_sysroot_dir(recipesysroot, recipesysrootnative, True, d)
+ staging_populate_sysroot_dir(recipesysroot, recipesysrootnative, False, d)
+ bb.utils.unlockfile(lock)
+ return
+
+ start = None
+ configuredeps = []
+ for dep in taskdepdata:
+ data = taskdepdata[dep]
+ if data[1] == mytaskname and data[0] == pn:
+ start = dep
+ break
+ if start is None:
+ bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
+
+ # We need to figure out which sysroot files we need to expose to this task.
+ # This needs to match what would get restored from sstate, which is controlled
+ # ultimately by calls from bitbake to setscene_depvalid().
+ # That function expects a setscene dependency tree. We build a dependency tree
+ # condensed to inter-sstate task dependencies, similar to that used by setscene
+ # tasks. We can then call into setscene_depvalid() and decide
+ # which dependencies we can "see" and should expose in the recipe specific sysroot.
+ setscenedeps = copy.deepcopy(taskdepdata)
+
+ start = set([start])
+
+ sstatetasks = d.getVar("SSTATETASKS").split()
+
+ def print_dep_tree(deptree):
+ data = ""
+ for dep in deptree:
+ deps = " " + "\n ".join(deptree[dep][3]) + "\n"
+ data = "%s:\n %s\n %s\n%s %s\n %s\n" % (deptree[dep][0], deptree[dep][1], deptree[dep][2], deps, deptree[dep][4], deptree[dep][5])
+ return data
+
+ #bb.note("Full dep tree is:\n%s" % print_dep_tree(taskdepdata))
+
+ #bb.note(" start2 is %s" % str(start))
+
+ # If start is an sstate task (like do_package) we need to add in its direct dependencies
+ # else the code below won't recurse into them.
+ for dep in set(start):
+ for dep2 in setscenedeps[dep][3]:
+ start.add(dep2)
+ start.remove(dep)
+
+ #bb.note(" start3 is %s" % str(start))
+
+ # Create collapsed do_populate_sysroot -> do_populate_sysroot tree
+ for dep in taskdepdata:
+ data = setscenedeps[dep]
+ if data[1] not in sstatetasks:
+ for dep2 in setscenedeps:
+ data2 = setscenedeps[dep2]
+ if dep in data2[3]:
+ data2[3].update(setscenedeps[dep][3])
+ data2[3].remove(dep)
+ if dep in start:
+ start.update(setscenedeps[dep][3])
+ start.remove(dep)
+ del setscenedeps[dep]
+
+ # Remove circular references
+ for dep in setscenedeps:
+ if dep in setscenedeps[dep][3]:
+ setscenedeps[dep][3].remove(dep)
+
+ #bb.note("Computed dep tree is:\n%s" % print_dep_tree(setscenedeps))
+ #bb.note(" start is %s" % str(start))
+
+ # Direct dependencies should be present and can be depended upon
+ for dep in set(start):
+ if setscenedeps[dep][1] == "do_populate_sysroot":
+ if dep not in configuredeps:
+ configuredeps.append(dep)
+ bb.note("Direct dependencies are %s" % str(configuredeps))
+ #bb.note(" or %s" % str(start))
+
+ msgbuf = []
+ # Call into setscene_depvalid for each sub-dependency and only copy sysroot files
+ # for ones that would be restored from sstate.
+ done = list(start)
+ next = list(start)
+ while next:
+ new = []
+ for dep in next:
+ data = setscenedeps[dep]
+ for datadep in data[3]:
+ if datadep in done:
+ continue
+ taskdeps = {}
+ taskdeps[dep] = setscenedeps[dep][:2]
+ taskdeps[datadep] = setscenedeps[datadep][:2]
+ retval = setscene_depvalid(datadep, taskdeps, [], d, msgbuf)
+ if retval:
+ msgbuf.append("Skipping setscene dependency %s for installation into the sysroot" % datadep)
+ continue
+ done.append(datadep)
+ new.append(datadep)
+ if datadep not in configuredeps and setscenedeps[datadep][1] == "do_populate_sysroot":
+ configuredeps.append(datadep)
+ msgbuf.append("Adding dependency on %s" % setscenedeps[datadep][0])
+ else:
+ msgbuf.append("Following dependency on %s" % setscenedeps[datadep][0])
+ next = new
+
+ # This logging is too verbose for day to day use sadly
+ #bb.debug(2, "\n".join(msgbuf))
+
+ depdir = recipesysrootnative + "/installeddeps"
+ bb.utils.mkdirhier(depdir)
+ bb.utils.mkdirhier(sharedmanifests)
+
+ lock = bb.utils.lockfile(recipesysroot + "/sysroot.lock")
+
+ fixme = {}
+ fixme[''] = []
+ fixme['native'] = []
+ seendirs = set()
+ postinsts = []
+ multilibs = {}
+ manifests = {}
+ # All files that we're going to be installing, to find conflicts.
+ fileset = {}
+
+ for f in os.listdir(depdir):
+ if not f.endswith(".complete"):
+ continue
+ f = depdir + "/" + f
+ if os.path.islink(f) and not os.path.exists(f):
+ bb.note("%s no longer exists, removing from sysroot" % f)
+ lnk = os.readlink(f.replace(".complete", ""))
+ sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+ os.unlink(f)
+ os.unlink(f.replace(".complete", ""))
+
+ installed = []
+ for dep in configuredeps:
+ c = setscenedeps[dep][0]
+ if mytaskname in ["do_sdk_depends", "do_populate_sdk_ext"] and c.endswith("-initial"):
+ bb.note("Skipping initial setscene dependency %s for installation into the sysroot" % c)
+ continue
+ installed.append(c)
+
+ # We want to remove anything which this task previously installed but is no longer a dependency
+ taskindex = depdir + "/" + "index." + mytaskname
+ if os.path.exists(taskindex):
+ potential = []
+ with open(taskindex, "r") as f:
+ for l in f:
+ l = l.strip()
+ if l not in installed:
+ fl = depdir + "/" + l
+ if not os.path.exists(fl):
+ # Was likely already uninstalled
+ continue
+ potential.append(l)
+ # We need to ensure not other task needs this dependency. We hold the sysroot
+ # lock so we ca search the indexes to check
+ if potential:
+ for i in glob.glob(depdir + "/index.*"):
+ if i.endswith("." + mytaskname):
+ continue
+ with open(i, "r") as f:
+ for l in f:
+ l = l.strip()
+ if l in potential:
+ potential.remove(l)
+ for l in potential:
+ fl = depdir + "/" + l
+ bb.note("Task %s no longer depends on %s, removing from sysroot" % (mytaskname, l))
+ lnk = os.readlink(fl)
+ sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+ os.unlink(fl)
+ os.unlink(fl + ".complete")
+
+ msg_exists = []
+ msg_adding = []
+ for dep in configuredeps:
+ c = setscenedeps[dep][0]
+ if c not in installed:
+ continue
+ taskhash = setscenedeps[dep][5]
+ taskmanifest = depdir + "/" + c + "." + taskhash
+
+ if os.path.exists(depdir + "/" + c):
+ lnk = os.readlink(depdir + "/" + c)
+ if lnk == c + "." + taskhash and os.path.exists(depdir + "/" + c + ".complete"):
+ msg_exists.append(c)
+ continue
+ else:
+ bb.note("%s exists in sysroot, but is stale (%s vs. %s), removing." % (c, lnk, c + "." + taskhash))
+ sstate_clean_manifest(depdir + "/" + lnk, d, workdir)
+ os.unlink(depdir + "/" + c)
+ if os.path.lexists(depdir + "/" + c + ".complete"):
+ os.unlink(depdir + "/" + c + ".complete")
+ elif os.path.lexists(depdir + "/" + c):
+ os.unlink(depdir + "/" + c)
+
+ msg_adding.append(c)
+
+ os.symlink(c + "." + taskhash, depdir + "/" + c)
+
+ manifest, d2 = oe.sstatesig.find_sstate_manifest(c, setscenedeps[dep][2], "populate_sysroot", d, multilibs)
+ destsysroot = d2.getVar("RECIPE_SYSROOT")
+
+ native = False
+ if c.endswith("-native") or "-cross-" in c or "-crosssdk" in c:
+ native = True
+
+ if manifest:
+ newmanifest = collections.OrderedDict()
+ if native:
+ fm = fixme['native']
+ targetdir = recipesysrootnative
+ else:
+ fm = fixme['']
+ targetdir = destsysroot
+ with open(manifest, "r") as f:
+ manifests[dep] = manifest
+ for l in f:
+ l = l.strip()
+ if l.endswith("/fixmepath"):
+ fm.append(l)
+ continue
+ if l.endswith("/fixmepath.cmd"):
+ continue
+ dest = l.replace(stagingdir, "")
+ dest = "/" + "/".join(dest.split("/")[3:])
+ newmanifest[l] = targetdir + dest
+
+ # Check if files have already been installed by another
+ # recipe and abort if they have, explaining what recipes are
+ # conflicting.
+ hashname = targetdir + dest
+ if not hashname.endswith("/"):
+ if hashname in fileset:
+ bb.fatal("The file %s is installed by both %s and %s, aborting" % (dest, c, fileset[hashname]))
+ else:
+ fileset[hashname] = c
+
+ # Having multiple identical manifests in each sysroot eats diskspace so
+ # create a shared pool of them and hardlink if we can.
+ # We create the manifest in advance so that if something fails during installation,
+ # or the build is interrupted, subsequent exeuction can cleanup.
+ sharedm = sharedmanifests + "/" + os.path.basename(taskmanifest)
+ if not os.path.exists(sharedm):
+ smlock = bb.utils.lockfile(sharedm + ".lock")
+ # Can race here. You'd think it just means we may not end up with all copies hardlinked to each other
+ # but python can lose file handles so we need to do this under a lock.
+ if not os.path.exists(sharedm):
+ with open(sharedm, 'w') as m:
+ for l in newmanifest:
+ dest = newmanifest[l]
+ m.write(dest.replace(workdir + "/", "") + "\n")
+ bb.utils.unlockfile(smlock)
+ try:
+ os.link(sharedm, taskmanifest)
+ except OSError as err:
+ if err.errno == errno.EXDEV:
+ bb.utils.copyfile(sharedm, taskmanifest)
+ else:
+ raise
+ # Finally actually install the files
+ for l in newmanifest:
+ dest = newmanifest[l]
+ if l.endswith("/"):
+ staging_copydir(l, targetdir, dest, seendirs)
+ continue
+ staging_copyfile(l, targetdir, dest, postinsts, seendirs)
+
+ bb.note("Installed into sysroot: %s" % str(msg_adding))
+ bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))
+
+ for f in fixme:
+ if f == '':
+ staging_processfixme(fixme[f], recipesysroot, recipesysroot, recipesysrootnative, d)
+ elif f == 'native':
+ staging_processfixme(fixme[f], recipesysrootnative, recipesysroot, recipesysrootnative, d)
+ else:
+ staging_processfixme(fixme[f], multilibs[f].getVar("RECIPE_SYSROOT"), recipesysroot, recipesysrootnative, d)
+
+ for p in postinsts:
+ subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)
+
+ for dep in manifests:
+ c = setscenedeps[dep][0]
+ os.symlink(manifests[dep], depdir + "/" + c + ".complete")
+
+ with open(taskindex, "w") as f:
+ for l in sorted(installed):
+ f.write(l + "\n")
+
+ bb.utils.unlockfile(lock)
+}
+extend_recipe_sysroot[vardepsexclude] += "MACHINE_ARCH PACKAGE_EXTRA_ARCHS SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
+
+python do_prepare_recipe_sysroot () {
+ bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask do_prepare_recipe_sysroot before do_configure after do_fetch
+
+# Clean out the recipe specific sysroots before do_fetch
+# (use a prefunc so we can order before extend_recipe_sysroot if it gets added)
+python clean_recipe_sysroot() {
+ # We remove these stamps since we're removing any content they'd have added with
+ # cleandirs. This removes the sigdata too, likely not a big deal,
+ oe.path.remove(d.getVar("STAMP") + "*addto_recipe_sysroot*")
+ return
+}
+clean_recipe_sysroot[cleandirs] += "${RECIPE_SYSROOT} ${RECIPE_SYSROOT_NATIVE}"
+do_fetch[prefuncs] += "clean_recipe_sysroot"
+
+python staging_taskhandler() {
+ bbtasks = e.tasklist
+ for task in bbtasks:
+ deps = d.getVarFlag(task, "depends")
+ if deps and "populate_sysroot" in deps:
+ d.appendVarFlag(task, "prefuncs", " extend_recipe_sysroot")
+}
+staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
+addhandler staging_taskhandler
diff --git a/poky/meta/classes/syslinux.bbclass b/poky/meta/classes/syslinux.bbclass
new file mode 100644
index 000000000..031dacbf7
--- /dev/null
+++ b/poky/meta/classes/syslinux.bbclass
@@ -0,0 +1,199 @@
+# syslinux.bbclass
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Provide syslinux specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${AUTO_SYSLINUXMENU} - set this to 1 to enable creating an automatic menu
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
+# ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu
+# ${SYSLINUX_DEFAULT_CONSOLE} - set to "console=ttyX" to change kernel boot default console
+# ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string
+# ${SYSLINUX_SERIAL_TTY} - Set alternate console=tty... kernel boot argument
+# ${SYSLINUX_KERNEL_ARGS} - Add additional kernel arguments
+
+do_bootimg[depends] += "${MLPREFIX}syslinux:do_populate_sysroot \
+ syslinux-native:do_populate_sysroot"
+
+ISOLINUXDIR ?= "/isolinux"
+SYSLINUXDIR = "/"
+# The kernel has an internal default console, which you can override with
+# a console=...some_tty...
+SYSLINUX_DEFAULT_CONSOLE ?= ""
+SYSLINUX_SERIAL ?= "0 115200"
+SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200"
+SYSLINUX_PROMPT ?= "0"
+SYSLINUX_TIMEOUT ?= "50"
+AUTO_SYSLINUXMENU ?= "1"
+SYSLINUX_ALLOWOPTIONS ?= "1"
+SYSLINUX_ROOT ?= "${ROOT}"
+SYSLINUX_CFG_VM ?= "${S}/syslinux_vm.cfg"
+SYSLINUX_CFG_LIVE ?= "${S}/syslinux_live.cfg"
+APPEND ?= ""
+
+# Need UUID utility code.
+inherit fs-uuid
+
+syslinux_populate() {
+ DEST=$1
+ BOOTDIR=$2
+ CFGNAME=$3
+
+ install -d ${DEST}${BOOTDIR}
+
+ # Install the config files
+ install -m 0644 ${SYSLINUX_CFG} ${DEST}${BOOTDIR}/${CFGNAME}
+ if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
+ install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32
+ install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32
+ install -m 0444 ${STAGING_DATADIR}/syslinux/libutil.c32 ${DEST}${BOOTDIR}/libutil.c32
+ if [ "${SYSLINUX_SPLASH}" != "" ] ; then
+ install -m 0644 ${SYSLINUX_SPLASH} ${DEST}${BOOTDIR}/splash.lss
+ fi
+ fi
+}
+
+syslinux_iso_populate() {
+ iso_dir=$1
+ syslinux_populate $iso_dir ${ISOLINUXDIR} isolinux.cfg
+ install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin $iso_dir${ISOLINUXDIR}
+ install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 $iso_dir${ISOLINUXDIR}
+}
+
+syslinux_hddimg_populate() {
+ hdd_dir=$1
+ syslinux_populate $hdd_dir ${SYSLINUXDIR} syslinux.cfg
+ install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys $hdd_dir${SYSLINUXDIR}/ldlinux.sys
+}
+
+syslinux_hddimg_install() {
+ syslinux ${IMGDEPLOYDIR}/${IMAGE_NAME}.hddimg
+}
+
+syslinux_hdddirect_install() {
+ DEST=$1
+ syslinux $DEST
+}
+
+python build_syslinux_cfg () {
+ import copy
+ import sys
+
+ workdir = d.getVar('WORKDIR')
+ if not workdir:
+ bb.error("WORKDIR not defined, unable to package")
+ return
+
+ labels = d.getVar('LABELS')
+ if not labels:
+ bb.debug(1, "LABELS not defined, nothing to do")
+ return
+
+ if labels == []:
+ bb.debug(1, "No labels, nothing to do")
+ return
+
+ cfile = d.getVar('SYSLINUX_CFG')
+ if not cfile:
+ bb.fatal('Unable to read SYSLINUX_CFG')
+
+ try:
+ cfgfile = open(cfile, 'w')
+ except OSError:
+ bb.fatal('Unable to open %s' % cfile)
+
+ cfgfile.write('# Automatically created by OE\n')
+
+ opts = d.getVar('SYSLINUX_OPTS')
+
+ if opts:
+ for opt in opts.split(';'):
+ cfgfile.write('%s\n' % opt)
+
+ allowoptions = d.getVar('SYSLINUX_ALLOWOPTIONS')
+ if allowoptions:
+ cfgfile.write('ALLOWOPTIONS %s\n' % allowoptions)
+ else:
+ cfgfile.write('ALLOWOPTIONS 1\n')
+
+ syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE')
+ syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY')
+ syslinux_serial = d.getVar('SYSLINUX_SERIAL')
+ if syslinux_serial:
+ cfgfile.write('SERIAL %s\n' % syslinux_serial)
+
+ menu = (d.getVar('AUTO_SYSLINUXMENU') == "1")
+
+ if menu and syslinux_serial:
+ cfgfile.write('DEFAULT Graphics console %s\n' % (labels.split()[0]))
+ else:
+ cfgfile.write('DEFAULT %s\n' % (labels.split()[0]))
+
+ timeout = d.getVar('SYSLINUX_TIMEOUT')
+
+ if timeout:
+ cfgfile.write('TIMEOUT %s\n' % timeout)
+ else:
+ cfgfile.write('TIMEOUT 50\n')
+
+ prompt = d.getVar('SYSLINUX_PROMPT')
+ if prompt:
+ cfgfile.write('PROMPT %s\n' % prompt)
+ else:
+ cfgfile.write('PROMPT 1\n')
+
+ if menu:
+ cfgfile.write('ui vesamenu.c32\n')
+ cfgfile.write('menu title Select kernel options and boot kernel\n')
+ cfgfile.write('menu tabmsg Press [Tab] to edit, [Return] to select\n')
+ splash = d.getVar('SYSLINUX_SPLASH')
+ if splash:
+ cfgfile.write('menu background splash.lss\n')
+
+ for label in labels.split():
+ localdata = bb.data.createCopy(d)
+
+ overrides = localdata.getVar('OVERRIDES')
+ if not overrides:
+ bb.fatal('OVERRIDES not defined')
+
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+
+ btypes = [ [ "", syslinux_default_console ] ]
+ if menu and syslinux_serial:
+ btypes = [ [ "Graphics console ", syslinux_default_console ],
+ [ "Serial console ", syslinux_serial_tty ] ]
+
+ root= d.getVar('SYSLINUX_ROOT')
+ if not root:
+ bb.fatal('SYSLINUX_ROOT not defined')
+
+ kernel = localdata.getVar('KERNEL_IMAGETYPE')
+ for btype in btypes:
+ cfgfile.write('LABEL %s%s\nKERNEL /%s\n' % (btype[0], label, kernel))
+
+ exargs = d.getVar('SYSLINUX_KERNEL_ARGS')
+ if exargs:
+ btype[1] += " " + exargs
+
+ append = localdata.getVar('APPEND')
+ initrd = localdata.getVar('INITRD')
+
+ append = root + " " + append
+ cfgfile.write('APPEND ')
+
+ if initrd:
+ cfgfile.write('initrd=/initrd ')
+
+ cfgfile.write('LABEL=%s '% (label))
+ append = replace_rootfs_uuid(d, append)
+ cfgfile.write('%s %s\n' % (append, btype[1]))
+
+ cfgfile.close()
+}
+build_syslinux_cfg[dirs] = "${S}"
diff --git a/poky/meta/classes/systemd-boot-cfg.bbclass b/poky/meta/classes/systemd-boot-cfg.bbclass
new file mode 100644
index 000000000..021c9f933
--- /dev/null
+++ b/poky/meta/classes/systemd-boot-cfg.bbclass
@@ -0,0 +1,68 @@
+SYSTEMD_BOOT_CFG ?= "${S}/loader.conf"
+SYSTEMD_BOOT_ENTRIES ?= ""
+SYSTEMD_BOOT_TIMEOUT ?= "10"
+
+# Need UUID utility code.
+inherit fs-uuid
+
+python build_efi_cfg() {
+ s = d.getVar("S")
+ labels = d.getVar('LABELS')
+ if not labels:
+ bb.debug(1, "LABELS not defined, nothing to do")
+ return
+
+ if labels == []:
+ bb.debug(1, "No labels, nothing to do")
+ return
+
+ cfile = d.getVar('SYSTEMD_BOOT_CFG')
+ cdir = os.path.dirname(cfile)
+ if not os.path.exists(cdir):
+ os.makedirs(cdir)
+ try:
+ cfgfile = open(cfile, 'w')
+ except OSError:
+ bb.fatal('Unable to open %s' % cfile)
+
+ cfgfile.write('# Automatically created by OE\n')
+ cfgfile.write('default %s\n' % (labels.split()[0]))
+ timeout = d.getVar('SYSTEMD_BOOT_TIMEOUT')
+ if timeout:
+ cfgfile.write('timeout %s\n' % timeout)
+ else:
+ cfgfile.write('timeout 10\n')
+ cfgfile.close()
+
+ for label in labels.split():
+ localdata = d.createCopy()
+
+ entryfile = "%s/%s.conf" % (s, label)
+ if not os.path.exists(s):
+ os.makedirs(s)
+ d.appendVar("SYSTEMD_BOOT_ENTRIES", " " + entryfile)
+ try:
+ entrycfg = open(entryfile, "w")
+ except OSError:
+ bb.fatal('Unable to open %s' % entryfile)
+
+ entrycfg.write('title %s\n' % label)
+
+ kernel = localdata.getVar("KERNEL_IMAGETYPE")
+ entrycfg.write('linux /%s\n' % kernel)
+
+ append = localdata.getVar('APPEND')
+ initrd = localdata.getVar('INITRD')
+
+ if initrd:
+ entrycfg.write('initrd /initrd\n')
+ lb = label
+ if label == "install":
+ lb = "install-efi"
+ entrycfg.write('options LABEL=%s ' % lb)
+ if append:
+ append = replace_rootfs_uuid(d, append)
+ entrycfg.write('%s' % append)
+ entrycfg.write('\n')
+ entrycfg.close()
+}
diff --git a/poky/meta/classes/systemd-boot.bbclass b/poky/meta/classes/systemd-boot.bbclass
new file mode 100644
index 000000000..3cd6811a6
--- /dev/null
+++ b/poky/meta/classes/systemd-boot.bbclass
@@ -0,0 +1,60 @@
+# Copyright (C) 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# systemd-boot.bbclass - The "systemd-boot" is essentially the gummiboot merged into systemd.
+# The original standalone gummiboot project is dead without any more
+# maintenance.
+#
+# Set EFI_PROVIDER = "systemd-boot" to use systemd-boot on your live images instead of grub-efi
+# (images built by image-live.bbclass)
+
+do_bootimg[depends] += "${MLPREFIX}systemd-boot:do_deploy"
+
+EFIDIR = "/EFI/BOOT"
+# Need UUID utility code.
+inherit fs-uuid
+
+efi_populate() {
+ DEST=$1
+
+ EFI_IMAGE="systemd-bootia32.efi"
+ DEST_EFI_IMAGE="bootia32.efi"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ EFI_IMAGE="systemd-bootx64.efi"
+ DEST_EFI_IMAGE="bootx64.efi"
+ fi
+
+ install -d ${DEST}${EFIDIR}
+ # systemd-boot requires these paths for configuration files
+ # they are not customizable so no point in new vars
+ install -d ${DEST}/loader
+ install -d ${DEST}/loader/entries
+ install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEST}${EFIDIR}/${DEST_EFI_IMAGE}
+ EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+ printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_EFI_IMAGE" >${DEST}/startup.nsh
+ install -m 0644 ${SYSTEMD_BOOT_CFG} ${DEST}/loader/loader.conf
+ for i in ${SYSTEMD_BOOT_ENTRIES}; do
+ install -m 0644 ${i} ${DEST}/loader/entries
+ done
+}
+
+efi_iso_populate() {
+ iso_dir=$1
+ efi_populate $iso_dir
+ mkdir -p ${EFIIMGDIR}/${EFIDIR}
+ cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+ cp -r $iso_dir/loader ${EFIIMGDIR}
+ cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
+ EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+ echo "fs0:${EFIPATH}\\${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+ if [ -f "$iso_dir/initrd" ] ; then
+ cp $iso_dir/initrd ${EFIIMGDIR}
+ fi
+}
+
+efi_hddimg_populate() {
+ efi_populate $1
+}
+
+inherit systemd-boot-cfg
diff --git a/poky/meta/classes/systemd.bbclass b/poky/meta/classes/systemd.bbclass
new file mode 100644
index 000000000..1b134322f
--- /dev/null
+++ b/poky/meta/classes/systemd.bbclass
@@ -0,0 +1,212 @@
+# The list of packages that should have systemd packaging scripts added. For
+# each entry, optionally have a SYSTEMD_SERVICE_[package] that lists the service
+# files in this package. If this variable isn't set, [package].service is used.
+SYSTEMD_PACKAGES ?= "${PN}"
+SYSTEMD_PACKAGES_class-native ?= ""
+SYSTEMD_PACKAGES_class-nativesdk ?= ""
+
+# Whether to enable or disable the services on installation.
+SYSTEMD_AUTO_ENABLE ??= "enable"
+
+# This class will be included in any recipe that supports systemd init scripts,
+# even if systemd is not in DISTRO_FEATURES. As such don't make any changes
+# directly but check the DISTRO_FEATURES first.
+python __anonymous() {
+ # If the distro features have systemd but not sysvinit, inhibit update-rcd
+ # from doing any work so that pure-systemd images don't have redundant init
+ # files.
+ if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+ d.appendVar("DEPENDS", " systemd-systemctl-native")
+ d.appendVar("PACKAGE_WRITE_DEPS", " systemd-systemctl-native")
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+systemd_postinst() {
+OPTS=""
+
+if [ -n "$D" ]; then
+ OPTS="--root=$D"
+fi
+
+if type systemctl >/dev/null 2>/dev/null; then
+ if [ -z "$D" ]; then
+ systemctl daemon-reload
+ fi
+
+ systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
+
+ if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
+ systemctl --no-block restart ${SYSTEMD_SERVICE}
+ fi
+fi
+}
+
+systemd_prerm() {
+OPTS=""
+
+if [ -n "$D" ]; then
+ OPTS="--root=$D"
+fi
+
+if type systemctl >/dev/null 2>/dev/null; then
+ if [ -z "$D" ]; then
+ systemctl stop ${SYSTEMD_SERVICE}
+ fi
+
+ systemctl $OPTS disable ${SYSTEMD_SERVICE}
+fi
+}
+
+
+systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst"
+systemd_populate_packages[vardepsexclude] += "OVERRIDES"
+
+
+python systemd_populate_packages() {
+ import re
+
+ if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+ return
+
+ def get_package_var(d, var, pkg):
+ val = (d.getVar('%s_%s' % (var, pkg)) or "").strip()
+ if val == "":
+ val = (d.getVar(var) or "").strip()
+ return val
+
+ # Check if systemd-packages already included in PACKAGES
+ def systemd_check_package(pkg_systemd):
+ packages = d.getVar('PACKAGES')
+ if not pkg_systemd in packages.split():
+ bb.error('%s does not appear in package list, please add it' % pkg_systemd)
+
+
+ def systemd_generate_package_scripts(pkg):
+ bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
+
+ # Add pkg to the overrides so that it finds the SYSTEMD_SERVICE_pkg
+ # variable.
+ localdata = d.createCopy()
+ localdata.prependVar("OVERRIDES", pkg + ":")
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += localdata.getVar('systemd_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ prerm = d.getVar('pkg_prerm_%s' % pkg)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += localdata.getVar('systemd_prerm')
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+
+ # Add files to FILES_*-systemd if existent and not already done
+ def systemd_append_file(pkg_systemd, file_append):
+ appended = False
+ if os.path.exists(oe.path.join(d.getVar("D"), file_append)):
+ var_name = "FILES_" + pkg_systemd
+ files = d.getVar(var_name, False) or ""
+ if file_append not in files.split():
+ d.appendVar(var_name, " " + file_append)
+ appended = True
+ return appended
+
+ # Add systemd files to FILES_*-systemd, parse for Also= and follow recursive
+ def systemd_add_files_and_parse(pkg_systemd, path, service, keys):
+ # avoid infinite recursion
+ if systemd_append_file(pkg_systemd, oe.path.join(path, service)):
+ fullpath = oe.path.join(d.getVar("D"), path, service)
+ if service.find('.service') != -1:
+ # for *.service add *@.service
+ service_base = service.replace('.service', '')
+ systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
+ if service.find('.socket') != -1:
+ # for *.socket add *.service and *@.service
+ service_base = service.replace('.socket', '')
+ systemd_add_files_and_parse(pkg_systemd, path, service_base + '.service', keys)
+ systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
+ for key in keys.split():
+ # recurse all dependencies found in keys ('Also';'Conflicts';..) and add to files
+ cmd = "grep %s %s | sed 's,%s=,,g' | tr ',' '\\n'" % (key, fullpath, key)
+ pipe = os.popen(cmd, 'r')
+ line = pipe.readline()
+ while line:
+ line = line.replace('\n', '')
+ systemd_add_files_and_parse(pkg_systemd, path, line, keys)
+ line = pipe.readline()
+ pipe.close()
+
+ # Check service-files and call systemd_add_files_and_parse for each entry
+ def systemd_check_services():
+ searchpaths = [oe.path.join(d.getVar("sysconfdir"), "systemd", "system"),]
+ searchpaths.append(d.getVar("systemd_system_unitdir"))
+ systemd_packages = d.getVar('SYSTEMD_PACKAGES')
+
+ keys = 'Also'
+ # scan for all in SYSTEMD_SERVICE[]
+ for pkg_systemd in systemd_packages.split():
+ for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
+ path_found = ''
+
+ # Deal with adding, for example, 'ifplugd@eth0.service' from
+ # 'ifplugd@.service'
+ base = None
+ at = service.find('@')
+ if at != -1:
+ ext = service.rfind('.')
+ base = service[:at] + '@' + service[ext:]
+
+ for path in searchpaths:
+ if os.path.exists(oe.path.join(d.getVar("D"), path, service)):
+ path_found = path
+ break
+ elif base is not None:
+ if os.path.exists(oe.path.join(d.getVar("D"), path, base)):
+ path_found = path
+ break
+
+ if path_found != '':
+ systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
+ else:
+ bb.fatal("SYSTEMD_SERVICE_%s value %s does not exist" % (pkg_systemd, service))
+
+ # Run all modifications once when creating package
+ if os.path.exists(d.getVar("D")):
+ for pkg in d.getVar('SYSTEMD_PACKAGES').split():
+ systemd_check_package(pkg)
+ if d.getVar('SYSTEMD_SERVICE_' + pkg):
+ systemd_generate_package_scripts(pkg)
+ systemd_check_services()
+}
+
+PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
+
+python rm_systemd_unitdir (){
+ import shutil
+ if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+ systemd_unitdir = oe.path.join(d.getVar("D"), d.getVar('systemd_unitdir'))
+ if os.path.exists(systemd_unitdir):
+ shutil.rmtree(systemd_unitdir)
+ systemd_libdir = os.path.dirname(systemd_unitdir)
+ if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
+ os.rmdir(systemd_libdir)
+}
+do_install[postfuncs] += "rm_systemd_unitdir "
+
+python rm_sysvinit_initddir (){
+ import shutil
+ sysv_initddir = oe.path.join(d.getVar("D"), (d.getVar('INIT_D_DIR') or "/etc/init.d"))
+
+ if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
+ not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+ os.path.exists(sysv_initddir):
+ systemd_system_unitdir = oe.path.join(d.getVar("D"), d.getVar('systemd_system_unitdir'))
+
+ # If systemd_system_unitdir contains anything, delete sysv_initddir
+ if (os.path.exists(systemd_system_unitdir) and os.listdir(systemd_system_unitdir)):
+ shutil.rmtree(sysv_initddir)
+}
+do_install[postfuncs] += "rm_sysvinit_initddir "
diff --git a/poky/meta/classes/terminal.bbclass b/poky/meta/classes/terminal.bbclass
new file mode 100644
index 000000000..a27e10c6e
--- /dev/null
+++ b/poky/meta/classes/terminal.bbclass
@@ -0,0 +1,105 @@
+OE_TERMINAL ?= 'auto'
+OE_TERMINAL[type] = 'choice'
+OE_TERMINAL[choices] = 'auto none \
+ ${@oe_terminal_prioritized()}'
+
+OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE CACHED_CONFIGUREVARS CONFIGUREOPTS EXTRA_OECONF'
+OE_TERMINAL_EXPORTS[type] = 'list'
+
+XAUTHORITY ?= "${HOME}/.Xauthority"
+SHELL ?= "bash"
+
+def oe_terminal_prioritized():
+ import oe.terminal
+ return " ".join(o.name for o in oe.terminal.prioritized())
+
+def emit_terminal_func(command, envdata, d):
+ cmd_func = 'do_terminal'
+
+ envdata.setVar(cmd_func, 'exec ' + command)
+ envdata.setVarFlag(cmd_func, 'func', '1')
+
+ runfmt = d.getVar('BB_RUNFMT') or "run.{func}.{pid}"
+ runfile = runfmt.format(func=cmd_func, task=cmd_func, taskfunc=cmd_func, pid=os.getpid())
+ runfile = os.path.join(d.getVar('T'), runfile)
+ bb.utils.mkdirhier(os.path.dirname(runfile))
+
+ with open(runfile, 'w') as script:
+ script.write('#!/bin/sh -e\n')
+ bb.data.emit_func(cmd_func, script, envdata)
+ script.write(cmd_func)
+ script.write("\n")
+ os.chmod(runfile, 0o755)
+
+ return runfile
+
+def oe_terminal(command, title, d):
+ import oe.data
+ import oe.terminal
+
+ envdata = bb.data.init()
+
+ for v in os.environ:
+ envdata.setVar(v, os.environ[v])
+ envdata.setVarFlag(v, 'export', '1')
+
+ for export in oe.data.typed_value('OE_TERMINAL_EXPORTS', d):
+ value = d.getVar(export)
+ if value is not None:
+ os.environ[export] = str(value)
+ envdata.setVar(export, str(value))
+ envdata.setVarFlag(export, 'export', '1')
+ if export == "PSEUDO_DISABLED":
+ if "PSEUDO_UNLOAD" in os.environ:
+ del os.environ["PSEUDO_UNLOAD"]
+ envdata.delVar("PSEUDO_UNLOAD")
+
+ # Add in all variables from the user's original environment which
+ # haven't subsequntly been set/changed
+ origbbenv = d.getVar("BB_ORIGENV", False) or {}
+ for key in origbbenv:
+ if key in envdata:
+ continue
+ value = origbbenv.getVar(key)
+ if value is not None:
+ os.environ[key] = str(value)
+ envdata.setVar(key, str(value))
+ envdata.setVarFlag(key, 'export', '1')
+
+ # Use original PATH as a fallback
+ path = d.getVar('PATH') + ":" + origbbenv.getVar('PATH')
+ os.environ['PATH'] = path
+ envdata.setVar('PATH', path)
+
+ # A complex PS1 might need more escaping of chars.
+ # Lets not export PS1 instead.
+ envdata.delVar("PS1")
+
+ # Replace command with an executable wrapper script
+ command = emit_terminal_func(command, envdata, d)
+
+ terminal = oe.data.typed_value('OE_TERMINAL', d).lower()
+ if terminal == 'none':
+ bb.fatal('Devshell usage disabled with OE_TERMINAL')
+ elif terminal != 'auto':
+ try:
+ oe.terminal.spawn(terminal, command, title, None, d)
+ return
+ except oe.terminal.UnsupportedTerminal:
+ bb.warn('Unsupported terminal "%s", defaulting to "auto"' %
+ terminal)
+ except oe.terminal.ExecutionError as exc:
+ bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+ try:
+ oe.terminal.spawn_preferred(command, title, None, d)
+ except oe.terminal.NoSupportedTerminals as nosup:
+ nosup.terms.remove("false")
+ cmds = '\n\t'.join(nosup.terms).replace("{command}",
+ "do_terminal").replace("{title}", title)
+ bb.fatal('No valid terminal found, unable to open devshell.\n' +
+ 'Tried the following commands:\n\t%s' % cmds)
+ except oe.terminal.ExecutionError as exc:
+ bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+oe_terminal[vardepsexclude] = "BB_ORIGENV"
diff --git a/poky/meta/classes/testexport.bbclass b/poky/meta/classes/testexport.bbclass
new file mode 100644
index 000000000..d070f07af
--- /dev/null
+++ b/poky/meta/classes/testexport.bbclass
@@ -0,0 +1,177 @@
+# Copyright (C) 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+#
+# testexport.bbclass allows to execute runtime test outside OE environment.
+# Most of the tests are commands run on target image over ssh.
+# To use it add testexport to global inherit and call your target image with -c testexport
+# You can try it out like this:
+# - First build an image. i.e. core-image-sato
+# - Add INHERIT += "testexport" in local.conf
+# - Then bitbake core-image-sato -c testexport. That will generate the directory structure
+# to execute the runtime tests using runexported.py.
+#
+# For more information on TEST_SUITES check testimage class.
+
+TEST_LOG_DIR ?= "${WORKDIR}/testexport"
+TEST_EXPORT_DIR ?= "${TMPDIR}/testexport/${PN}"
+TEST_EXPORT_PACKAGED_DIR ?= "packages/packaged"
+TEST_EXPORT_EXTRACTED_DIR ?= "packages/extracted"
+
+TEST_TARGET ?= "simpleremote"
+TEST_TARGET_IP ?= ""
+TEST_SERVER_IP ?= ""
+
+TEST_EXPORT_SDK_PACKAGES ?= ""
+TEST_EXPORT_SDK_ENABLED ?= "0"
+TEST_EXPORT_SDK_NAME ?= "testexport-tools-nativesdk"
+TEST_EXPORT_SDK_DIR ?= "sdk"
+
+TEST_EXPORT_DEPENDS = ""
+TEST_EXPORT_DEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
+TEST_EXPORT_DEPENDS += "${@bb.utils.contains('TEST_EXPORT_SDK_ENABLED', '1', 'testexport-tarball:do_populate_sdk', '', d)}"
+TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock"
+
+addtask testexport
+do_testexport[nostamp] = "1"
+do_testexport[depends] += "${TEST_EXPORT_DEPENDS} ${TESTIMAGEDEPENDS}"
+do_testexport[lockfiles] += "${TEST_EXPORT_LOCK}"
+
+python do_testexport() {
+ testexport_main(d)
+}
+
+def testexport_main(d):
+ import json
+ import logging
+
+ from oeqa.runtime.context import OERuntimeTestContext
+ from oeqa.runtime.context import OERuntimeTestContextExecutor
+
+ image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+ d.getVar('IMAGE_LINK_NAME')))
+
+ tdname = "%s.testdata.json" % image_name
+ td = json.load(open(tdname, "r"))
+
+ logger = logging.getLogger("BitBake")
+
+ target = OERuntimeTestContextExecutor.getTarget(
+ d.getVar("TEST_TARGET"), None, d.getVar("TEST_TARGET_IP"),
+ d.getVar("TEST_SERVER_IP"))
+
+ host_dumper = OERuntimeTestContextExecutor.getHostDumper(
+ d.getVar("testimage_dump_host"), d.getVar("TESTIMAGE_DUMP_DIR"))
+
+ image_manifest = "%s.manifest" % image_name
+ image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest)
+
+ extract_dir = d.getVar("TEST_EXTRACTED_DIR")
+
+ tc = OERuntimeTestContext(td, logger, target, host_dumper,
+ image_packages, extract_dir)
+
+ copy_needed_files(d, tc)
+
+def copy_needed_files(d, tc):
+ import shutil
+ import oe.path
+
+ from oeqa.utils.package_manager import _get_json_file
+ from oeqa.core.utils.test import getSuiteCasesFiles
+
+ export_path = d.getVar('TEST_EXPORT_DIR')
+ corebase_path = d.getVar('COREBASE')
+
+ # Clean everything before starting
+ oe.path.remove(export_path)
+ bb.utils.mkdirhier(os.path.join(export_path, 'lib', 'oeqa'))
+
+ # The source of files to copy are relative to 'COREBASE' directory
+ # The destination is relative to 'TEST_EXPORT_DIR'
+ # Because we are squashing the libraries, we need to remove
+ # the layer/script directory
+ files_to_copy = [ os.path.join('meta', 'lib', 'oeqa', 'core'),
+ os.path.join('meta', 'lib', 'oeqa', 'runtime'),
+ os.path.join('meta', 'lib', 'oeqa', 'files'),
+ os.path.join('meta', 'lib', 'oeqa', 'utils'),
+ os.path.join('scripts', 'oe-test'),
+ os.path.join('scripts', 'lib', 'argparse_oe.py'),
+ os.path.join('scripts', 'lib', 'scriptutils.py'), ]
+
+ for f in files_to_copy:
+ src = os.path.join(corebase_path, f)
+ dst = os.path.join(export_path, f.split('/', 1)[-1])
+ if os.path.isdir(src):
+ oe.path.copytree(src, dst)
+ else:
+ shutil.copy2(src, dst)
+
+ # Remove cases and just copy the ones specified
+ cases_path = os.path.join(export_path, 'lib', 'oeqa', 'runtime', 'cases')
+ oe.path.remove(cases_path)
+ bb.utils.mkdirhier(cases_path)
+ test_paths = get_runtime_paths(d)
+ test_modules = d.getVar('TEST_SUITES').split()
+ tc.loadTests(test_paths, modules=test_modules)
+ for f in getSuiteCasesFiles(tc.suites):
+ shutil.copy2(f, cases_path)
+ json_file = _get_json_file(f)
+ if json_file:
+ shutil.copy2(json_file, cases_path)
+
+ # Copy test data
+ image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+ d.getVar('IMAGE_LINK_NAME')))
+ image_manifest = "%s.manifest" % image_name
+ tdname = "%s.testdata.json" % image_name
+ test_data_path = os.path.join(export_path, 'data')
+ bb.utils.mkdirhier(test_data_path)
+ shutil.copy2(image_manifest, os.path.join(test_data_path, 'manifest'))
+ shutil.copy2(tdname, os.path.join(test_data_path, 'testdata.json'))
+
+ # Create tar file for common parts of testexport
+ create_tarball(d, "testexport.tar.gz", d.getVar("TEST_EXPORT_DIR"))
+
+ # Copy packages needed for runtime testing
+ package_extraction(d, tc.suites)
+ test_pkg_dir = d.getVar("TEST_NEEDED_PACKAGES_DIR")
+ if os.path.isdir(test_pkg_dir) and os.listdir(test_pkg_dir):
+ export_pkg_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"), "packages")
+ oe.path.copytree(test_pkg_dir, export_pkg_dir)
+ # Create tar file for packages needed by the DUT
+ create_tarball(d, "testexport_packages_%s.tar.gz" % d.getVar("MACHINE"), export_pkg_dir)
+
+ # Copy SDK
+ if d.getVar("TEST_EXPORT_SDK_ENABLED") == "1":
+ sdk_deploy = d.getVar("SDK_DEPLOY")
+ tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME")
+ tarball_path = os.path.join(sdk_deploy, tarball_name)
+ export_sdk_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"),
+ d.getVar("TEST_EXPORT_SDK_DIR"))
+ bb.utils.mkdirhier(export_sdk_dir)
+ shutil.copy2(tarball_path, export_sdk_dir)
+
+ # Create tar file for the sdk
+ create_tarball(d, "testexport_sdk_%s.tar.gz" % d.getVar("SDK_ARCH"), export_sdk_dir)
+
+ bb.plain("Exported tests to: %s" % export_path)
+
+def create_tarball(d, tar_name, src_dir):
+
+ import tarfile
+
+ tar_path = os.path.join(d.getVar("TEST_EXPORT_DIR"), tar_name)
+ current_dir = os.getcwd()
+ src_dir = src_dir.rstrip('/')
+ dir_name = os.path.dirname(src_dir)
+ base_name = os.path.basename(src_dir)
+
+ os.chdir(dir_name)
+ tar = tarfile.open(tar_path, "w:gz")
+ tar.add(base_name)
+ tar.close()
+ os.chdir(current_dir)
+
+inherit testimage
diff --git a/poky/meta/classes/testimage-auto.bbclass b/poky/meta/classes/testimage-auto.bbclass
new file mode 100644
index 000000000..e0a22b773
--- /dev/null
+++ b/poky/meta/classes/testimage-auto.bbclass
@@ -0,0 +1,23 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# Run tests automatically on an image after the image is constructed
+# (as opposed to testimage.bbclass alone where tests must be called
+# manually using bitbake -c testimage <image>).
+#
+# NOTE: to use this class, simply set TEST_IMAGE = "1" - no need to
+# inherit it since that will be done in image.bbclass when this variable
+# has been set.
+#
+# See testimage.bbclass for the test implementation.
+
+inherit testimage
+
+python do_testimage_auto() {
+ testimage_main(d)
+}
+addtask testimage_auto before do_build after do_image_complete
+do_testimage_auto[depends] += "${TESTIMAGEDEPENDS}"
+do_testimage_auto[lockfiles] += "${TESTIMAGELOCK}"
diff --git a/poky/meta/classes/testimage.bbclass b/poky/meta/classes/testimage.bbclass
new file mode 100644
index 000000000..77291c22c
--- /dev/null
+++ b/poky/meta/classes/testimage.bbclass
@@ -0,0 +1,375 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# testimage.bbclass enables testing of qemu images using python unittests.
+# Most of the tests are commands run on target image over ssh.
+# To use it add testimage to global inherit and call your target image with -c testimage
+# You can try it out like this:
+# - first add IMAGE_CLASSES += "testimage" in local.conf
+# - build a qemu core-image-sato
+# - then bitbake core-image-sato -c testimage. That will run a standard suite of tests.
+
+# You can set (or append to) TEST_SUITES in local.conf to select the tests
+# which you want to run for your target.
+# The test names are the module names in meta/lib/oeqa/runtime/cases.
+# Each name in TEST_SUITES represents a required test for the image. (no skipping allowed)
+# Appending "auto" means that it will try to run all tests that are suitable for the image (each test decides that on it's own).
+# Note that order in TEST_SUITES is relevant: tests are run in an order such that
+# tests mentioned in @skipUnlessPassed run before the tests that depend on them,
+# but without such dependencies, tests run in the order in which they are listed
+# in TEST_SUITES.
+#
+# A layer can add its own tests in lib/oeqa/runtime, provided it extends BBPATH as normal in its layer.conf.
+
+# TEST_LOG_DIR contains a command ssh log and may contain infromation about what command is running, output and return codes and for qemu a boot log till login.
+# Booting is handled by this class, and it's not a test in itself.
+# TEST_QEMUBOOT_TIMEOUT can be used to set the maximum time in seconds the launch code will wait for the login prompt.
+
+TEST_LOG_DIR ?= "${WORKDIR}/testimage"
+
+TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}"
+TEST_INSTALL_TMP_DIR ?= "${WORKDIR}/testimage/install_tmp"
+TEST_NEEDED_PACKAGES_DIR ?= "${WORKDIR}/testimage/packages"
+TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted"
+TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged"
+
+RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf rpm', '', d)}"
+SYSTEMDSUITE = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+MINTESTSUITE = "ping"
+NETTESTSUITE = "${MINTESTSUITE} ssh df date scp oe_syslog ${SYSTEMDSUITE}"
+DEVTESTSUITE = "gcc kernelmodule ldd"
+
+DEFAULT_TEST_SUITES = "${MINTESTSUITE} auto"
+DEFAULT_TEST_SUITES_pn-core-image-minimal = "${MINTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-minimal-dev = "${MINTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-full-cmdline = "${NETTESTSUITE} perl python logrotate ptest"
+DEFAULT_TEST_SUITES_pn-core-image-x11 = "${MINTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs ${RPMTESTSUITE} ptest"
+DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg parselogs ${RPMTESTSUITE} \
+ ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)} ptest gi"
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio buildlzip buildgalculator \
+ connman ${DEVTESTSUITE} logrotate perl parselogs python ${RPMTESTSUITE} xorg ptest gi stap"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python parselogs ${RPMTESTSUITE} ptest gi"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio buildlzip buildgalculator \
+ connman ${DEVTESTSUITE} logrotate pam parselogs perl python ${RPMTESTSUITE} ptest gi stap"
+DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
+
+# aarch64 has no graphics
+DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
+# musl doesn't support systemtap
+DEFAULT_TEST_SUITES_remove_libc-musl = "stap"
+
+# qemumips is quite slow and has reached the timeout limit several times on the YP build cluster,
+# mitigate this by removing build tests for qemumips machines.
+MIPSREMOVE ??= "buildcpio buildlzip buildgalculator"
+DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
+DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
+
+TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
+
+TEST_QEMUBOOT_TIMEOUT ?= "1000"
+TEST_TARGET ?= "qemu"
+
+TESTIMAGEDEPENDS = ""
+TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}"
+TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
+
+TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
+TESTIMAGELOCK_qemuall = ""
+
+TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
+
+TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR"
+
+testimage_dump_target () {
+ top -bn1
+ ps
+ free
+ df
+ # The next command will export the default gateway IP
+ export DEFAULT_GATEWAY=$(ip route | awk '/default/ { print $3}')
+ ping -c3 $DEFAULT_GATEWAY
+ dmesg
+ netstat -an
+ ip address
+ # Next command will dump logs from /var/log/
+ find /var/log/ -type f 2>/dev/null -exec echo "====================" \; -exec echo {} \; -exec echo "====================" \; -exec cat {} \; -exec echo "" \;
+}
+
+testimage_dump_host () {
+ top -bn1
+ iostat -x -z -N -d -p ALL 20 2
+ ps -ef
+ free
+ df
+ memstat
+ dmesg
+ ip -s link
+ netstat -an
+}
+
+python do_testimage() {
+
+ testimage_sanity(d)
+
+ if (d.getVar('IMAGE_PKGTYPE') == 'rpm'
+ and 'dnf' in d.getVar('TEST_SUITES')):
+ create_rpm_index(d)
+
+ testimage_main(d)
+}
+
+addtask testimage
+do_testimage[nostamp] = "1"
+do_testimage[depends] += "${TESTIMAGEDEPENDS}"
+do_testimage[lockfiles] += "${TESTIMAGELOCK}"
+
+def testimage_sanity(d):
+ if (d.getVar('TEST_TARGET') == 'simpleremote'
+ and (not d.getVar('TEST_TARGET_IP')
+ or not d.getVar('TEST_SERVER_IP'))):
+ bb.fatal('When TEST_TARGET is set to "simpleremote" '
+ 'TEST_TARGET_IP and TEST_SERVER_IP are needed too.')
+
+def testimage_main(d):
+ import os
+ import json
+ import signal
+ import logging
+
+ from bb.utils import export_proxies
+ from oeqa.core.utils.misc import updateTestData
+ from oeqa.runtime.context import OERuntimeTestContext
+ from oeqa.runtime.context import OERuntimeTestContextExecutor
+ from oeqa.core.target.qemu import supported_fstypes
+ from oeqa.core.utils.test import getSuiteCases
+ from oeqa.utils import make_logger_bitbake_compatible
+
+ def sigterm_exception(signum, stackframe):
+ """
+ Catch SIGTERM from worker in order to stop qemu.
+ """
+ raise RuntimeError
+
+ logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
+ pn = d.getVar("PN")
+
+ bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR"))
+
+ image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
+ d.getVar('IMAGE_LINK_NAME')))
+
+ tdname = "%s.testdata.json" % image_name
+ try:
+ td = json.load(open(tdname, "r"))
+ except (FileNotFoundError) as err:
+ bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname)
+
+ # Some variables need to be updates (mostly paths) with the
+ # ones of the current environment because some tests require them.
+ updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split())
+
+ image_manifest = "%s.manifest" % image_name
+ image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest)
+
+ extract_dir = d.getVar("TEST_EXTRACTED_DIR")
+
+ # Get machine
+ machine = d.getVar("MACHINE")
+
+ # Get rootfs
+ fstypes = [fs for fs in d.getVar('IMAGE_FSTYPES').split(' ')
+ if fs in supported_fstypes]
+ if not fstypes:
+ bb.fatal('Unsupported image type built. Add a comptible image to '
+ 'IMAGE_FSTYPES. Supported types: %s' %
+ ', '.join(supported_fstypes))
+ rootfs = '%s.%s' % (image_name, fstypes[0])
+
+ # Get tmpdir (not really used, just for compatibility)
+ tmpdir = d.getVar("TMPDIR")
+
+ # Get deploy_dir_image (not really used, just for compatibility)
+ dir_image = d.getVar("DEPLOY_DIR_IMAGE")
+
+ # Get bootlog
+ bootlog = os.path.join(d.getVar("TEST_LOG_DIR"),
+ 'qemu_boot_log.%s' % d.getVar('DATETIME'))
+
+ # Get display
+ display = d.getVar("BB_ORIGENV").getVar("DISPLAY")
+
+ # Get kernel
+ kernel_name = ('%s-%s.bin' % (d.getVar("KERNEL_IMAGETYPE"), machine))
+ kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), kernel_name)
+
+ # Get boottime
+ boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT"))
+
+ # Get use_kvm
+ qemu_use_kvm = d.getVar("QEMU_USE_KVM")
+ if qemu_use_kvm and \
+ (oe.types.boolean(qemu_use_kvm) and 'x86' in machine or \
+ d.getVar('MACHINE') in qemu_use_kvm.split()):
+ kvm = True
+ else:
+ kvm = False
+
+ # TODO: We use the current implementatin of qemu runner because of
+ # time constrains, qemu runner really needs a refactor too.
+ target_kwargs = { 'machine' : machine,
+ 'rootfs' : rootfs,
+ 'tmpdir' : tmpdir,
+ 'dir_image' : dir_image,
+ 'display' : display,
+ 'kernel' : kernel,
+ 'boottime' : boottime,
+ 'bootlog' : bootlog,
+ 'kvm' : kvm,
+ }
+
+ # TODO: Currently BBPATH is needed for custom loading of targets.
+ # It would be better to find these modules using instrospection.
+ target_kwargs['target_modules_path'] = d.getVar('BBPATH')
+
+ # runtime use network for download projects for build
+ export_proxies(d)
+
+ # we need the host dumper in test context
+ host_dumper = OERuntimeTestContextExecutor.getHostDumper(
+ d.getVar("testimage_dump_host"),
+ d.getVar("TESTIMAGE_DUMP_DIR"))
+
+ # the robot dance
+ target = OERuntimeTestContextExecutor.getTarget(
+ d.getVar("TEST_TARGET"), logger, d.getVar("TEST_TARGET_IP"),
+ d.getVar("TEST_SERVER_IP"), **target_kwargs)
+
+ # test context
+ tc = OERuntimeTestContext(td, logger, target, host_dumper,
+ image_packages, extract_dir)
+
+ # Load tests before starting the target
+ test_paths = get_runtime_paths(d)
+ test_modules = d.getVar('TEST_SUITES').split()
+ tc.loadTests(test_paths, modules=test_modules)
+
+ if not getSuiteCases(tc.suites):
+ bb.fatal('Empty test suite, please verify TEST_SUITES variable')
+
+ package_extraction(d, tc.suites)
+
+ bootparams = None
+ if d.getVar('VIRTUAL-RUNTIME_init_manager', '') == 'systemd':
+ # Add systemd.log_level=debug to enable systemd debug logging
+ bootparams = 'systemd.log_target=console'
+
+ results = None
+ orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception)
+ try:
+ # We need to check if runqemu ends unexpectedly
+ # or if the worker send us a SIGTERM
+ tc.target.start(extra_bootparams=bootparams)
+ results = tc.runTests()
+ except (RuntimeError, BlockingIOError) as err:
+ if isinstance(err, RuntimeError):
+ bb.error('testimage received SIGTERM, shutting down...')
+ else:
+ bb.error('runqemu failed, shutting down...')
+ if results:
+ results.stop()
+ results = None
+ finally:
+ signal.signal(signal.SIGTERM, orig_sigterm_handler)
+ tc.target.stop()
+
+ # Show results (if we have them)
+ if not results:
+ bb.fatal('%s - FAILED - tests were interrupted during execution' % pn, forcelog=True)
+ results.logDetails()
+ results.logSummary(pn)
+ if not results.wasSuccessful():
+ bb.fatal('%s - FAILED - check the task log and the ssh log' % pn, forcelog=True)
+
+def get_runtime_paths(d):
+ """
+ Returns a list of paths where runtime test must reside.
+
+ Runtime tests are expected in <LAYER_DIR>/lib/oeqa/runtime/cases/
+ """
+ paths = []
+
+ for layer in d.getVar('BBLAYERS').split():
+ path = os.path.join(layer, 'lib/oeqa/runtime/cases')
+ if os.path.isdir(path):
+ paths.append(path)
+ return paths
+
+def create_index(arg):
+ import subprocess
+
+ index_cmd = arg
+ try:
+ bb.note("Executing '%s' ..." % index_cmd)
+ result = subprocess.check_output(index_cmd,
+ stderr=subprocess.STDOUT,
+ shell=True)
+ result = result.decode('utf-8')
+ except subprocess.CalledProcessError as e:
+ return("Index creation command '%s' failed with return code "
+ '%d:\n%s' % (e.cmd, e.returncode, e.output.decode("utf-8")))
+ if result:
+ bb.note(result)
+ return None
+
+def create_rpm_index(d):
+ # Index RPMs
+ rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
+ index_cmds = []
+ archs = (d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or '').replace('-', '_')
+
+ for arch in archs.split():
+ rpm_dir = os.path.join(d.getVar('DEPLOY_DIR_RPM'), arch)
+ idx_path = os.path.join(d.getVar('WORKDIR'), 'oe-testimage-repo', arch)
+
+ if not os.path.isdir(rpm_dir):
+ continue
+
+ lockfilename = os.path.join(d.getVar('DEPLOY_DIR_RPM'), 'rpm.lock')
+ lf = bb.utils.lockfile(lockfilename, False)
+ oe.path.copyhardlinktree(rpm_dir, idx_path)
+ # Full indexes overload a 256MB image so reduce the number of rpms
+ # in the feed. Filter to r* since we use the run-postinst packages and
+ # this leaves some allarch and machine arch packages too.
+ bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+ bb.utils.unlockfile(lf)
+ cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
+
+ # Create repodata
+ result = create_index(cmd)
+ if result:
+ bb.fatal('%s' % ('\n'.join(result)))
+
+def package_extraction(d, test_suites):
+ from oeqa.utils.package_manager import find_packages_to_extract
+ from oeqa.utils.package_manager import extract_packages
+
+ bb.utils.remove(d.getVar("TEST_NEEDED_PACKAGES_DIR"), recurse=True)
+ packages = find_packages_to_extract(test_suites)
+ if packages:
+ bb.utils.mkdirhier(d.getVar("TEST_INSTALL_TMP_DIR"))
+ bb.utils.mkdirhier(d.getVar("TEST_PACKAGED_DIR"))
+ bb.utils.mkdirhier(d.getVar("TEST_EXTRACTED_DIR"))
+ extract_packages(d, packages)
+
+testimage_main[vardepsexclude] += "BB_ORIGENV DATETIME"
+
+inherit testsdk
diff --git a/poky/meta/classes/testsdk.bbclass b/poky/meta/classes/testsdk.bbclass
new file mode 100644
index 000000000..2e4334364
--- /dev/null
+++ b/poky/meta/classes/testsdk.bbclass
@@ -0,0 +1,196 @@
+# Copyright (C) 2013 - 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# testsdk.bbclass enables testing for SDK and Extensible SDK
+#
+# To run SDK tests, run the commands:
+# $ bitbake <image-name> -c populate_sdk
+# $ bitbake <image-name> -c testsdk
+#
+# To run eSDK tests, run the commands:
+# $ bitbake <image-name> -c populate_sdk_ext
+# $ bitbake <image-name> -c testsdkext
+#
+# where "<image-name>" is an image like core-image-sato.
+
+def testsdk_main(d):
+ import os
+ import subprocess
+ import json
+ import logging
+
+ from bb.utils import export_proxies
+ from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor
+ from oeqa.utils import make_logger_bitbake_compatible
+
+ bb.event.enable_threadlock()
+
+ pn = d.getVar("PN")
+ logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
+
+ # sdk use network for download projects for build
+ export_proxies(d)
+
+ tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
+ if not os.path.exists(tcname):
+ bb.fatal("The toolchain %s is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' ." % tcname)
+
+ tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.testdata.json")
+ test_data = json.load(open(tdname, "r"))
+
+ target_pkg_manifest = OESDKTestContextExecutor._load_manifest(
+ d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"))
+ host_pkg_manifest = OESDKTestContextExecutor._load_manifest(
+ d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"))
+
+ sdk_dir = d.expand("${WORKDIR}/testimage-sdk/")
+ bb.utils.remove(sdk_dir, True)
+ bb.utils.mkdirhier(sdk_dir)
+ try:
+ subprocess.check_output("cd %s; %s <<EOF\n./\nY\nEOF" % (sdk_dir, tcname), shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
+
+ fail = False
+ sdk_envs = OESDKTestContextExecutor._get_sdk_environs(sdk_dir)
+ for s in sdk_envs:
+ sdk_env = sdk_envs[s]
+ bb.plain("SDK testing environment: %s" % s)
+ tc = OESDKTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir,
+ sdk_env=sdk_env, target_pkg_manifest=target_pkg_manifest,
+ host_pkg_manifest=host_pkg_manifest)
+
+ try:
+ tc.loadTests(OESDKTestContextExecutor.default_cases)
+ except Exception as e:
+ import traceback
+ bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+ result = tc.runTests()
+
+ component = "%s %s" % (pn, OESDKTestContextExecutor.name)
+ context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
+
+ result.logDetails()
+ result.logSummary(component, context_msg)
+
+ if not result.wasSuccessful():
+ fail = True
+
+ if fail:
+ bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
+
+testsdk_main[vardepsexclude] =+ "BB_ORIGENV"
+
+python do_testsdk() {
+ testsdk_main(d)
+}
+addtask testsdk
+do_testsdk[nostamp] = "1"
+
+def testsdkext_main(d):
+ import os
+ import json
+ import subprocess
+ import logging
+
+ from bb.utils import export_proxies
+ from oeqa.utils import avoid_paths_in_environ, make_logger_bitbake_compatible, subprocesstweak
+ from oeqa.sdkext.context import OESDKExtTestContext, OESDKExtTestContextExecutor
+
+ bb.event.enable_threadlock()
+
+ pn = d.getVar("PN")
+ logger = make_logger_bitbake_compatible(logging.getLogger("BitBake"))
+
+ # extensible sdk use network
+ export_proxies(d)
+
+ subprocesstweak.errors_have_output()
+
+ # extensible sdk can be contaminated if native programs are
+ # in PATH, i.e. use perl-native instead of eSDK one.
+ paths_to_avoid = [d.getVar('STAGING_DIR'),
+ d.getVar('BASE_WORKDIR')]
+ os.environ['PATH'] = avoid_paths_in_environ(paths_to_avoid)
+
+ tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
+ if not os.path.exists(tcname):
+ bb.fatal("The toolchain ext %s is not built. Build it before running the" \
+ " tests: 'bitbake <image> -c populate_sdk_ext' ." % tcname)
+
+ tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.testdata.json")
+ test_data = json.load(open(tdname, "r"))
+
+ target_pkg_manifest = OESDKExtTestContextExecutor._load_manifest(
+ d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"))
+ host_pkg_manifest = OESDKExtTestContextExecutor._load_manifest(
+ d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest"))
+
+ sdk_dir = d.expand("${WORKDIR}/testsdkext/")
+ bb.utils.remove(sdk_dir, True)
+ bb.utils.mkdirhier(sdk_dir)
+ try:
+ subprocess.check_output("%s -y -d %s" % (tcname, sdk_dir), shell=True)
+ except subprocess.CalledProcessError as e:
+ msg = "Couldn't install the extensible SDK:\n%s" % e.output.decode("utf-8")
+ logfn = os.path.join(sdk_dir, 'preparing_build_system.log')
+ if os.path.exists(logfn):
+ msg += '\n\nContents of preparing_build_system.log:\n'
+ with open(logfn, 'r') as f:
+ for line in f:
+ msg += line
+ bb.fatal(msg)
+
+ fail = False
+ sdk_envs = OESDKExtTestContextExecutor._get_sdk_environs(sdk_dir)
+ for s in sdk_envs:
+ bb.plain("Extensible SDK testing environment: %s" % s)
+
+ sdk_env = sdk_envs[s]
+
+ # Use our own SSTATE_DIR and DL_DIR so that updates to the eSDK come from our sstate cache
+ # and we don't spend hours downloading kernels for the kernel module test
+ # Abuse auto.conf since local.conf would be overwritten by the SDK
+ with open(os.path.join(sdk_dir, 'conf', 'auto.conf'), 'a+') as f:
+ f.write('SSTATE_MIRRORS += " \\n file://.* file://%s/PATH"\n' % test_data.get('SSTATE_DIR'))
+ f.write('SOURCE_MIRROR_URL = "file://%s"\n' % test_data.get('DL_DIR'))
+ f.write('INHERIT += "own-mirrors"\n')
+
+ # We need to do this in case we have a minimal SDK
+ subprocess.check_output(". %s > /dev/null; devtool sdk-install meta-extsdk-toolchain" % \
+ sdk_env, cwd=sdk_dir, shell=True, stderr=subprocess.STDOUT)
+
+ tc = OESDKExtTestContext(td=test_data, logger=logger, sdk_dir=sdk_dir,
+ sdk_env=sdk_env, target_pkg_manifest=target_pkg_manifest,
+ host_pkg_manifest=host_pkg_manifest)
+
+ try:
+ tc.loadTests(OESDKExtTestContextExecutor.default_cases)
+ except Exception as e:
+ import traceback
+ bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+ result = tc.runTests()
+
+ component = "%s %s" % (pn, OESDKExtTestContextExecutor.name)
+ context_msg = "%s:%s" % (os.path.basename(tcname), os.path.basename(sdk_env))
+
+ result.logDetails()
+ result.logSummary(component, context_msg)
+
+ if not result.wasSuccessful():
+ fail = True
+
+ if fail:
+ bb.fatal("%s - FAILED - check the task log and the commands log" % pn)
+
+testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
+
+python do_testsdkext() {
+ testsdkext_main(d)
+}
+addtask testsdkext
+do_testsdkext[nostamp] = "1"
+
diff --git a/poky/meta/classes/texinfo.bbclass b/poky/meta/classes/texinfo.bbclass
new file mode 100644
index 000000000..6b0def0ea
--- /dev/null
+++ b/poky/meta/classes/texinfo.bbclass
@@ -0,0 +1,18 @@
+# This class is inherited by recipes whose upstream packages invoke the
+# texinfo utilities at build-time. Native and cross recipes are made to use the
+# dummy scripts provided by texinfo-dummy-native, for improved performance.
+# Target architecture recipes use the genuine Texinfo utilities. By default,
+# they use the Texinfo utilities on the host system. If you want to use the
+# Texinfo recipe, you can remove texinfo-native from ASSUME_PROVIDED and
+# makeinfo from SANITY_REQUIRED_UTILITIES.
+
+TEXDEP = "texinfo-native"
+TEXDEP_class-native = "texinfo-dummy-native"
+TEXDEP_class-cross = "texinfo-dummy-native"
+DEPENDS_append = " ${TEXDEP}"
+PATH_prepend_class-native = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
+PATH_prepend_class-cross = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
+
+# libtool-cross doesn't inherit cross
+TEXDEP_pn-libtool-cross = "texinfo-dummy-native"
+PATH_prepend_pn-libtool-cross = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
diff --git a/poky/meta/classes/tinderclient.bbclass b/poky/meta/classes/tinderclient.bbclass
new file mode 100644
index 000000000..00f453cec
--- /dev/null
+++ b/poky/meta/classes/tinderclient.bbclass
@@ -0,0 +1,368 @@
+def tinder_http_post(server, selector, content_type, body):
+ import httplib
+ # now post it
+ for i in range(0,5):
+ try:
+ h = httplib.HTTP(server)
+ h.putrequest('POST', selector)
+ h.putheader('content-type', content_type)
+ h.putheader('content-length', str(len(body)))
+ h.endheaders()
+ h.send(body)
+ errcode, errmsg, headers = h.getreply()
+ #print(errcode, errmsg, headers)
+ return (errcode,errmsg, headers, h.file)
+ except:
+ print("Error sending the report!")
+ # try again
+ pass
+
+ # return some garbage
+ return (-1, "unknown", "unknown", None)
+
+def tinder_form_data(bound, dict, log):
+ output = []
+ # for each key in the dictionary
+ for name in dict:
+ assert dict[name]
+ output.append( "--" + bound )
+ output.append( 'Content-Disposition: form-data; name="%s"' % name )
+ output.append( "" )
+ output.append( dict[name] )
+ if log:
+ output.append( "--" + bound )
+ output.append( 'Content-Disposition: form-data; name="log"; filename="log.txt"' )
+ output.append( '' )
+ output.append( log )
+ output.append( '--' + bound + '--' )
+ output.append( '' )
+
+ return "\r\n".join(output)
+
+def tinder_time_string():
+ """
+ Return the time as GMT
+ """
+ return ""
+
+def tinder_format_http_post(d,status,log):
+ """
+ Format the Tinderbox HTTP post with the data needed
+ for the tinderbox to be happy.
+ """
+
+ import random
+
+ # the variables we will need to send on this form post
+ variables = {
+ "tree" : d.getVar('TINDER_TREE'),
+ "machine_name" : d.getVar('TINDER_MACHINE'),
+ "os" : os.uname()[0],
+ "os_version" : os.uname()[2],
+ "compiler" : "gcc",
+ "clobber" : d.getVar('TINDER_CLOBBER') or "0",
+ "srcdate" : d.getVar('SRCDATE'),
+ "PN" : d.getVar('PN'),
+ "PV" : d.getVar('PV'),
+ "PR" : d.getVar('PR'),
+ "FILE" : d.getVar('FILE') or "N/A",
+ "TARGETARCH" : d.getVar('TARGET_ARCH'),
+ "TARGETFPU" : d.getVar('TARGET_FPU') or "Unknown",
+ "TARGETOS" : d.getVar('TARGET_OS') or "Unknown",
+ "MACHINE" : d.getVar('MACHINE') or "Unknown",
+ "DISTRO" : d.getVar('DISTRO') or "Unknown",
+ "zecke-rocks" : "sure",
+ }
+
+ # optionally add the status
+ if status:
+ variables["status"] = str(status)
+
+ # try to load the machine id
+ # we only need on build_status.pl but sending it
+ # always does not hurt
+ try:
+ f = open(d.getVar('TMPDIR')+'/tinder-machine.id', 'r')
+ id = f.read()
+ variables['machine_id'] = id
+ except:
+ pass
+
+ # the boundary we will need
+ boundary = "----------------------------------%d" % int(random.random()*1000000000000)
+
+ # now format the body
+ body = tinder_form_data( boundary, variables, log )
+
+ return ("multipart/form-data; boundary=%s" % boundary),body
+
+
+def tinder_build_start(d):
+ """
+ Inform the tinderbox that a build is starting. We do this
+ by posting our name and tree to the build_start.pl script
+ on the server.
+ """
+
+ # get the body and type
+ content_type, body = tinder_format_http_post(d,None,None)
+ server = d.getVar('TINDER_HOST')
+ url = d.getVar('TINDER_URL')
+
+ selector = url + "/xml/build_start.pl"
+
+ #print("selector %s and url %s" % (selector, url))
+
+ # now post it
+ errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
+ #print(errcode, errmsg, headers)
+ report = h_file.read()
+
+ # now let us find the machine id that was assigned to us
+ search = "<machine id='"
+ report = report[report.find(search)+len(search):]
+ report = report[0:report.find("'")]
+
+ bb.note("Machine ID assigned by tinderbox: %s" % report )
+
+ # now we will need to save the machine number
+ # we will override any previous numbers
+ f = open(d.getVar('TMPDIR')+"/tinder-machine.id", 'w')
+ f.write(report)
+
+
+def tinder_send_http(d, status, _log):
+ """
+ Send this log as build status
+ """
+
+ # get the body and type
+ server = d.getVar('TINDER_HOST')
+ url = d.getVar('TINDER_URL')
+
+ selector = url + "/xml/build_status.pl"
+
+ # now post it - in chunks of 10.000 characters
+ new_log = _log
+ while len(new_log) > 0:
+ content_type, body = tinder_format_http_post(d,status,new_log[0:18000])
+ errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
+ #print(errcode, errmsg, headers)
+ #print(h.file.read())
+ new_log = new_log[18000:]
+
+
+def tinder_print_info(d):
+ """
+ Print the TinderBox Info
+ Including informations of the BaseSystem and the Tree
+ we use.
+ """
+
+ # get the local vars
+ time = tinder_time_string()
+ ops = os.uname()[0]
+ version = os.uname()[2]
+ url = d.getVar('TINDER_URL')
+ tree = d.getVar('TINDER_TREE')
+ branch = d.getVar('TINDER_BRANCH')
+ srcdate = d.getVar('SRCDATE')
+ machine = d.getVar('MACHINE')
+ distro = d.getVar('DISTRO')
+ bbfiles = d.getVar('BBFILES')
+ tarch = d.getVar('TARGET_ARCH')
+ fpu = d.getVar('TARGET_FPU')
+ oerev = d.getVar('OE_REVISION') or "unknown"
+
+ # there is a bug with tipple quoted strings
+ # i will work around but will fix the original
+ # bug as well
+ output = []
+ output.append("== Tinderbox Info" )
+ output.append("Time: %(time)s" )
+ output.append("OS: %(ops)s" )
+ output.append("%(version)s" )
+ output.append("Compiler: gcc" )
+ output.append("Tinderbox Client: 0.1" )
+ output.append("Tinderbox Client Last Modified: yesterday" )
+ output.append("Tinderbox Protocol: 0.1" )
+ output.append("URL: %(url)s" )
+ output.append("Tree: %(tree)s" )
+ output.append("Config:" )
+ output.append("branch = '%(branch)s'" )
+ output.append("TARGET_ARCH = '%(tarch)s'" )
+ output.append("TARGET_FPU = '%(fpu)s'" )
+ output.append("SRCDATE = '%(srcdate)s'" )
+ output.append("MACHINE = '%(machine)s'" )
+ output.append("DISTRO = '%(distro)s'" )
+ output.append("BBFILES = '%(bbfiles)s'" )
+ output.append("OEREV = '%(oerev)s'" )
+ output.append("== End Tinderbox Client Info" )
+
+ # now create the real output
+ return "\n".join(output) % vars()
+
+
+def tinder_print_env():
+ """
+ Print the environment variables of this build
+ """
+ time_start = tinder_time_string()
+ time_end = tinder_time_string()
+
+ # build the environment
+ env = ""
+ for var in os.environ:
+ env += "%s=%s\n" % (var, os.environ[var])
+
+ output = []
+ output.append( "---> TINDERBOX RUNNING env %(time_start)s" )
+ output.append( env )
+ output.append( "<--- TINDERBOX FINISHED (SUCCESS) %(time_end)s" )
+
+ return "\n".join(output) % vars()
+
+def tinder_tinder_start(d, event):
+ """
+ PRINT the configuration of this build
+ """
+
+ time_start = tinder_time_string()
+ config = tinder_print_info(d)
+ #env = tinder_print_env()
+ time_end = tinder_time_string()
+ packages = " ".join( event.getPkgs() )
+
+ output = []
+ output.append( "---> TINDERBOX PRINTING CONFIGURATION %(time_start)s" )
+ output.append( config )
+ #output.append( env )
+ output.append( "<--- TINDERBOX FINISHED PRINTING CONFIGURATION %(time_end)s" )
+ output.append( "---> TINDERBOX BUILDING '%(packages)s'" )
+ output.append( "<--- TINDERBOX STARTING BUILD NOW" )
+
+ output.append( "" )
+
+ return "\n".join(output) % vars()
+
+def tinder_do_tinder_report(event):
+ """
+ Report to the tinderbox:
+ On the BuildStart we will inform the box directly
+ On the other events we will write to the TINDER_LOG and
+ when the Task is finished we will send the report.
+
+ The above is not yet fully implemented. Currently we send
+ information immediately. The caching/queuing needs to be
+ implemented. Also sending more or less information is not
+ implemented yet.
+
+ We have two temporary files stored in the TMP directory. One file
+ contains the assigned machine id for the tinderclient. This id gets
+ assigned when we connect the box and start the build process the second
+ file is used to workaround an EventHandler limitation. If BitBake is ran
+ with the continue option we want the Build to fail even if we get the
+ BuildCompleted Event. In this case we have to look up the status and
+ send it instead of 100/success.
+ """
+ import glob
+
+ # variables
+ name = bb.event.getName(event)
+ log = ""
+ status = 1
+ # Check what we need to do Build* shows we start or are done
+ if name == "BuildStarted":
+ tinder_build_start(event.data)
+ log = tinder_tinder_start(event.data,event)
+
+ try:
+ # truncate the tinder log file
+ f = open(event.data.getVar('TINDER_LOG'), 'w')
+ f.write("")
+ f.close()
+ except:
+ pass
+
+ try:
+ # write a status to the file. This is needed for the -k option
+ # of BitBake
+ g = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
+ g.write("")
+ g.close()
+ except IOError:
+ pass
+
+ # Append the Task-Log (compile,configure...) to the log file
+ # we will send to the server
+ if name == "TaskSucceeded" or name == "TaskFailed":
+ log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T'), event.task))
+
+ if len(log_file) != 0:
+ to_file = event.data.getVar('TINDER_LOG')
+ log += "".join(open(log_file[0], 'r').readlines())
+
+ # set the right 'HEADER'/Summary for the TinderBox
+ if name == "TaskStarted":
+ log += "---> TINDERBOX Task %s started\n" % event.task
+ elif name == "TaskSucceeded":
+ log += "<--- TINDERBOX Task %s done (SUCCESS)\n" % event.task
+ elif name == "TaskFailed":
+ log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task
+ elif name == "PkgStarted":
+ log += "---> TINDERBOX Package %s started\n" % event.data.getVar('PF')
+ elif name == "PkgSucceeded":
+ log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF')
+ elif name == "PkgFailed":
+ if not event.data.getVar('TINDER_AUTOBUILD') == "0":
+ build.exec_task('do_clean', event.data)
+ log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF')
+ status = 200
+ # remember the failure for the -k case
+ h = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
+ h.write("200")
+ elif name == "BuildCompleted":
+ log += "Build Completed\n"
+ status = 100
+ # Check if we have a old status...
+ try:
+ h = open(event.data.getVar('TMPDIR')+'/tinder-status', 'r')
+ status = int(h.read())
+ except:
+ pass
+
+ elif name == "MultipleProviders":
+ log += "---> TINDERBOX Multiple Providers\n"
+ log += "multiple providers are available (%s);\n" % ", ".join(event.getCandidates())
+ log += "consider defining PREFERRED_PROVIDER_%s\n" % event.getItem()
+ log += "is runtime: %d\n" % event.isRuntime()
+ log += "<--- TINDERBOX Multiple Providers\n"
+ elif name == "NoProvider":
+ log += "Error: No Provider for: %s\n" % event.getItem()
+ log += "Error:Was Runtime: %d\n" % event.isRuntime()
+ status = 200
+ # remember the failure for the -k case
+ h = open(event.data.getVar('TMPDIR')+"/tinder-status", 'w')
+ h.write("200")
+
+ # now post the log
+ if len(log) == 0:
+ return
+
+ # for now we will use the http post method as it is the only one
+ log_post_method = tinder_send_http
+ log_post_method(event.data, status, log)
+
+
+# we want to be an event handler
+addhandler tinderclient_eventhandler
+python tinderclient_eventhandler() {
+ if e.data is None or bb.event.getName(e) == "MsgNote":
+ return
+
+ do_tinder_report = e.data.getVar('TINDER_REPORT')
+ if do_tinder_report and do_tinder_report == "1":
+ tinder_do_tinder_report(e)
+
+ return
+}
diff --git a/poky/meta/classes/toaster.bbclass b/poky/meta/classes/toaster.bbclass
new file mode 100644
index 000000000..6cef0b8f6
--- /dev/null
+++ b/poky/meta/classes/toaster.bbclass
@@ -0,0 +1,380 @@
+#
+# Toaster helper class
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+# This bbclass is designed to extract data used by OE-Core during the build process,
+# for recording in the Toaster system.
+# The data access is synchronous, preserving the build data integrity across
+# different builds.
+#
+# The data is transferred through the event system, using the MetadataEvent objects.
+#
+# The model is to enable the datadump functions as postfuncs, and have the dump
+# executed after the real taskfunc has been executed. This prevents task signature changing
+# is toaster is enabled or not. Build performance is not affected if Toaster is not enabled.
+#
+# To enable, use INHERIT in local.conf:
+#
+# INHERIT += "toaster"
+#
+#
+#
+#
+
+# Find and dump layer info when we got the layers parsed
+
+
+
+python toaster_layerinfo_dumpdata() {
+ import subprocess
+
+ def _get_git_branch(layer_path):
+ branch = subprocess.Popen("git symbolic-ref HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0]
+ branch = branch.decode('utf-8')
+ branch = branch.replace('refs/heads/', '').rstrip()
+ return branch
+
+ def _get_git_revision(layer_path):
+ revision = subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0].rstrip()
+ return revision
+
+ def _get_url_map_name(layer_name):
+ """ Some layers have a different name on openembedded.org site,
+ this method returns the correct name to use in the URL
+ """
+
+ url_name = layer_name
+ url_mapping = {'meta': 'openembedded-core'}
+
+ for key in url_mapping.keys():
+ if key == layer_name:
+ url_name = url_mapping[key]
+
+ return url_name
+
+ def _get_layer_version_information(layer_path):
+
+ layer_version_info = {}
+ layer_version_info['branch'] = _get_git_branch(layer_path)
+ layer_version_info['commit'] = _get_git_revision(layer_path)
+ layer_version_info['priority'] = 0
+
+ return layer_version_info
+
+
+ def _get_layer_dict(layer_path):
+
+ layer_info = {}
+ layer_name = layer_path.split('/')[-1]
+ layer_url = 'http://layers.openembedded.org/layerindex/layer/{layer}/'
+ layer_url_name = _get_url_map_name(layer_name)
+
+ layer_info['name'] = layer_url_name
+ layer_info['local_path'] = layer_path
+ layer_info['layer_index_url'] = layer_url.format(layer=layer_url_name)
+ layer_info['version'] = _get_layer_version_information(layer_path)
+
+ return layer_info
+
+
+ bblayers = e.data.getVar("BBLAYERS")
+
+ llayerinfo = {}
+
+ for layer in { l for l in bblayers.strip().split(" ") if len(l) }:
+ llayerinfo[layer] = _get_layer_dict(layer)
+
+
+ bb.event.fire(bb.event.MetadataEvent("LayerInfo", llayerinfo), e.data)
+}
+
+# Dump package file info data
+
+def _toaster_load_pkgdatafile(dirpath, filepath):
+ import json
+ import re
+ pkgdata = {}
+ with open(os.path.join(dirpath, filepath), "r") as fin:
+ for line in fin:
+ try:
+ kn, kv = line.strip().split(": ", 1)
+ m = re.match(r"^PKG_([^A-Z:]*)", kn)
+ if m:
+ pkgdata['OPKGN'] = m.group(1)
+ kn = "_".join([x for x in kn.split("_") if x.isupper()])
+ pkgdata[kn] = kv.strip()
+ if kn == 'FILES_INFO':
+ pkgdata[kn] = json.loads(kv)
+
+ except ValueError:
+ pass # ignore lines without valid key: value pairs
+ return pkgdata
+
+python toaster_package_dumpdata() {
+ """
+ Dumps the data about the packages created by a recipe
+ """
+
+ # No need to try and dumpdata if the recipe isn't generating packages
+ if not d.getVar('PACKAGES'):
+ return
+
+ pkgdatadir = d.getVar('PKGDESTWORK')
+ lpkgdata = {}
+ datadir = os.path.join(pkgdatadir, 'runtime')
+
+ # scan and send data for each generated package
+ for datafile in os.listdir(datadir):
+ if not datafile.endswith('.packaged'):
+ lpkgdata = _toaster_load_pkgdatafile(datadir, datafile)
+ # Fire an event containing the pkg data
+ bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d)
+}
+
+# 2. Dump output image files information
+
+python toaster_artifact_dumpdata() {
+ """
+ Dump data about SDK variables
+ """
+
+ event_data = {
+ "TOOLCHAIN_OUTPUTNAME": d.getVar("TOOLCHAIN_OUTPUTNAME")
+ }
+
+ bb.event.fire(bb.event.MetadataEvent("SDKArtifactInfo", event_data), d)
+}
+
+# collect list of buildstats files based on fired events; when the build completes, collect all stats and fire an event with collected data
+
+python toaster_collect_task_stats() {
+ import bb.build
+ import bb.event
+ import bb.data
+ import bb.utils
+ import os
+
+ if not e.data.getVar('BUILDSTATS_BASE'):
+ return # if we don't have buildstats, we cannot collect stats
+
+ toaster_statlist_file = os.path.join(e.data.getVar('BUILDSTATS_BASE'), "toasterstatlist")
+
+ def stat_to_float(value):
+ return float(value.strip('% \n\r'))
+
+ def _append_read_list(v):
+ lock = bb.utils.lockfile(e.data.expand("${TOPDIR}/toaster.lock"), False, True)
+
+ with open(toaster_statlist_file, "a") as fout:
+ taskdir = e.data.expand("${BUILDSTATS_BASE}/${BUILDNAME}/${PF}")
+ fout.write("%s::%s::%s::%s\n" % (e.taskfile, e.taskname, os.path.join(taskdir, e.task), e.data.expand("${PN}")))
+
+ bb.utils.unlockfile(lock)
+
+ def _read_stats(filename):
+ # seconds
+ cpu_time_user = 0
+ cpu_time_system = 0
+
+ # bytes
+ disk_io_read = 0
+ disk_io_write = 0
+
+ started = 0
+ ended = 0
+
+ taskname = ''
+
+ statinfo = {}
+
+ with open(filename, 'r') as task_bs:
+ for line in task_bs.readlines():
+ k,v = line.strip().split(": ", 1)
+ statinfo[k] = v
+
+ if "Started" in statinfo:
+ started = stat_to_float(statinfo["Started"])
+
+ if "Ended" in statinfo:
+ ended = stat_to_float(statinfo["Ended"])
+
+ if "Child rusage ru_utime" in statinfo:
+ cpu_time_user = cpu_time_user + stat_to_float(statinfo["Child rusage ru_utime"])
+
+ if "Child rusage ru_stime" in statinfo:
+ cpu_time_system = cpu_time_system + stat_to_float(statinfo["Child rusage ru_stime"])
+
+ if "IO write_bytes" in statinfo:
+ write_bytes = int(statinfo["IO write_bytes"].strip('% \n\r'))
+ disk_io_write = disk_io_write + write_bytes
+
+ if "IO read_bytes" in statinfo:
+ read_bytes = int(statinfo["IO read_bytes"].strip('% \n\r'))
+ disk_io_read = disk_io_read + read_bytes
+
+ return {
+ 'stat_file': filename,
+ 'cpu_time_user': cpu_time_user,
+ 'cpu_time_system': cpu_time_system,
+ 'disk_io_read': disk_io_read,
+ 'disk_io_write': disk_io_write,
+ 'started': started,
+ 'ended': ended
+ }
+
+ if isinstance(e, (bb.build.TaskSucceeded, bb.build.TaskFailed)):
+ _append_read_list(e)
+ pass
+
+ if isinstance(e, bb.event.BuildCompleted) and os.path.exists(toaster_statlist_file):
+ events = []
+ with open(toaster_statlist_file, "r") as fin:
+ for line in fin:
+ (taskfile, taskname, filename, recipename) = line.strip().split("::")
+ stats = _read_stats(filename)
+ events.append((taskfile, taskname, stats, recipename))
+ bb.event.fire(bb.event.MetadataEvent("BuildStatsList", events), e.data)
+ os.unlink(toaster_statlist_file)
+}
+
+# dump relevant build history data as an event when the build is completed
+
+python toaster_buildhistory_dump() {
+ import re
+ BUILDHISTORY_DIR = e.data.expand("${TOPDIR}/buildhistory")
+ BUILDHISTORY_DIR_IMAGE_BASE = e.data.expand("%s/images/${MACHINE_ARCH}/${TCLIBC}/"% BUILDHISTORY_DIR)
+ pkgdata_dir = e.data.getVar("PKGDATA_DIR")
+
+
+ # scan the build targets for this build
+ images = {}
+ allpkgs = {}
+ files = {}
+ for target in e._pkgs:
+ target = target.split(':')[0] # strip ':<task>' suffix from the target
+ installed_img_path = e.data.expand(os.path.join(BUILDHISTORY_DIR_IMAGE_BASE, target))
+ if os.path.exists(installed_img_path):
+ images[target] = {}
+ files[target] = {}
+ files[target]['dirs'] = []
+ files[target]['syms'] = []
+ files[target]['files'] = []
+ with open("%s/installed-package-sizes.txt" % installed_img_path, "r") as fin:
+ for line in fin:
+ line = line.rstrip(";")
+ psize, punit, pname = line.split()
+ # this size is "installed-size" as it measures how much space it takes on disk
+ images[target][pname.strip()] = {'size':int(psize)*1024, 'depends' : []}
+
+ with open("%s/depends.dot" % installed_img_path, "r") as fin:
+ p = re.compile(r'\s*"(?P<name>[^"]+)"\s*->\s*"(?P<dep>[^"]+)"(?P<rec>.*?\[style=dotted\])?')
+ for line in fin:
+ m = p.match(line)
+ if not m:
+ continue
+ pname = m.group('name')
+ dependsname = m.group('dep')
+ deptype = 'recommends' if m.group('rec') else 'depends'
+
+ # If RPM is used for packaging, then there may be
+ # dependencies such as "/bin/sh", which will confuse
+ # _toaster_load_pkgdatafile() later on. While at it, ignore
+ # any dependencies that contain parentheses, e.g.,
+ # "libc.so.6(GLIBC_2.7)".
+ if dependsname.startswith('/') or '(' in dependsname:
+ continue
+
+ if not pname in images[target]:
+ images[target][pname] = {'size': 0, 'depends' : []}
+ if not dependsname in images[target]:
+ images[target][dependsname] = {'size': 0, 'depends' : []}
+ images[target][pname]['depends'].append((dependsname, deptype))
+
+ # files-in-image.txt is only generated if an image file is created,
+ # so the file entries ('syms', 'dirs', 'files') for a target will be
+ # empty for rootfs builds and other "image" tasks which don't
+ # produce image files
+ # (e.g. "bitbake core-image-minimal -c populate_sdk")
+ files_in_image_path = "%s/files-in-image.txt" % installed_img_path
+ if os.path.exists(files_in_image_path):
+ with open(files_in_image_path, "r") as fin:
+ for line in fin:
+ lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
+ if lc[0].startswith("l"):
+ files[target]['syms'].append(lc)
+ elif lc[0].startswith("d"):
+ files[target]['dirs'].append(lc)
+ else:
+ files[target]['files'].append(lc)
+
+ for pname in images[target]:
+ if not pname in allpkgs:
+ try:
+ pkgdata = _toaster_load_pkgdatafile("%s/runtime-reverse/" % pkgdata_dir, pname)
+ except IOError as err:
+ if err.errno == 2:
+ # We expect this e.g. for RRECOMMENDS that are unsatisfied at runtime
+ continue
+ else:
+ raise
+ allpkgs[pname] = pkgdata
+
+
+ data = { 'pkgdata' : allpkgs, 'imgdata' : images, 'filedata' : files }
+
+ bb.event.fire(bb.event.MetadataEvent("ImagePkgList", data), e.data)
+
+}
+
+# get list of artifacts from sstate manifest
+python toaster_artifacts() {
+ if e.taskname in ["do_deploy", "do_image_complete", "do_populate_sdk", "do_populate_sdk_ext"]:
+ d2 = d.createCopy()
+ d2.setVar('FILE', e.taskfile)
+ # Use 'stamp-extra-info' if present, else use workaround
+ # to determine 'SSTATE_MANMACH'
+ extrainf = d2.getVarFlag(e.taskname, 'stamp-extra-info')
+ if extrainf:
+ d2.setVar('SSTATE_MANMACH', extrainf)
+ else:
+ if "do_populate_sdk" == e.taskname:
+ d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}${SDKMACHINE}"))
+ else:
+ d2.setVar('SSTATE_MANMACH', d2.expand("${MACHINE}"))
+ manifest = oe.sstatesig.sstate_get_manifest_filename(e.taskname[3:], d2)[0]
+
+ if os.access(manifest, os.R_OK):
+ with open(manifest) as fmanifest:
+ artifacts = [fname.strip() for fname in fmanifest]
+ data = {"task": e.taskid, "artifacts": artifacts}
+ bb.event.fire(bb.event.MetadataEvent("TaskArtifacts", data), d2)
+}
+
+# set event handlers
+addhandler toaster_layerinfo_dumpdata
+toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted"
+
+addhandler toaster_collect_task_stats
+toaster_collect_task_stats[eventmask] = "bb.event.BuildCompleted bb.build.TaskSucceeded bb.build.TaskFailed"
+
+addhandler toaster_buildhistory_dump
+toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted"
+
+addhandler toaster_artifacts
+toaster_artifacts[eventmask] = "bb.runqueue.runQueueTaskSkipped bb.runqueue.runQueueTaskCompleted"
+
+do_packagedata_setscene[postfuncs] += "toaster_package_dumpdata "
+do_packagedata_setscene[vardepsexclude] += "toaster_package_dumpdata "
+
+do_package[postfuncs] += "toaster_package_dumpdata "
+do_package[vardepsexclude] += "toaster_package_dumpdata "
+
+#do_populate_sdk[postfuncs] += "toaster_artifact_dumpdata "
+#do_populate_sdk[vardepsexclude] += "toaster_artifact_dumpdata "
+
+#do_populate_sdk_ext[postfuncs] += "toaster_artifact_dumpdata "
+#do_populate_sdk_ext[vardepsexclude] += "toaster_artifact_dumpdata "
+
diff --git a/poky/meta/classes/toolchain-scripts-base.bbclass b/poky/meta/classes/toolchain-scripts-base.bbclass
new file mode 100644
index 000000000..2489b9dbe
--- /dev/null
+++ b/poky/meta/classes/toolchain-scripts-base.bbclass
@@ -0,0 +1,11 @@
+#This function create a version information file
+toolchain_create_sdk_version () {
+ local versionfile=$1
+ rm -f $versionfile
+ touch $versionfile
+ echo 'Distro: ${DISTRO}' >> $versionfile
+ echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
+ echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
+ echo 'Timestamp: ${DATETIME}' >> $versionfile
+}
+toolchain_create_sdk_version[vardepsexclude] = "DATETIME"
diff --git a/poky/meta/classes/toolchain-scripts.bbclass b/poky/meta/classes/toolchain-scripts.bbclass
new file mode 100644
index 000000000..71da5e540
--- /dev/null
+++ b/poky/meta/classes/toolchain-scripts.bbclass
@@ -0,0 +1,178 @@
+inherit toolchain-scripts-base siteinfo kernel-arch
+
+# We want to be able to change the value of MULTIMACH_TARGET_SYS, because it
+# doesn't always match our expectations... but we default to the stock value
+REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}"
+TARGET_CC_ARCH_append_libc-musl = " -mmusl"
+
+# default debug prefix map isn't valid in the SDK
+DEBUG_PREFIX_MAP = ""
+
+# This function creates an environment-setup-script for use in a deployable SDK
+toolchain_create_sdk_env_script () {
+ # Create environment setup script. Remember that $SDKTARGETSYSROOT should
+ # only be expanded on the target at runtime.
+ base_sbindir=${10:-${base_sbindir_nativesdk}}
+ base_bindir=${9:-${base_bindir_nativesdk}}
+ sbindir=${8:-${sbindir_nativesdk}}
+ sdkpathnative=${7:-${SDKPATHNATIVE}}
+ prefix=${6:-${prefix_nativesdk}}
+ bindir=${5:-${bindir_nativesdk}}
+ libdir=${4:-${libdir}}
+ sysroot=${3:-${SDKTARGETSYSROOT}}
+ multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}}
+ script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-$multimach_target_sys}
+ rm -f $script
+ touch $script
+
+ echo '# Check for LD_LIBRARY_PATH being set, which can break SDK and generally is a bad practice' >> $script
+ echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script
+ echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script
+ echo '# Only disable this check if you are absolutely know what you are doing!' >> $script
+ echo 'if [ ! -z "$LD_LIBRARY_PATH" ]; then' >> $script
+ echo " echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script
+ echo " echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script
+ echo ' echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script
+ echo ' echo "For more references see:"' >> $script
+ echo ' echo " http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80"' >> $script
+ echo ' echo " http://xahlee.info/UnixResource_dir/_/ldpath.html"' >> $script
+ echo ' return 1' >> $script
+ echo 'fi' >> $script
+
+ echo 'export SDKTARGETSYSROOT='"$sysroot" >> $script
+ EXTRAPATH=""
+ for i in ${CANADIANEXTRAOS}; do
+ EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${TARGET_ARCH}${TARGET_VENDOR}-$i"
+ done
+ echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$sbindir:$sdkpathnative$base_bindir:$sdkpathnative$base_sbindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
+ echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
+ echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig:$SDKTARGETSYSROOT'"$prefix"'/share/pkgconfig' >> $script
+ echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script
+ echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
+ echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
+ echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
+ echo 'unset command_not_found_handle' >> $script
+
+ toolchain_shared_env_script
+}
+
+# This function creates an environment-setup-script in the TMPDIR which enables
+# a OE-core IDE to integrate with the build tree
+toolchain_create_tree_env_script () {
+ script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+ rm -f $script
+ touch $script
+ echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script
+ echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script
+ echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
+ echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
+ echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script
+ echo 'export SDKTARGETSYSROOT=${STAGING_DIR_TARGET}' >> $script
+ echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
+ echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
+ echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script
+
+ toolchain_shared_env_script
+}
+
+toolchain_shared_env_script () {
+ echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script
+ echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
+ echo 'export STRIP=${TARGET_PREFIX}strip' >> $script
+ echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script
+ echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script
+ echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script
+ echo 'export AR=${TARGET_PREFIX}ar' >> $script
+ echo 'export NM=${TARGET_PREFIX}nm' >> $script
+ echo 'export M4=m4' >> $script
+ echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
+ echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script
+ echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script
+ echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script
+ echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script
+ echo 'export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"' >> $script
+ echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
+ echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
+ echo 'export ARCH=${ARCH}' >> $script
+ echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
+
+ cat >> $script <<EOF
+
+# Append environment subscripts
+if [ -d "\$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
+ for envfile in \$OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
+ . \$envfile
+ done
+fi
+if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
+ for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
+ . \$envfile
+ done
+fi
+EOF
+}
+
+toolchain_create_post_relocate_script() {
+ script=$1
+ rm -f $script
+ touch $script
+
+ cat >> $script <<EOF
+if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
+ for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*.sh; do
+ \$s "\$1"
+ done
+ rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
+fi
+EOF
+}
+
+#we get the cached site config in the runtime
+TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d)}"
+TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses"
+DEPENDS += "${TOOLCHAIN_NEED_CONFIGSITE_CACHE}"
+
+#This function create a site config file
+toolchain_create_sdk_siteconfig () {
+ local siteconfig=$1
+
+ rm -f $siteconfig
+ touch $siteconfig
+
+ for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do
+ cat $sitefile >> $siteconfig
+ done
+
+ #get cached site config
+ for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do
+ # Resolve virtual/* names to the real recipe name using sysroot-providers info
+ case $sitefile in virtual/*)
+ sitefile=`echo $sitefile | tr / _`
+ sitefile=`cat ${STAGING_DIR_TARGET}/sysroot-providers/$sitefile`
+ esac
+
+ if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then
+ cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig
+ fi
+ done
+}
+# The immediate expansion above can result in unwanted path dependencies here
+toolchain_create_sdk_siteconfig[vardepsexclude] = "TOOLCHAIN_CONFIGSITE_SYSROOTCACHE"
+
+python __anonymous () {
+ import oe.classextend
+ deps = ""
+ for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE') or "").split():
+ deps += " %s:do_populate_sysroot" % dep
+ for variant in (d.getVar('MULTILIB_VARIANTS') or "").split():
+ clsextend = oe.classextend.ClassExtender(variant, d)
+ newdep = clsextend.extend_name(dep)
+ deps += " %s:do_populate_sysroot" % newdep
+ d.appendVarFlag('do_configure', 'depends', deps)
+}
diff --git a/poky/meta/classes/typecheck.bbclass b/poky/meta/classes/typecheck.bbclass
new file mode 100644
index 000000000..72da93223
--- /dev/null
+++ b/poky/meta/classes/typecheck.bbclass
@@ -0,0 +1,12 @@
+# Check types of bitbake configuration variables
+#
+# See oe.types for details.
+
+python check_types() {
+ import oe.types
+ for key in e.data.keys():
+ if e.data.getVarFlag(key, "type"):
+ oe.data.typed_value(key, e.data)
+}
+addhandler check_types
+check_types[eventmask] = "bb.event.ConfigParsed"
diff --git a/poky/meta/classes/uboot-config.bbclass b/poky/meta/classes/uboot-config.bbclass
new file mode 100644
index 000000000..89ff970fc
--- /dev/null
+++ b/poky/meta/classes/uboot-config.bbclass
@@ -0,0 +1,57 @@
+# Handle U-Boot config for a machine
+#
+# The format to specify it, in the machine, is:
+#
+# UBOOT_CONFIG ??= <default>
+# UBOOT_CONFIG[foo] = "config,images,binary"
+#
+# or
+#
+# UBOOT_MACHINE = "config"
+#
+# Copyright 2013, 2014 (C) O.S. Systems Software LTDA.
+
+UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
+
+python () {
+ ubootmachine = d.getVar("UBOOT_MACHINE")
+ ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+ ubootbinary = d.getVar('UBOOT_BINARY')
+ ubootbinaries = d.getVar('UBOOT_BINARIES')
+ # The "doc" varflag is special, we don't want to see it here
+ ubootconfigflags.pop('doc', None)
+ ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
+
+ if not ubootmachine and not ubootconfig:
+ PN = d.getVar("PN")
+ FILE = os.path.basename(d.getVar("FILE"))
+ bb.debug(1, "To build %s, see %s for instructions on \
+ setting up your machine config" % (PN, FILE))
+ raise bb.parse.SkipRecipe("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE"))
+
+ if ubootmachine and ubootconfig:
+ raise bb.parse.SkipRecipe("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
+
+ if ubootconfigflags and ubootbinaries:
+ raise bb.parse.SkipRecipe("You cannot use UBOOT_BINARIES as it is internal to uboot_config.bbclass.")
+
+ if len(ubootconfig) > 0:
+ for config in ubootconfig:
+ for f, v in ubootconfigflags.items():
+ if config == f:
+ items = v.split(',')
+ if items[0] and len(items) > 3:
+ raise bb.parse.SkipRecipe('Only config,images,binary can be specified!')
+ d.appendVar('UBOOT_MACHINE', ' ' + items[0])
+ # IMAGE_FSTYPES appending
+ if len(items) > 1 and items[1]:
+ bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
+ d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+ if len(items) > 2 and items[2]:
+ bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % items[2])
+ d.appendVar('UBOOT_BINARIES', ' ' + items[2])
+ else:
+ bb.debug(1, "Appending '%s' to UBOOT_BINARIES." % ubootbinary)
+ d.appendVar('UBOOT_BINARIES', ' ' + ubootbinary)
+ break
+}
diff --git a/poky/meta/classes/uboot-extlinux-config.bbclass b/poky/meta/classes/uboot-extlinux-config.bbclass
new file mode 100644
index 000000000..61dff14b7
--- /dev/null
+++ b/poky/meta/classes/uboot-extlinux-config.bbclass
@@ -0,0 +1,152 @@
+# uboot-extlinux-config.bbclass
+#
+# This class allow the extlinux.conf generation for U-Boot use. The
+# U-Boot support for it is given to allow the Generic Distribution
+# Configuration specification use by OpenEmbedded-based products.
+#
+# External variables:
+#
+# UBOOT_EXTLINUX_CONSOLE - Set to "console=ttyX" to change kernel boot
+# default console.
+# UBOOT_EXTLINUX_LABELS - A list of targets for the automatic config.
+# UBOOT_EXTLINUX_KERNEL_ARGS - Add additional kernel arguments.
+# UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name.
+# UBOOT_EXTLINUX_FDTDIR - Device tree directory.
+# UBOOT_EXTLINUX_FDT - Device tree file.
+# UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to
+# concatenate and use as an initrd (optional).
+# UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description.
+# UBOOT_EXTLINUX_ROOT - Root kernel cmdline.
+# UBOOT_EXTLINUX_TIMEOUT - Timeout before DEFAULT selection is made.
+# Measured in 1/10 of a second.
+# UBOOT_EXTLINUX_DEFAULT_LABEL - Target to be selected by default after
+# the timeout period
+#
+# If there's only one label system will boot automatically and menu won't be
+# created. If you want to use more than one labels, e.g linux and alternate,
+# use overrides to set menu description, console and others variables.
+#
+# Ex:
+#
+# UBOOT_EXTLINUX_LABELS ??= "default fallback"
+#
+# UBOOT_EXTLINUX_DEFAULT_LABEL ??= "Linux Default"
+# UBOOT_EXTLINUX_TIMEOUT ??= "30"
+#
+# UBOOT_EXTLINUX_KERNEL_IMAGE_default ??= "../zImage"
+# UBOOT_EXTLINUX_MENU_DESCRIPTION_default ??= "Linux Default"
+#
+# UBOOT_EXTLINUX_KERNEL_IMAGE_fallback ??= "../zImage-fallback"
+# UBOOT_EXTLINUX_MENU_DESCRIPTION_fallback ??= "Linux Fallback"
+#
+# Results:
+#
+# menu title Select the boot mode
+# TIMEOUT 30
+# DEFAULT Linux Default
+# LABEL Linux Default
+# KERNEL ../zImage
+# FDTDIR ../
+# APPEND root=/dev/mmcblk2p2 rootwait rw console=${console}
+# LABEL Linux Fallback
+# KERNEL ../zImage-fallback
+# FDTDIR ../
+# APPEND root=/dev/mmcblk2p2 rootwait rw console=${console}
+#
+# Copyright (C) 2016, O.S. Systems Software LTDA. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+#
+# The kernel has an internal default console, which you can override with
+# a console=...some_tty...
+UBOOT_EXTLINUX_CONSOLE ??= "console=${console}"
+UBOOT_EXTLINUX_LABELS ??= "linux"
+UBOOT_EXTLINUX_FDT ??= ""
+UBOOT_EXTLINUX_FDTDIR ??= "../"
+UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}"
+UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw"
+UBOOT_EXTLINUX_MENU_DESCRIPTION_linux ??= "${DISTRO_NAME}"
+
+UBOOT_EXTLINUX_CONFIG = "${B}/extlinux.conf"
+
+python do_create_extlinux_config() {
+ if d.getVar("UBOOT_EXTLINUX") != "1":
+ return
+
+ if not d.getVar('WORKDIR'):
+ bb.error("WORKDIR not defined, unable to package")
+
+ labels = d.getVar('UBOOT_EXTLINUX_LABELS')
+ if not labels:
+ bb.fatal("UBOOT_EXTLINUX_LABELS not defined, nothing to do")
+
+ if not labels.strip():
+ bb.fatal("No labels, nothing to do")
+
+ cfile = d.getVar('UBOOT_EXTLINUX_CONFIG')
+ if not cfile:
+ bb.fatal('Unable to read UBOOT_EXTLINUX_CONFIG')
+
+ localdata = bb.data.createCopy(d)
+
+ try:
+ with open(cfile, 'w') as cfgfile:
+ cfgfile.write('# Generic Distro Configuration file generated by OpenEmbedded\n')
+
+ if len(labels.split()) > 1:
+ cfgfile.write('menu title Select the boot mode\n')
+
+ timeout = localdata.getVar('UBOOT_EXTLINUX_TIMEOUT')
+ if timeout:
+ cfgfile.write('TIMEOUT %s\n' % (timeout))
+
+ if len(labels.split()) > 1:
+ default = localdata.getVar('UBOOT_EXTLINUX_DEFAULT_LABEL')
+ if default:
+ cfgfile.write('DEFAULT %s\n' % (default))
+
+ for label in labels.split():
+
+ overrides = localdata.getVar('OVERRIDES')
+ if not overrides:
+ bb.fatal('OVERRIDES not defined')
+
+ localdata.setVar('OVERRIDES', label + ':' + overrides)
+
+ extlinux_console = localdata.getVar('UBOOT_EXTLINUX_CONSOLE')
+
+ menu_description = localdata.getVar('UBOOT_EXTLINUX_MENU_DESCRIPTION')
+ if not menu_description:
+ menu_description = label
+
+ root = localdata.getVar('UBOOT_EXTLINUX_ROOT')
+ if not root:
+ bb.fatal('UBOOT_EXTLINUX_ROOT not defined')
+
+ kernel_image = localdata.getVar('UBOOT_EXTLINUX_KERNEL_IMAGE')
+ fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR')
+
+ fdt = localdata.getVar('UBOOT_EXTLINUX_FDT')
+
+ if fdt:
+ cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDT %s\n' %
+ (menu_description, kernel_image, fdt))
+ elif fdtdir:
+ cfgfile.write('LABEL %s\n\tKERNEL %s\n\tFDTDIR %s\n' %
+ (menu_description, kernel_image, fdtdir))
+ else:
+ cfgfile.write('LABEL %s\n\tKERNEL %s\n' % (menu_description, kernel_image))
+
+ kernel_args = localdata.getVar('UBOOT_EXTLINUX_KERNEL_ARGS')
+
+ initrd = localdata.getVar('UBOOT_EXTLINUX_INITRD')
+ if initrd:
+ cfgfile.write('\tINITRD %s\n'% initrd)
+
+ kernel_args = root + " " + kernel_args
+ cfgfile.write('\tAPPEND %s %s\n' % (kernel_args, extlinux_console))
+
+ except OSError:
+ bb.fatal('Unable to open %s' % (cfile))
+}
+
+addtask create_extlinux_config before do_install do_deploy after do_compile
diff --git a/poky/meta/classes/uboot-sign.bbclass b/poky/meta/classes/uboot-sign.bbclass
new file mode 100644
index 000000000..8ee904e7d
--- /dev/null
+++ b/poky/meta/classes/uboot-sign.bbclass
@@ -0,0 +1,95 @@
+# This file is part of U-Boot verified boot support and is intended to be
+# inherited from u-boot recipe and from kernel-fitimage.bbclass.
+#
+# The signature procedure requires the user to generate an RSA key and
+# certificate in a directory and to define the following variable:
+#
+# UBOOT_SIGN_KEYDIR = "/keys/directory"
+# UBOOT_SIGN_KEYNAME = "dev" # keys name in keydir (eg. "dev.crt", "dev.key")
+# UBOOT_MKIMAGE_DTCOPTS = "-I dts -O dtb -p 2000"
+# UBOOT_SIGN_ENABLE = "1"
+#
+# As verified boot depends on fitImage generation, following is also required:
+#
+# KERNEL_CLASSES ?= " kernel-fitimage "
+# KERNEL_IMAGETYPE ?= "fitImage"
+#
+# The signature support is limited to the use of CONFIG_OF_SEPARATE in U-Boot.
+#
+# The tasks sequence is set as below, using DEPLOY_IMAGE_DIR as common place to
+# treat the device tree blob:
+#
+# u-boot:do_deploy_dtb
+# u-boot:do_deploy
+# virtual/kernel:do_assemble_fitimage
+# u-boot:do_concat_dtb
+# u-boot:do_install
+#
+# For more details on signature process, please refer to U-Boot documentation.
+
+# Signature activation.
+UBOOT_SIGN_ENABLE ?= "0"
+
+# Default value for deployment filenames.
+UBOOT_DTB_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.dtb"
+UBOOT_DTB_BINARY ?= "u-boot.dtb"
+UBOOT_DTB_SYMLINK ?= "u-boot-${MACHINE}.dtb"
+UBOOT_NODTB_IMAGE ?= "u-boot-nodtb-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
+UBOOT_NODTB_BINARY ?= "u-boot-nodtb.${UBOOT_SUFFIX}"
+UBOOT_NODTB_SYMLINK ?= "u-boot-nodtb-${MACHINE}.${UBOOT_SUFFIX}"
+
+#
+# Following is relevant only for u-boot recipes:
+#
+
+do_deploy_dtb () {
+ mkdir -p ${DEPLOYDIR}
+ cd ${DEPLOYDIR}
+
+ if [ -f ${B}/${UBOOT_DTB_BINARY} ]; then
+ install ${B}/${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${UBOOT_DTB_IMAGE}
+ rm -f ${UBOOT_DTB_BINARY} ${UBOOT_DTB_SYMLINK}
+ ln -sf ${UBOOT_DTB_IMAGE} ${UBOOT_DTB_SYMLINK}
+ ln -sf ${UBOOT_DTB_IMAGE} ${UBOOT_DTB_BINARY}
+ fi
+ if [ -f ${B}/${UBOOT_NODTB_BINARY} ]; then
+ install ${B}/${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}
+ rm -f ${UBOOT_NODTB_BINARY} ${UBOOT_NODTB_SYMLINK}
+ ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_SYMLINK}
+ ln -sf ${UBOOT_NODTB_IMAGE} ${UBOOT_NODTB_BINARY}
+ fi
+}
+
+do_concat_dtb () {
+ # Concatenate U-Boot w/o DTB & DTB with public key
+ # (cf. kernel-fitimage.bbclass for more details)
+ if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ]; then
+ if [ "x${UBOOT_SUFFIX}" = "ximg" -o "x${UBOOT_SUFFIX}" = "xrom" ] && \
+ [ -e "${DEPLOYDIR}/${UBOOT_DTB_IMAGE}" ]; then
+ cd ${B}
+ oe_runmake EXT_DTB=${DEPLOYDIR}/${UBOOT_DTB_IMAGE}
+ install ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+ install ${B}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${UBOOT_IMAGE}
+ elif [ -e "${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}" -a -e "${DEPLOYDIR}/${UBOOT_DTB_IMAGE}" ]; then
+ cd ${DEPLOYDIR}
+ cat ${UBOOT_NODTB_IMAGE} ${UBOOT_DTB_IMAGE} | tee ${B}/${UBOOT_BINARY} > ${UBOOT_IMAGE}
+ else
+ bbwarn "Failure while adding public key to u-boot binary. Verified boot won't be available."
+ fi
+ fi
+}
+
+python () {
+ uboot_pn = d.getVar('PREFERRED_PROVIDER_u-boot') or 'u-boot'
+ if d.getVar('UBOOT_SIGN_ENABLE') == '1' and d.getVar('PN') == uboot_pn:
+ kernel_pn = d.getVar('PREFERRED_PROVIDER_virtual/kernel')
+
+ # u-boot.dtb and u-boot-nodtb.bin are deployed _before_ do_deploy
+ # Thus, do_deploy_setscene will also populate them in DEPLOY_IMAGE_DIR
+ bb.build.addtask('do_deploy_dtb', 'do_deploy', 'do_compile', d)
+
+ # do_concat_dtb is scheduled _before_ do_install as it overwrite the
+ # u-boot.bin in both DEPLOYDIR and DEPLOY_IMAGE_DIR.
+ bb.build.addtask('do_concat_dtb', 'do_install', None, d)
+ d.appendVarFlag('do_concat_dtb', 'depends', ' %s:do_assemble_fitimage' % kernel_pn)
+}
diff --git a/poky/meta/classes/uninative.bbclass b/poky/meta/classes/uninative.bbclass
new file mode 100644
index 000000000..de2221a36
--- /dev/null
+++ b/poky/meta/classes/uninative.bbclass
@@ -0,0 +1,165 @@
+UNINATIVE_LOADER ?= "${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/lib/${@bb.utils.contains('BUILD_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}"
+UNINATIVE_STAGING_DIR ?= "${STAGING_DIR}"
+
+UNINATIVE_URL ?= "unset"
+UNINATIVE_TARBALL ?= "${BUILD_ARCH}-nativesdk-libc.tar.bz2"
+# Example checksums
+#UNINATIVE_CHECKSUM[i586] = "dead"
+#UNINATIVE_CHECKSUM[x86_64] = "dead"
+UNINATIVE_DLDIR ?= "${DL_DIR}/uninative/"
+
+# Enabling uninative will change the following variables so they need to go the parsing white list to prevent multiple recipe parsing
+BB_HASHCONFIG_WHITELIST += "NATIVELSBSTRING SSTATEPOSTUNPACKFUNCS BUILD_LDFLAGS"
+
+addhandler uninative_event_fetchloader
+uninative_event_fetchloader[eventmask] = "bb.event.BuildStarted"
+
+addhandler uninative_event_enable
+uninative_event_enable[eventmask] = "bb.event.ConfigParsed"
+
+python uninative_event_fetchloader() {
+ """
+ This event fires on the parent and will try to fetch the tarball if the
+ loader isn't already present.
+ """
+
+ chksum = d.getVarFlag("UNINATIVE_CHECKSUM", d.getVar("BUILD_ARCH"))
+ if not chksum:
+ bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH"))
+
+ loader = d.getVar("UNINATIVE_LOADER")
+ loaderchksum = loader + ".chksum"
+ if os.path.exists(loader) and os.path.exists(loaderchksum):
+ with open(loaderchksum, "r") as f:
+ readchksum = f.read().strip()
+ if readchksum == chksum:
+ return
+
+ import subprocess
+ try:
+ # Save and restore cwd as Fetch.download() does a chdir()
+ olddir = os.getcwd()
+
+ tarball = d.getVar("UNINATIVE_TARBALL")
+ tarballdir = os.path.join(d.getVar("UNINATIVE_DLDIR"), chksum)
+ tarballpath = os.path.join(tarballdir, tarball)
+
+ if not os.path.exists(tarballpath):
+ bb.utils.mkdirhier(tarballdir)
+ if d.getVar("UNINATIVE_URL") == "unset":
+ bb.fatal("Uninative selected but not configured, please set UNINATIVE_URL")
+
+ localdata = bb.data.createCopy(d)
+ localdata.setVar('FILESPATH', "")
+ localdata.setVar('DL_DIR', tarballdir)
+ # Our games with path manipulation of DL_DIR mean standard PREMIRRORS don't work
+ # and we can't easily put 'chksum' into the url path from a url parameter with
+ # the current fetcher url handling
+ ownmirror = d.getVar('SOURCE_MIRROR_URL')
+ if ownmirror:
+ localdata.appendVar("PREMIRRORS", " ${UNINATIVE_URL}${UNINATIVE_TARBALL} ${SOURCE_MIRROR_URL}/uninative/%s/${UNINATIVE_TARBALL}" % chksum)
+
+ srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};sha256sum=%s" % chksum)
+ bb.note("Fetching uninative binary shim from %s" % srcuri)
+
+ fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+ fetcher.download()
+ localpath = fetcher.localpath(srcuri)
+ if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
+ # Follow the symlink behavior from the bitbake fetch2.
+ # This will cover the case where an existing symlink is broken
+ # as well as if there are two processes trying to create it
+ # at the same time.
+ if os.path.islink(tarballpath):
+ # Broken symbolic link
+ os.unlink(tarballpath)
+
+ # Deal with two processes trying to make symlink at once
+ try:
+ os.symlink(localpath, tarballpath)
+ except FileExistsError:
+ pass
+
+ # ldd output is "ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23", extract last option from first line
+ glibcver = subprocess.check_output(["ldd", "--version"]).decode('utf-8').split('\n')[0].split()[-1]
+ if bb.utils.vercmp_string(d.getVar("UNINATIVE_MAXGLIBCVERSION"), glibcver) < 0:
+ raise RuntimeError("Your host glibc verson (%s) is newer than that in uninative (%s). Disabling uninative so that sstate is not corrupted." % (glibcver, d.getVar("UNINATIVE_MAXGLIBCVERSION")))
+
+ cmd = d.expand("\
+mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \
+cd ${UNINATIVE_STAGING_DIR}-uninative; \
+tar -xjf ${UNINATIVE_DLDIR}/%s/${UNINATIVE_TARBALL}; \
+${UNINATIVE_STAGING_DIR}-uninative/relocate_sdk.py \
+ ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux \
+ ${UNINATIVE_LOADER} \
+ ${UNINATIVE_LOADER} \
+ ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative \
+ ${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${base_libdir_native}/libc*.so" % chksum)
+ subprocess.check_output(cmd, shell=True)
+
+ with open(loaderchksum, "w") as f:
+ f.write(chksum)
+
+ enable_uninative(d)
+
+ except RuntimeError as e:
+ bb.warn(str(e))
+ except bb.fetch2.BBFetchException as exc:
+ bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc))
+ bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.")
+ except subprocess.CalledProcessError as exc:
+ bb.warn("Disabling uninative as unable to install uninative tarball: %s" % str(exc))
+ bb.warn("To build your own uninative loader, please bitbake uninative-tarball and set UNINATIVE_TARBALL appropriately.")
+ finally:
+ os.chdir(olddir)
+}
+
+python uninative_event_enable() {
+ """
+ This event handler is called in the workers and is responsible for setting
+ up uninative if a loader is found.
+ """
+ enable_uninative(d)
+}
+
+def enable_uninative(d):
+ loader = d.getVar("UNINATIVE_LOADER")
+ if os.path.exists(loader):
+ bb.debug(2, "Enabling uninative")
+ d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
+ d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
+ d.appendVarFlag("SSTATEPOSTUNPACKFUNCS", "vardepvalueexclude", "| uninative_changeinterp")
+ d.appendVar("BUILD_LDFLAGS", " -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}")
+ d.appendVarFlag("BUILD_LDFLAGS", "vardepvalueexclude", "| -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}")
+ d.appendVarFlag("BUILD_LDFLAGS", "vardepsexclude", "UNINATIVE_LOADER")
+ d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
+
+python uninative_changeinterp () {
+ import subprocess
+ import stat
+ import oe.qa
+
+ if not (bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d)):
+ return
+
+ sstateinst = d.getVar('SSTATE_INSTDIR')
+ for walkroot, dirs, files in os.walk(sstateinst):
+ for file in files:
+ if file.endswith(".so") or ".so." in file:
+ continue
+ f = os.path.join(walkroot, file)
+ if os.path.islink(f):
+ continue
+ s = os.stat(f)
+ if not ((s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH)):
+ continue
+ elf = oe.qa.ELFFile(f)
+ try:
+ elf.open()
+ except oe.qa.NotELFFileError:
+ continue
+ if not elf.isDynamic():
+ continue
+
+ subprocess.check_output(("patchelf-uninative", "--set-interpreter", d.getVar("UNINATIVE_LOADER"), f), stderr=subprocess.STDOUT)
+}
diff --git a/poky/meta/classes/update-alternatives.bbclass b/poky/meta/classes/update-alternatives.bbclass
new file mode 100644
index 000000000..aa01058cf
--- /dev/null
+++ b/poky/meta/classes/update-alternatives.bbclass
@@ -0,0 +1,277 @@
+# This class is used to help the alternatives system which is useful when
+# multiple sources provide same command. You can use update-alternatives
+# command directly in your recipe, but in most cases this class simplifies
+# that job.
+#
+# To use this class a number of variables should be defined:
+#
+# List all of the alternatives needed by a package:
+# ALTERNATIVE_<pkg> = "name1 name2 name3 ..."
+#
+# i.e. ALTERNATIVE_busybox = "sh sed test bracket"
+#
+# The pathname of the link
+# ALTERNATIVE_LINK_NAME[name] = "target"
+#
+# This is the name of the binary once it's been installed onto the runtime.
+# This name is global to all split packages in this recipe, and should match
+# other recipes with the same functionality.
+# i.e. ALTERNATIVE_LINK_NAME[bracket] = "/usr/bin/["
+#
+# NOTE: If ALTERNATIVE_LINK_NAME is not defined, it defaults to ${bindir}/name
+#
+# The default link to create for all targets
+# ALTERNATIVE_TARGET = "target"
+#
+# This is useful in a multicall binary case
+# i.e. ALTERNATIVE_TARGET = "/bin/busybox"
+#
+# A non-default link to create for a target
+# ALTERNATIVE_TARGET[name] = "target"
+#
+# This is the name of the binary as it's been install by do_install
+# i.e. ALTERNATIVE_TARGET[sh] = "/bin/bash"
+#
+# A package specific link for a target
+# ALTERNATIVE_TARGET_<pkg>[name] = "target"
+#
+# This is useful when a recipe provides multiple alternatives for the
+# same item.
+#
+# NOTE: If ALTERNATIVE_TARGET is not defined, it will inherit the value
+# from ALTERNATIVE_LINK_NAME.
+#
+# NOTE: If the ALTERNATIVE_LINK_NAME and ALTERNATIVE_TARGET are the same,
+# ALTERNATIVE_TARGET will have '.{BPN}' appended to it. If the file
+# referenced has not been renamed, it will also be renamed. (This avoids
+# the need to rename alternative files in the do_install step, but still
+# supports it if necessary for some reason.)
+#
+# The default priority for any alternatives
+# ALTERNATIVE_PRIORITY = "priority"
+#
+# i.e. default is ALTERNATIVE_PRIORITY = "10"
+#
+# The non-default priority for a specific target
+# ALTERNATIVE_PRIORITY[name] = "priority"
+#
+# The package priority for a specific target
+# ALTERNATIVE_PRIORITY_<pkg>[name] = "priority"
+
+ALTERNATIVE_PRIORITY = "10"
+
+# We need special processing for vardeps because it can not work on
+# modified flag values. So we aggregate the flags into a new variable
+# and include that vairable in the set.
+UPDALTVARS = "ALTERNATIVE ALTERNATIVE_LINK_NAME ALTERNATIVE_TARGET ALTERNATIVE_PRIORITY"
+
+PACKAGE_WRITE_DEPS += "virtual/update-alternatives-native"
+
+def gen_updatealternativesvardeps(d):
+ pkgs = (d.getVar("PACKAGES") or "").split()
+ vars = (d.getVar("UPDALTVARS") or "").split()
+
+ # First compute them for non_pkg versions
+ for v in vars:
+ for flag in sorted((d.getVarFlags(v) or {}).keys()):
+ if flag == "doc" or flag == "vardeps" or flag == "vardepsexp":
+ continue
+ d.appendVar('%s_VARDEPS' % (v), ' %s:%s' % (flag, d.getVarFlag(v, flag, False)))
+
+ for p in pkgs:
+ for v in vars:
+ for flag in sorted((d.getVarFlags("%s_%s" % (v,p)) or {}).keys()):
+ if flag == "doc" or flag == "vardeps" or flag == "vardepsexp":
+ continue
+ d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False)))
+
+def ua_extend_depends(d):
+ if not 'virtual/update-alternatives' in d.getVar('PROVIDES'):
+ d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives')
+
+python __anonymous() {
+ # Update Alternatives only works on target packages...
+ if bb.data.inherits_class('native', d) or \
+ bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or \
+ bb.data.inherits_class('cross-canadian', d):
+ return
+
+ # Disable when targeting mingw32 (no target support)
+ if d.getVar("TARGET_OS") == "mingw32":
+ return
+
+ # compute special vardeps
+ gen_updatealternativesvardeps(d)
+
+ # extend the depends to include virtual/update-alternatives
+ ua_extend_depends(d)
+}
+
+def gen_updatealternativesvars(d):
+ ret = []
+ pkgs = (d.getVar("PACKAGES") or "").split()
+ vars = (d.getVar("UPDALTVARS") or "").split()
+
+ for v in vars:
+ ret.append(v + "_VARDEPS")
+
+ for p in pkgs:
+ for v in vars:
+ ret.append(v + "_" + p)
+ ret.append(v + "_VARDEPS_" + p)
+ return " ".join(ret)
+
+# Now the new stuff, we use a custom function to generate the right values
+populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
+
+# We need to do the rename after the image creation step, but before
+# the split and strip steps.. packagecopy seems to be the earliest reasonable
+# place.
+python perform_packagecopy_append () {
+ # Check for deprecated usage...
+ pn = d.getVar('BPN')
+ if d.getVar('ALTERNATIVE_LINKS') != None:
+ bb.fatal('%s: Use of ALTERNATIVE_LINKS/ALTERNATIVE_PATH/ALTERNATIVE_NAME is no longer supported, please convert to the updated syntax, see update-alternatives.bbclass for more info.' % pn)
+
+ # Do actual update alternatives processing
+ pkgdest = d.getVar('PKGD')
+ for pkg in (d.getVar('PACKAGES') or "").split():
+ # If the src == dest, we know we need to rename the dest by appending ${BPN}
+ link_rename = {}
+ for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
+ if not alt_link:
+ alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
+ if alt_link.startswith(os.path.join(d.getVar('sysconfdir', True), 'init.d')):
+ # Managing init scripts does not work (bug #10433), foremost
+ # because of a race with update-rc.d
+ bb.fatal("Using update-alternatives for managing SysV init scripts is not supported")
+
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
+ # Sometimes alt_target is specified as relative to the link name.
+ alt_target = os.path.join(os.path.dirname(alt_link), alt_target)
+
+ # If the link and target are the same name, we need to rename the target.
+ if alt_link == alt_target:
+ src = '%s/%s' % (pkgdest, alt_target)
+ alt_target_rename = '%s.%s' % (alt_target, pn)
+ dest = '%s/%s' % (pkgdest, alt_target_rename)
+ if os.path.lexists(dest):
+ bb.note('%s: Already renamed: %s' % (pn, alt_target_rename))
+ elif os.path.lexists(src):
+ if os.path.islink(src):
+ # Delay rename of links
+ link_rename[alt_target] = alt_target_rename
+ else:
+ bb.note('%s: Rename %s -> %s' % (pn, alt_target, alt_target_rename))
+ os.rename(src, dest)
+ else:
+ bb.warn("%s: alternative target (%s or %s) does not exist, skipping..." % (pn, alt_target, alt_target_rename))
+ continue
+ d.setVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, alt_target_rename)
+
+ # Process delayed link names
+ # Do these after other renames so we can correct broken links
+ for alt_target in link_rename:
+ src = '%s/%s' % (pkgdest, alt_target)
+ dest = '%s/%s' % (pkgdest, link_rename[alt_target])
+ link = os.readlink(src)
+ link_target = oe.path.realpath(src, pkgdest, True)
+
+ if os.path.lexists(link_target):
+ # Ok, the link_target exists, we can rename
+ bb.note('%s: Rename (link) %s -> %s' % (pn, alt_target, link_rename[alt_target]))
+ os.rename(src, dest)
+ else:
+ # Try to resolve the broken link to link.${BPN}
+ link_maybe = '%s.%s' % (os.readlink(src), pn)
+ if os.path.lexists(os.path.join(os.path.dirname(src), link_maybe)):
+ # Ok, the renamed link target exists.. create a new link, and remove the original
+ bb.note('%s: Creating new link %s -> %s' % (pn, link_rename[alt_target], link_maybe))
+ os.symlink(link_maybe, dest)
+ os.unlink(src)
+ else:
+ bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target))
+}
+
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
+
+python populate_packages_updatealternatives () {
+ pn = d.getVar('BPN')
+
+ # Do actual update alternatives processing
+ pkgdest = d.getVar('PKGD')
+ for pkg in (d.getVar('PACKAGES') or "").split():
+ # Create post install/removal scripts
+ alt_setup_links = ""
+ alt_remove_links = ""
+ for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
+ # Sometimes alt_target is specified as relative to the link name.
+ alt_target = os.path.join(os.path.dirname(alt_link), alt_target)
+
+ alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_PRIORITY', alt_name)
+ alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg) or d.getVar('ALTERNATIVE_PRIORITY')
+
+ # This shouldn't trigger, as it should have been resolved earlier!
+ if alt_link == alt_target:
+ bb.note('alt_link == alt_target: %s == %s -- correcting, this should not happen!' % (alt_link, alt_target))
+ alt_target = '%s.%s' % (alt_target, pn)
+
+ if not os.path.lexists('%s/%s' % (pkgdest, alt_target)):
+ bb.warn('%s: NOT adding alternative provide %s: %s does not exist' % (pn, alt_link, alt_target))
+ continue
+
+ # Default to generate shell script.. eventually we may want to change this...
+ alt_target = os.path.normpath(alt_target)
+
+ alt_setup_links += '\tupdate-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority)
+ alt_remove_links += '\tupdate-alternatives --remove %s %s\n' % (alt_name, alt_target)
+
+ if alt_setup_links:
+ # RDEPENDS setup
+ provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives')
+ if provider:
+ #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
+ d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider)
+
+ bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
+ bb.note('%s' % alt_setup_links)
+ postinst = d.getVar('pkg_postinst_%s' % pkg) or '#!/bin/sh\n'
+ postinst += alt_setup_links
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ bb.note('%s' % alt_remove_links)
+ prerm = d.getVar('pkg_prerm_%s' % pkg) or '#!/bin/sh\n'
+ prerm += alt_remove_links
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+}
+
+python package_do_filedeps_append () {
+ pn = d.getVar('BPN')
+ pkgdest = d.getVar('PKGDEST')
+
+ for pkg in packages.split():
+ for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg) or "").split():
+ alt_link = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name)
+ alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
+ alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link
+
+ if alt_link == alt_target:
+ bb.warn('%s: alt_link == alt_target: %s == %s' % (pn, alt_link, alt_target))
+ alt_target = '%s.%s' % (alt_target, pn)
+
+ if not os.path.lexists('%s/%s/%s' % (pkgdest, pkg, alt_target)):
+ continue
+
+ # Add file provide
+ trans_target = oe.package.file_translate(alt_target)
+ d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link)
+ if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg) or ""):
+ d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
+}
+
diff --git a/poky/meta/classes/update-rc.d.bbclass b/poky/meta/classes/update-rc.d.bbclass
new file mode 100644
index 000000000..06e3b2139
--- /dev/null
+++ b/poky/meta/classes/update-rc.d.bbclass
@@ -0,0 +1,143 @@
+UPDATERCPN ?= "${PN}"
+
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', ' update-rc.d initscripts', '', d)}"
+
+UPDATERCD = "update-rc.d"
+UPDATERCD_class-cross = ""
+UPDATERCD_class-native = ""
+UPDATERCD_class-nativesdk = ""
+
+INITSCRIPT_PARAMS ?= "defaults"
+
+INIT_D_DIR = "${sysconfdir}/init.d"
+
+def use_updatercd(d):
+ # If the distro supports both sysvinit and systemd, and the current recipe
+ # supports systemd, only call update-rc.d on rootfs creation or if systemd
+ # is not running. That's because systemctl enable/disable will already call
+ # update-rc.d if it detects initscripts.
+ if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and bb.data.inherits_class('systemd', d):
+ return '[ -n "$D" -o ! -d /run/systemd/system ]'
+ return 'true'
+
+updatercd_preinst() {
+if ${@use_updatercd(d)} && [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
+fi
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
+ if [ -n "$D" ]; then
+ OPT="-f -r $D"
+ else
+ OPT="-f"
+ fi
+ update-rc.d $OPT ${INITSCRIPT_NAME} remove
+fi
+}
+
+PACKAGE_WRITE_DEPS += "update-rc.d-native"
+
+updatercd_postinst() {
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
+ if [ -n "$D" ]; then
+ OPT="-r $D"
+ else
+ OPT="-s"
+ fi
+ update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+fi
+}
+
+updatercd_prerm() {
+if ${@use_updatercd(d)} && [ -z "$D" -a -x "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop || :
+fi
+}
+
+updatercd_postrm() {
+if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
+ if [ -n "$D" ]; then
+ OPT="-f -r $D"
+ else
+ OPT="-f"
+ fi
+ update-rc.d $OPT ${INITSCRIPT_NAME} remove
+fi
+}
+
+
+def update_rc_after_parse(d):
+ if d.getVar('INITSCRIPT_PACKAGES', False) == None:
+ if d.getVar('INITSCRIPT_NAME', False) == None:
+ bb.fatal("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE', False))
+ if d.getVar('INITSCRIPT_PARAMS', False) == None:
+ bb.fatal("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE', False))
+
+python __anonymous() {
+ update_rc_after_parse(d)
+}
+
+PACKAGESPLITFUNCS_prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}"
+PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
+
+populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
+populate_packages_updatercd[vardepsexclude] += "OVERRIDES"
+
+python populate_packages_updatercd () {
+ def update_rcd_auto_depend(pkg):
+ import subprocess
+ import os
+ path = d.expand("${D}${INIT_D_DIR}/${INITSCRIPT_NAME}")
+ if not os.path.exists(path):
+ return
+ statement = "grep -q -w '/etc/init.d/functions' %s" % path
+ if subprocess.call(statement, shell=True) == 0:
+ mlprefix = d.getVar('MLPREFIX') or ""
+ d.appendVar('RDEPENDS_' + pkg, ' %sinitd-functions' % (mlprefix))
+
+ def update_rcd_package(pkg):
+ bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg)
+
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES")
+ localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
+
+ update_rcd_auto_depend(pkg)
+
+ preinst = d.getVar('pkg_preinst_%s' % pkg)
+ if not preinst:
+ preinst = '#!/bin/sh\n'
+ preinst += localdata.getVar('updatercd_preinst')
+ d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+ postinst = d.getVar('pkg_postinst_%s' % pkg)
+ if not postinst:
+ postinst = '#!/bin/sh\n'
+ postinst += localdata.getVar('updatercd_postinst')
+ d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+ prerm = d.getVar('pkg_prerm_%s' % pkg)
+ if not prerm:
+ prerm = '#!/bin/sh\n'
+ prerm += localdata.getVar('updatercd_prerm')
+ d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+ postrm = d.getVar('pkg_postrm_%s' % pkg)
+ if not postrm:
+ postrm = '#!/bin/sh\n'
+ postrm += localdata.getVar('updatercd_postrm')
+ d.setVar('pkg_postrm_%s' % pkg, postrm)
+
+ d.appendVar('RRECOMMENDS_' + pkg, " ${MLPREFIX}${UPDATERCD}")
+
+ # Check that this class isn't being inhibited (generally, by
+ # systemd.bbclass) before doing any work.
+ if not d.getVar("INHIBIT_UPDATERCD_BBCLASS"):
+ pkgs = d.getVar('INITSCRIPT_PACKAGES')
+ if pkgs == None:
+ pkgs = d.getVar('UPDATERCPN')
+ packages = (d.getVar('PACKAGES') or "").split()
+ if not pkgs in packages and packages != []:
+ pkgs = packages[0]
+ for pkg in pkgs.split():
+ update_rcd_package(pkg)
+}
diff --git a/poky/meta/classes/upstream-version-is-even.bbclass b/poky/meta/classes/upstream-version-is-even.bbclass
new file mode 100644
index 000000000..256c75242
--- /dev/null
+++ b/poky/meta/classes/upstream-version-is-even.bbclass
@@ -0,0 +1,5 @@
+# This class ensures that the upstream version check only
+# accepts even minor versions (i.e. 3.0.x, 3.2.x, 3.4.x, etc.)
+# This scheme is used by Gnome and a number of other projects
+# to signify stable releases vs development releases.
+UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>\d+\.(\d*[02468])+(\.\d+)+)\.tar"
diff --git a/poky/meta/classes/useradd-staticids.bbclass b/poky/meta/classes/useradd-staticids.bbclass
new file mode 100644
index 000000000..64bf6dc82
--- /dev/null
+++ b/poky/meta/classes/useradd-staticids.bbclass
@@ -0,0 +1,311 @@
+# In order to support a deterministic set of 'dynamic' users/groups,
+# we need a function to reformat the params based on a static file
+def update_useradd_static_config(d):
+ import itertools
+ import re
+ import errno
+ import oe.useradd
+
+ def list_extend(iterable, length, obj = None):
+ """Ensure that iterable is the specified length by extending with obj
+ and return it as a list"""
+ return list(itertools.islice(itertools.chain(iterable, itertools.repeat(obj)), length))
+
+ def merge_files(file_list, exp_fields):
+ """Read each passwd/group file in file_list, split each line and create
+ a dictionary with the user/group names as keys and the split lines as
+ values. If the user/group name already exists in the dictionary, then
+ update any fields in the list with the values from the new list (if they
+ are set)."""
+ id_table = dict()
+ for conf in file_list.split():
+ try:
+ with open(conf, "r") as f:
+ for line in f:
+ if line.startswith('#'):
+ continue
+ # Make sure there always are at least exp_fields
+ # elements in the field list. This allows for leaving
+ # out trailing colons in the files.
+ fields = list_extend(line.rstrip().split(":"), exp_fields)
+ if fields[0] not in id_table:
+ id_table[fields[0]] = fields
+ else:
+ id_table[fields[0]] = list(map(lambda x, y: x or y, fields, id_table[fields[0]]))
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ pass
+
+ return id_table
+
+ def handle_missing_id(id, type, pkg, files, var, value):
+ # For backwards compatibility we accept "1" in addition to "error"
+ error_dynamic = d.getVar('USERADD_ERROR_DYNAMIC')
+ msg = "%s - %s: %sname %s does not have a static ID defined." % (d.getVar('PN'), pkg, type, id)
+ if files:
+ msg += " Add %s to one of these files: %s" % (id, files)
+ else:
+ msg += " %s file(s) not found in BBPATH: %s" % (var, value)
+ if error_dynamic == 'error' or error_dynamic == '1':
+ raise NotImplementedError(msg)
+ elif error_dynamic == 'warn':
+ bb.warn(msg)
+ elif error_dynamic == 'skip':
+ raise bb.parse.SkipRecipe(msg)
+
+ # Return a list of configuration files based on either the default
+ # files/group or the contents of USERADD_GID_TABLES, resp.
+ # files/passwd for USERADD_UID_TABLES.
+ # Paths are resolved via BBPATH.
+ def get_table_list(d, var, default):
+ files = []
+ bbpath = d.getVar('BBPATH', True)
+ tables = d.getVar(var, True)
+ if not tables:
+ tables = default
+ for conf_file in tables.split():
+ files.append(bb.utils.which(bbpath, conf_file))
+ return (' '.join(files), var, default)
+
+ # We parse and rewrite the useradd components
+ def rewrite_useradd(params, is_pkg):
+ parser = oe.useradd.build_useradd_parser()
+
+ newparams = []
+ users = None
+ for param in oe.useradd.split_commands(params):
+ try:
+ uaargs = parser.parse_args(oe.useradd.split_args(param))
+ except:
+ bb.fatal("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN'), pkg, param))
+
+ # Read all passwd files specified in USERADD_UID_TABLES or files/passwd
+ # Use the standard passwd layout:
+ # username:password:user_id:group_id:comment:home_directory:login_shell
+ #
+ # If a field is left blank, the original value will be used. The 'username'
+ # field is required.
+ #
+ # Note: we ignore the password field, as including even the hashed password
+ # in the useradd command may introduce a security hole. It's assumed that
+ # all new users get the default ('*' which prevents login) until the user is
+ # specifically configured by the system admin.
+ if not users:
+ files, table_var, table_value = get_table_list(d, 'USERADD_UID_TABLES', 'files/passwd')
+ users = merge_files(files, 7)
+
+ type = 'system user' if uaargs.system else 'normal user'
+ if uaargs.LOGIN not in users:
+ handle_missing_id(uaargs.LOGIN, type, pkg, files, table_var, table_value)
+ newparams.append(param)
+ continue
+
+ field = users[uaargs.LOGIN]
+
+ if uaargs.uid and field[2] and (uaargs.uid != field[2]):
+ bb.warn("%s: Changing username %s's uid from (%s) to (%s), verify configuration files!" % (d.getVar('PN'), uaargs.LOGIN, uaargs.uid, field[2]))
+ uaargs.uid = field[2] or uaargs.uid
+
+ # Determine the possible groupname
+ # Unless the group name (or gid) is specified, we assume that the LOGIN is the groupname
+ #
+ # By default the system has creation of the matching groups enabled
+ # So if the implicit username-group creation is on, then the implicit groupname (LOGIN)
+ # is used, and we disable the user_group option.
+ #
+ if uaargs.gid:
+ uaargs.groupname = uaargs.gid
+ elif uaargs.user_group is not False:
+ uaargs.groupname = uaargs.LOGIN
+ else:
+ uaargs.groupname = 'users'
+ uaargs.groupid = field[3] or uaargs.groupname
+
+ if uaargs.groupid and uaargs.gid != uaargs.groupid:
+ newgroup = None
+ if not uaargs.groupid.isdigit():
+ # We don't have a group number, so we have to add a name
+ bb.debug(1, "Adding group %s!" % uaargs.groupid)
+ newgroup = "%s %s" % (' --system' if uaargs.system else '', uaargs.groupid)
+ elif uaargs.groupname and not uaargs.groupname.isdigit():
+ # We have a group name and a group number to assign it to
+ bb.debug(1, "Adding group %s (gid %s)!" % (uaargs.groupname, uaargs.groupid))
+ newgroup = "-g %s %s" % (uaargs.groupid, uaargs.groupname)
+ else:
+ # We want to add a group, but we don't know it's name... so we can't add the group...
+ # We have to assume the group has previously been added or we'll fail on the adduser...
+ # Note: specifying the actual gid is very rare in OE, usually the group name is specified.
+ bb.warn("%s: Changing gid for login %s to %s, verify configuration files!" % (d.getVar('PN'), uaargs.LOGIN, uaargs.groupid))
+
+ uaargs.gid = uaargs.groupid
+ uaargs.user_group = None
+ if newgroup and is_pkg:
+ groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg)
+ if groupadd:
+ # Only add the group if not already specified
+ if not uaargs.groupname in groupadd:
+ d.setVar("GROUPADD_PARAM_%s" % pkg, "%s; %s" % (groupadd, newgroup))
+ else:
+ d.setVar("GROUPADD_PARAM_%s" % pkg, newgroup)
+
+ uaargs.comment = "'%s'" % field[4] if field[4] else uaargs.comment
+ uaargs.home_dir = field[5] or uaargs.home_dir
+ uaargs.shell = field[6] or uaargs.shell
+
+ # Should be an error if a specific option is set...
+ if not uaargs.uid or not uaargs.uid.isdigit() or not uaargs.gid:
+ handle_missing_id(uaargs.LOGIN, type, pkg, files, table_var, table_value)
+
+ # Reconstruct the args...
+ newparam = ['', ' --defaults'][uaargs.defaults]
+ newparam += ['', ' --base-dir %s' % uaargs.base_dir][uaargs.base_dir != None]
+ newparam += ['', ' --comment %s' % uaargs.comment][uaargs.comment != None]
+ newparam += ['', ' --home-dir %s' % uaargs.home_dir][uaargs.home_dir != None]
+ newparam += ['', ' --expiredate %s' % uaargs.expiredate][uaargs.expiredate != None]
+ newparam += ['', ' --inactive %s' % uaargs.inactive][uaargs.inactive != None]
+ newparam += ['', ' --gid %s' % uaargs.gid][uaargs.gid != None]
+ newparam += ['', ' --groups %s' % uaargs.groups][uaargs.groups != None]
+ newparam += ['', ' --skel %s' % uaargs.skel][uaargs.skel != None]
+ newparam += ['', ' --key %s' % uaargs.key][uaargs.key != None]
+ newparam += ['', ' --no-log-init'][uaargs.no_log_init]
+ newparam += ['', ' --create-home'][uaargs.create_home is True]
+ newparam += ['', ' --no-create-home'][uaargs.create_home is False]
+ newparam += ['', ' --no-user-group'][uaargs.user_group is False]
+ newparam += ['', ' --non-unique'][uaargs.non_unique]
+ if uaargs.password != None:
+ newparam += ['', ' --password %s' % uaargs.password][uaargs.password != None]
+ elif uaargs.clear_password:
+ newparam += ['', ' --clear-password %s' % uaargs.clear_password][uaargs.clear_password != None]
+ newparam += ['', ' --root %s' % uaargs.root][uaargs.root != None]
+ newparam += ['', ' --system'][uaargs.system]
+ newparam += ['', ' --shell %s' % uaargs.shell][uaargs.shell != None]
+ newparam += ['', ' --uid %s' % uaargs.uid][uaargs.uid != None]
+ newparam += ['', ' --user-group'][uaargs.user_group is True]
+ newparam += ' %s' % uaargs.LOGIN
+
+ newparams.append(newparam)
+
+ return ";".join(newparams).strip()
+
+ # We parse and rewrite the groupadd components
+ def rewrite_groupadd(params, is_pkg):
+ parser = oe.useradd.build_groupadd_parser()
+
+ newparams = []
+ groups = None
+ for param in oe.useradd.split_commands(params):
+ try:
+ # If we're processing multiple lines, we could have left over values here...
+ gaargs = parser.parse_args(oe.useradd.split_args(param))
+ except:
+ bb.fatal("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN'), pkg, param))
+
+ # Read all group files specified in USERADD_GID_TABLES or files/group
+ # Use the standard group layout:
+ # groupname:password:group_id:group_members
+ #
+ # If a field is left blank, the original value will be used. The 'groupname' field
+ # is required.
+ #
+ # Note: similar to the passwd file, the 'password' filed is ignored
+ # Note: group_members is ignored, group members must be configured with the GROUPMEMS_PARAM
+ if not groups:
+ files, table_var, table_value = get_table_list(d, 'USERADD_GID_TABLES', 'files/group')
+ groups = merge_files(files, 4)
+
+ type = 'system group' if gaargs.system else 'normal group'
+ if gaargs.GROUP not in groups:
+ handle_missing_id(gaargs.GROUP, type, pkg, files, table_var, table_value)
+ newparams.append(param)
+ continue
+
+ field = groups[gaargs.GROUP]
+
+ if field[2]:
+ if gaargs.gid and (gaargs.gid != field[2]):
+ bb.warn("%s: Changing groupname %s's gid from (%s) to (%s), verify configuration files!" % (d.getVar('PN'), gaargs.GROUP, gaargs.gid, field[2]))
+ gaargs.gid = field[2]
+
+ if not gaargs.gid or not gaargs.gid.isdigit():
+ handle_missing_id(gaargs.GROUP, type, pkg, files, table_var, table_value)
+
+ # Reconstruct the args...
+ newparam = ['', ' --force'][gaargs.force]
+ newparam += ['', ' --gid %s' % gaargs.gid][gaargs.gid != None]
+ newparam += ['', ' --key %s' % gaargs.key][gaargs.key != None]
+ newparam += ['', ' --non-unique'][gaargs.non_unique]
+ if gaargs.password != None:
+ newparam += ['', ' --password %s' % gaargs.password][gaargs.password != None]
+ elif gaargs.clear_password:
+ newparam += ['', ' --clear-password %s' % gaargs.clear_password][gaargs.clear_password != None]
+ newparam += ['', ' --root %s' % gaargs.root][gaargs.root != None]
+ newparam += ['', ' --system'][gaargs.system]
+ newparam += ' %s' % gaargs.GROUP
+
+ newparams.append(newparam)
+
+ return ";".join(newparams).strip()
+
+ # The parsing of the current recipe depends on the content of
+ # the files listed in USERADD_UID/GID_TABLES. We need to tell bitbake
+ # about that explicitly to trigger re-parsing and thus re-execution of
+ # this code when the files change.
+ bbpath = d.getVar('BBPATH')
+ for varname, default in (('USERADD_UID_TABLES', 'files/passwd'),
+ ('USERADD_GID_TABLES', 'files/group')):
+ tables = d.getVar(varname)
+ if not tables:
+ tables = default
+ for conf_file in tables.split():
+ bb.parse.mark_dependency(d, bb.utils.which(bbpath, conf_file))
+
+ # Load and process the users and groups, rewriting the adduser/addgroup params
+ useradd_packages = d.getVar('USERADD_PACKAGES') or ""
+
+ for pkg in useradd_packages.split():
+ # Groupmems doesn't have anything we might want to change, so simply validating
+ # is a bit of a waste -- only process useradd/groupadd
+ useradd_param = d.getVar('USERADD_PARAM_%s' % pkg)
+ if useradd_param:
+ #bb.warn("Before: 'USERADD_PARAM_%s' - '%s'" % (pkg, useradd_param))
+ d.setVar('USERADD_PARAM_%s' % pkg, rewrite_useradd(useradd_param, True))
+ #bb.warn("After: 'USERADD_PARAM_%s' - '%s'" % (pkg, d.getVar('USERADD_PARAM_%s' % pkg)))
+
+ groupadd_param = d.getVar('GROUPADD_PARAM_%s' % pkg)
+ if groupadd_param:
+ #bb.warn("Before: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, groupadd_param))
+ d.setVar('GROUPADD_PARAM_%s' % pkg, rewrite_groupadd(groupadd_param, True))
+ #bb.warn("After: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, d.getVar('GROUPADD_PARAM_%s' % pkg)))
+
+ # Load and process extra users and groups, rewriting only adduser/addgroup params
+ pkg = d.getVar('PN')
+ extrausers = d.getVar('EXTRA_USERS_PARAMS') or ""
+
+ #bb.warn("Before: 'EXTRA_USERS_PARAMS' - '%s'" % (d.getVar('EXTRA_USERS_PARAMS')))
+ new_extrausers = []
+ for cmd in oe.useradd.split_commands(extrausers):
+ if re.match('''useradd (.*)''', cmd):
+ useradd_param = re.match('''useradd (.*)''', cmd).group(1)
+ useradd_param = rewrite_useradd(useradd_param, False)
+ cmd = 'useradd %s' % useradd_param
+ elif re.match('''groupadd (.*)''', cmd):
+ groupadd_param = re.match('''groupadd (.*)''', cmd).group(1)
+ groupadd_param = rewrite_groupadd(groupadd_param, False)
+ cmd = 'groupadd %s' % groupadd_param
+
+ new_extrausers.append(cmd)
+
+ new_extrausers.append('')
+ d.setVar('EXTRA_USERS_PARAMS', ';'.join(new_extrausers))
+ #bb.warn("After: 'EXTRA_USERS_PARAMS' - '%s'" % (d.getVar('EXTRA_USERS_PARAMS')))
+
+
+python __anonymous() {
+ if not bb.data.inherits_class('nativesdk', d) \
+ and not bb.data.inherits_class('native', d):
+ try:
+ update_useradd_static_config(d)
+ except NotImplementedError as f:
+ bb.debug(1, "Skipping recipe %s: %s" % (d.getVar('PN'), f))
+ raise bb.parse.SkipRecipe(f)
+}
diff --git a/poky/meta/classes/useradd.bbclass b/poky/meta/classes/useradd.bbclass
new file mode 100644
index 000000000..124becd08
--- /dev/null
+++ b/poky/meta/classes/useradd.bbclass
@@ -0,0 +1,252 @@
+inherit useradd_base
+
+# base-passwd-cross provides the default passwd and group files in the
+# target sysroot, and shadow -native and -sysroot provide the utilities
+# and support files needed to add and modify user and group accounts
+DEPENDS_append_class-target = " base-files shadow-native shadow-sysroot shadow base-passwd"
+PACKAGE_WRITE_DEPS += "shadow-native"
+
+# This preinstall function can be run in four different contexts:
+#
+# a) Before do_install
+# b) At do_populate_sysroot_setscene when installing from sstate packages
+# c) As the preinst script in the target package at do_rootfs time
+# d) As the preinst script in the target package on device as a package upgrade
+#
+useradd_preinst () {
+OPT=""
+SYSROOT=""
+
+if test "x$D" != "x"; then
+ # Installing into a sysroot
+ SYSROOT="$D"
+ OPT="--root $D"
+
+ # Make sure login.defs is there, this is to make debian package backend work
+ # correctly while doing rootfs.
+ # The problem here is that if /etc/login.defs is treated as a config file for
+ # shadow package, then while performing preinsts for packages that depend on
+ # shadow, there might only be /etc/login.def.dpkg-new there in root filesystem.
+ if [ ! -e $D${sysconfdir}/login.defs -a -e $D${sysconfdir}/login.defs.dpkg-new ]; then
+ cp $D${sysconfdir}/login.defs.dpkg-new $D${sysconfdir}/login.defs
+ fi
+
+ # user/group lookups should match useradd/groupadd --root
+ export PSEUDO_PASSWD="$SYSROOT"
+fi
+
+# If we're not doing a special SSTATE/SYSROOT install
+# then set the values, otherwise use the environment
+if test "x$UA_SYSROOT" = "x"; then
+ # Installing onto a target
+ # Add groups and users defined only for this package
+ GROUPADD_PARAM="${GROUPADD_PARAM}"
+ USERADD_PARAM="${USERADD_PARAM}"
+ GROUPMEMS_PARAM="${GROUPMEMS_PARAM}"
+fi
+
+# Perform group additions first, since user additions may depend
+# on these groups existing
+if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then
+ echo "Running groupadd commands..."
+ # Invoke multiple instances of groupadd for parameter lists
+ # separated by ';'
+ opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ while test "x$opts" != "x"; do
+ perform_groupadd "$SYSROOT" "$OPT $opts"
+ if test "x$opts" = "x$remaining"; then
+ break
+ fi
+ opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ done
+fi
+
+if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then
+ echo "Running useradd commands..."
+ # Invoke multiple instances of useradd for parameter lists
+ # separated by ';'
+ opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ while test "x$opts" != "x"; do
+ perform_useradd "$SYSROOT" "$OPT $opts"
+ if test "x$opts" = "x$remaining"; then
+ break
+ fi
+ opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ done
+fi
+
+if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then
+ echo "Running groupmems commands..."
+ # Invoke multiple instances of groupmems for parameter lists
+ # separated by ';'
+ opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ while test "x$opts" != "x"; do
+ perform_groupmems "$SYSROOT" "$OPT $opts"
+ if test "x$opts" = "x$remaining"; then
+ break
+ fi
+ opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
+ done
+fi
+}
+
+useradd_sysroot () {
+ # Pseudo may (do_prepare_recipe_sysroot) or may not (do_populate_sysroot_setscene) be running
+ # at this point so we're explicit about the environment so pseudo can load if
+ # not already present.
+ export PSEUDO="${FAKEROOTENV} ${PSEUDO_SYSROOT}${bindir_native}/pseudo"
+
+ # Explicitly set $D since it isn't set to anything
+ # before do_prepare_recipe_sysroot
+ D=${STAGING_DIR_TARGET}
+
+ # base-passwd's postinst may not have run yet in which case we'll get called later, just exit.
+ # Beware that in some cases we might see the fake pseudo passwd here, in which case we also must
+ # exit.
+ if [ ! -f $D${sysconfdir}/passwd ] ||
+ grep -q this-is-the-pseudo-passwd $D${sysconfdir}/passwd; then
+ exit 0
+ fi
+
+ # It is also possible we may be in a recipe which doesn't have useradd dependencies and hence the
+ # useradd/groupadd tools are unavailable. If there is no dependency, we assume we don't want to
+ # create users in the sysroot
+ if ! command -v useradd; then
+ bbwarn "command useradd not found!"
+ exit 0
+ fi
+
+ # Add groups and users defined for all recipe packages
+ GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
+ USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
+ GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
+
+ # Tell the system to use the environment vars
+ UA_SYSROOT=1
+
+ useradd_preinst
+}
+
+# The export of PSEUDO in useradd_sysroot() above contains references to
+# ${COMPONENTS_DIR} and ${PSEUDO_LOCALSTATEDIR}. Additionally, the logging
+# shell functions use ${LOGFIFO}. These need to be handled when restoring
+# postinst-useradd-${PN} from the sstate cache.
+EXTRA_STAGING_FIXMES += "COMPONENTS_DIR PSEUDO_LOCALSTATEDIR LOGFIFO"
+
+python useradd_sysroot_sstate () {
+ scriptfile = None
+ task = d.getVar("BB_CURRENTTASK")
+ if task == "package_setscene":
+ bb.build.exec_func("useradd_sysroot", d)
+ elif task == "prepare_recipe_sysroot":
+ # Used to update this recipe's own sysroot so the user/groups are available to do_install
+ scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}")
+ bb.build.exec_func("useradd_sysroot", d)
+ elif task == "populate_sysroot":
+ # Used when installed in dependent task sysroots
+ scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}")
+
+ if scriptfile:
+ bb.utils.mkdirhier(os.path.dirname(scriptfile))
+ with open(scriptfile, 'w') as script:
+ script.write("#!/bin/sh\n")
+ bb.data.emit_func("useradd_sysroot", script, d)
+ script.write("useradd_sysroot\n")
+ os.chmod(scriptfile, 0o755)
+}
+
+do_prepare_recipe_sysroot[postfuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC_class-target = "useradd_sysroot_sstate"
+SYSROOTFUNC = ""
+
+SYSROOT_PREPROCESS_FUNCS += "${SYSROOTFUNC}"
+
+SSTATEPREINSTFUNCS_append_class-target = " useradd_sysroot_sstate"
+
+do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
+do_populate_sysroot_setscene[depends] += "${USERADDSETSCENEDEPS}"
+USERADDSETSCENEDEPS_class-target = "${MLPREFIX}base-passwd:do_populate_sysroot_setscene pseudo-native:do_populate_sysroot_setscene shadow-native:do_populate_sysroot_setscene ${MLPREFIX}shadow-sysroot:do_populate_sysroot_setscene"
+USERADDSETSCENEDEPS = ""
+
+# Recipe parse-time sanity checks
+def update_useradd_after_parse(d):
+ useradd_packages = d.getVar('USERADD_PACKAGES')
+
+ if not useradd_packages:
+ bb.fatal("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
+
+ for pkg in useradd_packages.split():
+ if not d.getVar('USERADD_PARAM_%s' % pkg) and not d.getVar('GROUPADD_PARAM_%s' % pkg) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg):
+ bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE', False), pkg))
+
+python __anonymous() {
+ if not bb.data.inherits_class('nativesdk', d) \
+ and not bb.data.inherits_class('native', d):
+ update_useradd_after_parse(d)
+}
+
+# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the
+# [group|user]add parameters for all USERADD_PACKAGES in this recipe
+def get_all_cmd_params(d, cmd_type):
+ import string
+
+ param_type = cmd_type.upper() + "_PARAM_%s"
+ params = []
+
+ useradd_packages = d.getVar('USERADD_PACKAGES') or ""
+ for pkg in useradd_packages.split():
+ param = d.getVar(param_type % pkg)
+ if param:
+ params.append(param.rstrip(" ;"))
+
+ return "; ".join(params)
+
+# Adds the preinst script into generated packages
+fakeroot python populate_packages_prepend () {
+ def update_useradd_package(pkg):
+ bb.debug(1, 'adding user/group calls to preinst for %s' % pkg)
+
+ """
+ useradd preinst is appended here because pkg_preinst may be
+ required to execute on the target. Not doing so may cause
+ useradd preinst to be invoked twice, causing unwanted warnings.
+ """
+ preinst = d.getVar('pkg_preinst_%s' % pkg) or d.getVar('pkg_preinst')
+ if not preinst:
+ preinst = '#!/bin/sh\n'
+ preinst += 'bbnote () {\n\techo "NOTE: $*"\n}\n'
+ preinst += 'bbwarn () {\n\techo "WARNING: $*"\n}\n'
+ preinst += 'bbfatal () {\n\techo "ERROR: $*"\n\texit 1\n}\n'
+ preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd')
+ preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd')
+ preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems')
+ preinst += d.getVar('useradd_preinst')
+ d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+ # RDEPENDS setup
+ rdepends = d.getVar("RDEPENDS_%s" % pkg) or ""
+ rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-passwd'
+ rdepends += ' ' + d.getVar('MLPREFIX', False) + 'shadow'
+ # base-files is where the default /etc/skel is packaged
+ rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-files'
+ d.setVar("RDEPENDS_%s" % pkg, rdepends)
+
+ # Add the user/group preinstall scripts and RDEPENDS requirements
+ # to packages specified by USERADD_PACKAGES
+ if not bb.data.inherits_class('nativesdk', d) \
+ and not bb.data.inherits_class('native', d):
+ useradd_packages = d.getVar('USERADD_PACKAGES') or ""
+ for pkg in useradd_packages.split():
+ update_useradd_package(pkg)
+}
+
+# Use the following to extend the useradd with custom functions
+USERADDEXTENSION ?= ""
+
+inherit ${USERADDEXTENSION}
diff --git a/poky/meta/classes/useradd_base.bbclass b/poky/meta/classes/useradd_base.bbclass
new file mode 100644
index 000000000..551c82c32
--- /dev/null
+++ b/poky/meta/classes/useradd_base.bbclass
@@ -0,0 +1,147 @@
+# This bbclass provides basic functionality for user/group settings.
+# This bbclass is intended to be inherited by useradd.bbclass and
+# extrausers.bbclass.
+
+# The following functions basically have similar logic.
+# *) Perform necessary checks before invoking the actual command
+# *) Invoke the actual command with flock
+# *) Error out if an error occurs.
+
+# Note that before invoking these functions, make sure the global variable
+# PSEUDO is set up correctly.
+
+perform_groupadd () {
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing groupadd with [$opts]"
+ local groupname=`echo "$opts" | awk '{ print $NF }'`
+ local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+ if test "x$group_exists" = "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupadd \$opts\" || true
+ group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+ if test "x$group_exists" = "x"; then
+ bbfatal "${PN}: groupadd command did not succeed."
+ fi
+ else
+ bbnote "${PN}: group $groupname already exists, not re-creating it"
+ fi
+}
+
+perform_useradd () {
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing useradd with [$opts]"
+ local username=`echo "$opts" | awk '{ print $NF }'`
+ local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+ if test "x$user_exists" = "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO useradd \$opts\" || true
+ user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+ if test "x$user_exists" = "x"; then
+ bbfatal "${PN}: useradd command did not succeed."
+ fi
+ else
+ bbnote "${PN}: user $username already exists, not re-creating it"
+ fi
+}
+
+perform_groupmems () {
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing groupmems with [$opts]"
+ local groupname=`echo "$opts" | awk '{ for (i = 1; i < NF; i++) if ($i == "-g" || $i == "--group") print $(i+1) }'`
+ local username=`echo "$opts" | awk '{ for (i = 1; i < NF; i++) if ($i == "-a" || $i == "--add") print $(i+1) }'`
+ bbnote "${PN}: Running groupmems command with group $groupname and user $username"
+ local mem_exists="`grep "^$groupname:[^:]*:[^:]*:\([^,]*,\)*$username\(,[^,]*\)*" $rootdir/etc/group || true`"
+ if test "x$mem_exists" = "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupmems \$opts\" || true
+ mem_exists="`grep "^$groupname:[^:]*:[^:]*:\([^,]*,\)*$username\(,[^,]*\)*" $rootdir/etc/group || true`"
+ if test "x$mem_exists" = "x"; then
+ bbfatal "${PN}: groupmems command did not succeed."
+ fi
+ else
+ bbnote "${PN}: group $groupname already contains $username, not re-adding it"
+ fi
+}
+
+perform_groupdel () {
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing groupdel with [$opts]"
+ local groupname=`echo "$opts" | awk '{ print $NF }'`
+ local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+
+ if test "x$group_exists" != "x"; then
+ local awk_input='BEGIN {FS=":"}; $1=="'$groupname'" { print $3 }'
+ local groupid=`echo "$awk_input" | awk -f- $rootdir/etc/group`
+ local awk_check_users='BEGIN {FS=":"}; $4=="'$groupid'" {print $1}'
+ local other_users=`echo "$awk_check_users" | awk -f- $rootdir/etc/passwd`
+
+ if test "x$other_users" = "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupdel \$opts\" || true
+ group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+ if test "x$group_exists" != "x"; then
+ bbfatal "${PN}: groupdel command did not succeed."
+ fi
+ else
+ bbnote "${PN}: '$groupname' is primary group for users '$other_users', not removing it"
+ fi
+ else
+ bbnote "${PN}: group $groupname doesn't exist, not removing it"
+ fi
+}
+
+perform_userdel () {
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing userdel with [$opts]"
+ local username=`echo "$opts" | awk '{ print $NF }'`
+ local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+ if test "x$user_exists" != "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO userdel \$opts\" || true
+ user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+ if test "x$user_exists" != "x"; then
+ bbfatal "${PN}: userdel command did not succeed."
+ fi
+ else
+ bbnote "${PN}: user $username doesn't exist, not removing it"
+ fi
+}
+
+perform_groupmod () {
+ # Other than the return value of groupmod, there's no simple way to judge whether the command
+ # succeeds, so we disable -e option temporarily
+ set +e
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing groupmod with [$opts]"
+ local groupname=`echo "$opts" | awk '{ print $NF }'`
+ local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+ if test "x$group_exists" != "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupmod \$opts\"
+ if test $? != 0; then
+ bbwarn "${PN}: groupmod command did not succeed."
+ fi
+ else
+ bbwarn "${PN}: group $groupname doesn't exist, unable to modify it"
+ fi
+ set -e
+}
+
+perform_usermod () {
+ # Same reason with groupmod, temporarily disable -e option
+ set +e
+ local rootdir="$1"
+ local opts="$2"
+ bbnote "${PN}: Performing usermod with [$opts]"
+ local username=`echo "$opts" | awk '{ print $NF }'`
+ local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+ if test "x$user_exists" != "x"; then
+ eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO usermod \$opts\"
+ if test $? != 0; then
+ bbfatal "${PN}: usermod command did not succeed."
+ fi
+ else
+ bbwarn "${PN}: user $username doesn't exist, unable to modify it"
+ fi
+ set -e
+}
diff --git a/poky/meta/classes/utility-tasks.bbclass b/poky/meta/classes/utility-tasks.bbclass
new file mode 100644
index 000000000..b1f27d365
--- /dev/null
+++ b/poky/meta/classes/utility-tasks.bbclass
@@ -0,0 +1,53 @@
+addtask listtasks
+do_listtasks[nostamp] = "1"
+python do_listtasks() {
+ taskdescs = {}
+ maxlen = 0
+ for e in d.keys():
+ if d.getVarFlag(e, 'task'):
+ maxlen = max(maxlen, len(e))
+ if e.endswith('_setscene'):
+ desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '')
+ else:
+ desc = d.getVarFlag(e, 'doc') or ''
+ taskdescs[e] = desc
+
+ tasks = sorted(taskdescs.keys())
+ for taskname in tasks:
+ bb.plain("%s %s" % (taskname.ljust(maxlen), taskdescs[taskname]))
+}
+
+CLEANFUNCS ?= ""
+
+T_task-clean = "${LOG_DIR}/cleanlogs/${PN}"
+addtask clean
+do_clean[nostamp] = "1"
+python do_clean() {
+ """clear the build and temp directories"""
+ dir = d.expand("${WORKDIR}")
+ bb.note("Removing " + dir)
+ oe.path.remove(dir)
+
+ dir = "%s.*" % d.getVar('STAMP')
+ bb.note("Removing " + dir)
+ oe.path.remove(dir)
+
+ for f in (d.getVar('CLEANFUNCS') or '').split():
+ bb.build.exec_func(f, d)
+}
+
+addtask checkuri
+do_checkuri[nostamp] = "1"
+python do_checkuri() {
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ try:
+ fetcher = bb.fetch2.Fetch(src_uri, d)
+ fetcher.checkstatus()
+ except bb.fetch2.BBFetchException as e:
+ bb.fatal(str(e))
+}
+
+
diff --git a/poky/meta/classes/utils.bbclass b/poky/meta/classes/utils.bbclass
new file mode 100644
index 000000000..4f016e3d0
--- /dev/null
+++ b/poky/meta/classes/utils.bbclass
@@ -0,0 +1,399 @@
+def machine_paths(d):
+ """List any existing machine specific filespath directories"""
+ machine = d.getVar("MACHINE")
+ filespathpkg = d.getVar("FILESPATHPKG").split(":")
+ for basepath in d.getVar("FILESPATHBASE").split(":"):
+ for pkgpath in filespathpkg:
+ machinepath = os.path.join(basepath, pkgpath, machine)
+ if os.path.isdir(machinepath):
+ yield machinepath
+
+def is_machine_specific(d):
+ """Determine whether the current recipe is machine specific"""
+ machinepaths = set(machine_paths(d))
+ srcuri = d.getVar("SRC_URI").split()
+ for url in srcuri:
+ fetcher = bb.fetch2.Fetch([srcuri], d)
+ if url.startswith("file://"):
+ if any(fetcher.localpath(url).startswith(mp + "/") for mp in machinepaths):
+ return True
+
+oe_soinstall() {
+ # Purpose: Install shared library file and
+ # create the necessary links
+ # Example: oe_soinstall libfoo.so.1.2.3 ${D}${libdir}
+ libname=`basename $1`
+ case "$libname" in
+ *.so)
+ bbfatal "oe_soinstall: Shared library must haved versioned filename (e.g. libfoo.so.1.2.3)"
+ ;;
+ esac
+ install -m 755 $1 $2/$libname
+ sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+ if [ -z $sonamelink ]; then
+ bbfatal "oe_soinstall: $libname is missing ELF tag 'SONAME'."
+ fi
+ solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
+ ln -sf $libname $2/$sonamelink
+ ln -sf $libname $2/$solink
+}
+
+oe_libinstall() {
+ # Purpose: Install a library, in all its forms
+ # Example
+ #
+ # oe_libinstall libltdl ${STAGING_LIBDIR}/
+ # oe_libinstall -C src/libblah libblah ${D}/${libdir}/
+ dir=""
+ libtool=""
+ silent=""
+ require_static=""
+ require_shared=""
+ staging_install=""
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -C)
+ shift
+ dir="$1"
+ ;;
+ -s)
+ silent=1
+ ;;
+ -a)
+ require_static=1
+ ;;
+ -so)
+ require_shared=1
+ ;;
+ -*)
+ bbfatal "oe_libinstall: unknown option: $1"
+ ;;
+ *)
+ break;
+ ;;
+ esac
+ shift
+ done
+
+ libname="$1"
+ shift
+ destpath="$1"
+ if [ -z "$destpath" ]; then
+ bbfatal "oe_libinstall: no destination path specified"
+ fi
+ if echo "$destpath/" | egrep '^${STAGING_LIBDIR}/' >/dev/null
+ then
+ staging_install=1
+ fi
+
+ __runcmd () {
+ if [ -z "$silent" ]; then
+ echo >&2 "oe_libinstall: $*"
+ fi
+ $*
+ }
+
+ if [ -z "$dir" ]; then
+ dir=`pwd`
+ fi
+
+ dotlai=$libname.lai
+
+ # Sanity check that the libname.lai is unique
+ number_of_files=`(cd $dir; find . -name "$dotlai") | wc -l`
+ if [ $number_of_files -gt 1 ]; then
+ bbfatal "oe_libinstall: $dotlai is not unique in $dir"
+ fi
+
+
+ dir=$dir`(cd $dir;find . -name "$dotlai") | sed "s/^\.//;s/\/$dotlai\$//;q"`
+ olddir=`pwd`
+ __runcmd cd $dir
+
+ lafile=$libname.la
+
+ # If such file doesn't exist, try to cut version suffix
+ if [ ! -f "$lafile" ]; then
+ libname1=`echo "$libname" | sed 's/-[0-9.]*$//'`
+ lafile1=$libname.la
+ if [ -f "$lafile1" ]; then
+ libname=$libname1
+ lafile=$lafile1
+ fi
+ fi
+
+ if [ -f "$lafile" ]; then
+ # libtool archive
+ eval `cat $lafile|grep "^library_names="`
+ libtool=1
+ else
+ library_names="$libname.so* $libname.dll.a $libname.*.dylib"
+ fi
+
+ __runcmd install -d $destpath/
+ dota=$libname.a
+ if [ -f "$dota" -o -n "$require_static" ]; then
+ rm -f $destpath/$dota
+ __runcmd install -m 0644 $dota $destpath/
+ fi
+ if [ -f "$dotlai" -a -n "$libtool" ]; then
+ rm -f $destpath/$libname.la
+ __runcmd install -m 0644 $dotlai $destpath/$libname.la
+ fi
+
+ for name in $library_names; do
+ files=`eval echo $name`
+ for f in $files; do
+ if [ ! -e "$f" ]; then
+ if [ -n "$libtool" ]; then
+ bbfatal "oe_libinstall: $dir/$f not found."
+ fi
+ elif [ -L "$f" ]; then
+ __runcmd cp -P "$f" $destpath/
+ elif [ ! -L "$f" ]; then
+ libfile="$f"
+ rm -f $destpath/$libfile
+ __runcmd install -m 0755 $libfile $destpath/
+ fi
+ done
+ done
+
+ if [ -z "$libfile" ]; then
+ if [ -n "$require_shared" ]; then
+ bbfatal "oe_libinstall: unable to locate shared library"
+ fi
+ elif [ -z "$libtool" ]; then
+ # special case hack for non-libtool .so.#.#.# links
+ baselibfile=`basename "$libfile"`
+ if (echo $baselibfile | grep -qE '^lib.*\.so\.[0-9.]*$'); then
+ sonamelink=`${HOST_PREFIX}readelf -d $libfile |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+ solink=`echo $baselibfile | sed -e 's/\.so\..*/.so/'`
+ if [ -n "$sonamelink" -a x"$baselibfile" != x"$sonamelink" ]; then
+ __runcmd ln -sf $baselibfile $destpath/$sonamelink
+ fi
+ __runcmd ln -sf $baselibfile $destpath/$solink
+ fi
+ fi
+
+ __runcmd cd "$olddir"
+}
+
+oe_machinstall() {
+ # Purpose: Install machine dependent files, if available
+ # If not available, check if there is a default
+ # If no default, just touch the destination
+ # Example:
+ # $1 $2 $3 $4
+ # oe_machinstall -m 0644 fstab ${D}/etc/fstab
+ #
+ # TODO: Check argument number?
+ #
+ filename=`basename $3`
+ dirname=`dirname $3`
+
+ for o in `echo ${OVERRIDES} | tr ':' ' '`; do
+ if [ -e $dirname/$o/$filename ]; then
+ bbnote $dirname/$o/$filename present, installing to $4
+ install $1 $2 $dirname/$o/$filename $4
+ return
+ fi
+ done
+# bbnote overrides specific file NOT present, trying default=$3...
+ if [ -e $3 ]; then
+ bbnote $3 present, installing to $4
+ install $1 $2 $3 $4
+ else
+ bbnote $3 NOT present, touching empty $4
+ touch $4
+ fi
+}
+
+create_cmdline_wrapper () {
+ # Create a wrapper script where commandline options are needed
+ #
+ # These are useful to work around relocation issues, by passing extra options
+ # to a program
+ #
+ # Usage: create_cmdline_wrapper FILENAME <extra-options>
+
+ cmd=$1
+ shift
+
+ echo "Generating wrapper script for $cmd"
+
+ mv $cmd $cmd.real
+ cmdname=`basename $cmd`
+ dirname=`dirname $cmd`
+ cmdoptions=$@
+ if [ "${base_prefix}" != "" ]; then
+ relpath=`python3 -c "import os; print(os.path.relpath('${D}${base_prefix}', '$dirname'))"`
+ cmdoptions=`echo $@ | sed -e "s:${base_prefix}:\\$realdir/$relpath:g"`
+ fi
+ cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+realdir=\`dirname \$realpath\`
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $cmdoptions "\$@"
+END
+ chmod +x $cmd
+}
+
+create_wrapper () {
+ # Create a wrapper script where extra environment variables are needed
+ #
+ # These are useful to work around relocation issues, by setting environment
+ # variables which point to paths in the filesystem.
+ #
+ # Usage: create_wrapper FILENAME [[VAR=VALUE]..]
+
+ cmd=$1
+ shift
+
+ echo "Generating wrapper script for $cmd"
+
+ mv $cmd $cmd.real
+ cmdname=`basename $cmd`
+ dirname=`dirname $cmd`
+ exportstring=$@
+ if [ "${base_prefix}" != "" ]; then
+ relpath=`python3 -c "import os; print(os.path.relpath('${D}${base_prefix}', '$dirname'))"`
+ exportstring=`echo $@ | sed -e "s:${base_prefix}:\\$realdir/$relpath:g"`
+ fi
+ cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+realdir=\`dirname \$realpath\`
+export $exportstring
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real "\$@"
+END
+ chmod +x $cmd
+}
+
+# Copy files/directories from $1 to $2 but using hardlinks
+# (preserve symlinks)
+hardlinkdir () {
+ from=$1
+ to=$2
+ (cd $from; find . -print0 | cpio --null -pdlu $to)
+}
+
+
+def check_app_exists(app, d):
+ app = d.expand(app).split()[0].strip()
+ path = d.getVar('PATH')
+ return bool(bb.utils.which(path, app))
+
+def explode_deps(s):
+ return bb.utils.explode_deps(s)
+
+def base_set_filespath(path, d):
+ filespath = []
+ extrapaths = (d.getVar("FILESEXTRAPATHS") or "")
+ # Remove default flag which was used for checking
+ extrapaths = extrapaths.replace("__default:", "")
+ # Don't prepend empty strings to the path list
+ if extrapaths != "":
+ path = extrapaths.split(":") + path
+ # The ":" ensures we have an 'empty' override
+ overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":")
+ overrides.reverse()
+ for o in overrides:
+ for p in path:
+ if p != "":
+ filespath.append(os.path.join(p, o))
+ return ":".join(filespath)
+
+def extend_variants(d, var, extend, delim=':'):
+ """Return a string of all bb class extend variants for the given extend"""
+ variants = []
+ whole = d.getVar(var) or ""
+ for ext in whole.split():
+ eext = ext.split(delim)
+ if len(eext) > 1 and eext[0] == extend:
+ variants.append(eext[1])
+ return " ".join(variants)
+
+def multilib_pkg_extend(d, pkg):
+ variants = (d.getVar("MULTILIB_VARIANTS") or "").split()
+ if not variants:
+ return pkg
+ pkgs = pkg
+ for v in variants:
+ pkgs = pkgs + " " + v + "-" + pkg
+ return pkgs
+
+def get_multilib_datastore(variant, d):
+ return oe.utils.get_multilib_datastore(variant, d)
+
+def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '):
+ """Return a string of all ${var} in all multilib tune configuration"""
+ values = []
+ value = d.getVar(var) or ""
+ if value != "":
+ if need_split:
+ for item in value.split(delim):
+ values.append(item)
+ else:
+ values.append(value)
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ localdata = get_multilib_datastore(item, d)
+ value = localdata.getVar(var) or ""
+ if value != "":
+ if need_split:
+ for item in value.split(delim):
+ values.append(item)
+ else:
+ values.append(value)
+ if unique:
+ #we do this to keep order as much as possible
+ ret = []
+ for value in values:
+ if not value in ret:
+ ret.append(value)
+ else:
+ ret = values
+ return " ".join(ret)
+
+def all_multilib_tune_list(vars, d):
+ """
+ Return a list of ${VAR} for each variable VAR in vars from each
+ multilib tune configuration.
+ Is safe to be called from a multilib recipe/context as it can
+ figure out the original tune and remove the multilib overrides.
+ """
+ values = {}
+ for v in vars:
+ values[v] = []
+
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False).split(":")
+ newoverrides = []
+ for o in overrides:
+ if not o.startswith("virtclass-multilib-"):
+ newoverrides.append(o)
+ localdata.setVar("OVERRIDES", ":".join(newoverrides))
+ localdata.setVar("MLPREFIX", "")
+ origdefault = localdata.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL")
+ if origdefault:
+ localdata.setVar("DEFAULTTUNE", origdefault)
+ values['ml'] = ['']
+ for v in vars:
+ values[v].append(localdata.getVar(v))
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ localdata = get_multilib_datastore(item, d)
+ values[v].append(localdata.getVar(v))
+ values['ml'].append(item)
+ return values
+all_multilib_tune_list[vardepsexclude] = "OVERRIDES"
+
+# If the user hasn't set up their name/email, set some defaults
+check_git_config() {
+ if ! git config user.email > /dev/null ; then
+ git config --local user.email "${PATCH_GIT_USER_EMAIL}"
+ fi
+ if ! git config user.name > /dev/null ; then
+ git config --local user.name "${PATCH_GIT_USER_NAME}"
+ fi
+}
diff --git a/poky/meta/classes/vala.bbclass b/poky/meta/classes/vala.bbclass
new file mode 100644
index 000000000..615eb379a
--- /dev/null
+++ b/poky/meta/classes/vala.bbclass
@@ -0,0 +1,24 @@
+# Everyone needs vala-native and targets need vala, too,
+# because that is where target builds look for .vapi files.
+#
+VALADEPENDS = ""
+VALADEPENDS_class-target = "vala"
+DEPENDS_append = " vala-native ${VALADEPENDS}"
+
+# Our patched version of Vala looks in STAGING_DATADIR for .vapi files
+export STAGING_DATADIR
+# Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+# Package additional files
+FILES_${PN}-dev += "\
+ ${datadir}/vala/vapi/*.vapi \
+ ${datadir}/vala/vapi/*.deps \
+ ${datadir}/gir-1.0 \
+"
+
+# Remove vapigen.m4 that is bundled with tarballs
+# because it does not yet have our cross-compile fixes
+do_configure_prepend() {
+ rm -f ${S}/m4/vapigen.m4
+}
diff --git a/poky/meta/classes/waf.bbclass b/poky/meta/classes/waf.bbclass
new file mode 100644
index 000000000..19e93761b
--- /dev/null
+++ b/poky/meta/classes/waf.bbclass
@@ -0,0 +1,37 @@
+# avoids build breaks when using no-static-libs.inc
+DISABLE_STATIC = ""
+
+EXTRA_OECONF_append = " ${PACKAGECONFIG_CONFARGS}"
+
+python waf_preconfigure() {
+ import subprocess
+ from distutils.version import StrictVersion
+ subsrcdir = d.getVar('S')
+ wafbin = os.path.join(subsrcdir, 'waf')
+ try:
+ result = subprocess.check_output([wafbin, '--version'], cwd=subsrcdir, stderr=subprocess.STDOUT)
+ version = result.decode('utf-8').split()[1]
+ if StrictVersion(version) >= StrictVersion("1.8.7"):
+ d.setVar("WAF_EXTRA_CONF", "--bindir=${bindir} --libdir=${libdir}")
+ except subprocess.CalledProcessError as e:
+ bb.warn("Unable to execute waf --version, exit code %d. Assuming waf version without bindir/libdir support." % e.returncode)
+ except FileNotFoundError:
+ bb.fatal("waf does not exist in %s" % subsrcdir)
+}
+
+do_configure[prefuncs] += "waf_preconfigure"
+
+waf_do_configure() {
+ ${S}/waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF}
+}
+
+do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
+waf_do_compile() {
+ ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
+}
+
+waf_do_install() {
+ ${S}/waf install --destdir=${D}
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/poky/meta/conf/abi_version.conf b/poky/meta/conf/abi_version.conf
new file mode 100644
index 000000000..496488010
--- /dev/null
+++ b/poky/meta/conf/abi_version.conf
@@ -0,0 +1,7 @@
+#
+# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in
+# an incompatible way. Such changes should usually be detailed in the commit
+# that breaks the format and have been previously discussed on the mailing list
+# with general agreement from the core team.
+#
+OELAYOUT_ABI = "12"
diff --git a/poky/meta/conf/bitbake.conf b/poky/meta/conf/bitbake.conf
new file mode 100644
index 000000000..a21b7282f
--- /dev/null
+++ b/poky/meta/conf/bitbake.conf
@@ -0,0 +1,886 @@
+##################################################################
+# Standard target filesystem paths.
+##################################################################
+#
+# If changing these values, beware that native/cross/nativesdk bbclass
+# files may also need changes to keep in sync.
+#
+
+# Used by multilib code to change the library paths
+baselib = "${BASELIB}"
+baselib[vardepvalue] = "${baselib}"
+BASELIB = "lib"
+BASELIB_powerpc64 = "lib64"
+
+# Path prefixes
+export base_prefix = ""
+export prefix = "/usr"
+export exec_prefix = "${prefix}"
+
+root_prefix = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '${exec_prefix}', '${base_prefix}', d)}"
+
+# Base paths
+export base_bindir = "${root_prefix}/bin"
+export base_sbindir = "${root_prefix}/sbin"
+export base_libdir = "${root_prefix}/${baselib}"
+export nonarch_base_libdir = "${root_prefix}/lib"
+
+# Architecture independent paths
+export sysconfdir = "${base_prefix}/etc"
+export servicedir = "${base_prefix}/srv"
+export sharedstatedir = "${base_prefix}/com"
+export localstatedir = "${base_prefix}/var"
+export datadir = "${prefix}/share"
+export infodir = "${datadir}/info"
+export mandir = "${datadir}/man"
+export docdir = "${datadir}/doc"
+export systemd_unitdir = "${nonarch_base_libdir}/systemd"
+export systemd_system_unitdir = "${nonarch_base_libdir}/systemd/system"
+export nonarch_libdir = "${exec_prefix}/lib"
+export systemd_user_unitdir = "${nonarch_libdir}/systemd/user"
+
+# Architecture dependent paths
+export bindir = "${exec_prefix}/bin"
+export sbindir = "${exec_prefix}/sbin"
+export libdir = "${exec_prefix}/${baselib}"
+export libexecdir = "${exec_prefix}/libexec"
+export includedir = "${exec_prefix}/include"
+export oldincludedir = "${exec_prefix}/include"
+localedir = "${libdir}/locale"
+
+# Linkage between native/cross/nativesdk layouts
+base_bindir_native = "/bin"
+base_sbindir_native = "/sbin"
+sysconfdir_native = "/etc"
+prefix_native = "/usr"
+bindir_native = "${prefix_native}/bin"
+sbindir_native = "${prefix_native}/sbin"
+includedir_native = "${prefix_native}/include"
+libdir_native = "${prefix_native}/lib"
+libexecdir_native = "${prefix_native}/libexec"
+base_libdir_native = "/lib"
+datadir_native = "${prefix_native}/share"
+bindir_cross = "/bin"
+bindir_crossscripts = "${bindir}/crossscripts"
+prefix_nativesdk = "/usr"
+bindir_nativesdk = "${prefix_nativesdk}/bin"
+sbindir_nativesdk = "${prefix_nativesdk}/sbin"
+base_bindir_nativesdk = "/bin"
+base_sbindir_nativesdk = "/sbin"
+includedir_nativesdk = "${prefix_nativesdk}/include"
+libdir_nativesdk = "${prefix_nativesdk}/lib"
+base_libdir_nativesdk = "/lib"
+localstatedir_nativesdk = "/var"
+
+#
+# Cross recipes need to know about the target layout
+# := is used carefully here
+#
+target_datadir := "${datadir}"
+# Used to find env/perl/python
+USRBINPATH = "${bindir}"
+USRBINPATH_class-native = "/usr/bin"
+USRBINPATH_class-nativesdk = "/usr/bin"
+
+# Root home directory
+ROOT_HOME ??= "/home/root"
+
+# If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log.
+# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
+VOLATILE_LOG_DIR ?= "yes"
+
+##################################################################
+# Architecture-dependent build variables.
+##################################################################
+
+# Immediate expansion since there is no point in reapeatedly calling
+# os.uname() throughout parsing
+BUILD_ARCH := "${@os.uname()[4]}"
+BUILD_OS := "${@os.uname()[0].lower()}"
+BUILD_VENDOR = ""
+BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+BUILD_PREFIX = ""
+BUILD_CC_ARCH = ""
+BUILD_LD_ARCH = ""
+BUILD_AS_ARCH = ""
+BUILD_EXEEXT = ""
+
+HOST_ARCH = "${TARGET_ARCH}"
+HOST_OS = "${TARGET_OS}"
+HOST_VENDOR = "${TARGET_VENDOR}"
+HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
+HOST_PREFIX = "${TARGET_PREFIX}"
+HOST_CC_ARCH = "${TARGET_CC_ARCH}"
+HOST_LD_ARCH = "${TARGET_LD_ARCH}"
+HOST_AS_ARCH = "${TARGET_AS_ARCH}"
+HOST_EXEEXT = ""
+
+TUNE_ARCH ??= "INVALID"
+TUNE_CCARGS ??= ""
+TUNE_CCARGS[vardepvalue] = "${TUNE_CCARGS}"
+TUNE_LDARGS ??= ""
+TUNE_ASARGS ??= ""
+TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}"
+LIBCEXTENSION ??= ""
+ABIEXTENSION ??= ""
+USE_NLS ??= "${@bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', 'yes', 'no', d)}"
+SDKUSE_NLS ??= "yes"
+
+TARGET_ARCH = "${TUNE_ARCH}"
+TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
+TARGET_VENDOR = "-oe"
+TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS'), ''][d.getVar('TARGET_OS') == ('' or 'custom')]}"
+TARGET_PREFIX = "${TARGET_SYS}-"
+TARGET_CC_ARCH = "${TUNE_CCARGS}"
+TARGET_LD_ARCH = "${TUNE_LDARGS}"
+TARGET_AS_ARCH = "${TUNE_ASARGS}"
+
+SDKMACHINE ??= "x86_64"
+SDK_OS = "${BUILD_OS}"
+SDK_VENDOR = "-oesdk"
+SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS'), ''][d.getVar('SDK_OS') == ('' or 'custom')]}"
+SDK_PREFIX = "${SDK_SYS}-"
+SDK_CC_ARCH = "${BUILD_CC_ARCH}"
+SDKPKGSUFFIX = "nativesdk"
+SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
+SDK_LD_ARCH = "${BUILD_LD_ARCH}"
+SDK_AS_ARCH = "${BUILD_AS_ARCH}"
+
+TUNE_PKGARCH ??= ""
+PACKAGE_ARCH ??= "${TUNE_PKGARCH}"
+MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH'), d.getVar('MACHINE')][bool(d.getVar('MACHINE'))].replace('-', '_')}"
+PACKAGE_EXTRA_ARCHS ??= "${PACKAGE_EXTRA_ARCHS_tune-${DEFAULTTUNE}}"
+PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
+# MACHINE_ARCH shouldn't be included here as a variable dependency
+# since machine specific packages are handled using multimachine
+PACKAGE_ARCHS[vardepsexclude] = "MACHINE_ARCH"
+
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+##################################################################
+# Date/time variables.
+##################################################################
+
+DATE := "${@time.strftime('%Y%m%d',time.gmtime())}"
+TIME := "${@time.strftime('%H%M%S',time.gmtime())}"
+DATETIME = "${DATE}${TIME}"
+
+##################################################################
+# Openembedded Software Prerequisites.
+##################################################################
+
+# python-native should be here but python relies on building
+# its own in staging
+ASSUME_PROVIDED = "\
+ bzip2-native \
+ chrpath-native \
+ file-native \
+ findutils-native \
+ gawk-native \
+ git-native \
+ grep-native \
+ diffstat-native \
+ patch-native \
+ libgcc-native \
+ hostperl-runtime-native \
+ hostpython-runtime-native \
+ tar-native \
+ virtual/libintl-native \
+ virtual/libiconv-native \
+ virtual/crypt-native \
+ texinfo-native \
+ bash-native \
+ sed-native \
+ wget-native \
+ "
+# gzip-native should be listed above?
+
+##################################################################
+# Package default variables.
+##################################################################
+
+PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
+PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
+PE = ""
+PF = "${PN}-${EXTENDPE}${PV}-${PR}"
+EXTENDPE = "${@['','${PE}_'][int(d.getVar('PE') or 0) > 0]}"
+P = "${PN}-${PV}"
+
+PRAUTO = ""
+EXTENDPRAUTO = "${@['.${PRAUTO}', ''][not d.getVar('PRAUTO')]}"
+PRAUTOINX = "${PF}"
+
+PKGV ?= "${PV}"
+PKGR ?= "${PR}${EXTENDPRAUTO}"
+PKGE ?= "${@['','${PE}'][int(d.getVar('PE') or 0) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE}:'][d.getVar('PKGE').strip() != '']}"
+EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
+
+# Base package name
+# Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
+# otherwise it is the same as PN and P
+SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-canadian"
+BPN = "${@oe.utils.prune_suffix(d.getVar('PN'), d.getVar('SPECIAL_PKGSUFFIX').split(), d)}"
+BP = "${BPN}-${PV}"
+
+# Package info.
+
+SECTION = "base"
+PRIORITY = "optional"
+SUMMARY ?= "${PN} version ${PV}-${PR}"
+DESCRIPTION ?= "${SUMMARY}."
+
+# The following two are commented out because they result in a recursive
+# definition of the variable in some corner cases. These are left in
+# to illustrate the intended behavior.
+#SUMMARY_${PN} ?= "${SUMMARY}"
+#DESCRIPTION_${PN} ?= "${DESCRIPTION}"
+
+SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files"
+DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION} \
+This package contains ELF symbols and related sources for debugging purposes."
+
+SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
+DESCRIPTION_${PN}-dev ?= "${DESCRIPTION} \
+This package contains symbolic links, header files, and \
+related items necessary for software development."
+
+SUMMARY_${PN}-staticdev ?= "${SUMMARY} - Development files (Static Libraries)"
+DESCRIPTION_${PN}-staticdev?= "${DESCRIPTION} \
+This package contains static libraries for software development."
+
+SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
+DESCRIPTION_${PN}-doc ?= "${DESCRIPTION} \
+This package contains documentation."
+
+LICENSE ??= "INVALID"
+MAINTAINER = "OE-Core Developers <openembedded-core@lists.openembedded.org>"
+HOMEPAGE = ""
+
+# Package dependencies and provides.
+
+# Ensure that -dev packages recommend the corresponding -dev packages of their
+# deps, and the same for -dbg.
+DEPCHAIN_PRE = ""
+DEPCHAIN_POST = "-dev -dbg"
+
+DEPENDS = ""
+RDEPENDS = ""
+PROVIDES = ""
+PROVIDES_prepend = "${PN} "
+RPROVIDES = ""
+
+MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
+
+SOLIBS = ".so.*"
+SOLIBS_darwin = ".dylib"
+
+SOLIBSDEV = ".so"
+# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
+# we can't make the symlinks end up in the -dev packages easily at this point. This hack
+# at least means builds aren't completely broken and symlinks don't take up much space.
+SOLIBSDEV_darwin = ".dylibbroken"
+
+PACKAGE_BEFORE_PN ?= ""
+PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
+PACKAGES_DYNAMIC = "^${PN}-locale-.*"
+FILES = ""
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
+ ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+ ${base_bindir}/* ${base_sbindir}/* \
+ ${base_libdir}/*${SOLIBS} \
+ ${base_prefix}/lib/udev ${prefix}/lib/udev \
+ ${base_libdir}/udev ${libdir}/udev \
+ ${datadir}/${BPN} ${libdir}/${BPN}/* \
+ ${datadir}/pixmaps ${datadir}/applications \
+ ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
+ ${libdir}/bonobo/servers"
+
+FILES_${PN}-bin = "${bindir}/* ${sbindir}/*"
+
+FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
+ ${datadir}/gnome/help"
+SECTION_${PN}-doc = "doc"
+
+FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
+ ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
+ ${datadir}/aclocal ${base_libdir}/*.o \
+ ${libdir}/${BPN}/*.la ${base_libdir}/*.la"
+SECTION_${PN}-dev = "devel"
+ALLOW_EMPTY_${PN}-dev = "1"
+RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
+
+FILES_${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
+SECTION_${PN}-staticdev = "devel"
+RDEPENDS_${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
+
+FILES_${PN}-dbg = "/usr/lib/debug /usr/src/debug"
+
+SECTION_${PN}-dbg = "devel"
+ALLOW_EMPTY_${PN}-dbg = "1"
+
+FILES_${PN}-locale = "${datadir}/locale"
+
+# File manifest
+
+FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}"
+# FILESPATH is set in base.bbclass
+#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
+# This default was only used for checking
+FILESEXTRAPATHS ?= "__default:"
+
+# The default list of fs-perms files to process. If the list is empty only
+# the builtin definitions will be used. Builtin definitions included:
+# base_prefix, prefix, exec_prefix, base_bindir, base_sbindir, base_libdir,
+# datadir, sysconfdir, servicedir, sharedstatedir, localstatedir, infodir,
+# mandir, docdir, bindir, sbindir, libexecdir, libdir, includedir and
+# oldincludedir
+FILESYSTEM_PERMS_TABLES ?= "${@'files/fs-perms.txt' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'files/fs-perms-persistent-log.txt'}"
+
+##################################################################
+# General work and output directories for the build system.
+##################################################################
+
+TMPDIR ?= "${TOPDIR}/tmp"
+CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE'))][bool(d.getVar('MACHINE'))]}${@['', '/' + str(d.getVar('SDKMACHINE'))][bool(d.getVar('SDKMACHINE'))]}"
+# The persistent cache should be shared by all builds
+PERSISTENT_DIR = "${TOPDIR}/cache"
+LOG_DIR = "${TMPDIR}/log"
+CO_DIR = "${DL_DIR}"
+CVSDIR = "${CO_DIR}/cvs"
+SVNDIR = "${CO_DIR}/svn"
+GITDIR = "${CO_DIR}/git2"
+BZRDIR = "${CO_DIR}/bzr"
+HGDIR = "${CO_DIR}/hg"
+
+STAMPS_DIR ?= "${TMPDIR}/stamps"
+STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
+BASE_WORKDIR ?= "${TMPDIR}/work"
+WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+T = "${WORKDIR}/temp"
+D = "${WORKDIR}/image"
+S = "${WORKDIR}/${BP}"
+B = "${S}"
+
+STAGING_DIR = "${TMPDIR}/sysroots"
+COMPONENTS_DIR = "${STAGING_DIR}-components"
+RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot"
+RECIPE_SYSROOT_NATIVE = "${WORKDIR}/recipe-sysroot-native"
+
+STAGING_DIR_NATIVE = "${RECIPE_SYSROOT_NATIVE}"
+STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
+STAGING_BINDIR_CROSS = "${STAGING_BINDIR}/crossscripts"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+STAGING_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${libdir_native}"
+STAGING_LIBEXECDIR_NATIVE = "${STAGING_DIR_NATIVE}${libexecdir_native}"
+STAGING_BASE_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${base_libdir_native}"
+STAGING_SBINDIR_NATIVE = "${STAGING_DIR_NATIVE}${sbindir_native}"
+STAGING_INCDIR_NATIVE = "${STAGING_DIR_NATIVE}${includedir_native}"
+STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
+STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
+
+STAGING_DIR_HOST = "${RECIPE_SYSROOT}"
+STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"
+STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}"
+STAGING_LIBEXECDIR = "${STAGING_DIR_HOST}${libexecdir}"
+STAGING_BASELIBDIR = "${STAGING_DIR_HOST}${base_libdir}"
+STAGING_INCDIR = "${STAGING_DIR_HOST}${includedir}"
+STAGING_DATADIR = "${STAGING_DIR_HOST}${datadir}"
+STAGING_EXECPREFIXDIR = "${STAGING_DIR_HOST}${exec_prefix}"
+STAGING_LOADER_DIR = "${STAGING_DIR_HOST}/loader"
+STAGING_FIRMWARE_DIR = "${STAGING_DIR_HOST}/firmware"
+
+STAGING_DIR_TARGET = "${RECIPE_SYSROOT}"
+
+# Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using
+# packaged staging and/or multimachine.
+DEPLOY_DIR ?= "${TMPDIR}/deploy"
+DEPLOY_DIR_TAR = "${DEPLOY_DIR}/tar"
+DEPLOY_DIR_IPK = "${DEPLOY_DIR}/ipk"
+DEPLOY_DIR_RPM = "${DEPLOY_DIR}/rpm"
+DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
+DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
+DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
+
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${MACHINE}"
+
+##################################################################
+# SDK variables.
+##################################################################
+
+SDK_NAME_PREFIX ?= "oecore"
+SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}"
+SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
+SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
+
+##################################################################
+# Kernel info.
+##################################################################
+
+OLDEST_KERNEL = "3.2.0"
+OLDEST_KERNEL_aarch64 = "3.14"
+OLDEST_KERNEL_nios2 = "3.19"
+OLDEST_KERNEL_riscv32 = "4.15"
+OLDEST_KERNEL_riscv64 = "4.15"
+
+# SDK_OLDEST_KERNEL can't be set using overrides since there are
+# none for the SDK architecture. Best to set it from a machine-sdk
+# include file if you need an SDK arch-specific value
+SDK_OLDEST_KERNEL = "3.2.0"
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+
+STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-source"
+STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts"
+
+##################################################################
+# Specific image creation and rootfs population info.
+##################################################################
+
+IMAGE_ROOTFS = "${WORKDIR}/rootfs"
+IMAGE_BASENAME = "${PN}"
+IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
+IMAGE_NAME[vardepsexclude] += "DATETIME"
+IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
+
+# This option allows for a percentage overage of the actual image size rather than a
+# fixed extra space, this is space needed for initial startup and basic operations.
+IMAGE_OVERHEAD_FACTOR ?= "1.3"
+# This option allows for adding additional space in K above and beyond what the
+# IMAGE_OVERHEAD_FACTOR might add. This space is for additional packages, user data, ...
+# To set a fixed size then overriding IMAGE_ROOTFS_SIZE with the max size one wants
+# should do the trick
+IMAGE_ROOTFS_EXTRA_SPACE ?= "0"
+
+EXTRA_IMAGEDEPENDS = ""
+
+##################################################################
+# Toolchain info.
+##################################################################
+
+PATH_prepend = "${COREBASE}/scripts:${STAGING_BINDIR_TOOLCHAIN}:${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}${base_bindir_native}:"
+export PATH
+
+##################################################################
+# Build utility info.
+##################################################################
+
+# Directory where host tools are copied
+HOSTTOOLS_DIR = "${TMPDIR}/hosttools"
+
+# Tools needed to run builds with OE-Core
+HOSTTOOLS += " \
+ [ ar as awk basename bash bzip2 cat chgrp chmod chown chrpath cmp comm cp cpio \
+ cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \
+ fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \
+ head hostname id install ld ldd ln ls make makeinfo md5sum mkdir mknod \
+ mktemp mv nm objcopy objdump od patch perl pod2man pr printf pwd python python2 \
+ python2.7 python3 ranlib readelf readlink rm rmdir rpcgen sed sh sha256sum \
+ sleep sort split stat strings strip tail tar tee test touch tr true uname \
+ uniq wc wget which xargs \
+"
+
+# Tools needed to run testimage runtime image testing
+HOSTTOOLS += "${@['', 'ip ping ps scp ssh stty'][bb.data.inherits_class('testimage', d)]}"
+
+# Link to these if present
+HOSTTOOLS_NONFATAL += "aws ccache gcc-ar gpg ld.bfd ld.gold nc sftp socat ssh sudo"
+
+# Temporary add few more detected in bitbake world
+HOSTTOOLS_NONFATAL += "join nl size yes zcat"
+
+# Used by bzr fetcher
+HOSTTOOLS_NONFATAL += "bzr"
+
+# Used by ssh fetcher
+HOSTTOOLS_NONFATAL += "scp"
+
+CCACHE ??= ""
+# ccache < 3.1.10 will create CCACHE_DIR on startup even if disabled, and
+# autogen sets HOME=/dev/null so in certain situations builds can fail.
+# Explicitly export CCACHE_DIR until we can assume ccache >3.1.10 on the host.
+export CCACHE_DIR ??= "${@os.getenv('HOME')}/.ccache"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
+
+export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
+export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
+export CCLD = "${CC}"
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as ${HOST_AS_ARCH}"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export STRIP = "${HOST_PREFIX}strip"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+export STRINGS = "${HOST_PREFIX}strings"
+export NM = "${HOST_PREFIX}nm"
+export READELF = "${HOST_PREFIX}readelf"
+PYTHON = "${@sys.executable}"
+
+export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
+export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"
+export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
+export BUILD_CPP = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH} -E"
+export BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
+export BUILD_CCLD = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
+export BUILD_AR = "${BUILD_PREFIX}ar"
+export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
+export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
+export BUILD_STRIP = "${BUILD_PREFIX}strip"
+export BUILD_NM = "${BUILD_PREFIX}nm"
+
+export MAKE = "make"
+EXTRA_OEMAKE = ""
+EXTRA_OECONF = ""
+export LC_ALL = "en_US.UTF-8"
+export TZ = 'UTC'
+
+##################################################################
+# Patch handling.
+##################################################################
+PATCHTOOL = "quilt"
+PATCHRESOLVE = "noop"
+
+##################################################################
+# Build flags and options.
+##################################################################
+
+export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
+BUILDSDK_CPPFLAGS = ""
+export CPPFLAGS = "${TARGET_CPPFLAGS}"
+export TARGET_CPPFLAGS = ""
+
+export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
+BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION}"
+export CFLAGS = "${TARGET_CFLAGS}"
+export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
+
+export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
+BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
+export CXXFLAGS = "${TARGET_CXXFLAGS}"
+export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
+
+export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
+ -L${STAGING_BASE_LIBDIR_NATIVE} \
+ -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
+ -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
+ -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
+ -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
+ -Wl,-O1"
+
+BUILDSDK_LDFLAGS = "-Wl,-O1"
+
+LINKER_HASH_STYLE ??= "gnu"
+# mips does not support GNU hash style therefore we override
+LINKER_HASH_STYLE_mipsarch = "sysv"
+
+TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE') != 'gnu']}"
+
+export LDFLAGS = "${TARGET_LDFLAGS}"
+export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
+#export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
+# -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
+# -Wl,-O1"
+
+# Pass parallel make options to the compile task
+EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
+PARALLEL_MAKEINST ??= "${PARALLEL_MAKE}"
+# Pass parallel make options to the install task
+EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} "
+
+##################################################################
+# Optimization flags.
+##################################################################
+# Beware: applied last to first
+DEBUG_PREFIX_MAP ?= "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -fdebug-prefix-map=${STAGING_DIR_HOST}= \
+ -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+"
+DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
+
+# Disabled until the option works properly -feliminate-dwarf2-dups
+FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
+DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
+SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD') == '1'])}"
+SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
+BUILD_OPTIMIZATION = "-O2 -pipe"
+
+##################################################################
+# Settings used by bitbake-layers.
+##################################################################
+BBLAYERS_LAYERINDEX_URL ??= "http://layers.openembedded.org/layerindex/"
+BBLAYERS_FETCH_DIR ??= "${COREBASE}"
+
+##################################################################
+# Download locations and utilities.
+##################################################################
+
+APACHE_MIRROR = "http://archive.apache.org/dist"
+DEBIAN_MIRROR = "http://ftp.debian.org/debian/pool"
+GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
+GNOME_GIT = "git://git.gnome.org"
+GNOME_MIRROR = "http://ftp.gnome.org/pub/GNOME/sources"
+GNU_MIRROR = "http://ftp.gnu.org/gnu"
+GNUPG_MIRROR = "https://www.gnupg.org/ftp/gcrypt"
+GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
+KERNELORG_MIRROR = "http://cdn.kernel.org/pub"
+SOURCEFORGE_MIRROR = "http://downloads.sourceforge.net"
+XLIBS_MIRROR = "http://xlibs.freedesktop.org/release"
+XORG_MIRROR = "http://xorg.freedesktop.org/releases"
+SAVANNAH_GNU_MIRROR = "http://download.savannah.gnu.org/releases"
+SAVANNAH_NONGNU_MIRROR = "http://download.savannah.nongnu.org/releases"
+CPAN_MIRROR = "http://search.cpan.org/CPAN"
+
+SRC_URI[vardepsexclude] += "\
+ APACHE_MIRROR \
+ CPAN_MIRROR \
+ DEBIAN_MIRROR \
+ GENTOO_MIRROR \
+ GNOME_GIT \
+ GNOME_MIRROR \
+ GNU_MIRROR \
+ GNUPG_MIRROR \
+ GPE_MIRROR \
+ KERNELORG_MIRROR \
+ SAVANNAH_GNU_MIRROR \
+ SAVANNAH_NONGNU_MIRROR \
+ SOURCEFORGE_MIRROR \
+ XLIBS_MIRROR \
+ XORG_MIRROR \
+"
+
+# You can use the mirror of your country to get faster downloads by putting
+# export DEBIAN_MIRROR = "http://ftp.de.debian.org/debian/pool"
+# into your local.conf
+
+FETCHCMD_svn = "/usr/bin/env svn --non-interactive --trust-server-cert"
+FETCHCMD_cvs = "/usr/bin/env cvs"
+FETCHCMD_wget = "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
+FETCHCMD_bzr = "/usr/bin/env bzr"
+FETCHCMD_hg = "/usr/bin/env hg"
+
+SRCDATE = "${DATE}"
+SRCREV ??= "INVALID"
+AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+AUTOREV[vardepvalue] = "${SRCPV}"
+# Set Dynamically in base.bbclass
+# SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
+
+SRC_URI = ""
+
+# Use pseudo as the fakeroot implementation
+PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
+PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${PSEUDO_SYSROOT}"
+PSEUDO_SYSROOT = "${COMPONENTS_DIR}/${BUILD_ARCH}/pseudo-native"
+export PSEUDO_DISABLED = "1"
+#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
+#export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
+#export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
+FAKEROOTBASEENV = "PSEUDO_BINDIR=${PSEUDO_SYSROOT}${bindir_native} PSEUDO_LIBDIR=${PSEUDO_SYSROOT}${prefix_native}/lib/pseudo/lib PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_DISABLED=1"
+FAKEROOTCMD = "${PSEUDO_SYSROOT}${bindir_native}/pseudo"
+FAKEROOTENV = "PSEUDO_PREFIX=${PSEUDO_SYSROOT}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
+FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
+FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
+PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
+
+##################################################################
+# Not sure about the rest of this yet.
+##################################################################
+
+# Pre-build configuration output
+BUILDCFG_HEADER = "Build Configuration:"
+BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
+BUILDCFG_VARS[type] = "list"
+BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
+BUILDCFG_NEEDEDVARS[type] = "list"
+
+# Other
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_PATH = "${PKG_CONFIG_DIR}:${STAGING_DATADIR}/pkgconfig"
+export PKG_CONFIG_LIBDIR = "${PKG_CONFIG_DIR}"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+export PKG_CONFIG_DISABLE_UNINSTALLED = "yes"
+export PKG_CONFIG_SYSTEM_LIBRARY_PATH = "${base_libdir}:${libdir}"
+export PKG_CONFIG_SYSTEM_INCLUDE_PATH = "${includedir}"
+
+###
+### Config file processing
+###
+
+# An empty distro leads to :: entries in OVERRIDES and FILEOVERRIDES which
+# is a bad idea. Setting a dummy value is better than a ton of anonymous python.
+DISTRO ??= "nodistro"
+DISTRO_NAME ??= "OpenEmbedded"
+# Overrides are processed left to right, so the ones that are named later take precedence.
+# You generally want them to go from least to most specific.
+#
+# This means that an envionment variable named '<foo>_arm' overrides an
+# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
+# An environment variable '<foo>_qemuarm' overrides '<foo>' and overrides
+# '<foo>_arm' when ${MACHINE} is 'qemuarm'.
+# If you use combination ie '<foo>_qemuarm_arm', then '<foo>_qemuarm_arm' will override
+# '<foo>_qemuarm' and then '<foo>' will be overriden with that value from '<foo>_qemuarm'.
+# And finally '<foo>_forcevariable' overrides any standard variable, with the highest priority.
+#
+# This works for functions as well, they are really just environment variables.
+# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
+OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
+CLASSOVERRIDE ?= "class-target"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO') or ''}"
+MACHINEOVERRIDES ?= "${MACHINE}"
+
+FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
+
+##################################################################
+# Include the rest of the config files.
+##################################################################
+
+require conf/abi_version.conf
+include conf/site.conf
+include conf/auto.conf
+include conf/local.conf
+require conf/multiconfig/${BB_CURRENT_MC}.conf
+include conf/machine/${MACHINE}.conf
+include conf/machine-sdk/${SDKMACHINE}.conf
+include conf/distro/${DISTRO}.conf
+include conf/distro/defaultsetup.conf
+include conf/documentation.conf
+include conf/licenses.conf
+require conf/sanity.conf
+
+##################################################################
+# Weak variables (usually to retain backwards compatibility)
+##################################################################
+
+DL_DIR ?= "${TOPDIR}/downloads"
+SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+IMAGE_FSTYPES ?= "tar.gz"
+IMAGE_FSTYPES_DEBUGFS ?= "tar.gz"
+
+INITRAMFS_FSTYPES ?= "cpio.gz"
+# The maximum size in Kbytes for the generated initramfs image size.
+# Usually, it should be less than 1/2 of ram size, or you may fail to
+# boot it.
+INITRAMFS_MAXSIZE ??= "131072"
+
+DEFAULT_TASK_PROVIDER ?= "packagegroup-base"
+MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}"
+
+# The size in Kbytes for the generated image if it is larger than
+# the required size (du -ks IMAGE_ROOTFS * IMAGE_OVERHEAD_FACTOR),
+# and no effect if less than it.
+IMAGE_ROOTFS_SIZE ??= "65536"
+
+# Forcefully set CACHE now so future changes to things like
+# MACHINE don't change the path to the cache
+CACHE := "${CACHE}"
+
+# Default to setting automatically based on cpu count
+BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+
+# Default to setting automatically based on cpu count
+PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
+
+##################################################################
+# Magic Cookie for SANITY CHECK
+##################################################################
+OES_BITBAKE_CONF = "1"
+
+##################################################################
+# Machine properties and packagegroup-base stuff
+##################################################################
+
+MACHINE_FEATURES ?= ""
+DISTRO_FEATURES ?= ""
+
+DISTRO_EXTRA_RDEPENDS ?= ""
+DISTRO_EXTRA_RRECOMMENDS ?= ""
+MACHINE_EXTRA_RDEPENDS ?= ""
+MACHINE_EXTRA_RRECOMMENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+EXTRA_IMAGE_FEATURES ??= ""
+IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
+
+# Native distro features (will always be used for -native, even if they
+# are not enabled for target)
+DISTRO_FEATURES_NATIVE ?= "x11 ipv6 xattr"
+DISTRO_FEATURES_NATIVESDK ?= "x11 libc-charsets libc-locales libc-locale-code"
+
+# Normally target distro features will not be applied to native builds:
+# Native distro features on this list will use the target feature value
+DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
+DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
+
+DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data ldconfig"
+MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
+
+COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
+COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
+
+SERIAL_CONSOLE ??= ""
+SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE').replace(' ', ';')}"
+
+NO_RECOMMENDATIONS ?= ""
+BAD_RECOMMENDATIONS ?= ""
+
+# Make sure MACHINE isn't exported
+# (breaks binutils at least)
+MACHINE[unexport] = "1"
+
+# Make sure TARGET_ARCH isn't exported
+# (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
+# in them, undocumented)
+TARGET_ARCH[unexport] = "1"
+
+# Make sure DISTRO isn't exported
+# (breaks sysvinit at least)
+DISTRO[unexport] = "1"
+
+# Make sure SHELL isn't exported
+# (can break any number of things if the user's shell isn't POSIX-compliant,
+# including the flock command). The user's shell shouldn't affect our builds.
+SHELL[unexport] = "1"
+
+# Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
+TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH').replace("_", "-")}"
+
+# Complete output from bitbake
+BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
+
+# Setup our default hash policy
+BB_SIGNATURE_HANDLER ?= "OEBasicHash"
+BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DIR \
+ SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+ USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
+ STAMPS_DIR PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
+ CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_NOHASHDIR LICENSE_PATH SDKPKGSUFFIX \
+ WARN_QA ERROR_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH \
+ BB_WORKERCONTEXT BB_LIMITEDDEPS extend_recipe_sysroot DEPLOY_DIR"
+BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
+ SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
+ PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
+ GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
+ HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
+ BB_SETSCENE_ENFORCE BB_CMDLINE BB_SERVER_TIMEOUT"
+BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
+ lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
+ file-checksums python func task export unexport noexec nostamp dirs cleandirs \
+ sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
+ recrdeptask nodeprrecs stamp-extra-info sstate-outputdirs filename lineno \
+ progress"
+
+MLPREFIX ??= ""
+MULTILIB_VARIANTS ??= ""
diff --git a/poky/meta/conf/conf-notes.txt b/poky/meta/conf/conf-notes.txt
new file mode 100644
index 000000000..f1a4f4da1
--- /dev/null
+++ b/poky/meta/conf/conf-notes.txt
@@ -0,0 +1,12 @@
+
+### Shell environment set up for builds. ###
+
+You can now run 'bitbake <target>'
+
+Common targets are:
+ core-image-minimal
+ core-image-sato
+ meta-toolchain
+ meta-ide-support
+
+You can also run generated qemu images with a command like 'runqemu qemux86'
diff --git a/poky/meta/conf/distro/defaultsetup.conf b/poky/meta/conf/distro/defaultsetup.conf
new file mode 100644
index 000000000..ca2f9178d
--- /dev/null
+++ b/poky/meta/conf/distro/defaultsetup.conf
@@ -0,0 +1,24 @@
+include conf/distro/include/default-providers.inc
+include conf/distro/include/default-versions.inc
+include conf/distro/include/default-distrovars.inc
+include conf/distro/include/world-broken.inc
+
+TCMODE ?= "default"
+require conf/distro/include/tcmode-${TCMODE}.inc
+
+TCLIBC ?= "glibc"
+require conf/distro/include/tclibc-${TCLIBC}.inc
+
+require conf/distro/include/uninative-flags.inc
+
+# Allow single libc distros to disable this code
+TCLIBCAPPEND ?= "-${TCLIBC}"
+TMPDIR .= "${TCLIBCAPPEND}"
+
+CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE'))][bool(d.getVar('MACHINE'))]}${@['', '/' + str(d.getVar('SDKMACHINE'))][bool(d.getVar('SDKMACHINE'))]}"
+
+USER_CLASSES ?= ""
+PACKAGE_CLASSES ?= "package_ipk"
+INHERIT_BLACKLIST = "blacklist"
+INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
diff --git a/poky/meta/conf/distro/include/as-needed.inc b/poky/meta/conf/distro/include/as-needed.inc
new file mode 100644
index 000000000..6a8ad9d62
--- /dev/null
+++ b/poky/meta/conf/distro/include/as-needed.inc
@@ -0,0 +1,13 @@
+
+ASNEEDED = "-Wl,--as-needed"
+
+ASNEEDED_pn-babeltrace = ""
+ASNEEDED_pn-console-tools = ""
+ASNEEDED_pn-distcc = ""
+ASNEEDED_pn-openobex = ""
+ASNEEDED_pn-icu = ""
+ASNEEDED_pn-pciutils = ""
+ASNEEDED_pn-puzzles = ""
+ASNEEDED_pn-rpm = ""
+
+TARGET_LDFLAGS += "${ASNEEDED}"
diff --git a/poky/meta/conf/distro/include/default-distrovars.inc b/poky/meta/conf/distro/include/default-distrovars.inc
new file mode 100644
index 000000000..9620ad48d
--- /dev/null
+++ b/poky/meta/conf/distro/include/default-distrovars.inc
@@ -0,0 +1,55 @@
+QA_LOGFILE = "${TMPDIR}/qa.log"
+
+OEINCLUDELOGS ?= "yes"
+KERNEL_CONSOLE ?= "ttyS0"
+KEEPUIMAGE ??= "yes"
+
+IMAGE_LINGUAS ?= "en-us en-gb"
+ENABLE_BINARY_LOCALE_GENERATION ?= "1"
+LOCALE_UTF8_ONLY ?= "0"
+LOCALE_UTF8_IS_DEFAULT ?= "1"
+LOCALE_UTF8_IS_DEFAULT_class-nativesdk = "0"
+
+DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
+DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \
+ libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \
+ libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code \
+ libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \
+ libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \
+ libc-posix-wchar-io"
+DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
+DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
+DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC}"
+
+IMAGE_FEATURES ?= ""
+
+WHITELIST_GPL-3.0 ?= ""
+LGPLv2_WHITELIST_GPL-3.0 ?= ""
+
+COMMERCIAL_AUDIO_PLUGINS ?= ""
+# COMMERCIAL_AUDIO_PLUGINS ?= "gst-plugins-ugly-mad gst-plugins-ugly-mpegaudioparse"
+COMMERCIAL_VIDEO_PLUGINS ?= ""
+# COMMERCIAL_VIDEO_PLUGINS ?= "gst-plugins-ugly-mpeg2dec gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse"
+# Set of common licenses used for license.bbclass
+COMMON_LICENSE_DIR ??= "${COREBASE}/meta/files/common-licenses"
+
+BB_GENERATE_MIRROR_TARBALLS ??= "0"
+
+NO32LIBS ??= "1"
+
+# Default to emitting logfiles if a build fails.
+BBINCLUDELOGS ??= "yes"
+SDK_VERSION ??= "nodistro.0"
+DISTRO_VERSION ??= "nodistro.0"
+
+# Missing checksums should raise an error
+BB_STRICT_CHECKSUM = "1"
+
+GTK2DISTROFEATURES = "directfb x11"
+GTK3DISTROFEATURES = "x11 wayland"
+
+ARCH_DEFAULT_KERNELIMAGETYPE = "zImage"
+ARCH_DEFAULT_KERNELIMAGETYPE_x86 = "bzImage"
+ARCH_DEFAULT_KERNELIMAGETYPE_x86-64 = "bzImage"
+KERNEL_IMAGETYPE ??= "${ARCH_DEFAULT_KERNELIMAGETYPE}"
+KERNEL_IMAGETYPES ??= "${KERNEL_IMAGETYPE}"
diff --git a/poky/meta/conf/distro/include/default-providers.inc b/poky/meta/conf/distro/include/default-providers.inc
new file mode 100644
index 000000000..e65c1ed32
--- /dev/null
+++ b/poky/meta/conf/distro/include/default-providers.inc
@@ -0,0 +1,56 @@
+#
+# Default virtual providers
+#
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/egl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+PREFERRED_PROVIDER_virtual/mesa ?= "mesa"
+PREFERRED_PROVIDER_virtual/update-alternatives ?= "opkg-utils"
+PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-utils-native"
+PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
+PREFERRED_PROVIDER_virtual/base-utils ?= "busybox"
+PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
+PREFERRED_PROVIDER_virtual/make ?= "make"
+PREFERRED_PROVIDER_virtual/make-native ?= "make-native"
+
+#
+# Default virtual runtime providers
+#
+VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-opkg"
+VIRTUAL-RUNTIME_apm ?= "apm"
+VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
+VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
+VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
+VIRTUAL-RUNTIME_base-utils ?= "busybox"
+VIRTUAL-RUNTIME_base-utils-hwclock ?= "busybox-hwclock"
+
+#
+# Default recipe providers
+#
+PREFERRED_PROVIDER_dbus-glib ?= "dbus-glib"
+PREFERRED_PROVIDER_dbus-glib-native ?= "dbus-glib-native"
+PREFERRED_PROVIDER_gdk-pixbuf ?= "gdk-pixbuf"
+PREFERRED_PROVIDER_libgcc ?= "libgcc"
+PREFERRED_PROVIDER_nativesdk-libgcc ?= "nativesdk-libgcc"
+PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers"
+PREFERRED_PROVIDER_nativesdk-linux-libc-headers ?= "nativesdk-linux-libc-headers"
+PREFERRED_PROVIDER_matchbox-panel ?= "matchbox-panel-2"
+PREFERRED_PROVIDER_opkg ?= "opkg"
+PREFERRED_PROVIDER_opkg-native ?= "opkg-native"
+PREFERRED_PROVIDER_nativesdk-opkg ?= "nativesdk-opkg"
+PREFERRED_PROVIDER_console-tools ?= "kbd"
+PREFERRED_PROVIDER_udev ?= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','eudev',d)}"
+PREFERRED_RPROVIDER_bluez-hcidump ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez-hcidump',d)}"
+# Alternative is ltp-ddt in meta-oe: meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.4.bb
+PREFERRED_PROVIDER_ltp ?= "ltp"
+PREFERRED_PROVIDER_getopt ?= "util-linux-getopt"
+PREFERRED_PROVIDER_openssl ?= "openssl"
+PREFERRED_PROVIDER_openssl-native ?= "openssl-native"
+PREFERRED_PROVIDER_nativesdk-openssl ?= "nativesdk-openssl"
+PREFERRED_PROVIDER_pkgconfig ?= "pkgconfig"
+PREFERRED_PROVIDER_nativesdk-pkgconfig ?= "nativesdk-pkgconfig"
+PREFERRED_PROVIDER_pkgconfig-native ?= "pkgconfig-native"
+PREFERRED_RPROVIDER_initd-functions ?= "initscripts"
diff --git a/poky/meta/conf/distro/include/default-versions.inc b/poky/meta/conf/distro/include/default-versions.inc
new file mode 100644
index 000000000..868073843
--- /dev/null
+++ b/poky/meta/conf/distro/include/default-versions.inc
@@ -0,0 +1,7 @@
+#
+# Default preferred versions
+#
+
+PREFERRED_VERSION_openssl = "1.0.%"
+PREFERRED_VERSION_openssl-native = "1.0.%"
+PREFERRED_VERSION_nativesdk-openssl = "1.0.%"
diff --git a/poky/meta/conf/distro/include/distro_alias.inc b/poky/meta/conf/distro/include/distro_alias.inc
new file mode 100644
index 000000000..13c7e652b
--- /dev/null
+++ b/poky/meta/conf/distro/include/distro_alias.inc
@@ -0,0 +1,451 @@
+#
+# This is a list for tracking status of package relative to Major
+# distributions such as Fedora, Ubuntu, Debian, ... The package
+# name is the major distribution equivalent to the name used in oe-core
+#
+# The format is as a bitbake variable override for each recipe
+#
+# DISTRO_PN_ALIAS_pn-<recipe name> = "Distro1=<pkgname> Distro2=<pkgname>"
+#
+# Please keep this list in alphabetical order.
+#
+DISTRO_PN_ALIAS_pn-alsa-state = "OE-Core"
+DISTRO_PN_ALIAS_pn-alsa-utils-alsaconf = "OE-Core"
+DISTRO_PN_ALIAS_pn-alsa-utils-scripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-atk = "Fedora=atk OpenSuSE=atk"
+DISTRO_PN_ALIAS_pn-avahi-ui = "Ubuntu=avahi-discover Debian=avahi-discover"
+DISTRO_PN_ALIAS_pn-babeltrace = "OSPDT"
+DISTRO_PN_ALIAS_pn-bigreqsproto = "Meego=xorg-x11-proto-bigreqsproto"
+DISTRO_PN_ALIAS_pn-bjam = "OpenSuSE=boost-jam Debina=bjam"
+DISTRO_PN_ALIAS_pn-blktool = "Debian=blktool Mandriva=blktool"
+DISTRO_PN_ALIAS_pn-bluez5 = "Fedora=bluez Opensuse=bluez"
+DISTRO_PN_ALIAS_pn-bootchart2 = "Fedora=bootchart2 Opensuse=bootchart"
+DISTRO_PN_ALIAS_pn-btrfs-tools = "Debian=btrfs-tools Fedora=btrfs-progs"
+DISTRO_PN_ALIAS_pn-build-appliance-image = "OSPDT"
+DISTRO_PN_ALIAS_pn-build-compare = "Opensuse=build-compare Fedora=build-compare"
+DISTRO_PN_ALIAS_pn-builder = "OE-Core"
+DISTRO_PN_ALIAS_pn-buildtools-tarball = "OE-Core"
+DISTRO_PN_ALIAS_pn-calibrateproto = "OSPDT upstream=http://cgit.freedesktop.org/xorg/proto/calibrateproto"
+DISTRO_PN_ALIAS_pn-cdrtools = "OpenSUSE=cdrtools OSPDT"
+DISTRO_PN_ALIAS_pn-chkconfig-alternatives = "Mandriva=chkconfig Debian=chkconfig"
+DISTRO_PN_ALIAS_pn-clutter = "Fedora=clutter OpenSuse=clutter Ubuntu=clutter-1.0 Mandriva=clutter Debian=clutter"
+DISTRO_PN_ALIAS_pn-clutter-1.8 = "Fedora=clutter OpenSuse=clutter Ubuntu=clutter-1.0 Mandriva=clutter Debian=clutter"
+DISTRO_PN_ALIAS_pn-clutter-gst-1.0 = "Debian=clutter-gst Ubuntu=clutter-gst Fedora=clutter-gst"
+DISTRO_PN_ALIAS_pn-clutter-gst-1.8 = "Fedora=clutter-gst Debian=libclutter-gst"
+DISTRO_PN_ALIAS_pn-clutter-gst-3.0 = "Ubuntu=libclutter-gst Debian=libclutter-gst"
+DISTRO_PN_ALIAS_pn-clutter-gtk-1.0 = "Debian=clutter-gtk Ubuntu=clutter-gtk Fedora=clutter-gtk"
+DISTRO_PN_ALIAS_pn-clutter-gtk-1.8 = "Fedora=clutter-gtk OpenSuSE=clutter-gtk Ubuntu=clutter-gtk-0.10 Mandriva=clutter-gtk Debian=clutter-gtk"
+DISTRO_PN_ALIAS_pn-cogl-1.0 = "Debian=cogl Ubuntu=cogl Fedora=cogl"
+DISTRO_PN_ALIAS_pn-cogl = "Fedora=cogl OpenSuse=cogl Ubuntu=cogl Mandriva=cogl Debian=cogl"
+DISTRO_PN_ALIAS_pn-compositeproto = "Meego=xorg-x11-proto-compositeproto"
+DISTRO_PN_ALIAS_pn-connman = "Meego=connman"
+DISTRO_PN_ALIAS_pn-connman-conf = "OE-Core"
+DISTRO_PN_ALIAS_pn-connman-gnome = "Intel"
+DISTRO_PN_ALIAS_pn-console-tools = "Debian=console-tools Ubuntu=console-tools"
+DISTRO_PN_ALIAS_pn-core-image-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-clutter = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-full-cmdline = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-kernel-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-initramfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-mtdutils = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-rt = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-rt-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-testmaster = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-testmaster-initramfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-weston = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-createrepo-c = "Fedora=createrepo_c Clear=createrepo_c"
+DISTRO_PN_ALIAS_pn-cross-localedef = "OSPDT"
+DISTRO_PN_ALIAS_pn-cryptodev-linux = "OE-Core"
+DISTRO_PN_ALIAS_pn-cryptodev-module = "OE-Core"
+DISTRO_PN_ALIAS_pn-cryptodev-tests = "OE-Core"
+DISTRO_PN_ALIAS_pn-cwautomacros = "OSPDT upstream=http://cwautomacros.berlios.de/"
+DISTRO_PN_ALIAS_pn-damageproto = "Meego=xorg-x11-proto-damageproto"
+DISTRO_PN_ALIAS_pn-db = "Debian=db5.1 Ubuntu=db5.1"
+DISTRO_PN_ALIAS_pn-dbus-test = "Fedora=dbus Ubuntu=dbus"
+DISTRO_PN_ALIAS_pn-dbus-wait = "OpenedHand"
+DISTRO_PN_ALIAS_pn-depmodwrapper-cross = "OE-Core"
+DISTRO_PN_ALIAS_pn-distcc = "Debian=distcc Fedora=distcc"
+DISTRO_PN_ALIAS_pn-distcc-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-dmxproto = "Meego=xorg-x11-proto-dmxproto Ubuntu=x11proto-dmx Debian=x11proto-dmx"
+DISTRO_PN_ALIAS_pn-docbook-dsssl-stylesheets = "Fedora=docbook-style-dsssl Ubuntu=docbook-dsssl"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-3.1 = "Fedora=docbook-dtds Mandriva=docbook-dtd31-sgml"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-4.1 = "Fedora=docbook-dtds Mandriva=docbook-dtd41-sgml"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-4.5 = "Fedora=docbook-dtds Mandriva=docbook-dtd42-sgml"
+DISTRO_PN_ALIAS_pn-docbook-xml-dtd4 = "Ubuntu=docbook-xml Fedora=docbook-dtds"
+DISTRO_PN_ALIAS_pn-docbook-xml-dtd4-native = "Ubuntu=docbook-xml Fedora=docbook-dtds"
+DISTRO_PN_ALIAS_pn-docbook-xsl-stylesheets = "Fedora=docbook-xsl-stylesheets Opensuse=docbook-xsl-stylesheets"
+DISTRO_PN_ALIAS_pn-dri2proto = "Meego=xorg-x11-proto-dri2proto"
+DISTRO_PN_ALIAS_pn-dri3proto = "Fedora=dri3proto Opensuse=dri3proto-devel"
+DISTRO_PN_ALIAS_pn-dropbear = "Debian=dropbear Ubuntu=dropbear"
+DISTRO_PN_ALIAS_pn-dtc = "Fedora=dtc Ubuntu=dtc"
+DISTRO_PN_ALIAS_pn-eee-acpi-scripts = "Debian=eeepc-acpi-scripts Ubuntu=eeepc-acpi-scripts"
+DISTRO_PN_ALIAS_pn-eglinfo-fb = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglinfo-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-encodings = "Ubuntu=xfonts-encodings Mandriva=x11-font-encodings Debian=xfonts-encodings"
+DISTRO_PN_ALIAS_pn-fixesproto = "Meego=xorg-x11-proto-fixesproto"
+DISTRO_PN_ALIAS_pn-font-alias = "Fedora=xorg-x11-fonts-base Mandriva=x11-font-alias Meego=xorg-x11-fonts"
+DISTRO_PN_ALIAS_pn-fontcacheproto = "Meego=xorg-x11-proto-fontcacheproto"
+DISTRO_PN_ALIAS_pn-fontsproto = "Meego=xorg-x11-proto-fontsproto"
+DISTRO_PN_ALIAS_pn-font-util = "Meego=xorg-x11-font-utils Fedora=xorg-x11-font-utils Ubuntu=xfonts-utils Mandriva=x11-font-util Debian=xfonts-utils"
+DISTRO_PN_ALIAS_pn-formfactor = "OE-Core"
+DISTRO_PN_ALIAS_pn-fstests = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gcc-cross-initial = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-cross-initial-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-crosssdk-initial = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-crosssdk-initial-x86_64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-gccmakedep = "Mandriva=gccmakedep Ubuntu=xutils-dev"
+DISTRO_PN_ALIAS_pn-gcc-runtime = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gcc-sanitizers = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gcc-source = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gconf-dbus = "Meego=GConf-dbus"
+DISTRO_PN_ALIAS_pn-gdk-pixbuf = "Debian=libgdk-pixbuf2.0 Fedora=gdk-pixbuf"
+DISTRO_PN_ALIAS_pn-gdk-pixbuf-csource = "Debian=libgdk-pixbuf2.0-0 Fedora=gdk-pixbuf2"
+DISTRO_PN_ALIAS_pn-gettext-minimal = "Debian=gettext Fedora=gettext"
+DISTRO_PN_ALIAS_pn-glib-2.0 = "Meego=glib2 Fedora=glib2 OpenSuSE=glib2 Ubuntu=glib2.0 Mandriva=glib2.0 Debian=glib2.0"
+DISTRO_PN_ALIAS_pn-glibc-locale = "OpenSuSE=glibc-locale Fedora=glibc-devel"
+DISTRO_PN_ALIAS_pn-glibc-mtrace = "Fedora=glibc-utils Ubuntu=libc-dev-bin"
+DISTRO_PN_ALIAS_pn-glibc-scripts = "Fedora=glibc Ubuntu=libc-bin"
+DISTRO_PN_ALIAS_pn-glproto = "Meego=xorg-x11-proto-glproto"
+DISTRO_PN_ALIAS_pn-gnome-desktop-testing = "Debian=gnome-desktop-testing Fedora=gnome-desktop-testing"
+DISTRO_PN_ALIAS_pn-gnu-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gptfdisk = "Fedora=gdisk Ubuntu=gdisk"
+DISTRO_PN_ALIAS_pn-grub-efi = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-grub-efi-i586 = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-grub-efi-x86-64 = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-gst-player = "Ubuntu=gst-player Fedora=gstreamer-player"
+DISTRO_PN_ALIAS_pn-gst-plugin-bluetooth = "Ubuntu=libgstreamer-plugins-base Fedora=gstreamer-plugins-base"
+DISTRO_PN_ALIAS_pn-gstreamer1.0 = "Debian=gstreamer1.0 Ubuntu=gstreamer1.0"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-meta-base = "Meego=gstreamer Fedora=gstreamer OpenSuSE=gstreamer Ubuntu=gstreamer0.10"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-bad = "Debian=gstreamer1.0-plugins-bad Ubuntu=gstreamer1.0-plugins-bad"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-base = "Debian=gstreamer1.0-plugins-base Ubuntu=gstreamer1.0-plugins-base"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-good = "Debian=gstreamer1.0-plugins-good Ubuntu=gstreamer1.0-plugins-bad"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-rtsp-server = "Ubuntu=gstreamer0.10-rtsp Fedora=gstreamer-rtsp"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-vaapi = "Fedora=gstreamer1-vaapi Debian=gstreamer-vaapi Clear=gstreamer-vaapi"
+DISTRO_PN_ALIAS_pn-gtk+ = "Meego=gtk2 Fedora=gtk2 OpenSuSE=gtk2 Ubuntu=gtk+2.0 Mandriva=gtk+2.0 Debian=gtk+2.0"
+DISTRO_PN_ALIAS_pn-gtk+3 = "Ubuntu=gtk+3.0 Debian=gtk+3.0 Fedora=gtk3"
+DISTRO_PN_ALIAS_pn-gtk-doc = "Fedora=gtk-doc Ubuntu=gtk-doc"
+DISTRO_PN_ALIAS_pn-gtk-engines = "Fedora=gtk2-engines OpenSuSE=gtk2-engines Ubuntu=gtk2-engines Mandriva=gtk-engines2 Debian=gtk2-engines"
+DISTRO_PN_ALIAS_pn-gtk-sato-engine = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gtk-icon-utils-native = "OSPDT"
+DISTRO_PN_ALIAS_pn-systemd-boot = "Ubuntu=systemd-boot Fedora=systemd-boot"
+DISTRO_PN_ALIAS_pn-hello-mod = "OE-Core"
+DISTRO_PN_ALIAS_pn-hwlatdetect = "OSPDT"
+DISTRO_PN_ALIAS_pn-icecc-create-env = "OE-Core"
+DISTRO_PN_ALIAS_pn-init-ifupdown = "Debian=ifupdown Ubuntu=ifupdown"
+DISTRO_PN_ALIAS_pn-initramfs-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-framework = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-efi = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-efi-testfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-testfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-initscripts = "Fedora=initscripts Mandravia=initscripts"
+DISTRO_PN_ALIAS_pn-inputproto = "Meego=xorg-x11-proto-inputproto"
+DISTRO_PN_ALIAS_pn-iproute2 = "OSPDT"
+DISTRO_PN_ALIAS_pn-jpeg = "OpenSuSE=libjpeg Ubuntu=libjpeg62"
+DISTRO_PN_ALIAS_pn-kbproto = "Meego=xorg-x11-proto-kbproto Ubuntu=x11proto-kb-dev Debian=x11proto-kb-dev"
+DISTRO_PN_ALIAS_pn-kernel-devsrc = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-kernelshark = "Mandriva=kernelshark Ubuntu=kernelshark"
+DISTRO_PN_ALIAS_pn-kern-tools-native = "Windriver"
+DISTRO_PN_ALIAS_pn-keymaps = "OE-Core"
+DISTRO_PN_ALIAS_pn-kf = "OSPDT"
+DISTRO_PN_ALIAS_pn-lame = "Debian=lame Ubuntu=lame"
+DISTRO_PN_ALIAS_pn-ldconfig-native = "Ubuntu=libc-bin Fedora=glibc"
+DISTRO_PN_ALIAS_pn-liba52 = "Mandriva=a52dec Debian=a52dec"
+DISTRO_PN_ALIAS_pn-libacpi = "Ubuntu=libacpi Mandriva=libacpi"
+DISTRO_PN_ALIAS_pn-libatomics-ops = "Meego=libatomic-ops Debian=libatomic-ops Ubuntu=libatomic-ops OpenSuSE=libatomic-ops Mandriva=libatomic-ops"
+DISTRO_PN_ALIAS_pn-libcgroup = "Ubuntu=libcgroup1 Debian=libcgroup1"
+DISTRO_PN_ALIAS_pn-libcheck = "Ubuntu=check Fedora=check OpenSuSE=check"
+DISTRO_PN_ALIAS_pn-libclass-isa-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libdumpvalue-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libenv-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-liberation-fonts = "Ubuntu=fonts-liberation Fedora=liberation-fonts-ttf"
+DISTRO_PN_ALIAS_pn-libfakekey = "Meego1.0=libfakekey Debian=libfakekey"
+DISTRO_PN_ALIAS_pn-libfile-checktree-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libfm-extra = "Opensuse=libfm-extra4 Ubuntu=libfm-extra4"
+DISTRO_PN_ALIAS_pn-libgcc = "Debian=libgcc4 Ubuntu=libgcc1 OpenSuSE=libgcc46"
+DISTRO_PN_ALIAS_pn-libgdbus = "Intel"
+DISTRO_PN_ALIAS_pn-libglade = "Meego=libglade2 Fedora=libglade2 OpenSuSE=libglade2 Ubuntu=libglade2 Mandriva=libglade2.0 Debian=libglade2"
+DISTRO_PN_ALIAS_pn-libglu = "Debian=libglu Ubuntu=libglu Opensuse=mesa-libglu"
+DISTRO_PN_ALIAS_pn-libgu = "OpenSuSE=glu OSPDT"
+DISTRO_PN_ALIAS_pn-libi18n-collate-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libical = "Ubuntu=libical Fedora=libical"
+DISTRO_PN_ALIAS_pn-libiconv = "Fedora=mingw-libiconv Opensuse=cross-mingw-libiconv"
+DISTRO_PN_ALIAS_pn-libinput = "Ubuntu=libinput0 Fedora=libinput0"
+DISTRO_PN_ALIAS_pn-libjson = "Ubuntu=libjson0-dev Debian=libjson0-dev"
+DISTRO_PN_ALIAS_pn-libksba = "Fedora=libksba Debian=libksba8 Ubuntu=libksba"
+DISTRO_PN_ALIAS_pn-libmatchbox = "Ubuntu=libmatchbox Fedora=libmatchbox"
+DISTRO_PN_ALIAS_pn-libmpc = "Fedora=libmpc OpenSuse=libmpc2"
+DISTRO_PN_ALIAS_pn-libnewt = "Debian=libnewt0.52 Fedora=newt"
+DISTRO_PN_ALIAS_pn-libnewt-python = "Ubuntu=python-newt Fedora=newt-python"
+DISTRO_PN_ALIAS_pn-libnl = "Mandriva=libnl Fedora=libnl"
+DISTRO_PN_ALIAS_pn-libnss-mdns = "Meego=nss-mdns OpenSuSE=nss-mdns Ubuntu=nss-mdns Mandriva=nss_mdns Debian=nss-mdns"
+DISTRO_PN_ALIAS_pn-libomxil = "OSPDT upstream=http://omxil.sourceforge.net/"
+DISTRO_PN_ALIAS_pn-libowl = "Debian=owl OpenedHand"
+DISTRO_PN_ALIAS_pn-libpam = "Meego=pam Fedora=pam OpenSuSE=pam Ubuntu=pam Mandriva=pam Debian=pam"
+DISTRO_PN_ALIAS_pn-libpcre = "Mandriva=libpcre0 Fedora=pcre"
+DISTRO_PN_ALIAS_pn-libpcre2 = "Fedora=pcre2 Debian=pcre2 Clear=pcre2"
+DISTRO_PN_ALIAS_pn-libpng12 = "Debian=libpng12-0 Fedora=libpng"
+DISTRO_PN_ALIAS_pn-libpod-plainer-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libsamplerate0 = "Meego=libsamplerate Fedora=libsamplerate OpenSuSE=libsamplerate Ubuntu=libsamplerate Mandriva=libsamplerate Debian=libsamplerate"
+DISTRO_PN_ALIAS_pn-libsdl = "Fedora=SDL Opensuse=SDL"
+DISTRO_PN_ALIAS_pn-libsdl2 = "Fedora=sdl2 Opensuse=libsdl2 Ubuntu=libsdl2 Debian=libsdl2"
+DISTRO_PN_ALIAS_pn-libsndfile1 = "Meego=libsndfile Fedora=libsndfile OpenSuSE=libsndfile Ubuntu=libsndfile Mandriva=libsndfile Debian=libsndfile"
+DISTRO_PN_ALIAS_pn-libsoup-2.4 = "Meego=libsoup Fedora=libsoup OpenSuSE=libsoup Ubuntu=libsoup2.4 Mandriva=libsoup Debian=libsoup2.4"
+DISTRO_PN_ALIAS_pn-libtelepathy = "Debian=libtelepathy2 Ubuntu=libtelepathy2"
+DISTRO_PN_ALIAS_pn-libtimedate-perl = "Debian=libtimedate-perl Ubuntu=libtimedate-perl"
+DISTRO_PN_ALIAS_pn-liburcu = "Fedora=userspace-rcu Ubuntu=liburcu0"
+DISTRO_PN_ALIAS_pn-libusb1 = "Debian=libusb-1.0-0 Fedora=libusb1"
+DISTRO_PN_ALIAS_pn-libusb-compat = "OSPDT"
+DISTRO_PN_ALIAS_pn-libx11 = "Debian=libx11-6 Fedora=libX11 Ubuntu=libx11-6 OpenSuSE=xorg-x11-libX11"
+DISTRO_PN_ALIAS_pn-libxcalibrate = "OSPDT upstream=http://cgit.freedesktop.org/xorg/lib/libXCalibrate/"
+DISTRO_PN_ALIAS_pn-libxfont2 = "Fedora=libXfont2 Clear=libXfont2"
+DISTRO_PN_ALIAS_pn-libxft = "Mandriva=libxft Debian=libxft2 Ubuntu=libxft2"
+DISTRO_PN_ALIAS_pn-libxi = "Ubuntu=libxi Fedora=libXi"
+DISTRO_PN_ALIAS_pn-libxkbcommon = "Fedora=libxkbcommon Debian=libxkbcommon"
+DISTRO_PN_ALIAS_pn-libxscrnsaver = "Fedora=libXScrnSaver Ubuntu=libxss1 Mandriva=libxscrnsaver"
+DISTRO_PN_ALIAS_pn-libxxf86misc = "Mandriva=libxxf86misc Fedora=libXxf86misc"
+DISTRO_PN_ALIAS_pn-linux-dummy = "Intel"
+DISTRO_PN_ALIAS_pn-linux-firmware = "Fedora=linux-firmware Ubuntu=linux-firmware"
+DISTRO_PN_ALIAS_pn-linux-libc-headers = "Debian=linux-kernel-headers Ubuntu=linux-kernel-headers"
+DISTRO_PN_ALIAS_pn-linux-libc-headers-yocto = "Debian=linux-kernel-headers Ubuntu=linux-kernel-headers"
+DISTRO_PN_ALIAS_pn-linux-yocto = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-linux-yocto-rt = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-linux-yocto-tiny = "OSPDT"
+DISTRO_PN_ALIAS_pn-lsbinitscripts = "Windriver"
+DISTRO_PN_ALIAS_pn-lsbtest = "Windriver"
+DISTRO_PN_ALIAS_pn-ltp = "Mandriva=ltp Ubuntu=ltp"
+DISTRO_PN_ALIAS_pn-lttng-modules = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lttng-tools = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lttng-ust = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lz4 = "Debian=lz4 Fedora=lz4"
+DISTRO_PN_ALIAS_pn-lzo = "Debian=liblzo Ubuntu=liblzo Fedora=lzp"
+DISTRO_PN_ALIAS_pn-mailx = "Debian=bsd-mailx Ubuntu=bsd-mailx"
+DISTRO_PN_ALIAS_pn-makedepend = "Mandriva=makedepend Ubuntu=xutils-dev"
+DISTRO_PN_ALIAS_pn-makedevs = "OE-Core"
+DISTRO_PN_ALIAS_pn-matchbox-config-gtk = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-desktop = "Mandriva=matchbox-desktop Ubuntu=matchbox-desktop"
+DISTRO_PN_ALIAS_pn-matchbox-desktop-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-keyboard = "Debian=matchbox-keyboard Fedora=matchbox-keyboard"
+DISTRO_PN_ALIAS_pn-matchbox-panel-2 = "Debian=matchbox-panel Mandriva=matchbox-panel Ubuntu=matchbox-panel"
+DISTRO_PN_ALIAS_pn-matchbox-session = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-session-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-terminal = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-theme-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-themes-extra = "Ubuntu=matchbox-themes-extra Mandriva=matchbox-themes-extra"
+DISTRO_PN_ALIAS_pn-matchbox-themes-gtk = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-wm = "OpenedHand"
+DISTRO_PN_ALIAS_pn-menu-cache = "OSPDT"
+DISTRO_PN_ALIAS_pn-mesa = "Fedora=mesa Ubuntu=libgl1-mesa-dri"
+DISTRO_PN_ALIAS_pn-mesa-gl = "Fedora=mesa Ubuntu=libgl1-mesa-dri"
+DISTRO_PN_ALIAS_pn-meta-environment-extsdk-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-qemux86-64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-ide-support = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-toolchain = "OE-Core"
+DISTRO_PN_ALIAS_pn-mini-x-session = "OSPDT"
+DISTRO_PN_ALIAS_pn-mkelfimage = "Ubuntu=mkelfimage Fedora=mkelfimage"
+DISTRO_PN_ALIAS_pn-mkfontdir = "Mandriva=mkfontdir Ubuntu=xfonts-utils Fedora=xorg-x11-font-utils"
+DISTRO_PN_ALIAS_pn-mkfontscale = "Mandriva=mkfontscale Ubuntu=xfonts-utils Fedora=xorg-x11-font-utils"
+DISTRO_PN_ALIAS_pn-mktemp = "Mandriva=mktemp Fedora=mktemp"
+DISTRO_PN_ALIAS_pn-mmc-utils = "OE-Core"
+DISTRO_PN_ALIAS_pn-modutils-initscripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-mtd-utils = "Debian=mtd-utils Ubuntu=mtd-utils"
+DISTRO_PN_ALIAS_pn-mx-1.0 = "Ubuntu=mx Debian=mx Fedora=mx"
+DISTRO_PN_ALIAS_pn-neard = "Intel"
+DISTRO_PN_ALIAS_pn-neon = "Fedora=neon Opensuse=neon"
+DISTRO_PN_ALIAS_pn-network-suspend-scripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-nfs-export-root = "OpenedHand"
+DISTRO_PN_ALIAS_pn-npth = "OSPDT"
+DISTRO_PN_ALIAS_pn-nss-myhostname = "Meego=nss-mdns OpenSuSE=nss-mdns Ubuntu=nss-mdns Mandriva=nss_mdns Debian=nss-mdns"
+DISTRO_PN_ALIAS_pn-ofono = "Debian=ofono Ubuntu=ofono"
+DISTRO_PN_ALIAS_pn-oh-puzzles = "OpenedHand"
+DISTRO_PN_ALIAS_pn-opkg = "OSPDT upstream=http://svn.openmoko.org/trunk/src/tar"
+DISTRO_PN_ALIAS_pn-opkg-arch-config = "OE-Core"
+DISTRO_PN_ALIAS_pn-opkg-collateral = "OE-Core"
+DISTRO_PN_ALIAS_pn-opkg-keyrings = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-opkg-nogpg = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-opkg-utils = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-os-release = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-buildessential = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-clutter = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-device-devel = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-eclipse-debug = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-full-cmdline = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-lsb = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-nfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-ssh-dropbear = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-ssh-openssh = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-standalone-sdk-target = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-debug = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-profile = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-testapps = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-mini = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-sato = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-xserver = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-qemux86-64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-sdk-host = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-self-hosted = "OE-Core"
+DISTRO_PN_ALIAS_pn-package-index = "OE-Core"
+DISTRO_PN_ALIAS_pn-patchelf = "Opensuse=patchelf Fedora=patchelf"
+DISTRO_PN_ALIAS_pn-perf = "OSPDT"
+DISTRO_PN_ALIAS_pn-piglit = "OE-Core"
+DISTRO_PN_ALIAS_pn-pkgconfig = "Ubuntu=pkg-config Fedora=pkgconfig"
+DISTRO_PN_ALIAS_pn-pointercal-xinput = "OE-Core"
+DISTRO_PN_ALIAS_pn-pong-clock = "OpenedHand"
+DISTRO_PN_ALIAS_pn-portmap = "Debian=rpcbind Fedora=rpcbind"
+DISTRO_PN_ALIAS_pn-powertop = "Meego=powertop Fedora=powertop Debian=powertop OpenSuSE=powertop Mandriva=powertop"
+DISTRO_PN_ALIAS_pn-ppp-dialin = "OE-Core"
+DISTRO_PN_ALIAS_pn-presentproto = "Debian=x11proto-present-dev Fedora=xorg-x11-proto-devel"
+DISTRO_PN_ALIAS_pn-pseudo = "Windriver"
+DISTRO_PN_ALIAS_pn-psplash = "OpenedHand"
+DISTRO_PN_ALIAS_pn-ptest-runner = "OE-Core"
+DISTRO_PN_ALIAS_pn-pulseaudio-client-conf-sato = "OE-Core"
+DISTRO_PN_ALIAS_pn-puzzles = "Debian=sgt-puzzles Fedora=puzzles"
+DISTRO_PN_ALIAS_pn-python3 = "Fedora=python3 Debian=python3.2"
+DISTRO_PN_ALIAS_pn-python3-distribute = "Debian=python3-setuptools Fedora=python3-setuptools"
+DISTRO_PN_ALIAS_pn-python3-iniparse = "Fedora=python-iniparse Debian=python-iniparse"
+DISTRO_PN_ALIAS_pn-python3-pip = "OpenSuSE=python3-pip Debian=python3-pip"
+DISTRO_PN_ALIAS_pn-python3-pycurl = "Fedora=python-pycurl Debian=pycurl"
+DISTRO_PN_ALIAS_pn-python3-pygpgme = "Fedora=python-pygpgme Debian=pygpgme"
+DISTRO_PN_ALIAS_pn-python3-setuptools = "OpenSuSE=python3-setuptools Debian=python3-setuptools"
+DISTRO_PN_ALIAS_pn-python-dbus = "Ubuntu=python-dbus Debian=python-dbus Mandriva=python-dbus"
+DISTRO_PN_ALIAS_pn-python-distribute = "Opensuse=python-setuptools Fedora=python-setuptools"
+DISTRO_PN_ALIAS_pn-python-git = "Debian=python-git Fedora=GitPython"
+DISTRO_PN_ALIAS_pn-python-mako = "Fedora=python-mako Opensuse=python-Mako"
+DISTRO_PN_ALIAS_pn-python-pycairo = "Meego=pycairo Fedora=pycairo Ubuntu=pycairo Debian=pycairo"
+DISTRO_PN_ALIAS_pn-python-pygobject = "Meego=pygobject2 Fedora=pygobject2 Ubuntu=pygobject Debian=pygobject"
+DISTRO_PN_ALIAS_pn-python-scons = "Fedora=scons OpenSuSE=scons Ubuntu=scons Mandriva=scons Debian=scons"
+DISTRO_PN_ALIAS_pn-python-setuptools = "Mandriva=python-setup OpenSuSE=python-setup-git"
+DISTRO_PN_ALIAS_pn-python-smartpm = "Debian=smart OpenSuSE=smart"
+DISTRO_PN_ALIAS_pn-qemu-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemugl = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemu-helper = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemuwrapper-cross = "OE-Core"
+DISTRO_PN_ALIAS_pn-randrproto = "Meego=xorg-x11-proto-randrproto"
+DISTRO_PN_ALIAS_pn-readline = "Fedora=readline Debian=readline-common"
+DISTRO_PN_ALIAS_pn-recordproto = "Meego=xorg-x11-proto-recordproto"
+DISTRO_PN_ALIAS_pn-remake = "Mandriva=remake Debian=remake"
+DISTRO_PN_ALIAS_pn-renderproto = "Meego=xorg-x11-proto-renderproto"
+DISTRO_PN_ALIAS_pn-resourceproto = "Meego=xorg-x11-proto-resourceproto"
+DISTRO_PN_ALIAS_pn-rgb = "Fedora=xorg-X11-server-utils Debian=x11-xserver-utils"
+DISTRO_PN_ALIAS_pn-rpmresolve = "OSPDT"
+DISTRO_PN_ALIAS_pn-rt-tests = "Debian=rt-tests Ubuntu=rt-tests"
+DISTRO_PN_ALIAS_pn-run-postinsts = "OE-Core"
+DISTRO_PN_ALIAS_pn-sato-icon-theme = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sato-screenshot = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sbc = "Fedora=sbc Debian=libsbc1"
+DISTRO_PN_ALIAS_pn-screenshot = "OpenedHand"
+DISTRO_PN_ALIAS_pn-scrnsaverproto = "Meego=xorg-x11-proto-scrnsaverproto Ubuntu=x11proto-scrnsaver-dev Debian=x11proto-scrnsaver-dev"
+DISTRO_PN_ALIAS_pn-settings-daemon = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sgml-common = "OpenSuSE=sgml-common Fedora=sgml-common"
+DISTRO_PN_ALIAS_pn-sgmlspl = "Debian=sgmlspl Ubuntu=sgmlspl"
+DISTRO_PN_ALIAS_pn-shadow-securetty = "Ubuntu=shadow Fedora=shadow"
+DISTRO_PN_ALIAS_pn-shadow-sysroot = "Ubuntu=shadow Fedora=shadow"
+DISTRO_PN_ALIAS_pn-shutdown-desktop = "OpenedHand"
+DISTRO_PN_ALIAS_pn-speexdsp = "Ubuntu=libspeexdsp1 Fedora=speexdsp"
+DISTRO_PN_ALIAS_pn-stat = "Debian=coreutils Fedora=coreutils"
+DISTRO_PN_ALIAS_pn-stress = "Debian=stress Fedora=stress"
+DISTRO_PN_ALIAS_pn-sysklogd = "Debian=sysklogd Mandriva=sysklogd"
+DISTRO_PN_ALIAS_pn-sysprof = "Fedora=sysprof Debian=sysprof"
+DISTRO_PN_ALIAS_pn-systemd-compat-units = "Fedora=systemd Ubuntu=systemd"
+DISTRO_PN_ALIAS_pn-systemd-systemctl = "OE-Core"
+DISTRO_PN_ALIAS_pn-systemd-systemdctl = "Fedora=systemd Ubuntu=systemd"
+DISTRO_PN_ALIAS_pn-systemtap-uprobes = "Ubuntu=systemtap Debian=systemtap"
+DISTRO_PN_ALIAS_pn-sysvinit-inittab = "OE-Core"
+DISTRO_PN_ALIAS_pn-tar-replacement = "Fedora=tar Ubuntu=tar"
+DISTRO_PN_ALIAS_pn-tcf-agent = "Windriver upstream=http://www.eclipse.org/dsdp/tm/"
+DISTRO_PN_ALIAS_pn-texinfo-dummy-native = "OE-Core"
+DISTRO_PN_ALIAS_pn-tiny-init = "OSPDT"
+DISTRO_PN_ALIAS_pn-trace-cmd = "Mandriva=trace-cmd Ubuntu=trace-cmd"
+DISTRO_PN_ALIAS_pn-tremor = "OSPDT upstream=http://www.xiph.org/vorbis/"
+DISTRO_PN_ALIAS_pn-ttf-bitstream-vera = "Debian=ttf-bitstream-vera Ubuntu=ttf-bitstream-vera"
+DISTRO_PN_ALIAS_pn-tzcode = "OSPDT"
+DISTRO_PN_ALIAS_pn-u-boot-fw-utils = "Ubuntu=u-boot-tools Debian=u-boot-tools"
+DISTRO_PN_ALIAS_pn-u-boot-mkimage = "Ubuntu=uboot-mkimage Debian=uboot-mkimage"
+DISTRO_PN_ALIAS_pn-udev = "Mandriva=udev Fedora=udev"
+DISTRO_PN_ALIAS_pn-udev-extraconf = "OE-Core"
+DISTRO_PN_ALIAS_pn-unfs3 = "Debian=unfs3 Fedora=unfs3"
+DISTRO_PN_ALIAS_pn-unfs-server = "OE-Core"
+DISTRO_PN_ALIAS_pn-uninative-tarball = "OE-Core"
+DISTRO_PN_ALIAS_pn-update-alternatives-dpkg = "Opensuse=update-alternatives Mandriva=update-alternatives"
+DISTRO_PN_ALIAS_pn-update-rc.d = "OE-Core"
+DISTRO_PN_ALIAS_pn-usbinit = "OE-Core"
+DISTRO_PN_ALIAS_pn-util-macros = "Meego=xorg-x11-util-macros Fedora=xorg-x11-util-macros Mandriva=x11-util-macros"
+DISTRO_PN_ALIAS_pn-v86d = "Debian=v86d Ubuntu=v86d"
+DISTRO_PN_ALIAS_pn-videoproto = "Meego=xorg-x11-proto-videoproto"
+DISTRO_PN_ALIAS_pn-waffle = "OE-Core"
+DISTRO_PN_ALIAS_pn-watchdog = "Debian=watchdog Ubuntu=watchdog Mandriva=watchdog"
+DISTRO_PN_ALIAS_pn-webkitgtk = "Fedora=webkitgtk Ubuntu=libwebkit"
+DISTRO_PN_ALIAS_pn-weston = "Fedora=weston OpenSuSE=weston"
+DISTRO_PN_ALIAS_pn-weston-init = "OE-Core"
+DISTRO_PN_ALIAS_pn-which = "Mandriva=which Fedora=which"
+DISTRO_PN_ALIAS_pn-wpa-supplicant = "Meego=wpa_supplicant Fedora=wpa_supplicant OpenSuSE=wpa_supplicant Ubuntu=wpasupplicant Mandriva=wpa_supplicant Debian=wpasupplicant"
+DISTRO_PN_ALIAS_pn-x11perf = "Fedora=xorg-x11-apps Ubuntu=x11-apps"
+DISTRO_PN_ALIAS_pn-xcb-util-image = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcb-util-keysyms = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcb-util-wm = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcmiscproto = "Meego=xorg-x11-proto-xcmiscproto"
+DISTRO_PN_ALIAS_pn-xcursor-transparent-theme = "OpenedHand"
+DISTRO_PN_ALIAS_pn-xdpyinfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xev = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xextproto = "Meego=xorg-x11-proto-xextproto"
+DISTRO_PN_ALIAS_pn-xeyes = "Ubuntu=x11-apps Fedora=xorg-x11-apps"
+DISTRO_PN_ALIAS_pn-xf86bigfontproto = "Meego=xorg-x11-proto-xf86bigfontproto"
+DISTRO_PN_ALIAS_pn-xf86dgaproto = "Meego=xorg-x11-proto-xf86dgaproto"
+DISTRO_PN_ALIAS_pn-xf86driproto = "Meego=xorg-x11-proto-xf86driproto"
+DISTRO_PN_ALIAS_pn-xf86-input-evdev = "Ubuntu=xserver-xorg-input-evdev Mandriva=x11-driver-input-evdev Debian=xserver-xorg-input-evdev Fedora=xorg-x11-drv-evdev Meego=xorg-x11-drv-evdev"
+DISTRO_PN_ALIAS_pn-xf86-input-keyboard = "Meego=xorg-x11-drv-keyboard Fedora=xorg-x11-drv-keyboard Mandriva=x11-driver-input-keyboard Debian=xserver-xorg-input-keyboard"
+DISTRO_PN_ALIAS_pn-xf86-input-mouse = "Ubuntu=xserver-xorg-input-mouse Mandriva=x11-driver-input-mouse Debian=xserver-xorg-input-mouse"
+DISTRO_PN_ALIAS_pn-xf86-input-synaptics = "Meego=xorg-x11-drv-synaptics Fedora=xorg-x11-drv-synaptics Ubuntu=xserver-xorg-input-synaptics Mandriva=x11-driver-input-synaptics Debian=xfree86-driver-synaptics"
+DISTRO_PN_ALIAS_pn-xf86-input-vmmouse = "Fedora=xorg-x11-drv-vmmouse Ubuntu=xserver-xorg-input-vmmouse Mandriva=x11-driver-input-vmmouse Debian=xserver-xorg-input-vmmouse"
+DISTRO_PN_ALIAS_pn-xf86miscproto = "Meego=xorg-x11-proto-xf86miscproto"
+DISTRO_PN_ALIAS_pn-xf86-video-cirrus = "Opensuse=xf86-video-cirrus Debian=xserver-xorg-video-cirrus"
+DISTRO_PN_ALIAS_pn-xf86-video-fbdev = "Ubuntu=xserver-xorg-video-fbdev Debian=xserver-xorg-video-fbdev"
+DISTRO_PN_ALIAS_pn-xf86-video-intel = "Debian=xserver-xorg-video-intel Fedora=xorg-x11-drv-intel Mandriva=x11-driver-video-intel Meego=xorg-x11-drv-intel Ubuntu=xserver-xorg-video-intel"
+DISTRO_PN_ALIAS_pn-xf86-video-modesetting = "Debian=xserver-xorg-video-modesetting Fedora=xf86-video-modesetting"
+DISTRO_PN_ALIAS_pn-xf86-video-omap = "Ubuntu=xf86-video-omap Debian=xf86-video-omap"
+DISTRO_PN_ALIAS_pn-xf86-video-omapfb = "OSPDT"
+DISTRO_PN_ALIAS_pn-xf86-video-vesa = "Debian=xserver-xorg-video-vesa Fedora=xorg-x11-drv-vesa Mandriva=x11-driver-video-vesa Ubuntu=xserver-xorg-video-vesa"
+DISTRO_PN_ALIAS_pn-xf86-video-vmware = "Debian=xserver-xorg-video-vmware Fedora=xorg-x11-drv-vmware Mandriva=x11-driver-video-vmware Ubuntu=xserver-xorg-video-vmware"
+DISTRO_PN_ALIAS_pn-xf86vidmodeproto = "Meego=xorg-x11-proto-xf86vidmodeproto Ubuntu=x11proto-xf86vidmode Debian=x11proto-xf86vidmode"
+DISTRO_PN_ALIAS_pn-xhost = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xineramaproto = "Meego=xorg-x11-proto-xineramaproto Ubuntu=x11proto-xinerama Debian=x11proto-xinerama"
+DISTRO_PN_ALIAS_pn-xinput-calibrator = "Fedora=xinput-calibrator Mandravia=xinput-calibrator Ubuntu=xinput-calibrator"
+DISTRO_PN_ALIAS_pn-xkbcomp = "Ubuntu=x11-xkb-utils Fedora=xorg-x11-xkb-utils"
+DISTRO_PN_ALIAS_pn-xmodmap = "Meego=xorg-x11-utils-xmodmap Fedora=xorg-x11-server-utils Ubuntu=x11-xserver-utils"
+DISTRO_PN_ALIAS_pn-xorg-minimal-fonts = "Ubuntu=xfonts-base Fedora=xorg-x11-fonts-base"
+DISTRO_PN_ALIAS_pn-xprop = "Meego=xorg-x11-utils-xprop Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xproto = "Meego=xorg-x11-proto-xproto Fedora=xorg-x11-proto-devel Ubuntu=x11proto-core-dev Debian=x11proto-core-dev Opensuse=xorg-x11-proto-devel Mandriva=x11-proto-devel"
+DISTRO_PN_ALIAS_pn-xproxymanagementprotocol = "Meego=xorg-x11-proto-xproxymanagementprotocol"
+DISTRO_PN_ALIAS_pn-xrandr = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xrdb = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xserver-nodm-init = "OE-Core"
+DISTRO_PN_ALIAS_pn-xserver-xf86-config = "OE-Core"
+DISTRO_PN_ALIAS_pn-xserver-xf86-dri-lite = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xserver-xf86-lite = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xserver-xorg = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xset = "Fedora=xorg-x11-server-utils Ubuntu=x11-xserver-utils Debian=x11-xserver-utils Opensuse=xorg-x11"
+DISTRO_PN_ALIAS_pn-xuser-account = "OE-Core"
+DISTRO_PN_ALIAS_pn-xvideo-tests = "OpenedHand"
+DISTRO_PN_ALIAS_pn-xvinfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xwininfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
diff --git a/poky/meta/conf/distro/include/maintainers.inc b/poky/meta/conf/distro/include/maintainers.inc
new file mode 100644
index 000000000..48aff9537
--- /dev/null
+++ b/poky/meta/conf/distro/include/maintainers.inc
@@ -0,0 +1,799 @@
+# Yocto Project / OpenEmbedded-Core (OE-Core) Maintainers File
+#
+# This file contains a list of recipe maintainers.
+#
+# Please submit any patches against recipes in meta to the
+# OE-Core mail list (openembedded-core@lists.openembedded.org)
+# For recipes in meta-yocto please use the Poky list (poky@yoctoproject.org)
+#
+# If you have problems with or questions about a particular recipe, feel
+# free to contact the maintainer directly (cc:ing the appropriate mailing list
+# puts it in the archive and helps other people who might have the same
+# questions in the future), but please try to do the following first:
+#
+# - look in the Yocto Project Bugzilla
+# (http://bugzilla.yoctoproject.org/) to see if a problem has
+# already been reported
+#
+# - look through recent entries of the appropriate mailing list archives
+# (http://lists.linuxtogo.org/pipermail/openembedded-core or
+# https://lists.yoctoproject.org/pipermail/poky/) to see if other
+# people have run into similar problems or had similar questions
+# answered.
+#
+# The format is as a bitbake variable override for each recipe
+#
+# RECIPE_MAINTAINER_pn-<recipe name> = "Full Name <address@domain>"
+#
+# Please keep this list in alphabetical order.
+#
+RECIPE_MAINTAINER_pn-acl = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-acpica = "Fathi Boudra <fathi.boudra@linaro.org>"
+RECIPE_MAINTAINER_pn-acpid = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-acpitests = "Fathi Boudra <fathi.boudra@linaro.org>"
+RECIPE_MAINTAINER_pn-adwaita-icon-theme = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-alsa-lib = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-alsa-plugins = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-alsa-state = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-alsa-tools = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-alsa-utils = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-alsa-utils-scripts = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-apmd = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-apr = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-apr-util = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-apt = "Aníbal Limón <limon.anibal@gmail.com>"
+RECIPE_MAINTAINER_pn-apt-native = "Aníbal Limón <limon.anibal@gmail.com>"
+RECIPE_MAINTAINER_pn-argp-standalone = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-asciidoc = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-aspell = "Jose Lamego <jose.a.lamego@linux.intel.com>"
+RECIPE_MAINTAINER_pn-assimp = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-at = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-at-spi2-atk = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-at-spi2-core = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-atk = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-attr = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-autoconf = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-autoconf-archive = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-autogen-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-automake = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-avahi = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-avahi-ui = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-babeltrace = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-base-files = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-base-passwd = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-bash = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-bash-completion = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-bc = "Jose Lamego <jose.a.lamego@linux.intel.com>"
+RECIPE_MAINTAINER_pn-bdwgc = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-beecrypt = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-bigreqsproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-bind = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-binutils = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-binutils-crosssdk = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-bison = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-bjam-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-blktool = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-blktrace = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-bluez5 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-bmap-tools = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-boost = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-bootchart2 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-bsd-headers = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-btrfs-tools = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-build-appliance-image = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-build-compare = "Randy Witt <randy.e.witt@linux.intel.com>"
+RECIPE_MAINTAINER_pn-build-sysroots = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-builder = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-buildtools-tarball = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-busybox = "Armin Kuster <akuster808@gmail.com>"
+RECIPE_MAINTAINER_pn-busybox-inittab = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-bzip2 = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-ca-certificates = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-cairo = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-calibrateproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-cantarell-fonts = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ccache = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-cdrtools-native = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-chkconfig = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-chkconfig-alternatives-native = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-chrpath = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-clutter-1.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-clutter-gst-3.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-clutter-gtk-1.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-cmake = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-cmake-native = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-cogl-1.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-compositeproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-connman = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-connman-conf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-connman-gnome = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-console-tools = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-consolekit = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-coreutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-cpio = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-cracklib = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-createrepo-c = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-cronie = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-cross-localedef-native = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-cryptodev-linux = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-cryptodev-module = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-cryptodev-tests = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-cups = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-curl = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-cve-check-tool = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-cwautomacros = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-damageproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-db = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-dbus = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-dbus-glib = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-dbus-test = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-dbus-wait = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-debianutils = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-depmodwrapper-cross = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-desktop-file-utils-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-dhcp = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-diffstat = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-diffutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-directfb = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-directfb-examples = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-distcc = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-distcc-config = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-dmidecode = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-dmxproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-dnf = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-docbook-xml-dtd4 = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-docbook-xsl-stylesheets = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-dosfstools = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-dpkg = "Aníbal Limón <limon.anibal@gmail.com>"
+RECIPE_MAINTAINER_pn-dri2proto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-dri3proto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-dropbear = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-dtc = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-dwarfsrcfiles = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-e2fsprogs = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-ed = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-eee-acpi-scripts = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-efilinux = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-eglinfo-fb = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-eglinfo-x11 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-efilinux = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-elfutils = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-enchant = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-encodings = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-epiphany = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ethtool = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-eudev = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-expat = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-expect = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ffmpeg = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-file = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-findutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-fixesproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-flac = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-flex = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-font-alias = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-font-util = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-fontconfig = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-fontsproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-foomatic-filters = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-formfactor = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-freetype = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-fstests = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-fts = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gawk = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-gcc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-cross-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-crosssdk = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-crosssdk-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-runtime = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-sanitizers = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gcc-source = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gccmakedep = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gconf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gcr = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gdb = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gdb-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gdb-cross-canadian = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gdbm = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gdk-pixbuf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gettext = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gettext-minimal-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-ghostscript = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-git = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-glew = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-glib-2.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-glib-networking = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-glibc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-locale = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-mtrace = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glibc-scripts = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-glide = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-glproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-gmp = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gnome-common = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-desktop-testing = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-desktop3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-doc-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gnome-themes-standard = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-gnu-efi = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-gnupg = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-gnutls = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-go = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-go-cross = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-go-dep = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-go-helloworld = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-go-native = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-gobject-introspection = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gperf = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gpgme = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-gptfdisk = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-grep = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-groff = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-grub = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-grub-bootconf = "California Sullivan <california.l.sullivan@intel.com>"
+RECIPE_MAINTAINER_pn-grub-efi = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gsettings-desktop-schemas = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gst-examples = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gst-validate = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0 = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-libav = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-omx = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-meta-base = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-bad = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-base = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-good = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-plugins-ugly = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-python = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-rtsp-server = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gstreamer1.0-vaapi = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-gtk+ = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gtk+3 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-doc = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-engines = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-icon-utils-native = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-gtk-sato-engine = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-guilt-native = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-gummiboot = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-gzip = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-harfbuzz = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-hdparm = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-help2man-native = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-hicolor-icon-theme = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-hwlatdetect = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-i2c-tools = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-icecc-create-env = "Joshua Watt <JPEWhacker@gmail.com>"
+RECIPE_MAINTAINER_pn-icon-naming-utils = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-icu = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ifupdown = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-init-ifupdown = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-boot = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-initramfs-framework = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-initramfs-live-boot = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-boot-tiny = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install-efi = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install-efi-testfs = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initramfs-live-install-testfs = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-initscripts = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-inputproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-intltool = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-iproute2 = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-iptables = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-iputils = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-irda-utils = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-iso-codes = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-iw = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-libjpeg-turbo = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-json-c = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-json-glib = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-kbd = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kbproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-kconfig-frontends = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kern-tools-native = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-kernelshark = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kernel-devsrc = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-kexec-tools = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-keymaps = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-kmod = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-kmod-native = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-kmscube = "Carlos Rafael Giani <dv@pseudoterminal.org>"
+RECIPE_MAINTAINER_pn-l3afpad = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-lame = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-ldconfig-native = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-less = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-liba52 = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libacpi = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libaio = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libarchive = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-libart-lgpl = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libassuan = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libatomic-ops = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libbsd = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libcap = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libcap-ng = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libcgroup = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libcheck = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libcomps = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libconvert-asn1-perl = "Tim Orling <timothy.t.orling@intel.com>"
+RECIPE_MAINTAINER_pn-libcroco = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libdaemon = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libdmx = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libdnf = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libdrm = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-libepoxy = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-liberation-fonts = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-liberror-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libevdev = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libevent = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libexif = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libfakekey = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libffi = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libfm = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libfm-extra = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libfontenc = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libgcc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libgcc-initial = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libgcrypt = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libgfortran = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libglu = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libgpg-error = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libgudev = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libical = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libice = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libiconv = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libid3tag = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libidn = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libinput = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libjson = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libksba = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libmatchbox = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libmnl = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libmpc = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libnewt = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libnewt-python = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libnfsidmap = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libnl = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libnotify = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libnsl2 = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-libnss-mdns = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libogg = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libomxil = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libowl = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libpam = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libpcap = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libpciaccess = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libpcre = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libpcre2 = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libpfm4 = "Matthew McClintock <msm@freescale.com>"
+RECIPE_MAINTAINER_pn-libpipeline = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libpng = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libpng12 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libproxy = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libpthread-stubs = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-librepo = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-librsvg = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libsamplerate0 = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libsdl = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libsdl2 = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-libsecret = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libsm = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libsndfile1 = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libsolv = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libsoup-2.4 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libtasn1 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libtest-needs-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libtheora = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libtimedate-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libtirpc = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libtool = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libtool-cross = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libtool-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libunistring = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libunwind = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-liburcu = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-liburi-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libusb-compat = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libusb1 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libuser = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-libva = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-libva-utils = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-libvorbis = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-libwebp = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libx11 = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libx11-diet = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxau = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxcalibrate = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxcb = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxcomposite = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxcursor = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxdamage = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxdmcp = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxext = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxfixes = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxfont = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxfont2 = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxft = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxi = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxinerama = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxkbcommon = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxkbfile = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxml-namespacesupport-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-parser-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-sax-base-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-sax-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml-simple-perl = "Tim Orling <timothy.t.orling@linux.intel.com>"
+RECIPE_MAINTAINER_pn-libxml2 = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-libxmu = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxpm = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxrandr = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxrender = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxres = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxscrnsaver = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxsettings-client = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-libxshmfence = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxslt = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-libxt = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxtst = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxv = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxvmc = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxxf86dga = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxxf86misc = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libxxf86vm = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-libyaml = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-lighttpd = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-linux-dummy = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-linux-firmware = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-linux-libc-headers = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-linux-yocto = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-linux-yocto-dev = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-linux-yocto-rt = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-linux-yocto-tiny = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-llvm = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-logrotate = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-lrzsz = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-lsb = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-lsbinitscripts = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-lsbtest = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-lsof = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-ltp = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-lttng-modules = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-lttng-tools = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-lttng-ust = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-lz4 = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-lzo = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-lzip = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-lzop = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-m4 = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-m4-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-make = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-makedepend = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-makedevs = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-make-mod-scripts = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-man-db = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-man-pages = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-matchbox-config-gtk = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-desktop = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-desktop-sato = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-keyboard = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-panel-2 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-session = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-session-sato = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-terminal = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-theme-sato = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-matchbox-wm = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mc = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mdadm = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-menu-cache = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mesa = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-mesa-demos = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-mesa-gl = "Otavio Salvador <otavio.salvador@ossystems.com.br>"
+RECIPE_MAINTAINER_pn-meson = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-meta-environment = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-meta-environment-extsdk = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-meta-extsdk-toolchain = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-meta-ide-support = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-meta-toolchain = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-meta-world-pkgdata = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-mingetty = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-mini-x-session = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-minicom = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mkelfimage = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mkfontdir = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-mkfontscale = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-mklibs-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-mktemp = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-mmc-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mobile-broadband-provider-info = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-modutils-initscripts = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-mpeg2dec = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mpfr = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-mpg123 = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-msmtp = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-mtd-utils = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-mtdev = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-mtools = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-musl = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-musl-utils = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-mx-1.0 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-nasm = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-nativesdk-buildtools-perl-dummy = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-nativesdk-libtool = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-nativesdk-packagegroup-sdk-host = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-nativesdk-qemu-helper = "Juro Bystricky <juro.bystricky@intel.com>"
+RECIPE_MAINTAINER_pn-ncurses = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-neard = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-neon = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-net-tools = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-netbase = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-nettle = "Armin Kuster <akuster808@gmail.com>"
+RECIPE_MAINTAINER_pn-nfs-export-root = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-nfs-utils = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-ninja = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-npth = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-nspr = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-nss = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-nss-myhostname = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-ofono = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-oh-puzzles = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-openssh = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-openssl = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-opkg = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
+RECIPE_MAINTAINER_pn-opkg-arch-config = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
+RECIPE_MAINTAINER_pn-opkg-keyrings = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
+RECIPE_MAINTAINER_pn-opkg-utils = "Alejandro del Castillo <alejandro.delcastillo@ni.com>"
+RECIPE_MAINTAINER_pn-oprofile = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-orc = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-os-release = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-ossp-uuid = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ovmf = "Ricardo Neri <ricardo.neri-calderon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-ovmf-shell-image = "Ricardo Neri <ricardo.neri-calderon@linux.intel.com>"
+RECIPE_MAINTAINER_pn-p11-kit = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-package-index = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-pango = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-parted = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-patch = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-patchelf = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-pax-utils = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-pbzip2 = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-pciutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-pcmanfm = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-pcmciautils = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-perf = "Bruce Ashfield <bruce.ashfield@windriver.com>"
+RECIPE_MAINTAINER_pn-perl = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-perl-native = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-piglit = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pigz = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-pinentry = "Armin Kuster <akuster808@gmail.com>"
+RECIPE_MAINTAINER_pn-pixman = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pixz = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-pkgconf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pkgconfig = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pm-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pointercal-xinput = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-pong-clock = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-popt = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-powertop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ppp = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-ppp-dialin = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-prelink = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-presentproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-procps = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-pseudo = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-psmisc = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-psplash = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-ptest-runner = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-pulseaudio = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-pulseaudio-client-conf-sato = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-puzzles = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-python = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-native = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-nose = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-numpy = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-scons = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-scons-native = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python-setuptools = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3 = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-async = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-dbus = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-docutils = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-git = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-gitdb = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-iniparse = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-mako = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-native = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-nose = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-numpy = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-pip = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-pycairo = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-pygobject = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-setuptools = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-six = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-python3-smmap = "Derek Straka <derek@asterius.io>"
+RECIPE_MAINTAINER_pn-qemu = "Juro Bystricky <juro.bystricky@intel.com>"
+RECIPE_MAINTAINER_pn-qemu-helper-native = "Juro Bystricky <juro.bystricky@intel.com>"
+RECIPE_MAINTAINER_pn-qemuwrapper-cross = "Juro Bystricky <juro.bystricky@intel.com>"
+RECIPE_MAINTAINER_pn-quilt = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-quilt-native = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-quota = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-randrproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-re2c = "Khem Raj <raj.khem@gmail.com>"
+RECIPE_MAINTAINER_pn-readline = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-recordproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-remake = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-renderproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-resolvconf = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-resourceproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-rgb = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-rpcbind = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-rng-tools = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-rpm = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-rpmresolve = "Mark Hatle <mark.hatle@windriver.com>"
+RECIPE_MAINTAINER_pn-rsync = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-rt-tests = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ruby = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-run-postinsts = "Cristian Iorga <cristian.iorga@intel.com>"
+RECIPE_MAINTAINER_pn-rxvt-unicode = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-sato-screenshot = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-sbc = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-screen = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-scrnsaverproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-sed = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-serf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-setserial = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-settings-daemon = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-shadow = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-shadow-securetty = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-shadow-sysroot = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-shared-mime-info = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-shutdown-desktop = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-signing-keys = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-slang = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-socat = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-source-highlight = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-speex = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-speexdsp = "Tanu Kaskinen <tanuk@iki.fi>"
+RECIPE_MAINTAINER_pn-sqlite3 = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-squashfs-tools = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-startup-notification = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-strace = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-stress = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-subversion = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-sudo = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-swabber-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-swig = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-sysfsutils = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-sysklogd = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-syslinux = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-sysprof = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-sysstat = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-boot = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-bootchart = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-bootconf = "California Sullivan <california.l.sullivan@intel.com>"
+RECIPE_MAINTAINER_pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-systemtap = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-systemtap-uprobes = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-sysvinit = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-sysvinit-inittab = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-taglib = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-tar = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-tcf-agent = "Randy Witt <randy.e.witt@linux.intel.com>"
+RECIPE_MAINTAINER_pn-tcl = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-tcp-wrappers = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-testexport-tarball = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-texi2html = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-texinfo = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-texinfo-dummy-native = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-tiff = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-time = "Robert Yang <liezhi.yang@windriver.com>"
+RECIPE_MAINTAINER_pn-tiny-init = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-trace-cmd = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-ttf-bitstream-vera = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-tzcode-native = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-tzdata = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-u-boot = "Marek Vasut <marek.vasut@gmail.com>"
+RECIPE_MAINTAINER_pn-u-boot-fw-utils = "Marek Vasut <marek.vasut@gmail.com>"
+RECIPE_MAINTAINER_pn-u-boot-mkimage = "Marek Vasut <marek.vasut@gmail.com>"
+RECIPE_MAINTAINER_pn-ubootchart = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-udev-extraconf = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-unfs3 = "Randy Witt <randy.e.witt@linux.intel.com>"
+RECIPE_MAINTAINER_pn-unifdef = "Ross Burton <ross.burton@intel.com>"
+RECIPE_MAINTAINER_pn-uninative-tarball = "Richard Purdie <richard.purdie@linuxfoundation.org>"
+RECIPE_MAINTAINER_pn-unzip = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-update-rc.d = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-usbinit = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-usbutils = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-util-linux = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-util-macros = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-v86d = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-vala = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-valgrind = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-videoproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-volatile-binds = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER_pn-vte = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-vulkan = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-vulkan-demos = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-waffle = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-watchdog = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-watchdog-config = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-wayland = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-wayland-protocols = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-webkitgtk = "Alexander Kanavin <alexander.kanavin@intel.com>"
+RECIPE_MAINTAINER_pn-weston = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-weston-init = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-wget = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-which = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-wic-tools = "Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>"
+RECIPE_MAINTAINER_pn-wireless-tools = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-wpa-supplicant = "Changhyeok Bae <changhyeok.bae@lge.com>"
+RECIPE_MAINTAINER_pn-x11-common = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-x11perf = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-x264 = "Anuj Mittal <anuj.mittal@intel.com>"
+RECIPE_MAINTAINER_pn-xauth = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-proto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-util = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-util-image = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-util-keysyms = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-util-renderutil = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcb-util-wm = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcmiscproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xcursor-transparent-theme = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xdg-utils = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-xdpyinfo = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xev = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xextproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xeyes = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-evdev = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-keyboard = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-libinput = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-mouse = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-synaptics = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-input-vmmouse = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-cirrus = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-fbdev = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-intel = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-omap = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-omapfb = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-vesa = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86-video-vmware = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86dgaproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86driproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86miscproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xf86vidmodeproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xhost = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xineramaproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xinetd = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-xinit = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xinput = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xinput-calibrator = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xkbcomp = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xkeyboard-config = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xmlto = "Hongxu Jia <hongxu.jia@windriver.com>"
+RECIPE_MAINTAINER_pn-xmodmap = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xorg-minimal-fonts = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xprop = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xproto = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xrandr = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xrestop = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xserver-nodm-init = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xserver-xf86-config = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xserver-xorg = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xset = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xtrans = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xuser-account = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xvideo-tests = "Maxin B. John <maxin.john@intel.com>"
+RECIPE_MAINTAINER_pn-xvinfo = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xwininfo = "Armin Kuster <akuster@mvista.com>"
+RECIPE_MAINTAINER_pn-xz = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-yasm = "Yi Zhao <yi.zhao@windriver.com>"
+RECIPE_MAINTAINER_pn-zip = "Denys Dmytriyenko <denys@ti.com>"
+RECIPE_MAINTAINER_pn-zlib = "Denys Dmytriyenko <denys@ti.com>"
diff --git a/poky/meta/conf/distro/include/no-static-libs.inc b/poky/meta/conf/distro/include/no-static-libs.inc
new file mode 100644
index 000000000..7c165c717
--- /dev/null
+++ b/poky/meta/conf/distro/include/no-static-libs.inc
@@ -0,0 +1,42 @@
+DISABLE_STATIC = " --disable-static"
+
+# qemu aborts on unrecognised option
+DISABLE_STATIC_pn-qemu = ""
+DISABLE_STATIC_pn-qemu-native = ""
+DISABLE_STATIC_pn-nativesdk-qemu = ""
+# pciutils fails build
+DISABLE_STATIC_pn-pciutils = ""
+# libcap aborts on unrecognised option
+DISABLE_STATIC_pn-libcap = ""
+DISABLE_STATIC_pn-libcap-native = ""
+DISABLE_STATIC_pn-nativesdk-libcap = ""
+# libpcap aborts on unrecognised option
+DISABLE_STATIC_pn-libpcap = ""
+# needed by gdb
+DISABLE_STATIC_pn-readline = ""
+# needed by pseudo
+DISABLE_STATIC_pn-sqlite3 = ""
+DISABLE_STATIC_pn-sqlite3-native = ""
+DISABLE_STATIC_pn-nativesdk-sqlite3 = ""
+# openjade/sgml-common have build issues without static libs
+DISABLE_STATIC_pn-sgml-common-native = ""
+DISABLE_STATIC_pn-openjade-native = ""
+# openssl has build issues without static libs
+DISABLE_STATIC_pn-openssl = ""
+DISABLE_STATIC_pn-openssl-native = ""
+DISABLE_STATIC_pn-nativesdk-openssl = ""
+DISABLE_STATIC_pn-openssl10 = ""
+DISABLE_STATIC_pn-openssl10-native = ""
+DISABLE_STATIC_pn-nativesdk-openssl10 = ""
+# libssp-static-dev included in build-appliance
+DISABLE_STATIC_pn-gcc-runtime = ""
+# libusb1-native is used to build static dfu-util-native
+DISABLE_STATIC_pn-libusb1-native = ""
+
+EXTRA_OECONF_append = "${DISABLE_STATIC}"
+
+EXTRA_OECMAKE_append_pn-libical = " -DSHARED_ONLY=True"
+
+EXCONFIG_ARGS_append_pn-ncurses = " --without-normal"
+EXCONFIG_ARGS_append_pn-ncurses-native = " --without-normal"
+EXCONFIG_ARGS_append_pn-nativesdk-ncurses = " --without-normal"
diff --git a/poky/meta/conf/distro/include/security_flags.inc b/poky/meta/conf/distro/include/security_flags.inc
new file mode 100644
index 000000000..d66dd5764
--- /dev/null
+++ b/poky/meta/conf/distro/include/security_flags.inc
@@ -0,0 +1,71 @@
+# Setup extra CFLAGS and LDFLAGS which have 'security' benefits. These
+# don't work universally, there are recipes which can't use one, the other
+# or both so a blacklist is maintained here. The idea would be over
+# time to reduce this list to nothing.
+# From a Yocto Project perspective, this file is included and tested
+# in the DISTRO="poky-lsb" configuration.
+
+GCCPIE ?= "--enable-default-pie"
+GLIBCPIE ?= "--enable-static-pie"
+
+# _FORTIFY_SOURCE requires -O1 or higher, so disable in debug builds as they use
+# -O0 which then results in a compiler warning.
+lcl_maybe_fortify = "${@oe.utils.conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}"
+
+# Error on use of format strings that represent possible security problems
+SECURITY_STRINGFORMAT ?= "-Wformat -Wformat-security -Werror=format-security"
+
+# Inject pie flags into compiler flags if not configured with gcc itself
+# especially useful with external toolchains
+SECURITY_PIE_CFLAGS ?= "${@'' if '${GCCPIE}' else '-pie -fPIE'}"
+
+SECURITY_NOPIE_CFLAGS ?= "-no-pie -fno-PIE"
+
+SECURITY_CFLAGS ?= "-fstack-protector-strong ${SECURITY_PIE_CFLAGS} ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
+SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_STRINGFORMAT}"
+
+SECURITY_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro,-z,now"
+SECURITY_X_LDFLAGS ?= "-fstack-protector-strong -Wl,-z,relro"
+
+# powerpc does not get on with pie for reasons not looked into as yet
+SECURITY_CFLAGS_powerpc = "-fstack-protector-strong ${lcl_maybe_fortify} ${SECURITY_NOPIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libgcc_powerpc = ""
+GCCPIE_powerpc = ""
+GLIBCPIE_powerpc = ""
+
+# arm specific security flag issues
+SECURITY_CFLAGS_pn-glibc = ""
+SECURITY_CFLAGS_pn-glibc-initial = ""
+SECURITY_CFLAGS_pn-gcc-runtime = ""
+SECURITY_CFLAGS_pn-grub = ""
+SECURITY_CFLAGS_pn-grub-efi = ""
+SECURITY_CFLAGS_pn-grub-efi-native = ""
+SECURITY_CFLAGS_pn-grub-efi-x86-native = ""
+SECURITY_CFLAGS_pn-grub-efi-i586-native = ""
+SECURITY_CFLAGS_pn-grub-efi-x86-64-native = ""
+
+SECURITY_CFLAGS_pn-mkelfimage_x86 = ""
+
+SECURITY_CFLAGS_pn-valgrind = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS_pn-valgrind = ""
+SECURITY_CFLAGS_pn-sysklogd = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_LDFLAGS_pn-sysklogd = ""
+
+# Recipes which fail to compile when elevating -Wformat-security to an error
+SECURITY_STRINGFORMAT_pn-busybox = ""
+SECURITY_STRINGFORMAT_pn-gcc = ""
+
+TARGET_CC_ARCH_append_class-target = " ${SECURITY_CFLAGS}"
+TARGET_LDFLAGS_append_class-target = " ${SECURITY_LDFLAGS}"
+
+SECURITY_LDFLAGS_remove_pn-gcc-runtime = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-glibc = "-fstack-protector-strong"
+SECURITY_LDFLAGS_remove_pn-glibc-initial = "-fstack-protector-strong"
+# All xorg module drivers need to be linked this way as well and are
+# handled in recipes-graphics/xorg-driver/xorg-driver-common.inc
+SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}"
+
+TARGET_CC_ARCH_append_pn-binutils = " ${SELECTED_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-gcc = " ${SELECTED_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-gdb = " ${SELECTED_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-perf = " ${SELECTED_OPTIMIZATION}"
diff --git a/poky/meta/conf/distro/include/tclibc-baremetal.inc b/poky/meta/conf/distro/include/tclibc-baremetal.inc
new file mode 100644
index 000000000..a8ce6d3ac
--- /dev/null
+++ b/poky/meta/conf/distro/include/tclibc-baremetal.inc
@@ -0,0 +1,32 @@
+#
+# baremetal configuration
+#
+
+LIBCEXTENSION = ""
+
+# Add baremetal libc overrides to the overrides.
+LIBCOVERRIDE = ":libc-baremetal"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+ASSUME_PROVIDED += "virtual/libc virtual/libiconv"
+
+PREFERRED_PROVIDER_virtual/libc ?= "musl"
+PREFERRED_PROVIDER_virtual/libiconv ?= "musl"
+PREFERRED_PROVIDER_virtual/libintl ?= "gettext"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+USE_NLS ?= "no"
+IMAGE_LINGUAS = ""
+LIBC_DEPENDENCIES = ""
+
+EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
+DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
+
+TARGET_OS = "elf"
+TARGET_OS_arm = "eabi"
+
+TOOLCHAIN_HOST_TASK ?= "packagegroup-cross-canadian-${MACHINE}"
+TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_TARGET_TASK ?= "libgcc-dev"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE_remove = "virtual/${MLPREFIX}libc zlib ncurses"
diff --git a/poky/meta/conf/distro/include/tclibc-glibc.inc b/poky/meta/conf/distro/include/tclibc-glibc.inc
new file mode 100644
index 000000000..ad8000f5d
--- /dev/null
+++ b/poky/meta/conf/distro/include/tclibc-glibc.inc
@@ -0,0 +1,40 @@
+#
+# glibc specific configuration
+#
+
+LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION') or '') != '']}"
+
+# Add glibc overrides to the overrides for glibc.
+LIBCOVERRIDE = ":libc-glibc"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libiconv ?= "glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/libintl ?= "glibc"
+PREFERRED_PROVIDER_virtual/libc ?= "glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libc ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/libc-locale ?= "glibc-locale"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+LIBC_DEPENDENCIES = "libsegfault \
+ glibc \
+ glibc-dbg \
+ glibc-dev \
+ glibc-utils \
+ glibc-thread-db \
+ ${@get_libc_locales_dependencies(d)}"
+
+LIBC_LOCALE_DEPENDENCIES = "\
+ glibc-localedata-i18n \
+ glibc-gconv-ibm850 \
+ glibc-gconv-cp1252 \
+ glibc-gconv-iso8859-1 \
+ glibc-gconv-iso8859-15"
+
+def get_libc_locales_dependencies(d):
+ if 'libc-locales' in (d.getVar('DISTRO_FEATURES') or '').split() :
+ return d.getVar('LIBC_LOCALE_DEPENDENCIES') or ''
+ else:
+ return ''
diff --git a/poky/meta/conf/distro/include/tclibc-musl.inc b/poky/meta/conf/distro/include/tclibc-musl.inc
new file mode 100644
index 000000000..54e1acf1d
--- /dev/null
+++ b/poky/meta/conf/distro/include/tclibc-musl.inc
@@ -0,0 +1,32 @@
+#
+# musl specific configuration
+#
+
+LIBCEXTENSION = "-musl"
+
+# Add musl libc overrides to the overrides.
+LIBCOVERRIDE = ":libc-musl"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libc ?= "musl"
+PREFERRED_PROVIDER_virtual/libiconv ?= "musl"
+PREFERRED_PROVIDER_virtual/libintl ?= "musl"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig"
+
+#USE_NLS ?= "no"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+IMAGE_LINGUAS = ""
+
+LIBC_DEPENDENCIES = "\
+ musl \
+ musl-dbg \
+ musl-dev \
+ musl-utils \
+ musl-utils-iconv \
+ bsd-headers-dev \
+ "
diff --git a/poky/meta/conf/distro/include/tcmode-default.inc b/poky/meta/conf/distro/include/tcmode-default.inc
new file mode 100644
index 000000000..00399ae82
--- /dev/null
+++ b/poky/meta/conf/distro/include/tcmode-default.inc
@@ -0,0 +1,84 @@
+#
+# Default toolchain configuration
+#
+
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "binutils-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "gcc-cross-initial-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "gcc-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "gcc-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "gcc-runtime"
+PREFERRED_PROVIDER_gdb = "gdb"
+
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}binutils-crosssdk ?= "binutils-crosssdk-${SDK_SYS}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc-initial = "gcc-crosssdk-initial-${SDK_SYS}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc = "gcc-crosssdk-${SDK_SYS}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}g++ = "gcc-crosssdk-${SDK_SYS}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}compilerlibs = "nativesdk-gcc-runtime"
+
+# Default libc config
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "${TCLIBC}"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "${TCLIBC}-initial"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial ?= "nativesdk-glibc-initial"
+PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
+
+GCCVERSION ?= "7.%"
+SDKGCCVERSION ?= "${GCCVERSION}"
+BINUVERSION ?= "2.30%"
+GDBVERSION ?= "8.0%"
+GLIBCVERSION ?= "2.27%"
+LINUXLIBCVERSION ?= "4.15%"
+QEMUVERSION ?= "2.11%"
+
+PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-initial-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-${SDK_SYS} ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_SYS} ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-runtime ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-sanitizers ?= "${GCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc-sanitizers ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_libgcc ?= "${GCCVERSION}"
+PREFERRED_VERSION_libgcc-initial ?= "${GCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_binutils ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-native ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-cross-${TARGET_ARCH} ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-crosssdk-${SDK_SYS} ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${BINUVERSION}"
+PREFERRED_VERSION_gdb ?= "${GDBVERSION}"
+PREFERRED_VERSION_gdb-cross-${TARGET_ARCH} ?= "${GDBVERSION}"
+PREFERRED_VERSION_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GDBVERSION}"
+
+PREFERRED_VERSION_linux-libc-headers ?= "${LINUXLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-linux-libc-headers ?= "${LINUXLIBCVERSION}"
+PREFERRED_VERSION_glibc ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-locale ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-mtrace ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-scripts ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-glibc ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-glibc-initial ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_cross-localedef-native ?= "${GLIBCVERSION}"
+
+
+PREFERRED_VERSION_qemu ?= "${QEMUVERSION}"
+PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}"
+PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}"
+# Setup suitable toolchain flags
+require conf/distro/include/as-needed.inc
+
+GOVERSION ?= "1.9%"
+PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
+PREFERRED_VERSION_go-cross-${TARGET_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go ?= "${GOVERSION}"
+PREFERRED_VERSION_go-native ?= "${GOVERSION}"
+PREFERRED_VERSION_go-runtime ?= "${GOVERSION}"
+PREFERRED_VERSION_nativesdk-go ?= "${GOVERSION}"
+PREFERRED_VERSION_nativesdk-go-runtime ?= "${GOVERSION}"
diff --git a/poky/meta/conf/distro/include/uninative-flags.inc b/poky/meta/conf/distro/include/uninative-flags.inc
new file mode 100644
index 000000000..febf2a53e
--- /dev/null
+++ b/poky/meta/conf/distro/include/uninative-flags.inc
@@ -0,0 +1,7 @@
+# Some distros (ubuntu 16.10, debian-testing) default to gcc configured with
+# --enable-default-pie (see gcc -v). This breaks e.g. prelink-native on a pie
+# default system if binutils-native was built on a system which is not pie default
+# We therefore enable pie unconditionally for native recipes where static libs are
+# used such as libiberty from binutils, for now, until our minimum distro set is
+# all default pie.
+BUILD_CFLAGS_append_pn-binutils-native = " -pie -fpie"
diff --git a/poky/meta/conf/distro/include/upstream_tracking.inc b/poky/meta/conf/distro/include/upstream_tracking.inc
new file mode 100644
index 000000000..e2a5e6ce4
--- /dev/null
+++ b/poky/meta/conf/distro/include/upstream_tracking.inc
@@ -0,0 +1,24 @@
+# NOTE: THIS FILE IS DEPRECATED. Please add new entries to the recipes themselves.
+#
+# upstream_tracking.inc - This file contains data that tracks the
+# upstream project associated with a given recipe. This list is needed
+# for recipes that version information can not be automagically discovered.
+# As we automate this checking, this file will slowed be reduced.
+#
+# This data is used by the package reporting system (packages.yoctoproject.org)
+#
+# The format is as a bitbake variable override for each recipe
+#
+# RECIPE_UPSTREAM_VERSION_pn-<recipe name> = "<version>"
+# RECIPE_UPSTREAM_DATE_pn-<recipe name> = "Mmm dd, YYYY"
+# - This is the latest upstream version and date
+# RECIPE_NO_UPDATE_REASON_pn-<recipe name> = "<free form text>"
+# - Used to note why a recipe should not be upgraded to a newer versoin
+# CHECK_DATE_pn-<recipe name> = "Mmm dd, YYYY"
+# - This is the date that upstream was last manually checked over time
+# this should be removed as we automate this checking
+#
+# These entries will slowly be removed as we can automatically determine
+# the information in this file. So for existing recipes that we can get
+# from the Recipe reporting system, the entries here can be removed.
+#
diff --git a/poky/meta/conf/distro/include/world-broken.inc b/poky/meta/conf/distro/include/world-broken.inc
new file mode 100644
index 000000000..42cacfdf2
--- /dev/null
+++ b/poky/meta/conf/distro/include/world-broken.inc
@@ -0,0 +1,27 @@
+#
+# Exclude known broken packages
+#
+
+# rt-tests needs PI mutex support in libc
+EXCLUDE_FROM_WORLD_pn-rt-tests_libc-musl = "1"
+
+# error: use of undeclared identifier '_STAT_VER'
+EXCLUDE_FROM_WORLD_pn-pseudo_libc-musl = "1"
+
+# error: error.h: No such file or directory
+EXCLUDE_FROM_WORLD_pn-prelink_libc-musl = "1"
+
+# error: obstack.h: No such file or directory
+EXCLUDE_FROM_WORLD_pn-systemtap_libc-musl = "1"
+EXCLUDE_FROM_WORLD_pn-systemtap-uprobes_libc-musl = "1"
+
+# error: a parameter list without types is only allowed in a function definition
+# void (*_function)(sigval_t);
+EXCLUDE_FROM_WORLD_pn-qemu_libc-musl = "1"
+
+# error: format '%s' expects argument of type 'char *', but argument 4 has type 'int' [-Werror=format=]
+# snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
+EXCLUDE_FROM_WORLD_pn-perf_libc-musl = "1"
+
+# error: 'RTLD_NEXT' was not declared in this scope
+EXCLUDE_FROM_WORLD_pn-gcc-sanitizers_libc-musl = "1"
diff --git a/poky/meta/conf/distro/include/yocto-uninative.inc b/poky/meta/conf/distro/include/yocto-uninative.inc
new file mode 100644
index 000000000..a8e82cb5d
--- /dev/null
+++ b/poky/meta/conf/distro/include/yocto-uninative.inc
@@ -0,0 +1,13 @@
+#
+# This include points at uninative tarballs generated and maintained
+# by the Yocto Project. These file can be included by distros if they
+# want to use/maintain a unified sstate feed for native/cross artefacts
+# rather than the feeds having native/cross artefacts which are specific
+# to the distro running on the build machine.
+#
+
+UNINATIVE_MAXGLIBCVERSION = "2.27"
+
+UNINATIVE_URL ?= "http://downloads.yoctoproject.org/releases/uninative/1.9/"
+UNINATIVE_CHECKSUM[i686] ?= "83a4f927da81d9889ef0cbe5c12cb782e21c6cc11e6155600b94ff0c99576dce"
+UNINATIVE_CHECKSUM[x86_64] ?= "c26622a1f27dbf5b25de986b11584b5c5b2f322d9eb367f705a744f58a5561ec"
diff --git a/poky/meta/conf/documentation.conf b/poky/meta/conf/documentation.conf
new file mode 100644
index 000000000..254f8f196
--- /dev/null
+++ b/poky/meta/conf/documentation.conf
@@ -0,0 +1,464 @@
+# this file holds documentation for known keys, possible values and
+# their meanings. Please update, correct and extend this documentation.
+# Mail your changes to openembedded-devel@openembedded.org
+
+# DESCRIPTIONS FOR TASKS #
+
+do_bootimg[doc] = "Creates a bootable live image"
+do_build[doc] = "Default task for a recipe - depends on all other normal tasks required to 'build' a recipe"
+do_bundle_initramfs[doc] = "Combines an initial ramdisk image and kernel together to form a single image"
+do_checkuri[doc] = "Validates the SRC_URI value"
+do_clean[doc] = "Removes all output files for a target"
+do_cleanall[doc] = "Removes all output files, shared state cache, and downloaded source files for a target"
+do_cleansstate[doc] = "Removes all output files and shared state cache for a target"
+do_compile[doc] = "Compiles the source in the compilation directory"
+do_compile_kernelmodules[doc] = "Compiles loadable modules for the Linux kernel"
+do_compile_ptest_base[doc] = "Compiles the runtime test suite included in the software being built"
+do_configure[doc] = "Configures the source by enabling and disabling any build-time and configuration options for the software being built"
+do_configure_ptest_base[doc] = "Configures the runtime test suite included in the software being built"
+do_deploy[doc] = "Writes deployable output files to the deploy directory"
+do_devpyshell[doc] = "Starts an interactive Python shell for development/debugging"
+do_devshell[doc] = "Starts a shell with the environment set up for development/debugging"
+do_diffconfig[doc] = "Compares the old and new config files after running do_menuconfig for the kernel"
+do_fetch[doc] = "Fetches the source code"
+do_install[doc] = "Copies files from the compilation directory to a holding area"
+do_install_ptest_base[doc] = "Copies the runtime test suite files from the compilation directory to a holding area"
+do_kernel_checkout[doc] = "Checks out source/meta branches for a linux-yocto style kernel"
+do_kernel_configcheck[doc] = "Validates the kernel configuration for a linux-yocto style kernel"
+do_kernel_configme[doc] = "Assembles the kernel configuration for a linux-yocto style kernel"
+do_kernel_link_images[doc] = "Creates a symbolic link in arch/$arch/boot for vmlinux and vmlinuz kernel images"
+do_listtasks[doc] = "Lists all defined tasks for a target"
+do_menuconfig[doc] = "Runs 'make menuconfig' for the kernel"
+do_package[doc] = "Analyzes the content of the holding area and splits it into subsets based on available packages and files"
+do_package_index[doc] = "Creates or updates the index in the Package Feed area"
+do_package_qa[doc] = "Runs QA checks on packaged files"
+do_package_write_deb[doc] = "Creates the actual DEB packages and places them in the Package Feed area"
+do_package_write_ipk[doc] = "Creates the actual IPK packages and places them in the Package Feed area"
+do_package_write_rpm[doc] = "Creates the actual RPM packages and places them in the Package Feed area"
+do_package_write_tar[doc] = "Creates tar archives for packages and places them in the Package Feed area"
+do_packagedata[doc] = "Creates package metadata used by the build system to generate the final packages"
+do_patch[doc] = "Locates patch files and applies them to the source code"
+do_populate_lic[doc] = "Writes license information for the recipe that is collected later when the image is constructed"
+do_populate_sdk[doc] = "Creates the file and directory structure for an installable SDK"
+do_populate_sysroot[doc] = "Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes"
+do_rm_work[doc] = "Removes work files after the build system has finished with them"
+do_rm_work_all[doc] = "Top-level task for removing work files after the build system has finished with them"
+do_rootfs[doc] = "Creates the root filesystem (file and directory structure) for an image"
+do_savedefconfig[doc] = "Creates a minimal Linux kernel configuration file"
+do_sizecheck[doc] = "Checks the size of the kernel image against KERNEL_IMAGE_MAXSIZE (if set)"
+do_spdx[doc] = "A build stage that takes the source code and scans it on a remote FOSSOLOGY server in order to produce an SPDX document"
+do_strip[doc] = "Strips unneeded sections out of the Linux kernel image"
+do_testimage[doc] = "Boots an image and performs runtime tests within the image"
+do_testimage_auto[doc] = "Boots an image and performs runtime tests within the image immediately after it has been built"
+do_testsdk[doc] = "Installs an SDK and performs runtime tests on the tools installed by it"
+do_uboot_mkimage[doc] = "Creates a uImage file from the kernel for the U-Boot bootloader"
+do_unpack[doc] = "Unpacks the source code into a working directory"
+do_validate_branches[doc] = "Ensures that the source/meta branches are on the locations specified by their SRCREV values for a linux-yocto style kernel"
+
+# DESCRIPTIONS FOR VARIABLES #
+
+#A
+
+ALLOW_EMPTY[doc] = "Specifies if an output package should still be produced if it is empty."
+ALTERNATIVE[doc] = "Lists commands in a package that need an alternative binary naming scheme."
+ALTERNATIVE_LINK_NAME[doc] = "Used by the alternatives system to map duplicated commands to actual locations."
+ALTERNATIVE_PRIORITY[doc] = "Used by the alternatives system to create default priorities for duplicated commands."
+ALTERNATIVE_TARGET[doc] = "Used by the alternatives system to create default link locations for duplicated commands."
+ASSUME_PROVIDED[doc] = "List of packages (recipes actually) that are assumed to be implicitly available. BitBake does not build these packages."
+ASSUME_SHLIBS[doc] = "List of shlib:package[_version] mappings. Useful for lib packages in ASSUME_PROVIDED, for which automatic shlib dependency tracking does not work."
+AUTHOR[doc] = "Email address used to contact the original author(s) in order to send patches and forward bugs."
+AUTO_SYSLINUXMENU[doc] = "Enables creating an automatic menu for the syslinux bootloader."
+AUTOREV[doc] = "When SRCREV is set to the value of this variable, it specifies to use the latest source revision in the repository."
+
+#B
+
+B[doc] = "The Build Directory. The OpenEmbedded build system places generated objects into the Build Directory during a recipe's build process."
+BAD_RECOMMENDATIONS[doc] = "A list of packages not to install despite being recommended by a recipe. Support for this variable exists only when using the IPK or RPM packaging backends."
+BB_DANGLINGAPPENDS_WARNONLY[doc] = "Defines how BitBake handles situations where an append file (.bbappend) has no corresponding recipe file (.bb)."
+BB_DISKMON_DIRS[doc] = "Monitors disk space and available inodes during the build and allows you to control the build based on these parameters."
+BB_DISKMON_WARNINTERVAL[doc] = "Defines the disk space and free inode warning intervals. To set these intervals, define the variable in the conf/local.conf file in the Build Directory."
+BB_GENERATE_MIRROR_TARBALLS[doc] = "Causes tarballs of the Git repositories to be placed in the DL_DIR directory."
+BB_NUMBER_THREADS[doc] = "The maximum number of tasks BitBake should run in parallel at any one time. A good rule of thumb is to set this variable to twice the number of cores."
+BBCLASSEXTEND[doc] = "Allows you to extend a recipe so that it builds variants of the software. Common variants for recipes are 'native', 'cross', 'nativesdk' and multilibs."
+BBFILE_COLLECTIONS[doc] = "Lists the names of configured layers. These names are used to find the other BBFILE_* variables."
+BBFILE_PATTERN[doc] = "Variable that expands to match files from BBFILES in a particular layer. This variable is used in the layer.conf file and must be suffixed with the name of a layer."
+BBFILE_PRIORITY[doc] = "Assigns the priority for recipe files in each layer. Setting this variable allows you to prioritize a layer against other layers that contain the same recipe."
+BBFILES[doc] = "List of recipe files used by BitBake to build software."
+BBINCLUDELOGS[doc] = "Variable that controls how BitBake displays logs on build failure."
+BBINCLUDELOGS_LINES[doc] = "Amount of log lines printed on failure."
+BBLAYERS[doc] = "Lists the layers to enable during the build. This variable is defined in the bblayers.conf configuration file."
+BBMASK[doc] = "Prevents BitBake from processing specific recipes or recipe append files."
+BBPATH[doc] = "Used by BitBake to locate .bbclass and configuration files. This variable is analogous to the PATH variable."
+BBSERVER[doc] = "Points to the server that runs memory-resident BitBake."
+BINCONFIG_GLOB[doc] = "When inheriting binconfig.bbclass from a recipe, this variable specifies a wildcard for configuration scripts that need editing."
+BP[doc] = "The base recipe name and version but without any special recipe name suffix (i.e. -native, lib64-, and so forth). BP is comprised of ${BPN}-${PV}"
+BPN[doc] = "The bare name of the recipe. This variable is a version of the PN variable but removes common suffixes and prefixes."
+BUGTRACKER[doc] = "Specifies a URL for an upstream bug tracking website for a recipe."
+BUILD_ARCH[doc] = "The name of the building architecture (e.g. i686)."
+BUILD_OS[doc] = "The operating system (in lower case) of the building architecture (e.g. linux)."
+BUILDDIR[doc] = "Points to the location of the Build Directory."
+BUILDSTATS_BASE[doc] = "Points to the location of the directory that holds build statistics when you use and enable the buildstats class."
+BUSYBOX_SPLIT_SUID[doc] = "For the BusyBox recipe, specifies whether to split the output executable file into two parts: one for features that require setuid root, and one for the remaining features."
+
+#C
+
+CACHE[doc] = "The directory holding the cache of the metadata."
+CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as TARGET_CFLAGS."
+CLASSOVERRIDE[doc] = "An internal variable specifying the special class override that should currently apply (e.g. "class-target", "class-native", and so forth)."
+CLEANBROKEN[doc] = "Specifies if 'make clean' does not work for a recipe (and therefore the build system should not try to use it during do_configure)"
+COMBINED_FEATURES[doc] = "A set of features common between MACHINE_FEATURES and DISTRO_FEATURES."
+COMMON_LICENSE_DIR[doc] = "Points to meta/files/common-licenses in the Source Directory, which is where generic license files reside."
+COMPATIBLE_HOST[doc] = "A regular expression that resolves to one or more hosts (when the recipe is native) or one or more targets (when the recipe is non-native) with which a recipe is compatible."
+COMPATIBLE_MACHINE[doc] = "A regular expression that resolves to one or more target machines with which a recipe is compatible."
+COMPLEMENTARY_GLOB[doc] = "Defines wildcards to match when installing a list of complementary packages for all the packages installed in an image."
+CONFFILES[doc] = "Identifies editable or configurable files that are part of a package."
+CONFIG_SITE[doc] = "A list of files that contains autoconf test results relevant to the current build. This variable is used by the Autotools utilities when running configure."
+CONFLICT_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that would be in conflict should the recipe be built."
+CORE_IMAGE_EXTRA_INSTALL[doc] = "Specifies the list of packages to be added to the image. You should only set this variable in the conf/local.conf file in the Build Directory."
+COREBASE[doc] = "Specifies the parent directory of the OpenEmbedded Core Metadata layer (i.e. meta)."
+CONF_VERSION[doc] = "Tracks the version of local.conf. Increased each time build/conf/ changes incompatibly."
+CVSDIR[doc] = "The directory where cvs checkouts will be stored in."
+
+#D
+
+D[doc] = "The destination directory."
+DATE[doc] = "The date the build was started using YMD format."
+DATETIME[doc] = "The date and time the build was started."
+DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable."
+DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe'."
+DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority."
+DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)."
+DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs and other output files that are ready to be used outside of the build system."
+DEPLOY_DIR_IMAGE[doc] = "Points to the area that the OpenEmbedded build system uses to place images and other associated output files that are ready to be deployed onto the target machine."
+DEPLOYDIR[doc] = "For recipes that inherit the deploy class, the DEPLOYDIR points to a temporary work area for deployed files."
+DESCRIPTION[doc] = "The package description used by package managers. If not set, DESCRIPTION takes the value of the SUMMARY variable."
+DISTRO[doc] = "The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used."
+DISTRO_EXTRA_RDEPENDS[doc] = "Specifies a list of distro-specific packages to add to all images. The variable only applies to the images that include packagegroup-base."
+DISTRO_EXTRA_RRECOMMENDS[doc] = "Specifies a list of distro-specific packages to add to all images if the packages exist. The list of packages are automatically installed but you can remove them."
+DISTRO_FEATURES[doc] = "The features enabled for the distribution."
+DISTRO_FEATURES_BACKFILL[doc] = "Features to be added to DISTRO_FEATURES if not also present in DISTRO_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and it is not intended to be user-configurable."
+DISTRO_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from DISTRO_FEATURES_BACKFILL that should not be backfilled (i.e. added to DISTRO_FEATURES) during the build."
+DISTRO_NAME[doc] = "The long name of the distribution."
+DISTRO_PN_ALIAS[doc] = "Alias names used for the recipe in various Linux distributions."
+DISTRO_VERSION[doc] = "The version of the distribution."
+DISTROOVERRIDES[doc] = "Lists overrides specific to the current distribution. By default, the variable list includes the value of the DISTRO variable."
+DL_DIR[doc] = "The central download directory used by the build process to store downloads. By default, the directory is 'downloads' in the Build Directory."
+
+#E
+
+ENABLE_BINARY_LOCALE_GENERATION[doc] = "Controls which locales for glibc are generated during the build. The variable is useful if the target device has 64Mbytes of RAM or less."
+ERROR_QA[doc] = "Specifies the quality assurance checks whose failures are reported as errors by the OpenEmbedded build system."
+EXCLUDE_FROM_WORLD[doc] = "Directs BitBake to exclude a recipe from world builds (i.e. bitbake world)."
+EXTENDPE[doc] = "Used with file and pathnames to create a prefix for a recipe's version based on the recipe's PE value. If PE is set and greater than zero for a recipe, EXTENDPE becomes that value."
+EXTENDPKGV[doc] = "The full package version specification as it appears on the final packages produced by a recipe."
+EXTERNALSRC[doc] = "If externalsrc.bbclass is inherited, this variable points to the source tree, which is outside of the OpenEmbedded build system."
+EXTERNALSRC_BUILD[doc] = "If externalsrc.bbclass is inherited, this variable points to the directory in which the recipe's source code is built, which is outside of the OpenEmbedded build system."
+EXTRA_IMAGE_FEATURES[doc] = "The list of additional features to include in an image. Configure this variable in the conf/local.conf file in the Build Directory."
+EXTRA_IMAGEDEPENDS[doc] = "A list of recipes to build that do not provide packages for installing into the root filesystem. Use this variable to list recipes that are required to build the final image, but not needed in the root filesystem."
+EXTRA_OECMAKE[doc] = "Additional cmake options."
+EXTRA_OECONF[doc] = "Additional configure script options."
+EXTRA_OEMAKE[doc] = "Additional GNU make options."
+EXTRA_OESCONS[doc] = "When a recipe inherits the scons class, this variable specifies additional configuration options you want to pass to the scons command line."
+EXTRA_QMAKEVARS_POST[doc] = "Configuration variables or options you want to pass to qmake when the arguments need to be after the .pro file list on the command line."
+EXTRA_QMAKEVARS_PRE[doc] = "Configuration variables or options you want to pass to qmake when the arguments need to be before the .pro file list on the command line."
+EXTRA_USERS_PARAMS[doc] = "When a recipe inherits the extrausers class, this variable provides image level user and group operations."
+
+#F
+
+FEED_DEPLOYDIR_BASE_URI[doc] = "Allow to serve ipk deploy directory as an ad hoc feed (bogofeed). Set to base URL of the directory as exported by HTTP. Set of ad hoc feed configs will be generated in the image."
+FILES[doc] = "The list of directories or files that are placed in packages."
+FILESEXTRAPATHS[doc] = "Extends the search path the OpenEmbedded build system uses when looking for files and patches as it processes recipes and append files."
+FILESOVERRIDES[doc] = "A subset of OVERRIDES used by the OpenEmbedded build system for creating FILESPATH."
+FILESPATH[doc] = "The default set of directories the OpenEmbedded build system uses when searching for patches and files. It is defined in the base.bbclass class found in meta/classes in the Source Directory. Do not hand-edit the FILESPATH variable."
+FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process."
+FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'."
+FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig."
+FULL_OPTIMIZATION[doc]= "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-O2 -pipe ${DEBUG_FLAGS}'."
+
+#G
+
+GITDIR[doc] = "The directory where Git clones will be stored."
+GROUPADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupadd command if you wish to add a group to the system when the package is installed."
+GROUPMEMS_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupmems command if you wish to modify the members of a group when the package is installed."
+GRUB_GFXSERIAL[doc] = "Configures the GNU GRand Unified Bootloader (GRUB) to have graphics and serial in the boot menu."
+GRUB_OPTS[doc] = "Additional options to add to the GNU GRand Unified Bootloader (GRUB) configuration."
+GRUB_TIMEOUT[doc] = "Specifies the timeout before executing the default LABEL in the GNU GRand Unified Bootloader (GRUB)."
+GTKIMMODULES_PACKAGES[doc] = "For recipes that inherit the gtk-immodules-cache class, this variable specifies the packages that contain the GTK+ input method modules being installed when the modules are in packages other than the main package."
+
+#H
+
+HOMEPAGE[doc] = "Website where more information about the software the recipe is building can be found."
+HOST_ARCH[doc] = "The name of the target architecture. Normally same as the TARGET_ARCH."
+HOST_CC_ARCH[doc] = "The name of the host architecture. Normally same as the TARGET_CC_ARCH."
+HOST_OS[doc] = "The name of the target operating system. Normally the same as the TARGET_OS."
+HOST_PREFIX[doc] = "The prefix for the cross compile toolchain. Normally same as the TARGET_PREFIX."
+HOST_SYS[doc] = "Specifies the system, including the architecture and the operating system, for with the build is occurring in the context of the current recipe."
+HOST_VENDOR[doc] = "The name of the vendor. Normally same as the TARGET_VENDOR."
+
+#I
+
+ICECC_ENV_EXEC[doc] = "Points to the icecc-create-env script that you provide."
+ICECC_PATH[doc] = "The location of the icecc binary."
+ICECC_USER_CLASS_BL[doc] = "Identifies user classes that you do not want the Icecream distributed compile support to consider."
+ICECC_USER_PACKAGE_BL[doc] = "Identifies user recipes that you do not want the Icecream distributed compile support to consider."
+ICECC_USER_PACKAGE_WL[doc] = "Identifies user recipes that use an empty PARALLEL_MAKE variable that you want to force remote distributed compilation on using the Icecream distributed compile support."
+IMAGE_BASENAME[doc] = "The base name of image output files."
+IMAGE_BOOT_FILES[doc] = "Whitespace separated list of files from ${DEPLOY_DIR_IMAGE} to place in boot partition. Entries will be installed under a same name as the source file. To change the destination file name, pass a desired name after a semicolon (eg. u-boot.img;uboot)."
+IMAGE_CLASSES[doc] = "A list of classes that all images should inherit."
+IMAGE_FEATURES[doc] = "The primary list of features to include in an image. Configure this variable in an image recipe."
+IMAGE_FSTYPES[doc] = "Formats of root filesystem images that you want to have created."
+IMAGE_FSTYPES_DEBUGFS[doc] = "Formats of the debug root filesystem images that you want to have created."
+IMAGE_GEN_DEBUGFS[doc] = "When set to '1', generate a companion debug object/source filesystem image."
+IMAGE_INSTALL[doc] = "Specifies the packages to install into an image. Image recipes set IMAGE_INSTALL to specify the packages to install into an image through image.bbclass."
+IMAGE_LINGUAS[doc] = "Specifies the list of locales to install into the image during the root filesystem construction process."
+IMAGE_NAME[doc] = "The name of the output image files minus the extension."
+IMAGE_OVERHEAD_FACTOR[doc] = "Defines a multiplier that the build system applies to the initial image size for cases when the multiplier times the returned disk usage value for the image is greater than the sum of IMAGE_ROOTFS_SIZE and IMAGE_ROOTFS_EXTRA_SPACE."
+IMAGE_PKGTYPE[doc] = "Defines the package type (DEB, RPM, IPK, or TAR) used by the OpenEmbedded build system."
+IMAGE_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the image."
+IMAGE_ROOTFS[doc] = "The location of the root filesystem while it is under construction (i.e. during do_rootfs)."
+IMAGE_ROOTFS_EXTRA_SPACE[doc] = "Defines additional free disk space created in the image in Kbytes. By default, this variable is set to '0'."
+IMAGE_ROOTFS_SIZE[doc] = "Defines the size in Kbytes for the generated image."
+IMAGE_TYPES[doc] = "Specifies the complete list of supported image types by default."
+INC_PR[doc] = "Helps define the recipe revision for recipes that share a common include file."
+INCOMPATIBLE_LICENSE[doc] = "Specifies a space-separated list of license names (as they would appear in LICENSE) that should be excluded from the build. Wildcard is supported, such as '*GPLv3'"
+INHIBIT_DEFAULT_DEPS[doc] = "Prevents the default dependencies, namely the C compiler and standard C library (libc), from being added to DEPENDS."
+INHIBIT_PACKAGE_STRIP[doc] = "If set to "1", causes the build to not strip binaries in resulting packages."
+INHERIT[doc] = "Causes the named class to be inherited at this point during parsing. The variable is only valid in configuration files."
+INHERIT_DISTRO[doc] = "Lists classes that will be inherited at the distribution level. It is unlikely that you want to edit this variable."
+INITRAMFS_FSTYPES[doc] = "Defines the format for the output image of an initial RAM disk (initramfs), which is used during boot."
+INITRD[doc] = "Indicates a list of filesystem images to concatenate and use as an initial RAM disk (initrd)."
+INITSCRIPT_NAME[doc] = "The filename of the initialization script as installed to ${sysconfdir}/init.d."
+INITSCRIPT_PACKAGES[doc] = "A list of the packages that contain initscripts. This variable is used in recipes when using update-rc.d.bbclass. The variable is optional and defaults to the PN variable."
+INITSCRIPT_PARAMS[doc] = "Specifies the options to pass to update-rc.d. The variable is mandatory and is used in recipes when using update-rc.d.bbclass."
+INSANE_SKIP[doc] = "Specifies the QA checks to skip for a specific package within a recipe."
+IPK_FEED_URIS[doc] = "List of ipkg feed records to put into generated image."
+
+#K
+
+KARCH[doc] = "Defines the kernel architecture used when assembling the configuration. You define the KARCH variable in the BSP Descriptions."
+KBRANCH[doc] = "A regular expression used by the build process to explicitly identify the kernel branch that is validated, patched and configured during a build."
+KBRANCH_DEFAULT[doc] = "Defines the Linux kernel source repository's default branch used to build the Linux kernel. Unless you specify otherwise, the variable initializes to 'master'."
+KERNEL_CLASSES[doc] = "A list of classes defining kernel image types that kernel class should inherit."
+KERNEL_EXTRA_ARGS[doc] = "Specifies additional make command-line arguments the OpenEmbedded build system passes on when compiling the kernel."
+KERNEL_FEATURES[doc] = "Includes additional metadata from the Yocto Project kernel Git repository. The metadata you add through this variable includes config fragments and features descriptions."
+KERNEL_IMAGETYPE[doc] = "The type of kernel to build for a device, usually set by the machine configuration files and defaults to 'zImage'."
+KERNEL_IMAGETYPES[doc] = "The list of types of kernel to build for a device, usually set by the machine configuration files and defaults to KERNEL_IMAGETYPE."
+KERNEL_MODULE_AUTOLOAD[doc] = "Lists kernel modules that need to be auto-loaded during boot"
+KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules"
+KERNEL_PACKAGE_NAME[doc] = "Name prefix for kernel packages. Defaults to 'kernel'."
+KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+KERNEL_SRC[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+KFEATURE_DESCRIPTION[doc] = "Provides a short description of a configuration fragment. You use this variable in the .scc file that describes a configuration fragment file."
+KMACHINE[doc] = "The machine as known by the kernel."
+KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+
+#L
+
+LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, upon which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+LAYERDIR[doc] = "When used inside the layer.conf configuration file, this variable provides the path of the current layer."
+LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+LEAD_SONAME[doc] = "Specifies the lead (or primary) compiled library file (.so) that the debian class applies its naming policy to given a recipe that packages multiple libraries."
+LIC_FILES_CHKSUM[doc] = "Checksums of the license text in the recipe source code."
+LICENSE[doc] = "The list of source licenses for the recipe. Logical operators '&' or '|' and parentheses can be used."
+LICENSE_PATH[doc] = "Path to additional licenses used during the build."
+LINUX_KERNEL_TYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+LINUX_VERSION[doc] = "The Linux version from kernel.org on which the Linux kernel image being built using the OpenEmbedded build system is based. You define this variable in the kernel recipe."
+LINUX_VERSION_EXTENSION[doc] = "A string extension compiled into the version string of the Linux kernel built with the OpenEmbedded build system. You define this variable in the kernel recipe."
+LOCALE_UTF8_IS_DEFAULT[doc] = "If set, locale names are renamed such that those lacking an explicit encoding (e.g. en_US) will always be UTF-8, and non-UTF-8 encodings are renamed to, e.g., en_US.ISO-8859-1. Otherwise, the encoding is specified by glibc's SUPPORTED file. Not supported for precompiled locales."
+LOG_DIR[doc] = "Specifies the directory to which the OpenEmbedded build system writes overall log files. The default directory is ${TMPDIR}/log"
+
+#M
+
+MACHINE[doc] = "Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory."
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS[doc] = "A list of required machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot."
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS[doc] = "A list of recommended machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot."
+MACHINE_EXTRA_RDEPENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for the machine to boot. However, the build process for more fully-featured images depends on the packages being present."
+MACHINE_EXTRA_RRECOMMENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for booting the machine. The image being built has no build dependencies on the packages in this list."
+MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE supports."
+MACHINE_FEATURES_BACKFILL[doc] = "Features to be added to MACHINE_FEATURES if not also present in MACHINE_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and is not intended to be user-configurable."
+MACHINE_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from MACHINE_FEATURES_BACKFILL that should not be backfilled (i.e. added to MACHINE_FEATURES) during the build."
+MACHINEOVERRIDES[doc] = "Lists overrides specific to the current machine. By default, this list includes the value of MACHINE."
+MAINTAINER[doc] = "The email address of the distribution maintainer."
+MIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+MLPREFIX[doc] = "Specifies a prefix has been added to PN to create a special version of a recipe or package, such as a Multilib version."
+MODULE_TARBALL_DEPLOY[doc] = "Controls creation of the modules-*.tgz file. Set this variable to "0" to disable creation of this file, which contains all of the kernel modules resulting from a kernel build."
+MULTIMACH_TARGET_SYS[doc] = "Separates files for different machines such that you can build for multiple target machines using the same output directories."
+
+#N
+
+NATIVELSBSTRING[doc] = "A string identifying the host distribution."
+NO_RECOMMENDATIONS[doc] = "When set to '1', no recommended packages will be installed. Realize that some recommended packages might be required for certain system functionality, such as kernel-modules. It is up to the user to add packages to IMAGE_INSTALL as needed."
+NOHDD[doc] = "Causes the OpenEmbedded build system to skip building the .hddimg image."
+NOISO[doc] = "Causes the OpenEmbedded build system to skip building the ISO image."
+
+#O
+
+OE_BINCONFIG_EXTRA_MANGLE[doc] = "When a recipe inherits the binconfig.bbclass class, this variable specifies additional arguments passed to the "sed" command."
+OE_IMPORTS[doc] = "An internal variable used to tell the OpenEmbedded build system what Python modules to import for every Python function run by the system."
+OE_TERMINAL[doc] = "Controls how the OpenEmbedded build system spawns interactive terminals on the host development system."
+OEROOT[doc] = "The directory from which the top-level build environment setup script is sourced."
+OLDEST_KERNEL[doc] = "Declares the oldest version of the Linux kernel that the produced binaries must support."
+OVERRIDES[doc] = "BitBake uses OVERRIDES to control what variables are overridden after BitBake parses recipes and configuration files."
+
+#P
+
+P[doc] = "The recipe name and version. P is comprised of ${PN}-${PV}."
+PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
+PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
+PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
+PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
+PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
+PACKAGE_GROUP[doc] = "Defines one or more packages to include in an image when a specific item is included in IMAGE_FEATURES."
+PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
+PACKAGE_INSTALL_ATTEMPTONLY[doc] = "List of packages attempted to be installed. If a listed package fails to install, the build system does not generate an error. This variable is generally not user-defined."
+PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
+PACKAGES[doc] = "The list of packages to be created from the recipe."
+PACKAGES_DYNAMIC[doc] = "A promise that your recipe satisfies runtime dependencies for optional modules that are found in other recipes."
+PARALLEL_MAKE[doc] = "Specifies extra options that are passed to the make command during the compile tasks. This variable is usually in the form -j 4, where the number represents the maximum number of parallel threads make can run."
+PARALLEL_MAKEINST[doc] = "Extra options passed to the make install command during the do_install task in order to specify parallel installation."
+PATCHRESOLVE[doc] = "Enable or disable interactive patch resolution."
+PATCHTOOL[doc] = "Specifies the utility used to apply patches for a recipe during do_patch."
+PE[doc] = "The epoch of the recipe. The default value is '0'. The field is used to make upgrades possible when the versioning scheme changes in some backwards incompatible way."
+PF[doc] = "Specifies the recipe or package name and includes all version and revision numbers. This variable is comprised of ${PN}-${EXTENDPE}${PV}-${PR}."
+PIXBUF_PACKAGES[doc] = "When a recipe inherits the pixbufcache class, this variable identifies packages that contain the pixbuf loaders used with gdk-pixbuf."
+PKGD[doc] = "Points to the destination directory for files to be packaged before they are split into individual packages."
+PKGDATA_DIR[doc] = "Points to a shared, global-state directory that holds data generated during the packaging process."
+PKGDEST[doc] = "Points to the parent directory for files to be packaged after they have been split into individual packages."
+PKGDESTWORK[doc] = "Points to a temporary work area used by the do_package task to write output from the do_packagedata task."
+PN[doc] = "PN refers to a recipe name in the context of a file used by the OpenEmbedded build system as input to create a package. It refers to a package name in the context of a file created or produced by the OpenEmbedded build system."
+PNBLACKLIST[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
+PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'."
+PREFERRED_PROVIDER[doc] = "If multiple recipes provide an item, this variable determines which recipe should be given preference."
+PREFERRED_VERSION[doc] = "If there are multiple versions of recipes available, this variable determines which recipe should be given preference."
+PREMIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+PRIORITY[doc] = "Indicates the importance of a package. The default value is 'optional'. Other standard values are 'required', 'standard' and 'extra'."
+PROVIDES[doc] = "A list of aliases that a recipe also provides. These aliases are useful for satisfying dependencies of other recipes during the build as specified by DEPENDS."
+PRSERV_HOST[doc] = "The network based PR service host and port."
+PV[doc] = "The version of the recipe. The version is normally extracted from the recipe filename."
+PYPI_PACKAGE[doc] = "The python package name to use for fetching from pypi. Default is parsed from the recipe name, but can be overridden if upstream name is different than recipe name."
+PYPI_PACKAGE_EXT[doc] = "The archive file extension to use for fetching from pypi. Default is tar.gz, but can be overridden if upstream uses a different compression scheme."
+PYPI_SRC_URI[doc] = "The URI to use to fetch from pypi, default uses pythonhosted.org and is constructed from PYPI_PACKAGE, PYPI_PACKAGE_EXT and PV."
+
+#Q
+
+QMAKE_PROFILES[doc] = "Specifies your own subset of .pro files to be built for use with qmake."
+
+#R
+
+RCONFLICTS[doc] = "The list of packages that conflict with another package. Note that the package will not be installed if the conflicting packages are not first removed."
+RDEPENDS[doc] = "Lists a package's runtime dependencies (i.e. other packages) that must be installed for the package to be built. They must be the names of other packages as listed in the PACKAGES variable, not recipe names (PN)."
+REQUIRED_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that must exist in the current configuration in order for the OpenEmbedded build system to build the recipe."
+RM_WORK_EXCLUDE[doc] = "With rm_work enabled, this variable specifies a list of packages whose work directories should not be removed."
+ROOTFS[doc] = "Indicates a filesystem image to include as the root filesystem."
+ROOTFS_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the root filesystem."
+RPROVIDES[doc] = "A list of package name aliases that a package also provides. These aliases are useful for satisfying runtime dependencies of other packages both during the build and on the target."
+RRECOMMENDS[doc] = "A list of packages that extends the usability of a package being built. The package being built does not depend on this list of packages in order to successfully build, but needs them for the extended usability."
+RREPLACES[doc] = "A list of packages replaced by a package. The package manager uses this variable to determine which package should be installed to replace other package(s) during an upgrade."
+RSUGGESTS[doc] = "A list of additional packages that you can suggest for installation by the package manager at the time a package is installed. Not all package managers support this functionality."
+
+#S
+
+S[doc] = "The location in the Build Directory where unpacked package source code resides."
+SANITY_TESTED_DISTROS[doc] = "A list of the host distribution identifiers that the build system has been tested against."
+SDK_ARCH[doc] = "The target architecture for the SDK."
+SDK_DEPLOY[doc] = "The directory set up and used by the populate_sdk_base to which the SDK is deployed."
+SDK_DIR[doc] = "The parent directory used by the OpenEmbedded build system when creating SDK output."
+SDK_NAME[doc] = "The base name for SDK output files."
+SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build system when creating SDK output."
+SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However, this variable applies to the SDK generated from an image using the command 'bitbake -c populate_sdk imagename'."
+SDKMACHINE[doc] = "Specifies the architecture (i.e. i686 or x86_64) for which to build SDK and ADT items."
+SECTION[doc] = "The section in which packages should be categorized. Package management utilities can make use of this variable."
+SELECTED_OPTIMIZATION[doc] = "The variable takes the value of FULL_OPTIMIZATION unless DEBUG_BUILD = '1'. In this case, the value of DEBUG_OPTIMIZATION is used."
+SERIAL_CONSOLE[doc] = "The speed and device for the serial port used to attach the serial console. This variable is given to the kernel as the 'console' parameter. After booting occurs, getty is started on that port so remote login is possible."
+SERIAL_CONSOLES[doc] = "Defines the serial consoles (TTYs) to enable using getty."
+SERIAL_CONSOLES_CHECK[doc] = "Similar to SERIAL_CONSOLES except the device is checked for existence before attempting to enable it. Supported only by SysVinit."
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that should not be used to determine signatures of tasks from one recipe when they depend on tasks from another recipe."
+SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
+SITEINFO_BITS[doc] = "Specifies the number of bits for the target system CPU."
+SITEINFO_ENDIANNESS[doc] = "Specifies the endian byte order of the target system. The value should be either 'le' for 'little-endian' or 'be' for 'big-endian'."
+SOC_FAMILY[doc] = "Groups together machines based upon the same family of SOC (System On Chip). You typically set this variable in a common .inc file that you include in the configuration files of all the machines."
+SOLIBS[doc] = "Defines the suffix for shared libraries used on the target platform."
+SOLIBSDEV[doc] = "Defines the suffix for the development symbolic link (symlink) for shared libraries on the target platform."
+SOURCE_MIRROR_FETCH[doc] = "Switch marking build as source fetcher. Used to skip COMPATIBLE_* checking."
+SOURCE_MIRROR_URL[doc] = "URL to source mirror that will be used before fetching from original SRC_URI."
+SPECIAL_PKGSUFFIX[doc] = "A list of prefixes for PN used by the OpenEmbedded build system to create variants of recipes or packages. The list specifies the prefixes to strip off during certain circumstances such as the generation of the BPN variable."
+SRC_URI[doc] = "The list of source files - local or remote. This variable tells the OpenEmbedded build system what bits to pull in for the build and how to pull them in."
+SRC_URI_OVERRIDES_PACKAGE_ARCH[doc] = "By default, the OpenEmbedded build system automatically detects whether SRC_URI contains files that are machine-specific. If so, the build system automatically changes PACKAGE_ARCH. Setting this variable to '0' disables this behavior."
+SRCDATE[doc] = "The date of the source code used to build the package. This variable applies only if the source was fetched from a Source Code Manager (SCM)."
+SRCPV[doc] = "Returns the version string of the current package. This string is used to help define the value of PV."
+SRCREV[doc] = "The revision of the source code used to build the package. This variable applies to Subversion, Git, Mercurial and Bazaar only."
+SSTATE_DIR[doc] = "The directory for the shared state cache."
+SSTATE_MIRRORS[doc] = "Configures the OpenEmbedded build system to search other mirror locations for prebuilt cache data objects before building out the data. You can specify a filesystem directory or a remote URL such as HTTP or FTP."
+STAGING_KERNEL_DIR[doc] = "The directory with kernel headers that are required to build out-of-tree modules."
+STAMP[doc] = "Specifies the base path used to create recipe stamp files. The path to an actual stamp file is constructed by evaluating this string and then appending additional information."
+STAMPS_DIR[doc] = "Specifies the base directory in which the OpenEmbedded build system places stamps."
+SUMMARY[doc] = "The short (80 characters or less) summary of the binary package for packaging systems such as opkg, rpm or dpkg. By default, SUMMARY is used to define the DESCRIPTION variable if DESCRIPTION is not set in the recipe."
+SVNDIR[doc] = "The directory where Subversion checkouts will be stored."
+SYSLINUX_DEFAULT_CONSOLE[doc] = "Specifies the kernel boot default console."
+SYSLINUX_OPTS[doc] = "Lists additional options to add to the syslinux file."
+SYSLINUX_SERIAL[doc] = "Specifies the alternate serial port or turns it off."
+SYSLINUX_SPLASH[doc] = "An .LSS file used as the background for the VGA boot menu when you are using the boot menu."
+SYSLINUX_SERIAL_TTY[doc] = "Specifies the alternate console=tty... kernel boot argument."
+SYSROOT_PREPROCESS_FUNCS[doc] = "A list of functions to execute after files are staged into the sysroot. These functions are usually used to apply additional processing on the staged files, or to stage additional files."
+SYSTEMD_AUTO_ENABLE[doc] = "For recipes that inherit the systemd class, this variable specifies whether the service you have specified in SYSTEMD_SERVICE should be started automatically or not."
+SYSTEMD_PACKAGES[doc] = "For recipes that inherit the systemd class, this variable locates the systemd unit files when they are not found in the main recipe's package."
+SYSTEMD_SERVICE[doc] = "For recipes that inherit the systemd class, this variable specifies the systemd service name for a package."
+SYSVINIT_ENABLED_GETTYS[doc] = "Specifies which virtual terminals should be running a getty, the default is '1'."
+
+#T
+
+T[doc] = "This variable points to a directory were BitBake places temporary files, which consist mostly of task logs and scripts, when building a particular recipe."
+TARGET_ARCH[doc] = "The architecture of the device being built. The OpenEmbedded build system supports the following architectures: arm, mips, ppc, x86, x86-64."
+TARGET_CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as CFLAGS."
+TARGET_FPU[doc] = "Specifies the method for handling FPU code. For FPU-less targets, which include most ARM CPUs, the variable must be set to 'soft'. If not, the kernel emulation gets used, which results in a performance penalty."
+TARGET_OS[doc] = "Specifies the target's operating system."
+TARGET_PREFIX[doc] = "The prefix for the cross-compile toolchain (e.g. arm-linux-)."
+TARGET_SYS[doc] = "The target system is comprised of TARGET_ARCH,TARGET_VENDOR and TARGET_OS."
+TCLIBC[doc] = "Specifies C library (libc) variant to use during the build process. You can select 'baremetal', 'glibc' or 'musl'."
+TCMODE[doc] = "Enables an external toolchain (where provided by an additional layer) if set to a value other than 'default'."
+TEST_IMAGE[doc] = "Enables test booting of virtual machine images under the QEMU emulator after any root filesystems are created and runs tests against those images."
+TEST_QEMUBOOT_TIMEOUT[doc] = "The time in seconds allowed for an image to boot before automated runtime tests begin to run against an image."
+TEST_SUITES[doc] = "An ordered list of tests (modules) to run against an image when performing automated runtime testing."
+TEST_POWERCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to control the power of the target machine under test"
+TEST_POWERCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_POWERCONTROL_CMD"
+TEST_SERIALCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to connect to the serial console of the target machine under test"
+TEST_SERIALCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_SERIALCONTROL_CMD"
+TEST_TARGET[doc] = "For automated runtime testing, specifies the method of deploying the image and running tests on the target machine"
+THISDIR[doc] = "The directory in which the file BitBake is currently parsing is located."
+TIME[doc] = "The time the build was started using HMS format."
+TMPDIR[doc] = "The temporary directory the OpenEmbedded build system uses when it does its work building images. By default, the TMPDIR variable is named tmp within the Build Directory."
+TOOLCHAIN_HOST_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when building an SDK, which contains a cross-development environment."
+TOOLCHAIN_TARGET_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when it creates the target part of an SDK, which includes libraries and headers."
+TOPDIR[doc] = "The Build Directory. BitBake automatically sets this variable. The OpenEmbedded build system uses the Build Directory when building images."
+TRANSLATED_TARGET_ARCH[doc] = "A sanitized version of TARGET_ARCH. This variable is used where the architecture is needed in a value where underscores are not allowed."
+TUNE_PKGARCH[doc] = "The package architecture understood by the packaging system to define the architecture, ABI, and tuning of output packages."
+TUNEABI[doc] = "An underlying ABI used by a particular tuning in a given toolchain layer. This feature allows providers using prebuilt libraries to check compatibility of a tuning against their selection of libraries."
+TUNEABI_OVERRIDE[doc] = "If set, ignores TUNEABI_WHITELIST."
+TUNEABI_WHITELIST[doc] = "A whitelist of permissible TUNEABI values. If the variable is not set, all values are allowed."
+TUNECONFLICTS[doc] = "List of conflicting features for a given feature."
+TUNEVALID[doc] = "Descriptions, stored as flags, of valid tuning features."
+
+#U
+
+UBOOT_CONFIG[doc] = "Configures the UBOOT_MACHINE and can also define IMAGE_FSTYPES for individual cases."
+UBOOT_ENTRYPOINT[doc] = "Specifies the entry point for the U-Boot image."
+UBOOT_LOADADDRESS[doc] = "Specifies the load address for the U-Boot image."
+UBOOT_LOCALVERSION[doc] = "Appends a string to the name of the local version of the U-Boot image."
+UBOOT_MACHINE[doc] = "Specifies the value passed on the make command line when building a U-Boot image."
+UBOOT_MAKE_TARGET[doc] = "Specifies the target called in the Makefile."
+UBOOT_SUFFIX[doc] = "Points to the generated U-Boot extension."
+UBOOT_TARGET[doc] = "Specifies the target used for building U-Boot."
+USE_DEVFS[doc] = "When building images, specifies to populate or not /dev. This variable defaults to '1' (leave directory empty, surely because devtmpfs do the job). Set it to '0' to use makedevs (or consider using a custom file with IMAGE_DEVICE_TABLES)."
+USER_CLASSES[doc] = "List of additional classes to use when building images that enable extra features."
+USERADD_ERROR_DYNAMIC[doc] = "If set to 'error', forces the OpenEmbedded build system to produce an error if the user identification (uid) and group identification (gid) values are not defined in any of the files listed in USERADD_UID_TABLES and USERADD_GID_TABLES. If set to 'warn', a warning will be issued instead."
+USERADD_GID_TABLES[doc] = "Specifies a password file to use for obtaining static group identification (gid) values when the OpenEmbedded build system adds a group to the system during package installation."
+USERADD_PACKAGES[doc] = "When a recipe inherits the useradd class, this variable specifies the individual packages within the recipe that require users and/or groups to be added."
+USERADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the useradd command if you wish to add a user to the system when the package is installed."
+USERADD_UID_TABLES[doc] = "Specifies a password file to use for obtaining static user identification (uid) values when the OpenEmbedded build system adds a user to the system during package installation."
+USERADDEXTENSION[doc] = "When set to 'useradd-staticids', causes the OpenEmbedded build system to base all user and group additions on files listed in USERADD_UID_TABLES and USERADD_GID_TABLES."
+
+#W
+
+WARN_QA[doc] = "Specifies the quality assurance checks whose failures are reported as warnings by the OpenEmbedded build system."
+WORKDIR[doc] = "The pathname of the working directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and changes as different packages are built."
diff --git a/poky/meta/conf/layer.conf b/poky/meta/conf/layer.conf
new file mode 100644
index 000000000..315fb936f
--- /dev/null
+++ b/poky/meta/conf/layer.conf
@@ -0,0 +1,82 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb"
+
+BBFILE_COLLECTIONS += "core"
+BBFILE_PATTERN_core = "^${LAYERDIR}/"
+BBFILE_PRIORITY_core = "5"
+
+LAYERSERIES_CORENAMES = "sumo"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_core = "11"
+LAYERSERIES_COMPAT_core = "sumo"
+
+BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core"
+
+# Set a variable to get to the top of the metadata location
+COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
+
+# opkg-utils is for update-alternatives :(
+SIGGEN_EXCLUDERECIPES_ABISAFE += " \
+ sysvinit-inittab \
+ busybox-inittab \
+ shadow-securetty \
+ opkg-arch-config \
+ netbase \
+ init-ifupdown \
+ connman-conf \
+ formfactor \
+ xserver-xf86-config \
+ pointercal-xinput \
+ base-files \
+ keymaps \
+ udev-extraconf \
+ packagegroup-x11-xserver \
+ systemd-serialgetty \
+ initscripts \
+ shadow \
+ shadow-sysroot \
+ base-passwd \
+ opkg-utils \
+ gstreamer1.0-meta-base \
+ ca-certificates \
+"
+
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
+ *->quilt-native \
+ *->subversion-native \
+ *->git-native \
+ *->ccache-native \
+ *->icecc-create-env-native \
+ gcc-cross-${TARGET_ARCH}->virtual/${TARGET_PREFIX}libc-for-gcc \
+ gcc-cross-${TARGET_ARCH}->linux-libc-headers \
+ ppp-dialin->ppp \
+ resolvconf->bash \
+ docbook-xsl-stylesheets->perl \
+ ca-certificates->openssl \
+ initramfs-framework->${VIRTUAL-RUNTIME_base-utils} \
+ initramfs-framework->eudev \
+ initramfs-framework->systemd \
+ initramfs-module-install-efi->dosfstools \
+ initramfs-module-install-efi->e2fsprogs \
+ initramfs-module-install-efi->parted \
+ initramfs-module-install-efi->util-linux \
+ initramfs-module-install->e2fsprogs \
+ initramfs-module-install->grub \
+ initramfs-module-install->parted \
+ initramfs-module-install->util-linux \
+ grub-efi->grub-bootconf \
+ liberation-fonts->fontconfig \
+ cantarell-fonts->fontconfig \
+ gnome-icon-theme->librsvg \
+ font-alias->font-util \
+ systemd-boot->systemd-bootconf \
+ weston-init->weston \
+ weston-init->kbd \
+"
+
+# We need to keep bitbake tools in PATH
+PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${HOSTTOOLS_DIR}"
diff --git a/poky/meta/conf/licenses.conf b/poky/meta/conf/licenses.conf
new file mode 100644
index 000000000..3e2d2589a
--- /dev/null
+++ b/poky/meta/conf/licenses.conf
@@ -0,0 +1,192 @@
+# These aren't actually used anywhere that I can tell
+# They may be in the future (or are used by someone else
+# For completion sake, I've updated them
+SRC_DISTRIBUTE_LICENSES += "AAL Adobe AFL-1.2 AFL-2.0 AFL-2.1 AFL-3.0"
+SRC_DISTRIBUTE_LICENSES += "AGPL-3.0 ANTLR-PD Apache-1.0 Apache-1.1 Apache-2.0"
+SRC_DISTRIBUTE_LICENSES += "APL-1.0 APSL-1.0 APSL-1.1 APSL-1.2 APSL-2.0"
+SRC_DISTRIBUTE_LICENSES += "Artistic-1.0 Artistic-2.0 BitstreamVera BSD"
+SRC_DISTRIBUTE_LICENSES += "BSD-2-Clause BSD-3-Clause BSD-4-Clause BSL-1.0"
+SRC_DISTRIBUTE_LICENSES += "CATOSL-1.1 CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-3.0 CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-3.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-SA-1.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.5 CC-BY-SA-3.0"
+SRC_DISTRIBUTE_LICENSES += "CDDL-1.0 CECILL-1.0 CECILL-2.0 CECILL-B CECILL-C"
+SRC_DISTRIBUTE_LICENSES += "ClArtistic CPAL-1.0 CPL-1.0 CUA-OPL-1.0 DSSSL"
+SRC_DISTRIBUTE_LICENSES += "ECL-1.0 ECL-2.0 eCos-2.0 EDL-1.0 EFL-1.0 EFL-2.0"
+SRC_DISTRIBUTE_LICENSES += "Elfutils-Exception Entessa EPL-1.0 ErlPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "EUDatagrid EUPL-1.0 EUPL-1.1 Fair Frameworx-1.0"
+SRC_DISTRIBUTE_LICENSES += "FreeType GFDL-1.1 GFDL-1.2 GFDL-1.3 GPL-1.0"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0 GPL-2.0-with-autoconf-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-classpath-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-font-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-GCC-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2-with-bison-exception GPL-3.0"
+SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-autoconf-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-GCC-exception"
+SRC_DISTRIBUTE_LICENSES += "gSOAP-1 gSOAP-1.3b HPND IPA IPL-1.0 ISC LGPL-2.0"
+SRC_DISTRIBUTE_LICENSES += "LGPL-2.1 LGPL-3.0 Libpng LPL-1.02 LPPL-1.0 LPPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "LPPL-1.2 LPPL-1.3c MirOS MIT Motosoto MPL-1.0"
+SRC_DISTRIBUTE_LICENSES += "MPL-1.1 MS-PL MS-RL Multics NASA-1.3 Nauman NCSA"
+SRC_DISTRIBUTE_LICENSES += "NGPL Nokia NPOSL-3.0 NTP OASIS OCLC-2.0 ODbL-1.0"
+SRC_DISTRIBUTE_LICENSES += "OFL-1.1 OGTSL OLDAP-2.8 OpenSSL OSL-1.0 OSL-2.0"
+SRC_DISTRIBUTE_LICENSES += "OSL-3.0 PD PHP-3.0 PostgreSQL Proprietary"
+SRC_DISTRIBUTE_LICENSES += "Python-2.0 QPL-1.0 RHeCos-1 RHeCos-1.1 RPL-1.5"
+SRC_DISTRIBUTE_LICENSES += "RPSL-1.0 RSCPL Ruby SAX-PD SGI-1 Simple-2.0 Sleepycat"
+SRC_DISTRIBUTE_LICENSES += "SPL-1.0 SugarCRM-1 SugarCRM-1.1.3 UCB VSL-1.0 W3C"
+SRC_DISTRIBUTE_LICENSES += "Watcom-1.0 WXwindows XFree86-1.0 XFree86-1.1 Xnet XSL YPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "Zimbra-1.3 Zlib ZPL-1.1 ZPL-2.0 ZPL-2.1"
+
+# Standards are great! Everyone has their own. In an effort to standardize licensing
+# names, common-licenses will use the SPDX standard license names. In order to not
+# break the non-standardized license names that we find in LICENSE, we'll set
+# up a bunch of VarFlags to accomodate non-SPDX license names.
+#
+# We should really discuss standardizing this field, but that's a longer term goal.
+# For now, we can do this and it should grab the most common LICENSE naming variations.
+#
+# We should NEVER have a GPL/LGPL without a version!!!!
+# Any mapping to MPL/LGPL/GPL should be fixed
+
+# AGPL variations
+SPDXLICENSEMAP[AGPL-3] = "AGPL-3.0"
+SPDXLICENSEMAP[AGPLv3] = "AGPL-3.0"
+SPDXLICENSEMAP[AGPLv3.0] = "AGPL-3.0"
+
+# GPL variations
+SPDXLICENSEMAP[GPL-1] = "GPL-1.0"
+SPDXLICENSEMAP[GPLv1] = "GPL-1.0"
+SPDXLICENSEMAP[GPLv1.0] = "GPL-1.0"
+SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
+SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"
+
+#LGPL variations
+SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
+SPDXLICENSEMAP[LGPLv2.0] = "LGPL-2.0"
+SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
+SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
+SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"
+
+#MPL variations
+SPDXLICENSEMAP[MPL-1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1.1] = "MPL-1.1"
+SPDXLICENSEMAP[MPLv2] = "MPL-2.0"
+
+#MIT variations
+SPDXLICENSEMAP[MIT-X] = "MIT"
+SPDXLICENSEMAP[MIT-style] = "MIT"
+
+#Openssl variations
+SPDXLICENSEMAP[openssl] = "OpenSSL"
+
+#Python variations
+SPDXLICENSEMAP[PSF] = "Python-2.0"
+SPDXLICENSEMAP[PSFv2] = "Python-2.0"
+SPDXLICENSEMAP[Python-2] = "Python-2.0"
+
+#Apache variations
+SPDXLICENSEMAP[Apachev2] = "Apache-2.0"
+SPDXLICENSEMAP[Apache-2] = "Apache-2.0"
+
+#Artistic variations
+SPDXLICENSEMAP[Artisticv1] = "Artistic-1.0"
+SPDXLICENSEMAP[Artistic-1] = "Artistic-1.0"
+
+#Academic variations
+SPDXLICENSEMAP[AFL-2] = "AFL-2.0"
+SPDXLICENSEMAP[AFL-1] = "AFL-1.2"
+SPDXLICENSEMAP[AFLv2] = "AFL-2.0"
+SPDXLICENSEMAP[AFLv1] = "AFL-1.2"
+
+#CDDL variations
+SPDXLICENSEMAP[CDDLv1] = "CDDL-1.0"
+SPDXLICENSEMAP[CDDL-1] = "CDDL-1.0"
+
+#Other variations
+SPDXLICENSEMAP[EPLv1.0] = "EPL-1.0"
+
+#Silicon Graphics variations
+SPDXLICENSEMAP[SGIv1] = "SGI-1"
+
+# Additional license directories. Add your custom licenses directories this path.
+# LICENSE_PATH += "${COREBASE}/custom-licenses"
+
+# Set if you want the license.manifest copied to the image
+#COPY_LIC_MANIFEST = "1"
+
+# If you want the pkg licenses copied over as well you must set
+# both COPY_LIC_MANIFEST and COPY_LIC_DIRS
+#COPY_LIC_DIRS = "1"
+
+## SPDX temporary directory
+SPDX_TEMP_DIR = "${WORKDIR}/spdx_temp"
+SPDX_MANIFEST_DIR = "/home/yocto/fossology_scans"
+
+## SPDX Format info
+SPDX_VERSION = "SPDX-1.1"
+DATA_LICENSE = "CC0-1.0"
+
+## Fossology scan information
+# You can set option to control if the copyright information will be skipped
+# during the identification process.
+#
+# FOSS_NO_COPYRIGHT = "true"
+# NO copyright will be processed. That means only license information will be
+# identified and output to SPDX file
+# FOSS_NO_COPYRIGHT = "false"
+# Copyright will be identified and output to SPDX file along with license
+# information. The process will take more time than not processing copyright
+# information.
+#
+
+FOSS_NO_COPYRIGHT = "true"
+
+# A option defined as[FOSS_RECURSIVE_UNPACK] in ./meta/conf/licenses.conf. is
+# used to control if FOSSology server need recursively unpack tar.gz file which
+# is sent from do_spdx task.
+#
+# FOSS_RECURSIVE_UNPACK = "false":
+# FOSSology server does NOT recursively unpack. In the current release, this
+# is the default choice because recursively unpack will not necessarily break
+# down original compressed files.
+# FOSS_RECURSIVE_UNPACK = "true":
+# FOSSology server recursively unpack components.
+#
+
+FOSS_RECURSIVE_UNPACK = "false"
+
+# An option defined as [FOSS_FULL_SPDX] in ./meta/conf/licenses.conf is used to
+# control what kind of SPDX output to get from the FOSSology server.
+#
+# FOSS_FULL_SPDX = "true":
+# Tell FOSSology server to return full SPDX output, like if the program was
+# run from the command line. This is needed in order to get license refs for
+# the full package rather than individual files only.
+#
+# FOSS_FULL_SPDX = "false":
+# Tell FOSSology to only process license information for files. All package
+# license tags in the report will be "NOASSERTION"
+#
+
+FOSS_FULL_SPDX = "true"
+
+# FOSSologySPDX instance server. http://localhost/repo is the default
+# installation location for FOSSology.
+#
+# For more information on FOSSologySPDX commandline:
+# https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-SPDX-Web-API
+#
+
+FOSS_BASE_URL = "http://localhost/repo/?mod=spdx_license_once"
+FOSS_SERVER = "${FOSS_BASE_URL}&fullSPDXFlag=${FOSS_FULL_SPDX}&noCopyright=${FOSS_NO_COPYRIGHT}&recursiveUnpack=${FOSS_RECURSIVE_UNPACK}"
+
+FOSS_WGET_FLAGS = "-qO - --no-check-certificate --timeout=0"
+
+
diff --git a/poky/meta/conf/machine-sdk/i586.conf b/poky/meta/conf/machine-sdk/i586.conf
new file mode 100644
index 000000000..41e5e159d
--- /dev/null
+++ b/poky/meta/conf/machine-sdk/i586.conf
@@ -0,0 +1,4 @@
+SDK_ARCH = "i586"
+SDK_CC_ARCH = "-march=i586"
+ABIEXTENSION_class-nativesdk = ""
+
diff --git a/poky/meta/conf/machine-sdk/i686.conf b/poky/meta/conf/machine-sdk/i686.conf
new file mode 100644
index 000000000..fe406972c
--- /dev/null
+++ b/poky/meta/conf/machine-sdk/i686.conf
@@ -0,0 +1,3 @@
+SDK_ARCH = "i686"
+SDK_CC_ARCH = "-march=i686"
+ABIEXTENSION_class-nativesdk = ""
diff --git a/poky/meta/conf/machine-sdk/x86_64.conf b/poky/meta/conf/machine-sdk/x86_64.conf
new file mode 100644
index 000000000..61439b4fb
--- /dev/null
+++ b/poky/meta/conf/machine-sdk/x86_64.conf
@@ -0,0 +1,2 @@
+SDK_ARCH = "x86_64"
+ABIEXTENSION_class-nativesdk = ""
diff --git a/poky/meta/conf/machine/include/README b/poky/meta/conf/machine/include/README
new file mode 100644
index 000000000..d66130acb
--- /dev/null
+++ b/poky/meta/conf/machine/include/README
@@ -0,0 +1,100 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+
+Introduction
+============
+The individual CPU, and ABI tunings are contained in this directory. A
+number of local and global variables are used to control the way the
+tunings are setup and how they work together to specify an optimized
+configuration.
+
+The following is brief summary of the generic components that are used
+in these tunings.
+
+AVAILTUNES - This is a list of all of the tuning definitions currently
+available in the system. Not all tunes in this list may be compatible
+with the machine configuration, or each other in a multilib
+configuration. Each tuning file can add to this list using "+=", but
+should never replace the list using "=".
+
+DEFAULTTUNE - This specifies the tune to use for a particular build.
+Each tune should specify a reasonable default, which can be overriden by
+a machine or multilib configuration. The specified tune must be listed
+in the AVAILTUNES.
+
+TUNEVALID[feature] - The <feature> is defined with a human readable
+explanation for what it does. All architectural, cpu, abi, etc tuning
+features must be defined using TUNEVALID.
+
+TUNECONFLICTS[feature] - A list of features which conflict with <feature>.
+New sanity checks will try to reject combinations in which a single
+tuning ends up with features which conflict with each other.
+
+TUNE_FEATURES - This is automatically defined as TUNE_FEATURES_tune-<tune>.
+See TUNE_FEATURES_tune-<tune> for more information.
+
+TUNE_FEATURES_tune-<tune> - Specify the features used to describe a
+specific tune. This is a list of features that a tune support, each
+feature must be in the TUNEVALID list. Note: the tune and a given
+feature name may be the same, but they have different purposes. Only
+features may be used to change behavior, while tunes are used to
+describe an overall set of features.
+
+ABIEXTENSION - An ABI extension may be specified by a specific feature
+or other tuning setting, such as TARGET_FPU. Any ABI extensions either
+need to be defined in the architectures base arch file, i.e.
+ABIEXTENSION = "eabi" in the arm case, or appended to in specific tune
+files with a ".=". Spaces are not allowed in this variable.
+
+TUNE_CCARGS - Setup the cflags based on the TUNE_FEATURES settings.
+These should be additive when defined using "+=". All items in this
+list should be dynamic! i.e.
+${@bb.utils.contains("TUNE_FEATURES", "feature", "cflag", "!cflag", d)}
+
+TUNE_ARCH - The GNU canonical arch for a specific architecture. i.e.
+arm, armeb, mips, mips64, etc. This value is used by bitbake to setup
+configure. TUNE_ARCH definitions are specific to a given architecture.
+They may be a single static definition, or may be dynamically adjusted.
+See each architecture's README for details for that CPU family.
+
+TUNE_PKGARCH - The package architecture used by the packaging systems to
+define the architecture, abi and tuning of a particular package.
+Similarly to TUNE_ARCH, the definition of TUNE_PKGARCH is specific to
+each architecture. See each architectures README for details for that
+CPU family.
+
+PACKAGE_EXTRA_ARCHS - Lists all runtime compatible package
+architectures. By default this is equal to
+PACKAGE_EXTRA_ARCHS_tune-<tune>. If an architecture deviates from the
+default it will be listed in the architecture README.
+
+PACKAGE_EXTRA_ARCHS_tune-<tune> - List all of the package architectures
+that are compatible with this specific tune. The package arch of this
+tune must be in the list.
+
+TARGET_FPU - The FPU setting for a given tune, hard (generate floating
+point instructions), soft (generate internal gcc calls), "other"
+architecture specific floating point. This is synchronized with the
+compiler and other toolchain items. This should be dynamically
+configured in the same way that TUNE_CCARGS is.
+
+BASE_LIB_tune-<tune> - The "/lib" location for a specific ABI. This is
+used in a multilib configuration to place the libraries in the correct,
+non-conflicting locations.
+
+
+Best Practice
+=============
+The tune infrastructure is designed to be hierarchical. When writing a
+new tune file for a "fast-forward" CPU architecture (one that supports
+everything from a previous generation), it is recommended to require the
+previous generation tune file and specify PACKAGE_EXTRA_ARCHS using the
+previous generation's override and appending the new tune. Note that
+only one previous tune file should be included to avoid mutiple includes
+of the base arch which could lead to a broken configuration due to
+multiple prepend and append assignments.
+
+For example, for x86, there is a common x86/arch-x86.inc which is
+included in the base i586 tune file. The core2 tune builds
+on that, and corei7 builds on core2.
diff --git a/poky/meta/conf/machine/include/arm/README b/poky/meta/conf/machine/include/arm/README
new file mode 100644
index 000000000..a1beb75fd
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/README
@@ -0,0 +1,40 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+The ARM architecture definitions are split among a number of files.
+The primary definitions for the variables are handled by the core
+arch-arm.inc file.
+
+TUNE_ARCH is set to either "arm" or "armeb" depending on the value
+of the existence of the "bigendian" feature in a given tune.
+
+A small set of ARM specific variables have been defined to allow
+TUNE_PKGARCH to be automatically defined. Optimized tunings must NOT
+change the definiton of TUNE_PKGARCH. TUNE_PKGACH_tune-<tune> will be
+ignored. The format of the package arch is enforced by the TUNE_PKGARCH
+default. The format must be of the form:
+<armversion>[t][e][hf][b][-vfp][-neon]
+
+TUNE_PKGARCH is defined as:
+${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}
+
+ARMPKGARCH - This is the core package arch component specified by each
+tuning. This is the primary identifier of a tuning. Usual values are:
+arm, armv4, armv5, armv6, armv7a, etc.
+
+ARMPKGSFX_THUMB - This is the thumb specific suffix. Curently it is
+defined in feature-arm-thumb.inc.
+
+ARMPKGSFX_DSP - This is the DSP specific suffix. Currently this is set
+to 'e' when on armv5 and the dsp feature is enabled.
+
+ARMPKGSFX_EABI - This is the eabi specific suffix. There are currently
+two defined ABIs specificed, standard EABI and Hard Float (VFP) EABI.
+When the callconvention-hard is enabled, "hf" is specified, otherwise it
+is blank.
+
+ARMPKGSFX_ENDIAN - This is the endian specific suffix. It is defined in
+the core arch-arm.inc file.
+
+ARMPKGSFX_FPU - This is the FPU specific suffix. The suffix indicates
+specific FPU optimizations. 'vfp' and 'neon' are both defined.
diff --git a/poky/meta/conf/machine/include/arm/arch-arm.inc b/poky/meta/conf/machine/include/arm/arch-arm.inc
new file mode 100644
index 000000000..99625d841
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-arm.inc
@@ -0,0 +1,16 @@
+
+TUNEVALID[bigendian] = "Enable big-endian mode."
+
+ARMPKGARCH = "${ARMPKGARCH_tune-${DEFAULTTUNE}}"
+ARMPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'b', '', d)}"
+ARMPKGSFX_FPU ??= ""
+ARMPKGSFX_DSP ??= ""
+ARMPKGSFX_EABI ??= ""
+ARMPKGSFX_THUMB ??= ""
+
+TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'armeb', 'arm', d)}"
+TUNE_PKGARCH = "${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}"
+
+ABIEXTENSION = "eabi"
+
+TARGET_FPU = "${@d.getVar('TUNE_CCARGS_MFLOAT') or 'soft'}"
diff --git a/poky/meta/conf/machine/include/arm/arch-arm64.inc b/poky/meta/conf/machine/include/arm/arch-arm64.inc
new file mode 100644
index 000000000..5f90763f7
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-arm64.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "aarch64"
+
+require conf/machine/include/arm/arch-armv7ve.inc
+
+TUNEVALID[aarch64] = "Enable instructions for aarch64"
+
+MACHINEOVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ':aarch64', '' ,d)}"
+
+# Little Endian base configs
+AVAILTUNES += "aarch64 aarch64_be"
+ARMPKGARCH_tune-aarch64 ?= "aarch64"
+ARMPKGARCH_tune-aarch64_be ?= "aarch64_be"
+TUNE_FEATURES_tune-aarch64 = "aarch64"
+TUNE_FEATURES_tune-aarch64_be = "${TUNE_FEATURES_tune-aarch64} bigendian"
+BASE_LIB_tune-aarch64 = "lib64"
+BASE_LIB_tune-aarch64_be = "lib64"
+
+PACKAGE_EXTRA_ARCHS_tune-aarch64 = "aarch64"
+PACKAGE_EXTRA_ARCHS_tune-aarch64_be = "aarch64_be"
+
+ARMPKGSFX_ENDIAN_64 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '_be', '', d)}"
+TUNE_ARCH_64 = "aarch64${ARMPKGSFX_ENDIAN_64}"
+TUNE_PKGARCH_64 = "aarch64${ARMPKGSFX_ENDIAN_64}"
+ABIEXTENSION_64 = ""
+TARGET_FPU_64 = ""
+
+# Duplicated from arch-arm.inc
+TUNE_ARCH_32 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'armeb', 'arm', d)}"
+TUNE_PKGARCH_32 = "${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}"
+ABIEXTENSION_32 = "eabi"
+TARGET_FPU_32 = "${@d.getVar('TUNE_CCARGS_MFLOAT') or 'soft'}"
+
+TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_ARCH_64}', '${TUNE_ARCH_32}' ,d)}"
+TUNE_PKGARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_PKGARCH_64}', '${TUNE_PKGARCH_32}' ,d)}"
+ABIEXTENSION = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${ABIEXTENSION_64}', '${ABIEXTENSION_32}' ,d)}"
+TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}', '${TARGET_FPU_32}' ,d)}"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv4.inc b/poky/meta/conf/machine/include/arm/arch-armv4.inc
new file mode 100644
index 000000000..813ed159d
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv4.inc
@@ -0,0 +1,34 @@
+DEFAULTTUNE ?= "armv4"
+
+TUNEVALID[arm] = "Enable ARM instruction set"
+TUNEVALID[armv4] = "Enable instructions for ARMv4"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4', ' -march=armv4${ARMPKGSFX_THUMB}', '', d)}"
+# enable --fix-v4bx when we have armv4 in TUNE_FEATURES, but then disable it when we have also armv5 or thumb
+# maybe we should extend bb.utils.contains to support check for any checkvalues in value, now it does
+# checkvalues.issubset(val) which cannot be used for negative test of foo neither bar in value
+FIX_V4BX_ARMV4 = "${@bb.utils.contains('TUNE_FEATURES', 'armv4', '--fix-v4bx', '', d)}"
+FIX_V4BX_ARMV5 = "${@bb.utils.contains('TUNE_FEATURES', 'armv5', '', '${FIX_V4BX_ARMV4}', d)}"
+FIX_V4BX = "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '', '${FIX_V4BX_ARMV5}', d)}"
+TARGET_LD_KERNEL_ARCH += "${FIX_V4BX}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv4', 'armv4:', '' ,d)}"
+
+require conf/machine/include/arm/arch-arm.inc
+require conf/machine/include/arm/feature-arm-thumb.inc
+
+# Little Endian
+AVAILTUNES += "armv4 armv4t"
+ARMPKGARCH_tune-armv4 ?= "armv4"
+ARMPKGARCH_tune-armv4t ?= "armv4"
+TUNE_FEATURES_tune-armv4 = "arm armv4"
+TUNE_FEATURES_tune-armv4t = "${TUNE_FEATURES_tune-armv4} thumb"
+PACKAGE_EXTRA_ARCHS_tune-armv4 = "arm armv4"
+PACKAGE_EXTRA_ARCHS_tune-armv4t = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv4t"
+
+# Big Endian
+AVAILTUNES += "armv4b armv4tb"
+ARMPKGARCH_tune-armv4b ?= "armv4"
+ARMPKGARCH_tune-armv4tb ?= "armv4"
+TUNE_FEATURES_tune-armv4b = "${TUNE_FEATURES_tune-armv4} bigendian"
+TUNE_FEATURES_tune-armv4tb = "${TUNE_FEATURES_tune-armv4t} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv4b = "armeb armv4b"
+PACKAGE_EXTRA_ARCHS_tune-armv4tb = "${PACKAGE_EXTRA_ARCHS_tune-armv4b} armv4tb"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc b/poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
new file mode 100644
index 000000000..1f16085fc
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv5-dsp.inc
@@ -0,0 +1,52 @@
+ARMPKGSFX_DSP = "${@bb.utils.contains('TUNE_FEATURES', [ 'armv5', 'dsp' ], 'e', '', d)}"
+TUNEVALID[dsp] = "ARM DSP functionality"
+
+require conf/machine/include/arm/arch-armv5.inc
+
+# Little Endian
+AVAILTUNES += "armv5e armv5te"
+ARMPKGARCH_tune-armv5e ?= "armv5"
+ARMPKGARCH_tune-armv5te ?= "armv5"
+TUNE_FEATURES_tune-armv5e = "${TUNE_FEATURES_tune-armv5} dsp"
+TUNE_FEATURES_tune-armv5te = "${TUNE_FEATURES_tune-armv5t} dsp"
+PACKAGE_EXTRA_ARCHS_tune-armv5e = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5e"
+PACKAGE_EXTRA_ARCHS_tune-armv5te = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5e armv5te"
+
+# Little Endian + VFP/DSP
+AVAILTUNES += "armv5e-vfp armv5te-vfp armv5ehf-vfp armv5tehf-vfp"
+ARMPKGARCH_tune-armv5e-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5te-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5ehf-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tehf-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5e-vfp = "${TUNE_FEATURES_tune-armv5e} vfp"
+TUNE_FEATURES_tune-armv5te-vfp = "${TUNE_FEATURES_tune-armv5te} vfp"
+TUNE_FEATURES_tune-armv5ehf-vfp = "${TUNE_FEATURES_tune-armv5e-vfp} callconvention-hard"
+TUNE_FEATURES_tune-armv5tehf-vfp = "${TUNE_FEATURES_tune-armv5te-vfp} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5-vfp} armv5e armv5e-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp} armv5e armv5te armv5e-vfp armv5te-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp} armv5ehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp} armv5ehf-vfp armv5tehf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv5eb armv5teb"
+ARMPKGARCH_tune-armv5eb ?= "armv5"
+ARMPKGARCH_tune-armv5teb ?= "armv5"
+TUNE_FEATURES_tune-armv5eb = "${TUNE_FEATURES_tune-armv5e} bigendian"
+TUNE_FEATURES_tune-armv5teb = "${TUNE_FEATURES_tune-armv5te} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5eb"
+PACKAGE_EXTRA_ARCHS_tune-armv5teb = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5eb armv5teb"
+
+# Big Endian + VFP/DSP
+AVAILTUNES += "armv5eb-vfp armv5teb-vfp armv5ehfb-vfp armv5tehfb-vfp"
+ARMPKGARCH_tune-armv5eb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5teb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5ehfb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tehfb-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5eb-vfp = "${TUNE_FEATURES_tune-armv5e-vfp} bigendian"
+TUNE_FEATURES_tune-armv5teb-vfp = "${TUNE_FEATURES_tune-armv5te-vfp} bigendian"
+TUNE_FEATURES_tune-armv5ehfb-vfp = "${TUNE_FEATURES_tune-armv5ehf-vfp} bigendian"
+TUNE_FEATURES_tune-armv5tehfb-vfp = "${TUNE_FEATURES_tune-armv5tehf-vfp} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp} armv5eb armv5eb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp} armv5eb armv5teb armv5eb-vfp armv5teb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp} armv5ehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp} armv5ehfb-vfp armv5tehfb-vfp"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv5.inc b/poky/meta/conf/machine/include/arm/arch-armv5.inc
new file mode 100644
index 000000000..46f631c81
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv5.inc
@@ -0,0 +1,57 @@
+DEFAULTTUNE ?= "armv5"
+
+TUNEVALID[armv5] = "Enable instructions for ARMv5"
+TUNECONFLICTS[armv5] = "armv4"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5', ' -march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv5', 'armv5:', '' ,d)}"
+
+require conf/machine/include/arm/arch-armv4.inc
+require conf/machine/include/arm/feature-arm-vfp.inc
+
+# Little Endian
+AVAILTUNES += "armv5 armv5t"
+ARMPKGARCH_tune-armv5 ?= "armv5"
+ARMPKGARCH_tune-armv5t ?= "armv5"
+TUNE_FEATURES_tune-armv5 = "arm armv5"
+TUNE_FEATURES_tune-armv5t = "${TUNE_FEATURES_tune-armv5} thumb"
+PACKAGE_EXTRA_ARCHS_tune-armv5 = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5"
+PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t"
+
+# Little Endian + VFP/DSP
+AVAILTUNES += "armv5-vfp armv5t-vfp armv5hf-vfp armv5thf-vfp"
+ARMPKGARCH_tune-armv5-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5t-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5hf-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5thf-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5-vfp = "${TUNE_FEATURES_tune-armv5} vfp"
+TUNE_FEATURES_tune-armv5t-vfp = "${TUNE_FEATURES_tune-armv5t} vfp"
+TUNE_FEATURES_tune-armv5hf-vfp = "${TUNE_FEATURES_tune-armv5-vfp} callconvention-hard"
+TUNE_FEATURES_tune-armv5thf-vfp = "${TUNE_FEATURES_tune-armv5t-vfp} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv5-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5-vfp armv5t-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp = "armv5hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp = "armv5hf-vfp armv5thf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv5b armv5tb"
+ARMPKGARCH_tune-armv5b ?= "armv5"
+ARMPKGARCH_tune-armv5tb ?= "armv5"
+TUNE_FEATURES_tune-armv5b = "${TUNE_FEATURES_tune-armv5} bigendian"
+TUNE_FEATURES_tune-armv5tb = "${TUNE_FEATURES_tune-armv5t} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5b = "${PACKAGE_EXTRA_ARCHS_tune-armv4b} armv5b"
+PACKAGE_EXTRA_ARCHS_tune-armv5tb = "${PACKAGE_EXTRA_ARCHS_tune-armv4tb} armv5b armv5tb"
+
+# Big Endian + VFP/DSP
+AVAILTUNES += "armv5b-vfp armv5tb-vfp armv5hfb-vfp armv5thfb-vfp"
+ARMPKGARCH_tune-armv5b-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5hfb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5thfb-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5b-vfp = "${TUNE_FEATURES_tune-armv5-vfp} bigendian"
+TUNE_FEATURES_tune-armv5tb-vfp = "${TUNE_FEATURES_tune-armv5t-vfp} bigendian"
+TUNE_FEATURES_tune-armv5hfb-vfp = "${TUNE_FEATURES_tune-armv5hf-vfp} bigendian"
+TUNE_FEATURES_tune-armv5thfb-vfp = "${TUNE_FEATURES_tune-armv5thf-vfp} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5b-vfp armv5tb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp = "armv5hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp = "armv5hfb-vfp armv5thfb-vfp"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv6.inc b/poky/meta/conf/machine/include/arm/arch-armv6.inc
new file mode 100644
index 000000000..6c838e999
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv6.inc
@@ -0,0 +1,50 @@
+DEFAULTTUNE ?= "armv6hf"
+
+TUNEVALID[armv6] = "Enable instructions for ARMv6"
+TUNECONFLICTS[armv6] = "armv4 armv5"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6', ' -march=armv6', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv6', 'armv6:', '' ,d)}"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+# Little Endian
+AVAILTUNES += "armv6-novfp armv6t-novfp armv6 armv6t armv6hf armv6thf"
+ARMPKGARCH_tune-armv6-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6t-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6 ?= "armv6"
+ARMPKGARCH_tune-armv6t ?= "armv6"
+ARMPKGARCH_tune-armv6hf ?= "armv6"
+ARMPKGARCH_tune-armv6thf ?= "armv6"
+TUNE_FEATURES_tune-armv6-novfp = "arm armv6"
+TUNE_FEATURES_tune-armv6t-novfp = "${TUNE_FEATURES_tune-armv6-novfp} thumb"
+TUNE_FEATURES_tune-armv6 = "${TUNE_FEATURES_tune-armv6-novfp} vfp"
+TUNE_FEATURES_tune-armv6t = "${TUNE_FEATURES_tune-armv6t-novfp} vfp"
+TUNE_FEATURES_tune-armv6hf = "${TUNE_FEATURES_tune-armv6} callconvention-hard"
+TUNE_FEATURES_tune-armv6thf = "${TUNE_FEATURES_tune-armv6t} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv6-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5e} armv6"
+PACKAGE_EXTRA_ARCHS_tune-armv6t-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} armv6 armv6t"
+PACKAGE_EXTRA_ARCHS_tune-armv6 = "${PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp} armv6 armv6-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6t = "${PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp} armv6 armv6t armv6-vfp armv6t-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hf = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp} armv6hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6thf = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp} armv6hf-vfp armv6thf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv6b-novfp armv6tb-novfp armv6b armv6tb armv6hfb armv6thfb"
+ARMPKGARCH_tune-armv6b-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6tb-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6b ?= "armv6"
+ARMPKGARCH_tune-armv6tb ?= "armv6"
+ARMPKGARCH_tune-armv6hfb ?= "armv6"
+ARMPKGARCH_tune-armv6thfb ?= "armv6"
+TUNE_FEATURES_tune-armv6b-novfp = "${TUNE_FEATURES_tune-armv6-novfp} bigendian"
+TUNE_FEATURES_tune-armv6tb-novfp = "${TUNE_FEATURES_tune-armv6t-novfp} bigendian"
+TUNE_FEATURES_tune-armv6b = "${TUNE_FEATURES_tune-armv6} bigendian"
+TUNE_FEATURES_tune-armv6tb = "${TUNE_FEATURES_tune-armv6t} bigendian"
+TUNE_FEATURES_tune-armv6hfb = "${TUNE_FEATURES_tune-armv6hf} bigendian"
+TUNE_FEATURES_tune-armv6thfb = "${TUNE_FEATURES_tune-armv6thf} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv6b-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb} armv6b"
+PACKAGE_EXTRA_ARCHS_tune-armv6tb-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb} armv6b armv6tb"
+PACKAGE_EXTRA_ARCHS_tune-armv6b = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp} armv6b armv6b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6tb = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp} armv6b armv6tb armv6b-vfp armv6tb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hfb = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp} armv6hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6thfb = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp} armv6hfb-vfp armv6thfb-vfp"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv7a.inc b/poky/meta/conf/machine/include/arm/arch-armv7a.inc
new file mode 100644
index 000000000..bad1c2705
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv7a.inc
@@ -0,0 +1,141 @@
+DEFAULTTUNE ?= "armv7athf"
+
+TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
+TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', ' -march=armv7-a', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 'armv7a:', '' ,d)}"
+
+require conf/machine/include/arm/arch-armv6.inc
+require conf/machine/include/arm/feature-arm-neon.inc
+
+# Little Endian base configs
+AVAILTUNES += "armv7a armv7at armv7a-vfpv3d16 armv7at-vfpv3d16 armv7a-vfpv3 armv7at-vfpv3 armv7a-neon armv7at-neon armv7a-neon-vfpv4 armv7at-neon-vfpv4"
+ARMPKGARCH_tune-armv7a ?= "armv7a"
+ARMPKGARCH_tune-armv7at ?= "armv7a"
+ARMPKGARCH_tune-armv7a-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7at-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7a-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7at-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7a-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7at-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7a-neon-vfpv4 ?= "armv7a"
+ARMPKGARCH_tune-armv7at-neon-vfpv4 ?= "armv7a"
+TUNE_FEATURES_tune-armv7a = "arm armv7a vfp"
+TUNE_FEATURES_tune-armv7at = "${TUNE_FEATURES_tune-armv7a} thumb"
+TUNE_FEATURES_tune-armv7a-vfpv3d16 = "${TUNE_FEATURES_tune-armv7a} vfpv3d16"
+TUNE_FEATURES_tune-armv7at-vfpv3d16 = "${TUNE_FEATURES_tune-armv7at} vfpv3d16"
+TUNE_FEATURES_tune-armv7a-vfpv3 = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7at-vfpv3 = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7a-neon = "${TUNE_FEATURES_tune-armv7a} neon"
+TUNE_FEATURES_tune-armv7at-neon = "${TUNE_FEATURES_tune-armv7at} neon"
+TUNE_FEATURES_tune-armv7a-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7a-neon} vfpv4"
+TUNE_FEATURES_tune-armv7at-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon} vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7a = "${PACKAGE_EXTRA_ARCHS_tune-armv6} armv7a armv7a-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7at = "${PACKAGE_EXTRA_ARCHS_tune-armv6t} armv7a armv7a-vfp armv7at2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-vfpv3d16 armv7at2-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16} armv7a-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16} armv7a-vfpv3 armv7at2-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-neon armv7at2-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} armv7a-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} armv7a-neon-vfpv4 armv7at2-neon-vfpv4"
+
+# HF Tunes
+AVAILTUNES += "armv7ahf armv7athf armv7ahf-vfpv3d16 armv7athf-vfpv3d16 armv7ahf-vfpv3 armv7athf-vfpv3 armv7ahf-neon armv7athf-neon armv7ahf-neon-vfpv4 armv7athf-neon-vfpv4"
+ARMPKGARCH_tune-armv7ahf ?= "armv7a"
+ARMPKGARCH_tune-armv7athf ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-neon-vfpv4 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-neon-vfpv4 ?= "armv7a"
+TUNE_FEATURES_tune-armv7ahf = "${TUNE_FEATURES_tune-armv7a} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf = "${TUNE_FEATURES_tune-armv7at} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3d16 = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3d16 = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3 = "${TUNE_FEATURES_tune-armv7a-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3 = "${TUNE_FEATURES_tune-armv7at-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon = "${TUNE_FEATURES_tune-armv7a-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-neon = "${TUNE_FEATURES_tune-armv7at-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon-vfpv4} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf = "${PACKAGE_EXTRA_ARCHS_tune-armv6hf} armv7ahf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf = "${PACKAGE_EXTRA_ARCHS_tune-armv6thf} armv7ahf-vfp armv7at2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-vfpv3d16 armv7at2hf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16} armv7ahf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16} armv7ahf-vfpv3 armv7at2hf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-neon armv7at2hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} armv7ahf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} armv7ahf-neon-vfpv4 armv7at2hf-neon-vfpv4"
+
+# Big Endian
+AVAILTUNES += "armv7ab armv7atb armv7ab-vfpv3d16 armv7atb-vfpv3d16 armv7ab-vfpv3 armv7atb-vfpv3 armv7ab-neon armv7atb-neon armv7ab-neon-vfpv4 armv7atb-neon-vfpv4"
+ARMPKGARCH_tune-armv7ab ?= "armv7a"
+ARMPKGARCH_tune-armv7atb ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-neon-vfpv4 ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-neon-vfpv4 ?= "armv7a"
+TUNE_FEATURES_tune-armv7ab = "${TUNE_FEATURES_tune-armv7a} bigendian"
+TUNE_FEATURES_tune-armv7atb = "${TUNE_FEATURES_tune-armv7at} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3d16 = "${TUNE_FEATURES_tune-armv7a-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7at-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3 = "${TUNE_FEATURES_tune-armv7a-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3 = "${TUNE_FEATURES_tune-armv7at-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ab-neon = "${TUNE_FEATURES_tune-armv7a-neon} bigendian"
+TUNE_FEATURES_tune-armv7atb-neon = "${TUNE_FEATURES_tune-armv7at-neon} bigendian"
+TUNE_FEATURES_tune-armv7ab-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7a-neon-vfpv4} bigendian"
+TUNE_FEATURES_tune-armv7atb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7at-neon-vfpv4} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab = "${PACKAGE_EXTRA_ARCHS_tune-armv6b} armv7ab-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb = "${PACKAGE_EXTRA_ARCHS_tune-armv6tb} armv7ab-vfp armv7at2b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7ab-vfpv3d16 armv7at2b-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16} armv7ab-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3d16} armv7ab-vfpv3 armv7at2b-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7ab-neon armv7at2b-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon} armv7ab-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon} armv7ab-neon-vfpv4 armv7at2b-neon-vfpv4"
+
+# Big Endian + HF
+AVAILTUNES += "armv7ahfb armv7athfb armv7ahfb-vfpv3d16 armv7athfb-vfpv3d16 armv7ahfb-vfpv3 armv7athfb-vfpv3 armv7ahfb-neon armv7athfb-neon armv7ahfb-neon-vfpv4 armv7athfb-neon-vfpv4"
+ARMPKGARCH_tune-armv7ahfb ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-neon-vfpv4 ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-neon-vfpv4 ?= "armv7a"
+TUNE_FEATURES_tune-armv7ahfb = "${TUNE_FEATURES_tune-armv7ahf} bigendian"
+TUNE_FEATURES_tune-armv7athfb = "${TUNE_FEATURES_tune-armv7athf} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7ahf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7athf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3 = "${TUNE_FEATURES_tune-armv7ahf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3 = "${TUNE_FEATURES_tune-armv7athf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-neon = "${TUNE_FEATURES_tune-armv7ahf-neon} bigendian"
+TUNE_FEATURES_tune-armv7athfb-neon = "${TUNE_FEATURES_tune-armv7athf-neon} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ahf-neon-vfpv4} bigendian"
+TUNE_FEATURES_tune-armv7athfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7athf-neon-vfpv4} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb = "${PACKAGE_EXTRA_ARCHS_tune-armv6hfb} armv7ahfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb = "${PACKAGE_EXTRA_ARCHS_tune-armv6thfb} armv7ahfb-vfp armv7at2hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-vfpv3d16 armv7at2hfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16} armv7ahfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16} armv7ahfb-vfpv3 armv7at2hfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-neon armv7at2hfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon} armv7ahfb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon} armv7ahfb-neon-vfpv4 armv7at2hfb-neon-vfpv4"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv7ve.inc b/poky/meta/conf/machine/include/arm/arch-armv7ve.inc
new file mode 100644
index 000000000..4d9260fec
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv7ve.inc
@@ -0,0 +1,140 @@
+DEFAULTTUNE ?= "armv7vethf"
+
+TUNEVALID[armv7ve] = "Enable instructions for ARMv7ve"
+TUNECONFLICTS[armv7ve] = "armv4 armv5 armv6 armv7 armv7a"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7ve', ' -march=armv7ve', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7ve', 'armv7ve:', '' ,d)}"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+# Little Endian base configs
+AVAILTUNES += "armv7ve armv7vet armv7ve-vfpv3d16 armv7vet-vfpv3d16 armv7ve-vfpv3 armv7vet-vfpv3 armv7ve-neon armv7vet-neon armv7ve-neon-vfpv4 armv7vet-neon-vfpv4"
+ARMPKGARCH_tune-armv7ve ?= "armv7ve"
+ARMPKGARCH_tune-armv7vet ?= "armv7ve"
+ARMPKGARCH_tune-armv7ve-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vet-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7ve-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vet-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7ve-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vet-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7ve-neon-vfpv4 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vet-neon-vfpv4 ?= "armv7ve"
+TUNE_FEATURES_tune-armv7ve = "arm armv7ve vfp"
+TUNE_FEATURES_tune-armv7vet = "${TUNE_FEATURES_tune-armv7ve} thumb"
+TUNE_FEATURES_tune-armv7ve-vfpv3d16 = "${TUNE_FEATURES_tune-armv7ve} vfpv3d16"
+TUNE_FEATURES_tune-armv7vet-vfpv3d16 = "${TUNE_FEATURES_tune-armv7vet} vfpv3d16"
+TUNE_FEATURES_tune-armv7ve-vfpv3 = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7vet-vfpv3 = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7ve-neon = "${TUNE_FEATURES_tune-armv7ve} neon"
+TUNE_FEATURES_tune-armv7vet-neon = "${TUNE_FEATURES_tune-armv7vet} neon"
+TUNE_FEATURES_tune-armv7ve-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon} vfpv4"
+TUNE_FEATURES_tune-armv7vet-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon} vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7ve armv7ve-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7ve armv7ve-vfp armv7vet2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} armv7ve-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} armv7ve-vfpv3d16 armv7vet2-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-vfpv3d16} armv7ve-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-vfpv3d16} armv7ve-vfpv3 armv7vet2-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} armv7ve-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} armv7ve-neon armv7vet2-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} armv7ve-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} armv7ve-neon-vfpv4 armv7vet2-neon-vfpv4"
+
+# HF Tunes
+AVAILTUNES += "armv7vehf armv7vethf armv7vehf-vfpv3d16 armv7vethf-vfpv3d16 armv7vehf-vfpv3 armv7vethf-vfpv3 armv7vehf-neon armv7vethf-neon armv7vehf-neon-vfpv4 armv7vethf-neon-vfpv4"
+ARMPKGARCH_tune-armv7vehf ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethf ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehf-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethf-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehf-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethf-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehf-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethf-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehf-neon-vfpv4 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethf-neon-vfpv4 ?= "armv7ve"
+TUNE_FEATURES_tune-armv7vehf = "${TUNE_FEATURES_tune-armv7ve} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf = "${TUNE_FEATURES_tune-armv7vet} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-vfpv3d16 = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-vfpv3d16 = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-vfpv3 = "${TUNE_FEATURES_tune-armv7ve-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-vfpv3 = "${TUNE_FEATURES_tune-armv7vet-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-neon = "${TUNE_FEATURES_tune-armv7ve-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-neon = "${TUNE_FEATURES_tune-armv7vet-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7vehf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} callconvention-hard"
+TUNE_FEATURES_tune-armv7vethf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7vehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7vehf-vfp armv7vet2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} armv7vehf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} armv7vehf-vfpv3d16 armv7vet2hf-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-vfpv3d16} armv7vehf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-vfpv3d16} armv7vehf-vfpv3 armv7vet2hf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} armv7vehf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} armv7vehf-neon armv7vet2hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} armv7vehf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} armv7vehf-neon-vfpv4 armv7vet2hf-neon-vfpv4"
+
+# Big Endian
+AVAILTUNES += "armv7veb armv7vetb armv7veb-vfpv3d16 armv7vetb-vfpv3d16 armv7veb-vfpv3 armv7vetb-vfpv3 armv7veb-neon armv7vetb-neon armv7veb-neon-vfpv4 armv7vetb-neon-vfpv4"
+ARMPKGARCH_tune-armv7veb ?= "armv7ve"
+ARMPKGARCH_tune-armv7vetb ?= "armv7ve"
+ARMPKGARCH_tune-armv7veb-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vetb-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7veb-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vetb-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7veb-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vetb-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7veb-neon-vfpv4 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vetb-neon-vfpv4 ?= "armv7ve"
+TUNE_FEATURES_tune-armv7veb = "${TUNE_FEATURES_tune-armv7ve} bigendian"
+TUNE_FEATURES_tune-armv7vetb = "${TUNE_FEATURES_tune-armv7vet} bigendian"
+TUNE_FEATURES_tune-armv7veb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7ve-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vetb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7vet-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7veb-vfpv3 = "${TUNE_FEATURES_tune-armv7ve-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vetb-vfpv3 = "${TUNE_FEATURES_tune-armv7vet-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7veb-neon = "${TUNE_FEATURES_tune-armv7ve-neon} bigendian"
+TUNE_FEATURES_tune-armv7vetb-neon = "${TUNE_FEATURES_tune-armv7vet-neon} bigendian"
+TUNE_FEATURES_tune-armv7veb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} bigendian"
+TUNE_FEATURES_tune-armv7vetb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7veb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7veb-vfp armv7vet2b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb} armv7veb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb} armv7veb-vfpv3d16 armv7vet2b-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-vfpv3d16} armv7veb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb-vfpv3d16} armv7veb-vfpv3 armv7vet2b-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb} armv7veb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb} armv7veb-neon armv7vet2b-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7veb-neon} armv7veb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vetb-neon} armv7veb-neon-vfpv4 armv7vet2b-neon-vfpv4"
+
+# Big Endian + HF
+AVAILTUNES += "armv7vehfb armv7vethfb armv7vehfb-vfpv3d16 armv7vethfb-vfpv3d16 armv7vehfb-vfpv3 armv7vethfb-vfpv3 armv7vehfb-neon armv7vethfb-neon armv7vehfb-neon-vfpv4 armv7vethfb-neon-vfpv4"
+ARMPKGARCH_tune-armv7vehfb ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethfb ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehfb-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethfb-vfpv3d16 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehfb-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethfb-vfpv3 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehfb-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethfb-neon ?= "armv7ve"
+ARMPKGARCH_tune-armv7vehfb-neon-vfpv4 ?= "armv7ve"
+ARMPKGARCH_tune-armv7vethfb-neon-vfpv4 ?= "armv7ve"
+TUNE_FEATURES_tune-armv7vehfb = "${TUNE_FEATURES_tune-armv7vehf} bigendian"
+TUNE_FEATURES_tune-armv7vethfb = "${TUNE_FEATURES_tune-armv7vethf} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7vehf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-vfpv3d16 = "${TUNE_FEATURES_tune-armv7vethf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-vfpv3 = "${TUNE_FEATURES_tune-armv7vehf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-vfpv3 = "${TUNE_FEATURES_tune-armv7vethf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-neon = "${TUNE_FEATURES_tune-armv7vehf-neon} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-neon = "${TUNE_FEATURES_tune-armv7vethf-neon} bigendian"
+TUNE_FEATURES_tune-armv7vehfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} bigendian"
+TUNE_FEATURES_tune-armv7vethfb-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7vehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7vehfb-vfp armv7vet2hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb} armv7vehfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb} armv7vehfb-vfpv3d16 armv7vet2hfb-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-vfpv3d16} armv7vehfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-vfpv3d16} armv7vehfb-vfpv3 armv7vet2hfb-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb} armv7vehfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb} armv7vehfb-neon armv7vet2hfb-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehfb-neon} armv7vehfb-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethfb-neon} armv7vehfb-neon-vfpv4 armv7vet2hfb-neon-vfpv4"
diff --git a/poky/meta/conf/machine/include/arm/arch-armv8.inc b/poky/meta/conf/machine/include/arm/arch-armv8.inc
new file mode 100644
index 000000000..5e832fae6
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/arch-armv8.inc
@@ -0,0 +1 @@
+require conf/machine/include/arm/arch-arm64.inc
diff --git a/poky/meta/conf/machine/include/arm/feature-arm-neon.inc b/poky/meta/conf/machine/include/arm/feature-arm-neon.inc
new file mode 100644
index 000000000..b34af8e7c
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/feature-arm-neon.inc
@@ -0,0 +1,18 @@
+# GCC supports following options:
+# 'vfp', 'vfpv3', 'vfpv3-fp16', 'vfpv3-d16', 'vfpv3-d16-fp16', 'vfpv3xd', 'vfpv3xd-fp16', 'neon', 'neon-fp16', 'vfpv4', 'vfpv4-d16', 'fpv4-sp-d16', 'neon-vfpv4', 'fpv5-d16', 'fpv5-sp-d16', 'fp-armv8', 'neon-fp-armv8', and 'crypto-neon-fp-armv8'
+
+# Only some combinations are supported here.
+# 'vfp', -mfloat-abi parameter and 'hf' suffix is implemented in feature-arm-vfp.inc
+
+TUNEVALID[neon] = "Enable Neon SIMD accelerator unit."
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'neon', ' neon', '', d)}"
+
+TUNEVALID[vfpv3d16] = "Enable Vector Floating Point Version 3 with 16 registers (vfpv3-d16) unit."
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', ' vfpv3-d16', '', d)}"
+
+TUNEVALID[vfpv3] = "Enable Vector Floating Point Version 3 with 32 registers (vfpv3) unit."
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfpv3', ' vfpv3', '' , d)}"
+
+TUNEVALID[vfpv4] = "Enable Vector Floating Point Version 4 (vfpv4) unit."
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfpv4', ' vfpv4', '', d)}"
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', [ 'vfpv4', 'neon' ], ' neon-vfpv4', '', d)}"
diff --git a/poky/meta/conf/machine/include/arm/feature-arm-thumb.inc b/poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
new file mode 100644
index 000000000..0b47ccad0
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -0,0 +1,30 @@
+
+TUNEVALID[thumb] = "Support Thumb instructions"
+
+ARM_THUMB_SUFFIX = "${@bb.utils.contains_any('TUNE_FEATURES', 'armv4 armv5 armv6', 't', 't2', d)}"
+
+# If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb")
+# If the device doesn't support ARM, then always set "thumb" even when
+# some recipe explicitly sets ARM_INSTRUCTION_SET to "arm"
+ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET') == 'thumb']}"
+ARM_M_OPT = "${@bb.utils.contains('TUNE_FEATURES', 'arm', '${ARM_THUMB_OPT}', 'thumb', d)}"
+
+python () {
+ if bb.utils.contains('TUNE_FEATURES', 'thumb', False, True, d):
+ return
+ selected = d.getVar('ARM_INSTRUCTION_SET')
+ if selected == None:
+ return
+ used = d.getVar('ARM_M_OPT')
+ if selected != used:
+ pn = d.getVar('PN')
+ bb.warn("Recipe '%s' selects ARM_INSTRUCTION_SET to be '%s', but tune configuration overrides it to '%s'" % (pn, selected, used))
+}
+
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}"
+
+# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb
+ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '${ARM_THUMB_SUFFIX}', '', d) if d.getVar('ARM_M_OPT') == 'thumb' else ''}"
+
+# what about armv7m devices which don't support -marm (e.g. Cortex-M3)?
+TARGET_CC_KERNEL_ARCH += "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '-mno-thumb-interwork -marm', '', d)}"
diff --git a/poky/meta/conf/machine/include/arm/feature-arm-vfp.inc b/poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
new file mode 100644
index 000000000..7ae745669
--- /dev/null
+++ b/poky/meta/conf/machine/include/arm/feature-arm-vfp.inc
@@ -0,0 +1,14 @@
+# This is only for VFPv1 or VFPv2, other vfp* tunes are defined in
+# feature-arm-neon.inc, because they are available only for armv7*
+# and this .inc file is included from armv5
+
+TUNEVALID[vfp] = "Enable Vector Floating Point (vfp) unit."
+TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfp', ' vfp', '', d)}"
+
+TUNE_CCARGS .= "${@ (' -mfpu=%s' % d.getVar('TUNE_CCARGS_MFPU').split()[-1]) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
+ARMPKGSFX_FPU = "${@ ('-%s' % d.getVar('TUNE_CCARGS_MFPU').split()[-1].replace('vfpv3-d16', 'vfpv3d16')) if (d.getVar('TUNE_CCARGS_MFPU') != '') else ''}"
+
+TUNEVALID[callconvention-hard] = "Enable EABI hard float call convention, requires VFP."
+TUNE_CCARGS_MFLOAT = "${@ bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hard', 'softfp', d) if (d.getVar('TUNE_CCARGS_MFPU') != '') else '' }"
+TUNE_CCARGS .= "${@ ' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}"
+ARMPKGSFX_EABI = "${@ 'hf' if (d.getVar('TUNE_CCARGS_MFLOAT') == 'hard') else ''}"
diff --git a/poky/meta/conf/machine/include/microblaze/arch-microblaze.inc b/poky/meta/conf/machine/include/microblaze/arch-microblaze.inc
new file mode 100644
index 000000000..eab7171cb
--- /dev/null
+++ b/poky/meta/conf/machine/include/microblaze/arch-microblaze.inc
@@ -0,0 +1,53 @@
+# MicroBlaze architecture tune feature configuration
+
+# Architecture feature and override
+TUNEVALID[microblaze] = "MicroBlaze"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "microblaze", "microblaze:", "", d)}"
+
+# Endian
+TUNEVALID[bigendian] = "Use Microblaze Big Endian"
+TUNECONFLICTS[bigendian] += "v10.0"
+
+MBPKGARCH_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "eb", "el", d)}"
+
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "-mbig-endian", "-mlittle-endian", d)}"
+
+# General features
+TUNEVALID[barrel-shift] = "Enable Hardware Barrel Shifter"
+TUNEVALID[pattern-compare] = "Enable Pattern Compare Instructions"
+TUNEVALID[reorder] = "Enable Reorder Instructions"
+TUNECONFLICTS[reorder] += "v8.00 v8.10 v8.20"
+
+# Core configuration tune optimizations
+TUNEVALID[frequency-optimized] = "Enabling tuning for frequency optimized core (AREA_OPTIMIZED_2)"
+TUNECONFLICTS[frequency-optimized] += "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4 v9.5 v9.6"
+
+# Feature compiler args
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-mxl-barrel-shift", "-mno-xl-barrel-shift", d)}"
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "pattern-compare", "-mxl-pattern-compare", "-mno-xl-pattern-compare", d)}"
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "frequency-optimized", "-mxl-frequency", "", d)}"
+
+# Disable reorder for v8.30 if pattern-compare is not enabled
+TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "reorder", \
+ bb.utils.contains("TUNE_FEATURES", "v8.30", \
+ bb.utils.contains("TUNE_FEATURES", "pattern-compare", \
+ "-mxl-reorder", "-mno-xl-reorder", d), \
+ "-mxl-reorder", d), "-mno-xl-reorder", d)}"
+
+# Feature package architecture formatting
+MBPKGARCH_TUNE = ""
+MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "barrel-shift", "-bs", "", d)}"
+MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "pattern-compare", "-cmp", "", d)}"
+MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "reorder", "-re", "", d)}"
+MBPKGARCH_TUNE .= "${@bb.utils.contains("TUNE_FEATURES", "frequency-optimized", "-fo", "", d)}"
+
+# Additional features
+require conf/machine/include/microblaze/feature-microblaze-versions.inc
+require conf/machine/include/microblaze/feature-microblaze-math.inc
+
+# Architecture name, either 'microblazeeb' or 'microblazeel' depending on endianess
+TUNE_ARCH = "microblaze${@bb.utils.contains("TUNE_FEATURES", "bigendian", "eb", "el", d)}"
+
+# Package Architecture formatting
+TUNE_PKGARCH = "microblaze${MBPKGARCH_ENDIAN}${MBPKGARCH_VERSION}${MBPKGARCH_TUNE}${MBPKGARCH_MATH}"
+
diff --git a/poky/meta/conf/machine/include/microblaze/feature-microblaze-math.inc b/poky/meta/conf/machine/include/microblaze/feature-microblaze-math.inc
new file mode 100644
index 000000000..a31516659
--- /dev/null
+++ b/poky/meta/conf/machine/include/microblaze/feature-microblaze-math.inc
@@ -0,0 +1,33 @@
+# This include describes the math features (integer and floating point) that
+# are available for the MicroBlaze ISA
+
+TUNEVALID[multiply-low] = "Hardware multipler with 32 bit result"
+TUNEVALID[multiply-high] = "Hardware multipler with 64 bit result"
+TUNEVALID[divide-hard] = "Hardware divider"
+TUNEVALID[fpu-soft] = "Software FPU"
+TUNEVALID[fpu-hard] = "Hardware FPU in basic mode"
+TUNEVALID[fpu-hard-extended] = "Hardware FPU in extended mode (conversion and square root instructions)"
+
+TUNECONFLICTS[fpu-soft] = "fpu-hard fpu-hard-extended"
+TUNECONFLICTS[fpu-hard] = "fpu-soft"
+TUNECONFLICTS[fpu-hard-extended] = "fpu-soft"
+
+# Compiler args
+TUNE_CCARGS += "${@bb.utils.contains_any('TUNE_FEATURES', ['multiply-low', 'multiply-high'], '-mno-xl-soft-mul', '-mxl-soft-mul', d)}"
+TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'multiply-high', '-mxl-multiply-high', '', d)}"
+
+TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'divide-hard', '-mno-xl-soft-div', '-mxl-soft-div', d)}"
+
+TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'fpu-soft', '', '', d)}"
+TUNE_CCARGS += "${@bb.utils.contains_any('TUNE_FEATURES', ['fpu-hard', 'fpu-hard-extended'], '-mhard-float', '', d)}"
+TUNE_CCARGS += "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard-extended', '-mxl-float-convert -mxl-float-sqrt', '', d)}"
+
+# Set target fpu (bitbake known target) to soft or hard (basic or extended)
+TARGET_FPU = "${@bb.utils.contains_any('TUNE_FEATURES', 'fpu-hard fpu-hard-extended', 'fpu-hard', 'fpu-soft', d)}"
+
+# Package Architecture formatting
+MBPKGARCH_MATH = ""
+MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'multiply-high', '-mh', bb.utils.contains('TUNE_FEATURES', 'multiply-low', '-ml', '', d), d)}"
+MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'divide-hard', '-div', '', d)}"
+MBPKGARCH_MATH .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard-extended', '-fe', bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '-fb', '', d), d)}"
+
diff --git a/poky/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc b/poky/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc
new file mode 100644
index 000000000..955674fff
--- /dev/null
+++ b/poky/meta/conf/machine/include/microblaze/feature-microblaze-versions.inc
@@ -0,0 +1,67 @@
+# MicroBlaze versions are defined as features, the features are setup to
+# conflict with other versions as well as unavailable features for particular
+# versions.
+#
+# Versions before v9.0 of MicroBlaze use a versioning scheme of "vX.YY.Z"
+# (where Z = [abc]). For v8.* versions of MicroBlaze the revision (Z) changes
+# did not affect ABI and are ignored by this tune configuration. Though this
+# format is expected by GCC including the revision, but this is defaulted to
+# ".a".
+#
+# Since v9.0 of MicroBlaze the revision (Z) part of versions was entirely
+# dropped and the version scheme was changed to "vX.Y".
+
+def microblaze_current_version(d, gcc = False):
+ import re
+ # find the current version, and convert it to major/minor integers
+ version = None
+ for t in (d.getVar("TUNE_FEATURES") or "").split():
+ m = re.search("^v(\d+)\.(\d+)", t)
+ if m:
+ version = int(m.group(1)), int(m.group(2))
+ break
+
+ # format the version string in generic or GCC specific formats
+ if version:
+ if version[0] <= 8:
+ return ("v%d.%02d" % version[0:2]) + (".a" if gcc else "")
+ else:
+ return "v%d.%d" % version[0:2]
+ return ""
+
+# MicroBlaze versions
+TUNEVALID[v8.00] = "MicroBlaze version 8.00"
+TUNEVALID[v8.10] = "MicroBlaze version 8.10"
+TUNEVALID[v8.20] = "MicroBlaze version 8.20"
+TUNEVALID[v8.30] = "MicroBlaze version 8.30"
+TUNEVALID[v8.40] = "MicroBlaze version 8.40"
+TUNEVALID[v8.50] = "MicroBlaze version 8.50"
+TUNEVALID[v9.0] = "MicroBlaze version 9.0"
+TUNEVALID[v9.1] = "MicroBlaze version 9.1"
+TUNEVALID[v9.2] = "MicroBlaze version 9.2"
+TUNEVALID[v9.3] = "MicroBlaze version 9.3"
+TUNEVALID[v9.4] = "MicroBlaze version 9.4"
+TUNEVALID[v9.5] = "MicroBlaze version 9.5"
+TUNEVALID[v9.6] = "MicroBlaze version 9.6"
+TUNEVALID[v10.0] = "MicroBlaze version 10.0"
+
+# Version conflict matrix
+TUNECONFLICTS[v8.00] = ""
+TUNECONFLICTS[v8.10] = "v8.00"
+TUNECONFLICTS[v8.20] = "v8.00 v8.10"
+TUNECONFLICTS[v8.30] = "v8.00 v8.10 v8.20"
+TUNECONFLICTS[v8.40] = "v8.00 v8.10 v8.20 v8.30"
+TUNECONFLICTS[v8.50] = "v8.00 v8.10 v8.20 v8.30 v8.40"
+TUNECONFLICTS[v9.0] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50"
+TUNECONFLICTS[v9.1] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0"
+TUNECONFLICTS[v9.2] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1"
+TUNECONFLICTS[v9.3] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2"
+TUNECONFLICTS[v9.4] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3"
+TUNECONFLICTS[v9.5] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4"
+TUNECONFLICTS[v9.6] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4 v9.5"
+TUNECONFLICTS[v10.0] = "v8.00 v8.10 v8.20 v8.30 v8.40 v8.50 v9.0 v9.1 v9.2 v9.3 v9.4 v9.5 v9.6"
+
+# Version flags
+TUNE_CCARGS += "-mcpu=${@microblaze_current_version(d, True)}"
+MBPKGARCH_VERSION = "-${@microblaze_current_version(d)}"
+
diff --git a/poky/meta/conf/machine/include/mips/README b/poky/meta/conf/machine/include/mips/README
new file mode 100644
index 000000000..f36e87b45
--- /dev/null
+++ b/poky/meta/conf/machine/include/mips/README
@@ -0,0 +1,56 @@
+2016/09/30 - Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ - Add Release 6 support
+
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Version
+
+MIPS currently defines 12 ABIs. Combinations of:
+ *) Big/Little Endian
+ *) Hardware/Software Floating Point
+ *) o32, n32, n64 ABI
+
+Release 6 of the ISA is a major revision and doesn't build up on previous
+releases of the ISA.
+
+For more details about tuples, check https://wiki.debian.org/Multiarch/Tuples
+
+TUNE_ARCH, the GNU canonical arch, is defined as:
+
+"mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
+
+The package arch is defined in such a way to generated a standard naming
+scheme. The scheme is: <mips variant>[-nf][-n32]
+
+TUNE_PKGARCH is defined as:
+
+${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}
+
+The following is a list of MIPS specific variables:
+
+MIPSPKGSFX_BYTE - This is defined as either blank and "64" for MIPS64 CPUs.
+
+MIPSPKGSFX_ENDIAN - For bigendian hardware this is blank, otherwise it's
+defined as "el".
+
+MIPSPKGSFX_ENDIAN2 - For bigendian hardware this is "eb", otherwise it's
+defined as "el".
+
+MIPSPKGSFX_VARIANT_tune-<tune> - In the default tunings it is set to the
+same value as TUNE_ARCH. In custom, optimized tunings, the value should
+be modified to more precisely describe the tuning.
+
+MIPSPKGSFX_FPU - The value is set to "" or "-nf", where "-nf" indicates
+that the tune is using a non-floating point ABI.
+
+MIPSPKGSFX_ABI - This is used to specify an alternative ABI when the previous
+values are not enough to distringuish the package. "-n32" is added when
+building for N32 ABI.
+
+MIPSPKGSFX_R6 - This is used to specify the presence of release 6.
+"r6" is added in the tuple for release 6 of the isa.
+
+MIPSPKGSFX_64R6 - This is used to specify "isa" in the tuple.
+Release 6 onwards we use "mipsisa64" instead of just "mips64".
+
+MIPSPKGSFX_32R6 - This is used to specify "isa32" in the tuple.
+Release 6 onwards we use "mipsisa32" instead of just "mips".
diff --git a/poky/meta/conf/machine/include/mips/arch-mips.inc b/poky/meta/conf/machine/include/mips/arch-mips.inc
new file mode 100644
index 000000000..2f625119c
--- /dev/null
+++ b/poky/meta/conf/machine/include/mips/arch-mips.inc
@@ -0,0 +1,151 @@
+# MIPS Architecture definition
+# 12 defined ABIs, all combinations of:
+# *) Big/Little Endian
+# *) Hardware/Software Floating Point
+# *) o32, n32, n64 ABI
+
+DEFAULTTUNE ?= "mips"
+
+# Endianess
+TUNEVALID[bigendian] = "Enable big-endian mode"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', ' -meb', ' -mel', d)}"
+
+# ABI flags
+TUNEVALID[o32] = "MIPS o32 ABI"
+TUNECONFLICTS[o32] = "n32 n64"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'o32', ' -mabi=32', '', d)}"
+
+TUNEVALID[n32] = "MIPS64 n32 ABI"
+TUNECONFLICTS[n32] = "o32 n64"
+ABIEXTENSION .= "${@bb.utils.filter('TUNE_FEATURES', 'n32' ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n32', ' -mabi=n32', '', d)}"
+
+# user mode qemu doesn't support mips64 n32: "Invalid ELF image for this architecture"
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'n32', 'qemu-usermode', '', d)}"
+
+TUNEVALID[n64] = "MIPS64 n64 ABI"
+TUNECONFLICTS[n64] = "o32 n32"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'n64', ' -mabi=64', '', d)}"
+
+# Floating point
+TUNEVALID[fpu-hard] = "Use hardware FPU"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', ' -msoft-float', d)}"
+TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', '', 'soft', d)}"
+
+# MIPS r6 ABI
+TUNEVALID[r6] = "Use r6"
+TUNEVALID[mipsisa64r6] = "Use 64r6"
+TUNEVALID[mipsisa32r6] = "Use 32r6"
+
+# Package naming
+MIPSPKGSFX_ENDIAN = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', '', 'el', d)}"
+MIPSPKGSFX_ENDIAN2 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'eb', 'el', d)}"
+MIPSPKGSFX_BYTE = "${@bb.utils.contains('TUNE_FEATURES', 'n64' , '64', '', d)}"
+MIPSPKGSFX_BYTE .= "${@bb.utils.contains('TUNE_FEATURES', 'n32' , '64', '', d)}"
+MIPSPKGSFX_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard' , '', '-nf', d)}"
+MIPSPKGSFX_ABI = "${@bb.utils.contains('TUNE_FEATURES', 'n32', '-n32', '', d)}"
+MIPSPKGSFX_R6 = "${@bb.utils.filter('TUNE_FEATURES', 'r6', d)}"
+MIPSPKGSFX_64R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', 'isa', '', d)}"
+MIPSPKGSFX_32R6 = "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', 'isa32', '', d)}"
+
+TUNE_ARCH = "mips${MIPSPKGSFX_32R6}${MIPSPKGSFX_64R6}${MIPSPKGSFX_BYTE}${MIPSPKGSFX_R6}${MIPSPKGSFX_ENDIAN}"
+TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
+
+# Various Global Machine Overrides
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32${MIPSPKGSFX_ENDIAN2}:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n64', 'mipsarchn64:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'o32', 'mipsarcho32:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'n32', 'mipsarchn32:', '' ,d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'r6', 'mipsarchr6:', '' ,d)}"
+MACHINEOVERRIDES =. "mipsarch${MIPSPKGSFX_ENDIAN2}:"
+MACHINEOVERRIDES =. "mipsarch:"
+
+# Base tunes
+AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
+TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard"
+BASE_LIB_tune-mips = "lib"
+MIPSPKGSFX_VARIANT_tune-mips = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips = "mips"
+
+TUNE_FEATURES_tune-mips64-n32 = "n32 bigendian fpu-hard"
+BASE_LIB_tune-mips64-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-n32 = "mips64-n32"
+
+TUNE_FEATURES_tune-mips64 = "n64 bigendian fpu-hard"
+BASE_LIB_tune-mips64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64 = "mips64"
+
+TUNE_FEATURES_tune-mipsel = "o32 fpu-hard"
+BASE_LIB_tune-mipsel = "lib"
+MIPSPKGSFX_VARIANT_tune-mipsel = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsel = "mipsel"
+
+TUNE_FEATURES_tune-mips64el-n32 = "n32 fpu-hard"
+BASE_LIB_tune-mips64el-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64el-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-n32 = "mips64el-n32"
+
+TUNE_FEATURES_tune-mips64el = "n64 fpu-hard"
+BASE_LIB_tune-mips64el = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64el = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el = "mips64el"
+
+TUNE_FEATURES_tune-mips-nf = "o32 bigendian"
+BASE_LIB_tune-mips-nf = "lib"
+MIPSPKGSFX_VARIANT_tune-mips-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips-nf = "mips-nf"
+
+TUNE_FEATURES_tune-mips64-nf-n32 = "n32 bigendian"
+BASE_LIB_tune-mips64-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-nf-n32 = "mips64-nf-n32"
+
+TUNE_FEATURES_tune-mips64-nf = "n64 bigendian"
+BASE_LIB_tune-mips64-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-nf = "mips64-nf"
+
+TUNE_FEATURES_tune-mipsel-nf = "o32"
+BASE_LIB_tune-mipsel-nf = "lib"
+MIPSPKGSFX_VARIANT_tune-mipsel-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsel-nf = "mipsel-nf"
+
+TUNE_FEATURES_tune-mips64el-nf-n32 = "n32"
+BASE_LIB_tune-mips64el-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64el-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-n32 = "mips64el-nf-n32"
+
+TUNE_FEATURES_tune-mips64el-nf = "n64"
+BASE_LIB_tune-mips64el-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf"
+
+# MIPS 64 + o32
+AVAILTUNES += "mips64-o32 mips64el-o32"
+
+TUNE_FEATURES_tune-mips64-o32 = "o32 bigendian fpu-hard"
+BASE_LIB_tune-mips64-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-o32 = "mips mips64-o32"
+
+TUNE_FEATURES_tune-mips64el-o32 = "o32 fpu-hard"
+BASE_LIB_tune-mips64el-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64el-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-o32 = "mipsel mips64el-o32 mips64el-o32"
+
+# MIPS 64 o32 and Soft Float
+AVAILTUNES += "mips64-nf-o32 mips64el-nf-o32"
+
+TUNE_FEATURES_tune-mips64-nf-o32 = "o32 bigendian"
+BASE_LIB_tune-mips64-nf-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64-nf-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-nf-o32 = "mips-nf mips64-nf-o32"
+
+TUNE_FEATURES_tune-mips64el-nf-o32 = "o32"
+BASE_LIB_tune-mips64el-nf-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64el-nf-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-o32 = "mipsel-nf mips64el-nf-o32"
diff --git a/poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc b/poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc
new file mode 100644
index 000000000..101d5331b
--- /dev/null
+++ b/poky/meta/conf/machine/include/mips/feature-mips-mips16e.inc
@@ -0,0 +1,17 @@
+TUNEVALID[mips16e] = "Build target packages with MIPS16e ASE instructions"
+MIPS_MIPS16E_OPT = "${@['mno-mips16', 'mips16'][d.getVar('MIPS_INSTRUCTION_SET') == 'mips16e']}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', ' -${MIPS_MIPS16E_OPT}', '', d)}"
+
+MIPSPKGSFX_MIPS16E .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', '-m16', '', d) if d.getVar('MIPS_MIPS16E_OPT') == 'mips16' else ''}"
+
+# Whether to compile with code to allow interworking between the two
+# instruction sets. This allows mips16e code to be executed on a primarily
+# mips32/64 system and vice versa. It is strongly recommended that DISTROs not
+# turn this off - the actual cost is very small.
+TUNEVALID[no-interlink-compressed] = "Disable mixing of standard and MIPS16e code"
+MIPS16_TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'no-interlink-compressed', ' -mno-interlink-compressed', ' -minterlink-compressed', d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', ' ${MIPS16_TUNE_CCARGS}', '', d)}"
+OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'mips16e', ':mips16e', '', d)}"
+
+# show status (if compiling in MIPS16e mode)
+BUILDCFG_VARS += "${@['', 'MIPS_INSTRUCTION_SET'][d.getVar('MIPS_INSTRUCTION_SET') == 'mips16e']}"
diff --git a/poky/meta/conf/machine/include/mips/tune-mips-24k.inc b/poky/meta/conf/machine/include/mips/tune-mips-24k.inc
new file mode 100644
index 000000000..828acd42e
--- /dev/null
+++ b/poky/meta/conf/machine/include/mips/tune-mips-24k.inc
@@ -0,0 +1,51 @@
+DEFAULTTUNE ?= "mips32r2-24kc"
+
+MIPSPKGSFX_MIPS16E ??= ""
+
+require conf/machine/include/tune-mips32r2.inc
+require conf/machine/include/mips/feature-mips-mips16e.inc
+
+
+TUNEVALID[24kc] = "Enable MIPS 24Kc processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kc", " -mtune=24kc", "", d)}"
+TUNEVALID[24kec] = "Enable MIPS 24KEc processor optimizations, including DSP"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "24kec", " -mtune=24kec -mdsp", "", d)}"
+
+
+AVAILTUNES += "mips32r2-24kc mips32r2-24kec mips32r2-24kec-m16"
+AVAILTUNES += "mips32r2el-24kc mips32r2el-24kec mips32r2el-24kec-m16"
+
+# big endian: kc, kc+dsp=kec, kc+dsp+mips16e=kec-m16
+TUNE_FEATURES_tune-mips32r2-24kc = "${TUNE_FEATURES_tune-mips32r2-nf} 24kc"
+TUNE_FEATURES_tune-mips32r2-24kec = "${TUNE_FEATURES_tune-mips32r2-nf} 24kec"
+TUNE_FEATURES_tune-mips32r2-24kec-m16 = "${TUNE_FEATURES_tune-mips32r2-24kec} mips16e"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2-24kc = "mips32r2-24kc"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2-24kc = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2-nf} mips32r2-24kc-nf"
+QEMU_EXTRAOPTIONS_mips32r2-24kc-nf = " -cpu 24Kc"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2-24kec = "mips32r2-24kec"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2-24kec = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2-24kc} mips32r2-24kec-nf"
+QEMU_EXTRAOPTIONS_mips32r2-24kec-nf = " -cpu 24KEc"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2-24kec-m16 = "mips32r2-24kec${MIPSPKGSFX_MIPS16E}"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2-24kec-m16 = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2-24kec} mips32r2-24kec-m16-nf"
+QEMU_EXTRAOPTIONS_mips32r2-24kec-m16-nf = " -cpu 24KEc"
+
+
+# little endian: kc, kc+dsp=kec, kc+dsp+mips16e=kec-m16
+TUNE_FEATURES_tune-mips32r2el-24kc = "${TUNE_FEATURES_tune-mips32r2el-nf} 24kc"
+TUNE_FEATURES_tune-mips32r2el-24kec = "${TUNE_FEATURES_tune-mips32r2el-nf} 24kec"
+TUNE_FEATURES_tune-mips32r2el-24kec-m16 = "${TUNE_FEATURES_tune-mips32r2el-24kec} mips16e"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2el-24kc = "mips32r2el-24kc"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el-24kc = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2el-nf} mips32r2el-24kc-nf"
+QEMU_EXTRAOPTIONS_mips32r2el-24kc-nf = " -cpu 24Kc"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2el-24kec = "mips32r2el-24kec"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el-24kec = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2el-24kc} mips32r2el-24kec-nf"
+QEMU_EXTRAOPTIONS_mips32r2el-24kec-nf = " -cpu 24KEc"
+
+MIPSPKGSFX_VARIANT_tune-mips32r2el-24kec-m16 = "mips32r2el-24kec${MIPSPKGSFX_MIPS16E}"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el-24kec-m16 = "${PACKAGE_EXTRA_ARCHS_tune-mips32r2el-24kec} mips32r2el-24kec-m16-nf"
+QEMU_EXTRAOPTIONS_mips32r2el-24kec-m16-nf = " -cpu 24KEc"
diff --git a/poky/meta/conf/machine/include/powerpc/README b/poky/meta/conf/machine/include/powerpc/README
new file mode 100644
index 000000000..e87fb5082
--- /dev/null
+++ b/poky/meta/conf/machine/include/powerpc/README
@@ -0,0 +1,17 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial revision
+
+There are 4 primary PowerPC ABIs.
+# *) Hard/Soft Floating Point
+# *) 32-bit/64-bit
+
+TUNE_ARCH is defined as either "powerpc" or "powerpc64" based on the m32
+or m64 feature.
+
+May of the PowerPC package archictures are based on legacy Linux names.
+However, a general naming scheme should be similar to: ppc[64][<family>][-nf].
+(Note: the default package architectures are "powerpc" and "powerpc64".)
+
+TUNE_PKGARCH is defined as TUNE_PKGARCH_tune-${DEFAULTTUNE}. All
+PowerPC tunings are required to define TUNE_PKGARCH_tune-<tune>.
+
diff --git a/poky/meta/conf/machine/include/powerpc/arch-powerpc.inc b/poky/meta/conf/machine/include/powerpc/arch-powerpc.inc
new file mode 100644
index 000000000..9cf6b88fd
--- /dev/null
+++ b/poky/meta/conf/machine/include/powerpc/arch-powerpc.inc
@@ -0,0 +1,34 @@
+# Power Architecture definition
+# Four defined ABIs, all combinations of:
+# *) Hard/Soft Floating Point
+# *) 32-bit/64-bit
+
+DEFAULTTUNE ?= "powerpc"
+
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+ABIEXTENSION ?= ""
+
+TUNEVALID[m32] = "Power ELF32 standard ABI"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm32', ' -m32', '', d)}"
+TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'm32', 'powerpc', '', d)}"
+
+TUNEVALID[fpu-hard] = "Use hardware FPU."
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-hard', ' -mhard-float', '', d)}"
+
+TUNEVALID[fpu-soft] = "Use software FPU."
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-soft', ' -msoft-float', '', d)}"
+TARGET_FPU .= "${@bb.utils.contains('TUNE_FEATURES', 'fpu-soft', 'soft', '', d)}"
+
+TUNEVALID[altivec] = "Altivec"
+
+# Basic tune definitions
+AVAILTUNES += "powerpc powerpc-nf"
+TUNE_FEATURES_tune-powerpc-nf = "m32 fpu-soft"
+BASE_LIB_tune-powerpc-nf = "lib"
+TUNE_PKGARCH_tune-powerpc-nf = "powerpc-nf"
+PACKAGE_EXTRA_ARCHS_tune-powerpc-nf = "powerpc-nf"
+
+TUNE_FEATURES_tune-powerpc = "m32 fpu-hard"
+BASE_LIB_tune-powerpc = "lib"
+TUNE_PKGARCH_tune-powerpc = "powerpc"
+PACKAGE_EXTRA_ARCHS_tune-powerpc = "powerpc"
diff --git a/poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc b/poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc
new file mode 100644
index 000000000..f751c6b76
--- /dev/null
+++ b/poky/meta/conf/machine/include/powerpc/arch-powerpc64.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "powerpc64"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[m64] = "Power ELF64 standard ABI"
+TUNECONFLICTS[m64] = "m32 nf"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}"
+TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', [ 'm64' ], 'powerpc64', '', d)}"
+
+# user mode qemu doesn't support ppc64
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'm64', 'qemu-usermode', '', d)}"
+
+AVAILTUNES += "powerpc64"
+TUNE_FEATURES_tune-powerpc64 = "m64 fpu-hard"
+BASE_LIB_tune-powerpc64 = "lib64"
+TUNE_PKGARCH_tune-powerpc64 = "powerpc64"
+PACKAGE_EXTRA_ARCHS_tune-powerpc64 = "powerpc64"
diff --git a/poky/meta/conf/machine/include/qemu.inc b/poky/meta/conf/machine/include/qemu.inc
new file mode 100644
index 000000000..aa332fecc
--- /dev/null
+++ b/poky/meta/conf/machine/include/qemu.inc
@@ -0,0 +1,30 @@
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/egl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+XSERVER ?= "xserver-xorg \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
+ xf86-video-fbdev \
+ "
+
+MACHINE_FEATURES = "alsa bluetooth usbgadget screen"
+
+MACHINEOVERRIDES =. "qemuall:"
+
+IMAGE_FSTYPES += "tar.bz2 ext4"
+
+# Don't include kernels in standard images
+RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
+
+# Use a common kernel recipe for all QEMU machines
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+
+EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+
+# Provide the nfs server kernel module for all qemu images
+KERNEL_FEATURES_append_pn-linux-yocto = " features/nfsd/nfsd-enable.scc"
+KERNEL_FEATURES_append_pn-linux-yocto-rt = " features/nfsd/nfsd-enable.scc"
+
+IMAGE_CLASSES += "qemuboot"
diff --git a/poky/meta/conf/machine/include/qemuboot-mips.inc b/poky/meta/conf/machine/include/qemuboot-mips.inc
new file mode 100644
index 000000000..7d9fa52da
--- /dev/null
+++ b/poky/meta/conf/machine/include/qemuboot-mips.inc
@@ -0,0 +1,8 @@
+# For runqemu
+IMAGE_CLASSES += "qemuboot"
+QB_MEM = "-m 256"
+QB_MACHINE = "-machine malta"
+QB_KERNEL_CMDLINE_APPEND = "console=ttyS0 console=tty"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-vga cirrus -show-cursor -usb -device usb-tablet -device virtio-rng-pci"
+QB_SYSTEM_NAME = "qemu-system-${TUNE_ARCH}"
diff --git a/poky/meta/conf/machine/include/qemuboot-x86.inc b/poky/meta/conf/machine/include/qemuboot-x86.inc
new file mode 100644
index 000000000..1456bf7e8
--- /dev/null
+++ b/poky/meta/conf/machine/include/qemuboot-x86.inc
@@ -0,0 +1,17 @@
+# For runqemu
+IMAGE_CLASSES += "qemuboot"
+QB_SYSTEM_NAME_x86 = "qemu-system-i386"
+QB_CPU_x86 = "-cpu pentium2"
+QB_CPU_KVM_x86 = "-cpu pentium2"
+
+QB_SYSTEM_NAME_x86-64 = "qemu-system-x86_64"
+QB_CPU_x86-64 = "-cpu core2duo"
+QB_CPU_KVM_x86-64 = "-cpu core2duo"
+
+QB_AUDIO_DRV = "alsa"
+QB_AUDIO_OPT = "-soundhw ac97,es1370"
+QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=${UVESA_MODE} oprofile.timer=1 uvesafb.task_timeout=-1"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-vga vmware -show-cursor -usb -device usb-tablet -device virtio-rng-pci"
+
+UVESA_MODE ?= "640x480-32"
diff --git a/poky/meta/conf/machine/include/sh/README b/poky/meta/conf/machine/include/sh/README
new file mode 100644
index 000000000..b351acdd2
--- /dev/null
+++ b/poky/meta/conf/machine/include/sh/README
@@ -0,0 +1,11 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+Both big endian and little endian are defined for SH.
+
+Experimental -- SH tunings have not been validated.
+
+The TUNE_ARCH is defined as ${TUNE_ARCH_tune-${DEFAULTTUNE}}.
+
+The TUNE_PKGARCH is defind as ${TUNE_PKGARCH_tune-${DEFAULTTUNE}}.
+
diff --git a/poky/meta/conf/machine/include/sh/arch-sh.inc b/poky/meta/conf/machine/include/sh/arch-sh.inc
new file mode 100644
index 000000000..bdfbf52ca
--- /dev/null
+++ b/poky/meta/conf/machine/include/sh/arch-sh.inc
@@ -0,0 +1,9 @@
+# SH Architecture definition
+
+DEFAULTTUNE ?= "sh"
+
+TUNE_ARCH = "${TUNE_ARCH_tune-${DEFAULTTUNE}}"
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+
+TUNEVALID[bigendian] = "Enabled big-endian mode."
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', ' -mb', ' -ml', d)}"
diff --git a/poky/meta/conf/machine/include/soc-family.inc b/poky/meta/conf/machine/include/soc-family.inc
new file mode 100644
index 000000000..1ff089981
--- /dev/null
+++ b/poky/meta/conf/machine/include/soc-family.inc
@@ -0,0 +1,3 @@
+# Add SOC_FAMILY to machine overrides so we get access to e.g. 'omap3' and 'ti335x'
+SOC_FAMILY ??= ""
+MACHINEOVERRIDES =. "${@['', '${SOC_FAMILY}:']['${SOC_FAMILY}' != '']}"
diff --git a/poky/meta/conf/machine/include/tune-arm1136jf-s.inc b/poky/meta/conf/machine/include/tune-arm1136jf-s.inc
new file mode 100644
index 000000000..c5de63e1c
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-arm1136jf-s.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv6hf"
+
+require conf/machine/include/arm/arch-armv6.inc
+
+TUNEVALID[arm1136jfs] = "Enable arm1136jfs specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'arm1136jfs', ' -mcpu=arm1136jf-s', '', d)}"
+
+AVAILTUNES += "arm1136jfs"
+ARMPKGARCH_tune-arm1136jfs = "arm1136jfs"
+TUNE_FEATURES_tune-arm1136jfs = "${TUNE_FEATURES_tune-armv6} arm1136jfs"
+PACKAGE_EXTRA_ARCHS_tune-arm1136jfs = "${PACKAGE_EXTRA_ARCHS_tune-armv6} arm1136jfs-vfp"
diff --git a/poky/meta/conf/machine/include/tune-arm920t.inc b/poky/meta/conf/machine/include/tune-arm920t.inc
new file mode 100644
index 000000000..c6e74b677
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-arm920t.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4t"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[arm920t] = "Enable arm920t specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'arm920t', ' -mcpu=arm920t', '', d)}"
+
+AVAILTUNES += "arm920t"
+ARMPKGARCH_tune-arm920t = "arm920t"
+TUNE_FEATURES_tune-arm920t = "${TUNE_FEATURES_tune-armv4t} arm920t"
+PACKAGE_EXTRA_ARCHS_tune-arm920t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} arm920t arm920tt"
diff --git a/poky/meta/conf/machine/include/tune-arm926ejs.inc b/poky/meta/conf/machine/include/tune-arm926ejs.inc
new file mode 100644
index 000000000..81bcda339
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-arm926ejs.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv5te"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[arm926ejs] = "Enable arm926ejs specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'arm926ejs', ' -mcpu=arm926ej-s', '', d)}"
+
+AVAILTUNES += "arm926ejs"
+ARMPKGARCH_tune-arm926ejs = "arm926ejs"
+TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
+PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} arm926ejste arm926ejse"
diff --git a/poky/meta/conf/machine/include/tune-arm9tdmi.inc b/poky/meta/conf/machine/include/tune-arm9tdmi.inc
new file mode 100644
index 000000000..e9c2b8fcf
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-arm9tdmi.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4t"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[arm9tdmi] = "Enable arm9tdmi specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'arm9tdmi', ' -mcpu=arm9tdmi', '', d)}"
+
+AVAILTUNES += "arm9tdmi"
+ARMPKGARCH_tune-arm9tdmi = "arm9tdmi"
+TUNE_FEATURES_tune-arm9tdmi = "${TUNE_FEATURES_tune-armv4t} arm9tdmi"
+PACKAGE_EXTRA_ARCHS_tune-arm9tdmi = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} arm9tdmit"
diff --git a/poky/meta/conf/machine/include/tune-atom.inc b/poky/meta/conf/machine/include/tune-atom.inc
new file mode 100644
index 000000000..5e1bb74c6
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-atom.inc
@@ -0,0 +1,2 @@
+# Atom tunings are the same as core2 for now...
+require conf/machine/include/tune-core2.inc
diff --git a/poky/meta/conf/machine/include/tune-c3.inc b/poky/meta/conf/machine/include/tune-c3.inc
new file mode 100644
index 000000000..1b272b250
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-c3.inc
@@ -0,0 +1,12 @@
+require conf/machine/include/x86/arch-x86.inc
+
+TUNEVALID[c3] = "VIA Cyrix III or VIA C3 specific optimizations"
+TUNECONFLICTS[c3] = "m64 mx32"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'c3', ' -march=c3 -mtune=c3', '', d)}"
+
+AVAILTUNES += "c3"
+TUNE_FEATURES_tune-c3 = "${TUNE_FEATURES_tune-x86} c3"
+BASE_LIBS_tune-c3 = "${BASE_LIB_tune-x86}"
+# The following should likely be something other then i586...
+TUNE_PKGARCH_tune-c3 = "i586"
+PACKAGE_EXTRA_ARCHS_tune-c3 = "${PACKAGE_EXTRA_ARCHS_tune-x86} i386 i486 i586"
diff --git a/poky/meta/conf/machine/include/tune-core2.inc b/poky/meta/conf/machine/include/tune-core2.inc
new file mode 100644
index 000000000..c686bb468
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-core2.inc
@@ -0,0 +1,38 @@
+# Settings for the GCC(1) cpu-type "core2":
+#
+# Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
+# instruction set support.
+#
+# This tune is recommended for the Intel Core 2 CPU family, including Conroe,
+# Merom and beyond, as well as the first Atom CPUs, Diamondville, and beyond.
+#
+DEFAULTTUNE ?= "core2-32"
+
+# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/tune-i686.inc
+
+# Extra tune features
+TUNEVALID[core2] = "Enable core2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'core2', ' -march=core2 -mtune=core2 -msse3 -mfpmath=sse', '', d)}"
+
+# Extra tune selections
+AVAILTUNES += "core2-32"
+TUNE_FEATURES_tune-core2-32 = "${TUNE_FEATURES_tune-x86} core2"
+BASE_LIB_tune-core2-32 = "lib"
+TUNE_PKGARCH_tune-core2-32 = "core2-32"
+PACKAGE_EXTRA_ARCHS_tune-core2-32 = "${PACKAGE_EXTRA_ARCHS_tune-i686} core2-32"
+QEMU_EXTRAOPTIONS_core2-32 = " -cpu core2duo"
+
+AVAILTUNES += "core2-64"
+TUNE_FEATURES_tune-core2-64 = "${TUNE_FEATURES_tune-x86-64} core2"
+BASE_LIB_tune-core2-64 = "lib64"
+TUNE_PKGARCH_tune-core2-64 = "core2-64"
+PACKAGE_EXTRA_ARCHS_tune-core2-64 = "${PACKAGE_EXTRA_ARCHS_tune-x86-64} core2-64"
+QEMU_EXTRAOPTIONS_core2-64 = " -cpu core2duo"
+
+AVAILTUNES += "core2-64-x32"
+TUNE_FEATURES_tune-core2-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} core2"
+BASE_LIB_tune-core2-64-x32 = "libx32"
+TUNE_PKGARCH_tune-core2-64-x32 = "core2-64-x32"
+PACKAGE_EXTRA_ARCHS_tune-core2-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-x86-64-x32} core2-64-x32"
+QEMU_EXTRAOPTIONS_core2-64-x32 = " -cpu core2duo"
diff --git a/poky/meta/conf/machine/include/tune-corei7.inc b/poky/meta/conf/machine/include/tune-corei7.inc
new file mode 100644
index 000000000..6edfb680e
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-corei7.inc
@@ -0,0 +1,39 @@
+# Settings for the GCC(1) cpu-type "corei7":
+#
+# Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
+# and SSE4.2 instruction set support.
+#
+# This tune is recommended for Intel Nehalem and Silvermont (e.g. Bay Trail) CPUs
+# (and beyond).
+#
+DEFAULTTUNE ?= "corei7-64"
+
+# Pull in the previous tune in to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/tune-core2.inc
+
+
+# Extra tune features
+TUNEVALID[corei7] = "Enable corei7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'corei7', ' -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2', '', d)}"
+
+# Extra tune selections
+AVAILTUNES += "corei7-32"
+TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
+BASE_LIB_tune-corei7-32 = "lib"
+TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
+PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-32} corei7-32"
+QEMU_EXTRAOPTIONS_corei7-32 = " -cpu Nehalem,check=false"
+
+AVAILTUNES += "corei7-64"
+TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
+BASE_LIB_tune-corei7-64 = "lib64"
+TUNE_PKGARCH_tune-corei7-64 = "corei7-64"
+PACKAGE_EXTRA_ARCHS_tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64} corei7-64"
+QEMU_EXTRAOPTIONS_corei7-64 = " -cpu Nehalem,check=false"
+
+AVAILTUNES += "corei7-64-x32"
+TUNE_FEATURES_tune-corei7-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} corei7"
+BASE_LIB_tune-corei7-64-x32 = "libx32"
+TUNE_PKGARCH_tune-corei7-64-x32 = "corei7-64-x32"
+PACKAGE_EXTRA_ARCHS_tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64-x32} corei7-64-x32"
+QEMU_EXTRAOPTIONS_corei7-64-x32 = " -cpu Nehalem,check=false"
diff --git a/poky/meta/conf/machine/include/tune-cortexa15.inc b/poky/meta/conf/machine/include/tune-cortexa15.inc
new file mode 100644
index 000000000..25e99f93d
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa15.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7vethf-neon"
+
+require conf/machine/include/arm/arch-armv7ve.inc
+
+TUNEVALID[cortexa15] = "Enable Cortex-A15 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa15', ' -mcpu=cortex-a15', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa15 cortexa15t cortexa15-neon cortexa15t-neon cortexa15-neon-vfpv4 cortexa15t-neon-vfpv4"
+ARMPKGARCH_tune-cortexa15 = "cortexa15"
+ARMPKGARCH_tune-cortexa15t = "cortexa15"
+ARMPKGARCH_tune-cortexa15-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15t-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15-neon-vfpv4 = "cortexa15"
+ARMPKGARCH_tune-cortexa15t-neon-vfpv4 = "cortexa15"
+TUNE_FEATURES_tune-cortexa15 = "${TUNE_FEATURES_tune-armv7ve} cortexa15"
+TUNE_FEATURES_tune-cortexa15t = "${TUNE_FEATURES_tune-armv7vet} cortexa15"
+TUNE_FEATURES_tune-cortexa15-neon = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15t-neon = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa15"
+TUNE_FEATURES_tune-cortexa15t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa15"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa15-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15t = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa15-vfp cortexa15t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa15-vfp cortexa15-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa15-vfp cortexa15-neon cortexa15t2-vfp cortexa15t2-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa15-vfp cortexa15-neon cortexa15-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa15-vfp cortexa15-neon cortexa15-neon-vfpv4 cortexa15t2-vfp cortexa15t2-neon cortexa15t2-neon-vfpv4"
+
+# HF Tunes
+AVAILTUNES += "cortexa15hf cortexa15thf cortexa15hf-neon cortexa15thf-neon cortexa15hf-neon-vfpv4 cortexa15thf-neon-vfpv4"
+ARMPKGARCH_tune-cortexa15hf = "cortexa15"
+ARMPKGARCH_tune-cortexa15thf = "cortexa15"
+ARMPKGARCH_tune-cortexa15hf-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15thf-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15hf-neon-vfpv4 = "cortexa15"
+ARMPKGARCH_tune-cortexa15thf-neon-vfpv4 = "cortexa15"
+TUNE_FEATURES_tune-cortexa15hf = "${TUNE_FEATURES_tune-armv7vehf} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf = "${TUNE_FEATURES_tune-armv7vethf} cortexa15"
+TUNE_FEATURES_tune-cortexa15hf-neon = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf-neon = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15hf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa15"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa15hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa15hf-vfp cortexa15t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa15hf-vfp cortexa15hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa15hf-vfp cortexa15hf-neon cortexa15t2hf-vfp cortexa15t2hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa15hf-vfp cortexa15hf-neon cortexa15hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa15hf-vfp cortexa15hf-neon cortexa15hf-neon-vfpv4 cortexa15t2hf-vfp cortexa15t2hf-neon cortexa15t2hf-neon-vfpv4"
diff --git a/poky/meta/conf/machine/include/tune-cortexa17.inc b/poky/meta/conf/machine/include/tune-cortexa17.inc
new file mode 100644
index 000000000..40392f9bc
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa17.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7vethf-neon"
+
+require conf/machine/include/arm/arch-armv7ve.inc
+
+TUNEVALID[cortexa17] = "Enable Cortex-A17 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa17', ' -mcpu=cortex-a17', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa17 cortexa17t cortexa17-neon cortexa17t-neon cortexa17-neon-vfpv4 cortexa17t-neon-vfpv4"
+ARMPKGARCH_tune-cortexa17 = "cortexa17"
+ARMPKGARCH_tune-cortexa17t = "cortexa17"
+ARMPKGARCH_tune-cortexa17-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17t-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17-neon-vfpv4 = "cortexa17"
+ARMPKGARCH_tune-cortexa17t-neon-vfpv4 = "cortexa17"
+TUNE_FEATURES_tune-cortexa17 = "${TUNE_FEATURES_tune-armv7ve} cortexa17"
+TUNE_FEATURES_tune-cortexa17t = "${TUNE_FEATURES_tune-armv7vet} cortexa17"
+TUNE_FEATURES_tune-cortexa17-neon = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17t-neon = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa17"
+TUNE_FEATURES_tune-cortexa17t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa17"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa17-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17t = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa17-vfp cortexa17t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa17-vfp cortexa17-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa17-vfp cortexa17-neon cortexa17t2-vfp cortexa17t2-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa17-vfp cortexa17-neon cortexa17-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa17-vfp cortexa17-neon cortexa17-neon-vfpv4 cortexa17t2-vfp cortexa17t2-neon cortexa17t2-neon-vfpv4"
+
+# HF Tunes
+AVAILTUNES += "cortexa17hf cortexa17thf cortexa17hf-neon cortexa17thf-neon cortexa17hf-neon-vfpv4 cortexa17thf-neon-vfpv4"
+ARMPKGARCH_tune-cortexa17hf = "cortexa17"
+ARMPKGARCH_tune-cortexa17thf = "cortexa17"
+ARMPKGARCH_tune-cortexa17hf-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17thf-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17hf-neon-vfpv4 = "cortexa17"
+ARMPKGARCH_tune-cortexa17thf-neon-vfpv4 = "cortexa17"
+TUNE_FEATURES_tune-cortexa17hf = "${TUNE_FEATURES_tune-armv7vehf} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf = "${TUNE_FEATURES_tune-armv7vethf} cortexa17"
+TUNE_FEATURES_tune-cortexa17hf-neon = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf-neon = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17hf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa17"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa17hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa17hf-vfp cortexa17t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa17hf-vfp cortexa17hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa17hf-vfp cortexa17hf-neon cortexa17t2hf-vfp cortexa17t2hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa17hf-vfp cortexa17hf-neon cortexa17hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa17hf-vfp cortexa17hf-neon cortexa17hf-neon-vfpv4 cortexa17t2hf-vfp cortexa17t2hf-neon cortexa17t2hf-neon-vfpv4"
diff --git a/poky/meta/conf/machine/include/tune-cortexa5.inc b/poky/meta/conf/machine/include/tune-cortexa5.inc
new file mode 100644
index 000000000..1f0cda664
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa5.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7athf-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa5] = "Enable Cortex-A5 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa5', ' -mcpu=cortex-a5', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa5 cortexa5t cortexa5-neon cortexa5t-neon"
+ARMPKGARCH_tune-cortexa5 = "cortexa5"
+ARMPKGARCH_tune-cortexa5t = "cortexa5"
+ARMPKGARCH_tune-cortexa5-neon = "cortexa5"
+ARMPKGARCH_tune-cortexa5t-neon = "cortexa5"
+TUNE_FEATURES_tune-cortexa5 = "${TUNE_FEATURES_tune-armv7a} cortexa5"
+TUNE_FEATURES_tune-cortexa5t = "${TUNE_FEATURES_tune-armv7at} cortexa5"
+TUNE_FEATURES_tune-cortexa5-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa5-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa5-vfp cortexa5t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa5-vfp cortexa5-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa5-vfp cortexa5-neon cortexa5t2-vfp cortexa5t2-neon"
+
+# HF Tunes
+AVAILTUNES += "cortexa5hf cortexa5thf cortexa5hf-neon cortexa5thf-neon"
+ARMPKGARCH_tune-cortexa5hf = "cortexa5"
+ARMPKGARCH_tune-cortexa5thf = "cortexa5"
+ARMPKGARCH_tune-cortexa5hf-neon = "cortexa5"
+ARMPKGARCH_tune-cortexa5thf-neon = "cortexa5"
+TUNE_FEATURES_tune-cortexa5hf = "${TUNE_FEATURES_tune-armv7ahf} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf = "${TUNE_FEATURES_tune-armv7athf} cortexa5"
+TUNE_FEATURES_tune-cortexa5hf-neon = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf-neon = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa5hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa5hf-vfp cortexa5t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa5hf-vfp cortexa5hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa5hf-vfp cortexa5hf-neon cortexa5t2hf-vfp cortexa5t2hf-neon"
diff --git a/poky/meta/conf/machine/include/tune-cortexa7.inc b/poky/meta/conf/machine/include/tune-cortexa7.inc
new file mode 100644
index 000000000..52415d9c8
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa7.inc
@@ -0,0 +1,48 @@
+DEFAULTTUNE ?= "armv7vethf-neon"
+
+require conf/machine/include/arm/arch-armv7ve.inc
+
+TUNEVALID[cortexa7] = "Enable Cortex-A7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa7', ' -mcpu=cortex-a7', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa7 cortexa7t cortexa7-neon cortexa7t-neon cortexa7-neon-vfpv4 cortexa7t-neon-vfpv4"
+ARMPKGARCH_tune-cortexa7 = "cortexa7"
+ARMPKGARCH_tune-cortexa7t = "cortexa7"
+ARMPKGARCH_tune-cortexa7-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7t-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7-neon-vfpv4 = "cortexa7"
+ARMPKGARCH_tune-cortexa7t-neon-vfpv4 = "cortexa7"
+TUNE_FEATURES_tune-cortexa7 = "${TUNE_FEATURES_tune-armv7ve} cortexa7"
+TUNE_FEATURES_tune-cortexa7t = "${TUNE_FEATURES_tune-armv7vet} cortexa7"
+TUNE_FEATURES_tune-cortexa7-neon = "${TUNE_FEATURES_tune-armv7ve-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7t-neon = "${TUNE_FEATURES_tune-armv7vet-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7ve-neon-vfpv4} cortexa7"
+TUNE_FEATURES_tune-cortexa7t-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vet-neon-vfpv4} cortexa7"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve} cortexa7-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7t = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet} cortexa7-vfp cortexa7t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon} cortexa7-vfp cortexa7-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon} cortexa7-vfp cortexa7-neon cortexa7t2-vfp cortexa7t2-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ve-neon-vfpv4} cortexa7-vfp cortexa7-neon cortexa7-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7t-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vet-neon-vfpv4} cortexa7-vfp cortexa7-neon cortexa7-neon-vfpv4 cortexa7t2-vfp cortexa7t2-neon cortexa7t2-neon-vfpv4"
+
+# HF Tunes
+AVAILTUNES += "cortexa7hf cortexa7thf cortexa7hf-neon cortexa7thf-neon cortexa7hf-neon-vfpv4 cortexa7thf-neon-vfpv4"
+ARMPKGARCH_tune-cortexa7hf = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf = "cortexa7"
+ARMPKGARCH_tune-cortexa7hf-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7hf-neon-vfpv4 = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf-neon-vfpv4 = "cortexa7"
+TUNE_FEATURES_tune-cortexa7hf = "${TUNE_FEATURES_tune-armv7vehf} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf = "${TUNE_FEATURES_tune-armv7vethf} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon = "${TUNE_FEATURES_tune-armv7vehf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf-neon = "${TUNE_FEATURES_tune-armv7vethf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vehf-neon-vfpv4} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf-neon-vfpv4 = "${TUNE_FEATURES_tune-armv7vethf-neon-vfpv4} cortexa7"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf} cortexa7hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf} cortexa7hf-vfp cortexa7t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon} cortexa7hf-vfp cortexa7hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon} cortexa7hf-vfp cortexa7hf-neon cortexa7t2hf-vfp cortexa7t2hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vehf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-neon cortexa7hf-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7vethf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-neon cortexa7hf-neon-vfpv4 cortexa7t2hf-vfp cortexa7t2hf-neon cortexa7t2hf-neon-vfpv4"
diff --git a/poky/meta/conf/machine/include/tune-cortexa8.inc b/poky/meta/conf/machine/include/tune-cortexa8.inc
new file mode 100644
index 000000000..8ee8de97f
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa8.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7athf-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa8] = "Enable Cortex-A8 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa8', ' -mcpu=cortex-a8', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa8 cortexa8t cortexa8-neon cortexa8t-neon"
+ARMPKGARCH_tune-cortexa8 = "cortexa8"
+ARMPKGARCH_tune-cortexa8t = "cortexa8"
+ARMPKGARCH_tune-cortexa8-neon = "cortexa8"
+ARMPKGARCH_tune-cortexa8t-neon = "cortexa8"
+TUNE_FEATURES_tune-cortexa8 = "${TUNE_FEATURES_tune-armv7a} cortexa8"
+TUNE_FEATURES_tune-cortexa8t = "${TUNE_FEATURES_tune-armv7at} cortexa8"
+TUNE_FEATURES_tune-cortexa8-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa8-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa8-vfp cortexa8t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa8-vfp cortexa8-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa8-vfp cortexa8-neon cortexa8t2-vfp cortexa8t2-neon"
+
+# HF Tunes
+AVAILTUNES += "cortexa8hf cortexa8thf cortexa8hf-neon cortexa8thf-neon"
+ARMPKGARCH_tune-cortexa8hf = "cortexa8"
+ARMPKGARCH_tune-cortexa8thf = "cortexa8"
+ARMPKGARCH_tune-cortexa8hf-neon = "cortexa8"
+ARMPKGARCH_tune-cortexa8thf-neon = "cortexa8"
+TUNE_FEATURES_tune-cortexa8hf = "${TUNE_FEATURES_tune-armv7ahf} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf = "${TUNE_FEATURES_tune-armv7athf} cortexa8"
+TUNE_FEATURES_tune-cortexa8hf-neon = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf-neon = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa8hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa8hf-vfp cortexa8t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa8hf-vfp cortexa8hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa8hf-vfp cortexa8hf-neon cortexa8t2hf-vfp cortexa8t2hf-neon"
diff --git a/poky/meta/conf/machine/include/tune-cortexa9.inc b/poky/meta/conf/machine/include/tune-cortexa9.inc
new file mode 100644
index 000000000..0cf323c96
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-cortexa9.inc
@@ -0,0 +1,51 @@
+DEFAULTTUNE ?= "armv7athf-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa9] = "Enable Cortex-A9 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa9', ' -mcpu=cortex-a9', '', d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa9 cortexa9t cortexa9-neon cortexa9t-neon"
+ARMPKGARCH_tune-cortexa9 = "cortexa9"
+ARMPKGARCH_tune-cortexa9t = "cortexa9"
+ARMPKGARCH_tune-cortexa9-neon = "cortexa9"
+ARMPKGARCH_tune-cortexa9t-neon = "cortexa9"
+TUNE_FEATURES_tune-cortexa9 = "${TUNE_FEATURES_tune-armv7a} cortexa9"
+TUNE_FEATURES_tune-cortexa9t = "${TUNE_FEATURES_tune-armv7at} cortexa9"
+TUNE_FEATURES_tune-cortexa9-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa9-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa9-vfp cortexa9t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa9-vfp cortexa9-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa9-vfp cortexa9-neon cortexa9t2-vfp cortexa9t2-neon"
+
+# HF Tunes
+AVAILTUNES += "cortexa9hf cortexa9thf cortexa9hf-neon cortexa9thf-neon"
+ARMPKGARCH_tune-cortexa9hf = "cortexa9"
+ARMPKGARCH_tune-cortexa9thf = "cortexa9"
+ARMPKGARCH_tune-cortexa9hf-neon = "cortexa9"
+ARMPKGARCH_tune-cortexa9thf-neon = "cortexa9"
+TUNE_FEATURES_tune-cortexa9hf = "${TUNE_FEATURES_tune-armv7ahf} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf = "${TUNE_FEATURES_tune-armv7athf} cortexa9"
+TUNE_FEATURES_tune-cortexa9hf-neon = "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf-neon = "${TUNE_FEATURES_tune-armv7athf-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa9hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa9hf-vfp cortexa9t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa9hf-vfp cortexa9hf-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa9hf-vfp cortexa9hf-neon cortexa9t2hf-vfp cortexa9t2hf-neon"
+
+# VFPv3 Tunes
+AVAILTUNES += "cortexa9-vfpv3 cortexa9t-vfpv3 cortexa9hf-vfpv3 cortexa9thf-vfpv3"
+ARMPKGARCH_tune-cortexa9-vfpv3 = "cortexa9"
+ARMPKGARCH_tune-cortexa9t-vfpv3 = "cortexa9"
+ARMPKGARCH_tune-cortexa9hf-vfpv3 = "cortexa9"
+ARMPKGARCH_tune-cortexa9thf-vfpv3 = "cortexa9"
+TUNE_FEATURES_tune-cortexa9-vfpv3 = "${TUNE_FEATURES_tune-armv7a-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9t-vfpv3 = "${TUNE_FEATURES_tune-armv7at-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9hf-vfpv3 = "${TUNE_FEATURES_tune-armv7ahf-vfpv3} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf-vfpv3 = "${TUNE_FEATURES_tune-armv7athf-vfpv3} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3} cortexa9-vfp cortexa9-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9t-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3} cortexa9-vfp cortexa9-vfpv3 cortexa9t2-vfp cortexa9t2-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3} cortexa9hf-vfp cortexa9hf-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9thf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3} cortexa9hf-vfp cortexa9hf-vfpv3 cortexa9t2hf-vfp cortexa9t2hf-vfpv3"
diff --git a/poky/meta/conf/machine/include/tune-ep9312.inc b/poky/meta/conf/machine/include/tune-ep9312.inc
new file mode 100644
index 000000000..84ca528d6
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ep9312.inc
@@ -0,0 +1,12 @@
+DEFAULTTUNE ?= "ep9312"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[ep9312] = "Enable Intel PXA27x specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ep9312', ' -march=ep9312 -mcpu=ep9312', '', d)}"
+
+AVAILTUNES += "ep9312"
+ARMPKGARCH_tune-ep9312 = "ep9312"
+# this tune does not include TUNE_FEATURES_tune-armv4t, so there is no armv4 TUNE_FEATURES => no 't' in ARMPKGSFX_THUMB
+TUNE_FEATURES_tune-ep9312 = "thumb ep9312"
+PACKAGE_EXTRA_ARCHS_tune-ep9312 = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} ep9312"
diff --git a/poky/meta/conf/machine/include/tune-i586-nlp.inc b/poky/meta/conf/machine/include/tune-i586-nlp.inc
new file mode 100644
index 000000000..88e59038f
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-i586-nlp.inc
@@ -0,0 +1,19 @@
+# Settings for the GCC(1) cpu-type "quark":
+#
+#
+#
+DEFAULTTUNE ?= "i586-nlp-32"
+
+# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/x86/arch-x86.inc
+
+# x86 with no lock prefix
+TUNEVALID[i586-nlp] = "IA32 with Lock Prefix omitted"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'i586-nlp', ' -march=i586 -Wa,-momit-lock-prefix=yes', '', d)}"
+
+# Quark tune feature
+AVAILTUNES = "i586-nlp-32"
+TUNE_FEATURES_tune-i586-nlp-32 = "${TUNE_FEATURES_tune-x86} i586-nlp"
+BASE_LIB_tune-i586-nlp-32 = "lib"
+TUNE_PKGARCH_tune-i586-nlp-32 = "i586-nlp-32"
+PACKAGE_EXTRA_ARCHS_tune-i586-nlp-32 = "i586-nlp-32"
diff --git a/poky/meta/conf/machine/include/tune-i586.inc b/poky/meta/conf/machine/include/tune-i586.inc
new file mode 100644
index 000000000..1ab17bd40
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-i586.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "i586"
+
+require conf/machine/include/x86/arch-x86.inc
+
+# Extra tune features
+TUNEVALID[i586] = "Enable i586 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'i586', ' -march=i586', '', d)}"
+
+# Extra tune selections
+AVAILTUNES += "i586"
+TUNE_FEATURES_tune-i586 = "${TUNE_FEATURES_tune-x86} i586"
+BASE_LIB_tune-i586 = "lib"
+TUNE_PKGARCH_tune-i586 = "i586"
+PACKAGE_EXTRA_ARCHS_tune-i586 = "${PACKAGE_EXTRA_ARCHS_tune-x86} i586"
diff --git a/poky/meta/conf/machine/include/tune-i686.inc b/poky/meta/conf/machine/include/tune-i686.inc
new file mode 100644
index 000000000..bdb479920
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-i686.inc
@@ -0,0 +1,27 @@
+#
+# The i686 CPU family was introduced with the Intel Pentium Pro in 1995.
+# It has as required feature flags: fpu tsc cx8 cmov.
+#
+# It is the minimum CPU required by the Debian i386 port.
+# https://lists.debian.org/debian-devel-announce/2016/05/msg00001.html
+#
+#
+
+DEFAULTTUNE ?= "i686"
+
+# Set x86 target arch to i686, so that glibc enables SSE optimised memcpy, etc.
+X86ARCH32 ?= "i686"
+
+# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/tune-i586.inc
+
+# Extra tune features
+TUNEVALID[i686] = "Enable i686 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'i686', ' -march=i686', '', d)}"
+
+# Extra tune selections
+AVAILTUNES += "i686"
+TUNE_FEATURES_tune-i686 = "${TUNE_FEATURES_tune-x86} i686"
+BASE_LIB_tune-i686 = "lib"
+TUNE_PKGARCH_tune-i686 = "i686"
+PACKAGE_EXTRA_ARCHS_tune-i686 = "${PACKAGE_EXTRA_ARCHS_tune-i586} i686"
diff --git a/poky/meta/conf/machine/include/tune-iwmmxt.inc b/poky/meta/conf/machine/include/tune-iwmmxt.inc
new file mode 100644
index 000000000..f27423cb2
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-iwmmxt.inc
@@ -0,0 +1,14 @@
+# Configurations for the Intel PXA27x Appications Processor Family.
+# Please use tune-xscale for PXA255/PXA26x based processors.
+
+DEFAULTTUNE ?= "iwmmxt"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[iwmmxt] = "Enable Intel PXA27x specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'iwmmxt', ' -march=iwmmxt -mcpu=iwmmxt', '', d)}"
+
+AVAILTUNES += "iwmmxt"
+ARMPKGARCH_tune-iwmmxt = "iwmmxt"
+TUNE_FEATURES_tune-iwmmxt = "thumb iwmmxt"
+PACKAGE_EXTRA_ARCHS_tune-iwmmxt = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} iwmmxt iwmmxtt"
diff --git a/poky/meta/conf/machine/include/tune-microblaze.inc b/poky/meta/conf/machine/include/tune-microblaze.inc
new file mode 100644
index 000000000..41f0afe66
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-microblaze.inc
@@ -0,0 +1,8 @@
+DEFAULTTUNE ?= "microblaze"
+
+require conf/machine/include/microblaze/arch-microblaze.inc
+
+AVAILTUNES += "microblaze"
+TUNE_FEATURES_tune-microblaze = "microblaze"
+PACKAGE_EXTRA_ARCHS_tune-microblaze = "${TUNE_PKGARCH}"
+
diff --git a/poky/meta/conf/machine/include/tune-mips32.inc b/poky/meta/conf/machine/include/tune-mips32.inc
new file mode 100644
index 000000000..a90c0f059
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips32.inc
@@ -0,0 +1,29 @@
+DEFAULTTUNE ?= "mips32"
+
+require conf/machine/include/mips/arch-mips.inc
+
+TUNEVALID[mips32] = "Enable mips32 specific processor optimizations"
+TUNECONFLICTS[mips32] = "n64 n32"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips32', ' -march=mips32', '', d)}"
+
+# Base Tunes (Hard Float)
+AVAILTUNES += "mips32 mips32el"
+
+TUNE_FEATURES_tune-mips32 = "${TUNE_FEATURES_tune-mips} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32 = "mips32"
+PACKAGE_EXTRA_ARCHS_tune-mips32 = "mips mips32"
+
+TUNE_FEATURES_tune-mips32el = "${TUNE_FEATURES_tune-mipsel} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32el = "mips32el"
+PACKAGE_EXTRA_ARCHS_tune-mips32el = "mipsel mips32el"
+
+# Soft Float
+AVAILTUNES += "mips32-nf mips32el-nf"
+
+TUNE_FEATURES_tune-mips32-nf = "${TUNE_FEATURES_tune-mips-nf} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32-nf = "mips32"
+PACKAGE_EXTRA_ARCHS_tune-mips32-nf = "mips-nf mips32-nf"
+
+TUNE_FEATURES_tune-mips32el-nf = "${TUNE_FEATURES_tune-mipsel-nf} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32el-nf = "mips32el"
+PACKAGE_EXTRA_ARCHS_tune-mips32el-nf = "mipsel-nf mips32el-nf"
diff --git a/poky/meta/conf/machine/include/tune-mips32r2.inc b/poky/meta/conf/machine/include/tune-mips32r2.inc
new file mode 100644
index 000000000..14473ca83
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips32r2.inc
@@ -0,0 +1,29 @@
+DEFAULTTUNE ?= "mips32r2"
+
+require conf/machine/include/tune-mips32.inc
+
+TUNEVALID[mips32r2] = "Enable mips32r2 specific processor optimizations"
+TUNECONFLICTS[mips32r2] = "n64 n32"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips32r2', ' -march=mips32r2', '', d)}"
+
+# Base Tunes (Hard Float)
+AVAILTUNES += "mips32r2 mips32r2el"
+
+TUNE_FEATURES_tune-mips32r2 = "${TUNE_FEATURES_tune-mips} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2 = "mips32r2"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2 = "mips mips32 mips32r2"
+
+TUNE_FEATURES_tune-mips32r2el = "${TUNE_FEATURES_tune-mipsel} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2el = "mips32r2el"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el = "mipsel mips32el mips32r2el"
+
+# Soft Float
+AVAILTUNES += "mips32r2-nf mips32r2el-nf"
+
+TUNE_FEATURES_tune-mips32r2-nf = "${TUNE_FEATURES_tune-mips-nf} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2-nf = "mips32r2"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2-nf = "mips-nf mips32-nf mips32r2-nf"
+
+TUNE_FEATURES_tune-mips32r2el-nf = "${TUNE_FEATURES_tune-mipsel-nf} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2el-nf = "mips32r2el"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el-nf = "mipsel-nf mips32el-nf mips32r2el-nf"
diff --git a/poky/meta/conf/machine/include/tune-mips32r6.inc b/poky/meta/conf/machine/include/tune-mips32r6.inc
new file mode 100644
index 000000000..44369cb59
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips32r6.inc
@@ -0,0 +1,29 @@
+DEFAULTTUNE ?= "mipsisa32r6el"
+
+require conf/machine/include/mips/arch-mips.inc
+
+TUNEVALID[mipsisa32r6] = "Enable mipsisa32r6 specific processor optimizations"
+TUNECONFLICTS[mipsisa32r6] = "n64 n32"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa32r6', ' -march=mips32r6', '', d)}"
+
+# Base Tunes (Hard Float)
+AVAILTUNES += "mipsisa32r6 mipsisa32r6el"
+
+TUNE_FEATURES_tune-mipsisa32r6 = "o32 bigendian mipsisa32r6 fpu-hard r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa32r6 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6 = "mipsisa32r6"
+
+TUNE_FEATURES_tune-mipsisa32r6el = "o32 fpu-hard mipsisa32r6 r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa32r6el = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6el = "mipsisa32r6el"
+
+# Soft Float
+AVAILTUNES += "mipsisa32r6-nf mipsisa32r6el-nf"
+
+TUNE_FEATURES_tune-mipsisa32r6-nf = "o32 bigendian mipsisa32r6 r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa32r6-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6-nf = "mipsisa32r6-nf"
+
+TUNE_FEATURES_tune-mipsisa32r6el-nf = "o32 mipsisa32r6 r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa32r6el-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa32r6el-nf = "mipsisa32r6el-nf"
diff --git a/poky/meta/conf/machine/include/tune-mips64.inc b/poky/meta/conf/machine/include/tune-mips64.inc
new file mode 100644
index 000000000..9be0e0f8d
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips64.inc
@@ -0,0 +1,3 @@
+DEFAULTTUNE ?= "mips64"
+
+require conf/machine/include/tune-mips32r2.inc
diff --git a/poky/meta/conf/machine/include/tune-mips64r2.inc b/poky/meta/conf/machine/include/tune-mips64r2.inc
new file mode 100644
index 000000000..75d7535ad
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips64r2.inc
@@ -0,0 +1,84 @@
+DEFAULTTUNE ?= "mips64r2"
+
+require conf/machine/include/tune-mips64.inc
+
+TUNEVALID[mips64r2] = "Enable mips64r2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mips64r2', ' -march=mips64r2', '', d)}"
+
+# Base tunes
+AVAILTUNES += "mips64r2 mips64r2el"
+
+TUNE_FEATURES_tune-mips64r2 = "${TUNE_FEATURES_tune-mips64} mips64r2"
+BASE_LIB_tune-mips64r2 = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64r2 = "mips64r2"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2 = "mips64 mips64r2"
+
+TUNE_FEATURES_tune-mips64r2el = "${TUNE_FEATURES_tune-mips64el} mips64r2"
+BASE_LIB_tune-mips64r2el = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64r2el = "mips64r2el"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el = "mips64el mips64r2el"
+
+# MIPS 64r2 Soft Float
+AVAILTUNES += "mips64r2-nf mips64r2el-nf"
+
+TUNE_FEATURES_tune-mips64r2-nf = "${TUNE_FEATURES_tune-mips64-nf} mips64r2"
+BASE_LIB_tune-mips64r2-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64r2-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2-nf = "mips64-nf mips64r2-nf"
+
+TUNE_FEATURES_tune-mips64r2el-nf = "${TUNE_FEATURES_tune-mips64el-nf} mips64r2"
+BASE_LIB_tune-mips64r2el-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64r2el-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el-nf = "mips64el-nf mips64r2el-nf"
+
+# MIPS 64r2 n32
+AVAILTUNES += "mips64r2-n32 mips64r2el-n32"
+
+TUNE_FEATURES_tune-mips64r2-n32 = "${TUNE_FEATURES_tune-mips64-n32} mips64r2"
+BASE_LIB_tune-mips64r2-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64r2-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2-n32 = "mips64-n32 mips64r2-n32"
+
+TUNE_FEATURES_tune-mips64r2el-n32 = "${TUNE_FEATURES_tune-mips64el-n32} mips64r2"
+BASE_LIB_tune-mips64r2el-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64r2el-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el-n32 = "mips64el-n32 mips64r2el-n32"
+
+# MIPS 64r2 n32 and Soft Float
+AVAILTUNES += "mips64r2-nf-n32 mips64r2el-nf-n32"
+
+TUNE_FEATURES_tune-mips64r2-nf-n32 = "${TUNE_FEATURES_tune-mips64-nf-n32} mips64r2"
+BASE_LIB_tune-mips64r2-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64r2-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2-nf-n32 = "mips64-nf-n32 mips64r2-nf-n32"
+
+TUNE_FEATURES_tune-mips64r2el-nf-n32 = "${TUNE_FEATURES_tune-mips64el-nf-n32} mips64r2"
+BASE_LIB_tune-mips64r2el-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64r2el-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el-nf-n32 = "mips64el-nf-n32 mips64r2el-nf-n32"
+
+# MIPS 64r2 o32
+AVAILTUNES += "mips64r2-o32 mips64r2el-o32"
+
+TUNE_FEATURES_tune-mips64r2-o32 = "${TUNE_FEATURES_tune-mips64-o32} mips64r2"
+BASE_LIB_tune-mips64r2-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64r2-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2-o32 = "mips mips64-o32 mips64r2-o32"
+
+TUNE_FEATURES_tune-mips64r2el-o32 = "${TUNE_FEATURES_tune-mips64el-o32} mips64r2"
+BASE_LIB_tune-mips64r2el-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64r2el-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el-o32 = "mipsel mips64el-o32 mips64r2el-o32"
+
+# MIPS 64r2 o32 and Soft Float
+AVAILTUNES += "mips64r2-nf-o32 mips64r2el-nf-o32"
+
+TUNE_FEATURES_tune-mips64r2-nf-o32 = "${TUNE_FEATURES_tune-mips64-nf-o32} mips64r2"
+BASE_LIB_tune-mips64r2-nf-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64r2-nf-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2-nf-o32 = "mips-nf mips64r2-nf-o32"
+
+TUNE_FEATURES_tune-mips64r2el-nf-o32 = "${TUNE_FEATURES_tune-mips64el-nf-o32} mips64r2"
+BASE_LIB_tune-mips64r2el-nf-o32 = "lib"
+MIPSPKGSFX_VARIANT_tune-mips64r2el-nf-o32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64r2el-nf-o32 = "mipsel-nf mips64r2el-nf-o32"
diff --git a/poky/meta/conf/machine/include/tune-mips64r6.inc b/poky/meta/conf/machine/include/tune-mips64r6.inc
new file mode 100644
index 000000000..4fe3eedf1
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-mips64r6.inc
@@ -0,0 +1,58 @@
+DEFAULTTUNE ?= "mipsisa64r6el"
+
+require conf/machine/include/mips/arch-mips.inc
+
+TUNEVALID[mipsisa64r6] = "Enable mipsisa64r6 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mipsisa64r6', ' -march=mips64r6', '', d)}"
+
+# Base Tunes
+AVAILTUNES += "mipsisa64r6 mipsisa64r6el"
+
+TUNE_FEATURES_tune-mipsisa64r6 = "bigendian fpu-hard n64 mipsisa64r6 r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6 = "${TUNE_ARCH}"
+BASE_LIB_tune-mipsisa64r6 = "lib64"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6 = "mipsisa64r6"
+
+TUNE_FEATURES_tune-mipsisa64r6el = "fpu-hard r6 n64 mipsisa64r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el = "${TUNE_ARCH}"
+BASE_LIB_tune-mipsisa64r6el = "lib64"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el = "mipsisa64r6el"
+
+# Soft Float
+AVAILTUNES += "mipsisa64r6-nf mipsisa64r6el-nf"
+
+TUNE_FEATURES_tune-mipsisa64r6-nf = "bigendian r6 n64 mipsisa64r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6-nf = "${TUNE_ARCH}"
+BASE_LIB_tune-mipsisa64r6-nf = "lib64"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6-nf = "mipsisa64r6"
+
+TUNE_FEATURES_tune-mipsisa64r6el-nf = "r6 n64 mipsisa64r6"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-nf = "${TUNE_ARCH}"
+BASE_LIB_tune-mipsisa64r6el-nf = "lib64"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-nf = "mipsisa64r6el-nf"
+
+# MIPS 64r6 n32
+AVAILTUNES += "mipsisa64r6-n32 mipsisa64r6el-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6-n32 = "bigendian fpu-hard r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6-n32 = "mipsisa64r6-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6el-n32 = "fpu-hard r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6el-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-n32 = "mipsisa64r6el-n32"
+
+# MIPS 64r6 n32 and Soft Float
+AVAILTUNES += "mipsisa64r6-nf-n32 mipsisa64r6el-nf-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6-nf-n32 = "bigendian r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6-nf-n32 = "mipsisa64r6-nf-n32"
+
+TUNE_FEATURES_tune-mipsisa64r6el-nf-n32 = "r6 n32 mipsisa64r6"
+BASE_LIB_tune-mipsisa64r6el-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mipsisa64r6el-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsisa64r6el-nf-n32 = "mipsisa64r6el-nf-n32"
diff --git a/poky/meta/conf/machine/include/tune-octeon.inc b/poky/meta/conf/machine/include/tune-octeon.inc
new file mode 100644
index 000000000..b5deb8fd8
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-octeon.inc
@@ -0,0 +1,32 @@
+DEFAULTTUNE ?="octeon2"
+
+require conf/machine/include/tune-mips64.inc
+
+AVAILTUNES += "octeon2 octeon2_64 octeon3 octeon3_64"
+
+TUNEVALID[octeon2] = "Enable optimization related to octeon2 support"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeon2', ' -march=octeon2 ', '',d)}"
+
+TUNE_FEATURES_tune-octeon2 = "${TUNE_FEATURES_tune-mips64-n32} octeon2"
+BASE_LIB_tune-octeon2 = "lib32"
+MIPSPKGSFX_VARIANT_tune-octeon2 = "octeon2"
+PACKAGE_EXTRA_ARCHS_tune-octeon2 = "mips64-n32 octeon2-n32"
+
+TUNE_FEATURES_tune-octeon2_64 = "${TUNE_FEATURES_tune-mips64} octeon2"
+BASE_LIB_tune-octeon2_64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-octeon2_64 = "octeon2_64"
+PACKAGE_EXTRA_ARCHS_tune-octeon2_64 = "mips64 octeon2_64"
+
+
+TUNEVALID[octeon3] = "Enable optimization related to octeon3 support"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'octeon3', ' -march=octeon3 ', '',d)}"
+
+TUNE_FEATURES_tune-octeon3 = "${TUNE_FEATURES_tune-mips64-n32} octeon3"
+BASE_LIB_tune-octeon3 = "lib32"
+MIPSPKGSFX_VARIANT_tune-octeon3 = "octeon3"
+PACKAGE_EXTRA_ARCHS_tune-octeon3 = "mips64-n32 octeon3-n32"
+
+TUNE_FEATURES_tune-octeon3_64 = "${TUNE_FEATURES_tune-mips64} octeon3"
+BASE_LIB_tune-octeon3_64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-octeon3_64 = "octeon3_64"
+PACKAGE_EXTRA_ARCHS_tune-octeon3_64 = "mips64 octeon3_64"
diff --git a/poky/meta/conf/machine/include/tune-power5.inc b/poky/meta/conf/machine/include/tune-power5.inc
new file mode 100644
index 000000000..a346c309a
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-power5.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppc64p5"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power5] = "Enable IBM Power5 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'power5', ' -mcpu=power5', '', d)}"
+
+AVAILTUNES += "ppcp5 ppc64p5"
+TUNE_FEATURES_tune-ppcp5 = "m32 fpu-hard power5 altivec"
+BASE_LIB_tune-ppcp5 = "lib"
+TUNE_PKGARCH_tune-ppcp5 = "ppcp5"
+PACKAGE_EXTRA_ARCHS_tune-ppcp5 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp5"
+
+TUNE_FEATURES_tune-ppc64p5 = "m64 fpu-hard power5 altivec"
+BASE_LIB_tune-ppc64p5 = "lib64"
+TUNE_PKGARCH_tune-ppc64p5 = "ppc64p5"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p5 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p5"
+
+# glibc configure options to get power5 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power5', '--with-cpu=power5', '', d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power5', '--with-cpu=power5', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-power6.inc b/poky/meta/conf/machine/include/tune-power6.inc
new file mode 100644
index 000000000..ee200f97b
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-power6.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppcpr6"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power6] = "Enable IBM Power6 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'power6', ' -mcpu=power6', '', d)}"
+
+AVAILTUNES += "ppcp6 ppc64p6"
+TUNE_FEATURES_tune-ppcp6 = "m32 fpu-hard power6 altivec"
+BASE_LIB_tune-ppcp6 = "lib"
+TUNE_PKGARCH_tune-ppcp6 = "ppcp6"
+PACKAGE_EXTRA_ARCHS_tune-ppcp6 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp6"
+
+TUNE_FEATURES_tune-ppc64p6 = "m64 fpu-hard power6 altivec"
+BASE_LIB_tune-ppc64p6 = "lib64"
+TUNE_PKGARCH_tune-ppc64p6 = "ppc64p6"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p6 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p6"
+
+# glibc configure options to get power6 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power6', '--with-cpu=power6', '', d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power6', '--with-cpu=power6', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-power7.inc b/poky/meta/conf/machine/include/tune-power7.inc
new file mode 100644
index 000000000..3a27719be
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-power7.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppcpr7"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power7] = "Enable IBM Power7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'power7', ' -mcpu=power7', '', d)}"
+
+AVAILTUNES += "ppcp7 ppc64p7"
+TUNE_FEATURES_tune-ppcp7 = "m32 fpu-hard power7 altivec"
+BASE_LIB_tune-ppcp7 = "lib"
+TUNE_PKGARCH_tune-ppcp7 = "ppcp7"
+PACKAGE_EXTRA_ARCHS_tune-ppcp7 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp7"
+
+TUNE_FEATURES_tune-ppc64p7 = "m64 fpu-hard power7 altivec"
+BASE_LIB_tune-ppc64p7 = "lib64"
+TUNE_PKGARCH_tune-ppc64p7 = "ppc64p7"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p7 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p7"
+
+# glibc configure options to get power7 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'power7', '--with-cpu=power7', '', d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'power7', '--with-cpu=power7', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-ppc476.inc b/poky/meta/conf/machine/include/tune-ppc476.inc
new file mode 100644
index 000000000..d0011ff21
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppc476.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc476"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc476] = "Enable ppc476 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppc476', ' -mcpu=476', '', d)}"
+
+AVAILTUNES += "ppc476"
+TUNE_FEATURES_tune-ppc476 = "m32 fpu-hard ppc476"
+TUNE_PKGARCH_tune-ppc476 = "ppc476"
+PACKAGE_EXTRA_ARCHS_tune-ppc476 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc476"
+
+# glibc configure options to get 476 specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppc476', '-with-cpu=476', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-ppc603e.inc b/poky/meta/conf/machine/include/tune-ppc603e.inc
new file mode 100644
index 000000000..13f60dd06
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppc603e.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc603e"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc603e] = "Enable ppc603e specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppc603e', ' -mcpu=603e', '', d)}"
+
+AVAILTUNES += "ppc603e"
+TUNE_FEATURES_tune-ppc603e = "m32 fpu-hard ppc603e"
+TUNE_PKGARCH_tune-ppc603e = "ppc603e"
+PACKAGE_EXTRA_ARCHS_tune-ppc603e = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc603e"
+
+# glibc configure options to get 603e specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppc603e', '-with-cpu=603e', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-ppc7400.inc b/poky/meta/conf/machine/include/tune-ppc7400.inc
new file mode 100644
index 000000000..425e8bd21
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppc7400.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc7400"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc7400] = "Enable ppc7400 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppc7400', ' -mcpu=7400 -mno-spe', '', d)}"
+
+AVAILTUNES += "ppc7400"
+TUNE_FEATURES_tune-ppc7400 = "m32 fpu-hard ppc7400 altivec"
+TUNE_PKGARCH_tune-ppc7400 = "ppc7400"
+PACKAGE_EXTRA_ARCHS_tune-ppc7400 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc7400"
+
+# glibc configure options to get 7400 specific library (for sqrt)
+#GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppc7400', '--with-cpu=power4', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-ppce300c2.inc b/poky/meta/conf/machine/include/tune-ppce300c2.inc
new file mode 100644
index 000000000..af21f601a
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce300c2.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "ppce300c2"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce300c2] = "Enable ppce300c2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce300c2', ' -mcpu=e300c2', '', d)}"
+
+AVAILTUNES += "ppce300c2"
+TUNE_FEATURES_tune-ppce300c2 = "m32 fpu-soft ppce300c2"
+TUNE_PKGARCH_tune-ppce300c2 = "ppce300c2"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c2 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c2"
diff --git a/poky/meta/conf/machine/include/tune-ppce300c3.inc b/poky/meta/conf/machine/include/tune-ppce300c3.inc
new file mode 100644
index 000000000..a3d836c50
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce300c3.inc
@@ -0,0 +1,23 @@
+DEFAULTTUNE ?= "ppce300c3"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+AVAILTUNES += "ppce300c3 ppce300c3-nf"
+
+# hard-float
+TUNEVALID[ppce300c3] = "Enable ppce300c3 specific processor optimizations"
+TUNE_FEATURES_tune-ppce300c3 = "${TUNE_FEATURES_tune-powerpc} ppce300c3"
+TUNE_PKGARCH_tune-ppce300c3 = "ppce300c3"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce300c3"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce300c3', ' -mcpu=e300c3', '', d)}"
+
+# glibc config options to make use of e300c3 (603e) specific sqrt/sqrtf routines
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppce300c3', '--with-cpu=e300c3', '', d)}"
+
+# soft-float
+TUNEVALID[ppce300c3-nf] = "Enable ppce300c3 specific processor optimizations (no fpu)"
+TUNE_FEATURES_tune-ppce300c3-nf = "${TUNE_FEATURES_tune-powerpc-nf} ppce300c3-nf"
+TUNE_PKGARCH_tune-ppce300c3-nf = "ppce300c3-nf"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3-nf = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c3-nf"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce300c3-nf', ' -mcpu=e300c3', '', d)}"
+
diff --git a/poky/meta/conf/machine/include/tune-ppce500.inc b/poky/meta/conf/machine/include/tune-ppce500.inc
new file mode 100644
index 000000000..89ec3f38a
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce500.inc
@@ -0,0 +1,20 @@
+DEFAULTTUNE ?= "ppce500"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500] = "Enable ppce500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce500', ' -mcpu=8540', '', d)}"
+
+TUNEVALID[spe] = "Enable SPE ABI extensions"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', [ 'ppce500', 'spe' ], ' -mabi=spe -mspe -mfloat-gprs=single', '', d)}"
+TARGET_FPU .= "${@bb.utils.contains('TUNE_FEATURES', [ 'ppce500' , 'spe' ], 'ppc-efs', '', d)}"
+
+# spe is defined potentially in two places, so we want to be sure it will
+# only write spe once to the ABIEXTENSIONS field.
+SPEABIEXTENSION = "${@bb.utils.filter('TUNE_FEATURES', 'spe', d)}"
+ABIEXTENSION .= "${SPEABIEXTENSION}"
+
+AVAILTUNES += "ppce500"
+TUNE_FEATURES_tune-ppce500 = "m32 spe ppce500"
+TUNE_PKGARCH_tune-ppce500 = "ppce500"
+PACKAGE_EXTRA_ARCHS_tune-ppce500 = "ppce500"
diff --git a/poky/meta/conf/machine/include/tune-ppce500mc.inc b/poky/meta/conf/machine/include/tune-ppce500mc.inc
new file mode 100644
index 000000000..bc26a0f87
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce500mc.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "ppce500mc"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500mc] = "Enable ppce500mc specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce500mc', ' -mcpu=e500mc', '', d)}"
+
+AVAILTUNES += "ppce500mc"
+TUNE_FEATURES_tune-ppce500mc = "m32 fpu-hard ppce500mc"
+TUNE_PKGARCH_tune-ppce500mc = "ppce500mc"
+PACKAGE_EXTRA_ARCHS_tune-ppce500mc = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce500mc"
+
+# glibc configure options to get e500mc specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'ppce500mc', '-with-cpu=e500mc', '', d)}"
+
+# pass -mcpu=e500mc for ppce500mc kernel cross compile
+TARGET_CC_KERNEL_ARCH = "-mcpu=e500mc"
diff --git a/poky/meta/conf/machine/include/tune-ppce500v2.inc b/poky/meta/conf/machine/include/tune-ppce500v2.inc
new file mode 100644
index 000000000..3a006e2ca
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce500v2.inc
@@ -0,0 +1,20 @@
+DEFAULTTUNE ?= "ppce500v2"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500v2] = "Enable ppce500v2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'ppce500v2', ' -mcpu=8548', '', d)}"
+
+TUNEVALID[spe] = "Enable SPE ABI extensions"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', [ 'ppce500v2', 'spe' ], ' -mabi=spe -mspe -mfloat-gprs=double', '', d)}"
+TARGET_FPU .= "${@bb.utils.contains('TUNE_FEATURES', [ 'ppce500v2' , 'spe' ], 'ppc-efd', '', d)}"
+
+# spe is defined potentially in two places, so we want to be sure it will
+# only write spe once to the ABIEXTENSIONS field.
+SPEABIEXTENSION = "${@bb.utils.filter('TUNE_FEATURES', 'spe', d)}"
+ABIEXTENSION .= "${SPEABIEXTENSION}"
+
+AVAILTUNES += "ppce500v2"
+TUNE_FEATURES_tune-ppce500v2 = "m32 spe ppce500v2"
+TUNE_PKGARCH_tune-ppce500v2 = "ppce500v2"
+PACKAGE_EXTRA_ARCHS_tune-ppce500v2 = "ppce500v2"
diff --git a/poky/meta/conf/machine/include/tune-ppce5500.inc b/poky/meta/conf/machine/include/tune-ppce5500.inc
new file mode 100644
index 000000000..cebb24406
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce5500.inc
@@ -0,0 +1,23 @@
+DEFAULTTUNE ?= "ppce5500"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[e5500] = "Enable Freescale e5500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' -mcpu=e5500', '', d)}"
+
+AVAILTUNES += "ppce5500 ppc64e5500"
+TUNE_FEATURES_tune-ppce5500 = "m32 fpu-hard e5500"
+BASE_LIB_tune-ppce5500 = "lib"
+TUNE_PKGARCH_tune-ppce5500 = "ppce5500"
+PACKAGE_EXTRA_ARCHS_tune-ppce5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce5500"
+
+TUNE_FEATURES_tune-ppc64e5500 = "m64 fpu-hard e5500"
+BASE_LIB_tune-ppc64e5500 = "lib64"
+TUNE_PKGARCH_tune-ppc64e5500 = "ppc64e5500"
+PACKAGE_EXTRA_ARCHS_tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64e5500"
+
+# glibc configure options to get e5500 specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'e5500', '--with-cpu=e5500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-ppce6500.inc b/poky/meta/conf/machine/include/tune-ppce6500.inc
new file mode 100644
index 000000000..5db7e760c
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-ppce6500.inc
@@ -0,0 +1,24 @@
+DEFAULTTUNE ?= "ppce6500"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[e6500] = "Enable Freescale e6500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' -mcpu=e6500', '', d)}"
+
+AVAILTUNES += "ppce6500 ppc64e6500"
+TUNE_FEATURES_tune-ppce6500 = "m32 fpu-hard e6500 altivec"
+BASE_LIB_tune-ppce6500 = "lib"
+TUNE_PKGARCH_tune-ppce6500 = "ppce6500"
+PACKAGE_EXTRA_ARCHS_tune-ppce6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce6500"
+
+TUNE_FEATURES_tune-ppc64e6500 = "m64 fpu-hard e6500 altivec"
+BASE_LIB_tune-ppc64e6500 = "lib64"
+TUNE_PKGARCH_tune-ppc64e6500 = "ppc64e6500"
+PACKAGE_EXTRA_ARCHS_tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64e6500"
+
+# glibc configure options to get e6500 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"
diff --git a/poky/meta/conf/machine/include/tune-sh3.inc b/poky/meta/conf/machine/include/tune-sh3.inc
new file mode 100644
index 000000000..80df9a0b6
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-sh3.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "sh3"
+
+require conf/machine/include/sh/arch-sh.inc
+
+TUNEVALID[sh3] = "Enable SH3 optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'sh3', ' -m3', '', d)}"
+
+AVAILTUNES += "sh3 sh3eb"
+TUNE_FEATURES_tune-sh3 = "sh3"
+TUNE_ARCH_tune-sh3 = "sh3"
+TUNE_PKGARCH_tune-sh3 = "sh3"
+PACKAGE_EXTRA_ARCHS_tune-sh3 = "sh sh3"
+
+TUNE_FEATURES_tune-sh3eb = "sh3 bigendian"
+TUNE_ARCH_tune-sh3eb = "sh3eb"
+TUNE_PKGARCH_tune-sh3eb = "sh3eb"
+PACKAGE_EXTRA_ARCHS_tune-sh3eb = "sheb sh3eb"
diff --git a/poky/meta/conf/machine/include/tune-sh4.inc b/poky/meta/conf/machine/include/tune-sh4.inc
new file mode 100644
index 000000000..4160c30e1
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-sh4.inc
@@ -0,0 +1,34 @@
+DEFAULTTUNE ?= "sh4"
+
+# Pull in sh4 for compatibility...
+require conf/machine/include/sh/arch-sh.inc
+
+TUNEVALID[sh4] = "Enable SH4 optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'sh4', ' -m4', '', d)}"
+
+# NOTE: If you want to optimize to sh4a, conf/machine/include/tune-sh4a.inc.
+# But it is not compatible for sh4.
+# The binary optimized by m4a doesn't operate on sh4. It works on sh4a only.
+TUNEVALID[sh4a] = "Enable SH4a optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'sh4a', ' -m4a', '', d)}"
+
+AVAILTUNES += "sh4 sh4eb sh4a sh4aeb"
+TUNE_FEATURES_tune-sh4 = "sh4"
+TUNE_ARCH_tune-sh4 = "sh4"
+TUNE_PKGARCH_tune-sh4 = "sh4"
+PACKAGE_EXTRA_ARCHS_tune-sh4 = "sh sh4"
+
+TUNE_FEATURES_tune-sh4eb = "sh4 bigendian"
+TUNE_ARCH_tune-sh4eb = "sh4eb"
+TUNE_PKGARCH_tune-sh4eb = "sh4eb"
+PACKAGE_EXTRA_ARCHS_tune-sh4eb = "sheb sh4eb"
+
+TUNE_FEATURES_tune-sh4a = "sh4a"
+TUNE_ARCH_tune-sh4a = "sh4"
+TUNE_PKGARCH_tune-sh4a = "sh4a"
+PACKAGE_EXTRA_ARCHS_tune-sh4a = "sh sh4 sh4a"
+
+TUNE_FEATURES_tune-sh4aeb = "sh4a bigendian"
+TUNE_ARCH_tune-sh4aeb = "sh4eb"
+TUNE_PKGARCH_tune-sh4aeb = "sh4aeb"
+PACKAGE_EXTRA_ARCHS_tune-sh4aeb = "sheb sh4eb sh4aeb"
diff --git a/poky/meta/conf/machine/include/tune-strongarm1100.inc b/poky/meta/conf/machine/include/tune-strongarm1100.inc
new file mode 100644
index 000000000..80cfb8ab8
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-strongarm1100.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[strongarm] = "Enable Strongarm 1100 series processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'strongarm', ' -mcpu=strongarm1100', '', d)}"
+
+AVAILTUNES += "strongarm"
+ARMPKGARCH_tune-strongarm = "strongarm"
+TUNE_FEATURES_tune-strongarm = "${TUNE_FEATURES_tune-armv4} strongarm"
+PACKAGE_EXTRA_ARCHS_tune-strongarm = "${PACKAGE_EXTRA_ARCHS_tune-armv4} strongarm"
diff --git a/poky/meta/conf/machine/include/tune-supersparc.inc b/poky/meta/conf/machine/include/tune-supersparc.inc
new file mode 100644
index 000000000..0faa361f1
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-supersparc.inc
@@ -0,0 +1,4 @@
+TUNE_ARCH = "sparc"
+
+TUNE_CCARGS = "-mcpu=supersparc"
+TUNE_PKGARCH = "supersparc"
diff --git a/poky/meta/conf/machine/include/tune-thunderx.inc b/poky/meta/conf/machine/include/tune-thunderx.inc
new file mode 100644
index 000000000..3d43b0f7e
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-thunderx.inc
@@ -0,0 +1,19 @@
+require conf/machine/include/arm/arch-armv8.inc
+
+DEFAULTTUNE ?= "thunderx"
+AVAILTUNES += "thunderx thunderx_be"
+
+TUNEVALID[thunderx] = "Enable instructions for Cavium ThunderX"
+
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thunderx', ' -mcpu=thunderx ', '',d)}"
+
+ARMPKGARCH_tune-thunderx ?= "thunderx"
+ARMPKGARCH_tune-thunderx_be ?= "thunderx_be"
+
+TUNE_FEATURES_tune-thunderx = "${TUNE_FEATURES_tune-aarch64} thunderx"
+TUNE_FEATURES_tune-thunderx_be = "${TUNE_FEATURES_tune-thunderx} bigendian"
+BASE_LIB_tune-thunderx = "lib64"
+BASE_LIB_tune-thunderx_be = "lib64"
+
+PACKAGE_EXTRA_ARCHS_tune-thunderx = "aarch64 thunderx"
+PACKAGE_EXTRA_ARCHS_tune-thunderx_be = "aarch64_be thunderx_be"
diff --git a/poky/meta/conf/machine/include/tune-xscale.inc b/poky/meta/conf/machine/include/tune-xscale.inc
new file mode 100644
index 000000000..0d0733395
--- /dev/null
+++ b/poky/meta/conf/machine/include/tune-xscale.inc
@@ -0,0 +1,16 @@
+DEFAULTTUNE ?= "armv5te"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[xscale] = "Enable PXA255/PXA26x Xscale specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'xscale', ' -mcpu=xscale', '', d)}"
+
+AVAILTUNES += "xscale"
+ARMPKGARCH_tune-xscale = "xscale"
+TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
+PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} xscale xscalet xscalee xscalete"
+
+AVAILTUNES += "xscale-be"
+ARMPKGARCH_tune-xscale-be = "xscale"
+TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
+PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb} xscaleb xscaletb xscaleeb xscaleteb"
diff --git a/poky/meta/conf/machine/include/x86-base.inc b/poky/meta/conf/machine/include/x86-base.inc
new file mode 100644
index 000000000..f8aacea64
--- /dev/null
+++ b/poky/meta/conf/machine/include/x86-base.inc
@@ -0,0 +1,49 @@
+#
+# Base machine settings for X86 architecture BSPs
+#
+
+#
+# common settings for X86 machines
+#
+MACHINE_FEATURES += "screen keyboard pci usbhost ext2 ext3 x86 \
+ acpi serial usbgadget alsa"
+
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+IMAGE_FSTYPES ?= "live"
+NOISO ?= "1"
+
+KERNEL_IMAGETYPE ?= "bzImage"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+#
+# kernel-related variables
+#
+PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ??= "4.15%"
+
+#
+# XSERVER subcomponents, used to build the XSERVER variable
+#
+XSERVER_X86_BASE = "xserver-xorg \
+ "
+
+XSERVER_X86_EXT = " \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'xserver-xorg-extension-glx', '', d)} \
+ xserver-xorg-module-libint10 \
+ "
+
+XSERVER_X86_I915 = "xf86-video-intel \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-i915', '', d)} \
+ "
+
+XSERVER_X86_I965 = "xf86-video-intel \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-i965', '', d)} \
+ "
+
+XSERVER_X86_VESA = "xf86-video-vesa"
+
+XSERVER_X86_FBDEV = "xf86-video-fbdev"
+
+XSERVER_X86_MODESETTING = "xf86-video-modesetting"
diff --git a/poky/meta/conf/machine/include/x86/README b/poky/meta/conf/machine/include/x86/README
new file mode 100644
index 000000000..2b6c46c7e
--- /dev/null
+++ b/poky/meta/conf/machine/include/x86/README
@@ -0,0 +1,24 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial version
+
+Most of the items for the X86 architectures are defined in the single
+arch-x86 file.
+
+Three ABIs are define, m32, mx32 and m64.
+
+The following is the list of X86 specific variables:
+
+X86ARCH32 - This is the 32-bit architecture GNU canonical arch, TUNE_ARCH.
+
+X86ARCH64 - This is the 64-bit architecture GNU canonical arch, TUNE_ARCH.
+
+The TUNE_PKGARCH is defined as follows:
+
+TUNE_PKGARCH = ${TUNE_PKGARCH_tune-${DEFAULTTUNE}}
+
+The package architecture for 32-bit targets is historical and generally
+set to to match the core compatible processor type, i.e. i386.
+
+For 64-bit architectures, the architecture is expected to end in '_64'.
+
+If the x32 ABI is used, then the _64 is further extended with a '_x32'.
diff --git a/poky/meta/conf/machine/include/x86/arch-x86.inc b/poky/meta/conf/machine/include/x86/arch-x86.inc
new file mode 100644
index 000000000..70814b8d4
--- /dev/null
+++ b/poky/meta/conf/machine/include/x86/arch-x86.inc
@@ -0,0 +1,54 @@
+#
+# X86 Architecture definition (IA32, X86_64, and X32)
+#
+
+DEFAULTTUNE ?= "x86"
+TARGET_FPU ?= ""
+X86ARCH32 ?= "i586"
+X86ARCH64 ?= "x86_64"
+
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+
+# ELF32 ABI
+TUNEVALID[m32] = "IA32 ELF32 standard ABI"
+TUNECONFLICTS[m32] = "m64 mx32"
+TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'm32', '${X86ARCH32}', '' ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm32', ' -m32', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'm32', 'x86:', '' ,d)}"
+
+# x32 ABI
+TUNEVALID[mx32] = "IA32e (x86_64) ELF32 standard ABI"
+TUNECONFLICTS[mx32] = "m64 m32"
+TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '${X86ARCH64}', '' ,d)}"
+ABIEXTENSION .= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x32', '' ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'mx32', ' -mx32', '', d)}"
+TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-m elf32_x86_64', '', d)}"
+TUNE_ASARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-x32', '', d)}"
+# user mode qemu doesn't support x32
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '' ,d)}"
+
+# ELF64 ABI
+TUNEVALID[m64] = "IA32e (x86_64) ELF64 standard ABI"
+TUNECONFLICTS[m64] = "m32 mx32"
+TUNE_ARCH .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', '${X86ARCH64}', '' ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'm64', ' -m64', '', d)}"
+
+# Default Tune configurations
+AVAILTUNES += "x86"
+TUNE_FEATURES_tune-x86 = "m32"
+BASE_LIB_tune-x86 = "lib"
+TUNE_PKGARCH_tune-x86 = "x86"
+PACKAGE_EXTRA_ARCHS_tune-x86 = "${TUNE_PKGARCH_tune-x86}"
+
+AVAILTUNES += "x86-64"
+TUNE_FEATURES_tune-x86-64 = "m64"
+BASE_LIB_tune-x86-64 = "lib64"
+TUNE_PKGARCH_tune-x86-64 = "x86_64"
+PACKAGE_EXTRA_ARCHS_tune-x86-64 = "${TUNE_PKGARCH_tune-x86-64}"
+
+AVAILTUNES += "x86-64-x32"
+TUNE_FEATURES_tune-x86-64-x32 = "mx32"
+BASE_LIB_tune-x86-64-x32 = "libx32"
+TUNE_PKGARCH_tune-x86-64-x32 = "x86_64_x32"
+PACKAGE_EXTRA_ARCHS_tune-x86-64-x32 = "${TUNE_PKGARCH_tune-x86-64-x32}"
diff --git a/poky/meta/conf/machine/qemuarm.conf b/poky/meta/conf/machine/qemuarm.conf
new file mode 100644
index 000000000..9403b1e7e
--- /dev/null
+++ b/poky/meta/conf/machine/qemuarm.conf
@@ -0,0 +1,20 @@
+#@TYPE: Machine
+#@NAME: arm_versatile_926ejs
+#@DESCRIPTION: arm_versatile_926ejs
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-arm926ejs.inc
+#require conf/machine/include/tune-arm1136jf-s.inc
+
+KERNEL_IMAGETYPE = "zImage"
+
+SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1"
+
+# For runqemu
+QB_SYSTEM_NAME = "qemu-system-arm"
+QB_MACHINE = "-machine versatilepb"
+QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,115200 console=tty"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-show-cursor -usb -device usb-tablet -device virtio-rng-pci"
+PREFERRED_VERSION_linux-yocto ??= "4.15%"
+QB_DTB = "${@oe.utils.version_less_or_equal('PREFERRED_VERSION_linux-yocto', '4.7', '', 'zImage-versatile-pb.dtb', d)}"
diff --git a/poky/meta/conf/machine/qemuarm64.conf b/poky/meta/conf/machine/qemuarm64.conf
new file mode 100644
index 000000000..242889ac8
--- /dev/null
+++ b/poky/meta/conf/machine/qemuarm64.conf
@@ -0,0 +1,24 @@
+#@TYPE: Machine
+#@NAME: generic armv8 machine
+#@DESCRIPTION: Machine configuration for running a generic armv8
+
+require conf/machine/include/arm/arch-armv8.inc
+require conf/machine/include/qemu.inc
+
+KERNEL_IMAGETYPE = "Image"
+
+SERIAL_CONSOLES ?= "38400;ttyAMA0 38400;hvc0"
+
+# For runqemu
+QB_SYSTEM_NAME = "qemu-system-aarch64"
+QB_MEM = "-m 512"
+QB_MACHINE = "-machine virt"
+QB_CPU = "-cpu cortex-a57"
+QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0,38400"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-show-cursor -device virtio-rng-pci -monitor null"
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
+QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
+QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
+QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
+QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
diff --git a/poky/meta/conf/machine/qemumips.conf b/poky/meta/conf/machine/qemumips.conf
new file mode 100644
index 000000000..986315a64
--- /dev/null
+++ b/poky/meta/conf/machine/qemumips.conf
@@ -0,0 +1,14 @@
+#@TYPE: Machine
+#@NAME: mti_malta32_be MIPS
+#@DESCRIPTION: mti_malta32_be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips32r2.inc
+require conf/machine/include/qemuboot-mips.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/poky/meta/conf/machine/qemumips64.conf b/poky/meta/conf/machine/qemumips64.conf
new file mode 100644
index 000000000..3f91cbe17
--- /dev/null
+++ b/poky/meta/conf/machine/qemumips64.conf
@@ -0,0 +1,14 @@
+#@TYPE: Machine
+#@NAME: mti-malta64-be MIPS64
+#@DESCRIPTION: mti-malta64-be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips64.inc
+require conf/machine/include/qemuboot-mips.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/poky/meta/conf/machine/qemuppc.conf b/poky/meta/conf/machine/qemuppc.conf
new file mode 100644
index 000000000..537b2f677
--- /dev/null
+++ b/poky/meta/conf/machine/qemuppc.conf
@@ -0,0 +1,21 @@
+#@TYPE: Machine
+#@NAME: qemu PPC Emulator setup
+#@DESCRIPTION: Machine configuration for running an PPC system under qemu emulation
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-ppc7400.inc
+
+TARGET_CC_KERNEL_ARCH = "-mno-spe"
+
+KERNEL_IMAGETYPE = "vmlinux"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
+
+# For runqemu
+QB_SYSTEM_NAME = "qemu-system-ppc"
+QB_MACHINE = "-machine mac99"
+QB_CPU = "-cpu G4"
+QB_KERNEL_CMDLINE_APPEND = "console=tty console=ttyS0"
+# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
+QB_OPT_APPEND = "-show-cursor -usb -device usb-tablet -device virtio-rng-pci"
+QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
diff --git a/poky/meta/conf/machine/qemux86-64.conf b/poky/meta/conf/machine/qemux86-64.conf
new file mode 100644
index 000000000..fcc44595e
--- /dev/null
+++ b/poky/meta/conf/machine/qemux86-64.conf
@@ -0,0 +1,37 @@
+#@TYPE: Machine
+#@NAME: common_pc
+#@DESCRIPTION: Machine configuration for running a common x86
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+require conf/machine/include/qemu.inc
+DEFAULTTUNE ?= "core2-64"
+require conf/machine/include/tune-core2.inc
+require conf/machine/include/qemuboot-x86.inc
+
+KERNEL_IMAGETYPE = "bzImage"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
+
+XSERVER = "xserver-xorg \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
+ xf86-video-cirrus \
+ xf86-video-fbdev \
+ xf86-video-vmware \
+ xf86-video-modesetting \
+ xserver-xorg-module-libint10 \
+ "
+
+MACHINE_FEATURES += "x86 pci"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
+
+KERNEL_MODULE_AUTOLOAD += "uvesafb"
+KERNEL_MODULE_PROBECONF += "uvesafb"
+module_conf_uvesafb = "options uvesafb mode_option=${UVESA_MODE}"
+
+WKS_FILE ?= "directdisk.wks"
+do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/poky/meta/conf/machine/qemux86.conf b/poky/meta/conf/machine/qemux86.conf
new file mode 100644
index 000000000..c53f7a92c
--- /dev/null
+++ b/poky/meta/conf/machine/qemux86.conf
@@ -0,0 +1,36 @@
+#@TYPE: Machine
+#@NAME: common_pc
+#@DESCRIPTION: Machine configuration for running a common x86
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-i586.inc
+require conf/machine/include/qemuboot-x86.inc
+
+KERNEL_IMAGETYPE = "bzImage"
+
+SERIAL_CONSOLES ?= "115200;ttyS0 115200;ttyS1"
+
+XSERVER = "xserver-xorg \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast xserver-xorg-extension-glx', '', d)} \
+ xf86-video-cirrus \
+ xf86-video-fbdev \
+ xf86-video-vmware \
+ xf86-video-modesetting \
+ xserver-xorg-module-libint10 \
+ "
+
+MACHINE_FEATURES += "x86 pci"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
+
+KERNEL_MODULE_AUTOLOAD += "uvesafb"
+KERNEL_MODULE_PROBECONF += "uvesafb"
+module_conf_uvesafb = "options uvesafb mode_option=${UVESA_MODE}"
+
+WKS_FILE ?= "directdisk.wks"
+do_image_wic[depends] += "syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot mtools-native:do_populate_sysroot dosfstools-native:do_populate_sysroot"
diff --git a/poky/meta/conf/migrate_localcount.conf b/poky/meta/conf/migrate_localcount.conf
new file mode 100644
index 000000000..e486e03e5
--- /dev/null
+++ b/poky/meta/conf/migrate_localcount.conf
@@ -0,0 +1 @@
+INHERIT += "migrate_localcount"
diff --git a/poky/meta/conf/multiconfig/default.conf b/poky/meta/conf/multiconfig/default.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/conf/multiconfig/default.conf
diff --git a/poky/meta/conf/multilib.conf b/poky/meta/conf/multilib.conf
new file mode 100644
index 000000000..e74dec81a
--- /dev/null
+++ b/poky/meta/conf/multilib.conf
@@ -0,0 +1,28 @@
+
+baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE') or 'INVALID')) or d.getVar('BASELIB')}"
+
+MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
+MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS TARGET_VENDOR"
+
+MULTILIBS ??= "multilib:lib32"
+
+STAGING_DIR_HOST = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
+STAGING_DIR_TARGET = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
+RECIPE_SYSROOT = "${WORKDIR}/${MLPREFIX}recipe-sysroot"
+
+INHERIT += "multilib_global"
+
+BBCLASSEXTEND_append = " ${MULTILIBS}"
+
+MULTILIB_GLOBAL_VARIANTS ?= "lib32 lib64 libx32"
+
+OPKG_ARGS_append = " --force-maintainer --force-overwrite"
+
+# When multilib is enabled, allarch recipes will be installed into the MACHINE
+# sysroot, not MLPREFIXMACHINE. This means that anything using pkg-config to
+# find an allarch pkgconfig file will fail as the PKG_CONFIG_PATH only looks
+# inside the multilib sysroot. Fix this by explicitly adding the MACHINE's
+# architecture-independent pkgconfig location to PKG_CONFIG_PATH.
+PKG_CONFIG_PATH .= ":${WORKDIR}/recipe-sysroot/${datadir}/pkgconfig"
+PKG_CONFIG_PATH[vardepsexclude] = "datadir WORKDIR"
+PKG_CONFIG_PATH[vardepvalueexclude] = ":${WORKDIR}/recipe-sysroot/${datadir}/pkgconfig"
diff --git a/poky/meta/conf/prexport.conf b/poky/meta/conf/prexport.conf
new file mode 100644
index 000000000..12f3acb2d
--- /dev/null
+++ b/poky/meta/conf/prexport.conf
@@ -0,0 +1 @@
+INHERIT += "prexport"
diff --git a/poky/meta/conf/primport.conf b/poky/meta/conf/primport.conf
new file mode 100644
index 000000000..d94ea1b1e
--- /dev/null
+++ b/poky/meta/conf/primport.conf
@@ -0,0 +1 @@
+INHERIT += "primport"
diff --git a/poky/meta/conf/sanity.conf b/poky/meta/conf/sanity.conf
new file mode 100644
index 000000000..390d3427a
--- /dev/null
+++ b/poky/meta/conf/sanity.conf
@@ -0,0 +1,16 @@
+# Sanity checks for common user misconfigurations
+#
+# See sanity.bbclass
+#
+# Expert users can confirm their sanity with "touch conf/sanity.conf"
+BB_MIN_VERSION = "1.35.0"
+
+SANITY_ABIFILE = "${TMPDIR}/abi_version"
+
+SANITY_VERSION ?= "1"
+LOCALCONF_VERSION ?= "1"
+LAYER_CONF_VERSION ?= "7"
+SITE_CONF_VERSION ?= "1"
+
+INHERIT += "sanity"
+
diff --git a/poky/meta/files/common-licenses/AAL b/poky/meta/files/common-licenses/AAL
new file mode 100644
index 000000000..54842265f
--- /dev/null
+++ b/poky/meta/files/common-licenses/AAL
@@ -0,0 +1,51 @@
+
+Attribution Assurance License
+Copyright (c) 2002 by AUTHOR
+PROFESSIONAL IDENTIFICATION * URL
+"PROMOTIONAL SLOGAN FOR AUTHOR`S PROFESSIONAL PRACTICE"
+
+All Rights Reserved
+ATTRIBUTION ASSURANCE LICENSE (adapted from the original BSD license)
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the conditions below are met.
+These conditions require a modest attribution to <AUTHOR> (the
+"Author"), who hopes that its promotional value may help justify the
+thousands of dollars in otherwise billable time invested in writing
+this and other freely available, open-source software.
+
+1. Redistributions of source code, in whole or part and with or without
+modification (the "Code"), must prominently display this GPG-signed
+text in verifiable form.
+2. Redistributions of the Code in binary form must be accompanied by
+this GPG-signed text in any documentation and, each time the resulting
+executable program or a program dependent thereon is launched, a
+prominent display (e.g., splash screen or banner text) of the Author`s
+attribution information, which includes:
+(a) Name ("AUTHOR"),
+(b) Professional identification ("PROFESSIONAL IDENTIFICATION"), and
+(c) URL ("URL").
+3. Neither the name nor any trademark of the Author may be used to
+endorse or promote products derived from this software without specific
+prior written permission.
+4. Users are entirely responsible, to the exclusion of the Author and
+any other persons, for compliance with (1) regulations set by owners or
+administrators of employed equipment, (2) licensing terms of any other
+software, and (3) local regulations regarding use, including those
+regarding import, export, and use of encryption software.
+
+THIS FREE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR OR ANY CONTRIBUTOR BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+EFFECTS OF UNAUTHORIZED OR MALICIOUS NETWORK ACCESS;
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--End of License
+
diff --git a/poky/meta/files/common-licenses/AFL-1.2 b/poky/meta/files/common-licenses/AFL-1.2
new file mode 100644
index 000000000..e8131e722
--- /dev/null
+++ b/poky/meta/files/common-licenses/AFL-1.2
@@ -0,0 +1,123 @@
+
+ Academic Free License
+ Version 1.2
+
+This Academic Free License applies to any original work of authorship
+(the "Original Work") whose owner (the "Licensor") has placed the
+following notice immediately following the copyright notice for the
+Original Work:
+
+Licensed under the Academic Free License version 1.2
+
+Grant of License. Licensor hereby grants to any person obtaining a
+copy of the Original Work ("You") a world-wide, royalty-free,
+non-exclusive, perpetual, non-sublicenseable license (1) to use, copy,
+modify, merge, publish, perform, distribute and/or sell copies of the
+Original Work and derivative works thereof, and (2) under patent claims
+owned or controlled by the Licensor that are embodied in the Original
+Work as furnished by the Licensor, to make, use, sell and offer for
+sale the Original Work and derivative works thereof, subject to the
+following conditions.
+
+Attribution Rights. You must retain, in the Source Code of any
+Derivative Works that You create, all copyright, patent or trademark
+notices from the Source Code of the Original Work, as well as any
+notices of licensing and any descriptive text identified therein as an
+"Attribution Notice." You must cause the Source Code for any Derivative
+Works that You create to carry a prominent Attribution Notice reasonably
+calculated to inform recipients that You have modified the Original Work.
+
+Exclusions from License Grant. Neither the names of Licensor, nor the
+names of any contributors to the Original Work, nor any of their
+trademarks or service marks, may be used to endorse or promote products
+derived from this Original Work without express prior written permission
+of the Licensor.
+
+Warranty and Disclaimer of Warranty. Licensor warrants that the copyright
+in and to the Original Work is owned by the Licensor or that the Original
+Work is distributed by Licensor under a valid current license from the
+copyright owner. Except as expressly stated in the immediately proceeding
+sentence, the Original Work is provided under this License on an "AS IS"
+BASIS and WITHOUT WARRANTY, either express or implied, including, without
+limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
+WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part
+of this License. No license to Original Work is granted hereunder except
+under this disclaimer.
+
+Limitation of Liability. Under no circumstances and under no legal theory,
+whether in tort (including negligence), contract, or otherwise, shall the
+Licensor be liable to any person for any direct, indirect, special,
+incidental, or consequential damages of any character arising as a result
+of this License or the use of the Original Work including, without
+limitation, damages for loss of goodwill, work stoppage, computer failure
+or malfunction, or any and all other commercial damages or losses. This
+limitation of liability shall not apply to liability for death or personal
+injury resulting from Licensor`s negligence to the extent applicable law
+prohibits such limitation. Some jurisdictions do not allow the exclusion or
+limitation of incidental or consequential damages, so this exclusion and
+limitation may not apply to You.
+
+License to Source Code. The term "Source Code" means the preferred form of
+the Original Work for making modifications to it and all available
+documentation describing how to modify the Original Work. Licensor hereby
+agrees to provide a machine-readable copy of the Source Code of the Original
+Work along with each copy of the Original Work that Licensor distributes.
+Licensor reserves the right to satisfy this obligation by placing a
+machine-readable copy of the Source Code in an information repository
+reasonably calculated to permit inexpensive and convenient access by You for
+as long as Licensor continues to distribute the Original Work, and by
+publishing the address of that information repository in a notice immediately
+following the copyright notice that applies to the Original Work.
+
+Mutual Termination for Patent Action. This License shall terminate
+automatically and You may no longer exercise any of the rights granted to You
+by this License if You file a lawsuit in any court alleging that any OSI
+Certified open source software that is licensed under any license containing
+this "Mutual Termination for Patent Action" clause infringes any patent
+claims that are essential to use that software.
+
+Right to Use. You may use the Original Work in all ways not otherwise
+restricted or conditioned by this License or by law, and Licensor promises
+not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2002 Lawrence E. Rosen. All rights reserved.
+Permission is hereby granted to copy and distribute this license without
+modification. This license may not be modified without the express written
+permission of its copyright owner.
+
+--
+END OF LICENSE. The following is intended to describe the essential
+differences between the Academic Free License (AFL) version 1.0 and other
+open source licenses:
+
+The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache
+licenses in many respects but it is intended to solve a few problems with
+those licenses.
+
+* The AFL is written so as to make it clear what software is being
+licensed (by the inclusion of a statement following the copyright notice
+in the software). This way, the license functions better than a template
+license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
+
+* The AFL contains a complete copyright grant to the software. The BSD
+and Apache licenses are vague and incomplete in that respect.
+
+* The AFL contains a complete patent grant to the software. The BSD, MIT,
+UoI/NCSA and Apache licenses rely on an implied patent license and contain
+no explicit patent grant.
+
+* The AFL makes it clear that no trademark rights are granted to the
+licensor`s trademarks. The Apache license contains such a provision, but the
+BSD, MIT and UoI/NCSA licenses do not.
+
+* The AFL includes the warranty by the licensor that it either owns the
+copyright or that it is distributing the software under a license. None of
+the other licenses contain that warranty. All other warranties are disclaimed,
+as is the case for the other licenses.
+
+* The AFL is itself copyrighted (with the right granted to copy and distribute
+without modification). This ensures that the owner of the copyright to the
+license will control changes. The Apache license contains a copyright notice,
+but the BSD, MIT and UoI/NCSA licenses do not.
+
diff --git a/poky/meta/files/common-licenses/AFL-2.0 b/poky/meta/files/common-licenses/AFL-2.0
new file mode 100644
index 000000000..ad27a28d1
--- /dev/null
+++ b/poky/meta/files/common-licenses/AFL-2.0
@@ -0,0 +1,48 @@
+
+The Academic Free License
+ v. 2.0
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+Licensed under the Academic Free License version 2.0
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the public;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, for patent infringement (i) against Licensor with respect to a patent applicable to software or (ii) against any entity with respect to a patent applicable to the Original Work (but excluding combinations of the Original Work with other software or hardware).
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. ¤ 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
+
diff --git a/poky/meta/files/common-licenses/AFL-2.1 b/poky/meta/files/common-licenses/AFL-2.1
new file mode 100644
index 000000000..0284e4f5d
--- /dev/null
+++ b/poky/meta/files/common-licenses/AFL-2.1
@@ -0,0 +1,50 @@
+
+The Academic Free License
+v. 2.1
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+
+Licensed under the Academic Free License version 2.1
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the public;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. &#194;&#167; 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
+
diff --git a/poky/meta/files/common-licenses/AFL-3.0 b/poky/meta/files/common-licenses/AFL-3.0
new file mode 100644
index 000000000..126c259e4
--- /dev/null
+++ b/poky/meta/files/common-licenses/AFL-3.0
@@ -0,0 +1,27 @@
+
+Academic Free License (&#8220;AFL&#8221;) v. 3.0
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+Licensed under the Academic Free License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor&#8217;s reserved rights and remedies, in this Academic Free License;
+d) to perform the Original Work publicly; and
+e) to display the Original Work publicly.
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor&#8217;s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including &#8220;fair use&#8221; or &#8220;fair dealing&#8221;). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+12) Attorneys&#8217; Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
diff --git a/poky/meta/files/common-licenses/AGPL-3.0 b/poky/meta/files/common-licenses/AGPL-3.0
new file mode 100644
index 000000000..dba13ed2d
--- /dev/null
+++ b/poky/meta/files/common-licenses/AGPL-3.0
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/poky/meta/files/common-licenses/ANTLR-PD b/poky/meta/files/common-licenses/ANTLR-PD
new file mode 100644
index 000000000..8b02a8c13
--- /dev/null
+++ b/poky/meta/files/common-licenses/ANTLR-PD
@@ -0,0 +1,32 @@
+
+ANTLR SOFTWARE RIGHTS
+
+ANTLR 1989-2006 Developed by Terence Parr
+Partially supported by University of San Francisco &amp; jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
diff --git a/poky/meta/files/common-licenses/APL-1.0 b/poky/meta/files/common-licenses/APL-1.0
new file mode 100644
index 000000000..4805b1cb6
--- /dev/null
+++ b/poky/meta/files/common-licenses/APL-1.0
@@ -0,0 +1,218 @@
+
+ADAPTIVE PUBLIC LICENSE
+Version 1.0
+THE LICENSED WORK IS PROVIDED UNDER THE TERMS OF THIS ADAPTIVE PUBLIC LICENSE ("LICENSE"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE LICENSED WORK CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS LICENSE AND ITS TERMS, WHETHER OR NOT SUCH RECIPIENT READS THE TERMS OF THIS LICENSE. "LICENSED WORK" AND "RECIPIENT" ARE DEFINED BELOW.
+
+IMPORTANT NOTE: This License is "adaptive", and the generic version or another version of an Adaptive Public License should not be relied upon to determine your rights and obligations under this License. You must read the specific Adaptive Public License that you receive with the Licensed Work, as certain terms are defined at the outset by the Initial Contributor.
+
+See Section 2.2 below, Exhibit A attached, and any Suppfile.txt accompanying this License to determine the specific adaptive features applicable to this License. For example, without limiting the foregoing, (a) for selected choice of law and jurisdiction see Part 3 of Exhibit A; (b) for the selected definition of Third Party see Part 4 of Exhibit A; and (c) for selected patent licensing terms (if any) see Section 2.2 below and Part 6 of Exhibit A.
+
+1. DEFINITIONS.
+
+1.1. "CONTRIBUTION" means:
+
+(a) In the case of the Initial Contributor, the Initial Work distributed under this License by the Initial Contributor; and
+
+(b) In the case of each Subsequent Contributor, the Subsequent Work originating from and distributed by such Subsequent Contributor.
+
+1.2. "DESIGNATED WEB SITE" means the web site having the URL identified in Part 1 of Exhibit A, which URL may be changed by the Initial Contributor by posting on the current Designated Web Site the new URL for at least sixty (60) days.
+
+1.3. "DISTRIBUTOR" means any Person that distributes the Licensed Work or any portion thereof to at least one Third Party.
+
+1.4. "ELECTRONIC DISTRIBUTION MECHANISM" means any mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. "EXECUTABLE" means the Licensed Work in any form other than Source Code.
+
+1.6. "GOVERNING JURISDICTION" means the state, province or other legal jurisdiction identified in Part 3 of Exhibit A.
+
+1.7. "INDEPENDENT MODULE" means a separate module of software and/or data that is not a derivative work of or copied from the Licensed Work or any portion thereof. In addition, a module does not qualify as an Independent Module but instead forms part of the Licensed Work if the module: (a) is embedded in the Licensed Work; (b) is included by reference in the Licensed Work other than by a function call or a class reference; or (c) must be included or contained, in whole or in part, within a file directory or subdirectory actually containing files making up the Licensed Work.
+
+1.8. "INITIAL CONTRIBUTOR" means the Person or entity identified as the Initial Contributor in the notice required by Part 1 of Exhibit A.
+
+1.9. "INITIAL WORK" means the initial Source Code, object code (if any) and documentation for the computer program identified in Part 2 of Exhibit A, as such Source Code, object code and documentation is distributed under this License by the Initial Contributor.
+
+1.10. "LARGER WORK" means a work that combines the Licensed Work or portions thereof with code not governed by this License.
+
+1.11. "LICENSED WORK" means the Initial Work and/or any Subsequent Work, in each case including portions thereof.
+
+1.12. "LICENSE NOTICE" has the meaning assigned in Part 5 of Exhibit A.
+
+1.13. "MODIFICATION" or "MODIFICATIONS" means any change to and/or addition to the Licensed Work.
+
+1.14. "PERSON" means an individual or other legal entity, including a corporation, partnership or other body.
+
+1.15. "RECIPIENT" means any Person who receives or obtains the Licensed Work under this License (by way of example, without limiting the foregoing, any Subsequent Contributor or Distributor).
+
+1.16. "SOURCE CODE" means the source code for a computer program, including the source code for all modules and components of the computer program, plus any associated interface definition files, and scripts used to control compilation and installation of an executable.
+
+1.17. "SUBSEQUENT CONTRIBUTOR" means any Person that makes or contributes to the making of any Subsequent Work and that distributes that Subsequent Work to at least one Third Party.
+
+1.18. "SUBSEQUENT WORK" means a work that has resulted or arises from changes to and/or additions to:
+
+(a) the Initial Work;
+
+(b) any other Subsequent Work; or
+
+(c) to any combination of the Initial Work and any such other Subsequent Work;
+
+where such changes and/or additions originate from a Subsequent Contributor. A Subsequent Work will "originate" from a Subsequent Contributor if the Subsequent Work was a result of efforts by such Subsequent Contributor (or anyone acting on such Subsequent Contributor`s behalf, such as, a contractor or other entity that is engaged by or under the direction of the Subsequent Contributor). For greater certainty, a Subsequent Work expressly excludes and shall not capture within its meaning any Independent Module.
+
+1.19. "SUPPLEMENT FILE" means a file distributed with the Licensed Work having a file name "suppfile.txt".
+
+1.20. "THIRD PARTY" has the meaning assigned in Part 4 of Exhibit A.
+
+2. LICENSE.
+
+2.1. COPYRIGHT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.
+
+(a) Subject to the terms of this License, the Initial Contributor hereby grants each Recipient a world-wide, royalty-free, non-exclusive copyright license to:
+
+(i) reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Initial Work; and
+
+(ii) reproduce, publicly display, publicly perform, distribute, and sublicense any derivative works (if any) prepared by Recipient;
+
+in Source Code and Executable form, either with other Modifications, on an unmodified basis, or as part of a Larger Work.
+
+(b) Subject to the terms of this License, each Subsequent Contributor hereby grants each Recipient a world-wide, royalty-free, non-exclusive copyright license to:
+
+(i) reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Subsequent Work of such Subsequent Contributor; and
+
+(ii) reproduce, publicly display, publicly perform, distribute, and sublicense any derivative works (if any) prepared by Recipient;
+
+in Source Code and Executable form, either with other Modifications, on an unmodified basis, or as part of a Larger Work.
+2.2. PATENT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.
+
+(a) This License does not include or grant any patent license whatsoever from the Initial Contributor, Subsequent Contributor, or any Distributor unless, at the time the Initial Work is first distributed or made available under this License (as the case may be), the Initial Contributor has selected pursuant to Part 6 of Exhibit A the patent terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A. If this is not done then the Initial Work and any other Subsequent Work is made available under the License without any patent license (the "PATENTS-EXCLUDED LICENSE").
+
+(b) However, the Initial Contributor may subsequently distribute or make available (as the case may be) future copies of: (1) the Initial Work; or (2) any Licensed Work distributed by the Initial Contributor which includes the Initial Work (or any portion thereof) and/or any Modification made by the Initial Contributor; available under a License which includes a patent license (the "PATENTS-INCLUDED LICENSE") by selecting pursuant to Part 6 of Exhibit A the patent terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A, when the Initial Contributor distributes or makes available (as the case may be) such future copies under this License.
+
+(c) If any Recipient receives or obtains one or more copies of the Initial Work or any other portion of the Licensed Work under the Patents-Included License, then all licensing of such copies under this License shall include the terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A and that Recipient shall not be able to rely upon the Patents-Excluded License for any such copies. However, all Recipients that receive one or more copies of the Initial Work or any other portion of the Licensed Work under a copy of the License which includes the Patents-Excluded License shall have no patent license with respect to such copies received under the Patents-Excluded License and availability and distribution of such copies, including Modifications made by such Recipient to such copies, shall be under a copy of the License without any patent license.
+
+(d) Where a Recipient uses in combination or combines any copy of the Licensed Work (or portion thereof) licensed under a copy of the License having a Patents-Excluded License with any copy of the Licensed Work (or portion thereof) licensed under a copy of the License having a Patents-Included License, the combination (and any portion thereof) shall, from the first time such Recipient uses, makes available or distributes the combination (as the case may be), be subject to only the terms of the License having the Patents-Included License which shall include the terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A.
+
+2.3. ACKNOWLEDGEMENT AND DISCLAIMER.
+
+Recipient understands and agrees that although Initial Contributor and each Subsequent Contributor grants the licenses to its Contributions set forth herein, no representation, warranty, guarantee or assurance is provided by any Initial Contributor, Subsequent Contributor, or Distributor that the Licensed Work does not infringe the patent or other intellectual property rights of any other entity. Initial Contributor, Subsequent Contributor, and each Distributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise, in relation to the Licensed Works. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, without limiting the foregoing disclaimers, if a third party patent license is required to allow Recipient to distribute the Licensed Work, it is Recipient`s responsibility to acquire that license before distributing the Licensed Work.
+
+2.4. RESERVATION.
+
+Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Initial Contributor, Subsequent Contributor, or Distributor except as expressly stated herein.
+
+3. DISTRIBUTION OBLIGATIONS.
+
+3.1. DISTRIBUTION GENERALLY.
+
+(a) A Subsequent Contributor shall make that Subsequent Contributor`s Subsequent Work(s) available to the public via an Electronic Distribution Mechanism for a period of at least twelve (12) months. The aforesaid twelve (12) month period shall begin within a reasonable time after the creation of the Subsequent Work and no later than sixty (60) days after first distribution of that Subsequent Contributor`s Subsequent Work.
+
+(b) All Distributors must distribute the Licensed Work in accordance with the terms of the License, and must include a copy of this License (including without limitation Exhibit A and the accompanying Supplement File) with each copy of the Licensed Work distributed. In particular, this License must be prominently distributed with the Licensed Work in a file called "license.txt." In addition, the License Notice in Part 5 of Exhibit A must be included at the beginning of all Source Code files, and viewable to a user in any executable such that the License Notice is reasonably brought to the attention of any party using the Licensed Work.
+
+3.2. EXECUTABLE DISTRIBUTIONS OF THE LICENSED WORK.
+
+A Distributor may choose to distribute the Licensed Work, or any portion thereof, in Executable form (an "EXECUTABLE DISTRIBUTION") to any third party, under the terms of Section 2 of this License, provided the Executable Distribution is made available under and accompanied by a copy of this License, AND provided at least ONE of the following conditions is fulfilled:
+
+(a) The Executable Distribution must be accompanied by the Source Code for the Licensed Work making up the Executable Distribution, and the Source Code must be distributed on the same media as the Executable Distribution or using an Electronic Distribution Mechanism; or
+
+(b) The Executable Distribution must be accompanied with a written offer, valid for at least thirty six (36) months, to give any third party under the terms of this License, for a charge no more than the cost of physically performing source distribution, a complete machine-readable copy of the Source Code for the Licensed Work making up the Executable Distribution, to be available and distributed using an Electronic Distribution Mechanism, and such Executable Distribution must remain available in Source Code form to any third party via the Electronic Distribution Mechanism (or any replacement Electronic Distribution Mechanism the particular Distributor may reasonably need to turn to as a substitute) for said at least thirty six (36) months.
+
+For greater certainty, the above-noted requirements apply to any Licensed Work or portion thereof distributed to any third party in Executable form, whether such distribution is made alone, in combination with a Larger Work or Independent Modules, or in some other combination.
+
+3.3. SOURCE CODE DISTRIBUTIONS.
+
+When a Distributor makes the Licensed Work, or any portion thereof, available to any Person in Source Code form, it must be made available under this License and a copy of this License must be included with each copy of the Source Code, situated so that the copy of the License is conspicuously brought to the attention of that Person. For greater clarification, this Section 3.3 applies to all distribution of the Licensed Work in any Source Code form. A Distributor may charge a fee for the physical act of transferring a copy, which charge shall be no more than the cost of physically performing source distribution.
+
+3.4. REQUIRED NOTICES IN SOURCE CODE.
+
+Each Subsequent Contributor must ensure that the notice set out in Part 5 of Exhibit A is included in each file of the Source Code for each Subsequent Work originating from that particular Subsequent Contributor, if such notice is not already included in each such file. If it is not possible to put such notice in a particular Source Code file due to its structure, then the Subsequent Contributor must include such notice in a location (such as a relevant directory in which the file is stored) where a user would be likely to look for such a notice.
+
+3.5. NO DISTRIBUTION REQUIREMENTS FOR INTERNALLY USED MODIFICATIONS.
+
+Notwithstanding Sections 3.2, 3.3 and 3.4, Recipient may, internally within its own corporation or organization use the Licensed Work, including the Initial Work and Subsequent Works, and make Modifications for internal use within Recipient`s own corporation or organization (collectively, "INTERNAL USE MODIFICATIONS"). The Recipient shall have no obligation to distribute, in either Source Code or Executable form, any such Internal Use Modifications made by Recipient in the course of such internal use, except where required below in this Section 3.5. All Internal Use Modifications distributed to any Person, whether or not a Third Party, shall be distributed pursuant to and be accompanied by the terms of this License. If the Recipient chooses to distribute any such Internal Use Modifications to any Third Party, then the Recipient shall be deemed a Subsequent Contributor, and any such Internal Use Modifications distributed to any Third Party shall be deemed a Subsequent Work originating from that Subsequent Contributor, and shall from the first such instance become part of the Licensed Work that must thereafter be distributed and made available to third parties in accordance with the terms of Sections 3.1 to 3.4 inclusive.
+
+3.6. INDEPENDENT MODULES.
+
+This License shall not apply to Independent Modules of any Initial Contributor, Subsequent Contributor, Distributor or any Recipient, and such Independent Modules may be licensed or made available under one or more separate license agreements.
+
+3.7. LARGER WORKS.
+
+Any Distributor or Recipient may create or contribute to a Larger Work by combining any of the Licensed Work with other code not governed by the terms of this License, and may distribute the Larger Work as one or more products. However, in any such case, Distributor or Recipient (as the case may be) must make sure that the requirements of this License are fulfilled for the Licensed Work portion of the Larger Work.
+
+3.8. DESCRIPTION OF DISTRIBUTED MODIFICATIONS.
+
+(a) Each Subsequent Contributor (including the Initial Contributor where the Initial Contributor also qualifies as a Subsequent Contributor) must cause each Subsequent Work created or contributed to by that Subsequent Contributor to contain a file documenting the changes, in accordance with the requirements of Part 1 of the Supplement File, that such Subsequent Contributor made in the creation or contribution to that Subsequent Work. If no Supplement File exists or no requirements are set out in Part 1 of the Supplement File, then there are no requirements for Subsequent Contributors to document changes that they make resulting in Subsequent Works.
+
+(b) The Initial Contributor may at any time introduce requirements or add to or change earlier requirements (in each case, the "EARLIER DESCRIPTION REQUIREMENTS") for documenting changes resulting in Subsequent Works by revising Part 1 of each copy of the Supplement File distributed by the Initial Contributor with future copies of the Licensed Work so that Part 1 then contains new requirements (the "NEW DESCRIPTION REQUIREMENTS") for documenting such changes.
+
+(c) Any Recipient receiving at any time any copy of an Initial Work or any Subsequent Work under a copy of this License (in each case, an "Earlier LICENSED COPY") having the Earlier Description Requirements may choose, with respect to each such Earlier Licensed Copy, to comply with the Earlier Description Requirements or the New Description Requirements. Where a Recipient chooses to comply with the New Description Requirements, that Recipient will, when thereafter distributing any copies of any such Earlier Licensed Copy, include a Supplement File having a section entitled Part 1 that contains a copy of the New Description Requirements.
+
+(d) For greater certainty, the intent of Part 1 of the Supplement File is to provide a mechanism (if any) by which Subsequent Contributors must document changes that they make to the Licensed Work resulting in Subsequent Works. Part 1 of any Supplement File shall not be used to increase or reduce the scope of the license granted in Article 2 of this License or in any other way increase or decrease the rights and obligations of any Recipient, and shall at no time serve as the basis for terminating the License. Further, a Recipient can be required to correct and change its documentation procedures to comply with Part 1 of the Supplement File, but cannot be penalised with damages. Part 1 of any Supplement File is only binding on each Recipient of any Licensed Work to the extent Part 1 sets out the requirements for documenting changes to the Initial Work or any Subsequent Work.
+
+(e) An example of a set of requirements for documenting changes and contributions made by Subsequent Contributor is set out in Part 7 of Exhibit A of this License. Part 7 is a sample only and is not binding on Recipients, unless (subject to the earlier paragraphs of this Section 3.8) those are the requirements that the Initial Contributor includes in Part 1 of the Supplement File with the copies of the Initial Work distributed under this License.
+
+3.9. USE OF DISTRIBUTOR NAME.
+
+The name of a Distributor may not be used by any other Distributor to endorse or promote the Licensed Work or products derived from the Licensed Work, without prior written permission.
+
+3.10. LIMITED RECOGNITION OF INITIAL CONTRIBUTOR.
+
+(a) As a modest attribution to the Initial Contributor, in the hope that its promotional value may help justify the time, money and effort invested in writing the Initial Work, the Initial Contributor may include in Part 2 of the Supplement File a requirement that each time an executable program resulting from the Initial Work or any Subsequent Work, or a program dependent thereon, is launched or run, a prominent display of the Initial Contributor`s attribution information must occur (the "ATTRIBUTION INFORMATION"). The Attribution Information must be included at the beginning of each Source Code file. For greater certainty, the Initial Contributor may specify in the Supplement File that the above attribution requirement only applies to an executable program resulting from the Initial Work or any Subsequent Work, but not a program dependent thereon. The intent is to provide for reasonably modest attribution, therefore the Initial Contributor may not require Recipients to display, at any time, more than the following Attribution Information: (a) a copyright notice including the name of the Initial Contributor; (b) a word or one phrase (not exceeding 10 words); (c) one digital image or graphic provided with the Initial Work; and (d) a URL (collectively, the "ATTRIBUTION LIMITS").
+
+(b) If no Supplement File exists, or no Attribution Information is set out in Part 2 of the Supplement File, then there are no requirements for Recipients to display any Attribution Information of the Initial Contributor.
+
+(c) Each Recipient acknowledges that all trademarks, service marks and/or trade names contained within Part 2 of the Supplement File distributed with the Licensed Work are the exclusive property of the Initial Contributor and may only be used with the permission of the Initial Contributor, or under circumstances otherwise permitted by law, or as expressly set out in this License.
+
+3.11. For greater certainty, any description or attribution provisions contained within a Supplement File may only be used to specify the nature of the description or attribution requirements, as the case may be. Any provision in a Supplement File that otherwise purports to modify, vary, nullify or amend any right, obligation or representation contained herein shall be deemed void to that extent, and shall be of no force or effect.
+
+4. COMMERCIAL USE AND INDEMNITY.
+
+4.1. COMMERCIAL SERVICES.
+
+A Recipient ("COMMERCIAL RECIPIENT") may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations (collectively, "SERVICES") to one or more other Recipients or Distributors. However, such Commercial Recipient may do so only on that Commercial Recipient`s own behalf, and not on behalf of any other Distributor or Recipient, and Commercial Recipient must make it clear than any such warranty, support, indemnity or liability obligation(s) is/are offered by Commercial Recipient alone. At no time may Commercial Recipient use any Services to deny any party the Licensed Work in Source Code or Executable form when so required under any of the other terms of this License. For greater certainty, this Section 4.1 does not diminish any of the other terms of this License, including without limitation the obligation of the Commercial Recipient as a Distributor, when distributing any of the Licensed Work in Source Code or Executable form, to make such distribution royalty-free (subject to the right to charge a fee of no more than the cost of physically performing Source Code or Executable distribution (as the case may be)).
+
+4.2. INDEMNITY.
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this License is intended to facilitate the commercial use of the Licensed Work, the Distributor who includes any of the Licensed Work in a commercial product offering should do so in a manner which does not create potential liability for other Distributors. Therefore, if a Distributor includes the Licensed Work in a commercial product offering or offers any Services, such Distributor ("COMMERCIAL DISTRIBUTOR") hereby agrees to defend and indemnify every other Distributor or Subsequent Contributor (in each case an "INDEMNIFIED PARTY") against any losses, damages and costs (collectively "LOSSES") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Party to the extent caused by the acts or omissions of such Commercial Distributor in connection with its distribution of any of the Licensed Work in a commercial product offering or in connection with any Services. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Party must: (a) promptly notify the Commercial Distributor in writing of such claim; and (b) allow the Commercial Distributor to control, and co-operate with the Commercial Distributor in, the defense and any related settlement negotiations. The Indemnified Party may participate in any such claim at its own expense.
+
+5. VERSIONS OF THE LICENSE.
+
+5.1. NEW VERSIONS.
+
+The Initial Contributor may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+5.2. EFFECT OF NEW VERSIONS.
+
+Once the Licensed Work or any portion thereof has been published by Initial Contributor under a particular version of the License, Recipient may choose to continue to use it under the terms of that version. However, if a Recipient chooses to use the Licensed Work under the terms of any subsequent version of the License published by the Initial Contributor, then from the date of making this choice, the Recipient must comply with the terms of that subsequent version with respect to all further reproduction, preparation of derivative works, public display of, public performance of, distribution and sublicensing by the Recipient in connection with the Licensed Work. No one other than the Initial Contributor has the right to modify the terms applicable to the Licensed Work
+
+6. DISCLAIMER OF WARRANTY.
+
+6.1. GENERAL DISCLAIMER.
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, THE LICENSED WORK IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT ANY REPRESENTATION, WARRANTY, GUARANTEE, ASSURANCE OR CONDITION OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LICENSED WORK IS WITH RECIPIENT. SHOULD ANY LICENSED WORK PROVE DEFECTIVE IN ANY RESPECT, RECIPIENT (NOT THE INITIAL CONTRIBUTOR OR ANY SUBSEQUENT CONTRIBUTOR) ASSUMES THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS CLAUSE CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION THIS DISCLAIMER.
+
+6.2. RESPONSIBILITY OF RECIPIENTS.
+
+Each Recipient is solely responsible for determining the appropriateness of using and distributing the Licensed Work and assumes all risks associated with its exercise of rights under this License, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+7. TERMINATION.
+
+7.1. This License shall continue until terminated in accordance with the express terms herein.
+
+7.2. Recipient may choose to terminate this License automatically at any time.
+
+7.3. This License, including without limitation the rights granted hereunder to a particular Recipient, will terminate automatically if such Recipient is in material breach of any of the terms of this License and fails to cure such breach within sixty (60) days of becoming aware of the breach. Without limiting the foregoing, any material breach by such Recipient of any term of any other License under which such Recipient is granted any rights to the Licensed Work shall constitute a material breach of this License.
+
+7.4. Upon termination of this License by or with respect to a particular Recipient for any reason, all rights granted hereunder and under any other License to that Recipient shall terminate. However, all sublicenses to the Licensed Work which were previously properly granted by such Recipient under a copy of this License (in each case, an "Other License" and in plural, "Other Licenses") shall survive any such termination of this License, including without limitation the rights and obligations under such Other Licenses as set out in their respective Sections 2, 3, 4, 5, 6, 7 and 8, mutatis mutandis, for so long as the respective sublicensees (i.e. other Recipients) remain in compliance with the terms of the copy of this License under which such sublicensees received rights to the Licensed Work. Any termination of such Other Licenses shall be pursuant to their respective Section 7, mutatis mutandis. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+7.5. Upon any termination of this License by or with respect to a particular Recipient, Sections 4.1, 4.2, 6.1, 6.2, 7.4, 7.5, 8.1, and 8.2, together with all provisions of this License necessary for the interpretation and enforcement of same, shall expressly survive such termination.
+
+8. LIMITATION OF LIABILITY.
+
+8.1. IN NO EVENT SHALL ANY OF INITIAL CONTRIBUTOR, ITS SUBSIDIARIES, OR AFFILIATES, OR ANY OF ITS OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, AND/OR AGENTS (AS THE CASE MAY BE), HAVE ANY LIABILITY FOR ANY DIRECT DAMAGES, INDIRECT DAMAGES, PUNITIVE DAMAGES, INCIDENTAL DAMAGES, SPECIAL DAMAGES, EXEMPLARY DAMAGES, CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION LOSS OF USE, DATA OR PROFITS, OR ANY OTHER LOSS ARISING OUT OF OR IN ANY WAY RELATED TO THE USE, INABILITY TO USE, UNAUTHORIZED USE, PERFORMANCE, OR NON-PERFORMANCE OF THE LICENSED WORK OR ANY PART THEREOF OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR THAT RESULT FROM ERRORS, DEFECTS, OMISSIONS, DELAYS IN OPERATION OR TRANSMISSION, OR ANY OTHER FAILURE OF PERFORMANCE), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) IN RELATION TO OR ARISING IN ANY WAY OUT OF THIS LICENSE OR THE USE OR DISTRIBUTION OF THE LICENSED WORK OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. THIS CLAUSE CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION THE LIMITATIONS SET FORTH IN THIS SECTION 8.1.
+
+8.2. EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, EACH RECIPIENT SHALL NOT HAVE ANY LIABILITY FOR ANY EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE LICENSED WORK OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION.
+
+9. GOVERNING LAW AND LEGAL ACTION.
+
+9.1. This License shall be governed by and construed in accordance with the laws of the Governing Jurisdiction assigned in Part 3 of Exhibit A, without regard to its conflict of law provisions. No party may bring a legal action under this License more than one year after the cause of the action arose. Each party waives its rights (if any) to a jury trial in any litigation arising under this License. Note that if the Governing Jurisdiction is not assigned in Part 3 of Exhibit A, then the Governing Jurisdiction shall be the State of New York.
+
+9.2. The courts of the Governing Jurisdiction shall have jurisdiction, but not exclusive jurisdiction, to entertain and determine all disputes and claims, whether for specific performance, injunction, damages or otherwise,
+
diff --git a/poky/meta/files/common-licenses/APSL-1.0 b/poky/meta/files/common-licenses/APSL-1.0
new file mode 100644
index 000000000..024f8228a
--- /dev/null
+++ b/poky/meta/files/common-licenses/APSL-1.0
@@ -0,0 +1,372 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 1.0 - March 16, 1999
+
+Please read this License carefully before downloading this software.
+By downloading and using this software, you are agreeing to be bound by
+the terms of this License. If you do not or cannot agree to the terms
+of this License, please do not download or use the software.
+
+1. General; Definitions. This License applies to any program or other
+work which Apple Computer, Inc. ("Apple") publicly announces as
+subject to this Apple Public Source License and which contains a
+notice placed by Apple identifying such program or work as "Original
+Code" and stating that it is subject to the terms of this Apple Public
+Source License version 1.0 (or subsequent version thereof), as it may
+be revised from time to time by Apple ("License"). As used in this
+License:
+
+1.1 "Applicable Patents" mean: (a) in the case where Apple is the
+grantor of rights, (i) patents or patent applications that are now
+or hereafter acquired, owned by or assigned to Apple and (ii) whose
+claims cover subject matter contained in the Original Code, but only
+to the extent necessary to use, reproduce and/or distribute the
+Original Code without infringement; and (b) in the case where You
+are the grantor of rights, (i) patents and patent applications that
+are now or hereafter acquired, owned by or assigned to You and (ii)
+whose claims cover subject matter in Your Modifications, taken alone
+or in combination with Original Code.
+
+1.2 "Covered Code" means the Original Code, Modifications, the
+combination of Original Code and any Modifications, and/or any
+respective portions thereof.
+
+1.3 "Deploy" means to use, sublicense or distribute Covered Code other
+than for Your internal research and development (R&amp;D), and includes
+without limitation, any and all internal use or distribution of
+Covered Code within Your business or organization except for R&amp;D use,
+as well as direct or indirect sublicensing or distribution of Covered
+Code by You to any third party in any form or manner.
+
+1.4 "Larger Work" means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.5 "Modifications" mean any addition to, deletion from, and/or change
+to, the substance and/or structure of Covered Code. When code is
+released as a series of files, a Modification is: (a) any addition to
+or deletion from the contents of a file containing Covered Code;
+and/or (b) any new file or other representation of computer program
+statements that contains any part of Covered Code.
+
+1.6 "Original Code" means the Source Code of a program or other work
+as originally made available by Apple under this License, including
+the Source Code of any updates or upgrades to such programs or works
+made available by Apple under this License, and that has been
+expressly identified by Apple as such in the header file(s) of such
+work.
+
+1.7 "Source Code" means the human readable form of a program or other
+work that is suitable for making modifications to it, including all
+modules it contains, plus any associated interface definition files,
+scripts used to control compilation and installation of an executable
+(object code).
+
+1.8 "You" or "Your" means an individual or a legal entity exercising
+rights under this License. For legal entities, "You" or "Your"
+includes any entity which controls, is controlled by, or is under
+common control with, You, where "control" means (a) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms
+and conditions of this License, Apple hereby grants You, effective on
+the date You accept this License and download the Original Code, a
+world-wide, royalty-free, non-exclusive license, to the extent of
+Apple`s Applicable Patents and copyrights covering the Original
+Code, to do the following:
+
+2.1 You may use, copy, modify and distribute Original Code, with or
+without Modifications, solely for Your internal research and
+development, provided that You must in each instance:
+
+(a) retain and reproduce in all copies of Original Code the copyright
+and other proprietary notices and disclaimers of Apple as they appear
+in the Original Code, and keep intact all notices in the Original Code
+that refer to this License;
+
+(b) include a copy of this License with every copy of Source Code of
+Covered Code and documentation You distribute, and You may not offer
+or impose any terms on such Source Code that alter or restrict this
+License or the recipients` rights hereunder, except as permitted under
+Section 6; and
+
+(c) completely and accurately document all Modifications that you have
+made and the date of each such Modification, designate the version of
+the Original Code you used, prominently include a file carrying such
+information with the Modifications, and duplicate the notice in
+Exhibit A in each file of the Source Code of all such Modifications.
+
+2.2 You may Deploy Covered Code, provided that You must in each
+instance:
+
+(a) satisfy all the conditions of Section 2.1 with respect to the
+Source Code of the Covered Code;
+
+(b) make all Your Deployed Modifications publicly available in Source
+Code form via electronic distribution (e.g. download from a web site)
+under the terms of this License and subject to the license grants set
+forth in Section 3 below, and any additional terms You may choose to
+offer under Section 6. You must continue to make the Source Code of
+Your Deployed Modifications available for as long as you Deploy the
+Covered Code or twelve (12) months from the date of initial
+Deployment, whichever is longer;
+
+(c) must notify Apple and other third parties of how to obtain Your
+Deployed Modifications by filling out and submitting the required
+information found at
+http://www.apple.com/publicsource/modifications.html; and
+
+(d) if you Deploy Covered Code in object code, executable form only,
+include a prominent notice, in the code itself as well as in related
+documentation, stating that Source Code of the Covered Code is
+available under the terms of this License with information on how and
+where to obtain such Source Code.
+
+3. Your Grants. In consideration of, and as a condition to, the
+licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive,
+royalty-free license, under Your Applicable Patents and other
+intellectual property rights owned or controlled by You, to use,
+reproduce, modify, distribute and Deploy Your Modifications of the
+same scope and extent as Apple`s licenses under Sections 2.1 and 2.2;
+and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive,
+worldwide, royalty-free, perpetual and irrevocable license, under Your
+Applicable Patents and other intellectual property rights owned or
+controlled by You, to use, reproduce, execute, compile, display,
+perform, modify or have modified (for Apple and/or its subsidiaries),
+sublicense and distribute Your Modifications, in any form, through
+multiple tiers of distribution.
+
+4. Larger Works. You may create a Larger Work by combining Covered
+Code with other code not governed by the terms of this License and
+distribute the Larger Work as a single product. In each such
+instance, You must make sure the requirements of this License are
+fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in
+Section 2, no other patent rights, express or implied, are granted
+by Apple herein. Modifications and/or Larger Works may require
+additional patent licenses from Apple which Apple may grant in its
+sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee
+for, warranty, support, indemnity or liability obligations and/or
+other rights consistent with the scope of the license granted herein
+("Additional Terms") to one or more recipients of Covered
+Code. However, You may do so only on Your own behalf and as Your
+sole responsibility, and not on behalf of Apple. You must obtain the
+recipient`s agreement that any such Additional Terms are offered by
+You alone, and You hereby agree to indemnify, defend and hold Apple
+harmless for any liability incurred by or claims asserted against
+Apple by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new
+versions of this License from time to time. Each version will be
+given a distinguishing version number. Once Original Code has been
+published under a particular version of this License, You may
+continue to use it under the terms of that version. You may also
+choose to use such Original Code under the terms of any subsequent
+version of this License published by Apple. No one other than Apple
+has the right to modify the terms applicable to Covered Code created
+under this License.
+
+8. NO WARRANTY OR SUPPORT. The Original Code may contain in whole or
+in part pre-release, untested, or not fully tested works. The
+Original Code may contain errors that could cause failures or loss
+of data, and may be incomplete or contain inaccuracies. You
+expressly acknowledge and agree that use of the Original Code, or
+any portion thereof, is at Your sole and entire risk. THE ORIGINAL
+CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT
+OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (FOR THE PURPOSES OF
+SECTIONS 8 AND 9, APPLE AND APPLE`S LICENSOR(S) ARE COLLECTIVELY
+REFERRED TO AS "APPLE") EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR
+CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY OR
+SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE DOES NOT WARRANT THAT
+THE FUNCTIONS CONTAINED IN THE ORIGINAL CODE WILL MEET YOUR
+REQUIREMENTS, OR THAT THE OPERATION OF THE ORIGINAL CODE WILL BE
+UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE ORIGINAL CODE
+WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN
+BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE SHALL CREATE A
+WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF THIS WARRANTY. You
+acknowledge that the Original Code is not intended for use in the
+operation of nuclear facilities, aircraft navigation, communication
+systems, or air traffic control machines in which case the failure
+of the Original Code could lead to death, personal injury, or severe
+physical or environmental damage.
+
+9. Liability.
+
+9.1 Infringement. If any of the Original Code becomes the subject of
+a claim of infringement ("Affected Original Code"), Apple may, at
+its sole discretion and option: (a) attempt to procure the rights
+necessary for You to continue using the Affected Original Code; (b)
+modify the Affected Original Code so that it is no longer
+infringing; or (c) terminate Your rights to use the Affected
+Original Code, effective immediately upon Apple`s posting of a
+notice to such effect on the Apple web site that is used for
+implementation of this License.
+
+9.2 LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES SHALL APPLE BE
+LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR
+INABILITY TO USE THE ORIGINAL CODE, OR ANY PORTION THEREOF, WHETHER
+UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE),
+PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF
+ESSENTIAL PURPOSE OF ANY REMEDY. In no event shall Apple`s total
+liability to You for all damages under this License exceed the
+amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the
+trademarks or trade names "Apple", "Apple Computer", "Mac OS X",
+"Mac OS X Server" or any other trademarks or trade names belonging
+to Apple (collectively "Apple Marks") and no Apple Marks may be
+used to endorse or promote products derived from the Original Code
+other than as permitted by and in strict compliance at all times
+with Apple`s third party trademark usage guidelines which are
+posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Apple retains all rights, title and interest in and to
+the Original Code and any Modifications made by or on behalf of
+Apple ("Apple Modifications"), and such Apple Modifications will
+not be automatically subject to this License. Apple may, at its
+sole discretion, choose to license such Apple Modifications under
+this License, or on different terms from those contained in this
+License or may choose not to license them at all. Apple`s
+development, use, reproduction, modification, sublicensing and
+distribution of Covered Code will not be subject to this License.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will
+terminate:
+
+(a) automatically without notice from Apple if You fail to comply with
+any term(s) of this License and fail to cure such breach within 30
+days of becoming aware of such breach; (b) immediately in the event of
+the circumstances described in Sections 9.1 and/or 13.6(b); or (c)
+automatically without notice from Apple if You, at any time during the
+term of this License, commence an action for patent infringement
+against Apple.
+
+12.2 Effect of Termination. Upon termination, You agree to
+immediately stop any further use, reproduction, modification and
+distribution of the Covered Code, or Affected Original Code in the
+case of termination under Section 9.1, and to destroy all copies of
+the Covered Code or Affected Original Code (in the case of
+termination under Section 9.1) that are in your possession or
+control. All sublicenses to the Covered Code which have been
+properly granted prior to termination shall survive any termination
+of this License. Provisions which, by their nature, should remain
+in effect beyond the termination of this License shall survive,
+including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and
+13. Neither party will be liable to the other for compensation,
+indemnity or damages of any sort solely as a result of terminating
+this License in accordance with its terms, and termination of this
+License will be without prejudice to any other right or remedy of
+either party.
+
+13. Miscellaneous.
+
+13.1 Export Law Assurances. You may not use or otherwise export or
+re-export the Original Code except as authorized by United States
+law and the laws of the jurisdiction in which the Original Code was
+obtained. In particular, but without limitation, the Original Code
+may not be exported or re-exported (a) into (or to a national or
+resident of) any U.S. embargoed country or (b) to anyone on the
+U.S. Treasury Department`s list of Specially Designated Nationals
+or the U.S. Department of Commerce`s Table of Denial Orders. By
+using the Original Code, You represent and warrant that You are not
+located in, under control of, or a national or resident of any such
+country or on any such list.
+
+13.2 Government End Users. The Covered Code is a "commercial item" as
+defined in FAR 2.101. Government software and technical data
+rights in the Covered Code include only those rights customarily
+provided to the public as defined in this License. This customary
+commercial license in technical data and software is provided in
+accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
+Software) and, for Department of Defense purchases, DFAR
+252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3
+(Rights in Commercial Computer Software or Computer Software
+Documentation). Accordingly, all U.S. Government End Users acquire
+Covered Code with only those rights set forth herein.
+
+13.3 Relationship of Parties. This License will not be construed as
+creating an agency, partnership, joint venture or any other form of
+legal association between You and Apple, and You will not represent
+to the contrary, whether expressly, by implication, appearance or
+otherwise.
+
+13.4 Independent Development. Nothing in this License will impair
+Apple`s right to acquire, license, develop, have others develop for
+it, market and/or distribute technology or products that perform
+the same or similar functions as, or otherwise compete with,
+Modifications, Larger Works, technology or products that You may
+develop, produce, market or distribute.
+
+13.5 Waiver; Construction. Failure by Apple to enforce any provision
+of this License will not be deemed a waiver of future enforcement
+of that or any other provision. Any law or regulation which
+provides that the language of a contract shall be construed against
+the drafter will not apply to this License.
+
+13.6 Severability. (a) If for any reason a court of competent
+jurisdiction finds any provision of this License, or portion
+thereof, to be unenforceable, that provision of the License will be
+enforced to the maximum extent permissible so as to effect the
+economic benefits and intent of the parties, and the remainder of
+this License will continue in full force and effect. (b)
+Notwithstanding the foregoing, if applicable law prohibits or
+restricts You from fully and/or specifically complying with
+Sections 2 and/or 3 or prevents the enforceability of either of
+those Sections, this License will immediately terminate and You
+must immediately discontinue any use of the Covered Code and
+destroy all copies of it that are in your possession or control.
+
+13.7 Dispute Resolution. Any litigation or other dispute resolution
+between You and Apple relating to this License shall take place in
+the Northern District of California, and You and Apple hereby
+consent to the personal jurisdiction of, and venue in, the state
+and federal courts within that District with respect to this
+License. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly
+excluded.
+
+13.8 Entire Agreement; Governing Law. This License constitutes the
+entire agreement between the parties with respect to the subject
+matter hereof. This License shall be governed by the laws of the
+United States and the State of California, except that body of
+California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following
+clause applies: The parties hereby confirm that they have requested
+that this License and all related documents be drafted in English. Les
+parties ont exige que le present contrat et tous les documents
+connexes soient rediges en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+Reserved. This file contains Original Code and/or Modifications of
+Original Code as defined in and that are subject to the Apple Public
+Source License Version 1.0 (the `License`). You may not use this file
+except in compliance with the License. Please obtain a copy of the
+License at http://www.apple.com/publicsource and read it before using
+this file.
+
+The Original Code and all software distributed under the License are
+distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+License for the specific language governing rights and limitations
+under the License."
+
diff --git a/poky/meta/files/common-licenses/APSL-1.1 b/poky/meta/files/common-licenses/APSL-1.1
new file mode 100644
index 000000000..425e46e21
--- /dev/null
+++ b/poky/meta/files/common-licenses/APSL-1.1
@@ -0,0 +1,374 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 1.1 - April 19,1999
+
+Please read this License carefully before downloading this software.
+By downloading and using this software, you are agreeing to be bound
+by the terms of this License. If you do not or cannot agree to the
+terms of this License, please do not download or use the software.
+
+1. General; Definitions. This License applies to any program or other
+work which Apple Computer, Inc. ("Apple") publicly announces as
+subject to this Apple Public Source License and which contains a
+notice placed by Apple identifying such program or work as "Original
+Code" and stating that it is subject to the terms of this Apple Public
+Source License version 1.1 (or subsequent version thereof), as it may
+be revised from time to time by Apple ("License"). As used in this
+License:
+
+1.1 "Affected Original Code" means only those specific portions of
+Original Code that allegedly infringe upon any party`s intellectual
+property rights or are otherwise the subject of a claim of
+infringement.
+
+1.2 "Applicable Patent Rights" mean: (a) in the case where Apple is
+the grantor of rights, (i) claims of patents that are now or hereafter
+acquired, owned by or assigned to Apple and (ii) that cover subject
+matter contained in the Original Code, but only to the extent
+necessary to use, reproduce and/or distribute the Original Code
+without infringement; and (b) in the case where You are the grantor of
+rights, (i) claims of patents that are now or hereafter acquired,
+owned by or assigned to You and (ii) that cover subject matter in Your
+Modifications, taken alone or in combination with Original Code.
+
+1.3 "Covered Code" means the Original Code, Modifications, the
+combination of Original Code and any Modifications, and/or any
+respective portions thereof.
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other
+than for Your internal research and development (R&amp;D), and includes
+without limitation, any and all internal use or distribution of
+Covered Code within Your business or organization except for R&amp;D use,
+as well as direct or indirect sublicensing or distribution of Covered
+Code by You to any third party in any form or manner.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change
+to, the substance and/or structure of Covered Code. When code is
+released as a series of files, a Modification is: (a) any addition to
+or deletion from the contents of a file containing Covered Code;
+and/or (b) any new file or other representation of computer program
+statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other
+work as originally made available by Apple under this License,
+including the Source Code of any updates or upgrades to such programs
+or works made available by Apple under this License, and that has been
+expressly identified by Apple as such in the header file(s) of such
+work; and (b) the object code compiled from such Source Code and
+originally made available by Apple under this License.
+
+1.8 "Source Code" means the human readable form of a program or other
+work that is suitable for making modifications to it, including all
+modules it contains, plus any associated interface definition files,
+scripts used to control compilation and installation of an executable
+(object code).
+
+1.9 "You" or "Your" means an individual or a legal entity exercising
+rights under this License. For legal entities, "You" or "Your"
+includes any entity which controls, is controlled by, or is under
+common control with, You, where "control" means (a) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms
+and conditions of this License, Apple hereby grants You, effective on
+the date You accept this License and download the Original Code, a
+world-wide, royalty-free, non- exclusive license, to the extent of
+Apple`s Applicable Patent Rights and copyrights covering the Original
+Code, to do the following:
+
+2.1 You may use, copy, modify and distribute Original Code, with or
+without Modifications, solely for Your internal research and
+development, provided that You must in each instance:
+
+(a) retain and reproduce in all copies of Original Code the copyright
+and other proprietary notices and disclaimers of Apple as they appear
+in the Original Code, and keep intact all notices in the Original Code
+that refer to this License;
+
+(b) include a copy of this License with every copy of Source Code of
+Covered Code and documentation You distribute, and You may not offer
+or impose any terms on such Source Code that alter or restrict this
+License or the recipients` rights hereunder, except as permitted under
+Section 6; and
+
+(c) completely and accurately document all Modifications that you have
+made and the date of each such Modification, designate the version of
+the Original Code you used, prominently include a file carrying such
+information with the Modifications, and duplicate the notice in
+Exhibit A in each file of the Source Code of all such Modifications.
+
+2.2 You may Deploy Covered Code, provided that You must in each
+ instance:
+
+(a) satisfy all the conditions of Section 2.1 with respect to the
+Source Code of the Covered Code;
+
+(b) make all Your Deployed Modifications publicly available in Source
+Code form via electronic distribution (e.g. download from a web site)
+under the terms of this License and subject to the license grants set
+forth in Section 3 below, and any additional terms You may choose to
+offer under Section 6. You must continue to make the Source Code of
+Your Deployed Modifications available for as long as you Deploy the
+Covered Code or twelve (12) months from the date of initial
+Deployment, whichever is longer;
+
+(c) if You Deploy Covered Code containing Modifications made by You,
+inform others of how to obtain those Modifications by filling out and
+submitting the information found at
+http://www.apple.com/publicsource/modifications.html, if available;
+and
+
+(d) if You Deploy Covered Code in object code, executable form only,
+include a prominent notice, in the code itself as well as in related
+documentation, stating that Source Code of the Covered Code is
+available under the terms of this License with information on how and
+where to obtain such Source Code.
+
+3. Your Grants. In consideration of, and as a condition to, the
+licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive,
+royalty-free license, under Your Applicable Patent Rights and other
+intellectual property rights owned or controlled by You, to use,
+reproduce, modify, distribute and Deploy Your Modifications of the
+same scope and extent as Apple`s licenses under Sections 2.1 and 2.2;
+and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive,
+worldwide, royalty-free, perpetual and irrevocable license, under Your
+Applicable Patent Rights and other intellectual property rights owned
+or controlled by You, to use, reproduce, execute, compile, display,
+perform, modify or have modified (for Apple and/or its subsidiaries),
+sublicense and distribute Your Modifications, in any form, through
+multiple tiers of distribution.
+
+4. Larger Works. You may create a Larger Work by combining Covered
+Code with other code not governed by the terms of this License and
+distribute the Larger Work as a single product. In each such
+instance, You must make sure the requirements of this License are
+fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in
+Section 2, no other patent rights, express or implied, are granted by
+Apple herein. Modifications and/or Larger Works may require
+additional patent licenses from Apple which Apple may grant in its
+sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee
+for, warranty, support, indemnity or liability obligations and/or
+other rights consistent with the scope of the license granted herein
+("Additional Terms") to one or more recipients of Covered
+Code. However, You may do so only on Your own behalf and as Your sole
+responsibility, and not on behalf of Apple. You must obtain the
+recipient`s agreement that any such Additional Terms are offered by
+You alone, and You hereby agree to indemnify, defend and hold Apple
+harmless for any liability incurred by or claims asserted against
+Apple by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new
+versions of this License from time to time. Each version will be
+given a distinguishing version number. Once Original Code has been
+published under a particular version of this License, You may continue
+to use it under the terms of that version. You may also choose to use
+such Original Code under the terms of any subsequent version of this
+License published by Apple. No one other than Apple has the right to
+modify the terms applicable to Covered Code created under this
+License.
+
+8. NO WARRANTY OR SUPPORT. The Original Code may contain in whole or
+in part pre-release, untested, or not fully tested works. The
+Original Code may contain errors that could cause failures or loss of
+data, and may be incomplete or contain inaccuracies. You expressly
+acknowledge and agree that use of the Original Code, or any portion
+thereof, is at Your sole and entire risk. THE ORIGINAL CODE IS
+PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND
+AND APPLE AND APPLE`S LICENSOR(S) (FOR THE PURPOSES OF SECTIONS 8 AND
+9, APPLE AND APPLE`S LICENSOR(S) ARE COLLECTIVELY REFERRED TO AS
+"APPLE") EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+AND/OR CONDITIONS OF MERCHANTABILITY OR SATISFACTORY QUALITY AND
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+RIGHTS. APPLE DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE
+ORIGINAL CODE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF
+THE ORIGINAL CODE WILL BE UNINTERRUPTED OR ERROR- FREE, OR THAT
+DEFECTS IN THE ORIGINAL CODE WILL BE CORRECTED. NO ORAL OR WRITTEN
+INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED
+REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE
+SCOPE OF THIS WARRANTY. You acknowledge that the Original Code is not
+intended for use in the operation of nuclear facilities, aircraft
+navigation, communication systems, or air traffic control machines in
+which case the failure of the Original Code could lead to death,
+personal injury, or severe physical or environmental damage.
+
+9. Liability.
+
+9.1 Infringement. If any portion of, or functionality implemented by,
+the Original Code becomes the subject of a claim of infringement,
+Apple may, at its option: (a) attempt to procure the rights necessary
+for Apple and You to continue using the Affected Original Code; (b)
+modify the Affected Original Code so that it is no longer infringing;
+or (c) suspend Your rights to use, reproduce, modify, sublicense and
+distribute the Affected Original Code until a final determination of
+the claim is made by a court or governmental administrative agency of
+competent jurisdiction and Apple lifts the suspension as set forth
+below. Such suspension of rights will be effective immediately upon
+Apple`s posting of a notice to such effect on the Apple web site that
+is used for implementation of this License. Upon such final
+determination being made, if Apple is legally able, without the
+payment of a fee or royalty, to resume use, reproduction,
+modification, sublicensing and distribution of the Affected Original
+Code, Apple will lift the suspension of rights to the Affected
+Original Code by posting a notice to such effect on the Apple web site
+that is used for implementation of this License. If Apple suspends
+Your rights to Affected Original Code, nothing in this License shall
+be construed to restrict You, at Your option and subject to applicable
+law, from replacing the Affected Original Code with non-infringing
+code or independently negotiating for necessary rights from such third
+party.
+
+9.2 LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES SHALL APPLE BE
+LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO
+USE THE ORIGINAL CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY
+OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY
+OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF
+ANY REMEDY. In no event shall Apple`s total liability to You for all
+damages under this License exceed the amount of fifty dollars
+($50.00).
+
+10. Trademarks. This License does not grant any rights to use the
+trademarks or trade names "Apple", "Apple Computer", "Mac OS X", "Mac
+OS X Server" or any other trademarks or trade names belonging to Apple
+(collectively "Apple Marks") and no Apple Marks may be used to endorse
+or promote products derived from the Original Code other than as
+permitted by and in strict compliance at all times with Apple`s third
+party trademark usage guidelines which are posted at
+http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Apple retains all rights, title and interest in and to
+the Original Code and any Modifications made by or on behalf of Apple
+("Apple Modifications"), and such Apple Modifications will not be
+automatically subject to this License. Apple may, at its sole
+discretion, choose to license such Apple Modifications under this
+License, or on different terms from those contained in this License or
+may choose not to license them at all. Apple`s development, use,
+reproduction, modification, sublicensing and distribution of Covered
+Code will not be subject to this License.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will
+ terminate:
+
+(a) automatically without notice from Apple if You fail to comply with
+any term(s) of this License and fail to cure such breach within 30
+days of becoming aware of such breach; (b) immediately in the event of
+the circumstances described in Section 13.5(b); or (c) automatically
+without notice from Apple if You, at any time during the term of this
+License, commence an action for patent infringement against Apple.
+
+12.2 Effect of Termination. Upon termination, You agree to
+immediately stop any further use, reproduction, modification,
+sublicensing and distribution of the Covered Code and to destroy all
+copies of the Covered Code that are in your possession or control.
+All sublicenses to the Covered Code which have been properly granted
+prior to termination shall survive any termination of this License.
+Provisions which, by their nature, should remain in effect beyond the
+termination of this License shall survive, including but not limited
+to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. Neither party will be
+liable to the other for compensation, indemnity or damages of any sort
+solely as a result of terminating this License in accordance with its
+terms, and termination of this License will be without prejudice to
+any other right or remedy of either party.
+
+13. Miscellaneous.
+
+13.1 Government End Users. The Covered Code is a "commercial item" as
+defined in FAR 2.101. Government software and technical data rights
+in the Covered Code include only those rights customarily provided to
+the public as defined in this License. This customary commercial
+license in technical data and software is provided in accordance with
+FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for
+Department of Defense purchases, DFAR 252.227-7015 (Technical Data --
+Commercial Items) and 227.7202-3 (Rights in Commercial Computer
+Software or Computer Software Documentation). Accordingly, all U.S.
+Government End Users acquire Covered Code with only those rights set
+forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as
+creating an agency, partnership, joint venture or any other form of
+legal association between You and Apple, and You will not represent to
+the contrary, whether expressly, by implication, appearance or
+otherwise.
+
+13.3 Independent Development. Nothing in this License will impair
+Apple`s right to acquire, license, develop, have others develop for
+it, market and/or distribute technology or products that perform the
+same or similar functions as, or otherwise compete with,
+Modifications, Larger Works, technology or products that You may
+develop, produce, market or distribute.
+
+13.4 Waiver; Construction. Failure by Apple to enforce any provision
+of this License will not be deemed a waiver of future enforcement of
+that or any other provision. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+will not apply to this License.
+
+13.5 Severability. (a) If for any reason a court of competent
+jurisdiction finds any provision of this License, or portion thereof,
+to be unenforceable, that provision of the License will be enforced to
+the maximum extent permissible so as to effect the economic benefits
+and intent of the parties, and the remainder of this License will
+continue in full force and effect. (b) Notwithstanding the foregoing,
+if applicable law prohibits or restricts You from fully and/or
+specifically complying with Sections 2 and/or 3 or prevents the
+enforceability of either of those Sections, this License will
+immediately terminate and You must immediately discontinue any use of
+the Covered Code and destroy all copies of it that are in your
+possession or control.
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution
+between You and Apple relating to this License shall take place in the
+Northern District of California, and You and Apple hereby consent to
+the personal jurisdiction of, and venue in, the state and federal
+courts within that District with respect to this License. The
+application of the United Nations Convention on Contracts for the
+International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law. This License constitutes the
+entire agreement between the parties with respect to the subject
+matter hereof. This License shall be governed by the laws of the
+United States and the State of California, except that body of
+California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following
+clause applies: The parties hereby confirm that they have requested
+that this License and all related documents be drafted in English. Les
+parties ont exige que le present contrat et tous les documents
+connexes soient rediges en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2000 Apple Computer, Inc. All Rights
+Reserved. This file contains Original Code and/or Modifications of
+Original Code as defined in and that are subject to the Apple Public
+Source License Version 1.1 (the "License"). You may not use this file
+except in compliance with the License. Please obtain a copy of the
+License at http://www.apple.com/publicsource and read it before using
+this file.
+
+The Original Code and all software distributed under the License are
+distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
+License for the specific language governing rights and limitations
+under the License."
+
diff --git a/poky/meta/files/common-licenses/APSL-1.2 b/poky/meta/files/common-licenses/APSL-1.2
new file mode 100644
index 000000000..58e3530b8
--- /dev/null
+++ b/poky/meta/files/common-licenses/APSL-1.2
@@ -0,0 +1,105 @@
+
+Apple Public Source License Ver. 1.2
+
+1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 1.2 (or subsequent version thereof) ("License"). As used in this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Apple under this License, including the Source Code of any updates or upgrades to such programs or works made available by Apple under this License, and that has been expressly identified by Apple as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Apple under this License.
+
+1.8 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+1.9 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.10 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions.Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+2.1 You may use, reproduce, display, perform, modify and distribute Original Code, with or without Modifications, solely for Your internal research and development and/or Personal Use, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Apple as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and
+
+(b) You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+2.2 You may use, reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code;
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change;
+
+(c) You must make Source Code of all Your Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site); and
+
+(d) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code.
+
+2.3 You expressly acknowledge and agree that although Apple and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Apple or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Apple and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive, royalty-free license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Apple`s licenses under Sections 2.1 and 2.2; and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive, worldwide, royalty-free, perpetual and irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify or have modified (for Apple and/or its subsidiaries), sublicense and distribute Your Modifications, in any form, through multiple tiers of distribution.
+
+4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein. Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple. No one other than Apple has the right to modify the terms applicable to Covered Code created under this License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Apple", "Apple Computer", "Mac OS X", "Mac OS X Server", "QuickTime", "QuickTime Streaming Server" or any other trademarks or trade names belonging to Apple (collectively "Apple Marks") or to any trademark or trade name belonging to any Contributor. No Apple Marks may be used to endorse or promote products derived from the Original Code other than as permitted by and in strict compliance at all times with Apple`s third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License. Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Apple if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+
+(c) automatically without notice from Apple if You, at any time during the term of this License, commence an action for patent infringement against Apple.
+
+12.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+13. Miscellaneous.
+
+13.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or amongYou, Apple or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair Apple`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+13.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution between You and Apple relating to this License shall take place in the Northern District of California, and You and Apple hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2001 Apple Computer, Inc. All Rights Reserved.
+
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Apple Public Source License Version 1.2 (the `License`). You may not use this file except in compliance with the License. Please obtain a copy of the License at http://www.apple.com/publicsource and read it before using this file.
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the specific language governing rights and limitations under the License."
+
diff --git a/poky/meta/files/common-licenses/APSL-2.0 b/poky/meta/files/common-licenses/APSL-2.0
new file mode 100644
index 000000000..d12e8b47f
--- /dev/null
+++ b/poky/meta/files/common-licenses/APSL-2.0
@@ -0,0 +1,102 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 2.0 - August 6, 2003
+
+Please read this License carefully before downloading this software. By downloading or using this software, you are agreeing to be bound by the terms of this License. If you do not or cannot agree to the terms of this License, please do not download or use the software.
+
+Apple Note: In January 2007, Apple changed its corporate name from "Apple Computer, Inc." to "Apple Inc." This change has been reflected below and copyright years updated, but no other changes have been made to the APSL 2.0.
+
+1. General; Definitions. This License applies to any program or other work which Apple Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License"). As used in this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Apple under this License, including the Source Code of any updates or upgrades to such programs or works made available by Apple under this License, and that has been expressly identified by Apple as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Apple under this License
+
+1.8 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.9 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+2.1 Unmodified Code. You may use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy verbatim, unmodified copies of the Original Code, for commercial or non-commercial purposes, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Apple as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and
+
+(b) You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute or Externally Deploy, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+2.2 Modified Code. You may modify Covered Code and use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy Your Modifications and Covered Code, for commercial or non-commercial purposes, provided that in each instance You also meet all of these conditions:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code;
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change; and
+
+(c) If You Externally Deploy Your Modifications, You must make Source Code of all Your Externally Deployed Modifications either available to those to whom You have Externally Deployed Your Modifications, or publicly available. Source Code of Your Externally Deployed Modifications must be released under the terms set forth in this License, including the license grants set forth in Section 3 below, for as long as you Externally Deploy the Covered Code or twelve (12) months from the date of initial External Deployment, whichever is longer. You should preferably distribute the Source Code of Your Externally Deployed Modifications electronically (e.g. download from a web site).
+
+2.3 Distribution of Executable Versions. In addition, if You Externally Deploy Covered Code (Original Code and/or Modifications) in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code.
+
+2.4 Third Party Rights. You expressly acknowledge and agree that although Apple and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Apple or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Apple and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to any person or entity receiving or distributing Covered Code under this License a non-exclusive, royalty-free, perpetual, irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, sublicense, distribute and Externally Deploy Your Modifications of the same scope and extent as Apple`s licenses under Sections 2.1 and 2.2 above.
+
+4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein. Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple. No one other than Apple has the right to modify the terms applicable to Covered Code created under this License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime Streaming Server" or any other trademarks, service marks, logos or trade names belonging to Apple (collectively "Apple Marks") or to any trademark, service mark, logo or trade name belonging to any Contributor. You agree not to use any Apple Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code other than as expressly permitted by and in strict compliance at all times with Apple`s third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License. Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Apple if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+(c) automatically without notice from Apple if You, at any time during the term of this License, commence an action for patent infringement against Apple; provided that Apple did not first commence an action for patent infringement against You in that instance.
+
+12.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code. All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+13. Miscellaneous.
+
+13.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among You, Apple or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair Apple`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+13.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution between You and Apple relating to this License shall take place in the Northern District of California, and You and Apple hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2007 Apple Inc. All Rights Reserved.
+
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Apple Public Source License Version 2.0 (the `License`). You may not use this file except in compliance with the License. Please obtain a copy of the License at http://www.opensource.apple.com/apsl/ and read it before using this file.
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the specific language governing rights and limitations under the License."
+
diff --git a/poky/meta/files/common-licenses/Adobe b/poky/meta/files/common-licenses/Adobe
new file mode 100644
index 000000000..64779da1d
--- /dev/null
+++ b/poky/meta/files/common-licenses/Adobe
@@ -0,0 +1,14 @@
+Copyright 1990-1998 Adobe Systems Incorporated.
+All Rights Reserved.
+
+Patents Pending
+
+NOTICE: All information contained herein is the property of Adobe
+Systems Incorporated.
+
+Permission is granted for redistribution of this file provided
+this copyright notice is maintained intact and that the contents
+of this file are not altered in any way from its original form.
+
+PostScript and Display PostScript are trademarks of Adobe Systems
+Incorporated which may be registered in certain jurisdictions.
diff --git a/poky/meta/files/common-licenses/Apache-1.0 b/poky/meta/files/common-licenses/Apache-1.0
new file mode 100644
index 000000000..26e90892f
--- /dev/null
+++ b/poky/meta/files/common-licenses/Apache-1.0
@@ -0,0 +1,61 @@
+
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * 4. The names "Apache Server" and "Apache Group" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the Apache Group
+ * for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS`` AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Group and was originally based
+ * on public domain software written at the National Center for
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign.
+ * For more information on the Apache Group and the Apache HTTP server
+ * project, please see <http://www.apache.org/>.
+ *
+ */
+
+
+
+
diff --git a/poky/meta/files/common-licenses/Apache-1.1 b/poky/meta/files/common-licenses/Apache-1.1
new file mode 100644
index 000000000..c25ec0056
--- /dev/null
+++ b/poky/meta/files/common-licenses/Apache-1.1
@@ -0,0 +1,60 @@
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
+ */
+
+
diff --git a/poky/meta/files/common-licenses/Apache-2.0 b/poky/meta/files/common-licenses/Apache-2.0
new file mode 100644
index 000000000..b3201abff
--- /dev/null
+++ b/poky/meta/files/common-licenses/Apache-2.0
@@ -0,0 +1,204 @@
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don`t include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/poky/meta/files/common-licenses/Artistic-1.0 b/poky/meta/files/common-licenses/Artistic-1.0
new file mode 100644
index 000000000..807e4d258
--- /dev/null
+++ b/poky/meta/files/common-licenses/Artistic-1.0
@@ -0,0 +1,50 @@
+
+The Artistic License
+Preamble
+
+The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+"Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification.
+"Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder.
+"Copyright Holder" is whoever is named in the copyright or copyrights for the package.
+"You" is you, if you`re thinking about copying or distributing this Package.
+"Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.)
+"Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it.
+1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:
+
+a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package.
+
+b) use the modified Package only within your corporation or organization.
+
+c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following:
+
+a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version.
+
+b) accompany the distribution with the machine-readable source of the Package with your modifications.
+
+c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
diff --git a/poky/meta/files/common-licenses/Artistic-2.0 b/poky/meta/files/common-licenses/Artistic-2.0
new file mode 100644
index 000000000..c0f8d19db
--- /dev/null
+++ b/poky/meta/files/common-licenses/Artistic-2.0
@@ -0,0 +1,203 @@
+
+ The Artistic License 2.0
+
+ Copyright (c) 2000-2006, The Perl Foundation.
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package. If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+ "Copyright Holder" means the individual(s) or organization(s)
+ named in the copyright notice for the entire Package.
+
+ "Contributor" means any party that has contributed code or other
+ material to the Package, in accordance with the Copyright Holder`s
+ procedures.
+
+ "You" and "your" means any person who would like to copy,
+ distribute, or modify the Package.
+
+ "Package" means the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection and/or of
+ those files. A given Package may consist of either the Standard
+ Version, or a Modified Version.
+
+ "Distribute" means providing a copy of the Package or making it
+ accessible to anyone else, or in the case of a company or
+ organization, to others outside of your company or organization.
+
+ "Distributor Fee" means any fee that you charge for Distributing
+ this Package or providing support for this Package to another
+ party. It does not mean licensing fees.
+
+ "Standard Version" refers to the Package if it has not been
+ modified, or has been modified only in ways explicitly requested
+ by the Copyright Holder.
+
+ "Modified Version" means the Package, if it has been changed, and
+ such changes were not explicitly requested by the Copyright
+ Holder.
+
+ "Original License" means this Artistic License as Distributed with
+ the Standard Version of the Package, in its current version or as
+ it may be modified by The Perl Foundation in the future.
+
+ "Source" form means the source code, documentation source, and
+ configuration files for the Package.
+
+ "Compiled" form means the compiled bytecode, object code, binary,
+ or any other form resulting from mechanical transformation or
+ translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1) You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2) You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers. At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3) You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder. The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4) You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+ (a) make the Modified Version available to the Copyright Holder
+ of the Standard Version, under the Original License, so that the
+ Copyright Holder may include your modifications in the Standard
+ Version.
+
+ (b) ensure that installation of your Modified Version does not
+ prevent the user installing or running the Standard Version. In
+ addition, the Modified Version must bear a name that is different
+ from the name of the Standard Version.
+
+ (c) allow anyone who receives a copy of the Modified Version to
+ make the Source form of the Modified Version available to others
+ under
+
+ (i) the Original License or
+
+ (ii) a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5) You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version. Such instructions must be
+valid at the time of your distribution. If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6) You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7) You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package. Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version. In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10) Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11) If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12) This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13) This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14) Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS` AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/BSD b/poky/meta/files/common-licenses/BSD
new file mode 100644
index 000000000..c7a0aa4f9
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD
@@ -0,0 +1,26 @@
+Copyright (c) The Regents of the University of California.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/poky/meta/files/common-licenses/BSD-0-Clause b/poky/meta/files/common-licenses/BSD-0-Clause
new file mode 100644
index 000000000..328bdd6ae
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD-0-Clause
@@ -0,0 +1,12 @@
+Copyright (C) <YEAR> by <OWNER>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/poky/meta/files/common-licenses/BSD-1-Clause b/poky/meta/files/common-licenses/BSD-1-Clause
new file mode 100644
index 000000000..ded889768
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD-1-Clause
@@ -0,0 +1,9 @@
+
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+THIS SOFTWARE IS PROVIDED BY Berkeley Software Design, Inc. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/BSD-2-Clause b/poky/meta/files/common-licenses/BSD-2-Clause
new file mode 100644
index 000000000..ade0f34d5
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD-2-Clause
@@ -0,0 +1,13 @@
+
+The FreeBSD Copyright
+
+Copyright 1992-2010 The FreeBSD Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
+
diff --git a/poky/meta/files/common-licenses/BSD-3-Clause b/poky/meta/files/common-licenses/BSD-3-Clause
new file mode 100644
index 000000000..d13865eba
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD-3-Clause
@@ -0,0 +1,11 @@
+
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/BSD-4-Clause b/poky/meta/files/common-licenses/BSD-4-Clause
new file mode 100644
index 000000000..7b162dec0
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSD-4-Clause
@@ -0,0 +1,29 @@
+
+Copyright (c) <year>, <copyright holder>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the <organization>.
+4. Neither the name of the <organization> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS`` AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/BSL-1.0 b/poky/meta/files/common-licenses/BSL-1.0
new file mode 100644
index 000000000..8ea8eae49
--- /dev/null
+++ b/poky/meta/files/common-licenses/BSL-1.0
@@ -0,0 +1,25 @@
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/BitstreamVera b/poky/meta/files/common-licenses/BitstreamVera
new file mode 100644
index 000000000..e6f03aa57
--- /dev/null
+++ b/poky/meta/files/common-licenses/BitstreamVera
@@ -0,0 +1,160 @@
+Bitstream Vera Fonts Copyright
+
+The fonts have a generous copyright, allowing derivative works (as
+long as "Bitstream" or "Vera" are not in the names), and full
+redistribution (so long as they are not *sold* by themselves). They
+can be be bundled, redistributed and sold with any software.
+
+The fonts are distributed under the following copyright:
+
+Copyright
+=========
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
+Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the fonts accompanying this license ("Fonts") and associated
+documentation files (the "Font Software"), to reproduce and distribute
+the Font Software, including without limitation the rights to use,
+copy, merge, publish, distribute, and/or sell copies of the Font
+Software, and to permit persons to whom the Font Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice
+shall be included in all copies of one or more of the Font Software
+typefaces.
+
+The Font Software may be modified, altered, or added to, and in
+particular the designs of glyphs or characters in the Fonts may be
+modified and additional glyphs or characters may be added to the
+Fonts, only if the fonts are renamed to names not containing either
+the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts
+or Font Software that has been modified and is distributed under the
+"Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but
+no copy of one or more of the Font Software typefaces may be sold by
+itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
+SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome
+Foundation, and Bitstream Inc., shall not be used in advertising or
+otherwise to promote the sale, use or other dealings in this Font
+Software without prior written authorization from the Gnome Foundation
+or Bitstream Inc., respectively. For further information, contact:
+fonts at gnome dot org.
+
+Copyright FAQ
+=============
+
+1. I don't understand the resale restriction... What gives?
+
+Bitstream is giving away these fonts, but wishes to ensure its
+competitors can't just drop the fonts as is into a font sale system
+and sell them as is. It seems fair that if Bitstream can't make money
+from the Bitstream Vera fonts, their competitors should not be able to
+do so either. You can sell the fonts as part of any software package,
+however.
+
+2. I want to package these fonts separately for distribution and
+sale as part of a larger software package or system. Can I do so?
+
+Yes. A RPM or Debian package is a "larger software package" to begin
+with, and you aren't selling them independently by themselves.
+See 1. above.
+
+3. Are derivative works allowed?
+Yes!
+
+4. Can I change or add to the font(s)?
+Yes, but you must change the name(s) of the font(s).
+
+5. Under what terms are derivative works allowed?
+
+You must change the name(s) of the fonts. This is to ensure the
+quality of the fonts, both to protect Bitstream and Gnome. We want to
+ensure that if an application has opened a font specifically of these
+names, it gets what it expects (though of course, using fontconfig,
+substitutions could still could have occurred during font
+opening). You must include the Bitstream copyright. Additional
+copyrights can be added, as per copyright law. Happy Font Hacking!
+
+6. If I have improvements for Bitstream Vera, is it possible they might get
+adopted in future versions?
+
+Yes. The contract between the Gnome Foundation and Bitstream has
+provisions for working with Bitstream to ensure quality additions to
+the Bitstream Vera font family. Please contact us if you have such
+additions. Note, that in general, we will want such additions for the
+entire family, not just a single font, and that you'll have to keep
+both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
+glyphs to the font, they must be stylistically in keeping with Vera's
+design. Vera cannot become a "ransom note" font. Jim Lyles will be
+providing a document describing the design elements used in Vera, as a
+guide and aid for people interested in contributing to Vera.
+
+7. I want to sell a software package that uses these fonts: Can I do so?
+
+Sure. Bundle the fonts with your software and sell your software
+with the fonts. That is the intent of the copyright.
+
+8. If applications have built the names "Bitstream Vera" into them,
+can I override this somehow to use fonts of my choosing?
+
+This depends on exact details of the software. Most open source
+systems and software (e.g., Gnome, KDE, etc.) are now converting to
+use fontconfig (see www.fontconfig.org) to handle font configuration,
+selection and substitution; it has provisions for overriding font
+names and subsituting alternatives. An example is provided by the
+supplied local.conf file, which chooses the family Bitstream Vera for
+"sans", "serif" and "monospace". Other software (e.g., the XFree86
+core server) has other mechanisms for font substitution.
+
+Show details Hide details
+
+Change log
+r2011 by mark.nickel on Mar 3, 2011 Diff
+
+Majority of Multi-Line text editing is in
+the commit. Also added some specific free
+fonts to replace the existing set as we
+need some additional font metrics that we
+use in the Text Editing rendering
+pipeline.
+
+You can see the font licenses in the
+editor/fonts folder under each font.
+
+Still have some cleanup to do to add the
+text formatting (left,right,center) as
+...
+
+Go to:
+Hide comments
+Show comments
+
+Older revisions
+All revisions of this file
+
+File info
+Size: 5953 bytes, 123 lines
+View raw file
+
+File properties
+
+svn:executable
+ *
+
+
diff --git a/poky/meta/files/common-licenses/CATOSL-1.1 b/poky/meta/files/common-licenses/CATOSL-1.1
new file mode 100644
index 000000000..63e8a56b6
--- /dev/null
+++ b/poky/meta/files/common-licenses/CATOSL-1.1
@@ -0,0 +1,116 @@
+
+Computer Associates Trusted Open Source License
+Version 1.1
+
+
+(text)
+
+PLEASE READ THIS DOCUMENT CAREFULLY AND IN ITS ENTIRETY. THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMPUTER ASSOCIATES TRUSTED OPEN SOURCE LICENSE ("LICENSE"). ANY USE, REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES THE RECIPIENT`S ACCEPTANCE OF THIS LICENSE.
+
+License Background
+Computer Associates International, Inc. (CA) believes in open source. We believe that the open source development approach can take appropriate software programs to unprecedented levels of quality, growth, and innovation. To demonstrate our continuing commitment to open source, we are releasing the Program (as defined below) under this License.
+
+This License is intended to permit contributors and recipients of the Program to use the Program, including its source code, freely and without many of the concerns of some other open source licenses. Although we expect the underlying Program, and Contributions (as defined below) made to such Program, to remain open, this License is designed to permit you to maintain your own software programs free of this License unless you choose to do so. Thus, only your Contributions to the Program must be distributed under the terms of this License.
+
+The provisions that follow set forth the terms and conditions under which you may use the Program.
+
+1. DEFINITIONS
+
+1.1 Contribution means (a) in the case of CA, the Original Program; and (b) in the case of each Contributor (including CA), changes and additions to the Program, where such changes and/or additions to the Program originate from and are distributed by that particular Contributor to unaffiliated third parties. A Contribution originates from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributors behalf. Contributions do not include additions to the Program which: (x) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (y) are not derivative works of the Program.
+
+1.2 Contributor means CA and any other person or entity that distributes the Program.
+
+1.3 Contributor Version means as to a Contributor, that version of the Program that includes the Contributors Contribution but not any Contributions made to the Program thereafter.
+
+1.4 Larger Work means a work that combines the Program or portions thereof with code not governed by the terms of this License.
+
+1.5 Licensed Patents mean patents licensable by a Contributor that are infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+1.6 Original Program means the original version of the software to which this License is attached and as released by CA, including source code, object code and documentation, if any.
+
+1.7 Program means the Original Program and Contributions.
+
+1.8 Recipient means anyone who modifies, copies, uses or distributes the Program.
+
+2. GRANT OF RIGHTS
+
+2.1 Subject to the terms of this License, each Contributor hereby grants Recipient an irrevocable, non-exclusive, worldwide, royalty-free license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. For the avoidance of doubt, the license provided in this Section 2.1 shall not include a license to any Licensed Patents of a Contributor.
+
+2.2 Subject to the terms of this License, each Contributor hereby grants Recipient an irrevocable, non-exclusive, worldwide, royalty-free license to the Licensed Patents to the extent necessary to make, use, sell, offer to sell and import the Contribution of such Contributor, if any, in source code and object code form. The license granted in this Section 2.2 shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes the Licensed Patents to be infringed by such combination. Notwithstanding the foregoing, no license is granted under this Section 2.2: (a) for any code or works that do not include the Contributor Version, as it exists and is used in accordance with the terms hereof; (b) for infringements caused by: (i) third party modifications of the Contributor Version; or (ii) the combination of Contributions made by each such Contributor with other software (except as part of the Contributor Version) or other devices; or (c) with respect to Licensed Patents infringed by the Program in the absence of Contributions made by that Contributor.
+
+2.3 Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, except as provided in Section 2.4, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other person or entity. Each Contributor disclaims any liability to Recipient for claims brought by any other person or entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any.
+
+2.4 Each Contributor represents and warrants that it has all right, title and interest in the copyrights in its Contributions, and has the right to grant the copyright licenses set forth in this License.
+
+3. DISTRIBUTION REQUIREMENTS
+
+3.1 If the Program is distributed in object code form, then a prominent notice must be included in the code itself as well as in any related documentation, stating that the source code for the Program is available from the Contributor with information on how and where to obtain the source code. A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+it complies with the terms and conditions of this License; and
+its license agreement:
+effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose, to the maximum extent permitted by applicable law;
+effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits, to the maximum extent permitted by applicable law;
+states that any provisions which are inconsistent with this License are offered by that Contributor alone and not by any other party; and
+states that source code for the Program is available from such Contributor at the cost of distribution, and informs licensees how to obtain it in a reasonable manner.
+3.2 When the Program is made available in source code form:
+
+it must be made available under this License; and
+a copy of this License must be included with each copy of the Program.
+3.3 This License is intended to facilitate the commercial distribution of the Program by any Contributor. However, Contributors may only charge Recipients a one-time, upfront fee for the distribution of the Program. Contributors may not charge Recipients any recurring charge, license fee, or any ongoing royalty for the Recipients exercise of its rights under this License to the Program. Contributors shall make the source code for the Contributor Version they distribute available at a cost, if any, equal to the cost to the Contributor to physically copy and distribute the work. It is not the intent of this License to prohibit a Contributor from charging fees for any service or maintenance that a Contributor may charge to a Recipient, so long as such fees are not an attempt to circumvent the foregoing restrictions on charging royalties or other recurring fees for the Program itself.
+
+3.4 A Contributor may create a Larger Work by combining the Program with other software code not governed by the terms of this License, and distribute the Larger Work as a single product. In such a case, the Contributor must make sure that the requirements of this License are fulfilled for the Program. Any Contributor who includes the Program in a commercial product offering, including as part of a Larger Work, may subject itself, but not any other Contributor, to additional contractual commitments, including, but not limited to, performance warranties and non-infringement representations on suchContributors behalf. No Contributor may create any additional liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (Commercial Contributor) hereby agrees to defend and indemnify every other Contributor (Indemnified Contributor) who made Contributions to the Program distributed by the Commercial Contributor against any losses, damages and costs (collectively Losses) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions, including any additional contractual commitments, of such Commercial Contributor in connection with its distribution of the Program. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement.
+
+3.5 If Contributor has knowledge that a license under a third partys intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must (a) include a text file with the Program source code distribution titled ../IP_ISSUES, and (b) notify CA in writing at Computer Associates International, Inc., One Computer Associates Plaza, Islandia, New York 11749, Attn: Open Source Group or by email at opensource@ca.com, both describing the claim and the party making the claim in sufficient detail that a Recipient and CA will know whom to contact with regard to such matter. If Contributor obtains such knowledge after the Contribution is made available, Contributor shall also promptly modify the IP_ISSUES file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Program that such new knowledge has been obtained.
+
+3.6 Recipient shall not remove, obscure, or modify any CA or other Contributor copyright or patent proprietary notices appearing in the Program, whether in the source code, object code or in any documentation. In addition to the obligations set forth in Section 4, each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. CONTRIBUTION RESTRICTIONS
+
+4.1 Each Contributor must cause the Program to which the Contributor provides a Contribution to contain a file documenting the changes the Contributor made to create its version of the Program and the date of any change. Each Contributor must also include a prominent statement that the Contribution is derived, directly or indirectly, from the Program distributed by a prior Contributor, including the name of the prior Contributor from which such Contribution was derived, in (a) the Program source code, and (b) in any notice in an executable version or related documentation in which the Contributor describes the origin or ownership of the Program.
+
+5. NO WARRANTY
+
+5.1 EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, THE PROGRAM IS PROVIDED AS IS AND IN ITS PRESENT STATE AND CONDITION. NO WARRANTY, REPRESENTATION, CONDITION, UNDERTAKING OR TERM, EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, AS TO THE CONDITION, QUALITY, DURABILITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE OR USE OF THE PROGRAM IS GIVEN OR ASSUMED BY ANY CONTRIBUTOR AND ALL SUCH WARRANTIES, REPRESENTATIONS, CONDITIONS, UNDERTAKINGS AND TERMS ARE HEREBY EXCLUDED TO THE FULLEST EXTENT PERMITTED BY LAW.
+
+5.2 Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this License, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+5.3 Each Recipient acknowledges that the Program is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Program could lead to death, personal injury, or severe physical or environmental damage.
+
+6. DISCLAIMER OF LIABILITY
+
+6.1 EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, AND TO THE EXTENT PERMITTED BY LAW, NO CONTRIBUTOR SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. TRADEMARKS AND BRANDING
+
+7.1 This License does not grant any Recipient or any third party any rights to use the trademarks or trade names now or subsequently posted at http://www.ca.com/catrdmrk.htm, or any other trademarks, service marks, logos or trade names belonging to CA (collectively CA Marks) or to any trademark, service mark, logo or trade name belonging to any Contributor. Recipient agrees not to use any CA Marks in or as part of the name of products derived from the Original Program or to endorse or promote products derived from the Original Program.
+
+7.2 Subject to Section 7.1, Recipients may distribute the Program under trademarks, logos, and product names belonging to the Recipient provided that all copyright and other attribution notices remain in the Program.
+
+8. PATENT LITIGATION
+
+8.1 If Recipient institutes patent litigation against any person or entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipients patent(s), then such Recipients rights granted under Section 2.2 shall terminate as of the date such litigation is filed.
+
+9. OWNERSHIP
+
+9.1 Subject to the licenses granted under this License in Sections 2.1 and 2.2 above, each Contributor retains all rights, title and interest in and to any Contributions made by such Contributor. CA retains all rights, title and interest in and to the Original Program and any Contributions made by or on behalf of CA (CA Contributions), and such CA Contributions will not be automatically subject to this License. CA may, at its sole discretion, choose to license such CA Contributions under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+10. TERMINATION
+
+10.1 All of Recipients rights under this License shall terminate if it fails to comply with any of the material terms or conditions of this License and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If Recipients rights under this License terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipients obligations under this License and any licenses granted by Recipient as a Contributor relating to the Program shall continue and survive termination.
+
+11. GENERAL
+
+11.1 If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+11.2 CA may publish new versions (including revisions) of this License from time to time. Each new version of the License will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the License under which it was received. In addition, after a new version of the License is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than CA has the right to modify this License.
+
+11.3 If it is impossible for Recipient to comply with any of the terms of this License with respect to some or all of the Program due to statute, judicial order, or regulation, then Recipient must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the IP_ISSUES file described in Section 3.5 and must be included with all distributions of the Program source code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a Recipient of ordinary skill to be able to understand it.
+
+11.4 This License is governed by the laws of the State of New York. No Recipient will bring a legal action under this License more than one year after the cause of action arose. Each Recipient waives its rights to a jury trial in any resulting litigation. Any litigation or other dispute resolution between a Recipient and CA relating to this License shall take place in the State of New York, and Recipient and CA hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that district with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+11.5 Where Recipient is located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties contractantes confirment qu`elles ont exige que le present contrat et tous les documents associes soient rediges en anglais.
+
+11.6 The Program is subject to all export and import laws, restrictions and regulations of the country in which Recipient receives the Program. Recipient is solely responsible for complying with and ensuring that Recipient does not export, re-export, or import the Program in violation of such laws, restrictions or regulations, or without any necessary licenses and authorizations.
+
+11.7 This License constitutes the entire agreement between the parties with respect to the subject matter hereof.
+
diff --git a/poky/meta/files/common-licenses/CC-BY-1.0 b/poky/meta/files/common-licenses/CC-BY-1.0
new file mode 100644
index 000000000..ca0b75207
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-1.0
@@ -0,0 +1,60 @@
+
+Creative Commons
+Attribution 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-2.0 b/poky/meta/files/common-licenses/CC-BY-2.0
new file mode 100644
index 000000000..0e17a453e
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-2.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+Attribution 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-2.5 b/poky/meta/files/common-licenses/CC-BY-2.5
new file mode 100644
index 000000000..2e3d1932f
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-2.5
@@ -0,0 +1,63 @@
+
+Creative Commons
+Attribution 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-3.0 b/poky/meta/files/common-licenses/CC-BY-3.0
new file mode 100644
index 000000000..593d56291
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-3.0
@@ -0,0 +1,70 @@
+
+Creative Commons
+Attribution 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-1.0 b/poky/meta/files/common-licenses/CC-BY-NC-1.0
new file mode 100644
index 000000000..6c5d22995
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-1.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-2.0 b/poky/meta/files/common-licenses/CC-BY-NC-2.0
new file mode 100644
index 000000000..4dc517691
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-2.0
@@ -0,0 +1,66 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-2.5 b/poky/meta/files/common-licenses/CC-BY-NC-2.5
new file mode 100644
index 000000000..98e61e1f3
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-2.5
@@ -0,0 +1,66 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-3.0 b/poky/meta/files/common-licenses/CC-BY-NC-3.0
new file mode 100644
index 000000000..cf3425dcb
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-3.0
@@ -0,0 +1,72 @@
+
+Creative Commons
+
+Attribution-NonCommercial 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-ND-1.0 b/poky/meta/files/common-licenses/CC-BY-NC-ND-1.0
new file mode 100644
index 000000000..b17d84e6d
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-ND-1.0
@@ -0,0 +1,5 @@
+
+Creative Commons
+
+Attribution-NoDerivs-NonCommercial 1.0 CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 1. Definitions "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. "Licensor" means the individual or entity that offers the Work under the terms of this License. "Original Author" means the individual or entity who created the Work. "Work" means the copyrightable work of authorship offered under the terms of this License. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. 5. Representations, Warranties and Disclaimer By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry: Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments; The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party. EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK. 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 8. Miscellaneous Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. Creative Commons may be contacted at http://creativecommons.org/.
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-ND-2.0 b/poky/meta/files/common-licenses/CC-BY-NC-ND-2.0
new file mode 100644
index 000000000..f46c17033
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-ND-2.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-NoDerivs 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-ND-2.5 b/poky/meta/files/common-licenses/CC-BY-NC-ND-2.5
new file mode 100644
index 000000000..cb7aa599a
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-ND-2.5
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-NoDerivs 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-ND-3.0 b/poky/meta/files/common-licenses/CC-BY-NC-ND-3.0
new file mode 100644
index 000000000..3c954dbf1
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-ND-3.0
@@ -0,0 +1,69 @@
+
+Creative Commons
+
+Attribution-NonCommercial-NoDerivs 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+to Distribute and Publicly Perform the Work including as incorporated in Collections.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-SA-1.0 b/poky/meta/files/common-licenses/CC-BY-NC-SA-1.0
new file mode 100644
index 000000000..239fd6a07
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-SA-1.0
@@ -0,0 +1,64 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-SA-2.0 b/poky/meta/files/common-licenses/CC-BY-NC-SA-2.0
new file mode 100644
index 000000000..9f07f8124
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-SA-2.0
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(e) and 4(f).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-NonCommercial-ShareAlike 2.0 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-SA-2.5 b/poky/meta/files/common-licenses/CC-BY-NC-SA-2.5
new file mode 100644
index 000000000..025cccab6
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-SA-2.5
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(e) and 4(f).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(d), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(d), as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-NonCommercial-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-NC-SA-3.0 b/poky/meta/files/common-licenses/CC-BY-NC-SA-3.0
new file mode 100644
index 000000000..d0cb1c557
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-NC-SA-3.0
@@ -0,0 +1,74 @@
+
+Creative Commons
+
+Attribution-NonCommercial-ShareAlike 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested.
+You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-ND-1.0 b/poky/meta/files/common-licenses/CC-BY-ND-1.0
new file mode 100644
index 000000000..7358186f6
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-ND-1.0
@@ -0,0 +1,59 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-ND-2.0 b/poky/meta/files/common-licenses/CC-BY-ND-2.0
new file mode 100644
index 000000000..d2c974b1a
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-ND-2.0
@@ -0,0 +1,62 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-ND-2.5 b/poky/meta/files/common-licenses/CC-BY-ND-2.5
new file mode 100644
index 000000000..b5e4546d7
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-ND-2.5
@@ -0,0 +1,62 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-ND-3.0 b/poky/meta/files/common-licenses/CC-BY-ND-3.0
new file mode 100644
index 000000000..4f64e30dc
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-ND-3.0
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+Attribution-NoDerivs 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+to Distribute and Publicly Perform the Work including as incorporated in Collections.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested.
+If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(b) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-SA-1.0 b/poky/meta/files/common-licenses/CC-BY-SA-1.0
new file mode 100644
index 000000000..9f1394b02
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-SA-1.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-SA-2.0 b/poky/meta/files/common-licenses/CC-BY-SA-2.0
new file mode 100644
index 000000000..a82434afc
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-SA-2.0
@@ -0,0 +1,67 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.0 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-SA-2.5 b/poky/meta/files/common-licenses/CC-BY-SA-2.5
new file mode 100644
index 000000000..7f8dd5c10
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-SA-2.5
@@ -0,0 +1,67 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC-BY-SA-3.0 b/poky/meta/files/common-licenses/CC-BY-SA-3.0
new file mode 100644
index 000000000..70bbd6c90
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC-BY-SA-3.0
@@ -0,0 +1,74 @@
+
+Creative Commons
+
+Attribution-ShareAlike 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
+"Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
+You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/poky/meta/files/common-licenses/CC0-1.0 b/poky/meta/files/common-licenses/CC0-1.0
new file mode 100644
index 000000000..52cf88b9b
--- /dev/null
+++ b/poky/meta/files/common-licenses/CC0-1.0
@@ -0,0 +1,32 @@
+
+Creative Commons Zero 1.0 Universal (CC0)
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
+
+the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+moral rights retained by the original author(s) and/or performer(s);
+publicity and privacy rights pertaining to a person`s image or likeness depicted in a Work;
+rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
+rights protecting the extraction, dissemination, use and reuse of data in a Work;
+database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
+other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer`s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer`s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer`s express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer`s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer`s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer`s express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
+Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
+Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person`s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
+Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
+
diff --git a/poky/meta/files/common-licenses/CDDL-1.0 b/poky/meta/files/common-licenses/CDDL-1.0
new file mode 100644
index 000000000..74198e7c5
--- /dev/null
+++ b/poky/meta/files/common-licenses/CDDL-1.0
@@ -0,0 +1,131 @@
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+Version 1.0
+1. Definitions.
+
+1.1. &#8220;Contributor&#8221; means each individual or entity that creates or contributes to the creation of Modifications.
+
+1.2. &#8220;Contributor Version&#8221; means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
+
+1.3. &#8220;Covered Software&#8221; means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
+
+1.4. &#8220;Executable&#8221; means the Covered Software in any form other than Source Code.
+
+1.5. &#8220;Initial Developer&#8221; means the individual or entity that first makes Original Software available under this License.
+
+1.6. &#8220;Larger Work&#8221; means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
+
+1.7. &#8220;License&#8221; means this document.
+
+1.8. &#8220;Licensable&#8221; means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. &#8220;Modifications&#8221; means the Source Code and Executable form of any of the following:
+
+A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
+
+B. Any new file that contains any part of the Original Software or previous Modification; or
+
+C. Any new file that is contributed or otherwise made available under the terms of this License.
+
+1.10. &#8220;Original Software&#8221; means the Source Code and Executable form of computer software code that is originally released under this License.
+
+1.11. &#8220;Patent Claims&#8221; means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+1.12. &#8220;Source Code&#8221; means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
+
+1.13. &#8220;You&#8221; (or &#8220;Your&#8221;) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, &#8220;You&#8221; includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, &#8220;control&#8221; means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
+
+(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients&#8217; rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient&#8217;s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN &#8220;AS IS&#8221; BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as &#8220;Participant&#8221;) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY&#8217;S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a &#8220;commercial item,&#8221; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of &#8220;commercial computer software&#8221; (as that term is defined at 48 C.F.R. &#167; 252.227-7014(a)(1)) and &#8220;commercial computer software documentation&#8221; as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction&#8217;s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys&#8217; fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
diff --git a/poky/meta/files/common-licenses/CECILL-1.0 b/poky/meta/files/common-licenses/CECILL-1.0
new file mode 100644
index 000000000..3d31745ba
--- /dev/null
+++ b/poky/meta/files/common-licenses/CECILL-1.0
@@ -0,0 +1,242 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d&#8217;une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d&#8217;une part, sa conformit&#233; au droit fran&#231;ais, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu&#8217;il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+d&#8217;autre part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs.
+Les auteurs de la licence CeCILL1 sont:
+
+Commissariat &#224; l&#8217;Energie Atomique &#8211; CEA, &#233;tablissement public de caract&#232;re scientifique technique et industriel, dont le si&#232;ge est situ&#233; 31-33 rue de la F&#233;d&#233;ration, 75752 PARIS cedex 15.
+
+Centre National de la Recherche Scientifique &#8211; CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique &#8211; INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+PREAMBULE
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence dans le cadre d`un mod&#232;le de diffusion &#171;open source&#187;.
+
+L`exercice de ces libert&#233;s est assorti de certains devoirs &#224; la charge des utilisateurs afin de pr&#233;server ce statut au cours des redistributions ult&#233;rieures.
+
+L&#8217;accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui en d&#233;coulent ont pour contrepartie de n&#8217;offrir aux utilisateurs qu&#8217;une garantie limit&#233;e et de ne faire peser sur l&#8217;auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu&#8217;une responsabilit&#233; restreinte.
+
+A cet &#233;gard l&#8217;attention de l&#8217;utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l&#8217;utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l&#8217;utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs et des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l&#8217;ad&#233;quation du Logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;me conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l&#8217;&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s&#8217;appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l&#8217;exploitation aux dispositions qu&#8217;il contient.
+
+Article 1er - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu&#8217;ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l&#8217;acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l&#8217;ensemble des instructions et des lignes de programme du Logiciel et auquel l&#8217;acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire : d&#233;signe le d&#233;tenteur des droits patrimoniaux d&#8217;auteur sur le Logiciel Initial.
+
+Licenci&#233;(s): d&#233;signe le ou les utilisateur(s) du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d&#8217;au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contributions: d&#233;signe l&#8217;ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que les Modules Statiques.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui, une fois compil&#233; sous forme ex&#233;cutable, permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Dynamique: d&#233;signe tout Module, cr&#233;&#233; par le Contributeur, ind&#233;pendant du Logiciel, tel que ce Module et le Logiciel sont sous forme de deux ex&#233;cutables ind&#233;pendants qui s&#8217;ex&#233;cutent dans un espace d&#8217;adressage ind&#233;pendant, l&#8217;un appelant l&#8217;autre au moment de leur ex&#233;cution.
+
+Module Statique: d&#233;signe tout Module cr&#233;&#233; par le Contributeur et li&#233; au Logiciel par un lien statique rendant leur code objet d&#233;pendant l`un de l`autre. Ce Module et le Logiciel auquel il est li&#233;, sont regroup&#233;s en un seul ex&#233;cutable.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s&#8217;entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d&#8217;une Licence non exclusive, transf&#233;rable et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1. L&#8217;acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d&#8217;un serveur distant ou par chargement &#224; partir d&#8217;un support physique;
+(ii) le premier exercice par le Licenci&#233; de l&#8217;un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2. Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissances.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1.ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2. DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, le Conc&#233;dant conc&#232;de au Licenci&#233; &#224; titre gracieux les droits d&#8217;exploitation du ou des brevets qu&#8217;il d&#233;tient sur tout ou partie des inventions impl&#233;ment&#233;es dans le Logiciel.
+
+5.1. DROITS D&#8217;UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d&#8217;application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l&#8217;affichage, l&#8217;ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d&#8217;en observer, d&#8217;en &#233;tudier, ou d&#8217;en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n&#8217;importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d&#8217;affichage, d&#8217;ex&#233;cution, de transmission ou de stockage du Logiciel qu&#8217;il est en droit d&#8217;effectuer en vertu du Contrat.
+
+5.2. DROIT D&#8217;APPORTER DES CONTRIBUTIONS
+
+Le droit d&#8217;apporter des Contributions comporte le droit de traduire, d&#8217;adapter, d&#8217;arranger ou d&#8217;apporter toute autre modification du Logiciel et le droit de reproduire le Logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu&#8217;auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3. DROITS DE DISTRIBUTION ET DE DIFFUSION
+
+Le droit de distribution et de diffusion comporte notamment le droit de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1. REDISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette redistribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d&#8217;un exemplaire du Contrat,
+
+d&#8217;un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d&#8217;acc&#233;der facilement au Code Source complet du Logiciel en indiquant les modalit&#233;s d&#8217;acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d&#8217;acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2. REDISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, les conditions de redistribution du Logiciel Modifi&#233; sont alors soumises &#224; l&#8217;int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer le Logiciel Modifi&#233;, sous forme de Code Source ou de Code Objet, &#224; condition que cette redistribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d&#8217;un exemplaire du Contrat,
+
+d&#8217;un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d&#8217;acc&#233;der facilement au Code Source complet du Logiciel Modifi&#233; en indiquant les modalit&#233;s d&#8217;acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d&#8217;acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3. REDISTRIBUTION DES MODULES DYNAMIQUES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Dynamique les conditions du Contrat ne s&#8217;appliquent pas &#224; ce Module Dynamique, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4. COMPATIBILITE AVEC LA LICENCE GPL
+
+Dans le cas o&#249; le Logiciel, Modifi&#233; ou non, est int&#233;gr&#233; &#224; un code soumis aux dispositions de la licence GPL, le Licenci&#233; est autoris&#233; &#224; redistribuer l&#8217;ensemble sous la licence GPL.
+
+Dans le cas o&#249; le Logiciel Modifi&#233; int&#232;gre un code soumis aux dispositions de la licence GPL, le Licenci&#233; est autoris&#233; &#224; redistribuer le Logiciel Modifi&#233; sous la licence GPL.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1. SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son &#339;uvre et nul autre n&#8217;a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; maintenir la diffusion du Logiciel initial sous les conditions du Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2. SUR LES CONTRIBUTIONS
+
+Les droits de propri&#233;t&#233; intellectuelle sur les Contributions sont attach&#233;s au titulaire de droits patrimoniaux d&#233;sign&#233; par la l&#233;gislation applicable.
+
+6.3. SUR LES MODULES DYNAMIQUES
+
+Le Licenci&#233; ayant d&#233;velopp&#233; un Module Dynamique est titulaire des droits de propri&#233;t&#233; intellectuelle sur ce Module Dynamique et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4. DISPOSITIONS COMMUNES
+
+6.4.1. Le Licenci&#233; s&#8217;engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l&#8217;identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel.
+
+6.4.2. Le Licenci&#233; s&#8217;engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l&#8217;&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1. Le Contrat n&#8217;oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d&#8217;assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d&#8217;une telle assistance technique et/ou d&#8217;une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n&#8217;engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2. De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n&#8217;engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu&#8217;il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l&#8217;objet d&#8217;un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1. Sous r&#233;serve des dispositions de l&#8217;article 8.2, si le Conc&#233;dant n&#8217;ex&#233;cute pas tout ou partie des obligations mises &#224; sa charge par le Contrat, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu&#8217;il subit et dont il apportera la preuve.
+
+8.2. La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment:(i) des dommages dus &#224; l&#8217;inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l&#8217;utilisation ou des performances du Logiciel subis par le Licenci&#233; lorsqu&#8217;il s&#8217;agit d&#8217;un professionnel utilisant le Logiciel &#224; des fins professionnelles et (iii) des dommages indirects d&#233;coulant de l&#8217;utilisation ou des performances du Logiciel. Les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d&#8217;exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n&#8217;ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1. Le Licenci&#233; reconna&#238;t que l&#8217;&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d&#8217;en tester et d&#8217;en v&#233;rifier toutes les utilisations ni de d&#233;tecter l&#8217;existence d&#8217;&#233;ventuels d&#233;fauts. L&#8217;attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l&#8217;utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l&#8217;ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu&#8217;il ne causera pas de dommages aux personnes et aux biens.
+
+9.2. Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3. Le Licenci&#233; reconna&#238;t que le Logiciel est fourni &#171;en l`&#233;tat&#187; par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l&#8217;article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu&#8217;il fonctionnera sans interruption, qu&#8217;il sera compatible avec l&#8217;&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu&#8217;il remplira les besoins du Licenci&#233;.
+
+9.4. Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d&#8217;un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l&#8217;utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d&#8217;un protocole d&#8217;accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l&#8217;utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n&#8217;est apport&#233;e quant &#224; l&#8217;existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l&#8217;existence d&#8217;une marque.
+
+Article 10 - RESILIATION
+
+10.1. En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2. Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n&#8217;est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu&#8217;il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu&#8217;elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1. CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d&#8217;un retard ou d&#8217;une d&#233;faillance d&#8217;ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l&#8217;intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l&#8217;&#233;tat de guerre&#8230;
+
+11.2. Le fait, par l&#8217;une ou l&#8217;autre des Parties, d&#8217;omettre en une ou plusieurs occasions de se pr&#233;valoir d&#8217;une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s&#8217;en pr&#233;valoir ult&#233;rieurement.
+
+11.3. Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l&#8217;accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n&#8217;aura d&#8217;effet &#224; l&#8217;&#233;gard des Parties &#224; moins d&#8217;&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4. Dans l&#8217;hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s&#8217;av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d&#8217;une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l&#8217;ensemble du Contrat.
+
+11.5. LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise. En cas de divergence d&#8217;interpr&#233;tation, seule la version fran&#231;aise fait foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1. Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2. Afin d&#8217;en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#232;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3. Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure, sous r&#233;serve des dispositions de l`article 5.3.4.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1. Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l&#8217;amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l&#8217;occasion du Contrat.
+
+13.2. A d&#233;faut d&#8217;accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d&#8217;une proc&#233;dure d&#8217;urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 Ce: CEA, C: CNRS, I: INRIA, LL: Logiciel Libre
+
+
+Version 1 du 21/06/2004
+
diff --git a/poky/meta/files/common-licenses/CECILL-2.0 b/poky/meta/files/common-licenses/CECILL-2.0
new file mode 100644
index 000000000..7bc14a6a8
--- /dev/null
+++ b/poky/meta/files/common-licenses/CECILL-2.0
@@ -0,0 +1,243 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence dans le cadre d`un mod&#232;le de diffusion en logiciel libre.
+
+L`exercice de ces libert&#233;s est assorti de certains devoirs &#224; la charge des utilisateurs afin de pr&#233;server ce statut au cours des redistributions ult&#233;rieures.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui en d&#233;coulent ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Externe: d&#233;signe tout Module, non d&#233;riv&#233; du Logiciel, tel que ce Module et le Logiciel s`ex&#233;cutent dans des espaces d`adressage diff&#233;rents, l`un appelant l`autre au moment de leur ex&#233;cution.
+
+Module Interne: d&#233;signe tout Module li&#233; au Logiciel de telle sorte qu`ils s`ex&#233;cutent dans le m&#234;me espace d`adressage.
+
+GNU GPL: d&#233;signe la GNU General Public License dans sa version 2 ou toute version ult&#233;rieure, telle que publi&#233;e par Free Software Foundation Inc.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT D`APPORTER DES CONTRIBUTIONS
+
+Le droit d`apporter des Contributions comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d`acc&#233;der facilement au Code Source complet du Logiciel en indiquant les modalit&#233;s d`acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, les conditions de distribution du Logiciel Modifi&#233; en r&#233;sultant sont alors soumises &#224; l`int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer le Logiciel Modifi&#233;, sous forme de code source ou de code objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le code objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d`acc&#233;der facilement au code source complet du Logiciel Modifi&#233; en indiquant les modalit&#233;s d`acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Externe les conditions du Contrat ne s`appliquent pas &#224; ce Module Externe, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4 COMPATIBILITE AVEC LA LICENCE GNU GPL
+
+Le Licenci&#233; peut inclure un code soumis aux dispositions d`une des versions de la licence GNU GPL dans le Logiciel modifi&#233; ou non et distribuer l`ensemble sous les conditions de la m&#234;me version de la licence GNU GPL.
+
+Le Licenci&#233; peut inclure le Logiciel modifi&#233; ou non dans un code soumis aux dispositions d`une des versions de la licence GNU GPL et distribuer l`ensemble sous les conditions de la m&#234;me version de la licence GNU GPL.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES EXTERNES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Externe est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4 DISPOSITIONS COMMUNES
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non.
+
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure, sous r&#233;serve des dispositions de l`article 5.3.4.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 2.0 du 2006-09-05.
+
diff --git a/poky/meta/files/common-licenses/CECILL-B b/poky/meta/files/common-licenses/CECILL-B
new file mode 100644
index 000000000..1cc244f4c
--- /dev/null
+++ b/poky/meta/files/common-licenses/CECILL-B
@@ -0,0 +1,247 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL-B1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs une tr&#232;s large libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence.
+
+L`exercice de cette libert&#233; est assorti d`une obligation forte de citation &#224; la charge de ceux qui distribueraient un logiciel incorporant un logiciel r&#233;gi par la pr&#233;sente licence afin d`assurer que les contributions de tous soient correctement identifi&#233;es et reconnues.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui d&#233;coulent de ce contrat ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Externe: d&#233;signe tout Module, non d&#233;riv&#233; du Logiciel, tel que ce Module et le Logiciel s`ex&#233;cutent dans des espaces d`adressage diff&#233;rents, l`un appelant l`autre au moment de leur ex&#233;cution.
+
+Module Interne: d&#233;signe tout Module li&#233; au Logiciel de telle sorte qu`ils s`ex&#233;cutent dans le m&#234;me espace d`adressage.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT D`APPORTER DES CONTRIBUTIONS
+
+Le droit d`apporter des Contributions comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif au Code Source complet du Logiciel pendant au moins toute la dur&#233;e de sa distribution du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, le Logiciel Modifi&#233; peut &#234;tre distribu&#233; sous un contrat de licence autre que le pr&#233;sent Contrat sous r&#233;serve du respect des dispositions de l`article 5.3.4.
+
+5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Externe les conditions du Contrat ne s`appliquent pas &#224; ce Module Externe, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4 CITATIONS
+
+Le Licenci&#233; qui distribue un Logiciel Modifi&#233; s`engage express&#233;ment:
+
+&#224; indiquer dans sa documentation qu`il a &#233;t&#233; r&#233;alis&#233; &#224; partir du Logiciel r&#233;gi par le Contrat, en reproduisant les mentions de propri&#233;t&#233; intellectuelle du Logiciel,
+
+&#224; faire en sorte que l`utilisation du Logiciel, ses mentions de propri&#233;t&#233; intellectuelle et le fait qu`il est r&#233;gi par le Contrat soient indiqu&#233;s dans un texte facilement accessible depuis l`interface du Logiciel Modifi&#233;,
+
+&#224; mentionner, sur un site Web librement accessible d&#233;crivant le Logiciel Modifi&#233;, et pendant au moins toute la dur&#233;e de sa distribution, qu`il a &#233;t&#233; r&#233;alis&#233; &#224; partir du Logiciel r&#233;gi par le Contrat, en reproduisant les mentions de propri&#233;t&#233; intellectuelle du Logiciel,
+
+lorsqu`il le distribue &#224; un tiers susceptible de distribuer lui-m&#234;me un Logiciel Modifi&#233;, sans avoir &#224; en distribuer le code source, &#224; faire ses meilleurs efforts pour que les obligations du pr&#233;sent article 5.3.4 soient reprises par le dit tiers.
+
+Lorsque le Logiciel modifi&#233; ou non est distribu&#233; avec un Module Externe qui a &#233;t&#233; con&#231;u pour l`utiliser, le Licenci&#233; doit soumettre le dit Module Externe aux obligations pr&#233;c&#233;dentes.
+
+5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
+
+Lorsqu`un Logiciel Modifi&#233; contient une Contribution soumise au contrat de licence CeCILL, les stipulations pr&#233;vues &#224; l`article 5.3.4 sont facultatives.
+
+Un Logiciel Modifi&#233; peut &#234;tre distribu&#233; sous le contrat de licence CeCILL-C. Les stipulations pr&#233;vues &#224; l`article 5.3.4 sont alors facultatives.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES EXTERNES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Externe est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4 DISPOSITIONS COMMUNES
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non.
+
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 1.0 du 2006-09-05.
+
diff --git a/poky/meta/files/common-licenses/CECILL-C b/poky/meta/files/common-licenses/CECILL-C
new file mode 100644
index 000000000..7e8ef86e8
--- /dev/null
+++ b/poky/meta/files/common-licenses/CECILL-C
@@ -0,0 +1,241 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL-C1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modifier et de r&#233;utiliser le logiciel r&#233;gi par cette licence.
+
+L`exercice de cette libert&#233; est assorti d`une obligation de remettre &#224; la disposition de la communaut&#233; les modifications apport&#233;es au code source du logiciel afin de contribuer &#224; son &#233;volution.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui d&#233;coulent de ce contrat ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution Int&#233;gr&#233;e.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution Int&#233;gr&#233;e.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution Int&#233;gr&#233;e: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Code Source par tout Contributeur.
+
+Module Li&#233;: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui, sans modification du Code Source, permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Logiciel D&#233;riv&#233;: d&#233;signe toute combinaison du Logiciel, modifi&#233; ou non, et d`un Module Li&#233;.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT DE MODIFICATION
+
+Le droit de modification comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant. Il comprend en particulier le droit de cr&#233;er un Logiciel D&#233;riv&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute modification au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette modification et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif au Code Source complet du Logiciel pendant au moins toute la dur&#233;e de sa distribution du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution Int&#233;gr&#233;e au Logiciel, les conditions de distribution du Logiciel Modifi&#233; en r&#233;sultant sont alors soumises &#224; l`int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer le Logiciel Modifi&#233; sous forme de code source ou de code objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le code objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif &#224; son code source complet pendant au moins toute la dur&#233;e de sa distribution du Logiciel Modifi&#233;, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3 DISTRIBUTION DU LOGICIEL DERIVE
+
+Lorsque le Licenci&#233; cr&#233;e un Logiciel D&#233;riv&#233;, ce Logiciel D&#233;riv&#233; peut &#234;tre distribu&#233; sous un contrat de licence autre que le pr&#233;sent Contrat &#224; condition de respecter les obligations de mention des droits sur le Logiciel telles que d&#233;finies &#224; l`article 6.4. Dans le cas o&#249; la cr&#233;ation du Logiciel D&#233;riv&#233; a n&#233;cessit&#233; une modification du Code Source le licenci&#233; s`engage &#224; ce que:
+
+le Logiciel Modifi&#233; correspondant &#224; cette modification soit r&#233;gi par le pr&#233;sent Contrat,
+les Contributions Int&#233;gr&#233;es dont le Logiciel Modifi&#233; r&#233;sulte soient clairement identifi&#233;es et document&#233;es,
+le Licenci&#233; permette un acc&#232;s effectif au code source du Logiciel Modifi&#233;, pendant au moins toute la dur&#233;e de la distribution du Logiciel D&#233;riv&#233;, de telle sorte que ces modifications puissent &#234;tre reprises dans une version ult&#233;rieure du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source du Logiciel Modifi&#233; ne devra pas exc&#233;der le simple co&#251;t du transfert des donn&#233;es.
+5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL
+
+Lorsqu`un Logiciel Modifi&#233; contient une Contribution Int&#233;gr&#233;e soumise au contrat de licence CeCILL, ou lorsqu`un Logiciel D&#233;riv&#233; contient un Module Li&#233; soumis au contrat de licence CeCILL, les stipulations pr&#233;vues au troisi&#232;me item de l`article 6.4 sont facultatives.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS INTEGREES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution Int&#233;gr&#233;e est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES LIES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Li&#233; est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion dans les conditions d&#233;finies &#224; l`article 5.3.3.
+
+6.4 MENTIONS DES DROITS
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non;
+
+&#224; faire en sorte que l`utilisation du Logiciel, ses mentions de propri&#233;t&#233; intellectuelle et le fait qu`il est r&#233;gi par le Contrat soient indiqu&#233;s dans un texte facilement accessible notamment depuis l`interface de tout Logiciel D&#233;riv&#233;.
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 1.0 du 2006-09-05.
+
diff --git a/poky/meta/files/common-licenses/CPAL-1.0 b/poky/meta/files/common-licenses/CPAL-1.0
new file mode 100644
index 000000000..aafb0e24a
--- /dev/null
+++ b/poky/meta/files/common-licenses/CPAL-1.0
@@ -0,0 +1,109 @@
+
+Common Public Attribution License Version 1.0 (CPAL)
+1. &#8220;Definitions&#8221;
+1.0.1 &#8220;Commercial Use&#8221; means distribution or otherwise making the Covered Code available to a third party.
+1.1 &#8220;Contributor&#8221; means each entity that creates or contributes to the creation of Modifications.
+1.2 &#8220;Contributor Version&#8221; means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3 &#8220;Covered Code&#8221; means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+1.4 &#8220;Electronic Distribution Mechanism&#8221; means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5 &#8220;Executable&#8221; means Covered Code in any form other than Source Code.
+1.6 &#8220;Initial Developer&#8221; means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7 &#8220;Larger Work&#8221; means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8 &#8220;License&#8221; means this document.
+1.8.1 &#8220;Licensable&#8221; means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9 &#8220;Modifications&#8221; means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous Modifications.
+1.10 &#8220;Original Code&#8221; means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1 &#8220;Patent Claims&#8221; means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11 &#8220;Source Code&#8221; means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor&#8217;s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12 &#8220;You&#8221; (or &#8220;Your&#8221;) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, &#8220;You&#8221; includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, &#8220;control&#8221; means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2. Source Code License.
+2.1 The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+2.2 Contributor Grant.
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+3. Distribution Obligations.
+3.1 Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients&#8217; rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2 Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+3.3 Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+3.4 Intellectual Property Matters
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party&#8217;s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled &#8220;LEGAL&#8221; which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor&#8217;s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor&#8217;s Modifications are Contributor&#8217;s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+3.5 Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients&#8217; rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+3.6 Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients&#8217; rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient&#8217;s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer, Original Developer or any Contributor. You hereby agree to indemnify the Initial Developer, Original Developer and every Contributor for any liability incurred by the Initial Developer, Original Developer or such Contributor as a result of any such terms You offer.
+3.7 Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+6. Versions of the License.
+6.1 New Versions.
+Socialtext, Inc. (&#8220;Socialtext&#8221;) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2 Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Socialtext. No one other than Socialtext has the right to modify the terms applicable to Covered Code created under this License.
+6.3 Derivative Works.
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases &#8220;Socialtext&#8221;, &#8220;CPAL&#8221; or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN &#8220;AS IS&#8221; BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8. TERMINATION.
+8.1 This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer, Original Developer or a Contributor (the Initial Developer, Original Developer or Contributor against whom You file such action is referred to as &#8220;Participant&#8221;) alleging that:
+(a) such Participant&#8217;s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+(b) any software, hardware, or device, other than such Participant&#8217;s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+8.3 If You assert a patent infringement claim against Participant alleging that such Participant&#8217;s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY&#8217;S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a &#8220;commercial item,&#8221; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of &#8220;commercial computer software&#8221; and &#8220;commercial computer software documentation,&#8221; as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys&#8217; fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer, Original Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer, Original Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+14. ADDITIONAL TERM: ATTRIBUTION
+(a) As a modest attribution to the organizer of the development of the Original Code (&#8220;Original Developer&#8221;), in the hope that its promotional value may help justify the time, money and effort invested in writing the Original Code, the Original Developer may include in Exhibit B (&#8220;Attribution Information&#8221;) a requirement that each time an Executable and Source Code or a Larger Work is launched or initially run (which includes initiating a session), a prominent display of the Original Developer&#8217;s Attribution Information (as defined below) must occur on the graphic user interface employed by the end user to access such Covered Code (which may include display on a splash screen), if any. The size of the graphic image should be consistent with the size of the other elements of the Attribution Information. If the access by the end user to the Executable and Source Code does not create a graphic user interface for access to the Covered Code, this obligation shall not apply. If the Original Code displays such Attribution Information in a particular form (such as in the form of a splash screen, notice at login, an &#8220;about&#8221; display, or dedicated attribution area on user interface screens), continued use of such form for that Attribution Information is one way of meeting this requirement for notice.
+(b) Attribution information may only include a copyright notice, a brief phrase, graphic image and a URL (&#8220;Attribution Information&#8221;) and is subject to the Attribution Limits as defined below. For these purposes, prominent shall mean display for sufficient duration to give reasonable notice to the user of the identity of the Original Developer and that if You include Attribution Information or similar information for other parties, You must ensure that the Attribution Information for the Original Developer shall be no less prominent than such Attribution Information or similar information for the other party. For greater certainty, the Original Developer may choose to specify in Exhibit B below that the above attribution requirement only applies to an Executable and Source Code resulting from the Original Code or any Modification, but not a Larger Work. The intent is to provide for reasonably modest attribution, therefore the Original Developer cannot require that You display, at any time, more than the following information as Attribution Information: (a) a copyright notice including the name of the Original Developer; (b) a word or one phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and (d) a URL (collectively, the &#8220;Attribution Limits&#8221;).
+(c) If Exhibit B does not include any Attribution Information, then there are no requirements for You to display any Attribution Information of the Original Developer.
+(d) You acknowledge that all trademarks, service marks and/or trade names contained within the Attribution Information distributed with the Covered Code are the exclusive property of their owners and may only be used with the permission of their owners, or under circumstances otherwise permitted by law or as expressly set out in this License.
+15. ADDITIONAL TERM: NETWORK USE.
+The term &#8220;External Deployment&#8221; means the use, distribution, or communication of the Original Code or Modifications in any way such that the Original Code or Modifications may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Code or Modifications as a distribution under section 3.1 and make Source Code available under Section 3.2.
+
+ EXHIBIT A. Common Public Attribution License Version 1.0.
+&#8220;The contents of this file are subject to the Common Public Attribution License Version 1.0 (the &#8220;License&#8221;); you may not use this file except in compliance with the License. You may obtain a copy of the License at _____________. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
+Software distributed under the License is distributed on an &#8220;AS IS&#8221; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+The Original Code is______________________.
+The Original Developer is not the Initial Developer and is __________. If left blank, the Original Developer is the Initial Developer.
+The Initial Developer of the Original Code is ____________. All portions of the code written by ___________ are Copyright (c) _____. All Rights Reserved.
+Contributor ______________________.
+Alternatively, the contents of this file may be used under the terms of the _____ license (the [___] License), in which case the provisions of [______] License are applicable instead of those above.
+If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the [___] License.&#8221;
+[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+
+ EXHIBIT B. Attribution Information
+Attribution Copyright Notice: _______________________
+Attribution Phrase (not exceeding 10 words): _______________________
+Attribution URL: _______________________
+Graphic Image as provided in the Covered Code, if any.
+Display of Attribution Information is [required/not required] in Larger Works which are defined in the CPAL as a work which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
+
diff --git a/poky/meta/files/common-licenses/CPL-1.0 b/poky/meta/files/common-licenses/CPL-1.0
new file mode 100644
index 000000000..517c20fb4
--- /dev/null
+++ b/poky/meta/files/common-licenses/CPL-1.0
@@ -0,0 +1,215 @@
+
+Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution `originates` from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor`s behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient`s responsibility to acquire that license
+before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor`s responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient`s patent(s), then such Recipient`s rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient`s rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient`s obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
diff --git a/poky/meta/files/common-licenses/CUA-OPL-1.0 b/poky/meta/files/common-licenses/CUA-OPL-1.0
new file mode 100644
index 000000000..1ff59eb42
--- /dev/null
+++ b/poky/meta/files/common-licenses/CUA-OPL-1.0
@@ -0,0 +1,471 @@
+
+CUA Office Public License Version 1.0
+(plain text)
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified
+as the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or
+subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file
+containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or
+previous Modifications.
+
+1.10. "Original Code" means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process,
+and apparatus claims, in any patent Licensable by grantor.
+
+1.11. "Source Code" means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus
+any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or source code
+differential comparisons against either the Original Code or another
+well known, available Covered Code of the Contributor`s choice. The
+Source Code can be in a compressed or archival form, provided the
+appropriate decompression or de-archiving software is widely available
+for no charge.
+
+1.12. "You" (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this
+License or a future version of this License issued under Section 6.1.
+For legal entities, "You" includes any entity which controls, is
+controlled by, or is under common control with You. For purposes of
+this definition, "control" means (a) the power, direct or indirect,
+to cause the direction or management of such entity, whether by
+contract or otherwise, or (b) ownership of more than fifty percent
+(50%) of the outstanding shares or beneficial ownership of such
+entity.
+
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce,
+modify, display, perform, sublicense and distribute the Original
+Code (or portions thereof) with or without Modifications, and/or
+as part of a Larger Work; and
+
+(b) under Patents Claims infringed by the making, using or
+selling of Original Code, to make, have made, use, practice,
+sell, and offer for sale, and/or otherwise dispose of the
+Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are
+effective on the date Initial Developer first distributes
+Original Code under the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2)
+separate from the Original Code; or 3) for infringements caused
+by: i) the modification of the Original Code or ii) the
+combination of the Original Code with other software or devices.
+
+2.2. Contributor Grant.
+Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications
+created by such Contributor (or portions thereof) either on an
+unmodified basis, with other Modifications, as Covered Code
+and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or
+selling of Modifications made by that Contributor either alone
+and/or in combination with its Contributor Version (or portions
+of such combination), to make, use, sell, offer for sale, have
+made, and/or otherwise dispose of: 1) Modifications made by that
+Contributor (or portions thereof); and 2) the combination of
+Modifications made by that Contributor with its Contributor
+Version (or portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+effective on the date Contributor first makes Commercial Use of
+the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is
+granted: 1) for any code that Contributor has deleted from the
+Contributor Version; 2) separate from the Contributor Version;
+3) for infringements caused by: i) third party modifications of
+Contributor Version or ii) the combination of Modifications made
+by that Contributor with other software (except as part of the
+Contributor Version) or other devices; or 4) under Patent Claims
+infringed by Covered Code in the absence of Modifications made by
+that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation
+Section 2.2. The Source Code version of Covered Code may be
+distributed only under the terms of this License or a future version
+of this License released under Section 6.1, and You must include a
+copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code
+version that alters or restricts the applicable version of this
+License or the recipients` rights hereunder. However, You may include
+an additional document offering the additional rights described in
+Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License
+either on the same media as an Executable version or via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an
+Executable version available; and if made available via Electronic
+Distribution Mechanism, must remain available for at least twelve (12)
+months after the date it initially became available, or at least six
+(6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for
+ensuring that the Source Code version remains available even if the
+Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party`s
+intellectual property rights is required to exercise the rights
+granted by such Contributor under Sections 2.1 or 2.2,
+Contributor must include a text file with the Source Code
+distribution titled "LEGAL" which describes the claim and the
+party making the claim in sufficient detail that a recipient will
+know whom to contact. If Contributor obtains such knowledge after
+the Modification is made available as described in Section 3.2,
+Contributor shall promptly modify the LEGAL file in all copies
+Contributor makes available thereafter and shall take other steps
+(such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered
+Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming
+interface and Contributor has knowledge of patent licenses which
+are reasonably necessary to implement that API, Contributor must
+also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to
+Section 3.4(a) above, Contributor believes that Contributor`s
+Modifications are Contributor`s original creation(s) and/or
+Contributor has sufficient rights to grant the rights conveyed by
+this License.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source
+Code file due to its structure, then You must include such notice in a
+location (such as a relevant directory) where a user would be likely
+to look for such a notice. If You created one or more Modification(s)
+You may add your name as a Contributor to the notice described in
+Exhibit A. You must also duplicate this License in any documentation
+for the Source Code where You describe recipients` rights or ownership
+rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability
+obligations to one or more recipients of Covered Code. However, You
+may do so only on Your own behalf, and not on behalf of the Initial
+Developer or any Contributor. You must make it absolutely clear than
+any such warranty, support, indemnity or liability obligation is
+offered by You alone, and You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty,
+support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code or ownership rights under a license of Your choice, which may
+contain terms different from this License, provided that You are in
+compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this
+License. If You distribute the Executable version under a different
+license You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the
+Initial Developer and every Contributor for any liability incurred by
+the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 3.4 and must
+be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions.
+CUA Office Project may publish revised
+and/or new versions of the License from time to time. Each version
+will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the
+License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Code under the terms
+of any subsequent version of the License published by CUA Office Project. No one
+other than CUA Office Project has the right to modify the terms applicable to
+Covered Code created under this License.
+
+6.3. Derivative Works.
+If You create or use a modified version of this License (which you may
+only do in order to apply it to code which is not already Covered Code
+governed by this License), You must (a) rename Your license so that
+the phrases "CUA Office", "CUA", "CUAPL", or any confusingly similar phrase do not appear in your
+license (except to note that your license differs from this License)
+and (b) otherwise make it clear that Your version of the license
+contains terms which differ from the CUA Office Public License. (Filling in the name of the Initial
+Developer, Original Code or Contributor in the notice described in
+Exhibit A shall not of themselves be deemed to be modifications of
+this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+8.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement
+claim (excluding declatory judgment actions) against Initial Developer
+or a Contributor (the Initial Developer or Contributor against whom
+You file such action is referred to as "Participant") alleging that:
+
+(a) such Participant`s Contributor Version directly or indirectly
+infringes any patent, then any and all rights granted by such
+Participant to You under Sections 2.1 and/or 2.2 of this License
+shall, upon 60 days notice from Participant terminate prospectively,
+unless if within 60 days after receipt of notice You either: (i)
+agree in writing to pay Participant a mutually agreeable reasonable
+royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to
+the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not
+mutually agreed upon in writing by the parties or the litigation claim
+is not withdrawn, the rights granted by Participant to You under
+Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b)
+and 2.2(b) are revoked effective as of the date You first made, used,
+sold, distributed, or had made, Modifications made by that
+Participant.
+
+8.3. If You assert a patent infringement claim against Participant
+alleging that such Participant`s Contributor Version directly or
+indirectly infringes any patent where such claim is resolved (such as
+by license or settlement) prior to the initiation of patent
+infringement litigation, then the reasonable value of the licenses
+granted by such Participant under Sections 2.1 or 2.2 shall be taken
+into account in determining the amount or value of any payment or
+license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above,
+all end user license agreements (excluding distributors and resellers)
+which have been validly granted by You or any distributor hereunder
+prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+The Covered Code is a "commercial item," as that term is defined in
+48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" and "commercial computer software documentation," as such
+terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+all U.S. Government End Users acquire Covered Code with only those
+rights set forth herein.
+
+11. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. This License shall be governed by
+California law provisions (except to the extent applicable law, if
+any, provides otherwise), excluding its conflict-of-law provisions.
+With respect to disputes in which at least one party is a citizen of,
+or an entity chartered or registered to do business in the United
+States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern
+District of California, with venue lying in Santa Clara County,
+California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys` fees and
+expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded.
+Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this
+License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License and You agree to
+work with Initial Developer and Contributors to distribute such
+responsibility on an equitable basis. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+Initial Developer may designate portions of the Covered Code as
+"Multiple-Licensed". "Multiple-Licensed" means that the Initial
+Developer permits you to utilize portions of the Covered Code under
+Your choice of the NPL or the alternative licenses, if any, specified
+by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A - CUA Office Public License.
+
+``The contents of this file are subject to the CUA Office Public License
+Version 1.0 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at
+http://cuaoffice.sourceforge.net/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations
+under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________.
+Portions created by ______________________ are Copyright (C) ______
+_______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+of the _____ license (the "[___] License"), in which case the
+provisions of [______] License are applicable instead of those
+above. If you wish to allow use of your version of this file only
+under the terms of the [____] License and not to allow others to use
+your version of this file under the CUAPL, indicate your decision by
+deleting the provisions above and replace them with the notice and
+other provisions required by the [___] License. If you do not delete
+the provisions above, a recipient may use your version of this file
+under either the CUAPL or the [___] License."
+
+[NOTE: The text of this Exhibit A may differ slightly from the text of
+the notices in the Source Code files of the Original Code. You should
+use the text of this Exhibit A rather than the text found in the
+Original Code Source Code for Your Modifications.]
+
diff --git a/poky/meta/files/common-licenses/ClArtistic b/poky/meta/files/common-licenses/ClArtistic
new file mode 100644
index 000000000..8d5a4aad8
--- /dev/null
+++ b/poky/meta/files/common-licenses/ClArtistic
@@ -0,0 +1,138 @@
+
+ The Clarified Artistic License
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you`re thinking about copying or distributing
+ this Package.
+
+ "Distribution fee" is a fee you charge for providing a copy
+ of this Package to another party.
+
+ "Freely Available" means that no fee is charged for the right to
+ use the item, though there may be fees involved in handling the
+ item. It also means that recipients of the item may redistribute
+ it under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain, or those made Freely Available, or from
+the Copyright Holder. A Package modified in such a way shall still be
+considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or an
+ equivalent medium, or placing the modifications on a major network
+ archive site allowing unrestricted access to them, or by allowing the
+ Copyright Holder to include your modifications in the Standard Version
+ of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+ e) permit and encourge anyone who receives a copy of the modified Package
+ permission to make your modifications Freely Available
+ in some specific way.
+
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+ e) offer the machine-readable source of the Package, with your
+ modifications, by mail order.
+
+5. You may charge a distribution fee for any distribution of this Package.
+If you offer support for this Package, you may charge any fee you choose
+for that support. You may not charge a license fee for the right to use
+this Package itself. You may distribute this Package in aggregate with
+other (possibly commercial and possibly nonfree) programs as part of a
+larger (possibly commercial and possibly nonfree) software distribution,
+and charge license fees for other parts of that software distribution,
+provided that you do not advertise this Package as a product of your own.
+If the Package includes an interpreter, You may embed this Package`s
+interpreter within an executable of yours (by linking); this shall be
+construed as a mere form of aggregation, provided that the complete
+Standard Version of the interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of the Standard Version of the Package with a commercial
+distribution is always permitted provided that the use of this Package
+is embedded; that is, when no overt attempt is made to make this Package`s
+interfaces visible to the end user of the commercial distribution.
+Such use shall not be construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
+
diff --git a/poky/meta/files/common-licenses/DSSSL b/poky/meta/files/common-licenses/DSSSL
new file mode 100644
index 000000000..7159dfbd6
--- /dev/null
+++ b/poky/meta/files/common-licenses/DSSSL
@@ -0,0 +1,49 @@
+Copyright
+---------
+
+Copyright (C) 1997-2001 Norman Walsh
+
+The original inspiration for these stylesheets came from the
+work of Jon Bosak, Anders Berglund, Tony Graham, Terry Allen,
+James Clark, and many others. I am indebted to them and to the
+community of users on dssslist@mulberrytech.com for making
+substantial contributions to this work and for answering my many
+questions.
+
+This software may be distributed under the same terms as Jade:
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the ``Software''), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Except as contained in this notice, the names of individuals
+credited with contribution to this software shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization
+from the individuals in question.
+
+Any stylesheet derived from this Software that is publically
+distributed will be identified with a different name and the
+version strings in any derived Software will be changed so that
+no possibility of confusion between the derived package and this
+Software will exist.
+
+Warranty
+--------
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
+CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/poky/meta/files/common-licenses/ECL-1.0 b/poky/meta/files/common-licenses/ECL-1.0
new file mode 100644
index 000000000..bbc8be107
--- /dev/null
+++ b/poky/meta/files/common-licenses/ECL-1.0
@@ -0,0 +1,55 @@
+
+This Educational Community License (the "License") applies
+to any original work of authorship (the "Original Work") whose owner
+(the "Licensor") has placed the following notice immediately following
+the copyright notice for the Original Work:
+
+Copyright (c) <year> <copyright holders>
+
+Licensed under the Educational Community License version 1.0
+
+This Original Work, including software, source code, documents,
+or other related items, is being provided by the copyright holder(s)
+subject to the terms of the Educational Community License. By
+obtaining, using and/or copying this Original Work, you agree that you
+have read, understand, and will comply with the following terms and
+conditions of the Educational Community License:
+
+Permission to use, copy, modify, merge, publish, distribute, and
+sublicense this Original Work and its documentation, with or without
+modification, for any purpose, and without fee or royalty to the
+copyright holder(s) is hereby granted, provided that you include the
+following on ALL copies of the Original Work or portions thereof,
+including modifications or derivatives, that you make:
+
+
+The full text of the Educational Community License in a location viewable to
+users of the redistributed or derivative work.
+
+
+Any pre-existing intellectual property disclaimers, notices, or terms and
+conditions.
+
+
+
+Notice of any changes or modifications to the Original Work, including the
+date the changes were made.
+
+
+Any modifications of the Original Work must be distributed in such a manner as
+to avoid any confusion with the Original Work of the copyright holders.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+The name and trademarks of copyright holder(s) may NOT be used
+in advertising or publicity pertaining to the Original or Derivative
+Works without specific, written prior permission. Title to copyright in
+the Original Work and any associated documentation will at all times
+remain with the copyright holders.
+
diff --git a/poky/meta/files/common-licenses/ECL-2.0 b/poky/meta/files/common-licenses/ECL-2.0
new file mode 100644
index 000000000..54c99e7ed
--- /dev/null
+++ b/poky/meta/files/common-licenses/ECL-2.0
@@ -0,0 +1,99 @@
+
+Educational Community License, Version 2.0
+(plain text)
+Educational Community License
+
+Version 2.0, April 2007
+
+http://www.osedu.org/licenses/
+
+The Educational Community License version 2.0 ("ECL") consists of the Apache 2.0 license, modified to change the scope of the patent grant in section 3 to be specific to the needs of the education communities using this license. The original Apache 2.0 license can be found at: http://www.apache.org/licenses/LICENSE-2.0
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Any patent license granted hereby with respect to contributions by an individual employed by an institution or organization is limited to patent claims where the individual that is the author of the Work is also the inventor of the patent claims licensed, and where the organization or institution has the right to grant such license under applicable grant and research funding agreements. No other express or implied licenses are granted.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Educational Community License to your work
+
+To apply the Educational Community License to your work, attach
+the following boilerplate notice, with the fields enclosed by
+brackets "[]" replaced with your own identifying information.
+(Don`t include the brackets!) The text should be enclosed in the
+appropriate comment syntax for the file format. We also recommend
+that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner] Licensed under the
+ Educational Community License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may
+ obtain a copy of the License at
+
+ http://www.osedu.org/licenses/ECL-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an "AS IS"
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
diff --git a/poky/meta/files/common-licenses/EDL-1.0 b/poky/meta/files/common-licenses/EDL-1.0
new file mode 100644
index 000000000..53b1eb045
--- /dev/null
+++ b/poky/meta/files/common-licenses/EDL-1.0
@@ -0,0 +1,13 @@
+Eclipse Distribution License - v 1.0
+
+Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/poky/meta/files/common-licenses/EFL-1.0 b/poky/meta/files/common-licenses/EFL-1.0
new file mode 100644
index 000000000..c39960513
--- /dev/null
+++ b/poky/meta/files/common-licenses/EFL-1.0
@@ -0,0 +1,25 @@
+
+Eiffel Forum License, version 1
+
+Permission is hereby granted to use, copy, modify and/or distribute
+this package, provided that:
+
+ - copyright notices are retained unchanged
+
+ - any distribution of this package, whether modified or not,
+ includes this file
+
+Permission is hereby also granted to distribute binary programs which
+depend on this package, provided that:
+
+ - if the binary program depends on a modified version of this
+ package, you must publicly release the modified version of this
+ package
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.
+
diff --git a/poky/meta/files/common-licenses/EFL-2.0 b/poky/meta/files/common-licenses/EFL-2.0
new file mode 100644
index 000000000..be37f904a
--- /dev/null
+++ b/poky/meta/files/common-licenses/EFL-2.0
@@ -0,0 +1,12 @@
+
+Eiffel Forum License, version 2
+
+Permission is hereby granted to use, copy, modify and/or distribute this package, provided that:
+copyright notices are retained unchanged,
+any distribution of this package, whether modified or not, includes this license text.
+Permission is hereby also granted to distribute binary programs which depend on this package. If the binary program depends on a modified version of this package, you are encouraged to publicly release the modified version of this package.
+***********************
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.
+***********************
+
diff --git a/poky/meta/files/common-licenses/EPL-1.0 b/poky/meta/files/common-licenses/EPL-1.0
new file mode 100644
index 000000000..1d76e57b9
--- /dev/null
+++ b/poky/meta/files/common-licenses/EPL-1.0
@@ -0,0 +1,72 @@
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution `originates` from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor`s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient`s responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor`s responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient`s patent(s), then such Recipient`s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient`s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient`s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/poky/meta/files/common-licenses/EUDatagrid b/poky/meta/files/common-licenses/EUDatagrid
new file mode 100644
index 000000000..d96e50441
--- /dev/null
+++ b/poky/meta/files/common-licenses/EUDatagrid
@@ -0,0 +1,29 @@
+
+EU DataGrid Software License
+
+Copyright (c) 2001 EU DataGrid. All rights reserved.
+
+This software includes voluntary contributions made to the EU DataGrid. For more information on the EU DataGrid, please see http://www.eu-datagrid.org/.
+
+Installation, use, reproduction, display, modification and redistribution of this software, with or without modification, in source and binary forms, are permitted. Any exercise of rights under this license by you or your sub-licensees is subject to the following conditions:
+
+1. Redistributions of this software, with or without modification, must reproduce the above copyright notice and the above license statement as well as this list of conditions, in the software, the user documentation and any other materials provided with the software.
+
+2. The user documentation, if any, included with a redistribution, must include the following notice:
+"This product includes software developed by the EU DataGrid (http://www.eu-datagrid.org/)."
+
+Alternatively, if that is where third-party acknowledgments normally appear, this acknowledgment must be reproduced in the software itself.
+
+3. The names "EDG", "EDG Toolkit", &#8220;EU DataGrid&#8221; and "EU DataGrid Project" may not be used to endorse or promote software, or products derived
+therefrom, except with prior written permission by hep-project-grid-edg-license@cern.ch.
+
+4. You are under no obligation to provide anyone with any bug fixes, patches, upgrades or other modifications, enhancements or derivatives of the features,functionality or performance of this software that you may develop. However, if you publish or distribute your modifications, enhancements or derivative works without contemporaneously requiring users to enter into a separate written license agreement, then you are deemed to have granted participants in the EU DataGrid a worldwide, non-exclusive, royalty-free, perpetual license to install, use, reproduce, display, modify, redistribute and sub-license your modifications, enhancements or derivative works, whether in binary or source code form, under the license conditions stated in this list of conditions.
+
+5. DISCLAIMER
+
+THIS SOFTWARE IS PROVIDED BY THE EU DATAGRID AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE EU DATAGRID AND CONTRIBUTORS MAKE NO REPRESENTATION THAT THE SOFTWARE, MODIFICATIONS, ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY RIGHT.
+
+6. LIMITATION OF LIABILITY
+
+THE EU DATAGRID AND CONTRIBUTORS SHALL HAVE NO LIABILITY TO LICENSEE OR OTHER PERSONS FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS, OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR OTHERWISE, ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
diff --git a/poky/meta/files/common-licenses/EUPL-1.0 b/poky/meta/files/common-licenses/EUPL-1.0
new file mode 100644
index 000000000..40ecbfe23
--- /dev/null
+++ b/poky/meta/files/common-licenses/EUPL-1.0
@@ -0,0 +1,184 @@
+
+European Union Public Licence
+V.1.0
+EUPL &#169; the European Community 2007
+This European Union Public Licence (the &#8220;EUPL&#8221;) applies to the Work or Software (as
+defined below) which is provided under the terms of this Licence. Any use of the Work, other
+than as authorised under this Licence is prohibited (to the extent such use is covered by a right
+of the copyright holder of the Work).
+The Original Work is provided under the terms of this Licence when the Licensor (as defined
+below) has placed the following notice immediately following the copyright notice for the
+Original Work:
+Licensed under the EUPL V.1.0
+or has expressed by any other mean his willingness to license under the EUPL.
+1. Definitions
+In this Licence, the following terms have the following meaning:
+&#8722; The Licence: this Licence.
+&#8722; The Original Work or the Software: the software distributed and/or communicated by
+the Licensor under this Licence, available as Source Code and also as Executable
+Code as the case may be.
+&#8722; Derivative Works: the works or software that could be created by the Licensee, based
+upon the Original Work or modifications thereof. This Licence does not define the
+extent of modification or dependence on the Original Work required in order to
+classify a work as a Derivative Work; this extent is determined by copyright law
+applicable in the country mentioned in Article 15.
+&#8722; The Work: the Original Work and/or its Derivative Works.
+&#8722; The Source Code: the human-readable form of the Work which is the most
+convenient for people to study and modify.
+&#8722; The Executable Code: any code which has generally been compiled and which is
+meant to be interpreted by a computer as a program.
+&#8722; The Licensor: the natural or legal person that distributes and/or communicates the
+Work under the Licence.
+&#8722; Contributor(s): any natural or legal person who modifies the Work under the
+Licence, or otherwise contributes to the creation of a Derivative Work.
+&#8722; The Licensee or &#8220;You&#8221;: any natural or legal person who makes any usage of the
+Software under the terms of the Licence. &#8722; Distribution and/or Communication: any act of selling, giving, lending, renting,
+distributing, communicating, transmitting, or otherwise making available, on-line or
+off-line, copies of the Work at the disposal of any other natural or legal person.
+2. Scope of the rights granted by the Licence
+The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, sub-licensable
+licence to do the following, for the duration of copyright vested in the Original Work:
+&#8722; use the Work in any circumstance and for all usage,
+&#8722; reproduce the Work,
+&#8722; modify the Original Work, and make Derivative Works based upon the Work,
+&#8722; communicate to the public, including the right to make available or display the Work
+or copies thereof to the public and perform publicly, as the case may be, the Work,
+&#8722; distribute the Work or copies thereof,
+&#8722; lend and rent the Work or copies thereof,
+&#8722; sub-license rights in the Work or copies thereof.
+Those rights can be exercised on any media, supports and formats, whether now known or
+later invented, as far as the applicable law permits so.
+In the countries where moral rights apply, the Licensor waives his right to exercise his moral
+right to the extent allowed by law in order to make effective the licence of the economic rights
+here above listed.
+The Licensor grants to the Licensee royalty-free, non exclusive usage rights to any patents
+held by the Licensor, to the extent necessary to make use of the rights granted on the Work
+under this Licence.
+3. Communication of the Source Code
+The Licensor may provide the Work either in its Source Code form, or as Executable Code. If
+the Work is provided as Executable Code, the Licensor provides in addition a machinereadable copy of the Source Code of the Work along with each copy of the Work that the
+Licensor distributes or indicates, in a notice following the copyright notice attached to the
+Work, a repository where the Source Code is easily and freely accessible for as long as the
+Licensor continues to distribute and/or communicate the Work.
+4. Limitations on copyright
+Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception
+or limitation to the exclusive rights of the rights owners in the Original Work or Software, of
+the exhaustion of those rights or of other applicable limitations thereto.
+5. Obligations of the Licensee
+The grant of the rights mentioned above is subject to some restrictions and obligations
+imposed on the Licensee. Those obligations are the following: Attribution right: the Licensee shall keep intact all copyright, patent or trademarks notices
+and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must
+include a copy of such notices and a copy of the Licence with every copy of the Work he/she
+distributes and/or communicates. The Licensee must cause any Derivative Work to carry
+prominent notices stating that the Work has been modified and the date of modification.
+Copyleft clause: If the Licensee distributes and/or communicates copies of the Original
+Works or Derivative Works based upon the Original Work, this Distribution and/or
+Communication will be done under the terms of this Licence. The Licensee (becoming
+Licensor) cannot offer or impose any additional terms or conditions on the Work or
+Derivative Work that alter or restrict the terms of the Licence.
+Compatibility clause: If the Licensee Distributes and/or Communicates Derivative Works or
+copies thereof based upon both the Original Work and another work licensed under a
+Compatible Licence, this Distribution and/or Communication can be done under the terms of
+this Compatible Licence. For the sake of this clause, &#8220;Compatible Licence&#8221; refers to the
+licences listed in the appendix attached to this Licence. Should the Licensee&#8217;s obligations
+under the Compatible Licence conflict with his/her obligations under this Licence, the
+obligations of the Compatible Licence shall prevail.
+Provision of Source Code: When distributing and/or communicating copies of the Work, the
+Licensee will provide a machine-readable copy of the Source Code or indicate a repository
+where this Source will be easily and freely available for as long as the Licensee continues to
+distribute and/or communicate the Work.
+Legal Protection: This Licence does not grant permission to use the trade names, trademarks,
+service marks, or names of the Licensor, except as required for reasonable and customary use
+in describing the origin of the Work and reproducing the content of the copyright notice.
+6. Chain of Authorship
+The original Licensor warrants that the copyright in the Original Work granted hereunder is
+owned by him/her or licensed to him/her and that he/she has the power and authority to grant
+the Licence.
+Each Contributor warrants that the copyright in the modifications he/she brings to the Work
+are owned by him/her or licensed to him/her and that he/she has the power and authority to
+grant the Licence.
+Each time You, as a Licensee, receive the Work, the original Licensor and subsequent
+Contributors grant You a licence to their contributions to the Work, under the terms of this
+Licence.
+7. Disclaimer of Warranty
+The Work is a work in progress, which is continuously improved by numerous contributors. It
+is not a finished work and may therefore contain defects or &#8220;bugs&#8221; inherent to this type of
+software development.
+For the above reason, the Work is provided under the Licence on an &#8220;as is&#8221; basis and without
+warranties of any kind concerning the Work, including without limitation merchantability,
+fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of
+intellectual property rights other than copyright as stated in Article 6 of this Licence. This disclaimer of warranty is an essential part of the Licence and a condition for the grant of
+any rights to the Work.
+8. Disclaimer of Liability
+Except in the cases of wilful misconduct or damages directly caused to natural persons, the
+Licensor will in no event be liable for any direct or indirect, material or moral, damages of
+any kind, arising out of the Licence or of the use of the Work, including without limitation,
+damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or
+any commercial damage, even if the Licensor has been advised of the possibility of such
+damage. However, the Licensor will be liable under statutory product liability laws as far such
+laws apply to the Work.
+9. Additional agreements
+While distributing the Original Work or Derivative Works, You may choose to conclude an
+additional agreement to offer, and charge a fee for, acceptance of support, warranty,
+indemnity, or other liability obligations and/or services consistent with this Licence.
+However, in accepting such obligations, You may act only on your own behalf and on your
+sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if
+You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred
+by, or claims asserted against such Contributor by the fact You have accepted any such
+warranty or additional liability.
+10. Acceptance of the Licence
+The provisions of this Licence can be accepted by clicking on an icon &#8220;I agree&#8221; placed under
+the bottom of a window displaying the text of this Licence or by affirming consent in any
+other similar way, in accordance with the rules of applicable law. Clicking on that icon
+indicates your clear and irrevocable acceptance of this Licence and all of its terms and
+conditions.
+Similarly, you irrevocably accept this Licence and all of its terms and conditions by
+exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work,
+the creation by You of a Derivative Work or the Distribution and/or Communication by You
+of the Work or copies thereof.
+11. Information to the public
+In case of any Distribution and/or Communication of the Work by means of electronic
+communication by You (for example, by offering to download the Work from a remote
+location) the distribution channel or media (for example, a website) must at least provide to
+the public the information requested by the applicable law regarding the identification and
+address of the Licensor, the Licence and the way it may be accessible, concluded, stored and
+reproduced by the Licensee.
+12. Termination of the Licence
+The Licence and the rights granted hereunder will terminate automatically upon any breach by
+the Licensee of the terms of the Licence.
+Such a termination will not terminate the licences of any person who has received the Work
+from the Licensee under the Licence, provided such persons remain in full compliance with
+the Licence. 13. Miscellaneous
+Without prejudice of Article 9 above, the Licence represents the complete agreement between
+the Parties as to the Work licensed hereunder.
+If any provision of the Licence is invalid or unenforceable under applicable law, this will not
+affect the validity or enforceability of the Licence as a whole. Such provision will be
+construed and/or reformed so as necessary to make it valid and enforceable.
+The European Commission may put into force translations and/or binding new versions of
+this Licence, so far this is required and reasonable. New versions of the Licence will be
+published with a unique version number. The new version of the Licence becomes binding for
+You as soon as You become aware of its publication.
+14. Jurisdiction
+Any litigation resulting from the interpretation of this License, arising between the European
+Commission, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court
+of Justice of the European Communities, as laid down in article 238 of the Treaty establishing
+the European Community.
+Any litigation arising between Parties, other than the European Commission, and resulting
+from the interpretation of this License, will be subject to the exclusive jurisdiction of the
+competent court where the Licensor resides or conducts its primary business.
+15. Applicable Law
+This Licence shall be governed by the law of the European Union country where the Licensor
+resides or has his registered office.
+This licence shall be governed by the Belgian law if:
+&#8722; a litigation arises between the European Commission, as a Licensor, and any
+Licensee;
+&#8722; the Licensor, other than the European Commission, has no residence or registered
+office inside a European Union country.
+ ===Appendix
+&#8220;Compatible Licences&#8221; according to article 5 EUPL are:
+&#8722; General Public License (GPL) v. 2
+&#8722; Open Software License (OSL) v. 2.1, v. 3.0
+&#8722; Common Public License v. 1.0
+&#8722; Eclipse Public License v. 1.0
+&#8722; Cecill v. 2.0
+
diff --git a/poky/meta/files/common-licenses/EUPL-1.1 b/poky/meta/files/common-licenses/EUPL-1.1
new file mode 100644
index 000000000..6e1d84f77
--- /dev/null
+++ b/poky/meta/files/common-licenses/EUPL-1.1
@@ -0,0 +1,204 @@
+
+European Union Public Licence
+V. 1.1
+EUPL &#169; the European Community 2007
+This European Union Public Licence (the &#8220;EUPL&#8221;) applies to the Work or Software
+(as defined below) which is provided under the terms of this Licence. Any use of the
+Work, other than as authorised under this Licence is prohibited (to the extent such use
+is covered by a right of the copyright holder of the Work).
+The Original Work is provided under the terms of this Licence when the Licensor (as
+defined below) has placed the following notice immediately following the copyright
+notice for the Original Work:
+Licensed under the EUPL V.1.1
+or has expressed by any other mean his willingness to license under the EUPL.
+1. Definitions
+In this Licence, the following terms have the following meaning:
+- The Licence: this Licence.
+- The Original Work or the Software: the software distributed and/or communicated
+by the Licensor under this Licence, available as Source Code and also as Executable
+Code as the case may be.
+- Derivative Works: the works or software that could be created by the Licensee,
+based upon the Original Work or modifications thereof. This Licence does not define
+the extent of modification or dependence on the Original Work required in order to
+classify a work as a Derivative Work; this extent is determined by copyright law
+applicable in the country mentioned in Article 15.
+- The Work: the Original Work and/or its Derivative Works.
+- The Source Code: the human-readable form of the Work which is the most
+convenient for people to study and modify.
+- The Executable Code: any code which has generally been compiled and which is
+meant to be interpreted by a computer as a program.
+- The Licensor: the natural or legal person that distributes and/or communicates the
+Work under the Licence.
+- Contributor(s): any natural or legal person who modifies the Work under the
+Licence, or otherwise contributes to the creation of a Derivative Work.
+- The Licensee or &#8220;You&#8221;: any natural or legal person who makes any usage of the
+Software under the terms of the Licence.
+- Distribution and/or Communication: any act of selling, giving, lending, renting,
+distributing, communicating, transmitting, or otherwise making available, on-line or
+off-line, copies of the Work or providing access to its essential functionalities at the
+disposal of any other natural or legal person.
+2. Scope of the rights granted by the Licence
+The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, sublicensable
+licence to do the following, for the duration of copyright vested in the
+Original Work:
+- use the Work in any circumstance and for all usage,
+- reproduce the Work,
+- modify the Original Work, and make Derivative Works based upon the Work,
+- communicate to the public, including the right to make available or display the
+Work or copies thereof to the public and perform publicly, as the case may be,
+the Work,
+- distribute the Work or copies thereof,
+- lend and rent the Work or copies thereof,
+- sub-license rights in the Work or copies thereof.
+Those rights can be exercised on any media, supports and formats, whether now
+known or later invented, as far as the applicable law permits so.
+In the countries where moral rights apply, the Licensor waives his right to exercise his
+moral right to the extent allowed by law in order to make effective the licence of the
+economic rights here above listed.
+The Licensor grants to the Licensee royalty-free, non exclusive usage rights to any
+patents held by the Licensor, to the extent necessary to make use of the rights granted
+on the Work under this Licence.
+3. Communication of the Source Code
+The Licensor may provide the Work either in its Source Code form, or as Executable
+Code. If the Work is provided as Executable Code, the Licensor provides in addition a
+machine-readable copy of the Source Code of the Work along with each copy of the
+Work that the Licensor distributes or indicates, in a notice following the copyright
+notice attached to the Work, a repository where the Source Code is easily and freely
+accessible for as long as the Licensor continues to distribute and/or communicate the
+Work.
+4. Limitations on copyright
+Nothing in this Licence is intended to deprive the Licensee of the benefits from any
+exception or limitation to the exclusive rights of the rights owners in the Original
+Work or Software, of the exhaustion of those rights or of other applicable limitations
+thereto.
+5. Obligations of the Licensee
+The grant of the rights mentioned above is subject to some restrictions and obligations
+imposed on the Licensee. Those obligations are the following:
+Attribution right: the Licensee shall keep intact all copyright, patent or trademarks
+notices and all notices that refer to the Licence and to the disclaimer of warranties.
+The Licensee must include a copy of such notices and a copy of the Licence with
+every copy of the Work he/she distributes and/or communicates. The Licensee must
+cause any Derivative Work to carry prominent notices stating that the Work has been
+modified and the date of modification.
+Copyleft clause: If the Licensee distributes and/or communicates copies of the
+Original Works or Derivative Works based upon the Original Work, this Distribution
+and/or Communication will be done under the terms of this Licence or of a later
+version of this Licence unless the Original Work is expressly distributed only under
+this version of the Licence. The Licensee (becoming Licensor) cannot offer or impose
+any additional terms or conditions on the Work or Derivative Work that alter or
+restrict the terms of the Licence.
+Compatibility clause: If the Licensee Distributes and/or Communicates Derivative
+Works or copies thereof based upon both the Original Work and another work
+licensed under a Compatible Licence, this Distribution and/or Communication can be
+done under the terms of this Compatible Licence. For the sake of this clause,
+&#8220;Compatible Licence&#8221; refers to the licences listed in the appendix attached to this
+Licence. Should the Licensee&#8217;s obligations under the Compatible Licence conflict
+with his/her obligations under this Licence, the obligations of the Compatible Licence
+shall prevail.
+Provision of Source Code: When distributing and/or communicating copies of the
+Work, the Licensee will provide a machine-readable copy of the Source Code or
+indicate a repository where this Source will be easily and freely available for as long
+as the Licensee continues to distribute and/or communicate the Work.
+Legal Protection: This Licence does not grant permission to use the trade names,
+trademarks, service marks, or names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and reproducing
+the content of the copyright notice.
+6. Chain of Authorship
+The original Licensor warrants that the copyright in the Original Work granted
+hereunder is owned by him/her or licensed to him/her and that he/she has the power
+and authority to grant the Licence.
+Each Contributor warrants that the copyright in the modifications he/she brings to the
+Work are owned by him/her or licensed to him/her and that he/she has the power and
+authority to grant the Licence.
+Each time You accept the Licence, the original Licensor and subsequent Contributors
+grant You a licence to their contributions to the Work, under the terms of this
+Licence.
+7. Disclaimer of Warranty
+The Work is a work in progress, which is continuously improved by numerous
+contributors. It is not a finished work and may therefore contain defects or &#8220;bugs&#8221;
+inherent to this type of software development.
+For the above reason, the Work is provided under the Licence on an &#8220;as is&#8221; basis and
+without warranties of any kind concerning the Work, including without limitation
+merchantability, fitness for a particular purpose, absence of defects or errors,
+accuracy, non-infringement of intellectual property rights other than copyright as
+stated in Article 6 of this Licence.
+This disclaimer of warranty is an essential part of the Licence and a condition for the
+grant of any rights to the Work.
+8. Disclaimer of Liability
+Except in the cases of wilful misconduct or damages directly caused to natural
+persons, the Licensor will in no event be liable for any direct or indirect, material or
+moral, damages of any kind, arising out of the Licence or of the use of the Work,
+including without limitation, damages for loss of goodwill, work stoppage, computer
+failure or malfunction, loss of data or any commercial damage, even if the Licensor
+has been advised of the possibility of such damage. However, the Licensor will be
+liable under statutory product liability laws as far such laws apply to the Work.
+9. Additional agreements
+While distributing the Original Work or Derivative Works, You may choose to
+conclude an additional agreement to offer, and charge a fee for, acceptance of support,
+warranty, indemnity, or other liability obligations and/or services consistent with this
+Licence. However, in accepting such obligations, You may act only on your own
+behalf and on your sole responsibility, not on behalf of the original Licensor or any
+other Contributor, and only if You agree to indemnify, defend, and hold each
+Contributor harmless for any liability incurred by, or claims asserted against such
+Contributor by the fact You have accepted any such warranty or additional liability.
+10. Acceptance of the Licence
+The provisions of this Licence can be accepted by clicking on an icon &#8220;I agree&#8221;
+placed under the bottom of a window displaying the text of this Licence or by
+affirming consent in any other similar way, in accordance with the rules of applicable
+law. Clicking on that icon indicates your clear and irrevocable acceptance of this
+Licence and all of its terms and conditions.
+Similarly, you irrevocably accept this Licence and all of its terms and conditions by
+exercising any rights granted to You by Article 2 of this Licence, such as the use of
+the Work, the creation by You of a Derivative Work or the Distribution and/or
+Communication by You of the Work or copies thereof.
+11. Information to the public
+In case of any Distribution and/or Communication of the Work by means of electronic
+communication by You (for example, by offering to download the Work from a
+remote location) the distribution channel or media (for example, a website) must at
+least provide to the public the information requested by the applicable law regarding
+the Licensor, the Licence and the way it may be accessible, concluded, stored and
+reproduced by the Licensee.
+12. Termination of the Licence
+The Licence and the rights granted hereunder will terminate automatically upon any
+breach by the Licensee of the terms of the Licence.
+Such a termination will not terminate the licences of any person who has received the
+Work from the Licensee under the Licence, provided such persons remain in full
+compliance with the Licence.
+13. Miscellaneous
+Without prejudice of Article 9 above, the Licence represents the complete agreement
+between the Parties as to the Work licensed hereunder.
+If any provision of the Licence is invalid or unenforceable under applicable law, this
+will not affect the validity or enforceability of the Licence as a whole. Such provision
+will be construed and/or reformed so as necessary to make it valid and enforceable.
+The European Commission may publish other linguistic versions and/or new versions
+of this Licence, so far this is required and reasonable, without reducing the scope of
+the rights granted by the Licence. New versions of the Licence will be published with
+a unique version number.
+All linguistic versions of this Licence, approved by the European Commission, have
+identical value. Parties can take advantage of the linguistic version of their choice.
+14. Jurisdiction
+Any litigation resulting from the interpretation of this License, arising between the
+European Commission, as a Licensor, and any Licensee, will be subject to the
+jurisdiction of the Court of Justice of the European Communities, as laid down in
+article 238 of the Treaty establishing the European Community.
+Any litigation arising between Parties, other than the European Commission, and
+resulting from the interpretation of this License, will be subject to the exclusive
+jurisdiction of the competent court where the Licensor resides or conducts its primary
+business.
+15. Applicable Law
+This Licence shall be governed by the law of the European Union country where the
+Licensor resides or has his registered office.
+This licence shall be governed by the Belgian law if:
+- a litigation arises between the European Commission, as a Licensor, and any
+Licensee;
+- the Licensor, other than the European Commission, has no residence or
+registered office inside a European Union country.
+===
+Appendix
+&#8220;Compatible Licences&#8221; according to article 5 EUPL are:
+- GNU General Public License (GNU GPL) v. 2
+- Open Software License (OSL) v. 2.1, v. 3.0
+- Common Public License v. 1.0
+- Eclipse Public License v. 1.0
+- Cecill v. 2.0
+
diff --git a/poky/meta/files/common-licenses/Elfutils-Exception b/poky/meta/files/common-licenses/Elfutils-Exception
new file mode 100644
index 000000000..627d76912
--- /dev/null
+++ b/poky/meta/files/common-licenses/Elfutils-Exception
@@ -0,0 +1,12 @@
+ This file describes the limits of the Exception under which you are allowed
+ to distribute Non-GPL Code in linked combination with Red Hat elfutils.
+ For the full text of the license, please see one of the header files
+ included with the source distribution or the file COPYING found in the
+ top level directory of the source.
+
+ The Approved Interfaces are the functions declared in the files:
+
+ libelf.h
+ libdw.h
+ libdwfl.h
+
diff --git a/poky/meta/files/common-licenses/Entessa b/poky/meta/files/common-licenses/Entessa
new file mode 100644
index 000000000..d4dadd226
--- /dev/null
+++ b/poky/meta/files/common-licenses/Entessa
@@ -0,0 +1,20 @@
+
+Entessa Public License Version. 1.0
+Copyright (c) 2003 Entessa, LLC. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+The end-user documentation included with the redistribution, if any, must include the following acknowledgment:
+"This product includes open source software developed by openSEAL (http://www.openseal.org/)."
+
+Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear.
+
+The names "openSEAL" and "Entessa" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact epl@entessa.com.
+Products derived from this software may not be called "openSEAL", nor may "openSEAL" appear in their name, without prior written permission of Entessa.
+THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ENTESSA, LLC, OPENSEAL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+============================================================
+
+This software consists of voluntary contributions made by many individuals on behalf of openSEAL and was originally based on software contributed by Entessa, LLC, http://www.entessa.com. For more information on the openSEAL, please see <http://www.openseal.org/>.
+
diff --git a/poky/meta/files/common-licenses/ErlPL-1.1 b/poky/meta/files/common-licenses/ErlPL-1.1
new file mode 100644
index 000000000..5961ccf4d
--- /dev/null
+++ b/poky/meta/files/common-licenses/ErlPL-1.1
@@ -0,0 +1,288 @@
+
+ERLANG PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+1.1. ``Contributor`` means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. ``Contributor Version`` means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications
+made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source
+Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified
+as the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.9. ``Modifications`` means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing
+ Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+1.10. ``Original Code`` means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus
+any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or a list of source
+code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor`s
+choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is
+widely available for no charge.
+
+1.12. ``You`` means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License. For legal
+entities,``You`` includes any entity which controls, is controlled by,
+or is under common control with You. For purposes of this definition,
+``control`` means (a) the power, direct or indirect, to cause the
+direction or management of such entity, whether by contract or
+otherwise, or (b) ownership of fifty percent (50%) or more of the
+outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+ distribute the Original Code (or portions thereof) with or without
+ Modifications, or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial
+ Developer, to make, have made, use and sell (``Utilize``) the
+ Original Code (or portions thereof), but solely to the extent that
+ any such patent is reasonably necessary to enable You to Utilize
+ the Original Code (or portions thereof) and not to any greater
+ extent that may be necessary to Utilize further Modifications or
+ combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+ distribute the Modifications created by such Contributor (or
+ portions thereof) either on an unmodified basis, with other
+ Modifications, as Covered Code or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor,
+ to Utilize the Contributor Version (or portions thereof), but
+ solely to the extent that any such patent is reasonably necessary
+ to enable You to Utilize the Contributor Version (or portions
+ thereof), and not to any greater extent that may be necessary to
+ Utilize further Modifications or combinations.
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You contribute are governed by the terms of
+this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms
+of this License, and You must include a copy of this License with
+every copy of the Source Code You distribute. You may not offer or
+impose any terms on any Source Code version that alters or restricts
+the applicable version of this License or the recipients` rights
+hereunder. However, You may include an additional document offering
+the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You contribute must be made available in Source
+Code form under the terms of this License either on the same media as
+an Executable version or via an accepted Electronic Distribution
+Mechanism to anyone to whom you made an Executable version available;
+and if made available via Electronic Distribution Mechanism, must
+remain available for at least twelve (12) months after the date it
+initially became available, or at least six (6) months after a
+subsequent version of that particular Modification has been made
+available to such recipients. You are responsible for ensuring that
+the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+ If You have knowledge that a party claims an intellectual property
+ right in particular functionality or code (or its utilization
+ under this License), you must include a text file with the source
+ code distribution titled ``LEGAL`` which describes the claim and
+ the party making the claim in sufficient detail that a recipient
+ will know whom to contact. If you obtain such knowledge after You
+ make Your Modification available as described in Section 3.2, You
+ shall promptly modify the LEGAL file in all copies You make
+ available thereafter and shall take other steps (such as notifying
+ appropriate mailing lists or newsgroups) reasonably calculated to
+ inform those who received the Covered Code that new knowledge has
+ been obtained.
+
+(b) Contributor APIs.
+ If Your Modification is an application programming interface and
+ You own or control patents which are reasonably necessary to
+ implement that API, you must also include this information in the
+ LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source
+Code, and this License in any documentation for the Source Code, where
+You describe recipients` rights relating to Covered Code. If You
+created one or more Modification(s), You may add your name as a
+Contributor to the notice described in Exhibit A. If it is not
+possible to put such notice in a particular Source Code file due to
+its structure, then you must include such notice in a location (such
+as a relevant directory file) where a user would be likely to look for
+such a notice. You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations to one or more
+recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear than any such warranty,
+support, indemnity or liability obligation is offered by You alone,
+and You hereby agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial Developer or
+such Contributor as a result of warranty, support, indemnity or
+liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code under a license of Your choice, which may contain terms different
+from this License, provided that You are in compliance with the terms
+of this License and that the license for the Executable version does
+not attempt to limit or alter the recipient`s rights in the Source
+Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must
+make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by the Initial Developer or any
+Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to statute
+or regulation then You must: (a) comply with the terms of this License
+to the maximum extent possible; and (b) describe the limitations and
+the code they affect. Such description must be included in the LEGAL
+file described in Section 3.4 and must be included with all
+distributions of the Source Code. Except to the extent prohibited by
+statute or regulation, such description must be sufficiently detailed
+for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A, and to related Covered Code.
+
+6. CONNECTION TO MOZILLA PUBLIC LICENSE
+
+This Erlang License is a derivative work of the Mozilla Public
+License, Version 1.0. It contains terms which differ from the Mozilla
+Public License, Version 1.0.
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
+NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
+THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE
+IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
+OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
+EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+9. DISCLAIMER OF LIABILITY
+Any utilization of Covered Code shall not cause the Initial Developer
+or any Contributor to be liable for any damages (neither direct nor
+indirect).
+
+10. MISCELLANEOUS
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be construed by and in accordance with
+the substantive laws of Sweden. Any dispute, controversy or claim
+arising out of or relating to this License, or the breach, termination
+or invalidity thereof, shall be subject to the exclusive jurisdiction
+of Swedish courts, with the Stockholm City Court as the first
+instance.
+
+EXHIBIT A.
+
+``The contents of this file are subject to the Erlang Public License,
+Version 1.1, (the "License"); you may not use this file except in
+compliance with the License. You should have received a copy of the
+Erlang Public License along with this software. If not, it can be
+retrieved via the world wide web at http://www.erlang.org/.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+AB. All Rights Reserved.``
+
diff --git a/poky/meta/files/common-licenses/FSF-Unlimited b/poky/meta/files/common-licenses/FSF-Unlimited
new file mode 100644
index 000000000..010a981af
--- /dev/null
+++ b/poky/meta/files/common-licenses/FSF-Unlimited
@@ -0,0 +1,4 @@
+Copyright (C) 1997-2010 Free Software Foundation, Inc.
+This file is free software; the Free Software Foundation
+gives unlimited permission to copy and/or distribute it,
+with or without modifications, as long as this notice is preserved.
diff --git a/poky/meta/files/common-licenses/Fair b/poky/meta/files/common-licenses/Fair
new file mode 100644
index 000000000..475b01db9
--- /dev/null
+++ b/poky/meta/files/common-licenses/Fair
@@ -0,0 +1,11 @@
+
+Fair License
+(plain text)
+<Copyright Information>
+
+Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
+
+DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
+
+[2004, Fair License: rhid.com/fair (this URL no longer works)]
+
diff --git a/poky/meta/files/common-licenses/Frameworx-1.0 b/poky/meta/files/common-licenses/Frameworx-1.0
new file mode 100644
index 000000000..2abb1845a
--- /dev/null
+++ b/poky/meta/files/common-licenses/Frameworx-1.0
@@ -0,0 +1,69 @@
+
+THE FRAMEWORX OPEN LICENSE 1.0
+This License Agreement, The Frameworx Open License 1.0, has been entered into between The Frameworx Company and you, the licensee hereunder, effective as of Your acceptance of the Frameworx Code Base or an Downstream Distribution (each as defined below).
+
+AGREEMENT BACKGROUND
+The Frameworx Company is committed to the belief that open source software results in better quality, greater technical and product innovation in the market place and a more empowered and productive developer and end-user community. Our objective is to ensure that the Frameworx Code Base, and the source code for improvements and innovations to it, remain free and open to the community.To further these beliefs and objectives, we are distributing the Frameworx Code Base, without royalties and in source code form, to the community pursuant to this License Agreement.
+
+AGREEMENT TERMS
+The Frameworx Company and You have agreed as follows:
+1.Definitions.The following terms have the following respective meanings:
+
+(a) Frameworx Code Base means the software developed by The Frameworx Company and made available under this License Agreement
+
+(b) Downstream Distribution means any direct or indirect release, distribution or remote availability of software (i) that directly or indirectly contains, or depends for its intended functioning on, the Frameworx Code Base or any portion or element thereof and (ii) in which rights to use and distribute such Frameworx Code Base software depend, directly or indirectly, on the License provided in Section 2 below.
+
+(c) "Source Code" to any software means the preferred form for making modifications to that software, including any associated documentation, interface definition files and compilation or installation scripts, or any version thereof that has been compressed or archived, and can be reconstituted, using an appropriate and generally available archival or compression technology.
+
+(d) Value-Added Services means any commercial or fee-based software-related service, including without limitation: system or application development or consulting; technical or end-user support or training; distribution maintenance, configuration or versioning; or outsourced, hosted or network-based application services.
+
+2. License Grant. Subject to the terms and conditions hereof, The Frameworx Company hereby grants You a non-exclusive license (the License), subject to third party intellectual property claims, and for no fee other than a nominal charge reflecting the costs of physical distribution, to:
+
+(a) use the Frameworx Code Base, in either Source Code or machine-readable form;
+
+(b) make modifications, additions and deletions to the content or structure of the Frameworx Code Base; or
+
+(c) create larger works or derivative works including the Frameworx Code Base or any portion or element thereof; and
+
+(d) release, distribute or make available, either generally or to any specific third-party, any of the foregoing in Source Code or binary form.
+
+3. License Conditions. The grant of the License under Section 1 hereof, and your exercise of all rights in connection with this License Agreement, will remain subject to the following terms and conditions, as well as to the other provisions hereof:
+
+(a) Complete Source Code for any Downstream Distribution directly or indirectly made by You that contains, or depends for its intended functionality on, the Frameworx Code Base, or any portion or element thereof, shall be made freely available to all users thereof on terms and conditions no more restrictive, and no less favorable for any user (including, without limitation, with regard to Source Code availability and royalty-free use) than those terms and conditions provided in this License Agreement.
+
+(b) Any Value-Added Services that you offer or provide, directly or indirectly, in relation to any Downstream Distribution shall be offered and provided on commercial terms that are reasonably commensurate to the fair market value of such Value-Added Services. In addition, the terms and conditions on which any such Value Added Services are so offered or provided shall be consistent with, and shall fully support, the intent and purpose of this License Agreement.
+
+(c) All Downstream Distributions shall:
+
+ (i) include all portions and elements of the Frameworx Code Base required to build the Source Code of such Downstream Distribution into a fully functional machine-executable system, or additional build scripts or comparable software necessary and sufficient for such purposes;
+
+ (ii) include, in each file containing any portion or element of the Frameworx Code Base, the following identifying legend: This file contains software that has been made available under The Frameworx Open License 1.0. Use and distribution hereof are subject to the restrictions set forth therein.
+
+ (iii) include all other copyright notices, authorship credits, warranty disclaimers (including that provided in Section 6 below), legends, documentation, annotations and comments contained in the Frameworx Code Base as provided to You hereunder;
+
+ (iv) contain an unaltered copy of the html file named frameworx_community_invitation.html included within the Frameworx Code Base that acknowledges new users and provides them with information on the Frameworx Code Base community;
+
+ (v) contain an unaltered copy of the text file named the_frameworx_license.txt included within the Frameworx Code Base that includes a text copy of the form of this License Agreement; and
+
+ (vi) prominently display to any viewer or user of the Source Code of such Open Downstream Distribution, in the place and manner normally used for such displays, the following legend:
+
+Source code licensed under from The Frameworx Company is contained herein, and such source code has been obtained either under The Frameworx Open License, or another license granted by The Frameworx Company. Use and distribution hereof is subject to the restrictions provided in the relevant such license and to the copyrights of the licensor thereunder. A copy of The Frameworx Open License is provided in a file named the_frameworx_license.txt and included herein, and may also be available for inspection at http://www.frameworx.com.
+
+4. Restrictions on Open Downstream Distributions. Each Downstream Distribution made by You, and by any party directly or indirectly obtaining rights to the Frameworx Code Base through You, shall be made subject to a license grant or agreement to the extent necessary so that each distributee under that Downstream Distribution will be subject to the same restrictions on re-distribution and use as are binding on You hereunder. You may satisfy this licensing requirement either by:
+
+(a) requiring as a condition to any Downstream Distribution made by you, or by any direct or indirect distributee of Your Downstream Distribution (or any portion or element thereof), that each distributee under the relevant Downstream Distribution obtain a direct license (on the same terms and conditions as those in this License Agreement) from The Frameworx Company; or
+
+(b) sub-licensing all (and not less than all) of Your rights and obligations hereunder to that distributee, including (without limitation) Your obligation to require distributees to be bound by license restrictions as contemplated by this Section 4 above.
+
+The Frameworx Company hereby grants to you all rights to sub-license your rights hereunder as necessary to fully effect the intent and purpose of this Section 4 above, provided, however, that your rights and obligations hereunder shall be unaffected by any such sublicensing. In addition, The Frameworx Company expressly retains all rights to take all appropriate action (including legal action) against any such direct or indirect sub-licensee to ensure its full compliance with the intent and purposes of this License Agreement.
+
+5. Intellectual Property. Except as expressly provided herein, this License Agreement preserves and respects Your and The Frameworx Companys respective intellectual property rights, including, in the case of The Frameworx Company, its copyrights and patent rights relating to the Frameworx Code Base.
+
+6. Warranty Disclaimer. THE SOFTWARE LICENSED HEREUNDER IS PROVIDED ``AS IS.`` ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE LICENSOR OF THIS SOFTWARE, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES INCLUDING (BUT NOT LIMITED TO) PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+7. License Violation. The License, and all of your rights thereunder, shall be deemed automatically terminated and void as of any Downstream Distribution directly or indirectly made or facilitated by You that violates the provisions of this License Agreement, provided, however, that this License Agreement shall survive any such termination in order to remedy the effects of such violation. This License Agreement shall be binding on the legal successors and assigns of the parties hereto.
+
+Your agreement to the foregoing as of the date hereof has been evidenced by your acceptance of the relevant software distribution hereunder.
+
+(C) THE FRAMEWORX COMPANY 2003
+
diff --git a/poky/meta/files/common-licenses/FreeType b/poky/meta/files/common-licenses/FreeType
new file mode 100644
index 000000000..b7d4d11c0
--- /dev/null
+++ b/poky/meta/files/common-licenses/FreeType
@@ -0,0 +1,170 @@
+ The FreeType Project LICENSE
+ ----------------------------
+
+ 2006-Jan-27
+
+ Copyright 1996-2002, 2006 by
+ David Turner, Robert Wilhelm, and Werner Lemberg
+
+
+
+Introduction
+============
+
+ The FreeType Project is distributed in several archive packages;
+ some of them may contain, in addition to the FreeType font engine,
+ various tools and contributions which rely on, or relate to, the
+ FreeType Project.
+
+ This license applies to all files found in such packages, and
+ which do not fall under their own explicit license. The license
+ affects thus the FreeType font engine, the test programs,
+ documentation and makefiles, at the very least.
+
+ This license was inspired by the BSD, Artistic, and IJG
+ (Independent JPEG Group) licenses, which all encourage inclusion
+ and use of free software in commercial and freeware products
+ alike. As a consequence, its main points are that:
+
+ o We don't promise that this software works. However, we will be
+ interested in any kind of bug reports. (`as is' distribution)
+
+ o You can use this software for whatever you want, in parts or
+ full form, without having to pay us. (`royalty-free' usage)
+
+ o You may not pretend that you wrote this software. If you use
+ it, or only parts of it, in a program, you must acknowledge
+ somewhere in your documentation that you have used the
+ FreeType code. (`credits')
+
+ We specifically permit and encourage the inclusion of this
+ software, with or without modifications, in commercial products.
+ We disclaim all warranties covering The FreeType Project and
+ assume no liability related to The FreeType Project.
+
+
+ Finally, many people asked us for a preferred form for a
+ credit/disclaimer to use in compliance with this license. We thus
+ encourage you to use the following text:
+
+ """
+ Portions of this software are copyright � <year> The FreeType
+ Project (www.freetype.org). All rights reserved.
+ """
+
+ Please replace <year> with the value from the FreeType version you
+ actually use.
+
+
+Legal Terms
+===========
+
+0. Definitions
+--------------
+
+ Throughout this license, the terms `package', `FreeType Project',
+ and `FreeType archive' refer to the set of files originally
+ distributed by the authors (David Turner, Robert Wilhelm, and
+ Werner Lemberg) as the `FreeType Project', be they named as alpha,
+ beta or final release.
+
+ `You' refers to the licensee, or person using the project, where
+ `using' is a generic term including compiling the project's source
+ code as well as linking it to form a `program' or `executable'.
+ This program is referred to as `a program using the FreeType
+ engine'.
+
+ This license applies to all files distributed in the original
+ FreeType Project, including all source code, binaries and
+ documentation, unless otherwise stated in the file in its
+ original, unmodified form as distributed in the original archive.
+ If you are unsure whether or not a particular file is covered by
+ this license, you must contact us to verify this.
+
+ The FreeType Project is copyright (C) 1996-2000 by David Turner,
+ Robert Wilhelm, and Werner Lemberg. All rights reserved except as
+ specified below.
+
+1. No Warranty
+--------------
+
+ THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
+ USE, OF THE FREETYPE PROJECT.
+
+2. Redistribution
+-----------------
+
+ This license grants a worldwide, royalty-free, perpetual and
+ irrevocable right and license to use, execute, perform, compile,
+ display, copy, create derivative works of, distribute and
+ sublicense the FreeType Project (in both source and object code
+ forms) and derivative works thereof for any purpose; and to
+ authorize others to exercise some or all of the rights granted
+ herein, subject to the following conditions:
+
+ o Redistribution of source code must retain this license file
+ (`FTL.TXT') unaltered; any additions, deletions or changes to
+ the original files must be clearly indicated in accompanying
+ documentation. The copyright notices of the unaltered,
+ original files must be preserved in all copies of source
+ files.
+
+ o Redistribution in binary form must provide a disclaimer that
+ states that the software is based in part of the work of the
+ FreeType Team, in the distribution documentation. We also
+ encourage you to put an URL to the FreeType web page in your
+ documentation, though this isn't mandatory.
+
+ These conditions apply to any software derived from or based on
+ the FreeType Project, not just the unmodified files. If you use
+ our work, you must acknowledge us. However, no fee need be paid
+ to us.
+
+3. Advertising
+--------------
+
+ Neither the FreeType authors and contributors nor you shall use
+ the name of the other for commercial, advertising, or promotional
+ purposes without specific prior written permission.
+
+ We suggest, but do not require, that you use one or more of the
+ following phrases to refer to this software in your documentation
+ or advertising materials: `FreeType Project', `FreeType Engine',
+ `FreeType library', or `FreeType Distribution'.
+
+ As you have not signed this license, you are not required to
+ accept it. However, as the FreeType Project is copyrighted
+ material, only this license, or another one contracted with the
+ authors, grants you the right to use, distribute, and modify it.
+ Therefore, by using, distributing, or modifying the FreeType
+ Project, you indicate that you understand and accept all the terms
+ of this license.
+
+4. Contacts
+-----------
+
+ There are two mailing lists related to FreeType:
+
+ o freetype@nongnu.org
+
+ Discusses general use and applications of FreeType, as well as
+ future and wanted additions to the library and distribution.
+ If you are looking for support, start in this list if you
+ haven't found anything to help you in the documentation.
+
+ o freetype-devel@nongnu.org
+
+ Discusses bugs, as well as engine internals, design issues,
+ specific licenses, porting, etc.
+
+ Our home page can be found at
+
+ http://www.freetype.org
+
+
+--- end of FTL.TXT ---
+
diff --git a/poky/meta/files/common-licenses/GFDL-1.1 b/poky/meta/files/common-licenses/GFDL-1.1
new file mode 100644
index 000000000..1d7422315
--- /dev/null
+++ b/poky/meta/files/common-licenses/GFDL-1.1
@@ -0,0 +1,355 @@
+ GNU Free Documentation License
+ Version 1.1, March 2000
+
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+written document "free" in the sense of freedom: to assure everyone
+the effective freedom to copy and redistribute it, with or without
+modifying it, either commercially or noncommercially. Secondarily,
+this License preserves for the author and publisher a way to get
+credit for their work, while not being considered responsible for
+modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work that contains a
+notice placed by the copyright holder saying it can be distributed
+under the terms of this License. The "Document", below, refers to any
+such manual or work. Any member of the public is a licensee, and is
+addressed as "you".
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (For example, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, whose contents can be viewed and edited directly and
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup has been designed to thwart or discourage
+subsequent modification by readers is not Transparent. A copy that is
+not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML designed for human modification. Opaque formats include
+PostScript, PDF, proprietary formats that can be read and edited only
+by proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML produced by some word processors for output
+purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies of the Document numbering more than 100,
+and the Document's license notice requires Cover Texts, you must enclose
+the copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a publicly-accessible computer-network location containing a complete
+Transparent copy of the Document, free of added material, which the
+general network-using public has access to download anonymously at no
+charge using public-standard network protocols. If you use the latter
+option, you must take reasonably prudent steps, when you begin
+distribution of Opaque copies in quantity, to ensure that this
+Transparent copy will remain thus accessible at the stated location
+until at least one year after the last time you distribute an Opaque
+copy (directly or through your agents or retailers) of that edition to
+the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has less than five).
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section entitled "History", and its title, and add to
+ it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. In any section entitled "Acknowledgements" or "Dedications",
+ preserve the section's title, and preserve in the section all the
+ substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section as "Endorsements"
+ or to conflict in title with any Invariant Section.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections entitled "History"
+in the various original documents, forming one section entitled
+"History"; likewise combine any sections entitled "Acknowledgements",
+and any sections entitled "Dedications". You must delete all sections
+entitled "Endorsements."
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, does not as a whole count as a Modified Version
+of the Document, provided no compilation copyright is claimed for the
+compilation. Such a compilation is called an "aggregate", and this
+License does not apply to the other self-contained works thus compiled
+with the Document, on account of their being thus compiled, if they
+are not themselves derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one quarter
+of the entire aggregate, the Document's Cover Texts may be placed on
+covers that surround only the Document within the aggregate.
+Otherwise they must appear on covers around the whole aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License provided that you also include the
+original English version of this License. In case of a disagreement
+between the translation and the original English version of this
+License, the original English version will prevail.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1
+ or any later version published by the Free Software Foundation;
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have no Invariant Sections, write "with no Invariant Sections"
+instead of saying which ones are invariant. If you have no
+Front-Cover Texts, write "no Front-Cover Texts" instead of
+"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/poky/meta/files/common-licenses/GFDL-1.2 b/poky/meta/files/common-licenses/GFDL-1.2
new file mode 100644
index 000000000..ec872c6b8
--- /dev/null
+++ b/poky/meta/files/common-licenses/GFDL-1.2
@@ -0,0 +1,399 @@
+
+ GNU Free Documentation License
+ Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document`s overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work`s title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document`s license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document`s license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version`s license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation`s users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document`s Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License. Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License. However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
diff --git a/poky/meta/files/common-licenses/GFDL-1.3 b/poky/meta/files/common-licenses/GFDL-1.3
new file mode 100644
index 000000000..ab11a44a6
--- /dev/null
+++ b/poky/meta/files/common-licenses/GFDL-1.3
@@ -0,0 +1,453 @@
+
+
+ GNU Free Documentation License
+ Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document`s overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject. (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work`s title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document`s license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it. In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+ from that of the Document, and from those of previous versions
+ (which should, if there were any, be listed in the History section
+ of the Document). You may use the same title as a previous version
+ if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+ responsible for authorship of the modifications in the Modified
+ Version, together with at least five of the principal authors of the
+ Document (all of its principal authors, if it has fewer than five),
+ unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+ Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+ adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+ giving the public permission to use the Modified Version under the
+ terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+ and required Cover Texts given in the Document`s license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+ to it an item stating at least the title, year, new authors, and
+ publisher of the Modified Version as given on the Title Page. If
+ there is no section Entitled "History" in the Document, create one
+ stating the title, year, authors, and publisher of the Document as
+ given on its Title Page, then add an item describing the Modified
+ Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+ public access to a Transparent copy of the Document, and likewise
+ the network locations given in the Document for previous versions
+ it was based on. These may be placed in the "History" section.
+ You may omit a network location for a work that was published at
+ least four years before the Document itself, or if the original
+ publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+ Preserve the Title of the section, and preserve in the section all
+ the substance and tone of each of the contributor acknowledgements
+ and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+ unaltered in their text and in their titles. Section numbers
+ or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements". Such a section
+ may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+ or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant. To do this, add their titles to the
+list of Invariant Sections in the Modified Version`s license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version. Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity. If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy. If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications". You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation`s users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document`s Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections. You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers. In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+However, if you cease all violation of this License, then your license
+from a particular copyright holder is reinstated (a) provisionally,
+unless and until the copyright holder explicitly and finally
+terminates your license, and (b) permanently, if the copyright holder
+fails to notify you of the violation by some reasonable means prior to
+60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns. See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation. If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation. If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy`s public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works. A
+public wiki that anybody can edit is an example of such a server. A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+license published by Creative Commons Corporation, a not-for-profit
+corporation with a principal place of business in San Francisco,
+California, as well as future copyleft versions of that license
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this
+License, and if all works that were first published under this License
+somewhere other than this MMC, and subsequently incorporated in whole or
+in part into the MMC, (1) had no cover texts or invariant sections, and
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+ Copyright (c) YEAR YOUR NAME.
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.3
+ or any later version published by the Free Software Foundation;
+ with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+ A copy of the license is included in the section entitled "GNU
+ Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+ with the Invariant Sections being LIST THEIR TITLES, with the
+ Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
diff --git a/poky/meta/files/common-licenses/GPL-1.0 b/poky/meta/files/common-licenses/GPL-1.0
new file mode 100644
index 000000000..9d4ef93ae
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-1.0
@@ -0,0 +1,252 @@
+
+GNU General Public License, version 1
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The license agreements of most software companies try to keep users
+at the mercy of those companies. By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. The
+General Public License applies to the Free Software Foundation`s
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author`s protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors` reputations.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License. The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications. Each
+licensee is addressed as "you".
+
+ 1. You may copy and distribute verbatim copies of the Program`s source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program. You may charge a fee for the physical act of
+transferring a copy.
+
+ 2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish, that
+ in whole or in part contains the Program or any part thereof, either
+ with or without modifications, to be licensed at no charge to all
+ third parties under the terms of this General Public License (except
+ that you may choose to grant warranty protection to some or all
+ third parties, at your option).
+
+ c) If the modified program normally reads commands interactively when
+ run, you must cause it, when started running for such interactive use
+ in the simplest and most usual way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this General
+ Public License.
+
+ d) You may charge a fee for the physical act of transferring a
+ copy, and you may at your option offer warranty protection in
+ exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+ 3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal charge
+ for the cost of distribution) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it. For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+ 4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License. However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+ 5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions. You may not impose any further restrictions on the
+recipients` exercise of the rights granted herein.
+
+ 7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+ 8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program`s name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w`.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c` for details.
+
+The hypothetical commands `show w` and `show c` should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w` and `show
+c`; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision` (a program to direct compilers to make passes
+ at assemblers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+That`s all there is to it!
+
diff --git a/poky/meta/files/common-licenses/GPL-2-with-bison-exception b/poky/meta/files/common-licenses/GPL-2-with-bison-exception
new file mode 100644
index 000000000..dd3427397
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2-with-bison-exception
@@ -0,0 +1,7 @@
+
+insert GPL v2 text here
+
+Bison Exception
+As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn`t itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.
+This special exception was added by the Free Software Foundation in version 2.2 of Bison.
+
diff --git a/poky/meta/files/common-licenses/GPL-2.0 b/poky/meta/files/common-licenses/GPL-2.0
new file mode 100644
index 000000000..7f5abbce2
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0
@@ -0,0 +1,132 @@
+
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program`s name and an idea of what it does.
+Copyright (C) yyyy name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w`. This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c`
+for details.
+The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision`
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+
diff --git a/poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception b/poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception
new file mode 100644
index 000000000..ff8de09dc
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0-with-GCC-exception
@@ -0,0 +1,17 @@
+
+insert GPL v2 text here
+
+GCC Linking Exception
+In addition to the permissions in the GNU General Public License, the Free
+Software Foundation gives you unlimited permission to link the compiled version
+of this file into combinations with other programs, and to distribute those
+combinations without any restriction coming from the use of this file. (The
+General Public License restrictions do apply in other respects; for example,
+they cover modification of the file, and distribution when not linked into a
+combine executable.)
+
+
+
+
+
+
diff --git a/poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception b/poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception
new file mode 100644
index 000000000..7586c6225
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception
@@ -0,0 +1,285 @@
+
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program`s name and an idea of what it does.
+Copyright (C) yyyy name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w`. This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c`
+for details.
+The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision`
+(which makes passes at compilers) written
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+
+
+In addition, as a special exception, the copyright holder
+gives permission to link the code of this program with
+any version of the OpenSSL library which is distributed
+under a license identical to that listed in the included
+COPYING.OpenSSL file, and distribute linked combinations
+including the two. You must obey the GNU General Public
+License in all respects for all of the code used other
+than OpenSSL. If you modify this file, you may extend this
+exception to your version of the file, but you are not
+obligated to do so. If you do not wish to do so, delete
+this exception statement from your version.
+
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, version 2 of the License
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+ LICENSE ISSUES
+ ==============
+
+ The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
+ See below for the actual license texts. Actually both licenses are BSD-style
+ Open Source licenses. In case of any license issues related to OpenSSL
+ please contact openssl-core@openssl.org.
+
+ OpenSSL License
+ ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
diff --git a/poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception b/poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception
new file mode 100644
index 000000000..a22aad7ed
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0-with-autoconf-exception
@@ -0,0 +1,6 @@
+
+insert GPL v2 license text here
+
+As a special exception, the respective Autoconf Macro`s copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using or
+This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well.
+
diff --git a/poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception b/poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception
new file mode 100644
index 000000000..8d3e9cdbd
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0-with-classpath-exception
@@ -0,0 +1,7 @@
+
+insert GPL v2 license text here
+
+Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
+
+As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
+
diff --git a/poky/meta/files/common-licenses/GPL-2.0-with-font-exception b/poky/meta/files/common-licenses/GPL-2.0-with-font-exception
new file mode 100644
index 000000000..abb42f9f9
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-2.0-with-font-exception
@@ -0,0 +1,18 @@
+
+insert GPL v2 text here
+
+Font Exception
+As a special exception, if you create a document which uses this font, and
+embed this font or unaltered portions of this font into the document, this font
+does not by itself cause the resulting document to be covered by the GNU
+General Public License. This exception does not however invalidate any other
+reasons why the document might be covered by the GNU General Public License. If
+you modify this font, you may extend this exception to your version of the
+font, but you are not obligated to do so. If you do not wish to do so, delete
+this exception statement from your version.
+
+
+
+
+
+
diff --git a/poky/meta/files/common-licenses/GPL-3.0 b/poky/meta/files/common-licenses/GPL-3.0
new file mode 100644
index 000000000..e0665a64a
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-3.0
@@ -0,0 +1,225 @@
+GNU GENERAL PUBLIC LICENSE
+
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+Preamble
+
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
+
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and modification follow.
+TERMS AND CONDITIONS
+0. Definitions.
+
+“This License†refers to version 3 of the GNU General Public License.
+
+“Copyright†also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+“The Program†refers to any copyrightable work licensed under this License. Each licensee is addressed as “youâ€. “Licensees†and “recipients†may be individuals or organizations.
+
+To “modify†a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version†of the earlier work or a work “based on†the earlier work.
+
+A “covered work†means either the unmodified Program or a work based on the Program.
+
+To “propagate†a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To “convey†a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays “Appropriate Legal Notices†to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+1. Source Code.
+
+The “source code†for a work means the preferred form of the work for making modifications to it. “Object code†means any non-source form of a work.
+
+A “Standard Interface†means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The “System Libraries†of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Componentâ€, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The “Corresponding Source†for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+2. Basic Permissions.
+
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+4. Conveying Verbatim Copies.
+
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+5. Conveying Modified Source Versions.
+
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+ * a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+ * b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all noticesâ€.
+ * c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+ * d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate†if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+6. Conveying Non-Source Forms.
+
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+ * a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+ * b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+ * c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+ * d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+ * e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A “User Product†is either (1) a “consumer productâ€, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used†refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+“Installation Information†for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+7. Additional Terms.
+
+“Additional permissions†are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+ * a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+ * b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+ * c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+ * d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+ * e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+ * f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+
+All other non-permissive additional terms are considered “further restrictions†within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+8. Termination.
+
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+9. Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+10. Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An “entity transaction†is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+11. Patents.
+
+A “contributor†is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor versionâ€.
+
+A contributor's “essential patent claims†are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control†includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a “patent license†is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant†such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying†means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is “discriminatory†if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+12. No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+13. Use with the GNU Affero General Public License.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
+14. Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version†applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+15. Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS†WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+16. Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+17. Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright†line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about boxâ€.
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer†for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
+
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception b/poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception
new file mode 100644
index 000000000..6c968b67e
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-3.0-with-GCC-exception
@@ -0,0 +1,27 @@
+
+insert GPL v3 text here
+
+GCC RUNTIME LIBRARY EXCEPTION
+Version 3.1, 31 March 2009
+
+General information:
+http://www.gnu.org/licenses/gcc-exception.html
+Copyright (C) 2009 Free Software Foundation, Inc. <http://fsf.org/>
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+This GCC Runtime Library Exception ("Exception") is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
+When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception.
+
+0. Definitions.
+A file is an "Independent Module" if it either requires the Runtime Library for execution after a Compilation Process, or makes use of an interface provided by the Runtime Library, but is not otherwise based on the Runtime Library.
+"GCC" means a version of the GNU Compiler Collection, with or without modifications, governed by version 3 (or a specified later version) of the GNU General Public License (GPL) with the option of using any subsequent versions published by the FSF.
+"GPL-compatible Software" is software whose conditions of propagation, modification and use would permit combination with GCC in accord with the license of GCC.
+"Target Code" refers to output from any compiler for a real or virtual target processor architecture, in executable form or suitable for input to an assembler, loader, linker and/or execution phase. Notwithstanding that, Target Code does not include data in any format that is used as a compiler intermediate representation, or used for producing a compiler intermediate representation.
+The "Compilation Process" transforms code entirely represented in non-intermediate languages designed for human-written code, and/or in Java Virtual Machine byte code, into Target Code. Thus, for example, use of source code generators and preprocessors need not be considered part of the Compilation Process, since the Compilation Process can be understood as starting with the output of the generators or preprocessors.
+A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process.
+
+1. Grant of Additional Permission.
+You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules.
+
+2. No Weakening of GCC Copyleft.
+The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC.
+
diff --git a/poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception b/poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception
new file mode 100644
index 000000000..a86f0d7c8
--- /dev/null
+++ b/poky/meta/files/common-licenses/GPL-3.0-with-autoconf-exception
@@ -0,0 +1,28 @@
+
+insert GPL v3 text here
+
+AUTOCONF CONFIGURE SCRIPT EXCEPTION
+
+Version 3.0, 18 August 2009
+
+Copyright &#169; 2009 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+This Exception is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
+
+The purpose of this Exception is to allow distribution of Autoconf`s typical output under terms of the recipient`s choice (including proprietary).
+
+0. Definitions.
+"Covered Code" is the source or object code of a version of Autoconf that is a covered work under this License.
+
+"Normally Copied Code" for a version of Autoconf means all parts of its Covered Code which that version can copy from its code (i.e., not from its input file) into its minimally verbose, non-debugging and non-tracing output.
+
+"Ineligible Code" is Covered Code that is not Normally Copied Code.
+
+1. Grant of Additional Permission.
+You have permission to propagate output of Autoconf, even if such propagation would otherwise violate the terms of GPLv3. However, if by modifying Autoconf you cause any Ineligible Code of the version you received to become Normally Copied Code of your modified version, then you void this Exception for the resulting covered work. If you convey that resulting covered work, you must remove this Exception in accordance with the second paragraph of Section 7 of GPLv3.
+
+2. No Weakening of Autoconf Copyleft.
+The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of Autoconf.
+
diff --git a/poky/meta/files/common-licenses/HPND b/poky/meta/files/common-licenses/HPND
new file mode 100644
index 000000000..274bbdb8f
--- /dev/null
+++ b/poky/meta/files/common-licenses/HPND
@@ -0,0 +1,11 @@
+
+Historical Permission Notice and Disclaimer
+
+<copyright notice>
+
+Permission to use, copy, modify and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies[,] [and] that both [that] [the] copyright notice and this permission notice appear in supporting documentation[, and that the name [of] <copyright holder> [or <related entities>] not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission]. [<copyright holder> makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
+
+[<copyright holder> DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS[,][.] IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]
+
+---
+
diff --git a/poky/meta/files/common-licenses/ICU b/poky/meta/files/common-licenses/ICU
new file mode 100644
index 000000000..a29b6fb50
--- /dev/null
+++ b/poky/meta/files/common-licenses/ICU
@@ -0,0 +1,13 @@
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2012 International Business Machines Corporation and others
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the property of their respective owners.
diff --git a/poky/meta/files/common-licenses/IPA b/poky/meta/files/common-licenses/IPA
new file mode 100644
index 000000000..d465b1c58
--- /dev/null
+++ b/poky/meta/files/common-licenses/IPA
@@ -0,0 +1,95 @@
+
+IPA Font License Agreement v1.0
+
+
+The Licensor provides the Licensed Program (as defined in Article 1 below) under the terms of this license agreement ("Agreement"). Any use, reproduction or distribution of the Licensed Program, or any exercise of rights under this Agreement by a Recipient (as defined in Article 1 below) constitutes the Recipient`s acceptance of this Agreement.
+
+
+Article 1 (Definitions)
+
+1. "Digital Font Program" shall mean a computer program containing, or used to render or display fonts.
+
+2. "Licensed Program" shall mean a Digital Font Program licensed by the Licensor under this Agreement.
+
+3. "Derived Program" shall mean a Digital Font Program created as a result of a modification, addition, deletion, replacement or any other adaptation to or of a part or all of the Licensed Program, and includes a case where a Digital Font Program newly created by retrieving font information from a part or all of the Licensed Program or Embedded Fonts from a Digital Document File with or without modification of the retrieved font information.
+
+4. "Digital Content" shall mean products provided to end users in the form of digital data, including video content, motion and/or still pictures, TV programs or other broadcasting content and products consisting of character text, pictures, photographic images, graphic symbols and/or the like.
+
+5. "Digital Document File" shall mean a PDF file or other Digital Content created by various software programs in which a part or all of the Licensed Program becomes embedded or contained in the file for the display of the font ("Embedded Fonts"). Embedded Fonts are used only in the display of characters in the particular Digital Document File within which they are embedded, and shall be distinguished from those in any Digital Font Program, which may be used for display of characters outside that particular Digital Document File.
+
+6. "Computer" shall include a server in this Agreement.
+
+7. "Reproduction and Other Exploitation" shall mean reproduction, transfer, distribution, lease, public transmission, presentation, exhibition, adaptation and any other exploitation.
+
+8. "Recipient" shall mean anyone who receives the Licensed Program under this Agreement, including one that receives the Licensed Program from a Recipient.
+
+
+
+Article 2 (Grant of License)
+
+The Licensor grants to the Recipient a license to use the Licensed Program in any and all countries in accordance with each of the provisions set forth in this Agreement. However, any and all rights underlying in the Licensed Program shall be held by the Licensor. In no sense is this Agreement intended to transfer any right relating to the Licensed Program held by the Licensor except as specifically set forth herein or any right relating to any trademark, trade name, or service mark to the Recipient.
+
+
+
+1. The Recipient may install the Licensed Program on any number of Computers and use the same in accordance with the provisions set forth in this Agreement.
+
+2. The Recipient may use the Licensed Program, with or without modification in printed materials or in Digital Content as an expression of character texts or the like.
+
+3. The Recipient may conduct Reproduction and Other Exploitation of the printed materials and Digital Content created in accordance with the preceding Paragraph, for commercial or non-commercial purposes and in any form of media including but not limited to broadcasting, communication and various recording media.
+
+4. If any Recipient extracts Embedded Fonts from a Digital Document File to create a Derived Program, such Derived Program shall be subject to the terms of this agreement.
+
+5. If any Recipient performs Reproduction or Other Exploitation of a Digital Document File in which Embedded Fonts of the Licensed Program are used only for rendering the Digital Content within such Digital Document File then such Recipient shall have no further obligations under this Agreement in relation to such actions.
+
+6. The Recipient may reproduce the Licensed Program as is without modification and transfer such copies, publicly transmit or otherwise redistribute the Licensed Program to a third party for commercial or non-commercial purposes ("Redistribute"), in accordance with the provisions set forth in Article 3 Paragraph 2.
+
+7. The Recipient may create, use, reproduce and/or Redistribute a Derived Program under the terms stated above for the Licensed Program: provided, that the Recipient shall follow the provisions set forth in Article 3 Paragraph 1 when Redistributing the Derived Program.
+
+
+Article 3 (Restriction)
+
+The license granted in the preceding Article shall be subject to the following restrictions:
+
+
+1. If a Derived Program is Redistributed pursuant to Paragraph 4 and 7 of the preceding Article, the following conditions must be met :
+
+(1) The following must be also Redistributed together with the Derived Program, or be made available online or by means of mailing mechanisms in exchange for a cost which does not exceed the total costs of postage, storage medium and handling fees:
+
+(a) a copy of the Derived Program; and
+
+(b) any additional file created by the font developing program in the course of creating the Derived Program that can be used for further modification of the Derived Program, if any.
+
+(2) It is required to also Redistribute means to enable recipients of the Derived Program to replace the Derived Program with the Licensed Program first released under this License (the "Original Program"). Such means may be to provide a difference file from the Original Program, or instructions setting out a method to replace the Derived Program with the Original Program.
+
+(3) The Recipient must license the Derived Program under the terms and conditions of this Agreement.
+
+(4) No one may use or include the name of the Licensed Program as a program name, font name or file name of the Derived Program.
+
+(5) Any material to be made available online or by means of mailing a medium to satisfy the requirements of this paragraph may be provided, verbatim, by any party wishing to do so.
+
+2. If the Recipient Redistributes the Licensed Program pursuant to Paragraph 6 of the preceding Article, the Recipient shall meet all of the following conditions:
+
+(1) The Recipient may not change the name of the Licensed Program.
+
+(2) The Recipient may not alter or otherwise modify the Licensed Program.
+
+(3) The Recipient must attach a copy of this Agreement to the Licensed Program.
+
+3. THIS LICENSED PROGRAM IS PROVIDED BY THE LICENSOR "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTY AS TO THE LICENSED PROGRAM OR ANY DERIVED PROGRAM, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXTENDED, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; PROCUREMENT OF SUBSTITUTED GOODS OR SERVICE; DAMAGES ARISING FROM SYSTEM FAILURE; LOSS OR CORRUPTION OF EXISTING DATA OR PROGRAM; LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE INSTALLATION, USE, THE REPRODUCTION OR OTHER EXPLOITATION OF THE LICENSED PROGRAM OR ANY DERIVED PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+4. The Licensor is under no obligation to respond to any technical questions or inquiries, or provide any other user support in connection with the installation, use or the Reproduction and Other Exploitation of the Licensed Program or Derived Programs thereof.
+
+
+Article 4 (Termination of Agreement)
+
+1. The term of this Agreement shall begin from the time of receipt of the Licensed Program by the Recipient and shall continue as long as the Recipient retains any such Licensed Program in any way.
+
+2. Notwithstanding the provision set forth in the preceding Paragraph, in the event of the breach of any of the provisions set forth in this Agreement by the Recipient, this Agreement shall automatically terminate without any notice. In the case of such termination, the Recipient may not use or conduct Reproduction and Other Exploitation of the Licensed Program or a Derived Program: provided that such termination shall not affect any rights of any other Recipient receiving the Licensed Program or the Derived Program from such Recipient who breached this Agreement.
+
+
+Article 5 (Governing Law)
+
+1. IPA may publish revised and/or new versions of this License. In such an event, the Recipient may select either this Agreement or any subsequent version of the Agreement in using, conducting the Reproduction and Other Exploitation of, or Redistributing the Licensed Program or a Derived Program. Other matters not specified above shall be subject to the Copyright Law of Japan and other related laws and regulations of Japan.
+
+2. This Agreement shall be construed under the laws of Japan.
+
diff --git a/poky/meta/files/common-licenses/IPL-1.0 b/poky/meta/files/common-licenses/IPL-1.0
new file mode 100644
index 000000000..2b136c9b3
--- /dev/null
+++ b/poky/meta/files/common-licenses/IPL-1.0
@@ -0,0 +1,213 @@
+
+IBM Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS IBM
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+"Contribution" means:
+
+in the case of International Business Machines Corporation ("IBM"), the Original Program, and
+in the case of each Contributor,
+changes to the Program, and
+additions to the Program;
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+`originates` from a Contributor if it was added to the Program by
+such Contributor itself or anyone acting on such Contributor`s
+behalf. Contributions do not include additions to the Program which:
+(i) are separate modules of software distributed in conjunction with
+the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means IBM and any other entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.
+
+"Original Program" means the original version of the software
+accompanying this Agreement as released by IBM, including source
+code, object code and documentation, if any.
+
+"Program" means the Original Program and Contributions.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor,
+if any, in source code and object code form. This patent license
+shall apply to the combination of the Contribution and the Program
+if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by
+the Licensed Patents. The patent license shall not apply to any
+other combinations which include the Contribution. No hardware per
+se is licensed hereunder.
+
+Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity.
+Each Contributor disclaims any liability to Recipient for claims
+brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes
+sole responsibility to secure any other intellectual property rights
+needed, if any. For example, if a third party patent license is
+required to allow Recipient to distribute the Program, it is
+Recipient`s responsibility to acquire that license before
+distributing the Program.
+Each Contributor represents that to its knowledge it has
+sufficient copyright rights in its Contribution, if any, to grant the
+copyright license set forth in this Agreement.
+3. REQUIREMENTS
+A Contributor may choose to distribute
+the Program in object code form under its own license agreement,
+provided that:
+
+it complies with the terms and conditions of this Agreement; and
+its license agreement:
+effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+it must be made available under this Agreement; and
+a copy of this Agreement must be included with each copy of the
+Program.
+Each Contributor must include the following in a conspicuous location in the Program:
+
+Copyright (C) 1996, 1999 International Business Machines Corporation and others. All Rights Reserved.
+
+In addition, each Contributor must identify itself as the originator
+of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial
+use of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with
+its distribution of the Program in a commercial product offering.
+The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any
+such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor`s
+responsibility alone. Under this section, the Commercial Contributor
+would have to defend claims against the other Contributors related to
+those performance claims and warranties, and if a court requires any
+other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement, including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with
+respect to a patent applicable to software (including a cross-claim
+or counterclaim in a lawsuit), then any patent licenses granted by
+that Contributor to such Recipient under this Agreement shall
+terminate as of the date such litigation is filed. In addition, if
+Recipient institutes patent litigation against any entity (including
+a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or
+hardware) infringes such Recipient`s patent(s), then such Recipient`s
+rights granted under Section 2(b) shall terminate as of the date such
+litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient`s
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient`s obligations under this Agreement and any
+licenses granted by Recipient relating to the Program shall continue
+and survive.
+
+IBM may publish new versions (including revisions) of this Agreement
+from time to time. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. No one
+other than IBM has the right to modify this Agreement. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under
+this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each
+party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/poky/meta/files/common-licenses/ISC b/poky/meta/files/common-licenses/ISC
new file mode 100644
index 000000000..97af105b0
--- /dev/null
+++ b/poky/meta/files/common-licenses/ISC
@@ -0,0 +1,10 @@
+
+ISC License:
+
+Copyright &#169; 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
+Copyright &#169; 1995-2003 by Internet Software Consortium
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/LGPL-2.0 b/poky/meta/files/common-licenses/LGPL-2.0
new file mode 100644
index 000000000..5931d439b
--- /dev/null
+++ b/poky/meta/files/common-licenses/LGPL-2.0
@@ -0,0 +1,342 @@
+GNU LIBRARY GENERAL PUBLIC LICENSE
+
+
+
+Version 2, June 1991
+
+
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+
+of this license document, but changing it is not allowed.
+
+
+
+[This is the first released version of the library GPL. It is
+
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+Preamble
+
+
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+
+
+This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too.
+
+
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it.
+
+
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+
+
+Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.
+
+
+
+Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.
+
+
+
+The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.
+
+
+
+Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.
+
+
+
+However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.
+
+
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library.
+
+
+
+Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.
+
+
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+
+
+0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you".
+
+
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+
+
+a) The modified work must itself be a software library.
+
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+
+
+6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+
+b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+
+c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+
+d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+
+
+13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+
+
+NO WARRANTY
+
+
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+
+END OF TERMS AND CONDITIONS
+
+
+
+How to Apply These Terms to Your New Libraries
+
+
+
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+
+
+one line to give the library's name and an idea of what it does.
+
+Copyright (C) year name of author
+
+
+
+This library is free software; you can redistribute it and/or
+
+modify it under the terms of the GNU Library General Public
+
+License as published by the Free Software Foundation; either
+
+version 2 of the License, or (at your option) any later version.
+
+
+
+This library is distributed in the hope that it will be useful,
+
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+
+Library General Public License for more details.
+
+
+
+You should have received a copy of the GNU Library General Public
+
+License along with this library; if not, write to the
+
+Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+
+Boston, MA 02110-1301, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+
+the library `Frob' (a library for tweaking knobs) written
+
+by James Random Hacker.
+
+
+
+signature of Ty Coon, 1 April 1990
+
+Ty Coon, President of Vice
+
+That's all there is to it!
+
diff --git a/poky/meta/files/common-licenses/LGPL-2.1 b/poky/meta/files/common-licenses/LGPL-2.1
new file mode 100644
index 000000000..a0e735a98
--- /dev/null
+++ b/poky/meta/files/common-licenses/LGPL-2.1
@@ -0,0 +1,176 @@
+
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author`s reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user`s freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users` freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library`s complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) The modified work must itself be a software library.
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer`s own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user`s computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Libraries
+
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the library`s name and an idea of what it does.
+Copyright (C) year name of author
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+the library `Frob` (a library for tweaking knobs) written
+by James Random Hacker.
+
+signature of Ty Coon, 1 April 1990
+Ty Coon, President of Vice
+That`s all there is to it!
+
diff --git a/poky/meta/files/common-licenses/LGPL-3.0 b/poky/meta/files/common-licenses/LGPL-3.0
new file mode 100644
index 000000000..6be29bf20
--- /dev/null
+++ b/poky/meta/files/common-licenses/LGPL-3.0
@@ -0,0 +1,65 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
+0. Additional Definitions.
+
+As used herein, “this License†refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL†refers to version 3 of the GNU General Public License.
+
+“The Library†refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
+
+An “Application†is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
+
+A “Combined Work†is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Versionâ€.
+
+The “Minimal Corresponding Source†for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
+
+The “Corresponding Application Code†for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
+1. Exception to Section 3 of the GNU GPL.
+
+You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
+2. Conveying Modified Versions.
+
+If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
+
+ * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
+ * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
+
+3. Object Code Incorporating Material from Library Header Files.
+
+The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
+
+ * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
+ * b) Accompany the object code with a copy of the GNU GPL and this license document.
+
+4. Combined Works.
+
+You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
+
+ * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
+ * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
+ * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
+ * d) Do one of the following:
+ o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
+ o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
+ * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
+
+5. Combined Libraries.
+
+You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
+
+ * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
+ * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+6. Revised Versions of the GNU Lesser General Public License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version†applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
+
+If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
diff --git a/poky/meta/files/common-licenses/LPL-1.02 b/poky/meta/files/common-licenses/LPL-1.02
new file mode 100644
index 000000000..e933748a6
--- /dev/null
+++ b/poky/meta/files/common-licenses/LPL-1.02
@@ -0,0 +1,76 @@
+
+Lucent Public License Version 1.02
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+1. DEFINITIONS
+
+"Contribution" means:
+
+in the case of Lucent Technologies Inc. ("LUCENT"), the Original Program, and
+in the case of each Contributor,
+changes to the Program, and
+additions to the Program;
+where such changes and/or additions to the Program were added to the Program by such Contributor itself or anyone acting on such Contributor`s behalf, and the Contributor explicitly consents, in accordance with Section 3C, to characterization of the changes and/or additions as Contributions.
+"Contributor" means LUCENT and any other entity that has Contributed a Contribution to the Program.
+
+"Distributor" means a Recipient that distributes the Program, modifications to the Program, or any part thereof.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Original Program" means the original version of the software accompanying this Agreement as released by LUCENT, including source code, object code and documentation, if any.
+
+"Program" means the Original Program and Contributions or any part thereof
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. The patent license granted by a Contributor shall also apply to the combination of the Contribution of that Contributor and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license granted by a Contributor shall not apply to (i) any other combinations which include the Contribution, nor to (ii) Contributions of other Contributors. No hardware per se is licensed hereunder.
+Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient`s responsibility to acquire that license before distributing the Program.
+Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A. Distributor may choose to distribute the Program in any form under this Agreement or under its own license agreement, provided that:
+
+it complies with the terms and conditions of this Agreement;
+if the Program is distributed in source code or other tangible form, a copy of this Agreement or Distributor`s own license agreement is included with each copy of the Program; and
+if distributed under Distributor`s own license agreement, such license agreement:
+effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; and
+states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.
+B. Each Distributor must include the following in a conspicuous location in the Program:
+
+Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved.
+C. In addition, each Contributor must identify itself as the originator of its Contribution in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. Also, each Contributor must agree that the additions and/or changes are intended to be a Contribution. Once a Contribution is contributed, it may not thereafter be revoked.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Distributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for Contributors. Therefore, if a Distributor includes the Program in a commercial product offering, such Distributor ("Commercial Distributor") hereby agrees to defend and indemnify every Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Distributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Distributor in writing of such claim, and b) allow the Commercial Distributor to control, and cooperate with the Commercial Distributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Distributor might include the Program in a commercial product offering, Product X. That Distributor is then a Commercial Distributor. If that Commercial Distributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Distributor`s responsibility alone. Under this section, the Commercial Distributor would have to defend claims against the Contributors related to those performance claims and warranties, and if a court requires any Contributor to pay any damages as a result, the Commercial Distributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. EXPORT CONTROL
+
+Recipient agrees that Recipient alone is responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries).
+
+8. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient`s patent(s), then such Recipient`s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient`s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient`s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+LUCENT may publish new versions (including revisions) of this Agreement from time to time. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than LUCENT has the right to modify this Agreement. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/poky/meta/files/common-licenses/LPPL-1.0 b/poky/meta/files/common-licenses/LPPL-1.0
new file mode 100644
index 000000000..f9ef35d79
--- /dev/null
+++ b/poky/meta/files/common-licenses/LPPL-1.0
@@ -0,0 +1,213 @@
+
+LaTeX Project Public License
+============================
+
+LPPL Version 1.0 1999-03-01
+
+Copyright 1999 LaTeX3 Project
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but modification is not allowed.
+
+
+Preamble
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed. As described below you may use
+this licence for any software that you wish to distribute.
+
+It may be particularly suitable if your software is TeX related (such
+as a LaTeX package file) but it may be used for any software, even if
+it is unrelated to TeX.
+
+To use this license, the files of your distribution should have an
+explicit copyright notice giving your name and the year, together
+with a reference to this license.
+
+A typical example would be
+
+ %% pig.sty
+ %% Copyright 2001 M. Y. Name
+
+ % This program can redistributed and/or modified under the terms
+ % of the LaTeX Project Public License Distributed from CTAN
+ % archives in directory macros/latex/base/lppl.txt; either
+ % version 1 of the License, or (at your option) any later version.
+
+Given such a notice in the file, the conditions of this document would
+apply, with:
+
+`The Program` referring to the software `pig.sty` and
+`The Copyright Holder` referring to the person `M. Y. Name`.
+
+To see a real example, see the file legal.txt which carries the
+copyright notice for the base latex distribution.
+
+This license gives terms under which files of The Program may be
+distributed and modified. Individual files may have specific further
+constraints on modification, but no file should have restrictions on
+distribution other than those specified below.
+This is to ensure that a distributor wishing to distribute a complete
+unmodified copy of The Program need only check the conditions in this
+file, and does not need to check every file in The Program for extra
+restrictions. If you do need to modify the distribution terms of some
+files, do not refer to this license, instead distribute The Program
+under a different license. You may use the parts of the text of LPPL as
+a model for your own license, but your license should not directly refer
+to the LPPL or otherwise give the impression that The Program is
+distributed under the LPPL.
+
+
+
+The LaTeX Project Public License
+================================
+Terms And Conditions For Copying, Distribution And Modification
+===============================================================
+
+
+WARRANTY
+========
+
+There is no warranty for The Program, to the extent permitted by
+applicable law. Except when otherwise stated in writing, The
+Copyright Holder provides The Program `as is` without warranty of any
+kind, either expressed or implied, including, but not limited to, the
+implied warranties of merchantability and fitness for a particular
+purpose. The entire risk as to the quality and performance of the
+program is with you. Should The Program prove defective, you assume
+the cost of all necessary servicing, repair or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any of the individual authors named in
+the source for The Program, be liable to you for damages, including
+any general, special, incidental or consequential damages arising out
+of any use of The Program or out of inability to use The Program
+(including but not limited to loss of data or data being rendered
+inaccurate or losses sustained by you or by third parties as a result
+of a failure of The Program to operate with any other programs), even
+if such holder or other party has been advised of the possibility of
+such damages.
+
+
+DISTRIBUTION
+============
+
+Redistribution of unchanged files is allowed provided that all files
+that make up the distribution of The Program are distributed.
+In particular this means that The Program has to be distributed
+including its documentation if documentation was part of the original
+distribution.
+
+The distribution of The Program will contain a prominent file
+listing all the files covered by this license.
+
+If you receive only some of these files from someone, complain!
+
+The distribution of changed versions of certain files included in the
+The Program, and the reuse of code from The Program, are allowed
+under the following restrictions:
+
+ * It is allowed only if the legal notice in the file does not
+ expressly forbid it.
+ See note below, under "Conditions on individual files".
+
+ * You rename the file before you make any changes to it, unless the
+ file explicitly says that renaming is not required. Any such changed
+ files must be distributed under a license that forbids distribution
+ of those files, and any files derived from them, under the names used
+ by the original files in the distribution of The Program.
+
+ * You change any `identification string` in The Program to clearly
+ indicate that the file is not part of the standard system.
+
+ * If The Program includes an `error report address` so that errors
+ may be reported to The Copyright Holder, or other specified
+ addresses, this address must be changed in any modified versions of
+ The Program, so that reports for files not maintained by the
+ original program maintainers are directed to the maintainers of the
+ changed files.
+
+ * You acknowledge the source and authorship of the original version
+ in the modified file.
+
+ * You also distribute the unmodified version of the file or
+ alternatively provide sufficient information so that the
+ user of your modified file can be reasonably expected to be
+ able to obtain an original, unmodified copy of The Program.
+ For example, you may specify a URL to a site that you expect
+ will freely provide the user with a copy of The Program (either
+ the version on which your modification is based, or perhaps a
+ later version).
+
+ * If The Program is intended to be used with, or is based on, LaTeX,
+ then files with the following file extensions which have special
+ meaning in LaTeX Software, have special modification rules under the
+ license:
+
+ - Files with extension `.ins` (installation files): these files may
+ not be modified at all because they contain the legal notices
+ that are placed in the generated files.
+
+ - Files with extension `.fd` (LaTeX font definitions files): these
+ files are allowed to be modified without changing the name, but
+ only to enable use of all available fonts and to prevent attempts
+ to access unavailable fonts. However, modified files are not
+ allowed to be distributed in place of original files.
+
+ - Files with extension `.cfg` (configuration files): these files
+ can be created or modified to enable easy configuration of the
+ system. The documentation in cfgguide.tex in the base LaTeX
+ distribution describes when it makes sense to modify or generate
+ such files.
+
+
+The above restrictions are not intended to prohibit, and hence do
+not apply to, the updating, by any method, of a file so that it
+becomes identical to the latest version of that file in The Program.
+
+========================================================================
+
+NOTES
+=====
+
+We believe that these requirements give you the freedom you to make
+modifications that conform with whatever technical specifications you
+wish, whilst maintaining the availability, integrity and reliability of
+The Program. If you do not see how to achieve your goal whilst
+adhering to these requirements then read the document cfgguide.tex
+in the base LaTeX distribution for suggestions.
+
+Because of the portability and exchangeability aspects of systems
+like LaTeX, The LaTeX3 Project deprecates the distribution of
+non-standard versions of components of LaTeX or of generally available
+contributed code for them but such distributions are permitted under the
+above restrictions.
+
+The document modguide.tex in the base LaTeX distribution details
+the reasons for the legal requirements detailed above.
+Even if The Program is unrelated to LaTeX, the argument in
+modguide.tex may still apply, and should be read before
+a modified version of The Program is distributed.
+
+
+Conditions on individual files
+==============================
+
+The individual files may bear additional conditions which supersede
+the general conditions on distribution and modification contained in
+this file. If there are any such files, the distribution of The
+Program will contain a prominent file that lists all the exceptional
+files.
+
+Typical examples of files with more restrictive modification
+conditions would be files that contain the text of copyright notices.
+
+ * The conditions on individual files differ only in the
+ extent of *modification* that is allowed.
+
+ * The conditions on *distribution* are the same for all the files.
+ Thus a (re)distributor of a complete, unchanged copy of The Program
+ need meet only the conditions in this file; it is not necessary to
+ check the header of every file in the distribution to check that a
+ distribution meets these requirements.
+
diff --git a/poky/meta/files/common-licenses/LPPL-1.1 b/poky/meta/files/common-licenses/LPPL-1.1
new file mode 100644
index 000000000..808331998
--- /dev/null
+++ b/poky/meta/files/common-licenses/LPPL-1.1
@@ -0,0 +1,316 @@
+
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.1 1999-07-10
+
+Copyright 1999 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed.
+
+You may use this license for any program that you have written and wish
+to distribute. This license may be particularly suitable if your
+program is TeX-related (such as a LaTeX package), but you may use it
+even if your program is unrelated to TeX. The section `WHETHER AND HOW
+TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE`, below, gives instructions,
+examples, and recommendations for authors who are considering
+distributing their programs under this license.
+
+In this license document, `The Program` refers to any program
+distributed under this license.
+
+This license gives conditions under which The Program may be distributed
+and conditions under which modified versions of The Program may be
+distributed. Individual files of The Program may bear supplementary
+and/or superseding conditions on modification of themselves and on the
+distribution of modified versions of themselves, but *no* file of The
+Program may bear supplementary or superseding conditions on the
+distribution of an unmodified copy of the file. A distributor wishing
+to distribute a complete, unmodified copy of The Program therefore
+needs to check the conditions only in this license and nowhere else.
+
+Activities other than distribution and/or modification of The Program
+are not covered by this license; they are outside its scope. In
+particular, the act of running The Program is not restricted.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of The Program
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+The Program. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex`
+in the base LaTeX distribution for suggestions.
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+You may distribute a complete, unmodified copy of The Program.
+Distribution of only part of The Program is not allowed.
+
+You may not modify in any way a file of The Program that bears a legal
+notice forbidding modification of that file.
+
+You may distribute a modified file of The Program if, and only if, the
+following eight conditions are met:
+
+ 1. You must meet any additional conditions borne by the file on the
+ distribution of a modified version of the file as described below
+ in the subsection `Additional Conditions on Individual Files of
+ The Program`.
+
+ 2. If the file is a LaTeX software file, then you must meet any
+ applicable additional conditions on the distribution of a modified
+ version of the file that are described below in the subsection
+ `Additional Conditions on LaTeX Software Files`.
+
+ 3. You must not distribute the modified file with the filename of the
+ original file.
+
+ 4. In the modified file, you must acknowledge the authorship and
+ name of the original file, and the name (if any) of the program
+ which contains it.
+
+ 5. You must change any identification string in the file to indicate
+ clearly that the modified file is not part of The Program.
+
+ 6. You must change any addresses in the modified file for the
+ reporting of errors in the file or in The Program generally to
+ ensure that reports for files no longer maintained by the original
+ maintainers will be directed to the maintainers of the modified
+ files.
+
+ 7. You must distribute the modified file under a license that forbids
+ distribution both of the modified file and of any files derived
+ from the modified file with the filename of the original file.
+
+ 8. You must do either (A) or (B):
+
+ (A) distribute a copy of The Program (that is, a complete,
+ unmodified copy of The Program) together with the modified
+ file; if your distribution of the modified file is made by
+ offering access to copy the modified file from a designated
+ place, then offering equivalent access to copy The Program
+ from the same place meets this condition, even though third
+ parties are not compelled to copy The Program along with the
+ modified file;
+
+ (B) provide to those who receive the modified file information
+ that is sufficient for them to obtain a copy of The Program;
+ for example, you may provide a Uniform Resource Locator (URL)
+ for a site that you expect will provide them with a copy of
+ The Program free of charge (either the version from which
+ your modification is derived, or perhaps a later version).
+
+Note that in the above, `distribution` of a file means making the
+file available to others by any means. This includes, for instance,
+installing the file on any machine in such a way that the file is
+accessible by users other than yourself. `Modification` of a file
+means any procedure that produces a derivative file under any
+applicable law -- that is, a file containing the original file or
+a significant portion of it, either verbatim or with modifications
+and/or translated into another language.
+
+Changing the name of a file is considered to be a modification of
+the file.
+
+The distribution conditions in this license do not have to be
+applied to files that have been modified in accordance with the
+above conditions. Note, however, that Condition 7. does apply to
+any such modified file.
+
+The conditions above are not intended to prohibit, and hence do not
+apply to, the updating, by any method, of a file so that it becomes
+identical to the latest version of that file of The Program.
+
+
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a file of The Program, even for your own
+personal use, without also meeting the above eight conditions for
+distributing the modified file. While you might intend that such
+modified files will never be distributed, often this will happen by
+accident -- you may forget that you have modified the file; or it may
+not occur to you when allowing others to access the modified file
+that you are thus distributing it and violating the conditions of
+this license. It is usually in your best interest to keep your copy
+of The Program identical with the public one. Many programs provide
+ways to control the behavior of that program without altering its
+licensed files.
+
+
+Additional Conditions on Individual Files of The Program
+--------------------------------------------------------
+
+An individual file of The Program may bear additional conditions that
+supplement and/or supersede the conditions in this license if, and only
+if, such additional conditions exclusively concern modification of the
+file or distribution of a modified version of the file. The conditions
+on individual files of The Program therefore may differ only with
+respect to the kind and extent of modification of those files that
+is allowed, and with respect to the distribution of modified versions
+of those files.
+
+
+Additional Conditions on LaTeX Software Files
+---------------------------------------------
+
+If a file of The Program is intended to be used with LaTeX (that is,
+if it is a LaTeX software file), then the following additional
+conditions, which supplement and/or supersede the conditions
+above, apply to the file according to its filename extension:
+
+ - You may not modify any file with filename extension `.ins` since
+ these are installation files containing the legal notices that are
+ placed in the files they generate.
+
+ - You may distribute modified versions of files with filename
+ extension `.fd` (LaTeX font definition files) under the standard
+ conditions of the LPPL as described above. You may also distribute
+ such modified LaTeX font definition files with their original names
+ provided that:
+ (1) the only changes to the original files either enable use of
+ available fonts or prevent attempts to access unavailable fonts;
+ (2) you also distribute the original, unmodified files (TeX input
+ paths can be used to control which set of LaTeX font definition
+ files is actually used by TeX).
+
+ - You may distribute modified versions of files with filename
+ extension `.cfg` (configuration files) with their original names.
+ The Program may (and usually will) specify the range of commands
+ that are allowed in a particular configuration file.
+
+Because of portability and exchangeability issues in LaTeX software,
+The LaTeX3 Project deprecates the distribution of modified versions of
+components of LaTeX or of generally available contributed code for them,
+but such distribution can meet the conditions of this license.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for The Program. Except when otherwise stated in
+writing, The Copyright Holder provides The Program `as is`, without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for
+a particular purpose. The entire risk as to the quality and performance
+of The Program is with you. Should The Program prove defective, you
+assume the cost of all necessary servicing, repair, or correction.
+
+In no event unless agreed to in writing will The Copyright Holder, or
+any author named in the files of The Program, or any other party who may
+distribute and/or modify The Program as permitted below, be liable to
+you for damages, including any general, special, incidental or
+consequential damages arising out of any use of The Program or out of
+inability to use The Program (including, but not limited to, loss of
+data, data being rendered inaccurate, or losses sustained by anyone as
+a result of any failure of The Program to operate with any other
+programs), even if The Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+WHETHER AND HOW TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE
+=========================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+programs under this license. These authors are addressed as `you` in
+this section.
+
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your program you want or need to use *distribution*
+conditions that differ from those in this license, then do not refer to
+this license anywhere in your program but instead distribute your
+program under a different license. You may use the text of this license
+as a model for your own license, but your license should not refer to
+the LPPL or otherwise give the impression that your program is
+distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your program is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their programs under any
+license are encouraged to read it.
+
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the files of your program both
+an explicit copyright notice including your name and the year and also
+a statement that the distribution and/or modification of the file is
+constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2001 M. Y. Name
+ %
+ % This program may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.1
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.1 or later is part of all distributions of LaTeX
+ % version 1999/06/01 or later.
+ %
+ % This program consists of the files pig.dtx and pig.ins
+
+Given such a notice and statement in a file, the conditions given in
+this license document would apply, with `The Program` referring to the
+two files `pig.dtx` and `pig.ins`, and `The Copyright Holder` referring
+to the person `M. Y. Name`.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes The Program
+
+ The LPPL requires that distributions of The Program contain all the
+ files of The Program. It is therefore important that you provide a
+ way for the licensee to determine which files constitute The Program.
+ This could, for example, be achieved by explicitly listing all the
+ files of The Program near the copyright notice of each file or by
+ using a line like
+
+ % This program consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise The Program.
+
+ Noting Exceptional Files
+
+ If The Program contains any files bearing additional conditions on
+ modification, or on distribution of modified versions, of those
+ files (other than those listed in `Additional Conditions on LaTeX
+ Software Files`), then it is recommended that The Program contain a
+ prominent file that defines the exceptional conditions, and either
+ lists the exceptional files or defines one or more categories of
+ exceptional files.
+
+ Files containing the text of a license (such as this file) are
+ often examples of files bearing more restrictive conditions on
+ modification. LaTeX configuration files (with filename extension
+ `.cfg`) are examples of files bearing less restrictive conditions
+ on the distribution of a modified version of the file. The
+ additional conditions on LaTeX software given above are examples
+ of declaring a category of files bearing exceptional additional
+ conditions.
+
diff --git a/poky/meta/files/common-licenses/LPPL-1.2 b/poky/meta/files/common-licenses/LPPL-1.2
new file mode 100644
index 000000000..c391a47ef
--- /dev/null
+++ b/poky/meta/files/common-licenses/LPPL-1.2
@@ -0,0 +1,320 @@
+
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.2 1999-09-03
+
+Copyright 1999 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed.
+
+You may use this license for any program that you have written and wish
+to distribute. This license may be particularly suitable if your
+program is TeX-related (such as a LaTeX package), but you may use it
+even if your program is unrelated to TeX. The section `WHETHER AND HOW
+TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE`, below, gives instructions,
+examples, and recommendations for authors who are considering
+distributing their programs under this license.
+
+In this license document, `The Program` refers to any program
+distributed under this license.
+
+This license gives conditions under which The Program may be distributed
+and conditions under which modified versions of The Program may be
+distributed. Individual files of The Program may bear supplementary
+and/or superseding conditions on modification of themselves and on the
+distribution of modified versions of themselves, but *no* file of The
+Program may bear supplementary or superseding conditions on the
+distribution of an unmodified copy of the file. A distributor wishing
+to distribute a complete, unmodified copy of The Program therefore
+needs to check the conditions only in this license and nowhere else.
+
+Activities other than distribution and/or modification of The Program
+are not covered by this license; they are outside its scope. In
+particular, the act of running The Program is not restricted.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of The Program
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+The Program. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex`
+in the base LaTeX distribution for suggestions.
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+You may distribute a complete, unmodified copy of The Program.
+Distribution of only part of The Program is not allowed.
+
+You may not modify in any way a file of The Program that bears a legal
+notice forbidding modification of that file.
+
+You may distribute a modified file of The Program if, and only if, the
+following eight conditions are met:
+
+ 1. You must meet any additional conditions borne by the file on the
+ distribution of a modified version of the file as described below
+ in the subsection `Additional Conditions on Individual Files of
+ The Program`.
+
+ 2. If the file is a LaTeX software file, then you must meet any
+ applicable additional conditions on the distribution of a modified
+ version of the file that are described below in the subsection
+ `Additional Conditions on LaTeX Software Files`.
+
+ 3. You must not distribute the modified file with the filename of the
+ original file.
+
+ 4. In the modified file, you must acknowledge the authorship and
+ name of the original file, and the name (if any) of the program
+ which contains it.
+
+ 5. You must change any identification string in the file to indicate
+ clearly that the modified file is not part of The Program.
+
+ 6. You must change any addresses in the modified file for the
+ reporting of errors in the file or in The Program generally to
+ ensure that reports for files no longer maintained by the original
+ maintainers will be directed to the maintainers of the modified
+ files.
+
+ 7. You must distribute the modified file under a license that forbids
+ distribution both of the modified file and of any files derived
+ from the modified file with the filename of the original file.
+
+ 8. You must do either (A) or (B):
+
+ (A) distribute a copy of The Program (that is, a complete,
+ unmodified copy of The Program) together with the modified
+ file; if your distribution of the modified file is made by
+ offering access to copy the modified file from a designated
+ place, then offering equivalent access to copy The Program
+ from the same place meets this condition, even though third
+ parties are not compelled to copy The Program along with the
+ modified file;
+
+ (B) provide to those who receive the modified file information
+ that is sufficient for them to obtain a copy of The Program;
+ for example, you may provide a Uniform Resource Locator (URL)
+ for a site that you expect will provide them with a copy of
+ The Program free of charge (either the version from which
+ your modification is derived, or perhaps a later version).
+
+Note that in the above, `distribution` of a file means making the
+file available to others by any means. This includes, for instance,
+installing the file on any machine in such a way that the file is
+accessible by users other than yourself. `Modification` of a file
+means any procedure that produces a derivative file under any
+applicable law -- that is, a file containing the original file or
+a significant portion of it, either verbatim or with modifications
+and/or translated into another language.
+
+Changing the name of a file (other than as necessitated by the file
+conventions of the target file systems) is considered to be a
+modification of the file.
+
+The distribution conditions in this license do not have to be
+applied to files that have been modified in accordance with the
+above conditions. Note, however, that Condition 7. does apply to
+any such modified file.
+
+The conditions above are not intended to prohibit, and hence do not
+apply to, the updating, by any method, of a file so that it becomes
+identical to the latest version of that file of The Program.
+
+
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a file of The Program, even for your own
+personal use, without also meeting the above eight conditions for
+distributing the modified file. While you might intend that such
+modified files will never be distributed, often this will happen by
+accident -- you may forget that you have modified the file; or it may
+not occur to you when allowing others to access the modified file
+that you are thus distributing it and violating the conditions of
+this license. It is usually in your best interest to keep your copy
+of The Program identical with the public one. Many programs provide
+ways to control the behavior of that program without altering its
+licensed files.
+
+
+Additional Conditions on Individual Files of The Program
+--------------------------------------------------------
+
+An individual file of The Program may bear additional conditions that
+supplement and/or supersede the conditions in this license if, and only
+if, such additional conditions exclusively concern modification of the
+file or distribution of a modified version of the file. The conditions
+on individual files of The Program therefore may differ only with
+respect to the kind and extent of modification of those files that
+is allowed, and with respect to the distribution of modified versions
+of those files.
+
+
+Additional Conditions on LaTeX Software Files
+---------------------------------------------
+
+If a file of The Program is intended to be used with LaTeX (that is,
+if it is a LaTeX software file), then the following additional
+conditions, which supplement and/or supersede the conditions
+above, apply to the file according to its filename extension:
+
+ - You may not modify any file with filename extension `.ins` since
+ these are installation files containing the legal notices that are
+ placed in the files they generate.
+
+ - You may distribute modified versions of files with filename
+ extension `.fd` (LaTeX font definition files) under the standard
+ conditions of the LPPL as described above. You may also distribute
+ such modified LaTeX font definition files with their original names
+ provided that:
+ (1) the only changes to the original files either enable use of
+ available fonts or prevent attempts to access unavailable fonts;
+ (2) you also distribute the original, unmodified files (TeX input
+ paths can be used to control which set of LaTeX font definition
+ files is actually used by TeX).
+
+ - You may distribute modified versions of files with filename
+ extension `.cfg` (configuration files) with their original names.
+ The Program may (and usually will) specify the range of commands
+ that are allowed in a particular configuration file.
+
+Because of portability and exchangeability issues in LaTeX software,
+The LaTeX3 Project deprecates the distribution of modified versions of
+components of LaTeX or of generally available contributed code for them,
+but such distribution can meet the conditions of this license.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for The Program. Except when otherwise stated in
+writing, The Copyright Holder provides The Program `as is`, without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for
+a particular purpose. The entire risk as to the quality and performance
+of The Program is with you. Should The Program prove defective, you
+assume the cost of all necessary servicing, repair, or correction.
+
+In no event unless agreed to in writing will The Copyright Holder, or
+any author named in the files of The Program, or any other party who may
+distribute and/or modify The Program as permitted above, be liable to
+you for damages, including any general, special, incidental or
+consequential damages arising out of any use of The Program or out of
+inability to use The Program (including, but not limited to, loss of
+data, data being rendered inaccurate, or losses sustained by anyone as
+a result of any failure of The Program to operate with any other
+programs), even if The Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+WHETHER AND HOW TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE
+=========================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+programs under this license. These authors are addressed as `you` in
+this section.
+
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your program you want or need to use *distribution*
+conditions that differ from those in this license, then do not refer to
+this license anywhere in your program but instead distribute your
+program under a different license. You may use the text of this license
+as a model for your own license, but your license should not refer to
+the LPPL or otherwise give the impression that your program is
+distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your program is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their programs under any
+license are encouraged to read it.
+
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the files of your program both
+an explicit copyright notice including your name and the year and also
+a statement that the distribution and/or modification of the file is
+constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2001 M. Y. Name
+ %
+ % This program may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.2
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.2 or later is part of all distributions of LaTeX
+ % version 1999/12/01 or later.
+ %
+ % This program consists of the files pig.dtx and pig.ins
+
+Given such a notice and statement in a file, the conditions given in
+this license document would apply, with `The Program` referring to the
+two files `pig.dtx` and `pig.ins`, and `The Copyright Holder` referring
+to the person `M. Y. Name`.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes The Program
+
+ The LPPL requires that distributions of The Program contain all the
+ files of The Program. It is therefore important that you provide a
+ way for the licensee to determine which files constitute The Program.
+ This could, for example, be achieved by explicitly listing all the
+ files of The Program near the copyright notice of each file or by
+ using a line like
+
+ % This program consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise The Program.
+
+ Noting Exceptional Files
+
+ If The Program contains any files bearing additional conditions on
+ modification, or on distribution of modified versions, of those
+ files (other than those listed in `Additional Conditions on LaTeX
+ Software Files`), then it is recommended that The Program contain a
+ prominent file that defines the exceptional conditions, and either
+ lists the exceptional files or defines one or more categories of
+ exceptional files.
+
+ Files containing the text of a license (such as this file) are
+ often examples of files bearing more restrictive conditions on
+ modification. LaTeX configuration files (with filename extension
+ `.cfg`) are examples of files bearing less restrictive conditions
+ on the distribution of a modified version of the file. The
+ additional conditions on LaTeX software given above are examples
+ of declaring a category of files bearing exceptional additional
+ conditions.
+
+
+
+
diff --git a/poky/meta/files/common-licenses/LPPL-1.3c b/poky/meta/files/common-licenses/LPPL-1.3c
new file mode 100644
index 000000000..755e3bb12
--- /dev/null
+++ b/poky/meta/files/common-licenses/LPPL-1.3c
@@ -0,0 +1,418 @@
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE`,
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex`
+and `modguide.tex` in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work`
+ Any work being distributed under this License.
+
+ `Derived Work`
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification`
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify`
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution`
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun`s Network File System (NFS).
+
+ `Compiled Work`
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer`
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder` under
+ any applicable law.
+
+ `Base Interpreter`
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format` or in the case of files belonging to the
+ `LaTeX-format` a program implementing the `TeX language`.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is`, without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained` if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained`.
+
+The Work has the status `maintained` if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained` to `unmaintained` if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement` as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you` in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.3
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained`.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work` referring
+to the three files `pig.dtx`, `pig.ins`, and `pig.sty` (the last being
+generated from `pig.dtx` using `pig.ins`), the `Base Interpreter`
+referring to any `LaTeX-Format`, and both `Copyright Holder` and
+`Current Maintainer` referring to the person `M. Y. Name`.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained` above into `author-maintained`.
+However, we recommend that you use `maintained`, as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
+
diff --git a/poky/meta/files/common-licenses/Libpng b/poky/meta/files/common-licenses/Libpng
new file mode 100644
index 000000000..a9d5b031b
--- /dev/null
+++ b/poky/meta/files/common-licenses/Libpng
@@ -0,0 +1,112 @@
+
+This copy of the libpng notices is provided for your convenience. In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.4.5, December 9, 2010, are
+Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+ Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+ There is no warranty against interference with your enjoyment of the
+ library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is with
+ the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose. The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products. If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+ printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+December 9, 2010
+
diff --git a/poky/meta/files/common-licenses/MIT b/poky/meta/files/common-licenses/MIT
new file mode 100644
index 000000000..33f8bef43
--- /dev/null
+++ b/poky/meta/files/common-licenses/MIT
@@ -0,0 +1,23 @@
+
+MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/MPL-1.0 b/poky/meta/files/common-licenses/MPL-1.0
new file mode 100644
index 000000000..83dc3f624
--- /dev/null
+++ b/poky/meta/files/common-licenses/MPL-1.0
@@ -0,0 +1,109 @@
+
+MOZILLA PUBLIC LICENSE
+Version 1.0
+
+1. Definitions.
+
+1.1. ``Contributor`` means each entity that creates or contributes to the creation of Modifications.
+1.2. ``Contributor Version`` means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.9. ``Modifications`` means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous Modifications.
+
+1.10. ``Original Code`` means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or a list of source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. ``You`` means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, ``You`` includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, ``control`` means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell (``Utilize``) the Original Code (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Original Code (or portions thereof) and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to Utilize the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Contributor Version (or portions thereof), and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+3. Distribution Obligations.
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled ``LEGAL`` which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Covered Code. If You created one or more Modification(s), You may add your name as a Contributor to the notice described in Exhibit A. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A, and to related Covered Code.
+6. Versions of the License.
+6.1. New Versions.
+Netscape Communications Corporation (``Netscape``) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works.
+If you create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), you must (a) rename Your license so that the phrases ``Mozilla``, ``MOZILLAPL``, ``MOZPL``, ``Netscape``, ``NPL`` or any confusingly similar phrase do not appear anywhere in your license and (b) otherwise make it clear that your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS`` BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8. TERMINATION.
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ``commercial item,`` as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software`` and ``commercial computer software documentation,`` as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in, the United States of America: (a) unless otherwise agreed in writing, all disputes relating to this License (excepting any dispute relating to intellectual property rights) shall be subject to final and binding arbitration, with the losing party paying all costs of arbitration; (b) any arbitration relating to this Agreement shall be held in Santa Clara County, California, under the auspices of JAMS/EndDispute; and (c) any litigation relating to this Agreement shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+12. RESPONSIBILITY FOR CLAIMS.
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Covered Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+EXHIBIT A.
+``The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.``
+
diff --git a/poky/meta/files/common-licenses/MPL-1.1 b/poky/meta/files/common-licenses/MPL-1.1
new file mode 100644
index 000000000..6aa8c4edc
--- /dev/null
+++ b/poky/meta/files/common-licenses/MPL-1.1
@@ -0,0 +1,185 @@
+
+Mozilla Public License Version 1.1
+
+1. Definitions.
+
+1.0.1. "Commercial Use"
+means distribution or otherwise making the Covered Code available to a third party.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+Any new file that contains any part of the Original Code or previous Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+the licenses granted in this Section 2.1 (a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+Notwithstanding Section 2.1 (b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+the licenses granted in Sections 2.2 (a) and 2.2 (b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+Notwithstanding Section 2.2 (b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+3. Distribution Obligations.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims
+
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs
+
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section 3.4 (a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of Sections 3.1, 3.2, 3.3, 3.4 and 3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions
+
+Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions
+
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works
+
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. Termination
+
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+such Participant`s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+any software, hardware, or device, other than such Participant`s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. government end users
+
+The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. Miscellaneous
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys` fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. Responsibility for claims
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. Multiple-licensed code
+
+Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+
+Exhibit A - Mozilla Public License.
+
+"The contents of this file are subject to the Mozilla Public License
+Version 1.1 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at
+http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations
+under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________.
+Portions created by ______________________ are Copyright (C) ______
+_______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+of the _____ license (the "[___] License"), in which case the
+provisions of [______] License are applicable instead of those
+above. If you wish to allow use of your version of this file only
+under the terms of the [____] License and not to allow others to use
+your version of this file under the MPL, indicate your decision by
+deleting the provisions above and replace them with the notice and
+other provisions required by the [___] License. If you do not delete
+the provisions above, a recipient may use your version of this file
+under either the MPL or the [___] License."
+NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.
+
diff --git a/poky/meta/files/common-licenses/MPL-2.0 b/poky/meta/files/common-licenses/MPL-2.0
new file mode 100644
index 000000000..14e2f777f
--- /dev/null
+++ b/poky/meta/files/common-licenses/MPL-2.0
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/poky/meta/files/common-licenses/MS-PL b/poky/meta/files/common-licenses/MS-PL
new file mode 100644
index 000000000..e90d6b4fd
--- /dev/null
+++ b/poky/meta/files/common-licenses/MS-PL
@@ -0,0 +1,19 @@
+
+Microsoft Public License (Ms-PL)
+
+
+This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
+
+
+Definitions
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. A "contribution" is the original software, or any additions or changes to the software. A "contributor" is any person that distributes its contribution under this license. "Licensed patents" are a contributor`s patent claims that read directly on its contribution.
+Grant of Rights
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+Conditions and Limitations
+(A) No Trademark License- This license does not grant you rights to use any contributors` name, logo, or trademarks.
+(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
+(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
+(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
+(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
+
diff --git a/poky/meta/files/common-licenses/MS-RL b/poky/meta/files/common-licenses/MS-RL
new file mode 100644
index 000000000..f703c0d3d
--- /dev/null
+++ b/poky/meta/files/common-licenses/MS-RL
@@ -0,0 +1,23 @@
+
+Microsoft Reciprocal License (Ms-RL)
+
+
+This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
+
+
+Definitions
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
+A "contribution" is the original software, or any additions or changes to the software.
+A "contributor" is any person that distributes its contribution under this license.
+"Licensed patents" are a contributor`s patent claims that read directly on its contribution.
+Grant of Rights
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+Conditions and Limitations
+(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
+(B) No Trademark License- This license does not grant you rights to use any contributors` name, logo, or trademarks.
+(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
+(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
+(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
+(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
+
diff --git a/poky/meta/files/common-licenses/MirOS b/poky/meta/files/common-licenses/MirOS
new file mode 100644
index 000000000..146768e28
--- /dev/null
+++ b/poky/meta/files/common-licenses/MirOS
@@ -0,0 +1,58 @@
+
+MirOS License
+
+/*-
+* Copyright &#169; year, year, year, &#8230;
+* First M. Last <user@host.domain>
+*
+* Provided that these terms and disclaimer and all copyright notices
+* are retained or reproduced in an accompanying document, permission
+* is granted to deal in this work without restriction, including un&#8208;
+* limited rights to use, publicly perform, distribute, sell, modify,
+* merge, give away, or sublicence.
+*
+* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+* the utmost extent permitted by applicable law, neither express nor
+* implied; without malicious intent or gross negligence. In no event
+* may a licensor, author or contributor be held liable for indirect,
+* direct, other damage, loss, or other issues arising in any way out
+* of dealing in the work, even if advised of the possibility of such
+* damage or existence of a defect, except proven that it results out
+* of said person`s immediate fault when using the work as intended.
+*/
+
+I_N_S_T_R_U_C_T_I_O_N_S_:_
+To apply the template(&#185;) specify the years of copyright (separated by
+comma, not as a range), the legal names of the copyright holders, and
+the real names of the authors if different. Avoid adding text.
+
+R_A_T_I_O_N_A_L_E_:_
+This licence is apt for any kind of work (such as source code, fonts,
+documentation, graphics, sound etc.) and the preferred terms for work
+added to MirBSD. It has been drafted as universally usable equivalent
+of the "historic permission notice"&#8317;&#178;&#8318; adapted to Europen law because
+in some (droit d`auteur) countries authors cannot disclaim all liabi&#8208;
+lities. Compliance to DFSG&#8317;&#179;&#8318; 1.1 is ensured, and GPLv2 compatibility
+is asserted unless advertising clauses are used. The MirOS Licence is
+certified to conform to OKD&#8317;&#8308;&#8318; 1.0 and OSD&#8317;&#8309;&#8318; 1.9, and qualifies as a
+Free Software&#8317;&#8310;&#8318; and also Free Documentation&#8317;&#8311;&#8318; licence and is inclu&#8208;
+ded in some relevant lists&#8317;&#8312;&#8318;&#8317;&#8313;&#8318;&#8317;&#185;&#8304;&#8318;.
+
+We believe you are not liable for work inserted which is intellectual
+property of third parties, if you were not aware of the fact, act ap&#8208;
+propriately as soon as you become aware of that problem, seek an ami&#8208;
+cable solution for all parties, and never knowingly distribute a work
+without being authorised to do so by its licensors.
+
+R_E_F_E_R_E_N_C_E_S_:_
+&#9312; also at http://mirbsd.de/MirOS-Licence
+&#9313; http://www.opensource.org/licenses/historical.php
+&#9314; http://www.debian.org/social_contract#guidelines
+&#9315; http://www.opendefinition.org/1.0
+&#9316; http://www.opensource.org/docs/osd
+&#9317; http://www.gnu.org/philosophy/free-sw.html
+&#9318; http://www.gnu.org/philosophy/free-doc.html
+&#9319; http://www.ifross.de/ifross_html/lizenzcenter.html
+&#9320; http://www.opendefinition.org/licenses
+&#9321; http://opensource.org/licenses/miros.html
+
diff --git a/poky/meta/files/common-licenses/Motosoto b/poky/meta/files/common-licenses/Motosoto
new file mode 100644
index 000000000..7a524f62b
--- /dev/null
+++ b/poky/meta/files/common-licenses/Motosoto
@@ -0,0 +1,422 @@
+
+MOTOSOTO OPEN SOURCE LICENSE - Version 0.9.1
+This Motosoto Open Source License (the "License") applies to "Community
+Portal Server" and related software products as well as any updatesor
+maintenance releases of that software ("Motosoto Products") that are
+distributed by Motosoto.Com B.V. ("Licensor"). Any Motosoto
+Product licensed pursuant to this License is a "Licensed Product." Licensed
+Product, in its entirety, is protected by Dutch copyright law.
+This
+License identifies the terms under which you may use, copy, distribute or modify
+Licensed Product and has been submitted to the Open Software Initiative (OSI)
+for approval.
+
+Preamble
+
+This Preamble is intended to describe, in plain English, the nature and scope of
+this License. However, this Preamble is not a part of this license. The legal
+effect of this License is dependent only upon the terms of the License and not
+this Preamble.
+This License complies with the Open Source Definition and has been approved by
+Open Source Initiative. Software distributed under this License may be marked
+as "OSI Certified Open Source Software."
+
+This License provides that:
+
+1. You may use, sell or give away the Licensed Product, alone or as a
+component of an aggregate software distribution containing
+programs from several different sources. No royalty or other fee is
+required.
+
+2. Both Source Code and executable versions of the Licensed Product,
+including Modifications made by previous Contributors, are
+available for your use. (The terms "Licensed Product," "Modifications,"
+"Contributors" and "Source Code" are defined in the License.)
+
+3. You are allowed to make Modifications to the Licensed Product, and you
+can create Derivative Works from it. (The term "Derivative
+Works" is defined in the License.)
+
+4. By accepting the Licensed Product under the provisions of this License,
+you agree that any Modifications you make to the Licensed
+Product and then distribute are governed by the provisions of this
+License. In particular, you must make the Source Code of your
+Modifications available to others.
+
+5. You may use the Licensed Product for any purpose, but the Licensor is
+not providing you any warranty whatsoever, nor is the Licensor
+accepting any liability in the event that the Licensed Product doesn`t
+work properly or causes you any injury or damages.
+
+6. If you sublicense the Licensed Product or Derivative Works, you may
+charge fees for warranty or support, or for accepting indemnity
+or liability obligations to your customers. You cannot charge for the
+Source Code.
+
+7. If you assert any patent claims against the Licensor relating to the
+Licensed Product, or if you breach any terms of the License, your
+rights to the Licensed Product under this License automatically
+terminate.
+
+You may use this License to distribute your own Derivative Works, in which
+case the provisions of this License will apply to your Derivative
+Works just as they do to the original Licensed Product.
+
+Alternatively, you may distribute your Derivative Works under any other
+OSI-approved Open Source license, or under a proprietary license of
+your choice. If you use any license other than this License, however, you must
+continue to fulfill the requirements of this License (including the
+provisions relating to publishing the Source Code) for those portions of your
+Derivative Works that consist of the Licensed Product, including
+the files containing Modifications.
+
+New versions of this License may be published from time to time. You may
+choose to continue to use the license terms in this version of the
+License or those from the new version. However, only the Licensor has the right
+to change the License terms as they apply to the Licensed
+Product.
+This License relies on precise definitions for certain terms. Those terms are
+defined when they are first used, and the definitions are repeated for
+your convenience in a Glossary at the end of the License.
+
+License Terms
+
+1. Grant of License From Licensor.
+
+Licensor
+hereby grants you a world-wide, royalty-free, non-exclusive license, subject to
+third
+party intellectual property claims, to do the following:
+
+a. Use, reproduce, modify, display, perform, sublicense and
+distribute Licensed Product or portions thereof (including
+Modifications as hereinafter defined), in both Source Code or as
+an executable program. "Source Code" means the preferred
+form for making modifications to the Licensed Product, including
+all modules contained therein, plus any associated
+interface definition files, scripts used to control compilation
+and installation of an executable program, or a list of
+differential comparisons against the Source Code of the Licensed
+Product.
+
+b. Create Derivative Works (as that term is defined under Dutch
+copyright law) of Licensed Product by adding to or deleting
+from the substance or structure of said Licensed Product.
+
+c. Under claims of patents now or hereafter owned or controlled
+by Licensor, to make, use, sell, offer for sale, have made,
+and/or otherwise dispose of Licensed Product or portions thereof,
+but solely to the extent that any such claim is necessary to
+enable you to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of Licensed Product or portions thereof or
+Derivative Works thereof.
+
+2. Grant of License to Modifications From
+Contributor.
+
+"Modifications" means any additions to or
+deletions from the substance or
+structure of (i) a file containing Licensed Product, or (ii) any new file
+that contains any part of Licensed Product. Hereinafter in this
+License, the term "Licensed Product" shall include all previous
+Modifications that you receive from any Contributor. By
+application of the provisions in Section 4(a) below, each person or
+entity who created or contributed to the creation of, and distributed,
+a Modification (a "Contributor") hereby grants you a world-wide,
+royalty-free, non-exclusive license, subject to third party
+intellectual property claims, to do the following:
+
+a. Use, reproduce, modify, display, perform, sublicense and
+distribute any Modifications created by such Contributor or
+portions thereof, in both Source Code or as an executable program,
+either on an unmodified basis or as part of Derivative
+Works.
+
+b. Under claims of patents now or hereafter owned or controlled by
+Contributor, to make, use, sell, offer for sale, have made,
+and/or otherwise dispose of Modifications or portions thereof, but
+solely to the extent that any such claim is necessary to
+enable you to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of Modifications or portions thereof or
+Derivative Works thereof.
+
+3. Exclusions From License Grant.
+
+Nothing in
+this License shall be deemed to grant any rights to trademarks, copyrights,
+patents,
+trade secrets or any other intellectual property of Licensor or any
+Contributor except as expressly stated herein. No patent license is
+granted separate from the Licensed Product, for code that you delete from
+the Licensed Product, or for combinations of the Licensed
+Product with other software or hardware. No right is granted to the
+trademarks of Licensor or any Contributor even if such marks are
+included in the Licensed Product. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under different
+terms from this License any code that Licensor otherwise would have a
+right to license.
+
+4. Your Obligations Regarding Distribution.
+
+a. Application of This License to Your
+Modifications. As an express condition for your use of the Licensed
+Product, you
+hereby agree that any Modifications that you create or to which
+you contribute, and which you distribute, are governed by the
+terms of this License including, without limitation, Section 2.
+Any Modifications that you create or to which you contribute
+may be distributed only under the terms of this License or a
+future version of this License released under Section 7. You must
+include a copy of this License with every copy of the
+Modifications you distribute. You agree not to offer or impose any
+terms on any Source Code or executable version of the Licensed
+Product or Modifications that alter or restrict the applicable
+version of this License or the recipients` rights hereunder.
+However, you may include an additional document offering the
+additional rights described in Section 4(e).
+
+b. Availability of Source Code. You must make
+available, under the terms of this License, the Source Code of the Licensed
+Product and any Modifications that you distribute, either on the
+same media as you distribute any executable or other form
+of the Licensed Product, or via a mechanism generally accepted in
+the software development community for the electronic
+transfer of data (an "Electronic Distribution Mechanism"). The
+Source Code for any version of Licensed Product or
+Modifications that you distribute must remain available for at
+least twelve (12) months after the date it initially became
+available, or at least six (6) months after a subsequent version
+of said Licensed Product or Modifications has been made
+available. You are responsible for ensuring that the Source Code
+version remains available even if the Electronic Distribution
+Mechanism is maintained by a third party.
+
+c. Description of Modifications. You must cause any
+Modifications that you create or to which you contribute, and which
+you distribute, to contain a file documenting the additions,
+changes or deletions you made to create or contribute to those
+Modifications, and the dates of any such additions, changes or
+deletions. You must include a prominent statement that the
+Modifications are derived, directly or indirectly, from the
+Licensed Product and include the names of the Licensor and any
+Contributor to the Licensed Product in (i) the Source Code and
+(ii) in any notice displayed by a version of the Licensed
+Product you distribute or in related documentation in which you
+describe the origin or ownership of the Licensed Product.
+You may not modify or delete any preexisting copyright notices in
+the Licensed Product.
+
+d. Intellectual Property Matters.
+
+i. Third Party Claims. If you have
+knowledge that a license to a third party`s intellectual property right is
+required
+to exercise the rights granted by this License, you must
+include a text file with the Source Code distribution titled
+"LEGAL" that describes the claim and the party making the
+claim in sufficient detail that a recipient will know
+whom to contact. If you obtain such knowledge after you make
+any Modifications available as described in Section
+4(b), you shall promptly modify the LEGAL file in all copies
+you make available thereafter and shall take other
+steps (such as notifying appropriate mailing lists or
+newsgroups) reasonably calculated to inform those who
+received the Licensed Product from you that new knowledge
+has been obtained.
+
+ii. Contributor APIs. If your
+Modifications include an application programming interface ("API") and you have
+knowledge of patent licenses that are reasonably necessary
+to implement that API, you must also include this
+information in the LEGAL file.
+
+iii. Representations. You represent that,
+except as disclosed pursuant to 4(d)(i) above, you believe that any
+Modifications you distribute are your original creations and
+that you have sufficient rights to grant the rights
+conveyed by this License.
+
+e. Required Notices. You must duplicate this
+License in any documentation you provide along with the Source Code of any
+Modifications you create or to which you contribute, and which you
+distribute, wherever you describe recipients` rights
+relating to Licensed Product. You must duplicate the notice
+contained in Exhibit A (the "Notice") in each file of the Source
+Code of any copy you distribute of the Licensed Product. If you
+created a Modification, you may add your name as a
+Contributor to the Notice. If it is not possible to put the Notice
+in a particular Source Code file due to its structure, then
+you must include such Notice in a location (such as a relevant
+directory file) where a user would be likely to look for such a
+notice. You may choose to offer, and charge a fee for, warranty,
+support, indemnity or liability obligations to one or more
+recipients of Licensed Product. However, you may do so only on
+your own behalf, and not on behalf of the Licensor or any
+Contributor. You must make it clear that any such warranty,
+support, indemnity or liability obligation is offered by you
+alone, and you hereby agree to indemnify the Licensor and every
+Contributor for any liability incurred by the Licensor or such
+Contributor as a result of warranty, support, indemnity or
+liability terms you offer.
+
+f. Distribution of Executable Versions. You may
+distribute Licensed Product as an executable program under a license of
+your choice that may contain terms different from this License
+provided (i) you have satisfied the requirements of Sections
+4(a) through 4(e) for that distribution, (ii) you include a
+conspicuous notice in the executable version, related documentation
+and collateral materials stating that the Source Code version of
+the Licensed Product is available under the terms of this
+License, including a description of how and where you have
+fulfilled the obligations of Section 4(b), (iii) you retain all
+existing copyright notices in the Licensed Product, and (iv) you
+make it clear that any terms that differ from this License are
+offered by you alone, not by Licensor or any Contributor. You
+hereby agree to indemnify the Licensor and every Contributor
+for any liability incurred by Licensor or such Contributor as a
+result of any terms you offer.
+
+g. Distribution of Derivative Works. You may
+create Derivative Works (e.g., combinations of some or all of the Licensed
+Product with other code) and distribute the Derivative Works as
+products under any other license you select, with the
+proviso that the requirements of this License are fulfilled for
+those portions of the Derivative Works that consist of the
+Licensed Product or any Modifications thereto.
+
+5. Inability to Comply Due to Statute or
+Regulation.
+
+If it is impossible for you to comply with any of
+the terms of this License with
+respect to some or all of the Licensed Product due to statute, judicial
+order, or regulation, then you must (i) comply with the terms of
+this License to the maximum extent possible, (ii) cite the statute or
+regulation that prohibits you from adhering to the License, and
+(iii) describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 4(d),
+and must be included with all distributions of the Source Code. Except to
+the extent prohibited by statute or regulation, such
+description must be sufficiently detailed for a recipient of ordinary
+skill at computer programming to be able to understand it.
+
+6. Application of This License.
+
+This License
+applies to code to which Licensor or Contributor has attached the Notice in
+Exhibit A,
+which is incorporated herein by this reference.
+
+7. Versions of This License.
+
+a. Version. The Motosoto Open Source License is
+derived from the Jabber Open Source License. All changes are related to
+applicable law and the location of court.
+
+b. New Versions. Licensor may publish from time to
+time revised and/or new versions of the License.
+
+c. Effect of New Versions. Once Licensed Product
+has been published under a particular version of the License, you may always
+continue to use it under the terms of that version. You may also
+choose to use such Licensed Product under the terms of any
+subsequent version of the License published by Licensor. No one
+other than Lic ensor has the right to modify the terms
+applicable to Licensed Product created under this License.
+
+d. Derivative Works of this License. If you
+create or use a modified version of this License, which you may do only in
+order to
+apply it to software that is not already a Licensed Product under
+this License, you must rename your license so that it is not
+confusingly similar to this License, and must make it clear that
+your license contains terms that differ from this License. In
+so naming your license, you may not use any trademark of Licensor
+or any Contributor.
+
+8. Disclaimer of Warranty.
+
+LICENSED PRODUCT IS
+PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES
+THAT THE LICENSED PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+PARTICULAR PURPOSE OR
+NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LICENSED PRODUCT IS
+WITH YOU. SHOULD LICENSED PRODUCT PROVE DEFECTIVE IN ANY RESPECT, YOU
+(AND NOT THE LICENSOR OR
+ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR
+OR CORRECTION. THIS
+DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO
+USE OF LICENSED
+PRODUCT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+9. Termination.
+
+a. Automatic Termination Upon Breach. This
+license and the rights granted hereunder will terminate automatically if you
+fail to comply with the terms herein and fail to cure such breach
+within thirty (30) days of becoming aware of the breach.
+All sublicenses to the Licensed Product that are properly granted
+shall survive any termination of this license. Provisions
+that, by their nature, must remain in effect beyond the
+termination of this License, shall survive.
+
+b. Termination Upon Assertion of Patent
+Infringement. If you initiate litigation by asserting a patent
+infringement claim
+(excluding declaratory judgment actions) against Licensor or a
+Contributor (Licensor or Contributor against whom you file
+such an action is referred to herein as "Respondent") alleging
+that Licensed Product directly or indirectly infringes any
+patent, then any and all rights granted by such Respondent to you
+under Sections 1 or 2 of this License shall terminate
+prospectively upon sixty (60) days notice from Respondent (the
+"Notice Period") unless within that Notice Period you
+either agree in writing (i) to pay Respondent a mutually agreeable
+reasonably royalty for your past or future use of Licensed
+Product made by such Respondent, or (ii) withdraw your litigation
+claim with respect to Licensed Product against such
+Respondent. If within said Notice Period a reasonable royalty and
+payment arrangement are not mutually agreed upon in
+writing by the parties or the litigation claim is not withdrawn,
+the rights granted by Licensor to you under Sections 1 and 2
+automatically terminate at the expiration of said Notice
+Period.
+
+c. Reasonable Value of This License. If you assert a
+patent infringement claim against Respondent alleging that Licensed
+Product directly or indirectly infringes any patent where such
+claim is resolved (such as by license or settlement) prior to
+the initiation of patent infringement litigation, then the
+reasonable value of the licenses granted by said Respondent under
+Sections 1 and 2 shall be taken into account in determining the
+amount or value of any payment or license.
+
+d. No Retroactive Effect of Termination. In the
+event of termination under Sections 9(a) or 9(b) above, all end user license
+agreements (excluding licenses to distributors and reselle rs)
+that have been validly granted by you or any distributor
+hereunder prior to termination shall survive
+termination.
+
+10. Limitation of Liability.
+
+UNDER NO
+CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE LICENSOR, ANY
+CONTRIBUTOR, OR ANY
+DISTRIBUTOR OF LICENSED PRODUCT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES,
+BE LIABLE TO ANY PERSON
+FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+FAILURE OR
+MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
+SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT
+APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+PARTY
+
diff --git a/poky/meta/files/common-licenses/Multics b/poky/meta/files/common-licenses/Multics
new file mode 100644
index 000000000..a487645d8
--- /dev/null
+++ b/poky/meta/files/common-licenses/Multics
@@ -0,0 +1,40 @@
+
+Multics License
+
+Historical Background
+
+This edition of the Multics software materials and documentation is
+provided and donated to Massachusetts Institute of Technology by Group
+BULL including BULL HN Information Systems Inc. as a contribution to
+computer science knowledge. This donation is made also to give evidence
+of the common contributions of Massachusetts Institute of Technology,
+Bell Laboratories, General Electric, Honeywell Information Systems
+Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems
+Inc. to the development of this operating system. Multics development
+was initiated by Massachusetts Institute of Technology Project MAC
+(1963-1970), renamed the MIT Laboratory for Computer Science and
+Artificial Intelligence in the mid 1970s, under the leadership of
+Professor Fernando Jose Corbato. Users consider that Multics provided the
+best software architecture for managing computer hardware properly and
+for executing programs. Many subsequent operating systems incorporated
+Multics principles. Multics was distributed in 1975 to 2000 by Group
+Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as
+successor in interest by change in name only to Honeywell Bull Inc. and
+Honeywell Information Systems Inc. .
+
+-----------------------------------------------------------
+
+Permission to use, copy, modify, and distribute these programs and their
+documentation for any purpose and without fee is hereby granted,provided
+that the below copyright notice and historical background appear in all
+copies and that both the copyright notice and historical background and
+this permission notice appear in supporting documentation, and that
+the names of MIT, HIS, BULL or BULL HN not be used in advertising or
+publicity pertaining to distribution of the programs without specific
+prior written permission.
+Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information
+Systems Inc.
+Copyright 2006 by BULL HN Information Systems Inc.
+Copyright 2006 by Bull SAS
+All Rights Reserved
+
diff --git a/poky/meta/files/common-licenses/NASA-1.3 b/poky/meta/files/common-licenses/NASA-1.3
new file mode 100644
index 000000000..123182d89
--- /dev/null
+++ b/poky/meta/files/common-licenses/NASA-1.3
@@ -0,0 +1,79 @@
+
+ASA OPEN SOURCE AGREEMENT VERSION 1.3
+
+THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT.
+
+Government Agency: _____ Government Agency Original Software Designation: __ Government Agency Original Software Title: _____ User Registration Requested. Please Visit http://___ Government Agency Point of Contact for Original Software: _____
+
+DEFINITIONS
+A. "Contributor" means Government Agency, as the developer of the Original Software, and any entity that makes a Modification. B. "Covered Patents" mean patent claims licensable by a Contributor that are necessarily infringed by the use or sale of its Modification alone or when combined with the Subject Software. C. "Display" means the showing of a copy of the Subject Software, either directly or by means of an image, or any other device. D. "Distribution" means conveyance or transfer of the Subject Software, regardless of means, to another. E. "Larger Work" means computer software that combines Subject Software, or portions thereof, with software separate from the Subject Software that is not governed by the terms of this Agreement. F. "Modification" means any alteration of, including addition to or deletion from, the substance or structure of either the Original Software or Subject Software, and includes derivative works, as that term is defined in the Copyright Statute, 17 USC 101. However, the act of including Subject Software as part of a Larger Work does not in and of itself constitute a Modification. G. "Original Software" means the computer software first released under this Agreement by Government Agency with Government Agency designation __ and entitled _________, including source code, object code and accompanying documentation, if any. H. "Recipient" means anyone who acquires the Subject Software under this Agreement, including all Contributors. I. "Redistribution" means Distribution of the Subject Software after a Modification has been made. J. "Reproduction" means the making of a counterpart, image or copy of the Subject Software. K. "Sale" means the exchange of the Subject Software for money or equivalent value. L. "Subject Software" means the Original Software, Modifications, or any respective parts thereof. M. "Use" means the application or employment of the Subject Software for any purpose.
+
+GRANT OF RIGHTS
+A. Under Non-Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
+
+Use
+Distribution
+Reproduction
+Modification
+Redistribution
+Display
+B. Under Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient under Covered Patents a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
+
+Use
+Distribution
+Reproduction
+Sale
+Offer for Sale
+C. The rights granted under Paragraph B. also apply to the combination of a Contributor`s Modification and the Subject Software if, at the time the Modification is added by the Contributor, the addition of such Modification causes the combination to be covered by the Covered Patents. It does not apply to any other combinations that include a Modification.
+
+D. The rights granted in Paragraphs A. and B. allow the Recipient to sublicense those same rights. Such sublicense must be under the same terms and conditions of this Agreement.
+
+OBLIGATIONS OF RECIPIENT
+A. Distribution or Redistribution of the Subject Software must be made under this Agreement except for additions covered under paragraph 3H.
+
+Whenever a Recipient distributes or redistributes the Subject Software, a copy of this Agreement must be included with each copy of the Subject Software; and
+If Recipient distributes or redistributes the Subject Software in any form other than source code, Recipient must also make the source code freely available, and must provide with each copy of the Subject Software information on how to obtain the source code in a reasonable manner on or through a medium customarily used for software exchange.
+B. Each Recipient must ensure that the following copyright notice appears prominently in the Subject Software:
+
+[Government Agency will insert the applicable copyright notice in each agreement accompanying the initial distribution of original software and remove this bracketed language.]
+
+[The following copyright notice will be used if created by a contractor pursuant to Government Agency contract and rights obtained from creator by assignment. Government Agency will insert the year and its Agency designation and remove the bracketed language.] Copyright &#65533; {YEAR} United States Government as represented by ___ ____. All Rights Reserved.
+
+[The following copyright notice will be used if created by civil servants only. Government Agency will insert the year and its Agency designation and remove the bracketed language.] Copyright &#65533; {YEAR} United States Government as represented by ____ ____. No copyright is claimed in the United States under Title 17, U.S.Code. All Other Rights Reserved.
+
+C. Each Contributor must characterize its alteration of the Subject Software as a Modification and must identify itself as the originator of its Modification in a manner that reasonably allows subsequent Recipients to identify the originator of the Modification. In fulfillment of these requirements, Contributor must include a file (e.g., a change log file) that describes the alterations made and the date of the alterations, identifies Contributor as originator of the alterations, and consents to characterization of the alterations as a Modification, for example, by including a statement that the Modification is derived, directly or indirectly, from Original Software provided by Government Agency. Once consent is granted, it may not thereafter be revoked.
+
+D. A Contributor may add its own copyright notice to the Subject Software. Once a copyright notice has been added to the Subject Software, a Recipient may not remove it without the express permission of the Contributor who added the notice.
+
+E. A Recipient may not make any representation in the Subject Software or in any promotional, advertising or other material that may be construed as an endorsement by Government Agency or by any prior Recipient of any product or service provided by Recipient, or that may seek to obtain commercial advantage by the fact of Government Agency`s or a prior Recipient`s participation in this Agreement.
+
+F. In an effort to track usage and maintain accurate records of the Subject Software, each Recipient, upon receipt of the Subject Software, is requested to register with Government Agency by visiting the following website: ______. Recipient`s name and personal information shall be used for statistical purposes only. Once a Recipient makes a Modification available, it is requested that the Recipient inform Government Agency at the web site provided above how to access the Modification.
+
+[Alternative paragraph for use when a web site for release and monitoring of subject software will not be supported by releasing Government Agency] In an effort to track usage and maintain accurate records of the Subject Software, each Recipient, upon receipt of the Subject Software, is requested to provide Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., the following information: ______. Recipient`s name and personal information shall be used for statistical purposes only. Once a Recipient makes a Modification available, it is requested that the Recipient inform Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., how to access the Modification.
+
+G. Each Contributor represents that that its Modification is believed to be Contributor`s original creation and does not violate any existing agreements, regulations, statutes or rules, and further that Contributor has sufficient rights to grant the rights conveyed by this Agreement.
+
+H. A Recipient may choose to offer, and to charge a fee for, warranty, support, indemnity and/or liability obligations to one or more other Recipients of the Subject Software. A Recipient may do so, however, only on its own behalf and not on behalf of Government Agency or any other Recipient. Such a Recipient must make it absolutely clear that any such warranty, support, indemnity and/or liability obligation is offered by that Recipient alone. Further, such Recipient agrees to indemnify Government Agency and every other Recipient for any liability incurred by them as a result of warranty, support, indemnity and/or liability offered by such Recipient.
+
+I. A Recipient may create a Larger Work by combining Subject Software with separate software not governed by the terms of this agreement and distribute the Larger Work as a single product. In such case, the Recipient must make sure Subject Software, or portions thereof, included in the Larger Work is subject to this Agreement.
+
+J. Notwithstanding any provisions contained herein, Recipient is hereby put on notice that export of any goods or technical data from the United States may require some form of export license from the U.S. Government. Failure to obtain necessary export licenses may result in criminal liability under U.S. laws. Government Agency neither represents that a license shall not be required nor that, if required, it shall be issued. Nothing granted herein provides any such export license.
+
+DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION
+A. No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS."
+
+B. Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT`S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT`S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT`S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
+
+GENERAL TERMS
+A. Termination: This Agreement and the rights granted hereunder will terminate automatically if a Recipient fails to comply with these terms and conditions, and fails to cure such noncompliance within thirty (30) days of becoming aware of such noncompliance. Upon termination, a Recipient agrees to immediately cease use and distribution of the Subject Software. All sublicenses to the Subject Software properly granted by the breaching Recipient shall survive any such termination of this Agreement.
+
+B. Severability: If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement.
+
+C. Applicable Law: This Agreement shall be subject to United States federal law only for all purposes, including, but not limited to, determining the validity of this Agreement, the meaning of its provisions and the rights, obligations and remedies of the parties.
+
+D. Entire Understanding: This Agreement constitutes the entire understanding and agreement of the parties relating to release of the Subject Software and may not be superseded, modified or amended except by further written agreement duly executed by the parties.
+
+E. Binding Authority: By accepting and using the Subject Software under this Agreement, a Recipient affirms its authority to bind the Recipient to all terms and conditions of this Agreement and that that Recipient hereby agrees to all terms and conditions herein.
+
+F. Point of Contact: Any Recipient contact with Government Agency is to be directed to the designated representative as follows: ___________.
+
diff --git a/poky/meta/files/common-licenses/NCSA b/poky/meta/files/common-licenses/NCSA
new file mode 100644
index 000000000..d0ddc9b07
--- /dev/null
+++ b/poky/meta/files/common-licenses/NCSA
@@ -0,0 +1,34 @@
+
+University of Illinois/NCSA Open Source License
+Copyright (c) <Year> <Owner Organization Name>
+All rights reserved.
+
+Developed by: <Name of Development Group>
+ <Name of Institution>
+ <URL for Development Group/Institution>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal with the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimers.
+Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimers
+in the documentation and/or other materials provided with the
+distribution.
+Neither the names of <Name of Development Group, Name of
+Institution>, nor the names of its contributors may be used to endorse
+or promote products derived from this Software without specific prior
+written permission.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/NGPL b/poky/meta/files/common-licenses/NGPL
new file mode 100644
index 000000000..2096eab0f
--- /dev/null
+++ b/poky/meta/files/common-licenses/NGPL
@@ -0,0 +1,45 @@
+
+
+NETHACK GENERAL PUBLIC LICENSE
+
+(Copyright 1989 M. Stephenson)
+(Based on the BISON general public license, copyright 1988 Richard M. Stallman)
+
+Everyone is permitted to copy and distribute verbatim copies of this license, but changing it is not allowed. You can also use this wording to make the terms for other programs.
+The license agreements of most software companies keep you at the mercy of those companies. By contrast, our general public license is intended to give everyone the right to share NetHack. To make sure that you get the rights we want you to have, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. Hence this license agreement.
+
+Specifically, we want to make sure that you have the right to give away copies of NetHack, that you receive source code or else can get it if you want it, that you can change NetHack or use pieces of it in new free programs, and that you know you can do these things.
+
+To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of NetHack, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.
+
+Also, for our own protection, we must make certain that everyone finds out that there is no warranty for NetHack. If NetHack is modified by someone else and passed on, we want its recipients to know that what they have is not what we distributed.
+
+Therefore we (Mike Stephenson and other holders of NetHack copyrights) make the following terms which say what you must do to be allowed to distribute or change NetHack.
+
+COPYING POLICIES
+
+You may copy and distribute verbatim copies of NetHack source code as you receive it, in any medium, provided that you keep intact the notices on all files that refer to copyrights, to this License Agreement, and to the absence of any warranty; and give any other recipients of the NetHack program a copy of this License Agreement along with the program.
+You may modify your copy or copies of NetHack or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above (including distributing this License Agreement), provided that you also do the following:
+a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and
+
+b) cause the whole of any work that you distribute or publish, that in whole or in part contains or is a derivative of NetHack or any part thereof, to be licensed at no charge to all third parties on terms identical to those contained in this License Agreement (except that you may choose to grant more extensive warranty protection to some or all third parties, at your option)
+
+c) You may charge a distribution fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+You may copy and distribute NetHack (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following:
+a) accompany it with the complete machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or,
+
+b) accompany it with full information as to how to obtain the complete machine-readable source code from an appropriate archive site. (This alternative is allowed only for noncommercial distribution.)
+
+For these purposes, complete source code means either the full source distribution as originally released over Usenet or updated copies of the files in this distribution used to create the object code or executable.
+
+You may not copy, sublicense, distribute or transfer NetHack except as expressly provided under this License Agreement. Any attempt otherwise to copy, sublicense, distribute or transfer NetHack is void and your rights to use the program under this License agreement shall be automatically terminated. However, parties who have received computer software programs from you with this License Agreement will not have their licenses terminated so long as such parties remain in full compliance.
+Stated plainly: You are permitted to modify NetHack, or otherwise use parts of NetHack, provided that you comply with the conditions specified above; in particular, your modified NetHack or program containing parts of NetHack must remain freely available as provided in this License Agreement. In other words, go ahead and share NetHack, but don`t try to stop anyone else from sharing it farther.
+[ Home | Version 3.4.3 | Contact Us ]
+
+
+
+Hosted by:
+NetHack is Copyright 1985-2003 by Stichting Mathematisch Centrum and M. Stephenson. See our license for details.
+This site is Copyright 1999-2009 by Kenneth Lorber, Kensington, Maryland.
+
diff --git a/poky/meta/files/common-licenses/NPOSL-3.0 b/poky/meta/files/common-licenses/NPOSL-3.0
new file mode 100644
index 000000000..3a2a66237
--- /dev/null
+++ b/poky/meta/files/common-licenses/NPOSL-3.0
@@ -0,0 +1,61 @@
+
+Non-Profit Open Software License ("Non-Profit OSL") 3.0
+
+This Non-Profit Open Software License ("Non-Profit OSL") version 3.0 (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Non-Profit Open Software License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Non-Profit Open Software License or as provided in section 17(d);
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor`s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. The Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+12) Attorneys` Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
+17) Non-Profit Amendment. The name of this amended version of the Open Software License ("OSL 3.0") is "Non-Profit Open Software License 3.0". The original OSL 3.0 license has been amended as follows:
+
+(a) Licensor represents and declares that it is a not-for-profit organization that derives no revenue whatsoever from the distribution of the Original Work or Derivative Works thereof, or from support or services relating thereto.
+
+(b) The first sentence of Section 7 ["Warranty of Provenance"] of OSL 3.0 has been stricken. For Original Works licensed under this Non-Profit OSL 3.0, LICENSOR OFFERS NO WARRANTIES WHATSOEVER.
+
+(c) In the first sentence of Section 8 ["Limitation of Liability"] of this Non-Profit OSL 3.0, the list of damages for which LIABILITY IS LIMITED now includes "direct" damages.
+
+(d) The proviso in Section 1(c) of this License now refers to this "Non-Profit Open Software License" rather than the "Open Software License". You may distribute or communicate the Original Work or Derivative Works thereof under this Non-Profit OSL 3.0 license only if You make the representation and declaration in paragraph (a) of this Section 17. Otherwise, You shall distribute or communicate the Original Work or Derivative Works thereof only under the OSL 3.0 license and You shall publish clear licensing notices so stating. Also by way of clarification, this License does not authorize You to distribute or communicate works under this Non-Profit OSL 3.0 if You received them under the original OSL 3.0 license.
+
+(e) Original Works licensed under this license shall reference "Non-Profit OSL 3.0" in licensing notices to distinguish them from works licensed under the original OSL 3.0 license.
+
diff --git a/poky/meta/files/common-licenses/NTP b/poky/meta/files/common-licenses/NTP
new file mode 100644
index 000000000..b3572b0b4
--- /dev/null
+++ b/poky/meta/files/common-licenses/NTP
@@ -0,0 +1,7 @@
+
+NTP License (NTP)
+
+Copyright (c) (CopyrightHoldersName) (From 4-digit-year)-(To 4-digit-year)
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the above copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name (TrademarkedName) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. (TrademarkedName) makes no representations about the suitability this software for any purpose. It is provided "as is" without express or implied warranty.
+
diff --git a/poky/meta/files/common-licenses/Nauman b/poky/meta/files/common-licenses/Nauman
new file mode 100644
index 000000000..69ce785ff
--- /dev/null
+++ b/poky/meta/files/common-licenses/Nauman
@@ -0,0 +1,50 @@
+
+NAUMEN Public License
+This software is Copyright (c) NAUMEN (tm) and Contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+1. Redistributions in source code must retain the above
+copyright notice, this list of conditions, and the following
+disclaimer.
+
+2. Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions, and the following
+disclaimer in the documentation and/or other materials
+provided with the distribution.
+
+3. The name NAUMEN (tm) must not be used to
+endorse or promote products derived from this software without prior
+written permission from NAUMEN.
+
+4. The right to distribute this software or to use it for any
+purpose does not give you the right to use Servicemarks (sm)
+or Trademarks (tm) of NAUMEN.
+
+5. If any files originating from NAUMEN or Contributors are modified, you must
+cause the modified files to carry prominent notices stating
+that you changed the files and the date of any change.
+
+Disclaimer:
+
+THIS SOFTWARE IS PROVIDED BY NAUMEN "AS IS" AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NAUMEN
+OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+This software consists of contributions made by NAUMEN
+and Contributors. Specific attributions are listed in the
+accompanying credits file.
+
diff --git a/poky/meta/files/common-licenses/Nokia b/poky/meta/files/common-licenses/Nokia
new file mode 100644
index 000000000..0037716df
--- /dev/null
+++ b/poky/meta/files/common-licenses/Nokia
@@ -0,0 +1,423 @@
+
+Nokia Open Source License (NOKOS
+License) Version 1.0a
+ 1. DEFINITIONS.
+
+"Affiliates" of a party shall mean an entity
+
+a) which is directly or indirectly controlling such party;
+
+b) which is under the same direct or indirect ownership or control
+as such party; or
+
+c) which is directly or indirectly owned or controlled by such party.
+
+For these purposes, an entity shall be treated as being controlled
+by another if that other entity has fifty percent (50%) or more of the
+votes in such entity, is able to direct its affairs and/or to control the
+composition of its board of directors or equivalent body.
+
+"Commercial Use" shall mean distribution or otherwise making
+the Covered Software available to a third party.
+
+``Contributor`` shall mean each entity that creates or contributes
+to the creation of Modifications.
+
+``Contributor Version`` shall mean in case of any Contributor
+the combination of the Original Software, prior Modifications used by a
+Contributor, and the Modifications made by that particular Contributor
+and in case of Nokia in addition the Original Software in any form, including
+the form as Exceutable.
+
+``Covered Software`` shall mean the Original Software or Modifications
+or the combination of the Original Software and Modifications, in each
+case including portions thereof.
+
+``Electronic Distribution Mechanism`` shall mean a mechanism
+generally accepted in the software development community for the electronic
+transfer of data.
+
+``Executable`` shall mean Covered Software in any form other
+than Source Code.
+
+``Nokia`` shall mean Nokia Corporation and its Affiliates.
+
+``Larger Work`` shall mean a work, which combines Covered Software
+or portions thereof with code not governed by the terms of this License.
+
+``License`` shall mean this document.
+
+"Licensable" shall mean having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+``Modifications`` shall mean any addition to or deletion from
+the substance or structure of either the Original Software or any previous
+Modifications. When Covered Software is released as a series of files,
+a Modification is:
+
+a) Any addition to or deletion from the contents of a file containing
+Original Software or previous Modifications.
+
+b) Any new file that contains any part of the Original Software or
+previous Modifications.
+
+``Original Software`` shall mean the Source Code of computer
+software code which is described in the Source Code notice required by
+Exhibit A as Original Software, and which, at the time of its release under
+this License is not already Covered Software governed by this License.
+
+"Patent Claims" shall mean any patent claim(s), now owned
+or hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+``Source Code`` shall mean the preferred form of the Covered
+Software for making modifications to it, including all modules it contains,
+plus any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or source code differential
+comparisons against either the Original Software or another well known,
+available Covered Software of the Contributor`s choice. The Source Code
+can be in a compressed or archival form, provided the appropriate decompression
+or de-archiving software is widely available for no charge.
+
+"You`` (or "Your") shall mean an individual or a legal
+entity exercising rights under, and complying with all of the terms of,
+this License or a future version of this License issued under Section 6.1.
+For legal entities, "You`` includes Affiliates of such entity.
+
+2. SOURCE CODE LICENSE.
+
+2.1 Nokia Grant.
+
+Subject to the terms of this License, Nokia hereby grants You a world-wide,
+royalty-free, non-exclusive license, subject to third party intellectual
+property claims:
+
+a) under copyrights Licensable by Nokia to use, reproduce, modify,
+display, perform, sublicense and distribute the Original Software (or portions
+thereof) with or without Modifications, and/or as part of a Larger Work;
+
+b) and under Patents Claims necessarily infringed by the making, using
+or selling of Original Software, to make, have made, use, practice, sell,
+and offer for sale, and/or otherwise dispose of the Original Software (or
+portions thereof).
+
+c) The licenses granted in this Section 2.1(a) and (b) are effective
+on the date Nokia first distributes Original Software under the terms of
+this License.
+
+d) Notwithstanding Section 2.1(b) above, no patent license is granted:
+1) for code that You delete from the Original Software; 2) separate from
+the Original Software; or 3) for infringements caused by: i) the modification
+of the Original Software or ii) the combination of the Original Software
+with other software or devices.
+
+2.2 Contributor Grant.
+
+Subject to the terms of this License and subject to third party intellectual
+property claims, each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license
+
+a) under copyrights Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications created by
+such Contributor (or portions thereof) either on an unmodified basis, with
+other Modifications, as Covered Software and/or as part of a Larger Work;
+and
+
+b) under Patent Claims necessarily infringed by the making, using,
+or selling of Modifications made by that Contributor either alone and/or
+in combination with its Contributor Version (or portions of such combination),
+to make, use, sell, offer for sale, have made, and/or otherwise dispose
+of: 1) Modifications made by that Contributor (or portions thereof); and
+2) the combination of Modifications made by that Contributor with its Contributor
+Version (or portions of such combination).
+
+c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+on the date Contributor first makes Commercial Use of the Covered Software.
+
+d) Notwithstanding Section 2.2(b) above, no patent license is granted:
+1) for any code that Contributor has deleted from the Contributor Version;
+2) separate from the Contributor Version; 3) for infringements caused by:
+i) third party modifications of Contributor Version or ii) the combination
+of Modifications made by that Contributor with other software (except as
+part of the Contributor Version) or other devices; or 4) under Patent Claims
+infringed by Covered Software in the absence of Modifications made by that
+Contributor.
+
+3. DISTRIBUTION OBLIGATIONS.
+
+3.1 Application of License.
+
+
+The Modifications which You create or to which You contribute are governed
+by the terms of this License, including without limitation Section 2.2.
+The Source Code version of Covered Software may be distributed only under
+the terms of this License or a future version of this License released
+under Section 6.1, and You must include a copy of this License with every
+copy of the Source Code You distribute. You may not offer or impose any
+terms on any Source Code version that alters or restricts the applicable
+version of this License or the recipients` rights hereunder. However, You
+may include an additional document offering the additional rights described
+in Section 3.5.
+
+3.2 Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License either
+on the same media as an Executable version or via an accepted Electronic
+Distribution Mechanism to anyone to whom you made an Executable version
+available; and if made available via Electronic Distribution Mechanism,
+must remain available for at least twelve (12) months after the date it
+initially became available, or at least six (6) months after a subsequent
+version of that particular Modification has been made available to such
+recipients. You are responsible for ensuring that the Source Code version
+remains available even if the Electronic Distribution Mechanism is maintained
+by a third party.
+
+3.3 Description of Modifications.
+
+You must cause all Covered Software to which You contribute to contain
+a file documenting the changes You made to create that Covered Software
+and the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original Software
+provided by Nokia and including the name of Nokia in (a) the Source Code,
+and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Software.
+
+3.4 Intellectual Property Matters
+
+(a) Third Party Claims.
+
+If Contributor has knowledge that a license under a third party`s intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the
+Source Code distribution titled "LEGAL`` which describes the claim and
+the party making the claim in sufficient detail that a recipient will know
+whom to contact. If Contributor obtains such knowledge after the Modification
+is made available as described in Section 3.2, Contributor shall promptly
+modify the LEGAL file in all copies Contributor makes available thereafter
+and shall take other steps (such as notifying appropriate mailing lists
+or newsgroups) reasonably calculated to inform those who received the Covered
+Software that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming interface
+and Contributor has knowledge of patent licenses which are reasonably necessary
+to implement that API, Contributor must also include this information in
+the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section
+3.4(a) above, Contributor believes that Contributor`s Modifications are
+Contributor`s original creation(s) and/or Contributor has sufficient rights
+to grant the rights conveyed by this License.
+
+3.5 Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source Code
+file due to its structure, then You must include such notice in a location
+(such as a relevant directory) where a user would be likely to look for
+such a notice. If You created one or more Modification(s) You may add your
+name as a Contributor to the notice described in Exhibit A. You must also
+duplicate this License in any documentation for the Source Code where You
+describe recipients` rights or ownership rights relating to Covered Software.
+You may choose to offer, and to charge a fee for, warranty, support, indemnity
+or liability obligations to one or more recipients of Covered Software.
+However, You may do so only on Your own behalf, and not on behalf of Nokia
+or any Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify Nokia and every Contributor for any liability
+incurred by Nokia or such Contributor as a result of warranty, support,
+indemnity or liability terms You offer.
+
+3.6 Distribution of Executable Versions.
+
+You may distribute Covered Software in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Software,
+and if You include a notice stating that the Source Code version of the
+Covered Software is available under the terms of this License, including
+a description of how and where You have fulfilled the obligations of Section
+3.2. The notice must be conspicuously included in any notice in an Executable
+version, related documentation or collateral in which You describe recipients`
+rights relating to the Covered Software. You may distribute the Executable
+version of Covered Software or ownership rights under a license of Your
+choice, which may contain terms different from this License, provided that
+You are in compliance with the terms of this License and that the license
+for the Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this License.
+If You distribute the Executable version under a different license You
+must make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by Nokia or any Contributor. You hereby agree
+to indemnify Nokia and every Contributor for any liability incurred by
+Nokia or such Contributor as a result of any such terms You offer.
+
+3.7 Larger Works.
+
+You may create a Larger Work by combining Covered Software with other
+software not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to statute,
+judicial order, or regulation then You must: (a) comply with the terms
+of this License to the maximum extent possible; and (b) describe the limitations
+and the code they affect. Such description must be included in the LEGAL
+file described in Section 3.4 and must be included with all distributions
+of the Source Code.
+
+Except to the extent prohibited by statute or regulation, such description
+must be sufficiently detailed for a recipient of ordinary skill to be able
+to understand it.
+
+5. APPLICATION OF THIS LICENSE.
+
+This License applies to code to which Nokia has attached the notice
+in Exhibit A and to related Covered Software.
+
+6. VERSIONS OF THE LICENSE.
+
+
+6.1 New Versions.
+
+Nokia may publish revised and/or new versions of the License from time
+to time. Each version will be given a distinguishing version number.
+
+6.2 Effect of New Versions.
+
+Once Covered Software has been published under a particular version
+of the License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Software under the terms
+of any subsequent version of the License published by Nokia. No one other
+than Nokia has the right to modify the terms applicable to Covered Software
+created under this License.
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
+COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT NOKIA, ITS LICENSORS
+OR AFFILIATES OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES
+AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED
+HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+8.1 This License and the rights granted hereunder will terminate automatically
+if You fail to comply with terms herein and fail to cure such breach within
+30 days of becoming aware of the breach. All sublicenses to the Covered
+Software which are properly granted shall survive any termination of this
+License. Provisions which, by their nature, must remain in effect beyond
+the termination of this License shall survive.
+
+8.2 If You initiate litigation by asserting a patent infringement claim
+(excluding declatory judgment actions) against Nokia or a Contributor (Nokia
+or Contributor against whom You file such action is referred to as "Participant")
+alleging that:
+
+a) such Participant`s Contributor Version directly or indirectly infringes
+any patent, then any and all rights granted by such Participant to You
+under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice
+from Participant terminate prospectively, unless if within 60 days after
+receipt of notice You either: (i) agree in writing to pay Participant a
+mutually agreeable reasonable royalty for Your past and future use of Modifications
+made by such Participant, or (ii) withdraw Your litigation claim with respect
+to the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not mutually
+agreed upon in writing by the parties or the litigation claim is not withdrawn,
+the rights granted by Participant to You under Sections 2.1 and/or 2.2
+automatically terminate at the expiration of the 60 day notice period specified
+above.
+
+b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b) and
+2.2(b) are revoked effective as of the date You first made, used, sold,
+distributed, or had made, Modifications made by that Participant.
+
+8.3 If You assert a patent infringement claim against Participant alleging
+that such Participant`s Contributor Version directly or indirectly infringes
+any patent where such claim is resolved (such as by license or settlement)
+prior to the initiation of patent infringement litigation, then the reasonable
+value of the licenses granted by such Participant under Sections 2.1 or
+2.2 shall be taken into account in determining the amount or value of any
+payment or license.
+
+8.4 In the event of termination under Sections 8.1 or 8.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or any distributor hereunder prior to
+termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, NOKIA, ANY OTHER CONTRIBUTOR,
+OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH
+PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION
+OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS
+SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
+OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, BUT MAY ALLOW LIABILITY TO BE LIMITED;
+IN SUCH CASES, A PARTY`s, ITS EMPLOYEES, LICENSORS OR AFFILIATES` LIABILITY
+SHALL BE LIMITED TO U.S. $50. Nothing contained in this License shall prejudice
+the statutory rights of any party dealing as a consumer.
+
+10. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. All rights in the Covered Software not expressly granted under
+this License are reserved. Nothing in this License shall grant You any
+rights to use any of the trademarks of Nokia or any of its Affiliates,
+even if any of such trademarks are included in any part of Covered Software
+and/or documentation to it.
+
+This License is governed by the laws of Finland excluding its conflict-of-law
+provisions. All disputes arising from or relating to this Agreement shall
+be settled by a single arbitrator appointed by the Central Chamber of Commerce
+of Finland. The arbitration procedure shall take place in Helsinki, Finland
+in the English language. If any part of this Agreement is found void and
+unenforceable, it will not affect the validity of the balance of the Agreement,
+which shall remain valid and enforceable according to its terms.
+
+11. RESPONSIBILITY FOR CLAIMS.
+
+As between Nokia and the Contributors, each party is responsible for
+claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Nokia and Contributors
+to distribute such responsibility on an equitable basis. Nothing herein
+is intended or shall be deemed to constitute any admission of liability.
+
+
+
+EXHIBIT A
+
+The contents of this file are subject to the NOKOS License Version 1.0
+(the "License"); you may not use this file except in compliance with the
+License.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+The Original Software is
+
+______________________________________.
+
+Copyright &#169; <year> Nokia and others. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
diff --git a/poky/meta/files/common-licenses/OASIS b/poky/meta/files/common-licenses/OASIS
new file mode 100644
index 000000000..f93df7af2
--- /dev/null
+++ b/poky/meta/files/common-licenses/OASIS
@@ -0,0 +1,13 @@
+ Permission to use, copy, modify and distribute the DocBook DTD and
+ its accompanying documentation for any purpose and without fee is
+ hereby granted in perpetuity, provided that the above copyright
+ notice and this paragraph appear in all copies. The copyright
+ holders make no representation about the suitability of the DTD for
+ any purpose. It is provided "as is" without expressed or implied
+ warranty.
+
+ If you modify the DocBook DTD in any way, except for declaring and
+ referencing additional sets of general entities and declaring
+ additional notations, label your DTD as a variant of DocBook. See
+ the maintenance documentation for more information.
+
diff --git a/poky/meta/files/common-licenses/OCLC-2.0 b/poky/meta/files/common-licenses/OCLC-2.0
new file mode 100644
index 000000000..139e3f7e0
--- /dev/null
+++ b/poky/meta/files/common-licenses/OCLC-2.0
@@ -0,0 +1,78 @@
+
+OCLC Research Public License 2.0
+Terms &amp; Conditions Of Use
+May, 2002
+Copyright &#169; 2002. OCLC Online Computer Library Center, Inc. All Rights Reserved
+
+PLEASE READ THIS DOCUMENT CAREFULLY. BY DOWNLOADING OR USING THE CODE BASE AND/OR DOCUMENTATION ACCOMPANYING THIS LICENSE (THE "License"), YOU AGREE TO THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE.
+
+Section 1. Your Rights
+
+Subject to these terms and conditions of this License, the OCLC Office of Research (the "Original Contributor") and each subsequent contributor (collectively with the Original Contributor, the "Contributors") hereby grant you a non-exclusive, worldwide, no-charge, transferable license to execute, prepare derivative works of, and distribute (internally and externally), for commercial and noncommercial purposes, the original code contributed by Original Contributor and all Modifications (collectively called the "Program").
+
+Section 2. Definitions
+
+A "Modification" to the Program is any addition to or deletion from the contents of any file of the Program and any new file that contains any part of the Program. If you make a Modification and distribute the Program externally you are a "Contributor." The distribution of the Program must be under the terms of this license including those in Section 3 below.
+
+A "Combined Work" results from combining and integrating all or parts of the Program with other code. A Combined Work may be thought of as having multiple parents or being result of multiple lines of code development.
+
+Section 3. Distribution Licensing Terms
+
+A. General Requirements
+Except as necessary to recognize third-party rights or third-party restriction (see below), a distribution of the Program in any of the forms listed below must not put any further restrictions on the recipient&#8217;s exercise of the rights granted herein.
+
+As a Contributor, you represent that your Modification(s) are your original creation(s) and, to the best of your knowledge, no third party has any claim (including but not limited to intellectual property claims) relating to your Modification(s). You represent that each of your Modifications includes complete details of any third-party right or other third-party restriction associated with any part of your Modification (including a copy of any applicable license agreement).
+
+The Program must be distributed without charge beyond the costs of physically transferring the files to the recipient.
+
+This Warranty Disclaimer/Limitation of Liability must be prominently displayed with every distribution of the Program in any form:
+
+YOU AGREE THAT THE PROGRAM IS PROVIDED AS-IS, WITHOUT WARRANTY OF ANY KIND (EITHER EXPRESS OR IMPLIED). ACCORDINGLY, OCLC MAKES NO WARRANTIES, REPRESENTATIONS OR GUARANTEES, EITHER EXPRESS OR IMPLIED, AND DISCLAIMS ALL SUCH WARRANTIES, REPRESENTATIONS OR GUARANTEES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE, AS TO: (A) THE FUNCTIONALITY OR NONINFRINGEMENT OF PROGRAM, ANY MODIFICATION, A COMBINED WORK OR AN AGGREGATE WORK; OR (B) THE RESULTS OF ANY PROJECT UNDERTAKEN USING THE PROGRAM, ANY MODIFICATION, A COMBINED WORK OR AN AGGREGATE WORK. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, CONSEQUENTIAL OR ANY OTHER DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE PROGRAM, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. YOU HEREBY WAIVE ANY CLAIMS FOR DAMAGES OF ANY KIND AGAINST CONTRIBUTORS WHICH MAY RESULT FROM YOUR USE OF THE PROGRAM.
+
+B. Requirements for a Distribution of Modifiable Code
+If you distribute the Program in a form to which the recipient can make Modifications (e.g. source code), the terms of this license apply to use by recipient. In addition, each source and data file of the Program and any Modification you distribute must contain the following notice:
+
+"Copyright (c) 2000- (insert then current year) OCLC Online Computer Library Center, Inc. and other contributors. All rights reserved. The contents of this file, as updated from time to time by the OCLC Office of Research, are subject to OCLC Research Public License Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a current copy of the License at http://purl.oclc.org/oclc/research/ORPL/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. This software consists of voluntary contributions made by many individuals on behalf of OCLC Research. For more information on OCLC Research, please see http://www.oclc.org/research/. The Original Code is ______________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) _____ _______________________. All Rights Reserved. Contributor(s): ______________________________________."
+
+C. Requirements for a Distribution of Non-modifiable Code
+If you distribute the Program in a form to which the recipient cannot make Modifications (e.g. object code), the terms of this license apply to use by recipient and you must include the following statement in appropriate and conspicuous locations:
+
+"Copyright (c) 2000- (insert then current year) OCLC Online Computer Library Center, Inc. and other contributors. All rights reserved."
+
+In addition, the source code must be included with the object code distribution or the distributor must provide the source code to the recipient upon request.
+
+D. Requirements for a Combined Work Distribution
+Distributions of Combined Works are subject to the terms of this license and must be made at no charge to the recipient beyond the costs of physically transferring the files to recipient.
+
+A Combined Work may be distributed as either modifiable or non-modifiable code. The requirements of Section 3.B or 3.C above (as appropriate) apply to such distributions.
+
+An "Aggregate Work" is when the Program exists, without integration, with other programs on a storage medium. This License does not apply to portions of an Aggregate Work which are not covered by the definition of "Program" provided in this License. You are not forbidden from selling an Aggregate Work. However, the Program contained in an Aggregate Work is subject to this License. Also, should the Program be extracted from an Aggregate Work, this License applies to any use of the Program apart from the Aggregate Work.
+
+Section 4. License Grant
+
+For purposes of permitting use of your Modifications by OCLC and other licensees hereunder, you hereby grant to OCLC and such other licensees the non-exclusive, worldwide, royalty-free, transferable, sublicenseable license to execute, copy, alter, delete, modify, adapt, change, revise, enhance, develop, publicly display, distribute (internally and externally) and/or create derivative works based on your Modifications (and derivative works thereof) in accordance with these Terms. This Section 4 shall survive termination of this License for any reason.
+
+Section 5. Termination of Rights
+
+This non-exclusive license (with respect to the grant from a particular Contributor) automatically terminates for any entity that initiates legal action for intellectual property infringement (with respect to the Program) against such Contributor as of the initiation of such action.
+
+If you fail to comply with this License, your rights (but not your obligations) under this License shall terminate automatically unless you cure such breach within thirty (30) days of becoming aware of the noncompliance. All sublicenses granted by you which preexist such termination and are properly granted shall survive such termination.
+
+Section 6. Other Terms
+
+Except for the copyright notices required above, you may not use any trademark of any of the Contributors without the prior written consent of the relevant Contributor. You agree not to remove, alter or obscure any copyright or other proprietary rights notice contained in the Program.
+
+All transfers of the Program or any part thereof shall be made in compliance with U.S. import/export regulations or other restrictions of the U.S. Department of Commerce, as well as other similar trade or commerce restrictions which might apply.
+
+Any patent obtained by any party covering the Program or any part thereof must include a provision providing for the free, perpetual and unrestricted commercial and noncommercial use by any third party.
+
+If, as a consequence of a court judgment or settlement relating to intellectual property infringement or any other cause of action, conditions are imposed on you that contradict the conditions of this License, such conditions do not excuse you from compliance with this License. If you cannot distribute the Program so as to simultaneously satisfy your obligations under this License and such other conditions, you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, you could not satisfy both the patent license and this License, and you would be required to refrain entirely from distribution of the Program.
+
+If you learn of a third party claim or other restriction relating to a Program you have already distributed you shall promptly redo your Program to address the issue and take all reasonable steps to inform those who may have received the Program at issue. An example of an appropriate reasonable step to inform would be posting an announcement on an appropriate web bulletin board.
+
+The provisions of this License are deemed to be severable, and the invalidity or unenforceability of any provision shall not affect or impair the remaining provisions which shall continue in full force and effect. In substitution for any provision held unlawful, there shall be substituted a provision of similar import reflecting the original intent of the parties hereto to the extent permissible under law.
+
+The Original Contributor from time to time may change this License, and the amended license will apply to all copies of the Program downloaded after the new license is posted. This License grants only the rights expressly stated herein and provides you with no implied rights or licenses to the intellectual property of any Contributor.
+
+This License is the complete and exclusive statement of the agreement between the parties concerning the subject matter hereof and may not be amended except by the written agreement of the parties. This License shall be governed by and construed in accordance with the laws of the State of Ohio and the United States of America, without regard to principles of conflicts of law.
+
diff --git a/poky/meta/files/common-licenses/ODbL-1.0 b/poky/meta/files/common-licenses/ODbL-1.0
new file mode 100644
index 000000000..c9f144eb2
--- /dev/null
+++ b/poky/meta/files/common-licenses/ODbL-1.0
@@ -0,0 +1,543 @@
+
+## ODC Open Database License (ODbL)
+
+### Preamble
+
+The Open Database License (ODbL) is a license agreement intended to
+allow users to freely share, modify, and use this Database while
+maintaining this same freedom for others. Many databases are covered by
+copyright, and therefore this document licenses these rights. Some
+jurisdictions, mainly in the European Union, have specific rights that
+cover databases, and so the ODbL addresses these rights, too. Finally,
+the ODbL is also an agreement in contract for users of this Database to
+act in certain ways in return for accessing this Database.
+
+Databases can contain a wide variety of types of content (images,
+audiovisual material, and sounds all in the same database, for example),
+and so the ODbL only governs the rights over the Database, and not the
+contents of the Database individually. Licensors should use the ODbL
+together with another license for the contents, if the contents have a
+single set of rights that uniformly covers all of the contents. If the
+contents have multiple sets of different rights, Licensors should
+describe what rights govern what contents together in the individual
+record or in some other way that clarifies what rights apply.
+
+Sometimes the contents of a database, or the database itself, can be
+covered by other rights not addressed here (such as private contracts,
+trade mark over the name, or privacy rights / data protection rights
+over information in the contents), and so you are advised that you may
+have to consult other documents or clear other rights before doing
+activities not covered by this License.
+
+------
+
+The Licensor (as defined below)
+
+and
+
+You (as defined below)
+
+agree as follows:
+
+### 1.0 Definitions of Capitalised Words
+
+"Collective Database" &#8211; Means this Database in unmodified form as part
+of a collection of independent databases in themselves that together are
+assembled into a collective whole. A work that constitutes a Collective
+Database will not be considered a Derivative Database.
+
+"Convey" &#8211; As a verb, means Using the Database, a Derivative Database,
+or the Database as part of a Collective Database in any way that enables
+a Person to make or receive copies of the Database or a Derivative
+Database. Conveying does not include interaction with a user through a
+computer network, or creating and Using a Produced Work, where no
+transfer of a copy of the Database or a Derivative Database occurs.
+"Contents" &#8211; The contents of this Database, which includes the
+information, independent works, or other material collected into the
+Database. For example, the contents of the Database could be factual
+data or works such as images, audiovisual material, text, or sounds.
+
+"Database" &#8211; A collection of material (the Contents) arranged in a
+systematic or methodical way and individually accessible by electronic
+or other means offered under the terms of this License.
+
+"Database Directive" &#8211; Means Directive 96/9/EC of the European
+Parliament and of the Council of 11 March 1996 on the legal protection
+of databases, as amended or succeeded.
+
+"Database Right" &#8211; Means rights resulting from the Chapter III ("sui
+generis") rights in the Database Directive (as amended and as transposed
+by member states), which includes the Extraction and Re-utilisation of
+the whole or a Substantial part of the Contents, as well as any similar
+rights available in the relevant jurisdiction under Section 10.4.
+
+"Derivative Database" &#8211; Means a database based upon the Database, and
+includes any translation, adaptation, arrangement, modification, or any
+other alteration of the Database or of a Substantial part of the
+Contents. This includes, but is not limited to, Extracting or
+Re-utilising the whole or a Substantial part of the Contents in a new
+Database.
+
+"Extraction" &#8211; Means the permanent or temporary transfer of all or a
+Substantial part of the Contents to another medium by any means or in
+any form.
+
+"License" &#8211; Means this license agreement and is both a license of rights
+such as copyright and Database Rights and an agreement in contract.
+
+"Licensor" &#8211; Means the Person that offers the Database under the terms
+of this License.
+
+"Person" &#8211; Means a natural or legal person or a body of persons
+corporate or incorporate.
+
+"Produced Work" &#8211; a work (such as an image, audiovisual material, text,
+or sounds) resulting from using the whole or a Substantial part of the
+Contents (via a search or other query) from this Database, a Derivative
+Database, or this Database as part of a Collective Database.
+
+"Publicly" &#8211; means to Persons other than You or under Your control by
+either more than 50% ownership or by the power to direct their
+activities (such as contracting with an independent consultant).
+
+"Re-utilisation" &#8211; means any form of making available to the public all
+or a Substantial part of the Contents by the distribution of copies, by
+renting, by online or other forms of transmission.
+
+"Substantial" &#8211; Means substantial in terms of quantity or quality or a
+combination of both. The repeated and systematic Extraction or
+Re-utilisation of insubstantial parts of the Contents may amount to the
+Extraction or Re-utilisation of a Substantial part of the Contents.
+
+"Use" &#8211; As a verb, means doing any act that is restricted by copyright
+or Database Rights whether in the original medium or any other; and
+includes without limitation distributing, copying, publicly performing,
+publicly displaying, and preparing derivative works of the Database, as
+well as modifying the Database as may be technically necessary to use it
+in a different mode or format.
+
+"You" &#8211; Means a Person exercising rights under this License who has not
+previously violated the terms of this License with respect to the
+Database, or who has received express permission from the Licensor to
+exercise rights under this License despite a previous violation.
+
+Words in the singular include the plural and vice versa.
+
+### 2.0 What this License covers
+
+2.1. Legal effect of this document. This License is:
+
+ a. A license of applicable copyright and neighbouring rights;
+
+ b. A license of the Database Right; and
+
+ c. An agreement in contract between You and the Licensor.
+
+2.2 Legal rights covered. This License covers the legal rights in the
+Database, including:
+
+ a. Copyright. Any copyright or neighbouring rights in the Database.
+ The copyright licensed includes any individual elements of the
+ Database, but does not cover the copyright over the Contents
+ independent of this Database. See Section 2.4 for details. Copyright
+ law varies between jurisdictions, but is likely to cover: the Database
+ model or schema, which is the structure, arrangement, and organisation
+ of the Database, and can also include the Database tables and table
+ indexes; the data entry and output sheets; and the Field names of
+ Contents stored in the Database;
+
+ b. Database Rights. Database Rights only extend to the Extraction and
+ Re-utilisation of the whole or a Substantial part of the Contents.
+ Database Rights can apply even when there is no copyright over the
+ Database. Database Rights can also apply when the Contents are removed
+ from the Database and are selected and arranged in a way that would
+ not infringe any applicable copyright; and
+
+ c. Contract. This is an agreement between You and the Licensor for
+ access to the Database. In return you agree to certain conditions of
+ use on this access as outlined in this License.
+
+2.3 Rights not covered.
+
+ a. This License does not apply to computer programs used in the making
+ or operation of the Database;
+
+ b. This License does not cover any patents over the Contents or the
+ Database; and
+
+ c. This License does not cover any trademarks associated with the
+ Database.
+
+2.4 Relationship to Contents in the Database. The individual items of
+the Contents contained in this Database may be covered by other rights,
+including copyright, patent, data protection, privacy, or personality
+rights, and this License does not cover any rights (other than Database
+Rights or in contract) in individual Contents contained in the Database.
+For example, if used on a Database of images (the Contents), this
+License would not apply to copyright over individual images, which could
+have their own separate licenses, or one single license covering all of
+the rights over the images.
+
+### 3.0 Rights granted
+
+3.1 Subject to the terms and conditions of this License, the Licensor
+grants to You a worldwide, royalty-free, non-exclusive, terminable (but
+only under Section 9) license to Use the Database for the duration of
+any applicable copyright and Database Rights. These rights explicitly
+include commercial use, and do not exclude any field of endeavour. To
+the extent possible in the relevant jurisdiction, these rights may be
+exercised in all media and formats whether now known or created in the
+future.
+
+The rights granted cover, for example:
+
+ a. Extraction and Re-utilisation of the whole or a Substantial part of
+ the Contents;
+
+ b. Creation of Derivative Databases;
+
+ c. Creation of Collective Databases;
+
+ d. Creation of temporary or permanent reproductions by any means and
+ in any form, in whole or in part, including of any Derivative
+ Databases or as a part of Collective Databases; and
+
+ e. Distribution, communication, display, lending, making available, or
+ performance to the public by any means and in any form, in whole or in
+ part, including of any Derivative Database or as a part of Collective
+ Databases.
+
+3.2 Compulsory license schemes. For the avoidance of doubt:
+
+ a. Non-waivable compulsory license schemes. In those jurisdictions in
+ which the right to collect royalties through any statutory or
+ compulsory licensing scheme cannot be waived, the Licensor reserves
+ the exclusive right to collect such royalties for any exercise by You
+ of the rights granted under this License;
+
+ b. Waivable compulsory license schemes. In those jurisdictions in
+ which the right to collect royalties through any statutory or
+ compulsory licensing scheme can be waived, the Licensor waives the
+ exclusive right to collect such royalties for any exercise by You of
+ the rights granted under this License; and,
+
+ c. Voluntary license schemes. The Licensor waives the right to collect
+ royalties, whether individually or, in the event that the Licensor is
+ a member of a collecting society that administers voluntary licensing
+ schemes, via that society, from any exercise by You of the rights
+ granted under this License.
+
+3.3 The right to release the Database under different terms, or to stop
+distributing or making available the Database, is reserved. Note that
+this Database may be multiple-licensed, and so You may have the choice
+of using alternative licenses for this Database. Subject to Section
+10.4, all other rights not expressly granted by Licensor are reserved.
+
+### 4.0 Conditions of Use
+
+4.1 The rights granted in Section 3 above are expressly made subject to
+Your complying with the following conditions of use. These are important
+conditions of this License, and if You fail to follow them, You will be
+in material breach of its terms.
+
+4.2 Notices. If You Publicly Convey this Database, any Derivative
+Database, or the Database as part of a Collective Database, then You
+must:
+
+ a. Do so only under the terms of this License or another license
+ permitted under Section 4.4;
+
+ b. Include a copy of this License (or, as applicable, a license
+ permitted under Section 4.4) or its Uniform Resource Identifier (URI)
+ with the Database or Derivative Database, including both in the
+ Database or Derivative Database and in any relevant documentation; and
+
+ c. Keep intact any copyright or Database Right notices and notices
+ that refer to this License.
+
+ d. If it is not possible to put the required notices in a particular
+ file due to its structure, then You must include the notices in a
+ location (such as a relevant directory) where users would be likely to
+ look for it.
+
+4.3 Notice for using output (Contents). Creating and Using a Produced
+Work does not require the notice in Section 4.2. However, if you
+Publicly Use a Produced Work, You must include a notice associated with
+the Produced Work reasonably calculated to make any Person that uses,
+views, accesses, interacts with, or is otherwise exposed to the Produced
+Work aware that Content was obtained from the Database, Derivative
+Database, or the Database as part of a Collective Database, and that it
+is available under this License.
+
+ a. Example notice. The following text will satisfy notice under
+ Section 4.3:
+
+ Contains information from DATABASE NAME, which is made available
+ here under the Open Database License (ODbL).
+
+DATABASE NAME should be replaced with the name of the Database and a
+hyperlink to the URI of the Database. "Open Database License" should
+contain a hyperlink to the URI of the text of this License. If
+hyperlinks are not possible, You should include the plain text of the
+required URI`s with the above notice.
+
+4.4 Share alike.
+
+ a. Any Derivative Database that You Publicly Use must be only under
+ the terms of:
+
+ i. This License;
+
+ ii. A later version of this License similar in spirit to this
+ License; or
+
+ iii. A compatible license.
+
+ If You license the Derivative Database under one of the licenses
+ mentioned in (iii), You must comply with the terms of that license.
+
+ b. For the avoidance of doubt, Extraction or Re-utilisation of the
+ whole or a Substantial part of the Contents into a new database is a
+ Derivative Database and must comply with Section 4.4.
+
+ c. Derivative Databases and Produced Works. A Derivative Database is
+ Publicly Used and so must comply with Section 4.4. if a Produced Work
+ created from the Derivative Database is Publicly Used.
+
+ d. Share Alike and additional Contents. For the avoidance of doubt,
+ You must not add Contents to Derivative Databases under Section 4.4 a
+ that are incompatible with the rights granted under this License.
+
+ e. Compatible licenses. Licensors may authorise a proxy to determine
+ compatible licenses under Section 4.4 a iii. If they do so, the
+ authorised proxy`s public statement of acceptance of a compatible
+ license grants You permission to use the compatible license.
+
+
+4.5 Limits of Share Alike. The requirements of Section 4.4 do not apply
+in the following:
+
+ a. For the avoidance of doubt, You are not required to license
+ Collective Databases under this License if You incorporate this
+ Database or a Derivative Database in the collection, but this License
+ still applies to this Database or a Derivative Database as a part of
+ the Collective Database;
+
+ b. Using this Database, a Derivative Database, or this Database as
+ part of a Collective Database to create a Produced Work does not
+ create a Derivative Database for purposes of Section 4.4; and
+
+ c. Use of a Derivative Database internally within an organisation is
+ not to the public and therefore does not fall under the requirements
+ of Section 4.4.
+
+4.6 Access to Derivative Databases. If You Publicly Use a Derivative
+Database or a Produced Work from a Derivative Database, You must also
+offer to recipients of the Derivative Database or Produced Work a copy
+in a machine readable form of:
+
+ a. The entire Derivative Database; or
+
+ b. A file containing all of the alterations made to the Database or
+ the method of making the alterations to the Database (such as an
+ algorithm), including any additional Contents, that make up all the
+ differences between the Database and the Derivative Database.
+
+The Derivative Database (under a.) or alteration file (under b.) must be
+available at no more than a reasonable production cost for physical
+distributions and free of charge if distributed over the internet.
+
+4.7 Technological measures and additional terms
+
+ a. This License does not allow You to impose (except subject to
+ Section 4.7 b.) any terms or any technological measures on the
+ Database, a Derivative Database, or the whole or a Substantial part of
+ the Contents that alter or restrict the terms of this License, or any
+ rights granted under it, or have the effect or intent of restricting
+ the ability of any person to exercise those rights.
+
+ b. Parallel distribution. You may impose terms or technological
+ measures on the Database, a Derivative Database, or the whole or a
+ Substantial part of the Contents (a "Restricted Database") in
+ contravention of Section 4.74 a. only if You also make a copy of the
+ Database or a Derivative Database available to the recipient of the
+ Restricted Database:
+
+ i. That is available without additional fee;
+
+ ii. That is available in a medium that does not alter or restrict
+ the terms of this License, or any rights granted under it, or have
+ the effect or intent of restricting the ability of any person to
+ exercise those rights (an "Unrestricted Database"); and
+
+ iii. The Unrestricted Database is at least as accessible to the
+ recipient as a practical matter as the Restricted Database.
+
+ c. For the avoidance of doubt, You may place this Database or a
+ Derivative Database in an authenticated environment, behind a
+ password, or within a similar access control scheme provided that You
+ do not alter or restrict the terms of this License or any rights
+ granted under it or have the effect or intent of restricting the
+ ability of any person to exercise those rights.
+
+4.8 Licensing of others. You may not sublicense the Database. Each time
+You communicate the Database, the whole or Substantial part of the
+Contents, or any Derivative Database to anyone else in any way, the
+Licensor offers to the recipient a license to the Database on the same
+terms and conditions as this License. You are not responsible for
+enforcing compliance by third parties with this License, but You may
+enforce any rights that You have over a Derivative Database. You are
+solely responsible for any modifications of a Derivative Database made
+by You or another Person at Your direction. You may not impose any
+further restrictions on the exercise of the rights granted or affirmed
+under this License.
+
+### 5.0 Moral rights
+
+5.1 Moral rights. This section covers moral rights, including any rights
+to be identified as the author of the Database or to object to treatment
+that would otherwise prejudice the author`s honour and reputation, or
+any other derogatory treatment:
+
+ a. For jurisdictions allowing waiver of moral rights, Licensor waives
+ all moral rights that Licensor may have in the Database to the fullest
+ extent possible by the law of the relevant jurisdiction under Section
+ 10.4;
+
+ b. If waiver of moral rights under Section 5.1 a in the relevant
+ jurisdiction is not possible, Licensor agrees not to assert any moral
+ rights over the Database and waives all claims in moral rights to the
+ fullest extent possible by the law of the relevant jurisdiction under
+ Section 10.4; and
+
+ c. For jurisdictions not allowing waiver or an agreement not to assert
+ moral rights under Section 5.1 a and b, the author may retain their
+ moral rights over certain aspects of the Database.
+
+Please note that some jurisdictions do not allow for the waiver of moral
+rights, and so moral rights may still subsist over the Database in some
+jurisdictions.
+
+### 6.0 Fair dealing, Database exceptions, and other rights not affected
+
+6.1 This License does not affect any rights that You or anyone else may
+independently have under any applicable law to make any use of this
+Database, including without limitation:
+
+ a. Exceptions to the Database Right including: Extraction of Contents
+ from non-electronic Databases for private purposes, Extraction for
+ purposes of illustration for teaching or scientific research, and
+ Extraction or Re-utilisation for public security or an administrative
+ or judicial procedure.
+
+ b. Fair dealing, fair use, or any other legally recognised limitation
+ or exception to infringement of copyright or other applicable laws.
+
+6.2 This License does not affect any rights of lawful users to Extract
+and Re-utilise insubstantial parts of the Contents, evaluated
+quantitatively or qualitatively, for any purposes whatsoever, including
+creating a Derivative Database (subject to other rights over the
+Contents, see Section 2.4). The repeated and systematic Extraction or
+Re-utilisation of insubstantial parts of the Contents may however amount
+to the Extraction or Re-utilisation of a Substantial part of the
+Contents.
+
+### 7.0 Warranties and Disclaimer
+
+7.1 The Database is licensed by the Licensor "as is" and without any
+warranty of any kind, either express, implied, or arising by statute,
+custom, course of dealing, or trade usage. Licensor specifically
+disclaims any and all implied warranties or conditions of title,
+non-infringement, accuracy or completeness, the presence or absence of
+errors, fitness for a particular purpose, merchantability, or otherwise.
+Some jurisdictions do not allow the exclusion of implied warranties, so
+this exclusion may not apply to You.
+
+### 8.0 Limitation of liability
+
+8.1 Subject to any liability that may not be excluded or limited by law,
+the Licensor is not liable for, and expressly excludes, all liability
+for loss or damage however and whenever caused to anyone by any use
+under this License, whether by You or by anyone else, and whether caused
+by any fault on the part of the Licensor or not. This exclusion of
+liability includes, but is not limited to, any special, incidental,
+consequential, punitive, or exemplary damages such as loss of revenue,
+data, anticipated profits, and lost business. This exclusion applies
+even if the Licensor has been advised of the possibility of such
+damages.
+
+8.2 If liability may not be excluded by law, it is limited to actual and
+direct financial loss to the extent it is caused by proved negligence on
+the part of the Licensor.
+
+### 9.0 Termination of Your rights under this License
+
+9.1 Any breach by You of the terms and conditions of this License
+automatically terminates this License with immediate effect and without
+notice to You. For the avoidance of doubt, Persons who have received the
+Database, the whole or a Substantial part of the Contents, Derivative
+Databases, or the Database as part of a Collective Database from You
+under this License will not have their licenses terminated provided
+their use is in full compliance with this License or a license granted
+under Section 4.8 of this License. Sections 1, 2, 7, 8, 9 and 10 will
+survive any termination of this License.
+
+9.2 If You are not in breach of the terms of this License, the Licensor
+will not terminate Your rights under it.
+
+9.3 Unless terminated under Section 9.1, this License is granted to You
+for the duration of applicable rights in the Database.
+
+9.4 Reinstatement of rights. If you cease any breach of the terms and
+conditions of this License, then your full rights under this License
+will be reinstated:
+
+ a. Provisionally and subject to permanent termination until the 60th
+ day after cessation of breach;
+
+ b. Permanently on the 60th day after cessation of breach unless
+ otherwise reasonably notified by the Licensor; or
+
+ c. Permanently if reasonably notified by the Licensor of the
+ violation, this is the first time You have received notice of
+ violation of this License from the Licensor, and You cure the
+ violation prior to 30 days after your receipt of the notice.
+
+Persons subject to permanent termination of rights are not eligible to
+be a recipient and receive a license under Section 4.8.
+
+9.5 Notwithstanding the above, Licensor reserves the right to release
+the Database under different license terms or to stop distributing or
+making available the Database. Releasing the Database under different
+license terms or stopping the distribution of the Database will not
+withdraw this License (or any other license that has been, or is
+required to be, granted under the terms of this License), and this
+License will continue in full force and effect unless terminated as
+stated above.
+
+### 10.0 General
+
+10.1 If any provision of this License is held to be invalid or
+unenforceable, that must not affect the validity or enforceability of
+the remainder of the terms and conditions of this License and each
+remaining provision of this License shall be valid and enforced to the
+fullest extent permitted by law.
+
+10.2 This License is the entire agreement between the parties with
+respect to the rights granted here over the Database. It replaces any
+earlier understandings, agreements or representations with respect to
+the Database.
+
+10.3 If You are in breach of the terms of this License, You will not be
+entitled to rely on the terms of this License or to complain of any
+breach by the Licensor.
+
+10.4 Choice of law. This License takes effect in and will be governed by
+the laws of the relevant jurisdiction in which the License terms are
+sought to be enforced. If the standard suite of rights granted under
+applicable copyright law and Database Rights in the relevant
+jurisdiction includes additional rights not granted under this License,
+these additional rights are granted in this License in order to meet the
+terms of this License.
+
+
diff --git a/poky/meta/files/common-licenses/OFL-1.1 b/poky/meta/files/common-licenses/OFL-1.1
new file mode 100644
index 000000000..e644bce64
--- /dev/null
+++ b/poky/meta/files/common-licenses/OFL-1.1
@@ -0,0 +1,88 @@
+
+SIL OPEN FONT LICENSE
+
+Version 1.1 - 26 February 2007
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/OGTSL b/poky/meta/files/common-licenses/OGTSL
new file mode 100644
index 000000000..8a0cad7e0
--- /dev/null
+++ b/poky/meta/files/common-licenses/OGTSL
@@ -0,0 +1,120 @@
+
+The Open Group Test Suite License
+
+Preamble
+
+The intent of this document is to state the conditions under which
+a Package may be copied, such that the Copyright Holder maintains
+some semblance of artistic control over the development of the
+package, while giving the users of the package the right to use and
+distribute the Package in a more-or-less customary fashion, plus
+the right to make reasonable modifications.
+
+Testing is essential for proper development and maintenance of
+standards-based products.
+
+For buyers: adequate conformance testing leads to reduced
+integration costs and protection of investments in applications,
+software and people.
+
+For software developers: conformance testing of platforms and
+middleware greatly reduces the cost of developing and maintaining
+multi-platform application software.
+
+For suppliers: In-depth testing increases customer satisfaction and
+keeps development and support costs in check. API conformance is
+highly measurable and suppliers who claim it must be able to
+substantiate that claim.
+
+As such, since these are benchmark measures of conformance, we feel
+the integrity of test tools is of importance. In order to preserve
+the integrity of the existing conformance modes of this test
+package and to permit recipients of modified versions of this
+package to run the original test modes, this license requires that
+the original test modes be preserved.
+
+If you find a bug in one of the standards mode test cases, please
+let us know so we can feed this back into the original, and also
+raise any specification issues with the appropriate bodies (for
+example the POSIX committees).
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder.
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package. "You" is you, if you`re thinking
+ about copying or distributing this Package.
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people
+ involved, and so on. (You will not be required to justify it
+ to the Copyright Holder, but only to the computing community
+ at large as a market that must bear the fee.)
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the
+ item. It also means that recipients of the item may
+ redistribute it under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of
+the Standard Version of this Package without restriction, provided
+that you duplicate all of the original copyright notices and
+associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other
+modifications derived from the Public Domain or from the Copyright
+Holder. A Package modified in such a way shall still be considered
+the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way,
+provided that you insert a prominent notice in each changed file
+stating how and when you changed that file, and provided that you
+do at least the following:
+
+ rename any non-standard executables and testcases so the
+ names do not conflict with standard executables and
+ testcases, which must also be provided, and provide a
+ separate manual page for each non-standard executable and
+ testcase that clearly documents how it differs from the
+ Standard Version.
+
+4. You may distribute the programs of this Package in object code
+or executable form, provided that you do at least the following:
+
+ accompany any non-standard executables and testcases with
+ their corresponding Standard Version executables and
+ testcases, giving the non-standard executables and
+ testcases non-standard names, and clearly documenting the
+ differences in manual pages (or equivalent), together with
+ instructions on where to get the Standard Version.
+
+5. You may charge a reasonable copying fee for any distribution of
+this Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial)
+software distribution provided that you do not advertise this
+Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced
+as output from the programs of this Package do not automatically
+fall under the copyright of this Package, but belong to whomever
+generated them, and may be sold commercially, and may be aggregated
+with this Package.
+
+7.Subroutines supplied by you and linked into this Package shall
+not be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or
+promote products derived from this software without specific prior
+written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
diff --git a/poky/meta/files/common-licenses/OLDAP-2.8 b/poky/meta/files/common-licenses/OLDAP-2.8
new file mode 100644
index 000000000..be253da41
--- /dev/null
+++ b/poky/meta/files/common-licenses/OLDAP-2.8
@@ -0,0 +1,49 @@
+
+The OpenLDAP Public License
+ Version 2.8, 17 August 2003
+
+Redistribution and use of this software and associated documentation
+("Software"), with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions in source form must retain copyright statements
+ and notices,
+
+2. Redistributions in binary form must reproduce applicable copyright
+ statements and notices, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution, and
+
+3. Redistributions must contain a verbatim copy of this document.
+
+The OpenLDAP Foundation may revise this license from time to time.
+Each revision is distinguished by a version number. You may use
+this Software under terms of this license revision or under the
+terms of any subsequent revision of the license.
+
+THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
+CONTRIBUTORS ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
+OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+The names of the authors and copyright holders must not be used in
+advertising or otherwise to promote the sale, use or other dealing
+in this Software without specific, written prior permission. Title
+to copyright in this Software shall at all times remain with copyright
+holders.
+
+OpenLDAP is a registered trademark of the OpenLDAP Foundation.
+
+Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
+California, USA. All Rights Reserved. Permission to copy and
+distribute verbatim copies of this document is granted.
+
diff --git a/poky/meta/files/common-licenses/OSL-1.0 b/poky/meta/files/common-licenses/OSL-1.0
new file mode 100644
index 000000000..85ad0dadb
--- /dev/null
+++ b/poky/meta/files/common-licenses/OSL-1.0
@@ -0,0 +1,164 @@
+
+The Open Software License
+v. 1.0
+
+This Open Software License (the "License") applies to any original
+work of authorship (the "Original Work") whose owner (the "Licensor")
+has placed the following notice immediately following the copyright
+notice for the Original Work: "Licensed under the Open Software
+License version 1.0"
+
+License Terms
+
+1) Grant of Copyright License. Licensor hereby grants You a
+world-wide, royalty-free, non-exclusive, perpetual, non-sublicenseable
+license to do the following:
+
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the
+Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works
+to the public, with the proviso that copies of Original Work or
+Derivative Works that You distribute shall be licensed under the
+Open Software License;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, non-sublicenseable license,
+under patent claims owned or controlled by the Licensor that are
+embodied in the Original Work as furnished by the Licensor ("Licensed
+Claims") to make, use, sell and offer for sale the Original Work.
+Licensor hereby grants You a world-wide, royalty-free, non-exclusive,
+perpetual, non-sublicenseable license under the Licensed Claims to
+make, use, sell and offer for sale Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the
+preferred form of the Original Work for making modifications to it and
+all available documentation describing how to access and modify the
+Original Work. Licensor hereby agrees to provide a machine-readable
+copy of the Source Code of the Original Work along with each copy of
+the Original Work that Licensor distributes. Licensor reserves the
+right to satisfy this obligation by placing a machine-readable copy of
+the Source Code in an information repository reasonably calculated to
+permit inexpensive and convenient access by You for as long as
+Licensor continues to distribute the Original Work, and by publishing
+the address of that information repository in a notice immediately
+following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Nothing in this License shall be
+deemed to grant any rights to trademarks, copyrights, patents, trade
+secrets or any other intellectual property of Licensor except as
+expressly stated herein. No patent license is granted to make, use,
+sell or offer to sell embodiments of any patent claims other than the
+Licensed Claims defined in Section 2. No right is granted to the
+trademarks of Licensor even if such marks are included in the Original
+Work. Nothing in this License shall be interpreted to prohibit
+Licensor from licensing under different terms from this License any
+Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use
+or distribution of the Original Work or Derivative Works in any way
+such that the Original Work or Derivative Works may be accessed or
+used by anyone other than You, whether the Original Work or Derivative
+Works are distributed to those persons, made available as an
+application intended for use over a computer network, or used to
+provide services or otherwise deliver content to anyone other than
+You. As an express condition for the grants of license hereunder, You
+agree that any External Deployment by You shall be deemed a
+distribution and shall be licensed to all under the terms of this
+License, as prescribed in section 1(c) herein.
+
+6) Warranty and Disclaimer of Warranty. LICENSOR WARRANTS THAT THE
+COPYRIGHT IN AND TO THE ORIGINAL WORK IS OWNED BY THE LICENSOR OR THAT
+THE ORIGINAL WORK IS DISTRIBUTED BY LICENSOR UNDER A VALID CURRENT
+LICENSE FROM THE COPYRIGHT OWNER. EXCEPT AS EXPRESSLY STATED IN THE
+IMMEDIATELY PRECEEDING SENTENCE, THE ORIGINAL WORK IS PROVIDED UNDER
+THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY, EITHER EXPRESS OR
+IMPLIED, INCLUDING, WITHOUT LIMITATION, THE WARRANTY OF
+NON-INFRINGEMENT AND WARRANTIES THAT THE ORIGINAL WORK IS MERCHANTABLE
+OR FIT FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF
+THE ORIGINAL WORK IS WITH YOU. THIS DISCLAIMER OF WARRANTY CONSTITUTES
+AN ESSENTIAL PART OF THIS LICENSE. NO LICENSE TO ORIGINAL WORK IS
+GRANTED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+7) Limitation of Liability. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
+THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE,
+SHALL THE LICENSOR BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING
+AS A RESULT OF THIS LICENSE OR THE USE OF THE ORIGINAL WORK INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL
+DAMAGES OR LOSSES, EVEN IF SUCH PERSON SHALL HAVE BEEN INFORMED OF THE
+POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT
+APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
+AND LIMITATION MAY NOT APPLY TO YOU.
+
+8) Acceptance and Termination. Nothing else but this License (or
+another written agreement between Licensor and You) grants You
+permission to create Derivative Works based upon the Original Work,
+and any attempt to do so except under the terms of this License (or
+another written agreement between Licensor and You) is expressly
+prohibited by U.S. copyright law, the equivalent laws of other
+countries, and by international treaty. Therefore, by exercising any
+of the rights granted to You in Sections 1 and 2 herein, You indicate
+Your acceptance of this License and all of its terms and conditions.
+This license shall terminate immediately and you may no longer
+exercise any of the rights granted to You by this License upon Your
+failure to honor the proviso in Section 1(c) herein.
+
+9) Mutual Termination for Patent Action. This License shall terminate
+automatically and You may no longer exercise any of the rights granted
+to You by this License if You file a lawsuit in any court alleging
+that any OSI Certified open source software that is licensed under any
+license containing this "Mutual Termination for Patent Action" clause
+infringes any patent claims that are essential to use that software.
+
+10) Jurisdiction, Venue and Governing Law. You agree that any lawsuit
+arising under or relating to this License shall be maintained in the
+courts of the jurisdiction wherein the Licensor resides or in which
+Licensor conducts its primary business, and under the laws of that
+jurisdiction excluding its conflict-of-law provisions. The application
+of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any use of the Original Work
+outside the scope of this License or after its termination shall be
+subject to the requirements and penalties of the U.S. Copyright Act,
+17 U.S.C. &#167; 101 et seq., the equivalent laws of other countries, and
+international treaty. This section shall survive the termination of
+this License.
+
+11) Attorneys Fees. In any action to enforce the terms of this License
+or seeking damages relating thereto, the prevailing party shall be
+entitled to recover its costs and expenses, including, without
+limitation, reasonable attorneys` fees and costs incurred in
+connection with such action, including any appeal of such action. This
+section shall survive the termination of this License.
+
+12) Miscellaneous. This License represents the complete agreement
+concerning the subject matter hereof. If any provision of this License
+is held to be unenforceable, such provision shall be reformed only to
+the extent necessary to make it enforceable.
+
+13) Definition of "You" in This License. "You" throughout this
+License, whether in upper or lower case, means an individual or a
+legal entity exercising rights under, and complying with all of the
+terms of, this License. For legal entities, "You" includes any entity
+that controls, is controlled by, or is under common control with you.
+For purposes of this definition, "control" means (i) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent
+(50%) or more of the outstanding shares, or (iii) beneficial ownership
+of such entity.
+
+This license is Copyright (C) 2002 Lawrence E. Rosen. All rights
+reserved. Permission is hereby granted to copy and distribute this
+license without modification. This license may not be modified without
+the express written permission of its copyright owner.
+
diff --git a/poky/meta/files/common-licenses/OSL-2.0 b/poky/meta/files/common-licenses/OSL-2.0
new file mode 100644
index 000000000..9fe5c9eda
--- /dev/null
+++ b/poky/meta/files/common-licenses/OSL-2.0
@@ -0,0 +1,48 @@
+
+Open Software License
+v. 2.0
+
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+
+Licensed under the Open Software License version 2.0
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+
+a) to reproduce the Original Work in copies;
+b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute shall be licensed under the Open Software License;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use or distribution of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether the Original Work or Derivative Works are distributed to those persons or made available as an application intended for use over a computer network. As an express condition for the grants of license hereunder, You agree that any External Deployment by You of a Derivative Work shall be deemed a distribution and shall be licensed to all under the terms of this License, as prescribed in section 1(c) herein.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions. This License shall terminate immediately and you may no longer exercise any of the rights granted to You by this License upon Your failure to honor the proviso in Section 1(c) herein.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, for patent infringement (i) against Licensor with respect to a patent applicable to software or (ii) against any entity with respect to a patent applicable to the Original Work (but excluding combinations of the Original Work with other software or hardware).
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
+
diff --git a/poky/meta/files/common-licenses/OSL-3.0 b/poky/meta/files/common-licenses/OSL-3.0
new file mode 100644
index 000000000..1557749e7
--- /dev/null
+++ b/poky/meta/files/common-licenses/OSL-3.0
@@ -0,0 +1,27 @@
+
+Open Software License (&#8220;OSL&#8221;) v. 3.0
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+Licensed under the Open Software License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
+d) to perform the Original Work publicly; and
+e) to display the Original Work publicly.
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor&#8217;s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including &#8220;fair use&#8221; or &#8220;fair dealing&#8221;). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+12) Attorneys&#8217; Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
diff --git a/poky/meta/files/common-licenses/OpenSSL b/poky/meta/files/common-licenses/OpenSSL
new file mode 100644
index 000000000..d4270a332
--- /dev/null
+++ b/poky/meta/files/common-licenses/OpenSSL
@@ -0,0 +1,107 @@
+
+OpenSSL License
+
+ ====================================================================
+ Copyright (c) 1998-2008 The OpenSSL Project. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. All advertising materials mentioning features or use of this
+ software must display the following acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+
+ 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ endorse or promote products derived from this software without
+ prior written permission. For written permission, please contact
+ openssl-core@openssl.org.
+
+ 5. Products derived from this software may not be called "OpenSSL"
+ nor may "OpenSSL" appear in their names without prior written
+ permission of the OpenSSL Project.
+
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes software developed by the OpenSSL Project
+ for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+
+ THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS`` AND ANY
+ EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+ ====================================================================
+
+ This product includes cryptographic software written by Eric Young
+ (eay@cryptsoft.com). This product includes software written by Tim
+ Hudson (tjh@cryptsoft.com).
+
+
+ Original SSLeay License
+ -----------------------
+
+Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+All rights reserved.
+
+ This package is an SSL implementation written
+ by Eric Young (eay@cryptsoft.com).
+ The implementation was written so as to conform with Netscapes SSL.
+
+ This library is free for commercial and non-commercial use as long as
+ the following conditions are aheared to. The following conditions
+ apply to all code found in this distribution, be it the RC4, RSA,
+ lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ included with this distribution is covered by the same copyright terms
+ except that the holder is Tim Hudson (tjh@cryptsoft.com).
+
+ Copyright remains Eric Young`s, and as such any Copyright notices in
+ the code are not to be removed.
+ If this package is used in a product, Eric Young should be given attribution
+ as the author of the parts of the library used.
+ This can be in the form of a textual message at program startup or
+ in documentation (online or textual) provided with the package.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ "This product includes cryptographic software written by
+ Eric Young (eay@cryptsoft.com)"
+ The word `cryptographic` can be left out if the rouines from the library
+ being used are not cryptographic related :-).
+ 4. If you include any Windows specific code (or a derivative thereof) from
+ the apps directory (application code) you must include an acknowledgement:
+ "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+
+ THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ The licence and distribution terms for any publically available version or derivative of this code cannot be changed. i.e. this code cannot simply be copied and put under another distribution licence
+ [including the GNU Public Licence.]
+
+
+
+
diff --git a/poky/meta/files/common-licenses/PD b/poky/meta/files/common-licenses/PD
new file mode 100644
index 000000000..21fb878e6
--- /dev/null
+++ b/poky/meta/files/common-licenses/PD
@@ -0,0 +1 @@
+This is a placeholder for the Public Domain License
diff --git a/poky/meta/files/common-licenses/PHP-3.0 b/poky/meta/files/common-licenses/PHP-3.0
new file mode 100644
index 000000000..ef0b20306
--- /dev/null
+++ b/poky/meta/files/common-licenses/PHP-3.0
@@ -0,0 +1,70 @@
+
+--------------------------------------------------------------------
+ The PHP License, version 3.01
+Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
+--------------------------------------------------------------------
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The name "PHP" must not be used to endorse or promote products
+ derived from this software without prior written permission. For
+ written permission, please contact group@php.net.
+
+ 4. Products derived from this software may not be called "PHP", nor
+ may "PHP" appear in their name, without prior written permission
+ from group@php.net. You may indicate that your software works in
+ conjunction with PHP by saying "Foo for PHP" instead of calling
+ it "PHP Foo" or "phpfoo"
+
+ 5. The PHP Group may publish revised and/or new versions of the
+ license from time to time. Each version will be given a
+ distinguishing version number.
+ Once covered code has been published under a particular version
+ of the license, you may always continue to use it under the terms
+ of that version. You may also choose to use such covered code
+ under the terms of any subsequent version of the license
+ published by the PHP Group. No one other than the PHP Group has
+ the right to modify the terms applicable to covered code created
+ under this License.
+
+ 6. Redistributions of any form whatsoever must retain the following
+ acknowledgment:
+ "This product includes PHP software, freely available from
+ <http://www.php.net/software/>".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS`` AND
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+--------------------------------------------------------------------
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group@php.net.
+
+For more information on the PHP Group and the PHP project,
+please see <http://www.php.net>.
+
+PHP includes the Zend Engine, freely available at
+<http://www.zend.com>.
+
diff --git a/poky/meta/files/common-licenses/ParaTypeFFL-1.3 b/poky/meta/files/common-licenses/ParaTypeFFL-1.3
new file mode 100644
index 000000000..8357965be
--- /dev/null
+++ b/poky/meta/files/common-licenses/ParaTypeFFL-1.3
@@ -0,0 +1,44 @@
+ParaType Free Font Licensing Agreement
+
+Copyright (c) 2009, ParaType Ltd. All Rights Reserved.
+
+LICENSING AGREEMENT
+for the fonts with Original Name: PT Sans, PT Serif, PT Mono
+Version 1.3 - January 20, 2012
+
+GRANT OF LICENSE
+ParaType Ltd grants you the right to use, copy, modify the fonts and
+distribute modified and unmodified copies of the fonts by any means,
+including placing on Web servers for free downloading, embedding in
+documents and Web pages, bundling with commercial and non commercial
+products, if it does not conflict with the conditions listed below:
+
+- You may bundle the fonts with commercial software, but you may not
+sell the fonts by themselves. They are free.
+
+- You may distribute the fonts in modified or unmodified versions only
+together with this Licensing Agreement and with above copyright notice.
+You have no right to modify the text of Licensing Agreement. It can be
+placed in a separate text file or inserted into the font file, but it
+must be easily viewed by users.
+
+- You may not distribute modified version of the font under the Original
+name or a combination of Original name with any other words without
+explicit written permission from ParaType.
+
+TERMINATION & TERRITORY
+This license has no limits on time and territory, but it becomes null
+and void if any of the above conditions are not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+PARATYPE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
+ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
+OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS
+IN THE FONT SOFTWARE.
+
+ParaType Ltd
diff --git a/poky/meta/files/common-licenses/PostgreSQL b/poky/meta/files/common-licenses/PostgreSQL
new file mode 100644
index 000000000..ae658dc12
--- /dev/null
+++ b/poky/meta/files/common-licenses/PostgreSQL
@@ -0,0 +1,14 @@
+
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2010, The PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
diff --git a/poky/meta/files/common-licenses/Proprietary b/poky/meta/files/common-licenses/Proprietary
new file mode 100644
index 000000000..661875810
--- /dev/null
+++ b/poky/meta/files/common-licenses/Proprietary
@@ -0,0 +1 @@
+Proprietary license.
diff --git a/poky/meta/files/common-licenses/Python-2.0 b/poky/meta/files/common-licenses/Python-2.0
new file mode 100644
index 000000000..9d3e86215
--- /dev/null
+++ b/poky/meta/files/common-licenses/Python-2.0
@@ -0,0 +1,192 @@
+
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+alone or in any derivative version, provided, however, that PSF`s
+License Agreement and PSF`s notice of copyright, i.e., "Copyright (c)
+2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
+Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee. This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+-------------------------------------------
+
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
+
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization ("Licensee") accessing and otherwise using
+this software in source or binary form and its associated
+documentation ("the Software").
+
+2. Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+3. BeOpen is making the Software available to Licensee on an "AS IS"
+basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+5. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+6. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions. Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee. This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party. As an exception, the "BeOpen Python" logos available at
+http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+7. By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
+---------------------------------------
+
+1. This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 ("CNRI"), and the Individual or Organization
+("Licensee") accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI`s
+License Agreement and CNRI`s notice of copyright, i.e., "Copyright (c)
+1995-2001 Corporation for National Research Initiatives; All Rights
+Reserved" are retained in Python 1.6.1 alone or in any derivative
+version prepared by Licensee. Alternately, in lieu of CNRI`s License
+Agreement, Licensee may substitute the following text (omitting the
+quotes): "Python 1.6.1 is made available subject to the terms and
+conditions in CNRI`s License Agreement. This Agreement together with
+Python 1.6.1 may be located on the Internet using the following
+unique, persistent identifier (known as a handle): 1895.22/1013. This
+Agreement may also be obtained from a proxy server on the Internet
+using the following URL: http://hdl.handle.net/1895.22/1013".
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
+basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia`s conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee. This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+8. By clicking on the "ACCEPT" button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+
+ACCEPT
+
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+--------------------------------------------------
+
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
+The Netherlands. All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/poky/meta/files/common-licenses/QPL-1.0 b/poky/meta/files/common-licenses/QPL-1.0
new file mode 100644
index 000000000..7d433ab26
--- /dev/null
+++ b/poky/meta/files/common-licenses/QPL-1.0
@@ -0,0 +1,48 @@
+
+THE Q PUBLIC LICENSE version 1.0
+
+Copyright (C) 1999-2005 Trolltech AS, Norway.
+Everyone is permitted to copy and distribute this license document.
+The intent of this license is to establish freedom to share and change the software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the copyright holder saying that it may be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as the Software. This license covers modification and distribution of the Software, use of third-party application programs based on the Software, and development of free software which uses the Software.
+
+Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any and all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license.
+
+2. You may copy and distribute the Software in unmodified form provided that the entire package, including - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial developer of the Software, is distributed.
+
+3. You may make modifications to the Software and distribute your modifications, in a form that is separate from the Software, such as patches. The following restrictions apply to modifications:
+
+a. Modifications must not alter or remove any copyright notices in the Software.
+b. When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted to the initial developer of the Software to distribute your modification in future versions of the Software provided such versions remain available under these terms in addition to any other license(s) of the initial developer.
+
+4. You may distribute machine-executable forms of the Software or machine-executable forms of modified versions of the Software, provided that you meet these restrictions:
+
+a. You must include this license document in the distribution.
+b. You must ensure that all recipients of the machine-executable forms are also able to receive the complete machine-readable source code to the distributed Software, including all modifications, without any charge beyond the costs of data transfer, and place prominent notices in the distribution explaining this.
+
+c. You must ensure that all modifications included in the machine-executable forms are available under the terms of this license.
+
+5. You may use the original or modified versions of the Software to compile, link and run application programs legally developed by you or by others.
+
+6. You may develop application programs, reusable components and other software items that link with the original or modified versions of the Software. These items, when distributed, are subject to the following requirements:
+
+a. You must ensure that all recipients of machine-executable forms of these items are also able to receive and use the complete machine-readable source code to the items without any charge beyond the costs of data transfer.
+b. You must explicitly license all recipients of your items to use and re-distribute original and modified versions of the items in both machine-executable and source code forms. The recipients must be able to do so without any charges whatsoever, and they must be able to re-distribute to anyone they choose.
+
+c. If the items are not available to the general public, and the initial developer of the Software requests a copy of the items, then you must supply one.
+
+Limitations of Liability
+
+In no event shall the initial developers or copyright holders be liable for any damages whatsoever, including - but not restricted to - lost revenue or profits or other direct, indirect, special, incidental or consequential damages, even if they have been advised of the possibility of such damages, except to the extent invariable law, if any, provides otherwise.
+
+No Warranty
+
+The Software and this license document are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+Choice of Law
+
+This license is governed by the Laws of Norway. Disputes shall be settled by Oslo City Court.
+
diff --git a/poky/meta/files/common-licenses/RHeCos-1 b/poky/meta/files/common-licenses/RHeCos-1
new file mode 100644
index 000000000..2ab40b77d
--- /dev/null
+++ b/poky/meta/files/common-licenses/RHeCos-1
@@ -0,0 +1,401 @@
+
+Red Hat eCos Public License v1.1
+
+1. DEFINITIONS
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications made by
+that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case including
+portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic transfer of
+data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified as
+the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous
+Modifications.
+
+1.10. "Original Code" means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as Original
+Code, and which, at the time of its release under this License is not already
+Covered Code governed by this License.
+
+1.11. "Source Code" means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus any
+associated interface definition files, scripts used to control compilation and
+installation of an Executable, or a list of source code differential
+comparisons against either the Original Code or another well known, available
+Covered Code of the Contributor's choice. The Source Code can be in a
+compressed or archival form, provided the appropriate decompression or de-
+archiving software is widely available for no charge.
+
+1.12. "You" means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License or a future version
+of this License issued under Section 6.1. For legal entities, "You"
+includes any entity which controls, is controlled by, or is under common
+control with You. For purposes of this definition, "control" means
+(a) the power, direct or indirect, to cause the direction or management of such
+entity, whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+1.13. "Red Hat Branded Code" is code that Red Hat distributes and/or
+permits others to distribute under different terms than the Red Hat eCos Public
+License. Red Hat's Branded Code may contain part or all of the Covered Code.
+
+2. SOURCE CODE LICENSE
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the
+Original Code (or portions thereof) with or without Modifications, or as part
+of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to
+make, have made, use and sell ("Utilize") the Original Code (or
+portions thereof), but solely to the extent that any such patent is reasonably
+necessary to enable You to Utilize the Original Code (or portions thereof) and
+not to any greater extent that may be necessary to Utilize further
+Modifications or combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive
+license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the
+Modifications created by such Contributor (or portions thereof) either on an
+unmodified basis, with other Modifications, as Covered Code or as part of a
+Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to
+Utilize the Contributor Version (or portions thereof), but solely to the extent
+that any such patent is reasonably necessary to enable You to Utilize the
+Contributor Version (or portions thereof), and not to any greater extent that
+may be necessary to Utilize further Modifications or combinations.
+
+3. DISTRIBUTION OBLIGATIONS
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made
+available in Source Code form under the terms of this License via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an Executable
+version available and to the Initial Developer; and if made available via
+Electronic Distribution Mechanism, must remain available for at least twelve
+(12) months after the date it initially became available, or at least six (6)
+months after a subsequent version of that particular Modification has been made
+available to such recipients. You are responsible for ensuring that the Source
+Code version remains available even if the Electronic Distribution Mechanism is
+maintained by a third party. You are responsible for notifying the Initial
+Developer of the Modification and the location of the Source if a contact means
+is provided. Red Hat will be acting as maintainer of the Source and may provide
+an Electronic Distribution mechanism for the Modification to be made available.
+You can contact Red Hat to make the Modification available and to notify the
+Initial Developer. (http://sourceware.cygnus.com/ecos/)
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+(a) Third Party Claims.
+If You have knowledge that a party claims an intellectual property right in
+particular functionality or code (or its utilization under this License), you
+must include a text file with the source code distribution titled
+"LEGAL" which describes the claim and the party making the claim in
+sufficient detail that a recipient will know whom to contact. If you obtain
+such knowledge after You make Your Modification available as described in
+Section 3.2, You shall promptly modify the LEGAL file in all copies You make
+available thereafter and shall take other steps (such as notifying appropriate
+mailing lists or newsgroups) reasonably calculated to inform those who received
+the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+If Your Modification is an application programming interface and You own or
+control patents which are reasonably necessary to implement that API, you must
+also include this information in the LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code, and
+this License in any documentation for the Source Code, where You describe
+recipients' rights relating to Covered Code. If You created one or more
+Modification(s), You may add your name as a Contributor to the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then you must include such notice in a location (such as a
+relevant directory file) where a user would be likely to look for such a
+notice. You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered Code.
+
+However, You may do so only on Your own behalf, and not on behalf of the
+Initial Developer or any Contributor. You must make it absolutely clear that
+any such warranty, support, indemnity or liability obligation is offered by You
+alone, and You hereby agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial Developer or such
+Contributor as a result of warranty, support, indemnity or liability terms You
+offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code, and if You include a
+notice stating that the Source Code version of the Covered Code is available
+under the terms of this License, including a description of how and where You
+have fulfilled the obligations of Section 3.2. The notice must be conspicuously
+included in any notice in an Executable version, related documentation or
+collateral in which You describe recipients' rights relating to the Covered
+Code. You may distribute the Executable version of Covered Code under a license
+of Your choice, which may contain terms different from this License, provided
+that You are in compliance with the terms of this License and that the license
+for the Executable version does not attempt to limit or alter the recipient's
+rights in the Source Code version from the rights set forth in this License. If
+You distribute the Executable version under a different license You must make
+it absolutely clear that any terms which differ from this License are offered
+by You alone, not by the Initial Developer or any Contributor. You hereby agree
+to indemnify the Initial Developer and every Contributor for any liability
+incurred by the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+If you distribute executable versions containing Covered Code, you must
+reproduce the notice in Exhibit B in the documentation and/or other materials
+provided with the product.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION
+
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute or regulation
+then You must: (a) comply with the terms of this License to the maximum extent
+possible; (b) cite the statute or regulation that prohibits you from adhering
+to the license; and (c) describe the limitations and the code they affect. Such
+description must be included in the LEGAL file described in Section 3.4 and
+must be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it. You must submit this LEGAL file to Red Hat for review, and You
+will not be able use the covered code in any means until permission is granted
+from Red Hat to allow for the inability to comply due to statute or regulation.
+
+5. APPLICATION OF THIS LICENSE
+
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A, and to related Covered Code.
+
+Red Hat may include Covered Code in products without such additional products
+becoming subject to the terms of this License, and may license such additional
+products on different terms from those contained in this License.
+
+Red Hat may license the Source Code of Red Hat Branded Code without Red Hat
+Branded Code becoming subject to the terms of this License, and may license Red
+Hat Branded Code on different terms from those contained in this License.
+Contact Red Hat for details of alternate licensing terms available.
+
+6. VERSIONS OF THE LICENSE
+
+6.1. New Versions.
+Red Hat may publish revised and/or new versions of the License from time to
+time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License published by Red Hat. No one other than Red Hat has the right to
+modify the terms applicable to Covered Code beyond what is granted under this
+and subsequent Licenses.
+
+6.3. Derivative Works.
+If you create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), you must (a) rename Your license so that the phrases
+"ECOS", "eCos", "Red Hat", "RHEPL" or
+any confusingly similar phrase do not appear anywhere in your license and (b)
+otherwise make it clear that your version of the license contains terms which
+differ from the Red Hat eCos Public License. (Filling in the name of the
+Initial Developer, Original Code or Contributor in the notice described in
+Exhibit A shall not of themselves be deemed to be modifications of this
+License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION
+
+This License and the rights granted hereunder will terminate automatically if
+You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER
+CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH
+PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
+MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH
+PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS
+LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
+INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND
+LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS
+
+The Covered Code is a "commercial item," as that term is defined in
+48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" and "commercial computer software documentation," as
+such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
+12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
+Government End Users acquire Covered Code with only those rights set forth
+herein.
+
+11. MISCELLANEOUS
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by California law provisions
+(except to the extent applicable law, if any, provides otherwise), excluding
+its conflict-of-law provisions. With respect to disputes in which at least one
+party is a citizen of, or an entity chartered or registered to do business in,
+the United States of America: (a) unless otherwise agreed in writing, all
+disputes relating to this License (excepting any dispute relating to
+intellectual property rights) shall be subject to final and binding
+arbitration, with the losing party paying all costs of arbitration; (b) any
+arbitration relating to this Agreement shall be held in Santa Clara County,
+California, under the auspices of JAMS/EndDispute; and (c) any litigation
+relating to this Agreement shall be subject to the jurisdiction of the Federal
+Courts of the Northern District of California, with venue lying in Santa Clara
+County, California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys fees and expenses. The
+application of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any law or regulation which provides that
+the language of a contract shall be construed against the drafter shall not
+apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS
+
+Except in cases where another Contributor has failed to comply with Section
+3.4, You are responsible for damages arising, directly or indirectly, out of
+Your utilization of rights under this License, based on the number of copies of
+Covered Code you made available, the revenues you received from utilizing such
+rights, and other relevant factors. You agree to work with affected parties to
+distribute responsibility on an equitable basis.
+
+13. ADDITIONAL TERMS APPLICABLE TO THE RED HAT ECOS PUBLIC LICENSE
+
+Nothing in this License shall be interpreted to prohibit Red Hat from licensing
+under different terms than this License any code which Red Hat otherwise would
+have a right to license.
+
+Red Hat and logo - This License does not grant any rights to use the trademark
+Red Hat, the Red Hat logo, eCos logo, even if such marks are included in the
+Original Code. You may contact Red Hat for permission to display the Red Hat
+and eCos marks in either the documentation or the Executable version beyond
+that required in Exhibit B.
+
+Inability to Comply Due to Contractual Obligation - To the extent that Red Hat
+is limited contractually from making third party code available under this
+License, Red Hat may choose to integrate such third party code into Covered
+Code without being required to distribute such third party code in Source Code
+form, even if such third party code would otherwise be considered
+"Modifications" under this License.
+
+EXHIBIT A
+
+"The contents of this file are subject to the Red Hat eCos Public License
+Version 1.1 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at http://
+www.redhat.com/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the License.
+
+The Original Code is eCos - Embedded Configurable Operating System, released
+September 30, 1998. The Initial Developer of the Original Code is Red Hat.
+Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+All Rights Reserved."
+
+EXHIBIT B
+
+Part of the software embedded in this product is eCos - Embedded Configurable
+Operating System, a trademark of Red Hat. Portions created by Red Hat are
+Copyright (C) 1998, 1999, 2000 Red Hat, Inc. (http://www.redhat.com/). All
+Rights Reserved.
+
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY RED HAT AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+
+
+
+
+
+
diff --git a/poky/meta/files/common-licenses/RHeCos-1.1 b/poky/meta/files/common-licenses/RHeCos-1.1
new file mode 100644
index 000000000..f98900abf
--- /dev/null
+++ b/poky/meta/files/common-licenses/RHeCos-1.1
@@ -0,0 +1,151 @@
+
+Red Hat eCos Public License v1.1
+
+1. DEFINITIONS
+
+1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source Code.
+
+1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous Modifications.
+
+1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or a list of source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+1.13. "Red Hat Branded Code" is code that Red Hat distributes and/or permits others to distribute under different terms than the Red Hat eCos Public License. Red Hat`s Branded Code may contain part or all of the Covered Code.
+
+2. SOURCE CODE LICENSE
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell ("Utilize") the Original Code (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Original Code (or portions thereof) and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to Utilize the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Contributor Version (or portions thereof), and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+3. DISTRIBUTION OBLIGATIONS
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available and to the Initial Developer; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. You are responsible for notifying the Initial Developer of the Modification and the location of the Source if a contact means is provided. Red Hat will be acting as maintainer of the Source and may provide an Electronic Distribution mechanism for the Modification to be made available. You can contact Red Hat to make the Modification available and to notify the Initial Developer. (http://sourceware.cygnus.com/ecos/)
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+(a) Third Party Claims.
+If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Covered Code. If You created one or more Modification(s), You may add your name as a Contributor to the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code.
+
+However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+If you distribute executable versions containing Covered Code, you must reproduce the notice in Exhibit B in the documentation and/or other materials provided with the product.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; (b) cite the statute or regulation that prohibits you from adhering to the license; and (c) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. You must submit this LEGAL file to Red Hat for review, and You will not be able use the covered code in any means until permission is granted from Red Hat to allow for the inability to comply due to statute or regulation.
+
+5. APPLICATION OF THIS LICENSE
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A, and to related Covered Code.
+
+Red Hat may include Covered Code in products without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License.
+
+Red Hat may license the Source Code of Red Hat Branded Code without Red Hat Branded Code becoming subject to the terms of this License, and may license Red Hat Branded Code on different terms from those contained in this License. Contact Red Hat for details of alternate licensing terms available.
+
+6. VERSIONS OF THE LICENSE
+
+6.1. New Versions.
+Red Hat may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Red Hat. No one other than Red Hat has the right to modify the terms applicable to Covered Code beyond what is granted under this and subsequent Licenses.
+
+6.3. Derivative Works.
+If you create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), you must (a) rename Your license so that the phrases "ECOS", "eCos", "Red Hat", "RHEPL" or any confusingly similar phrase do not appear anywhere in your license and (b) otherwise make it clear that your version of the license contains terms which differ from the Red Hat eCos Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION
+
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS
+
+The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in, the United States of America: (a) unless otherwise agreed in writing, all disputes relating to this License (excepting any dispute relating to intellectual property rights) shall be subject to final and binding arbitration, with the losing party paying all costs of arbitration; (b) any arbitration relating to this Agreement shall be held in Santa Clara County, California, under the auspices of JAMS/EndDispute; and (c) any litigation relating to this Agreement shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS
+
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Covered Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+
+13. ADDITIONAL TERMS APPLICABLE TO THE RED HAT ECOS PUBLIC LICENSE
+
+Nothing in this License shall be interpreted to prohibit Red Hat from licensing under different terms than this License any code which Red Hat otherwise would have a right to license.
+
+Red Hat and logo - This License does not grant any rights to use the trademark Red Hat, the Red Hat logo, eCos logo, even if such marks are included in the Original Code. You may contact Red Hat for permission to display the Red Hat and eCos marks in either the documentation or the Executable version beyond that required in Exhibit B.
+
+Inability to Comply Due to Contractual Obligation - To the extent that Red Hat is limited contractually from making third party code available under this License, Red Hat may choose to integrate such third party code into Covered Code without being required to distribute such third party code in Source Code form, even if such third party code would otherwise be considered "Modifications" under this License.
+
+EXHIBIT A
+
+"The contents of this file are subject to the Red Hat eCos Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.redhat.com/
+
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+The Original Code is eCos - Embedded Configurable Operating System, released September 30, 1998. The Initial Developer of the Original Code is Red Hat. Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc. All Rights Reserved."
+
+EXHIBIT B
+
+Part of the software embedded in this product is eCos - Embedded Configurable Operating System, a trademark of Red Hat. Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc. (http://www.redhat.com/). All Rights Reserved.
+
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY RED HAT AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/RPL-1.5 b/poky/meta/files/common-licenses/RPL-1.5
new file mode 100644
index 000000000..21908751e
--- /dev/null
+++ b/poky/meta/files/common-licenses/RPL-1.5
@@ -0,0 +1,546 @@
+
+Reciprocal Public License 1.5 (RPL1.5)
+
+Reciprocal Public License (RPL)
+
+Version 1.5, July 15, 2007
+
+Copyright (C) 2001-2007
+Technical Pursuit Inc.,
+All Rights Reserved.
+
+PREAMBLE
+
+The Reciprocal Public License (RPL) is based on the concept of reciprocity or,
+if you prefer, fairness.
+
+In short, this license grew out of a desire to close loopholes in previous open
+source licenses, loopholes that allowed parties to acquire open source software
+and derive financial benefit from it without having to release their
+improvements or derivatives to the community which enabled them. This occurred
+any time an entity did not release their application to a "third party".
+
+While there is a certain freedom in this model of licensing, it struck the
+authors of the RPL as being unfair to the open source community at large and to
+the original authors of the works in particular. After all, bug fixes,
+extensions, and meaningful and valuable derivatives were not consistently
+finding their way back into the community where they could fuel further, and
+faster, growth and expansion of the overall open source software base.
+
+While you should clearly read and understand the entire license, the essence of
+the RPL is found in two definitions: "Deploy" and "Required Components".
+
+Regarding deployment, under the RPL your changes, bug fixes, extensions, etc.
+must be made available to the open source community at large when you Deploy in
+any form -- either internally or to an outside party. Once you start running
+the software you have to start sharing the software.
+
+Further, under the RPL all components you author including schemas, scripts,
+source code, etc. -- regardless of whether they`re compiled into a single
+binary or used as two halves of client/server application -- must be shared.
+You have to share the whole pie, not an isolated slice of it.
+
+In addition to these goals, the RPL was authored to meet the requirements of
+the Open Source Definition as maintained by the Open Source Initiative (OSI).
+
+The specific terms and conditions of the license are defined in the remainder
+of this document.
+
+LICENSE TERMS
+
+1.0 General; Applicability &amp; Definitions. This Reciprocal Public License
+Version 1.5 ("License") applies to any programs or other works as well as any
+and all updates or maintenance releases of said programs or works ("Software")
+not already covered by this License which the Software copyright holder
+("Licensor") makes available containing a License Notice (hereinafter defined)
+from the Licensor specifying or allowing use or distribution under the terms of
+this License. As used in this License:
+
+1.1 "Contributor" means any person or entity who created or contributed to the
+creation of an Extension.
+
+1.2 "Deploy" means to use, Serve, sublicense or distribute Licensed Software
+other than for Your internal Research and/or Personal Use, and includes
+without limitation, any and all internal use or distribution of Licensed
+Software within Your business or organization other than for Research and/or
+Personal Use, as well as direct or indirect sublicensing or distribution of
+Licensed Software by You to any third party in any form or manner.
+
+1.3 "Derivative Works" as used in this License is defined under U.S. copyright
+law.
+
+1.4 "Electronic Distribution Mechanism" means a mechanism generally accepted
+in the software development community for the electronic transfer of data such
+as download from an FTP server or web site, where such mechanism is publicly
+accessible.
+
+1.5 "Extensions" means any Modifications, Derivative Works, or Required
+Components as those terms are defined in this License.
+
+1.6 "License" means this Reciprocal Public License.
+
+1.7 "License Notice" means any notice contained in EXHIBIT A.
+
+1.8 "Licensed Software" means any Software licensed pursuant to this License.
+Licensed Software also includes all previous Extensions from any Contributor
+that You receive.
+
+1.9 "Licensor" means the copyright holder of any Software previously not
+covered by this License who releases the Software under the terms of this
+License.
+
+1.10 "Modifications" means any additions to or deletions from the substance or
+structure of (i) a file or other storage containing Licensed Software, or (ii)
+any new file or storage that contains any part of Licensed Software, or (iii)
+any file or storage which replaces or otherwise alters the original
+functionality of Licensed Software at runtime.
+
+1.11 "Personal Use" means use of Licensed Software by an individual solely for
+his or her personal, private and non-commercial purposes. An individual`s use
+of Licensed Software in his or her capacity as an officer, employee, member,
+independent contractor or agent of a corporation, business or organization
+(commercial or non-commercial) does not qualify as Personal Use.
+
+1.12 "Required Components" means any text, programs, scripts, schema,
+interface definitions, control files, or other works created by You which are
+required by a third party of average skill to successfully install and run
+Licensed Software containing Your Modifications, or to install and run Your
+Derivative Works.
+
+1.13 "Research" means investigation or experimentation for the purpose of
+understanding the nature and limits of the Licensed Software and its potential
+uses.
+
+1.14 "Serve" means to deliver Licensed Software and/or Your Extensions by
+means of a computer network to one or more computers for purposes of execution
+of Licensed Software and/or Your Extensions.
+
+1.15 "Software" means any computer programs or other works as well as any
+updates or maintenance releases of those programs or works which are
+distributed publicly by Licensor.
+
+1.16 "Source Code" means the preferred form for making modifications to the
+Licensed Software and/or Your Extensions, including all modules contained
+therein, plus any associated text, interface definition files, scripts used to
+control compilation and installation of an executable program or other
+components required by a third party of average skill to build a running
+version of the Licensed Software or Your Extensions.
+
+1.17 "User-Visible Attribution Notice" means any notice contained in EXHIBIT B.
+
+1.18 "You" or "Your" means an individual or a legal entity exercising rights
+under this License. For legal entities, "You" or "Your" includes any entity
+which controls, is controlled by, or is under common control with, You, where
+"control" means (a) the power, direct or indirect, to cause the direction or
+management of such entity, whether by contract or otherwise, or (b) ownership
+of fifty percent (50%) or more of the outstanding shares or beneficial
+ownership of such entity.
+
+2.0 Acceptance Of License. You are not required to accept this License since
+you have not signed it, however nothing else grants you permission to use,
+copy, distribute, modify, or create derivatives of either the Software or any
+Extensions created by a Contributor. These actions are prohibited by law if
+you do not accept this License. Therefore, by performing any of these actions
+You indicate Your acceptance of this License and Your agreement to be bound by
+all its terms and conditions. IF YOU DO NOT AGREE WITH ALL THE TERMS AND
+CONDITIONS OF THIS LICENSE DO NOT USE, MODIFY, CREATE DERIVATIVES, OR
+DISTRIBUTE THE SOFTWARE. IF IT IS IMPOSSIBLE FOR YOU TO COMPLY WITH ALL THE
+TERMS AND CONDITIONS OF THIS LICENSE THEN YOU CAN NOT USE, MODIFY, CREATE
+DERIVATIVES, OR DISTRIBUTE THE SOFTWARE.
+
+3.0 Grant of License From Licensor. Subject to the terms and conditions of
+this License, Licensor hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to Licensor`s intellectual property rights, and any
+third party intellectual property claims derived from the Licensed Software
+under this License, to do the following:
+
+3.1 Use, reproduce, modify, display, perform, sublicense and distribute
+Licensed Software and Your Extensions in both Source Code form or as an
+executable program.
+
+3.2 Create Derivative Works (as that term is defined under U.S. copyright law)
+of Licensed Software by adding to or deleting from the substance or structure
+of said Licensed Software.
+
+3.3 Under claims of patents now or hereafter owned or controlled by Licensor,
+to make, use, have made, and/or otherwise dispose of Licensed Software or
+portions thereof, but solely to the extent that any such claim is necessary to
+enable You to make, use, have made, and/or otherwise dispose of Licensed
+Software or portions thereof.
+
+3.4 Licensor reserves the right to release new versions of the Software with
+different features, specifications, capabilities, functions, licensing terms,
+general availability or other characteristics. Title, ownership rights, and
+intellectual property rights in and to the Licensed Software shall remain in
+Licensor and/or its Contributors.
+
+4.0 Grant of License From Contributor. By application of the provisions in
+Section 6 below, each Contributor hereby grants You a world-wide, royalty-
+free, non-exclusive license, subject to said Contributor`s intellectual
+property rights, and any third party intellectual property claims derived from
+the Licensed Software under this License, to do the following:
+
+4.1 Use, reproduce, modify, display, perform, sublicense and distribute any
+Extensions Deployed by such Contributor or portions thereof, in both Source
+Code form or as an executable program, either on an unmodified basis or as
+part of Derivative Works.
+
+4.2 Under claims of patents now or hereafter owned or controlled by
+Contributor, to make, use, have made, and/or otherwise dispose of Extensions
+or portions thereof, but solely to the extent that any such claim is necessary
+to enable You to make, use, have made, and/or otherwise dispose of
+Licensed Software or portions thereof.
+
+5.0 Exclusions From License Grant. Nothing in this License shall be deemed to
+grant any rights to trademarks, copyrights, patents, trade secrets or any
+other intellectual property of Licensor or any Contributor except as expressly
+stated herein. Except as expressly stated in Sections 3 and 4, no other patent
+rights, express or implied, are granted herein. Your Extensions may require
+additional patent licenses from Licensor or Contributors which each may grant
+in its sole discretion. No right is granted to the trademarks of Licensor or
+any Contributor even if such marks are included in the Licensed Software.
+Nothing in this License shall be interpreted to prohibit Licensor from
+licensing under different terms from this License any code that Licensor
+otherwise would have a right to license.
+
+5.1 You expressly acknowledge and agree that although Licensor and each
+Contributor grants the licenses to their respective portions of the Licensed
+Software set forth herein, no assurances are provided by Licensor or any
+Contributor that the Licensed Software does not infringe the patent or other
+intellectual property rights of any other entity. Licensor and each
+Contributor disclaim any liability to You for claims brought by any other
+entity based on infringement of intellectual property rights or otherwise. As
+a condition to exercising the rights and licenses granted hereunder, You
+hereby assume sole responsibility to secure any other intellectual property
+rights needed, if any. For example, if a third party patent license is
+required to allow You to distribute the Licensed Software, it is Your
+responsibility to acquire that license before distributing the Licensed
+Software.
+
+6.0 Your Obligations And Grants. In consideration of, and as an express
+condition to, the licenses granted to You under this License You hereby agree
+that any Modifications, Derivative Works, or Required Components (collectively
+Extensions) that You create or to which You contribute are governed by the
+terms of this License including, without limitation, Section 4. Any Extensions
+that You create or to which You contribute must be Deployed under the terms of
+this License or a future version of this License released under Section 7. You
+hereby grant to Licensor and all third parties a world-wide, non-exclusive,
+royalty-free license under those intellectual property rights You own or
+control to use, reproduce, display, perform, modify, create derivatives,
+sublicense, and distribute Licensed Software, in any form. Any Extensions You
+make and Deploy must have a distinct title so as to readily tell any
+subsequent user or Contributor that the Extensions are by You. You must
+include a copy of this License or directions on how to obtain a copy with
+every copy of the Extensions You distribute. You agree not to offer or impose
+any terms on any Source Code or executable version of the Licensed Software,
+or its Extensions that alter or restrict the applicable version of this
+License or the recipients` rights hereunder.
+
+6.1 Availability of Source Code. You must make available, under the terms of
+this License, the Source Code of any Extensions that You Deploy, via an
+Electronic Distribution Mechanism. The Source Code for any version that You
+Deploy must be made available within one (1) month of when you Deploy and must
+remain available for no less than twelve (12) months after the date You cease
+to Deploy. You are responsible for ensuring that the Source Code to each
+version You Deploy remains available even if the Electronic Distribution
+Mechanism is maintained by a third party. You may not charge a fee for any
+copy of the Source Code distributed under this Section in excess of Your
+actual cost of duplication and distribution of said copy.
+
+6.2 Description of Modifications. You must cause any Modifications that You
+create or to which You contribute to be documented in the Source Code, clearly
+describing the additions, changes or deletions You made. You must include a
+prominent statement that the Modifications are derived, directly or indirectly,
+from the Licensed Software and include the names of the Licensor and any
+Contributor to the Licensed Software in (i) the Source Code and (ii) in any
+notice displayed by the Licensed Software You distribute or in related
+documentation in which You describe the origin or ownership of the Licensed
+Software. You may not modify or delete any pre-existing copyright notices,
+change notices or License text in the Licensed Software without written
+permission of the respective Licensor or Contributor.
+
+6.3 Intellectual Property Matters.
+
+a. Third Party Claims. If You have knowledge that a license to a third party`s
+intellectual property right is required to exercise the rights granted by this
+License, You must include a human-readable file with Your distribution that
+describes the claim and the party making the claim in sufficient detail that a
+recipient will know whom to contact.
+
+b. Contributor APIs. If Your Extensions include an application programming
+interface ("API") and You have knowledge of patent licenses that are
+reasonably necessary to implement that API, You must also include this
+information in a human-readable file supplied with Your distribution.
+
+c. Representations. You represent that, except as disclosed pursuant to 6.3(a)
+above, You believe that any Extensions You distribute are Your original
+creations and that You have sufficient rights to grant the rights conveyed by
+this License.
+
+6.4 Required Notices.
+
+a. License Text. You must duplicate this License or instructions on how to
+acquire a copy in any documentation You provide along with the Source Code of
+any Extensions You create or to which You contribute, wherever You describe
+recipients` rights relating to Licensed Software.
+
+b. License Notice. You must duplicate any notice contained in EXHIBIT A (the
+"License Notice") in each file of the Source Code of any copy You distribute
+of the Licensed Software and Your Extensions. If You create an Extension, You
+may add Your name as a Contributor to the Source Code and accompanying
+documentation along with a description of the contribution. If it is not
+possible to put the License Notice in a particular Source Code file due to its
+structure, then You must include such License Notice in a location where a
+user would be likely to look for such a notice.
+
+c. Source Code Availability. You must notify the software community of the
+availability of Source Code to Your Extensions within one (1) month of the date
+You initially Deploy and include in such notification a description of the
+Extensions, and instructions on how to acquire the Source Code. Should such
+instructions change you must notify the software community of revised
+instructions within one (1) month of the date of change. You must provide
+notification by posting to appropriate news groups, mailing lists, weblogs, or
+other sites where a publicly accessible search engine would reasonably be
+expected to index your post in relationship to queries regarding the Licensed
+Software and/or Your Extensions.
+
+d. User-Visible Attribution. You must duplicate any notice contained in
+EXHIBIT B (the "User-Visible Attribution Notice") in each user-visible display
+of the Licensed Software and Your Extensions which delineates copyright,
+ownership, or similar attribution information. If You create an Extension,
+You may add Your name as a Contributor, and add Your attribution notice, as an
+equally visible and functional element of any User-Visible Attribution Notice
+content. To ensure proper attribution, You must also include such User-Visible
+Attribution Notice in at least one location in the Software documentation
+where a user would be likely to look for such notice.
+
+6.5 Additional Terms. You may choose to offer, and charge a fee for, warranty,
+support, indemnity or liability obligations to one or more recipients of
+Licensed Software. However, You may do so only on Your own behalf, and not on
+behalf of the Licensor or any Contributor except as permitted under other
+agreements between you and Licensor or Contributor. You must make it clear that
+any such warranty, support, indemnity or liability obligation is offered by You
+alone, and You hereby agree to indemnify the Licensor and every Contributor for
+any liability plus attorney fees, costs, and related expenses due to any such
+action or claim incurred by the Licensor or such Contributor as a result of
+warranty, support, indemnity or liability terms You offer.
+
+6.6 Conflicts With Other Licenses. Where any portion of Your Extensions, by
+virtue of being Derivative Works of another product or similar circumstance,
+fall under the terms of another license, the terms of that license should be
+honored however You must also make Your Extensions available under this
+License. If the terms of this License continue to conflict with the terms of
+the other license you may write the Licensor for permission to resolve the
+conflict in a fashion that remains consistent with the intent of this License.
+Such permission will be granted at the sole discretion of the Licensor.
+
+7.0 Versions of This License. Licensor may publish from time to time revised
+versions of the License. Once Licensed Software has been published under a
+particular version of the License, You may always continue to use it under the
+terms of that version. You may also choose to use such Licensed Software under
+the terms of any subsequent version of the License published by Licensor. No
+one other than Licensor has the right to modify the terms applicable to
+Licensed Software created under this License.
+
+7.1 If You create or use a modified version of this License, which You may do
+only in order to apply it to software that is not already Licensed Software
+under this License, You must rename Your license so that it is not confusingly
+similar to this License, and must make it clear that Your license contains
+terms that differ from this License. In so naming Your license, You may not
+use any trademark of Licensor or of any Contributor. Should Your modifications
+to this License be limited to alteration of a) Section 13.8 solely to modify
+the legal Jurisdiction or Venue for disputes, b) EXHIBIT A solely to define
+License Notice text, or c) to EXHIBIT B solely to define a User-Visible
+Attribution Notice, You may continue to refer to Your License as the
+Reciprocal Public License or simply the RPL.
+
+8.0 Disclaimer of Warranty. LICENSED SOFTWARE IS PROVIDED UNDER THIS LICENSE
+ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
+INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE LICENSED SOFTWARE IS FREE
+OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+FURTHER THERE IS NO WARRANTY MADE AND ALL IMPLIED WARRANTIES ARE DISCLAIMED
+THAT THE LICENSED SOFTWARE MEETS OR COMPLIES WITH ANY DESCRIPTION OF
+PERFORMANCE OR OPERATION, SAID COMPATIBILITY AND SUITABILITY BEING YOUR
+RESPONSIBILITY. LICENSOR DISCLAIMS ANY WARRANTY, IMPLIED OR EXPRESSED, THAT
+ANY CONTRIBUTOR`S EXTENSIONS MEET ANY STANDARD OF COMPATIBILITY OR DESCRIPTION
+OF PERFORMANCE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LICENSED SOFTWARE IS WITH YOU. SHOULD LICENSED SOFTWARE PROVE DEFECTIVE IN ANY
+RESPECT, YOU (AND NOT THE LICENSOR OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. UNDER THE TERMS OF THIS
+LICENSOR WILL NOT SUPPORT THIS SOFTWARE AND IS UNDER NO OBLIGATION TO ISSUE
+UPDATES TO THIS SOFTWARE. LICENSOR HAS NO KNOWLEDGE OF ERRANT CODE OR VIRUS IN
+THIS SOFTWARE, BUT DOES NOT WARRANT THAT THE SOFTWARE IS FREE FROM SUCH ERRORS
+OR VIRUSES. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF LICENSED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+9.0 Limitation of Liability. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
+WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
+LICENSOR, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF LICENSED SOFTWARE, OR ANY
+SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES,
+EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH
+DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH
+OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT
+APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS
+EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10.0 High Risk Activities. THE LICENSED SOFTWARE IS NOT FAULT-TOLERANT AND IS
+NOT DESIGNED, MANUFACTURED, OR INTENDED FOR USE OR DISTRIBUTION AS ON-LINE
+CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE,
+SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR
+COMMUNICATIONS SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES, OR
+WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE LICENSED SOFTWARE COULD LEAD
+DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
+("HIGH RISK ACTIVITIES"). LICENSOR AND CONTRIBUTORS SPECIFICALLY DISCLAIM ANY
+EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+
+11.0 Responsibility for Claims. As between Licensor and Contributors, each
+party is responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License which specifically
+disclaims warranties and limits any liability of the Licensor. This paragraph
+is to be used in conjunction with and controlled by the Disclaimer Of
+Warranties of Section 8, the Limitation Of Damages in Section 9, and the
+disclaimer against use for High Risk Activities in Section 10. The Licensor
+has thereby disclaimed all warranties and limited any damages that it is or
+may be liable for. You agree to work with Licensor and Contributors to
+distribute such responsibility on an equitable basis consistent with the terms
+of this License including Sections 8, 9, and 10. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+12.0 Termination. This License and all rights granted hereunder will terminate
+immediately in the event of the circumstances described in Section 13.6 or if
+applicable law prohibits or restricts You from fully and or specifically
+complying with Sections 3, 4 and/or 6, or prevents the enforceability of any
+of those Sections, and You must immediately discontinue any use of Licensed
+Software.
+
+12.1 Automatic Termination Upon Breach. This License and the rights granted
+hereunder will terminate automatically if You fail to comply with the terms
+herein and fail to cure such breach within thirty (30) days of becoming aware
+of the breach. All sublicenses to the Licensed Software that are properly
+granted shall survive any termination of this License. Provisions that, by
+their nature, must remain in effect beyond the termination of this License,
+shall survive.
+
+12.2 Termination Upon Assertion of Patent Infringement. If You initiate
+litigation by asserting a patent infringement claim (excluding declaratory
+judgment actions) against Licensor or a Contributor (Licensor or Contributor
+against whom You file such an action is referred to herein as "Respondent")
+alleging that Licensed Software directly or indirectly infringes any patent,
+then any and all rights granted by such Respondent to You under Sections 3 or
+4 of this License shall terminate prospectively upon sixty (60) days notice
+from Respondent (the "Notice Period") unless within that Notice Period You
+either agree in writing (i) to pay Respondent a mutually agreeable reasonably
+royalty for Your past or future use of Licensed Software made by such
+Respondent, or (ii) withdraw Your litigation claim with respect to Licensed
+Software against such Respondent. If within said Notice Period a reasonable
+royalty and payment arrangement are not mutually agreed upon in writing by the
+parties or the litigation claim is not withdrawn, the rights granted by
+Licensor to You under Sections 3 and 4 automatically terminate at the
+expiration of said Notice Period.
+
+12.3 Reasonable Value of This License. If You assert a patent infringement
+claim against Respondent alleging that Licensed Software directly or
+indirectly infringes any patent where such claim is resolved (such as by
+license or settlement) prior to the initiation of patent infringement
+litigation, then the reasonable value of the licenses granted by said
+Respondent under Sections 3 and 4 shall be taken into account in determining
+the amount or value of any payment or license.
+
+12.4 No Retroactive Effect of Termination. In the event of termination under
+this Section all end user license agreements (excluding licenses to
+distributors and resellers) that have been validly granted by You or any
+distributor hereunder prior to termination shall survive termination.
+
+13.0 Miscellaneous.
+
+13.1 U.S. Government End Users. The Licensed Software is a "commercial item,"
+as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+"commercial computer software" and "commercial computer software
+documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995).
+Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4
+(June 1995), all U.S. Government End Users acquire Licensed Software with only
+those rights set forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as creating
+an agency, partnership, joint venture, or any other form of legal association
+between or among You, Licensor, or any Contributor, and You will not represent
+to the contrary, whether expressly, by implication, appearance, or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair Licensor`s
+right to acquire, license, develop, subcontract, market, or distribute
+technology or products that perform the same or similar functions as, or
+otherwise compete with, Extensions that You may develop, produce, market, or
+distribute.
+
+13.4 Consent To Breach Not Waiver. Failure by Licensor or Contributor to
+enforce any provision of this License will not be deemed a waiver of future enforcement
+of that or any other provision.
+
+13.5 Severability. This License represents the complete agreement concerning
+the subject matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary
+to make it enforceable.
+
+13.6 Inability to Comply Due to Statute or Regulation. If it is impossible for
+You to comply with any of the terms of this License with respect to some or
+all of the Licensed Software due to statute, judicial order, or regulation,
+then You cannot use, modify, or distribute the software.
+
+13.7 Export Restrictions. You may be restricted with respect to downloading or
+otherwise acquiring, exporting, or reexporting the Licensed Software or any
+underlying information or technology by United States and other applicable
+laws and regulations. By downloading or by otherwise obtaining the Licensed
+Software, You are agreeing to be responsible for compliance with all
+applicable laws and regulations.
+
+13.8 Arbitration, Jurisdiction &amp; Venue. This License shall be governed by
+Colorado law provisions (except to the extent applicable law, if any, provides
+otherwise), excluding its conflict-of-law provisions. You expressly agree that
+any dispute relating to this License shall be submitted to binding arbitration
+under the rules then prevailing of the American Arbitration Association. You
+further agree that Adams County, Colorado USA is proper venue and grant such
+arbitration proceeding jurisdiction as may be appropriate for purposes of
+resolving any dispute under this License. Judgement upon any award made in
+arbitration may be entered and enforced in any court of competent
+jurisdiction. The arbitrator shall award attorney`s fees and costs of
+arbitration to the prevailing party. Should either party find it necessary to
+enforce its arbitration award or seek specific performance of such award in a
+civil court of competent jurisdiction, the prevailing party shall be entitled
+to reasonable attorney`s fees and costs. The application of the United Nations
+Convention on Contracts for the International Sale of Goods is expressly
+excluded. You and Licensor expressly waive any rights to a jury trial in any
+litigation concerning Licensed Software or this License. Any law or regulation
+that provides that the language of a contract shall be construed against the
+drafter shall not apply to this License.
+
+13.9 Entire Agreement. This License constitutes the entire agreement between
+the parties with respect to the subject matter hereof.
+
+EXHIBIT A
+
+The License Notice below must appear in each file of the Source Code of any
+copy You distribute of the Licensed Software or any Extensions thereto:
+
+Unless explicitly acquired and licensed from Licensor under another
+license, the contents of this file are subject to the Reciprocal Public
+License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
+and You may not copy or use this file in either source code or executable
+form, except in compliance with the terms and conditions of the RPL.
+
+All software distributed under the RPL is provided strictly on an "AS
+IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
+LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
+LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
+language governing rights and limitations under the RPL.
+
+EXHIBIT B
+
+The User-Visible Attribution Notice below, when provided, must appear in each
+user-visible display as defined in Section 6.4 (d):
+
diff --git a/poky/meta/files/common-licenses/RPSL-1.0 b/poky/meta/files/common-licenses/RPSL-1.0
new file mode 100644
index 000000000..80814f95d
--- /dev/null
+++ b/poky/meta/files/common-licenses/RPSL-1.0
@@ -0,0 +1,182 @@
+
+RealNetworks Public Source License Version 1.0
+
+(Rev. Date October 28, 2002)
+
+Also available in text format.
+
+1. General Definitions. This License applies to any program or other work which RealNetworks, Inc., or any other entity that elects to use this license, ("Licensor") makes publicly available and which contains a notice placed by Licensor identifying such program or work as "Original Code" and stating that it is subject to the terms of this RealNetworks Public Source License version 1.0 (or subsequent version thereof) ("License"). You are not required to accept this License. However, nothing else grants You permission to use, copy, modify or distribute the software or its derivative works. These actions are prohibited by law if You do not accept this License. Therefore, by modifying, copying or distributing the software (or any work based on the software), You indicate your acceptance of this License to do so, and all its terms and conditions. In addition, you agree to the terms of this License by clicking the Accept button or downloading the software. As used in this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the grantor of rights, claims of patents that (i) are now or hereafter acquired, owned by or assigned to Licensor and (ii) are necessarily infringed by using or making the Original Code alone and not in combination with other software or hardware; and (b) in the case where You are the grantor of rights, claims of patents that (i) are now or hereafter acquired, owned by or assigned to You and (ii) are infringed (directly or indirectly) by using or making Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Compatible Source License" means any one of the licenses listed on Exhibit B or at https://www.helixcommunity.org/content/complicense or other licenses specifically identified by Licensor in writing. Notwithstanding any term to the contrary in any Compatible Source License, any code covered by any Compatible Source License that is used with Covered Code must be made readily available in Source Code format for royalty-free use under the terms of the Compatible Source License or this License.
+
+1.3 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.4 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+1.6 "Derivative Work" means either the Covered Code or any derivative work under United States copyright law, and including any work containing or including any portion of the Covered Code or Modifications, either verbatim or with modifications and/or translated into another language. Derivative Work also includes any work which combines any portion of Covered Code or Modifications with code not otherwise governed by the terms of this License.
+
+1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be accessed or used by anyone other than You, used to provide any services to anyone other than You, or used in any way to deliver any content to anyone other than You, whether the Covered Code is distributed to those parties, made available as an application intended for use over a computer network, or used to provide services or otherwise deliver content to anyone other than You.
+
+1.8. "Interface" means interfaces, functions, properties, class definitions, APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of software, firmware or hardware to communicate or interoperate with another piece of software, firmware or hardware.
+
+1.9 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+1.10 "Original Code" means (a) the Source Code of a program or other work as originally made available by Licensor under this License, including the Source Code of any updates or upgrades to such programs or works made available by Licensor under this License, and that has been expressly identified by Licensor as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Licensor under this License.
+
+1.11 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+1.12 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.13 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms and conditions of this License, Licensor hereby grants You, effective on the date You accept this License (via downloading or using Covered Code or otherwise indicating your acceptance of this License), a worldwide, royalty-free, non-exclusive copyright license, to the extent of Licensor`s copyrights cover the Original Code, to do the following:
+
+2.1 You may reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Licensor as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License;
+
+(b) You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6;
+
+(c) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change;
+
+(d) You must make Source Code of all Your Externally Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site); and
+
+(e) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code. You must also include the Object Code Notice set forth in Exhibit A in the "about" box or other appropriate place where other copyright notices are placed, including any packaging materials.
+
+2.2 You expressly acknowledge and agree that although Licensor and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Licensor or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Licensor and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to make, use, sell, import or offer for sale the Covered Code, it is Your responsibility to acquire such license(s).
+
+2.3 Subject to the terms and conditions of this License, Licensor hereby grants You, effective on the date You accept this License (via downloading or using Covered Code or otherwise indicating your acceptance of this License), a worldwide, royalty-free, perpetual, non-exclusive patent license under Licensor`s Applicable Patent Rights to make, use, sell, offer for sale and import the Covered Code, provided that in each instance you comply with the terms of this License.
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License:
+
+(a) You grant to Licensor and all third parties a non-exclusive, perpetual, irrevocable, royalty free license under Your Applicable Patent Rights and other intellectual property rights owned or controlled by You, to make, sell, offer for sale, use, import, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Licensor`s licenses under Sections 2.1 and 2.2; and
+
+(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide, royalty-free, perpetual and irrevocable license, under Your Applicable Patent Rights and other intellectual property rights owned or controlled by You, to make, use, sell, offer for sale, import, reproduce, display, perform, distribute, modify or have modified (for Licensor and/or its subsidiaries), sublicense and distribute Your Modifications, in any form and for any purpose, through multiple tiers of distribution.
+
+(c) You agree not use any information derived from Your use and review of the Covered Code, including but not limited to any algorithms or inventions that may be contained in the Covered Code, for the purpose of asserting any of Your patent rights, or assisting a third party to assert any of its patent rights, against Licensor or any Contributor.
+
+4. Derivative Works. You may create a Derivative Work by combining Covered Code with other code not otherwise governed by the terms of this License and distribute the Derivative Work as an integrated product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof, including all Modifications.
+
+4.1 You must cause any Derivative Work that you distribute, publish or Externally Deploy, that in whole or in part contains or is derived from the Covered Code or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License and no other license except as provided in Section 4.2. You also must make Source Code available for the Derivative Work under the same terms as Modifications, described in Sections 2 and 3, above.
+
+4.2 Compatible Source Licenses. Software modules that have been independently developed without any use of Covered Code and which contain no portion of the Covered Code, Modifications or other Derivative Works, but are used or combined in any way with the Covered Code or any Derivative Work to form a larger Derivative Work, are exempt from the conditions described in Section 4.1 but only to the extent that: the software module, including any software that is linked to, integrated with, or part of the same applications as, the software module by any method must be wholly subject to one of the Compatible Source Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the terms of this License. Thus, the entire Derivative Work must be licensed under a combination of the RPSL (for Covered Code) and a Compatible Source License for any independently developed software modules within the Derivative Work. The foregoing requirement applies even if the Compatible Source License would ordinarily allow the software module to link with, or form larger works with, other software that is not subject to the Compatible Source License. For example, although the Mozilla Public License v1.1 allows Mozilla code to be combined with proprietary software that is not subject to the MPL, if MPL-licensed code is used with Covered Code the MPL-licensed code could not be combined or linked with any code not governed by the MPL. The general intent of this section 4.2 is to enable use of Covered Code with applications that are wholly subject to an acceptable open source license. You are responsible for determining whether your use of software with Covered Code is allowed under Your license to such software.
+
+4.3 Mere aggregation of another work not based on the Covered Code with the Covered Code (or with a work based on the Covered Code) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. If You deliver the Covered Code for combination and/or integration with an application previously provided by You (for example, via automatic updating technology), such combination and/or integration constitutes a Derivative Work subject to the terms of this License.
+
+5. Exclusions From License Grant. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor or any Contributor except as expressly stated herein. No right is granted to the trademarks of Licensor or any Contributor even if such marks are included in the Covered Code. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any code that Licensor otherwise would have a right to license. Modifications, Derivative Works and/or any use or combination of Covered Code with other technology provided by Licensor or third parties may require additional patent licenses from Licensor which Licensor may grant in its sole discretion. No patent license is granted separate from the Original Code or combinations of the Original Code with other software or hardware.
+
+5.1. Trademarks. This License does not grant any rights to use the trademarks or trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any trademark or trade name belonging to any Contributor. No Licensor Marks may be used to endorse or promote products derived from the Original Code other than as permitted by the Licensor Trademark Policy defined in Exhibit C.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Licensor or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Licensor and every Contributor harmless for any liability incurred by or claims asserted against Licensor or such Contributor by reason of any such Additional Terms.
+
+7. Versions of the License. Licensor may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Licensor. No one other than Licensor has the right to modify the terms applicable to Covered Code created under this License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND LICENSOR AND LICENSOR`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in high risk activities, including, but not limited to, the design, construction, operation or maintenance of nuclear facilities, aircraft navigation, aircraft communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage. Licensor disclaims any express or implied warranty of fitness for such uses.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Licensor`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of ten dollars ($10.00).
+
+10. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Licensor retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Licensor ("Licensor Modifications"), and such Licensor Modifications will not be automatically subject to this License. Licensor may, at its sole discretion, choose to license such Licensor Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+11. Termination.
+
+11.1 Term and Termination. The term of this License is perpetual unless terminated as provided below. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Licensor if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 12.5(b); or
+
+(c) automatically without notice from Licensor if You, at any time during the term of this License, commence an action for patent infringement against Licensor (including by cross-claim or counter claim in a lawsuit);
+
+(d) upon written notice from Licensor if You, at any time during the term of this License, commence an action for patent infringement against any third party alleging that the Covered Code itself (excluding combinations with other software or hardware) infringes any patent (including by cross-claim or counter claim in a lawsuit).
+
+11.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+12. Miscellaneous.
+
+12.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+12.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among You, Licensor or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+12.3 Independent Development. Nothing in this License will impair Licensor`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Derivative Works, technology or products that You may develop, produce, market or distribute.
+
+12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+12.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+12.6 Dispute Resolution. Any litigation or other dispute resolution between You and Licensor relating to this License shall take place in the Seattle, Washington, and You and Licensor hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+12.7 Export/Import Laws. This software is subject to all export and import laws and restrictions and regulations of the country in which you receive the Covered Code and You are solely responsible for ensuring that You do not export, re-export or import the Covered Code or any direct product thereof in violation of any such restrictions, laws or regulations, or without all necessary authorizations.
+
+12.8 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of Washington.
+
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+
+EXHIBIT A.
+
+"Copyright &#169; 1995-2002 RealNetworks, Inc. and/or its licensors. All Rights Reserved.
+
+The contents of this file, and the files included with this file, are subject to the current version of the RealNetworks Public Source License Version 1.0 (the "RPSL") available at https://www.helixcommunity.org/content/rpsl unless you have licensed the file under the RealNetworks Community Source License Version 1.0 (the "RCSL") available at https://www.helixcommunity.org/content/rcsl, in which case the RCSL will apply. You may also obtain the license terms directly from RealNetworks. You may not use this file except in compliance with the RPSL or, if you have a valid RCSL with RealNetworks applicable to this file, the RCSL. Please see the applicable RPSL or RCSL for the rights, obligations and limitations governing use of the contents of the file.
+
+This file is part of the Helix DNA Technology. RealNetworks is the developer of the Original code and owns the copyrights in the portions it created.
+
+This file, and the files included with this file, is distributed and made available on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+
+Contributor(s): ____________________________________
+
+Technology Compatibility Kit Test Suite(s) Location (if licensed under the RCSL):
+
+________________________________"
+
+Object Code Notice: Helix DNA Client technology included. Copyright &#169; RealNetworks, Inc., 1995-2002. All rights reserved.
+
+EXHIBIT B
+
+Compatible Source Licenses for the RealNetworks Public Source License. The following list applies to the most recent version of the license as of October 25, 2002, unless otherwise indicated.
+
+Academic Free License
+Apache Software License
+Apple Public Source License
+Artistic license
+Attribution Assurance Licenses
+BSD license
+Common Public License1
+Eiffel Forum License
+GNU General Public License (GPL)1
+GNU Library or "Lesser" General Public License (LGPL)1
+IBM Public License
+Intel Open Source License
+Jabber Open Source License
+MIT license
+MITRE Collaborative Virtual Workspace License (CVW License)
+Motosoto License
+Mozilla Public License 1.0 (MPL)
+Mozilla Public License 1.1 (MPL)
+Nokia Open Source License
+Open Group Test Suite License
+Python Software Foundation License
+Ricoh Source Code Public License
+Sun Industry Standards Source License (SISSL)
+Sun Public License
+University of Illinois/NCSA Open Source License
+Vovida Software License v. 1.0
+W3C License
+X.Net License
+Zope Public License
+zlib/libpng license
+1Note: because this license contains certain reciprocal licensing terms that purport to extend to independently developed code, You may be prohibited under the terms of this otherwise compatible license from using code licensed under its terms with Covered Code because Covered Code may only be licensed under the RealNetworks Public Source License. Any attempt to apply non RPSL license terms, including without limitation the GPL, to Covered Code is expressly forbidden. You are responsible for ensuring that Your use of Compatible Source Licensed code does not violate either the RPSL or the Compatible Source License.
+
+The latest version of this list can be found at: https://www.helixcommunity.org/content/complicense
+
+EXHIBIT C
+
+RealNetworks` Trademark policy.
+
+RealNetworks defines the following trademarks collectively as "Licensor Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem", "RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other trademarks or trade names belonging to RealNetworks.
+
+RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks except as permitted by and in strict compliance at all times with RealNetworks` third party trademark usage guidelines which are posted at www.realnetworks.com/info/helixlogo.html.
+
diff --git a/poky/meta/files/common-licenses/RSCPL b/poky/meta/files/common-licenses/RSCPL
new file mode 100644
index 000000000..bedbbc1e8
--- /dev/null
+++ b/poky/meta/files/common-licenses/RSCPL
@@ -0,0 +1,193 @@
+
+Ricoh Source Code Public License
+
+Version 1.0
+
+
+1. Definitions.
+
+
+1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications.
+
+
+1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+
+1.3. "Electronic Distribution Mechanism" means a website or any other mechanism generally accepted in the software development community for the electronic transfer of data.
+
+
+1.4. "Executable Code" means Governed Code in any form other than Source Code.
+
+
+1.5. "Governed Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+
+1.6. "Larger Work" means a work which combines Governed Code or portions thereof with code not governed by the terms of this License.
+
+
+1.7. "Licensable" means the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+
+1.8. "License" means this document.
+
+
+1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Governed Code is released as a series of files, a Modification is:
+
+
+(a) Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+(b) Any new file that contains any part of the Original Code or previous Modifications.
+
+
+
+1.10. "Original Code" means the "Platform for Information Applications" Source Code as released under this License by RSV.
+
+
+1.11 "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by the grantor of a license thereto.
+
+1.12. "RSV" means Ricoh Silicon Valley, Inc., a California corporation with offices at 2882 Sand Hill Road, Suite 115, Menlo Park, CA 94025-7022.
+
+1.13. "Source Code" means the preferred form of the Governed Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of Executable Code, or a list of source code differential comparisons against either the Original Code or another well known, available Governed Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+
+1.14. "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+
+
+2. Source Code License.
+
+2.1. Grant from RSV. RSV hereby grants You a worldwide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+
+(a) to use, reproduce, modify, create derivative works of, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+
+
+
+2.2. Contributor Grant. Each Contributor hereby grants You a worldwide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+
+(a) to use, reproduce, modify, create derivative works of, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Governed Code or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (i) Modifications made by that Contributor (or portions thereof); and (ii) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+
+
+3. Distribution Obligations.
+
+
+
+3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Governed Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+
+3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable Code version or via an Electronic Distribution Mechanism to anyone to whom you made an Executable Code version available; and if made available via an Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+
+3.3. Description of Modifications. You must cause all Governed Code to which you contribute to contain a file documenting the changes You made to create that Governed Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by RSV and including the name of RSV in (a) the Source Code, and (b) in any notice in an Executable Code version or related documentation in which You describe the origin or ownership of the Governed Code.
+
+
+3.4. Intellectual Property Matters.
+
+3.4.1. Third Party Claims. If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying RSV and appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Governed Code that new knowledge has been obtained. In the event that You are a Contributor, You represent that, except as disclosed in the LEGAL file, your Modifications are your original creations and, to the best of your knowledge, no third party has any claim (including but not limited to intellectual property claims) relating to your Modifications. You represent that the LEGAL file includes complete details of any license or other restriction associated with any part of your Modifications.
+
+3.4.2. Contributor APIs. If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+
+3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Governed Code. If You created one or more Modification(s), You may add your name as a Contributor to the notice described in Exhibit A. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Governed Code. However, You may do so only on Your own behalf, and not on behalf of RSV or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify RSV and every Contributor for any liability incurred by RSV or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+
+3.6. Distribution of Executable Code Versions. You may distribute Governed Code in Executable Code form only if the requirements of Section 3.1-3.5 have been met for that Governed Code, and if You include a prominent notice stating that the Source Code version of the Governed Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable Code version, related documentation or collateral in which You describe recipients` rights relating to the Governed Code. You may distribute the Executable Code version of Governed Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable Code version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable Code version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by RSV or any Contributor. You hereby agree to indemnify RSV and every Contributor for any liability incurred by RSV or such Contributor as a result of any such terms You offer.
+
+
+3.7. Larger Works. You may create a Larger Work by combining Governed Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Governed Code.
+
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of theterms of this License with respect to some or all of the Governed Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+
+5. Trademark Usage.
+
+
+
+5.1. Advertising Materials. All advertising materials mentioning features or use of the Governed Code must display the following acknowledgement: "This product includes software developed by Ricoh Silicon Valley, Inc."
+
+
+5.2. Endorsements. The names "Ricoh," "Ricoh Silicon Valley," and "RSV" must not be used to endorse or promote Contributor Versions or Larger Works without the prior written permission of RSV.
+
+
+5.3. Product Names. Contributor Versions and Larger Works may not be called "Ricoh" nor may the word "Ricoh" appear in their names without the prior written permission of RSV.
+
+
+6. Versions of the License.
+
+
+
+6.1. New Versions. RSV may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+
+6.2. Effect of New Versions. Once Governed Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Governed Code under the terms of any subsequent version of the License published by RSV. No one other than RSV has the right to modify the terms applicable to Governed Code created under this License.
+
+
+7. Disclaimer of Warranty.
+
+GOVERNED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE GOVERNED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE GOVERNED CODE IS WITH YOU. SHOULD ANY GOVERNED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT RSV OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY GOVERNED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+
+8. Termination.
+
+
+
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Governed Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+
+8.2. If You initiate patent infringement litigation against RSV or a Contributor (RSV or the Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+
+(a) such Participant`s Original Code or Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of the Original Code or the Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Original Code or the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device provided to You by the Participant, other than such Participant`s Original Code or Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Original Code or the Modifications made by that Participant.
+
+
+
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Original Code or Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+
+9. Limitation of Liability.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL RSV, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF GOVERNED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. TO THE EXTENT THAT ANY EXCLUSION OF DAMAGES ABOVE IS NOT VALID, YOU AGREE THAT IN NO EVENT WILL RSVS LIABILITY UNDER OR RELATED TO THIS AGREEMENT EXCEED FIVE THOUSAND DOLLARS ($5,000). THE GOVERNED CODE IS NOT INTENDED FOR USE IN CONNECTION WITH ANY NUCLER, AVIATION, MASS TRANSIT OR MEDICAL APPLICATION OR ANY OTHER INHERENTLY DANGEROUS APPLICATION THAT COULD RESULT IN DEATH, PERSONAL INJURY, CATASTROPHIC DAMAGE OR MASS DESTRUCTION, AND YOU AGREE THAT NEITHER RSV NOR ANY CONTRIBUTOR SHALL HAVE ANY LIABILITY OF ANY NATURE AS A RESULT OF ANY SUCH USE OF THE GOVERNED CODE.
+
+
+10. U.S. Government End Users.
+
+The Governed Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Governed Code with only those rights set forth herein.
+
+
+11. Miscellaneous.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. The parties submit to personal jurisdiction in California and further agree that any cause of action arising under or related to this Agreement shall be brought in the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California. The losing party shall be responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. Notwithstanding anything to the contrary herein, RSV may seek injunctive relief related to a breach of this Agreement in any court of competent jurisdiction. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+
+12. Responsibility for Claims.
+
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Governed Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+
+
+
+
+
+EXHIBIT A
+
+"The contents of this file are subject to the Ricoh Source Code Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.risource.org/RPL
+
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+This code was initially developed by Ricoh Silicon Valley, Inc. Portions created by Ricoh Silicon Valley, Inc. are Copyright (C) 1995-1999. All Rights Reserved.
+
+Contributor(s): ______________________________________."
+
diff --git a/poky/meta/files/common-licenses/Ruby b/poky/meta/files/common-licenses/Ruby
new file mode 100644
index 000000000..bc2e57f89
--- /dev/null
+++ b/poky/meta/files/common-licenses/Ruby
@@ -0,0 +1,60 @@
+
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.co.jp>.
+You can redistribute it and/or modify it under either the terms of the GPL
+(see COPYING.txt file), or the conditions below:
+
+ 1. You may make and give away verbatim copies of the source form of the
+ software without restriction, provided that you duplicate all of the
+ original copyright notices and associated disclaimers.
+
+ 2. You may modify your copy of the software in any way, provided that
+ you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise
+ make them Freely Available, such as by posting said
+ modifications to Usenet or an equivalent medium, or by allowing
+ the author to include your modifications in the software.
+
+ b) use the modified software only within your corporation or
+ organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided.
+
+ d) make other distribution arrangements with the author.
+
+ 3. You may distribute the software in object code or executable
+ form, provided that you do at least ONE of the following:
+
+ a) distribute the executables and library files of the software,
+ together with instructions (in the manual page or equivalent)
+ on where to get the original distribution.
+
+ b) accompany the distribution with the machine-readable source of
+ the software.
+
+ c) give non-standard executables non-standard names, with
+ instructions on where to get the original software distribution.
+
+ d) make other distribution arrangements with the author.
+
+ 4. You may modify and include the part of the software into any other
+ software (possibly commercial). But some files in the distribution
+ are not written by the author, so that they are not under this terms.
+
+ They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
+ files under the ./missing directory. See each file for the copying
+ condition.
+
+ 5. The scripts and library files supplied as input to or produced as
+ output from the software do not automatically fall under the
+ copyright of the software, but belong to whomever generated them,
+ and may be sold commercially, and may be aggregated with this
+ software.
+
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE.
+
+
diff --git a/poky/meta/files/common-licenses/SAX-PD b/poky/meta/files/common-licenses/SAX-PD
new file mode 100644
index 000000000..a1fd1130f
--- /dev/null
+++ b/poky/meta/files/common-licenses/SAX-PD
@@ -0,0 +1,33 @@
+
+Copyright Status for SAX
+
+SAX is free!
+
+In fact, it`s not possible to own a license to SAX, since it`s been placed in the public domain.
+
+No Warranty
+
+Because SAX is released to the public domain, there is no warranty for the design or for the software implementation, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide SAX "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of SAX is with you. Should SAX prove defective, you assume the cost of all necessary servicing, repair or correction.
+
+In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute SAX, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use SAX (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the SAX to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
+
+Copyright Disclaimers
+
+This page includes statements to that effect by David Megginson, who would have been able to claim copyright for the original work.
+
+SAX 1.0
+
+Version 1.0 of the Simple API for XML (SAX), created collectively by the membership of the XML-DEV mailing list, is hereby released into the public domain.
+
+No one owns SAX: you may use it freely in both commercial and non-commercial applications, bundle it with your software distribution, include it on a CD-ROM, list the source code in a book, mirror the documentation at your own web site, or use it in any other way you see fit.
+
+David Megginson, Megginson Technologies Ltd.
+1998-05-11
+
+SAX 2.0
+
+I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and release all of the SAX 2.0 source code, compiled code, and documentation contained in this distribution into the Public Domain. SAX comes with NO WARRANTY or guarantee of fitness for any purpose.
+
+David Megginson, Megginson Technologies Ltd.
+2000-05-05
+
diff --git a/poky/meta/files/common-licenses/SGI-1 b/poky/meta/files/common-licenses/SGI-1
new file mode 100644
index 000000000..e3998567e
--- /dev/null
+++ b/poky/meta/files/common-licenses/SGI-1
@@ -0,0 +1,36 @@
+/*
+ * (c) Copyright 1993, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
diff --git a/poky/meta/files/common-licenses/SMAIL_GPL b/poky/meta/files/common-licenses/SMAIL_GPL
new file mode 100644
index 000000000..dfc3fd16c
--- /dev/null
+++ b/poky/meta/files/common-licenses/SMAIL_GPL
@@ -0,0 +1,164 @@
+This is the Debian GNU/Linux package debianutils.
+
+It is an original Debian package. Programs in it were maintained by
+Guy Maor <maor@debian.org>, and are now maintained by Clint Adams
+<schizo@debian.org>.
+
+All its programs except readlink, savelog, and which may be
+redistributed under the terms of the GNU GPL, Version 2 or later,
+found on Debian systems in the file /usr/share/common-licenses/GPL.
+
+which is in the public domain.
+
+readlink is Copyright (c) 1997 Kenneth Stailey, and may also be
+distributed under the terms of the BSD copyright.
+
+savelog may be redistributed under the following terms: (The rest of
+this file consists of savelog's distribution terms.)
+
+#ident "@(#)smail:RELEASE-3_2:COPYING,v 1.2 1996/06/14 18:59:10 woods Exp"
+
+ SMAIL GENERAL PUBLIC LICENSE
+ (Clarified 11 Feb 1988)
+
+ Copyright (C) 1988 Landon Curt Noll & Ronald S. Karr
+ Copyright (C) 1992 Ronald S. Karr
+ Copyleft (GNU) 1988 Landon Curt Noll & Ronald S. Karr
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license, but changing it is not allowed. You can also
+ use this wording to make the terms for other programs.
+
+ The license agreements of most software companies keep you at the
+mercy of those companies. By contrast, our general public license is
+intended to give everyone the right to share SMAIL. To make sure that
+you get the rights we want you to have, we need to make restrictions
+that forbid anyone to deny you these rights or to ask you to surrender
+the rights. Hence this license agreement.
+
+ Specifically, we want to make sure that you have the right to give
+away copies of SMAIL, that you receive source code or else can get it
+if you want it, that you can change SMAIL or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To make sure that everyone has such rights, we have to forbid you to
+deprive anyone else of these rights. For example, if you distribute
+copies of SMAIL, you must give the recipients all the rights that you
+have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ Also, for our own protection, we must make certain that everyone
+finds out that there is no warranty for SMAIL. If SMAIL is modified by
+someone else and passed on, we want its recipients to know that what
+they have is not what we distributed, so that any problems introduced
+by others will not reflect on our reputation.
+
+ Therefore we (Landon Curt Noll and Ronald S. Karr) make the following
+terms which say what you must do to be allowed to distribute or change
+SMAIL.
+
+
+ COPYING POLICIES
+
+ 1. You may copy and distribute verbatim copies of SMAIL source code
+as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy a valid copyright notice "Copyright
+(C) 1988 Landon Curt Noll & Ronald S. Karr" (or with whatever year is
+appropriate); keep intact the notices on all files that refer to this
+License Agreement and to the absence of any warranty; and give any
+other recipients of the SMAIL program a copy of this License
+Agreement along with the program. You may charge a distribution fee
+for the physical act of transferring a copy.
+
+ 2. You may modify your copy or copies of SMAIL or any portion of it,
+and copy and distribute such modifications under the terms of
+Paragraph 1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating
+ that you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish,
+ that in whole or in part contains or is a derivative of SMAIL or
+ any part thereof, to be licensed at no charge to all third
+ parties on terms identical to those contained in this License
+ Agreement (except that you may choose to grant more extensive
+ warranty protection to some or all third parties, at your option).
+
+ c) You may charge a distribution fee for the physical act of
+ transferring a copy, and you may at your option offer warranty
+ protection in exchange for a fee.
+
+Mere aggregation of another unrelated program with this program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other program under the scope of these terms.
+
+ 3. You may copy and distribute SMAIL (or a portion or derivative of it,
+under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal
+ shipping charge) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for non-commercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+For an executable file, complete source code means all the source code for
+all modules it contains; but, as a special exception, it need not include
+source code for modules which are standard libraries that accompany the
+operating system on which the executable file runs.
+
+ 4. You may not copy, sublicense, distribute or transfer SMAIL
+except as expressly provided under this License Agreement. Any attempt
+otherwise to copy, sublicense, distribute or transfer SMAIL is void and
+your rights to use the program under this License agreement shall be
+automatically terminated. However, parties who have received computer
+software programs from you with this License Agreement will not have
+their licenses terminated so long as such parties remain in full compliance.
+
+ 5. If you wish to incorporate parts of SMAIL into other free
+programs whose distribution conditions are different, write to Landon
+Curt Noll & Ronald S. Karr via the Free Software Foundation at 51
+Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. We have not yet
+worked out a simple rule that can be stated here, but we will often
+permit this. We will be guided by the two goals of preserving the
+free status of all derivatives of our free software and of promoting
+the sharing and reuse of software.
+
+Your comments and suggestions about our licensing policies and our
+software are welcome! This contract was based on the contract made by
+the Free Software Foundation. Please contact the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA, or call (617) 542-5942 for details on copylefted material in
+general.
+
+ NO WARRANTY
+
+ BECAUSE SMAIL IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO
+WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING, LANDON CURT NOLL & RONALD S. KARR AND/OR
+OTHER PARTIES PROVIDE SMAIL "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SMAIL IS WITH
+YOU. SHOULD SMAIL PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL LANDON CURT NOLL &
+RONALD S. KARR AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
+SMAIL AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) SMAIL, EVEN IF YOU HAVE
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY
+ANY OTHER PARTY.
diff --git a/poky/meta/files/common-licenses/SPL-1.0 b/poky/meta/files/common-licenses/SPL-1.0
new file mode 100644
index 000000000..2848b3621
--- /dev/null
+++ b/poky/meta/files/common-licenses/SPL-1.0
@@ -0,0 +1,507 @@
+
+SUN PUBLIC LICENSE Version 1.0
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Code,
+prior Modifications used by a Contributor, and the Modifications made
+by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof and corresponding documentation released
+with the source code.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified as
+the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this
+License.
+
+1.8. "License" means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or
+subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing
+Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or
+previous Modifications.
+
+1.10. "Original Code"../ means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+1.11. "Source Code"../ means the preferred form of the Covered Code
+for
+making modifications to it, including all modules it contains, plus
+any associated documentation, interface definition files, scripts used
+to control compilation and installation of an Executable, or source
+code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor`s
+choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is
+widely available for no charge.
+
+1.12. "You" (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this
+License or a future version of this License issued under Section 6.1.
+For legal entities, "You" includes any entity which controls, is
+controlled by, or is under common control with You. For purposes of
+this definition, "control"../ means (a) the power, direct or indirect,
+to
+cause the direction or management of such entity, whether by contract
+or otherwise, or (b) ownership of more than fifty percent (50%) of the
+outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+2.1 The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce, modify,
+display, perform, sublicense and distribute the Original Code (or
+portions thereof) with or without Modifications, and/or as part of a
+Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of
+Original Code, to make, have made, use, practice, sell, and offer for
+sale, and/or otherwise dispose of the Original Code (or portions
+thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective
+on the date Initial Developer first distributes Original Code under
+the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2)
+separate from the Original Code; or 3) for infringements caused
+by:
+
+i) the modification of the Original Code or ii) the combination of the
+Original Code with other software or devices.
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent
+or
+trademark) Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications created
+by such Contributor (or portions thereof) either on an unmodified
+basis, with other Modifications, as Covered Code and/or as part of a
+Larger Work; and
+
+b) under Patent Claims infringed by the making, using, or selling of
+Modifications made by that Contributor either alone and/or in
+combination with its Contributor Version (or portions of such
+combination), to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of: 1) Modifications made by that Contributor (or
+portions thereof); and 2) the combination of Modifications made by
+that Contributor with its Contributor Version (or portions of such
+combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective
+on the date Contributor first makes Commercial Use of the Covered
+Code.
+
+(d) notwithstanding Section 2.2(b) above, no patent license is
+granted: 1) for any code that Contributor has deleted from the
+Contributor Version; 2) separate from the Contributor Version; 3) for
+infringements caused by: i) third party modifications of Contributor
+Version or ii) the combination of Modifications made by that
+Contributor with other software (except as part of the Contributor
+Version) or other devices; or 4) under Patent Claims infringed by
+Covered Code in the absence of Modifications made by that
+Contributor.
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation
+Section 2.2. The Source Code version of Covered Code may be
+distributed only under the terms of this License or a future version
+of this License released under Section 6.1, and You must include a
+copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code
+version that alters or restricts the applicable version of this
+License or the recipients` rights hereunder. However, You may include
+an additional document offering the additional rights described in
+Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License
+either on the same media as an Executable version or via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an
+Executable version available; and if made available via Electronic
+Distribution Mechanism, must remain available for at least twelve (12)
+months after the date it initially became available, or at least six
+(6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for
+ensuring that the Source Code version remains available even if the
+Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters.
+
+(a) Third Party Claims.
+
+If Contributor has knowledge that a license under a third party`s
+intellectual property rights is required to exercise the rights
+granted by such Contributor under Sections 2.1 or 2.2, Contributor
+must include a text file with the Source Code distribution titled
+"../LEGAL`` which describes the claim and the party making the claim in
+sufficient detail that a recipient will know whom to contact. If
+Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly
+modify the LEGAL file in all copies Contributor makes available
+thereafter and shall take other steps (such as notifying appropriate
+mailing lists or newsgroups) reasonably calculated to inform those who
+received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming
+interface ("API"../) and Contributor has knowledge of patent licenses
+which are reasonably necessary to implement that API, Contributor must
+also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section
+3.4(a) above, Contributor believes that Contributor`s Modifications
+are Contributor`s original creation(s) and/or Contributor has
+sufficient rights to grant the rights conveyed by this
+License
+
+.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source
+Code file due to its structure, then You must include such notice in a
+location (such as a relevant directory) where a user would be likely
+to look for such a notice. If You created one or more Modification(s)
+You may add your name as a Contributor to the notice described in
+Exhibit A. You must also duplicate this License in any documentation
+for the Source Code where You describe recipients` rights or ownership
+rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability
+obligations to one or more recipients of Covered Code. However, You
+may do so only on Your own behalf, and not on behalf of the Initial
+Developer or any Contributor. You must make it absolutely clear than
+any such warranty, support, indemnity or liability obligation is
+offered by You alone, and You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty,
+support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code or ownership rights under a license of Your choice, which may
+contain terms different from this License, provided that You are in
+compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this
+License. If You distribute the Executable version under a different
+license You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the
+Initial Developer and every Contributor for any liability incurred by
+the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other
+code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 3.4 and must
+be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions.
+
+Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions
+of the License from time to time. Each version will be given a
+distinguishing version number.
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of
+the
+License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Code under the terms
+of any subsequent version of the License published by Sun. No one
+other than Sun has the right to modify the terms applicable to Covered
+Code created under this License.
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you
+may
+only do in order to apply it to code which is not already Covered Code
+governed by this License), You must: (a) rename Your license so that
+the phrases "Sun," "Sun Public License," or "SPL"../ or any confusingly
+similar phrase do not appear in your license (except to note that your
+license differs from this License) and (b) otherwise make it clear
+that Your version of the license contains terms which differ from the
+Sun Public License. (Filling in the name of the Initial Developer,
+Original Code or Contributor in the notice described in Exhibit A
+shall not of themselves be deemed to be modifications of this
+License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "../AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION.
+
+8.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement
+claim (excluding declaratory judgment actions) against Initial Developer
+or a Contributor (the Initial Developer or Contributor against whom
+You file such action is referred to as "Participant") alleging
+that:
+
+(a) such Participant`s Contributor Version directly or indirectly
+infringes any patent, then any and all rights granted by such
+Participant to You under Sections 2.1 and/or 2.2 of this License
+shall, upon 60 days notice from Participant terminate prospectively,
+unless if within 60 days after receipt of notice You either: (i)
+agree in writing to pay Participant a mutually agreeable reasonable
+royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to
+the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not
+mutually agreed upon in writing by the parties or the litigation claim
+is not withdrawn, the rights granted by Participant to You under
+Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b)
+and 2.2(b) are revoked effective as of the date You first made, used,
+sold, distributed, or had made, Modifications made by that
+Participant.
+
+8.3. If You assert a patent infringement claim against Participant
+alleging that such Participant`s Contributor Version directly or
+indirectly infringes any patent where such claim is resolved (such as
+by license or settlement) prior to the initiation of patent
+infringement litigation, then the reasonable value of the licenses
+granted by such Participant under Sections 2.1 or 2.2 shall be taken
+into account in determining the amount or value of any payment or
+license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above,
+all
+end user license agreements (excluding distributors and resellers)
+which have been validly granted by You or any distributor hereunder
+prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+The Covered Code is a "commercial item," as that term is defined in
+48
+C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
+and "commercial computer software documentation,"../ as such terms are
+used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
+12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all
+U.S. Government End Users acquire Covered Code with only those rights
+set forth herein.
+
+11. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. This License shall be governed by
+California law provisions (except to the extent applicable law, if
+any, provides otherwise), excluding its conflict-of-law provisions.
+With respect to disputes in which at least one party is a citizen of,
+or an entity chartered or registered to do business in the United
+States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern
+District of California, with venue lying in Santa Clara County,
+California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys` fees and
+expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded.
+Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this
+License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License and You agree to
+work with Initial Developer and Contributors to distribute such
+responsibility on an equitable basis. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+Initial Developer may designate portions of the Covered Code as
+?Multiple-Licensed?. ?Multiple-Licensed? means that the Initial
+Developer permits you to utilize portions of the Covered Code under
+Your choice of the alternative licenses, if any, specified by the
+Initial Developer in the file described in Exhibit A.
+
+Exhibit A -Sun Public License Notice.
+
+The contents of this file are subject to the Sun Public License
+
+Version 1.0 (the License); you may not use this file except in
+
+compliance with the License. A copy of the License is available at
+
+http://www.sun.com/
+
+The Original Code is _________________. The Initial Developer of the
+
+Original Code is ___________. Portions created by ______ are Copyright
+
+(C)_________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+
+of the _____ license (the ?[___] License?), in which case the
+
+provisions of [______] License are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the
+
+terms of the [____] License and not to allow others to use your
+
+version of this file under the SPL, indicate your decision by deleting
+
+the provisions above and replace them with the notice and other
+
+provisions required by the [___] License. If you do not delete the
+
+provisions above, a recipient may use your version of this file under
+
+either the SPL or the [___] License.
+[NOTE: The text of this Exhibit A may differ slightly from the text of
+
+the notices in the Source Code files of the Original Code. You should
+
+use the text of this Exhibit A rather than the text found in the
+
+Original Code Source Code for Your Modifications.]
+
diff --git a/poky/meta/files/common-licenses/Simple-2.0 b/poky/meta/files/common-licenses/Simple-2.0
new file mode 100644
index 000000000..d28357d5f
--- /dev/null
+++ b/poky/meta/files/common-licenses/Simple-2.0
@@ -0,0 +1,27 @@
+
+Simple Public License (SimPL)
+
+Preamble
+This Simple Public License 2.0 (SimPL 2.0 for short) is a plain language implementation of GPL 2.0. The words are different, but the goal is the same - to guarantee for all users the freedom to share and change software. If anyone wonders about the meaning of the SimPL, they should interpret it as consistent with GPL 2.0.
+Simple Public License (SimPL) 2.0
+The SimPL applies to the software`s source and object code and comes with any rights that I have in it (other than trademarks). You agree to the SimPL by copying, distributing, or making a derivative work of the software.
+
+You get the royalty free right to:
+Use the software for any purpose;
+Make derivative works of it (this is called a "Derived Work");
+Copy and distribute it and any Derived Work.
+If you distribute the software or a Derived Work, you must give back to the community by:
+Prominently noting the date of any changes you make;
+Leaving other people`s copyright notices, warranty disclaimers, and license terms in place;
+Providing the source code, build scripts, installation scripts, and interface definitions in a form that is easy to get and best to modify;
+Licensing it to everyone under SimPL, or substantially similar terms (such as GPL 2.0), without adding further restrictions to the rights provided;
+Conspicuously announcing that it is available under that license.
+There are some things that you must shoulder:
+You get NO WARRANTIES. None of any kind;
+If the software damages you in any way, you may only recover direct damages up to the amount you paid for it (that is zero if you did not pay anything). You may not recover any other damages, including those called "consequential damages." (The state or country where you live may not allow you to limit your liability in this way, so this may not apply to you);
+The SimPL continues perpetually, except that your license rights end automatically if:
+You do not abide by the "give back to the community" terms (your licensees get to keep their rights if they abide);
+Anyone prevents you from distributing the software under the terms of the SimPL.
+License for the License
+You may do anything that you want with the SimPL text; it`s a license form to use in any way that you find helpful. To avoid confusion, however, if you change the terms in any way then you may not call your license the Simple Public License or the SimPL (but feel free to acknowledge that your license is "based on the Simple Public License").
+
diff --git a/poky/meta/files/common-licenses/Sleepycat b/poky/meta/files/common-licenses/Sleepycat
new file mode 100644
index 000000000..02e9d84f7
--- /dev/null
+++ b/poky/meta/files/common-licenses/Sleepycat
@@ -0,0 +1,90 @@
+
+The Sleepycat License
+Copyright (c) 1990-1999
+Sleepycat Software. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Redistributions in any form must be accompanied by information on
+how to obtain complete source code for the DB software and any
+accompanying software that uses the DB software. The source code
+must either be included in the distribution or be available for no
+more than the cost of distribution plus a nominal fee, and must be
+freely redistributable under reasonable conditions. For an
+executable file, complete source code means the source code for all
+modules it contains. It does not include source code for modules or
+files that typically accompany the major components of the operating
+system on which the executable file runs.
+THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS`` AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL SLEEPYCAT SOFTWARE
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+Copyright (c) 1990, 1993, 1994, 1995
+The Regents of the University of California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the University nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS`` AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Copyright (c) 1995, 1996
+The President and Fellows of Harvard University. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the University nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS`` AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/SugarCRM-1 b/poky/meta/files/common-licenses/SugarCRM-1
new file mode 100644
index 000000000..acbb4e0bd
--- /dev/null
+++ b/poky/meta/files/common-licenses/SugarCRM-1
@@ -0,0 +1,431 @@
+
+SUGARCRM PUBLIC LICENSE
+
+Version 1.1.3
+
+The SugarCRM Public License Version ("SPL") consists of the Mozilla
+Public License Version 1.1, modified to be specific to SugarCRM, with the
+Additional Terms in Exhibit B. The original Mozilla Public License 1.1 can be
+found at: http://www.mozilla.org/MPL/MPL-1.1.html
+
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+1.1. ''Contributor'' means each entity that creates or contributes to the
+creation of Modifications.
+
+1.2. ''Contributor Version'' means the combination of the Original Code, prior
+Modifications used by a Contributor, and the Modifications made by that
+particular Contributor.
+
+1.3. ''Covered Code'' means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case including
+portions thereof.
+
+1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted
+in the software development community for the electronic transfer of data.
+
+1.5. ''Executable'' means Covered Code in any form other than Source Code.
+
+1.6. ''Initial Developer'' means the individual or entity identified as the
+Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ''Larger Work'' means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.8. ''License'' means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. ''Modifications'' means any addition to or deletion from the substance or
+structure of either the Original Code or any previous Modifications. When
+Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous
+Modifications.
+1.10. ''Original Code'' means Source Code of computer software code which is
+described in the Source Code notice required by Exhibit A as Original Code, and
+which, at the time of its release under this License is not already Covered
+Code governed by this License.
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+1.11. ''Source Code'' means the preferred form of the Covered Code for making
+modifications to it, including all modules it contains, plus any associated
+interface definition files, scripts used to control compilation and
+installation of an Executable, or source code differential comparisons against
+either the Original Code or another well known, available Covered Code of the
+Contributor's choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is widely
+available for no charge.
+
+1.12. "You'' (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this License
+or a future version of this License issued under Section 6.1. For legal
+entities, "You'' includes any entity which controls, is controlled by, or
+is under common control with You. For purposes of this definition,
+"control'' means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark)
+Licensable by Initial Developer to use, reproduce, modify, display, perform,
+sublicense and distribute the Original Code (or portions thereof) with or
+without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original
+Code, to make, have made, use, practice, sell, and offer for sale, and/or
+otherwise dispose of the Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the
+date Initial Developer first distributes Original Code under the terms of this
+License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for
+code that You delete from the Original Code; 2) separate from the Original
+Code; or 3) for infringements caused by: i) the modification of the Original
+Code or ii) the combination of the Original Code with other software or
+devices.
+2.2. Contributor Grant.
+Subject to third party intellectual property claims, each Contributor hereby
+grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or trademark)
+Licensable by Contributor, to use, reproduce, modify, display, perform,
+sublicense and distribute the Modifications created by such Contributor (or
+portions thereof) either on an unmodified basis, with other Modifications, as
+Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of
+Modifications made by that Contributor either alone and/or in combination with
+its Contributor Version (or portions of such combination), to make, use, sell,
+offer for sale, have made, and/or otherwise dispose of: 1) Modifications made
+by that Contributor (or portions thereof); and 2) the combination of
+Modifications made by that Contributor with its Contributor Version (or
+portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the
+date Contributor first makes Commercial Use of the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for
+any code that Contributor has deleted from the Contributor Version; 2) separate
+from the Contributor Version; 3) for infringements caused by: i) third party
+modifications of Contributor Version or ii) the combination of Modifications
+made by that Contributor with other software (except as part of the Contributor
+Version) or other devices; or 4) under Patent Claims infringed by Covered Code
+in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made
+available in Source Code form under the terms of this License either on the
+same media as an Executable version or via an accepted Electronic Distribution
+Mechanism to anyone to whom you made an Executable version available; and if
+made available via Electronic Distribution Mechanism, must remain available for
+at least twelve (12) months after the date it initially became available, or at
+least six (6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for ensuring
+that the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party's intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the Source
+Code distribution titled "LEGAL'' which describes the claim and the party
+making the claim in sufficient detail that a recipient will know whom to
+contact. If Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly modify the
+LEGAL file in all copies Contributor makes available thereafter and shall take
+other steps (such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered Code that new
+knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor's Modifications include an application programming interface and
+Contributor has knowledge of patent licenses which are reasonably necessary to
+implement that API, Contributor must also include this information in the LEGAL
+file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a)
+above, Contributor believes that Contributor's Modifications are Contributor's
+original creation(s) and/or Contributor has sufficient rights to grant the
+rights conveyed by this License.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then You must include such notice in a location (such as a
+relevant directory) where a user would be likely to look for such a notice. If
+You created one or more Modification(s) You may add your name as a Contributor
+to the notice described in Exhibit A. You must also duplicate this License in
+any documentation for the Source Code where You describe recipients' rights or
+ownership rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to one
+or more recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any Contributor. You must
+make it absolutely clear than any such warranty, support, indemnity or
+liability obligation is offered by You alone, and You hereby agree to indemnify
+the Initial Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty, support,
+indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code, and if You include a
+notice stating that the Source Code version of the Covered Code is available
+under the terms of this License, including a description of how and where You
+have fulfilled the obligations of Section 3.2. The notice must be conspicuously
+included in any notice in an Executable version, related documentation or
+collateral in which You describe recipients' rights relating to the Covered
+Code. You may distribute the Executable version of Covered Code or ownership
+rights under a license of Your choice, which may contain terms different from
+this License, provided that You are in compliance with the terms of this
+License and that the license for the Executable version does not attempt to
+limit or alter the recipient's rights in the Source Code version from the
+rights set forth in this License. If You distribute the Executable version
+under a different license You must make it absolutely clear that any terms
+which differ from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the Initial
+Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute, judicial order,
+or regulation then You must: (a) comply with the terms of this License to the
+maximum extent possible; and (b) describe the limitations and the code they
+affect. Such description must be included in the LEGAL file described in
+Section 3.4 and must be included with all distributions of the Source Code.
+Except to the extent prohibited by statute or regulation, such description must
+be sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+6.1. New Versions.
+SugarCRM Inc. (''SugarCRM'') may publish revised and/or new versions of the
+License from time to time. Each version will be given a distinguishing version
+number.
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License published by SugarCRM. No one other than SugarCRM has the right to
+modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works.
+If You create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), You must (a) rename Your license so that the phrases ''SugarCRM'',
+''SPL'' or any confusingly similar phrase do not appear in your license (except
+to note that your license differs from this License) and (b) otherwise make it
+clear that Your version of the license contains terms which differ from the
+SugarCRM Public License. (Filling in the name of the Initial Developer,
+Original Code or Contributor in the notice described in Exhibit A shall not of
+themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION.
+8.1. This License and the rights granted hereunder will terminate automatically
+if You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+8.2. If You initiate litigation by asserting a patent infringement claim
+(excluding declatory judgment actions) against Initial Developer or a
+Contributor (the Initial Developer or Contributor against whom You file such
+action is referred to as "Participant") alleging that:
+
+(a) such Participant's Contributor Version directly or indirectly infringes any
+patent, then any and all rights granted by such Participant to You under
+Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from
+Participant terminate prospectively, unless if within 60 days after receipt of
+notice You either: (i) agree in writing to pay Participant a mutually agreeable
+reasonable royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to the
+Contributor Version against such Participant. If within 60 days of notice, a
+reasonable royalty and payment arrangement are not mutually agreed upon in
+writing by the parties or the litigation claim is not withdrawn, the rights
+granted by Participant to You under Sections 2.1 and/or 2.2 automatically
+terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant's
+Contributor Version, directly or indirectly infringes any patent, then any
+rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are
+revoked effective as of the date You first made, used, sold, distributed, or
+had made, Modifications made by that Participant.
+
+8.3. If You assert a patent infringement claim against Participant alleging
+that such Participant's Contributor Version directly or indirectly infringes
+any patent where such claim is resolved (such as by license or settlement)
+prior to the initiation of patent infringement litigation, then the reasonable
+value of the licenses granted by such Participant under Sections 2.1 or 2.2
+shall be taken into account in determining the amount or value of any payment
+or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user
+license agreements (excluding distributors and resellers) which have been
+validly granted by You or any distributor hereunder prior to termination shall
+survive termination.
+
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY
+OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING
+FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R.
+2.101 (Oct. 1995), consisting of ''commercial computer software'' and
+''commercial computer software documentation,'' as such terms are used in 48
+C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
+227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
+acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by California law provisions
+(except to the extent applicable law, if any, provides otherwise), excluding
+its conflict-of-law provisions. With respect to disputes in which at least one
+party is a citizen of, or an entity chartered or registered to do business in
+the United States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern District of
+California, with venue lying in Santa Clara County, California, with the losing
+party responsible for costs, including without limitation, court costs and
+reasonable attorneys' fees and expenses. The application of the United Nations
+Convention on Contracts for the International Sale of Goods is expressly
+excluded. Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer and the Contributors, each party is responsible
+for claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Initial Developer and
+Contributors to distribute such responsibility on an equitable basis. Nothing
+herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as
+"Multiple-Licensed". "Multiple-Licensed" means that the
+Initial Developer permits you to utilize portions of the Covered Code under
+Your choice of the SPL or the alternative licenses, if any, specified by the
+Initial Developer in the file described in Exhibit A.
+SugarCRM Public License 1.1.3 - Exhibit A
+
+The contents of this file are subject to the SugarCRM Public License Version
+1.1.3
+("License"); You may not use this file except in compliance with the
+License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+Software distributed under the License is distributed on an "AS IS"
+basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+the specific language governing rights and limitations under the License.
+
+The Original Code is: SugarCRM Open Source
+
+The Initial Developer of the Original Code is SugarCRM, Inc.
+Portions created by SugarCRM are Copyright (C) 2004 SugarCRM, Inc.;
+All Rights Reserved.
+Contributor(s): ______________________________________.
+[NOTE: The text of this Exhibit A may differ slightly from the text of the
+notices in the Source Code files of the Original Code. You should use the text
+of this Exhibit A rather than the text found in the Original Code Source Code
+for Your Modifications.]
+
+SugarCRM Public License 1.1.3 - Exhibit B
+
+Additional Terms applicable to the SugarCRM Public License.
+
+I. Effect.
+These additional terms described in this SugarCRM Public License &ndash;
+Additional Terms shall apply to the Covered Code under this License.
+
+II. SugarCRM and logo.
+This License does not grant any rights to use the trademarks
+"SugarCRM" and the "SugarCRM" logos even if such marks are
+included in the Original Code or Modifications.
+
+However, in addition to the other notice obligations, all copies of the Covered
+Code in Executable and Source Code form distributed must, as a form of
+attribution of the original author, include on each user interface screen (i)
+the "Powered by SugarCRM" logo and (ii) the copyright notice in the
+same form as the latest version of the Covered Code distributed by SugarCRM,
+Inc. at the time of distribution of such copy. In addition, the "Powered
+by SugarCRM" logo must be visible to all users and be located at the very
+bottom center of each user interface screen. Notwithstanding the above, the
+dimensions of the "Powered By SugarCRM" logo must be at least 106 x
+23 pixels. When users click on the "Powered by SugarCRM" logo it must
+direct them back to http://www.sugarforge.org. In addition, the copyright
+notice must remain visible to all users at all times at the bottom of the user
+interface screen. When users click on the copyright notice, it must direct them
+back to http://www.sugarcrm.com
+
+
+
+
+
+
diff --git a/poky/meta/files/common-licenses/SugarCRM-1.1.3 b/poky/meta/files/common-licenses/SugarCRM-1.1.3
new file mode 100644
index 000000000..509681a8c
--- /dev/null
+++ b/poky/meta/files/common-licenses/SugarCRM-1.1.3
@@ -0,0 +1,160 @@
+
+SUGARCRM PUBLIC LICENSE
+
+Version 1.1.3
+
+The SugarCRM Public License Version ("SPL") consists of the Mozilla Public License Version 1.1, modified to be specific to SugarCRM, with the Additional Terms in Exhibit B. The original Mozilla Public License 1.1 can be found at: http://www.mozilla.org/MPL/MPL-1.1.html
+
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
+1.1. ``Contributor`` means each entity that creates or contributes to the creation of Modifications.
+
+1.2. ``Contributor Version`` means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. ``Modifications`` means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous Modifications.
+1.10. ``Original Code`` means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. "You`` (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You`` includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control`` means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+2.2. Contributor Grant.
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL`` which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+6.1. New Versions.
+SugarCRM Inc. (``SugarCRM``) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by SugarCRM. No one other than SugarCRM has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works.
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ``SugarCRM``, ``SPL`` or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the SugarCRM Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS`` BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+(a) such Participant`s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ``commercial item,`` as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software`` and ``commercial computer software documentation,`` as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys` fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as &#8220;Multiple-Licensed&#8221;. &#8220;Multiple-Licensed&#8221; means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the SPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+SugarCRM Public License 1.1.3 - Exhibit A
+
+The contents of this file are subject to the SugarCRM Public License Version 1.1.3
+("License"); You may not use this file except in compliance with the
+License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+the specific language governing rights and limitations under the License.
+
+The Original Code is: SugarCRM Open Source
+
+The Initial Developer of the Original Code is SugarCRM, Inc.
+Portions created by SugarCRM are Copyright (C) 2004 SugarCRM, Inc.;
+All Rights Reserved.
+Contributor(s): ______________________________________.
+[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+
+SugarCRM Public License 1.1.3 - Exhibit B
+
+Additional Terms applicable to the SugarCRM Public License.
+
+I. Effect.
+These additional terms described in this SugarCRM Public License &#8211; Additional Terms shall apply to the Covered Code under this License.
+
+II. SugarCRM and logo.
+This License does not grant any rights to use the trademarks "SugarCRM" and the "SugarCRM" logos even if such marks are included in the Original Code or Modifications.
+
+However, in addition to the other notice obligations, all copies of the Covered Code in Executable and Source Code form distributed must, as a form of attribution of the original author, include on each user interface screen (i) the "Powered by SugarCRM" logo and (ii) the copyright notice in the same form as the latest version of the Covered Code distributed by SugarCRM, Inc. at the time of distribution of such copy. In addition, the "Powered by SugarCRM" logo must be visible to all users and be located at the very bottom center of each user interface screen. Notwithstanding the above, the dimensions of the "Powered By SugarCRM" logo must be at least 106 x 23 pixels. When users click on the "Powered by SugarCRM" logo it must direct them back to http://www.sugarforge.org. In addition, the copyright notice must remain visible to all users at all times at the bottom of the user interface screen. When users click on the copyright notice, it must direct them back to http://www.sugarcrm.com
+
diff --git a/poky/meta/files/common-licenses/UCB b/poky/meta/files/common-licenses/UCB
new file mode 100644
index 000000000..79a757af9
--- /dev/null
+++ b/poky/meta/files/common-licenses/UCB
@@ -0,0 +1,26 @@
+ Copyright (c) 1987, 1989, 1990, 1991, 1992, 1993, 1994
+ The Regents of the University of California. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
diff --git a/poky/meta/files/common-licenses/VSL-1.0 b/poky/meta/files/common-licenses/VSL-1.0
new file mode 100644
index 000000000..36bae5c63
--- /dev/null
+++ b/poky/meta/files/common-licenses/VSL-1.0
@@ -0,0 +1,49 @@
+
+Vovida Software License v. 1.0
+
+This license applies to all software incorporated in the "Vovida
+Open Communication Application Library" except for those portions
+incorporating third party software specifically identified as being
+licensed under separate license.
+
+The Vovida Software License, Version 1.0
+Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the
+distribution.
+
+3. The names "VOCAL", "Vovida Open Communication Application Library",
+and "Vovida Open Communication Application Library (VOCAL)" must
+not be used to endorse or promote products derived from this
+software without prior written permission. For written
+permission, please contact vocal@vovida.org.
+
+4. Products derived from this software may not be called "VOCAL", nor
+may "VOCAL" appear in their name, without prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
+NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DAMAGES
+IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+
+
diff --git a/poky/meta/files/common-licenses/W3C b/poky/meta/files/common-licenses/W3C
new file mode 100644
index 000000000..e4b8c4683
--- /dev/null
+++ b/poky/meta/files/common-licenses/W3C
@@ -0,0 +1,17 @@
+
+W3C SOFTWARE NOTICE AND LICENSE
+This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+License
+By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+Disclaimers
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+Notes
+This version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+This formulation of W3C`s notice and license became active on December 31 2002. This version removes the copyright ownership notice such that this license can be used with materials other than those owned by the W3C, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the license, and removes the ambiguous grant of "use". Otherwise, this version is the same as the previous version and is written so as to preserve the Free Software Foundation`s assessment of GPL compatibility and OSI`s certification under the Open Source Definition.
+
diff --git a/poky/meta/files/common-licenses/WXwindows b/poky/meta/files/common-licenses/WXwindows
new file mode 100644
index 000000000..1fe09482d
--- /dev/null
+++ b/poky/meta/files/common-licenses/WXwindows
@@ -0,0 +1,55 @@
+
+ wxWindows Library Licence, Version 3.1
+ ======================================
+
+ Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this licence document, but changing it is not allowed.
+
+ WXWINDOWS LIBRARY LICENCE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public Licence as published by
+ the Free Software Foundation; either version 2 of the Licence, or (at
+ your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
+ General Public Licence for more details.
+
+ You should have received a copy of the GNU Library General Public Licence
+ along with this software, usually in a file named COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ Boston, MA 02111-1307 USA.
+
+ EXCEPTION NOTICE
+
+ 1. As a special exception, the copyright holders of this library give
+ permission for additional uses of the text contained in this release of
+ the library as licenced under the wxWindows Library Licence, applying
+ either version 3.1 of the Licence, or (at your option) any later version of
+ the Licence as published by the copyright holders of version
+ 3.1 of the Licence document.
+
+ 2. The exception is that you may use, copy, link, modify and distribute
+ under your own terms, binary object code versions of works based
+ on the Library.
+
+ 3. If you copy code from files distributed under the terms of the GNU
+ General Public Licence or the GNU Library General Public Licence into a
+ copy of this library, as this licence permits, the exception does not
+ apply to the code that you add in this way. To avoid misleading anyone as
+ to the status of such modified files, you must delete this exception
+ notice from such code and/or adjust the licensing conditions notice
+ accordingly.
+
+ 4. If you write modifications of your own for this library, it is your
+ choice whether to permit this exception to apply to your modifications.
+ If you do not wish that, you must delete the exception notice from such
+ code and/or adjust the licensing conditions notice accordingly.
+
+
+
diff --git a/poky/meta/files/common-licenses/Watcom-1.0 b/poky/meta/files/common-licenses/Watcom-1.0
new file mode 100644
index 000000000..6bb619a9d
--- /dev/null
+++ b/poky/meta/files/common-licenses/Watcom-1.0
@@ -0,0 +1,140 @@
+
+Sybase Open Watcom Public License version 1.0
+
+USE OF THE SYBASE OPEN WATCOM SOFTWARE DESCRIBED BELOW ("SOFTWARE") IS SUBJECT TO THE TERMS AND CONDITIONS SET FORTH IN THE SYBASE OPEN WATCOM PUBLIC LICENSE SET FORTH BELOW ("LICENSE"). YOU MAY NOT USE THE SOFTWARE IN ANY MANNER UNLESS YOU ACCEPT THE TERMS AND CONDITIONS OF THE LICENSE. YOU INDICATE YOUR ACCEPTANCE BY IN ANY MANNER USING (INCLUDING WITHOUT LIMITATION BY REPRODUCING, MODIFYING OR DISTRIBUTING) THE SOFTWARE. IF YOU DO NOT ACCEPT ALL OF THE TERMS AND CONDITIONS OF THE LICENSE, DO NOT USE THE SOFTWARE IN ANY MANNER.
+
+Sybase Open Watcom Public License version 1.0
+1. General; Definitions. This License applies only to the following software programs: the open source versions of Sybase`s Watcom C/C++ and Fortran compiler products ("Software"), which are modified versions of, with significant changes from, the last versions made commercially available by Sybase. As used in this License:
+
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Sybase is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Sybase and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+
+1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Sybase under this License, including the Source Code of any updates or upgrades to such programs or works made available by Sybase under this License, and that has been expressly identified by Sybase as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Sybase under this License.
+
+
+1.8 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+
+1.9 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+
+1.10 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+
+2. Permitted Uses; Conditions &amp; Restrictions.Subject to the terms and conditions of this License, Sybase hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Sybase`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+
+2.1 You may use, reproduce, display, perform, modify and distribute Original Code, with or without Modifications, solely for Your internal research and development and/or Personal Use, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Sybase as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and
+
+(b) You must retain and reproduce a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+(c) Whenever reasonably feasible you should include the copy of this License in a click-wrap format, which requires affirmative acceptance by clicking on an "I accept" button or similar mechanism. If a click-wrap format is not included, you must include a statement that any use (including without limitation reproduction, modification or distribution) of the Software, and any other affirmative act that you define, constitutes acceptance of the License, and instructing the user not to use the Covered Code in any manner if the user does not accept all of the terms and conditions of the License.
+
+
+2.2 You may use, reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code;
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change;
+
+(c) You must make Source Code of all Your Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site);
+
+(d) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code; and
+
+(e) the object code form of the Covered Code may be distributed under Your own license agreement, provided that such license agreement contains terms no less protective of Sybase and each Contributor than the terms of this License, and stating that any provisions which differ from this License are offered by You alone and not by any other party.
+
+
+2.3 You expressly acknowledge and agree that although Sybase and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Sybase or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Sybase and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to Sybase and all third parties a non-exclusive, royalty-free license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Sybase`s licenses under Sections 2.1 and 2.2.
+
+
+4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof.
+
+
+5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Sybase herein. Modifications and/or Larger Works may require additional patent licenses from Sybase which Sybase may grant in its sole discretion.
+
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with this License ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Sybase or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Sybase and every Contributor harmless for any liability incurred by or claims asserted against Sybase or such Contributor by reason of any such Additional Terms.
+
+
+7. Versions of the License. Sybase may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Sybase. No one other than Sybase has the right to modify the terms applicable to Covered Code created under this License.
+
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND SYBASE AND SYBASE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "SYBASE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. SYBASE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY SYBASE, A SYBASE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL SYBASE OR ANY CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR OTHER DAMAGES OF ANY KIND ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF SYBASE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL OR OTHER DAMAGES OF ANY KIND, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Sybase`s or any Contributor`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of five hundred dollars ($500.00).
+
+
+10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Sybase" or any other trademarks or trade names belonging to Sybase (collectively "Sybase Marks") or to any trademark or trade name belonging to any Contributor("Contributor Marks"). No Sybase Marks or Contributor Marks may be used to endorse or promote products derived from the Original Code or Covered Code other than with the prior written consent of Sybase or the Contributor, as applicable.
+
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Sybase retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Sybase ("Sybase Modifications"), and such Sybase Modifications will not be automatically subject to this License. Sybase may, at its sole discretion, choose to license such Sybase Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+
+12.1 Termination. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+
+(c) automatically without notice if You, at any time during the term of this License, commence an action for patent infringement (including as a cross claim or counterclaim) against Sybase or any Contributor.
+
+
+12.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code that have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+
+13. Miscellaneous.
+
+
+13.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+
+13.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among you, Sybase or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+
+13.3 Independent Development. Nothing in this License will impair Sybase`s or any Contributor`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+
+13.4 Waiver; Construction. Failure by Sybase or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+
+13.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution between You and Sybase relating to this License shall take place in the Northern District of California, and You and Sybase hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+
+13.7 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law.
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#232; que le pr&#232;sent contrat et tous les documents connexes soient r&#232;di&#232;s en anglais.
+
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Sybase Open Watcom Public License version 1.0 (the `License`). You may not use this file except in compliance with the License. BY USING THIS FILE YOU AGREE TO ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is provided with the Original Code and Modifications, and is also available at www.sybase.com/developer/opensource.
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the specific language governing rights and limitations under the License."
+
diff --git a/poky/meta/files/common-licenses/XFree86-1.0 b/poky/meta/files/common-licenses/XFree86-1.0
new file mode 100644
index 000000000..b1f3bf45b
--- /dev/null
+++ b/poky/meta/files/common-licenses/XFree86-1.0
@@ -0,0 +1,22 @@
+Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the XFree86 Project.
diff --git a/poky/meta/files/common-licenses/XFree86-1.1 b/poky/meta/files/common-licenses/XFree86-1.1
new file mode 100644
index 000000000..c2a5cb202
--- /dev/null
+++ b/poky/meta/files/common-licenses/XFree86-1.1
@@ -0,0 +1,18 @@
+
+XFree86 License (version 1.1)
+
+Copyright (C) 1994-2006 The XFree86 Project, Inc.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution, and in the same place and form as other copyright, license and disclaimer information.
+
+3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors", in the same place and form as other third-party acknowledgments. Alternately, this acknowledgment may appear in the software itself, in the same form and location as other such third-party acknowledgments.
+
+4. Except as contained in this notice, the name of The XFree86 Project, Inc shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The XFree86 Project, Inc.
+
+THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/XSL b/poky/meta/files/common-licenses/XSL
new file mode 100644
index 000000000..0a82d60c1
--- /dev/null
+++ b/poky/meta/files/common-licenses/XSL
@@ -0,0 +1,48 @@
+Copyright
+---------
+Copyright (C) 1999-2007 Norman Walsh
+Copyright (C) 2003 Jiří Kosek
+Copyright (C) 2004-2007 Steve Ball
+Copyright (C) 2005-2008 The DocBook Project
+Copyright (C) 2011-2012 O'Reilly Media
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the ``Software''), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Except as contained in this notice, the names of individuals
+credited with contribution to this software shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization
+from the individuals in question.
+
+Any stylesheet derived from this Software that is publically
+distributed will be identified with a different name and the
+version strings in any derived Software will be changed so that
+no possibility of confusion between the derived package and this
+Software will exist.
+
+Warranty
+--------
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
+CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Contacting the Author
+---------------------
+The DocBook XSL stylesheets are maintained by Norman Walsh,
+<ndw@nwalsh.com>, and members of the DocBook Project,
+<docbook-developers@sf.net>
diff --git a/poky/meta/files/common-licenses/Xnet b/poky/meta/files/common-licenses/Xnet
new file mode 100644
index 000000000..0444edf2c
--- /dev/null
+++ b/poky/meta/files/common-licenses/Xnet
@@ -0,0 +1,27 @@
+
+The X.Net, Inc. License
+This License has been voluntarily deprecated by its author.
+
+Copyright (c) 2000-2001 X.Net, Inc. Lafayette, California, USA
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+This agreement shall be governed in all respects by the laws of the State of
+California and by the laws of the United States of America.
+
diff --git a/poky/meta/files/common-licenses/YPL-1.1 b/poky/meta/files/common-licenses/YPL-1.1
new file mode 100644
index 000000000..4a1880aa1
--- /dev/null
+++ b/poky/meta/files/common-licenses/YPL-1.1
@@ -0,0 +1,30 @@
+
+Yahoo! Public License, Version 1.1 (YPL)
+This Yahoo! Public License (this "Agreement") is a legal agreement that describes the terms under which Yahoo! Inc., a Delaware corporation having its principal place of business at 701 First Avenue, Sunnyvale, California 94089 ("Yahoo!") will provide software to you via download or otherwise ("Software"). By using the Software, you, an individual or an entity ("You") agree to the terms of this Agreement.
+
+In consideration of the mutual promises and upon the terms and conditions set forth below, the parties agree as follows:
+
+Grant of Copyright License
+1.1 - Subject to the terms and conditions of this Agreement, Yahoo! hereby grants to You, under any and all of its copyright interest in and to the Software, a royalty-free, non-exclusive, non-transferable license to copy, modify, compile, execute, and distribute the Software and Modifications. For the purposes of this Agreement, any change to, addition to, or abridgement of the Software made by You is a "Modification;" however, any file You add to the Software that does not contain any part of the Software is not a "Modification."
+1.2 - If You are an individual acting on behalf of a corporation or other entity, Your use of the Software or any Modification is subject to Your having the authority to bind such corporation or entity to this Agreement. Providing copies to persons within such corporation or entity is not considered distribution for purposes of this Agreement.
+1.3 - For the Software or any Modification You distribute in source code format, You must do so only under the terms of this Agreement, and You must include a complete copy of this Agreement with Your distribution. With respect to any Modification You distribute in source code format, the terms of this Agreement will apply to You in the same way those terms apply to Yahoo! with respect to the Software. In other words, when You are distributing Modifications under this Agreement, You "stand in the shoes" of Yahoo! in terms of the rights You grant and how the terms and conditions apply to You and the licensees of Your Modifications. Notwithstanding the foregoing, when You "stand in the shoes" of Yahoo!, You are not subject to the jurisdiction provision under Section 7, which requires all disputes under this Agreement to be subject to the jurisdiction of federal or state courts of northern California.
+1.4 - For the Software or any Modification You distribute in compiled or object code format, You must also provide recipients with access to the Software or Modification in source code format along with a complete copy of this Agreement. The distribution of the Software or Modifications in compiled or object code format may be under a license of Your choice, provided that You are in compliance with the terms of this Agreement. In addition, You must make absolutely clear that any license terms applying to such Software or Modification that differ from this Agreement are offered by You alone and not by Yahoo!, and that such license does not restrict recipients from exercising rights in the source code to the Software granted by Yahoo! under this Agreement or rights in the source code to any Modification granted by You as described in Section 1.3.
+1.5 - This Agreement does not limit Your right to distribute files that are entirely Your own work (i.e., which do not incorporate any portion of the Software and are not Modifications) under any terms You choose.
+Support
+Yahoo! has no obligation to provide technical support or updates to You. Nothing in this Agreement requires Yahoo! to enter into any license with You for any other edition of the Software.
+Intellectual Property Rights
+3.1 - Except for the license expressly granted under copyright in Section 1.1, no rights, licenses or forbearances are granted or may arise in relation to this Agreement whether expressly, by implication, exhaustion, estoppel or otherwise. All rights, including all intellectual property rights, that are not expressly granted under this Agreement are hereby reserved.
+3.2 - In any copy of the Software or in any Modification you create, You must retain and reproduce, any and all copyright, patent, trademark, and attribution notices that are included in the Software in the same form as they appear in the Software. This includes the preservation of attribution notices in the form of trademarks or logos that exist within a user interface of the Software.
+3.3 - This license does not grant You rights to use any party`s name, logo, or trademarks, except solely as necessary to comply with Section 3.2.
+Disclaimer of Warranties
+THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND. YAHOO! MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY REGARDING OR RELATING TO THE SOFTWARE. SPECIFICALLY, YAHOO! DOES NOT WARRANT THAT THE SOFTWARE WILL BE ERROR FREE OR WILL PERFORM IN AN UNINTERRUPTED MANNER. TO THE GREATEST EXTENT ALLOWED BY LAW, YAHOO! SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (EVEN IF YAHOO! HAD BEEN INFORMED OF SUCH PURPOSE), AND NONINFRINGEMENT WITH RESPECT TO THE SOFTWARE, ANY MODIFICATIONS THERETO AND WITH RESPECT TO THE USE OF THE FOREGOING.
+Limitation of Liability
+IN NO EVENT WILL YAHOO! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING WITHOUT LIMITATION LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, LOSS OF DATA, COST OF COVER) IN CONNECTION WITH OR ARISING OUT OF OR RELATING TO THE FURNISHING, PERFORMANCE OR USE OF THE SOFTWARE OR ANY OTHER RIGHTS GRANTED HEREUNDER, WHETHER ALLEGED AS A BREACH OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, AND EVEN IF YAHOO! HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+Term and Termination
+6.1 - This Agreement will continue in effect unless and until terminated earlier pursuant to this Section 6.
+6.2 - In the event You violate the terms of this Agreement, Yahoo! may terminate this Agreement.
+6.3 - All licenses granted hereunder shall terminate upon the termination of this Agreement. Termination will be in addition to any rights and remedies available to Yahoo! at law or equity or under this Agreement.
+6.4 - Termination of this Agreement will not affect the provisions regarding reservation of rights (Section 3.1), provisions disclaiming or limiting Yahoo!`s liability (Sections 4 and 5), Termination (Section 6) or Miscellaneous (Section 7), which provisions will survive termination of this Agreement.
+Miscellaneous
+This Agreement contains the entire agreement of the parties with respect to the subject matter of this Agreement and supersedes all previous communications, representations, understandings and agreements, either oral or written, between the parties with respect to said subject matter. The relationship of the parties hereunder is that of independent contractors, and this Agreement will not be construed as creating an agency, partnership, joint venture or any other form of legal association between the parties. If any term, condition, or provision in this Agreement is found to be invalid, unlawful or unenforceable to any extent, this Agreement will be construed in a manner that most closely effectuates the intent of this Agreement. Such invalid term, condition or provision will be severed from the remaining terms, conditions and provisions, which will continue to be valid and enforceable to the fullest extent permitted by law. This Agreement will be interpreted and construed in accordance with the laws of the State of California and the United States of America, without regard to conflict of law principles. The U.N. Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. All disputes arising out of this Agreement involving Yahoo! or any of its subsidiaries shall be subject to the jurisdiction of the federal or state courts of northern California, with venue lying in Santa Clara County, California. No rights may be assigned, no obligations may be delegated, and this Agreement may not be transferred by You, in whole or in part, whether voluntary or by operation of law, including by way of sale of assets, merger or consolidation, without the prior written consent of Yahoo!, and any purported assignment, delegation or transfer without such consent shall be void ab initio. Any waiver of the provisions of this Agreement or of a party`s rights or remedies under this Agreement must be in writing to be effective. Failure, neglect or delay by a party to enforce the provisions of this Agreement or its rights or remedies at any time, will not be construed or be deemed to be a waiver of such party`s rights under this Agreement and will not in any way affect the validity of the whole or any part of this Agreement or prejudice such party`s right to take subsequent action.
+
diff --git a/poky/meta/files/common-licenses/ZPL-1.1 b/poky/meta/files/common-licenses/ZPL-1.1
new file mode 100644
index 000000000..a6aabec3a
--- /dev/null
+++ b/poky/meta/files/common-licenses/ZPL-1.1
@@ -0,0 +1,28 @@
+
+Zope Public License (ZPL) Version 1.1
+
+Copyright (c) Zope Corporation. All rights reserved.
+
+This license has been certified as open source.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions in source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
+All advertising materials and documentation mentioning features derived from or use of this software must display the following acknowledgement:
+"This product includes software developed by Zope Corporation for use in the Z Object Publishing Environment (http://www.zope.com/)."
+
+In the event that the product being advertised includes an intact Zope distribution (with copyright and license included) then this clause is waived.
+
+Names associated with Zope or Zope Corporation must not be used to endorse or promote products derived from this software without prior written permission from Zope Corporation.
+Modified redistributions of any form whatsoever must retain the following acknowledgment:
+"This product includes software developed by Zope Corporation for use in the Z Object Publishing Environment (http://www.zope.com/)."
+
+Intact (re-)distributions of any official Zope release do not require an external acknowledgement.
+
+Modifications are encouraged but must be packaged separately as patches to official Zope releases. Distributions that do not clearly separate the patches from the original work must be clearly labeled as unofficial distributions. Modifications which do not carry the name Zope may be packaged in any form, as long as they conform to all of the clauses above.
+Disclaimer
+THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZOPE CORPORATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This software consists of contributions made by Zope Corporation and many individuals on behalf of Zope Corporation. Specific attributions are listed in the accompanying credits file.
+
diff --git a/poky/meta/files/common-licenses/ZPL-2.0 b/poky/meta/files/common-licenses/ZPL-2.0
new file mode 100644
index 000000000..3ae208313
--- /dev/null
+++ b/poky/meta/files/common-licenses/ZPL-2.0
@@ -0,0 +1,61 @@
+
+Zope Public License (ZPL) Version 2.0
+-----------------------------------------------
+
+This software is Copyright (c) Zope Corporation (tm) and
+Contributors. All rights reserved.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the above
+ copyright notice, this list of conditions, and the following
+ disclaimer.
+
+2. Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+3. The name Zope Corporation (tm) must not be used to
+ endorse or promote products derived from this software
+ without prior written permission from Zope Corporation.
+
+4. The right to distribute this software or to use it for
+ any purpose does not give you the right to use Servicemarks
+ (sm) or Trademarks (tm) of Zope Corporation. Use of them is
+ covered in a separate agreement (see
+ http://www.zope.com/Marks).
+
+5. If any files are modified, you must cause the modified
+ files to carry prominent notices stating that you changed
+ the files and the date of any change.
+
+Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS``
+ AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+ NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ NO EVENT SHALL ZOPE CORPORATION OR ITS CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
+
+
+This software consists of contributions made by Zope
+Corporation and many individuals on behalf of Zope
+Corporation. Specific attributions are listed in the
+accompanying credits file.
+
diff --git a/poky/meta/files/common-licenses/ZPL-2.1 b/poky/meta/files/common-licenses/ZPL-2.1
new file mode 100644
index 000000000..2d9d43f03
--- /dev/null
+++ b/poky/meta/files/common-licenses/ZPL-2.1
@@ -0,0 +1,18 @@
+
+ZPL 2.1
+Zope Public License (ZPL) Version 2.1
+
+A copyright notice accompanies this license document that identifies the copyright holders.
+
+This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer.
+Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders.
+The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders.
+If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+Disclaimer
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/poky/meta/files/common-licenses/Zimbra-1.3 b/poky/meta/files/common-licenses/Zimbra-1.3
new file mode 100644
index 000000000..79b7b346d
--- /dev/null
+++ b/poky/meta/files/common-licenses/Zimbra-1.3
@@ -0,0 +1,30 @@
+
+Zimbra Public License, Version 1.3 (ZPL)
+This Zimbra Public License (this "Agreement") is a legal agreement that describes the terms under which VMware, Inc., a Delaware corporation having its principal place of business at 3401 Hillview Avenue, Palo Alto, California 94304 ("VMware") will provide software to you via download or otherwise ("Software"). By using the Software, you, an individual or an entity ("You") agree to the terms of this Agreement.
+
+In consideration of the mutual promises and upon the terms and conditions set forth below, the parties agree as follows:
+
+1. Grant of Copyright License
+1.1 - Subject to the terms and conditions of this Agreement, VMware hereby grants to You, under any and all of its copyright interest in and to the Software, a royalty-free, non-exclusive, non-transferable license to copy, modify, compile, execute, and distribute the Software and Modifications. For the purposes of this Agreement, any change to, addition to, or abridgement of the Software made by You is a "Modification;" however, any file You add to the Software that does not contain any part of the Software is not a "Modification."
+1.2 - If You are an individual acting on behalf of a corporation or other entity, Your use of the Software or any Modification is subject to Your having the authority to bind such corporation or entity to this Agreement. Providing copies to persons within such corporation or entity is not considered distribution for purposes of this Agreement.
+1.3 - For the Software or any Modification You distribute in source code format, You must do so only under the terms of this Agreement, and You must include a complete copy of this Agreement with Your distribution. With respect to any Modification You distribute in source code format, the terms of this Agreement will apply to You in the same way those terms apply to VMware with respect to the Software. In other words, when You are distributing Modifications under this Agreement, You "stand in the shoes" of VMware in terms of the rights You grant and how the terms and conditions apply to You and the licensees of Your Modifications. Notwithstanding the foregoing, when You "stand in the shoes" of VMware, You are not subject to the jurisdiction provision under Section 7, which requires all disputes under this Agreement to be subject to the jurisdiction of federal or state courts of northern California.
+1.4 - For the Software or any Modification You distribute in compiled or object code format, You must also provide recipients with access to the Software or Modification in source code format along with a complete copy of this Agreement. The distribution of the Software or Modifications in compiled or object code format may be under a license of Your choice, provided that You are in compliance with the terms of this Agreement. In addition, You must make absolutely clear that any license terms applying to such Software or Modification that differ from this Agreement are offered by You alone and not by VMware, and that such license does not restrict recipients from exercising rights in the source code to the Software granted by VMware under this Agreement or rights in the source code to any Modification granted by You as described in Section 1.3.
+1.5 - This Agreement does not limit Your right to distribute files that are entirely Your own work (i.e., which do not incorporate any portion of the Software and are not Modifications) under any terms You choose.
+2. Support
+VMware has no obligation to provide technical support or updates to You. Nothing in this Agreement requires VMware to enter into any license with You for any other edition of the Software.
+3. Intellectual Property Rights
+3.1 - Except for the license expressly granted under copyright in Section 1.1, no rights, licenses or forbearances are granted or may arise in relation to this Agreement whether expressly, by implication, exhaustion, estoppel or otherwise. All rights, including all intellectual property rights, that are not expressly granted under this Agreement are hereby reserved.
+3.2 - In any copy of the Software or in any Modification you create, You must retain and reproduce, any and all copyright, patent, trademark, and attribution notices that are included in the Software in the same form as they appear in the Software. This includes the preservation of attribution notices in the form of trademarks or logos that exist within a user interface of the Software.
+3.3 - This license does not grant You rights to use any party`s name, logo, or trademarks, except solely as necessary to comply with Section 3.2.
+4. Disclaimer of Warranties
+THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND. VMWARE MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY REGARDING OR RELATING TO THE SOFTWARE. SPECIFICALLY, VMWARE DOES NOT WARRANT THAT THE SOFTWARE WILL BE ERROR FREE OR WILL PERFORM IN AN UNINTERRUPTED MANNER. TO THE GREATEST EXTENT ALLOWED BY LAW, VMWARE SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (EVEN IF VMWARE HAD BEEN INFORMED OF SUCH PURPOSE), AND NONINFRINGEMENT WITH RESPECT TO THE SOFTWARE, ANY MODIFICATIONS THERETO AND WITH RESPECT TO THE USE OF THE FOREGOING.
+5. Limitation of Liability
+IN NO EVENT WILL VMWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING WITHOUT LIMITATION LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, LOSS OF DATA, COST OF COVER) IN CONNECTION WITH OR ARISING OUT OF OR RELATING TO THE FURNISHING, PERFORMANCE OR USE OF THE SOFTWARE OR ANY OTHER RIGHTS GRANTED HEREUNDER, WHETHER ALLEGED AS A BREACH OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, AND EVEN IF VMWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+6. Term and Termination
+6.1 - This Agreement will continue in effect unless and until terminated earlier pursuant to this Section 6.
+6.2 - In the event You violate the terms of this Agreement, VMware may terminate this Agreement.
+6.3 - All licenses granted hereunder shall terminate upon the termination of this Agreement. Termination will be in addition to any rights and remedies available to VMware at law or equity or under this Agreement.
+6.4 - Termination of this Agreement will not affect the provisions regarding reservation of rights (Section 3.1), provisions disclaiming or limiting VMware`s liability (Sections 4 and 5), Termination (Section 6) or Miscellaneous (Section 7), which provisions will survive termination of this Agreement.
+7. Miscellaneous
+This Agreement contains the entire agreement of the parties with respect to the subject matter of this Agreement and supersedes all previous communications, representations, understandings and agreements, either oral or written, between the parties with respect to said subject matter. The relationship of the parties hereunder is that of independent contractors, and this Agreement will not be construed as creating an agency, partnership, joint venture or any other form of legal association between the parties. If any term, condition, or provision in this Agreement is found to be invalid, unlawful or unenforceable to any extent, this Agreement will be construed in a manner that most closely effectuates the intent of this Agreement. Such invalid term, condition or provision will be severed from the remaining terms, conditions and provisions, which will continue to be valid and enforceable to the fullest extent permitted by law. This Agreement will be interpreted and construed in accordance with the laws of the State of California and the United States of America, without regard to conflict of law principles. The U.N. Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. All disputes arising out of this Agreement involving VMware or any of its subsidiaries shall be subject to the jurisdiction of the federal or state courts of northern California, with venue lying in Santa Clara County, California. No rights may be assigned, no obligations may be delegated, and this Agreement may not be transferred by You, in whole or in part, whether voluntary or by operation of law, including by way of sale of assets, merger or consolidation, without the prior written consent of VMware, and any purported assignment, delegation or transfer without such consent shall be void ab initio. Any waiver of the provisions of this Agreement or of a party`s rights or remedies under this Agreement must be in writing to be effective. Failure, neglect or delay by a party to enforce the provisions of this Agreement or its rights or remedies at any time, will not be construed or be deemed to be a waiver of such party`s rights under this Agreement and will not in any way affect the validity of the whole or any part of this Agreement or prejudice such party`s right to take subsequent action.
+
diff --git a/poky/meta/files/common-licenses/Zlib b/poky/meta/files/common-licenses/Zlib
new file mode 100644
index 000000000..f8b388494
--- /dev/null
+++ b/poky/meta/files/common-licenses/Zlib
@@ -0,0 +1,21 @@
+
+zlib License
+
+
+ This software is provided `as-is`, without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
diff --git a/poky/meta/files/common-licenses/bzip2 b/poky/meta/files/common-licenses/bzip2
new file mode 100644
index 000000000..8ec599dc3
--- /dev/null
+++ b/poky/meta/files/common-licenses/bzip2
@@ -0,0 +1,41 @@
+--------------------------------------------------------------------------
+
+This program, "bzip2", the associated library "libbzip2", and all
+documentation, are copyright (C) 1996-2010 Julian R Seward. All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, jseward@bzip.org
+bzip2/libbzip2 version 1.0.6 of 6 September 2010
+
+--------------------------------------------------------------------------
diff --git a/poky/meta/files/common-licenses/eCos-2.0 b/poky/meta/files/common-licenses/eCos-2.0
new file mode 100644
index 000000000..39b5d6351
--- /dev/null
+++ b/poky/meta/files/common-licenses/eCos-2.0
@@ -0,0 +1,18 @@
+
+The eCos license version 2.0
+
+This file is part of eCos, the Embedded Configurable Operating System. Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+eCos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 or (at your option) any later version.
+
+eCos is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with eCos; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License.
+
+This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License.
+
+Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. at http://sources.redhat.com/ecos/ecos-license/ -------------------------------------------
+
+####ECOSGPLCOPYRIGHTEND####
+
diff --git a/poky/meta/files/common-licenses/gSOAP-1 b/poky/meta/files/common-licenses/gSOAP-1
new file mode 100644
index 000000000..3f8638add
--- /dev/null
+++ b/poky/meta/files/common-licenses/gSOAP-1
@@ -0,0 +1,380 @@
+
+gSOAP Public License
+
+Version 1.3b
+
+The gSOAP public license is derived from the Mozilla Public License (MPL1.1).
+The sections that were deleted from the original MPL1.1 text are 1.0.1, 2.1.
+(c),(d), 2.2.(c),(d), 8.2.(b), 10, and 11. Section 3.8 was added. The modified
+sections are 2.1.(b), 2.2.(b), 3.2 (simplified), 3.5 (deleted the last
+sentence), and 3.6 (simplified).
+This license applies to the gSOAP software package, with the exception of the
+soapcpp2 and wsdl2h source code located in gsoap/src and gsoap/wsdl, all code
+generated by soapcpp2 and wsdl2h, the UDDI source code gsoap/uddi2, and the Web
+server sample source code samples/webserver. To use any of these software tools
+and components commercially, a commercial license is required and can be
+obtained from www.genivia.com.
+1 DEFINITIONS.
+
+1.0.1.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a
+Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code, or Modifications or the combination of the Original
+Code, and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for
+the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the
+Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not
+governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the
+time of the initial grant or subsequently acquired, any and all of the rights
+conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the
+Original Code or any previous Modifications. When Covered Code is released as a
+series of files, a Modification is:
+A.
+Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+B.
+Any new file that contains any part of the Original Code, or previous
+Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source
+Code notice required by Exhibit A as Original Code, and which, at the time of
+its release under this License is not already Covered Code governed by this
+License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without
+limitation, method, process, and apparatus claims, in any patent Licensable by
+grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it,
+including all modules it contains, plus any associated interface definition
+files, scripts used to control compilation and installation of an Executable,
+or source code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor's choice. The
+Source Code can be in a compressed or archival form, provided the appropriate
+decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying
+with all of the terms of, this License or a future version of this License
+issued under Section 6.1. For legal entities, "You" includes any
+entity which controls, is controlled by, or is under common control with You.
+For purposes of this definition, "control" means (a) the power,
+direct or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of more than fifty percent
+(50%) of the outstanding shares or beneficial ownership of such entity.
+2 SOURCE CODE LICENSE.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+(a)
+under intellectual property rights (other than patent or trademark) Licensable
+by Initial Developer to use, reproduce, modify, display, perform, sublicense
+and distribute the Original Code (or portions thereof) with or without
+Modifications, and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Initial Developer, to
+make, have made, use and sell ("offer to sell and import") the
+Original Code, Modifications, or portions thereof, but solely to the extent
+that any such patent is reasonably necessary to enable You to utilize, alone or
+in combination with other software, the Original Code, Modifications, or any
+combination or portions thereof.
+(c)
+(d)
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby
+grants You a world-wide, royalty-free, non-exclusive license
+(a)
+under intellectual property rights (other than patent or trademark) Licensable
+by Contributor, to use, reproduce, modify, display, perform, sublicense and
+distribute the Modifications created by such Contributor (or portions thereof)
+either on an unmodified basis, with other Modifications, as Covered Code and/or
+as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Contributor, to make,
+have made, use and sell ("offer to sell and import") the Contributor
+Version (or portions thereof), but solely to the extent that any such patent is
+reasonably necessary to enable You to utilize, alone or in combination with
+other software, the Contributor Version (or portions thereof).
+(c)
+(d)
+3 DISTRIBUTION OBLIGATIONS.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification created by You will be provided to the Initial Developer in
+Source Code form and are subject to the terms of the License.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters.
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party's intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the Source
+Code distribution titled "LEGAL" which describes the claim and the
+party making the claim in sufficient detail that a recipient will know whom to
+contact. If Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly modify the
+LEGAL file in all copies Contributor makes available thereafter and shall take
+other steps (such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered Code that new
+knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor's Modifications include an application programming interface and
+Contributor has knowledge of patent licenses which are reasonably necessary to
+implement that API, Contributor must also include this information in the LEGAL
+file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a)
+above, Contributor believes that Contributor's Modifications are Contributor's
+original creation(s) and/or Contributor has sufficient rights to grant the
+rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then You must include such notice in a location (such as a
+relevant directory) where a user would be likely to look for such a notice. If
+You created one or more Modification(s) You may add your name as a Contributor
+to the notice described in Exhibit A. You must also duplicate this License in
+any documentation for the Source Code where You describe recipients' rights or
+ownership rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to one
+or more recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any Contributor.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code. You may distribute the
+Executable version of Covered Code or ownership rights under a license of Your
+choice, which may contain terms different from this License, provided that You
+are in compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient's rights in
+the Source Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must make it
+absolutely clear that any terms which differ from this License are offered by
+You alone, not by the Initial Developer or any Contributor. If you distribute
+executable versions containing Covered Code as part of a product, you must
+reproduce the notice in Exhibit B in the documentation and/or other materials
+provided with the product.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+3.8. Restrictions.
+
+You may not remove any product identification, copyright, proprietary notices
+or labels from gSOAP.
+4 INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute, judicial order,
+or regulation then You must: (a) comply with the terms of this License to the
+maximum extent possible; and (b) describe the limitations and the code they
+affect. Such description must be included in the LEGAL file described in
+Section 3.4 and must be included with all distributions of the Source Code.
+Except to the extent prohibited by statute or regulation, such description must
+be sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+5 APPLICATION OF THIS LICENSE.
+
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A and to related Covered Code.
+6 VERSIONS OF THE LICENSE.
+
+6.1. New Versions.
+
+Grantor may publish revised and/or new versions of the License from time to
+time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License.
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), You must (a) rename Your license so that the phrase "gSOAP"
+or any confusingly similar phrase do not appear in your license (except to note
+that your license differs from this License) and (b) otherwise make it clear
+that Your version of the license contains terms which differ from the gSOAP
+Public License. (Filling in the name of the Initial Developer, Original Code or
+Contributor in the notice described in Exhibit A shall not of themselves be
+deemed to be modifications of this License.)
+7 DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
+WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A
+PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
+RIGHTS, AND ANY WARRANTY THAT MAY ARISE BY REASON OF TRADE USAGE, CUSTOM, OR
+COURSE OF DEALING. WITHOUT LIMITING THE FOREGOING, YOU ACKNOWLEDGE THAT THE
+SOFTWARE IS PROVIDED "AS IS" AND THAT THE AUTHORS DO NOT WARRANT THE
+SOFTWARE WILL RUN UNINTERRUPTED OR ERROR FREE. LIMITED LIABILITY THE ENTIRE
+RISK AS TO RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. UNDER NO
+CIRCUMSTANCES WILL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+EXEMPLARY OR CONSEQUENTIAL DAMAGES OF ANY KIND OR NATURE WHATSOEVER, WHETHER
+BASED ON CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
+OTHERWISE, ARISING OUT OF OR IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF THE
+AUTHORS HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGE OR IF SUCH DAMAGE
+COULD HAVE BEEN REASONABLY FORESEEN, AND NOTWITHSTANDING ANY FAILURE OF
+ESSENTIAL PURPOSE OF ANY EXCLUSIVE REMEDY PROVIDED. SUCH LIMITATION ON DAMAGES
+INCLUDES, BUT IS NOT LIMITED TO, DAMAGES FOR LOSS OF GOODWILL, LOST PROFITS,
+LOSS OF DATA OR SOFTWARE, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION OR
+IMPAIRMENT OF OTHER GOODS. IN NO EVENT WILL THE AUTHORS BE LIABLE FOR THE COSTS
+OF PROCUREMENT OF SUBSTITUTE SOFTWARE OR SERVICES. YOU ACKNOWLEDGE THAT THIS
+SOFTWARE IS NOT DESIGNED FOR USE IN ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS
+SUCH AS OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR CONTROL, OR
+LIFE-CRITICAL APPLICATIONS. THE AUTHORS EXPRESSLY DISCLAIM ANY LIABILITY
+RESULTING FROM USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS
+ENVIRONMENTS AND ACCEPTS NO LIABILITY IN RESPECT OF ANY ACTIONS OR CLAIMS BASED
+ON THE USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS
+ENVIRONMENTS BY YOU. FOR PURPOSES OF THIS PARAGRAPH, THE TERM "LIFE-
+CRITICAL APPLICATION" MEANS AN APPLICATION IN WHICH THE FUNCTIONING OR
+MALFUNCTIONING OF THE SOFTWARE MAY RESULT DIRECTLY OR INDIRECTLY IN PHYSICAL
+INJURY OR LOSS OF HUMAN LIFE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
+ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED
+HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8 TERMINATION.
+
+8.1.
+This License and the rights granted hereunder will terminate automatically if
+You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+8.2.
+8.3.
+If You assert a patent infringement claim against Participant alleging that
+such Participant's Contributor Version directly or indirectly infringes any
+patent where such claim is resolved (such as by license or settlement) prior to
+the initiation of patent infringement litigation, then the reasonable value of
+the licenses granted by such Participant under Sections 2.1 or 2.2 shall be
+taken into account in determining the amount or value of any payment or
+license.
+8.4.
+In the event of termination under Sections 8.1 or 8.2 above, all end user
+license agreements (excluding distributors and resellers) which have been
+validly granted by You or any distributor hereunder prior to termination shall
+survive termination.
+9 LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY
+OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING
+FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+APPLY TO YOU.
+10 U.S. GOVERNMENT END USERS.
+
+11 MISCELLANEOUS.
+
+12 RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible
+for claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Initial Developer and
+Contributors to distribute such responsibility on an equitable basis. Nothing
+herein is intended or shall be deemed to constitute any admission of liability.
+EXHIBIT A.
+
+"The contents of this file are subject to the gSOAP Public License Version
+1.3 (the "License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+http://www.cs.fsu.edu/ engelen/soaplicense.html
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the License.
+The Original Code of the gSOAP Software is: stdsoap.h, stdsoap2.h, stdsoap.c,
+stdsoap2.c, stdsoap.cpp, stdsoap2.cpp, soapcpp2.h, soapcpp2.c, soapcpp2_lex.l,
+soapcpp2_yacc.y, error2.h, error2.c, symbol2.c, init2.c, soapdoc2.html, and
+soapdoc2.pdf, httpget.h, httpget.c, stl.h, stldeque.h, stllist.h, stlvector.h,
+stlset.h.
+The Initial Developer of the Original Code is Robert A. van Engelen. Portions
+created by Robert A. van Engelen are Copyright (C) 2001-2004 Robert A. van
+Engelen, Genivia inc. All Rights Reserved.
+Contributor(s):
+"________________________."
+[Note: The text of this Exhibit A may differ slightly form the text of the
+notices in the Source Code files of the Original code. You should use the text
+of this Exhibit A rather than the text found in the Original Code Source Code
+for Your Modifications.]
+EXHIBIT B.
+
+"Part of the software embedded in this product is gSOAP software.
+Portions created by gSOAP are Copyright (C) 2001-2009 Robert A. van Engelen,
+Genivia inc. All Rights Reserved.
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY GENIVIA INC AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+
+
+
+
+
diff --git a/poky/meta/files/common-licenses/gSOAP-1.3b b/poky/meta/files/common-licenses/gSOAP-1.3b
new file mode 100644
index 000000000..68c942bb5
--- /dev/null
+++ b/poky/meta/files/common-licenses/gSOAP-1.3b
@@ -0,0 +1,157 @@
+
+gSOAP Public License
+
+Version 1.3b
+
+The gSOAP public license is derived from the Mozilla Public License (MPL1.1). The sections that were deleted from the original MPL1.1 text are 1.0.1, 2.1.(c),(d), 2.2.(c),(d), 8.2.(b), 10, and 11. Section 3.8 was added. The modified sections are 2.1.(b), 2.2.(b), 3.2 (simplified), 3.5 (deleted the last sentence), and 3.6 (simplified).
+This license applies to the gSOAP software package, with the exception of the soapcpp2 and wsdl2h source code located in gsoap/src and gsoap/wsdl, all code generated by soapcpp2 and wsdl2h, the UDDI source code gsoap/uddi2, and the Web server sample source code samples/webserver. To use any of these software tools and components commercially, a commercial license is required and can be obtained from www.genivia.com.
+1 DEFINITIONS.
+
+1.0.1.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code, or Modifications or the combination of the Original Code, and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+A.
+Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B.
+Any new file that contains any part of the Original Code, or previous Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2 SOURCE CODE LICENSE.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a)
+under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell ("offer to sell and import") the Original Code, Modifications, or portions thereof, but solely to the extent that any such patent is reasonably necessary to enable You to utilize, alone or in combination with other software, the Original Code, Modifications, or any combination or portions thereof.
+(c)
+(d)
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+(a)
+under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Contributor, to make, have made, use and sell ("offer to sell and import") the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to utilize, alone or in combination with other software, the Contributor Version (or portions thereof).
+(c)
+(d)
+3 DISTRIBUTION OBLIGATIONS.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification created by You will be provided to the Initial Developer in Source Code form and are subject to the terms of the License.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters.
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. If you distribute executable versions containing Covered Code as part of a product, you must reproduce the notice in Exhibit B in the documentation and/or other materials provided with the product.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+3.8. Restrictions.
+
+You may not remove any product identification, copyright, proprietary notices or labels from gSOAP.
+4 INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+5 APPLICATION OF THIS LICENSE.
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+6 VERSIONS OF THE LICENSE.
+
+6.1. New Versions.
+
+Grantor may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License.
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrase "gSOAP" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the gSOAP Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+7 DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, AND ANY WARRANTY THAT MAY ARISE BY REASON OF TRADE USAGE, CUSTOM, OR COURSE OF DEALING. WITHOUT LIMITING THE FOREGOING, YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" AND THAT THE AUTHORS DO NOT WARRANT THE SOFTWARE WILL RUN UNINTERRUPTED OR ERROR FREE. LIMITED LIABILITY THE ENTIRE RISK AS TO RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. UNDER NO CIRCUMSTANCES WILL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES OF ANY KIND OR NATURE WHATSOEVER, WHETHER BASED ON CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, ARISING OUT OF OR IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF THE AUTHORS HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGE OR IF SUCH DAMAGE COULD HAVE BEEN REASONABLY FORESEEN, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY EXCLUSIVE REMEDY PROVIDED. SUCH LIMITATION ON DAMAGES INCLUDES, BUT IS NOT LIMITED TO, DAMAGES FOR LOSS OF GOODWILL, LOST PROFITS, LOSS OF DATA OR SOFTWARE, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION OR IMPAIRMENT OF OTHER GOODS. IN NO EVENT WILL THE AUTHORS BE LIABLE FOR THE COSTS OF PROCUREMENT OF SUBSTITUTE SOFTWARE OR SERVICES. YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED FOR USE IN ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS SUCH AS OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR CONTROL, OR LIFE-CRITICAL APPLICATIONS. THE AUTHORS EXPRESSLY DISCLAIM ANY LIABILITY RESULTING FROM USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS AND ACCEPTS NO LIABILITY IN RESPECT OF ANY ACTIONS OR CLAIMS BASED ON THE USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS BY YOU. FOR PURPOSES OF THIS PARAGRAPH, THE TERM "LIFE-CRITICAL APPLICATION" MEANS AN APPLICATION IN WHICH THE FUNCTIONING OR MALFUNCTIONING OF THE SOFTWARE MAY RESULT DIRECTLY OR INDIRECTLY IN PHYSICAL INJURY OR LOSS OF HUMAN LIFE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8 TERMINATION.
+
+8.1.
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2.
+8.3.
+If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+8.4.
+In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+9 LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10 U.S. GOVERNMENT END USERS.
+
+11 MISCELLANEOUS.
+
+12 RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+EXHIBIT A.
+
+"The contents of this file are subject to the gSOAP Public License Version 1.3 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
+http://www.cs.fsu.edu/ engelen/soaplicense.html
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+The Original Code of the gSOAP Software is: stdsoap.h, stdsoap2.h, stdsoap.c, stdsoap2.c, stdsoap.cpp, stdsoap2.cpp, soapcpp2.h, soapcpp2.c, soapcpp2_lex.l, soapcpp2_yacc.y, error2.h, error2.c, symbol2.c, init2.c, soapdoc2.html, and soapdoc2.pdf, httpget.h, httpget.c, stl.h, stldeque.h, stllist.h, stlvector.h, stlset.h.
+The Initial Developer of the Original Code is Robert A. van Engelen. Portions created by Robert A. van Engelen are Copyright (C) 2001-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.
+Contributor(s):
+"________________________."
+[Note: The text of this Exhibit A may differ slightly form the text of the notices in the Source Code files of the Original code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+EXHIBIT B.
+
+"Part of the software embedded in this product is gSOAP software.
+Portions created by gSOAP are Copyright (C) 2001-2009 Robert A. van Engelen, Genivia inc. All Rights Reserved.
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY GENIVIA INC AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
diff --git a/poky/meta/files/common-licenses/pkgconf b/poky/meta/files/common-licenses/pkgconf
new file mode 100644
index 000000000..81a522150
--- /dev/null
+++ b/poky/meta/files/common-licenses/pkgconf
@@ -0,0 +1,10 @@
+Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017
+ pkgconf authors (see AUTHORS file in source directory).
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+This software is provided 'as is' and without any warranty, express or
+implied. In no event shall the authors be liable for any damages arising
+from the use of this software.
diff --git a/poky/meta/files/common-licenses/tcl b/poky/meta/files/common-licenses/tcl
new file mode 100644
index 000000000..d8049cd9e
--- /dev/null
+++ b/poky/meta/files/common-licenses/tcl
@@ -0,0 +1,40 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
+Corporation and other parties. The following terms apply to all files
+associated with the software unless explicitly disclaimed in
+individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/poky/meta/files/common-licenses/unfs3 b/poky/meta/files/common-licenses/unfs3
new file mode 100644
index 000000000..7f2b53f16
--- /dev/null
+++ b/poky/meta/files/common-licenses/unfs3
@@ -0,0 +1,24 @@
+UNFS3 user-space NFSv3 server
+(C) 2003, Pascal Schmidt <unfs3-server@ewetel.net>
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/poky/meta/files/device_table-minimal.txt b/poky/meta/files/device_table-minimal.txt
new file mode 100644
index 000000000..e4891ccb4
--- /dev/null
+++ b/poky/meta/files/device_table-minimal.txt
@@ -0,0 +1,35 @@
+#<path> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
+#/dev/mem c 640 0 0 1 1 0 0 -
+#
+#type can be one of:
+# f A regular file
+# d Directory
+# c Character special device file
+# b Block special device file
+# p Fifo (named pipe)
+
+/dev d 755 root root - - - - -
+/dev/console c 662 root tty 5 1 - - -
+/dev/fb0 c 600 root root 29 0 - - -
+/dev/hda b 660 root disk 3 0 - - -
+/dev/hda b 660 root disk 3 1 1 1 4
+/dev/kmem c 640 root kmem 1 2 - - -
+/dev/kmsg c 600 root root 1 11 - - -
+/dev/mem c 640 root kmem 1 1 - - -
+/dev/mmcblk0 b 660 root disk 179 0 - - -
+/dev/mmcblk0p b 660 root disk 179 1 1 1 4
+/dev/mtd c 660 root disk 90 0 0 2 8
+/dev/mtdblock b 640 root root 31 0 0 1 8
+/dev/null c 666 root root 1 3 - - -
+/dev/ram b 640 root root 1 0 0 1 4
+/dev/random c 644 root root 1 8 - - -
+/dev/rtc c 644 root root 254 0 0 1 2
+/dev/sda b 660 root disk 8 0 - - -
+/dev/sda b 660 root disk 8 1 1 1 4
+/dev/sdb b 660 root disk 8 16 - - -
+/dev/sdb b 660 root disk 8 17 1 1 4
+/dev/tty c 662 root tty 5 0 - - -
+/dev/tty c 666 root tty 4 0 0 1 8
+/dev/ttyS c 640 root tty 4 64 0 1 2
+/dev/urandom c 644 root root 1 9 - - -
+/dev/zero c 644 root root 1 5 - - -
diff --git a/poky/meta/files/ext-sdk-prepare.py b/poky/meta/files/ext-sdk-prepare.py
new file mode 100644
index 000000000..96c5212a2
--- /dev/null
+++ b/poky/meta/files/ext-sdk-prepare.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+
+# Prepare the build system within the extensible SDK
+
+import sys
+import os
+import subprocess
+import signal
+
+def reenable_sigint():
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
+
+def run_command_interruptible(cmd):
+ """
+ Run a command with output displayed on the console, but ensure any Ctrl+C is
+ processed only by the child process.
+ """
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+ try:
+ ret = subprocess.call(cmd, shell=True, preexec_fn=reenable_sigint)
+ finally:
+ signal.signal(signal.SIGINT, signal.SIG_DFL)
+ return ret
+
+def get_last_consolelog():
+ '''Return the most recent console log file'''
+ logdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'tmp', 'log', 'cooker')
+ if os.path.exists(logdir):
+ mcdir = os.listdir(logdir)
+ if mcdir:
+ logdir = os.path.join(logdir, mcdir[0])
+ logfiles = [os.path.join(logdir, fn) for fn in os.listdir(logdir)]
+ logfiles.sort(key=os.path.getmtime)
+ if logfiles:
+ return os.path.join(logdir, logfiles[-1])
+ return None
+
+def main():
+ if len(sys.argv) < 2:
+ print('Please specify output log file')
+ return 1
+ logfile = sys.argv[1]
+ if len(sys.argv) < 3:
+ sdk_targets = []
+ else:
+ sdk_targets = ' '.join(sys.argv[2:]).split()
+ if not sdk_targets:
+ # Just do a parse so the cache is primed
+ ret = run_command_interruptible('bitbake -p --quiet')
+ return ret
+
+ with open(logfile, 'a') as logf:
+ logf.write('Preparing SDK for %s...\n' % ', '.join(sdk_targets))
+
+ ret = run_command_interruptible('BB_SETSCENE_ENFORCE=1 bitbake --quiet %s' % ' '.join(sdk_targets))
+ if not ret:
+ ret = run_command_interruptible('bitbake --quiet build-sysroots')
+ lastlog = get_last_consolelog()
+ if lastlog:
+ with open(lastlog, 'r') as f:
+ for line in f:
+ logf.write(line)
+ if ret:
+ print('ERROR: SDK preparation failed: error log written to %s' % logfile)
+ return ret
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/meta/files/fs-perms-persistent-log.txt b/poky/meta/files/fs-perms-persistent-log.txt
new file mode 100644
index 000000000..3a7cf3ab9
--- /dev/null
+++ b/poky/meta/files/fs-perms-persistent-log.txt
@@ -0,0 +1,66 @@
+# This file contains a list of files and directories with known permissions.
+# It is used by the packaging class to ensure that the permissions, owners and
+# group of listed files and directories are in sync across the system.
+#
+# The format of this file
+#
+#<path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
+#
+# or
+#
+#<path> link <target>
+#
+# <path>: directory path
+# <mode>: mode for directory
+# <uid>: uid for directory
+# <gid>: gid for directory
+# <walk>: recursively walk the directory? true or false
+# <fmode>: if walking, new mode for files
+# <fuid>: if walking, new uid for files
+# <fgid>: if walking, new gid for files
+# <target>: turn the directory into a symlink point to target
+#
+# in mode, uid or gid, a "-" means don't change any existing values
+#
+# /usr/src 0755 root root false - - -
+# /usr/share/man 0755 root root true 0644 root root
+
+# Note: all standard config directories are automatically assigned "0755 root root false - - -"
+
+# Documentation should always be corrected
+${mandir} 0755 root root true 0644 root root
+${infodir} 0755 root root true 0644 root root
+${docdir} 0755 root root true 0644 root root
+${datadir}/gtk-doc 0755 root root true 0644 root root
+
+# Fixup locales
+${datadir}/locale 0755 root root true 0644 root root
+
+# Cleanup headers
+${includedir} 0755 root root true 0644 root root
+${oldincludedir} 0755 root root true 0644 root root
+
+# Cleanup debug src
+/usr/src/debug 0755 root root true - root root
+
+# Items from base-files
+# Links
+${localstatedir}/run link /run
+${localstatedir}/lock link /run/lock
+${localstatedir}/tmp link volatile/tmp
+
+/home 0755 root root false - - -
+/srv 0755 root root false - - -
+${prefix}/src 0755 root root false - - -
+${localstatedir}/local 0755 root root false - - -
+
+# Special permissions from base-files
+# Set 1777
+/tmp 01777 root root false - - -
+${localstatedir}/volatile/tmp 01777 root root false - - -
+
+# Set 0700
+${ROOT_HOME} 0700 root root false - - -
+
+# Set 2775-lsb
+${localstatedir}/mail 02775 root mail false - - -
diff --git a/poky/meta/files/fs-perms.txt b/poky/meta/files/fs-perms.txt
new file mode 100644
index 000000000..c8c3ac5db
--- /dev/null
+++ b/poky/meta/files/fs-perms.txt
@@ -0,0 +1,67 @@
+# This file contains a list of files and directories with known permissions.
+# It is used by the packaging class to ensure that the permissions, owners and
+# group of listed files and directories are in sync across the system.
+#
+# The format of this file
+#
+#<path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
+#
+# or
+#
+#<path> link <target>
+#
+# <path>: directory path
+# <mode>: mode for directory
+# <uid>: uid for directory
+# <gid>: gid for directory
+# <walk>: recursively walk the directory? true or false
+# <fmode>: if walking, new mode for files
+# <fuid>: if walking, new uid for files
+# <fgid>: if walking, new gid for files
+# <target>: turn the directory into a symlink point to target
+#
+# in mode, uid or gid, a "-" means don't change any existing values
+#
+# /usr/src 0755 root root false - - -
+# /usr/share/man 0755 root root true 0644 root root
+
+# Note: all standard config directories are automatically assigned "0755 root root false - - -"
+
+# Documentation should always be corrected
+${mandir} 0755 root root true 0644 root root
+${infodir} 0755 root root true 0644 root root
+${docdir} 0755 root root true 0644 root root
+${datadir}/gtk-doc 0755 root root true 0644 root root
+
+# Fixup locales
+${datadir}/locale 0755 root root true 0644 root root
+
+# Cleanup headers
+${includedir} 0755 root root true 0644 root root
+${oldincludedir} 0755 root root true 0644 root root
+
+# Cleanup debug src
+/usr/src/debug 0755 root root true - root root
+
+# Items from base-files
+# Links
+${localstatedir}/run link /run
+${localstatedir}/log link volatile/log
+${localstatedir}/lock link /run/lock
+${localstatedir}/tmp link volatile/tmp
+
+/home 0755 root root false - - -
+/srv 0755 root root false - - -
+${prefix}/src 0755 root root false - - -
+${localstatedir}/local 0755 root root false - - -
+
+# Special permissions from base-files
+# Set 1777
+/tmp 01777 root root false - - -
+${localstatedir}/volatile/tmp 01777 root root false - - -
+
+# Set 0700
+${ROOT_HOME} 0700 root root false - - -
+
+# Set 2775-lsb
+${localstatedir}/mail 02775 root mail false - - -
diff --git a/poky/meta/files/ptest-perl/run-ptest b/poky/meta/files/ptest-perl/run-ptest
new file mode 100644
index 000000000..c9f9ca94d
--- /dev/null
+++ b/poky/meta/files/ptest-perl/run-ptest
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+for case in `find t -type f -name '*.t'`; do
+ perl $case >$case.output 2>&1
+ ret=$?
+ cat $case.output
+ if [ $ret -ne 0 ]; then
+ echo "FAIL: ${case%.t}"
+ elif grep -i 'SKIP' $case.output; then
+ echo "SKIP: ${case%.t}"
+ else
+ echo "PASS: ${case%.t}"
+ fi
+
+ rm -f $case.output
+done
diff --git a/poky/meta/files/toolchain-shar-extract.sh b/poky/meta/files/toolchain-shar-extract.sh
new file mode 100644
index 000000000..f7ab43066
--- /dev/null
+++ b/poky/meta/files/toolchain-shar-extract.sh
@@ -0,0 +1,278 @@
+#!/bin/sh
+
+[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \
+ LC_ALL=en_US.UTF-8 \
+ TERM=$TERM \
+ http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \
+ no_proxy="$no_proxy" all_proxy="$all_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@"
+[ -f /etc/environment ] && . /etc/environment
+export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'`
+
+tweakpath () {
+ case ":${PATH}:" in
+ *:"$1":*)
+ ;;
+ *)
+ PATH=$PATH:$1
+ esac
+}
+
+# Some systems don't have /usr/sbin or /sbin in the cleaned environment PATH but we make need it
+# for the system's host tooling checks
+tweakpath /usr/sbin
+tweakpath /sbin
+
+INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
+SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
+
+INST_GCC_VER=$(gcc --version | sed -ne 's/.* \([0-9]\+\.[0-9]\+\)\.[0-9]\+.*/\1/p')
+SDK_GCC_VER='@SDK_GCC_VER@'
+
+verlte () {
+ [ "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ]
+}
+
+verlt() {
+ [ "$1" = "$2" ] && return 1 || verlte $1 $2
+}
+
+verlt `uname -r` @OLDEST_KERNEL@
+if [ $? = 0 ]; then
+ echo "Error: The SDK needs a kernel > @OLDEST_KERNEL@"
+ exit 1
+fi
+
+if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
+ # Allow for installation of ix86 SDK on x86_64 host
+ if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then
+ echo "Error: Incompatible SDK installer! Your host is $INST_ARCH and this SDK was built for $SDK_ARCH hosts."
+ exit 1
+ fi
+fi
+
+if ! xz -V > /dev/null 2>&1; then
+ echo "Error: xz is required for installation of this SDK, please install it first"
+ exit 1
+fi
+
+DEFAULT_INSTALL_DIR="@SDKPATH@"
+SUDO_EXEC=""
+EXTRA_TAR_OPTIONS=""
+target_sdk_dir=""
+answer=""
+relocate=1
+savescripts=0
+verbose=0
+publish=0
+listcontents=0
+while getopts ":yd:npDRSl" OPT; do
+ case $OPT in
+ y)
+ answer="Y"
+ ;;
+ d)
+ target_sdk_dir=$OPTARG
+ ;;
+ n)
+ prepare_buildsystem="no"
+ ;;
+ p)
+ prepare_buildsystem="no"
+ publish=1
+ ;;
+ D)
+ verbose=1
+ ;;
+ R)
+ relocate=0
+ savescripts=1
+ ;;
+ S)
+ savescripts=1
+ ;;
+ l)
+ listcontents=1
+ ;;
+ *)
+ echo "Usage: $(basename $0) [-y] [-d <dir>]"
+ echo " -y Automatic yes to all prompts"
+ echo " -d <dir> Install the SDK to <dir>"
+ echo "======== Extensible SDK only options ============"
+ echo " -n Do not prepare the build system"
+ echo " -p Publish mode (implies -n)"
+ echo "======== Advanced DEBUGGING ONLY OPTIONS ========"
+ echo " -S Save relocation scripts"
+ echo " -R Do not relocate executables"
+ echo " -D use set -x to see what is going on"
+ echo " -l list files that will be extracted"
+ exit 1
+ ;;
+ esac
+done
+
+payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
+if [ "$listcontents" = "1" ] ; then
+ tail -n +$payload_offset $0| tar tvJ || exit 1
+ exit
+fi
+
+titlestr="@SDK_TITLE@ installer version @SDK_VERSION@"
+printf "%s\n" "$titlestr"
+printf "%${#titlestr}s\n" | tr " " "="
+
+if [ $verbose = 1 ] ; then
+ set -x
+fi
+
+@SDK_PRE_INSTALL_COMMAND@
+
+# SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above
+if [ "$SDK_EXTENSIBLE" = "1" ]; then
+ DEFAULT_INSTALL_DIR="@SDKEXTPATH@"
+ if [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '4.9' ] || [ "$INST_GCC_VER" = '4.8' -a "$SDK_GCC_VER" = '' ] || \
+ [ "$INST_GCC_VER" = '4.9' -a "$SDK_GCC_VER" = '' ]; then
+ echo "Error: Incompatible SDK installer! Your host gcc version is $INST_GCC_VER and this SDK was built by gcc higher version."
+ exit 1
+ fi
+fi
+
+if [ "$target_sdk_dir" = "" ]; then
+ if [ "$answer" = "Y" ]; then
+ target_sdk_dir="$DEFAULT_INSTALL_DIR"
+ else
+ read -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
+ [ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
+ fi
+fi
+
+eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g')
+if [ -d "$target_sdk_dir" ]; then
+ target_sdk_dir=$(cd "$target_sdk_dir"; pwd)
+else
+ target_sdk_dir=$(readlink -m "$target_sdk_dir")
+fi
+
+# limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result.
+if [ ${#target_sdk_dir} -gt 2048 ]; then
+ echo "Error: The target directory path is too long!!!"
+ exit 1
+fi
+
+if [ "$SDK_EXTENSIBLE" = "1" ]; then
+ # We're going to be running the build system, additional restrictions apply
+ if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then
+ echo "The target directory path ($target_sdk_dir) contains illegal" \
+ "characters such as spaces, @, \$ or +. Abort!"
+ exit 1
+ fi
+ # The build system doesn't work well with /tmp on NFS
+ fs_dev_path="$target_sdk_dir"
+ while [ ! -d "$fs_dev_path" ] ; do
+ fs_dev_path=`dirname $fs_dev_path`
+ done
+ fs_dev_type=`stat -f -c '%t' "$fs_dev_path"`
+ if [ "$fsdevtype" = "6969" ] ; then
+ echo "The target directory path $target_sdk_dir is on NFS, this is not possible. Abort!"
+ exit 1
+ fi
+else
+ if [ -n "$(echo $target_sdk_dir|grep ' ')" ]; then
+ echo "The target directory path ($target_sdk_dir) contains spaces. Abort!"
+ exit 1
+ fi
+fi
+
+if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then
+ echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
+ printf "If you continue, existing files will be overwritten! Proceed[y/N]? "
+
+ default_answer="n"
+else
+ printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]? "
+
+ default_answer="y"
+fi
+
+if [ "$answer" = "" ]; then
+ read answer
+ [ "$answer" = "" ] && answer="$default_answer"
+else
+ echo $answer
+fi
+
+if [ "$answer" != "Y" -a "$answer" != "y" ]; then
+ echo "Installation aborted!"
+ exit 1
+fi
+
+# Try to create the directory (this will not succeed if user doesn't have rights)
+mkdir -p $target_sdk_dir >/dev/null 2>&1
+
+# if don't have the right to access dir, gain by sudo
+if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then
+ if [ "$SDK_EXTENSIBLE" = "1" ]; then
+ echo "Unable to access \"$target_sdk_dir\", will not attempt to use" \
+ "sudo as as extensible SDK cannot be used as root."
+ exit 1
+ fi
+
+ SUDO_EXEC=$(which "sudo")
+ if [ -z $SUDO_EXEC ]; then
+ echo "No command 'sudo' found, please install sudo first. Abort!"
+ exit 1
+ fi
+
+ # test sudo could gain root right
+ $SUDO_EXEC pwd >/dev/null 2>&1
+ [ $? -ne 0 ] && echo "Sorry, you are not allowed to execute as root." && exit 1
+
+ # now that we have sudo rights, create the directory
+ $SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1
+fi
+
+printf "Extracting SDK..."
+tail -n +$payload_offset $0| $SUDO_EXEC tar xJ -C $target_sdk_dir --checkpoint=.2500 $EXTRA_TAR_OPTIONS || exit 1
+echo "done"
+
+printf "Setting it up..."
+# fix environment paths
+real_env_setup_script=""
+for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
+ if grep -q 'OECORE_NATIVE_SYSROOT=' $env_setup_script; then
+ # Handle custom env setup scripts that are only named
+ # environment-setup-* so that they have relocation
+ # applied - what we want beyond here is the main one
+ # rather than the one that simply sorts last
+ real_env_setup_script="$env_setup_script"
+ fi
+ $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script
+done
+if [ -n "$real_env_setup_script" ] ; then
+ env_setup_script="$real_env_setup_script"
+fi
+
+@SDK_POST_INSTALL_COMMAND@
+
+# delete the relocating script, so that user is forced to re-run the installer
+# if he/she wants another location for the sdk
+if [ $savescripts = 0 ] ; then
+ $SUDO_EXEC rm -f ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh
+fi
+
+# Execute post-relocation script
+post_relocate="$target_sdk_dir/post-relocate-setup.sh"
+if [ -e "$post_relocate" ]; then
+ $SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $post_relocate
+ $SUDO_EXEC /bin/sh $post_relocate "$target_sdk_dir" "@SDKPATH@"
+ $SUDO_EXEC rm -f $post_relocate
+fi
+
+echo "SDK has been successfully set up and is ready to be used."
+echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g."
+for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
+ echo " \$ . $env_setup_script"
+done
+
+exit 0
+
+MARKER:
diff --git a/poky/meta/files/toolchain-shar-relocate.sh b/poky/meta/files/toolchain-shar-relocate.sh
new file mode 100644
index 000000000..e3c10018e
--- /dev/null
+++ b/poky/meta/files/toolchain-shar-relocate.sh
@@ -0,0 +1,79 @@
+if ! xargs --version > /dev/null 2>&1; then
+ echo "xargs is required by the relocation script, please install it first. Abort!"
+ exit 1
+fi
+
+# fix dynamic loader paths in all ELF SDK binaries
+native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"')
+dl_path=$($SUDO_EXEC find $native_sysroot/lib -name "ld-linux*")
+if [ "$dl_path" = "" ] ; then
+ echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
+ exit 1
+fi
+executable_files=$($SUDO_EXEC find $native_sysroot -type f \
+ \( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ")
+if [ "x$executable_files" = "x" ]; then
+ echo "SDK relocate failed, could not get executalbe files"
+ exit 1
+fi
+
+tdir=`mktemp -d`
+if [ x$tdir = x ] ; then
+ echo "SDK relocate failed, could not create a temporary directory"
+ exit 1
+fi
+cat <<EOF >> $tdir/relocate_sdk.sh
+#!/bin/sh
+for py in python python2 python3
+do
+ PYTHON=\`which \${py} 2>/dev/null\`
+ if [ \$? -eq 0 ]; then
+ break;
+ fi
+done
+
+if [ x\${PYTHON} = "x" ]; then
+ echo "SDK could not be relocated. No python found."
+ exit 1
+fi
+\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
+EOF
+
+$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
+$SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
+rm -rf $tdir
+if [ $relocate = 1 ] ; then
+ $SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.sh
+ if [ $? -ne 0 ]; then
+ echo "SDK could not be set up. Relocate script failed. Abort!"
+ exit 1
+ fi
+fi
+
+# replace @SDKPATH@ with the new prefix in all text files: configs/scripts/etc.
+# replace the host perl with SDK perl.
+for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do
+ $SUDO_EXEC find $replace -type f
+done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \
+ awk -F':' '{printf "\"%s\"\n", $1}' | \
+ grep -Ev "$target_sdk_dir/(environment-setup-*|relocate_sdk*|${0##*/})" | \
+ xargs -n100 $SUDO_EXEC sed -i \
+ -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \
+ -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \
+ -e "s: /usr/bin/perl: /usr/bin/env perl:g"
+
+if [ $? -ne 0 ]; then
+ echo "Failed to replace perl. Relocate script failed. Abort!"
+ exit 1
+fi
+
+# change all symlinks pointing to @SDKPATH@
+for l in $($SUDO_EXEC find $native_sysroot -type l); do
+ $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
+ if [ $? -ne 0 ]; then
+ echo "Failed to setup symlinks. Relocate script failed. Abort!"
+ exit 1
+ fi
+done
+
+echo done
diff --git a/poky/meta/lib/bblayers/create.py b/poky/meta/lib/bblayers/create.py
new file mode 100644
index 000000000..6a41fe050
--- /dev/null
+++ b/poky/meta/lib/bblayers/create.py
@@ -0,0 +1,66 @@
+import logging
+import os
+import sys
+import shutil
+
+import bb.utils
+
+from bblayers.common import LayerPlugin
+
+logger = logging.getLogger('bitbake-layers')
+
+def plugin_init(plugins):
+ return CreatePlugin()
+
+def read_template(template, template_dir='templates'):
+ lines = str()
+ with open(os.path.join(os.path.dirname(__file__), template_dir, template)) as fd:
+ lines = ''.join(fd.readlines())
+ return lines
+
+class CreatePlugin(LayerPlugin):
+ def do_create_layer(self, args):
+ """Create a basic layer"""
+ layerdir = os.path.abspath(args.layerdir)
+ if os.path.exists(layerdir):
+ sys.stderr.write("Specified layer directory exists\n")
+ return 1
+
+ # create dirs
+ conf = os.path.join(layerdir, 'conf')
+ bb.utils.mkdirhier(conf)
+
+ # Create the README from templates/README
+ readme_template = read_template('README') % (args.layerdir, args.layerdir, args.layerdir, args.layerdir, args.layerdir, args.layerdir)
+ readme = os.path.join(layerdir, 'README')
+ with open(readme, 'w') as fd:
+ fd.write(readme_template)
+
+ # Copy the MIT license from meta
+ copying = 'COPYING.MIT'
+ dn = os.path.dirname
+ license_src = os.path.join(dn(dn(dn(__file__))), copying)
+ license_dst = os.path.join(layerdir, copying)
+ shutil.copy(license_src, license_dst)
+
+ # Create the layer.conf from templates/layer.conf
+ layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority)
+ layerconf = os.path.join(conf, 'layer.conf')
+ with open(layerconf, 'w') as fd:
+ fd.write(layerconf_template)
+
+ # Create the example from templates/example.bb
+ example_template = read_template('example.bb')
+ example = os.path.join(layerdir, 'recipes-' + args.examplerecipe, args.examplerecipe)
+ bb.utils.mkdirhier(example)
+ with open(os.path.join(example, args.examplerecipe + '.bb'), 'w') as fd:
+ fd.write(example_template)
+
+ logger.plain('Add your new layer with \'bitbake-layers add-layer %s\'' % args.layerdir)
+
+ def register_commands(self, sp):
+ parser_create_layer = self.add_command(sp, 'create-layer', self.do_create_layer, parserecipes=False)
+ parser_create_layer.add_argument('layerdir', help='Layer directory to create')
+ parser_create_layer.add_argument('--priority', '-p', default=6, help='Layer directory to create')
+ parser_create_layer.add_argument('--example-recipe-name', '-e', dest='examplerecipe', default='example', help='Filename of the example recipe')
+
diff --git a/poky/meta/lib/bblayers/templates/README b/poky/meta/lib/bblayers/templates/README
new file mode 100644
index 000000000..5a77f8d34
--- /dev/null
+++ b/poky/meta/lib/bblayers/templates/README
@@ -0,0 +1,41 @@
+This README file contains information on the contents of the %s layer.
+
+Please see the corresponding sections below for details.
+
+Dependencies
+============
+
+ URI: <first dependency>
+ branch: <branch name>
+
+ URI: <second dependency>
+ branch: <branch name>
+
+ .
+ .
+ .
+
+Patches
+=======
+
+Please submit any patches against the %s layer to the xxxx mailing list (xxxx@zzzz.org)
+and cc: the maintainer:
+
+Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com>
+
+Table of Contents
+=================
+
+ I. Adding the %s layer to your build
+ II. Misc
+
+
+I. Adding the %s layer to your build
+=================================================
+
+Run 'bitbake-layers add-layer %s'
+
+II. Misc
+========
+
+--- replace with specific information about the %s layer ---
diff --git a/poky/meta/lib/bblayers/templates/example.bb b/poky/meta/lib/bblayers/templates/example.bb
new file mode 100644
index 000000000..c4b873d59
--- /dev/null
+++ b/poky/meta/lib/bblayers/templates/example.bb
@@ -0,0 +1,11 @@
+SUMMARY = "bitbake-layers recipe"
+DESCRIPTION = "Recipe created by bitbake-layers"
+LICENSE = "MIT"
+
+python do_build() {
+ bb.plain("***********************************************");
+ bb.plain("* *");
+ bb.plain("* Example recipe created by bitbake-layers *");
+ bb.plain("* *");
+ bb.plain("***********************************************");
+}
diff --git a/poky/meta/lib/bblayers/templates/layer.conf b/poky/meta/lib/bblayers/templates/layer.conf
new file mode 100644
index 000000000..3c0300226
--- /dev/null
+++ b/poky/meta/lib/bblayers/templates/layer.conf
@@ -0,0 +1,10 @@
+# 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 += "%s"
+BBFILE_PATTERN_%s = "^${LAYERDIR}/"
+BBFILE_PRIORITY_%s = "%s"
diff --git a/poky/meta/lib/buildstats.py b/poky/meta/lib/buildstats.py
new file mode 100644
index 000000000..c5d4c73cf
--- /dev/null
+++ b/poky/meta/lib/buildstats.py
@@ -0,0 +1,158 @@
+# Implements system state sampling. Called by buildstats.bbclass.
+# Because it is a real Python module, it can hold persistent state,
+# like open log files and the time of the last sampling.
+
+import time
+import re
+import bb.event
+
+class SystemStats:
+ def __init__(self, d):
+ bn = d.getVar('BUILDNAME')
+ bsdir = os.path.join(d.getVar('BUILDSTATS_BASE'), bn)
+ bb.utils.mkdirhier(bsdir)
+
+ self.proc_files = []
+ for filename, handler in (
+ ('diskstats', self._reduce_diskstats),
+ ('meminfo', self._reduce_meminfo),
+ ('stat', self._reduce_stat),
+ ):
+ # The corresponding /proc files might not exist on the host.
+ # For example, /proc/diskstats is not available in virtualized
+ # environments like Linux-VServer. Silently skip collecting
+ # the data.
+ if os.path.exists(os.path.join('/proc', filename)):
+ # In practice, this class gets instantiated only once in
+ # the bitbake cooker process. Therefore 'append' mode is
+ # not strictly necessary, but using it makes the class
+ # more robust should two processes ever write
+ # concurrently.
+ destfile = os.path.join(bsdir, '%sproc_%s.log' % ('reduced_' if handler else '', filename))
+ self.proc_files.append((filename, open(destfile, 'ab'), handler))
+ self.monitor_disk = open(os.path.join(bsdir, 'monitor_disk.log'), 'ab')
+ # Last time that we sampled /proc data resp. recorded disk monitoring data.
+ self.last_proc = 0
+ self.last_disk_monitor = 0
+ # Minimum number of seconds between recording a sample. This
+ # becames relevant when we get called very often while many
+ # short tasks get started. Sampling during quiet periods
+ # depends on the heartbeat event, which fires less often.
+ self.min_seconds = 1
+
+ self.meminfo_regex = re.compile(b'^(MemTotal|MemFree|Buffers|Cached|SwapTotal|SwapFree):\s*(\d+)')
+ self.diskstats_regex = re.compile(b'^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$')
+ self.diskstats_ltime = None
+ self.diskstats_data = None
+ self.stat_ltimes = None
+
+ def close(self):
+ self.monitor_disk.close()
+ for _, output, _ in self.proc_files:
+ output.close()
+
+ def _reduce_meminfo(self, time, data):
+ """
+ Extracts 'MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree'
+ and writes their values into a single line, in that order.
+ """
+ values = {}
+ for line in data.split(b'\n'):
+ m = self.meminfo_regex.match(line)
+ if m:
+ values[m.group(1)] = m.group(2)
+ if len(values) == 6:
+ return (time,
+ b' '.join([values[x] for x in
+ (b'MemTotal', b'MemFree', b'Buffers', b'Cached', b'SwapTotal', b'SwapFree')]) + b'\n')
+
+ def _diskstats_is_relevant_line(self, linetokens):
+ if len(linetokens) != 14:
+ return False
+ disk = linetokens[2]
+ return self.diskstats_regex.match(disk)
+
+ def _reduce_diskstats(self, time, data):
+ relevant_tokens = filter(self._diskstats_is_relevant_line, map(lambda x: x.split(), data.split(b'\n')))
+ diskdata = [0] * 3
+ reduced = None
+ for tokens in relevant_tokens:
+ # rsect
+ diskdata[0] += int(tokens[5])
+ # wsect
+ diskdata[1] += int(tokens[9])
+ # use
+ diskdata[2] += int(tokens[12])
+ if self.diskstats_ltime:
+ # We need to compute information about the time interval
+ # since the last sampling and record the result as sample
+ # for that point in the past.
+ interval = time - self.diskstats_ltime
+ if interval > 0:
+ sums = [ a - b for a, b in zip(diskdata, self.diskstats_data) ]
+ readTput = sums[0] / 2.0 * 100.0 / interval
+ writeTput = sums[1] / 2.0 * 100.0 / interval
+ util = float( sums[2] ) / 10 / interval
+ util = max(0.0, min(1.0, util))
+ reduced = (self.diskstats_ltime, (readTput, writeTput, util))
+
+ self.diskstats_ltime = time
+ self.diskstats_data = diskdata
+ return reduced
+
+
+ def _reduce_nop(self, time, data):
+ return (time, data)
+
+ def _reduce_stat(self, time, data):
+ if not data:
+ return None
+ # CPU times {user, nice, system, idle, io_wait, irq, softirq} from first line
+ tokens = data.split(b'\n', 1)[0].split()
+ times = [ int(token) for token in tokens[1:] ]
+ reduced = None
+ if self.stat_ltimes:
+ user = float((times[0] + times[1]) - (self.stat_ltimes[0] + self.stat_ltimes[1]))
+ system = float((times[2] + times[5] + times[6]) - (self.stat_ltimes[2] + self.stat_ltimes[5] + self.stat_ltimes[6]))
+ idle = float(times[3] - self.stat_ltimes[3])
+ iowait = float(times[4] - self.stat_ltimes[4])
+
+ aSum = max(user + system + idle + iowait, 1)
+ reduced = (time, (user/aSum, system/aSum, iowait/aSum))
+
+ self.stat_ltimes = times
+ return reduced
+
+ def sample(self, event, force):
+ now = time.time()
+ if (now - self.last_proc > self.min_seconds) or force:
+ for filename, output, handler in self.proc_files:
+ with open(os.path.join('/proc', filename), 'rb') as input:
+ data = input.read()
+ if handler:
+ reduced = handler(now, data)
+ else:
+ reduced = (now, data)
+ if reduced:
+ if isinstance(reduced[1], bytes):
+ # Use as it is.
+ data = reduced[1]
+ else:
+ # Convert to a single line.
+ data = (' '.join([str(x) for x in reduced[1]]) + '\n').encode('ascii')
+ # Unbuffered raw write, less overhead and useful
+ # in case that we end up with concurrent writes.
+ os.write(output.fileno(),
+ ('%.0f\n' % reduced[0]).encode('ascii') +
+ data +
+ b'\n')
+ self.last_proc = now
+
+ if isinstance(event, bb.event.MonitorDiskEvent) and \
+ ((now - self.last_disk_monitor > self.min_seconds) or force):
+ os.write(self.monitor_disk.fileno(),
+ ('%.0f\n' % now).encode('ascii') +
+ ''.join(['%s: %d\n' % (dev, sample.total_bytes - sample.free_bytes)
+ for dev, sample in event.disk_usage.items()]).encode('ascii') +
+ b'\n')
+ self.last_disk_monitor = now
diff --git a/poky/meta/lib/oe/__init__.py b/poky/meta/lib/oe/__init__.py
new file mode 100644
index 000000000..3ad9513f4
--- /dev/null
+++ b/poky/meta/lib/oe/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/poky/meta/lib/oe/buildhistory_analysis.py b/poky/meta/lib/oe/buildhistory_analysis.py
new file mode 100644
index 000000000..b0365abce
--- /dev/null
+++ b/poky/meta/lib/oe/buildhistory_analysis.py
@@ -0,0 +1,665 @@
+# Report significant differences in the buildhistory repository since a specific revision
+#
+# Copyright (C) 2012-2013, 2016-2017 Intel Corporation
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Note: requires GitPython 0.3.1+
+#
+# You can use this from the command line by running scripts/buildhistory-diff
+#
+
+import sys
+import os.path
+import difflib
+import git
+import re
+import hashlib
+import collections
+import bb.utils
+import bb.tinfoil
+
+
+# How to display fields
+list_fields = ['DEPENDS', 'RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
+list_order_fields = ['PACKAGES']
+defaultval_map = {'PKG': 'PKG', 'PKGE': 'PE', 'PKGV': 'PV', 'PKGR': 'PR'}
+numeric_fields = ['PKGSIZE', 'IMAGESIZE']
+# Fields to monitor
+monitor_fields = ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RREPLACES', 'RCONFLICTS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'PKG']
+ver_monitor_fields = ['PKGE', 'PKGV', 'PKGR']
+# Percentage change to alert for numeric fields
+monitor_numeric_threshold = 10
+# Image files to monitor (note that image-info.txt is handled separately)
+img_monitor_files = ['installed-package-names.txt', 'files-in-image.txt']
+# Related context fields for reporting (note: PE, PV & PR are always reported for monitored package fields)
+related_fields = {}
+related_fields['RDEPENDS'] = ['DEPENDS']
+related_fields['RRECOMMENDS'] = ['DEPENDS']
+related_fields['FILELIST'] = ['FILES']
+related_fields['files-in-image.txt'] = ['installed-package-names.txt', 'USER_CLASSES', 'IMAGE_CLASSES', 'ROOTFS_POSTPROCESS_COMMAND', 'IMAGE_POSTPROCESS_COMMAND']
+related_fields['installed-package-names.txt'] = ['IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'NO_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
+
+colours = {
+ 'colour_default': '',
+ 'colour_add': '',
+ 'colour_remove': '',
+}
+
+def init_colours(use_colours):
+ global colours
+ if use_colours:
+ colours = {
+ 'colour_default': '\033[0m',
+ 'colour_add': '\033[1;32m',
+ 'colour_remove': '\033[1;31m',
+ }
+ else:
+ colours = {
+ 'colour_default': '',
+ 'colour_add': '',
+ 'colour_remove': '',
+ }
+
+class ChangeRecord:
+ def __init__(self, path, fieldname, oldvalue, newvalue, monitored):
+ self.path = path
+ self.fieldname = fieldname
+ self.oldvalue = oldvalue
+ self.newvalue = newvalue
+ self.monitored = monitored
+ self.related = []
+ self.filechanges = None
+
+ def __str__(self):
+ return self._str_internal(True)
+
+ def _str_internal(self, outer):
+ if outer:
+ if '/image-files/' in self.path:
+ prefix = '%s: ' % self.path.split('/image-files/')[0]
+ else:
+ prefix = '%s: ' % self.path
+ else:
+ prefix = ''
+
+ def pkglist_combine(depver):
+ pkglist = []
+ for k,v in depver.items():
+ if v:
+ pkglist.append("%s (%s)" % (k,v))
+ else:
+ pkglist.append(k)
+ return pkglist
+
+ def detect_renamed_dirs(aitems, bitems):
+ adirs = set(map(os.path.dirname, aitems))
+ bdirs = set(map(os.path.dirname, bitems))
+ files_ab = [(name, sorted(os.path.basename(item) for item in aitems if os.path.dirname(item) == name)) \
+ for name in adirs - bdirs]
+ files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \
+ for name in bdirs - adirs]
+ renamed_dirs = []
+ for dir1, files1 in files_ab:
+ rename = False
+ for dir2, files2 in files_ba:
+ if files1 == files2 and not rename:
+ renamed_dirs.append((dir1,dir2))
+ # Make sure that we don't use this (dir, files) pair again.
+ files_ba.remove((dir2,files2))
+ # If a dir has already been found to have a rename, stop and go no further.
+ rename = True
+
+ # remove files that belong to renamed dirs from aitems and bitems
+ for dir1, dir2 in renamed_dirs:
+ aitems = [item for item in aitems if os.path.dirname(item) not in (dir1, dir2)]
+ bitems = [item for item in bitems if os.path.dirname(item) not in (dir1, dir2)]
+ return renamed_dirs, aitems, bitems
+
+ if self.fieldname in list_fields or self.fieldname in list_order_fields:
+ renamed_dirs = []
+ changed_order = False
+ if self.fieldname in ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS']:
+ (depvera, depverb) = compare_pkg_lists(self.oldvalue, self.newvalue)
+ aitems = pkglist_combine(depvera)
+ bitems = pkglist_combine(depverb)
+ else:
+ aitems = self.oldvalue.split()
+ bitems = self.newvalue.split()
+ if self.fieldname == 'FILELIST':
+ renamed_dirs, aitems, bitems = detect_renamed_dirs(aitems, bitems)
+
+ removed = list(set(aitems) - set(bitems))
+ added = list(set(bitems) - set(aitems))
+
+ if not removed and not added:
+ depvera = bb.utils.explode_dep_versions2(self.oldvalue, sort=False)
+ depverb = bb.utils.explode_dep_versions2(self.newvalue, sort=False)
+ for i, j in zip(depvera.items(), depverb.items()):
+ if i[0] != j[0]:
+ changed_order = True
+ break
+
+ lines = []
+ if renamed_dirs:
+ for dfrom, dto in renamed_dirs:
+ lines.append('directory renamed {colour_remove}{}{colour_default} -> {colour_add}{}{colour_default}'.format(dfrom, dto, **colours))
+ if removed or added:
+ if removed and not bitems:
+ lines.append('removed all items "{colour_remove}{}{colour_default}"'.format(' '.join(removed), **colours))
+ else:
+ if removed:
+ lines.append('removed "{colour_remove}{value}{colour_default}"'.format(value=' '.join(removed), **colours))
+ if added:
+ lines.append('added "{colour_add}{value}{colour_default}"'.format(value=' '.join(added), **colours))
+ else:
+ lines.append('changed order')
+
+ if not (removed or added or changed_order):
+ out = ''
+ else:
+ out = '%s: %s' % (self.fieldname, ', '.join(lines))
+
+ elif self.fieldname in numeric_fields:
+ aval = int(self.oldvalue or 0)
+ bval = int(self.newvalue or 0)
+ if aval != 0:
+ percentchg = ((bval - aval) / float(aval)) * 100
+ else:
+ percentchg = 100
+ out = '{} changed from {colour_remove}{}{colour_default} to {colour_add}{}{colour_default} ({}{:.0f}%)'.format(self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg, **colours)
+ elif self.fieldname in defaultval_map:
+ out = '{} changed from {colour_remove}{}{colour_default} to {colour_add}{}{colour_default}'.format(self.fieldname, self.oldvalue, self.newvalue, **colours)
+ if self.fieldname == 'PKG' and '[default]' in self.newvalue:
+ out += ' - may indicate debian renaming failure'
+ elif self.fieldname in ['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm']:
+ if self.oldvalue and self.newvalue:
+ out = '%s changed:\n ' % self.fieldname
+ elif self.newvalue:
+ out = '%s added:\n ' % self.fieldname
+ elif self.oldvalue:
+ out = '%s cleared:\n ' % self.fieldname
+ alines = self.oldvalue.splitlines()
+ blines = self.newvalue.splitlines()
+ diff = difflib.unified_diff(alines, blines, self.fieldname, self.fieldname, lineterm='')
+ out += '\n '.join(list(diff)[2:])
+ out += '\n --'
+ elif self.fieldname in img_monitor_files or '/image-files/' in self.path:
+ if self.filechanges or (self.oldvalue and self.newvalue):
+ fieldname = self.fieldname
+ if '/image-files/' in self.path:
+ fieldname = os.path.join('/' + self.path.split('/image-files/')[1], self.fieldname)
+ out = 'Changes to %s:\n ' % fieldname
+ else:
+ if outer:
+ prefix = 'Changes to %s ' % self.path
+ out = '(%s):\n ' % self.fieldname
+ if self.filechanges:
+ out += '\n '.join(['%s' % i for i in self.filechanges])
+ else:
+ alines = self.oldvalue.splitlines()
+ blines = self.newvalue.splitlines()
+ diff = difflib.unified_diff(alines, blines, fieldname, fieldname, lineterm='')
+ out += '\n '.join(list(diff))
+ out += '\n --'
+ else:
+ out = ''
+ else:
+ out = '{} changed from "{colour_remove}{}{colour_default}" to "{colour_add}{}{colour_default}"'.format(self.fieldname, self.oldvalue, self.newvalue, **colours)
+
+ if self.related:
+ for chg in self.related:
+ if not outer and chg.fieldname in ['PE', 'PV', 'PR']:
+ continue
+ for line in chg._str_internal(False).splitlines():
+ out += '\n * %s' % line
+
+ return '%s%s' % (prefix, out) if out else ''
+
+class FileChange:
+ changetype_add = 'A'
+ changetype_remove = 'R'
+ changetype_type = 'T'
+ changetype_perms = 'P'
+ changetype_ownergroup = 'O'
+ changetype_link = 'L'
+
+ def __init__(self, path, changetype, oldvalue = None, newvalue = None):
+ self.path = path
+ self.changetype = changetype
+ self.oldvalue = oldvalue
+ self.newvalue = newvalue
+
+ def _ftype_str(self, ftype):
+ if ftype == '-':
+ return 'file'
+ elif ftype == 'd':
+ return 'directory'
+ elif ftype == 'l':
+ return 'symlink'
+ elif ftype == 'c':
+ return 'char device'
+ elif ftype == 'b':
+ return 'block device'
+ elif ftype == 'p':
+ return 'fifo'
+ elif ftype == 's':
+ return 'socket'
+ else:
+ return 'unknown (%s)' % ftype
+
+ def __str__(self):
+ if self.changetype == self.changetype_add:
+ return '%s was added' % self.path
+ elif self.changetype == self.changetype_remove:
+ return '%s was removed' % self.path
+ elif self.changetype == self.changetype_type:
+ return '%s changed type from %s to %s' % (self.path, self._ftype_str(self.oldvalue), self._ftype_str(self.newvalue))
+ elif self.changetype == self.changetype_perms:
+ return '%s changed permissions from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+ elif self.changetype == self.changetype_ownergroup:
+ return '%s changed owner/group from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+ elif self.changetype == self.changetype_link:
+ return '%s changed symlink target from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+ else:
+ return '%s changed (unknown)' % self.path
+
+
+def blob_to_dict(blob):
+ alines = [line for line in blob.data_stream.read().decode('utf-8').splitlines()]
+ adict = {}
+ for line in alines:
+ splitv = [i.strip() for i in line.split('=',1)]
+ if len(splitv) > 1:
+ adict[splitv[0]] = splitv[1]
+ return adict
+
+
+def file_list_to_dict(lines):
+ adict = {}
+ for line in lines:
+ # Leave the last few fields intact so we handle file names containing spaces
+ splitv = line.split(None,4)
+ # Grab the path and remove the leading .
+ path = splitv[4][1:].strip()
+ # Handle symlinks
+ if(' -> ' in path):
+ target = path.split(' -> ')[1]
+ path = path.split(' -> ')[0]
+ adict[path] = splitv[0:3] + [target]
+ else:
+ adict[path] = splitv[0:3]
+ return adict
+
+
+def compare_file_lists(alines, blines):
+ adict = file_list_to_dict(alines)
+ bdict = file_list_to_dict(blines)
+ filechanges = []
+ for path, splitv in adict.items():
+ newsplitv = bdict.pop(path, None)
+ if newsplitv:
+ # Check type
+ oldvalue = splitv[0][0]
+ newvalue = newsplitv[0][0]
+ if oldvalue != newvalue:
+ filechanges.append(FileChange(path, FileChange.changetype_type, oldvalue, newvalue))
+ # Check permissions
+ oldvalue = splitv[0][1:]
+ newvalue = newsplitv[0][1:]
+ if oldvalue != newvalue:
+ filechanges.append(FileChange(path, FileChange.changetype_perms, oldvalue, newvalue))
+ # Check owner/group
+ oldvalue = '%s/%s' % (splitv[1], splitv[2])
+ newvalue = '%s/%s' % (newsplitv[1], newsplitv[2])
+ if oldvalue != newvalue:
+ filechanges.append(FileChange(path, FileChange.changetype_ownergroup, oldvalue, newvalue))
+ # Check symlink target
+ if newsplitv[0][0] == 'l':
+ if len(splitv) > 3:
+ oldvalue = splitv[3]
+ else:
+ oldvalue = None
+ newvalue = newsplitv[3]
+ if oldvalue != newvalue:
+ filechanges.append(FileChange(path, FileChange.changetype_link, oldvalue, newvalue))
+ else:
+ filechanges.append(FileChange(path, FileChange.changetype_remove))
+
+ # Whatever is left over has been added
+ for path in bdict:
+ filechanges.append(FileChange(path, FileChange.changetype_add))
+
+ return filechanges
+
+
+def compare_lists(alines, blines):
+ removed = list(set(alines) - set(blines))
+ added = list(set(blines) - set(alines))
+
+ filechanges = []
+ for pkg in removed:
+ filechanges.append(FileChange(pkg, FileChange.changetype_remove))
+ for pkg in added:
+ filechanges.append(FileChange(pkg, FileChange.changetype_add))
+
+ return filechanges
+
+
+def compare_pkg_lists(astr, bstr):
+ depvera = bb.utils.explode_dep_versions2(astr)
+ depverb = bb.utils.explode_dep_versions2(bstr)
+
+ # Strip out changes where the version has increased
+ remove = []
+ for k in depvera:
+ if k in depverb:
+ dva = depvera[k]
+ dvb = depverb[k]
+ if dva and dvb and len(dva) == len(dvb):
+ # Since length is the same, sort so that prefixes (e.g. >=) will line up
+ dva.sort()
+ dvb.sort()
+ removeit = True
+ for dvai, dvbi in zip(dva, dvb):
+ if dvai != dvbi:
+ aiprefix = dvai.split(' ')[0]
+ biprefix = dvbi.split(' ')[0]
+ if aiprefix == biprefix and aiprefix in ['>=', '=']:
+ if bb.utils.vercmp(bb.utils.split_version(dvai), bb.utils.split_version(dvbi)) > 0:
+ removeit = False
+ break
+ else:
+ removeit = False
+ break
+ if removeit:
+ remove.append(k)
+
+ for k in remove:
+ depvera.pop(k)
+ depverb.pop(k)
+
+ return (depvera, depverb)
+
+
+def compare_dict_blobs(path, ablob, bblob, report_all, report_ver):
+ adict = blob_to_dict(ablob)
+ bdict = blob_to_dict(bblob)
+
+ pkgname = os.path.basename(path)
+
+ defaultvals = {}
+ defaultvals['PKG'] = pkgname
+ defaultvals['PKGE'] = '0'
+
+ changes = []
+ keys = list(set(adict.keys()) | set(bdict.keys()) | set(defaultval_map.keys()))
+ for key in keys:
+ astr = adict.get(key, '')
+ bstr = bdict.get(key, '')
+ if key in ver_monitor_fields:
+ monitored = report_ver or astr or bstr
+ else:
+ monitored = key in monitor_fields
+ mapped_key = defaultval_map.get(key, '')
+ if mapped_key:
+ if not astr:
+ astr = '%s [default]' % adict.get(mapped_key, defaultvals.get(key, ''))
+ if not bstr:
+ bstr = '%s [default]' % bdict.get(mapped_key, defaultvals.get(key, ''))
+
+ if astr != bstr:
+ if (not report_all) and key in numeric_fields:
+ aval = int(astr or 0)
+ bval = int(bstr or 0)
+ if aval != 0:
+ percentchg = ((bval - aval) / float(aval)) * 100
+ else:
+ percentchg = 100
+ if abs(percentchg) < monitor_numeric_threshold:
+ continue
+ elif (not report_all) and key in list_fields:
+ if key == "FILELIST" and path.endswith("-dbg") and bstr.strip() != '':
+ continue
+ if key in ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS']:
+ (depvera, depverb) = compare_pkg_lists(astr, bstr)
+ if depvera == depverb:
+ continue
+ alist = astr.split()
+ alist.sort()
+ blist = bstr.split()
+ blist.sort()
+ # We don't care about the removal of self-dependencies
+ if pkgname in alist and not pkgname in blist:
+ alist.remove(pkgname)
+ if ' '.join(alist) == ' '.join(blist):
+ continue
+
+ if key == 'PKGR' and not report_all:
+ vers = []
+ # strip leading 'r' and dots
+ for ver in (astr.split()[0], bstr.split()[0]):
+ if ver.startswith('r'):
+ ver = ver[1:]
+ vers.append(ver.replace('.', ''))
+ maxlen = max(len(vers[0]), len(vers[1]))
+ try:
+ # pad with '0' and convert to int
+ vers = [int(ver.ljust(maxlen, '0')) for ver in vers]
+ except ValueError:
+ pass
+ else:
+ # skip decrements and increments
+ if abs(vers[0] - vers[1]) == 1:
+ continue
+
+ chg = ChangeRecord(path, key, astr, bstr, monitored)
+ changes.append(chg)
+ return changes
+
+
+def compare_siglists(a_blob, b_blob, taskdiff=False):
+ # FIXME collapse down a recipe's tasks?
+ alines = a_blob.data_stream.read().decode('utf-8').splitlines()
+ blines = b_blob.data_stream.read().decode('utf-8').splitlines()
+ keys = []
+ pnmap = {}
+ def readsigs(lines):
+ sigs = {}
+ for line in lines:
+ linesplit = line.split()
+ if len(linesplit) > 2:
+ sigs[linesplit[0]] = linesplit[2]
+ if not linesplit[0] in keys:
+ keys.append(linesplit[0])
+ pnmap[linesplit[1]] = linesplit[0].rsplit('.', 1)[0]
+ return sigs
+ adict = readsigs(alines)
+ bdict = readsigs(blines)
+ out = []
+
+ changecount = 0
+ addcount = 0
+ removecount = 0
+ if taskdiff:
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+
+ changes = collections.OrderedDict()
+
+ def compare_hashfiles(pn, taskname, hash1, hash2):
+ hashes = [hash1, hash2]
+ hashfiles = bb.siggen.find_siginfo(pn, taskname, hashes, tinfoil.config_data)
+
+ if not taskname:
+ (pn, taskname) = pn.rsplit('.', 1)
+ pn = pnmap.get(pn, pn)
+ desc = '%s.%s' % (pn, taskname)
+
+ if len(hashfiles) == 0:
+ out.append("Unable to find matching sigdata for %s with hashes %s or %s" % (desc, hash1, hash2))
+ elif not hash1 in hashfiles:
+ out.append("Unable to find matching sigdata for %s with hash %s" % (desc, hash1))
+ elif not hash2 in hashfiles:
+ out.append("Unable to find matching sigdata for %s with hash %s" % (desc, hash2))
+ else:
+ out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb, collapsed=True)
+ for line in out2:
+ m = hashlib.sha256()
+ m.update(line.encode('utf-8'))
+ entry = changes.get(m.hexdigest(), (line, []))
+ if desc not in entry[1]:
+ changes[m.hexdigest()] = (line, entry[1] + [desc])
+
+ # Define recursion callback
+ def recursecb(key, hash1, hash2):
+ compare_hashfiles(key, None, hash1, hash2)
+ return []
+
+ for key in keys:
+ siga = adict.get(key, None)
+ sigb = bdict.get(key, None)
+ if siga is not None and sigb is not None and siga != sigb:
+ changecount += 1
+ (pn, taskname) = key.rsplit('.', 1)
+ compare_hashfiles(pn, taskname, siga, sigb)
+ elif siga is None:
+ addcount += 1
+ elif sigb is None:
+ removecount += 1
+ for key, item in changes.items():
+ line, tasks = item
+ if len(tasks) == 1:
+ desc = tasks[0]
+ elif len(tasks) == 2:
+ desc = '%s and %s' % (tasks[0], tasks[1])
+ else:
+ desc = '%s and %d others' % (tasks[-1], len(tasks)-1)
+ out.append('%s: %s' % (desc, line))
+ else:
+ for key in keys:
+ siga = adict.get(key, None)
+ sigb = bdict.get(key, None)
+ if siga is not None and sigb is not None and siga != sigb:
+ out.append('%s changed from %s to %s' % (key, siga, sigb))
+ changecount += 1
+ elif siga is None:
+ out.append('%s was added' % key)
+ addcount += 1
+ elif sigb is None:
+ out.append('%s was removed' % key)
+ removecount += 1
+ out.append('Summary: %d tasks added, %d tasks removed, %d tasks modified (%.1f%%)' % (addcount, removecount, changecount, (changecount / float(len(bdict)) * 100)))
+ return '\n'.join(out)
+
+
+def process_changes(repopath, revision1, revision2='HEAD', report_all=False, report_ver=False,
+ sigs=False, sigsdiff=False, exclude_path=None):
+ repo = git.Repo(repopath)
+ assert repo.bare == False
+ commit = repo.commit(revision1)
+ diff = commit.diff(revision2)
+
+ changes = []
+
+ if sigs or sigsdiff:
+ for d in diff.iter_change_type('M'):
+ if d.a_blob.path == 'siglist.txt':
+ changes.append(compare_siglists(d.a_blob, d.b_blob, taskdiff=sigsdiff))
+ return changes
+
+ for d in diff.iter_change_type('M'):
+ path = os.path.dirname(d.a_blob.path)
+ if path.startswith('packages/'):
+ filename = os.path.basename(d.a_blob.path)
+ if filename == 'latest':
+ changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
+ elif filename.startswith('latest.'):
+ chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
+ changes.append(chg)
+ elif path.startswith('images/'):
+ filename = os.path.basename(d.a_blob.path)
+ if filename in img_monitor_files:
+ if filename == 'files-in-image.txt':
+ alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
+ blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
+ filechanges = compare_file_lists(alines,blines)
+ if filechanges:
+ chg = ChangeRecord(path, filename, None, None, True)
+ chg.filechanges = filechanges
+ changes.append(chg)
+ elif filename == 'installed-package-names.txt':
+ alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
+ blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
+ filechanges = compare_lists(alines,blines)
+ if filechanges:
+ chg = ChangeRecord(path, filename, None, None, True)
+ chg.filechanges = filechanges
+ changes.append(chg)
+ else:
+ chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
+ changes.append(chg)
+ elif filename == 'image-info.txt':
+ changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
+ elif '/image-files/' in path:
+ chg = ChangeRecord(path, filename, d.a_blob.data_stream.read().decode('utf-8'), d.b_blob.data_stream.read().decode('utf-8'), True)
+ changes.append(chg)
+
+ # Look for added preinst/postinst/prerm/postrm
+ # (without reporting newly added recipes)
+ addedpkgs = []
+ addedchanges = []
+ for d in diff.iter_change_type('A'):
+ path = os.path.dirname(d.b_blob.path)
+ if path.startswith('packages/'):
+ filename = os.path.basename(d.b_blob.path)
+ if filename == 'latest':
+ addedpkgs.append(path)
+ elif filename.startswith('latest.'):
+ chg = ChangeRecord(path, filename[7:], '', d.b_blob.data_stream.read().decode('utf-8'), True)
+ addedchanges.append(chg)
+ for chg in addedchanges:
+ found = False
+ for pkg in addedpkgs:
+ if chg.path.startswith(pkg):
+ found = True
+ break
+ if not found:
+ changes.append(chg)
+
+ # Look for cleared preinst/postinst/prerm/postrm
+ for d in diff.iter_change_type('D'):
+ path = os.path.dirname(d.a_blob.path)
+ if path.startswith('packages/'):
+ filename = os.path.basename(d.a_blob.path)
+ if filename != 'latest' and filename.startswith('latest.'):
+ chg = ChangeRecord(path, filename[7:], d.a_blob.data_stream.read().decode('utf-8'), '', True)
+ changes.append(chg)
+
+ # Link related changes
+ for chg in changes:
+ if chg.monitored:
+ for chg2 in changes:
+ # (Check dirname in the case of fields from recipe info files)
+ if chg.path == chg2.path or os.path.dirname(chg.path) == chg2.path:
+ if chg2.fieldname in related_fields.get(chg.fieldname, []):
+ chg.related.append(chg2)
+ elif chg.path == chg2.path and chg.path.startswith('packages/') and chg2.fieldname in ['PE', 'PV', 'PR']:
+ chg.related.append(chg2)
+
+ # filter out unwanted paths
+ if exclude_path:
+ for chg in changes:
+ if chg.filechanges:
+ fchgs = []
+ for fchg in chg.filechanges:
+ for epath in exclude_path:
+ if fchg.path.startswith(epath):
+ break
+ else:
+ fchgs.append(fchg)
+ chg.filechanges = fchgs
+
+ if report_all:
+ return changes
+ else:
+ return [chg for chg in changes if chg.monitored]
diff --git a/poky/meta/lib/oe/cachedpath.py b/poky/meta/lib/oe/cachedpath.py
new file mode 100644
index 000000000..0840cc4c3
--- /dev/null
+++ b/poky/meta/lib/oe/cachedpath.py
@@ -0,0 +1,233 @@
+#
+# Based on standard python library functions but avoid
+# repeated stat calls. Its assumed the files will not change from under us
+# so we can cache stat calls.
+#
+
+import os
+import errno
+import stat as statmod
+
+class CachedPath(object):
+ def __init__(self):
+ self.statcache = {}
+ self.lstatcache = {}
+ self.normpathcache = {}
+ return
+
+ def updatecache(self, x):
+ x = self.normpath(x)
+ if x in self.statcache:
+ del self.statcache[x]
+ if x in self.lstatcache:
+ del self.lstatcache[x]
+
+ def normpath(self, path):
+ if path in self.normpathcache:
+ return self.normpathcache[path]
+ newpath = os.path.normpath(path)
+ self.normpathcache[path] = newpath
+ return newpath
+
+ def _callstat(self, path):
+ if path in self.statcache:
+ return self.statcache[path]
+ try:
+ st = os.stat(path)
+ self.statcache[path] = st
+ return st
+ except os.error:
+ self.statcache[path] = False
+ return False
+
+ # We might as well call lstat and then only
+ # call stat as well in the symbolic link case
+ # since this turns out to be much more optimal
+ # in real world usage of this cache
+ def callstat(self, path):
+ path = self.normpath(path)
+ self.calllstat(path)
+ return self.statcache[path]
+
+ def calllstat(self, path):
+ path = self.normpath(path)
+ if path in self.lstatcache:
+ return self.lstatcache[path]
+ #bb.error("LStatpath:" + path)
+ try:
+ lst = os.lstat(path)
+ self.lstatcache[path] = lst
+ if not statmod.S_ISLNK(lst.st_mode):
+ self.statcache[path] = lst
+ else:
+ self._callstat(path)
+ return lst
+ except (os.error, AttributeError):
+ self.lstatcache[path] = False
+ self.statcache[path] = False
+ return False
+
+ # This follows symbolic links, so both islink() and isdir() can be true
+ # for the same path ono systems that support symlinks
+ def isfile(self, path):
+ """Test whether a path is a regular file"""
+ st = self.callstat(path)
+ if not st:
+ return False
+ return statmod.S_ISREG(st.st_mode)
+
+ # Is a path a directory?
+ # This follows symbolic links, so both islink() and isdir()
+ # can be true for the same path on systems that support symlinks
+ def isdir(self, s):
+ """Return true if the pathname refers to an existing directory."""
+ st = self.callstat(s)
+ if not st:
+ return False
+ return statmod.S_ISDIR(st.st_mode)
+
+ def islink(self, path):
+ """Test whether a path is a symbolic link"""
+ st = self.calllstat(path)
+ if not st:
+ return False
+ return statmod.S_ISLNK(st.st_mode)
+
+ # Does a path exist?
+ # This is false for dangling symbolic links on systems that support them.
+ def exists(self, path):
+ """Test whether a path exists. Returns False for broken symbolic links"""
+ if self.callstat(path):
+ return True
+ return False
+
+ def lexists(self, path):
+ """Test whether a path exists. Returns True for broken symbolic links"""
+ if self.calllstat(path):
+ return True
+ return False
+
+ def stat(self, path):
+ return self.callstat(path)
+
+ def lstat(self, path):
+ return self.calllstat(path)
+
+ def walk(self, top, topdown=True, onerror=None, followlinks=False):
+ # Matches os.walk, not os.path.walk()
+
+ # We may not have read permission for top, in which case we can't
+ # get a list of the files the directory contains. os.path.walk
+ # always suppressed the exception then, rather than blow up for a
+ # minor reason when (say) a thousand readable directories are still
+ # left to visit. That logic is copied here.
+ try:
+ names = os.listdir(top)
+ except os.error as err:
+ if onerror is not None:
+ onerror(err)
+ return
+
+ dirs, nondirs = [], []
+ for name in names:
+ if self.isdir(os.path.join(top, name)):
+ dirs.append(name)
+ else:
+ nondirs.append(name)
+
+ if topdown:
+ yield top, dirs, nondirs
+ for name in dirs:
+ new_path = os.path.join(top, name)
+ if followlinks or not self.islink(new_path):
+ for x in self.walk(new_path, topdown, onerror, followlinks):
+ yield x
+ if not topdown:
+ yield top, dirs, nondirs
+
+ ## realpath() related functions
+ def __is_path_below(self, file, root):
+ return (file + os.path.sep).startswith(root)
+
+ def __realpath_rel(self, start, rel_path, root, loop_cnt, assume_dir):
+ """Calculates real path of symlink 'start' + 'rel_path' below
+ 'root'; no part of 'start' below 'root' must contain symlinks. """
+ have_dir = True
+
+ for d in rel_path.split(os.path.sep):
+ if not have_dir and not assume_dir:
+ raise OSError(errno.ENOENT, "no such directory %s" % start)
+
+ if d == os.path.pardir: # '..'
+ if len(start) >= len(root):
+ # do not follow '..' before root
+ start = os.path.dirname(start)
+ else:
+ # emit warning?
+ pass
+ else:
+ (start, have_dir) = self.__realpath(os.path.join(start, d),
+ root, loop_cnt, assume_dir)
+
+ assert(self.__is_path_below(start, root))
+
+ return start
+
+ def __realpath(self, file, root, loop_cnt, assume_dir):
+ while self.islink(file) and len(file) >= len(root):
+ if loop_cnt == 0:
+ raise OSError(errno.ELOOP, file)
+
+ loop_cnt -= 1
+ target = os.path.normpath(os.readlink(file))
+
+ if not os.path.isabs(target):
+ tdir = os.path.dirname(file)
+ assert(self.__is_path_below(tdir, root))
+ else:
+ tdir = root
+
+ file = self.__realpath_rel(tdir, target, root, loop_cnt, assume_dir)
+
+ try:
+ is_dir = self.isdir(file)
+ except:
+ is_dir = False
+
+ return (file, is_dir)
+
+ def realpath(self, file, root, use_physdir = True, loop_cnt = 100, assume_dir = False):
+ """ Returns the canonical path of 'file' with assuming a
+ toplevel 'root' directory. When 'use_physdir' is set, all
+ preceding path components of 'file' will be resolved first;
+ this flag should be set unless it is guaranteed that there is
+ no symlink in the path. When 'assume_dir' is not set, missing
+ path components will raise an ENOENT error"""
+
+ root = os.path.normpath(root)
+ file = os.path.normpath(file)
+
+ if not root.endswith(os.path.sep):
+ # letting root end with '/' makes some things easier
+ root = root + os.path.sep
+
+ if not self.__is_path_below(file, root):
+ raise OSError(errno.EINVAL, "file '%s' is not below root" % file)
+
+ try:
+ if use_physdir:
+ file = self.__realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
+ else:
+ file = self.__realpath(file, root, loop_cnt, assume_dir)[0]
+ except OSError as e:
+ if e.errno == errno.ELOOP:
+ # make ELOOP more readable; without catching it, there will
+ # be printed a backtrace with 100s of OSError exceptions
+ # else
+ raise OSError(errno.ELOOP,
+ "too much recursions while resolving '%s'; loop in '%s'" %
+ (file, e.strerror))
+
+ raise
+
+ return file
diff --git a/poky/meta/lib/oe/classextend.py b/poky/meta/lib/oe/classextend.py
new file mode 100644
index 000000000..d2eeaf0e5
--- /dev/null
+++ b/poky/meta/lib/oe/classextend.py
@@ -0,0 +1,122 @@
+import collections
+
+class ClassExtender(object):
+ def __init__(self, extname, d):
+ self.extname = extname
+ self.d = d
+ self.pkgs_mapping = []
+
+ def extend_name(self, name):
+ if name.startswith("kernel-") or name == "virtual/kernel":
+ return name
+ if name.startswith("rtld"):
+ return name
+ if name.endswith("-crosssdk"):
+ return name
+ if name.endswith("-" + self.extname):
+ name = name.replace("-" + self.extname, "")
+ if name.startswith("virtual/"):
+ subs = name.split("/", 1)[1]
+ if not subs.startswith(self.extname):
+ return "virtual/" + self.extname + "-" + subs
+ return name
+ if not name.startswith(self.extname):
+ return self.extname + "-" + name
+ return name
+
+ def map_variable(self, varname, setvar = True):
+ var = self.d.getVar(varname)
+ if not var:
+ return ""
+ var = var.split()
+ newvar = []
+ for v in var:
+ newvar.append(self.extend_name(v))
+ newdata = " ".join(newvar)
+ if setvar:
+ self.d.setVar(varname, newdata)
+ return newdata
+
+ def map_regexp_variable(self, varname, setvar = True):
+ var = self.d.getVar(varname)
+ if not var:
+ return ""
+ var = var.split()
+ newvar = []
+ for v in var:
+ if v.startswith("^" + self.extname):
+ newvar.append(v)
+ elif v.startswith("^"):
+ newvar.append("^" + self.extname + "-" + v[1:])
+ else:
+ newvar.append(self.extend_name(v))
+ newdata = " ".join(newvar)
+ if setvar:
+ self.d.setVar(varname, newdata)
+ return newdata
+
+ def map_depends(self, dep):
+ if dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('cross-canadian' in dep) or ('-crosssdk-' in dep):
+ return dep
+ else:
+ # Do not extend for that already have multilib prefix
+ var = self.d.getVar("MULTILIB_VARIANTS")
+ if var:
+ var = var.split()
+ for v in var:
+ if dep.startswith(v):
+ return dep
+ return self.extend_name(dep)
+
+ def map_depends_variable(self, varname, suffix = ""):
+ # We need to preserve EXTENDPKGV so it can be expanded correctly later
+ if suffix:
+ varname = varname + "_" + suffix
+ orig = self.d.getVar("EXTENDPKGV", False)
+ self.d.setVar("EXTENDPKGV", "EXTENDPKGV")
+ deps = self.d.getVar(varname)
+ if not deps:
+ self.d.setVar("EXTENDPKGV", orig)
+ return
+ deps = bb.utils.explode_dep_versions2(deps)
+ newdeps = collections.OrderedDict()
+ for dep in deps:
+ newdeps[self.map_depends(dep)] = deps[dep]
+
+ self.d.setVar(varname, bb.utils.join_deps(newdeps, False).replace("EXTENDPKGV", "${EXTENDPKGV}"))
+ self.d.setVar("EXTENDPKGV", orig)
+
+ def map_packagevars(self):
+ for pkg in (self.d.getVar("PACKAGES").split() + [""]):
+ self.map_depends_variable("RDEPENDS", pkg)
+ self.map_depends_variable("RRECOMMENDS", pkg)
+ self.map_depends_variable("RSUGGESTS", pkg)
+ self.map_depends_variable("RPROVIDES", pkg)
+ self.map_depends_variable("RREPLACES", pkg)
+ self.map_depends_variable("RCONFLICTS", pkg)
+ self.map_depends_variable("PKG", pkg)
+
+ def rename_packages(self):
+ for pkg in (self.d.getVar("PACKAGES") or "").split():
+ if pkg.startswith(self.extname):
+ self.pkgs_mapping.append([pkg.split(self.extname + "-")[1], pkg])
+ continue
+ self.pkgs_mapping.append([pkg, self.extend_name(pkg)])
+
+ self.d.setVar("PACKAGES", " ".join([row[1] for row in self.pkgs_mapping]))
+
+ def rename_package_variables(self, variables):
+ for pkg_mapping in self.pkgs_mapping:
+ for subs in variables:
+ self.d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1]))
+
+class NativesdkClassExtender(ClassExtender):
+ def map_depends(self, dep):
+ if dep.startswith(self.extname):
+ return dep
+ if dep.endswith(("-gcc-initial", "-gcc", "-g++")):
+ return dep + "-crosssdk"
+ elif dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('-cross-' in dep) or ('-crosssdk-' in dep):
+ return dep
+ else:
+ return self.extend_name(dep)
diff --git a/poky/meta/lib/oe/classutils.py b/poky/meta/lib/oe/classutils.py
new file mode 100644
index 000000000..45cd5249b
--- /dev/null
+++ b/poky/meta/lib/oe/classutils.py
@@ -0,0 +1,44 @@
+
+class ClassRegistryMeta(type):
+ """Give each ClassRegistry their own registry"""
+ def __init__(cls, name, bases, attrs):
+ cls.registry = {}
+ type.__init__(cls, name, bases, attrs)
+
+class ClassRegistry(type, metaclass=ClassRegistryMeta):
+ """Maintain a registry of classes, indexed by name.
+
+Note that this implementation requires that the names be unique, as it uses
+a dictionary to hold the classes by name.
+
+The name in the registry can be overridden via the 'name' attribute of the
+class, and the 'priority' attribute controls priority. The prioritized()
+method returns the registered classes in priority order.
+
+Subclasses of ClassRegistry may define an 'implemented' property to exert
+control over whether the class will be added to the registry (e.g. to keep
+abstract base classes out of the registry)."""
+ priority = 0
+ def __init__(cls, name, bases, attrs):
+ super(ClassRegistry, cls).__init__(name, bases, attrs)
+ try:
+ if not cls.implemented:
+ return
+ except AttributeError:
+ pass
+
+ try:
+ cls.name
+ except AttributeError:
+ cls.name = name
+ cls.registry[cls.name] = cls
+
+ @classmethod
+ def prioritized(tcls):
+ return sorted(list(tcls.registry.values()),
+ key=lambda v: (v.priority, v.name), reverse=True)
+
+ def unregister(cls):
+ for key in cls.registry.keys():
+ if cls.registry[key] is cls:
+ del cls.registry[key]
diff --git a/poky/meta/lib/oe/copy_buildsystem.py b/poky/meta/lib/oe/copy_buildsystem.py
new file mode 100644
index 000000000..4b94806c7
--- /dev/null
+++ b/poky/meta/lib/oe/copy_buildsystem.py
@@ -0,0 +1,262 @@
+# This class should provide easy access to the different aspects of the
+# buildsystem such as layers, bitbake location, etc.
+import stat
+import shutil
+
+def _smart_copy(src, dest):
+ import subprocess
+ # smart_copy will choose the correct function depending on whether the
+ # source is a file or a directory.
+ mode = os.stat(src).st_mode
+ if stat.S_ISDIR(mode):
+ bb.utils.mkdirhier(dest)
+ cmd = "tar --exclude='.git' --xattrs --xattrs-include='*' -chf - -C %s -p . \
+ | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dest)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ else:
+ shutil.copyfile(src, dest)
+ shutil.copymode(src, dest)
+
+class BuildSystem(object):
+ def __init__(self, context, d):
+ self.d = d
+ self.context = context
+ self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS').split()]
+ self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE') or "").split()
+
+ def copy_bitbake_and_layers(self, destdir, workspace_name=None):
+ # Copy in all metadata layers + bitbake (as repositories)
+ layers_copied = []
+ bb.utils.mkdirhier(destdir)
+ layers = list(self.layerdirs)
+
+ corebase = os.path.abspath(self.d.getVar('COREBASE'))
+ layers.append(corebase)
+ # The bitbake build system uses the meta-skeleton layer as a layout
+ # for common recipies, e.g: the recipetool script to create kernel recipies
+ # Add the meta-skeleton layer to be included as part of the eSDK installation
+ layers.append(os.path.join(corebase, 'meta-skeleton'))
+
+ # Exclude layers
+ for layer_exclude in self.layers_exclude:
+ if layer_exclude in layers:
+ layers.remove(layer_exclude)
+
+ workspace_newname = workspace_name
+ if workspace_newname:
+ layernames = [os.path.basename(layer) for layer in layers]
+ extranum = 0
+ while workspace_newname in layernames:
+ extranum += 1
+ workspace_newname = '%s-%d' % (workspace_name, extranum)
+
+ corebase_files = self.d.getVar('COREBASE_FILES').split()
+ corebase_files = [corebase + '/' +x for x in corebase_files]
+ # Make sure bitbake goes in
+ bitbake_dir = bb.__file__.rsplit('/', 3)[0]
+ corebase_files.append(bitbake_dir)
+
+ for layer in layers:
+ layerconf = os.path.join(layer, 'conf', 'layer.conf')
+ layernewname = os.path.basename(layer)
+ workspace = False
+ if os.path.exists(layerconf):
+ with open(layerconf, 'r') as f:
+ if f.readline().startswith("# ### workspace layer auto-generated by devtool ###"):
+ if workspace_newname:
+ layernewname = workspace_newname
+ workspace = True
+ else:
+ bb.plain("NOTE: Excluding local workspace layer %s from %s" % (layer, self.context))
+ continue
+
+ # If the layer was already under corebase, leave it there
+ # since layers such as meta have issues when moved.
+ layerdestpath = destdir
+ if corebase == os.path.dirname(layer):
+ layerdestpath += '/' + os.path.basename(corebase)
+ else:
+ layer_relative = os.path.basename(corebase) + '/' + os.path.relpath(layer, corebase)
+ if os.path.dirname(layer_relative) != layernewname:
+ layerdestpath += '/' + os.path.dirname(layer_relative)
+
+ layerdestpath += '/' + layernewname
+
+ layer_relative = os.path.relpath(layerdestpath,
+ destdir)
+ layers_copied.append(layer_relative)
+
+ # Treat corebase as special since it typically will contain
+ # build directories or other custom items.
+ if corebase == layer:
+ bb.utils.mkdirhier(layerdestpath)
+ for f in corebase_files:
+ f_basename = os.path.basename(f)
+ destname = os.path.join(layerdestpath, f_basename)
+ _smart_copy(f, destname)
+ else:
+ if os.path.exists(os.path.join(layerdestpath, 'conf/layer.conf')):
+ bb.note("Skipping layer %s, already handled" % layer)
+ else:
+ _smart_copy(layer, layerdestpath)
+
+ if workspace:
+ # Make some adjustments original workspace layer
+ # Drop sources (recipe tasks will be locked, so we don't need them)
+ srcdir = os.path.join(layerdestpath, 'sources')
+ if os.path.isdir(srcdir):
+ shutil.rmtree(srcdir)
+ # Drop all bbappends except the one for the image the SDK is being built for
+ # (because of externalsrc, the workspace bbappends will interfere with the
+ # locked signatures if present, and we don't need them anyway)
+ image_bbappend = os.path.splitext(os.path.basename(self.d.getVar('FILE')))[0] + '.bbappend'
+ appenddir = os.path.join(layerdestpath, 'appends')
+ if os.path.isdir(appenddir):
+ for fn in os.listdir(appenddir):
+ if fn == image_bbappend:
+ continue
+ else:
+ os.remove(os.path.join(appenddir, fn))
+ # Drop README
+ readme = os.path.join(layerdestpath, 'README')
+ if os.path.exists(readme):
+ os.remove(readme)
+ # Filter out comments in layer.conf and change layer name
+ layerconf = os.path.join(layerdestpath, 'conf', 'layer.conf')
+ with open(layerconf, 'r') as f:
+ origlines = f.readlines()
+ with open(layerconf, 'w') as f:
+ for line in origlines:
+ if line.startswith('#'):
+ continue
+ line = line.replace('workspacelayer', workspace_newname)
+ f.write(line)
+
+ # meta-skeleton layer is added as part of the build system
+ # but not as a layer included in the build, therefore it is
+ # not reported to the function caller.
+ for layer in layers_copied:
+ if layer.endswith('/meta-skeleton'):
+ layers_copied.remove(layer)
+ break
+
+ return layers_copied
+
+def generate_locked_sigs(sigfile, d):
+ bb.utils.mkdirhier(os.path.dirname(sigfile))
+ depd = d.getVar('BB_TASKDEPDATA', False)
+ tasks = ['%s.%s' % (v[2], v[1]) for v in depd.values()]
+ bb.parse.siggen.dump_lockedsigs(sigfile, tasks)
+
+def prune_lockedsigs(excluded_tasks, excluded_targets, lockedsigs, pruned_output):
+ with open(lockedsigs, 'r') as infile:
+ bb.utils.mkdirhier(os.path.dirname(pruned_output))
+ with open(pruned_output, 'w') as f:
+ invalue = False
+ for line in infile:
+ if invalue:
+ if line.endswith('\\\n'):
+ splitval = line.strip().split(':')
+ if not splitval[1] in excluded_tasks and not splitval[0] in excluded_targets:
+ f.write(line)
+ else:
+ f.write(line)
+ invalue = False
+ elif line.startswith('SIGGEN_LOCKEDSIGS'):
+ invalue = True
+ f.write(line)
+
+def merge_lockedsigs(copy_tasks, lockedsigs_main, lockedsigs_extra, merged_output, copy_output=None):
+ merged = {}
+ arch_order = []
+ with open(lockedsigs_main, 'r') as f:
+ invalue = None
+ for line in f:
+ if invalue:
+ if line.endswith('\\\n'):
+ merged[invalue].append(line)
+ else:
+ invalue = None
+ elif line.startswith('SIGGEN_LOCKEDSIGS_t-'):
+ invalue = line[18:].split('=', 1)[0].rstrip()
+ merged[invalue] = []
+ arch_order.append(invalue)
+
+ with open(lockedsigs_extra, 'r') as f:
+ invalue = None
+ tocopy = {}
+ for line in f:
+ if invalue:
+ if line.endswith('\\\n'):
+ if not line in merged[invalue]:
+ target, task = line.strip().split(':')[:2]
+ if not copy_tasks or task in copy_tasks:
+ tocopy[invalue].append(line)
+ merged[invalue].append(line)
+ else:
+ invalue = None
+ elif line.startswith('SIGGEN_LOCKEDSIGS_t-'):
+ invalue = line[18:].split('=', 1)[0].rstrip()
+ if not invalue in merged:
+ merged[invalue] = []
+ arch_order.append(invalue)
+ tocopy[invalue] = []
+
+ def write_sigs_file(fn, types, sigs):
+ fulltypes = []
+ bb.utils.mkdirhier(os.path.dirname(fn))
+ with open(fn, 'w') as f:
+ for typename in types:
+ lines = sigs[typename]
+ if lines:
+ f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % typename)
+ for line in lines:
+ f.write(line)
+ f.write(' "\n')
+ fulltypes.append(typename)
+ f.write('SIGGEN_LOCKEDSIGS_TYPES = "%s"\n' % ' '.join(fulltypes))
+
+ if copy_output:
+ write_sigs_file(copy_output, list(tocopy.keys()), tocopy)
+ if merged_output:
+ write_sigs_file(merged_output, arch_order, merged)
+
+def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring="", filterfile=None):
+ import shutil
+ bb.note('Generating sstate-cache...')
+
+ nativelsbstring = d.getVar('NATIVELSBSTRING')
+ bb.process.run("gen-lockedsig-cache %s %s %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache, nativelsbstring, filterfile or ''))
+ if fixedlsbstring and nativelsbstring != fixedlsbstring:
+ nativedir = output_sstate_cache + '/' + nativelsbstring
+ if os.path.isdir(nativedir):
+ destdir = os.path.join(output_sstate_cache, fixedlsbstring)
+ for root, _, files in os.walk(nativedir):
+ for fn in files:
+ src = os.path.join(root, fn)
+ dest = os.path.join(destdir, os.path.relpath(src, nativedir))
+ if os.path.exists(dest):
+ # Already exists, and it'll be the same file, so just delete it
+ os.unlink(src)
+ else:
+ bb.utils.mkdirhier(os.path.dirname(dest))
+ shutil.move(src, dest)
+
+def check_sstate_task_list(d, targets, filteroutfile, cmdprefix='', cwd=None, logfile=None):
+ import subprocess
+
+ bb.note('Generating sstate task list...')
+
+ if not cwd:
+ cwd = os.getcwd()
+ if logfile:
+ logparam = '-l %s' % logfile
+ else:
+ logparam = ''
+ cmd = "%sBB_SETSCENE_ENFORCE=1 PSEUDO_DISABLED=1 oe-check-sstate %s -s -o %s %s" % (cmdprefix, targets, filteroutfile, logparam)
+ env = dict(d.getVar('BB_ORIGENV', False))
+ env.pop('BUILDDIR', '')
+ env.pop('BBPATH', '')
+ pathitems = env['PATH'].split(':')
+ env['PATH'] = ':'.join([item for item in pathitems if not item.endswith('/bitbake/bin')])
+ bb.process.run(cmd, stderr=subprocess.STDOUT, env=env, cwd=cwd, executable='/bin/bash')
diff --git a/poky/meta/lib/oe/data.py b/poky/meta/lib/oe/data.py
new file mode 100644
index 000000000..b8901e63f
--- /dev/null
+++ b/poky/meta/lib/oe/data.py
@@ -0,0 +1,47 @@
+import json
+import oe.maketype
+
+def typed_value(key, d):
+ """Construct a value for the specified metadata variable, using its flags
+ to determine the type and parameters for construction."""
+ var_type = d.getVarFlag(key, 'type')
+ flags = d.getVarFlags(key)
+ if flags is not None:
+ flags = dict((flag, d.expand(value))
+ for flag, value in list(flags.items()))
+ else:
+ flags = {}
+
+ try:
+ return oe.maketype.create(d.getVar(key) or '', var_type, **flags)
+ except (TypeError, ValueError) as exc:
+ bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
+
+def export2json(d, json_file, expand=True, searchString="",replaceString=""):
+ data2export = {}
+ keys2export = []
+
+ for key in d.keys():
+ if key.startswith("_"):
+ continue
+ elif key.startswith("BB"):
+ continue
+ elif key.startswith("B_pn"):
+ continue
+ elif key.startswith("do_"):
+ continue
+ elif d.getVarFlag(key, "func"):
+ continue
+
+ keys2export.append(key)
+
+ for key in keys2export:
+ try:
+ data2export[key] = d.getVar(key, expand).replace(searchString,replaceString)
+ except bb.data_smart.ExpansionError:
+ data2export[key] = ''
+ except AttributeError:
+ pass
+
+ with open(json_file, "w") as f:
+ json.dump(data2export, f, skipkeys=True, indent=4, sort_keys=True)
diff --git a/poky/meta/lib/oe/distro_check.py b/poky/meta/lib/oe/distro_check.py
new file mode 100644
index 000000000..e775c3a6e
--- /dev/null
+++ b/poky/meta/lib/oe/distro_check.py
@@ -0,0 +1,308 @@
+def create_socket(url, d):
+ import urllib
+ from bb.utils import export_proxies
+
+ export_proxies(d)
+ return urllib.request.urlopen(url)
+
+def get_links_from_url(url, d):
+ "Return all the href links found on the web location"
+
+ from bs4 import BeautifulSoup, SoupStrainer
+
+ soup = BeautifulSoup(create_socket(url,d), "html.parser", parse_only=SoupStrainer("a"))
+ hyperlinks = []
+ for line in soup.find_all('a', href=True):
+ hyperlinks.append(line['href'].strip('/'))
+ return hyperlinks
+
+def find_latest_numeric_release(url, d):
+ "Find the latest listed numeric release on the given url"
+ max=0
+ maxstr=""
+ for link in get_links_from_url(url, d):
+ try:
+ # TODO use LooseVersion
+ release = float(link)
+ except:
+ release = 0
+ if release > max:
+ max = release
+ maxstr = link
+ return maxstr
+
+def is_src_rpm(name):
+ "Check if the link is pointing to a src.rpm file"
+ return name.endswith(".src.rpm")
+
+def package_name_from_srpm(srpm):
+ "Strip out the package name from the src.rpm filename"
+
+ # ca-certificates-2016.2.7-1.0.fc24.src.rpm
+ # ^name ^ver ^release^removed
+ (name, version, release) = srpm.replace(".src.rpm", "").rsplit("-", 2)
+ return name
+
+def get_source_package_list_from_url(url, section, d):
+ "Return a sectioned list of package names from a URL list"
+
+ bb.note("Reading %s: %s" % (url, section))
+ links = get_links_from_url(url, d)
+ srpms = filter(is_src_rpm, links)
+ names_list = map(package_name_from_srpm, srpms)
+
+ new_pkgs = set()
+ for pkgs in names_list:
+ new_pkgs.add(pkgs + ":" + section)
+ return new_pkgs
+
+def get_source_package_list_from_url_by_letter(url, section, d):
+ import string
+ from urllib.error import HTTPError
+ packages = set()
+ for letter in (string.ascii_lowercase + string.digits):
+ # Not all subfolders may exist, so silently handle 404
+ try:
+ packages |= get_source_package_list_from_url(url + "/" + letter, section, d)
+ except HTTPError as e:
+ if e.code != 404: raise
+ return packages
+
+def get_latest_released_fedora_source_package_list(d):
+ "Returns list of all the name os packages in the latest fedora distro"
+ latest = find_latest_numeric_release("http://archive.fedoraproject.org/pub/fedora/linux/releases/", d)
+ package_names = get_source_package_list_from_url_by_letter("http://archive.fedoraproject.org/pub/fedora/linux/releases/%s/Everything/source/tree/Packages/" % latest, "main", d)
+ package_names |= get_source_package_list_from_url_by_letter("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates", d)
+ return latest, package_names
+
+def get_latest_released_opensuse_source_package_list(d):
+ "Returns list of all the name os packages in the latest opensuse distro"
+ latest = find_latest_numeric_release("http://download.opensuse.org/source/distribution/leap", d)
+
+ package_names = get_source_package_list_from_url("http://download.opensuse.org/source/distribution/leap/%s/repo/oss/suse/src/" % latest, "main", d)
+ package_names |= get_source_package_list_from_url("http://download.opensuse.org/update/leap/%s/oss/src/" % latest, "updates", d)
+ return latest, package_names
+
+def get_latest_released_clear_source_package_list(d):
+ latest = find_latest_numeric_release("https://download.clearlinux.org/releases/", d)
+ package_names = get_source_package_list_from_url("https://download.clearlinux.org/releases/%s/clear/source/SRPMS/" % latest, "main", d)
+ return latest, package_names
+
+def find_latest_debian_release(url, d):
+ "Find the latest listed debian release on the given url"
+
+ releases = [link.replace("Debian", "")
+ for link in get_links_from_url(url, d)
+ if link.startswith("Debian")]
+ releases.sort()
+ try:
+ return releases[-1]
+ except:
+ return "_NotFound_"
+
+def get_debian_style_source_package_list(url, section, d):
+ "Return the list of package-names stored in the debian style Sources.gz file"
+ import gzip
+
+ package_names = set()
+ for line in gzip.open(create_socket(url, d), mode="rt"):
+ if line.startswith("Package:"):
+ pkg = line.split(":", 1)[1].strip()
+ package_names.add(pkg + ":" + section)
+ return package_names
+
+def get_latest_released_debian_source_package_list(d):
+ "Returns list of all the name of packages in the latest debian distro"
+ latest = find_latest_debian_release("http://ftp.debian.org/debian/dists/", d)
+ url = "http://ftp.debian.org/debian/dists/stable/main/source/Sources.gz"
+ package_names = get_debian_style_source_package_list(url, "main", d)
+ url = "http://ftp.debian.org/debian/dists/stable-proposed-updates/main/source/Sources.gz"
+ package_names |= get_debian_style_source_package_list(url, "updates", d)
+ return latest, package_names
+
+def find_latest_ubuntu_release(url, d):
+ """
+ Find the latest listed Ubuntu release on the given ubuntu/dists/ URL.
+
+ To avoid matching development releases look for distributions that have
+ updates, so the resulting distro could be any supported release.
+ """
+ url += "?C=M;O=D" # Descending Sort by Last Modified
+ for link in get_links_from_url(url, d):
+ if "-updates" in link:
+ distro = link.replace("-updates", "")
+ return distro
+ return "_NotFound_"
+
+def get_latest_released_ubuntu_source_package_list(d):
+ "Returns list of all the name os packages in the latest ubuntu distro"
+ latest = find_latest_ubuntu_release("http://archive.ubuntu.com/ubuntu/dists/", d)
+ url = "http://archive.ubuntu.com/ubuntu/dists/%s/main/source/Sources.gz" % latest
+ package_names = get_debian_style_source_package_list(url, "main", d)
+ url = "http://archive.ubuntu.com/ubuntu/dists/%s-updates/main/source/Sources.gz" % latest
+ package_names |= get_debian_style_source_package_list(url, "updates", d)
+ return latest, package_names
+
+def create_distro_packages_list(distro_check_dir, d):
+ import shutil
+
+ pkglst_dir = os.path.join(distro_check_dir, "package_lists")
+ bb.utils.remove(pkglst_dir, True)
+ bb.utils.mkdirhier(pkglst_dir)
+
+ per_distro_functions = (
+ ("Debian", get_latest_released_debian_source_package_list),
+ ("Ubuntu", get_latest_released_ubuntu_source_package_list),
+ ("Fedora", get_latest_released_fedora_source_package_list),
+ ("openSUSE", get_latest_released_opensuse_source_package_list),
+ ("Clear", get_latest_released_clear_source_package_list),
+ )
+
+ for name, fetcher_func in per_distro_functions:
+ try:
+ release, package_list = fetcher_func(d)
+ except Exception as e:
+ bb.warn("Cannot fetch packages for %s: %s" % (name, e))
+ bb.note("Distro: %s, Latest Release: %s, # src packages: %d" % (name, release, len(package_list)))
+ if len(package_list) == 0:
+ bb.error("Didn't fetch any packages for %s %s" % (name, release))
+
+ package_list_file = os.path.join(pkglst_dir, name + "-" + release)
+ with open(package_list_file, 'w') as f:
+ for pkg in sorted(package_list):
+ f.write(pkg + "\n")
+
+def update_distro_data(distro_check_dir, datetime, d):
+ """
+ If distro packages list data is old then rebuild it.
+ The operations has to be protected by a lock so that
+ only one thread performes it at a time.
+ """
+ if not os.path.isdir (distro_check_dir):
+ try:
+ bb.note ("Making new directory: %s" % distro_check_dir)
+ os.makedirs (distro_check_dir)
+ except OSError:
+ raise Exception('Unable to create directory %s' % (distro_check_dir))
+
+
+ datetime_file = os.path.join(distro_check_dir, "build_datetime")
+ saved_datetime = "_invalid_"
+ import fcntl
+ try:
+ if not os.path.exists(datetime_file):
+ open(datetime_file, 'w+').close() # touch the file so that the next open won't fail
+
+ f = open(datetime_file, "r+")
+ fcntl.lockf(f, fcntl.LOCK_EX)
+ saved_datetime = f.read()
+ if saved_datetime[0:8] != datetime[0:8]:
+ bb.note("The build datetime did not match: saved:%s current:%s" % (saved_datetime, datetime))
+ bb.note("Regenerating distro package lists")
+ create_distro_packages_list(distro_check_dir, d)
+ f.seek(0)
+ f.write(datetime)
+
+ except OSError as e:
+ raise Exception('Unable to open timestamp: %s' % e)
+ finally:
+ fcntl.lockf(f, fcntl.LOCK_UN)
+ f.close()
+
+def compare_in_distro_packages_list(distro_check_dir, d):
+ if not os.path.isdir(distro_check_dir):
+ raise Exception("compare_in_distro_packages_list: invalid distro_check_dir passed")
+
+ localdata = bb.data.createCopy(d)
+ pkglst_dir = os.path.join(distro_check_dir, "package_lists")
+ matching_distros = []
+ pn = recipe_name = d.getVar('PN')
+ bb.note("Checking: %s" % pn)
+
+ if pn.find("-native") != -1:
+ pnstripped = pn.split("-native")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+ recipe_name = pnstripped[0]
+
+ if pn.startswith("nativesdk-"):
+ pnstripped = pn.split("nativesdk-")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[1] + ":" + d.getVar('OVERRIDES'))
+ recipe_name = pnstripped[1]
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+ recipe_name = pnstripped[0]
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES'))
+ recipe_name = pnstripped[0]
+
+ bb.note("Recipe: %s" % recipe_name)
+
+ distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'})
+ tmp = localdata.getVar('DISTRO_PN_ALIAS') or ""
+ for str in tmp.split():
+ if str and str.find("=") == -1 and distro_exceptions[str]:
+ matching_distros.append(str)
+
+ distro_pn_aliases = {}
+ for str in tmp.split():
+ if "=" in str:
+ (dist, pn_alias) = str.split('=')
+ distro_pn_aliases[dist.strip().lower()] = pn_alias.strip()
+
+ for file in os.listdir(pkglst_dir):
+ (distro, distro_release) = file.split("-")
+ f = open(os.path.join(pkglst_dir, file), "r")
+ for line in f:
+ (pkg, section) = line.split(":")
+ if distro.lower() in distro_pn_aliases:
+ pn = distro_pn_aliases[distro.lower()]
+ else:
+ pn = recipe_name
+ if pn == pkg:
+ matching_distros.append(distro + "-" + section[:-1]) # strip the \n at the end
+ f.close()
+ break
+ f.close()
+
+ for item in tmp.split():
+ matching_distros.append(item)
+ bb.note("Matching: %s" % matching_distros)
+ return matching_distros
+
+def create_log_file(d, logname):
+ logpath = d.getVar('LOG_DIR')
+ bb.utils.mkdirhier(logpath)
+ logfn, logsuffix = os.path.splitext(logname)
+ logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME'), logsuffix))
+ if not os.path.exists(logfile):
+ slogfile = os.path.join(logpath, logname)
+ if os.path.exists(slogfile):
+ os.remove(slogfile)
+ open(logfile, 'w+').close()
+ os.symlink(logfile, slogfile)
+ d.setVar('LOG_FILE', logfile)
+ return logfile
+
+
+def save_distro_check_result(result, datetime, result_file, d):
+ pn = d.getVar('PN')
+ logdir = d.getVar('LOG_DIR')
+ if not logdir:
+ bb.error("LOG_DIR variable is not defined, can't write the distro_check results")
+ return
+ bb.utils.mkdirhier(logdir)
+
+ line = pn
+ for i in result:
+ line = line + "," + i
+ f = open(result_file, "a")
+ import fcntl
+ fcntl.lockf(f, fcntl.LOCK_EX)
+ f.seek(0, os.SEEK_END) # seek to the end of file
+ f.write(line + "\n")
+ fcntl.lockf(f, fcntl.LOCK_UN)
+ f.close()
diff --git a/poky/meta/lib/oe/gpg_sign.py b/poky/meta/lib/oe/gpg_sign.py
new file mode 100644
index 000000000..b17272928
--- /dev/null
+++ b/poky/meta/lib/oe/gpg_sign.py
@@ -0,0 +1,128 @@
+"""Helper module for GPG signing"""
+import os
+
+import bb
+import oe.utils
+
+class LocalSigner(object):
+ """Class for handling local (on the build host) signing"""
+ def __init__(self, d):
+ self.gpg_bin = d.getVar('GPG_BIN') or \
+ bb.utils.which(os.getenv('PATH'), 'gpg')
+ self.gpg_path = d.getVar('GPG_PATH')
+ self.gpg_version = self.get_gpg_version()
+ self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign")
+ self.gpg_agent_bin = bb.utils.which(os.getenv('PATH'), "gpg-agent")
+
+ def export_pubkey(self, output_file, keyid, armor=True):
+ """Export GPG public key to a file"""
+ cmd = '%s --no-permission-warning --batch --yes --export -o %s ' % \
+ (self.gpg_bin, output_file)
+ if self.gpg_path:
+ cmd += "--homedir %s " % self.gpg_path
+ if armor:
+ cmd += "--armor "
+ cmd += keyid
+ status, output = oe.utils.getstatusoutput(cmd)
+ if status:
+ raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' %
+ (keyid, output))
+
+ def sign_rpms(self, files, keyid, passphrase, digest, sign_chunk, fsk=None, fsk_password=None):
+ """Sign RPM files"""
+
+ cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid
+ gpg_args = '--no-permission-warning --batch --passphrase=%s --agent-program=%s|--auto-expand-secmem' % (passphrase, self.gpg_agent_bin)
+ if self.gpg_version > (2,1,):
+ gpg_args += ' --pinentry-mode=loopback'
+ cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args
+ cmd += "--define '_binary_filedigest_algorithm %s' " % digest
+ if self.gpg_bin:
+ cmd += "--define '__gpg %s' " % self.gpg_bin
+ if self.gpg_path:
+ cmd += "--define '_gpg_path %s' " % self.gpg_path
+ if fsk:
+ cmd += "--signfiles --fskpath %s " % fsk
+ if fsk_password:
+ cmd += "--define '_file_signing_key_password %s' " % fsk_password
+
+ # Sign in chunks
+ for i in range(0, len(files), sign_chunk):
+ status, output = oe.utils.getstatusoutput(cmd + ' '.join(files[i:i+sign_chunk]))
+ if status:
+ raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output)
+
+ def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True):
+ """Create a detached signature of a file"""
+ import subprocess
+
+ if passphrase_file and passphrase:
+ raise Exception("You should use either passphrase_file of passphrase, not both")
+
+ cmd = [self.gpg_bin, '--detach-sign', '--no-permission-warning', '--batch',
+ '--no-tty', '--yes', '--passphrase-fd', '0', '-u', keyid]
+
+ if self.gpg_path:
+ cmd += ['--homedir', self.gpg_path]
+ if armor:
+ cmd += ['--armor']
+
+ #gpg > 2.1 supports password pipes only through the loopback interface
+ #gpg < 2.1 errors out if given unknown parameters
+ if self.gpg_version > (2,1,):
+ cmd += ['--pinentry-mode', 'loopback']
+
+ if self.gpg_agent_bin:
+ cmd += ["--agent-program=%s|--auto-expand-secmem" % (self.gpg_agent_bin)]
+
+ cmd += [input_file]
+
+ try:
+ if passphrase_file:
+ with open(passphrase_file) as fobj:
+ passphrase = fobj.readline();
+
+ job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ (_, stderr) = job.communicate(passphrase.encode("utf-8"))
+
+ if job.returncode:
+ raise bb.build.FuncFailed("GPG exited with code %d: %s" %
+ (job.returncode, stderr.decode("utf-8")))
+
+ except IOError as e:
+ bb.error("IO error (%s): %s" % (e.errno, e.strerror))
+ raise Exception("Failed to sign '%s'" % input_file)
+
+ except OSError as e:
+ bb.error("OS error (%s): %s" % (e.errno, e.strerror))
+ raise Exception("Failed to sign '%s" % input_file)
+
+
+ def get_gpg_version(self):
+ """Return the gpg version as a tuple of ints"""
+ import subprocess
+ try:
+ ver_str = subprocess.check_output((self.gpg_bin, "--version", "--no-permission-warning")).split()[2].decode("utf-8")
+ return tuple([int(i) for i in ver_str.split("-")[0].split('.')])
+ except subprocess.CalledProcessError as e:
+ raise bb.build.FuncFailed("Could not get gpg version: %s" % e)
+
+
+ def verify(self, sig_file):
+ """Verify signature"""
+ cmd = self.gpg_bin + " --verify --no-permission-warning "
+ if self.gpg_path:
+ cmd += "--homedir %s " % self.gpg_path
+ cmd += sig_file
+ status, _ = oe.utils.getstatusoutput(cmd)
+ ret = False if status else True
+ return ret
+
+
+def get_signer(d, backend):
+ """Get signer object for the specified backend"""
+ # Use local signing by default
+ if backend == 'local':
+ return LocalSigner(d)
+ else:
+ bb.fatal("Unsupported signing backend '%s'" % backend)
diff --git a/poky/meta/lib/oe/license.py b/poky/meta/lib/oe/license.py
new file mode 100644
index 000000000..ca385d518
--- /dev/null
+++ b/poky/meta/lib/oe/license.py
@@ -0,0 +1,243 @@
+# vi:sts=4:sw=4:et
+"""Code for parsing OpenEmbedded license strings"""
+
+import ast
+import re
+from fnmatch import fnmatchcase as fnmatch
+
+def license_ok(license, dont_want_licenses):
+ """ Return False if License exist in dont_want_licenses else True """
+ for dwl in dont_want_licenses:
+ # If you want to exclude license named generically 'X', we
+ # surely want to exclude 'X+' as well. In consequence, we
+ # will exclude a trailing '+' character from LICENSE in
+ # case INCOMPATIBLE_LICENSE is not a 'X+' license.
+ lic = license
+ if not re.search('\+$', dwl):
+ lic = re.sub('\+', '', license)
+ if fnmatch(lic, dwl):
+ return False
+ return True
+
+class LicenseError(Exception):
+ pass
+
+class LicenseSyntaxError(LicenseError):
+ def __init__(self, licensestr, exc):
+ self.licensestr = licensestr
+ self.exc = exc
+ LicenseError.__init__(self)
+
+ def __str__(self):
+ return "error in '%s': %s" % (self.licensestr, self.exc)
+
+class InvalidLicense(LicenseError):
+ def __init__(self, license):
+ self.license = license
+ LicenseError.__init__(self)
+
+ def __str__(self):
+ return "invalid characters in license '%s'" % self.license
+
+license_operator_chars = '&|() '
+license_operator = re.compile('([' + license_operator_chars + '])')
+license_pattern = re.compile('[a-zA-Z0-9.+_\-]+$')
+
+class LicenseVisitor(ast.NodeVisitor):
+ """Get elements based on OpenEmbedded license strings"""
+ def get_elements(self, licensestr):
+ new_elements = []
+ elements = list([x for x in license_operator.split(licensestr) if x.strip()])
+ for pos, element in enumerate(elements):
+ if license_pattern.match(element):
+ if pos > 0 and license_pattern.match(elements[pos-1]):
+ new_elements.append('&')
+ element = '"' + element + '"'
+ elif not license_operator.match(element):
+ raise InvalidLicense(element)
+ new_elements.append(element)
+
+ return new_elements
+
+ """Syntax tree visitor which can accept elements previously generated with
+ OpenEmbedded license string"""
+ def visit_elements(self, elements):
+ self.visit(ast.parse(' '.join(elements)))
+
+ """Syntax tree visitor which can accept OpenEmbedded license strings"""
+ def visit_string(self, licensestr):
+ self.visit_elements(self.get_elements(licensestr))
+
+class FlattenVisitor(LicenseVisitor):
+ """Flatten a license tree (parsed from a string) by selecting one of each
+ set of OR options, in the way the user specifies"""
+ def __init__(self, choose_licenses):
+ self.choose_licenses = choose_licenses
+ self.licenses = []
+ LicenseVisitor.__init__(self)
+
+ def visit_Str(self, node):
+ self.licenses.append(node.s)
+
+ def visit_BinOp(self, node):
+ if isinstance(node.op, ast.BitOr):
+ left = FlattenVisitor(self.choose_licenses)
+ left.visit(node.left)
+
+ right = FlattenVisitor(self.choose_licenses)
+ right.visit(node.right)
+
+ selected = self.choose_licenses(left.licenses, right.licenses)
+ self.licenses.extend(selected)
+ else:
+ self.generic_visit(node)
+
+def flattened_licenses(licensestr, choose_licenses):
+ """Given a license string and choose_licenses function, return a flat list of licenses"""
+ flatten = FlattenVisitor(choose_licenses)
+ try:
+ flatten.visit_string(licensestr)
+ except SyntaxError as exc:
+ raise LicenseSyntaxError(licensestr, exc)
+ return flatten.licenses
+
+def is_included(licensestr, whitelist=None, blacklist=None):
+ """Given a license string and whitelist and blacklist, determine if the
+ license string matches the whitelist and does not match the blacklist.
+
+ Returns a tuple holding the boolean state and a list of the applicable
+ licenses that were excluded if state is False, or the licenses that were
+ included if the state is True.
+ """
+
+ def include_license(license):
+ return any(fnmatch(license, pattern) for pattern in whitelist)
+
+ def exclude_license(license):
+ return any(fnmatch(license, pattern) for pattern in blacklist)
+
+ def choose_licenses(alpha, beta):
+ """Select the option in an OR which is the 'best' (has the most
+ included licenses and no excluded licenses)."""
+ # The factor 1000 below is arbitrary, just expected to be much larger
+ # that the number of licenses actually specified. That way the weight
+ # will be negative if the list of licenses contains an excluded license,
+ # but still gives a higher weight to the list with the most included
+ # licenses.
+ alpha_weight = (len(list(filter(include_license, alpha))) -
+ 1000 * (len(list(filter(exclude_license, alpha))) > 0))
+ beta_weight = (len(list(filter(include_license, beta))) -
+ 1000 * (len(list(filter(exclude_license, beta))) > 0))
+ if alpha_weight >= beta_weight:
+ return alpha
+ else:
+ return beta
+
+ if not whitelist:
+ whitelist = ['*']
+
+ if not blacklist:
+ blacklist = []
+
+ licenses = flattened_licenses(licensestr, choose_licenses)
+ excluded = [lic for lic in licenses if exclude_license(lic)]
+ included = [lic for lic in licenses if include_license(lic)]
+ if excluded:
+ return False, excluded
+ else:
+ return True, included
+
+class ManifestVisitor(LicenseVisitor):
+ """Walk license tree (parsed from a string) removing the incompatible
+ licenses specified"""
+ def __init__(self, dont_want_licenses, canonical_license, d):
+ self._dont_want_licenses = dont_want_licenses
+ self._canonical_license = canonical_license
+ self._d = d
+ self._operators = []
+
+ self.licenses = []
+ self.licensestr = ''
+
+ LicenseVisitor.__init__(self)
+
+ def visit(self, node):
+ if isinstance(node, ast.Str):
+ lic = node.s
+
+ if license_ok(self._canonical_license(self._d, lic),
+ self._dont_want_licenses) == True:
+ if self._operators:
+ ops = []
+ for op in self._operators:
+ if op == '[':
+ ops.append(op)
+ elif op == ']':
+ ops.append(op)
+ else:
+ if not ops:
+ ops.append(op)
+ elif ops[-1] in ['[', ']']:
+ ops.append(op)
+ else:
+ ops[-1] = op
+
+ for op in ops:
+ if op == '[' or op == ']':
+ self.licensestr += op
+ elif self.licenses:
+ self.licensestr += ' ' + op + ' '
+
+ self._operators = []
+
+ self.licensestr += lic
+ self.licenses.append(lic)
+ elif isinstance(node, ast.BitAnd):
+ self._operators.append("&")
+ elif isinstance(node, ast.BitOr):
+ self._operators.append("|")
+ elif isinstance(node, ast.List):
+ self._operators.append("[")
+ elif isinstance(node, ast.Load):
+ self.licensestr += "]"
+
+ self.generic_visit(node)
+
+def manifest_licenses(licensestr, dont_want_licenses, canonical_license, d):
+ """Given a license string and dont_want_licenses list,
+ return license string filtered and a list of licenses"""
+ manifest = ManifestVisitor(dont_want_licenses, canonical_license, d)
+
+ try:
+ elements = manifest.get_elements(licensestr)
+
+ # Replace '()' to '[]' for handle in ast as List and Load types.
+ elements = ['[' if e == '(' else e for e in elements]
+ elements = [']' if e == ')' else e for e in elements]
+
+ manifest.visit_elements(elements)
+ except SyntaxError as exc:
+ raise LicenseSyntaxError(licensestr, exc)
+
+ # Replace '[]' to '()' for output correct license.
+ manifest.licensestr = manifest.licensestr.replace('[', '(').replace(']', ')')
+
+ return (manifest.licensestr, manifest.licenses)
+
+class ListVisitor(LicenseVisitor):
+ """Record all different licenses found in the license string"""
+ def __init__(self):
+ self.licenses = set()
+
+ def visit_Str(self, node):
+ self.licenses.add(node.s)
+
+def list_licenses(licensestr):
+ """Simply get a list of all licenses mentioned in a license string.
+ Binary operators are not applied or taken into account in any way"""
+ visitor = ListVisitor()
+ try:
+ visitor.visit_string(licensestr)
+ except SyntaxError as exc:
+ raise LicenseSyntaxError(licensestr, exc)
+ return visitor.licenses
diff --git a/poky/meta/lib/oe/lsb.py b/poky/meta/lib/oe/lsb.py
new file mode 100644
index 000000000..71c0992c5
--- /dev/null
+++ b/poky/meta/lib/oe/lsb.py
@@ -0,0 +1,117 @@
+def get_os_release():
+ """Get all key-value pairs from /etc/os-release as a dict"""
+ from collections import OrderedDict
+
+ data = OrderedDict()
+ if os.path.exists('/etc/os-release'):
+ with open('/etc/os-release') as f:
+ for line in f:
+ try:
+ key, val = line.rstrip().split('=', 1)
+ except ValueError:
+ continue
+ data[key.strip()] = val.strip('"')
+ return data
+
+def release_dict_osr():
+ """ Populate a dict with pertinent values from /etc/os-release """
+ data = {}
+ os_release = get_os_release()
+ if 'ID' in os_release:
+ data['DISTRIB_ID'] = os_release['ID']
+ if 'VERSION_ID' in os_release:
+ data['DISTRIB_RELEASE'] = os_release['VERSION_ID']
+
+ return data
+
+def release_dict_lsb():
+ """ Return the output of lsb_release -ir as a dictionary """
+ from subprocess import PIPE
+
+ try:
+ output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE)
+ except bb.process.CmdError as exc:
+ return {}
+
+ lsb_map = { 'Distributor ID': 'DISTRIB_ID',
+ 'Release': 'DISTRIB_RELEASE'}
+ lsb_keys = lsb_map.keys()
+
+ data = {}
+ for line in output.splitlines():
+ if line.startswith("-e"):
+ line = line[3:]
+ try:
+ key, value = line.split(":\t", 1)
+ except ValueError:
+ continue
+ if key in lsb_keys:
+ data[lsb_map[key]] = value
+
+ if len(data.keys()) != 2:
+ return None
+
+ return data
+
+def release_dict_file():
+ """ Try to gather release information manually when other methods fail """
+ data = {}
+ try:
+ if os.path.exists('/etc/lsb-release'):
+ data = {}
+ with open('/etc/lsb-release') as f:
+ for line in f:
+ key, value = line.split("=", 1)
+ data[key] = value.strip()
+ elif os.path.exists('/etc/redhat-release'):
+ data = {}
+ with open('/etc/redhat-release') as f:
+ distro = f.readline().strip()
+ import re
+ match = re.match(r'(.*) release (.*) \((.*)\)', distro)
+ if match:
+ data['DISTRIB_ID'] = match.group(1)
+ data['DISTRIB_RELEASE'] = match.group(2)
+ elif os.path.exists('/etc/SuSE-release'):
+ data = {}
+ data['DISTRIB_ID'] = 'SUSE LINUX'
+ with open('/etc/SuSE-release') as f:
+ for line in f:
+ if line.startswith('VERSION = '):
+ data['DISTRIB_RELEASE'] = line[10:].rstrip()
+ break
+
+ except IOError:
+ return {}
+ return data
+
+def distro_identifier(adjust_hook=None):
+ """Return a distro identifier string based upon lsb_release -ri,
+ with optional adjustment via a hook"""
+
+ import re
+
+ # Try /etc/os-release first, then the output of `lsb_release -ir` and
+ # finally fall back on parsing various release files in order to determine
+ # host distro name and version.
+ distro_data = release_dict_osr()
+ if not distro_data:
+ distro_data = release_dict_lsb()
+ if not distro_data:
+ distro_data = release_dict_file()
+
+ distro_id = distro_data.get('DISTRIB_ID', '')
+ release = distro_data.get('DISTRIB_RELEASE', '')
+
+ if adjust_hook:
+ distro_id, release = adjust_hook(distro_id, release)
+ if not distro_id:
+ return "Unknown"
+ # Filter out any non-alphanumerics
+ distro_id = re.sub(r'\W', '', distro_id)
+
+ if release:
+ id_str = '{0}-{1}'.format(distro_id.lower(), release)
+ else:
+ id_str = distro_id
+ return id_str.replace(' ','-').replace('/','-')
diff --git a/poky/meta/lib/oe/maketype.py b/poky/meta/lib/oe/maketype.py
new file mode 100644
index 000000000..f88981dd9
--- /dev/null
+++ b/poky/meta/lib/oe/maketype.py
@@ -0,0 +1,102 @@
+"""OpenEmbedded variable typing support
+
+Types are defined in the metadata by name, using the 'type' flag on a
+variable. Other flags may be utilized in the construction of the types. See
+the arguments of the type's factory for details.
+"""
+
+import inspect
+import oe.types as types
+import collections
+
+available_types = {}
+
+class MissingFlag(TypeError):
+ """A particular flag is required to construct the type, but has not been
+ provided."""
+ def __init__(self, flag, type):
+ self.flag = flag
+ self.type = type
+ TypeError.__init__(self)
+
+ def __str__(self):
+ return "Type '%s' requires flag '%s'" % (self.type, self.flag)
+
+def factory(var_type):
+ """Return the factory for a specified type."""
+ if var_type is None:
+ raise TypeError("No type specified. Valid types: %s" %
+ ', '.join(available_types))
+ try:
+ return available_types[var_type]
+ except KeyError:
+ raise TypeError("Invalid type '%s':\n Valid types: %s" %
+ (var_type, ', '.join(available_types)))
+
+def create(value, var_type, **flags):
+ """Create an object of the specified type, given the specified flags and
+ string value."""
+ obj = factory(var_type)
+ objflags = {}
+ for flag in obj.flags:
+ if flag not in flags:
+ if flag not in obj.optflags:
+ raise MissingFlag(flag, var_type)
+ else:
+ objflags[flag] = flags[flag]
+
+ return obj(value, **objflags)
+
+def get_callable_args(obj):
+ """Grab all but the first argument of the specified callable, returning
+ the list, as well as a list of which of the arguments have default
+ values."""
+ if type(obj) is type:
+ obj = obj.__init__
+
+ sig = inspect.signature(obj)
+ args = list(sig.parameters.keys())
+ defaults = list(s for s in sig.parameters.keys() if sig.parameters[s].default != inspect.Parameter.empty)
+ flaglist = []
+ if args:
+ if len(args) > 1 and args[0] == 'self':
+ args = args[1:]
+ flaglist.extend(args)
+
+ optional = set()
+ if defaults:
+ optional |= set(flaglist[-len(defaults):])
+ return flaglist, optional
+
+def factory_setup(name, obj):
+ """Prepare a factory for use."""
+ args, optional = get_callable_args(obj)
+ extra_args = args[1:]
+ if extra_args:
+ obj.flags, optional = extra_args, optional
+ obj.optflags = set(optional)
+ else:
+ obj.flags = obj.optflags = ()
+
+ if not hasattr(obj, 'name'):
+ obj.name = name
+
+def register(name, factory):
+ """Register a type, given its name and a factory callable.
+
+ Determines the required and optional flags from the factory's
+ arguments."""
+ factory_setup(name, factory)
+ available_types[factory.name] = factory
+
+
+# Register all our included types
+for name in dir(types):
+ if name.startswith('_'):
+ continue
+
+ obj = getattr(types, name)
+ if not isinstance(obj, collections.Callable):
+ continue
+
+ register(name, obj)
diff --git a/poky/meta/lib/oe/manifest.py b/poky/meta/lib/oe/manifest.py
new file mode 100644
index 000000000..674303c86
--- /dev/null
+++ b/poky/meta/lib/oe/manifest.py
@@ -0,0 +1,344 @@
+from abc import ABCMeta, abstractmethod
+import os
+import re
+import bb
+
+
+class Manifest(object, metaclass=ABCMeta):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+
+ PKG_TYPE_MUST_INSTALL = "mip"
+ PKG_TYPE_MULTILIB = "mlp"
+ PKG_TYPE_LANGUAGE = "lgp"
+ PKG_TYPE_ATTEMPT_ONLY = "aop"
+
+ MANIFEST_TYPE_IMAGE = "image"
+ MANIFEST_TYPE_SDK_HOST = "sdk_host"
+ MANIFEST_TYPE_SDK_TARGET = "sdk_target"
+
+ var_maps = {
+ MANIFEST_TYPE_IMAGE: {
+ "PACKAGE_INSTALL": PKG_TYPE_MUST_INSTALL,
+ "PACKAGE_INSTALL_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY,
+ "LINGUAS_INSTALL": PKG_TYPE_LANGUAGE
+ },
+ MANIFEST_TYPE_SDK_HOST: {
+ "TOOLCHAIN_HOST_TASK": PKG_TYPE_MUST_INSTALL,
+ "TOOLCHAIN_HOST_TASK_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY
+ },
+ MANIFEST_TYPE_SDK_TARGET: {
+ "TOOLCHAIN_TARGET_TASK": PKG_TYPE_MUST_INSTALL,
+ "TOOLCHAIN_TARGET_TASK_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY
+ }
+ }
+
+ INSTALL_ORDER = [
+ PKG_TYPE_LANGUAGE,
+ PKG_TYPE_MUST_INSTALL,
+ PKG_TYPE_ATTEMPT_ONLY,
+ PKG_TYPE_MULTILIB
+ ]
+
+ initial_manifest_file_header = \
+ "# This file was generated automatically and contains the packages\n" \
+ "# passed on to the package manager in order to create the rootfs.\n\n" \
+ "# Format:\n" \
+ "# <package_type>,<package_name>\n" \
+ "# where:\n" \
+ "# <package_type> can be:\n" \
+ "# 'mip' = must install package\n" \
+ "# 'aop' = attempt only package\n" \
+ "# 'mlp' = multilib package\n" \
+ "# 'lgp' = language package\n\n"
+
+ def __init__(self, d, manifest_dir=None, manifest_type=MANIFEST_TYPE_IMAGE):
+ self.d = d
+ self.manifest_type = manifest_type
+
+ if manifest_dir is None:
+ if manifest_type != self.MANIFEST_TYPE_IMAGE:
+ self.manifest_dir = self.d.getVar('SDK_DIR')
+ else:
+ self.manifest_dir = self.d.getVar('WORKDIR')
+ else:
+ self.manifest_dir = manifest_dir
+
+ bb.utils.mkdirhier(self.manifest_dir)
+
+ self.initial_manifest = os.path.join(self.manifest_dir, "%s_initial_manifest" % manifest_type)
+ self.final_manifest = os.path.join(self.manifest_dir, "%s_final_manifest" % manifest_type)
+ self.full_manifest = os.path.join(self.manifest_dir, "%s_full_manifest" % manifest_type)
+
+ # packages in the following vars will be split in 'must install' and
+ # 'multilib'
+ self.vars_to_split = ["PACKAGE_INSTALL",
+ "TOOLCHAIN_HOST_TASK",
+ "TOOLCHAIN_TARGET_TASK"]
+
+ """
+ This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk).
+ This will be used for testing until the class is implemented properly!
+ """
+ def _create_dummy_initial(self):
+ image_rootfs = self.d.getVar('IMAGE_ROOTFS')
+ pkg_list = dict()
+ if image_rootfs.find("core-image-sato-sdk") > 0:
+ pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
+ "packagegroup-core-x11-sato-games packagegroup-base-extended " \
+ "packagegroup-core-x11-sato packagegroup-core-x11-base " \
+ "packagegroup-core-sdk packagegroup-core-tools-debug " \
+ "packagegroup-core-boot packagegroup-core-tools-testapps " \
+ "packagegroup-core-eclipse-debug packagegroup-core-qt-demoapps " \
+ "apt packagegroup-core-tools-profile psplash " \
+ "packagegroup-core-standalone-sdk-target " \
+ "packagegroup-core-ssh-openssh dpkg kernel-dev"
+ pkg_list[self.PKG_TYPE_LANGUAGE] = \
+ "locale-base-en-us locale-base-en-gb"
+ elif image_rootfs.find("core-image-sato") > 0:
+ pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
+ "packagegroup-core-ssh-dropbear packagegroup-core-x11-sato-games " \
+ "packagegroup-core-x11-base psplash apt dpkg packagegroup-base-extended " \
+ "packagegroup-core-x11-sato packagegroup-core-boot"
+ pkg_list['lgp'] = \
+ "locale-base-en-us locale-base-en-gb"
+ elif image_rootfs.find("core-image-minimal") > 0:
+ pkg_list[self.PKG_TYPE_MUST_INSTALL] = "packagegroup-core-boot"
+
+ with open(self.initial_manifest, "w+") as manifest:
+ manifest.write(self.initial_manifest_file_header)
+
+ for pkg_type in pkg_list:
+ for pkg in pkg_list[pkg_type].split():
+ manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+ """
+ This will create the initial manifest which will be used by Rootfs class to
+ generate the rootfs
+ """
+ @abstractmethod
+ def create_initial(self):
+ pass
+
+ """
+ This creates the manifest after everything has been installed.
+ """
+ @abstractmethod
+ def create_final(self):
+ pass
+
+ """
+ This creates the manifest after the package in initial manifest has been
+ dummy installed. It lists all *to be installed* packages. There is no real
+ installation, just a test.
+ """
+ @abstractmethod
+ def create_full(self, pm):
+ pass
+
+ """
+ The following function parses an initial manifest and returns a dictionary
+ object with the must install, attempt only, multilib and language packages.
+ """
+ def parse_initial_manifest(self):
+ pkgs = dict()
+
+ with open(self.initial_manifest) as manifest:
+ for line in manifest.read().split('\n'):
+ comment = re.match("^#.*", line)
+ pattern = "^(%s|%s|%s|%s),(.*)$" % \
+ (self.PKG_TYPE_MUST_INSTALL,
+ self.PKG_TYPE_ATTEMPT_ONLY,
+ self.PKG_TYPE_MULTILIB,
+ self.PKG_TYPE_LANGUAGE)
+ pkg = re.match(pattern, line)
+
+ if comment is not None:
+ continue
+
+ if pkg is not None:
+ pkg_type = pkg.group(1)
+ pkg_name = pkg.group(2)
+
+ if not pkg_type in pkgs:
+ pkgs[pkg_type] = [pkg_name]
+ else:
+ pkgs[pkg_type].append(pkg_name)
+
+ return pkgs
+
+ '''
+ This following function parses a full manifest and return a list
+ object with packages.
+ '''
+ def parse_full_manifest(self):
+ installed_pkgs = list()
+ if not os.path.exists(self.full_manifest):
+ bb.note('full manifest not exist')
+ return installed_pkgs
+
+ with open(self.full_manifest, 'r') as manifest:
+ for pkg in manifest.read().split('\n'):
+ installed_pkgs.append(pkg.strip())
+
+ return installed_pkgs
+
+
+class RpmManifest(Manifest):
+ """
+ Returns a dictionary object with mip and mlp packages.
+ """
+ def _split_multilib(self, pkg_list):
+ pkgs = dict()
+
+ for pkg in pkg_list.split():
+ pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+ for ml_variant in ml_variants:
+ if pkg.startswith(ml_variant + '-'):
+ pkg_type = self.PKG_TYPE_MULTILIB
+
+ if not pkg_type in pkgs:
+ pkgs[pkg_type] = pkg
+ else:
+ pkgs[pkg_type] += " " + pkg
+
+ return pkgs
+
+ def create_initial(self):
+ pkgs = dict()
+
+ with open(self.initial_manifest, "w+") as manifest:
+ manifest.write(self.initial_manifest_file_header)
+
+ for var in self.var_maps[self.manifest_type]:
+ if var in self.vars_to_split:
+ split_pkgs = self._split_multilib(self.d.getVar(var))
+ if split_pkgs is not None:
+ pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
+ else:
+ pkg_list = self.d.getVar(var)
+ if pkg_list is not None:
+ pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
+
+ for pkg_type in pkgs:
+ for pkg in pkgs[pkg_type].split():
+ manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+ def create_final(self):
+ pass
+
+ def create_full(self, pm):
+ pass
+
+
+class OpkgManifest(Manifest):
+ """
+ Returns a dictionary object with mip and mlp packages.
+ """
+ def _split_multilib(self, pkg_list):
+ pkgs = dict()
+
+ for pkg in pkg_list.split():
+ pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+ ml_variants = self.d.getVar('MULTILIB_VARIANTS').split()
+
+ for ml_variant in ml_variants:
+ if pkg.startswith(ml_variant + '-'):
+ pkg_type = self.PKG_TYPE_MULTILIB
+
+ if not pkg_type in pkgs:
+ pkgs[pkg_type] = pkg
+ else:
+ pkgs[pkg_type] += " " + pkg
+
+ return pkgs
+
+ def create_initial(self):
+ pkgs = dict()
+
+ with open(self.initial_manifest, "w+") as manifest:
+ manifest.write(self.initial_manifest_file_header)
+
+ for var in self.var_maps[self.manifest_type]:
+ if var in self.vars_to_split:
+ split_pkgs = self._split_multilib(self.d.getVar(var))
+ if split_pkgs is not None:
+ pkgs = dict(list(pkgs.items()) + list(split_pkgs.items()))
+ else:
+ pkg_list = self.d.getVar(var)
+ if pkg_list is not None:
+ pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var)
+
+ for pkg_type in sorted(pkgs):
+ for pkg in sorted(pkgs[pkg_type].split()):
+ manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+ def create_final(self):
+ pass
+
+ def create_full(self, pm):
+ if not os.path.exists(self.initial_manifest):
+ self.create_initial()
+
+ initial_manifest = self.parse_initial_manifest()
+ pkgs_to_install = list()
+ for pkg_type in initial_manifest:
+ pkgs_to_install += initial_manifest[pkg_type]
+ if len(pkgs_to_install) == 0:
+ return
+
+ output = pm.dummy_install(pkgs_to_install)
+
+ with open(self.full_manifest, 'w+') as manifest:
+ pkg_re = re.compile('^Installing ([^ ]+) [^ ].*')
+ for line in set(output.split('\n')):
+ m = pkg_re.match(line)
+ if m:
+ manifest.write(m.group(1) + '\n')
+
+ return
+
+
+class DpkgManifest(Manifest):
+ def create_initial(self):
+ with open(self.initial_manifest, "w+") as manifest:
+ manifest.write(self.initial_manifest_file_header)
+
+ for var in self.var_maps[self.manifest_type]:
+ pkg_list = self.d.getVar(var)
+
+ if pkg_list is None:
+ continue
+
+ for pkg in pkg_list.split():
+ manifest.write("%s,%s\n" %
+ (self.var_maps[self.manifest_type][var], pkg))
+
+ def create_final(self):
+ pass
+
+ def create_full(self, pm):
+ pass
+
+
+def create_manifest(d, final_manifest=False, manifest_dir=None,
+ manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
+ manifest_map = {'rpm': RpmManifest,
+ 'ipk': OpkgManifest,
+ 'deb': DpkgManifest}
+
+ manifest = manifest_map[d.getVar('IMAGE_PKGTYPE')](d, manifest_dir, manifest_type)
+
+ if final_manifest:
+ manifest.create_final()
+ else:
+ manifest.create_initial()
+
+
+if __name__ == "__main__":
+ pass
diff --git a/poky/meta/lib/oe/package.py b/poky/meta/lib/oe/package.py
new file mode 100644
index 000000000..4f3e21ad4
--- /dev/null
+++ b/poky/meta/lib/oe/package.py
@@ -0,0 +1,294 @@
+def runstrip(arg):
+ # Function to strip a single file, called from split_and_strip_files below
+ # A working 'file' (one which works on the target architecture)
+ #
+ # The elftype is a bit pattern (explained in split_and_strip_files) to tell
+ # us what type of file we're processing...
+ # 4 - executable
+ # 8 - shared library
+ # 16 - kernel module
+
+ import stat, subprocess
+
+ (file, elftype, strip) = arg
+
+ newmode = None
+ if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
+ origmode = os.stat(file)[stat.ST_MODE]
+ newmode = origmode | stat.S_IWRITE | stat.S_IREAD
+ os.chmod(file, newmode)
+
+ stripcmd = [strip]
+
+ # kernel module
+ if elftype & 16:
+ stripcmd.extend(["--strip-debug", "--remove-section=.comment",
+ "--remove-section=.note", "--preserve-dates"])
+ # .so and shared library
+ elif ".so" in file and elftype & 8:
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"])
+ # shared or executable:
+ elif elftype & 8 or elftype & 4:
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"])
+
+ stripcmd.append(file)
+ bb.debug(1, "runstrip: %s" % stripcmd)
+
+ try:
+ output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
+
+ if newmode:
+ os.chmod(file, origmode)
+
+ return
+
+
+def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, qa_already_stripped=False):
+ """
+ Strip executable code (like executables, shared libraries) _in_place_
+ - Based on sysroot_strip in staging.bbclass
+ :param dstdir: directory in which to strip files
+ :param strip_cmd: Strip command (usually ${STRIP})
+ :param libdir: ${libdir} - strip .so files in this directory
+ :param base_libdir: ${base_libdir} - strip .so files in this directory
+ :param qa_already_stripped: Set to True if already-stripped' in ${INSANE_SKIP}
+ This is for proper logging and messages only.
+ """
+ import stat, errno, oe.path, oe.utils, mmap
+
+ # Detect .ko module by searching for "vermagic=" string
+ def is_kernel_module(path):
+ with open(path) as f:
+ return mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ).find(b"vermagic=") >= 0
+
+ # Return type (bits):
+ # 0 - not elf
+ # 1 - ELF
+ # 2 - stripped
+ # 4 - executable
+ # 8 - shared library
+ # 16 - kernel module
+ def is_elf(path):
+ exec_type = 0
+ ret, result = oe.utils.getstatusoutput("file -b '%s'" % path)
+
+ if ret:
+ bb.error("split_and_strip_files: 'file %s' failed" % path)
+ return exec_type
+
+ if "ELF" in result:
+ exec_type |= 1
+ if "not stripped" not in result:
+ exec_type |= 2
+ if "executable" in result:
+ exec_type |= 4
+ if "shared" in result:
+ exec_type |= 8
+ if "relocatable" in result and is_kernel_module(path):
+ exec_type |= 16
+ return exec_type
+
+ elffiles = {}
+ inodes = {}
+ libdir = os.path.abspath(dstdir + os.sep + libdir)
+ base_libdir = os.path.abspath(dstdir + os.sep + base_libdir)
+ exec_mask = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
+ #
+ # First lets figure out all of the files we may have to process
+ #
+ for root, dirs, files in os.walk(dstdir):
+ for f in files:
+ file = os.path.join(root, f)
+
+ try:
+ ltarget = oe.path.realpath(file, dstdir, False)
+ s = os.lstat(ltarget)
+ except OSError as e:
+ (err, strerror) = e.args
+ if err != errno.ENOENT:
+ raise
+ # Skip broken symlinks
+ continue
+ if not s:
+ continue
+ # Check its an excutable
+ if s[stat.ST_MODE] & exec_mask \
+ or ((file.startswith(libdir) or file.startswith(base_libdir)) and ".so" in f) \
+ or file.endswith('.ko'):
+ # If it's a symlink, and points to an ELF file, we capture the readlink target
+ if os.path.islink(file):
+ continue
+
+ # It's a file (or hardlink), not a link
+ # ...but is it ELF, and is it already stripped?
+ elf_file = is_elf(file)
+ if elf_file & 1:
+ if elf_file & 2:
+ if qa_already_stripped:
+ bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dstdir):], pn))
+ else:
+ bb.warn("File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dstdir):], pn))
+ continue
+
+ if s.st_ino in inodes:
+ os.unlink(file)
+ os.link(inodes[s.st_ino], file)
+ else:
+ # break hardlinks so that we do not strip the original.
+ inodes[s.st_ino] = file
+ bb.utils.copyfile(file, file)
+ elffiles[file] = elf_file
+
+ #
+ # Now strip them (in parallel)
+ #
+ sfiles = []
+ for file in elffiles:
+ elf_file = int(elffiles[file])
+ sfiles.append((file, elf_file, strip_cmd))
+
+ oe.utils.multiprocess_exec(sfiles, runstrip)
+
+
+
+def file_translate(file):
+ ft = file.replace("@", "@at@")
+ ft = ft.replace(" ", "@space@")
+ ft = ft.replace("\t", "@tab@")
+ ft = ft.replace("[", "@openbrace@")
+ ft = ft.replace("]", "@closebrace@")
+ ft = ft.replace("_", "@underscore@")
+ return ft
+
+def filedeprunner(arg):
+ import re, subprocess, shlex
+
+ (pkg, pkgfiles, rpmdeps, pkgdest) = arg
+ provides = {}
+ requires = {}
+
+ file_re = re.compile(r'\s+\d+\s(.*)')
+ dep_re = re.compile(r'\s+(\S)\s+(.*)')
+ r = re.compile(r'[<>=]+\s+\S*')
+
+ def process_deps(pipe, pkg, pkgdest, provides, requires):
+ file = None
+ for line in pipe.split("\n"):
+
+ m = file_re.match(line)
+ if m:
+ file = m.group(1)
+ file = file.replace(pkgdest + "/" + pkg, "")
+ file = file_translate(file)
+ continue
+
+ m = dep_re.match(line)
+ if not m or not file:
+ continue
+
+ type, dep = m.groups()
+
+ if type == 'R':
+ i = requires
+ elif type == 'P':
+ i = provides
+ else:
+ continue
+
+ if dep.startswith("python("):
+ continue
+
+ # Ignore all perl(VMS::...) and perl(Mac::...) dependencies. These
+ # are typically used conditionally from the Perl code, but are
+ # generated as unconditional dependencies.
+ if dep.startswith('perl(VMS::') or dep.startswith('perl(Mac::'):
+ continue
+
+ # Ignore perl dependencies on .pl files.
+ if dep.startswith('perl(') and dep.endswith('.pl)'):
+ continue
+
+ # Remove perl versions and perl module versions since they typically
+ # do not make sense when used as package versions.
+ if dep.startswith('perl') and r.search(dep):
+ dep = dep.split()[0]
+
+ # Put parentheses around any version specifications.
+ dep = r.sub(r'(\g<0>)',dep)
+
+ if file not in i:
+ i[file] = []
+ i[file].append(dep)
+
+ return provides, requires
+
+ output = subprocess.check_output(shlex.split(rpmdeps) + pkgfiles, stderr=subprocess.STDOUT).decode("utf-8")
+ provides, requires = process_deps(output, pkg, pkgdest, provides, requires)
+
+ return (pkg, provides, requires)
+
+
+def read_shlib_providers(d):
+ import re
+
+ shlib_provider = {}
+ shlibs_dirs = d.getVar('SHLIBSDIRS').split()
+ list_re = re.compile('^(.*)\.list$')
+ # Go from least to most specific since the last one found wins
+ for dir in reversed(shlibs_dirs):
+ bb.debug(2, "Reading shlib providers in %s" % (dir))
+ if not os.path.exists(dir):
+ continue
+ for file in os.listdir(dir):
+ m = list_re.match(file)
+ if m:
+ dep_pkg = m.group(1)
+ try:
+ fd = open(os.path.join(dir, file))
+ except IOError:
+ # During a build unrelated shlib files may be deleted, so
+ # handle files disappearing between the listdirs and open.
+ continue
+ lines = fd.readlines()
+ fd.close()
+ for l in lines:
+ s = l.strip().split(":")
+ if s[0] not in shlib_provider:
+ shlib_provider[s[0]] = {}
+ shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
+ return shlib_provider
+
+
+def npm_split_package_dirs(pkgdir):
+ """
+ Work out the packages fetched and unpacked by BitBake's npm fetcher
+ Returns a dict of packagename -> (relpath, package.json) ordered
+ such that it is suitable for use in PACKAGES and FILES
+ """
+ from collections import OrderedDict
+ import json
+ packages = {}
+ for root, dirs, files in os.walk(pkgdir):
+ if os.path.basename(root) == 'node_modules':
+ for dn in dirs:
+ relpth = os.path.relpath(os.path.join(root, dn), pkgdir)
+ pkgitems = ['${PN}']
+ for pathitem in relpth.split('/'):
+ if pathitem == 'node_modules':
+ continue
+ pkgitems.append(pathitem)
+ pkgname = '-'.join(pkgitems).replace('_', '-')
+ pkgname = pkgname.replace('@', '')
+ pkgfile = os.path.join(root, dn, 'package.json')
+ data = None
+ if os.path.exists(pkgfile):
+ with open(pkgfile, 'r') as f:
+ data = json.loads(f.read())
+ packages[pkgname] = (relpth, data)
+ # We want the main package for a module sorted *after* its subpackages
+ # (so that it doesn't otherwise steal the files for the subpackage), so
+ # this is a cheap way to do that whilst still having an otherwise
+ # alphabetical sort
+ return OrderedDict((key, packages[key]) for key in sorted(packages, key=lambda pkg: pkg + '~'))
diff --git a/poky/meta/lib/oe/package_manager.py b/poky/meta/lib/oe/package_manager.py
new file mode 100644
index 000000000..2d8aeba03
--- /dev/null
+++ b/poky/meta/lib/oe/package_manager.py
@@ -0,0 +1,1787 @@
+from abc import ABCMeta, abstractmethod
+import os
+import glob
+import subprocess
+import shutil
+import multiprocessing
+import re
+import collections
+import bb
+import tempfile
+import oe.utils
+import oe.path
+import string
+from oe.gpg_sign import get_signer
+import hashlib
+
+# this can be used by all PM backends to create the index files in parallel
+def create_index(arg):
+ index_cmd = arg
+
+ bb.note("Executing '%s' ..." % index_cmd)
+ result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
+ if result:
+ bb.note(result)
+
+def opkg_query(cmd_output):
+ """
+ This method parse the output from the package managerand return
+ a dictionary with the information of the packages. This is used
+ when the packages are in deb or ipk format.
+ """
+ verregex = re.compile(' \([=<>]* [^ )]*\)')
+ output = dict()
+ pkg = ""
+ arch = ""
+ ver = ""
+ filename = ""
+ dep = []
+ pkgarch = ""
+ for line in cmd_output.splitlines():
+ line = line.rstrip()
+ if ':' in line:
+ if line.startswith("Package: "):
+ pkg = line.split(": ")[1]
+ elif line.startswith("Architecture: "):
+ arch = line.split(": ")[1]
+ elif line.startswith("Version: "):
+ ver = line.split(": ")[1]
+ elif line.startswith("File: ") or line.startswith("Filename:"):
+ filename = line.split(": ")[1]
+ if "/" in filename:
+ filename = os.path.basename(filename)
+ elif line.startswith("Depends: "):
+ depends = verregex.sub('', line.split(": ")[1])
+ for depend in depends.split(", "):
+ dep.append(depend)
+ elif line.startswith("Recommends: "):
+ recommends = verregex.sub('', line.split(": ")[1])
+ for recommend in recommends.split(", "):
+ dep.append("%s [REC]" % recommend)
+ elif line.startswith("PackageArch: "):
+ pkgarch = line.split(": ")[1]
+
+ # When there is a blank line save the package information
+ elif not line:
+ # IPK doesn't include the filename
+ if not filename:
+ filename = "%s_%s_%s.ipk" % (pkg, ver, arch)
+ if pkg:
+ output[pkg] = {"arch":arch, "ver":ver,
+ "filename":filename, "deps": dep, "pkgarch":pkgarch }
+ pkg = ""
+ arch = ""
+ ver = ""
+ filename = ""
+ dep = []
+ pkgarch = ""
+
+ if pkg:
+ if not filename:
+ filename = "%s_%s_%s.ipk" % (pkg, ver, arch)
+ output[pkg] = {"arch":arch, "ver":ver,
+ "filename":filename, "deps": dep }
+
+ return output
+
+# Note: this should be bb.fatal in the future.
+def failed_postinsts_warn(pkgs, log_path):
+ bb.warn("""Intentionally failing postinstall scriptlets of %s to defer them to first boot is deprecated. Please place them into pkg_postinst_ontarget_${PN} ().
+If deferring to first boot wasn't the intent, then scriptlet failure may mean an issue in the recipe, or a regression elsewhere.
+Details of the failure are in %s.""" %(pkgs, log_path))
+
+class Indexer(object, metaclass=ABCMeta):
+ def __init__(self, d, deploy_dir):
+ self.d = d
+ self.deploy_dir = deploy_dir
+
+ @abstractmethod
+ def write_index(self):
+ pass
+
+
+class RpmIndexer(Indexer):
+ def write_index(self):
+ self.do_write_index(self.deploy_dir)
+
+ def do_write_index(self, deploy_dir):
+ if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+ signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+ else:
+ signer = None
+
+ createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
+ result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
+ if result:
+ bb.fatal(result)
+
+ # Sign repomd
+ if signer:
+ sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
+ is_ascii_sig = (sig_type.upper() != "BIN")
+ signer.detach_sign(os.path.join(deploy_dir, 'repodata', 'repomd.xml'),
+ self.d.getVar('PACKAGE_FEED_GPG_NAME'),
+ self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
+ armor=is_ascii_sig)
+
+class RpmSubdirIndexer(RpmIndexer):
+ def write_index(self):
+ bb.note("Generating package index for %s" %(self.deploy_dir))
+ self.do_write_index(self.deploy_dir)
+ for entry in os.walk(self.deploy_dir):
+ if os.path.samefile(self.deploy_dir, entry[0]):
+ for dir in entry[1]:
+ if dir != 'repodata':
+ dir_path = oe.path.join(self.deploy_dir, dir)
+ bb.note("Generating package index for %s" %(dir_path))
+ self.do_write_index(dir_path)
+
+class OpkgIndexer(Indexer):
+ def write_index(self):
+ arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
+ "SDK_PACKAGE_ARCHS",
+ ]
+
+ opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
+ if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+ signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+ else:
+ signer = None
+
+ if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
+ open(os.path.join(self.deploy_dir, "Packages"), "w").close()
+
+ index_cmds = set()
+ index_sign_files = set()
+ for arch_var in arch_vars:
+ archs = self.d.getVar(arch_var)
+ if archs is None:
+ continue
+
+ for arch in archs.split():
+ pkgs_dir = os.path.join(self.deploy_dir, arch)
+ pkgs_file = os.path.join(pkgs_dir, "Packages")
+
+ if not os.path.isdir(pkgs_dir):
+ continue
+
+ if not os.path.exists(pkgs_file):
+ open(pkgs_file, "w").close()
+
+ index_cmds.add('%s -r %s -p %s -m %s' %
+ (opkg_index_cmd, pkgs_file, pkgs_file, pkgs_dir))
+
+ index_sign_files.add(pkgs_file)
+
+ if len(index_cmds) == 0:
+ bb.note("There are no packages in %s!" % self.deploy_dir)
+ return
+
+ oe.utils.multiprocess_exec(index_cmds, create_index)
+
+ if signer:
+ feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
+ is_ascii_sig = (feed_sig_type.upper() != "BIN")
+ for f in index_sign_files:
+ signer.detach_sign(f,
+ self.d.getVar('PACKAGE_FEED_GPG_NAME'),
+ self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
+ armor=is_ascii_sig)
+
+
+class DpkgIndexer(Indexer):
+ def _create_configs(self):
+ bb.utils.mkdirhier(self.apt_conf_dir)
+ bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial"))
+ bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d"))
+ bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d"))
+
+ with open(os.path.join(self.apt_conf_dir, "preferences"),
+ "w") as prefs_file:
+ pass
+ with open(os.path.join(self.apt_conf_dir, "sources.list"),
+ "w+") as sources_file:
+ pass
+
+ with open(self.apt_conf_file, "w") as apt_conf:
+ with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"),
+ "apt", "apt.conf.sample")) as apt_conf_sample:
+ for line in apt_conf_sample.read().split("\n"):
+ line = re.sub("#ROOTFS#", "/dev/null", line)
+ line = re.sub("#APTCONF#", self.apt_conf_dir, line)
+ apt_conf.write(line + "\n")
+
+ def write_index(self):
+ self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"),
+ "apt-ftparchive")
+ self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
+ self._create_configs()
+
+ os.environ['APT_CONFIG'] = self.apt_conf_file
+
+ pkg_archs = self.d.getVar('PACKAGE_ARCHS')
+ if pkg_archs is not None:
+ arch_list = pkg_archs.split()
+ sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS')
+ if sdk_pkg_archs is not None:
+ for a in sdk_pkg_archs.split():
+ if a not in pkg_archs:
+ arch_list.append(a)
+
+ all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split()
+ arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list)
+
+ apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
+ gzip = bb.utils.which(os.getenv('PATH'), "gzip")
+
+ index_cmds = []
+ deb_dirs_found = False
+ for arch in arch_list:
+ arch_dir = os.path.join(self.deploy_dir, arch)
+ if not os.path.isdir(arch_dir):
+ continue
+
+ cmd = "cd %s; PSEUDO_UNLOAD=1 %s packages . > Packages;" % (arch_dir, apt_ftparchive)
+
+ cmd += "%s -fcn Packages > Packages.gz;" % gzip
+
+ with open(os.path.join(arch_dir, "Release"), "w+") as release:
+ release.write("Label: %s\n" % arch)
+
+ cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
+
+ index_cmds.append(cmd)
+
+ deb_dirs_found = True
+
+ if not deb_dirs_found:
+ bb.note("There are no packages in %s" % self.deploy_dir)
+ return
+
+ oe.utils.multiprocess_exec(index_cmds, create_index)
+ if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+ raise NotImplementedError('Package feed signing not implementd for dpkg')
+
+
+
+class PkgsList(object, metaclass=ABCMeta):
+ def __init__(self, d, rootfs_dir):
+ self.d = d
+ self.rootfs_dir = rootfs_dir
+
+ @abstractmethod
+ def list_pkgs(self):
+ pass
+
+class RpmPkgsList(PkgsList):
+ def list_pkgs(self):
+ return RpmPM(self.d, self.rootfs_dir, self.d.getVar('TARGET_VENDOR')).list_installed()
+
+class OpkgPkgsList(PkgsList):
+ def __init__(self, d, rootfs_dir, config_file):
+ super(OpkgPkgsList, self).__init__(d, rootfs_dir)
+
+ self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
+ self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
+ self.opkg_args += self.d.getVar("OPKG_ARGS")
+
+ def list_pkgs(self, format=None):
+ cmd = "%s %s status" % (self.opkg_cmd, self.opkg_args)
+
+ # opkg returns success even when it printed some
+ # "Collected errors:" report to stderr. Mixing stderr into
+ # stdout then leads to random failures later on when
+ # parsing the output. To avoid this we need to collect both
+ # output streams separately and check for empty stderr.
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+ cmd_output, cmd_stderr = p.communicate()
+ cmd_output = cmd_output.decode("utf-8")
+ cmd_stderr = cmd_stderr.decode("utf-8")
+ if p.returncode or cmd_stderr:
+ bb.fatal("Cannot get the installed packages list. Command '%s' "
+ "returned %d and stderr:\n%s" % (cmd, p.returncode, cmd_stderr))
+
+ return opkg_query(cmd_output)
+
+
+class DpkgPkgsList(PkgsList):
+
+ def list_pkgs(self):
+ cmd = [bb.utils.which(os.getenv('PATH'), "dpkg-query"),
+ "--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
+ "-W"]
+
+ cmd.append("-f=Package: ${Package}\nArchitecture: ${PackageArch}\nVersion: ${Version}\nFile: ${Package}_${Version}_${Architecture}.deb\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n")
+
+ try:
+ cmd_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip().decode("utf-8")
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot get the installed packages list. Command '%s' "
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
+ return opkg_query(cmd_output)
+
+
+class PackageManager(object, metaclass=ABCMeta):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+
+ def __init__(self, d, target_rootfs):
+ self.d = d
+ self.target_rootfs = target_rootfs
+ self.deploy_dir = None
+ self.deploy_lock = None
+ self._initialize_intercepts()
+
+ def _initialize_intercepts(self):
+ bb.note("Initializing intercept dir for %s" % self.target_rootfs)
+ postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR")
+ if not postinst_intercepts_dir:
+ postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
+ # As there might be more than one instance of PackageManager operating at the same time
+ # we need to isolate the intercept_scripts directories from each other,
+ # hence the ugly hash digest in dir name.
+ self.intercepts_dir = os.path.join(self.d.getVar('WORKDIR'),
+ "intercept_scripts-%s" %(hashlib.sha256(self.target_rootfs.encode()).hexdigest()) )
+
+ bb.utils.remove(self.intercepts_dir, True)
+ shutil.copytree(postinst_intercepts_dir, self.intercepts_dir)
+
+ @abstractmethod
+ def _handle_intercept_failure(self, failed_script):
+ pass
+
+ def _postpone_to_first_boot(self, postinst_intercept_hook):
+ with open(postinst_intercept_hook) as intercept:
+ registered_pkgs = None
+ for line in intercept.read().split("\n"):
+ m = re.match("^##PKGS:(.*)", line)
+ if m is not None:
+ registered_pkgs = m.group(1).strip()
+ break
+
+ if registered_pkgs is not None:
+ bb.note("If an image is being built, the postinstalls for the following packages "
+ "will be postponed for first boot: %s" %
+ registered_pkgs)
+
+ # call the backend dependent handler
+ self._handle_intercept_failure(registered_pkgs)
+
+
+ def run_intercepts(self):
+ intercepts_dir = self.intercepts_dir
+
+ bb.note("Running intercept scripts:")
+ os.environ['D'] = self.target_rootfs
+ os.environ['STAGING_DIR_NATIVE'] = self.d.getVar('STAGING_DIR_NATIVE')
+ for script in os.listdir(intercepts_dir):
+ script_full = os.path.join(intercepts_dir, script)
+
+ if script == "postinst_intercept" or not os.access(script_full, os.X_OK):
+ continue
+
+ if script == "delay_to_first_boot":
+ self._postpone_to_first_boot(script_full)
+ continue
+
+ bb.note("> Executing %s intercept ..." % script)
+
+ try:
+ output = subprocess.check_output(script_full, stderr=subprocess.STDOUT)
+ if output: bb.note(output.decode("utf-8"))
+ except subprocess.CalledProcessError as e:
+ bb.warn("The postinstall intercept hook '%s' failed, details in %s/log.do_%s" % (script, self.d.getVar('T'), self.d.getVar('BB_CURRENTTASK')))
+ bb.note("Exit code %d. Output:\n%s" % (e.returncode, e.output.decode("utf-8")))
+ self._postpone_to_first_boot(script_full)
+
+ @abstractmethod
+ def update(self):
+ """
+ Update the package manager package database.
+ """
+ pass
+
+ @abstractmethod
+ def install(self, pkgs, attempt_only=False):
+ """
+ Install a list of packages. 'pkgs' is a list object. If 'attempt_only' is
+ True, installation failures are ignored.
+ """
+ pass
+
+ @abstractmethod
+ def remove(self, pkgs, with_dependencies=True):
+ """
+ Remove a list of packages. 'pkgs' is a list object. If 'with_dependencies'
+ is False, then any dependencies are left in place.
+ """
+ pass
+
+ @abstractmethod
+ def write_index(self):
+ """
+ This function creates the index files
+ """
+ pass
+
+ @abstractmethod
+ def remove_packaging_data(self):
+ pass
+
+ @abstractmethod
+ def list_installed(self):
+ pass
+
+ @abstractmethod
+ def extract(self, pkg):
+ """
+ Returns the path to a tmpdir where resides the contents of a package.
+ Deleting the tmpdir is responsability of the caller.
+ """
+ pass
+
+ @abstractmethod
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ """
+ Add remote package feeds into repository manager configuration. The parameters
+ for the feeds are set by feed_uris, feed_base_paths and feed_archs.
+ See http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-PACKAGE_FEED_URIS
+ for their description.
+ """
+ pass
+
+ def install_glob(self, globs, sdk=False):
+ """
+ Install all packages that match a glob.
+ """
+ # TODO don't have sdk here but have a property on the superclass
+ # (and respect in install_complementary)
+ if sdk:
+ pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}")
+ else:
+ pkgdatadir = self.d.getVar("PKGDATA_DIR")
+
+ try:
+ bb.note("Installing globbed packages...")
+ cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs]
+ pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
+ self.install(pkgs.split(), attempt_only=True)
+ except subprocess.CalledProcessError as e:
+ # Return code 1 means no packages matched
+ if e.returncode != 1:
+ bb.fatal("Could not compute globbed packages list. Command "
+ "'%s' returned %d:\n%s" %
+ (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
+ def install_complementary(self, globs=None):
+ """
+ Install complementary packages based upon the list of currently installed
+ packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install
+ these packages, if they don't exist then no error will occur. Note: every
+ backend needs to call this function explicitly after the normal package
+ installation
+ """
+ if globs is None:
+ globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY')
+ split_linguas = set()
+
+ for translation in self.d.getVar('IMAGE_LINGUAS').split():
+ split_linguas.add(translation)
+ split_linguas.add(translation.split('-')[0])
+
+ split_linguas = sorted(split_linguas)
+
+ for lang in split_linguas:
+ globs += " *-locale-%s" % lang
+
+ if globs is None:
+ return
+
+ # we need to write the list of installed packages to a file because the
+ # oe-pkgdata-util reads it from a file
+ with tempfile.NamedTemporaryFile(mode="w+", prefix="installed-pkgs") as installed_pkgs:
+ pkgs = self.list_installed()
+ output = oe.utils.format_pkg_list(pkgs, "arch")
+ installed_pkgs.write(output)
+ installed_pkgs.flush()
+
+ cmd = ["oe-pkgdata-util",
+ "-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs.name,
+ globs]
+ exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY')
+ if exclude:
+ cmd.extend(['--exclude=' + '|'.join(exclude.split())])
+ try:
+ bb.note("Installing complementary packages ...")
+ bb.note('Running %s' % cmd)
+ complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
+ self.install(complementary_pkgs.split(), attempt_only=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Could not compute complementary packages list. Command "
+ "'%s' returned %d:\n%s" %
+ (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
+ def deploy_dir_lock(self):
+ if self.deploy_dir is None:
+ raise RuntimeError("deploy_dir is not set!")
+
+ lock_file_name = os.path.join(self.deploy_dir, "deploy.lock")
+
+ self.deploy_lock = bb.utils.lockfile(lock_file_name)
+
+ def deploy_dir_unlock(self):
+ if self.deploy_lock is None:
+ return
+
+ bb.utils.unlockfile(self.deploy_lock)
+
+ self.deploy_lock = None
+
+ def construct_uris(self, uris, base_paths):
+ """
+ Construct URIs based on the following pattern: uri/base_path where 'uri'
+ and 'base_path' correspond to each element of the corresponding array
+ argument leading to len(uris) x len(base_paths) elements on the returned
+ array
+ """
+ def _append(arr1, arr2, sep='/'):
+ res = []
+ narr1 = [a.rstrip(sep) for a in arr1]
+ narr2 = [a.rstrip(sep).lstrip(sep) for a in arr2]
+ for a1 in narr1:
+ if arr2:
+ for a2 in narr2:
+ res.append("%s%s%s" % (a1, sep, a2))
+ else:
+ res.append(a1)
+ return res
+ return _append(uris, base_paths)
+
+def create_packages_dir(d, rpm_repo_dir, deploydir, taskname, filterbydependencies):
+ """
+ Go through our do_package_write_X dependencies and hardlink the packages we depend
+ upon into the repo directory. This prevents us seeing other packages that may
+ have been built that we don't depend upon and also packages for architectures we don't
+ support.
+ """
+ import errno
+
+ taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+ mytaskname = d.getVar("BB_RUNTASK")
+ pn = d.getVar("PN")
+ seendirs = set()
+ multilibs = {}
+
+ rpm_subrepo_dir = oe.path.join(rpm_repo_dir, "rpm")
+
+ bb.utils.remove(rpm_subrepo_dir, recurse=True)
+ bb.utils.mkdirhier(rpm_subrepo_dir)
+
+ # Detect bitbake -b usage
+ nodeps = d.getVar("BB_LIMITEDDEPS") or False
+ if nodeps or not filterbydependencies:
+ oe.path.symlink(deploydir, rpm_subrepo_dir, True)
+ return
+
+ start = None
+ for dep in taskdepdata:
+ data = taskdepdata[dep]
+ if data[1] == mytaskname and data[0] == pn:
+ start = dep
+ break
+ if start is None:
+ bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
+ rpmdeps = set()
+ start = [start]
+ seen = set(start)
+ # Support direct dependencies (do_rootfs -> rpms)
+ # or indirect dependencies within PN (do_populate_sdk_ext -> do_rootfs -> rpms)
+ while start:
+ next = []
+ for dep2 in start:
+ for dep in taskdepdata[dep2][3]:
+ if taskdepdata[dep][0] != pn:
+ if "do_" + taskname in dep:
+ rpmdeps.add(dep)
+ elif dep not in seen:
+ next.append(dep)
+ seen.add(dep)
+ start = next
+
+ for dep in rpmdeps:
+ c = taskdepdata[dep][0]
+ manifest, d2 = oe.sstatesig.find_sstate_manifest(c, taskdepdata[dep][2], taskname, d, multilibs)
+ if not manifest:
+ bb.fatal("No manifest generated from: %s in %s" % (c, taskdepdata[dep][2]))
+ if not os.path.exists(manifest):
+ continue
+ with open(manifest, "r") as f:
+ for l in f:
+ l = l.strip()
+ dest = l.replace(deploydir, "")
+ dest = rpm_subrepo_dir + dest
+ if l.endswith("/"):
+ if dest not in seendirs:
+ bb.utils.mkdirhier(dest)
+ seendirs.add(dest)
+ continue
+ # Try to hardlink the file, copy if that fails
+ destdir = os.path.dirname(dest)
+ if destdir not in seendirs:
+ bb.utils.mkdirhier(destdir)
+ seendirs.add(destdir)
+ try:
+ os.link(l, dest)
+ except OSError as err:
+ if err.errno == errno.EXDEV:
+ bb.utils.copyfile(l, dest)
+ else:
+ raise
+
+class RpmPM(PackageManager):
+ def __init__(self,
+ d,
+ target_rootfs,
+ target_vendor,
+ task_name='target',
+ arch_var=None,
+ os_var=None,
+ rpm_repo_workdir="oe-rootfs-repo",
+ filterbydependencies=True):
+ super(RpmPM, self).__init__(d, target_rootfs)
+ self.target_vendor = target_vendor
+ self.task_name = task_name
+ if arch_var == None:
+ self.archs = self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS').replace("-","_")
+ else:
+ self.archs = self.d.getVar(arch_var).replace("-","_")
+ if task_name == "host":
+ self.primary_arch = self.d.getVar('SDK_ARCH')
+ else:
+ self.primary_arch = self.d.getVar('MACHINE_ARCH')
+
+ self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir)
+ create_packages_dir(self.d, self.rpm_repo_dir, d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
+
+ self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
+ if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
+ bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
+ self.packaging_data_dirs = ['var/lib/rpm', 'var/lib/dnf', 'var/cache/dnf']
+ self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
+ self.task_name)
+ if not os.path.exists(self.d.expand('${T}/saved')):
+ bb.utils.mkdirhier(self.d.expand('${T}/saved'))
+
+ def _configure_dnf(self):
+ # libsolv handles 'noarch' internally, we don't need to specify it explicitly
+ archs = [i for i in reversed(self.archs.split()) if i not in ["any", "all", "noarch"]]
+ # This prevents accidental matching against libsolv's built-in policies
+ if len(archs) <= 1:
+ archs = archs + ["bogusarch"]
+ confdir = "%s/%s" %(self.target_rootfs, "etc/dnf/vars/")
+ bb.utils.mkdirhier(confdir)
+ open(confdir + "arch", 'w').write(":".join(archs))
+ distro_codename = self.d.getVar('DISTRO_CODENAME')
+ open(confdir + "releasever", 'w').write(distro_codename if distro_codename is not None else '')
+
+ open(oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"), 'w').write("")
+
+
+ def _configure_rpm(self):
+ # We need to configure rpm to use our primary package architecture as the installation architecture,
+ # and to make it compatible with other package architectures that we use.
+ # Otherwise it will refuse to proceed with packages installation.
+ platformconfdir = "%s/%s" %(self.target_rootfs, "etc/rpm/")
+ rpmrcconfdir = "%s/%s" %(self.target_rootfs, "etc/")
+ bb.utils.mkdirhier(platformconfdir)
+ open(platformconfdir + "platform", 'w').write("%s-pc-linux" % self.primary_arch)
+ open(rpmrcconfdir + "rpmrc", 'w').write("arch_compat: %s: %s\n" % (self.primary_arch, self.archs if len(self.archs) > 0 else self.primary_arch))
+
+ open(platformconfdir + "macros", 'w').write("%_transaction_color 7\n")
+ if self.d.getVar('RPM_PREFER_ELF_ARCH'):
+ open(platformconfdir + "macros", 'a').write("%%_prefer_color %s" % (self.d.getVar('RPM_PREFER_ELF_ARCH')))
+ else:
+ open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
+
+ if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
+ signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
+ pubkey_path = oe.path.join(self.d.getVar('B'), 'rpm-key')
+ signer.export_pubkey(pubkey_path, self.d.getVar('RPM_GPG_NAME'))
+ rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmkeys")
+ cmd = [rpm_bin, '--root=%s' % self.target_rootfs, '--import', pubkey_path]
+ try:
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Importing GPG key failed. Command '%s' "
+ "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
+ def create_configs(self):
+ self._configure_dnf()
+ self._configure_rpm()
+
+ def write_index(self):
+ lockfilename = self.d.getVar('DEPLOY_DIR_RPM') + "/rpm.lock"
+ lf = bb.utils.lockfile(lockfilename, False)
+ RpmIndexer(self.d, self.rpm_repo_dir).write_index()
+ bb.utils.unlockfile(lf)
+
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ from urllib.parse import urlparse
+
+ if feed_uris == "":
+ return
+
+ gpg_opts = ''
+ if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+ gpg_opts += 'repo_gpgcheck=1\n'
+ gpg_opts += 'gpgkey=file://%s/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-%s-%s\n' % (self.d.getVar('sysconfdir'), self.d.getVar('DISTRO'), self.d.getVar('DISTRO_CODENAME'))
+
+ if self.d.getVar('RPM_SIGN_PACKAGES') != '1':
+ gpg_opts += 'gpgcheck=0\n'
+
+ bb.utils.mkdirhier(oe.path.join(self.target_rootfs, "etc", "yum.repos.d"))
+ remote_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+ for uri in remote_uris:
+ repo_base = "oe-remote-repo" + "-".join(urlparse(uri).path.split("/"))
+ if feed_archs is not None:
+ for arch in feed_archs.split():
+ repo_uri = uri + "/" + arch
+ repo_id = "oe-remote-repo" + "-".join(urlparse(repo_uri).path.split("/"))
+ repo_name = "OE Remote Repo:" + " ".join(urlparse(repo_uri).path.split("/"))
+ open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'a').write(
+ "[%s]\nname=%s\nbaseurl=%s\n%s\n" % (repo_id, repo_name, repo_uri, gpg_opts))
+ else:
+ repo_name = "OE Remote Repo:" + " ".join(urlparse(uri).path.split("/"))
+ repo_uri = uri
+ open(oe.path.join(self.target_rootfs, "etc", "yum.repos.d", repo_base + ".repo"), 'w').write(
+ "[%s]\nname=%s\nbaseurl=%s\n%s" % (repo_base, repo_name, repo_uri, gpg_opts))
+
+ def _prepare_pkg_transaction(self):
+ os.environ['D'] = self.target_rootfs
+ os.environ['OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['INTERCEPT_DIR'] = self.intercepts_dir
+ os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
+
+
+ def install(self, pkgs, attempt_only = False):
+ if len(pkgs) == 0:
+ return
+ self._prepare_pkg_transaction()
+
+ bad_recommendations = self.d.getVar('BAD_RECOMMENDATIONS')
+ package_exclude = self.d.getVar('PACKAGE_EXCLUDE')
+ exclude_pkgs = (bad_recommendations.split() if bad_recommendations else []) + (package_exclude.split() if package_exclude else [])
+
+ output = self._invoke_dnf((["--skip-broken"] if attempt_only else []) +
+ (["-x", ",".join(exclude_pkgs)] if len(exclude_pkgs) > 0 else []) +
+ (["--setopt=install_weak_deps=False"] if self.d.getVar('NO_RECOMMENDATIONS') == "1" else []) +
+ (["--nogpgcheck"] if self.d.getVar('RPM_SIGN_PACKAGES') != '1' else ["--setopt=gpgcheck=True"]) +
+ ["install"] +
+ pkgs)
+
+ failed_scriptlets_pkgnames = collections.OrderedDict()
+ for line in output.splitlines():
+ if line.startswith("Non-fatal POSTIN scriptlet failure in rpm package"):
+ failed_scriptlets_pkgnames[line.split()[-1]] = True
+
+ if len(failed_scriptlets_pkgnames) > 0:
+ failed_postinsts_warn(list(failed_scriptlets_pkgnames.keys()), self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
+ for pkg in failed_scriptlets_pkgnames.keys():
+ self.save_rpmpostinst(pkg)
+
+ def remove(self, pkgs, with_dependencies = True):
+ if len(pkgs) == 0:
+ return
+ self._prepare_pkg_transaction()
+
+ if with_dependencies:
+ self._invoke_dnf(["remove"] + pkgs)
+ else:
+ cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+ args = ["-e", "-v", "--nodeps", "--root=%s" %self.target_rootfs]
+
+ try:
+ bb.note("Running %s" % ' '.join([cmd] + args + pkgs))
+ output = subprocess.check_output([cmd] + args + pkgs, stderr=subprocess.STDOUT).decode("utf-8")
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Could not invoke rpm. Command "
+ "'%s' returned %d:\n%s" % (' '.join([cmd] + args + pkgs), e.returncode, e.output.decode("utf-8")))
+
+ def upgrade(self):
+ self._prepare_pkg_transaction()
+ self._invoke_dnf(["upgrade"])
+
+ def autoremove(self):
+ self._prepare_pkg_transaction()
+ self._invoke_dnf(["autoremove"])
+
+ def remove_packaging_data(self):
+ self._invoke_dnf(["clean", "all"])
+ for dir in self.packaging_data_dirs:
+ bb.utils.remove(oe.path.join(self.target_rootfs, dir), True)
+
+ def backup_packaging_data(self):
+ # Save the packaging dirs for increment rpm image generation
+ if os.path.exists(self.saved_packaging_data):
+ bb.utils.remove(self.saved_packaging_data, True)
+ for i in self.packaging_data_dirs:
+ source_dir = oe.path.join(self.target_rootfs, i)
+ target_dir = oe.path.join(self.saved_packaging_data, i)
+ shutil.copytree(source_dir, target_dir, symlinks=True)
+
+ def recovery_packaging_data(self):
+ # Move the rpmlib back
+ if os.path.exists(self.saved_packaging_data):
+ for i in self.packaging_data_dirs:
+ target_dir = oe.path.join(self.target_rootfs, i)
+ if os.path.exists(target_dir):
+ bb.utils.remove(target_dir, True)
+ source_dir = oe.path.join(self.saved_packaging_data, i)
+ shutil.copytree(source_dir,
+ target_dir,
+ symlinks=True)
+
+ def list_installed(self):
+ output = self._invoke_dnf(["repoquery", "--installed", "--queryformat", "Package: %{name} %{arch} %{version} %{name}-%{version}-%{release}.%{arch}.rpm\nDependencies:\n%{requires}\nRecommendations:\n%{recommends}\nDependenciesEndHere:\n"],
+ print_output = False)
+ packages = {}
+ current_package = None
+ current_deps = None
+ current_state = "initial"
+ for line in output.splitlines():
+ if line.startswith("Package:"):
+ package_info = line.split(" ")[1:]
+ current_package = package_info[0]
+ package_arch = package_info[1]
+ package_version = package_info[2]
+ package_rpm = package_info[3]
+ packages[current_package] = {"arch":package_arch, "ver":package_version, "filename":package_rpm}
+ current_deps = []
+ elif line.startswith("Dependencies:"):
+ current_state = "dependencies"
+ elif line.startswith("Recommendations"):
+ current_state = "recommendations"
+ elif line.startswith("DependenciesEndHere:"):
+ current_state = "initial"
+ packages[current_package]["deps"] = current_deps
+ elif len(line) > 0:
+ if current_state == "dependencies":
+ current_deps.append(line)
+ elif current_state == "recommendations":
+ current_deps.append("%s [REC]" % line)
+
+ return packages
+
+ def update(self):
+ self._invoke_dnf(["makecache", "--refresh"])
+
+ def _invoke_dnf(self, dnf_args, fatal = True, print_output = True ):
+ os.environ['RPM_ETCCONFIGDIR'] = self.target_rootfs
+
+ dnf_cmd = bb.utils.which(os.getenv('PATH'), "dnf")
+ standard_dnf_args = (["-v", "--rpmverbosity=debug"] if self.d.getVar('ROOTFS_RPM_DEBUG') else []) + ["-y",
+ "-c", oe.path.join(self.target_rootfs, "etc/dnf/dnf.conf"),
+ "--setopt=reposdir=%s" %(oe.path.join(self.target_rootfs, "etc/yum.repos.d")),
+ "--repofrompath=oe-repo,%s" % (self.rpm_repo_dir),
+ "--installroot=%s" % (self.target_rootfs),
+ "--setopt=logdir=%s" % (self.d.getVar('T'))
+ ]
+ cmd = [dnf_cmd] + standard_dnf_args + dnf_args
+ bb.note('Running %s' % ' '.join(cmd))
+ try:
+ output = subprocess.check_output(cmd,stderr=subprocess.STDOUT).decode("utf-8")
+ if print_output:
+ bb.note(output)
+ return output
+ except subprocess.CalledProcessError as e:
+ if print_output:
+ (bb.note, bb.fatal)[fatal]("Could not invoke dnf. Command "
+ "'%s' returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+ else:
+ (bb.note, bb.fatal)[fatal]("Could not invoke dnf. Command "
+ "'%s' returned %d:" % (' '.join(cmd), e.returncode))
+ return e.output.decode("utf-8")
+
+ def dump_install_solution(self, pkgs):
+ open(self.solution_manifest, 'w').write(" ".join(pkgs))
+ return pkgs
+
+ def load_old_install_solution(self):
+ if not os.path.exists(self.solution_manifest):
+ return []
+
+ return open(self.solution_manifest, 'r').read().split()
+
+ def _script_num_prefix(self, path):
+ files = os.listdir(path)
+ numbers = set()
+ numbers.add(99)
+ for f in files:
+ numbers.add(int(f.split("-")[0]))
+ return max(numbers) + 1
+
+ def save_rpmpostinst(self, pkg):
+ bb.note("Saving postinstall script of %s" % (pkg))
+ cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+ args = ["-q", "--root=%s" % self.target_rootfs, "--queryformat", "%{postin}", pkg]
+
+ try:
+ output = subprocess.check_output([cmd] + args,stderr=subprocess.STDOUT).decode("utf-8")
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Could not invoke rpm. Command "
+ "'%s' returned %d:\n%s" % (' '.join([cmd] + args), e.returncode, e.output.decode("utf-8")))
+
+ # may need to prepend #!/bin/sh to output
+
+ target_path = oe.path.join(self.target_rootfs, self.d.expand('${sysconfdir}/rpm-postinsts/'))
+ bb.utils.mkdirhier(target_path)
+ num = self._script_num_prefix(target_path)
+ saved_script_name = oe.path.join(target_path, "%d-%s" % (num, pkg))
+ open(saved_script_name, 'w').write(output)
+ os.chmod(saved_script_name, 0o755)
+
+ def _handle_intercept_failure(self, registered_pkgs):
+ rpm_postinsts_dir = self.target_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/')
+ bb.utils.mkdirhier(rpm_postinsts_dir)
+
+ # Save the package postinstalls in /etc/rpm-postinsts
+ for pkg in registered_pkgs.split():
+ self.save_rpmpostinst(pkg)
+
+ def extract(self, pkg):
+ output = self._invoke_dnf(["repoquery", "--queryformat", "%{location}", pkg])
+ pkg_name = output.splitlines()[-1]
+ if not pkg_name.endswith(".rpm"):
+ bb.fatal("dnf could not find package %s in repository: %s" %(pkg, output))
+ pkg_path = oe.path.join(self.rpm_repo_dir, pkg_name)
+
+ cpio_cmd = bb.utils.which(os.getenv("PATH"), "cpio")
+ rpm2cpio_cmd = bb.utils.which(os.getenv("PATH"), "rpm2cpio")
+
+ if not os.path.isfile(pkg_path):
+ bb.fatal("Unable to extract package for '%s'."
+ "File %s doesn't exists" % (pkg, pkg_path))
+
+ tmp_dir = tempfile.mkdtemp()
+ current_dir = os.getcwd()
+ os.chdir(tmp_dir)
+
+ try:
+ cmd = "%s %s | %s -idmv" % (rpm2cpio_cmd, pkg_path, cpio_cmd)
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.utils.remove(tmp_dir, recurse=True)
+ bb.fatal("Unable to extract %s package. Command '%s' "
+ "returned %d:\n%s" % (pkg_path, cmd, e.returncode, e.output.decode("utf-8")))
+ except OSError as e:
+ bb.utils.remove(tmp_dir, recurse=True)
+ bb.fatal("Unable to extract %s package. Command '%s' "
+ "returned %d:\n%s at %s" % (pkg_path, cmd, e.errno, e.strerror, e.filename))
+
+ bb.note("Extracted %s to %s" % (pkg_path, tmp_dir))
+ os.chdir(current_dir)
+
+ return tmp_dir
+
+
+class OpkgDpkgPM(PackageManager):
+ def __init__(self, d, target_rootfs):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+ super(OpkgDpkgPM, self).__init__(d, target_rootfs)
+
+ def package_info(self, pkg, cmd):
+ """
+ Returns a dictionary with the package info.
+
+ This method extracts the common parts for Opkg and Dpkg
+ """
+
+ try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to list available packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+ return opkg_query(output)
+
+ def extract(self, pkg, pkg_info):
+ """
+ Returns the path to a tmpdir where resides the contents of a package.
+
+ Deleting the tmpdir is responsability of the caller.
+
+ This method extracts the common parts for Opkg and Dpkg
+ """
+
+ ar_cmd = bb.utils.which(os.getenv("PATH"), "ar")
+ tar_cmd = bb.utils.which(os.getenv("PATH"), "tar")
+ pkg_path = pkg_info[pkg]["filepath"]
+
+ if not os.path.isfile(pkg_path):
+ bb.fatal("Unable to extract package for '%s'."
+ "File %s doesn't exists" % (pkg, pkg_path))
+
+ tmp_dir = tempfile.mkdtemp()
+ current_dir = os.getcwd()
+ os.chdir(tmp_dir)
+ if self.d.getVar('IMAGE_PKGTYPE') == 'deb':
+ data_tar = 'data.tar.xz'
+ else:
+ data_tar = 'data.tar.gz'
+
+ try:
+ cmd = [ar_cmd, 'x', pkg_path]
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ cmd = [tar_cmd, 'xf', data_tar]
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.utils.remove(tmp_dir, recurse=True)
+ bb.fatal("Unable to extract %s package. Command '%s' "
+ "returned %d:\n%s" % (pkg_path, ' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+ except OSError as e:
+ bb.utils.remove(tmp_dir, recurse=True)
+ bb.fatal("Unable to extract %s package. Command '%s' "
+ "returned %d:\n%s at %s" % (pkg_path, ' '.join(cmd), e.errno, e.strerror, e.filename))
+
+ bb.note("Extracted %s to %s" % (pkg_path, tmp_dir))
+ bb.utils.remove(os.path.join(tmp_dir, "debian-binary"))
+ bb.utils.remove(os.path.join(tmp_dir, "control.tar.gz"))
+ os.chdir(current_dir)
+
+ return tmp_dir
+
+ def _handle_intercept_failure(self, registered_pkgs):
+ self.mark_packages("unpacked", registered_pkgs.split())
+
+class OpkgPM(OpkgDpkgPM):
+ def __init__(self, d, target_rootfs, config_file, archs, task_name='target'):
+ super(OpkgPM, self).__init__(d, target_rootfs)
+
+ self.config_file = config_file
+ self.pkg_archs = archs
+ self.task_name = task_name
+
+ self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK")
+ self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
+ self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
+ self.opkg_args = "--volatile-cache -f %s -t %s -o %s " % (self.config_file, self.d.expand('${T}/ipktemp/') ,target_rootfs)
+ self.opkg_args += self.d.getVar("OPKG_ARGS")
+
+ opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
+ if opkg_lib_dir[0] == "/":
+ opkg_lib_dir = opkg_lib_dir[1:]
+
+ self.opkg_dir = os.path.join(target_rootfs, opkg_lib_dir, "opkg")
+
+ bb.utils.mkdirhier(self.opkg_dir)
+
+ self.saved_opkg_dir = self.d.expand('${T}/saved/%s' % self.task_name)
+ if not os.path.exists(self.d.expand('${T}/saved')):
+ bb.utils.mkdirhier(self.d.expand('${T}/saved'))
+
+ self.from_feeds = (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") == "1"
+ if self.from_feeds:
+ self._create_custom_config()
+ else:
+ self._create_config()
+
+ self.indexer = OpkgIndexer(self.d, self.deploy_dir)
+
+ def mark_packages(self, status_tag, packages=None):
+ """
+ This function will change a package's status in /var/lib/opkg/status file.
+ If 'packages' is None then the new_status will be applied to all
+ packages
+ """
+ status_file = os.path.join(self.opkg_dir, "status")
+
+ with open(status_file, "r") as sf:
+ with open(status_file + ".tmp", "w+") as tmp_sf:
+ if packages is None:
+ tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
+ r"Package: \1\n\2Status: \3%s" % status_tag,
+ sf.read()))
+ else:
+ if type(packages).__name__ != "list":
+ raise TypeError("'packages' should be a list object")
+
+ status = sf.read()
+ for pkg in packages:
+ status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
+ r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
+ status)
+
+ tmp_sf.write(status)
+
+ os.rename(status_file + ".tmp", status_file)
+
+ def _create_custom_config(self):
+ bb.note("Building from feeds activated!")
+
+ with open(self.config_file, "w+") as config_file:
+ priority = 1
+ for arch in self.pkg_archs.split():
+ config_file.write("arch %s %d\n" % (arch, priority))
+ priority += 5
+
+ for line in (self.d.getVar('IPK_FEED_URIS') or "").split():
+ feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
+
+ if feed_match is not None:
+ feed_name = feed_match.group(1)
+ feed_uri = feed_match.group(2)
+
+ bb.note("Add %s feed with URL %s" % (feed_name, feed_uri))
+
+ config_file.write("src/gz %s %s\n" % (feed_name, feed_uri))
+
+ """
+ Allow to use package deploy directory contents as quick devel-testing
+ feed. This creates individual feed configs for each arch subdir of those
+ specified as compatible for the current machine.
+ NOTE: Development-helper feature, NOT a full-fledged feed.
+ """
+ if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI') or "") != "":
+ for arch in self.pkg_archs.split():
+ cfg_file_name = os.path.join(self.target_rootfs,
+ self.d.getVar("sysconfdir"),
+ "opkg",
+ "local-%s-feed.conf" % arch)
+
+ with open(cfg_file_name, "w+") as cfg_file:
+ cfg_file.write("src/gz local-%s %s/%s" %
+ (arch,
+ self.d.getVar('FEED_DEPLOYDIR_BASE_URI'),
+ arch))
+
+ if self.d.getVar('OPKGLIBDIR') != '/var/lib':
+ # There is no command line option for this anymore, we need to add
+ # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
+ # the default value of "/var/lib" as defined in opkg:
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
+ cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+ cfg_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
+ cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
+
+
+ def _create_config(self):
+ with open(self.config_file, "w+") as config_file:
+ priority = 1
+ for arch in self.pkg_archs.split():
+ config_file.write("arch %s %d\n" % (arch, priority))
+ priority += 5
+
+ config_file.write("src oe file:%s\n" % self.deploy_dir)
+
+ for arch in self.pkg_archs.split():
+ pkgs_dir = os.path.join(self.deploy_dir, arch)
+ if os.path.isdir(pkgs_dir):
+ config_file.write("src oe-%s file:%s\n" %
+ (arch, pkgs_dir))
+
+ if self.d.getVar('OPKGLIBDIR') != '/var/lib':
+ # There is no command line option for this anymore, we need to add
+ # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
+ # the default value of "/var/lib" as defined in opkg:
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
+ # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
+ config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
+ config_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
+ config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
+
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ if feed_uris == "":
+ return
+
+ rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
+ % self.target_rootfs)
+
+ feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+ archs = self.pkg_archs.split() if feed_archs is None else feed_archs.split()
+
+ with open(rootfs_config, "w+") as config_file:
+ uri_iterator = 0
+ for uri in feed_uris:
+ if archs:
+ for arch in archs:
+ if (feed_archs is None) and (not os.path.exists(oe.path.join(self.deploy_dir, arch))):
+ continue
+ bb.note('Adding opkg feed url-%s-%d (%s)' %
+ (arch, uri_iterator, uri))
+ config_file.write("src/gz uri-%s-%d %s/%s\n" %
+ (arch, uri_iterator, uri, arch))
+ else:
+ bb.note('Adding opkg feed url-%d (%s)' %
+ (uri_iterator, uri))
+ config_file.write("src/gz uri-%d %s\n" %
+ (uri_iterator, uri))
+
+ uri_iterator += 1
+
+ def update(self):
+ self.deploy_dir_lock()
+
+ cmd = "%s %s update" % (self.opkg_cmd, self.opkg_args)
+
+ try:
+ subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ self.deploy_dir_unlock()
+ bb.fatal("Unable to update the package index files. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+
+ self.deploy_dir_unlock()
+
+ def install(self, pkgs, attempt_only=False):
+ if not pkgs:
+ return
+
+ cmd = "%s %s install %s" % (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+
+ os.environ['D'] = self.target_rootfs
+ os.environ['OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['INTERCEPT_DIR'] = self.intercepts_dir
+ os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
+
+ try:
+ bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+ bb.note(cmd)
+ output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
+ bb.note(output)
+ failed_pkgs = []
+ for line in output.split('\n'):
+ if line.endswith("configuration required on target."):
+ bb.warn(line)
+ failed_pkgs.append(line.split(".")[0])
+ if failed_pkgs:
+ failed_postinsts_warn(failed_pkgs, self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
+ except subprocess.CalledProcessError as e:
+ (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
+ "Command '%s' returned %d:\n%s" %
+ (cmd, e.returncode, e.output.decode("utf-8")))
+
+ def remove(self, pkgs, with_dependencies=True):
+ if with_dependencies:
+ cmd = "%s %s --force-remove --force-removal-of-dependent-packages remove %s" % \
+ (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+ else:
+ cmd = "%s %s --force-depends remove %s" % \
+ (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+
+ try:
+ bb.note(cmd)
+ output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to remove packages. Command '%s' "
+ "returned %d:\n%s" % (e.cmd, e.returncode, e.output.decode("utf-8")))
+
+ def write_index(self):
+ self.deploy_dir_lock()
+
+ result = self.indexer.write_index()
+
+ self.deploy_dir_unlock()
+
+ if result is not None:
+ bb.fatal(result)
+
+ def remove_packaging_data(self):
+ bb.utils.remove(self.opkg_dir, True)
+ # create the directory back, it's needed by PM lock
+ bb.utils.mkdirhier(self.opkg_dir)
+
+ def remove_lists(self):
+ if not self.from_feeds:
+ bb.utils.remove(os.path.join(self.opkg_dir, "lists"), True)
+
+ def list_installed(self):
+ return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list_pkgs()
+
+ def handle_bad_recommendations(self):
+ bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS") or ""
+ if bad_recommendations.strip() == "":
+ return
+
+ status_file = os.path.join(self.opkg_dir, "status")
+
+ # If status file existed, it means the bad recommendations has already
+ # been handled
+ if os.path.exists(status_file):
+ return
+
+ cmd = "%s %s info " % (self.opkg_cmd, self.opkg_args)
+
+ with open(status_file, "w+") as status:
+ for pkg in bad_recommendations.split():
+ pkg_info = cmd + pkg
+
+ try:
+ output = subprocess.check_output(pkg_info.split(), stderr=subprocess.STDOUT).strip().decode("utf-8")
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot get package info. Command '%s' "
+ "returned %d:\n%s" % (pkg_info, e.returncode, e.output.decode("utf-8")))
+
+ if output == "":
+ bb.note("Ignored bad recommendation: '%s' is "
+ "not a package" % pkg)
+ continue
+
+ for line in output.split('\n'):
+ if line.startswith("Status:"):
+ status.write("Status: deinstall hold not-installed\n")
+ else:
+ status.write(line + "\n")
+
+ # Append a blank line after each package entry to ensure that it
+ # is separated from the following entry
+ status.write("\n")
+
+ def dummy_install(self, pkgs):
+ """
+ The following function dummy installs pkgs and returns the log of output.
+ """
+ if len(pkgs) == 0:
+ return
+
+ # Create an temp dir as opkg root for dummy installation
+ temp_rootfs = self.d.expand('${T}/opkg')
+ opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
+ if opkg_lib_dir[0] == "/":
+ opkg_lib_dir = opkg_lib_dir[1:]
+ temp_opkg_dir = os.path.join(temp_rootfs, opkg_lib_dir, 'opkg')
+ bb.utils.mkdirhier(temp_opkg_dir)
+
+ opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
+ opkg_args += self.d.getVar("OPKG_ARGS")
+
+ cmd = "%s %s update" % (self.opkg_cmd, opkg_args)
+ try:
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to update. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+
+ # Dummy installation
+ cmd = "%s %s --noaction install %s " % (self.opkg_cmd,
+ opkg_args,
+ ' '.join(pkgs))
+ try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to dummy install packages. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+
+ bb.utils.remove(temp_rootfs, True)
+
+ return output
+
+ def backup_packaging_data(self):
+ # Save the opkglib for increment ipk image generation
+ if os.path.exists(self.saved_opkg_dir):
+ bb.utils.remove(self.saved_opkg_dir, True)
+ shutil.copytree(self.opkg_dir,
+ self.saved_opkg_dir,
+ symlinks=True)
+
+ def recover_packaging_data(self):
+ # Move the opkglib back
+ if os.path.exists(self.saved_opkg_dir):
+ if os.path.exists(self.opkg_dir):
+ bb.utils.remove(self.opkg_dir, True)
+
+ bb.note('Recover packaging data')
+ shutil.copytree(self.saved_opkg_dir,
+ self.opkg_dir,
+ symlinks=True)
+
+ def package_info(self, pkg):
+ """
+ Returns a dictionary with the package info.
+ """
+ cmd = "%s %s info %s" % (self.opkg_cmd, self.opkg_args, pkg)
+ pkg_info = super(OpkgPM, self).package_info(pkg, cmd)
+
+ pkg_arch = pkg_info[pkg]["arch"]
+ pkg_filename = pkg_info[pkg]["filename"]
+ pkg_info[pkg]["filepath"] = \
+ os.path.join(self.deploy_dir, pkg_arch, pkg_filename)
+
+ return pkg_info
+
+ def extract(self, pkg):
+ """
+ Returns the path to a tmpdir where resides the contents of a package.
+
+ Deleting the tmpdir is responsability of the caller.
+ """
+ pkg_info = self.package_info(pkg)
+ if not pkg_info:
+ bb.fatal("Unable to get information for package '%s' while "
+ "trying to extract the package." % pkg)
+
+ tmp_dir = super(OpkgPM, self).extract(pkg, pkg_info)
+ bb.utils.remove(os.path.join(tmp_dir, "data.tar.gz"))
+
+ return tmp_dir
+
+class DpkgPM(OpkgDpkgPM):
+ def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None):
+ super(DpkgPM, self).__init__(d, target_rootfs)
+ self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB')
+ if apt_conf_dir is None:
+ self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt")
+ else:
+ self.apt_conf_dir = apt_conf_dir
+ self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
+ self.apt_get_cmd = bb.utils.which(os.getenv('PATH'), "apt-get")
+ self.apt_cache_cmd = bb.utils.which(os.getenv('PATH'), "apt-cache")
+
+ self.apt_args = d.getVar("APT_ARGS")
+
+ self.all_arch_list = archs.split()
+ all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS') or "").split()
+ self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list)
+
+ self._create_configs(archs, base_archs)
+
+ self.indexer = DpkgIndexer(self.d, self.deploy_dir)
+
+ def mark_packages(self, status_tag, packages=None):
+ """
+ This function will change a package's status in /var/lib/dpkg/status file.
+ If 'packages' is None then the new_status will be applied to all
+ packages
+ """
+ status_file = self.target_rootfs + "/var/lib/dpkg/status"
+
+ with open(status_file, "r") as sf:
+ with open(status_file + ".tmp", "w+") as tmp_sf:
+ if packages is None:
+ tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
+ r"Package: \1\n\2Status: \3%s" % status_tag,
+ sf.read()))
+ else:
+ if type(packages).__name__ != "list":
+ raise TypeError("'packages' should be a list object")
+
+ status = sf.read()
+ for pkg in packages:
+ status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
+ r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
+ status)
+
+ tmp_sf.write(status)
+
+ os.rename(status_file + ".tmp", status_file)
+
+ def run_pre_post_installs(self, package_name=None):
+ """
+ Run the pre/post installs for package "package_name". If package_name is
+ None, then run all pre/post install scriptlets.
+ """
+ info_dir = self.target_rootfs + "/var/lib/dpkg/info"
+ ControlScript = collections.namedtuple("ControlScript", ["suffix", "name", "argument"])
+ control_scripts = [
+ ControlScript(".preinst", "Preinstall", "install"),
+ ControlScript(".postinst", "Postinstall", "configure")]
+ status_file = self.target_rootfs + "/var/lib/dpkg/status"
+ installed_pkgs = []
+
+ with open(status_file, "r") as status:
+ for line in status.read().split('\n'):
+ m = re.match("^Package: (.*)", line)
+ if m is not None:
+ installed_pkgs.append(m.group(1))
+
+ if package_name is not None and not package_name in installed_pkgs:
+ return
+
+ os.environ['D'] = self.target_rootfs
+ os.environ['OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+ os.environ['INTERCEPT_DIR'] = self.intercepts_dir
+ os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE')
+
+ failed_pkgs = []
+ for pkg_name in installed_pkgs:
+ for control_script in control_scripts:
+ p_full = os.path.join(info_dir, pkg_name + control_script.suffix)
+ if os.path.exists(p_full):
+ try:
+ bb.note("Executing %s for package: %s ..." %
+ (control_script.name.lower(), pkg_name))
+ output = subprocess.check_output([p_full, control_script.argument],
+ stderr=subprocess.STDOUT).decode("utf-8")
+ bb.note(output)
+ except subprocess.CalledProcessError as e:
+ bb.warn("%s for package %s failed with %d:\n%s" %
+ (control_script.name, pkg_name, e.returncode,
+ e.output.decode("utf-8")))
+ failed_postinsts_warn([pkg_name], self.d.expand("${T}/log.do_${BB_CURRENTTASK}"))
+ failed_pkgs.append(pkg_name)
+ break
+
+ if len(failed_pkgs):
+ self.mark_packages("unpacked", failed_pkgs)
+
+ def update(self):
+ os.environ['APT_CONFIG'] = self.apt_conf_file
+
+ self.deploy_dir_lock()
+
+ cmd = "%s update" % self.apt_get_cmd
+
+ try:
+ subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to update the package index files. Command '%s' "
+ "returned %d:\n%s" % (e.cmd, e.returncode, e.output.decode("utf-8")))
+
+ self.deploy_dir_unlock()
+
+ def install(self, pkgs, attempt_only=False):
+ if attempt_only and len(pkgs) == 0:
+ return
+
+ os.environ['APT_CONFIG'] = self.apt_conf_file
+
+ cmd = "%s %s install --force-yes --allow-unauthenticated %s" % \
+ (self.apt_get_cmd, self.apt_args, ' '.join(pkgs))
+
+ try:
+ bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+ subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
+ "Command '%s' returned %d:\n%s" %
+ (cmd, e.returncode, e.output.decode("utf-8")))
+
+ # rename *.dpkg-new files/dirs
+ for root, dirs, files in os.walk(self.target_rootfs):
+ for dir in dirs:
+ new_dir = re.sub("\.dpkg-new", "", dir)
+ if dir != new_dir:
+ os.rename(os.path.join(root, dir),
+ os.path.join(root, new_dir))
+
+ for file in files:
+ new_file = re.sub("\.dpkg-new", "", file)
+ if file != new_file:
+ os.rename(os.path.join(root, file),
+ os.path.join(root, new_file))
+
+
+ def remove(self, pkgs, with_dependencies=True):
+ if with_dependencies:
+ os.environ['APT_CONFIG'] = self.apt_conf_file
+ cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
+ else:
+ cmd = "%s --admindir=%s/var/lib/dpkg --instdir=%s" \
+ " -P --force-depends %s" % \
+ (bb.utils.which(os.getenv('PATH'), "dpkg"),
+ self.target_rootfs, self.target_rootfs, ' '.join(pkgs))
+
+ try:
+ subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Unable to remove packages. Command '%s' "
+ "returned %d:\n%s" % (e.cmd, e.returncode, e.output.decode("utf-8")))
+
+ def write_index(self):
+ self.deploy_dir_lock()
+
+ result = self.indexer.write_index()
+
+ self.deploy_dir_unlock()
+
+ if result is not None:
+ bb.fatal(result)
+
+ def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
+ if feed_uris == "":
+ return
+
+ sources_conf = os.path.join("%s/etc/apt/sources.list"
+ % self.target_rootfs)
+ arch_list = []
+
+ if feed_archs is None:
+ for arch in self.all_arch_list:
+ if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+ continue
+ arch_list.append(arch)
+ else:
+ arch_list = feed_archs.split()
+
+ feed_uris = self.construct_uris(feed_uris.split(), feed_base_paths.split())
+
+ with open(sources_conf, "w+") as sources_file:
+ for uri in feed_uris:
+ if arch_list:
+ for arch in arch_list:
+ bb.note('Adding dpkg channel at (%s)' % uri)
+ sources_file.write("deb %s/%s ./\n" %
+ (uri, arch))
+ else:
+ bb.note('Adding dpkg channel at (%s)' % uri)
+ sources_file.write("deb %s ./\n" % uri)
+
+ def _create_configs(self, archs, base_archs):
+ base_archs = re.sub("_", "-", base_archs)
+
+ if os.path.exists(self.apt_conf_dir):
+ bb.utils.remove(self.apt_conf_dir, True)
+
+ bb.utils.mkdirhier(self.apt_conf_dir)
+ bb.utils.mkdirhier(self.apt_conf_dir + "/lists/partial/")
+ bb.utils.mkdirhier(self.apt_conf_dir + "/apt.conf.d/")
+ bb.utils.mkdirhier(self.apt_conf_dir + "/preferences.d/")
+
+ arch_list = []
+ for arch in self.all_arch_list:
+ if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+ continue
+ arch_list.append(arch)
+
+ with open(os.path.join(self.apt_conf_dir, "preferences"), "w+") as prefs_file:
+ priority = 801
+ for arch in arch_list:
+ prefs_file.write(
+ "Package: *\n"
+ "Pin: release l=%s\n"
+ "Pin-Priority: %d\n\n" % (arch, priority))
+
+ priority += 5
+
+ pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE') or ""
+ for pkg in pkg_exclude.split():
+ prefs_file.write(
+ "Package: %s\n"
+ "Pin: release *\n"
+ "Pin-Priority: -1\n\n" % pkg)
+
+ arch_list.reverse()
+
+ with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file:
+ for arch in arch_list:
+ sources_file.write("deb file:%s/ ./\n" %
+ os.path.join(self.deploy_dir, arch))
+
+ base_arch_list = base_archs.split()
+ multilib_variants = self.d.getVar("MULTILIB_VARIANTS");
+ for variant in multilib_variants.split():
+ localdata = bb.data.createCopy(self.d)
+ variant_tune = localdata.getVar("DEFAULTTUNE_virtclass-multilib-" + variant, False)
+ orig_arch = localdata.getVar("DPKG_ARCH")
+ localdata.setVar("DEFAULTTUNE", variant_tune)
+ variant_arch = localdata.getVar("DPKG_ARCH")
+ if variant_arch not in base_arch_list:
+ base_arch_list.append(variant_arch)
+
+ with open(self.apt_conf_file, "w+") as apt_conf:
+ with open(self.d.expand("${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample")) as apt_conf_sample:
+ for line in apt_conf_sample.read().split("\n"):
+ match_arch = re.match(" Architecture \".*\";$", line)
+ architectures = ""
+ if match_arch:
+ for base_arch in base_arch_list:
+ architectures += "\"%s\";" % base_arch
+ apt_conf.write(" Architectures {%s};\n" % architectures);
+ apt_conf.write(" Architecture \"%s\";\n" % base_archs)
+ else:
+ line = re.sub("#ROOTFS#", self.target_rootfs, line)
+ line = re.sub("#APTCONF#", self.apt_conf_dir, line)
+ apt_conf.write(line + "\n")
+
+ target_dpkg_dir = "%s/var/lib/dpkg" % self.target_rootfs
+ bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "info"))
+
+ bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "updates"))
+
+ if not os.path.exists(os.path.join(target_dpkg_dir, "status")):
+ open(os.path.join(target_dpkg_dir, "status"), "w+").close()
+ if not os.path.exists(os.path.join(target_dpkg_dir, "available")):
+ open(os.path.join(target_dpkg_dir, "available"), "w+").close()
+
+ def remove_packaging_data(self):
+ bb.utils.remove(os.path.join(self.target_rootfs,
+ self.d.getVar('opkglibdir')), True)
+ bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True)
+
+ def fix_broken_dependencies(self):
+ os.environ['APT_CONFIG'] = self.apt_conf_file
+
+ cmd = "%s %s -f install" % (self.apt_get_cmd, self.apt_args)
+
+ try:
+ subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Cannot fix broken dependencies. Command '%s' "
+ "returned %d:\n%s" % (cmd, e.returncode, e.output.decode("utf-8")))
+
+ def list_installed(self):
+ return DpkgPkgsList(self.d, self.target_rootfs).list_pkgs()
+
+ def package_info(self, pkg):
+ """
+ Returns a dictionary with the package info.
+ """
+ cmd = "%s show %s" % (self.apt_cache_cmd, pkg)
+ pkg_info = super(DpkgPM, self).package_info(pkg, cmd)
+
+ pkg_arch = pkg_info[pkg]["pkgarch"]
+ pkg_filename = pkg_info[pkg]["filename"]
+ pkg_info[pkg]["filepath"] = \
+ os.path.join(self.deploy_dir, pkg_arch, pkg_filename)
+
+ return pkg_info
+
+ def extract(self, pkg):
+ """
+ Returns the path to a tmpdir where resides the contents of a package.
+
+ Deleting the tmpdir is responsability of the caller.
+ """
+ pkg_info = self.package_info(pkg)
+ if not pkg_info:
+ bb.fatal("Unable to get information for package '%s' while "
+ "trying to extract the package." % pkg)
+
+ tmp_dir = super(DpkgPM, self).extract(pkg, pkg_info)
+ bb.utils.remove(os.path.join(tmp_dir, "data.tar.xz"))
+
+ return tmp_dir
+
+def generate_index_files(d):
+ classes = d.getVar('PACKAGE_CLASSES').replace("package_", "").split()
+
+ indexer_map = {
+ "rpm": (RpmSubdirIndexer, d.getVar('DEPLOY_DIR_RPM')),
+ "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK')),
+ "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB'))
+ }
+
+ result = None
+
+ for pkg_class in classes:
+ if not pkg_class in indexer_map:
+ continue
+
+ if os.path.exists(indexer_map[pkg_class][1]):
+ result = indexer_map[pkg_class][0](d, indexer_map[pkg_class][1]).write_index()
+
+ if result is not None:
+ bb.fatal(result)
diff --git a/poky/meta/lib/oe/packagedata.py b/poky/meta/lib/oe/packagedata.py
new file mode 100644
index 000000000..32e5c82a9
--- /dev/null
+++ b/poky/meta/lib/oe/packagedata.py
@@ -0,0 +1,95 @@
+import codecs
+import os
+
+def packaged(pkg, d):
+ return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
+
+def read_pkgdatafile(fn):
+ pkgdata = {}
+
+ def decode(str):
+ c = codecs.getdecoder("unicode_escape")
+ return c(str)[0]
+
+ if os.access(fn, os.R_OK):
+ import re
+ f = open(fn, 'r')
+ lines = f.readlines()
+ f.close()
+ r = re.compile("([^:]+):\s*(.*)")
+ for l in lines:
+ m = r.match(l)
+ if m:
+ pkgdata[m.group(1)] = decode(m.group(2))
+
+ return pkgdata
+
+def get_subpkgedata_fn(pkg, d):
+ return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+
+def has_subpkgdata(pkg, d):
+ return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
+
+def read_subpkgdata(pkg, d):
+ return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+
+def has_pkgdata(pn, d):
+ fn = d.expand('${PKGDATA_DIR}/%s' % pn)
+ return os.access(fn, os.R_OK)
+
+def read_pkgdata(pn, d):
+ fn = d.expand('${PKGDATA_DIR}/%s' % pn)
+ return read_pkgdatafile(fn)
+
+#
+# Collapse FOO_pkg variables into FOO
+#
+def read_subpkgdata_dict(pkg, d):
+ ret = {}
+ subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+ for var in subd:
+ newvar = var.replace("_" + pkg, "")
+ if newvar == var and var + "_" + pkg in subd:
+ continue
+ ret[newvar] = subd[var]
+ return ret
+
+def _pkgmap(d):
+ """Return a dictionary mapping package to recipe name."""
+
+ pkgdatadir = d.getVar("PKGDATA_DIR")
+
+ pkgmap = {}
+ try:
+ files = os.listdir(pkgdatadir)
+ except OSError:
+ bb.warn("No files in %s?" % pkgdatadir)
+ files = []
+
+ for pn in [f for f in files if not os.path.isdir(os.path.join(pkgdatadir, f))]:
+ try:
+ pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
+ except OSError:
+ continue
+
+ packages = pkgdata.get("PACKAGES") or ""
+ for pkg in packages.split():
+ pkgmap[pkg] = pn
+
+ return pkgmap
+
+def pkgmap(d):
+ """Return a dictionary mapping package to recipe name.
+ Cache the mapping in the metadata"""
+
+ pkgmap_data = d.getVar("__pkgmap_data", False)
+ if pkgmap_data is None:
+ pkgmap_data = _pkgmap(d)
+ d.setVar("__pkgmap_data", pkgmap_data)
+
+ return pkgmap_data
+
+def recipename(pkg, d):
+ """Return the recipe name for the given binary package name."""
+
+ return pkgmap(d).get(pkg)
diff --git a/poky/meta/lib/oe/packagegroup.py b/poky/meta/lib/oe/packagegroup.py
new file mode 100644
index 000000000..4bc5d3e4b
--- /dev/null
+++ b/poky/meta/lib/oe/packagegroup.py
@@ -0,0 +1,36 @@
+import itertools
+
+def is_optional(feature, d):
+ packages = d.getVar("FEATURE_PACKAGES_%s" % feature)
+ if packages:
+ return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional"))
+ else:
+ return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional"))
+
+def packages(features, d):
+ for feature in features:
+ packages = d.getVar("FEATURE_PACKAGES_%s" % feature)
+ if not packages:
+ packages = d.getVar("PACKAGE_GROUP_%s" % feature)
+ for pkg in (packages or "").split():
+ yield pkg
+
+def required_packages(features, d):
+ req = [feature for feature in features if not is_optional(feature, d)]
+ return packages(req, d)
+
+def optional_packages(features, d):
+ opt = [feature for feature in features if is_optional(feature, d)]
+ return packages(opt, d)
+
+def active_packages(features, d):
+ return itertools.chain(required_packages(features, d),
+ optional_packages(features, d))
+
+def active_recipes(features, d):
+ import oe.packagedata
+
+ for pkg in active_packages(features, d):
+ recipe = oe.packagedata.recipename(pkg, d)
+ if recipe:
+ yield recipe
diff --git a/poky/meta/lib/oe/patch.py b/poky/meta/lib/oe/patch.py
new file mode 100644
index 000000000..af7aa5235
--- /dev/null
+++ b/poky/meta/lib/oe/patch.py
@@ -0,0 +1,895 @@
+import oe.path
+import oe.types
+
+class NotFoundError(bb.BBHandledException):
+ def __init__(self, path):
+ self.path = path
+
+ def __str__(self):
+ return "Error: %s not found." % self.path
+
+class CmdError(bb.BBHandledException):
+ def __init__(self, command, exitstatus, output):
+ self.command = command
+ self.status = exitstatus
+ self.output = output
+
+ def __str__(self):
+ return "Command Error: '%s' exited with %d Output:\n%s" % \
+ (self.command, self.status, self.output)
+
+
+def runcmd(args, dir = None):
+ import pipes
+
+ if dir:
+ olddir = os.path.abspath(os.curdir)
+ if not os.path.exists(dir):
+ raise NotFoundError(dir)
+ os.chdir(dir)
+ # print("cwd: %s -> %s" % (olddir, dir))
+
+ try:
+ args = [ pipes.quote(str(arg)) for arg in args ]
+ cmd = " ".join(args)
+ # print("cmd: %s" % cmd)
+ (exitstatus, output) = oe.utils.getstatusoutput(cmd)
+ if exitstatus != 0:
+ raise CmdError(cmd, exitstatus >> 8, output)
+ if " fuzz " in output:
+ bb.warn("""
+Some of the context lines in patches were ignored. This can lead to incorrectly applied patches.
+The context lines in the patches can be updated with devtool:
+
+ devtool modify <recipe>
+ devtool finish --force-patch-refresh <recipe> <layer_path>
+
+Then the updated patches and the source tree (in devtool's workspace)
+should be reviewed to make sure the patches apply in the correct place
+and don't introduce duplicate lines (which can, and does happen
+when some of the context is ignored). Further information:
+http://lists.openembedded.org/pipermail/openembedded-core/2018-March/148675.html
+https://bugzilla.yoctoproject.org/show_bug.cgi?id=10450
+Details:
+{}""".format(output))
+ return output
+
+ finally:
+ if dir:
+ os.chdir(olddir)
+
+class PatchError(Exception):
+ def __init__(self, msg):
+ self.msg = msg
+
+ def __str__(self):
+ return "Patch Error: %s" % self.msg
+
+class PatchSet(object):
+ defaults = {
+ "strippath": 1
+ }
+
+ def __init__(self, dir, d):
+ self.dir = dir
+ self.d = d
+ self.patches = []
+ self._current = None
+
+ def current(self):
+ return self._current
+
+ def Clean(self):
+ """
+ Clean out the patch set. Generally includes unapplying all
+ patches and wiping out all associated metadata.
+ """
+ raise NotImplementedError()
+
+ def Import(self, patch, force):
+ if not patch.get("file"):
+ if not patch.get("remote"):
+ raise PatchError("Patch file must be specified in patch import.")
+ else:
+ patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+
+ for param in PatchSet.defaults:
+ if not patch.get(param):
+ patch[param] = PatchSet.defaults[param]
+
+ if patch.get("remote"):
+ patch["file"] = self.d.expand(bb.fetch2.localpath(patch["remote"], self.d))
+
+ patch["filemd5"] = bb.utils.md5_file(patch["file"])
+
+ def Push(self, force):
+ raise NotImplementedError()
+
+ def Pop(self, force):
+ raise NotImplementedError()
+
+ def Refresh(self, remote = None, all = None):
+ raise NotImplementedError()
+
+ @staticmethod
+ def getPatchedFiles(patchfile, striplevel, srcdir=None):
+ """
+ Read a patch file and determine which files it will modify.
+ Params:
+ patchfile: the patch file to read
+ striplevel: the strip level at which the patch is going to be applied
+ srcdir: optional path to join onto the patched file paths
+ Returns:
+ A list of tuples of file path and change mode ('A' for add,
+ 'D' for delete or 'M' for modify)
+ """
+
+ def patchedpath(patchline):
+ filepth = patchline.split()[1]
+ if filepth.endswith('/dev/null'):
+ return '/dev/null'
+ filesplit = filepth.split(os.sep)
+ if striplevel > len(filesplit):
+ bb.error('Patch %s has invalid strip level %d' % (patchfile, striplevel))
+ return None
+ return os.sep.join(filesplit[striplevel:])
+
+ for encoding in ['utf-8', 'latin-1']:
+ try:
+ copiedmode = False
+ filelist = []
+ with open(patchfile) as f:
+ for line in f:
+ if line.startswith('--- '):
+ patchpth = patchedpath(line)
+ if not patchpth:
+ break
+ if copiedmode:
+ addedfile = patchpth
+ else:
+ removedfile = patchpth
+ elif line.startswith('+++ '):
+ addedfile = patchedpath(line)
+ if not addedfile:
+ break
+ elif line.startswith('*** '):
+ copiedmode = True
+ removedfile = patchedpath(line)
+ if not removedfile:
+ break
+ else:
+ removedfile = None
+ addedfile = None
+
+ if addedfile and removedfile:
+ if removedfile == '/dev/null':
+ mode = 'A'
+ elif addedfile == '/dev/null':
+ mode = 'D'
+ else:
+ mode = 'M'
+ if srcdir:
+ fullpath = os.path.abspath(os.path.join(srcdir, addedfile))
+ else:
+ fullpath = addedfile
+ filelist.append((fullpath, mode))
+ except UnicodeDecodeError:
+ continue
+ break
+ else:
+ raise PatchError('Unable to decode %s' % patchfile)
+
+ return filelist
+
+
+class PatchTree(PatchSet):
+ def __init__(self, dir, d):
+ PatchSet.__init__(self, dir, d)
+ self.patchdir = os.path.join(self.dir, 'patches')
+ self.seriespath = os.path.join(self.dir, 'patches', 'series')
+ bb.utils.mkdirhier(self.patchdir)
+
+ def _appendPatchFile(self, patch, strippath):
+ with open(self.seriespath, 'a') as f:
+ f.write(os.path.basename(patch) + "," + strippath + "\n")
+ shellcmd = ["cat", patch, ">" , self.patchdir + "/" + os.path.basename(patch)]
+ runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+ def _removePatch(self, p):
+ patch = {}
+ patch['file'] = p.split(",")[0]
+ patch['strippath'] = p.split(",")[1]
+ self._applypatch(patch, False, True)
+
+ def _removePatchFile(self, all = False):
+ if not os.path.exists(self.seriespath):
+ return
+ with open(self.seriespath, 'r+') as f:
+ patches = f.readlines()
+ if all:
+ for p in reversed(patches):
+ self._removePatch(os.path.join(self.patchdir, p.strip()))
+ patches = []
+ else:
+ self._removePatch(os.path.join(self.patchdir, patches[-1].strip()))
+ patches.pop()
+ with open(self.seriespath, 'w') as f:
+ for p in patches:
+ f.write(p)
+
+ def Import(self, patch, force = None):
+ """"""
+ PatchSet.Import(self, patch, force)
+
+ if self._current is not None:
+ i = self._current + 1
+ else:
+ i = 0
+ self.patches.insert(i, patch)
+
+ def _applypatch(self, patch, force = False, reverse = False, run = True):
+ shellcmd = ["cat", patch['file'], "|", "patch", "--no-backup-if-mismatch", "-p", patch['strippath']]
+ if reverse:
+ shellcmd.append('-R')
+
+ if not run:
+ return "sh" + "-c" + " ".join(shellcmd)
+
+ if not force:
+ shellcmd.append('--dry-run')
+
+ try:
+ output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+ if force:
+ return
+
+ shellcmd.pop(len(shellcmd) - 1)
+ output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ except CmdError as err:
+ raise bb.BBHandledException("Applying '%s' failed:\n%s" %
+ (os.path.basename(patch['file']), err.output))
+
+ if not reverse:
+ self._appendPatchFile(patch['file'], patch['strippath'])
+
+ return output
+
+ def Push(self, force = False, all = False, run = True):
+ bb.note("self._current is %s" % self._current)
+ bb.note("patches is %s" % self.patches)
+ if all:
+ for i in self.patches:
+ bb.note("applying patch %s" % i)
+ self._applypatch(i, force)
+ self._current = i
+ else:
+ if self._current is not None:
+ next = self._current + 1
+ else:
+ next = 0
+
+ bb.note("applying patch %s" % self.patches[next])
+ ret = self._applypatch(self.patches[next], force)
+
+ self._current = next
+ return ret
+
+ def Pop(self, force = None, all = None):
+ if all:
+ self._removePatchFile(True)
+ self._current = None
+ else:
+ self._removePatchFile(False)
+
+ if self._current == 0:
+ self._current = None
+
+ if self._current is not None:
+ self._current = self._current - 1
+
+ def Clean(self):
+ """"""
+ self.Pop(all=True)
+
+class GitApplyTree(PatchTree):
+ patch_line_prefix = '%% original patch'
+ ignore_commit_prefix = '%% ignore'
+
+ def __init__(self, dir, d):
+ PatchTree.__init__(self, dir, d)
+ self.commituser = d.getVar('PATCH_GIT_USER_NAME')
+ self.commitemail = d.getVar('PATCH_GIT_USER_EMAIL')
+
+ @staticmethod
+ def extractPatchHeader(patchfile):
+ """
+ Extract just the header lines from the top of a patch file
+ """
+ for encoding in ['utf-8', 'latin-1']:
+ lines = []
+ try:
+ with open(patchfile, 'r', encoding=encoding) as f:
+ for line in f:
+ if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('---'):
+ break
+ lines.append(line)
+ except UnicodeDecodeError:
+ continue
+ break
+ else:
+ raise PatchError('Unable to find a character encoding to decode %s' % patchfile)
+ return lines
+
+ @staticmethod
+ def decodeAuthor(line):
+ from email.header import decode_header
+ authorval = line.split(':', 1)[1].strip().replace('"', '')
+ result = decode_header(authorval)[0][0]
+ if hasattr(result, 'decode'):
+ result = result.decode('utf-8')
+ return result
+
+ @staticmethod
+ def interpretPatchHeader(headerlines):
+ import re
+ author_re = re.compile('[\S ]+ <\S+@\S+\.\S+>')
+ from_commit_re = re.compile('^From [a-z0-9]{40} .*')
+ outlines = []
+ author = None
+ date = None
+ subject = None
+ for line in headerlines:
+ if line.startswith('Subject: '):
+ subject = line.split(':', 1)[1]
+ # Remove any [PATCH][oe-core] etc.
+ subject = re.sub(r'\[.+?\]\s*', '', subject)
+ continue
+ elif line.startswith('From: ') or line.startswith('Author: '):
+ authorval = GitApplyTree.decodeAuthor(line)
+ # git is fussy about author formatting i.e. it must be Name <email@domain>
+ if author_re.match(authorval):
+ author = authorval
+ continue
+ elif line.startswith('Date: '):
+ if date is None:
+ dateval = line.split(':', 1)[1].strip()
+ # Very crude check for date format, since git will blow up if it's not in the right
+ # format. Without e.g. a python-dateutils dependency we can't do a whole lot more
+ if len(dateval) > 12:
+ date = dateval
+ continue
+ elif not author and line.lower().startswith('signed-off-by: '):
+ authorval = GitApplyTree.decodeAuthor(line)
+ # git is fussy about author formatting i.e. it must be Name <email@domain>
+ if author_re.match(authorval):
+ author = authorval
+ elif from_commit_re.match(line):
+ # We don't want the From <commit> line - if it's present it will break rebasing
+ continue
+ outlines.append(line)
+
+ if not subject:
+ firstline = None
+ for line in headerlines:
+ line = line.strip()
+ if firstline:
+ if line:
+ # Second line is not blank, the first line probably isn't usable
+ firstline = None
+ break
+ elif line:
+ firstline = line
+ if firstline and not firstline.startswith(('#', 'Index:', 'Upstream-Status:')) and len(firstline) < 100:
+ subject = firstline
+
+ return outlines, author, date, subject
+
+ @staticmethod
+ def gitCommandUserOptions(cmd, commituser=None, commitemail=None, d=None):
+ if d:
+ commituser = d.getVar('PATCH_GIT_USER_NAME')
+ commitemail = d.getVar('PATCH_GIT_USER_EMAIL')
+ if commituser:
+ cmd += ['-c', 'user.name="%s"' % commituser]
+ if commitemail:
+ cmd += ['-c', 'user.email="%s"' % commitemail]
+
+ @staticmethod
+ def prepareCommit(patchfile, commituser=None, commitemail=None):
+ """
+ Prepare a git commit command line based on the header from a patch file
+ (typically this is useful for patches that cannot be applied with "git am" due to formatting)
+ """
+ import tempfile
+ # Process patch header and extract useful information
+ lines = GitApplyTree.extractPatchHeader(patchfile)
+ outlines, author, date, subject = GitApplyTree.interpretPatchHeader(lines)
+ if not author or not subject or not date:
+ try:
+ shellcmd = ["git", "log", "--format=email", "--follow", "--diff-filter=A", "--", patchfile]
+ out = runcmd(["sh", "-c", " ".join(shellcmd)], os.path.dirname(patchfile))
+ except CmdError:
+ out = None
+ if out:
+ _, newauthor, newdate, newsubject = GitApplyTree.interpretPatchHeader(out.splitlines())
+ if not author:
+ # If we're setting the author then the date should be set as well
+ author = newauthor
+ date = newdate
+ elif not date:
+ # If we don't do this we'll get the current date, at least this will be closer
+ date = newdate
+ if not subject:
+ subject = newsubject
+ if subject and outlines and not outlines[0].strip() == subject:
+ outlines.insert(0, '%s\n\n' % subject.strip())
+
+ # Write out commit message to a file
+ with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+ tmpfile = tf.name
+ for line in outlines:
+ tf.write(line)
+ # Prepare git command
+ cmd = ["git"]
+ GitApplyTree.gitCommandUserOptions(cmd, commituser, commitemail)
+ cmd += ["commit", "-F", tmpfile]
+ # git doesn't like plain email addresses as authors
+ if author and '<' in author:
+ cmd.append('--author="%s"' % author)
+ if date:
+ cmd.append('--date="%s"' % date)
+ return (tmpfile, cmd)
+
+ @staticmethod
+ def extractPatches(tree, startcommit, outdir, paths=None):
+ import tempfile
+ import shutil
+ import re
+ tempdir = tempfile.mkdtemp(prefix='oepatch')
+ try:
+ shellcmd = ["git", "format-patch", "--no-signature", "--no-numbered", startcommit, "-o", tempdir]
+ if paths:
+ shellcmd.append('--')
+ shellcmd.extend(paths)
+ out = runcmd(["sh", "-c", " ".join(shellcmd)], tree)
+ if out:
+ for srcfile in out.split():
+ for encoding in ['utf-8', 'latin-1']:
+ patchlines = []
+ outfile = None
+ try:
+ with open(srcfile, 'r', encoding=encoding) as f:
+ for line in f:
+ checkline = line
+ if checkline.startswith('Subject: '):
+ checkline = re.sub(r'\[.+?\]\s*', '', checkline[9:])
+ if checkline.startswith(GitApplyTree.patch_line_prefix):
+ outfile = line.split()[-1].strip()
+ continue
+ if checkline.startswith(GitApplyTree.ignore_commit_prefix):
+ continue
+ patchlines.append(line)
+ except UnicodeDecodeError:
+ continue
+ break
+ else:
+ raise PatchError('Unable to find a character encoding to decode %s' % srcfile)
+
+ if not outfile:
+ outfile = os.path.basename(srcfile)
+ with open(os.path.join(outdir, outfile), 'w') as of:
+ for line in patchlines:
+ of.write(line)
+ finally:
+ shutil.rmtree(tempdir)
+
+ def _applypatch(self, patch, force = False, reverse = False, run = True):
+ import shutil
+
+ def _applypatchhelper(shellcmd, patch, force = False, reverse = False, run = True):
+ if reverse:
+ shellcmd.append('-R')
+
+ shellcmd.append(patch['file'])
+
+ if not run:
+ return "sh" + "-c" + " ".join(shellcmd)
+
+ return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+ # Add hooks which add a pointer to the original patch file name in the commit message
+ reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
+ if not reporoot:
+ raise Exception("Cannot get repository root for directory %s" % self.dir)
+ hooks_dir = os.path.join(reporoot, '.git', 'hooks')
+ hooks_dir_backup = hooks_dir + '.devtool-orig'
+ if os.path.lexists(hooks_dir_backup):
+ raise Exception("Git hooks backup directory already exists: %s" % hooks_dir_backup)
+ if os.path.lexists(hooks_dir):
+ shutil.move(hooks_dir, hooks_dir_backup)
+ os.mkdir(hooks_dir)
+ commithook = os.path.join(hooks_dir, 'commit-msg')
+ applyhook = os.path.join(hooks_dir, 'applypatch-msg')
+ with open(commithook, 'w') as f:
+ # NOTE: the formatting here is significant; if you change it you'll also need to
+ # change other places which read it back
+ f.write('echo >> $1\n')
+ f.write('echo "%s: $PATCHFILE" >> $1\n' % GitApplyTree.patch_line_prefix)
+ os.chmod(commithook, 0o755)
+ shutil.copy2(commithook, applyhook)
+ try:
+ patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file'])
+ try:
+ shellcmd = [patchfilevar, "git", "--work-tree=%s" % reporoot]
+ self.gitCommandUserOptions(shellcmd, self.commituser, self.commitemail)
+ shellcmd += ["am", "-3", "--keep-cr", "-p%s" % patch['strippath']]
+ return _applypatchhelper(shellcmd, patch, force, reverse, run)
+ except CmdError:
+ # Need to abort the git am, or we'll still be within it at the end
+ try:
+ shellcmd = ["git", "--work-tree=%s" % reporoot, "am", "--abort"]
+ runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ except CmdError:
+ pass
+ # git am won't always clean up after itself, sadly, so...
+ shellcmd = ["git", "--work-tree=%s" % reporoot, "reset", "--hard", "HEAD"]
+ runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ # Also need to take care of any stray untracked files
+ shellcmd = ["git", "--work-tree=%s" % reporoot, "clean", "-f"]
+ runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+ # Fall back to git apply
+ shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']]
+ try:
+ output = _applypatchhelper(shellcmd, patch, force, reverse, run)
+ except CmdError:
+ # Fall back to patch
+ output = PatchTree._applypatch(self, patch, force, reverse, run)
+ # Add all files
+ shellcmd = ["git", "add", "-f", "-A", "."]
+ output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ # Exclude the patches directory
+ shellcmd = ["git", "reset", "HEAD", self.patchdir]
+ output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ # Commit the result
+ (tmpfile, shellcmd) = self.prepareCommit(patch['file'], self.commituser, self.commitemail)
+ try:
+ shellcmd.insert(0, patchfilevar)
+ output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+ finally:
+ os.remove(tmpfile)
+ return output
+ finally:
+ shutil.rmtree(hooks_dir)
+ if os.path.lexists(hooks_dir_backup):
+ shutil.move(hooks_dir_backup, hooks_dir)
+
+
+class QuiltTree(PatchSet):
+ def _runcmd(self, args, run = True):
+ quiltrc = self.d.getVar('QUILTRCFILE')
+ if not run:
+ return ["quilt"] + ["--quiltrc"] + [quiltrc] + args
+ runcmd(["quilt"] + ["--quiltrc"] + [quiltrc] + args, self.dir)
+
+ def _quiltpatchpath(self, file):
+ return os.path.join(self.dir, "patches", os.path.basename(file))
+
+
+ def __init__(self, dir, d):
+ PatchSet.__init__(self, dir, d)
+ self.initialized = False
+ p = os.path.join(self.dir, 'patches')
+ if not os.path.exists(p):
+ os.makedirs(p)
+
+ def Clean(self):
+ try:
+ self._runcmd(["pop", "-a", "-f"])
+ oe.path.remove(os.path.join(self.dir, "patches","series"))
+ except Exception:
+ pass
+ self.initialized = True
+
+ def InitFromDir(self):
+ # read series -> self.patches
+ seriespath = os.path.join(self.dir, 'patches', 'series')
+ if not os.path.exists(self.dir):
+ raise NotFoundError(self.dir)
+ if os.path.exists(seriespath):
+ with open(seriespath, 'r') as f:
+ for line in f.readlines():
+ patch = {}
+ parts = line.strip().split()
+ patch["quiltfile"] = self._quiltpatchpath(parts[0])
+ patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
+ if len(parts) > 1:
+ patch["strippath"] = parts[1][2:]
+ self.patches.append(patch)
+
+ # determine which patches are applied -> self._current
+ try:
+ output = runcmd(["quilt", "applied"], self.dir)
+ except CmdError:
+ import sys
+ if sys.exc_value.output.strip() == "No patches applied":
+ return
+ else:
+ raise
+ output = [val for val in output.split('\n') if not val.startswith('#')]
+ for patch in self.patches:
+ if os.path.basename(patch["quiltfile"]) == output[-1]:
+ self._current = self.patches.index(patch)
+ self.initialized = True
+
+ def Import(self, patch, force = None):
+ if not self.initialized:
+ self.InitFromDir()
+ PatchSet.Import(self, patch, force)
+ oe.path.symlink(patch["file"], self._quiltpatchpath(patch["file"]), force=True)
+ with open(os.path.join(self.dir, "patches", "series"), "a") as f:
+ f.write(os.path.basename(patch["file"]) + " -p" + patch["strippath"] + "\n")
+ patch["quiltfile"] = self._quiltpatchpath(patch["file"])
+ patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
+
+ # TODO: determine if the file being imported:
+ # 1) is already imported, and is the same
+ # 2) is already imported, but differs
+
+ self.patches.insert(self._current or 0, patch)
+
+
+ def Push(self, force = False, all = False, run = True):
+ # quilt push [-f]
+
+ args = ["push"]
+ if force:
+ args.append("-f")
+ if all:
+ args.append("-a")
+ if not run:
+ return self._runcmd(args, run)
+
+ self._runcmd(args)
+
+ if self._current is not None:
+ self._current = self._current + 1
+ else:
+ self._current = 0
+
+ def Pop(self, force = None, all = None):
+ # quilt pop [-f]
+ args = ["pop"]
+ if force:
+ args.append("-f")
+ if all:
+ args.append("-a")
+
+ self._runcmd(args)
+
+ if self._current == 0:
+ self._current = None
+
+ if self._current is not None:
+ self._current = self._current - 1
+
+ def Refresh(self, **kwargs):
+ if kwargs.get("remote"):
+ patch = self.patches[kwargs["patch"]]
+ if not patch:
+ raise PatchError("No patch found at index %s in patchset." % kwargs["patch"])
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(patch["remote"])
+ if type == "file":
+ import shutil
+ if not patch.get("file") and patch.get("remote"):
+ patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+
+ shutil.copyfile(patch["quiltfile"], patch["file"])
+ else:
+ raise PatchError("Unable to do a remote refresh of %s, unsupported remote url scheme %s." % (os.path.basename(patch["quiltfile"]), type))
+ else:
+ # quilt refresh
+ args = ["refresh"]
+ if kwargs.get("quiltfile"):
+ args.append(os.path.basename(kwargs["quiltfile"]))
+ elif kwargs.get("patch"):
+ args.append(os.path.basename(self.patches[kwargs["patch"]]["quiltfile"]))
+ self._runcmd(args)
+
+class Resolver(object):
+ def __init__(self, patchset, terminal):
+ raise NotImplementedError()
+
+ def Resolve(self):
+ raise NotImplementedError()
+
+ def Revert(self):
+ raise NotImplementedError()
+
+ def Finalize(self):
+ raise NotImplementedError()
+
+class NOOPResolver(Resolver):
+ def __init__(self, patchset, terminal):
+ self.patchset = patchset
+ self.terminal = terminal
+
+ def Resolve(self):
+ olddir = os.path.abspath(os.curdir)
+ os.chdir(self.patchset.dir)
+ try:
+ self.patchset.Push()
+ except Exception:
+ import sys
+ os.chdir(olddir)
+ raise
+
+# Patch resolver which relies on the user doing all the work involved in the
+# resolution, with the exception of refreshing the remote copy of the patch
+# files (the urls).
+class UserResolver(Resolver):
+ def __init__(self, patchset, terminal):
+ self.patchset = patchset
+ self.terminal = terminal
+
+ # Force a push in the patchset, then drop to a shell for the user to
+ # resolve any rejected hunks
+ def Resolve(self):
+ olddir = os.path.abspath(os.curdir)
+ os.chdir(self.patchset.dir)
+ try:
+ self.patchset.Push(False)
+ except CmdError as v:
+ # Patch application failed
+ patchcmd = self.patchset.Push(True, False, False)
+
+ t = self.patchset.d.getVar('T')
+ if not t:
+ bb.msg.fatal("Build", "T not set")
+ bb.utils.mkdirhier(t)
+ import random
+ rcfile = "%s/bashrc.%s.%s" % (t, str(os.getpid()), random.random())
+ with open(rcfile, "w") as f:
+ f.write("echo '*** Manual patch resolution mode ***'\n")
+ f.write("echo 'Dropping to a shell, so patch rejects can be fixed manually.'\n")
+ f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n")
+ f.write("echo ''\n")
+ f.write(" ".join(patchcmd) + "\n")
+ os.chmod(rcfile, 0o775)
+
+ self.terminal("bash --rcfile " + rcfile, 'Patch Rejects: Please fix patch rejects manually', self.patchset.d)
+
+ # Construct a new PatchSet after the user's changes, compare the
+ # sets, checking patches for modifications, and doing a remote
+ # refresh on each.
+ oldpatchset = self.patchset
+ self.patchset = oldpatchset.__class__(self.patchset.dir, self.patchset.d)
+
+ for patch in self.patchset.patches:
+ oldpatch = None
+ for opatch in oldpatchset.patches:
+ if opatch["quiltfile"] == patch["quiltfile"]:
+ oldpatch = opatch
+
+ if oldpatch:
+ patch["remote"] = oldpatch["remote"]
+ if patch["quiltfile"] == oldpatch["quiltfile"]:
+ if patch["quiltfilemd5"] != oldpatch["quiltfilemd5"]:
+ bb.note("Patch %s has changed, updating remote url %s" % (os.path.basename(patch["quiltfile"]), patch["remote"]))
+ # user change? remote refresh
+ self.patchset.Refresh(remote=True, patch=self.patchset.patches.index(patch))
+ else:
+ # User did not fix the problem. Abort.
+ raise PatchError("Patch application failed, and user did not fix and refresh the patch.")
+ except Exception:
+ os.chdir(olddir)
+ raise
+ os.chdir(olddir)
+
+
+def patch_path(url, fetch, workdir, expand=True):
+ """Return the local path of a patch, or None if this isn't a patch"""
+
+ local = fetch.localpath(url)
+ base, ext = os.path.splitext(os.path.basename(local))
+ if ext in ('.gz', '.bz2', '.xz', '.Z'):
+ if expand:
+ local = os.path.join(workdir, base)
+ ext = os.path.splitext(base)[1]
+
+ urldata = fetch.ud[url]
+ if "apply" in urldata.parm:
+ apply = oe.types.boolean(urldata.parm["apply"])
+ if not apply:
+ return
+ elif ext not in (".diff", ".patch"):
+ return
+
+ return local
+
+def src_patches(d, all=False, expand=True):
+ workdir = d.getVar('WORKDIR')
+ fetch = bb.fetch2.Fetch([], d)
+ patches = []
+ sources = []
+ for url in fetch.urls:
+ local = patch_path(url, fetch, workdir, expand)
+ if not local:
+ if all:
+ local = fetch.localpath(url)
+ sources.append(local)
+ continue
+
+ urldata = fetch.ud[url]
+ parm = urldata.parm
+ patchname = parm.get('pname') or os.path.basename(local)
+
+ apply, reason = should_apply(parm, d)
+ if not apply:
+ if reason:
+ bb.note("Patch %s %s" % (patchname, reason))
+ continue
+
+ patchparm = {'patchname': patchname}
+ if "striplevel" in parm:
+ striplevel = parm["striplevel"]
+ elif "pnum" in parm:
+ #bb.msg.warn(None, "Deprecated usage of 'pnum' url parameter in '%s', please use 'striplevel'" % url)
+ striplevel = parm["pnum"]
+ else:
+ striplevel = '1'
+ patchparm['striplevel'] = striplevel
+
+ patchdir = parm.get('patchdir')
+ if patchdir:
+ patchparm['patchdir'] = patchdir
+
+ localurl = bb.fetch.encodeurl(('file', '', local, '', '', patchparm))
+ patches.append(localurl)
+
+ if all:
+ return sources
+
+ return patches
+
+
+def should_apply(parm, d):
+ if "mindate" in parm or "maxdate" in parm:
+ pn = d.getVar('PN')
+ srcdate = d.getVar('SRCDATE_%s' % pn)
+ if not srcdate:
+ srcdate = d.getVar('SRCDATE')
+
+ if srcdate == "now":
+ srcdate = d.getVar('DATE')
+
+ if "maxdate" in parm and parm["maxdate"] < srcdate:
+ return False, 'is outdated'
+
+ if "mindate" in parm and parm["mindate"] > srcdate:
+ return False, 'is predated'
+
+
+ if "minrev" in parm:
+ srcrev = d.getVar('SRCREV')
+ if srcrev and srcrev < parm["minrev"]:
+ return False, 'applies to later revisions'
+
+ if "maxrev" in parm:
+ srcrev = d.getVar('SRCREV')
+ if srcrev and srcrev > parm["maxrev"]:
+ return False, 'applies to earlier revisions'
+
+ if "rev" in parm:
+ srcrev = d.getVar('SRCREV')
+ if srcrev and parm["rev"] not in srcrev:
+ return False, "doesn't apply to revision"
+
+ if "notrev" in parm:
+ srcrev = d.getVar('SRCREV')
+ if srcrev and parm["notrev"] in srcrev:
+ return False, "doesn't apply to revision"
+
+ return True, None
+
diff --git a/poky/meta/lib/oe/path.py b/poky/meta/lib/oe/path.py
new file mode 100644
index 000000000..76c58fa76
--- /dev/null
+++ b/poky/meta/lib/oe/path.py
@@ -0,0 +1,261 @@
+import errno
+import glob
+import shutil
+import subprocess
+import os.path
+
+def join(*paths):
+ """Like os.path.join but doesn't treat absolute RHS specially"""
+ return os.path.normpath("/".join(paths))
+
+def relative(src, dest):
+ """ Return a relative path from src to dest.
+
+ >>> relative("/usr/bin", "/tmp/foo/bar")
+ ../../tmp/foo/bar
+
+ >>> relative("/usr/bin", "/usr/lib")
+ ../lib
+
+ >>> relative("/tmp", "/tmp/foo/bar")
+ foo/bar
+ """
+
+ return os.path.relpath(dest, src)
+
+def make_relative_symlink(path):
+ """ Convert an absolute symlink to a relative one """
+ if not os.path.islink(path):
+ return
+ link = os.readlink(path)
+ if not os.path.isabs(link):
+ return
+
+ # find the common ancestor directory
+ ancestor = path
+ depth = 0
+ while ancestor and not link.startswith(ancestor):
+ ancestor = ancestor.rpartition('/')[0]
+ depth += 1
+
+ if not ancestor:
+ print("make_relative_symlink() Error: unable to find the common ancestor of %s and its target" % path)
+ return
+
+ base = link.partition(ancestor)[2].strip('/')
+ while depth > 1:
+ base = "../" + base
+ depth -= 1
+
+ os.remove(path)
+ os.symlink(base, path)
+
+def replace_absolute_symlinks(basedir, d):
+ """
+ Walk basedir looking for absolute symlinks and replacing them with relative ones.
+ The absolute links are assumed to be relative to basedir
+ (compared to make_relative_symlink above which tries to compute common ancestors
+ using pattern matching instead)
+ """
+ for walkroot, dirs, files in os.walk(basedir):
+ for file in files + dirs:
+ path = os.path.join(walkroot, file)
+ if not os.path.islink(path):
+ continue
+ link = os.readlink(path)
+ if not os.path.isabs(link):
+ continue
+ walkdir = os.path.dirname(path.rpartition(basedir)[2])
+ base = os.path.relpath(link, walkdir)
+ bb.debug(2, "Replacing absolute path %s with relative path %s" % (link, base))
+ os.remove(path)
+ os.symlink(base, path)
+
+def format_display(path, metadata):
+ """ Prepare a path for display to the user. """
+ rel = relative(metadata.getVar("TOPDIR"), path)
+ if len(rel) > len(path):
+ return path
+ else:
+ return rel
+
+def copytree(src, dst):
+ # We could use something like shutil.copytree here but it turns out to
+ # to be slow. It takes twice as long copying to an empty directory.
+ # If dst already has contents performance can be 15 time slower
+ # This way we also preserve hardlinks between files in the tree.
+
+ bb.utils.mkdirhier(dst)
+ cmd = "tar --xattrs --xattrs-include='*' -cf - -C %s -p . | tar --xattrs --xattrs-include='*' -xf - -C %s" % (src, dst)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+
+def copyhardlinktree(src, dst):
+ """ Make the hard link when possible, otherwise copy. """
+ bb.utils.mkdirhier(dst)
+ if os.path.isdir(src) and not len(os.listdir(src)):
+ return
+
+ if (os.stat(src).st_dev == os.stat(dst).st_dev):
+ # Need to copy directories only with tar first since cp will error if two
+ # writers try and create a directory at the same time
+ cmd = "cd %s; find . -type d -print | tar --xattrs --xattrs-include='*' -cf - -C %s -p --no-recursion --files-from - | tar --xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+ source = ''
+ if os.path.isdir(src):
+ if len(glob.glob('%s/.??*' % src)) > 0:
+ source = './.??* '
+ source += './*'
+ s_dir = src
+ else:
+ source = src
+ s_dir = os.getcwd()
+ cmd = 'cp -afl --preserve=xattr %s %s' % (source, os.path.realpath(dst))
+ subprocess.check_output(cmd, shell=True, cwd=s_dir, stderr=subprocess.STDOUT)
+ else:
+ copytree(src, dst)
+
+def remove(path, recurse=True):
+ """
+ Equivalent to rm -f or rm -rf
+ NOTE: be careful about passing paths that may contain filenames with
+ wildcards in them (as opposed to passing an actual wildcarded path) -
+ since we use glob.glob() to expand the path. Filenames containing
+ square brackets are particularly problematic since the they may not
+ actually expand to match the original filename.
+ """
+ for name in glob.glob(path):
+ try:
+ os.unlink(name)
+ except OSError as exc:
+ if recurse and exc.errno == errno.EISDIR:
+ shutil.rmtree(name)
+ elif exc.errno != errno.ENOENT:
+ raise
+
+def symlink(source, destination, force=False):
+ """Create a symbolic link"""
+ try:
+ if force:
+ remove(destination)
+ os.symlink(source, destination)
+ except OSError as e:
+ if e.errno != errno.EEXIST or os.readlink(destination) != source:
+ raise
+
+def find(dir, **walkoptions):
+ """ Given a directory, recurses into that directory,
+ returning all files as absolute paths. """
+
+ for root, dirs, files in os.walk(dir, **walkoptions):
+ for file in files:
+ yield os.path.join(root, file)
+
+
+## realpath() related functions
+def __is_path_below(file, root):
+ return (file + os.path.sep).startswith(root)
+
+def __realpath_rel(start, rel_path, root, loop_cnt, assume_dir):
+ """Calculates real path of symlink 'start' + 'rel_path' below
+ 'root'; no part of 'start' below 'root' must contain symlinks. """
+ have_dir = True
+
+ for d in rel_path.split(os.path.sep):
+ if not have_dir and not assume_dir:
+ raise OSError(errno.ENOENT, "no such directory %s" % start)
+
+ if d == os.path.pardir: # '..'
+ if len(start) >= len(root):
+ # do not follow '..' before root
+ start = os.path.dirname(start)
+ else:
+ # emit warning?
+ pass
+ else:
+ (start, have_dir) = __realpath(os.path.join(start, d),
+ root, loop_cnt, assume_dir)
+
+ assert(__is_path_below(start, root))
+
+ return start
+
+def __realpath(file, root, loop_cnt, assume_dir):
+ while os.path.islink(file) and len(file) >= len(root):
+ if loop_cnt == 0:
+ raise OSError(errno.ELOOP, file)
+
+ loop_cnt -= 1
+ target = os.path.normpath(os.readlink(file))
+
+ if not os.path.isabs(target):
+ tdir = os.path.dirname(file)
+ assert(__is_path_below(tdir, root))
+ else:
+ tdir = root
+
+ file = __realpath_rel(tdir, target, root, loop_cnt, assume_dir)
+
+ try:
+ is_dir = os.path.isdir(file)
+ except:
+ is_dir = false
+
+ return (file, is_dir)
+
+def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False):
+ """ Returns the canonical path of 'file' with assuming a
+ toplevel 'root' directory. When 'use_physdir' is set, all
+ preceding path components of 'file' will be resolved first;
+ this flag should be set unless it is guaranteed that there is
+ no symlink in the path. When 'assume_dir' is not set, missing
+ path components will raise an ENOENT error"""
+
+ root = os.path.normpath(root)
+ file = os.path.normpath(file)
+
+ if not root.endswith(os.path.sep):
+ # letting root end with '/' makes some things easier
+ root = root + os.path.sep
+
+ if not __is_path_below(file, root):
+ raise OSError(errno.EINVAL, "file '%s' is not below root" % file)
+
+ try:
+ if use_physdir:
+ file = __realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
+ else:
+ file = __realpath(file, root, loop_cnt, assume_dir)[0]
+ except OSError as e:
+ if e.errno == errno.ELOOP:
+ # make ELOOP more readable; without catching it, there will
+ # be printed a backtrace with 100s of OSError exceptions
+ # else
+ raise OSError(errno.ELOOP,
+ "too much recursions while resolving '%s'; loop in '%s'" %
+ (file, e.strerror))
+
+ raise
+
+ return file
+
+def is_path_parent(possible_parent, *paths):
+ """
+ Return True if a path is the parent of another, False otherwise.
+ Multiple paths to test can be specified in which case all
+ specified test paths must be under the parent in order to
+ return True.
+ """
+ def abs_path_trailing(pth):
+ pth_abs = os.path.abspath(pth)
+ if not pth_abs.endswith(os.sep):
+ pth_abs += os.sep
+ return pth_abs
+
+ possible_parent_abs = abs_path_trailing(possible_parent)
+ if not paths:
+ return False
+ for path in paths:
+ path_abs = abs_path_trailing(path)
+ if not path_abs.startswith(possible_parent_abs):
+ return False
+ return True
diff --git a/poky/meta/lib/oe/prservice.py b/poky/meta/lib/oe/prservice.py
new file mode 100644
index 000000000..32dfc15e8
--- /dev/null
+++ b/poky/meta/lib/oe/prservice.py
@@ -0,0 +1,126 @@
+
+def prserv_make_conn(d, check = False):
+ import prserv.serv
+ host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
+ try:
+ conn = None
+ conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
+ if check:
+ if not conn.ping():
+ raise Exception('service not available')
+ d.setVar("__PRSERV_CONN",conn)
+ except Exception as exc:
+ bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc)))
+
+ return conn
+
+def prserv_dump_db(d):
+ if not d.getVar('PRSERV_HOST'):
+ bb.error("Not using network based PR service")
+ return None
+
+ conn = d.getVar("__PRSERV_CONN")
+ if conn is None:
+ conn = prserv_make_conn(d)
+ if conn is None:
+ bb.error("Making connection failed to remote PR service")
+ return None
+
+ #dump db
+ opt_version = d.getVar('PRSERV_DUMPOPT_VERSION')
+ opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH')
+ opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM')
+ opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL'))
+ return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
+
+def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
+ if not d.getVar('PRSERV_HOST'):
+ bb.error("Not using network based PR service")
+ return None
+
+ conn = d.getVar("__PRSERV_CONN")
+ if conn is None:
+ conn = prserv_make_conn(d)
+ if conn is None:
+ bb.error("Making connection failed to remote PR service")
+ return None
+ #get the entry values
+ imported = []
+ prefix = "PRAUTO$"
+ for v in d.keys():
+ if v.startswith(prefix):
+ (remain, sep, checksum) = v.rpartition('$')
+ (remain, sep, pkgarch) = remain.rpartition('$')
+ (remain, sep, version) = remain.rpartition('$')
+ if (remain + '$' != prefix) or \
+ (filter_version and filter_version != version) or \
+ (filter_pkgarch and filter_pkgarch != pkgarch) or \
+ (filter_checksum and filter_checksum != checksum):
+ continue
+ try:
+ value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum))
+ except BaseException as exc:
+ bb.debug("Not valid value of %s:%s" % (v,str(exc)))
+ continue
+ ret = conn.importone(version,pkgarch,checksum,value)
+ if ret != value:
+ bb.error("importing(%s,%s,%s,%d) failed. DB may have larger value %d" % (version,pkgarch,checksum,value,ret))
+ else:
+ imported.append((version,pkgarch,checksum,value))
+ return imported
+
+def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
+ import bb.utils
+ #initilize the output file
+ bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR'))
+ df = d.getVar('PRSERV_DUMPFILE')
+ #write data
+ lf = bb.utils.lockfile("%s.lock" % df)
+ f = open(df, "a")
+ if metainfo:
+ #dump column info
+ f.write("#PR_core_ver = \"%s\"\n\n" % metainfo['core_ver']);
+ f.write("#Table: %s\n" % metainfo['tbl_name'])
+ f.write("#Columns:\n")
+ f.write("#name \t type \t notn \t dflt \t pk\n")
+ f.write("#----------\t --------\t --------\t --------\t ----\n")
+ for i in range(len(metainfo['col_info'])):
+ f.write("#%10s\t %8s\t %8s\t %8s\t %4s\n" %
+ (metainfo['col_info'][i]['name'],
+ metainfo['col_info'][i]['type'],
+ metainfo['col_info'][i]['notnull'],
+ metainfo['col_info'][i]['dflt_value'],
+ metainfo['col_info'][i]['pk']))
+ f.write("\n")
+
+ if lockdown:
+ f.write("PRSERV_LOCKDOWN = \"1\"\n\n")
+
+ if datainfo:
+ idx = {}
+ for i in range(len(datainfo)):
+ pkgarch = datainfo[i]['pkgarch']
+ value = datainfo[i]['value']
+ if pkgarch not in idx:
+ idx[pkgarch] = i
+ elif value > datainfo[idx[pkgarch]]['value']:
+ idx[pkgarch] = i
+ f.write("PRAUTO$%s$%s$%s = \"%s\"\n" %
+ (str(datainfo[i]['version']), pkgarch, str(datainfo[i]['checksum']), str(value)))
+ if not nomax:
+ for i in idx:
+ f.write("PRAUTO_%s_%s = \"%s\"\n" % (str(datainfo[idx[i]]['version']),str(datainfo[idx[i]]['pkgarch']),str(datainfo[idx[i]]['value'])))
+ f.close()
+ bb.utils.unlockfile(lf)
+
+def prserv_check_avail(d):
+ host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or '').split(':') if _f])
+ try:
+ if len(host_params) != 2:
+ raise TypeError
+ else:
+ int(host_params[1])
+ except TypeError:
+ bb.fatal('Undefined/incorrect PRSERV_HOST value. Format: "host:port"')
+ else:
+ prserv_make_conn(d, True)
diff --git a/poky/meta/lib/oe/qa.py b/poky/meta/lib/oe/qa.py
new file mode 100644
index 000000000..3231e60ce
--- /dev/null
+++ b/poky/meta/lib/oe/qa.py
@@ -0,0 +1,171 @@
+import os, struct, mmap
+
+class NotELFFileError(Exception):
+ pass
+
+class ELFFile:
+ EI_NIDENT = 16
+
+ EI_CLASS = 4
+ EI_DATA = 5
+ EI_VERSION = 6
+ EI_OSABI = 7
+ EI_ABIVERSION = 8
+
+ E_MACHINE = 0x12
+
+ # possible values for EI_CLASS
+ ELFCLASSNONE = 0
+ ELFCLASS32 = 1
+ ELFCLASS64 = 2
+
+ # possible value for EI_VERSION
+ EV_CURRENT = 1
+
+ # possible values for EI_DATA
+ EI_DATA_NONE = 0
+ EI_DATA_LSB = 1
+ EI_DATA_MSB = 2
+
+ PT_INTERP = 3
+
+ def my_assert(self, expectation, result):
+ if not expectation == result:
+ #print "'%x','%x' %s" % (ord(expectation), ord(result), self.name)
+ raise NotELFFileError("%s is not an ELF" % self.name)
+
+ def __init__(self, name):
+ self.name = name
+ self.objdump_output = {}
+
+ # Context Manager functions to close the mmap explicitly
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.data.close()
+
+ def open(self):
+ with open(self.name, "rb") as f:
+ try:
+ self.data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
+ except ValueError:
+ # This means the file is empty
+ raise NotELFFileError("%s is empty" % self.name)
+
+ # Check the file has the minimum number of ELF table entries
+ if len(self.data) < ELFFile.EI_NIDENT + 4:
+ raise NotELFFileError("%s is not an ELF" % self.name)
+
+ # ELF header
+ self.my_assert(self.data[0], 0x7f)
+ self.my_assert(self.data[1], ord('E'))
+ self.my_assert(self.data[2], ord('L'))
+ self.my_assert(self.data[3], ord('F'))
+ if self.data[ELFFile.EI_CLASS] == ELFFile.ELFCLASS32:
+ self.bits = 32
+ elif self.data[ELFFile.EI_CLASS] == ELFFile.ELFCLASS64:
+ self.bits = 64
+ else:
+ # Not 32-bit or 64.. lets assert
+ raise NotELFFileError("ELF but not 32 or 64 bit.")
+ self.my_assert(self.data[ELFFile.EI_VERSION], ELFFile.EV_CURRENT)
+
+ self.endian = self.data[ELFFile.EI_DATA]
+ if self.endian not in (ELFFile.EI_DATA_LSB, ELFFile.EI_DATA_MSB):
+ raise NotELFFileError("Unexpected EI_DATA %x" % self.endian)
+
+ def osAbi(self):
+ return self.data[ELFFile.EI_OSABI]
+
+ def abiVersion(self):
+ return self.data[ELFFile.EI_ABIVERSION]
+
+ def abiSize(self):
+ return self.bits
+
+ def isLittleEndian(self):
+ return self.endian == ELFFile.EI_DATA_LSB
+
+ def isBigEndian(self):
+ return self.endian == ELFFile.EI_DATA_MSB
+
+ def getStructEndian(self):
+ return {ELFFile.EI_DATA_LSB: "<",
+ ELFFile.EI_DATA_MSB: ">"}[self.endian]
+
+ def getShort(self, offset):
+ return struct.unpack_from(self.getStructEndian() + "H", self.data, offset)[0]
+
+ def getWord(self, offset):
+ return struct.unpack_from(self.getStructEndian() + "i", self.data, offset)[0]
+
+ def isDynamic(self):
+ """
+ Return True if there is a .interp segment (therefore dynamically
+ linked), otherwise False (statically linked).
+ """
+ offset = self.getWord(self.bits == 32 and 0x1C or 0x20)
+ size = self.getShort(self.bits == 32 and 0x2A or 0x36)
+ count = self.getShort(self.bits == 32 and 0x2C or 0x38)
+
+ for i in range(0, count):
+ p_type = self.getWord(offset + i * size)
+ if p_type == ELFFile.PT_INTERP:
+ return True
+ return False
+
+ def machine(self):
+ """
+ We know the endian stored in self.endian and we
+ know the position
+ """
+ return self.getShort(ELFFile.E_MACHINE)
+
+ def run_objdump(self, cmd, d):
+ import bb.process
+ import sys
+
+ if cmd in self.objdump_output:
+ return self.objdump_output[cmd]
+
+ objdump = d.getVar('OBJDUMP')
+
+ env = os.environ.copy()
+ env["LC_ALL"] = "C"
+ env["PATH"] = d.getVar('PATH')
+
+ try:
+ bb.note("%s %s %s" % (objdump, cmd, self.name))
+ self.objdump_output[cmd] = bb.process.run([objdump, cmd, self.name], env=env, shell=False)[0]
+ return self.objdump_output[cmd]
+ except Exception as e:
+ bb.note("%s %s %s failed: %s" % (objdump, cmd, self.name, e))
+ return ""
+
+def elf_machine_to_string(machine):
+ """
+ Return the name of a given ELF e_machine field or the hex value as a string
+ if it isn't recognised.
+ """
+ try:
+ return {
+ 0x02: "SPARC",
+ 0x03: "x86",
+ 0x08: "MIPS",
+ 0x14: "PowerPC",
+ 0x28: "ARM",
+ 0x2A: "SuperH",
+ 0x32: "IA-64",
+ 0x3E: "x86-64",
+ 0xB7: "AArch64"
+ }[machine]
+ except:
+ return "Unknown (%s)" % repr(machine)
+
+if __name__ == "__main__":
+ import sys
+
+ with ELFFile(sys.argv[1]) as elf:
+ elf.open()
+ print(elf.isDynamic())
diff --git a/poky/meta/lib/oe/recipeutils.py b/poky/meta/lib/oe/recipeutils.py
new file mode 100644
index 000000000..aa64553c0
--- /dev/null
+++ b/poky/meta/lib/oe/recipeutils.py
@@ -0,0 +1,971 @@
+# Utility functions for reading and modifying recipes
+#
+# Some code borrowed from the OE layer index
+#
+# Copyright (C) 2013-2017 Intel Corporation
+#
+
+import sys
+import os
+import os.path
+import tempfile
+import textwrap
+import difflib
+from . import utils
+import shutil
+import re
+import fnmatch
+import glob
+from collections import OrderedDict, defaultdict
+
+
+# Help us to find places to insert values
+recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LICENSE_FLAGS', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRCPV', 'SRC_URI', 'S', 'do_fetch()', 'do_unpack()', 'do_patch()', 'EXTRA_OECONF', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'do_configure()', 'EXTRA_OEMAKE', 'do_compile()', 'do_install()', 'do_populate_sysroot()', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'populate_packages()', 'do_package()', 'do_deploy()']
+# Variables that sometimes are a bit long but shouldn't be wrapped
+nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER', 'SRC_URI\[(.+\.)?md5sum\]', 'SRC_URI\[(.+\.)?sha256sum\]']
+list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM']
+meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION']
+
+
+def pn_to_recipe(cooker, pn, mc=''):
+ """Convert a recipe name (PN) to the path to the recipe file"""
+
+ best = cooker.findBestProvider(pn, mc)
+ return best[3]
+
+
+def get_unavailable_reasons(cooker, pn):
+ """If a recipe could not be found, find out why if possible"""
+ import bb.taskdata
+ taskdata = bb.taskdata.TaskData(None, skiplist=cooker.skiplist)
+ return taskdata.get_reasons(pn)
+
+
+def parse_recipe(cooker, fn, appendfiles):
+ """
+ Parse an individual recipe file, optionally with a list of
+ bbappend files.
+ """
+ import bb.cache
+ parser = bb.cache.NoCache(cooker.databuilder)
+ envdata = parser.loadDataFull(fn, appendfiles)
+ return envdata
+
+
+def get_var_files(fn, varlist, d):
+ """Find the file in which each of a list of variables is set.
+ Note: requires variable history to be enabled when parsing.
+ """
+ varfiles = {}
+ for v in varlist:
+ history = d.varhistory.variable(v)
+ files = []
+ for event in history:
+ if 'file' in event and not 'flag' in event:
+ files.append(event['file'])
+ if files:
+ actualfile = files[-1]
+ else:
+ actualfile = None
+ varfiles[v] = actualfile
+
+ return varfiles
+
+
+def split_var_value(value, assignment=True):
+ """
+ Split a space-separated variable's value into a list of items,
+ taking into account that some of the items might be made up of
+ expressions containing spaces that should not be split.
+ Parameters:
+ value:
+ The string value to split
+ assignment:
+ True to assume that the value represents an assignment
+ statement, False otherwise. If True, and an assignment
+ statement is passed in the first item in
+ the returned list will be the part of the assignment
+ statement up to and including the opening quote character,
+ and the last item will be the closing quote.
+ """
+ inexpr = 0
+ lastchar = None
+ out = []
+ buf = ''
+ for char in value:
+ if char == '{':
+ if lastchar == '$':
+ inexpr += 1
+ elif char == '}':
+ inexpr -= 1
+ elif assignment and char in '"\'' and inexpr == 0:
+ if buf:
+ out.append(buf)
+ out.append(char)
+ char = ''
+ buf = ''
+ elif char.isspace() and inexpr == 0:
+ char = ''
+ if buf:
+ out.append(buf)
+ buf = ''
+ buf += char
+ lastchar = char
+ if buf:
+ out.append(buf)
+
+ # Join together assignment statement and opening quote
+ outlist = out
+ if assignment:
+ assigfound = False
+ for idx, item in enumerate(out):
+ if '=' in item:
+ assigfound = True
+ if assigfound:
+ if '"' in item or "'" in item:
+ outlist = [' '.join(out[:idx+1])]
+ outlist.extend(out[idx+1:])
+ break
+ return outlist
+
+
+def patch_recipe_lines(fromlines, values, trailing_newline=True):
+ """Update or insert variable values into lines from a recipe.
+ Note that some manual inspection/intervention may be required
+ since this cannot handle all situations.
+ """
+
+ import bb.utils
+
+ if trailing_newline:
+ newline = '\n'
+ else:
+ newline = ''
+
+ nowrap_vars_res = []
+ for item in nowrap_vars:
+ nowrap_vars_res.append(re.compile('^%s$' % item))
+
+ recipe_progression_res = []
+ recipe_progression_restrs = []
+ for item in recipe_progression:
+ if item.endswith('()'):
+ key = item[:-2]
+ else:
+ key = item
+ restr = '%s(_[a-zA-Z0-9-_$(){}]+|\[[^\]]*\])?' % key
+ if item.endswith('()'):
+ recipe_progression_restrs.append(restr + '()')
+ else:
+ recipe_progression_restrs.append(restr)
+ recipe_progression_res.append(re.compile('^%s$' % restr))
+
+ def get_recipe_pos(variable):
+ for i, p in enumerate(recipe_progression_res):
+ if p.match(variable):
+ return i
+ return -1
+
+ remainingnames = {}
+ for k in values.keys():
+ remainingnames[k] = get_recipe_pos(k)
+ remainingnames = OrderedDict(sorted(remainingnames.items(), key=lambda x: x[1]))
+
+ modifying = False
+
+ def outputvalue(name, lines, rewindcomments=False):
+ if values[name] is None:
+ return
+ rawtext = '%s = "%s"%s' % (name, values[name], newline)
+ addlines = []
+ nowrap = False
+ for nowrap_re in nowrap_vars_res:
+ if nowrap_re.match(name):
+ nowrap = True
+ break
+ if nowrap:
+ addlines.append(rawtext)
+ elif name in list_vars:
+ splitvalue = split_var_value(values[name], assignment=False)
+ if len(splitvalue) > 1:
+ linesplit = ' \\\n' + (' ' * (len(name) + 4))
+ addlines.append('%s = "%s%s"%s' % (name, linesplit.join(splitvalue), linesplit, newline))
+ else:
+ addlines.append(rawtext)
+ else:
+ wrapped = textwrap.wrap(rawtext)
+ for wrapline in wrapped[:-1]:
+ addlines.append('%s \\%s' % (wrapline, newline))
+ addlines.append('%s%s' % (wrapped[-1], newline))
+
+ # Split on newlines - this isn't strictly necessary if you are only
+ # going to write the output to disk, but if you want to compare it
+ # (as patch_recipe_file() will do if patch=True) then it's important.
+ addlines = [line for l in addlines for line in l.splitlines(True)]
+ if rewindcomments:
+ # Ensure we insert the lines before any leading comments
+ # (that we'd want to ensure remain leading the next value)
+ for i, ln in reversed(list(enumerate(lines))):
+ if not ln.startswith('#'):
+ lines[i+1:i+1] = addlines
+ break
+ else:
+ lines.extend(addlines)
+ else:
+ lines.extend(addlines)
+
+ existingnames = []
+ def patch_recipe_varfunc(varname, origvalue, op, newlines):
+ if modifying:
+ # Insert anything that should come before this variable
+ pos = get_recipe_pos(varname)
+ for k in list(remainingnames):
+ if remainingnames[k] > -1 and pos >= remainingnames[k] and not k in existingnames:
+ outputvalue(k, newlines, rewindcomments=True)
+ del remainingnames[k]
+ # Now change this variable, if it needs to be changed
+ if varname in existingnames and op in ['+=', '=', '=+']:
+ if varname in remainingnames:
+ outputvalue(varname, newlines)
+ del remainingnames[varname]
+ return None, None, 0, True
+ else:
+ if varname in values:
+ existingnames.append(varname)
+ return origvalue, None, 0, True
+
+ # First run - establish which values we want to set are already in the file
+ varlist = [re.escape(item) for item in values.keys()]
+ bb.utils.edit_metadata(fromlines, varlist, patch_recipe_varfunc)
+ # Second run - actually set everything
+ modifying = True
+ varlist.extend(recipe_progression_restrs)
+ changed, tolines = bb.utils.edit_metadata(fromlines, varlist, patch_recipe_varfunc, match_overrides=True)
+
+ if remainingnames:
+ if tolines and tolines[-1].strip() != '':
+ tolines.append('\n')
+ for k in remainingnames.keys():
+ outputvalue(k, tolines)
+
+ return changed, tolines
+
+
+def patch_recipe_file(fn, values, patch=False, relpath='', redirect_output=None):
+ """Update or insert variable values into a recipe file (assuming you
+ have already identified the exact file you want to update.)
+ Note that some manual inspection/intervention may be required
+ since this cannot handle all situations.
+ """
+
+ with open(fn, 'r') as f:
+ fromlines = f.readlines()
+
+ _, tolines = patch_recipe_lines(fromlines, values)
+
+ if redirect_output:
+ with open(os.path.join(redirect_output, os.path.basename(fn)), 'w') as f:
+ f.writelines(tolines)
+ return None
+ elif patch:
+ relfn = os.path.relpath(fn, relpath)
+ diff = difflib.unified_diff(fromlines, tolines, 'a/%s' % relfn, 'b/%s' % relfn)
+ return diff
+ else:
+ with open(fn, 'w') as f:
+ f.writelines(tolines)
+ return None
+
+
+def localise_file_vars(fn, varfiles, varlist):
+ """Given a list of variables and variable history (fetched with get_var_files())
+ find where each variable should be set/changed. This handles for example where a
+ recipe includes an inc file where variables might be changed - in most cases
+ we want to update the inc file when changing the variable value rather than adding
+ it to the recipe itself.
+ """
+ fndir = os.path.dirname(fn) + os.sep
+
+ first_meta_file = None
+ for v in meta_vars:
+ f = varfiles.get(v, None)
+ if f:
+ actualdir = os.path.dirname(f) + os.sep
+ if actualdir.startswith(fndir):
+ first_meta_file = f
+ break
+
+ filevars = defaultdict(list)
+ for v in varlist:
+ f = varfiles[v]
+ # Only return files that are in the same directory as the recipe or in some directory below there
+ # (this excludes bbclass files and common inc files that wouldn't be appropriate to set the variable
+ # in if we were going to set a value specific to this recipe)
+ if f:
+ actualfile = f
+ else:
+ # Variable isn't in a file, if it's one of the "meta" vars, use the first file with a meta var in it
+ if first_meta_file:
+ actualfile = first_meta_file
+ else:
+ actualfile = fn
+
+ actualdir = os.path.dirname(actualfile) + os.sep
+ if not actualdir.startswith(fndir):
+ actualfile = fn
+ filevars[actualfile].append(v)
+
+ return filevars
+
+def patch_recipe(d, fn, varvalues, patch=False, relpath='', redirect_output=None):
+ """Modify a list of variable values in the specified recipe. Handles inc files if
+ used by the recipe.
+ """
+ varlist = varvalues.keys()
+ varfiles = get_var_files(fn, varlist, d)
+ locs = localise_file_vars(fn, varfiles, varlist)
+ patches = []
+ for f,v in locs.items():
+ vals = {k: varvalues[k] for k in v}
+ patchdata = patch_recipe_file(f, vals, patch, relpath, redirect_output)
+ if patch:
+ patches.append(patchdata)
+
+ if patch:
+ return patches
+ else:
+ return None
+
+
+
+def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True, all_variants=False):
+ """Copy (local) recipe files, including both files included via include/require,
+ and files referred to in the SRC_URI variable."""
+ import bb.fetch2
+ import oe.path
+
+ # FIXME need a warning if the unexpanded SRC_URI value contains variable references
+
+ uri_values = []
+ localpaths = []
+ def fetch_urls(rdata):
+ # Collect the local paths from SRC_URI
+ srcuri = rdata.getVar('SRC_URI') or ""
+ if srcuri not in uri_values:
+ fetch = bb.fetch2.Fetch(srcuri.split(), rdata)
+ if download:
+ fetch.download()
+ for pth in fetch.localpaths():
+ if pth not in localpaths:
+ localpaths.append(pth)
+ uri_values.append(srcuri)
+
+ fetch_urls(d)
+ if all_variants:
+ # Get files for other variants e.g. in the case of a SRC_URI_append
+ localdata = bb.data.createCopy(d)
+ variants = (localdata.getVar('BBCLASSEXTEND') or '').split()
+ if variants:
+ # Ensure we handle class-target if we're dealing with one of the variants
+ variants.append('target')
+ for variant in variants:
+ localdata.setVar('CLASSOVERRIDE', 'class-%s' % variant)
+ fetch_urls(localdata)
+
+ # Copy local files to target directory and gather any remote files
+ bb_dir = os.path.abspath(os.path.dirname(d.getVar('FILE'))) + os.sep
+ remotes = []
+ copied = []
+ # Need to do this in two steps since we want to check against the absolute path
+ includes = [os.path.abspath(path) for path in d.getVar('BBINCLUDED').split() if os.path.exists(path)]
+ # We also check this below, but we don't want any items in this list being considered remotes
+ includes = [path for path in includes if path.startswith(bb_dir)]
+ for path in localpaths + includes:
+ # Only import files that are under the meta directory
+ if path.startswith(bb_dir):
+ if not whole_dir:
+ relpath = os.path.relpath(path, bb_dir)
+ subdir = os.path.join(tgt_dir, os.path.dirname(relpath))
+ if not os.path.exists(subdir):
+ os.makedirs(subdir)
+ shutil.copy2(path, os.path.join(tgt_dir, relpath))
+ copied.append(relpath)
+ else:
+ remotes.append(path)
+ # Simply copy whole meta dir, if requested
+ if whole_dir:
+ shutil.copytree(bb_dir, tgt_dir)
+
+ return copied, remotes
+
+
+def get_recipe_local_files(d, patches=False, archives=False):
+ """Get a list of local files in SRC_URI within a recipe."""
+ import oe.patch
+ uris = (d.getVar('SRC_URI') or "").split()
+ fetch = bb.fetch2.Fetch(uris, d)
+ # FIXME this list should be factored out somewhere else (such as the
+ # fetcher) though note that this only encompasses actual container formats
+ # i.e. that can contain multiple files as opposed to those that only
+ # contain a compressed stream (i.e. .tar.gz as opposed to just .gz)
+ archive_exts = ['.tar', '.tgz', '.tar.gz', '.tar.Z', '.tbz', '.tbz2', '.tar.bz2', '.txz', '.tar.xz', '.tar.lz', '.zip', '.jar', '.rpm', '.srpm', '.deb', '.ipk', '.tar.7z', '.7z']
+ ret = {}
+ for uri in uris:
+ if fetch.ud[uri].type == 'file':
+ if (not patches and
+ oe.patch.patch_path(uri, fetch, '', expand=False)):
+ continue
+ # Skip files that are referenced by absolute path
+ fname = fetch.ud[uri].basepath
+ if os.path.isabs(fname):
+ continue
+ # Handle subdir=
+ subdir = fetch.ud[uri].parm.get('subdir', '')
+ if subdir:
+ if os.path.isabs(subdir):
+ continue
+ fname = os.path.join(subdir, fname)
+ localpath = fetch.localpath(uri)
+ if not archives:
+ # Ignore archives that will be unpacked
+ if localpath.endswith(tuple(archive_exts)):
+ unpack = fetch.ud[uri].parm.get('unpack', True)
+ if unpack:
+ continue
+ ret[fname] = localpath
+ return ret
+
+
+def get_recipe_patches(d):
+ """Get a list of the patches included in SRC_URI within a recipe."""
+ import oe.patch
+ patches = oe.patch.src_patches(d, expand=False)
+ patchfiles = []
+ for patch in patches:
+ _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+ patchfiles.append(local)
+ return patchfiles
+
+
+def get_recipe_patched_files(d):
+ """
+ Get the list of patches for a recipe along with the files each patch modifies.
+ Params:
+ d: the datastore for the recipe
+ Returns:
+ a dict mapping patch file path to a list of tuples of changed files and
+ change mode ('A' for add, 'D' for delete or 'M' for modify)
+ """
+ import oe.patch
+ patches = oe.patch.src_patches(d, expand=False)
+ patchedfiles = {}
+ for patch in patches:
+ _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch)
+ striplevel = int(parm['striplevel'])
+ patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S'), parm.get('patchdir', '')))
+ return patchedfiles
+
+
+def validate_pn(pn):
+ """Perform validation on a recipe name (PN) for a new recipe."""
+ reserved_names = ['forcevariable', 'append', 'prepend', 'remove']
+ if not re.match('^[0-9a-z-.+]+$', pn):
+ return 'Recipe name "%s" is invalid: only characters 0-9, a-z, -, + and . are allowed' % pn
+ elif pn in reserved_names:
+ return 'Recipe name "%s" is invalid: is a reserved keyword' % pn
+ elif pn.startswith('pn-'):
+ return 'Recipe name "%s" is invalid: names starting with "pn-" are reserved' % pn
+ elif pn.endswith(('.bb', '.bbappend', '.bbclass', '.inc', '.conf')):
+ return 'Recipe name "%s" is invalid: should be just a name, not a file name' % pn
+ return ''
+
+
+def get_bbfile_path(d, destdir, extrapathhint=None):
+ """
+ Determine the correct path for a recipe within a layer
+ Parameters:
+ d: Recipe-specific datastore
+ destdir: destination directory. Can be the path to the base of the layer or a
+ partial path somewhere within the layer.
+ extrapathhint: a path relative to the base of the layer to try
+ """
+ import bb.cookerdata
+
+ destdir = os.path.abspath(destdir)
+ destlayerdir = find_layerdir(destdir)
+
+ # Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf
+ confdata = d.createCopy()
+ confdata.setVar('BBFILES', '')
+ confdata.setVar('LAYERDIR', destlayerdir)
+ destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf")
+ confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
+ pn = d.getVar('PN')
+
+ bbfilespecs = (confdata.getVar('BBFILES') or '').split()
+ if destdir == destlayerdir:
+ for bbfilespec in bbfilespecs:
+ if not bbfilespec.endswith('.bbappend'):
+ for match in glob.glob(bbfilespec):
+ splitext = os.path.splitext(os.path.basename(match))
+ if splitext[1] == '.bb':
+ mpn = splitext[0].split('_')[0]
+ if mpn == pn:
+ return os.path.dirname(match)
+
+ # Try to make up a path that matches BBFILES
+ # this is a little crude, but better than nothing
+ bpn = d.getVar('BPN')
+ recipefn = os.path.basename(d.getVar('FILE'))
+ pathoptions = [destdir]
+ if extrapathhint:
+ pathoptions.append(os.path.join(destdir, extrapathhint))
+ if destdir == destlayerdir:
+ pathoptions.append(os.path.join(destdir, 'recipes-%s' % bpn, bpn))
+ pathoptions.append(os.path.join(destdir, 'recipes', bpn))
+ pathoptions.append(os.path.join(destdir, bpn))
+ elif not destdir.endswith(('/' + pn, '/' + bpn)):
+ pathoptions.append(os.path.join(destdir, bpn))
+ closepath = ''
+ for pathoption in pathoptions:
+ bbfilepath = os.path.join(pathoption, 'test.bb')
+ for bbfilespec in bbfilespecs:
+ if fnmatch.fnmatchcase(bbfilepath, bbfilespec):
+ return pathoption
+ return None
+
+def get_bbappend_path(d, destlayerdir, wildcardver=False):
+ """Determine how a bbappend for a recipe should be named and located within another layer"""
+
+ import bb.cookerdata
+
+ destlayerdir = os.path.abspath(destlayerdir)
+ recipefile = d.getVar('FILE')
+ recipefn = os.path.splitext(os.path.basename(recipefile))[0]
+ if wildcardver and '_' in recipefn:
+ recipefn = recipefn.split('_', 1)[0] + '_%'
+ appendfn = recipefn + '.bbappend'
+
+ # Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf
+ confdata = d.createCopy()
+ confdata.setVar('BBFILES', '')
+ confdata.setVar('LAYERDIR', destlayerdir)
+ destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf")
+ confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
+
+ origlayerdir = find_layerdir(recipefile)
+ if not origlayerdir:
+ return (None, False)
+ # Now join this to the path where the bbappend is going and check if it is covered by BBFILES
+ appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn)
+ closepath = ''
+ pathok = True
+ for bbfilespec in confdata.getVar('BBFILES').split():
+ if fnmatch.fnmatchcase(appendpath, bbfilespec):
+ # Our append path works, we're done
+ break
+ elif bbfilespec.startswith(destlayerdir) and fnmatch.fnmatchcase('test.bbappend', os.path.basename(bbfilespec)):
+ # Try to find the longest matching path
+ if len(bbfilespec) > len(closepath):
+ closepath = bbfilespec
+ else:
+ # Unfortunately the bbappend layer and the original recipe's layer don't have the same structure
+ if closepath:
+ # bbappend layer's layer.conf at least has a spec that picks up .bbappend files
+ # Now we just need to substitute out any wildcards
+ appendsubdir = os.path.relpath(os.path.dirname(closepath), destlayerdir)
+ if 'recipes-*' in appendsubdir:
+ # Try to copy this part from the original recipe path
+ res = re.search('/recipes-[^/]+/', recipefile)
+ if res:
+ appendsubdir = appendsubdir.replace('/recipes-*/', res.group(0))
+ # This is crude, but we have to do something
+ appendsubdir = appendsubdir.replace('*', recipefn.split('_')[0])
+ appendsubdir = appendsubdir.replace('?', 'a')
+ appendpath = os.path.join(destlayerdir, appendsubdir, appendfn)
+ else:
+ pathok = False
+ return (appendpath, pathok)
+
+
+def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None, redirect_output=None):
+ """
+ Writes a bbappend file for a recipe
+ Parameters:
+ rd: data dictionary for the recipe
+ destlayerdir: base directory of the layer to place the bbappend in
+ (subdirectory path from there will be determined automatically)
+ srcfiles: dict of source files to add to SRC_URI, where the value
+ is the full path to the file to be added, and the value is the
+ original filename as it would appear in SRC_URI or None if it
+ isn't already present. You may pass None for this parameter if
+ you simply want to specify your own content via the extralines
+ parameter.
+ install: dict mapping entries in srcfiles to a tuple of two elements:
+ install path (*without* ${D} prefix) and permission value (as a
+ string, e.g. '0644').
+ wildcardver: True to use a % wildcard in the bbappend filename, or
+ False to make the bbappend specific to the recipe version.
+ machine:
+ If specified, make the changes in the bbappend specific to this
+ machine. This will also cause PACKAGE_ARCH = "${MACHINE_ARCH}"
+ to be added to the bbappend.
+ extralines:
+ Extra lines to add to the bbappend. This may be a dict of name
+ value pairs, or simply a list of the lines.
+ removevalues:
+ Variable values to remove - a dict of names/values.
+ redirect_output:
+ If specified, redirects writing the output file to the
+ specified directory (for dry-run purposes)
+ """
+
+ if not removevalues:
+ removevalues = {}
+
+ # Determine how the bbappend should be named
+ appendpath, pathok = get_bbappend_path(rd, destlayerdir, wildcardver)
+ if not appendpath:
+ bb.error('Unable to determine layer directory containing %s' % recipefile)
+ return (None, None)
+ if not pathok:
+ bb.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.' % (os.path.join(destlayerdir, 'conf', 'layer.conf'), os.path.dirname(appendpath)))
+
+ appenddir = os.path.dirname(appendpath)
+ if not redirect_output:
+ bb.utils.mkdirhier(appenddir)
+
+ # FIXME check if the bbappend doesn't get overridden by a higher priority layer?
+
+ layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
+ if not os.path.abspath(destlayerdir) in layerdirs:
+ bb.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
+
+ bbappendlines = []
+ if extralines:
+ if isinstance(extralines, dict):
+ for name, value in extralines.items():
+ bbappendlines.append((name, '=', value))
+ else:
+ # Do our best to split it
+ for line in extralines:
+ if line[-1] == '\n':
+ line = line[:-1]
+ splitline = line.split(None, 2)
+ if len(splitline) == 3:
+ bbappendlines.append(tuple(splitline))
+ else:
+ raise Exception('Invalid extralines value passed')
+
+ def popline(varname):
+ for i in range(0, len(bbappendlines)):
+ if bbappendlines[i][0] == varname:
+ line = bbappendlines.pop(i)
+ return line
+ return None
+
+ def appendline(varname, op, value):
+ for i in range(0, len(bbappendlines)):
+ item = bbappendlines[i]
+ if item[0] == varname:
+ bbappendlines[i] = (item[0], item[1], item[2] + ' ' + value)
+ break
+ else:
+ bbappendlines.append((varname, op, value))
+
+ destsubdir = rd.getVar('PN')
+ if srcfiles:
+ bbappendlines.append(('FILESEXTRAPATHS_prepend', ':=', '${THISDIR}/${PN}:'))
+
+ appendoverride = ''
+ if machine:
+ bbappendlines.append(('PACKAGE_ARCH', '=', '${MACHINE_ARCH}'))
+ appendoverride = '_%s' % machine
+ copyfiles = {}
+ if srcfiles:
+ instfunclines = []
+ for newfile, origsrcfile in srcfiles.items():
+ srcfile = origsrcfile
+ srcurientry = None
+ if not srcfile:
+ srcfile = os.path.basename(newfile)
+ srcurientry = 'file://%s' % srcfile
+ # Double-check it's not there already
+ # FIXME do we care if the entry is added by another bbappend that might go away?
+ if not srcurientry in rd.getVar('SRC_URI').split():
+ if machine:
+ appendline('SRC_URI_append%s' % appendoverride, '=', ' ' + srcurientry)
+ else:
+ appendline('SRC_URI', '+=', srcurientry)
+ copyfiles[newfile] = srcfile
+ if install:
+ institem = install.pop(newfile, None)
+ if institem:
+ (destpath, perms) = institem
+ instdestpath = replace_dir_vars(destpath, rd)
+ instdirline = 'install -d ${D}%s' % os.path.dirname(instdestpath)
+ if not instdirline in instfunclines:
+ instfunclines.append(instdirline)
+ instfunclines.append('install -m %s ${WORKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath))
+ if instfunclines:
+ bbappendlines.append(('do_install_append%s()' % appendoverride, '', instfunclines))
+
+ if redirect_output:
+ bb.note('Writing append file %s (dry-run)' % appendpath)
+ outfile = os.path.join(redirect_output, os.path.basename(appendpath))
+ # Only take a copy if the file isn't already there (this function may be called
+ # multiple times per operation when we're handling overrides)
+ if os.path.exists(appendpath) and not os.path.exists(outfile):
+ shutil.copy2(appendpath, outfile)
+ else:
+ bb.note('Writing append file %s' % appendpath)
+ outfile = appendpath
+
+ if os.path.exists(outfile):
+ # Work around lack of nonlocal in python 2
+ extvars = {'destsubdir': destsubdir}
+
+ def appendfile_varfunc(varname, origvalue, op, newlines):
+ if varname == 'FILESEXTRAPATHS_prepend':
+ if origvalue.startswith('${THISDIR}/'):
+ popline('FILESEXTRAPATHS_prepend')
+ extvars['destsubdir'] = rd.expand(origvalue.split('${THISDIR}/', 1)[1].rstrip(':'))
+ elif varname == 'PACKAGE_ARCH':
+ if machine:
+ popline('PACKAGE_ARCH')
+ return (machine, None, 4, False)
+ elif varname.startswith('do_install_append'):
+ func = popline(varname)
+ if func:
+ instfunclines = [line.strip() for line in origvalue.strip('\n').splitlines()]
+ for line in func[2]:
+ if not line in instfunclines:
+ instfunclines.append(line)
+ return (instfunclines, None, 4, False)
+ else:
+ splitval = split_var_value(origvalue, assignment=False)
+ changed = False
+ removevar = varname
+ if varname in ['SRC_URI', 'SRC_URI_append%s' % appendoverride]:
+ removevar = 'SRC_URI'
+ line = popline(varname)
+ if line:
+ if line[2] not in splitval:
+ splitval.append(line[2])
+ changed = True
+ else:
+ line = popline(varname)
+ if line:
+ splitval = [line[2]]
+ changed = True
+
+ if removevar in removevalues:
+ remove = removevalues[removevar]
+ if isinstance(remove, str):
+ if remove in splitval:
+ splitval.remove(remove)
+ changed = True
+ else:
+ for removeitem in remove:
+ if removeitem in splitval:
+ splitval.remove(removeitem)
+ changed = True
+
+ if changed:
+ newvalue = splitval
+ if len(newvalue) == 1:
+ # Ensure it's written out as one line
+ if '_append' in varname:
+ newvalue = ' ' + newvalue[0]
+ else:
+ newvalue = newvalue[0]
+ if not newvalue and (op in ['+=', '.='] or '_append' in varname):
+ # There's no point appending nothing
+ newvalue = None
+ if varname.endswith('()'):
+ indent = 4
+ else:
+ indent = -1
+ return (newvalue, None, indent, True)
+ return (origvalue, None, 4, False)
+
+ varnames = [item[0] for item in bbappendlines]
+ if removevalues:
+ varnames.extend(list(removevalues.keys()))
+
+ with open(outfile, 'r') as f:
+ (updated, newlines) = bb.utils.edit_metadata(f, varnames, appendfile_varfunc)
+
+ destsubdir = extvars['destsubdir']
+ else:
+ updated = False
+ newlines = []
+
+ if bbappendlines:
+ for line in bbappendlines:
+ if line[0].endswith('()'):
+ newlines.append('%s {\n %s\n}\n' % (line[0], '\n '.join(line[2])))
+ else:
+ newlines.append('%s %s "%s"\n\n' % line)
+ updated = True
+
+ if updated:
+ with open(outfile, 'w') as f:
+ f.writelines(newlines)
+
+ if copyfiles:
+ if machine:
+ destsubdir = os.path.join(destsubdir, machine)
+ if redirect_output:
+ outdir = redirect_output
+ else:
+ outdir = appenddir
+ for newfile, srcfile in copyfiles.items():
+ filedest = os.path.join(outdir, destsubdir, os.path.basename(srcfile))
+ if os.path.abspath(newfile) != os.path.abspath(filedest):
+ if newfile.startswith(tempfile.gettempdir()):
+ newfiledisp = os.path.basename(newfile)
+ else:
+ newfiledisp = newfile
+ if redirect_output:
+ bb.note('Copying %s to %s (dry-run)' % (newfiledisp, os.path.join(appenddir, destsubdir, os.path.basename(srcfile))))
+ else:
+ bb.note('Copying %s to %s' % (newfiledisp, filedest))
+ bb.utils.mkdirhier(os.path.dirname(filedest))
+ shutil.copyfile(newfile, filedest)
+
+ return (appendpath, os.path.join(appenddir, destsubdir))
+
+
+def find_layerdir(fn):
+ """ Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
+ pth = os.path.abspath(fn)
+ layerdir = ''
+ while pth:
+ if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
+ layerdir = pth
+ break
+ pth = os.path.dirname(pth)
+ if pth == '/':
+ return None
+ return layerdir
+
+
+def replace_dir_vars(path, d):
+ """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})"""
+ dirvars = {}
+ # Sort by length so we get the variables we're interested in first
+ for var in sorted(list(d.keys()), key=len):
+ if var.endswith('dir') and var.lower() == var:
+ value = d.getVar(var)
+ if value.startswith('/') and not '\n' in value and value not in dirvars:
+ dirvars[value] = var
+ for dirpath in sorted(list(dirvars.keys()), reverse=True):
+ path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
+ return path
+
+def get_recipe_pv_without_srcpv(pv, uri_type):
+ """
+ Get PV without SRCPV common in SCM's for now only
+ support git.
+
+ Returns tuple with pv, prefix and suffix.
+ """
+ pfx = ''
+ sfx = ''
+
+ if uri_type == 'git':
+ git_regex = re.compile("(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?")
+ m = git_regex.match(pv)
+
+ if m:
+ pv = m.group('ver')
+ pfx = m.group('pfx')
+ sfx = m.group('sfx')
+ else:
+ regex = re.compile("(?P<pfx>(v|r)?)(?P<ver>.*)")
+ m = regex.match(pv)
+ if m:
+ pv = m.group('ver')
+ pfx = m.group('pfx')
+
+ return (pv, pfx, sfx)
+
+def get_recipe_upstream_version(rd):
+ """
+ Get upstream version of recipe using bb.fetch2 methods with support for
+ http, https, ftp and git.
+
+ bb.fetch2 exceptions can be raised,
+ FetchError when don't have network access or upstream site don't response.
+ NoMethodError when uri latest_versionstring method isn't implemented.
+
+ Returns a dictonary with version, repository revision, current_version, type and datetime.
+ Type can be A for Automatic, M for Manual and U for Unknown.
+ """
+ from bb.fetch2 import decodeurl
+ from datetime import datetime
+
+ ru = {}
+ ru['current_version'] = rd.getVar('PV')
+ ru['version'] = ''
+ ru['type'] = 'U'
+ ru['datetime'] = ''
+ ru['revision'] = ''
+
+ # XXX: If don't have SRC_URI means that don't have upstream sources so
+ # returns the current recipe version, so that upstream version check
+ # declares a match.
+ src_uris = rd.getVar('SRC_URI')
+ if not src_uris:
+ ru['version'] = ru['current_version']
+ ru['type'] = 'M'
+ ru['datetime'] = datetime.now()
+ return ru
+
+ # XXX: we suppose that the first entry points to the upstream sources
+ src_uri = src_uris.split()[0]
+ uri_type, _, _, _, _, _ = decodeurl(src_uri)
+
+ (pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd.getVar('PV'), uri_type)
+ ru['current_version'] = pv
+
+ manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION")
+ if manual_upstream_version:
+ # manual tracking of upstream version.
+ ru['version'] = manual_upstream_version
+ ru['type'] = 'M'
+
+ manual_upstream_date = rd.getVar("CHECK_DATE")
+ if manual_upstream_date:
+ date = datetime.strptime(manual_upstream_date, "%b %d, %Y")
+ else:
+ date = datetime.now()
+ ru['datetime'] = date
+
+ elif uri_type == "file":
+ # files are always up-to-date
+ ru['version'] = pv
+ ru['type'] = 'A'
+ ru['datetime'] = datetime.now()
+ else:
+ ud = bb.fetch2.FetchData(src_uri, rd)
+ if rd.getVar("UPSTREAM_CHECK_COMMITS") == "1":
+ revision = ud.method.latest_revision(ud, rd, 'default')
+ upversion = pv
+ if revision != rd.getVar("SRCREV"):
+ upversion = upversion + "-new-commits-available"
+ else:
+ pupver = ud.method.latest_versionstring(ud, rd)
+ (upversion, revision) = pupver
+
+ if upversion:
+ ru['version'] = upversion
+ ru['type'] = 'A'
+
+ if revision:
+ ru['revision'] = revision
+
+ ru['datetime'] = datetime.now()
+
+ return ru
diff --git a/poky/meta/lib/oe/rootfs.py b/poky/meta/lib/oe/rootfs.py
new file mode 100644
index 000000000..f8f717c05
--- /dev/null
+++ b/poky/meta/lib/oe/rootfs.py
@@ -0,0 +1,973 @@
+from abc import ABCMeta, abstractmethod
+from oe.utils import execute_pre_post_process
+from oe.package_manager import *
+from oe.manifest import *
+import oe.path
+import filecmp
+import shutil
+import os
+import subprocess
+import re
+
+
+class Rootfs(object, metaclass=ABCMeta):
+ """
+ This is an abstract class. Do not instantiate this directly.
+ """
+
+ def __init__(self, d, progress_reporter=None, logcatcher=None):
+ self.d = d
+ self.pm = None
+ self.image_rootfs = self.d.getVar('IMAGE_ROOTFS')
+ self.deploydir = self.d.getVar('IMGDEPLOYDIR')
+ self.progress_reporter = progress_reporter
+ self.logcatcher = logcatcher
+
+ self.install_order = Manifest.INSTALL_ORDER
+
+ @abstractmethod
+ def _create(self):
+ pass
+
+ @abstractmethod
+ def _get_delayed_postinsts(self):
+ pass
+
+ @abstractmethod
+ def _save_postinsts(self):
+ pass
+
+ @abstractmethod
+ def _log_check(self):
+ pass
+
+ def _log_check_common(self, type, match):
+ # Ignore any lines containing log_check to avoid recursion, and ignore
+ # lines beginning with a + since sh -x may emit code which isn't
+ # actually executed, but may contain error messages
+ excludes = [ 'log_check', r'^\+' ]
+ if hasattr(self, 'log_check_expected_regexes'):
+ excludes.extend(self.log_check_expected_regexes)
+ excludes = [re.compile(x) for x in excludes]
+ r = re.compile(match)
+ log_path = self.d.expand("${T}/log.do_rootfs")
+ messages = []
+ with open(log_path, 'r') as log:
+ for line in log:
+ if self.logcatcher and self.logcatcher.contains(line.rstrip()):
+ continue
+ for ee in excludes:
+ m = ee.search(line)
+ if m:
+ break
+ if m:
+ continue
+
+ m = r.search(line)
+ if m:
+ messages.append('[log_check] %s' % line)
+ if messages:
+ if len(messages) == 1:
+ msg = '1 %s message' % type
+ else:
+ msg = '%d %s messages' % (len(messages), type)
+ msg = '[log_check] %s: found %s in the logfile:\n%s' % \
+ (self.d.getVar('PN'), msg, ''.join(messages))
+ if type == 'error':
+ bb.fatal(msg)
+ else:
+ bb.warn(msg)
+
+ def _log_check_warn(self):
+ self._log_check_common('warning', '^(warn|Warn|WARNING:)')
+
+ def _log_check_error(self):
+ self._log_check_common('error', self.log_check_regex)
+
+ def _insert_feed_uris(self):
+ if bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d):
+ self.pm.insert_feeds_uris(self.d.getVar('PACKAGE_FEED_URIS') or "",
+ self.d.getVar('PACKAGE_FEED_BASE_PATHS') or "",
+ self.d.getVar('PACKAGE_FEED_ARCHS'))
+
+
+ """
+ The _cleanup() method should be used to clean-up stuff that we don't really
+ want to end up on target. For example, in the case of RPM, the DB locks.
+ The method is called, once, at the end of create() method.
+ """
+ @abstractmethod
+ def _cleanup(self):
+ pass
+
+ def _setup_dbg_rootfs(self, dirs):
+ gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS') or '0'
+ if gen_debugfs != '1':
+ return
+
+ bb.note(" Renaming the original rootfs...")
+ try:
+ shutil.rmtree(self.image_rootfs + '-orig')
+ except:
+ pass
+ os.rename(self.image_rootfs, self.image_rootfs + '-orig')
+
+ bb.note(" Creating debug rootfs...")
+ bb.utils.mkdirhier(self.image_rootfs)
+
+ bb.note(" Copying back package database...")
+ for dir in dirs:
+ if not os.path.isdir(self.image_rootfs + '-orig' + dir):
+ continue
+ bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(dir))
+ shutil.copytree(self.image_rootfs + '-orig' + dir, self.image_rootfs + dir, symlinks=True)
+
+ cpath = oe.cachedpath.CachedPath()
+ # Copy files located in /usr/lib/debug or /usr/src/debug
+ for dir in ["/usr/lib/debug", "/usr/src/debug"]:
+ src = self.image_rootfs + '-orig' + dir
+ if cpath.exists(src):
+ dst = self.image_rootfs + dir
+ bb.utils.mkdirhier(os.path.dirname(dst))
+ shutil.copytree(src, dst)
+
+ # Copy files with suffix '.debug' or located in '.debug' dir.
+ for root, dirs, files in cpath.walk(self.image_rootfs + '-orig'):
+ relative_dir = root[len(self.image_rootfs + '-orig'):]
+ for f in files:
+ if f.endswith('.debug') or '/.debug' in relative_dir:
+ bb.utils.mkdirhier(self.image_rootfs + relative_dir)
+ shutil.copy(os.path.join(root, f),
+ self.image_rootfs + relative_dir)
+
+ bb.note(" Install complementary '*-dbg' packages...")
+ self.pm.install_complementary('*-dbg')
+
+ bb.note(" Rename debug rootfs...")
+ try:
+ shutil.rmtree(self.image_rootfs + '-dbg')
+ except:
+ pass
+ os.rename(self.image_rootfs, self.image_rootfs + '-dbg')
+
+ bb.note(" Restoreing original rootfs...")
+ os.rename(self.image_rootfs + '-orig', self.image_rootfs)
+
+ def _exec_shell_cmd(self, cmd):
+ fakerootcmd = self.d.getVar('FAKEROOT')
+ if fakerootcmd is not None:
+ exec_cmd = [fakerootcmd, cmd]
+ else:
+ exec_cmd = cmd
+
+ try:
+ subprocess.check_output(exec_cmd, stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as e:
+ return("Command '%s' returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+ return None
+
+ def create(self):
+ bb.note("###### Generate rootfs #######")
+ pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND")
+ post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND")
+ rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND')
+
+ bb.utils.mkdirhier(self.image_rootfs)
+
+ bb.utils.mkdirhier(self.deploydir)
+
+ execute_pre_post_process(self.d, pre_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ # call the package manager dependent create method
+ self._create()
+
+ sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir')
+ bb.utils.mkdirhier(sysconfdir)
+ with open(sysconfdir + "/version", "w+") as ver:
+ ver.write(self.d.getVar('BUILDNAME') + "\n")
+
+ execute_pre_post_process(self.d, rootfs_post_install_cmds)
+
+ self.pm.run_intercepts()
+
+ execute_pre_post_process(self.d, post_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ if bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+ True, False, self.d):
+ delayed_postinsts = self._get_delayed_postinsts()
+ if delayed_postinsts is not None:
+ bb.fatal("The following packages could not be configured "
+ "offline and rootfs is read-only: %s" %
+ delayed_postinsts)
+
+ if self.d.getVar('USE_DEVFS') != "1":
+ self._create_devfs()
+
+ self._uninstall_unneeded()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self._insert_feed_uris()
+
+ self._run_ldconfig()
+
+ if self.d.getVar('USE_DEPMOD') != "0":
+ self._generate_kernel_module_deps()
+
+ self._cleanup()
+ self._log_check()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+
+ def _uninstall_unneeded(self):
+ # Remove unneeded init script symlinks
+ delayed_postinsts = self._get_delayed_postinsts()
+ if delayed_postinsts is None:
+ if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
+ self._exec_shell_cmd(["update-rc.d", "-f", "-r",
+ self.d.getVar('IMAGE_ROOTFS'),
+ "run-postinsts", "remove"])
+
+ image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+ True, False, self.d)
+ image_rorfs_force = self.d.getVar('FORCE_RO_REMOVE')
+
+ if image_rorfs or image_rorfs_force == "1":
+ # Remove components that we don't need if it's a read-only rootfs
+ unneeded_pkgs = self.d.getVar("ROOTFS_RO_UNNEEDED").split()
+ pkgs_installed = image_list_installed_packages(self.d)
+ # Make sure update-alternatives is removed last. This is
+ # because its database has to available while uninstalling
+ # other packages, allowing alternative symlinks of packages
+ # to be uninstalled or to be managed correctly otherwise.
+ provider = self.d.getVar("VIRTUAL-RUNTIME_update-alternatives")
+ pkgs_to_remove = sorted([pkg for pkg in pkgs_installed if pkg in unneeded_pkgs], key=lambda x: x == provider)
+
+ # update-alternatives provider is removed in its own remove()
+ # call because all package managers do not guarantee the packages
+ # are removed in the order they given in the list (which is
+ # passed to the command line). The sorting done earlier is
+ # utilized to implement the 2-stage removal.
+ if len(pkgs_to_remove) > 1:
+ self.pm.remove(pkgs_to_remove[:-1], False)
+ if len(pkgs_to_remove) > 0:
+ self.pm.remove([pkgs_to_remove[-1]], False)
+
+ if delayed_postinsts:
+ self._save_postinsts()
+ if image_rorfs:
+ bb.warn("There are post install scripts "
+ "in a read-only rootfs")
+
+ post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND")
+ execute_pre_post_process(self.d, post_uninstall_cmds)
+
+ runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management",
+ True, False, self.d)
+ if not runtime_pkgmanage:
+ # Remove the package manager data files
+ self.pm.remove_packaging_data()
+
+ def _run_ldconfig(self):
+ if self.d.getVar('LDCONFIGDEPEND'):
+ bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v")
+ self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
+ 'new', '-v'])
+
+ def _check_for_kernel_modules(self, modules_dir):
+ for root, dirs, files in os.walk(modules_dir, topdown=True):
+ for name in files:
+ found_ko = name.endswith(".ko")
+ if found_ko:
+ return found_ko
+ return False
+
+ def _generate_kernel_module_deps(self):
+ modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules')
+ # if we don't have any modules don't bother to do the depmod
+ if not self._check_for_kernel_modules(modules_dir):
+ bb.note("No Kernel Modules found, not running depmod")
+ return
+
+ kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR'), "kernel-depmod",
+ 'kernel-abiversion')
+ if not os.path.exists(kernel_abi_ver_file):
+ bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file)
+
+ kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')
+ versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver)
+
+ bb.utils.mkdirhier(versioned_modules_dir)
+
+ self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver])
+
+ """
+ Create devfs:
+ * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
+ * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached
+ for in the BBPATH
+ If neither are specified then the default name of files/device_table-minimal.txt
+ is searched for in the BBPATH (same as the old version.)
+ """
+ def _create_devfs(self):
+ devtable_list = []
+ devtable = self.d.getVar('IMAGE_DEVICE_TABLE')
+ if devtable is not None:
+ devtable_list.append(devtable)
+ else:
+ devtables = self.d.getVar('IMAGE_DEVICE_TABLES')
+ if devtables is None:
+ devtables = 'files/device_table-minimal.txt'
+ for devtable in devtables.split():
+ devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH'), devtable))
+
+ for devtable in devtable_list:
+ self._exec_shell_cmd(["makedevs", "-r",
+ self.image_rootfs, "-D", devtable])
+
+
+class RpmRootfs(Rootfs):
+ def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+ super(RpmRootfs, self).__init__(d, progress_reporter, logcatcher)
+ self.log_check_regex = '(unpacking of archive failed|Cannot find package'\
+ '|exit 1|ERROR: |Error: |Error |ERROR '\
+ '|Failed |Failed: |Failed$|Failed\(\d+\):)'
+ self.manifest = RpmManifest(d, manifest_dir)
+
+ self.pm = RpmPM(d,
+ d.getVar('IMAGE_ROOTFS'),
+ self.d.getVar('TARGET_VENDOR')
+ )
+
+ self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
+ if self.inc_rpm_image_gen != "1":
+ bb.utils.remove(self.image_rootfs, True)
+ else:
+ self.pm.recovery_packaging_data()
+ bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
+
+ self.pm.create_configs()
+
+ '''
+ While rpm incremental image generation is enabled, it will remove the
+ unneeded pkgs by comparing the new install solution manifest and the
+ old installed manifest.
+ '''
+ def _create_incremental(self, pkgs_initial_install):
+ if self.inc_rpm_image_gen == "1":
+
+ pkgs_to_install = list()
+ for pkg_type in pkgs_initial_install:
+ pkgs_to_install += pkgs_initial_install[pkg_type]
+
+ installed_manifest = self.pm.load_old_install_solution()
+ solution_manifest = self.pm.dump_install_solution(pkgs_to_install)
+
+ pkg_to_remove = list()
+ for pkg in installed_manifest:
+ if pkg not in solution_manifest:
+ pkg_to_remove.append(pkg)
+
+ self.pm.update()
+
+ bb.note('incremental update -- upgrade packages in place ')
+ self.pm.upgrade()
+ if pkg_to_remove != []:
+ bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
+ self.pm.remove(pkg_to_remove)
+
+ self.pm.autoremove()
+
+ def _create(self):
+ pkgs_to_install = self.manifest.parse_initial_manifest()
+ rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
+ rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS')
+
+ # update PM index files
+ self.pm.write_index()
+
+ execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ if self.inc_rpm_image_gen == "1":
+ self._create_incremental(pkgs_to_install)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self.pm.update()
+
+ pkgs = []
+ pkgs_attempt = []
+ for pkg_type in pkgs_to_install:
+ if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+ pkgs_attempt += pkgs_to_install[pkg_type]
+ else:
+ pkgs += pkgs_to_install[pkg_type]
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self.pm.install(pkgs)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self.pm.install(pkgs_attempt, True)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self.pm.install_complementary()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self._setup_dbg_rootfs(['/etc', '/var/lib/rpm', '/var/cache/dnf', '/var/lib/dnf'])
+
+ execute_pre_post_process(self.d, rpm_post_process_cmds)
+
+ if self.inc_rpm_image_gen == "1":
+ self.pm.backup_packaging_data()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+
+ @staticmethod
+ def _depends_list():
+ return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 'RPM_PREPROCESS_COMMANDS',
+ 'RPM_POSTPROCESS_COMMANDS', 'RPM_PREFER_ELF_ARCH']
+
+ def _get_delayed_postinsts(self):
+ postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts")
+ if os.path.isdir(postinst_dir):
+ files = os.listdir(postinst_dir)
+ for f in files:
+ bb.note('Delayed package scriptlet: %s' % f)
+ return files
+
+ return None
+
+ def _save_postinsts(self):
+ # this is just a stub. For RPM, the failed postinstalls are
+ # already saved in /etc/rpm-postinsts
+ pass
+
+ def _log_check(self):
+ self._log_check_warn()
+ self._log_check_error()
+
+ def _cleanup(self):
+ self.pm._invoke_dnf(["clean", "all"])
+
+
+class DpkgOpkgRootfs(Rootfs):
+ def __init__(self, d, progress_reporter=None, logcatcher=None):
+ super(DpkgOpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+
+ def _get_pkgs_postinsts(self, status_file):
+ def _get_pkg_depends_list(pkg_depends):
+ pkg_depends_list = []
+ # filter version requirements like libc (>= 1.1)
+ for dep in pkg_depends.split(', '):
+ m_dep = re.match("^(.*) \(.*\)$", dep)
+ if m_dep:
+ dep = m_dep.group(1)
+ pkg_depends_list.append(dep)
+
+ return pkg_depends_list
+
+ pkgs = {}
+ pkg_name = ""
+ pkg_status_match = False
+ pkg_depends = ""
+
+ with open(status_file) as status:
+ data = status.read()
+ status.close()
+ for line in data.split('\n'):
+ m_pkg = re.match("^Package: (.*)", line)
+ m_status = re.match("^Status:.*unpacked", line)
+ m_depends = re.match("^Depends: (.*)", line)
+
+ if m_pkg is not None:
+ if pkg_name and pkg_status_match:
+ pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+
+ pkg_name = m_pkg.group(1)
+ pkg_status_match = False
+ pkg_depends = ""
+ elif m_status is not None:
+ pkg_status_match = True
+ elif m_depends is not None:
+ pkg_depends = m_depends.group(1)
+
+ # remove package dependencies not in postinsts
+ pkg_names = list(pkgs.keys())
+ for pkg_name in pkg_names:
+ deps = pkgs[pkg_name][:]
+
+ for d in deps:
+ if d not in pkg_names:
+ pkgs[pkg_name].remove(d)
+
+ return pkgs
+
+ def _get_delayed_postinsts_common(self, status_file):
+ def _dep_resolve(graph, node, resolved, seen):
+ seen.append(node)
+
+ for edge in graph[node]:
+ if edge not in resolved:
+ if edge in seen:
+ raise RuntimeError("Packages %s and %s have " \
+ "a circular dependency in postinsts scripts." \
+ % (node, edge))
+ _dep_resolve(graph, edge, resolved, seen)
+
+ resolved.append(node)
+
+ pkg_list = []
+
+ pkgs = None
+ if not self.d.getVar('PACKAGE_INSTALL').strip():
+ bb.note("Building empty image")
+ else:
+ pkgs = self._get_pkgs_postinsts(status_file)
+ if pkgs:
+ root = "__packagegroup_postinst__"
+ pkgs[root] = list(pkgs.keys())
+ _dep_resolve(pkgs, root, pkg_list, [])
+ pkg_list.remove(root)
+
+ if len(pkg_list) == 0:
+ return None
+
+ return pkg_list
+
+ def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+ num = 0
+ for p in self._get_delayed_postinsts():
+ bb.utils.mkdirhier(dst_postinst_dir)
+
+ if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+ shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+ os.path.join(dst_postinst_dir, "%03d-%s" % (num, p)))
+
+ num += 1
+
+class DpkgRootfs(DpkgOpkgRootfs):
+ def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+ super(DpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+ self.log_check_regex = '^E:'
+ self.log_check_expected_regexes = \
+ [
+ "^E: Unmet dependencies."
+ ]
+
+ bb.utils.remove(self.image_rootfs, True)
+ bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
+ self.manifest = DpkgManifest(d, manifest_dir)
+ self.pm = DpkgPM(d, d.getVar('IMAGE_ROOTFS'),
+ d.getVar('PACKAGE_ARCHS'),
+ d.getVar('DPKG_ARCH'))
+
+
+ def _create(self):
+ pkgs_to_install = self.manifest.parse_initial_manifest()
+ deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS')
+ deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS')
+
+ alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
+ bb.utils.mkdirhier(alt_dir)
+
+ # update PM index files
+ self.pm.write_index()
+
+ execute_pre_post_process(self.d, deb_pre_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+ # Don't support incremental, so skip that
+ self.progress_reporter.next_stage()
+
+ self.pm.update()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ for pkg_type in self.install_order:
+ if pkg_type in pkgs_to_install:
+ self.pm.install(pkgs_to_install[pkg_type],
+ [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+ if self.progress_reporter:
+ # Don't support attemptonly, so skip that
+ self.progress_reporter.next_stage()
+ self.progress_reporter.next_stage()
+
+ self.pm.install_complementary()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self._setup_dbg_rootfs(['/var/lib/dpkg'])
+
+ self.pm.fix_broken_dependencies()
+
+ self.pm.mark_packages("installed")
+
+ self.pm.run_pre_post_installs()
+
+ execute_pre_post_process(self.d, deb_post_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ @staticmethod
+ def _depends_list():
+ return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
+
+ def _get_delayed_postinsts(self):
+ status_file = self.image_rootfs + "/var/lib/dpkg/status"
+ return self._get_delayed_postinsts_common(status_file)
+
+ def _save_postinsts(self):
+ dst_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/deb-postinsts")
+ src_postinst_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/info")
+ return self._save_postinsts_common(dst_postinst_dir, src_postinst_dir)
+
+ def _log_check(self):
+ self._log_check_warn()
+ self._log_check_error()
+
+ def _cleanup(self):
+ pass
+
+
+class OpkgRootfs(DpkgOpkgRootfs):
+ def __init__(self, d, manifest_dir, progress_reporter=None, logcatcher=None):
+ super(OpkgRootfs, self).__init__(d, progress_reporter, logcatcher)
+ self.log_check_regex = '(exit 1|Collected errors)'
+
+ self.manifest = OpkgManifest(d, manifest_dir)
+ self.opkg_conf = self.d.getVar("IPKGCONF_TARGET")
+ self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS")
+
+ self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN') or ""
+ if self._remove_old_rootfs():
+ bb.utils.remove(self.image_rootfs, True)
+ self.pm = OpkgPM(d,
+ self.image_rootfs,
+ self.opkg_conf,
+ self.pkg_archs)
+ else:
+ self.pm = OpkgPM(d,
+ self.image_rootfs,
+ self.opkg_conf,
+ self.pkg_archs)
+ self.pm.recover_packaging_data()
+
+ bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS'), True)
+
+ def _prelink_file(self, root_dir, filename):
+ bb.note('prelink %s in %s' % (filename, root_dir))
+ prelink_cfg = oe.path.join(root_dir,
+ self.d.expand('${sysconfdir}/prelink.conf'))
+ if not os.path.exists(prelink_cfg):
+ shutil.copy(self.d.expand('${STAGING_DIR_NATIVE}${sysconfdir_native}/prelink.conf'),
+ prelink_cfg)
+
+ cmd_prelink = self.d.expand('${STAGING_DIR_NATIVE}${sbindir_native}/prelink')
+ self._exec_shell_cmd([cmd_prelink,
+ '--root',
+ root_dir,
+ '-amR',
+ '-N',
+ '-c',
+ self.d.expand('${sysconfdir}/prelink.conf')])
+
+ '''
+ Compare two files with the same key twice to see if they are equal.
+ If they are not equal, it means they are duplicated and come from
+ different packages.
+ 1st: Comapre them directly;
+ 2nd: While incremental image creation is enabled, one of the
+ files could be probaly prelinked in the previous image
+ creation and the file has been changed, so we need to
+ prelink the other one and compare them.
+ '''
+ def _file_equal(self, key, f1, f2):
+
+ # Both of them are not prelinked
+ if filecmp.cmp(f1, f2):
+ return True
+
+ if self.image_rootfs not in f1:
+ self._prelink_file(f1.replace(key, ''), f1)
+
+ if self.image_rootfs not in f2:
+ self._prelink_file(f2.replace(key, ''), f2)
+
+ # Both of them are prelinked
+ if filecmp.cmp(f1, f2):
+ return True
+
+ # Not equal
+ return False
+
+ """
+ This function was reused from the old implementation.
+ See commit: "image.bbclass: Added variables for multilib support." by
+ Lianhao Lu.
+ """
+ def _multilib_sanity_test(self, dirs):
+
+ allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP")
+ if allow_replace is None:
+ allow_replace = ""
+
+ allow_rep = re.compile(re.sub("\|$", "", allow_replace))
+ error_prompt = "Multilib check error:"
+
+ files = {}
+ for dir in dirs:
+ for root, subfolders, subfiles in os.walk(dir):
+ for file in subfiles:
+ item = os.path.join(root, file)
+ key = str(os.path.join("/", os.path.relpath(item, dir)))
+
+ valid = True
+ if key in files:
+ #check whether the file is allow to replace
+ if allow_rep.match(key):
+ valid = True
+ else:
+ if os.path.exists(files[key]) and \
+ os.path.exists(item) and \
+ not self._file_equal(key, files[key], item):
+ valid = False
+ bb.fatal("%s duplicate files %s %s is not the same\n" %
+ (error_prompt, item, files[key]))
+
+ #pass the check, add to list
+ if valid:
+ files[key] = item
+
+ def _multilib_test_install(self, pkgs):
+ ml_temp = self.d.getVar("MULTILIB_TEMP_ROOTFS")
+ bb.utils.mkdirhier(ml_temp)
+
+ dirs = [self.image_rootfs]
+
+ for variant in self.d.getVar("MULTILIB_VARIANTS").split():
+ ml_target_rootfs = os.path.join(ml_temp, variant)
+
+ bb.utils.remove(ml_target_rootfs, True)
+
+ ml_opkg_conf = os.path.join(ml_temp,
+ variant + "-" + os.path.basename(self.opkg_conf))
+
+ ml_pm = OpkgPM(self.d, ml_target_rootfs, ml_opkg_conf, self.pkg_archs)
+
+ ml_pm.update()
+ ml_pm.install(pkgs)
+
+ dirs.append(ml_target_rootfs)
+
+ self._multilib_sanity_test(dirs)
+
+ '''
+ While ipk incremental image generation is enabled, it will remove the
+ unneeded pkgs by comparing the old full manifest in previous existing
+ image and the new full manifest in the current image.
+ '''
+ def _remove_extra_packages(self, pkgs_initial_install):
+ if self.inc_opkg_image_gen == "1":
+ # Parse full manifest in previous existing image creation session
+ old_full_manifest = self.manifest.parse_full_manifest()
+
+ # Create full manifest for the current image session, the old one
+ # will be replaced by the new one.
+ self.manifest.create_full(self.pm)
+
+ # Parse full manifest in current image creation session
+ new_full_manifest = self.manifest.parse_full_manifest()
+
+ pkg_to_remove = list()
+ for pkg in old_full_manifest:
+ if pkg not in new_full_manifest:
+ pkg_to_remove.append(pkg)
+
+ if pkg_to_remove != []:
+ bb.note('decremental removed: %s' % ' '.join(pkg_to_remove))
+ self.pm.remove(pkg_to_remove)
+
+ '''
+ Compare with previous existing image creation, if some conditions
+ triggered, the previous old image should be removed.
+ The conditions include any of 'PACKAGE_EXCLUDE, NO_RECOMMENDATIONS
+ and BAD_RECOMMENDATIONS' has been changed.
+ '''
+ def _remove_old_rootfs(self):
+ if self.inc_opkg_image_gen != "1":
+ return True
+
+ vars_list_file = self.d.expand('${T}/vars_list')
+
+ old_vars_list = ""
+ if os.path.exists(vars_list_file):
+ old_vars_list = open(vars_list_file, 'r+').read()
+
+ new_vars_list = '%s:%s:%s\n' % \
+ ((self.d.getVar('BAD_RECOMMENDATIONS') or '').strip(),
+ (self.d.getVar('NO_RECOMMENDATIONS') or '').strip(),
+ (self.d.getVar('PACKAGE_EXCLUDE') or '').strip())
+ open(vars_list_file, 'w+').write(new_vars_list)
+
+ if old_vars_list != new_vars_list:
+ return True
+
+ return False
+
+ def _create(self):
+ pkgs_to_install = self.manifest.parse_initial_manifest()
+ opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS')
+ opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS')
+
+ # update PM index files, unless users provide their own feeds
+ if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
+ self.pm.write_index()
+
+ execute_pre_post_process(self.d, opkg_pre_process_cmds)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+ # Steps are a bit different in order, skip next
+ self.progress_reporter.next_stage()
+
+ self.pm.update()
+
+ self.pm.handle_bad_recommendations()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ if self.inc_opkg_image_gen == "1":
+ self._remove_extra_packages(pkgs_to_install)
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ for pkg_type in self.install_order:
+ if pkg_type in pkgs_to_install:
+ # For multilib, we perform a sanity test before final install
+ # If sanity test fails, it will automatically do a bb.fatal()
+ # and the installation will stop
+ if pkg_type == Manifest.PKG_TYPE_MULTILIB:
+ self._multilib_test_install(pkgs_to_install[pkg_type])
+
+ self.pm.install(pkgs_to_install[pkg_type],
+ [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ self.pm.install_complementary()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ opkg_lib_dir = self.d.getVar('OPKGLIBDIR')
+ opkg_dir = os.path.join(opkg_lib_dir, 'opkg')
+ self._setup_dbg_rootfs([opkg_dir])
+
+ execute_pre_post_process(self.d, opkg_post_process_cmds)
+
+ if self.inc_opkg_image_gen == "1":
+ self.pm.backup_packaging_data()
+
+ if self.progress_reporter:
+ self.progress_reporter.next_stage()
+
+ @staticmethod
+ def _depends_list():
+ return ['IPKGCONF_SDK', 'IPK_FEED_URIS', 'DEPLOY_DIR_IPK', 'IPKGCONF_TARGET', 'INC_IPK_IMAGE_GEN', 'OPKG_ARGS', 'OPKGLIBDIR', 'OPKG_PREPROCESS_COMMANDS', 'OPKG_POSTPROCESS_COMMANDS', 'OPKGLIBDIR']
+
+ def _get_delayed_postinsts(self):
+ status_file = os.path.join(self.image_rootfs,
+ self.d.getVar('OPKGLIBDIR').strip('/'),
+ "opkg", "status")
+ return self._get_delayed_postinsts_common(status_file)
+
+ def _save_postinsts(self):
+ dst_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts")
+ src_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info")
+ return self._save_postinsts_common(dst_postinst_dir, src_postinst_dir)
+
+ def _log_check(self):
+ self._log_check_warn()
+ self._log_check_error()
+
+ def _cleanup(self):
+ self.pm.remove_lists()
+
+def get_class_for_type(imgtype):
+ return {"rpm": RpmRootfs,
+ "ipk": OpkgRootfs,
+ "deb": DpkgRootfs}[imgtype]
+
+def variable_depends(d, manifest_dir=None):
+ img_type = d.getVar('IMAGE_PKGTYPE')
+ cls = get_class_for_type(img_type)
+ return cls._depends_list()
+
+def create_rootfs(d, manifest_dir=None, progress_reporter=None, logcatcher=None):
+ env_bkp = os.environ.copy()
+
+ img_type = d.getVar('IMAGE_PKGTYPE')
+ if img_type == "rpm":
+ RpmRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
+ elif img_type == "ipk":
+ OpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
+ elif img_type == "deb":
+ DpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
+
+ os.environ.clear()
+ os.environ.update(env_bkp)
+
+
+def image_list_installed_packages(d, rootfs_dir=None):
+ if not rootfs_dir:
+ rootfs_dir = d.getVar('IMAGE_ROOTFS')
+
+ img_type = d.getVar('IMAGE_PKGTYPE')
+ if img_type == "rpm":
+ return RpmPkgsList(d, rootfs_dir).list_pkgs()
+ elif img_type == "ipk":
+ return OpkgPkgsList(d, rootfs_dir, d.getVar("IPKGCONF_TARGET")).list_pkgs()
+ elif img_type == "deb":
+ return DpkgPkgsList(d, rootfs_dir).list_pkgs()
+
+if __name__ == "__main__":
+ """
+ We should be able to run this as a standalone script, from outside bitbake
+ environment.
+ """
+ """
+ TBD
+ """
diff --git a/poky/meta/lib/oe/sdk.py b/poky/meta/lib/oe/sdk.py
new file mode 100644
index 000000000..d6a503372
--- /dev/null
+++ b/poky/meta/lib/oe/sdk.py
@@ -0,0 +1,473 @@
+from abc import ABCMeta, abstractmethod
+from oe.utils import execute_pre_post_process
+from oe.manifest import *
+from oe.package_manager import *
+import os
+import shutil
+import glob
+import traceback
+
+def generate_locale_archive(d, rootfs):
+ # Pretty sure we don't need this for SDK archive generation but
+ # keeping it to be safe...
+ target_arch = d.getVar('SDK_ARCH')
+ locale_arch_options = { \
+ "arm": ["--uint32-align=4", "--little-endian"],
+ "armeb": ["--uint32-align=4", "--big-endian"],
+ "aarch64": ["--uint32-align=4", "--little-endian"],
+ "aarch64_be": ["--uint32-align=4", "--big-endian"],
+ "sh4": ["--uint32-align=4", "--big-endian"],
+ "powerpc": ["--uint32-align=4", "--big-endian"],
+ "powerpc64": ["--uint32-align=4", "--big-endian"],
+ "mips": ["--uint32-align=4", "--big-endian"],
+ "mipsisa32r6": ["--uint32-align=4", "--big-endian"],
+ "mips64": ["--uint32-align=4", "--big-endian"],
+ "mipsisa64r6": ["--uint32-align=4", "--big-endian"],
+ "mipsel": ["--uint32-align=4", "--little-endian"],
+ "mipsisa32r6el": ["--uint32-align=4", "--little-endian"],
+ "mips64el": ["--uint32-align=4", "--little-endian"],
+ "mipsisa64r6el": ["--uint32-align=4", "--little-endian"],
+ "i586": ["--uint32-align=4", "--little-endian"],
+ "i686": ["--uint32-align=4", "--little-endian"],
+ "x86_64": ["--uint32-align=4", "--little-endian"]
+ }
+ if target_arch in locale_arch_options:
+ arch_options = locale_arch_options[target_arch]
+ else:
+ bb.error("locale_arch_options not found for target_arch=" + target_arch)
+ bb.fatal("unknown arch:" + target_arch + " for locale_arch_options")
+
+ localedir = oe.path.join(rootfs, d.getVar("libdir_nativesdk"), "locale")
+ # Need to set this so cross-localedef knows where the archive is
+ env = dict(os.environ)
+ env["LOCALEARCHIVE"] = oe.path.join(localedir, "locale-archive")
+
+ for name in os.listdir(localedir):
+ path = os.path.join(localedir, name)
+ if os.path.isdir(path):
+ try:
+ cmd = ["cross-localedef", "--verbose"]
+ cmd += arch_options
+ cmd += ["--add-to-archive", path]
+ subprocess.check_output(cmd, env=env, stderr=subprocess.STDOUT)
+ except Exception as e:
+ bb.fatal("Cannot create locale archive: %s" % e.output)
+
+class Sdk(object, metaclass=ABCMeta):
+ def __init__(self, d, manifest_dir):
+ self.d = d
+ self.sdk_output = self.d.getVar('SDK_OUTPUT')
+ self.sdk_native_path = self.d.getVar('SDKPATHNATIVE').strip('/')
+ self.target_path = self.d.getVar('SDKTARGETSYSROOT').strip('/')
+ self.sysconfdir = self.d.getVar('sysconfdir').strip('/')
+
+ self.sdk_target_sysroot = os.path.join(self.sdk_output, self.target_path)
+ self.sdk_host_sysroot = self.sdk_output
+
+ if manifest_dir is None:
+ self.manifest_dir = self.d.getVar("SDK_DIR")
+ else:
+ self.manifest_dir = manifest_dir
+
+ self.remove(self.sdk_output, True)
+
+ self.install_order = Manifest.INSTALL_ORDER
+
+ @abstractmethod
+ def _populate(self):
+ pass
+
+ def populate(self):
+ self.mkdirhier(self.sdk_output)
+
+ # call backend dependent implementation
+ self._populate()
+
+ # Don't ship any libGL in the SDK
+ self.remove(os.path.join(self.sdk_output, self.sdk_native_path,
+ self.d.getVar('libdir_nativesdk').strip('/'),
+ "libGL*"))
+
+ # Fix or remove broken .la files
+ self.remove(os.path.join(self.sdk_output, self.sdk_native_path,
+ self.d.getVar('libdir_nativesdk').strip('/'),
+ "*.la"))
+
+ # Link the ld.so.cache file into the hosts filesystem
+ link_name = os.path.join(self.sdk_output, self.sdk_native_path,
+ self.sysconfdir, "ld.so.cache")
+ self.mkdirhier(os.path.dirname(link_name))
+ os.symlink("/etc/ld.so.cache", link_name)
+
+ execute_pre_post_process(self.d, self.d.getVar('SDK_POSTPROCESS_COMMAND'))
+
+ def movefile(self, sourcefile, destdir):
+ try:
+ # FIXME: this check of movefile's return code to None should be
+ # fixed within the function to use only exceptions to signal when
+ # something goes wrong
+ if (bb.utils.movefile(sourcefile, destdir) == None):
+ raise OSError("moving %s to %s failed"
+ %(sourcefile, destdir))
+ #FIXME: using umbrella exc catching because bb.utils method raises it
+ except Exception as e:
+ bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc())
+ bb.error("unable to place %s in final SDK location" % sourcefile)
+
+ def mkdirhier(self, dirpath):
+ try:
+ bb.utils.mkdirhier(dirpath)
+ except OSError as e:
+ bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc())
+ bb.fatal("cannot make dir for SDK: %s" % dirpath)
+
+ def remove(self, path, recurse=False):
+ try:
+ bb.utils.remove(path, recurse)
+ #FIXME: using umbrella exc catching because bb.utils method raises it
+ except Exception as e:
+ bb.debug(1, "printing the stack trace\n %s" %traceback.format_exc())
+ bb.warn("cannot remove SDK dir: %s" % path)
+
+ def install_locales(self, pm):
+ # This is only relevant for glibc
+ if self.d.getVar("TCLIBC") != "glibc":
+ return
+
+ linguas = self.d.getVar("SDKIMAGE_LINGUAS")
+ if linguas:
+ import fnmatch
+ # Install the binary locales
+ if linguas == "all":
+ pm.install_glob("nativesdk-glibc-binary-localedata-*.utf-8", sdk=True)
+ else:
+ for lang in linguas.split():
+ pm.install("nativesdk-glibc-binary-localedata-%s.utf-8" % lang)
+ # Generate a locale archive of them
+ generate_locale_archive(self.d, oe.path.join(self.sdk_host_sysroot, self.sdk_native_path))
+ # And now delete the binary locales
+ pkgs = fnmatch.filter(pm.list_installed(), "nativesdk-glibc-binary-localedata-*.utf-8")
+ pm.remove(pkgs)
+ else:
+ # No linguas so do nothing
+ pass
+
+
+class RpmSdk(Sdk):
+ def __init__(self, d, manifest_dir=None, rpm_workdir="oe-sdk-repo"):
+ super(RpmSdk, self).__init__(d, manifest_dir)
+
+ self.target_manifest = RpmManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_TARGET)
+ self.host_manifest = RpmManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ rpm_repo_workdir = "oe-sdk-repo"
+ if "sdk_ext" in d.getVar("BB_RUNTASK"):
+ rpm_repo_workdir = "oe-sdk-ext-repo"
+
+ self.target_pm = RpmPM(d,
+ self.sdk_target_sysroot,
+ self.d.getVar('TARGET_VENDOR'),
+ 'target',
+ rpm_repo_workdir=rpm_repo_workdir
+ )
+
+ self.host_pm = RpmPM(d,
+ self.sdk_host_sysroot,
+ self.d.getVar('SDK_VENDOR'),
+ 'host',
+ "SDK_PACKAGE_ARCHS",
+ "SDK_OS",
+ rpm_repo_workdir=rpm_repo_workdir
+ )
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ pm.create_configs()
+ pm.write_index()
+ pm.update()
+
+ pkgs = []
+ pkgs_attempt = []
+ for pkg_type in pkgs_to_install:
+ if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+ pkgs_attempt += pkgs_to_install[pkg_type]
+ else:
+ pkgs += pkgs_to_install[pkg_type]
+
+ pm.install(pkgs)
+
+ pm.install(pkgs_attempt, True)
+
+ def _populate(self):
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+ bb.note("Installing TARGET packages")
+ self._populate_sysroot(self.target_pm, self.target_manifest)
+
+ self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+ self.target_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+ self.install_locales(self.host_pm)
+
+ self.host_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.host_pm.remove_packaging_data()
+
+ # Move host RPM library data
+ native_rpm_state_dir = os.path.join(self.sdk_output,
+ self.sdk_native_path,
+ self.d.getVar('localstatedir_nativesdk').strip('/'),
+ "lib",
+ "rpm"
+ )
+ self.mkdirhier(native_rpm_state_dir)
+ for f in glob.glob(os.path.join(self.sdk_output,
+ "var",
+ "lib",
+ "rpm",
+ "*")):
+ self.movefile(f, native_rpm_state_dir)
+
+ self.remove(os.path.join(self.sdk_output, "var"), True)
+
+ # Move host sysconfig data
+ native_sysconf_dir = os.path.join(self.sdk_output,
+ self.sdk_native_path,
+ self.d.getVar('sysconfdir',
+ True).strip('/'),
+ )
+ self.mkdirhier(native_sysconf_dir)
+ for f in glob.glob(os.path.join(self.sdk_output, "etc", "rpm*")):
+ self.movefile(f, native_sysconf_dir)
+ for f in glob.glob(os.path.join(self.sdk_output, "etc", "dnf", "*")):
+ self.movefile(f, native_sysconf_dir)
+ self.remove(os.path.join(self.sdk_output, "etc"), True)
+
+
+class OpkgSdk(Sdk):
+ def __init__(self, d, manifest_dir=None):
+ super(OpkgSdk, self).__init__(d, manifest_dir)
+
+ self.target_conf = self.d.getVar("IPKGCONF_TARGET")
+ self.host_conf = self.d.getVar("IPKGCONF_SDK")
+
+ self.target_manifest = OpkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_TARGET)
+ self.host_manifest = OpkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
+ self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
+
+ self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
+ self.d.getVar("SDK_PACKAGE_ARCHS"))
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS') or "") != "1":
+ pm.write_index()
+
+ pm.update()
+
+ for pkg_type in self.install_order:
+ if pkg_type in pkgs_to_install:
+ pm.install(pkgs_to_install[pkg_type],
+ [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+ def _populate(self):
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+ bb.note("Installing TARGET packages")
+ self._populate_sysroot(self.target_pm, self.target_manifest)
+
+ self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+ self.target_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+ self.install_locales(self.host_pm)
+
+ self.host_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.host_pm.remove_packaging_data()
+
+ target_sysconfdir = os.path.join(self.sdk_target_sysroot, self.sysconfdir)
+ host_sysconfdir = os.path.join(self.sdk_host_sysroot, self.sysconfdir)
+
+ self.mkdirhier(target_sysconfdir)
+ shutil.copy(self.target_conf, target_sysconfdir)
+ os.chmod(os.path.join(target_sysconfdir,
+ os.path.basename(self.target_conf)), 0o644)
+
+ self.mkdirhier(host_sysconfdir)
+ shutil.copy(self.host_conf, host_sysconfdir)
+ os.chmod(os.path.join(host_sysconfdir,
+ os.path.basename(self.host_conf)), 0o644)
+
+ native_opkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+ self.d.getVar('localstatedir_nativesdk').strip('/'),
+ "lib", "opkg")
+ self.mkdirhier(native_opkg_state_dir)
+ for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", "*")):
+ self.movefile(f, native_opkg_state_dir)
+
+ self.remove(os.path.join(self.sdk_output, "var"), True)
+
+
+class DpkgSdk(Sdk):
+ def __init__(self, d, manifest_dir=None):
+ super(DpkgSdk, self).__init__(d, manifest_dir)
+
+ self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt")
+ self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET"), "apt-sdk")
+
+ self.target_manifest = DpkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_TARGET)
+ self.host_manifest = DpkgManifest(d, self.manifest_dir,
+ Manifest.MANIFEST_TYPE_SDK_HOST)
+
+ self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
+ self.d.getVar("PACKAGE_ARCHS"),
+ self.d.getVar("DPKG_ARCH"),
+ self.target_conf_dir)
+
+ self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+ self.d.getVar("SDK_PACKAGE_ARCHS"),
+ self.d.getVar("DEB_SDK_ARCH"),
+ self.host_conf_dir)
+
+ def _copy_apt_dir_to(self, dst_dir):
+ staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE")
+
+ self.remove(dst_dir, True)
+
+ shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
+
+ def _populate_sysroot(self, pm, manifest):
+ pkgs_to_install = manifest.parse_initial_manifest()
+
+ pm.write_index()
+ pm.update()
+
+ for pkg_type in self.install_order:
+ if pkg_type in pkgs_to_install:
+ pm.install(pkgs_to_install[pkg_type],
+ [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+ def _populate(self):
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_PRE_TARGET_COMMAND"))
+
+ bb.note("Installing TARGET packages")
+ self._populate_sysroot(self.target_pm, self.target_manifest)
+
+ self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY'))
+
+ self.target_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND"))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.target_pm.remove_packaging_data()
+
+ bb.note("Installing NATIVESDK packages")
+ self._populate_sysroot(self.host_pm, self.host_manifest)
+ self.install_locales(self.host_pm)
+
+ self.host_pm.run_intercepts()
+
+ execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND"))
+
+ self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
+ "etc", "apt"))
+
+ if not bb.utils.contains("SDKIMAGE_FEATURES", "package-management", True, False, self.d):
+ self.host_pm.remove_packaging_data()
+
+ native_dpkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+ "var", "lib", "dpkg")
+ self.mkdirhier(native_dpkg_state_dir)
+ for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", "*")):
+ self.movefile(f, native_dpkg_state_dir)
+ self.remove(os.path.join(self.sdk_output, "var"), True)
+
+
+
+def sdk_list_installed_packages(d, target, rootfs_dir=None):
+ if rootfs_dir is None:
+ sdk_output = d.getVar('SDK_OUTPUT')
+ target_path = d.getVar('SDKTARGETSYSROOT').strip('/')
+
+ rootfs_dir = [sdk_output, os.path.join(sdk_output, target_path)][target is True]
+
+ img_type = d.getVar('IMAGE_PKGTYPE')
+ if img_type == "rpm":
+ arch_var = ["SDK_PACKAGE_ARCHS", None][target is True]
+ os_var = ["SDK_OS", None][target is True]
+ return RpmPkgsList(d, rootfs_dir).list_pkgs()
+ elif img_type == "ipk":
+ conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_TARGET"][target is True]
+ return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var)).list_pkgs()
+ elif img_type == "deb":
+ return DpkgPkgsList(d, rootfs_dir).list_pkgs()
+
+def populate_sdk(d, manifest_dir=None):
+ env_bkp = os.environ.copy()
+
+ img_type = d.getVar('IMAGE_PKGTYPE')
+ if img_type == "rpm":
+ RpmSdk(d, manifest_dir).populate()
+ elif img_type == "ipk":
+ OpkgSdk(d, manifest_dir).populate()
+ elif img_type == "deb":
+ DpkgSdk(d, manifest_dir).populate()
+
+ os.environ.clear()
+ os.environ.update(env_bkp)
+
+def get_extra_sdkinfo(sstate_dir):
+ """
+ This function is going to be used for generating the target and host manifest files packages of eSDK.
+ """
+ import math
+
+ extra_info = {}
+ extra_info['tasksizes'] = {}
+ extra_info['filesizes'] = {}
+ for root, _, files in os.walk(sstate_dir):
+ for fn in files:
+ if fn.endswith('.tgz'):
+ fsize = int(math.ceil(float(os.path.getsize(os.path.join(root, fn))) / 1024))
+ task = fn.rsplit(':',1)[1].split('_',1)[1].split(',')[0]
+ origtotal = extra_info['tasksizes'].get(task, 0)
+ extra_info['tasksizes'][task] = origtotal + fsize
+ extra_info['filesizes'][fn] = fsize
+ return extra_info
+
+if __name__ == "__main__":
+ pass
diff --git a/poky/meta/lib/oe/sstatesig.py b/poky/meta/lib/oe/sstatesig.py
new file mode 100644
index 000000000..b82e0f422
--- /dev/null
+++ b/poky/meta/lib/oe/sstatesig.py
@@ -0,0 +1,404 @@
+import bb.siggen
+import oe
+
+def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCache):
+ # Return True if we should keep the dependency, False to drop it
+ def isNative(x):
+ return x.endswith("-native")
+ def isCross(x):
+ return "-cross-" in x
+ def isNativeSDK(x):
+ return x.startswith("nativesdk-")
+ def isKernel(fn):
+ inherits = " ".join(dataCache.inherits[fn])
+ return inherits.find("/module-base.bbclass") != -1 or inherits.find("/linux-kernel-base.bbclass") != -1
+ def isPackageGroup(fn):
+ inherits = " ".join(dataCache.inherits[fn])
+ return "/packagegroup.bbclass" in inherits
+ def isAllArch(fn):
+ inherits = " ".join(dataCache.inherits[fn])
+ return "/allarch.bbclass" in inherits
+ def isImage(fn):
+ return "/image.bbclass" in " ".join(dataCache.inherits[fn])
+
+ # (Almost) always include our own inter-task dependencies.
+ # The exception is the special do_kernel_configme->do_unpack_and_patch
+ # dependency from archiver.bbclass.
+ if recipename == depname:
+ if task == "do_kernel_configme" and dep.endswith(".do_unpack_and_patch"):
+ return False
+ return True
+
+ # Exclude well defined recipe->dependency
+ if "%s->%s" % (recipename, depname) in siggen.saferecipedeps:
+ return False
+
+ # Check for special wildcard
+ if "*->%s" % depname in siggen.saferecipedeps and recipename != depname:
+ return False
+
+ # Don't change native/cross/nativesdk recipe dependencies any further
+ if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename):
+ return True
+
+ # Only target packages beyond here
+
+ # allarch packagegroups are assumed to have well behaved names which don't change between architecures/tunes
+ if isPackageGroup(fn) and isAllArch(fn) and not isNative(depname):
+ return False
+
+ # Exclude well defined machine specific configurations which don't change ABI
+ if depname in siggen.abisaferecipes and not isImage(fn):
+ return False
+
+ # Kernel modules are well namespaced. We don't want to depend on the kernel's checksum
+ # if we're just doing an RRECOMMENDS_xxx = "kernel-module-*", not least because the checksum
+ # is machine specific.
+ # Therefore if we're not a kernel or a module recipe (inheriting the kernel classes)
+ # and we reccomend a kernel-module, we exclude the dependency.
+ depfn = dep.rsplit(".", 1)[0]
+ if dataCache and isKernel(depfn) and not isKernel(fn):
+ for pkg in dataCache.runrecs[fn]:
+ if " ".join(dataCache.runrecs[fn][pkg]).find("kernel-module-") != -1:
+ return False
+
+ # Default to keep dependencies
+ return True
+
+def sstate_lockedsigs(d):
+ sigs = {}
+ types = (d.getVar("SIGGEN_LOCKEDSIGS_TYPES") or "").split()
+ for t in types:
+ siggen_lockedsigs_var = "SIGGEN_LOCKEDSIGS_%s" % t
+ lockedsigs = (d.getVar(siggen_lockedsigs_var) or "").split()
+ for ls in lockedsigs:
+ pn, task, h = ls.split(":", 2)
+ if pn not in sigs:
+ sigs[pn] = {}
+ sigs[pn][task] = [h, siggen_lockedsigs_var]
+ return sigs
+
+class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic):
+ name = "OEBasic"
+ def init_rundepcheck(self, data):
+ self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
+ self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
+ pass
+ def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
+ return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
+
+class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
+ name = "OEBasicHash"
+ def init_rundepcheck(self, data):
+ self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE") or "").split()
+ self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS") or "").split()
+ self.lockedsigs = sstate_lockedsigs(data)
+ self.lockedhashes = {}
+ self.lockedpnmap = {}
+ self.lockedhashfn = {}
+ self.machine = data.getVar("MACHINE")
+ self.mismatch_msgs = []
+ self.unlockedrecipes = (data.getVar("SIGGEN_UNLOCKED_RECIPES") or
+ "").split()
+ self.unlockedrecipes = { k: "" for k in self.unlockedrecipes }
+ pass
+
+ def tasks_resolved(self, virtmap, virtpnmap, dataCache):
+ # Translate virtual/xxx entries to PN values
+ newabisafe = []
+ for a in self.abisaferecipes:
+ if a in virtpnmap:
+ newabisafe.append(virtpnmap[a])
+ else:
+ newabisafe.append(a)
+ self.abisaferecipes = newabisafe
+ newsafedeps = []
+ for a in self.saferecipedeps:
+ a1, a2 = a.split("->")
+ if a1 in virtpnmap:
+ a1 = virtpnmap[a1]
+ if a2 in virtpnmap:
+ a2 = virtpnmap[a2]
+ newsafedeps.append(a1 + "->" + a2)
+ self.saferecipedeps = newsafedeps
+
+ def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
+ return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
+
+ def get_taskdata(self):
+ data = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskdata()
+ return (data, self.lockedpnmap, self.lockedhashfn)
+
+ def set_taskdata(self, data):
+ coredata, self.lockedpnmap, self.lockedhashfn = data
+ super(bb.siggen.SignatureGeneratorBasicHash, self).set_taskdata(coredata)
+
+ def dump_sigs(self, dataCache, options):
+ sigfile = os.getcwd() + "/locked-sigs.inc"
+ bb.plain("Writing locked sigs to %s" % sigfile)
+ self.dump_lockedsigs(sigfile)
+ return super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigs(dataCache, options)
+
+ def get_taskhash(self, fn, task, deps, dataCache):
+ h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(fn, task, deps, dataCache)
+
+ recipename = dataCache.pkg_fn[fn]
+ self.lockedpnmap[fn] = recipename
+ self.lockedhashfn[fn] = dataCache.hashfn[fn]
+
+ unlocked = False
+ if recipename in self.unlockedrecipes:
+ unlocked = True
+ else:
+ def recipename_from_dep(dep):
+ # The dep entry will look something like
+ # /path/path/recipename.bb.task, virtual:native:/p/foo.bb.task,
+ # ...
+ fn = dep.rsplit('.', 1)[0]
+ return dataCache.pkg_fn[fn]
+
+ # If any unlocked recipe is in the direct dependencies then the
+ # current recipe should be unlocked as well.
+ depnames = [ recipename_from_dep(x) for x in deps ]
+ if any(x in y for y in depnames for x in self.unlockedrecipes):
+ self.unlockedrecipes[recipename] = ''
+ unlocked = True
+
+ if not unlocked and recipename in self.lockedsigs:
+ if task in self.lockedsigs[recipename]:
+ k = fn + "." + task
+ h_locked = self.lockedsigs[recipename][task][0]
+ var = self.lockedsigs[recipename][task][1]
+ self.lockedhashes[k] = h_locked
+ self.taskhash[k] = h_locked
+ #bb.warn("Using %s %s %s" % (recipename, task, h))
+
+ if h != h_locked:
+ self.mismatch_msgs.append('The %s:%s sig is computed to be %s, but the sig is locked to %s in %s'
+ % (recipename, task, h, h_locked, var))
+
+ return h_locked
+ #bb.warn("%s %s %s" % (recipename, task, h))
+ return h
+
+ def dump_sigtask(self, fn, task, stampbase, runtime):
+ k = fn + "." + task
+ if k in self.lockedhashes:
+ return
+ super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)
+
+ def dump_lockedsigs(self, sigfile, taskfilter=None):
+ types = {}
+ for k in self.runtaskdeps:
+ if taskfilter:
+ if not k in taskfilter:
+ continue
+ fn = k.rsplit(".",1)[0]
+ t = self.lockedhashfn[fn].split(" ")[1].split(":")[5]
+ t = 't-' + t.replace('_', '-')
+ if t not in types:
+ types[t] = []
+ types[t].append(k)
+
+ with open(sigfile, "w") as f:
+ l = sorted(types)
+ for t in l:
+ f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
+ types[t].sort()
+ sortedk = sorted(types[t], key=lambda k: self.lockedpnmap[k.rsplit(".",1)[0]])
+ for k in sortedk:
+ fn = k.rsplit(".",1)[0]
+ task = k.rsplit(".",1)[1]
+ if k not in self.taskhash:
+ continue
+ f.write(" " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n")
+ f.write(' "\n')
+ f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(l)))
+
+ def dump_siglist(self, sigfile):
+ with open(sigfile, "w") as f:
+ tasks = []
+ for taskitem in self.taskhash:
+ (fn, task) = taskitem.rsplit(".", 1)
+ pn = self.lockedpnmap[fn]
+ tasks.append((pn, task, fn, self.taskhash[taskitem]))
+ for (pn, task, fn, taskhash) in sorted(tasks):
+ f.write('%s.%s %s %s\n' % (pn, task, fn, taskhash))
+
+ def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
+ warn_msgs = []
+ error_msgs = []
+ sstate_missing_msgs = []
+
+ for task in range(len(sq_fn)):
+ if task not in ret:
+ for pn in self.lockedsigs:
+ if sq_hash[task] in iter(self.lockedsigs[pn].values()):
+ if sq_task[task] == 'do_shared_workdir':
+ continue
+ sstate_missing_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?"
+ % (pn, sq_task[task], sq_hash[task]))
+
+ checklevel = d.getVar("SIGGEN_LOCKEDSIGS_TASKSIG_CHECK")
+ if checklevel == 'warn':
+ warn_msgs += self.mismatch_msgs
+ elif checklevel == 'error':
+ error_msgs += self.mismatch_msgs
+
+ checklevel = d.getVar("SIGGEN_LOCKEDSIGS_SSTATE_EXISTS_CHECK")
+ if checklevel == 'warn':
+ warn_msgs += sstate_missing_msgs
+ elif checklevel == 'error':
+ error_msgs += sstate_missing_msgs
+
+ if warn_msgs:
+ bb.warn("\n".join(warn_msgs))
+ if error_msgs:
+ bb.fatal("\n".join(error_msgs))
+
+
+# Insert these classes into siggen's namespace so it can see and select them
+bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic
+bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash
+
+
+def find_siginfo(pn, taskname, taskhashlist, d):
+ """ Find signature data files for comparison purposes """
+
+ import fnmatch
+ import glob
+
+ if not taskname:
+ # We have to derive pn and taskname
+ key = pn
+ splitit = key.split('.bb.')
+ taskname = splitit[1]
+ pn = os.path.basename(splitit[0]).split('_')[0]
+ if key.startswith('virtual:native:'):
+ pn = pn + '-native'
+
+ hashfiles = {}
+ filedates = {}
+
+ def get_hashval(siginfo):
+ if siginfo.endswith('.siginfo'):
+ return siginfo.rpartition(':')[2].partition('_')[0]
+ else:
+ return siginfo.rpartition('.')[2]
+
+ # First search in stamps dir
+ localdata = d.createCopy()
+ localdata.setVar('MULTIMACH_TARGET_SYS', '*')
+ localdata.setVar('PN', pn)
+ localdata.setVar('PV', '*')
+ localdata.setVar('PR', '*')
+ localdata.setVar('EXTENDPE', '')
+ stamp = localdata.getVar('STAMP')
+ if pn.startswith("gcc-source"):
+ # gcc-source shared workdir is a special case :(
+ stamp = localdata.expand("${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}")
+
+ filespec = '%s.%s.sigdata.*' % (stamp, taskname)
+ foundall = False
+ import glob
+ for fullpath in glob.glob(filespec):
+ match = False
+ if taskhashlist:
+ for taskhash in taskhashlist:
+ if fullpath.endswith('.%s' % taskhash):
+ hashfiles[taskhash] = fullpath
+ if len(hashfiles) == len(taskhashlist):
+ foundall = True
+ break
+ else:
+ try:
+ filedates[fullpath] = os.stat(fullpath).st_mtime
+ except OSError:
+ continue
+ hashval = get_hashval(fullpath)
+ hashfiles[hashval] = fullpath
+
+ if not taskhashlist or (len(filedates) < 2 and not foundall):
+ # That didn't work, look in sstate-cache
+ hashes = taskhashlist or ['?' * 32]
+ localdata = bb.data.createCopy(d)
+ for hashval in hashes:
+ localdata.setVar('PACKAGE_ARCH', '*')
+ localdata.setVar('TARGET_VENDOR', '*')
+ localdata.setVar('TARGET_OS', '*')
+ localdata.setVar('PN', pn)
+ localdata.setVar('PV', '*')
+ localdata.setVar('PR', '*')
+ localdata.setVar('BB_TASKHASH', hashval)
+ swspec = localdata.getVar('SSTATE_SWSPEC')
+ if taskname in ['do_fetch', 'do_unpack', 'do_patch', 'do_populate_lic', 'do_preconfigure'] and swspec:
+ localdata.setVar('SSTATE_PKGSPEC', '${SSTATE_SWSPEC}')
+ elif pn.endswith('-native') or "-cross-" in pn or "-crosssdk-" in pn:
+ localdata.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
+ sstatename = taskname[3:]
+ filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG'), sstatename)
+
+ matchedfiles = glob.glob(filespec)
+ for fullpath in matchedfiles:
+ actual_hashval = get_hashval(fullpath)
+ if actual_hashval in hashfiles:
+ continue
+ hashfiles[hashval] = fullpath
+ if not taskhashlist:
+ try:
+ filedates[fullpath] = os.stat(fullpath).st_mtime
+ except:
+ continue
+
+ if taskhashlist:
+ return hashfiles
+ else:
+ return filedates
+
+bb.siggen.find_siginfo = find_siginfo
+
+
+def sstate_get_manifest_filename(task, d):
+ """
+ Return the sstate manifest file path for a particular task.
+ Also returns the datastore that can be used to query related variables.
+ """
+ d2 = d.createCopy()
+ extrainf = d.getVarFlag("do_" + task, 'stamp-extra-info')
+ if extrainf:
+ d2.setVar("SSTATE_MANMACH", extrainf)
+ return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
+
+def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
+ d2 = d
+ variant = ''
+ if taskdata2.startswith("virtual:multilib"):
+ variant = taskdata2.split(":")[2]
+ if variant not in multilibcache:
+ multilibcache[variant] = oe.utils.get_multilib_datastore(variant, d)
+ d2 = multilibcache[variant]
+
+ if taskdata.endswith("-native"):
+ pkgarchs = ["${BUILD_ARCH}"]
+ elif taskdata.startswith("nativesdk-"):
+ pkgarchs = ["${SDK_ARCH}_${SDK_OS}", "allarch"]
+ elif "-cross-canadian" in taskdata:
+ pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
+ elif "-cross-" in taskdata:
+ pkgarchs = ["${BUILD_ARCH}_${TARGET_ARCH}"]
+ elif "-crosssdk" in taskdata:
+ pkgarchs = ["${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"]
+ else:
+ pkgarchs = ['${MACHINE_ARCH}']
+ pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
+ pkgarchs.append('allarch')
+ pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')
+
+ for pkgarch in pkgarchs:
+ manifest = d2.expand("${SSTATE_MANIFESTS}/manifest-%s-%s.%s" % (pkgarch, taskdata, taskname))
+ if os.path.exists(manifest):
+ return manifest, d2
+ bb.warn("Manifest %s not found in %s (variant '%s')?" % (manifest, d2.expand(" ".join(pkgarchs)), variant))
+ return None, d2
+
+
diff --git a/poky/meta/lib/oe/terminal.py b/poky/meta/lib/oe/terminal.py
new file mode 100644
index 000000000..94afe394e
--- /dev/null
+++ b/poky/meta/lib/oe/terminal.py
@@ -0,0 +1,308 @@
+import logging
+import oe.classutils
+import shlex
+from bb.process import Popen, ExecutionError
+from distutils.version import LooseVersion
+
+logger = logging.getLogger('BitBake.OE.Terminal')
+
+
+class UnsupportedTerminal(Exception):
+ pass
+
+class NoSupportedTerminals(Exception):
+ def __init__(self, terms):
+ self.terms = terms
+
+
+class Registry(oe.classutils.ClassRegistry):
+ command = None
+
+ def __init__(cls, name, bases, attrs):
+ super(Registry, cls).__init__(name.lower(), bases, attrs)
+
+ @property
+ def implemented(cls):
+ return bool(cls.command)
+
+
+class Terminal(Popen, metaclass=Registry):
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ fmt_sh_cmd = self.format_command(sh_cmd, title)
+ try:
+ Popen.__init__(self, fmt_sh_cmd, env=env)
+ except OSError as exc:
+ import errno
+ if exc.errno == errno.ENOENT:
+ raise UnsupportedTerminal(self.name)
+ else:
+ raise
+
+ def format_command(self, sh_cmd, title):
+ fmt = {'title': title or 'Terminal', 'command': sh_cmd}
+ if isinstance(self.command, str):
+ return shlex.split(self.command.format(**fmt))
+ else:
+ return [element.format(**fmt) for element in self.command]
+
+class XTerminal(Terminal):
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ Terminal.__init__(self, sh_cmd, title, env, d)
+ if not os.environ.get('DISPLAY'):
+ raise UnsupportedTerminal(self.name)
+
+class Gnome(XTerminal):
+ command = 'gnome-terminal -t "{title}" -x {command}'
+ priority = 2
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ # Recent versions of gnome-terminal does not support non-UTF8 charset:
+ # https://bugzilla.gnome.org/show_bug.cgi?id=732127; as a workaround,
+ # clearing the LC_ALL environment variable so it uses the locale.
+ # Once fixed on the gnome-terminal project, this should be removed.
+ if os.getenv('LC_ALL'): os.putenv('LC_ALL','')
+
+ XTerminal.__init__(self, sh_cmd, title, env, d)
+
+class Mate(XTerminal):
+ command = 'mate-terminal --disable-factory -t "{title}" -x {command}'
+ priority = 2
+
+class Xfce(XTerminal):
+ command = 'xfce4-terminal -T "{title}" -e "{command}"'
+ priority = 2
+
+class Terminology(XTerminal):
+ command = 'terminology -T="{title}" -e {command}'
+ priority = 2
+
+class Konsole(XTerminal):
+ command = 'konsole --separate --workdir . -p tabtitle="{title}" -e {command}'
+ priority = 2
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ # Check version
+ vernum = check_terminal_version("konsole")
+ if vernum and LooseVersion(vernum) < '2.0.0':
+ # Konsole from KDE 3.x
+ self.command = 'konsole -T "{title}" -e {command}'
+ elif vernum and LooseVersion(vernum) < '16.08.1':
+ # Konsole pre 16.08.01 Has nofork
+ self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}'
+ XTerminal.__init__(self, sh_cmd, title, env, d)
+
+class XTerm(XTerminal):
+ command = 'xterm -T "{title}" -e {command}'
+ priority = 1
+
+class Rxvt(XTerminal):
+ command = 'rxvt -T "{title}" -e {command}'
+ priority = 1
+
+class Screen(Terminal):
+ command = 'screen -D -m -t "{title}" -S devshell {command}'
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ s_id = "devshell_%i" % os.getpid()
+ self.command = "screen -D -m -t \"{title}\" -S %s {command}" % s_id
+ Terminal.__init__(self, sh_cmd, title, env, d)
+ msg = 'Screen started. Please connect in another terminal with ' \
+ '"screen -r %s"' % s_id
+ if (d):
+ bb.event.fire(bb.event.LogExecTTY(msg, "screen -r %s" % s_id,
+ 0.5, 10), d)
+ else:
+ logger.warn(msg)
+
+class TmuxRunning(Terminal):
+ """Open a new pane in the current running tmux window"""
+ name = 'tmux-running'
+ command = 'tmux split-window "{command}"'
+ priority = 2.75
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+ raise UnsupportedTerminal('tmux is not installed')
+
+ if not os.getenv('TMUX'):
+ raise UnsupportedTerminal('tmux is not running')
+
+ if not check_tmux_pane_size('tmux'):
+ raise UnsupportedTerminal('tmux pane too small or tmux < 1.9 version is being used')
+
+ Terminal.__init__(self, sh_cmd, title, env, d)
+
+class TmuxNewWindow(Terminal):
+ """Open a new window in the current running tmux session"""
+ name = 'tmux-new-window'
+ command = 'tmux new-window -n "{title}" "{command}"'
+ priority = 2.70
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+ raise UnsupportedTerminal('tmux is not installed')
+
+ if not os.getenv('TMUX'):
+ raise UnsupportedTerminal('tmux is not running')
+
+ Terminal.__init__(self, sh_cmd, title, env, d)
+
+class Tmux(Terminal):
+ """Start a new tmux session and window"""
+ command = 'tmux new -d -s devshell -n devshell "{command}"'
+ priority = 0.75
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+ raise UnsupportedTerminal('tmux is not installed')
+
+ # TODO: consider using a 'devshell' session shared amongst all
+ # devshells, if it's already there, add a new window to it.
+ window_name = 'devshell-%i' % os.getpid()
+
+ self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'.format(window_name)
+ Terminal.__init__(self, sh_cmd, title, env, d)
+
+ attach_cmd = 'tmux att -t {0}'.format(window_name)
+ msg = 'Tmux started. Please connect in another terminal with `tmux att -t {0}`'.format(window_name)
+ if d:
+ bb.event.fire(bb.event.LogExecTTY(msg, attach_cmd, 0.5, 10), d)
+ else:
+ logger.warn(msg)
+
+class Custom(Terminal):
+ command = 'false' # This is a placeholder
+ priority = 3
+
+ def __init__(self, sh_cmd, title=None, env=None, d=None):
+ self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD')
+ if self.command:
+ if not '{command}' in self.command:
+ self.command += ' {command}'
+ Terminal.__init__(self, sh_cmd, title, env, d)
+ logger.warn('Custom terminal was started.')
+ else:
+ logger.debug(1, 'No custom terminal (OE_TERMINAL_CUSTOMCMD) set')
+ raise UnsupportedTerminal('OE_TERMINAL_CUSTOMCMD not set')
+
+
+def prioritized():
+ return Registry.prioritized()
+
+def get_cmd_list():
+ terms = Registry.prioritized()
+ cmds = []
+ for term in terms:
+ if term.command:
+ cmds.append(term.command)
+ return cmds
+
+def spawn_preferred(sh_cmd, title=None, env=None, d=None):
+ """Spawn the first supported terminal, by priority"""
+ for terminal in prioritized():
+ try:
+ spawn(terminal.name, sh_cmd, title, env, d)
+ break
+ except UnsupportedTerminal:
+ continue
+ else:
+ raise NoSupportedTerminals(get_cmd_list())
+
+def spawn(name, sh_cmd, title=None, env=None, d=None):
+ """Spawn the specified terminal, by name"""
+ logger.debug(1, 'Attempting to spawn terminal "%s"', name)
+ try:
+ terminal = Registry.registry[name]
+ except KeyError:
+ raise UnsupportedTerminal(name)
+
+ # We need to know when the command completes but some terminals (at least
+ # gnome and tmux) gives us no way to do this. We therefore write the pid
+ # to a file using a "phonehome" wrapper script, then monitor the pid
+ # until it exits.
+ import tempfile
+ import time
+ pidfile = tempfile.NamedTemporaryFile(delete = False).name
+ try:
+ sh_cmd = bb.utils.which(os.getenv('PATH'), "oe-gnome-terminal-phonehome") + " " + pidfile + " " + sh_cmd
+ pipe = terminal(sh_cmd, title, env, d)
+ output = pipe.communicate()[0]
+ if output:
+ output = output.decode("utf-8")
+ if pipe.returncode != 0:
+ raise ExecutionError(sh_cmd, pipe.returncode, output)
+
+ while os.stat(pidfile).st_size <= 0:
+ time.sleep(0.01)
+ continue
+ with open(pidfile, "r") as f:
+ pid = int(f.readline())
+ finally:
+ os.unlink(pidfile)
+
+ while True:
+ try:
+ os.kill(pid, 0)
+ time.sleep(0.1)
+ except OSError:
+ return
+
+def check_tmux_pane_size(tmux):
+ import subprocess as sub
+ # On older tmux versions (<1.9), return false. The reason
+ # is that there is no easy way to get the height of the active panel
+ # on current window without nested formats (available from version 1.9)
+ vernum = check_terminal_version("tmux")
+ if vernum and LooseVersion(vernum) < '1.9':
+ return False
+ try:
+ p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
+ shell=True,stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ size = int(out.strip())
+ except OSError as exc:
+ import errno
+ if exc.errno == errno.ENOENT:
+ return None
+ else:
+ raise
+
+ return size/2 >= 19
+
+def check_terminal_version(terminalName):
+ import subprocess as sub
+ try:
+ cmdversion = '%s --version' % terminalName
+ if terminalName.startswith('tmux'):
+ cmdversion = '%s -V' % terminalName
+ newenv = os.environ.copy()
+ newenv["LANG"] = "C"
+ p = sub.Popen(['sh', '-c', cmdversion], stdout=sub.PIPE, stderr=sub.PIPE, env=newenv)
+ out, err = p.communicate()
+ ver_info = out.decode().rstrip().split('\n')
+ except OSError as exc:
+ import errno
+ if exc.errno == errno.ENOENT:
+ return None
+ else:
+ raise
+ vernum = None
+ for ver in ver_info:
+ if ver.startswith('Konsole'):
+ vernum = ver.split(' ')[-1]
+ if ver.startswith('GNOME Terminal'):
+ vernum = ver.split(' ')[-1]
+ if ver.startswith('MATE Terminal'):
+ vernum = ver.split(' ')[-1]
+ if ver.startswith('tmux'):
+ vernum = ver.split()[-1]
+ return vernum
+
+def distro_name():
+ try:
+ p = Popen(['lsb_release', '-i'])
+ out, err = p.communicate()
+ distro = out.split(':')[1].strip().lower()
+ except:
+ distro = "unknown"
+ return distro
diff --git a/poky/meta/lib/oe/types.py b/poky/meta/lib/oe/types.py
new file mode 100644
index 000000000..4ae58acfa
--- /dev/null
+++ b/poky/meta/lib/oe/types.py
@@ -0,0 +1,153 @@
+import errno
+import re
+import os
+
+
+class OEList(list):
+ """OpenEmbedded 'list' type
+
+ Acts as an ordinary list, but is constructed from a string value and a
+ separator (optional), and re-joins itself when converted to a string with
+ str(). Set the variable type flag to 'list' to use this type, and the
+ 'separator' flag may be specified (defaulting to whitespace)."""
+
+ name = "list"
+
+ def __init__(self, value, separator = None):
+ if value is not None:
+ list.__init__(self, value.split(separator))
+ else:
+ list.__init__(self)
+
+ if separator is None:
+ self.separator = " "
+ else:
+ self.separator = separator
+
+ def __str__(self):
+ return self.separator.join(self)
+
+def choice(value, choices):
+ """OpenEmbedded 'choice' type
+
+ Acts as a multiple choice for the user. To use this, set the variable
+ type flag to 'choice', and set the 'choices' flag to a space separated
+ list of valid values."""
+ if not isinstance(value, str):
+ raise TypeError("choice accepts a string, not '%s'" % type(value))
+
+ value = value.lower()
+ choices = choices.lower()
+ if value not in choices.split():
+ raise ValueError("Invalid choice '%s'. Valid choices: %s" %
+ (value, choices))
+ return value
+
+class NoMatch(object):
+ """Stub python regex pattern object which never matches anything"""
+ def findall(self, string, flags=0):
+ return None
+
+ def finditer(self, string, flags=0):
+ return None
+
+ def match(self, flags=0):
+ return None
+
+ def search(self, string, flags=0):
+ return None
+
+ def split(self, string, maxsplit=0):
+ return None
+
+ def sub(pattern, repl, string, count=0):
+ return None
+
+ def subn(pattern, repl, string, count=0):
+ return None
+
+NoMatch = NoMatch()
+
+def regex(value, regexflags=None):
+ """OpenEmbedded 'regex' type
+
+ Acts as a regular expression, returning the pre-compiled regular
+ expression pattern object. To use this type, set the variable type flag
+ to 'regex', and optionally, set the 'regexflags' type to a space separated
+ list of the flags to control the regular expression matching (e.g.
+ FOO[regexflags] += 'ignorecase'). See the python documentation on the
+ 're' module for a list of valid flags."""
+
+ flagval = 0
+ if regexflags:
+ for flag in regexflags.split():
+ flag = flag.upper()
+ try:
+ flagval |= getattr(re, flag)
+ except AttributeError:
+ raise ValueError("Invalid regex flag '%s'" % flag)
+
+ if not value:
+ # Let's ensure that the default behavior for an undefined or empty
+ # variable is to match nothing. If the user explicitly wants to match
+ # anything, they can match '.*' instead.
+ return NoMatch
+
+ try:
+ return re.compile(value, flagval)
+ except re.error as exc:
+ raise ValueError("Invalid regex value '%s': %s" %
+ (value, exc.args[0]))
+
+def boolean(value):
+ """OpenEmbedded 'boolean' type
+
+ Valid values for true: 'yes', 'y', 'true', 't', '1'
+ Valid values for false: 'no', 'n', 'false', 'f', '0'
+ """
+
+ if not isinstance(value, str):
+ raise TypeError("boolean accepts a string, not '%s'" % type(value))
+
+ value = value.lower()
+ if value in ('yes', 'y', 'true', 't', '1'):
+ return True
+ elif value in ('no', 'n', 'false', 'f', '0'):
+ return False
+ raise ValueError("Invalid boolean value '%s'" % value)
+
+def integer(value, numberbase=10):
+ """OpenEmbedded 'integer' type
+
+ Defaults to base 10, but this can be specified using the optional
+ 'numberbase' flag."""
+
+ return int(value, int(numberbase))
+
+_float = float
+def float(value, fromhex='false'):
+ """OpenEmbedded floating point type
+
+ To use this type, set the type flag to 'float', and optionally set the
+ 'fromhex' flag to a true value (obeying the same rules as for the
+ 'boolean' type) if the value is in base 16 rather than base 10."""
+
+ if boolean(fromhex):
+ return _float.fromhex(value)
+ else:
+ return _float(value)
+
+def path(value, relativeto='', normalize='true', mustexist='false'):
+ value = os.path.join(relativeto, value)
+
+ if boolean(normalize):
+ value = os.path.normpath(value)
+
+ if boolean(mustexist):
+ try:
+ open(value, 'r')
+ except IOError as exc:
+ if exc.errno == errno.ENOENT:
+ raise ValueError("{0}: {1}".format(value, os.strerror(errno.ENOENT)))
+
+ return value
diff --git a/poky/meta/lib/oe/useradd.py b/poky/meta/lib/oe/useradd.py
new file mode 100644
index 000000000..179ac76b5
--- /dev/null
+++ b/poky/meta/lib/oe/useradd.py
@@ -0,0 +1,68 @@
+import argparse
+import re
+
+class myArgumentParser(argparse.ArgumentParser):
+ def _print_message(self, message, file=None):
+ bb.warn("%s - %s: %s" % (d.getVar('PN'), pkg, message))
+
+ # This should never be called...
+ def exit(self, status=0, message=None):
+ message = message or ("%s - %s: useradd.bbclass: Argument parsing exited" % (d.getVar('PN'), pkg))
+ error(message)
+
+ def error(self, message):
+ raise bb.build.FuncFailed(message)
+
+def split_commands(params):
+ params = re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip())
+ # Remove any empty items
+ return [x for x in params if x]
+
+def split_args(params):
+ params = re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params.strip())
+ # Remove any empty items
+ return [x for x in params if x]
+
+def build_useradd_parser():
+ # The following comes from --help on useradd from shadow
+ parser = myArgumentParser(prog='useradd')
+ parser.add_argument("-b", "--base-dir", metavar="BASE_DIR", help="base directory for the home directory of the new account")
+ parser.add_argument("-c", "--comment", metavar="COMMENT", help="GECOS field of the new account")
+ parser.add_argument("-d", "--home-dir", metavar="HOME_DIR", help="home directory of the new account")
+ parser.add_argument("-D", "--defaults", help="print or change default useradd configuration", action="store_true")
+ parser.add_argument("-e", "--expiredate", metavar="EXPIRE_DATE", help="expiration date of the new account")
+ parser.add_argument("-f", "--inactive", metavar="INACTIVE", help="password inactivity period of the new account")
+ parser.add_argument("-g", "--gid", metavar="GROUP", help="name or ID of the primary group of the new account")
+ parser.add_argument("-G", "--groups", metavar="GROUPS", help="list of supplementary groups of the new account")
+ parser.add_argument("-k", "--skel", metavar="SKEL_DIR", help="use this alternative skeleton directory")
+ parser.add_argument("-K", "--key", metavar="KEY=VALUE", help="override /etc/login.defs defaults")
+ parser.add_argument("-l", "--no-log-init", help="do not add the user to the lastlog and faillog databases", action="store_true")
+ parser.add_argument("-m", "--create-home", help="create the user's home directory", action="store_const", const=True)
+ parser.add_argument("-M", "--no-create-home", dest="create_home", help="do not create the user's home directory", action="store_const", const=False)
+ parser.add_argument("-N", "--no-user-group", dest="user_group", help="do not create a group with the same name as the user", action="store_const", const=False)
+ parser.add_argument("-o", "--non-unique", help="allow to create users with duplicate (non-unique UID)", action="store_true")
+ parser.add_argument("-p", "--password", metavar="PASSWORD", help="encrypted password of the new account")
+ parser.add_argument("-P", "--clear-password", metavar="CLEAR_PASSWORD", help="use this clear password for the new account")
+ parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
+ parser.add_argument("-r", "--system", help="create a system account", action="store_true")
+ parser.add_argument("-s", "--shell", metavar="SHELL", help="login shell of the new account")
+ parser.add_argument("-u", "--uid", metavar="UID", help="user ID of the new account")
+ parser.add_argument("-U", "--user-group", help="create a group with the same name as the user", action="store_const", const=True)
+ parser.add_argument("LOGIN", help="Login name of the new user")
+
+ return parser
+
+def build_groupadd_parser():
+ # The following comes from --help on groupadd from shadow
+ parser = myArgumentParser(prog='groupadd')
+ parser.add_argument("-f", "--force", help="exit successfully if the group already exists, and cancel -g if the GID is already used", action="store_true")
+ parser.add_argument("-g", "--gid", metavar="GID", help="use GID for the new group")
+ parser.add_argument("-K", "--key", metavar="KEY=VALUE", help="override /etc/login.defs defaults")
+ parser.add_argument("-o", "--non-unique", help="allow to create groups with duplicate (non-unique) GID", action="store_true")
+ parser.add_argument("-p", "--password", metavar="PASSWORD", help="use this encrypted password for the new group")
+ parser.add_argument("-P", "--clear-password", metavar="CLEAR_PASSWORD", help="use this clear password for the new group")
+ parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
+ parser.add_argument("-r", "--system", help="create a system account", action="store_true")
+ parser.add_argument("GROUP", help="Group name of the new group")
+
+ return parser
diff --git a/poky/meta/lib/oe/utils.py b/poky/meta/lib/oe/utils.py
new file mode 100644
index 000000000..80f0442d0
--- /dev/null
+++ b/poky/meta/lib/oe/utils.py
@@ -0,0 +1,421 @@
+import subprocess
+
+def read_file(filename):
+ try:
+ f = open( filename, "r" )
+ except IOError as reason:
+ return "" # WARNING: can't raise an error now because of the new RDEPENDS handling. This is a bit ugly. :M:
+ else:
+ data = f.read().strip()
+ f.close()
+ return data
+ return None
+
+def ifelse(condition, iftrue = True, iffalse = False):
+ if condition:
+ return iftrue
+ else:
+ return iffalse
+
+def conditional(variable, checkvalue, truevalue, falsevalue, d):
+ if d.getVar(variable) == checkvalue:
+ return truevalue
+ else:
+ return falsevalue
+
+def less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ if float(d.getVar(variable)) <= float(checkvalue):
+ return truevalue
+ else:
+ return falsevalue
+
+def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+ result = bb.utils.vercmp_string(d.getVar(variable), checkvalue)
+ if result <= 0:
+ return truevalue
+ else:
+ return falsevalue
+
+def both_contain(variable1, variable2, checkvalue, d):
+ val1 = d.getVar(variable1)
+ val2 = d.getVar(variable2)
+ val1 = set(val1.split())
+ val2 = set(val2.split())
+ if isinstance(checkvalue, str):
+ checkvalue = set(checkvalue.split())
+ else:
+ checkvalue = set(checkvalue)
+ if checkvalue.issubset(val1) and checkvalue.issubset(val2):
+ return " ".join(checkvalue)
+ else:
+ return ""
+
+def set_intersect(variable1, variable2, d):
+ """
+ Expand both variables, interpret them as lists of strings, and return the
+ intersection as a flattened string.
+
+ For example:
+ s1 = "a b c"
+ s2 = "b c d"
+ s3 = set_intersect(s1, s2)
+ => s3 = "b c"
+ """
+ val1 = set(d.getVar(variable1).split())
+ val2 = set(d.getVar(variable2).split())
+ return " ".join(val1 & val2)
+
+def prune_suffix(var, suffixes, d):
+ # See if var ends with any of the suffixes listed and
+ # remove it if found
+ for suffix in suffixes:
+ if var.endswith(suffix):
+ var = var.replace(suffix, "")
+
+ prefix = d.getVar("MLPREFIX")
+ if prefix and var.startswith(prefix):
+ var = var.replace(prefix, "")
+
+ return var
+
+def str_filter(f, str, d):
+ from re import match
+ return " ".join([x for x in str.split() if match(f, x, 0)])
+
+def str_filter_out(f, str, d):
+ from re import match
+ return " ".join([x for x in str.split() if not match(f, x, 0)])
+
+def build_depends_string(depends, task):
+ """Append a taskname to a string of dependencies as used by the [depends] flag"""
+ return " ".join(dep + ":" + task for dep in depends.split())
+
+def inherits(d, *classes):
+ """Return True if the metadata inherits any of the specified classes"""
+ return any(bb.data.inherits_class(cls, d) for cls in classes)
+
+def features_backfill(var,d):
+ # This construct allows the addition of new features to variable specified
+ # as var
+ # Example for var = "DISTRO_FEATURES"
+ # This construct allows the addition of new features to DISTRO_FEATURES
+ # that if not present would disable existing functionality, without
+ # disturbing distributions that have already set DISTRO_FEATURES.
+ # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should
+ # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED
+ features = (d.getVar(var) or "").split()
+ backfill = (d.getVar(var+"_BACKFILL") or "").split()
+ considered = (d.getVar(var+"_BACKFILL_CONSIDERED") or "").split()
+
+ addfeatures = []
+ for feature in backfill:
+ if feature not in features and feature not in considered:
+ addfeatures.append(feature)
+
+ if addfeatures:
+ d.appendVar(var, " " + " ".join(addfeatures))
+
+def all_distro_features(d, features, truevalue="1", falsevalue=""):
+ """
+ Returns truevalue if *all* given features are set in DISTRO_FEATURES,
+ else falsevalue. The features can be given as single string or anything
+ that can be turned into a set.
+
+ This is a shorter, more flexible version of
+ bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, d).
+
+ Without explicit true/false values it can be used directly where
+ Python expects a boolean:
+ if oe.utils.all_distro_features(d, "foo bar"):
+ bb.fatal("foo and bar are mutually exclusive DISTRO_FEATURES")
+
+ With just a truevalue, it can be used to include files that are meant to be
+ used only when requested via DISTRO_FEATURES:
+ require ${@ oe.utils.all_distro_features(d, "foo bar", "foo-and-bar.inc")
+ """
+ return bb.utils.contains("DISTRO_FEATURES", features, truevalue, falsevalue, d)
+
+def any_distro_features(d, features, truevalue="1", falsevalue=""):
+ """
+ Returns truevalue if at least *one* of the given features is set in DISTRO_FEATURES,
+ else falsevalue. The features can be given as single string or anything
+ that can be turned into a set.
+
+ This is a shorter, more flexible version of
+ bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d).
+
+ Without explicit true/false values it can be used directly where
+ Python expects a boolean:
+ if not oe.utils.any_distro_features(d, "foo bar"):
+ bb.fatal("foo, bar or both must be set in DISTRO_FEATURES")
+
+ With just a truevalue, it can be used to include files that are meant to be
+ used only when requested via DISTRO_FEATURES:
+ require ${@ oe.utils.any_distro_features(d, "foo bar", "foo-or-bar.inc")
+
+ """
+ return bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d)
+
+def parallel_make(d):
+ """
+ Return the integer value for the number of parallel threads to use when
+ building, scraped out of PARALLEL_MAKE. If no parallelization option is
+ found, returns None
+
+ e.g. if PARALLEL_MAKE = "-j 10", this will return 10 as an integer.
+ """
+ pm = (d.getVar('PARALLEL_MAKE') or '').split()
+ # look for '-j' and throw other options (e.g. '-l') away
+ while pm:
+ opt = pm.pop(0)
+ if opt == '-j':
+ v = pm.pop(0)
+ elif opt.startswith('-j'):
+ v = opt[2:].strip()
+ else:
+ continue
+
+ return int(v)
+
+ return None
+
+def parallel_make_argument(d, fmt, limit=None):
+ """
+ Helper utility to construct a parallel make argument from the number of
+ parallel threads specified in PARALLEL_MAKE.
+
+ Returns the input format string `fmt` where a single '%d' will be expanded
+ with the number of parallel threads to use. If `limit` is specified, the
+ number of parallel threads will be no larger than it. If no parallelization
+ option is found in PARALLEL_MAKE, returns an empty string
+
+ e.g. if PARALLEL_MAKE = "-j 10", parallel_make_argument(d, "-n %d") will return
+ "-n 10"
+ """
+ v = parallel_make(d)
+ if v:
+ if limit:
+ v = min(limit, v)
+ return fmt % v
+ return ''
+
+def packages_filter_out_system(d):
+ """
+ Return a list of packages from PACKAGES with the "system" packages such as
+ PN-dbg PN-doc PN-locale-eb-gb removed.
+ """
+ pn = d.getVar('PN')
+ blacklist = [pn + suffix for suffix in ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev')]
+ localepkg = pn + "-locale-"
+ pkgs = []
+
+ for pkg in d.getVar('PACKAGES').split():
+ if pkg not in blacklist and localepkg not in pkg:
+ pkgs.append(pkg)
+ return pkgs
+
+def getstatusoutput(cmd):
+ return subprocess.getstatusoutput(cmd)
+
+
+def trim_version(version, num_parts=2):
+ """
+ Return just the first <num_parts> of <version>, split by periods. For
+ example, trim_version("1.2.3", 2) will return "1.2".
+ """
+ if type(version) is not str:
+ raise TypeError("Version should be a string")
+ if num_parts < 1:
+ raise ValueError("Cannot split to parts < 1")
+
+ parts = version.split(".")
+ trimmed = ".".join(parts[:num_parts])
+ return trimmed
+
+def cpu_count():
+ import multiprocessing
+ return multiprocessing.cpu_count()
+
+def execute_pre_post_process(d, cmds):
+ if cmds is None:
+ return
+
+ for cmd in cmds.strip().split(';'):
+ cmd = cmd.strip()
+ if cmd != '':
+ bb.note("Executing %s ..." % cmd)
+ bb.build.exec_func(cmd, d)
+
+def multiprocess_exec(commands, function):
+ import signal
+ import multiprocessing
+
+ if not commands:
+ return []
+
+ def init_worker():
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
+
+ fails = []
+
+ def failures(res):
+ fails.append(res)
+
+ nproc = min(multiprocessing.cpu_count(), len(commands))
+ pool = bb.utils.multiprocessingpool(nproc, init_worker)
+
+ try:
+ mapresult = pool.map_async(function, commands, error_callback=failures)
+
+ pool.close()
+ pool.join()
+ results = mapresult.get()
+ except KeyboardInterrupt:
+ pool.terminate()
+ pool.join()
+ raise
+
+ if fails:
+ raise fails[0]
+
+ return results
+
+def squashspaces(string):
+ import re
+ return re.sub("\s+", " ", string).strip()
+
+def format_pkg_list(pkg_dict, ret_format=None):
+ output = []
+
+ if ret_format == "arch":
+ for pkg in sorted(pkg_dict):
+ output.append("%s %s" % (pkg, pkg_dict[pkg]["arch"]))
+ elif ret_format == "file":
+ for pkg in sorted(pkg_dict):
+ output.append("%s %s %s" % (pkg, pkg_dict[pkg]["filename"], pkg_dict[pkg]["arch"]))
+ elif ret_format == "ver":
+ for pkg in sorted(pkg_dict):
+ output.append("%s %s %s" % (pkg, pkg_dict[pkg]["arch"], pkg_dict[pkg]["ver"]))
+ elif ret_format == "deps":
+ for pkg in sorted(pkg_dict):
+ for dep in pkg_dict[pkg]["deps"]:
+ output.append("%s|%s" % (pkg, dep))
+ else:
+ for pkg in sorted(pkg_dict):
+ output.append(pkg)
+
+ return '\n'.join(output)
+
+def host_gcc_version(d):
+ import re, subprocess
+
+ compiler = d.getVar("BUILD_CC")
+ try:
+ env = os.environ.copy()
+ env["PATH"] = d.getVar("PATH")
+ output = subprocess.check_output("%s --version" % compiler, shell=True, env=env).decode("utf-8")
+ except subprocess.CalledProcessError as e:
+ bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
+
+ match = re.match(".* (\d\.\d)\.\d.*", output.split('\n')[0])
+ if not match:
+ bb.fatal("Can't get compiler version from %s --version output" % compiler)
+
+ version = match.group(1)
+ return "-%s" % version if version in ("4.8", "4.9") else ""
+
+
+def get_multilib_datastore(variant, d):
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + variant
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", variant + "-")
+ return localdata
+
+#
+# Python 2.7 doesn't have threaded pools (just multiprocessing)
+# so implement a version here
+#
+
+from queue import Queue
+from threading import Thread
+
+class ThreadedWorker(Thread):
+ """Thread executing tasks from a given tasks queue"""
+ def __init__(self, tasks, worker_init, worker_end):
+ Thread.__init__(self)
+ self.tasks = tasks
+ self.daemon = True
+
+ self.worker_init = worker_init
+ self.worker_end = worker_end
+
+ def run(self):
+ from queue import Empty
+
+ if self.worker_init is not None:
+ self.worker_init(self)
+
+ while True:
+ try:
+ func, args, kargs = self.tasks.get(block=False)
+ except Empty:
+ if self.worker_end is not None:
+ self.worker_end(self)
+ break
+
+ try:
+ func(self, *args, **kargs)
+ except Exception as e:
+ print(e)
+ finally:
+ self.tasks.task_done()
+
+class ThreadedPool:
+ """Pool of threads consuming tasks from a queue"""
+ def __init__(self, num_workers, num_tasks, worker_init=None,
+ worker_end=None):
+ self.tasks = Queue(num_tasks)
+ self.workers = []
+
+ for _ in range(num_workers):
+ worker = ThreadedWorker(self.tasks, worker_init, worker_end)
+ self.workers.append(worker)
+
+ def start(self):
+ for worker in self.workers:
+ worker.start()
+
+ def add_task(self, func, *args, **kargs):
+ """Add a task to the queue"""
+ self.tasks.put((func, args, kargs))
+
+ def wait_completion(self):
+ """Wait for completion of all the tasks in the queue"""
+ self.tasks.join()
+ for worker in self.workers:
+ worker.join()
+
+def write_ld_so_conf(d):
+ # Some utils like prelink may not have the correct target library paths
+ # so write an ld.so.conf to help them
+ ldsoconf = d.expand("${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf")
+ if os.path.exists(ldsoconf):
+ bb.utils.remove(ldsoconf)
+ bb.utils.mkdirhier(os.path.dirname(ldsoconf))
+ with open(ldsoconf, "w") as f:
+ f.write(d.getVar("base_libdir") + '\n')
+ f.write(d.getVar("libdir") + '\n')
+
+class ImageQAFailed(bb.build.FuncFailed):
+ def __init__(self, description, name=None, logfile=None):
+ self.description = description
+ self.name = name
+ self.logfile=logfile
+
+ def __str__(self):
+ msg = 'Function failed: %s' % self.name
+ if self.description:
+ msg = msg + ' (%s)' % self.description
+
+ return msg
diff --git a/poky/meta/lib/oeqa/buildperf/__init__.py b/poky/meta/lib/oeqa/buildperf/__init__.py
new file mode 100644
index 000000000..605f429ec
--- /dev/null
+++ b/poky/meta/lib/oeqa/buildperf/__init__.py
@@ -0,0 +1,19 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Build performance tests"""
+from .base import (BuildPerfTestCase,
+ BuildPerfTestLoader,
+ BuildPerfTestResult,
+ BuildPerfTestRunner,
+ KernelDropCaches,
+ runCmd2)
+from .test_basic import *
diff --git a/poky/meta/lib/oeqa/buildperf/base.py b/poky/meta/lib/oeqa/buildperf/base.py
new file mode 100644
index 000000000..ac6ee15d0
--- /dev/null
+++ b/poky/meta/lib/oeqa/buildperf/base.py
@@ -0,0 +1,511 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Build performance test base classes and functionality"""
+import json
+import logging
+import os
+import re
+import resource
+import socket
+import shutil
+import time
+import unittest
+import xml.etree.ElementTree as ET
+from collections import OrderedDict
+from datetime import datetime, timedelta
+from functools import partial
+from multiprocessing import Process
+from multiprocessing import SimpleQueue
+from xml.dom import minidom
+
+import oe.path
+from oeqa.utils.commands import CommandError, runCmd, get_bb_vars
+from oeqa.utils.git import GitError, GitRepo
+
+# Get logger for this module
+log = logging.getLogger('build-perf')
+
+# Our own version of runCmd which does not raise AssertErrors which would cause
+# errors to interpreted as failures
+runCmd2 = partial(runCmd, assert_error=False, limit_exc_output=40)
+
+
+class KernelDropCaches(object):
+ """Container of the functions for dropping kernel caches"""
+ sudo_passwd = None
+
+ @classmethod
+ def check(cls):
+ """Check permssions for dropping kernel caches"""
+ from getpass import getpass
+ from locale import getdefaultlocale
+ cmd = ['sudo', '-k', '-n', 'tee', '/proc/sys/vm/drop_caches']
+ ret = runCmd2(cmd, ignore_status=True, data=b'0')
+ if ret.output.startswith('sudo:'):
+ pass_str = getpass(
+ "\nThe script requires sudo access to drop caches between "
+ "builds (echo 3 > /proc/sys/vm/drop_caches).\n"
+ "Please enter your sudo password: ")
+ cls.sudo_passwd = bytes(pass_str, getdefaultlocale()[1])
+
+ @classmethod
+ def drop(cls):
+ """Drop kernel caches"""
+ cmd = ['sudo', '-k']
+ if cls.sudo_passwd:
+ cmd.append('-S')
+ input_data = cls.sudo_passwd + b'\n'
+ else:
+ cmd.append('-n')
+ input_data = b''
+ cmd += ['tee', '/proc/sys/vm/drop_caches']
+ input_data += b'3'
+ runCmd2(cmd, data=input_data)
+
+
+def str_to_fn(string):
+ """Convert string to a sanitized filename"""
+ return re.sub(r'(\W+)', '-', string, flags=re.LOCALE)
+
+
+class ResultsJsonEncoder(json.JSONEncoder):
+ """Extended encoder for build perf test results"""
+ unix_epoch = datetime.utcfromtimestamp(0)
+
+ def default(self, obj):
+ """Encoder for our types"""
+ if isinstance(obj, datetime):
+ # NOTE: we assume that all timestamps are in UTC time
+ return (obj - self.unix_epoch).total_seconds()
+ if isinstance(obj, timedelta):
+ return obj.total_seconds()
+ return json.JSONEncoder.default(self, obj)
+
+
+class BuildPerfTestResult(unittest.TextTestResult):
+ """Runner class for executing the individual tests"""
+ # List of test cases to run
+ test_run_queue = []
+
+ def __init__(self, out_dir, *args, **kwargs):
+ super(BuildPerfTestResult, self).__init__(*args, **kwargs)
+
+ self.out_dir = out_dir
+ self.hostname = socket.gethostname()
+ self.product = os.getenv('OE_BUILDPERFTEST_PRODUCT', 'oe-core')
+ self.start_time = self.elapsed_time = None
+ self.successes = []
+
+ def addSuccess(self, test):
+ """Record results from successful tests"""
+ super(BuildPerfTestResult, self).addSuccess(test)
+ self.successes.append(test)
+
+ def addError(self, test, err):
+ """Record results from crashed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addError(test, err)
+
+ def addFailure(self, test, err):
+ """Record results from failed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addFailure(test, err)
+
+ def addExpectedFailure(self, test, err):
+ """Record results from expectedly failed test"""
+ test.err = err
+ super(BuildPerfTestResult, self).addExpectedFailure(test, err)
+
+ def startTest(self, test):
+ """Pre-test hook"""
+ test.base_dir = self.out_dir
+ log.info("Executing test %s: %s", test.name, test.shortDescription())
+ self.stream.write(datetime.now().strftime("[%Y-%m-%d %H:%M:%S] "))
+ super(BuildPerfTestResult, self).startTest(test)
+
+ def startTestRun(self):
+ """Pre-run hook"""
+ self.start_time = datetime.utcnow()
+
+ def stopTestRun(self):
+ """Pre-run hook"""
+ self.elapsed_time = datetime.utcnow() - self.start_time
+
+ def all_results(self):
+ compound = [('SUCCESS', t, None) for t in self.successes] + \
+ [('FAILURE', t, m) for t, m in self.failures] + \
+ [('ERROR', t, m) for t, m in self.errors] + \
+ [('EXPECTED_FAILURE', t, m) for t, m in self.expectedFailures] + \
+ [('UNEXPECTED_SUCCESS', t, None) for t in self.unexpectedSuccesses] + \
+ [('SKIPPED', t, m) for t, m in self.skipped]
+ return sorted(compound, key=lambda info: info[1].start_time)
+
+
+ def write_buildstats_json(self):
+ """Write buildstats file"""
+ buildstats = OrderedDict()
+ for _, test, _ in self.all_results():
+ for key, val in test.buildstats.items():
+ buildstats[test.name + '.' + key] = val
+ with open(os.path.join(self.out_dir, 'buildstats.json'), 'w') as fobj:
+ json.dump(buildstats, fobj, cls=ResultsJsonEncoder)
+
+
+ def write_results_json(self):
+ """Write test results into a json-formatted file"""
+ results = OrderedDict([('tester_host', self.hostname),
+ ('start_time', self.start_time),
+ ('elapsed_time', self.elapsed_time),
+ ('tests', OrderedDict())])
+
+ for status, test, reason in self.all_results():
+ test_result = OrderedDict([('name', test.name),
+ ('description', test.shortDescription()),
+ ('status', status),
+ ('start_time', test.start_time),
+ ('elapsed_time', test.elapsed_time),
+ ('measurements', test.measurements)])
+ if status in ('ERROR', 'FAILURE', 'EXPECTED_FAILURE'):
+ test_result['message'] = str(test.err[1])
+ test_result['err_type'] = test.err[0].__name__
+ test_result['err_output'] = reason
+ elif reason:
+ test_result['message'] = reason
+
+ results['tests'][test.name] = test_result
+
+ with open(os.path.join(self.out_dir, 'results.json'), 'w') as fobj:
+ json.dump(results, fobj, indent=4,
+ cls=ResultsJsonEncoder)
+
+ def write_results_xml(self):
+ """Write test results into a JUnit XML file"""
+ top = ET.Element('testsuites')
+ suite = ET.SubElement(top, 'testsuite')
+ suite.set('name', 'oeqa.buildperf')
+ suite.set('timestamp', self.start_time.isoformat())
+ suite.set('time', str(self.elapsed_time.total_seconds()))
+ suite.set('hostname', self.hostname)
+ suite.set('failures', str(len(self.failures) + len(self.expectedFailures)))
+ suite.set('errors', str(len(self.errors)))
+ suite.set('skipped', str(len(self.skipped)))
+
+ test_cnt = 0
+ for status, test, reason in self.all_results():
+ test_cnt += 1
+ testcase = ET.SubElement(suite, 'testcase')
+ testcase.set('classname', test.__module__ + '.' + test.__class__.__name__)
+ testcase.set('name', test.name)
+ testcase.set('description', test.shortDescription())
+ testcase.set('timestamp', test.start_time.isoformat())
+ testcase.set('time', str(test.elapsed_time.total_seconds()))
+ if status in ('ERROR', 'FAILURE', 'EXP_FAILURE'):
+ if status in ('FAILURE', 'EXP_FAILURE'):
+ result = ET.SubElement(testcase, 'failure')
+ else:
+ result = ET.SubElement(testcase, 'error')
+ result.set('message', str(test.err[1]))
+ result.set('type', test.err[0].__name__)
+ result.text = reason
+ elif status == 'SKIPPED':
+ result = ET.SubElement(testcase, 'skipped')
+ result.text = reason
+ elif status not in ('SUCCESS', 'UNEXPECTED_SUCCESS'):
+ raise TypeError("BUG: invalid test status '%s'" % status)
+
+ for data in test.measurements.values():
+ measurement = ET.SubElement(testcase, data['type'])
+ measurement.set('name', data['name'])
+ measurement.set('legend', data['legend'])
+ vals = data['values']
+ if data['type'] == BuildPerfTestCase.SYSRES:
+ ET.SubElement(measurement, 'time',
+ timestamp=vals['start_time'].isoformat()).text = \
+ str(vals['elapsed_time'].total_seconds())
+ attrib = dict((k, str(v)) for k, v in vals['iostat'].items())
+ ET.SubElement(measurement, 'iostat', attrib=attrib)
+ attrib = dict((k, str(v)) for k, v in vals['rusage'].items())
+ ET.SubElement(measurement, 'rusage', attrib=attrib)
+ elif data['type'] == BuildPerfTestCase.DISKUSAGE:
+ ET.SubElement(measurement, 'size').text = str(vals['size'])
+ else:
+ raise TypeError('BUG: unsupported measurement type')
+
+ suite.set('tests', str(test_cnt))
+
+ # Use minidom for pretty-printing
+ dom_doc = minidom.parseString(ET.tostring(top, 'utf-8'))
+ with open(os.path.join(self.out_dir, 'results.xml'), 'w') as fobj:
+ dom_doc.writexml(fobj, addindent=' ', newl='\n', encoding='utf-8')
+
+
+class BuildPerfTestCase(unittest.TestCase):
+ """Base class for build performance tests"""
+ SYSRES = 'sysres'
+ DISKUSAGE = 'diskusage'
+ build_target = None
+
+ def __init__(self, *args, **kwargs):
+ super(BuildPerfTestCase, self).__init__(*args, **kwargs)
+ self.name = self._testMethodName
+ self.base_dir = None
+ self.start_time = None
+ self.elapsed_time = None
+ self.measurements = OrderedDict()
+ self.buildstats = OrderedDict()
+ # self.err is supposed to be a tuple from sys.exc_info()
+ self.err = None
+ self.bb_vars = get_bb_vars()
+ # TODO: remove 'times' and 'sizes' arrays when globalres support is
+ # removed
+ self.times = []
+ self.sizes = []
+
+ @property
+ def tmp_dir(self):
+ return os.path.join(self.base_dir, self.name + '.tmp')
+
+ def shortDescription(self):
+ return super(BuildPerfTestCase, self).shortDescription() or ""
+
+ def setUp(self):
+ """Set-up fixture for each test"""
+ if not os.path.isdir(self.tmp_dir):
+ os.mkdir(self.tmp_dir)
+ if self.build_target:
+ self.run_cmd(['bitbake', self.build_target, '--runall=fetch'])
+
+ def tearDown(self):
+ """Tear-down fixture for each test"""
+ if os.path.isdir(self.tmp_dir):
+ shutil.rmtree(self.tmp_dir)
+
+ def run(self, *args, **kwargs):
+ """Run test"""
+ self.start_time = datetime.now()
+ super(BuildPerfTestCase, self).run(*args, **kwargs)
+ self.elapsed_time = datetime.now() - self.start_time
+
+ def run_cmd(self, cmd):
+ """Convenience method for running a command"""
+ cmd_str = cmd if isinstance(cmd, str) else ' '.join(cmd)
+ log.info("Logging command: %s", cmd_str)
+ try:
+ runCmd2(cmd)
+ except CommandError as err:
+ log.error("Command failed: %s", err.retcode)
+ raise
+
+ def _append_measurement(self, measurement):
+ """Simple helper for adding measurements results"""
+ if measurement['name'] in self.measurements:
+ raise ValueError('BUG: two measurements with the same name in {}'.format(
+ self.__class__.__name__))
+ self.measurements[measurement['name']] = measurement
+
+ def measure_cmd_resources(self, cmd, name, legend, save_bs=False):
+ """Measure system resource usage of a command"""
+ def _worker(data_q, cmd, **kwargs):
+ """Worker process for measuring resources"""
+ try:
+ start_time = datetime.now()
+ ret = runCmd2(cmd, **kwargs)
+ etime = datetime.now() - start_time
+ rusage_struct = resource.getrusage(resource.RUSAGE_CHILDREN)
+ iostat = OrderedDict()
+ with open('/proc/{}/io'.format(os.getpid())) as fobj:
+ for line in fobj.readlines():
+ key, val = line.split(':')
+ iostat[key] = int(val)
+ rusage = OrderedDict()
+ # Skip unused fields, (i.e. 'ru_ixrss', 'ru_idrss', 'ru_isrss',
+ # 'ru_nswap', 'ru_msgsnd', 'ru_msgrcv' and 'ru_nsignals')
+ for key in ['ru_utime', 'ru_stime', 'ru_maxrss', 'ru_minflt',
+ 'ru_majflt', 'ru_inblock', 'ru_oublock',
+ 'ru_nvcsw', 'ru_nivcsw']:
+ rusage[key] = getattr(rusage_struct, key)
+ data_q.put({'ret': ret,
+ 'start_time': start_time,
+ 'elapsed_time': etime,
+ 'rusage': rusage,
+ 'iostat': iostat})
+ except Exception as err:
+ data_q.put(err)
+
+ cmd_str = cmd if isinstance(cmd, str) else ' '.join(cmd)
+ log.info("Timing command: %s", cmd_str)
+ data_q = SimpleQueue()
+ try:
+ proc = Process(target=_worker, args=(data_q, cmd,))
+ proc.start()
+ data = data_q.get()
+ proc.join()
+ if isinstance(data, Exception):
+ raise data
+ except CommandError:
+ log.error("Command '%s' failed", cmd_str)
+ raise
+ etime = data['elapsed_time']
+
+ measurement = OrderedDict([('type', self.SYSRES),
+ ('name', name),
+ ('legend', legend)])
+ measurement['values'] = OrderedDict([('start_time', data['start_time']),
+ ('elapsed_time', etime),
+ ('rusage', data['rusage']),
+ ('iostat', data['iostat'])])
+ if save_bs:
+ self.save_buildstats(name)
+
+ self._append_measurement(measurement)
+
+ # Append to 'times' array for globalres log
+ e_sec = etime.total_seconds()
+ self.times.append('{:d}:{:02d}:{:05.2f}'.format(int(e_sec / 3600),
+ int((e_sec % 3600) / 60),
+ e_sec % 60))
+
+ def measure_disk_usage(self, path, name, legend, apparent_size=False):
+ """Estimate disk usage of a file or directory"""
+ cmd = ['du', '-s', '--block-size', '1024']
+ if apparent_size:
+ cmd.append('--apparent-size')
+ cmd.append(path)
+
+ ret = runCmd2(cmd)
+ size = int(ret.output.split()[0])
+ log.debug("Size of %s path is %s", path, size)
+ measurement = OrderedDict([('type', self.DISKUSAGE),
+ ('name', name),
+ ('legend', legend)])
+ measurement['values'] = OrderedDict([('size', size)])
+ self._append_measurement(measurement)
+ # Append to 'sizes' array for globalres log
+ self.sizes.append(str(size))
+
+ def save_buildstats(self, measurement_name):
+ """Save buildstats"""
+ def split_nevr(nevr):
+ """Split name and version information from recipe "nevr" string"""
+ n_e_v, revision = nevr.rsplit('-', 1)
+ match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[0-9]\S*)$',
+ n_e_v)
+ if not match:
+ # If we're not able to parse a version starting with a number, just
+ # take the part after last dash
+ match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[^-]+)$',
+ n_e_v)
+ name = match.group('name')
+ version = match.group('version')
+ epoch = match.group('epoch')
+ return name, epoch, version, revision
+
+ def bs_to_json(filename):
+ """Convert (task) buildstats file into json format"""
+ bs_json = OrderedDict()
+ iostat = OrderedDict()
+ rusage = OrderedDict()
+ with open(filename) as fobj:
+ for line in fobj.readlines():
+ key, val = line.split(':', 1)
+ val = val.strip()
+ if key == 'Started':
+ start_time = datetime.utcfromtimestamp(float(val))
+ bs_json['start_time'] = start_time
+ elif key == 'Ended':
+ end_time = datetime.utcfromtimestamp(float(val))
+ elif key.startswith('IO '):
+ split = key.split()
+ iostat[split[1]] = int(val)
+ elif key.find('rusage') >= 0:
+ split = key.split()
+ ru_key = split[-1]
+ if ru_key in ('ru_stime', 'ru_utime'):
+ val = float(val)
+ else:
+ val = int(val)
+ rusage[ru_key] = rusage.get(ru_key, 0) + val
+ elif key == 'Status':
+ bs_json['status'] = val
+ bs_json['elapsed_time'] = end_time - start_time
+ bs_json['rusage'] = rusage
+ bs_json['iostat'] = iostat
+ return bs_json
+
+ log.info('Saving buildstats in JSON format')
+ bs_dirs = sorted(os.listdir(self.bb_vars['BUILDSTATS_BASE']))
+ if len(bs_dirs) > 1:
+ log.warning("Multiple buildstats found for test %s, only "
+ "archiving the last one", self.name)
+ bs_dir = os.path.join(self.bb_vars['BUILDSTATS_BASE'], bs_dirs[-1])
+
+ buildstats = []
+ for fname in os.listdir(bs_dir):
+ recipe_dir = os.path.join(bs_dir, fname)
+ if not os.path.isdir(recipe_dir):
+ continue
+ name, epoch, version, revision = split_nevr(fname)
+ recipe_bs = OrderedDict((('name', name),
+ ('epoch', epoch),
+ ('version', version),
+ ('revision', revision),
+ ('tasks', OrderedDict())))
+ for task in os.listdir(recipe_dir):
+ recipe_bs['tasks'][task] = bs_to_json(os.path.join(recipe_dir,
+ task))
+ buildstats.append(recipe_bs)
+
+ self.buildstats[measurement_name] = buildstats
+
+ def rm_tmp(self):
+ """Cleanup temporary/intermediate files and directories"""
+ log.debug("Removing temporary and cache files")
+ for name in ['bitbake.lock', 'conf/sanity_info',
+ self.bb_vars['TMPDIR']]:
+ oe.path.remove(name, recurse=True)
+
+ def rm_sstate(self):
+ """Remove sstate directory"""
+ log.debug("Removing sstate-cache")
+ oe.path.remove(self.bb_vars['SSTATE_DIR'], recurse=True)
+
+ def rm_cache(self):
+ """Drop bitbake caches"""
+ oe.path.remove(self.bb_vars['PERSISTENT_DIR'], recurse=True)
+
+ @staticmethod
+ def sync():
+ """Sync and drop kernel caches"""
+ runCmd2('bitbake -m', ignore_status=True)
+ log.debug("Syncing and dropping kernel caches""")
+ KernelDropCaches.drop()
+ os.sync()
+ # Wait a bit for all the dirty blocks to be written onto disk
+ time.sleep(3)
+
+
+class BuildPerfTestLoader(unittest.TestLoader):
+ """Test loader for build performance tests"""
+ sortTestMethodsUsing = None
+
+
+class BuildPerfTestRunner(unittest.TextTestRunner):
+ """Test loader for build performance tests"""
+ sortTestMethodsUsing = None
+
+ def __init__(self, out_dir, *args, **kwargs):
+ super(BuildPerfTestRunner, self).__init__(*args, **kwargs)
+ self.out_dir = out_dir
+
+ def _makeResult(self):
+ return BuildPerfTestResult(self.out_dir, self.stream, self.descriptions,
+ self.verbosity)
diff --git a/poky/meta/lib/oeqa/buildperf/test_basic.py b/poky/meta/lib/oeqa/buildperf/test_basic.py
new file mode 100644
index 000000000..6d6b01b04
--- /dev/null
+++ b/poky/meta/lib/oeqa/buildperf/test_basic.py
@@ -0,0 +1,127 @@
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Basic set of build performance tests"""
+import os
+import shutil
+
+import oe.path
+from oeqa.buildperf import BuildPerfTestCase
+from oeqa.utils.commands import get_bb_var, get_bb_vars
+
+class Test1P1(BuildPerfTestCase):
+ build_target = 'core-image-sato'
+
+ def test1(self):
+ """Build core-image-sato"""
+ self.rm_tmp()
+ self.rm_sstate()
+ self.rm_cache()
+ self.sync()
+ self.measure_cmd_resources(['bitbake', self.build_target], 'build',
+ 'bitbake ' + self.build_target, save_bs=True)
+ self.measure_disk_usage(self.bb_vars['TMPDIR'], 'tmpdir', 'tmpdir')
+ self.measure_disk_usage(get_bb_var("IMAGE_ROOTFS", self.build_target), 'rootfs', 'rootfs', True)
+
+
+class Test1P2(BuildPerfTestCase):
+ build_target = 'virtual/kernel'
+
+ def test12(self):
+ """Build virtual/kernel"""
+ # Build and cleans state in order to get all dependencies pre-built
+ self.run_cmd(['bitbake', self.build_target])
+ self.run_cmd(['bitbake', self.build_target, '-c', 'cleansstate'])
+
+ self.sync()
+ self.measure_cmd_resources(['bitbake', self.build_target], 'build',
+ 'bitbake ' + self.build_target)
+
+
+class Test1P3(BuildPerfTestCase):
+ build_target = 'core-image-sato'
+
+ def test13(self):
+ """Build core-image-sato with rm_work enabled"""
+ postfile = os.path.join(self.tmp_dir, 'postfile.conf')
+ with open(postfile, 'w') as fobj:
+ fobj.write('INHERIT += "rm_work"\n')
+
+ self.rm_tmp()
+ self.rm_sstate()
+ self.rm_cache()
+ self.sync()
+ cmd = ['bitbake', '-R', postfile, self.build_target]
+ self.measure_cmd_resources(cmd, 'build',
+ 'bitbake' + self.build_target,
+ save_bs=True)
+ self.measure_disk_usage(self.bb_vars['TMPDIR'], 'tmpdir', 'tmpdir')
+
+
+class Test2(BuildPerfTestCase):
+ build_target = 'core-image-sato'
+
+ def test2(self):
+ """Run core-image-sato do_rootfs with sstate"""
+ # Build once in order to populate sstate cache
+ self.run_cmd(['bitbake', self.build_target])
+
+ self.rm_tmp()
+ self.rm_cache()
+ self.sync()
+ cmd = ['bitbake', self.build_target, '-c', 'rootfs']
+ self.measure_cmd_resources(cmd, 'do_rootfs', 'bitbake do_rootfs')
+
+
+class Test3(BuildPerfTestCase):
+
+ def test3(self):
+ """Bitbake parsing (bitbake -p)"""
+ # Drop all caches and parse
+ self.rm_cache()
+ oe.path.remove(os.path.join(self.bb_vars['TMPDIR'], 'cache'), True)
+ self.measure_cmd_resources(['bitbake', '-p'], 'parse_1',
+ 'bitbake -p (no caches)')
+ # Drop tmp/cache
+ oe.path.remove(os.path.join(self.bb_vars['TMPDIR'], 'cache'), True)
+ self.measure_cmd_resources(['bitbake', '-p'], 'parse_2',
+ 'bitbake -p (no tmp/cache)')
+ # Parse with fully cached data
+ self.measure_cmd_resources(['bitbake', '-p'], 'parse_3',
+ 'bitbake -p (cached)')
+
+
+class Test4(BuildPerfTestCase):
+ build_target = 'core-image-sato'
+
+ def test4(self):
+ """eSDK metrics"""
+ self.run_cmd(['bitbake', '-c', 'do_populate_sdk_ext',
+ self.build_target])
+ self.bb_vars = get_bb_vars(None, self.build_target)
+ tmp_dir = self.bb_vars['TMPDIR']
+ installer = os.path.join(
+ self.bb_vars['SDK_DEPLOY'],
+ self.bb_vars['TOOLCHAINEXT_OUTPUTNAME'] + '.sh')
+ # Measure installer size
+ self.measure_disk_usage(installer, 'installer_bin', 'eSDK installer',
+ apparent_size=True)
+ # Measure deployment time and deployed size
+ deploy_dir = os.path.join(tmp_dir, 'esdk-deploy')
+ if os.path.exists(deploy_dir):
+ shutil.rmtree(deploy_dir)
+ self.sync()
+ self.measure_cmd_resources([installer, '-y', '-d', deploy_dir],
+ 'deploy', 'eSDK deploy')
+ #make sure bitbake is unloaded
+ self.sync()
+ self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir',
+ apparent_size=True)
diff --git a/poky/meta/lib/oeqa/controllers/__init__.py b/poky/meta/lib/oeqa/controllers/__init__.py
new file mode 100644
index 000000000..8eda92763
--- /dev/null
+++ b/poky/meta/lib/oeqa/controllers/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have modules in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/poky/meta/lib/oeqa/controllers/masterimage.py b/poky/meta/lib/oeqa/controllers/masterimage.py
new file mode 100644
index 000000000..a2912fc56
--- /dev/null
+++ b/poky/meta/lib/oeqa/controllers/masterimage.py
@@ -0,0 +1,239 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module adds support to testimage.bbclass to deploy images and run
+# tests using a "master image" - this is a "known good" image that is
+# installed onto the device as part of initial setup and will be booted into
+# with no interaction; we can then use it to deploy the image to be tested
+# to a second partition before running the tests.
+#
+# For an example master image, see core-image-testmaster
+# (meta/recipes-extended/images/core-image-testmaster.bb)
+
+import os
+import bb
+import traceback
+import time
+import subprocess
+
+import oeqa.targetcontrol
+import oeqa.utils.sshcontrol as sshcontrol
+import oeqa.utils.commands as commands
+from oeqa.utils import CommandError
+
+from abc import ABCMeta, abstractmethod
+
+class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta):
+
+ supported_image_fstypes = ['tar.gz', 'tar.bz2']
+
+ def __init__(self, d):
+ super(MasterImageHardwareTarget, self).__init__(d)
+
+ # target ip
+ addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+ self.ip = addr.split(":")[0]
+ try:
+ self.port = addr.split(":")[1]
+ except IndexError:
+ self.port = None
+ bb.note("Target IP: %s" % self.ip)
+ self.server_ip = d.getVar("TEST_SERVER_IP")
+ if not self.server_ip:
+ try:
+ self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
+ except Exception as e:
+ bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
+ bb.note("Server IP: %s" % self.server_ip)
+
+ # test rootfs + kernel
+ self.image_fstype = self.get_image_fstype(d)
+ self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
+ self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+ if not os.path.isfile(self.rootfs):
+ # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be
+ # the same as the config with which the image was build, ie
+ # you bitbake core-image-sato with IMAGE_FSTYPES += "tar.gz"
+ # and your autobuilder overwrites the config, adds the test bits and runs bitbake core-image-sato -c testimage
+ bb.fatal("No rootfs found. Did you build the image ?\nIf yes, did you build it with IMAGE_FSTYPES += \"tar.gz\" ? \
+ \nExpected path: %s" % self.rootfs)
+ if not os.path.isfile(self.kernel):
+ bb.fatal("No kernel found. Expected path: %s" % self.kernel)
+
+ # master ssh connection
+ self.master = None
+ # if the user knows what they are doing, then by all means...
+ self.user_cmds = d.getVar("TEST_DEPLOY_CMDS")
+ self.deploy_cmds = None
+
+ # this is the name of the command that controls the power for a board
+ # e.g: TEST_POWERCONTROL_CMD = "/home/user/myscripts/powercontrol.py ${MACHINE} what-ever-other-args-the-script-wants"
+ # the command should take as the last argument "off" and "on" and "cycle" (off, on)
+ self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD") or None
+ self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS", False) or ""
+
+ self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD") or None
+ self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS", False) or ""
+
+ self.origenv = os.environ
+ if self.powercontrol_cmd or self.serialcontrol_cmd:
+ # the external script for controlling power might use ssh
+ # ssh + keys means we need the original user env
+ bborigenv = d.getVar("BB_ORIGENV", False) or {}
+ for key in bborigenv:
+ val = bborigenv.getVar(key)
+ if val is not None:
+ self.origenv[key] = str(val)
+
+ if self.powercontrol_cmd:
+ if self.powercontrol_args:
+ self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
+ if self.serialcontrol_cmd:
+ if self.serialcontrol_args:
+ self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
+
+ def power_ctl(self, msg):
+ if self.powercontrol_cmd:
+ cmd = "%s %s" % (self.powercontrol_cmd, msg)
+ try:
+ commands.runCmd(cmd, assert_error=False, preexec_fn=os.setsid, env=self.origenv)
+ except CommandError as e:
+ bb.fatal(str(e))
+
+ def power_cycle(self, conn):
+ if self.powercontrol_cmd:
+ # be nice, don't just cut power
+ conn.run("shutdown -h now")
+ time.sleep(10)
+ self.power_ctl("cycle")
+ else:
+ status, output = conn.run("sync; { sleep 1; reboot; } > /dev/null &")
+ if status != 0:
+ bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output)
+
+ def _wait_until_booted(self):
+ ''' Waits until the target device has booted (if we have just power cycled it) '''
+ # Subclasses with better methods of determining boot can override this
+ time.sleep(120)
+
+ def deploy(self):
+ # base class just sets the ssh log file for us
+ super(MasterImageHardwareTarget, self).deploy()
+ self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
+ status, output = self.master.run("cat /etc/masterimage")
+ if status != 0:
+ # We're not booted into the master image, so try rebooting
+ bb.plain("%s - booting into the master image" % self.pn)
+ self.power_ctl("cycle")
+ self._wait_until_booted()
+
+ bb.plain("%s - deploying image on target" % self.pn)
+ status, output = self.master.run("cat /etc/masterimage")
+ if status != 0:
+ bb.fatal("No ssh connectivity or target isn't running a master image.\n%s" % output)
+ if self.user_cmds:
+ self.deploy_cmds = self.user_cmds.split("\n")
+ try:
+ self._deploy()
+ except Exception as e:
+ bb.fatal("Failed deploying test image: %s" % e)
+
+ @abstractmethod
+ def _deploy(self):
+ pass
+
+ def start(self, extra_bootparams=None):
+ bb.plain("%s - boot test image on target" % self.pn)
+ self._start()
+ # set the ssh object for the target/test image
+ self.connection = sshcontrol.SSHControl(self.ip, logfile=self.sshlog, port=self.port)
+ bb.plain("%s - start running tests" % self.pn)
+
+ @abstractmethod
+ def _start(self):
+ pass
+
+ def stop(self):
+ bb.plain("%s - reboot/powercycle target" % self.pn)
+ self.power_cycle(self.master)
+
+
+class SystemdbootTarget(MasterImageHardwareTarget):
+
+ def __init__(self, d):
+ super(SystemdbootTarget, self).__init__(d)
+ # this the value we need to set in the LoaderEntryOneShot EFI variable
+ # so the system boots the 'test' bootloader label and not the default
+ # The first four bytes are EFI bits, and the rest is an utf-16le string
+ # (EFI vars values need to be utf-16)
+ # $ echo -en "test\0" | iconv -f ascii -t utf-16le | hexdump -C
+ # 00000000 74 00 65 00 73 00 74 00 00 00 |t.e.s.t...|
+ self.efivarvalue = r'\x07\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00'
+ self.deploy_cmds = [
+ 'mount -L boot /boot',
+ 'mkdir -p /mnt/testrootfs',
+ 'mount -L testrootfs /mnt/testrootfs',
+ 'modprobe efivarfs',
+ 'mount -t efivarfs efivarfs /sys/firmware/efi/efivars',
+ 'cp ~/test-kernel /boot',
+ 'rm -rf /mnt/testrootfs/*',
+ 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
+ 'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue
+ ]
+
+ def _deploy(self):
+ # make sure these aren't mounted
+ self.master.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
+ # from now on, every deploy cmd should return 0
+ # else an exception will be thrown by sshcontrol
+ self.master.ignore_status = False
+ self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
+ self.master.copy_to(self.kernel, "~/test-kernel")
+ for cmd in self.deploy_cmds:
+ self.master.run(cmd)
+
+ def _start(self, params=None):
+ self.power_cycle(self.master)
+ # there are better ways than a timeout but this should work for now
+ time.sleep(120)
+
+
+class SystemdbootTarget(MasterImageHardwareTarget):
+
+ def __init__(self, d):
+ super(SystemdbootTarget, self).__init__(d)
+ # this the value we need to set in the LoaderEntryOneShot EFI variable
+ # so the system boots the 'test' bootloader label and not the default
+ # The first four bytes are EFI bits, and the rest is an utf-16le string
+ # (EFI vars values need to be utf-16)
+ # $ echo -en "test\0" | iconv -f ascii -t utf-16le | hexdump -C
+ # 00000000 74 00 65 00 73 00 74 00 00 00 |t.e.s.t...|
+ self.efivarvalue = r'\x07\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00'
+ self.deploy_cmds = [
+ 'mount -L boot /boot',
+ 'mkdir -p /mnt/testrootfs',
+ 'mount -L testrootfs /mnt/testrootfs',
+ 'modprobe efivarfs',
+ 'mount -t efivarfs efivarfs /sys/firmware/efi/efivars',
+ 'cp ~/test-kernel /boot',
+ 'rm -rf /mnt/testrootfs/*',
+ 'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
+ 'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue
+ ]
+
+ def _deploy(self):
+ # make sure these aren't mounted
+ self.master.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
+ # from now on, every deploy cmd should return 0
+ # else an exception will be thrown by sshcontrol
+ self.master.ignore_status = False
+ self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
+ self.master.copy_to(self.kernel, "~/test-kernel")
+ for cmd in self.deploy_cmds:
+ self.master.run(cmd)
+
+ def _start(self, params=None):
+ self.power_cycle(self.master)
+ # there are better ways than a timeout but this should work for now
+ time.sleep(120)
diff --git a/poky/meta/lib/oeqa/controllers/testtargetloader.py b/poky/meta/lib/oeqa/controllers/testtargetloader.py
new file mode 100644
index 000000000..b51d04b21
--- /dev/null
+++ b/poky/meta/lib/oeqa/controllers/testtargetloader.py
@@ -0,0 +1,68 @@
+import types
+import bb
+import os
+
+# This class is responsible for loading a test target controller
+class TestTargetLoader:
+
+ # Search oeqa.controllers module directory for and return a controller
+ # corresponding to the given target name.
+ # AttributeError raised if not found.
+ # ImportError raised if a provided module can not be imported.
+ def get_controller_module(self, target, bbpath):
+ controllerslist = self.get_controller_modulenames(bbpath)
+ bb.note("Available controller modules: %s" % str(controllerslist))
+ controller = self.load_controller_from_name(target, controllerslist)
+ return controller
+
+ # Return a list of all python modules in lib/oeqa/controllers for each
+ # layer in bbpath
+ def get_controller_modulenames(self, bbpath):
+
+ controllerslist = []
+
+ def add_controller_list(path):
+ if not os.path.exists(os.path.join(path, '__init__.py')):
+ bb.fatal('Controllers directory %s exists but is missing __init__.py' % path)
+ files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+ for f in files:
+ module = 'oeqa.controllers.' + f[:-3]
+ if module not in controllerslist:
+ controllerslist.append(module)
+ else:
+ bb.warn("Duplicate controller module found for %s, only one added. Layers should create unique controller module names" % module)
+
+ for p in bbpath:
+ controllerpath = os.path.join(p, 'lib', 'oeqa', 'controllers')
+ bb.debug(2, 'Searching for target controllers in %s' % controllerpath)
+ if os.path.exists(controllerpath):
+ add_controller_list(controllerpath)
+ return controllerslist
+
+ # Search for and return a controller from given target name and
+ # set of module names.
+ # Raise AttributeError if not found.
+ # Raise ImportError if a provided module can not be imported
+ def load_controller_from_name(self, target, modulenames):
+ for name in modulenames:
+ obj = self.load_controller_from_module(target, name)
+ if obj:
+ return obj
+ raise AttributeError("Unable to load {0} from available modules: {1}".format(target, str(modulenames)))
+
+ # Search for and return a controller or None from given module name
+ def load_controller_from_module(self, target, modulename):
+ obj = None
+ # import module, allowing it to raise import exception
+ module = __import__(modulename, globals(), locals(), [target])
+ # look for target class in the module, catching any exceptions as it
+ # is valid that a module may not have the target class.
+ try:
+ obj = getattr(module, target)
+ if obj:
+ from oeqa.targetcontrol import BaseTarget
+ if( not issubclass(obj, BaseTarget)):
+ bb.warn("Target {0} found, but subclass is not BaseTarget".format(target))
+ except:
+ obj = None
+ return obj
diff --git a/poky/meta/lib/oeqa/core/README b/poky/meta/lib/oeqa/core/README
new file mode 100644
index 000000000..d4fcda41f
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/README
@@ -0,0 +1,76 @@
+= OEQA (v2) Framework =
+
+== Introduction ==
+
+This is version 2 of the OEQA framework. Base clases are located in the
+'oeqa/core' directory and subsequent components must extend from these.
+
+The main design consideration was to implement the needed functionality on
+top of the Python unittest framework. To achieve this goal, the following
+modules are used:
+
+ * oeqa/core/runner.py: Provides OETestResult and OETestRunner base
+ classes extending the unittest class. These classes support exporting
+ results to different formats; currently RAW and XML support exist.
+
+ * oeqa/core/loader.py: Provides OETestLoader extending the unittest class.
+ It also features a unified implementation of decorator support and
+ filtering test cases.
+
+ * oeqa/core/case.py: Provides OETestCase base class extending
+ unittest.TestCase and provides access to the Test data (td), Test context
+ and Logger functionality.
+
+ * oeqa/core/decorator: Provides OETestDecorator, a new class to implement
+ decorators for Test cases.
+
+ * oeqa/core/context: Provides OETestContext, a high-level API for
+ loadTests and runTests of certain Test component and
+ OETestContextExecutor a base class to enable oe-test to discover/use
+ the Test component.
+
+Also, a new 'oe-test' runner is located under 'scripts', allowing scans for components
+that supports OETestContextExecutor (see below).
+
+== Terminology ==
+
+ * Test component: The area of testing in the Project, for example: runtime, SDK, eSDK, selftest.
+
+ * Test data: Data associated with the Test component. Currently we use bitbake datastore as
+ a Test data input.
+
+ * Test context: A context of what tests needs to be run and how to do it; this additionally
+ provides access to the Test data and could have custom methods and/or attrs.
+
+== oe-test ==
+
+The new tool, oe-test, has the ability to scan the code base for test components and provide
+a unified way to run test cases. Internally it scans folders inside oeqa module in order to find
+specific classes that implement a test component.
+
+== Usage ==
+
+Executing the example test component
+
+ $ source oe-init-build-env
+ $ oe-test core
+
+Getting help
+
+ $ oe-test -h
+
+== Creating new Test Component ==
+
+Adding a new test component the developer needs to extend OETestContext/OETestContextExecutor
+(from context.py) and OETestCase (from case.py)
+
+== Selftesting the framework ==
+
+Run all tests:
+
+ $ PATH=$PATH:../../ python3 -m unittest discover -s tests
+
+Run some test:
+
+ $ cd tests/
+ $ ./test_data.py
diff --git a/poky/meta/lib/oeqa/core/__init__.py b/poky/meta/lib/oeqa/core/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/__init__.py
diff --git a/poky/meta/lib/oeqa/core/case.py b/poky/meta/lib/oeqa/core/case.py
new file mode 100644
index 000000000..917a2aa3f
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/case.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from oeqa.core.exception import OEQAMissingVariable
+
+def _validate_td_vars(td, td_vars, type_msg):
+ if td_vars:
+ for v in td_vars:
+ if not v in td:
+ raise OEQAMissingVariable("Test %s need %s variable but"\
+ " isn't into td" % (type_msg, v))
+
+class OETestCase(unittest.TestCase):
+ # TestContext and Logger instance set by OETestLoader.
+ tc = None
+ logger = None
+
+ # td has all the variables needed by the test cases
+ # is the same across all the test cases.
+ td = None
+
+ # td_vars has the variables needed by a test class
+ # or test case instance, if some var isn't into td a
+ # OEQAMissingVariable exception is raised
+ td_vars = None
+
+ @classmethod
+ def _oeSetUpClass(clss):
+ _validate_td_vars(clss.td, clss.td_vars, "class")
+ clss.setUpClassMethod()
+
+ @classmethod
+ def _oeTearDownClass(clss):
+ clss.tearDownClassMethod()
+
+ def _oeSetUp(self):
+ for d in self.decorators:
+ d.setUpDecorator()
+ self.setUpMethod()
+
+ def _oeTearDown(self):
+ for d in self.decorators:
+ d.tearDownDecorator()
+ self.tearDownMethod()
diff --git a/poky/meta/lib/oeqa/core/cases/__init__.py b/poky/meta/lib/oeqa/core/cases/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/cases/__init__.py
diff --git a/poky/meta/lib/oeqa/core/cases/example/data.json b/poky/meta/lib/oeqa/core/cases/example/data.json
new file mode 100644
index 000000000..21d6b16d1
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/cases/example/data.json
@@ -0,0 +1 @@
+{"ARCH": "x86", "IMAGE": "core-image-minimal"} \ No newline at end of file
diff --git a/poky/meta/lib/oeqa/core/cases/example/test_basic.py b/poky/meta/lib/oeqa/core/cases/example/test_basic.py
new file mode 100644
index 000000000..11cf3800c
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/cases/example/test_basic.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class OETestExample(OETestCase):
+ def test_example(self):
+ self.logger.info('IMAGE: %s' % self.td.get('IMAGE'))
+ self.assertEqual('core-image-minimal', self.td.get('IMAGE'))
+ self.logger.info('ARCH: %s' % self.td.get('ARCH'))
+ self.assertEqual('x86', self.td.get('ARCH'))
+
+class OETestExampleDepend(OETestCase):
+ @OETestDepends(['OETestExample.test_example'])
+ def test_example_depends(self):
+ pass
+
+ def test_example_no_depends(self):
+ pass
diff --git a/poky/meta/lib/oeqa/core/context.py b/poky/meta/lib/oeqa/core/context.py
new file mode 100644
index 000000000..acd547416
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/context.py
@@ -0,0 +1,191 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import json
+import time
+import logging
+import collections
+
+from oeqa.core.loader import OETestLoader
+from oeqa.core.runner import OETestRunner
+from oeqa.core.exception import OEQAMissingManifest, OEQATestNotFound
+
+class OETestContext(object):
+ loaderClass = OETestLoader
+ runnerClass = OETestRunner
+
+ files_dir = os.path.abspath(os.path.join(os.path.dirname(
+ os.path.abspath(__file__)), "../files"))
+
+ def __init__(self, td=None, logger=None):
+ if not type(td) is dict:
+ raise TypeError("td isn't dictionary type")
+
+ self.td = td
+ self.logger = logger
+ self._registry = {}
+ self._registry['cases'] = collections.OrderedDict()
+ self._results = {}
+
+ def _read_modules_from_manifest(self, manifest):
+ if not os.path.exists(manifest):
+ raise OEQAMissingManifest("Manifest does not exist on %s" % manifest)
+
+ modules = []
+ for line in open(manifest).readlines():
+ line = line.strip()
+ if line and not line.startswith("#"):
+ modules.append(line)
+
+ return modules
+
+ def skipTests(self, skips):
+ if not skips:
+ return
+ for test in self.suites:
+ for skip in skips:
+ if test.id().startswith(skip):
+ setattr(test, 'setUp', lambda: test.skipTest('Skip by the command line argument "%s"' % skip))
+
+ def loadTests(self, module_paths, modules=[], tests=[],
+ modules_manifest="", modules_required=[], filters={}):
+ if modules_manifest:
+ modules = self._read_modules_from_manifest(modules_manifest)
+
+ self.loader = self.loaderClass(self, module_paths, modules, tests,
+ modules_required, filters)
+ self.suites = self.loader.discover()
+
+ def runTests(self, skips=[]):
+ self.runner = self.runnerClass(self, descriptions=False, verbosity=2)
+
+ # Dinamically skip those tests specified though arguments
+ self.skipTests(skips)
+
+ self._run_start_time = time.time()
+ result = self.runner.run(self.suites)
+ self._run_end_time = time.time()
+
+ return result
+
+ def listTests(self, display_type):
+ self.runner = self.runnerClass(self, verbosity=2)
+ return self.runner.list_tests(self.suites, display_type)
+
+class OETestContextExecutor(object):
+ _context_class = OETestContext
+ _script_executor = 'oe-test'
+
+ name = 'core'
+ help = 'core test component example'
+ description = 'executes core test suite example'
+
+ default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+ 'cases/example')]
+ default_test_data = os.path.join(default_cases[0], 'data.json')
+ default_tests = None
+
+ def register_commands(self, logger, subparsers):
+ self.parser = subparsers.add_parser(self.name, help=self.help,
+ description=self.description, group='components')
+
+ self.default_output_log = '%s-results-%s.log' % (self.name,
+ time.strftime("%Y%m%d%H%M%S"))
+ self.parser.add_argument('--output-log', action='store',
+ default=self.default_output_log,
+ help="results output log, default: %s" % self.default_output_log)
+
+ group = self.parser.add_mutually_exclusive_group()
+ group.add_argument('--run-tests', action='store', nargs='+',
+ default=self.default_tests,
+ help="tests to run in <module>[.<class>[.<name>]]")
+ group.add_argument('--list-tests', action='store',
+ choices=('module', 'class', 'name'),
+ help="lists available tests")
+
+ if self.default_test_data:
+ self.parser.add_argument('--test-data-file', action='store',
+ default=self.default_test_data,
+ help="data file to load, default: %s" % self.default_test_data)
+ else:
+ self.parser.add_argument('--test-data-file', action='store',
+ help="data file to load")
+
+ if self.default_cases:
+ self.parser.add_argument('CASES_PATHS', action='store',
+ default=self.default_cases, nargs='*',
+ help="paths to directories with test cases, default: %s"\
+ % self.default_cases)
+ else:
+ self.parser.add_argument('CASES_PATHS', action='store',
+ nargs='+', help="paths to directories with test cases")
+
+ self.parser.set_defaults(func=self.run)
+
+ def _setup_logger(self, logger, args):
+ formatter = logging.Formatter('%(asctime)s - ' + self.name + \
+ ' - %(levelname)s - %(message)s')
+ sh = logger.handlers[0]
+ sh.setFormatter(formatter)
+ fh = logging.FileHandler(args.output_log)
+ fh.setFormatter(formatter)
+ logger.addHandler(fh)
+
+ return logger
+
+ def _process_args(self, logger, args):
+ self.tc_kwargs = {}
+ self.tc_kwargs['init'] = {}
+ self.tc_kwargs['load'] = {}
+ self.tc_kwargs['list'] = {}
+ self.tc_kwargs['run'] = {}
+
+ self.tc_kwargs['init']['logger'] = self._setup_logger(logger, args)
+ if args.test_data_file:
+ self.tc_kwargs['init']['td'] = json.load(
+ open(args.test_data_file, "r"))
+ else:
+ self.tc_kwargs['init']['td'] = {}
+
+ if args.run_tests:
+ self.tc_kwargs['load']['modules'] = args.run_tests
+ self.tc_kwargs['load']['modules_required'] = args.run_tests
+ else:
+ self.tc_kwargs['load']['modules'] = []
+
+ self.tc_kwargs['run']['skips'] = []
+
+ self.module_paths = args.CASES_PATHS
+
+ def _pre_run(self):
+ pass
+
+ def run(self, logger, args):
+ self._process_args(logger, args)
+
+ self.tc = self._context_class(**self.tc_kwargs['init'])
+ try:
+ self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
+ except OEQATestNotFound as ex:
+ logger.error(ex)
+ sys.exit(1)
+
+ if args.list_tests:
+ rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['list'])
+ else:
+ self._pre_run()
+ rc = self.tc.runTests(**self.tc_kwargs['run'])
+ rc.logDetails()
+ rc.logSummary(self.name)
+
+ output_link = os.path.join(os.path.dirname(args.output_log),
+ "%s-results.log" % self.name)
+ if os.path.exists(output_link):
+ os.remove(output_link)
+ os.symlink(args.output_log, output_link)
+
+ return rc
+
+_executor_class = OETestContextExecutor
diff --git a/poky/meta/lib/oeqa/core/decorator/__init__.py b/poky/meta/lib/oeqa/core/decorator/__init__.py
new file mode 100644
index 000000000..855b6b9d2
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/__init__.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from functools import wraps
+from abc import abstractmethod
+
+decoratorClasses = set()
+
+def registerDecorator(obj):
+ decoratorClasses.add(obj)
+ return obj
+
+class OETestDecorator(object):
+ case = None # Reference of OETestCase decorated
+ attrs = None # Attributes to be loaded by decorator implementation
+
+ def __init__(self, *args, **kwargs):
+ if not self.attrs:
+ return
+
+ for idx, attr in enumerate(self.attrs):
+ if attr in kwargs:
+ value = kwargs[attr]
+ else:
+ value = args[idx]
+ setattr(self, attr, value)
+
+ def __call__(self, func):
+ @wraps(func)
+ def wrapped_f(*args, **kwargs):
+ self.attrs = self.attrs # XXX: Enables OETestLoader discover
+ return func(*args, **kwargs)
+ return wrapped_f
+
+ # OETestLoader call it when is loading test cases.
+ # XXX: Most methods would change the registry for later
+ # processing; be aware that filtrate method needs to
+ # run later than bind, so there could be data (in the
+ # registry) of a cases that were filtered.
+ def bind(self, registry, case):
+ self.case = case
+ self.logger = case.tc.logger
+ self.case.decorators.append(self)
+
+ # OETestRunner call this method when tries to run
+ # the test case.
+ def setUpDecorator(self):
+ pass
+
+ # OETestRunner call it after a test method has been
+ # called even if the method raised an exception.
+ def tearDownDecorator(self):
+ pass
+
+class OETestDiscover(OETestDecorator):
+
+ # OETestLoader call it after discover test cases
+ # needs to return the cases to be run.
+ @staticmethod
+ def discover(registry):
+ return registry['cases']
+
+class OETestFilter(OETestDecorator):
+
+ # OETestLoader call it while loading the tests
+ # in loadTestsFromTestCase method, it needs to
+ # return a bool, True if needs to be filtered.
+ # This method must consume the filter used.
+ @abstractmethod
+ def filtrate(self, filters):
+ return False
diff --git a/poky/meta/lib/oeqa/core/decorator/data.py b/poky/meta/lib/oeqa/core/decorator/data.py
new file mode 100644
index 000000000..ff7bdd98b
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/data.py
@@ -0,0 +1,98 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.exception import OEQAMissingVariable
+
+from . import OETestDecorator, registerDecorator
+
+def has_feature(td, feature):
+ """
+ Checks for feature in DISTRO_FEATURES or IMAGE_FEATURES.
+ """
+
+ if (feature in td.get('DISTRO_FEATURES', '') or
+ feature in td.get('IMAGE_FEATURES', '')):
+ return True
+ return False
+
+@registerDecorator
+class skipIfDataVar(OETestDecorator):
+ """
+ Skip test based on value of a data store's variable.
+
+ It will get the info of var from the data store and will
+ check it against value; if are equal it will skip the test
+ with msg as the reason.
+ """
+
+ attrs = ('var', 'value', 'msg')
+
+ def setUpDecorator(self):
+ msg = ('Checking if %r value is %r to skip test' %
+ (self.var, self.value))
+ self.logger.debug(msg)
+ if self.case.td.get(self.var) == self.value:
+ self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfNotDataVar(OETestDecorator):
+ """
+ Skip test based on value of a data store's variable.
+
+ It will get the info of var from the data store and will
+ check it against value; if are not equal it will skip the
+ test with msg as the reason.
+ """
+
+ attrs = ('var', 'value', 'msg')
+
+ def setUpDecorator(self):
+ msg = ('Checking if %r value is not %r to skip test' %
+ (self.var, self.value))
+ self.logger.debug(msg)
+ if not self.case.td.get(self.var) == self.value:
+ self.case.skipTest(self.msg)
+
+@registerDecorator
+class skipIfNotInDataVar(OETestDecorator):
+ """
+ Skip test if value is not in data store's variable.
+ """
+
+ attrs = ('var', 'value', 'msg')
+ def setUpDecorator(self):
+ msg = ('Checking if %r value is in %r to run '
+ 'the test' % (self.var, self.value))
+ self.logger.debug(msg)
+ if not self.value in self.case.td.get(self.var):
+ self.case.skipTest(self.msg)
+
+@registerDecorator
+class OETestDataDepends(OETestDecorator):
+ attrs = ('td_depends',)
+
+ def setUpDecorator(self):
+ for v in self.td_depends:
+ try:
+ value = self.case.td[v]
+ except KeyError:
+ raise OEQAMissingVariable("Test case need %s variable but"\
+ " isn't into td" % v)
+
+@registerDecorator
+class skipIfNotFeature(OETestDecorator):
+ """
+ Skip test based on DISTRO_FEATURES.
+
+ value must be in distro features or it will skip the test
+ with msg as the reason.
+ """
+
+ attrs = ('value', 'msg')
+
+ def setUpDecorator(self):
+ msg = ('Checking if %s is in DISTRO_FEATURES '
+ 'or IMAGE_FEATURES' % (self.value))
+ self.logger.debug(msg)
+ if not has_feature(self.case.td, self.value):
+ self.case.skipTest(self.msg)
diff --git a/poky/meta/lib/oeqa/core/decorator/depends.py b/poky/meta/lib/oeqa/core/decorator/depends.py
new file mode 100644
index 000000000..baa04341c
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/depends.py
@@ -0,0 +1,100 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from unittest import SkipTest
+
+from oeqa.core.threaded import OETestRunnerThreaded
+from oeqa.core.exception import OEQADependency
+
+from . import OETestDiscover, registerDecorator
+
+def _add_depends(registry, case, depends):
+ module_name = case.__module__
+ class_name = case.__class__.__name__
+
+ case_id = case.id()
+
+ for depend in depends:
+ dparts = depend.split('.')
+
+ if len(dparts) == 1:
+ depend_id = ".".join((module_name, class_name, dparts[0]))
+ elif len(dparts) == 2:
+ depend_id = ".".join((module_name, dparts[0], dparts[1]))
+ else:
+ depend_id = depend
+
+ if not case_id in registry:
+ registry[case_id] = []
+ if not depend_id in registry[case_id]:
+ registry[case_id].append(depend_id)
+
+def _validate_test_case_depends(cases, depends):
+ for case in depends:
+ if not case in cases:
+ continue
+ for dep in depends[case]:
+ if not dep in cases:
+ raise OEQADependency("TestCase %s depends on %s and isn't available"\
+ ", cases available %s." % (case, dep, str(cases.keys())))
+
+def _order_test_case_by_depends(cases, depends):
+ def _dep_resolve(graph, node, resolved, seen):
+ seen.append(node)
+ for edge in graph[node]:
+ if edge not in resolved:
+ if edge in seen:
+ raise OEQADependency("Test cases %s and %s have a circular" \
+ " dependency." % (node, edge))
+ _dep_resolve(graph, edge, resolved, seen)
+ resolved.append(node)
+
+ dep_graph = {}
+ dep_graph['__root__'] = cases.keys()
+ for case in cases:
+ if case in depends:
+ dep_graph[case] = depends[case]
+ else:
+ dep_graph[case] = []
+
+ cases_ordered = []
+ _dep_resolve(dep_graph, '__root__', cases_ordered, [])
+ cases_ordered.remove('__root__')
+
+ return [cases[case_id] for case_id in cases_ordered]
+
+def _skipTestDependency(case, depends):
+ if isinstance(case.tc.runner, OETestRunnerThreaded):
+ import threading
+ results = case.tc._results[threading.get_ident()]
+ else:
+ results = case.tc._results
+
+ skipReasons = ['errors', 'failures', 'skipped']
+
+ for reason in skipReasons:
+ for test, _ in results[reason]:
+ if test.id() in depends:
+ raise SkipTest("Test case %s depends on %s and was in %s." \
+ % (case.id(), test.id(), reason))
+
+@registerDecorator
+class OETestDepends(OETestDiscover):
+ attrs = ('depends',)
+
+ def bind(self, registry, case):
+ super(OETestDepends, self).bind(registry, case)
+ if not registry.get('depends'):
+ registry['depends'] = {}
+ _add_depends(registry['depends'], case, self.depends)
+
+ @staticmethod
+ def discover(registry):
+ if registry.get('depends'):
+ _validate_test_case_depends(registry['cases'], registry['depends'])
+ return _order_test_case_by_depends(registry['cases'], registry['depends'])
+ else:
+ return [registry['cases'][case_id] for case_id in registry['cases']]
+
+ def setUpDecorator(self):
+ _skipTestDependency(self.case, self.depends)
diff --git a/poky/meta/lib/oeqa/core/decorator/oeid.py b/poky/meta/lib/oeqa/core/decorator/oeid.py
new file mode 100644
index 000000000..ea8017a55
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/oeid.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestFilter, registerDecorator
+from oeqa.core.utils.misc import intToList
+
+def _idFilter(oeid, filters):
+ return False if oeid in filters else True
+
+@registerDecorator
+class OETestID(OETestFilter):
+ attrs = ('oeid',)
+
+ def bind(self, registry, case):
+ super(OETestID, self).bind(registry, case)
+
+ def filtrate(self, filters):
+ if filters.get('oeid'):
+ filterx = intToList(filters['oeid'], 'oeid')
+ del filters['oeid']
+ if _idFilter(self.oeid, filterx):
+ return True
+ return False
diff --git a/poky/meta/lib/oeqa/core/decorator/oetag.py b/poky/meta/lib/oeqa/core/decorator/oetag.py
new file mode 100644
index 000000000..ad38ab78a
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/oetag.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestFilter, registerDecorator
+from oeqa.core.utils.misc import strToList
+
+def _tagFilter(tags, filters):
+ return False if set(tags) & set(filters) else True
+
+@registerDecorator
+class OETestTag(OETestFilter):
+ attrs = ('oetag',)
+
+ def bind(self, registry, case):
+ super(OETestTag, self).bind(registry, case)
+ self.oetag = strToList(self.oetag, 'oetag')
+
+ def filtrate(self, filters):
+ if filters.get('oetag'):
+ filterx = strToList(filters['oetag'], 'oetag')
+ del filters['oetag']
+ if _tagFilter(self.oetag, filterx):
+ return True
+ return False
diff --git a/poky/meta/lib/oeqa/core/decorator/oetimeout.py b/poky/meta/lib/oeqa/core/decorator/oetimeout.py
new file mode 100644
index 000000000..f85e7d979
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/decorator/oetimeout.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from . import OETestDecorator, registerDecorator
+
+import signal
+from threading import Timer
+
+from oeqa.core.threaded import OETestRunnerThreaded
+from oeqa.core.exception import OEQATimeoutError
+
+@registerDecorator
+class OETimeout(OETestDecorator):
+ attrs = ('oetimeout',)
+
+ def setUpDecorator(self):
+ self.logger.debug("Setting up a %d second(s) timeout" % self.oetimeout)
+
+ if isinstance(self.case.tc.runner, OETestRunnerThreaded):
+ self.timeouted = False
+ def _timeoutHandler():
+ self.timeouted = True
+
+ self.timer = Timer(self.oetimeout, _timeoutHandler)
+ self.timer.start()
+ else:
+ timeout = self.oetimeout
+ def _timeoutHandler(signum, frame):
+ raise OEQATimeoutError("Timed out after %s "
+ "seconds of execution" % timeout)
+
+ self.alarmSignal = signal.signal(signal.SIGALRM, _timeoutHandler)
+ signal.alarm(self.oetimeout)
+
+ def tearDownDecorator(self):
+ if isinstance(self.case.tc.runner, OETestRunnerThreaded):
+ self.timer.cancel()
+ self.logger.debug("Removed Timer handler")
+ if self.timeouted:
+ raise OEQATimeoutError("Timed out after %s "
+ "seconds of execution" % self.oetimeout)
+ else:
+ signal.alarm(0)
+ signal.signal(signal.SIGALRM, self.alarmSignal)
+ self.logger.debug("Removed SIGALRM handler")
diff --git a/poky/meta/lib/oeqa/core/exception.py b/poky/meta/lib/oeqa/core/exception.py
new file mode 100644
index 000000000..732f2efde
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/exception.py
@@ -0,0 +1,23 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+class OEQAException(Exception):
+ pass
+
+class OEQATimeoutError(OEQAException):
+ pass
+
+class OEQAMissingVariable(OEQAException):
+ pass
+
+class OEQADependency(OEQAException):
+ pass
+
+class OEQAMissingManifest(OEQAException):
+ pass
+
+class OEQAPreRun(OEQAException):
+ pass
+
+class OEQATestNotFound(OEQAException):
+ pass
diff --git a/poky/meta/lib/oeqa/core/loader.py b/poky/meta/lib/oeqa/core/loader.py
new file mode 100644
index 000000000..a4744dee0
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/loader.py
@@ -0,0 +1,355 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import re
+import sys
+import unittest
+import inspect
+
+from oeqa.core.utils.path import findFile
+from oeqa.core.utils.test import getSuiteModules, getCaseID
+
+from oeqa.core.exception import OEQATestNotFound
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator import decoratorClasses, OETestDecorator, \
+ OETestFilter, OETestDiscover
+
+# When loading tests, the unittest framework stores any exceptions and
+# displays them only when the run method is called.
+#
+# For our purposes, it is better to raise the exceptions in the loading
+# step rather than waiting to run the test suite.
+#
+# Generate the function definition because this differ across python versions
+# Python >= 3.4.4 uses tree parameters instead four but for example Python 3.5.3
+# ueses four parameters so isn't incremental.
+_failed_test_args = inspect.getargspec(unittest.loader._make_failed_test).args
+exec("""def _make_failed_test(%s): raise exception""" % ', '.join(_failed_test_args))
+unittest.loader._make_failed_test = _make_failed_test
+
+def _find_duplicated_modules(suite, directory):
+ for module in getSuiteModules(suite):
+ path = findFile('%s.py' % module, directory)
+ if path:
+ raise ImportError("Duplicated %s module found in %s" % (module, path))
+
+def _built_modules_dict(modules):
+ modules_dict = {}
+
+ if modules == None:
+ return modules_dict
+
+ for module in modules:
+ # Assumption: package and module names do not contain upper case
+ # characters, whereas class names do
+ m = re.match(r'^(\w+)(?:\.(\w[^.]*)(?:\.([^.]+))?)?$', module, flags=re.ASCII)
+
+ module_name, class_name, test_name = m.groups()
+
+ if module_name and module_name not in modules_dict:
+ modules_dict[module_name] = {}
+ if class_name and class_name not in modules_dict[module_name]:
+ modules_dict[module_name][class_name] = []
+ if test_name and test_name not in modules_dict[module_name][class_name]:
+ modules_dict[module_name][class_name].append(test_name)
+
+ return modules_dict
+
+class OETestLoader(unittest.TestLoader):
+ caseClass = OETestCase
+
+ kwargs_names = ['testMethodPrefix', 'sortTestMethodUsing', 'suiteClass',
+ '_top_level_dir']
+
+ def __init__(self, tc, module_paths, modules, tests, modules_required,
+ filters, *args, **kwargs):
+ self.tc = tc
+
+ self.modules = _built_modules_dict(modules)
+
+ self.tests = tests
+ self.modules_required = modules_required
+
+ self.filters = filters
+ self.decorator_filters = [d for d in decoratorClasses if \
+ issubclass(d, OETestFilter)]
+ self._validateFilters(self.filters, self.decorator_filters)
+ self.used_filters = [d for d in self.decorator_filters
+ for f in self.filters
+ if f in d.attrs]
+
+ if isinstance(module_paths, str):
+ module_paths = [module_paths]
+ elif not isinstance(module_paths, list):
+ raise TypeError('module_paths must be a str or a list of str')
+ self.module_paths = module_paths
+
+ for kwname in self.kwargs_names:
+ if kwname in kwargs:
+ setattr(self, kwname, kwargs[kwname])
+
+ self._patchCaseClass(self.caseClass)
+
+ super(OETestLoader, self).__init__()
+
+ def _patchCaseClass(self, testCaseClass):
+ # Adds custom attributes to the OETestCase class
+ setattr(testCaseClass, 'tc', self.tc)
+ setattr(testCaseClass, 'td', self.tc.td)
+ setattr(testCaseClass, 'logger', self.tc.logger)
+
+ def _validateFilters(self, filters, decorator_filters):
+ # Validate if filter isn't empty
+ for key,value in filters.items():
+ if not value:
+ raise TypeError("Filter %s specified is empty" % key)
+
+ # Validate unique attributes
+ attr_filters = [attr for clss in decorator_filters \
+ for attr in clss.attrs]
+ dup_attr = [attr for attr in attr_filters
+ if attr_filters.count(attr) > 1]
+ if dup_attr:
+ raise TypeError('Detected duplicated attribute(s) %s in filter'
+ ' decorators' % ' ,'.join(dup_attr))
+
+ # Validate if filter is supported
+ for f in filters:
+ if f not in attr_filters:
+ classes = ', '.join([d.__name__ for d in decorator_filters])
+ raise TypeError('Found "%s" filter but not declared in any of '
+ '%s decorators' % (f, classes))
+
+ def _registerTestCase(self, case):
+ case_id = case.id()
+ self.tc._registry['cases'][case_id] = case
+
+ def _handleTestCaseDecorators(self, case):
+ def _handle(obj):
+ if isinstance(obj, OETestDecorator):
+ if not obj.__class__ in decoratorClasses:
+ raise Exception("Decorator %s isn't registered" \
+ " in decoratorClasses." % obj.__name__)
+ obj.bind(self.tc._registry, case)
+
+ def _walk_closure(obj):
+ if hasattr(obj, '__closure__') and obj.__closure__:
+ for f in obj.__closure__:
+ obj = f.cell_contents
+ _handle(obj)
+ _walk_closure(obj)
+ method = getattr(case, case._testMethodName, None)
+ _walk_closure(method)
+
+ def _filterTest(self, case):
+ """
+ Returns True if test case must be filtered, False otherwise.
+ """
+ # XXX; If the module has more than one namespace only use
+ # the first to support run the whole module specifying the
+ # <module_name>.[test_class].[test_name]
+ module_name_small = case.__module__.split('.')[0]
+ module_name = case.__module__
+
+ class_name = case.__class__.__name__
+ test_name = case._testMethodName
+
+ if self.modules:
+ module = None
+ try:
+ module = self.modules[module_name_small]
+ except KeyError:
+ try:
+ module = self.modules[module_name]
+ except KeyError:
+ return True
+
+ if module:
+ if not class_name in module:
+ return True
+
+ if module[class_name]:
+ if test_name not in module[class_name]:
+ return True
+
+ # Decorator filters
+ if self.filters and isinstance(case, OETestCase):
+ filters = self.filters.copy()
+ case_decorators = [cd for cd in case.decorators
+ if cd.__class__ in self.used_filters]
+
+ # Iterate over case decorators to check if needs to be filtered.
+ for cd in case_decorators:
+ if cd.filtrate(filters):
+ return True
+
+ # Case is missing one or more decorators for all the filters
+ # being used, so filter test case.
+ if filters:
+ return True
+
+ return False
+
+ def _getTestCase(self, testCaseClass, tcName):
+ if not hasattr(testCaseClass, '__oeqa_loader') and \
+ issubclass(testCaseClass, OETestCase):
+ # In order to support data_vars validation
+ # monkey patch the default setUp/tearDown{Class} to use
+ # the ones provided by OETestCase
+ setattr(testCaseClass, 'setUpClassMethod',
+ getattr(testCaseClass, 'setUpClass'))
+ setattr(testCaseClass, 'tearDownClassMethod',
+ getattr(testCaseClass, 'tearDownClass'))
+ setattr(testCaseClass, 'setUpClass',
+ testCaseClass._oeSetUpClass)
+ setattr(testCaseClass, 'tearDownClass',
+ testCaseClass._oeTearDownClass)
+
+ # In order to support decorators initialization
+ # monkey patch the default setUp/tearDown to use
+ # a setUpDecorators/tearDownDecorators that methods
+ # will call setUp/tearDown original methods.
+ setattr(testCaseClass, 'setUpMethod',
+ getattr(testCaseClass, 'setUp'))
+ setattr(testCaseClass, 'tearDownMethod',
+ getattr(testCaseClass, 'tearDown'))
+ setattr(testCaseClass, 'setUp', testCaseClass._oeSetUp)
+ setattr(testCaseClass, 'tearDown', testCaseClass._oeTearDown)
+
+ setattr(testCaseClass, '__oeqa_loader', True)
+
+ case = testCaseClass(tcName)
+ if isinstance(case, OETestCase):
+ setattr(case, 'decorators', [])
+
+ return case
+
+ def loadTestsFromTestCase(self, testCaseClass):
+ """
+ Returns a suite of all tests cases contained in testCaseClass.
+ """
+ if issubclass(testCaseClass, unittest.suite.TestSuite):
+ raise TypeError("Test cases should not be derived from TestSuite." \
+ " Maybe you meant to derive %s from TestCase?" \
+ % testCaseClass.__name__)
+ if not issubclass(testCaseClass, unittest.case.TestCase):
+ raise TypeError("Test %s is not derived from %s" % \
+ (testCaseClass.__name__, unittest.case.TestCase.__name__))
+
+ testCaseNames = self.getTestCaseNames(testCaseClass)
+ if not testCaseNames and hasattr(testCaseClass, 'runTest'):
+ testCaseNames = ['runTest']
+
+ suite = []
+ for tcName in testCaseNames:
+ case = self._getTestCase(testCaseClass, tcName)
+ # Filer by case id
+ if not (self.tests and not 'all' in self.tests
+ and not getCaseID(case) in self.tests):
+ self._handleTestCaseDecorators(case)
+
+ # Filter by decorators
+ if not self._filterTest(case):
+ self._registerTestCase(case)
+ suite.append(case)
+
+ return self.suiteClass(suite)
+
+ def _required_modules_validation(self):
+ """
+ Search in Test context registry if a required
+ test is found, raise an exception when not found.
+ """
+
+ for module in self.modules_required:
+ found = False
+
+ # The module name is splitted to only compare the
+ # first part of a test case id.
+ comp_len = len(module.split('.'))
+ for case in self.tc._registry['cases']:
+ case_comp = '.'.join(case.split('.')[0:comp_len])
+ if module == case_comp:
+ found = True
+ break
+
+ if not found:
+ raise OEQATestNotFound("Not found %s in loaded test cases" % \
+ module)
+
+ def discover(self):
+ big_suite = self.suiteClass()
+ for path in self.module_paths:
+ _find_duplicated_modules(big_suite, path)
+ suite = super(OETestLoader, self).discover(path,
+ pattern='*.py', top_level_dir=path)
+ big_suite.addTests(suite)
+
+ cases = None
+ discover_classes = [clss for clss in decoratorClasses
+ if issubclass(clss, OETestDiscover)]
+ for clss in discover_classes:
+ cases = clss.discover(self.tc._registry)
+
+ if self.modules_required:
+ self._required_modules_validation()
+
+ return self.suiteClass(cases) if cases else big_suite
+
+ def _filterModule(self, module):
+ if module.__name__ in sys.builtin_module_names:
+ msg = 'Tried to import %s test module but is a built-in'
+ raise ImportError(msg % module.__name__)
+
+ # XXX; If the module has more than one namespace only use
+ # the first to support run the whole module specifying the
+ # <module_name>.[test_class].[test_name]
+ module_name_small = module.__name__.split('.')[0]
+ module_name = module.__name__
+
+ # Normal test modules are loaded if no modules were specified,
+ # if module is in the specified module list or if 'all' is in
+ # module list.
+ # Underscore modules are loaded only if specified in module list.
+ load_module = True if not module_name.startswith('_') \
+ and (not self.modules \
+ or module_name in self.modules \
+ or module_name_small in self.modules \
+ or 'all' in self.modules) \
+ else False
+
+ load_underscore = True if module_name.startswith('_') \
+ and (module_name in self.modules or \
+ module_name_small in self.modules) \
+ else False
+
+ return (load_module, load_underscore)
+
+
+ # XXX After Python 3.5, remove backward compatibility hacks for
+ # use_load_tests deprecation via *args and **kws. See issue 16662.
+ if sys.version_info >= (3,5):
+ def loadTestsFromModule(self, module, *args, pattern=None, **kws):
+ """
+ Returns a suite of all tests cases contained in module.
+ """
+ load_module, load_underscore = self._filterModule(module)
+
+ if load_module or load_underscore:
+ return super(OETestLoader, self).loadTestsFromModule(
+ module, *args, pattern=pattern, **kws)
+ else:
+ return self.suiteClass()
+ else:
+ def loadTestsFromModule(self, module, use_load_tests=True):
+ """
+ Returns a suite of all tests cases contained in module.
+ """
+ load_module, load_underscore = self._filterModule(module)
+
+ if load_module or load_underscore:
+ return super(OETestLoader, self).loadTestsFromModule(
+ module, use_load_tests)
+ else:
+ return self.suiteClass()
diff --git a/poky/meta/lib/oeqa/core/runner.py b/poky/meta/lib/oeqa/core/runner.py
new file mode 100644
index 000000000..13cdf5ba5
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/runner.py
@@ -0,0 +1,277 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import time
+import unittest
+import logging
+import re
+
+xmlEnabled = False
+try:
+ import xmlrunner
+ from xmlrunner.result import _XMLTestResult as _TestResult
+ from xmlrunner.runner import XMLTestRunner as _TestRunner
+ xmlEnabled = True
+except ImportError:
+ # use the base runner instead
+ from unittest import TextTestResult as _TestResult
+ from unittest import TextTestRunner as _TestRunner
+
+class OEStreamLogger(object):
+ def __init__(self, logger):
+ self.logger = logger
+ self.buffer = ""
+
+ def write(self, msg):
+ if len(msg) > 1 and msg[0] != '\n':
+ if '...' in msg:
+ self.buffer += msg
+ elif self.buffer:
+ self.buffer += msg
+ self.logger.log(logging.INFO, self.buffer)
+ self.buffer = ""
+ else:
+ self.logger.log(logging.INFO, msg)
+
+ def flush(self):
+ for handler in self.logger.handlers:
+ handler.flush()
+
+class OETestResult(_TestResult):
+ def __init__(self, tc, *args, **kwargs):
+ super(OETestResult, self).__init__(*args, **kwargs)
+
+ self.tc = tc
+ self._tc_map_results()
+
+ def startTest(self, test):
+ # Allow us to trigger the testcase buffer mode on a per test basis
+ # so stdout/stderr are only printed upon failure. Enables debugging
+ # but clean output
+ if hasattr(test, "buffer"):
+ self.buffer = test.buffer
+ super(OETestResult, self).startTest(test)
+
+ def _tc_map_results(self):
+ self.tc._results['failures'] = self.failures
+ self.tc._results['errors'] = self.errors
+ self.tc._results['skipped'] = self.skipped
+ self.tc._results['expectedFailures'] = self.expectedFailures
+
+ def logSummary(self, component, context_msg=''):
+ elapsed_time = self.tc._run_end_time - self.tc._run_start_time
+ self.tc.logger.info("SUMMARY:")
+ self.tc.logger.info("%s (%s) - Ran %d test%s in %.3fs" % (component,
+ context_msg, self.testsRun, self.testsRun != 1 and "s" or "",
+ elapsed_time))
+
+ if self.wasSuccessful():
+ msg = "%s - OK - All required tests passed" % component
+ else:
+ msg = "%s - FAIL - Required tests failed" % component
+ skipped = len(self.tc._results['skipped'])
+ if skipped:
+ msg += " (skipped=%d)" % skipped
+ self.tc.logger.info(msg)
+
+ def _getDetailsNotPassed(self, case, type, desc):
+ found = False
+
+ for (scase, msg) in self.tc._results[type]:
+ # XXX: When XML reporting is enabled scase is
+ # xmlrunner.result._TestInfo instance instead of
+ # string.
+ if xmlEnabled:
+ if case.id() == scase.test_id:
+ found = True
+ break
+ scase_str = scase.test_id
+ else:
+ if case == scase:
+ found = True
+ break
+ scase_str = str(scase)
+
+ # When fails at module or class level the class name is passed as string
+ # so figure out to see if match
+ m = re.search("^setUpModule \((?P<module_name>.*)\)$", scase_str)
+ if m:
+ if case.__class__.__module__ == m.group('module_name'):
+ found = True
+ break
+
+ m = re.search("^setUpClass \((?P<class_name>.*)\)$", scase_str)
+ if m:
+ class_name = "%s.%s" % (case.__class__.__module__,
+ case.__class__.__name__)
+
+ if class_name == m.group('class_name'):
+ found = True
+ break
+
+ if found:
+ return (found, msg)
+
+ return (found, None)
+
+ def logDetails(self):
+ self.tc.logger.info("RESULTS:")
+ for case_name in self.tc._registry['cases']:
+ case = self.tc._registry['cases'][case_name]
+
+ result_types = ['failures', 'errors', 'skipped', 'expectedFailures']
+ result_desc = ['FAILED', 'ERROR', 'SKIPPED', 'EXPECTEDFAIL']
+
+ fail = False
+ desc = None
+ for idx, name in enumerate(result_types):
+ (fail, msg) = self._getDetailsNotPassed(case, result_types[idx],
+ result_desc[idx])
+ if fail:
+ desc = result_desc[idx]
+ break
+
+ oeid = -1
+ if hasattr(case, 'decorators'):
+ for d in case.decorators:
+ if hasattr(d, 'oeid'):
+ oeid = d.oeid
+
+ if fail:
+ self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(),
+ oeid, desc))
+ else:
+ self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(),
+ oeid, 'PASSED'))
+
+class OEListTestsResult(object):
+ def wasSuccessful(self):
+ return True
+
+class OETestRunner(_TestRunner):
+ streamLoggerClass = OEStreamLogger
+
+ def __init__(self, tc, *args, **kwargs):
+ if xmlEnabled:
+ if not kwargs.get('output'):
+ kwargs['output'] = os.path.join(os.getcwd(),
+ 'TestResults_%s_%s' % (time.strftime("%Y%m%d%H%M%S"), os.getpid()))
+
+ kwargs['stream'] = self.streamLoggerClass(tc.logger)
+ super(OETestRunner, self).__init__(*args, **kwargs)
+ self.tc = tc
+ self.resultclass = OETestResult
+
+ # XXX: The unittest-xml-reporting package defines _make_result method instead
+ # of _makeResult standard on unittest.
+ if xmlEnabled:
+ def _make_result(self):
+ """
+ Creates a TestResult object which will be used to store
+ information about the executed tests.
+ """
+ # override in subclasses if necessary.
+ return self.resultclass(self.tc,
+ self.stream, self.descriptions, self.verbosity, self.elapsed_times
+ )
+ else:
+ def _makeResult(self):
+ return self.resultclass(self.tc, self.stream, self.descriptions,
+ self.verbosity)
+
+
+ def _walk_suite(self, suite, func):
+ for obj in suite:
+ if isinstance(obj, unittest.suite.TestSuite):
+ if len(obj._tests):
+ self._walk_suite(obj, func)
+ elif isinstance(obj, unittest.case.TestCase):
+ func(self.tc.logger, obj)
+ self._walked_cases = self._walked_cases + 1
+
+ def _list_tests_name(self, suite):
+ from oeqa.core.decorator.oeid import OETestID
+ from oeqa.core.decorator.oetag import OETestTag
+
+ self._walked_cases = 0
+
+ def _list_cases_without_id(logger, case):
+
+ found_id = False
+ if hasattr(case, 'decorators'):
+ for d in case.decorators:
+ if isinstance(d, OETestID):
+ found_id = True
+
+ if not found_id:
+ logger.info('oeid missing for %s' % case.id())
+
+ def _list_cases(logger, case):
+ oeid = None
+ oetag = None
+
+ if hasattr(case, 'decorators'):
+ for d in case.decorators:
+ if isinstance(d, OETestID):
+ oeid = d.oeid
+ elif isinstance(d, OETestTag):
+ oetag = d.oetag
+
+ logger.info("%s\t%s\t\t%s" % (oeid, oetag, case.id()))
+
+ self.tc.logger.info("Listing test cases that don't have oeid ...")
+ self._walk_suite(suite, _list_cases_without_id)
+ self.tc.logger.info("-" * 80)
+
+ self.tc.logger.info("Listing all available tests:")
+ self._walked_cases = 0
+ self.tc.logger.info("id\ttag\t\ttest")
+ self.tc.logger.info("-" * 80)
+ self._walk_suite(suite, _list_cases)
+ self.tc.logger.info("-" * 80)
+ self.tc.logger.info("Total found:\t%s" % self._walked_cases)
+
+ def _list_tests_class(self, suite):
+ self._walked_cases = 0
+
+ curr = {}
+ def _list_classes(logger, case):
+ if not 'module' in curr or curr['module'] != case.__module__:
+ curr['module'] = case.__module__
+ logger.info(curr['module'])
+
+ if not 'class' in curr or curr['class'] != \
+ case.__class__.__name__:
+ curr['class'] = case.__class__.__name__
+ logger.info(" -- %s" % curr['class'])
+
+ logger.info(" -- -- %s" % case._testMethodName)
+
+ self.tc.logger.info("Listing all available test classes:")
+ self._walk_suite(suite, _list_classes)
+
+ def _list_tests_module(self, suite):
+ self._walked_cases = 0
+
+ listed = []
+ def _list_modules(logger, case):
+ if not case.__module__ in listed:
+ if case.__module__.startswith('_'):
+ logger.info("%s (hidden)" % case.__module__)
+ else:
+ logger.info(case.__module__)
+ listed.append(case.__module__)
+
+ self.tc.logger.info("Listing all available test modules:")
+ self._walk_suite(suite, _list_modules)
+
+ def list_tests(self, suite, display_type):
+ if display_type == 'name':
+ self._list_tests_name(suite)
+ elif display_type == 'class':
+ self._list_tests_class(suite)
+ elif display_type == 'module':
+ self._list_tests_module(suite)
+
+ return OEListTestsResult()
diff --git a/poky/meta/lib/oeqa/core/target/__init__.py b/poky/meta/lib/oeqa/core/target/__init__.py
new file mode 100644
index 000000000..d2468bc25
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/target/__init__.py
@@ -0,0 +1,33 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from abc import abstractmethod
+
+class OETarget(object):
+
+ def __init__(self, logger, *args, **kwargs):
+ self.logger = logger
+
+ @abstractmethod
+ def start(self):
+ pass
+
+ @abstractmethod
+ def stop(self):
+ pass
+
+ @abstractmethod
+ def run(self, cmd, timeout=None):
+ pass
+
+ @abstractmethod
+ def copyTo(self, localSrc, remoteDst):
+ pass
+
+ @abstractmethod
+ def copyFrom(self, remoteSrc, localDst):
+ pass
+
+ @abstractmethod
+ def copyDirTo(self, localSrc, remoteDst):
+ pass
diff --git a/poky/meta/lib/oeqa/core/target/qemu.py b/poky/meta/lib/oeqa/core/target/qemu.py
new file mode 100644
index 000000000..bf3b633f0
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/target/qemu.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import signal
+import time
+
+from .ssh import OESSHTarget
+from oeqa.utils.qemurunner import QemuRunner
+
+supported_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
+
+class OEQemuTarget(OESSHTarget):
+ def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+ port=None, machine='', rootfs='', kernel='', kvm=False,
+ dump_dir='', dump_host_cmds='', display='', bootlog='',
+ tmpdir='', dir_image='', boottime=60, **kwargs):
+
+ super(OEQemuTarget, self).__init__(logger, ip, server_ip, timeout,
+ user, port)
+
+ self.ip = ip
+ self.server_ip = server_ip
+ self.machine = machine
+ self.rootfs = rootfs
+ self.kernel = kernel
+ self.kvm = kvm
+
+ self.runner = QemuRunner(machine=machine, rootfs=rootfs, tmpdir=tmpdir,
+ deploy_dir_image=dir_image, display=display,
+ logfile=bootlog, boottime=boottime,
+ use_kvm=kvm, dump_dir=dump_dir,
+ dump_host_cmds=dump_host_cmds, logger=logger)
+
+ def start(self, params=None, extra_bootparams=None):
+ if self.runner.start(params, extra_bootparams=extra_bootparams):
+ self.ip = self.runner.ip
+ self.server_ip = self.runner.server_ip
+ else:
+ self.stop()
+ raise RuntimeError("FAILED to start qemu - check the task log and the boot log")
+
+ def stop(self):
+ self.runner.stop()
diff --git a/poky/meta/lib/oeqa/core/target/ssh.py b/poky/meta/lib/oeqa/core/target/ssh.py
new file mode 100644
index 000000000..151b99a77
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/target/ssh.py
@@ -0,0 +1,267 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import time
+import select
+import logging
+import subprocess
+import codecs
+
+from . import OETarget
+
+class OESSHTarget(OETarget):
+ def __init__(self, logger, ip, server_ip, timeout=300, user='root',
+ port=None, **kwargs):
+ if not logger:
+ logger = logging.getLogger('target')
+ logger.setLevel(logging.INFO)
+ filePath = os.path.join(os.getcwd(), 'remoteTarget.log')
+ fileHandler = logging.FileHandler(filePath, 'w', 'utf-8')
+ formatter = logging.Formatter(
+ '%(asctime)s.%(msecs)03d %(levelname)s: %(message)s',
+ '%H:%M:%S')
+ fileHandler.setFormatter(formatter)
+ logger.addHandler(fileHandler)
+
+ super(OESSHTarget, self).__init__(logger)
+ self.ip = ip
+ self.server_ip = server_ip
+ self.timeout = timeout
+ self.user = user
+ ssh_options = [
+ '-o', 'UserKnownHostsFile=/dev/null',
+ '-o', 'StrictHostKeyChecking=no',
+ '-o', 'LogLevel=ERROR'
+ ]
+ self.ssh = ['ssh', '-l', self.user ] + ssh_options
+ self.scp = ['scp'] + ssh_options
+ if port:
+ self.ssh = self.ssh + [ '-p', port ]
+ self.scp = self.scp + [ '-P', port ]
+
+ def start(self, **kwargs):
+ pass
+
+ def stop(self, **kwargs):
+ pass
+
+ def _run(self, command, timeout=None, ignore_status=True):
+ """
+ Runs command in target using SSHProcess.
+ """
+ self.logger.debug("[Running]$ %s" % " ".join(command))
+
+ starttime = time.time()
+ status, output = SSHCall(command, self.logger, timeout)
+ self.logger.debug("[Command returned '%d' after %.2f seconds]"
+ "" % (status, time.time() - starttime))
+
+ if status and not ignore_status:
+ raise AssertionError("Command '%s' returned non-zero exit "
+ "status %d:\n%s" % (command, status, output))
+
+ return (status, output)
+
+ def run(self, command, timeout=None):
+ """
+ Runs command in target.
+
+ command: Command to run on target.
+ timeout: <value>: Kill command after <val> seconds.
+ None: Kill command default value seconds.
+ 0: No timeout, runs until return.
+ """
+ targetCmd = 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; %s' % command
+ sshCmd = self.ssh + [self.ip, targetCmd]
+
+ if timeout:
+ processTimeout = timeout
+ elif timeout==0:
+ processTimeout = None
+ else:
+ processTimeout = self.timeout
+
+ status, output = self._run(sshCmd, processTimeout, True)
+ self.logger.debug('Command: %s\nOutput: %s\n' % (command, output))
+ return (status, output)
+
+ def copyTo(self, localSrc, remoteDst):
+ """
+ Copy file to target.
+
+ If local file is symlink, recreate symlink in target.
+ """
+ if os.path.islink(localSrc):
+ link = os.readlink(localSrc)
+ dstDir, dstBase = os.path.split(remoteDst)
+ sshCmd = 'cd %s; ln -s %s %s' % (dstDir, link, dstBase)
+ return self.run(sshCmd)
+
+ else:
+ remotePath = '%s@%s:%s' % (self.user, self.ip, remoteDst)
+ scpCmd = self.scp + [localSrc, remotePath]
+ return self._run(scpCmd, ignore_status=False)
+
+ def copyFrom(self, remoteSrc, localDst):
+ """
+ Copy file from target.
+ """
+ remotePath = '%s@%s:%s' % (self.user, self.ip, remoteSrc)
+ scpCmd = self.scp + [remotePath, localDst]
+ return self._run(scpCmd, ignore_status=False)
+
+ def copyDirTo(self, localSrc, remoteDst):
+ """
+ Copy recursively localSrc directory to remoteDst in target.
+ """
+
+ for root, dirs, files in os.walk(localSrc):
+ # Create directories in the target as needed
+ for d in dirs:
+ tmpDir = os.path.join(root, d).replace(localSrc, "")
+ newDir = os.path.join(remoteDst, tmpDir.lstrip("/"))
+ cmd = "mkdir -p %s" % newDir
+ self.run(cmd)
+
+ # Copy files into the target
+ for f in files:
+ tmpFile = os.path.join(root, f).replace(localSrc, "")
+ dstFile = os.path.join(remoteDst, tmpFile.lstrip("/"))
+ srcFile = os.path.join(root, f)
+ self.copyTo(srcFile, dstFile)
+
+ def deleteFiles(self, remotePath, files):
+ """
+ Deletes files in target's remotePath.
+ """
+
+ cmd = "rm"
+ if not isinstance(files, list):
+ files = [files]
+
+ for f in files:
+ cmd = "%s %s" % (cmd, os.path.join(remotePath, f))
+
+ self.run(cmd)
+
+
+ def deleteDir(self, remotePath):
+ """
+ Deletes target's remotePath directory.
+ """
+
+ cmd = "rmdir %s" % remotePath
+ self.run(cmd)
+
+
+ def deleteDirStructure(self, localPath, remotePath):
+ """
+ Delete recursively localPath structure directory in target's remotePath.
+
+ This function is very usefult to delete a package that is installed in
+ the DUT and the host running the test has such package extracted in tmp
+ directory.
+
+ Example:
+ pwd: /home/user/tmp
+ tree: .
+ └── work
+ ├── dir1
+ │   └── file1
+ └── dir2
+
+ localpath = "/home/user/tmp" and remotepath = "/home/user"
+
+ With the above variables this function will try to delete the
+ directory in the DUT in this order:
+ /home/user/work/dir1/file1
+ /home/user/work/dir1 (if dir is empty)
+ /home/user/work/dir2 (if dir is empty)
+ /home/user/work (if dir is empty)
+ """
+
+ for root, dirs, files in os.walk(localPath, topdown=False):
+ # Delete files first
+ tmpDir = os.path.join(root).replace(localPath, "")
+ remoteDir = os.path.join(remotePath, tmpDir.lstrip("/"))
+ self.deleteFiles(remoteDir, files)
+
+ # Remove dirs if empty
+ for d in dirs:
+ tmpDir = os.path.join(root, d).replace(localPath, "")
+ remoteDir = os.path.join(remotePath, tmpDir.lstrip("/"))
+ self.deleteDir(remoteDir)
+
+def SSHCall(command, logger, timeout=None, **opts):
+
+ def run():
+ nonlocal output
+ nonlocal process
+ starttime = time.time()
+ process = subprocess.Popen(command, **options)
+ if timeout:
+ endtime = starttime + timeout
+ eof = False
+ while time.time() < endtime and not eof:
+ logger.debug('time: %s, endtime: %s' % (time.time(), endtime))
+ try:
+ if select.select([process.stdout], [], [], 5)[0] != []:
+ reader = codecs.getreader('utf-8')(process.stdout)
+ data = reader.read(1024, 1024)
+ if not data:
+ process.stdout.close()
+ eof = True
+ else:
+ output += data
+ logger.debug('Partial data from SSH call: %s' % data)
+ endtime = time.time() + timeout
+ except InterruptedError:
+ continue
+
+ # process hasn't returned yet
+ if not eof:
+ process.terminate()
+ time.sleep(5)
+ try:
+ process.kill()
+ except OSError:
+ pass
+ endtime = time.time() - starttime
+ lastline = ("\nProcess killed - no output for %d seconds. Total"
+ " running time: %d seconds." % (timeout, endtime))
+ logger.debug('Received data from SSH call %s ' % lastline)
+ output += lastline
+
+ else:
+ output = process.communicate()[0].decode("utf-8", errors='replace')
+ logger.debug('Data from SSH call: %s' % output.rstrip())
+
+ options = {
+ "stdout": subprocess.PIPE,
+ "stderr": subprocess.STDOUT,
+ "stdin": None,
+ "shell": False,
+ "bufsize": -1,
+ "preexec_fn": os.setsid,
+ }
+ options.update(opts)
+ output = ''
+ process = None
+
+ # Unset DISPLAY which means we won't trigger SSH_ASKPASS
+ env = os.environ.copy()
+ if "DISPLAY" in env:
+ del env['DISPLAY']
+ options['env'] = env
+
+ try:
+ run()
+ except:
+ # Need to guard against a SystemExit or other exception ocurring
+ # whilst running and ensure we don't leave a process behind.
+ if process.poll() is None:
+ process.kill()
+ logger.debug('Something went wrong, killing SSH process')
+ raise
+ return (process.wait(), output.rstrip())
diff --git a/poky/meta/lib/oeqa/core/tests/__init__.py b/poky/meta/lib/oeqa/core/tests/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/__init__.py
diff --git a/poky/meta/lib/oeqa/core/tests/cases/data.py b/poky/meta/lib/oeqa/core/tests/cases/data.py
new file mode 100644
index 000000000..88003a6ad
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/data.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetag import OETestTag
+from oeqa.core.decorator.data import OETestDataDepends
+
+class DataTest(OETestCase):
+ data_vars = ['IMAGE', 'ARCH']
+
+ @OETestDataDepends(['MACHINE',])
+ @OETestTag('dataTestOk')
+ def testDataOk(self):
+ self.assertEqual(self.td.get('IMAGE'), 'core-image-minimal')
+ self.assertEqual(self.td.get('ARCH'), 'x86')
+ self.assertEqual(self.td.get('MACHINE'), 'qemuarm')
+
+ @OETestTag('dataTestFail')
+ def testDataFail(self):
+ pass
diff --git a/poky/meta/lib/oeqa/core/tests/cases/depends.py b/poky/meta/lib/oeqa/core/tests/cases/depends.py
new file mode 100644
index 000000000..17cdd90b1
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/depends.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class DependsTest(OETestCase):
+
+ def testDependsFirst(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsFirst'])
+ def testDependsSecond(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsSecond'])
+ def testDependsThird(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsSecond'])
+ def testDependsFourth(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsThird', 'testDependsFourth'])
+ def testDependsFifth(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsCircular3'])
+ def testDependsCircular1(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsCircular1'])
+ def testDependsCircular2(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestDepends(['testDependsCircular2'])
+ def testDependsCircular3(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py b/poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
new file mode 100644
index 000000000..038d44593
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/invalid/oeid.py
@@ -0,0 +1,15 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class AnotherIDTest(OETestCase):
+
+ def testAnotherIdGood(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ def testAnotherIdOther(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ def testAnotherIdNone(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py
new file mode 100644
index 000000000..0fe4cb3f1
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded.py
@@ -0,0 +1,12 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class ThreadedTest(OETestCase):
+ def test_threaded_no_depends(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+class ThreadedTest2(OETestCase):
+ def test_threaded_same_module(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py
new file mode 100644
index 000000000..905f39784
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_alone.py
@@ -0,0 +1,8 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class ThreadedTestAlone(OETestCase):
+ def test_threaded_alone(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py
new file mode 100644
index 000000000..0c158d3ba
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_depends.py
@@ -0,0 +1,10 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.depends import OETestDepends
+
+class ThreadedTest3(OETestCase):
+ @OETestDepends(['threaded.ThreadedTest.test_threaded_no_depends'])
+ def test_threaded_depends(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py
new file mode 100644
index 000000000..63d17e040
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/threaded/threaded_module.py
@@ -0,0 +1,12 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class ThreadedTestModule(OETestCase):
+ def test_threaded_module(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+class ThreadedTestModule2(OETestCase):
+ def test_threaded_module2(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py b/poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
new file mode 100644
index 000000000..c9ffd1777
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/loader/valid/another.py
@@ -0,0 +1,9 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class AnotherTest(OETestCase):
+
+ def testAnother(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/oeid.py b/poky/meta/lib/oeqa/core/tests/cases/oeid.py
new file mode 100644
index 000000000..c2d3d32f2
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/oeid.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class IDTest(OETestCase):
+
+ @OETestID(101)
+ def testIdGood(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestID(102)
+ def testIdOther(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ def testIdNone(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/oetag.py b/poky/meta/lib/oeqa/core/tests/cases/oetag.py
new file mode 100644
index 000000000..0cae02e75
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/oetag.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetag import OETestTag
+
+class TagTest(OETestCase):
+
+ @OETestTag('goodTag')
+ def testTagGood(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETestTag('otherTag')
+ def testTagOther(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ def testTagNone(self):
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/cases/timeout.py b/poky/meta/lib/oeqa/core/tests/cases/timeout.py
new file mode 100644
index 000000000..870c3157f
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/cases/timeout.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from time import sleep
+
+from oeqa.core.case import OETestCase
+from oeqa.core.decorator.oetimeout import OETimeout
+
+class TimeoutTest(OETestCase):
+
+ @OETimeout(1)
+ def testTimeoutPass(self):
+ self.assertTrue(True, msg='How is this possible?')
+
+ @OETimeout(1)
+ def testTimeoutFail(self):
+ sleep(2)
+ self.assertTrue(True, msg='How is this possible?')
diff --git a/poky/meta/lib/oeqa/core/tests/common.py b/poky/meta/lib/oeqa/core/tests/common.py
new file mode 100644
index 000000000..193232340
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/common.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import sys
+import os
+
+import unittest
+import logging
+import os
+
+logger = logging.getLogger("oeqa")
+logger.setLevel(logging.INFO)
+consoleHandler = logging.StreamHandler()
+formatter = logging.Formatter('OEQATest: %(message)s')
+consoleHandler.setFormatter(formatter)
+logger.addHandler(consoleHandler)
+
+def setup_sys_path():
+ directory = os.path.dirname(os.path.abspath(__file__))
+ oeqa_lib = os.path.realpath(os.path.join(directory, '../../../'))
+ if not oeqa_lib in sys.path:
+ sys.path.insert(0, oeqa_lib)
+
+class TestBase(unittest.TestCase):
+ def setUp(self):
+ self.logger = logger
+ directory = os.path.dirname(os.path.abspath(__file__))
+ self.cases_path = os.path.join(directory, 'cases')
+
+ def _testLoader(self, d={}, modules=[], tests=[], filters={}):
+ from oeqa.core.context import OETestContext
+ tc = OETestContext(d, self.logger)
+ tc.loadTests(self.cases_path, modules=modules, tests=tests,
+ filters=filters)
+ return tc
+
+ def _testLoaderThreaded(self, d={}, modules=[],
+ tests=[], filters={}):
+ from oeqa.core.threaded import OETestContextThreaded
+
+ tc = OETestContextThreaded(d, self.logger)
+ tc.loadTests(self.cases_path, modules=modules, tests=tests,
+ filters=filters)
+
+ return tc
diff --git a/poky/meta/lib/oeqa/core/tests/test_data.py b/poky/meta/lib/oeqa/core/tests/test_data.py
new file mode 100755
index 000000000..320468cbe
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/test_data.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+import logging
+import os
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQAMissingVariable
+from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames
+
+class TestData(TestBase):
+ modules = ['data']
+
+ def test_data_fail_missing_variable(self):
+ expectedException = "oeqa.core.exception.OEQAMissingVariable"
+
+ tc = self._testLoader(modules=self.modules)
+ self.assertEqual(False, tc.runTests().wasSuccessful())
+ for test, data in tc._results['errors']:
+ expect = False
+ if expectedException in data:
+ expect = True
+
+ self.assertTrue(expect)
+
+ def test_data_fail_wrong_variable(self):
+ expectedError = 'AssertionError'
+ d = {'IMAGE' : 'core-image-sato', 'ARCH' : 'arm'}
+
+ tc = self._testLoader(d=d, modules=self.modules)
+ self.assertEqual(False, tc.runTests().wasSuccessful())
+ for test, data in tc._results['failures']:
+ expect = False
+ if expectedError in data:
+ expect = True
+
+ self.assertTrue(expect)
+
+ def test_data_ok(self):
+ d = {'IMAGE' : 'core-image-minimal', 'ARCH' : 'x86', 'MACHINE' : 'qemuarm'}
+
+ tc = self._testLoader(d=d, modules=self.modules)
+ self.assertEqual(True, tc.runTests().wasSuccessful())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/poky/meta/lib/oeqa/core/tests/test_decorators.py b/poky/meta/lib/oeqa/core/tests/test_decorators.py
new file mode 100755
index 000000000..cf99e0d72
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/test_decorators.py
@@ -0,0 +1,147 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import signal
+import unittest
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQADependency
+from oeqa.core.utils.test import getCaseMethod, getSuiteCasesNames, getSuiteCasesIDs
+
+class TestFilterDecorator(TestBase):
+
+ def _runFilterTest(self, modules, filters, expect, msg):
+ tc = self._testLoader(modules=modules, filters=filters)
+ test_loaded = set(getSuiteCasesNames(tc.suites))
+ self.assertEqual(expect, test_loaded, msg=msg)
+
+ def test_oetag(self):
+ # Get all cases without filtering.
+ filter_all = {}
+ test_all = {'testTagGood', 'testTagOther', 'testTagNone'}
+ msg_all = 'Failed to get all oetag cases without filtering.'
+
+ # Get cases with 'goodTag'.
+ filter_good = {'oetag':'goodTag'}
+ test_good = {'testTagGood'}
+ msg_good = 'Failed to get just one test filtering with "goodTag" oetag.'
+
+ # Get cases with an invalid tag.
+ filter_invalid = {'oetag':'invalidTag'}
+ test_invalid = set()
+ msg_invalid = 'Failed to filter all test using an invalid oetag.'
+
+ tests = ((filter_all, test_all, msg_all),
+ (filter_good, test_good, msg_good),
+ (filter_invalid, test_invalid, msg_invalid))
+
+ for test in tests:
+ self._runFilterTest(['oetag'], test[0], test[1], test[2])
+
+ def test_oeid(self):
+ # Get all cases without filtering.
+ filter_all = {}
+ test_all = {'testIdGood', 'testIdOther', 'testIdNone'}
+ msg_all = 'Failed to get all oeid cases without filtering.'
+
+ # Get cases with '101' oeid.
+ filter_good = {'oeid': 101}
+ test_good = {'testIdGood'}
+ msg_good = 'Failed to get just one tes filtering with "101" oeid.'
+
+ # Get cases with an invalid id.
+ filter_invalid = {'oeid':999}
+ test_invalid = set()
+ msg_invalid = 'Failed to filter all test using an invalid oeid.'
+
+ tests = ((filter_all, test_all, msg_all),
+ (filter_good, test_good, msg_good),
+ (filter_invalid, test_invalid, msg_invalid))
+
+ for test in tests:
+ self._runFilterTest(['oeid'], test[0], test[1], test[2])
+
+class TestDependsDecorator(TestBase):
+ modules = ['depends']
+
+ def test_depends_order(self):
+ tests = ['depends.DependsTest.testDependsFirst',
+ 'depends.DependsTest.testDependsSecond',
+ 'depends.DependsTest.testDependsThird',
+ 'depends.DependsTest.testDependsFourth',
+ 'depends.DependsTest.testDependsFifth']
+ tests2 = list(tests)
+ tests2[2], tests2[3] = tests[3], tests[2]
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ test_loaded = getSuiteCasesIDs(tc.suites)
+ result = True if test_loaded == tests or test_loaded == tests2 else False
+ msg = 'Failed to order tests using OETestDepends decorator.\nTest order:'\
+ ' %s.\nExpected: %s\nOr: %s' % (test_loaded, tests, tests2)
+ self.assertTrue(result, msg=msg)
+
+ def test_depends_fail_missing_dependency(self):
+ expect = "TestCase depends.DependsTest.testDependsSecond depends on "\
+ "depends.DependsTest.testDependsFirst and isn't available"
+ tests = ['depends.DependsTest.testDependsSecond']
+ try:
+ # Must throw OEQADependency because missing 'testDependsFirst'
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ self.fail('Expected OEQADependency exception')
+ except OEQADependency as e:
+ result = True if expect in str(e) else False
+ msg = 'Expected OEQADependency exception missing testDependsFirst test'
+ self.assertTrue(result, msg=msg)
+
+ def test_depends_fail_circular_dependency(self):
+ expect = 'have a circular dependency'
+ tests = ['depends.DependsTest.testDependsCircular1',
+ 'depends.DependsTest.testDependsCircular2',
+ 'depends.DependsTest.testDependsCircular3']
+ try:
+ # Must throw OEQADependency because circular dependency
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ self.fail('Expected OEQADependency exception')
+ except OEQADependency as e:
+ result = True if expect in str(e) else False
+ msg = 'Expected OEQADependency exception having a circular dependency'
+ self.assertTrue(result, msg=msg)
+
+class TestTimeoutDecorator(TestBase):
+ modules = ['timeout']
+
+ def test_timeout(self):
+ tests = ['timeout.TimeoutTest.testTimeoutPass']
+ msg = 'Failed to run test using OETestTimeout'
+ alarm_signal = signal.getsignal(signal.SIGALRM)
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+ msg = "OETestTimeout didn't restore SIGALRM"
+ self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+
+ def test_timeout_fail(self):
+ tests = ['timeout.TimeoutTest.testTimeoutFail']
+ msg = "OETestTimeout test didn't timeout as expected"
+ alarm_signal = signal.getsignal(signal.SIGALRM)
+ tc = self._testLoader(modules=self.modules, tests=tests)
+ self.assertFalse(tc.runTests().wasSuccessful(), msg=msg)
+ msg = "OETestTimeout didn't restore SIGALRM"
+ self.assertIs(alarm_signal, signal.getsignal(signal.SIGALRM), msg=msg)
+
+ def test_timeout_thread(self):
+ tests = ['timeout.TimeoutTest.testTimeoutPass']
+ msg = 'Failed to run test using OETestTimeout'
+ tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
+ self.assertTrue(tc.runTests().wasSuccessful(), msg=msg)
+
+ def test_timeout_threaded_fail(self):
+ tests = ['timeout.TimeoutTest.testTimeoutFail']
+ msg = "OETestTimeout test didn't timeout as expected"
+ tc = self._testLoaderThreaded(modules=self.modules, tests=tests)
+ self.assertFalse(tc.runTests().wasSuccessful(), msg=msg)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/poky/meta/lib/oeqa/core/tests/test_loader.py b/poky/meta/lib/oeqa/core/tests/test_loader.py
new file mode 100755
index 000000000..e0d917d31
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/test_loader.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016-2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import unittest
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.exception import OEQADependency
+from oeqa.core.utils.test import getSuiteModules, getSuiteCasesIDs
+
+class TestLoader(TestBase):
+
+ def test_fail_empty_filter(self):
+ filters = {'oetag' : ''}
+ expect = 'Filter oetag specified is empty'
+ msg = 'Expected TypeError exception for having invalid filter'
+ try:
+ # Must throw TypeError because empty filter
+ tc = self._testLoader(filters=filters)
+ self.fail(msg)
+ except TypeError as e:
+ result = True if expect in str(e) else False
+ self.assertTrue(result, msg=msg)
+
+ def test_fail_invalid_filter(self):
+ filters = {'invalid' : 'good'}
+ expect = 'filter but not declared in any of'
+ msg = 'Expected TypeError exception for having invalid filter'
+ try:
+ # Must throw TypeError because invalid filter
+ tc = self._testLoader(filters=filters)
+ self.fail(msg)
+ except TypeError as e:
+ result = True if expect in str(e) else False
+ self.assertTrue(result, msg=msg)
+
+ def test_fail_duplicated_module(self):
+ cases_path = self.cases_path
+ invalid_path = os.path.join(cases_path, 'loader', 'invalid')
+ self.cases_path = [self.cases_path, invalid_path]
+ expect = 'Duplicated oeid module found in'
+ msg = 'Expected ImportError exception for having duplicated module'
+ try:
+ # Must throw ImportEror because duplicated module
+ tc = self._testLoader()
+ self.fail(msg)
+ except ImportError as e:
+ result = True if expect in str(e) else False
+ self.assertTrue(result, msg=msg)
+ finally:
+ self.cases_path = cases_path
+
+ def test_filter_modules(self):
+ expected_modules = {'oeid', 'oetag'}
+ tc = self._testLoader(modules=expected_modules)
+ modules = getSuiteModules(tc.suites)
+ msg = 'Expected just %s modules' % ', '.join(expected_modules)
+ self.assertEqual(modules, expected_modules, msg=msg)
+
+ def test_filter_cases(self):
+ modules = ['oeid', 'oetag', 'data']
+ expected_cases = {'data.DataTest.testDataOk',
+ 'oetag.TagTest.testTagGood',
+ 'oeid.IDTest.testIdGood'}
+ tc = self._testLoader(modules=modules, tests=expected_cases)
+ cases = set(getSuiteCasesIDs(tc.suites))
+ msg = 'Expected just %s cases' % ', '.join(expected_cases)
+ self.assertEqual(cases, expected_cases, msg=msg)
+
+ def test_import_from_paths(self):
+ cases_path = self.cases_path
+ cases2_path = os.path.join(cases_path, 'loader', 'valid')
+ expected_modules = {'oeid', 'another'}
+ self.cases_path = [self.cases_path, cases2_path]
+ tc = self._testLoader(modules=expected_modules)
+ modules = getSuiteModules(tc.suites)
+ self.cases_path = cases_path
+ msg = 'Expected modules from two different paths'
+ self.assertEqual(modules, expected_modules, msg=msg)
+
+ def test_loader_threaded(self):
+ cases_path = self.cases_path
+
+ self.cases_path = [os.path.join(self.cases_path, 'loader', 'threaded')]
+
+ tc = self._testLoaderThreaded()
+ self.assertEqual(len(tc.suites), 3, "Expected to be 3 suites")
+
+ case_ids = ['threaded.ThreadedTest.test_threaded_no_depends',
+ 'threaded.ThreadedTest2.test_threaded_same_module',
+ 'threaded_depends.ThreadedTest3.test_threaded_depends']
+ for case in tc.suites[0]._tests:
+ self.assertEqual(case.id(),
+ case_ids[tc.suites[0]._tests.index(case)])
+
+ case_ids = ['threaded_alone.ThreadedTestAlone.test_threaded_alone']
+ for case in tc.suites[1]._tests:
+ self.assertEqual(case.id(),
+ case_ids[tc.suites[1]._tests.index(case)])
+
+ case_ids = ['threaded_module.ThreadedTestModule.test_threaded_module',
+ 'threaded_module.ThreadedTestModule2.test_threaded_module2']
+ for case in tc.suites[2]._tests:
+ self.assertEqual(case.id(),
+ case_ids[tc.suites[2]._tests.index(case)])
+
+ self.cases_path = cases_path
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/poky/meta/lib/oeqa/core/tests/test_runner.py b/poky/meta/lib/oeqa/core/tests/test_runner.py
new file mode 100755
index 000000000..a3f3861fe
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/tests/test_runner.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+import logging
+import tempfile
+
+from common import setup_sys_path, TestBase
+setup_sys_path()
+
+from oeqa.core.runner import OEStreamLogger
+
+class TestRunner(TestBase):
+ def test_stream_logger(self):
+ fp = tempfile.TemporaryFile(mode='w+')
+
+ logging.basicConfig(format='%(message)s', stream=fp)
+ logger = logging.getLogger()
+ logger.setLevel(logging.INFO)
+
+ oeSL = OEStreamLogger(logger)
+
+ lines = ['init', 'bigline_' * 65535, 'morebigline_' * 65535 * 4, 'end']
+ for line in lines:
+ oeSL.write(line)
+
+ fp.seek(0)
+ fp_lines = fp.readlines()
+ for i, fp_line in enumerate(fp_lines):
+ fp_line = fp_line.strip()
+ self.assertEqual(lines[i], fp_line)
+
+ fp.close()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/poky/meta/lib/oeqa/core/threaded.py b/poky/meta/lib/oeqa/core/threaded.py
new file mode 100644
index 000000000..2cafe03a2
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/threaded.py
@@ -0,0 +1,275 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import threading
+import multiprocessing
+import queue
+import time
+
+from unittest.suite import TestSuite
+
+from oeqa.core.loader import OETestLoader
+from oeqa.core.runner import OEStreamLogger, OETestResult, OETestRunner
+from oeqa.core.context import OETestContext
+
+class OETestLoaderThreaded(OETestLoader):
+ def __init__(self, tc, module_paths, modules, tests, modules_required,
+ filters, process_num=0, *args, **kwargs):
+ super(OETestLoaderThreaded, self).__init__(tc, module_paths, modules,
+ tests, modules_required, filters, *args, **kwargs)
+
+ self.process_num = process_num
+
+ def discover(self):
+ suite = super(OETestLoaderThreaded, self).discover()
+
+ if self.process_num <= 0:
+ self.process_num = min(multiprocessing.cpu_count(),
+ len(suite._tests))
+
+ suites = []
+ for _ in range(self.process_num):
+ suites.append(self.suiteClass())
+
+ def _search_for_module_idx(suites, case):
+ """
+ Cases in the same module needs to be run
+ in the same thread because PyUnit keeps track
+ of setUp{Module, Class,} and tearDown{Module, Class,}.
+ """
+
+ for idx in range(self.process_num):
+ suite = suites[idx]
+ for c in suite._tests:
+ if case.__module__ == c.__module__:
+ return idx
+
+ return -1
+
+ def _search_for_depend_idx(suites, depends):
+ """
+ Dependency cases needs to be run in the same
+ thread, because OEQA framework look at the state
+ of dependant test to figure out if skip or not.
+ """
+
+ for idx in range(self.process_num):
+ suite = suites[idx]
+
+ for case in suite._tests:
+ if case.id() in depends:
+ return idx
+ return -1
+
+ def _get_best_idx(suites):
+ sizes = [len(suite._tests) for suite in suites]
+ return sizes.index(min(sizes))
+
+ def _fill_suites(suite):
+ idx = -1
+ for case in suite:
+ if isinstance(case, TestSuite):
+ _fill_suites(case)
+ else:
+ idx = _search_for_module_idx(suites, case)
+
+ depends = {}
+ if 'depends' in self.tc._registry:
+ depends = self.tc._registry['depends']
+
+ if idx == -1 and case.id() in depends:
+ case_depends = depends[case.id()]
+ idx = _search_for_depend_idx(suites, case_depends)
+
+ if idx == -1:
+ idx = _get_best_idx(suites)
+
+ suites[idx].addTest(case)
+ _fill_suites(suite)
+
+ suites_tmp = suites
+ suites = []
+ for suite in suites_tmp:
+ if len(suite._tests) > 0:
+ suites.append(suite)
+
+ return suites
+
+class OEStreamLoggerThreaded(OEStreamLogger):
+ _lock = threading.Lock()
+ buffers = {}
+
+ def write(self, msg):
+ tid = threading.get_ident()
+
+ if not tid in self.buffers:
+ self.buffers[tid] = ""
+
+ if msg:
+ self.buffers[tid] += msg
+
+ def finish(self):
+ tid = threading.get_ident()
+
+ self._lock.acquire()
+ self.logger.info('THREAD: %d' % tid)
+ self.logger.info('-' * 70)
+ for line in self.buffers[tid].split('\n'):
+ self.logger.info(line)
+ self._lock.release()
+
+class OETestResultThreadedInternal(OETestResult):
+ def _tc_map_results(self):
+ tid = threading.get_ident()
+
+ # PyUnit generates a result for every test module run, test
+ # if the thread already has an entry to avoid lose the previous
+ # test module results.
+ if not tid in self.tc._results:
+ self.tc._results[tid] = {}
+ self.tc._results[tid]['failures'] = self.failures
+ self.tc._results[tid]['errors'] = self.errors
+ self.tc._results[tid]['skipped'] = self.skipped
+ self.tc._results[tid]['expectedFailures'] = self.expectedFailures
+
+class OETestResultThreaded(object):
+ _results = {}
+ _lock = threading.Lock()
+
+ def __init__(self, tc):
+ self.tc = tc
+
+ def _fill_tc_results(self):
+ tids = list(self.tc._results.keys())
+ fields = ['failures', 'errors', 'skipped', 'expectedFailures']
+
+ for tid in tids:
+ result = self.tc._results[tid]
+ for field in fields:
+ if not field in self.tc._results:
+ self.tc._results[field] = []
+ self.tc._results[field].extend(result[field])
+
+ def addResult(self, result, run_start_time, run_end_time):
+ tid = threading.get_ident()
+
+ self._lock.acquire()
+ self._results[tid] = {}
+ self._results[tid]['result'] = result
+ self._results[tid]['run_start_time'] = run_start_time
+ self._results[tid]['run_end_time'] = run_end_time
+ self._results[tid]['result'] = result
+ self._lock.release()
+
+ def wasSuccessful(self):
+ wasSuccessful = True
+ for tid in self._results.keys():
+ wasSuccessful = wasSuccessful and \
+ self._results[tid]['result'].wasSuccessful()
+ return wasSuccessful
+
+ def stop(self):
+ for tid in self._results.keys():
+ self._results[tid]['result'].stop()
+
+ def logSummary(self, component, context_msg=''):
+ elapsed_time = (self.tc._run_end_time - self.tc._run_start_time)
+
+ self.tc.logger.info("SUMMARY:")
+ self.tc.logger.info("%s (%s) - Ran %d tests in %.3fs" % (component,
+ context_msg, len(self.tc._registry['cases']), elapsed_time))
+ if self.wasSuccessful():
+ msg = "%s - OK - All required tests passed" % component
+ else:
+ msg = "%s - FAIL - Required tests failed" % component
+ self.tc.logger.info(msg)
+
+ def logDetails(self):
+ if list(self._results):
+ tid = list(self._results)[0]
+ result = self._results[tid]['result']
+ result.logDetails()
+
+class _Worker(threading.Thread):
+ """Thread executing tasks from a given tasks queue"""
+ def __init__(self, tasks, result, stream):
+ threading.Thread.__init__(self)
+ self.tasks = tasks
+
+ self.result = result
+ self.stream = stream
+
+ def run(self):
+ while True:
+ try:
+ func, args, kargs = self.tasks.get(block=False)
+ except queue.Empty:
+ break
+
+ try:
+ run_start_time = time.time()
+ rc = func(*args, **kargs)
+ run_end_time = time.time()
+ self.result.addResult(rc, run_start_time, run_end_time)
+ self.stream.finish()
+ except Exception as e:
+ print(e)
+ finally:
+ self.tasks.task_done()
+
+class _ThreadedPool:
+ """Pool of threads consuming tasks from a queue"""
+ def __init__(self, num_workers, num_tasks, stream=None, result=None):
+ self.tasks = queue.Queue(num_tasks)
+ self.workers = []
+
+ for _ in range(num_workers):
+ worker = _Worker(self.tasks, result, stream)
+ self.workers.append(worker)
+
+ def start(self):
+ for worker in self.workers:
+ worker.start()
+
+ def add_task(self, func, *args, **kargs):
+ """Add a task to the queue"""
+ self.tasks.put((func, args, kargs))
+
+ def wait_completion(self):
+ """Wait for completion of all the tasks in the queue"""
+ self.tasks.join()
+ for worker in self.workers:
+ worker.join()
+
+class OETestRunnerThreaded(OETestRunner):
+ streamLoggerClass = OEStreamLoggerThreaded
+
+ def __init__(self, tc, *args, **kwargs):
+ super(OETestRunnerThreaded, self).__init__(tc, *args, **kwargs)
+ self.resultclass = OETestResultThreadedInternal # XXX: XML reporting overrides at __init__
+
+ def run(self, suites):
+ result = OETestResultThreaded(self.tc)
+
+ pool = _ThreadedPool(len(suites), len(suites), stream=self.stream,
+ result=result)
+ for s in suites:
+ pool.add_task(super(OETestRunnerThreaded, self).run, s)
+ pool.start()
+ pool.wait_completion()
+ result._fill_tc_results()
+
+ return result
+
+class OETestContextThreaded(OETestContext):
+ loaderClass = OETestLoaderThreaded
+ runnerClass = OETestRunnerThreaded
+
+ def loadTests(self, module_paths, modules=[], tests=[],
+ modules_manifest="", modules_required=[], filters={}, process_num=0):
+ if modules_manifest:
+ modules = self._read_modules_from_manifest(modules_manifest)
+
+ self.loader = self.loaderClass(self, module_paths, modules, tests,
+ modules_required, filters, process_num)
+ self.suites = self.loader.discover()
diff --git a/poky/meta/lib/oeqa/core/utils/__init__.py b/poky/meta/lib/oeqa/core/utils/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/utils/__init__.py
diff --git a/poky/meta/lib/oeqa/core/utils/misc.py b/poky/meta/lib/oeqa/core/utils/misc.py
new file mode 100644
index 000000000..0b223b5d0
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/utils/misc.py
@@ -0,0 +1,44 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+def toList(obj, obj_type, obj_name="Object"):
+ if isinstance(obj, obj_type):
+ return [obj]
+ elif isinstance(obj, list):
+ return obj
+ else:
+ raise TypeError("%s must be %s or list" % (obj_name, obj_type))
+
+def toSet(obj, obj_type, obj_name="Object"):
+ if isinstance(obj, obj_type):
+ return {obj}
+ elif isinstance(obj, list):
+ return set(obj)
+ elif isinstance(obj, set):
+ return obj
+ else:
+ raise TypeError("%s must be %s or set" % (obj_name, obj_type))
+
+def strToList(obj, obj_name="Object"):
+ return toList(obj, str, obj_name)
+
+def strToSet(obj, obj_name="Object"):
+ return toSet(obj, str, obj_name)
+
+def intToList(obj, obj_name="Object"):
+ return toList(obj, int, obj_name)
+
+def dataStoteToDict(d, variables):
+ data = {}
+
+ for v in variables:
+ data[v] = d.getVar(v)
+
+ return data
+
+def updateTestData(d, td, variables):
+ """
+ Updates variables with values of data store to test data.
+ """
+ for var in variables:
+ td[var] = d.getVar(var)
diff --git a/poky/meta/lib/oeqa/core/utils/path.py b/poky/meta/lib/oeqa/core/utils/path.py
new file mode 100644
index 000000000..a21caad5c
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/utils/path.py
@@ -0,0 +1,19 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+
+def findFile(file_name, directory):
+ """
+ Search for a file in directory and returns its complete path.
+ """
+ for r, d, f in os.walk(directory):
+ if file_name in f:
+ return os.path.join(r, file_name)
+ return None
+
+def remove_safe(path):
+ if os.path.exists(path):
+ os.remove(path)
+
diff --git a/poky/meta/lib/oeqa/core/utils/test.py b/poky/meta/lib/oeqa/core/utils/test.py
new file mode 100644
index 000000000..88d5d1398
--- /dev/null
+++ b/poky/meta/lib/oeqa/core/utils/test.py
@@ -0,0 +1,86 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import inspect
+import unittest
+
+def getSuiteCases(suite):
+ """
+ Returns individual test from a test suite.
+ """
+ tests = []
+
+ if isinstance(suite, unittest.TestCase):
+ tests.append(suite)
+ elif isinstance(suite, unittest.suite.TestSuite):
+ for item in suite:
+ tests.extend(getSuiteCases(item))
+
+ return tests
+
+def getSuiteModules(suite):
+ """
+ Returns modules in a test suite.
+ """
+ modules = set()
+ for test in getSuiteCases(suite):
+ modules.add(getCaseModule(test))
+ return modules
+
+def getSuiteCasesInfo(suite, func):
+ """
+ Returns test case info from suite. Info is fetched from func.
+ """
+ tests = []
+ for test in getSuiteCases(suite):
+ tests.append(func(test))
+ return tests
+
+def getSuiteCasesNames(suite):
+ """
+ Returns test case names from suite.
+ """
+ return getSuiteCasesInfo(suite, getCaseMethod)
+
+def getSuiteCasesIDs(suite):
+ """
+ Returns test case ids from suite.
+ """
+ return getSuiteCasesInfo(suite, getCaseID)
+
+def getSuiteCasesFiles(suite):
+ """
+ Returns test case files paths from suite.
+ """
+ return getSuiteCasesInfo(suite, getCaseFile)
+
+def getCaseModule(test_case):
+ """
+ Returns test case module name.
+ """
+ return test_case.__module__
+
+def getCaseClass(test_case):
+ """
+ Returns test case class name.
+ """
+ return test_case.__class__.__name__
+
+def getCaseID(test_case):
+ """
+ Returns test case complete id.
+ """
+ return test_case.id()
+
+def getCaseFile(test_case):
+ """
+ Returns test case file path.
+ """
+ return inspect.getsourcefile(test_case.__class__)
+
+def getCaseMethod(test_case):
+ """
+ Returns test case method name.
+ """
+ return getCaseID(test_case).split('.')[-1]
diff --git a/poky/meta/lib/oeqa/files/test.c b/poky/meta/lib/oeqa/files/test.c
new file mode 100644
index 000000000..2d8389c92
--- /dev/null
+++ b/poky/meta/lib/oeqa/files/test.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+double convert(long long l)
+{
+ return (double)l;
+}
+
+int main(int argc, char * argv[]) {
+
+ long long l = 10;
+ double f;
+ double check = 10.0;
+
+ f = convert(l);
+ printf("convert: %lld => %f\n", l, f);
+ if ( f != check ) exit(1);
+
+ f = 1234.67;
+ check = 1234.0;
+ printf("floorf(%f) = %f\n", f, floorf(f));
+ if ( floorf(f) != check) exit(1);
+
+ return 0;
+}
diff --git a/poky/meta/lib/oeqa/files/test.cpp b/poky/meta/lib/oeqa/files/test.cpp
new file mode 100644
index 000000000..9e1a76473
--- /dev/null
+++ b/poky/meta/lib/oeqa/files/test.cpp
@@ -0,0 +1,3 @@
+#include <limits>
+
+int main() {} \ No newline at end of file
diff --git a/poky/meta/lib/oeqa/files/test.pl b/poky/meta/lib/oeqa/files/test.pl
new file mode 100644
index 000000000..689c8f163
--- /dev/null
+++ b/poky/meta/lib/oeqa/files/test.pl
@@ -0,0 +1,2 @@
+$a = 9.01e+21 - 9.01e+21 + 0.01;
+print ("the value of a is ", $a, "\n");
diff --git a/poky/meta/lib/oeqa/files/test.py b/poky/meta/lib/oeqa/files/test.py
new file mode 100644
index 000000000..f389225d7
--- /dev/null
+++ b/poky/meta/lib/oeqa/files/test.py
@@ -0,0 +1,6 @@
+import os
+
+os.system('touch /tmp/testfile.python')
+
+a = 9.01e+21 - 9.01e+21 + 0.01
+print("the value of a is %s" % a)
diff --git a/poky/meta/lib/oeqa/oetest.py b/poky/meta/lib/oeqa/oetest.py
new file mode 100644
index 000000000..f7171260e
--- /dev/null
+++ b/poky/meta/lib/oeqa/oetest.py
@@ -0,0 +1,616 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Main unittest module used by testimage.bbclass
+# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
+
+# It also has some helper functions and it's responsible for actually starting the tests
+
+import os, re, mmap, sys
+import unittest
+import inspect
+import subprocess
+import signal
+import shutil
+import functools
+try:
+ import bb
+except ImportError:
+ pass
+import logging
+
+import oeqa.runtime
+# Exported test doesn't require sdkext
+try:
+ import oeqa.sdkext
+except ImportError:
+ pass
+from oeqa.utils.decorators import LogResults, gettag, getResults
+
+logger = logging.getLogger("BitBake")
+
+def getVar(obj):
+ #extend form dict, if a variable didn't exists, need find it in testcase
+ class VarDict(dict):
+ def __getitem__(self, key):
+ return gettag(obj, key)
+ return VarDict()
+
+def checkTags(tc, tagexp):
+ return eval(tagexp, None, getVar(tc))
+
+def filterByTagExp(testsuite, tagexp):
+ if not tagexp:
+ return testsuite
+ caseList = []
+ for each in testsuite:
+ if not isinstance(each, unittest.BaseTestSuite):
+ if checkTags(each, tagexp):
+ caseList.append(each)
+ else:
+ caseList.append(filterByTagExp(each, tagexp))
+ return testsuite.__class__(caseList)
+
+@LogResults
+class oeTest(unittest.TestCase):
+
+ pscmd = "ps"
+ longMessage = True
+
+ @classmethod
+ def hasPackage(self, pkg):
+ """
+ True if the full package name exists in the manifest, False otherwise.
+ """
+ return pkg in oeTest.tc.pkgmanifest
+
+ @classmethod
+ def hasPackageMatch(self, match):
+ """
+ True if match exists in the manifest as a regular expression substring,
+ False otherwise.
+ """
+ for s in oeTest.tc.pkgmanifest:
+ if re.match(match, s):
+ return True
+ return False
+
+ @classmethod
+ def hasFeature(self,feature):
+ if feature in oeTest.tc.imagefeatures or \
+ feature in oeTest.tc.distrofeatures:
+ return True
+ else:
+ return False
+
+class oeRuntimeTest(oeTest):
+ def __init__(self, methodName='runTest'):
+ self.target = oeRuntimeTest.tc.target
+ super(oeRuntimeTest, self).__init__(methodName)
+
+ def setUp(self):
+ # Install packages in the DUT
+ self.tc.install_uninstall_packages(self.id())
+
+ # Check if test needs to run
+ if self.tc.sigterm:
+ self.fail("Got SIGTERM")
+ elif (type(self.target).__name__ == "QemuTarget"):
+ self.assertTrue(self.target.check(), msg = "Qemu not running?")
+
+ self.setUpLocal()
+
+ # a setup method before tests but after the class instantiation
+ def setUpLocal(self):
+ pass
+
+ def tearDown(self):
+ # Uninstall packages in the DUT
+ self.tc.install_uninstall_packages(self.id(), False)
+
+ res = getResults()
+ # If a test fails or there is an exception dump
+ # for QemuTarget only
+ if (type(self.target).__name__ == "QemuTarget" and
+ (self.id() in res.getErrorList() or
+ self.id() in res.getFailList())):
+ self.tc.host_dumper.create_dir(self._testMethodName)
+ self.tc.host_dumper.dump_host()
+ self.target.target_dumper.dump_target(
+ self.tc.host_dumper.dump_dir)
+ print ("%s dump data stored in %s" % (self._testMethodName,
+ self.tc.host_dumper.dump_dir))
+
+ self.tearDownLocal()
+
+ # Method to be run after tearDown and implemented by child classes
+ def tearDownLocal(self):
+ pass
+
+def getmodule(pos=2):
+ # stack returns a list of tuples containg frame information
+ # First element of the list the is current frame, caller is 1
+ frameinfo = inspect.stack()[pos]
+ modname = inspect.getmodulename(frameinfo[1])
+ #modname = inspect.getmodule(frameinfo[0]).__name__
+ return modname
+
+def skipModule(reason, pos=2):
+ modname = getmodule(pos)
+ if modname not in oeTest.tc.testsrequired:
+ raise unittest.SkipTest("%s: %s" % (modname, reason))
+ else:
+ raise Exception("\nTest %s wants to be skipped.\nReason is: %s" \
+ "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" \
+ "\nor the image really doesn't have the required feature/package when it should." % (modname, reason))
+
+def skipModuleIf(cond, reason):
+
+ if cond:
+ skipModule(reason, 3)
+
+def skipModuleUnless(cond, reason):
+
+ if not cond:
+ skipModule(reason, 3)
+
+_buffer_logger = ""
+def custom_verbose(msg, *args, **kwargs):
+ global _buffer_logger
+ if msg[-1] != "\n":
+ _buffer_logger += msg
+ else:
+ _buffer_logger += msg
+ try:
+ bb.plain(_buffer_logger.rstrip("\n"), *args, **kwargs)
+ except NameError:
+ logger.info(_buffer_logger.rstrip("\n"), *args, **kwargs)
+ _buffer_logger = ""
+
+class TestContext(object):
+ def __init__(self, d, exported=False):
+ self.d = d
+
+ self.testsuites = self._get_test_suites()
+
+ if exported:
+ path = [os.path.dirname(os.path.abspath(__file__))]
+ extrapath = ""
+ else:
+ path = d.getVar("BBPATH").split(':')
+ extrapath = "lib/oeqa"
+
+ self.testslist = self._get_tests_list(path, extrapath)
+ self.testsrequired = self._get_test_suites_required()
+
+ self.filesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "runtime/files")
+ self.corefilesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+ self.imagefeatures = d.getVar("IMAGE_FEATURES").split()
+ self.distrofeatures = d.getVar("DISTRO_FEATURES").split()
+
+ # get testcase list from specified file
+ # if path is a relative path, then relative to build/conf/
+ def _read_testlist(self, fpath, builddir):
+ if not os.path.isabs(fpath):
+ fpath = os.path.join(builddir, "conf", fpath)
+ if not os.path.exists(fpath):
+ bb.fatal("No such manifest file: ", fpath)
+ tcs = []
+ for line in open(fpath).readlines():
+ line = line.strip()
+ if line and not line.startswith("#"):
+ tcs.append(line)
+ return " ".join(tcs)
+
+ # return test list by type also filter if TEST_SUITES is specified
+ def _get_tests_list(self, bbpath, extrapath):
+ testslist = []
+
+ type = self._get_test_namespace()
+
+ # This relies on lib/ under each directory in BBPATH being added to sys.path
+ # (as done by default in base.bbclass)
+ for testname in self.testsuites:
+ if testname != "auto":
+ if testname.startswith("oeqa."):
+ testslist.append(testname)
+ continue
+ found = False
+ for p in bbpath:
+ if os.path.exists(os.path.join(p, extrapath, type, testname + ".py")):
+ testslist.append("oeqa." + type + "." + testname)
+ found = True
+ break
+ elif os.path.exists(os.path.join(p, extrapath, type, testname.split(".")[0] + ".py")):
+ testslist.append("oeqa." + type + "." + testname)
+ found = True
+ break
+ if not found:
+ bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname)
+
+ if "auto" in self.testsuites:
+ def add_auto_list(path):
+ files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+ for f in files:
+ module = 'oeqa.' + type + '.' + f[:-3]
+ if module not in testslist:
+ testslist.append(module)
+
+ for p in bbpath:
+ testpath = os.path.join(p, 'lib', 'oeqa', type)
+ bb.debug(2, 'Searching for tests in %s' % testpath)
+ if os.path.exists(testpath):
+ add_auto_list(testpath)
+
+ return testslist
+
+ def getTestModules(self):
+ """
+ Returns all the test modules in the testlist.
+ """
+
+ import pkgutil
+
+ modules = []
+ for test in self.testslist:
+ if re.search("\w+\.\w+\.test_\S+", test):
+ test = '.'.join(t.split('.')[:3])
+ module = pkgutil.get_loader(test)
+ modules.append(module)
+
+ return modules
+
+ def getModulefromID(self, test_id):
+ """
+ Returns the test module based on a test id.
+ """
+
+ module_name = ".".join(test_id.split(".")[:3])
+ modules = self.getTestModules()
+ for module in modules:
+ if module.name == module_name:
+ return module
+
+ return None
+
+ def getTests(self, test):
+ '''Return all individual tests executed when running the suite.'''
+ # Unfortunately unittest does not have an API for this, so we have
+ # to rely on implementation details. This only needs to work
+ # for TestSuite containing TestCase.
+ method = getattr(test, '_testMethodName', None)
+ if method:
+ # leaf case: a TestCase
+ yield test
+ else:
+ # Look into TestSuite.
+ tests = getattr(test, '_tests', [])
+ for t1 in tests:
+ for t2 in self.getTests(t1):
+ yield t2
+
+ def loadTests(self):
+ setattr(oeTest, "tc", self)
+
+ testloader = unittest.TestLoader()
+ testloader.sortTestMethodsUsing = None
+ suites = [testloader.loadTestsFromName(name) for name in self.testslist]
+ suites = filterByTagExp(suites, getattr(self, "tagexp", None))
+
+ # Determine dependencies between suites by looking for @skipUnlessPassed
+ # method annotations. Suite A depends on suite B if any method in A
+ # depends on a method on B.
+ for suite in suites:
+ suite.dependencies = []
+ suite.depth = 0
+ for test in self.getTests(suite):
+ methodname = getattr(test, '_testMethodName', None)
+ if methodname:
+ method = getattr(test, methodname)
+ depends_on = getattr(method, '_depends_on', None)
+ if depends_on:
+ for dep_suite in suites:
+ if depends_on in [getattr(t, '_testMethodName', None) for t in self.getTests(dep_suite)]:
+ if dep_suite not in suite.dependencies and \
+ dep_suite is not suite:
+ suite.dependencies.append(dep_suite)
+ break
+ else:
+ logger.warning("Test %s was declared as @skipUnlessPassed('%s') but that test is either not defined or not active. Will run the test anyway." %
+ (test, depends_on))
+
+ # Use brute-force topological sort to determine ordering. Sort by
+ # depth (higher depth = must run later), with original ordering to
+ # break ties.
+ def set_suite_depth(suite):
+ for dep in suite.dependencies:
+ new_depth = set_suite_depth(dep) + 1
+ if new_depth > suite.depth:
+ suite.depth = new_depth
+ return suite.depth
+
+ for index, suite in enumerate(suites):
+ set_suite_depth(suite)
+ suite.index = index
+
+ def cmp(a, b):
+ return (a > b) - (a < b)
+
+ def cmpfunc(a, b):
+ return cmp((a.depth, a.index), (b.depth, b.index))
+
+ suites.sort(key=functools.cmp_to_key(cmpfunc))
+
+ self.suite = testloader.suiteClass(suites)
+
+ return self.suite
+
+ def runTests(self):
+ logger.info("Test modules %s" % self.testslist)
+ if hasattr(self, "tagexp") and self.tagexp:
+ logger.info("Filter test cases by tags: %s" % self.tagexp)
+ logger.info("Found %s tests" % self.suite.countTestCases())
+ runner = unittest.TextTestRunner(verbosity=2)
+ if 'bb' in sys.modules:
+ runner.stream.write = custom_verbose
+
+ return runner.run(self.suite)
+
+class RuntimeTestContext(TestContext):
+ def __init__(self, d, target, exported=False):
+ super(RuntimeTestContext, self).__init__(d, exported)
+
+ self.target = target
+
+ self.pkgmanifest = {}
+ manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"),
+ d.getVar("IMAGE_LINK_NAME") + ".manifest")
+ nomanifest = d.getVar("IMAGE_NO_MANIFEST")
+ if nomanifest is None or nomanifest != "1":
+ try:
+ with open(manifest) as f:
+ for line in f:
+ (pkg, arch, version) = line.strip().split()
+ self.pkgmanifest[pkg] = (version, arch)
+ except IOError as e:
+ bb.fatal("No package manifest file found. Did you build the image?\n%s" % e)
+
+ def _get_test_namespace(self):
+ return "runtime"
+
+ def _get_test_suites(self):
+ testsuites = []
+
+ manifests = (self.d.getVar("TEST_SUITES_MANIFEST") or '').split()
+ if manifests:
+ for manifest in manifests:
+ testsuites.extend(self._read_testlist(manifest,
+ self.d.getVar("TOPDIR")).split())
+
+ else:
+ testsuites = self.d.getVar("TEST_SUITES").split()
+
+ return testsuites
+
+ def _get_test_suites_required(self):
+ return [t for t in self.d.getVar("TEST_SUITES").split() if t != "auto"]
+
+ def loadTests(self):
+ super(RuntimeTestContext, self).loadTests()
+ if oeTest.hasPackage("procps"):
+ oeRuntimeTest.pscmd = "ps -ef"
+
+ def extract_packages(self):
+ """
+ Find packages that will be needed during runtime.
+ """
+
+ modules = self.getTestModules()
+ bbpaths = self.d.getVar("BBPATH").split(":")
+
+ shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR"))
+ shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR"))
+ for module in modules:
+ json_file = self._getJsonFile(module)
+ if json_file:
+ needed_packages = self._getNeededPackages(json_file)
+ self._perform_package_extraction(needed_packages)
+
+ def _perform_package_extraction(self, needed_packages):
+ """
+ Extract packages that will be needed during runtime.
+ """
+
+ import oe.path
+
+ extracted_path = self.d.getVar("TEST_EXTRACTED_DIR")
+ packaged_path = self.d.getVar("TEST_PACKAGED_DIR")
+
+ for key,value in needed_packages.items():
+ packages = ()
+ if isinstance(value, dict):
+ packages = (value, )
+ elif isinstance(value, list):
+ packages = value
+ else:
+ bb.fatal("Failed to process needed packages for %s; "
+ "Value must be a dict or list" % key)
+
+ for package in packages:
+ pkg = package["pkg"]
+ rm = package.get("rm", False)
+ extract = package.get("extract", True)
+ if extract:
+ dst_dir = os.path.join(extracted_path, pkg)
+ else:
+ dst_dir = os.path.join(packaged_path)
+
+ # Extract package and copy it to TEST_EXTRACTED_DIR
+ pkg_dir = self._extract_in_tmpdir(pkg)
+ if extract:
+
+ # Same package used for more than one test,
+ # don't need to extract again.
+ if os.path.exists(dst_dir):
+ continue
+ oe.path.copytree(pkg_dir, dst_dir)
+ shutil.rmtree(pkg_dir)
+
+ # Copy package to TEST_PACKAGED_DIR
+ else:
+ self._copy_package(pkg)
+
+ def _getJsonFile(self, module):
+ """
+ Returns the path of the JSON file for a module, empty if doesn't exitst.
+ """
+
+ module_file = module.path
+ json_file = "%s.json" % module_file.rsplit(".", 1)[0]
+ if os.path.isfile(module_file) and os.path.isfile(json_file):
+ return json_file
+ else:
+ return ""
+
+ def _getNeededPackages(self, json_file, test=None):
+ """
+ Returns a dict with needed packages based on a JSON file.
+
+
+ If a test is specified it will return the dict just for that test.
+ """
+
+ import json
+
+ needed_packages = {}
+
+ with open(json_file) as f:
+ test_packages = json.load(f)
+ for key,value in test_packages.items():
+ needed_packages[key] = value
+
+ if test:
+ if test in needed_packages:
+ needed_packages = needed_packages[test]
+ else:
+ needed_packages = {}
+
+ return needed_packages
+
+ def _extract_in_tmpdir(self, pkg):
+ """"
+ Returns path to a temp directory where the package was
+ extracted without dependencies.
+ """
+
+ from oeqa.utils.package_manager import get_package_manager
+
+ pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
+ pm = get_package_manager(self.d, pkg_path)
+ extract_dir = pm.extract(pkg)
+ shutil.rmtree(pkg_path)
+
+ return extract_dir
+
+ def _copy_package(self, pkg):
+ """
+ Copy the RPM, DEB or IPK package to dst_dir
+ """
+
+ from oeqa.utils.package_manager import get_package_manager
+
+ pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
+ dst_dir = self.d.getVar("TEST_PACKAGED_DIR")
+ pm = get_package_manager(self.d, pkg_path)
+ pkg_info = pm.package_info(pkg)
+ file_path = pkg_info[pkg]["filepath"]
+ shutil.copy2(file_path, dst_dir)
+ shutil.rmtree(pkg_path)
+
+ def install_uninstall_packages(self, test_id, pkg_dir, install):
+ """
+ Check if the test requires a package and Install/Uninstall it in the DUT
+ """
+
+ test = test_id.split(".")[4]
+ module = self.getModulefromID(test_id)
+ json = self._getJsonFile(module)
+ if json:
+ needed_packages = self._getNeededPackages(json, test)
+ if needed_packages:
+ self._install_uninstall_packages(needed_packages, pkg_dir, install)
+
+ def _install_uninstall_packages(self, needed_packages, pkg_dir, install=True):
+ """
+ Install/Uninstall packages in the DUT without using a package manager
+ """
+
+ if isinstance(needed_packages, dict):
+ packages = [needed_packages]
+ elif isinstance(needed_packages, list):
+ packages = needed_packages
+
+ for package in packages:
+ pkg = package["pkg"]
+ rm = package.get("rm", False)
+ extract = package.get("extract", True)
+ src_dir = os.path.join(pkg_dir, pkg)
+
+ # Install package
+ if install and extract:
+ self.target.connection.copy_dir_to(src_dir, "/")
+
+ # Uninstall package
+ elif not install and rm:
+ self.target.connection.delete_dir_structure(src_dir, "/")
+
+class ImageTestContext(RuntimeTestContext):
+ def __init__(self, d, target, host_dumper):
+ super(ImageTestContext, self).__init__(d, target)
+
+ self.tagexp = d.getVar("TEST_SUITES_TAGS")
+
+ self.host_dumper = host_dumper
+
+ self.sigterm = False
+ self.origsigtermhandler = signal.getsignal(signal.SIGTERM)
+ signal.signal(signal.SIGTERM, self._sigterm_exception)
+
+ def _sigterm_exception(self, signum, stackframe):
+ bb.warn("TestImage received SIGTERM, shutting down...")
+ self.sigterm = True
+ self.target.stop()
+
+ def install_uninstall_packages(self, test_id, install=True):
+ """
+ Check if the test requires a package and Install/Uninstall it in the DUT
+ """
+
+ pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR")
+ super(ImageTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
+
+class ExportTestContext(RuntimeTestContext):
+ def __init__(self, d, target, exported=False, parsedArgs={}):
+ """
+ This class is used when exporting tests and when are executed outside OE environment.
+
+ parsedArgs can contain the following:
+ - tag: Filter test by tag.
+ """
+ super(ExportTestContext, self).__init__(d, target, exported)
+
+ tag = parsedArgs.get("tag", None)
+ self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS")
+
+ self.sigterm = None
+
+ def install_uninstall_packages(self, test_id, install=True):
+ """
+ Check if the test requires a package and Install/Uninstall it in the DUT
+ """
+
+ export_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+ extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR")
+ pkg_dir = os.path.join(export_dir, extracted_dir)
+ super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
diff --git a/poky/meta/lib/oeqa/runexported.py b/poky/meta/lib/oeqa/runexported.py
new file mode 100755
index 000000000..9cfea0f7a
--- /dev/null
+++ b/poky/meta/lib/oeqa/runexported.py
@@ -0,0 +1,153 @@
+#!/usr/bin/env python3
+
+
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This script should be used outside of the build system to run image tests.
+# It needs a json file as input as exported by the build.
+# E.g for an already built image:
+#- export the tests:
+# TEST_EXPORT_ONLY = "1"
+# TEST_TARGET = "simpleremote"
+# TEST_TARGET_IP = "192.168.7.2"
+# TEST_SERVER_IP = "192.168.7.1"
+# bitbake core-image-sato -c testimage
+# Setup your target, e.g for qemu: runqemu core-image-sato
+# cd build/tmp/testimage/core-image-sato
+# ./runexported.py testdata.json
+
+import sys
+import os
+import time
+import argparse
+
+try:
+ import simplejson as json
+except ImportError:
+ import json
+
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa")))
+
+from oeqa.oetest import ExportTestContext
+from oeqa.utils.commands import runCmd, updateEnv
+from oeqa.utils.sshcontrol import SSHControl
+
+# this isn't pretty but we need a fake target object
+# for running the tests externally as we don't care
+# about deploy/start we only care about the connection methods (run, copy)
+class FakeTarget(object):
+ def __init__(self, d):
+ self.connection = None
+ self.ip = None
+ self.server_ip = None
+ self.datetime = time.strftime('%Y%m%d%H%M%S',time.gmtime())
+ self.testdir = d.getVar("TEST_LOG_DIR")
+ self.pn = d.getVar("PN")
+
+ def exportStart(self):
+ self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
+ sshloglink = os.path.join(self.testdir, "ssh_target_log")
+ if os.path.lexists(sshloglink):
+ os.remove(sshloglink)
+ os.symlink(self.sshlog, sshloglink)
+ print("SSH log file: %s" % self.sshlog)
+ self.connection = SSHControl(self.ip, logfile=self.sshlog)
+
+ def run(self, cmd, timeout=None):
+ return self.connection.run(cmd, timeout)
+
+ def copy_to(self, localpath, remotepath):
+ return self.connection.copy_to(localpath, remotepath)
+
+ def copy_from(self, remotepath, localpath):
+ return self.connection.copy_from(remotepath, localpath)
+
+
+class MyDataDict(dict):
+ def getVar(self, key, unused = None):
+ return self.get(key, "")
+
+def main():
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-t", "--target-ip", dest="ip", help="The IP address of the target machine. Use this to \
+ overwrite the value determined from TEST_TARGET_IP at build time")
+ parser.add_argument("-s", "--server-ip", dest="server_ip", help="The IP address of this machine. Use this to \
+ overwrite the value determined from TEST_SERVER_IP at build time.")
+ parser.add_argument("-d", "--deploy-dir", dest="deploy_dir", help="Full path to the package feeds, that this \
+ the contents of what used to be DEPLOY_DIR on the build machine. If not specified it will use the value \
+ specified in the json if that directory actually exists or it will error out.")
+ parser.add_argument("-l", "--log-dir", dest="log_dir", help="This sets the path for TEST_LOG_DIR. If not specified \
+ the current dir is used. This is used for usually creating a ssh log file and a scp test file.")
+ parser.add_argument("-a", "--tag", dest="tag", help="Only run test with specified tag.")
+ parser.add_argument("json", help="The json file exported by the build system", default="testdata.json", nargs='?')
+
+ args = parser.parse_args()
+
+ with open(args.json, "r") as f:
+ loaded = json.load(f)
+
+ if args.ip:
+ loaded["target"]["ip"] = args.ip
+ if args.server_ip:
+ loaded["target"]["server_ip"] = args.server_ip
+
+ d = MyDataDict()
+ for key in loaded["d"].keys():
+ d[key] = loaded["d"][key]
+
+ if args.log_dir:
+ d["TEST_LOG_DIR"] = args.log_dir
+ else:
+ d["TEST_LOG_DIR"] = os.path.abspath(os.path.dirname(__file__))
+ if args.deploy_dir:
+ d["DEPLOY_DIR"] = args.deploy_dir
+ else:
+ if not os.path.isdir(d["DEPLOY_DIR"]):
+ print("WARNING: The path to DEPLOY_DIR does not exist: %s" % d["DEPLOY_DIR"])
+
+ parsedArgs = {}
+ parsedArgs["tag"] = args.tag
+
+ extract_sdk(d)
+
+ target = FakeTarget(d)
+ for key in loaded["target"].keys():
+ setattr(target, key, loaded["target"][key])
+
+ target.exportStart()
+ tc = ExportTestContext(d, target, True, parsedArgs)
+ tc.loadTests()
+ tc.runTests()
+
+ return 0
+
+def extract_sdk(d):
+ """
+ Extract SDK if needed
+ """
+
+ export_dir = os.path.dirname(os.path.realpath(__file__))
+ tools_dir = d.getVar("TEST_EXPORT_SDK_DIR")
+ tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME")
+ tarball_path = os.path.join(export_dir, tools_dir, tarball_name)
+ extract_path = os.path.join(export_dir, "sysroot")
+ if os.path.isfile(tarball_path):
+ print ("Found SDK tarball %s. Extracting..." % tarball_path)
+ result = runCmd("%s -y -d %s" % (tarball_path, extract_path))
+ for f in os.listdir(extract_path):
+ if f.startswith("environment-setup"):
+ print("Setting up SDK environment...")
+ env_file = os.path.join(extract_path, f)
+ updateEnv(env_file)
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/meta/lib/oeqa/runtime/case.py b/poky/meta/lib/oeqa/runtime/case.py
new file mode 100644
index 000000000..2f190acf1
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/case.py
@@ -0,0 +1,17 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+from oeqa.utils.package_manager import install_package, uninstall_package
+
+class OERuntimeTestCase(OETestCase):
+ # target instance set by OERuntimeTestLoader.
+ target = None
+
+ def setUp(self):
+ super(OERuntimeTestCase, self).setUp()
+ install_package(self)
+
+ def tearDown(self):
+ super(OERuntimeTestCase, self).tearDown()
+ uninstall_package(self)
diff --git a/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py b/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
new file mode 100644
index 000000000..7b5b48141
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/_qemutiny.py
@@ -0,0 +1,8 @@
+from oeqa.runtime.case import OERuntimeTestCase
+
+class QemuTinyTest(OERuntimeTestCase):
+
+ def test_boot_tiny(self):
+ status, output = self.target.run_serial('uname -a')
+ msg = "Cannot detect poky tiny boot!"
+ self.assertTrue("yocto-tiny" in output, msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/apt.py b/poky/meta/lib/oeqa/runtime/cases/apt.py
new file mode 100644
index 000000000..8d4dd35c5
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/apt.py
@@ -0,0 +1,47 @@
+import os
+from oeqa.utils.httpserver import HTTPService
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class AptTest(OERuntimeTestCase):
+
+ def pkg(self, command, expected = 0):
+ command = 'apt-get %s' % command
+ status, output = self.target.run(command, 1500)
+ message = os.linesep.join([command, output])
+ self.assertEqual(status, expected, message)
+ return output
+
+class AptRepoTest(AptTest):
+
+ @classmethod
+ def setUpClass(cls):
+ service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_DEB'], 'all')
+ cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip)
+ cls.repo_server.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.repo_server.stop()
+
+ def setup_source_config_for_package_install(self):
+ apt_get_source_server = 'http://%s:%s/' % (self.tc.target.server_ip, self.repo_server.port)
+ apt_get_sourceslist_dir = '/etc/apt/'
+ self.target.run('cd %s; echo deb %s ./ > sources.list' % (apt_get_sourceslist_dir, apt_get_source_server))
+
+ def cleanup_source_config_for_package_install(self):
+ apt_get_sourceslist_dir = '/etc/apt/'
+ self.target.run('cd %s; rm sources.list' % (apt_get_sourceslist_dir))
+
+ @skipIfNotFeature('package-management',
+ 'Test requires package-management to be in IMAGE_FEATURES')
+ @skipIfNotDataVar('IMAGE_PKGTYPE', 'deb',
+ 'DEB is not the primary package manager')
+ @OEHasPackage(['apt'])
+ def test_apt_install_from_repo(self):
+ self.setup_source_config_for_package_install()
+ self.pkg('update')
+ self.pkg('remove --yes run-postinsts-dev')
+ self.pkg('install --yes --allow-unauthenticated run-postinsts-dev')
+ self.cleanup_source_config_for_package_install()
diff --git a/poky/meta/lib/oeqa/runtime/cases/buildcpio.py b/poky/meta/lib/oeqa/runtime/cases/buildcpio.py
new file mode 100644
index 000000000..79b22d04d
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/buildcpio.py
@@ -0,0 +1,29 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class BuildCpioTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ uri = 'https://downloads.yoctoproject.org/mirror/sources/cpio-2.12.tar.gz'
+ cls.project = TargetBuildProject(cls.tc.target,
+ uri,
+ dl_dir = cls.tc.td['DL_DIR'])
+ cls.project.download_archive()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.project.clean()
+
+ @OETestID(205)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_cpio(self):
+ self.project.run_configure()
+ self.project.run_make()
+ self.project.run_install()
diff --git a/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py b/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py
new file mode 100644
index 000000000..7c9d4a392
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py
@@ -0,0 +1,28 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class GalculatorTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ uri = 'http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2'
+ cls.project = TargetBuildProject(cls.tc.target,
+ uri,
+ dl_dir = cls.tc.td['DL_DIR'])
+ cls.project.download_archive()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.project.clean()
+
+ @OETestID(1526)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_galculator(self):
+ self.project.run_configure()
+ self.project.run_make()
diff --git a/poky/meta/lib/oeqa/runtime/cases/buildlzip.py b/poky/meta/lib/oeqa/runtime/cases/buildlzip.py
new file mode 100644
index 000000000..ca3fead2e
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/buildlzip.py
@@ -0,0 +1,34 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
+
+class BuildLzipTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ uri = 'http://downloads.yoctoproject.org/mirror/sources'
+ uri = '%s/lzip-1.19.tar.gz' % uri
+ cls.project = TargetBuildProject(cls.tc.target,
+ uri,
+ dl_dir = cls.tc.td['DL_DIR'])
+ cls.project.download_archive()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.project.clean()
+
+ @OETestID(206)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_lzip(self):
+ self.project.run_configure()
+ self.project.run_make()
+ self.project.run_install()
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/poky/meta/lib/oeqa/runtime/cases/connman.py b/poky/meta/lib/oeqa/runtime/cases/connman.py
new file mode 100644
index 000000000..12456b417
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/connman.py
@@ -0,0 +1,30 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class ConnmanTest(OERuntimeTestCase):
+
+ def service_status(self, service):
+ if 'systemd' in self.tc.td['DISTRO_FEATURES']:
+ (_, output) = self.target.run('systemctl status -l %s' % service)
+ return output
+ else:
+ return "Unable to get status or logs for %s" % service
+
+ @OETestID(961)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(["connman"])
+ def test_connmand_help(self):
+ (status, output) = self.target.run('/usr/sbin/connmand --help')
+ msg = 'Failed to get connman help. Output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(221)
+ @OETestDepends(['connman.ConnmanTest.test_connmand_help'])
+ def test_connmand_running(self):
+ cmd = '%s | grep [c]onnmand' % self.tc.target_cmds['ps']
+ (status, output) = self.target.run(cmd)
+ if status != 0:
+ self.logger.info(self.service_status("connman"))
+ self.fail("No connmand process running")
diff --git a/poky/meta/lib/oeqa/runtime/cases/date.py b/poky/meta/lib/oeqa/runtime/cases/date.py
new file mode 100644
index 000000000..ece7338de
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/date.py
@@ -0,0 +1,38 @@
+import re
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class DateTest(OERuntimeTestCase):
+
+ def setUp(self):
+ if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
+ self.logger.debug('Stopping systemd-timesyncd daemon')
+ self.target.run('systemctl stop systemd-timesyncd')
+
+ def tearDown(self):
+ if self.tc.td.get('VIRTUAL-RUNTIME_init_manager') == 'systemd':
+ self.logger.debug('Starting systemd-timesyncd daemon')
+ self.target.run('systemctl start systemd-timesyncd')
+
+ @OETestID(211)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_date(self):
+ (status, output) = self.target.run('date +"%Y-%m-%d %T"')
+ msg = 'Failed to get initial date, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+ oldDate = output
+
+ sampleDate = '"2016-08-09 10:00:00"'
+ (status, output) = self.target.run("date -s %s" % sampleDate)
+ self.assertEqual(status, 0, msg='Date set failed, output: %s' % output)
+
+ (status, output) = self.target.run("date -R")
+ p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output)
+ msg = 'The date was not set correctly, output: %s' % output
+ self.assertTrue(p, msg=msg)
+
+ (status, output) = self.target.run('date -s "%s"' % oldDate)
+ msg = 'Failed to reset date, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/df.py b/poky/meta/lib/oeqa/runtime/cases/df.py
new file mode 100644
index 000000000..aecc32d7c
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/df.py
@@ -0,0 +1,13 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class DfTest(OERuntimeTestCase):
+
+ @OETestID(234)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_df(self):
+ cmd = "df / | sed -n '2p' | awk '{print $4}'"
+ (status,output) = self.target.run(cmd)
+ msg = 'Not enough space on image. Current size is %s' % output
+ self.assertTrue(int(output)>5120, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/dnf.py b/poky/meta/lib/oeqa/runtime/cases/dnf.py
new file mode 100644
index 000000000..2f87296b4
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/dnf.py
@@ -0,0 +1,123 @@
+import os
+import re
+import subprocess
+from oeqa.utils.httpserver import HTTPService
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class DnfTest(OERuntimeTestCase):
+
+ def dnf(self, command, expected = 0):
+ command = 'dnf %s' % command
+ status, output = self.target.run(command, 1500)
+ message = os.linesep.join([command, output])
+ self.assertEqual(status, expected, message)
+ return output
+
+class DnfBasicTest(DnfTest):
+
+ @skipIfNotFeature('package-management',
+ 'Test requires package-management to be in IMAGE_FEATURES')
+ @skipIfNotDataVar('IMAGE_PKGTYPE', 'rpm',
+ 'RPM is not the primary package manager')
+ @OEHasPackage(['dnf'])
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OETestID(1735)
+ def test_dnf_help(self):
+ self.dnf('--help')
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ @OETestID(1739)
+ def test_dnf_version(self):
+ self.dnf('--version')
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ @OETestID(1737)
+ def test_dnf_info(self):
+ self.dnf('info dnf')
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ @OETestID(1738)
+ def test_dnf_search(self):
+ self.dnf('search dnf')
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ @OETestID(1736)
+ def test_dnf_history(self):
+ self.dnf('history')
+
+class DnfRepoTest(DnfTest):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'oe-testimage-repo'),
+ cls.tc.target.server_ip)
+ cls.repo_server.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.repo_server.stop()
+
+ def dnf_with_repo(self, command):
+ pkgarchs = os.listdir(os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo'))
+ deploy_url = 'http://%s:%s/' %(self.target.server_ip, self.repo_server.port)
+ cmdlinerepoopts = ["--repofrompath=oe-testimage-repo-%s,%s%s" %(arch, deploy_url, arch) for arch in pkgarchs]
+
+ self.dnf(" ".join(cmdlinerepoopts) + " --nogpgcheck " + command)
+
+ @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+ @OETestID(1744)
+ def test_dnf_makecache(self):
+ self.dnf_with_repo('makecache')
+
+
+# Does not work when repo is specified on the command line
+# @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+# def test_dnf_repolist(self):
+# self.dnf_with_repo('repolist')
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+ @OETestID(1746)
+ def test_dnf_repoinfo(self):
+ self.dnf_with_repo('repoinfo')
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+ @OETestID(1740)
+ def test_dnf_install(self):
+ self.dnf_with_repo('install -y run-postinsts-dev')
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+ @OETestID(1741)
+ def test_dnf_install_dependency(self):
+ self.dnf_with_repo('remove -y run-postinsts')
+ self.dnf_with_repo('install -y run-postinsts-dev')
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency'])
+ @OETestID(1742)
+ def test_dnf_install_from_disk(self):
+ self.dnf_with_repo('remove -y run-postinsts-dev')
+ self.dnf_with_repo('install -y --downloadonly run-postinsts-dev')
+ status, output = self.target.run('find /var/cache/dnf -name run-postinsts-dev*rpm', 1500)
+ self.assertEqual(status, 0, output)
+ self.dnf_with_repo('install -y %s' % output)
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk'])
+ @OETestID(1743)
+ def test_dnf_install_from_http(self):
+ output = subprocess.check_output('%s %s -name run-postinsts-dev*' % (bb.utils.which(os.getenv('PATH'), "find"),
+ os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), shell=True).decode("utf-8")
+ rpm_path = output.split("/")[-2] + "/" + output.split("/")[-1]
+ url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, rpm_path)
+ self.dnf_with_repo('remove -y run-postinsts-dev')
+ self.dnf_with_repo('install -y %s' % url)
+
+ @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+ @OETestID(1745)
+ def test_dnf_reinstall(self):
+ self.dnf_with_repo('reinstall -y run-postinsts-dev')
+
+
diff --git a/poky/meta/lib/oeqa/runtime/cases/gcc.py b/poky/meta/lib/oeqa/runtime/cases/gcc.py
new file mode 100644
index 000000000..911083156
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/gcc.py
@@ -0,0 +1,73 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class GccCompileTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ dst = '/tmp/'
+ src = os.path.join(cls.tc.files_dir, 'test.c')
+ cls.tc.target.copyTo(src, dst)
+
+ src = os.path.join(cls.tc.runtime_files_dir, 'testmakefile')
+ cls.tc.target.copyTo(src, dst)
+
+ src = os.path.join(cls.tc.files_dir, 'test.cpp')
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile'
+ cls.tc.target.run('rm %s' % files)
+
+ @OETestID(203)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_gcc_compile(self):
+ status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
+ msg = 'gcc compile failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/test')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(200)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_gpp_compile(self):
+ status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
+ msg = 'g++ compile failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/test')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(1142)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_gpp2_compile(self):
+ status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
+ msg = 'g++ compile failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('/tmp/test')
+ msg = 'running compiled file failed, output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(204)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_make(self):
+ status, output = self.target.run('cd /tmp; make -f testmakefile')
+ msg = 'running make failed, output %s' % output
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/gi.py b/poky/meta/lib/oeqa/runtime/cases/gi.py
new file mode 100644
index 000000000..19073e52c
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/gi.py
@@ -0,0 +1,15 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class GObjectIntrospectionTest(OERuntimeTestCase):
+
+ @OETestDepends(["ssh.SSHTest.test_ssh"])
+ @OEHasPackage(["python3-pygobject"])
+ def test_python(self):
+ script = """from gi.repository import GObject; print(GObject.markup_escape_text("<testing&testing>"))"""
+ status, output = self.target.run("python3 -c '%s'" % script)
+ self.assertEqual(status, 0, msg="Python failed (%s)" % (output))
+ self.assertEqual(output, "&lt;testing&amp;testing&gt;", msg="Unexpected output (%s)" % output)
diff --git a/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py b/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py
new file mode 100644
index 000000000..de1a5aa44
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py
@@ -0,0 +1,40 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class KernelModuleTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c')
+ dst = '/tmp/hellomod.c'
+ cls.tc.target.copyTo(src, dst)
+
+ src = os.path.join(cls.tc.runtime_files_dir, 'hellomod_makefile')
+ dst = '/tmp/Makefile'
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ files = '/tmp/Makefile /tmp/hellomod.c'
+ cls.tc.target.run('rm %s' % files)
+
+ @OETestID(1541)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['gcc.GccCompileTest.test_gcc_compile'])
+ def test_kernel_module(self):
+ cmds = [
+ 'cd /usr/src/kernel && make scripts prepare',
+ 'cd /tmp && make',
+ 'cd /tmp && insmod hellomod.ko',
+ 'lsmod | grep hellomod',
+ 'dmesg | grep Hello',
+ 'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"'
+ ]
+ for cmd in cmds:
+ status, output = self.target.run(cmd, 900)
+ self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
diff --git a/poky/meta/lib/oeqa/runtime/cases/ldd.py b/poky/meta/lib/oeqa/runtime/cases/ldd.py
new file mode 100644
index 000000000..c6d92fd5a
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/ldd.py
@@ -0,0 +1,25 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class LddTest(OERuntimeTestCase):
+
+ @OETestID(962)
+ @skipIfNotFeature('tools-sdk',
+ 'Test requires tools-sdk to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_ldd_exists(self):
+ status, output = self.target.run('which ldd')
+ msg = 'ldd does not exist in PATH: which ldd: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(239)
+ @OETestDepends(['ldd.LddTest.test_ldd_exists'])
+ def test_ldd_rtldlist_check(self):
+ cmd = ('for i in $(which ldd | xargs cat | grep "^RTLDLIST"| '
+ 'cut -d\'=\' -f2|tr -d \'"\'); '
+ 'do test -f $i && echo $i && break; done')
+ status, output = self.target.run(cmd)
+ msg = "ldd path not correct or RTLDLIST files don't exist."
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/logrotate.py b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
new file mode 100644
index 000000000..992fef298
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -0,0 +1,42 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=289 testcase
+# Note that the image under test must have logrotate installed
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class LogrotateTest(OERuntimeTestCase):
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.tc.target.run('rm -rf $HOME/logrotate_dir')
+
+ @OETestID(1544)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['logrotate'])
+ def test_1_logrotate_setup(self):
+ status, output = self.target.run('mkdir $HOME/logrotate_dir')
+ msg = 'Could not create logrotate_dir. Output: %s' % output
+ self.assertEqual(status, 0, msg = msg)
+
+ cmd = ('sed -i "s#wtmp {#wtmp {\\n olddir $HOME/logrotate_dir#"'
+ ' /etc/logrotate.conf')
+ status, output = self.target.run(cmd)
+ msg = ('Could not write to logrotate.conf file. Status and output: '
+ ' %s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
+
+ @OETestID(1542)
+ @OETestDepends(['logrotate.LogrotateTest.test_1_logrotate_setup'])
+ def test_2_logrotate(self):
+ status, output = self.target.run('logrotate -f /etc/logrotate.conf')
+ msg = ('logrotate service could not be reloaded. Status and output: '
+ '%s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
+
+ _, output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')
+ msg = ('new logfile could not be created. List of files within log '
+ 'directory: %s' % (
+ self.target.run('ls -la $HOME/logrotate_dir')[1]))
+ self.assertTrue(int(output)>=3, msg = msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/multilib.py b/poky/meta/lib/oeqa/runtime/cases/multilib.py
new file mode 100644
index 000000000..8c167f100
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/multilib.py
@@ -0,0 +1,41 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotInDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class MultilibTest(OERuntimeTestCase):
+
+ def archtest(self, binary, arch):
+ """
+ Check that ``binary`` has the ELF class ``arch`` (e.g. ELF32/ELF64).
+ """
+
+ status, output = self.target.run('readelf -h %s' % binary)
+ self.assertEqual(status, 0, 'Failed to readelf %s' % binary)
+
+ l = [l.split()[1] for l in output.split('\n') if "Class:" in l]
+ if l:
+ theclass = l[0]
+ else:
+ self.fail('Cannot parse readelf. Output:\n%s' % output)
+
+ msg = "%s isn't %s (is %s)" % (binary, arch, theclass)
+ self.assertEqual(theclass, arch, msg=msg)
+
+ @OETestID(1593)
+ @skipIfNotInDataVar('MULTILIBS', 'multilib:lib32',
+ "This isn't a multilib:lib32 image")
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_check_multilib_libc(self):
+ """
+ Check that a multilib image has both 32-bit and 64-bit libc in.
+ """
+ self.archtest("/lib/libc.so.6", "ELF32")
+ self.archtest("/lib64/libc.so.6", "ELF64")
+
+ @OETestID(279)
+ @OETestDepends(['multilib.MultilibTest.test_check_multilib_libc'])
+ @OEHasPackage(['lib32-connman'])
+ def test_file_connman(self):
+ self.archtest("/usr/sbin/connmand", "ELF32")
diff --git a/poky/meta/lib/oeqa/runtime/cases/oe_syslog.py b/poky/meta/lib/oeqa/runtime/cases/oe_syslog.py
new file mode 100644
index 000000000..005b6978d
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/oe_syslog.py
@@ -0,0 +1,66 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class SyslogTest(OERuntimeTestCase):
+
+ @OETestID(201)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(["busybox-syslog", "sysklogd"])
+ def test_syslog_running(self):
+ cmd = '%s | grep -i [s]yslogd' % self.tc.target_cmds['ps']
+ status, output = self.target.run(cmd)
+ msg = "No syslogd process; ps output: %s" % output
+ self.assertEqual(status, 0, msg=msg)
+
+class SyslogTestConfig(OERuntimeTestCase):
+
+ @OETestID(1149)
+ @OETestDepends(['oe_syslog.SyslogTest.test_syslog_running'])
+ def test_syslog_logger(self):
+ status, output = self.target.run('logger foobar')
+ msg = "Can't log into syslog. Output: %s " % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('grep foobar /var/log/messages')
+ if status != 0:
+ if self.tc.td.get("VIRTUAL-RUNTIME_init_manager") == "systemd":
+ status, output = self.target.run('journalctl -o cat | grep foobar')
+ else:
+ status, output = self.target.run('logread | grep foobar')
+ msg = ('Test log string not found in /var/log/messages or logread.'
+ ' Output: %s ' % output)
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(1150)
+ @OETestDepends(['oe_syslog.SyslogTest.test_syslog_running'])
+ def test_syslog_restart(self):
+ if "systemd" != self.tc.td.get("VIRTUAL-RUNTIME_init_manager", ""):
+ (_, _) = self.target.run('/etc/init.d/syslog restart')
+ else:
+ (_, _) = self.target.run('systemctl restart syslog.service')
+
+
+ @OETestID(202)
+ @OETestDepends(['oe_syslog.SyslogTestConfig.test_syslog_logger'])
+ @OEHasPackage(["!sysklogd", "busybox"])
+ @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+ 'Not appropiate for systemd image')
+ def test_syslog_startup_config(self):
+ cmd = 'echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf'
+ self.target.run(cmd)
+ status, output = self.target.run('/etc/init.d/syslog restart')
+ msg = ('Could not restart syslog service. Status and output:'
+ ' %s and %s' % (status,output))
+ self.assertEqual(status, 0, msg)
+
+ cmd = 'logger foobar && grep foobar /var/log/test'
+ status,output = self.target.run(cmd)
+ msg = 'Test log string not found. Output: %s ' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ cmd = "sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf"
+ self.target.run(cmd)
+ self.target.run('/etc/init.d/syslog restart')
diff --git a/poky/meta/lib/oeqa/runtime/cases/opkg.py b/poky/meta/lib/oeqa/runtime/cases/opkg.py
new file mode 100644
index 000000000..671ee06c7
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/opkg.py
@@ -0,0 +1,47 @@
+import os
+from oeqa.utils.httpserver import HTTPService
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.data import skipIfNotDataVar, skipIfNotFeature
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class OpkgTest(OERuntimeTestCase):
+
+ def pkg(self, command, expected = 0):
+ command = 'opkg %s' % command
+ status, output = self.target.run(command, 1500)
+ message = os.linesep.join([command, output])
+ self.assertEqual(status, expected, message)
+ return output
+
+class OpkgRepoTest(OpkgTest):
+
+ @classmethod
+ def setUpClass(cls):
+ service_repo = os.path.join(cls.tc.td['DEPLOY_DIR_IPK'], 'all')
+ cls.repo_server = HTTPService(service_repo, cls.tc.target.server_ip)
+ cls.repo_server.start()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.repo_server.stop()
+
+ def setup_source_config_for_package_install(self):
+ apt_get_source_server = 'http://%s:%s/' % (self.tc.target.server_ip, self.repo_server.port)
+ apt_get_sourceslist_dir = '/etc/opkg/'
+ self.target.run('cd %s; echo src/gz all %s >> opkg.conf' % (apt_get_sourceslist_dir, apt_get_source_server))
+
+ def cleanup_source_config_for_package_install(self):
+ apt_get_sourceslist_dir = '/etc/opkg/'
+ self.target.run('cd %s; sed -i "/^src/d" opkg.conf' % (apt_get_sourceslist_dir))
+
+ @skipIfNotFeature('package-management',
+ 'Test requires package-management to be in IMAGE_FEATURES')
+ @skipIfNotDataVar('IMAGE_PKGTYPE', 'ipk',
+ 'IPK is not the primary package manager')
+ @OEHasPackage(['opkg'])
+ def test_opkg_install_from_repo(self):
+ self.setup_source_config_for_package_install()
+ self.pkg('update')
+ self.pkg('remove run-postinsts-dev')
+ self.pkg('install run-postinsts-dev')
+ self.cleanup_source_config_for_package_install()
diff --git a/poky/meta/lib/oeqa/runtime/cases/pam.py b/poky/meta/lib/oeqa/runtime/cases/pam.py
new file mode 100644
index 000000000..3654cdc94
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/pam.py
@@ -0,0 +1,33 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
+# Note that the image under test must have "pam" in DISTRO_FEATURES
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class PamBasicTest(OERuntimeTestCase):
+
+ @OETestID(1543)
+ @skipIfNotFeature('pam', 'Test requires pam to be in DISTRO_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_pam(self):
+ status, output = self.target.run('login --help')
+ msg = ('login command does not work as expected. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 1, msg = msg)
+
+ status, output = self.target.run('passwd --help')
+ msg = ('passwd command does not work as expected. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
+
+ status, output = self.target.run('su --help')
+ msg = ('su command does not work as expected. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
+
+ status, output = self.target.run('useradd --help')
+ msg = ('useradd command does not work as expected. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/parselogs.py b/poky/meta/lib/oeqa/runtime/cases/parselogs.py
new file mode 100644
index 000000000..1f36c6108
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/parselogs.py
@@ -0,0 +1,363 @@
+import os
+
+from subprocess import check_output
+from shutil import rmtree
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+#in the future these lists could be moved outside of module
+errors = ["error", "cannot", "can\'t", "failed"]
+
+common_errors = [
+ "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.",
+ "dma timeout",
+ "can\'t add hid device:",
+ "usbhid: probe of ",
+ "_OSC failed (AE_ERROR)",
+ "_OSC failed (AE_SUPPORT)",
+ "AE_ALREADY_EXISTS",
+ "ACPI _OSC request failed (AE_SUPPORT)",
+ "can\'t disable ASPM",
+ "Failed to load module \"vesa\"",
+ "Failed to load module vesa",
+ "Failed to load module \"modesetting\"",
+ "Failed to load module modesetting",
+ "Failed to load module \"glx\"",
+ "Failed to load module \"fbdev\"",
+ "Failed to load module fbdev",
+ "Failed to load module glx",
+ "[drm] Cannot find any crtc or sizes - going 1024x768",
+ "_OSC failed (AE_NOT_FOUND); disabling ASPM",
+ "Open ACPI failed (/var/run/acpid.socket) (No such file or directory)",
+ "NX (Execute Disable) protection cannot be enabled: non-PAE kernel!",
+ "hd.: possibly failed opcode",
+ 'NETLINK INITIALIZATION FAILED',
+ 'kernel: Cannot find map file',
+ 'omap_hwmod: debugss: _wait_target_disable failed',
+ 'VGA arbiter: cannot open kernel arbiter, no multi-card support',
+ 'Failed to find URL:http://ipv4.connman.net/online/status.html',
+ 'Online check failed for',
+ 'netlink init failed',
+ 'Fast TSC calibration',
+ "BAR 0-9",
+ "Failed to load module \"ati\"",
+ "controller can't do DEVSLP, turning off",
+ "stmmac_dvr_probe: warning: cannot get CSR clock",
+ "error: couldn\'t mount because of unsupported optional features",
+ "GPT: Use GNU Parted to correct GPT errors",
+ "Cannot set xattr user.Librepo.DownloadInProgress",
+ ]
+
+video_related = [
+ "uvesafb",
+]
+
+x86_common = [
+ '[drm:psb_do_init] *ERROR* Debug is',
+ 'wrong ELF class',
+ 'Could not enable PowerButton event',
+ 'probe of LNXPWRBN:00 failed with error -22',
+ 'pmd_set_huge: Cannot satisfy',
+ 'failed to setup card detect gpio',
+ 'amd_nb: Cannot enumerate AMD northbridges',
+ 'failed to retrieve link info, disabling eDP',
+ 'Direct firmware load for iwlwifi',
+] + common_errors
+
+qemux86_common = [
+ 'wrong ELF class',
+ "fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.",
+ "can't claim BAR ",
+ 'amd_nb: Cannot enumerate AMD northbridges',
+ 'uvesafb: 5000 ms task timeout, infinitely waiting',
+ 'tsc: HPET/PMTIMER calibration failed',
+] + common_errors
+
+ignore_errors = {
+ 'default' : common_errors,
+ 'qemux86' : [
+ 'Failed to access perfctr msr (MSR',
+ 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+ ] + qemux86_common,
+ 'qemux86-64' : qemux86_common,
+ 'qemumips' : [
+ 'Failed to load module "glx"',
+ 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+ 'cacheinfo: Failed to find cpu0 device node',
+ ] + common_errors,
+ 'qemumips64' : [
+ 'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+ 'cacheinfo: Failed to find cpu0 device node',
+ ] + common_errors,
+ 'qemuppc' : [
+ 'PCI 0000:00 Cannot reserve Legacy IO [io 0x0000-0x0fff]',
+ 'host side 80-wire cable detection failed, limiting max speed',
+ 'mode "640x480" test failed',
+ 'Failed to load module "glx"',
+ 'can\'t handle BAR above 4GB',
+ 'Cannot reserve Legacy IO',
+ ] + common_errors,
+ 'qemuarm' : [
+ 'mmci-pl18x: probe of fpga:05 failed with error -22',
+ 'mmci-pl18x: probe of fpga:0b failed with error -22',
+ 'Failed to load module "glx"',
+ 'OF: amba_device_add() failed (-19) for /amba/smc@10100000',
+ 'OF: amba_device_add() failed (-19) for /amba/mpmc@10110000',
+ 'OF: amba_device_add() failed (-19) for /amba/sctl@101e0000',
+ 'OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000',
+ 'OF: amba_device_add() failed (-19) for /amba/sci@101f0000',
+ 'OF: amba_device_add() failed (-19) for /amba/ssp@101f4000',
+ 'OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000',
+ 'Failed to initialize \'/amba/timer@101e3000\': -22',
+ 'jitterentropy: Initialization failed with host not compliant with requirements: 2',
+ ] + common_errors,
+ 'qemuarm64' : [
+ 'Fatal server error:',
+ '(EE) Server terminated with error (1). Closing log file.',
+ 'dmi: Firmware registration failed.',
+ 'irq: type mismatch, failed to map hwirq-27 for /intc',
+ ] + common_errors,
+ 'emenlow' : [
+ '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+ '(EE) Failed to load module "psb"',
+ '(EE) Failed to load module psb',
+ '(EE) Failed to load module "psbdrv"',
+ '(EE) Failed to load module psbdrv',
+ '(EE) open /dev/fb0: No such file or directory',
+ '(EE) AIGLX: reverting to software rendering',
+ ] + x86_common,
+ 'intel-core2-32' : [
+ 'ACPI: No _BQC method, cannot determine initial brightness',
+ '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+ '(EE) Failed to load module "psb"',
+ '(EE) Failed to load module psb',
+ '(EE) Failed to load module "psbdrv"',
+ '(EE) Failed to load module psbdrv',
+ '(EE) open /dev/fb0: No such file or directory',
+ '(EE) AIGLX: reverting to software rendering',
+ 'dmi: Firmware registration failed.',
+ 'ioremap error for 0x78',
+ ] + x86_common,
+ 'intel-corei7-64' : [
+ 'can\'t set Max Payload Size to 256',
+ 'intel_punit_ipc: can\'t request region for resource',
+ '[drm] parse error at position 4 in video mode \'efifb\'',
+ 'ACPI Error: Could not enable RealTimeClock event',
+ 'ACPI Warning: Could not enable fixed event - RealTimeClock',
+ 'hci_intel INT33E1:00: Unable to retrieve gpio',
+ 'hci_intel: probe of INT33E1:00 failed',
+ 'can\'t derive routing for PCI INT A',
+ 'failed to read out thermal zone',
+ 'Bluetooth: hci0: Setting Intel event mask failed',
+ 'ttyS2 - failed to request DMA',
+ 'Bluetooth: hci0: Failed to send firmware data (-38)',
+ 'atkbd serio0: Failed to enable keyboard on isa0060/serio0',
+ ] + x86_common,
+ 'crownbay' : x86_common,
+ 'genericx86' : x86_common,
+ 'genericx86-64' : [
+ 'Direct firmware load for i915',
+ 'Failed to load firmware i915',
+ 'Failed to fetch GuC',
+ 'Failed to initialize GuC',
+ 'Failed to load DMC firmware',
+ 'The driver is built-in, so to load the firmware you need to',
+ ] + x86_common,
+ 'edgerouter' : [
+ 'Fatal server error:',
+ ] + common_errors,
+ 'jasperforest' : [
+ 'Activated service \'org.bluez\' failed:',
+ 'Unable to find NFC netlink family',
+ ] + common_errors,
+}
+
+log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"]
+
+class ParseLogsTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.errors = errors
+
+ # When systemd is enabled we need to notice errors on
+ # circular dependencies in units.
+ if 'systemd' in cls.td.get('DISTRO_FEATURES', ''):
+ cls.errors.extend([
+ 'Found ordering cycle on',
+ 'Breaking ordering cycle by deleting job',
+ 'deleted to break ordering cycle',
+ 'Ordering cycle found, skipping',
+ ])
+
+ cls.ignore_errors = ignore_errors
+ cls.log_locations = log_locations
+ cls.msg = ''
+ is_lsb, _ = cls.tc.target.run("which LSB_Test.sh")
+ if is_lsb == 0:
+ for machine in cls.ignore_errors:
+ cls.ignore_errors[machine] = cls.ignore_errors[machine] \
+ + video_related
+
+ def getMachine(self):
+ return self.td.get('MACHINE', '')
+
+ def getWorkdir(self):
+ return self.td.get('WORKDIR', '')
+
+ # Get some information on the CPU of the machine to display at the
+ # beginning of the output. This info might be useful in some cases.
+ def getHardwareInfo(self):
+ hwi = ""
+ cmd = ('cat /proc/cpuinfo | grep "model name" | head -n1 | '
+ " awk 'BEGIN{FS=\":\"}{print $2}'")
+ _, cpu_name = self.target.run(cmd)
+
+ cmd = ('cat /proc/cpuinfo | grep "cpu cores" | head -n1 | '
+ "awk {'print $4'}")
+ _, cpu_physical_cores = self.target.run(cmd)
+
+ cmd = 'cat /proc/cpuinfo | grep "processor" | wc -l'
+ _, cpu_logical_cores = self.target.run(cmd)
+
+ _, cpu_arch = self.target.run('uname -m')
+
+ hwi += 'Machine information: \n'
+ hwi += '*******************************\n'
+ hwi += 'Machine name: ' + self.getMachine() + '\n'
+ hwi += 'CPU: ' + str(cpu_name) + '\n'
+ hwi += 'Arch: ' + str(cpu_arch)+ '\n'
+ hwi += 'Physical cores: ' + str(cpu_physical_cores) + '\n'
+ hwi += 'Logical cores: ' + str(cpu_logical_cores) + '\n'
+ hwi += '*******************************\n'
+
+ return hwi
+
+ # Go through the log locations provided and if it's a folder
+ # create a list with all the .log files in it, if it's a file
+ # just add it to that list.
+ def getLogList(self, log_locations):
+ logs = []
+ for location in log_locations:
+ status, _ = self.target.run('test -f ' + str(location))
+ if status == 0:
+ logs.append(str(location))
+ else:
+ status, _ = self.target.run('test -d ' + str(location))
+ if status == 0:
+ cmd = 'find ' + str(location) + '/*.log -maxdepth 1 -type f'
+ status, output = self.target.run(cmd)
+ if status == 0:
+ output = output.splitlines()
+ for logfile in output:
+ logs.append(os.path.join(location, str(logfile)))
+ return logs
+
+ # Copy the log files to be parsed locally
+ def transfer_logs(self, log_list):
+ workdir = self.getWorkdir()
+ self.target_logs = workdir + '/' + 'target_logs'
+ target_logs = self.target_logs
+ if os.path.exists(target_logs):
+ rmtree(self.target_logs)
+ os.makedirs(target_logs)
+ for f in log_list:
+ self.target.copyFrom(str(f), target_logs)
+
+ # Get the local list of logs
+ def get_local_log_list(self, log_locations):
+ self.transfer_logs(self.getLogList(log_locations))
+ list_dir = os.listdir(self.target_logs)
+ dir_files = [os.path.join(self.target_logs, f) for f in list_dir]
+ logs = [f for f in dir_files if os.path.isfile(f)]
+ return logs
+
+ # Build the grep command to be used with filters and exclusions
+ def build_grepcmd(self, errors, ignore_errors, log):
+ grepcmd = 'grep '
+ grepcmd += '-Ei "'
+ for error in errors:
+ grepcmd += error + '|'
+ grepcmd = grepcmd[:-1]
+ grepcmd += '" ' + str(log) + " | grep -Eiv \'"
+
+ try:
+ errorlist = ignore_errors[self.getMachine()]
+ except KeyError:
+ self.msg += 'No ignore list found for this machine, using default\n'
+ errorlist = ignore_errors['default']
+
+ for ignore_error in errorlist:
+ ignore_error = ignore_error.replace('(', '\(')
+ ignore_error = ignore_error.replace(')', '\)')
+ ignore_error = ignore_error.replace("'", '.')
+ ignore_error = ignore_error.replace('?', '\?')
+ ignore_error = ignore_error.replace('[', '\[')
+ ignore_error = ignore_error.replace(']', '\]')
+ ignore_error = ignore_error.replace('*', '\*')
+ ignore_error = ignore_error.replace('0-9', '[0-9]')
+ grepcmd += ignore_error + '|'
+ grepcmd = grepcmd[:-1]
+ grepcmd += "\'"
+
+ return grepcmd
+
+ # Grep only the errors so that their context could be collected.
+ # Default context is 10 lines before and after the error itself
+ def parse_logs(self, errors, ignore_errors, logs,
+ lines_before = 10, lines_after = 10):
+ results = {}
+ rez = []
+ grep_output = ''
+
+ for log in logs:
+ result = None
+ thegrep = self.build_grepcmd(errors, ignore_errors, log)
+
+ try:
+ result = check_output(thegrep, shell=True).decode('utf-8')
+ except:
+ pass
+
+ if result is not None:
+ results[log.replace('target_logs/','')] = {}
+ rez = result.splitlines()
+
+ for xrez in rez:
+ try:
+ cmd = ['grep', '-F', xrez, '-B', str(lines_before)]
+ cmd += ['-A', str(lines_after), log]
+ grep_output = check_output(cmd).decode('utf-8')
+ except:
+ pass
+ results[log.replace('target_logs/','')][xrez]=grep_output
+
+ return results
+
+ # Get the output of dmesg and write it in a file.
+ # This file is added to log_locations.
+ def write_dmesg(self):
+ (status, dmesg) = self.target.run('dmesg > /tmp/dmesg_output.log')
+
+ @OETestID(1059)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_parselogs(self):
+ self.write_dmesg()
+ log_list = self.get_local_log_list(self.log_locations)
+ result = self.parse_logs(self.errors, self.ignore_errors, log_list)
+ print(self.getHardwareInfo())
+ errcount = 0
+ for log in result:
+ self.msg += 'Log: ' + log + '\n'
+ self.msg += '-----------------------\n'
+ for error in result[log]:
+ errcount += 1
+ self.msg += 'Central error: ' + str(error) + '\n'
+ self.msg += '***********************\n'
+ self.msg += result[str(log)][str(error)] + '\n'
+ self.msg += '***********************\n'
+ self.msg += '%s errors found in logs.' % errcount
+ self.assertEqual(errcount, 0, msg=self.msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/perl.py b/poky/meta/lib/oeqa/runtime/cases/perl.py
new file mode 100644
index 000000000..d0b7e8ed9
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/perl.py
@@ -0,0 +1,37 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class PerlTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ src = os.path.join(cls.tc.files_dir, 'test.pl')
+ dst = '/tmp/test.pl'
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ dst = '/tmp/test.pl'
+ cls.tc.target.run('rm %s' % dst)
+
+ @OETestID(1141)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['perl'])
+ def test_perl_exists(self):
+ status, output = self.target.run('which perl')
+ msg = 'Perl binary not in PATH or not on target.'
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(208)
+ @OETestDepends(['perl.PerlTest.test_perl_exists'])
+ def test_perl_works(self):
+ status, output = self.target.run('perl /tmp/test.pl')
+ msg = 'Exit status was not 0. Output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ msg = 'Incorrect output: %s' % output
+ self.assertEqual(output, "the value of a is 0.01", msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/ping.py b/poky/meta/lib/oeqa/runtime/cases/ping.py
new file mode 100644
index 000000000..02f580abe
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/ping.py
@@ -0,0 +1,24 @@
+from subprocess import Popen, PIPE
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.oetimeout import OETimeout
+
+class PingTest(OERuntimeTestCase):
+
+ @OETimeout(30)
+ @OETestID(964)
+ def test_ping(self):
+ output = ''
+ count = 0
+ while count < 5:
+ cmd = 'ping -c 1 %s' % self.target.ip
+ proc = Popen(cmd, shell=True, stdout=PIPE)
+ output += proc.communicate()[0].decode('utf-8')
+ if proc.poll() == 0:
+ count += 1
+ else:
+ count = 0
+ msg = ('Expected 5 consecutive, got %d.\n'
+ 'ping output is:\n%s' % (count,output))
+ self.assertEqual(count, 5, msg = msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/ptest.py b/poky/meta/lib/oeqa/runtime/cases/ptest.py
new file mode 100644
index 000000000..f60a433d5
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/ptest.py
@@ -0,0 +1,93 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+from oeqa.utils.logparser import Lparser, Result
+
+class PtestRunnerTest(OERuntimeTestCase):
+
+ # a ptest log parser
+ def parse_ptest(self, logfile):
+ parser = Lparser(test_0_pass_regex="^PASS:(.+)",
+ test_0_fail_regex="^FAIL:(.+)",
+ test_0_skip_regex="^SKIP:(.+)",
+ section_0_begin_regex="^BEGIN: .*/(.+)/ptest",
+ section_0_end_regex="^END: .*/(.+)/ptest")
+ parser.init()
+ result = Result()
+
+ with open(logfile, errors='replace') as f:
+ for line in f:
+ result_tuple = parser.parse_line(line)
+ if not result_tuple:
+ continue
+ result_tuple = line_type, category, status, name = parser.parse_line(line)
+
+ if line_type == 'section' and status == 'begin':
+ current_section = name
+ continue
+
+ if line_type == 'section' and status == 'end':
+ current_section = None
+ continue
+
+ if line_type == 'test' and status == 'pass':
+ result.store(current_section, name, status)
+ continue
+
+ if line_type == 'test' and status == 'fail':
+ result.store(current_section, name, status)
+ continue
+
+ if line_type == 'test' and status == 'skip':
+ result.store(current_section, name, status)
+ continue
+
+ result.sort_tests()
+ return result
+
+ @OETestID(1600)
+ @skipIfNotFeature('ptest', 'Test requires ptest to be in DISTRO_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_ptestrunner(self):
+ status, output = self.target.run('which ptest-runner', 0)
+ if status != 0:
+ self.skipTest("No -ptest packages are installed in the image")
+
+ import datetime
+
+ test_log_dir = self.td.get('TEST_LOG_DIR', '')
+ # The TEST_LOG_DIR maybe NULL when testimage is added after
+ # testdata.json is generated.
+ if not test_log_dir:
+ test_log_dir = os.path.join(self.td.get('WORKDIR', ''), 'testimage')
+ # Don't use self.td.get('DATETIME'), it's from testdata.json, not
+ # up-to-date, and may cause "File exists" when re-reun.
+ datetime = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
+ ptest_log_dir_link = os.path.join(test_log_dir, 'ptest_log')
+ ptest_log_dir = '%s.%s' % (ptest_log_dir_link, datetime)
+ ptest_runner_log = os.path.join(ptest_log_dir, 'ptest-runner.log')
+
+ status, output = self.target.run('ptest-runner', 0)
+ os.makedirs(ptest_log_dir)
+ with open(ptest_runner_log, 'w') as f:
+ f.write(output)
+
+ # status != 0 is OK since some ptest tests may fail
+ self.assertTrue(status != 127, msg="Cannot execute ptest-runner!")
+
+ # Parse and save results
+ parse_result = self.parse_ptest(ptest_runner_log)
+ parse_result.log_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip'])
+ if os.path.exists(ptest_log_dir_link):
+ # Remove the old link to create a new one
+ os.remove(ptest_log_dir_link)
+ os.symlink(os.path.basename(ptest_log_dir), ptest_log_dir_link)
+
+ failed_tests = {}
+ for section in parse_result.result_dict:
+ failed_testcases = [ test for test, result in parse_result.result_dict[section] if result == 'fail' ]
+ if failed_testcases:
+ failed_tests[section] = failed_testcases
+
+ self.assertFalse(failed_tests, msg = "Failed ptests: %s" %(str(failed_tests)))
diff --git a/poky/meta/lib/oeqa/runtime/cases/python.py b/poky/meta/lib/oeqa/runtime/cases/python.py
new file mode 100644
index 000000000..bf3e17916
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/python.py
@@ -0,0 +1,43 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class PythonTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ src = os.path.join(cls.tc.files_dir, 'test.py')
+ dst = '/tmp/test.py'
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ dst = '/tmp/test.py'
+ cls.tc.target.run('rm %s' % dst)
+
+ @OETestID(1145)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['python-core'])
+ def test_python_exists(self):
+ status, output = self.target.run('which python')
+ msg = 'Python binary not in PATH or not on target.'
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(965)
+ @OETestDepends(['python.PythonTest.test_python_exists'])
+ def test_python_stdout(self):
+ status, output = self.target.run('python /tmp/test.py')
+ msg = 'Exit status was not 0. Output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ msg = 'Incorrect output: %s' % output
+ self.assertEqual(output, "the value of a is 0.01", msg=msg)
+
+ @OETestID(1146)
+ @OETestDepends(['python.PythonTest.test_python_stdout'])
+ def test_python_testfile(self):
+ status, output = self.target.run('ls /tmp/testfile.python')
+ self.assertEqual(status, 0, msg='Python test file generate failed.')
diff --git a/poky/meta/lib/oeqa/runtime/cases/rpm.py b/poky/meta/lib/oeqa/runtime/cases/rpm.py
new file mode 100644
index 000000000..05b94c7b4
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/rpm.py
@@ -0,0 +1,142 @@
+import os
+import fnmatch
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+from oeqa.core.utils.path import findFile
+
+class RpmBasicTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm':
+ cls.skipTest('Tests require image to be build from rpm')
+
+ @OETestID(960)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_rpm_help(self):
+ status, output = self.target.run('rpm --help')
+ msg = 'status and output: %s and %s' % (status, output)
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(191)
+ @OETestDepends(['rpm.RpmBasicTest.test_rpm_help'])
+ def test_rpm_query(self):
+ status, output = self.target.run('rpm -q rpm')
+ msg = 'status and output: %s and %s' % (status, output)
+ self.assertEqual(status, 0, msg=msg)
+
+class RpmInstallRemoveTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm':
+ cls.skipTest('Tests require image to be build from rpm')
+
+ pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_')
+ rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch)
+ # Pick rpm-doc as a test file to get installed, because it's small
+ # and it will always be built for standard targets
+ rpm_doc = 'rpm-doc-*.%s.rpm' % pkgarch
+ for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc):
+ test_file = os.path.join(rpmdir, f)
+ dst = '/tmp/rpm-doc.rpm'
+ cls.tc.target.copyTo(test_file, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ dst = '/tmp/rpm-doc.rpm'
+ cls.tc.target.run('rm -f %s' % dst)
+
+ @OETestID(192)
+ @OETestDepends(['rpm.RpmBasicTest.test_rpm_help'])
+ def test_rpm_install(self):
+ status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+ msg = 'Failed to install rpm-doc package: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(194)
+ @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install'])
+ def test_rpm_remove(self):
+ status,output = self.target.run('rpm -e rpm-doc')
+ msg = 'Failed to remove rpm-doc package: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(1096)
+ @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
+ def test_rpm_query_nonroot(self):
+
+ def set_up_test_user(u):
+ status, output = self.target.run('id -u %s' % u)
+ if status:
+ status, output = self.target.run('useradd %s' % u)
+ msg = 'Failed to create new user: %s' % output
+ self.assertTrue(status == 0, msg=msg)
+
+ def exec_as_test_user(u):
+ status, output = self.target.run('su -c id %s' % u)
+ msg = 'Failed to execute as new user'
+ self.assertTrue("({0})".format(u) in output, msg=msg)
+
+ status, output = self.target.run('su -c "rpm -qa" %s ' % u)
+ msg = 'status: %s. Cannot run rpm -qa: %s' % (status, output)
+ self.assertEqual(status, 0, msg=msg)
+
+ def unset_up_test_user(u):
+ status, output = self.target.run('userdel -r %s' % u)
+ msg = 'Failed to erase user: %s' % output
+ self.assertTrue(status == 0, msg=msg)
+
+ tuser = 'test1'
+
+ try:
+ set_up_test_user(tuser)
+ exec_as_test_user(tuser)
+ finally:
+ unset_up_test_user(tuser)
+
+ @OETestID(195)
+ @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_remove'])
+ def test_check_rpm_install_removal_log_file_size(self):
+ """
+ Summary: Check that rpm writes into /var/log/messages
+ Expected: There should be some RPM prefixed entries in the above file.
+ Product: BSPs
+ Author: Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+ db_files_cmd = 'ls /var/lib/rpm/__db.*'
+ check_log_cmd = "grep RPM /var/log/messages | wc -l"
+
+ # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
+ status, output = self.target.run(db_files_cmd)
+ msg = 'Failed to find database files under /var/lib/rpm/ as __db.xxx'
+ self.assertEqual(0, status, msg=msg)
+
+ # Remove the package just in case
+ self.target.run('rpm -e rpm-doc')
+
+ # Install/Remove a package 10 times
+ for i in range(10):
+ status, output = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+ msg = 'Failed to install rpm-doc package. Reason: {}'.format(output)
+ self.assertEqual(0, status, msg=msg)
+
+ status, output = self.target.run('rpm -e rpm-doc')
+ msg = 'Failed to remove rpm-doc package. Reason: {}'.format(output)
+ self.assertEqual(0, status, msg=msg)
+
+ # if using systemd this should ensure all entries are flushed to /var
+ status, output = self.target.run("journalctl --sync")
+ # Get the amount of entries in the log file
+ status, output = self.target.run(check_log_cmd)
+ msg = 'Failed to get the final size of the log file.'
+ self.assertEqual(0, status, msg=msg)
+
+ # Check that there's enough of them
+ self.assertGreaterEqual(int(output), 80,
+ 'Cound not find sufficient amount of rpm entries in /var/log/messages, found {} entries'.format(output))
diff --git a/poky/meta/lib/oeqa/runtime/cases/scanelf.py b/poky/meta/lib/oeqa/runtime/cases/scanelf.py
new file mode 100644
index 000000000..3ba1f78af
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/scanelf.py
@@ -0,0 +1,26 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class ScanelfTest(OERuntimeTestCase):
+ scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
+
+ @OETestID(966)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['pax-utils'])
+ def test_scanelf_textrel(self):
+ # print TEXTREL information
+ cmd = '%s --textrel' % self.scancmd
+ status, output = self.target.run(cmd)
+ msg = '\n'.join([cmd, output])
+ self.assertEqual(output.strip(), '', msg=msg)
+
+ @OETestID(967)
+ @OETestDepends(['scanelf.ScanelfTest.test_scanelf_textrel'])
+ def test_scanelf_rpath(self):
+ # print RPATH information
+ cmd = '%s --textrel --rpath' % self.scancmd
+ status, output = self.target.run(cmd)
+ msg = '\n'.join([cmd, output])
+ self.assertEqual(output.strip(), '', msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/scp.py b/poky/meta/lib/oeqa/runtime/cases/scp.py
new file mode 100644
index 000000000..f488a6175
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/scp.py
@@ -0,0 +1,33 @@
+import os
+from tempfile import mkstemp
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class ScpTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.tmp_fd, cls.tmp_path = mkstemp()
+ with os.fdopen(cls.tmp_fd, 'w') as f:
+ f.seek(2 ** 22 -1)
+ f.write(os.linesep)
+
+ @classmethod
+ def tearDownClass(cls):
+ os.remove(cls.tmp_path)
+
+ @OETestID(220)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_scp_file(self):
+ dst = '/tmp/test_scp_file'
+
+ (status, output) = self.target.copyTo(self.tmp_path, dst)
+ msg = 'File could not be copied. Output: %s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ (status, output) = self.target.run('ls -la %s' % dst)
+ self.assertEqual(status, 0, msg = 'SCP test failed')
+
+ self.target.run('rm %s' % dst)
diff --git a/poky/meta/lib/oeqa/runtime/cases/skeletoninit.py b/poky/meta/lib/oeqa/runtime/cases/skeletoninit.py
new file mode 100644
index 000000000..4fdcf033a
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/skeletoninit.py
@@ -0,0 +1,33 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284
+# testcase. Image under test must have meta-skeleton layer in bblayers and
+# IMAGE_INSTALL_append = " service" in local.conf
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+
+class SkeletonBasicTest(OERuntimeTestCase):
+
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ @OEHasPackage(['service'])
+ @skipIfDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+ 'Not appropiate for systemd image')
+ def test_skeleton_availability(self):
+ status, output = self.target.run('ls /etc/init.d/skeleton')
+ msg = 'skeleton init script not found. Output:\n%s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ status, output = self.target.run('ls /usr/sbin/skeleton-test')
+ msg = 'skeleton-test not found. Output:\n%s' % output
+ self.assertEqual(status, 0, msg=msg)
+
+ @OETestID(284)
+ @OETestDepends(['skeletoninit.SkeletonBasicTest.test_skeleton_availability'])
+ def test_skeleton_script(self):
+ output1 = self.target.run("/etc/init.d/skeleton start")[1]
+ cmd = '%s | grep [s]keleton-test' % self.tc.target_cmds['ps']
+ status, output2 = self.target.run(cmd)
+ msg = ('Skeleton script could not be started:'
+ '\n%s\n%s' % (output1, output2))
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/ssh.py b/poky/meta/lib/oeqa/runtime/cases/ssh.py
new file mode 100644
index 000000000..eca167969
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/ssh.py
@@ -0,0 +1,15 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+
+class SSHTest(OERuntimeTestCase):
+
+ @OETestID(224)
+ @OETestDepends(['ping.PingTest.test_ping'])
+ def test_ssh(self):
+ (status, output) = self.target.run('uname -a')
+ self.assertEqual(status, 0, msg='SSH Test failed: %s' % output)
+ (status, output) = self.target.run('cat /etc/masterimage')
+ msg = "This isn't the right image - /etc/masterimage " \
+ "shouldn't be here %s" % output
+ self.assertEqual(status, 1, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/stap.py b/poky/meta/lib/oeqa/runtime/cases/stap.py
new file mode 100644
index 000000000..fc728bfc5
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/stap.py
@@ -0,0 +1,33 @@
+import os
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class StapTest(OERuntimeTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
+ dst = '/tmp/hello.stp'
+ cls.tc.target.copyTo(src, dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ files = '/tmp/hello.stp'
+ cls.tc.target.run('rm %s' % files)
+
+ @OETestID(1652)
+ @skipIfNotFeature('tools-profile',
+ 'Test requires tools-profile to be in IMAGE_FEATURES')
+ @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module'])
+ def test_stap(self):
+ cmds = [
+ 'cd /usr/src/kernel && make scripts prepare',
+ 'cd /lib/modules/`uname -r` && (if [ ! -L build ]; then ln -s /usr/src/kernel build; fi)',
+ 'stap --disable-cache -DSTP_NO_VERREL_CHECK /tmp/hello.stp'
+ ]
+ for cmd in cmds:
+ status, output = self.target.run(cmd, 900)
+ self.assertEqual(status, 0, msg='\n'.join([cmd, output]))
diff --git a/poky/meta/lib/oeqa/runtime/cases/systemd.py b/poky/meta/lib/oeqa/runtime/cases/systemd.py
new file mode 100644
index 000000000..db69384c8
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/systemd.py
@@ -0,0 +1,181 @@
+import re
+import time
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfDataVar, skipIfNotDataVar
+from oeqa.runtime.decorator.package import OEHasPackage
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class SystemdTest(OERuntimeTestCase):
+
+ def systemctl(self, action='', target='', expected=0, verbose=False):
+ command = 'systemctl %s %s' % (action, target)
+ status, output = self.target.run(command)
+ message = '\n'.join([command, output])
+ if status != expected and verbose:
+ cmd = 'systemctl status --full %s' % target
+ message += self.target.run(cmd)[1]
+ self.assertEqual(status, expected, message)
+ return output
+
+ #TODO: use pyjournalctl instead
+ def journalctl(self, args='',l_match_units=None):
+ """
+ Request for the journalctl output to the current target system
+
+ Arguments:
+ -args, an optional argument pass through argument
+ -l_match_units, an optional list of units to filter the output
+ Returns:
+ -string output of the journalctl command
+ Raises:
+ -AssertionError, on remote commands that fail
+ -ValueError, on a journalctl call with filtering by l_match_units that
+ returned no entries
+ """
+
+ query_units=''
+ if l_match_units:
+ query_units = ['_SYSTEMD_UNIT='+unit for unit in l_match_units]
+ query_units = ' '.join(query_units)
+ command = 'journalctl %s %s' %(args, query_units)
+ status, output = self.target.run(command)
+ if status:
+ raise AssertionError("Command '%s' returned non-zero exit "
+ 'code %d:\n%s' % (command, status, output))
+ if len(output) == 1 and "-- No entries --" in output:
+ raise ValueError('List of units to match: %s, returned no entries'
+ % l_match_units)
+ return output
+
+class SystemdBasicTests(SystemdTest):
+
+ def settle(self):
+ """
+ Block until systemd has finished activating any units being activated,
+ or until two minutes has elapsed.
+
+ Returns a tuple, either (True, '') if all units have finished
+ activating, or (False, message string) if there are still units
+ activating (generally, failing units that restart).
+ """
+ endtime = time.time() + (60 * 2)
+ while True:
+ status, output = self.target.run('systemctl --state=activating')
+ if "0 loaded units listed" in output:
+ return (True, '')
+ if time.time() >= endtime:
+ return (False, output)
+ time.sleep(10)
+
+ @skipIfNotFeature('systemd',
+ 'Test requires systemd to be in DISTRO_FEATURES')
+ @skipIfNotDataVar('VIRTUAL-RUNTIME_init_manager', 'systemd',
+ 'systemd is not the init manager for this image')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_systemd_basic(self):
+ self.systemctl('--version')
+
+ @OETestID(551)
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ def test_systemd_list(self):
+ self.systemctl('list-unit-files')
+
+ @OETestID(550)
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ def test_systemd_failed(self):
+ settled, output = self.settle()
+ msg = "Timed out waiting for systemd to settle:\n%s" % output
+ self.assertTrue(settled, msg=msg)
+
+ output = self.systemctl('list-units', '--failed')
+ match = re.search('0 loaded units listed', output)
+ if not match:
+ output += self.systemctl('status --full --failed')
+ self.assertTrue(match, msg='Some systemd units failed:\n%s' % output)
+
+
+class SystemdServiceTests(SystemdTest):
+
+ @OEHasPackage(['avahi-daemon'])
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ def test_systemd_status(self):
+ self.systemctl('status --full', 'avahi-daemon.service')
+
+ @OETestID(695)
+ @OETestDepends(['systemd.SystemdServiceTests.test_systemd_status'])
+ def test_systemd_stop_start(self):
+ self.systemctl('stop', 'avahi-daemon.service')
+ self.systemctl('is-active', 'avahi-daemon.service',
+ expected=3, verbose=True)
+ self.systemctl('start','avahi-daemon.service')
+ self.systemctl('is-active', 'avahi-daemon.service', verbose=True)
+
+ @OETestID(696)
+ @OETestDepends(['systemd.SystemdServiceTests.test_systemd_status'])
+ def test_systemd_disable_enable(self):
+ self.systemctl('disable', 'avahi-daemon.service')
+ self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
+ self.systemctl('enable', 'avahi-daemon.service')
+ self.systemctl('is-enabled', 'avahi-daemon.service')
+
+class SystemdJournalTests(SystemdTest):
+
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ def test_systemd_journal(self):
+ status, output = self.target.run('journalctl')
+ self.assertEqual(status, 0, output)
+
+ @OETestDepends(['systemd.SystemdBasicTests.test_systemd_basic'])
+ def test_systemd_boot_time(self, systemd_TimeoutStartSec=90):
+ """
+ Get the target boot time from journalctl and log it
+
+ Arguments:
+ -systemd_TimeoutStartSec, an optional argument containing systemd's
+ unit start timeout to compare against
+ """
+
+ # The expression chain that uniquely identifies the time boot message.
+ expr_items=['Startup finished', 'kernel', 'userspace','\.$']
+ try:
+ output = self.journalctl(args='-o cat --reverse')
+ except AssertionError:
+ self.fail('Error occurred while calling journalctl')
+ if not len(output):
+ self.fail('Error, unable to get startup time from systemd journal')
+
+ # Check for the regular expression items that match the startup time.
+ for line in output.split('\n'):
+ check_match = ''.join(re.findall('.*'.join(expr_items), line))
+ if check_match:
+ break
+ # Put the startup time in the test log
+ if check_match:
+ self.tc.logger.info('%s' % check_match)
+ else:
+ self.skipTest('Error at obtaining the boot time from journalctl')
+ boot_time_sec = 0
+
+ # Get the numeric values from the string and convert them to seconds
+ # same data will be placed in list and string for manipulation.
+ l_boot_time = check_match.split(' ')[-2:]
+ s_boot_time = ' '.join(l_boot_time)
+ try:
+ # Obtain the minutes it took to boot.
+ if l_boot_time[0].endswith('min') and l_boot_time[0][0].isdigit():
+ boot_time_min = s_boot_time.split('min')[0]
+ # Convert to seconds and accumulate it.
+ boot_time_sec += int(boot_time_min) * 60
+ # Obtain the seconds it took to boot and accumulate.
+ boot_time_sec += float(l_boot_time[1].split('s')[0])
+ except ValueError:
+ self.skipTest('Error when parsing time from boot string')
+
+ # Assert the target boot time against systemd's unit start timeout.
+ if boot_time_sec > systemd_TimeoutStartSec:
+ msg = ("Target boot time %s exceeds systemd's TimeoutStartSec %s"
+ % (boot_time_sec, systemd_TimeoutStartSec))
+ self.tc.logger.info(msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/x32lib.py b/poky/meta/lib/oeqa/runtime/cases/x32lib.py
new file mode 100644
index 000000000..8da0154e7
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/x32lib.py
@@ -0,0 +1,19 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotInDataVar
+
+class X32libTest(OERuntimeTestCase):
+
+ @skipIfNotInDataVar('DEFAULTTUNE', 'x86-64-x32',
+ 'DEFAULTTUNE is not set to x86-64-x32')
+ @OETestID(281)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_x32_file(self):
+ cmd = 'readelf -h /bin/ls | grep Class | grep ELF32'
+ status1 = self.target.run(cmd)[0]
+ cmd = 'readelf -h /bin/ls | grep Machine | grep X86-64'
+ status2 = self.target.run(cmd)[0]
+ msg = ("/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" %
+ self.target.run("readelf -h /bin/ls")[1])
+ self.assertTrue(status1 == 0 and status2 == 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/cases/xorg.py b/poky/meta/lib/oeqa/runtime/cases/xorg.py
new file mode 100644
index 000000000..2124813e3
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/cases/xorg.py
@@ -0,0 +1,17 @@
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.data import skipIfNotFeature
+
+class XorgTest(OERuntimeTestCase):
+
+ @OETestID(1151)
+ @skipIfNotFeature('x11-base',
+ 'Test requires x11 to be in IMAGE_FEATURES')
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_xorg_running(self):
+ cmd ='%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps']
+ status, output = self.target.run(cmd)
+ msg = ('Xorg does not appear to be running %s' %
+ self.target.run(self.tc.target_cmds['ps'])[1])
+ self.assertEqual(status, 0, msg=msg)
diff --git a/poky/meta/lib/oeqa/runtime/context.py b/poky/meta/lib/oeqa/runtime/context.py
new file mode 100644
index 000000000..0294003fc
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/context.py
@@ -0,0 +1,226 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+
+from oeqa.core.context import OETestContext, OETestContextExecutor
+from oeqa.core.target.ssh import OESSHTarget
+from oeqa.core.target.qemu import OEQemuTarget
+from oeqa.utils.dump import HostDumper
+
+from oeqa.runtime.loader import OERuntimeTestLoader
+
+class OERuntimeTestContext(OETestContext):
+ loaderClass = OERuntimeTestLoader
+ runtime_files_dir = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), "files")
+
+ def __init__(self, td, logger, target,
+ host_dumper, image_packages, extract_dir):
+ super(OERuntimeTestContext, self).__init__(td, logger)
+
+ self.target = target
+ self.image_packages = image_packages
+ self.host_dumper = host_dumper
+ self.extract_dir = extract_dir
+ self._set_target_cmds()
+
+ def _set_target_cmds(self):
+ self.target_cmds = {}
+
+ self.target_cmds['ps'] = 'ps'
+ if 'procps' in self.image_packages:
+ self.target_cmds['ps'] = self.target_cmds['ps'] + ' -ef'
+
+class OERuntimeTestContextExecutor(OETestContextExecutor):
+ _context_class = OERuntimeTestContext
+
+ name = 'runtime'
+ help = 'runtime test component'
+ description = 'executes runtime tests over targets'
+
+ default_cases = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+ 'cases')
+ default_data = None
+ default_test_data = 'data/testdata.json'
+ default_tests = ''
+
+ default_target_type = 'simpleremote'
+ default_manifest = 'data/manifest'
+ default_server_ip = '192.168.7.1'
+ default_target_ip = '192.168.7.2'
+ default_host_dumper_dir = '/tmp/oe-saved-tests'
+ default_extract_dir = 'packages/extracted'
+
+ def register_commands(self, logger, subparsers):
+ super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers)
+
+ runtime_group = self.parser.add_argument_group('runtime options')
+
+ runtime_group.add_argument('--target-type', action='store',
+ default=self.default_target_type, choices=['simpleremote', 'qemu'],
+ help="Target type of device under test, default: %s" \
+ % self.default_target_type)
+ runtime_group.add_argument('--target-ip', action='store',
+ default=self.default_target_ip,
+ help="IP address of device under test, default: %s" \
+ % self.default_target_ip)
+ runtime_group.add_argument('--server-ip', action='store',
+ default=self.default_target_ip,
+ help="IP address of device under test, default: %s" \
+ % self.default_server_ip)
+
+ runtime_group.add_argument('--host-dumper-dir', action='store',
+ default=self.default_host_dumper_dir,
+ help="Directory where host status is dumped, if tests fails, default: %s" \
+ % self.default_host_dumper_dir)
+
+ runtime_group.add_argument('--packages-manifest', action='store',
+ default=self.default_manifest,
+ help="Package manifest of the image under testi, default: %s" \
+ % self.default_manifest)
+
+ runtime_group.add_argument('--extract-dir', action='store',
+ default=self.default_extract_dir,
+ help='Directory where extracted packages reside, default: %s' \
+ % self.default_extract_dir)
+
+ runtime_group.add_argument('--qemu-boot', action='store',
+ help="Qemu boot configuration, only needed when target_type is QEMU.")
+
+ @staticmethod
+ def getTarget(target_type, logger, target_ip, server_ip, **kwargs):
+ target = None
+
+ if target_ip:
+ target_ip_port = target_ip.split(':')
+ if len(target_ip_port) == 2:
+ target_ip = target_ip_port[0]
+ kwargs['port'] = target_ip_port[1]
+
+ if target_type == 'simpleremote':
+ target = OESSHTarget(logger, target_ip, server_ip, **kwargs)
+ elif target_type == 'qemu':
+ target = OEQemuTarget(logger, target_ip, server_ip, **kwargs)
+ else:
+ # XXX: This code uses the old naming convention for controllers and
+ # targets, the idea it is to leave just targets as the controller
+ # most of the time was just a wrapper.
+ # XXX: This code tries to import modules from lib/oeqa/controllers
+ # directory and treat them as controllers, it will less error prone
+ # to use introspection to load such modules.
+ # XXX: Don't base your targets on this code it will be refactored
+ # in the near future.
+ # Custom target module loading
+ try:
+ target_modules_path = kwargs.get('target_modules_path', '')
+ controller = OERuntimeTestContextExecutor.getControllerModule(target_type, target_modules_path)
+ target = controller(logger, target_ip, server_ip, **kwargs)
+ except ImportError as e:
+ raise TypeError("Failed to import %s from available controller modules" % target_type)
+
+ return target
+
+ # Search oeqa.controllers module directory for and return a controller
+ # corresponding to the given target name.
+ # AttributeError raised if not found.
+ # ImportError raised if a provided module can not be imported.
+ @staticmethod
+ def getControllerModule(target, target_modules_path):
+ controllerslist = OERuntimeTestContextExecutor._getControllerModulenames(target_modules_path)
+ controller = OERuntimeTestContextExecutor._loadControllerFromName(target, controllerslist)
+ return controller
+
+ # Return a list of all python modules in lib/oeqa/controllers for each
+ # layer in bbpath
+ @staticmethod
+ def _getControllerModulenames(target_modules_path):
+
+ controllerslist = []
+
+ def add_controller_list(path):
+ if not os.path.exists(os.path.join(path, '__init__.py')):
+ raise OSError('Controllers directory %s exists but is missing __init__.py' % path)
+ files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+ for f in files:
+ module = 'oeqa.controllers.' + f[:-3]
+ if module not in controllerslist:
+ controllerslist.append(module)
+ else:
+ raise RuntimeError("Duplicate controller module found for %s. Layers should create unique controller module names" % module)
+
+ extpath = target_modules_path.split(':')
+ for p in extpath:
+ controllerpath = os.path.join(p, 'lib', 'oeqa', 'controllers')
+ if os.path.exists(controllerpath):
+ add_controller_list(controllerpath)
+ return controllerslist
+
+ # Search for and return a controller from given target name and
+ # set of module names.
+ # Raise AttributeError if not found.
+ # Raise ImportError if a provided module can not be imported
+ @staticmethod
+ def _loadControllerFromName(target, modulenames):
+ for name in modulenames:
+ obj = OERuntimeTestContextExecutor._loadControllerFromModule(target, name)
+ if obj:
+ return obj
+ raise AttributeError("Unable to load {0} from available modules: {1}".format(target, str(modulenames)))
+
+ # Search for and return a controller or None from given module name
+ @staticmethod
+ def _loadControllerFromModule(target, modulename):
+ obj = None
+ # import module, allowing it to raise import exception
+ try:
+ module = __import__(modulename, globals(), locals(), [target])
+ except Exception as e:
+ return obj
+ # look for target class in the module, catching any exceptions as it
+ # is valid that a module may not have the target class.
+ try:
+ obj = getattr(module, target)
+ except:
+ obj = None
+ return obj
+
+ @staticmethod
+ def readPackagesManifest(manifest):
+ if not manifest or not os.path.exists(manifest):
+ raise OSError("Manifest file not exists: %s" % manifest)
+
+ image_packages = set()
+ with open(manifest, 'r') as f:
+ for line in f.readlines():
+ line = line.strip()
+ if line and not line.startswith("#"):
+ image_packages.add(line.split()[0])
+
+ return image_packages
+
+ @staticmethod
+ def getHostDumper(cmds, directory):
+ return HostDumper(cmds, directory)
+
+ def _process_args(self, logger, args):
+ if not args.packages_manifest:
+ raise TypeError('Manifest file not provided')
+
+ super(OERuntimeTestContextExecutor, self)._process_args(logger, args)
+
+ target_kwargs = {}
+ target_kwargs['qemuboot'] = args.qemu_boot
+
+ self.tc_kwargs['init']['target'] = \
+ OERuntimeTestContextExecutor.getTarget(args.target_type,
+ None, args.target_ip, args.server_ip, **target_kwargs)
+ self.tc_kwargs['init']['host_dumper'] = \
+ OERuntimeTestContextExecutor.getHostDumper(None,
+ args.host_dumper_dir)
+ self.tc_kwargs['init']['image_packages'] = \
+ OERuntimeTestContextExecutor.readPackagesManifest(
+ args.packages_manifest)
+ self.tc_kwargs['init']['extract_dir'] = args.extract_dir
+
+_executor_class = OERuntimeTestContextExecutor
diff --git a/poky/meta/lib/oeqa/runtime/decorator/package.py b/poky/meta/lib/oeqa/runtime/decorator/package.py
new file mode 100644
index 000000000..aa6ecb68f
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/decorator/package.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.decorator import OETestDecorator, registerDecorator
+from oeqa.core.utils.misc import strToSet
+
+@registerDecorator
+class OEHasPackage(OETestDecorator):
+ """
+ Checks if image has packages (un)installed.
+
+ The argument must be a string, set, or list of packages that must be
+ installed or not present in the image.
+
+ The way to tell a package must not be in an image is using an
+ exclamation point ('!') before the name of the package.
+
+ If test depends on pkg1 or pkg2 you need to use:
+ @OEHasPackage({'pkg1', 'pkg2'})
+
+ If test depends on pkg1 and pkg2 you need to use:
+ @OEHasPackage('pkg1')
+ @OEHasPackage('pkg2')
+
+ If test depends on pkg1 but pkg2 must not be present use:
+ @OEHasPackage({'pkg1', '!pkg2'})
+ """
+
+ attrs = ('need_pkgs',)
+
+ def setUpDecorator(self):
+ need_pkgs = set()
+ unneed_pkgs = set()
+ pkgs = strToSet(self.need_pkgs)
+ for pkg in pkgs:
+ if pkg.startswith('!'):
+ unneed_pkgs.add(pkg[1:])
+ else:
+ need_pkgs.add(pkg)
+
+ if unneed_pkgs:
+ msg = 'Checking if %s is not installed' % ', '.join(unneed_pkgs)
+ self.logger.debug(msg)
+ if not self.case.tc.image_packages.isdisjoint(unneed_pkgs):
+ msg = "Test can't run with %s installed" % ', or'.join(unneed_pkgs)
+ self.case.skipTest(msg)
+
+ if need_pkgs:
+ msg = 'Checking if at least one of %s is installed' % ', '.join(need_pkgs)
+ self.logger.debug(msg)
+ if self.case.tc.image_packages.isdisjoint(need_pkgs):
+ msg = "Test requires %s to be installed" % ', or'.join(need_pkgs)
+ self.case.skipTest(msg)
diff --git a/poky/meta/lib/oeqa/runtime/files/hello.stp b/poky/meta/lib/oeqa/runtime/files/hello.stp
new file mode 100644
index 000000000..367714716
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/hello.stp
@@ -0,0 +1 @@
+probe oneshot { println("hello world") }
diff --git a/poky/meta/lib/oeqa/runtime/files/hellomod.c b/poky/meta/lib/oeqa/runtime/files/hellomod.c
new file mode 100644
index 000000000..a383397e9
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/hellomod.c
@@ -0,0 +1,19 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+static int __init hello_init(void)
+{
+ printk(KERN_INFO "Hello world!\n");
+ return 0;
+}
+
+static void __exit hello_cleanup(void)
+{
+ printk(KERN_INFO "Cleaning up hellomod.\n");
+}
+
+module_init(hello_init);
+module_exit(hello_cleanup);
+
+MODULE_LICENSE("GPL");
diff --git a/poky/meta/lib/oeqa/runtime/files/hellomod_makefile b/poky/meta/lib/oeqa/runtime/files/hellomod_makefile
new file mode 100644
index 000000000..b92d5c8fe
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/hellomod_makefile
@@ -0,0 +1,8 @@
+obj-m := hellomod.o
+KDIR := /usr/src/kernel
+
+all:
+ $(MAKE) -C $(KDIR) M=$(PWD) modules
+
+clean:
+ $(MAKE) -C $(KDIR) M=$(PWD) clean
diff --git a/poky/meta/lib/oeqa/runtime/files/testmakefile b/poky/meta/lib/oeqa/runtime/files/testmakefile
new file mode 100644
index 000000000..ca1844e93
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/files/testmakefile
@@ -0,0 +1,5 @@
+test: test.o
+ gcc -o test test.o -lm
+test.o: test.c
+ gcc -c test.c
+
diff --git a/poky/meta/lib/oeqa/runtime/loader.py b/poky/meta/lib/oeqa/runtime/loader.py
new file mode 100644
index 000000000..041ef976e
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/loader.py
@@ -0,0 +1,16 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.loader import OETestLoader
+from oeqa.runtime.case import OERuntimeTestCase
+
+class OERuntimeTestLoader(OETestLoader):
+ caseClass = OERuntimeTestCase
+
+ def _getTestCase(self, testCaseClass, tcName):
+ case = super(OERuntimeTestLoader, self)._getTestCase(testCaseClass, tcName)
+
+ # Adds custom attributes to the OERuntimeTestCase
+ setattr(case, 'target', self.tc.target)
+
+ return case
diff --git a/poky/meta/lib/oeqa/runtime/utils/__init__.py b/poky/meta/lib/oeqa/runtime/utils/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/utils/__init__.py
diff --git a/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py b/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py
new file mode 100644
index 000000000..5af55d736
--- /dev/null
+++ b/poky/meta/lib/oeqa/runtime/utils/targetbuildproject.py
@@ -0,0 +1,39 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.utils.buildproject import BuildProject
+
+class TargetBuildProject(BuildProject):
+
+ def __init__(self, target, uri, foldername=None, dl_dir=None):
+ self.target = target
+ self.targetdir = "~/"
+ BuildProject.__init__(self, uri, foldername, dl_dir=dl_dir)
+
+ def download_archive(self):
+ self._download_archive()
+
+ status, output = self.target.copyTo(self.localarchive, self.targetdir)
+ if status:
+ raise Exception('Failed to copy archive to target, '
+ 'output: %s' % output)
+
+ cmd = 'tar xf %s%s -C %s' % (self.targetdir,
+ self.archive,
+ self.targetdir)
+ status, output = self.target.run(cmd)
+ if status:
+ raise Exception('Failed to extract archive, '
+ 'output: %s' % output)
+
+ # Change targetdir to project folder
+ self.targetdir = self.targetdir + self.fname
+
+ # The timeout parameter of target.run is set to 0
+ # to make the ssh command run with no timeout.
+ def _run(self, cmd):
+ ret = self.target.run(cmd, 0)
+ msg = "Command %s failed with exit code %s: %s" % (cmd, ret[0], ret[1])
+ if ret[0] != 0:
+ raise Exception(msg)
+ return ret[0]
diff --git a/poky/meta/lib/oeqa/sdk/__init__.py b/poky/meta/lib/oeqa/sdk/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/__init__.py
diff --git a/poky/meta/lib/oeqa/sdk/case.py b/poky/meta/lib/oeqa/sdk/case.py
new file mode 100644
index 000000000..963aa8d35
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/case.py
@@ -0,0 +1,12 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import subprocess
+
+from oeqa.core.case import OETestCase
+
+class OESDKTestCase(OETestCase):
+ def _run(self, cmd):
+ return subprocess.check_output(". %s > /dev/null; %s;" % \
+ (self.tc.sdk_env, cmd), shell=True,
+ stderr=subprocess.STDOUT, universal_newlines=True)
diff --git a/poky/meta/lib/oeqa/sdk/cases/buildcpio.py b/poky/meta/lib/oeqa/sdk/cases/buildcpio.py
new file mode 100644
index 000000000..333dc7c22
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/buildcpio.py
@@ -0,0 +1,33 @@
+import unittest
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+class BuildCpioTest(OESDKTestCase):
+ td_vars = ['DATETIME']
+
+ @classmethod
+ def setUpClass(self):
+ dl_dir = self.td.get('DL_DIR', None)
+
+ self.project = SDKBuildProject(self.tc.sdk_dir + "/cpio/", self.tc.sdk_env,
+ "https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz",
+ self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+ self.project.download_archive()
+
+ machine = self.td.get("MACHINE")
+ if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
+ raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
+
+ def test_cpio(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ self.assertEqual(self.project.run_install(), 0,
+ msg="Running make install failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py b/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
new file mode 100644
index 000000000..780afccc7
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -0,0 +1,35 @@
+import unittest
+
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+class GalculatorTest(OESDKTestCase):
+ td_vars = ['DATETIME']
+
+ @classmethod
+ def setUpClass(self):
+ if not (self.tc.hasTargetPackage("gtk\+3") or\
+ self.tc.hasTargetPackage("libgtk-3.0")):
+ raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
+
+ def test_galculator(self):
+ dl_dir = self.td.get('DL_DIR', None)
+ project = None
+ try:
+ project = SDKBuildProject(self.tc.sdk_dir + "/galculator/",
+ self.tc.sdk_env,
+ "http://galculator.mnim.org/downloads/galculator-2.1.4.tar.bz2",
+ self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+
+ project.download_archive()
+
+ # regenerate configure to get support for --with-libtool-sysroot
+ legacy_preconf=("autoreconf -i -f -I ${OECORE_TARGET_SYSROOT}/usr/share/aclocal -I m4;")
+
+ self.assertEqual(project.run_configure(extra_cmds=legacy_preconf),
+ 0, msg="Running configure failed")
+
+ self.assertEqual(project.run_make(), 0,
+ msg="Running make failed")
+ finally:
+ project.clean()
diff --git a/poky/meta/lib/oeqa/sdk/cases/buildlzip.py b/poky/meta/lib/oeqa/sdk/cases/buildlzip.py
new file mode 100644
index 000000000..3a89ce862
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -0,0 +1,36 @@
+import unittest
+from oeqa.sdk.case import OESDKTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+
+
+class BuildLzipTest(OESDKTestCase):
+ td_vars = ['DATETIME']
+
+ @classmethod
+ def setUpClass(self):
+ dl_dir = self.td.get('DL_DIR', None)
+
+ self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", self.tc.sdk_env,
+ "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz",
+ self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
+ self.project.download_archive()
+
+ machine = self.td.get("MACHINE")
+
+ if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
+ self.tc.hasTargetPackage("gcc")):
+ raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain")
+
+ def test_lzip(self):
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+
+ self.assertEqual(self.project.run_install(), 0,
+ msg="Running make install failed")
+
+ @classmethod
+ def tearDownClass(self):
+ self.project.clean()
diff --git a/poky/meta/lib/oeqa/sdk/cases/gcc.py b/poky/meta/lib/oeqa/sdk/cases/gcc.py
new file mode 100644
index 000000000..d11f4b63f
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/gcc.py
@@ -0,0 +1,43 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class GccCompileTest(OESDKTestCase):
+ td_vars = ['MACHINE']
+
+ @classmethod
+ def setUpClass(self):
+ files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir,
+ 'testsdkmakefile' : self.tc.sdk_files_dir}
+ for f in files:
+ shutil.copyfile(os.path.join(files[f], f),
+ os.path.join(self.tc.sdk_dir, f))
+
+ def setUp(self):
+ machine = self.td.get("MACHINE")
+ if not (self.tc.hasTargetPackage("packagegroup-cross-canadian-%s" % machine) or
+ self.tc.hasTargetPackage("gcc")):
+ raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
+
+ def test_gcc_compile(self):
+ self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+ def test_gpp_compile(self):
+ self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+ def test_gpp2_compile(self):
+ self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
+
+ def test_make(self):
+ self._run('cd %s; make -f testsdkmakefile' % self.tc.sdk_dir)
+
+ @classmethod
+ def tearDownClass(self):
+ files = [os.path.join(self.tc.sdk_dir, f) \
+ for f in ['test.c', 'test.cpp', 'test.o', 'test',
+ 'testsdkmakefile']]
+ for f in files:
+ remove_safe(f)
diff --git a/poky/meta/lib/oeqa/sdk/cases/perl.py b/poky/meta/lib/oeqa/sdk/cases/perl.py
new file mode 100644
index 000000000..808567811
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/perl.py
@@ -0,0 +1,28 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class PerlTest(OESDKTestCase):
+ @classmethod
+ def setUpClass(self):
+ if not (self.tc.hasHostPackage("nativesdk-perl") or
+ self.tc.hasHostPackage("perl-native")):
+ raise unittest.SkipTest("No perl package in the SDK")
+
+ for f in ['test.pl']:
+ shutil.copyfile(os.path.join(self.tc.files_dir, f),
+ os.path.join(self.tc.sdk_dir, f))
+ self.testfile = os.path.join(self.tc.sdk_dir, "test.pl")
+
+ def test_perl_exists(self):
+ self._run('which perl')
+
+ def test_perl_works(self):
+ self._run('perl %s' % self.testfile)
+
+ @classmethod
+ def tearDownClass(self):
+ remove_safe(self.testfile)
diff --git a/poky/meta/lib/oeqa/sdk/cases/python.py b/poky/meta/lib/oeqa/sdk/cases/python.py
new file mode 100644
index 000000000..72dfcc72b
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/cases/python.py
@@ -0,0 +1,32 @@
+import os
+import shutil
+import unittest
+
+from oeqa.core.utils.path import remove_safe
+from oeqa.sdk.case import OESDKTestCase
+
+class PythonTest(OESDKTestCase):
+ @classmethod
+ def setUpClass(self):
+ if not (self.tc.hasHostPackage("nativesdk-python") or
+ self.tc.hasHostPackage("python-native")):
+ raise unittest.SkipTest("No python package in the SDK")
+
+ for f in ['test.py']:
+ shutil.copyfile(os.path.join(self.tc.files_dir, f),
+ os.path.join(self.tc.sdk_dir, f))
+
+ def test_python_exists(self):
+ self._run('which python')
+
+ def test_python_stdout(self):
+ output = self._run('python %s/test.py' % self.tc.sdk_dir)
+ self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+ def test_python_testfile(self):
+ self._run('ls /tmp/testfile.python')
+
+ @classmethod
+ def tearDownClass(self):
+ remove_safe("%s/test.py" % self.tc.sdk_dir)
+ remove_safe("/tmp/testfile.python")
diff --git a/poky/meta/lib/oeqa/sdk/context.py b/poky/meta/lib/oeqa/sdk/context.py
new file mode 100644
index 000000000..b3d7c7518
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/context.py
@@ -0,0 +1,134 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import glob
+import re
+
+from oeqa.core.context import OETestContextExecutor
+from oeqa.core.threaded import OETestContextThreaded
+
+class OESDKTestContext(OETestContextThreaded):
+ sdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+
+ def __init__(self, td=None, logger=None, sdk_dir=None, sdk_env=None,
+ target_pkg_manifest=None, host_pkg_manifest=None):
+ super(OESDKTestContext, self).__init__(td, logger)
+
+ self.sdk_dir = sdk_dir
+ self.sdk_env = sdk_env
+ self.target_pkg_manifest = target_pkg_manifest
+ self.host_pkg_manifest = host_pkg_manifest
+
+ def _hasPackage(self, manifest, pkg):
+ for host_pkg in manifest.keys():
+ if re.search(pkg, host_pkg):
+ return True
+ return False
+
+ def hasHostPackage(self, pkg):
+ return self._hasPackage(self.host_pkg_manifest, pkg)
+
+ def hasTargetPackage(self, pkg):
+ return self._hasPackage(self.target_pkg_manifest, pkg)
+
+class OESDKTestContextExecutor(OETestContextExecutor):
+ _context_class = OESDKTestContext
+
+ name = 'sdk'
+ help = 'sdk test component'
+ description = 'executes sdk tests'
+
+ default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+ 'cases')]
+ default_test_data = None
+
+ def register_commands(self, logger, subparsers):
+ super(OESDKTestContextExecutor, self).register_commands(logger, subparsers)
+
+ sdk_group = self.parser.add_argument_group('sdk options')
+ sdk_group.add_argument('--sdk-env', action='store',
+ help='sdk environment')
+ sdk_group.add_argument('--target-manifest', action='store',
+ help='sdk target manifest')
+ sdk_group.add_argument('--host-manifest', action='store',
+ help='sdk host manifest')
+
+ sdk_dgroup = self.parser.add_argument_group('sdk display options')
+ sdk_dgroup.add_argument('--list-sdk-env', action='store_true',
+ default=False, help='sdk list available environment')
+
+ # XXX this option is required but argparse_oe has a bug handling
+ # required options, seems that don't keep track of already parsed
+ # options
+ sdk_rgroup = self.parser.add_argument_group('sdk required options')
+ sdk_rgroup.add_argument('--sdk-dir', required=False, action='store',
+ help='sdk installed directory')
+
+ @staticmethod
+ def _load_manifest(manifest):
+ pkg_manifest = {}
+ if manifest:
+ with open(manifest) as f:
+ for line in f:
+ (pkg, arch, version) = line.strip().split()
+ pkg_manifest[pkg] = (version, arch)
+
+ return pkg_manifest
+
+ def _process_args(self, logger, args):
+ super(OESDKTestContextExecutor, self)._process_args(logger, args)
+
+ self.tc_kwargs['init']['sdk_dir'] = args.sdk_dir
+ self.tc_kwargs['init']['sdk_env'] = self.sdk_env
+ self.tc_kwargs['init']['target_pkg_manifest'] = \
+ OESDKTestContextExecutor._load_manifest(args.target_manifest)
+ self.tc_kwargs['init']['host_pkg_manifest'] = \
+ OESDKTestContextExecutor._load_manifest(args.host_manifest)
+
+ @staticmethod
+ def _get_sdk_environs(sdk_dir):
+ sdk_env = {}
+
+ environ_pattern = sdk_dir + '/environment-setup-*'
+ full_sdk_env = glob.glob(sdk_dir + '/environment-setup-*')
+ for env in full_sdk_env:
+ m = re.search('environment-setup-(.*)', env)
+ if m:
+ sdk_env[m.group(1)] = env
+
+ return sdk_env
+
+ def _display_sdk_envs(self, log, args, sdk_envs):
+ log("Available SDK environments at directory %s:" \
+ % args.sdk_dir)
+ log("")
+ for env in sdk_envs:
+ log(env)
+
+ def run(self, logger, args):
+ import argparse_oe
+
+ if not args.sdk_dir:
+ raise argparse_oe.ArgumentUsageError("No SDK directory "\
+ "specified please do, --sdk-dir SDK_DIR", self.name)
+
+ sdk_envs = OESDKTestContextExecutor._get_sdk_environs(args.sdk_dir)
+ if not sdk_envs:
+ raise argparse_oe.ArgumentUsageError("No available SDK "\
+ "enviroments found at %s" % args.sdk_dir, self.name)
+
+ if args.list_sdk_env:
+ self._display_sdk_envs(logger.info, args, sdk_envs)
+ sys.exit(0)
+
+ if not args.sdk_env in sdk_envs:
+ self._display_sdk_envs(logger.error, args, sdk_envs)
+ raise argparse_oe.ArgumentUsageError("No valid SDK "\
+ "environment (%s) specified" % args.sdk_env, self.name)
+
+ self.sdk_env = sdk_envs[args.sdk_env]
+ return super(OESDKTestContextExecutor, self).run(logger, args)
+
+_executor_class = OESDKTestContextExecutor
diff --git a/poky/meta/lib/oeqa/sdk/files/testsdkmakefile b/poky/meta/lib/oeqa/sdk/files/testsdkmakefile
new file mode 100644
index 000000000..fb05f822f
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/files/testsdkmakefile
@@ -0,0 +1,5 @@
+test: test.o
+ $(CC) -o test test.o -lm
+test.o: test.c
+ $(CC) -c test.c
+
diff --git a/poky/meta/lib/oeqa/sdk/utils/__init__.py b/poky/meta/lib/oeqa/sdk/utils/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/utils/__init__.py
diff --git a/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py b/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
new file mode 100644
index 000000000..4e251142d
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdk/utils/sdkbuildproject.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import subprocess
+
+from oeqa.utils.buildproject import BuildProject
+
+class SDKBuildProject(BuildProject):
+ def __init__(self, testpath, sdkenv, uri, testlogdir, builddatetime,
+ foldername=None, dl_dir=None):
+ self.sdkenv = sdkenv
+ self.testdir = testpath
+ self.targetdir = testpath
+ os.makedirs(testpath, exist_ok=True)
+ self.datetime = builddatetime
+ self.testlogdir = testlogdir
+ os.makedirs(self.testlogdir, exist_ok=True)
+ self.logfile = os.path.join(self.testlogdir, "sdk_target_log.%s" % self.datetime)
+ BuildProject.__init__(self, uri, foldername, tmpdir=testpath, dl_dir=dl_dir)
+
+ def download_archive(self):
+
+ self._download_archive()
+
+ cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
+ subprocess.check_output(cmd, shell=True)
+
+ #Change targetdir to project folder
+ self.targetdir = os.path.join(self.targetdir, self.fname)
+
+ def run_configure(self, configure_args='', extra_cmds=''):
+ return super(SDKBuildProject, self).run_configure(configure_args=(configure_args or '$CONFIGURE_FLAGS'), extra_cmds=extra_cmds)
+
+ def run_install(self, install_args=''):
+ return super(SDKBuildProject, self).run_install(install_args=(install_args or "DESTDIR=%s/../install" % self.targetdir))
+
+ def log(self, msg):
+ if self.logfile:
+ with open(self.logfile, "a") as f:
+ f.write("%s\n" % msg)
+
+ def _run(self, cmd):
+ self.log("Running . %s; " % self.sdkenv + cmd)
+ return subprocess.call(". %s; " % self.sdkenv + cmd, shell=True)
diff --git a/poky/meta/lib/oeqa/sdkext/__init__.py b/poky/meta/lib/oeqa/sdkext/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/__init__.py
diff --git a/poky/meta/lib/oeqa/sdkext/case.py b/poky/meta/lib/oeqa/sdkext/case.py
new file mode 100644
index 000000000..21b718831
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/case.py
@@ -0,0 +1,21 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import subprocess
+
+from oeqa.utils import avoid_paths_in_environ
+from oeqa.sdk.case import OESDKTestCase
+
+class OESDKExtTestCase(OESDKTestCase):
+ def _run(self, cmd):
+ # extensible sdk shows a warning if found bitbake in the path
+ # because can cause contamination, i.e. use devtool from
+ # poky/scripts instead of eSDK one.
+ env = os.environ.copy()
+ paths_to_avoid = ['bitbake/bin', 'poky/scripts']
+ env['PATH'] = avoid_paths_in_environ(paths_to_avoid)
+
+ return subprocess.check_output(". %s > /dev/null;"\
+ " %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT,
+ shell=True, env=env, universal_newlines=True)
diff --git a/poky/meta/lib/oeqa/sdkext/cases/devtool.py b/poky/meta/lib/oeqa/sdkext/cases/devtool.py
new file mode 100644
index 000000000..ea9051710
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -0,0 +1,129 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import shutil
+import subprocess
+
+from oeqa.sdkext.case import OESDKExtTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.httpserver import HTTPService
+
+class DevtoolTest(OESDKExtTestCase):
+ @classmethod
+ def setUpClass(cls):
+ myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp")
+ cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp")
+ shutil.copytree(myapp_src, cls.myapp_dst)
+
+ myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake")
+ cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake")
+ shutil.copytree(myapp_cmake_src, cls.myapp_cmake_dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.myapp_dst)
+ shutil.rmtree(cls.myapp_cmake_dst)
+
+ def _test_devtool_build(self, directory):
+ self._run('devtool add myapp %s' % directory)
+ try:
+ self._run('devtool build myapp')
+ finally:
+ self._run('devtool reset myapp')
+
+ def _test_devtool_build_package(self, directory):
+ self._run('devtool add myapp %s' % directory)
+ try:
+ self._run('devtool package myapp')
+ finally:
+ self._run('devtool reset myapp')
+
+ def test_devtool_location(self):
+ output = self._run('which devtool')
+ self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
+ msg="Seems that devtool isn't the eSDK one: %s" % output)
+
+ @OETestDepends(['test_devtool_location'])
+ def test_devtool_add_reset(self):
+ self._run('devtool add myapp %s' % self.myapp_dst)
+ self._run('devtool reset myapp')
+
+ @OETestID(1605)
+ @OETestDepends(['test_devtool_location'])
+ def test_devtool_build_make(self):
+ self._test_devtool_build(self.myapp_dst)
+
+ @OETestID(1606)
+ @OETestDepends(['test_devtool_location'])
+ def test_devtool_build_esdk_package(self):
+ self._test_devtool_build_package(self.myapp_dst)
+
+ @OETestID(1607)
+ @OETestDepends(['test_devtool_location'])
+ def test_devtool_build_cmake(self):
+ self._test_devtool_build(self.myapp_cmake_dst)
+
+ @OETestID(1608)
+ @OETestDepends(['test_devtool_location'])
+ def test_extend_autotools_recipe_creation(self):
+ req = 'https://github.com/rdfa/librdfa'
+ recipe = "librdfa"
+ self._run('devtool sdk-install libxml2')
+ self._run('devtool add %s %s' % (recipe, req) )
+ try:
+ self._run('devtool build %s' % recipe)
+ finally:
+ self._run('devtool reset %s' % recipe)
+
+ @OETestID(1609)
+ @OETestDepends(['test_devtool_location'])
+ def test_devtool_kernelmodule(self):
+ docfile = 'https://github.com/umlaeute/v4l2loopback.git'
+ recipe = 'v4l2loopback-driver'
+ self._run('devtool add %s %s' % (recipe, docfile) )
+ try:
+ self._run('devtool build %s' % recipe)
+ finally:
+ self._run('devtool reset %s' % recipe)
+
+ @OETestID(1610)
+ @OETestDepends(['test_devtool_location'])
+ def test_recipes_for_nodejs(self):
+ package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
+ self._run('devtool add %s ' % package_nodejs)
+ try:
+ self._run('devtool build %s ' % package_nodejs)
+ finally:
+ self._run('devtool reset %s '% package_nodejs)
+
+class SdkUpdateTest(OESDKExtTestCase):
+ @classmethod
+ def setUpClass(self):
+ self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish')
+ if os.path.exists(self.publish_dir):
+ shutil.rmtree(self.publish_dir)
+ os.mkdir(self.publish_dir)
+
+ base_tcname = "%s/%s" % (self.td.get("SDK_DEPLOY", ''),
+ self.td.get("TOOLCHAINEXT_OUTPUTNAME", ''))
+ tcname_new = "%s-new.sh" % base_tcname
+ if not os.path.exists(tcname_new):
+ tcname_new = "%s.sh" % base_tcname
+
+ cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir)
+ subprocess.check_output(cmd, shell=True)
+
+ self.http_service = HTTPService(self.publish_dir)
+ self.http_service.start()
+
+ self.http_url = "http://127.0.0.1:%d" % self.http_service.port
+
+ def test_sdk_update_http(self):
+ output = self._run("devtool sdk-update \"%s\"" % self.http_url)
+
+ @classmethod
+ def tearDownClass(self):
+ self.http_service.stop()
+ shutil.rmtree(self.publish_dir)
diff --git a/poky/meta/lib/oeqa/sdkext/context.py b/poky/meta/lib/oeqa/sdkext/context.py
new file mode 100644
index 000000000..65da4c6e1
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/context.py
@@ -0,0 +1,29 @@
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+from oeqa.sdk.context import OESDKTestContext, OESDKTestContextExecutor
+
+class OESDKExtTestContext(OESDKTestContext):
+ esdk_files_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "files")
+
+ # FIXME - We really need to do better mapping of names here, this at
+ # least allows some tests to run
+ def hasHostPackage(self, pkg):
+ # We force a toolchain to be installed into the eSDK even if its minimal
+ if pkg.startswith("packagegroup-cross-canadian-"):
+ return True
+ return self._hasPackage(self.host_pkg_manifest, pkg)
+
+class OESDKExtTestContextExecutor(OESDKTestContextExecutor):
+ _context_class = OESDKExtTestContext
+
+ name = 'esdk'
+ help = 'esdk test component'
+ description = 'executes esdk tests'
+
+ default_cases = OESDKTestContextExecutor.default_cases + \
+ [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases')]
+ default_test_data = None
+
+_executor_class = OESDKExtTestContextExecutor
diff --git a/poky/meta/lib/oeqa/sdkext/files/myapp/Makefile b/poky/meta/lib/oeqa/sdkext/files/myapp/Makefile
new file mode 100644
index 000000000..abd91bea6
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/files/myapp/Makefile
@@ -0,0 +1,10 @@
+all: myapp
+
+myapp: myapp.o
+ $(CC) $(LDFLAGS) $< -o $@
+
+myapp.o: myapp.c
+ $(CC) $(CFLAGS) -c $< -o $@
+
+clean:
+ rm -rf myapp.o myapp
diff --git a/poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c b/poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c
new file mode 100644
index 000000000..f0b63f03f
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/files/myapp/myapp.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ printf("Hello world\n");
+
+ return 0;
+}
diff --git a/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt b/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt
new file mode 100644
index 000000000..19d773dd6
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required (VERSION 2.6)
+project (myapp)
+# The version number.
+set (myapp_VERSION_MAJOR 1)
+set (myapp_VERSION_MINOR 0)
+
+# add the executable
+add_executable (myapp myapp.c)
+
+install(TARGETS myapp
+ RUNTIME DESTINATION bin)
diff --git a/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c b/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c
new file mode 100644
index 000000000..f0b63f03f
--- /dev/null
+++ b/poky/meta/lib/oeqa/sdkext/files/myapp_cmake/myapp.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+ printf("Hello world\n");
+
+ return 0;
+}
diff --git a/poky/meta/lib/oeqa/selftest/case.py b/poky/meta/lib/oeqa/selftest/case.py
new file mode 100644
index 000000000..e09915b49
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/case.py
@@ -0,0 +1,278 @@
+# Copyright (C) 2013-2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import sys
+import os
+import shutil
+import glob
+import errno
+from unittest.util import safe_repr
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.core.case import OETestCase
+
+class OESelftestTestCase(OETestCase):
+ def __init__(self, methodName="runTest"):
+ self._extra_tear_down_commands = []
+ super(OESelftestTestCase, self).__init__(methodName)
+
+ @classmethod
+ def setUpClass(cls):
+ super(OESelftestTestCase, cls).setUpClass()
+
+ cls.testlayer_path = cls.tc.config_paths['testlayer_path']
+ cls.builddir = cls.tc.config_paths['builddir']
+
+ cls.localconf_path = cls.tc.config_paths['localconf']
+ cls.localconf_backup = cls.tc.config_paths['localconf_class_backup']
+ cls.local_bblayers_path = cls.tc.config_paths['bblayers']
+ cls.local_bblayers_backup = cls.tc.config_paths['bblayers_class_backup']
+
+ cls.testinc_path = os.path.join(cls.tc.config_paths['builddir'],
+ "conf/selftest.inc")
+ cls.testinc_bblayers_path = os.path.join(cls.tc.config_paths['builddir'],
+ "conf/bblayers.inc")
+ cls.machineinc_path = os.path.join(cls.tc.config_paths['builddir'],
+ "conf/machine.inc")
+
+ cls._track_for_cleanup = [
+ cls.testinc_path, cls.testinc_bblayers_path,
+ cls.machineinc_path, cls.localconf_backup,
+ cls.local_bblayers_backup]
+
+ cls.add_include()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.remove_include()
+ cls.remove_inc_files()
+ super(OESelftestTestCase, cls).tearDownClass()
+
+ @classmethod
+ def add_include(cls):
+ if "#include added by oe-selftest" \
+ not in ftools.read_file(os.path.join(cls.builddir, "conf/local.conf")):
+ cls.logger.info("Adding: \"include selftest.inc\" in %s" % os.path.join(cls.builddir, "conf/local.conf"))
+ ftools.append_file(os.path.join(cls.builddir, "conf/local.conf"), \
+ "\n#include added by oe-selftest\ninclude machine.inc\ninclude selftest.inc")
+
+ if "#include added by oe-selftest" \
+ not in ftools.read_file(os.path.join(cls.builddir, "conf/bblayers.conf")):
+ cls.logger.info("Adding: \"include bblayers.inc\" in bblayers.conf")
+ ftools.append_file(os.path.join(cls.builddir, "conf/bblayers.conf"), \
+ "\n#include added by oe-selftest\ninclude bblayers.inc")
+
+ @classmethod
+ def remove_include(cls):
+ if "#include added by oe-selftest.py" \
+ in ftools.read_file(os.path.join(cls.builddir, "conf/local.conf")):
+ cls.logger.info("Removing the include from local.conf")
+ ftools.remove_from_file(os.path.join(cls.builddir, "conf/local.conf"), \
+ "\n#include added by oe-selftest.py\ninclude machine.inc\ninclude selftest.inc")
+
+ if "#include added by oe-selftest.py" \
+ in ftools.read_file(os.path.join(cls.builddir, "conf/bblayers.conf")):
+ cls.logger.info("Removing the include from bblayers.conf")
+ ftools.remove_from_file(os.path.join(cls.builddir, "conf/bblayers.conf"), \
+ "\n#include added by oe-selftest.py\ninclude bblayers.inc")
+
+ @classmethod
+ def remove_inc_files(cls):
+ try:
+ os.remove(os.path.join(cls.builddir, "conf/selftest.inc"))
+ for root, _, files in os.walk(cls.testlayer_path):
+ for f in files:
+ if f == 'test_recipe.inc':
+ os.remove(os.path.join(root, f))
+ except OSError as e:
+ pass
+
+ for incl_file in ['conf/bblayers.inc', 'conf/machine.inc']:
+ try:
+ os.remove(os.path.join(cls.builddir, incl_file))
+ except:
+ pass
+
+ def setUp(self):
+ super(OESelftestTestCase, self).setUp()
+ os.chdir(self.builddir)
+ # Check if local.conf or bblayers.conf files backup exists
+ # from a previous failed test and restore them
+ if os.path.isfile(self.localconf_backup) or os.path.isfile(
+ self.local_bblayers_backup):
+ self.logger.debug("\
+Found a local.conf and/or bblayers.conf backup from a previously aborted test.\
+Restoring these files now, but tests should be re-executed from a clean environment\
+to ensure accurate results.")
+ try:
+ shutil.copyfile(self.localconf_backup, self.localconf_path)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ try:
+ shutil.copyfile(self.local_bblayers_backup,
+ self.local_bblayers_path)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ else:
+ # backup local.conf and bblayers.conf
+ shutil.copyfile(self.localconf_path, self.localconf_backup)
+ shutil.copyfile(self.local_bblayers_path, self.local_bblayers_backup)
+ self.logger.debug("Creating local.conf and bblayers.conf backups.")
+ # we don't know what the previous test left around in config or inc files
+ # if it failed so we need a fresh start
+ try:
+ os.remove(self.testinc_path)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ for root, _, files in os.walk(self.testlayer_path):
+ for f in files:
+ if f == 'test_recipe.inc':
+ os.remove(os.path.join(root, f))
+
+ for incl_file in [self.testinc_bblayers_path, self.machineinc_path]:
+ try:
+ os.remove(incl_file)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+
+ if self.tc.custommachine:
+ machine_conf = 'MACHINE ??= "%s"\n' % self.tc.custommachine
+ self.set_machine_config(machine_conf)
+
+ # tests might need their own setup
+ # but if they overwrite this one they have to call
+ # super each time, so let's give them an alternative
+ self.setUpLocal()
+
+ def setUpLocal(self):
+ pass
+
+ def tearDown(self):
+ if self._extra_tear_down_commands:
+ failed_extra_commands = []
+ for command in self._extra_tear_down_commands:
+ result = runCmd(command, ignore_status=True)
+ if not result.status == 0:
+ failed_extra_commands.append(command)
+ if failed_extra_commands:
+ self.logger.warning("tearDown commands have failed: %s" % ', '.join(map(str, failed_extra_commands)))
+ self.logger.debug("Trying to move on.")
+ self._extra_tear_down_commands = []
+
+ if self._track_for_cleanup:
+ for path in self._track_for_cleanup:
+ if os.path.isdir(path):
+ shutil.rmtree(path)
+ if os.path.isfile(path):
+ os.remove(path)
+ self._track_for_cleanup = []
+
+ self.tearDownLocal()
+ super(OESelftestTestCase, self).tearDown()
+
+ def tearDownLocal(self):
+ pass
+
+ def add_command_to_tearDown(self, command):
+ """Add test specific commands to the tearDown method"""
+ self.logger.debug("Adding command '%s' to tearDown for this test." % command)
+ self._extra_tear_down_commands.append(command)
+
+ def track_for_cleanup(self, path):
+ """Add test specific files or directories to be removed in the tearDown method"""
+ self.logger.debug("Adding path '%s' to be cleaned up when test is over" % path)
+ self._track_for_cleanup.append(path)
+
+ def write_config(self, data):
+ """Write to <builddir>/conf/selftest.inc"""
+
+ self.logger.debug("Writing to: %s\n%s\n" % (self.testinc_path, data))
+ ftools.write_file(self.testinc_path, data)
+
+ if self.tc.custommachine and 'MACHINE' in data:
+ machine = get_bb_var('MACHINE')
+ self.logger.warning('MACHINE overridden: %s' % machine)
+
+ def append_config(self, data):
+ """Append to <builddir>/conf/selftest.inc"""
+ self.logger.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
+ ftools.append_file(self.testinc_path, data)
+
+ if self.tc.custommachine and 'MACHINE' in data:
+ machine = get_bb_var('MACHINE')
+ self.logger.warning('MACHINE overridden: %s' % machine)
+
+ def remove_config(self, data):
+ """Remove data from <builddir>/conf/selftest.inc"""
+ self.logger.debug("Removing from: %s\n%s\n" % (self.testinc_path, data))
+ ftools.remove_from_file(self.testinc_path, data)
+
+ def recipeinc(self, recipe):
+ """Return absolute path of meta-sefltest/recipes-test/<recipe>/test_recipe.inc"""
+ return os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+
+ def write_recipeinc(self, recipe, data):
+ """Write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc"""
+ inc_file = self.recipeinc(recipe)
+ self.logger.debug("Writing to: %s\n%s\n" % (inc_file, data))
+ ftools.write_file(inc_file, data)
+ return inc_file
+
+ def append_recipeinc(self, recipe, data):
+ """Append data to meta-sefltest/recipes-test/<recipe>/test_recipe.inc"""
+ inc_file = self.recipeinc(recipe)
+ self.logger.debug("Appending to: %s\n%s\n" % (inc_file, data))
+ ftools.append_file(inc_file, data)
+ return inc_file
+
+ def remove_recipeinc(self, recipe, data):
+ """Remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc"""
+ inc_file = self.recipeinc(recipe)
+ self.logger.debug("Removing from: %s\n%s\n" % (inc_file, data))
+ ftools.remove_from_file(inc_file, data)
+
+ def delete_recipeinc(self, recipe):
+ """Delete meta-sefltest/recipes-test/<recipe>/test_recipe.inc file"""
+ inc_file = self.recipeinc(recipe)
+ self.logger.debug("Deleting file: %s" % inc_file)
+ try:
+ os.remove(inc_file)
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+ def write_bblayers_config(self, data):
+ """Write to <builddir>/conf/bblayers.inc"""
+ self.logger.debug("Writing to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.write_file(self.testinc_bblayers_path, data)
+
+ def append_bblayers_config(self, data):
+ """Append to <builddir>/conf/bblayers.inc"""
+ self.logger.debug("Appending to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.append_file(self.testinc_bblayers_path, data)
+
+ def remove_bblayers_config(self, data):
+ """Remove data from <builddir>/conf/bblayers.inc"""
+ self.logger.debug("Removing from: %s\n%s\n" % (self.testinc_bblayers_path, data))
+ ftools.remove_from_file(self.testinc_bblayers_path, data)
+
+ def set_machine_config(self, data):
+ """Write to <builddir>/conf/machine.inc"""
+ self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data))
+ ftools.write_file(self.machineinc_path, data)
+
+ # check does path exist
+ def assertExists(self, expr, msg=None):
+ if not os.path.exists(expr):
+ msg = self._formatMessage(msg, "%s does not exist" % safe_repr(expr))
+ raise self.failureException(msg)
+
+ # check does path not exist
+ def assertNotExists(self, expr, msg=None):
+ if os.path.exists(expr):
+ msg = self._formatMessage(msg, "%s exists when it should not" % safe_repr(expr))
+ raise self.failureException(msg)
diff --git a/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py b/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
new file mode 100644
index 000000000..0e5896234
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/_sstatetests_noauto.py
@@ -0,0 +1,92 @@
+import os
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.cases.sstate import SStateBase
+
+
+class RebuildFromSState(SStateBase):
+
+ @classmethod
+ def setUpClass(self):
+ super(RebuildFromSState, self).setUpClass()
+ self.builddir = os.path.join(os.environ.get('BUILDDIR'))
+
+ def get_dep_targets(self, primary_targets):
+ found_targets = []
+ bitbake("-g " + ' '.join(map(str, primary_targets)))
+ with open(os.path.join(self.builddir, 'pn-buildlist'), 'r') as pnfile:
+ found_targets = pnfile.read().splitlines()
+ return found_targets
+
+ def configure_builddir(self, builddir):
+ os.mkdir(builddir)
+ self.track_for_cleanup(builddir)
+ os.mkdir(os.path.join(builddir, 'conf'))
+ shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/local.conf'), os.path.join(builddir, 'conf/local.conf'))
+ config = {}
+ config['default_sstate_dir'] = "SSTATE_DIR ?= \"${TOPDIR}/sstate-cache\""
+ config['null_sstate_mirrors'] = "SSTATE_MIRRORS = \"\""
+ config['default_tmp_dir'] = "TMPDIR = \"${TOPDIR}/tmp\""
+ for key in config:
+ ftools.append_file(os.path.join(builddir, 'conf/selftest.inc'), config[key])
+ shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/bblayers.conf'), os.path.join(builddir, 'conf/bblayers.conf'))
+ try:
+ shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/auto.conf'), os.path.join(builddir, 'conf/auto.conf'))
+ except:
+ pass
+
+ def hardlink_tree(self, src, dst):
+ os.mkdir(dst)
+ self.track_for_cleanup(dst)
+ for root, dirs, files in os.walk(src):
+ if root == src:
+ continue
+ os.mkdir(os.path.join(dst, root.split(src)[1][1:]))
+ for sstate_file in files:
+ os.link(os.path.join(root, sstate_file), os.path.join(dst, root.split(src)[1][1:], sstate_file))
+
+ def run_test_sstate_rebuild(self, primary_targets, relocate=False, rebuild_dependencies=False):
+ buildA = os.path.join(self.builddir, 'buildA')
+ if relocate:
+ buildB = os.path.join(self.builddir, 'buildB')
+ else:
+ buildB = buildA
+
+ if rebuild_dependencies:
+ rebuild_targets = self.get_dep_targets(primary_targets)
+ else:
+ rebuild_targets = primary_targets
+
+ self.configure_builddir(buildA)
+ runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildA)) + 'bitbake ' + ' '.join(map(str, primary_targets)), shell=True, executable='/bin/bash')
+ self.hardlink_tree(os.path.join(buildA, 'sstate-cache'), os.path.join(self.builddir, 'sstate-cache-buildA'))
+ shutil.rmtree(buildA)
+
+ failed_rebuild = []
+ failed_cleansstate = []
+ for target in rebuild_targets:
+ self.configure_builddir(buildB)
+ self.hardlink_tree(os.path.join(self.builddir, 'sstate-cache-buildA'), os.path.join(buildB, 'sstate-cache'))
+
+ result_cleansstate = runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildB)) + 'bitbake -ccleansstate ' + target, ignore_status=True, shell=True, executable='/bin/bash')
+ if not result_cleansstate.status == 0:
+ failed_cleansstate.append(target)
+ shutil.rmtree(buildB)
+ continue
+
+ result_build = runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildB)) + 'bitbake ' + target, ignore_status=True, shell=True, executable='/bin/bash')
+ if not result_build.status == 0:
+ failed_rebuild.append(target)
+
+ shutil.rmtree(buildB)
+
+ self.assertFalse(failed_rebuild, msg="The following recipes have failed to rebuild: %s" % ' '.join(map(str, failed_rebuild)))
+ self.assertFalse(failed_cleansstate, msg="The following recipes have failed cleansstate(all others have passed both cleansstate and rebuild from sstate tests): %s" % ' '.join(map(str, failed_cleansstate)))
+
+ def test_sstate_relocation(self):
+ self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=True, rebuild_dependencies=True)
+
+ def test_sstate_rebuild(self):
+ self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=False, rebuild_dependencies=True)
diff --git a/poky/meta/lib/oeqa/selftest/cases/archiver.py b/poky/meta/lib/oeqa/selftest/cases/archiver.py
new file mode 100644
index 000000000..0a6d4e325
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/archiver.py
@@ -0,0 +1,131 @@
+import os
+import glob
+from oeqa.utils.commands import bitbake, get_bb_vars
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class Archiver(OESelftestTestCase):
+
+ @OETestID(1345)
+ def test_archiver_allows_to_filter_on_recipe_name(self):
+ """
+ Summary: The archiver should offer the possibility to filter on the recipe. (#6929)
+ Expected: 1. Included recipe (busybox) should be included
+ 2. Excluded recipe (zlib) should be excluded
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ include_recipe = 'busybox'
+ exclude_recipe = 'zlib'
+
+ features = 'INHERIT += "archiver"\n'
+ features += 'ARCHIVER_MODE[src] = "original"\n'
+ features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % include_recipe
+ features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe
+ self.write_config(features)
+
+ bitbake('-c clean %s %s' % (include_recipe, exclude_recipe))
+ bitbake("-c deploy_archives %s %s" % (include_recipe, exclude_recipe))
+
+ bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
+ src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
+
+ # Check that include_recipe was included
+ included_present = len(glob.glob(src_path + '/%s-*' % include_recipe))
+ self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe)
+
+ # Check that exclude_recipe was excluded
+ excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
+ self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)
+
+ @OETestID(1900)
+ def test_archiver_filters_by_type(self):
+ """
+ Summary: The archiver is documented to filter on the recipe type.
+ Expected: 1. included recipe type (target) should be included
+ 2. other types should be excluded
+ Product: oe-core
+ Author: André Draszik <adraszik@tycoint.com>
+ """
+
+ target_recipe = 'initscripts'
+ native_recipe = 'zlib-native'
+
+ features = 'INHERIT += "archiver"\n'
+ features += 'ARCHIVER_MODE[src] = "original"\n'
+ features += 'COPYLEFT_RECIPE_TYPES = "target"\n'
+ self.write_config(features)
+
+ bitbake('-c clean %s %s' % (target_recipe, native_recipe))
+ bitbake("%s -c deploy_archives %s" % (target_recipe, native_recipe))
+
+ bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
+ src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
+ src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
+
+ # Check that target_recipe was included
+ included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipe))
+ self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe)
+
+ # Check that native_recipe was excluded
+ excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe))
+ self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe)
+
+ @OETestID(1901)
+ def test_archiver_filters_by_type_and_name(self):
+ """
+ Summary: Test that the archiver archives by recipe type, taking the
+ recipe name into account.
+ Expected: 1. included recipe type (target) should be included
+ 2. other types should be excluded
+ 3. recipe by name should be included / excluded,
+ overriding previous decision by type
+ Product: oe-core
+ Author: André Draszik <adraszik@tycoint.com>
+ """
+
+ target_recipes = [ 'initscripts', 'zlib' ]
+ native_recipes = [ 'update-rc.d-native', 'zlib-native' ]
+
+ features = 'INHERIT += "archiver"\n'
+ features += 'ARCHIVER_MODE[src] = "original"\n'
+ features += 'COPYLEFT_RECIPE_TYPES = "target"\n'
+ features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % native_recipes[1]
+ features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % target_recipes[1]
+ self.write_config(features)
+
+ bitbake('-c clean %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
+ bitbake('-c deploy_archives %s %s' % (' '.join(target_recipes), ' '.join(native_recipes)))
+
+ bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS'])
+ src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'])
+ src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS'])
+
+ # Check that target_recipe[0] and native_recipes[1] were included
+ included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[0]))
+ self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0])
+
+ included_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[1]))
+ self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1])
+
+ # Check that native_recipes[0] and target_recipes[1] were excluded
+ excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[0]))
+ self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0])
+
+ excluded_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[1]))
+ self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1])
+
+
+
+ def test_archiver_srpm_mode(self):
+ """
+ Test that in srpm mode, the added recipe dependencies at least exist/work [YOCTO #11121]
+ """
+
+ features = 'INHERIT += "archiver"\n'
+ features += 'ARCHIVER_MODE[srpm] = "1"\n'
+ self.write_config(features)
+
+ bitbake('-n core-image-sato')
diff --git a/poky/meta/lib/oeqa/selftest/cases/bblayers.py b/poky/meta/lib/oeqa/selftest/cases/bblayers.py
new file mode 100644
index 000000000..90a2249b0
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/bblayers.py
@@ -0,0 +1,97 @@
+import os
+import re
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, get_bb_var
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class BitbakeLayers(OESelftestTestCase):
+
+ @OETestID(756)
+ def test_bitbakelayers_showcrossdepends(self):
+ result = runCmd('bitbake-layers show-cross-depends')
+ self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output)
+
+ @OETestID(83)
+ def test_bitbakelayers_showlayers(self):
+ result = runCmd('bitbake-layers show-layers')
+ self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output)
+
+ @OETestID(93)
+ def test_bitbakelayers_showappends(self):
+ recipe = "xcursor-transparent-theme"
+ bb_file = self.get_recipe_basename(recipe)
+ result = runCmd('bitbake-layers show-appends')
+ self.assertTrue(bb_file in result.output, msg="%s file was not recognised. bitbake-layers show-appends output: %s" % (bb_file, result.output))
+
+ @OETestID(90)
+ def test_bitbakelayers_showoverlayed(self):
+ result = runCmd('bitbake-layers show-overlayed')
+ self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output)
+
+ @OETestID(95)
+ def test_bitbakelayers_flatten(self):
+ recipe = "xcursor-transparent-theme"
+ recipe_path = "recipes-graphics/xcursor-transparent-theme"
+ recipe_file = self.get_recipe_basename(recipe)
+ testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten')
+ self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time")
+ self.track_for_cleanup(testoutdir)
+ result = runCmd('bitbake-layers flatten %s' % testoutdir)
+ bb_file = os.path.join(testoutdir, recipe_path, recipe_file)
+ self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
+ contents = ftools.read_file(bb_file)
+ find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
+ self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
+
+ @OETestID(1195)
+ def test_bitbakelayers_add_remove(self):
+ test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output, "This test cannot run with meta-skeleton in bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
+ result = runCmd('bitbake-layers add-layer %s' % test_layer)
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
+ result = runCmd('bitbake-layers remove-layer %s' % test_layer)
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output)
+ result = runCmd('bitbake-layers add-layer %s' % test_layer)
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
+ result = runCmd('bitbake-layers remove-layer */meta-skeleton')
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step. bitbake-layers show-layers output: %s" % result.output)
+
+ @OETestID(1384)
+ def test_bitbakelayers_showrecipes(self):
+ result = runCmd('bitbake-layers show-recipes')
+ self.assertIn('aspell:', result.output)
+ self.assertIn('mtd-utils:', result.output)
+ self.assertIn('core-image-minimal:', result.output)
+ result = runCmd('bitbake-layers show-recipes mtd-utils')
+ self.assertIn('mtd-utils:', result.output)
+ self.assertNotIn('aspell:', result.output)
+ result = runCmd('bitbake-layers show-recipes -i image')
+ self.assertIn('core-image-minimal', result.output)
+ self.assertNotIn('mtd-utils:', result.output)
+ result = runCmd('bitbake-layers show-recipes -i cmake,pkgconfig')
+ self.assertIn('libproxy:', result.output)
+ self.assertNotIn('mtd-utils:', result.output) # doesn't inherit either
+ self.assertNotIn('wget:', result.output) # doesn't inherit cmake
+ self.assertNotIn('waffle:', result.output) # doesn't inherit pkgconfig
+ result = runCmd('bitbake-layers show-recipes -i nonexistentclass', ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'bitbake-layers show-recipes -i nonexistentclass should have failed')
+ self.assertIn('ERROR:', result.output)
+
+ def get_recipe_basename(self, recipe):
+ recipe_file = ""
+ result = runCmd("bitbake-layers show-recipes -f %s" % recipe)
+ for line in result.output.splitlines():
+ if recipe in line:
+ recipe_file = line
+ break
+
+ self.assertTrue(os.path.isfile(recipe_file), msg = "Can't find recipe file for %s" % recipe)
+ return os.path.basename(recipe_file)
diff --git a/poky/meta/lib/oeqa/selftest/cases/bbtests.py b/poky/meta/lib/oeqa/selftest/cases/bbtests.py
new file mode 100644
index 000000000..350614967
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -0,0 +1,278 @@
+import os
+import re
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class BitbakeTests(OESelftestTestCase):
+
+ def getline(self, res, line):
+ for l in res.output.split('\n'):
+ if line in l:
+ return l
+
+ @OETestID(789)
+ def test_run_bitbake_from_dir_1(self):
+ os.chdir(os.path.join(self.builddir, 'conf'))
+ self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir")
+
+ @OETestID(790)
+ def test_run_bitbake_from_dir_2(self):
+ my_env = os.environ.copy()
+ my_env['BBPATH'] = my_env['BUILDDIR']
+ os.chdir(os.path.dirname(os.environ['BUILDDIR']))
+ self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir")
+
+ @OETestID(806)
+ def test_event_handler(self):
+ self.write_config("INHERIT += \"test_events\"")
+ result = bitbake('m4-native')
+ find_build_started = re.search("NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Executing RunQueue Tasks", result.output)
+ find_build_completed = re.search("Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output)
+ self.assertTrue(find_build_started, msg = "Match failed in:\n%s" % result.output)
+ self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output)
+ self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output)
+
+ @OETestID(103)
+ def test_local_sstate(self):
+ bitbake('m4-native')
+ bitbake('m4-native -cclean')
+ result = bitbake('m4-native')
+ find_setscene = re.search("m4-native.*do_.*_setscene", result.output)
+ self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output )
+
+ @OETestID(105)
+ def test_bitbake_invalid_recipe(self):
+ result = bitbake('-b asdf', ignore_status=True)
+ self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+ @OETestID(107)
+ def test_bitbake_invalid_target(self):
+ result = bitbake('asdf', ignore_status=True)
+ self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+ @OETestID(106)
+ def test_warnings_errors(self):
+ result = bitbake('-b asdf', ignore_status=True)
+ find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output)
+ find_errors = re.search("Summary: There w.{2,3}? [1-9][0-9]* ERROR messages* shown", result.output)
+ self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output)
+ self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output)
+
+ @OETestID(108)
+ def test_invalid_patch(self):
+ # This patch should fail to apply.
+ self.write_recipeinc('man-db', 'FILESEXTRAPATHS_prepend := "${THISDIR}/files:"\nSRC_URI += "file://0001-Test-patch-here.patch"')
+ self.write_config("INHERIT_remove = \"report-error\"")
+ result = bitbake('man-db -c patch', ignore_status=True)
+ self.delete_recipeinc('man-db')
+ bitbake('-cclean man-db')
+ line = self.getline(result, "Function failed: patch_do_patch")
+ self.assertTrue(line and line.startswith("ERROR:"), msg = "Incorrectly formed patch application didn't fail. bitbake output: %s" % result.output)
+
+ @OETestID(1354)
+ def test_force_task_1(self):
+ # test 1 from bug 5875
+ test_recipe = 'zlib'
+ test_data = "Microsoft Made No Profit From Anyone's Zunes Yo"
+ bb_vars = get_bb_vars(['D', 'PKGDEST', 'mandir'], test_recipe)
+ image_dir = bb_vars['D']
+ pkgsplit_dir = bb_vars['PKGDEST']
+ man_dir = bb_vars['mandir']
+
+ bitbake('-c clean %s' % test_recipe)
+ bitbake('-c package -f %s' % test_recipe)
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ man_file = os.path.join(image_dir + man_dir, 'man3/zlib.3')
+ ftools.append_file(man_file, test_data)
+ bitbake('-c package -f %s' % test_recipe)
+
+ man_split_file = os.path.join(pkgsplit_dir, 'zlib-doc' + man_dir, 'man3/zlib.3')
+ man_split_content = ftools.read_file(man_split_file)
+ self.assertIn(test_data, man_split_content, 'The man file has not changed in packages-split.')
+
+ ret = bitbake(test_recipe)
+ self.assertIn('task do_package_write_rpm:', ret.output, 'Task do_package_write_rpm did not re-executed.')
+
+ @OETestID(163)
+ def test_force_task_2(self):
+ # test 2 from bug 5875
+ test_recipe = 'zlib'
+
+ bitbake(test_recipe)
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ result = bitbake('-C compile %s' % test_recipe)
+ look_for_tasks = ['do_compile:', 'do_install:', 'do_populate_sysroot:', 'do_package:']
+ for task in look_for_tasks:
+ self.assertIn(task, result.output, msg="Couldn't find %s task.")
+
+ @OETestID(167)
+ def test_bitbake_g(self):
+ result = bitbake('-g core-image-minimal')
+ for f in ['pn-buildlist', 'recipe-depends.dot', 'task-depends.dot']:
+ self.addCleanup(os.remove, f)
+ self.assertTrue('Task dependencies saved to \'task-depends.dot\'' in result.output, msg = "No task dependency \"task-depends.dot\" file was generated for the given task target. bitbake output: %s" % result.output)
+ self.assertTrue('busybox' in ftools.read_file(os.path.join(self.builddir, 'task-depends.dot')), msg = "No \"busybox\" dependency found in task-depends.dot file.")
+
+ @OETestID(899)
+ def test_image_manifest(self):
+ bitbake('core-image-minimal')
+ bb_vars = get_bb_vars(["DEPLOY_DIR_IMAGE", "IMAGE_LINK_NAME"], "core-image-minimal")
+ deploydir = bb_vars["DEPLOY_DIR_IMAGE"]
+ imagename = bb_vars["IMAGE_LINK_NAME"]
+ manifest = os.path.join(deploydir, imagename + ".manifest")
+ self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest)
+
+ @OETestID(168)
+ def test_invalid_recipe_src_uri(self):
+ data = 'SRC_URI = "file://invalid"'
+ self.write_recipeinc('man-db', data)
+ self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+INHERIT_remove = \"report-error\"
+""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+
+ bitbake('-ccleanall man-db')
+ result = bitbake('-c fetch man-db', ignore_status=True)
+ bitbake('-ccleanall man-db')
+ self.delete_recipeinc('man-db')
+ self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output)
+ self.assertTrue('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output, msg = "\"invalid\" file \
+doesn't exist, yet no error message encountered. bitbake output: %s" % result.output)
+ line = self.getline(result, 'Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.')
+ self.assertTrue(line and line.startswith("ERROR:"), msg = "\"invalid\" file \
+doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output)
+
+ @OETestID(171)
+ def test_rename_downloaded_file(self):
+ # TODO unique dldir instead of using cleanall
+ # TODO: need to set sstatedir?
+ self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+
+ data = 'SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz;downloadfilename=test-aspell.tar.gz"'
+ self.write_recipeinc('aspell', data)
+ result = bitbake('-f -c fetch aspell', ignore_status=True)
+ self.delete_recipeinc('aspell')
+ self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output)
+ dl_dir = get_bb_var("DL_DIR")
+ self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % dl_dir)
+ self.assertTrue(os.path.isfile(os.path.join(dl_dir, 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % dl_dir)
+
+ @OETestID(1028)
+ def test_environment(self):
+ self.write_config("TEST_ENV=\"localconf\"")
+ result = runCmd('bitbake -e | grep TEST_ENV=')
+ self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='")
+
+ @OETestID(1029)
+ def test_dry_run(self):
+ result = runCmd('bitbake -n m4-native')
+ self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output)
+
+ @OETestID(1030)
+ def test_just_parse(self):
+ result = runCmd('bitbake -p')
+ self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output)
+
+ @OETestID(1031)
+ def test_version(self):
+ result = runCmd('bitbake -s | grep wget')
+ find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output)
+ self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output)
+
+ @OETestID(1032)
+ def test_prefile(self):
+ preconf = os.path.join(self.builddir, 'conf/prefile.conf')
+ self.track_for_cleanup(preconf)
+ ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"")
+ result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
+ self.assertTrue('prefile' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration. ")
+ self.write_config("TEST_PREFILE=\"localconf\"")
+ result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
+ self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.")
+
+ @OETestID(1033)
+ def test_postfile(self):
+ postconf = os.path.join(self.builddir, 'conf/postfile.conf')
+ self.track_for_cleanup(postconf)
+ ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"")
+ self.write_config("TEST_POSTFILE=\"localconf\"")
+ result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=')
+ self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.")
+
+ @OETestID(1034)
+ def test_checkuri(self):
+ result = runCmd('bitbake -c checkuri m4')
+ self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output)
+
+ @OETestID(1035)
+ def test_continue(self):
+ self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+INHERIT_remove = \"report-error\"
+""")
+ self.track_for_cleanup(os.path.join(self.builddir, "download-selftest"))
+ self.write_recipeinc('man-db',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" )
+ runCmd('bitbake -c cleanall man-db xcursor-transparent-theme')
+ result = runCmd('bitbake -c unpack -k man-db xcursor-transparent-theme', ignore_status=True)
+ errorpos = result.output.find('ERROR: Function failed: do_fail_task')
+ manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output)
+ continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1))
+ self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output)
+
+ @OETestID(1119)
+ def test_non_gplv3(self):
+ self.write_config('INCOMPATIBLE_LICENSE = "GPLv3"')
+ result = bitbake('selftest-ed', ignore_status=True)
+ self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output))
+ lic_dir = get_bb_var('LICENSE_DIRECTORY')
+ self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3')))
+ self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2')))
+
+ @OETestID(1422)
+ def test_setscene_only(self):
+ """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)"""
+ test_recipe = 'ed'
+
+ bitbake(test_recipe)
+ bitbake('-c clean %s' % test_recipe)
+ ret = bitbake('--setscene-only %s' % test_recipe)
+
+ tasks = re.findall(r'task\s+(do_\S+):', ret.output)
+
+ for task in tasks:
+ self.assertIn('_setscene', task, 'A task different from _setscene ran: %s.\n'
+ 'Executed tasks were: %s' % (task, str(tasks)))
+
+ @OETestID(1425)
+ def test_bbappend_order(self):
+ """ Bitbake should bbappend to recipe in a predictable order """
+ test_recipe = 'ed'
+ bb_vars = get_bb_vars(['SUMMARY', 'PV'], test_recipe)
+ test_recipe_summary_before = bb_vars['SUMMARY']
+ test_recipe_pv = bb_vars['PV']
+ recipe_append_file = test_recipe + '_' + test_recipe_pv + '.bbappend'
+ expected_recipe_summary = test_recipe_summary_before
+
+ for i in range(5):
+ recipe_append_dir = test_recipe + '_test_' + str(i)
+ recipe_append_path = os.path.join(self.testlayer_path, 'recipes-test', recipe_append_dir, recipe_append_file)
+ os.mkdir(os.path.join(self.testlayer_path, 'recipes-test', recipe_append_dir))
+ feature = 'SUMMARY += "%s"\n' % i
+ ftools.write_file(recipe_append_path, feature)
+ expected_recipe_summary += ' %s' % i
+
+ self.add_command_to_tearDown('rm -rf %s' % os.path.join(self.testlayer_path, 'recipes-test',
+ test_recipe + '_test_*'))
+
+ test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe)
+ self.assertEqual(expected_recipe_summary, test_recipe_summary_after)
diff --git a/poky/meta/lib/oeqa/selftest/cases/buildhistory.py b/poky/meta/lib/oeqa/selftest/cases/buildhistory.py
new file mode 100644
index 000000000..06792d914
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/buildhistory.py
@@ -0,0 +1,46 @@
+import os
+import re
+import datetime
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_vars
+
+
+class BuildhistoryBase(OESelftestTestCase):
+
+ def config_buildhistory(self, tmp_bh_location=False):
+ bb_vars = get_bb_vars(['USER_CLASSES', 'INHERIT'])
+ if (not 'buildhistory' in bb_vars['USER_CLASSES']) and (not 'buildhistory' in bb_vars['INHERIT']):
+ add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"'
+ self.append_config(add_buildhistory_config)
+
+ if tmp_bh_location:
+ # Using a temporary buildhistory location for testing
+ tmp_bh_dir = os.path.join(self.builddir, "tmp_buildhistory_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+ buildhistory_dir_config = "BUILDHISTORY_DIR = \"%s\"" % tmp_bh_dir
+ self.append_config(buildhistory_dir_config)
+ self.track_for_cleanup(tmp_bh_dir)
+
+ def run_buildhistory_operation(self, target, global_config='', target_config='', change_bh_location=False, expect_error=False, error_regex=''):
+ if change_bh_location:
+ tmp_bh_location = True
+ else:
+ tmp_bh_location = False
+ self.config_buildhistory(tmp_bh_location)
+
+ self.append_config(global_config)
+ self.append_recipeinc(target, target_config)
+ bitbake("-cclean %s" % target)
+ result = bitbake(target, ignore_status=True)
+ self.remove_config(global_config)
+ self.remove_recipeinc(target, target_config)
+
+ if expect_error:
+ self.assertEqual(result.status, 1, msg="Error expected for global config '%s' and target config '%s'" % (global_config, target_config))
+ search_for_error = re.search(error_regex, result.output)
+ self.assertTrue(search_for_error, msg="Could not find desired error in output: %s (%s)" % (error_regex, result.output))
+ else:
+ self.assertEqual(result.status, 0, msg="Command 'bitbake %s' has failed unexpectedly: %s" % (target, result.output))
+
+ # No tests should be added to the base class.
+ # Please create a new class that inherit this one, or use one of those already available for adding tests.
diff --git a/poky/meta/lib/oeqa/selftest/cases/buildoptions.py b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
new file mode 100644
index 000000000..e60e32dad
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/buildoptions.py
@@ -0,0 +1,180 @@
+import os
+import re
+import glob as g
+import shutil
+import tempfile
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.selftest.cases.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+import oeqa.utils.ftools as ftools
+from oeqa.core.decorator.oeid import OETestID
+
+class ImageOptionsTests(OESelftestTestCase):
+
+ @OETestID(761)
+ def test_incremental_image_generation(self):
+ image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
+ if image_pkgtype != 'rpm':
+ self.skipTest('Not using RPM as main package format')
+ bitbake("-c clean core-image-minimal")
+ self.write_config('INC_RPM_IMAGE_GEN = "1"')
+ self.append_config('IMAGE_FEATURES += "ssh-server-openssh"')
+ bitbake("core-image-minimal")
+ log_data_file = os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")
+ log_data_created = ftools.read_file(log_data_file)
+ incremental_created = re.search(r"Installing\s*:\s*packagegroup-core-ssh-openssh", log_data_created)
+ self.remove_config('IMAGE_FEATURES += "ssh-server-openssh"')
+ self.assertTrue(incremental_created, msg = "Match failed in:\n%s" % log_data_created)
+ bitbake("core-image-minimal")
+ log_data_removed = ftools.read_file(log_data_file)
+ incremental_removed = re.search(r"Erasing\s*:\s*packagegroup-core-ssh-openssh", log_data_removed)
+ self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
+
+ @OETestID(286)
+ def test_ccache_tool(self):
+ bitbake("ccache-native")
+ bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'ccache-native')
+ p = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] + "/" + "ccache"
+ self.assertTrue(os.path.isfile(p), msg = "No ccache found (%s)" % p)
+ self.write_config('INHERIT += "ccache"')
+ self.add_command_to_tearDown('bitbake -c clean m4')
+ bitbake("m4 -f -c compile")
+ log_compile = os.path.join(get_bb_var("WORKDIR","m4"), "temp/log.do_compile")
+ res = runCmd("grep ccache %s" % log_compile, ignore_status=True)
+ self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % log_compile)
+
+ @OETestID(1435)
+ def test_read_only_image(self):
+ distro_features = get_bb_var('DISTRO_FEATURES')
+ if not ('x11' in distro_features and 'opengl' in distro_features):
+ self.skipTest('core-image-sato requires x11 and opengl in distro features')
+ self.write_config('IMAGE_FEATURES += "read-only-rootfs"')
+ bitbake("core-image-sato")
+ # do_image will fail if there are any pending postinsts
+
+class DiskMonTest(OESelftestTestCase):
+
+ @OETestID(277)
+ def test_stoptask_behavior(self):
+ self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"')
+ res = bitbake("m4", ignore_status = True)
+ self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output)
+ self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+ self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"')
+ res = bitbake("m4", ignore_status = True)
+ self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output)
+ self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+ self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"')
+ res = bitbake("m4")
+ self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output)
+
+class SanityOptionsTest(OESelftestTestCase):
+ def getline(self, res, line):
+ for l in res.output.split('\n'):
+ if line in l:
+ return l
+
+ @OETestID(927)
+ def test_options_warnqa_errorqa_switch(self):
+
+ self.write_config("INHERIT_remove = \"report-error\"")
+ if "packages-list" not in get_bb_var("ERROR_QA"):
+ self.append_config("ERROR_QA_append = \" packages-list\"")
+
+ self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
+ self.add_command_to_tearDown('bitbake -c clean xcursor-transparent-theme')
+ res = bitbake("xcursor-transparent-theme -f -c package", ignore_status=True)
+ self.delete_recipeinc('xcursor-transparent-theme')
+ line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.")
+ self.assertTrue(line and line.startswith("ERROR:"), msg=res.output)
+ self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+ self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
+ self.append_config('ERROR_QA_remove = "packages-list"')
+ self.append_config('WARN_QA_append = " packages-list"')
+ res = bitbake("xcursor-transparent-theme -f -c package")
+ self.delete_recipeinc('xcursor-transparent-theme')
+ line = self.getline(res, "QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors.")
+ self.assertTrue(line and line.startswith("WARNING:"), msg=res.output)
+
+ @OETestID(1421)
+ def test_layer_without_git_dir(self):
+ """
+ Summary: Test that layer git revisions are displayed and do not fail without git repository
+ Expected: The build to be successful and without "fatal" errors
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ dirpath = tempfile.mkdtemp()
+
+ dummy_layer_name = 'meta-dummy'
+ dummy_layer_path = os.path.join(dirpath, dummy_layer_name)
+ dummy_layer_conf_dir = os.path.join(dummy_layer_path, 'conf')
+ os.makedirs(dummy_layer_conf_dir)
+ dummy_layer_conf_path = os.path.join(dummy_layer_conf_dir, 'layer.conf')
+
+ dummy_layer_content = 'BBPATH .= ":${LAYERDIR}"\n' \
+ 'BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"\n' \
+ 'BBFILE_COLLECTIONS += "%s"\n' \
+ 'BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' \
+ 'BBFILE_PRIORITY_%s = "6"\n' % (dummy_layer_name, dummy_layer_name, dummy_layer_name)
+
+ ftools.write_file(dummy_layer_conf_path, dummy_layer_content)
+
+ bblayers_conf = 'BBLAYERS += "%s"\n' % dummy_layer_path
+ self.write_bblayers_config(bblayers_conf)
+
+ test_recipe = 'ed'
+
+ ret = bitbake('-n %s' % test_recipe)
+
+ err = 'fatal: Not a git repository'
+
+ shutil.rmtree(dirpath)
+
+ self.assertNotIn(err, ret.output)
+
+
+class BuildhistoryTests(BuildhistoryBase):
+
+ @OETestID(293)
+ def test_buildhistory_basic(self):
+ self.run_buildhistory_operation('xcursor-transparent-theme')
+ self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.")
+
+ @OETestID(294)
+ def test_buildhistory_buildtime_pr_backwards(self):
+ target = 'xcursor-transparent-theme'
+ error = "ERROR:.*QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1.* to .*-r0.*)" % target
+ self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
+ self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)
+
+class ArchiverTest(OESelftestTestCase):
+ @OETestID(926)
+ def test_arch_work_dir_and_export_source(self):
+ """
+ Test for archiving the work directory and exporting the source files.
+ """
+ self.write_config("INHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
+ res = bitbake("xcursor-transparent-theme", ignore_status=True)
+ self.assertEqual(res.status, 0, "\nCouldn't build xcursortransparenttheme.\nbitbake output %s" % res.output)
+ deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
+ pkgs_path = g.glob(str(deploy_dir_src) + "/allarch*/xcurs*")
+ src_file_glob = str(pkgs_path[0]) + "/xcursor*.src.rpm"
+ tar_file_glob = str(pkgs_path[0]) + "/xcursor*.tar.gz"
+ self.assertTrue((g.glob(src_file_glob) and g.glob(tar_file_glob)), "Couldn't find .src.rpm and .tar.gz files under %s/allarch*/xcursor*" % deploy_dir_src)
+
+class ToolchainOptions(OESelftestTestCase):
+
+ def test_toolchain_fortran(self):
+ """
+ Test whether we can enable and build fortran and its supporting libraries
+ """
+
+ features = 'FORTRAN_forcevariable = ",fortran"\n'
+ features += 'RUNTIMETARGET_append_pn-gcc-runtime = " libquadmath"\n'
+ self.write_config(features)
+
+ bitbake('gcc-runtime libgfortran')
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/containerimage.py b/poky/meta/lib/oeqa/selftest/cases/containerimage.py
new file mode 100644
index 000000000..99a5cc9e5
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/containerimage.py
@@ -0,0 +1,85 @@
+import os
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+from oeqa.core.decorator.oeid import OETestID
+
+# This test builds an image with using the "container" IMAGE_FSTYPE, and
+# ensures that then files in the image are only the ones expected.
+#
+# The only package added to the image is container_image_testpkg, which
+# contains one file. However, due to some other things not cleaning up during
+# rootfs creation, there is some cruft. Ideally bugs will be filed and the
+# cruft removed, but for now we whitelist some known set.
+#
+# Also for performance reasons we're only checking the cruft when using ipk.
+# When using deb, and rpm it is a bit different and we could test all
+# of them, but this test is more to catch if other packages get added by
+# default other than what is in ROOTFS_BOOTSTRAP_INSTALL.
+#
+class ContainerImageTests(OESelftestTestCase):
+
+ # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+ # the conversion type bar gets added as a dep as well
+ @OETestID(1619)
+ def test_expected_files(self):
+
+ def get_each_path_part(path):
+ if path:
+ part = [ '.' + path + '/' ]
+ result = get_each_path_part(path.rsplit('/', 1)[0])
+ if result:
+ return part + result
+ else:
+ return part
+ else:
+ return None
+
+ self.write_config("""PREFERRED_PROVIDER_virtual/kernel = "linux-dummy"
+IMAGE_FSTYPES = "container"
+PACKAGE_CLASSES = "package_ipk"
+IMAGE_FEATURES = ""
+""")
+
+ bbvars = get_bb_vars(['bindir', 'sysconfdir', 'localstatedir',
+ 'DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'],
+ target='container-test-image')
+ expected_files = [
+ './',
+ '.{bindir}/theapp',
+ '.{sysconfdir}/default/',
+ '.{sysconfdir}/default/postinst',
+ '.{sysconfdir}/ld.so.cache',
+ '.{sysconfdir}/timestamp',
+ '.{sysconfdir}/version',
+ './run/',
+ '.{localstatedir}/cache/',
+ '.{localstatedir}/cache/ldconfig/',
+ '.{localstatedir}/cache/ldconfig/aux-cache',
+ '.{localstatedir}/cache/opkg/',
+ '.{localstatedir}/lib/',
+ '.{localstatedir}/lib/opkg/'
+ ]
+
+ expected_files = [ x.format(bindir=bbvars['bindir'],
+ sysconfdir=bbvars['sysconfdir'],
+ localstatedir=bbvars['localstatedir'])
+ for x in expected_files ]
+
+ # Since tar lists all directories individually, make sure each element
+ # from bindir, sysconfdir, etc is added
+ expected_files += get_each_path_part(bbvars['bindir'])
+ expected_files += get_each_path_part(bbvars['sysconfdir'])
+ expected_files += get_each_path_part(bbvars['localstatedir'])
+
+ expected_files = sorted(expected_files)
+
+ # Build the image of course
+ bitbake('container-test-image')
+
+ image = os.path.join(bbvars['DEPLOY_DIR_IMAGE'],
+ bbvars['IMAGE_LINK_NAME'] + '.tar.bz2')
+
+ # Ensure the files in the image are what we expect
+ result = runCmd("tar tf {} | sort".format(image), shell=True)
+ self.assertEqual(result.output.split('\n'), expected_files)
diff --git a/poky/meta/lib/oeqa/selftest/cases/devtool.py b/poky/meta/lib/oeqa/selftest/cases/devtool.py
new file mode 100644
index 000000000..d5b6a46d4
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/devtool.py
@@ -0,0 +1,1716 @@
+import os
+import re
+import shutil
+import tempfile
+import glob
+import fnmatch
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
+from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
+from oeqa.core.decorator.oeid import OETestID
+
+class DevtoolBase(OESelftestTestCase):
+
+ buffer = True
+
+ def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
+ with open(recipefile, 'r') as f:
+ invar = None
+ invalue = None
+ for line in f:
+ var = None
+ if invar:
+ value = line.strip().strip('"')
+ if value.endswith('\\'):
+ invalue += ' ' + value[:-1].strip()
+ continue
+ else:
+ invalue += ' ' + value.strip()
+ var = invar
+ value = invalue
+ invar = None
+ elif '=' in line:
+ splitline = line.split('=', 1)
+ var = splitline[0].rstrip()
+ value = splitline[1].strip().strip('"')
+ if value.endswith('\\'):
+ invalue = value[:-1].strip()
+ invar = var
+ continue
+ elif line.startswith('inherit '):
+ inherits = line.split()[1:]
+
+ if var and var in checkvars:
+ needvalue = checkvars.pop(var)
+ if needvalue is None:
+ self.fail('Variable %s should not appear in recipe, but value is being set to "%s"' % (var, value))
+ if isinstance(needvalue, set):
+ if var == 'LICENSE':
+ value = set(value.split(' & '))
+ else:
+ value = set(value.split())
+ self.assertEqual(value, needvalue, 'values for %s do not match' % var)
+
+
+ missingvars = {}
+ for var, value in checkvars.items():
+ if value is not None:
+ missingvars[var] = value
+ self.assertEqual(missingvars, {}, 'Some expected variables not found in recipe: %s' % checkvars)
+
+ for inherit in checkinherits:
+ self.assertIn(inherit, inherits, 'Missing inherit of %s' % inherit)
+
+ def _check_bbappend(self, testrecipe, recipefile, appenddir):
+ result = runCmd('bitbake-layers show-appends', cwd=self.builddir)
+ resultlines = result.output.splitlines()
+ inrecipe = False
+ bbappends = []
+ bbappendfile = None
+ for line in resultlines:
+ if inrecipe:
+ if line.startswith(' '):
+ bbappends.append(line.strip())
+ else:
+ break
+ elif line == '%s:' % os.path.basename(recipefile):
+ inrecipe = True
+ self.assertLessEqual(len(bbappends), 2, '%s recipe is being bbappended by another layer - bbappends found:\n %s' % (testrecipe, '\n '.join(bbappends)))
+ for bbappend in bbappends:
+ if bbappend.startswith(appenddir):
+ bbappendfile = bbappend
+ break
+ else:
+ self.fail('bbappend for recipe %s does not seem to be created in test layer' % testrecipe)
+ return bbappendfile
+
+ def _create_temp_layer(self, templayerdir, addlayer, templayername, priority=999, recipepathspec='recipes-*/*'):
+ create_temp_layer(templayerdir, templayername, priority, recipepathspec)
+ if addlayer:
+ self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir)
+ result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir)
+
+ def _process_ls_output(self, output):
+ """
+ Convert ls -l output to a format we can reasonably compare from one context
+ to another (e.g. from host to target)
+ """
+ filelist = []
+ for line in output.splitlines():
+ splitline = line.split()
+ if len(splitline) < 8:
+ self.fail('_process_ls_output: invalid output line: %s' % line)
+ # Remove trailing . on perms
+ splitline[0] = splitline[0].rstrip('.')
+ # Remove leading . on paths
+ splitline[-1] = splitline[-1].lstrip('.')
+ # Drop fields we don't want to compare
+ del splitline[7]
+ del splitline[6]
+ del splitline[5]
+ del splitline[4]
+ del splitline[1]
+ filelist.append(' '.join(splitline))
+ return filelist
+
+
+class DevtoolTests(DevtoolBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(DevtoolTests, cls).setUpClass()
+ bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR'])
+ cls.original_sstate = bb_vars['SSTATE_DIR']
+ cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool')
+ cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate
+ cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n'
+ % cls.original_sstate)
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.logger.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate)
+ runCmd('rm -rf %s' % cls.devtool_sstate)
+ super(DevtoolTests, cls).tearDownClass()
+
+ def setUp(self):
+ """Test case setup function"""
+ super(DevtoolTests, self).setUp()
+ self.workspacedir = os.path.join(self.builddir, 'workspace')
+ self.assertTrue(not os.path.exists(self.workspacedir),
+ 'This test cannot be run with a workspace directory '
+ 'under the build directory')
+ self.append_config(self.sstate_conf)
+
+ def _check_src_repo(self, repo_dir):
+ """Check srctree git repository"""
+ self.assertTrue(os.path.isdir(os.path.join(repo_dir, '.git')),
+ 'git repository for external source tree not found')
+ result = runCmd('git status --porcelain', cwd=repo_dir)
+ self.assertEqual(result.output.strip(), "",
+ 'Created git repo is not clean')
+ result = runCmd('git symbolic-ref HEAD', cwd=repo_dir)
+ self.assertEqual(result.output.strip(), "refs/heads/devtool",
+ 'Wrong branch in git repo')
+
+ def _check_repo_status(self, repo_dir, expected_status):
+ """Check the worktree status of a repository"""
+ result = runCmd('git status . --porcelain',
+ cwd=repo_dir)
+ for line in result.output.splitlines():
+ for ind, (f_status, fn_re) in enumerate(expected_status):
+ if re.match(fn_re, line[3:]):
+ if f_status != line[:2]:
+ self.fail('Unexpected status in line: %s' % line)
+ expected_status.pop(ind)
+ break
+ else:
+ self.fail('Unexpected modified file in line: %s' % line)
+ if expected_status:
+ self.fail('Missing file changes: %s' % expected_status)
+
+ @OETestID(1158)
+ def test_create_workspace(self):
+ # Check preconditions
+ result = runCmd('bitbake-layers show-layers')
+ self.assertTrue('\nworkspace' not in result.output, 'This test cannot be run with a workspace layer in bblayers.conf')
+ # Try creating a workspace layer with a specific path
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ result = runCmd('devtool create-workspace %s' % tempdir)
+ self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
+ result = runCmd('bitbake-layers show-layers')
+ self.assertIn(tempdir, result.output)
+ # Try creating a workspace layer with the default path
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool create-workspace')
+ self.assertTrue(os.path.isfile(os.path.join(self.workspacedir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
+ result = runCmd('bitbake-layers show-layers')
+ self.assertNotIn(tempdir, result.output)
+ self.assertIn(self.workspacedir, result.output)
+
+ @OETestID(1159)
+ def test_devtool_add(self):
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ pn = 'pv'
+ pv = '1.5.3'
+ url = 'http://www.ivarch.com/programs/sources/pv-1.5.3.tar.bz2'
+ result = runCmd('wget %s' % url, cwd=tempdir)
+ result = runCmd('tar xfv %s' % os.path.basename(url), cwd=tempdir)
+ srcdir = os.path.join(tempdir, '%s-%s' % (pn, pv))
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory')
+ # Test devtool add
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake -c cleansstate %s' % pn)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add %s %s' % (pn, srcdir))
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ recipepath = '%s/recipes/%s/%s_%s.bb' % (self.workspacedir, pn, pn, pv)
+ self.assertIn(recipepath, result.output)
+ self.assertIn(srcdir, result.output)
+ # Test devtool find-recipe
+ result = runCmd('devtool -q find-recipe %s' % pn)
+ self.assertEqual(recipepath, result.output.strip())
+ # Test devtool edit-recipe
+ result = runCmd('VISUAL="echo 123" devtool -q edit-recipe %s' % pn)
+ self.assertEqual('123 %s' % recipepath, result.output.strip())
+ # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
+ bitbake('%s -c cleansstate' % pn)
+ # Test devtool build
+ result = runCmd('devtool build %s' % pn)
+ bb_vars = get_bb_vars(['D', 'bindir'], pn)
+ installdir = bb_vars['D']
+ self.assertTrue(installdir, 'Could not query installdir variable')
+ bindir = bb_vars['bindir']
+ self.assertTrue(bindir, 'Could not query bindir variable')
+ if bindir[0] == '/':
+ bindir = bindir[1:]
+ self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D')
+
+ @OETestID(1423)
+ def test_devtool_add_git_local(self):
+ # Fetch source from a remote URL, but do it outside of devtool
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ pn = 'dbus-wait'
+ srcrev = '6cc6077a36fe2648a5f993fe7c16c9632f946517'
+ # We choose an https:// git URL here to check rewriting the URL works
+ url = 'https://git.yoctoproject.org/git/dbus-wait'
+ # Force fetching to "noname" subdir so we verify we're picking up the name from autoconf
+ # instead of the directory name
+ result = runCmd('git clone %s noname' % url, cwd=tempdir)
+ srcdir = os.path.join(tempdir, 'noname')
+ result = runCmd('git reset --hard %s' % srcrev, cwd=srcdir)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure script in source directory')
+ # Test devtool add
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # Don't specify a name since we should be able to auto-detect it
+ result = runCmd('devtool add %s' % srcdir)
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ # Check the recipe name is correct
+ recipefile = get_bb_var('FILE', pn)
+ self.assertIn('%s_git.bb' % pn, recipefile, 'Recipe file incorrectly named')
+ self.assertIn(recipefile, result.output)
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(pn, result.output)
+ self.assertIn(srcdir, result.output)
+ self.assertIn(recipefile, result.output)
+ checkvars = {}
+ checkvars['LICENSE'] = 'GPLv2'
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'
+ checkvars['S'] = '${WORKDIR}/git'
+ checkvars['PV'] = '0.1+git${SRCPV}'
+ checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https'
+ checkvars['SRCREV'] = srcrev
+ checkvars['DEPENDS'] = set(['dbus'])
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @OETestID(1162)
+ def test_devtool_add_library(self):
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ version = '1.1'
+ url = 'https://www.intra2net.com/en/developer/libftdi/download/libftdi1-%s.tar.bz2' % version
+ result = runCmd('wget %s' % url, cwd=tempdir)
+ result = runCmd('tar xfv libftdi1-%s.tar.bz2' % version, cwd=tempdir)
+ srcdir = os.path.join(tempdir, 'libftdi1-%s' % version)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'CMakeLists.txt')), 'Unable to find CMakeLists.txt in source directory')
+ # Test devtool add (and use -V so we test that too)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add libftdi %s -V %s' % (srcdir, version))
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn('libftdi', result.output)
+ self.assertIn(srcdir, result.output)
+ # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
+ bitbake('libftdi -c cleansstate')
+ # libftdi's python/CMakeLists.txt is a bit broken, so let's just disable it
+ # There's also the matter of it installing cmake files to a path we don't
+ # normally cover, which triggers the installed-vs-shipped QA test we have
+ # within do_package
+ recipefile = '%s/recipes/libftdi/libftdi_%s.bb' % (self.workspacedir, version)
+ result = runCmd('recipetool setvar %s EXTRA_OECMAKE -- \'-DPYTHON_BINDINGS=OFF -DLIBFTDI_CMAKE_CONFIG_DIR=${datadir}/cmake/Modules\'' % recipefile)
+ with open(recipefile, 'a') as f:
+ f.write('\nFILES_${PN}-dev += "${datadir}/cmake/Modules"\n')
+ # We don't have the ability to pick up this dependency automatically yet...
+ f.write('\nDEPENDS += "libusb1"\n')
+ f.write('\nTESTLIBOUTPUT = "${COMPONENTS_DIR}/${TUNE_PKGARCH}/${PN}/${libdir}"\n')
+ # Test devtool build
+ result = runCmd('devtool build libftdi')
+ bb_vars = get_bb_vars(['TESTLIBOUTPUT', 'STAMP'], 'libftdi')
+ staging_libdir = bb_vars['TESTLIBOUTPUT']
+ self.assertTrue(staging_libdir, 'Could not query TESTLIBOUTPUT variable')
+ self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output)
+ # Test devtool reset
+ stampprefix = bb_vars['STAMP']
+ result = runCmd('devtool reset libftdi')
+ result = runCmd('devtool status')
+ self.assertNotIn('libftdi', result.output)
+ self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe libftdi')
+ matches = glob.glob(stampprefix + '*')
+ self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned')
+ self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning')
+
+ @OETestID(1160)
+ def test_devtool_add_fetch(self):
+ # Fetch source
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ testver = '0.23'
+ url = 'https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%s.tar.gz' % testver
+ testrecipe = 'python-markupsafe'
+ srcdir = os.path.join(tempdir, testrecipe)
+ # Test devtool add
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. %s' % result.output)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
+ self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(srcdir, result.output)
+ # Check recipe
+ recipefile = get_bb_var('FILE', testrecipe)
+ self.assertIn('%s_%s.bb' % (testrecipe, testver), recipefile, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/MarkupSafe-${PV}'
+ checkvars['SRC_URI'] = url.replace(testver, '${PV}')
+ self._test_recipe_contents(recipefile, checkvars, [])
+ # Try with version specified
+ result = runCmd('devtool reset -n %s' % testrecipe)
+ shutil.rmtree(srcdir)
+ fakever = '1.9'
+ result = runCmd('devtool add %s %s -f %s -V %s' % (testrecipe, srcdir, url, fakever))
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(srcdir, result.output)
+ # Check recipe
+ recipefile = get_bb_var('FILE', testrecipe)
+ self.assertIn('%s_%s.bb' % (testrecipe, fakever), recipefile, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/MarkupSafe-%s' % testver
+ checkvars['SRC_URI'] = url
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @OETestID(1161)
+ def test_devtool_add_fetch_git(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ url = 'gitsm://git.yoctoproject.org/mraa'
+ checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d'
+ testrecipe = 'mraa'
+ srcdir = os.path.join(tempdir, testrecipe)
+ # Test devtool add
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add %s %s -a -f %s' % (testrecipe, srcdir, url))
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created: %s' % result.output)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(srcdir, result.output)
+ # Check recipe
+ recipefile = get_bb_var('FILE', testrecipe)
+ self.assertIn('_git.bb', recipefile, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/git'
+ checkvars['PV'] = '1.0+git${SRCPV}'
+ checkvars['SRC_URI'] = url
+ checkvars['SRCREV'] = '${AUTOREV}'
+ self._test_recipe_contents(recipefile, checkvars, [])
+ # Try with revision and version specified
+ result = runCmd('devtool reset -n %s' % testrecipe)
+ shutil.rmtree(srcdir)
+ url_rev = '%s;rev=%s' % (url, checkrev)
+ result = runCmd('devtool add %s %s -f "%s" -V 1.5' % (testrecipe, srcdir, url_rev))
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'imraa', 'imraa.c')), 'Unable to find imraa/imraa.c in source directory')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(srcdir, result.output)
+ # Check recipe
+ recipefile = get_bb_var('FILE', testrecipe)
+ self.assertIn('_git.bb', recipefile, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/git'
+ checkvars['PV'] = '1.5+git${SRCPV}'
+ checkvars['SRC_URI'] = url
+ checkvars['SRCREV'] = checkrev
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @OETestID(1391)
+ def test_devtool_add_fetch_simple(self):
+ # Fetch source from a remote URL, auto-detecting name
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ testver = '1.6.0'
+ url = 'http://www.ivarch.com/programs/sources/pv-%s.tar.bz2' % testver
+ testrecipe = 'pv'
+ srcdir = os.path.join(self.workspacedir, 'sources', testrecipe)
+ # Test devtool add
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool add %s' % url)
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. %s' % result.output)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory')
+ self.assertTrue(os.path.isdir(os.path.join(srcdir, '.git')), 'git repository for external source tree was not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(srcdir, result.output)
+ # Check recipe
+ recipefile = get_bb_var('FILE', testrecipe)
+ self.assertIn('%s_%s.bb' % (testrecipe, testver), recipefile, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['S'] = None
+ checkvars['SRC_URI'] = url.replace(testver, '${PV}')
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @OETestID(1164)
+ def test_devtool_modify(self):
+ import oe.path
+
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean mdadm')
+ result = runCmd('devtool modify mdadm -x %s' % tempdir)
+ self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend'))
+ self.assertTrue(matches, 'bbappend not created %s' % result.output)
+
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn('mdadm', result.output)
+ self.assertIn(tempdir, result.output)
+ self._check_src_repo(tempdir)
+
+ bitbake('mdadm -C unpack')
+
+ def check_line(checkfile, expected, message, present=True):
+ # Check for $expected, on a line on its own, in checkfile.
+ with open(checkfile, 'r') as f:
+ if present:
+ self.assertIn(expected + '\n', f, message)
+ else:
+ self.assertNotIn(expected + '\n', f, message)
+
+ modfile = os.path.join(tempdir, 'mdadm.8.in')
+ bb_vars = get_bb_vars(['PKGD', 'mandir'], 'mdadm')
+ pkgd = bb_vars['PKGD']
+ self.assertTrue(pkgd, 'Could not query PKGD variable')
+ mandir = bb_vars['mandir']
+ self.assertTrue(mandir, 'Could not query mandir variable')
+ manfile = oe.path.join(pkgd, mandir, 'man8', 'mdadm.8')
+
+ check_line(modfile, 'Linux Software RAID', 'Could not find initial string')
+ check_line(modfile, 'antique pin sardine', 'Unexpectedly found replacement string', present=False)
+
+ result = runCmd("sed -i 's!^Linux Software RAID$!antique pin sardine!' %s" % modfile)
+ check_line(modfile, 'antique pin sardine', 'mdadm.8.in file not modified (sed failed)')
+
+ bitbake('mdadm -c package')
+ check_line(manfile, 'antique pin sardine', 'man file not modified. man searched file path: %s' % manfile)
+
+ result = runCmd('git checkout -- %s' % modfile, cwd=tempdir)
+ check_line(modfile, 'Linux Software RAID', 'man .in file not restored (git failed)')
+
+ bitbake('mdadm -c package')
+ check_line(manfile, 'Linux Software RAID', 'man file not updated. man searched file path: %s' % manfile)
+
+ result = runCmd('devtool reset mdadm')
+ result = runCmd('devtool status')
+ self.assertNotIn('mdadm', result.output)
+
+ @OETestID(1620)
+ def test_devtool_buildclean(self):
+ def assertFile(path, *paths):
+ f = os.path.join(path, *paths)
+ self.assertExists(f)
+ def assertNoFile(path, *paths):
+ f = os.path.join(path, *paths)
+ self.assertNotExists(f)
+
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('mdadm m4 -c cleansstate')
+ # Try modifying a recipe
+ tempdir_mdadm = tempfile.mkdtemp(prefix='devtoolqa')
+ tempdir_m4 = tempfile.mkdtemp(prefix='devtoolqa')
+ builddir_m4 = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir_mdadm)
+ self.track_for_cleanup(tempdir_m4)
+ self.track_for_cleanup(builddir_m4)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean mdadm m4')
+ self.write_recipeinc('m4', 'EXTERNALSRC_BUILD = "%s"\ndo_clean() {\n\t:\n}\n' % builddir_m4)
+ try:
+ runCmd('devtool modify mdadm -x %s' % tempdir_mdadm)
+ runCmd('devtool modify m4 -x %s' % tempdir_m4)
+ assertNoFile(tempdir_mdadm, 'mdadm')
+ assertNoFile(builddir_m4, 'src/m4')
+ result = bitbake('m4 -e')
+ result = bitbake('mdadm m4 -c compile')
+ self.assertEqual(result.status, 0)
+ assertFile(tempdir_mdadm, 'mdadm')
+ assertFile(builddir_m4, 'src/m4')
+ # Check that buildclean task exists and does call make clean
+ bitbake('mdadm m4 -c buildclean')
+ assertNoFile(tempdir_mdadm, 'mdadm')
+ assertNoFile(builddir_m4, 'src/m4')
+ bitbake('mdadm m4 -c compile')
+ assertFile(tempdir_mdadm, 'mdadm')
+ assertFile(builddir_m4, 'src/m4')
+ bitbake('mdadm m4 -c clean')
+ # Check that buildclean task is run before clean for B == S
+ assertNoFile(tempdir_mdadm, 'mdadm')
+ # Check that buildclean task is not run before clean for B != S
+ assertFile(builddir_m4, 'src/m4')
+ finally:
+ self.delete_recipeinc('m4')
+
+ @OETestID(1166)
+ def test_devtool_modify_invalid(self):
+ # Try modifying some recipes
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ testrecipes = 'perf kernel-devsrc package-index core-image-minimal meta-toolchain packagegroup-core-sdk meta-ide-support'.split()
+ # Find actual name of gcc-source since it now includes the version - crude, but good enough for this purpose
+ result = runCmd('bitbake-layers show-recipes gcc-source*')
+ for line in result.output.splitlines():
+ # just match those lines that contain a real target
+ m = re.match('(?P<recipe>^[a-zA-Z0-9.-]+)(?P<colon>:$)', line)
+ if m:
+ testrecipes.append(m.group('recipe'))
+ for testrecipe in testrecipes:
+ # Check it's a valid recipe
+ bitbake('%s -e' % testrecipe)
+ # devtool extract should fail
+ result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed. devtool output: %s' % (testrecipe, result.output))
+ self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe)
+ self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe)
+ # devtool modify should fail
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' % (testrecipe, result.output))
+ self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
+
+ @OETestID(1365)
+ def test_devtool_modify_native(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ # Try modifying some recipes
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ bbclassextended = False
+ inheritnative = False
+ testrecipes = 'mtools-native apt-native desktop-file-utils-native'.split()
+ for testrecipe in testrecipes:
+ checkextend = 'native' in (get_bb_var('BBCLASSEXTEND', testrecipe) or '').split()
+ if not bbclassextended:
+ bbclassextended = checkextend
+ if not inheritnative:
+ inheritnative = not checkextend
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)))
+ self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool modify output: %s' % result.output)
+ result = runCmd('devtool build %s' % testrecipe)
+ self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool build output: %s' % result.output)
+ result = runCmd('devtool reset %s' % testrecipe)
+ self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool reset output: %s' % result.output)
+
+ self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
+ self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
+
+
+ @OETestID(1165)
+ def test_devtool_modify_git(self):
+ # Check preconditions
+ testrecipe = 'psplash'
+ src_uri = get_bb_var('SRC_URI', testrecipe)
+ self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('%s -c cleansstate' % testrecipe)
+ # Try modifying a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found')
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output)
+ matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'psplash_*.bbappend'))
+ self.assertTrue(matches, 'bbappend not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Try building
+ bitbake(testrecipe)
+
+ @OETestID(1167)
+ def test_devtool_modify_localfiles(self):
+ # Check preconditions
+ testrecipe = 'lighttpd'
+ src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split()
+ foundlocal = False
+ for item in src_uri:
+ if item.startswith('file://') and '.patch' not in item:
+ foundlocal = True
+ break
+ self.assertTrue(foundlocal, 'This test expects the %s recipe to fetch local files and it seems that it no longer does' % testrecipe)
+ # Clean up anything in the workdir/sysroot/sstate cache
+ bitbake('%s -c cleansstate' % testrecipe)
+ # Try modifying a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ self.assertExists(os.path.join(tempdir, 'configure.ac'), 'Extracted source could not be found')
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe))
+ self.assertTrue(matches, 'bbappend not created')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(testrecipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Try building
+ bitbake(testrecipe)
+
+ @OETestID(1378)
+ def test_devtool_modify_virtual(self):
+ # Try modifying a virtual recipe
+ virtrecipe = 'virtual/make'
+ realrecipe = 'make'
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool modify %s -x %s' % (virtrecipe, tempdir))
+ self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found')
+ self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created')
+ matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % realrecipe))
+ self.assertTrue(matches, 'bbappend not created %s' % result.output)
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertNotIn(virtrecipe, result.output)
+ self.assertIn(realrecipe, result.output)
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # This is probably sufficient
+
+
+ @OETestID(1169)
+ def test_devtool_update_recipe(self):
+ # Check preconditions
+ testrecipe = 'minicom'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # First, modify a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ # We don't use -x here so that we test the behaviour of devtool modify without it
+ result = runCmd('devtool modify %s %s' % (testrecipe, tempdir))
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Add a couple of commits
+ # FIXME: this only tests adding, need to also test update and remove
+ result = runCmd('echo "Additional line" >> README', cwd=tempdir)
+ result = runCmd('git commit -a -m "Change the README"', cwd=tempdir)
+ result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
+ result = runCmd('git add devtool-new-file', cwd=tempdir)
+ result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
+ self.add_command_to_tearDown('cd %s; rm %s/*.patch; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ ('??', '.*/0001-Change-the-README.patch$'),
+ ('??', '.*/0002-Add-a-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1172)
+ def test_devtool_update_recipe_git(self):
+ # Check preconditions
+ testrecipe = 'mtd-utils'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+ patches = []
+ for entry in src_uri.split():
+ if entry.startswith('file://') and entry.endswith('.patch'):
+ patches.append(entry[7:].split(';')[0])
+ self.assertGreater(len(patches), 0, 'The %s recipe does not appear to contain any patches, so this test will not be effective' % testrecipe)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # First, modify a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Add a couple of commits
+ # FIXME: this only tests adding, need to also test update and remove
+ result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempdir)
+ result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempdir)
+ result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
+ result = runCmd('git add devtool-new-file', cwd=tempdir)
+ result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
+ self.add_command_to_tearDown('cd %s; rm -rf %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe -m srcrev %s' % testrecipe)
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile))] + \
+ [(' D', '.*/%s$' % patch) for patch in patches]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
+ addlines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git"']
+ srcurilines = src_uri.split()
+ srcurilines[0] = 'SRC_URI = "' + srcurilines[0]
+ srcurilines.append('"')
+ removelines = ['SRCREV = ".*"'] + srcurilines
+ for line in result.output.splitlines():
+ if line.startswith('+++') or line.startswith('---'):
+ continue
+ elif line.startswith('+'):
+ matched = False
+ for item in addlines:
+ if re.match(item, line[1:].strip()):
+ matched = True
+ break
+ self.assertTrue(matched, 'Unexpected diff add line: %s' % line)
+ elif line.startswith('-'):
+ matched = False
+ for item in removelines:
+ if re.match(item, line[1:].strip()):
+ matched = True
+ break
+ self.assertTrue(matched, 'Unexpected diff remove line: %s' % line)
+ # Now try with auto mode
+ runCmd('cd %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ result = runCmd('git rev-parse --show-toplevel', cwd=os.path.dirname(recipefile))
+ topleveldir = result.output.strip()
+ relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
+ expected_status = [(' M', os.path.relpath(recipefile, topleveldir)),
+ ('??', '%s/0001-Change-the-Makefile.patch' % relpatchpath),
+ ('??', '%s/0002-Add-a-new-file.patch' % relpatchpath)]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1170)
+ def test_devtool_update_recipe_append(self):
+ # Check preconditions
+ testrecipe = 'mdadm'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # First, modify a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ tempsrcdir = os.path.join(tempdir, 'source')
+ templayerdir = os.path.join(tempdir, 'layer')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempsrcdir))
+ # Check git repo
+ self._check_src_repo(tempsrcdir)
+ # Add a commit
+ result = runCmd("sed 's!\\(#define VERSION\\W*\"[^\"]*\\)\"!\\1-custom\"!' -i ReadMe.c", cwd=tempsrcdir)
+ result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir)
+ self.add_command_to_tearDown('cd %s; rm -f %s/*.patch; git checkout .' % (os.path.dirname(recipefile), testrecipe))
+ # Create a temporary layer and add it to bblayers.conf
+ self._create_temp_layer(templayerdir, True, 'selftestupdaterecipe')
+ # Create the bbappend
+ result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+ self.assertNotIn('WARNING:', result.output)
+ # Check recipe is still clean
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # Check bbappend was created
+ splitpath = os.path.dirname(recipefile).split(os.sep)
+ appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
+ patchfile = os.path.join(appenddir, testrecipe, '0001-Add-our-custom-version.patch')
+ self.assertExists(patchfile, 'Patch file not created')
+
+ # Check bbappend contents
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://0001-Add-our-custom-version.patch"\n',
+ '\n']
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, f.readlines())
+
+ # Check we can run it again and bbappend isn't modified
+ result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, f.readlines())
+ # Drop new commit and check patch gets deleted
+ result = runCmd('git reset HEAD^', cwd=tempsrcdir)
+ result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+ self.assertNotExists(patchfile, 'Patch file not deleted')
+ expectedlines2 = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines2, f.readlines())
+ # Put commit back and check we can run it if layer isn't in bblayers.conf
+ os.remove(bbappendfile)
+ result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir)
+ result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
+ result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+ self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output)
+ self.assertExists(patchfile, 'Patch file not created (with disabled layer)')
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, f.readlines())
+ # Deleting isn't expected to work under these circumstances
+
+ @OETestID(1171)
+ def test_devtool_update_recipe_append_git(self):
+ # Check preconditions
+ testrecipe = 'mtd-utils'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+ for entry in src_uri.split():
+ if entry.startswith('git://'):
+ git_uri = entry
+ break
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # First, modify a recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ tempsrcdir = os.path.join(tempdir, 'source')
+ templayerdir = os.path.join(tempdir, 'layer')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempsrcdir))
+ # Check git repo
+ self._check_src_repo(tempsrcdir)
+ # Add a commit
+ result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempsrcdir)
+ result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
+ self.add_command_to_tearDown('cd %s; rm -f %s/*.patch; git checkout .' % (os.path.dirname(recipefile), testrecipe))
+ # Create a temporary layer
+ os.makedirs(os.path.join(templayerdir, 'conf'))
+ with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f:
+ f.write('BBPATH .= ":${LAYERDIR}"\n')
+ f.write('BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend"\n')
+ f.write('BBFILE_COLLECTIONS += "oeselftesttemplayer"\n')
+ f.write('BBFILE_PATTERN_oeselftesttemplayer = "^${LAYERDIR}/"\n')
+ f.write('BBFILE_PRIORITY_oeselftesttemplayer = "999"\n')
+ f.write('BBFILE_PATTERN_IGNORE_EMPTY_oeselftesttemplayer = "1"\n')
+ f.write('LAYERSERIES_COMPAT_oeselftesttemplayer = "${LAYERSERIES_COMPAT_core}"\n')
+ self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir)
+ result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir)
+ # Create the bbappend
+ result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+ self.assertNotIn('WARNING:', result.output)
+ # Check recipe is still clean
+ self._check_repo_status(os.path.dirname(recipefile), [])
+ # Check bbappend was created
+ splitpath = os.path.dirname(recipefile).split(os.sep)
+ appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
+ self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created')
+
+ # Check bbappend contents
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = set(['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\n'])
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, set(f.readlines()))
+
+ # Check we can run it again and bbappend isn't modified
+ result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, set(f.readlines()))
+ # Drop new commit and check SRCREV changes
+ result = runCmd('git reset HEAD^', cwd=tempsrcdir)
+ result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+ self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created')
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = set(['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\n'])
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, set(f.readlines()))
+ # Put commit back and check we can run it if layer isn't in bblayers.conf
+ os.remove(bbappendfile)
+ result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
+ result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
+ result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+ self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output)
+ self.assertNotExists(os.path.join(appenddir, testrecipe), 'Patch directory should not be created')
+ result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+ expectedlines = set(['SRCREV = "%s"\n' % result.output,
+ '\n',
+ 'SRC_URI = "%s"\n' % git_uri,
+ '\n'])
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, set(f.readlines()))
+ # Deleting isn't expected to work under these circumstances
+
+ @OETestID(1370)
+ def test_devtool_update_recipe_local_files(self):
+ """Check that local source files are copied over instead of patched"""
+ testrecipe = 'makedevs'
+ recipefile = get_bb_var('FILE', testrecipe)
+ # Setup srctree for modifying the recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be
+ # building it)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Try building just to ensure we haven't broken that
+ bitbake("%s" % testrecipe)
+ # Edit / commit local source
+ runCmd('echo "/* Foobar */" >> oe-local-files/makedevs.c', cwd=tempdir)
+ runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
+ runCmd('echo "Bar" > new-file', cwd=tempdir)
+ runCmd('git add new-file', cwd=tempdir)
+ runCmd('git commit -m "Add new file"', cwd=tempdir)
+ self.add_command_to_tearDown('cd %s; git clean -fd .; git checkout .' %
+ os.path.dirname(recipefile))
+ runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ (' M', '.*/makedevs/makedevs.c$'),
+ ('??', '.*/makedevs/new-local$'),
+ ('??', '.*/makedevs/0001-Add-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1371)
+ def test_devtool_update_recipe_local_files_2(self):
+ """Check local source files support when oe-local-files is in Git"""
+ testrecipe = 'devtool-test-local'
+ recipefile = get_bb_var('FILE', testrecipe)
+ recipedir = os.path.dirname(recipefile)
+ result = runCmd('git status --porcelain .', cwd=recipedir)
+ if result.output.strip():
+ self.fail('Recipe directory for %s contains uncommitted changes' % testrecipe)
+ # Setup srctree for modifying the recipe
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # Check git repo
+ self._check_src_repo(tempdir)
+ # Add oe-local-files to Git
+ runCmd('rm oe-local-files/.gitignore', cwd=tempdir)
+ runCmd('git add oe-local-files', cwd=tempdir)
+ runCmd('git commit -m "Add local sources"', cwd=tempdir)
+ # Edit / commit local sources
+ runCmd('echo "# Foobar" >> oe-local-files/file1', cwd=tempdir)
+ runCmd('git commit -am "Edit existing file"', cwd=tempdir)
+ runCmd('git rm oe-local-files/file2', cwd=tempdir)
+ runCmd('git commit -m"Remove file"', cwd=tempdir)
+ runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
+ runCmd('git add oe-local-files/new-local', cwd=tempdir)
+ runCmd('git commit -m "Add new local file"', cwd=tempdir)
+ runCmd('echo "Gar" > new-file', cwd=tempdir)
+ runCmd('git add new-file', cwd=tempdir)
+ runCmd('git commit -m "Add new file"', cwd=tempdir)
+ self.add_command_to_tearDown('cd %s; git clean -fd .; git checkout .' %
+ os.path.dirname(recipefile))
+ # Checkout unmodified file to working copy -> devtool should still pick
+ # the modified version from HEAD
+ runCmd('git checkout HEAD^ -- oe-local-files/file1', cwd=tempdir)
+ runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)),
+ (' M', '.*/file1$'),
+ (' D', '.*/file2$'),
+ ('??', '.*/new-local$'),
+ ('??', '.*/0001-Add-new-file.patch$')]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1627)
+ def test_devtool_update_recipe_local_files_3(self):
+ # First, modify the recipe
+ testrecipe = 'devtool-test-localonly'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s' % testrecipe)
+ # Modify one file
+ runCmd('echo "Another line" >> file2', cwd=os.path.join(self.workspacedir, 'sources', testrecipe, 'oe-local-files'))
+ self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1629)
+ def test_devtool_update_recipe_local_patch_gz(self):
+ # First, modify the recipe
+ testrecipe = 'devtool-test-patch-gz'
+ if get_bb_var('DISTRO') == 'poky-tiny':
+ self.skipTest("The DISTRO 'poky-tiny' does not provide the dependencies needed by %s" % testrecipe)
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s' % testrecipe)
+ # Modify one file
+ srctree = os.path.join(self.workspacedir, 'sources', testrecipe)
+ runCmd('echo "Another line" >> README', cwd=srctree)
+ runCmd('git commit -a --amend --no-edit', cwd=srctree)
+ self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = [(' M', '.*/%s/readme.patch.gz$' % testrecipe)]
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ patch_gz = os.path.join(os.path.dirname(recipefile), testrecipe, 'readme.patch.gz')
+ result = runCmd('file %s' % patch_gz)
+ if 'gzip compressed data' not in result.output:
+ self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
+
+ @OETestID(1628)
+ def test_devtool_update_recipe_local_files_subdir(self):
+ # Try devtool update-recipe on a recipe that has a file with subdir= set in
+ # SRC_URI such that it overwrites a file that was in an archive that
+ # was also in SRC_URI
+ # First, modify the recipe
+ testrecipe = 'devtool-test-subdir'
+ bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
+ recipefile = bb_vars['FILE']
+ src_uri = bb_vars['SRC_URI']
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # (don't bother with cleaning the recipe on teardown, we won't be building it)
+ result = runCmd('devtool modify %s' % testrecipe)
+ testfile = os.path.join(self.workspacedir, 'sources', testrecipe, 'testfile')
+ self.assertExists(testfile, 'Extracted source could not be found')
+ with open(testfile, 'r') as f:
+ contents = f.read().rstrip()
+ self.assertEqual(contents, 'Modified version', 'File has apparently not been overwritten as it should have been')
+ # Test devtool update-recipe without modifying any files
+ self.add_command_to_tearDown('cd %s; rm %s/*; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+ result = runCmd('devtool update-recipe %s' % testrecipe)
+ expected_status = []
+ self._check_repo_status(os.path.dirname(recipefile), expected_status)
+
+ @OETestID(1163)
+ def test_devtool_extract(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ # Try devtool extract
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool extract matchbox-terminal %s' % tempdir)
+ self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found')
+ self._check_src_repo(tempdir)
+
+ @OETestID(1379)
+ def test_devtool_extract_virtual(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ # Try devtool extract
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool extract virtual/make %s' % tempdir)
+ self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found')
+ self._check_src_repo(tempdir)
+
+ @OETestID(1168)
+ def test_devtool_reset_all(self):
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ testrecipe1 = 'mdadm'
+ testrecipe2 = 'cronie'
+ result = runCmd('devtool modify -x %s %s' % (testrecipe1, os.path.join(tempdir, testrecipe1)))
+ result = runCmd('devtool modify -x %s %s' % (testrecipe2, os.path.join(tempdir, testrecipe2)))
+ result = runCmd('devtool build %s' % testrecipe1)
+ result = runCmd('devtool build %s' % testrecipe2)
+ stampprefix1 = get_bb_var('STAMP', testrecipe1)
+ self.assertTrue(stampprefix1, 'Unable to get STAMP value for recipe %s' % testrecipe1)
+ stampprefix2 = get_bb_var('STAMP', testrecipe2)
+ self.assertTrue(stampprefix2, 'Unable to get STAMP value for recipe %s' % testrecipe2)
+ result = runCmd('devtool reset -a')
+ self.assertIn(testrecipe1, result.output)
+ self.assertIn(testrecipe2, result.output)
+ result = runCmd('devtool status')
+ self.assertNotIn(testrecipe1, result.output)
+ self.assertNotIn(testrecipe2, result.output)
+ matches1 = glob.glob(stampprefix1 + '*')
+ self.assertFalse(matches1, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe1)
+ matches2 = glob.glob(stampprefix2 + '*')
+ self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
+
+ @OETestID(1272)
+ def test_devtool_deploy_target(self):
+ # NOTE: Whilst this test would seemingly be better placed as a runtime test,
+ # unfortunately the runtime tests run under bitbake and you can't run
+ # devtool within bitbake (since devtool needs to run bitbake itself).
+ # Additionally we are testing build-time functionality as well, so
+ # really this has to be done as an oe-selftest test.
+ #
+ # Check preconditions
+ machine = get_bb_var('MACHINE')
+ if not machine.startswith('qemu'):
+ self.skipTest('This test only works with qemu machines')
+ if not os.path.exists('/etc/runqemu-nosudo'):
+ self.skipTest('You must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
+ result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ip tuntap show', ignore_status=True)
+ if result.status != 0:
+ result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ifconfig -a', ignore_status=True)
+ if result.status != 0:
+ self.skipTest('Failed to determine if tap devices exist with ifconfig or ip: %s' % result.output)
+ for line in result.output.splitlines():
+ if line.startswith('tap'):
+ break
+ else:
+ self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ # Definitions
+ testrecipe = 'mdadm'
+ testfile = '/sbin/mdadm'
+ testimage = 'oe-selftest-image'
+ testcommand = '/sbin/mdadm --help'
+ # Build an image to run
+ bitbake("%s qemu-native qemu-helper-native" % testimage)
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ self.add_command_to_tearDown('bitbake -c clean %s' % testimage)
+ self.add_command_to_tearDown('rm -f %s/%s*' % (deploy_dir_image, testimage))
+ # Clean recipe so the first deploy will fail
+ bitbake("%s -c clean" % testrecipe)
+ # Try devtool modify
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+ result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+ # Test that deploy-target at this point fails (properly)
+ result = runCmd('devtool deploy-target -n %s root@localhost' % testrecipe, ignore_status=True)
+ self.assertNotEqual(result.output, 0, 'devtool deploy-target should have failed, output: %s' % result.output)
+ self.assertNotIn(result.output, 'Traceback', 'devtool deploy-target should have failed with a proper error not a traceback, output: %s' % result.output)
+ result = runCmd('devtool build %s' % testrecipe)
+ # First try a dry-run of deploy-target
+ result = runCmd('devtool deploy-target -n %s root@localhost' % testrecipe)
+ self.assertIn(' %s' % testfile, result.output)
+ # Boot the image
+ with runqemu(testimage) as qemu:
+ # Now really test deploy-target
+ result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip))
+ # Run a test command to see if it was installed properly
+ sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
+ # Check if it deployed all of the files with the right ownership/perms
+ # First look on the host - need to do this under pseudo to get the correct ownership/perms
+ bb_vars = get_bb_vars(['D', 'FAKEROOTENV', 'FAKEROOTCMD'], testrecipe)
+ installdir = bb_vars['D']
+ fakerootenv = bb_vars['FAKEROOTENV']
+ fakerootcmd = bb_vars['FAKEROOTCMD']
+ result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir)
+ filelist1 = self._process_ls_output(result.output)
+
+ # Now look on the target
+ tempdir2 = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir2)
+ tmpfilelist = os.path.join(tempdir2, 'files.txt')
+ with open(tmpfilelist, 'w') as f:
+ for line in filelist1:
+ splitline = line.split()
+ f.write(splitline[-1] + '\n')
+ result = runCmd('cat %s | ssh -q %s root@%s \'xargs ls -l\'' % (tmpfilelist, sshargs, qemu.ip))
+ filelist2 = self._process_ls_output(result.output)
+ filelist1.sort(key=lambda item: item.split()[-1])
+ filelist2.sort(key=lambda item: item.split()[-1])
+ self.assertEqual(filelist1, filelist2)
+ # Test undeploy-target
+ result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip))
+ result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
+ self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
+
+ @OETestID(1366)
+ def test_devtool_build_image(self):
+ """Test devtool build-image plugin"""
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ image = 'core-image-minimal'
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % image)
+ bitbake('%s -c clean' % image)
+ # Add target and native recipes to workspace
+ recipes = ['mdadm', 'parted-native']
+ for recipe in recipes:
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
+ runCmd('devtool modify %s -x %s' % (recipe, tempdir))
+ # Try to build image
+ result = runCmd('devtool build-image %s' % image)
+ self.assertNotEqual(result, 0, 'devtool build-image failed')
+ # Check if image contains expected packages
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ image_link_name = get_bb_var('IMAGE_LINK_NAME', image)
+ reqpkgs = [item for item in recipes if not item.endswith('-native')]
+ with open(os.path.join(deploy_dir_image, image_link_name + '.manifest'), 'r') as f:
+ for line in f:
+ splitval = line.split()
+ if splitval:
+ pkg = splitval[0]
+ if pkg in reqpkgs:
+ reqpkgs.remove(pkg)
+ if reqpkgs:
+ self.fail('The following packages were not present in the image as expected: %s' % ', '.join(reqpkgs))
+
+ @OETestID(1367)
+ def test_devtool_upgrade(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # Check parameters
+ result = runCmd('devtool upgrade -h')
+ for param in 'recipename srctree --version -V --branch -b --keep-temp --no-patch'.split():
+ self.assertIn(param, result.output)
+ # For the moment, we are using a real recipe.
+ recipe = 'devtool-upgrade-test1'
+ version = '1.6.0'
+ oldrecipefile = get_bb_var('FILE', recipe)
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ # Check that recipe is not already under devtool control
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output)
+ # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that
+ # we are downgrading instead of upgrading.
+ result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version))
+ # Check if srctree at least is populated
+ self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, version))
+ # Check new recipe subdirectory is present
+ self.assertExists(os.path.join(self.workspacedir, 'recipes', recipe, '%s-%s' % (recipe, version)), 'Recipe folder should exist')
+ # Check new recipe file is present
+ newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version))
+ self.assertExists(newrecipefile, 'Recipe file should exist after upgrade')
+ # Check devtool status and make sure recipe is present
+ result = runCmd('devtool status')
+ self.assertIn(recipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Check recipe got changed as expected
+ with open(oldrecipefile + '.upgraded', 'r') as f:
+ desiredlines = f.readlines()
+ with open(newrecipefile, 'r') as f:
+ newlines = f.readlines()
+ self.assertEqual(desiredlines, newlines)
+ # Check devtool reset recipe
+ result = runCmd('devtool reset %s -n' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output)
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting')
+
+ @OETestID(1433)
+ def test_devtool_upgrade_git(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ recipe = 'devtool-upgrade-test2'
+ commit = '6cc6077a36fe2648a5f993fe7c16c9632f946517'
+ oldrecipefile = get_bb_var('FILE', recipe)
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ # Check that recipe is not already under devtool control
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output)
+ # Check upgrade
+ result = runCmd('devtool upgrade %s %s -S %s' % (recipe, tempdir, commit))
+ # Check if srctree at least is populated
+ self.assertTrue(len(os.listdir(tempdir)) > 0, 'srctree (%s) should be populated with new (%s) source code' % (tempdir, commit))
+ # Check new recipe file is present
+ newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, os.path.basename(oldrecipefile))
+ self.assertExists(newrecipefile, 'Recipe file should exist after upgrade')
+ # Check devtool status and make sure recipe is present
+ result = runCmd('devtool status')
+ self.assertIn(recipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Check recipe got changed as expected
+ with open(oldrecipefile + '.upgraded', 'r') as f:
+ desiredlines = f.readlines()
+ with open(newrecipefile, 'r') as f:
+ newlines = f.readlines()
+ self.assertEqual(desiredlines, newlines)
+ # Check devtool reset recipe
+ result = runCmd('devtool reset %s -n' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output)
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting')
+
+ @OETestID(1352)
+ def test_devtool_layer_plugins(self):
+ """Test that devtool can use plugins from other layers.
+
+ This test executes the selftest-reverse command from meta-selftest."""
+
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ s = "Microsoft Made No Profit From Anyone's Zunes Yo"
+ result = runCmd("devtool --quiet selftest-reverse \"%s\"" % s)
+ self.assertEqual(result.output, s[::-1])
+
+ def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
+ dstdir = basedstdir
+ self.assertExists(dstdir)
+ for p in paths:
+ dstdir = os.path.join(dstdir, p)
+ if not os.path.exists(dstdir):
+ os.makedirs(dstdir)
+ self.track_for_cleanup(dstdir)
+ dstfile = os.path.join(dstdir, os.path.basename(srcfile))
+ if srcfile != dstfile:
+ shutil.copy(srcfile, dstfile)
+ self.track_for_cleanup(dstfile)
+
+ @OETestID(1625)
+ def test_devtool_load_plugin(self):
+ """Test that devtool loads only the first found plugin in BBPATH."""
+
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ devtool = runCmd("which devtool")
+ fromname = runCmd("devtool --quiet pluginfile")
+ srcfile = fromname.output
+ bbpath = get_bb_var('BBPATH')
+ searchpath = bbpath.split(':') + [os.path.dirname(devtool.output)]
+ plugincontent = []
+ with open(srcfile) as fh:
+ plugincontent = fh.readlines()
+ try:
+ self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found')
+ for path in searchpath:
+ self._copy_file_with_cleanup(srcfile, path, 'lib', 'devtool')
+ result = runCmd("devtool --quiet count")
+ self.assertEqual(result.output, '1')
+ result = runCmd("devtool --quiet multiloaded")
+ self.assertEqual(result.output, "no")
+ for path in searchpath:
+ result = runCmd("devtool --quiet bbdir")
+ self.assertEqual(result.output, path)
+ os.unlink(os.path.join(result.output, 'lib', 'devtool', 'bbpath.py'))
+ finally:
+ with open(srcfile, 'w') as fh:
+ fh.writelines(plugincontent)
+
+ def _setup_test_devtool_finish_upgrade(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ # Use a "real" recipe from meta-selftest
+ recipe = 'devtool-upgrade-test1'
+ oldversion = '1.5.3'
+ newversion = '1.6.0'
+ oldrecipefile = get_bb_var('FILE', recipe)
+ recipedir = os.path.dirname(oldrecipefile)
+ result = runCmd('git status --porcelain .', cwd=recipedir)
+ if result.output.strip():
+ self.fail('Recipe directory for %s contains uncommitted changes' % recipe)
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ # Check that recipe is not already under devtool control
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output)
+ # Do the upgrade
+ result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, newversion))
+ # Check devtool status and make sure recipe is present
+ result = runCmd('devtool status')
+ self.assertIn(recipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Make a change to the source
+ result = runCmd('sed -i \'/^#include "pv.h"/a \\/* Here is a new comment *\\/\' src/pv/number.c', cwd=tempdir)
+ result = runCmd('git status --porcelain', cwd=tempdir)
+ self.assertIn('M src/pv/number.c', result.output)
+ result = runCmd('git commit src/pv/number.c -m "Add a comment to the code"', cwd=tempdir)
+ # Check if patch is there
+ recipedir = os.path.dirname(oldrecipefile)
+ olddir = os.path.join(recipedir, recipe + '-' + oldversion)
+ patchfn = '0001-Add-a-note-line-to-the-quick-reference.patch'
+ self.assertExists(os.path.join(olddir, patchfn), 'Original patch file does not exist')
+ return recipe, oldrecipefile, recipedir, olddir, newversion, patchfn
+
+ @OETestID(1623)
+ def test_devtool_finish_upgrade_origlayer(self):
+ recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade()
+ # Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
+ self.assertIn('/meta-selftest/', recipedir)
+ # Try finish to the original layer
+ self.add_command_to_tearDown('rm -rf %s ; cd %s ; git checkout %s' % (recipedir, os.path.dirname(recipedir), recipedir))
+ result = runCmd('devtool finish %s meta-selftest' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish')
+ self.assertNotExists(oldrecipefile, 'Old recipe file should have been deleted but wasn\'t')
+ self.assertNotExists(os.path.join(olddir, patchfn), 'Old patch file should have been deleted but wasn\'t')
+ newrecipefile = os.path.join(recipedir, '%s_%s.bb' % (recipe, newversion))
+ newdir = os.path.join(recipedir, recipe + '-' + newversion)
+ self.assertExists(newrecipefile, 'New recipe file should have been copied into existing layer but wasn\'t')
+ self.assertExists(os.path.join(newdir, patchfn), 'Patch file should have been copied into new directory but wasn\'t')
+ self.assertExists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch'), 'New patch file should have been created but wasn\'t')
+
+ @OETestID(1624)
+ def test_devtool_finish_upgrade_otherlayer(self):
+ recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade()
+ # Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
+ self.assertIn('/meta-selftest/', recipedir)
+ # Try finish to a different layer - should create a bbappend
+ # This cleanup isn't strictly necessary but do it anyway just in case it goes wrong and writes to here
+ self.add_command_to_tearDown('rm -rf %s ; cd %s ; git checkout %s' % (recipedir, os.path.dirname(recipedir), recipedir))
+ oe_core_dir = os.path.join(get_bb_var('COREBASE'), 'meta')
+ newrecipedir = os.path.join(oe_core_dir, 'recipes-test', 'devtool')
+ newrecipefile = os.path.join(newrecipedir, '%s_%s.bb' % (recipe, newversion))
+ self.track_for_cleanup(newrecipedir)
+ result = runCmd('devtool finish %s oe-core' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish')
+ self.assertExists(oldrecipefile, 'Old recipe file should not have been deleted')
+ self.assertExists(os.path.join(olddir, patchfn), 'Old patch file should not have been deleted')
+ newdir = os.path.join(newrecipedir, recipe + '-' + newversion)
+ self.assertExists(newrecipefile, 'New recipe file should have been copied into existing layer but wasn\'t')
+ self.assertExists(os.path.join(newdir, patchfn), 'Patch file should have been copied into new directory but wasn\'t')
+ self.assertExists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch'), 'New patch file should have been created but wasn\'t')
+
+ def _setup_test_devtool_finish_modify(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ # Try modifying a recipe
+ self.track_for_cleanup(self.workspacedir)
+ recipe = 'mdadm'
+ oldrecipefile = get_bb_var('FILE', recipe)
+ recipedir = os.path.dirname(oldrecipefile)
+ result = runCmd('git status --porcelain .', cwd=recipedir)
+ if result.output.strip():
+ self.fail('Recipe directory for %s contains uncommitted changes' % recipe)
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ self.track_for_cleanup(tempdir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ result = runCmd('devtool modify %s %s' % (recipe, tempdir))
+ self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
+ # Test devtool status
+ result = runCmd('devtool status')
+ self.assertIn(recipe, result.output)
+ self.assertIn(tempdir, result.output)
+ # Make a change to the source
+ result = runCmd('sed -i \'/^#include "mdadm.h"/a \\/* Here is a new comment *\\/\' maps.c', cwd=tempdir)
+ result = runCmd('git status --porcelain', cwd=tempdir)
+ self.assertIn('M maps.c', result.output)
+ result = runCmd('git commit maps.c -m "Add a comment to the code"', cwd=tempdir)
+ for entry in os.listdir(recipedir):
+ filesdir = os.path.join(recipedir, entry)
+ if os.path.isdir(filesdir):
+ break
+ else:
+ self.fail('Unable to find recipe files directory for %s' % recipe)
+ return recipe, oldrecipefile, recipedir, filesdir
+
+ @OETestID(1621)
+ def test_devtool_finish_modify_origlayer(self):
+ recipe, oldrecipefile, recipedir, filesdir = self._setup_test_devtool_finish_modify()
+ # Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
+ self.assertIn('/meta/', recipedir)
+ # Try finish to the original layer
+ self.add_command_to_tearDown('rm -rf %s ; cd %s ; git checkout %s' % (recipedir, os.path.dirname(recipedir), recipedir))
+ result = runCmd('devtool finish %s meta' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish')
+ expected_status = [(' M', '.*/%s$' % os.path.basename(oldrecipefile)),
+ ('??', '.*/.*-Add-a-comment-to-the-code.patch$')]
+ self._check_repo_status(recipedir, expected_status)
+
+ @OETestID(1622)
+ def test_devtool_finish_modify_otherlayer(self):
+ recipe, oldrecipefile, recipedir, filesdir = self._setup_test_devtool_finish_modify()
+ # Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
+ self.assertIn('/meta/', recipedir)
+ relpth = os.path.relpath(recipedir, os.path.join(get_bb_var('COREBASE'), 'meta'))
+ appenddir = os.path.join(get_test_layer(), relpth)
+ self.track_for_cleanup(appenddir)
+ # Try finish to the original layer
+ self.add_command_to_tearDown('rm -rf %s ; cd %s ; git checkout %s' % (recipedir, os.path.dirname(recipedir), recipedir))
+ result = runCmd('devtool finish %s meta-selftest' % recipe)
+ result = runCmd('devtool status')
+ self.assertNotIn(recipe, result.output, 'Recipe should have been reset by finish but wasn\'t')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after finish')
+ result = runCmd('git status --porcelain .', cwd=recipedir)
+ if result.output.strip():
+ self.fail('Recipe directory for %s contains the following unexpected changes after finish:\n%s' % (recipe, result.output.strip()))
+ recipefn = os.path.splitext(os.path.basename(oldrecipefile))[0]
+ recipefn = recipefn.split('_')[0] + '_%'
+ appendfile = os.path.join(appenddir, recipefn + '.bbappend')
+ self.assertExists(appendfile, 'bbappend %s should have been created but wasn\'t' % appendfile)
+ newdir = os.path.join(appenddir, recipe)
+ files = os.listdir(newdir)
+ foundpatch = None
+ for fn in files:
+ if fnmatch.fnmatch(fn, '*-Add-a-comment-to-the-code.patch'):
+ foundpatch = fn
+ if not foundpatch:
+ self.fail('No patch file created next to bbappend')
+ files.remove(foundpatch)
+ if files:
+ self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files))
+
+ @OETestID(1626)
+ def test_devtool_rename(self):
+ # Check preconditions
+ self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+ # First run devtool add
+ # We already have this recipe in OE-Core, but that doesn't matter
+ recipename = 'i2c-tools'
+ recipever = '3.1.2'
+ recipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, recipever))
+ url = 'http://downloads.yoctoproject.org/mirror/sources/i2c-tools-%s.tar.bz2' % recipever
+ def add_recipe():
+ result = runCmd('devtool add %s' % url)
+ self.assertExists(recipefile, 'Expected recipe file not created')
+ self.assertExists(os.path.join(self.workspacedir, 'sources', recipename), 'Source directory not created')
+ checkvars = {}
+ checkvars['S'] = None
+ checkvars['SRC_URI'] = url.replace(recipever, '${PV}')
+ self._test_recipe_contents(recipefile, checkvars, [])
+ add_recipe()
+ # Now rename it - change both name and version
+ newrecipename = 'mynewrecipe'
+ newrecipever = '456'
+ newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, newrecipever))
+ result = runCmd('devtool rename %s %s -V %s' % (recipename, newrecipename, newrecipever))
+ self.assertExists(newrecipefile, 'Recipe file not renamed')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipename), 'Old recipe directory still exists')
+ newsrctree = os.path.join(self.workspacedir, 'sources', newrecipename)
+ self.assertExists(newsrctree, 'Source directory not renamed')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/%s-%s' % (recipename, recipever)
+ checkvars['SRC_URI'] = url
+ self._test_recipe_contents(newrecipefile, checkvars, [])
+ # Try again - change just name this time
+ result = runCmd('devtool reset -n %s' % newrecipename)
+ shutil.rmtree(newsrctree)
+ add_recipe()
+ newrecipefile = os.path.join(self.workspacedir, 'recipes', newrecipename, '%s_%s.bb' % (newrecipename, recipever))
+ result = runCmd('devtool rename %s %s' % (recipename, newrecipename))
+ self.assertExists(newrecipefile, 'Recipe file not renamed')
+ self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipename), 'Old recipe directory still exists')
+ self.assertExists(os.path.join(self.workspacedir, 'sources', newrecipename), 'Source directory not renamed')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/%s-${PV}' % recipename
+ checkvars['SRC_URI'] = url.replace(recipever, '${PV}')
+ self._test_recipe_contents(newrecipefile, checkvars, [])
+ # Try again - change just version this time
+ result = runCmd('devtool reset -n %s' % newrecipename)
+ shutil.rmtree(newsrctree)
+ add_recipe()
+ newrecipefile = os.path.join(self.workspacedir, 'recipes', recipename, '%s_%s.bb' % (recipename, newrecipever))
+ result = runCmd('devtool rename %s -V %s' % (recipename, newrecipever))
+ self.assertExists(newrecipefile, 'Recipe file not renamed')
+ self.assertExists(os.path.join(self.workspacedir, 'sources', recipename), 'Source directory no longer exists')
+ checkvars = {}
+ checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever
+ checkvars['SRC_URI'] = url
+ self._test_recipe_contents(newrecipefile, checkvars, [])
+
+ @OETestID(1577)
+ def test_devtool_virtual_kernel_modify(self):
+ """
+ Summary: The purpose of this test case is to verify that
+ devtool modify works correctly when building
+ the kernel.
+ Dependencies: NA
+ Steps: 1. Build kernel with bitbake.
+ 2. Save the config file generated.
+ 3. Clean the environment.
+ 4. Use `devtool modify virtual/kernel` to validate following:
+ 4.1 The source is checked out correctly.
+ 4.2 The resulting configuration is the same as
+ what was get on step 2.
+ 4.3 The Kernel can be build correctly.
+ 4.4 Changes made on the source are reflected on the
+ subsequent builds.
+ 4.5 Changes on the configuration are reflected on the
+ subsequent builds
+ Expected: devtool modify is able to checkout the source of the kernel
+ and modification to the source and configurations are reflected
+ when building the kernel.
+ """
+ kernel_provider = get_bb_var('PREFERRED_PROVIDER_virtual/kernel')
+ # Clean up the enviroment
+ bitbake('%s -c clean' % kernel_provider)
+ tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+ tempdir_cfg = tempfile.mkdtemp(prefix='config_qa')
+ self.track_for_cleanup(tempdir)
+ self.track_for_cleanup(tempdir_cfg)
+ self.track_for_cleanup(self.workspacedir)
+ self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+ self.add_command_to_tearDown('bitbake -c clean %s' % kernel_provider)
+ #Step 1
+ #Here is just generated the config file instead of all the kernel to optimize the
+ #time of executing this test case.
+ bitbake('%s -c configure' % kernel_provider)
+ bbconfig = os.path.join(get_bb_var('B', kernel_provider),'.config')
+ #Step 2
+ runCmd('cp %s %s' % (bbconfig, tempdir_cfg))
+ self.assertExists(os.path.join(tempdir_cfg, '.config'), 'Could not copy .config file from kernel')
+
+ tmpconfig = os.path.join(tempdir_cfg, '.config')
+ #Step 3
+ bitbake('%s -c clean' % kernel_provider)
+ #Step 4.1
+ runCmd('devtool modify virtual/kernel -x %s' % tempdir)
+ self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found')
+ #Step 4.2
+ configfile = os.path.join(tempdir,'.config')
+ diff = runCmd('diff %s %s' % (tmpconfig, configfile))
+ self.assertEqual(0,diff.status,'Kernel .config file is not the same using bitbake and devtool')
+ #Step 4.3
+ #NOTE: virtual/kernel is mapped to kernel_provider
+ result = runCmd('devtool build %s' % kernel_provider)
+ self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`')
+ kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', kernel_provider), 'vmlinux')
+ self.assertExists(kernelfile, 'Kernel was not build correctly')
+
+ #Modify the kernel source
+ modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
+ modstring = "Use a boot loader. Devtool testing."
+ modapplied = runCmd("sed -i 's/Use a boot loader./%s/' %s" % (modstring, modfile))
+ self.assertEqual(0,modapplied.status,'Modification to %s on kernel source failed' % modfile)
+ #Modify the configuration
+ codeconfigfile = os.path.join(tempdir,'.config.new')
+ modconfopt = "CONFIG_SG_POOL=n"
+ modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile))
+ self.assertEqual(0,modconf.status,'Modification to %s failed' % codeconfigfile)
+ #Build again kernel with devtool
+ rebuild = runCmd('devtool build %s' % kernel_provider)
+ self.assertEqual(0,rebuild.status,'Fail to build kernel after modification of source and config')
+ #Step 4.4
+ bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME', kernel_provider)
+ bzimagefile = os.path.join(get_bb_var('D', kernel_provider),'boot', bzimagename)
+ checkmodcode = runCmd("grep '%s' %s" % (modstring, bzimagefile))
+ self.assertEqual(0,checkmodcode.status,'Modification on kernel source failed')
+ #Step 4.5
+ checkmodconfg = runCmd("grep %s %s" % (modconfopt, codeconfigfile))
+ self.assertEqual(0,checkmodconfg.status,'Modification to configuration file failed')
diff --git a/poky/meta/lib/oeqa/selftest/cases/distrodata.py b/poky/meta/lib/oeqa/selftest/cases/distrodata.py
new file mode 100644
index 000000000..7b2800464
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -0,0 +1,99 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+from oeqa.utils.decorators import testcase
+from oeqa.utils.ftools import write_file
+from oeqa.core.decorator.oeid import OETestID
+
+class Distrodata(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(Distrodata, cls).setUpClass()
+ feature = 'INHERIT += "distrodata"\n'
+ feature += 'LICENSE_FLAGS_WHITELIST += " commercial"\n'
+
+ cls.write_config(cls, feature)
+ bitbake('-c checkpkg world')
+
+ @OETestID(1902)
+ def test_checkpkg(self):
+ """
+ Summary: Test that upstream version checks do not regress
+ Expected: Upstream version checks should succeed except for the recipes listed in the exception list.
+ Product: oe-core
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ """
+ checkpkg_result = open(os.path.join(get_bb_var("LOG_DIR"), "checkpkg.csv")).readlines()[1:]
+ regressed_failures = [pkg_data[0] for pkg_data in [pkg_line.split('\t') for pkg_line in checkpkg_result] if pkg_data[11] == 'UNKNOWN_BROKEN']
+ regressed_successes = [pkg_data[0] for pkg_data in [pkg_line.split('\t') for pkg_line in checkpkg_result] if pkg_data[11] == 'KNOWN_BROKEN']
+ msg = ""
+ if len(regressed_failures) > 0:
+ msg = msg + """
+The following packages failed upstream version checks. Please fix them using UPSTREAM_CHECK_URI/UPSTREAM_CHECK_REGEX
+(when using tarballs) or UPSTREAM_CHECK_GITTAGREGEX (when using git). If an upstream version check cannot be performed
+(for example, if upstream does not use git tags), you can set UPSTREAM_VERSION_UNKNOWN to '1' in the recipe to acknowledge
+that the check cannot be performed.
+""" + "\n".join(regressed_failures)
+ if len(regressed_successes) > 0:
+ msg = msg + """
+The following packages have been checked successfully for upstream versions,
+but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please remove that line from the recipes.
+""" + "\n".join(regressed_successes)
+ self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg)
+
+ def test_maintainers(self):
+ """
+ Summary: Test that oe-core recipes have a maintainer
+ Expected: All oe-core recipes (except a few special static/testing ones) should have a maintainer listed in maintainers.inc file.
+ Product: oe-core
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ """
+ def is_exception(pkg):
+ exceptions = ["packagegroup-", "initramfs-", "systemd-machine-units", "target-sdk-provides-dummy"]
+ for i in exceptions:
+ if i in pkg:
+ return True
+ return False
+
+ def is_in_oe_core(recipe, recipes):
+ self.assertTrue(recipe in recipes.keys(), "Recipe %s was not in 'bitbake-layers show-recipes' output" %(recipe))
+ self.assertTrue(len(recipes[recipe]) > 0, "'bitbake-layers show-recipes' could not determine what layer(s) a recipe %s is in" %(recipe))
+ try:
+ recipes[recipe].index('meta')
+ return True
+ except ValueError:
+ return False
+
+ def get_recipe_layers():
+ import re
+
+ recipes = {}
+ recipe_regex = re.compile('^(?P<name>.*):$')
+ layer_regex = re.compile('^ (?P<name>\S*) +')
+ output = runCmd('bitbake-layers show-recipes').output
+ for line in output.split('\n'):
+ recipe_name_obj = recipe_regex.search(line)
+ if recipe_name_obj:
+ recipe_name = recipe_name_obj.group('name')
+ recipes[recipe_name] = []
+ recipe_layer_obj = layer_regex.search(line)
+ if recipe_layer_obj:
+ layer_name = recipe_layer_obj.group('name')
+ recipes[recipe_name].append(layer_name)
+ return recipes
+
+ checkpkg_result = open(os.path.join(get_bb_var("LOG_DIR"), "checkpkg.csv")).readlines()[1:]
+ recipes_layers = get_recipe_layers()
+ no_maintainer_list = [pkg_data[0] for pkg_data in [pkg_line.split('\t') for pkg_line in checkpkg_result] \
+ if pkg_data[14] == '' and is_in_oe_core(pkg_data[0], recipes_layers) and not is_exception(pkg_data[0])]
+ msg = """
+The following packages do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file.
+""" + "\n".join(no_maintainer_list)
+ self.assertTrue(len(no_maintainer_list) == 0, msg)
+
+ with_maintainer_list = [pkg_data[0] for pkg_data in [pkg_line.split('\t') for pkg_line in checkpkg_result] \
+ if pkg_data[14] != '' and is_in_oe_core(pkg_data[0], recipes_layers) and not is_exception(pkg_data[0])]
+ msg = """
+The list of oe-core packages with maintainers is empty. This may indicate that the test has regressed and needs fixing.
+"""
+ self.assertTrue(len(with_maintainer_list) > 0, msg)
diff --git a/poky/meta/lib/oeqa/selftest/cases/eSDK.py b/poky/meta/lib/oeqa/selftest/cases/eSDK.py
new file mode 100644
index 000000000..d03188f2f
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/eSDK.py
@@ -0,0 +1,111 @@
+import tempfile
+import shutil
+import os
+import glob
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+
+class oeSDKExtSelfTest(OESelftestTestCase):
+ """
+ # Bugzilla Test Plan: 6033
+ # This code is planned to be part of the automation for eSDK containig
+ # Install libraries and headers, image generation binary feeds, sdk-update.
+ """
+
+ @staticmethod
+ def get_esdk_environment(env_eSDK, tmpdir_eSDKQA):
+ # XXX: at this time use the first env need to investigate
+ # what environment load oe-selftest, i586, x86_64
+ pattern = os.path.join(tmpdir_eSDKQA, 'environment-setup-*')
+ return glob.glob(pattern)[0]
+
+ @staticmethod
+ def run_esdk_cmd(env_eSDK, tmpdir_eSDKQA, cmd, postconfig=None, **options):
+ if postconfig:
+ esdk_conf_file = os.path.join(tmpdir_eSDKQA, 'conf', 'local.conf')
+ with open(esdk_conf_file, 'a+') as f:
+ f.write(postconfig)
+ if not options:
+ options = {}
+ if not 'shell' in options:
+ options['shell'] = True
+
+ runCmd("cd %s; . %s; %s" % (tmpdir_eSDKQA, env_eSDK, cmd), **options)
+
+ @staticmethod
+ def generate_eSDK(image):
+ pn_task = '%s -c populate_sdk_ext' % image
+ bitbake(pn_task)
+
+ @staticmethod
+ def get_eSDK_toolchain(image):
+ pn_task = '%s -c populate_sdk_ext' % image
+
+ bb_vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAINEXT_OUTPUTNAME'], pn_task)
+ sdk_deploy = bb_vars['SDK_DEPLOY']
+ toolchain_name = bb_vars['TOOLCHAINEXT_OUTPUTNAME']
+ return os.path.join(sdk_deploy, toolchain_name + '.sh')
+
+ @staticmethod
+ def update_configuration(cls, image, tmpdir_eSDKQA, env_eSDK, ext_sdk_path):
+ sstate_dir = os.path.join(os.environ['BUILDDIR'], 'sstate-cache')
+
+ oeSDKExtSelfTest.generate_eSDK(cls.image)
+
+ cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
+ runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
+
+ cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
+
+ sstate_config="""
+SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
+SSTATE_MIRRORS = "file://.* file://%s/PATH"
+CORE_IMAGE_EXTRA_INSTALL = "perl"
+ """ % sstate_dir
+
+ with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
+ f.write(sstate_config)
+
+ @classmethod
+ def setUpClass(cls):
+ super(oeSDKExtSelfTest, cls).setUpClass()
+ cls.tmpdir_eSDKQA = tempfile.mkdtemp(prefix='eSDKQA')
+
+ sstate_dir = get_bb_var('SSTATE_DIR')
+
+ cls.image = 'core-image-minimal'
+ oeSDKExtSelfTest.generate_eSDK(cls.image)
+
+ # Install eSDK
+ cls.ext_sdk_path = oeSDKExtSelfTest.get_eSDK_toolchain(cls.image)
+ runCmd("%s -y -d \"%s\"" % (cls.ext_sdk_path, cls.tmpdir_eSDKQA))
+
+ cls.env_eSDK = oeSDKExtSelfTest.get_esdk_environment('', cls.tmpdir_eSDKQA)
+
+ # Configure eSDK to use sstate mirror from poky
+ sstate_config="""
+SDK_LOCAL_CONF_WHITELIST = "SSTATE_MIRRORS"
+SSTATE_MIRRORS = "file://.* file://%s/PATH"
+ """ % sstate_dir
+ with open(os.path.join(cls.tmpdir_eSDKQA, 'conf', 'local.conf'), 'a+') as f:
+ f.write(sstate_config)
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.tmpdir_eSDKQA, ignore_errors=True)
+ super(oeSDKExtSelfTest, cls).tearDownClass()
+
+ @OETestID(1602)
+ def test_install_libraries_headers(self):
+ pn_sstate = 'bc'
+ bitbake(pn_sstate)
+ cmd = "devtool sdk-install %s " % pn_sstate
+ oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
+
+ @OETestID(1603)
+ def test_image_generation_binary_feeds(self):
+ image = 'core-image-minimal'
+ cmd = "devtool build-image %s" % image
+ oeSDKExtSelfTest.run_esdk_cmd(self.env_eSDK, self.tmpdir_eSDKQA, cmd)
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/efibootpartition.py b/poky/meta/lib/oeqa/selftest/cases/efibootpartition.py
new file mode 100644
index 000000000..0c8325669
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/efibootpartition.py
@@ -0,0 +1,45 @@
+# Based on runqemu.py test file
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+
+import re
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var
+
+class GenericEFITest(OESelftestTestCase):
+ """EFI booting test class"""
+
+ buffer = True
+ cmd_common = "runqemu nographic serial wic ovmf"
+ efi_provider = "systemd-boot"
+ image = "core-image-minimal"
+ machine = "qemux86-64"
+ recipes_built = False
+
+ @classmethod
+ def setUpLocal(self):
+ super(GenericEFITest, self).setUpLocal(self)
+
+ self.write_config(self,
+"""
+EFI_PROVIDER = "%s"
+IMAGE_FSTYPES_pn-%s_append = " wic"
+MACHINE = "%s"
+MACHINE_FEATURES_append = " efi"
+WKS_FILE = "efi-bootdisk.wks.in"
+IMAGE_INSTALL_append = " grub-efi systemd-boot kernel-image-bzimage"
+"""
+% (self.efi_provider, self.image, self.machine))
+ if not self.recipes_built:
+ bitbake("ovmf")
+ bitbake(self.image)
+ self.recipes_built = True
+
+ @classmethod
+ def test_boot_efi(self):
+ """Test generic boot partition with qemu"""
+ cmd = "%s %s" % (self.cmd_common, self.machine)
+ with runqemu(self.image, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
diff --git a/poky/meta/lib/oeqa/selftest/cases/gotoolchain.py b/poky/meta/lib/oeqa/selftest/cases/gotoolchain.py
new file mode 100644
index 000000000..1e23257f4
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/gotoolchain.py
@@ -0,0 +1,67 @@
+import glob
+import os
+import shutil
+import tempfile
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_vars
+
+
+class oeGoToolchainSelfTest(OESelftestTestCase):
+ """
+ Test cases for OE's Go toolchain
+ """
+
+ @staticmethod
+ def get_sdk_environment(tmpdir_SDKQA):
+ pattern = os.path.join(tmpdir_SDKQA, "environment-setup-*")
+ # FIXME: this is a very naive implementation
+ return glob.glob(pattern)[0]
+
+ @staticmethod
+ def get_sdk_toolchain():
+ bb_vars = get_bb_vars(['SDK_DEPLOY', 'TOOLCHAIN_OUTPUTNAME'],
+ "meta-go-toolchain")
+ sdk_deploy = bb_vars['SDK_DEPLOY']
+ toolchain_name = bb_vars['TOOLCHAIN_OUTPUTNAME']
+ return os.path.join(sdk_deploy, toolchain_name + ".sh")
+
+ @classmethod
+ def setUpClass(cls):
+ super(oeGoToolchainSelfTest, cls).setUpClass()
+ cls.tmpdir_SDKQA = tempfile.mkdtemp(prefix='SDKQA')
+ cls.go_path = os.path.join(cls.tmpdir_SDKQA, "go")
+ # Build the SDK and locate it in DEPLOYDIR
+ bitbake("meta-go-toolchain")
+ cls.sdk_path = oeGoToolchainSelfTest.get_sdk_toolchain()
+ # Install the SDK into the tmpdir
+ runCmd("sh %s -y -d \"%s\"" % (cls.sdk_path, cls.tmpdir_SDKQA))
+ cls.env_SDK = oeGoToolchainSelfTest.get_sdk_environment(cls.tmpdir_SDKQA)
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.tmpdir_SDKQA, ignore_errors=True)
+ super(oeGoToolchainSelfTest, cls).tearDownClass()
+
+ def run_sdk_go_command(self, gocmd):
+ cmd = "cd %s; " % self.tmpdir_SDKQA
+ cmd = cmd + ". %s; " % self.env_SDK
+ cmd = cmd + "export GOPATH=%s; " % self.go_path
+ cmd = cmd + "${CROSS_COMPILE}go %s" % gocmd
+ return runCmd(cmd).status
+
+ def test_go_dep_build(self):
+ proj = "github.com/golang"
+ name = "dep"
+ ver = "v0.3.1"
+ archive = ".tar.gz"
+ url = "https://%s/%s/archive/%s%s" % (proj, name, ver, archive)
+
+ runCmd("cd %s; wget %s" % (self.tmpdir_SDKQA, url))
+ runCmd("cd %s; tar -xf %s" % (self.tmpdir_SDKQA, ver+archive))
+ runCmd("mkdir -p %s/src/%s" % (self.go_path, proj))
+ runCmd("mv %s/dep-0.3.1 %s/src/%s/%s"
+ % (self.tmpdir_SDKQA, self.go_path, proj, name))
+ retv = self.run_sdk_go_command('build %s/%s/cmd/dep'
+ % (proj, name))
+ self.assertEqual(retv, 0,
+ msg="Running go build failed for %s" % name)
diff --git a/poky/meta/lib/oeqa/selftest/cases/image_typedep.py b/poky/meta/lib/oeqa/selftest/cases/image_typedep.py
new file mode 100644
index 000000000..e6788853a
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/image_typedep.py
@@ -0,0 +1,53 @@
+import os
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+from oeqa.core.decorator.oeid import OETestID
+
+class ImageTypeDepTests(OESelftestTestCase):
+
+ # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
+ # the conversion type bar gets added as a dep as well
+ @OETestID(1633)
+ def test_conversion_typedep_added(self):
+
+ self.write_recipeinc('emptytest', """
+# Try to empty out the default dependency list
+PACKAGE_INSTALL = ""
+DISTRO_EXTRA_RDEPENDS=""
+
+LICENSE = "MIT"
+IMAGE_FSTYPES = "testfstype"
+
+IMAGE_TYPES_MASKED += "testfstype"
+IMAGE_TYPEDEP_testfstype = "tar.bz2"
+
+inherit image
+
+""")
+ # First get the dependency that should exist for bz2, it will look
+ # like CONVERSION_DEPENDS_bz2="somedep"
+ result = bitbake('-e emptytest')
+
+ for line in result.output.split('\n'):
+ if line.startswith('CONVERSION_DEPENDS_bz2'):
+ dep = line.split('=')[1].strip('"')
+ break
+
+ # Now get the dependency task list and check for the expected task
+ # dependency
+ bitbake('-g emptytest')
+
+ taskdependsfile = os.path.join(self.builddir, 'task-depends.dot')
+ dep = dep + ".do_populate_sysroot"
+ depfound = False
+ expectedline = '"emptytest.do_rootfs" -> "{}"'.format(dep)
+
+ with open(taskdependsfile, "r") as f:
+ for line in f:
+ if line.strip() == expectedline:
+ depfound = True
+ break
+
+ if not depfound:
+ raise AssertionError("\"{}\" not found".format(expectedline))
diff --git a/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
new file mode 100644
index 000000000..09e0b2062
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -0,0 +1,240 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.sshcontrol import SSHControl
+import os
+import json
+
+class ImageFeatures(OESelftestTestCase):
+
+ test_user = 'tester'
+ root_user = 'root'
+
+ buffer = True
+
+ @OETestID(1107)
+ def test_non_root_user_can_connect_via_ssh_without_password(self):
+ """
+ Summary: Check if non root user can connect via ssh without password
+ Expected: 1. Connection to the image via ssh using root user without providing a password should be allowed.
+ 2. Connection to the image via ssh using tester user without providing a password should be allowed.
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh empty-root-password allow-empty-password"\n'
+ features += 'INHERIT += "extrausers"\n'
+ features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
+ self.write_config(features)
+
+ # Build a core-image-minimal
+ bitbake('core-image-minimal')
+
+ with runqemu("core-image-minimal") as qemu:
+ # Attempt to ssh with each user into qemu with empty password
+ for user in [self.root_user, self.test_user]:
+ ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user)
+ status, output = ssh.run("true")
+ self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
+
+ @OETestID(1115)
+ def test_all_users_can_connect_via_ssh_without_password(self):
+ """
+ Summary: Check if all users can connect via ssh without password
+ Expected: 1. Connection to the image via ssh using root user without providing a password should NOT be allowed.
+ 2. Connection to the image via ssh using tester user without providing a password should be allowed.
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh allow-empty-password"\n'
+ features += 'INHERIT += "extrausers"\n'
+ features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
+ self.write_config(features)
+
+ # Build a core-image-minimal
+ bitbake('core-image-minimal')
+
+ with runqemu("core-image-minimal") as qemu:
+ # Attempt to ssh with each user into qemu with empty password
+ for user in [self.root_user, self.test_user]:
+ ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user)
+ status, output = ssh.run("true")
+ if user == 'root':
+ self.assertNotEqual(status, 0, 'ssh to user root was allowed when it should not have been')
+ else:
+ self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output)
+
+
+ @OETestID(1116)
+ def test_clutter_image_can_be_built(self):
+ """
+ Summary: Check if clutter image can be built
+ Expected: 1. core-image-clutter can be built
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ # Build a core-image-clutter
+ bitbake('core-image-clutter')
+
+ @OETestID(1117)
+ def test_wayland_support_in_image(self):
+ """
+ Summary: Check Wayland support in image
+ Expected: 1. Wayland image can be build
+ 2. Wayland feature can be installed
+ Product: oe-core
+ Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ distro_features = get_bb_var('DISTRO_FEATURES')
+ if not ('opengl' in distro_features and 'wayland' in distro_features):
+ self.skipTest('neither opengl nor wayland present on DISTRO_FEATURES so core-image-weston cannot be built')
+
+ # Build a core-image-weston
+ bitbake('core-image-weston')
+
+ @OETestID(1497)
+ def test_bmap(self):
+ """
+ Summary: Check bmap support
+ Expected: 1. core-image-minimal can be build with bmap support
+ 2. core-image-minimal is sparse
+ Product: oe-core
+ Author: Ed Bartosh <ed.bartosh@linux.intel.com>
+ """
+
+ features = 'IMAGE_FSTYPES += " ext4 ext4.bmap ext4.bmap.gz"'
+ self.write_config(features)
+
+ image_name = 'core-image-minimal'
+ bitbake(image_name)
+
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
+ image_path = os.path.join(deploy_dir_image, "%s.ext4" % link_name)
+ bmap_path = "%s.bmap" % image_path
+ gzip_path = "%s.gz" % bmap_path
+
+ # check if result image, bmap and bmap.gz files are in deploy directory
+ self.assertTrue(os.path.exists(image_path))
+ self.assertTrue(os.path.exists(bmap_path))
+ self.assertTrue(os.path.exists(gzip_path))
+
+ # check if result image is sparse
+ image_stat = os.stat(image_path)
+ self.assertTrue(image_stat.st_size > image_stat.st_blocks * 512)
+
+ # check if the resulting gzip is valid
+ self.assertTrue(runCmd('gzip -t %s' % gzip_path))
+
+ @OETestID(1903)
+ def test_hypervisor_fmts(self):
+ """
+ Summary: Check various hypervisor formats
+ Expected: 1. core-image-minimal can be built with vmdk, vdi and
+ qcow2 support.
+ 2. qemu-img says each image has the expected format
+ Product: oe-core
+ Author: Tom Rini <trini@konsulko.com>
+ """
+
+ img_types = [ 'vmdk', 'vdi', 'qcow2' ]
+ features = ""
+ for itype in img_types:
+ features += 'IMAGE_FSTYPES += "wic.%s"\n' % itype
+ self.write_config(features)
+
+ image_name = 'core-image-minimal'
+ bitbake(image_name)
+
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
+ for itype in img_types:
+ image_path = os.path.join(deploy_dir_image, "%s.wic.%s" %
+ (link_name, itype))
+
+ # check if result image file is in deploy directory
+ self.assertTrue(os.path.exists(image_path))
+
+ # check if result image is vmdk
+ sysroot = get_bb_var('STAGING_DIR_NATIVE', 'core-image-minimal')
+ result = runCmd('qemu-img info --output json %s' % image_path,
+ native_sysroot=sysroot)
+ self.assertTrue(json.loads(result.output).get('format') == itype)
+
+ @OETestID(1905)
+ def test_long_chain_conversion(self):
+ """
+ Summary: Check for chaining many CONVERSION_CMDs together
+ Expected: 1. core-image-minimal can be built with
+ ext4.bmap.gz.bz2.lzo.xz.u-boot and also create a
+ sha256sum
+ 2. The above image has a valid sha256sum
+ Product: oe-core
+ Author: Tom Rini <trini@konsulko.com>
+ """
+
+ conv = "ext4.bmap.gz.bz2.lzo.xz.u-boot"
+ features = 'IMAGE_FSTYPES += "%s %s.sha256sum"' % (conv, conv)
+ self.write_config(features)
+
+ image_name = 'core-image-minimal'
+ bitbake(image_name)
+
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
+ image_path = os.path.join(deploy_dir_image, "%s.%s" %
+ (link_name, conv))
+
+ # check if resulting image is in the deploy directory
+ self.assertTrue(os.path.exists(image_path))
+ self.assertTrue(os.path.exists(image_path + ".sha256sum"))
+
+ # check if the resulting sha256sum agrees
+ self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' %
+ (deploy_dir_image, link_name, conv)))
+
+ @OETestID(1904)
+ def test_image_fstypes(self):
+ """
+ Summary: Check if image of supported image fstypes can be built
+ Expected: core-image-minimal can be built for various image types
+ Product: oe-core
+ Author: Ed Bartosh <ed.bartosh@linux.intel.com>
+ """
+ image_name = 'core-image-minimal'
+
+ img_types = [itype for itype in get_bb_var("IMAGE_TYPES", image_name).split() \
+ if itype not in ('container', 'elf', 'f2fs', 'multiubi')]
+
+ config = 'IMAGE_FSTYPES += "%s"\n'\
+ 'MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"\n'\
+ 'UBINIZE_ARGS ?= "-m 2048 -p 128KiB -s 512"' % ' '.join(img_types)
+
+ self.write_config(config)
+
+ bitbake(image_name)
+
+ deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ link_name = get_bb_var('IMAGE_LINK_NAME', image_name)
+ for itype in img_types:
+ image_path = os.path.join(deploy_dir_image, "%s.%s" % (link_name, itype))
+ # check if result image is in deploy directory
+ self.assertTrue(os.path.exists(image_path),
+ "%s image %s doesn't exist" % (itype, image_path))
+
+ def test_useradd_static(self):
+ config = """
+USERADDEXTENSION = "useradd-staticids"
+USERADD_ERROR_DYNAMIC = "skip"
+USERADD_UID_TABLES += "files/static-passwd"
+USERADD_GID_TABLES += "files/static-group"
+"""
+ self.write_config(config)
+ bitbake("core-image-base")
diff --git a/poky/meta/lib/oeqa/selftest/cases/layerappend.py b/poky/meta/lib/oeqa/selftest/cases/layerappend.py
new file mode 100644
index 000000000..2fd5cdb0c
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/layerappend.py
@@ -0,0 +1,95 @@
+import os
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import oeqa.utils.ftools as ftools
+from oeqa.core.decorator.oeid import OETestID
+
+class LayerAppendTests(OESelftestTestCase):
+ layerconf = """
+# 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 += "meta-layerINT"
+BBFILE_PATTERN_meta-layerINT := "^${LAYERDIR}/"
+BBFILE_PRIORITY_meta-layerINT = "6"
+"""
+ recipe = """
+LICENSE="CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+python do_build() {
+ bb.plain('Building ...')
+}
+addtask build
+"""
+ append = """
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://appendtest.txt"
+
+sysroot_stage_all_append() {
+ install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
+}
+
+"""
+
+ append2 = """
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://appendtest.txt"
+"""
+ layerappend = ''
+
+ def tearDownLocal(self):
+ if self.layerappend:
+ ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
+ super(LayerAppendTests, self).tearDownLocal()
+
+ @OETestID(1196)
+ def test_layer_appends(self):
+ corebase = get_bb_var("COREBASE")
+
+ for l in ["0", "1", "2"]:
+ layer = os.path.join(corebase, "meta-layertest" + l)
+ self.assertFalse(os.path.exists(layer))
+ os.mkdir(layer)
+ os.mkdir(layer + "/conf")
+ with open(layer + "/conf/layer.conf", "w") as f:
+ f.write(self.layerconf.replace("INT", l))
+ os.mkdir(layer + "/recipes-test")
+ if l == "0":
+ with open(layer + "/recipes-test/layerappendtest.bb", "w") as f:
+ f.write(self.recipe)
+ elif l == "1":
+ with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
+ f.write(self.append)
+ os.mkdir(layer + "/recipes-test/layerappendtest")
+ with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+ f.write("Layer 1 test")
+ elif l == "2":
+ with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
+ f.write(self.append2)
+ os.mkdir(layer + "/recipes-test/layerappendtest")
+ with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+ f.write("Layer 2 test")
+ self.track_for_cleanup(layer)
+
+ self.layerappend = "BBLAYERS += \"{0}/meta-layertest0 {0}/meta-layertest1 {0}/meta-layertest2\"".format(corebase)
+ ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
+ stagingdir = get_bb_var("SYSROOT_DESTDIR", "layerappendtest")
+ bitbake("layerappendtest")
+ data = ftools.read_file(stagingdir + "/appendtest.txt")
+ self.assertEqual(data, "Layer 2 test")
+ os.remove(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt")
+ bitbake("layerappendtest")
+ data = ftools.read_file(stagingdir + "/appendtest.txt")
+ self.assertEqual(data, "Layer 1 test")
+ with open(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+ f.write("Layer 2 test")
+ bitbake("layerappendtest")
+ data = ftools.read_file(stagingdir + "/appendtest.txt")
+ self.assertEqual(data, "Layer 2 test")
diff --git a/poky/meta/lib/oeqa/selftest/cases/liboe.py b/poky/meta/lib/oeqa/selftest/cases/liboe.py
new file mode 100644
index 000000000..e84609246
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/liboe.py
@@ -0,0 +1,102 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake, runCmd
+import oe.path
+import os
+
+class LibOE(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(LibOE, cls).setUpClass()
+ cls.tmp_dir = get_bb_var('TMPDIR')
+
+ @OETestID(1635)
+ def test_copy_tree_special(self):
+ """
+ Summary: oe.path.copytree() should copy files with special character
+ Expected: 'test file with sp£c!al @nd spaces' should exist in
+ copy destination
+ Product: OE-Core
+ Author: Joshua Lock <joshua.g.lock@intel.com>
+ """
+ testloc = oe.path.join(self.tmp_dir, 'liboetests')
+ src = oe.path.join(testloc, 'src')
+ dst = oe.path.join(testloc, 'dst')
+ bb.utils.mkdirhier(testloc)
+ bb.utils.mkdirhier(src)
+ testfilename = 'test file with sp£c!al @nd spaces'
+
+ # create the test file and copy it
+ open(oe.path.join(src, testfilename), 'w+b').close()
+ oe.path.copytree(src, dst)
+
+ # ensure path exists in dest
+ fileindst = os.path.isfile(oe.path.join(dst, testfilename))
+ self.assertTrue(fileindst, "File with spaces doesn't exist in dst")
+
+ oe.path.remove(testloc)
+
+ @OETestID(1636)
+ def test_copy_tree_xattr(self):
+ """
+ Summary: oe.path.copytree() should preserve xattr on copied files
+ Expected: testxattr file in destination should have user.oetest
+ extended attribute
+ Product: OE-Core
+ Author: Joshua Lock <joshua.g.lock@intel.com>
+ """
+ testloc = oe.path.join(self.tmp_dir, 'liboetests')
+ src = oe.path.join(testloc, 'src')
+ dst = oe.path.join(testloc, 'dst')
+ bb.utils.mkdirhier(testloc)
+ bb.utils.mkdirhier(src)
+ testfilename = 'testxattr'
+
+ # ensure we have setfattr available
+ bitbake("attr-native")
+
+ bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'bindir'], 'attr-native')
+ destdir = bb_vars['SYSROOT_DESTDIR']
+ bindir = bb_vars['bindir']
+ bindir = destdir + bindir
+
+ # create a file with xattr and copy it
+ open(oe.path.join(src, testfilename), 'w+b').close()
+ runCmd('%s/setfattr -n user.oetest -v "testing liboe" %s' % (bindir, oe.path.join(src, testfilename)))
+ oe.path.copytree(src, dst)
+
+ # ensure file in dest has user.oetest xattr
+ result = runCmd('%s/getfattr -n user.oetest %s' % (bindir, oe.path.join(dst, testfilename)))
+ self.assertIn('user.oetest="testing liboe"', result.output, 'Extended attribute not sert in dst')
+
+ oe.path.remove(testloc)
+
+ @OETestID(1634)
+ def test_copy_hardlink_tree_count(self):
+ """
+ Summary: oe.path.copyhardlinktree() shouldn't miss out files
+ Expected: src and dst should have the same number of files
+ Product: OE-Core
+ Author: Joshua Lock <joshua.g.lock@intel.com>
+ """
+ testloc = oe.path.join(self.tmp_dir, 'liboetests')
+ src = oe.path.join(testloc, 'src')
+ dst = oe.path.join(testloc, 'dst')
+ bb.utils.mkdirhier(testloc)
+ bb.utils.mkdirhier(src)
+ testfiles = ['foo', 'bar', '.baz', 'quux']
+
+ def touchfile(tf):
+ open(oe.path.join(src, tf), 'w+b').close()
+
+ for f in testfiles:
+ touchfile(f)
+
+ oe.path.copyhardlinktree(src, dst)
+
+ dstcnt = len(os.listdir(dst))
+ srccnt = len(os.listdir(src))
+ self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt))
+
+ oe.path.remove(testloc)
diff --git a/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py b/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py
new file mode 100644
index 000000000..37407157c
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/lic_checksum.py
@@ -0,0 +1,35 @@
+import os
+import tempfile
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+from oeqa.utils import CommandError
+from oeqa.core.decorator.oeid import OETestID
+
+class LicenseTests(OESelftestTestCase):
+
+ # Verify that changing a license file that has an absolute path causes
+ # the license qa to fail due to a mismatched md5sum.
+ @OETestID(1197)
+ def test_nonmatching_checksum(self):
+ bitbake_cmd = '-c populate_lic emptytest'
+ error_msg = 'emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
+
+ lic_file, lic_path = tempfile.mkstemp()
+ os.close(lic_file)
+ self.track_for_cleanup(lic_path)
+
+ self.write_recipeinc('emptytest', """
+INHIBIT_DEFAULT_DEPS = "1"
+LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
+SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
+""" % (lic_path, lic_path))
+ result = bitbake(bitbake_cmd)
+
+ with open(lic_path, "w") as f:
+ f.write("data")
+
+ self.write_config("INHERIT_remove = \"report-error\"")
+ result = bitbake(bitbake_cmd, ignore_status=True)
+ if error_msg not in result.output:
+ raise AssertionError(result.output)
diff --git a/poky/meta/lib/oeqa/selftest/cases/manifest.py b/poky/meta/lib/oeqa/selftest/cases/manifest.py
new file mode 100644
index 000000000..146071934
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/manifest.py
@@ -0,0 +1,166 @@
+import os
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake
+from oeqa.core.decorator.oeid import OETestID
+
+class ManifestEntry:
+ '''A manifest item of a collection able to list missing packages'''
+ def __init__(self, entry):
+ self.file = entry
+ self.missing = []
+
+class VerifyManifest(OESelftestTestCase):
+ '''Tests for the manifest files and contents of an image'''
+
+ @classmethod
+ def check_manifest_entries(self, manifest, path):
+ manifest_errors = []
+ try:
+ with open(manifest, "r") as mfile:
+ for line in mfile:
+ manifest_entry = os.path.join(path, line.split()[0])
+ self.logger.debug("{}: looking for {}"\
+ .format(self.classname, manifest_entry))
+ if not os.path.isfile(manifest_entry):
+ manifest_errors.append(manifest_entry)
+ self.logger.debug("{}: {} not found"\
+ .format(self.classname, manifest_entry))
+ except OSError as e:
+ self.logger.debug("{}: checking of {} failed"\
+ .format(self.classname, manifest))
+ raise e
+
+ return manifest_errors
+
+ #this will possibly move from here
+ @classmethod
+ def get_dir_from_bb_var(self, bb_var, target = None):
+ target == self.buildtarget if target == None else target
+ directory = get_bb_var(bb_var, target);
+ if not directory or not os.path.isdir(directory):
+ self.logger.debug("{}: {} points to {} when target = {}"\
+ .format(self.classname, bb_var, directory, target))
+ raise OSError
+ return directory
+
+ @classmethod
+ def setUpClass(self):
+
+ super(VerifyManifest, self).setUpClass()
+ self.buildtarget = 'core-image-minimal'
+ self.classname = 'VerifyManifest'
+
+ self.logger.info("{}: doing bitbake {} as a prerequisite of the test"\
+ .format(self.classname, self.buildtarget))
+ if bitbake(self.buildtarget).status:
+ self.logger.debug("{} Failed to setup {}"\
+ .format(self.classname, self.buildtarget))
+ self.skipTest("{}: Cannot setup testing scenario"\
+ .format(self.classname))
+
+ @OETestID(1380)
+ def test_SDK_manifest_entries(self):
+ '''Verifying the SDK manifest entries exist, this may take a build'''
+
+ # the setup should bitbake core-image-minimal and here it is required
+ # to do an additional setup for the sdk
+ sdktask = '-c populate_sdk'
+ bbargs = sdktask + ' ' + self.buildtarget
+ self.logger.debug("{}: doing bitbake {} as a prerequisite of the test"\
+ .format(self.classname, bbargs))
+ if bitbake(bbargs).status:
+ self.logger.debug("{} Failed to bitbake {}"\
+ .format(self.classname, bbargs))
+ self.skipTest("{}: Cannot setup testing scenario"\
+ .format(self.classname))
+
+
+ pkgdata_dir = reverse_dir = {}
+ mfilename = mpath = m_entry = {}
+ # get manifest location based on target to query about
+ d_target= dict(target = self.buildtarget,
+ host = 'nativesdk-packagegroup-sdk-host')
+ try:
+ mdir = self.get_dir_from_bb_var('SDK_DEPLOY', self.buildtarget)
+ for k in d_target.keys():
+ bb_vars = get_bb_vars(['SDK_NAME', 'SDK_VERSION'], self.buildtarget)
+ mfilename[k] = "{}-toolchain-{}.{}.manifest".format(
+ bb_vars['SDK_NAME'],
+ bb_vars['SDK_VERSION'],
+ k)
+ mpath[k] = os.path.join(mdir, mfilename[k])
+ if not os.path.isfile(mpath[k]):
+ self.logger.debug("{}: {} does not exist".format(
+ self.classname, mpath[k]))
+ raise IOError
+ m_entry[k] = ManifestEntry(mpath[k])
+
+ pkgdata_dir[k] = self.get_dir_from_bb_var('PKGDATA_DIR',
+ d_target[k])
+ reverse_dir[k] = os.path.join(pkgdata_dir[k],
+ 'runtime-reverse')
+ if not os.path.exists(reverse_dir[k]):
+ self.logger.debug("{}: {} does not exist".format(
+ self.classname, reverse_dir[k]))
+ raise IOError
+ except OSError:
+ raise self.skipTest("{}: Error in obtaining manifest dirs"\
+ .format(self.classname))
+ except IOError:
+ msg = "{}: Error cannot find manifests in the specified dir:\n{}"\
+ .format(self.classname, mdir)
+ self.fail(msg)
+
+ for k in d_target.keys():
+ self.logger.debug("{}: Check manifest {}".format(
+ self.classname, m_entry[k].file))
+
+ m_entry[k].missing = self.check_manifest_entries(\
+ m_entry[k].file,reverse_dir[k])
+ if m_entry[k].missing:
+ msg = '{}: {} Error has the following missing entries'\
+ .format(self.classname, m_entry[k].file)
+ logmsg = msg+':\n'+'\n'.join(m_entry[k].missing)
+ self.logger.debug(logmsg)
+ self.logger.info(msg)
+ self.fail(logmsg)
+
+ @OETestID(1381)
+ def test_image_manifest_entries(self):
+ '''Verifying the image manifest entries exist'''
+
+ # get manifest location based on target to query about
+ try:
+ mdir = self.get_dir_from_bb_var('DEPLOY_DIR_IMAGE',
+ self.buildtarget)
+ mfilename = get_bb_var("IMAGE_LINK_NAME", self.buildtarget)\
+ + ".manifest"
+ mpath = os.path.join(mdir, mfilename)
+ if not os.path.isfile(mpath): raise IOError
+ m_entry = ManifestEntry(mpath)
+
+ pkgdata_dir = {}
+ pkgdata_dir = self.get_dir_from_bb_var('PKGDATA_DIR',
+ self.buildtarget)
+ revdir = os.path.join(pkgdata_dir, 'runtime-reverse')
+ if not os.path.exists(revdir): raise IOError
+ except OSError:
+ raise self.skipTest("{}: Error in obtaining manifest dirs"\
+ .format(self.classname))
+ except IOError:
+ msg = "{}: Error cannot find manifests in dir:\n{}"\
+ .format(self.classname, mdir)
+ self.fail(msg)
+
+ self.logger.debug("{}: Check manifest {}"\
+ .format(self.classname, m_entry.file))
+ m_entry.missing = self.check_manifest_entries(\
+ m_entry.file, revdir)
+ if m_entry.missing:
+ msg = '{}: {} Error has the following missing entries'\
+ .format(self.classname, m_entry.file)
+ logmsg = msg+':\n'+'\n'.join(m_entry.missing)
+ self.logger.debug(logmsg)
+ self.logger.info(msg)
+ self.fail(logmsg)
diff --git a/poky/meta/lib/oeqa/selftest/cases/meta_ide.py b/poky/meta/lib/oeqa/selftest/cases/meta_ide.py
new file mode 100644
index 000000000..5df9d3ed9
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/meta_ide.py
@@ -0,0 +1,49 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
+from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+from oeqa.core.decorator.oeid import OETestID
+import tempfile
+import shutil
+
+class MetaIDE(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(MetaIDE, cls).setUpClass()
+ bitbake('meta-ide-support')
+ bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'TMPDIR', 'COREBASE'])
+ cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS']
+ cls.tmpdir = bb_vars['TMPDIR']
+ cls.environment_script_path = '%s/%s' % (cls.tmpdir, cls.environment_script)
+ cls.corebasedir = bb_vars['COREBASE']
+ cls.tmpdir_metaideQA = tempfile.mkdtemp(prefix='metaide')
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.tmpdir_metaideQA, ignore_errors=True)
+ super(MetaIDE, cls).tearDownClass()
+
+ @OETestID(1982)
+ def test_meta_ide_had_installed_meta_ide_support(self):
+ self.assertExists(self.environment_script_path)
+
+ @OETestID(1983)
+ def test_meta_ide_can_compile_c_program(self):
+ runCmd('cp %s/test.c %s' % (self.tc.files_dir, self.tmpdir_metaideQA))
+ runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path))
+ compiled_file = '%s/a.out' % self.tmpdir_metaideQA
+ self.assertExists(compiled_file)
+
+ @OETestID(1984)
+ def test_meta_ide_can_build_cpio_project(self):
+ dl_dir = self.td.get('DL_DIR', None)
+ self.project = SDKBuildProject(self.tmpdir_metaideQA + "/cpio/", self.environment_script_path,
+ "https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz",
+ self.tmpdir_metaideQA, self.td['DATETIME'], dl_dir=dl_dir)
+ self.project.download_archive()
+ self.assertEqual(self.project.run_configure(), 0,
+ msg="Running configure failed")
+ self.assertEqual(self.project.run_make(), 0,
+ msg="Running make failed")
+ self.assertEqual(self.project.run_install(), 0,
+ msg="Running make install failed")
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/__init__.py b/poky/meta/lib/oeqa/selftest/cases/oelib/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/__init__.py
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py b/poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
new file mode 100644
index 000000000..08675fd82
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py
@@ -0,0 +1,99 @@
+import os
+from oeqa.selftest.case import OESelftestTestCase
+import tempfile
+from oeqa.utils.commands import get_bb_var
+from oeqa.core.decorator.oeid import OETestID
+
+class TestBlobParsing(OESelftestTestCase):
+
+ def setUp(self):
+ import time
+ self.repo_path = tempfile.mkdtemp(prefix='selftest-buildhistory',
+ dir=get_bb_var('TOPDIR'))
+
+ try:
+ from git import Repo
+ self.repo = Repo.init(self.repo_path)
+ except ImportError:
+ self.skipTest('Python module GitPython is not present')
+
+ self.test_file = "test"
+ self.var_map = {}
+
+ def tearDown(self):
+ import shutil
+ shutil.rmtree(self.repo_path)
+
+ def commit_vars(self, to_add={}, to_remove = [], msg="A commit message"):
+ if len(to_add) == 0 and len(to_remove) == 0:
+ return
+
+ for k in to_remove:
+ self.var_map.pop(x,None)
+ for k in to_add:
+ self.var_map[k] = to_add[k]
+
+ with open(os.path.join(self.repo_path, self.test_file), 'w') as repo_file:
+ for k in self.var_map:
+ repo_file.write("%s = %s\n" % (k, self.var_map[k]))
+
+ self.repo.git.add("--all")
+ self.repo.git.commit(message=msg)
+
+ @OETestID(1859)
+ def test_blob_to_dict(self):
+ """
+ Test convertion of git blobs to dictionary
+ """
+ from oe.buildhistory_analysis import blob_to_dict
+ valuesmap = { "foo" : "1", "bar" : "2" }
+ self.commit_vars(to_add = valuesmap)
+
+ blob = self.repo.head.commit.tree.blobs[0]
+ self.assertEqual(valuesmap, blob_to_dict(blob),
+ "commit was not translated correctly to dictionary")
+
+ @OETestID(1860)
+ def test_compare_dict_blobs(self):
+ """
+ Test comparisson of dictionaries extracted from git blobs
+ """
+ from oe.buildhistory_analysis import compare_dict_blobs
+
+ changesmap = { "foo-2" : ("2", "8"), "bar" : ("","4"), "bar-2" : ("","5")}
+
+ self.commit_vars(to_add = { "foo" : "1", "foo-2" : "2", "foo-3" : "3" })
+ blob1 = self.repo.heads.master.commit.tree.blobs[0]
+
+ self.commit_vars(to_add = { "foo-2" : "8", "bar" : "4", "bar-2" : "5" })
+ blob2 = self.repo.heads.master.commit.tree.blobs[0]
+
+ change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
+ blob1, blob2, False, False)
+
+ var_changes = { x.fieldname : (x.oldvalue, x.newvalue) for x in change_records}
+ self.assertEqual(changesmap, var_changes, "Changes not reported correctly")
+
+ @OETestID(1861)
+ def test_compare_dict_blobs_default(self):
+ """
+ Test default values for comparisson of git blob dictionaries
+ """
+ from oe.buildhistory_analysis import compare_dict_blobs
+ defaultmap = { x : ("default", "1") for x in ["PKG", "PKGE", "PKGV", "PKGR"]}
+
+ self.commit_vars(to_add = { "foo" : "1" })
+ blob1 = self.repo.heads.master.commit.tree.blobs[0]
+
+ self.commit_vars(to_add = { "PKG" : "1", "PKGE" : "1", "PKGV" : "1", "PKGR" : "1" })
+ blob2 = self.repo.heads.master.commit.tree.blobs[0]
+
+ change_records = compare_dict_blobs(os.path.join(self.repo_path, self.test_file),
+ blob1, blob2, False, False)
+
+ var_changes = {}
+ for x in change_records:
+ oldvalue = "default" if ("default" in x.oldvalue) else x.oldvalue
+ var_changes[x.fieldname] = (oldvalue, x.newvalue)
+
+ self.assertEqual(defaultmap, var_changes, "Defaults not set properly")
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/elf.py b/poky/meta/lib/oeqa/selftest/cases/oelib/elf.py
new file mode 100644
index 000000000..74ee6a11c
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/elf.py
@@ -0,0 +1,21 @@
+from unittest.case import TestCase
+import oe.qa
+
+class TestElf(TestCase):
+ def test_machine_name(self):
+ """
+ Test elf_machine_to_string()
+ """
+ self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
+
+ self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
+ self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown (3735928559)")
+ self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown ('foobar')")
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/license.py b/poky/meta/lib/oeqa/selftest/cases/oelib/license.py
new file mode 100644
index 000000000..d7f91fb2f
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/license.py
@@ -0,0 +1,99 @@
+from unittest.case import TestCase
+import oe.license
+
+class SeenVisitor(oe.license.LicenseVisitor):
+ def __init__(self):
+ self.seen = []
+ oe.license.LicenseVisitor.__init__(self)
+
+ def visit_Str(self, node):
+ self.seen.append(node.s)
+
+class TestSingleLicense(TestCase):
+ licenses = [
+ "GPLv2",
+ "LGPL-2.0",
+ "Artistic",
+ "MIT",
+ "GPLv3+",
+ "FOO_BAR",
+ ]
+ invalid_licenses = ["GPL/BSD"]
+
+ @staticmethod
+ def parse(licensestr):
+ visitor = SeenVisitor()
+ visitor.visit_string(licensestr)
+ return visitor.seen
+
+ def test_single_licenses(self):
+ for license in self.licenses:
+ licenses = self.parse(license)
+ self.assertListEqual(licenses, [license])
+
+ def test_invalid_licenses(self):
+ for license in self.invalid_licenses:
+ with self.assertRaises(oe.license.InvalidLicense) as cm:
+ self.parse(license)
+ self.assertEqual(cm.exception.license, license)
+
+class TestSimpleCombinations(TestCase):
+ tests = {
+ "FOO&BAR": ["FOO", "BAR"],
+ "BAZ & MOO": ["BAZ", "MOO"],
+ "ALPHA|BETA": ["ALPHA"],
+ "BAZ&MOO|FOO": ["FOO"],
+ "FOO&BAR|BAZ": ["FOO", "BAR"],
+ }
+ preferred = ["ALPHA", "FOO", "BAR"]
+
+ def test_tests(self):
+ def choose(a, b):
+ if all(lic in self.preferred for lic in b):
+ return b
+ else:
+ return a
+
+ for license, expected in self.tests.items():
+ licenses = oe.license.flattened_licenses(license, choose)
+ self.assertListEqual(licenses, expected)
+
+class TestComplexCombinations(TestSimpleCombinations):
+ tests = {
+ "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
+ "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
+ "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
+ "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-4-clause", "MIT"],
+ }
+ preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
+
+class TestIsIncluded(TestCase):
+ tests = {
+ ("FOO | BAR", None, None):
+ [True, ["FOO"]],
+ ("FOO | BAR", None, "FOO"):
+ [True, ["BAR"]],
+ ("FOO | BAR", "BAR", None):
+ [True, ["BAR"]],
+ ("FOO | BAR & FOOBAR", "*BAR", None):
+ [True, ["BAR", "FOOBAR"]],
+ ("FOO | BAR & FOOBAR", None, "FOO*"):
+ [False, ["FOOBAR"]],
+ ("(FOO | BAR) & FOOBAR | BARFOO", None, "FOO"):
+ [True, ["BAR", "FOOBAR"]],
+ ("(FOO | BAR) & FOOBAR | BAZ & MOO & BARFOO", None, "FOO"):
+ [True, ["BAZ", "MOO", "BARFOO"]],
+ ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, None):
+ [True, ["GPL-3.0", "GPL-2.0", "LGPL-2.1"]],
+ ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, "GPL-3.0"):
+ [True, ["Proprietary"]],
+ ("GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary", None, "GPL-3.0 Proprietary"):
+ [False, ["GPL-3.0"]]
+ }
+
+ def test_tests(self):
+ for args, expected in self.tests.items():
+ is_included, licenses = oe.license.is_included(
+ args[0], (args[1] or '').split(), (args[2] or '').split())
+ self.assertEqual(is_included, expected[0])
+ self.assertListEqual(licenses, expected[1])
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/path.py b/poky/meta/lib/oeqa/selftest/cases/oelib/path.py
new file mode 100644
index 000000000..75a27c06f
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/path.py
@@ -0,0 +1,89 @@
+from unittest.case import TestCase
+import oe, oe.path
+import tempfile
+import os
+import errno
+import shutil
+
+class TestRealPath(TestCase):
+ DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
+ FILES = [ "etc/passwd", "b/file" ]
+ LINKS = [
+ ( "bin", "/usr/bin", "/usr/bin" ),
+ ( "binX", "usr/binX", "/usr/binX" ),
+ ( "c", "broken", "/broken" ),
+ ( "etc/passwd-1", "passwd", "/etc/passwd" ),
+ ( "etc/passwd-2", "passwd-1", "/etc/passwd" ),
+ ( "etc/passwd-3", "/etc/passwd-1", "/etc/passwd" ),
+ ( "etc/shadow-1", "/etc/shadow", "/etc/shadow" ),
+ ( "etc/shadow-2", "/etc/shadow-1", "/etc/shadow" ),
+ ( "prog-A", "bin/prog-A", "/usr/bin/prog-A" ),
+ ( "prog-B", "/bin/prog-B", "/usr/bin/prog-B" ),
+ ( "usr/bin/prog-C", "../../sbin/prog-C", "/sbin/prog-C" ),
+ ( "usr/bin/prog-D", "/sbin/prog-D", "/sbin/prog-D" ),
+ ( "usr/binX/prog-E", "../sbin/prog-E", None ),
+ ( "usr/bin/prog-F", "../../../sbin/prog-F", "/sbin/prog-F" ),
+ ( "loop", "a/loop", None ),
+ ( "a/loop", "../loop", None ),
+ ( "b/test", "file/foo", "/b/file/foo" ),
+ ]
+
+ LINKS_PHYS = [
+ ( "./", "/", "" ),
+ ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
+ ]
+
+ EXCEPTIONS = [
+ ( "loop", errno.ELOOP ),
+ ( "b/test", errno.ENOENT ),
+ ]
+
+ def __del__(self):
+ try:
+ #os.system("tree -F %s" % self.tmpdir)
+ shutil.rmtree(self.tmpdir)
+ except:
+ pass
+
+ def setUp(self):
+ self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
+ self.root = os.path.join(self.tmpdir, "R")
+
+ os.mkdir(os.path.join(self.tmpdir, "_real"))
+ os.symlink("_real", self.root)
+
+ for d in self.DIRS:
+ os.mkdir(os.path.join(self.root, d))
+ for f in self.FILES:
+ open(os.path.join(self.root, f), "w")
+ for l in self.LINKS:
+ os.symlink(l[1], os.path.join(self.root, l[0]))
+
+ def __realpath(self, file, use_physdir, assume_dir = True):
+ return oe.path.realpath(os.path.join(self.root, file), self.root,
+ use_physdir, assume_dir = assume_dir)
+
+ def test_norm(self):
+ for l in self.LINKS:
+ if l[2] == None:
+ continue
+
+ target_p = self.__realpath(l[0], True)
+ target_l = self.__realpath(l[0], False)
+
+ if l[2] != False:
+ self.assertEqual(target_p, target_l)
+ self.assertEqual(l[2], target_p[len(self.root):])
+
+ def test_phys(self):
+ for l in self.LINKS_PHYS:
+ target_p = self.__realpath(l[0], True)
+ target_l = self.__realpath(l[0], False)
+
+ self.assertEqual(l[1], target_p[len(self.root):])
+ self.assertEqual(l[2], target_l[len(self.root):])
+
+ def test_loop(self):
+ for e in self.EXCEPTIONS:
+ self.assertRaisesRegex(OSError, r'\[Errno %u\]' % e[1],
+ self.__realpath, e[0], False, False)
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/types.py b/poky/meta/lib/oeqa/selftest/cases/oelib/types.py
new file mode 100644
index 000000000..6b53aa64e
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/types.py
@@ -0,0 +1,50 @@
+from unittest.case import TestCase
+from oe.maketype import create
+
+class TestBooleanType(TestCase):
+ def test_invalid(self):
+ self.assertRaises(ValueError, create, '', 'boolean')
+ self.assertRaises(ValueError, create, 'foo', 'boolean')
+ self.assertRaises(TypeError, create, object(), 'boolean')
+
+ def test_true(self):
+ self.assertTrue(create('y', 'boolean'))
+ self.assertTrue(create('yes', 'boolean'))
+ self.assertTrue(create('1', 'boolean'))
+ self.assertTrue(create('t', 'boolean'))
+ self.assertTrue(create('true', 'boolean'))
+ self.assertTrue(create('TRUE', 'boolean'))
+ self.assertTrue(create('truE', 'boolean'))
+
+ def test_false(self):
+ self.assertFalse(create('n', 'boolean'))
+ self.assertFalse(create('no', 'boolean'))
+ self.assertFalse(create('0', 'boolean'))
+ self.assertFalse(create('f', 'boolean'))
+ self.assertFalse(create('false', 'boolean'))
+ self.assertFalse(create('FALSE', 'boolean'))
+ self.assertFalse(create('faLse', 'boolean'))
+
+ def test_bool_equality(self):
+ self.assertEqual(create('n', 'boolean'), False)
+ self.assertNotEqual(create('n', 'boolean'), True)
+ self.assertEqual(create('y', 'boolean'), True)
+ self.assertNotEqual(create('y', 'boolean'), False)
+
+class TestList(TestCase):
+ def assertListEqual(self, value, valid, sep=None):
+ obj = create(value, 'list', separator=sep)
+ self.assertEqual(obj, valid)
+ if sep is not None:
+ self.assertEqual(obj.separator, sep)
+ self.assertEqual(str(obj), obj.separator.join(obj))
+
+ def test_list_nosep(self):
+ testlist = ['alpha', 'beta', 'theta']
+ self.assertListEqual('alpha beta theta', testlist)
+ self.assertListEqual('alpha beta\ttheta', testlist)
+ self.assertListEqual('alpha', ['alpha'])
+
+ def test_list_usersep(self):
+ self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
+ self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/poky/meta/lib/oeqa/selftest/cases/oelib/utils.py b/poky/meta/lib/oeqa/selftest/cases/oelib/utils.py
new file mode 100644
index 000000000..9fb6c1576
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oelib/utils.py
@@ -0,0 +1,51 @@
+from unittest.case import TestCase
+from oe.utils import packages_filter_out_system, trim_version
+
+class TestPackagesFilterOutSystem(TestCase):
+ def test_filter(self):
+ """
+ Test that oe.utils.packages_filter_out_system works.
+ """
+ try:
+ import bb
+ except ImportError:
+ self.skipTest("Cannot import bb")
+
+ d = bb.data_smart.DataSmart()
+ d.setVar("PN", "foo")
+
+ d.setVar("PACKAGES", "foo foo-doc foo-dev")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, [])
+
+ d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, ["foo-data"])
+
+ d.setVar("PACKAGES", "foo foo-locale-en-gb")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, [])
+
+ d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
+ pkgs = packages_filter_out_system(d)
+ self.assertEqual(pkgs, ["foo-data"])
+
+
+class TestTrimVersion(TestCase):
+ def test_version_exception(self):
+ with self.assertRaises(TypeError):
+ trim_version(None, 2)
+ with self.assertRaises(TypeError):
+ trim_version((1, 2, 3), 2)
+
+ def test_num_exception(self):
+ with self.assertRaises(ValueError):
+ trim_version("1.2.3", 0)
+ with self.assertRaises(ValueError):
+ trim_version("1.2.3", -1)
+
+ def test_valid(self):
+ self.assertEqual(trim_version("1.2.3", 1), "1")
+ self.assertEqual(trim_version("1.2.3", 2), "1.2")
+ self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
+ self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
diff --git a/poky/meta/lib/oeqa/selftest/cases/oescripts.py b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
new file mode 100644
index 000000000..1ee753763
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -0,0 +1,15 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.selftest.cases.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.core.decorator.oeid import OETestID
+
+class BuildhistoryDiffTests(BuildhistoryBase):
+
+ @OETestID(295)
+ def test_buildhistory_diff(self):
+ target = 'xcursor-transparent-theme'
+ self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
+ self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True)
+ result = runCmd("buildhistory-diff -p %s" % get_bb_var('BUILDHISTORY_DIR'))
+ expected_output = 'PR changed from "r1" to "r0"'
+ self.assertTrue(expected_output in result.output, msg="Did not find expected output: %s" % result.output)
diff --git a/poky/meta/lib/oeqa/selftest/cases/package.py b/poky/meta/lib/oeqa/selftest/cases/package.py
new file mode 100644
index 000000000..169698f78
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/package.py
@@ -0,0 +1,86 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.commands import bitbake, get_bb_vars
+import subprocess, os
+import oe.path
+
+class VersionOrdering(OESelftestTestCase):
+ # version1, version2, sort order
+ tests = (
+ ("1.0", "1.0", 0),
+ ("1.0", "2.0", -1),
+ ("2.0", "1.0", 1),
+ ("2.0-rc", "2.0", 1),
+ ("2.0~rc", "2.0", -1),
+ ("1.2rc2", "1.2.0", -1)
+ )
+
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+
+ # Build the tools we need and populate a sysroot
+ bitbake("dpkg-native opkg-native rpm-native python3-native")
+ bitbake("build-sysroots -c build_native_sysroot")
+
+ # Get the paths so we can point into the sysroot correctly
+ vars = get_bb_vars(["STAGING_DIR", "BUILD_ARCH", "bindir_native", "libdir_native"])
+ cls.staging = oe.path.join(vars["STAGING_DIR"], vars["BUILD_ARCH"])
+ cls.bindir = oe.path.join(cls.staging, vars["bindir_native"])
+ cls.libdir = oe.path.join(cls.staging, vars["libdir_native"])
+
+ def setUp(self):
+ # Just for convenience
+ self.staging = type(self).staging
+ self.bindir = type(self).bindir
+ self.libdir = type(self).libdir
+
+ @OETestID(1880)
+ def test_dpkg(self):
+ for ver1, ver2, sort in self.tests:
+ op = { -1: "<<", 0: "=", 1: ">>" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2))
+ self.assertEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ # Now do it again but with incorrect operations
+ op = { -1: ">>", 0: ">>", 1: "<<" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2))
+ self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ # Now do it again but with incorrect operations
+ op = { -1: "=", 0: "<<", 1: "=" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2))
+ self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ @OETestID(1881)
+ def test_opkg(self):
+ for ver1, ver2, sort in self.tests:
+ op = { -1: "<<", 0: "=", 1: ">>" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2))
+ self.assertEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ # Now do it again but with incorrect operations
+ op = { -1: ">>", 0: ">>", 1: "<<" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2))
+ self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ # Now do it again but with incorrect operations
+ op = { -1: "=", 0: "<<", 1: "=" }[sort]
+ status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2))
+ self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+
+ @OETestID(1882)
+ def test_rpm(self):
+ # Need to tell the Python bindings where to find its configuration
+ env = os.environ.copy()
+ env["RPM_CONFIGDIR"] = oe.path.join(self.libdir, "rpm")
+
+ for ver1, ver2, sort in self.tests:
+ # The only way to test rpm is via the Python module, so we need to
+ # execute python3-native. labelCompare returns -1/0/1 (like strcmp)
+ # so add 100 and use that as the exit code.
+ command = (oe.path.join(self.bindir, "python3-native", "python3"), "-c",
+ "import sys, rpm; v1=(None, \"%s\", None); v2=(None, \"%s\", None); sys.exit(rpm.labelCompare(v1, v2) + 100)" % (ver1, ver2))
+ status = subprocess.call(command, env=env)
+ self.assertIn(status, (99, 100, 101))
+ self.assertEqual(status - 100, sort, "%s %s (%d) failed" % (ver1, ver2, sort))
diff --git a/poky/meta/lib/oeqa/selftest/cases/pkgdata.py b/poky/meta/lib/oeqa/selftest/cases/pkgdata.py
new file mode 100644
index 000000000..0b4caf1b2
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/pkgdata.py
@@ -0,0 +1,224 @@
+import os
+import tempfile
+import fnmatch
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+from oeqa.core.decorator.oeid import OETestID
+
+class OePkgdataUtilTests(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(OePkgdataUtilTests, cls).setUpClass()
+ # Ensure we have the right data in pkgdata
+ cls.logger.info('Running bitbake to generate pkgdata')
+ bitbake('busybox zlib m4')
+
+ @OETestID(1203)
+ def test_lookup_pkg(self):
+ # Forward tests
+ result = runCmd('oe-pkgdata-util lookup-pkg "zlib busybox"')
+ self.assertEqual(result.output, 'libz1\nbusybox')
+ result = runCmd('oe-pkgdata-util lookup-pkg zlib-dev')
+ self.assertEqual(result.output, 'libz-dev')
+ result = runCmd('oe-pkgdata-util lookup-pkg nonexistentpkg', ignore_status=True)
+ self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+ self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+ # Reverse tests
+ result = runCmd('oe-pkgdata-util lookup-pkg -r "libz1 busybox"')
+ self.assertEqual(result.output, 'zlib\nbusybox')
+ result = runCmd('oe-pkgdata-util lookup-pkg -r libz-dev')
+ self.assertEqual(result.output, 'zlib-dev')
+ result = runCmd('oe-pkgdata-util lookup-pkg -r nonexistentpkg', ignore_status=True)
+ self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+ self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+
+ @OETestID(1205)
+ def test_read_value(self):
+ result = runCmd('oe-pkgdata-util read-value PN libz1')
+ self.assertEqual(result.output, 'zlib')
+ result = runCmd('oe-pkgdata-util read-value PKG libz1')
+ self.assertEqual(result.output, 'libz1')
+ result = runCmd('oe-pkgdata-util read-value PKGSIZE m4')
+ pkgsize = int(result.output.strip())
+ self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output)
+
+ @OETestID(1198)
+ def test_find_path(self):
+ result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')
+ self.assertEqual(result.output, 'zlib: /lib/libz.so.1')
+ result = runCmd('oe-pkgdata-util find-path /usr/bin/m4')
+ self.assertEqual(result.output, 'm4: /usr/bin/m4')
+ result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True)
+ self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+ self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
+
+ @OETestID(1204)
+ def test_lookup_recipe(self):
+ result = runCmd('oe-pkgdata-util lookup-recipe "libz-staticdev busybox"')
+ self.assertEqual(result.output, 'zlib\nbusybox')
+ result = runCmd('oe-pkgdata-util lookup-recipe libz-dbg')
+ self.assertEqual(result.output, 'zlib')
+ result = runCmd('oe-pkgdata-util lookup-recipe nonexistentpkg', ignore_status=True)
+ self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+ self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+
+ @OETestID(1202)
+ def test_list_pkgs(self):
+ # No arguments
+ result = runCmd('oe-pkgdata-util list-pkgs')
+ pkglist = result.output.split()
+ self.assertIn('zlib', pkglist, "Listed packages: %s" % result.output)
+ self.assertIn('zlib-dev', pkglist, "Listed packages: %s" % result.output)
+ # No pkgspec, runtime
+ result = runCmd('oe-pkgdata-util list-pkgs -r')
+ pkglist = result.output.split()
+ self.assertIn('libz-dev', pkglist, "Listed packages: %s" % result.output)
+ # With recipe specified
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib')
+ pkglist = sorted(result.output.split())
+ try:
+ pkglist.remove('zlib-ptest') # in case ptest is disabled
+ except ValueError:
+ pass
+ self.assertEqual(pkglist, ['zlib', 'zlib-dbg', 'zlib-dev', 'zlib-doc', 'zlib-staticdev'], "Packages listed after remove: %s" % result.output)
+ # With recipe specified, runtime
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib -r')
+ pkglist = sorted(result.output.split())
+ try:
+ pkglist.remove('libz-ptest') # in case ptest is disabled
+ except ValueError:
+ pass
+ self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc', 'libz-staticdev', 'libz1'], "Packages listed after remove: %s" % result.output)
+ # With recipe specified and unpackaged
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib -u')
+ pkglist = sorted(result.output.split())
+ self.assertIn('zlib-locale', pkglist, "Listed packages: %s" % result.output)
+ # With recipe specified and unpackaged, runtime
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib -u -r')
+ pkglist = sorted(result.output.split())
+ self.assertIn('libz-locale', pkglist, "Listed packages: %s" % result.output)
+ # With recipe specified and pkgspec
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib "*-d*"')
+ pkglist = sorted(result.output.split())
+ self.assertEqual(pkglist, ['zlib-dbg', 'zlib-dev', 'zlib-doc'], "Packages listed: %s" % result.output)
+ # With recipe specified and pkgspec, runtime
+ result = runCmd('oe-pkgdata-util list-pkgs -p zlib -r "*-d*"')
+ pkglist = sorted(result.output.split())
+ self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'], "Packages listed: %s" % result.output)
+
+ @OETestID(1201)
+ def test_list_pkg_files(self):
+ def splitoutput(output):
+ files = {}
+ curpkg = None
+ for line in output.splitlines():
+ if line.startswith('\t'):
+ self.assertTrue(curpkg, 'Unexpected non-package line:\n%s' % line)
+ files[curpkg].append(line.strip())
+ else:
+ self.assertTrue(line.rstrip().endswith(':'), 'Invalid package line in output:\n%s' % line)
+ curpkg = line.split(':')[0]
+ files[curpkg] = []
+ return files
+ bb_vars = get_bb_vars(['base_libdir', 'libdir', 'includedir', 'mandir'])
+ base_libdir = bb_vars['base_libdir']
+ libdir = bb_vars['libdir']
+ includedir = bb_vars['includedir']
+ mandir = bb_vars['mandir']
+ # Test recipe-space package name
+ result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc')
+ files = splitoutput(result.output)
+ self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+ self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+ # Test runtime package name
+ result = runCmd('oe-pkgdata-util list-pkg-files -r libz1 libz-dev')
+ files = splitoutput(result.output)
+ self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertGreater(len(files['libz1']), 1)
+ libspec = os.path.join(base_libdir, 'libz.so.1.*')
+ found = False
+ for fileitem in files['libz1']:
+ if fnmatch.fnmatchcase(fileitem, libspec):
+ found = True
+ break
+ self.assertTrue(found, 'Could not find zlib library file %s in libz1 package file list: %s' % (libspec, files['libz1']))
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+ # Test recipe
+ result = runCmd('oe-pkgdata-util list-pkg-files -p zlib')
+ files = splitoutput(result.output)
+ self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertNotIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ # (ignore ptest, might not be there depending on config)
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+ self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+ self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev'])
+ # Test recipe, runtime
+ result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r')
+ files = splitoutput(result.output)
+ self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertNotIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+ self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
+ self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
+ # Test recipe, unpackaged
+ result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -u')
+ files = splitoutput(result.output)
+ self.assertIn('zlib-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('zlib-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+ self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+ self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev'])
+ # Test recipe, runtime, unpackaged
+ result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r -u')
+ files = splitoutput(result.output)
+ self.assertIn('libz-dbg', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-doc', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-dev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-staticdev', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz1', list(files.keys()), "listed pkgs. files: %s" %result.output)
+ self.assertIn('libz-locale', list(files.keys()), "listed pkgs. files: %s" %result.output) # this is the key one
+ self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+ self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
+ self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
+
+ @OETestID(1200)
+ def test_glob(self):
+ tempdir = tempfile.mkdtemp(prefix='pkgdataqa')
+ self.track_for_cleanup(tempdir)
+ pkglistfile = os.path.join(tempdir, 'pkglist')
+ with open(pkglistfile, 'w') as f:
+ f.write('libz1\n')
+ f.write('busybox\n')
+ result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile)
+ desiredresult = ['libz-dev', 'busybox-dev']
+ self.assertEqual(sorted(result.output.split()), sorted(desiredresult))
+ # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
+ result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
+ self.assertEqual(result.output, '')
+ # Test exclude option
+ result = runCmd('oe-pkgdata-util glob %s "*-dev *-dbg" -x "^libz"' % pkglistfile)
+ resultlist = result.output.split()
+ self.assertNotIn('libz-dev', resultlist)
+ self.assertNotIn('libz-dbg', resultlist)
+
+ @OETestID(1206)
+ def test_specify_pkgdatadir(self):
+ result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
+ self.assertEqual(result.output, 'libz1')
diff --git a/poky/meta/lib/oeqa/selftest/cases/prservice.py b/poky/meta/lib/oeqa/selftest/cases/prservice.py
new file mode 100644
index 000000000..479e52061
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/prservice.py
@@ -0,0 +1,131 @@
+import os
+import re
+import shutil
+import datetime
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.network import get_free_port
+
+class BitbakePrTests(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(BitbakePrTests, cls).setUpClass()
+ cls.pkgdata_dir = get_bb_var('PKGDATA_DIR')
+
+ def get_pr_version(self, package_name):
+ package_data_file = os.path.join(self.pkgdata_dir, 'runtime', package_name)
+ package_data = ftools.read_file(package_data_file)
+ find_pr = re.search("PKGR: r[0-9]+\.([0-9]+)", package_data)
+ self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file)
+ return int(find_pr.group(1))
+
+ def get_task_stamp(self, package_name, recipe_task):
+ stampdata = get_bb_var('STAMP', target=package_name).split('/')
+ prefix = stampdata[-1]
+ package_stamps_path = "/".join(stampdata[:-1])
+ stamps = []
+ for stamp in os.listdir(package_stamps_path):
+ find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (re.escape(prefix), recipe_task), stamp)
+ if find_stamp:
+ stamps.append(find_stamp.group(1))
+ self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name))
+ self.assertFalse(len(stamps) > 1, msg="Found multiple %s stamps for the %s recipe in the %s directory." % (recipe_task, package_name, package_stamps_path))
+ return str(stamps[0])
+
+ def increment_package_pr(self, package_name):
+ inc_data = "do_package_append() {\n bb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now()
+ self.write_recipeinc(package_name, inc_data)
+ res = bitbake(package_name, ignore_status=True)
+ self.delete_recipeinc(package_name)
+ self.assertEqual(res.status, 0, msg=res.output)
+
+ def config_pr_tests(self, package_name, package_type='rpm', pr_socket='localhost:0'):
+ config_package_data = 'PACKAGE_CLASSES = "package_%s"' % package_type
+ self.write_config(config_package_data)
+ config_server_data = 'PRSERV_HOST = "%s"' % pr_socket
+ self.append_config(config_server_data)
+
+ def run_test_pr_service(self, package_name, package_type='rpm', track_task='do_package', pr_socket='localhost:0'):
+ self.config_pr_tests(package_name, package_type, pr_socket)
+
+ self.increment_package_pr(package_name)
+ pr_1 = self.get_pr_version(package_name)
+ stamp_1 = self.get_task_stamp(package_name, track_task)
+
+ self.increment_package_pr(package_name)
+ pr_2 = self.get_pr_version(package_name)
+ stamp_2 = self.get_task_stamp(package_name, track_task)
+
+ self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
+ self.assertTrue(stamp_1 != stamp_2, "Different pkg rev. but same stamp: %s" % stamp_1)
+
+ def run_test_pr_export_import(self, package_name, replace_current_db=True):
+ self.config_pr_tests(package_name)
+
+ self.increment_package_pr(package_name)
+ pr_1 = self.get_pr_version(package_name)
+
+ exported_db_path = os.path.join(self.builddir, 'export.inc')
+ export_result = runCmd("bitbake-prserv-tool export %s" % exported_db_path, ignore_status=True)
+ self.assertEqual(export_result.status, 0, msg="PR Service database export failed: %s" % export_result.output)
+ self.assertTrue(os.path.exists(exported_db_path))
+
+ if replace_current_db:
+ current_db_path = os.path.join(get_bb_var('PERSISTENT_DIR'), 'prserv.sqlite3')
+ self.assertTrue(os.path.exists(current_db_path), msg="Path to current PR Service database is invalid: %s" % current_db_path)
+ os.remove(current_db_path)
+
+ import_result = runCmd("bitbake-prserv-tool import %s" % exported_db_path, ignore_status=True)
+ os.remove(exported_db_path)
+ self.assertEqual(import_result.status, 0, msg="PR Service database import failed: %s" % import_result.output)
+
+ self.increment_package_pr(package_name)
+ pr_2 = self.get_pr_version(package_name)
+
+ self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
+
+ @OETestID(930)
+ def test_import_export_replace_db(self):
+ self.run_test_pr_export_import('m4')
+
+ @OETestID(931)
+ def test_import_export_override_db(self):
+ self.run_test_pr_export_import('m4', replace_current_db=False)
+
+ @OETestID(932)
+ def test_pr_service_rpm_arch_dep(self):
+ self.run_test_pr_service('m4', 'rpm', 'do_package')
+
+ @OETestID(934)
+ def test_pr_service_deb_arch_dep(self):
+ self.run_test_pr_service('m4', 'deb', 'do_package')
+
+ @OETestID(933)
+ def test_pr_service_ipk_arch_dep(self):
+ self.run_test_pr_service('m4', 'ipk', 'do_package')
+
+ @OETestID(935)
+ def test_pr_service_rpm_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package')
+
+ @OETestID(937)
+ def test_pr_service_deb_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package')
+
+ @OETestID(936)
+ def test_pr_service_ipk_arch_indep(self):
+ self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package')
+
+ @OETestID(1419)
+ def test_stopping_prservice_message(self):
+ port = get_free_port()
+
+ runCmd('bitbake-prserv --host localhost --port %s --loglevel=DEBUG --start' % port)
+ ret = runCmd('bitbake-prserv --host localhost --port %s --loglevel=DEBUG --stop' % port)
+
+ self.assertEqual(ret.status, 0)
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/recipetool.py b/poky/meta/lib/oeqa/selftest/cases/recipetool.py
new file mode 100644
index 000000000..754ea9498
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/recipetool.py
@@ -0,0 +1,698 @@
+import os
+import shutil
+import tempfile
+import urllib.parse
+
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.commands import get_bb_vars, create_temp_layer
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.selftest.cases import devtool
+
+templayerdir = None
+
+def setUpModule():
+ global templayerdir
+ templayerdir = tempfile.mkdtemp(prefix='recipetoolqa')
+ create_temp_layer(templayerdir, 'selftestrecipetool')
+ runCmd('bitbake-layers add-layer %s' % templayerdir)
+
+
+def tearDownModule():
+ runCmd('bitbake-layers remove-layer %s' % templayerdir, ignore_status=True)
+ runCmd('rm -rf %s' % templayerdir)
+
+
+class RecipetoolBase(devtool.DevtoolBase):
+
+ def setUpLocal(self):
+ super(RecipetoolBase, self).setUpLocal()
+ self.templayerdir = templayerdir
+ self.tempdir = tempfile.mkdtemp(prefix='recipetoolqa')
+ self.track_for_cleanup(self.tempdir)
+ self.testfile = os.path.join(self.tempdir, 'testfile')
+ with open(self.testfile, 'w') as f:
+ f.write('Test file\n')
+
+ def tearDownLocal(self):
+ runCmd('rm -rf %s/recipes-*' % self.templayerdir)
+ super(RecipetoolBase, self).tearDownLocal()
+
+ def _try_recipetool_appendcmd(self, cmd, testrecipe, expectedfiles, expectedlines=None):
+ result = runCmd(cmd)
+ self.assertNotIn('Traceback', result.output)
+
+ # Check the bbappend was created and applies properly
+ recipefile = get_bb_var('FILE', testrecipe)
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+
+ # Check the bbappend contents
+ if expectedlines is not None:
+ with open(bbappendfile, 'r') as f:
+ self.assertEqual(expectedlines, f.readlines(), "Expected lines are not present in %s" % bbappendfile)
+
+ # Check file was copied
+ filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
+ for expectedfile in expectedfiles:
+ self.assertTrue(os.path.isfile(os.path.join(filesdir, expectedfile)), 'Expected file %s to be copied next to bbappend, but it wasn\'t' % expectedfile)
+
+ # Check no other files created
+ createdfiles = []
+ for root, _, files in os.walk(filesdir):
+ for f in files:
+ createdfiles.append(os.path.relpath(os.path.join(root, f), filesdir))
+ self.assertTrue(sorted(createdfiles), sorted(expectedfiles))
+
+ return bbappendfile, result.output
+
+
+class RecipetoolTests(RecipetoolBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(RecipetoolTests, cls).setUpClass()
+ # Ensure we have the right data in shlibs/pkgdata
+ cls.logger.info('Running bitbake to generate pkgdata')
+ bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
+ bb_vars = get_bb_vars(['COREBASE', 'BBPATH'])
+ cls.corebase = bb_vars['COREBASE']
+ cls.bbpath = bb_vars['BBPATH']
+
+ def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles):
+ cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options)
+ return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+ def _try_recipetool_appendfile_fail(self, destfile, newfile, checkerror):
+ cmd = 'recipetool appendfile %s %s %s' % (self.templayerdir, destfile, newfile)
+ result = runCmd(cmd, ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'Command "%s" should have failed but didn\'t' % cmd)
+ self.assertNotIn('Traceback', result.output)
+ for errorstr in checkerror:
+ self.assertIn(errorstr, result.output)
+
+ @OETestID(1177)
+ def test_recipetool_appendfile_basic(self):
+ # Basic test
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1183)
+ def test_recipetool_appendfile_invalid(self):
+ # Test some commands that should error
+ self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers'])
+ self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool'])
+ self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool'])
+
+ @OETestID(1176)
+ def test_recipetool_appendfile_alternatives(self):
+ # Now try with a file we know should be an alternative
+ # (this is very much a fake example, but one we know is reliably an alternative)
+ self._try_recipetool_appendfile_fail('/bin/ls', self.testfile, ['ERROR: File /bin/ls is an alternative possibly provided by the following recipes:', 'coreutils', 'busybox'])
+ # Need a test file - should be executable
+ testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
+ testfile2name = os.path.basename(testfile2)
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://%s"\n' % testfile2name,
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${base_bindir}\n',
+ ' install -m 0755 ${WORKDIR}/%s ${D}${base_bindir}/ls\n' % testfile2name,
+ '}\n']
+ self._try_recipetool_appendfile('coreutils', '/bin/ls', testfile2, '-r coreutils', expectedlines, [testfile2name])
+ # Now try bbappending the same file again, contents should not change
+ bbappendfile, _ = self._try_recipetool_appendfile('coreutils', '/bin/ls', self.testfile, '-r coreutils', expectedlines, [testfile2name])
+ # But file should have
+ copiedfile = os.path.join(os.path.dirname(bbappendfile), 'coreutils', testfile2name)
+ result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'New file should have been copied but was not %s' % result.output)
+
+ @OETestID(1178)
+ def test_recipetool_appendfile_binary(self):
+ # Try appending a binary file
+ # /bin/ls can be a symlink to /usr/bin/ls
+ ls = os.path.realpath("/bin/ls")
+ result = runCmd('recipetool appendfile %s /bin/ls %s -r coreutils' % (self.templayerdir, ls))
+ self.assertIn('WARNING: ', result.output)
+ self.assertIn('is a binary', result.output)
+
+ @OETestID(1173)
+ def test_recipetool_appendfile_add(self):
+ # Try arbitrary file add to a recipe
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+ '}\n']
+ self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile'])
+ # Try adding another file, this time where the source file is executable
+ # (so we're testing that, plus modifying an existing bbappend)
+ testfile2 = os.path.join(self.corebase, 'oe-init-build-env')
+ testfile2name = os.path.basename(testfile2)
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile \\\n',
+ ' file://%s \\\n' % testfile2name,
+ ' "\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+ ' install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
+ '}\n']
+ self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
+
+ @OETestID(1174)
+ def test_recipetool_appendfile_add_bindir(self):
+ # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${bindir}\n',
+ ' install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1175)
+ def test_recipetool_appendfile_add_machine(self):
+ # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'PACKAGE_ARCH = "${MACHINE_ARCH}"\n',
+ '\n',
+ 'SRC_URI_append_mymachine = " file://testfile"\n',
+ '\n',
+ 'do_install_append_mymachine() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1184)
+ def test_recipetool_appendfile_orig(self):
+ # A file that's in SRC_URI and in do_install with the same name
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1191)
+ def test_recipetool_appendfile_todir(self):
+ # A file that's in SRC_URI and in do_install with destination directory rather than file
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1187)
+ def test_recipetool_appendfile_renamed(self):
+ # A file that's in SRC_URI with a different name to the destination file
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1190)
+ def test_recipetool_appendfile_subdir(self):
+ # A file that's in SRC_URI in a subdir
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1189)
+ def test_recipetool_appendfile_src_glob(self):
+ # A file that's in SRC_URI as a glob
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-src-globfile\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1181)
+ def test_recipetool_appendfile_inst_glob(self):
+ # A file that's in do_install as a glob
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1182)
+ def test_recipetool_appendfile_inst_todir_glob(self):
+ # A file that's in do_install as a glob with destination as a directory
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1185)
+ def test_recipetool_appendfile_patch(self):
+ # A file that's added by a patch in SRC_URI
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${sysconfdir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile'])
+ for line in output.splitlines():
+ if 'WARNING: ' in line:
+ self.assertIn('add-file.patch', line, 'Unexpected warning found in output:\n%s' % line)
+ break
+ else:
+ self.fail('Patch warning not found in output:\n%s' % output)
+
+ @OETestID(1188)
+ def test_recipetool_appendfile_script(self):
+ # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install)
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1180)
+ def test_recipetool_appendfile_inst_func(self):
+ # A file that's installed from a function called by do_install
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func'])
+ self.assertNotIn('WARNING: ', output)
+
+ @OETestID(1186)
+ def test_recipetool_appendfile_postinstall(self):
+ # A file that's created by a postinstall script (and explicitly mentioned in it)
+ # First try without specifying recipe
+ self._try_recipetool_appendfile_fail('/usr/share/selftest-replaceme-postinst', self.testfile, ['File /usr/share/selftest-replaceme-postinst may be written out in a pre/postinstall script of the following recipes:', 'selftest-recipetool-appendfile'])
+ # Now specify recipe
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n',
+ 'SRC_URI += "file://testfile"\n',
+ '\n',
+ 'do_install_append() {\n',
+ ' install -d ${D}${datadir}\n',
+ ' install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
+ '}\n']
+ _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
+
+ @OETestID(1179)
+ def test_recipetool_appendfile_extlayer(self):
+ # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure
+ exttemplayerdir = os.path.join(self.tempdir, 'extlayer')
+ self._create_temp_layer(exttemplayerdir, False, 'oeselftestextlayer', recipepathspec='metadata/recipes/recipes-*/*')
+ result = runCmd('recipetool appendfile %s /usr/share/selftest-replaceme-orig %s' % (exttemplayerdir, self.testfile))
+ self.assertNotIn('Traceback', result.output)
+ createdfiles = []
+ for root, _, files in os.walk(exttemplayerdir):
+ for f in files:
+ createdfiles.append(os.path.relpath(os.path.join(root, f), exttemplayerdir))
+ createdfiles.remove('conf/layer.conf')
+ expectedfiles = ['metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile.bbappend',
+ 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig']
+ self.assertEqual(sorted(createdfiles), sorted(expectedfiles))
+
+ @OETestID(1192)
+ def test_recipetool_appendfile_wildcard(self):
+
+ def try_appendfile_wc(options):
+ result = runCmd('recipetool appendfile %s /etc/profile %s %s' % (self.templayerdir, self.testfile, options))
+ self.assertNotIn('Traceback', result.output)
+ bbappendfile = None
+ for root, _, files in os.walk(self.templayerdir):
+ for f in files:
+ if f.endswith('.bbappend'):
+ bbappendfile = f
+ break
+ if not bbappendfile:
+ self.fail('No bbappend file created')
+ runCmd('rm -rf %s/recipes-*' % self.templayerdir)
+ return bbappendfile
+
+ # Check without wildcard option
+ recipefn = os.path.basename(get_bb_var('FILE', 'base-files'))
+ filename = try_appendfile_wc('')
+ self.assertEqual(filename, recipefn.replace('.bb', '.bbappend'))
+ # Now check with wildcard option
+ filename = try_appendfile_wc('-w')
+ self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
+
+ @OETestID(1193)
+ def test_recipetool_create(self):
+ # Try adding a recipe
+ tempsrc = os.path.join(self.tempdir, 'srctree')
+ os.makedirs(tempsrc)
+ recipefile = os.path.join(self.tempdir, 'logrotate_3.12.3.bb')
+ srcuri = 'https://github.com/logrotate/logrotate/releases/download/3.12.3/logrotate-3.12.3.tar.xz'
+ result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = 'GPLv2'
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'
+ checkvars['SRC_URI'] = 'https://github.com/logrotate/logrotate/releases/download/${PV}/logrotate-${PV}.tar.xz'
+ checkvars['SRC_URI[md5sum]'] = 'a560c57fac87c45b2fc17406cdf79288'
+ checkvars['SRC_URI[sha256sum]'] = '2e6a401cac9024db2288297e3be1a8ab60e7401ba8e91225218aaf4a27e82a07'
+ self._test_recipe_contents(recipefile, checkvars, [])
+
+ @OETestID(1194)
+ def test_recipetool_create_git(self):
+ if 'x11' not in get_bb_var('DISTRO_FEATURES'):
+ self.skipTest('Test requires x11 as distro feature')
+ # Ensure we have the right data in shlibs/pkgdata
+ bitbake('libpng pango libx11 libxext jpeg libcheck')
+ # Try adding a recipe
+ tempsrc = os.path.join(self.tempdir, 'srctree')
+ os.makedirs(tempsrc)
+ recipefile = os.path.join(self.tempdir, 'libmatchbox.bb')
+ srcuri = 'git://git.yoctoproject.org/libmatchbox'
+ result = runCmd(['recipetool', 'create', '-o', recipefile, srcuri + ";rev=9f7cf8895ae2d39c465c04cc78e918c157420269", '-x', tempsrc])
+ self.assertTrue(os.path.isfile(recipefile), 'recipetool did not create recipe file; output:\n%s' % result.output)
+ checkvars = {}
+ checkvars['LICENSE'] = 'LGPLv2.1'
+ checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34'
+ checkvars['S'] = '${WORKDIR}/git'
+ checkvars['PV'] = '1.11+git${SRCPV}'
+ checkvars['SRC_URI'] = srcuri
+ checkvars['DEPENDS'] = set(['libcheck', 'libjpeg-turbo', 'libpng', 'libx11', 'libxext', 'pango'])
+ inherits = ['autotools', 'pkgconfig']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ @OETestID(1392)
+ def test_recipetool_create_simple(self):
+ # Try adding a recipe
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ pv = '1.7.3.0'
+ srcuri = 'http://www.dest-unreach.org/socat/download/socat-%s.tar.bz2' % pv
+ result = runCmd('recipetool create %s -o %s' % (srcuri, temprecipe))
+ dirlist = os.listdir(temprecipe)
+ if len(dirlist) > 1:
+ self.fail('recipetool created more than just one file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
+ if len(dirlist) < 1 or not os.path.isfile(os.path.join(temprecipe, dirlist[0])):
+ self.fail('recipetool did not create recipe file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
+ self.assertEqual(dirlist[0], 'socat_%s.bb' % pv, 'Recipe file incorrectly named')
+ checkvars = {}
+ checkvars['LICENSE'] = set(['Unknown', 'GPLv2'])
+ checkvars['LIC_FILES_CHKSUM'] = set(['file://COPYING.OpenSSL;md5=5c9bccc77f67a8328ef4ebaf468116f4', 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'])
+ # We don't check DEPENDS since they are variable for this recipe depending on what's in the sysroot
+ checkvars['S'] = None
+ checkvars['SRC_URI'] = srcuri.replace(pv, '${PV}')
+ inherits = ['autotools']
+ self._test_recipe_contents(os.path.join(temprecipe, dirlist[0]), checkvars, inherits)
+
+ @OETestID(1418)
+ def test_recipetool_create_cmake(self):
+ # Try adding a recipe
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ recipefile = os.path.join(temprecipe, 'navit_0.5.0.bb')
+ srcuri = 'http://downloads.sourceforge.net/project/navit/v0.5.0/navit-0.5.0.tar.gz'
+ result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['Unknown', 'GPLv2', 'LGPLv2'])
+ checkvars['SRC_URI'] = 'http://downloads.sourceforge.net/project/navit/v${PV}/navit-${PV}.tar.gz'
+ checkvars['SRC_URI[md5sum]'] = '242f398e979a6b8c0f3c802b63435b68'
+ checkvars['SRC_URI[sha256sum]'] = '13353481d7fc01a4f64e385dda460b51496366bba0fd2cc85a89a0747910e94d'
+ checkvars['DEPENDS'] = set(['freetype', 'zlib', 'openssl', 'glib-2.0', 'virtual/libgl', 'virtual/egl', 'gtk+', 'libpng', 'libsdl', 'freeglut', 'dbus-glib'])
+ inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ @OETestID(1638)
+ def test_recipetool_create_github(self):
+ # Basic test to see if github URL mangling works
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ recipefile = os.path.join(temprecipe, 'meson_git.bb')
+ srcuri = 'https://github.com/mesonbuild/meson;rev=0.32.0'
+ result = runCmd(['recipetool', 'create', '-o', temprecipe, srcuri])
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['Apache-2.0'])
+ checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https'
+ inherits = ['setuptools']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ @OETestID(1639)
+ def test_recipetool_create_github_tarball(self):
+ # Basic test to ensure github URL mangling doesn't apply to release tarballs
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ pv = '0.32.0'
+ recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv)
+ srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv)
+ result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['Apache-2.0'])
+ checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz'
+ inherits = ['setuptools']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ @OETestID(1637)
+ def test_recipetool_create_git_http(self):
+ # Basic test to check http git URL mangling works
+ temprecipe = os.path.join(self.tempdir, 'recipe')
+ os.makedirs(temprecipe)
+ recipefile = os.path.join(temprecipe, 'matchbox-terminal_git.bb')
+ srcuri = 'http://git.yoctoproject.org/git/matchbox-terminal'
+ result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri))
+ self.assertTrue(os.path.isfile(recipefile))
+ checkvars = {}
+ checkvars['LICENSE'] = set(['GPLv2'])
+ checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/matchbox-terminal;protocol=http'
+ inherits = ['pkgconfig', 'autotools']
+ self._test_recipe_contents(recipefile, checkvars, inherits)
+
+ def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
+ dstdir = basedstdir
+ self.assertTrue(os.path.exists(dstdir))
+ for p in paths:
+ dstdir = os.path.join(dstdir, p)
+ if not os.path.exists(dstdir):
+ os.makedirs(dstdir)
+ self.track_for_cleanup(dstdir)
+ dstfile = os.path.join(dstdir, os.path.basename(srcfile))
+ if srcfile != dstfile:
+ shutil.copy(srcfile, dstfile)
+ self.track_for_cleanup(dstfile)
+
+ @OETestID(1640)
+ def test_recipetool_load_plugin(self):
+ """Test that recipetool loads only the first found plugin in BBPATH."""
+
+ recipetool = runCmd("which recipetool")
+ fromname = runCmd("recipetool --quiet pluginfile")
+ srcfile = fromname.output
+ searchpath = self.bbpath.split(':') + [os.path.dirname(recipetool.output)]
+ plugincontent = []
+ with open(srcfile) as fh:
+ plugincontent = fh.readlines()
+ try:
+ self.assertIn('meta-selftest', srcfile, 'wrong bbpath plugin found')
+ for path in searchpath:
+ self._copy_file_with_cleanup(srcfile, path, 'lib', 'recipetool')
+ result = runCmd("recipetool --quiet count")
+ self.assertEqual(result.output, '1')
+ result = runCmd("recipetool --quiet multiloaded")
+ self.assertEqual(result.output, "no")
+ for path in searchpath:
+ result = runCmd("recipetool --quiet bbdir")
+ self.assertEqual(result.output, path)
+ os.unlink(os.path.join(result.output, 'lib', 'recipetool', 'bbpath.py'))
+ finally:
+ with open(srcfile, 'w') as fh:
+ fh.writelines(plugincontent)
+
+
+class RecipetoolAppendsrcBase(RecipetoolBase):
+ def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles):
+ cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile)
+ return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+ def _try_recipetool_appendsrcfiles(self, testrecipe, newfiles, expectedlines=None, expectedfiles=None, destdir=None, options=''):
+
+ if destdir:
+ options += ' -D %s' % destdir
+
+ if expectedfiles is None:
+ expectedfiles = [os.path.basename(f) for f in newfiles]
+
+ cmd = 'recipetool appendsrcfiles %s %s %s %s' % (options, self.templayerdir, testrecipe, ' '.join(newfiles))
+ return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+ def _try_recipetool_appendsrcfile_fail(self, testrecipe, newfile, destfile, checkerror):
+ cmd = 'recipetool appendsrcfile %s %s %s %s' % (self.templayerdir, testrecipe, newfile, destfile or '')
+ result = runCmd(cmd, ignore_status=True)
+ self.assertNotEqual(result.status, 0, 'Command "%s" should have failed but didn\'t' % cmd)
+ self.assertNotIn('Traceback', result.output)
+ for errorstr in checkerror:
+ self.assertIn(errorstr, result.output)
+
+ @staticmethod
+ def _get_first_file_uri(recipe):
+ '''Return the first file:// in SRC_URI for the specified recipe.'''
+ src_uri = get_bb_var('SRC_URI', recipe).split()
+ for uri in src_uri:
+ p = urllib.parse.urlparse(uri)
+ if p.scheme == 'file':
+ return p.netloc + p.path
+
+ def _test_appendsrcfile(self, testrecipe, filename=None, destdir=None, has_src_uri=True, srcdir=None, newfile=None, options=''):
+ if newfile is None:
+ newfile = self.testfile
+
+ if srcdir:
+ if destdir:
+ expected_subdir = os.path.join(srcdir, destdir)
+ else:
+ expected_subdir = srcdir
+ else:
+ options += " -W"
+ expected_subdir = destdir
+
+ if filename:
+ if destdir:
+ destpath = os.path.join(destdir, filename)
+ else:
+ destpath = filename
+ else:
+ filename = os.path.basename(newfile)
+ if destdir:
+ destpath = destdir + os.sep
+ else:
+ destpath = '.' + os.sep
+
+ expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+ '\n']
+ if has_src_uri:
+ uri = 'file://%s' % filename
+ if expected_subdir:
+ uri += ';subdir=%s' % expected_subdir
+ expectedlines[0:0] = ['SRC_URI += "%s"\n' % uri,
+ '\n']
+
+ return self._try_recipetool_appendsrcfile(testrecipe, newfile, destpath, options, expectedlines, [filename])
+
+ def _test_appendsrcfiles(self, testrecipe, newfiles, expectedfiles=None, destdir=None, options=''):
+ if expectedfiles is None:
+ expectedfiles = [os.path.basename(n) for n in newfiles]
+
+ self._try_recipetool_appendsrcfiles(testrecipe, newfiles, expectedfiles=expectedfiles, destdir=destdir, options=options)
+
+ bb_vars = get_bb_vars(['SRC_URI', 'FILE', 'FILESEXTRAPATHS'], testrecipe)
+ src_uri = bb_vars['SRC_URI'].split()
+ for f in expectedfiles:
+ if destdir:
+ self.assertIn('file://%s;subdir=%s' % (f, destdir), src_uri)
+ else:
+ self.assertIn('file://%s' % f, src_uri)
+
+ recipefile = bb_vars['FILE']
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+ filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
+ filesextrapaths = bb_vars['FILESEXTRAPATHS'].split(':')
+ self.assertIn(filesdir, filesextrapaths)
+
+
+
+
+class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
+
+ @OETestID(1273)
+ def test_recipetool_appendsrcfile_basic(self):
+ self._test_appendsrcfile('base-files', 'a-file')
+
+ @OETestID(1274)
+ def test_recipetool_appendsrcfile_basic_wildcard(self):
+ testrecipe = 'base-files'
+ self._test_appendsrcfile(testrecipe, 'a-file', options='-w')
+ recipefile = get_bb_var('FILE', testrecipe)
+ bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+ self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe)
+
+ @OETestID(1281)
+ def test_recipetool_appendsrcfile_subdir_basic(self):
+ self._test_appendsrcfile('base-files', 'a-file', 'tmp')
+
+ @OETestID(1282)
+ def test_recipetool_appendsrcfile_subdir_basic_dirdest(self):
+ self._test_appendsrcfile('base-files', destdir='tmp')
+
+ @OETestID(1280)
+ def test_recipetool_appendsrcfile_srcdir_basic(self):
+ testrecipe = 'bash'
+ bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe)
+ srcdir = bb_vars['S']
+ workdir = bb_vars['WORKDIR']
+ subdir = os.path.relpath(srcdir, workdir)
+ self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
+
+ @OETestID(1275)
+ def test_recipetool_appendsrcfile_existing_in_src_uri(self):
+ testrecipe = 'base-files'
+ filepath = self._get_first_file_uri(testrecipe)
+ self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
+ self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False)
+
+ @OETestID(1276)
+ def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self):
+ testrecipe = 'base-files'
+ subdir = 'tmp'
+ filepath = self._get_first_file_uri(testrecipe)
+ self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
+
+ output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False)
+ self.assertTrue(any('with different parameters' in l for l in output))
+
+ @OETestID(1277)
+ def test_recipetool_appendsrcfile_replace_file_srcdir(self):
+ testrecipe = 'bash'
+ filepath = 'Makefile.in'
+ bb_vars = get_bb_vars(['S', 'WORKDIR'], testrecipe)
+ srcdir = bb_vars['S']
+ workdir = bb_vars['WORKDIR']
+ subdir = os.path.relpath(srcdir, workdir)
+
+ self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir)
+ bitbake('%s:do_unpack' % testrecipe)
+ self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read())
+
+ @OETestID(1278)
+ def test_recipetool_appendsrcfiles_basic(self, destdir=None):
+ newfiles = [self.testfile]
+ for i in range(1, 5):
+ testfile = os.path.join(self.tempdir, 'testfile%d' % i)
+ with open(testfile, 'w') as f:
+ f.write('Test file %d\n' % i)
+ newfiles.append(testfile)
+ self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W')
+
+ @OETestID(1279)
+ def test_recipetool_appendsrcfiles_basic_subdir(self):
+ self.test_recipetool_appendsrcfiles_basic(destdir='testdir')
diff --git a/poky/meta/lib/oeqa/selftest/cases/runcmd.py b/poky/meta/lib/oeqa/selftest/cases/runcmd.py
new file mode 100644
index 000000000..d76d7063c
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -0,0 +1,134 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd
+from oeqa.utils import CommandError
+from oeqa.core.decorator.oeid import OETestID
+
+import subprocess
+import threading
+import time
+import signal
+
+class MemLogger(object):
+ def __init__(self):
+ self.info_msgs = []
+ self.error_msgs = []
+
+ def info(self, msg):
+ self.info_msgs.append(msg)
+
+ def error(self, msg):
+ self.error_msgs.append(msg)
+
+class RunCmdTests(OESelftestTestCase):
+ """ Basic tests for runCmd() utility function """
+
+ # The delta is intentionally smaller than the timeout, to detect cases where
+ # we incorrectly apply the timeout more than once.
+ TIMEOUT = 2
+ DELTA = 1
+
+ @OETestID(1916)
+ def test_result_okay(self):
+ result = runCmd("true")
+ self.assertEqual(result.status, 0)
+
+ @OETestID(1915)
+ def test_result_false(self):
+ result = runCmd("false", ignore_status=True)
+ self.assertEqual(result.status, 1)
+
+ @OETestID(1917)
+ def test_shell(self):
+ # A shell is used for all string commands.
+ result = runCmd("false; true", ignore_status=True)
+ self.assertEqual(result.status, 0)
+
+ @OETestID(1910)
+ def test_no_shell(self):
+ self.assertRaises(FileNotFoundError,
+ runCmd, "false; true", shell=False)
+
+ @OETestID(1906)
+ def test_list_not_found(self):
+ self.assertRaises(FileNotFoundError,
+ runCmd, ["false; true"])
+
+ @OETestID(1907)
+ def test_list_okay(self):
+ result = runCmd(["true"])
+ self.assertEqual(result.status, 0)
+
+ @OETestID(1913)
+ def test_result_assertion(self):
+ self.assertRaisesRegexp(AssertionError, "Command 'echo .* false' returned non-zero exit status 1:\nfoobar",
+ runCmd, "echo foobar >&2; false", shell=True)
+
+ @OETestID(1914)
+ def test_result_exception(self):
+ self.assertRaisesRegexp(CommandError, "Command 'echo .* false' returned non-zero exit status 1 with output: foobar",
+ runCmd, "echo foobar >&2; false", shell=True, assert_error=False)
+
+ @OETestID(1911)
+ def test_output(self):
+ result = runCmd("echo stdout; echo stderr >&2", shell=True)
+ self.assertEqual("stdout\nstderr", result.output)
+ self.assertEqual("", result.error)
+
+ @OETestID(1912)
+ def test_output_split(self):
+ result = runCmd("echo stdout; echo stderr >&2", shell=True, stderr=subprocess.PIPE)
+ self.assertEqual("stdout", result.output)
+ self.assertEqual("stderr", result.error)
+
+ @OETestID(1920)
+ def test_timeout(self):
+ numthreads = threading.active_count()
+ start = time.time()
+ # Killing a hanging process only works when not using a shell?!
+ result = runCmd(['sleep', '60'], timeout=self.TIMEOUT, ignore_status=True)
+ self.assertEqual(result.status, -signal.SIGTERM)
+ end = time.time()
+ self.assertLess(end - start, self.TIMEOUT + self.DELTA)
+ self.assertEqual(numthreads, threading.active_count())
+
+ @OETestID(1921)
+ def test_timeout_split(self):
+ numthreads = threading.active_count()
+ start = time.time()
+ # Killing a hanging process only works when not using a shell?!
+ result = runCmd(['sleep', '60'], timeout=self.TIMEOUT, ignore_status=True, stderr=subprocess.PIPE)
+ self.assertEqual(result.status, -signal.SIGTERM)
+ end = time.time()
+ self.assertLess(end - start, self.TIMEOUT + self.DELTA)
+ self.assertEqual(numthreads, threading.active_count())
+
+ @OETestID(1918)
+ def test_stdin(self):
+ numthreads = threading.active_count()
+ result = runCmd("cat", data=b"hello world", timeout=self.TIMEOUT)
+ self.assertEqual("hello world", result.output)
+ self.assertEqual(numthreads, threading.active_count())
+
+ @OETestID(1919)
+ def test_stdin_timeout(self):
+ numthreads = threading.active_count()
+ start = time.time()
+ result = runCmd(['sleep', '60'], data=b"hello world", timeout=self.TIMEOUT, ignore_status=True)
+ self.assertEqual(result.status, -signal.SIGTERM)
+ end = time.time()
+ self.assertLess(end - start, self.TIMEOUT + self.DELTA)
+ self.assertEqual(numthreads, threading.active_count())
+
+ @OETestID(1908)
+ def test_log(self):
+ log = MemLogger()
+ result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log)
+ self.assertEqual(["Running: echo stdout; echo stderr >&2", "stdout", "stderr"], log.info_msgs)
+ self.assertEqual([], log.error_msgs)
+
+ @OETestID(1909)
+ def test_log_split(self):
+ log = MemLogger()
+ result = runCmd("echo stdout; echo stderr >&2", shell=True, output_log=log, stderr=subprocess.PIPE)
+ self.assertEqual(["Running: echo stdout; echo stderr >&2", "stdout"], log.info_msgs)
+ self.assertEqual(["stderr"], log.error_msgs)
diff --git a/poky/meta/lib/oeqa/selftest/cases/runqemu.py b/poky/meta/lib/oeqa/selftest/cases/runqemu.py
new file mode 100644
index 000000000..5ebdd57a4
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -0,0 +1,206 @@
+#
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+
+import re
+import tempfile
+import time
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, runqemu, get_bb_var, runCmd
+from oeqa.core.decorator.oeid import OETestID
+
+class RunqemuTests(OESelftestTestCase):
+ """Runqemu test class"""
+
+ image_is_ready = False
+ deploy_dir_image = ''
+ # We only want to print runqemu stdout/stderr if there is a test case failure
+ buffer = True
+
+ def setUpLocal(self):
+ super(RunqemuTests, self).setUpLocal()
+ self.recipe = 'core-image-minimal'
+ self.machine = 'qemux86-64'
+ self.fstypes = "ext4 iso hddimg wic.vmdk wic.qcow2 wic.vdi"
+ self.cmd_common = "runqemu nographic"
+
+ self.write_config(
+"""
+MACHINE = "%s"
+IMAGE_FSTYPES = "%s"
+# 10 means 1 second
+SYSLINUX_TIMEOUT = "10"
+"""
+% (self.machine, self.fstypes)
+ )
+
+ if not RunqemuTests.image_is_ready:
+ RunqemuTests.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ bitbake(self.recipe)
+ RunqemuTests.image_is_ready = True
+
+ @OETestID(2001)
+ def test_boot_machine(self):
+ """Test runqemu machine"""
+ cmd = "%s %s" % (self.cmd_common, self.machine)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+ @OETestID(2002)
+ def test_boot_machine_ext4(self):
+ """Test runqemu machine ext4"""
+ cmd = "%s %s ext4" % (self.cmd_common, self.machine)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue('rootfs.ext4' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2003)
+ def test_boot_machine_iso(self):
+ """Test runqemu machine iso"""
+ cmd = "%s %s iso" % (self.cmd_common, self.machine)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue('media=cdrom' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2004)
+ def test_boot_recipe_image(self):
+ """Test runqemu recipe-image"""
+ cmd = "%s %s" % (self.cmd_common, self.recipe)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+ @OETestID(2005)
+ def test_boot_recipe_image_vmdk(self):
+ """Test runqemu recipe-image vmdk"""
+ cmd = "%s %s wic.vmdk" % (self.cmd_common, self.recipe)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue('format=vmdk' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2006)
+ def test_boot_recipe_image_vdi(self):
+ """Test runqemu recipe-image vdi"""
+ cmd = "%s %s wic.vdi" % (self.cmd_common, self.recipe)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue('format=vdi' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2007)
+ def test_boot_deploy(self):
+ """Test runqemu deploy_dir_image"""
+ cmd = "%s %s" % (self.cmd_common, self.deploy_dir_image)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+ @OETestID(2008)
+ def test_boot_deploy_hddimg(self):
+ """Test runqemu deploy_dir_image hddimg"""
+ cmd = "%s %s hddimg" % (self.cmd_common, self.deploy_dir_image)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue(re.search('file=.*.hddimg', f.read()), "Failed: %s" % cmd)
+
+ @OETestID(2009)
+ def test_boot_machine_slirp(self):
+ """Test runqemu machine slirp"""
+ cmd = "%s slirp %s" % (self.cmd_common, self.machine)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue(' -netdev user' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2009)
+ def test_boot_machine_slirp_qcow2(self):
+ """Test runqemu machine slirp qcow2"""
+ cmd = "%s slirp wic.qcow2 %s" % (self.cmd_common, self.machine)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ with open(qemu.qemurunnerlog) as f:
+ self.assertTrue('format=qcow2' in f.read(), "Failed: %s" % cmd)
+
+ @OETestID(2010)
+ def test_boot_qemu_boot(self):
+ """Test runqemu /path/to/image.qemuboot.conf"""
+ qemuboot_conf = "%s-%s.qemuboot.conf" % (self.recipe, self.machine)
+ qemuboot_conf = os.path.join(self.deploy_dir_image, qemuboot_conf)
+ if not os.path.exists(qemuboot_conf):
+ self.skipTest("%s not found" % qemuboot_conf)
+ cmd = "%s %s" % (self.cmd_common, qemuboot_conf)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+ @OETestID(2011)
+ def test_boot_rootfs(self):
+ """Test runqemu /path/to/rootfs.ext4"""
+ rootfs = "%s-%s.ext4" % (self.recipe, self.machine)
+ rootfs = os.path.join(self.deploy_dir_image, rootfs)
+ if not os.path.exists(rootfs):
+ self.skipTest("%s not found" % rootfs)
+ cmd = "%s %s" % (self.cmd_common, rootfs)
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+# This test was designed as a separate class to test that shutdown
+# command will shutdown qemu as expected on each qemu architecture
+# based on the MACHINE configuration inside the config file
+# (eg. local.conf).
+#
+# This was different compared to RunqemuTests, where RunqemuTests was
+# dedicated for MACHINE=qemux86-64 where it test that qemux86-64 will
+# bootup various filesystem types, including live image(iso and hddimg)
+# where live image was not supported on all qemu architecture.
+class QemuTest(OESelftestTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(QemuTest, cls).setUpClass()
+ cls.recipe = 'core-image-minimal'
+ cls.machine = get_bb_var('MACHINE')
+ cls.deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+ cls.cmd_common = "runqemu nographic"
+ cls.qemuboot_conf = "%s-%s.qemuboot.conf" % (cls.recipe, cls.machine)
+ cls.qemuboot_conf = os.path.join(cls.deploy_dir_image, cls.qemuboot_conf)
+ bitbake(cls.recipe)
+
+ def _start_qemu_shutdown_check_if_shutdown_succeeded(self, qemu, timeout):
+ qemu.run_serial("shutdown -h now")
+ # Stop thread will stop the LoggingThread instance used for logging
+ # qemu through serial console, stop thread will prevent this code
+ # from facing exception (Console connection closed unexpectedly)
+ # when qemu was shutdown by the above shutdown command
+ qemu.runner.stop_thread()
+ time_track = 0
+ while True:
+ is_alive = qemu.check()
+ if not is_alive:
+ return True
+ if time_track > timeout:
+ return False
+ time.sleep(1)
+ time_track += 1
+
+ def test_qemu_can_shutdown(self):
+ self.assertExists(self.qemuboot_conf)
+ cmd = "%s %s" % (self.cmd_common, self.qemuboot_conf)
+ shutdown_timeout = 120
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout)
+ self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout))
+
+ # Need to have portmap/rpcbind running to allow this test to work and
+ # current autobuilder setup does not have this.
+ def disabled_test_qemu_can_boot_nfs_and_shutdown(self):
+ self.assertExists(self.qemuboot_conf)
+ bitbake('meta-ide-support')
+ rootfs_tar = "%s-%s.tar.bz2" % (self.recipe, self.machine)
+ rootfs_tar = os.path.join(self.deploy_dir_image, rootfs_tar)
+ self.assertExists(rootfs_tar)
+ tmpdir = tempfile.mkdtemp(prefix='qemu_nfs')
+ tmpdir_nfs = os.path.join(tmpdir, 'nfs')
+ cmd_extract_nfs = 'runqemu-extract-sdk %s %s' % (rootfs_tar, tmpdir_nfs)
+ result = runCmd(cmd_extract_nfs)
+ self.assertEqual(0, result.status, "runqemu-extract-sdk didn't run as expected. %s" % result.output)
+ cmd = "%s nfs %s %s" % (self.cmd_common, self.qemuboot_conf, tmpdir_nfs)
+ shutdown_timeout = 120
+ with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
+ qemu_shutdown_succeeded = self._start_qemu_shutdown_check_if_shutdown_succeeded(qemu, shutdown_timeout)
+ self.assertTrue(qemu_shutdown_succeeded, 'Failed: %s does not shutdown within timeout(%s)' % (self.machine, shutdown_timeout))
+ runCmd('rm -rf %s' % tmpdir)
diff --git a/poky/meta/lib/oeqa/selftest/cases/runtime_test.py b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
new file mode 100644
index 000000000..9c9b4b341
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -0,0 +1,260 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
+from oeqa.utils.sshcontrol import SSHControl
+from oeqa.core.decorator.oeid import OETestID
+import os
+import re
+import tempfile
+import shutil
+
+class TestExport(OESelftestTestCase):
+
+ @classmethod
+ def tearDownClass(cls):
+ runCmd("rm -rf /tmp/sdk")
+ super(TestExport, cls).tearDownClass()
+
+ @OETestID(1499)
+ def test_testexport_basic(self):
+ """
+ Summary: Check basic testexport functionality with only ping test enabled.
+ Expected: 1. testexport directory must be created.
+ 2. runexported.py must run without any error/exception.
+ 3. ping test must succeed.
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+
+ features = 'INHERIT += "testexport"\n'
+ # These aren't the actual IP addresses but testexport class needs something defined
+ features += 'TEST_SERVER_IP = "192.168.7.1"\n'
+ features += 'TEST_TARGET_IP = "192.168.7.1"\n'
+ features += 'TEST_SUITES = "ping"\n'
+ self.write_config(features)
+
+ # Build tesexport for core-image-minimal
+ bitbake('core-image-minimal')
+ bitbake('-c testexport core-image-minimal')
+
+ testexport_dir = get_bb_var('TEST_EXPORT_DIR', 'core-image-minimal')
+
+ # Verify if TEST_EXPORT_DIR was created
+ isdir = os.path.isdir(testexport_dir)
+ self.assertEqual(True, isdir, 'Failed to create testexport dir: %s' % testexport_dir)
+
+ with runqemu('core-image-minimal') as qemu:
+ # Attempt to run runexported.py to perform ping test
+ test_path = os.path.join(testexport_dir, "oe-test")
+ data_file = os.path.join(testexport_dir, 'data', 'testdata.json')
+ manifest = os.path.join(testexport_dir, 'data', 'manifest')
+ cmd = ("%s runtime --test-data-file %s --packages-manifest %s "
+ "--target-ip %s --server-ip %s --quiet"
+ % (test_path, data_file, manifest, qemu.ip, qemu.server_ip))
+ result = runCmd(cmd)
+ # Verify ping test was succesful
+ self.assertEqual(0, result.status, 'oe-test runtime returned a non 0 status')
+
+ @OETestID(1641)
+ def test_testexport_sdk(self):
+ """
+ Summary: Check sdk functionality for testexport.
+ Expected: 1. testexport directory must be created.
+ 2. SDK tarball must exists.
+ 3. Uncompressing of tarball must succeed.
+ 4. Check if the SDK directory is added to PATH.
+ 5. Run tar from the SDK directory.
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+
+ features = 'INHERIT += "testexport"\n'
+ # These aren't the actual IP addresses but testexport class needs something defined
+ features += 'TEST_SERVER_IP = "192.168.7.1"\n'
+ features += 'TEST_TARGET_IP = "192.168.7.1"\n'
+ features += 'TEST_SUITES = "ping"\n'
+ features += 'TEST_EXPORT_SDK_ENABLED = "1"\n'
+ features += 'TEST_EXPORT_SDK_PACKAGES = "nativesdk-tar"\n'
+ self.write_config(features)
+
+ # Build tesexport for core-image-minimal
+ bitbake('core-image-minimal')
+ bitbake('-c testexport core-image-minimal')
+
+ needed_vars = ['TEST_EXPORT_DIR', 'TEST_EXPORT_SDK_DIR', 'TEST_EXPORT_SDK_NAME']
+ bb_vars = get_bb_vars(needed_vars, 'core-image-minimal')
+ testexport_dir = bb_vars['TEST_EXPORT_DIR']
+ sdk_dir = bb_vars['TEST_EXPORT_SDK_DIR']
+ sdk_name = bb_vars['TEST_EXPORT_SDK_NAME']
+
+ # Check for SDK
+ tarball_name = "%s.sh" % sdk_name
+ tarball_path = os.path.join(testexport_dir, sdk_dir, tarball_name)
+ msg = "Couldn't find SDK tarball: %s" % tarball_path
+ self.assertEqual(os.path.isfile(tarball_path), True, msg)
+
+ # Extract SDK and run tar from SDK
+ result = runCmd("%s -y -d /tmp/sdk" % tarball_path)
+ self.assertEqual(0, result.status, "Couldn't extract SDK")
+
+ env_script = result.output.split()[-1]
+ result = runCmd(". %s; which tar" % env_script, shell=True)
+ self.assertEqual(0, result.status, "Couldn't setup SDK environment")
+ is_sdk_tar = True if "/tmp/sdk" in result.output else False
+ self.assertTrue(is_sdk_tar, "Couldn't setup SDK environment")
+
+ tar_sdk = result.output
+ result = runCmd("%s --version" % tar_sdk)
+ self.assertEqual(0, result.status, "Couldn't run tar from SDK")
+
+
+class TestImage(OESelftestTestCase):
+
+ @OETestID(1644)
+ def test_testimage_install(self):
+ """
+ Summary: Check install packages functionality for testimage/testexport.
+ Expected: 1. Import tests from a directory other than meta.
+ 2. Check install/uninstall of socat.
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+ if get_bb_var('DISTRO') == 'poky-tiny':
+ self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
+
+ features = 'INHERIT += "testimage"\n'
+ features += 'TEST_SUITES = "ping ssh selftest"\n'
+ self.write_config(features)
+
+ # Build core-image-sato and testimage
+ bitbake('core-image-full-cmdline socat')
+ bitbake('-c testimage core-image-full-cmdline')
+
+ @OETestID(1883)
+ def test_testimage_dnf(self):
+ """
+ Summary: Check package feeds functionality for dnf
+ Expected: 1. Check that remote package feeds can be accessed
+ Product: oe-core
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ """
+ if get_bb_var('DISTRO') == 'poky-tiny':
+ self.skipTest('core-image-full-cmdline not buildable for poky-tiny')
+
+ features = 'INHERIT += "testimage"\n'
+ features += 'TEST_SUITES = "ping ssh dnf_runtime dnf.DnfBasicTest.test_dnf_help"\n'
+ # We don't yet know what the server ip and port will be - they will be patched
+ # in at the start of the on-image test
+ features += 'PACKAGE_FEED_URIS = "http://bogus_ip:bogus_port"\n'
+ features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
+ features += 'PACKAGE_CLASSES = "package_rpm"\n'
+
+ # Enable package feed signing
+ self.gpg_home = tempfile.mkdtemp(prefix="oeqa-feed-sign-")
+ signing_key_dir = os.path.join(self.testlayer_path, 'files', 'signing')
+ runCmd('gpg --batch --homedir %s --import %s' % (self.gpg_home, os.path.join(signing_key_dir, 'key.secret')))
+ features += 'INHERIT += "sign_package_feed"\n'
+ features += 'PACKAGE_FEED_GPG_NAME = "testuser"\n'
+ features += 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "%s"\n' % os.path.join(signing_key_dir, 'key.passphrase')
+ features += 'GPG_PATH = "%s"\n' % self.gpg_home
+ self.write_config(features)
+
+ # Build core-image-sato and testimage
+ bitbake('core-image-full-cmdline socat')
+ bitbake('-c testimage core-image-full-cmdline')
+
+ # remove the oeqa-feed-sign temporal directory
+ shutil.rmtree(self.gpg_home, ignore_errors=True)
+
+class Postinst(OESelftestTestCase):
+ @OETestID(1540)
+ @OETestID(1545)
+ def test_postinst_rootfs_and_boot(self):
+ """
+ Summary: The purpose of this test case is to verify Post-installation
+ scripts are called when rootfs is created and also test
+ that script can be delayed to run at first boot.
+ Dependencies: NA
+ Steps: 1. Add proper configuration to local.conf file
+ 2. Build a "core-image-minimal" image
+ 3. Verify that file created by postinst_rootfs recipe is
+ present on rootfs dir.
+ 4. Boot the image created on qemu and verify that the file
+ created by postinst_boot recipe is present on image.
+ Expected: The files are successfully created during rootfs and boot
+ time for 3 different package managers: rpm,ipk,deb and
+ for initialization managers: sysvinit and systemd.
+
+ """
+
+ import oe.path
+
+ vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal")
+ rootfs = vars["IMAGE_ROOTFS"]
+ self.assertIsNotNone(rootfs)
+ sysconfdir = vars["sysconfdir"]
+ self.assertIsNotNone(sysconfdir)
+ # Need to use oe.path here as sysconfdir starts with /
+ hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test")
+ targettestdir = os.path.join(sysconfdir, "postinst-test")
+
+ for init_manager in ("sysvinit", "systemd"):
+ for classes in ("package_rpm", "package_deb", "package_ipk"):
+ with self.subTest(init_manager=init_manager, package_class=classes):
+ features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-delayed-b"\n'
+ features += 'IMAGE_FEATURES += "package-management empty-root-password"\n'
+ features += 'PACKAGE_CLASSES = "%s"\n' % classes
+ if init_manager == "systemd":
+ features += 'DISTRO_FEATURES_append = " systemd"\n'
+ features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n'
+ features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"\n'
+ features += 'VIRTUAL-RUNTIME_initscripts = ""\n'
+ self.write_config(features)
+
+ bitbake('core-image-minimal')
+
+ self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs")),
+ "rootfs state file was not created")
+
+ with runqemu('core-image-minimal') as qemu:
+ # Make the test echo a string and search for that as
+ # run_serial()'s status code is useless.'
+ for filename in ("rootfs", "delayed-a", "delayed-b"):
+ status, output = qemu.run_serial("test -f %s && echo found" % os.path.join(targettestdir, filename))
+ self.assertEqual(output, "found", "%s was not present on boot" % filename)
+
+
+
+ def test_failing_postinst(self):
+ """
+ Summary: The purpose of this test case is to verify that post-installation
+ scripts that contain errors are properly reported.
+ Expected: The scriptlet failure is properly reported.
+ The file that is created after the error in the scriptlet is not present.
+ Product: oe-core
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ """
+
+ import oe.path
+
+ vars = get_bb_vars(("IMAGE_ROOTFS", "sysconfdir"), "core-image-minimal")
+ rootfs = vars["IMAGE_ROOTFS"]
+ self.assertIsNotNone(rootfs)
+ sysconfdir = vars["sysconfdir"]
+ self.assertIsNotNone(sysconfdir)
+ # Need to use oe.path here as sysconfdir starts with /
+ hosttestdir = oe.path.join(rootfs, sysconfdir, "postinst-test")
+
+ for classes in ("package_rpm", "package_deb", "package_ipk"):
+ with self.subTest(package_class=classes):
+ features = 'CORE_IMAGE_EXTRA_INSTALL = "postinst-rootfs-failing"\n'
+ features += 'PACKAGE_CLASSES = "%s"\n' % classes
+ self.write_config(features)
+ bb_result = bitbake('core-image-minimal')
+ self.assertGreaterEqual(bb_result.output.find("Intentionally failing postinstall scriptlets of ['postinst-rootfs-failing'] to defer them to first boot is deprecated."), 0,
+ "Warning about a failed scriptlet not found in bitbake output: %s" %(bb_result.output))
+
+ self.assertTrue(os.path.isfile(os.path.join(hosttestdir, "rootfs-before-failure")),
+ "rootfs-before-failure file was not created")
+ self.assertFalse(os.path.isfile(os.path.join(hosttestdir, "rootfs-after-failure")),
+ "rootfs-after-failure file was created")
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/selftest.py b/poky/meta/lib/oeqa/selftest/cases/selftest.py
new file mode 100644
index 000000000..4b3cb1446
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/selftest.py
@@ -0,0 +1,51 @@
+import importlib
+from oeqa.utils.commands import runCmd
+import oeqa.selftest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class ExternalLayer(OESelftestTestCase):
+
+ @OETestID(1885)
+ def test_list_imported(self):
+ """
+ Summary: Checks functionality to import tests from other layers.
+ Expected: 1. File "external-layer.py" must be in
+ oeqa.selftest.__path__
+ 2. test_unconditional_pas method must exists
+ in ImportedTests class
+ Product: oe-core
+ Author: Mariano Lopez <mariano.lopez@intel.com>
+ """
+
+ test_file = "external-layer.py"
+ test_module = "oeqa.selftest.cases.external-layer"
+ method_name = "test_unconditional_pass"
+
+ # Check if "external-layer.py" is in oeqa path
+ found_file = search_test_file(test_file)
+ self.assertTrue(found_file, msg="Can't find %s in the oeqa path" % test_file)
+
+ # Import oeqa.selftest.external-layer module and search for
+ # test_unconditional_pass method of ImportedTests class
+ found_method = search_method(test_module, method_name)
+ self.assertTrue(method_name, msg="Can't find %s method" % method_name)
+
+def search_test_file(file_name):
+ for layer_path in oeqa.selftest.__path__:
+ for _, _, files in os.walk(layer_path):
+ for f in files:
+ if f == file_name:
+ return True
+ return False
+
+def search_method(module, method):
+ modlib = importlib.import_module(module)
+ for var in vars(modlib):
+ klass = vars(modlib)[var]
+ if isinstance(klass, type(OESelftestTestCase)) and issubclass(klass, OESelftestTestCase):
+ for m in dir(klass):
+ if m == method:
+ return True
+ return False
+
diff --git a/poky/meta/lib/oeqa/selftest/cases/signing.py b/poky/meta/lib/oeqa/selftest/cases/signing.py
new file mode 100644
index 000000000..a750cfc7b
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/signing.py
@@ -0,0 +1,187 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
+import os
+import glob
+import re
+import shutil
+import tempfile
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.ftools import write_file
+
+
+class Signing(OESelftestTestCase):
+
+ gpg_dir = ""
+ pub_key_path = ""
+ secret_key_path = ""
+
+ @classmethod
+ def setUpClass(cls):
+ super(Signing, cls).setUpClass()
+ # Check that we can find the gpg binary and fail early if we can't
+ if not shutil.which("gpg"):
+ raise AssertionError("This test needs GnuPG")
+
+ cls.gpg_dir = tempfile.mkdtemp(prefix="oeqa-signing-")
+
+ cls.pub_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.pub")
+ cls.secret_key_path = os.path.join(cls.testlayer_path, 'files', 'signing', "key.secret")
+
+ runCmd('gpg --batch --homedir %s --import %s %s' % (cls.gpg_dir, cls.pub_key_path, cls.secret_key_path))
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.gpg_dir, ignore_errors=True)
+
+ @OETestID(1362)
+ def test_signing_packages(self):
+ """
+ Summary: Test that packages can be signed in the package feed
+ Expected: Package should be signed with the correct key
+ Expected: Images can be created from signed packages
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ Author: Alexander Kanavin <alexander.kanavin@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+ import oe.packagedata
+
+ package_classes = get_bb_var('PACKAGE_CLASSES')
+ if 'package_rpm' not in package_classes:
+ self.skipTest('This test requires RPM Packaging.')
+
+ test_recipe = 'ed'
+
+ feature = 'INHERIT += "sign_rpm"\n'
+ feature += 'RPM_GPG_PASSPHRASE = "test123"\n'
+ feature += 'RPM_GPG_NAME = "testuser"\n'
+ feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
+
+ self.write_config(feature)
+
+ bitbake('-c clean %s' % test_recipe)
+ bitbake('-f -c package_write_rpm %s' % test_recipe)
+
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+
+ needed_vars = ['PKGDATA_DIR', 'DEPLOY_DIR_RPM', 'PACKAGE_ARCH', 'STAGING_BINDIR_NATIVE']
+ bb_vars = get_bb_vars(needed_vars, test_recipe)
+ pkgdatadir = bb_vars['PKGDATA_DIR']
+ pkgdata = oe.packagedata.read_pkgdatafile(pkgdatadir + "/runtime/ed")
+ if 'PKGE' in pkgdata:
+ pf = pkgdata['PN'] + "-" + pkgdata['PKGE'] + pkgdata['PKGV'] + '-' + pkgdata['PKGR']
+ else:
+ pf = pkgdata['PN'] + "-" + pkgdata['PKGV'] + '-' + pkgdata['PKGR']
+ deploy_dir_rpm = bb_vars['DEPLOY_DIR_RPM']
+ package_arch = bb_vars['PACKAGE_ARCH'].replace('-', '_')
+ staging_bindir_native = bb_vars['STAGING_BINDIR_NATIVE']
+
+ pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm')))
+
+ # Use a temporary rpmdb
+ rpmdb = tempfile.mkdtemp(prefix='oeqa-rpmdb')
+
+ runCmd('%s/rpmkeys --define "_dbpath %s" --import %s' %
+ (staging_bindir_native, rpmdb, self.pub_key_path))
+
+ ret = runCmd('%s/rpmkeys --define "_dbpath %s" --checksig %s' %
+ (staging_bindir_native, rpmdb, pkg_deploy))
+ # tmp/deploy/rpm/i586/ed-1.9-r0.i586.rpm: rsa sha1 md5 OK
+ self.assertIn('digests signatures OK', ret.output, 'Package signed incorrectly.')
+ shutil.rmtree(rpmdb)
+
+ #Check that an image can be built from signed packages
+ self.add_command_to_tearDown('bitbake -c clean core-image-minimal')
+ bitbake('-c clean core-image-minimal')
+ bitbake('core-image-minimal')
+
+
+ @OETestID(1382)
+ def test_signing_sstate_archive(self):
+ """
+ Summary: Test that sstate archives can be signed
+ Expected: Package should be signed with the correct key
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ test_recipe = 'ed'
+
+ builddir = os.environ.get('BUILDDIR')
+ sstatedir = os.path.join(builddir, 'test-sstate')
+
+ self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe)
+ self.add_command_to_tearDown('rm -rf %s' % sstatedir)
+
+ feature = 'SSTATE_SIG_KEY ?= "testuser"\n'
+ feature += 'SSTATE_SIG_PASSPHRASE ?= "test123"\n'
+ feature += 'SSTATE_VERIFY_SIG ?= "1"\n'
+ feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
+ feature += 'SSTATE_DIR = "%s"\n' % sstatedir
+ # Any mirror might have partial sstate without .sig files, triggering failures
+ feature += 'SSTATE_MIRRORS_forcevariable = ""\n'
+
+ self.write_config(feature)
+
+ bitbake('-c clean %s' % test_recipe)
+ bitbake(test_recipe)
+
+ recipe_sig = glob.glob(sstatedir + '/*/*:ed:*_package.tgz.sig')
+ recipe_tgz = glob.glob(sstatedir + '/*/*:ed:*_package.tgz')
+
+ self.assertEqual(len(recipe_sig), 1, 'Failed to find .sig file.')
+ self.assertEqual(len(recipe_tgz), 1, 'Failed to find .tgz file.')
+
+ ret = runCmd('gpg --homedir %s --verify %s %s' % (self.gpg_dir, recipe_sig[0], recipe_tgz[0]))
+ # gpg: Signature made Thu 22 Oct 2015 01:45:09 PM EEST using RSA key ID 61EEFB30
+ # gpg: Good signature from "testuser (nocomment) <testuser@email.com>"
+ self.assertIn('gpg: Good signature from', ret.output, 'Package signed incorrectly.')
+
+
+class LockedSignatures(OESelftestTestCase):
+
+ @OETestID(1420)
+ def test_locked_signatures(self):
+ """
+ Summary: Test locked signature mechanism
+ Expected: Locked signatures will prevent task to run
+ Product: oe-core
+ Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+ """
+
+ test_recipe = 'ed'
+ locked_sigs_file = 'locked-sigs.inc'
+
+ self.add_command_to_tearDown('rm -f %s' % os.path.join(self.builddir, locked_sigs_file))
+
+ bitbake(test_recipe)
+ # Generate locked sigs include file
+ bitbake('-S none %s' % test_recipe)
+
+ feature = 'require %s\n' % locked_sigs_file
+ feature += 'SIGGEN_LOCKEDSIGS_TASKSIG_CHECK = "warn"\n'
+ self.write_config(feature)
+
+ # Build a locked recipe
+ bitbake(test_recipe)
+
+ # Make a change that should cause the locked task signature to change
+ recipe_append_file = test_recipe + '_' + get_bb_var('PV', test_recipe) + '.bbappend'
+ recipe_append_path = os.path.join(self.testlayer_path, 'recipes-test', test_recipe, recipe_append_file)
+ feature = 'SUMMARY += "test locked signature"\n'
+
+ os.mkdir(os.path.join(self.testlayer_path, 'recipes-test', test_recipe))
+ write_file(recipe_append_path, feature)
+
+ self.add_command_to_tearDown('rm -rf %s' % os.path.join(self.testlayer_path, 'recipes-test', test_recipe))
+
+ # Build the recipe again
+ ret = bitbake(test_recipe)
+
+ # Verify you get the warning and that the real task *isn't* run (i.e. the locked signature has worked)
+ patt = r'WARNING: The %s:do_package sig is computed to be \S+, but the sig is locked to \S+ in SIGGEN_LOCKEDSIGS\S+' % test_recipe
+ found_warn = re.search(patt, ret.output)
+
+ self.assertIsNotNone(found_warn, "Didn't find the expected warning message. Output: %s" % ret.output)
diff --git a/poky/meta/lib/oeqa/selftest/cases/sstate.py b/poky/meta/lib/oeqa/selftest/cases/sstate.py
new file mode 100644
index 000000000..bc2fdbd8c
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/sstate.py
@@ -0,0 +1,63 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_vars, get_test_layer
+
+
+class SStateBase(OESelftestTestCase):
+
+ def setUpLocal(self):
+ super(SStateBase, self).setUpLocal()
+ self.temp_sstate_location = None
+ needed_vars = ['SSTATE_DIR', 'NATIVELSBSTRING', 'TCLIBC', 'TUNE_ARCH',
+ 'TOPDIR', 'TARGET_VENDOR', 'TARGET_OS']
+ bb_vars = get_bb_vars(needed_vars)
+ self.sstate_path = bb_vars['SSTATE_DIR']
+ self.hostdistro = bb_vars['NATIVELSBSTRING']
+ self.tclibc = bb_vars['TCLIBC']
+ self.tune_arch = bb_vars['TUNE_ARCH']
+ self.topdir = bb_vars['TOPDIR']
+ self.target_vendor = bb_vars['TARGET_VENDOR']
+ self.target_os = bb_vars['TARGET_OS']
+ self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
+
+ # Creates a special sstate configuration with the option to add sstate mirrors
+ def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
+ self.temp_sstate_location = temp_sstate_location
+
+ if self.temp_sstate_location:
+ temp_sstate_path = os.path.join(self.builddir, "temp_sstate_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+ config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
+ self.append_config(config_temp_sstate)
+ self.track_for_cleanup(temp_sstate_path)
+ bb_vars = get_bb_vars(['SSTATE_DIR', 'NATIVELSBSTRING'])
+ self.sstate_path = bb_vars['SSTATE_DIR']
+ self.hostdistro = bb_vars['NATIVELSBSTRING']
+ self.distro_specific_sstate = os.path.join(self.sstate_path, self.hostdistro)
+
+ if add_local_mirrors:
+ config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
+ self.append_config(config_set_sstate_if_not_set)
+ for local_mirror in add_local_mirrors:
+ self.assertFalse(os.path.join(local_mirror) == os.path.join(self.sstate_path), msg='Cannot add the current sstate path as a sstate mirror')
+ config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror
+ self.append_config(config_sstate_mirror)
+
+ # Returns a list containing sstate files
+ def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
+ result = []
+ for root, dirs, files in os.walk(self.sstate_path):
+ if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.hostdistro, root):
+ for f in files:
+ if re.search(filename_regex, f):
+ result.append(f)
+ if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root):
+ for f in files:
+ if re.search(filename_regex, f):
+ result.append(f)
+ return result
diff --git a/poky/meta/lib/oeqa/selftest/cases/sstatetests.py b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py
new file mode 100644
index 000000000..7b008e409
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/sstatetests.py
@@ -0,0 +1,532 @@
+import os
+import shutil
+import glob
+import subprocess
+import tempfile
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer, create_temp_layer
+from oeqa.selftest.cases.sstate import SStateBase
+from oeqa.core.decorator.oeid import OETestID
+
+import bb.siggen
+
+class SStateTests(SStateBase):
+ def test_autorev_sstate_works(self):
+ # Test that a git repository which changes is correctly handled by SRCREV = ${AUTOREV}
+ # when PV does not contain SRCPV
+
+ tempdir = tempfile.mkdtemp(prefix='oeqa')
+ self.track_for_cleanup(tempdir)
+ create_temp_layer(tempdir, 'selftestrecipetool')
+ self.add_command_to_tearDown('bitbake-layers remove-layer %s' % tempdir)
+ runCmd('bitbake-layers add-layer %s' % tempdir)
+
+ # Use dbus-wait as a local git repo we can add a commit between two builds in
+ pn = 'dbus-wait'
+ srcrev = '6cc6077a36fe2648a5f993fe7c16c9632f946517'
+ url = 'git://git.yoctoproject.org/dbus-wait'
+ result = runCmd('git clone %s noname' % url, cwd=tempdir)
+ srcdir = os.path.join(tempdir, 'noname')
+ result = runCmd('git reset --hard %s' % srcrev, cwd=srcdir)
+ self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure script in source directory')
+
+ recipefile = os.path.join(tempdir, "recipes-test", "dbus-wait-test", 'dbus-wait-test_git.bb')
+ os.makedirs(os.path.dirname(recipefile))
+ srcuri = 'git://' + srcdir + ';protocol=file'
+ result = runCmd(['recipetool', 'create', '-o', recipefile, srcuri])
+ self.assertTrue(os.path.isfile(recipefile), 'recipetool did not create recipe file; output:\n%s' % result.output)
+
+ with open(recipefile, 'a') as f:
+ f.write('SRCREV = "${AUTOREV}"\n')
+ f.write('PV = "1.0"\n')
+
+ bitbake("dbus-wait-test -c fetch")
+ with open(os.path.join(srcdir, "bar.txt"), "w") as f:
+ f.write("foo")
+ result = runCmd('git add bar.txt; git commit -asm "add bar"', cwd=srcdir)
+ bitbake("dbus-wait-test -c unpack")
+
+
+ # Test sstate files creation and their location
+ def run_test_sstate_creation(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True, should_pass=True):
+ self.config_sstate(temp_sstate_location, [self.sstate_path])
+
+ if self.temp_sstate_location:
+ bitbake(['-cclean'] + targets)
+ else:
+ bitbake(['-ccleansstate'] + targets)
+
+ bitbake(targets)
+ file_tracker = []
+ results = self.search_sstate('|'.join(map(str, targets)), distro_specific, distro_nonspecific)
+ if distro_nonspecific:
+ for r in results:
+ if r.endswith(("_populate_lic.tgz", "_populate_lic.tgz.siginfo", "_fetch.tgz.siginfo", "_unpack.tgz.siginfo", "_patch.tgz.siginfo")):
+ continue
+ file_tracker.append(r)
+ else:
+ file_tracker = results
+
+ if should_pass:
+ self.assertTrue(file_tracker , msg="Could not find sstate files for: %s" % ', '.join(map(str, targets)))
+ else:
+ self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s (found %s)" % (', '.join(map(str, targets)), str(file_tracker)))
+
+ @OETestID(975)
+ def test_sstate_creation_distro_specific_pass(self):
+ self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+
+ @OETestID(1374)
+ def test_sstate_creation_distro_specific_fail(self):
+ self.run_test_sstate_creation(['binutils-cross-'+ self.tune_arch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
+
+ @OETestID(976)
+ def test_sstate_creation_distro_nonspecific_pass(self):
+ self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+ @OETestID(1375)
+ def test_sstate_creation_distro_nonspecific_fail(self):
+ self.run_test_sstate_creation(['linux-libc-headers'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
+
+ # Test the sstate files deletion part of the do_cleansstate task
+ def run_test_cleansstate_task(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True):
+ self.config_sstate(temp_sstate_location, [self.sstate_path])
+
+ bitbake(['-ccleansstate'] + targets)
+
+ bitbake(targets)
+ tgz_created = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
+ self.assertTrue(tgz_created, msg="Could not find sstate .tgz files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_created)))
+
+ siginfo_created = self.search_sstate('|'.join(map(str, [s + '.*?\.siginfo$' for s in targets])), distro_specific, distro_nonspecific)
+ self.assertTrue(siginfo_created, msg="Could not find sstate .siginfo files for: %s (%s)" % (', '.join(map(str, targets)), str(siginfo_created)))
+
+ bitbake(['-ccleansstate'] + targets)
+ tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
+ self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s (%s)" % (', '.join(map(str, targets)), str(tgz_removed)))
+
+ @OETestID(977)
+ def test_cleansstate_task_distro_specific_nonspecific(self):
+ targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
+ targets.append('linux-libc-headers')
+ self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+
+ @OETestID(1376)
+ def test_cleansstate_task_distro_nonspecific(self):
+ self.run_test_cleansstate_task(['linux-libc-headers'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+ @OETestID(1377)
+ def test_cleansstate_task_distro_specific(self):
+ targets = ['binutils-cross-'+ self.tune_arch, 'binutils-native']
+ targets.append('linux-libc-headers')
+ self.run_test_cleansstate_task(targets, distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+
+
+ # Test rebuilding of distro-specific sstate files
+ def run_test_rebuild_distro_specific_sstate(self, targets, temp_sstate_location=True):
+ self.config_sstate(temp_sstate_location, [self.sstate_path])
+
+ bitbake(['-ccleansstate'] + targets)
+
+ bitbake(targets)
+ results = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=False, distro_nonspecific=True)
+ filtered_results = []
+ for r in results:
+ if r.endswith(("_populate_lic.tgz", "_populate_lic.tgz.siginfo")):
+ continue
+ filtered_results.append(r)
+ self.assertTrue(filtered_results == [], msg="Found distro non-specific sstate for: %s (%s)" % (', '.join(map(str, targets)), str(filtered_results)))
+ file_tracker_1 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
+ self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
+
+ self.track_for_cleanup(self.distro_specific_sstate + "_old")
+ shutil.copytree(self.distro_specific_sstate, self.distro_specific_sstate + "_old")
+ shutil.rmtree(self.distro_specific_sstate)
+
+ bitbake(['-cclean'] + targets)
+ bitbake(targets)
+ file_tracker_2 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
+ self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
+
+ not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2]
+ self.assertTrue(not_recreated == [], msg="The following sstate files ware not recreated: %s" % ', '.join(map(str, not_recreated)))
+
+ created_once = [x for x in file_tracker_2 if x not in file_tracker_1]
+ self.assertTrue(created_once == [], msg="The following sstate files ware created only in the second run: %s" % ', '.join(map(str, created_once)))
+
+ @OETestID(175)
+ def test_rebuild_distro_specific_sstate_cross_native_targets(self):
+ self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch, 'binutils-native'], temp_sstate_location=True)
+
+ @OETestID(1372)
+ def test_rebuild_distro_specific_sstate_cross_target(self):
+ self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + self.tune_arch], temp_sstate_location=True)
+
+ @OETestID(1373)
+ def test_rebuild_distro_specific_sstate_native_target(self):
+ self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True)
+
+
+ # Test the sstate-cache-management script. Each element in the global_config list is used with the corresponding element in the target_config list
+ # global_config elements are expected to not generate any sstate files that would be removed by sstate-cache-management.sh (such as changing the value of MACHINE)
+ def run_test_sstate_cache_management_script(self, target, global_config=[''], target_config=[''], ignore_patterns=[]):
+ self.assertTrue(global_config)
+ self.assertTrue(target_config)
+ self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements')
+ self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path])
+
+ # If buildhistory is enabled, we need to disable version-going-backwards
+ # QA checks for this test. It may report errors otherwise.
+ self.append_config('ERROR_QA_remove = "version-going-backwards"')
+
+ # For not this only checks if random sstate tasks are handled correctly as a group.
+ # In the future we should add control over what tasks we check for.
+
+ sstate_archs_list = []
+ expected_remaining_sstate = []
+ for idx in range(len(target_config)):
+ self.append_config(global_config[idx])
+ self.append_recipeinc(target, target_config[idx])
+ sstate_arch = get_bb_var('SSTATE_PKGARCH', target)
+ if not sstate_arch in sstate_archs_list:
+ sstate_archs_list.append(sstate_arch)
+ if target_config[idx] == target_config[-1]:
+ target_sstate_before_build = self.search_sstate(target + '.*?\.tgz$')
+ bitbake("-cclean %s" % target)
+ result = bitbake(target, ignore_status=True)
+ if target_config[idx] == target_config[-1]:
+ target_sstate_after_build = self.search_sstate(target + '.*?\.tgz$')
+ expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)]
+ self.remove_config(global_config[idx])
+ self.remove_recipeinc(target, target_config[idx])
+ self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output))
+
+ runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list))))
+ actual_remaining_sstate = [x for x in self.search_sstate(target + '.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)]
+
+ actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate]
+ self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected)))
+ expected_not_actual = [x for x in expected_remaining_sstate if x not in actual_remaining_sstate]
+ self.assertFalse(expected_not_actual, msg="Extra files ware removed: %s" ', '.join(map(str, expected_not_actual)))
+
+ @OETestID(973)
+ def test_sstate_cache_management_script_using_pr_1(self):
+ global_config = []
+ target_config = []
+ global_config.append('')
+ target_config.append('PR = "0"')
+ self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+
+ @OETestID(978)
+ def test_sstate_cache_management_script_using_pr_2(self):
+ global_config = []
+ target_config = []
+ global_config.append('')
+ target_config.append('PR = "0"')
+ global_config.append('')
+ target_config.append('PR = "1"')
+ self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+
+ @OETestID(979)
+ def test_sstate_cache_management_script_using_pr_3(self):
+ global_config = []
+ target_config = []
+ global_config.append('MACHINE = "qemux86-64"')
+ target_config.append('PR = "0"')
+ global_config.append(global_config[0])
+ target_config.append('PR = "1"')
+ global_config.append('MACHINE = "qemux86"')
+ target_config.append('PR = "1"')
+ self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+
+ @OETestID(974)
+ def test_sstate_cache_management_script_using_machine(self):
+ global_config = []
+ target_config = []
+ global_config.append('MACHINE = "qemux86-64"')
+ target_config.append('')
+ global_config.append('MACHINE = "qemux86"')
+ target_config.append('')
+ self.run_test_sstate_cache_management_script('m4', global_config, target_config, ignore_patterns=['populate_lic'])
+
+ @OETestID(1270)
+ def test_sstate_32_64_same_hash(self):
+ """
+ The sstate checksums for both native and target should not vary whether
+ they're built on a 32 or 64 bit system. Rather than requiring two different
+ build machines and running a builds, override the variables calling uname()
+ manually and check using bitbake -S.
+ """
+
+ self.write_config("""
+MACHINE = "qemux86"
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
+BUILD_ARCH = "x86_64"
+BUILD_OS = "linux"
+SDKMACHINE = "x86_64"
+PACKAGE_CLASSES = "package_rpm package_ipk package_deb"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+ bitbake("core-image-sato -S none")
+ self.write_config("""
+MACHINE = "qemux86"
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
+BUILD_ARCH = "i686"
+BUILD_OS = "linux"
+SDKMACHINE = "i686"
+PACKAGE_CLASSES = "package_rpm package_ipk package_deb"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+ bitbake("core-image-sato -S none")
+
+ def get_files(d):
+ f = []
+ for root, dirs, files in os.walk(d):
+ if "core-image-sato" in root:
+ # SDKMACHINE changing will change
+ # do_rootfs/do_testimage/do_build stamps of images which
+ # is safe to ignore.
+ continue
+ f.extend(os.path.join(root, name) for name in files)
+ return f
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + self.target_vendor + "-linux", "x86_64" + self.target_vendor + "-linux", ) for x in files2]
+ self.maxDiff = None
+ self.assertCountEqual(files1, files2)
+
+
+ @OETestID(1271)
+ def test_sstate_nativelsbstring_same_hash(self):
+ """
+ The sstate checksums should be independent of whichever NATIVELSBSTRING is
+ detected. Rather than requiring two different build machines and running
+ builds, override the variables manually and check using bitbake -S.
+ """
+
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+NATIVELSBSTRING = \"DistroA\"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+ bitbake("core-image-sato -S none")
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+NATIVELSBSTRING = \"DistroB\"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+ bitbake("core-image-sato -S none")
+
+ def get_files(d):
+ f = []
+ for root, dirs, files in os.walk(d):
+ f.extend(os.path.join(root, name) for name in files)
+ return f
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+ self.maxDiff = None
+ self.assertCountEqual(files1, files2)
+
+ @OETestID(1368)
+ def test_sstate_allarch_samesigs(self):
+ """
+ The sstate checksums of allarch packages should be independent of whichever
+ MACHINE is set. Check this using bitbake -S.
+ Also, rather than duplicate the test, check nativesdk stamps are the same between
+ the two MACHINE values.
+ """
+
+ configA = """
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+MACHINE = \"qemux86-64\"
+"""
+ configB = """
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemuarm\"
+"""
+ self.sstate_allarch_samesigs(configA, configB)
+
+ @OETestID(1645)
+ def test_sstate_allarch_samesigs_multilib(self):
+ """
+ The sstate checksums of allarch multilib packages should be independent of whichever
+ MACHINE is set. Check this using bitbake -S.
+ Also, rather than duplicate the test, check nativesdk stamps are the same between
+ the two MACHINE values.
+ """
+
+ configA = """
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+MACHINE = \"qemux86-64\"
+require conf/multilib.conf
+MULTILIBS = \"multilib:lib32\"
+DEFAULTTUNE_virtclass-multilib-lib32 = \"x86\"
+"""
+ configB = """
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemuarm\"
+require conf/multilib.conf
+MULTILIBS = \"\"
+"""
+ self.sstate_allarch_samesigs(configA, configB)
+
+ def sstate_allarch_samesigs(self, configA, configB):
+
+ self.write_config(configA)
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+ bitbake("world meta-toolchain -S none")
+ self.write_config(configB)
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+ bitbake("world meta-toolchain -S none")
+
+ def get_files(d):
+ f = {}
+ for root, dirs, files in os.walk(d):
+ for name in files:
+ if "meta-environment" in root or "cross-canadian" in root:
+ continue
+ if "do_build" not in name:
+ # 1.4.1+gitAUTOINC+302fca9f4c-r0.do_package_write_ipk.sigdata.f3a2a38697da743f0dbed8b56aafcf79
+ (_, task, _, shash) = name.rsplit(".", 3)
+ f[os.path.join(os.path.basename(root), task)] = shash
+ return f
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/all" + self.target_vendor + "-" + self.target_os)
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/all" + self.target_vendor + "-" + self.target_os)
+ self.maxDiff = None
+ self.assertEqual(files1, files2)
+
+ nativesdkdir = os.path.basename(glob.glob(self.topdir + "/tmp-sstatesamehash/stamps/*-nativesdk*-linux")[0])
+
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/" + nativesdkdir)
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/" + nativesdkdir)
+ self.maxDiff = None
+ self.assertEqual(files1, files2)
+
+ @OETestID(1369)
+ def test_sstate_sametune_samesigs(self):
+ """
+ The sstate checksums of two identical machines (using the same tune) should be the
+ same, apart from changes within the machine specific stamps directory. We use the
+ qemux86copy machine to test this. Also include multilibs in the test.
+ """
+
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+MACHINE = \"qemux86\"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+ bitbake("world meta-toolchain -S none")
+ self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemux86copy\"
+require conf/multilib.conf
+MULTILIBS = "multilib:lib32"
+DEFAULTTUNE_virtclass-multilib-lib32 = "x86"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+ bitbake("world meta-toolchain -S none")
+
+ def get_files(d):
+ f = []
+ for root, dirs, files in os.walk(d):
+ for name in files:
+ if "meta-environment" in root or "cross-canadian" in root:
+ continue
+ if "qemux86copy-" in root or "qemux86-" in root:
+ continue
+ if "do_build" not in name and "do_populate_sdk" not in name:
+ f.append(os.path.join(root, name))
+ return f
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps")
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps")
+ files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+ self.maxDiff = None
+ self.assertCountEqual(files1, files2)
+
+
+ @OETestID(1498)
+ def test_sstate_noop_samesigs(self):
+ """
+ The sstate checksums of two builds with these variables changed or
+ classes inherits should be the same.
+ """
+
+ self.write_config("""
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash"
+BB_NUMBER_THREADS = "${@oe.utils.cpu_count()}"
+PARALLEL_MAKE = "-j 1"
+DL_DIR = "${TOPDIR}/download1"
+TIME = "111111"
+DATE = "20161111"
+INHERIT_remove = "buildstats-summary buildhistory uninative"
+http_proxy = ""
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash")
+ self.track_for_cleanup(self.topdir + "/download1")
+ bitbake("world meta-toolchain -S none")
+ self.write_config("""
+TMPDIR = "${TOPDIR}/tmp-sstatesamehash2"
+BB_NUMBER_THREADS = "${@oe.utils.cpu_count()+1}"
+PARALLEL_MAKE = "-j 2"
+DL_DIR = "${TOPDIR}/download2"
+TIME = "222222"
+DATE = "20161212"
+# Always remove uninative as we're changing proxies
+INHERIT_remove = "uninative"
+INHERIT += "buildstats-summary buildhistory"
+http_proxy = "http://example.com/"
+""")
+ self.track_for_cleanup(self.topdir + "/tmp-sstatesamehash2")
+ self.track_for_cleanup(self.topdir + "/download2")
+ bitbake("world meta-toolchain -S none")
+
+ def get_files(d):
+ f = {}
+ for root, dirs, files in os.walk(d):
+ for name in files:
+ name, shash = name.rsplit('.', 1)
+ # Extract just the machine and recipe name
+ base = os.sep.join(root.rsplit(os.sep, 2)[-2:] + [name])
+ f[base] = shash
+ return f
+
+ def compare_sigfiles(files, files1, files2, compare=False):
+ for k in files:
+ if k in files1 and k in files2:
+ print("%s differs:" % k)
+ if compare:
+ sigdatafile1 = self.topdir + "/tmp-sstatesamehash/stamps/" + k + "." + files1[k]
+ sigdatafile2 = self.topdir + "/tmp-sstatesamehash2/stamps/" + k + "." + files2[k]
+ output = bb.siggen.compare_sigfiles(sigdatafile1, sigdatafile2)
+ if output:
+ print('\n'.join(output))
+ elif k in files1 and k not in files2:
+ print("%s in files1" % k)
+ elif k not in files1 and k in files2:
+ print("%s in files2" % k)
+ else:
+ assert "shouldn't reach here"
+
+ files1 = get_files(self.topdir + "/tmp-sstatesamehash/stamps/")
+ files2 = get_files(self.topdir + "/tmp-sstatesamehash2/stamps/")
+ # Remove items that are identical in both sets
+ for k,v in files1.items() & files2.items():
+ del files1[k]
+ del files2[k]
+ if not files1 and not files2:
+ # No changes, so we're done
+ return
+
+ files = list(files1.keys() | files2.keys())
+ # this is an expensive computation, thus just compare the first 'max_sigfiles_to_compare' k files
+ max_sigfiles_to_compare = 20
+ first, rest = files[:max_sigfiles_to_compare], files[max_sigfiles_to_compare:]
+ compare_sigfiles(first, files1, files2, compare=True)
+ compare_sigfiles(rest, files1, files2, compare=False)
+
+ self.fail("sstate hashes not identical.")
diff --git a/poky/meta/lib/oeqa/selftest/cases/tinfoil.py b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
new file mode 100644
index 000000000..f889a47b2
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/tinfoil.py
@@ -0,0 +1,231 @@
+import os
+import re
+import time
+import logging
+import bb.tinfoil
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd
+from oeqa.core.decorator.oeid import OETestID
+
+class TinfoilTests(OESelftestTestCase):
+ """ Basic tests for the tinfoil API """
+
+ @OETestID(1568)
+ def test_getvar(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ machine = tinfoil.config_data.getVar('MACHINE')
+ if not machine:
+ self.fail('Unable to get MACHINE value - returned %s' % machine)
+
+ @OETestID(1569)
+ def test_expand(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ expr = '${@os.getpid()}'
+ pid = tinfoil.config_data.expand(expr)
+ if not pid:
+ self.fail('Unable to expand "%s" - returned %s' % (expr, pid))
+
+ @OETestID(1570)
+ def test_getvar_bb_origenv(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(True)
+ origenv = tinfoil.config_data.getVar('BB_ORIGENV', False)
+ if not origenv:
+ self.fail('Unable to get BB_ORIGENV value - returned %s' % origenv)
+ self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME'])
+
+ @OETestID(1571)
+ def test_parse_recipe(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ rd = tinfoil.parse_recipe_file(best[3])
+ self.assertEqual(testrecipe, rd.getVar('PN'))
+
+ @OETestID(1572)
+ def test_parse_recipe_copy_expand(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ rd = tinfoil.parse_recipe_file(best[3])
+ # Check we can get variable values
+ self.assertEqual(testrecipe, rd.getVar('PN'))
+ # Check that expanding a value that includes a variable reference works
+ self.assertEqual(testrecipe, rd.getVar('BPN'))
+ # Now check that changing the referenced variable's value in a copy gives that
+ # value when expanding
+ localdata = bb.data.createCopy(rd)
+ localdata.setVar('PN', 'hello')
+ self.assertEqual('hello', localdata.getVar('BPN'))
+
+ @OETestID(1573)
+ def test_parse_recipe_initial_datastore(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ testrecipe = 'mdadm'
+ best = tinfoil.find_best_provider(testrecipe)
+ if not best:
+ self.fail('Unable to find recipe providing %s' % testrecipe)
+ dcopy = bb.data.createCopy(tinfoil.config_data)
+ dcopy.setVar('MYVARIABLE', 'somevalue')
+ rd = tinfoil.parse_recipe_file(best[3], config_data=dcopy)
+ # Check we can get variable values
+ self.assertEqual('somevalue', rd.getVar('MYVARIABLE'))
+
+ @OETestID(1574)
+ def test_list_recipes(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ # Check pkg_pn
+ checkpns = ['tar', 'automake', 'coreutils', 'm4-native', 'nativesdk-gcc']
+ pkg_pn = tinfoil.cooker.recipecaches[''].pkg_pn
+ for pn in checkpns:
+ self.assertIn(pn, pkg_pn)
+ # Check pkg_fn
+ checkfns = {'nativesdk-gcc': '^virtual:nativesdk:.*', 'coreutils': '.*/coreutils_.*.bb'}
+ for fn, pn in tinfoil.cooker.recipecaches[''].pkg_fn.items():
+ if pn in checkpns:
+ if pn in checkfns:
+ self.assertTrue(re.match(checkfns[pn], fn), 'Entry for %s: %s did not match %s' % (pn, fn, checkfns[pn]))
+ checkpns.remove(pn)
+ if checkpns:
+ self.fail('Unable to find pkg_fn entries for: %s' % ', '.join(checkpns))
+
+ @OETestID(1575)
+ def test_wait_event(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+
+ tinfoil.set_event_mask(['bb.event.FilesMatchingFound', 'bb.command.CommandCompleted'])
+
+ # Need to drain events otherwise events that were masked may still be in the queue
+ while tinfoil.wait_event():
+ pass
+
+ pattern = 'conf'
+ res = tinfoil.run_command('findFilesMatchingInDir', pattern, 'conf/machine')
+ self.assertTrue(res)
+
+ eventreceived = False
+ commandcomplete = False
+ start = time.time()
+ # Wait for 5s in total so we'd detect spurious heartbeat events for example
+ while time.time() - start < 5:
+ event = tinfoil.wait_event(1)
+ if event:
+ if isinstance(event, bb.command.CommandCompleted):
+ commandcomplete = True
+ elif isinstance(event, bb.event.FilesMatchingFound):
+ self.assertEqual(pattern, event._pattern)
+ self.assertIn('qemuarm.conf', event._matches)
+ eventreceived = True
+ elif isinstance(event, logging.LogRecord):
+ continue
+ else:
+ self.fail('Unexpected event: %s' % event)
+
+ self.assertTrue(commandcomplete, 'Timed out waiting for CommandCompleted event from bitbake server')
+ self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound event from bitbake server')
+
+ @OETestID(1576)
+ def test_setvariable_clean(self):
+ # First check that setVariable affects the datastore
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ tinfoil.run_command('setVariable', 'TESTVAR', 'specialvalue')
+ self.assertEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is not reflected in client-side getVar()')
+
+ # Now check that the setVariable's effects are no longer present
+ # (this may legitimately break in future if we stop reinitialising
+ # the datastore, in which case we'll have to reconsider use of
+ # setVariable entirely)
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ self.assertNotEqual(tinfoil.config_data.getVar('TESTVAR'), 'specialvalue', 'Value set using setVariable is still present!')
+
+ # Now check that setVar on the main datastore works (uses setVariable internally)
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ tinfoil.config_data.setVar('TESTVAR', 'specialvalue')
+ value = tinfoil.run_command('getVariable', 'TESTVAR')
+ self.assertEqual(value, 'specialvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+
+ @OETestID(1884)
+ def test_datastore_operations(self):
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=True)
+ # Test setVarFlag() / getVarFlag()
+ tinfoil.config_data.setVarFlag('TESTVAR', 'flagname', 'flagval')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+ self.assertEqual(value, 'flagval', 'Value set using config_data.setVarFlag() is not reflected in config_data.getVarFlag()')
+ # Test delVarFlag()
+ tinfoil.config_data.setVarFlag('TESTVAR', 'otherflag', 'othervalue')
+ tinfoil.config_data.delVarFlag('TESTVAR', 'flagname')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'flagname')
+ self.assertEqual(value, None, 'Varflag deleted using config_data.delVarFlag() is not reflected in config_data.getVarFlag()')
+ value = tinfoil.config_data.getVarFlag('TESTVAR', 'otherflag')
+ self.assertEqual(value, 'othervalue', 'Varflag deleted using config_data.delVarFlag() caused unrelated flag to be removed')
+ # Test delVar()
+ tinfoil.config_data.setVar('TESTVAR', 'varvalue')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, 'varvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+ tinfoil.config_data.delVar('TESTVAR')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, None, 'Variable deleted using config_data.delVar() appears to still have a value')
+ # Test renameVar()
+ tinfoil.config_data.setVar('TESTVAROLD', 'origvalue')
+ tinfoil.config_data.renameVar('TESTVAROLD', 'TESTVARNEW')
+ value = tinfoil.config_data.getVar('TESTVAROLD')
+ self.assertEqual(value, None, 'Variable renamed using config_data.renameVar() still seems to exist')
+ value = tinfoil.config_data.getVar('TESTVARNEW')
+ self.assertEqual(value, 'origvalue', 'Variable renamed using config_data.renameVar() does not appear with new name')
+ # Test overrides
+ tinfoil.config_data.setVar('TESTVAR', 'original')
+ tinfoil.config_data.setVar('TESTVAR_overrideone', 'one')
+ tinfoil.config_data.setVar('TESTVAR_overridetwo', 'two')
+ tinfoil.config_data.appendVar('OVERRIDES', ':overrideone')
+ value = tinfoil.config_data.getVar('TESTVAR')
+ self.assertEqual(value, 'one', 'Variable overrides not functioning correctly')
+
+ def test_variable_history(self):
+ # Basic test to ensure that variable history works when tracking=True
+ with bb.tinfoil.Tinfoil(tracking=True) as tinfoil:
+ tinfoil.prepare(config_only=False, quiet=2)
+ # Note that _tracking for any datastore we get will be
+ # false here, that's currently expected - so we can't check
+ # for that
+ history = tinfoil.config_data.varhistory.variable('DL_DIR')
+ for entry in history:
+ if entry['file'].endswith('/bitbake.conf'):
+ if entry['op'] in ['set', 'set?']:
+ break
+ else:
+ self.fail('Did not find history entry setting DL_DIR in bitbake.conf. History: %s' % history)
+ # Check it works for recipes as well
+ testrecipe = 'zlib'
+ rd = tinfoil.parse_recipe(testrecipe)
+ history = rd.varhistory.variable('LICENSE')
+ bbfound = -1
+ recipefound = -1
+ for i, entry in enumerate(history):
+ if entry['file'].endswith('/bitbake.conf'):
+ if entry['detail'] == 'INVALID' and entry['op'] in ['set', 'set?']:
+ bbfound = i
+ elif entry['file'].endswith('.bb'):
+ if entry['op'] == 'set':
+ recipefound = i
+ if bbfound == -1:
+ self.fail('Did not find history entry setting LICENSE in bitbake.conf parsing %s recipe. History: %s' % (testrecipe, history))
+ if recipefound == -1:
+ self.fail('Did not find history entry setting LICENSE in %s recipe. History: %s' % (testrecipe, history))
+ if bbfound > recipefound:
+ self.fail('History entry setting LICENSE in %s recipe and in bitbake.conf in wrong order. History: %s' % (testrecipe, history))
diff --git a/poky/meta/lib/oeqa/selftest/cases/wic.py b/poky/meta/lib/oeqa/selftest/cases/wic.py
new file mode 100644
index 000000000..b84466d9a
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/wic.py
@@ -0,0 +1,1066 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2015, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# AUTHORS
+# Ed Bartosh <ed.bartosh@linux.intel.com>
+
+"""Test cases for wic."""
+
+import os
+import sys
+import unittest
+
+from glob import glob
+from shutil import rmtree, copy
+from functools import wraps, lru_cache
+from tempfile import NamedTemporaryFile
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu
+from oeqa.core.decorator.oeid import OETestID
+
+
+@lru_cache(maxsize=32)
+def get_host_arch(recipe):
+ """A cached call to get_bb_var('HOST_ARCH', <recipe>)"""
+ return get_bb_var('HOST_ARCH', recipe)
+
+
+def only_for_arch(archs, image='core-image-minimal'):
+ """Decorator for wrapping test cases that can be run only for specific target
+ architectures. A list of compatible architectures is passed in `archs`.
+ Current architecture will be determined by parsing bitbake output for
+ `image` recipe.
+ """
+ def wrapper(func):
+ @wraps(func)
+ def wrapped_f(*args, **kwargs):
+ arch = get_host_arch(image)
+ if archs and arch not in archs:
+ raise unittest.SkipTest("Testcase arch dependency not met: %s" % arch)
+ return func(*args, **kwargs)
+ wrapped_f.__name__ = func.__name__
+ return wrapped_f
+ return wrapper
+
+
+class Wic(OESelftestTestCase):
+ """Wic test class."""
+
+ resultdir = "/var/tmp/wic.oe-selftest/"
+ image_is_ready = False
+ native_sysroot = None
+ wicenv_cache = {}
+
+ def setUpLocal(self):
+ """This code is executed before each test method."""
+ super(Wic, self).setUpLocal()
+ if not self.native_sysroot:
+ Wic.native_sysroot = get_bb_var('STAGING_DIR_NATIVE', 'wic-tools')
+
+ # Do this here instead of in setUpClass as the base setUp does some
+ # clean up which can result in the native tools built earlier in
+ # setUpClass being unavailable.
+ if not Wic.image_is_ready:
+ if get_bb_var('USE_NLS') == 'yes':
+ bitbake('wic-tools')
+ else:
+ self.skipTest('wic-tools cannot be built due its (intltool|gettext)-native dependency and NLS disable')
+
+ bitbake('core-image-minimal')
+ Wic.image_is_ready = True
+
+ rmtree(self.resultdir, ignore_errors=True)
+
+ def tearDownLocal(self):
+ """Remove resultdir as it may contain images."""
+ rmtree(self.resultdir, ignore_errors=True)
+ super(Wic, self).tearDownLocal()
+
+ @OETestID(1552)
+ def test_version(self):
+ """Test wic --version"""
+ self.assertEqual(0, runCmd('wic --version').status)
+
+ @OETestID(1208)
+ def test_help(self):
+ """Test wic --help and wic -h"""
+ self.assertEqual(0, runCmd('wic --help').status)
+ self.assertEqual(0, runCmd('wic -h').status)
+
+ @OETestID(1209)
+ def test_createhelp(self):
+ """Test wic create --help"""
+ self.assertEqual(0, runCmd('wic create --help').status)
+
+ @OETestID(1210)
+ def test_listhelp(self):
+ """Test wic list --help"""
+ self.assertEqual(0, runCmd('wic list --help').status)
+
+ @OETestID(1553)
+ def test_help_create(self):
+ """Test wic help create"""
+ self.assertEqual(0, runCmd('wic help create').status)
+
+ @OETestID(1554)
+ def test_help_list(self):
+ """Test wic help list"""
+ self.assertEqual(0, runCmd('wic help list').status)
+
+ @OETestID(1215)
+ def test_help_overview(self):
+ """Test wic help overview"""
+ self.assertEqual(0, runCmd('wic help overview').status)
+
+ @OETestID(1216)
+ def test_help_plugins(self):
+ """Test wic help plugins"""
+ self.assertEqual(0, runCmd('wic help plugins').status)
+
+ @OETestID(1217)
+ def test_help_kickstart(self):
+ """Test wic help kickstart"""
+ self.assertEqual(0, runCmd('wic help kickstart').status)
+
+ @OETestID(1555)
+ def test_list_images(self):
+ """Test wic list images"""
+ self.assertEqual(0, runCmd('wic list images').status)
+
+ @OETestID(1556)
+ def test_list_source_plugins(self):
+ """Test wic list source-plugins"""
+ self.assertEqual(0, runCmd('wic list source-plugins').status)
+
+ @OETestID(1557)
+ def test_listed_images_help(self):
+ """Test wic listed images help"""
+ output = runCmd('wic list images').output
+ imagelist = [line.split()[0] for line in output.splitlines()]
+ for image in imagelist:
+ self.assertEqual(0, runCmd('wic list %s help' % image).status)
+
+ @OETestID(1213)
+ def test_unsupported_subcommand(self):
+ """Test unsupported subcommand"""
+ self.assertNotEqual(0, runCmd('wic unsupported', ignore_status=True).status)
+
+ @OETestID(1214)
+ def test_no_command(self):
+ """Test wic without command"""
+ self.assertEqual(1, runCmd('wic', ignore_status=True).status)
+
+ @OETestID(1211)
+ def test_build_image_name(self):
+ """Test wic create wictestdisk --image-name=core-image-minimal"""
+ cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1157)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_gpt_image(self):
+ """Test creation of core-image-minimal with gpt table and UUID boot"""
+ cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+ @OETestID(1346)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_iso_image(self):
+ """Test creation of hybrid iso image with legacy and EFI boot"""
+ config = 'INITRAMFS_IMAGE = "core-image-minimal-initramfs"\n'\
+ 'MACHINE_FEATURES_append = " efi"\n'\
+ 'DEPENDS_pn-core-image-minimal += "syslinux"\n'
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ self.remove_config(config)
+ cmd = "wic create mkhybridiso --image-name core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
+ self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+
+ @OETestID(1348)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_qemux86_directdisk(self):
+ """Test creation of qemux-86-directdisk image"""
+ cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "qemux86-directdisk-*direct")))
+
+ @OETestID(1350)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_mkefidisk(self):
+ """Test creation of mkefidisk image"""
+ cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "mkefidisk-*direct")))
+
+ @OETestID(1385)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_bootloader_config(self):
+ """Test creation of directdisk-bootloader-config image"""
+ config = 'DEPENDS_pn-core-image-minimal += "syslinux"\n'
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ self.remove_config(config)
+ cmd = "wic create directdisk-bootloader-config -e core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-bootloader-config-*direct")))
+
+ @OETestID(1560)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_systemd_bootdisk(self):
+ """Test creation of systemd-bootdisk image"""
+ config = 'MACHINE_FEATURES_append = " efi"\n'
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ self.remove_config(config)
+ cmd = "wic create systemd-bootdisk -e core-image-minimal -o %s" % self.resultdir
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "systemd-bootdisk-*direct")))
+
+ @OETestID(1561)
+ def test_sdimage_bootpart(self):
+ """Test creation of sdimage-bootpart image"""
+ cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s" % self.resultdir
+ kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
+ self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+
+ @OETestID(1562)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_default_output_dir(self):
+ """Test default output location"""
+ for fname in glob("directdisk-*.direct"):
+ os.remove(fname)
+ config = 'DEPENDS_pn-core-image-minimal += "syslinux"\n'
+ self.append_config(config)
+ bitbake('core-image-minimal')
+ self.remove_config(config)
+ cmd = "wic create directdisk -e core-image-minimal"
+ self.assertEqual(0, runCmd(cmd).status)
+ self.assertEqual(1, len(glob("directdisk-*.direct")))
+
+ @OETestID(1212)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_build_artifacts(self):
+ """Test wic create directdisk providing all artifacts."""
+ bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
+ 'wic-tools')
+ bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+ 'core-image-minimal'))
+ bbvars = {key.lower(): value for key, value in bb_vars.items()}
+ bbvars['resultdir'] = self.resultdir
+ status = runCmd("wic create directdisk "
+ "-b %(staging_datadir)s "
+ "-k %(deploy_dir_image)s "
+ "-n %(recipe_sysroot_native)s "
+ "-r %(image_rootfs)s "
+ "-o %(resultdir)s" % bbvars).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+ @OETestID(1264)
+ def test_compress_gzip(self):
+ """Test compressing an image with gzip"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name core-image-minimal "
+ "-c gzip -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.gz")))
+
+ @OETestID(1265)
+ def test_compress_bzip2(self):
+ """Test compressing an image with bzip2"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-c bzip2 -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.bz2")))
+
+ @OETestID(1266)
+ def test_compress_xz(self):
+ """Test compressing an image with xz"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "--compress-with=xz -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct.xz")))
+
+ @OETestID(1267)
+ def test_wrong_compressor(self):
+ """Test how wic breaks if wrong compressor is provided"""
+ self.assertEqual(2, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-c wrong -o %s" % self.resultdir,
+ ignore_status=True).status)
+
+ @OETestID(1558)
+ def test_debug_short(self):
+ """Test -D option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1658)
+ def test_debug_long(self):
+ """Test --debug option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "--debug -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1563)
+ def test_skip_build_check_short(self):
+ """Test -s option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-s -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1671)
+ def test_skip_build_check_long(self):
+ """Test --skip-build-check option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "--skip-build-check "
+ "--outdir %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1564)
+ def test_build_rootfs_short(self):
+ """Test -f option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-f -o %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1656)
+ def test_build_rootfs_long(self):
+ """Test --build-rootfs option"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "--build-rootfs "
+ "--outdir %s" % self.resultdir).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+
+ @OETestID(1268)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_rootfs_indirect_recipes(self):
+ """Test usage of rootfs plugin with rootfs recipes"""
+ status = runCmd("wic create directdisk-multi-rootfs "
+ "--image-name=core-image-minimal "
+ "--rootfs rootfs1=core-image-minimal "
+ "--rootfs rootfs2=core-image-minimal "
+ "--outdir %s" % self.resultdir).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "directdisk-multi-rootfs*.direct")))
+
+ @OETestID(1269)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_rootfs_artifacts(self):
+ """Test usage of rootfs plugin with rootfs paths"""
+ bb_vars = get_bb_vars(['STAGING_DATADIR', 'RECIPE_SYSROOT_NATIVE'],
+ 'wic-tools')
+ bb_vars.update(get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'],
+ 'core-image-minimal'))
+ bbvars = {key.lower(): value for key, value in bb_vars.items()}
+ bbvars['wks'] = "directdisk-multi-rootfs"
+ bbvars['resultdir'] = self.resultdir
+ status = runCmd("wic create %(wks)s "
+ "--bootimg-dir=%(staging_datadir)s "
+ "--kernel-dir=%(deploy_dir_image)s "
+ "--native-sysroot=%(recipe_sysroot_native)s "
+ "--rootfs-dir rootfs1=%(image_rootfs)s "
+ "--rootfs-dir rootfs2=%(image_rootfs)s "
+ "--outdir %(resultdir)s" % bbvars).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars)))
+
+ @OETestID(1661)
+ def test_exclude_path(self):
+ """Test --exclude-path wks option."""
+
+ oldpath = os.environ['PATH']
+ os.environ['PATH'] = get_bb_var("PATH", "wic-tools")
+
+ try:
+ wks_file = 'temp.wks'
+ with open(wks_file, 'w') as wks:
+ rootfs_dir = get_bb_var('IMAGE_ROOTFS', 'core-image-minimal')
+ wks.write("""
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path usr
+part /usr --source rootfs --ondisk mmcblk0 --fstype=ext4 --rootfs-dir %s/usr
+part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --rootfs-dir %s/usr"""
+ % (rootfs_dir, rootfs_dir))
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir)).status)
+
+ os.remove(wks_file)
+ wicout = glob(self.resultdir + "%s-*direct" % 'temp')
+ self.assertEqual(1, len(wicout))
+
+ wicimg = wicout[0]
+
+ # verify partition size with wic
+ res = runCmd("parted -m %s unit b p 2>/dev/null" % wicimg)
+ self.assertEqual(0, res.status)
+
+ # parse parted output which looks like this:
+ # BYT;\n
+ # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+ # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+ partlns = res.output.splitlines()[2:]
+
+ self.assertEqual(3, len(partlns))
+
+ for part in [1, 2, 3]:
+ part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+ partln = partlns[part-1].split(":")
+ self.assertEqual(7, len(partln))
+ start = int(partln[1].rstrip("B")) / 512
+ length = int(partln[3].rstrip("B")) / 512
+ self.assertEqual(0, runCmd("dd if=%s of=%s skip=%d count=%d" %
+ (wicimg, part_file, start, length)).status)
+
+ def extract_files(debugfs_output):
+ """
+ extract file names from the output of debugfs -R 'ls -p',
+ which looks like this:
+
+ /2/040755/0/0/.//\n
+ /2/040755/0/0/..//\n
+ /11/040700/0/0/lost+found^M//\n
+ /12/040755/1002/1002/run//\n
+ /13/040755/1002/1002/sys//\n
+ /14/040755/1002/1002/bin//\n
+ /80/040755/1002/1002/var//\n
+ /92/040755/1002/1002/tmp//\n
+ """
+ # NOTE the occasional ^M in file names
+ return [line.split('/')[5].strip() for line in \
+ debugfs_output.strip().split('/\n')]
+
+ # Test partition 1, should contain the normal root directories, except
+ # /usr.
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+ os.path.join(self.resultdir, "selftest_img.part1"))
+ self.assertEqual(0, res.status)
+ files = extract_files(res.output)
+ self.assertIn("etc", files)
+ self.assertNotIn("usr", files)
+
+ # Partition 2, should contain common directories for /usr, not root
+ # directories.
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+ os.path.join(self.resultdir, "selftest_img.part2"))
+ self.assertEqual(0, res.status)
+ files = extract_files(res.output)
+ self.assertNotIn("etc", files)
+ self.assertNotIn("usr", files)
+ self.assertIn("share", files)
+
+ # Partition 3, should contain the same as partition 2, including the bin
+ # directory, but not the files inside it.
+ res = runCmd("debugfs -R 'ls -p' %s 2>/dev/null" % \
+ os.path.join(self.resultdir, "selftest_img.part3"))
+ self.assertEqual(0, res.status)
+ files = extract_files(res.output)
+ self.assertNotIn("etc", files)
+ self.assertNotIn("usr", files)
+ self.assertIn("share", files)
+ self.assertIn("bin", files)
+ res = runCmd("debugfs -R 'ls -p bin' %s 2>/dev/null" % \
+ os.path.join(self.resultdir, "selftest_img.part3"))
+ self.assertEqual(0, res.status)
+ files = extract_files(res.output)
+ self.assertIn(".", files)
+ self.assertIn("..", files)
+ self.assertEqual(2, len(files))
+
+ for part in [1, 2, 3]:
+ part_file = os.path.join(self.resultdir, "selftest_img.part%d" % part)
+ os.remove(part_file)
+
+ finally:
+ os.environ['PATH'] = oldpath
+
+ @OETestID(1662)
+ def test_exclude_path_errors(self):
+ """Test --exclude-path wks option error handling."""
+ wks_file = 'temp.wks'
+
+ # Absolute argument.
+ with open(wks_file, 'w') as wks:
+ wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path /usr")
+ self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir), ignore_status=True).status)
+ os.remove(wks_file)
+
+ # Argument pointing to parent directory.
+ with open(wks_file, 'w') as wks:
+ wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path ././..")
+ self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wks_file, self.resultdir), ignore_status=True).status)
+ os.remove(wks_file)
+
+ @OETestID(1496)
+ def test_bmap_short(self):
+ """Test generation of .bmap file -m option"""
+ cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir
+ status = runCmd(cmd).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+
+ @OETestID(1655)
+ def test_bmap_long(self):
+ """Test generation of .bmap file --bmap option"""
+ cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir
+ status = runCmd(cmd).status
+ self.assertEqual(0, status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+
+ def _get_image_env_path(self, image):
+ """Generate and obtain the path to <image>.env"""
+ if image not in self.wicenv_cache:
+ self.assertEqual(0, bitbake('%s -c do_rootfs_wicenv' % image).status)
+ bb_vars = get_bb_vars(['STAGING_DIR', 'MACHINE'], image)
+ stdir = bb_vars['STAGING_DIR']
+ machine = bb_vars['MACHINE']
+ self.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
+ return self.wicenv_cache[image]
+
+ @OETestID(1347)
+ def test_image_env(self):
+ """Test generation of <image>.env files."""
+ image = 'core-image-minimal'
+ imgdatadir = self._get_image_env_path(image)
+
+ bb_vars = get_bb_vars(['IMAGE_BASENAME', 'WICVARS'], image)
+ basename = bb_vars['IMAGE_BASENAME']
+ self.assertEqual(basename, image)
+ path = os.path.join(imgdatadir, basename) + '.env'
+ self.assertTrue(os.path.isfile(path))
+
+ wicvars = set(bb_vars['WICVARS'].split())
+ # filter out optional variables
+ wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES',
+ 'INITRD', 'INITRD_LIVE', 'ISODIR'))
+ with open(path) as envfile:
+ content = dict(line.split("=", 1) for line in envfile)
+ # test if variables used by wic present in the .env file
+ for var in wicvars:
+ self.assertTrue(var in content, "%s is not in .env file" % var)
+ self.assertTrue(content[var])
+
+ @OETestID(1559)
+ def test_image_vars_dir_short(self):
+ """Test image vars directory selection -v option"""
+ image = 'core-image-minimal'
+ imgenvdir = self._get_image_env_path(image)
+ native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=%s -v %s -n %s -o %s"
+ % (image, imgenvdir, native_sysroot,
+ self.resultdir)).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+
+ @OETestID(1665)
+ def test_image_vars_dir_long(self):
+ """Test image vars directory selection --vars option"""
+ image = 'core-image-minimal'
+ imgenvdir = self._get_image_env_path(image)
+ native_sysroot = get_bb_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=%s "
+ "--vars %s "
+ "--native-sysroot %s "
+ "--outdir %s"
+ % (image, imgenvdir, native_sysroot,
+ self.resultdir)).status)
+ self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+
+ @OETestID(1351)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_wic_image_type(self):
+ """Test building wic images by bitbake"""
+ config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
+ 'MACHINE_FEATURES_append = " efi"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('wic-image-minimal').status)
+ self.remove_config(config)
+
+ bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
+ deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
+ machine = bb_vars['MACHINE']
+ prefix = os.path.join(deploy_dir, 'wic-image-minimal-%s.' % machine)
+ # check if we have result image and manifests symlinks
+ # pointing to existing files
+ for suffix in ('wic', 'manifest'):
+ path = prefix + suffix
+ self.assertTrue(os.path.islink(path))
+ self.assertTrue(os.path.isfile(os.path.realpath(path)))
+
+ @OETestID(1424)
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ def test_qemu(self):
+ """Test wic-image-minimal under qemu"""
+ config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
+ 'MACHINE_FEATURES_append = " efi"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('wic-image-minimal').status)
+ self.remove_config(config)
+
+ with runqemu('wic-image-minimal', ssh=False) as qemu:
+ cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(output, '/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
+ cmd = "grep UUID= /etc/fstab"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+ self.assertEqual(output, 'UUID=2c71ef06-a81d-4735-9d3a-379b69c6bdba\t/media\text4\tdefaults\t0\t0')
+
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ @OETestID(1852)
+ def test_qemu_efi(self):
+ """Test core-image-minimal efi image under qemu"""
+ config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('core-image-minimal ovmf').status)
+ self.remove_config(config)
+
+ with runqemu('core-image-minimal', ssh=False,
+ runqemuparams='ovmf', image_fstype='wic') as qemu:
+ cmd = "grep sda. /proc/partitions |wc -l"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+ self.assertEqual(output, '3')
+
+ @staticmethod
+ def _make_fixed_size_wks(size):
+ """
+ Create a wks of an image with a single partition. Size of the partition is set
+ using --fixed-size flag. Returns a tuple: (path to wks file, wks image name)
+ """
+ with NamedTemporaryFile("w", suffix=".wks", delete=False) as tempf:
+ wkspath = tempf.name
+ tempf.write("part " \
+ "--source rootfs --ondisk hda --align 4 --fixed-size %d "
+ "--fstype=ext4\n" % size)
+ wksname = os.path.splitext(os.path.basename(wkspath))[0]
+
+ return wkspath, wksname
+
+ @OETestID(1847)
+ def test_fixed_size(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag
+ """
+ wkspath, wksname = Wic._make_fixed_size_wks(200)
+
+ self.assertEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wkspath, self.resultdir)).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(wicout))
+
+ wicimg = wicout[0]
+
+ # verify partition size with wic
+ res = runCmd("parted -m %s unit mib p 2>/dev/null" % wicimg,
+ ignore_status=True,
+ native_sysroot=self.native_sysroot)
+ self.assertEqual(0, res.status)
+
+ # parse parted output which looks like this:
+ # BYT;\n
+ # /var/tmp/wic/build/tmpfwvjjkf_-201611101222-hda.direct:200MiB:file:512:512:msdos::;\n
+ # 1:0.00MiB:200MiB:200MiB:ext4::;\n
+ partlns = res.output.splitlines()[2:]
+
+ self.assertEqual(1, len(partlns))
+ self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+
+ @OETestID(1848)
+ def test_fixed_size_error(self):
+ """
+ Test creation of a simple image with partition size controlled through
+ --fixed-size flag. The size of partition is intentionally set to 1MiB
+ in order to trigger an error in wic.
+ """
+ wkspath, wksname = Wic._make_fixed_size_wks(1)
+
+ self.assertEqual(1, runCmd("wic create %s -e core-image-minimal -o %s" \
+ % (wkspath, self.resultdir), ignore_status=True).status)
+ os.remove(wkspath)
+ wicout = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(0, len(wicout))
+
+ @only_for_arch(['i586', 'i686', 'x86_64'])
+ @OETestID(1854)
+ def test_rawcopy_plugin_qemu(self):
+ """Test rawcopy plugin in qemu"""
+ # build ext4 and wic images
+ for fstype in ("ext4", "wic"):
+ config = 'IMAGE_FSTYPES = "%s"\nWKS_FILE = "test_rawcopy_plugin.wks.in"\n' % fstype
+ self.append_config(config)
+ self.assertEqual(0, bitbake('core-image-minimal').status)
+ self.remove_config(config)
+
+ with runqemu('core-image-minimal', ssh=False, image_fstype='wic') as qemu:
+ cmd = "grep sda. /proc/partitions |wc -l"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+ self.assertEqual(output, '2')
+
+ @OETestID(1853)
+ def test_rawcopy_plugin(self):
+ """Test rawcopy plugin"""
+ img = 'core-image-minimal'
+ machine = get_bb_var('MACHINE', img)
+ with NamedTemporaryFile("w", suffix=".wks") as wks:
+ wks.writelines(['part /boot --active --source bootimg-pcbios\n',
+ 'part / --source rawcopy --sourceparams="file=%s-%s.ext4" --use-uuid\n'\
+ % (img, machine),
+ 'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n'])
+ wks.flush()
+ cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+ self.assertEqual(0, runCmd(cmd).status)
+ wksname = os.path.splitext(os.path.basename(wks.name))[0]
+ out = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(out))
+
+ @OETestID(1849)
+ def test_fs_types(self):
+ """Test filesystem types for empty and not empty partitions"""
+ img = 'core-image-minimal'
+ with NamedTemporaryFile("w", suffix=".wks") as wks:
+ wks.writelines(['part ext2 --fstype ext2 --source rootfs\n',
+ 'part btrfs --fstype btrfs --source rootfs --size 40M\n',
+ 'part squash --fstype squashfs --source rootfs\n',
+ 'part swap --fstype swap --size 1M\n',
+ 'part emptyvfat --fstype vfat --size 1M\n',
+ 'part emptymsdos --fstype msdos --size 1M\n',
+ 'part emptyext2 --fstype ext2 --size 1M\n',
+ 'part emptybtrfs --fstype btrfs --size 100M\n'])
+ wks.flush()
+ cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+ self.assertEqual(0, runCmd(cmd).status)
+ wksname = os.path.splitext(os.path.basename(wks.name))[0]
+ out = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(out))
+
+ @OETestID(1851)
+ def test_kickstart_parser(self):
+ """Test wks parser options"""
+ with NamedTemporaryFile("w", suffix=".wks") as wks:
+ wks.writelines(['part / --fstype ext3 --source rootfs --system-id 0xFF '\
+ '--overhead-factor 1.2 --size 100k\n'])
+ wks.flush()
+ cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
+ self.assertEqual(0, runCmd(cmd).status)
+ wksname = os.path.splitext(os.path.basename(wks.name))[0]
+ out = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(out))
+
+ @OETestID(1850)
+ def test_image_bootpart_globbed(self):
+ """Test globbed sources with image-bootpart plugin"""
+ img = "core-image-minimal"
+ cmd = "wic create sdimage-bootpart -e %s -o %s" % (img, self.resultdir)
+ config = 'IMAGE_BOOT_FILES = "%s*"' % get_bb_var('KERNEL_IMAGETYPE', img)
+ self.append_config(config)
+ self.assertEqual(0, runCmd(cmd).status)
+ self.remove_config(config)
+ self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+
+ @OETestID(1855)
+ def test_sparse_copy(self):
+ """Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs"""
+ libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'wic')
+ sys.path.insert(0, libpath)
+ from filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp
+ with NamedTemporaryFile("w", suffix=".wic-sparse") as sparse:
+ src_name = sparse.name
+ src_size = 1024 * 10
+ sparse.truncate(src_size)
+ # write one byte to the file
+ with open(src_name, 'r+b') as sfile:
+ sfile.seek(1024 * 4)
+ sfile.write(b'\x00')
+ dest = sparse.name + '.out'
+ # copy src file to dest using different filemap APIs
+ for api in (FilemapFiemap, FilemapSeek, None):
+ if os.path.exists(dest):
+ os.unlink(dest)
+ try:
+ sparse_copy(sparse.name, dest, api=api)
+ except ErrorNotSupp:
+ continue # skip unsupported API
+ dest_stat = os.stat(dest)
+ self.assertEqual(dest_stat.st_size, src_size)
+ # 8 blocks is 4K (physical sector size)
+ self.assertEqual(dest_stat.st_blocks, 8)
+ os.unlink(dest)
+
+ @OETestID(1857)
+ def test_wic_ls(self):
+ """Test listing image content using 'wic ls'"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "wictestdisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list partitions
+ result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(3, len(result.output.split('\n')))
+
+ # list directory content of the first partition
+ result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(6, len(result.output.split('\n')))
+
+ @OETestID(1856)
+ def test_wic_cp(self):
+ """Test copy files and directories to the the wic image."""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "wictestdisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the first partition
+ result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(6, len(result.output.split('\n')))
+
+ with NamedTemporaryFile("w", suffix=".wic-cp") as testfile:
+ testfile.write("test")
+
+ # copy file to the partition
+ result = runCmd("wic cp %s %s:1/ -n %s" % (testfile.name, images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if file is there
+ result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(7, len(result.output.split('\n')))
+ self.assertTrue(os.path.basename(testfile.name) in result.output)
+
+ # prepare directory
+ testdir = os.path.join(self.resultdir, 'wic-test-cp-dir')
+ testsubdir = os.path.join(testdir, 'subdir')
+ os.makedirs(os.path.join(testsubdir))
+ copy(testfile.name, testdir)
+
+ # copy directory to the partition
+ result = runCmd("wic cp %s %s:1/ -n %s" % (testdir, images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if directory is there
+ result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertEqual(8, len(result.output.split('\n')))
+ self.assertTrue(os.path.basename(testdir) in result.output)
+
+ @OETestID(1858)
+ def test_wic_rm(self):
+ """Test removing files and directories from the the wic image."""
+ self.assertEqual(0, runCmd("wic create mkefidisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "mkefidisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the first partition
+ result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertIn('\nBZIMAGE ', result.output)
+ self.assertIn('\nEFI <DIR> ', result.output)
+
+ # remove file
+ result = runCmd("wic rm %s:1/bzimage -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # remove directory
+ result = runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if they're removed
+ result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertNotIn('\nBZIMAGE ', result.output)
+ self.assertNotIn('\nEFI <DIR> ', result.output)
+
+ @OETestID(1922)
+ def test_mkfs_extraopts(self):
+ """Test wks option --mkfs-extraopts for empty and not empty partitions"""
+ img = 'core-image-minimal'
+ with NamedTemporaryFile("w", suffix=".wks") as wks:
+ wks.writelines(
+ ['part ext2 --fstype ext2 --source rootfs --mkfs-extraopts "-D -F -i 8192"\n',
+ "part btrfs --fstype btrfs --source rootfs --size 40M --mkfs-extraopts='--quiet'\n",
+ 'part squash --fstype squashfs --source rootfs --mkfs-extraopts "-no-sparse -b 4096"\n',
+ 'part emptyvfat --fstype vfat --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
+ 'part emptymsdos --fstype msdos --size 1M --mkfs-extraopts "-S 1024 -s 64"\n',
+ 'part emptyext2 --fstype ext2 --size 1M --mkfs-extraopts "-D -F -i 8192"\n',
+ 'part emptybtrfs --fstype btrfs --size 100M --mkfs-extraopts "--mixed -K"\n'])
+ wks.flush()
+ cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+ self.assertEqual(0, runCmd(cmd).status)
+ wksname = os.path.splitext(os.path.basename(wks.name))[0]
+ out = glob(self.resultdir + "%s-*direct" % wksname)
+ self.assertEqual(1, len(out))
+
+ def test_expand_mbr_image(self):
+ """Test wic write --expand command for mbr image"""
+ # build an image
+ config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "directdisk.wks"\n'
+ self.append_config(config)
+ self.assertEqual(0, bitbake('core-image-minimal').status)
+
+ # get path to the image
+ bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'MACHINE'])
+ deploy_dir = bb_vars['DEPLOY_DIR_IMAGE']
+ machine = bb_vars['MACHINE']
+ image_path = os.path.join(deploy_dir, 'core-image-minimal-%s.wic' % machine)
+
+ self.remove_config(config)
+
+ try:
+ # expand image to 1G
+ new_image_path = None
+ with NamedTemporaryFile(mode='wb', suffix='.wic.exp',
+ dir=deploy_dir, delete=False) as sparse:
+ sparse.truncate(1024 ** 3)
+ new_image_path = sparse.name
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+ cmd = "wic write -n %s --expand 1:0 %s %s" % (sysroot, image_path, new_image_path)
+ self.assertEqual(0, runCmd(cmd).status)
+
+ # check if partitions are expanded
+ orig = runCmd("wic ls %s -n %s" % (image_path, sysroot))
+ exp = runCmd("wic ls %s -n %s" % (new_image_path, sysroot))
+ orig_sizes = [int(line.split()[3]) for line in orig.output.split('\n')[1:]]
+ exp_sizes = [int(line.split()[3]) for line in exp.output.split('\n')[1:]]
+ self.assertEqual(orig_sizes[0], exp_sizes[0]) # first partition is not resized
+ self.assertTrue(orig_sizes[1] < exp_sizes[1])
+
+ # Check if all free space is partitioned
+ result = runCmd("%s/usr/sbin/sfdisk -F %s" % (sysroot, new_image_path))
+ self.assertTrue("0 B, 0 bytes, 0 sectors" in result.output)
+
+ os.rename(image_path, image_path + '.bak')
+ os.rename(new_image_path, image_path)
+
+ # Check if it boots in qemu
+ with runqemu('core-image-minimal', ssh=False) as qemu:
+ cmd = "ls /etc/"
+ status, output = qemu.run_serial('true')
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+ finally:
+ if os.path.exists(new_image_path):
+ os.unlink(new_image_path)
+ if os.path.exists(image_path + '.bak'):
+ os.rename(image_path + '.bak', image_path)
+
+ def test_wic_ls_ext(self):
+ """Test listing content of the ext partition using 'wic ls'"""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "wictestdisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the second ext4 partition
+ result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(
+ set(line.split()[-1] for line in result.output.split('\n') if line)))
+
+ def test_wic_cp_ext(self):
+ """Test copy files and directories to the ext partition."""
+ self.assertEqual(0, runCmd("wic create wictestdisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "wictestdisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the ext4 partition
+ result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ dirs = set(line.split()[-1] for line in result.output.split('\n') if line)
+ self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(dirs))
+
+ with NamedTemporaryFile("w", suffix=".wic-cp") as testfile:
+ testfile.write("test")
+
+ # copy file to the partition
+ result = runCmd("wic cp %s %s:2/ -n %s" % (testfile.name, images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if file is there
+ result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ newdirs = set(line.split()[-1] for line in result.output.split('\n') if line)
+ self.assertEqual(newdirs.difference(dirs), set([os.path.basename(testfile.name)]))
+
+ def test_wic_rm_ext(self):
+ """Test removing files from the ext partition."""
+ self.assertEqual(0, runCmd("wic create mkefidisk "
+ "--image-name=core-image-minimal "
+ "-D -o %s" % self.resultdir).status)
+ images = glob(self.resultdir + "mkefidisk-*.direct")
+ self.assertEqual(1, len(images))
+
+ sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
+
+ # list directory content of the /etc directory on ext4 partition
+ result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue('fstab' in [line.split()[-1] for line in result.output.split('\n') if line])
+
+ # remove file
+ result = runCmd("wic rm %s:2/etc/fstab -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+
+ # check if it's removed
+ result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+ self.assertEqual(0, result.status)
+ self.assertTrue('fstab' not in [line.split()[-1] for line in result.output.split('\n') if line])
diff --git a/poky/meta/lib/oeqa/selftest/context.py b/poky/meta/lib/oeqa/selftest/context.py
new file mode 100644
index 000000000..9e90d3c25
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/context.py
@@ -0,0 +1,279 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import time
+import glob
+import sys
+import imp
+import signal
+from shutil import copyfile
+from random import choice
+
+import oeqa
+
+from oeqa.core.context import OETestContext, OETestContextExecutor
+from oeqa.core.exception import OEQAPreRun, OEQATestNotFound
+
+from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer
+
+class OESelftestTestContext(OETestContext):
+ def __init__(self, td=None, logger=None, machines=None, config_paths=None):
+ super(OESelftestTestContext, self).__init__(td, logger)
+
+ self.machines = machines
+ self.custommachine = None
+ self.config_paths = config_paths
+
+ def runTests(self, machine=None, skips=[]):
+ if machine:
+ self.custommachine = machine
+ if machine == 'random':
+ self.custommachine = choice(self.machines)
+ self.logger.info('Run tests with custom MACHINE set to: %s' % \
+ self.custommachine)
+ return super(OESelftestTestContext, self).runTests(skips)
+
+ def listTests(self, display_type, machine=None):
+ return super(OESelftestTestContext, self).listTests(display_type)
+
+class OESelftestTestContextExecutor(OETestContextExecutor):
+ _context_class = OESelftestTestContext
+ _script_executor = 'oe-selftest'
+
+ name = 'oe-selftest'
+ help = 'oe-selftest test component'
+ description = 'Executes selftest tests'
+
+ def register_commands(self, logger, parser):
+ group = parser.add_mutually_exclusive_group(required=True)
+
+ group.add_argument('-a', '--run-all-tests', default=False,
+ action="store_true", dest="run_all_tests",
+ help='Run all (unhidden) tests')
+ group.add_argument('-R', '--skip-tests', required=False, action='store',
+ nargs='+', dest="skips", default=None,
+ help='Run all (unhidden) tests except the ones specified. Format should be <module>[.<class>[.<test_method>]]')
+ group.add_argument('-r', '--run-tests', required=False, action='store',
+ nargs='+', dest="run_tests", default=None,
+ help='Select what tests to run (modules, classes or test methods). Format should be: <module>.<class>.<test_method>')
+
+ group.add_argument('-m', '--list-modules', required=False,
+ action="store_true", default=False,
+ help='List all available test modules.')
+ group.add_argument('--list-classes', required=False,
+ action="store_true", default=False,
+ help='List all available test classes.')
+ group.add_argument('-l', '--list-tests', required=False,
+ action="store_true", default=False,
+ help='List all available tests.')
+
+ parser.add_argument('--machine', required=False, choices=['random', 'all'],
+ help='Run tests on different machines (random/all).')
+
+ parser.set_defaults(func=self.run)
+
+ def _get_available_machines(self):
+ machines = []
+
+ bbpath = self.tc_kwargs['init']['td']['BBPATH'].split(':')
+
+ for path in bbpath:
+ found_machines = glob.glob(os.path.join(path, 'conf', 'machine', '*.conf'))
+ if found_machines:
+ for i in found_machines:
+ # eg: '/home/<user>/poky/meta-intel/conf/machine/intel-core2-32.conf'
+ machines.append(os.path.splitext(os.path.basename(i))[0])
+
+ return machines
+
+ def _get_cases_paths(self, bbpath):
+ cases_paths = []
+ for layer in bbpath:
+ cases_dir = os.path.join(layer, 'lib', 'oeqa', 'selftest', 'cases')
+ if os.path.isdir(cases_dir):
+ cases_paths.append(cases_dir)
+ return cases_paths
+
+ def _process_args(self, logger, args):
+ args.output_log = '%s-results-%s.log' % (self.name,
+ time.strftime("%Y%m%d%H%M%S"))
+ args.test_data_file = None
+ args.CASES_PATHS = None
+
+ super(OESelftestTestContextExecutor, self)._process_args(logger, args)
+
+ if args.list_modules:
+ args.list_tests = 'module'
+ elif args.list_classes:
+ args.list_tests = 'class'
+ elif args.list_tests:
+ args.list_tests = 'name'
+
+ self.tc_kwargs['init']['td'] = get_bb_vars()
+ self.tc_kwargs['init']['machines'] = self._get_available_machines()
+
+ builddir = os.environ.get("BUILDDIR")
+ self.tc_kwargs['init']['config_paths'] = {}
+ self.tc_kwargs['init']['config_paths']['testlayer_path'] = \
+ get_test_layer()
+ self.tc_kwargs['init']['config_paths']['builddir'] = builddir
+ self.tc_kwargs['init']['config_paths']['localconf'] = \
+ os.path.join(builddir, "conf/local.conf")
+ self.tc_kwargs['init']['config_paths']['localconf_backup'] = \
+ os.path.join(builddir, "conf/local.conf.orig")
+ self.tc_kwargs['init']['config_paths']['localconf_class_backup'] = \
+ os.path.join(builddir, "conf/local.conf.bk")
+ self.tc_kwargs['init']['config_paths']['bblayers'] = \
+ os.path.join(builddir, "conf/bblayers.conf")
+ self.tc_kwargs['init']['config_paths']['bblayers_backup'] = \
+ os.path.join(builddir, "conf/bblayers.conf.orig")
+ self.tc_kwargs['init']['config_paths']['bblayers_class_backup'] = \
+ os.path.join(builddir, "conf/bblayers.conf.bk")
+
+ copyfile(self.tc_kwargs['init']['config_paths']['localconf'],
+ self.tc_kwargs['init']['config_paths']['localconf_backup'])
+ copyfile(self.tc_kwargs['init']['config_paths']['bblayers'],
+ self.tc_kwargs['init']['config_paths']['bblayers_backup'])
+
+ self.tc_kwargs['run']['skips'] = args.skips
+
+ def _pre_run(self):
+ def _check_required_env_variables(vars):
+ for var in vars:
+ if not os.environ.get(var):
+ self.tc.logger.error("%s is not set. Did you forget to source your build environment setup script?" % var)
+ raise OEQAPreRun
+
+ def _check_presence_meta_selftest():
+ builddir = os.environ.get("BUILDDIR")
+ if os.getcwd() != builddir:
+ self.tc.logger.info("Changing cwd to %s" % builddir)
+ os.chdir(builddir)
+
+ if not "meta-selftest" in self.tc.td["BBLAYERS"]:
+ self.tc.logger.warn("meta-selftest layer not found in BBLAYERS, adding it")
+ meta_selftestdir = os.path.join(
+ self.tc.td["BBLAYERS_FETCH_DIR"], 'meta-selftest')
+ if os.path.isdir(meta_selftestdir):
+ runCmd("bitbake-layers add-layer %s" %meta_selftestdir)
+ # reload data is needed because a meta-selftest layer was add
+ self.tc.td = get_bb_vars()
+ self.tc.config_paths['testlayer_path'] = get_test_layer()
+ else:
+ self.tc.logger.error("could not locate meta-selftest in:\n%s" % meta_selftestdir)
+ raise OEQAPreRun
+
+ def _add_layer_libs():
+ bbpath = self.tc.td['BBPATH'].split(':')
+ layer_libdirs = [p for p in (os.path.join(l, 'lib') \
+ for l in bbpath) if os.path.exists(p)]
+ if layer_libdirs:
+ self.tc.logger.info("Adding layer libraries:")
+ for l in layer_libdirs:
+ self.tc.logger.info("\t%s" % l)
+
+ sys.path.extend(layer_libdirs)
+ imp.reload(oeqa.selftest)
+
+ _check_required_env_variables(["BUILDDIR"])
+ _check_presence_meta_selftest()
+
+ if "buildhistory.bbclass" in self.tc.td["BBINCLUDED"]:
+ self.tc.logger.error("You have buildhistory enabled already and this isn't recommended for selftest, please disable it first.")
+ raise OEQAPreRun
+
+ if "PRSERV_HOST" in self.tc.td:
+ self.tc.logger.error("Please unset PRSERV_HOST in order to run oe-selftest")
+ raise OEQAPreRun
+
+ if "SANITY_TESTED_DISTROS" in self.tc.td:
+ self.tc.logger.error("Please unset SANITY_TESTED_DISTROS in order to run oe-selftest")
+ raise OEQAPreRun
+
+ _add_layer_libs()
+
+ self.tc.logger.info("Running bitbake -p")
+ runCmd("bitbake -p")
+
+ def _internal_run(self, logger, args):
+ self.module_paths = self._get_cases_paths(
+ self.tc_kwargs['init']['td']['BBPATH'].split(':'))
+
+ self.tc = self._context_class(**self.tc_kwargs['init'])
+ try:
+ self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
+ except OEQATestNotFound as ex:
+ logger.error(ex)
+ sys.exit(1)
+
+ if args.list_tests:
+ rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['list'])
+ else:
+ self._pre_run()
+ rc = self.tc.runTests(**self.tc_kwargs['run'])
+ rc.logDetails()
+ rc.logSummary(self.name)
+
+ return rc
+
+ def _signal_clean_handler(self, signum, frame):
+ sys.exit(1)
+
+ def run(self, logger, args):
+ self._process_args(logger, args)
+
+ signal.signal(signal.SIGTERM, self._signal_clean_handler)
+
+ rc = None
+ try:
+ if args.machine:
+ logger.info('Custom machine mode enabled. MACHINE set to %s' %
+ args.machine)
+
+ if args.machine == 'all':
+ results = []
+ for m in self.tc_kwargs['init']['machines']:
+ self.tc_kwargs['run']['machine'] = m
+ results.append(self._internal_run(logger, args))
+
+ # XXX: the oe-selftest script only needs to know if one
+ # machine run fails
+ for r in results:
+ rc = r
+ if not r.wasSuccessful():
+ break
+
+ else:
+ self.tc_kwargs['run']['machine'] = args.machine
+ return self._internal_run(logger, args)
+
+ else:
+ self.tc_kwargs['run']['machine'] = args.machine
+ rc = self._internal_run(logger, args)
+ finally:
+ config_paths = self.tc_kwargs['init']['config_paths']
+ if os.path.exists(config_paths['localconf_backup']):
+ copyfile(config_paths['localconf_backup'],
+ config_paths['localconf'])
+ os.remove(config_paths['localconf_backup'])
+
+ if os.path.exists(config_paths['bblayers_backup']):
+ copyfile(config_paths['bblayers_backup'],
+ config_paths['bblayers'])
+ os.remove(config_paths['bblayers_backup'])
+
+ if os.path.exists(config_paths['localconf_class_backup']):
+ os.remove(config_paths['localconf_class_backup'])
+ if os.path.exists(config_paths['bblayers_class_backup']):
+ os.remove(config_paths['bblayers_class_backup'])
+
+ output_link = os.path.join(os.path.dirname(args.output_log),
+ "%s-results.log" % self.name)
+ if os.path.exists(output_link):
+ os.remove(output_link)
+ os.symlink(args.output_log, output_link)
+
+ return rc
+
+_executor_class = OESelftestTestContextExecutor
diff --git a/poky/meta/lib/oeqa/targetcontrol.py b/poky/meta/lib/oeqa/targetcontrol.py
new file mode 100644
index 000000000..59a9c35a0
--- /dev/null
+++ b/poky/meta/lib/oeqa/targetcontrol.py
@@ -0,0 +1,232 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module is used by testimage.bbclass for setting up and controlling a target machine.
+
+import os
+import shutil
+import subprocess
+import bb
+import traceback
+import sys
+import logging
+from oeqa.utils.sshcontrol import SSHControl
+from oeqa.utils.qemurunner import QemuRunner
+from oeqa.utils.qemutinyrunner import QemuTinyRunner
+from oeqa.utils.dump import TargetDumper
+from oeqa.controllers.testtargetloader import TestTargetLoader
+from abc import ABCMeta, abstractmethod
+
+class BaseTarget(object, metaclass=ABCMeta):
+
+ supported_image_fstypes = []
+
+ def __init__(self, d, logger):
+ self.connection = None
+ self.ip = None
+ self.server_ip = None
+ self.datetime = d.getVar('DATETIME')
+ self.testdir = d.getVar("TEST_LOG_DIR")
+ self.pn = d.getVar("PN")
+ self.logger = logger
+
+ @abstractmethod
+ def deploy(self):
+
+ self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
+ sshloglink = os.path.join(self.testdir, "ssh_target_log")
+ if os.path.islink(sshloglink):
+ os.unlink(sshloglink)
+ os.symlink(self.sshlog, sshloglink)
+ self.logger.info("SSH log file: %s" % self.sshlog)
+
+ @abstractmethod
+ def start(self, params=None, ssh=True, extra_bootparams=None):
+ pass
+
+ @abstractmethod
+ def stop(self):
+ pass
+
+ @classmethod
+ def get_extra_files(self):
+ return None
+
+ @classmethod
+ def match_image_fstype(self, d, image_fstypes=None):
+ if not image_fstypes:
+ image_fstypes = d.getVar('IMAGE_FSTYPES').split(' ')
+ possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes]
+ if possible_image_fstypes:
+ return possible_image_fstypes[0]
+ else:
+ return None
+
+ def get_image_fstype(self, d):
+ image_fstype = self.match_image_fstype(d)
+ if image_fstype:
+ return image_fstype
+ else:
+ bb.fatal("IMAGE_FSTYPES should contain a Target Controller supported image fstype: %s " % ', '.join(map(str, self.supported_image_fstypes)))
+
+ def restart(self, params=None):
+ self.stop()
+ self.start(params)
+
+ def run(self, cmd, timeout=None):
+ return self.connection.run(cmd, timeout)
+
+ def copy_to(self, localpath, remotepath):
+ return self.connection.copy_to(localpath, remotepath)
+
+ def copy_from(self, remotepath, localpath):
+ return self.connection.copy_from(remotepath, localpath)
+
+
+
+class QemuTarget(BaseTarget):
+
+ supported_image_fstypes = ['ext3', 'ext4', 'cpio.gz', 'wic']
+
+ def __init__(self, d, logger, image_fstype=None):
+
+ import oe.types
+
+ super(QemuTarget, self).__init__(d, logger)
+
+ self.rootfs = ''
+ self.kernel = ''
+ self.image_fstype = ''
+
+ if d.getVar('FIND_ROOTFS') == '1':
+ self.image_fstype = image_fstype or self.get_image_fstype(d)
+ self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("IMAGE_LINK_NAME") + '.' + self.image_fstype)
+ self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+ self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
+ dump_target_cmds = d.getVar("testimage_dump_target")
+ dump_host_cmds = d.getVar("testimage_dump_host")
+ dump_dir = d.getVar("TESTIMAGE_DUMP_DIR")
+ qemu_use_kvm = d.getVar("QEMU_USE_KVM")
+ if qemu_use_kvm and \
+ (oe.types.boolean(qemu_use_kvm) and "x86" in d.getVar("MACHINE") or \
+ d.getVar("MACHINE") in qemu_use_kvm.split()):
+ use_kvm = True
+ else:
+ use_kvm = False
+
+ # Log QemuRunner log output to a file
+ import oe.path
+ bb.utils.mkdirhier(self.testdir)
+ self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
+ loggerhandler = logging.FileHandler(self.qemurunnerlog)
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ self.logger.addHandler(loggerhandler)
+ oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
+
+ if d.getVar("DISTRO") == "poky-tiny":
+ self.runner = QemuTinyRunner(machine=d.getVar("MACHINE"),
+ rootfs=self.rootfs,
+ tmpdir = d.getVar("TMPDIR"),
+ deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
+ display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
+ logfile = self.qemulog,
+ kernel = self.kernel,
+ boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
+ logger = logger)
+ else:
+ self.runner = QemuRunner(machine=d.getVar("MACHINE"),
+ rootfs=self.rootfs,
+ tmpdir = d.getVar("TMPDIR"),
+ deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE"),
+ display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY"),
+ logfile = self.qemulog,
+ boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT")),
+ use_kvm = use_kvm,
+ dump_dir = dump_dir,
+ dump_host_cmds = d.getVar("testimage_dump_host"),
+ logger = logger)
+
+ self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
+
+ def deploy(self):
+ bb.utils.mkdirhier(self.testdir)
+
+ qemuloglink = os.path.join(self.testdir, "qemu_boot_log")
+ if os.path.islink(qemuloglink):
+ os.unlink(qemuloglink)
+ os.symlink(self.qemulog, qemuloglink)
+
+ self.logger.info("rootfs file: %s" % self.rootfs)
+ self.logger.info("Qemu log file: %s" % self.qemulog)
+ super(QemuTarget, self).deploy()
+
+ def start(self, params=None, ssh=True, extra_bootparams='', runqemuparams='', launch_cmd='', discard_writes=True):
+ if launch_cmd:
+ start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd)
+ else:
+ start = self.runner.start(params, get_ip=ssh, extra_bootparams=extra_bootparams, runqemuparams=runqemuparams, discard_writes=discard_writes)
+
+ if start:
+ if ssh:
+ self.ip = self.runner.ip
+ self.server_ip = self.runner.server_ip
+ self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
+ else:
+ self.stop()
+ if os.path.exists(self.qemulog):
+ with open(self.qemulog, 'r') as f:
+ bb.error("Qemu log output from %s:\n%s" % (self.qemulog, f.read()))
+ raise bb.build.FuncFailed("%s - FAILED to start qemu - check the task log and the boot log" % self.pn)
+
+ def check(self):
+ return self.runner.is_alive()
+
+ def stop(self):
+ self.runner.stop()
+ self.connection = None
+ self.ip = None
+ self.server_ip = None
+
+ def restart(self, params=None):
+ if self.runner.restart(params):
+ self.ip = self.runner.ip
+ self.server_ip = self.runner.server_ip
+ self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
+ else:
+ raise bb.build.FuncFailed("%s - FAILED to re-start qemu - check the task log and the boot log" % self.pn)
+
+ def run_serial(self, command, timeout=5):
+ return self.runner.run_serial(command, timeout=timeout)
+
+
+class SimpleRemoteTarget(BaseTarget):
+
+ def __init__(self, d):
+ super(SimpleRemoteTarget, self).__init__(d)
+ addr = d.getVar("TEST_TARGET_IP") or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+ self.ip = addr.split(":")[0]
+ try:
+ self.port = addr.split(":")[1]
+ except IndexError:
+ self.port = None
+ self.logger.info("Target IP: %s" % self.ip)
+ self.server_ip = d.getVar("TEST_SERVER_IP")
+ if not self.server_ip:
+ try:
+ self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
+ except Exception as e:
+ bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
+ self.logger.info("Server IP: %s" % self.server_ip)
+
+ def deploy(self):
+ super(SimpleRemoteTarget, self).deploy()
+
+ def start(self, params=None, ssh=True, extra_bootparams=None):
+ if ssh:
+ self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port)
+
+ def stop(self):
+ self.connection = None
+ self.ip = None
+ self.server_ip = None
diff --git a/poky/meta/lib/oeqa/utils/__init__.py b/poky/meta/lib/oeqa/utils/__init__.py
new file mode 100644
index 000000000..d38a32301
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/__init__.py
@@ -0,0 +1,103 @@
+# Enable other layers to have modules in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
+
+# Borrowed from CalledProcessError
+
+class CommandError(Exception):
+ def __init__(self, retcode, cmd, output = None):
+ self.retcode = retcode
+ self.cmd = cmd
+ self.output = output
+ def __str__(self):
+ return "Command '%s' returned non-zero exit status %d with output: %s" % (self.cmd, self.retcode, self.output)
+
+def avoid_paths_in_environ(paths):
+ """
+ Searches for every path in os.environ['PATH']
+ if found remove it.
+
+ Returns new PATH without avoided PATHs.
+ """
+ import os
+
+ new_path = ''
+ for p in os.environ['PATH'].split(':'):
+ avoid = False
+ for pa in paths:
+ if pa in p:
+ avoid = True
+ break
+ if avoid:
+ continue
+
+ new_path = new_path + p + ':'
+
+ new_path = new_path[:-1]
+ return new_path
+
+def make_logger_bitbake_compatible(logger):
+ import logging
+
+ """
+ Bitbake logger redifines debug() in order to
+ set a level within debug, this breaks compatibility
+ with vainilla logging, so we neeed to redifine debug()
+ method again also add info() method with INFO + 1 level.
+ """
+ def _bitbake_log_debug(*args, **kwargs):
+ lvl = logging.DEBUG
+
+ if isinstance(args[0], int):
+ lvl = args[0]
+ msg = args[1]
+ args = args[2:]
+ else:
+ msg = args[0]
+ args = args[1:]
+
+ logger.log(lvl, msg, *args, **kwargs)
+
+ def _bitbake_log_info(msg, *args, **kwargs):
+ logger.log(logging.INFO + 1, msg, *args, **kwargs)
+
+ logger.debug = _bitbake_log_debug
+ logger.info = _bitbake_log_info
+
+ return logger
+
+def load_test_components(logger, executor):
+ import sys
+ import os
+ import importlib
+
+ from oeqa.core.context import OETestContextExecutor
+
+ components = {}
+
+ for path in sys.path:
+ base_dir = os.path.join(path, 'oeqa')
+ if os.path.exists(base_dir) and os.path.isdir(base_dir):
+ for file in os.listdir(base_dir):
+ comp_name = file
+ comp_context = os.path.join(base_dir, file, 'context.py')
+ if os.path.exists(comp_context):
+ comp_plugin = importlib.import_module('oeqa.%s.%s' % \
+ (comp_name, 'context'))
+ try:
+ if not issubclass(comp_plugin._executor_class,
+ OETestContextExecutor):
+ raise TypeError("Component %s in %s, _executor_class "\
+ "isn't derived from OETestContextExecutor."\
+ % (comp_name, comp_context))
+
+ if comp_plugin._executor_class._script_executor \
+ != executor:
+ continue
+
+ components[comp_name] = comp_plugin._executor_class()
+ except AttributeError:
+ raise AttributeError("Component %s in %s don't have "\
+ "_executor_class defined." % (comp_name, comp_context))
+
+ return components
diff --git a/poky/meta/lib/oeqa/utils/buildproject.py b/poky/meta/lib/oeqa/utils/buildproject.py
new file mode 100644
index 000000000..721f35d99
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/buildproject.py
@@ -0,0 +1,55 @@
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for automating build tests for projects
+
+import os
+import re
+import subprocess
+import shutil
+import tempfile
+
+from abc import ABCMeta, abstractmethod
+
+class BuildProject(metaclass=ABCMeta):
+ def __init__(self, uri, foldername=None, tmpdir=None, dl_dir=None):
+ self.uri = uri
+ self.archive = os.path.basename(uri)
+ if not tmpdir:
+ tmpdir = tempfile.mkdtemp(prefix='buildproject')
+ self.localarchive = os.path.join(tmpdir, self.archive)
+ self.dl_dir = dl_dir
+ if foldername:
+ self.fname = foldername
+ else:
+ self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive)
+
+ # Download self.archive to self.localarchive
+ def _download_archive(self):
+ if self.dl_dir and os.path.exists(os.path.join(self.dl_dir, self.archive)):
+ shutil.copyfile(os.path.join(self.dl_dir, self.archive), self.localarchive)
+ return
+
+ cmd = "wget -O %s %s" % (self.localarchive, self.uri)
+ subprocess.check_output(cmd, shell=True)
+
+ # This method should provide a way to run a command in the desired environment.
+ @abstractmethod
+ def _run(self, cmd):
+ pass
+
+ # The timeout parameter of target.run is set to 0 to make the ssh command
+ # run with no timeout.
+ def run_configure(self, configure_args='', extra_cmds=''):
+ return self._run('cd %s; gnu-configize; %s ./configure %s' % (self.targetdir, extra_cmds, configure_args))
+
+ def run_make(self, make_args=''):
+ return self._run('cd %s; make %s' % (self.targetdir, make_args))
+
+ def run_install(self, install_args=''):
+ return self._run('cd %s; make install %s' % (self.targetdir, install_args))
+
+ def clean(self):
+ self._run('rm -rf %s' % self.targetdir)
+ subprocess.check_call('rm -f %s' % self.localarchive, shell=True)
diff --git a/poky/meta/lib/oeqa/utils/commands.py b/poky/meta/lib/oeqa/utils/commands.py
new file mode 100644
index 000000000..0d9cf23fe
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/commands.py
@@ -0,0 +1,357 @@
+# Copyright (c) 2013-2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# DESCRIPTION
+# This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest
+# It provides a class and methods for running commands on the host in a convienent way for tests.
+
+
+
+import os
+import sys
+import signal
+import subprocess
+import threading
+import time
+import logging
+from oeqa.utils import CommandError
+from oeqa.utils import ftools
+import re
+import contextlib
+# Export test doesn't require bb
+try:
+ import bb
+except ImportError:
+ pass
+
+class Command(object):
+ def __init__(self, command, bg=False, timeout=None, data=None, output_log=None, **options):
+
+ self.defaultopts = {
+ "stdout": subprocess.PIPE,
+ "stderr": subprocess.STDOUT,
+ "stdin": None,
+ "shell": False,
+ "bufsize": -1,
+ }
+
+ self.cmd = command
+ self.bg = bg
+ self.timeout = timeout
+ self.data = data
+
+ self.options = dict(self.defaultopts)
+ if isinstance(self.cmd, str):
+ self.options["shell"] = True
+ if self.data:
+ self.options['stdin'] = subprocess.PIPE
+ self.options.update(options)
+
+ self.status = None
+ # We collect chunks of output before joining them at the end.
+ self._output_chunks = []
+ self._error_chunks = []
+ self.output = None
+ self.error = None
+ self.threads = []
+
+ self.output_log = output_log
+ self.log = logging.getLogger("utils.commands")
+
+ def run(self):
+ self.process = subprocess.Popen(self.cmd, **self.options)
+
+ def readThread(output, stream, logfunc):
+ if logfunc:
+ for line in stream:
+ output.append(line)
+ logfunc(line.decode("utf-8", errors='replace').rstrip())
+ else:
+ output.append(stream.read())
+
+ def readStderrThread():
+ readThread(self._error_chunks, self.process.stderr, self.output_log.error if self.output_log else None)
+
+ def readStdoutThread():
+ readThread(self._output_chunks, self.process.stdout, self.output_log.info if self.output_log else None)
+
+ def writeThread():
+ try:
+ self.process.stdin.write(self.data)
+ self.process.stdin.close()
+ except OSError as ex:
+ # It's not an error when the command does not consume all
+ # of our data. subprocess.communicate() also ignores that.
+ if ex.errno != EPIPE:
+ raise
+
+ # We write in a separate thread because then we can read
+ # without worrying about deadlocks. The additional thread is
+ # expected to terminate by itself and we mark it as a daemon,
+ # so even it should happen to not terminate for whatever
+ # reason, the main process will still exit, which will then
+ # kill the write thread.
+ if self.data:
+ threading.Thread(target=writeThread, daemon=True).start()
+ if self.process.stderr:
+ thread = threading.Thread(target=readStderrThread)
+ thread.start()
+ self.threads.append(thread)
+ if self.output_log:
+ self.output_log.info('Running: %s' % self.cmd)
+ thread = threading.Thread(target=readStdoutThread)
+ thread.start()
+ self.threads.append(thread)
+
+ self.log.debug("Running command '%s'" % self.cmd)
+
+ if not self.bg:
+ if self.timeout is None:
+ for thread in self.threads:
+ thread.join()
+ else:
+ deadline = time.time() + self.timeout
+ for thread in self.threads:
+ timeout = deadline - time.time()
+ if timeout < 0:
+ timeout = 0
+ thread.join(timeout)
+ self.stop()
+
+ def stop(self):
+ for thread in self.threads:
+ if thread.isAlive():
+ self.process.terminate()
+ # let's give it more time to terminate gracefully before killing it
+ thread.join(5)
+ if thread.isAlive():
+ self.process.kill()
+ thread.join()
+
+ def finalize_output(data):
+ if not data:
+ data = ""
+ else:
+ data = b"".join(data)
+ data = data.decode("utf-8", errors='replace').rstrip()
+ return data
+
+ self.output = finalize_output(self._output_chunks)
+ self._output_chunks = None
+ # self.error used to be a byte string earlier, probably unintentionally.
+ # Now it is a normal string, just like self.output.
+ self.error = finalize_output(self._error_chunks)
+ self._error_chunks = None
+ # At this point we know that the process has closed stdout/stderr, so
+ # it is safe and necessary to wait for the actual process completion.
+ self.status = self.process.wait()
+
+ self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status))
+ # logging the complete output is insane
+ # bitbake -e output is really big
+ # and makes the log file useless
+ if self.status:
+ lout = "\n".join(self.output.splitlines()[-20:])
+ self.log.debug("Last 20 lines:\n%s" % lout)
+
+
+class Result(object):
+ pass
+
+
+def runCmd(command, ignore_status=False, timeout=None, assert_error=True,
+ native_sysroot=None, limit_exc_output=0, output_log=None, **options):
+ result = Result()
+
+ if native_sysroot:
+ extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+ (native_sysroot, native_sysroot, native_sysroot)
+ nenv = dict(options.get('env', os.environ))
+ nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '')
+ options['env'] = nenv
+
+ cmd = Command(command, timeout=timeout, output_log=output_log, **options)
+ cmd.run()
+
+ result.command = command
+ result.status = cmd.status
+ result.output = cmd.output
+ result.error = cmd.error
+ result.pid = cmd.process.pid
+
+ if result.status and not ignore_status:
+ exc_output = result.output
+ if limit_exc_output > 0:
+ split = result.output.splitlines()
+ if len(split) > limit_exc_output:
+ exc_output = "\n... (last %d lines of output)\n" % limit_exc_output + \
+ '\n'.join(split[-limit_exc_output:])
+ if assert_error:
+ raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
+ else:
+ raise CommandError(result.status, command, exc_output)
+
+ return result
+
+
+def bitbake(command, ignore_status=False, timeout=None, postconfig=None, output_log=None, **options):
+
+ if postconfig:
+ postconfig_file = os.path.join(os.environ.get('BUILDDIR'), 'oeqa-post.conf')
+ ftools.write_file(postconfig_file, postconfig)
+ extra_args = "-R %s" % postconfig_file
+ else:
+ extra_args = ""
+
+ if isinstance(command, str):
+ cmd = "bitbake " + extra_args + " " + command
+ else:
+ cmd = [ "bitbake" ] + [a for a in (command + extra_args.split(" ")) if a not in [""]]
+
+ try:
+ return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)
+ finally:
+ if postconfig:
+ os.remove(postconfig_file)
+
+
+def get_bb_env(target=None, postconfig=None):
+ if target:
+ return bitbake("-e %s" % target, postconfig=postconfig).output
+ else:
+ return bitbake("-e", postconfig=postconfig).output
+
+def get_bb_vars(variables=None, target=None, postconfig=None):
+ """Get values of multiple bitbake variables"""
+ bbenv = get_bb_env(target, postconfig=postconfig)
+
+ if variables is not None:
+ variables = list(variables)
+ var_re = re.compile(r'^(export )?(?P<var>\w+(_.*)?)="(?P<value>.*)"$')
+ unset_re = re.compile(r'^unset (?P<var>\w+)$')
+ lastline = None
+ values = {}
+ for line in bbenv.splitlines():
+ match = var_re.match(line)
+ val = None
+ if match:
+ val = match.group('value')
+ else:
+ match = unset_re.match(line)
+ if match:
+ # Handle [unexport] variables
+ if lastline.startswith('# "'):
+ val = lastline.split('"')[1]
+ if val:
+ var = match.group('var')
+ if variables is None:
+ values[var] = val
+ else:
+ if var in variables:
+ values[var] = val
+ variables.remove(var)
+ # Stop after all required variables have been found
+ if not variables:
+ break
+ lastline = line
+ if variables:
+ # Fill in missing values
+ for var in variables:
+ values[var] = None
+ return values
+
+def get_bb_var(var, target=None, postconfig=None):
+ return get_bb_vars([var], target, postconfig)[var]
+
+def get_test_layer():
+ layers = get_bb_var("BBLAYERS").split()
+ testlayer = None
+ for l in layers:
+ if '~' in l:
+ l = os.path.expanduser(l)
+ if "/meta-selftest" in l and os.path.isdir(l):
+ testlayer = l
+ break
+ return testlayer
+
+def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'):
+ os.makedirs(os.path.join(templayerdir, 'conf'))
+ with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f:
+ f.write('BBPATH .= ":${LAYERDIR}"\n')
+ f.write('BBFILES += "${LAYERDIR}/%s/*.bb \\' % recipepathspec)
+ f.write(' ${LAYERDIR}/%s/*.bbappend"\n' % recipepathspec)
+ f.write('BBFILE_COLLECTIONS += "%s"\n' % templayername)
+ f.write('BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' % templayername)
+ f.write('BBFILE_PRIORITY_%s = "%d"\n' % (templayername, priority))
+ f.write('BBFILE_PATTERN_IGNORE_EMPTY_%s = "1"\n' % templayername)
+ f.write('LAYERSERIES_COMPAT_%s = "${LAYERSERIES_COMPAT_core}"\n' % templayername)
+
+@contextlib.contextmanager
+def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, discard_writes=True):
+ """
+ launch_cmd means directly run the command, don't need set rootfs or env vars.
+ """
+
+ import bb.tinfoil
+ import bb.build
+
+ # Need a non-'BitBake' logger to capture the runner output
+ targetlogger = logging.getLogger('TargetRunner')
+ targetlogger.setLevel(logging.DEBUG)
+ handler = logging.StreamHandler(sys.stdout)
+ targetlogger.addHandler(handler)
+
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(config_only=False, quiet=True)
+ try:
+ tinfoil.logger.setLevel(logging.WARNING)
+ import oeqa.targetcontrol
+ tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage")
+ tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000")
+ # Tell QemuTarget() whether need find rootfs/kernel or not
+ if launch_cmd:
+ tinfoil.config_data.setVar("FIND_ROOTFS", '0')
+ else:
+ tinfoil.config_data.setVar("FIND_ROOTFS", '1')
+
+ recipedata = tinfoil.parse_recipe(pn)
+ for key, value in overrides.items():
+ recipedata.setVar(key, value)
+
+ logdir = recipedata.getVar("TEST_LOG_DIR")
+
+ qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype)
+ finally:
+ # We need to shut down tinfoil early here in case we actually want
+ # to run tinfoil-using utilities with the running QEMU instance.
+ # Luckily QemuTarget doesn't need it after the constructor.
+ tinfoil.shutdown()
+
+ try:
+ qemu.deploy()
+ try:
+ qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
+ except bb.build.FuncFailed:
+ raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
+
+ yield qemu
+
+ finally:
+ try:
+ qemu.stop()
+ except:
+ pass
+ targetlogger.removeHandler(handler)
+
+def updateEnv(env_file):
+ """
+ Source a file and update environment.
+ """
+
+ cmd = ". %s; env -0" % env_file
+ result = runCmd(cmd)
+
+ for line in result.output.split("\0"):
+ (key, _, value) = line.partition("=")
+ os.environ[key] = value
diff --git a/poky/meta/lib/oeqa/utils/decorators.py b/poky/meta/lib/oeqa/utils/decorators.py
new file mode 100644
index 000000000..d87689692
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/decorators.py
@@ -0,0 +1,295 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Some custom decorators that can be used by unittests
+# Most useful is skipUnlessPassed which can be used for
+# creating dependecies between two test methods.
+
+import os
+import logging
+import sys
+import unittest
+import threading
+import signal
+from functools import wraps
+
+#get the "result" object from one of the upper frames provided that one of these upper frames is a unittest.case frame
+class getResults(object):
+ def __init__(self):
+ #dynamically determine the unittest.case frame and use it to get the name of the test method
+ ident = threading.current_thread().ident
+ upperf = sys._current_frames()[ident]
+ while (upperf.f_globals['__name__'] != 'unittest.case'):
+ upperf = upperf.f_back
+
+ def handleList(items):
+ ret = []
+ # items is a list of tuples, (test, failure) or (_ErrorHandler(), Exception())
+ for i in items:
+ s = i[0].id()
+ #Handle the _ErrorHolder objects from skipModule failures
+ if "setUpModule (" in s:
+ ret.append(s.replace("setUpModule (", "").replace(")",""))
+ else:
+ ret.append(s)
+ # Append also the test without the full path
+ testname = s.split('.')[-1]
+ if testname:
+ ret.append(testname)
+ return ret
+ self.faillist = handleList(upperf.f_locals['result'].failures)
+ self.errorlist = handleList(upperf.f_locals['result'].errors)
+ self.skiplist = handleList(upperf.f_locals['result'].skipped)
+
+ def getFailList(self):
+ return self.faillist
+
+ def getErrorList(self):
+ return self.errorlist
+
+ def getSkipList(self):
+ return self.skiplist
+
+class skipIfFailure(object):
+
+ def __init__(self,testcase):
+ self.testcase = testcase
+
+ def __call__(self,f):
+ @wraps(f)
+ def wrapped_f(*args, **kwargs):
+ res = getResults()
+ if self.testcase in (res.getFailList() or res.getErrorList()):
+ raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+ return f(*args, **kwargs)
+ wrapped_f.__name__ = f.__name__
+ return wrapped_f
+
+class skipIfSkipped(object):
+
+ def __init__(self,testcase):
+ self.testcase = testcase
+
+ def __call__(self,f):
+ @wraps(f)
+ def wrapped_f(*args, **kwargs):
+ res = getResults()
+ if self.testcase in res.getSkipList():
+ raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+ return f(*args, **kwargs)
+ wrapped_f.__name__ = f.__name__
+ return wrapped_f
+
+class skipUnlessPassed(object):
+
+ def __init__(self,testcase):
+ self.testcase = testcase
+
+ def __call__(self,f):
+ @wraps(f)
+ def wrapped_f(*args, **kwargs):
+ res = getResults()
+ if self.testcase in res.getSkipList() or \
+ self.testcase in res.getFailList() or \
+ self.testcase in res.getErrorList():
+ raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+ return f(*args, **kwargs)
+ wrapped_f.__name__ = f.__name__
+ wrapped_f._depends_on = self.testcase
+ return wrapped_f
+
+class testcase(object):
+ def __init__(self, test_case):
+ self.test_case = test_case
+
+ def __call__(self, func):
+ @wraps(func)
+ def wrapped_f(*args, **kwargs):
+ return func(*args, **kwargs)
+ wrapped_f.test_case = self.test_case
+ wrapped_f.__name__ = func.__name__
+ return wrapped_f
+
+class NoParsingFilter(logging.Filter):
+ def filter(self, record):
+ return record.levelno == 100
+
+import inspect
+
+def LogResults(original_class):
+ orig_method = original_class.run
+
+ from time import strftime, gmtime
+ caller = os.path.basename(sys.argv[0])
+ timestamp = strftime('%Y%m%d%H%M%S',gmtime())
+ logfile = os.path.join(os.getcwd(),'results-'+caller+'.'+timestamp+'.log')
+ linkfile = os.path.join(os.getcwd(),'results-'+caller+'.log')
+
+ def get_class_that_defined_method(meth):
+ if inspect.ismethod(meth):
+ for cls in inspect.getmro(meth.__self__.__class__):
+ if cls.__dict__.get(meth.__name__) is meth:
+ return cls
+ meth = meth.__func__ # fallback to __qualname__ parsing
+ if inspect.isfunction(meth):
+ cls = getattr(inspect.getmodule(meth),
+ meth.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0])
+ if isinstance(cls, type):
+ return cls
+ return None
+
+ #rewrite the run method of unittest.TestCase to add testcase logging
+ def run(self, result, *args, **kws):
+ orig_method(self, result, *args, **kws)
+ passed = True
+ testMethod = getattr(self, self._testMethodName)
+ #if test case is decorated then use it's number, else use it's name
+ try:
+ test_case = testMethod.test_case
+ except AttributeError:
+ test_case = self._testMethodName
+
+ class_name = str(get_class_that_defined_method(testMethod)).split("'")[1]
+
+ #create custom logging level for filtering.
+ custom_log_level = 100
+ logging.addLevelName(custom_log_level, 'RESULTS')
+
+ def results(self, message, *args, **kws):
+ if self.isEnabledFor(custom_log_level):
+ self.log(custom_log_level, message, *args, **kws)
+ logging.Logger.results = results
+
+ logging.basicConfig(filename=logfile,
+ filemode='w',
+ format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
+ datefmt='%H:%M:%S',
+ level=custom_log_level)
+ for handler in logging.root.handlers:
+ handler.addFilter(NoParsingFilter())
+ local_log = logging.getLogger(caller)
+
+ #check status of tests and record it
+
+ tcid = self.id()
+ for (name, msg) in result.errors:
+ if tcid == name.id():
+ local_log.results("Testcase "+str(test_case)+": ERROR")
+ local_log.results("Testcase "+str(test_case)+":\n"+msg)
+ passed = False
+ for (name, msg) in result.failures:
+ if tcid == name.id():
+ local_log.results("Testcase "+str(test_case)+": FAILED")
+ local_log.results("Testcase "+str(test_case)+":\n"+msg)
+ passed = False
+ for (name, msg) in result.skipped:
+ if tcid == name.id():
+ local_log.results("Testcase "+str(test_case)+": SKIPPED")
+ passed = False
+ if passed:
+ local_log.results("Testcase "+str(test_case)+": PASSED")
+
+ # XXX: In order to avoid race condition when test if exists the linkfile
+ # use bb.utils.lock, the best solution is to create a unique name for the
+ # link file.
+ try:
+ import bb
+ has_bb = True
+ lockfilename = linkfile + '.lock'
+ except ImportError:
+ has_bb = False
+
+ if has_bb:
+ lf = bb.utils.lockfile(lockfilename, block=True)
+ # Create symlink to the current log
+ if os.path.lexists(linkfile):
+ os.remove(linkfile)
+ os.symlink(logfile, linkfile)
+ if has_bb:
+ bb.utils.unlockfile(lf)
+
+ original_class.run = run
+
+ return original_class
+
+class TimeOut(BaseException):
+ pass
+
+def timeout(seconds):
+ def decorator(fn):
+ if hasattr(signal, 'alarm'):
+ @wraps(fn)
+ def wrapped_f(*args, **kw):
+ current_frame = sys._getframe()
+ def raiseTimeOut(signal, frame):
+ if frame is not current_frame:
+ raise TimeOut('%s seconds' % seconds)
+ prev_handler = signal.signal(signal.SIGALRM, raiseTimeOut)
+ try:
+ signal.alarm(seconds)
+ return fn(*args, **kw)
+ finally:
+ signal.alarm(0)
+ signal.signal(signal.SIGALRM, prev_handler)
+ return wrapped_f
+ else:
+ return fn
+ return decorator
+
+__tag_prefix = "tag__"
+def tag(*args, **kwargs):
+ """Decorator that adds attributes to classes or functions
+ for use with the Attribute (-a) plugin.
+ """
+ def wrap_ob(ob):
+ for name in args:
+ setattr(ob, __tag_prefix + name, True)
+ for name, value in kwargs.items():
+ setattr(ob, __tag_prefix + name, value)
+ return ob
+ return wrap_ob
+
+def gettag(obj, key, default=None):
+ key = __tag_prefix + key
+ if not isinstance(obj, unittest.TestCase):
+ return getattr(obj, key, default)
+ tc_method = getattr(obj, obj._testMethodName)
+ ret = getattr(tc_method, key, getattr(obj, key, default))
+ return ret
+
+def getAllTags(obj):
+ def __gettags(o):
+ r = {k[len(__tag_prefix):]:getattr(o,k) for k in dir(o) if k.startswith(__tag_prefix)}
+ return r
+ if not isinstance(obj, unittest.TestCase):
+ return __gettags(obj)
+ tc_method = getattr(obj, obj._testMethodName)
+ ret = __gettags(obj)
+ ret.update(__gettags(tc_method))
+ return ret
+
+def timeout_handler(seconds):
+ def decorator(fn):
+ if hasattr(signal, 'alarm'):
+ @wraps(fn)
+ def wrapped_f(self, *args, **kw):
+ current_frame = sys._getframe()
+ def raiseTimeOut(signal, frame):
+ if frame is not current_frame:
+ try:
+ self.target.restart()
+ raise TimeOut('%s seconds' % seconds)
+ except:
+ raise TimeOut('%s seconds' % seconds)
+ prev_handler = signal.signal(signal.SIGALRM, raiseTimeOut)
+ try:
+ signal.alarm(seconds)
+ return fn(self, *args, **kw)
+ finally:
+ signal.alarm(0)
+ signal.signal(signal.SIGALRM, prev_handler)
+ return wrapped_f
+ else:
+ return fn
+ return decorator
diff --git a/poky/meta/lib/oeqa/utils/dump.py b/poky/meta/lib/oeqa/utils/dump.py
new file mode 100644
index 000000000..5a7edc1a8
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/dump.py
@@ -0,0 +1,91 @@
+import os
+import sys
+import errno
+import datetime
+import itertools
+from .commands import runCmd
+
+class BaseDumper(object):
+ """ Base class to dump commands from host/target """
+
+ def __init__(self, cmds, parent_dir):
+ self.cmds = []
+ # Some testing doesn't inherit testimage, so it is needed
+ # to set some defaults.
+ self.parent_dir = parent_dir or "/tmp/oe-saved-tests"
+ dft_cmds = """ top -bn1
+ iostat -x -z -N -d -p ALL 20 2
+ ps -ef
+ free
+ df
+ memstat
+ dmesg
+ ip -s link
+ netstat -an"""
+ if not cmds:
+ cmds = dft_cmds
+ for cmd in cmds.split('\n'):
+ cmd = cmd.lstrip()
+ if not cmd or cmd[0] == '#':
+ continue
+ self.cmds.append(cmd)
+
+ def create_dir(self, dir_suffix):
+ dump_subdir = ("%s_%s" % (
+ datetime.datetime.now().strftime('%Y%m%d%H%M'),
+ dir_suffix))
+ dump_dir = os.path.join(self.parent_dir, dump_subdir)
+ try:
+ os.makedirs(dump_dir)
+ except OSError as err:
+ if err.errno != errno.EEXIST:
+ raise err
+ self.dump_dir = dump_dir
+
+ def _write_dump(self, command, output):
+ if isinstance(self, HostDumper):
+ prefix = "host"
+ elif isinstance(self, TargetDumper):
+ prefix = "target"
+ else:
+ prefix = "unknown"
+ for i in itertools.count():
+ filename = "%s_%02d_%s" % (prefix, i, command)
+ fullname = os.path.join(self.dump_dir, filename)
+ if not os.path.exists(fullname):
+ break
+ with open(fullname, 'w') as dump_file:
+ dump_file.write(output)
+
+
+class HostDumper(BaseDumper):
+ """ Class to get dumps from the host running the tests """
+
+ def __init__(self, cmds, parent_dir):
+ super(HostDumper, self).__init__(cmds, parent_dir)
+
+ def dump_host(self, dump_dir=""):
+ if dump_dir:
+ self.dump_dir = dump_dir
+ for cmd in self.cmds:
+ result = runCmd(cmd, ignore_status=True)
+ self._write_dump(cmd.split()[0], result.output)
+
+class TargetDumper(BaseDumper):
+ """ Class to get dumps from target, it only works with QemuRunner """
+
+ def __init__(self, cmds, parent_dir, runner):
+ super(TargetDumper, self).__init__(cmds, parent_dir)
+ self.runner = runner
+
+ def dump_target(self, dump_dir=""):
+ if dump_dir:
+ self.dump_dir = dump_dir
+ for cmd in self.cmds:
+ # We can continue with the testing if serial commands fail
+ try:
+ (status, output) = self.runner.run_serial(cmd)
+ self._write_dump(cmd.split()[0], output)
+ except:
+ print("Tried to dump info from target but "
+ "serial console failed")
diff --git a/poky/meta/lib/oeqa/utils/ftools.py b/poky/meta/lib/oeqa/utils/ftools.py
new file mode 100644
index 000000000..a7233d4ca
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/ftools.py
@@ -0,0 +1,46 @@
+import os
+import re
+import errno
+
+def write_file(path, data):
+ # In case data is None, return immediately
+ if data is None:
+ return
+ wdata = data.rstrip() + "\n"
+ with open(path, "w") as f:
+ f.write(wdata)
+
+def append_file(path, data):
+ # In case data is None, return immediately
+ if data is None:
+ return
+ wdata = data.rstrip() + "\n"
+ with open(path, "a") as f:
+ f.write(wdata)
+
+def read_file(path):
+ data = None
+ with open(path) as f:
+ data = f.read()
+ return data
+
+def remove_from_file(path, data):
+ # In case data is None, return immediately
+ if data is None:
+ return
+ try:
+ rdata = read_file(path)
+ except IOError as e:
+ # if file does not exit, just quit, otherwise raise an exception
+ if e.errno == errno.ENOENT:
+ return
+ else:
+ raise
+
+ contents = rdata.strip().splitlines()
+ for r in data.strip().splitlines():
+ try:
+ contents.remove(r)
+ except ValueError:
+ pass
+ write_file(path, "\n".join(contents))
diff --git a/poky/meta/lib/oeqa/utils/git.py b/poky/meta/lib/oeqa/utils/git.py
new file mode 100644
index 000000000..757e3f0cb
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/git.py
@@ -0,0 +1,80 @@
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+"""Git repository interactions"""
+import os
+
+from oeqa.utils.commands import runCmd
+
+
+class GitError(Exception):
+ """Git error handling"""
+ pass
+
+class GitRepo(object):
+ """Class representing a Git repository clone"""
+ def __init__(self, path, is_topdir=False):
+ git_dir = self._run_git_cmd_at(['rev-parse', '--git-dir'], path)
+ git_dir = git_dir if os.path.isabs(git_dir) else os.path.join(path, git_dir)
+ self.git_dir = os.path.realpath(git_dir)
+
+ if self._run_git_cmd_at(['rev-parse', '--is-bare-repository'], path) == 'true':
+ self.bare = True
+ self.top_dir = self.git_dir
+ else:
+ self.bare = False
+ self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'],
+ path)
+ realpath = os.path.realpath(path)
+ if is_topdir and realpath != self.top_dir:
+ raise GitError("{} is not a Git top directory".format(realpath))
+
+ @staticmethod
+ def _run_git_cmd_at(git_args, cwd, **kwargs):
+ """Run git command at a specified directory"""
+ git_cmd = 'git ' if isinstance(git_args, str) else ['git']
+ git_cmd += git_args
+ ret = runCmd(git_cmd, ignore_status=True, cwd=cwd, **kwargs)
+ if ret.status:
+ cmd_str = git_cmd if isinstance(git_cmd, str) \
+ else ' '.join(git_cmd)
+ raise GitError("'{}' failed with exit code {}: {}".format(
+ cmd_str, ret.status, ret.output))
+ return ret.output.strip()
+
+ @staticmethod
+ def init(path, bare=False):
+ """Initialize a new Git repository"""
+ cmd = ['init']
+ if bare:
+ cmd.append('--bare')
+ GitRepo._run_git_cmd_at(cmd, cwd=path)
+ return GitRepo(path, is_topdir=True)
+
+ def run_cmd(self, git_args, env_update=None):
+ """Run Git command"""
+ env = None
+ if env_update:
+ env = os.environ.copy()
+ env.update(env_update)
+ return self._run_git_cmd_at(git_args, self.top_dir, env=env)
+
+ def rev_parse(self, revision):
+ """Do git rev-parse"""
+ try:
+ return self.run_cmd(['rev-parse', '--verify', revision])
+ except GitError:
+ # Revision does not exist
+ return None
+
+ def get_current_branch(self):
+ """Get current branch"""
+ try:
+ # Strip 11 chars, i.e. 'refs/heads' from the beginning
+ return self.run_cmd(['symbolic-ref', 'HEAD'])[11:]
+ except GitError:
+ return None
+
+
diff --git a/poky/meta/lib/oeqa/utils/httpserver.py b/poky/meta/lib/oeqa/utils/httpserver.py
new file mode 100644
index 000000000..7d1233145
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/httpserver.py
@@ -0,0 +1,36 @@
+import http.server
+import multiprocessing
+import os
+from socketserver import ThreadingMixIn
+
+class HTTPServer(ThreadingMixIn, http.server.HTTPServer):
+
+ def server_start(self, root_dir):
+ import signal
+ signal.signal(signal.SIGTERM, signal.SIG_DFL)
+ os.chdir(root_dir)
+ self.serve_forever()
+
+class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
+
+ def log_message(self, format_str, *args):
+ pass
+
+class HTTPService(object):
+
+ def __init__(self, root_dir, host=''):
+ self.root_dir = root_dir
+ self.host = host
+ self.port = 0
+
+ def start(self):
+ self.server = HTTPServer((self.host, self.port), HTTPRequestHandler)
+ if self.port == 0:
+ self.port = self.server.server_port
+ self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir])
+ self.process.start()
+
+ def stop(self):
+ self.server.server_close()
+ self.process.terminate()
+ self.process.join()
diff --git a/poky/meta/lib/oeqa/utils/logparser.py b/poky/meta/lib/oeqa/utils/logparser.py
new file mode 100644
index 000000000..0670627c3
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/logparser.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import re
+from . import ftools
+
+
+# A parser that can be used to identify weather a line is a test result or a section statement.
+class Lparser(object):
+
+ def __init__(self, test_0_pass_regex, test_0_fail_regex, test_0_skip_regex, section_0_begin_regex=None, section_0_end_regex=None, **kwargs):
+ # Initialize the arguments dictionary
+ if kwargs:
+ self.args = kwargs
+ else:
+ self.args = {}
+
+ # Add the default args to the dictionary
+ self.args['test_0_pass_regex'] = test_0_pass_regex
+ self.args['test_0_fail_regex'] = test_0_fail_regex
+ self.args['test_0_skip_regex'] = test_0_skip_regex
+ if section_0_begin_regex:
+ self.args['section_0_begin_regex'] = section_0_begin_regex
+ if section_0_end_regex:
+ self.args['section_0_end_regex'] = section_0_end_regex
+
+ self.test_possible_status = ['pass', 'fail', 'error', 'skip']
+ self.section_possible_status = ['begin', 'end']
+
+ self.initialized = False
+
+
+ # Initialize the parser with the current configuration
+ def init(self):
+
+ # extra arguments can be added by the user to define new test and section categories. They must follow a pre-defined pattern: <type>_<category_name>_<status>_regex
+ self.test_argument_pattern = "^test_(.+?)_(%s)_regex" % '|'.join(map(str, self.test_possible_status))
+ self.section_argument_pattern = "^section_(.+?)_(%s)_regex" % '|'.join(map(str, self.section_possible_status))
+
+ # Initialize the test and section regex dictionaries
+ self.test_regex = {}
+ self.section_regex ={}
+
+ for arg, value in self.args.items():
+ if not value:
+ raise Exception('The value of provided argument %s is %s. Should have a valid value.' % (key, value))
+ is_test = re.search(self.test_argument_pattern, arg)
+ is_section = re.search(self.section_argument_pattern, arg)
+ if is_test:
+ if not is_test.group(1) in self.test_regex:
+ self.test_regex[is_test.group(1)] = {}
+ self.test_regex[is_test.group(1)][is_test.group(2)] = re.compile(value)
+ elif is_section:
+ if not is_section.group(1) in self.section_regex:
+ self.section_regex[is_section.group(1)] = {}
+ self.section_regex[is_section.group(1)][is_section.group(2)] = re.compile(value)
+ else:
+ # TODO: Make these call a traceback instead of a simple exception..
+ raise Exception("The provided argument name does not correspond to any valid type. Please give one of the following types:\nfor tests: %s\nfor sections: %s" % (self.test_argument_pattern, self.section_argument_pattern))
+
+ self.initialized = True
+
+ # Parse a line and return a tuple containing the type of result (test/section) and its category, status and name
+ def parse_line(self, line):
+ if not self.initialized:
+ raise Exception("The parser is not initialized..")
+
+ for test_category, test_status_list in self.test_regex.items():
+ for test_status, status_regex in test_status_list.items():
+ test_name = status_regex.search(line)
+ if test_name:
+ return ['test', test_category, test_status, test_name.group(1)]
+
+ for section_category, section_status_list in self.section_regex.items():
+ for section_status, status_regex in section_status_list.items():
+ section_name = status_regex.search(line)
+ if section_name:
+ return ['section', section_category, section_status, section_name.group(1)]
+ return None
+
+
+class Result(object):
+
+ def __init__(self):
+ self.result_dict = {}
+
+ def store(self, section, test, status):
+ if not section in self.result_dict:
+ self.result_dict[section] = []
+
+ self.result_dict[section].append((test, status))
+
+ # sort tests by the test name(the first element of the tuple), for each section. This can be helpful when using git to diff for changes by making sure they are always in the same order.
+ def sort_tests(self):
+ for package in self.result_dict:
+ sorted_results = sorted(self.result_dict[package], key=lambda tup: tup[0])
+ self.result_dict[package] = sorted_results
+
+ # Log the results as files. The file name is the section name and the contents are the tests in that section.
+ def log_as_files(self, target_dir, test_status):
+ status_regex = re.compile('|'.join(map(str, test_status)))
+ if not type(test_status) == type([]):
+ raise Exception("test_status should be a list. Got " + str(test_status) + " instead.")
+ if not os.path.exists(target_dir):
+ raise Exception("Target directory does not exist: %s" % target_dir)
+
+ for section, test_results in self.result_dict.items():
+ prefix = ''
+ for x in test_status:
+ prefix +=x+'.'
+ if section:
+ prefix += section
+ section_file = os.path.join(target_dir, prefix)
+ # purge the file contents if it exists
+ open(section_file, 'w').close()
+ for test_result in test_results:
+ (test_name, status) = test_result
+ # we log only the tests with status in the test_status list
+ match_status = status_regex.search(status)
+ if match_status:
+ ftools.append_file(section_file, status + ": " + test_name)
+
+ # Not yet implemented!
+ def log_to_lava(self):
+ pass
diff --git a/poky/meta/lib/oeqa/utils/metadata.py b/poky/meta/lib/oeqa/utils/metadata.py
new file mode 100644
index 000000000..65bbdc61f
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/metadata.py
@@ -0,0 +1,108 @@
+# Copyright (C) 2016 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+# Functions to get metadata from the testing host used
+# for analytics of test results.
+
+from collections import OrderedDict
+from collections.abc import MutableMapping
+from xml.dom.minidom import parseString
+from xml.etree.ElementTree import Element, tostring
+
+from oe.lsb import get_os_release
+from oeqa.utils.commands import runCmd, get_bb_vars
+
+
+def metadata_from_bb():
+ """ Returns test's metadata as OrderedDict.
+
+ Data will be gathered using bitbake -e thanks to get_bb_vars.
+ """
+ metadata_config_vars = ('MACHINE', 'BB_NUMBER_THREADS', 'PARALLEL_MAKE')
+
+ info_dict = OrderedDict()
+ hostname = runCmd('hostname')
+ info_dict['hostname'] = hostname.output
+ data_dict = get_bb_vars()
+
+ # Distro information
+ info_dict['distro'] = {'id': data_dict['DISTRO'],
+ 'version_id': data_dict['DISTRO_VERSION'],
+ 'pretty_name': '%s %s' % (data_dict['DISTRO'], data_dict['DISTRO_VERSION'])}
+
+ # Host distro information
+ os_release = get_os_release()
+ if os_release:
+ info_dict['host_distro'] = OrderedDict()
+ for key in ('ID', 'VERSION_ID', 'PRETTY_NAME'):
+ if key in os_release:
+ info_dict['host_distro'][key.lower()] = os_release[key]
+
+ info_dict['layers'] = get_layers(data_dict['BBLAYERS'])
+ info_dict['bitbake'] = git_rev_info(os.path.dirname(bb.__file__))
+
+ info_dict['config'] = OrderedDict()
+ for var in sorted(metadata_config_vars):
+ info_dict['config'][var] = data_dict[var]
+ return info_dict
+
+def metadata_from_data_store(d):
+ """ Returns test's metadata as OrderedDict.
+
+ Data will be collected from the provided data store.
+ """
+ # TODO: Getting metadata from the data store would
+ # be useful when running within bitbake.
+ pass
+
+def git_rev_info(path):
+ """Get git revision information as a dict"""
+ from git import Repo, InvalidGitRepositoryError, NoSuchPathError
+
+ info = OrderedDict()
+ try:
+ repo = Repo(path, search_parent_directories=True)
+ except (InvalidGitRepositoryError, NoSuchPathError):
+ return info
+ info['commit'] = repo.head.commit.hexsha
+ info['commit_count'] = repo.head.commit.count()
+ try:
+ info['branch'] = repo.active_branch.name
+ except TypeError:
+ info['branch'] = '(nobranch)'
+ return info
+
+def get_layers(layers):
+ """Returns layer information in dict format"""
+ layer_dict = OrderedDict()
+ for layer in layers.split():
+ layer_name = os.path.basename(layer)
+ layer_dict[layer_name] = git_rev_info(layer)
+ return layer_dict
+
+def write_metadata_file(file_path, metadata):
+ """ Writes metadata to a XML file in directory. """
+
+ xml = dict_to_XML('metadata', metadata)
+ xml_doc = parseString(tostring(xml).decode('UTF-8'))
+ with open(file_path, 'w') as f:
+ f.write(xml_doc.toprettyxml())
+
+def dict_to_XML(tag, dictionary, **kwargs):
+ """ Return XML element converting dicts recursively. """
+
+ elem = Element(tag, **kwargs)
+ for key, val in dictionary.items():
+ if tag == 'layers':
+ child = (dict_to_XML('layer', val, name=key))
+ elif isinstance(val, MutableMapping):
+ child = (dict_to_XML(key, val))
+ else:
+ if tag == 'config':
+ child = Element('variable', name=key)
+ else:
+ child = Element(key)
+ child.text = str(val)
+ elem.append(child)
+ return elem
diff --git a/poky/meta/lib/oeqa/utils/network.py b/poky/meta/lib/oeqa/utils/network.py
new file mode 100644
index 000000000..2768f6c5d
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/network.py
@@ -0,0 +1,8 @@
+import socket
+
+def get_free_port():
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.bind(('', 0))
+ addr = s.getsockname()
+ s.close()
+ return addr[1]
diff --git a/poky/meta/lib/oeqa/utils/package_manager.py b/poky/meta/lib/oeqa/utils/package_manager.py
new file mode 100644
index 000000000..afd5b8e75
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/package_manager.py
@@ -0,0 +1,211 @@
+import os
+import json
+import shutil
+
+from oeqa.core.utils.test import getCaseFile, getCaseMethod
+
+def get_package_manager(d, root_path):
+ """
+ Returns an OE package manager that can install packages in root_path.
+ """
+ from oe.package_manager import RpmPM, OpkgPM, DpkgPM
+
+ pkg_class = d.getVar("IMAGE_PKGTYPE")
+ if pkg_class == "rpm":
+ pm = RpmPM(d,
+ root_path,
+ d.getVar('TARGET_VENDOR'),
+ filterbydependencies=False)
+ pm.create_configs()
+
+ elif pkg_class == "ipk":
+ pm = OpkgPM(d,
+ root_path,
+ d.getVar("IPKGCONF_TARGET"),
+ d.getVar("ALL_MULTILIB_PACKAGE_ARCHS"))
+
+ elif pkg_class == "deb":
+ pm = DpkgPM(d,
+ root_path,
+ d.getVar('PACKAGE_ARCHS'),
+ d.getVar('DPKG_ARCH'))
+
+ pm.write_index()
+ pm.update()
+
+ return pm
+
+def find_packages_to_extract(test_suite):
+ """
+ Returns packages to extract required by runtime tests.
+ """
+ from oeqa.core.utils.test import getSuiteCasesFiles
+
+ needed_packages = {}
+ files = getSuiteCasesFiles(test_suite)
+
+ for f in set(files):
+ json_file = _get_json_file(f)
+ if json_file:
+ needed_packages.update(_get_needed_packages(json_file))
+
+ return needed_packages
+
+def _get_json_file(module_path):
+ """
+ Returns the path of the JSON file for a module, empty if doesn't exitst.
+ """
+
+ json_file = '%s.json' % module_path.rsplit('.', 1)[0]
+ if os.path.isfile(module_path) and os.path.isfile(json_file):
+ return json_file
+ else:
+ return ''
+
+def _get_needed_packages(json_file, test=None):
+ """
+ Returns a dict with needed packages based on a JSON file.
+
+ If a test is specified it will return the dict just for that test.
+ """
+ needed_packages = {}
+
+ with open(json_file) as f:
+ test_packages = json.load(f)
+ for key,value in test_packages.items():
+ needed_packages[key] = value
+
+ if test:
+ if test in needed_packages:
+ needed_packages = needed_packages[test]
+ else:
+ needed_packages = {}
+
+ return needed_packages
+
+def extract_packages(d, needed_packages):
+ """
+ Extract packages that will be needed during runtime.
+ """
+
+ import bb
+ import oe.path
+
+ extracted_path = d.getVar('TEST_EXTRACTED_DIR')
+
+ for key,value in needed_packages.items():
+ packages = ()
+ if isinstance(value, dict):
+ packages = (value, )
+ elif isinstance(value, list):
+ packages = value
+ else:
+ bb.fatal('Failed to process needed packages for %s; '
+ 'Value must be a dict or list' % key)
+
+ for package in packages:
+ pkg = package['pkg']
+ rm = package.get('rm', False)
+ extract = package.get('extract', True)
+
+ if extract:
+ #logger.debug(1, 'Extracting %s' % pkg)
+ dst_dir = os.path.join(extracted_path, pkg)
+ # Same package used for more than one test,
+ # don't need to extract again.
+ if os.path.exists(dst_dir):
+ continue
+
+ # Extract package and copy it to TEST_EXTRACTED_DIR
+ pkg_dir = _extract_in_tmpdir(d, pkg)
+ oe.path.copytree(pkg_dir, dst_dir)
+ shutil.rmtree(pkg_dir)
+
+ else:
+ #logger.debug(1, 'Copying %s' % pkg)
+ _copy_package(d, pkg)
+
+def _extract_in_tmpdir(d, pkg):
+ """"
+ Returns path to a temp directory where the package was
+ extracted without dependencies.
+ """
+
+ from oeqa.utils.package_manager import get_package_manager
+
+ pkg_path = os.path.join(d.getVar('TEST_INSTALL_TMP_DIR'), pkg)
+ pm = get_package_manager(d, pkg_path)
+ extract_dir = pm.extract(pkg)
+ shutil.rmtree(pkg_path)
+
+ return extract_dir
+
+def _copy_package(d, pkg):
+ """
+ Copy the RPM, DEB or IPK package to dst_dir
+ """
+
+ from oeqa.utils.package_manager import get_package_manager
+
+ pkg_path = os.path.join(d.getVar('TEST_INSTALL_TMP_DIR'), pkg)
+ dst_dir = d.getVar('TEST_PACKAGED_DIR')
+ pm = get_package_manager(d, pkg_path)
+ pkg_info = pm.package_info(pkg)
+ file_path = pkg_info[pkg]['filepath']
+ shutil.copy2(file_path, dst_dir)
+ shutil.rmtree(pkg_path)
+
+def install_package(test_case):
+ """
+ Installs package in DUT if required.
+ """
+ needed_packages = test_needs_package(test_case)
+ if needed_packages:
+ _install_uninstall_packages(needed_packages, test_case, True)
+
+def uninstall_package(test_case):
+ """
+ Uninstalls package in DUT if required.
+ """
+ needed_packages = test_needs_package(test_case)
+ if needed_packages:
+ _install_uninstall_packages(needed_packages, test_case, False)
+
+def test_needs_package(test_case):
+ """
+ Checks if a test case requires to install/uninstall packages.
+ """
+ test_file = getCaseFile(test_case)
+ json_file = _get_json_file(test_file)
+
+ if json_file:
+ test_method = getCaseMethod(test_case)
+ needed_packages = _get_needed_packages(json_file, test_method)
+ if needed_packages:
+ return needed_packages
+
+ return None
+
+def _install_uninstall_packages(needed_packages, test_case, install=True):
+ """
+ Install/Uninstall packages in the DUT without using a package manager
+ """
+
+ if isinstance(needed_packages, dict):
+ packages = [needed_packages]
+ elif isinstance(needed_packages, list):
+ packages = needed_packages
+
+ for package in packages:
+ pkg = package['pkg']
+ rm = package.get('rm', False)
+ extract = package.get('extract', True)
+ src_dir = os.path.join(test_case.tc.extract_dir, pkg)
+
+ # Install package
+ if install and extract:
+ test_case.tc.target.copyDirTo(src_dir, '/')
+
+ # Uninstall package
+ elif not install and rm:
+ test_case.tc.target.deleteDirStructure(src_dir, '/')
diff --git a/poky/meta/lib/oeqa/utils/qemurunner.py b/poky/meta/lib/oeqa/utils/qemurunner.py
new file mode 100644
index 000000000..c962602a6
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/qemurunner.py
@@ -0,0 +1,591 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module provides a class for starting qemu images using runqemu.
+# It's used by testimage.bbclass.
+
+import subprocess
+import os
+import sys
+import time
+import signal
+import re
+import socket
+import select
+import errno
+import string
+import threading
+import codecs
+import logging
+from oeqa.utils.dump import HostDumper
+
+# Get Unicode non printable control chars
+control_range = list(range(0,32))+list(range(127,160))
+control_chars = [chr(x) for x in control_range
+ if chr(x) not in string.printable]
+re_control_char = re.compile('[%s]' % re.escape("".join(control_chars)))
+
+class QemuRunner:
+
+ def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds, use_kvm, logger):
+
+ # Popen object for runqemu
+ self.runqemu = None
+ # pid of the qemu process that runqemu will start
+ self.qemupid = None
+ # target ip - from the command line or runqemu output
+ self.ip = None
+ # host ip - where qemu is running
+ self.server_ip = None
+ # target ip netmask
+ self.netmask = None
+
+ self.machine = machine
+ self.rootfs = rootfs
+ self.display = display
+ self.tmpdir = tmpdir
+ self.deploy_dir_image = deploy_dir_image
+ self.logfile = logfile
+ self.boottime = boottime
+ self.logged = False
+ self.thread = None
+ self.use_kvm = use_kvm
+ self.msg = ''
+
+ self.runqemutime = 120
+ self.qemu_pidfile = 'pidfile_'+str(os.getpid())
+ self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
+
+ self.logger = logger
+
+ def create_socket(self):
+ try:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.setblocking(0)
+ sock.bind(("127.0.0.1",0))
+ sock.listen(2)
+ port = sock.getsockname()[1]
+ self.logger.debug("Created listening socket for qemu serial console on: 127.0.0.1:%s" % port)
+ return (sock, port)
+
+ except socket.error:
+ sock.close()
+ raise
+
+ def log(self, msg):
+ if self.logfile:
+ # It is needed to sanitize the data received from qemu
+ # because is possible to have control characters
+ msg = msg.decode("utf-8", errors='ignore')
+ msg = re_control_char.sub('', msg)
+ self.msg += msg
+ with codecs.open(self.logfile, "a", encoding="utf-8") as f:
+ f.write("%s" % msg)
+
+ def getOutput(self, o):
+ import fcntl
+ fl = fcntl.fcntl(o, fcntl.F_GETFL)
+ fcntl.fcntl(o, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+ return os.read(o.fileno(), 1000000).decode("utf-8")
+
+
+ def handleSIGCHLD(self, signum, frame):
+ if self.runqemu and self.runqemu.poll():
+ if self.runqemu.returncode:
+ self.logger.debug('runqemu exited with code %d' % self.runqemu.returncode)
+ self.logger.debug("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
+ self.stop()
+ self._dump_host()
+ raise SystemExit
+
+ def start(self, qemuparams = None, get_ip = True, extra_bootparams = None, runqemuparams='', launch_cmd=None, discard_writes=True):
+ env = os.environ.copy()
+ if self.display:
+ env["DISPLAY"] = self.display
+ # Set this flag so that Qemu doesn't do any grabs as SDL grabs
+ # interact badly with screensavers.
+ env["QEMU_DONT_GRAB"] = "1"
+ if not os.path.exists(self.rootfs):
+ self.logger.error("Invalid rootfs %s" % self.rootfs)
+ return False
+ if not os.path.exists(self.tmpdir):
+ self.logger.error("Invalid TMPDIR path %s" % self.tmpdir)
+ return False
+ else:
+ env["OE_TMPDIR"] = self.tmpdir
+ if not os.path.exists(self.deploy_dir_image):
+ self.logger.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image)
+ return False
+ else:
+ env["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
+
+ if not launch_cmd:
+ launch_cmd = 'runqemu %s %s ' % ('snapshot' if discard_writes else '', runqemuparams)
+ if self.use_kvm:
+ self.logger.debug('Using kvm for runqemu')
+ launch_cmd += ' kvm'
+ else:
+ self.logger.debug('Not using kvm for runqemu')
+ if not self.display:
+ launch_cmd += ' nographic'
+ launch_cmd += ' %s %s' % (self.machine, self.rootfs)
+
+ return self.launch(launch_cmd, qemuparams=qemuparams, get_ip=get_ip, extra_bootparams=extra_bootparams, env=env)
+
+ def launch(self, launch_cmd, get_ip = True, qemuparams = None, extra_bootparams = None, env = None):
+ try:
+ threadsock, threadport = self.create_socket()
+ self.server_socket, self.serverport = self.create_socket()
+ except socket.error as msg:
+ self.logger.error("Failed to create listening socket: %s" % msg[1])
+ return False
+
+ bootparams = 'console=tty1 console=ttyS0,115200n8 printk.time=1'
+ if extra_bootparams:
+ bootparams = bootparams + ' ' + extra_bootparams
+
+ # Ask QEMU to store the QEMU process PID in file, this way we don't have to parse running processes
+ # and analyze descendents in order to determine it.
+ if os.path.exists(self.qemu_pidfile):
+ os.remove(self.qemu_pidfile)
+ self.qemuparams = 'bootparams="{0}" qemuparams="-serial tcp:127.0.0.1:{1} -pidfile {2}"'.format(bootparams, threadport, self.qemu_pidfile)
+ if qemuparams:
+ self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
+
+ launch_cmd += ' tcpserial=%s %s' % (self.serverport, self.qemuparams)
+
+ self.origchldhandler = signal.getsignal(signal.SIGCHLD)
+ signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
+
+ self.logger.debug('launchcmd=%s'%(launch_cmd))
+
+ # FIXME: We pass in stdin=subprocess.PIPE here to work around stty
+ # blocking at the end of the runqemu script when using this within
+ # oe-selftest (this makes stty error out immediately). There ought
+ # to be a proper fix but this will suffice for now.
+ self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp, env=env)
+ output = self.runqemu.stdout
+
+ #
+ # We need the preexec_fn above so that all runqemu processes can easily be killed
+ # (by killing their process group). This presents a problem if this controlling
+ # process itself is killed however since those processes don't notice the death
+ # of the parent and merrily continue on.
+ #
+ # Rather than hack runqemu to deal with this, we add something here instead.
+ # Basically we fork off another process which holds an open pipe to the parent
+ # and also is setpgrp. If/when the pipe sees EOF from the parent dieing, it kills
+ # the process group. This is like pctrl's PDEATHSIG but for a process group
+ # rather than a single process.
+ #
+ r, w = os.pipe()
+ self.monitorpid = os.fork()
+ if self.monitorpid:
+ os.close(r)
+ self.monitorpipe = os.fdopen(w, "w")
+ else:
+ # child process
+ os.setpgrp()
+ os.close(w)
+ r = os.fdopen(r)
+ x = r.read()
+ os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
+ sys.exit(0)
+
+ self.logger.debug("runqemu started, pid is %s" % self.runqemu.pid)
+ self.logger.debug("waiting at most %s seconds for qemu pid (%s)" %
+ (self.runqemutime, time.strftime("%D %H:%M:%S")))
+ endtime = time.time() + self.runqemutime
+ while not self.is_alive() and time.time() < endtime:
+ if self.runqemu.poll():
+ if self.runqemu.returncode:
+ # No point waiting any longer
+ self.logger.debug('runqemu exited with code %d' % self.runqemu.returncode)
+ self._dump_host()
+ self.stop()
+ self.logger.debug("Output from runqemu:\n%s" % self.getOutput(output))
+ return False
+ time.sleep(0.5)
+
+ if not self.is_alive():
+ self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
+ (self.runqemutime, time.strftime("%D %H:%M:%S")))
+ # Dump all processes to help us to figure out what is going on...
+ ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command '], stdout=subprocess.PIPE).communicate()[0]
+ processes = ps.decode("utf-8")
+ self.logger.debug("Running processes:\n%s" % processes)
+ self._dump_host()
+ self.stop()
+ op = self.getOutput(output)
+ if op:
+ self.logger.error("Output from runqemu:\n%s" % op)
+ else:
+ self.logger.error("No output from runqemu.\n")
+ return False
+
+ # We are alive: qemu is running
+ out = self.getOutput(output)
+ netconf = False # network configuration is not required by default
+ self.logger.debug("qemu started in %s seconds - qemu procces pid is %s (%s)" %
+ (time.time() - (endtime - self.runqemutime),
+ self.qemupid, time.strftime("%D %H:%M:%S")))
+ if get_ip:
+ cmdline = ''
+ with open('/proc/%s/cmdline' % self.qemupid) as p:
+ cmdline = p.read()
+ # It is needed to sanitize the data received
+ # because is possible to have control characters
+ cmdline = re_control_char.sub(' ', cmdline)
+ try:
+ ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
+ self.ip = ips[0]
+ self.server_ip = ips[1]
+ self.logger.debug("qemu cmdline used:\n{}".format(cmdline))
+ except (IndexError, ValueError):
+ # Try to get network configuration from runqemu output
+ match = re.match('.*Network configuration: ([0-9.]+)::([0-9.]+):([0-9.]+)$.*',
+ out, re.MULTILINE|re.DOTALL)
+ if match:
+ self.ip, self.server_ip, self.netmask = match.groups()
+ # network configuration is required as we couldn't get it
+ # from the runqemu command line, so qemu doesn't run kernel
+ # and guest networking is not configured
+ netconf = True
+ else:
+ self.logger.error("Couldn't get ip from qemu command line and runqemu output! "
+ "Here is the qemu command line used:\n%s\n"
+ "and output from runqemu:\n%s" % (cmdline, out))
+ self._dump_host()
+ self.stop()
+ return False
+
+ self.logger.debug("Target IP: %s" % self.ip)
+ self.logger.debug("Server IP: %s" % self.server_ip)
+
+ self.thread = LoggingThread(self.log, threadsock, self.logger)
+ self.thread.start()
+ if not self.thread.connection_established.wait(self.boottime):
+ self.logger.error("Didn't receive a console connection from qemu. "
+ "Here is the qemu command line used:\n%s\nand "
+ "output from runqemu:\n%s" % (cmdline, out))
+ self.stop_thread()
+ return False
+
+ self.logger.debug("Output from runqemu:\n%s", out)
+ self.logger.debug("Waiting at most %d seconds for login banner (%s)" %
+ (self.boottime, time.strftime("%D %H:%M:%S")))
+ endtime = time.time() + self.boottime
+ socklist = [self.server_socket]
+ reachedlogin = False
+ stopread = False
+ qemusock = None
+ bootlog = b''
+ data = b''
+ while time.time() < endtime and not stopread:
+ try:
+ sread, swrite, serror = select.select(socklist, [], [], 5)
+ except InterruptedError:
+ continue
+ for sock in sread:
+ if sock is self.server_socket:
+ qemusock, addr = self.server_socket.accept()
+ qemusock.setblocking(0)
+ socklist.append(qemusock)
+ socklist.remove(self.server_socket)
+ self.logger.debug("Connection from %s:%s" % addr)
+ else:
+ data = data + sock.recv(1024)
+ if data:
+ bootlog += data
+ data = b''
+ if b' login:' in bootlog:
+ self.server_socket = qemusock
+ stopread = True
+ reachedlogin = True
+ self.logger.debug("Reached login banner in %s seconds (%s)" %
+ (time.time() - (endtime - self.boottime),
+ time.strftime("%D %H:%M:%S")))
+ else:
+ # no need to check if reachedlogin unless we support multiple connections
+ self.logger.debug("QEMU socket disconnected before login banner reached. (%s)" %
+ time.strftime("%D %H:%M:%S"))
+ socklist.remove(sock)
+ sock.close()
+ stopread = True
+
+
+ if not reachedlogin:
+ if time.time() >= endtime:
+ self.logger.debug("Target didn't reach login banner in %d seconds (%s)" %
+ (self.boottime, time.strftime("%D %H:%M:%S")))
+ tail = lambda l: "\n".join(l.splitlines()[-25:])
+ # in case bootlog is empty, use tail qemu log store at self.msg
+ lines = tail(bootlog if bootlog else self.msg)
+ self.logger.debug("Last 25 lines of text:\n%s" % lines)
+ self.logger.debug("Check full boot log: %s" % self.logfile)
+ self._dump_host()
+ self.stop()
+ return False
+
+ # If we are not able to login the tests can continue
+ try:
+ (status, output) = self.run_serial("root\n", raw=True)
+ if re.search("root@[a-zA-Z0-9\-]+:~#", output):
+ self.logged = True
+ self.logger.debug("Logged as root in serial console")
+ if netconf:
+ # configure guest networking
+ cmd = "ifconfig eth0 %s netmask %s up\n" % (self.ip, self.netmask)
+ output = self.run_serial(cmd, raw=True)[1]
+ if re.search("root@[a-zA-Z0-9\-]+:~#", output):
+ self.logger.debug("configured ip address %s", self.ip)
+ else:
+ self.logger.debug("Couldn't configure guest networking")
+ else:
+ self.logger.debug("Couldn't login into serial console"
+ " as root using blank password")
+ except:
+ self.logger.debug("Serial console failed while trying to login")
+ return True
+
+ def stop(self):
+ self.stop_thread()
+ self.stop_qemu_system()
+ if hasattr(self, "origchldhandler"):
+ signal.signal(signal.SIGCHLD, self.origchldhandler)
+ if self.runqemu:
+ if hasattr(self, "monitorpid"):
+ os.kill(self.monitorpid, signal.SIGKILL)
+ self.logger.debug("Sending SIGTERM to runqemu")
+ try:
+ os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
+ except OSError as e:
+ if e.errno != errno.ESRCH:
+ raise
+ endtime = time.time() + self.runqemutime
+ while self.runqemu.poll() is None and time.time() < endtime:
+ time.sleep(1)
+ if self.runqemu.poll() is None:
+ self.logger.debug("Sending SIGKILL to runqemu")
+ os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL)
+ self.runqemu = None
+ if hasattr(self, 'server_socket') and self.server_socket:
+ self.server_socket.close()
+ self.server_socket = None
+ self.qemupid = None
+ self.ip = None
+ if os.path.exists(self.qemu_pidfile):
+ os.remove(self.qemu_pidfile)
+
+ def stop_qemu_system(self):
+ if self.qemupid:
+ try:
+ # qemu-system behaves well and a SIGTERM is enough
+ os.kill(self.qemupid, signal.SIGTERM)
+ except ProcessLookupError as e:
+ self.logger.warn('qemu-system ended unexpectedly')
+
+ def stop_thread(self):
+ if self.thread and self.thread.is_alive():
+ self.thread.stop()
+ self.thread.join()
+
+ def restart(self, qemuparams = None):
+ self.logger.debug("Restarting qemu process")
+ if self.runqemu.poll() is None:
+ self.stop()
+ if self.start(qemuparams):
+ return True
+ return False
+
+ def is_alive(self):
+ if not self.runqemu:
+ return False
+ if os.path.isfile(self.qemu_pidfile):
+ f = open(self.qemu_pidfile, 'r')
+ qemu_pid = f.read()
+ f.close()
+ qemupid = int(qemu_pid)
+ if os.path.exists("/proc/" + str(qemupid)):
+ self.qemupid = qemupid
+ return True
+ return False
+
+ def run_serial(self, command, raw=False, timeout=5):
+ # We assume target system have echo to get command status
+ if not raw:
+ command = "%s; echo $?\n" % command
+
+ data = ''
+ status = 0
+ self.server_socket.sendall(command.encode('utf-8'))
+ start = time.time()
+ end = start + timeout
+ while True:
+ now = time.time()
+ if now >= end:
+ data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
+ break
+ try:
+ sread, _, _ = select.select([self.server_socket],[],[], end - now)
+ except InterruptedError:
+ continue
+ if sread:
+ answer = self.server_socket.recv(1024)
+ if answer:
+ data += answer.decode('utf-8')
+ # Search the prompt to stop
+ if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
+ break
+ else:
+ raise Exception("No data on serial console socket")
+
+ if data:
+ if raw:
+ status = 1
+ else:
+ # Remove first line (command line) and last line (prompt)
+ data = data[data.find('$?\r\n')+4:data.rfind('\r\n')]
+ index = data.rfind('\r\n')
+ if index == -1:
+ status_cmd = data
+ data = ""
+ else:
+ status_cmd = data[index+2:]
+ data = data[:index]
+ if (status_cmd == "0"):
+ status = 1
+ return (status, str(data))
+
+
+ def _dump_host(self):
+ self.host_dumper.create_dir("qemu")
+ self.logger.warn("Qemu ended unexpectedly, dump data from host"
+ " is in %s" % self.host_dumper.dump_dir)
+ self.host_dumper.dump_host()
+
+# This class is for reading data from a socket and passing it to logfunc
+# to be processed. It's completely event driven and has a straightforward
+# event loop. The mechanism for stopping the thread is a simple pipe which
+# will wake up the poll and allow for tearing everything down.
+class LoggingThread(threading.Thread):
+ def __init__(self, logfunc, sock, logger):
+ self.connection_established = threading.Event()
+ self.serversock = sock
+ self.logfunc = logfunc
+ self.logger = logger
+ self.readsock = None
+ self.running = False
+
+ self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL
+ self.readevents = select.POLLIN | select.POLLPRI
+
+ threading.Thread.__init__(self, target=self.threadtarget)
+
+ def threadtarget(self):
+ try:
+ self.eventloop()
+ finally:
+ self.teardown()
+
+ def run(self):
+ self.logger.debug("Starting logging thread")
+ self.readpipe, self.writepipe = os.pipe()
+ threading.Thread.run(self)
+
+ def stop(self):
+ self.logger.debug("Stopping logging thread")
+ if self.running:
+ os.write(self.writepipe, bytes("stop", "utf-8"))
+
+ def teardown(self):
+ self.logger.debug("Tearing down logging thread")
+ self.close_socket(self.serversock)
+
+ if self.readsock is not None:
+ self.close_socket(self.readsock)
+
+ self.close_ignore_error(self.readpipe)
+ self.close_ignore_error(self.writepipe)
+ self.running = False
+
+ def eventloop(self):
+ poll = select.poll()
+ event_read_mask = self.errorevents | self.readevents
+ poll.register(self.serversock.fileno())
+ poll.register(self.readpipe, event_read_mask)
+
+ breakout = False
+ self.running = True
+ self.logger.debug("Starting thread event loop")
+ while not breakout:
+ events = poll.poll()
+ for event in events:
+ # An error occurred, bail out
+ if event[1] & self.errorevents:
+ raise Exception(self.stringify_event(event[1]))
+
+ # Event to stop the thread
+ if self.readpipe == event[0]:
+ self.logger.debug("Stop event received")
+ breakout = True
+ break
+
+ # A connection request was received
+ elif self.serversock.fileno() == event[0]:
+ self.logger.debug("Connection request received")
+ self.readsock, _ = self.serversock.accept()
+ self.readsock.setblocking(0)
+ poll.unregister(self.serversock.fileno())
+ poll.register(self.readsock.fileno(), event_read_mask)
+
+ self.logger.debug("Setting connection established event")
+ self.connection_established.set()
+
+ # Actual data to be logged
+ elif self.readsock.fileno() == event[0]:
+ data = self.recv(1024)
+ self.logfunc(data)
+
+ # Since the socket is non-blocking make sure to honor EAGAIN
+ # and EWOULDBLOCK.
+ def recv(self, count):
+ try:
+ data = self.readsock.recv(count)
+ except socket.error as e:
+ if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
+ return ''
+ else:
+ raise
+
+ if data is None:
+ raise Exception("No data on read ready socket")
+ elif not data:
+ # This actually means an orderly shutdown
+ # happened. But for this code it counts as an
+ # error since the connection shouldn't go away
+ # until qemu exits.
+ raise Exception("Console connection closed unexpectedly")
+
+ return data
+
+ def stringify_event(self, event):
+ val = ''
+ if select.POLLERR == event:
+ val = 'POLLER'
+ elif select.POLLHUP == event:
+ val = 'POLLHUP'
+ elif select.POLLNVAL == event:
+ val = 'POLLNVAL'
+ return val
+
+ def close_socket(self, sock):
+ sock.shutdown(socket.SHUT_RDWR)
+ sock.close()
+
+ def close_ignore_error(self, fd):
+ try:
+ os.close(fd)
+ except OSError:
+ pass
diff --git a/poky/meta/lib/oeqa/utils/qemutinyrunner.py b/poky/meta/lib/oeqa/utils/qemutinyrunner.py
new file mode 100644
index 000000000..63b5d1648
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -0,0 +1,176 @@
+# Copyright (C) 2015 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module provides a class for starting qemu images of poky tiny.
+# It's used by testimage.bbclass.
+
+import subprocess
+import os
+import time
+import signal
+import re
+import socket
+import select
+import bb
+from .qemurunner import QemuRunner
+
+class QemuTinyRunner(QemuRunner):
+
+ def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, kernel, boottime, logger):
+
+ # Popen object for runqemu
+ self.runqemu = None
+ # pid of the qemu process that runqemu will start
+ self.qemupid = None
+ # target ip - from the command line
+ self.ip = None
+ # host ip - where qemu is running
+ self.server_ip = None
+
+ self.machine = machine
+ self.rootfs = rootfs
+ self.display = display
+ self.tmpdir = tmpdir
+ self.deploy_dir_image = deploy_dir_image
+ self.logfile = logfile
+ self.boottime = boottime
+
+ self.runqemutime = 60
+ self.socketfile = "console.sock"
+ self.server_socket = None
+ self.kernel = kernel
+ self.logger = logger
+
+
+ def create_socket(self):
+ tries = 3
+ while tries > 0:
+ try:
+ self.server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ self.server_socket.connect(self.socketfile)
+ bb.note("Created listening socket for qemu serial console.")
+ tries = 0
+ except socket.error as msg:
+ self.server_socket.close()
+ bb.fatal("Failed to create listening socket.")
+ tries -= 1
+
+ def log(self, msg):
+ if self.logfile:
+ with open(self.logfile, "a") as f:
+ f.write("%s" % msg)
+
+ def start(self, qemuparams = None, ssh=True, extra_bootparams=None, runqemuparams='', discard_writes=True):
+
+ if self.display:
+ os.environ["DISPLAY"] = self.display
+ else:
+ bb.error("To start qemu I need a X desktop, please set DISPLAY correctly (e.g. DISPLAY=:1)")
+ return False
+ if not os.path.exists(self.rootfs):
+ bb.error("Invalid rootfs %s" % self.rootfs)
+ return False
+ if not os.path.exists(self.tmpdir):
+ bb.error("Invalid TMPDIR path %s" % self.tmpdir)
+ return False
+ else:
+ os.environ["OE_TMPDIR"] = self.tmpdir
+ if not os.path.exists(self.deploy_dir_image):
+ bb.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image)
+ return False
+ else:
+ os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
+
+ # Set this flag so that Qemu doesn't do any grabs as SDL grabs interact
+ # badly with screensavers.
+ os.environ["QEMU_DONT_GRAB"] = "1"
+ self.qemuparams = '--append "root=/dev/ram0 console=ttyS0" -nographic -serial unix:%s,server,nowait' % self.socketfile
+
+ launch_cmd = 'qemu-system-i386 -kernel %s -initrd %s %s' % (self.kernel, self.rootfs, self.qemuparams)
+ self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp)
+
+ bb.note("runqemu started, pid is %s" % self.runqemu.pid)
+ bb.note("waiting at most %s seconds for qemu pid" % self.runqemutime)
+ endtime = time.time() + self.runqemutime
+ while not self.is_alive() and time.time() < endtime:
+ time.sleep(1)
+
+ if self.is_alive():
+ bb.note("qemu started - qemu procces pid is %s" % self.qemupid)
+ self.create_socket()
+ else:
+ bb.note("Qemu pid didn't appeared in %s seconds" % self.runqemutime)
+ output = self.runqemu.stdout
+ self.stop()
+ bb.note("Output from runqemu:\n%s" % output.read().decode("utf-8"))
+ return False
+
+ return self.is_alive()
+
+ def run_serial(self, command, timeout=5):
+ self.server_socket.sendall(command+'\n')
+ data = ''
+ status = 0
+ stopread = False
+ endtime = time.time()+timeout
+ while time.time()<endtime and not stopread:
+ try:
+ sread, _, _ = select.select([self.server_socket],[],[],1)
+ except InterruptedError:
+ continue
+ for sock in sread:
+ answer = sock.recv(1024)
+ if answer:
+ data += answer
+ else:
+ sock.close()
+ stopread = True
+ if not data:
+ status = 1
+ if not stopread:
+ data += "<<< run_serial(): command timed out after %d seconds without output >>>\r\n\r\n" % timeout
+ return (status, str(data))
+
+ def find_child(self,parent_pid):
+ #
+ # Walk the process tree from the process specified looking for a qemu-system. Return its [pid'cmd]
+ #
+ ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command'], stdout=subprocess.PIPE).communicate()[0]
+ processes = ps.decode("utf-8").split('\n')
+ nfields = len(processes[0].split()) - 1
+ pids = {}
+ commands = {}
+ for row in processes[1:]:
+ data = row.split(None, nfields)
+ if len(data) != 3:
+ continue
+ if data[1] not in pids:
+ pids[data[1]] = []
+
+ pids[data[1]].append(data[0])
+ commands[data[0]] = data[2]
+
+ if parent_pid not in pids:
+ return []
+
+ parents = []
+ newparents = pids[parent_pid]
+ while newparents:
+ next = []
+ for p in newparents:
+ if p in pids:
+ for n in pids[p]:
+ if n not in parents and n not in next:
+ next.append(n)
+ if p not in parents:
+ parents.append(p)
+ newparents = next
+ #print("Children matching %s:" % str(parents))
+ for p in parents:
+ # Need to be careful here since runqemu runs "ldd qemu-system-xxxx"
+ # Also, old versions of ldd (2.11) run "LD_XXXX qemu-system-xxxx"
+ basecmd = commands[p].split()[0]
+ basecmd = os.path.basename(basecmd)
+ if "qemu-system" in basecmd and "-serial unix" in commands[p]:
+ return [int(p),commands[p]]
diff --git a/poky/meta/lib/oeqa/utils/sshcontrol.py b/poky/meta/lib/oeqa/utils/sshcontrol.py
new file mode 100644
index 000000000..d292893c0
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/sshcontrol.py
@@ -0,0 +1,242 @@
+# -*- coding: utf-8 -*-
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for setting up ssh connections,
+# running commands and copying files to/from a target.
+# It's used by testimage.bbclass and tests in lib/oeqa/runtime.
+
+import subprocess
+import time
+import os
+import select
+
+
+class SSHProcess(object):
+ def __init__(self, **options):
+
+ self.defaultopts = {
+ "stdout": subprocess.PIPE,
+ "stderr": subprocess.STDOUT,
+ "stdin": None,
+ "shell": False,
+ "bufsize": -1,
+ "preexec_fn": os.setsid,
+ }
+ self.options = dict(self.defaultopts)
+ self.options.update(options)
+ self.status = None
+ self.output = None
+ self.process = None
+ self.starttime = None
+ self.logfile = None
+
+ # Unset DISPLAY which means we won't trigger SSH_ASKPASS
+ env = os.environ.copy()
+ if "DISPLAY" in env:
+ del env['DISPLAY']
+ self.options['env'] = env
+
+ def log(self, msg):
+ if self.logfile:
+ with open(self.logfile, "a") as f:
+ f.write("%s" % msg)
+
+ def _run(self, command, timeout=None, logfile=None):
+ self.logfile = logfile
+ self.starttime = time.time()
+ output = ''
+ self.process = subprocess.Popen(command, **self.options)
+ if timeout:
+ endtime = self.starttime + timeout
+ eof = False
+ while time.time() < endtime and not eof:
+ try:
+ if select.select([self.process.stdout], [], [], 5)[0] != []:
+ data = os.read(self.process.stdout.fileno(), 1024)
+ if not data:
+ self.process.stdout.close()
+ eof = True
+ else:
+ data = data.decode("utf-8")
+ output += data
+ self.log(data)
+ endtime = time.time() + timeout
+ except InterruptedError:
+ continue
+
+ # process hasn't returned yet
+ if not eof:
+ self.process.terminate()
+ time.sleep(5)
+ try:
+ self.process.kill()
+ except OSError:
+ pass
+ lastline = "\nProcess killed - no output for %d seconds. Total running time: %d seconds." % (timeout, time.time() - self.starttime)
+ self.log(lastline)
+ output += lastline
+ else:
+ output = self.process.communicate()[0]
+ self.log(output.rstrip())
+
+ self.status = self.process.wait()
+ self.output = output.rstrip()
+
+ def run(self, command, timeout=None, logfile=None):
+ try:
+ self._run(command, timeout, logfile)
+ except:
+ # Need to guard against a SystemExit or other exception occuring whilst running
+ # and ensure we don't leave a process behind.
+ if self.process.poll() is None:
+ self.process.kill()
+ self.status = self.process.wait()
+ raise
+ return (self.status, self.output)
+
+class SSHControl(object):
+ def __init__(self, ip, logfile=None, timeout=300, user='root', port=None):
+ self.ip = ip
+ self.defaulttimeout = timeout
+ self.ignore_status = True
+ self.logfile = logfile
+ self.user = user
+ self.ssh_options = [
+ '-o', 'UserKnownHostsFile=/dev/null',
+ '-o', 'StrictHostKeyChecking=no',
+ '-o', 'LogLevel=ERROR'
+ ]
+ self.ssh = ['ssh', '-l', self.user ] + self.ssh_options
+ self.scp = ['scp'] + self.ssh_options
+ if port:
+ self.ssh = self.ssh + [ '-p', port ]
+ self.scp = self.scp + [ '-P', port ]
+
+ def log(self, msg):
+ if self.logfile:
+ with open(self.logfile, "a") as f:
+ f.write("%s\n" % msg)
+
+ def _internal_run(self, command, timeout=None, ignore_status = True):
+ self.log("[Running]$ %s" % " ".join(command))
+
+ proc = SSHProcess()
+ status, output = proc.run(command, timeout, logfile=self.logfile)
+
+ self.log("[Command returned '%d' after %.2f seconds]" % (status, time.time() - proc.starttime))
+
+ if status and not ignore_status:
+ raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, status, output))
+
+ return (status, output)
+
+ def run(self, command, timeout=None):
+ """
+ command - ssh command to run
+ timeout=<val> - kill command if there is no output after <val> seconds
+ timeout=None - kill command if there is no output after a default value seconds
+ timeout=0 - no timeout, let command run until it returns
+ """
+
+ command = self.ssh + [self.ip, 'export PATH=/usr/sbin:/sbin:/usr/bin:/bin; ' + command]
+
+ if timeout is None:
+ return self._internal_run(command, self.defaulttimeout, self.ignore_status)
+ if timeout == 0:
+ return self._internal_run(command, None, self.ignore_status)
+ return self._internal_run(command, timeout, self.ignore_status)
+
+ def copy_to(self, localpath, remotepath):
+ if os.path.islink(localpath):
+ localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath)
+ command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
+ return self._internal_run(command, ignore_status=False)
+
+ def copy_from(self, remotepath, localpath):
+ command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]
+ return self._internal_run(command, ignore_status=False)
+
+ def copy_dir_to(self, localpath, remotepath):
+ """
+ Copy recursively localpath directory to remotepath in target.
+ """
+
+ for root, dirs, files in os.walk(localpath):
+ # Create directories in the target as needed
+ for d in dirs:
+ tmp_dir = os.path.join(root, d).replace(localpath, "")
+ new_dir = os.path.join(remotepath, tmp_dir.lstrip("/"))
+ cmd = "mkdir -p %s" % new_dir
+ self.run(cmd)
+
+ # Copy files into the target
+ for f in files:
+ tmp_file = os.path.join(root, f).replace(localpath, "")
+ dst_file = os.path.join(remotepath, tmp_file.lstrip("/"))
+ src_file = os.path.join(root, f)
+ self.copy_to(src_file, dst_file)
+
+
+ def delete_files(self, remotepath, files):
+ """
+ Delete files in target's remote path.
+ """
+
+ cmd = "rm"
+ if not isinstance(files, list):
+ files = [files]
+
+ for f in files:
+ cmd = "%s %s" % (cmd, os.path.join(remotepath, f))
+
+ self.run(cmd)
+
+
+ def delete_dir(self, remotepath):
+ """
+ Delete remotepath directory in target.
+ """
+
+ cmd = "rmdir %s" % remotepath
+ self.run(cmd)
+
+
+ def delete_dir_structure(self, localpath, remotepath):
+ """
+ Delete recursively localpath structure directory in target's remotepath.
+
+ This function is very usefult to delete a package that is installed in
+ the DUT and the host running the test has such package extracted in tmp
+ directory.
+
+ Example:
+ pwd: /home/user/tmp
+ tree: .
+ └── work
+ ├── dir1
+ │   └── file1
+ └── dir2
+
+ localpath = "/home/user/tmp" and remotepath = "/home/user"
+
+ With the above variables this function will try to delete the
+ directory in the DUT in this order:
+ /home/user/work/dir1/file1
+ /home/user/work/dir1 (if dir is empty)
+ /home/user/work/dir2 (if dir is empty)
+ /home/user/work (if dir is empty)
+ """
+
+ for root, dirs, files in os.walk(localpath, topdown=False):
+ # Delete files first
+ tmpdir = os.path.join(root).replace(localpath, "")
+ remotedir = os.path.join(remotepath, tmpdir.lstrip("/"))
+ self.delete_files(remotedir, files)
+
+ # Remove dirs if empty
+ for d in dirs:
+ tmpdir = os.path.join(root, d).replace(localpath, "")
+ remotedir = os.path.join(remotepath, tmpdir.lstrip("/"))
+ self.delete_dir(remotepath)
diff --git a/poky/meta/lib/oeqa/utils/subprocesstweak.py b/poky/meta/lib/oeqa/utils/subprocesstweak.py
new file mode 100644
index 000000000..1f7d11b55
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/subprocesstweak.py
@@ -0,0 +1,19 @@
+import subprocess
+
+class OETestCalledProcessError(subprocess.CalledProcessError):
+ def __str__(self):
+ def strify(o):
+ if isinstance(o, bytes):
+ return o.decode("utf-8", errors="replace")
+ else:
+ return o
+
+ s = "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
+ if hasattr(self, "output") and self.output:
+ s = s + "\nStandard Output: " + strify(self.output)
+ if hasattr(self, "stderr") and self.stderr:
+ s = s + "\nStandard Error: " + strify(self.stderr)
+ return s
+
+def errors_have_output():
+ subprocess.CalledProcessError = OETestCalledProcessError
diff --git a/poky/meta/lib/oeqa/utils/targetbuild.py b/poky/meta/lib/oeqa/utils/targetbuild.py
new file mode 100644
index 000000000..1202d579f
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/targetbuild.py
@@ -0,0 +1,139 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for automating build tests for projects
+
+import os
+import re
+import bb.utils
+import subprocess
+import tempfile
+from abc import ABCMeta, abstractmethod
+
+class BuildProject(metaclass=ABCMeta):
+
+ def __init__(self, d, uri, foldername=None, tmpdir=None):
+ self.d = d
+ self.uri = uri
+ self.archive = os.path.basename(uri)
+ if not tmpdir:
+ tmpdir = self.d.getVar('WORKDIR')
+ if not tmpdir:
+ tmpdir = tempfile.mkdtemp(prefix='buildproject')
+ self.localarchive = os.path.join(tmpdir,self.archive)
+ if foldername:
+ self.fname = foldername
+ else:
+ self.fname = re.sub(r'\.tar\.bz2$|\.tar\.gz$|\.tar\.xz$', '', self.archive)
+
+ # Download self.archive to self.localarchive
+ def _download_archive(self):
+ dl_dir = self.d.getVar("DL_DIR")
+ if dl_dir and os.path.exists(os.path.join(dl_dir, self.archive)):
+ bb.utils.copyfile(os.path.join(dl_dir, self.archive), self.localarchive)
+ return
+
+ exportvars = ['HTTP_PROXY', 'http_proxy',
+ 'HTTPS_PROXY', 'https_proxy',
+ 'FTP_PROXY', 'ftp_proxy',
+ 'FTPS_PROXY', 'ftps_proxy',
+ 'NO_PROXY', 'no_proxy',
+ 'ALL_PROXY', 'all_proxy',
+ 'SOCKS5_USER', 'SOCKS5_PASSWD']
+
+ cmd = ''
+ for var in exportvars:
+ val = self.d.getVar(var)
+ if val:
+ cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+
+ cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri)
+ subprocess.check_output(cmd, shell=True)
+
+ # This method should provide a way to run a command in the desired environment.
+ @abstractmethod
+ def _run(self, cmd):
+ pass
+
+ # The timeout parameter of target.run is set to 0 to make the ssh command
+ # run with no timeout.
+ def run_configure(self, configure_args='', extra_cmds=''):
+ return self._run('cd %s; %s ./configure %s' % (self.targetdir, extra_cmds, configure_args))
+
+ def run_make(self, make_args=''):
+ return self._run('cd %s; make %s' % (self.targetdir, make_args))
+
+ def run_install(self, install_args=''):
+ return self._run('cd %s; make install %s' % (self.targetdir, install_args))
+
+ def clean(self):
+ self._run('rm -rf %s' % self.targetdir)
+ subprocess.check_call('rm -f %s' % self.localarchive, shell=True)
+ pass
+
+class TargetBuildProject(BuildProject):
+
+ def __init__(self, target, d, uri, foldername=None):
+ self.target = target
+ self.targetdir = "~/"
+ BuildProject.__init__(self, d, uri, foldername)
+
+ def download_archive(self):
+
+ self._download_archive()
+
+ (status, output) = self.target.copy_to(self.localarchive, self.targetdir)
+ if status != 0:
+ raise Exception("Failed to copy archive to target, output: %s" % output)
+
+ (status, output) = self.target.run('tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir))
+ if status != 0:
+ raise Exception("Failed to extract archive, output: %s" % output)
+
+ #Change targetdir to project folder
+ self.targetdir = self.targetdir + self.fname
+
+ # The timeout parameter of target.run is set to 0 to make the ssh command
+ # run with no timeout.
+ def _run(self, cmd):
+ return self.target.run(cmd, 0)[0]
+
+
+class SDKBuildProject(BuildProject):
+
+ def __init__(self, testpath, sdkenv, d, uri, foldername=None):
+ self.sdkenv = sdkenv
+ self.testdir = testpath
+ self.targetdir = testpath
+ bb.utils.mkdirhier(testpath)
+ self.datetime = d.getVar('DATETIME')
+ self.testlogdir = d.getVar("TEST_LOG_DIR")
+ bb.utils.mkdirhier(self.testlogdir)
+ self.logfile = os.path.join(self.testlogdir, "sdk_target_log.%s" % self.datetime)
+ BuildProject.__init__(self, d, uri, foldername, tmpdir=testpath)
+
+ def download_archive(self):
+
+ self._download_archive()
+
+ cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
+ subprocess.check_output(cmd, shell=True)
+
+ #Change targetdir to project folder
+ self.targetdir = os.path.join(self.targetdir, self.fname)
+
+ def run_configure(self, configure_args='', extra_cmds=' gnu-configize; '):
+ return super(SDKBuildProject, self).run_configure(configure_args=(configure_args or '$CONFIGURE_FLAGS'), extra_cmds=extra_cmds)
+
+ def run_install(self, install_args=''):
+ return super(SDKBuildProject, self).run_install(install_args=(install_args or "DESTDIR=%s/../install" % self.targetdir))
+
+ def log(self, msg):
+ if self.logfile:
+ with open(self.logfile, "a") as f:
+ f.write("%s\n" % msg)
+
+ def _run(self, cmd):
+ self.log("Running . %s; " % self.sdkenv + cmd)
+ return subprocess.check_call(". %s; " % self.sdkenv + cmd, shell=True)
diff --git a/poky/meta/lib/oeqa/utils/testexport.py b/poky/meta/lib/oeqa/utils/testexport.py
new file mode 100644
index 000000000..be2a2110f
--- /dev/null
+++ b/poky/meta/lib/oeqa/utils/testexport.py
@@ -0,0 +1,263 @@
+# Copyright (C) 2015 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides functions to help with exporting binaries obtained from built targets
+
+import os, re, glob as g, shutil as sh,sys
+from time import sleep
+from .commands import runCmd
+from difflib import SequenceMatcher as SM
+
+try:
+ import bb
+except ImportError:
+ class my_log():
+ def __init__(self):
+ pass
+ def plain(self, msg):
+ if msg:
+ print(msg)
+ def warn(self, msg):
+ if msg:
+ print("WARNING: " + msg)
+ def fatal(self, msg):
+ if msg:
+ print("FATAL:" + msg)
+ sys.exit(1)
+ bb = my_log()
+
+
+def determine_if_poky_env():
+ """
+ used to determine if we are inside the poky env or not. Usefull for remote machine where poky is not present
+ """
+ check_env = True if ("/scripts" and "/bitbake/bin") in os.getenv("PATH") else False
+ return check_env
+
+
+def get_dest_folder(tune_features, folder_list):
+ """
+ Function to determine what rpm deploy dir to choose for a given architecture based on TUNE_FEATURES
+ """
+ features_list = tune_features.split(" ")
+ features_list.reverse()
+ features_list = "_".join(features_list)
+ match_rate = 0
+ best_match = None
+ for folder in folder_list:
+ curr_match_rate = SM(None, folder, features_list).ratio()
+ if curr_match_rate > match_rate:
+ match_rate = curr_match_rate
+ best_match = folder
+ return best_match
+
+
+def process_binaries(d, params):
+ param_list = params
+ export_env = d.getVar("TEST_EXPORT_ONLY")
+
+ def extract_binary(pth_to_pkg, dest_pth=None):
+ cpio_command = runCmd("which cpio")
+ rpm2cpio_command = runCmd("ls /usr/bin/rpm2cpio")
+ if (cpio_command.status != 0) and (rpm2cpio_command.status != 0):
+ bb.fatal("Either \"rpm2cpio\" or \"cpio\" tools are not available on your system."
+ "All binaries extraction processes will not be available, crashing all related tests."
+ "Please install them according to your OS recommendations") # will exit here
+ if dest_pth:
+ os.chdir(dest_pth)
+ else:
+ os.chdir("%s" % os.sep)# this is for native package
+ extract_bin_command = runCmd("%s %s | %s -idm" % (rpm2cpio_command.output, pth_to_pkg, cpio_command.output)) # semi-hardcoded because of a bug on poky's rpm2cpio
+ return extract_bin_command
+
+ if determine_if_poky_env(): # machine with poky environment
+ exportpath = d.getVar("TEST_EXPORT_DIR") if export_env else d.getVar("DEPLOY_DIR")
+ rpm_deploy_dir = d.getVar("DEPLOY_DIR_RPM")
+ arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(rpm_deploy_dir))
+ arch_rpm_dir = os.path.join(rpm_deploy_dir, arch)
+ extracted_bin_dir = os.path.join(exportpath,"binaries", arch, "extracted_binaries")
+ packaged_bin_dir = os.path.join(exportpath,"binaries", arch, "packaged_binaries")
+ # creating necessary directory structure in case testing is done in poky env.
+ if export_env == "0":
+ if not os.path.exists(extracted_bin_dir): bb.utils.mkdirhier(extracted_bin_dir)
+ if not os.path.exists(packaged_bin_dir): bb.utils.mkdirhier(packaged_bin_dir)
+
+ if param_list[3] == "native":
+ if export_env == "1": #this is a native package and we only need to copy it. no need for extraction
+ native_rpm_dir = os.path.join(rpm_deploy_dir, get_dest_folder("{} nativesdk".format(d.getVar("BUILD_SYS")), os.listdir(rpm_deploy_dir)))
+ native_rpm_file_list = [item for item in os.listdir(native_rpm_dir) if re.search("nativesdk-" + param_list[0] + "-([0-9]+\.*)", item)]
+ if not native_rpm_file_list:
+ bb.warn("Couldn't find any version of {} native package. Related tests will most probably fail.".format(param_list[0]))
+ return ""
+ for item in native_rpm_file_list:# will copy all versions of package. Used version will be selected on remote machine
+ bb.plain("Copying native package file: %s" % item)
+ sh.copy(os.path.join(rpm_deploy_dir, native_rpm_dir, item), os.path.join(d.getVar("TEST_EXPORT_DIR"), "binaries", "native"))
+ else: # nothing to do here; running tests under bitbake, so we asume native binaries are in sysroots dir.
+ if param_list[1] or param_list[4]:
+ bb.warn("Native binary %s %s%s. Running tests under bitbake environment. Version can't be checked except when the test itself does it"
+ " and binary can't be removed."%(param_list[0],"has assigned ver. " + param_list[1] if param_list[1] else "",
+ ", is marked for removal" if param_list[4] else ""))
+ else:# the package is target aka DUT intended and it is either required to be delivered in an extracted form or in a packaged version
+ target_rpm_file_list = [item for item in os.listdir(arch_rpm_dir) if re.search(param_list[0] + "-([0-9]+\.*)", item)]
+ if not target_rpm_file_list:
+ bb.warn("Couldn't find any version of target package %s. Please ensure it was built. "
+ "Related tests will probably fail." % param_list[0])
+ return ""
+ if param_list[2] == "rpm": # binary should be deployed as rpm; (other, .deb, .ipk? ; in the near future)
+ for item in target_rpm_file_list: # copying all related rpm packages. "Intuition" reasons, someone may need other versions too. Deciding later on version
+ bb.plain("Copying target specific packaged file: %s" % item)
+ sh.copy(os.path.join(arch_rpm_dir, item), packaged_bin_dir)
+ return "copied"
+ else: # it is required to extract the binary
+ if param_list[1]: # the package is versioned
+ for item in target_rpm_file_list:
+ if re.match(".*-{}-.*\.rpm".format(param_list[1]), item):
+ destination = os.path.join(extracted_bin_dir,param_list[0], param_list[1])
+ bb.utils.mkdirhier(destination)
+ extract_binary(os.path.join(arch_rpm_dir, item), destination)
+ break
+ else:
+ bb.warn("Couldn't find the desired version %s for target binary %s. Related test cases will probably fail." % (param_list[1], param_list[0]))
+ return ""
+ return "extracted"
+ else: # no version provided, just extract one binary
+ destination = os.path.join(extracted_bin_dir,param_list[0],
+ re.search(".*-([0-9]+\.[0-9]+)-.*rpm", target_rpm_file_list[0]).group(1))
+ bb.utils.mkdirhier(destination)
+ extract_binary(os.path.join(arch_rpm_dir, target_rpm_file_list[0]), destination)
+ return "extracted"
+ else: # remote machine
+ binaries_path = os.getenv("bin_dir")# in order to know where the binaries are, bin_dir is set as env. variable
+ if param_list[3] == "native": #need to extract the native pkg here
+ native_rpm_dir = os.path.join(binaries_path, "native")
+ native_rpm_file_list = os.listdir(native_rpm_dir)
+ for item in native_rpm_file_list:
+ if param_list[1] and re.match("nativesdk-{}-{}-.*\.rpm".format(param_list[0], param_list[1]), item): # native package has version
+ extract_binary(os.path.join(native_rpm_dir, item))
+ break
+ else:# just copy any related native binary
+ found_version = re.match("nativesdk-{}-([0-9]+\.[0-9]+)-".format(param_list[0]), item).group(1)
+ if found_version:
+ extract_binary(os.path.join(native_rpm_dir, item))
+ else:
+ bb.warn("Couldn't find native package %s%s. Related test cases will be influenced." %
+ (param_list[0], " with version " + param_list[1] if param_list[1] else ""))
+ return
+
+ else: # this is for target device
+ if param_list[2] == "rpm":
+ return "No need to extract, this is an .rpm file"
+ arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(binaries_path))
+ extracted_bin_path = os.path.join(binaries_path, arch, "extracted_binaries")
+ extracted_bin_list = [item for item in os.listdir(extracted_bin_path)]
+ packaged_bin_path = os.path.join(binaries_path, arch, "packaged_binaries")
+ packaged_bin_file_list = os.listdir(packaged_bin_path)
+ # see if the package is already in the extracted ones; maybe it was deployed when exported the env.
+ if os.path.exists(os.path.join(extracted_bin_path, param_list[0], param_list[1] if param_list[1] else "")):
+ return "binary %s is already extracted" % param_list[0]
+ else: # we need to search for it in the packaged binaries directory. It may have been shipped after export
+ for item in packaged_bin_file_list:
+ if param_list[1]:
+ if re.match("%s-%s.*rpm" % (param_list[0], param_list[1]), item): # package with version
+ if not os.path.exists(os.path.join(extracted_bin_path, param_list[0],param_list[1])):
+ os.makedirs(os.path.join(extracted_bin_path, param_list[0], param_list[1]))
+ extract_binary(os.path.join(packaged_bin_path, item), os.path.join(extracted_bin_path, param_list[0],param_list[1]))
+ bb.plain("Using {} for {}".format(os.path.join(packaged_bin_path, item), param_list[0]))
+ break
+ else:
+ if re.match("%s-.*rpm" % param_list[0], item):
+ found_version = re.match(".*-([0-9]+\.[0-9]+)-", item).group(1)
+ if not os.path.exists(os.path.join(extracted_bin_path, param_list[0], found_version)):
+ os.makedirs(os.path.join(extracted_bin_path, param_list[0], found_version))
+ bb.plain("Used ver. %s for %s" % (found_version, param_list[0]))
+ extract_binary(os.path.join(packaged_bin_path, item), os.path.join(extracted_bin_path, param_list[0], found_version))
+ break
+ else:
+ bb.warn("Couldn't find target package %s%s. Please ensure it is available "
+ "in either of these directories: extracted_binaries or packaged_binaries. "
+ "Related tests will probably fail." % (param_list[0], " with version " + param_list[1] if param_list[1] else ""))
+ return
+ return "Binary %s extracted successfully." % param_list[0]
+
+
+def files_to_copy(base_dir):
+ """
+ Produces a list of files relative to the base dir path sent as param
+ :return: the list of relative path files
+ """
+ files_list = []
+ dir_list = [base_dir]
+ count = 1
+ dir_count = 1
+ while (dir_count == 1 or dir_count != count):
+ count = dir_count
+ for dir in dir_list:
+ for item in os.listdir(dir):
+ if os.path.isdir(os.path.join(dir, item)) and os.path.join(dir, item) not in dir_list:
+ dir_list.append(os.path.join(dir, item))
+ dir_count = len(dir_list)
+ elif os.path.join(dir, item) not in files_list and os.path.isfile(os.path.join(dir, item)):
+ files_list.append(os.path.join(dir, item))
+ return files_list
+
+
+def send_bin_to_DUT(d,params):
+ from oeqa.oetest import oeRuntimeTest
+ param_list = params
+ cleanup_list = list()
+ bins_dir = os.path.join(d.getVar("TEST_EXPORT_DIR"), "binaries") if determine_if_poky_env() \
+ else os.getenv("bin_dir")
+ arch = get_dest_folder(d.getVar("TUNE_FEATURES"), os.listdir(bins_dir))
+ arch_rpms_dir = os.path.join(bins_dir, arch, "packaged_binaries")
+ extracted_bin_dir = os.path.join(bins_dir, arch, "extracted_binaries", param_list[0])
+
+ def send_extracted_binary():
+ bin_local_dir = os.path.join(extracted_bin_dir, param_list[1] if param_list[1] else os.listdir(extracted_bin_dir)[0])
+ for item in files_to_copy(bin_local_dir):
+ split_path = item.split(bin_local_dir)[1]
+ path_on_DUT = split_path if split_path[0] is "/" else "/" + split_path # create the path as on DUT; eg. /usr/bin/bin_file
+ (status, output) = oeRuntimeTest.tc.target.copy_to(item, path_on_DUT)
+ if status != 0:
+ bb.warn("Failed to copy %s binary file %s on the remote target: %s" %
+ (param_list[0], "ver. " + param_list[1] if param_list[1] else "", d.getVar("MACHINE")))
+ return
+ if param_list[4] == "rm":
+ cleanup_list.append(path_on_DUT)
+ return cleanup_list
+
+ def send_rpm(remote_path): # if it is not required to have an extracted binary, but to send an .rpm file
+ rpm_to_send = ""
+ for item in os.listdir(arch_rpms_dir):
+ if param_list[1] and re.match("%s-%s-.*rpm"%(param_list[0], param_list[1]), item):
+ rpm_to_send = item
+ break
+ elif re.match("%s-[0-9]+\.[0-9]+-.*rpm" % param_list[0], item):
+ rpm_to_send = item
+ break
+ else:
+ bb.warn("No rpm package found for %s %s in .rpm files dir %s. Skipping deployment." %
+ (param_list[0], "ver. " + param_list[1] if param_list[1] else "", rpms_file_dir) )
+ return
+ (status, output) = oeRuntimeTest.tc.target.copy_to(os.path.join(arch_rpms_dir, rpm_to_send), remote_path)
+ if status != 0:
+ bb.warn("Failed to copy %s on the remote target: %s" %(param_list[0], d.getVar("MACHINE")))
+ return
+ if param_list[4] == "rm":
+ cleanup_list.append(os.path.join(remote_path, rpm_to_send))
+ return cleanup_list
+
+ if param_list[2] == "rpm": # send an .rpm file
+ return send_rpm("/home/root") # rpms will be sent on home dir of remote machine
+ else:
+ return send_extracted_binary()
+
+
+def rm_bin(removal_list): # need to know both if the binary is sent archived and the path where it is sent if archived
+ from oeqa.oetest import oeRuntimeTest
+ for item in removal_list:
+ (status,output) = oeRuntimeTest.tc.target.run("rm " + item)
+ if status != 0:
+ bb.warn("Failed to remove: %s. Please ensure connection with the target device is up and running and "
+ "you have the needed rights." % item)
+
diff --git a/poky/meta/lib/rootfspostcommands.py b/poky/meta/lib/rootfspostcommands.py
new file mode 100644
index 000000000..4742e0613
--- /dev/null
+++ b/poky/meta/lib/rootfspostcommands.py
@@ -0,0 +1,56 @@
+import os
+
+def sort_file(filename, mapping):
+ """
+ Sorts a passwd or group file based on the numeric ID in the third column.
+ If a mapping is given, the name from the first column is mapped via that
+ dictionary instead (necessary for /etc/shadow and /etc/gshadow). If not,
+ a new mapping is created on the fly and returned.
+ """
+ new_mapping = {}
+ with open(filename, 'rb+') as f:
+ lines = f.readlines()
+ # No explicit error checking for the sake of simplicity. /etc
+ # files are assumed to be well-formed, causing exceptions if
+ # not.
+ for line in lines:
+ entries = line.split(b':')
+ name = entries[0]
+ if mapping is None:
+ id = int(entries[2])
+ else:
+ id = mapping[name]
+ new_mapping[name] = id
+ # Sort by numeric id first, with entire line as secondary key
+ # (just in case that there is more than one entry for the same id).
+ lines.sort(key=lambda line: (new_mapping[line.split(b':')[0]], line))
+ # We overwrite the entire file, i.e. no truncate() necessary.
+ f.seek(0)
+ f.write(b''.join(lines))
+ return new_mapping
+
+def remove_backup(filename):
+ """
+ Removes the backup file for files like /etc/passwd.
+ """
+ backup_filename = filename + '-'
+ if os.path.exists(backup_filename):
+ os.unlink(backup_filename)
+
+def sort_passwd(sysconfdir):
+ """
+ Sorts passwd and group files in a rootfs /etc directory by ID.
+ Backup files are sometimes are inconsistent and then cannot be
+ sorted (YOCTO #11043), and more importantly, are not needed in
+ the initial rootfs, so they get deleted.
+ """
+ for main, shadow in (('passwd', 'shadow'),
+ ('group', 'gshadow')):
+ filename = os.path.join(sysconfdir, main)
+ remove_backup(filename)
+ if os.path.exists(filename):
+ mapping = sort_file(filename, None)
+ filename = os.path.join(sysconfdir, shadow)
+ remove_backup(filename)
+ if os.path.exists(filename):
+ sort_file(filename, mapping)
diff --git a/poky/meta/recipes-bsp/acpid/acpid.inc b/poky/meta/recipes-bsp/acpid/acpid.inc
new file mode 100644
index 000000000..766ed4f89
--- /dev/null
+++ b/poky/meta/recipes-bsp/acpid/acpid.inc
@@ -0,0 +1,32 @@
+SUMMARY = "A daemon for delivering ACPI events"
+HOMEPAGE = "http://sourceforge.net/projects/acpid2"
+BUGTRACKER = "http://sourceforge.net/p/acpid2/tickets/?source=navbar"
+SECTION = "base"
+LICENSE = "GPLv2+"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \
+ file://init \
+ file://acpid.service \
+ "
+
+CVE_PRODUCT = "acpid2"
+
+inherit autotools update-rc.d systemd
+
+INITSCRIPT_NAME = "acpid"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "acpid.service"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ sed -e 's,/usr/sbin,${sbindir},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/acpid
+ chmod 755 ${D}${sysconfdir}/init.d/acpid
+
+ install -d ${D}${sysconfdir}/acpi
+ install -d ${D}${sysconfdir}/acpi/events
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/acpid.service
+}
diff --git a/poky/meta/recipes-bsp/acpid/acpid/acpid.service b/poky/meta/recipes-bsp/acpid/acpid/acpid.service
new file mode 100644
index 000000000..f70e74096
--- /dev/null
+++ b/poky/meta/recipes-bsp/acpid/acpid/acpid.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=ACPI Event Daemon
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/acpid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-bsp/acpid/acpid/init b/poky/meta/recipes-bsp/acpid/acpid/init
new file mode 100755
index 000000000..40ff385c1
--- /dev/null
+++ b/poky/meta/recipes-bsp/acpid/acpid/init
@@ -0,0 +1,31 @@
+#! /bin/sh -e
+
+test -x /usr/sbin/acpid || exit 0
+test -d /proc/acpi || exit 0
+mkdir -p /etc/acpi/events
+
+case "$1" in
+ start)
+ echo -n "Starting Advanced Configuration and Power Interface daemon: "
+ if [ ! -d /etc/acpi/events ]; then
+ echo "There is not any rule configuration file."
+ else
+ start-stop-daemon -o -S -x /usr/sbin/acpid -- -c /etc/acpi/events
+ echo "acpid."
+ fi
+ ;;
+ stop)
+ echo -n "Stopping Advanced Configuration and Power Interface daemon: "
+ start-stop-daemon -o -K -x /usr/sbin/acpid
+ echo "acpid."
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/acpid {start|stop|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb b/poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb
new file mode 100644
index 000000000..686526fda
--- /dev/null
+++ b/poky/meta/recipes-bsp/acpid/acpid_2.0.28.bb
@@ -0,0 +1,7 @@
+require acpid.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
+
+SRC_URI[md5sum] = "0432407b5ff75ae8e08afb43052fde2b"
+SRC_URI[sha256sum] = "980c3a54b0d3f2fd49fd845a0584c5c2abeaab9e9ac09fcbb68686bbb57a7110"
diff --git a/poky/meta/recipes-bsp/alsa-state/alsa-state.bb b/poky/meta/recipes-bsp/alsa-state/alsa-state.bb
new file mode 100644
index 000000000..067055699
--- /dev/null
+++ b/poky/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,68 @@
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: MIT (see http://www.opensource.org/licenses/mit-license.php
+# for a copy of the license)
+#
+# Filename: alsa-state.bb
+
+SUMMARY = "Alsa scenario files to enable alsa state restoration"
+HOMEPAGE = "http://www.alsa-project.org/"
+DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \
+sound state at system boot and save it at system shut down."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "0.2.0"
+PR = "r5"
+
+SRC_URI = "\
+ file://asound.conf \
+ file://asound.state \
+ file://alsa-state-init \
+"
+
+S = "${WORKDIR}"
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "alsa-state"
+INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
+
+do_install() {
+ # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
+ fi
+
+ install -d ${D}/${localstatedir}/lib/alsa
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
+}
+
+PACKAGES += "alsa-states"
+
+RRECOMMENDS_alsa-state = "alsa-states"
+
+RDEPENDS_${PN} = "alsa-utils-alsactl"
+FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
+CONFFILES_${PN} = "${sysconfdir}/asound.conf"
+
+FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
+
+pkg_postinst_${PN}() {
+ if test -z "$D"
+ then
+ if test -x ${sbindir}/alsactl
+ then
+ ${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
+ fi
+ fi
+}
diff --git a/poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
new file mode 100755
index 000000000..eee59cb32
--- /dev/null
+++ b/poky/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
@@ -0,0 +1,39 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: alsa-state
+# Date: 20070308 (YMD)
+
+# source function library
+. /etc/init.d/functions
+
+asound_restore(){
+ echo "ALSA: Restoring mixer settings..."
+ if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
+ then
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
+ fi
+}
+
+asound_store(){
+ echo "ALSA: Storing mixer settings..."
+ if test -x /usr/sbin/alsactl
+ then
+ /usr/sbin/alsactl -f #STATEDIR#/asound.state store
+ fi
+}
+
+case "$1" in
+start) asound_restore ;;
+stop) asound_store ;;
+ status)
+ status /usr/sbin/alsactl;
+ exit $?
+ ;;
+ *)
+ echo "Usage: /etc/init.d/alsa-state {start|stop|status}"
+ exit 1
+ ;;
+esac
diff --git a/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
new file mode 100644
index 000000000..03653cfb2
--- /dev/null
+++ b/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
@@ -0,0 +1 @@
+# Global alsa-lib configuration
diff --git a/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state b/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 000000000..ddd1cce85
--- /dev/null
+++ b/poky/meta/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1 @@
+# Dummy file, do not delete
diff --git a/poky/meta/recipes-bsp/apmd/apmd/apmd.service b/poky/meta/recipes-bsp/apmd/apmd/apmd.service
new file mode 100644
index 000000000..ffab82334
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/apmd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Advanced Power Management daemon
+After=remote-fs.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/apmd
+ExecStart=@SBINDIR@/apmd -P @SYSCONFDIR@/apm/apmd_proxy $APMD
diff --git a/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy b/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy
new file mode 100644
index 000000000..c48ee4e5d
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy
@@ -0,0 +1,91 @@
+#!/bin/sh
+#
+# apmd_proxy - program dispatcher for APM daemon
+#
+# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999
+# Modified for Debian by Avery Pennarun
+#
+# This shell script is called by the APM daemon (apmd) when a power
+# management event occurs. Its first and second arguments describe the
+# event. For example, apmd will call "apmd_proxy suspend system" just
+# before the system is suspended.
+#
+# Here are the possible arguments:
+#
+# start - APM daemon has started
+# stop - APM daemon is shutting down
+# suspend critical - APM system indicates critical suspend (++)
+# suspend system - APM system has requested suspend mode
+# suspend user - User has requested suspend mode
+# standby system - APM system has requested standby mode
+# standby user - User has requested standby mode
+# resume suspend - System has resumed from suspend mode
+# resume standby - System has resumed from standby mode
+# resume critical - System has resumed from critical suspend
+# change battery - APM system reported low battery
+# change power - APM system reported AC/battery change
+# change time - APM system reported time change (*)
+# change capability - APM system reported config. change (+)
+#
+# (*) - APM daemon may be configured to not call these sequences
+# (+) - Available if APM kernel supports it.
+# (++) - "suspend critical" is never passed to apmd from the kernel,
+# so we will never see it here. Scripts that process "resume
+# critical" events need to take this into account.
+#
+# It is the proxy script's responsibility to examine the APM status
+# (via /proc/apm) or other status and to take appropriate actions.
+# For example, the script might unmount network drives before the
+# machine is suspended.
+#
+# In Debian, the usual way of adding functionality to the proxy is to
+# add a script to /etc/apm/event.d. This script will be called by
+# apmd_proxy (via run-parts) with the same arguments.
+#
+# If it is important that a certain set of script be run in a certain
+# order on suspend and in a different order on resume, then put all
+# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and
+# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and
+# /etc/apm/other.d using names whose lexicographical order is the same
+# as the desired order of execution.
+#
+# If the kernel's APM driver supports it, apmd_proxy can return a non-zero
+# exit status on suspend and standby events, indicating that the suspend
+# or standby event should be rejected.
+#
+# *******************************************************************
+
+set -e
+
+# The following doesn't yet work, because current kernels (up to at least
+# 2.4.20) do not support rejection of APM events. Supporting this would
+# require substantial modifications to the APM driver. We will re-enable
+# this feature if the driver is ever modified. -- cph@debian.org
+#
+#SUSPEND_ON_AC=false
+#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf
+#
+#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \
+# && on_ac_power >/dev/null; then
+# # Reject system suspends and standbys if we are on AC power
+# exit 1 # Reject (NOTE kernel support must be enabled)
+#fi
+
+if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then
+ run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+ if [ -d /etc/apm/suspend.d ]; then
+ run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d
+ fi
+elif [ "${1}" = "resume" ]; then
+ if [ -d /etc/apm/resume.d ]; then
+ run-parts -a "${1}" -a "${2}" /etc/apm/resume.d
+ fi
+ run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+else
+ run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+ if [ -d /etc/apm/other.d ]; then
+ run-parts -a "${1}" -a "${2}" /etc/apm/other.d
+ fi
+fi
+
+exit 0
diff --git a/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf b/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf
new file mode 100644
index 000000000..751145c52
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf
@@ -0,0 +1,16 @@
+# /etc/apm/apmd_proxy.conf: configuration file for apmd.
+#
+# This file is managed by debconf when installing or reconfiguring the
+# package. It is generated by merging the answers gathered by debconf
+# into the template file "/usr/share/apmd/apmd_proxy.conf".
+
+# The following doesn't yet work, because current kernels (up to at least
+# 2.4.20) do not support rejection of APM events. Supporting this would
+# require substantial modifications to the APM driver. We will re-enable
+# this feature if the driver is ever modified. -- cph@debian.org
+#
+# Set the following to "false" if you want to reject system suspend or
+# system standby requests when the computer is running on AC power.
+# Otherwise set this to "true". Such requests are never rejected when
+# the computer is running on battery power.
+#SUSPEND_ON_AC=true
diff --git a/poky/meta/recipes-bsp/apmd/apmd/default b/poky/meta/recipes-bsp/apmd/apmd/default
new file mode 100644
index 000000000..4b7965abf
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/default
@@ -0,0 +1,8 @@
+#
+# Default for /etc/init.d/apmd
+#
+
+# As apmd can be called with arguments, we use the following variable
+# to store them, e.g., APMD="-w 5 -p 2".
+# See the manual page apmd(8) for details.
+APMD="--proxy-timeout 30"
diff --git a/poky/meta/recipes-bsp/apmd/apmd/init b/poky/meta/recipes-bsp/apmd/apmd/init
new file mode 100755
index 000000000..c0b41aa9d
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/init
@@ -0,0 +1,51 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: apmd
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Advanced Power Management daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+[ -f /etc/default/apmd ] && . /etc/default/apmd
+
+case "$1" in
+ start)
+ echo -n "Starting advanced power management daemon: "
+ start-stop-daemon -S -x /usr/sbin/apmd -- \
+ -P /etc/apm/apmd_proxy $APMD
+ if [ $? = 0 ]; then
+ echo "apmd."
+ else
+ echo "(failed.)"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping advanced power management daemon: "
+ start-stop-daemon -K \
+ -x /usr/sbin/apmd
+ echo "apmd."
+ ;;
+ status)
+ status /usr/sbin/apmd;
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit
+ ;;
+ *)
+ echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-bsp/apmd/apmd/legacy.patch b/poky/meta/recipes-bsp/apmd/apmd/legacy.patch
new file mode 100644
index 000000000..5db895e8f
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/legacy.patch
@@ -0,0 +1,133 @@
+From 3595933d221f0ba836917debc0776b8723972ec9 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 11 Aug 2015 17:40:50 +0300
+Subject: [PATCH 1/3] Patch with fixes provided by Debian.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.2.2-15.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ Makefile | 2 +-
+ apm.c | 3 ++-
+ apm.h | 9 +++++++++
+ apmd.c | 15 ++++++++-------
+ 4 files changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index bf346d9..92fc0fd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -43,7 +43,7 @@ DESTDIR=
+
+ CC=gcc
+ CFLAGS=-O -g
+-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \
++XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
+ -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
+ -DVERSION=\"$(VERSION)\" \
+ -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
+diff --git a/apm.c b/apm.c
+index b21c057..0359b1c 100644
+--- a/apm.c
++++ b/apm.c
+@@ -219,12 +219,13 @@ int main(int argc, char **argv)
+ }
+ }
+
+-
++#if 0
+ if (!(i.apm_flags & APM_32_BIT_SUPPORT))
+ {
+ fprintf(stderr, "32-bit APM interface not supported\n");
+ exit(1);
+ }
++#endif
+
+ if (verbose && (i.apm_flags & 0x10))
+ printf("APM BIOS Power Management is currently disabled\n");
+diff --git a/apm.h b/apm.h
+index fb24dfd..824cc06 100644
+--- a/apm.h
++++ b/apm.h
+@@ -20,6 +20,13 @@
+ * $Id: apm.h,v 1.7 1999/07/05 22:31:11 apenwarr Exp $
+ *
+ */
++#ifndef _APM_H
++#define _APM_H 1
++
++#ifndef __KERNEL_STRICT_NAMES
++#define __KERNEL_STRICT_NAMES
++#endif
++
+ #include <linux/apm_bios.h>
+ #include <sys/types.h>
+
+@@ -93,3 +100,5 @@ extern int apm_reject(int fd);
+ #else
+ #define apm_reject(fd) (-EINVAL)
+ #endif
++
++#endif
+diff --git a/apmd.c b/apmd.c
+index 49ed3a1..560f536 100644
+--- a/apmd.c
++++ b/apmd.c
+@@ -343,7 +343,7 @@ static int call_proxy(apm_event_t event)
+ /* parent */
+ int status, retval;
+ ssize_t len;
+- time_t time_limit;
++ time_t countdown;
+
+ if (pid < 0) {
+ /* Couldn't fork */
+@@ -356,8 +356,9 @@ static int call_proxy(apm_event_t event)
+ /* Capture the child's output, if any, but only until it terminates */
+ close(fds[1]);
+ fcntl(fds[0], F_SETFL, O_RDONLY|O_NONBLOCK);
+- time_limit = time(0) + proxy_timeout;
++ countdown = proxy_timeout;
+ do {
++ countdown -= 1;
+ while ((len = read(fds[0], line, sizeof(line)-1)) > 0) {
+ line[len] = 0;
+ APMD_SYSLOG(LOG_INFO, "+ %s", line);
+@@ -372,16 +373,16 @@ static int call_proxy(apm_event_t event)
+ goto proxy_done;
+ }
+
+- sleep(1);
++ while (sleep(1) > 0) ;
+ } while (
+- (time(0) < time_limit)
++ (countdown >= 0)
+ || (proxy_timeout < 0)
+ );
+
+ APMD_SYSLOG(LOG_NOTICE, "Proxy has been running more than %d seconds; killing it", proxy_timeout);
+
+ kill(pid, SIGTERM);
+- time_limit = time(0) + 5;
++ countdown = 5;
+ do {
+ retval = waitpid(pid, &status, WNOHANG);
+ if (retval == pid)
+@@ -392,9 +393,9 @@ static int call_proxy(apm_event_t event)
+ goto proxy_done;
+ }
+
+- sleep(1);
++ while (sleep(1) > 0) ;
+
+- } while (time(0) < time_limit);
++ } while (countdown >= 0);
+
+ kill(pid, SIGKILL);
+ status = __W_EXITCODE(0, SIGKILL);
+--
+2.1.4
+
diff --git a/poky/meta/recipes-bsp/apmd/apmd/libtool.patch b/poky/meta/recipes-bsp/apmd/apmd/libtool.patch
new file mode 100644
index 000000000..834ee080a
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/libtool.patch
@@ -0,0 +1,33 @@
+Add by RP to address "unable to infer tagged configuration" error:
+ commit 35de05e61b88c0808a5e885bb0efdf420555d5ad
+ Author: Richard Purdie <rpurdie@rpsys.net>
+ Date: Sun Jun 1 16:13:38 2008 +0000
+
+ apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky)
+
+However I didn't see same issue with current libtool-2.2.10. Also per my understanding,
+the default tag, if not specified, falls back to CC. So disable it from patching, but
+keep it here. If we encounter similar issue in the future, we could then push upstream
+
+Comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-16
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: apmd-3.2.2.orig/Makefile
+===================================================================
+--- apmd-3.2.2.orig.orig/Makefile 2004-01-04 08:13:18.000000000 +0000
++++ apmd-3.2.2.orig/Makefile 2008-04-21 17:10:03.000000000 +0100
+@@ -58,9 +57,8 @@
+ #CFLAGS=-O3 -m486 -fomit-frame-pointer
+ #LDFLAGS=-s
+
+-LIBTOOL=libtool --quiet
+-LT_COMPILE = $(LIBTOOL) --mode=compile $(CC)
+-LT_LINK = $(LIBTOOL) --mode=link $(CC)
++LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC)
++LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
+ LT_INSTALL = $(LIBTOOL) --mode=install install
+ LT_CLEAN = $(LIBTOOL) --mode=clean rm
+
diff --git a/poky/meta/recipes-bsp/apmd/apmd/linkage.patch b/poky/meta/recipes-bsp/apmd/apmd/linkage.patch
new file mode 100644
index 000000000..3d32c49cd
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/linkage.patch
@@ -0,0 +1,53 @@
+When building use the libtool intermediate .lo files instead of explicitly using
+the .o files. Under libtool foo.lo is the libtool intermediate wrapper, foo.o is
+a static build, and .libs/foo.o is a shared build.
+
+If static libraries have been disabled globally then libtool won't generate them
+and explicit references to foo.o won't be satisfied.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile b/Makefile
+index bb695c6..5f60146 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,7 +28,7 @@ endif
+
+ .SUFFIXES:
+
+-OBJS=apmlib.o
++OBJS=apmlib.lo
+ EXES=apm apmd xapm apmsleep
+ HEADERS=apm.h
+
+@@ -66,22 +66,22 @@ all: $(EXES)
+
+ $(OBJS): $(HEADERS)
+
+-%.o: %.c
++%.lo: %.c
+ $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) $<
+
+-%: %.o $(LIBAPM)
++%: %.lo $(LIBAPM)
+ $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM)
+
+-xapm.o: xapm.c
++xapm.lo: xapm.c
+ $(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) -DNARROWPROTO $<
+
+-apmd: apmd.o
++apmd: apmd.lo
+
+-apmsleep: apmsleep.o
++apmsleep: apmsleep.lo
+
+-apmexists: apmexists.o
++apmexists: apmexists.lo
+
+-xapm: xapm.o $(LIBAPM)
++xapm: xapm.lo $(LIBAPM)
+ $(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM) $(XLDFLAGS) $(XLIBS)
+
+ $(LIBAPM): apmlib.lo
diff --git a/poky/meta/recipes-bsp/apmd/apmd/unlinux.patch b/poky/meta/recipes-bsp/apmd/apmd/unlinux.patch
new file mode 100644
index 000000000..ec8206cf1
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/unlinux.patch
@@ -0,0 +1,25 @@
+copy OE commit message here:
+ commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359
+ Author: Michael Krelin <hacker@klever.net>
+ Date: Tue May 29 12:27:45 2007 +0000
+
+ apmd: prevent build from interferring with host kernel headers. Closes #1257
+
+comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- apmd-3.2.2.orig/Makefile
++++ apmd-3.2.2/Makefile
+@@ -43,8 +43,7 @@
+
+ CC=gcc
+ CFLAGS=-O -g
+-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
+- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
++XTRACFLAGS=-Wall -pipe -I. \
+ -DVERSION=\"$(VERSION)\" \
+ -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
+ LDFLAGS=
diff --git a/poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch b/poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch
new file mode 100644
index 000000000..c5faa85fa
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd/wexitcode.patch
@@ -0,0 +1,26 @@
+Define non-posix W* funcitons
+
+C libraries like musl dont define them
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: apmd-3.2.2.orig/apmd.c
+===================================================================
+--- apmd-3.2.2.orig.orig/apmd.c
++++ apmd-3.2.2.orig/apmd.c
+@@ -55,6 +55,14 @@
+ #define MINIMUM_RATE_CALC_TIME 120
+ #endif
+
++#ifndef _POSIX_SOURCE
++
++#define __WCOREFLAG 0200
++#define __WCOREDUMP(x) (_W_INT(x) & __WCOREFLAG)
++#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
++
++#endif
++
+ /*
+ * For the verbosity level feature to be useful,
+ * we rely on the fact that syslog.h assigns adjacent
diff --git a/poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb b/poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
new file mode 100644
index 000000000..82c264934
--- /dev/null
+++ b/poky/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
@@ -0,0 +1,85 @@
+SUMMARY = "Utilities for Advanced Power Management"
+DESCRIPTION = "The Advanced Power Management (APM) support provides \
+access to battery status information and a set of tools for managing \
+notebook power consumption."
+HOMEPAGE = "http://apenwarr.ca/apmd/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
+DEPENDS = "libtool-cross"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_3.2.2.orig.tar.gz;name=tarball \
+ file://legacy.patch \
+ file://libtool.patch \
+ file://unlinux.patch \
+ file://wexitcode.patch \
+ file://linkage.patch \
+ file://init \
+ file://default \
+ file://apmd_proxy \
+ file://apmd_proxy.conf \
+ file://apmd.service"
+
+SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
+SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apmd/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/apmd-3.2.2.orig"
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "apmd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "apmd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile() {
+ # apmd doesn't use whole autotools. Just libtool for installation
+ oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -d ${D}${sysconfdir}/apm
+ install -d ${D}${sysconfdir}/apm/event.d
+ install -d ${D}${sysconfdir}/apm/other.d
+ install -d ${D}${sysconfdir}/apm/suspend.d
+ install -d ${D}${sysconfdir}/apm/resume.d
+ install -d ${D}${sysconfdir}/apm/scripts.d
+ install -d ${D}${sysconfdir}/default
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sbindir}
+ install -d ${D}${bindir}
+ install -d ${D}${libdir}
+ install -d ${D}${datadir}/apmd
+ install -d ${D}${includedir}
+
+ install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
+ install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
+ install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
+ install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
+ install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
+ oe_libinstall -so libapm ${D}${libdir}
+ install -m 0644 apm.h ${D}${includedir}
+
+ sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
+ chmod 755 ${D}${sysconfdir}/init.d/apmd
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service
+}
+
+PACKAGES =+ "libapm apm"
+
+FILES_libapm = "${libdir}/libapm${SOLIBS}"
+FILES_apm = "${bindir}/apm*"
diff --git a/poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb b/poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb
new file mode 100644
index 000000000..c2a02aadb
--- /dev/null
+++ b/poky/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "eeePC specific ACPI scripts"
+HOMEPAGE = "http://alioth.debian.org/projects/debian-eeepc/"
+SECTION = "base"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=77ef83ab5f4af938a93edb61f7b74f2c"
+
+SRCREV = "9d4cdedca25b396405f8587f9c4fbf8229e041c2"
+PV = "1.1.12+git${SRCPV}"
+
+SRC_URI = "git://git.debian.org/git/debian-eeepc/eeepc-acpi-scripts.git \
+ file://remove-doc-check.patch \
+ file://powerbtn.patch \
+ file://policy-funcs "
+
+S = "${WORKDIR}/git"
+
+FILES_${PN} = "${datadir}/acpi-support/ \
+ ${datadir}/eeepc-acpi-scripts \
+ ${sysconfdir}/default/ \
+ ${sysconfdir}/acpi/"
+
+do_install () {
+ install -d ${D}${sysconfdir}/default/
+ install -d ${D}${sysconfdir}/acpi/actions/
+ install -d ${D}${sysconfdir}/acpi/events/
+ install -d ${D}${sysconfdir}/acpi/lib/udev/rules.d
+ install -d ${D}${datadir}/eeepc-acpi-scripts/
+ install -d ${D}${datadir}/acpi-support/
+ install -m 644 ${S}/events/* ${D}${sysconfdir}/acpi/events/
+ install -m 644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/acpi/lib/udev/rules.d/
+ install ${S}/actions/* ${D}${sysconfdir}/acpi/actions/
+ install -m 0644 ${S}/acpilib/functions.sh ${D}${datadir}/eeepc-acpi-scripts/
+ install -m 0644 ${WORKDIR}/policy-funcs ${D}${datadir}/acpi-support/
+ install -m 0644 ${S}/debian/eeepc-acpi-scripts.default* ${D}${sysconfdir}/default/
+}
+
+RDEPENDS_${PN} = "pm-utils"
+
diff --git a/poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs b/poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs
new file mode 100644
index 000000000..fd099df0d
--- /dev/null
+++ b/poky/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs
@@ -0,0 +1,8 @@
+CheckPolicy() {
+ if pidof gnome-power-manager kpowersave > /dev/null ||
+ (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ; then
+ echo 0;
+ else
+ echo 1;
+ fi
+}
diff --git a/poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch b/poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch
new file mode 100644
index 000000000..403e5569b
--- /dev/null
+++ b/poky/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch
@@ -0,0 +1,22 @@
+---
+ actions/power.sh | 3 +++
+ events/powerbtn | 2 ++
+ 2 files changed, 5 insertions(+)
+
+Upstream-Status: Inappropriate [enable feature]
+
+Index: git/events/powerbtn
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ git/events/powerbtn 2008-10-08 17:43:35.000000000 +0200
+@@ -0,0 +1,2 @@
++event=button/power PWRF
++action=/etc/acpi/actions/power.sh
+Index: git/actions/power.sh
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ git/actions/power.sh 2008-10-08 17:45:26.000000000 +0200
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++/sbin/shutdown -h now "Power button pressed"
diff --git a/poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch b/poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch
new file mode 100644
index 000000000..efb3dca7a
--- /dev/null
+++ b/poky/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch
@@ -0,0 +1,60 @@
+---
+ actions/hotkey.sh | 3 ---
+ actions/suspend.sh | 3 ---
+ actions/vga-toggle.sh | 3 ---
+ actions/volume.sh | 3 ---
+ 4 files changed, 12 deletions(-)
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/eeepc-acpi-scripts/volume.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/volume.sh 2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/volume.sh 2011-11-29 19:41:36.000000000 +0800
+@@ -3,12 +3,10 @@
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+ # Volume controls
+
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+
+ . $FUNC_LIB
+ . $PKG_DIR/lib/sound.sh
+Index: git/eeepc-acpi-scripts/hotkey.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/hotkey.sh 2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/hotkey.sh 2011-11-29 19:39:51.000000000 +0800
+@@ -1,12 +1,10 @@
+ #!/bin/sh
+
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+
+ case $(runlevel) in
+ *0|*6)
+Index: git/eeepc-acpi-scripts/vga-toggle.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/vga-toggle.sh 2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/vga-toggle.sh 2011-11-29 19:40:24.000000000 +0800
+@@ -1,12 +1,10 @@
+ #!/bin/sh
+
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+
+ if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
+ . $FUNC_LIB
diff --git a/poky/meta/recipes-bsp/formfactor/files/config b/poky/meta/recipes-bsp/formfactor/files/config
new file mode 100755
index 000000000..ecfdf26e2
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/config
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+if [ -e /etc/formfactor/machconfig ]; then
+ . /etc/formfactor/machconfig
+fi
+
+if [ -z "$HAVE_TOUCHSCREEN" ]; then
+ HAVE_TOUCHSCREEN=0
+fi
+
+if [ -z "$HAVE_KEYBOARD" ]; then
+ HAVE_KEYBOARD=1
+fi
+
+if [ -z "$HAVE_KEYBOARD_PORTRAIT" ]; then
+ HAVE_KEYBOARD_PORTRAIT=0
+fi
+
+if [ -z "$HAVE_KEYBOARD_LANDSCAPE" ]; then
+ HAVE_KEYBOARD_LANDSCAPE=0
+fi
+
+if [ -z "$DISPLAY_CAN_ROTATE" ]; then
+ DISPLAY_CAN_ROTATE=0
+fi
+
+if [ -z "$DISPLAY_ORIENTATION" ]; then
+ DISPLAY_ORIENTATION=0
+fi
+
+if [ -e "/dev/fb" ]; then
+ if [ -z "$DISPLAY_WIDTH_PIXELS" ]; then
+ DISPLAY_WIDTH_PIXELS=`/usr/sbin/fbset | grep geometry | awk '{ print $2 }'`
+ fi
+
+ if [ -z "$DISPLAY_HEIGHT_PIXELS" ]; then
+ DISPLAY_HEIGHT_PIXELS=`/usr/sbin/fbset | grep geometry | awk '{ print $3 }'`
+ fi
+
+ if [ -z "$DISPLAY_BPP" ]; then
+ DISPLAY_BPP=`/usr/sbin/fbset | grep geometry | awk '{ print $6 }'`
+ fi
+fi
+
+#
+# No way to guess these or have any defaults
+#
+#DISPLAY_WIDTH_MM
+#DISPLAY_HEIGHT_MM
+#DISPLAY_SUBPIXEL_ORDER=
diff --git a/poky/meta/recipes-bsp/formfactor/files/machconfig b/poky/meta/recipes-bsp/formfactor/files/machconfig
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/machconfig
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemuarm/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig
new file mode 100755
index 000000000..56777b6e2
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemumips/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_WIDTH_PIXELS=640
+DISPLAY_HEIGHT_PIXELS=480
+DISPLAY_BPP=16
+DISPLAY_DPI=150
+#DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig
new file mode 100755
index 000000000..56777b6e2
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemumips64/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_WIDTH_PIXELS=640
+DISPLAY_HEIGHT_PIXELS=480
+DISPLAY_BPP=16
+DISPLAY_DPI=150
+#DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig
new file mode 100755
index 000000000..5ea2270cd
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemuppc/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_WIDTH_PIXELS=800
+DISPLAY_HEIGHT_PIXELS=600
+DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig b/poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig
new file mode 100755
index 000000000..56a2ae2e3
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/files/qemux86/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
new file mode 100644
index 000000000..53cf1cf77
--- /dev/null
+++ b/poky/meta/recipes-bsp/formfactor/formfactor_0.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Device formfactor information"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PR = "r45"
+
+SRC_URI = "file://config file://machconfig"
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_install() {
+ # Install file only if it has contents
+ install -d ${D}${sysconfdir}/formfactor/
+ install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/
+ if [ -s "${S}/machconfig" ]; then
+ install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
+ fi
+}
diff --git a/poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch
new file mode 100644
index 000000000..69efd34e2
--- /dev/null
+++ b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/gcc46-compatibility.patch
@@ -0,0 +1,35 @@
+From 8d16ae374c5d4d9fac45c002605a66cfb8c08be5 Mon Sep 17 00:00:00 2001
+From: Steve Langasek <steve.langasek@ubuntu.com>
+Date: Wed, 9 Sep 2015 08:26:06 +0000
+Subject: [PATCH 3/3] gnu-efi, syslinux: Support gcc < 4.7
+
+don't break with old compilers and -DGNU_EFI_USE_MS_ABI
+It's entirely legitimate to request GNU_EFI_USE_MS_ABI even if the current
+compiler doesn't support it, and gnu-efi should transparently fall back to
+using legacy techniques to set the calling convention. We don't get type
+checking, but at least it will still compile.
+
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Upstream-Status: Pending
+[Rebased for 3.0.6]
+Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
+---
+ inc/x86_64/efibind.h | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/inc/x86_64/efibind.h b/inc/x86_64/efibind.h
+index 4309f9f..02c0af1 100644
+--- a/inc/x86_64/efibind.h
++++ b/inc/x86_64/efibind.h
+@@ -25,8 +25,6 @@ Revision History
+ #if defined(GNU_EFI_USE_MS_ABI)
+ #if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)))||(defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 2)))
+ #define HAVE_USE_MS_ABI 1
+- #else
+- #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+ #endif
+
+--
+2.9.4
+
diff --git a/poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch
new file mode 100644
index 000000000..1b2ae1ef0
--- /dev/null
+++ b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch
@@ -0,0 +1,38 @@
+From 0daa354a16aa3cade56ed423d0f8a04cf1c22f9d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 23 Apr 2015 01:49:31 -0700
+Subject: [PATCH] lib/Makefile: fix parallel issue
+
+Fixed:
+Assembler messages:
+Fatal error: can't create runtime/rtlock.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/rtdata.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/vm.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/efirtlib.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/Makefile | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index dc4b94a..f64d1ed 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -73,6 +73,8 @@ all: libsubdirs libefi.a
+ libsubdirs:
+ for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
+
++$(OBJS): libsubdirs
++
+ libefi.a: $(OBJS)
+ $(AR) rv $@ $(OBJS)
+
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
new file mode 100644
index 000000000..0110260bd
--- /dev/null
+++ b/poky/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
@@ -0,0 +1,54 @@
+From 16865de66db33ca70872199e70d93efccecc8575 Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw@linux.intel.com>
+Date: Sun, 9 Mar 2014 15:22:15 +0200
+Subject: [PATCH 1/3] Fix parallel make failure for archives
+
+Upstream-Status: Pending
+
+The lib and gnuefi makefiles were using the lib.a() form which compiles
+and ar's as a pair instead of compiling all and then ar'ing which can
+parallelize better. This was resulting in build failures on larger values
+of -j.
+
+See http://www.chemie.fu-berlin.de/chemnet/use/info/make/make_toc.html#TOC105
+for details.
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+[Rebased for 3.0.6]
+Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
+---
+ gnuefi/Makefile | 3 ++-
+ lib/Makefile | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/gnuefi/Makefile b/gnuefi/Makefile
+index 2a61699..148106e 100644
+--- a/gnuefi/Makefile
++++ b/gnuefi/Makefile
+@@ -54,7 +54,8 @@ TARGETS = crt0-efi-$(ARCH).o libgnuefi.a
+
+ all: $(TARGETS)
+
+-libgnuefi.a: $(patsubst %,libgnuefi.a(%),$(OBJS))
++libgnuefi.a: $(OBJS)
++ $(AR) rv $@ $(OBJS)
+
+ clean:
+ rm -f $(TARGETS) *~ *.o $(OBJS)
+diff --git a/lib/Makefile b/lib/Makefile
+index b8d1ce7..6ef8107 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -75,7 +75,7 @@ libsubdirs:
+ for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
+
+ libefi.a: $(OBJS)
+- $(AR) rv -U $@ $^
++ $(AR) rv $@ $(OBJS)
+
+ clean:
+ rm -f libefi.a *~ $(OBJS) */*.o
+--
+2.9.4
+
diff --git a/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.6.bb b/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.6.bb
new file mode 100644
index 000000000..2a6071748
--- /dev/null
+++ b/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.6.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Libraries for producing EFI binaries"
+HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
+SECTION = "devel"
+LICENSE = "GPLv2+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
+ file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
+ file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \
+ file://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \
+ file://lib/arm/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+ file://lib/arm/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+ file://lib/aarch64/math.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+ file://lib/aarch64/initplat.c;beginline=2;endline=15;md5=8ed772501da77b2b3345aa6df8744c9e \
+ "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+ file://parallel-make-archives.patch \
+ file://lib-Makefile-fix-parallel-issue.patch \
+ file://gcc46-compatibility.patch \
+ "
+
+SRC_URI[md5sum] = "46f633758a8a37db9fd6909fe270c26b"
+SRC_URI[sha256sum] = "21515902d80fbea23328a61d70d3d51a47204abd1507ebfa27550a7b9bf22c91"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+COMPATIBLE_HOST_armv4 = 'null'
+
+do_configure_linux-gnux32_prepend() {
+ cp ${STAGING_INCDIR}/gnu/stubs-x32.h ${STAGING_INCDIR}/gnu/stubs-64.h
+ cp ${STAGING_INCDIR}/bits/long-double-32.h ${STAGING_INCDIR}/bits/long-double-64.h
+}
+
+def gnu_efi_arch(d):
+ import re
+ tarch = d.getVar("TARGET_ARCH")
+ if re.match("i[3456789]86", tarch):
+ return "ia32"
+ return tarch
+
+EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
+ 'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \
+ "
+
+# gnu-efi's Makefile treats prefix as toolchain prefix, so don't
+# export it.
+prefix[unexport] = "1"
+
+do_install() {
+ oe_runmake install INSTALLROOT="${D}"
+}
+
+FILES_${PN} += "${libdir}/*.lds"
+
+# 64-bit binaries are expected for EFI when targeting X32
+INSANE_SKIP_${PN}-dev_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}-dev_append_linux-muslx32 = " arch"
+
+BBCLASSEXTEND = "native"
+
+# It doesn't support sse, its make.defaults sets:
+# CFLAGS += -mno-mmx -mno-sse
+# So also remove -mfpmath=sse from TUNE_CCARGS
+TUNE_CCARGS_remove = "-mfpmath=sse"
+
+python () {
+ ccargs = d.getVar('TUNE_CCARGS').split()
+ if '-mx32' in ccargs:
+ # use x86_64 EFI ABI
+ ccargs.remove('-mx32')
+ ccargs.append('-m64')
+ d.setVar('TUNE_CCARGS', ' '.join(ccargs))
+}
diff --git a/poky/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch b/poky/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch
new file mode 100644
index 000000000..ce3238f3a
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch
@@ -0,0 +1,46 @@
+From fb7b827a56b1f92f882d0f5ef130acc968b23293 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 19:17:31 +0000
+Subject: [PATCH] Disable -mfpmath=sse as well when SSE is disabled
+
+Fixes
+
+configure:20574: i586-poky-linux-gcc -m32 -march=core2 -msse3
+-mtune=generic -mfpmath=sse
+--sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o
+conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow
+-Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g
+-falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse
+-mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector
+-mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100
+-Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include
+-DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1
+-Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
+conftest.c:1:0: error: SSE instruction set disabled, using 387
+arithmetics [-Werror]
+cc1: all warnings being treated as errors
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 26d2f33..9ce56de 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -783,7 +783,7 @@ fi
+ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
+ # Some toolchains enable these features by default, but they need
+ # registers that aren't set up properly in GRUB.
+- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
++ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -mfpmath=387"
+ fi
+
+ # GRUB doesn't use float or doubles at all. Yet some toolchains may decide
+--
+2.7.0
+
diff --git a/poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..67dc11549
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: grub-2.00/grub-core/gnulib/Makefile.am
+===================================================================
+--- grub-2.00.orig/grub-core/gnulib/Makefile.am
++++ grub-2.00/grub-core/gnulib/Makefile.am
+@@ -410,7 +410,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch b/poky/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch
new file mode 100644
index 000000000..d5bfaa177
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch
@@ -0,0 +1,56 @@
+From b512c77222a8b133d7dd71a0dcef081a921d97d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 19:28:00 +0000
+Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name
+
+Our kernel's name is bzImage, we need add it to grub.d/10_linux.in so
+that the grub-mkconfig and grub-install can work correctly.
+
+We only need add the bzImage to util/grub.d/10_linux.in, but also add it
+to util/grub.d/20_linux_xen.in to keep compatibility.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [OE specific]
+
+ util/grub.d/10_linux.in | 6 +++---
+ util/grub.d/20_linux_xen.in | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 859b608..946be5d 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -148,12 +148,12 @@ machine=`uname -m`
+ case "x$machine" in
+ xi?86 | xx86_64)
+ list=
+- for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
++ for i in /boot/bzImage-* /bzImage-* /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
+ done ;;
+- *)
++ *)
+ list=
+- for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
++ for i in /boot/bzImage-* /boot/vmlinuz-* /boot/vmlinux-* /bzImage-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" ; then list="$list $i" ; fi
+ done ;;
+ esac
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index f532fb9..1994244 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -138,7 +138,7 @@ EOF
+ }
+
+ linux_list=
+-for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
++for i in /boot/bzImage[xz]-* /bzImage[xz]-* /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+ if grub_file_is_not_garbage "$i"; then
+ basename=$(basename $i)
+ version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+--
+2.7.0
+
diff --git a/poky/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch b/poky/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch
new file mode 100644
index 000000000..fc5aa4e31
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/autogen.sh-exclude-pc.patch
@@ -0,0 +1,34 @@
+From ff8f68cc48fd3c30d55e1d570d51f2e0952c968e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 25 Jan 2014 23:49:44 -0500
+Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in
+
+Exclude the .pc from po/POTFILES.in since quilt uses "patch --backup",
+which will create the backup file under .pc, this may cause unexpected
+errors, for example, on CentOS 5.x, if the backup file is null
+(newfile), it's mode will be 000, then we will get errors when xgettext
+try to read it.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ autogen.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 7424428..843619e 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -5,7 +5,7 @@ set -e
+ export LC_COLLATE=C
+ unset LC_ALL
+
+-find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
++find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -path './.pc/*' | sort > po/POTFILES.in
+ find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
+
+ echo "Importing unicode..."
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-bsp/grub/files/cfg b/poky/meta/recipes-bsp/grub/files/cfg
new file mode 100644
index 000000000..8ca53d24d
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/cfg
@@ -0,0 +1,2 @@
+search.file ($cmdpath)/EFI/BOOT/grub.cfg root
+set prefix=($root)/EFI/BOOT
diff --git a/poky/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch b/poky/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch
new file mode 100644
index 000000000..f35df97bf
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch
@@ -0,0 +1,39 @@
+* e.g. with gentoo gcc-7.1 they define _FORTIFY_SOURCE by default with:
+ https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/7.1.0/gentoo/10_all_default-fortify-source.patch?view=markup
+ which results in following error while building grub-efi-native:
+ ./config-util.h:1504:48: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
+ || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+ ^~~~~~~~~~~~~~~
+ this part comes from gnulib and it's used only for Apple and BSD,
+ so we can ignore it, but we cannot add -Wno-error=expansion-to-defined
+ because this warning was introduced only in gcc-7 and older gcc
+ will fail with:
+ cc1: error: -Werror=expansion-to-defined: no option -Wexpansion-to-defined
+ use #pragma to work around this
+
+Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub)
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+diff -uNr grub-2.02.old/m4/extern-inline.m4 grub-2.02/m4/extern-inline.m4
+--- grub-2.02.old/m4/extern-inline.m4 2016-02-28 15:22:21.000000000 +0100
++++ grub-2.02/m4/extern-inline.m4 2017-08-22 19:26:45.213637276 +0200
+@@ -39,6 +39,10 @@
+ OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+ for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+ Assume DragonFly and FreeBSD will be similar. */
++#pragma GCC diagnostic push
++#if __GNUC__ >= 7
++#pragma GCC diagnostic ignored "-Wexpansion-to-defined"
++#endif
+ #if (((defined __APPLE__ && defined __MACH__) \
+ || defined __DragonFly__ || defined __FreeBSD__) \
+ && (defined __header_inline \
+@@ -50,6 +52,7 @@
+ && defined __GNUC__ && ! defined __cplusplus))))
+ # define _GL_EXTERN_INLINE_STDHEADER_BUG
+ #endif
++#pragma GCC diagnostic pop
+ #if ((__GNUC__ \
+ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+ : (199901L <= __STDC_VERSION__ \
diff --git a/poky/meta/recipes-bsp/grub/files/gcc8.patch b/poky/meta/recipes-bsp/grub/files/gcc8.patch
new file mode 100644
index 000000000..fa7331f1b
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/gcc8.patch
@@ -0,0 +1,74 @@
+From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001
+From: Michael Chang <mchang@suse.com>
+Date: Mon, 26 Mar 2018 16:52:34 +0800
+Subject: Fix packed-not-aligned error on GCC 8
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When building with GCC 8, there are several errors regarding packed-not-aligned.
+
+./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
+
+This patch fixes the build error by cleaning up the ambiguity of placing
+aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
+grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
+has to be packed, to ensure the structure is bit-to-bit mapped to the format
+laid on disk. I think we could blame to copy and paste error here for the
+mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
+the name suggests. :)
+
+Signed-off-by: Michael Chang <mchang@suse.com>
+Tested-by: Michael Chang <mchang@suse.com>
+Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
+Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
+
+Upstream-Status: Backport http://git.savannah.gnu.org/cgit/grub.git/commit/?id=563b1da6e6ae7af46cc8354cadb5dab416989f0a
+---
+ grub-core/fs/btrfs.c | 2 +-
+ include/grub/efiemu/runtime.h | 2 +-
+ include/grub/gpt_partition.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
+index 4849c1c..be19544 100644
+--- a/grub-core/fs/btrfs.c
++++ b/grub-core/fs/btrfs.c
+@@ -175,7 +175,7 @@ struct grub_btrfs_time
+ {
+ grub_int64_t sec;
+ grub_uint32_t nanosec;
+-} __attribute__ ((aligned (4)));
++} GRUB_PACKED;
+
+ struct grub_btrfs_inode
+ {
+diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
+index 9b6b729..36d2ded 100644
+--- a/include/grub/efiemu/runtime.h
++++ b/include/grub/efiemu/runtime.h
+@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
+
+ struct efi_variable
+ {
+- grub_efi_guid_t guid;
++ grub_efi_packed_guid_t guid;
+ grub_uint32_t namelen;
+ grub_uint32_t size;
+ grub_efi_uint32_t attributes;
+diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
+index 1b32f67..9668a68 100644
+--- a/include/grub/gpt_partition.h
++++ b/include/grub/gpt_partition.h
+@@ -28,7 +28,7 @@ struct grub_gpt_part_type
+ grub_uint16_t data2;
+ grub_uint16_t data3;
+ grub_uint8_t data4[8];
+-} __attribute__ ((aligned(8)));
++} GRUB_PACKED;
+ typedef struct grub_gpt_part_type grub_gpt_part_type_t;
+
+ #define GRUB_GPT_PARTITION_TYPE_EMPTY \
+--
+cgit v1.0-41-gc330
+
diff --git a/poky/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch b/poky/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch
new file mode 100644
index 000000000..ffc2d40d8
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/files/grub-module-explicitly-keeps-symbole-.module_license.patch
@@ -0,0 +1,58 @@
+From 7461a3de38b66edbe2f5593f9bdab9f2704d32bc Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Aug 2016 04:06:34 -0400
+Subject: [PATCH] grub module explicitly keeps symbole .module_license
+
+While using oe-core toolchain to strip grub module 'all_video.mod',
+it stripped symbol table:
+--------------
+root@localhost:~# objdump -t all_video.mod
+
+all_video.mod: file format elf64-x86-64
+
+SYMBOL TABLE:
+no symbols
+--------------
+
+It caused grub to load module all_video failed.
+--------------
+grub> insmod all_video
+error: no symbol table.
+--------------
+
+Tweak strip option to keep symbol .module_license could workaround
+the issue.
+--------------
+root@localhost:~# objdump -t all_video.mod
+
+all_video.mod: file format elf64-x86-64
+
+SYMBOL TABLE:
+0000000000000000 l d .text 0000000000000000 .text
+0000000000000000 l d .data 0000000000000000 .data
+0000000000000000 l d .module_license 0000000000000000 .module_license
+0000000000000000 l d .bss 0000000000000000 .bss
+0000000000000000 l d .moddeps 0000000000000000 .moddeps
+0000000000000000 l d .modname 0000000000000000 .modname
+--------------
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ grub-core/genmod.sh.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: grub-2.02/grub-core/genmod.sh.in
+===================================================================
+--- grub-2.02.orig/grub-core/genmod.sh.in
++++ grub-2.02/grub-core/genmod.sh.in
+@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; th
+ if test x@platform@ != xemu; then
+ @TARGET_STRIP@ --strip-unneeded \
+ -K grub_mod_init -K grub_mod_fini \
+- -K _grub_mod_init -K _grub_mod_fini \
++ -K _grub_mod_init -K _grub_mod_fini -K .module_license \
+ -R .note.gnu.gold-version -R .note.GNU-stack \
+ -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1
+ fi
diff --git a/poky/meta/recipes-bsp/grub/grub-bootconf_1.00.bb b/poky/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
new file mode 100644
index 000000000..750f8c808
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/grub-bootconf_1.00.bb
@@ -0,0 +1,29 @@
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SUMMARY = "Basic grub.cfg for use in EFI systems"
+
+RPROVIDES_${PN} += "virtual/grub-bootconf"
+
+inherit grub-efi-cfg
+
+S = "${WORKDIR}"
+
+GRUB_CFG = "${S}/grub-bootconf"
+LABELS = "boot"
+
+ROOT ?= "root=/dev/sda2"
+
+python do_configure() {
+ bb.build.exec_func('build_efi_cfg', d)
+}
+
+do_configure[vardeps] += "APPEND ROOT"
+
+do_install() {
+ install -d ${D}/boot
+ install -d ${D}/boot/EFI
+ install -d ${D}/boot/EFI/BOOT
+ install grub-bootconf ${D}/boot/EFI/BOOT/grub.cfg
+}
+
+FILES_${PN} = "/boot/EFI/BOOT/grub.cfg"
diff --git a/poky/meta/recipes-bsp/grub/grub-efi_2.02.bb b/poky/meta/recipes-bsp/grub/grub-efi_2.02.bb
new file mode 100644
index 000000000..7bfc8eece
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/grub-efi_2.02.bb
@@ -0,0 +1,109 @@
+require grub2.inc
+
+GRUBPLATFORM = "efi"
+
+DEPENDS_append_class-target = " grub-efi-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype grub-common virtual/grub-bootconf"
+
+SRC_URI += " \
+ file://cfg \
+ "
+
+S = "${WORKDIR}/grub-${PV}"
+
+# Determine the target arch for the grub modules
+python __anonymous () {
+ import re
+ target = d.getVar('TARGET_ARCH')
+ prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
+ if target == "x86_64":
+ grubtarget = 'x86_64'
+ grubimage = prefix + "bootx64.efi"
+ elif re.match('i.86', target):
+ grubtarget = 'i386'
+ grubimage = prefix + "bootia32.efi"
+ elif re.match('aarch64', target):
+ grubtarget = 'arm64'
+ grubimage = prefix + "bootaa64.efi"
+ else:
+ raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
+ d.setVar("GRUB_TARGET", grubtarget)
+ d.setVar("GRUB_IMAGE", grubimage)
+ prefix = "grub-efi-" if prefix == "" else ""
+ d.setVar("GRUB_IMAGE_PREFIX", prefix)
+}
+
+inherit deploy
+
+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
+EXTRA_OECONF += "--enable-efiemu=no"
+
+# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
+# and many other places in the grub code when compiled with some native gcc compilers (specifically, gentoo)
+CFLAGS_append_class-native = " -Wno-error=trampolines"
+
+do_mkimage() {
+ cd ${B}
+ # Search for the grub.cfg on the local boot media by using the
+ # built in cfg file provided via this recipe
+ grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
+ ${GRUB_BUILDIN}
+}
+
+addtask mkimage before do_install after do_compile
+
+do_mkimage_class-native() {
+ :
+}
+
+do_install_append_class-target() {
+ install -d ${D}/boot
+ install -d ${D}/boot/EFI
+ install -d ${D}/boot/EFI/BOOT
+ install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
+}
+
+do_install_class-native() {
+ install -d ${D}${bindir}
+ install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_class-target() {
+ oe_runmake 'DESTDIR=${D}' -C grub-core install
+
+ # Remove build host references...
+ find "${D}" -name modinfo.sh -type f -exec \
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ {} +
+}
+
+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
+ efi_gop iso9660 configfile search loadenv test"
+
+do_deploy() {
+ install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+ :
+}
+
+addtask deploy after do_install before do_build
+
+FILES_${PN} = "${libdir}/grub/${GRUB_TARGET}-efi \
+ ${datadir}/grub \
+ /boot/EFI/BOOT/${GRUB_IMAGE} \
+ "
+
+
+# 64-bit binaries are expected for the bootloader with an x32 userland
+INSANE_SKIP_${PN}_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}_append_linux-muslx32 = " arch"
+INSANE_SKIP_${PN}-dbg_append_linux-muslx32 = " arch"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-bsp/grub/grub2.inc b/poky/meta/recipes-bsp/grub/grub2.inc
new file mode 100644
index 000000000..a8f335e1f
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/grub2.inc
@@ -0,0 +1,71 @@
+SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
+
+DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
+intended to unify bootloading across x86 operating systems. In \
+addition to loading the Linux kernel, it implements the Multiboot \
+standard, which allows for flexible loading of multiple boot images."
+
+HOMEPAGE = "http://www.gnu.org/software/grub/"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
+ file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://autogen.sh-exclude-pc.patch \
+ file://grub-module-explicitly-keeps-symbole-.module_license.patch \
+ file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
+ file://fix.build.with.gcc-7.patch \
+ file://gcc8.patch \
+"
+SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d"
+SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d"
+
+DEPENDS = "flex-native bison-native"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
+COMPATIBLE_HOST_armv7a = 'null'
+COMPATIBLE_HOST_armv7ve = 'null'
+
+# configure.ac has code to set this automagically from the target tuple
+# but the OE freeform one (core2-foo-bar-linux) don't work with that.
+
+GRUBPLATFORM_arm = "uboot"
+GRUBPLATFORM_aarch64 = "efi"
+GRUBPLATFORM ??= "pc"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} \
+ --disable-grub-mkfont \
+ --program-prefix="" \
+ --enable-liblzma=no \
+ --enable-libzfs=no \
+ --enable-largefile \
+"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
+PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,libdevmapper"
+
+# grub2 creates its own set of -nostdinc / -isystem / -ffreestanding CFLAGS and
+# OE's default BUILD_CFLAGS (assigned to CFLAGS for native builds) etc, conflict
+# with that. Note that since BUILD_CFLAGS etc are not used by grub2 target
+# builds, it's safe to clear them unconditionally for both target and native.
+BUILD_CPPFLAGS = ""
+BUILD_CFLAGS = ""
+BUILD_CXXFLAGS = ""
+BUILD_LDFLAGS = ""
+
+do_configure_prepend() {
+ # The grub2 configure script uses variables such as TARGET_CFLAGS etc
+ # for its own purposes. Remove the OE versions from the environment to
+ # avoid conflicts.
+ unset TARGET_CPPFLAGS TARGET_CFLAGS TARGET_CXXFLAGS TARGET_LDFLAGS
+ ( cd ${S}
+ ${S}/autogen.sh )
+}
+
+RDEPENDS_${PN}_class-native = ""
diff --git a/poky/meta/recipes-bsp/grub/grub_2.02.bb b/poky/meta/recipes-bsp/grub/grub_2.02.bb
new file mode 100644
index 000000000..e0973759f
--- /dev/null
+++ b/poky/meta/recipes-bsp/grub/grub_2.02.bb
@@ -0,0 +1,29 @@
+require grub2.inc
+
+RDEPENDS_${PN}-common += "${PN}-editenv"
+RDEPENDS_${PN} += "diffutils freetype ${PN}-common"
+
+RPROVIDES_${PN}-editenv += "${PN}-efi-editenv"
+
+PACKAGES =+ "${PN}-editenv ${PN}-common"
+FILES_${PN}-editenv = "${bindir}/grub-editenv"
+FILES_${PN}-common = " \
+ ${bindir} \
+ ${sysconfdir} \
+ ${sbindir} \
+ ${datadir}/grub \
+"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/grub.d
+ # Remove build host references...
+ find "${D}" -name modinfo.sh -type f -exec \
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ {} +
+}
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/poky/meta/recipes-bsp/keymaps/files/GPLv2.patch b/poky/meta/recipes-bsp/keymaps/files/GPLv2.patch
new file mode 100644
index 000000000..1ee8181f1
--- /dev/null
+++ b/poky/meta/recipes-bsp/keymaps/files/GPLv2.patch
@@ -0,0 +1,347 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/poky/meta/recipes-bsp/keymaps/files/keymap.sh b/poky/meta/recipes-bsp/keymaps/files/keymap.sh
new file mode 100755
index 000000000..6ebc63426
--- /dev/null
+++ b/poky/meta/recipes-bsp/keymaps/files/keymap.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# load keymap, if existing
+
+KERNEL_MAJMIN=`uname -r | cut -d '.' -f 1,2`
+if [ -e /etc/keymap-$KERNEL_MAJMIN.map ]; then
+ loadkeys /etc/keymap-$KERNEL_MAJMIN.map
+fi
+
+if ( ls "/etc" | grep -q "keymap-extension-${KERNEL_MAJMIN}" )
+then
+ for extension in `ls -1 /etc/keymap-extension-$KERNEL_MAJMIN*`
+ do
+ loadkeys "$extension"
+ done
+fi
diff --git a/poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
new file mode 100644
index 000000000..34b208c5b
--- /dev/null
+++ b/poky/meta/recipes-bsp/keymaps/keymaps_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Keyboard maps"
+DESCRIPTION = "Keymaps and initscript to set the keymap on bootup."
+SECTION = "base"
+
+RDEPENDS_${PN} = "kbd"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PR = "r31"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit update-rc.d
+
+SRC_URI = "file://keymap.sh \
+ file://GPLv2.patch"
+
+INITSCRIPT_NAME = "keymap.sh"
+INITSCRIPT_PARAMS = "start 01 S ."
+
+S = "${WORKDIR}"
+
+do_install () {
+ # Only install the script if 'sysvinit' is in DISTRO_FEATURES
+ # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/
+ fi
+}
+
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask keymap.service
+ fi
+}
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/poky/meta/recipes-bsp/libacpi/files/ldflags.patch b/poky/meta/recipes-bsp/libacpi/files/ldflags.patch
new file mode 100644
index 000000000..a7424c39d
--- /dev/null
+++ b/poky/meta/recipes-bsp/libacpi/files/ldflags.patch
@@ -0,0 +1,41 @@
+libacpi: Remove QA warning: No GNU_HASH in the elf binary
+
+Upstream-Status: Inappropriate [other]
+ Useful within bitbake environment only.
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+---
+ Makefile | 3 ++-
+ config.mk | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -19,6 +19,7 @@ options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "CC = ${CC}"
+ @echo "SOFLAGS = ${SOFLAGS}"
++ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "LD = ${LD}"
+
+ .c.o:
+@@ -34,7 +35,7 @@ libacpi.a: ${OBJ}
+
+ libacpi.so: ${OBJ}
+ @echo LD $@
+- @${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++ @${CC} ${SOFLAGS} ${LDFLAGS} -o $@.${SOVERSION} ${OBJ}
+
+ test-libacpi: ${OBJ_test}
+ @echo LD $@
+--- libacpi-0.2.orig/config.mk
++++ libacpi-0.2/config.mk
+@@ -10,6 +10,7 @@ MANPREFIX = ${PREFIX}/share/man
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
+ ARFLAGS = cr
++LDFLAGS =
+
+ # Compiler and linker
+ CC = cc
diff --git a/poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch b/poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
new file mode 100644
index 000000000..06f20e5a7
--- /dev/null
+++ b/poky/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Fix libacpi for x32
+
+ libacpi doesn't use base_libdir for install. This patch adds
+ libdir support so that x32 libraries are installed properly.
+
+Patch Received from: H.J. Lu <hjl.tools@gmail.com>
+Updated by: Ricardo Salveti <ricardo@opensourcefoundries.com> 2018/02/03
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/05
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -42,13 +42,13 @@ install: all
+ @mkdir -p ${DESTDIR}${PREFIX}/include
+ @cp -f libacpi.h ${DESTDIR}${PREFIX}/include
+ @chmod 644 ${DESTDIR}${PREFIX}/include/libacpi.h
+- @echo installing library to ${DESTDIR}${PREFIX}/lib
+- @mkdir -p ${DESTDIR}${PREFIX}/lib
+- @cp -f libacpi.a ${DESTDIR}${PREFIX}/lib
+- @chmod 644 ${DESTDIR}${PREFIX}/lib/libacpi.a
+- @cp -f ${SONAME} ${DESTDIR}${PREFIX}/lib/
+- @chmod 644 ${DESTDIR}${PREFIX}/lib/${SONAME}
+- @ln -s ${SONAME} ${DESTDIR}${PREFIX}/lib/libacpi.so
++ @echo installing library to ${DESTDIR}${LIBDIR}
++ @mkdir -p ${DESTDIR}${LIBDIR}
++ @cp -f libacpi.a ${DESTDIR}${LIBDIR}
++ @chmod 644 ${DESTDIR}${LIBDIR}/libacpi.a
++ @cp -f ${SONAME} ${DESTDIR}${LIBDIR}/
++ @chmod 644 ${DESTDIR}${LIBDIR}/${SONAME}
++ @ln -s ${SONAME} ${DESTDIR}${LIBDIR}/libacpi.so
+ @echo installing test-libacpi to ${DESTDIR}${PREFIX}/bin
+ @mkdir -p ${DESTDIR}${PREFIX}/bin
+ @cp -f test-libacpi ${DESTDIR}${PREFIX}/bin
diff --git a/poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch b/poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch
new file mode 100644
index 000000000..c34ef34e0
--- /dev/null
+++ b/poky/meta/recipes-bsp/libacpi/files/makefile-fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+---
+ Makefile | 6 +++---
+ config.mk | 3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile 2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/Makefile 2008-09-26 10:34:53.000000000 +0200
+@@ -25,16 +25,16 @@ ${OBJ}: config.mk libacpi.h
+
+ libacpi.a: ${OBJ}
+ @echo AR $@
+- @${AR} $@ ${OBJ}
++ ${AR} ${ARFLAGS} $@ ${OBJ}
+ @${RANLIB} $@
+
+ libacpi.so: ${OBJ}
+ @echo LD $@
+- @${LD} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++ @${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
+
+ test-libacpi: ${OBJ_test}
+ @echo LD $@
+- @${LD} -o $@ ${OBJ_test} ${LDFLAGS}
++ @${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+ @strip $@
+
+ install: all
+Index: libacpi-0.2/config.mk
+===================================================================
+--- libacpi-0.2.orig/config.mk 2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/config.mk 2008-09-26 10:34:33.000000000 +0200
+@@ -9,9 +9,10 @@ MANPREFIX = ${PREFIX}/share/man
+ # flags
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
++ARFLAGS = cr
+
+ # Compiler and linker
+ CC = cc
+ LD = ${CC}
+-AR = ar cr
++AR = ar
+ RANLIB = ranlib
diff --git a/poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch b/poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
new file mode 100644
index 000000000..ef376aa31
--- /dev/null
+++ b/poky/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Used the cross strip instead of host strip to avoid this build error:
+
+| strip: Unable to recognise the format of the input file `test-libacpi'
+| make: *** [test-libacpi] Error 1
+| ERROR: oe_runmake failed
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -39,7 +39,7 @@ libacpi.so: ${OBJ}
+ test-libacpi: ${OBJ_test}
+ @echo LD $@
+ @${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+- @strip $@
++ @${STRIP} $@
+
+ install: all
+ @echo installing header to ${DESTDIR}${PREFIX}/include
diff --git a/poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb
new file mode 100644
index 000000000..5e7f7fa8e
--- /dev/null
+++ b/poky/meta/recipes-bsp/libacpi/libacpi_0.2.bb
@@ -0,0 +1,32 @@
+SUMMARY = "ACPI data gathering library"
+DESCRIPTION = "General purpose shared library for programs gathering ACPI data on Linux. \
+Thermal zones, battery infomration, fan information and AC states are implemented."
+SECTION = "base"
+HOMEPAGE = "http://www.ngolde.de/libacpi.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5"
+PR = "r6"
+
+SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \
+ file://makefile-fix.patch \
+ file://libacpi_fix_for_x32.patch \
+ file://use_correct_strip_in_cross_environment.patch \
+ file://ldflags.patch "
+
+SRC_URI[md5sum] = "05b53dd7bead66dda35fec502b91066c"
+SRC_URI[sha256sum] = "13086e31d428b9c125954d48ac497b754bbbce2ef34ea29ecd903e82e25bad29"
+
+UPSTREAM_CHECK_URI = "http://www.ngolde.de/libacpi.html"
+
+inherit lib_package
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+
+CFLAGS += "-fPIC"
+EXTRA_OEMAKE = '-e MAKEFLAGS= STRIP="echo"'
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} PREFIX=${exec_prefix} LIBDIR=${libdir}
+}
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch
new file mode 100644
index 000000000..682cf416e
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch
@@ -0,0 +1,19 @@
+Add a description to the AC_DEFINE for LOCALEDIR so that it appears in config.h
+and silences a fatal warning.
+
+Upstream-Status:Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.in b/configure.in
+index c10460c..aa20263 100644
+--- a/configure.in
++++ b/configure.in
+@@ -258,7 +258,7 @@ AC_SUBST(LIBS)
+
+ AM_GNU_GETTEXT
+
+-AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
++AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME",[locale directory])
+
+ AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile m4/Makefile \
+ man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch
new file mode 100644
index 000000000..394519855
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- lrzsz-0.12.20/acinclude.m4~autotools 1998-12-27 17:08:59.000000000 -0500
++++ lrzsz-0.12.20/acinclude.m4 2004-05-09 22:26:19.000000000 -0400
+@@ -1,12 +1,11 @@
+ dnl AC_REPLACE_GNU_GETOPT
+-AC_DEFUN(AC_REPLACE_GNU_GETOPT,
+-[AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
+-AC_SUBST(LIBOBJS)dnl
+-])
++AC_DEFUN([AC_REPLACE_GNU_GETOPT],
++[AC_CHECK_FUNC(getopt_long, , [AC_LIBOBJ([getopt1])
++AC_LIBOBJ([getopt])dnl])])
+
+ dnl
+ dnl taken from taylor uucp
+-AC_DEFUN(LRZSZ_ERRNO_DECL,[
++AC_DEFUN([LRZSZ_ERRNO_DECL],[
+ AC_MSG_CHECKING(for errno declaration)
+ AC_CACHE_VAL(lrzsz_cv_decl_errno,
+ [AC_TRY_COMPILE([#include <errno.h>], [int i = errno; errno = 1;],
+@@ -23,7 +21,7 @@
+ ])
+
+ dnl LRZSZ_TYPE_SPEED_T
+-AC_DEFUN(LRZSZ_TYPE_SPEED_T,[
++AC_DEFUN([LRZSZ_TYPE_SPEED_T],[
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([LRZSZ_HEADERS_TERM_IO])dnl
+ AC_MSG_CHECKING(for speed_t)
+@@ -61,7 +59,7 @@
+ fi
+ ])
+
+-AC_DEFUN(lrzsz_HEADER_SYS_SELECT,
++AC_DEFUN([lrzsz_HEADER_SYS_SELECT],
+ [AC_CACHE_CHECK([whether sys/time.h and sys/select.h may both be included],
+ lrzsz_cv_header_sys_select,
+ [AC_TRY_COMPILE([#include <sys/types.h>
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch
new file mode 100644
index 000000000..1a24a1f05
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch
@@ -0,0 +1,21884 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- lrzsz-0.12.20.safe/ABOUT-NLS 1998-04-26 09:22:30.000000000 -0400
++++ lrzsz-0.12.20/ABOUT-NLS 2004-09-12 14:40:34.323752952 -0400
+@@ -1,14 +1,14 @@
+ Notes on the Free Translation Project
+ *************************************
+
+- Free software is going international! The Free Translation Project
+-is a way to get maintainers of free software, translators, and users all
++Free software is going international! The Free Translation Project is
++a way to get maintainers of free software, translators, and users all
+ together, so that will gradually become able to speak many languages.
+ A few packages already provide translations for their messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+ assume that the distributed package does use GNU `gettext' internally,
+-itself available at your nearest GNU archive site. But you do *not*
++itself available at your nearest GNU archive site. But you do _not_
+ need to install GNU `gettext' prior to configuring, installing or using
+ this package with messages translated.
+
+@@ -22,10 +22,10 @@
+ `gettext' which is used. The information can be found in the
+ `intl/VERSION' file, in internationalized packages.
+
+-One advise in advance
+-=====================
++Quick configuration advice
++==========================
+
+- If you want to exploit the full power of internationalization, you
++If you want to exploit the full power of internationalization, you
+ should configure it using
+
+ ./configure --with-included-gettext
+@@ -34,42 +34,40 @@
+ package, despite the existence of internationalizing capabilities in the
+ operating system where this package is being installed. So far, only
+ the `gettext' implementation in the GNU C library version 2 provides as
+-many features (such as locale alias or message inheritance) as the
+-implementation here. It is also not possible to offer this additional
+-functionality on top of a `catgets' implementation. Future versions of
+-GNU `gettext' will very likely convey even more functionality. So it
+-might be a good idea to change to GNU `gettext' as soon as possible.
++many features (such as locale alias, message inheritance, automatic
++charset conversion or plural form handling) as the implementation here.
++It is also not possible to offer this additional functionality on top
++of a `catgets' implementation. Future versions of GNU `gettext' will
++very likely convey even more functionality. So it might be a good idea
++to change to GNU `gettext' as soon as possible.
+
+- So you need not provide this option if you are using GNU libc 2 or
++ So you need _not_ provide this option if you are using GNU libc 2 or
+ you have installed a recent copy of the GNU gettext package with the
+ included `libintl'.
+
+ INSTALL Matters
+ ===============
+
+- Some packages are "localizable" when properly installed; the
+-programs they contain can be made to speak your own native language.
+-Most such packages use GNU `gettext'. Other packages have their own
+-ways to internationalization, predating GNU `gettext'.
++Some packages are "localizable" when properly installed; the programs
++they contain can be made to speak your own native language. Most such
++packages use GNU `gettext'. Other packages have their own ways to
++internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+-messages. It will automatically detect whether the system provides
+-usable `catgets' (if using this is selected by the installer) or
+-`gettext' functions. If neither is available, the GNU `gettext' own
++messages. It will automatically detect whether the system already
++provides the GNU `gettext' functions. If not, the GNU `gettext' own
+ library will be used. This library is wholly contained within this
+ package, usually in the `intl/' subdirectory, so prior installation of
+-the GNU `gettext' package is *not* required. Installers may use
++the GNU `gettext' package is _not_ required. Installers may use
+ special options at configuration time for changing the default
+ behaviour. The commands:
+
+ ./configure --with-included-gettext
+- ./configure --with-catgets
+ ./configure --disable-nls
+
+-will respectively bypass any pre-existing `catgets' or `gettext' to use
+-the internationalizing routines provided within this package, enable
+-the use of the `catgets' functions (if found on the locale system), or
+-else, *totally* disable translation of messages.
++will respectively bypass any pre-existing `gettext' to use the
++internationalizing routines provided within this package, or else,
++_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+ configure without an option for your new package, `configure' will
+@@ -83,18 +81,10 @@
+
+ to prevent auto-detection.
+
+- By default the configuration process will not test for the `catgets'
+-function and therefore they will not be used. The reasons are already
+-given above: the emulation on top of `catgets' cannot provide all the
+-extensions provided by the GNU `gettext' library. If you nevertheless
+-want to use the `catgets' functions use
+-
+- ./configure --with-catgets
+-
+-to enable the test for `catgets' (this causes no harm if `catgets' is
+-not available on your system). If you really select this option we
+-would like to hear about the reasons because we cannot think of any
+-good one ourself.
++ The configuration process will not test for the `catgets' function
++and therefore it will not be used. The reason is that even an
++emulation of `gettext' on top of `catgets' could not provide all the
++extensions of the GNU `gettext' library.
+
+ Internationalized packages have usually many `po/LL.po' files, where
+ LL gives an ISO 639 two-letter code identifying the language. Unless
+@@ -108,57 +98,73 @@
+ Using This Package
+ ==================
+
+- As a user, if your language has been installed for this package, you
++As a user, if your language has been installed for this package, you
+ only have to set the `LANG' environment variable to the appropriate
+-ISO 639 `LL' two-letter code prior to using the programs in the
+-package. For example, let's suppose that you speak German. At the
+-shell prompt, merely execute `setenv LANG de' (in `csh'),
+-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
+-can be done from your `.login' or `.profile' file, once and for all.
++`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
++and `CC' is an ISO 3166 two-letter country code. For example, let's
++suppose that you speak German and live in Germany. At the shell
++prompt, merely execute `setenv LANG de_DE' (in `csh'),
++`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
++This can be done from your `.login' or `.profile' file, once and for
++all.
+
+- An operating system might already offer message localization for
+-many of its programs, while other programs have been installed locally
+-with the full capabilities of GNU `gettext'. Just using `gettext'
+-extended syntax for `LANG' would break proper localization of already
+-available operating system programs. In this case, users should set
+-both `LANGUAGE' and `LANG' variables in their environment, as programs
+-using GNU `gettext' give preference to `LANGUAGE'. For example, some
+-Swedish users would rather read translations in German than English for
+-when Swedish is not available. This is easily accomplished by setting
+-`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
++ You might think that the country code specification is redundant.
++But in fact, some languages have dialects in different countries. For
++example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
++country code serves to distinguish the dialects.
++
++ The locale naming convention of `LL_CC', with `LL' denoting the
++language and `CC' denoting the country, is the one use on systems based
++on GNU libc. On other systems, some variations of this scheme are
++used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
++locales supported by your system for your country by running the command
++`locale -a | grep '^LL''.
++
++ Not all programs have translations for all languages. By default, an
++English message is shown in place of a nonexistent translation. If you
++understand other languages, you can set up a priority list of languages.
++This is done through a different environment variable, called
++`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
++for the purpose of message handling, but you still need to have `LANG'
++set to the primary language; this is required by other parts of the
++system libraries. For example, some Swedish users who would rather
++read translations in German than English for when Swedish is not
++available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
++
++ Special advice for Norwegian users: The language code for Norwegian
++bokma*l changed from `no' to `nb' recently (in 2003). During the
++transition period, while some message catalogs for this language are
++installed under `nb' and some older ones under `no', it's recommended
++for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
++older translations are used.
++
++ In the `LANGUAGE' environment variable, but not in the `LANG'
++environment variable, `LL_CC' combinations can be abbreviated as `LL'
++to denote the language's main dialect. For example, `de' is equivalent
++to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
++(Portuguese as spoken in Portugal) in this context.
+
+ Translating Teams
+ =================
+
+- For the Free Translation Project to be a success, we need interested
++For the Free Translation Project to be a success, we need interested
+ people who like their own language and write it well, and who are also
+ able to synergize with other translators speaking the same language.
+-Each translation team has its own mailing list, courtesy of Linux
+-International. You may reach your translation team at the address
+-`LL@li.org', replacing LL by the two-letter ISO 639 code for your
+-language. Language codes are *not* the same as the country codes given
+-in ISO 3166. The following translation teams exist, as of August 1997:
+-
+- Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
+- Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
+- `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
+- Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
+- `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
+- Swedish `sv', and Turkish `tr'.
+-
+-For example, you may reach the Chinese translation team by writing to
+-`zh@li.org'.
++Each translation team has its own mailing list. The up-to-date list of
++teams can be found at the Free Translation Project's homepage,
++`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
++area.
+
+- If you'd like to volunteer to *work* at translating messages, you
++ If you'd like to volunteer to _work_ at translating messages, you
+ should become a member of the translating team for your own language.
+-The subscribing address is *not* the same as the list itself, it has
++The subscribing address is _not_ the same as the list itself, it has
+ `-request' appended. For example, speakers of Swedish can send a
+ message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+-*actively* in translations, or at solving translational difficulties,
++_actively_ in translations, or at solving translational difficulties,
+ rather than merely lurking around. If your team does not exist yet and
+ you want to start one, or if you are unsure about what to do or how to
+ get started, please write to `translation@iro.umontreal.ca' to reach the
+@@ -171,43 +177,559 @@
+ Available Packages
+ ==================
+
+- Languages are not equally supported in all packages. The following
+-matrix shows the current state of internationalization, as of August
+-1997. The matrix shows, in regard of each package, for which languages
+-PO files have been submitted to translation coordination.
++Languages are not equally supported in all packages. The following
++matrix shows the current state of internationalization, as of January
++2004. The matrix shows, in regard of each package, for which languages
++PO files have been submitted to translation coordination, with a
++translation percentage of at least 50%.
+
+- Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
+- .-------------------------------------------------.
+- bash | [] [] [] | 3
+- bison | [] [] [] | 3
+- clisp | [] [] [] [] | 4
+- cpio | [] [] [] [] [] | 5
+- diffutils | [] [] [] [] [] | 5
+- enscript | [] [] [] [] [] [] | 6
+- fileutils | [] [] [] [] [] [] [] [] [] [] | 10
+- findutils | [] [] [] [] [] [] [] [] | 8
+- flex | [] [] [] [] | 4
+- gcal | [] [] [] [] [] | 5
+- gettext | [] [] [] [] [] [] [] [] [] [] | 11
+- grep | [] [] [] [] [] [] [] [] [] | 9
+- hello | [] [] [] [] [] [] [] [] [] [] | 10
+- id-utils | [] [] [] | 3
+- indent | [] [] [] [] | 4
+- libc | [] [] [] [] [] [] [] | 7
+- m4 | [] [] [] [] [] | 5
+- make | [] [] [] [] [] [] | 6
+- music | [] [] | 2
+- ptx | [] [] [] [] [] [] [] [] | 8
+- recode | [] [] [] [] [] [] [] [] [] | 9
+- sh-utils | [] [] [] [] [] [] [] | 7
+- sharutils | [] [] [] [] [] | 5
+- tar | [] [] [] [] [] [] [] [] [] [] | 10
+- texinfo | [] | 1
+- textutils | [] [] [] [] [] [] [] [] [] | 9
+- wdiff | [] [] [] [] [] [] [] [] | 8
+- `-------------------------------------------------'
+- 16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
+- 27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
++ Ready PO files af am ar az be bg bs ca cs da de el en en_GB eo es
++ +----------------------------------------------------+
++ a2ps | [] [] [] [] |
++ aegis | () |
++ ant-phone | () |
++ anubis | |
++ ap-utils | |
++ aspell | [] |
++ bash | [] [] [] [] |
++ batchelor | |
++ bfd | [] [] |
++ binutils | [] [] |
++ bison | [] [] [] |
++ bluez-pin | [] [] [] |
++ clisp | |
++ clisp | [] [] [] |
++ console-tools | [] [] |
++ coreutils | [] [] [] [] |
++ cpio | [] [] [] |
++ darkstat | [] () [] |
++ diffutils | [] [] [] [] [] [] [] |
++ e2fsprogs | [] [] [] |
++ enscript | [] [] [] [] |
++ error | [] [] [] [] [] |
++ fetchmail | [] () [] [] [] [] |
++ fileutils | [] [] [] |
++ findutils | [] [] [] [] [] [] [] |
++ flex | [] [] [] [] |
++ fslint | |
++ gas | [] |
++ gawk | [] [] [] [] |
++ gbiff | [] |
++ gcal | [] |
++ gcc | [] [] |
++ gettext | [] [] [] [] [] |
++ gettext-examples | [] [] [] [] |
++ gettext-runtime | [] [] [] [] [] |
++ gettext-tools | [] [] [] |
++ gimp-print | [] [] [] [] [] |
++ gliv | |
++ glunarclock | [] [] |
++ gnubiff | [] |
++ gnucash | [] () [] [] |
++ gnucash-glossary | [] () [] |
++ gnupg | [] () [] [] [] [] |
++ gpe-aerial | [] |
++ gpe-beam | [] [] |
++ gpe-calendar | [] [] |
++ gpe-clock | [] [] |
++ gpe-conf | [] [] |
++ gpe-contacts | [] [] |
++ gpe-edit | [] |
++ gpe-go | [] |
++ gpe-login | [] [] |
++ gpe-ownerinfo | [] [] |
++ gpe-sketchbook | [] [] |
++ gpe-su | [] [] |
++ gpe-taskmanager | [] [] |
++ gpe-timesheet | [] |
++ gpe-today | [] [] |
++ gpe-todo | [] [] |
++ gphoto2 | [] [] [] [] |
++ gprof | [] [] [] |
++ gpsdrive | () () () |
++ gramadoir | [] |
++ grep | [] [] [] [] [] [] |
++ gretl | [] |
++ gtick | [] () |
++ hello | [] [] [] [] [] [] |
++ id-utils | [] [] |
++ indent | [] [] [] [] |
++ iso_3166 | [] [] [] [] [] [] [] [] [] [] |
++ iso_3166_1 | [] [] [] [] [] [] |
++ iso_3166_2 | |
++ iso_3166_3 | [] |
++ iso_4217 | [] [] [] [] |
++ iso_639 | |
++ jpilot | [] [] [] |
++ jtag | |
++ jwhois | [] |
++ kbd | [] [] [] [] [] |
++ latrine | () |
++ ld | [] [] |
++ libc | [] [] [] [] [] [] |
++ libgpewidget | [] [] |
++ libiconv | [] [] [] [] [] |
++ lifelines | [] () |
++ lilypond | [] |
++ lingoteach | |
++ lingoteach_lessons | () () |
++ lynx | [] [] [] [] |
++ m4 | [] [] [] [] |
++ mailutils | [] [] |
++ make | [] [] [] |
++ man-db | [] () [] [] () |
++ minicom | [] [] [] |
++ mysecretdiary | [] [] [] |
++ nano | [] () [] [] [] |
++ nano_1_0 | [] () [] [] [] |
++ opcodes | [] |
++ parted | [] [] [] [] [] |
++ ptx | [] [] [] [] [] |
++ python | |
++ radius | [] |
++ recode | [] [] [] [] [] [] [] |
++ rpm | [] [] |
++ screem | |
++ scrollkeeper | [] [] [] [] [] [] |
++ sed | [] [] [] [] [] [] |
++ sh-utils | [] [] [] |
++ shared-mime-info | |
++ sharutils | [] [] [] [] [] [] |
++ silky | () |
++ skencil | [] () [] |
++ sketch | [] () [] |
++ soundtracker | [] [] [] |
++ sp | [] |
++ tar | [] [] [] [] |
++ texinfo | [] [] [] |
++ textutils | [] [] [] [] |
++ tin | () () |
++ tp-robot | |
++ tuxpaint | [] [] [] [] [] [] [] |
++ unicode-han-tra... | |
++ unicode-transla... | |
++ util-linux | [] [] [] [] [] |
++ vorbis-tools | [] [] [] [] |
++ wastesedge | () |
++ wdiff | [] [] [] [] |
++ wget | [] [] [] [] [] [] |
++ xchat | [] [] [] [] |
++ xfree86_xkb_xml | [] [] |
++ xpad | [] |
++ +----------------------------------------------------+
++ af am ar az be bg bs ca cs da de el en en_GB eo es
++ 4 0 0 1 9 4 1 40 41 60 78 17 1 5 13 68
++
++ et eu fa fi fr ga gl he hr hu id is it ja ko lg
++ +-------------------------------------------------+
++ a2ps | [] [] [] () () |
++ aegis | |
++ ant-phone | [] |
++ anubis | [] |
++ ap-utils | [] |
++ aspell | [] [] |
++ bash | [] [] |
++ batchelor | [] [] |
++ bfd | [] |
++ binutils | [] [] |
++ bison | [] [] [] [] |
++ bluez-pin | [] [] [] [] [] |
++ clisp | |
++ clisp | [] |
++ console-tools | |
++ coreutils | [] [] [] [] [] [] |
++ cpio | [] [] [] [] |
++ darkstat | () [] [] [] |
++ diffutils | [] [] [] [] [] [] [] |
++ e2fsprogs | |
++ enscript | [] [] |
++ error | [] [] [] [] |
++ fetchmail | [] |
++ fileutils | [] [] [] [] [] [] |
++ findutils | [] [] [] [] [] [] [] [] [] [] [] |
++ flex | [] [] [] |
++ fslint | [] |
++ gas | [] |
++ gawk | [] [] [] |
++ gbiff | [] |
++ gcal | [] |
++ gcc | [] |
++ gettext | [] [] [] |
++ gettext-examples | [] [] |
++ gettext-runtime | [] [] [] [] [] |
++ gettext-tools | [] [] [] |
++ gimp-print | [] [] |
++ gliv | () |
++ glunarclock | [] [] [] [] |
++ gnubiff | [] |
++ gnucash | () [] |
++ gnucash-glossary | [] |
++ gnupg | [] [] [] [] [] [] [] |
++ gpe-aerial | [] |
++ gpe-beam | [] |
++ gpe-calendar | [] [] [] |
++ gpe-clock | [] |
++ gpe-conf | [] |
++ gpe-contacts | [] [] |
++ gpe-edit | [] [] |
++ gpe-go | [] |
++ gpe-login | [] [] |
++ gpe-ownerinfo | [] [] [] |
++ gpe-sketchbook | [] |
++ gpe-su | [] |
++ gpe-taskmanager | [] |
++ gpe-timesheet | [] [] [] |
++ gpe-today | [] [] |
++ gpe-todo | [] [] |
++ gphoto2 | [] [] [] |
++ gprof | [] [] |
++ gpsdrive | () () () |
++ gramadoir | [] [] |
++ grep | [] [] [] [] [] [] [] [] [] [] [] |
++ gretl | [] [] |
++ gtick | [] [] [] |
++ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
++ id-utils | [] [] [] [] |
++ indent | [] [] [] [] [] [] [] [] [] |
++ iso_3166 | [] [] [] [] [] [] [] |
++ iso_3166_1 | [] [] [] [] [] |
++ iso_3166_2 | |
++ iso_3166_3 | |
++ iso_4217 | [] [] [] [] [] [] |
++ iso_639 | |
++ jpilot | [] () |
++ jtag | [] |
++ jwhois | [] [] [] [] |
++ kbd | [] |
++ latrine | [] |
++ ld | [] |
++ libc | [] [] [] [] [] [] |
++ libgpewidget | [] [] [] [] |
++ libiconv | [] [] [] [] [] [] [] [] [] |
++ lifelines | () |
++ lilypond | [] |
++ lingoteach | [] [] |
++ lingoteach_lessons | |
++ lynx | [] [] [] [] |
++ m4 | [] [] [] [] |
++ mailutils | |
++ make | [] [] [] [] [] [] |
++ man-db | () () |
++ minicom | [] [] [] [] |
++ mysecretdiary | [] [] |
++ nano | [] [] [] [] |
++ nano_1_0 | [] [] [] [] |
++ opcodes | [] |
++ parted | [] [] [] |
++ ptx | [] [] [] [] [] [] [] |
++ python | |
++ radius | [] |
++ recode | [] [] [] [] [] [] |
++ rpm | [] [] |
++ screem | |
++ scrollkeeper | [] |
++ sed | [] [] [] [] [] [] [] [] [] |
++ sh-utils | [] [] [] [] [] [] [] |
++ shared-mime-info | [] [] [] |
++ sharutils | [] [] [] [] [] |
++ silky | () [] () () |
++ skencil | [] |
++ sketch | [] |
++ soundtracker | [] [] |
++ sp | [] () |
++ tar | [] [] [] [] [] [] [] [] [] |
++ texinfo | [] [] [] [] |
++ textutils | [] [] [] [] [] [] |
++ tin | [] () |
++ tp-robot | [] |
++ tuxpaint | [] [] [] [] [] [] [] [] [] |
++ unicode-han-tra... | |
++ unicode-transla... | [] [] |
++ util-linux | [] [] [] [] () [] |
++ vorbis-tools | [] |
++ wastesedge | () |
++ wdiff | [] [] [] [] [] [] |
++ wget | [] [] [] [] [] [] [] |
++ xchat | [] [] [] |
++ xfree86_xkb_xml | [] [] |
++ xpad | [] [] |
++ +-------------------------------------------------+
++ et eu fa fi fr ga gl he hr hu id is it ja ko lg
++ 22 2 1 26 106 28 24 8 10 41 33 1 26 33 12 0
++
++ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
++ +-----------------------------------------------------+
++ a2ps | [] [] () () [] [] [] |
++ aegis | () () () |
++ ant-phone | [] [] |
++ anubis | [] [] [] [] [] [] |
++ ap-utils | [] () [] |
++ aspell | [] |
++ bash | [] [] [] |
++ batchelor | [] |
++ bfd | [] |
++ binutils | [] |
++ bison | [] [] [] [] [] |
++ bluez-pin | [] [] [] |
++ clisp | |
++ clisp | [] |
++ console-tools | [] |
++ coreutils | [] [] |
++ cpio | [] [] [] [] [] |
++ darkstat | [] [] [] [] |
++ diffutils | [] [] [] [] [] [] |
++ e2fsprogs | [] |
++ enscript | [] [] [] [] |
++ error | [] [] [] |
++ fetchmail | [] [] () [] |
++ fileutils | [] [] [] |
++ findutils | [] [] [] [] [] |
++ flex | [] [] [] [] |
++ fslint | [] [] |
++ gas | |
++ gawk | [] [] [] |
++ gbiff | [] [] |
++ gcal | |
++ gcc | |
++ gettext | [] [] [] |
++ gettext-examples | [] [] [] |
++ gettext-runtime | [] [] [] [] |
++ gettext-tools | [] [] |
++ gimp-print | [] |
++ gliv | [] [] [] |
++ glunarclock | [] [] [] [] |
++ gnubiff | [] |
++ gnucash | [] [] () [] |
++ gnucash-glossary | [] [] |
++ gnupg | [] |
++ gpe-aerial | [] [] [] [] |
++ gpe-beam | [] [] [] [] |
++ gpe-calendar | [] [] [] [] |
++ gpe-clock | [] [] [] [] |
++ gpe-conf | [] [] [] [] |
++ gpe-contacts | [] [] [] [] |
++ gpe-edit | [] [] [] [] |
++ gpe-go | [] [] [] |
++ gpe-login | [] [] [] [] |
++ gpe-ownerinfo | [] [] [] [] |
++ gpe-sketchbook | [] [] [] [] |
++ gpe-su | [] [] [] [] |
++ gpe-taskmanager | [] [] [] [] |
++ gpe-timesheet | [] [] [] [] |
++ gpe-today | [] [] [] [] |
++ gpe-todo | [] [] [] [] |
++ gphoto2 | [] |
++ gprof | [] [] |
++ gpsdrive | () () [] |
++ gramadoir | () [] |
++ grep | [] [] [] [] [] |
++ gretl | |
++ gtick | [] [] [] |
++ hello | [] [] [] [] [] [] [] [] [] [] |
++ id-utils | [] [] [] [] |
++ indent | [] [] [] [] |
++ iso_3166 | [] [] [] |
++ iso_3166_1 | [] [] |
++ iso_3166_2 | |
++ iso_3166_3 | [] |
++ iso_4217 | [] [] [] [] [] [] [] [] |
++ iso_639 | [] |
++ jpilot | () () |
++ jtag | |
++ jwhois | [] [] [] [] () |
++ kbd | [] [] [] |
++ latrine | [] |
++ ld | |
++ libc | [] [] [] [] |
++ libgpewidget | [] [] [] |
++ libiconv | [] [] [] [] [] |
++ lifelines | |
++ lilypond | |
++ lingoteach | |
++ lingoteach_lessons | |
++ lynx | [] [] [] |
++ m4 | [] [] [] [] [] |
++ mailutils | [] [] [] |
++ make | [] [] [] [] |
++ man-db | [] |
++ minicom | [] [] [] [] |
++ mysecretdiary | [] [] [] |
++ nano | [] [] [] [] [] |
++ nano_1_0 | [] [] [] [] [] [] |
++ opcodes | [] [] |
++ parted | [] [] [] [] |
++ ptx | [] [] [] [] [] [] [] [] |
++ python | |
++ radius | [] [] |
++ recode | [] [] [] [] |
++ rpm | [] [] [] |
++ screem | |
++ scrollkeeper | [] [] [] [] [] |
++ sed | [] [] [] |
++ sh-utils | [] [] |
++ shared-mime-info | [] [] |
++ sharutils | [] [] |
++ silky | () |
++ skencil | [] [] |
++ sketch | [] [] |
++ soundtracker | |
++ sp | |
++ tar | [] [] [] [] [] [] |
++ texinfo | [] [] [] [] |
++ textutils | [] [] |
++ tin | |
++ tp-robot | [] |
++ tuxpaint | [] [] [] [] [] [] [] [] |
++ unicode-han-tra... | |
++ unicode-transla... | |
++ util-linux | [] [] [] |
++ vorbis-tools | [] [] [] |
++ wastesedge | |
++ wdiff | [] [] [] [] [] |
++ wget | [] [] [] |
++ xchat | [] [] [] |
++ xfree86_xkb_xml | [] [] |
++ xpad | [] [] |
++ +-----------------------------------------------------+
++ lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
++ 1 2 0 3 12 0 10 69 6 7 1 40 26 36 76 63
++
++ sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
++ +-----------------------------------------------------+
++ a2ps | [] [] [] [] | 16
++ aegis | | 0
++ ant-phone | | 3
++ anubis | [] [] | 9
++ ap-utils | () | 3
++ aspell | | 4
++ bash | | 9
++ batchelor | | 3
++ bfd | [] [] | 6
++ binutils | [] [] [] | 8
++ bison | [] [] | 14
++ bluez-pin | [] [] [] | 14
++ clisp | | 0
++ clisp | | 5
++ console-tools | | 3
++ coreutils | [] [] [] [] | 16
++ cpio | [] [] | 14
++ darkstat | [] [] [] () () | 12
++ diffutils | [] [] [] | 23
++ e2fsprogs | [] [] | 6
++ enscript | [] [] | 12
++ error | [] [] [] | 15
++ fetchmail | [] [] | 11
++ fileutils | [] [] [] [] [] | 17
++ findutils | [] [] [] [] [] [] | 29
++ flex | [] [] | 13
++ fslint | | 3
++ gas | [] | 3
++ gawk | [] [] | 12
++ gbiff | | 4
++ gcal | [] [] | 4
++ gcc | [] | 4
++ gettext | [] [] [] [] [] | 16
++ gettext-examples | [] [] [] [] [] | 14
++ gettext-runtime | [] [] [] [] [] [] [] [] | 22
++ gettext-tools | [] [] [] [] [] [] | 14
++ gimp-print | [] [] | 10
++ gliv | | 3
++ glunarclock | [] [] [] | 13
++ gnubiff | | 3
++ gnucash | [] [] | 9
++ gnucash-glossary | [] [] [] | 8
++ gnupg | [] [] [] [] | 17
++ gpe-aerial | [] | 7
++ gpe-beam | [] | 8
++ gpe-calendar | [] [] [] [] | 13
++ gpe-clock | [] [] [] | 10
++ gpe-conf | [] [] | 9
++ gpe-contacts | [] [] [] | 11
++ gpe-edit | [] [] [] [] [] | 12
++ gpe-go | | 5
++ gpe-login | [] [] [] [] [] | 13
++ gpe-ownerinfo | [] [] [] [] | 13
++ gpe-sketchbook | [] [] | 9
++ gpe-su | [] [] [] | 10
++ gpe-taskmanager | [] [] [] | 10
++ gpe-timesheet | [] [] [] [] | 12
++ gpe-today | [] [] [] [] [] | 13
++ gpe-todo | [] [] [] [] | 12
++ gphoto2 | [] [] [] | 11
++ gprof | [] [] | 9
++ gpsdrive | [] [] | 3
++ gramadoir | [] | 5
++ grep | [] [] [] [] | 26
++ gretl | | 3
++ gtick | | 7
++ hello | [] [] [] [] [] | 34
++ id-utils | [] [] | 12
++ indent | [] [] [] [] | 21
++ iso_3166 | [] [] [] [] [] [] [] | 27
++ iso_3166_1 | [] [] [] | 16
++ iso_3166_2 | | 0
++ iso_3166_3 | | 2
++ iso_4217 | [] [] [] [] [] [] | 24
++ iso_639 | | 1
++ jpilot | [] [] [] [] [] | 9
++ jtag | [] | 2
++ jwhois | () [] [] | 11
++ kbd | [] [] | 11
++ latrine | | 2
++ ld | [] [] | 5
++ libc | [] [] [] [] | 20
++ libgpewidget | [] [] [] [] | 13
++ libiconv | [] [] [] [] [] [] [] [] | 27
++ lifelines | [] | 2
++ lilypond | [] | 3
++ lingoteach | | 2
++ lingoteach_lessons | () | 0
++ lynx | [] [] [] | 14
++ m4 | [] [] | 15
++ mailutils | | 5
++ make | [] [] [] | 16
++ man-db | [] | 5
++ minicom | | 11
++ mysecretdiary | [] [] | 10
++ nano | [] [] [] [] | 17
++ nano_1_0 | [] [] [] | 17
++ opcodes | [] [] | 6
++ parted | [] [] [] | 15
++ ptx | [] [] | 22
++ python | | 0
++ radius | | 4
++ recode | [] [] [] | 20
++ rpm | [] [] | 9
++ screem | [] [] | 2
++ scrollkeeper | [] [] [] | 15
++ sed | [] [] [] [] [] [] | 24
++ sh-utils | [] [] | 14
++ shared-mime-info | [] [] | 7
++ sharutils | [] [] [] [] | 17
++ silky | () | 3
++ skencil | [] | 6
++ sketch | [] | 6
++ soundtracker | [] [] | 7
++ sp | [] | 3
++ tar | [] [] [] [] [] | 24
++ texinfo | [] [] [] | 14
++ textutils | [] [] [] [] | 16
++ tin | | 1
++ tp-robot | | 2
++ tuxpaint | [] [] [] [] [] | 29
++ unicode-han-tra... | | 0
++ unicode-transla... | | 2
++ util-linux | [] [] | 15
++ vorbis-tools | | 8
++ wastesedge | | 0
++ wdiff | [] [] [] | 18
++ wget | [] [] [] [] [] [] [] [] | 24
++ xchat | [] [] [] [] [] | 15
++ xfree86_xkb_xml | [] [] [] [] [] | 11
++ xpad | | 5
++ +-----------------------------------------------------+
++ 63 teams sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
++ 131 domains 47 19 28 83 0 0 59 13 1 1 11 0 22 22 0 1373
+
+ Some counters in the preceding matrix are higher than the number of
+ visible blocks let us expect. This is because a few extra PO files are
+@@ -220,6 +742,27 @@
+ lag between the mere existence a PO file and its wide availability in a
+ distribution.
+
+- If August 1997 seems to be old, you may fetch a more recent copy of
+-this `ABOUT-NLS' file on most GNU archive sites.
++ If January 2004 seems to be old, you may fetch a more recent copy of
++this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
++matrix with full percentage details can be found at
++`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
++
++Using `gettext' in new packages
++===============================
++
++If you are writing a freely available program and want to
++internationalize it you are welcome to use GNU `gettext' in your
++package. Of course you have to respect the GNU Library General Public
++License which covers the use of the GNU `gettext' library. This means
++in particular that even non-free programs can use `libintl' as a shared
++library, whereas only free software can use `libintl' as a static
++library or use modified versions of `libintl'.
++
++ Once the sources are changed appropriately and the setup can handle
++the use of `gettext' the only thing missing are the translations. The
++Free Translation Project is also available for packages which are not
++developed inside the GNU project. Therefore the information given above
++applies also for every other Free Software Project. Contact
++`translation@iro.umontreal.ca' to make the `.pot' files available to
++the translation teams.
+
+--- lrzsz-0.12.20.safe/ChangeLog 1998-12-29 17:49:56.000000000 -0500
++++ lrzsz-0.12.20/ChangeLog 2004-09-12 14:40:35.846521456 -0400
+@@ -1,3 +1,11 @@
++2004-09-12 gettextize <bug-gnu-gettext@gnu.org>
++
++ * Makefile.am (ACLOCAL_AMFLAGS): New variable.
++ (EXTRA_DIST): Add config.rpath.
++ * configure.in (AC_OUTPUT): Add m4/Makefile.
++ (AC_OUTPUT): Remove command that created po/Makefile.
++ (AC_LINK_FILES): Remove invocation.
++
+ 1998-12-29 Uwe Ohse <uwe@ohse.de>
+
+ * src/lrz.c: removed stpcpy call.
+--- lrzsz-0.12.20.safe/config.rpath 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/config.rpath 2004-09-12 14:40:34.329752040 -0400
+@@ -0,0 +1,548 @@
++#! /bin/sh
++# Output a system dependent set of variables, describing how to set the
++# run time search path of shared libraries in an executable.
++#
++# Copyright 1996-2003 Free Software Foundation, Inc.
++# Taken from GNU libtool, 2001
++# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++# As a special exception to the GNU General Public License, if you
++# distribute this file as part of a program that contains a
++# configuration script generated by Autoconf, you may include it under
++# the same distribution terms that you use for the rest of that program.
++#
++# The first argument passed to this file is the canonical host specification,
++# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or
++# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
++# should be set by the caller.
++#
++# The set of defined variables is at the end of this script.
++
++# Known limitations:
++# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
++# than 256 bytes, otherwise the compiler driver will dump core. The only
++# known workaround is to choose shorter directory names for the build
++# directory and/or the installation directory.
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++shrext=.so
++
++host="$1"
++host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
++
++wl=
++if test "$GCC" = yes; then
++ wl='-Wl,'
++else
++ case "$host_os" in
++ aix*)
++ wl='-Wl,'
++ ;;
++ mingw* | pw32* | os2*)
++ ;;
++ hpux9* | hpux10* | hpux11*)
++ wl='-Wl,'
++ ;;
++ irix5* | irix6* | nonstopux*)
++ wl='-Wl,'
++ ;;
++ newsos6)
++ ;;
++ linux*)
++ case $CC in
++ icc|ecc)
++ wl='-Wl,'
++ ;;
++ ccc)
++ wl='-Wl,'
++ ;;
++ esac
++ ;;
++ osf3* | osf4* | osf5*)
++ wl='-Wl,'
++ ;;
++ sco3.2v5*)
++ ;;
++ solaris*)
++ wl='-Wl,'
++ ;;
++ sunos4*)
++ wl='-Qoption ld '
++ ;;
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ wl='-Wl,'
++ ;;
++ sysv4*MP*)
++ ;;
++ uts4*)
++ ;;
++ esac
++fi
++
++# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
++
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++
++case "$host_os" in
++ cygwin* | mingw* | pw32*)
++ # FIXME: the MSVC++ port hasn't been tested in a loooong time
++ # When not using gcc, we currently assume that we are using
++ # Microsoft Visual C++.
++ if test "$GCC" != yes; then
++ with_gnu_ld=no
++ fi
++ ;;
++ openbsd*)
++ with_gnu_ld=no
++ ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++ case "$host_os" in
++ aix3* | aix4* | aix5*)
++ # On AIX/PPC, the GNU linker is very broken
++ if test "$host_cpu" != ia64; then
++ ld_shlibs=no
++ fi
++ ;;
++ amigaos*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_minus_L=yes
++ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++ # that the semantics of dynamic libraries on AmigaOS, at least up
++ # to version 4, is to share data among multiple programs linked
++ # with the same dynamic library. Since this doesn't match the
++ # behavior of shared libraries on other platforms, we can use
++ # them.
++ ld_shlibs=no
++ ;;
++ beos*)
++ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ :
++ else
++ ld_shlibs=no
++ fi
++ ;;
++ cygwin* | mingw* | pw32*)
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec='-L$libdir'
++ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++ :
++ else
++ ld_shlibs=no
++ fi
++ ;;
++ netbsd*)
++ ;;
++ solaris* | sysv5*)
++ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
++ ld_shlibs=no
++ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ :
++ else
++ ld_shlibs=no
++ fi
++ ;;
++ sunos4*)
++ hardcode_direct=yes
++ ;;
++ *)
++ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++ :
++ else
++ ld_shlibs=no
++ fi
++ ;;
++ esac
++ if test "$ld_shlibs" = yes; then
++ # Unlike libtool, we use -rpath here, not --rpath, since the documented
++ # option of GNU ld is called -rpath, not --rpath.
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ fi
++else
++ case "$host_os" in
++ aix3*)
++ # Note: this linker hardcodes the directories in LIBPATH if there
++ # are no directories specified by -L.
++ hardcode_minus_L=yes
++ if test "$GCC" = yes; then
++ # Neither direct hardcoding nor static linking is supported with a
++ # broken collect2.
++ hardcode_direct=unsupported
++ fi
++ ;;
++ aix4* | aix5*)
++ if test "$host_cpu" = ia64; then
++ # On IA64, the linker does run time linking by default, so we don't
++ # have to do anything special.
++ aix_use_runtimelinking=no
++ else
++ aix_use_runtimelinking=no
++ # Test if we are trying to use run time linking or normal
++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
++ # need to do runtime linking.
++ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
++ for ld_flag in $LDFLAGS; do
++ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
++ aix_use_runtimelinking=yes
++ break
++ fi
++ done
++ esac
++ fi
++ hardcode_direct=yes
++ hardcode_libdir_separator=':'
++ if test "$GCC" = yes; then
++ case $host_os in aix4.[012]|aix4.[012].*)
++ collect2name=`${CC} -print-prog-name=collect2`
++ if test -f "$collect2name" && \
++ strings "$collect2name" | grep resolve_lib_name >/dev/null
++ then
++ # We have reworked collect2
++ hardcode_direct=yes
++ else
++ # We have old collect2
++ hardcode_direct=unsupported
++ hardcode_minus_L=yes
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_libdir_separator=
++ fi
++ esac
++ fi
++ # Begin _LT_AC_SYS_LIBPATH_AIX.
++ echo 'int main () { return 0; }' > conftest.c
++ ${CC} ${LDFLAGS} conftest.c -o conftest
++ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
++}'`
++ if test -z "$aix_libpath"; then
++ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
++}'`
++ fi
++ if test -z "$aix_libpath"; then
++ aix_libpath="/usr/lib:/lib"
++ fi
++ rm -f conftest.c conftest
++ # End _LT_AC_SYS_LIBPATH_AIX.
++ if test "$aix_use_runtimelinking" = yes; then
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
++ else
++ if test "$host_cpu" = ia64; then
++ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
++ else
++ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
++ fi
++ fi
++ ;;
++ amigaos*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_minus_L=yes
++ # see comment about different semantics on the GNU ld section
++ ld_shlibs=no
++ ;;
++ bsdi4*)
++ ;;
++ cygwin* | mingw* | pw32*)
++ # When not using gcc, we currently assume that we are using
++ # Microsoft Visual C++.
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec=' '
++ libext=lib
++ ;;
++ darwin* | rhapsody*)
++ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
++ hardcode_direct=no
++ fi
++ ;;
++ dgux*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ ;;
++ freebsd1*)
++ ld_shlibs=no
++ ;;
++ freebsd2.2*)
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ ;;
++ freebsd2*)
++ hardcode_direct=yes
++ hardcode_minus_L=yes
++ ;;
++ freebsd*)
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ ;;
++ hpux9*)
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ # hardcode_minus_L: Not really in the search PATH,
++ # but as the default location of the library.
++ hardcode_minus_L=yes
++ ;;
++ hpux10* | hpux11*)
++ if test "$with_gnu_ld" = no; then
++ case "$host_cpu" in
++ hppa*64*)
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=no
++ ;;
++ ia64*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_direct=no
++ # hardcode_minus_L: Not really in the search PATH,
++ # but as the default location of the library.
++ hardcode_minus_L=yes
++ ;;
++ *)
++ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++ hardcode_libdir_separator=:
++ hardcode_direct=yes
++ # hardcode_minus_L: Not really in the search PATH,
++ # but as the default location of the library.
++ hardcode_minus_L=yes
++ ;;
++ esac
++ fi
++ ;;
++ irix5* | irix6* | nonstopux*)
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++ netbsd*)
++ hardcode_libdir_flag_spec='-R$libdir'
++ hardcode_direct=yes
++ ;;
++ newsos6)
++ hardcode_direct=yes
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++ openbsd*)
++ hardcode_direct=yes
++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++ else
++ case "$host_os" in
++ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
++ hardcode_libdir_flag_spec='-R$libdir'
++ ;;
++ *)
++ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++ ;;
++ esac
++ fi
++ ;;
++ os2*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_minus_L=yes
++ ;;
++ osf3*)
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ hardcode_libdir_separator=:
++ ;;
++ osf4* | osf5*)
++ if test "$GCC" = yes; then
++ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++ else
++ # Both cc and cxx compiler support -rpath directly
++ hardcode_libdir_flag_spec='-rpath $libdir'
++ fi
++ hardcode_libdir_separator=:
++ ;;
++ sco3.2v5*)
++ ;;
++ solaris*)
++ hardcode_libdir_flag_spec='-R$libdir'
++ ;;
++ sunos4*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ hardcode_direct=yes
++ hardcode_minus_L=yes
++ ;;
++ sysv4)
++ case $host_vendor in
++ sni)
++ hardcode_direct=yes # is this really true???
++ ;;
++ siemens)
++ hardcode_direct=no
++ ;;
++ motorola)
++ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
++ ;;
++ esac
++ ;;
++ sysv4.3*)
++ ;;
++ sysv4*MP*)
++ if test -d /usr/nec; then
++ ld_shlibs=yes
++ fi
++ ;;
++ sysv4.2uw2*)
++ hardcode_direct=yes
++ hardcode_minus_L=no
++ ;;
++ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
++ ;;
++ sysv5*)
++ hardcode_libdir_flag_spec=
++ ;;
++ uts4*)
++ hardcode_libdir_flag_spec='-L$libdir'
++ ;;
++ *)
++ ld_shlibs=no
++ ;;
++ esac
++fi
++
++# Check dynamic linker characteristics
++# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
++libname_spec='lib$name'
++case "$host_os" in
++ aix3*)
++ ;;
++ aix4* | aix5*)
++ ;;
++ amigaos*)
++ ;;
++ beos*)
++ ;;
++ bsdi4*)
++ ;;
++ cygwin* | mingw* | pw32*)
++ shrext=.dll
++ ;;
++ darwin* | rhapsody*)
++ shrext=.dylib
++ ;;
++ dgux*)
++ ;;
++ freebsd1*)
++ ;;
++ freebsd*)
++ ;;
++ gnu*)
++ ;;
++ hpux9* | hpux10* | hpux11*)
++ case "$host_cpu" in
++ ia64*)
++ shrext=.so
++ ;;
++ hppa*64*)
++ shrext=.sl
++ ;;
++ *)
++ shrext=.sl
++ ;;
++ esac
++ ;;
++ irix5* | irix6* | nonstopux*)
++ case "$host_os" in
++ irix5* | nonstopux*)
++ libsuff= shlibsuff=
++ ;;
++ *)
++ case $LD in
++ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
++ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
++ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
++ *) libsuff= shlibsuff= ;;
++ esac
++ ;;
++ esac
++ ;;
++ linux*oldld* | linux*aout* | linux*coff*)
++ ;;
++ linux*)
++ ;;
++ netbsd*)
++ ;;
++ newsos6)
++ ;;
++ nto-qnx)
++ ;;
++ openbsd*)
++ ;;
++ os2*)
++ libname_spec='$name'
++ shrext=.dll
++ ;;
++ osf3* | osf4* | osf5*)
++ ;;
++ sco3.2v5*)
++ ;;
++ solaris*)
++ ;;
++ sunos4*)
++ ;;
++ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++ ;;
++ sysv4*MP*)
++ ;;
++ uts4*)
++ ;;
++esac
++
++sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
++escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
++shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
++escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
++
++sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
++
++# How to pass a linker flag through the compiler.
++wl="$escaped_wl"
++
++# Static library suffix (normally "a").
++libext="$libext"
++
++# Shared library suffix (normally "so").
++shlibext="$shlibext"
++
++# Flag to hardcode \$libdir into a binary during linking.
++# This must work even if \$libdir does not exist.
++hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
++
++# Whether we need a single -rpath flag with a separated argument.
++hardcode_libdir_separator="$hardcode_libdir_separator"
++
++# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct="$hardcode_direct"
++
++# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
++# resulting binary.
++hardcode_minus_L="$hardcode_minus_L"
++
++EOF
+--- lrzsz-0.12.20.safe/configure.in 2004-09-12 14:39:55.161706488 -0400
++++ lrzsz-0.12.20/configure.in 2004-09-12 14:40:35.816526016 -0400
+@@ -260,11 +260,10 @@
+ AM_GNU_GETTEXT
+
+ AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
+-AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+-AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile \
++AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile m4/Makefile \
+ man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
+ src/lrzszbug],
+-[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile;
++[
+ chmod +x debian/rules;
+ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
+--- lrzsz-0.12.20.safe/intl/bindtextdom.c 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/bindtextdom.c 2004-09-12 14:40:34.343749912 -0400
+@@ -1,59 +1,75 @@
+ /* Implementation of the bindtextdomain(3) function
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-# ifdef HAVE_MALLOC_H
+-# include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
+
+-#if defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
++#ifdef _LIBC
++# include <libintl.h>
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
++# include "libgnuintl.h"
+ #endif
++#include "gettextP.h"
+
+ #ifdef _LIBC
+-# include <libintl.h>
++/* We have to handle multi-threaded applications. */
++# include <bits/libc-lock.h>
+ #else
+-# include "libgettext.h"
++/* Provide dummy implementation if this is outside glibc. */
++# define __libc_rwlock_define(CLASS, NAME)
++# define __libc_rwlock_wrlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++ names than the internal variables in GNU libc, otherwise programs
++ using libintl.a cannot be linked statically. */
++#if !defined _LIBC
++# define _nl_default_dirname libintl_nl_default_dirname
++# define _nl_domain_bindings libintl_nl_domain_bindings
++#endif
++
++/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
++#ifndef offsetof
++# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+ #endif
+-#include "gettext.h"
+-#include "gettextP.h"
+
+ /* @@ end of prolog @@ */
+
+ /* Contains the default location of the message catalogs. */
+ extern const char _nl_default_dirname[];
++#ifdef _LIBC
++extern const char _nl_default_dirname_internal[] attribute_hidden;
++#else
++# define INTUSE(name) name
++#endif
+
+ /* List with bindings of specific domains. */
+ extern struct binding *_nl_domain_bindings;
+
++/* Lock variable to protect the global data in the gettext implementation. */
++__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
++
+
+ /* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+@@ -61,23 +77,41 @@
+ prefix. So we have to make a difference here. */
+ #ifdef _LIBC
+ # define BINDTEXTDOMAIN __bindtextdomain
+-# define strdup(str) __strdup (str)
++# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
++# ifndef strdup
++# define strdup(str) __strdup (str)
++# endif
+ #else
+-# define BINDTEXTDOMAIN bindtextdomain__
++# define BINDTEXTDOMAIN libintl_bindtextdomain
++# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
+ #endif
+
+-/* Specify that the DOMAINNAME message catalog will be found
+- in DIRNAME rather than in the system locale data base. */
+-char *
+-BINDTEXTDOMAIN (domainname, dirname)
+- const char *domainname;
+- const char *dirname;
++/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
++ to be used for the DOMAINNAME message catalog.
++ If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
++ modified, only the current value is returned.
++ If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
++ modified nor returned. */
++static void
++set_binding_values (const char *domainname,
++ const char **dirnamep, const char **codesetp)
+ {
+ struct binding *binding;
++ int modified;
+
+ /* Some sanity checks. */
+ if (domainname == NULL || domainname[0] == '\0')
+- return NULL;
++ {
++ if (dirnamep)
++ *dirnamep = NULL;
++ if (codesetp)
++ *codesetp = NULL;
++ return;
++ }
++
++ __libc_rwlock_wrlock (_nl_state_lock);
++
++ modified = 0;
+
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+@@ -93,81 +127,173 @@
+ }
+ }
+
+- if (dirname == NULL)
+- /* The current binding has be to returned. */
+- return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+-
+ if (binding != NULL)
+ {
+- /* The domain is already bound. If the new value and the old
+- one are equal we simply do nothing. Otherwise replace the
+- old binding. */
+- if (strcmp (dirname, binding->dirname) != 0)
++ if (dirnamep)
+ {
+- char *new_dirname;
++ const char *dirname = *dirnamep;
+
+- if (strcmp (dirname, _nl_default_dirname) == 0)
+- new_dirname = (char *) _nl_default_dirname;
++ if (dirname == NULL)
++ /* The current binding has be to returned. */
++ *dirnamep = binding->dirname;
+ else
+ {
++ /* The domain is already bound. If the new value and the old
++ one are equal we simply do nothing. Otherwise replace the
++ old binding. */
++ char *result = binding->dirname;
++ if (strcmp (dirname, result) != 0)
++ {
++ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
++ result = (char *) INTUSE(_nl_default_dirname);
++ else
++ {
+ #if defined _LIBC || defined HAVE_STRDUP
+- new_dirname = strdup (dirname);
+- if (new_dirname == NULL)
+- return NULL;
++ result = strdup (dirname);
+ #else
+- size_t len = strlen (dirname) + 1;
+- new_dirname = (char *) malloc (len);
+- if (new_dirname == NULL)
+- return NULL;
+-
+- memcpy (new_dirname, dirname, len);
++ size_t len = strlen (dirname) + 1;
++ result = (char *) malloc (len);
++ if (__builtin_expect (result != NULL, 1))
++ memcpy (result, dirname, len);
+ #endif
++ }
++
++ if (__builtin_expect (result != NULL, 1))
++ {
++ if (binding->dirname != INTUSE(_nl_default_dirname))
++ free (binding->dirname);
++
++ binding->dirname = result;
++ modified = 1;
++ }
++ }
++ *dirnamep = result;
+ }
++ }
+
+- if (binding->dirname != _nl_default_dirname)
+- free (binding->dirname);
++ if (codesetp)
++ {
++ const char *codeset = *codesetp;
+
+- binding->dirname = new_dirname;
++ if (codeset == NULL)
++ /* The current binding has be to returned. */
++ *codesetp = binding->codeset;
++ else
++ {
++ /* The domain is already bound. If the new value and the old
++ one are equal we simply do nothing. Otherwise replace the
++ old binding. */
++ char *result = binding->codeset;
++ if (result == NULL || strcmp (codeset, result) != 0)
++ {
++#if defined _LIBC || defined HAVE_STRDUP
++ result = strdup (codeset);
++#else
++ size_t len = strlen (codeset) + 1;
++ result = (char *) malloc (len);
++ if (__builtin_expect (result != NULL, 1))
++ memcpy (result, codeset, len);
++#endif
++
++ if (__builtin_expect (result != NULL, 1))
++ {
++ if (binding->codeset != NULL)
++ free (binding->codeset);
++
++ binding->codeset = result;
++ binding->codeset_cntr++;
++ modified = 1;
++ }
++ }
++ *codesetp = result;
++ }
+ }
+ }
++ else if ((dirnamep == NULL || *dirnamep == NULL)
++ && (codesetp == NULL || *codesetp == NULL))
++ {
++ /* Simply return the default values. */
++ if (dirnamep)
++ *dirnamep = INTUSE(_nl_default_dirname);
++ if (codesetp)
++ *codesetp = NULL;
++ }
+ else
+ {
+ /* We have to create a new binding. */
+- size_t len;
++ size_t len = strlen (domainname) + 1;
+ struct binding *new_binding =
+- (struct binding *) malloc (sizeof (*new_binding));
++ (struct binding *) malloc (offsetof (struct binding, domainname) + len);
+
+- if (new_binding == NULL)
+- return NULL;
++ if (__builtin_expect (new_binding == NULL, 0))
++ goto failed;
+
++ memcpy (new_binding->domainname, domainname, len);
++
++ if (dirnamep)
++ {
++ const char *dirname = *dirnamep;
++
++ if (dirname == NULL)
++ /* The default value. */
++ dirname = INTUSE(_nl_default_dirname);
++ else
++ {
++ if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
++ dirname = INTUSE(_nl_default_dirname);
++ else
++ {
++ char *result;
+ #if defined _LIBC || defined HAVE_STRDUP
+- new_binding->domainname = strdup (domainname);
+- if (new_binding->domainname == NULL)
+- return NULL;
++ result = strdup (dirname);
++ if (__builtin_expect (result == NULL, 0))
++ goto failed_dirname;
+ #else
+- len = strlen (domainname) + 1;
+- new_binding->domainname = (char *) malloc (len);
+- if (new_binding->domainname == NULL)
+- return NULL;
+- memcpy (new_binding->domainname, domainname, len);
++ size_t len = strlen (dirname) + 1;
++ result = (char *) malloc (len);
++ if (__builtin_expect (result == NULL, 0))
++ goto failed_dirname;
++ memcpy (result, dirname, len);
+ #endif
+-
+- if (strcmp (dirname, _nl_default_dirname) == 0)
+- new_binding->dirname = (char *) _nl_default_dirname;
++ dirname = result;
++ }
++ }
++ *dirnamep = dirname;
++ new_binding->dirname = (char *) dirname;
++ }
+ else
++ /* The default value. */
++ new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
++
++ new_binding->codeset_cntr = 0;
++
++ if (codesetp)
+ {
++ const char *codeset = *codesetp;
++
++ if (codeset != NULL)
++ {
++ char *result;
++
+ #if defined _LIBC || defined HAVE_STRDUP
+- new_binding->dirname = strdup (dirname);
+- if (new_binding->dirname == NULL)
+- return NULL;
++ result = strdup (codeset);
++ if (__builtin_expect (result == NULL, 0))
++ goto failed_codeset;
+ #else
+- len = strlen (dirname) + 1;
+- new_binding->dirname = (char *) malloc (len);
+- if (new_binding->dirname == NULL)
+- return NULL;
+- memcpy (new_binding->dirname, dirname, len);
++ size_t len = strlen (codeset) + 1;
++ result = (char *) malloc (len);
++ if (__builtin_expect (result == NULL, 0))
++ goto failed_codeset;
++ memcpy (result, codeset, len);
+ #endif
++ codeset = result;
++ new_binding->codeset_cntr++;
++ }
++ *codesetp = codeset;
++ new_binding->codeset = (char *) codeset;
+ }
++ else
++ new_binding->codeset = NULL;
+
+ /* Now enqueue it. */
+ if (_nl_domain_bindings == NULL
+@@ -187,13 +313,51 @@
+ binding->next = new_binding;
+ }
+
+- binding = new_binding;
++ modified = 1;
++
++ /* Here we deal with memory allocation failures. */
++ if (0)
++ {
++ failed_codeset:
++ if (new_binding->dirname != INTUSE(_nl_default_dirname))
++ free (new_binding->dirname);
++ failed_dirname:
++ free (new_binding);
++ failed:
++ if (dirnamep)
++ *dirnamep = NULL;
++ if (codesetp)
++ *codesetp = NULL;
++ }
+ }
+
+- return binding->dirname;
++ /* If we modified any binding, we flush the caches. */
++ if (modified)
++ ++_nl_msg_cat_cntr;
++
++ __libc_rwlock_unlock (_nl_state_lock);
++}
++
++/* Specify that the DOMAINNAME message catalog will be found
++ in DIRNAME rather than in the system locale data base. */
++char *
++BINDTEXTDOMAIN (const char *domainname, const char *dirname)
++{
++ set_binding_values (domainname, &dirname, NULL);
++ return (char *) dirname;
++}
++
++/* Specify the character encoding in which the messages from the
++ DOMAINNAME message catalog will be returned. */
++char *
++BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
++{
++ set_binding_values (domainname, NULL, &codeset);
++ return (char *) codeset;
+ }
+
+ #ifdef _LIBC
+-/* Alias for function name in GNU C Library. */
++/* Aliases for function names in GNU C Library. */
+ weak_alias (__bindtextdomain, bindtextdomain);
++weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
+ #endif
+--- lrzsz-0.12.20.safe/intl/cat-compat.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/cat-compat.c 1969-12-31 19:00:00.000000000 -0500
+@@ -1,262 +0,0 @@
+-/* Compatibility code for gettext-using-catgets interface.
+- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+-
+-#ifdef HAVE_CONFIG_H
+-# include <config.h>
+-#endif
+-
+-#include <stdio.h>
+-
+-#ifdef STDC_HEADERS
+-# include <stdlib.h>
+-# include <string.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-# include <malloc.h>
+-# endif
+-#endif
+-
+-#ifdef HAVE_NL_TYPES_H
+-# include <nl_types.h>
+-#endif
+-
+-#include "libgettext.h"
+-
+-/* @@ end of prolog @@ */
+-
+-/* XPG3 defines the result of `setlocale (category, NULL)' as:
+- ``Directs `setlocale()' to query `category' and return the current
+- setting of `local'.''
+- However it does not specify the exact format. And even worse: POSIX
+- defines this not at all. So we can use this feature only on selected
+- system (e.g. those using GNU C Library). */
+-#ifdef _LIBC
+-# define HAVE_LOCALE_NULL
+-#endif
+-
+-/* The catalog descriptor. */
+-static nl_catd catalog = (nl_catd) -1;
+-
+-/* Name of the default catalog. */
+-static const char default_catalog_name[] = "messages";
+-
+-/* Name of currently used catalog. */
+-static const char *catalog_name = default_catalog_name;
+-
+-/* Get ID for given string. If not found return -1. */
+-static int msg_to_cat_id PARAMS ((const char *msg));
+-
+-/* Substitution for systems lacking this function in their C library. */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
+-#endif
+-
+-
+-/* Set currently used domain/catalog. */
+-char *
+-textdomain (domainname)
+- const char *domainname;
+-{
+- nl_catd new_catalog;
+- char *new_name;
+- size_t new_name_len;
+- char *lang;
+-
+-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
+- && defined HAVE_LOCALE_NULL
+- lang = setlocale (LC_MESSAGES, NULL);
+-#else
+- lang = getenv ("LC_ALL");
+- if (lang == NULL || lang[0] == '\0')
+- {
+- lang = getenv ("LC_MESSAGES");
+- if (lang == NULL || lang[0] == '\0')
+- lang = getenv ("LANG");
+- }
+-#endif
+- if (lang == NULL || lang[0] == '\0')
+- lang = "C";
+-
+- /* See whether name of currently used domain is asked. */
+- if (domainname == NULL)
+- return (char *) catalog_name;
+-
+- if (domainname[0] == '\0')
+- domainname = default_catalog_name;
+-
+- /* Compute length of added path element. */
+- new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
+- + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
+- + sizeof (".cat");
+-
+- new_name = (char *) malloc (new_name_len);
+- if (new_name == NULL)
+- return NULL;
+-
+- strcpy (new_name, PACKAGE);
+- new_catalog = catopen (new_name, 0);
+-
+- if (new_catalog == (nl_catd) -1)
+- {
+- /* NLSPATH search didn't work, try absolute path */
+- sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
+- PACKAGE);
+- new_catalog = catopen (new_name, 0);
+-
+- if (new_catalog == (nl_catd) -1)
+- {
+- free (new_name);
+- return (char *) catalog_name;
+- }
+- }
+-
+- /* Close old catalog. */
+- if (catalog != (nl_catd) -1)
+- catclose (catalog);
+- if (catalog_name != default_catalog_name)
+- free ((char *) catalog_name);
+-
+- catalog = new_catalog;
+- catalog_name = new_name;
+-
+- return (char *) catalog_name;
+-}
+-
+-char *
+-bindtextdomain (domainname, dirname)
+- const char *domainname;
+- const char *dirname;
+-{
+-#if HAVE_SETENV || HAVE_PUTENV
+- char *old_val, *new_val, *cp;
+- size_t new_val_len;
+-
+- /* This does not make much sense here but to be compatible do it. */
+- if (domainname == NULL)
+- return NULL;
+-
+- /* Compute length of added path element. If we use setenv we don't need
+- the first byts for NLSPATH=, but why complicate the code for this
+- peanuts. */
+- new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
+- + sizeof ("/%L/LC_MESSAGES/%N.cat");
+-
+- old_val = getenv ("NLSPATH");
+- if (old_val == NULL || old_val[0] == '\0')
+- {
+- old_val = NULL;
+- new_val_len += 1 + sizeof (LOCALEDIR) - 1
+- + sizeof ("/%L/LC_MESSAGES/%N.cat");
+- }
+- else
+- new_val_len += strlen (old_val);
+-
+- new_val = (char *) malloc (new_val_len);
+- if (new_val == NULL)
+- return NULL;
+-
+-# if HAVE_SETENV
+- cp = new_val;
+-# else
+- cp = stpcpy (new_val, "NLSPATH=");
+-# endif
+-
+- cp = stpcpy (cp, dirname);
+- cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
+-
+- if (old_val == NULL)
+- {
+-# if __STDC__
+- stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
+-# else
+-
+- cp = stpcpy (cp, LOCALEDIR);
+- stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
+-# endif
+- }
+- else
+- stpcpy (cp, old_val);
+-
+-# if HAVE_SETENV
+- setenv ("NLSPATH", new_val, 1);
+- free (new_val);
+-# else
+- putenv (new_val);
+- /* Do *not* free the environment entry we just entered. It is used
+- from now on. */
+-# endif
+-
+-#endif
+-
+- return (char *) domainname;
+-}
+-
+-#undef gettext
+-char *
+-gettext (msg)
+- const char *msg;
+-{
+- int msgid;
+-
+- if (msg == NULL || catalog == (nl_catd) -1)
+- return (char *) msg;
+-
+- /* Get the message from the catalog. We always use set number 1.
+- The message ID is computed by the function `msg_to_cat_id'
+- which works on the table generated by `po-to-tbl'. */
+- msgid = msg_to_cat_id (msg);
+- if (msgid == -1)
+- return (char *) msg;
+-
+- return catgets (catalog, 1, msgid, (char *) msg);
+-}
+-
+-/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
+- for the one equal to msg. If it is found return the ID. In case when
+- the string is not found return -1. */
+-static int
+-msg_to_cat_id (msg)
+- const char *msg;
+-{
+- int cnt;
+-
+- for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
+- if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
+- return _msg_tbl[cnt]._msg_number;
+-
+- return -1;
+-}
+-
+-
+-/* @@ begin of epilog @@ */
+-
+-/* We don't want libintl.a to depend on any other library. So we
+- avoid the non-standard function stpcpy. In GNU C Library this
+- function is available, though. Also allow the symbol HAVE_STPCPY
+- to be defined. */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *
+-stpcpy (dest, src)
+- char *dest;
+- const char *src;
+-{
+- while ((*dest++ = *src++) != '\0')
+- /* Do nothing. */ ;
+- return dest - 1;
+-}
+-#endif
+--- lrzsz-0.12.20.safe/intl/ChangeLog 1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/ChangeLog 2004-09-12 14:40:34.349749000 -0400
+@@ -1,1022 +1,4 @@
+-1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
+-
+- * intlh.inst.in: Reformat copyright.
+-
+-1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com>
+-
+- * dcgettext.c (DCGETTEXT): Remove wrong comment.
+-
+-1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (install-data): Don't change directory to install.
+-
+-1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com>
+-
+- * cat-compat.c: Fix copyright.
+-
+- * localealias.c: Don't define strchr unless !HAVE_STRCHR.
+-
+- * loadmsgcat.c: Update copyright. Fix typos.
+-
+- * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
+- (_nl_make_l10nflist): Handle sponsor and revision correctly.
+-
+- * gettext.c: Update copyright.
+- * gettext.h: Likewise.
+- * hash-string.h: Likewise.
+-
+- * finddomain.c: Remoave dead code. Define strchr only if
+- !HAVE_STRCHR.
+-
+- * explodename.c: Include <sys/types.h>.
+-
+- * explodename.c: Reformat copyright text.
+- (_nl_explode_name): Fix typo.
+-
+- * dcgettext.c: Define and use __set_errno.
+- (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
+- not defined.
+-
+- * bindtextdom.c: Pretty printing.
+-
+-1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com>
+-
+- * dcgettext.c (guess_category_value): Don't depend on
+- HAVE_LC_MESSAGES. We don't need the macro here.
+- Patch by Bruno Haible <haible@ilog.fr>.
+-
+- * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
+- macro. Instead use HAVE_LOCALE_NULL and define it when using
+- glibc, as in dcgettext.c.
+- Patch by Bruno Haible <haible@ilog.fr>.
+-
+- * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois
+- Pinard.
+-
+-Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in: Implement handling of libtool.
+-
+- * gettextP.h: Change data structures for use of generic lowlevel
+- i18n file handling.
+-
+-Wed Dec 4 20:21:18 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * textdomain.c: Put parentheses around arguments of memcpy macro
+- definition.
+- * localealias.c: Likewise.
+- * l10nflist.c: Likewise.
+- * finddomain.c: Likewise.
+- * bindtextdom.c: Likewise.
+- Reported by Thomas Esken.
+-
+-Mon Nov 25 22:57:51 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * textdomain.c: Move definition of `memcpy` macro to right
+- position.
+-
+-Fri Nov 22 04:01:58 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
+- bcopy if not already defined. Reported by Thomas Esken.
+- * bindtextdom.c: Likewise.
+- * l10nflist.c: Likewise.
+- * localealias.c: Likewise.
+- * textdomain.c: Likewise.
+-
+-Tue Oct 29 11:10:27 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (libdir): Change to use exec_prefix instead of
+- prefix. Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
+-
+-Sat Aug 31 03:07:09 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
+- so don't prepend uppercase `ISO' for only numeric arg.
+-
+-Fri Jul 19 00:15:46 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
+- definition of _GNU_SOURCE. Patch by Roland McGrath.
+-
+- * Makefile.in (uninstall): Fix another bug with `for' loop and
+- empty arguments. Patch by Jim Meyering. Correct name os
+- uninstalled files: no intl- prefix anymore.
+-
+- * Makefile.in (install-data): Again work around shells which
+- cannot handle mpty for list. Reported by Jim Meyering.
+-
+-Sat Jul 13 18:11:35 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (install): Split goal. Now depend on install-exec
+- and install-data.
+- (install-exec, install-data): New goals. Created from former
+- install goal.
+- Reported by Karl Berry.
+-
+-Sat Jun 22 04:58:14 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (MKINSTALLDIRS): New variable. Path to
+- mkinstalldirs script.
+- (install): use MKINSTALLDIRS variable or if the script is not present
+- try to find it in the $top_scrdir).
+-
+-Wed Jun 19 02:56:56 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * l10nflist.c: Linux libc *partly* includes the argz_* functions.
+- Grr. Work around by renaming the static version and use macros
+- for renaming.
+-
+-Tue Jun 18 20:11:17 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * l10nflist.c: Correct presence test macros of __argz_* functions.
+-
+- * l10nflist.c: Include <argz.h> based on test of it instead when
+- __argz_* functions are available.
+- Reported by Andreas Schwab.
+-
+-Thu Jun 13 15:17:44 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * explodename.c, l10nflist.c: Define NULL for dumb systems.
+-
+-Tue Jun 11 17:05:13 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
+- result to __result to prevent name clash.
+-
+- * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
+- get prototype for stpcpy and strcasecmp.
+-
+- * intlh.inst.in, libgettext.h: Move declaration of
+- `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
+- from gcc's -Wnested-extern option.
+-
+-Fri Jun 7 01:58:00 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (install): Remove comment.
+-
+-Thu Jun 6 17:28:17 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (install): Work around for another Buglix stupidity.
+- Always use an `else' close for `if's. Reported by Nelson Beebe.
+-
+- * Makefile.in (intlh.inst): Correct typo in phony rule.
+- Reported by Nelson Beebe.
+-
+-Thu Jun 6 01:49:52 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * dcgettext.c (read_alias_file): Rename variable alloca_list to
+- block_list as the macro calls assume.
+- Patch by Eric Backus.
+-
+- * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
+- malloc.
+- (read_alias_file): Rename varriabe alloca_list to block_list as the
+- macro calls assume.
+- Patch by Eric Backus.
+-
+- * l10nflist.c: Correct conditional for <argz.h> inclusion.
+- Reported by Roland McGrath.
+-
+- * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
+- all-@USE_NLS@.
+-
+- * Makefile.in (install): intlh.inst comes from local dir, not
+- $(srcdir).
+-
+- * Makefile.in (intlh.inst): Special handling of this goal. If
+- used in gettext, this is really a rul to construct this file. If
+- used in any other package it is defined as a .PHONY rule with
+- empty body.
+-
+- * finddomain.c: Extract locale file information handling into
+- l10nfile.c. Rename local stpcpy__ function to stpcpy.
+-
+- * dcgettext.c (stpcpy): Add local definition.
+-
+- * l10nflist.c: Solve some portability problems. Patches partly by
+- Thomas Esken. Add local definition of stpcpy.
+-
+-Tue Jun 4 02:47:49 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * intlh.inst.in: Don't depend including <locale.h> on
+- HAVE_LOCALE_H. Instead configure must rewrite this fiile
+- depending on the result of the configure run.
+-
+- * Makefile.in (install): libintl.inst is now called intlh.inst.
+- Add rules for updating intlh.inst from intlh.inst.in.
+-
+- * libintl.inst: Renamed to intlh.inst.in.
+-
+- * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
+- because gcc has __buitlin_alloca.
+- Reported by Roland McGrath.
+-
+-Mon Jun 3 00:32:16 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * Makefile.in (installcheck): New goal to fulfill needs of
+- automake's distcheck.
+-
+- * Makefile.in (install): Reorder commands so that VERSION is
+- found.
+-
+- * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
+- @datadir@/gettext.
+- (COMSRCS): Add l10nfile.c.
+- (OBJECTS): Add l10nfile.o.
+- (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common).
+- (DISTFILE.gettext): Remove $(DISTFILES.common).
+- (all-gettext): Remove goal.
+- (install): If $(PACKAGE) = gettext install, otherwose do nothing. No
+- package but gettext itself should install libintl.h + headers.
+- (dist): Extend goal to work for gettext, too.
+- (dist-gettext): Remove goal.
+-
+- * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
+-
+-Sun Jun 2 17:33:06 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
+- find_l10nfile.
+-
+-Sat Jun 1 02:23:03 1996 Ulrich Drepper <drepper@cygnus.com>
+-
+- * l10nflist.c (__argz_next): Add definition.
+-
+- * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
+- code. Use new l10nfile handling.
+-
+- * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
+- alloca code.
+-
+- * l10nflist.c: Initial revision.
+-
+-Tue Apr 2 18:51:18 1996 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (all-gettext): New goal. Same as all-yes.
+-
+-Thu Mar 28 23:01:22 1996 Karl Eichwalder <ke@ke.central.de>
+-
+- * Makefile.in (gettextsrcdir): Define using @datadir@.
+-
+-Tue Mar 26 12:39:14 1996 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c: Include <ctype.h>. Reported by Roland McGrath.
+-
+-Sat Mar 23 02:00:35 1996 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
+- with external declaration.
+-
+-Sat Mar 2 00:47:09 1996 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (all-no): Rename from all_no.
+-
+-Sat Feb 17 00:25:59 1996 Ulrich Drepper <drepper@myware>
+-
+- * gettextP.h [loaded_domain]: Array `successor' must now contain up
+- to 63 elements (because of codeset name normalization).
+-
+- * finddomain.c: Implement codeset name normalization.
+-
+-Thu Feb 15 04:39:09 1996 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (all): Define to `all-@USE_NLS@'.
+- (all-yes, all_no): New goals. `all-no' is noop, `all-yes'
+- is former all.
+-
+-Mon Jan 15 21:46:01 1996 Howard Gayle <howard@hal.com>
+-
+- * localealias.c (alias_compare): Increment string pointers in loop
+- of strcasecmp replacement.
+-
+-Fri Dec 29 21:16:34 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (install-src): Who commented this goal out ? :-)
+-
+-Fri Dec 29 15:08:16 1995 Ulrich Drepper <drepper@myware>
+-
+- * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls
+- should not effect it because a missing catalog is no error.
+- Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
+-
+-Tue Dec 19 22:09:13 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (Makefile): Explicitly use $(SHELL) for running
+- shell scripts.
+-
+-Fri Dec 15 17:34:59 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+-
+- * Makefile.in (install-src): Only install library and header when
+- we use the own implementation. Don't do it when using the
+- system's gettext or catgets functions.
+-
+- * dcgettext.c (find_msg): Must not swap domain->hash_size here.
+-
+-Sat Dec 9 16:24:37 1995 Ulrich Drepper <drepper@myware>
+-
+- * localealias.c, libintl.inst, libgettext.h, hash-string.h,
+- gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
+- Use PARAMS instead of __P. Suggested by Roland McGrath.
+-
+-Tue Dec 5 11:39:14 1995 Larry Schwimmer <rosebud@cyclone.stanford.edu>
+-
+- * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
+- !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
+-
+-Mon Dec 4 15:42:07 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (install-src):
+- Install libintl.inst instead of libintl.h.install.
+-
+-Sat Dec 2 22:51:38 1995 Marcus Daniels <marcus@sysc.pdx.edu>
+-
+- * cat-compat.c (textdomain):
+- Reverse order in which files are tried you load. First
+- try local file, when this failed absolute path.
+-
+-Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+-
+- * cat-compat.c (bindtextdomain): Add missing { }.
+-
+-Sun Nov 26 18:21:41 1995 Ulrich Drepper <drepper@myware>
+-
+- * libintl.inst: Add missing __P definition. Reported by Nelson Beebe.
+-
+- * Makefile.in:
+- Add dummy `all' and `dvi' goals. Reported by Tom Tromey.
+-
+-Sat Nov 25 16:12:01 1995 Franc,ois Pinard <pinard@iro.umontreal.ca>
+-
+- * hash-string.h: Capitalize arguments of macros.
+-
+-Sat Nov 25 12:01:36 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (DISTFILES): Prevent files names longer than 13
+- characters. libintl.h.glibc->libintl.glibc,
+- libintl.h.install->libintl.inst. Reported by Joshua R. Poulson.
+-
+-Sat Nov 25 11:31:12 1995 Eric Backus <ericb@lsid.hp.com>
+-
+- * dcgettext.c: Fix bug in preprocessor conditionals.
+-
+-Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+-
+- * libgettext.h: Solaris cc does not understand
+- #if !SYMBOL1 && !SYMBOL2. Sad but true.
+-
+-Thu Nov 23 16:22:14 1995 Ulrich Drepper <drepper@myware>
+-
+- * hash-string.h (hash_string):
+- Fix for machine with >32 bit `unsigned long's.
+-
+- * dcgettext.c (DCGETTEXT):
+- Fix horrible bug in loop for alternative translation.
+-
+-Thu Nov 23 01:45:29 1995 Ulrich Drepper <drepper@myware>
+-
+- * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
+- Some further simplifications in message number generation.
+-
+-Mon Nov 20 21:08:43 1995 Ulrich Drepper <drepper@myware>
+-
+- * libintl.h.glibc: Use __const instead of const in prototypes.
+-
+- * Makefile.in (install-src):
+- Install libintl.h.install instead of libintl.h. This
+- is a stripped-down version. Suggested by Peter Miller.
+-
+- * libintl.h.install, libintl.h.glibc: Initial revision.
+-
+- * localealias.c (_nl_expand_alias, read_alias_file):
+- Protect prototypes in type casts by __P.
+-
+-Tue Nov 14 16:43:58 1995 Ulrich Drepper <drepper@myware>
+-
+- * hash-string.h: Correct prototype for hash_string.
+-
+-Sun Nov 12 12:42:30 1995 Ulrich Drepper <drepper@myware>
+-
+- * hash-string.h (hash_string): Add prototype.
+-
+- * gettextP.h: Fix copyright.
+- (SWAP): Add prototype.
+-
+-Wed Nov 8 22:56:33 1995 Ulrich Drepper <drepper@myware>
+-
+- * localealias.c (read_alias_file): Forgot sizeof.
+- Avoid calling *printf function. This introduces a big overhead.
+- Patch by Roland McGrath.
+-
+-Tue Nov 7 14:21:08 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
+-
+- * finddomain.c (stpcpy):
+- Define substitution function local. The macro was to flaky.
+-
+- * cat-compat.c: Fix typo.
+-
+- * xopen-msg.sed, linux-msg.sed:
+- While bringing message number to right place only accept digits.
+-
+- * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
+- leading 0s we don't need to remove them. Reported by Marcus
+- Daniels.
+-
+- * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
+- dependency. Reported by Marcus Daniels.
+-
+- * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
+- Generally cleanup using #if instead of #ifndef.
+-
+- * Makefile.in: Correct typos in comment. By Franc,ois Pinard.
+-
+-Mon Nov 6 00:27:02 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (install-src): Don't install libintl.h and libintl.a
+- if we use an available gettext implementation.
+-
+-Sun Nov 5 22:02:08 1995 Ulrich Drepper <drepper@myware>
+-
+- * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported
+- by Franc,ois Pinard.
+-
+- * libgettext.h: Use #if instead of #ifdef/#ifndef.
+-
+- * finddomain.c:
+- Comments describing what has to be done should start with FIXME.
+-
+-Sun Nov 5 19:38:01 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning.
+- DISTFILES.common names the files common to both dist goals.
+- DISTFILES.gettext are the files only distributed in GNU gettext.
+-
+-Sun Nov 5 17:32:54 1995 Ulrich Drepper <drepper@myware>
+-
+- * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
+- This was necessary since a change in _nl_find_msg several weeks
+- ago. I really don't know this is still not fixed.
+-
+-Sun Nov 5 12:43:12 1995 Ulrich Drepper <drepper@myware>
+-
+- * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This
+- might mark a special condition.
+-
+- * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
+-
+- * Makefile.in (dist): Suppress error message when ln failed.
+- Get files from $(srcdir) explicitly.
+-
+- * libgettext.h (gettext_const): Rename to gettext_noop.
+-
+-Fri Nov 3 07:36:50 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (make_entry_rec):
+- Protect against wrong locale names by testing mask.
+-
+- * libgettext.h (gettext_const): Add macro definition.
+- Capitalize macro arguments.
+-
+-Thu Nov 2 23:15:51 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (_nl_find_domain):
+- Test for pointer != NULL before accessing value.
+- Reported by Tom Tromey.
+-
+- * gettext.c (NULL):
+- Define as (void*)0 instad of 0. Reported by Franc,ois Pinard.
+-
+-Mon Oct 30 21:28:52 1995 Ulrich Drepper <drepper@myware>
+-
+- * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
+-
+-Sat Oct 28 23:20:47 1995 Ulrich Drepper <drepper@myware>
+-
+- * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
+-
+- * localealias.c (alias_compare):
+- Peter Miller reported that tolower in some systems is
+- even dumber than I thought. Protect call by `isupper'.
+-
+-Fri Oct 27 22:22:51 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (libdir, includedir): New variables.
+- (install-src): Install libintl.a and libintl.h in correct dirs.
+-
+-Fri Oct 27 22:07:29 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
+-
+- * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
+-
+- * localealias.c:
+- Fix typo and superflous test. Reported by Christian von Roques.
+-
+-Fri Oct 6 11:52:05 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (_nl_find_domain):
+- Correct some remainder from the pre-CEN syntax. Now
+- we don't have a constant number of successors anymore.
+-
+-Wed Sep 27 21:41:13 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (DISTFILES): Add libintl.h.glibc.
+-
+- * Makefile.in (dist-libc): Add goal for packing sources for glibc.
+- (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
+-
+- * loadmsgcat.c: Forget to continue #if line.
+-
+- * localealias.c:
+- [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
+- space clean.
+-
+- * dcgettext.c, finddomain.c: Better comment to last change.
+-
+- * loadmsgcat.c:
+- [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
+- __fstat, __open, __close, __read, __mmap, and __munmap resp
+- to keep ANSI C name space clean.
+-
+- * finddomain.c:
+- [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
+-
+- * dcgettext.c:
+- [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
+- keep ANSI C name space clean.
+-
+- * libgettext.h:
+- Include sys/types.h for those old SysV systems out there.
+- Reported by Francesco Potorti`.
+-
+- * loadmsgcat.c (use_mmap): Define if compiled for glibc.
+-
+- * bindtextdom.c: Include all those standard headers
+- unconditionally if _LIBC is defined.
+-
+- * finddomain.c: Fix 2 times defiend -> defined.
+-
+- * textdomain.c: Include libintl.h instead of libgettext.h when
+- compiling for glibc. Include all those standard headers
+- unconditionally if _LIBC is defined.
+-
+- * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
+-
+- * gettext.c:
+- Include libintl.h instead of libgettext.h when compiling for glibc.
+- Get NULL from stddef.h if we compile for glibc.
+-
+- * finddomain.c: Include libintl.h instead of libgettext.h when
+- compiling for glibc. Include all those standard headers
+- unconditionally if _LIBC is defined.
+-
+- * dcgettext.c: Include all those standard headers unconditionally
+- if _LIBC is defined.
+-
+- * dgettext.c: If compiled in glibc include libintl.h instead of
+- libgettext.h.
+- (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
+-
+- * dcgettext.c: If compiled in glibc include libintl.h instead of
+- libgettext.h.
+- (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
+-
+- * bindtextdom.c:
+- If compiled in glibc include libintl.h instead of libgettext.h.
+-
+-Mon Sep 25 22:23:06 1995 Ulrich Drepper <drepper@myware>
+-
+- * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
+- Reported by Marcus Daniels.
+-
+- * cat-compat.c (bindtextdomain):
+- String used in putenv must not be recycled.
+- Reported by Marcus Daniels.
+-
+- * libgettext.h (__USE_GNU_GETTEXT):
+- Additional symbol to signal that we use GNU gettext
+- library.
+-
+- * cat-compat.c (bindtextdomain):
+- Fix bug with the strange stpcpy replacement.
+- Reported by Nelson Beebe.
+-
+-Sat Sep 23 08:23:51 1995 Ulrich Drepper <drepper@myware>
+-
+- * cat-compat.c: Include <string.h> for stpcpy prototype.
+-
+- * localealias.c (read_alias_file):
+- While expand strdup code temporary variable `cp' hided
+- higher level variable with same name. Rename to `tp'.
+-
+- * textdomain.c (textdomain):
+- Avoid warning by using temporary variable in strdup code.
+-
+- * finddomain.c (_nl_find_domain): Remove unused variable `application'.
+-
+-Thu Sep 21 15:51:44 1995 Ulrich Drepper <drepper@myware>
+-
+- * localealias.c (alias_compare):
+- Use strcasecmp() only if available. Else use
+- implementation in place.
+-
+- * intl-compat.c:
+- Wrapper functions now call *__ functions instead of __*.
+-
+- * libgettext.h: Declare prototypes for *__ functions instead for __*.
+-
+- * cat-compat.c, loadmsgcat.c:
+- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+- of the standard libc and so prevent libintl.a from being used
+- standalone.
+-
+- * bindtextdom.c:
+- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+- of the standard libc and so prevent libintl.a from being used
+- standalone.
+- Rename to bindtextdomain__ if not used in GNU C Library.
+-
+- * dgettext.c:
+- Rename function to dgettext__ if not used in GNU C Library.
+-
+- * gettext.c:
+- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+- of the standard libc and so prevent libintl.a from being used
+- standalone.
+- Functions now called gettext__ if not used in GNU C Library.
+-
+- * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
+- Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+- of the standard libc and so prevent libintl.a from being used
+- standalone.
+-
+-Sun Sep 17 23:14:49 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c: Correct some bugs in handling of CEN standard
+- locale definitions.
+-
+-Thu Sep 7 01:49:28 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c: Implement CEN syntax.
+-
+- * gettextP.h (loaded_domain): Extend number of successors to 31.
+-
+-Sat Aug 19 19:25:29 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (aliaspath): Remove path to X11 locale dir.
+-
+- * Makefile.in: Make install-src depend on install. This helps
+- gettext to install the sources and other packages can use the
+- install goal.
+-
+-Sat Aug 19 15:19:33 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (uninstall): Remove stuff installed by install-src.
+-
+-Tue Aug 15 13:13:53 1995 Ulrich Drepper <drepper@myware>
+-
+- * VERSION.in: Initial revision.
+-
+- * Makefile.in (DISTFILES):
+- Add VERSION file. This is not necessary for gettext, but
+- for other packages using this library.
+-
+-Tue Aug 15 06:16:44 1995 Ulrich Drepper <drepper@myware>
+-
+- * gettextP.h (_nl_find_domain):
+- New prototype after changing search strategy.
+-
+- * finddomain.c (_nl_find_domain):
+- We now try only to find a specified catalog. Fall back to other
+- catalogs listed in the locale list is now done in __dcgettext.
+-
+- * dcgettext.c (__dcgettext):
+- Now we provide message fall back even to different languages.
+- I.e. if a message is not available in one language all the other
+- in the locale list a tried. Formerly fall back was only possible
+- within one language. Implemented by moving one loop from
+- _nl_find_domain to here.
+-
+-Mon Aug 14 23:45:50 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (gettextsrcdir):
+- Directory where source of GNU gettext library are made
+- available.
+- (INSTALL, INSTALL_DATA): Programs used for installing sources.
+- (gettext-src): New. Rule to install GNU gettext sources for use in
+- gettextize shell script.
+-
+-Sun Aug 13 14:40:48 1995 Ulrich Drepper <drepper@myware>
+-
+- * loadmsgcat.c (_nl_load_domain):
+- Use mmap for loading only when munmap function is
+- also available.
+-
+- * Makefile.in (install): Depend on `all' goal.
+-
+-Wed Aug 9 11:04:33 1995 Ulrich Drepper <drepper@myware>
+-
+- * localealias.c (read_alias_file):
+- Do not overwrite '\n' when terminating alias value string.
+-
+- * localealias.c (read_alias_file):
+- Handle long lines. Ignore the rest not fitting in
+- the buffer after the initial `fgets' call.
+-
+-Wed Aug 9 00:54:29 1995 Ulrich Drepper <drepper@myware>
+-
+- * gettextP.h (_nl_load_domain):
+- Add prototype, replacing prototype for _nl_load_msg_cat.
+-
+- * finddomain.c (_nl_find_domain):
+- Remove unneeded variable filename and filename_len.
+- (expand_alias): Remove prototype because functions does not
+- exist anymore.
+-
+- * localealias.c (read_alias_file):
+- Change type of fname_len parameter to int.
+- (xmalloc): Add prototype.
+-
+- * loadmsgcat.c: Better prototypes for xmalloc.
+-
+-Tue Aug 8 22:30:39 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (_nl_find_domain):
+- Allow alias name to be constructed from the four components.
+-
+- * Makefile.in (aliaspath): New variable. Set to preliminary value.
+- (SOURCES): Add localealias.c.
+- (OBJECTS): Add localealias.o.
+-
+- * gettextP.h: Add prototype for _nl_expand_alias.
+-
+- * finddomain.c: Aliasing handled in intl/localealias.c.
+-
+- * localealias.c: Aliasing for locale names.
+-
+- * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
+-
+-Mon Aug 7 23:47:42 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
+-
+- * cat-compat.c (bindtextdomain):
+- Correct implementation. dirname parameter was not used.
+- Reported by Marcus Daniels.
+-
+- * gettextP.h (loaded_domain):
+- New fields `successor' and `decided' for oo, lazy
+- message handling implementation.
+-
+- * dcgettext.c:
+- Adopt for oo, lazy message handliing.
+- Now we can inherit translations from less specific locales.
+- (find_msg): New function.
+-
+- * loadmsgcat.c, finddomain.c:
+- Complete rewrite. Implement oo, lazy message handling :-).
+- We now have an additional environment variable `LANGUAGE' with
+- a higher priority than LC_ALL for the LC_MESSAGE locale.
+- Here we can set a colon separated list of specifications each
+- of the form `language[_territory[.codeset]][@modifier]'.
+-
+-Sat Aug 5 09:55:42 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (unistd.h):
+- Include to get _PC_PATH_MAX defined on system having it.
+-
+-Fri Aug 4 22:42:00 1995 Ulrich Drepper <drepper@myware>
+-
+- * finddomain.c (stpcpy): Include prototype.
+-
+- * Makefile.in (dist): Remove `copying instead' message.
+-
+-Wed Aug 2 18:52:03 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (ID, TAGS): Do not use $^.
+-
+-Tue Aug 1 20:07:11 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (TAGS, ID): Use $^ as command argument.
+- (TAGS): Give etags -o option t write to current directory,
+- not $(srcdir).
+- (ID): Use $(srcdir) instead os $(top_srcdir)/src.
+- (distclean): Remove ID.
+-
+-Sun Jul 30 11:51:46 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (gnulocaledir):
+- New variable, always using share/ for data directory.
+- (DEFS): Add GNULOCALEDIR, used in finddomain.c.
+-
+- * finddomain.c (_nl_default_dirname):
+- Set to GNULOCALEDIR, because it always has to point
+- to the directory where GNU gettext Library writes it to.
+-
+- * intl-compat.c (textdomain, bindtextdomain):
+- Undefine macros before function definition.
+-
+-Sat Jul 22 01:10:02 1995 Ulrich Drepper <drepper@myware>
+-
+- * libgettext.h (_LIBINTL_H):
+- Protect definition in case where this file is included as
+- libgettext.h on Solaris machines. Add comment about this.
+-
+-Wed Jul 19 02:36:42 1995 Ulrich Drepper <drepper@myware>
+-
+- * intl-compat.c (textdomain): Correct typo.
+-
+-Wed Jul 19 01:51:35 1995 Ulrich Drepper <drepper@myware>
+-
+- * dcgettext.c (dcgettext): Function now called __dcgettext.
+-
+- * dgettext.c (dgettext): Now called __dgettext and calls
+- __dcgettext.
+-
+- * gettext.c (gettext):
+- Function now called __gettext and calls __dgettext.
+-
+- * textdomain.c (textdomain): Function now called __textdomain.
+-
+- * bindtextdom.c (bindtextdomain): Function now called
+- __bindtextdomain.
+-
+- * intl-compat.c: Initial revision.
+-
+- * Makefile.in (SOURCES): Add intl-compat.c.
+- (OBJECTS): We always compile the GNU gettext library functions.
+- OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
+- and intl-compat.o.
+- (GETTOBJS): Contains now only intl-compat.o.
+-
+- * libgettext.h:
+- Re-include protection matches dualistic character of libgettext.h.
+- For all functions in GNU gettext library define __ counter part.
+-
+- * finddomain.c (strchr): Define as index if not found in C library.
+- (_nl_find_domain): For relative paths paste / in between.
+-
+-Tue Jul 18 16:37:45 1995 Ulrich Drepper <drepper@myware>
+-
+- * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
+-
+- * xopen-msg.sed: Fix bug with `msgstr ""' lines.
+- A little bit better comments.
+-
+-Tue Jul 18 01:18:27 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in:
+- po-mode.el, makelinks, combine-sh are now found in ../misc.
+-
+- * po-mode.el, makelinks, combine-sh, elisp-comp:
+- Moved to ../misc/.
+-
+- * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
+-
+-Sun Jul 16 22:33:02 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (INSTALL, INSTALL_DATA): New variables.
+- (install-data, uninstall): Install/uninstall .elc file.
+-
+- * po-mode.el (Installation comment):
+- Add .pox as possible extension of .po files.
+-
+-Sun Jul 16 13:23:27 1995 Ulrich Drepper <drepper@myware>
+-
+- * elisp-comp: Complete new version by Franc,ois: This does not
+- fail when not compiling in the source directory.
+-
+-Sun Jul 16 00:12:17 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (../po/cat-id-tbl.o):
+- Use $(MAKE) instead of make for recursive make.
+-
+- * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
+- (install-exec): Add missing dummy goal.
+- (install-data, uninstall): @ in multi-line shell command at
+- beginning, not in front of echo. Reported by Eric Backus.
+-
+-Sat Jul 15 00:21:28 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (DISTFILES):
+- Rename libgettext.perl to gettext.perl to fit in 14 chars
+- file systems.
+-
+- * gettext.perl:
+- Rename to gettext.perl to fit in 14 chars file systems.
+-
+-Thu Jul 13 23:17:20 1995 Ulrich Drepper <drepper@myware>
+-
+- * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
+-
+-Thu Jul 13 20:55:02 1995 Ulrich Drepper <drepper@myware>
+-
+- * po2tbl.sed.in: Pretty printing.
+-
+- * linux-msg.sed, xopen-msg.sed:
+- Correct bugs with handling substitute flags in branches.
+-
+- * hash-string.h (hash_string):
+- Old K&R compilers don't under stand `unsigned char'.
+-
+- * gettext.h (nls_uint32):
+- Some old K&R compilers (eg HP) don't understand `unsigned int'.
+-
+- * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
+-
+-Thu Jul 13 01:34:33 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (ELCFILES): New variable.
+- (DISTFILES): Add elisp-comp.
+- Add implicit rule for .el -> .elc compilation.
+- (install-data): install $ELCFILES
+- (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
+-
+- * elisp-comp: Initial revision
+-
+-Wed Jul 12 16:14:52 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in:
+- cat-id-tbl.c is now found in po/. This enables us to use an identical
+- intl/ directory in all packages.
+-
+- * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
+-
+- * textdomain.c: fix typo (#if def -> #if defined)
+-
+-Tue Jul 11 18:44:43 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in (stamp-cat-id): use top_srcdir to address source files
+- (DISTFILES,distclean): move tupdate.perl to src/
+-
+- * po-to-tbl.sed.in:
+- add additional jump to clear change flag to recognize multiline strings
+-
+-Tue Jul 11 01:32:50 1995 Ulrich Drepper <drepper@myware>
+-
+- * textdomain.c: Protect inclusion of stdlib.h and string.h.
+-
+- * loadmsgcat.c: Protect inclusion of stdlib.h.
+-
+- * libgettext.h: Protect inclusion of locale.h.
+- Allow use in C++ programs.
+- Define NULL is not happened already.
+-
+- * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
+- po-to-tbl.sed.
+- (distclean): remove po-to-tbl.sed and tupdate.perl.
+-
+- * tupdate.perl.in: Substitute Perl path even in exec line.
+- Don't include entries without translation from old .po file.
+-
+-Tue Jul 4 00:41:51 1995 Ulrich Drepper <drepper@myware>
+-
+- * tupdate.perl.in: use "Updated: " in msgid "".
+-
+- * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
+- Define getenv if !__STDC__.
+-
+- * bindtextdom.c: Protect stdlib.h and string.h inclusion.
+- Define free if !__STDC__.
+-
+- * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+- Define free if !__STDC__.
+-
+- * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+-
+-Mon Jul 3 23:56:30 1995 Ulrich Drepper <drepper@myware>
+-
+- * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
+- Remove unneeded $(srcdir) from Makefile.in dependency.
+-
+- * makelinks: Add copyright and short description.
+-
+- * po-mode.el: Last version for 0.7.
+-
+- * tupdate.perl.in: Fix die message.
+-
+- * dcgettext.c: Protect include of string.h.
+-
+- * gettext.c: Protect include of stdlib.h and further tries to get NULL.
+-
+- * finddomain.c: Some corrections in includes.
+-
+- * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
+-
+- * po-to-tbl.sed: Adopt for new .po file format.
+-
+- * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
+-
+-Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware>
+-
+- * tupdate.perl.in: Complete rewrite for new .po file format.
++2004-01-29 GNU <bug-gnu-gettext@gnu.org>
+
+-Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware>
++ * Version 0.14.1 released.
+
+- * First official release. This directory contains all the code
+- needed to internationalize own packages. It provides functions
+- which allow to use the X/Open catgets function with an interface
+- like the Uniforum gettext function. For system which does not
+- have neither of those a complete implementation is provided.
+--- lrzsz-0.12.20.safe/intl/config.charset 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/config.charset 2004-09-12 14:40:34.354748240 -0400
+@@ -0,0 +1,608 @@
++#! /bin/sh
++# Output a system dependent table of character encoding aliases.
++#
++# Copyright (C) 2000-2004 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Library General Public License for more details.
++#
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
++#
++# The table consists of lines of the form
++# ALIAS CANONICAL
++#
++# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
++# ALIAS is compared in a case sensitive way.
++#
++# CANONICAL is the GNU canonical name for this character encoding.
++# It must be an encoding supported by libiconv. Support by GNU libc is
++# also desirable. CANONICAL is case insensitive. Usually an upper case
++# MIME charset name is preferred.
++# The current list of GNU canonical charset names is as follows.
++#
++# name MIME? used by which systems
++# ASCII, ANSI_X3.4-1968 glibc solaris freebsd darwin
++# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd darwin
++# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd darwin
++# ISO-8859-3 Y glibc solaris
++# ISO-8859-4 Y osf solaris freebsd darwin
++# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd darwin
++# ISO-8859-6 Y glibc aix hpux solaris
++# ISO-8859-7 Y glibc aix hpux irix osf solaris
++# ISO-8859-8 Y glibc aix hpux osf solaris
++# ISO-8859-9 Y glibc aix hpux irix osf solaris
++# ISO-8859-13 glibc
++# ISO-8859-14 glibc
++# ISO-8859-15 glibc aix osf solaris freebsd
++# KOI8-R Y glibc solaris freebsd darwin
++# KOI8-U Y glibc freebsd darwin
++# KOI8-T glibc
++# CP437 dos
++# CP775 dos
++# CP850 aix osf dos
++# CP852 dos
++# CP855 dos
++# CP856 aix
++# CP857 dos
++# CP861 dos
++# CP862 dos
++# CP864 dos
++# CP865 dos
++# CP866 freebsd darwin dos
++# CP869 dos
++# CP874 woe32 dos
++# CP922 aix
++# CP932 aix woe32 dos
++# CP943 aix
++# CP949 osf woe32 dos
++# CP950 woe32 dos
++# CP1046 aix
++# CP1124 aix
++# CP1125 dos
++# CP1129 aix
++# CP1250 woe32
++# CP1251 glibc solaris darwin woe32
++# CP1252 aix woe32
++# CP1253 woe32
++# CP1254 woe32
++# CP1255 glibc woe32
++# CP1256 woe32
++# CP1257 woe32
++# GB2312 Y glibc aix hpux irix solaris freebsd darwin
++# EUC-JP Y glibc aix hpux irix osf solaris freebsd darwin
++# EUC-KR Y glibc aix hpux irix osf solaris freebsd darwin
++# EUC-TW glibc aix hpux irix osf solaris
++# BIG5 Y glibc aix hpux osf solaris freebsd darwin
++# BIG5-HKSCS glibc solaris
++# GBK glibc aix osf solaris woe32 dos
++# GB18030 glibc solaris
++# SHIFT_JIS Y hpux osf solaris freebsd darwin
++# JOHAB glibc solaris woe32
++# TIS-620 glibc aix hpux osf solaris
++# VISCII Y glibc
++# TCVN5712-1 glibc
++# GEORGIAN-PS glibc
++# HP-ROMAN8 hpux
++# HP-ARABIC8 hpux
++# HP-GREEK8 hpux
++# HP-HEBREW8 hpux
++# HP-TURKISH8 hpux
++# HP-KANA8 hpux
++# DEC-KANJI osf
++# DEC-HANYU osf
++# UTF-8 Y glibc aix hpux osf solaris
++#
++# Note: Names which are not marked as being a MIME name should not be used in
++# Internet protocols for information interchange (mail, news, etc.).
++#
++# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
++# must understand both names and treat them as equivalent.
++#
++# The first argument passed to this file is the canonical host specification,
++# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or
++# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++
++host="$1"
++os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
++echo "# This file contains a table of character encoding aliases,"
++echo "# suitable for operating system '${os}'."
++echo "# It was automatically generated from config.charset."
++# List of references, updated during installation:
++echo "# Packages using this file: "
++case "$os" in
++ linux-gnulibc1*)
++ # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
++ # localcharset.c falls back to using the full locale name
++ # from the environment variables.
++ echo "C ASCII"
++ echo "POSIX ASCII"
++ for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
++ en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
++ en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
++ es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
++ et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
++ fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
++ it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
++ sv_FI sv_SE; do
++ echo "$l ISO-8859-1"
++ echo "$l.iso-8859-1 ISO-8859-1"
++ echo "$l.iso-8859-15 ISO-8859-15"
++ echo "$l.iso-8859-15@euro ISO-8859-15"
++ echo "$l@euro ISO-8859-15"
++ echo "$l.cp-437 CP437"
++ echo "$l.cp-850 CP850"
++ echo "$l.cp-1252 CP1252"
++ echo "$l.cp-1252@euro CP1252"
++ #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
++ echo "$l.utf-8 UTF-8"
++ echo "$l.utf-8@euro UTF-8"
++ done
++ for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
++ sl_SI sr sr_CS sr_YU; do
++ echo "$l ISO-8859-2"
++ echo "$l.iso-8859-2 ISO-8859-2"
++ echo "$l.cp-852 CP852"
++ echo "$l.cp-1250 CP1250"
++ echo "$l.utf-8 UTF-8"
++ done
++ for l in mk mk_MK ru ru_RU; do
++ echo "$l ISO-8859-5"
++ echo "$l.iso-8859-5 ISO-8859-5"
++ echo "$l.koi8-r KOI8-R"
++ echo "$l.cp-866 CP866"
++ echo "$l.cp-1251 CP1251"
++ echo "$l.utf-8 UTF-8"
++ done
++ for l in ar ar_SA; do
++ echo "$l ISO-8859-6"
++ echo "$l.iso-8859-6 ISO-8859-6"
++ echo "$l.cp-864 CP864"
++ #echo "$l.cp-868 CP868" # not a commonly used encoding
++ echo "$l.cp-1256 CP1256"
++ echo "$l.utf-8 UTF-8"
++ done
++ for l in el el_GR gr gr_GR; do
++ echo "$l ISO-8859-7"
++ echo "$l.iso-8859-7 ISO-8859-7"
++ echo "$l.cp-869 CP869"
++ echo "$l.cp-1253 CP1253"
++ echo "$l.cp-1253@euro CP1253"
++ echo "$l.utf-8 UTF-8"
++ echo "$l.utf-8@euro UTF-8"
++ done
++ for l in he he_IL iw iw_IL; do
++ echo "$l ISO-8859-8"
++ echo "$l.iso-8859-8 ISO-8859-8"
++ echo "$l.cp-862 CP862"
++ echo "$l.cp-1255 CP1255"
++ echo "$l.utf-8 UTF-8"
++ done
++ for l in tr tr_TR; do
++ echo "$l ISO-8859-9"
++ echo "$l.iso-8859-9 ISO-8859-9"
++ echo "$l.cp-857 CP857"
++ echo "$l.cp-1254 CP1254"
++ echo "$l.utf-8 UTF-8"
++ done
++ for l in lt lt_LT lv lv_LV; do
++ #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
++ echo "$l ISO-8859-13"
++ done
++ for l in ru_UA uk uk_UA; do
++ echo "$l KOI8-U"
++ done
++ for l in zh zh_CN; do
++ #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
++ echo "$l GB2312"
++ done
++ for l in ja ja_JP ja_JP.EUC; do
++ echo "$l EUC-JP"
++ done
++ for l in ko ko_KR; do
++ echo "$l EUC-KR"
++ done
++ for l in th th_TH; do
++ echo "$l TIS-620"
++ done
++ for l in fa fa_IR; do
++ #echo "$l ISIRI-3342" # a broken encoding
++ echo "$l.utf-8 UTF-8"
++ done
++ ;;
++ linux* | *-gnu*)
++ # With glibc-2.1 or newer, we don't need any canonicalization,
++ # because glibc has iconv and both glibc and libiconv support all
++ # GNU canonical names directly. Therefore, the Makefile does not
++ # need to install the alias file at all.
++ # The following applies only to glibc-2.0.x and older libcs.
++ echo "ISO_646.IRV:1983 ASCII"
++ ;;
++ aix*)
++ echo "ISO8859-1 ISO-8859-1"
++ echo "ISO8859-2 ISO-8859-2"
++ echo "ISO8859-5 ISO-8859-5"
++ echo "ISO8859-6 ISO-8859-6"
++ echo "ISO8859-7 ISO-8859-7"
++ echo "ISO8859-8 ISO-8859-8"
++ echo "ISO8859-9 ISO-8859-9"
++ echo "ISO8859-15 ISO-8859-15"
++ echo "IBM-850 CP850"
++ echo "IBM-856 CP856"
++ echo "IBM-921 ISO-8859-13"
++ echo "IBM-922 CP922"
++ echo "IBM-932 CP932"
++ echo "IBM-943 CP943"
++ echo "IBM-1046 CP1046"
++ echo "IBM-1124 CP1124"
++ echo "IBM-1129 CP1129"
++ echo "IBM-1252 CP1252"
++ echo "IBM-eucCN GB2312"
++ echo "IBM-eucJP EUC-JP"
++ echo "IBM-eucKR EUC-KR"
++ echo "IBM-eucTW EUC-TW"
++ echo "big5 BIG5"
++ echo "GBK GBK"
++ echo "TIS-620 TIS-620"
++ echo "UTF-8 UTF-8"
++ ;;
++ hpux*)
++ echo "iso88591 ISO-8859-1"
++ echo "iso88592 ISO-8859-2"
++ echo "iso88595 ISO-8859-5"
++ echo "iso88596 ISO-8859-6"
++ echo "iso88597 ISO-8859-7"
++ echo "iso88598 ISO-8859-8"
++ echo "iso88599 ISO-8859-9"
++ echo "iso885915 ISO-8859-15"
++ echo "roman8 HP-ROMAN8"
++ echo "arabic8 HP-ARABIC8"
++ echo "greek8 HP-GREEK8"
++ echo "hebrew8 HP-HEBREW8"
++ echo "turkish8 HP-TURKISH8"
++ echo "kana8 HP-KANA8"
++ echo "tis620 TIS-620"
++ echo "big5 BIG5"
++ echo "eucJP EUC-JP"
++ echo "eucKR EUC-KR"
++ echo "eucTW EUC-TW"
++ echo "hp15CN GB2312"
++ #echo "ccdc ?" # what is this?
++ echo "SJIS SHIFT_JIS"
++ echo "utf8 UTF-8"
++ ;;
++ irix*)
++ echo "ISO8859-1 ISO-8859-1"
++ echo "ISO8859-2 ISO-8859-2"
++ echo "ISO8859-5 ISO-8859-5"
++ echo "ISO8859-7 ISO-8859-7"
++ echo "ISO8859-9 ISO-8859-9"
++ echo "eucCN GB2312"
++ echo "eucJP EUC-JP"
++ echo "eucKR EUC-KR"
++ echo "eucTW EUC-TW"
++ ;;
++ osf*)
++ echo "ISO8859-1 ISO-8859-1"
++ echo "ISO8859-2 ISO-8859-2"
++ echo "ISO8859-4 ISO-8859-4"
++ echo "ISO8859-5 ISO-8859-5"
++ echo "ISO8859-7 ISO-8859-7"
++ echo "ISO8859-8 ISO-8859-8"
++ echo "ISO8859-9 ISO-8859-9"
++ echo "ISO8859-15 ISO-8859-15"
++ echo "cp850 CP850"
++ echo "big5 BIG5"
++ echo "dechanyu DEC-HANYU"
++ echo "dechanzi GB2312"
++ echo "deckanji DEC-KANJI"
++ echo "deckorean EUC-KR"
++ echo "eucJP EUC-JP"
++ echo "eucKR EUC-KR"
++ echo "eucTW EUC-TW"
++ echo "GBK GBK"
++ echo "KSC5601 CP949"
++ echo "sdeckanji EUC-JP"
++ echo "SJIS SHIFT_JIS"
++ echo "TACTIS TIS-620"
++ echo "UTF-8 UTF-8"
++ ;;
++ solaris*)
++ echo "646 ASCII"
++ echo "ISO8859-1 ISO-8859-1"
++ echo "ISO8859-2 ISO-8859-2"
++ echo "ISO8859-3 ISO-8859-3"
++ echo "ISO8859-4 ISO-8859-4"
++ echo "ISO8859-5 ISO-8859-5"
++ echo "ISO8859-6 ISO-8859-6"
++ echo "ISO8859-7 ISO-8859-7"
++ echo "ISO8859-8 ISO-8859-8"
++ echo "ISO8859-9 ISO-8859-9"
++ echo "ISO8859-15 ISO-8859-15"
++ echo "koi8-r KOI8-R"
++ echo "ansi-1251 CP1251"
++ echo "BIG5 BIG5"
++ echo "Big5-HKSCS BIG5-HKSCS"
++ echo "gb2312 GB2312"
++ echo "GBK GBK"
++ echo "GB18030 GB18030"
++ echo "cns11643 EUC-TW"
++ echo "5601 EUC-KR"
++ echo "ko_KR.johap92 JOHAB"
++ echo "eucJP EUC-JP"
++ echo "PCK SHIFT_JIS"
++ echo "TIS620.2533 TIS-620"
++ #echo "sun_eu_greek ?" # what is this?
++ echo "UTF-8 UTF-8"
++ ;;
++ freebsd* | os2*)
++ # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
++ # localcharset.c falls back to using the full locale name
++ # from the environment variables.
++ # Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
++ # reuse FreeBSD's locale data for OS/2.
++ echo "C ASCII"
++ echo "US-ASCII ASCII"
++ for l in la_LN lt_LN; do
++ echo "$l.ASCII ASCII"
++ done
++ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
++ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
++ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
++ echo "$l.ISO_8859-1 ISO-8859-1"
++ echo "$l.DIS_8859-15 ISO-8859-15"
++ done
++ for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
++ echo "$l.ISO_8859-2 ISO-8859-2"
++ done
++ for l in la_LN lt_LT; do
++ echo "$l.ISO_8859-4 ISO-8859-4"
++ done
++ for l in ru_RU ru_SU; do
++ echo "$l.KOI8-R KOI8-R"
++ echo "$l.ISO_8859-5 ISO-8859-5"
++ echo "$l.CP866 CP866"
++ done
++ echo "uk_UA.KOI8-U KOI8-U"
++ echo "zh_TW.BIG5 BIG5"
++ echo "zh_TW.Big5 BIG5"
++ echo "zh_CN.EUC GB2312"
++ echo "ja_JP.EUC EUC-JP"
++ echo "ja_JP.SJIS SHIFT_JIS"
++ echo "ja_JP.Shift_JIS SHIFT_JIS"
++ echo "ko_KR.EUC EUC-KR"
++ ;;
++ netbsd*)
++ echo "646 ASCII"
++ echo "ISO8859-1 ISO-8859-1"
++ echo "ISO8859-2 ISO-8859-2"
++ echo "ISO8859-4 ISO-8859-4"
++ echo "ISO8859-5 ISO-8859-5"
++ echo "ISO8859-15 ISO-8859-15"
++ echo "eucCN GB2312"
++ echo "eucJP EUC-JP"
++ echo "eucKR EUC-KR"
++ echo "eucTW EUC-TW"
++ echo "BIG5 BIG5"
++ echo "SJIS SHIFT_JIS"
++ ;;
++ darwin*)
++ # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
++ # localcharset.c falls back to using the full locale name
++ # from the environment variables.
++ echo "C ASCII"
++ for l in en_AU en_CA en_GB en_US la_LN; do
++ echo "$l.US-ASCII ASCII"
++ done
++ for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
++ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
++ nl_NL no_NO pt_PT sv_SE; do
++ echo "$l ISO-8859-1"
++ echo "$l.ISO8859-1 ISO-8859-1"
++ echo "$l.ISO8859-15 ISO-8859-15"
++ done
++ for l in la_LN; do
++ echo "$l.ISO8859-1 ISO-8859-1"
++ echo "$l.ISO8859-15 ISO-8859-15"
++ done
++ for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
++ echo "$l.ISO8859-2 ISO-8859-2"
++ done
++ for l in la_LN lt_LT; do
++ echo "$l.ISO8859-4 ISO-8859-4"
++ done
++ for l in ru_RU; do
++ echo "$l.KOI8-R KOI8-R"
++ echo "$l.ISO8859-5 ISO-8859-5"
++ echo "$l.CP866 CP866"
++ done
++ for l in bg_BG; do
++ echo "$l.CP1251 CP1251"
++ done
++ echo "uk_UA.KOI8-U KOI8-U"
++ echo "zh_TW.BIG5 BIG5"
++ echo "zh_TW.Big5 BIG5"
++ echo "zh_CN.EUC GB2312"
++ echo "ja_JP.EUC EUC-JP"
++ echo "ja_JP.SJIS SHIFT_JIS"
++ echo "ko_KR.EUC EUC-KR"
++ ;;
++ beos*)
++ # BeOS has a single locale, and it has UTF-8 encoding.
++ echo "* UTF-8"
++ ;;
++ msdosdjgpp*)
++ # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
++ # localcharset.c falls back to using the full locale name
++ # from the environment variables.
++ echo "#"
++ echo "# The encodings given here may not all be correct."
++ echo "# If you find that the encoding given for your language and"
++ echo "# country is not the one your DOS machine actually uses, just"
++ echo "# correct it in this file, and send a mail to"
++ echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
++ echo "# and Bruno Haible <bruno@clisp.org>."
++ echo "#"
++ echo "C ASCII"
++ # ISO-8859-1 languages
++ echo "ca CP850"
++ echo "ca_ES CP850"
++ echo "da CP865" # not CP850 ??
++ echo "da_DK CP865" # not CP850 ??
++ echo "de CP850"
++ echo "de_AT CP850"
++ echo "de_CH CP850"
++ echo "de_DE CP850"
++ echo "en CP850"
++ echo "en_AU CP850" # not CP437 ??
++ echo "en_CA CP850"
++ echo "en_GB CP850"
++ echo "en_NZ CP437"
++ echo "en_US CP437"
++ echo "en_ZA CP850" # not CP437 ??
++ echo "es CP850"
++ echo "es_AR CP850"
++ echo "es_BO CP850"
++ echo "es_CL CP850"
++ echo "es_CO CP850"
++ echo "es_CR CP850"
++ echo "es_CU CP850"
++ echo "es_DO CP850"
++ echo "es_EC CP850"
++ echo "es_ES CP850"
++ echo "es_GT CP850"
++ echo "es_HN CP850"
++ echo "es_MX CP850"
++ echo "es_NI CP850"
++ echo "es_PA CP850"
++ echo "es_PY CP850"
++ echo "es_PE CP850"
++ echo "es_SV CP850"
++ echo "es_UY CP850"
++ echo "es_VE CP850"
++ echo "et CP850"
++ echo "et_EE CP850"
++ echo "eu CP850"
++ echo "eu_ES CP850"
++ echo "fi CP850"
++ echo "fi_FI CP850"
++ echo "fr CP850"
++ echo "fr_BE CP850"
++ echo "fr_CA CP850"
++ echo "fr_CH CP850"
++ echo "fr_FR CP850"
++ echo "ga CP850"
++ echo "ga_IE CP850"
++ echo "gd CP850"
++ echo "gd_GB CP850"
++ echo "gl CP850"
++ echo "gl_ES CP850"
++ echo "id CP850" # not CP437 ??
++ echo "id_ID CP850" # not CP437 ??
++ echo "is CP861" # not CP850 ??
++ echo "is_IS CP861" # not CP850 ??
++ echo "it CP850"
++ echo "it_CH CP850"
++ echo "it_IT CP850"
++ echo "lt CP775"
++ echo "lt_LT CP775"
++ echo "lv CP775"
++ echo "lv_LV CP775"
++ echo "nb CP865" # not CP850 ??
++ echo "nb_NO CP865" # not CP850 ??
++ echo "nl CP850"
++ echo "nl_BE CP850"
++ echo "nl_NL CP850"
++ echo "nn CP865" # not CP850 ??
++ echo "nn_NO CP865" # not CP850 ??
++ echo "no CP865" # not CP850 ??
++ echo "no_NO CP865" # not CP850 ??
++ echo "pt CP850"
++ echo "pt_BR CP850"
++ echo "pt_PT CP850"
++ echo "sv CP850"
++ echo "sv_SE CP850"
++ # ISO-8859-2 languages
++ echo "cs CP852"
++ echo "cs_CZ CP852"
++ echo "hr CP852"
++ echo "hr_HR CP852"
++ echo "hu CP852"
++ echo "hu_HU CP852"
++ echo "pl CP852"
++ echo "pl_PL CP852"
++ echo "ro CP852"
++ echo "ro_RO CP852"
++ echo "sk CP852"
++ echo "sk_SK CP852"
++ echo "sl CP852"
++ echo "sl_SI CP852"
++ echo "sq CP852"
++ echo "sq_AL CP852"
++ echo "sr CP852" # CP852 or CP866 or CP855 ??
++ echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
++ echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
++ # ISO-8859-3 languages
++ echo "mt CP850"
++ echo "mt_MT CP850"
++ # ISO-8859-5 languages
++ echo "be CP866"
++ echo "be_BE CP866"
++ echo "bg CP866" # not CP855 ??
++ echo "bg_BG CP866" # not CP855 ??
++ echo "mk CP866" # not CP855 ??
++ echo "mk_MK CP866" # not CP855 ??
++ echo "ru CP866"
++ echo "ru_RU CP866"
++ echo "uk CP1125"
++ echo "uk_UA CP1125"
++ # ISO-8859-6 languages
++ echo "ar CP864"
++ echo "ar_AE CP864"
++ echo "ar_DZ CP864"
++ echo "ar_EG CP864"
++ echo "ar_IQ CP864"
++ echo "ar_IR CP864"
++ echo "ar_JO CP864"
++ echo "ar_KW CP864"
++ echo "ar_MA CP864"
++ echo "ar_OM CP864"
++ echo "ar_QA CP864"
++ echo "ar_SA CP864"
++ echo "ar_SY CP864"
++ # ISO-8859-7 languages
++ echo "el CP869"
++ echo "el_GR CP869"
++ # ISO-8859-8 languages
++ echo "he CP862"
++ echo "he_IL CP862"
++ # ISO-8859-9 languages
++ echo "tr CP857"
++ echo "tr_TR CP857"
++ # Japanese
++ echo "ja CP932"
++ echo "ja_JP CP932"
++ # Chinese
++ echo "zh_CN GBK"
++ echo "zh_TW CP950" # not CP938 ??
++ # Korean
++ echo "kr CP949" # not CP934 ??
++ echo "kr_KR CP949" # not CP934 ??
++ # Thai
++ echo "th CP874"
++ echo "th_TH CP874"
++ # Other
++ echo "eo CP850"
++ echo "eo_EO CP850"
++ ;;
++esac
+--- lrzsz-0.12.20.safe/intl/dcgettext.c 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/dcgettext.c 2004-09-12 14:40:34.359747480 -0400
+@@ -1,593 +1,56 @@
+-/* Implementation of the dcgettext(3) function
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Implementation of the dcgettext(3) function.
++ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#include <sys/types.h>
+-
+-#ifdef __GNUC__
+-# define alloca __builtin_alloca
+-# define HAVE_ALLOCA 1
+-#else
+-# if defined HAVE_ALLOCA_H || defined _LIBC
+-# include <alloca.h>
+-# else
+-# ifdef _AIX
+- #pragma alloca
+-# else
+-# ifndef alloca
+-char *alloca ();
+-# endif
+-# endif
+-# endif
+-#endif
+-
+-#include <errno.h>
+-#ifndef errno
+-extern int errno;
+-#endif
+-#ifndef __set_errno
+-# define __set_errno(val) errno = (val)
+-#endif
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-# include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-# define _GNU_SOURCE 1
+-# endif
+-# include <string.h>
+-#else
+-# include <strings.h>
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-# define strchr index
+-# endif
+-#endif
+-
+-#if defined HAVE_UNISTD_H || defined _LIBC
+-# include <unistd.h>
+-#endif
+-
+-#include "gettext.h"
+ #include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+-#include "hash-string.h"
+
+ /* @@ end of prolog @@ */
+
+-#ifdef _LIBC
+-/* Rename the non ANSI C functions. This is required by the standard
+- because some ANSI C functions will require linking with this object
+- file and the name space must not be polluted. */
+-# define getcwd __getcwd
+-# define stpcpy __stpcpy
+-#else
+-# if !defined HAVE_GETCWD
+-char *getwd ();
+-# define getcwd(buf, max) getwd (buf)
+-# else
+-char *getcwd ();
+-# endif
+-# ifndef HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
+-# endif
+-#endif
+-
+-/* Amount to increase buffer size by in each try. */
+-#define PATH_INCR 32
+-
+-/* The following is from pathmax.h. */
+-/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+- PATH_MAX but might cause redefinition warnings when sys/param.h is
+- later included (as on MORE/BSD 4.3). */
+-#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
+-# include <limits.h>
+-#endif
+-
+-#ifndef _POSIX_PATH_MAX
+-# define _POSIX_PATH_MAX 255
+-#endif
+-
+-#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
+-# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+-#endif
+-
+-/* Don't include sys/param.h if it already has been. */
+-#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
+-# include <sys/param.h>
+-#endif
+-
+-#if !defined(PATH_MAX) && defined(MAXPATHLEN)
+-# define PATH_MAX MAXPATHLEN
+-#endif
+-
+-#ifndef PATH_MAX
+-# define PATH_MAX _POSIX_PATH_MAX
+-#endif
+-
+-/* XPG3 defines the result of `setlocale (category, NULL)' as:
+- ``Directs `setlocale()' to query `category' and return the current
+- setting of `local'.''
+- However it does not specify the exact format. And even worse: POSIX
+- defines this not at all. So we can use this feature only on selected
+- system (e.g. those using GNU C Library). */
+-#ifdef _LIBC
+-# define HAVE_LOCALE_NULL
+-#endif
+-
+-/* Name of the default domain used for gettext(3) prior any call to
+- textdomain(3). The default value for this is "messages". */
+-const char _nl_default_default_domain[] = "messages";
+-
+-/* Value used as the default domain for gettext(3). */
+-const char *_nl_current_default_domain = _nl_default_default_domain;
+-
+-/* Contains the default location of the message catalogs. */
+-const char _nl_default_dirname[] = GNULOCALEDIR;
+-
+-/* List with bindings of specific domains created by bindtextdomain()
+- calls. */
+-struct binding *_nl_domain_bindings;
+-
+-/* Prototypes for local functions. */
+-static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+- const char *msgid));
+-static const char *category_to_name PARAMS ((int category));
+-static const char *guess_category_value PARAMS ((int category,
+- const char *categoryname));
+-
+-
+-/* For those loosing systems which don't have `alloca' we have to add
+- some additional code emulating it. */
+-#ifdef HAVE_ALLOCA
+-/* Nothing has to be done. */
+-# define ADD_BLOCK(list, address) /* nothing */
+-# define FREE_BLOCKS(list) /* nothing */
+-#else
+-struct block_list
+-{
+- void *address;
+- struct block_list *next;
+-};
+-# define ADD_BLOCK(list, addr) \
+- do { \
+- struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+- /* If we cannot get a free block we cannot add the new element to \
+- the list. */ \
+- if (newp != NULL) { \
+- newp->address = (addr); \
+- newp->next = (list); \
+- (list) = newp; \
+- } \
+- } while (0)
+-# define FREE_BLOCKS(list) \
+- do { \
+- while (list != NULL) { \
+- struct block_list *old = list; \
+- list = list->next; \
+- free (old); \
+- } \
+- } while (0)
+-# undef alloca
+-# define alloca(size) (malloc (size))
+-#endif /* have alloca */
+-
+-
+ /* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+ #ifdef _LIBC
+ # define DCGETTEXT __dcgettext
++# define DCIGETTEXT __dcigettext
+ #else
+-# define DCGETTEXT dcgettext__
++# define DCGETTEXT libintl_dcgettext
++# define DCIGETTEXT libintl_dcigettext
+ #endif
+
+ /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+ char *
+-DCGETTEXT (domainname, msgid, category)
+- const char *domainname;
+- const char *msgid;
+- int category;
++DCGETTEXT (const char *domainname, const char *msgid, int category)
+ {
+-#ifndef HAVE_ALLOCA
+- struct block_list *block_list = NULL;
+-#endif
+- struct loaded_l10nfile *domain;
+- struct binding *binding;
+- const char *categoryname;
+- const char *categoryvalue;
+- char *dirname, *xdomainname;
+- char *single_locale;
+- char *retval;
+- int saved_errno = errno;
+-
+- /* If no real MSGID is given return NULL. */
+- if (msgid == NULL)
+- return NULL;
+-
+- /* If DOMAINNAME is NULL, we are interested in the default domain. If
+- CATEGORY is not LC_MESSAGES this might not make much sense but the
+- defintion left this undefined. */
+- if (domainname == NULL)
+- domainname = _nl_current_default_domain;
+-
+- /* First find matching binding. */
+- for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+- {
+- int compare = strcmp (domainname, binding->domainname);
+- if (compare == 0)
+- /* We found it! */
+- break;
+- if (compare < 0)
+- {
+- /* It is not in the list. */
+- binding = NULL;
+- break;
+- }
+- }
+-
+- if (binding == NULL)
+- dirname = (char *) _nl_default_dirname;
+- else if (binding->dirname[0] == '/')
+- dirname = binding->dirname;
+- else
+- {
+- /* We have a relative path. Make it absolute now. */
+- size_t dirname_len = strlen (binding->dirname) + 1;
+- size_t path_max;
+- char *ret;
+-
+- path_max = (unsigned) PATH_MAX;
+- path_max += 2; /* The getcwd docs say to do this. */
+-
+- dirname = (char *) alloca (path_max + dirname_len);
+- ADD_BLOCK (block_list, dirname);
+-
+- __set_errno (0);
+- while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
+- {
+- path_max += PATH_INCR;
+- dirname = (char *) alloca (path_max + dirname_len);
+- ADD_BLOCK (block_list, dirname);
+- __set_errno (0);
+- }
+-
+- if (ret == NULL)
+- {
+- /* We cannot get the current working directory. Don't signal an
+- error but simply return the default string. */
+- FREE_BLOCKS (block_list);
+- __set_errno (saved_errno);
+- return (char *) msgid;
+- }
+-
+- stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+- }
+-
+- /* Now determine the symbolic name of CATEGORY and its value. */
+- categoryname = category_to_name (category);
+- categoryvalue = guess_category_value (category, categoryname);
+-
+- xdomainname = (char *) alloca (strlen (categoryname)
+- + strlen (domainname) + 5);
+- ADD_BLOCK (block_list, xdomainname);
+-
+- stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+- domainname),
+- ".mo");
+-
+- /* Creating working area. */
+- single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+- ADD_BLOCK (block_list, single_locale);
+-
+-
+- /* Search for the given string. This is a loop because we perhaps
+- got an ordered list of languages to consider for th translation. */
+- while (1)
+- {
+- /* Make CATEGORYVALUE point to the next element of the list. */
+- while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+- ++categoryvalue;
+- if (categoryvalue[0] == '\0')
+- {
+- /* The whole contents of CATEGORYVALUE has been searched but
+- no valid entry has been found. We solve this situation
+- by implicitly appending a "C" entry, i.e. no translation
+- will take place. */
+- single_locale[0] = 'C';
+- single_locale[1] = '\0';
+- }
+- else
+- {
+- char *cp = single_locale;
+- while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+- *cp++ = *categoryvalue++;
+- *cp = '\0';
+- }
+-
+- /* If the current locale value is C (or POSIX) we don't load a
+- domain. Return the MSGID. */
+- if (strcmp (single_locale, "C") == 0
+- || strcmp (single_locale, "POSIX") == 0)
+- {
+- FREE_BLOCKS (block_list);
+- __set_errno (saved_errno);
+- return (char *) msgid;
+- }
+-
+-
+- /* Find structure describing the message catalog matching the
+- DOMAINNAME and CATEGORY. */
+- domain = _nl_find_domain (dirname, single_locale, xdomainname);
+-
+- if (domain != NULL)
+- {
+- retval = find_msg (domain, msgid);
+-
+- if (retval == NULL)
+- {
+- int cnt;
+-
+- for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+- {
+- retval = find_msg (domain->successor[cnt], msgid);
+-
+- if (retval != NULL)
+- break;
+- }
+- }
+-
+- if (retval != NULL)
+- {
+- FREE_BLOCKS (block_list);
+- __set_errno (saved_errno);
+- return retval;
+- }
+- }
+- }
+- /* NOTREACHED */
++ return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
+ }
+
+ #ifdef _LIBC
+ /* Alias for function name in GNU C Library. */
++INTDEF(__dcgettext)
+ weak_alias (__dcgettext, dcgettext);
+ #endif
+-
+-
+-static char *
+-find_msg (domain_file, msgid)
+- struct loaded_l10nfile *domain_file;
+- const char *msgid;
+-{
+- size_t top, act, bottom;
+- struct loaded_domain *domain;
+-
+- if (domain_file->decided == 0)
+- _nl_load_domain (domain_file);
+-
+- if (domain_file->data == NULL)
+- return NULL;
+-
+- domain = (struct loaded_domain *) domain_file->data;
+-
+- /* Locate the MSGID and its translation. */
+- if (domain->hash_size > 2 && domain->hash_tab != NULL)
+- {
+- /* Use the hashing table. */
+- nls_uint32 len = strlen (msgid);
+- nls_uint32 hash_val = hash_string (msgid);
+- nls_uint32 idx = hash_val % domain->hash_size;
+- nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+- nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+-
+- if (nstr == 0)
+- /* Hash table entry is empty. */
+- return NULL;
+-
+- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+- && strcmp (msgid,
+- domain->data + W (domain->must_swap,
+- domain->orig_tab[nstr - 1].offset)) == 0)
+- return (char *) domain->data + W (domain->must_swap,
+- domain->trans_tab[nstr - 1].offset);
+-
+- while (1)
+- {
+- if (idx >= domain->hash_size - incr)
+- idx -= domain->hash_size - incr;
+- else
+- idx += incr;
+-
+- nstr = W (domain->must_swap, domain->hash_tab[idx]);
+- if (nstr == 0)
+- /* Hash table entry is empty. */
+- return NULL;
+-
+- if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+- && strcmp (msgid,
+- domain->data + W (domain->must_swap,
+- domain->orig_tab[nstr - 1].offset))
+- == 0)
+- return (char *) domain->data
+- + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
+- }
+- /* NOTREACHED */
+- }
+-
+- /* Now we try the default method: binary search in the sorted
+- array of messages. */
+- bottom = 0;
+- top = domain->nstrings;
+- while (bottom < top)
+- {
+- int cmp_val;
+-
+- act = (bottom + top) / 2;
+- cmp_val = strcmp (msgid, domain->data
+- + W (domain->must_swap,
+- domain->orig_tab[act].offset));
+- if (cmp_val < 0)
+- top = act;
+- else if (cmp_val > 0)
+- bottom = act + 1;
+- else
+- break;
+- }
+-
+- /* If an translation is found return this. */
+- return bottom >= top ? NULL : (char *) domain->data
+- + W (domain->must_swap,
+- domain->trans_tab[act].offset);
+-}
+-
+-
+-/* Return string representation of locale CATEGORY. */
+-static const char *
+-category_to_name (category)
+- int category;
+-{
+- const char *retval;
+-
+- switch (category)
+- {
+-#ifdef LC_COLLATE
+- case LC_COLLATE:
+- retval = "LC_COLLATE";
+- break;
+-#endif
+-#ifdef LC_CTYPE
+- case LC_CTYPE:
+- retval = "LC_CTYPE";
+- break;
+-#endif
+-#ifdef LC_MONETARY
+- case LC_MONETARY:
+- retval = "LC_MONETARY";
+- break;
+-#endif
+-#ifdef LC_NUMERIC
+- case LC_NUMERIC:
+- retval = "LC_NUMERIC";
+- break;
+-#endif
+-#ifdef LC_TIME
+- case LC_TIME:
+- retval = "LC_TIME";
+- break;
+-#endif
+-#ifdef LC_MESSAGES
+- case LC_MESSAGES:
+- retval = "LC_MESSAGES";
+- break;
+-#endif
+-#ifdef LC_RESPONSE
+- case LC_RESPONSE:
+- retval = "LC_RESPONSE";
+- break;
+-#endif
+-#ifdef LC_ALL
+- case LC_ALL:
+- /* This might not make sense but is perhaps better than any other
+- value. */
+- retval = "LC_ALL";
+- break;
+-#endif
+- default:
+- /* If you have a better idea for a default value let me know. */
+- retval = "LC_XXX";
+- }
+-
+- return retval;
+-}
+-
+-/* Guess value of current locale from value of the environment variables. */
+-static const char *
+-guess_category_value (category, categoryname)
+- int category;
+- const char *categoryname;
+-{
+- const char *retval;
+-
+- /* The highest priority value is the `LANGUAGE' environment
+- variable. This is a GNU extension. */
+- retval = getenv ("LANGUAGE");
+- if (retval != NULL && retval[0] != '\0')
+- return retval;
+-
+- /* `LANGUAGE' is not set. So we have to proceed with the POSIX
+- methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some
+- systems this can be done by the `setlocale' function itself. */
+-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+- return setlocale (category, NULL);
+-#else
+- /* Setting of LC_ALL overwrites all other. */
+- retval = getenv ("LC_ALL");
+- if (retval != NULL && retval[0] != '\0')
+- return retval;
+-
+- /* Next comes the name of the desired category. */
+- retval = getenv (categoryname);
+- if (retval != NULL && retval[0] != '\0')
+- return retval;
+-
+- /* Last possibility is the LANG environment variable. */
+- retval = getenv ("LANG");
+- if (retval != NULL && retval[0] != '\0')
+- return retval;
+-
+- /* We use C as the default domain. POSIX says this is implementation
+- defined. */
+- return "C";
+-#endif
+-}
+-
+-/* @@ begin of epilog @@ */
+-
+-/* We don't want libintl.a to depend on any other library. So we
+- avoid the non-standard function stpcpy. In GNU C Library this
+- function is available, though. Also allow the symbol HAVE_STPCPY
+- to be defined. */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *
+-stpcpy (dest, src)
+- char *dest;
+- const char *src;
+-{
+- while ((*dest++ = *src++) != '\0')
+- /* Do nothing. */ ;
+- return dest - 1;
+-}
+-#endif
+--- lrzsz-0.12.20.safe/intl/dcigettext.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dcigettext.c 2004-09-12 14:40:34.369745960 -0400
+@@ -0,0 +1,1219 @@
++/* Implementation of the internal dcigettext function.
++ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <sys/types.h>
++
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
++# else
++# if defined HAVE_ALLOCA_H || defined _LIBC
++# include <alloca.h>
++# else
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca
++char *alloca ();
++# endif
++# endif
++# endif
++# endif
++#endif
++
++#include <errno.h>
++#ifndef errno
++extern int errno;
++#endif
++#ifndef __set_errno
++# define __set_errno(val) errno = (val)
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
++
++#if defined HAVE_UNISTD_H || defined _LIBC
++# include <unistd.h>
++#endif
++
++#include <locale.h>
++
++#ifdef _LIBC
++ /* Guess whether integer division by zero raises signal SIGFPE.
++ Set to 1 only if you know for sure. In case of doubt, set to 0. */
++# if defined __alpha__ || defined __arm__ || defined __i386__ \
++ || defined __m68k__ || defined __s390__
++# define INTDIV0_RAISES_SIGFPE 1
++# else
++# define INTDIV0_RAISES_SIGFPE 0
++# endif
++#endif
++#if !INTDIV0_RAISES_SIGFPE
++# include <signal.h>
++#endif
++
++#if defined HAVE_SYS_PARAM_H || defined _LIBC
++# include <sys/param.h>
++#endif
++
++#include "gettextP.h"
++#include "plural-exp.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++#include "hash-string.h"
++
++/* Thread safetyness. */
++#ifdef _LIBC
++# include <bits/libc-lock.h>
++#else
++/* Provide dummy implementation if this is outside glibc. */
++# define __libc_lock_define_initialized(CLASS, NAME)
++# define __libc_lock_lock(NAME)
++# define __libc_lock_unlock(NAME)
++# define __libc_rwlock_define_initialized(CLASS, NAME)
++# define __libc_rwlock_rdlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* Alignment of types. */
++#if defined __GNUC__ && __GNUC__ >= 2
++# define alignof(TYPE) __alignof__ (TYPE)
++#else
++# define alignof(TYPE) \
++ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++ names than the internal variables in GNU libc, otherwise programs
++ using libintl.a cannot be linked statically. */
++#if !defined _LIBC
++# define _nl_default_default_domain libintl_nl_default_default_domain
++# define _nl_current_default_domain libintl_nl_current_default_domain
++# define _nl_default_dirname libintl_nl_default_dirname
++# define _nl_domain_bindings libintl_nl_domain_bindings
++#endif
++
++/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>. */
++#ifndef offsetof
++# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
++#endif
++
++/* @@ end of prolog @@ */
++
++#ifdef _LIBC
++/* Rename the non ANSI C functions. This is required by the standard
++ because some ANSI C functions will require linking with this object
++ file and the name space must not be polluted. */
++# define getcwd __getcwd
++# ifndef stpcpy
++# define stpcpy __stpcpy
++# endif
++# define tfind __tfind
++#else
++# if !defined HAVE_GETCWD
++char *getwd ();
++# define getcwd(buf, max) getwd (buf)
++# else
++# if VMS
++# define getcwd(buf, max) (getcwd) (buf, max, 0)
++# else
++char *getcwd ();
++# endif
++# endif
++# ifndef HAVE_STPCPY
++static char *stpcpy (char *dest, const char *src);
++# endif
++# ifndef HAVE_MEMPCPY
++static void *mempcpy (void *dest, const void *src, size_t n);
++# endif
++#endif
++
++/* Amount to increase buffer size by in each try. */
++#define PATH_INCR 32
++
++/* The following is from pathmax.h. */
++/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
++ PATH_MAX but might cause redefinition warnings when sys/param.h is
++ later included (as on MORE/BSD 4.3). */
++#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__)
++# include <limits.h>
++#endif
++
++#ifndef _POSIX_PATH_MAX
++# define _POSIX_PATH_MAX 255
++#endif
++
++#if !defined PATH_MAX && defined _PC_PATH_MAX
++# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
++#endif
++
++/* Don't include sys/param.h if it already has been. */
++#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
++# include <sys/param.h>
++#endif
++
++#if !defined PATH_MAX && defined MAXPATHLEN
++# define PATH_MAX MAXPATHLEN
++#endif
++
++#ifndef PATH_MAX
++# define PATH_MAX _POSIX_PATH_MAX
++#endif
++
++/* Pathname support.
++ ISSLASH(C) tests whether C is a directory separator character.
++ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
++ it may be concatenated to a directory pathname.
++ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++ && (P)[1] == ':')
++# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
++# define IS_PATH_WITH_DIR(P) \
++ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
++#else
++ /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
++# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
++#endif
++
++/* This is the type used for the search tree where known translations
++ are stored. */
++struct known_translation_t
++{
++ /* Domain in which to search. */
++ char *domainname;
++
++ /* The category. */
++ int category;
++
++ /* State of the catalog counter at the point the string was found. */
++ int counter;
++
++ /* Catalog where the string was found. */
++ struct loaded_l10nfile *domain;
++
++ /* And finally the translation. */
++ const char *translation;
++ size_t translation_length;
++
++ /* Pointer to the string in question. */
++ char msgid[ZERO];
++};
++
++/* Root of the search tree with known translations. We can use this
++ only if the system provides the `tsearch' function family. */
++#if defined HAVE_TSEARCH || defined _LIBC
++# include <search.h>
++
++static void *root;
++
++# ifdef _LIBC
++# define tsearch __tsearch
++# endif
++
++/* Function to compare two entries in the table of known translations. */
++static int
++transcmp (const void *p1, const void *p2)
++{
++ const struct known_translation_t *s1;
++ const struct known_translation_t *s2;
++ int result;
++
++ s1 = (const struct known_translation_t *) p1;
++ s2 = (const struct known_translation_t *) p2;
++
++ result = strcmp (s1->msgid, s2->msgid);
++ if (result == 0)
++ {
++ result = strcmp (s1->domainname, s2->domainname);
++ if (result == 0)
++ /* We compare the category last (though this is the cheapest
++ operation) since it is hopefully always the same (namely
++ LC_MESSAGES). */
++ result = s1->category - s2->category;
++ }
++
++ return result;
++}
++#endif
++
++#ifndef INTVARDEF
++# define INTVARDEF(name)
++#endif
++#ifndef INTUSE
++# define INTUSE(name) name
++#endif
++
++/* Name of the default domain used for gettext(3) prior any call to
++ textdomain(3). The default value for this is "messages". */
++const char _nl_default_default_domain[] attribute_hidden = "messages";
++
++/* Value used as the default domain for gettext(3). */
++const char *_nl_current_default_domain attribute_hidden
++ = _nl_default_default_domain;
++
++/* Contains the default location of the message catalogs. */
++#if defined __EMX__
++extern const char _nl_default_dirname[];
++#else
++const char _nl_default_dirname[] = LOCALEDIR;
++INTVARDEF (_nl_default_dirname)
++#endif
++
++/* List with bindings of specific domains created by bindtextdomain()
++ calls. */
++struct binding *_nl_domain_bindings;
++
++/* Prototypes for local functions. */
++static char *plural_lookup (struct loaded_l10nfile *domain,
++ unsigned long int n,
++ const char *translation, size_t translation_len)
++ internal_function;
++static const char *guess_category_value (int category,
++ const char *categoryname)
++ internal_function;
++#ifdef _LIBC
++# include "../locale/localeinfo.h"
++# define category_to_name(category) _nl_category_names[category]
++#else
++static const char *category_to_name (int category) internal_function;
++#endif
++
++
++/* For those loosing systems which don't have `alloca' we have to add
++ some additional code emulating it. */
++#ifdef HAVE_ALLOCA
++/* Nothing has to be done. */
++# define freea(p) /* nothing */
++# define ADD_BLOCK(list, address) /* nothing */
++# define FREE_BLOCKS(list) /* nothing */
++#else
++struct block_list
++{
++ void *address;
++ struct block_list *next;
++};
++# define ADD_BLOCK(list, addr) \
++ do { \
++ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
++ /* If we cannot get a free block we cannot add the new element to \
++ the list. */ \
++ if (newp != NULL) { \
++ newp->address = (addr); \
++ newp->next = (list); \
++ (list) = newp; \
++ } \
++ } while (0)
++# define FREE_BLOCKS(list) \
++ do { \
++ while (list != NULL) { \
++ struct block_list *old = list; \
++ list = list->next; \
++ free (old->address); \
++ free (old); \
++ } \
++ } while (0)
++# undef alloca
++# define alloca(size) (malloc (size))
++# define freea(p) free (p)
++#endif /* have alloca */
++
++
++#ifdef _LIBC
++/* List of blocks allocated for translations. */
++typedef struct transmem_list
++{
++ struct transmem_list *next;
++ char data[ZERO];
++} transmem_block_t;
++static struct transmem_list *transmem_list;
++#else
++typedef unsigned char transmem_block_t;
++#endif
++
++
++/* Names for the libintl functions are a problem. They must not clash
++ with existing names and they should follow ANSI C. But this source
++ code is also used in GNU C Library where the names have a __
++ prefix. So we have to make a difference here. */
++#ifdef _LIBC
++# define DCIGETTEXT __dcigettext
++#else
++# define DCIGETTEXT libintl_dcigettext
++#endif
++
++/* Lock variable to protect the global data in the gettext implementation. */
++#ifdef _LIBC
++__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
++#endif
++
++/* Checking whether the binaries runs SUID must be done and glibc provides
++ easier methods therefore we make a difference here. */
++#ifdef _LIBC
++# define ENABLE_SECURE __libc_enable_secure
++# define DETERMINE_SECURE
++#else
++# ifndef HAVE_GETUID
++# define getuid() 0
++# endif
++# ifndef HAVE_GETGID
++# define getgid() 0
++# endif
++# ifndef HAVE_GETEUID
++# define geteuid() getuid()
++# endif
++# ifndef HAVE_GETEGID
++# define getegid() getgid()
++# endif
++static int enable_secure;
++# define ENABLE_SECURE (enable_secure == 1)
++# define DETERMINE_SECURE \
++ if (enable_secure == 0) \
++ { \
++ if (getuid () != geteuid () || getgid () != getegid ()) \
++ enable_secure = 1; \
++ else \
++ enable_secure = -1; \
++ }
++#endif
++
++/* Get the function to evaluate the plural expression. */
++#include "eval-plural.h"
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current
++ CATEGORY locale and, if PLURAL is nonzero, search over string
++ depending on the plural form determined by N. */
++char *
++DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
++ int plural, unsigned long int n, int category)
++{
++#ifndef HAVE_ALLOCA
++ struct block_list *block_list = NULL;
++#endif
++ struct loaded_l10nfile *domain;
++ struct binding *binding;
++ const char *categoryname;
++ const char *categoryvalue;
++ char *dirname, *xdomainname;
++ char *single_locale;
++ char *retval;
++ size_t retlen;
++ int saved_errno;
++#if defined HAVE_TSEARCH || defined _LIBC
++ struct known_translation_t *search;
++ struct known_translation_t **foundp = NULL;
++ size_t msgid_len;
++#endif
++ size_t domainname_len;
++
++ /* If no real MSGID is given return NULL. */
++ if (msgid1 == NULL)
++ return NULL;
++
++#ifdef _LIBC
++ if (category < 0 || category >= __LC_LAST || category == LC_ALL)
++ /* Bogus. */
++ return (plural == 0
++ ? (char *) msgid1
++ /* Use the Germanic plural rule. */
++ : n == 1 ? (char *) msgid1 : (char *) msgid2);
++#endif
++
++ __libc_rwlock_rdlock (_nl_state_lock);
++
++ /* If DOMAINNAME is NULL, we are interested in the default domain. If
++ CATEGORY is not LC_MESSAGES this might not make much sense but the
++ definition left this undefined. */
++ if (domainname == NULL)
++ domainname = _nl_current_default_domain;
++
++ /* OS/2 specific: backward compatibility with older libintl versions */
++#ifdef LC_MESSAGES_COMPAT
++ if (category == LC_MESSAGES_COMPAT)
++ category = LC_MESSAGES;
++#endif
++
++#if defined HAVE_TSEARCH || defined _LIBC
++ msgid_len = strlen (msgid1) + 1;
++
++ /* Try to find the translation among those which we found at
++ some time. */
++ search = (struct known_translation_t *)
++ alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
++ memcpy (search->msgid, msgid1, msgid_len);
++ search->domainname = (char *) domainname;
++ search->category = category;
++
++ foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
++ freea (search);
++ if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
++ {
++ /* Now deal with plural. */
++ if (plural)
++ retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,
++ (*foundp)->translation_length);
++ else
++ retval = (char *) (*foundp)->translation;
++
++ __libc_rwlock_unlock (_nl_state_lock);
++ return retval;
++ }
++#endif
++
++ /* Preserve the `errno' value. */
++ saved_errno = errno;
++
++ /* See whether this is a SUID binary or not. */
++ DETERMINE_SECURE;
++
++ /* First find matching binding. */
++ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
++ {
++ int compare = strcmp (domainname, binding->domainname);
++ if (compare == 0)
++ /* We found it! */
++ break;
++ if (compare < 0)
++ {
++ /* It is not in the list. */
++ binding = NULL;
++ break;
++ }
++ }
++
++ if (binding == NULL)
++ dirname = (char *) INTUSE(_nl_default_dirname);
++ else if (IS_ABSOLUTE_PATH (binding->dirname))
++ dirname = binding->dirname;
++ else
++ {
++ /* We have a relative path. Make it absolute now. */
++ size_t dirname_len = strlen (binding->dirname) + 1;
++ size_t path_max;
++ char *ret;
++
++ path_max = (unsigned int) PATH_MAX;
++ path_max += 2; /* The getcwd docs say to do this. */
++
++ for (;;)
++ {
++ dirname = (char *) alloca (path_max + dirname_len);
++ ADD_BLOCK (block_list, dirname);
++
++ __set_errno (0);
++ ret = getcwd (dirname, path_max);
++ if (ret != NULL || errno != ERANGE)
++ break;
++
++ path_max += path_max / 2;
++ path_max += PATH_INCR;
++ }
++
++ if (ret == NULL)
++ /* We cannot get the current working directory. Don't signal an
++ error but simply return the default string. */
++ goto return_untranslated;
++
++ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
++ }
++
++ /* Now determine the symbolic name of CATEGORY and its value. */
++ categoryname = category_to_name (category);
++ categoryvalue = guess_category_value (category, categoryname);
++
++ domainname_len = strlen (domainname);
++ xdomainname = (char *) alloca (strlen (categoryname)
++ + domainname_len + 5);
++ ADD_BLOCK (block_list, xdomainname);
++
++ stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
++ domainname, domainname_len),
++ ".mo");
++
++ /* Creating working area. */
++ single_locale = (char *) alloca (strlen (categoryvalue) + 1);
++ ADD_BLOCK (block_list, single_locale);
++
++
++ /* Search for the given string. This is a loop because we perhaps
++ got an ordered list of languages to consider for the translation. */
++ while (1)
++ {
++ /* Make CATEGORYVALUE point to the next element of the list. */
++ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
++ ++categoryvalue;
++ if (categoryvalue[0] == '\0')
++ {
++ /* The whole contents of CATEGORYVALUE has been searched but
++ no valid entry has been found. We solve this situation
++ by implicitly appending a "C" entry, i.e. no translation
++ will take place. */
++ single_locale[0] = 'C';
++ single_locale[1] = '\0';
++ }
++ else
++ {
++ char *cp = single_locale;
++ while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
++ *cp++ = *categoryvalue++;
++ *cp = '\0';
++
++ /* When this is a SUID binary we must not allow accessing files
++ outside the dedicated directories. */
++ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
++ /* Ingore this entry. */
++ continue;
++ }
++
++ /* If the current locale value is C (or POSIX) we don't load a
++ domain. Return the MSGID. */
++ if (strcmp (single_locale, "C") == 0
++ || strcmp (single_locale, "POSIX") == 0)
++ break;
++
++ /* Find structure describing the message catalog matching the
++ DOMAINNAME and CATEGORY. */
++ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);
++
++ if (domain != NULL)
++ {
++ retval = _nl_find_msg (domain, binding, msgid1, &retlen);
++
++ if (retval == NULL)
++ {
++ int cnt;
++
++ for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
++ {
++ retval = _nl_find_msg (domain->successor[cnt], binding,
++ msgid1, &retlen);
++
++ if (retval != NULL)
++ {
++ domain = domain->successor[cnt];
++ break;
++ }
++ }
++ }
++
++ if (retval != NULL)
++ {
++ /* Found the translation of MSGID1 in domain DOMAIN:
++ starting at RETVAL, RETLEN bytes. */
++ FREE_BLOCKS (block_list);
++#if defined HAVE_TSEARCH || defined _LIBC
++ if (foundp == NULL)
++ {
++ /* Create a new entry and add it to the search tree. */
++ struct known_translation_t *newp;
++
++ newp = (struct known_translation_t *)
++ malloc (offsetof (struct known_translation_t, msgid)
++ + msgid_len + domainname_len + 1);
++ if (newp != NULL)
++ {
++ newp->domainname =
++ mempcpy (newp->msgid, msgid1, msgid_len);
++ memcpy (newp->domainname, domainname, domainname_len + 1);
++ newp->category = category;
++ newp->counter = _nl_msg_cat_cntr;
++ newp->domain = domain;
++ newp->translation = retval;
++ newp->translation_length = retlen;
++
++ /* Insert the entry in the search tree. */
++ foundp = (struct known_translation_t **)
++ tsearch (newp, &root, transcmp);
++ if (foundp == NULL
++ || __builtin_expect (*foundp != newp, 0))
++ /* The insert failed. */
++ free (newp);
++ }
++ }
++ else
++ {
++ /* We can update the existing entry. */
++ (*foundp)->counter = _nl_msg_cat_cntr;
++ (*foundp)->domain = domain;
++ (*foundp)->translation = retval;
++ (*foundp)->translation_length = retlen;
++ }
++#endif
++ __set_errno (saved_errno);
++
++ /* Now deal with plural. */
++ if (plural)
++ retval = plural_lookup (domain, n, retval, retlen);
++
++ __libc_rwlock_unlock (_nl_state_lock);
++ return retval;
++ }
++ }
++ }
++
++ return_untranslated:
++ /* Return the untranslated MSGID. */
++ FREE_BLOCKS (block_list);
++ __libc_rwlock_unlock (_nl_state_lock);
++#ifndef _LIBC
++ if (!ENABLE_SECURE)
++ {
++ extern void _nl_log_untranslated (const char *logfilename,
++ const char *domainname,
++ const char *msgid1, const char *msgid2,
++ int plural);
++ const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
++
++ if (logfilename != NULL && logfilename[0] != '\0')
++ _nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural);
++ }
++#endif
++ __set_errno (saved_errno);
++ return (plural == 0
++ ? (char *) msgid1
++ /* Use the Germanic plural rule. */
++ : n == 1 ? (char *) msgid1 : (char *) msgid2);
++}
++
++
++char *
++internal_function
++_nl_find_msg (struct loaded_l10nfile *domain_file,
++ struct binding *domainbinding, const char *msgid,
++ size_t *lengthp)
++{
++ struct loaded_domain *domain;
++ nls_uint32 nstrings;
++ size_t act;
++ char *result;
++ size_t resultlen;
++
++ if (domain_file->decided == 0)
++ _nl_load_domain (domain_file, domainbinding);
++
++ if (domain_file->data == NULL)
++ return NULL;
++
++ domain = (struct loaded_domain *) domain_file->data;
++
++ nstrings = domain->nstrings;
++
++ /* Locate the MSGID and its translation. */
++ if (domain->hash_tab != NULL)
++ {
++ /* Use the hashing table. */
++ nls_uint32 len = strlen (msgid);
++ nls_uint32 hash_val = hash_string (msgid);
++ nls_uint32 idx = hash_val % domain->hash_size;
++ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
++
++ while (1)
++ {
++ nls_uint32 nstr =
++ W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
++
++ if (nstr == 0)
++ /* Hash table entry is empty. */
++ return NULL;
++
++ nstr--;
++
++ /* Compare msgid with the original string at index nstr.
++ We compare the lengths with >=, not ==, because plural entries
++ are represented by strings with an embedded NUL. */
++ if (nstr < nstrings
++ ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
++ && (strcmp (msgid,
++ domain->data + W (domain->must_swap,
++ domain->orig_tab[nstr].offset))
++ == 0)
++ : domain->orig_sysdep_tab[nstr - nstrings].length > len
++ && (strcmp (msgid,
++ domain->orig_sysdep_tab[nstr - nstrings].pointer)
++ == 0))
++ {
++ act = nstr;
++ goto found;
++ }
++
++ if (idx >= domain->hash_size - incr)
++ idx -= domain->hash_size - incr;
++ else
++ idx += incr;
++ }
++ /* NOTREACHED */
++ }
++ else
++ {
++ /* Try the default method: binary search in the sorted array of
++ messages. */
++ size_t top, bottom;
++
++ bottom = 0;
++ top = nstrings;
++ while (bottom < top)
++ {
++ int cmp_val;
++
++ act = (bottom + top) / 2;
++ cmp_val = strcmp (msgid, (domain->data
++ + W (domain->must_swap,
++ domain->orig_tab[act].offset)));
++ if (cmp_val < 0)
++ top = act;
++ else if (cmp_val > 0)
++ bottom = act + 1;
++ else
++ goto found;
++ }
++ /* No translation was found. */
++ return NULL;
++ }
++
++ found:
++ /* The translation was found at index ACT. If we have to convert the
++ string to use a different character set, this is the time. */
++ if (act < nstrings)
++ {
++ result = (char *)
++ (domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
++ resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
++ }
++ else
++ {
++ result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
++ resultlen = domain->trans_sysdep_tab[act - nstrings].length;
++ }
++
++#if defined _LIBC || HAVE_ICONV
++ if (domain->codeset_cntr
++ != (domainbinding != NULL ? domainbinding->codeset_cntr : 0))
++ {
++ /* The domain's codeset has changed through bind_textdomain_codeset()
++ since the message catalog was initialized or last accessed. We
++ have to reinitialize the converter. */
++ _nl_free_domain_conv (domain);
++ _nl_init_domain_conv (domain_file, domain, domainbinding);
++ }
++
++ if (
++# ifdef _LIBC
++ domain->conv != (__gconv_t) -1
++# else
++# if HAVE_ICONV
++ domain->conv != (iconv_t) -1
++# endif
++# endif
++ )
++ {
++ /* We are supposed to do a conversion. First allocate an
++ appropriate table with the same structure as the table
++ of translations in the file, where we can put the pointers
++ to the converted strings in.
++ There is a slight complication with plural entries. They
++ are represented by consecutive NUL terminated strings. We
++ handle this case by converting RESULTLEN bytes, including
++ NULs. */
++
++ if (domain->conv_tab == NULL
++ && ((domain->conv_tab =
++ (char **) calloc (nstrings + domain->n_sysdep_strings,
++ sizeof (char *)))
++ == NULL))
++ /* Mark that we didn't succeed allocating a table. */
++ domain->conv_tab = (char **) -1;
++
++ if (__builtin_expect (domain->conv_tab == (char **) -1, 0))
++ /* Nothing we can do, no more memory. */
++ goto converted;
++
++ if (domain->conv_tab[act] == NULL)
++ {
++ /* We haven't used this string so far, so it is not
++ translated yet. Do this now. */
++ /* We use a bit more efficient memory handling.
++ We allocate always larger blocks which get used over
++ time. This is faster than many small allocations. */
++ __libc_lock_define_initialized (static, lock)
++# define INITIAL_BLOCK_SIZE 4080
++ static unsigned char *freemem;
++ static size_t freemem_size;
++
++ const unsigned char *inbuf;
++ unsigned char *outbuf;
++ int malloc_count;
++# ifndef _LIBC
++ transmem_block_t *transmem_list = NULL;
++# endif
++
++ __libc_lock_lock (lock);
++
++ inbuf = (const unsigned char *) result;
++ outbuf = freemem + sizeof (size_t);
++
++ malloc_count = 0;
++ while (1)
++ {
++ transmem_block_t *newmem;
++# ifdef _LIBC
++ size_t non_reversible;
++ int res;
++
++ if (freemem_size < sizeof (size_t))
++ goto resize_freemem;
++
++ res = __gconv (domain->conv,
++ &inbuf, inbuf + resultlen,
++ &outbuf,
++ outbuf + freemem_size - sizeof (size_t),
++ &non_reversible);
++
++ if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT)
++ break;
++
++ if (res != __GCONV_FULL_OUTPUT)
++ {
++ __libc_lock_unlock (lock);
++ goto converted;
++ }
++
++ inbuf = result;
++# else
++# if HAVE_ICONV
++ const char *inptr = (const char *) inbuf;
++ size_t inleft = resultlen;
++ char *outptr = (char *) outbuf;
++ size_t outleft;
++
++ if (freemem_size < sizeof (size_t))
++ goto resize_freemem;
++
++ outleft = freemem_size - sizeof (size_t);
++ if (iconv (domain->conv,
++ (ICONV_CONST char **) &inptr, &inleft,
++ &outptr, &outleft)
++ != (size_t) (-1))
++ {
++ outbuf = (unsigned char *) outptr;
++ break;
++ }
++ if (errno != E2BIG)
++ {
++ __libc_lock_unlock (lock);
++ goto converted;
++ }
++# endif
++# endif
++
++ resize_freemem:
++ /* We must allocate a new buffer or resize the old one. */
++ if (malloc_count > 0)
++ {
++ ++malloc_count;
++ freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
++ newmem = (transmem_block_t *) realloc (transmem_list,
++ freemem_size);
++# ifdef _LIBC
++ if (newmem != NULL)
++ transmem_list = transmem_list->next;
++ else
++ {
++ struct transmem_list *old = transmem_list;
++
++ transmem_list = transmem_list->next;
++ free (old);
++ }
++# endif
++ }
++ else
++ {
++ malloc_count = 1;
++ freemem_size = INITIAL_BLOCK_SIZE;
++ newmem = (transmem_block_t *) malloc (freemem_size);
++ }
++ if (__builtin_expect (newmem == NULL, 0))
++ {
++ freemem = NULL;
++ freemem_size = 0;
++ __libc_lock_unlock (lock);
++ goto converted;
++ }
++
++# ifdef _LIBC
++ /* Add the block to the list of blocks we have to free
++ at some point. */
++ newmem->next = transmem_list;
++ transmem_list = newmem;
++
++ freemem = newmem->data;
++ freemem_size -= offsetof (struct transmem_list, data);
++# else
++ transmem_list = newmem;
++ freemem = newmem;
++# endif
++
++ outbuf = freemem + sizeof (size_t);
++ }
++
++ /* We have now in our buffer a converted string. Put this
++ into the table of conversions. */
++ *(size_t *) freemem = outbuf - freemem - sizeof (size_t);
++ domain->conv_tab[act] = (char *) freemem;
++ /* Shrink freemem, but keep it aligned. */
++ freemem_size -= outbuf - freemem;
++ freemem = outbuf;
++ freemem += freemem_size & (alignof (size_t) - 1);
++ freemem_size = freemem_size & ~ (alignof (size_t) - 1);
++
++ __libc_lock_unlock (lock);
++ }
++
++ /* Now domain->conv_tab[act] contains the translation of all
++ the plural variants. */
++ result = domain->conv_tab[act] + sizeof (size_t);
++ resultlen = *(size_t *) domain->conv_tab[act];
++ }
++
++ converted:
++ /* The result string is converted. */
++
++#endif /* _LIBC || HAVE_ICONV */
++
++ *lengthp = resultlen;
++ return result;
++}
++
++
++/* Look up a plural variant. */
++static char *
++internal_function
++plural_lookup (struct loaded_l10nfile *domain, unsigned long int n,
++ const char *translation, size_t translation_len)
++{
++ struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
++ unsigned long int index;
++ const char *p;
++
++ index = plural_eval (domaindata->plural, n);
++ if (index >= domaindata->nplurals)
++ /* This should never happen. It means the plural expression and the
++ given maximum value do not match. */
++ index = 0;
++
++ /* Skip INDEX strings at TRANSLATION. */
++ p = translation;
++ while (index-- > 0)
++ {
++#ifdef _LIBC
++ p = __rawmemchr (p, '\0');
++#else
++ p = strchr (p, '\0');
++#endif
++ /* And skip over the NUL byte. */
++ p++;
++
++ if (p >= translation + translation_len)
++ /* This should never happen. It means the plural expression
++ evaluated to a value larger than the number of variants
++ available for MSGID1. */
++ return (char *) translation;
++ }
++ return (char *) p;
++}
++
++#ifndef _LIBC
++/* Return string representation of locale CATEGORY. */
++static const char *
++internal_function
++category_to_name (int category)
++{
++ const char *retval;
++
++ switch (category)
++ {
++#ifdef LC_COLLATE
++ case LC_COLLATE:
++ retval = "LC_COLLATE";
++ break;
++#endif
++#ifdef LC_CTYPE
++ case LC_CTYPE:
++ retval = "LC_CTYPE";
++ break;
++#endif
++#ifdef LC_MONETARY
++ case LC_MONETARY:
++ retval = "LC_MONETARY";
++ break;
++#endif
++#ifdef LC_NUMERIC
++ case LC_NUMERIC:
++ retval = "LC_NUMERIC";
++ break;
++#endif
++#ifdef LC_TIME
++ case LC_TIME:
++ retval = "LC_TIME";
++ break;
++#endif
++#ifdef LC_MESSAGES
++ case LC_MESSAGES:
++ retval = "LC_MESSAGES";
++ break;
++#endif
++#ifdef LC_RESPONSE
++ case LC_RESPONSE:
++ retval = "LC_RESPONSE";
++ break;
++#endif
++#ifdef LC_ALL
++ case LC_ALL:
++ /* This might not make sense but is perhaps better than any other
++ value. */
++ retval = "LC_ALL";
++ break;
++#endif
++ default:
++ /* If you have a better idea for a default value let me know. */
++ retval = "LC_XXX";
++ }
++
++ return retval;
++}
++#endif
++
++/* Guess value of current locale from value of the environment variables. */
++static const char *
++internal_function
++guess_category_value (int category, const char *categoryname)
++{
++ const char *language;
++ const char *retval;
++
++ /* The highest priority value is the `LANGUAGE' environment
++ variable. But we don't use the value if the currently selected
++ locale is the C locale. This is a GNU extension. */
++ language = getenv ("LANGUAGE");
++ if (language != NULL && language[0] == '\0')
++ language = NULL;
++
++ /* We have to proceed with the POSIX methods of looking to `LC_ALL',
++ `LC_xxx', and `LANG'. On some systems this can be done by the
++ `setlocale' function itself. */
++#ifdef _LIBC
++ retval = __current_locale_name (category);
++#else
++ retval = _nl_locale_name (category, categoryname);
++#endif
++
++ /* Ignore LANGUAGE if the locale is set to "C" because
++ 1. "C" locale usually uses the ASCII encoding, and most international
++ messages use non-ASCII characters. These characters get displayed
++ as question marks (if using glibc's iconv()) or as invalid 8-bit
++ characters (because other iconv()s refuse to convert most non-ASCII
++ characters to ASCII). In any case, the output is ugly.
++ 2. The precise output of some programs in the "C" locale is specified
++ by POSIX and should not depend on environment variables like
++ "LANGUAGE". We allow such programs to use gettext(). */
++ return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
++}
++
++/* @@ begin of epilog @@ */
++
++/* We don't want libintl.a to depend on any other library. So we
++ avoid the non-standard function stpcpy. In GNU C Library this
++ function is available, though. Also allow the symbol HAVE_STPCPY
++ to be defined. */
++#if !_LIBC && !HAVE_STPCPY
++static char *
++stpcpy (char *dest, const char *src)
++{
++ while ((*dest++ = *src++) != '\0')
++ /* Do nothing. */ ;
++ return dest - 1;
++}
++#endif
++
++#if !_LIBC && !HAVE_MEMPCPY
++static void *
++mempcpy (void *dest, const void *src, size_t n)
++{
++ return (void *) ((char *) memcpy (dest, src, n) + n);
++}
++#endif
++
++
++#ifdef _LIBC
++/* If we want to free all resources we have to do some work at
++ program's end. */
++libc_freeres_fn (free_mem)
++{
++ void *old;
++
++ while (_nl_domain_bindings != NULL)
++ {
++ struct binding *oldp = _nl_domain_bindings;
++ _nl_domain_bindings = _nl_domain_bindings->next;
++ if (oldp->dirname != INTUSE(_nl_default_dirname))
++ /* Yes, this is a pointer comparison. */
++ free (oldp->dirname);
++ free (oldp->codeset);
++ free (oldp);
++ }
++
++ if (_nl_current_default_domain != _nl_default_default_domain)
++ /* Yes, again a pointer comparison. */
++ free ((char *) _nl_current_default_domain);
++
++ /* Remove the search tree with the known translations. */
++ __tdestroy (root, free);
++ root = NULL;
++
++ while (transmem_list != NULL)
++ {
++ old = transmem_list;
++ transmem_list = transmem_list->next;
++ free (old);
++ }
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/dcngettext.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dcngettext.c 2004-09-12 14:40:34.375745048 -0400
+@@ -0,0 +1,57 @@
++/* Implementation of the dcngettext(3) function.
++ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include "gettextP.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem. They must not clash
++ with existing names and they should follow ANSI C. But this source
++ code is also used in GNU C Library where the names have a __
++ prefix. So we have to make a difference here. */
++#ifdef _LIBC
++# define DCNGETTEXT __dcngettext
++# define DCIGETTEXT __dcigettext
++#else
++# define DCNGETTEXT libintl_dcngettext
++# define DCIGETTEXT libintl_dcigettext
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
++ locale. */
++char *
++DCNGETTEXT (const char *domainname,
++ const char *msgid1, const char *msgid2, unsigned long int n,
++ int category)
++{
++ return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library. */
++weak_alias (__dcngettext, dcngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/dgettext.c 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/dgettext.c 2004-09-12 14:40:34.380744288 -0400
+@@ -1,32 +1,33 @@
+-/* dgettext.c -- implementation of the dgettext(3) function
+- Copyright (C) 1995 Software Foundation, Inc.
++/* Implementation of the dgettext(3) function.
++ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+
+-This program is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
+
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-GNU General Public License for more details.
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#if defined HAVE_LOCALE_H || defined _LIBC
+-# include <locale.h>
+-#endif
++#include "gettextP.h"
++
++#include <locale.h>
+
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+
+ /* @@ end of prolog @@ */
+@@ -37,18 +38,16 @@
+ prefix. So we have to make a difference here. */
+ #ifdef _LIBC
+ # define DGETTEXT __dgettext
+-# define DCGETTEXT __dcgettext
++# define DCGETTEXT INTUSE(__dcgettext)
+ #else
+-# define DGETTEXT dgettext__
+-# define DCGETTEXT dcgettext__
++# define DGETTEXT libintl_dgettext
++# define DCGETTEXT libintl_dcgettext
+ #endif
+
+ /* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+ char *
+-DGETTEXT (domainname, msgid)
+- const char *domainname;
+- const char *msgid;
++DGETTEXT (const char *domainname, const char *msgid)
+ {
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+ }
+--- lrzsz-0.12.20.safe/intl/dngettext.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dngettext.c 2004-09-12 14:40:34.385743528 -0400
+@@ -0,0 +1,59 @@
++/* Implementation of the dngettext(3) function.
++ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include "gettextP.h"
++
++#include <locale.h>
++
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem. They must not clash
++ with existing names and they should follow ANSI C. But this source
++ code is also used in GNU C Library where the names have a __
++ prefix. So we have to make a difference here. */
++#ifdef _LIBC
++# define DNGETTEXT __dngettext
++# define DCNGETTEXT __dcngettext
++#else
++# define DNGETTEXT libintl_dngettext
++# define DCNGETTEXT libintl_dcngettext
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog of the current
++ LC_MESSAGES locale and skip message according to the plural form. */
++char *
++DNGETTEXT (const char *domainname,
++ const char *msgid1, const char *msgid2, unsigned long int n)
++{
++ return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library. */
++weak_alias (__dngettext, dngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/eval-plural.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/eval-plural.h 2004-09-12 14:40:34.390742768 -0400
+@@ -0,0 +1,108 @@
++/* Plural expression evaluation.
++ Copyright (C) 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef STATIC
++#define STATIC static
++#endif
++
++/* Evaluate the plural expression and return an index value. */
++STATIC
++unsigned long int
++internal_function
++plural_eval (struct expression *pexp, unsigned long int n)
++{
++ switch (pexp->nargs)
++ {
++ case 0:
++ switch (pexp->operation)
++ {
++ case var:
++ return n;
++ case num:
++ return pexp->val.num;
++ default:
++ break;
++ }
++ /* NOTREACHED */
++ break;
++ case 1:
++ {
++ /* pexp->operation must be lnot. */
++ unsigned long int arg = plural_eval (pexp->val.args[0], n);
++ return ! arg;
++ }
++ case 2:
++ {
++ unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
++ if (pexp->operation == lor)
++ return leftarg || plural_eval (pexp->val.args[1], n);
++ else if (pexp->operation == land)
++ return leftarg && plural_eval (pexp->val.args[1], n);
++ else
++ {
++ unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
++
++ switch (pexp->operation)
++ {
++ case mult:
++ return leftarg * rightarg;
++ case divide:
++#if !INTDIV0_RAISES_SIGFPE
++ if (rightarg == 0)
++ raise (SIGFPE);
++#endif
++ return leftarg / rightarg;
++ case module:
++#if !INTDIV0_RAISES_SIGFPE
++ if (rightarg == 0)
++ raise (SIGFPE);
++#endif
++ return leftarg % rightarg;
++ case plus:
++ return leftarg + rightarg;
++ case minus:
++ return leftarg - rightarg;
++ case less_than:
++ return leftarg < rightarg;
++ case greater_than:
++ return leftarg > rightarg;
++ case less_or_equal:
++ return leftarg <= rightarg;
++ case greater_or_equal:
++ return leftarg >= rightarg;
++ case equal:
++ return leftarg == rightarg;
++ case not_equal:
++ return leftarg != rightarg;
++ default:
++ break;
++ }
++ }
++ /* NOTREACHED */
++ break;
++ }
++ case 3:
++ {
++ /* pexp->operation must be qmop. */
++ unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
++ return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
++ }
++ }
++ /* NOTREACHED */
++ return 0;
++}
+--- lrzsz-0.12.20.safe/intl/explodename.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/explodename.c 2004-09-12 14:40:34.395742008 -0400
+@@ -1,19 +1,20 @@
+-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -36,18 +37,23 @@
+
+ /* @@ end of prolog @@ */
+
++char *
++_nl_find_language (const char *name)
++{
++ while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
++ && name[0] != '+' && name[0] != ',')
++ ++name;
++
++ return (char *) name;
++}
++
++
+ int
+-_nl_explode_name (name, language, modifier, territory, codeset,
+- normalized_codeset, special, sponsor, revision)
+- char *name;
+- const char **language;
+- const char **modifier;
+- const char **territory;
+- const char **codeset;
+- const char **normalized_codeset;
+- const char **special;
+- const char **sponsor;
+- const char **revision;
++_nl_explode_name (char *name,
++ const char **language, const char **modifier,
++ const char **territory, const char **codeset,
++ const char **normalized_codeset, const char **special,
++ const char **sponsor, const char **revision)
+ {
+ enum { undecided, xpg, cen } syntax;
+ char *cp;
+@@ -67,9 +73,7 @@
+ mask = 0;
+ syntax = undecided;
+ *language = cp = name;
+- while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
+- && cp[0] != '+' && cp[0] != ',')
+- ++cp;
++ cp = _nl_find_language (*language);
+
+ if (*language == cp)
+ /* This does not make sense: language has to be specified. Use
+--- lrzsz-0.12.20.safe/intl/finddomain.c 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/finddomain.c 2004-09-12 14:40:34.415738968 -0400
+@@ -1,64 +1,40 @@
+ /* Handle list of needed message catalogs
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@gnu.org>, 1995.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#include <ctype.h>
+-#include <errno.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-# ifdef HAVE_MALLOC_H
+-# include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
+-#else
+-# include <strings.h>
+-# ifndef memcpy
+-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-# define strchr index
+-# endif
+-#endif
++#include <stdlib.h>
++#include <string.h>
+
+ #if defined HAVE_UNISTD_H || defined _LIBC
+ # include <unistd.h>
+ #endif
+
+-#include "gettext.h"
+ #include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+
+ /* @@ end of prolog @@ */
+@@ -70,10 +46,9 @@
+ the DOMAINNAME and CATEGORY parameters with respect to the currently
+ established bindings. */
+ struct loaded_l10nfile *
+-_nl_find_domain (dirname, locale, domainname)
+- const char *dirname;
+- char *locale;
+- const char *domainname;
++internal_function
++_nl_find_domain (const char *dirname, char *locale,
++ const char *domainname, struct binding *domainbinding)
+ {
+ struct loaded_l10nfile *retval;
+ const char *language;
+@@ -95,9 +70,9 @@
+
+ language[_territory][+audience][+special][,[sponsor][_revision]]
+
+- Beside the first all of them are allowed to be missing. If the
+- full specified locale is not found, the less specific one are
+- looked for. The various part will be stripped of according to
++ Beside the first part all of them are allowed to be missing. If
++ the full specified locale is not found, the less specific one are
++ looked for. The various parts will be stripped off according to
+ the following order:
+ (1) revision
+ (2) sponsor
+@@ -119,7 +94,7 @@
+ int cnt;
+
+ if (retval->decided == 0)
+- _nl_load_domain (retval);
++ _nl_load_domain (retval, domainbinding);
+
+ if (retval->data != NULL)
+ return retval;
+@@ -127,7 +102,7 @@
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+- _nl_load_domain (retval->successor[cnt]);
++ _nl_load_domain (retval->successor[cnt], domainbinding);
+
+ if (retval->successor[cnt]->data != NULL)
+ break;
+@@ -142,12 +117,18 @@
+ alias_value = _nl_expand_alias (locale);
+ if (alias_value != NULL)
+ {
++#if defined _LIBC || defined HAVE_STRDUP
++ locale = strdup (alias_value);
++ if (locale == NULL)
++ return NULL;
++#else
+ size_t len = strlen (alias_value) + 1;
+ locale = (char *) malloc (len);
+ if (locale == NULL)
+ return NULL;
+
+ memcpy (locale, alias_value, len);
++#endif
+ }
+
+ /* Now we determine the single parts of the locale name. First
+@@ -168,14 +149,14 @@
+ return NULL;
+
+ if (retval->decided == 0)
+- _nl_load_domain (retval);
++ _nl_load_domain (retval, domainbinding);
+ if (retval->data == NULL)
+ {
+ int cnt;
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+- _nl_load_domain (retval->successor[cnt]);
++ _nl_load_domain (retval->successor[cnt], domainbinding);
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+@@ -185,5 +166,27 @@
+ if (alias_value != NULL)
+ free (locale);
+
++ /* The space for normalized_codeset is dynamically allocated. Free it. */
++ if (mask & XPG_NORM_CODESET)
++ free ((void *) normalized_codeset);
++
+ return retval;
+ }
++
++
++#ifdef _LIBC
++libc_freeres_fn (free_mem)
++{
++ struct loaded_l10nfile *runp = _nl_loaded_domains;
++
++ while (runp != NULL)
++ {
++ struct loaded_l10nfile *here = runp;
++ if (runp->data != NULL)
++ _nl_unload_domain ((struct loaded_domain *) runp->data);
++ runp = runp->next;
++ free ((char *) here->filename);
++ free (here);
++ }
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/gettext.c 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/gettext.c 2004-09-12 14:40:34.420738208 -0400
+@@ -1,19 +1,20 @@
+-/* Implementation of gettext(3) function
+- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
++/* Implementation of gettext(3) function.
++ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -23,21 +24,14 @@
+ # define __need_NULL
+ # include <stddef.h>
+ #else
+-# ifdef STDC_HEADERS
+-# include <stdlib.h> /* Just for NULL. */
+-# else
+-# ifdef HAVE_STRING_H
+-# include <string.h>
+-# else
+-# define NULL ((void *) 0)
+-# endif
+-# endif
++# include <stdlib.h> /* Just for NULL. */
+ #endif
+
++#include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+
+ /* @@ end of prolog @@ */
+@@ -48,20 +42,19 @@
+ prefix. So we have to make a difference here. */
+ #ifdef _LIBC
+ # define GETTEXT __gettext
+-# define DGETTEXT __dgettext
++# define DCGETTEXT INTUSE(__dcgettext)
+ #else
+-# define GETTEXT gettext__
+-# define DGETTEXT dgettext__
++# define GETTEXT libintl_gettext
++# define DCGETTEXT libintl_dcgettext
+ #endif
+
+ /* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+ char *
+-GETTEXT (msgid)
+- const char *msgid;
++GETTEXT (const char *msgid)
+ {
+- return DGETTEXT (NULL, msgid);
++ return DCGETTEXT (NULL, msgid, LC_MESSAGES);
+ }
+
+ #ifdef _LIBC
+--- lrzsz-0.12.20.safe/intl/gettext.h 1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/gettext.h 1969-12-31 19:00:00.000000000 -0500
+@@ -1,105 +0,0 @@
+-/* Internal header for GNU gettext internationalization functions
+- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU Library General Public
+- License along with the GNU C Library; see the file COPYING.LIB. If not,
+- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+- Boston, MA 02111-1307, USA. */
+-
+-#ifndef _GETTEXT_H
+-#define _GETTEXT_H 1
+-
+-#include <stdio.h>
+-
+-#if HAVE_LIMITS_H || _LIBC
+-# include <limits.h>
+-#endif
+-
+-/* @@ end of prolog @@ */
+-
+-/* The magic number of the GNU message catalog format. */
+-#define _MAGIC 0x950412de
+-#define _MAGIC_SWAPPED 0xde120495
+-
+-/* Revision number of the currently used .mo (binary) file format. */
+-#define MO_REVISION_NUMBER 0
+-
+-/* The following contortions are an attempt to use the C preprocessor
+- to determine an unsigned integral type that is 32 bits wide. An
+- alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+- doing that would require that the configure script compile and *run*
+- the resulting executable. Locally running cross-compiled executables
+- is usually not possible. */
+-
+-#if __STDC__
+-# define UINT_MAX_32_BITS 4294967295U
+-#else
+-# define UINT_MAX_32_BITS 0xFFFFFFFF
+-#endif
+-
+-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+- This should be valid for all systems GNU cares about because
+- that doesn't include 16-bit systems, and only modern systems
+- (that certainly have <limits.h>) have 64+-bit integral types. */
+-
+-#ifndef UINT_MAX
+-# define UINT_MAX UINT_MAX_32_BITS
+-#endif
+-
+-#if UINT_MAX == UINT_MAX_32_BITS
+-typedef unsigned nls_uint32;
+-#else
+-# if USHRT_MAX == UINT_MAX_32_BITS
+-typedef unsigned short nls_uint32;
+-# else
+-# if ULONG_MAX == UINT_MAX_32_BITS
+-typedef unsigned long nls_uint32;
+-# else
+- /* The following line is intended to throw an error. Using #error is
+- not portable enough. */
+- "Cannot determine unsigned 32-bit data type."
+-# endif
+-# endif
+-#endif
+-
+-
+-/* Header for binary .mo file format. */
+-struct mo_file_header
+-{
+- /* The magic number. */
+- nls_uint32 magic;
+- /* The revision number of the file format. */
+- nls_uint32 revision;
+- /* The number of strings pairs. */
+- nls_uint32 nstrings;
+- /* Offset of table with start offsets of original strings. */
+- nls_uint32 orig_tab_offset;
+- /* Offset of table with start offsets of translation strings. */
+- nls_uint32 trans_tab_offset;
+- /* Size of hashing table. */
+- nls_uint32 hash_tab_size;
+- /* Offset of first hashing entry. */
+- nls_uint32 hash_tab_offset;
+-};
+-
+-struct string_desc
+-{
+- /* Length of addressed string. */
+- nls_uint32 length;
+- /* Offset of string in file. */
+- nls_uint32 offset;
+-};
+-
+-/* @@ begin of epilog @@ */
+-
+-#endif /* gettext.h */
+--- lrzsz-0.12.20.safe/intl/gettextP.h 1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/gettextP.h 2004-09-12 14:40:34.426737296 -0400
+@@ -1,33 +1,53 @@
+-/* Header describing internals of gettext library
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Header describing internals of libintl library.
++ Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifndef _GETTEXTP_H
+ #define _GETTEXTP_H
+
++#include <stddef.h> /* Get size_t. */
++
++#ifdef _LIBC
++# include "../iconv/gconv_int.h"
++#else
++# if HAVE_ICONV
++# include <iconv.h>
++# endif
++#endif
++
+ #include "loadinfo.h"
+
++#include "gmo.h" /* Get nls_uint32. */
++
+ /* @@ end of prolog @@ */
+
+-#ifndef PARAMS
+-# if __STDC__
+-# define PARAMS(args) args
+-# else
+-# define PARAMS(args) ()
+-# endif
++#ifndef internal_function
++# define internal_function
++#endif
++
++#ifndef attribute_hidden
++# define attribute_hidden
++#endif
++
++/* Tell the compiler when a conditional or integer expression is
++ almost always true or almost always false. */
++#ifndef HAVE_BUILTIN_EXPECT
++# define __builtin_expect(expr, val) (expr)
+ #endif
+
+ #ifndef W
+@@ -35,38 +55,160 @@
+ #endif
+
+
+-static nls_uint32 SWAP PARAMS ((nls_uint32 i));
+-
++#ifdef _LIBC
++# include <byteswap.h>
++# define SWAP(i) bswap_32 (i)
++#else
+ static inline nls_uint32
+ SWAP (i)
+ nls_uint32 i;
+ {
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+ }
++#endif
++
+
++/* In-memory representation of system dependent string. */
++struct sysdep_string_desc
++{
++ /* Length of addressed string, including the trailing NUL. */
++ size_t length;
++ /* Pointer to addressed string. */
++ const char *pointer;
++};
+
++/* The representation of an opened message catalog. */
+ struct loaded_domain
+ {
++ /* Pointer to memory containing the .mo file. */
+ const char *data;
++ /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed. */
++ int use_mmap;
++ /* Size of mmap()ed memory. */
++ size_t mmap_size;
++ /* 1 if the .mo file uses a different endianness than this machine. */
+ int must_swap;
++ /* Pointer to additional malloc()ed memory. */
++ void *malloced;
++
++ /* Number of static strings pairs. */
+ nls_uint32 nstrings;
+- struct string_desc *orig_tab;
+- struct string_desc *trans_tab;
++ /* Pointer to descriptors of original strings in the file. */
++ const struct string_desc *orig_tab;
++ /* Pointer to descriptors of translated strings in the file. */
++ const struct string_desc *trans_tab;
++
++ /* Number of system dependent strings pairs. */
++ nls_uint32 n_sysdep_strings;
++ /* Pointer to descriptors of original sysdep strings. */
++ const struct sysdep_string_desc *orig_sysdep_tab;
++ /* Pointer to descriptors of translated sysdep strings. */
++ const struct sysdep_string_desc *trans_sysdep_tab;
++
++ /* Size of hash table. */
+ nls_uint32 hash_size;
+- nls_uint32 *hash_tab;
++ /* Pointer to hash table. */
++ const nls_uint32 *hash_tab;
++ /* 1 if the hash table uses a different endianness than this machine. */
++ int must_swap_hash_tab;
++
++ int codeset_cntr;
++#ifdef _LIBC
++ __gconv_t conv;
++#else
++# if HAVE_ICONV
++ iconv_t conv;
++# endif
++#endif
++ char **conv_tab;
++
++ struct expression *plural;
++ unsigned long int nplurals;
+ };
+
++/* We want to allocate a string at the end of the struct. But ISO C
++ doesn't allow zero sized arrays. */
++#ifdef __GNUC__
++# define ZERO 0
++#else
++# define ZERO 1
++#endif
++
++/* A set of settings bound to a message domain. Used to store settings
++ from bindtextdomain() and bind_textdomain_codeset(). */
+ struct binding
+ {
+ struct binding *next;
+- char *domainname;
+ char *dirname;
++ int codeset_cntr; /* Incremented each time codeset changes. */
++ char *codeset;
++ char domainname[ZERO];
+ };
+
+-struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+- char *__locale,
+- const char *__domainname));
+-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain));
++/* A counter which is incremented each time some previous translations
++ become invalid.
++ This variable is part of the external ABI of the GNU libintl. */
++extern int _nl_msg_cat_cntr;
++
++#ifndef _LIBC
++const char *_nl_locale_name (int category, const char *categoryname);
++#endif
++
++struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
++ const char *__domainname,
++ struct binding *__domainbinding)
++ internal_function;
++void _nl_load_domain (struct loaded_l10nfile *__domain,
++ struct binding *__domainbinding)
++ internal_function;
++void _nl_unload_domain (struct loaded_domain *__domain)
++ internal_function;
++const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
++ struct loaded_domain *__domain,
++ struct binding *__domainbinding)
++ internal_function;
++void _nl_free_domain_conv (struct loaded_domain *__domain)
++ internal_function;
++
++char *_nl_find_msg (struct loaded_l10nfile *domain_file,
++ struct binding *domainbinding, const char *msgid,
++ size_t *lengthp)
++ internal_function;
++
++#ifdef _LIBC
++extern char *__gettext (const char *__msgid);
++extern char *__dgettext (const char *__domainname, const char *__msgid);
++extern char *__dcgettext (const char *__domainname, const char *__msgid,
++ int __category);
++extern char *__ngettext (const char *__msgid1, const char *__msgid2,
++ unsigned long int __n);
++extern char *__dngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int n);
++extern char *__dcngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int __n, int __category);
++extern char *__dcigettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ int __plural, unsigned long int __n,
++ int __category);
++extern char *__textdomain (const char *__domainname);
++extern char *__bindtextdomain (const char *__domainname,
++ const char *__dirname);
++extern char *__bind_textdomain_codeset (const char *__domainname,
++ const char *__codeset);
++#else
++/* Declare the exported libintl_* functions, in a way that allows us to
++ call them under their real name. */
++# undef _INTL_REDIRECT_INLINE
++# undef _INTL_REDIRECT_MACROS
++# define _INTL_REDIRECT_MACROS
++# include "libgnuintl.h"
++extern char *libintl_dcigettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ int __plural, unsigned long int __n,
++ int __category);
++#endif
+
+ /* @@ begin of epilog @@ */
+
+--- lrzsz-0.12.20.safe/intl/gmo.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/gmo.h 2004-09-12 14:40:34.431736536 -0400
+@@ -0,0 +1,149 @@
++/* Description of GNU message catalog format: general file layout.
++ Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _GETTEXT_H
++#define _GETTEXT_H 1
++
++#include <limits.h>
++
++/* @@ end of prolog @@ */
++
++/* The magic number of the GNU message catalog format. */
++#define _MAGIC 0x950412de
++#define _MAGIC_SWAPPED 0xde120495
++
++/* Revision number of the currently used .mo (binary) file format. */
++#define MO_REVISION_NUMBER 0
++#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
++
++/* The following contortions are an attempt to use the C preprocessor
++ to determine an unsigned integral type that is 32 bits wide. An
++ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
++ as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
++ when cross-compiling. */
++
++#if __STDC__
++# define UINT_MAX_32_BITS 4294967295U
++#else
++# define UINT_MAX_32_BITS 0xFFFFFFFF
++#endif
++
++/* If UINT_MAX isn't defined, assume it's a 32-bit type.
++ This should be valid for all systems GNU cares about because
++ that doesn't include 16-bit systems, and only modern systems
++ (that certainly have <limits.h>) have 64+-bit integral types. */
++
++#ifndef UINT_MAX
++# define UINT_MAX UINT_MAX_32_BITS
++#endif
++
++#if UINT_MAX == UINT_MAX_32_BITS
++typedef unsigned nls_uint32;
++#else
++# if USHRT_MAX == UINT_MAX_32_BITS
++typedef unsigned short nls_uint32;
++# else
++# if ULONG_MAX == UINT_MAX_32_BITS
++typedef unsigned long nls_uint32;
++# else
++ /* The following line is intended to throw an error. Using #error is
++ not portable enough. */
++ "Cannot determine unsigned 32-bit data type."
++# endif
++# endif
++#endif
++
++
++/* Header for binary .mo file format. */
++struct mo_file_header
++{
++ /* The magic number. */
++ nls_uint32 magic;
++ /* The revision number of the file format. */
++ nls_uint32 revision;
++
++ /* The following are only used in .mo files with major revision 0 or 1. */
++
++ /* The number of strings pairs. */
++ nls_uint32 nstrings;
++ /* Offset of table with start offsets of original strings. */
++ nls_uint32 orig_tab_offset;
++ /* Offset of table with start offsets of translated strings. */
++ nls_uint32 trans_tab_offset;
++ /* Size of hash table. */
++ nls_uint32 hash_tab_size;
++ /* Offset of first hash table entry. */
++ nls_uint32 hash_tab_offset;
++
++ /* The following are only used in .mo files with minor revision >= 1. */
++
++ /* The number of system dependent segments. */
++ nls_uint32 n_sysdep_segments;
++ /* Offset of table describing system dependent segments. */
++ nls_uint32 sysdep_segments_offset;
++ /* The number of system dependent strings pairs. */
++ nls_uint32 n_sysdep_strings;
++ /* Offset of table with start offsets of original sysdep strings. */
++ nls_uint32 orig_sysdep_tab_offset;
++ /* Offset of table with start offsets of translated sysdep strings. */
++ nls_uint32 trans_sysdep_tab_offset;
++};
++
++/* Descriptor for static string contained in the binary .mo file. */
++struct string_desc
++{
++ /* Length of addressed string, not including the trailing NUL. */
++ nls_uint32 length;
++ /* Offset of string in file. */
++ nls_uint32 offset;
++};
++
++/* The following are only used in .mo files with minor revision >= 1. */
++
++/* Descriptor for system dependent string segment. */
++struct sysdep_segment
++{
++ /* Length of addressed string, including the trailing NUL. */
++ nls_uint32 length;
++ /* Offset of string in file. */
++ nls_uint32 offset;
++};
++
++/* Descriptor for system dependent string. */
++struct sysdep_string
++{
++ /* Offset of static string segments in file. */
++ nls_uint32 offset;
++ /* Alternating sequence of static and system dependent segments.
++ The last segment is a static segment, including the trailing NUL. */
++ struct segment_pair
++ {
++ /* Size of static segment. */
++ nls_uint32 segsize;
++ /* Reference to system dependent string segment, or ~0 at the end. */
++ nls_uint32 sysdepref;
++ } segments[1];
++};
++
++/* Marker for the end of the segments[] array. This has the value 0xFFFFFFFF,
++ regardless whether 'int' is 16 bit, 32 bit, or 64 bit. */
++#define SEGMENTS_END ((nls_uint32) ~0)
++
++/* @@ begin of epilog @@ */
++
++#endif /* gettext.h */
+--- lrzsz-0.12.20.safe/intl/hash-string.h 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/hash-string.h 2004-09-12 14:40:34.436735776 -0400
+@@ -1,35 +1,23 @@
+-/* Implements a string hashing function.
+- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
++/* Description of GNU message catalog format: string hashing function.
++ Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+- License along with the GNU C Library; see the file COPYING.LIB. If not,
+- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+- Boston, MA 02111-1307, USA. */
+-
+-#ifdef HAVE_VALUES_H
+-# include <values.h>
+-#endif
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ /* @@ end of prolog @@ */
+
+-#ifndef PARAMS
+-# if __STDC__
+-# define PARAMS(Args) Args
+-# else
+-# define PARAMS(Args) ()
+-# endif
+-#endif
+-
+ /* We assume to have `unsigned long int' value with at least 32 bits. */
+ #define HASHWORDBITS 32
+
+@@ -37,11 +25,8 @@
+ /* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+-static unsigned long hash_string PARAMS ((const char *__str_param));
+-
+-static inline unsigned long
+-hash_string (str_param)
+- const char *str_param;
++static inline unsigned long int
++hash_string (const char *str_param)
+ {
+ unsigned long int hval, g;
+ const char *str = str_param;
+@@ -51,8 +36,8 @@
+ while (*str != '\0')
+ {
+ hval <<= 4;
+- hval += (unsigned long) *str++;
+- g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
++ hval += (unsigned char) *str++;
++ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+--- lrzsz-0.12.20.safe/intl/intl-compat.c 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/intl-compat.c 2004-09-12 14:40:34.441735016 -0400
+@@ -1,76 +1,131 @@
+ /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+ Library.
+- Copyright (C) 1995 Software Foundation, Inc.
++ Copyright (C) 1995, 2000-2003 Software Foundation, Inc.
+
+-This program is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
+
+-This program is distributed in the hope that it will be useful,
+-but WITHOUT ANY WARRANTY; without even the implied warranty of
+-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-GNU General Public License for more details.
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#include "libgettext.h"
++#include "gettextP.h"
+
+ /* @@ end of prolog @@ */
+
++/* This file redirects the gettext functions (without prefix) to those
++ defined in the included GNU libintl library (with "libintl_" prefix).
++ It is compiled into libintl in order to make the AM_GNU_GETTEXT test
++ of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
++ has the redirections primarily in the <libintl.h> include file.
++ It is also compiled into libgnuintl so that libgnuintl.so can be used
++ as LD_PRELOADable library on glibc systems, to provide the extra
++ features that the functions in the libc don't have (namely, logging). */
++
+
+ #undef gettext
+ #undef dgettext
+ #undef dcgettext
++#undef ngettext
++#undef dngettext
++#undef dcngettext
+ #undef textdomain
+ #undef bindtextdomain
++#undef bind_textdomain_codeset
++
++
++/* When building a DLL, we must export some functions. Note that because
++ the functions are only defined for binary backward compatibility, we
++ don't need to use __declspec(dllimport) in any case. */
++#if defined _MSC_VER && BUILDING_DLL
++# define DLL_EXPORTED __declspec(dllexport)
++#else
++# define DLL_EXPORTED
++#endif
+
+
++DLL_EXPORTED
+ char *
+-bindtextdomain (domainname, dirname)
+- const char *domainname;
+- const char *dirname;
++gettext (const char *msgid)
+ {
+- return bindtextdomain__ (domainname, dirname);
++ return libintl_gettext (msgid);
+ }
+
+
++DLL_EXPORTED
+ char *
+-dcgettext (domainname, msgid, category)
+- const char *domainname;
+- const char *msgid;
+- int category;
++dgettext (const char *domainname, const char *msgid)
+ {
+- return dcgettext__ (domainname, msgid, category);
++ return libintl_dgettext (domainname, msgid);
+ }
+
+
++DLL_EXPORTED
+ char *
+-dgettext (domainname, msgid)
+- const char *domainname;
+- const char *msgid;
++dcgettext (const char *domainname, const char *msgid, int category)
+ {
+- return dgettext__ (domainname, msgid);
++ return libintl_dcgettext (domainname, msgid, category);
+ }
+
+
++DLL_EXPORTED
+ char *
+-gettext (msgid)
+- const char *msgid;
++ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
+ {
+- return gettext__ (msgid);
++ return libintl_ngettext (msgid1, msgid2, n);
+ }
+
+
++DLL_EXPORTED
+ char *
+-textdomain (domainname)
+- const char *domainname;
++dngettext (const char *domainname,
++ const char *msgid1, const char *msgid2, unsigned long int n)
+ {
+- return textdomain__ (domainname);
++ return libintl_dngettext (domainname, msgid1, msgid2, n);
++}
++
++
++DLL_EXPORTED
++char *
++dcngettext (const char *domainname,
++ const char *msgid1, const char *msgid2, unsigned long int n,
++ int category)
++{
++ return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
++}
++
++
++DLL_EXPORTED
++char *
++textdomain (const char *domainname)
++{
++ return libintl_textdomain (domainname);
++}
++
++
++DLL_EXPORTED
++char *
++bindtextdomain (const char *domainname, const char *dirname)
++{
++ return libintl_bindtextdomain (domainname, dirname);
++}
++
++
++DLL_EXPORTED
++char *
++bind_textdomain_codeset (const char *domainname, const char *codeset)
++{
++ return libintl_bind_textdomain_codeset (domainname, codeset);
+ }
+--- lrzsz-0.12.20.safe/intl/l10nflist.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/l10nflist.c 2004-09-12 14:40:34.457732584 -0400
+@@ -1,52 +1,40 @@
+-/* Handle list of needed message catalogs
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Tell glibc's <string.h> to provide a prototype for stpcpy().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-# define _GNU_SOURCE 1
+-# endif
+-# include <string.h>
+-#else
+-# include <strings.h>
+-# ifndef memcpy
+-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-# define strchr index
+-# endif
+-#endif
++#include <string.h>
+
+ #if defined _LIBC || defined HAVE_ARGZ_H
+ # include <argz.h>
+ #endif
+ #include <ctype.h>
+ #include <sys/types.h>
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#endif
++#include <stdlib.h>
+
+ #include "loadinfo.h"
+
+@@ -65,23 +53,39 @@
+ /* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+-# define stpcpy(dest, src) __stpcpy(dest, src)
++# ifndef stpcpy
++# define stpcpy(dest, src) __stpcpy(dest, src)
++# endif
+ #else
+ # ifndef HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
++static char *stpcpy (char *dest, const char *src);
+ # endif
+ #endif
+
++/* Pathname support.
++ ISSLASH(C) tests whether C is a directory separator character.
++ IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not,
++ it may be concatenated to a directory pathname.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++ && (P)[1] == ':')
++# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
++#else
++ /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
++#endif
++
+ /* Define function which are usually not available. */
+
+ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+ /* Returns the number of strings in ARGZ. */
+-static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+-
+ static size_t
+-argz_count__ (argz, len)
+- const char *argz;
+- size_t len;
++argz_count__ (const char *argz, size_t len)
+ {
+ size_t count = 0;
+ while (len > 0)
+@@ -95,18 +99,17 @@
+ }
+ # undef __argz_count
+ # define __argz_count(argz, len) argz_count__ (argz, len)
++#else
++# ifdef _LIBC
++# define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
++# endif
+ #endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+ /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+-static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+-
+ static void
+-argz_stringify__ (argz, len, sep)
+- char *argz;
+- size_t len;
+- int sep;
++argz_stringify__ (char *argz, size_t len, int sep)
+ {
+ while (len > 0)
+ {
+@@ -119,17 +122,16 @@
+ }
+ # undef __argz_stringify
+ # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
++#else
++# ifdef _LIBC
++# define __argz_stringify(argz, len, sep) \
++ INTUSE(__argz_stringify) (argz, len, sep)
++# endif
+ #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+-static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+- const char *entry));
+-
+ static char *
+-argz_next__ (argz, argz_len, entry)
+- char *argz;
+- size_t argz_len;
+- const char *entry;
++argz_next__ (char *argz, size_t argz_len, const char *entry)
+ {
+ if (entry)
+ {
+@@ -150,11 +152,8 @@
+
+
+ /* Return number of bits set in X. */
+-static int pop PARAMS ((int x));
+-
+ static inline int
+-pop (x)
+- int x;
++pop (int x)
+ {
+ /* We assume that no more than 16 bits are used. */
+ x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+@@ -167,31 +166,27 @@
+
+
+ struct loaded_l10nfile *
+-_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+- territory, codeset, normalized_codeset, modifier, special,
+- sponsor, revision, filename, do_allocate)
+- struct loaded_l10nfile **l10nfile_list;
+- const char *dirlist;
+- size_t dirlist_len;
+- int mask;
+- const char *language;
+- const char *territory;
+- const char *codeset;
+- const char *normalized_codeset;
+- const char *modifier;
+- const char *special;
+- const char *sponsor;
+- const char *revision;
+- const char *filename;
+- int do_allocate;
++_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
++ const char *dirlist, size_t dirlist_len,
++ int mask, const char *language, const char *territory,
++ const char *codeset, const char *normalized_codeset,
++ const char *modifier, const char *special,
++ const char *sponsor, const char *revision,
++ const char *filename, int do_allocate)
+ {
+ char *abs_filename;
+- struct loaded_l10nfile *last = NULL;
++ struct loaded_l10nfile **lastp;
+ struct loaded_l10nfile *retval;
+ char *cp;
++ size_t dirlist_count;
+ size_t entries;
+ int cnt;
+
++ /* If LANGUAGE contains an absolute directory specification, we ignore
++ DIRLIST. */
++ if (IS_ABSOLUTE_PATH (language))
++ dirlist_len = 0;
++
+ /* Allocate room for the full file name. */
+ abs_filename = (char *) malloc (dirlist_len
+ + strlen (language)
+@@ -209,7 +204,7 @@
+ + (((mask & CEN_SPONSOR) != 0
+ || (mask & CEN_REVISION) != 0)
+ ? (1 + ((mask & CEN_SPONSOR) != 0
+- ? strlen (sponsor) + 1 : 0)
++ ? strlen (sponsor) : 0)
+ + ((mask & CEN_REVISION) != 0
+ ? strlen (revision) + 1 : 0)) : 0)
+ + 1 + strlen (filename) + 1);
+@@ -217,14 +212,16 @@
+ if (abs_filename == NULL)
+ return NULL;
+
+- retval = NULL;
+- last = NULL;
+-
+ /* Construct file name. */
+- memcpy (abs_filename, dirlist, dirlist_len);
+- __argz_stringify (abs_filename, dirlist_len, ':');
+- cp = abs_filename + (dirlist_len - 1);
+- *cp++ = '/';
++ cp = abs_filename;
++ if (dirlist_len > 0)
++ {
++ memcpy (cp, dirlist, dirlist_len);
++ __argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
++ cp += dirlist_len;
++ cp[-1] = '/';
++ }
++
+ cp = stpcpy (cp, language);
+
+ if ((mask & TERRITORY) != 0)
+@@ -271,7 +268,7 @@
+
+ /* Look in list of already loaded domains whether it is already
+ available. */
+- last = NULL;
++ lastp = l10nfile_list;
+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+ if (retval->filename != NULL)
+ {
+@@ -286,7 +283,7 @@
+ break;
+ }
+
+- last = retval;
++ lastp = &retval->next;
+ }
+
+ if (retval != NULL || do_allocate == 0)
+@@ -295,48 +292,66 @@
+ return retval;
+ }
+
+- retval = (struct loaded_l10nfile *)
+- malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+- * (1 << pop (mask))
+- * sizeof (struct loaded_l10nfile *)));
++ dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
++
++ /* Allocate a new loaded_l10nfile. */
++ retval =
++ (struct loaded_l10nfile *)
++ malloc (sizeof (*retval)
++ + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
++ * sizeof (struct loaded_l10nfile *)));
+ if (retval == NULL)
+ return NULL;
+
+ retval->filename = abs_filename;
+- retval->decided = (__argz_count (dirlist, dirlist_len) != 1
++
++ /* We set retval->data to NULL here; it is filled in later.
++ Setting retval->decided to 1 here means that retval does not
++ correspond to a real file (dirlist_count > 1) or is not worth
++ looking up (if an unnormalized codeset was specified). */
++ retval->decided = (dirlist_count > 1
+ || ((mask & XPG_CODESET) != 0
+ && (mask & XPG_NORM_CODESET) != 0));
+ retval->data = NULL;
+
+- if (last == NULL)
+- {
+- retval->next = *l10nfile_list;
+- *l10nfile_list = retval;
+- }
+- else
+- {
+- retval->next = last->next;
+- last->next = retval;
+- }
++ retval->next = *lastp;
++ *lastp = retval;
+
+ entries = 0;
+- /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+- a real file. So we have to use the DIRLIST separation mechanism
+- of the inner loop. */
+- cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+- for (; cnt >= 0; --cnt)
++ /* Recurse to fill the inheritance list of RETVAL.
++ If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
++ entry does not correspond to a real file; retval->filename contains
++ colons. In this case we loop across all elements of DIRLIST and
++ across all bit patterns dominated by MASK.
++ If the DIRLIST is a single directory or entirely redundant (i.e.
++ DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
++ MASK, excluding MASK itself.
++ In either case, we loop down from MASK to 0. This has the effect
++ that the extra bits in the locale name are dropped in this order:
++ first the modifier, then the territory, then the codeset, then the
++ normalized_codeset. */
++ for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
+ if ((cnt & ~mask) == 0
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+ {
+- /* Iterate over all elements of the DIRLIST. */
+- char *dir = NULL;
++ if (dirlist_count > 1)
++ {
++ /* Iterate over all elements of the DIRLIST. */
++ char *dir = NULL;
+
+- while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+- != NULL)
++ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
++ != NULL)
++ retval->successor[entries++]
++ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
++ cnt, language, territory, codeset,
++ normalized_codeset, modifier, special,
++ sponsor, revision, filename, 1);
++ }
++ else
+ retval->successor[entries++]
+- = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+- language, territory, codeset,
++ = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
++ cnt, language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+@@ -347,11 +362,10 @@
+
+ /* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+- names. */
++ names. The return value is dynamically allocated and has to be
++ freed by the caller. */
+ const char *
+-_nl_normalize_codeset (codeset, name_len)
+- const char *codeset;
+- size_t name_len;
++_nl_normalize_codeset (const char *codeset, size_t name_len)
+ {
+ int len = 0;
+ int only_digit = 1;
+@@ -360,11 +374,11 @@
+ size_t cnt;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+- if (isalnum (codeset[cnt]))
++ if (isalnum ((unsigned char) codeset[cnt]))
+ {
+ ++len;
+
+- if (isalpha (codeset[cnt]))
++ if (isalpha ((unsigned char) codeset[cnt]))
+ only_digit = 0;
+ }
+
+@@ -378,9 +392,9 @@
+ wp = retval;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+- if (isalpha (codeset[cnt]))
+- *wp++ = tolower (codeset[cnt]);
+- else if (isdigit (codeset[cnt]))
++ if (isalpha ((unsigned char) codeset[cnt]))
++ *wp++ = tolower ((unsigned char) codeset[cnt]);
++ else if (isdigit ((unsigned char) codeset[cnt]))
+ *wp++ = codeset[cnt];
+
+ *wp = '\0';
+@@ -398,9 +412,7 @@
+ to be defined. */
+ #if !_LIBC && !HAVE_STPCPY
+ static char *
+-stpcpy (dest, src)
+- char *dest;
+- const char *src;
++stpcpy (char *dest, const char *src)
+ {
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+--- lrzsz-0.12.20.safe/intl/libgettext.h 1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/libgettext.h 1969-12-31 19:00:00.000000000 -0500
+@@ -1,182 +0,0 @@
+-/* Message catalogs for internationalization.
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
+- any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+-
+-/* Because on some systems (e.g. Solaris) we sometimes have to include
+- the systems libintl.h as well as this file we have more complex
+- include protection above. But the systems header might perhaps also
+- define _LIBINTL_H and therefore we have to protect the definition here. */
+-
+-#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
+-#if !defined (_LIBINTL_H)
+-# define _LIBINTL_H 1
+-#endif
+-#define _LIBGETTEXT_H 1
+-
+-/* We define an additional symbol to signal that we use the GNU
+- implementation of gettext. */
+-#define __USE_GNU_GETTEXT 1
+-
+-#include <sys/types.h>
+-
+-#if HAVE_LOCALE_H
+-# include <locale.h>
+-#endif
+-
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-/* @@ end of prolog @@ */
+-
+-#ifndef PARAMS
+-# if __STDC__
+-# define PARAMS(args) args
+-# else
+-# define PARAMS(args) ()
+-# endif
+-#endif
+-
+-#ifndef NULL
+-# if !defined __cplusplus || defined __GNUC__
+-# define NULL ((void *) 0)
+-# else
+-# define NULL (0)
+-# endif
+-#endif
+-
+-#if !HAVE_LC_MESSAGES
+-/* This value determines the behaviour of the gettext() and dgettext()
+- function. But some system does not have this defined. Define it
+- to a default value. */
+-# define LC_MESSAGES (-1)
+-#endif
+-
+-
+-/* Declarations for gettext-using-catgets interface. Derived from
+- Jim Meyering's libintl.h. */
+-struct _msg_ent
+-{
+- const char *_msg;
+- int _msg_number;
+-};
+-
+-
+-#if HAVE_CATGETS
+-/* These two variables are defined in the automatically by po-to-tbl.sed
+- generated file `cat-id-tbl.c'. */
+-extern const struct _msg_ent _msg_tbl[];
+-extern int _msg_tbl_length;
+-#endif
+-
+-
+-/* For automatical extraction of messages sometimes no real
+- translation is needed. Instead the string itself is the result. */
+-#define gettext_noop(Str) (Str)
+-
+-/* Look up MSGID in the current default message catalog for the current
+- LC_MESSAGES locale. If not found, returns MSGID itself (the default
+- text). */
+-extern char *gettext PARAMS ((const char *__msgid));
+-extern char *gettext__ PARAMS ((const char *__msgid));
+-
+-/* Look up MSGID in the DOMAINNAME message catalog for the current
+- LC_MESSAGES locale. */
+-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+-extern char *dgettext__ PARAMS ((const char *__domainname,
+- const char *__msgid));
+-
+-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+- locale. */
+-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+- int __category));
+-extern char *dcgettext__ PARAMS ((const char *__domainname,
+- const char *__msgid, int __category));
+-
+-
+-/* Set the current default message catalog to DOMAINNAME.
+- If DOMAINNAME is null, return the current default.
+- If DOMAINNAME is "", reset to the default of "messages". */
+-extern char *textdomain PARAMS ((const char *__domainname));
+-extern char *textdomain__ PARAMS ((const char *__domainname));
+-
+-/* Specify that the DOMAINNAME message catalog will be found
+- in DIRNAME rather than in the system locale data base. */
+-extern char *bindtextdomain PARAMS ((const char *__domainname,
+- const char *__dirname));
+-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+- const char *__dirname));
+-
+-#if ENABLE_NLS
+-
+-/* Solaris 2.3 has the gettext function but dcgettext is missing.
+- So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
+- has dcgettext. */
+-# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+-
+-# define gettext(Msgid) \
+- dgettext (NULL, Msgid)
+-
+-# define dgettext(Domainname, Msgid) \
+- dcgettext (Domainname, Msgid, LC_MESSAGES)
+-
+-# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+-/* This global variable is defined in loadmsgcat.c. We need a sign,
+- whether a new catalog was loaded, which can be associated with all
+- translations. */
+-extern int _nl_msg_cat_cntr;
+-
+-# define dcgettext(Domainname, Msgid, Category) \
+- (__extension__ \
+- ({ \
+- char *__result; \
+- if (__builtin_constant_p (Msgid)) \
+- { \
+- static char *__translation__; \
+- static int __catalog_counter__; \
+- if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
+- { \
+- __translation__ = \
+- dcgettext__ (Domainname, Msgid, Category); \
+- __catalog_counter__ = _nl_msg_cat_cntr; \
+- } \
+- __result = __translation__; \
+- } \
+- else \
+- __result = dcgettext__ (Domainname, Msgid, Category); \
+- __result; \
+- }))
+-# endif
+-# endif
+-
+-#else
+-
+-# define gettext(Msgid) (Msgid)
+-# define dgettext(Domainname, Msgid) (Msgid)
+-# define dcgettext(Domainname, Msgid, Category) (Msgid)
+-# define textdomain(Domainname) while (0) /* nothing */
+-# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+-
+-#endif
+-
+-/* @@ begin of epilog @@ */
+-
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-#endif
+--- lrzsz-0.12.20.safe/intl/libgnuintl.h.in 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/libgnuintl.h.in 2004-09-12 14:40:34.462731824 -0400
+@@ -0,0 +1,383 @@
++/* Message catalogs for internationalization.
++ Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _LIBINTL_H
++#define _LIBINTL_H 1
++
++#include <locale.h>
++
++/* The LC_MESSAGES locale category is the category used by the functions
++ gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
++ On systems that don't define it, use an arbitrary value instead.
++ On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
++ then includes <libintl.h> (i.e. this file!) and then only defines
++ LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
++ in this case. */
++#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
++# define LC_MESSAGES 1729
++#endif
++
++/* We define an additional symbol to signal that we use the GNU
++ implementation of gettext. */
++#define __USE_GNU_GETTEXT 1
++
++/* Provide information about the supported file formats. Returns the
++ maximum minor revision number supported for a given major revision. */
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
++ ((major) == 0 ? 1 : -1)
++
++/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
++ precedence over _conio_gettext. */
++#ifdef __DJGPP__
++# undef gettext
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* We redirect the functions to those prefixed with "libintl_". This is
++ necessary, because some systems define gettext/textdomain/... in the C
++ library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
++ If we used the unprefixed names, there would be cases where the
++ definition in the C library would override the one in the libintl.so
++ shared library. Recall that on ELF systems, the symbols are looked
++ up in the following order:
++ 1. in the executable,
++ 2. in the shared libraries specified on the link command line, in order,
++ 3. in the dependencies of the shared libraries specified on the link
++ command line,
++ 4. in the dlopen()ed shared libraries, in the order in which they were
++ dlopen()ed.
++ The definition in the C library would override the one in libintl.so if
++ either
++ * -lc is given on the link command line and -lintl isn't, or
++ * -lc is given on the link command line before -lintl, or
++ * libintl.so is a dependency of a dlopen()ed shared library but not
++ linked to the executable at link time.
++ Since Solaris gettext() behaves differently than GNU gettext(), this
++ would be unacceptable.
++
++ The redirection happens by default through macros in C, so that &gettext
++ is independent of the compilation unit, but through inline functions in
++ C++, in order not to interfere with the name mangling of class fields or
++ class methods called 'gettext'. */
++
++/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
++ If he doesn't, we choose the method. A third possible method is
++ _INTL_REDIRECT_ASM, supported only by GCC. */
++#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
++# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
++# define _INTL_REDIRECT_ASM
++# else
++# ifdef __cplusplus
++# define _INTL_REDIRECT_INLINE
++# else
++# define _INTL_REDIRECT_MACROS
++# endif
++# endif
++#endif
++/* Auxiliary macros. */
++#ifdef _INTL_REDIRECT_ASM
++# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
++# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
++# define _INTL_STRINGIFY(prefix) #prefix
++#else
++# define _INTL_ASM(cname)
++#endif
++
++/* Look up MSGID in the current default message catalog for the current
++ LC_MESSAGES locale. If not found, returns MSGID itself (the default
++ text). */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_gettext (const char *__msgid);
++static inline char *gettext (const char *__msgid)
++{
++ return libintl_gettext (__msgid);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define gettext libintl_gettext
++#endif
++extern char *gettext (const char *__msgid)
++ _INTL_ASM (libintl_gettext);
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current
++ LC_MESSAGES locale. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
++static inline char *dgettext (const char *__domainname, const char *__msgid)
++{
++ return libintl_dgettext (__domainname, __msgid);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dgettext libintl_dgettext
++#endif
++extern char *dgettext (const char *__domainname, const char *__msgid)
++ _INTL_ASM (libintl_dgettext);
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
++ locale. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
++ int __category);
++static inline char *dcgettext (const char *__domainname, const char *__msgid,
++ int __category)
++{
++ return libintl_dcgettext (__domainname, __msgid, __category);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dcgettext libintl_dcgettext
++#endif
++extern char *dcgettext (const char *__domainname, const char *__msgid,
++ int __category)
++ _INTL_ASM (libintl_dcgettext);
++#endif
++
++
++/* Similar to `gettext' but select the plural form corresponding to the
++ number N. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
++ unsigned long int __n);
++static inline char *ngettext (const char *__msgid1, const char *__msgid2,
++ unsigned long int __n)
++{
++ return libintl_ngettext (__msgid1, __msgid2, __n);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define ngettext libintl_ngettext
++#endif
++extern char *ngettext (const char *__msgid1, const char *__msgid2,
++ unsigned long int __n)
++ _INTL_ASM (libintl_ngettext);
++#endif
++
++/* Similar to `dgettext' but select the plural form corresponding to the
++ number N. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
++ const char *__msgid2, unsigned long int __n);
++static inline char *dngettext (const char *__domainname, const char *__msgid1,
++ const char *__msgid2, unsigned long int __n)
++{
++ return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dngettext libintl_dngettext
++#endif
++extern char *dngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int __n)
++ _INTL_ASM (libintl_dngettext);
++#endif
++
++/* Similar to `dcgettext' but select the plural form corresponding to the
++ number N. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dcngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int __n, int __category);
++static inline char *dcngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int __n, int __category)
++{
++ return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dcngettext libintl_dcngettext
++#endif
++extern char *dcngettext (const char *__domainname,
++ const char *__msgid1, const char *__msgid2,
++ unsigned long int __n, int __category)
++ _INTL_ASM (libintl_dcngettext);
++#endif
++
++
++/* Set the current default message catalog to DOMAINNAME.
++ If DOMAINNAME is null, return the current default.
++ If DOMAINNAME is "", reset to the default of "messages". */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_textdomain (const char *__domainname);
++static inline char *textdomain (const char *__domainname)
++{
++ return libintl_textdomain (__domainname);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define textdomain libintl_textdomain
++#endif
++extern char *textdomain (const char *__domainname)
++ _INTL_ASM (libintl_textdomain);
++#endif
++
++/* Specify that the DOMAINNAME message catalog will be found
++ in DIRNAME rather than in the system locale data base. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_bindtextdomain (const char *__domainname,
++ const char *__dirname);
++static inline char *bindtextdomain (const char *__domainname,
++ const char *__dirname)
++{
++ return libintl_bindtextdomain (__domainname, __dirname);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define bindtextdomain libintl_bindtextdomain
++#endif
++extern char *bindtextdomain (const char *__domainname, const char *__dirname)
++ _INTL_ASM (libintl_bindtextdomain);
++#endif
++
++/* Specify the character encoding in which the messages from the
++ DOMAINNAME message catalog will be returned. */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_bind_textdomain_codeset (const char *__domainname,
++ const char *__codeset);
++static inline char *bind_textdomain_codeset (const char *__domainname,
++ const char *__codeset)
++{
++ return libintl_bind_textdomain_codeset (__domainname, __codeset);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define bind_textdomain_codeset libintl_bind_textdomain_codeset
++#endif
++extern char *bind_textdomain_codeset (const char *__domainname,
++ const char *__codeset)
++ _INTL_ASM (libintl_bind_textdomain_codeset);
++#endif
++
++
++/* Support for format strings with positions in *printf(), following the
++ POSIX/XSI specification.
++ Note: These replacements for the *printf() functions are visible only
++ in source files that #include <libintl.h> or #include "gettext.h".
++ Packages that use *printf() in source files that don't refer to _()
++ or gettext() but for which the format string could be the return value
++ of _() or gettext() need to add this #include. Oh well. */
++
++#if !@HAVE_POSIX_PRINTF@
++
++#include <stdio.h>
++#include <stddef.h>
++
++/* Get va_list. */
++#if __STDC__ || defined __cplusplus || defined _MSC_VER
++# include <stdarg.h>
++#else
++# include <varargs.h>
++#endif
++
++#undef fprintf
++#define fprintf libintl_fprintf
++extern int fprintf (FILE *, const char *, ...);
++#undef vfprintf
++#define vfprintf libintl_vfprintf
++extern int vfprintf (FILE *, const char *, va_list);
++
++#undef printf
++#define printf libintl_printf
++extern int printf (const char *, ...);
++#undef vprintf
++#define vprintf libintl_vprintf
++extern int vprintf (const char *, va_list);
++
++#undef sprintf
++#define sprintf libintl_sprintf
++extern int sprintf (char *, const char *, ...);
++#undef vsprintf
++#define vsprintf libintl_vsprintf
++extern int vsprintf (char *, const char *, va_list);
++
++#if @HAVE_SNPRINTF@
++
++#undef snprintf
++#define snprintf libintl_snprintf
++extern int snprintf (char *, size_t, const char *, ...);
++#undef vsnprintf
++#define vsnprintf libintl_vsnprintf
++extern int vsnprintf (char *, size_t, const char *, va_list);
++
++#endif
++
++#if @HAVE_ASPRINTF@
++
++#undef asprintf
++#define asprintf libintl_asprintf
++extern int asprintf (char **, const char *, ...);
++#undef vasprintf
++#define vasprintf libintl_vasprintf
++extern int vasprintf (char **, const char *, va_list);
++
++#endif
++
++#if @HAVE_WPRINTF@
++
++#undef fwprintf
++#define fwprintf libintl_fwprintf
++extern int fwprintf (FILE *, const wchar_t *, ...);
++#undef vfwprintf
++#define vfwprintf libintl_vfwprintf
++extern int vfwprintf (FILE *, const wchar_t *, va_list);
++
++#undef wprintf
++#define wprintf libintl_wprintf
++extern int wprintf (const wchar_t *, ...);
++#undef vwprintf
++#define vwprintf libintl_vwprintf
++extern int vwprintf (const wchar_t *, va_list);
++
++#undef swprintf
++#define swprintf libintl_swprintf
++extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
++#undef vswprintf
++#define vswprintf libintl_vswprintf
++extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
++
++#endif
++
++#endif
++
++
++/* Support for relocatable packages. */
++
++/* Sets the original and the current installation prefix of the package.
++ Relocation simply replaces a pathname starting with the original prefix
++ by the corresponding pathname with the current prefix instead. Both
++ prefixes should be directory names without trailing slash (i.e. use ""
++ instead of "/"). */
++#define libintl_set_relocation_prefix libintl_set_relocation_prefix
++extern void
++ libintl_set_relocation_prefix (const char *orig_prefix,
++ const char *curr_prefix);
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* libintl.h */
+--- lrzsz-0.12.20.safe/intl/linux-msg.sed 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/linux-msg.sed 1969-12-31 19:00:00.000000000 -0500
+@@ -1,100 +0,0 @@
+-# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-#
+-# The first directive in the .msg should be the definition of the
+-# message set number. We use always set number 1.
+-#
+-1 {
+- i\
+-$set 1 # Automatically created by po2msg.sed
+- h
+- s/.*/0/
+- x
+-}
+-#
+-# Mitch's old catalog format does not allow comments.
+-#
+-# We copy the original message as a comment into the .msg file.
+-#
+-/^msgid/ {
+- s/msgid[ ]*"//
+-#
+-# This does not work now with the new format.
+-# /"$/! {
+-# s/\\$//
+-# s/$/ ... (more lines following)"/
+-# }
+- x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+- td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+- :d
+- s/9\(_*\)$/_\1/
+- td
+-# Assure at least one digit is available.
+- s/^\(_*\)$/0\1/
+-# Increment the last digit.
+- s/8\(_*\)$/9\1/
+- s/7\(_*\)$/8\1/
+- s/6\(_*\)$/7\1/
+- s/5\(_*\)$/6\1/
+- s/4\(_*\)$/5\1/
+- s/3\(_*\)$/4\1/
+- s/2\(_*\)$/3\1/
+- s/1\(_*\)$/2\1/
+- s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+- s/_/0/g
+- x
+- G
+- s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
+-}
+-#
+-# The .msg file contains, other then the .po file, only the translations
+-# but each given a unique ID. Starting from 1 and incrementing by 1 for
+-# each message we assign them to the messages.
+-# It is important that the .po file used to generate the cat-id-tbl.c file
+-# (with po-to-tbl) is the same as the one used here. (At least the order
+-# of declarations must not be changed.)
+-#
+-/^msgstr/ {
+- s/msgstr[ ]*"\(.*\)"/# \1/
+-# Clear substitution flag.
+- tb
+-# Append the next line.
+- :b
+- N
+-# Look whether second part is continuation line.
+- s/\(.*\n\)"\(.*\)"/\1\2/
+-# Yes, then branch.
+- ta
+- P
+- D
+-# Note that D includes a jump to the start!!
+-# We found a continuation line. But before printing insert '\'.
+- :a
+- s/\(.*\)\(\n.*\)/\1\\\2/
+- P
+-# We cannot use D here.
+- s/.*\n\(.*\)/\1/
+- tb
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/loadinfo.h 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/loadinfo.h 2004-09-12 14:40:34.468730912 -0400
+@@ -1,9 +1,54 @@
+-#ifndef PARAMS
+-# if __STDC__
+-# define PARAMS(args) args
+-# else
+-# define PARAMS(args) ()
+-# endif
++/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _LOADINFO_H
++#define _LOADINFO_H 1
++
++/* Declarations of locale dependent catalog lookup functions.
++ Implemented in
++
++ localealias.c Possibly replace a locale name by another.
++ explodename.c Split a locale name into its various fields.
++ l10nflist.c Generate a list of filenames of possible message catalogs.
++ finddomain.c Find and open the relevant message catalogs.
++
++ The main function _nl_find_domain() in finddomain.c is declared
++ in gettextP.h.
++ */
++
++#ifndef internal_function
++# define internal_function
++#endif
++
++/* Tell the compiler when a conditional or integer expression is
++ almost always true or almost always false. */
++#ifndef HAVE_BUILTIN_EXPECT
++# define __builtin_expect(expr, val) (expr)
++#endif
++
++/* Separator in PATH like lists of pathnames. */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS */
++# define PATH_SEPARATOR ';'
++#else
++ /* Unix */
++# define PATH_SEPARATOR ':'
+ #endif
+
+ /* Encoding of locale name parts. */
+@@ -32,27 +77,69 @@
+ };
+
+
+-extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
+- size_t name_len));
++/* Normalize codeset name. There is no standard for the codeset
++ names. Normalization allows the user to use any of the common
++ names. The return value is dynamically allocated and has to be
++ freed by the caller. */
++extern const char *_nl_normalize_codeset (const char *codeset,
++ size_t name_len);
+
++/* Lookup a locale dependent file.
++ *L10NFILE_LIST denotes a pool of lookup results of locale dependent
++ files of the same kind, sorted in decreasing order of ->filename.
++ DIRLIST and DIRLIST_LEN are an argz list of directories in which to
++ look, containing at least one directory (i.e. DIRLIST_LEN > 0).
++ MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
++ SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
++ produced by _nl_explode_name(). FILENAME is the filename suffix.
++ The return value is the lookup result, either found in *L10NFILE_LIST,
++ or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
++ If the return value is non-NULL, it is added to *L10NFILE_LIST, and
++ its ->next field denotes the chaining inside *L10NFILE_LIST, and
++ furthermore its ->successor[] field contains a list of other lookup
++ results from which this lookup result inherits. */
+ extern struct loaded_l10nfile *
+-_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+- const char *dirlist, size_t dirlist_len, int mask,
+- const char *language, const char *territory,
+- const char *codeset,
+- const char *normalized_codeset,
+- const char *modifier, const char *special,
+- const char *sponsor, const char *revision,
+- const char *filename, int do_allocate));
++_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
++ const char *dirlist, size_t dirlist_len, int mask,
++ const char *language, const char *territory,
++ const char *codeset, const char *normalized_codeset,
++ const char *modifier, const char *special,
++ const char *sponsor, const char *revision,
++ const char *filename, int do_allocate);
+
++/* Lookup the real locale name for a locale alias NAME, or NULL if
++ NAME is not a locale alias (but possibly a real locale name).
++ The return value is statically allocated and must not be freed. */
++extern const char *_nl_expand_alias (const char *name);
+
+-extern const char *_nl_expand_alias PARAMS ((const char *name));
++/* Split a locale name NAME into its pieces: language, modifier,
++ territory, codeset, special, sponsor, revision.
++ NAME gets destructively modified: NUL bytes are inserted here and
++ there. *LANGUAGE gets assigned NAME. Each of *MODIFIER, *TERRITORY,
++ *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
++ pointer into the old NAME string, or NULL. *NORMALIZED_CODESET
++ gets assigned the expanded *CODESET, if it is different from *CODESET;
++ this one is dynamically allocated and has to be freed by the caller.
++ The return value is a bitmask, where each bit corresponds to one
++ filled-in value:
++ XPG_MODIFIER, CEN_AUDIENCE for *MODIFIER,
++ TERRITORY for *TERRITORY,
++ XPG_CODESET for *CODESET,
++ XPG_NORM_CODESET for *NORMALIZED_CODESET,
++ CEN_SPECIAL for *SPECIAL,
++ CEN_SPONSOR for *SPONSOR,
++ CEN_REVISION for *REVISION.
++ */
++extern int _nl_explode_name (char *name, const char **language,
++ const char **modifier, const char **territory,
++ const char **codeset,
++ const char **normalized_codeset,
++ const char **special, const char **sponsor,
++ const char **revision);
+
+-extern int _nl_explode_name PARAMS ((char *name, const char **language,
+- const char **modifier,
+- const char **territory,
+- const char **codeset,
+- const char **normalized_codeset,
+- const char **special,
+- const char **sponsor,
+- const char **revision));
++/* Split a locale name NAME into a leading language part and all the
++ rest. Return a pointer to the first character after the language,
++ i.e. to the first byte of the rest. */
++extern char *_nl_find_language (const char *name);
++
++#endif /* loadinfo.h */
+--- lrzsz-0.12.20.safe/intl/loadmsgcat.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/loadmsgcat.c 2004-09-12 14:40:34.473730152 -0400
+@@ -1,42 +1,455 @@
+-/* Load needed message catalogs
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Load needed message catalogs.
++ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
++#include <ctype.h>
++#include <errno.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
++#ifdef __GNUC__
++# undef alloca
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
++# else
++# if defined HAVE_ALLOCA_H || defined _LIBC
++# include <alloca.h>
++# else
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca
++char *alloca ();
++# endif
++# endif
++# endif
++# endif
+ #endif
+
++#include <stdlib.h>
++#include <string.h>
++
+ #if defined HAVE_UNISTD_H || defined _LIBC
+ # include <unistd.h>
+ #endif
+
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
++#ifdef _LIBC
++# include <langinfo.h>
++# include <locale.h>
++#endif
++
++#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
++ || (defined _LIBC && defined _POSIX_MAPPED_FILES)
+ # include <sys/mman.h>
++# undef HAVE_MMAP
++# define HAVE_MMAP 1
++#else
++# undef HAVE_MMAP
+ #endif
+
+-#include "gettext.h"
++#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC
++# include <stdint.h>
++#endif
++#if defined HAVE_INTTYPES_H || defined _LIBC
++# include <inttypes.h>
++#endif
++
++#include "gmo.h"
+ #include "gettextP.h"
++#include "hash-string.h"
++#include "plural-exp.h"
++
++#ifdef _LIBC
++# include "../locale/localeinfo.h"
++#endif
++
++/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
++ Note that our fallback values need not be literal strings, because we don't
++ use them with preprocessor string concatenation. */
++#if !defined PRId8 || PRI_MACROS_BROKEN
++# undef PRId8
++# define PRId8 "d"
++#endif
++#if !defined PRIi8 || PRI_MACROS_BROKEN
++# undef PRIi8
++# define PRIi8 "i"
++#endif
++#if !defined PRIo8 || PRI_MACROS_BROKEN
++# undef PRIo8
++# define PRIo8 "o"
++#endif
++#if !defined PRIu8 || PRI_MACROS_BROKEN
++# undef PRIu8
++# define PRIu8 "u"
++#endif
++#if !defined PRIx8 || PRI_MACROS_BROKEN
++# undef PRIx8
++# define PRIx8 "x"
++#endif
++#if !defined PRIX8 || PRI_MACROS_BROKEN
++# undef PRIX8
++# define PRIX8 "X"
++#endif
++#if !defined PRId16 || PRI_MACROS_BROKEN
++# undef PRId16
++# define PRId16 "d"
++#endif
++#if !defined PRIi16 || PRI_MACROS_BROKEN
++# undef PRIi16
++# define PRIi16 "i"
++#endif
++#if !defined PRIo16 || PRI_MACROS_BROKEN
++# undef PRIo16
++# define PRIo16 "o"
++#endif
++#if !defined PRIu16 || PRI_MACROS_BROKEN
++# undef PRIu16
++# define PRIu16 "u"
++#endif
++#if !defined PRIx16 || PRI_MACROS_BROKEN
++# undef PRIx16
++# define PRIx16 "x"
++#endif
++#if !defined PRIX16 || PRI_MACROS_BROKEN
++# undef PRIX16
++# define PRIX16 "X"
++#endif
++#if !defined PRId32 || PRI_MACROS_BROKEN
++# undef PRId32
++# define PRId32 "d"
++#endif
++#if !defined PRIi32 || PRI_MACROS_BROKEN
++# undef PRIi32
++# define PRIi32 "i"
++#endif
++#if !defined PRIo32 || PRI_MACROS_BROKEN
++# undef PRIo32
++# define PRIo32 "o"
++#endif
++#if !defined PRIu32 || PRI_MACROS_BROKEN
++# undef PRIu32
++# define PRIu32 "u"
++#endif
++#if !defined PRIx32 || PRI_MACROS_BROKEN
++# undef PRIx32
++# define PRIx32 "x"
++#endif
++#if !defined PRIX32 || PRI_MACROS_BROKEN
++# undef PRIX32
++# define PRIX32 "X"
++#endif
++#if !defined PRId64 || PRI_MACROS_BROKEN
++# undef PRId64
++# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
++#endif
++#if !defined PRIi64 || PRI_MACROS_BROKEN
++# undef PRIi64
++# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
++#endif
++#if !defined PRIo64 || PRI_MACROS_BROKEN
++# undef PRIo64
++# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
++#endif
++#if !defined PRIu64 || PRI_MACROS_BROKEN
++# undef PRIu64
++# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
++#endif
++#if !defined PRIx64 || PRI_MACROS_BROKEN
++# undef PRIx64
++# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
++#endif
++#if !defined PRIX64 || PRI_MACROS_BROKEN
++# undef PRIX64
++# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
++#endif
++#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
++# undef PRIdLEAST8
++# define PRIdLEAST8 "d"
++#endif
++#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
++# undef PRIiLEAST8
++# define PRIiLEAST8 "i"
++#endif
++#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
++# undef PRIoLEAST8
++# define PRIoLEAST8 "o"
++#endif
++#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
++# undef PRIuLEAST8
++# define PRIuLEAST8 "u"
++#endif
++#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
++# undef PRIxLEAST8
++# define PRIxLEAST8 "x"
++#endif
++#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
++# undef PRIXLEAST8
++# define PRIXLEAST8 "X"
++#endif
++#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
++# undef PRIdLEAST16
++# define PRIdLEAST16 "d"
++#endif
++#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
++# undef PRIiLEAST16
++# define PRIiLEAST16 "i"
++#endif
++#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
++# undef PRIoLEAST16
++# define PRIoLEAST16 "o"
++#endif
++#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
++# undef PRIuLEAST16
++# define PRIuLEAST16 "u"
++#endif
++#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
++# undef PRIxLEAST16
++# define PRIxLEAST16 "x"
++#endif
++#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
++# undef PRIXLEAST16
++# define PRIXLEAST16 "X"
++#endif
++#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
++# undef PRIdLEAST32
++# define PRIdLEAST32 "d"
++#endif
++#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
++# undef PRIiLEAST32
++# define PRIiLEAST32 "i"
++#endif
++#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
++# undef PRIoLEAST32
++# define PRIoLEAST32 "o"
++#endif
++#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
++# undef PRIuLEAST32
++# define PRIuLEAST32 "u"
++#endif
++#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
++# undef PRIxLEAST32
++# define PRIxLEAST32 "x"
++#endif
++#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
++# undef PRIXLEAST32
++# define PRIXLEAST32 "X"
++#endif
++#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
++# undef PRIdLEAST64
++# define PRIdLEAST64 PRId64
++#endif
++#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
++# undef PRIiLEAST64
++# define PRIiLEAST64 PRIi64
++#endif
++#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
++# undef PRIoLEAST64
++# define PRIoLEAST64 PRIo64
++#endif
++#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
++# undef PRIuLEAST64
++# define PRIuLEAST64 PRIu64
++#endif
++#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
++# undef PRIxLEAST64
++# define PRIxLEAST64 PRIx64
++#endif
++#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
++# undef PRIXLEAST64
++# define PRIXLEAST64 PRIX64
++#endif
++#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
++# undef PRIdFAST8
++# define PRIdFAST8 "d"
++#endif
++#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
++# undef PRIiFAST8
++# define PRIiFAST8 "i"
++#endif
++#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
++# undef PRIoFAST8
++# define PRIoFAST8 "o"
++#endif
++#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
++# undef PRIuFAST8
++# define PRIuFAST8 "u"
++#endif
++#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
++# undef PRIxFAST8
++# define PRIxFAST8 "x"
++#endif
++#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
++# undef PRIXFAST8
++# define PRIXFAST8 "X"
++#endif
++#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
++# undef PRIdFAST16
++# define PRIdFAST16 "d"
++#endif
++#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
++# undef PRIiFAST16
++# define PRIiFAST16 "i"
++#endif
++#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
++# undef PRIoFAST16
++# define PRIoFAST16 "o"
++#endif
++#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
++# undef PRIuFAST16
++# define PRIuFAST16 "u"
++#endif
++#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
++# undef PRIxFAST16
++# define PRIxFAST16 "x"
++#endif
++#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
++# undef PRIXFAST16
++# define PRIXFAST16 "X"
++#endif
++#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
++# undef PRIdFAST32
++# define PRIdFAST32 "d"
++#endif
++#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
++# undef PRIiFAST32
++# define PRIiFAST32 "i"
++#endif
++#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
++# undef PRIoFAST32
++# define PRIoFAST32 "o"
++#endif
++#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
++# undef PRIuFAST32
++# define PRIuFAST32 "u"
++#endif
++#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
++# undef PRIxFAST32
++# define PRIxFAST32 "x"
++#endif
++#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
++# undef PRIXFAST32
++# define PRIXFAST32 "X"
++#endif
++#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
++# undef PRIdFAST64
++# define PRIdFAST64 PRId64
++#endif
++#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
++# undef PRIiFAST64
++# define PRIiFAST64 PRIi64
++#endif
++#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
++# undef PRIoFAST64
++# define PRIoFAST64 PRIo64
++#endif
++#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
++# undef PRIuFAST64
++# define PRIuFAST64 PRIu64
++#endif
++#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
++# undef PRIxFAST64
++# define PRIxFAST64 PRIx64
++#endif
++#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
++# undef PRIXFAST64
++# define PRIXFAST64 PRIX64
++#endif
++#if !defined PRIdMAX || PRI_MACROS_BROKEN
++# undef PRIdMAX
++# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
++#endif
++#if !defined PRIiMAX || PRI_MACROS_BROKEN
++# undef PRIiMAX
++# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
++#endif
++#if !defined PRIoMAX || PRI_MACROS_BROKEN
++# undef PRIoMAX
++# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
++#endif
++#if !defined PRIuMAX || PRI_MACROS_BROKEN
++# undef PRIuMAX
++# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
++#endif
++#if !defined PRIxMAX || PRI_MACROS_BROKEN
++# undef PRIxMAX
++# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
++#endif
++#if !defined PRIXMAX || PRI_MACROS_BROKEN
++# undef PRIXMAX
++# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
++#endif
++#if !defined PRIdPTR || PRI_MACROS_BROKEN
++# undef PRIdPTR
++# define PRIdPTR \
++ (sizeof (void *) == sizeof (long) ? "ld" : \
++ sizeof (void *) == sizeof (int) ? "d" : \
++ "lld")
++#endif
++#if !defined PRIiPTR || PRI_MACROS_BROKEN
++# undef PRIiPTR
++# define PRIiPTR \
++ (sizeof (void *) == sizeof (long) ? "li" : \
++ sizeof (void *) == sizeof (int) ? "i" : \
++ "lli")
++#endif
++#if !defined PRIoPTR || PRI_MACROS_BROKEN
++# undef PRIoPTR
++# define PRIoPTR \
++ (sizeof (void *) == sizeof (long) ? "lo" : \
++ sizeof (void *) == sizeof (int) ? "o" : \
++ "llo")
++#endif
++#if !defined PRIuPTR || PRI_MACROS_BROKEN
++# undef PRIuPTR
++# define PRIuPTR \
++ (sizeof (void *) == sizeof (long) ? "lu" : \
++ sizeof (void *) == sizeof (int) ? "u" : \
++ "llu")
++#endif
++#if !defined PRIxPTR || PRI_MACROS_BROKEN
++# undef PRIxPTR
++# define PRIxPTR \
++ (sizeof (void *) == sizeof (long) ? "lx" : \
++ sizeof (void *) == sizeof (int) ? "x" : \
++ "llx")
++#endif
++#if !defined PRIXPTR || PRI_MACROS_BROKEN
++# undef PRIXPTR
++# define PRIXPTR \
++ (sizeof (void *) == sizeof (long) ? "lX" : \
++ sizeof (void *) == sizeof (int) ? "X" : \
++ "llX")
++#endif
+
+ /* @@ end of prolog @@ */
+
+@@ -44,7 +457,6 @@
+ /* Rename the non ISO C functions. This is required by the standard
+ because some ISO C functions will require linking with this object
+ file and the name space must not be polluted. */
+-# define fstat __fstat
+ # define open __open
+ # define close __close
+ # define read __read
+@@ -52,30 +464,471 @@
+ # define munmap __munmap
+ #endif
+
++/* For those losing systems which don't have `alloca' we have to add
++ some additional code emulating it. */
++#ifdef HAVE_ALLOCA
++# define freea(p) /* nothing */
++#else
++# define alloca(n) malloc (n)
++# define freea(p) free (p)
++#endif
++
++/* For systems that distinguish between text and binary I/O.
++ O_BINARY is usually declared in <fcntl.h>. */
++#if !defined O_BINARY && defined _O_BINARY
++ /* For MSC-compatible compilers. */
++# define O_BINARY _O_BINARY
++# define O_TEXT _O_TEXT
++#endif
++#ifdef __BEOS__
++ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
++# undef O_BINARY
++# undef O_TEXT
++#endif
++/* On reasonable systems, binary I/O is the default. */
++#ifndef O_BINARY
++# define O_BINARY 0
++#endif
++
++
+ /* We need a sign, whether a new catalog was loaded, which can be associated
+ with all translations. This is important if the translations are
+ cached by one of GCC's features. */
+-int _nl_msg_cat_cntr = 0;
++int _nl_msg_cat_cntr;
+
+
++/* Expand a system dependent string segment. Return NULL if unsupported. */
++static const char *
++get_sysdep_segment_value (const char *name)
++{
++ /* Test for an ISO C 99 section 7.8.1 format string directive.
++ Syntax:
++ P R I { d | i | o | u | x | X }
++ { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR } */
++ /* We don't use a table of 14 times 6 'const char *' strings here, because
++ data relocations cost startup time. */
++ if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')
++ {
++ if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u'
++ || name[3] == 'x' || name[3] == 'X')
++ {
++ if (name[4] == '8' && name[5] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRId8;
++ if (name[3] == 'i')
++ return PRIi8;
++ if (name[3] == 'o')
++ return PRIo8;
++ if (name[3] == 'u')
++ return PRIu8;
++ if (name[3] == 'x')
++ return PRIx8;
++ if (name[3] == 'X')
++ return PRIX8;
++ abort ();
++ }
++ if (name[4] == '1' && name[5] == '6' && name[6] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRId16;
++ if (name[3] == 'i')
++ return PRIi16;
++ if (name[3] == 'o')
++ return PRIo16;
++ if (name[3] == 'u')
++ return PRIu16;
++ if (name[3] == 'x')
++ return PRIx16;
++ if (name[3] == 'X')
++ return PRIX16;
++ abort ();
++ }
++ if (name[4] == '3' && name[5] == '2' && name[6] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRId32;
++ if (name[3] == 'i')
++ return PRIi32;
++ if (name[3] == 'o')
++ return PRIo32;
++ if (name[3] == 'u')
++ return PRIu32;
++ if (name[3] == 'x')
++ return PRIx32;
++ if (name[3] == 'X')
++ return PRIX32;
++ abort ();
++ }
++ if (name[4] == '6' && name[5] == '4' && name[6] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRId64;
++ if (name[3] == 'i')
++ return PRIi64;
++ if (name[3] == 'o')
++ return PRIo64;
++ if (name[3] == 'u')
++ return PRIu64;
++ if (name[3] == 'x')
++ return PRIx64;
++ if (name[3] == 'X')
++ return PRIX64;
++ abort ();
++ }
++ if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A'
++ && name[7] == 'S' && name[8] == 'T')
++ {
++ if (name[9] == '8' && name[10] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdLEAST8;
++ if (name[3] == 'i')
++ return PRIiLEAST8;
++ if (name[3] == 'o')
++ return PRIoLEAST8;
++ if (name[3] == 'u')
++ return PRIuLEAST8;
++ if (name[3] == 'x')
++ return PRIxLEAST8;
++ if (name[3] == 'X')
++ return PRIXLEAST8;
++ abort ();
++ }
++ if (name[9] == '1' && name[10] == '6' && name[11] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdLEAST16;
++ if (name[3] == 'i')
++ return PRIiLEAST16;
++ if (name[3] == 'o')
++ return PRIoLEAST16;
++ if (name[3] == 'u')
++ return PRIuLEAST16;
++ if (name[3] == 'x')
++ return PRIxLEAST16;
++ if (name[3] == 'X')
++ return PRIXLEAST16;
++ abort ();
++ }
++ if (name[9] == '3' && name[10] == '2' && name[11] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdLEAST32;
++ if (name[3] == 'i')
++ return PRIiLEAST32;
++ if (name[3] == 'o')
++ return PRIoLEAST32;
++ if (name[3] == 'u')
++ return PRIuLEAST32;
++ if (name[3] == 'x')
++ return PRIxLEAST32;
++ if (name[3] == 'X')
++ return PRIXLEAST32;
++ abort ();
++ }
++ if (name[9] == '6' && name[10] == '4' && name[11] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdLEAST64;
++ if (name[3] == 'i')
++ return PRIiLEAST64;
++ if (name[3] == 'o')
++ return PRIoLEAST64;
++ if (name[3] == 'u')
++ return PRIuLEAST64;
++ if (name[3] == 'x')
++ return PRIxLEAST64;
++ if (name[3] == 'X')
++ return PRIXLEAST64;
++ abort ();
++ }
++ }
++ if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S'
++ && name[7] == 'T')
++ {
++ if (name[8] == '8' && name[9] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdFAST8;
++ if (name[3] == 'i')
++ return PRIiFAST8;
++ if (name[3] == 'o')
++ return PRIoFAST8;
++ if (name[3] == 'u')
++ return PRIuFAST8;
++ if (name[3] == 'x')
++ return PRIxFAST8;
++ if (name[3] == 'X')
++ return PRIXFAST8;
++ abort ();
++ }
++ if (name[8] == '1' && name[9] == '6' && name[10] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdFAST16;
++ if (name[3] == 'i')
++ return PRIiFAST16;
++ if (name[3] == 'o')
++ return PRIoFAST16;
++ if (name[3] == 'u')
++ return PRIuFAST16;
++ if (name[3] == 'x')
++ return PRIxFAST16;
++ if (name[3] == 'X')
++ return PRIXFAST16;
++ abort ();
++ }
++ if (name[8] == '3' && name[9] == '2' && name[10] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdFAST32;
++ if (name[3] == 'i')
++ return PRIiFAST32;
++ if (name[3] == 'o')
++ return PRIoFAST32;
++ if (name[3] == 'u')
++ return PRIuFAST32;
++ if (name[3] == 'x')
++ return PRIxFAST32;
++ if (name[3] == 'X')
++ return PRIXFAST32;
++ abort ();
++ }
++ if (name[8] == '6' && name[9] == '4' && name[10] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdFAST64;
++ if (name[3] == 'i')
++ return PRIiFAST64;
++ if (name[3] == 'o')
++ return PRIoFAST64;
++ if (name[3] == 'u')
++ return PRIuFAST64;
++ if (name[3] == 'x')
++ return PRIxFAST64;
++ if (name[3] == 'X')
++ return PRIXFAST64;
++ abort ();
++ }
++ }
++ if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X'
++ && name[7] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdMAX;
++ if (name[3] == 'i')
++ return PRIiMAX;
++ if (name[3] == 'o')
++ return PRIoMAX;
++ if (name[3] == 'u')
++ return PRIuMAX;
++ if (name[3] == 'x')
++ return PRIxMAX;
++ if (name[3] == 'X')
++ return PRIXMAX;
++ abort ();
++ }
++ if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R'
++ && name[7] == '\0')
++ {
++ if (name[3] == 'd')
++ return PRIdPTR;
++ if (name[3] == 'i')
++ return PRIiPTR;
++ if (name[3] == 'o')
++ return PRIoPTR;
++ if (name[3] == 'u')
++ return PRIuPTR;
++ if (name[3] == 'x')
++ return PRIxPTR;
++ if (name[3] == 'X')
++ return PRIXPTR;
++ abort ();
++ }
++ }
++ }
++ /* Test for a glibc specific printf() format directive flag. */
++ if (name[0] == 'I' && name[1] == '\0')
++ {
++#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
++ /* The 'I' flag, in numeric format directives, replaces ASCII digits
++ with the 'outdigits' defined in the LC_CTYPE locale facet. This is
++ used for Farsi (Persian) and maybe Arabic. */
++ return "I";
++#else
++ return "";
++#endif
++ }
++ /* Other system dependent strings are not valid. */
++ return NULL;
++}
++
++/* Initialize the codeset dependent parts of an opened message catalog.
++ Return the header entry. */
++const char *
++internal_function
++_nl_init_domain_conv (struct loaded_l10nfile *domain_file,
++ struct loaded_domain *domain,
++ struct binding *domainbinding)
++{
++ /* Find out about the character set the file is encoded with.
++ This can be found (in textual form) in the entry "". If this
++ entry does not exist or if this does not contain the `charset='
++ information, we will assume the charset matches the one the
++ current locale and we don't have to perform any conversion. */
++ char *nullentry;
++ size_t nullentrylen;
++
++ /* Preinitialize fields, to avoid recursion during _nl_find_msg. */
++ domain->codeset_cntr =
++ (domainbinding != NULL ? domainbinding->codeset_cntr : 0);
++#ifdef _LIBC
++ domain->conv = (__gconv_t) -1;
++#else
++# if HAVE_ICONV
++ domain->conv = (iconv_t) -1;
++# endif
++#endif
++ domain->conv_tab = NULL;
++
++ /* Get the header entry. */
++ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
++
++ if (nullentry != NULL)
++ {
++#if defined _LIBC || HAVE_ICONV
++ const char *charsetstr;
++
++ charsetstr = strstr (nullentry, "charset=");
++ if (charsetstr != NULL)
++ {
++ size_t len;
++ char *charset;
++ const char *outcharset;
++
++ charsetstr += strlen ("charset=");
++ len = strcspn (charsetstr, " \t\n");
++
++ charset = (char *) alloca (len + 1);
++# if defined _LIBC || HAVE_MEMPCPY
++ *((char *) mempcpy (charset, charsetstr, len)) = '\0';
++# else
++ memcpy (charset, charsetstr, len);
++ charset[len] = '\0';
++# endif
++
++ /* The output charset should normally be determined by the
++ locale. But sometimes the locale is not used or not correctly
++ set up, so we provide a possibility for the user to override
++ this. Moreover, the value specified through
++ bind_textdomain_codeset overrides both. */
++ if (domainbinding != NULL && domainbinding->codeset != NULL)
++ outcharset = domainbinding->codeset;
++ else
++ {
++ outcharset = getenv ("OUTPUT_CHARSET");
++ if (outcharset == NULL || outcharset[0] == '\0')
++ {
++# ifdef _LIBC
++ outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
++# else
++# if HAVE_ICONV
++ extern const char *locale_charset (void);
++ outcharset = locale_charset ();
++# endif
++# endif
++ }
++ }
++
++# ifdef _LIBC
++ /* We always want to use transliteration. */
++ outcharset = norm_add_slashes (outcharset, "TRANSLIT");
++ charset = norm_add_slashes (charset, NULL);
++ if (__gconv_open (outcharset, charset, &domain->conv,
++ GCONV_AVOID_NOCONV)
++ != __GCONV_OK)
++ domain->conv = (__gconv_t) -1;
++# else
++# if HAVE_ICONV
++ /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
++ we want to use transliteration. */
++# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
++ || _LIBICONV_VERSION >= 0x0105
++ if (strchr (outcharset, '/') == NULL)
++ {
++ char *tmp;
++
++ len = strlen (outcharset);
++ tmp = (char *) alloca (len + 10 + 1);
++ memcpy (tmp, outcharset, len);
++ memcpy (tmp + len, "//TRANSLIT", 10 + 1);
++ outcharset = tmp;
++
++ domain->conv = iconv_open (outcharset, charset);
++
++ freea (outcharset);
++ }
++ else
++# endif
++ domain->conv = iconv_open (outcharset, charset);
++# endif
++# endif
++
++ freea (charset);
++ }
++#endif /* _LIBC || HAVE_ICONV */
++ }
++
++ return nullentry;
++}
++
++/* Frees the codeset dependent parts of an opened message catalog. */
++void
++internal_function
++_nl_free_domain_conv (struct loaded_domain *domain)
++{
++ if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
++ free (domain->conv_tab);
++
++#ifdef _LIBC
++ if (domain->conv != (__gconv_t) -1)
++ __gconv_close (domain->conv);
++#else
++# if HAVE_ICONV
++ if (domain->conv != (iconv_t) -1)
++ iconv_close (domain->conv);
++# endif
++#endif
++}
++
+ /* Load the message catalogs specified by FILENAME. If it is no valid
+ message catalog do nothing. */
+ void
+-_nl_load_domain (domain_file)
+- struct loaded_l10nfile *domain_file;
++internal_function
++_nl_load_domain (struct loaded_l10nfile *domain_file,
++ struct binding *domainbinding)
+ {
+ int fd;
++ size_t size;
++#ifdef _LIBC
++ struct stat64 st;
++#else
+ struct stat st;
++#endif
+ struct mo_file_header *data = (struct mo_file_header *) -1;
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+- || defined _LIBC
+ int use_mmap = 0;
+-#endif
+ struct loaded_domain *domain;
++ int revision;
++ const char *nullentry;
+
+ domain_file->decided = 1;
+ domain_file->data = NULL;
+
++ /* Note that it would be useless to store domainbinding in domain_file
++ because domainbinding might be == NULL now but != NULL later (after
++ a call to bind_textdomain_codeset). */
++
+ /* If the record does not represent a valid locale the FILENAME
+ might be NULL. This can happen when according to the given
+ specification the locale file name is different for XPG and CEN
+@@ -84,27 +937,32 @@
+ return;
+
+ /* Try to open the addressed file. */
+- fd = open (domain_file->filename, O_RDONLY);
++ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+ if (fd == -1)
+ return;
+
+ /* We must know about the size of the file. */
+- if (fstat (fd, &st) != 0
+- && st.st_size < (off_t) sizeof (struct mo_file_header))
++ if (
++#ifdef _LIBC
++ __builtin_expect (fstat64 (fd, &st) != 0, 0)
++#else
++ __builtin_expect (fstat (fd, &st) != 0, 0)
++#endif
++ || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
++ || __builtin_expect (size < sizeof (struct mo_file_header), 0))
+ {
+ /* Something went wrong. */
+ close (fd);
+ return;
+ }
+
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+- || defined _LIBC
++#ifdef HAVE_MMAP
+ /* Now we are ready to load the file. If mmap() is available we try
+ this first. If not available or it failed we try to load it. */
+- data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
++ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+ MAP_PRIVATE, fd, 0);
+
+- if (data != (struct mo_file_header *) -1)
++ if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
+ {
+ /* mmap() call was successful. */
+ close (fd);
+@@ -116,24 +974,27 @@
+ it manually. */
+ if (data == (struct mo_file_header *) -1)
+ {
+- off_t to_read;
++ size_t to_read;
+ char *read_ptr;
+
+- data = (struct mo_file_header *) malloc (st.st_size);
++ data = (struct mo_file_header *) malloc (size);
+ if (data == NULL)
+ return;
+
+- to_read = st.st_size;
++ to_read = size;
+ read_ptr = (char *) data;
+ do
+ {
+ long int nb = (long int) read (fd, read_ptr, to_read);
+- if (nb == -1)
++ if (nb <= 0)
+ {
++#ifdef EINTR
++ if (nb == -1 && errno == EINTR)
++ continue;
++#endif
+ close (fd);
+ return;
+ }
+-
+ read_ptr += nb;
+ to_read -= nb;
+ }
+@@ -144,47 +1005,378 @@
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+- if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
++ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
++ 0))
+ {
+ /* The magic number is wrong: not a message catalog file. */
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+- || defined _LIBC
++#ifdef HAVE_MMAP
+ if (use_mmap)
+- munmap ((caddr_t) data, st.st_size);
++ munmap ((caddr_t) data, size);
+ else
+ #endif
+ free (data);
+ return;
+ }
+
+- domain_file->data
+- = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+- if (domain_file->data == NULL)
++ domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
++ if (domain == NULL)
+ return;
++ domain_file->data = domain;
+
+- domain = (struct loaded_domain *) domain_file->data;
+ domain->data = (char *) data;
++ domain->use_mmap = use_mmap;
++ domain->mmap_size = size;
+ domain->must_swap = data->magic != _MAGIC;
++ domain->malloced = NULL;
+
+ /* Fill in the information about the available tables. */
+- switch (W (domain->must_swap, data->revision))
++ revision = W (domain->must_swap, data->revision);
++ /* We support only the major revisions 0 and 1. */
++ switch (revision >> 16)
+ {
+ case 0:
++ case 1:
+ domain->nstrings = W (domain->must_swap, data->nstrings);
+- domain->orig_tab = (struct string_desc *)
++ domain->orig_tab = (const struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+- domain->trans_tab = (struct string_desc *)
++ domain->trans_tab = (const struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+- domain->hash_tab = (nls_uint32 *)
+- ((char *) data + W (domain->must_swap, data->hash_tab_offset));
++ domain->hash_tab =
++ (domain->hash_size > 2
++ ? (const nls_uint32 *)
++ ((char *) data + W (domain->must_swap, data->hash_tab_offset))
++ : NULL);
++ domain->must_swap_hash_tab = domain->must_swap;
++
++ /* Now dispatch on the minor revision. */
++ switch (revision & 0xffff)
++ {
++ case 0:
++ domain->n_sysdep_strings = 0;
++ domain->orig_sysdep_tab = NULL;
++ domain->trans_sysdep_tab = NULL;
++ break;
++ case 1:
++ default:
++ {
++ nls_uint32 n_sysdep_strings;
++
++ if (domain->hash_tab == NULL)
++ /* This is invalid. These minor revisions need a hash table. */
++ goto invalid;
++
++ n_sysdep_strings =
++ W (domain->must_swap, data->n_sysdep_strings);
++ if (n_sysdep_strings > 0)
++ {
++ nls_uint32 n_sysdep_segments;
++ const struct sysdep_segment *sysdep_segments;
++ const char **sysdep_segment_values;
++ const nls_uint32 *orig_sysdep_tab;
++ const nls_uint32 *trans_sysdep_tab;
++ nls_uint32 n_inmem_sysdep_strings;
++ size_t memneed;
++ char *mem;
++ struct sysdep_string_desc *inmem_orig_sysdep_tab;
++ struct sysdep_string_desc *inmem_trans_sysdep_tab;
++ nls_uint32 *inmem_hash_tab;
++ unsigned int i, j;
++
++ /* Get the values of the system dependent segments. */
++ n_sysdep_segments =
++ W (domain->must_swap, data->n_sysdep_segments);
++ sysdep_segments = (const struct sysdep_segment *)
++ ((char *) data
++ + W (domain->must_swap, data->sysdep_segments_offset));
++ sysdep_segment_values =
++ alloca (n_sysdep_segments * sizeof (const char *));
++ for (i = 0; i < n_sysdep_segments; i++)
++ {
++ const char *name =
++ (char *) data
++ + W (domain->must_swap, sysdep_segments[i].offset);
++ nls_uint32 namelen =
++ W (domain->must_swap, sysdep_segments[i].length);
++
++ if (!(namelen > 0 && name[namelen - 1] == '\0'))
++ {
++ freea (sysdep_segment_values);
++ goto invalid;
++ }
++
++ sysdep_segment_values[i] = get_sysdep_segment_value (name);
++ }
++
++ orig_sysdep_tab = (const nls_uint32 *)
++ ((char *) data
++ + W (domain->must_swap, data->orig_sysdep_tab_offset));
++ trans_sysdep_tab = (const nls_uint32 *)
++ ((char *) data
++ + W (domain->must_swap, data->trans_sysdep_tab_offset));
++
++ /* Compute the amount of additional memory needed for the
++ system dependent strings and the augmented hash table.
++ At the same time, also drop string pairs which refer to
++ an undefined system dependent segment. */
++ n_inmem_sysdep_strings = 0;
++ memneed = domain->hash_size * sizeof (nls_uint32);
++ for (i = 0; i < n_sysdep_strings; i++)
++ {
++ int valid = 1;
++ size_t needs[2];
++
++ for (j = 0; j < 2; j++)
++ {
++ const struct sysdep_string *sysdep_string =
++ (const struct sysdep_string *)
++ ((char *) data
++ + W (domain->must_swap,
++ j == 0
++ ? orig_sysdep_tab[i]
++ : trans_sysdep_tab[i]));
++ size_t need = 0;
++ const struct segment_pair *p = sysdep_string->segments;
++
++ if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END)
++ for (p = sysdep_string->segments;; p++)
++ {
++ nls_uint32 sysdepref;
++
++ need += W (domain->must_swap, p->segsize);
++
++ sysdepref = W (domain->must_swap, p->sysdepref);
++ if (sysdepref == SEGMENTS_END)
++ break;
++
++ if (sysdepref >= n_sysdep_segments)
++ {
++ /* Invalid. */
++ freea (sysdep_segment_values);
++ goto invalid;
++ }
++
++ if (sysdep_segment_values[sysdepref] == NULL)
++ {
++ /* This particular string pair is invalid. */
++ valid = 0;
++ break;
++ }
++
++ need += strlen (sysdep_segment_values[sysdepref]);
++ }
++
++ needs[j] = need;
++ if (!valid)
++ break;
++ }
++
++ if (valid)
++ {
++ n_inmem_sysdep_strings++;
++ memneed += needs[0] + needs[1];
++ }
++ }
++ memneed += 2 * n_inmem_sysdep_strings
++ * sizeof (struct sysdep_string_desc);
++
++ if (n_inmem_sysdep_strings > 0)
++ {
++ unsigned int k;
++
++ /* Allocate additional memory. */
++ mem = (char *) malloc (memneed);
++ if (mem == NULL)
++ goto invalid;
++
++ domain->malloced = mem;
++ inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;
++ mem += n_inmem_sysdep_strings
++ * sizeof (struct sysdep_string_desc);
++ inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem;
++ mem += n_inmem_sysdep_strings
++ * sizeof (struct sysdep_string_desc);
++ inmem_hash_tab = (nls_uint32 *) mem;
++ mem += domain->hash_size * sizeof (nls_uint32);
++
++ /* Compute the system dependent strings. */
++ k = 0;
++ for (i = 0; i < n_sysdep_strings; i++)
++ {
++ int valid = 1;
++
++ for (j = 0; j < 2; j++)
++ {
++ const struct sysdep_string *sysdep_string =
++ (const struct sysdep_string *)
++ ((char *) data
++ + W (domain->must_swap,
++ j == 0
++ ? orig_sysdep_tab[i]
++ : trans_sysdep_tab[i]));
++ const struct segment_pair *p =
++ sysdep_string->segments;
++
++ if (W (domain->must_swap, p->sysdepref)
++ != SEGMENTS_END)
++ for (p = sysdep_string->segments;; p++)
++ {
++ nls_uint32 sysdepref;
++
++ sysdepref =
++ W (domain->must_swap, p->sysdepref);
++ if (sysdepref == SEGMENTS_END)
++ break;
++
++ if (sysdep_segment_values[sysdepref] == NULL)
++ {
++ /* This particular string pair is
++ invalid. */
++ valid = 0;
++ break;
++ }
++ }
++
++ if (!valid)
++ break;
++ }
++
++ if (valid)
++ {
++ for (j = 0; j < 2; j++)
++ {
++ const struct sysdep_string *sysdep_string =
++ (const struct sysdep_string *)
++ ((char *) data
++ + W (domain->must_swap,
++ j == 0
++ ? orig_sysdep_tab[i]
++ : trans_sysdep_tab[i]));
++ const char *static_segments =
++ (char *) data
++ + W (domain->must_swap, sysdep_string->offset);
++ const struct segment_pair *p =
++ sysdep_string->segments;
++
++ /* Concatenate the segments, and fill
++ inmem_orig_sysdep_tab[k] (for j == 0) and
++ inmem_trans_sysdep_tab[k] (for j == 1). */
++
++ struct sysdep_string_desc *inmem_tab_entry =
++ (j == 0
++ ? inmem_orig_sysdep_tab
++ : inmem_trans_sysdep_tab)
++ + k;
++
++ if (W (domain->must_swap, p->sysdepref)
++ == SEGMENTS_END)
++ {
++ /* Only one static segment. */
++ inmem_tab_entry->length =
++ W (domain->must_swap, p->segsize);
++ inmem_tab_entry->pointer = static_segments;
++ }
++ else
++ {
++ inmem_tab_entry->pointer = mem;
++
++ for (p = sysdep_string->segments;; p++)
++ {
++ nls_uint32 segsize =
++ W (domain->must_swap, p->segsize);
++ nls_uint32 sysdepref =
++ W (domain->must_swap, p->sysdepref);
++ size_t n;
++
++ if (segsize > 0)
++ {
++ memcpy (mem, static_segments, segsize);
++ mem += segsize;
++ static_segments += segsize;
++ }
++
++ if (sysdepref == SEGMENTS_END)
++ break;
++
++ n = strlen (sysdep_segment_values[sysdepref]);
++ memcpy (mem, sysdep_segment_values[sysdepref], n);
++ mem += n;
++ }
++
++ inmem_tab_entry->length =
++ mem - inmem_tab_entry->pointer;
++ }
++ }
++
++ k++;
++ }
++ }
++ if (k != n_inmem_sysdep_strings)
++ abort ();
++
++ /* Compute the augmented hash table. */
++ for (i = 0; i < domain->hash_size; i++)
++ inmem_hash_tab[i] =
++ W (domain->must_swap_hash_tab, domain->hash_tab[i]);
++ for (i = 0; i < n_inmem_sysdep_strings; i++)
++ {
++ const char *msgid = inmem_orig_sysdep_tab[i].pointer;
++ nls_uint32 hash_val = hash_string (msgid);
++ nls_uint32 idx = hash_val % domain->hash_size;
++ nls_uint32 incr =
++ 1 + (hash_val % (domain->hash_size - 2));
++
++ for (;;)
++ {
++ if (inmem_hash_tab[idx] == 0)
++ {
++ /* Hash table entry is empty. Use it. */
++ inmem_hash_tab[idx] = 1 + domain->nstrings + i;
++ break;
++ }
++
++ if (idx >= domain->hash_size - incr)
++ idx -= domain->hash_size - incr;
++ else
++ idx += incr;
++ }
++ }
++
++ domain->n_sysdep_strings = n_inmem_sysdep_strings;
++ domain->orig_sysdep_tab = inmem_orig_sysdep_tab;
++ domain->trans_sysdep_tab = inmem_trans_sysdep_tab;
++
++ domain->hash_tab = inmem_hash_tab;
++ domain->must_swap_hash_tab = 0;
++ }
++ else
++ {
++ domain->n_sysdep_strings = 0;
++ domain->orig_sysdep_tab = NULL;
++ domain->trans_sysdep_tab = NULL;
++ }
++
++ freea (sysdep_segment_values);
++ }
++ else
++ {
++ domain->n_sysdep_strings = 0;
++ domain->orig_sysdep_tab = NULL;
++ domain->trans_sysdep_tab = NULL;
++ }
++ }
++ break;
++ }
+ break;
+ default:
+- /* This is an illegal revision. */
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+- || defined _LIBC
++ /* This is an invalid revision. */
++ invalid:
++ /* This is an invalid .mo file. */
++ if (domain->malloced)
++ free (domain->malloced);
++#ifdef HAVE_MMAP
+ if (use_mmap)
+- munmap ((caddr_t) data, st.st_size);
++ munmap ((caddr_t) data, size);
+ else
+ #endif
+ free (data);
+@@ -193,7 +1385,36 @@
+ return;
+ }
+
+- /* Show that one domain is changed. This might make some cached
+- translations invalid. */
+- ++_nl_msg_cat_cntr;
++ /* Now initialize the character set converter from the character set
++ the file is encoded with (found in the header entry) to the domain's
++ specified character set or the locale's character set. */
++ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
++
++ /* Also look for a plural specification. */
++ EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
+ }
++
++
++#ifdef _LIBC
++void
++internal_function
++_nl_unload_domain (struct loaded_domain *domain)
++{
++ if (domain->plural != &__gettext_germanic_plural)
++ __gettext_free_exp (domain->plural);
++
++ _nl_free_domain_conv (domain);
++
++ if (domain->malloced)
++ free (domain->malloced);
++
++# ifdef _POSIX_MAPPED_FILES
++ if (domain->use_mmap)
++ munmap ((caddr_t) domain->data, domain->mmap_size);
++ else
++# endif /* _POSIX_MAPPED_FILES */
++ free ((void *) domain->data);
++
++ free (domain);
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/localcharset.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localcharset.c 2004-09-12 14:40:34.478729392 -0400
+@@ -0,0 +1,398 @@
++/* Determine a canonical name for the current locale's character encoding.
++
++ Copyright (C) 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Written by Bruno Haible <bruno@clisp.org>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification. */
++#include "localcharset.h"
++
++#if HAVE_STDDEF_H
++# include <stddef.h>
++#endif
++
++#include <stdio.h>
++#if HAVE_STRING_H
++# include <string.h>
++#else
++# include <strings.h>
++#endif
++#if HAVE_STDLIB_H
++# include <stdlib.h>
++#endif
++
++#if defined _WIN32 || defined __WIN32__
++# undef WIN32 /* avoid warning on mingw32 */
++# define WIN32
++#endif
++
++#if defined __EMX__
++/* Assume EMX program runs on OS/2, even if compiled under DOS. */
++# define OS2
++#endif
++
++#if !defined WIN32
++# if HAVE_LANGINFO_CODESET
++# include <langinfo.h>
++# else
++# if HAVE_SETLOCALE
++# include <locale.h>
++# endif
++# endif
++#elif defined WIN32
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++#endif
++#if defined OS2
++# define INCL_DOS
++# include <os2.h>
++#endif
++
++#if ENABLE_RELOCATABLE
++# include "relocatable.h"
++#else
++# define relocate(pathname) (pathname)
++#endif
++
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++#endif
++
++#ifndef DIRECTORY_SEPARATOR
++# define DIRECTORY_SEPARATOR '/'
++#endif
++
++#ifndef ISSLASH
++# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
++#endif
++
++#if HAVE_DECL_GETC_UNLOCKED
++# undef getc
++# define getc getc_unlocked
++#endif
++
++/* The following static variable is declared 'volatile' to avoid a
++ possible multithread problem in the function get_charset_aliases. If we
++ are running in a threaded environment, and if two threads initialize
++ 'charset_aliases' simultaneously, both will produce the same value,
++ and everything will be ok if the two assignments to 'charset_aliases'
++ are atomic. But I don't know what will happen if the two assignments mix. */
++#if __STDC__ != 1
++# define volatile /* empty */
++#endif
++/* Pointer to the contents of the charset.alias file, if it has already been
++ read, else NULL. Its format is:
++ ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
++static const char * volatile charset_aliases;
++
++/* Return a pointer to the contents of the charset.alias file. */
++static const char *
++get_charset_aliases ()
++{
++ const char *cp;
++
++ cp = charset_aliases;
++ if (cp == NULL)
++ {
++#if !(defined VMS || defined WIN32)
++ FILE *fp;
++ const char *dir = relocate (LIBDIR);
++ const char *base = "charset.alias";
++ char *file_name;
++
++ /* Concatenate dir and base into freshly allocated file_name. */
++ {
++ size_t dir_len = strlen (dir);
++ size_t base_len = strlen (base);
++ int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
++ file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
++ if (file_name != NULL)
++ {
++ memcpy (file_name, dir, dir_len);
++ if (add_slash)
++ file_name[dir_len] = DIRECTORY_SEPARATOR;
++ memcpy (file_name + dir_len + add_slash, base, base_len + 1);
++ }
++ }
++
++ if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
++ /* Out of memory or file not found, treat it as empty. */
++ cp = "";
++ else
++ {
++ /* Parse the file's contents. */
++ int c;
++ char buf1[50+1];
++ char buf2[50+1];
++ char *res_ptr = NULL;
++ size_t res_size = 0;
++ size_t l1, l2;
++
++ for (;;)
++ {
++ c = getc (fp);
++ if (c == EOF)
++ break;
++ if (c == '\n' || c == ' ' || c == '\t')
++ continue;
++ if (c == '#')
++ {
++ /* Skip comment, to end of line. */
++ do
++ c = getc (fp);
++ while (!(c == EOF || c == '\n'));
++ if (c == EOF)
++ break;
++ continue;
++ }
++ ungetc (c, fp);
++ if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
++ break;
++ l1 = strlen (buf1);
++ l2 = strlen (buf2);
++ if (res_size == 0)
++ {
++ res_size = l1 + 1 + l2 + 1;
++ res_ptr = (char *) malloc (res_size + 1);
++ }
++ else
++ {
++ res_size += l1 + 1 + l2 + 1;
++ res_ptr = (char *) realloc (res_ptr, res_size + 1);
++ }
++ if (res_ptr == NULL)
++ {
++ /* Out of memory. */
++ res_size = 0;
++ break;
++ }
++ strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
++ strcpy (res_ptr + res_size - (l2 + 1), buf2);
++ }
++ fclose (fp);
++ if (res_size == 0)
++ cp = "";
++ else
++ {
++ *(res_ptr + res_size) = '\0';
++ cp = res_ptr;
++ }
++ }
++
++ if (file_name != NULL)
++ free (file_name);
++
++#else
++
++# if defined VMS
++ /* To avoid the troubles of an extra file charset.alias_vms in the
++ sources of many GNU packages, simply inline the aliases here. */
++ /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
++ "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
++ section 10.7 "Handling Different Character Sets". */
++ cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
++ "ISO8859-2" "\0" "ISO-8859-2" "\0"
++ "ISO8859-5" "\0" "ISO-8859-5" "\0"
++ "ISO8859-7" "\0" "ISO-8859-7" "\0"
++ "ISO8859-8" "\0" "ISO-8859-8" "\0"
++ "ISO8859-9" "\0" "ISO-8859-9" "\0"
++ /* Japanese */
++ "eucJP" "\0" "EUC-JP" "\0"
++ "SJIS" "\0" "SHIFT_JIS" "\0"
++ "DECKANJI" "\0" "DEC-KANJI" "\0"
++ "SDECKANJI" "\0" "EUC-JP" "\0"
++ /* Chinese */
++ "eucTW" "\0" "EUC-TW" "\0"
++ "DECHANYU" "\0" "DEC-HANYU" "\0"
++ "DECHANZI" "\0" "GB2312" "\0"
++ /* Korean */
++ "DECKOREAN" "\0" "EUC-KR" "\0";
++# endif
++
++# if defined WIN32
++ /* To avoid the troubles of installing a separate file in the same
++ directory as the DLL and of retrieving the DLL's directory at
++ runtime, simply inline the aliases here. */
++
++ cp = "CP936" "\0" "GBK" "\0"
++ "CP1361" "\0" "JOHAB" "\0"
++ "CP20127" "\0" "ASCII" "\0"
++ "CP20866" "\0" "KOI8-R" "\0"
++ "CP21866" "\0" "KOI8-RU" "\0"
++ "CP28591" "\0" "ISO-8859-1" "\0"
++ "CP28592" "\0" "ISO-8859-2" "\0"
++ "CP28593" "\0" "ISO-8859-3" "\0"
++ "CP28594" "\0" "ISO-8859-4" "\0"
++ "CP28595" "\0" "ISO-8859-5" "\0"
++ "CP28596" "\0" "ISO-8859-6" "\0"
++ "CP28597" "\0" "ISO-8859-7" "\0"
++ "CP28598" "\0" "ISO-8859-8" "\0"
++ "CP28599" "\0" "ISO-8859-9" "\0"
++ "CP28605" "\0" "ISO-8859-15" "\0";
++# endif
++#endif
++
++ charset_aliases = cp;
++ }
++
++ return cp;
++}
++
++/* Determine the current locale's character encoding, and canonicalize it
++ into one of the canonical names listed in config.charset.
++ The result must not be freed; it is statically allocated.
++ If the canonical name cannot be determined, the result is a non-canonical
++ name. */
++
++#ifdef STATIC
++STATIC
++#endif
++const char *
++locale_charset ()
++{
++ const char *codeset;
++ const char *aliases;
++
++#if !(defined WIN32 || defined OS2)
++
++# if HAVE_LANGINFO_CODESET
++
++ /* Most systems support nl_langinfo (CODESET) nowadays. */
++ codeset = nl_langinfo (CODESET);
++
++# else
++
++ /* On old systems which lack it, use setlocale or getenv. */
++ const char *locale = NULL;
++
++ /* But most old systems don't have a complete set of locales. Some
++ (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't
++ use setlocale here; it would return "C" when it doesn't support the
++ locale name the user has set. */
++# if HAVE_SETLOCALE && 0
++ locale = setlocale (LC_CTYPE, NULL);
++# endif
++ if (locale == NULL || locale[0] == '\0')
++ {
++ locale = getenv ("LC_ALL");
++ if (locale == NULL || locale[0] == '\0')
++ {
++ locale = getenv ("LC_CTYPE");
++ if (locale == NULL || locale[0] == '\0')
++ locale = getenv ("LANG");
++ }
++ }
++
++ /* On some old systems, one used to set locale = "iso8859_1". On others,
++ you set it to "language_COUNTRY.charset". In any case, we resolve it
++ through the charset.alias file. */
++ codeset = locale;
++
++# endif
++
++#elif defined WIN32
++
++ static char buf[2 + 10 + 1];
++
++ /* Woe32 has a function returning the locale's codepage as a number. */
++ sprintf (buf, "CP%u", GetACP ());
++ codeset = buf;
++
++#elif defined OS2
++
++ const char *locale;
++ static char buf[2 + 10 + 1];
++ ULONG cp[3];
++ ULONG cplen;
++
++ /* Allow user to override the codeset, as set in the operating system,
++ with standard language environment variables. */
++ locale = getenv ("LC_ALL");
++ if (locale == NULL || locale[0] == '\0')
++ {
++ locale = getenv ("LC_CTYPE");
++ if (locale == NULL || locale[0] == '\0')
++ locale = getenv ("LANG");
++ }
++ if (locale != NULL && locale[0] != '\0')
++ {
++ /* If the locale name contains an encoding after the dot, return it. */
++ const char *dot = strchr (locale, '.');
++
++ if (dot != NULL)
++ {
++ const char *modifier;
++
++ dot++;
++ /* Look for the possible @... trailer and remove it, if any. */
++ modifier = strchr (dot, '@');
++ if (modifier == NULL)
++ return dot;
++ if (modifier - dot < sizeof (buf))
++ {
++ memcpy (buf, dot, modifier - dot);
++ buf [modifier - dot] = '\0';
++ return buf;
++ }
++ }
++
++ /* Resolve through the charset.alias file. */
++ codeset = locale;
++ }
++ else
++ {
++ /* OS/2 has a function returning the locale's codepage as a number. */
++ if (DosQueryCp (sizeof (cp), cp, &cplen))
++ codeset = "";
++ else
++ {
++ sprintf (buf, "CP%u", cp[0]);
++ codeset = buf;
++ }
++ }
++
++#endif
++
++ if (codeset == NULL)
++ /* The canonical name cannot be determined. */
++ codeset = "";
++
++ /* Resolve alias. */
++ for (aliases = get_charset_aliases ();
++ *aliases != '\0';
++ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
++ if (strcmp (codeset, aliases) == 0
++ || (aliases[0] == '*' && aliases[1] == '\0'))
++ {
++ codeset = aliases + strlen (aliases) + 1;
++ break;
++ }
++
++ /* Don't return an empty string. GNU libc and GNU libiconv interpret
++ the empty string as denoting "the locale's character encoding",
++ thus GNU libiconv would call this function a second time. */
++ if (codeset[0] == '\0')
++ codeset = "ASCII";
++
++ return codeset;
++}
+--- lrzsz-0.12.20.safe/intl/localcharset.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localcharset.h 2004-09-12 14:40:34.483728632 -0400
+@@ -0,0 +1,42 @@
++/* Determine a canonical name for the current locale's character encoding.
++ Copyright (C) 2000-2003 Free Software Foundation, Inc.
++ This file is part of the GNU CHARSET Library.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _LOCALCHARSET_H
++#define _LOCALCHARSET_H
++
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* Determine the current locale's character encoding, and canonicalize it
++ into one of the canonical names listed in config.charset.
++ The result must not be freed; it is statically allocated.
++ If the canonical name cannot be determined, the result is a non-canonical
++ name. */
++extern const char * locale_charset (void);
++
++
++#ifdef __cplusplus
++}
++#endif
++
++
++#endif /* _LOCALCHARSET_H */
+--- lrzsz-0.12.20.safe/intl/locale.alias 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/locale.alias 2004-09-12 14:40:34.499726200 -0400
+@@ -0,0 +1,78 @@
++# Locale name alias data base.
++# Copyright (C) 1996-2001,2003 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Library General Public License for more details.
++#
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
++
++# The format of this file is the same as for the corresponding file of
++# the X Window System, which normally can be found in
++# /usr/lib/X11/locale/locale.alias
++# A single line contains two fields: an alias and a substitution value.
++# All entries are case independent.
++
++# Note: This file is far from being complete. If you have a value for
++# your own site which you think might be useful for others too, share
++# it with the rest of us. Send it using the `glibcbug' script to
++# bugs@gnu.org.
++
++# Packages using this file:
++
++bokmal nb_NO.ISO-8859-1
++bokmål nb_NO.ISO-8859-1
++catalan ca_ES.ISO-8859-1
++croatian hr_HR.ISO-8859-2
++czech cs_CZ.ISO-8859-2
++danish da_DK.ISO-8859-1
++dansk da_DK.ISO-8859-1
++deutsch de_DE.ISO-8859-1
++dutch nl_NL.ISO-8859-1
++eesti et_EE.ISO-8859-1
++estonian et_EE.ISO-8859-1
++finnish fi_FI.ISO-8859-1
++français fr_FR.ISO-8859-1
++french fr_FR.ISO-8859-1
++galego gl_ES.ISO-8859-1
++galician gl_ES.ISO-8859-1
++german de_DE.ISO-8859-1
++greek el_GR.ISO-8859-7
++hebrew he_IL.ISO-8859-8
++hrvatski hr_HR.ISO-8859-2
++hungarian hu_HU.ISO-8859-2
++icelandic is_IS.ISO-8859-1
++italian it_IT.ISO-8859-1
++japanese ja_JP.eucJP
++japanese.euc ja_JP.eucJP
++ja_JP ja_JP.eucJP
++ja_JP.ujis ja_JP.eucJP
++japanese.sjis ja_JP.SJIS
++korean ko_KR.eucKR
++korean.euc ko_KR.eucKR
++ko_KR ko_KR.eucKR
++lithuanian lt_LT.ISO-8859-13
++no_NO nb_NO.ISO-8859-1
++no_NO.ISO-8859-1 nb_NO.ISO-8859-1
++norwegian nb_NO.ISO-8859-1
++nynorsk nn_NO.ISO-8859-1
++polish pl_PL.ISO-8859-2
++portuguese pt_PT.ISO-8859-1
++romanian ro_RO.ISO-8859-2
++russian ru_RU.ISO-8859-5
++slovak sk_SK.ISO-8859-2
++slovene sl_SI.ISO-8859-2
++slovenian sl_SI.ISO-8859-2
++spanish es_ES.ISO-8859-1
++swedish sv_SE.ISO-8859-1
++thai th_TH.TIS-620
++turkish tr_TR.ISO-8859-9
+--- lrzsz-0.12.20.safe/intl/localealias.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/localealias.c 2004-09-12 14:40:34.505725288 -0400
+@@ -1,20 +1,27 @@
+-/* Handle aliases for locale names
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Handle aliases for locale names.
++ Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -22,56 +29,45 @@
+
+ #include <ctype.h>
+ #include <stdio.h>
++#if defined _LIBC || defined HAVE___FSETLOCKING
++# include <stdio_ext.h>
++#endif
+ #include <sys/types.h>
+
+ #ifdef __GNUC__
++# undef alloca
+ # define alloca __builtin_alloca
+ # define HAVE_ALLOCA 1
+ #else
+-# if defined HAVE_ALLOCA_H || defined _LIBC
+-# include <alloca.h>
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
+ # else
+-# ifdef _AIX
+- #pragma alloca
++# if defined HAVE_ALLOCA_H || defined _LIBC
++# include <alloca.h>
+ # else
+-# ifndef alloca
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca
+ char *alloca ();
++# endif
+ # endif
+ # endif
+ # endif
+ #endif
+
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-# include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
++#include <stdlib.h>
++#include <string.h>
+
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-# define _GNU_SOURCE 1
+-# endif
+-# include <string.h>
++#include "gettextP.h"
++
++#if ENABLE_RELOCATABLE
++# include "relocatable.h"
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-# define strchr index
+-# endif
++# define relocate(pathname) (pathname)
+ #endif
+
+-#include "gettext.h"
+-#include "gettextP.h"
+-
+ /* @@ end of prolog @@ */
+
+ #ifdef _LIBC
+@@ -79,43 +75,49 @@
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+ # define strcasecmp __strcasecmp
++
++# ifndef mempcpy
++# define mempcpy __mempcpy
++# endif
++# define HAVE_MEMPCPY 1
++# define HAVE___FSETLOCKING 1
++
++/* We need locking here since we can be called from different places. */
++# include <bits/libc-lock.h>
++
++__libc_lock_define_initialized (static, lock);
++#endif
++
++#ifndef internal_function
++# define internal_function
+ #endif
+
++/* Some optimizations for glibc. */
++#ifdef _LIBC
++# define FEOF(fp) feof_unlocked (fp)
++# define FGETS(buf, n, fp) fgets_unlocked (buf, n, fp)
++#else
++# define FEOF(fp) feof (fp)
++# define FGETS(buf, n, fp) fgets (buf, n, fp)
++#endif
+
+-/* For those loosing systems which don't have `alloca' we have to add
++/* For those losing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+ #ifdef HAVE_ALLOCA
+-/* Nothing has to be done. */
+-# define ADD_BLOCK(list, address) /* nothing */
+-# define FREE_BLOCKS(list) /* nothing */
++# define freea(p) /* nothing */
+ #else
+-struct block_list
+-{
+- void *address;
+- struct block_list *next;
+-};
+-# define ADD_BLOCK(list, addr) \
+- do { \
+- struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+- /* If we cannot get a free block we cannot add the new element to \
+- the list. */ \
+- if (newp != NULL) { \
+- newp->address = (addr); \
+- newp->next = (list); \
+- (list) = newp; \
+- } \
+- } while (0)
+-# define FREE_BLOCKS(list) \
+- do { \
+- while (list != NULL) { \
+- struct block_list *old = list; \
+- list = list->next; \
+- free (old); \
+- } \
+- } while (0)
+-# undef alloca
+-# define alloca(size) (malloc (size))
+-#endif /* have alloca */
++# define alloca(n) malloc (n)
++# define freea(p) free (p)
++#endif
++
++#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
++# undef fgets
++# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
++#endif
++#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
++# undef feof
++# define feof(s) feof_unlocked (s)
++#endif
+
+
+ struct alias_map
+@@ -125,26 +127,41 @@
+ };
+
+
+-static struct alias_map *map;
+-static size_t nmap = 0;
+-static size_t maxmap = 0;
++#ifndef _LIBC
++# define libc_freeres_ptr(decl) decl
++#endif
++
++libc_freeres_ptr (static char *string_space);
++static size_t string_space_act;
++static size_t string_space_max;
++libc_freeres_ptr (static struct alias_map *map);
++static size_t nmap;
++static size_t maxmap;
+
+
+ /* Prototypes for local functions. */
+-static size_t read_alias_file PARAMS ((const char *fname, int fname_len));
+-static void extend_alias_table PARAMS ((void));
+-static int alias_compare PARAMS ((const struct alias_map *map1,
+- const struct alias_map *map2));
++static size_t read_alias_file (const char *fname, int fname_len)
++ internal_function;
++static int extend_alias_table (void);
++static int alias_compare (const struct alias_map *map1,
++ const struct alias_map *map2);
+
+
+ const char *
+-_nl_expand_alias (name)
+- const char *name;
++_nl_expand_alias (const char *name)
+ {
+- static const char *locale_alias_path = LOCALE_ALIAS_PATH;
++ static const char *locale_alias_path;
+ struct alias_map *retval;
++ const char *result = NULL;
+ size_t added;
+
++#ifdef _LIBC
++ __libc_lock_lock (lock);
++#endif
++
++ if (locale_alias_path == NULL)
++ locale_alias_path = LOCALE_ALIAS_PATH;
++
+ do
+ {
+ struct alias_map item;
+@@ -154,15 +171,18 @@
+ if (nmap > 0)
+ retval = (struct alias_map *) bsearch (&item, map, nmap,
+ sizeof (struct alias_map),
+- (int (*) PARAMS ((const void *,
+- const void *))
++ (int (*) (const void *,
++ const void *)
+ ) alias_compare);
+ else
+ retval = NULL;
+
+ /* We really found an alias. Return the value. */
+ if (retval != NULL)
+- return retval->value;
++ {
++ result = retval->value;
++ break;
++ }
+
+ /* Perhaps we can find another alias file. */
+ added = 0;
+@@ -170,11 +190,12 @@
+ {
+ const char *start;
+
+- while (locale_alias_path[0] == ':')
++ while (locale_alias_path[0] == PATH_SEPARATOR)
+ ++locale_alias_path;
+ start = locale_alias_path;
+
+- while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
++ while (locale_alias_path[0] != '\0'
++ && locale_alias_path[0] != PATH_SEPARATOR)
+ ++locale_alias_path;
+
+ if (start < locale_alias_path)
+@@ -183,78 +204,87 @@
+ }
+ while (added != 0);
+
+- return NULL;
++#ifdef _LIBC
++ __libc_lock_unlock (lock);
++#endif
++
++ return result;
+ }
+
+
+ static size_t
+-read_alias_file (fname, fname_len)
+- const char *fname;
+- int fname_len;
++internal_function
++read_alias_file (const char *fname, int fname_len)
+ {
+-#ifndef HAVE_ALLOCA
+- struct block_list *block_list = NULL;
+-#endif
+ FILE *fp;
+ char *full_fname;
+ size_t added;
+ static const char aliasfile[] = "/locale.alias";
+
+ full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+- ADD_BLOCK (block_list, full_fname);
++#ifdef HAVE_MEMPCPY
++ mempcpy (mempcpy (full_fname, fname, fname_len),
++ aliasfile, sizeof aliasfile);
++#else
+ memcpy (full_fname, fname, fname_len);
+ memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
++#endif
+
+- fp = fopen (full_fname, "r");
++ fp = fopen (relocate (full_fname), "r");
++ freea (full_fname);
+ if (fp == NULL)
+- {
+- FREE_BLOCKS (block_list);
+- return 0;
+- }
++ return 0;
++
++#ifdef HAVE___FSETLOCKING
++ /* No threads present. */
++ __fsetlocking (fp, FSETLOCKING_BYCALLER);
++#endif
+
+ added = 0;
+- while (!feof (fp))
++ while (!FEOF (fp))
+ {
+ /* It is a reasonable approach to use a fix buffer here because
+ a) we are only interested in the first two fields
+ b) these fields must be usable as file names and so must not
+ be that long
+- */
+- char buf[BUFSIZ];
++ We avoid a multi-kilobyte buffer here since this would use up
++ stack space which we might not have if the program ran out of
++ memory. */
++ char buf[400];
+ char *alias;
+ char *value;
+ char *cp;
+
+- if (fgets (buf, BUFSIZ, fp) == NULL)
++ if (FGETS (buf, sizeof buf, fp) == NULL)
+ /* EOF reached. */
+ break;
+
+ cp = buf;
+ /* Ignore leading white space. */
+- while (isspace (cp[0]))
++ while (isspace ((unsigned char) cp[0]))
+ ++cp;
+
+ /* A leading '#' signals a comment line. */
+ if (cp[0] != '\0' && cp[0] != '#')
+ {
+ alias = cp++;
+- while (cp[0] != '\0' && !isspace (cp[0]))
++ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ ++cp;
+ /* Terminate alias name. */
+ if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ /* Now look for the beginning of the value. */
+- while (isspace (cp[0]))
++ while (isspace ((unsigned char) cp[0]))
+ ++cp;
+
+ if (cp[0] != '\0')
+ {
+- char *tp;
+- size_t len;
++ size_t alias_len;
++ size_t value_len;
+
+ value = cp++;
+- while (cp[0] != '\0' && !isspace (cp[0]))
++ while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ ++cp;
+ /* Terminate value. */
+ if (cp[0] == '\n')
+@@ -269,28 +299,44 @@
+ *cp++ = '\0';
+
+ if (nmap >= maxmap)
+- extend_alias_table ();
+-
+- /* We cannot depend on strdup available in the libc. Sigh! */
+- len = strlen (alias) + 1;
+- tp = (char *) malloc (len);
+- if (tp == NULL)
+- {
+- FREE_BLOCKS (block_list);
++ if (__builtin_expect (extend_alias_table (), 0))
+ return added;
+- }
+- memcpy (tp, alias, len);
+- map[nmap].alias = tp;
+
+- len = strlen (value) + 1;
+- tp = (char *) malloc (len);
+- if (tp == NULL)
++ alias_len = strlen (alias) + 1;
++ value_len = strlen (value) + 1;
++
++ if (string_space_act + alias_len + value_len > string_space_max)
+ {
+- FREE_BLOCKS (block_list);
+- return added;
++ /* Increase size of memory pool. */
++ size_t new_size = (string_space_max
++ + (alias_len + value_len > 1024
++ ? alias_len + value_len : 1024));
++ char *new_pool = (char *) realloc (string_space, new_size);
++ if (new_pool == NULL)
++ return added;
++
++ if (__builtin_expect (string_space != new_pool, 0))
++ {
++ size_t i;
++
++ for (i = 0; i < nmap; i++)
++ {
++ map[i].alias += new_pool - string_space;
++ map[i].value += new_pool - string_space;
++ }
++ }
++
++ string_space = new_pool;
++ string_space_max = new_size;
+ }
+- memcpy (tp, value, len);
+- map[nmap].value = tp;
++
++ map[nmap].alias = memcpy (&string_space[string_space_act],
++ alias, alias_len);
++ string_space_act += alias_len;
++
++ map[nmap].value = memcpy (&string_space[string_space_act],
++ value, value_len);
++ string_space_act += value_len;
+
+ ++nmap;
+ ++added;
+@@ -299,14 +345,11 @@
+
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+- while (strchr (cp, '\n') == NULL)
+- {
+- cp = buf;
+- if (fgets (buf, BUFSIZ, fp) == NULL)
+- /* Make sure the inner loop will be left. The outer loop
+- will exit at the `feof' test. */
+- *cp = '\n';
+- }
++ while (strchr (buf, '\n') == NULL)
++ if (FGETS (buf, sizeof buf, fp) == NULL)
++ /* Make sure the inner loop will be left. The outer loop
++ will exit at the `feof' test. */
++ break;
+ }
+
+ /* Should we test for ferror()? I think we have to silently ignore
+@@ -315,40 +358,33 @@
+
+ if (added > 0)
+ qsort (map, nmap, sizeof (struct alias_map),
+- (int (*) PARAMS ((const void *, const void *))) alias_compare);
++ (int (*) (const void *, const void *)) alias_compare);
+
+- FREE_BLOCKS (block_list);
+ return added;
+ }
+
+
+-static void
++static int
+ extend_alias_table ()
+ {
+ size_t new_size;
+ struct alias_map *new_map;
+
+ new_size = maxmap == 0 ? 100 : 2 * maxmap;
+- new_map = (struct alias_map *) malloc (new_size
+- * sizeof (struct alias_map));
++ new_map = (struct alias_map *) realloc (map, (new_size
++ * sizeof (struct alias_map)));
+ if (new_map == NULL)
+ /* Simply don't extend: we don't have any more core. */
+- return;
+-
+- memcpy (new_map, map, nmap * sizeof (struct alias_map));
+-
+- if (maxmap != 0)
+- free (map);
++ return -1;
+
+ map = new_map;
+ maxmap = new_size;
++ return 0;
+ }
+
+
+ static int
+-alias_compare (map1, map2)
+- const struct alias_map *map1;
+- const struct alias_map *map2;
++alias_compare (const struct alias_map *map1, const struct alias_map *map2)
+ {
+ #if defined _LIBC || defined HAVE_STRCASECMP
+ return strcasecmp (map1->alias, map2->alias);
+--- lrzsz-0.12.20.safe/intl/localename.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localename.c 2004-09-12 14:40:34.510724528 -0400
+@@ -0,0 +1,1142 @@
++/* Determine the current selected locale.
++ Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
++/* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <locale.h>
++
++#if defined _WIN32 || defined __WIN32__
++# undef WIN32 /* avoid warning on mingw32 */
++# define WIN32
++#endif
++
++#ifdef WIN32
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++/* List of language codes, sorted by value:
++ 0x01 LANG_ARABIC
++ 0x02 LANG_BULGARIAN
++ 0x03 LANG_CATALAN
++ 0x04 LANG_CHINESE
++ 0x05 LANG_CZECH
++ 0x06 LANG_DANISH
++ 0x07 LANG_GERMAN
++ 0x08 LANG_GREEK
++ 0x09 LANG_ENGLISH
++ 0x0a LANG_SPANISH
++ 0x0b LANG_FINNISH
++ 0x0c LANG_FRENCH
++ 0x0d LANG_HEBREW
++ 0x0e LANG_HUNGARIAN
++ 0x0f LANG_ICELANDIC
++ 0x10 LANG_ITALIAN
++ 0x11 LANG_JAPANESE
++ 0x12 LANG_KOREAN
++ 0x13 LANG_DUTCH
++ 0x14 LANG_NORWEGIAN
++ 0x15 LANG_POLISH
++ 0x16 LANG_PORTUGUESE
++ 0x17 LANG_RHAETO_ROMANCE
++ 0x18 LANG_ROMANIAN
++ 0x19 LANG_RUSSIAN
++ 0x1a LANG_CROATIAN == LANG_SERBIAN
++ 0x1b LANG_SLOVAK
++ 0x1c LANG_ALBANIAN
++ 0x1d LANG_SWEDISH
++ 0x1e LANG_THAI
++ 0x1f LANG_TURKISH
++ 0x20 LANG_URDU
++ 0x21 LANG_INDONESIAN
++ 0x22 LANG_UKRAINIAN
++ 0x23 LANG_BELARUSIAN
++ 0x24 LANG_SLOVENIAN
++ 0x25 LANG_ESTONIAN
++ 0x26 LANG_LATVIAN
++ 0x27 LANG_LITHUANIAN
++ 0x28 LANG_TAJIK
++ 0x29 LANG_FARSI
++ 0x2a LANG_VIETNAMESE
++ 0x2b LANG_ARMENIAN
++ 0x2c LANG_AZERI
++ 0x2d LANG_BASQUE
++ 0x2e LANG_SORBIAN
++ 0x2f LANG_MACEDONIAN
++ 0x30 LANG_SUTU
++ 0x31 LANG_TSONGA
++ 0x32 LANG_TSWANA
++ 0x33 LANG_VENDA
++ 0x34 LANG_XHOSA
++ 0x35 LANG_ZULU
++ 0x36 LANG_AFRIKAANS
++ 0x37 LANG_GEORGIAN
++ 0x38 LANG_FAEROESE
++ 0x39 LANG_HINDI
++ 0x3a LANG_MALTESE
++ 0x3b LANG_SAAMI
++ 0x3c LANG_GAELIC
++ 0x3d LANG_YIDDISH
++ 0x3e LANG_MALAY
++ 0x3f LANG_KAZAK
++ 0x40 LANG_KYRGYZ
++ 0x41 LANG_SWAHILI
++ 0x42 LANG_TURKMEN
++ 0x43 LANG_UZBEK
++ 0x44 LANG_TATAR
++ 0x45 LANG_BENGALI
++ 0x46 LANG_PUNJABI
++ 0x47 LANG_GUJARATI
++ 0x48 LANG_ORIYA
++ 0x49 LANG_TAMIL
++ 0x4a LANG_TELUGU
++ 0x4b LANG_KANNADA
++ 0x4c LANG_MALAYALAM
++ 0x4d LANG_ASSAMESE
++ 0x4e LANG_MARATHI
++ 0x4f LANG_SANSKRIT
++ 0x50 LANG_MONGOLIAN
++ 0x51 LANG_TIBETAN
++ 0x52 LANG_WELSH
++ 0x53 LANG_CAMBODIAN
++ 0x54 LANG_LAO
++ 0x55 LANG_BURMESE
++ 0x56 LANG_GALICIAN
++ 0x57 LANG_KONKANI
++ 0x58 LANG_MANIPURI
++ 0x59 LANG_SINDHI
++ 0x5a LANG_SYRIAC
++ 0x5b LANG_SINHALESE
++ 0x5c LANG_CHEROKEE
++ 0x5d LANG_INUKTITUT
++ 0x5e LANG_AMHARIC
++ 0x5f LANG_TAMAZIGHT
++ 0x60 LANG_KASHMIRI
++ 0x61 LANG_NEPALI
++ 0x62 LANG_FRISIAN
++ 0x63 LANG_PASHTO
++ 0x64 LANG_TAGALOG
++ 0x65 LANG_DIVEHI
++ 0x66 LANG_EDO
++ 0x67 LANG_FULFULDE
++ 0x68 LANG_HAUSA
++ 0x69 LANG_IBIBIO
++ 0x6a LANG_YORUBA
++ 0x70 LANG_IGBO
++ 0x71 LANG_KANURI
++ 0x72 LANG_OROMO
++ 0x73 LANG_TIGRINYA
++ 0x74 LANG_GUARANI
++ 0x75 LANG_HAWAIIAN
++ 0x76 LANG_LATIN
++ 0x77 LANG_SOMALI
++ 0x78 LANG_YI
++ 0x79 LANG_PAPIAMENTU
++*/
++/* Mingw headers don't have latest language and sublanguage codes. */
++# ifndef LANG_AFRIKAANS
++# define LANG_AFRIKAANS 0x36
++# endif
++# ifndef LANG_ALBANIAN
++# define LANG_ALBANIAN 0x1c
++# endif
++# ifndef LANG_AMHARIC
++# define LANG_AMHARIC 0x5e
++# endif
++# ifndef LANG_ARABIC
++# define LANG_ARABIC 0x01
++# endif
++# ifndef LANG_ARMENIAN
++# define LANG_ARMENIAN 0x2b
++# endif
++# ifndef LANG_ASSAMESE
++# define LANG_ASSAMESE 0x4d
++# endif
++# ifndef LANG_AZERI
++# define LANG_AZERI 0x2c
++# endif
++# ifndef LANG_BASQUE
++# define LANG_BASQUE 0x2d
++# endif
++# ifndef LANG_BELARUSIAN
++# define LANG_BELARUSIAN 0x23
++# endif
++# ifndef LANG_BENGALI
++# define LANG_BENGALI 0x45
++# endif
++# ifndef LANG_BURMESE
++# define LANG_BURMESE 0x55
++# endif
++# ifndef LANG_CAMBODIAN
++# define LANG_CAMBODIAN 0x53
++# endif
++# ifndef LANG_CATALAN
++# define LANG_CATALAN 0x03
++# endif
++# ifndef LANG_CHEROKEE
++# define LANG_CHEROKEE 0x5c
++# endif
++# ifndef LANG_DIVEHI
++# define LANG_DIVEHI 0x65
++# endif
++# ifndef LANG_EDO
++# define LANG_EDO 0x66
++# endif
++# ifndef LANG_ESTONIAN
++# define LANG_ESTONIAN 0x25
++# endif
++# ifndef LANG_FAEROESE
++# define LANG_FAEROESE 0x38
++# endif
++# ifndef LANG_FARSI
++# define LANG_FARSI 0x29
++# endif
++# ifndef LANG_FRISIAN
++# define LANG_FRISIAN 0x62
++# endif
++# ifndef LANG_FULFULDE
++# define LANG_FULFULDE 0x67
++# endif
++# ifndef LANG_GAELIC
++# define LANG_GAELIC 0x3c
++# endif
++# ifndef LANG_GALICIAN
++# define LANG_GALICIAN 0x56
++# endif
++# ifndef LANG_GEORGIAN
++# define LANG_GEORGIAN 0x37
++# endif
++# ifndef LANG_GUARANI
++# define LANG_GUARANI 0x74
++# endif
++# ifndef LANG_GUJARATI
++# define LANG_GUJARATI 0x47
++# endif
++# ifndef LANG_HAUSA
++# define LANG_HAUSA 0x68
++# endif
++# ifndef LANG_HAWAIIAN
++# define LANG_HAWAIIAN 0x75
++# endif
++# ifndef LANG_HEBREW
++# define LANG_HEBREW 0x0d
++# endif
++# ifndef LANG_HINDI
++# define LANG_HINDI 0x39
++# endif
++# ifndef LANG_IBIBIO
++# define LANG_IBIBIO 0x69
++# endif
++# ifndef LANG_IGBO
++# define LANG_IGBO 0x70
++# endif
++# ifndef LANG_INDONESIAN
++# define LANG_INDONESIAN 0x21
++# endif
++# ifndef LANG_INUKTITUT
++# define LANG_INUKTITUT 0x5d
++# endif
++# ifndef LANG_KANNADA
++# define LANG_KANNADA 0x4b
++# endif
++# ifndef LANG_KANURI
++# define LANG_KANURI 0x71
++# endif
++# ifndef LANG_KASHMIRI
++# define LANG_KASHMIRI 0x60
++# endif
++# ifndef LANG_KAZAK
++# define LANG_KAZAK 0x3f
++# endif
++# ifndef LANG_KONKANI
++# define LANG_KONKANI 0x57
++# endif
++# ifndef LANG_KYRGYZ
++# define LANG_KYRGYZ 0x40
++# endif
++# ifndef LANG_LAO
++# define LANG_LAO 0x54
++# endif
++# ifndef LANG_LATIN
++# define LANG_LATIN 0x76
++# endif
++# ifndef LANG_LATVIAN
++# define LANG_LATVIAN 0x26
++# endif
++# ifndef LANG_LITHUANIAN
++# define LANG_LITHUANIAN 0x27
++# endif
++# ifndef LANG_MACEDONIAN
++# define LANG_MACEDONIAN 0x2f
++# endif
++# ifndef LANG_MALAY
++# define LANG_MALAY 0x3e
++# endif
++# ifndef LANG_MALAYALAM
++# define LANG_MALAYALAM 0x4c
++# endif
++# ifndef LANG_MALTESE
++# define LANG_MALTESE 0x3a
++# endif
++# ifndef LANG_MANIPURI
++# define LANG_MANIPURI 0x58
++# endif
++# ifndef LANG_MARATHI
++# define LANG_MARATHI 0x4e
++# endif
++# ifndef LANG_MONGOLIAN
++# define LANG_MONGOLIAN 0x50
++# endif
++# ifndef LANG_NEPALI
++# define LANG_NEPALI 0x61
++# endif
++# ifndef LANG_ORIYA
++# define LANG_ORIYA 0x48
++# endif
++# ifndef LANG_OROMO
++# define LANG_OROMO 0x72
++# endif
++# ifndef LANG_PAPIAMENTU
++# define LANG_PAPIAMENTU 0x79
++# endif
++# ifndef LANG_PASHTO
++# define LANG_PASHTO 0x63
++# endif
++# ifndef LANG_PUNJABI
++# define LANG_PUNJABI 0x46
++# endif
++# ifndef LANG_RHAETO_ROMANCE
++# define LANG_RHAETO_ROMANCE 0x17
++# endif
++# ifndef LANG_SAAMI
++# define LANG_SAAMI 0x3b
++# endif
++# ifndef LANG_SANSKRIT
++# define LANG_SANSKRIT 0x4f
++# endif
++# ifndef LANG_SERBIAN
++# define LANG_SERBIAN 0x1a
++# endif
++# ifndef LANG_SINDHI
++# define LANG_SINDHI 0x59
++# endif
++# ifndef LANG_SINHALESE
++# define LANG_SINHALESE 0x5b
++# endif
++# ifndef LANG_SLOVAK
++# define LANG_SLOVAK 0x1b
++# endif
++# ifndef LANG_SOMALI
++# define LANG_SOMALI 0x77
++# endif
++# ifndef LANG_SORBIAN
++# define LANG_SORBIAN 0x2e
++# endif
++# ifndef LANG_SUTU
++# define LANG_SUTU 0x30
++# endif
++# ifndef LANG_SWAHILI
++# define LANG_SWAHILI 0x41
++# endif
++# ifndef LANG_SYRIAC
++# define LANG_SYRIAC 0x5a
++# endif
++# ifndef LANG_TAGALOG
++# define LANG_TAGALOG 0x64
++# endif
++# ifndef LANG_TAJIK
++# define LANG_TAJIK 0x28
++# endif
++# ifndef LANG_TAMAZIGHT
++# define LANG_TAMAZIGHT 0x5f
++# endif
++# ifndef LANG_TAMIL
++# define LANG_TAMIL 0x49
++# endif
++# ifndef LANG_TATAR
++# define LANG_TATAR 0x44
++# endif
++# ifndef LANG_TELUGU
++# define LANG_TELUGU 0x4a
++# endif
++# ifndef LANG_THAI
++# define LANG_THAI 0x1e
++# endif
++# ifndef LANG_TIBETAN
++# define LANG_TIBETAN 0x51
++# endif
++# ifndef LANG_TIGRINYA
++# define LANG_TIGRINYA 0x73
++# endif
++# ifndef LANG_TSONGA
++# define LANG_TSONGA 0x31
++# endif
++# ifndef LANG_TSWANA
++# define LANG_TSWANA 0x32
++# endif
++# ifndef LANG_TURKMEN
++# define LANG_TURKMEN 0x42
++# endif
++# ifndef LANG_UKRAINIAN
++# define LANG_UKRAINIAN 0x22
++# endif
++# ifndef LANG_URDU
++# define LANG_URDU 0x20
++# endif
++# ifndef LANG_UZBEK
++# define LANG_UZBEK 0x43
++# endif
++# ifndef LANG_VENDA
++# define LANG_VENDA 0x33
++# endif
++# ifndef LANG_VIETNAMESE
++# define LANG_VIETNAMESE 0x2a
++# endif
++# ifndef LANG_WELSH
++# define LANG_WELSH 0x52
++# endif
++# ifndef LANG_XHOSA
++# define LANG_XHOSA 0x34
++# endif
++# ifndef LANG_YI
++# define LANG_YI 0x78
++# endif
++# ifndef LANG_YIDDISH
++# define LANG_YIDDISH 0x3d
++# endif
++# ifndef LANG_YORUBA
++# define LANG_YORUBA 0x6a
++# endif
++# ifndef LANG_ZULU
++# define LANG_ZULU 0x35
++# endif
++# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
++# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
++# endif
++# ifndef SUBLANG_ARABIC_IRAQ
++# define SUBLANG_ARABIC_IRAQ 0x02
++# endif
++# ifndef SUBLANG_ARABIC_EGYPT
++# define SUBLANG_ARABIC_EGYPT 0x03
++# endif
++# ifndef SUBLANG_ARABIC_LIBYA
++# define SUBLANG_ARABIC_LIBYA 0x04
++# endif
++# ifndef SUBLANG_ARABIC_ALGERIA
++# define SUBLANG_ARABIC_ALGERIA 0x05
++# endif
++# ifndef SUBLANG_ARABIC_MOROCCO
++# define SUBLANG_ARABIC_MOROCCO 0x06
++# endif
++# ifndef SUBLANG_ARABIC_TUNISIA
++# define SUBLANG_ARABIC_TUNISIA 0x07
++# endif
++# ifndef SUBLANG_ARABIC_OMAN
++# define SUBLANG_ARABIC_OMAN 0x08
++# endif
++# ifndef SUBLANG_ARABIC_YEMEN
++# define SUBLANG_ARABIC_YEMEN 0x09
++# endif
++# ifndef SUBLANG_ARABIC_SYRIA
++# define SUBLANG_ARABIC_SYRIA 0x0a
++# endif
++# ifndef SUBLANG_ARABIC_JORDAN
++# define SUBLANG_ARABIC_JORDAN 0x0b
++# endif
++# ifndef SUBLANG_ARABIC_LEBANON
++# define SUBLANG_ARABIC_LEBANON 0x0c
++# endif
++# ifndef SUBLANG_ARABIC_KUWAIT
++# define SUBLANG_ARABIC_KUWAIT 0x0d
++# endif
++# ifndef SUBLANG_ARABIC_UAE
++# define SUBLANG_ARABIC_UAE 0x0e
++# endif
++# ifndef SUBLANG_ARABIC_BAHRAIN
++# define SUBLANG_ARABIC_BAHRAIN 0x0f
++# endif
++# ifndef SUBLANG_ARABIC_QATAR
++# define SUBLANG_ARABIC_QATAR 0x10
++# endif
++# ifndef SUBLANG_AZERI_LATIN
++# define SUBLANG_AZERI_LATIN 0x01
++# endif
++# ifndef SUBLANG_AZERI_CYRILLIC
++# define SUBLANG_AZERI_CYRILLIC 0x02
++# endif
++# ifndef SUBLANG_BENGALI_INDIA
++# define SUBLANG_BENGALI_INDIA 0x00
++# endif
++# ifndef SUBLANG_BENGALI_BANGLADESH
++# define SUBLANG_BENGALI_BANGLADESH 0x01
++# endif
++# ifndef SUBLANG_CHINESE_MACAU
++# define SUBLANG_CHINESE_MACAU 0x05
++# endif
++# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
++# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
++# endif
++# ifndef SUBLANG_ENGLISH_JAMAICA
++# define SUBLANG_ENGLISH_JAMAICA 0x08
++# endif
++# ifndef SUBLANG_ENGLISH_CARIBBEAN
++# define SUBLANG_ENGLISH_CARIBBEAN 0x09
++# endif
++# ifndef SUBLANG_ENGLISH_BELIZE
++# define SUBLANG_ENGLISH_BELIZE 0x0a
++# endif
++# ifndef SUBLANG_ENGLISH_TRINIDAD
++# define SUBLANG_ENGLISH_TRINIDAD 0x0b
++# endif
++# ifndef SUBLANG_ENGLISH_ZIMBABWE
++# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
++# endif
++# ifndef SUBLANG_ENGLISH_PHILIPPINES
++# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
++# endif
++# ifndef SUBLANG_ENGLISH_INDONESIA
++# define SUBLANG_ENGLISH_INDONESIA 0x0e
++# endif
++# ifndef SUBLANG_ENGLISH_HONGKONG
++# define SUBLANG_ENGLISH_HONGKONG 0x0f
++# endif
++# ifndef SUBLANG_ENGLISH_INDIA
++# define SUBLANG_ENGLISH_INDIA 0x10
++# endif
++# ifndef SUBLANG_ENGLISH_MALAYSIA
++# define SUBLANG_ENGLISH_MALAYSIA 0x11
++# endif
++# ifndef SUBLANG_ENGLISH_SINGAPORE
++# define SUBLANG_ENGLISH_SINGAPORE 0x12
++# endif
++# ifndef SUBLANG_FRENCH_LUXEMBOURG
++# define SUBLANG_FRENCH_LUXEMBOURG 0x05
++# endif
++# ifndef SUBLANG_FRENCH_MONACO
++# define SUBLANG_FRENCH_MONACO 0x06
++# endif
++# ifndef SUBLANG_FRENCH_WESTINDIES
++# define SUBLANG_FRENCH_WESTINDIES 0x07
++# endif
++# ifndef SUBLANG_FRENCH_REUNION
++# define SUBLANG_FRENCH_REUNION 0x08
++# endif
++# ifndef SUBLANG_FRENCH_CONGO
++# define SUBLANG_FRENCH_CONGO 0x09
++# endif
++# ifndef SUBLANG_FRENCH_SENEGAL
++# define SUBLANG_FRENCH_SENEGAL 0x0a
++# endif
++# ifndef SUBLANG_FRENCH_CAMEROON
++# define SUBLANG_FRENCH_CAMEROON 0x0b
++# endif
++# ifndef SUBLANG_FRENCH_COTEDIVOIRE
++# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
++# endif
++# ifndef SUBLANG_FRENCH_MALI
++# define SUBLANG_FRENCH_MALI 0x0d
++# endif
++# ifndef SUBLANG_FRENCH_MOROCCO
++# define SUBLANG_FRENCH_MOROCCO 0x0e
++# endif
++# ifndef SUBLANG_FRENCH_HAITI
++# define SUBLANG_FRENCH_HAITI 0x0f
++# endif
++# ifndef SUBLANG_GERMAN_LUXEMBOURG
++# define SUBLANG_GERMAN_LUXEMBOURG 0x04
++# endif
++# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
++# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
++# endif
++# ifndef SUBLANG_KASHMIRI_INDIA
++# define SUBLANG_KASHMIRI_INDIA 0x02
++# endif
++# ifndef SUBLANG_MALAY_MALAYSIA
++# define SUBLANG_MALAY_MALAYSIA 0x01
++# endif
++# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
++# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
++# endif
++# ifndef SUBLANG_NEPALI_INDIA
++# define SUBLANG_NEPALI_INDIA 0x02
++# endif
++# ifndef SUBLANG_PUNJABI_INDIA
++# define SUBLANG_PUNJABI_INDIA 0x00
++# endif
++# ifndef SUBLANG_PUNJABI_PAKISTAN
++# define SUBLANG_PUNJABI_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_ROMANIAN_ROMANIA
++# define SUBLANG_ROMANIAN_ROMANIA 0x00
++# endif
++# ifndef SUBLANG_ROMANIAN_MOLDOVA
++# define SUBLANG_ROMANIAN_MOLDOVA 0x01
++# endif
++# ifndef SUBLANG_SERBIAN_LATIN
++# define SUBLANG_SERBIAN_LATIN 0x02
++# endif
++# ifndef SUBLANG_SERBIAN_CYRILLIC
++# define SUBLANG_SERBIAN_CYRILLIC 0x03
++# endif
++# ifndef SUBLANG_SINDHI_INDIA
++# define SUBLANG_SINDHI_INDIA 0x00
++# endif
++# ifndef SUBLANG_SINDHI_PAKISTAN
++# define SUBLANG_SINDHI_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_SPANISH_GUATEMALA
++# define SUBLANG_SPANISH_GUATEMALA 0x04
++# endif
++# ifndef SUBLANG_SPANISH_COSTA_RICA
++# define SUBLANG_SPANISH_COSTA_RICA 0x05
++# endif
++# ifndef SUBLANG_SPANISH_PANAMA
++# define SUBLANG_SPANISH_PANAMA 0x06
++# endif
++# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
++# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
++# endif
++# ifndef SUBLANG_SPANISH_VENEZUELA
++# define SUBLANG_SPANISH_VENEZUELA 0x08
++# endif
++# ifndef SUBLANG_SPANISH_COLOMBIA
++# define SUBLANG_SPANISH_COLOMBIA 0x09
++# endif
++# ifndef SUBLANG_SPANISH_PERU
++# define SUBLANG_SPANISH_PERU 0x0a
++# endif
++# ifndef SUBLANG_SPANISH_ARGENTINA
++# define SUBLANG_SPANISH_ARGENTINA 0x0b
++# endif
++# ifndef SUBLANG_SPANISH_ECUADOR
++# define SUBLANG_SPANISH_ECUADOR 0x0c
++# endif
++# ifndef SUBLANG_SPANISH_CHILE
++# define SUBLANG_SPANISH_CHILE 0x0d
++# endif
++# ifndef SUBLANG_SPANISH_URUGUAY
++# define SUBLANG_SPANISH_URUGUAY 0x0e
++# endif
++# ifndef SUBLANG_SPANISH_PARAGUAY
++# define SUBLANG_SPANISH_PARAGUAY 0x0f
++# endif
++# ifndef SUBLANG_SPANISH_BOLIVIA
++# define SUBLANG_SPANISH_BOLIVIA 0x10
++# endif
++# ifndef SUBLANG_SPANISH_EL_SALVADOR
++# define SUBLANG_SPANISH_EL_SALVADOR 0x11
++# endif
++# ifndef SUBLANG_SPANISH_HONDURAS
++# define SUBLANG_SPANISH_HONDURAS 0x12
++# endif
++# ifndef SUBLANG_SPANISH_NICARAGUA
++# define SUBLANG_SPANISH_NICARAGUA 0x13
++# endif
++# ifndef SUBLANG_SPANISH_PUERTO_RICO
++# define SUBLANG_SPANISH_PUERTO_RICO 0x14
++# endif
++# ifndef SUBLANG_SWEDISH_FINLAND
++# define SUBLANG_SWEDISH_FINLAND 0x02
++# endif
++# ifndef SUBLANG_TAMAZIGHT_ARABIC
++# define SUBLANG_TAMAZIGHT_ARABIC 0x01
++# endif
++# ifndef SUBLANG_TAMAZIGHT_LATIN
++# define SUBLANG_TAMAZIGHT_LATIN 0x02
++# endif
++# ifndef SUBLANG_TIGRINYA_ETHIOPIA
++# define SUBLANG_TIGRINYA_ETHIOPIA 0x00
++# endif
++# ifndef SUBLANG_TIGRINYA_ERITREA
++# define SUBLANG_TIGRINYA_ERITREA 0x01
++# endif
++# ifndef SUBLANG_URDU_PAKISTAN
++# define SUBLANG_URDU_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_URDU_INDIA
++# define SUBLANG_URDU_INDIA 0x02
++# endif
++# ifndef SUBLANG_UZBEK_LATIN
++# define SUBLANG_UZBEK_LATIN 0x01
++# endif
++# ifndef SUBLANG_UZBEK_CYRILLIC
++# define SUBLANG_UZBEK_CYRILLIC 0x02
++# endif
++#endif
++
++/* XPG3 defines the result of 'setlocale (category, NULL)' as:
++ "Directs 'setlocale()' to query 'category' and return the current
++ setting of 'local'."
++ However it does not specify the exact format. Neither do SUSV2 and
++ ISO C 99. So we can use this feature only on selected systems (e.g.
++ those using GNU C Library). */
++#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
++# define HAVE_LOCALE_NULL
++#endif
++
++/* Determine the current locale's name, and canonicalize it into XPG syntax
++ language[_territory[.codeset]][@modifier]
++ The codeset part in the result is not reliable; the locale_charset()
++ should be used for codeset information instead.
++ The result must not be freed; it is statically allocated. */
++
++const char *
++_nl_locale_name (int category, const char *categoryname)
++{
++ const char *retval;
++
++#ifndef WIN32
++
++ /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
++ On some systems this can be done by the 'setlocale' function itself. */
++# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
++ retval = setlocale (category, NULL);
++# else
++ /* Setting of LC_ALL overwrites all other. */
++ retval = getenv ("LC_ALL");
++ if (retval == NULL || retval[0] == '\0')
++ {
++ /* Next comes the name of the desired category. */
++ retval = getenv (categoryname);
++ if (retval == NULL || retval[0] == '\0')
++ {
++ /* Last possibility is the LANG environment variable. */
++ retval = getenv ("LANG");
++ if (retval == NULL || retval[0] == '\0')
++ /* We use C as the default domain. POSIX says this is
++ implementation defined. */
++ retval = "C";
++ }
++ }
++# endif
++
++ return retval;
++
++#else /* WIN32 */
++
++ /* Return an XPG style locale name language[_territory][@modifier].
++ Don't even bother determining the codeset; it's not useful in this
++ context, because message catalogs are not specific to a single
++ codeset. */
++
++ LCID lcid;
++ LANGID langid;
++ int primary, sub;
++
++ /* Let the user override the system settings through environment
++ variables, as on POSIX systems. */
++ retval = getenv ("LC_ALL");
++ if (retval != NULL && retval[0] != '\0')
++ return retval;
++ retval = getenv (categoryname);
++ if (retval != NULL && retval[0] != '\0')
++ return retval;
++ retval = getenv ("LANG");
++ if (retval != NULL && retval[0] != '\0')
++ return retval;
++
++ /* Use native Win32 API locale ID. */
++ lcid = GetThreadLocale ();
++
++ /* Strip off the sorting rules, keep only the language part. */
++ langid = LANGIDFROMLCID (lcid);
++
++ /* Split into language and territory part. */
++ primary = PRIMARYLANGID (langid);
++ sub = SUBLANGID (langid);
++
++ /* Dispatch on language.
++ See also http://www.unicode.org/unicode/onlinedat/languages.html .
++ For details about languages, see http://www.ethnologue.com/ . */
++ switch (primary)
++ {
++ case LANG_AFRIKAANS: return "af_ZA";
++ case LANG_ALBANIAN: return "sq_AL";
++ case LANG_AMHARIC: return "am_ET";
++ case LANG_ARABIC:
++ switch (sub)
++ {
++ case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
++ case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
++ case SUBLANG_ARABIC_EGYPT: return "ar_EG";
++ case SUBLANG_ARABIC_LIBYA: return "ar_LY";
++ case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
++ case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
++ case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
++ case SUBLANG_ARABIC_OMAN: return "ar_OM";
++ case SUBLANG_ARABIC_YEMEN: return "ar_YE";
++ case SUBLANG_ARABIC_SYRIA: return "ar_SY";
++ case SUBLANG_ARABIC_JORDAN: return "ar_JO";
++ case SUBLANG_ARABIC_LEBANON: return "ar_LB";
++ case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
++ case SUBLANG_ARABIC_UAE: return "ar_AE";
++ case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
++ case SUBLANG_ARABIC_QATAR: return "ar_QA";
++ }
++ return "ar";
++ case LANG_ARMENIAN: return "hy_AM";
++ case LANG_ASSAMESE: return "as_IN";
++ case LANG_AZERI:
++ switch (sub)
++ {
++ /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
++ case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
++ case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
++ }
++ return "az";
++ case LANG_BASQUE:
++ return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
++ case LANG_BELARUSIAN: return "be_BY";
++ case LANG_BENGALI:
++ switch (sub)
++ {
++ case SUBLANG_BENGALI_INDIA: return "bn_IN";
++ case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
++ }
++ return "bn";
++ case LANG_BULGARIAN: return "bg_BG";
++ case LANG_BURMESE: return "my_MM";
++ case LANG_CAMBODIAN: return "km_KH";
++ case LANG_CATALAN: return "ca_ES";
++ case LANG_CHEROKEE: return "chr_US";
++ case LANG_CHINESE:
++ switch (sub)
++ {
++ case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
++ case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
++ case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
++ case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
++ case SUBLANG_CHINESE_MACAU: return "zh_MO";
++ }
++ return "zh";
++ case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
++ * What used to be called Serbo-Croatian
++ * should really now be two separate
++ * languages because of political reasons.
++ * (Says tml, who knows nothing about Serbian
++ * or Croatian.)
++ * (I can feel those flames coming already.)
++ */
++ switch (sub)
++ {
++ case SUBLANG_DEFAULT: return "hr_HR";
++ case SUBLANG_SERBIAN_LATIN: return "sr_CS";
++ case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
++ }
++ return "hr";
++ case LANG_CZECH: return "cs_CZ";
++ case LANG_DANISH: return "da_DK";
++ case LANG_DIVEHI: return "dv_MV";
++ case LANG_DUTCH:
++ switch (sub)
++ {
++ case SUBLANG_DUTCH: return "nl_NL";
++ case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
++ }
++ return "nl";
++ case LANG_EDO: return "bin_NG";
++ case LANG_ENGLISH:
++ switch (sub)
++ {
++ /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
++ * English was the language spoken in England.
++ * Oh well.
++ */
++ case SUBLANG_ENGLISH_US: return "en_US";
++ case SUBLANG_ENGLISH_UK: return "en_GB";
++ case SUBLANG_ENGLISH_AUS: return "en_AU";
++ case SUBLANG_ENGLISH_CAN: return "en_CA";
++ case SUBLANG_ENGLISH_NZ: return "en_NZ";
++ case SUBLANG_ENGLISH_EIRE: return "en_IE";
++ case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
++ case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
++ case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
++ case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
++ case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
++ case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
++ case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
++ case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
++ case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
++ case SUBLANG_ENGLISH_INDIA: return "en_IN";
++ case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
++ case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
++ }
++ return "en";
++ case LANG_ESTONIAN: return "et_EE";
++ case LANG_FAEROESE: return "fo_FO";
++ case LANG_FARSI: return "fa_IR";
++ case LANG_FINNISH: return "fi_FI";
++ case LANG_FRENCH:
++ switch (sub)
++ {
++ case SUBLANG_FRENCH: return "fr_FR";
++ case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
++ case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
++ case SUBLANG_FRENCH_SWISS: return "fr_CH";
++ case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
++ case SUBLANG_FRENCH_MONACO: return "fr_MC";
++ case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
++ case SUBLANG_FRENCH_REUNION: return "fr_RE";
++ case SUBLANG_FRENCH_CONGO: return "fr_CG";
++ case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
++ case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
++ case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
++ case SUBLANG_FRENCH_MALI: return "fr_ML";
++ case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
++ case SUBLANG_FRENCH_HAITI: return "fr_HT";
++ }
++ return "fr";
++ case LANG_FRISIAN: return "fy_NL";
++ case LANG_FULFULDE:
++ /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
++ return "ff_NG";
++ case LANG_GAELIC:
++ switch (sub)
++ {
++ case 0x01: /* SCOTTISH */ return "gd_GB";
++ case 0x02: /* IRISH */ return "ga_IE";
++ }
++ return "C";
++ case LANG_GALICIAN: return "gl_ES";
++ case LANG_GEORGIAN: return "ka_GE";
++ case LANG_GERMAN:
++ switch (sub)
++ {
++ case SUBLANG_GERMAN: return "de_DE";
++ case SUBLANG_GERMAN_SWISS: return "de_CH";
++ case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
++ case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
++ case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
++ }
++ return "de";
++ case LANG_GREEK: return "el_GR";
++ case LANG_GUARANI: return "gn_PY";
++ case LANG_GUJARATI: return "gu_IN";
++ case LANG_HAUSA: return "ha_NG";
++ case LANG_HAWAIIAN:
++ /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
++ or Hawaii Creole English ("cpe_US", 600000 speakers)? */
++ return "cpe_US";
++ case LANG_HEBREW: return "he_IL";
++ case LANG_HINDI: return "hi_IN";
++ case LANG_HUNGARIAN: return "hu_HU";
++ case LANG_IBIBIO: return "nic_NG";
++ case LANG_ICELANDIC: return "is_IS";
++ case LANG_IGBO: return "ig_NG";
++ case LANG_INDONESIAN: return "id_ID";
++ case LANG_INUKTITUT: return "iu_CA";
++ case LANG_ITALIAN:
++ switch (sub)
++ {
++ case SUBLANG_ITALIAN: return "it_IT";
++ case SUBLANG_ITALIAN_SWISS: return "it_CH";
++ }
++ return "it";
++ case LANG_JAPANESE: return "ja_JP";
++ case LANG_KANNADA: return "kn_IN";
++ case LANG_KANURI: return "kr_NG";
++ case LANG_KASHMIRI:
++ switch (sub)
++ {
++ case SUBLANG_DEFAULT: return "ks_PK";
++ case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
++ }
++ return "ks";
++ case LANG_KAZAK: return "kk_KZ";
++ case LANG_KONKANI:
++ /* FIXME: Adjust this when such locales appear on Unix. */
++ return "kok_IN";
++ case LANG_KOREAN: return "ko_KR";
++ case LANG_KYRGYZ: return "ky_KG";
++ case LANG_LAO: return "lo_LA";
++ case LANG_LATIN: return "la_VA";
++ case LANG_LATVIAN: return "lv_LV";
++ case LANG_LITHUANIAN: return "lt_LT";
++ case LANG_MACEDONIAN: return "mk_MK";
++ case LANG_MALAY:
++ switch (sub)
++ {
++ case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
++ case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
++ }
++ return "ms";
++ case LANG_MALAYALAM: return "ml_IN";
++ case LANG_MALTESE: return "mt_MT";
++ case LANG_MANIPURI:
++ /* FIXME: Adjust this when such locales appear on Unix. */
++ return "mni_IN";
++ case LANG_MARATHI: return "mr_IN";
++ case LANG_MONGOLIAN:
++ return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
++ case LANG_NEPALI:
++ switch (sub)
++ {
++ case SUBLANG_DEFAULT: return "ne_NP";
++ case SUBLANG_NEPALI_INDIA: return "ne_IN";
++ }
++ return "ne";
++ case LANG_NORWEGIAN:
++ switch (sub)
++ {
++ case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
++ case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
++ }
++ return "no";
++ case LANG_ORIYA: return "or_IN";
++ case LANG_OROMO: return "om_ET";
++ case LANG_PAPIAMENTU: return "pap_AN";
++ case LANG_PASHTO:
++ return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
++ case LANG_POLISH: return "pl_PL";
++ case LANG_PORTUGUESE:
++ switch (sub)
++ {
++ case SUBLANG_PORTUGUESE: return "pt_PT";
++ /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
++ Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
++ case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
++ }
++ return "pt";
++ case LANG_PUNJABI:
++ switch (sub)
++ {
++ case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
++ case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
++ }
++ return "pa";
++ case LANG_RHAETO_ROMANCE: return "rm_CH";
++ case LANG_ROMANIAN:
++ switch (sub)
++ {
++ case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
++ case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
++ }
++ return "ro";
++ case LANG_RUSSIAN:
++ return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
++ case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
++ case LANG_SANSKRIT: return "sa_IN";
++ case LANG_SINDHI:
++ switch (sub)
++ {
++ case SUBLANG_SINDHI_INDIA: return "sd_IN";
++ case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
++ }
++ return "sd";
++ case LANG_SINHALESE: return "si_LK";
++ case LANG_SLOVAK: return "sk_SK";
++ case LANG_SLOVENIAN: return "sl_SI";
++ case LANG_SOMALI: return "so_SO";
++ case LANG_SORBIAN:
++ /* FIXME: Adjust this when such locales appear on Unix. */
++ return "wen_DE";
++ case LANG_SPANISH:
++ switch (sub)
++ {
++ case SUBLANG_SPANISH: return "es_ES";
++ case SUBLANG_SPANISH_MEXICAN: return "es_MX";
++ case SUBLANG_SPANISH_MODERN:
++ return "es_ES@modern"; /* not seen on Unix */
++ case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
++ case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
++ case SUBLANG_SPANISH_PANAMA: return "es_PA";
++ case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
++ case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
++ case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
++ case SUBLANG_SPANISH_PERU: return "es_PE";
++ case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
++ case SUBLANG_SPANISH_ECUADOR: return "es_EC";
++ case SUBLANG_SPANISH_CHILE: return "es_CL";
++ case SUBLANG_SPANISH_URUGUAY: return "es_UY";
++ case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
++ case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
++ case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
++ case SUBLANG_SPANISH_HONDURAS: return "es_HN";
++ case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
++ case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
++ }
++ return "es";
++ case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
++ case LANG_SWAHILI: return "sw_KE";
++ case LANG_SWEDISH:
++ switch (sub)
++ {
++ case SUBLANG_DEFAULT: return "sv_SE";
++ case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
++ }
++ return "sv";
++ case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
++ case LANG_TAGALOG: return "tl_PH";
++ case LANG_TAJIK: return "tg_TJ";
++ case LANG_TAMAZIGHT:
++ switch (sub)
++ {
++ /* FIXME: Adjust this when Tamazight locales appear on Unix. */
++ case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
++ case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
++ }
++ return "ber_MA";
++ case LANG_TAMIL:
++ return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
++ case LANG_TATAR: return "tt_RU";
++ case LANG_TELUGU: return "te_IN";
++ case LANG_THAI: return "th_TH";
++ case LANG_TIBETAN: return "bo_CN";
++ case LANG_TIGRINYA:
++ switch (sub)
++ {
++ case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
++ case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
++ }
++ return "ti";
++ case LANG_TSONGA: return "ts_ZA";
++ case LANG_TSWANA: return "tn_BW";
++ case LANG_TURKISH: return "tr_TR";
++ case LANG_TURKMEN: return "tk_TM";
++ case LANG_UKRAINIAN: return "uk_UA";
++ case LANG_URDU:
++ switch (sub)
++ {
++ case SUBLANG_URDU_PAKISTAN: return "ur_PK";
++ case SUBLANG_URDU_INDIA: return "ur_IN";
++ }
++ return "ur";
++ case LANG_UZBEK:
++ switch (sub)
++ {
++ case SUBLANG_UZBEK_LATIN: return "uz_UZ";
++ case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
++ }
++ return "uz";
++ case LANG_VENDA: return "ve_ZA";
++ case LANG_VIETNAMESE: return "vi_VN";
++ case LANG_WELSH: return "cy_GB";
++ case LANG_XHOSA: return "xh_ZA";
++ case LANG_YI: return "sit_CN";
++ case LANG_YIDDISH: return "yi_IL";
++ case LANG_YORUBA: return "yo_NG";
++ case LANG_ZULU: return "zu_ZA";
++ default: return "C";
++ }
++
++#endif
++}
+--- lrzsz-0.12.20.safe/intl/log.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/log.c 2004-09-12 14:40:34.515723768 -0400
+@@ -0,0 +1,98 @@
++/* Log file output.
++ Copyright (C) 2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Written by Bruno Haible <bruno@clisp.org>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++/* Print an ASCII string with quotes and escape sequences where needed. */
++static void
++print_escaped (FILE *stream, const char *str)
++{
++ putc ('"', stream);
++ for (; *str != '\0'; str++)
++ if (*str == '\n')
++ {
++ fputs ("\\n\"", stream);
++ if (str[1] == '\0')
++ return;
++ fputs ("\n\"", stream);
++ }
++ else
++ {
++ if (*str == '"' || *str == '\\')
++ putc ('\\', stream);
++ putc (*str, stream);
++ }
++ putc ('"', stream);
++}
++
++/* Add to the log file an entry denoting a failed translation. */
++void
++_nl_log_untranslated (const char *logfilename, const char *domainname,
++ const char *msgid1, const char *msgid2, int plural)
++{
++ static char *last_logfilename = NULL;
++ static FILE *last_logfile = NULL;
++ FILE *logfile;
++
++ /* Can we reuse the last opened logfile? */
++ if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
++ {
++ /* Close the last used logfile. */
++ if (last_logfilename != NULL)
++ {
++ if (last_logfile != NULL)
++ {
++ fclose (last_logfile);
++ last_logfile = NULL;
++ }
++ free (last_logfilename);
++ last_logfilename = NULL;
++ }
++ /* Open the logfile. */
++ last_logfilename = (char *) malloc (strlen (logfilename) + 1);
++ if (last_logfilename == NULL)
++ return;
++ strcpy (last_logfilename, logfilename);
++ last_logfile = fopen (logfilename, "a");
++ if (last_logfile == NULL)
++ return;
++ }
++ logfile = last_logfile;
++
++ fprintf (logfile, "domain ");
++ print_escaped (logfile, domainname);
++ fprintf (logfile, "\nmsgid ");
++ print_escaped (logfile, msgid1);
++ if (plural)
++ {
++ fprintf (logfile, "\nmsgid_plural ");
++ print_escaped (logfile, msgid2);
++ fprintf (logfile, "\nmsgstr[0] \"\"\n");
++ }
++ else
++ fprintf (logfile, "\nmsgstr \"\"\n");
++ putc ('\n', logfile);
++}
+--- lrzsz-0.12.20.safe/intl/Makefile.in 1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/Makefile.in 2004-09-12 14:40:34.521722856 -0400
+@@ -1,19 +1,20 @@
+-# Makefile for directory with message catalog handling in GNU NLS Utilities.
+-# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++# Makefile for directory with message catalog handling library of GNU gettext
++# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+ #
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Library General Public License for more details.
+ #
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
+
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+@@ -23,118 +24,341 @@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+ top_builddir = ..
+-VPATH = @srcdir@
++#VPATH = $(srcdir)
+
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ transform = @program_transform_name@
+-libdir = $(exec_prefix)/lib
+-includedir = $(prefix)/include
+-datadir = $(prefix)/@DATADIRNAME@
++libdir = @libdir@
++includedir = @includedir@
++datadir = @datadir@
+ localedir = $(datadir)/locale
+-gnulocaledir = $(prefix)/share/locale
+-gettextsrcdir = @datadir@/gettext/intl
+-aliaspath = $(localedir):.
++gettextsrcdir = $(datadir)/gettext/intl
++aliaspath = $(localedir)
+ subdir = intl
+
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ MKINSTALLDIRS = @MKINSTALLDIRS@
++mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
+
+-l = @l@
++l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+
+ AR = ar
+ CC = @CC@
+ LIBTOOL = @LIBTOOL@
+ RANLIB = @RANLIB@
++YACC = @INTLBISON@ -y -d
++YFLAGS = --name-prefix=__gettext
+
+-DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
+--DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
++DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
++-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
++-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
++-Dset_relocation_prefix=libintl_set_relocation_prefix \
++-Drelocate=libintl_relocate \
++-DDEPENDS_ON_LIBICONV=1 @DEFS@
+ CPPFLAGS = @CPPFLAGS@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
++LIBS = @LIBS@
+
+ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+-HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+-COMHDRS = gettext.h gettextP.h hash-string.h
+-SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+-COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+-finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+-explodename.c
+-OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+-finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+-explodename.$lo
+-CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
+-GETTOBJS = intl-compat.$lo
+-DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
+-xopen-msg.sed $(HEADERS) $(SOURCES)
++HEADERS = \
++ gmo.h \
++ gettextP.h \
++ hash-string.h \
++ loadinfo.h \
++ plural-exp.h \
++ eval-plural.h \
++ localcharset.h \
++ relocatable.h \
++ xsize.h \
++ printf-args.h printf-args.c \
++ printf-parse.h wprintf-parse.h printf-parse.c \
++ vasnprintf.h vasnwprintf.h vasnprintf.c \
++ os2compat.h \
++ libgnuintl.h.in
++SOURCES = \
++ bindtextdom.c \
++ dcgettext.c \
++ dgettext.c \
++ gettext.c \
++ finddomain.c \
++ loadmsgcat.c \
++ localealias.c \
++ textdomain.c \
++ l10nflist.c \
++ explodename.c \
++ dcigettext.c \
++ dcngettext.c \
++ dngettext.c \
++ ngettext.c \
++ plural.y \
++ plural-exp.c \
++ localcharset.c \
++ relocatable.c \
++ localename.c \
++ log.c \
++ printf.c \
++ osdep.c \
++ os2compat.c \
++ intl-compat.c
++OBJECTS = \
++ bindtextdom.$lo \
++ dcgettext.$lo \
++ dgettext.$lo \
++ gettext.$lo \
++ finddomain.$lo \
++ loadmsgcat.$lo \
++ localealias.$lo \
++ textdomain.$lo \
++ l10nflist.$lo \
++ explodename.$lo \
++ dcigettext.$lo \
++ dcngettext.$lo \
++ dngettext.$lo \
++ ngettext.$lo \
++ plural.$lo \
++ plural-exp.$lo \
++ localcharset.$lo \
++ relocatable.$lo \
++ localename.$lo \
++ log.$lo \
++ printf.$lo \
++ osdep.$lo \
++ intl-compat.$lo
++DISTFILES.common = Makefile.in \
++config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
++DISTFILES.generated = plural.c
+ DISTFILES.normal = VERSION
+-DISTFILES.gettext = libintl.glibc intlh.inst.in
++DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
++libgnuintl.h_vms Makefile.vms \
++libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
++DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
++COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
++
++all: all-@USE_INCLUDED_LIBINTL@
++all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
++all-no: all-no-@BUILD_INCLUDED_LIBINTL@
++all-no-yes: libgnuintl.$la
++all-no-no:
++
++libintl.a libgnuintl.a: $(OBJECTS)
++ rm -f $@
++ $(AR) cru $@ $(OBJECTS)
++ $(RANLIB) $@
++
++libintl.la libgnuintl.la: $(OBJECTS)
++ $(LIBTOOL) --mode=link \
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
++ $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
++ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
++ -rpath $(libdir) \
++ -no-undefined
++
++# Libtool's library version information for libintl.
++# Before making a gettext release, the gettext maintainer must change this
++# according to the libtool documentation, section "Library interface versions".
++# Maintainers of other packages that include the intl directory must *not*
++# change these values.
++LTV_CURRENT=7
++LTV_REVISION=0
++LTV_AGE=4
+
+ .SUFFIXES:
+-.SUFFIXES: .c .o .lo
++.SUFFIXES: .c .y .o .lo .sin .sed
++
+ .c.o:
+ $(COMPILE) $<
+-.c.lo:
+- $(LIBTOOL) --mode=compile $(COMPILE) $<
+
+-INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib
++.y.c:
++ $(YACC) $(YFLAGS) --output $@ $<
++ rm -f $*.h
+
+-all: all-@USE_INCLUDED_LIBINTL@
++bindtextdom.lo: $(srcdir)/bindtextdom.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
++dcgettext.lo: $(srcdir)/dcgettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
++dgettext.lo: $(srcdir)/dgettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
++gettext.lo: $(srcdir)/gettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
++finddomain.lo: $(srcdir)/finddomain.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
++loadmsgcat.lo: $(srcdir)/loadmsgcat.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
++localealias.lo: $(srcdir)/localealias.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
++textdomain.lo: $(srcdir)/textdomain.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
++l10nflist.lo: $(srcdir)/l10nflist.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
++explodename.lo: $(srcdir)/explodename.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
++dcigettext.lo: $(srcdir)/dcigettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
++dcngettext.lo: $(srcdir)/dcngettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
++dngettext.lo: $(srcdir)/dngettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
++ngettext.lo: $(srcdir)/ngettext.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
++plural.lo: $(srcdir)/plural.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
++plural-exp.lo: $(srcdir)/plural-exp.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
++localcharset.lo: $(srcdir)/localcharset.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
++relocatable.lo: $(srcdir)/relocatable.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
++localename.lo: $(srcdir)/localename.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
++log.lo: $(srcdir)/log.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
++printf.lo: $(srcdir)/printf.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
++osdep.lo: $(srcdir)/osdep.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
++intl-compat.lo: $(srcdir)/intl-compat.c
++ $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
+
+-all-yes: libintl.$la intlh.inst
+-all-no:
++ref-add.sed: $(srcdir)/ref-add.sin
++ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
++ mv t-ref-add.sed ref-add.sed
++ref-del.sed: $(srcdir)/ref-del.sin
++ sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
++ mv t-ref-del.sed ref-del.sed
+
+-libintl.a: $(OBJECTS)
+- rm -f $@
+- $(AR) cru $@ $(OBJECTS)
+- $(RANLIB) $@
++INCLUDES = -I. -I$(srcdir) -I..
+
+-libintl.la: $(OBJECTS)
+- $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
+- -version-info 1:0 -rpath $(libdir)
++libgnuintl.h: $(srcdir)/libgnuintl.h.in
++ sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
++ -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
++ -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
++ -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
++ < $(srcdir)/libgnuintl.h.in > libgnuintl.h
+
+-../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
+- cd ../po && $(MAKE) cat-id-tbl.$lo
++libintl.h: libgnuintl.h
++ cp libgnuintl.h libintl.h
+
+-check: all
++charset.alias: $(srcdir)/config.charset
++ $(SHELL) $(srcdir)/config.charset '@host@' > t-$@
++ mv t-$@ $@
+
+-# This installation goal is only used in GNU gettext. Packages which
+-# only use the library should use install instead.
++check: all
+
+ # We must not install the libintl.h/libintl.a files if we are on a
+-# system which has the gettext() function in its C library or in a
+-# separate library or use the catgets interface. A special case is
+-# where configure found a previously installed GNU gettext library.
++# system which has the GNU gettext() function in its C library or in a
++# separate library.
+ # If you want to use the one which comes with this version of the
+ # package, you have to use `configure --with-included-gettext'.
+ install: install-exec install-data
+ install-exec: all
+- if test "$(PACKAGE)" = "gettext" \
+- && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
+- if test -r $(MKINSTALLDIRS); then \
+- $(MKINSTALLDIRS) $(libdir) $(includedir); \
+- else \
+- $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
++ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
++ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
++ $(LIBTOOL) --mode=install \
++ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
++ if test "@RELOCATABLE@" = yes; then \
++ dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
++ if test -n "$$dependencies"; then \
++ rm -f $(DESTDIR)$(libdir)/libintl.la; \
++ fi; \
+ fi; \
+- $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
+- $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ else \
+ : ; \
+ fi
+-install-data: all
+- if test "$(PACKAGE)" = "gettext"; then \
+- if test -r $(MKINSTALLDIRS); then \
+- $(MKINSTALLDIRS) $(gettextsrcdir); \
++ if test "$(PACKAGE)" = "gettext-tools" \
++ && test '@USE_INCLUDED_LIBINTL@' = no; then \
++ $(mkinstalldirs) $(DESTDIR)$(libdir); \
++ $(LIBTOOL) --mode=install \
++ $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
++ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++ $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++ $(LIBTOOL) --mode=uninstall \
++ rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
++ else \
++ : ; \
++ fi
++ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
++ temp=$(DESTDIR)$(libdir)/t-charset.alias; \
++ dest=$(DESTDIR)$(libdir)/charset.alias; \
++ if test -f $(DESTDIR)$(libdir)/charset.alias; then \
++ orig=$(DESTDIR)$(libdir)/charset.alias; \
++ sed -f ref-add.sed $$orig > $$temp; \
++ $(INSTALL_DATA) $$temp $$dest; \
++ rm -f $$temp; \
+ else \
+- $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
++ if test @GLIBC21@ = no; then \
++ orig=charset.alias; \
++ sed -f ref-add.sed $$orig > $$temp; \
++ $(INSTALL_DATA) $$temp $$dest; \
++ rm -f $$temp; \
++ fi; \
+ fi; \
+- $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
+- dists="$(DISTFILES.common)"; \
++ $(mkinstalldirs) $(DESTDIR)$(localedir); \
++ test -f $(DESTDIR)$(localedir)/locale.alias \
++ && orig=$(DESTDIR)$(localedir)/locale.alias \
++ || orig=$(srcdir)/locale.alias; \
++ temp=$(DESTDIR)$(localedir)/t-locale.alias; \
++ dest=$(DESTDIR)$(localedir)/locale.alias; \
++ sed -f ref-add.sed $$orig > $$temp; \
++ $(INSTALL_DATA) $$temp $$dest; \
++ rm -f $$temp; \
++ else \
++ : ; \
++ fi
++install-data: all
++ if test "$(PACKAGE)" = "gettext-tools"; then \
++ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
++ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
++ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
++ dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
+ for file in $$dists; do \
+- $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
++ $(INSTALL_DATA) $(srcdir)/$$file \
++ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
++ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
++ dists="$(DISTFILES.generated)"; \
++ for file in $$dists; do \
++ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
++ $(INSTALL_DATA) $$dir/$$file \
++ $(DESTDIR)$(gettextsrcdir)/$$file; \
++ done; \
++ dists="$(DISTFILES.obsolete)"; \
++ for file in $$dists; do \
++ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
++ done; \
++ else \
++ : ; \
++ fi
++
++install-strip: install
++
++installdirs:
++ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
++ else \
++ : ; \
++ fi
++ if test "$(PACKAGE)" = "gettext-tools" \
++ && test '@USE_INCLUDED_LIBINTL@' = no; then \
++ $(mkinstalldirs) $(DESTDIR)$(libdir); \
++ else \
++ : ; \
++ fi
++ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
++ $(mkinstalldirs) $(DESTDIR)$(localedir); \
++ else \
++ : ; \
++ fi
++ if test "$(PACKAGE)" = "gettext-tools"; then \
++ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+@@ -143,22 +367,76 @@
+ installcheck:
+
+ uninstall:
+- dists="$(DISTFILES.common)"; \
+- for file in $$dists; do \
+- rm -f $(gettextsrcdir)/$$file; \
+- done
++ if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++ && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ rm -f $(DESTDIR)$(includedir)/libintl.h; \
++ $(LIBTOOL) --mode=uninstall \
++ rm -f $(DESTDIR)$(libdir)/libintl.$la; \
++ else \
++ : ; \
++ fi
++ if test "$(PACKAGE)" = "gettext-tools" \
++ && test '@USE_INCLUDED_LIBINTL@' = no; then \
++ rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++ else \
++ : ; \
++ fi
++ if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++ if test -f $(DESTDIR)$(libdir)/charset.alias; then \
++ temp=$(DESTDIR)$(libdir)/t-charset.alias; \
++ dest=$(DESTDIR)$(libdir)/charset.alias; \
++ sed -f ref-del.sed $$dest > $$temp; \
++ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
++ rm -f $$dest; \
++ else \
++ $(INSTALL_DATA) $$temp $$dest; \
++ fi; \
++ rm -f $$temp; \
++ fi; \
++ if test -f $(DESTDIR)$(localedir)/locale.alias; then \
++ temp=$(DESTDIR)$(localedir)/t-locale.alias; \
++ dest=$(DESTDIR)$(localedir)/locale.alias; \
++ sed -f ref-del.sed $$dest > $$temp; \
++ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
++ rm -f $$dest; \
++ else \
++ $(INSTALL_DATA) $$temp $$dest; \
++ fi; \
++ rm -f $$temp; \
++ fi; \
++ else \
++ : ; \
++ fi
++ if test "$(PACKAGE)" = "gettext-tools"; then \
++ for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
++ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
++ done; \
++ else \
++ : ; \
++ fi
+
+-info dvi:
++info dvi ps pdf html:
+
+-$(OBJECTS): ../config.h libgettext.h
+-bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
+-dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
++$(OBJECTS): ../config.h libgnuintl.h
++bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
++dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
++explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
++dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
++dcigettext.$lo: $(srcdir)/eval-plural.h
++localcharset.$lo: $(srcdir)/localcharset.h
++localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
++printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
+
+ tags: TAGS
+
+ TAGS: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+
++ctags: CTAGS
++
++CTAGS: $(HEADERS) $(SOURCES)
++ here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
++
+ id: ID
+
+ ID: $(HEADERS) $(SOURCES)
+@@ -166,12 +444,19 @@
+
+
+ mostlyclean:
+- rm -f *.a *.o *.lo core core.*
++ rm -f *.a *.la *.o *.obj *.lo core core.*
++ rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
++ rm -f -r .libs _libs
+
+ clean: mostlyclean
+
+ distclean: clean
+- rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
++ rm -f Makefile ID TAGS
++ if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
++ rm -f ChangeLog.inst $(DISTFILES.normal); \
++ else \
++ : ; \
++ fi
+
+ maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+@@ -181,33 +466,27 @@
+ # GNU gettext needs not contain the file `VERSION' but contains some
+ # other files which should not be distributed in other packages.
+ distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+-dist distdir: Makefile $(DISTFILES)
+- if test "$(PACKAGE)" = gettext; then \
+- additional="$(DISTFILES.gettext)"; \
++dist distdir: Makefile
++ if test "$(PACKAGE)" = "gettext-tools"; then \
++ : ; \
+ else \
+- additional="$(DISTFILES.normal)"; \
+- fi; \
+- for file in $(DISTFILES.common) $$additional; do \
+- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+- || cp -p $(srcdir)/$$file $(distdir); \
+- done
+-
+-dist-libc:
+- tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
+-
+-Makefile: Makefile.in ../config.status
+- cd .. \
+- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
++ if test "$(PACKAGE)" = "gettext-runtime"; then \
++ additional="$(DISTFILES.gettext)"; \
++ else \
++ additional="$(DISTFILES.normal)"; \
++ fi; \
++ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
++ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
++ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
++ cp -p $$dir/$$file $(distdir); \
++ done; \
++ fi
+
+-# The dependency for intlh.inst is different in gettext and all other
+-# packages. Because we cannot you GNU make features we have to solve
+-# the problem while rewriting Makefile.in.
+-@GT_YES@intlh.inst: intlh.inst.in ../config.status
+-@GT_YES@ cd .. \
+-@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+-@GT_YES@ $(SHELL) ./config.status
+-@GT_NO@.PHONY: intlh.inst
+-@GT_NO@intlh.inst:
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++ cd $(top_builddir) && $(SHELL) ./config.status
++# This would be more efficient, but doesn't work any more with autoconf-2.57,
++# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
++# cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+ # Tell versions [3.59,3.63) of GNU make not to export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+--- lrzsz-0.12.20.safe/intl/ngettext.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ngettext.c 2004-09-12 14:40:34.533721032 -0400
+@@ -0,0 +1,65 @@
++/* Implementation of ngettext(3) function.
++ Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#ifdef _LIBC
++# define __need_NULL
++# include <stddef.h>
++#else
++# include <stdlib.h> /* Just for NULL. */
++#endif
++
++#include "gettextP.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++#include <locale.h>
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem. They must not clash
++ with existing names and they should follow ANSI C. But this source
++ code is also used in GNU C Library where the names have a __
++ prefix. So we have to make a difference here. */
++#ifdef _LIBC
++# define NGETTEXT __ngettext
++# define DCNGETTEXT __dcngettext
++#else
++# define NGETTEXT libintl_ngettext
++# define DCNGETTEXT libintl_dcngettext
++#endif
++
++/* Look up MSGID in the current default message catalog for the current
++ LC_MESSAGES locale. If not found, returns MSGID itself (the default
++ text). */
++char *
++NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
++{
++ return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library. */
++weak_alias (__ngettext, ngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/os2compat.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/os2compat.c 2004-09-12 14:40:34.539720120 -0400
+@@ -0,0 +1,98 @@
++/* OS/2 compatibility functions.
++ Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#define OS2_AWARE
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <string.h>
++#include <sys/param.h>
++
++/* A version of getenv() that works from DLLs */
++extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
++
++char *
++_nl_getenv (const char *name)
++{
++ unsigned char *value;
++ if (DosScanEnv (name, &value))
++ return NULL;
++ else
++ return value;
++}
++
++/* A fixed size buffer. */
++char libintl_nl_default_dirname[MAXPATHLEN+1];
++
++char *_nlos2_libdir = NULL;
++char *_nlos2_localealiaspath = NULL;
++char *_nlos2_localedir = NULL;
++
++static __attribute__((constructor)) void
++nlos2_initialize ()
++{
++ char *root = getenv ("UNIXROOT");
++ char *gnulocaledir = getenv ("GNULOCALEDIR");
++
++ _nlos2_libdir = gnulocaledir;
++ if (!_nlos2_libdir)
++ {
++ if (root)
++ {
++ size_t sl = strlen (root);
++ _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
++ memcpy (_nlos2_libdir, root, sl);
++ memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
++ }
++ else
++ _nlos2_libdir = LIBDIR;
++ }
++
++ _nlos2_localealiaspath = gnulocaledir;
++ if (!_nlos2_localealiaspath)
++ {
++ if (root)
++ {
++ size_t sl = strlen (root);
++ _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
++ memcpy (_nlos2_localealiaspath, root, sl);
++ memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
++ }
++ else
++ _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
++ }
++
++ _nlos2_localedir = gnulocaledir;
++ if (!_nlos2_localedir)
++ {
++ if (root)
++ {
++ size_t sl = strlen (root);
++ _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
++ memcpy (_nlos2_localedir, root, sl);
++ memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
++ }
++ else
++ _nlos2_localedir = LOCALEDIR;
++ }
++
++ if (strlen (_nlos2_localedir) <= MAXPATHLEN)
++ strcpy (libintl_nl_default_dirname, _nlos2_localedir);
++}
+--- lrzsz-0.12.20.safe/intl/os2compat.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/os2compat.h 2004-09-12 14:40:34.544719360 -0400
+@@ -0,0 +1,46 @@
++/* OS/2 compatibility defines.
++ This file is intended to be included from config.h
++ Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* When included from os2compat.h we need all the original definitions */
++#ifndef OS2_AWARE
++
++#undef LIBDIR
++#define LIBDIR _nlos2_libdir
++extern char *_nlos2_libdir;
++
++#undef LOCALEDIR
++#define LOCALEDIR _nlos2_localedir
++extern char *_nlos2_localedir;
++
++#undef LOCALE_ALIAS_PATH
++#define LOCALE_ALIAS_PATH _nlos2_localealiaspath
++extern char *_nlos2_localealiaspath;
++
++#endif
++
++#undef HAVE_STRCASECMP
++#define HAVE_STRCASECMP 1
++#define strcasecmp stricmp
++#define strncasecmp strnicmp
++
++/* We have our own getenv() which works even if library is compiled as DLL */
++#define getenv _nl_getenv
++
++/* Older versions of gettext used -1 as the value of LC_MESSAGES */
++#define LC_MESSAGES_COMPAT (-1)
+--- lrzsz-0.12.20.safe/intl/osdep.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/osdep.c 2004-09-12 14:40:34.550718448 -0400
+@@ -0,0 +1,24 @@
++/* OS dependent parts of libintl.
++ Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#if defined __EMX__
++# include "os2compat.c"
++#else
++/* Avoid AIX compiler warning. */
++typedef int dummy;
++#endif
+--- lrzsz-0.12.20.safe/intl/plural.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural.c 2004-09-12 14:40:36.571411256 -0400
+@@ -0,0 +1,1490 @@
++/* A Bison parser, made from plural.y
++ by GNU bison 1.35. */
++
++#define YYBISON 1 /* Identify Bison output. */
++
++#define yyparse __gettextparse
++#define yylex __gettextlex
++#define yyerror __gettexterror
++#define yylval __gettextlval
++#define yychar __gettextchar
++#define yydebug __gettextdebug
++#define yynerrs __gettextnerrs
++# define EQUOP2 257
++# define CMPOP2 258
++# define ADDOP2 259
++# define MULOP2 260
++# define NUMBER 261
++
++#line 1 "plural.y"
++
++/* Expression parsing for plural form selection.
++ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* The bison generated parser uses alloca. AIX 3 forces us to put this
++ declaration at the beginning of the file. The declaration in bison's
++ skeleton file comes too late. This must come before <config.h>
++ because <config.h> may include arbitrary system headers. */
++#if defined _AIX && !defined __GNUC__
++ #pragma alloca
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include "plural-exp.h"
++
++/* The main function generated by the parser is called __gettextparse,
++ but we want it to be called PLURAL_PARSE. */
++#ifndef _LIBC
++# define __gettextparse PLURAL_PARSE
++#endif
++
++#define YYLEX_PARAM &((struct parse_args *) arg)->cp
++#define YYPARSE_PARAM arg
++
++#line 49 "plural.y"
++#ifndef YYSTYPE
++typedef union {
++ unsigned long int num;
++ enum operator op;
++ struct expression *exp;
++} yystype;
++# define YYSTYPE yystype
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++#line 55 "plural.y"
++
++/* Prototypes for local functions. */
++static int yylex (YYSTYPE *lval, const char **pexp);
++static void yyerror (const char *str);
++
++/* Allocation of expressions. */
++
++static struct expression *
++new_exp (int nargs, enum operator op, struct expression * const *args)
++{
++ int i;
++ struct expression *newp;
++
++ /* If any of the argument could not be malloc'ed, just return NULL. */
++ for (i = nargs - 1; i >= 0; i--)
++ if (args[i] == NULL)
++ goto fail;
++
++ /* Allocate a new expression. */
++ newp = (struct expression *) malloc (sizeof (*newp));
++ if (newp != NULL)
++ {
++ newp->nargs = nargs;
++ newp->operation = op;
++ for (i = nargs - 1; i >= 0; i--)
++ newp->val.args[i] = args[i];
++ return newp;
++ }
++
++ fail:
++ for (i = nargs - 1; i >= 0; i--)
++ FREE_EXPRESSION (args[i]);
++
++ return NULL;
++}
++
++static inline struct expression *
++new_exp_0 (enum operator op)
++{
++ return new_exp (0, op, NULL);
++}
++
++static inline struct expression *
++new_exp_1 (enum operator op, struct expression *right)
++{
++ struct expression *args[1];
++
++ args[0] = right;
++ return new_exp (1, op, args);
++}
++
++static struct expression *
++new_exp_2 (enum operator op, struct expression *left, struct expression *right)
++{
++ struct expression *args[2];
++
++ args[0] = left;
++ args[1] = right;
++ return new_exp (2, op, args);
++}
++
++static inline struct expression *
++new_exp_3 (enum operator op, struct expression *bexp,
++ struct expression *tbranch, struct expression *fbranch)
++{
++ struct expression *args[3];
++
++ args[0] = bexp;
++ args[1] = tbranch;
++ args[2] = fbranch;
++ return new_exp (3, op, args);
++}
++
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++
++
++#define YYFINAL 27
++#define YYFLAG -32768
++#define YYNTBASE 16
++
++/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
++#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
++
++/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
++static const char yytranslate[] =
++{
++ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
++ 14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
++ 2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 13, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
++ 2, 2, 2, 2, 2, 2, 1, 6, 7, 8,
++ 9, 11
++};
++
++#if YYDEBUG
++static const short yyprhs[] =
++{
++ 0, 0, 2, 8, 12, 16, 20, 24, 28, 32,
++ 35, 37, 39
++};
++static const short yyrhs[] =
++{
++ 17, 0, 17, 3, 17, 12, 17, 0, 17, 4,
++ 17, 0, 17, 5, 17, 0, 17, 6, 17, 0,
++ 17, 7, 17, 0, 17, 8, 17, 0, 17, 9,
++ 17, 0, 10, 17, 0, 13, 0, 11, 0, 14,
++ 17, 15, 0
++};
++
++#endif
++
++#if YYDEBUG
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const short yyrline[] =
++{
++ 0, 150, 158, 162, 166, 170, 174, 178, 182, 186,
++ 190, 194, 199
++};
++#endif
++
++
++#if (YYDEBUG) || defined YYERROR_VERBOSE
++
++/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
++static const char *const yytname[] =
++{
++ "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
++ "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
++ "start", "exp", 0
++};
++#endif
++
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const short yyr1[] =
++{
++ 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
++ 17, 17, 17
++};
++
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const short yyr2[] =
++{
++ 0, 1, 5, 3, 3, 3, 3, 3, 3, 2,
++ 1, 1, 3
++};
++
++/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
++ doesn't specify something else to do. Zero means the default is an
++ error. */
++static const short yydefact[] =
++{
++ 0, 0, 11, 10, 0, 1, 9, 0, 0, 0,
++ 0, 0, 0, 0, 0, 12, 0, 3, 4, 5,
++ 6, 7, 8, 0, 2, 0, 0, 0
++};
++
++static const short yydefgoto[] =
++{
++ 25, 5
++};
++
++static const short yypact[] =
++{
++ -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9,
++ -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16,
++ 26, -3,-32768, -9, 34, 21, 53,-32768
++};
++
++static const short yypgoto[] =
++{
++ -32768, -1
++};
++
++
++#define YYLAST 53
++
++
++static const short yytable[] =
++{
++ 6, 1, 2, 7, 3, 4, 14, 16, 17, 18,
++ 19, 20, 21, 22, 8, 9, 10, 11, 12, 13,
++ 14, 26, 24, 12, 13, 14, 15, 8, 9, 10,
++ 11, 12, 13, 14, 13, 14, 23, 8, 9, 10,
++ 11, 12, 13, 14, 10, 11, 12, 13, 14, 11,
++ 12, 13, 14, 27
++};
++
++static const short yycheck[] =
++{
++ 1, 10, 11, 4, 13, 14, 9, 8, 9, 10,
++ 11, 12, 13, 14, 3, 4, 5, 6, 7, 8,
++ 9, 0, 23, 7, 8, 9, 15, 3, 4, 5,
++ 6, 7, 8, 9, 8, 9, 12, 3, 4, 5,
++ 6, 7, 8, 9, 5, 6, 7, 8, 9, 6,
++ 7, 8, 9, 0
++};
++#define YYPURE 1
++
++/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
++#line 3 "/usr/local/share/bison/bison.simple"
++
++/* Skeleton output parser for bison,
++
++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
++ Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330,
++ Boston, MA 02111-1307, USA. */
++
++/* As a special exception, when this file is copied by Bison into a
++ Bison output file, you may use that output file without restriction.
++ This special exception was added by the Free Software Foundation
++ in version 1.24 of Bison. */
++
++/* This is the parser code that is written into each bison parser when
++ the %semantic_parser declaration is not specified in the grammar.
++ It was written by Richard Stallman by simplifying the hairy parser
++ used when %semantic_parser is specified. */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++ infringing on user name space. This should be done even for local
++ variables, as they might otherwise be expanded by user macros.
++ There are some unavoidable exceptions within include files to
++ define necessary library symbols; they are noted "INFRINGES ON
++ USER NAME SPACE" below. */
++
++#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
++
++/* The parser invokes alloca or malloc; define the necessary symbols. */
++
++# if YYSTACK_USE_ALLOCA
++# define YYSTACK_ALLOC alloca
++# else
++# ifndef YYSTACK_USE_ALLOCA
++# if defined (alloca) || defined (_ALLOCA_H)
++# define YYSTACK_ALLOC alloca
++# else
++# ifdef __GNUC__
++# define YYSTACK_ALLOC __builtin_alloca
++# endif
++# endif
++# endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++ /* Pacify GCC's `empty if-body' warning. */
++# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++# else
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++# define YYSTACK_ALLOC malloc
++# define YYSTACK_FREE free
++# endif
++#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
++
++
++#if (! defined (yyoverflow) \
++ && (! defined (__cplusplus) \
++ || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
++
++/* A type that is properly aligned for any stack member. */
++union yyalloc
++{
++ short yyss;
++ YYSTYPE yyvs;
++# if YYLSP_NEEDED
++ YYLTYPE yyls;
++# endif
++};
++
++/* The size of the maximum gap between one aligned stack and the next. */
++# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++ N elements. */
++# if YYLSP_NEEDED
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
++ + 2 * YYSTACK_GAP_MAX)
++# else
++# define YYSTACK_BYTES(N) \
++ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
++ + YYSTACK_GAP_MAX)
++# endif
++
++/* Copy COUNT objects from FROM to TO. The source and destination do
++ not overlap. */
++# ifndef YYCOPY
++# if 1 < __GNUC__
++# define YYCOPY(To, From, Count) \
++ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++# else
++# define YYCOPY(To, From, Count) \
++ do \
++ { \
++ register YYSIZE_T yyi; \
++ for (yyi = 0; yyi < (Count); yyi++) \
++ (To)[yyi] = (From)[yyi]; \
++ } \
++ while (0)
++# endif
++# endif
++
++/* Relocate STACK from its old location to the new one. The
++ local variables YYSIZE and YYSTACKSIZE give the old and new number of
++ elements in the stack, and YYPTR gives the new location of the
++ stack. Advance YYPTR to a properly aligned location for the next
++ stack. */
++# define YYSTACK_RELOCATE(Stack) \
++ do \
++ { \
++ YYSIZE_T yynewbytes; \
++ YYCOPY (&yyptr->Stack, Stack, yysize); \
++ Stack = &yyptr->Stack; \
++ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
++ yyptr += yynewbytes / sizeof (*yyptr); \
++ } \
++ while (0)
++
++#endif
++
++
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# if defined (__STDC__) || defined (__cplusplus)
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++# endif
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
++#endif
++
++#define yyerrok (yyerrstatus = 0)
++#define yyclearin (yychar = YYEMPTY)
++#define YYEMPTY -2
++#define YYEOF 0
++#define YYACCEPT goto yyacceptlab
++#define YYABORT goto yyabortlab
++#define YYERROR goto yyerrlab1
++/* Like YYERROR except do call yyerror. This remains here temporarily
++ to ease the transition to the new meaning of YYERROR, for GCC.
++ Once GCC version 2 has supplanted version 1, this can go. */
++#define YYFAIL goto yyerrlab
++#define YYRECOVERING() (!!yyerrstatus)
++#define YYBACKUP(Token, Value) \
++do \
++ if (yychar == YYEMPTY && yylen == 1) \
++ { \
++ yychar = (Token); \
++ yylval = (Value); \
++ yychar1 = YYTRANSLATE (yychar); \
++ YYPOPSTACK; \
++ goto yybackup; \
++ } \
++ else \
++ { \
++ yyerror ("syntax error: cannot back up"); \
++ YYERROR; \
++ } \
++while (0)
++
++#define YYTERROR 1
++#define YYERRCODE 256
++
++
++/* YYLLOC_DEFAULT -- Compute the default location (before the actions
++ are run).
++
++ When YYLLOC_DEFAULT is run, CURRENT is set the location of the
++ first token. By default, to implement support for ranges, extend
++ its range to the last symbol. */
++
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N) \
++ Current.last_line = Rhs[N].last_line; \
++ Current.last_column = Rhs[N].last_column;
++#endif
++
++
++/* YYLEX -- calling `yylex' with the right arguments. */
++
++#if YYPURE
++# if YYLSP_NEEDED
++# ifdef YYLEX_PARAM
++# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
++# else
++# define YYLEX yylex (&yylval, &yylloc)
++# endif
++# else /* !YYLSP_NEEDED */
++# ifdef YYLEX_PARAM
++# define YYLEX yylex (&yylval, YYLEX_PARAM)
++# else
++# define YYLEX yylex (&yylval)
++# endif
++# endif /* !YYLSP_NEEDED */
++#else /* !YYPURE */
++# define YYLEX yylex ()
++#endif /* !YYPURE */
++
++
++/* Enable debugging if requested. */
++#if YYDEBUG
++
++# ifndef YYFPRINTF
++# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++# define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args) \
++do { \
++ if (yydebug) \
++ YYFPRINTF Args; \
++} while (0)
++/* Nonzero means print parse trace. It is left uninitialized so that
++ multiple parsers can coexist. */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++#endif /* !YYDEBUG */
++
++/* YYINITDEPTH -- initial size of the parser's stacks. */
++#ifndef YYINITDEPTH
++# define YYINITDEPTH 200
++#endif
++
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++ if the built-in stack extension method is used).
++
++ Do not make this value too large; the results are undefined if
++ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++ evaluated with infinite-precision integer arithmetic. */
++
++#if YYMAXDEPTH == 0
++# undef YYMAXDEPTH
++#endif
++
++#ifndef YYMAXDEPTH
++# define YYMAXDEPTH 10000
++#endif
++
++#ifdef YYERROR_VERBOSE
++
++# ifndef yystrlen
++# if defined (__GLIBC__) && defined (_STRING_H)
++# define yystrlen strlen
++# else
++/* Return the length of YYSTR. */
++static YYSIZE_T
++# if defined (__STDC__) || defined (__cplusplus)
++yystrlen (const char *yystr)
++# else
++yystrlen (yystr)
++ const char *yystr;
++# endif
++{
++ register const char *yys = yystr;
++
++ while (*yys++ != '\0')
++ continue;
++
++ return yys - yystr - 1;
++}
++# endif
++# endif
++
++# ifndef yystpcpy
++# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
++# define yystpcpy stpcpy
++# else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++ YYDEST. */
++static char *
++# if defined (__STDC__) || defined (__cplusplus)
++yystpcpy (char *yydest, const char *yysrc)
++# else
++yystpcpy (yydest, yysrc)
++ char *yydest;
++ const char *yysrc;
++# endif
++{
++ register char *yyd = yydest;
++ register const char *yys = yysrc;
++
++ while ((*yyd++ = *yys++) != '\0')
++ continue;
++
++ return yyd - 1;
++}
++# endif
++# endif
++#endif
++
++#line 315 "/usr/local/share/bison/bison.simple"
++
++
++/* The user can define YYPARSE_PARAM as the name of an argument to be passed
++ into yyparse. The argument should have type void *.
++ It should actually point to an object.
++ Grammar actions can access the variable by casting it
++ to the proper pointer type. */
++
++#ifdef YYPARSE_PARAM
++# if defined (__STDC__) || defined (__cplusplus)
++# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
++# define YYPARSE_PARAM_DECL
++# else
++# define YYPARSE_PARAM_ARG YYPARSE_PARAM
++# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
++# endif
++#else /* !YYPARSE_PARAM */
++# define YYPARSE_PARAM_ARG
++# define YYPARSE_PARAM_DECL
++#endif /* !YYPARSE_PARAM */
++
++/* Prevent warning if -Wstrict-prototypes. */
++#ifdef __GNUC__
++# ifdef YYPARSE_PARAM
++int yyparse (void *);
++# else
++int yyparse (void);
++# endif
++#endif
++
++/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
++ variables are global, or local to YYPARSE. */
++
++#define YY_DECL_NON_LSP_VARIABLES \
++/* The lookahead symbol. */ \
++int yychar; \
++ \
++/* The semantic value of the lookahead symbol. */ \
++YYSTYPE yylval; \
++ \
++/* Number of parse errors so far. */ \
++int yynerrs;
++
++#if YYLSP_NEEDED
++# define YY_DECL_VARIABLES \
++YY_DECL_NON_LSP_VARIABLES \
++ \
++/* Location data for the lookahead symbol. */ \
++YYLTYPE yylloc;
++#else
++# define YY_DECL_VARIABLES \
++YY_DECL_NON_LSP_VARIABLES
++#endif
++
++
++/* If nonreentrant, generate the variables here. */
++
++#if !YYPURE
++YY_DECL_VARIABLES
++#endif /* !YYPURE */
++
++int
++yyparse (YYPARSE_PARAM_ARG)
++ YYPARSE_PARAM_DECL
++{
++ /* If reentrant, generate the variables here. */
++#if YYPURE
++ YY_DECL_VARIABLES
++#endif /* !YYPURE */
++
++ register int yystate;
++ register int yyn;
++ int yyresult;
++ /* Number of tokens to shift before error messages enabled. */
++ int yyerrstatus;
++ /* Lookahead token as an internal (translated) token number. */
++ int yychar1 = 0;
++
++ /* Three stacks and their tools:
++ `yyss': related to states,
++ `yyvs': related to semantic values,
++ `yyls': related to locations.
++
++ Refer to the stacks thru separate pointers, to allow yyoverflow
++ to reallocate them elsewhere. */
++
++ /* The state stack. */
++ short yyssa[YYINITDEPTH];
++ short *yyss = yyssa;
++ register short *yyssp;
++
++ /* The semantic value stack. */
++ YYSTYPE yyvsa[YYINITDEPTH];
++ YYSTYPE *yyvs = yyvsa;
++ register YYSTYPE *yyvsp;
++
++#if YYLSP_NEEDED
++ /* The location stack. */
++ YYLTYPE yylsa[YYINITDEPTH];
++ YYLTYPE *yyls = yylsa;
++ YYLTYPE *yylsp;
++#endif
++
++#if YYLSP_NEEDED
++# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
++#else
++# define YYPOPSTACK (yyvsp--, yyssp--)
++#endif
++
++ YYSIZE_T yystacksize = YYINITDEPTH;
++
++
++ /* The variables used to return semantic value and location from the
++ action routines. */
++ YYSTYPE yyval;
++#if YYLSP_NEEDED
++ YYLTYPE yyloc;
++#endif
++
++ /* When reducing, the number of symbols on the RHS of the reduced
++ rule. */
++ int yylen;
++
++ YYDPRINTF ((stderr, "Starting parse\n"));
++
++ yystate = 0;
++ yyerrstatus = 0;
++ yynerrs = 0;
++ yychar = YYEMPTY; /* Cause a token to be read. */
++
++ /* Initialize stack pointers.
++ Waste one element of value and location stack
++ so that they stay on the same level as the state stack.
++ The wasted elements are never initialized. */
++
++ yyssp = yyss;
++ yyvsp = yyvs;
++#if YYLSP_NEEDED
++ yylsp = yyls;
++#endif
++ goto yysetstate;
++
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate. |
++`------------------------------------------------------------*/
++ yynewstate:
++ /* In all cases, when you get here, the value and location stacks
++ have just been pushed. so pushing a state here evens the stacks.
++ */
++ yyssp++;
++
++ yysetstate:
++ *yyssp = yystate;
++
++ if (yyssp >= yyss + yystacksize - 1)
++ {
++ /* Get the current used size of the three stacks, in elements. */
++ YYSIZE_T yysize = yyssp - yyss + 1;
++
++#ifdef yyoverflow
++ {
++ /* Give user a chance to reallocate the stack. Use copies of
++ these so that the &'s don't force the real ones into
++ memory. */
++ YYSTYPE *yyvs1 = yyvs;
++ short *yyss1 = yyss;
++
++ /* Each stack pointer address is followed by the size of the
++ data in use in that stack, in bytes. */
++# if YYLSP_NEEDED
++ YYLTYPE *yyls1 = yyls;
++ /* This used to be a conditional around just the two extra args,
++ but that might be undefined if yyoverflow is a macro. */
++ yyoverflow ("parser stack overflow",
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++ &yyls1, yysize * sizeof (*yylsp),
++ &yystacksize);
++ yyls = yyls1;
++# else
++ yyoverflow ("parser stack overflow",
++ &yyss1, yysize * sizeof (*yyssp),
++ &yyvs1, yysize * sizeof (*yyvsp),
++ &yystacksize);
++# endif
++ yyss = yyss1;
++ yyvs = yyvs1;
++ }
++#else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++ goto yyoverflowlab;
++# else
++ /* Extend the stack our own way. */
++ if (yystacksize >= YYMAXDEPTH)
++ goto yyoverflowlab;
++ yystacksize *= 2;
++ if (yystacksize > YYMAXDEPTH)
++ yystacksize = YYMAXDEPTH;
++
++ {
++ short *yyss1 = yyss;
++ union yyalloc *yyptr =
++ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++ if (! yyptr)
++ goto yyoverflowlab;
++ YYSTACK_RELOCATE (yyss);
++ YYSTACK_RELOCATE (yyvs);
++# if YYLSP_NEEDED
++ YYSTACK_RELOCATE (yyls);
++# endif
++# undef YYSTACK_RELOCATE
++ if (yyss1 != yyssa)
++ YYSTACK_FREE (yyss1);
++ }
++# endif
++#endif /* no yyoverflow */
++
++ yyssp = yyss + yysize - 1;
++ yyvsp = yyvs + yysize - 1;
++#if YYLSP_NEEDED
++ yylsp = yyls + yysize - 1;
++#endif
++
++ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++ (unsigned long int) yystacksize));
++
++ if (yyssp >= yyss + yystacksize - 1)
++ YYABORT;
++ }
++
++ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
++
++ goto yybackup;
++
++
++/*-----------.
++| yybackup. |
++`-----------*/
++yybackup:
++
++/* Do appropriate processing given the current state. */
++/* Read a lookahead token if we need one and don't already have one. */
++/* yyresume: */
++
++ /* First try to decide what to do without reference to lookahead token. */
++
++ yyn = yypact[yystate];
++ if (yyn == YYFLAG)
++ goto yydefault;
++
++ /* Not known => get a lookahead token if don't already have one. */
++
++ /* yychar is either YYEMPTY or YYEOF
++ or a valid token in external form. */
++
++ if (yychar == YYEMPTY)
++ {
++ YYDPRINTF ((stderr, "Reading a token: "));
++ yychar = YYLEX;
++ }
++
++ /* Convert token to internal form (in yychar1) for indexing tables with */
++
++ if (yychar <= 0) /* This means end of input. */
++ {
++ yychar1 = 0;
++ yychar = YYEOF; /* Don't call YYLEX any more */
++
++ YYDPRINTF ((stderr, "Now at end of input.\n"));
++ }
++ else
++ {
++ yychar1 = YYTRANSLATE (yychar);
++
++#if YYDEBUG
++ /* We have to keep this `#if YYDEBUG', since we use variables
++ which are defined only if `YYDEBUG' is set. */
++ if (yydebug)
++ {
++ YYFPRINTF (stderr, "Next token is %d (%s",
++ yychar, yytname[yychar1]);
++ /* Give the individual parser a way to print the precise
++ meaning of a token, for further debugging info. */
++# ifdef YYPRINT
++ YYPRINT (stderr, yychar, yylval);
++# endif
++ YYFPRINTF (stderr, ")\n");
++ }
++#endif
++ }
++
++ yyn += yychar1;
++ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
++ goto yydefault;
++
++ yyn = yytable[yyn];
++
++ /* yyn is what to do for this token type in this state.
++ Negative => reduce, -yyn is rule number.
++ Positive => shift, yyn is new state.
++ New state is final state => don't bother to shift,
++ just return success.
++ 0, or most negative number => error. */
++
++ if (yyn < 0)
++ {
++ if (yyn == YYFLAG)
++ goto yyerrlab;
++ yyn = -yyn;
++ goto yyreduce;
++ }
++ else if (yyn == 0)
++ goto yyerrlab;
++
++ if (yyn == YYFINAL)
++ YYACCEPT;
++
++ /* Shift the lookahead token. */
++ YYDPRINTF ((stderr, "Shifting token %d (%s), ",
++ yychar, yytname[yychar1]));
++
++ /* Discard the token being shifted unless it is eof. */
++ if (yychar != YYEOF)
++ yychar = YYEMPTY;
++
++ *++yyvsp = yylval;
++#if YYLSP_NEEDED
++ *++yylsp = yylloc;
++#endif
++
++ /* Count tokens shifted since error; after three, turn off error
++ status. */
++ if (yyerrstatus)
++ yyerrstatus--;
++
++ yystate = yyn;
++ goto yynewstate;
++
++
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state. |
++`-----------------------------------------------------------*/
++yydefault:
++ yyn = yydefact[yystate];
++ if (yyn == 0)
++ goto yyerrlab;
++ goto yyreduce;
++
++
++/*-----------------------------.
++| yyreduce -- Do a reduction. |
++`-----------------------------*/
++yyreduce:
++ /* yyn is the number of a rule to reduce with. */
++ yylen = yyr2[yyn];
++
++ /* If YYLEN is nonzero, implement the default value of the action:
++ `$$ = $1'.
++
++ Otherwise, the following line sets YYVAL to the semantic value of
++ the lookahead token. This behavior is undocumented and Bison
++ users should not rely upon it. Assigning to YYVAL
++ unconditionally makes the parser a bit smaller, and it avoids a
++ GCC warning that YYVAL may be used uninitialized. */
++ yyval = yyvsp[1-yylen];
++
++#if YYLSP_NEEDED
++ /* Similarly for the default location. Let the user run additional
++ commands if for instance locations are ranges. */
++ yyloc = yylsp[1-yylen];
++ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
++#endif
++
++#if YYDEBUG
++ /* We have to keep this `#if YYDEBUG', since we use variables which
++ are defined only if `YYDEBUG' is set. */
++ if (yydebug)
++ {
++ int yyi;
++
++ YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
++ yyn, yyrline[yyn]);
++
++ /* Print the symbols being reduced, and their result. */
++ for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
++ YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
++ YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
++ }
++#endif
++
++ switch (yyn) {
++
++case 1:
++#line 151 "plural.y"
++{
++ if (yyvsp[0].exp == NULL)
++ YYABORT;
++ ((struct parse_args *) arg)->res = yyvsp[0].exp;
++ }
++ break;
++case 2:
++#line 159 "plural.y"
++{
++ yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 3:
++#line 163 "plural.y"
++{
++ yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 4:
++#line 167 "plural.y"
++{
++ yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 5:
++#line 171 "plural.y"
++{
++ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 6:
++#line 175 "plural.y"
++{
++ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 7:
++#line 179 "plural.y"
++{
++ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 8:
++#line 183 "plural.y"
++{
++ yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++ }
++ break;
++case 9:
++#line 187 "plural.y"
++{
++ yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
++ }
++ break;
++case 10:
++#line 191 "plural.y"
++{
++ yyval.exp = new_exp_0 (var);
++ }
++ break;
++case 11:
++#line 195 "plural.y"
++{
++ if ((yyval.exp = new_exp_0 (num)) != NULL)
++ yyval.exp->val.num = yyvsp[0].num;
++ }
++ break;
++case 12:
++#line 200 "plural.y"
++{
++ yyval.exp = yyvsp[-1].exp;
++ }
++ break;
++}
++
++#line 705 "/usr/local/share/bison/bison.simple"
++
++
++ yyvsp -= yylen;
++ yyssp -= yylen;
++#if YYLSP_NEEDED
++ yylsp -= yylen;
++#endif
++
++#if YYDEBUG
++ if (yydebug)
++ {
++ short *yyssp1 = yyss - 1;
++ YYFPRINTF (stderr, "state stack now");
++ while (yyssp1 != yyssp)
++ YYFPRINTF (stderr, " %d", *++yyssp1);
++ YYFPRINTF (stderr, "\n");
++ }
++#endif
++
++ *++yyvsp = yyval;
++#if YYLSP_NEEDED
++ *++yylsp = yyloc;
++#endif
++
++ /* Now `shift' the result of the reduction. Determine what state
++ that goes to, based on the state we popped back to and the rule
++ number reduced by. */
++
++ yyn = yyr1[yyn];
++
++ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
++ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++ yystate = yytable[yystate];
++ else
++ yystate = yydefgoto[yyn - YYNTBASE];
++
++ goto yynewstate;
++
++
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++ /* If not already recovering from an error, report this error. */
++ if (!yyerrstatus)
++ {
++ ++yynerrs;
++
++#ifdef YYERROR_VERBOSE
++ yyn = yypact[yystate];
++
++ if (yyn > YYFLAG && yyn < YYLAST)
++ {
++ YYSIZE_T yysize = 0;
++ char *yymsg;
++ int yyx, yycount;
++
++ yycount = 0;
++ /* Start YYX at -YYN if negative to avoid negative indexes in
++ YYCHECK. */
++ for (yyx = yyn < 0 ? -yyn : 0;
++ yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
++ if (yycheck[yyx + yyn] == yyx)
++ yysize += yystrlen (yytname[yyx]) + 15, yycount++;
++ yysize += yystrlen ("parse error, unexpected ") + 1;
++ yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
++ yymsg = (char *) YYSTACK_ALLOC (yysize);
++ if (yymsg != 0)
++ {
++ char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
++ yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
++
++ if (yycount < 5)
++ {
++ yycount = 0;
++ for (yyx = yyn < 0 ? -yyn : 0;
++ yyx < (int) (sizeof (yytname) / sizeof (char *));
++ yyx++)
++ if (yycheck[yyx + yyn] == yyx)
++ {
++ const char *yyq = ! yycount ? ", expecting " : " or ";
++ yyp = yystpcpy (yyp, yyq);
++ yyp = yystpcpy (yyp, yytname[yyx]);
++ yycount++;
++ }
++ }
++ yyerror (yymsg);
++ YYSTACK_FREE (yymsg);
++ }
++ else
++ yyerror ("parse error; also virtual memory exhausted");
++ }
++ else
++#endif /* defined (YYERROR_VERBOSE) */
++ yyerror ("parse error");
++ }
++ goto yyerrlab1;
++
++
++/*--------------------------------------------------.
++| yyerrlab1 -- error raised explicitly by an action |
++`--------------------------------------------------*/
++yyerrlab1:
++ if (yyerrstatus == 3)
++ {
++ /* If just tried and failed to reuse lookahead token after an
++ error, discard it. */
++
++ /* return failure if at end of input */
++ if (yychar == YYEOF)
++ YYABORT;
++ YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
++ yychar, yytname[yychar1]));
++ yychar = YYEMPTY;
++ }
++
++ /* Else will try to reuse lookahead token after shifting the error
++ token. */
++
++ yyerrstatus = 3; /* Each real token shifted decrements this */
++
++ goto yyerrhandle;
++
++
++/*-------------------------------------------------------------------.
++| yyerrdefault -- current state does not do anything special for the |
++| error token. |
++`-------------------------------------------------------------------*/
++yyerrdefault:
++#if 0
++ /* This is wrong; only states that explicitly want error tokens
++ should shift them. */
++
++ /* If its default is to accept any token, ok. Otherwise pop it. */
++ yyn = yydefact[yystate];
++ if (yyn)
++ goto yydefault;
++#endif
++
++
++/*---------------------------------------------------------------.
++| yyerrpop -- pop the current state because it cannot handle the |
++| error token |
++`---------------------------------------------------------------*/
++yyerrpop:
++ if (yyssp == yyss)
++ YYABORT;
++ yyvsp--;
++ yystate = *--yyssp;
++#if YYLSP_NEEDED
++ yylsp--;
++#endif
++
++#if YYDEBUG
++ if (yydebug)
++ {
++ short *yyssp1 = yyss - 1;
++ YYFPRINTF (stderr, "Error: state stack now");
++ while (yyssp1 != yyssp)
++ YYFPRINTF (stderr, " %d", *++yyssp1);
++ YYFPRINTF (stderr, "\n");
++ }
++#endif
++
++/*--------------.
++| yyerrhandle. |
++`--------------*/
++yyerrhandle:
++ yyn = yypact[yystate];
++ if (yyn == YYFLAG)
++ goto yyerrdefault;
++
++ yyn += YYTERROR;
++ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
++ goto yyerrdefault;
++
++ yyn = yytable[yyn];
++ if (yyn < 0)
++ {
++ if (yyn == YYFLAG)
++ goto yyerrpop;
++ yyn = -yyn;
++ goto yyreduce;
++ }
++ else if (yyn == 0)
++ goto yyerrpop;
++
++ if (yyn == YYFINAL)
++ YYACCEPT;
++
++ YYDPRINTF ((stderr, "Shifting error token, "));
++
++ *++yyvsp = yylval;
++#if YYLSP_NEEDED
++ *++yylsp = yylloc;
++#endif
++
++ yystate = yyn;
++ goto yynewstate;
++
++
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here. |
++`-------------------------------------*/
++yyacceptlab:
++ yyresult = 0;
++ goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here. |
++`-----------------------------------*/
++yyabortlab:
++ yyresult = 1;
++ goto yyreturn;
++
++/*---------------------------------------------.
++| yyoverflowab -- parser overflow comes here. |
++`---------------------------------------------*/
++yyoverflowlab:
++ yyerror ("parser stack overflow");
++ yyresult = 2;
++ /* Fall through. */
++
++yyreturn:
++#ifndef yyoverflow
++ if (yyss != yyssa)
++ YYSTACK_FREE (yyss);
++#endif
++ return yyresult;
++}
++#line 205 "plural.y"
++
++
++void
++internal_function
++FREE_EXPRESSION (struct expression *exp)
++{
++ if (exp == NULL)
++ return;
++
++ /* Handle the recursive case. */
++ switch (exp->nargs)
++ {
++ case 3:
++ FREE_EXPRESSION (exp->val.args[2]);
++ /* FALLTHROUGH */
++ case 2:
++ FREE_EXPRESSION (exp->val.args[1]);
++ /* FALLTHROUGH */
++ case 1:
++ FREE_EXPRESSION (exp->val.args[0]);
++ /* FALLTHROUGH */
++ default:
++ break;
++ }
++
++ free (exp);
++}
++
++
++static int
++yylex (YYSTYPE *lval, const char **pexp)
++{
++ const char *exp = *pexp;
++ int result;
++
++ while (1)
++ {
++ if (exp[0] == '\0')
++ {
++ *pexp = exp;
++ return YYEOF;
++ }
++
++ if (exp[0] != ' ' && exp[0] != '\t')
++ break;
++
++ ++exp;
++ }
++
++ result = *exp++;
++ switch (result)
++ {
++ case '0': case '1': case '2': case '3': case '4':
++ case '5': case '6': case '7': case '8': case '9':
++ {
++ unsigned long int n = result - '0';
++ while (exp[0] >= '0' && exp[0] <= '9')
++ {
++ n *= 10;
++ n += exp[0] - '0';
++ ++exp;
++ }
++ lval->num = n;
++ result = NUMBER;
++ }
++ break;
++
++ case '=':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = equal;
++ result = EQUOP2;
++ }
++ else
++ result = YYERRCODE;
++ break;
++
++ case '!':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = not_equal;
++ result = EQUOP2;
++ }
++ break;
++
++ case '&':
++ case '|':
++ if (exp[0] == result)
++ ++exp;
++ else
++ result = YYERRCODE;
++ break;
++
++ case '<':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = less_or_equal;
++ }
++ else
++ lval->op = less_than;
++ result = CMPOP2;
++ break;
++
++ case '>':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = greater_or_equal;
++ }
++ else
++ lval->op = greater_than;
++ result = CMPOP2;
++ break;
++
++ case '*':
++ lval->op = mult;
++ result = MULOP2;
++ break;
++
++ case '/':
++ lval->op = divide;
++ result = MULOP2;
++ break;
++
++ case '%':
++ lval->op = module;
++ result = MULOP2;
++ break;
++
++ case '+':
++ lval->op = plus;
++ result = ADDOP2;
++ break;
++
++ case '-':
++ lval->op = minus;
++ result = ADDOP2;
++ break;
++
++ case 'n':
++ case '?':
++ case ':':
++ case '(':
++ case ')':
++ /* Nothing, just return the character. */
++ break;
++
++ case ';':
++ case '\n':
++ case '\0':
++ /* Be safe and let the user call this function again. */
++ --exp;
++ result = YYEOF;
++ break;
++
++ default:
++ result = YYERRCODE;
++#if YYDEBUG != 0
++ --exp;
++#endif
++ break;
++ }
++
++ *pexp = exp;
++
++ return result;
++}
++
++
++static void
++yyerror (const char *str)
++{
++ /* Do nothing. We don't print error messages here. */
++}
+--- lrzsz-0.12.20.safe/intl/plural-exp.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural-exp.c 2004-09-12 14:40:34.578714192 -0400
+@@ -0,0 +1,154 @@
++/* Expression parsing for plural form selection.
++ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "plural-exp.h"
++
++#if (defined __GNUC__ && !defined __APPLE_CC__) \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
++
++/* These structs are the constant expression for the germanic plural
++ form determination. It represents the expression "n != 1". */
++static const struct expression plvar =
++{
++ .nargs = 0,
++ .operation = var,
++};
++static const struct expression plone =
++{
++ .nargs = 0,
++ .operation = num,
++ .val =
++ {
++ .num = 1
++ }
++};
++struct expression GERMANIC_PLURAL =
++{
++ .nargs = 2,
++ .operation = not_equal,
++ .val =
++ {
++ .args =
++ {
++ [0] = (struct expression *) &plvar,
++ [1] = (struct expression *) &plone
++ }
++ }
++};
++
++# define INIT_GERMANIC_PLURAL()
++
++#else
++
++/* For compilers without support for ISO C 99 struct/union initializers:
++ Initialization at run-time. */
++
++static struct expression plvar;
++static struct expression plone;
++struct expression GERMANIC_PLURAL;
++
++static void
++init_germanic_plural ()
++{
++ if (plone.val.num == 0)
++ {
++ plvar.nargs = 0;
++ plvar.operation = var;
++
++ plone.nargs = 0;
++ plone.operation = num;
++ plone.val.num = 1;
++
++ GERMANIC_PLURAL.nargs = 2;
++ GERMANIC_PLURAL.operation = not_equal;
++ GERMANIC_PLURAL.val.args[0] = &plvar;
++ GERMANIC_PLURAL.val.args[1] = &plone;
++ }
++}
++
++# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
++
++#endif
++
++void
++internal_function
++EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp,
++ unsigned long int *npluralsp)
++{
++ if (nullentry != NULL)
++ {
++ const char *plural;
++ const char *nplurals;
++
++ plural = strstr (nullentry, "plural=");
++ nplurals = strstr (nullentry, "nplurals=");
++ if (plural == NULL || nplurals == NULL)
++ goto no_plural;
++ else
++ {
++ char *endp;
++ unsigned long int n;
++ struct parse_args args;
++
++ /* First get the number. */
++ nplurals += 9;
++ while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
++ ++nplurals;
++ if (!(*nplurals >= '0' && *nplurals <= '9'))
++ goto no_plural;
++#if defined HAVE_STRTOUL || defined _LIBC
++ n = strtoul (nplurals, &endp, 10);
++#else
++ for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
++ n = n * 10 + (*endp - '0');
++#endif
++ if (nplurals == endp)
++ goto no_plural;
++ *npluralsp = n;
++
++ /* Due to the restrictions bison imposes onto the interface of the
++ scanner function we have to put the input string and the result
++ passed up from the parser into the same structure which address
++ is passed down to the parser. */
++ plural += 7;
++ args.cp = plural;
++ if (PLURAL_PARSE (&args) != 0)
++ goto no_plural;
++ *pluralp = args.res;
++ }
++ }
++ else
++ {
++ /* By default we are using the Germanic form: singular form only
++ for `one', the plural form otherwise. Yes, this is also what
++ English is using since English is a Germanic language. */
++ no_plural:
++ INIT_GERMANIC_PLURAL ();
++ *pluralp = &GERMANIC_PLURAL;
++ *npluralsp = 2;
++ }
++}
+--- lrzsz-0.12.20.safe/intl/plural-exp.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural-exp.h 2004-09-12 14:40:34.584713280 -0400
+@@ -0,0 +1,118 @@
++/* Expression parsing and evaluation for plural form selection.
++ Copyright (C) 2000-2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _PLURAL_EXP_H
++#define _PLURAL_EXP_H
++
++#ifndef internal_function
++# define internal_function
++#endif
++
++#ifndef attribute_hidden
++# define attribute_hidden
++#endif
++
++
++/* This is the representation of the expressions to determine the
++ plural form. */
++struct expression
++{
++ int nargs; /* Number of arguments. */
++ enum operator
++ {
++ /* Without arguments: */
++ var, /* The variable "n". */
++ num, /* Decimal number. */
++ /* Unary operators: */
++ lnot, /* Logical NOT. */
++ /* Binary operators: */
++ mult, /* Multiplication. */
++ divide, /* Division. */
++ module, /* Modulo operation. */
++ plus, /* Addition. */
++ minus, /* Subtraction. */
++ less_than, /* Comparison. */
++ greater_than, /* Comparison. */
++ less_or_equal, /* Comparison. */
++ greater_or_equal, /* Comparison. */
++ equal, /* Comparison for equality. */
++ not_equal, /* Comparison for inequality. */
++ land, /* Logical AND. */
++ lor, /* Logical OR. */
++ /* Ternary operators: */
++ qmop /* Question mark operator. */
++ } operation;
++ union
++ {
++ unsigned long int num; /* Number value for `num'. */
++ struct expression *args[3]; /* Up to three arguments. */
++ } val;
++};
++
++/* This is the data structure to pass information to the parser and get
++ the result in a thread-safe way. */
++struct parse_args
++{
++ const char *cp;
++ struct expression *res;
++};
++
++
++/* Names for the libintl functions are a problem. This source code is used
++ 1. in the GNU C Library library,
++ 2. in the GNU libintl library,
++ 3. in the GNU gettext tools.
++ The function names in each situation must be different, to allow for
++ binary incompatible changes in 'struct expression'. Furthermore,
++ 1. in the GNU C Library library, the names have a __ prefix,
++ 2.+3. in the GNU libintl library and in the GNU gettext tools, the names
++ must follow ANSI C and not start with __.
++ So we have to distinguish the three cases. */
++#ifdef _LIBC
++# define FREE_EXPRESSION __gettext_free_exp
++# define PLURAL_PARSE __gettextparse
++# define GERMANIC_PLURAL __gettext_germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
++#elif defined (IN_LIBINTL)
++# define FREE_EXPRESSION libintl_gettext_free_exp
++# define PLURAL_PARSE libintl_gettextparse
++# define GERMANIC_PLURAL libintl_gettext_germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
++#else
++# define FREE_EXPRESSION free_plural_expression
++# define PLURAL_PARSE parse_plural_expression
++# define GERMANIC_PLURAL germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
++#endif
++
++extern void FREE_EXPRESSION (struct expression *exp)
++ internal_function;
++extern int PLURAL_PARSE (void *arg);
++extern struct expression GERMANIC_PLURAL attribute_hidden;
++extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
++ struct expression **pluralp,
++ unsigned long int *npluralsp)
++ internal_function;
++
++#if !defined (_LIBC) && !defined (IN_LIBINTL)
++extern unsigned long int plural_eval (struct expression *pexp,
++ unsigned long int n);
++#endif
++
++#endif /* _PLURAL_EXP_H */
+--- lrzsz-0.12.20.safe/intl/plural.y 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural.y 2004-09-12 14:40:34.589712520 -0400
+@@ -0,0 +1,381 @@
++%{
++/* Expression parsing for plural form selection.
++ Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++ Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* The bison generated parser uses alloca. AIX 3 forces us to put this
++ declaration at the beginning of the file. The declaration in bison's
++ skeleton file comes too late. This must come before <config.h>
++ because <config.h> may include arbitrary system headers. */
++#if defined _AIX && !defined __GNUC__
++ #pragma alloca
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include "plural-exp.h"
++
++/* The main function generated by the parser is called __gettextparse,
++ but we want it to be called PLURAL_PARSE. */
++#ifndef _LIBC
++# define __gettextparse PLURAL_PARSE
++#endif
++
++#define YYLEX_PARAM &((struct parse_args *) arg)->cp
++#define YYPARSE_PARAM arg
++%}
++%pure_parser
++%expect 7
++
++%union {
++ unsigned long int num;
++ enum operator op;
++ struct expression *exp;
++}
++
++%{
++/* Prototypes for local functions. */
++static int yylex (YYSTYPE *lval, const char **pexp);
++static void yyerror (const char *str);
++
++/* Allocation of expressions. */
++
++static struct expression *
++new_exp (int nargs, enum operator op, struct expression * const *args)
++{
++ int i;
++ struct expression *newp;
++
++ /* If any of the argument could not be malloc'ed, just return NULL. */
++ for (i = nargs - 1; i >= 0; i--)
++ if (args[i] == NULL)
++ goto fail;
++
++ /* Allocate a new expression. */
++ newp = (struct expression *) malloc (sizeof (*newp));
++ if (newp != NULL)
++ {
++ newp->nargs = nargs;
++ newp->operation = op;
++ for (i = nargs - 1; i >= 0; i--)
++ newp->val.args[i] = args[i];
++ return newp;
++ }
++
++ fail:
++ for (i = nargs - 1; i >= 0; i--)
++ FREE_EXPRESSION (args[i]);
++
++ return NULL;
++}
++
++static inline struct expression *
++new_exp_0 (enum operator op)
++{
++ return new_exp (0, op, NULL);
++}
++
++static inline struct expression *
++new_exp_1 (enum operator op, struct expression *right)
++{
++ struct expression *args[1];
++
++ args[0] = right;
++ return new_exp (1, op, args);
++}
++
++static struct expression *
++new_exp_2 (enum operator op, struct expression *left, struct expression *right)
++{
++ struct expression *args[2];
++
++ args[0] = left;
++ args[1] = right;
++ return new_exp (2, op, args);
++}
++
++static inline struct expression *
++new_exp_3 (enum operator op, struct expression *bexp,
++ struct expression *tbranch, struct expression *fbranch)
++{
++ struct expression *args[3];
++
++ args[0] = bexp;
++ args[1] = tbranch;
++ args[2] = fbranch;
++ return new_exp (3, op, args);
++}
++
++%}
++
++/* This declares that all operators have the same associativity and the
++ precedence order as in C. See [Harbison, Steele: C, A Reference Manual].
++ There is no unary minus and no bitwise operators.
++ Operators with the same syntactic behaviour have been merged into a single
++ token, to save space in the array generated by bison. */
++%right '?' /* ? */
++%left '|' /* || */
++%left '&' /* && */
++%left EQUOP2 /* == != */
++%left CMPOP2 /* < > <= >= */
++%left ADDOP2 /* + - */
++%left MULOP2 /* * / % */
++%right '!' /* ! */
++
++%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
++%token <num> NUMBER
++%type <exp> exp
++
++%%
++
++start: exp
++ {
++ if ($1 == NULL)
++ YYABORT;
++ ((struct parse_args *) arg)->res = $1;
++ }
++ ;
++
++exp: exp '?' exp ':' exp
++ {
++ $$ = new_exp_3 (qmop, $1, $3, $5);
++ }
++ | exp '|' exp
++ {
++ $$ = new_exp_2 (lor, $1, $3);
++ }
++ | exp '&' exp
++ {
++ $$ = new_exp_2 (land, $1, $3);
++ }
++ | exp EQUOP2 exp
++ {
++ $$ = new_exp_2 ($2, $1, $3);
++ }
++ | exp CMPOP2 exp
++ {
++ $$ = new_exp_2 ($2, $1, $3);
++ }
++ | exp ADDOP2 exp
++ {
++ $$ = new_exp_2 ($2, $1, $3);
++ }
++ | exp MULOP2 exp
++ {
++ $$ = new_exp_2 ($2, $1, $3);
++ }
++ | '!' exp
++ {
++ $$ = new_exp_1 (lnot, $2);
++ }
++ | 'n'
++ {
++ $$ = new_exp_0 (var);
++ }
++ | NUMBER
++ {
++ if (($$ = new_exp_0 (num)) != NULL)
++ $$->val.num = $1;
++ }
++ | '(' exp ')'
++ {
++ $$ = $2;
++ }
++ ;
++
++%%
++
++void
++internal_function
++FREE_EXPRESSION (struct expression *exp)
++{
++ if (exp == NULL)
++ return;
++
++ /* Handle the recursive case. */
++ switch (exp->nargs)
++ {
++ case 3:
++ FREE_EXPRESSION (exp->val.args[2]);
++ /* FALLTHROUGH */
++ case 2:
++ FREE_EXPRESSION (exp->val.args[1]);
++ /* FALLTHROUGH */
++ case 1:
++ FREE_EXPRESSION (exp->val.args[0]);
++ /* FALLTHROUGH */
++ default:
++ break;
++ }
++
++ free (exp);
++}
++
++
++static int
++yylex (YYSTYPE *lval, const char **pexp)
++{
++ const char *exp = *pexp;
++ int result;
++
++ while (1)
++ {
++ if (exp[0] == '\0')
++ {
++ *pexp = exp;
++ return YYEOF;
++ }
++
++ if (exp[0] != ' ' && exp[0] != '\t')
++ break;
++
++ ++exp;
++ }
++
++ result = *exp++;
++ switch (result)
++ {
++ case '0': case '1': case '2': case '3': case '4':
++ case '5': case '6': case '7': case '8': case '9':
++ {
++ unsigned long int n = result - '0';
++ while (exp[0] >= '0' && exp[0] <= '9')
++ {
++ n *= 10;
++ n += exp[0] - '0';
++ ++exp;
++ }
++ lval->num = n;
++ result = NUMBER;
++ }
++ break;
++
++ case '=':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = equal;
++ result = EQUOP2;
++ }
++ else
++ result = YYERRCODE;
++ break;
++
++ case '!':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = not_equal;
++ result = EQUOP2;
++ }
++ break;
++
++ case '&':
++ case '|':
++ if (exp[0] == result)
++ ++exp;
++ else
++ result = YYERRCODE;
++ break;
++
++ case '<':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = less_or_equal;
++ }
++ else
++ lval->op = less_than;
++ result = CMPOP2;
++ break;
++
++ case '>':
++ if (exp[0] == '=')
++ {
++ ++exp;
++ lval->op = greater_or_equal;
++ }
++ else
++ lval->op = greater_than;
++ result = CMPOP2;
++ break;
++
++ case '*':
++ lval->op = mult;
++ result = MULOP2;
++ break;
++
++ case '/':
++ lval->op = divide;
++ result = MULOP2;
++ break;
++
++ case '%':
++ lval->op = module;
++ result = MULOP2;
++ break;
++
++ case '+':
++ lval->op = plus;
++ result = ADDOP2;
++ break;
++
++ case '-':
++ lval->op = minus;
++ result = ADDOP2;
++ break;
++
++ case 'n':
++ case '?':
++ case ':':
++ case '(':
++ case ')':
++ /* Nothing, just return the character. */
++ break;
++
++ case ';':
++ case '\n':
++ case '\0':
++ /* Be safe and let the user call this function again. */
++ --exp;
++ result = YYEOF;
++ break;
++
++ default:
++ result = YYERRCODE;
++#if YYDEBUG != 0
++ --exp;
++#endif
++ break;
++ }
++
++ *pexp = exp;
++
++ return result;
++}
++
++
++static void
++yyerror (const char *str)
++{
++ /* Do nothing. We don't print error messages here. */
++}
+--- lrzsz-0.12.20.safe/intl/po2tbl.sed.in 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/po2tbl.sed.in 1969-12-31 19:00:00.000000000 -0500
+@@ -1,102 +0,0 @@
+-# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-1 {
+- i\
+-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
+-\
+-#if HAVE_CONFIG_H\
+-# include <config.h>\
+-#endif\
+-\
+-#include "libgettext.h"\
+-\
+-const struct _msg_ent _msg_tbl[] = {
+- h
+- s/.*/0/
+- x
+-}
+-#
+-# Write msgid entries in C array form.
+-#
+-/^msgid/ {
+- s/msgid[ ]*\(".*"\)/ {\1/
+- tb
+-# Append the next line
+- :b
+- N
+-# Look whether second part is continuation line.
+- s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+-# Yes, then branch.
+- ta
+-# Because we assume that the input file correctly formed the line
+-# just read cannot be again be a msgid line. So it's safe to ignore
+-# it.
+- s/\(.*\)\n.*/\1/
+- bc
+-# We found a continuation line. But before printing insert '\'.
+- :a
+- s/\(.*\)\(\n.*\)/\1\\\2/
+- P
+-# We cannot use D here.
+- s/.*\n\(.*\)/\1/
+-# Some buggy seds do not clear the `successful substitution since last ``t'''
+-# flag on `N', so we do a `t' here to clear it.
+- tb
+-# Not reached
+- :c
+- x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+- td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+- :d
+- s/9\(_*\)$/_\1/
+- td
+-# Assure at least one digit is available.
+- s/^\(_*\)$/0\1/
+-# Increment the last digit.
+- s/8\(_*\)$/9\1/
+- s/7\(_*\)$/8\1/
+- s/6\(_*\)$/7\1/
+- s/5\(_*\)$/6\1/
+- s/4\(_*\)$/5\1/
+- s/3\(_*\)$/4\1/
+- s/2\(_*\)$/3\1/
+- s/1\(_*\)$/2\1/
+- s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+- s/_/0/g
+- x
+- G
+- s/\(.*\)\n\([0-9]*\)/\1, \2},/
+- s/\(.*\)"$/\1/
+- p
+-}
+-#
+-# Last line.
+-#
+-$ {
+- i\
+-};\
+-
+- g
+- s/0*\(.*\)/int _msg_tbl_length = \1;/p
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/printf-args.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-args.c 2004-09-12 14:40:34.595711608 -0400
+@@ -0,0 +1,119 @@
++/* Decomposed printf argument list.
++ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification. */
++#include "printf-args.h"
++
++#ifdef STATIC
++STATIC
++#endif
++int
++printf_fetchargs (va_list args, arguments *a)
++{
++ size_t i;
++ argument *ap;
++
++ for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
++ switch (ap->type)
++ {
++ case TYPE_SCHAR:
++ ap->a.a_schar = va_arg (args, /*signed char*/ int);
++ break;
++ case TYPE_UCHAR:
++ ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
++ break;
++ case TYPE_SHORT:
++ ap->a.a_short = va_arg (args, /*short*/ int);
++ break;
++ case TYPE_USHORT:
++ ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
++ break;
++ case TYPE_INT:
++ ap->a.a_int = va_arg (args, int);
++ break;
++ case TYPE_UINT:
++ ap->a.a_uint = va_arg (args, unsigned int);
++ break;
++ case TYPE_LONGINT:
++ ap->a.a_longint = va_arg (args, long int);
++ break;
++ case TYPE_ULONGINT:
++ ap->a.a_ulongint = va_arg (args, unsigned long int);
++ break;
++#ifdef HAVE_LONG_LONG
++ case TYPE_LONGLONGINT:
++ ap->a.a_longlongint = va_arg (args, long long int);
++ break;
++ case TYPE_ULONGLONGINT:
++ ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
++ break;
++#endif
++ case TYPE_DOUBLE:
++ ap->a.a_double = va_arg (args, double);
++ break;
++#ifdef HAVE_LONG_DOUBLE
++ case TYPE_LONGDOUBLE:
++ ap->a.a_longdouble = va_arg (args, long double);
++ break;
++#endif
++ case TYPE_CHAR:
++ ap->a.a_char = va_arg (args, int);
++ break;
++#ifdef HAVE_WINT_T
++ case TYPE_WIDE_CHAR:
++ ap->a.a_wide_char = va_arg (args, wint_t);
++ break;
++#endif
++ case TYPE_STRING:
++ ap->a.a_string = va_arg (args, const char *);
++ break;
++#ifdef HAVE_WCHAR_T
++ case TYPE_WIDE_STRING:
++ ap->a.a_wide_string = va_arg (args, const wchar_t *);
++ break;
++#endif
++ case TYPE_POINTER:
++ ap->a.a_pointer = va_arg (args, void *);
++ break;
++ case TYPE_COUNT_SCHAR_POINTER:
++ ap->a.a_count_schar_pointer = va_arg (args, signed char *);
++ break;
++ case TYPE_COUNT_SHORT_POINTER:
++ ap->a.a_count_short_pointer = va_arg (args, short *);
++ break;
++ case TYPE_COUNT_INT_POINTER:
++ ap->a.a_count_int_pointer = va_arg (args, int *);
++ break;
++ case TYPE_COUNT_LONGINT_POINTER:
++ ap->a.a_count_longint_pointer = va_arg (args, long int *);
++ break;
++#ifdef HAVE_LONG_LONG
++ case TYPE_COUNT_LONGLONGINT_POINTER:
++ ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
++ break;
++#endif
++ default:
++ /* Unknown type. */
++ return -1;
++ }
++ return 0;
++}
+--- lrzsz-0.12.20.safe/intl/printf-args.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-args.h 2004-09-12 14:40:34.601710696 -0400
+@@ -0,0 +1,137 @@
++/* Decomposed printf argument list.
++ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _PRINTF_ARGS_H
++#define _PRINTF_ARGS_H
++
++/* Get size_t. */
++#include <stddef.h>
++
++/* Get wchar_t. */
++#ifdef HAVE_WCHAR_T
++# include <stddef.h>
++#endif
++
++/* Get wint_t. */
++#ifdef HAVE_WINT_T
++# include <wchar.h>
++#endif
++
++/* Get va_list. */
++#include <stdarg.h>
++
++
++/* Argument types */
++typedef enum
++{
++ TYPE_NONE,
++ TYPE_SCHAR,
++ TYPE_UCHAR,
++ TYPE_SHORT,
++ TYPE_USHORT,
++ TYPE_INT,
++ TYPE_UINT,
++ TYPE_LONGINT,
++ TYPE_ULONGINT,
++#ifdef HAVE_LONG_LONG
++ TYPE_LONGLONGINT,
++ TYPE_ULONGLONGINT,
++#endif
++ TYPE_DOUBLE,
++#ifdef HAVE_LONG_DOUBLE
++ TYPE_LONGDOUBLE,
++#endif
++ TYPE_CHAR,
++#ifdef HAVE_WINT_T
++ TYPE_WIDE_CHAR,
++#endif
++ TYPE_STRING,
++#ifdef HAVE_WCHAR_T
++ TYPE_WIDE_STRING,
++#endif
++ TYPE_POINTER,
++ TYPE_COUNT_SCHAR_POINTER,
++ TYPE_COUNT_SHORT_POINTER,
++ TYPE_COUNT_INT_POINTER,
++ TYPE_COUNT_LONGINT_POINTER
++#ifdef HAVE_LONG_LONG
++, TYPE_COUNT_LONGLONGINT_POINTER
++#endif
++} arg_type;
++
++/* Polymorphic argument */
++typedef struct
++{
++ arg_type type;
++ union
++ {
++ signed char a_schar;
++ unsigned char a_uchar;
++ short a_short;
++ unsigned short a_ushort;
++ int a_int;
++ unsigned int a_uint;
++ long int a_longint;
++ unsigned long int a_ulongint;
++#ifdef HAVE_LONG_LONG
++ long long int a_longlongint;
++ unsigned long long int a_ulonglongint;
++#endif
++ float a_float;
++ double a_double;
++#ifdef HAVE_LONG_DOUBLE
++ long double a_longdouble;
++#endif
++ int a_char;
++#ifdef HAVE_WINT_T
++ wint_t a_wide_char;
++#endif
++ const char* a_string;
++#ifdef HAVE_WCHAR_T
++ const wchar_t* a_wide_string;
++#endif
++ void* a_pointer;
++ signed char * a_count_schar_pointer;
++ short * a_count_short_pointer;
++ int * a_count_int_pointer;
++ long int * a_count_longint_pointer;
++#ifdef HAVE_LONG_LONG
++ long long int * a_count_longlongint_pointer;
++#endif
++ }
++ a;
++}
++argument;
++
++typedef struct
++{
++ size_t count;
++ argument *arg;
++}
++arguments;
++
++
++/* Fetch the arguments, putting them into a. */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int printf_fetchargs (va_list args, arguments *a);
++
++#endif /* _PRINTF_ARGS_H */
+--- lrzsz-0.12.20.safe/intl/printf.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf.c 2004-09-12 14:40:34.607709784 -0400
+@@ -0,0 +1,371 @@
++/* Formatted output to strings, using POSIX/XSI format strings with positions.
++ Copyright (C) 2003 Free Software Foundation, Inc.
++ Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++# include <malloc.h>
++# define alloca _alloca
++# else
++# if defined HAVE_ALLOCA_H || defined _LIBC
++# include <alloca.h>
++# else
++# ifdef _AIX
++ #pragma alloca
++# else
++# ifndef alloca
++char *alloca ();
++# endif
++# endif
++# endif
++# endif
++#endif
++
++#include <stdio.h>
++
++#if !HAVE_POSIX_PRINTF
++
++#include <stdlib.h>
++#include <string.h>
++
++/* When building a DLL, we must export some functions. Note that because
++ the functions are only defined for binary backward compatibility, we
++ don't need to use __declspec(dllimport) in any case. */
++#if defined _MSC_VER && BUILDING_DLL
++# define DLL_EXPORTED __declspec(dllexport)
++#else
++# define DLL_EXPORTED
++#endif
++
++#define STATIC static
++
++/* Define auxiliary functions declared in "printf-args.h". */
++#include "printf-args.c"
++
++/* Define auxiliary functions declared in "printf-parse.h". */
++#include "printf-parse.c"
++
++/* Define functions declared in "vasnprintf.h". */
++#define vasnprintf libintl_vasnprintf
++#include "vasnprintf.c"
++#if 0 /* not needed */
++#define asnprintf libintl_asnprintf
++#include "asnprintf.c"
++#endif
++
++DLL_EXPORTED
++int
++libintl_vfprintf (FILE *stream, const char *format, va_list args)
++{
++ if (strchr (format, '$') == NULL)
++ return vfprintf (stream, format, args);
++ else
++ {
++ size_t length;
++ char *result = libintl_vasnprintf (NULL, &length, format, args);
++ int retval = -1;
++ if (result != NULL)
++ {
++ if (fwrite (result, 1, length, stream) == length)
++ retval = length;
++ free (result);
++ }
++ return retval;
++ }
++}
++
++DLL_EXPORTED
++int
++libintl_fprintf (FILE *stream, const char *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vfprintf (stream, format, args);
++ va_end (args);
++ return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vprintf (const char *format, va_list args)
++{
++ return libintl_vfprintf (stdout, format, args);
++}
++
++DLL_EXPORTED
++int
++libintl_printf (const char *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vprintf (format, args);
++ va_end (args);
++ return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vsprintf (char *resultbuf, const char *format, va_list args)
++{
++ if (strchr (format, '$') == NULL)
++ return vsprintf (resultbuf, format, args);
++ else
++ {
++ size_t length = (size_t) ~0 / (4 * sizeof (char));
++ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
++ if (result != resultbuf)
++ {
++ free (result);
++ return -1;
++ }
++ else
++ return length;
++ }
++}
++
++DLL_EXPORTED
++int
++libintl_sprintf (char *resultbuf, const char *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vsprintf (resultbuf, format, args);
++ va_end (args);
++ return retval;
++}
++
++#if HAVE_SNPRINTF
++
++# if HAVE_DECL__SNPRINTF
++ /* Windows. */
++# define system_vsnprintf _vsnprintf
++# else
++ /* Unix. */
++# define system_vsnprintf vsnprintf
++# endif
++
++DLL_EXPORTED
++int
++libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args)
++{
++ if (strchr (format, '$') == NULL)
++ return system_vsnprintf (resultbuf, length, format, args);
++ else
++ {
++ size_t maxlength = length;
++ char *result = libintl_vasnprintf (resultbuf, &length, format, args);
++ if (result != resultbuf)
++ {
++ if (maxlength > 0)
++ {
++ if (length < maxlength)
++ abort ();
++ memcpy (resultbuf, result, maxlength - 1);
++ resultbuf[maxlength - 1] = '\0';
++ }
++ free (result);
++ return -1;
++ }
++ else
++ return length;
++ }
++}
++
++DLL_EXPORTED
++int
++libintl_snprintf (char *resultbuf, size_t length, const char *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vsnprintf (resultbuf, length, format, args);
++ va_end (args);
++ return retval;
++}
++
++#endif
++
++#if HAVE_ASPRINTF
++
++DLL_EXPORTED
++int
++libintl_vasprintf (char **resultp, const char *format, va_list args)
++{
++ size_t length;
++ char *result = libintl_vasnprintf (NULL, &length, format, args);
++ if (result == NULL)
++ return -1;
++ *resultp = result;
++ return length;
++}
++
++DLL_EXPORTED
++int
++libintl_asprintf (char **resultp, const char *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vasprintf (resultp, format, args);
++ va_end (args);
++ return retval;
++}
++
++#endif
++
++#if HAVE_FWPRINTF
++
++#include <wchar.h>
++
++#define WIDE_CHAR_VERSION 1
++
++/* Define auxiliary functions declared in "wprintf-parse.h". */
++#include "printf-parse.c"
++
++/* Define functions declared in "vasnprintf.h". */
++#define vasnwprintf libintl_vasnwprintf
++#include "vasnprintf.c"
++#if 0 /* not needed */
++#define asnwprintf libintl_asnwprintf
++#include "asnprintf.c"
++#endif
++
++# if HAVE_DECL__SNWPRINTF
++ /* Windows. */
++# define system_vswprintf _vsnwprintf
++# else
++ /* Unix. */
++# define system_vswprintf vswprintf
++# endif
++
++DLL_EXPORTED
++int
++libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
++{
++ if (wcschr (format, '$') == NULL)
++ return vfwprintf (stream, format, args);
++ else
++ {
++ size_t length;
++ wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
++ int retval = -1;
++ if (result != NULL)
++ {
++ size_t i;
++ for (i = 0; i < length; i++)
++ if (fputwc (result[i], stream) == WEOF)
++ break;
++ if (i == length)
++ retval = length;
++ free (result);
++ }
++ return retval;
++ }
++}
++
++DLL_EXPORTED
++int
++libintl_fwprintf (FILE *stream, const wchar_t *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vfwprintf (stream, format, args);
++ va_end (args);
++ return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vwprintf (const wchar_t *format, va_list args)
++{
++ return libintl_vfwprintf (stdout, format, args);
++}
++
++DLL_EXPORTED
++int
++libintl_wprintf (const wchar_t *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vwprintf (format, args);
++ va_end (args);
++ return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args)
++{
++ if (wcschr (format, '$') == NULL)
++ return system_vswprintf (resultbuf, length, format, args);
++ else
++ {
++ size_t maxlength = length;
++ wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
++ if (result != resultbuf)
++ {
++ if (maxlength > 0)
++ {
++ if (length < maxlength)
++ abort ();
++ memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t));
++ resultbuf[maxlength - 1] = 0;
++ }
++ free (result);
++ return -1;
++ }
++ else
++ return length;
++ }
++}
++
++DLL_EXPORTED
++int
++libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...)
++{
++ va_list args;
++ int retval;
++
++ va_start (args, format);
++ retval = libintl_vswprintf (resultbuf, length, format, args);
++ va_end (args);
++ return retval;
++}
++
++#endif
++
++#endif
+--- lrzsz-0.12.20.safe/intl/printf-parse.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-parse.c 2004-09-12 14:40:34.622707504 -0400
+@@ -0,0 +1,537 @@
++/* Formatted output to strings.
++ Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification. */
++#if WIDE_CHAR_VERSION
++# include "wprintf-parse.h"
++#else
++# include "printf-parse.h"
++#endif
++
++/* Get size_t, NULL. */
++#include <stddef.h>
++
++/* Get intmax_t. */
++#if HAVE_STDINT_H_WITH_UINTMAX
++# include <stdint.h>
++#endif
++#if HAVE_INTTYPES_H_WITH_UINTMAX
++# include <inttypes.h>
++#endif
++
++/* malloc(), realloc(), free(). */
++#include <stdlib.h>
++
++/* Checked size_t computations. */
++#include "xsize.h"
++
++#if WIDE_CHAR_VERSION
++# define PRINTF_PARSE wprintf_parse
++# define CHAR_T wchar_t
++# define DIRECTIVE wchar_t_directive
++# define DIRECTIVES wchar_t_directives
++#else
++# define PRINTF_PARSE printf_parse
++# define CHAR_T char
++# define DIRECTIVE char_directive
++# define DIRECTIVES char_directives
++#endif
++
++#ifdef STATIC
++STATIC
++#endif
++int
++PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
++{
++ const CHAR_T *cp = format; /* pointer into format */
++ size_t arg_posn = 0; /* number of regular arguments consumed */
++ size_t d_allocated; /* allocated elements of d->dir */
++ size_t a_allocated; /* allocated elements of a->arg */
++ size_t max_width_length = 0;
++ size_t max_precision_length = 0;
++
++ d->count = 0;
++ d_allocated = 1;
++ d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
++ if (d->dir == NULL)
++ /* Out of memory. */
++ return -1;
++
++ a->count = 0;
++ a_allocated = 0;
++ a->arg = NULL;
++
++#define REGISTER_ARG(_index_,_type_) \
++ { \
++ size_t n = (_index_); \
++ if (n >= a_allocated) \
++ { \
++ size_t memory_size; \
++ argument *memory; \
++ \
++ a_allocated = xtimes (a_allocated, 2); \
++ if (a_allocated <= n) \
++ a_allocated = xsum (n, 1); \
++ memory_size = xtimes (a_allocated, sizeof (argument)); \
++ if (size_overflow_p (memory_size)) \
++ /* Overflow, would lead to out of memory. */ \
++ goto error; \
++ memory = (a->arg \
++ ? realloc (a->arg, memory_size) \
++ : malloc (memory_size)); \
++ if (memory == NULL) \
++ /* Out of memory. */ \
++ goto error; \
++ a->arg = memory; \
++ } \
++ while (a->count <= n) \
++ a->arg[a->count++].type = TYPE_NONE; \
++ if (a->arg[n].type == TYPE_NONE) \
++ a->arg[n].type = (_type_); \
++ else if (a->arg[n].type != (_type_)) \
++ /* Ambiguous type for positional argument. */ \
++ goto error; \
++ }
++
++ while (*cp != '\0')
++ {
++ CHAR_T c = *cp++;
++ if (c == '%')
++ {
++ size_t arg_index = ARG_NONE;
++ DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
++
++ /* Initialize the next directive. */
++ dp->dir_start = cp - 1;
++ dp->flags = 0;
++ dp->width_start = NULL;
++ dp->width_end = NULL;
++ dp->width_arg_index = ARG_NONE;
++ dp->precision_start = NULL;
++ dp->precision_end = NULL;
++ dp->precision_arg_index = ARG_NONE;
++ dp->arg_index = ARG_NONE;
++
++ /* Test for positional argument. */
++ if (*cp >= '0' && *cp <= '9')
++ {
++ const CHAR_T *np;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ ;
++ if (*np == '$')
++ {
++ size_t n = 0;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ n = xsum (xtimes (n, 10), *np - '0');
++ if (n == 0)
++ /* Positional argument 0. */
++ goto error;
++ if (size_overflow_p (n))
++ /* n too large, would lead to out of memory later. */
++ goto error;
++ arg_index = n - 1;
++ cp = np + 1;
++ }
++ }
++
++ /* Read the flags. */
++ for (;;)
++ {
++ if (*cp == '\'')
++ {
++ dp->flags |= FLAG_GROUP;
++ cp++;
++ }
++ else if (*cp == '-')
++ {
++ dp->flags |= FLAG_LEFT;
++ cp++;
++ }
++ else if (*cp == '+')
++ {
++ dp->flags |= FLAG_SHOWSIGN;
++ cp++;
++ }
++ else if (*cp == ' ')
++ {
++ dp->flags |= FLAG_SPACE;
++ cp++;
++ }
++ else if (*cp == '#')
++ {
++ dp->flags |= FLAG_ALT;
++ cp++;
++ }
++ else if (*cp == '0')
++ {
++ dp->flags |= FLAG_ZERO;
++ cp++;
++ }
++ else
++ break;
++ }
++
++ /* Parse the field width. */
++ if (*cp == '*')
++ {
++ dp->width_start = cp;
++ cp++;
++ dp->width_end = cp;
++ if (max_width_length < 1)
++ max_width_length = 1;
++
++ /* Test for positional argument. */
++ if (*cp >= '0' && *cp <= '9')
++ {
++ const CHAR_T *np;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ ;
++ if (*np == '$')
++ {
++ size_t n = 0;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ n = xsum (xtimes (n, 10), *np - '0');
++ if (n == 0)
++ /* Positional argument 0. */
++ goto error;
++ if (size_overflow_p (n))
++ /* n too large, would lead to out of memory later. */
++ goto error;
++ dp->width_arg_index = n - 1;
++ cp = np + 1;
++ }
++ }
++ if (dp->width_arg_index == ARG_NONE)
++ {
++ dp->width_arg_index = arg_posn++;
++ if (dp->width_arg_index == ARG_NONE)
++ /* arg_posn wrapped around. */
++ goto error;
++ }
++ REGISTER_ARG (dp->width_arg_index, TYPE_INT);
++ }
++ else if (*cp >= '0' && *cp <= '9')
++ {
++ size_t width_length;
++
++ dp->width_start = cp;
++ for (; *cp >= '0' && *cp <= '9'; cp++)
++ ;
++ dp->width_end = cp;
++ width_length = dp->width_end - dp->width_start;
++ if (max_width_length < width_length)
++ max_width_length = width_length;
++ }
++
++ /* Parse the precision. */
++ if (*cp == '.')
++ {
++ cp++;
++ if (*cp == '*')
++ {
++ dp->precision_start = cp - 1;
++ cp++;
++ dp->precision_end = cp;
++ if (max_precision_length < 2)
++ max_precision_length = 2;
++
++ /* Test for positional argument. */
++ if (*cp >= '0' && *cp <= '9')
++ {
++ const CHAR_T *np;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ ;
++ if (*np == '$')
++ {
++ size_t n = 0;
++
++ for (np = cp; *np >= '0' && *np <= '9'; np++)
++ n = xsum (xtimes (n, 10), *np - '0');
++ if (n == 0)
++ /* Positional argument 0. */
++ goto error;
++ if (size_overflow_p (n))
++ /* n too large, would lead to out of memory
++ later. */
++ goto error;
++ dp->precision_arg_index = n - 1;
++ cp = np + 1;
++ }
++ }
++ if (dp->precision_arg_index == ARG_NONE)
++ {
++ dp->precision_arg_index = arg_posn++;
++ if (dp->precision_arg_index == ARG_NONE)
++ /* arg_posn wrapped around. */
++ goto error;
++ }
++ REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
++ }
++ else
++ {
++ size_t precision_length;
++
++ dp->precision_start = cp - 1;
++ for (; *cp >= '0' && *cp <= '9'; cp++)
++ ;
++ dp->precision_end = cp;
++ precision_length = dp->precision_end - dp->precision_start;
++ if (max_precision_length < precision_length)
++ max_precision_length = precision_length;
++ }
++ }
++
++ {
++ arg_type type;
++
++ /* Parse argument type/size specifiers. */
++ {
++ int flags = 0;
++
++ for (;;)
++ {
++ if (*cp == 'h')
++ {
++ flags |= (1 << (flags & 1));
++ cp++;
++ }
++ else if (*cp == 'L')
++ {
++ flags |= 4;
++ cp++;
++ }
++ else if (*cp == 'l')
++ {
++ flags += 8;
++ cp++;
++ }
++#ifdef HAVE_INTMAX_T
++ else if (*cp == 'j')
++ {
++ if (sizeof (intmax_t) > sizeof (long))
++ {
++ /* intmax_t = long long */
++ flags += 16;
++ }
++ else if (sizeof (intmax_t) > sizeof (int))
++ {
++ /* intmax_t = long */
++ flags += 8;
++ }
++ cp++;
++ }
++#endif
++ else if (*cp == 'z' || *cp == 'Z')
++ {
++ /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
++ because the warning facility in gcc-2.95.2 understands
++ only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
++ if (sizeof (size_t) > sizeof (long))
++ {
++ /* size_t = long long */
++ flags += 16;
++ }
++ else if (sizeof (size_t) > sizeof (int))
++ {
++ /* size_t = long */
++ flags += 8;
++ }
++ cp++;
++ }
++ else if (*cp == 't')
++ {
++ if (sizeof (ptrdiff_t) > sizeof (long))
++ {
++ /* ptrdiff_t = long long */
++ flags += 16;
++ }
++ else if (sizeof (ptrdiff_t) > sizeof (int))
++ {
++ /* ptrdiff_t = long */
++ flags += 8;
++ }
++ cp++;
++ }
++ else
++ break;
++ }
++
++ /* Read the conversion character. */
++ c = *cp++;
++ switch (c)
++ {
++ case 'd': case 'i':
++#ifdef HAVE_LONG_LONG
++ if (flags >= 16 || (flags & 4))
++ type = TYPE_LONGLONGINT;
++ else
++#endif
++ if (flags >= 8)
++ type = TYPE_LONGINT;
++ else if (flags & 2)
++ type = TYPE_SCHAR;
++ else if (flags & 1)
++ type = TYPE_SHORT;
++ else
++ type = TYPE_INT;
++ break;
++ case 'o': case 'u': case 'x': case 'X':
++#ifdef HAVE_LONG_LONG
++ if (flags >= 16 || (flags & 4))
++ type = TYPE_ULONGLONGINT;
++ else
++#endif
++ if (flags >= 8)
++ type = TYPE_ULONGINT;
++ else if (flags & 2)
++ type = TYPE_UCHAR;
++ else if (flags & 1)
++ type = TYPE_USHORT;
++ else
++ type = TYPE_UINT;
++ break;
++ case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
++ case 'a': case 'A':
++#ifdef HAVE_LONG_DOUBLE
++ if (flags >= 16 || (flags & 4))
++ type = TYPE_LONGDOUBLE;
++ else
++#endif
++ type = TYPE_DOUBLE;
++ break;
++ case 'c':
++ if (flags >= 8)
++#ifdef HAVE_WINT_T
++ type = TYPE_WIDE_CHAR;
++#else
++ goto error;
++#endif
++ else
++ type = TYPE_CHAR;
++ break;
++#ifdef HAVE_WINT_T
++ case 'C':
++ type = TYPE_WIDE_CHAR;
++ c = 'c';
++ break;
++#endif
++ case 's':
++ if (flags >= 8)
++#ifdef HAVE_WCHAR_T
++ type = TYPE_WIDE_STRING;
++#else
++ goto error;
++#endif
++ else
++ type = TYPE_STRING;
++ break;
++#ifdef HAVE_WCHAR_T
++ case 'S':
++ type = TYPE_WIDE_STRING;
++ c = 's';
++ break;
++#endif
++ case 'p':
++ type = TYPE_POINTER;
++ break;
++ case 'n':
++#ifdef HAVE_LONG_LONG
++ if (flags >= 16 || (flags & 4))
++ type = TYPE_COUNT_LONGLONGINT_POINTER;
++ else
++#endif
++ if (flags >= 8)
++ type = TYPE_COUNT_LONGINT_POINTER;
++ else if (flags & 2)
++ type = TYPE_COUNT_SCHAR_POINTER;
++ else if (flags & 1)
++ type = TYPE_COUNT_SHORT_POINTER;
++ else
++ type = TYPE_COUNT_INT_POINTER;
++ break;
++ case '%':
++ type = TYPE_NONE;
++ break;
++ default:
++ /* Unknown conversion character. */
++ goto error;
++ }
++ }
++
++ if (type != TYPE_NONE)
++ {
++ dp->arg_index = arg_index;
++ if (dp->arg_index == ARG_NONE)
++ {
++ dp->arg_index = arg_posn++;
++ if (dp->arg_index == ARG_NONE)
++ /* arg_posn wrapped around. */
++ goto error;
++ }
++ REGISTER_ARG (dp->arg_index, type);
++ }
++ dp->conversion = c;
++ dp->dir_end = cp;
++ }
++
++ d->count++;
++ if (d->count >= d_allocated)
++ {
++ size_t memory_size;
++ DIRECTIVE *memory;
++
++ d_allocated = xtimes (d_allocated, 2);
++ memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
++ if (size_overflow_p (memory_size))
++ /* Overflow, would lead to out of memory. */
++ goto error;
++ memory = realloc (d->dir, memory_size);
++ if (memory == NULL)
++ /* Out of memory. */
++ goto error;
++ d->dir = memory;
++ }
++ }
++ }
++ d->dir[d->count].dir_start = cp;
++
++ d->max_width_length = max_width_length;
++ d->max_precision_length = max_precision_length;
++ return 0;
++
++error:
++ if (a->arg)
++ free (a->arg);
++ if (d->dir)
++ free (d->dir);
++ return -1;
++}
++
++#undef DIRECTIVES
++#undef DIRECTIVE
++#undef CHAR_T
++#undef PRINTF_PARSE
+--- lrzsz-0.12.20.safe/intl/printf-parse.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-parse.h 2004-09-12 14:40:34.628706592 -0400
+@@ -0,0 +1,75 @@
++/* Parse printf format string.
++ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _PRINTF_PARSE_H
++#define _PRINTF_PARSE_H
++
++#include "printf-args.h"
++
++
++/* Flags */
++#define FLAG_GROUP 1 /* ' flag */
++#define FLAG_LEFT 2 /* - flag */
++#define FLAG_SHOWSIGN 4 /* + flag */
++#define FLAG_SPACE 8 /* space flag */
++#define FLAG_ALT 16 /* # flag */
++#define FLAG_ZERO 32
++
++/* arg_index value indicating that no argument is consumed. */
++#define ARG_NONE (~(size_t)0)
++
++/* A parsed directive. */
++typedef struct
++{
++ const char* dir_start;
++ const char* dir_end;
++ int flags;
++ const char* width_start;
++ const char* width_end;
++ size_t width_arg_index;
++ const char* precision_start;
++ const char* precision_end;
++ size_t precision_arg_index;
++ char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
++ size_t arg_index;
++}
++char_directive;
++
++/* A parsed format string. */
++typedef struct
++{
++ size_t count;
++ char_directive *dir;
++ size_t max_width_length;
++ size_t max_precision_length;
++}
++char_directives;
++
++
++/* Parses the format string. Fills in the number N of directives, and fills
++ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
++ to the end of the format string. Also fills in the arg_type fields of the
++ arguments and the needed count of arguments. */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int printf_parse (const char *format, char_directives *d, arguments *a);
++
++#endif /* _PRINTF_PARSE_H */
+--- lrzsz-0.12.20.safe/intl/ref-add.sin 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ref-add.sin 2004-09-12 14:40:34.633705832 -0400
+@@ -0,0 +1,31 @@
++# Add this package to a list of references stored in a text file.
++#
++# Copyright (C) 2000 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Library General Public License for more details.
++#
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
++#
++# Written by Bruno Haible <haible@clisp.cons.org>.
++#
++/^# Packages using this file: / {
++ s/# Packages using this file://
++ ta
++ :a
++ s/ @PACKAGE@ / @PACKAGE@ /
++ tb
++ s/ $/ @PACKAGE@ /
++ :b
++ s/^/# Packages using this file:/
++}
+--- lrzsz-0.12.20.safe/intl/ref-del.sin 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ref-del.sin 2004-09-12 14:40:34.638705072 -0400
+@@ -0,0 +1,26 @@
++# Remove this package from a list of references stored in a text file.
++#
++# Copyright (C) 2000 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Library General Public License for more details.
++#
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
++#
++# Written by Bruno Haible <haible@clisp.cons.org>.
++#
++/^# Packages using this file: / {
++ s/# Packages using this file://
++ s/ @PACKAGE@ / /
++ s/^/# Packages using this file:/
++}
+--- lrzsz-0.12.20.safe/intl/relocatable.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/relocatable.c 2004-09-12 14:40:34.644704160 -0400
+@@ -0,0 +1,449 @@
++/* Provide relocatable packages.
++ Copyright (C) 2003 Free Software Foundation, Inc.
++ Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++
++/* Tell glibc's <stdio.h> to provide a prototype for getline().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include "config.h"
++#endif
++
++/* Specification. */
++#include "relocatable.h"
++
++#if ENABLE_RELOCATABLE
++
++#include <stddef.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#ifdef NO_XMALLOC
++# define xmalloc malloc
++#else
++# include "xalloc.h"
++#endif
++
++#if defined _WIN32 || defined __WIN32__
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++#endif
++
++#if DEPENDS_ON_LIBCHARSET
++# include <libcharset.h>
++#endif
++#if DEPENDS_ON_LIBICONV && HAVE_ICONV
++# include <iconv.h>
++#endif
++#if DEPENDS_ON_LIBINTL && ENABLE_NLS
++# include <libintl.h>
++#endif
++
++/* Faked cheap 'bool'. */
++#undef bool
++#undef false
++#undef true
++#define bool int
++#define false 0
++#define true 1
++
++/* Pathname support.
++ ISSLASH(C) tests whether C is a directory separator character.
++ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++ && (P)[1] == ':')
++# define IS_PATH_WITH_DIR(P) \
++ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
++# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
++#else
++ /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
++# define FILESYSTEM_PREFIX_LEN(P) 0
++#endif
++
++/* Original installation prefix. */
++static char *orig_prefix;
++static size_t orig_prefix_len;
++/* Current installation prefix. */
++static char *curr_prefix;
++static size_t curr_prefix_len;
++/* These prefixes do not end in a slash. Anything that will be concatenated
++ to them must start with a slash. */
++
++/* Sets the original and the current installation prefix of this module.
++ Relocation simply replaces a pathname starting with the original prefix
++ by the corresponding pathname with the current prefix instead. Both
++ prefixes should be directory names without trailing slash (i.e. use ""
++ instead of "/"). */
++static void
++set_this_relocation_prefix (const char *orig_prefix_arg,
++ const char *curr_prefix_arg)
++{
++ if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
++ /* Optimization: if orig_prefix and curr_prefix are equal, the
++ relocation is a nop. */
++ && strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
++ {
++ /* Duplicate the argument strings. */
++ char *memory;
++
++ orig_prefix_len = strlen (orig_prefix_arg);
++ curr_prefix_len = strlen (curr_prefix_arg);
++ memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
++#ifdef NO_XMALLOC
++ if (memory != NULL)
++#endif
++ {
++ memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
++ orig_prefix = memory;
++ memory += orig_prefix_len + 1;
++ memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
++ curr_prefix = memory;
++ return;
++ }
++ }
++ orig_prefix = NULL;
++ curr_prefix = NULL;
++ /* Don't worry about wasted memory here - this function is usually only
++ called once. */
++}
++
++/* Sets the original and the current installation prefix of the package.
++ Relocation simply replaces a pathname starting with the original prefix
++ by the corresponding pathname with the current prefix instead. Both
++ prefixes should be directory names without trailing slash (i.e. use ""
++ instead of "/"). */
++void
++set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
++{
++ set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++
++ /* Now notify all dependent libraries. */
++#if DEPENDS_ON_LIBCHARSET
++ libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
++ libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
++ libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++}
++
++#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
++
++/* Convenience function:
++ Computes the current installation prefix, based on the original
++ installation prefix, the original installation directory of a particular
++ file, and the current pathname of this file. Returns NULL upon failure. */
++#ifdef IN_LIBRARY
++#define compute_curr_prefix local_compute_curr_prefix
++static
++#endif
++const char *
++compute_curr_prefix (const char *orig_installprefix,
++ const char *orig_installdir,
++ const char *curr_pathname)
++{
++ const char *curr_installdir;
++ const char *rel_installdir;
++
++ if (curr_pathname == NULL)
++ return NULL;
++
++ /* Determine the relative installation directory, relative to the prefix.
++ This is simply the difference between orig_installprefix and
++ orig_installdir. */
++ if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
++ != 0)
++ /* Shouldn't happen - nothing should be installed outside $(prefix). */
++ return NULL;
++ rel_installdir = orig_installdir + strlen (orig_installprefix);
++
++ /* Determine the current installation directory. */
++ {
++ const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname);
++ const char *p = curr_pathname + strlen (curr_pathname);
++ char *q;
++
++ while (p > p_base)
++ {
++ p--;
++ if (ISSLASH (*p))
++ break;
++ }
++
++ q = (char *) xmalloc (p - curr_pathname + 1);
++#ifdef NO_XMALLOC
++ if (q == NULL)
++ return NULL;
++#endif
++ memcpy (q, curr_pathname, p - curr_pathname);
++ q[p - curr_pathname] = '\0';
++ curr_installdir = q;
++ }
++
++ /* Compute the current installation prefix by removing the trailing
++ rel_installdir from it. */
++ {
++ const char *rp = rel_installdir + strlen (rel_installdir);
++ const char *cp = curr_installdir + strlen (curr_installdir);
++ const char *cp_base =
++ curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir);
++
++ while (rp > rel_installdir && cp > cp_base)
++ {
++ bool same = false;
++ const char *rpi = rp;
++ const char *cpi = cp;
++
++ while (rpi > rel_installdir && cpi > cp_base)
++ {
++ rpi--;
++ cpi--;
++ if (ISSLASH (*rpi) || ISSLASH (*cpi))
++ {
++ if (ISSLASH (*rpi) && ISSLASH (*cpi))
++ same = true;
++ break;
++ }
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++ /* Win32, OS/2, DOS - case insignificant filesystem */
++ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
++ != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
++ break;
++#else
++ if (*rpi != *cpi)
++ break;
++#endif
++ }
++ if (!same)
++ break;
++ /* The last pathname component was the same. opi and cpi now point
++ to the slash before it. */
++ rp = rpi;
++ cp = cpi;
++ }
++
++ if (rp > rel_installdir)
++ /* Unexpected: The curr_installdir does not end with rel_installdir. */
++ return NULL;
++
++ {
++ size_t curr_prefix_len = cp - curr_installdir;
++ char *curr_prefix;
++
++ curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
++#ifdef NO_XMALLOC
++ if (curr_prefix == NULL)
++ return NULL;
++#endif
++ memcpy (curr_prefix, curr_installdir, curr_prefix_len);
++ curr_prefix[curr_prefix_len] = '\0';
++
++ return curr_prefix;
++ }
++ }
++}
++
++#endif /* !IN_LIBRARY || PIC */
++
++#if defined PIC && defined INSTALLDIR
++
++/* Full pathname of shared library, or NULL. */
++static char *shared_library_fullname;
++
++#if defined _WIN32 || defined __WIN32__
++
++/* Determine the full pathname of the shared library when it is loaded. */
++
++BOOL WINAPI
++DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
++{
++ (void) reserved;
++
++ if (event == DLL_PROCESS_ATTACH)
++ {
++ /* The DLL is being loaded into an application's address range. */
++ static char location[MAX_PATH];
++
++ if (!GetModuleFileName (module_handle, location, sizeof (location)))
++ /* Shouldn't happen. */
++ return FALSE;
++
++ if (!IS_PATH_WITH_DIR (location))
++ /* Shouldn't happen. */
++ return FALSE;
++
++ shared_library_fullname = strdup (location);
++ }
++
++ return TRUE;
++}
++
++#else /* Unix */
++
++static void
++find_shared_library_fullname ()
++{
++#if defined __linux__ && __GLIBC__ >= 2
++ /* Linux has /proc/self/maps. glibc 2 has the getline() function. */
++ FILE *fp;
++
++ /* Open the current process' maps file. It describes one VMA per line. */
++ fp = fopen ("/proc/self/maps", "r");
++ if (fp)
++ {
++ unsigned long address = (unsigned long) &find_shared_library_fullname;
++ for (;;)
++ {
++ unsigned long start, end;
++ int c;
++
++ if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
++ break;
++ if (address >= start && address <= end - 1)
++ {
++ /* Found it. Now see if this line contains a filename. */
++ while (c = getc (fp), c != EOF && c != '\n' && c != '/')
++ continue;
++ if (c == '/')
++ {
++ size_t size;
++ int len;
++
++ ungetc (c, fp);
++ shared_library_fullname = NULL; size = 0;
++ len = getline (&shared_library_fullname, &size, fp);
++ if (len >= 0)
++ {
++ /* Success: filled shared_library_fullname. */
++ if (len > 0 && shared_library_fullname[len - 1] == '\n')
++ shared_library_fullname[len - 1] = '\0';
++ }
++ }
++ break;
++ }
++ while (c = getc (fp), c != EOF && c != '\n')
++ continue;
++ }
++ fclose (fp);
++ }
++#endif
++}
++
++#endif /* WIN32 / Unix */
++
++/* Return the full pathname of the current shared library.
++ Return NULL if unknown.
++ Guaranteed to work only on Linux and Woe32. */
++static char *
++get_shared_library_fullname ()
++{
++#if !(defined _WIN32 || defined __WIN32__)
++ static bool tried_find_shared_library_fullname;
++ if (!tried_find_shared_library_fullname)
++ {
++ find_shared_library_fullname ();
++ tried_find_shared_library_fullname = true;
++ }
++#endif
++ return shared_library_fullname;
++}
++
++#endif /* PIC */
++
++/* Returns the pathname, relocated according to the current installation
++ directory. */
++const char *
++relocate (const char *pathname)
++{
++#if defined PIC && defined INSTALLDIR
++ static int initialized;
++
++ /* Initialization code for a shared library. */
++ if (!initialized)
++ {
++ /* At this point, orig_prefix and curr_prefix likely have already been
++ set through the main program's set_program_name_and_installdir
++ function. This is sufficient in the case that the library has
++ initially been installed in the same orig_prefix. But we can do
++ better, to also cover the cases that 1. it has been installed
++ in a different prefix before being moved to orig_prefix and (later)
++ to curr_prefix, 2. unlike the program, it has not moved away from
++ orig_prefix. */
++ const char *orig_installprefix = INSTALLPREFIX;
++ const char *orig_installdir = INSTALLDIR;
++ const char *curr_prefix_better;
++
++ curr_prefix_better =
++ compute_curr_prefix (orig_installprefix, orig_installdir,
++ get_shared_library_fullname ());
++ if (curr_prefix_better == NULL)
++ curr_prefix_better = curr_prefix;
++
++ set_relocation_prefix (orig_installprefix, curr_prefix_better);
++
++ initialized = 1;
++ }
++#endif
++
++ /* Note: It is not necessary to perform case insensitive comparison here,
++ even for DOS-like filesystems, because the pathname argument was
++ typically created from the same Makefile variable as orig_prefix came
++ from. */
++ if (orig_prefix != NULL && curr_prefix != NULL
++ && strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
++ {
++ if (pathname[orig_prefix_len] == '\0')
++ /* pathname equals orig_prefix. */
++ return curr_prefix;
++ if (ISSLASH (pathname[orig_prefix_len]))
++ {
++ /* pathname starts with orig_prefix. */
++ const char *pathname_tail = &pathname[orig_prefix_len];
++ char *result =
++ (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
++
++#ifdef NO_XMALLOC
++ if (result != NULL)
++#endif
++ {
++ memcpy (result, curr_prefix, curr_prefix_len);
++ strcpy (result + curr_prefix_len, pathname_tail);
++ return result;
++ }
++ }
++ }
++ /* Nothing to relocate. */
++ return pathname;
++}
++
++#endif
+--- lrzsz-0.12.20.safe/intl/relocatable.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/relocatable.h 2004-09-12 14:40:34.651703096 -0400
+@@ -0,0 +1,77 @@
++/* Provide relocatable packages.
++ Copyright (C) 2003 Free Software Foundation, Inc.
++ Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _RELOCATABLE_H
++#define _RELOCATABLE_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* This can be enabled through the configure --enable-relocatable option. */
++#if ENABLE_RELOCATABLE
++
++/* When building a DLL, we must export some functions. Note that because
++ this is a private .h file, we don't need to use __declspec(dllimport)
++ in any case. */
++#if defined _MSC_VER && BUILDING_DLL
++# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
++#else
++# define RELOCATABLE_DLL_EXPORTED
++#endif
++
++/* Sets the original and the current installation prefix of the package.
++ Relocation simply replaces a pathname starting with the original prefix
++ by the corresponding pathname with the current prefix instead. Both
++ prefixes should be directory names without trailing slash (i.e. use ""
++ instead of "/"). */
++extern RELOCATABLE_DLL_EXPORTED void
++ set_relocation_prefix (const char *orig_prefix,
++ const char *curr_prefix);
++
++/* Returns the pathname, relocated according to the current installation
++ directory. */
++extern const char * relocate (const char *pathname);
++
++/* Memory management: relocate() leaks memory, because it has to construct
++ a fresh pathname. If this is a problem because your program calls
++ relocate() frequently, think about caching the result. */
++
++/* Convenience function:
++ Computes the current installation prefix, based on the original
++ installation prefix, the original installation directory of a particular
++ file, and the current pathname of this file. Returns NULL upon failure. */
++extern const char * compute_curr_prefix (const char *orig_installprefix,
++ const char *orig_installdir,
++ const char *curr_pathname);
++
++#else
++
++/* By default, we use the hardwired pathnames. */
++#define relocate(pathname) (pathname)
++
++#endif
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _RELOCATABLE_H */
+--- lrzsz-0.12.20.safe/intl/textdomain.c 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/textdomain.c 2004-09-12 14:40:34.656702336 -0400
+@@ -1,51 +1,60 @@
+-/* Implementation of the textdomain(3) function
+- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+- Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Implementation of the textdomain(3) function.
++ Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2, or (at your option)
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software Foundation,
+- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
+
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#endif
++#include <stdlib.h>
++#include <string.h>
+
+-#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
++#ifdef _LIBC
++# include <libintl.h>
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
++# include "libgnuintl.h"
+ #endif
++#include "gettextP.h"
+
+ #ifdef _LIBC
+-# include <libintl.h>
++/* We have to handle multi-threaded applications. */
++# include <bits/libc-lock.h>
+ #else
+-# include "libgettext.h"
++/* Provide dummy implementation if this is outside glibc. */
++# define __libc_rwlock_define(CLASS, NAME)
++# define __libc_rwlock_wrlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++ names than the internal variables in GNU libc, otherwise programs
++ using libintl.a cannot be linked statically. */
++#if !defined _LIBC
++# define _nl_default_default_domain libintl_nl_default_default_domain
++# define _nl_current_default_domain libintl_nl_current_default_domain
+ #endif
+
+ /* @@ end of prolog @@ */
+
+ /* Name of the default text domain. */
+-extern const char _nl_default_default_domain[];
++extern const char _nl_default_default_domain[] attribute_hidden;
+
+ /* Default text domain in which entries for gettext(3) are to be found. */
+-extern const char *_nl_current_default_domain;
++extern const char *_nl_current_default_domain attribute_hidden;
+
+
+ /* Names for the libintl functions are a problem. They must not clash
+@@ -54,50 +63,76 @@
+ prefix. So we have to make a difference here. */
+ #ifdef _LIBC
+ # define TEXTDOMAIN __textdomain
+-# define strdup(str) __strdup (str)
++# ifndef strdup
++# define strdup(str) __strdup (str)
++# endif
+ #else
+-# define TEXTDOMAIN textdomain__
++# define TEXTDOMAIN libintl_textdomain
+ #endif
+
++/* Lock variable to protect the global data in the gettext implementation. */
++__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
++
+ /* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+ char *
+-TEXTDOMAIN (domainname)
+- const char *domainname;
++TEXTDOMAIN (const char *domainname)
+ {
+- char *old;
++ char *new_domain;
++ char *old_domain;
+
+ /* A NULL pointer requests the current setting. */
+ if (domainname == NULL)
+ return (char *) _nl_current_default_domain;
+
+- old = (char *) _nl_current_default_domain;
++ __libc_rwlock_wrlock (_nl_state_lock);
++
++ old_domain = (char *) _nl_current_default_domain;
+
+ /* If domain name is the null string set to default domain "messages". */
+ if (domainname[0] == '\0'
+ || strcmp (domainname, _nl_default_default_domain) == 0)
+- _nl_current_default_domain = _nl_default_default_domain;
++ {
++ _nl_current_default_domain = _nl_default_default_domain;
++ new_domain = (char *) _nl_current_default_domain;
++ }
++ else if (strcmp (domainname, old_domain) == 0)
++ /* This can happen and people will use it to signal that some
++ environment variable changed. */
++ new_domain = old_domain;
+ else
+ {
+ /* If the following malloc fails `_nl_current_default_domain'
+ will be NULL. This value will be returned and so signals we
+ are out of core. */
+ #if defined _LIBC || defined HAVE_STRDUP
+- _nl_current_default_domain = strdup (domainname);
++ new_domain = strdup (domainname);
+ #else
+ size_t len = strlen (domainname) + 1;
+- char *cp = (char *) malloc (len);
+- if (cp != NULL)
+- memcpy (cp, domainname, len);
+- _nl_current_default_domain = cp;
++ new_domain = (char *) malloc (len);
++ if (new_domain != NULL)
++ memcpy (new_domain, domainname, len);
+ #endif
++
++ if (new_domain != NULL)
++ _nl_current_default_domain = new_domain;
+ }
+
+- if (old != _nl_default_default_domain)
+- free (old);
++ /* We use this possibility to signal a change of the loaded catalogs
++ since this is most likely the case and there is no other easy we
++ to do it. Do it only when the call was successful. */
++ if (new_domain != NULL)
++ {
++ ++_nl_msg_cat_cntr;
+
+- return (char *) _nl_current_default_domain;
++ if (old_domain != new_domain && old_domain != _nl_default_default_domain)
++ free (old_domain);
++ }
++
++ __libc_rwlock_unlock (_nl_state_lock);
++
++ return new_domain;
+ }
+
+ #ifdef _LIBC
+--- lrzsz-0.12.20.safe/intl/vasnprintf.c 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnprintf.c 2004-09-12 14:40:34.662701424 -0400
+@@ -0,0 +1,887 @@
++/* vsprintf with automatic memory allocation.
++ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
++ This must come before <config.h> because <config.h> may include
++ <features.h>, and once <features.h> has been included, it's too late. */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++#ifndef IN_LIBINTL
++# include <alloca.h>
++#endif
++
++/* Specification. */
++#if WIDE_CHAR_VERSION
++# include "vasnwprintf.h"
++#else
++# include "vasnprintf.h"
++#endif
++
++#include <stdio.h> /* snprintf(), sprintf() */
++#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
++#include <string.h> /* memcpy(), strlen() */
++#include <errno.h> /* errno */
++#include <limits.h> /* CHAR_BIT */
++#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
++#if WIDE_CHAR_VERSION
++# include "wprintf-parse.h"
++#else
++# include "printf-parse.h"
++#endif
++
++/* Checked size_t computations. */
++#include "xsize.h"
++
++#ifdef HAVE_WCHAR_T
++# ifdef HAVE_WCSLEN
++# define local_wcslen wcslen
++# else
++ /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
++ a dependency towards this library, here is a local substitute.
++ Define this substitute only once, even if this file is included
++ twice in the same compilation unit. */
++# ifndef local_wcslen_defined
++# define local_wcslen_defined 1
++static size_t
++local_wcslen (const wchar_t *s)
++{
++ const wchar_t *ptr;
++
++ for (ptr = s; *ptr != (wchar_t) 0; ptr++)
++ ;
++ return ptr - s;
++}
++# endif
++# endif
++#endif
++
++#if WIDE_CHAR_VERSION
++# define VASNPRINTF vasnwprintf
++# define CHAR_T wchar_t
++# define DIRECTIVE wchar_t_directive
++# define DIRECTIVES wchar_t_directives
++# define PRINTF_PARSE wprintf_parse
++# define USE_SNPRINTF 1
++# if HAVE_DECL__SNWPRINTF
++ /* On Windows, the function swprintf() has a different signature than
++ on Unix; we use the _snwprintf() function instead. */
++# define SNPRINTF _snwprintf
++# else
++ /* Unix. */
++# define SNPRINTF swprintf
++# endif
++#else
++# define VASNPRINTF vasnprintf
++# define CHAR_T char
++# define DIRECTIVE char_directive
++# define DIRECTIVES char_directives
++# define PRINTF_PARSE printf_parse
++# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
++# if HAVE_DECL__SNPRINTF
++ /* Windows. */
++# define SNPRINTF _snprintf
++# else
++ /* Unix. */
++# define SNPRINTF snprintf
++# endif
++#endif
++
++CHAR_T *
++VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
++{
++ DIRECTIVES d;
++ arguments a;
++
++ if (PRINTF_PARSE (format, &d, &a) < 0)
++ {
++ errno = EINVAL;
++ return NULL;
++ }
++
++#define CLEANUP() \
++ free (d.dir); \
++ if (a.arg) \
++ free (a.arg);
++
++ if (printf_fetchargs (args, &a) < 0)
++ {
++ CLEANUP ();
++ errno = EINVAL;
++ return NULL;
++ }
++
++ {
++ size_t buf_neededlength;
++ CHAR_T *buf;
++ CHAR_T *buf_malloced;
++ const CHAR_T *cp;
++ size_t i;
++ DIRECTIVE *dp;
++ /* Output string accumulator. */
++ CHAR_T *result;
++ size_t allocated;
++ size_t length;
++
++ /* Allocate a small buffer that will hold a directive passed to
++ sprintf or snprintf. */
++ buf_neededlength =
++ xsum4 (7, d.max_width_length, d.max_precision_length, 6);
++#if HAVE_ALLOCA
++ if (buf_neededlength < 4000 / sizeof (CHAR_T))
++ {
++ buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
++ buf_malloced = NULL;
++ }
++ else
++#endif
++ {
++ size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
++ if (size_overflow_p (buf_memsize))
++ goto out_of_memory_1;
++ buf = (CHAR_T *) malloc (buf_memsize);
++ if (buf == NULL)
++ goto out_of_memory_1;
++ buf_malloced = buf;
++ }
++
++ if (resultbuf != NULL)
++ {
++ result = resultbuf;
++ allocated = *lengthp;
++ }
++ else
++ {
++ result = NULL;
++ allocated = 0;
++ }
++ length = 0;
++ /* Invariants:
++ result is either == resultbuf or == NULL or malloc-allocated.
++ If length > 0, then result != NULL. */
++
++ /* Ensures that allocated >= needed. Aborts through a jump to
++ out_of_memory if needed is SIZE_MAX or otherwise too big. */
++#define ENSURE_ALLOCATION(needed) \
++ if ((needed) > allocated) \
++ { \
++ size_t memory_size; \
++ CHAR_T *memory; \
++ \
++ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
++ if ((needed) > allocated) \
++ allocated = (needed); \
++ memory_size = xtimes (allocated, sizeof (CHAR_T)); \
++ if (size_overflow_p (memory_size)) \
++ goto out_of_memory; \
++ if (result == resultbuf || result == NULL) \
++ memory = (CHAR_T *) malloc (memory_size); \
++ else \
++ memory = (CHAR_T *) realloc (result, memory_size); \
++ if (memory == NULL) \
++ goto out_of_memory; \
++ if (result == resultbuf && length > 0) \
++ memcpy (memory, result, length * sizeof (CHAR_T)); \
++ result = memory; \
++ }
++
++ for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
++ {
++ if (cp != dp->dir_start)
++ {
++ size_t n = dp->dir_start - cp;
++ size_t augmented_length = xsum (length, n);
++
++ ENSURE_ALLOCATION (augmented_length);
++ memcpy (result + length, cp, n * sizeof (CHAR_T));
++ length = augmented_length;
++ }
++ if (i == d.count)
++ break;
++
++ /* Execute a single directive. */
++ if (dp->conversion == '%')
++ {
++ size_t augmented_length;
++
++ if (!(dp->arg_index == ARG_NONE))
++ abort ();
++ augmented_length = xsum (length, 1);
++ ENSURE_ALLOCATION (augmented_length);
++ result[length] = '%';
++ length = augmented_length;
++ }
++ else
++ {
++ if (!(dp->arg_index != ARG_NONE))
++ abort ();
++
++ if (dp->conversion == 'n')
++ {
++ switch (a.arg[dp->arg_index].type)
++ {
++ case TYPE_COUNT_SCHAR_POINTER:
++ *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
++ break;
++ case TYPE_COUNT_SHORT_POINTER:
++ *a.arg[dp->arg_index].a.a_count_short_pointer = length;
++ break;
++ case TYPE_COUNT_INT_POINTER:
++ *a.arg[dp->arg_index].a.a_count_int_pointer = length;
++ break;
++ case TYPE_COUNT_LONGINT_POINTER:
++ *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
++ break;
++#ifdef HAVE_LONG_LONG
++ case TYPE_COUNT_LONGLONGINT_POINTER:
++ *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
++ break;
++#endif
++ default:
++ abort ();
++ }
++ }
++ else
++ {
++ arg_type type = a.arg[dp->arg_index].type;
++ CHAR_T *p;
++ unsigned int prefix_count;
++ int prefixes[2];
++#if !USE_SNPRINTF
++ size_t tmp_length;
++ CHAR_T tmpbuf[700];
++ CHAR_T *tmp;
++
++ /* Allocate a temporary buffer of sufficient size for calling
++ sprintf. */
++ {
++ size_t width;
++ size_t precision;
++
++ width = 0;
++ if (dp->width_start != dp->width_end)
++ {
++ if (dp->width_arg_index != ARG_NONE)
++ {
++ int arg;
++
++ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
++ abort ();
++ arg = a.arg[dp->width_arg_index].a.a_int;
++ width = (arg < 0 ? (unsigned int) (-arg) : arg);
++ }
++ else
++ {
++ const CHAR_T *digitp = dp->width_start;
++
++ do
++ width = xsum (xtimes (width, 10), *digitp++ - '0');
++ while (digitp != dp->width_end);
++ }
++ }
++
++ precision = 6;
++ if (dp->precision_start != dp->precision_end)
++ {
++ if (dp->precision_arg_index != ARG_NONE)
++ {
++ int arg;
++
++ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
++ abort ();
++ arg = a.arg[dp->precision_arg_index].a.a_int;
++ precision = (arg < 0 ? 0 : arg);
++ }
++ else
++ {
++ const CHAR_T *digitp = dp->precision_start + 1;
++
++ precision = 0;
++ do
++ precision = xsum (xtimes (precision, 10), *digitp++ - '0');
++ while (digitp != dp->precision_end);
++ }
++ }
++
++ switch (dp->conversion)
++ {
++
++ case 'd': case 'i': case 'u':
++# ifdef HAVE_LONG_LONG
++ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++ * 0.30103 /* binary -> decimal */
++ * 2 /* estimate for FLAG_GROUP */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ else
++# endif
++ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++ * 0.30103 /* binary -> decimal */
++ * 2 /* estimate for FLAG_GROUP */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ else
++ tmp_length =
++ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++ * 0.30103 /* binary -> decimal */
++ * 2 /* estimate for FLAG_GROUP */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ break;
++
++ case 'o':
++# ifdef HAVE_LONG_LONG
++ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++ * 0.333334 /* binary -> octal */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ else
++# endif
++ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++ * 0.333334 /* binary -> octal */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ else
++ tmp_length =
++ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++ * 0.333334 /* binary -> octal */
++ )
++ + 1 /* turn floor into ceil */
++ + 1; /* account for leading sign */
++ break;
++
++ case 'x': case 'X':
++# ifdef HAVE_LONG_LONG
++ if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++ * 0.25 /* binary -> hexadecimal */
++ )
++ + 1 /* turn floor into ceil */
++ + 2; /* account for leading sign or alternate form */
++ else
++# endif
++ if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++ tmp_length =
++ (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++ * 0.25 /* binary -> hexadecimal */
++ )
++ + 1 /* turn floor into ceil */
++ + 2; /* account for leading sign or alternate form */
++ else
++ tmp_length =
++ (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++ * 0.25 /* binary -> hexadecimal */
++ )
++ + 1 /* turn floor into ceil */
++ + 2; /* account for leading sign or alternate form */
++ break;
++
++ case 'f': case 'F':
++# ifdef HAVE_LONG_DOUBLE
++ if (type == TYPE_LONGDOUBLE)
++ tmp_length =
++ (unsigned int) (LDBL_MAX_EXP
++ * 0.30103 /* binary -> decimal */
++ * 2 /* estimate for FLAG_GROUP */
++ )
++ + 1 /* turn floor into ceil */
++ + 10; /* sign, decimal point etc. */
++ else
++# endif
++ tmp_length =
++ (unsigned int) (DBL_MAX_EXP
++ * 0.30103 /* binary -> decimal */
++ * 2 /* estimate for FLAG_GROUP */
++ )
++ + 1 /* turn floor into ceil */
++ + 10; /* sign, decimal point etc. */
++ tmp_length = xsum (tmp_length, precision);
++ break;
++
++ case 'e': case 'E': case 'g': case 'G':
++ case 'a': case 'A':
++ tmp_length =
++ 12; /* sign, decimal point, exponent etc. */
++ tmp_length = xsum (tmp_length, precision);
++ break;
++
++ case 'c':
++# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
++ if (type == TYPE_WIDE_CHAR)
++ tmp_length = MB_CUR_MAX;
++ else
++# endif
++ tmp_length = 1;
++ break;
++
++ case 's':
++# ifdef HAVE_WCHAR_T
++ if (type == TYPE_WIDE_STRING)
++ {
++ tmp_length =
++ local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
++
++# if !WIDE_CHAR_VERSION
++ tmp_length = xtimes (tmp_length, MB_CUR_MAX);
++# endif
++ }
++ else
++# endif
++ tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
++ break;
++
++ case 'p':
++ tmp_length =
++ (unsigned int) (sizeof (void *) * CHAR_BIT
++ * 0.25 /* binary -> hexadecimal */
++ )
++ + 1 /* turn floor into ceil */
++ + 2; /* account for leading 0x */
++ break;
++
++ default:
++ abort ();
++ }
++
++ if (tmp_length < width)
++ tmp_length = width;
++
++ tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
++ }
++
++ if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
++ tmp = tmpbuf;
++ else
++ {
++ size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
++
++ if (size_overflow_p (tmp_memsize))
++ /* Overflow, would lead to out of memory. */
++ goto out_of_memory;
++ tmp = (CHAR_T *) malloc (tmp_memsize);
++ if (tmp == NULL)
++ /* Out of memory. */
++ goto out_of_memory;
++ }
++#endif
++
++ /* Construct the format string for calling snprintf or
++ sprintf. */
++ p = buf;
++ *p++ = '%';
++ if (dp->flags & FLAG_GROUP)
++ *p++ = '\'';
++ if (dp->flags & FLAG_LEFT)
++ *p++ = '-';
++ if (dp->flags & FLAG_SHOWSIGN)
++ *p++ = '+';
++ if (dp->flags & FLAG_SPACE)
++ *p++ = ' ';
++ if (dp->flags & FLAG_ALT)
++ *p++ = '#';
++ if (dp->flags & FLAG_ZERO)
++ *p++ = '0';
++ if (dp->width_start != dp->width_end)
++ {
++ size_t n = dp->width_end - dp->width_start;
++ memcpy (p, dp->width_start, n * sizeof (CHAR_T));
++ p += n;
++ }
++ if (dp->precision_start != dp->precision_end)
++ {
++ size_t n = dp->precision_end - dp->precision_start;
++ memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
++ p += n;
++ }
++
++ switch (type)
++ {
++#ifdef HAVE_LONG_LONG
++ case TYPE_LONGLONGINT:
++ case TYPE_ULONGLONGINT:
++ *p++ = 'l';
++ /*FALLTHROUGH*/
++#endif
++ case TYPE_LONGINT:
++ case TYPE_ULONGINT:
++#ifdef HAVE_WINT_T
++ case TYPE_WIDE_CHAR:
++#endif
++#ifdef HAVE_WCHAR_T
++ case TYPE_WIDE_STRING:
++#endif
++ *p++ = 'l';
++ break;
++#ifdef HAVE_LONG_DOUBLE
++ case TYPE_LONGDOUBLE:
++ *p++ = 'L';
++ break;
++#endif
++ default:
++ break;
++ }
++ *p = dp->conversion;
++#if USE_SNPRINTF
++ p[1] = '%';
++ p[2] = 'n';
++ p[3] = '\0';
++#else
++ p[1] = '\0';
++#endif
++
++ /* Construct the arguments for calling snprintf or sprintf. */
++ prefix_count = 0;
++ if (dp->width_arg_index != ARG_NONE)
++ {
++ if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
++ abort ();
++ prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
++ }
++ if (dp->precision_arg_index != ARG_NONE)
++ {
++ if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
++ abort ();
++ prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
++ }
++
++#if USE_SNPRINTF
++ /* Prepare checking whether snprintf returns the count
++ via %n. */
++ ENSURE_ALLOCATION (xsum (length, 1));
++ result[length] = '\0';
++#endif
++
++ for (;;)
++ {
++ size_t maxlen;
++ int count;
++ int retcount;
++
++ maxlen = allocated - length;
++ count = -1;
++ retcount = 0;
++
++#if USE_SNPRINTF
++# define SNPRINTF_BUF(arg) \
++ switch (prefix_count) \
++ { \
++ case 0: \
++ retcount = SNPRINTF (result + length, maxlen, buf, \
++ arg, &count); \
++ break; \
++ case 1: \
++ retcount = SNPRINTF (result + length, maxlen, buf, \
++ prefixes[0], arg, &count); \
++ break; \
++ case 2: \
++ retcount = SNPRINTF (result + length, maxlen, buf, \
++ prefixes[0], prefixes[1], arg, \
++ &count); \
++ break; \
++ default: \
++ abort (); \
++ }
++#else
++# define SNPRINTF_BUF(arg) \
++ switch (prefix_count) \
++ { \
++ case 0: \
++ count = sprintf (tmp, buf, arg); \
++ break; \
++ case 1: \
++ count = sprintf (tmp, buf, prefixes[0], arg); \
++ break; \
++ case 2: \
++ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
++ arg); \
++ break; \
++ default: \
++ abort (); \
++ }
++#endif
++
++ switch (type)
++ {
++ case TYPE_SCHAR:
++ {
++ int arg = a.arg[dp->arg_index].a.a_schar;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_UCHAR:
++ {
++ unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_SHORT:
++ {
++ int arg = a.arg[dp->arg_index].a.a_short;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_USHORT:
++ {
++ unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_INT:
++ {
++ int arg = a.arg[dp->arg_index].a.a_int;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_UINT:
++ {
++ unsigned int arg = a.arg[dp->arg_index].a.a_uint;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_LONGINT:
++ {
++ long int arg = a.arg[dp->arg_index].a.a_longint;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_ULONGINT:
++ {
++ unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#ifdef HAVE_LONG_LONG
++ case TYPE_LONGLONGINT:
++ {
++ long long int arg = a.arg[dp->arg_index].a.a_longlongint;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ case TYPE_ULONGLONGINT:
++ {
++ unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#endif
++ case TYPE_DOUBLE:
++ {
++ double arg = a.arg[dp->arg_index].a.a_double;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#ifdef HAVE_LONG_DOUBLE
++ case TYPE_LONGDOUBLE:
++ {
++ long double arg = a.arg[dp->arg_index].a.a_longdouble;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#endif
++ case TYPE_CHAR:
++ {
++ int arg = a.arg[dp->arg_index].a.a_char;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#ifdef HAVE_WINT_T
++ case TYPE_WIDE_CHAR:
++ {
++ wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#endif
++ case TYPE_STRING:
++ {
++ const char *arg = a.arg[dp->arg_index].a.a_string;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#ifdef HAVE_WCHAR_T
++ case TYPE_WIDE_STRING:
++ {
++ const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++#endif
++ case TYPE_POINTER:
++ {
++ void *arg = a.arg[dp->arg_index].a.a_pointer;
++ SNPRINTF_BUF (arg);
++ }
++ break;
++ default:
++ abort ();
++ }
++
++#if USE_SNPRINTF
++ /* Portability: Not all implementations of snprintf()
++ are ISO C 99 compliant. Determine the number of
++ bytes that snprintf() has produced or would have
++ produced. */
++ if (count >= 0)
++ {
++ /* Verify that snprintf() has NUL-terminated its
++ result. */
++ if (count < maxlen && result[length + count] != '\0')
++ abort ();
++ /* Portability hack. */
++ if (retcount > count)
++ count = retcount;
++ }
++ else
++ {
++ /* snprintf() doesn't understand the '%n'
++ directive. */
++ if (p[1] != '\0')
++ {
++ /* Don't use the '%n' directive; instead, look
++ at the snprintf() return value. */
++ p[1] = '\0';
++ continue;
++ }
++ else
++ {
++ /* Look at the snprintf() return value. */
++ if (retcount < 0)
++ {
++ /* HP-UX 10.20 snprintf() is doubly deficient:
++ It doesn't understand the '%n' directive,
++ *and* it returns -1 (rather than the length
++ that would have been required) when the
++ buffer is too small. */
++ size_t bigger_need =
++ xsum (xtimes (allocated, 2), 12);
++ ENSURE_ALLOCATION (bigger_need);
++ continue;
++ }
++ else
++ count = retcount;
++ }
++ }
++#endif
++
++ /* Attempt to handle failure. */
++ if (count < 0)
++ {
++ if (!(result == resultbuf || result == NULL))
++ free (result);
++ if (buf_malloced != NULL)
++ free (buf_malloced);
++ CLEANUP ();
++ errno = EINVAL;
++ return NULL;
++ }
++
++#if !USE_SNPRINTF
++ if (count >= tmp_length)
++ /* tmp_length was incorrectly calculated - fix the
++ code above! */
++ abort ();
++#endif
++
++ /* Make room for the result. */
++ if (count >= maxlen)
++ {
++ /* Need at least count bytes. But allocate
++ proportionally, to avoid looping eternally if
++ snprintf() reports a too small count. */
++ size_t n =
++ xmax (xsum (length, count), xtimes (allocated, 2));
++
++ ENSURE_ALLOCATION (n);
++#if USE_SNPRINTF
++ continue;
++#endif
++ }
++
++#if USE_SNPRINTF
++ /* The snprintf() result did fit. */
++#else
++ /* Append the sprintf() result. */
++ memcpy (result + length, tmp, count * sizeof (CHAR_T));
++ if (tmp != tmpbuf)
++ free (tmp);
++#endif
++
++ length += count;
++ break;
++ }
++ }
++ }
++ }
++
++ /* Add the final NUL. */
++ ENSURE_ALLOCATION (xsum (length, 1));
++ result[length] = '\0';
++
++ if (result != resultbuf && length + 1 < allocated)
++ {
++ /* Shrink the allocated memory if possible. */
++ CHAR_T *memory;
++
++ memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
++ if (memory != NULL)
++ result = memory;
++ }
++
++ if (buf_malloced != NULL)
++ free (buf_malloced);
++ CLEANUP ();
++ *lengthp = length;
++ return result;
++
++ out_of_memory:
++ if (!(result == resultbuf || result == NULL))
++ free (result);
++ if (buf_malloced != NULL)
++ free (buf_malloced);
++ out_of_memory_1:
++ CLEANUP ();
++ errno = ENOMEM;
++ return NULL;
++ }
++}
++
++#undef SNPRINTF
++#undef USE_SNPRINTF
++#undef PRINTF_PARSE
++#undef DIRECTIVES
++#undef DIRECTIVE
++#undef CHAR_T
++#undef VASNPRINTF
+--- lrzsz-0.12.20.safe/intl/vasnprintf.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnprintf.h 2004-09-12 14:40:34.667700664 -0400
+@@ -0,0 +1,61 @@
++/* vsprintf with automatic memory allocation.
++ Copyright (C) 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _VASNPRINTF_H
++#define _VASNPRINTF_H
++
++/* Get va_list. */
++#include <stdarg.h>
++
++/* Get size_t. */
++#include <stddef.h>
++
++#ifndef __attribute__
++/* This feature is available in gcc versions 2.5 and later. */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
++# define __attribute__(Spec) /* empty */
++# endif
++/* The __-protected variants of `format' and `printf' attributes
++ are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
++# define __format__ format
++# define __printf__ printf
++# endif
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Write formatted output to a string dynamically allocated with malloc().
++ You can pass a preallocated buffer for the result in RESULTBUF and its
++ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
++ If successful, return the address of the string (this may be = RESULTBUF
++ if no dynamic memory allocation was necessary) and set *LENGTHP to the
++ number of resulting bytes, excluding the trailing NUL. Upon error, set
++ errno and return NULL. */
++extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
++ __attribute__ ((__format__ (__printf__, 3, 4)));
++extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
++ __attribute__ ((__format__ (__printf__, 3, 0)));
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _VASNPRINTF_H */
+--- lrzsz-0.12.20.safe/intl/vasnwprintf.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnwprintf.h 2004-09-12 14:40:34.673699752 -0400
+@@ -0,0 +1,46 @@
++/* vswprintf with automatic memory allocation.
++ Copyright (C) 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _VASNWPRINTF_H
++#define _VASNWPRINTF_H
++
++/* Get va_list. */
++#include <stdarg.h>
++
++/* Get wchar_t, size_t. */
++#include <stddef.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Write formatted output to a string dynamically allocated with malloc().
++ You can pass a preallocated buffer for the result in RESULTBUF and its
++ size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
++ If successful, return the address of the string (this may be = RESULTBUF
++ if no dynamic memory allocation was necessary) and set *LENGTHP to the
++ number of resulting bytes, excluding the trailing NUL. Upon error, set
++ errno and return NULL. */
++extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
++extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _VASNWPRINTF_H */
+--- lrzsz-0.12.20.safe/intl/VERSION 1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/VERSION 2004-09-12 14:40:34.679698840 -0400
+@@ -1 +1 @@
+-GNU gettext library from gettext-0.10.32
++GNU gettext library from gettext-0.14.1
+--- lrzsz-0.12.20.safe/intl/wprintf-parse.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/wprintf-parse.h 2004-09-12 14:40:34.695696408 -0400
+@@ -0,0 +1,75 @@
++/* Parse printf format string.
++ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _WPRINTF_PARSE_H
++#define _WPRINTF_PARSE_H
++
++#include "printf-args.h"
++
++
++/* Flags */
++#define FLAG_GROUP 1 /* ' flag */
++#define FLAG_LEFT 2 /* - flag */
++#define FLAG_SHOWSIGN 4 /* + flag */
++#define FLAG_SPACE 8 /* space flag */
++#define FLAG_ALT 16 /* # flag */
++#define FLAG_ZERO 32
++
++/* arg_index value indicating that no argument is consumed. */
++#define ARG_NONE (~(size_t)0)
++
++/* A parsed directive. */
++typedef struct
++{
++ const wchar_t* dir_start;
++ const wchar_t* dir_end;
++ int flags;
++ const wchar_t* width_start;
++ const wchar_t* width_end;
++ size_t width_arg_index;
++ const wchar_t* precision_start;
++ const wchar_t* precision_end;
++ size_t precision_arg_index;
++ wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */
++ size_t arg_index;
++}
++wchar_t_directive;
++
++/* A parsed format string. */
++typedef struct
++{
++ size_t count;
++ wchar_t_directive *dir;
++ size_t max_width_length;
++ size_t max_precision_length;
++}
++wchar_t_directives;
++
++
++/* Parses the format string. Fills in the number N of directives, and fills
++ in directives[0], ..., directives[N-1], and sets directives[N].dir_start
++ to the end of the format string. Also fills in the arg_type fields of the
++ arguments and the needed count of arguments. */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a);
++
++#endif /* _WPRINTF_PARSE_H */
+--- lrzsz-0.12.20.safe/intl/xopen-msg.sed 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/xopen-msg.sed 1969-12-31 19:00:00.000000000 -0500
+@@ -1,104 +0,0 @@
+-# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-#
+-# The first directive in the .msg should be the definition of the
+-# message set number. We use always set number 1.
+-#
+-1 {
+- i\
+-$set 1 # Automatically created by po2msg.sed
+- h
+- s/.*/0/
+- x
+-}
+-#
+-# We copy all comments into the .msg file. Perhaps they can help.
+-#
+-/^#/ s/^#[ ]*/$ /p
+-#
+-# We copy the original message as a comment into the .msg file.
+-#
+-/^msgid/ {
+-# Does not work now
+-# /"$/! {
+-# s/\\$//
+-# s/$/ ... (more lines following)"/
+-# }
+- s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
+- p
+-}
+-#
+-# The .msg file contains, other then the .po file, only the translations
+-# but each given a unique ID. Starting from 1 and incrementing by 1 for
+-# each message we assign them to the messages.
+-# It is important that the .po file used to generate the cat-id-tbl.c file
+-# (with po-to-tbl) is the same as the one used here. (At least the order
+-# of declarations must not be changed.)
+-#
+-/^msgstr/ {
+- s/msgstr[ ]*"\(.*\)"/\1/
+- x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+- td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+- :d
+- s/9\(_*\)$/_\1/
+- td
+-# Assure at least one digit is available.
+- s/^\(_*\)$/0\1/
+-# Increment the last digit.
+- s/8\(_*\)$/9\1/
+- s/7\(_*\)$/8\1/
+- s/6\(_*\)$/7\1/
+- s/5\(_*\)$/6\1/
+- s/4\(_*\)$/5\1/
+- s/3\(_*\)$/4\1/
+- s/2\(_*\)$/3\1/
+- s/1\(_*\)$/2\1/
+- s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+- s/_/0/g
+- x
+-# Bring the line in the format `<number> <message>'
+- G
+- s/^[^\n]*$/& /
+- s/\(.*\)\n\([0-9]*\)/\2 \1/
+-# Clear flag from last substitution.
+- tb
+-# Append the next line.
+- :b
+- N
+-# Look whether second part is a continuation line.
+- s/\(.*\n\)"\(.*\)"/\1\2/
+-# Yes, then branch.
+- ta
+- P
+- D
+-# Note that `D' includes a jump to the start!!
+-# We found a continuation line. But before printing insert '\'.
+- :a
+- s/\(.*\)\(\n.*\)/\1\\\2/
+- P
+-# We cannot use the sed command `D' here
+- s/.*\n\(.*\)/\1/
+- tb
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/xsize.h 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/xsize.h 2004-09-12 14:40:34.700695648 -0400
+@@ -0,0 +1,109 @@
++/* xsize.h -- Checked size_t computations.
++
++ Copyright (C) 2003 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Library General Public License as published
++ by the Free Software Foundation; either version 2, or (at your option)
++ any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Library General Public License for more details.
++
++ You should have received a copy of the GNU Library General Public
++ License along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++ USA. */
++
++#ifndef _XSIZE_H
++#define _XSIZE_H
++
++/* Get size_t. */
++#include <stddef.h>
++
++/* Get SIZE_MAX. */
++#include <limits.h>
++#if HAVE_STDINT_H
++# include <stdint.h>
++#endif
++
++/* The size of memory objects is often computed through expressions of
++ type size_t. Example:
++ void* p = malloc (header_size + n * element_size).
++ These computations can lead to overflow. When this happens, malloc()
++ returns a piece of memory that is way too small, and the program then
++ crashes while attempting to fill the memory.
++ To avoid this, the functions and macros in this file check for overflow.
++ The convention is that SIZE_MAX represents overflow.
++ malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
++ implementation that uses mmap --, it's recommended to use size_overflow_p()
++ or size_in_bounds_p() before invoking malloc().
++ The example thus becomes:
++ size_t size = xsum (header_size, xtimes (n, element_size));
++ void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
++*/
++
++/* Convert an arbitrary value >= 0 to type size_t. */
++#define xcast_size_t(N) \
++ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
++
++/* Sum of two sizes, with overflow check. */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum (size_t size1, size_t size2)
++{
++ size_t sum = size1 + size2;
++ return (sum >= size1 ? sum : SIZE_MAX);
++}
++
++/* Sum of three sizes, with overflow check. */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum3 (size_t size1, size_t size2, size_t size3)
++{
++ return xsum (xsum (size1, size2), size3);
++}
++
++/* Sum of four sizes, with overflow check. */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
++{
++ return xsum (xsum (xsum (size1, size2), size3), size4);
++}
++
++/* Maximum of two sizes, with overflow check. */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xmax (size_t size1, size_t size2)
++{
++ /* No explicit check is needed here, because for any n:
++ max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
++ return (size1 >= size2 ? size1 : size2);
++}
++
++/* Multiplication of a count with an element size, with overflow check.
++ The count must be >= 0 and the element size must be > 0.
++ This is a macro, not an inline function, so that it works correctly even
++ when N is of a wider tupe and N > SIZE_MAX. */
++#define xtimes(N, ELSIZE) \
++ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
++
++/* Check for overflow. */
++#define size_overflow_p(SIZE) \
++ ((SIZE) == SIZE_MAX)
++/* Check against overflow. */
++#define size_in_bounds_p(SIZE) \
++ ((SIZE) != SIZE_MAX)
++
++#endif /* _XSIZE_H */
+--- lrzsz-0.12.20.safe/m4/ChangeLog 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/ChangeLog 2004-09-12 14:40:35.054641840 -0400
+@@ -0,0 +1,32 @@
++2004-09-12 gettextize <bug-gnu-gettext@gnu.org>
++
++ * codeset.m4: New file, from gettext-0.14.1.
++ * gettext.m4: New file, from gettext-0.14.1.
++ * glibc21.m4: New file, from gettext-0.14.1.
++ * iconv.m4: New file, from gettext-0.14.1.
++ * intdiv0.m4: New file, from gettext-0.14.1.
++ * intmax.m4: New file, from gettext-0.14.1.
++ * inttypes.m4: New file, from gettext-0.14.1.
++ * inttypes_h.m4: New file, from gettext-0.14.1.
++ * inttypes-pri.m4: New file, from gettext-0.14.1.
++ * isc-posix.m4: New file, from gettext-0.14.1.
++ * lcmessage.m4: New file, from gettext-0.14.1.
++ * lib-ld.m4: New file, from gettext-0.14.1.
++ * lib-link.m4: New file, from gettext-0.14.1.
++ * lib-prefix.m4: New file, from gettext-0.14.1.
++ * longdouble.m4: New file, from gettext-0.14.1.
++ * longlong.m4: New file, from gettext-0.14.1.
++ * nls.m4: New file, from gettext-0.14.1.
++ * po.m4: New file, from gettext-0.14.1.
++ * printf-posix.m4: New file, from gettext-0.14.1.
++ * progtest.m4: New file, from gettext-0.14.1.
++ * signed.m4: New file, from gettext-0.14.1.
++ * size_max.m4: New file, from gettext-0.14.1.
++ * stdint_h.m4: New file, from gettext-0.14.1.
++ * uintmax_t.m4: New file, from gettext-0.14.1.
++ * ulonglong.m4: New file, from gettext-0.14.1.
++ * wchar_t.m4: New file, from gettext-0.14.1.
++ * wint_t.m4: New file, from gettext-0.14.1.
++ * xsize.m4: New file, from gettext-0.14.1.
++ * Makefile.am: New file.
++
+--- lrzsz-0.12.20.safe/m4/codeset.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/codeset.m4 2004-09-12 14:40:34.820677408 -0400
+@@ -0,0 +1,23 @@
++# codeset.m4 serial AM1 (gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([AM_LANGINFO_CODESET],
++[
++ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
++ [AC_TRY_LINK([#include <langinfo.h>],
++ [char* cs = nl_langinfo(CODESET);],
++ am_cv_langinfo_codeset=yes,
++ am_cv_langinfo_codeset=no)
++ ])
++ if test $am_cv_langinfo_codeset = yes; then
++ AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
++ [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/gettext.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/gettext.m4 2004-09-12 14:40:34.826676496 -0400
+@@ -0,0 +1,487 @@
++# gettext.m4 serial 28 (gettext-0.13)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++dnl Macro to add for using GNU gettext.
++
++dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
++dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
++dnl default (if it is not specified or empty) is 'no-libtool'.
++dnl INTLSYMBOL should be 'external' for packages with no intl directory,
++dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
++dnl If INTLSYMBOL is 'use-libtool', then a libtool library
++dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
++dnl depending on --{enable,disable}-{shared,static} and on the presence of
++dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
++dnl $(top_builddir)/intl/libintl.a will be created.
++dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
++dnl implementations (in libc or libintl) without the ngettext() function
++dnl will be ignored. If NEEDSYMBOL is specified and is
++dnl 'need-formatstring-macros', then GNU gettext implementations that don't
++dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
++dnl INTLDIR is used to find the intl libraries. If empty,
++dnl the value `$(top_builddir)/intl/' is used.
++dnl
++dnl The result of the configuration is one of three cases:
++dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
++dnl and used.
++dnl Catalog format: GNU --> install in $(datadir)
++dnl Catalog extension: .mo after installation, .gmo in source tree
++dnl 2) GNU gettext has been found in the system's C library.
++dnl Catalog format: GNU --> install in $(datadir)
++dnl Catalog extension: .mo after installation, .gmo in source tree
++dnl 3) No internationalization, always use English msgid.
++dnl Catalog format: none
++dnl Catalog extension: none
++dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
++dnl The use of .gmo is historical (it was needed to avoid overwriting the
++dnl GNU format catalogs when building on a platform with an X/Open gettext),
++dnl but we keep it in order not to force irrelevant filename changes on the
++dnl maintainers.
++dnl
++AC_DEFUN([AM_GNU_GETTEXT],
++[
++ dnl Argument checking.
++ ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
++ [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
++])])])])])
++ ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
++ [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
++])])])])
++ define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
++ define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
++
++ AC_REQUIRE([AM_PO_SUBDIRS])dnl
++ ifelse(gt_included_intl, yes, [
++ AC_REQUIRE([AM_INTL_SUBDIR])dnl
++ ])
++
++ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++
++ dnl Sometimes libintl requires libiconv, so first search for libiconv.
++ dnl Ideally we would do this search only after the
++ dnl if test "$USE_NLS" = "yes"; then
++ dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
++ dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
++ dnl the configure script would need to contain the same shell code
++ dnl again, outside any 'if'. There are two solutions:
++ dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
++ dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
++ dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
++ dnl documented, we avoid it.
++ ifelse(gt_included_intl, yes, , [
++ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
++ ])
++
++ dnl Set USE_NLS.
++ AM_NLS
++
++ ifelse(gt_included_intl, yes, [
++ BUILD_INCLUDED_LIBINTL=no
++ USE_INCLUDED_LIBINTL=no
++ ])
++ LIBINTL=
++ LTLIBINTL=
++ POSUB=
++
++ dnl If we use NLS figure out what method
++ if test "$USE_NLS" = "yes"; then
++ gt_use_preinstalled_gnugettext=no
++ ifelse(gt_included_intl, yes, [
++ AC_MSG_CHECKING([whether included gettext is requested])
++ AC_ARG_WITH(included-gettext,
++ [ --with-included-gettext use the GNU gettext library included here],
++ nls_cv_force_use_gnu_gettext=$withval,
++ nls_cv_force_use_gnu_gettext=no)
++ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
++
++ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
++ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
++ ])
++ dnl User does not insist on using GNU NLS library. Figure out what
++ dnl to use. If GNU gettext is available we use this. Else we have
++ dnl to fall back to GNU NLS library.
++
++ dnl Add a version number to the cache macros.
++ define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
++ define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
++ define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
++
++ AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
++ [AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern int *_nl_domain_bindings;],
++ [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
++ gt_cv_func_gnugettext_libc=yes,
++ gt_cv_func_gnugettext_libc=no)])
++
++ if test "$gt_cv_func_gnugettext_libc" != "yes"; then
++ dnl Sometimes libintl requires libiconv, so first search for libiconv.
++ ifelse(gt_included_intl, yes, , [
++ AM_ICONV_LINK
++ ])
++ dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
++ dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
++ dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
++ dnl even if libiconv doesn't exist.
++ AC_LIB_LINKFLAGS_BODY([intl])
++ AC_CACHE_CHECK([for GNU gettext in libintl],
++ gt_cv_func_gnugettext_libintl,
++ [gt_save_CPPFLAGS="$CPPFLAGS"
++ CPPFLAGS="$CPPFLAGS $INCINTL"
++ gt_save_LIBS="$LIBS"
++ LIBS="$LIBS $LIBINTL"
++ dnl Now see whether libintl exists and does not depend on libiconv.
++ AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern
++#ifdef __cplusplus
++"C"
++#endif
++const char *_nl_expand_alias ();],
++ [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
++ gt_cv_func_gnugettext_libintl=yes,
++ gt_cv_func_gnugettext_libintl=no)
++ dnl Now see whether libintl exists and depends on libiconv.
++ if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
++ LIBS="$LIBS $LIBICONV"
++ AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern
++#ifdef __cplusplus
++"C"
++#endif
++const char *_nl_expand_alias ();],
++ [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
++ [LIBINTL="$LIBINTL $LIBICONV"
++ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
++ gt_cv_func_gnugettext_libintl=yes
++ ])
++ fi
++ CPPFLAGS="$gt_save_CPPFLAGS"
++ LIBS="$gt_save_LIBS"])
++ fi
++
++ dnl If an already present or preinstalled GNU gettext() is found,
++ dnl use it. But if this macro is used in GNU gettext, and GNU
++ dnl gettext is already preinstalled in libintl, we update this
++ dnl libintl. (Cf. the install rule in intl/Makefile.in.)
++ if test "$gt_cv_func_gnugettext_libc" = "yes" \
++ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
++ && test "$PACKAGE" != gettext-runtime \
++ && test "$PACKAGE" != gettext-tools; }; then
++ gt_use_preinstalled_gnugettext=yes
++ else
++ dnl Reset the values set by searching for libintl.
++ LIBINTL=
++ LTLIBINTL=
++ INCINTL=
++ fi
++
++ ifelse(gt_included_intl, yes, [
++ if test "$gt_use_preinstalled_gnugettext" != "yes"; then
++ dnl GNU gettext is not found in the C library.
++ dnl Fall back on included GNU gettext library.
++ nls_cv_use_gnu_gettext=yes
++ fi
++ fi
++
++ if test "$nls_cv_use_gnu_gettext" = "yes"; then
++ dnl Mark actions used to generate GNU NLS library.
++ BUILD_INCLUDED_LIBINTL=yes
++ USE_INCLUDED_LIBINTL=yes
++ LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
++ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
++ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
++ fi
++
++ if test "$gt_use_preinstalled_gnugettext" = "yes" \
++ || test "$nls_cv_use_gnu_gettext" = "yes"; then
++ dnl Mark actions to use GNU gettext tools.
++ CATOBJEXT=.gmo
++ fi
++ ])
++
++ if test "$gt_use_preinstalled_gnugettext" = "yes" \
++ || test "$nls_cv_use_gnu_gettext" = "yes"; then
++ AC_DEFINE(ENABLE_NLS, 1,
++ [Define to 1 if translation of program messages to the user's native language
++ is requested.])
++ else
++ USE_NLS=no
++ fi
++ fi
++
++ AC_MSG_CHECKING([whether to use NLS])
++ AC_MSG_RESULT([$USE_NLS])
++ if test "$USE_NLS" = "yes"; then
++ AC_MSG_CHECKING([where the gettext function comes from])
++ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
++ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
++ gt_source="external libintl"
++ else
++ gt_source="libc"
++ fi
++ else
++ gt_source="included intl directory"
++ fi
++ AC_MSG_RESULT([$gt_source])
++ fi
++
++ if test "$USE_NLS" = "yes"; then
++
++ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
++ if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
++ AC_MSG_CHECKING([how to link with libintl])
++ AC_MSG_RESULT([$LIBINTL])
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
++ fi
++
++ dnl For backward compatibility. Some packages may be using this.
++ AC_DEFINE(HAVE_GETTEXT, 1,
++ [Define if the GNU gettext() function is already present or preinstalled.])
++ AC_DEFINE(HAVE_DCGETTEXT, 1,
++ [Define if the GNU dcgettext() function is already present or preinstalled.])
++ fi
++
++ dnl We need to process the po/ directory.
++ POSUB=po
++ fi
++
++ ifelse(gt_included_intl, yes, [
++ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
++ dnl to 'yes' because some of the testsuite requires it.
++ if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
++ BUILD_INCLUDED_LIBINTL=yes
++ fi
++
++ dnl Make all variables we use known to autoconf.
++ AC_SUBST(BUILD_INCLUDED_LIBINTL)
++ AC_SUBST(USE_INCLUDED_LIBINTL)
++ AC_SUBST(CATOBJEXT)
++
++ dnl For backward compatibility. Some configure.ins may be using this.
++ nls_cv_header_intl=
++ nls_cv_header_libgt=
++
++ dnl For backward compatibility. Some Makefiles may be using this.
++ DATADIRNAME=share
++ AC_SUBST(DATADIRNAME)
++
++ dnl For backward compatibility. Some Makefiles may be using this.
++ INSTOBJEXT=.mo
++ AC_SUBST(INSTOBJEXT)
++
++ dnl For backward compatibility. Some Makefiles may be using this.
++ GENCAT=gencat
++ AC_SUBST(GENCAT)
++
++ dnl For backward compatibility. Some Makefiles may be using this.
++ if test "$USE_INCLUDED_LIBINTL" = yes; then
++ INTLOBJS="\$(GETTOBJS)"
++ fi
++ AC_SUBST(INTLOBJS)
++
++ dnl Enable libtool support if the surrounding package wishes it.
++ INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
++ AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
++ ])
++
++ dnl For backward compatibility. Some Makefiles may be using this.
++ INTLLIBS="$LIBINTL"
++ AC_SUBST(INTLLIBS)
++
++ dnl Make all documented variables known to autoconf.
++ AC_SUBST(LIBINTL)
++ AC_SUBST(LTLIBINTL)
++ AC_SUBST(POSUB)
++])
++
++
++dnl Checks for all prerequisites of the intl subdirectory,
++dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
++dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
++AC_DEFUN([AM_INTL_SUBDIR],
++[
++ AC_REQUIRE([AC_PROG_INSTALL])dnl
++ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
++ AC_REQUIRE([AC_PROG_CC])dnl
++ AC_REQUIRE([AC_CANONICAL_HOST])dnl
++ AC_REQUIRE([AC_PROG_RANLIB])dnl
++ AC_REQUIRE([AC_ISC_POSIX])dnl
++ AC_REQUIRE([AC_HEADER_STDC])dnl
++ AC_REQUIRE([AC_C_CONST])dnl
++ AC_REQUIRE([bh_C_SIGNED])dnl
++ AC_REQUIRE([AC_C_INLINE])dnl
++ AC_REQUIRE([AC_TYPE_OFF_T])dnl
++ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
++ AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
++ AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
++ AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
++ AC_REQUIRE([gt_TYPE_WINT_T])dnl
++ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++ AC_REQUIRE([gt_TYPE_INTMAX_T])
++ AC_REQUIRE([gt_PRINTF_POSIX])
++ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
++ AC_REQUIRE([AC_FUNC_MMAP])dnl
++ AC_REQUIRE([jm_GLIBC21])dnl
++ AC_REQUIRE([gt_INTDIV0])dnl
++ AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
++ AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
++ AC_REQUIRE([gt_INTTYPES_PRI])dnl
++ AC_REQUIRE([gl_XSIZE])dnl
++
++ AC_CHECK_TYPE([ptrdiff_t], ,
++ [AC_DEFINE([ptrdiff_t], [long],
++ [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
++ ])
++ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
++stdlib.h string.h unistd.h sys/param.h])
++ AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
++mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
++strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
++__fsetlocking])
++
++ dnl Use the _snprintf function only if it is declared (because on NetBSD it
++ dnl is defined as a weak alias of snprintf; we prefer to use the latter).
++ gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
++ gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
++
++ dnl Use the *_unlocked functions only if they are declared.
++ dnl (because some of them were defined without being declared in Solaris
++ dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
++ dnl on Solaris 2.5.1 to run on Solaris 2.6).
++ dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
++ gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
++ gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
++ gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
++
++ case $gt_cv_func_printf_posix in
++ *yes) HAVE_POSIX_PRINTF=1 ;;
++ *) HAVE_POSIX_PRINTF=0 ;;
++ esac
++ AC_SUBST([HAVE_POSIX_PRINTF])
++ if test "$ac_cv_func_asprintf" = yes; then
++ HAVE_ASPRINTF=1
++ else
++ HAVE_ASPRINTF=0
++ fi
++ AC_SUBST([HAVE_ASPRINTF])
++ if test "$ac_cv_func_snprintf" = yes; then
++ HAVE_SNPRINTF=1
++ else
++ HAVE_SNPRINTF=0
++ fi
++ AC_SUBST([HAVE_SNPRINTF])
++ if test "$ac_cv_func_wprintf" = yes; then
++ HAVE_WPRINTF=1
++ else
++ HAVE_WPRINTF=0
++ fi
++ AC_SUBST([HAVE_WPRINTF])
++
++ AM_ICONV
++ AM_LANGINFO_CODESET
++ if test $ac_cv_header_locale_h = yes; then
++ AM_LC_MESSAGES
++ fi
++
++ dnl intl/plural.c is generated from intl/plural.y. It requires bison,
++ dnl because plural.y uses bison specific features. It requires at least
++ dnl bison-1.26 because earlier versions generate a plural.c that doesn't
++ dnl compile.
++ dnl bison is only needed for the maintainer (who touches plural.y). But in
++ dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
++ dnl the rule in general Makefile. Now, some people carelessly touch the
++ dnl files or have a broken "make" program, hence the plural.c rule will
++ dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
++ dnl present or too old.
++ AC_CHECK_PROGS([INTLBISON], [bison])
++ if test -z "$INTLBISON"; then
++ ac_verc_fail=yes
++ else
++ dnl Found it, now check the version.
++ AC_MSG_CHECKING([version of bison])
++changequote(<<,>>)dnl
++ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
++ case $ac_prog_version in
++ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
++ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
++changequote([,])dnl
++ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
++ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
++ esac
++ AC_MSG_RESULT([$ac_prog_version])
++ fi
++ if test $ac_verc_fail = yes; then
++ INTLBISON=:
++ fi
++])
++
++
++dnl gt_CHECK_DECL(FUNC, INCLUDES)
++dnl Check whether a function is declared.
++AC_DEFUN([gt_CHECK_DECL],
++[
++ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
++ [AC_TRY_COMPILE([$2], [
++#ifndef $1
++ char *p = (char *) $1;
++#endif
++], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
++ if test $ac_cv_have_decl_$1 = yes; then
++ gt_value=1
++ else
++ gt_value=0
++ fi
++ AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
++ [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
++])
++
++
++dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
++AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+--- lrzsz-0.12.20.safe/m4/glibc21.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/glibc21.m4 2004-09-12 14:40:34.833675432 -0400
+@@ -0,0 +1,32 @@
++# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# Test for the GNU C Library, version 2.1 or newer.
++# From Bruno Haible.
++
++AC_DEFUN([jm_GLIBC21],
++ [
++ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
++ ac_cv_gnu_library_2_1,
++ [AC_EGREP_CPP([Lucky GNU user],
++ [
++#include <features.h>
++#ifdef __GNU_LIBRARY__
++ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
++ Lucky GNU user
++ #endif
++#endif
++ ],
++ ac_cv_gnu_library_2_1=yes,
++ ac_cv_gnu_library_2_1=no)
++ ]
++ )
++ AC_SUBST(GLIBC21)
++ GLIBC21="$ac_cv_gnu_library_2_1"
++ ]
++)
+--- lrzsz-0.12.20.safe/m4/iconv.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/iconv.m4 2004-09-12 14:40:34.839674520 -0400
+@@ -0,0 +1,103 @@
++# iconv.m4 serial AM4 (gettext-0.11.3)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
++[
++ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++
++ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
++ dnl accordingly.
++ AC_LIB_LINKFLAGS_BODY([iconv])
++])
++
++AC_DEFUN([AM_ICONV_LINK],
++[
++ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
++ dnl those with the standalone portable GNU libiconv installed).
++
++ dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
++ dnl accordingly.
++ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
++
++ dnl Add $INCICONV to CPPFLAGS before performing the following checks,
++ dnl because if the user has installed libiconv and not disabled its use
++ dnl via --without-libiconv-prefix, he wants to use it. The first
++ dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
++ am_save_CPPFLAGS="$CPPFLAGS"
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
++
++ AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
++ am_cv_func_iconv="no, consider installing GNU libiconv"
++ am_cv_lib_iconv=no
++ AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ am_cv_func_iconv=yes)
++ if test "$am_cv_func_iconv" != yes; then
++ am_save_LIBS="$LIBS"
++ LIBS="$LIBS $LIBICONV"
++ AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++ [iconv_t cd = iconv_open("","");
++ iconv(cd,NULL,NULL,NULL,NULL);
++ iconv_close(cd);],
++ am_cv_lib_iconv=yes
++ am_cv_func_iconv=yes)
++ LIBS="$am_save_LIBS"
++ fi
++ ])
++ if test "$am_cv_func_iconv" = yes; then
++ AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
++ fi
++ if test "$am_cv_lib_iconv" = yes; then
++ AC_MSG_CHECKING([how to link with libiconv])
++ AC_MSG_RESULT([$LIBICONV])
++ else
++ dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
++ dnl either.
++ CPPFLAGS="$am_save_CPPFLAGS"
++ LIBICONV=
++ LTLIBICONV=
++ fi
++ AC_SUBST(LIBICONV)
++ AC_SUBST(LTLIBICONV)
++])
++
++AC_DEFUN([AM_ICONV],
++[
++ AM_ICONV_LINK
++ if test "$am_cv_func_iconv" = yes; then
++ AC_MSG_CHECKING([for iconv declaration])
++ AC_CACHE_VAL(am_cv_proto_iconv, [
++ AC_TRY_COMPILE([
++#include <stdlib.h>
++#include <iconv.h>
++extern
++#ifdef __cplusplus
++"C"
++#endif
++#if defined(__STDC__) || defined(__cplusplus)
++size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
++#else
++size_t iconv();
++#endif
++], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
++ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
++ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
++ AC_MSG_RESULT([$]{ac_t:-
++ }[$]am_cv_proto_iconv)
++ AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
++ [Define as const if the declaration of iconv() needs const.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/intdiv0.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/intdiv0.m4 2004-09-12 14:40:34.845673608 -0400
+@@ -0,0 +1,72 @@
++# intdiv0.m4 serial 1 (gettext-0.11.3)
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gt_INTDIV0],
++[
++ AC_REQUIRE([AC_PROG_CC])dnl
++ AC_REQUIRE([AC_CANONICAL_HOST])dnl
++
++ AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
++ gt_cv_int_divbyzero_sigfpe,
++ [
++ AC_TRY_RUN([
++#include <stdlib.h>
++#include <signal.h>
++
++static void
++#ifdef __cplusplus
++sigfpe_handler (int sig)
++#else
++sigfpe_handler (sig) int sig;
++#endif
++{
++ /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
++ exit (sig != SIGFPE);
++}
++
++int x = 1;
++int y = 0;
++int z;
++int nan;
++
++int main ()
++{
++ signal (SIGFPE, sigfpe_handler);
++/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
++#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
++ signal (SIGTRAP, sigfpe_handler);
++#endif
++/* Linux/SPARC yields signal SIGILL. */
++#if defined (__sparc__) && defined (__linux__)
++ signal (SIGILL, sigfpe_handler);
++#endif
++
++ z = x / y;
++ nan = y / y;
++ exit (1);
++}
++], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
++ [
++ # Guess based on the CPU.
++ case "$host_cpu" in
++ alpha* | i[34567]86 | m68k | s390*)
++ gt_cv_int_divbyzero_sigfpe="guessing yes";;
++ *)
++ gt_cv_int_divbyzero_sigfpe="guessing no";;
++ esac
++ ])
++ ])
++ case "$gt_cv_int_divbyzero_sigfpe" in
++ *yes) value=1;;
++ *) value=0;;
++ esac
++ AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
++ [Define if integer division by zero raises signal SIGFPE.])
++])
+--- lrzsz-0.12.20.safe/m4/intmax.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/intmax.m4 2004-09-12 14:40:34.855672088 -0400
+@@ -0,0 +1,32 @@
++# intmax.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the system has the 'intmax_t' type, but don't attempt to
++dnl find a replacement if it is lacking.
++
++AC_DEFUN([gt_TYPE_INTMAX_T],
++[
++ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++ AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
++ [AC_TRY_COMPILE([
++#include <stddef.h>
++#include <stdlib.h>
++#if HAVE_STDINT_H_WITH_UINTMAX
++#include <stdint.h>
++#endif
++#if HAVE_INTTYPES_H_WITH_UINTMAX
++#include <inttypes.h>
++#endif
++], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
++ if test $gt_cv_c_intmax_t = yes; then
++ AC_DEFINE(HAVE_INTMAX_T, 1,
++ [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes_h.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes_h.m4 2004-09-12 14:40:34.868670112 -0400
+@@ -0,0 +1,28 @@
++# inttypes_h.m4 serial 5 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
++[
++ AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
++ [AC_TRY_COMPILE(
++ [#include <sys/types.h>
++#include <inttypes.h>],
++ [uintmax_t i = (uintmax_t) -1;],
++ jm_ac_cv_header_inttypes_h=yes,
++ jm_ac_cv_header_inttypes_h=no)])
++ if test $jm_ac_cv_header_inttypes_h = yes; then
++ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
++ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
++ and declares uintmax_t. ])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes.m4 2004-09-12 14:40:34.861671176 -0400
+@@ -0,0 +1,27 @@
++# inttypes.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
++# <sys/types.h>.
++
++AC_DEFUN([gt_HEADER_INTTYPES_H],
++[
++ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
++ [
++ AC_TRY_COMPILE(
++ [#include <sys/types.h>
++#include <inttypes.h>],
++ [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
++ ])
++ if test $gt_cv_header_inttypes_h = yes; then
++ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
++ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes-pri.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes-pri.m4 2004-09-12 14:40:34.874669200 -0400
+@@ -0,0 +1,32 @@
++# inttypes-pri.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
++# macros to non-string values. This is the case on AIX 4.3.3.
++
++AC_DEFUN([gt_INTTYPES_PRI],
++[
++ AC_REQUIRE([gt_HEADER_INTTYPES_H])
++ if test $gt_cv_header_inttypes_h = yes; then
++ AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
++ gt_cv_inttypes_pri_broken,
++ [
++ AC_TRY_COMPILE([#include <inttypes.h>
++#ifdef PRId32
++char *p = PRId32;
++#endif
++], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
++ ])
++ fi
++ if test "$gt_cv_inttypes_pri_broken" = yes; then
++ AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
++ [Define if <inttypes.h> exists and defines unusable PRI* macros.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/isc-posix.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/isc-posix.m4 2004-09-12 14:40:34.885667528 -0400
+@@ -0,0 +1,26 @@
++# isc-posix.m4 serial 2 (gettext-0.11.2)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
++
++# This test replaces the one in autoconf.
++# Currently this macro should have the same name as the autoconf macro
++# because gettext's gettext.m4 (distributed in the automake package)
++# still uses it. Otherwise, the use in gettext.m4 makes autoheader
++# give these diagnostics:
++# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
++# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
++
++undefine([AC_ISC_POSIX])
++
++AC_DEFUN([AC_ISC_POSIX],
++ [
++ dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
++ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
++ ]
++)
+--- lrzsz-0.12.20.safe/m4/lcmessage.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lcmessage.m4 2004-09-12 14:40:34.902664944 -0400
+@@ -0,0 +1,32 @@
++# lcmessage.m4 serial 3 (gettext-0.11.3)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
++
++# Check whether LC_MESSAGES is available in <locale.h>.
++
++AC_DEFUN([AM_LC_MESSAGES],
++[
++ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
++ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
++ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
++ if test $am_cv_val_LC_MESSAGES = yes; then
++ AC_DEFINE(HAVE_LC_MESSAGES, 1,
++ [Define if your <locale.h> file defines LC_MESSAGES.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/lib-ld.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-ld.m4 2004-09-12 14:40:34.908664032 -0400
+@@ -0,0 +1,112 @@
++# lib-ld.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl Subroutines of libtool.m4,
++dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
++dnl with libtool.m4.
++
++dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
++AC_DEFUN([AC_LIB_PROG_LD_GNU],
++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
++case `$LD -v 2>&1 </dev/null` in
++*GNU* | *'with BFD'*)
++ acl_cv_prog_gnu_ld=yes ;;
++*)
++ acl_cv_prog_gnu_ld=no ;;
++esac])
++with_gnu_ld=$acl_cv_prog_gnu_ld
++])
++
++dnl From libtool-1.4. Sets the variable LD.
++AC_DEFUN([AC_LIB_PROG_LD],
++[AC_ARG_WITH(gnu-ld,
++[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
++test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++ac_prog=ld
++if test "$GCC" = yes; then
++ # Check if gcc -print-prog-name=ld gives a path.
++ AC_MSG_CHECKING([for ld used by GCC])
++ case $host in
++ *-*-mingw*)
++ # gcc leaves a trailing carriage return which upsets mingw
++ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
++ *)
++ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
++ esac
++ case $ac_prog in
++ # Accept absolute paths.
++ [[\\/]* | [A-Za-z]:[\\/]*)]
++ [re_direlt='/[^/][^/]*/\.\./']
++ # Canonicalize the path of ld
++ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
++ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
++ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
++ done
++ test -z "$LD" && LD="$ac_prog"
++ ;;
++ "")
++ # If it fails, then pretend we aren't using GCC.
++ ac_prog=ld
++ ;;
++ *)
++ # If it is relative, then search for the first ld in PATH.
++ with_gnu_ld=unknown
++ ;;
++ esac
++elif test "$with_gnu_ld" = yes; then
++ AC_MSG_CHECKING([for GNU ld])
++else
++ AC_MSG_CHECKING([for non-GNU ld])
++fi
++AC_CACHE_VAL(acl_cv_path_LD,
++[if test -z "$LD"; then
++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++ for ac_dir in $PATH; do
++ test -z "$ac_dir" && ac_dir=.
++ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
++ acl_cv_path_LD="$ac_dir/$ac_prog"
++ # Check to see if the program is GNU ld. I'd rather use --version,
++ # but apparently some GNU ld's only accept -v.
++ # Break only if it was the GNU/non-GNU ld that we prefer.
++ case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
++ *GNU* | *'with BFD'*)
++ test "$with_gnu_ld" != no && break ;;
++ *)
++ test "$with_gnu_ld" != yes && break ;;
++ esac
++ fi
++ done
++ IFS="$ac_save_ifs"
++else
++ acl_cv_path_LD="$LD" # Let the user override the test with a path.
++fi])
++LD="$acl_cv_path_LD"
++if test -n "$LD"; then
++ AC_MSG_RESULT($LD)
++else
++ AC_MSG_RESULT(no)
++fi
++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
++AC_LIB_PROG_LD_GNU
++])
+--- lrzsz-0.12.20.safe/m4/lib-link.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-link.m4 2004-09-12 14:40:34.914663120 -0400
+@@ -0,0 +1,551 @@
++# lib-link.m4 serial 4 (gettext-0.12)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
++dnl augments the CPPFLAGS variable.
++AC_DEFUN([AC_LIB_LINKFLAGS],
++[
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++ define([Name],[translit([$1],[./-], [___])])
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++ AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
++ AC_LIB_LINKFLAGS_BODY([$1], [$2])
++ ac_cv_lib[]Name[]_libs="$LIB[]NAME"
++ ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
++ ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++ ])
++ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
++ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
++ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++ AC_SUBST([LIB]NAME)
++ AC_SUBST([LTLIB]NAME)
++ dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
++ dnl results of this search when this library appears as a dependency.
++ HAVE_LIB[]NAME=yes
++ undefine([Name])
++ undefine([NAME])
++])
++
++dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
++dnl searches for libname and the libraries corresponding to explicit and
++dnl implicit dependencies, together with the specified include files and
++dnl the ability to compile and link the specified testcode. If found, it
++dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
++dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
++dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
++dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
++AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
++[
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ AC_REQUIRE([AC_LIB_RPATH])
++ define([Name],[translit([$1],[./-], [___])])
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++
++ dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
++ dnl accordingly.
++ AC_LIB_LINKFLAGS_BODY([$1], [$2])
++
++ dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
++ dnl because if the user has installed lib[]Name and not disabled its use
++ dnl via --without-lib[]Name-prefix, he wants to use it.
++ ac_save_CPPFLAGS="$CPPFLAGS"
++ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++
++ AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
++ ac_save_LIBS="$LIBS"
++ LIBS="$LIBS $LIB[]NAME"
++ AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
++ LIBS="$ac_save_LIBS"
++ ])
++ if test "$ac_cv_lib[]Name" = yes; then
++ HAVE_LIB[]NAME=yes
++ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
++ AC_MSG_CHECKING([how to link with lib[]$1])
++ AC_MSG_RESULT([$LIB[]NAME])
++ else
++ HAVE_LIB[]NAME=no
++ dnl If $LIB[]NAME didn't lead to a usable library, we don't need
++ dnl $INC[]NAME either.
++ CPPFLAGS="$ac_save_CPPFLAGS"
++ LIB[]NAME=
++ LTLIB[]NAME=
++ fi
++ AC_SUBST([HAVE_LIB]NAME)
++ AC_SUBST([LIB]NAME)
++ AC_SUBST([LTLIB]NAME)
++ undefine([Name])
++ undefine([NAME])
++])
++
++dnl Determine the platform dependent parameters needed to use rpath:
++dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
++dnl hardcode_direct, hardcode_minus_L.
++AC_DEFUN([AC_LIB_RPATH],
++[
++ AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
++ AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
++ AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
++ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
++ AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
++ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
++ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
++ . ./conftest.sh
++ rm -f ./conftest.sh
++ acl_cv_rpath=done
++ ])
++ wl="$acl_cv_wl"
++ libext="$acl_cv_libext"
++ shlibext="$acl_cv_shlibext"
++ hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++ hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++ hardcode_direct="$acl_cv_hardcode_direct"
++ hardcode_minus_L="$acl_cv_hardcode_minus_L"
++ dnl Determine whether the user wants rpath handling at all.
++ AC_ARG_ENABLE(rpath,
++ [ --disable-rpath do not hardcode runtime library paths],
++ :, enable_rpath=yes)
++])
++
++dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
++AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
++[
++ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++ [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++ dnl By default, look in $includedir and $libdir.
++ use_additional=yes
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ AC_LIB_ARG_WITH([lib$1-prefix],
++[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
++ --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
++[
++ if test "X$withval" = "Xno"; then
++ use_additional=no
++ else
++ if test "X$withval" = "X"; then
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ else
++ additional_includedir="$withval/include"
++ additional_libdir="$withval/lib"
++ fi
++ fi
++])
++ dnl Search the library and its dependencies in $additional_libdir and
++ dnl $LDFLAGS. Using breadth-first-seach.
++ LIB[]NAME=
++ LTLIB[]NAME=
++ INC[]NAME=
++ rpathdirs=
++ ltrpathdirs=
++ names_already_handled=
++ names_next_round='$1 $2'
++ while test -n "$names_next_round"; do
++ names_this_round="$names_next_round"
++ names_next_round=
++ for name in $names_this_round; do
++ already_handled=
++ for n in $names_already_handled; do
++ if test "$n" = "$name"; then
++ already_handled=yes
++ break
++ fi
++ done
++ if test -z "$already_handled"; then
++ names_already_handled="$names_already_handled $name"
++ dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
++ dnl or AC_LIB_HAVE_LINKFLAGS call.
++ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
++ eval value=\"\$HAVE_LIB$uppername\"
++ if test -n "$value"; then
++ if test "$value" = yes; then
++ eval value=\"\$LIB$uppername\"
++ test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
++ eval value=\"\$LTLIB$uppername\"
++ test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
++ else
++ dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
++ dnl that this library doesn't exist. So just drop it.
++ :
++ fi
++ else
++ dnl Search the library lib$name in $additional_libdir and $LDFLAGS
++ dnl and the already constructed $LIBNAME/$LTLIBNAME.
++ found_dir=
++ found_la=
++ found_so=
++ found_a=
++ if test $use_additional = yes; then
++ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
++ found_dir="$additional_libdir"
++ found_so="$additional_libdir/lib$name.$shlibext"
++ if test -f "$additional_libdir/lib$name.la"; then
++ found_la="$additional_libdir/lib$name.la"
++ fi
++ else
++ if test -f "$additional_libdir/lib$name.$libext"; then
++ found_dir="$additional_libdir"
++ found_a="$additional_libdir/lib$name.$libext"
++ if test -f "$additional_libdir/lib$name.la"; then
++ found_la="$additional_libdir/lib$name.la"
++ fi
++ fi
++ fi
++ fi
++ if test "X$found_dir" = "X"; then
++ for x in $LDFLAGS $LTLIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ case "$x" in
++ -L*)
++ dir=`echo "X$x" | sed -e 's/^X-L//'`
++ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
++ found_dir="$dir"
++ found_so="$dir/lib$name.$shlibext"
++ if test -f "$dir/lib$name.la"; then
++ found_la="$dir/lib$name.la"
++ fi
++ else
++ if test -f "$dir/lib$name.$libext"; then
++ found_dir="$dir"
++ found_a="$dir/lib$name.$libext"
++ if test -f "$dir/lib$name.la"; then
++ found_la="$dir/lib$name.la"
++ fi
++ fi
++ fi
++ ;;
++ esac
++ if test "X$found_dir" != "X"; then
++ break
++ fi
++ done
++ fi
++ if test "X$found_dir" != "X"; then
++ dnl Found the library.
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
++ if test "X$found_so" != "X"; then
++ dnl Linking with a shared library. We attempt to hardcode its
++ dnl directory into the executable's runpath, unless it's the
++ dnl standard /usr/lib.
++ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
++ dnl No hardcoding is needed.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ dnl Use an explicit option to hardcode DIR into the resulting
++ dnl binary.
++ dnl Potentially add DIR to ltrpathdirs.
++ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++ haveit=
++ for x in $ltrpathdirs; do
++ if test "X$x" = "X$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ ltrpathdirs="$ltrpathdirs $found_dir"
++ fi
++ dnl The hardcoding into $LIBNAME is system dependent.
++ if test "$hardcode_direct" = yes; then
++ dnl Using DIR/libNAME.so during linking hardcodes DIR into the
++ dnl resulting binary.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
++ dnl Use an explicit option to hardcode DIR into the resulting
++ dnl binary.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ dnl Potentially add DIR to rpathdirs.
++ dnl The rpathdirs will be appended to $LIBNAME at the end.
++ haveit=
++ for x in $rpathdirs; do
++ if test "X$x" = "X$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ rpathdirs="$rpathdirs $found_dir"
++ fi
++ else
++ dnl Rely on "-L$found_dir".
++ dnl But don't add it if it's already contained in the LDFLAGS
++ dnl or the already constructed $LIBNAME
++ haveit=
++ for x in $LDFLAGS $LIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$found_dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
++ fi
++ if test "$hardcode_minus_L" != no; then
++ dnl FIXME: Not sure whether we should use
++ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++ dnl here.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++ else
++ dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
++ dnl here, because this doesn't fit in flags passed to the
++ dnl compiler. So give up. No hardcoding. This affects only
++ dnl very old systems.
++ dnl FIXME: Not sure whether we should use
++ dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++ dnl here.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++ fi
++ fi
++ fi
++ fi
++ else
++ if test "X$found_a" != "X"; then
++ dnl Linking with a static library.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
++ else
++ dnl We shouldn't come here, but anyway it's good to have a
++ dnl fallback.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
++ fi
++ fi
++ dnl Assume the include files are nearby.
++ additional_includedir=
++ case "$found_dir" in
++ */lib | */lib/)
++ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
++ additional_includedir="$basedir/include"
++ ;;
++ esac
++ if test "X$additional_includedir" != "X"; then
++ dnl Potentially add $additional_includedir to $INCNAME.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/include,
++ dnl 2. if it's /usr/local/include and we are using GCC on Linux,
++ dnl 3. if it's already present in $CPPFLAGS or the already
++ dnl constructed $INCNAME,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_includedir" != "X/usr/include"; then
++ haveit=
++ if test "X$additional_includedir" = "X/usr/local/include"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux*) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ for x in $CPPFLAGS $INC[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-I$additional_includedir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_includedir"; then
++ dnl Really add $additional_includedir to $INCNAME.
++ INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
++ fi
++ fi
++ fi
++ fi
++ fi
++ dnl Look for dependencies.
++ if test -n "$found_la"; then
++ dnl Read the .la file. It defines the variables
++ dnl dlname, library_names, old_library, dependency_libs, current,
++ dnl age, revision, installed, dlopen, dlpreopen, libdir.
++ save_libdir="$libdir"
++ case "$found_la" in
++ */* | *\\*) . "$found_la" ;;
++ *) . "./$found_la" ;;
++ esac
++ libdir="$save_libdir"
++ dnl We use only dependency_libs.
++ for dep in $dependency_libs; do
++ case "$dep" in
++ -L*)
++ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
++ dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/lib,
++ dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
++ dnl 3. if it's already present in $LDFLAGS or the already
++ dnl constructed $LIBNAME,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_libdir" != "X/usr/lib"; then
++ haveit=
++ if test "X$additional_libdir" = "X/usr/local/lib"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux*) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ haveit=
++ for x in $LDFLAGS $LIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LIBNAME.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
++ fi
++ fi
++ haveit=
++ for x in $LDFLAGS $LTLIB[]NAME; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LTLIBNAME.
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
++ fi
++ fi
++ fi
++ fi
++ ;;
++ -R*)
++ dir=`echo "X$dep" | sed -e 's/^X-R//'`
++ if test "$enable_rpath" != no; then
++ dnl Potentially add DIR to rpathdirs.
++ dnl The rpathdirs will be appended to $LIBNAME at the end.
++ haveit=
++ for x in $rpathdirs; do
++ if test "X$x" = "X$dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ rpathdirs="$rpathdirs $dir"
++ fi
++ dnl Potentially add DIR to ltrpathdirs.
++ dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++ haveit=
++ for x in $ltrpathdirs; do
++ if test "X$x" = "X$dir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ ltrpathdirs="$ltrpathdirs $dir"
++ fi
++ fi
++ ;;
++ -l*)
++ dnl Handle this in the next round.
++ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
++ ;;
++ *.la)
++ dnl Handle this in the next round. Throw away the .la's
++ dnl directory; it is already contained in a preceding -L
++ dnl option.
++ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
++ ;;
++ *)
++ dnl Most likely an immediate library name.
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
++ ;;
++ esac
++ done
++ fi
++ else
++ dnl Didn't find the library; assume it is in the system directories
++ dnl known to the linker and runtime loader. (All the system
++ dnl directories known to the linker should also be known to the
++ dnl runtime loader, otherwise the system is severely misconfigured.)
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
++ fi
++ fi
++ fi
++ done
++ done
++ if test "X$rpathdirs" != "X"; then
++ if test -n "$hardcode_libdir_separator"; then
++ dnl Weird platform: only the last -rpath option counts, the user must
++ dnl pass all path elements in one option. We can arrange that for a
++ dnl single library, but not when more than one $LIBNAMEs are used.
++ alldirs=
++ for found_dir in $rpathdirs; do
++ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
++ done
++ dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++ acl_save_libdir="$libdir"
++ libdir="$alldirs"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++ else
++ dnl The -rpath options are cumulative.
++ for found_dir in $rpathdirs; do
++ acl_save_libdir="$libdir"
++ libdir="$found_dir"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ libdir="$acl_save_libdir"
++ LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++ done
++ fi
++ fi
++ if test "X$ltrpathdirs" != "X"; then
++ dnl When using libtool, the option that works for both libraries and
++ dnl executables is -R. The -R options are cumulative.
++ for found_dir in $ltrpathdirs; do
++ LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
++ done
++ fi
++])
++
++dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
++dnl unless already present in VAR.
++dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
++dnl contains two or three consecutive elements that belong together.
++AC_DEFUN([AC_LIB_APPENDTOVAR],
++[
++ for element in [$2]; do
++ haveit=
++ for x in $[$1]; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X$element"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ [$1]="${[$1]}${[$1]:+ }$element"
++ fi
++ done
++])
+--- lrzsz-0.12.20.safe/m4/lib-prefix.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-prefix.m4 2004-09-12 14:40:34.921662056 -0400
+@@ -0,0 +1,155 @@
++# lib-prefix.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
++dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
++dnl require excessive bracketing.
++ifdef([AC_HELP_STRING],
++[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
++[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
++
++dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
++dnl to access previously installed libraries. The basic assumption is that
++dnl a user will want packages to use other packages he previously installed
++dnl with the same --prefix option.
++dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
++dnl libraries, but is otherwise very convenient.
++AC_DEFUN([AC_LIB_PREFIX],
++[
++ AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
++ AC_REQUIRE([AC_PROG_CC])
++ AC_REQUIRE([AC_CANONICAL_HOST])
++ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++ dnl By default, look in $includedir and $libdir.
++ use_additional=yes
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ AC_LIB_ARG_WITH([lib-prefix],
++[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
++ --without-lib-prefix don't search for libraries in includedir and libdir],
++[
++ if test "X$withval" = "Xno"; then
++ use_additional=no
++ else
++ if test "X$withval" = "X"; then
++ AC_LIB_WITH_FINAL_PREFIX([
++ eval additional_includedir=\"$includedir\"
++ eval additional_libdir=\"$libdir\"
++ ])
++ else
++ additional_includedir="$withval/include"
++ additional_libdir="$withval/lib"
++ fi
++ fi
++])
++ if test $use_additional = yes; then
++ dnl Potentially add $additional_includedir to $CPPFLAGS.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/include,
++ dnl 2. if it's already present in $CPPFLAGS,
++ dnl 3. if it's /usr/local/include and we are using GCC on Linux,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_includedir" != "X/usr/include"; then
++ haveit=
++ for x in $CPPFLAGS; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-I$additional_includedir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test "X$additional_includedir" = "X/usr/local/include"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux*) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ if test -d "$additional_includedir"; then
++ dnl Really add $additional_includedir to $CPPFLAGS.
++ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
++ fi
++ fi
++ fi
++ fi
++ dnl Potentially add $additional_libdir to $LDFLAGS.
++ dnl But don't add it
++ dnl 1. if it's the standard /usr/lib,
++ dnl 2. if it's already present in $LDFLAGS,
++ dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
++ dnl 4. if it doesn't exist as a directory.
++ if test "X$additional_libdir" != "X/usr/lib"; then
++ haveit=
++ for x in $LDFLAGS; do
++ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++ if test "X$x" = "X-L$additional_libdir"; then
++ haveit=yes
++ break
++ fi
++ done
++ if test -z "$haveit"; then
++ if test "X$additional_libdir" = "X/usr/local/lib"; then
++ if test -n "$GCC"; then
++ case $host_os in
++ linux*) haveit=yes;;
++ esac
++ fi
++ fi
++ if test -z "$haveit"; then
++ if test -d "$additional_libdir"; then
++ dnl Really add $additional_libdir to $LDFLAGS.
++ LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
++ fi
++ fi
++ fi
++ fi
++ fi
++])
++
++dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
++dnl acl_final_exec_prefix, containing the values to which $prefix and
++dnl $exec_prefix will expand at the end of the configure script.
++AC_DEFUN([AC_LIB_PREPARE_PREFIX],
++[
++ dnl Unfortunately, prefix and exec_prefix get only finally determined
++ dnl at the end of configure.
++ if test "X$prefix" = "XNONE"; then
++ acl_final_prefix="$ac_default_prefix"
++ else
++ acl_final_prefix="$prefix"
++ fi
++ if test "X$exec_prefix" = "XNONE"; then
++ acl_final_exec_prefix='${prefix}'
++ else
++ acl_final_exec_prefix="$exec_prefix"
++ fi
++ acl_save_prefix="$prefix"
++ prefix="$acl_final_prefix"
++ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
++ prefix="$acl_save_prefix"
++])
++
++dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
++dnl variables prefix and exec_prefix bound to the values they will have
++dnl at the end of the configure script.
++AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
++[
++ acl_save_prefix="$prefix"
++ prefix="$acl_final_prefix"
++ acl_save_exec_prefix="$exec_prefix"
++ exec_prefix="$acl_final_exec_prefix"
++ $1
++ exec_prefix="$acl_save_exec_prefix"
++ prefix="$acl_save_prefix"
++])
+--- lrzsz-0.12.20.safe/m4/longdouble.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/longdouble.m4 2004-09-12 14:40:34.942658864 -0400
+@@ -0,0 +1,30 @@
++# longdouble.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the compiler supports the 'long double' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_LONGDOUBLE],
++[
++ AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
++ [if test "$GCC" = yes; then
++ gt_cv_c_long_double=yes
++ else
++ AC_TRY_COMPILE([
++ /* The Stardent Vistra knows sizeof(long double), but does not support it. */
++ long double foo = 0.0;
++ /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
++ int array [2*(sizeof(long double) >= sizeof(double)) - 1];
++ ], ,
++ gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
++ fi])
++ if test $gt_cv_c_long_double = yes; then
++ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/longlong.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/longlong.m4 2004-09-12 14:40:34.949657800 -0400
+@@ -0,0 +1,25 @@
++# longlong.m4 serial 4
++dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_LONG_LONG if 'long long' works.
++
++AC_DEFUN([jm_AC_TYPE_LONG_LONG],
++[
++ AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
++ [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
++ [long long llmax = (long long) -1;
++ return ll << i | ll >> i | llmax / ll | llmax % ll;],
++ ac_cv_type_long_long=yes,
++ ac_cv_type_long_long=no)])
++ if test $ac_cv_type_long_long = yes; then
++ AC_DEFINE(HAVE_LONG_LONG, 1,
++ [Define if you have the 'long long' type.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/Makefile.am 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/Makefile.am 2004-09-12 14:40:35.048642752 -0400
+@@ -0,0 +1 @@
++EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4
+--- lrzsz-0.12.20.safe/m4/nls.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/nls.m4 2004-09-12 14:40:34.955656888 -0400
+@@ -0,0 +1,49 @@
++# nls.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++AC_DEFUN([AM_NLS],
++[
++ AC_MSG_CHECKING([whether NLS is requested])
++ dnl Default is enabled NLS
++ AC_ARG_ENABLE(nls,
++ [ --disable-nls do not use Native Language Support],
++ USE_NLS=$enableval, USE_NLS=yes)
++ AC_MSG_RESULT($USE_NLS)
++ AC_SUBST(USE_NLS)
++])
++
++AC_DEFUN([AM_MKINSTALLDIRS],
++[
++ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
++ dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
++ dnl Try to locate it.
++ MKINSTALLDIRS=
++ if test -n "$ac_aux_dir"; then
++ case "$ac_aux_dir" in
++ /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
++ *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
++ esac
++ fi
++ if test -z "$MKINSTALLDIRS"; then
++ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
++ fi
++ AC_SUBST(MKINSTALLDIRS)
++])
+--- lrzsz-0.12.20.safe/m4/po.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/po.m4 2004-09-12 14:40:34.961655976 -0400
+@@ -0,0 +1,426 @@
++# po.m4 serial 3 (gettext-0.14)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++dnl Checks for all prerequisites of the po subdirectory.
++AC_DEFUN([AM_PO_SUBDIRS],
++[
++ AC_REQUIRE([AC_PROG_MAKE_SET])dnl
++ AC_REQUIRE([AC_PROG_INSTALL])dnl
++ AC_REQUIRE([AM_MKINSTALLDIRS])dnl
++ AC_REQUIRE([AM_NLS])dnl
++
++ dnl Perform the following tests also if --disable-nls has been given,
++ dnl because they are needed for "make dist" to work.
++
++ dnl Search for GNU msgfmt in the PATH.
++ dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
++ dnl The second test excludes FreeBSD msgfmt.
++ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
++ [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
++ (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
++ :)
++ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
++
++ dnl Search for GNU xgettext 0.12 or newer in the PATH.
++ dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
++ dnl The second test excludes FreeBSD xgettext.
++ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
++ [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
++ (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
++ :)
++ dnl Remove leftover from FreeBSD xgettext call.
++ rm -f messages.po
++
++ dnl Search for GNU msgmerge 0.11 or newer in the PATH.
++ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
++ [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
++
++ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
++ dnl Test whether we really found GNU msgfmt.
++ if test "$GMSGFMT" != ":"; then
++ dnl If it is no GNU msgfmt we define it as : so that the
++ dnl Makefiles still can work.
++ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
++ (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
++ : ;
++ else
++ GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
++ AC_MSG_RESULT(
++ [found $GMSGFMT program is not GNU msgfmt; ignore it])
++ GMSGFMT=":"
++ fi
++ fi
++
++ dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
++ dnl Test whether we really found GNU xgettext.
++ if test "$XGETTEXT" != ":"; then
++ dnl If it is no GNU xgettext we define it as : so that the
++ dnl Makefiles still can work.
++ if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
++ (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
++ : ;
++ else
++ AC_MSG_RESULT(
++ [found xgettext program is not GNU xgettext; ignore it])
++ XGETTEXT=":"
++ fi
++ dnl Remove leftover from FreeBSD xgettext call.
++ rm -f messages.po
++ fi
++
++ AC_OUTPUT_COMMANDS([
++ for ac_file in $CONFIG_FILES; do
++ # Support "outfile[:infile[:infile...]]"
++ case "$ac_file" in
++ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++ esac
++ # PO directories have a Makefile.in generated from Makefile.in.in.
++ case "$ac_file" in */Makefile.in)
++ # Adjust a relative srcdir.
++ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
++ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
++ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
++ # In autoconf-2.13 it is called $ac_given_srcdir.
++ # In autoconf-2.50 it is called $srcdir.
++ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
++ case "$ac_given_srcdir" in
++ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
++ /*) top_srcdir="$ac_given_srcdir" ;;
++ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
++ esac
++ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
++ rm -f "$ac_dir/POTFILES"
++ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
++ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
++ POMAKEFILEDEPS="POTFILES.in"
++ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
++ # on $ac_dir but don't depend on user-specified configuration
++ # parameters.
++ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
++ # The LINGUAS file contains the set of available languages.
++ if test -n "$OBSOLETE_ALL_LINGUAS"; then
++ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
++ fi
++ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
++ # Hide the ALL_LINGUAS assigment from automake.
++ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
++ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
++ else
++ # The set of available languages was given in configure.in.
++ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
++ fi
++ # Compute POFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
++ # Compute UPDATEPOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
++ # Compute DUMMYPOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
++ # Compute GMOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
++ case "$ac_given_srcdir" in
++ .) srcdirpre= ;;
++ *) srcdirpre='$(srcdir)/' ;;
++ esac
++ POFILES=
++ UPDATEPOFILES=
++ DUMMYPOFILES=
++ GMOFILES=
++ for lang in $ALL_LINGUAS; do
++ POFILES="$POFILES $srcdirpre$lang.po"
++ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
++ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
++ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
++ done
++ # CATALOGS depends on both $ac_dir and the user's LINGUAS
++ # environment variable.
++ INST_LINGUAS=
++ if test -n "$ALL_LINGUAS"; then
++ for presentlang in $ALL_LINGUAS; do
++ useit=no
++ if test "%UNSET%" != "$LINGUAS"; then
++ desiredlanguages="$LINGUAS"
++ else
++ desiredlanguages="$ALL_LINGUAS"
++ fi
++ for desiredlang in $desiredlanguages; do
++ # Use the presentlang catalog if desiredlang is
++ # a. equal to presentlang, or
++ # b. a variant of presentlang (because in this case,
++ # presentlang can be used as a fallback for messages
++ # which are not translated in the desiredlang catalog).
++ case "$desiredlang" in
++ "$presentlang"*) useit=yes;;
++ esac
++ done
++ if test $useit = yes; then
++ INST_LINGUAS="$INST_LINGUAS $presentlang"
++ fi
++ done
++ fi
++ CATALOGS=
++ if test -n "$INST_LINGUAS"; then
++ for lang in $INST_LINGUAS; do
++ CATALOGS="$CATALOGS $lang.gmo"
++ done
++ fi
++ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
++ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
++ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
++ if test -f "$f"; then
++ case "$f" in
++ *.orig | *.bak | *~) ;;
++ *) cat "$f" >> "$ac_dir/Makefile" ;;
++ esac
++ fi
++ done
++ fi
++ ;;
++ esac
++ done],
++ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
++ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
++ # from automake.
++ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
++ # Capture the value of LINGUAS because we need it to compute CATALOGS.
++ LINGUAS="${LINGUAS-%UNSET%}"
++ ])
++])
++
++dnl Postprocesses a Makefile in a directory containing PO files.
++AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
++[
++ # When this code is run, in config.status, two variables have already been
++ # set:
++ # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
++ # - LINGUAS is the value of the environment variable LINGUAS at configure
++ # time.
++
++changequote(,)dnl
++ # Adjust a relative srcdir.
++ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
++ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
++ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
++ # In autoconf-2.13 it is called $ac_given_srcdir.
++ # In autoconf-2.50 it is called $srcdir.
++ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
++ case "$ac_given_srcdir" in
++ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
++ /*) top_srcdir="$ac_given_srcdir" ;;
++ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
++ esac
++
++ # Find a way to echo strings without interpreting backslash.
++ if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
++ gt_echo='echo'
++ else
++ if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
++ gt_echo='printf %s\n'
++ else
++ echo_func () {
++ cat <<EOT
++$*
++EOT
++ }
++ gt_echo='echo_func'
++ fi
++ fi
++
++ # A sed script that extracts the value of VARIABLE from a Makefile.
++ sed_x_variable='
++# Test if the hold space is empty.
++x
++s/P/P/
++x
++ta
++# Yes it was empty. Look if we have the expected variable definition.
++/^[ ]*VARIABLE[ ]*=/{
++ # Seen the first line of the variable definition.
++ s/^[ ]*VARIABLE[ ]*=//
++ ba
++}
++bd
++:a
++# Here we are processing a line from the variable definition.
++# Remove comment, more precisely replace it with a space.
++s/#.*$/ /
++# See if the line ends in a backslash.
++tb
++:b
++s/\\$//
++# Print the line, without the trailing backslash.
++p
++tc
++# There was no trailing backslash. The end of the variable definition is
++# reached. Clear the hold space.
++s/^.*$//
++x
++bd
++:c
++# A trailing backslash means that the variable definition continues in the
++# next line. Put a nonempty string into the hold space to indicate this.
++s/^.*$/P/
++x
++:d
++'
++changequote([,])dnl
++
++ # Set POTFILES to the value of the Makefile variable POTFILES.
++ sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
++ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
++ # Compute POTFILES_DEPS as
++ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
++ POTFILES_DEPS=
++ for file in $POTFILES; do
++ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
++ done
++ POMAKEFILEDEPS=""
++
++ if test -n "$OBSOLETE_ALL_LINGUAS"; then
++ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
++ fi
++ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
++ # The LINGUAS file contains the set of available languages.
++ ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
++ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
++ else
++ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
++ sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
++ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
++ fi
++ # Hide the ALL_LINGUAS assigment from automake.
++ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
++ # Compute POFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
++ # Compute UPDATEPOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
++ # Compute DUMMYPOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
++ # Compute GMOFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
++ # Compute PROPERTIESFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
++ # Compute CLASSFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
++ # Compute QMFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
++ # Compute MSGFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
++ # Compute RESOURCESDLLFILES
++ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
++ case "$ac_given_srcdir" in
++ .) srcdirpre= ;;
++ *) srcdirpre='$(srcdir)/' ;;
++ esac
++ POFILES=
++ UPDATEPOFILES=
++ DUMMYPOFILES=
++ GMOFILES=
++ PROPERTIESFILES=
++ CLASSFILES=
++ QMFILES=
++ MSGFILES=
++ RESOURCESDLLFILES=
++ for lang in $ALL_LINGUAS; do
++ POFILES="$POFILES $srcdirpre$lang.po"
++ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
++ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
++ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
++ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
++ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
++ QMFILES="$QMFILES $srcdirpre$lang.qm"
++ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
++ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
++ done
++ # CATALOGS depends on both $ac_dir and the user's LINGUAS
++ # environment variable.
++ INST_LINGUAS=
++ if test -n "$ALL_LINGUAS"; then
++ for presentlang in $ALL_LINGUAS; do
++ useit=no
++ if test "%UNSET%" != "$LINGUAS"; then
++ desiredlanguages="$LINGUAS"
++ else
++ desiredlanguages="$ALL_LINGUAS"
++ fi
++ for desiredlang in $desiredlanguages; do
++ # Use the presentlang catalog if desiredlang is
++ # a. equal to presentlang, or
++ # b. a variant of presentlang (because in this case,
++ # presentlang can be used as a fallback for messages
++ # which are not translated in the desiredlang catalog).
++ case "$desiredlang" in
++ "$presentlang"*) useit=yes;;
++ esac
++ done
++ if test $useit = yes; then
++ INST_LINGUAS="$INST_LINGUAS $presentlang"
++ fi
++ done
++ fi
++ CATALOGS=
++ JAVACATALOGS=
++ QTCATALOGS=
++ TCLCATALOGS=
++ CSHARPCATALOGS=
++ if test -n "$INST_LINGUAS"; then
++ for lang in $INST_LINGUAS; do
++ CATALOGS="$CATALOGS $lang.gmo"
++ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
++ QTCATALOGS="$QTCATALOGS $lang.qm"
++ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
++ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
++ done
++ fi
++
++ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
++ if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
++ # Add dependencies that cannot be formulated as a simple suffix rule.
++ for lang in $ALL_LINGUAS; do
++ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++ cat >> "$ac_file.tmp" <<EOF
++$frobbedlang.msg: $lang.po
++ @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
++ \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++EOF
++ done
++ fi
++ if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
++ # Add dependencies that cannot be formulated as a simple suffix rule.
++ for lang in $ALL_LINGUAS; do
++ frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++ cat >> "$ac_file.tmp" <<EOF
++$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
++ @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
++ \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++EOF
++ done
++ fi
++ if test -n "$POMAKEFILEDEPS"; then
++ cat >> "$ac_file.tmp" <<EOF
++Makefile: $POMAKEFILEDEPS
++EOF
++ fi
++ mv "$ac_file.tmp" "$ac_file"
++])
+--- lrzsz-0.12.20.safe/m4/printf-posix.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/printf-posix.m4 2004-09-12 14:40:34.974654000 -0400
+@@ -0,0 +1,46 @@
++# printf-posix.m4 serial 2 (gettext-0.13.1)
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the printf() function supports POSIX/XSI format strings with
++dnl positions.
++
++AC_DEFUN([gt_PRINTF_POSIX],
++[
++ AC_REQUIRE([AC_PROG_CC])
++ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
++ gt_cv_func_printf_posix,
++ [
++ AC_TRY_RUN([
++#include <stdio.h>
++#include <string.h>
++/* The string "%2$d %1$d", with dollar characters protected from the shell's
++ dollar expansion (possibly an autoconf bug). */
++static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
++static char buf[100];
++int main ()
++{
++ sprintf (buf, format, 33, 55);
++ return (strcmp (buf, "55 33") != 0);
++}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
++ [
++ AC_EGREP_CPP(notposix, [
++#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
++ notposix
++#endif
++ ], gt_cv_func_printf_posix="guessing no",
++ gt_cv_func_printf_posix="guessing yes")
++ ])
++ ])
++ case $gt_cv_func_printf_posix in
++ *yes)
++ AC_DEFINE(HAVE_POSIX_PRINTF, 1,
++ [Define if your printf() function supports format strings with positions.])
++ ;;
++ esac
++])
+--- lrzsz-0.12.20.safe/m4/progtest.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/progtest.m4 2004-09-12 14:40:34.990651568 -0400
+@@ -0,0 +1,91 @@
++# progtest.m4 serial 3 (gettext-0.12)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
++
++# Search path for a program which passes the given test.
++
++dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
++dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
++AC_DEFUN([AM_PATH_PROG_WITH_TEST],
++[
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++ echo "#! /bin/sh" >conf$$.sh
++ echo "exit 0" >>conf$$.sh
++ chmod +x conf$$.sh
++ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++ PATH_SEPARATOR=';'
++ else
++ PATH_SEPARATOR=:
++ fi
++ rm -f conf$$.sh
++fi
++
++# Find out how to test for executable files. Don't use a zero-byte file,
++# as systems may use methods other than mode bits to determine executability.
++cat >conf$$.file <<_ASEOF
++#! /bin/sh
++exit 0
++_ASEOF
++chmod +x conf$$.file
++if test -x conf$$.file >/dev/null 2>&1; then
++ ac_executable_p="test -x"
++else
++ ac_executable_p="test -f"
++fi
++rm -f conf$$.file
++
++# Extract the first word of "$2", so it can be a program name with args.
++set dummy $2; ac_word=[$]2
++AC_MSG_CHECKING([for $ac_word])
++AC_CACHE_VAL(ac_cv_path_$1,
++[case "[$]$1" in
++ [[\\/]]* | ?:[[\\/]]*)
++ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
++ ;;
++ *)
++ ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
++ for ac_dir in ifelse([$5], , $PATH, [$5]); do
++ IFS="$ac_save_IFS"
++ test -z "$ac_dir" && ac_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
++ if [$3]; then
++ ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
++ break 2
++ fi
++ fi
++ done
++ done
++ IFS="$ac_save_IFS"
++dnl If no 4th arg is given, leave the cache variable unset,
++dnl so AC_PATH_PROGS will keep looking.
++ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
++])dnl
++ ;;
++esac])dnl
++$1="$ac_cv_path_$1"
++if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
++ AC_MSG_RESULT([$]$1)
++else
++ AC_MSG_RESULT(no)
++fi
++AC_SUBST($1)dnl
++])
+--- lrzsz-0.12.20.safe/m4/signed.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/signed.m4 2004-09-12 14:40:34.996650656 -0400
+@@ -0,0 +1,19 @@
++# signed.m4 serial 1 (gettext-0.10.40)
++dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([bh_C_SIGNED],
++[
++ AC_CACHE_CHECK([for signed], bh_cv_c_signed,
++ [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
++ if test $bh_cv_c_signed = no; then
++ AC_DEFINE(signed, ,
++ [Define to empty if the C compiler doesn't support this keyword.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/size_max.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/size_max.m4 2004-09-12 14:40:35.003649592 -0400
+@@ -0,0 +1,61 @@
++# size_max.m4 serial 2
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gl_SIZE_MAX],
++[
++ AC_CHECK_HEADERS(stdint.h)
++ dnl First test whether the system already has SIZE_MAX.
++ AC_MSG_CHECKING([for SIZE_MAX])
++ result=
++ AC_EGREP_CPP([Found it], [
++#include <limits.h>
++#if HAVE_STDINT_H
++#include <stdint.h>
++#endif
++#ifdef SIZE_MAX
++Found it
++#endif
++], result=yes)
++ if test -z "$result"; then
++ dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
++ dnl than the type 'unsigned long'.
++ dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
++ dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
++ _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
++ [#include <stddef.h>], result=?)
++ _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
++ [#include <stddef.h>], result=?)
++ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
++ [#include <stddef.h>], result=?)
++ if test "$fits_in_uint" = 1; then
++ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
++ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
++ AC_TRY_COMPILE([#include <stddef.h>
++ extern size_t foo;
++ extern unsigned long foo;
++ ], [], fits_in_uint=0)
++ fi
++ if test -z "$result"; then
++ if test "$fits_in_uint" = 1; then
++ result="$res_hi$res_lo"U
++ else
++ result="$res_hi$res_lo"UL
++ fi
++ else
++ dnl Shouldn't happen, but who knows...
++ result='~(size_t)0'
++ fi
++ fi
++ AC_MSG_RESULT([$result])
++ if test "$result" != yes; then
++ AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
++ [Define as the maximum value of type 'size_t', if the system doesn't define it.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/stdint_h.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/stdint_h.m4 2004-09-12 14:40:35.009648680 -0400
+@@ -0,0 +1,28 @@
++# stdint_h.m4 serial 3 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_STDINT_H],
++[
++ AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
++ [AC_TRY_COMPILE(
++ [#include <sys/types.h>
++#include <stdint.h>],
++ [uintmax_t i = (uintmax_t) -1;],
++ jm_ac_cv_header_stdint_h=yes,
++ jm_ac_cv_header_stdint_h=no)])
++ if test $jm_ac_cv_header_stdint_h = yes; then
++ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
++ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
++ and declares uintmax_t. ])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/uintmax_t.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/uintmax_t.m4 2004-09-12 14:40:35.021646856 -0400
+@@ -0,0 +1,32 @@
++# uintmax_t.m4 serial 7 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to 'unsigned long' or 'unsigned long long'
++# if it is not already defined in <stdint.h> or <inttypes.h>.
++
++AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
++[
++ AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++ AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++ if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
++ AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
++ test $ac_cv_type_unsigned_long_long = yes \
++ && ac_type='unsigned long long' \
++ || ac_type='unsigned long'
++ AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
++ [Define to unsigned long or unsigned long long
++ if <stdint.h> and <inttypes.h> don't define.])
++ else
++ AC_DEFINE(HAVE_UINTMAX_T, 1,
++ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/ulonglong.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/ulonglong.m4 2004-09-12 14:40:35.028645792 -0400
+@@ -0,0 +1,25 @@
++# ulonglong.m4 serial 3
++dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
++
++AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
++[
++ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
++ [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
++ [unsigned long long ullmax = (unsigned long long) -1;
++ return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
++ ac_cv_type_unsigned_long_long=yes,
++ ac_cv_type_unsigned_long_long=no)])
++ if test $ac_cv_type_unsigned_long_long = yes; then
++ AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
++ [Define if you have the 'unsigned long long' type.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/wchar_t.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/wchar_t.m4 2004-09-12 14:40:35.034644880 -0400
+@@ -0,0 +1,22 @@
++# wchar_t.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether <stddef.h> has the 'wchar_t' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_WCHAR_T],
++[
++ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
++ [AC_TRY_COMPILE([#include <stddef.h>
++ wchar_t foo = (wchar_t)'\0';], ,
++ gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
++ if test $gt_cv_c_wchar_t = yes; then
++ AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/wint_t.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/wint_t.m4 2004-09-12 14:40:35.040643968 -0400
+@@ -0,0 +1,22 @@
++# wint_t.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether <wchar.h> has the 'wint_t' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_WINT_T],
++[
++ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
++ [AC_TRY_COMPILE([#include <wchar.h>
++ wint_t foo = (wchar_t)'\0';], ,
++ gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
++ if test $gt_cv_c_wint_t = yes; then
++ AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
++ fi
++])
+--- lrzsz-0.12.20.safe/m4/xsize.m4 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/xsize.m4 2004-09-12 14:40:35.047642904 -0400
+@@ -0,0 +1,14 @@
++# xsize.m4 serial 2
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License. As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_XSIZE],
++[
++ dnl Prerequisites of lib/xsize.h.
++ AC_REQUIRE([gl_SIZE_MAX])
++ AC_CHECK_HEADERS(stdint.h)
++])
+--- lrzsz-0.12.20.safe/Makefile.am 1998-12-30 06:19:40.000000000 -0500
++++ lrzsz-0.12.20/Makefile.am 2004-09-12 14:40:35.121631656 -0400
+@@ -1,5 +1,5 @@
+ SUBDIRS = lib intl src po man testsuite
+-EXTRA_DIST = check.lrzsz COMPATABILITY README.cvs README.isdn4linux \
++EXTRA_DIST = config.rpath check.lrzsz COMPATABILITY README.cvs README.isdn4linux \
+ README.gettext rpmrc buildrpm systype.in fastcheck.sh README.tests \
+ beos-runpiped.c fastcheck.beos
+ noinst_SCRIPTS=systype
+@@ -83,3 +83,5 @@
+ rpm: $(PR).tar.gz Specfile
+ $(srcdir)/buildrpm $(srcdir)
+
++
++ACLOCAL_AMFLAGS = -I m4
+--- lrzsz-0.12.20.safe/Makefile.in 1998-12-30 11:31:40.000000000 -0500
++++ lrzsz-0.12.20/Makefile.in 2004-09-12 14:40:35.109633480 -0400
+@@ -125,7 +125,7 @@
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+ $(ACLOCAL_M4): configure.in acinclude.m4
+- cd $(srcdir) && $(ACLOCAL)
++ cd $(srcdir) && $(ACLOCAL) -I m4
+
+ config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
+--- lrzsz-0.12.20.safe/mkinstalldirs 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/mkinstalldirs 2004-09-12 14:40:34.337750824 -0400
+@@ -1,34 +1,150 @@
+ #! /bin/sh
+ # mkinstalldirs --- make directory hierarchy
+-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
++
++scriptversion=2004-02-15.20
++
++# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+ # Created: 1993-05-16
+-# Last modified: 1995-03-05
+-# Public domain
++# Public domain.
++#
++# This file is maintained in Automake, please report
++# bugs to <bug-automake@gnu.org> or send patches to
++# <automake-patches@gnu.org>.
+
+ errstatus=0
++dirmode=""
+
+-for file in ${1+"$@"} ; do
+- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+- shift
++usage="\
++Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+- pathcomp=
+- for d in ${1+"$@"} ; do
+- pathcomp="$pathcomp$d"
+- case "$pathcomp" in
+- -* ) pathcomp=./$pathcomp ;;
+- esac
++Create each directory DIR (with mode MODE, if specified), including all
++leading file name components.
+
+- if test ! -d "$pathcomp"; then
+- echo "mkdir $pathcomp" 1>&2
+- mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+- fi
++Report bugs to <bug-automake@gnu.org>."
+
+- if test ! -d "$pathcomp"; then
++# process command line arguments
++while test $# -gt 0 ; do
++ case $1 in
++ -h | --help | --h*) # -h for help
++ echo "$usage"
++ exit 0
++ ;;
++ -m) # -m PERM arg
++ shift
++ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
++ dirmode=$1
++ shift
++ ;;
++ --version)
++ echo "$0 $scriptversion"
++ exit 0
++ ;;
++ --) # stop option processing
++ shift
++ break
++ ;;
++ -*) # unknown option
++ echo "$usage" 1>&2
++ exit 1
++ ;;
++ *) # first non-opt arg
++ break
++ ;;
++ esac
++done
++
++for file
++do
++ if test -d "$file"; then
++ shift
++ else
++ break
++ fi
++done
++
++case $# in
++ 0) exit 0 ;;
++esac
++
++# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
++# mkdir -p a/c at the same time, both will detect that a is missing,
++# one will create a, then the other will try to create a and die with
++# a "File exists" error. This is a problem when calling mkinstalldirs
++# from a parallel make. We use --version in the probe to restrict
++# ourselves to GNU mkdir, which is thread-safe.
++case $dirmode in
++ '')
++ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++ echo "mkdir -p -- $*"
++ exec mkdir -p -- "$@"
++ else
++ # On NextStep and OpenStep, the `mkdir' command does not
++ # recognize any option. It will interpret all options as
++ # directories to create, and then abort because `.' already
++ # exists.
++ test -d ./-p && rmdir ./-p
++ test -d ./--version && rmdir ./--version
++ fi
++ ;;
++ *)
++ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
++ test ! -d ./--version; then
++ echo "mkdir -m $dirmode -p -- $*"
++ exec mkdir -m "$dirmode" -p -- "$@"
++ else
++ # Clean up after NextStep and OpenStep mkdir.
++ for d in ./-m ./-p ./--version "./$dirmode";
++ do
++ test -d $d && rmdir $d
++ done
++ fi
++ ;;
++esac
++
++for file
++do
++ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
++ shift
++
++ pathcomp=
++ for d
++ do
++ pathcomp="$pathcomp$d"
++ case $pathcomp in
++ -*) pathcomp=./$pathcomp ;;
++ esac
++
++ if test ! -d "$pathcomp"; then
++ echo "mkdir $pathcomp"
++
++ mkdir "$pathcomp" || lasterr=$?
++
++ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+- fi
++ else
++ if test ! -z "$dirmode"; then
++ echo "chmod $dirmode $pathcomp"
++ lasterr=""
++ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+- pathcomp="$pathcomp/"
+- done
++ if test ! -z "$lasterr"; then
++ errstatus=$lasterr
++ fi
++ fi
++ fi
++ fi
++
++ pathcomp="$pathcomp/"
++ done
+ done
+
+ exit $errstatus
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "scriptversion="
++# time-stamp-format: "%:y-%02m-%02d.%02H"
++# time-stamp-end: "$"
++# End:
+--- lrzsz-0.12.20.safe/po/boldquot.sed 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/boldquot.sed 2004-09-12 14:40:34.723692152 -0400
+@@ -0,0 +1,10 @@
++s/"\([^"]*\)"/“\1â€/g
++s/`\([^`']*\)'/‘\1’/g
++s/ '\([^`']*\)' / ‘\1’ /g
++s/ '\([^`']*\)'$/ ‘\1’/g
++s/^'\([^`']*\)' /‘\1’ /g
++s/“â€/""/g
++s/“/“/g
++s/â€/â€/g
++s/‘/‘/g
++s/’/’/g
+--- lrzsz-0.12.20.safe/po/cat-id-tbl.c 1998-12-29 04:24:24.000000000 -0500
++++ lrzsz-0.12.20/po/cat-id-tbl.c 1969-12-31 19:00:00.000000000 -0500
+@@ -1,234 +0,0 @@
+-/* Automatically generated by po2tbl.sed from lrzsz.pot. */
+-
+-#if HAVE_CONFIG_H
+-# include <config.h>
+-#endif
+-
+-#include "libgettext.h"
+-
+-const struct _msg_ent _msg_tbl[] = {
+- {"", 1},
+- {"io_mode(,2) in rbsb.c not implemented\n", 2},
+- {"caught signal %d; exiting", 3},
+- {"command tries", 4},
+- {"packetlength", 5},
+- {"packetlength out of range 24..%ld", 6},
+- {"framelength", 7},
+- {"framelength out of range 32..%ld", 8},
+- {"min_bps", 9},
+- {"min_bps must be >= 0", 10},
+- {"min_bps_time", 11},
+- {"min_bps_time must be > 1", 12},
+- {"hour to large (0..23)", 13},
+- {"unparsable stop time\n", 14},
+- {"minute to large (0..59)", 15},
+- {"stop time to small", 16},
+- {"stop-at", 17},
+- {"timeout", 18},
+- {"timeout out of range 10..1000", 19},
+- {"security violation: can't do that under restricted shell\n", 20},
+- {"window size", 21},
+- {"cannot turnoff syslog", 22},
+- {"startup delay", 23},
+- {"out of memory", 24},
+- {"this program was never intended to be used setuid\n", 25},
+- {"need at least one file to send", 26},
+- {"Can't send command in restricted mode\n", 27},
+- {"hostname too long\n", 28},
+- {"illegal server address\n", 29},
+- {"can read only one file from stdin", 30},
+- {"Transfer incomplete\n", 31},
+- {"Transfer complete\n", 32},
+- {"send_pseudo %s: cannot open tmpfile %s: %s", 33},
+- {"send_pseudo %s: cannot lstat tmpfile %s: %s", 34},
+- {"send_pseudo %s: avoiding symlink trap", 35},
+- {"send_pseudo %s: cannot write to tmpfile %s: %s", 36},
+- {"send_pseudo %s: failed", 37},
+- {"send_pseudo %s: ok", 38},
+- {"tcp protocol init failed\n", 39},
+- {"Answering TIMESYNC at %s", 40},
+- {"timezone", 41},
+- {"timezone unknown", 42},
+- {"Can't open any requested files.", 43},
+- {"security violation: not allowed to upload from %s", 44},
+- {"cannot open %s", 45},
+- {"is not a file: %s", 46},
+- {"%s/%s: error occured", 47},
+- {"skipped: %s", 48},
+- {"%s/%s: skipped", 49},
+- {"Bytes Sent:%7ld BPS:%-8ld \n", 50},
+- {"Sending %s, %ld blocks: ", 51},
+- {"Give your local XMODEM receive command now.", 52},
+- {"Sending: %s\n", 53},
+- {"Timeout on pathname", 54},
+- {"Receiver Cancelled", 55},
+- {"No ACK on EOT", 56},
+- {"Xmodem sectors/kbytes sent: %3d/%2dk", 57},
+- {"Ymodem sectors/kbytes sent: %3d/%2dk", 58},
+- {"Cancelled", 59},
+- {"Timeout on sector ACK", 60},
+- {"NAK on sector", 61},
+- {"Got burst for sector ACK", 62},
+- {"Got %02x for sector ACK", 63},
+- {"Retry Count Exceeded", 64},
+- {"Try `%s --help' for more information.\n", 65},
+- {"%s version %s\n", 66},
+- {"Usage: %s [options] file ...\n", 67},
+- {" or: %s [options] -{c|i} COMMAND\n", 68},
+- {"Send file(s) with ZMODEM/YMODEM/XMODEM protocol\n", 69},
+- {"\
+- (X) = option applies to XMODEM only\n\
+- (Y) = option applies to YMODEM only\n\
+- (Z) = option applies to ZMODEM only\n", 70},
+- {"\
+- -+, --append append to existing destination file (Z)\n\
+- -2, --twostop use 2 stop bits\n\
+- -4, --try-4k go up to 4K blocksize\n\
+- --start-4k start with 4K blocksize (doesn't try 8)\n\
+- -8, --try-8k go up to 8K blocksize\n\
+- --start-8k start with 8K blocksize\n\
+- -a, --ascii ASCII transfer (change CR/LF to LF)\n\
+- -b, --binary binary transfer\n\
+- -B, --bufsize N buffer N bytes (N==auto: buffer whole file)\n\
+- -c, --command COMMAND execute remote command COMMAND (Z)\n\
+- -C, --command-tries N try N times to execute a command (Z)\n\
+- -d, --dot-to-slash change '.' to '/' in pathnames (Y/Z)\n\
+- --delay-startup N sleep N seconds before doing anything\n\
+- -e, --escape escape all control characters (Z)\n\
+- -E, --rename force receiver to rename files it already has\n\
+- -f, --full-path send full pathname (Y/Z)\n\
+- -i, --immediate-command CMD send remote CMD, return immediately (Z)\n\
+- -h, --help print this usage message\n\
+- -k, --1k send 1024 byte packets (X)\n\
+- -L, --packetlen N limit subpacket length to N bytes (Z)\n\
+- -l, --framelen N limit frame length to N bytes (l>=L) (Z)\n\
+- -m, --min-bps N stop transmission if BPS below N\n\
+- -M, --min-bps-time N for at least N seconds (default: 120)\n", 71},
+- {"\
+- -n, --newer send file if source newer (Z)\n\
+- -N, --newer-or-longer send file if source newer or longer (Z)\n\
+- -o, --16-bit-crc use 16 bit CRC instead of 32 bit CRC (Z)\n\
+- -O, --disable-timeouts disable timeout code, wait forever\n\
+- -p, --protect protect existing destination file (Z)\n\
+- -r, --resume resume interrupted file transfer (Z)\n\
+- -R, --restricted restricted, more secure mode\n\
+- -q, --quiet quiet (no progress reports)\n\
+- -s, --stop-at {HH:MM|+N} stop transmission at HH:MM or in N seconds\n\
+- --tcp build a TCP connection to transmit files\n\
+- --tcp-server open socket, wait for connection\n\
+- -u, --unlink unlink file after transmission\n\
+- -U, --unrestrict turn off restricted mode (if allowed to)\n\
+- -v, --verbose be verbose, provide debugging information\n\
+- -w, --windowsize N Window is N bytes (Z)\n\
+- -X, --xmodem use XMODEM protocol\n\
+- -y, --overwrite overwrite existing files\n\
+- -Y, --overwrite-or-skip overwrite existing files, else skip\n\
+- --ymodem use YMODEM protocol\n\
+- -Z, --zmodem use ZMODEM protocol\n\
+-\n\
+-short options use the same arguments as the long ones\n", 72},
+- {"got ZRQINIT", 73},
+- {"got ZCAN", 74},
+- {"blklen now %d\n", 75},
+- {"zsendfdata: bps rate %ld below min %ld", 76},
+- {"zsendfdata: reached stop time", 77},
+- {"Bytes Sent:%7ld/%7ld BPS:%-8ld ETA %02d:%02d ", 78},
+- {"calc_blklen: reduced to %d due to error\n", 79},
+- {"calc_blklen: returned old value %d due to low bpe diff\n", 80},
+- {"calc_blklen: old %ld, new %ld, d %ld\n", 81},
+- {"calc_blklen: calc total_bytes=%ld, bpe=%ld, ec=%ld\n", 82},
+- {"calc_blklen: blklen %d, ok %ld, failed %ld -> %lu\n", 83},
+- {"calc_blklen: returned %d as best\n", 84},
+- {"\
+-\n\
+-countem: Total %d %ld\n", 85},
+- {"Bad escape sequence %x", 86},
+- {"Sender Canceled", 87},
+- {"TIMEOUT", 88},
+- {"Bad data subpacket", 89},
+- {"Data subpacket too long", 90},
+- {"Garbage count exceeded", 91},
+- {"Got %s", 92},
+- {"Retry %d: ", 93},
+- {"don't have settimeofday, will not set time\n", 94},
+- {"not running as root (this is good!), can not set time\n", 95},
+- {"bytes_per_error", 96},
+- {"bytes-per-error should be >100", 97},
+- {"O_SYNC not supported by the kernel", 98},
+- {"garbage on commandline", 99},
+- {"Usage: %s [options] [filename.if.xmodem]\n", 100},
+- {"Receive files with ZMODEM/YMODEM/XMODEM protocol\n", 101},
+- {"\
+- -+, --append append to existing files\n\
+- -a, --ascii ASCII transfer (change CR/LF to LF)\n\
+- -b, --binary binary transfer\n\
+- -B, --bufsize N buffer N bytes (N==auto: buffer whole file)\n\
+- -c, --with-crc Use 16 bit CRC (X)\n\
+- -C, --allow-remote-commands allow execution of remote commands (Z)\n\
+- -D, --null write all received data to /dev/null\n\
+- --delay-startup N sleep N seconds before doing anything\n\
+- -e, --escape Escape control characters (Z)\n\
+- -E, --rename rename any files already existing\n\
+- --errors N generate CRC error every N bytes (debugging)\n\
+- -h, --help Help, print this usage message\n\
+- -m, --min-bps N stop transmission if BPS below N\n\
+- -M, --min-bps-time N for at least N seconds (default: 120)\n\
+- -O, --disable-timeouts disable timeout code, wait forever for data\n\
+- --o-sync open output file(s) in synchronous write mode\n\
+- -p, --protect protect existing files\n\
+- -q, --quiet quiet, no progress reports\n\
+- -r, --resume try to resume interrupted file transfer (Z)\n\
+- -R, --restricted restricted, more secure mode\n\
+- -s, --stop-at {HH:MM|+N} stop transmission at HH:MM or in N seconds\n\
+- -S, --timesync request remote time (twice: set local time)\n\
+- --syslog[=off] turn syslog on or off, if possible\n\
+- -t, --timeout N set timeout to N tenths of a second\n\
+- -u, --keep-uppercase keep upper case filenames\n\
+- -U, --unrestrict disable restricted mode (if allowed to)\n\
+- -v, --verbose be verbose, provide debugging information\n\
+- -w, --windowsize N Window is N bytes (Z)\n\
+- -X --xmodem use XMODEM protocol\n\
+- -y, --overwrite Yes, clobber existing file if any\n\
+- --ymodem use YMODEM protocol\n\
+- -Z, --zmodem use ZMODEM protocol\n\
+-\n\
+-short options use the same arguments as the long ones\n", 102},
+- {"%s waiting to receive.", 103},
+- {"\rBytes received: %7ld/%7ld BPS:%-6ld \r\n", 104},
+- {"%s: ready to receive %s", 105},
+- {"\rBytes received: %7ld BPS:%-6ld \r\n", 106},
+- {"\
+-\r\n\
+-%s: %s removed.\r\n", 107},
+- {"Pathname fetch returned EOT", 108},
+- {"Received dup Sector", 109},
+- {"Sync Error", 110},
+- {"CRC", 111},
+- {"Checksum", 112},
+- {"Sector number garbled", 113},
+- {"Sender Cancelled", 114},
+- {"Got 0%o sector header", 115},
+- {"file name ends with a /, skipped: %s\n", 116},
+- {"zmanag=%d, Lzmanag=%d\n", 117},
+- {"zconv=%d\n", 118},
+- {"file exists, skipped: %s\n", 119},
+- {"TIMESYNC: here %ld, remote %ld, diff %ld seconds\n", 120},
+- {"TIMESYNC: cannot set time: %s\n", 121},
+- {"cannot tmpfile() for tcp protocol synchronization", 122},
+- {"Topipe", 123},
+- {"Receiving: %s\n", 124},
+- {"Blocks received: %d", 125},
+- {"%s: %s exists\n", 126},
+- {"%s:\tSecurity Violation", 127},
+- {"remote command execution requested", 128},
+- {"not executed", 129},
+- {"got ZRINIT", 130},
+- {"Skipped", 131},
+- {"rzfile: bps rate %ld below min %ld", 132},
+- {"rzfile: reached stop time", 133},
+- {"\rBytes received: %7ld/%7ld BPS:%-6ld ETA %02d:%02d ", 134},
+- {"fgets for tcp protocol synchronization failed: ", 135},
+- {"file close error", 136},
+-};
+-
+-int _msg_tbl_length = 136;
+--- lrzsz-0.12.20.safe/po/ChangeLog 1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/po/ChangeLog 2004-09-12 14:40:34.793681512 -0400
+@@ -1,3 +1,15 @@
++2004-09-12 gettextize <bug-gnu-gettext@gnu.org>
++
++ * boldquot.sed: New file, from gettext-0.14.1.
++ * en@boldquot.header: New file, from gettext-0.14.1.
++ * en@quot.header: New file, from gettext-0.14.1.
++ * insert-header.sin: New file, from gettext-0.14.1.
++ * quot.sed: New file, from gettext-0.14.1.
++ * remove-potcdate.sin: New file, from gettext-0.14.1.
++ * Rules-quot: New file, from gettext-0.14.1.
++ * cat-id-tbl.c: Remove file.
++ * stamp-cat-id: Remove file.
++
+ /* Automatically generated by po2tbl.sed from lrzsz.pot. */
+
+ #if HAVE_CONFIG_H
+--- lrzsz-0.12.20.safe/po/en@boldquot.header 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/en@boldquot.header 2004-09-12 14:40:34.731690936 -0400
+@@ -0,0 +1,25 @@
++# All this catalog "translates" are quotation characters.
++# The msgids must be ASCII and therefore cannot contain real quotation
++# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
++# and double quote (0x22). These substitutes look strange; see
++# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
++#
++# This catalog translates grave accent (0x60) and apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019).
++# It also translates pairs of apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019)
++# and pairs of quotation mark (0x22) to
++# left double quotation mark (U+201C) and right double quotation mark (U+201D).
++#
++# When output to an UTF-8 terminal, the quotation characters appear perfectly.
++# When output to an ISO-8859-1 terminal, the single quotation marks are
++# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
++# grave/acute accent (by libiconv), and the double quotation marks are
++# transliterated to 0x22.
++# When output to an ASCII terminal, the single quotation marks are
++# transliterated to apostrophes, and the double quotation marks are
++# transliterated to 0x22.
++#
++# This catalog furthermore displays the text between the quotation marks in
++# bold face, assuming the VT100/XTerm escape sequences.
++#
+--- lrzsz-0.12.20.safe/po/en@quot.header 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/en@quot.header 2004-09-12 14:40:34.737690024 -0400
+@@ -0,0 +1,22 @@
++# All this catalog "translates" are quotation characters.
++# The msgids must be ASCII and therefore cannot contain real quotation
++# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
++# and double quote (0x22). These substitutes look strange; see
++# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
++#
++# This catalog translates grave accent (0x60) and apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019).
++# It also translates pairs of apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019)
++# and pairs of quotation mark (0x22) to
++# left double quotation mark (U+201C) and right double quotation mark (U+201D).
++#
++# When output to an UTF-8 terminal, the quotation characters appear perfectly.
++# When output to an ISO-8859-1 terminal, the single quotation marks are
++# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
++# grave/acute accent (by libiconv), and the double quotation marks are
++# transliterated to 0x22.
++# When output to an ASCII terminal, the single quotation marks are
++# transliterated to apostrophes, and the double quotation marks are
++# transliterated to 0x22.
++#
+--- lrzsz-0.12.20.safe/po/insert-header.sin 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/insert-header.sin 2004-09-12 14:40:34.743689112 -0400
+@@ -0,0 +1,23 @@
++# Sed script that inserts the file called HEADER before the header entry.
++#
++# At each occurrence of a line starting with "msgid ", we execute the following
++# commands. At the first occurrence, insert the file. At the following
++# occurrences, do nothing. The distinction between the first and the following
++# occurrences is achieved by looking at the hold space.
++/^msgid /{
++x
++# Test if the hold space is empty.
++s/m/m/
++ta
++# Yes it was empty. First occurrence. Read the file.
++r HEADER
++# Output the file's contents by reading the next line. But don't lose the
++# current line while doing this.
++g
++N
++bb
++:a
++# The hold space was nonempty. Following occurrences. Do nothing.
++x
++:b
++}
+--- lrzsz-0.12.20.safe/po/Makevars 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/Makevars 2004-09-12 14:40:34.748688352 -0400
+@@ -0,0 +1,41 @@
++# Makefile variables for PO directory in any package using GNU gettext.
++
++# Usually the message domain is the same as the package name.
++DOMAIN = $(PACKAGE)
++
++# These two variables depend on the location of this directory.
++subdir = po
++top_builddir = ..
++
++# These options get passed to xgettext.
++XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
++
++# This is the copyright holder that gets inserted into the header of the
++# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
++# package. (Note that the msgstr strings, extracted from the package's
++# sources, belong to the copyright holder of the package.) Translators are
++# expected to transfer the copyright for their translations to this person
++# or entity, or to disclaim their copyright. The empty string stands for
++# the public domain; in this case the translators are expected to disclaim
++# their copyright.
++COPYRIGHT_HOLDER = Free Software Foundation, Inc.
++
++# This is the email address or URL to which the translators shall report
++# bugs in the untranslated strings:
++# - Strings which are not entire sentences, see the maintainer guidelines
++# in the GNU gettext documentation, section 'Preparing Strings'.
++# - Strings which use unclear terms or require additional context to be
++# understood.
++# - Strings which make invalid assumptions about notation of date, time or
++# money.
++# - Pluralisation problems.
++# - Incorrect English spelling.
++# - Incorrect formatting.
++# It can be your email address, or a mailing list address where translators
++# can write to without being subscribed, or the URL of a web page through
++# which the translators can contact you.
++MSGID_BUGS_ADDRESS =
++
++# This is the list of locale categories, beyond LC_MESSAGES, for which the
++# message catalogs shall be used. It is usually empty.
++EXTRA_LOCALE_CATEGORIES =
+--- lrzsz-0.12.20.safe/po/quot.sed 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/quot.sed 2004-09-12 14:40:34.754687440 -0400
+@@ -0,0 +1,6 @@
++s/"\([^"]*\)"/“\1â€/g
++s/`\([^`']*\)'/‘\1’/g
++s/ '\([^`']*\)' / ‘\1’ /g
++s/ '\([^`']*\)'$/ ‘\1’/g
++s/^'\([^`']*\)' /‘\1’ /g
++s/“â€/""/g
+--- lrzsz-0.12.20.safe/po/remove-potcdate.sin 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/remove-potcdate.sin 2004-09-12 14:40:34.762686224 -0400
+@@ -0,0 +1,19 @@
++# Sed script that remove the POT-Creation-Date line in the header entry
++# from a POT file.
++#
++# The distinction between the first and the following occurrences of the
++# pattern is achieved by looking at the hold space.
++/^"POT-Creation-Date: .*"$/{
++x
++# Test if the hold space is empty.
++s/P/P/
++ta
++# Yes it was empty. First occurrence. Remove the line.
++g
++d
++bb
++:a
++# The hold space was nonempty. Following occurrences. Do nothing.
++x
++:b
++}
+--- lrzsz-0.12.20.safe/po/Rules-quot 1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/Rules-quot 2004-09-12 14:40:34.778683792 -0400
+@@ -0,0 +1,47 @@
++# Special Makefile rules for English message catalogs with quotation marks.
++
++DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
++
++.SUFFIXES: .insert-header .po-update-en
++
++en@quot.po-create:
++ $(MAKE) en@quot.po-update
++en@boldquot.po-create:
++ $(MAKE) en@boldquot.po-update
++
++en@quot.po-update: en@quot.po-update-en
++en@boldquot.po-update: en@boldquot.po-update-en
++
++.insert-header.po-update-en:
++ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
++ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
++ tmpdir=`pwd`; \
++ echo "$$lang:"; \
++ ll=`echo $$lang | sed -e 's/@.*//'`; \
++ LC_ALL=C; export LC_ALL; \
++ cd $(srcdir); \
++ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
++ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
++ rm -f $$tmpdir/$$lang.new.po; \
++ else \
++ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
++ :; \
++ else \
++ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
++ exit 1; \
++ fi; \
++ fi; \
++ else \
++ echo "creation of $$lang.po failed!" 1>&2; \
++ rm -f $$tmpdir/$$lang.new.po; \
++ fi
++
++en@quot.insert-header: insert-header.sin
++ sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
++
++en@boldquot.insert-header: insert-header.sin
++ sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
++
++mostlyclean: mostlyclean-quot
++mostlyclean-quot:
++ rm -f *.insert-header
+--- lrzsz-0.12.20.safe/po/stamp-cat-id 1998-12-30 02:50:01.000000000 -0500
++++ lrzsz-0.12.20/po/stamp-cat-id 1969-12-31 19:00:00.000000000 -0500
+@@ -1 +0,0 @@
+-timestamp
+--- lrzsz-0.12.20.safe/src/Makefile.am 1998-12-28 03:38:47.000000000 -0500
++++ lrzsz-0.12.20/src/Makefile.am 2004-09-12 14:40:53.665812512 -0400
+@@ -2,12 +2,12 @@
+ lrz_SOURCES=lrz.c timing.c zperr.c zreadline.c crctab.c rbsb.c zm.c protname.c tcp.c lsyslog.c canit.c
+ lsz_SOURCES=lsz.c timing.c zperr.c zreadline.c crctab.c rbsb.c zm.c protname.c tcp.c lsyslog.c canit.c
+ noinst_HEADERS = timing.h zglobal.h zmodem.h
+-datadir = $(prefix)/@DATADIRNAME@
++datadir = $(prefix)/share
+ localedir = $(datadir)/locale
+ CFLAGS=@CFLAGS@
+ DISTCLEAN_FILES=lrzszbug
+
+-LDADD = ../lib/libzmodem.a @INTLLIBS@
++LDADD = ../lib/libzmodem.a @LIBINTL@
+ AUTOMAKE_OPTIONS=ansi2knr
+ EXTRA_DIST = ansi2knr.1 ansi2knr.c lrzszbug.in
+ INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/src -I../intl -I$(top_srcdir)/lib
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch
new file mode 100644
index 000000000..9e46dfa07
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch
@@ -0,0 +1,32 @@
+From 28b473c3c96682a820e292cc1be006e19aee11bc Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Fri, 24 May 2013 01:07:24 -0400
+Subject: [PATCH] lrzsz check locale.h
+
+fix the build failure when using -O0 in a debug build:
+lrz.c:284:13: error: 'LC_ALL' undeclared (first use in this function)
+
+Upstream-Status: Submitted [uwe@ohse.de]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 6e2064c..c10460c 100644
+--- a/configure.in
++++ b/configure.in
+@@ -130,7 +130,7 @@ AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h sys/times.h)
+ LRZSZ_HEADERS_TERM_IO
+ AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)
+ AC_CHECK_HEADERS(sys/mman.h utime.h syslog.h sys/syslog.h sys/param.h)
+-AC_CHECK_HEADERS(sys/select.h strings.h arpa/inet.h)
++AC_CHECK_HEADERS(sys/select.h strings.h locale.h arpa/inet.h)
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_TYPE_SIZE_T
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..682f1c9c8
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| configure.in:95: error: automatic de-ANSI-fication support has been removed
+...
+| lib/Makefile.am:3: error: automatic de-ANSI-fication support has been removed
+| lib/Makefile.am: installing './depcomp'
+| src/Makefile.am:11: error: automatic de-ANSI-fication support has been removed
+
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: lrzsz-0.12.20/configure.in
+===================================================================
+--- lrzsz-0.12.20.orig/configure.in
++++ lrzsz-0.12.20/configure.in
+@@ -92,7 +92,6 @@ AC_PROG_RANLIB
+ AC_ISC_POSIX
+ AC_AIX
+ AC_MINIX
+-AM_C_PROTOTYPES
+ AC_C_CONST
+ AC_C_INLINE
+
+Index: lrzsz-0.12.20/lib/Makefile.am
+===================================================================
+--- lrzsz-0.12.20.orig/lib/Makefile.am
++++ lrzsz-0.12.20/lib/Makefile.am
+@@ -1,6 +1,5 @@
+ noinst_LIBRARIES=libzmodem.a
+ CFLAGS=@CFLAGS@
+-AUTOMAKE_OPTIONS=ansi2knr
+
+ EXTRA_DIST = alloca.c ansi2knr.1 ansi2knr.c \
+ getopt.c getopt1.c mkdir.c mktime.c \
+Index: lrzsz-0.12.20/src/Makefile.am
+===================================================================
+--- lrzsz-0.12.20.orig/src/Makefile.am
++++ lrzsz-0.12.20/src/Makefile.am
+@@ -8,7 +8,6 @@ CFLAGS=@CFLAGS@
+ DISTCLEAN_FILES=lrzszbug
+
+ LDADD = ../lib/libzmodem.a @LIBINTL@
+-AUTOMAKE_OPTIONS=ansi2knr
+ EXTRA_DIST = ansi2knr.1 ansi2knr.c lrzszbug.in
+ INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/src -I../intl -I$(top_srcdir)/lib
+ #DEFS = -DLOCALEDIR=\"$(localedir)\" -DOS=\"@host_os@\" -DCPU=\"@host_cpu@\"
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch
new file mode 100644
index 000000000..ace592c8f
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN lrzsz-0.12.20_org/src/Makefile.in lrzsz-0.12.20_patch/src/Makefile.in
+--- lrzsz-0.12.20_org/src/Makefile.in 1998-12-30 17:31:46.000000000 +0100
++++ lrzsz-0.12.20_patch/src/Makefile.in 2004-04-29 13:57:33.434909656 +0200
+@@ -372,13 +372,13 @@
+ rm -f $(DESTDIR)/$(bindir)/`echo lsb | sed -e '$(transform)'`
+ ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \
+ $(DESTDIR)/$(bindir)/`echo lsb |sed -e '$(transform)'`
+- rm -f $(bindir)/`echo lsx | sed -e '$(transform)'`
++ rm -f $(DESTDIR)/$(bindir)/`echo lsx | sed -e '$(transform)'`
+ ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \
+ $(DESTDIR)/$(bindir)/`echo lsx |sed -e '$(transform)'`
+- rm -f $(bindir)/`echo lrb | sed -e '$(transform)'`
++ rm -f $(DESTDIR)/$(bindir)/`echo lrb | sed -e '$(transform)'`
+ ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \
+ $(DESTDIR)/$(bindir)/`echo lrb |sed -e '$(transform)'`
+- rm -f $(bindir)/`echo lrx | sed -e '$(transform)'`
++ rm -f $(DESTDIR)/$(bindir)/`echo lrx | sed -e '$(transform)'`
+ ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \
+ $(DESTDIR)/$(bindir)/`echo lrx |sed -e '$(transform)'`
+ # rm -f $(bindir)/`echo lrzszbug | sed -e '$(transform)'`
diff --git a/poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
new file mode 100644
index 000000000..4b349be32
--- /dev/null
+++ b/poky/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Tools for zmodem/xmodem/ymodem file transfer"
+DESCRIPTION = "Lrzsz is a cosmetically modified zmodem/ymodem/xmodem package built from \
+the public-domain version of Chuck Forsberg's rzsz package. \
+These programs use error correcting protocols ({z,x,y}modem) to send (sz, sx, sb) and \
+receive (rz, rx, rb) files over a dial-in serial port from a variety of programs \
+running under various operating systems. "
+HOMEPAGE = "http://www.ohse.de/uwe/software/lrzsz.html"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f"
+SECTION = "console/network"
+DEPENDS = ""
+PR = "r6"
+
+SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
+ file://autotools.patch \
+ file://makefile.patch \
+ file://gettext.patch \
+ file://acdefine.patch \
+ file://lrzsz_fix_for_automake-1.12.patch \
+ file://lrzsz-check-locale.h.patch \
+ "
+
+SRC_URI[md5sum] = "b5ce6a74abc9b9eb2af94dffdfd372a4"
+SRC_URI[sha256sum] = "c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1"
+
+UPSTREAM_CHECK_URI = "http://ohse.de/uwe/software/lrzsz.html"
+
+inherit autotools gettext
+
+do_install() {
+ install -d ${D}${bindir}/
+ install -m 0755 src/lrz src/lsz ${D}${bindir}/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "rz rx rb sz sx sb"
+
+ALTERNATIVE_TARGET[rz] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rx] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rb] = "${bindir}/lrz"
+
+ALTERNATIVE_TARGET[sz] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sx] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sb] = "${bindir}/lsz"
diff --git a/poky/meta/recipes-bsp/pciutils/pciutils/configure.patch b/poky/meta/recipes-bsp/pciutils/pciutils/configure.patch
new file mode 100644
index 000000000..a7e445733
--- /dev/null
+++ b/poky/meta/recipes-bsp/pciutils/pciutils/configure.patch
@@ -0,0 +1,81 @@
+This patch:
+* ensures we link correctly
+* allows us to optionally pass target information to configure rather than using uname
+* select linux as the platform in most cases we care about
+
+This is a merge of various tweaks to allow us to build pciutils including
+work from:
+
+7/30/2010 - Qing He <qing.he@intel.com>
+1/22/2012 - Shane Wang <shane.wang@intel.com>
+Ionut Radu <ionutx.radu@intel.com>
+2017/6/15 - RP - Cleanups and merging patches
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: pciutils-3.5.6/Makefile
+===================================================================
+--- pciutils-3.5.6.orig/Makefile
++++ pciutils-3.5.6/Makefile
+@@ -96,7 +96,7 @@ example: example.o lib/$(PCILIB)
+ example.o: example.c $(PCIINC)
+
+ %: %.o
+- $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
++ $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
+
+ %.8 %.7: %.man
+ M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#"
+Index: pciutils-3.5.6/lib/configure
+===================================================================
+--- pciutils-3.5.6.orig/lib/configure
++++ pciutils-3.5.6/lib/configure
+@@ -9,6 +9,10 @@ echo_n() {
+ printf '%s' "$*"
+ }
+
++VERSION=$1
++IDSDIR=$2
++DNS=yes
++
+ if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then
+ echo >&2 "Please run the configure script from the top-level Makefile"
+ exit 1
+@@ -16,8 +20,8 @@ fi
+
+ echo_n "Configuring libpci for your system..."
+ if [ -z "$HOST" ] ; then
+- sys=`uname -s`
+- rel=`uname -r`
++ sys=${3:-`uname -s`}
++ rel=
+ realsys="$sys"
+ if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+ then
+@@ -25,7 +29,7 @@ if [ -z "$HOST" ] ; then
+ proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+ cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+ else
+- cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
++ cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`}
+ fi
+ if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ]
+ then
+@@ -35,7 +39,7 @@ if [ -z "$HOST" ] ; then
+ then
+ sys=cygwin
+ fi
+- HOST=${3:-$cpu-$sys}
++ HOST=$cpu-$sys
+ fi
+ [ -n "$RELEASE" ] && rel="${RELEASE}"
+ # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
+@@ -44,6 +48,8 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^
+ sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+
++{ echo "$host" | grep linux; } && sys=linux
++
+ c=config.h
+ m=config.mk
+ echo >$c '#define PCI_CONFIG_H'
diff --git a/poky/meta/recipes-bsp/pciutils/pciutils_3.5.6.bb b/poky/meta/recipes-bsp/pciutils/pciutils_3.5.6.bb
new file mode 100644
index 000000000..b18b7da3e
--- /dev/null
+++ b/poky/meta/recipes-bsp/pciutils/pciutils_3.5.6.bb
@@ -0,0 +1,58 @@
+SUMMARY = "PCI utilities"
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS = "zlib kmod"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \
+ file://configure.patch"
+
+SRC_URI[md5sum] = "8e52278399b7b35fcfc031bc05da80a8"
+SRC_URI[sha256sum] = "f346eeb90cce0910c05b877fe49eadc760fa084c0455fd313e39d4b2c2d4bb21"
+
+inherit multilib_header pkgconfig
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}"
+PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
+
+PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes STRIP= LIBDIR=${libdir}"
+
+# see configure.patch
+do_configure () {
+ (
+ cd lib && \
+ # PACKAGECONFIG_CONFARGS for this recipe could only possibly contain 'HWDB=yes/no',
+ # so we put it before ./configure
+ ${PCI_CONF_FLAG} ${PACKAGECONFIG_CONFARGS} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH}
+ )
+}
+
+export PREFIX = "${prefix}"
+export SBINDIR = "${sbindir}"
+export SHAREDIR = "${datadir}"
+export MANDIR = "${mandir}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS= ${PCI_CONF_FLAG}"
+
+# The configure script breaks if the HOST variable is set
+HOST[unexport] = "1"
+
+do_install () {
+ oe_runmake DESTDIR=${D} install install-lib
+
+ install -d ${D}${bindir}
+ ln -s ../sbin/lspci ${D}${bindir}/lspci
+
+ oe_multilib_header pci/config.h
+}
+
+PACKAGES =+ "${PN}-ids libpci"
+FILES_${PN}-ids = "${datadir}/pci.ids*"
+FILES_libpci = "${libdir}/libpci.so.*"
+SUMMARY_${PN}-ids = "PCI utilities - device ID database"
+DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils."
+RDEPENDS_${PN} += "${PN}-ids"
diff --git a/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch
new file mode 100644
index 000000000..d4c2bed15
--- /dev/null
+++ b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/lex_sys_types.patch
@@ -0,0 +1,21 @@
+Include sys/types.h for u_long definition
+
+Fix errors like
+In file included from src/lex_config.l:34:0:
+src/yacc_config.y:45:5: error: unknown type name 'u_long'
+ u_long num;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: pcmciautils-018/src/lex_config.l
+===================================================================
+--- pcmciautils-018.orig/src/lex_config.l
++++ pcmciautils-018/src/lex_config.l
+@@ -22,6 +22,7 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <syslog.h>
++#include <sys/types.h>
+
+ #ifdef HAS_WORDEXP
+ #include <wordexp.h>
diff --git a/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch
new file mode 100644
index 000000000..7b0ce2119
--- /dev/null
+++ b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [configuration]
+
+Hardcoded paths are bad...
+This lets us use the install from OE's native sysroot
+rebase the patch to 018, removing hardcoded path for true
+as well. Removing of -D in install invocation is a little
+questionable, is it some GNU extention?
+
+-Khem Raj <raj.khem@gmail.com>
+
+Index: pcmciautils-018/Makefile
+===================================================================
+--- pcmciautils-018.orig/Makefile
++++ pcmciautils-018/Makefile
+@@ -76,7 +76,7 @@ sbindir = ${exec_prefix}/sbin
+ mandir = ${prefix}/usr/share/man
+ udevdir = ${prefix}/lib/udev
+
+-INSTALL = /usr/bin/install -c
++INSTALL = install -c
+ INSTALL_PROGRAM = ${INSTALL}
+ INSTALL_DATA = ${INSTALL} -m 644
+ INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+@@ -180,7 +180,7 @@ endif
+ # if DEBUG is enabled, then we do not strip or optimize
+ ifeq ($(strip $(DEBUG)),true)
+ CFLAGS += -O1 -g -DDEBUG -D_GNU_SOURCE
+- STRIPCMD = /bin/true -Since_we_are_debugging
++ STRIPCMD = true -Since_we_are_debugging
+ else
+ CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
+ STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+@@ -273,30 +273,32 @@ clean:
+
+ install-hotplug:
+ $(INSTALL) -d $(DESTDIR)$(hotplugdir)
+- $(INSTALL_PROGRAM) -D hotplug/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.agent
+- $(INSTALL_PROGRAM) -D hotplug/pcmcia.rc $(DESTDIR)$(hotplugdir)/pcmcia.rc
++ $(INSTALL_PROGRAM) hotplug/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.agent
++ $(INSTALL_PROGRAM) hotplug/pcmcia.rc $(DESTDIR)$(hotplugdir)/pcmcia.rc
+
+ uninstall-hotplug:
+ - rm -f $(DESTDIR)$(hotplugdir)/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.rc
+
+ install-socket-hotplug:
+- $(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent
+- $(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.rc $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
++ $(INSTALL_PROGRAM) hotplug/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent
++ $(INSTALL_PROGRAM) hotplug/pcmcia_socket.rc $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
+
+ uninstall-socket-hotplug:
+ - rm -f $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
+
+ install-socket-tools:
+- $(INSTALL_PROGRAM) -D $(PCMCIA_SOCKET_STARTUP) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
++ $(INSTALL) -d $(DESTDIR)$(udevhelperdir)
++ $(INSTALL_PROGRAM) $(PCMCIA_SOCKET_STARTUP) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
+
+ uninstall-socket-tools:
+ - rm -f $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
+
+ install-tools:
+ $(INSTALL) -d $(DESTDIR)$(sbindir)
+- $(INSTALL_PROGRAM) -D $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(PCCARDCTL)
++ $(INSTALL) -d $(DESTDIR)$(udevhelperdir)
++ $(INSTALL_PROGRAM) $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(PCCARDCTL)
+ $(SYMLINK) $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(LSPCMCIA)
+- $(INSTALL_PROGRAM) -D $(PCMCIA_CHECK_BROKEN_CIS) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_CHECK_BROKEN_CIS)
++ $(INSTALL_PROGRAM) $(PCMCIA_CHECK_BROKEN_CIS) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_CHECK_BROKEN_CIS)
+
+ uninstall-tools:
+ - rm -f $(DESTDIR)$(sbindir)/$(PCCARDCTL)
+@@ -305,22 +307,24 @@ uninstall-tools:
+
+ install-config:
+ $(INSTALL) -d $(DESTDIR)$(pcmciaconfdir)
+- $(INSTALL_DATA) -D config/config.opts $(DESTDIR)$(pcmciaconfdir)/config.opts
++ $(INSTALL_DATA) config/config.opts $(DESTDIR)$(pcmciaconfdir)/config.opts
+ if [ -f config/config.opts.$(ARCH) ]; then \
+- $(INSTALL_DATA) -D config/config.opts.$(ARCH) $(DESTDIR)$(pcmciaconfdir)/config.opts; \
++ $(INSTALL_DATA) config/config.opts.$(ARCH) $(DESTDIR)$(pcmciaconfdir)/config.opts; \
+ fi
+
+ uninstall-config:
+ # - rm -f $(DESTDIR)$(pcmciaconfdir)/config.opts
+
+ install-udev:
+- $(INSTALL_DATA) -D $(UDEV_RULES_FILE) $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
++ $(INSTALL) -d $(DESTDIR)$(udevrulesdir)
++ $(INSTALL_DATA) $(UDEV_RULES_FILE) $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
+
+ uninstall-udev:
+ - rm -f $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
+
+ install-man:
+- $(INSTALL_DATA) -D man/man8/pccardctl.8 $(DESTDIR)$(mandir)/man8/pccardctl.8
++ $(INSTALL) -d $(DESTDIR)$(mandir)/man8
++ $(INSTALL_DATA) man/man8/pccardctl.8 $(DESTDIR)$(mandir)/man8/pccardctl.8
+ $(SYMLINK) pccardctl.8 $(DESTDIR)$(mandir)/man8/lspcmcia.8
+
+ uninstall-man:
diff --git a/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch
new file mode 100644
index 000000000..4c5eba795
--- /dev/null
+++ b/poky/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_race.patch
@@ -0,0 +1,29 @@
+"make src/lex_config.o"
+
+results in:
+
+src/lex_config.l:35:25: fatal error: yacc_config.h: No such file or directory
+
+so add missing dependency through a missing rule. Also remove a rule which
+doesn't appear to do anything.
+
+RP
+2016/1/31
+
+Upstream-Status: Pending
+
+Index: pcmciautils-018/Makefile
+===================================================================
+--- pcmciautils-018.orig/Makefile
++++ pcmciautils-018/Makefile
+@@ -246,8 +246,8 @@ $(PCMCIA_SOCKET_STARTUP): $(LIBC) src/st
+ $(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/startup.o src/yacc_config.o src/lex_config.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
+ $(QUIET) $(STRIPCMD) $@
+
+-yacc_config.o lex_config.o: %.o: %.c
+- $(CC) -c -MD -O -pipe $(CPPFLAGS) $<
++src/lex_config.o : src/lex_config.c src/yacc_config.h ccdv
++ $(QUIET) $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+ debugtools: ccdv $(CBDUMP) $(CISDUMP)
+
diff --git a/poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc b/poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
new file mode 100644
index 000000000..052498050
--- /dev/null
+++ b/poky/meta/recipes-bsp/pcmciautils/pcmciautils.inc
@@ -0,0 +1,34 @@
+SUMMARY = "Linux kernel userland utilities for the PCMCIA subsystem"
+HOMEPAGE = "https://www.kernel.org/pub/linux/utils/kernel/pcmcia/"
+SECTION = "kernel/userland"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "udev sysfsutils flex-native"
+RDEPENDS_${PN} = "udev module-init-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/pcmcia/${BP}.tar.xz"
+
+S = "${WORKDIR}/pcmciautils-${PV}"
+
+inherit pkgconfig
+
+export HOSTCC = "${BUILD_CC}"
+export etcdir = "${sysconfdir}"
+export sbindir = "${base_sbindir}"
+export pcmciaconfdir = "${sysconfdir}/pcmcia"
+export udevdir = "`pkg-config --variable=udevdir udev`"
+export udevrulesdir = "`pkg-config --variable=udevdir udev`/rules.d"
+export UDEV = "1"
+LD = "${CC}"
+CFLAGS =+ "-I${S}/src"
+CFLAGS =+ "-DPCMCIAUTILS_VERSION=\\"${PV}\\""
+
+EXTRA_OEMAKE = "-e 'STRIP=echo' 'LIB_OBJS=-lc -lsysfs' 'LEX=flex'"
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+CONFFILES_${PN} += "${sysconfdir}/pcmcia/config.opts"
diff --git a/poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb b/poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
new file mode 100644
index 000000000..bf0f58a7c
--- /dev/null
+++ b/poky/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
@@ -0,0 +1,11 @@
+require pcmciautils.inc
+
+SRC_URI += "file://makefile_fix.patch \
+ file://makefile_race.patch \
+ file://lex_sys_types.patch \
+"
+
+SRC_URI[md5sum] = "885431c3cefb76ffdad8cb985134e996"
+SRC_URI[sha256sum] = "57c27be8f04ef4d535bcfa988567316cc57659fe69068327486dab53791e6558"
+
+PR = "r1"
diff --git a/poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb b/poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
new file mode 100644
index 000000000..cac09101c
--- /dev/null
+++ b/poky/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
@@ -0,0 +1,27 @@
+SECTION = "base"
+SUMMARY = "Utilities and scripts for power management"
+DESCRIPTION = "Simple shell command line tools to suspend and hibernate."
+HOMEPAGE = "http://pm-utils.freedesktop.org/wiki/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://src/pm-pmu.c;beginline=1;endline=22;md5=3c1ddbc54e735fb4a0386e14c78a3147"
+
+PR = "r1"
+
+SRC_URI = "http://pm-utils.freedesktop.org/releases/pm-utils-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1742a556089c36c3a89eb1b957da5a60"
+SRC_URI[sha256sum] = "8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b"
+
+inherit pkgconfig autotools manpages
+
+PACKAGECONFIG[manpages] = "--enable-doc, --disable-doc, libxslt-native xmlto-native"
+
+RDEPENDS_${PN} = "grep bash"
+
+do_configure_prepend () {
+ ( cd ${S}; autoreconf -f -i -s )
+}
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+FILES_${PN}-dbg += "${datadir}/doc/pm-utils/README.debugging"
diff --git a/poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch b/poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch
new file mode 100644
index 000000000..e34f262a8
--- /dev/null
+++ b/poky/meta/recipes-bsp/setserial/setserial/add_stdlib.patch
@@ -0,0 +1,18 @@
+# This patch addes stdlib.h to fix compiler warnings due to the exit
+# built-in not being defined and getting an incorrect implicit definition
+
+Upstream-Status: Pending
+
+Created-by: Saul Wold <saul.wold@intel.com>
+
+--- setserial-2.17/setserial.c 2010-09-02 14:11:27.569763088 -0700
++++ setserial-2.17_fixed/setserial.c 2010-09-02 14:11:08.546264139 -0700
+@@ -11,6 +11,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ #include <termios.h>
+ #include <string.h>
+
diff --git a/poky/meta/recipes-bsp/setserial/setserial/ldflags.patch b/poky/meta/recipes-bsp/setserial/setserial/ldflags.patch
new file mode 100644
index 000000000..174adc89f
--- /dev/null
+++ b/poky/meta/recipes-bsp/setserial/setserial/ldflags.patch
@@ -0,0 +1,24 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- setserial-2.17.orig/Makefile.in
++++ setserial-2.17/Makefile.in
+@@ -13,6 +13,7 @@ STRIP = @STRIP@
+ CC = @CC@
+ RM = rm -f
+ CFLAGS = @CFLAGS@
++LDFLAGS = @LDFLAGS@
+ DEFS = @DEFS@
+ INCS = -I.
+ TAR = tar
+@@ -20,7 +21,7 @@ TAR = tar
+ all: setserial setserial.cat
+
+ setserial: setserial.c
+- $(CC) $(CFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
++ $(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
+
+ setserial.cat: setserial.8
+ nroff -man setserial.8 > setserial.cat
diff --git a/poky/meta/recipes-bsp/setserial/setserial_2.17.bb b/poky/meta/recipes-bsp/setserial/setserial_2.17.bb
new file mode 100644
index 000000000..8dbddd7dc
--- /dev/null
+++ b/poky/meta/recipes-bsp/setserial/setserial_2.17.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Controls the configuration of serial ports"
+DESCRIPTION = "setserial is a program designed to set and/or report the configuration information associated with a serial port"
+HOMEPAGE = "http://setserial.sourceforge.net"
+AUTHOR = "Theodore Ts'o <tytso@mit.edu>"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2.0"
+LIC_FILES_CHKSUM = "file://version.h;beginline=1;endline=6;md5=2e7c59cb9e57e356ae81f50f4e4dfd99"
+PR = "r3"
+
+DEPENDS += "groff-native"
+
+inherit autotools-brokensep
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
+ file://add_stdlib.patch \
+ file://ldflags.patch \
+ "
+
+SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2"
+SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man8
+
+ install -m 0755 ${S}/setserial ${D}${bindir}
+ install -m 0644 ${S}/setserial.8 ${D}${mandir}/man8
+}
diff --git a/poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch b/poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch
new file mode 100644
index 000000000..ecaa1796a
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/files/MPC8315ERDB-enable-DHCP.patch
@@ -0,0 +1,19 @@
+Enabled dhcp client functionality for Yocto reference
+hardware MPC8315E-RDB.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+Index: git/configs/MPC8315ERDB_defconfig
+===================================================================
+--- git.orig/configs/MPC8315ERDB_defconfig
++++ git/configs/MPC8315ERDB_defconfig
+@@ -12,6 +12,7 @@ CONFIG_CMD_PCI=y
+ CONFIG_CMD_SATA=y
+ CONFIG_CMD_USB=y
+ # CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_DHCP=y
+ CONFIG_CMD_MII=y
+ CONFIG_CMD_PING=y
+ CONFIG_CMD_DATE=y
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-common_2018.01.inc b/poky/meta/recipes-bsp/u-boot/u-boot-common_2018.01.inc
new file mode 100644
index 000000000..d2073ea0c
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/u-boot-common_2018.01.inc
@@ -0,0 +1,16 @@
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
+PE = "1"
+
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "f3dd87e0b98999a78e500e8c6d2b063ebadf535a"
+
+SRC_URI = "git://git.denx.de/u-boot.git \
+ file://MPC8315ERDB-enable-DHCP.patch \
+"
+
+S = "${WORKDIR}/git"
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.01.bb b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.01.bb
new file mode 100644
index 000000000..02887a138
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.01.bb
@@ -0,0 +1,34 @@
+require u-boot-common_${PV}.inc
+
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+DEPENDS = "mtd-utils"
+
+INSANE_SKIP_${PN} = "already-stripped"
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'HOSTCC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+
+inherit uboot-config
+
+do_compile () {
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake envtools
+}
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -d ${D}${sysconfdir}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+ install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+do_install_class-cross () {
+ install -d ${D}${bindir_cross}
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+}
+
+SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.01.bb b/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.01.bb
new file mode 100644
index 000000000..1c008be96
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.01.bb
@@ -0,0 +1,29 @@
+require u-boot-common_${PV}.inc
+
+SUMMARY = "U-Boot bootloader image creation tool"
+DEPENDS = "openssl"
+
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
+
+do_compile () {
+ oe_runmake sandbox_defconfig
+
+ # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and
+ # generating it requires bin2header tool, which for target build
+ # is built with target tools and thus cannot be executed on host.
+ sed -i "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" .config
+
+ oe_runmake cross_tools NO_SDL=1
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
+ ln -sf uboot-mkimage ${D}${bindir}/mkimage
+}
+
+RDEPENDS_${PN} += "dtc"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot.inc b/poky/meta/recipes-bsp/u-boot/u-boot.inc
new file mode 100644
index 000000000..c2bcf9984
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/u-boot.inc
@@ -0,0 +1,307 @@
+SUMMARY = "Universal Boot Loader for embedded devices"
+PROVIDES = "virtual/bootloader"
+
+B = "${WORKDIR}/build"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit uboot-config uboot-extlinux-config uboot-sign deploy
+
+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
+EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+
+PACKAGECONFIG ??= "openssl"
+# u-boot will compile its own tools during the build, with specific
+# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as
+# a host build dependency.
+PACKAGECONFIG[openssl] = ",,openssl-native"
+
+# Allow setting an additional version string that will be picked up by the
+# u-boot build system and appended to the u-boot version. If the .scmversion
+# file already exists it will not be overwritten.
+UBOOT_LOCALVERSION ?= ""
+
+# Some versions of u-boot use .bin and others use .img. By default use .bin
+# but enable individual recipes to change this value.
+UBOOT_SUFFIX ??= "bin"
+UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
+UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
+UBOOT_MAKE_TARGET ?= "all"
+
+# Output the ELF generated. Some platforms can use the ELF file and directly
+# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging
+# purposes.
+UBOOT_ELF ?= ""
+UBOOT_ELF_SUFFIX ?= "elf"
+UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
+
+# Some versions of u-boot build an SPL (Second Program Loader) image that
+# should be packaged along with the u-boot binary as well as placed in the
+# deploy directory. For those versions they can set the following variables
+# to allow packaging the SPL.
+SPL_BINARY ?= ""
+SPL_BINARYNAME ?= "${@os.path.basename(d.getVar("SPL_BINARY"))}"
+SPL_IMAGE ?= "${SPL_BINARYNAME}-${MACHINE}-${PV}-${PR}"
+SPL_SYMLINK ?= "${SPL_BINARYNAME}-${MACHINE}"
+
+# Additional environment variables or a script can be installed alongside
+# u-boot to be used automatically on boot. This file, typically 'uEnv.txt'
+# or 'boot.scr', should be packaged along with u-boot as well as placed in the
+# deploy directory. Machine configurations needing one of these files should
+# include it in the SRC_URI and set the UBOOT_ENV parameter.
+UBOOT_ENV_SUFFIX ?= "txt"
+UBOOT_ENV ?= ""
+UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
+
+# U-Boot EXTLINUX variables. U-Boot searches for /boot/extlinux/extlinux.conf
+# to find EXTLINUX conf file.
+UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux"
+UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf"
+UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}"
+
+do_compile () {
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
+ sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk
+ fi
+
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+
+ if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+ then
+ echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+ echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+ fi
+
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ unset i j k
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ oe_runmake -C ${S} O=${B}/${config} ${config}
+ oe_runmake -C ${S} O=${B}/${config} ${UBOOT_MAKE_TARGET}
+ for binary in ${UBOOT_BINARIES}; do
+ k=$(expr $k + 1);
+ if [ $k -eq $i ]; then
+ cp ${B}/${config}/${binary} ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
+ fi
+ done
+ unset k
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE}
+ oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET}
+ fi
+
+}
+
+do_install () {
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -d ${D}/boot
+ install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${D}/boot
+ install -m 644 ${B}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+ fi
+
+ if [ -n "${UBOOT_ELF}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
+ ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
+ fi
+ fi
+
+ if [ -e ${WORKDIR}/fw_env.config ] ; then
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ fi
+
+ if [ -n "${SPL_BINARY}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARYNAME}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+ ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARYNAME}
+ fi
+ fi
+
+ if [ -n "${UBOOT_ENV}" ]
+ then
+ install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
+ ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
+ fi
+
+ if [ "${UBOOT_EXTLINUX}" = "1" ]
+ then
+ install -Dm 0644 ${UBOOT_EXTLINUX_CONFIG} ${D}/${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}
+ fi
+
+}
+
+FILES_${PN} = "/boot ${sysconfdir}"
+
+do_deploy () {
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+ cd ${DEPLOYDIR}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -d ${DEPLOYDIR}
+ install -m 644 ${B}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+ cd ${DEPLOYDIR}
+ rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+ fi
+
+ if [ -n "${UBOOT_ELF}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
+ ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
+ ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+ ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+ fi
+ fi
+
+
+ if [ -n "${SPL_BINARY}" ]
+ then
+ if [ -n "${UBOOT_CONFIG}" ]
+ then
+ for config in ${UBOOT_MACHINE}; do
+ i=$(expr $i + 1);
+ for type in ${UBOOT_CONFIG}; do
+ j=$(expr $j + 1);
+ if [ $j -eq $i ]
+ then
+ install -m 644 ${B}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
+ rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARYNAME}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+ ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ done
+ unset j
+ done
+ unset i
+ else
+ install -m 644 ${B}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
+ rm -f ${DEPLOYDIR}/${SPL_BINARYNAME} ${DEPLOYDIR}/${SPL_SYMLINK}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARYNAME}
+ ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
+ fi
+ fi
+
+
+ if [ -n "${UBOOT_ENV}" ]
+ then
+ install -m 644 ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
+ rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+ ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
+ ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+ fi
+
+ if [ "${UBOOT_EXTLINUX}" = "1" ]
+ then
+ install -m 644 ${UBOOT_EXTLINUX_CONFIG} ${DEPLOYDIR}/${UBOOT_EXTLINUX_SYMLINK}
+ ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}
+ ln -sf ${UBOOT_EXTLINUX_SYMLINK} ${DEPLOYDIR}/${UBOOT_EXTLINUX_CONF_NAME}
+ fi
+}
+
+addtask deploy before do_build after do_compile
diff --git a/poky/meta/recipes-bsp/u-boot/u-boot_2018.01.bb b/poky/meta/recipes-bsp/u-boot/u-boot_2018.01.bb
new file mode 100644
index 000000000..37c21dcaa
--- /dev/null
+++ b/poky/meta/recipes-bsp/u-boot/u-boot_2018.01.bb
@@ -0,0 +1,4 @@
+require u-boot-common_${PV}.inc
+require u-boot.inc
+
+DEPENDS += "bc-native dtc-native"
diff --git a/poky/meta/recipes-bsp/usbinit/usbinit.bb b/poky/meta/recipes-bsp/usbinit/usbinit.bb
new file mode 100644
index 000000000..aba44b406
--- /dev/null
+++ b/poky/meta/recipes-bsp/usbinit/usbinit.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Initscript for enabling USB gadget Ethernet"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+PR = "r3"
+
+SRC_URI = "file://usb-gether \
+ file://COPYING.GPL"
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -d ${D}${sysconfdir}/init.d
+ install usb-gether ${D}${sysconfdir}/init.d
+}
+
+inherit update-rc.d allarch
+
+INITSCRIPT_NAME = "usb-gether"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
diff --git a/poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL b/poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/poky/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/poky/meta/recipes-bsp/usbinit/usbinit/usb-gether b/poky/meta/recipes-bsp/usbinit/usbinit/usb-gether
new file mode 100755
index 000000000..e80a0bb30
--- /dev/null
+++ b/poky/meta/recipes-bsp/usbinit/usbinit/usb-gether
@@ -0,0 +1,23 @@
+#! /bin/sh
+#
+# usb-ether Start up the gadget usb ethernet interface.
+#
+
+case "$1" in
+ start|"")
+ test "$VERBOSE" != no && echo "Initializing g_ether gadget..."
+ modprobe g_ether
+ ifup usb0
+ ;;
+ stop)
+ test "$VERBOSE" != no && echo "Disabling g_ether..."
+ ifdown usb0
+ rmmod g_ether
+ ;;
+ *)
+ echo "Usage: usb-ether {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch b/poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch
new file mode 100644
index 000000000..a6b241f85
--- /dev/null
+++ b/poky/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch
@@ -0,0 +1,30 @@
+From 333d5fbbc03481f1aa222bd68c2609db168ae3e0 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Thu, 26 Jul 2012 10:37:32 +0100
+Subject: [PATCH] usb-devices: avoid dependency on bash
+
+By virtue of having #!/bin/bash this script declared that it requires
+bash, however manual examination, checkbashisms and tests with dash
+and busybox show that it doesn't contain any bashisms, so change the
+header to avoid the dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ usb-devices | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usb-devices b/usb-devices
+index b2052e2..14a5358 100755
+--- a/usb-devices
++++ b/usb-devices
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # Copyright: 2009 Greg Kroah-Hartman <greg@kroah.com>
+ # 2009 Randy Dunlap <rdunlap@xenotime.net>
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-bsp/usbutils/usbutils_009.bb b/poky/meta/recipes-bsp/usbutils/usbutils_009.bb
new file mode 100644
index 000000000..3ffc0dd97
--- /dev/null
+++ b/poky/meta/recipes-bsp/usbutils/usbutils_009.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Host side USB console utilities"
+DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected to the USB bus."
+HOMEPAGE = "http://www.linux-usb.org"
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "libusb zlib virtual/libiconv udev"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
+ file://usb-devices-avoid-dependency-on-bash.patch \
+ "
+
+SRC_URI[md5sum] = "b5dbc498b2eb5058f7a57fc6532d0aad"
+SRC_URI[sha256sum] = "e73543293a17c7803994eac97a49e58b377e08e6299ba11aad09794b91340e8b"
+
+inherit autotools pkgconfig distro_features_check update-alternatives
+
+ALTERNATIVE_${PN} = "lsusb"
+ALTERNATIVE_PRIORITY = "100"
+
+FILES_${PN}-dev += "${datadir}/pkgconfig"
+
+RRECOMMENDS_${PN} = "udev-hwdb"
+RDEPENDS_${PN}-ptest = "libboost-system libboost-thread"
+
+PACKAGE_BEFORE_PN =+ "${PN}-python"
+FILES_${PN}-python += "${bindir}/lsusb.py"
+RDEPENDS_${PN}-python = "python3-core"
+
+do_install_append() {
+ sed -i -E '1s,#!.+python,#!${bindir}/python3,' ${D}${bindir}/lsusb.py
+}
diff --git a/poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch b/poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch
new file mode 100644
index 000000000..a09e2a257
--- /dev/null
+++ b/poky/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch
@@ -0,0 +1,21766 @@
+From 1a410ae58f28eeab32fa87626cfd5a663ba33c51 Mon Sep 17 00:00:00 2001
+From: Bernhard Walle <bernhard@bwalle.de>
+Date: Tue, 13 May 2014 23:40:56 +0200
+Subject: [PATCH 2/2] Update x86emu from X.org
+
+This commit updates the x86emu copy from X.org tarball
+(ftp://mirror.csclub.uwaterloo.ca/x.org/current/src/xserver/xorg-server-1.12.2.tar.bz2).
+
+This fixes a compatibility issue between v86d and SeaBIOS VGA BIOS where
+the leal instruction is not decoded properly. Read the
+http://thread.gmane.org/gmane.comp.emulators.qemu/271806 thread for more
+details.
+
+Upstream-Status: Backport
+
+Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
+---
+ libs/x86emu/LICENSE | 17 -
+ libs/x86emu/debug.c | 509 +++---
+ libs/x86emu/decode.c | 1069 ++++++------
+ libs/x86emu/fpu.c | 463 +++---
+ libs/x86emu/ops.c | 2940 +++++++++++++++++++--------------
+ libs/x86emu/ops2.c | 1929 +++++++++++-----------
+ libs/x86emu/prim_ops.c | 3219 +++++++++++++++++++------------------
+ libs/x86emu/sys.c | 583 +++----
+ libs/x86emu/validate.c | 52 +-
+ libs/x86emu/x86emu.h | 75 +-
+ libs/x86emu/x86emu/debug.h | 163 +-
+ libs/x86emu/x86emu/decode.h | 57 +-
+ libs/x86emu/x86emu/fpu.h | 23 +-
+ libs/x86emu/x86emu/fpu_regs.h | 44 +-
+ libs/x86emu/x86emu/ops.h | 6 +-
+ libs/x86emu/x86emu/prim_asm.h | 251 ++-
+ libs/x86emu/x86emu/prim_ops.h | 188 +--
+ libs/x86emu/x86emu/prim_x86_gcc.h | 77 +
+ libs/x86emu/x86emu/regs.h | 101 +-
+ libs/x86emu/x86emu/types.h | 50 +-
+ libs/x86emu/x86emu/x86emui.h | 34 +-
+ 21 files changed, 6379 insertions(+), 5471 deletions(-)
+ delete mode 100644 libs/x86emu/LICENSE
+ create mode 100644 libs/x86emu/x86emu/prim_x86_gcc.h
+
+diff --git a/libs/x86emu/LICENSE b/libs/x86emu/LICENSE
+deleted file mode 100644
+index a3ede4a..0000000
+--- a/libs/x86emu/LICENSE
++++ /dev/null
+@@ -1,17 +0,0 @@
+- License information
+- -------------------
+-
+-The x86emu library is under a BSD style license, comaptible
+-with the XFree86 and X licenses used by XFree86. The
+-original x86emu libraries were under the GNU General Public
+-License. Due to license incompatibilities between the GPL
+-and the XFree86 license, the original authors of the code
+-decided to allow a license change. If you have submitted
+-code to the original x86emu project, and you don't agree
+-with the license change, please contact us and let you
+-know. Your code will be removed to comply with your wishes.
+-
+-If you have any questions about this, please send email to
+-x86emu@linuxlabs.com or KendallB@scitechsoft.com for
+-clarification.
+-
+diff --git a/libs/x86emu/debug.c b/libs/x86emu/debug.c
+index 6fd7f11..1a8d1d6 100644
+--- a/libs/x86emu/debug.c
++++ b/libs/x86emu/debug.c
+@@ -38,6 +38,8 @@
+ ****************************************************************************/
+
+ #include "x86emu/x86emui.h"
++#include <stdio.h>
++#include <string.h>
+ #ifndef NO_SYS_HEADERS
+ #include <stdarg.h>
+ #include <stdlib.h>
+@@ -47,46 +49,51 @@
+
+ #ifdef DEBUG
+
+-static void print_encoded_bytes (u16 s, u16 o);
+-static void print_decoded_instruction (void);
+-static int parse_line (char *s, int *ps, int *n);
+-
++static void print_encoded_bytes(u16 s, u16 o);
++static void print_decoded_instruction(void);
++static int parse_line(char *s, int *ps, int *n);
++
+ /* should look something like debug's output. */
+-void X86EMU_trace_regs (void)
++void
++X86EMU_trace_regs(void)
+ {
+- if (DEBUG_TRACE()) {
+- x86emu_dump_regs();
++ if (DEBUG_TRACE()) {
++ x86emu_dump_regs();
+ }
+- if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) {
+- printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+- print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+- print_decoded_instruction();
++ if (DEBUG_DECODE() && !DEBUG_DECODE_NOPRINT()) {
++ printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
++ print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
++ print_decoded_instruction();
+ }
+ }
+
+-void X86EMU_trace_xregs (void)
++void
++X86EMU_trace_xregs(void)
+ {
+- if (DEBUG_TRACE()) {
+- x86emu_dump_xregs();
++ if (DEBUG_TRACE()) {
++ x86emu_dump_xregs();
+ }
+ }
+
+-void x86emu_just_disassemble (void)
++void
++x86emu_just_disassemble(void)
+ {
+ /*
+ * This routine called if the flag DEBUG_DISASSEMBLE is set kind
+ * of a hack!
+ */
+- printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+- print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+- print_decoded_instruction();
++ printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
++ print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
++ print_decoded_instruction();
+ }
+
+-static void disassemble_forward (u16 seg, u16 off, int n)
++static void
++disassemble_forward(u16 seg, u16 off, int n)
+ {
+- X86EMU_sysEnv tregs;
+- int i;
+- u8 op1;
++ X86EMU_sysEnv tregs;
++ int i;
++ u8 op1;
++
+ /*
+ * hack, hack, hack. What we do is use the exact machinery set up
+ * for execution, except that now there is an additional state
+@@ -111,17 +118,17 @@ static void disassemble_forward (u16 seg, u16 off, int n)
+ * This was done for an entirely different reason, but makes a
+ * nice way to get the system to help debug codes.
+ */
+- tregs = M;
++ tregs = M;
+ tregs.x86.R_IP = off;
+ tregs.x86.R_CS = seg;
+-
++
+ /* reset the decoding buffers */
+ tregs.x86.enc_str_pos = 0;
+ tregs.x86.enc_pos = 0;
+-
++
+ /* turn on the "disassemble only, no execute" flag */
+ tregs.x86.debug |= DEBUG_DISASSEMBLE_F;
+-
++
+ /* DUMP NEXT n instructions to screen in straight_line fashion */
+ /*
+ * This looks like the regular instruction fetch stream, except
+@@ -130,299 +137,359 @@ static void disassemble_forward (u16 seg, u16 off, int n)
+ * the instruction. XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
+ * Note the use of a copy of the register structure...
+ */
+- for (i=0; i<n; i++) {
+- op1 = (*sys_rdb)(((u32)M.x86.R_CS<<4) + (M.x86.R_IP++));
+- (x86emu_optab[op1])(op1);
++ for (i = 0; i < n; i++) {
++ op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++ (x86emu_optab[op1]) (op1);
+ }
+ /* end major hack mode. */
+ }
+
+-void x86emu_check_ip_access (void)
++void
++x86emu_check_ip_access(void)
+ {
+ /* NULL as of now */
+ }
+
+-void x86emu_check_sp_access (void)
++void
++x86emu_check_sp_access(void)
+ {
+ }
+
+-void x86emu_check_mem_access (u32 dummy)
++void
++x86emu_check_mem_access(u32 dummy)
+ {
+- /* check bounds, etc */
++ /* check bounds, etc */
+ }
+
+-void x86emu_check_data_access (uint dummy1, uint dummy2)
++void
++x86emu_check_data_access(uint dummy1, uint dummy2)
+ {
+- /* check bounds, etc */
++ /* check bounds, etc */
+ }
+
+-void x86emu_inc_decoded_inst_len (int x)
++void
++x86emu_inc_decoded_inst_len(int x)
+ {
+- M.x86.enc_pos += x;
++ M.x86.enc_pos += x;
+ }
+
+-void x86emu_decode_printf (char *x)
++void
++x86emu_decode_printf(const char *x)
+ {
+- sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x);
+- M.x86.enc_str_pos += strlen(x);
++ sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", x);
++ M.x86.enc_str_pos += strlen(x);
+ }
+
+-void x86emu_decode_printf2 (char *x, int y)
++void
++x86emu_decode_printf2(const char *x, int y)
+ {
+- char temp[100];
+- sprintf(temp,x,y);
+- sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",temp);
+- M.x86.enc_str_pos += strlen(temp);
++ char temp[100];
++
++ snprintf(temp, sizeof(temp), x, y);
++ sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", temp);
++ M.x86.enc_str_pos += strlen(temp);
+ }
+
+-void x86emu_end_instr (void)
++void
++x86emu_end_instr(void)
+ {
+- M.x86.enc_str_pos = 0;
+- M.x86.enc_pos = 0;
++ M.x86.enc_str_pos = 0;
++ M.x86.enc_pos = 0;
+ }
+
+-static void print_encoded_bytes (u16 s, u16 o)
++static void
++print_encoded_bytes(u16 s, u16 o)
+ {
+ int i;
+ char buf1[64];
+- for (i=0; i< M.x86.enc_pos; i++) {
+- sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i));
++
++ for (i = 0; i < M.x86.enc_pos; i++) {
++ sprintf(buf1 + 2 * i, "%02x", fetch_data_byte_abs(s, o + i));
+ }
+- printk("%-20s",buf1);
++ printk("%-20s", buf1);
+ }
+
+-static void print_decoded_instruction (void)
++static void
++print_decoded_instruction(void)
+ {
+- printk("%s", M.x86.decoded_buf);
++ printk("%s", M.x86.decoded_buf);
+ }
+
+-void x86emu_print_int_vect (u16 iv)
++void
++x86emu_print_int_vect(u16 iv)
+ {
+- u16 seg,off;
++ u16 seg, off;
+
+- if (iv > 256) return;
+- seg = fetch_data_word_abs(0,iv*4);
+- off = fetch_data_word_abs(0,iv*4+2);
+- printk("%04x:%04x ", seg, off);
++ if (iv > 256)
++ return;
++ seg = fetch_data_word_abs(0, iv * 4);
++ off = fetch_data_word_abs(0, iv * 4 + 2);
++ printk("%04x:%04x ", seg, off);
+ }
+
+-void X86EMU_dump_memory (u16 seg, u16 off, u32 amt)
++void
++X86EMU_dump_memory(u16 seg, u16 off, u32 amt)
+ {
+- u32 start = off & 0xfffffff0;
+- u32 end = (off+16) & 0xfffffff0;
+- u32 i;
+- u32 current;
+-
+- current = start;
+- while (end <= off + amt) {
+- printk("%04x:%04x ", seg, start);
+- for (i=start; i< off; i++)
+- printk(" ");
+- for ( ; i< end; i++)
+- printk("%02x ", fetch_data_byte_abs(seg,i));
+- printk("\n");
+- start = end;
+- end = start + 16;
+- }
++ u32 start = off & 0xfffffff0;
++ u32 end = (off + 16) & 0xfffffff0;
++ u32 i;
++ u32 current;
++
++ current = start;
++ while (end <= off + amt) {
++ printk("%04x:%04x ", seg, start);
++ for (i = start; i < off; i++)
++ printk(" ");
++ for (; i < end; i++)
++ printk("%02x ", fetch_data_byte_abs(seg, i));
++ printk("\n");
++ start = end;
++ end = start + 16;
++ }
+ }
+
+-void x86emu_single_step (void)
++void
++x86emu_single_step(void)
+ {
+ char s[1024];
+ int ps[10];
+ int ntok;
+ int cmd;
+ int done;
+- int segment;
++ int segment;
+ int offset;
+ static int breakpoint;
+ static int noDecode = 1;
+-
++
+ char *p;
+
+- if (DEBUG_BREAK()) {
+- if (M.x86.saved_ip != breakpoint) {
+- return;
+- } else {
+- M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+- M.x86.debug |= DEBUG_TRACE_F;
+- M.x86.debug &= ~DEBUG_BREAK_F;
+- print_decoded_instruction ();
+- X86EMU_trace_regs();
+- }
+- }
+- done=0;
+- offset = M.x86.saved_ip;
++ if (DEBUG_BREAK()) {
++ if (M.x86.saved_ip != breakpoint) {
++ return;
++ }
++ else {
++ M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
++ M.x86.debug |= DEBUG_TRACE_F;
++ M.x86.debug &= ~DEBUG_BREAK_F;
++ print_decoded_instruction();
++ X86EMU_trace_regs();
++ }
++ }
++ done = 0;
++ offset = M.x86.saved_ip;
+ while (!done) {
+ printk("-");
+ p = fgets(s, 1023, stdin);
+ cmd = parse_line(s, ps, &ntok);
+- switch(cmd) {
+- case 'u':
+- disassemble_forward(M.x86.saved_cs,(u16)offset,10);
++ switch (cmd) {
++ case 'u':
++ disassemble_forward(M.x86.saved_cs, (u16) offset, 10);
+ break;
+- case 'd':
+- if (ntok == 2) {
+- segment = M.x86.saved_cs;
+- offset = ps[1];
+- X86EMU_dump_memory(segment,(u16)offset,16);
+- offset += 16;
+- } else if (ntok == 3) {
+- segment = ps[1];
+- offset = ps[2];
+- X86EMU_dump_memory(segment,(u16)offset,16);
+- offset += 16;
+- } else {
+- segment = M.x86.saved_cs;
+- X86EMU_dump_memory(segment,(u16)offset,16);
+- offset += 16;
+- }
++ case 'd':
++ if (ntok == 2) {
++ segment = M.x86.saved_cs;
++ offset = ps[1];
++ X86EMU_dump_memory(segment, (u16) offset, 16);
++ offset += 16;
++ }
++ else if (ntok == 3) {
++ segment = ps[1];
++ offset = ps[2];
++ X86EMU_dump_memory(segment, (u16) offset, 16);
++ offset += 16;
++ }
++ else {
++ segment = M.x86.saved_cs;
++ X86EMU_dump_memory(segment, (u16) offset, 16);
++ offset += 16;
++ }
+ break;
+- case 'c':
+- M.x86.debug ^= DEBUG_TRACECALL_F;
++ case 'c':
++ M.x86.debug ^= DEBUG_TRACECALL_F;
+ break;
+- case 's':
+- M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
++ case 's':
++ M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
+ break;
+- case 'r':
+- X86EMU_trace_regs();
++ case 'r':
++ X86EMU_trace_regs();
+ break;
+- case 'x':
+- X86EMU_trace_xregs();
++ case 'x':
++ X86EMU_trace_xregs();
+ break;
+- case 'g':
++ case 'g':
+ if (ntok == 2) {
+ breakpoint = ps[1];
+- if (noDecode) {
+- M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
+- } else {
+- M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+- }
+- M.x86.debug &= ~DEBUG_TRACE_F;
+- M.x86.debug |= DEBUG_BREAK_F;
+- done = 1;
++ if (noDecode) {
++ M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
++ }
++ else {
++ M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
++ }
++ M.x86.debug &= ~DEBUG_TRACE_F;
++ M.x86.debug |= DEBUG_BREAK_F;
++ done = 1;
+ }
+ break;
+- case 'q':
+- M.x86.debug |= DEBUG_EXIT;
+- return;
+- case 'P':
+- noDecode = (noDecode)?0:1;
+- printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
+- break;
+- case 't':
+- case 0:
++ case 'q':
++ M.x86.debug |= DEBUG_EXIT;
++ return;
++ case 'P':
++ noDecode = (noDecode) ? 0 : 1;
++ printk("Toggled decoding to %s\n", (noDecode) ? "FALSE" : "TRUE");
++ break;
++ case 't':
++ case 0:
+ done = 1;
+ break;
+- }
++ }
+ }
+ }
+
+-int X86EMU_trace_on(void)
++int
++X86EMU_trace_on(void)
+ {
+- return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
++ return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
+ }
+
+-int X86EMU_trace_off(void)
++int
++X86EMU_trace_off(void)
+ {
+- return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
++ return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
+ }
+
+-static int parse_line (char *s, int *ps, int *n)
++static int
++parse_line(char *s, int *ps, int *n)
+ {
+ int cmd;
+
+ *n = 0;
+- while(*s == ' ' || *s == '\t') s++;
++ while (*s == ' ' || *s == '\t')
++ s++;
+ ps[*n] = *s;
+ switch (*s) {
+- case '\n':
++ case '\n':
+ *n += 1;
+ return 0;
+- default:
++ default:
+ cmd = *s;
+ *n += 1;
+ }
+
+- while (1) {
+- while (*s != ' ' && *s != '\t' && *s != '\n') s++;
+-
+- if (*s == '\n')
+- return cmd;
+-
+- while(*s == ' ' || *s == '\t') s++;
+-
+- sscanf(s,"%x",&ps[*n]);
+- *n += 1;
+- }
++ while (1) {
++ while (*s != ' ' && *s != '\t' && *s != '\n')
++ s++;
++
++ if (*s == '\n')
++ return cmd;
++
++ while (*s == ' ' || *s == '\t')
++ s++;
++
++ sscanf(s, "%x", &ps[*n]);
++ *n += 1;
++ }
+ }
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+-void x86emu_dump_regs (void)
++void
++x86emu_dump_regs(void)
+ {
+- printk("\tAX=%04x ", M.x86.R_AX );
+- printk("BX=%04x ", M.x86.R_BX );
+- printk("CX=%04x ", M.x86.R_CX );
+- printk("DX=%04x ", M.x86.R_DX );
+- printk("SP=%04x ", M.x86.R_SP );
+- printk("BP=%04x ", M.x86.R_BP );
+- printk("SI=%04x ", M.x86.R_SI );
+- printk("DI=%04x\n", M.x86.R_DI );
+- printk("\tDS=%04x ", M.x86.R_DS );
+- printk("ES=%04x ", M.x86.R_ES );
+- printk("SS=%04x ", M.x86.R_SS );
+- printk("CS=%04x ", M.x86.R_CS );
+- printk("IP=%04x ", M.x86.R_IP );
+- if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
+- else printk("NV ");
+- if (ACCESS_FLAG(F_DF)) printk("DN ");
+- else printk("UP ");
+- if (ACCESS_FLAG(F_IF)) printk("EI ");
+- else printk("DI ");
+- if (ACCESS_FLAG(F_SF)) printk("NG ");
+- else printk("PL ");
+- if (ACCESS_FLAG(F_ZF)) printk("ZR ");
+- else printk("NZ ");
+- if (ACCESS_FLAG(F_AF)) printk("AC ");
+- else printk("NA ");
+- if (ACCESS_FLAG(F_PF)) printk("PE ");
+- else printk("PO ");
+- if (ACCESS_FLAG(F_CF)) printk("CY ");
+- else printk("NC ");
+- printk("\n");
++ printk("\tAX=%04x ", M.x86.R_AX);
++ printk("BX=%04x ", M.x86.R_BX);
++ printk("CX=%04x ", M.x86.R_CX);
++ printk("DX=%04x ", M.x86.R_DX);
++ printk("SP=%04x ", M.x86.R_SP);
++ printk("BP=%04x ", M.x86.R_BP);
++ printk("SI=%04x ", M.x86.R_SI);
++ printk("DI=%04x\n", M.x86.R_DI);
++ printk("\tDS=%04x ", M.x86.R_DS);
++ printk("ES=%04x ", M.x86.R_ES);
++ printk("SS=%04x ", M.x86.R_SS);
++ printk("CS=%04x ", M.x86.R_CS);
++ printk("IP=%04x ", M.x86.R_IP);
++ if (ACCESS_FLAG(F_OF))
++ printk("OV "); /* CHECKED... */
++ else
++ printk("NV ");
++ if (ACCESS_FLAG(F_DF))
++ printk("DN ");
++ else
++ printk("UP ");
++ if (ACCESS_FLAG(F_IF))
++ printk("EI ");
++ else
++ printk("DI ");
++ if (ACCESS_FLAG(F_SF))
++ printk("NG ");
++ else
++ printk("PL ");
++ if (ACCESS_FLAG(F_ZF))
++ printk("ZR ");
++ else
++ printk("NZ ");
++ if (ACCESS_FLAG(F_AF))
++ printk("AC ");
++ else
++ printk("NA ");
++ if (ACCESS_FLAG(F_PF))
++ printk("PE ");
++ else
++ printk("PO ");
++ if (ACCESS_FLAG(F_CF))
++ printk("CY ");
++ else
++ printk("NC ");
++ printk("\n");
+ }
+
+-void x86emu_dump_xregs (void)
++void
++x86emu_dump_xregs(void)
+ {
+- printk("\tEAX=%08x ", M.x86.R_EAX );
+- printk("EBX=%08x ", M.x86.R_EBX );
+- printk("ECX=%08x ", M.x86.R_ECX );
+- printk("EDX=%08x \n", M.x86.R_EDX );
+- printk("\tESP=%08x ", M.x86.R_ESP );
+- printk("EBP=%08x ", M.x86.R_EBP );
+- printk("ESI=%08x ", M.x86.R_ESI );
+- printk("EDI=%08x\n", M.x86.R_EDI );
+- printk("\tDS=%04x ", M.x86.R_DS );
+- printk("ES=%04x ", M.x86.R_ES );
+- printk("SS=%04x ", M.x86.R_SS );
+- printk("CS=%04x ", M.x86.R_CS );
+- printk("EIP=%08x\n\t", M.x86.R_EIP );
+- if (ACCESS_FLAG(F_OF)) printk("OV "); /* CHECKED... */
+- else printk("NV ");
+- if (ACCESS_FLAG(F_DF)) printk("DN ");
+- else printk("UP ");
+- if (ACCESS_FLAG(F_IF)) printk("EI ");
+- else printk("DI ");
+- if (ACCESS_FLAG(F_SF)) printk("NG ");
+- else printk("PL ");
+- if (ACCESS_FLAG(F_ZF)) printk("ZR ");
+- else printk("NZ ");
+- if (ACCESS_FLAG(F_AF)) printk("AC ");
+- else printk("NA ");
+- if (ACCESS_FLAG(F_PF)) printk("PE ");
+- else printk("PO ");
+- if (ACCESS_FLAG(F_CF)) printk("CY ");
+- else printk("NC ");
+- printk("\n");
++ printk("\tEAX=%08x ", M.x86.R_EAX);
++ printk("EBX=%08x ", M.x86.R_EBX);
++ printk("ECX=%08x ", M.x86.R_ECX);
++ printk("EDX=%08x \n", M.x86.R_EDX);
++ printk("\tESP=%08x ", M.x86.R_ESP);
++ printk("EBP=%08x ", M.x86.R_EBP);
++ printk("ESI=%08x ", M.x86.R_ESI);
++ printk("EDI=%08x\n", M.x86.R_EDI);
++ printk("\tDS=%04x ", M.x86.R_DS);
++ printk("ES=%04x ", M.x86.R_ES);
++ printk("SS=%04x ", M.x86.R_SS);
++ printk("CS=%04x ", M.x86.R_CS);
++ printk("EIP=%08x\n\t", M.x86.R_EIP);
++ if (ACCESS_FLAG(F_OF))
++ printk("OV "); /* CHECKED... */
++ else
++ printk("NV ");
++ if (ACCESS_FLAG(F_DF))
++ printk("DN ");
++ else
++ printk("UP ");
++ if (ACCESS_FLAG(F_IF))
++ printk("EI ");
++ else
++ printk("DI ");
++ if (ACCESS_FLAG(F_SF))
++ printk("NG ");
++ else
++ printk("PL ");
++ if (ACCESS_FLAG(F_ZF))
++ printk("ZR ");
++ else
++ printk("NZ ");
++ if (ACCESS_FLAG(F_AF))
++ printk("AC ");
++ else
++ printk("NA ");
++ if (ACCESS_FLAG(F_PF))
++ printk("PE ");
++ else
++ printk("PO ");
++ if (ACCESS_FLAG(F_CF))
++ printk("CY ");
++ else
++ printk("NC ");
++ printk("\n");
+ }
+diff --git a/libs/x86emu/decode.c b/libs/x86emu/decode.c
+index 7d9a34a..12f8fb8 100644
+--- a/libs/x86emu/decode.c
++++ b/libs/x86emu/decode.c
+@@ -46,25 +46,27 @@
+ REMARKS:
+ Handles any pending asychronous interrupts.
+ ****************************************************************************/
+-static void x86emu_intr_handle(void)
++static void
++x86emu_intr_handle(void)
+ {
+- u8 intno;
+-
+- if (M.x86.intr & INTR_SYNCH) {
+- intno = M.x86.intno;
+- if (_X86EMU_intrTab[intno]) {
+- (*_X86EMU_intrTab[intno])(intno);
+- } else {
+- push_word((u16)M.x86.R_FLG);
+- CLEAR_FLAG(F_IF);
+- CLEAR_FLAG(F_TF);
+- push_word(M.x86.R_CS);
+- M.x86.R_CS = mem_access_word(intno * 4 + 2);
+- push_word(M.x86.R_IP);
+- M.x86.R_IP = mem_access_word(intno * 4);
+- M.x86.intr = 0;
+- }
+- }
++ u8 intno;
++
++ if (M.x86.intr & INTR_SYNCH) {
++ intno = M.x86.intno;
++ if (_X86EMU_intrTab[intno]) {
++ (*_X86EMU_intrTab[intno]) (intno);
++ }
++ else {
++ push_word((u16) M.x86.R_FLG);
++ CLEAR_FLAG(F_IF);
++ CLEAR_FLAG(F_TF);
++ push_word(M.x86.R_CS);
++ M.x86.R_CS = mem_access_word(intno * 4 + 2);
++ push_word(M.x86.R_IP);
++ M.x86.R_IP = mem_access_word(intno * 4);
++ M.x86.intr = 0;
++ }
++ }
+ }
+
+ /****************************************************************************
+@@ -75,11 +77,11 @@ REMARKS:
+ Raise the specified interrupt to be handled before the execution of the
+ next instruction.
+ ****************************************************************************/
+-void x86emu_intr_raise(
+- u8 intrnum)
++void
++x86emu_intr_raise(u8 intrnum)
+ {
+- M.x86.intno = intrnum;
+- M.x86.intr |= INTR_SYNCH;
++ M.x86.intno = intrnum;
++ M.x86.intr |= INTR_SYNCH;
+ }
+
+ /****************************************************************************
+@@ -88,39 +90,39 @@ Main execution loop for the emulator. We return from here when the system
+ halts, which is normally caused by a stack fault when we return from the
+ original real mode call.
+ ****************************************************************************/
+-void X86EMU_exec(void)
++void
++X86EMU_exec(void)
+ {
+- u8 op1;
+-
+- M.x86.intr = 0;
+- DB(x86emu_end_instr();)
+-
+- for (;;) {
+-DB( if (CHECK_IP_FETCH())
+- x86emu_check_ip_access();)
+- /* If debugging, save the IP and CS values. */
+- SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
+- INC_DECODED_INST_LEN(1);
+- if (M.x86.intr) {
+- if (M.x86.intr & INTR_HALTED) {
+-DB( if (M.x86.R_SP != 0) {
+- printk("halted\n");
+- X86EMU_trace_regs();
+- }
+- else {
+- if (M.x86.debug)
+- printk("Service completed successfully\n");
+- })
+- return;
++ u8 op1;
++
++ M.x86.intr = 0;
++ DB(x86emu_end_instr();
++ )
++
++ for (;;) {
++ DB(if (CHECK_IP_FETCH())
++ x86emu_check_ip_access();)
++ /* If debugging, save the IP and CS values. */
++ SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
++ INC_DECODED_INST_LEN(1);
++ if (M.x86.intr) {
++ if (M.x86.intr & INTR_HALTED) {
++ DB(if (M.x86.R_SP != 0) {
++ printk("halted\n"); X86EMU_trace_regs();}
++ else {
++ if (M.x86.debug)
++ printk("Service completed successfully\n");}
++ )
++ return;
+ }
+- if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
+- !ACCESS_FLAG(F_IF)) {
+- x86emu_intr_handle();
+- }
+- }
+-
+- op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+- (*x86emu_optab[op1])(op1);
++ if (((M.x86.intr & INTR_SYNCH) &&
++ (M.x86.intno == 0 || M.x86.intno == 2)) ||
++ !ACCESS_FLAG(F_IF)) {
++ x86emu_intr_handle();
++ }
++ }
++ op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++ (*x86emu_optab[op1]) (op1);
+ if (M.x86.debug & DEBUG_EXIT) {
+ M.x86.debug &= ~DEBUG_EXIT;
+ return;
+@@ -132,9 +134,10 @@ DB( if (M.x86.R_SP != 0) {
+ REMARKS:
+ Halts the system by setting the halted system flag.
+ ****************************************************************************/
+-void X86EMU_halt_sys(void)
++void
++X86EMU_halt_sys(void)
+ {
+- M.x86.intr |= INTR_HALTED;
++ M.x86.intr |= INTR_HALTED;
+ }
+
+ /****************************************************************************
+@@ -149,19 +152,17 @@ next instruction.
+
+ NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+ ****************************************************************************/
+-void fetch_decode_modrm(
+- int *mod,
+- int *regh,
+- int *regl)
++void
++fetch_decode_modrm(int *mod, int *regh, int *regl)
+ {
+- int fetched;
+-
+-DB( if (CHECK_IP_FETCH())
+- x86emu_check_ip_access();)
+- fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+- INC_DECODED_INST_LEN(1);
+- *mod = (fetched >> 6) & 0x03;
+- *regh = (fetched >> 3) & 0x07;
++ int fetched;
++
++ DB(if (CHECK_IP_FETCH())
++ x86emu_check_ip_access();)
++ fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++ INC_DECODED_INST_LEN(1);
++ *mod = (fetched >> 6) & 0x03;
++ *regh = (fetched >> 3) & 0x07;
+ *regl = (fetched >> 0) & 0x07;
+ }
+
+@@ -175,15 +176,16 @@ moves the instruction pointer to the next value.
+
+ NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+ ****************************************************************************/
+-u8 fetch_byte_imm(void)
++u8
++fetch_byte_imm(void)
+ {
+- u8 fetched;
++ u8 fetched;
+
+-DB( if (CHECK_IP_FETCH())
+- x86emu_check_ip_access();)
+- fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+- INC_DECODED_INST_LEN(1);
+- return fetched;
++ DB(if (CHECK_IP_FETCH())
++ x86emu_check_ip_access();)
++ fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++ INC_DECODED_INST_LEN(1);
++ return fetched;
+ }
+
+ /****************************************************************************
+@@ -196,16 +198,17 @@ moves the instruction pointer to the next value.
+
+ NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+ ****************************************************************************/
+-u16 fetch_word_imm(void)
++u16
++fetch_word_imm(void)
+ {
+- u16 fetched;
+-
+-DB( if (CHECK_IP_FETCH())
+- x86emu_check_ip_access();)
+- fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+- M.x86.R_IP += 2;
+- INC_DECODED_INST_LEN(2);
+- return fetched;
++ u16 fetched;
++
++ DB(if (CHECK_IP_FETCH())
++ x86emu_check_ip_access();)
++ fetched = (*sys_rdw) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP));
++ M.x86.R_IP += 2;
++ INC_DECODED_INST_LEN(2);
++ return fetched;
+ }
+
+ /****************************************************************************
+@@ -218,16 +221,17 @@ moves the instruction pointer to the next value.
+
+ NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+ ****************************************************************************/
+-u32 fetch_long_imm(void)
++u32
++fetch_long_imm(void)
+ {
+- u32 fetched;
+-
+-DB( if (CHECK_IP_FETCH())
+- x86emu_check_ip_access();)
+- fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+- M.x86.R_IP += 4;
+- INC_DECODED_INST_LEN(4);
+- return fetched;
++ u32 fetched;
++
++ DB(if (CHECK_IP_FETCH())
++ x86emu_check_ip_access();)
++ fetched = (*sys_rdl) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP));
++ M.x86.R_IP += 4;
++ INC_DECODED_INST_LEN(4);
++ return fetched;
+ }
+
+ /****************************************************************************
+@@ -259,38 +263,39 @@ cpu-state-varible M.x86.mode. There are several potential states:
+
+ Each of the above 7 items are handled with a bit in the mode field.
+ ****************************************************************************/
+-_INLINE u32 get_data_segment(void)
++_INLINE u32
++get_data_segment(void)
+ {
+ #define GET_SEGMENT(segment)
+- switch (M.x86.mode & SYSMODE_SEGMASK) {
+- case 0: /* default case: use ds register */
+- case SYSMODE_SEGOVR_DS:
+- case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
+- return M.x86.R_DS;
+- case SYSMODE_SEG_DS_SS: /* non-overridden, use ss register */
+- return M.x86.R_SS;
+- case SYSMODE_SEGOVR_CS:
+- case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
+- return M.x86.R_CS;
+- case SYSMODE_SEGOVR_ES:
+- case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
+- return M.x86.R_ES;
+- case SYSMODE_SEGOVR_FS:
+- case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
+- return M.x86.R_FS;
+- case SYSMODE_SEGOVR_GS:
+- case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
+- return M.x86.R_GS;
+- case SYSMODE_SEGOVR_SS:
+- case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
+- return M.x86.R_SS;
+- default:
++ switch (M.x86.mode & SYSMODE_SEGMASK) {
++ case 0: /* default case: use ds register */
++ case SYSMODE_SEGOVR_DS:
++ case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
++ return M.x86.R_DS;
++ case SYSMODE_SEG_DS_SS: /* non-overridden, use ss register */
++ return M.x86.R_SS;
++ case SYSMODE_SEGOVR_CS:
++ case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
++ return M.x86.R_CS;
++ case SYSMODE_SEGOVR_ES:
++ case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
++ return M.x86.R_ES;
++ case SYSMODE_SEGOVR_FS:
++ case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
++ return M.x86.R_FS;
++ case SYSMODE_SEGOVR_GS:
++ case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
++ return M.x86.R_GS;
++ case SYSMODE_SEGOVR_SS:
++ case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
++ return M.x86.R_SS;
++ default:
+ #ifdef DEBUG
+- printk("error: should not happen: multiple overrides.\n");
++ printk("error: should not happen: multiple overrides.\n");
+ #endif
+- HALT_SYS();
+- return 0;
+- }
++ HALT_SYS();
++ return 0;
++ }
+ }
+
+ /****************************************************************************
+@@ -302,14 +307,14 @@ Byte value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u8 fetch_data_byte(
+- uint offset)
++u8
++fetch_data_byte(uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- return (*sys_rdb)((get_data_segment() << 4) + offset);
++ return (*sys_rdb) ((get_data_segment() << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -321,14 +326,14 @@ Word value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 fetch_data_word(
+- uint offset)
++u16
++fetch_data_word(uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- return (*sys_rdw)((get_data_segment() << 4) + offset);
++ return (*sys_rdw) ((get_data_segment() << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -340,14 +345,14 @@ Long value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 fetch_data_long(
+- uint offset)
++u32
++fetch_data_long(uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- return (*sys_rdl)((get_data_segment() << 4) + offset);
++ return (*sys_rdl) ((get_data_segment() << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -360,15 +365,14 @@ Byte value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u8 fetch_data_byte_abs(
+- uint segment,
+- uint offset)
++u8
++fetch_data_byte_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- return (*sys_rdb)(((u32)segment << 4) + offset);
++ return (*sys_rdb) (((u32) segment << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -381,15 +385,14 @@ Word value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 fetch_data_word_abs(
+- uint segment,
+- uint offset)
++u16
++fetch_data_word_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- return (*sys_rdw)(((u32)segment << 4) + offset);
++ return (*sys_rdw) (((u32) segment << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -402,15 +405,14 @@ Long value read from the absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 fetch_data_long_abs(
+- uint segment,
+- uint offset)
++u32
++fetch_data_long_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- return (*sys_rdl)(((u32)segment << 4) + offset);
++ return (*sys_rdl) (((u32) segment << 4) + offset);
+ }
+
+ /****************************************************************************
+@@ -424,15 +426,14 @@ the current 'default' segment, which may have been overridden.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_byte(
+- uint offset,
+- u8 val)
++void
++store_data_byte(uint offset, u8 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- (*sys_wrb)((get_data_segment() << 4) + offset, val);
++ (*sys_wrb) ((get_data_segment() << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -446,15 +447,14 @@ the current 'default' segment, which may have been overridden.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_word(
+- uint offset,
+- u16 val)
++void
++store_data_word(uint offset, u16 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- (*sys_wrw)((get_data_segment() << 4) + offset, val);
++ (*sys_wrw) ((get_data_segment() << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -468,15 +468,14 @@ the current 'default' segment, which may have been overridden.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_long(
+- uint offset,
+- u32 val)
++void
++store_data_long(uint offset, u32 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access((u16)get_data_segment(), offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+- (*sys_wrl)((get_data_segment() << 4) + offset, val);
++ (*sys_wrl) ((get_data_segment() << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -490,16 +489,14 @@ Writes a byte value to an absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_byte_abs(
+- uint segment,
+- uint offset,
+- u8 val)
++void
++store_data_byte_abs(uint segment, uint offset, u8 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- (*sys_wrb)(((u32)segment << 4) + offset, val);
++ (*sys_wrb) (((u32) segment << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -513,16 +510,14 @@ Writes a word value to an absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_word_abs(
+- uint segment,
+- uint offset,
+- u16 val)
++void
++store_data_word_abs(uint segment, uint offset, u16 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- (*sys_wrw)(((u32)segment << 4) + offset, val);
++ (*sys_wrw) (((u32) segment << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -536,16 +531,14 @@ Writes a long value to an absolute memory location.
+
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_long_abs(
+- uint segment,
+- uint offset,
+- u32 val)
++void
++store_data_long_abs(uint segment, uint offset, u32 val)
+ {
+ #ifdef DEBUG
+- if (CHECK_DATA_ACCESS())
+- x86emu_check_data_access(segment, offset);
++ if (CHECK_DATA_ACCESS())
++ x86emu_check_data_access(segment, offset);
+ #endif
+- (*sys_wrl)(((u32)segment << 4) + offset, val);
++ (*sys_wrl) (((u32) segment << 4) + offset, val);
+ }
+
+ /****************************************************************************
+@@ -559,37 +552,37 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for byte operands. Also enables the decoding of instructions.
+ ****************************************************************************/
+-u8* decode_rm_byte_register(
+- int reg)
++u8 *
++decode_rm_byte_register(int reg)
+ {
+- switch (reg) {
+- case 0:
+- DECODE_PRINTF("AL");
+- return &M.x86.R_AL;
+- case 1:
+- DECODE_PRINTF("CL");
+- return &M.x86.R_CL;
+- case 2:
+- DECODE_PRINTF("DL");
+- return &M.x86.R_DL;
+- case 3:
+- DECODE_PRINTF("BL");
+- return &M.x86.R_BL;
+- case 4:
+- DECODE_PRINTF("AH");
+- return &M.x86.R_AH;
+- case 5:
+- DECODE_PRINTF("CH");
+- return &M.x86.R_CH;
+- case 6:
+- DECODE_PRINTF("DH");
+- return &M.x86.R_DH;
+- case 7:
+- DECODE_PRINTF("BH");
+- return &M.x86.R_BH;
+- }
+- HALT_SYS();
+- return NULL; /* NOT REACHED OR REACHED ON ERROR */
++ switch (reg) {
++ case 0:
++ DECODE_PRINTF("AL");
++ return &M.x86.R_AL;
++ case 1:
++ DECODE_PRINTF("CL");
++ return &M.x86.R_CL;
++ case 2:
++ DECODE_PRINTF("DL");
++ return &M.x86.R_DL;
++ case 3:
++ DECODE_PRINTF("BL");
++ return &M.x86.R_BL;
++ case 4:
++ DECODE_PRINTF("AH");
++ return &M.x86.R_AH;
++ case 5:
++ DECODE_PRINTF("CH");
++ return &M.x86.R_CH;
++ case 6:
++ DECODE_PRINTF("DH");
++ return &M.x86.R_DH;
++ case 7:
++ DECODE_PRINTF("BH");
++ return &M.x86.R_BH;
++ }
++ HALT_SYS();
++ return NULL; /* NOT REACHED OR REACHED ON ERROR */
+ }
+
+ /****************************************************************************
+@@ -603,36 +596,36 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for word operands. Also enables the decoding of instructions.
+ ****************************************************************************/
+-u16* decode_rm_word_register(
+- int reg)
++u16 *
++decode_rm_word_register(int reg)
+ {
+- switch (reg) {
+- case 0:
+- DECODE_PRINTF("AX");
+- return &M.x86.R_AX;
+- case 1:
+- DECODE_PRINTF("CX");
+- return &M.x86.R_CX;
+- case 2:
+- DECODE_PRINTF("DX");
+- return &M.x86.R_DX;
+- case 3:
+- DECODE_PRINTF("BX");
+- return &M.x86.R_BX;
+- case 4:
+- DECODE_PRINTF("SP");
+- return &M.x86.R_SP;
+- case 5:
+- DECODE_PRINTF("BP");
+- return &M.x86.R_BP;
+- case 6:
+- DECODE_PRINTF("SI");
+- return &M.x86.R_SI;
+- case 7:
+- DECODE_PRINTF("DI");
+- return &M.x86.R_DI;
+- }
+- HALT_SYS();
++ switch (reg) {
++ case 0:
++ DECODE_PRINTF("AX");
++ return &M.x86.R_AX;
++ case 1:
++ DECODE_PRINTF("CX");
++ return &M.x86.R_CX;
++ case 2:
++ DECODE_PRINTF("DX");
++ return &M.x86.R_DX;
++ case 3:
++ DECODE_PRINTF("BX");
++ return &M.x86.R_BX;
++ case 4:
++ DECODE_PRINTF("SP");
++ return &M.x86.R_SP;
++ case 5:
++ DECODE_PRINTF("BP");
++ return &M.x86.R_BP;
++ case 6:
++ DECODE_PRINTF("SI");
++ return &M.x86.R_SI;
++ case 7:
++ DECODE_PRINTF("DI");
++ return &M.x86.R_DI;
++ }
++ HALT_SYS();
+ return NULL; /* NOTREACHED OR REACHED ON ERROR */
+ }
+
+@@ -647,36 +640,36 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for dword operands. Also enables the decoding of instructions.
+ ****************************************************************************/
+-u32* decode_rm_long_register(
+- int reg)
++u32 *
++decode_rm_long_register(int reg)
+ {
+ switch (reg) {
+- case 0:
+- DECODE_PRINTF("EAX");
+- return &M.x86.R_EAX;
+- case 1:
+- DECODE_PRINTF("ECX");
+- return &M.x86.R_ECX;
+- case 2:
+- DECODE_PRINTF("EDX");
+- return &M.x86.R_EDX;
+- case 3:
+- DECODE_PRINTF("EBX");
+- return &M.x86.R_EBX;
+- case 4:
+- DECODE_PRINTF("ESP");
+- return &M.x86.R_ESP;
+- case 5:
+- DECODE_PRINTF("EBP");
+- return &M.x86.R_EBP;
+- case 6:
+- DECODE_PRINTF("ESI");
+- return &M.x86.R_ESI;
+- case 7:
+- DECODE_PRINTF("EDI");
+- return &M.x86.R_EDI;
+- }
+- HALT_SYS();
++ case 0:
++ DECODE_PRINTF("EAX");
++ return &M.x86.R_EAX;
++ case 1:
++ DECODE_PRINTF("ECX");
++ return &M.x86.R_ECX;
++ case 2:
++ DECODE_PRINTF("EDX");
++ return &M.x86.R_EDX;
++ case 3:
++ DECODE_PRINTF("EBX");
++ return &M.x86.R_EBX;
++ case 4:
++ DECODE_PRINTF("ESP");
++ return &M.x86.R_ESP;
++ case 5:
++ DECODE_PRINTF("EBP");
++ return &M.x86.R_EBP;
++ case 6:
++ DECODE_PRINTF("ESI");
++ return &M.x86.R_ESI;
++ case 7:
++ DECODE_PRINTF("EDI");
++ return &M.x86.R_EDI;
++ }
++ HALT_SYS();
+ return NULL; /* NOTREACHED OR REACHED ON ERROR */
+ }
+
+@@ -692,126 +685,129 @@ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for word operands, modified from above for the weirdo
+ special case of segreg operands. Also enables the decoding of instructions.
+ ****************************************************************************/
+-u16* decode_rm_seg_register(
+- int reg)
++u16 *
++decode_rm_seg_register(int reg)
+ {
+- switch (reg) {
+- case 0:
+- DECODE_PRINTF("ES");
+- return &M.x86.R_ES;
+- case 1:
+- DECODE_PRINTF("CS");
+- return &M.x86.R_CS;
+- case 2:
+- DECODE_PRINTF("SS");
+- return &M.x86.R_SS;
+- case 3:
+- DECODE_PRINTF("DS");
+- return &M.x86.R_DS;
+- case 4:
+- DECODE_PRINTF("FS");
+- return &M.x86.R_FS;
+- case 5:
+- DECODE_PRINTF("GS");
+- return &M.x86.R_GS;
+- case 6:
+- case 7:
+- DECODE_PRINTF("ILLEGAL SEGREG");
+- break;
+- }
+- HALT_SYS();
+- return NULL; /* NOT REACHED OR REACHED ON ERROR */
++ switch (reg) {
++ case 0:
++ DECODE_PRINTF("ES");
++ return &M.x86.R_ES;
++ case 1:
++ DECODE_PRINTF("CS");
++ return &M.x86.R_CS;
++ case 2:
++ DECODE_PRINTF("SS");
++ return &M.x86.R_SS;
++ case 3:
++ DECODE_PRINTF("DS");
++ return &M.x86.R_DS;
++ case 4:
++ DECODE_PRINTF("FS");
++ return &M.x86.R_FS;
++ case 5:
++ DECODE_PRINTF("GS");
++ return &M.x86.R_GS;
++ case 6:
++ case 7:
++ DECODE_PRINTF("ILLEGAL SEGREG");
++ break;
++ }
++ HALT_SYS();
++ return NULL; /* NOT REACHED OR REACHED ON ERROR */
+ }
+
+ /*
+ *
+ * return offset from the SIB Byte
+ */
+-u32 decode_sib_address(int sib, int mod)
++u32
++decode_sib_address(int sib, int mod)
+ {
+ u32 base = 0, i = 0, scale = 1;
+
+- switch(sib & 0x07) {
++ switch (sib & 0x07) {
+ case 0:
+- DECODE_PRINTF("[EAX]");
+- base = M.x86.R_EAX;
+- break;
++ DECODE_PRINTF("[EAX]");
++ base = M.x86.R_EAX;
++ break;
+ case 1:
+- DECODE_PRINTF("[ECX]");
+- base = M.x86.R_ECX;
+- break;
++ DECODE_PRINTF("[ECX]");
++ base = M.x86.R_ECX;
++ break;
+ case 2:
+- DECODE_PRINTF("[EDX]");
+- base = M.x86.R_EDX;
+- break;
++ DECODE_PRINTF("[EDX]");
++ base = M.x86.R_EDX;
++ break;
+ case 3:
+- DECODE_PRINTF("[EBX]");
+- base = M.x86.R_EBX;
+- break;
++ DECODE_PRINTF("[EBX]");
++ base = M.x86.R_EBX;
++ break;
+ case 4:
+- DECODE_PRINTF("[ESP]");
+- base = M.x86.R_ESP;
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
+- break;
++ DECODE_PRINTF("[ESP]");
++ base = M.x86.R_ESP;
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
++ break;
+ case 5:
+- if (mod == 0) {
+- base = fetch_long_imm();
+- DECODE_PRINTF2("%08x", base);
+- } else {
+- DECODE_PRINTF("[EBP]");
+- base = M.x86.R_ESP;
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
+- }
+- break;
++ if (mod == 0) {
++ base = fetch_long_imm();
++ DECODE_PRINTF2("%08x", base);
++ }
++ else {
++ DECODE_PRINTF("[EBP]");
++ base = M.x86.R_ESP;
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
++ }
++ break;
+ case 6:
+- DECODE_PRINTF("[ESI]");
+- base = M.x86.R_ESI;
+- break;
++ DECODE_PRINTF("[ESI]");
++ base = M.x86.R_ESI;
++ break;
+ case 7:
+- DECODE_PRINTF("[EDI]");
+- base = M.x86.R_EDI;
+- break;
++ DECODE_PRINTF("[EDI]");
++ base = M.x86.R_EDI;
++ break;
+ }
+ switch ((sib >> 3) & 0x07) {
+ case 0:
+- DECODE_PRINTF("[EAX");
+- i = M.x86.R_EAX;
+- break;
++ DECODE_PRINTF("[EAX");
++ i = M.x86.R_EAX;
++ break;
+ case 1:
+- DECODE_PRINTF("[ECX");
+- i = M.x86.R_ECX;
+- break;
++ DECODE_PRINTF("[ECX");
++ i = M.x86.R_ECX;
++ break;
+ case 2:
+- DECODE_PRINTF("[EDX");
+- i = M.x86.R_EDX;
+- break;
++ DECODE_PRINTF("[EDX");
++ i = M.x86.R_EDX;
++ break;
+ case 3:
+- DECODE_PRINTF("[EBX");
+- i = M.x86.R_EBX;
+- break;
++ DECODE_PRINTF("[EBX");
++ i = M.x86.R_EBX;
++ break;
+ case 4:
+- i = 0;
+- break;
++ i = 0;
++ break;
+ case 5:
+- DECODE_PRINTF("[EBP");
+- i = M.x86.R_EBP;
+- break;
++ DECODE_PRINTF("[EBP");
++ i = M.x86.R_EBP;
++ break;
+ case 6:
+- DECODE_PRINTF("[ESI");
+- i = M.x86.R_ESI;
+- break;
++ DECODE_PRINTF("[ESI");
++ i = M.x86.R_ESI;
++ break;
+ case 7:
+- DECODE_PRINTF("[EDI");
+- i = M.x86.R_EDI;
+- break;
++ DECODE_PRINTF("[EDI");
++ i = M.x86.R_EDI;
++ break;
+ }
+ scale = 1 << ((sib >> 6) & 0x03);
+ if (((sib >> 3) & 0x07) != 4) {
+- if (scale == 1) {
+- DECODE_PRINTF("]");
+- } else {
+- DECODE_PRINTF2("*%d]", scale);
+- }
++ if (scale == 1) {
++ DECODE_PRINTF("]");
++ }
++ else {
++ DECODE_PRINTF2("*%d]", scale);
++ }
+ }
+ return base + (i * scale);
+ }
+@@ -836,74 +832,75 @@ NOTE: The code which specifies the corresponding segment (ds vs ss)
+ if a SS access is needed, set this bit. Otherwise, DS access
+ occurs (unless any of the segment override bits are set).
+ ****************************************************************************/
+-u32 decode_rm00_address(
+- int rm)
++u32
++decode_rm00_address(int rm)
+ {
+ u32 offset;
+ int sib;
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
+- switch (rm) {
+- case 0:
+- DECODE_PRINTF("[EAX]");
+- return M.x86.R_EAX;
+- case 1:
+- DECODE_PRINTF("[ECX]");
+- return M.x86.R_ECX;
+- case 2:
+- DECODE_PRINTF("[EDX]");
+- return M.x86.R_EDX;
+- case 3:
+- DECODE_PRINTF("[EBX]");
+- return M.x86.R_EBX;
+- case 4:
+- sib = fetch_byte_imm();
+- return decode_sib_address(sib, 0);
+- case 5:
+- offset = fetch_long_imm();
+- DECODE_PRINTF2("[%08x]", offset);
+- return offset;
+- case 6:
+- DECODE_PRINTF("[ESI]");
+- return M.x86.R_ESI;
+- case 7:
+- DECODE_PRINTF("[EDI]");
+- return M.x86.R_EDI;
+- }
+- HALT_SYS();
+- } else {
++ switch (rm) {
++ case 0:
++ DECODE_PRINTF("[EAX]");
++ return M.x86.R_EAX;
++ case 1:
++ DECODE_PRINTF("[ECX]");
++ return M.x86.R_ECX;
++ case 2:
++ DECODE_PRINTF("[EDX]");
++ return M.x86.R_EDX;
++ case 3:
++ DECODE_PRINTF("[EBX]");
++ return M.x86.R_EBX;
++ case 4:
++ sib = fetch_byte_imm();
++ return decode_sib_address(sib, 0);
++ case 5:
++ offset = fetch_long_imm();
++ DECODE_PRINTF2("[%08x]", offset);
++ return offset;
++ case 6:
++ DECODE_PRINTF("[ESI]");
++ return M.x86.R_ESI;
++ case 7:
++ DECODE_PRINTF("[EDI]");
++ return M.x86.R_EDI;
++ }
++ HALT_SYS();
++ }
++ else {
+ /* 16-bit addressing */
+- switch (rm) {
+- case 0:
+- DECODE_PRINTF("[BX+SI]");
++ switch (rm) {
++ case 0:
++ DECODE_PRINTF("[BX+SI]");
+ return (M.x86.R_BX + M.x86.R_SI) & 0xffff;
+- case 1:
+- DECODE_PRINTF("[BX+DI]");
++ case 1:
++ DECODE_PRINTF("[BX+DI]");
+ return (M.x86.R_BX + M.x86.R_DI) & 0xffff;
+- case 2:
+- DECODE_PRINTF("[BP+SI]");
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 2:
++ DECODE_PRINTF("[BP+SI]");
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_SI) & 0xffff;
+- case 3:
+- DECODE_PRINTF("[BP+DI]");
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 3:
++ DECODE_PRINTF("[BP+DI]");
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_DI) & 0xffff;
+- case 4:
+- DECODE_PRINTF("[SI]");
+- return M.x86.R_SI;
+- case 5:
+- DECODE_PRINTF("[DI]");
+- return M.x86.R_DI;
+- case 6:
+- offset = fetch_word_imm();
+- DECODE_PRINTF2("[%04x]", offset);
+- return offset;
+- case 7:
+- DECODE_PRINTF("[BX]");
+- return M.x86.R_BX;
+- }
+- HALT_SYS();
++ case 4:
++ DECODE_PRINTF("[SI]");
++ return M.x86.R_SI;
++ case 5:
++ DECODE_PRINTF("[DI]");
++ return M.x86.R_DI;
++ case 6:
++ offset = fetch_word_imm();
++ DECODE_PRINTF2("[%04x]", offset);
++ return offset;
++ case 7:
++ DECODE_PRINTF("[BX]");
++ return M.x86.R_BX;
++ }
++ HALT_SYS();
+ }
+ return 0;
+ }
+@@ -919,79 +916,80 @@ REMARKS:
+ Return the offset given by mod=01 addressing. Also enables the
+ decoding of instructions.
+ ****************************************************************************/
+-u32 decode_rm01_address(
+- int rm)
++u32
++decode_rm01_address(int rm)
+ {
+ int displacement = 0;
+ int sib;
+
+ /* Fetch disp8 if no SIB byte */
+ if (!((M.x86.mode & SYSMODE_PREFIX_ADDR) && (rm == 4)))
+- displacement = (s8)fetch_byte_imm();
++ displacement = (s8) fetch_byte_imm();
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
+- switch (rm) {
+- case 0:
+- DECODE_PRINTF2("%d[EAX]", displacement);
+- return M.x86.R_EAX + displacement;
+- case 1:
+- DECODE_PRINTF2("%d[ECX]", displacement);
+- return M.x86.R_ECX + displacement;
+- case 2:
+- DECODE_PRINTF2("%d[EDX]", displacement);
+- return M.x86.R_EDX + displacement;
+- case 3:
+- DECODE_PRINTF2("%d[EBX]", displacement);
+- return M.x86.R_EBX + displacement;
+- case 4:
+- sib = fetch_byte_imm();
+- displacement = (s8)fetch_byte_imm();
+- DECODE_PRINTF2("%d", displacement);
+- return decode_sib_address(sib, 1) + displacement;
+- case 5:
+- DECODE_PRINTF2("%d[EBP]", displacement);
+- return M.x86.R_EBP + displacement;
+- case 6:
+- DECODE_PRINTF2("%d[ESI]", displacement);
+- return M.x86.R_ESI + displacement;
+- case 7:
+- DECODE_PRINTF2("%d[EDI]", displacement);
+- return M.x86.R_EDI + displacement;
+- }
+- HALT_SYS();
+- } else {
++ switch (rm) {
++ case 0:
++ DECODE_PRINTF2("%d[EAX]", displacement);
++ return M.x86.R_EAX + displacement;
++ case 1:
++ DECODE_PRINTF2("%d[ECX]", displacement);
++ return M.x86.R_ECX + displacement;
++ case 2:
++ DECODE_PRINTF2("%d[EDX]", displacement);
++ return M.x86.R_EDX + displacement;
++ case 3:
++ DECODE_PRINTF2("%d[EBX]", displacement);
++ return M.x86.R_EBX + displacement;
++ case 4:
++ sib = fetch_byte_imm();
++ displacement = (s8) fetch_byte_imm();
++ DECODE_PRINTF2("%d", displacement);
++ return decode_sib_address(sib, 1) + displacement;
++ case 5:
++ DECODE_PRINTF2("%d[EBP]", displacement);
++ return M.x86.R_EBP + displacement;
++ case 6:
++ DECODE_PRINTF2("%d[ESI]", displacement);
++ return M.x86.R_ESI + displacement;
++ case 7:
++ DECODE_PRINTF2("%d[EDI]", displacement);
++ return M.x86.R_EDI + displacement;
++ }
++ HALT_SYS();
++ }
++ else {
+ /* 16-bit addressing */
+- switch (rm) {
+- case 0:
+- DECODE_PRINTF2("%d[BX+SI]", displacement);
++ switch (rm) {
++ case 0:
++ DECODE_PRINTF2("%d[BX+SI]", displacement);
+ return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+- case 1:
+- DECODE_PRINTF2("%d[BX+DI]", displacement);
++ case 1:
++ DECODE_PRINTF2("%d[BX+DI]", displacement);
+ return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+- case 2:
+- DECODE_PRINTF2("%d[BP+SI]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 2:
++ DECODE_PRINTF2("%d[BP+SI]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+- case 3:
+- DECODE_PRINTF2("%d[BP+DI]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 3:
++ DECODE_PRINTF2("%d[BP+DI]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+- case 4:
+- DECODE_PRINTF2("%d[SI]", displacement);
++ case 4:
++ DECODE_PRINTF2("%d[SI]", displacement);
+ return (M.x86.R_SI + displacement) & 0xffff;
+- case 5:
+- DECODE_PRINTF2("%d[DI]", displacement);
++ case 5:
++ DECODE_PRINTF2("%d[DI]", displacement);
+ return (M.x86.R_DI + displacement) & 0xffff;
+- case 6:
+- DECODE_PRINTF2("%d[BP]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 6:
++ DECODE_PRINTF2("%d[BP]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + displacement) & 0xffff;
+- case 7:
+- DECODE_PRINTF2("%d[BX]", displacement);
++ case 7:
++ DECODE_PRINTF2("%d[BX]", displacement);
+ return (M.x86.R_BX + displacement) & 0xffff;
+- }
+- HALT_SYS();
++ }
++ HALT_SYS();
+ }
+ return 0; /* SHOULD NOT HAPPEN */
+ }
+@@ -1007,86 +1005,87 @@ REMARKS:
+ Return the offset given by mod=10 addressing. Also enables the
+ decoding of instructions.
+ ****************************************************************************/
+-u32 decode_rm10_address(
+- int rm)
++u32
++decode_rm10_address(int rm)
+ {
+ u32 displacement = 0;
+ int sib;
+
+ /* Fetch disp16 if 16-bit addr mode */
+ if (!(M.x86.mode & SYSMODE_PREFIX_ADDR))
+- displacement = (u16)fetch_word_imm();
++ displacement = (u16) fetch_word_imm();
+ else {
+- /* Fetch disp32 if no SIB byte */
+- if (rm != 4)
+- displacement = (u32)fetch_long_imm();
++ /* Fetch disp32 if no SIB byte */
++ if (rm != 4)
++ displacement = (u32) fetch_long_imm();
+ }
+
+ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+ /* 32-bit addressing */
+- switch (rm) {
+- case 0:
+- DECODE_PRINTF2("%08x[EAX]", displacement);
+- return M.x86.R_EAX + displacement;
+- case 1:
+- DECODE_PRINTF2("%08x[ECX]", displacement);
+- return M.x86.R_ECX + displacement;
+- case 2:
+- DECODE_PRINTF2("%08x[EDX]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
+- return M.x86.R_EDX + displacement;
+- case 3:
+- DECODE_PRINTF2("%08x[EBX]", displacement);
+- return M.x86.R_EBX + displacement;
+- case 4:
+- sib = fetch_byte_imm();
+- displacement = (u32)fetch_long_imm();
+- DECODE_PRINTF2("%08x", displacement);
+- return decode_sib_address(sib, 2) + displacement;
+- break;
+- case 5:
+- DECODE_PRINTF2("%08x[EBP]", displacement);
+- return M.x86.R_EBP + displacement;
+- case 6:
+- DECODE_PRINTF2("%08x[ESI]", displacement);
+- return M.x86.R_ESI + displacement;
+- case 7:
+- DECODE_PRINTF2("%08x[EDI]", displacement);
+- return M.x86.R_EDI + displacement;
+- }
+- HALT_SYS();
+- } else {
++ switch (rm) {
++ case 0:
++ DECODE_PRINTF2("%08x[EAX]", displacement);
++ return M.x86.R_EAX + displacement;
++ case 1:
++ DECODE_PRINTF2("%08x[ECX]", displacement);
++ return M.x86.R_ECX + displacement;
++ case 2:
++ DECODE_PRINTF2("%08x[EDX]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
++ return M.x86.R_EDX + displacement;
++ case 3:
++ DECODE_PRINTF2("%08x[EBX]", displacement);
++ return M.x86.R_EBX + displacement;
++ case 4:
++ sib = fetch_byte_imm();
++ displacement = (u32) fetch_long_imm();
++ DECODE_PRINTF2("%08x", displacement);
++ return decode_sib_address(sib, 2) + displacement;
++ break;
++ case 5:
++ DECODE_PRINTF2("%08x[EBP]", displacement);
++ return M.x86.R_EBP + displacement;
++ case 6:
++ DECODE_PRINTF2("%08x[ESI]", displacement);
++ return M.x86.R_ESI + displacement;
++ case 7:
++ DECODE_PRINTF2("%08x[EDI]", displacement);
++ return M.x86.R_EDI + displacement;
++ }
++ HALT_SYS();
++ }
++ else {
+ /* 16-bit addressing */
+- switch (rm) {
+- case 0:
++ switch (rm) {
++ case 0:
+ DECODE_PRINTF2("%04x[BX+SI]", displacement);
+ return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+- case 1:
++ case 1:
+ DECODE_PRINTF2("%04x[BX+DI]", displacement);
+ return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+- case 2:
+- DECODE_PRINTF2("%04x[BP+SI]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 2:
++ DECODE_PRINTF2("%04x[BP+SI]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+- case 3:
+- DECODE_PRINTF2("%04x[BP+DI]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 3:
++ DECODE_PRINTF2("%04x[BP+DI]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+- case 4:
++ case 4:
+ DECODE_PRINTF2("%04x[SI]", displacement);
+ return (M.x86.R_SI + displacement) & 0xffff;
+- case 5:
++ case 5:
+ DECODE_PRINTF2("%04x[DI]", displacement);
+ return (M.x86.R_DI + displacement) & 0xffff;
+- case 6:
+- DECODE_PRINTF2("%04x[BP]", displacement);
+- M.x86.mode |= SYSMODE_SEG_DS_SS;
++ case 6:
++ DECODE_PRINTF2("%04x[BP]", displacement);
++ M.x86.mode |= SYSMODE_SEG_DS_SS;
+ return (M.x86.R_BP + displacement) & 0xffff;
+- case 7:
++ case 7:
+ DECODE_PRINTF2("%04x[BX]", displacement);
+ return (M.x86.R_BX + displacement) & 0xffff;
+- }
+- HALT_SYS();
++ }
++ HALT_SYS();
+ }
+ return 0;
+ /*NOTREACHED */
+diff --git a/libs/x86emu/fpu.c b/libs/x86emu/fpu.c
+index b72de1e..0dab05c 100644
+--- a/libs/x86emu/fpu.c
++++ b/libs/x86emu/fpu.c
+@@ -42,7 +42,8 @@
+ /*----------------------------- Implementation ----------------------------*/
+
+ /* opcode=0xd8 */
+-void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("ESC D8\n");
+@@ -52,7 +53,7 @@ void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
+
+ #ifdef DEBUG
+
+-static char *x86emu_fpu_op_d9_tab[] = {
++static const char *x86emu_fpu_op_d9_tab[] = {
+ "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
+ "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+
+@@ -63,7 +64,7 @@ static char *x86emu_fpu_op_d9_tab[] = {
+ "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+ };
+
+-static char *x86emu_fpu_op_d9_tab1[] = {
++static const char *x86emu_fpu_op_d9_tab1[] = {
+ "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+ "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+
+@@ -89,10 +90,11 @@ static char *x86emu_fpu_op_d9_tab1[] = {
+ "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xd9 */
+-void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -103,56 +105,58 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+ #ifdef DEBUG
+ if (mod != 3) {
+ DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
+- } else {
++ }
++ else {
+ DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
+ }
+ #endif
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
+- if (rh < 4) {
+- DECODE_PRINTF2("ST(%d)\n", stkelem);
+- } else {
+- DECODE_PRINTF("\n");
+- }
++ case 3: /* register to register */
++ stkelem = (u8) rl;
++ if (rh < 4) {
++ DECODE_PRINTF2("ST(%d)\n", stkelem);
++ }
++ else {
++ DECODE_PRINTF("\n");
++ }
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
+ break;
+- case 2:
++ case 2:
+ switch (rl) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_nop();
+ break;
+- default:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+- case 3:
++ case 3:
+ x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
+ break;
+- case 4:
++ case 4:
+ switch (rl) {
+ case 0:
+ x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
+@@ -173,133 +177,133 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+ }
+ break;
+
+- case 5:
++ case 5:
+ switch (rl) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP);
+ break;
+- default:
++ default:
+ /* 7 */
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+
+- case 6:
++ case 6:
+ switch (rl) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_illegal();
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_R_decstp();
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_R_incstp();
+ break;
+ }
+ break;
+
+- case 7:
++ case 7:
+ switch (rl) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_illegal();
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP);
+ break;
+- case 6:
+- case 7:
+- default:
++ case 6:
++ case 7:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_illegal();
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
+-#endif /* X86EMU_FPU_PRESENT */
++ (void) destoffset;
++ (void) stkelem;
++#endif /* X86EMU_FPU_PRESENT */
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+ }
+
+ #ifdef DEBUG
+
+-char *x86emu_fpu_op_da_tab[] = {
++static const char *x86emu_fpu_op_da_tab[] = {
+ "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+@@ -309,7 +313,7 @@ char *x86emu_fpu_op_da_tab[] = {
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+ "FIDIVR\tDWORD PTR ",
+-
++
+ "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+ "FICOMP\tDWORD PTR ",
+ "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+@@ -319,10 +323,11 @@ char *x86emu_fpu_op_da_tab[] = {
+ "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xda */
+-void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -332,59 +337,59 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
++ case 3: /* register to register */
++ stkelem = (u8) rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+- case 3:
++ case 3:
+ x86emu_fpu_illegal();
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
++ (void) destoffset;
++ (void) stkelem;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+@@ -392,7 +397,7 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+
+ #ifdef DEBUG
+
+-char *x86emu_fpu_op_db_tab[] = {
++static const char *x86emu_fpu_op_db_tab[] = {
+ "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
+ "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+
+@@ -403,10 +408,11 @@ char *x86emu_fpu_op_db_tab[] = {
+ "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xdb */
+-void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -416,104 +422,106 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
+ #ifdef DEBUG
+ if (mod != 3) {
+ DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
+- } else if (rh == 4) { /* === 11 10 0 nnn */
++ }
++ else if (rh == 4) { /* === 11 10 0 nnn */
+ switch (rl) {
+- case 0:
++ case 0:
+ DECODE_PRINTF("FENI\n");
+ break;
+- case 1:
++ case 1:
+ DECODE_PRINTF("FDISI\n");
+ break;
+- case 2:
++ case 2:
+ DECODE_PRINTF("FCLEX\n");
+ break;
+- case 3:
++ case 3:
+ DECODE_PRINTF("FINIT\n");
+ break;
+ }
+- } else {
++ }
++ else {
+ DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
+ }
+-#endif /* DEBUG */
++#endif /* DEBUG */
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 4:
++ case 4:
+ switch (rl) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_feni();
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fdisi();
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fclex();
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_finit();
+ break;
+- default:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+- default:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_illegal();
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_illegal();
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_illegal();
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
++ (void) destoffset;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+ }
+
+ #ifdef DEBUG
+-char *x86emu_fpu_op_dc_tab[] = {
++static const char *x86emu_fpu_op_dc_tab[] = {
+ "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
+ "FCOMP\tQWORD PTR ",
+ "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
+@@ -532,10 +540,11 @@ char *x86emu_fpu_op_dc_tab[] = {
+ "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
+ "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
+ };
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xdc */
+-void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -545,85 +554,85 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
++ case 3: /* register to register */
++ stkelem = (u8) rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ /* execute */
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ }
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
++ (void) destoffset;
++ (void) stkelem;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+@@ -631,7 +640,7 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+
+ #ifdef DEBUG
+
+-static char *x86emu_fpu_op_dd_tab[] = {
++static const char *x86emu_fpu_op_dd_tab[] = {
+ "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
+ "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
+
+@@ -645,10 +654,11 @@ static char *x86emu_fpu_op_dd_tab[] = {
+ "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xdd */
+-void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -658,75 +668,75 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
++ case 3: /* register to register */
++ stkelem = (u8) rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_ffree(stkelem);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fxch(stkelem);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fst(stkelem); /* register version */
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_fstp(stkelem); /* register version */
+ break;
+- default:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_illegal();
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_illegal();
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
++ (void) destoffset;
++ (void) stkelem;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+@@ -734,8 +744,7 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+
+ #ifdef DEBUG
+
+-static char *x86emu_fpu_op_de_tab[] =
+-{
++static const char *x86emu_fpu_op_de_tab[] = {
+ "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
+ "FICOMP\tWORD PTR ",
+ "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
+@@ -755,10 +764,11 @@ static char *x86emu_fpu_op_de_tab[] =
+ "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xde */
+-void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -768,87 +778,87 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
++ case 3: /* register to register */
++ stkelem = (u8) rl;
+ DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 3:
++ case 3:
+ if (stkelem == 1)
+- x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
++ x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
+ else
+- x86emu_fpu_illegal();
++ x86emu_fpu_illegal();
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP);
+ break;
+ }
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
++ (void) destoffset;
++ (void) stkelem;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+@@ -856,7 +866,7 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+
+ #ifdef DEBUG
+
+-static char *x86emu_fpu_op_df_tab[] = {
++static const char *x86emu_fpu_op_df_tab[] = {
+ /* mod == 00 */
+ "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
+ "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
+@@ -877,10 +887,11 @@ static char *x86emu_fpu_op_df_tab[] = {
+ "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
+ };
+
+-#endif /* DEBUG */
++#endif /* DEBUG */
+
+ /* opcode=0xdf */
+-void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset = 0;
+@@ -890,75 +901,75 @@ void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
+ switch (mod) {
+- case 0:
++ case 0:
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 1:
++ case 1:
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 2:
++ case 2:
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF("\n");
+ break;
+- case 3: /* register to register */
+- stkelem = (u8)rl;
++ case 3: /* register to register */
++ stkelem = (u8) rl;
+ DECODE_PRINTF2("\tST(%d)\n", stkelem);
+ break;
+ }
+ #ifdef X86EMU_FPU_PRESENT
+ switch (mod) {
+- case 3:
++ case 3:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_R_ffree(stkelem);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_R_fxch(stkelem);
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_R_fst(stkelem); /* register version */
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_R_fstp(stkelem); /* register version */
+ break;
+- default:
++ default:
+ x86emu_fpu_illegal();
+ break;
+ }
+ break;
+- default:
++ default:
+ switch (rh) {
+- case 0:
++ case 0:
+ x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 1:
++ case 1:
+ x86emu_fpu_illegal();
+ break;
+- case 2:
++ case 2:
+ x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 3:
++ case 3:
+ x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset);
+ break;
+- case 4:
++ case 4:
+ x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset);
+ break;
+- case 5:
++ case 5:
+ x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset);
+ break;
+- case 6:
++ case 6:
+ x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset);
+ break;
+- case 7:
++ case 7:
+ x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset);
+ break;
+ }
+ }
+ #else
+- (void)destoffset;
+- (void)stkelem;
++ (void) destoffset;
++ (void) stkelem;
+ #endif
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR_NO_TRACE();
+diff --git a/libs/x86emu/ops.c b/libs/x86emu/ops.c
+index 4f504c9..76b8358 100644
+--- a/libs/x86emu/ops.c
++++ b/libs/x86emu/ops.c
+@@ -81,17 +81,17 @@ op1 - Instruction op code
+ REMARKS:
+ Handles illegal opcodes.
+ ****************************************************************************/
+-static void x86emuOp_illegal_op(
+- u8 op1)
++static void
++x86emuOp_illegal_op(u8 op1)
+ {
+ START_OF_INSTR();
+ if (M.x86.R_SP != 0) {
+- DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
+- TRACE_REGS();
+- printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+- M.x86.R_CS, M.x86.R_IP-1,op1);
+- HALT_SYS();
+- }
++ DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
++ TRACE_REGS();
++ DB(printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
++ M.x86.R_CS, M.x86.R_IP - 1, op1));
++ HALT_SYS();
++ }
+ else {
+ /* If we get here, it means the stack pointer is back to zero
+ * so we are just returning from an emulator service call
+@@ -100,7 +100,7 @@ static void x86emuOp_illegal_op(
+ * call.
+ */
+ X86EMU_halt_sys();
+- }
++ }
+ END_OF_INSTR();
+ }
+
+@@ -108,7 +108,8 @@ static void x86emuOp_illegal_op(
+ REMARKS:
+ Handles opcode 0x00
+ ****************************************************************************/
+-static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -149,7 +150,7 @@ static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = add_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -166,7 +167,8 @@ static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x01
+ ****************************************************************************/
+-static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -188,7 +190,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -215,7 +218,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -242,7 +246,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = add_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -256,9 +261,9 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -266,8 +271,9 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -286,7 +292,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x02
+ ****************************************************************************/
+-static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -324,7 +331,7 @@ static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = add_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -341,7 +348,8 @@ static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x03
+ ****************************************************************************/
+-static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -362,7 +370,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -387,7 +396,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -412,7 +422,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -425,9 +436,9 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = add_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -435,8 +446,9 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = add_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -455,7 +467,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x04
+ ****************************************************************************/
+-static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -473,7 +486,8 @@ static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x05
+ ****************************************************************************/
+-static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -481,7 +495,8 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADD\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("ADD\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -489,8 +504,9 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = add_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -500,7 +516,8 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x06
+ ****************************************************************************/
+-static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tES\n");
+@@ -514,7 +531,8 @@ static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x07
+ ****************************************************************************/
+-static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tES\n");
+@@ -528,7 +546,8 @@ static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x08
+ ****************************************************************************/
+-static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -569,7 +588,7 @@ static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = or_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -586,7 +605,8 @@ static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x09
+ ****************************************************************************/
+-static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -608,7 +628,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -635,7 +656,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -662,7 +684,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = or_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -676,9 +699,9 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -686,8 +709,9 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -706,7 +730,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0a
+ ****************************************************************************/
+-static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -744,7 +769,7 @@ static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = or_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -761,7 +786,8 @@ static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0b
+ ****************************************************************************/
+-static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -782,7 +808,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -807,7 +834,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -832,7 +860,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -845,9 +874,9 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = or_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -855,8 +884,9 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = or_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -875,7 +905,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0c
+ ****************************************************************************/
+-static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -893,7 +924,8 @@ static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0d
+ ****************************************************************************/
+-static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -901,7 +933,8 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OR\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("OR\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -909,8 +942,9 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = or_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -920,7 +954,8 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0e
+ ****************************************************************************/
+-static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tCS\n");
+@@ -934,18 +969,21 @@ static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
+ ****************************************************************************/
+-static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
+ {
+- u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
++ u8 op2 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++
+ INC_DECODED_INST_LEN(1);
+- (*x86emu_optab2[op2])(op2);
++ (*x86emu_optab2[op2]) (op2);
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x10
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -986,7 +1024,7 @@ static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = adc_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1003,7 +1041,8 @@ static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x11
+ ****************************************************************************/
+-static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -1025,7 +1064,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1052,7 +1092,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1079,7 +1120,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = adc_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1093,9 +1135,9 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1103,8 +1145,9 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1123,7 +1166,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x12
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -1161,7 +1205,7 @@ static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = adc_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -1178,7 +1222,8 @@ static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x13
+ ****************************************************************************/
+-static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1199,7 +1244,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1224,7 +1270,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1249,7 +1296,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1262,9 +1310,9 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = adc_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1272,8 +1320,9 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = adc_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1292,7 +1341,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x14
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -1310,7 +1360,8 @@ static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x15
+ ****************************************************************************/
+-static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -1318,7 +1369,8 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("ADC\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("ADC\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -1326,8 +1378,9 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = adc_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -1337,7 +1390,8 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x16
+ ****************************************************************************/
+-static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tSS\n");
+@@ -1351,7 +1405,8 @@ static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x17
+ ****************************************************************************/
+-static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tSS\n");
+@@ -1365,7 +1420,8 @@ static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x18
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -1406,7 +1462,7 @@ static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = sbb_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1423,7 +1479,8 @@ static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x19
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -1445,7 +1502,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1472,7 +1530,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1499,7 +1558,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sbb_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1513,9 +1573,9 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1523,8 +1583,9 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1543,7 +1604,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1a
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -1581,7 +1643,7 @@ static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = sbb_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -1598,7 +1660,8 @@ static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1b
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1619,7 +1682,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1644,7 +1708,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1669,7 +1734,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1682,9 +1748,9 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = sbb_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1692,8 +1758,9 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sbb_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1712,7 +1779,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1c
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -1730,7 +1798,8 @@ static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1d
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -1738,7 +1807,8 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SBB\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("SBB\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -1746,8 +1816,9 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = sbb_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -1757,7 +1828,8 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1e
+ ****************************************************************************/
+-static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tDS\n");
+@@ -1771,7 +1843,8 @@ static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1f
+ ****************************************************************************/
+-static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tDS\n");
+@@ -1785,7 +1858,8 @@ static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x20
+ ****************************************************************************/
+-static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -1830,7 +1904,7 @@ static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_byte(destoffset, destval);
+ break;
+
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1847,7 +1921,8 @@ static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x21
+ ****************************************************************************/
+-static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -1869,7 +1944,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1896,7 +1972,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1923,7 +2000,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = and_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -1937,9 +2015,9 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1947,8 +2025,9 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1967,7 +2046,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x22
+ ****************************************************************************/
+-static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -2005,7 +2085,7 @@ static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = and_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2022,7 +2102,8 @@ static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x23
+ ****************************************************************************/
+-static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2043,7 +2124,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2069,7 +2151,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+ break;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2094,7 +2177,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2107,9 +2191,9 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = and_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2117,8 +2201,9 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = and_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2137,7 +2222,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x24
+ ****************************************************************************/
+-static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -2155,7 +2241,8 @@ static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x25
+ ****************************************************************************/
+-static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -2163,7 +2250,8 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("AND\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("AND\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -2171,8 +2259,9 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = and_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -2182,7 +2271,8 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x26
+ ****************************************************************************/
+-static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("ES:\n");
+@@ -2199,7 +2289,8 @@ static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x27
+ ****************************************************************************/
+-static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("DAA\n");
+@@ -2213,7 +2304,8 @@ static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x28
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -2254,7 +2346,7 @@ static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = sub_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -2271,7 +2363,8 @@ static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x29
+ ****************************************************************************/
+-static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -2293,7 +2386,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2320,7 +2414,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2347,7 +2442,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = sub_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2361,9 +2457,9 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -2371,8 +2467,9 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -2391,7 +2488,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2a
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -2429,7 +2527,7 @@ static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = sub_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2446,7 +2544,8 @@ static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2b
+ ****************************************************************************/
+-static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2467,7 +2566,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2492,7 +2592,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2517,7 +2618,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2530,9 +2632,9 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = sub_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2540,8 +2642,9 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = sub_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2560,7 +2663,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2c
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -2578,7 +2682,8 @@ static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2d
+ ****************************************************************************/
+-static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -2586,7 +2691,8 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SUB\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("SUB\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -2594,8 +2700,9 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = sub_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -2605,7 +2712,8 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2e
+ ****************************************************************************/
+-static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("CS:\n");
+@@ -2619,7 +2727,8 @@ static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2f
+ ****************************************************************************/
+-static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_das(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("DAS\n");
+@@ -2633,7 +2742,8 @@ static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x30
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -2674,7 +2784,7 @@ static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = xor_byte(destval, *srcreg);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -2691,7 +2801,8 @@ static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x31
+ ****************************************************************************/
+-static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -2713,7 +2824,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2740,7 +2852,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2767,7 +2880,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = xor_long(destval, *srcreg);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -2781,9 +2895,9 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -2791,8 +2905,9 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -2811,7 +2926,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x32
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -2849,7 +2965,7 @@ static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = xor_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2866,7 +2982,8 @@ static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x33
+ ****************************************************************************/
+-static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2887,7 +3004,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2912,7 +3030,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2937,7 +3056,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -2950,9 +3070,9 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = xor_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2960,8 +3080,9 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = xor_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -2980,7 +3101,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x34
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -2998,7 +3120,8 @@ static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x35
+ ****************************************************************************/
+-static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -3006,7 +3129,8 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XOR\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XOR\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -3014,8 +3138,9 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
+- } else {
+- M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ M.x86.R_AX = xor_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -3025,7 +3150,8 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x36
+ ****************************************************************************/
+-static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("SS:\n");
+@@ -3039,7 +3165,8 @@ static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x37
+ ****************************************************************************/
+-static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("AAA\n");
+@@ -3053,7 +3180,8 @@ static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x38
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -3091,7 +3219,7 @@ static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ cmp_byte(destval, *srcreg);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -3108,7 +3236,8 @@ static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x39
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -3129,7 +3258,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -3154,7 +3284,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -3179,7 +3310,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -3192,9 +3324,9 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ cmp_word(destval, *srcreg);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -3202,8 +3334,9 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -3222,7 +3355,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3a
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -3260,7 +3394,7 @@ static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ cmp_byte(*destreg, srcval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -3277,7 +3411,8 @@ static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3b
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -3298,7 +3433,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -3323,7 +3459,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -3348,7 +3485,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -3361,9 +3499,9 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ cmp_word(*destreg, srcval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -3371,8 +3509,9 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ cmp_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -3391,7 +3530,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3c
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 srcval;
+
+@@ -3409,7 +3549,8 @@ static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3d
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -3417,7 +3558,8 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMP\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("CMP\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -3425,8 +3567,9 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ cmp_long(M.x86.R_EAX, srcval);
+- } else {
+- cmp_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ cmp_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -3436,7 +3579,8 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3e
+ ****************************************************************************/
+-static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("DS:\n");
+@@ -3450,7 +3594,8 @@ static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3f
+ ****************************************************************************/
+-static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("AAS\n");
+@@ -3464,18 +3609,21 @@ static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x40
+ ****************************************************************************/
+-static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEAX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = inc_long(M.x86.R_EAX);
+- } else {
++ }
++ else {
+ M.x86.R_AX = inc_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3486,18 +3634,21 @@ static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x41
+ ****************************************************************************/
+-static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tECX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = inc_long(M.x86.R_ECX);
+- } else {
++ }
++ else {
+ M.x86.R_CX = inc_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3508,18 +3659,21 @@ static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x42
+ ****************************************************************************/
+-static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = inc_long(M.x86.R_EDX);
+- } else {
++ }
++ else {
+ M.x86.R_DX = inc_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3530,18 +3684,21 @@ static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x43
+ ****************************************************************************/
+-static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = inc_long(M.x86.R_EBX);
+- } else {
++ }
++ else {
+ M.x86.R_BX = inc_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3552,18 +3709,21 @@ static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x44
+ ****************************************************************************/
+-static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = inc_long(M.x86.R_ESP);
+- } else {
++ }
++ else {
+ M.x86.R_SP = inc_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3574,18 +3734,21 @@ static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x45
+ ****************************************************************************/
+-static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEBP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = inc_long(M.x86.R_EBP);
+- } else {
++ }
++ else {
+ M.x86.R_BP = inc_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3596,18 +3759,21 @@ static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x46
+ ****************************************************************************/
+-static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tESI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = inc_long(M.x86.R_ESI);
+- } else {
++ }
++ else {
+ M.x86.R_SI = inc_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3618,18 +3784,21 @@ static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x47
+ ****************************************************************************/
+-static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tEDI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = inc_long(M.x86.R_EDI);
+- } else {
++ }
++ else {
+ M.x86.R_DI = inc_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3640,18 +3809,21 @@ static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x48
+ ****************************************************************************/
+-static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEAX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = dec_long(M.x86.R_EAX);
+- } else {
++ }
++ else {
+ M.x86.R_AX = dec_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3662,18 +3834,21 @@ static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x49
+ ****************************************************************************/
+-static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tECX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = dec_long(M.x86.R_ECX);
+- } else {
++ }
++ else {
+ M.x86.R_CX = dec_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3684,18 +3859,21 @@ static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4a
+ ****************************************************************************/
+-static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = dec_long(M.x86.R_EDX);
+- } else {
++ }
++ else {
+ M.x86.R_DX = dec_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3706,18 +3884,21 @@ static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4b
+ ****************************************************************************/
+-static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = dec_long(M.x86.R_EBX);
+- } else {
++ }
++ else {
+ M.x86.R_BX = dec_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3728,18 +3909,21 @@ static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4c
+ ****************************************************************************/
+-static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = dec_long(M.x86.R_ESP);
+- } else {
++ }
++ else {
+ M.x86.R_SP = dec_word(M.x86.R_SP);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3750,18 +3934,21 @@ static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4d
+ ****************************************************************************/
+-static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEBP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = dec_long(M.x86.R_EBP);
+- } else {
++ }
++ else {
+ M.x86.R_BP = dec_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3772,18 +3959,21 @@ static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4e
+ ****************************************************************************/
+-static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tESI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = dec_long(M.x86.R_ESI);
+- } else {
++ }
++ else {
+ M.x86.R_SI = dec_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3794,18 +3984,21 @@ static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4f
+ ****************************************************************************/
+-static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tEDI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = dec_long(M.x86.R_EDI);
+- } else {
++ }
++ else {
+ M.x86.R_DI = dec_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3816,18 +4009,21 @@ static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x50
+ ****************************************************************************/
+-static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEAX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EAX);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3838,18 +4034,21 @@ static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x51
+ ****************************************************************************/
+-static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tECX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ECX);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_CX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3860,18 +4059,21 @@ static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x52
+ ****************************************************************************/
+-static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDX);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3882,18 +4084,21 @@ static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x53
+ ****************************************************************************/
+-static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBX);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_BX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3904,23 +4109,26 @@ static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x54
+ ****************************************************************************/
+-static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tSP\n");
+ }
+ TRACE_AND_STEP();
+- /* Always push (E)SP, since we are emulating an i386 and above
+- * processor. This is necessary as some BIOS'es use this to check
+- * what type of processor is in the system.
+- */
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- push_long(M.x86.R_ESP);
+- } else {
+- push_word((u16)(M.x86.R_SP));
++ /* Always push (E)SP, since we are emulating an i386 and above
++ * processor. This is necessary as some BIOS'es use this to check
++ * what type of processor is in the system.
++ */
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ push_long(M.x86.R_ESP);
++ }
++ else {
++ push_word((u16) (M.x86.R_SP));
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -3930,18 +4138,21 @@ static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x55
+ ****************************************************************************/
+-static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEBP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EBP);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_BP);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3952,18 +4163,21 @@ static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x56
+ ****************************************************************************/
+-static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tESI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_ESI);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_SI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3974,18 +4188,21 @@ static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x57
+ ****************************************************************************/
+-static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSH\tEDI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSH\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(M.x86.R_EDI);
+- } else {
++ }
++ else {
+ push_word(M.x86.R_DI);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -3996,18 +4213,21 @@ static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x58
+ ****************************************************************************/
+-static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEAX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tAX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_AX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4018,18 +4238,21 @@ static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x59
+ ****************************************************************************/
+-static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tECX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tCX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_CX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4040,18 +4263,21 @@ static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5a
+ ****************************************************************************/
+-static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tDX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_DX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4062,18 +4288,21 @@ static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5b
+ ****************************************************************************/
+-static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tBX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_BX = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4084,18 +4313,21 @@ static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5c
+ ****************************************************************************/
+-static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tSP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_SP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4106,18 +4338,21 @@ static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5d
+ ****************************************************************************/
+-static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEBP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tBP\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_BP = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4128,18 +4363,21 @@ static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5e
+ ****************************************************************************/
+-static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tESI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tSI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_SI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4150,18 +4388,21 @@ static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5f
+ ****************************************************************************/
+-static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POP\tEDI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POP\tDI\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_DI = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -4172,12 +4413,14 @@ static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x60
+ ****************************************************************************/
+-static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHAD\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSHA\n");
+ }
+ TRACE_AND_STEP();
+@@ -4192,7 +4435,8 @@ static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+ push_long(M.x86.R_EBP);
+ push_long(M.x86.R_ESI);
+ push_long(M.x86.R_EDI);
+- } else {
++ }
++ else {
+ u16 old_sp = M.x86.R_SP;
+
+ push_word(M.x86.R_AX);
+@@ -4212,12 +4456,14 @@ static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x61
+ ****************************************************************************/
+-static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPAD\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POPA\n");
+ }
+ TRACE_AND_STEP();
+@@ -4225,16 +4471,17 @@ static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+ M.x86.R_EDI = pop_long();
+ M.x86.R_ESI = pop_long();
+ M.x86.R_EBP = pop_long();
+- M.x86.R_ESP += 4; /* skip ESP */
++ M.x86.R_ESP += 4; /* skip ESP */
+ M.x86.R_EBX = pop_long();
+ M.x86.R_EDX = pop_long();
+ M.x86.R_ECX = pop_long();
+ M.x86.R_EAX = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_DI = pop_word();
+ M.x86.R_SI = pop_word();
+ M.x86.R_BP = pop_word();
+- M.x86.R_SP += 2; /* skip SP */
++ M.x86.R_SP += 2; /* skip SP */
+ M.x86.R_BX = pop_word();
+ M.x86.R_DX = pop_word();
+ M.x86.R_CX = pop_word();
+@@ -4251,7 +4498,8 @@ static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x64
+ ****************************************************************************/
+-static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("FS:\n");
+@@ -4268,7 +4516,8 @@ static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x65
+ ****************************************************************************/
+-static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("GS:\n");
+@@ -4285,7 +4534,8 @@ static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x66 - prefix for 32-bit register
+ ****************************************************************************/
+-static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("DATA:\n");
+@@ -4299,7 +4549,8 @@ static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x67 - prefix for 32-bit address
+ ****************************************************************************/
+-static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("ADDR:\n");
+@@ -4313,22 +4564,25 @@ static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x68
+ ****************************************************************************/
+-static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 imm;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ imm = fetch_long_imm();
+- } else {
++ }
++ else {
+ imm = fetch_word_imm();
+ }
+ DECODE_PRINTF2("PUSH\t%x\n", imm);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(imm);
+- } else {
+- push_word((u16)imm);
++ }
++ else {
++ push_word((u16) imm);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -4338,7 +4592,8 @@ static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x69
+ ****************************************************************************/
+-static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -4351,7 +4606,7 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4359,18 +4614,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4381,24 +4638,26 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4406,18 +4665,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4428,24 +4689,26 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4453,18 +4716,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_long_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4475,42 +4740,46 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_word_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
+- u32 res_lo,res_hi;
++ u32 *destreg, *srcreg;
++ u32 res_lo, res_hi;
+ s32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
+- u16 *destreg,*srcreg;
++ *destreg = (u32) res_lo;
++ }
++ else {
++ u16 *destreg, *srcreg;
+ u32 res;
+ s16 imm;
+
+@@ -4518,16 +4787,17 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
+- res = (s16)*srcreg * (s16)imm;
++ DECODE_PRINTF2(",%d\n", (s32) imm);
++ res = (s16) * srcreg * (s16) imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ }
+@@ -4539,18 +4809,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6a
+ ****************************************************************************/
+-static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ s16 imm;
+
+ START_OF_INSTR();
+- imm = (s8)fetch_byte_imm();
++ imm = (s8) fetch_byte_imm();
+ DECODE_PRINTF2("PUSH\t%d\n", imm);
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- push_long((s32)imm);
+- } else {
+- push_word(imm);
++ push_long((s32) imm);
++ }
++ else {
++ push_word(imm);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -4560,11 +4832,12 @@ static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6b
+ ****************************************************************************/
+-static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+- s8 imm;
++ s8 imm;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IMUL\t");
+@@ -4574,25 +4847,27 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4602,42 +4877,46 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4647,42 +4926,46 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -4692,57 +4975,62 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- res = (s16)srcval * (s16)imm;
++ res = (s16) srcval *(s16) imm;
++
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
+- u32 res_lo,res_hi;
++ u32 *destreg, *srcreg;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
++ DECODE_PRINTF2(",%d\n", (s32) imm);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
++ imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
+- u16 *destreg,*srcreg;
++ *destreg = (u32) res_lo;
++ }
++ else {
++ u16 *destreg, *srcreg;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_byte_imm();
+- DECODE_PRINTF2(",%d\n", (s32)imm);
+- res = (s16)*srcreg * (s16)imm;
++ DECODE_PRINTF2(",%d\n", (s32) imm);
++ res = (s16) * srcreg * (s16) imm;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ }
+@@ -4754,7 +5042,8 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6c
+ ****************************************************************************/
+-static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("INSB\n");
+@@ -4768,13 +5057,15 @@ static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6d
+ ****************************************************************************/
+-static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INSD\n");
+ ins(4);
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INSW\n");
+ ins(2);
+ }
+@@ -4787,7 +5078,8 @@ static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6e
+ ****************************************************************************/
+-static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("OUTSB\n");
+@@ -4801,13 +5093,15 @@ static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6f
+ ****************************************************************************/
+-static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUTSD\n");
+ outs(4);
+- } else {
++ }
++ else {
+ DECODE_PRINTF("OUTSW\n");
+ outs(2);
+ }
+@@ -4820,7 +5114,8 @@ static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x70
+ ****************************************************************************/
+-static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4828,8 +5123,8 @@ static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JO\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF))
+@@ -4842,7 +5137,8 @@ static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x71
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4850,8 +5146,8 @@ static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if overflow is not set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNO\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_OF))
+@@ -4864,7 +5160,8 @@ static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x72
+ ****************************************************************************/
+-static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4872,8 +5169,8 @@ static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if carry flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JB\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF))
+@@ -4886,7 +5183,8 @@ static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x73
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4894,8 +5192,8 @@ static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if carry flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNB\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_CF))
+@@ -4908,7 +5206,8 @@ static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x74
+ ****************************************************************************/
+-static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4916,8 +5215,8 @@ static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if zero flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JZ\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_ZF))
+@@ -4930,7 +5229,8 @@ static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x75
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4938,8 +5238,8 @@ static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if zero flag is clear. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNZ\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_ZF))
+@@ -4952,7 +5252,8 @@ static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x76
+ ****************************************************************************/
+-static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4961,8 +5262,8 @@ static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+ flag is set. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JBE\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
+@@ -4975,7 +5276,8 @@ static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x77
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -4984,8 +5286,8 @@ static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+ flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNBE\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
+@@ -4998,7 +5300,8 @@ static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x78
+ ****************************************************************************/
+-static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5006,8 +5309,8 @@ static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if sign flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JS\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_SF))
+@@ -5020,7 +5323,8 @@ static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x79
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5028,8 +5332,8 @@ static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if sign flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNS\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_SF))
+@@ -5042,7 +5346,8 @@ static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7a
+ ****************************************************************************/
+-static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5050,8 +5355,8 @@ static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if parity flag is set (even parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JP\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_PF))
+@@ -5064,7 +5369,8 @@ static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7b
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5072,8 +5378,8 @@ static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if parity flag is clear (odd parity) */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNP\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (!ACCESS_FLAG(F_PF))
+@@ -5086,7 +5392,8 @@ static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7c
+ ****************************************************************************/
+-static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5095,8 +5402,8 @@ static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JL\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5111,7 +5418,8 @@ static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7d
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5120,8 +5428,8 @@ static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+ /* jump to byte offset if sign flag not equal to overflow flag. */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNL\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5137,7 +5445,8 @@ static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7e
+ ****************************************************************************/
+-static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5147,8 +5456,8 @@ static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+ or the zero flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JLE\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5163,7 +5472,8 @@ static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7f
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+ {
+ s8 offset;
+ u16 target;
+@@ -5173,8 +5483,8 @@ static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+ and the zero flag is clear */
+ START_OF_INSTR();
+ DECODE_PRINTF("JNLE\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + (s16)offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + (s16) offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5185,23 +5495,23 @@ static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+ END_OF_INSTR();
+ }
+
+-static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
+-{
+- add_byte, /* 00 */
+- or_byte, /* 01 */
+- adc_byte, /* 02 */
+- sbb_byte, /* 03 */
+- and_byte, /* 04 */
+- sub_byte, /* 05 */
+- xor_byte, /* 06 */
+- cmp_byte, /* 07 */
++static u8(*opc80_byte_operation[]) (u8 d, u8 s) = {
++ add_byte, /* 00 */
++ or_byte, /* 01 */
++ adc_byte, /* 02 */
++ sbb_byte, /* 03 */
++ and_byte, /* 04 */
++ sub_byte, /* 05 */
++ xor_byte, /* 06 */
++ cmp_byte, /* 07 */
+ };
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x80
+ ****************************************************************************/
+-static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -5290,7 +5600,7 @@ static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ imm = fetch_byte_imm();
+@@ -5305,35 +5615,34 @@ static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ END_OF_INSTR();
+ }
+
+-static u16 (*opc81_word_operation[])(u16 d, u16 s) =
+-{
+- add_word, /*00 */
+- or_word, /*01 */
+- adc_word, /*02 */
+- sbb_word, /*03 */
+- and_word, /*04 */
+- sub_word, /*05 */
+- xor_word, /*06 */
+- cmp_word, /*07 */
++static u16(*opc81_word_operation[]) (u16 d, u16 s) = {
++ add_word, /*00 */
++ or_word, /*01 */
++ adc_word, /*02 */
++ sbb_word, /*03 */
++ and_word, /*04 */
++ sub_word, /*05 */
++ xor_word, /*06 */
++ cmp_word, /*07 */
+ };
+
+-static u32 (*opc81_long_operation[])(u32 d, u32 s) =
+-{
+- add_long, /*00 */
+- or_long, /*01 */
+- adc_long, /*02 */
+- sbb_long, /*03 */
+- and_long, /*04 */
+- sub_long, /*05 */
+- xor_long, /*06 */
+- cmp_long, /*07 */
++static u32(*opc81_long_operation[]) (u32 d, u32 s) = {
++ add_long, /*00 */
++ or_long, /*01 */
++ adc_long, /*02 */
++ sbb_long, /*03 */
++ and_long, /*04 */
++ sub_long, /*05 */
++ xor_long, /*06 */
++ cmp_long, /*07 */
+ };
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x81
+ ****************************************************************************/
+-static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -5387,7 +5696,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -5399,8 +5708,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -5416,7 +5726,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -5428,8 +5738,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -5445,7 +5756,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -5457,8 +5768,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc81_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -5472,10 +5784,10 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+- u32 destval,imm;
++ u32 destval, imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -5485,9 +5797,10 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc81_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+- u16 destval,imm;
++ u16 destval, imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -5504,23 +5817,23 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ END_OF_INSTR();
+ }
+
+-static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
+-{
+- add_byte, /*00 */
+- or_byte, /*01 *//*YYY UNUSED ???? */
+- adc_byte, /*02 */
+- sbb_byte, /*03 */
+- and_byte, /*04 *//*YYY UNUSED ???? */
+- sub_byte, /*05 */
+- xor_byte, /*06 *//*YYY UNUSED ???? */
+- cmp_byte, /*07 */
++static u8(*opc82_byte_operation[]) (u8 s, u8 d) = {
++ add_byte, /*00 */
++ or_byte, /*01 *//*YYY UNUSED ???? */
++ adc_byte, /*02 */
++ sbb_byte, /*03 */
++ and_byte, /*04 *//*YYY UNUSED ???? */
++ sub_byte, /*05 */
++ xor_byte, /*06 *//*YYY UNUSED ???? */
++ cmp_byte, /*07 */
+ };
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x82
+ ****************************************************************************/
+-static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -5606,7 +5919,7 @@ static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ if (rh != 7)
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+@@ -5620,35 +5933,34 @@ static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ END_OF_INSTR();
+ }
+
+-static u16 (*opc83_word_operation[])(u16 s, u16 d) =
+-{
+- add_word, /*00 */
+- or_word, /*01 *//*YYY UNUSED ???? */
+- adc_word, /*02 */
+- sbb_word, /*03 */
+- and_word, /*04 *//*YYY UNUSED ???? */
+- sub_word, /*05 */
+- xor_word, /*06 *//*YYY UNUSED ???? */
+- cmp_word, /*07 */
++static u16(*opc83_word_operation[]) (u16 s, u16 d) = {
++ add_word, /*00 */
++ or_word, /*01 *//*YYY UNUSED ???? */
++ adc_word, /*02 */
++ sbb_word, /*03 */
++ and_word, /*04 *//*YYY UNUSED ???? */
++ sub_word, /*05 */
++ xor_word, /*06 *//*YYY UNUSED ???? */
++ cmp_word, /*07 */
+ };
+
+-static u32 (*opc83_long_operation[])(u32 s, u32 d) =
+-{
+- add_long, /*00 */
+- or_long, /*01 *//*YYY UNUSED ???? */
+- adc_long, /*02 */
+- sbb_long, /*03 */
+- and_long, /*04 *//*YYY UNUSED ???? */
+- sub_long, /*05 */
+- xor_long, /*06 *//*YYY UNUSED ???? */
+- cmp_long, /*07 */
++static u32(*opc83_long_operation[]) (u32 s, u32 d) = {
++ add_long, /*00 */
++ or_long, /*01 *//*YYY UNUSED ???? */
++ adc_long, /*02 */
++ sbb_long, /*03 */
++ and_long, /*04 *//*YYY UNUSED ???? */
++ sub_long, /*05 */
++ xor_long, /*06 *//*YYY UNUSED ???? */
++ cmp_long, /*07 */
+ };
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x83
+ ****************************************************************************/
+-static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -5667,7 +5979,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ general, so that it is important to leave the strings
+ in the same format, even though the result is that the
+ above test is done twice. */
+- switch (rh) {
++ switch (rh) {
+ case 0:
+ DECODE_PRINTF("ADD\t");
+ break;
+@@ -5700,7 +6012,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -5711,8 +6023,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -5727,7 +6040,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -5738,8 +6051,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -5754,7 +6068,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,imm;
++ u32 destval, imm;
+
+ DECODE_PRINTF("DWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -5765,8 +6079,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc83_long_operation[rh]) (destval, imm);
+ if (rh != 7)
+ store_data_long(destoffset, destval);
+- } else {
+- u16 destval,imm;
++ }
++ else {
++ u16 destval, imm;
+
+ DECODE_PRINTF("WORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -5779,10 +6094,10 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+- u32 destval,imm;
++ u32 destval, imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+@@ -5791,9 +6106,10 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ destval = (*opc83_long_operation[rh]) (*destreg, imm);
+ if (rh != 7)
+ *destreg = destval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+- u16 destval,imm;
++ u16 destval, imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = (s8) fetch_byte_imm();
+@@ -5813,7 +6129,8 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x84
+ ****************************************************************************/
+-static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -5851,7 +6168,7 @@ static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ test_byte(destval, *srcreg);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -5868,7 +6185,8 @@ static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x85
+ ****************************************************************************/
+-static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -5889,7 +6207,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -5914,7 +6233,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -5939,7 +6259,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(destval, *srcreg);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *srcreg;
+
+@@ -5952,9 +6273,9 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ test_word(destval, *srcreg);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -5962,8 +6283,9 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ test_long(*destreg, *srcreg);
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -5982,7 +6304,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x86
+ ****************************************************************************/
+-static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -6030,7 +6353,7 @@ static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ destval = tmp;
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -6049,7 +6372,8 @@ static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x87
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -6061,7 +6385,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+- u32 destval,tmp;
++ u32 destval, tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+@@ -6073,9 +6397,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+- u16 destval,tmp;
++ u16 destval, tmp;
+
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+@@ -6092,7 +6417,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+- u32 destval,tmp;
++ u32 destval, tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+@@ -6104,9 +6429,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+- u16 destval,tmp;
++ u16 destval, tmp;
+
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+@@ -6123,7 +6449,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+- u32 destval,tmp;
++ u32 destval, tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+@@ -6135,9 +6461,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ *srcreg = destval;
+ destval = tmp;
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+- u16 destval,tmp;
++ u16 destval, tmp;
+
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+@@ -6151,9 +6478,9 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+ u32 tmp;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+@@ -6164,8 +6491,9 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ tmp = *srcreg;
+ *srcreg = *destreg;
+ *destreg = tmp;
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+ u16 tmp;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6187,7 +6515,8 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x88
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -6221,7 +6550,7 @@ static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, *srcreg);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -6238,7 +6567,8 @@ static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x89
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u32 destoffset;
+@@ -6257,7 +6587,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+
+ destoffset = decode_rm00_address(rl);
+@@ -6278,7 +6609,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+
+ destoffset = decode_rm01_address(rl);
+@@ -6299,7 +6631,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ store_data_long(destoffset, *srcreg);
+- } else {
++ }
++ else {
+ u16 *srcreg;
+
+ destoffset = decode_rm10_address(rl);
+@@ -6310,9 +6643,9 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, *srcreg);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
++ u32 *destreg, *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -6320,8 +6653,9 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+- } else {
+- u16 *destreg,*srcreg;
++ }
++ else {
++ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -6340,7 +6674,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8a
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg, *srcreg;
+@@ -6378,7 +6713,7 @@ static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -6395,7 +6730,8 @@ static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8b
+ ****************************************************************************/
+-static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -6416,7 +6752,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -6441,7 +6778,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -6466,7 +6804,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -6479,7 +6818,7 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = srcval;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg, *srcreg;
+
+@@ -6489,7 +6828,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+- } else {
++ }
++ else {
+ u16 *destreg, *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+@@ -6509,7 +6849,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8c
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+@@ -6547,7 +6888,7 @@ static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+ destval = *srcreg;
+ store_data_word(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ srcreg = decode_rm_seg_register(rh);
+@@ -6564,47 +6905,77 @@ static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8d
+ ****************************************************************************/
+-static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+- u16 *srcreg;
+ uint destoffset;
+
+-/*
+- * TODO: Need to handle address size prefix!
+- *
+- * lea eax,[eax+ebx*2] ??
+- */
+-
+ START_OF_INSTR();
+ DECODE_PRINTF("LEA\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+- srcreg = DECODE_RM_WORD_REGISTER(rh);
+- DECODE_PRINTF(",");
+- destoffset = decode_rm00_address(rl);
+- DECODE_PRINTF("\n");
+- TRACE_AND_STEP();
+- *srcreg = (u16)destoffset;
++ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm00_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u32) destoffset;
++ }
++ else {
++ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm00_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u16) destoffset;
++ }
+ break;
+ case 1:
+- srcreg = DECODE_RM_WORD_REGISTER(rh);
+- DECODE_PRINTF(",");
+- destoffset = decode_rm01_address(rl);
+- DECODE_PRINTF("\n");
+- TRACE_AND_STEP();
+- *srcreg = (u16)destoffset;
++ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm01_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u32) destoffset;
++ }
++ else {
++ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm01_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u16) destoffset;
++ }
+ break;
+ case 2:
+- srcreg = DECODE_RM_WORD_REGISTER(rh);
+- DECODE_PRINTF(",");
+- destoffset = decode_rm10_address(rl);
+- DECODE_PRINTF("\n");
+- TRACE_AND_STEP();
+- *srcreg = (u16)destoffset;
++ if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++ u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm10_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u32) destoffset;
++ }
++ else {
++ u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++ DECODE_PRINTF(",");
++ destoffset = decode_rm10_address(rl);
++ DECODE_PRINTF("\n");
++ TRACE_AND_STEP();
++ *srcreg = (u16) destoffset;
++ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* undefined. Do nothing. */
+ break;
+ }
+@@ -6616,7 +6987,8 @@ static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8e
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u16 *destreg, *srcreg;
+@@ -6654,7 +7026,7 @@ static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = decode_rm_seg_register(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6677,7 +7049,8 @@ static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8f
+ ****************************************************************************/
+-static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -6699,7 +7072,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destoffset = decode_rm00_address(rl);
+@@ -6718,7 +7092,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destoffset = decode_rm01_address(rl);
+@@ -6737,7 +7112,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = pop_long();
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destoffset = decode_rm10_address(rl);
+@@ -6747,7 +7123,7 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+@@ -6755,7 +7131,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = pop_long();
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6773,7 +7150,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x90
+ ****************************************************************************/
+-static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("NOP\n");
+@@ -6786,14 +7164,16 @@ static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x91
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ECX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,CX\n");
+ }
+ TRACE_AND_STEP();
+@@ -6801,10 +7181,11 @@ static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ECX;
+ M.x86.R_ECX = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_CX;
+- M.x86.R_CX = (u16)tmp;
++ M.x86.R_CX = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6814,14 +7195,16 @@ static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x92
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+@@ -6829,10 +7212,11 @@ static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDX;
+ M.x86.R_EDX = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DX;
+- M.x86.R_DX = (u16)tmp;
++ M.x86.R_DX = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6842,14 +7226,16 @@ static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x93
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,BX\n");
+ }
+ TRACE_AND_STEP();
+@@ -6857,10 +7243,11 @@ static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBX;
+ M.x86.R_EBX = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BX;
+- M.x86.R_BX = (u16)tmp;
++ M.x86.R_BX = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6870,14 +7257,16 @@ static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x94
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,SP\n");
+ }
+ TRACE_AND_STEP();
+@@ -6885,10 +7274,11 @@ static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESP;
+ M.x86.R_ESP = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SP;
+- M.x86.R_SP = (u16)tmp;
++ M.x86.R_SP = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6898,14 +7288,16 @@ static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x95
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EBP\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,BP\n");
+ }
+ TRACE_AND_STEP();
+@@ -6913,10 +7305,11 @@ static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EBP;
+ M.x86.R_EBP = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_BP;
+- M.x86.R_BP = (u16)tmp;
++ M.x86.R_BP = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6926,14 +7319,16 @@ static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x96
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,ESI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,SI\n");
+ }
+ TRACE_AND_STEP();
+@@ -6941,10 +7336,11 @@ static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_ESI;
+ M.x86.R_ESI = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_SI;
+- M.x86.R_SI = (u16)tmp;
++ M.x86.R_SI = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6954,14 +7350,16 @@ static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x97
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+ {
+ u32 tmp;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("XCHG\tEAX,EDI\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("XCHG\tAX,DI\n");
+ }
+ TRACE_AND_STEP();
+@@ -6969,10 +7367,11 @@ static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+ tmp = M.x86.R_EAX;
+ M.x86.R_EAX = M.x86.R_EDI;
+ M.x86.R_EDI = tmp;
+- } else {
++ }
++ else {
+ tmp = M.x86.R_AX;
+ M.x86.R_AX = M.x86.R_DI;
+- M.x86.R_DI = (u16)tmp;
++ M.x86.R_DI = (u16) tmp;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -6982,25 +7381,30 @@ static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x98
+ ****************************************************************************/
+-static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CWDE\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("CBW\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_EAX |= 0xffff0000;
+- } else {
++ }
++ else {
+ M.x86.R_EAX &= 0x0000ffff;
+ }
+- } else {
++ }
++ else {
+ if (M.x86.R_AL & 0x80) {
+ M.x86.R_AH = 0xff;
+- } else {
++ }
++ else {
+ M.x86.R_AH = 0x0;
+ }
+ }
+@@ -7012,12 +7416,14 @@ static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x99
+ ****************************************************************************/
+-static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CDQ\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("CWD\n");
+ }
+ DECODE_PRINTF("CWD\n");
+@@ -7025,13 +7431,16 @@ static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ if (M.x86.R_EAX & 0x80000000) {
+ M.x86.R_EDX = 0xffffffff;
+- } else {
++ }
++ else {
+ M.x86.R_EDX = 0x0;
+ }
+- } else {
++ }
++ else {
+ if (M.x86.R_AX & 0x8000) {
+ M.x86.R_DX = 0xffff;
+- } else {
++ }
++ else {
+ M.x86.R_DX = 0x0;
+ }
+ }
+@@ -7043,17 +7452,24 @@ static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9a
+ ****************************************************************************/
+-static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+- u16 farseg, faroff;
++ u32 farseg, faroff;
+
+ START_OF_INSTR();
+- DECODE_PRINTF("CALL\t");
+- faroff = fetch_word_imm();
+- farseg = fetch_word_imm();
+- DECODE_PRINTF2("%04x:", farseg);
+- DECODE_PRINTF2("%04x\n", faroff);
+- CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
++ DECODE_PRINTF("CALL\t");
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ faroff = fetch_long_imm();
++ farseg = fetch_word_imm();
++ }
++ else {
++ faroff = fetch_word_imm();
++ farseg = fetch_word_imm();
++ }
++ DECODE_PRINTF2("%04x:", farseg);
++ DECODE_PRINTF2("%04x\n", faroff);
++ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+
+ /* XXX
+ *
+@@ -7064,8 +7480,13 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = farseg;
+- push_word(M.x86.R_IP);
+- M.x86.R_IP = faroff;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ push_long(M.x86.R_EIP);
++ }
++ else {
++ push_word(M.x86.R_IP);
++ }
++ M.x86.R_EIP = faroff & 0xffff;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -7074,7 +7495,8 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9b
+ ****************************************************************************/
+-static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("WAIT");
+@@ -7088,14 +7510,16 @@ static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9c
+ ****************************************************************************/
+-static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+ {
+ u32 flags;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("PUSHFD\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("PUSHF\n");
+ }
+ TRACE_AND_STEP();
+@@ -7104,8 +7528,9 @@ static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+ flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ push_long(flags);
+- } else {
+- push_word((u16)flags);
++ }
++ else {
++ push_word((u16) flags);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -7115,18 +7540,21 @@ static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9d
+ ****************************************************************************/
+-static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("POPFD\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("POPF\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EFLG = pop_long();
+- } else {
++ }
++ else {
+ M.x86.R_FLG = pop_word();
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -7137,7 +7565,8 @@ static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9e
+ ****************************************************************************/
+-static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("SAHF\n");
+@@ -7154,12 +7583,13 @@ static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9f
+ ****************************************************************************/
+-static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("LAHF\n");
+ TRACE_AND_STEP();
+- M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
++ M.x86.R_AH = (u8) (M.x86.R_FLG & 0xff);
+ /*undocumented TC++ behavior??? Nope. It's documented, but
+ you have too look real hard to notice it. */
+ M.x86.R_AH |= 0x2;
+@@ -7171,7 +7601,8 @@ static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa0
+ ****************************************************************************/
+-static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 offset;
+
+@@ -7189,7 +7620,8 @@ static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa1
+ ****************************************************************************/
+-static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 offset;
+
+@@ -7197,13 +7629,15 @@ static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
+- } else {
++ }
++ else {
+ DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(offset);
+- } else {
++ }
++ else {
+ M.x86.R_AX = fetch_data_word(offset);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -7214,7 +7648,8 @@ static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa2
+ ****************************************************************************/
+-static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 offset;
+
+@@ -7232,7 +7667,8 @@ static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa3
+ ****************************************************************************/
+-static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 offset;
+
+@@ -7240,13 +7676,15 @@ static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+ offset = fetch_word_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
+- } else {
++ }
++ else {
+ DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long(offset, M.x86.R_EAX);
+- } else {
++ }
++ else {
+ store_data_word(offset, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -7257,15 +7695,16 @@ static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa4
+ ****************************************************************************/
+-static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+ {
+- u8 val;
++ u8 val;
+ u32 count;
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("MOVS\tBYTE\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+@@ -7292,7 +7731,8 @@ static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa5
+ ****************************************************************************/
+-static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ {
+ u32 val;
+ int inc;
+@@ -7301,13 +7741,14 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOVS\tDWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOVS\tWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+@@ -7325,9 +7766,10 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long(M.x86.R_SI);
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
+- } else {
++ }
++ else {
+ val = fetch_data_word(M.x86.R_SI);
+- store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
++ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16) val);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+@@ -7340,7 +7782,8 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa6
+ ****************************************************************************/
+-static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ {
+ s8 val1, val2;
+ int inc;
+@@ -7348,7 +7791,7 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ DECODE_PRINTF("CMPS\tBYTE\n");
+ TRACE_AND_STEP();
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+@@ -7359,7 +7802,7 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ while (M.x86.R_CX != 0) {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_byte(val1, val2);
++ cmp_byte(val1, val2);
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+@@ -7367,7 +7810,8 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++ }
++ else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+@@ -7381,7 +7825,8 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+- } else {
++ }
++ else {
+ val1 = fetch_data_byte(M.x86.R_SI);
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(val1, val2);
+@@ -7396,21 +7841,23 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa7
+ ****************************************************************************/
+-static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ {
+- u32 val1,val2;
++ u32 val1, val2;
+ int inc;
+
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("CMPS\tDWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+- } else {
++ }
++ else {
+ DECODE_PRINTF("CMPS\tWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+@@ -7424,10 +7871,11 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+- } else {
++ }
++ else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word((u16)val1, (u16)val2);
++ cmp_word((u16) val1, (u16) val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+@@ -7436,7 +7884,8 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++ }
++ else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+@@ -7444,10 +7893,11 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+- } else {
++ }
++ else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word((u16)val1, (u16)val2);
++ cmp_word((u16) val1, (u16) val2);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_SI += inc;
+@@ -7456,15 +7906,17 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+- } else {
++ }
++ else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val1 = fetch_data_long(M.x86.R_SI);
+ val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(val1, val2);
+- } else {
++ }
++ else {
+ val1 = fetch_data_word(M.x86.R_SI);
+ val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word((u16)val1, (u16)val2);
++ cmp_word((u16) val1, (u16) val2);
+ }
+ M.x86.R_SI += inc;
+ M.x86.R_DI += inc;
+@@ -7477,7 +7929,8 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa8
+ ****************************************************************************/
+-static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int imm;
+
+@@ -7486,7 +7939,7 @@ static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2("%04x\n", imm);
+ TRACE_AND_STEP();
+- test_byte(M.x86.R_AL, (u8)imm);
++ test_byte(M.x86.R_AL, (u8) imm);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -7495,7 +7948,8 @@ static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa9
+ ****************************************************************************/
+-static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -7503,7 +7957,8 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("TEST\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("TEST\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -7511,8 +7966,9 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ test_long(M.x86.R_EAX, srcval);
+- } else {
+- test_word(M.x86.R_AX, (u16)srcval);
++ }
++ else {
++ test_word(M.x86.R_AX, (u16) srcval);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -7522,13 +7978,14 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xaa
+ ****************************************************************************/
+-static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+ {
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("STOS\tBYTE\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+@@ -7542,7 +7999,8 @@ static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+ M.x86.R_DI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+- } else {
++ }
++ else {
+ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+ M.x86.R_DI += inc;
+ }
+@@ -7554,7 +8012,8 @@ static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xab
+ ****************************************************************************/
+-static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ {
+ int inc;
+ u32 count;
+@@ -7562,13 +8021,14 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("STOS\tDWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+- } else {
++ }
++ else {
+ DECODE_PRINTF("STOS\tWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+@@ -7585,7 +8045,8 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
+- } else {
++ }
++ else {
+ store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
+ }
+ M.x86.R_DI += inc;
+@@ -7598,14 +8059,15 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xac
+ ****************************************************************************/
+-static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+ {
+ int inc;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("LODS\tBYTE\n");
+ TRACE_AND_STEP();
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+@@ -7618,7 +8080,8 @@ static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+ M.x86.R_SI += inc;
+ }
+ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+- } else {
++ }
++ else {
+ M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+ M.x86.R_SI += inc;
+ }
+@@ -7630,7 +8093,8 @@ static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xad
+ ****************************************************************************/
+-static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ {
+ int inc;
+ u32 count;
+@@ -7638,13 +8102,14 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("LODS\tDWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+- } else {
++ }
++ else {
+ DECODE_PRINTF("LODS\tWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+@@ -7661,7 +8126,8 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ while (count--) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
+- } else {
++ }
++ else {
+ M.x86.R_AX = fetch_data_word(M.x86.R_SI);
+ }
+ M.x86.R_SI += inc;
+@@ -7674,7 +8140,8 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xae
+ ****************************************************************************/
+-static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ {
+ s8 val2;
+ int inc;
+@@ -7682,7 +8149,7 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ DECODE_PRINTF("SCAS\tBYTE\n");
+ TRACE_AND_STEP();
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -1;
+ else
+ inc = 1;
+@@ -7698,7 +8165,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++ }
++ else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+@@ -7710,7 +8178,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+- } else {
++ }
++ else {
+ val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_byte(M.x86.R_AL, val2);
+ M.x86.R_DI += inc;
+@@ -7723,7 +8192,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xaf
+ ****************************************************************************/
+-static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ {
+ int inc;
+ u32 val;
+@@ -7731,13 +8201,14 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("SCAS\tDWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -4;
+ else
+ inc = 4;
+- } else {
++ }
++ else {
+ DECODE_PRINTF("SCAS\tWORD\n");
+- if (ACCESS_FLAG(F_DF)) /* down */
++ if (ACCESS_FLAG(F_DF)) /* down */
+ inc = -2;
+ else
+ inc = 2;
+@@ -7750,9 +8221,10 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+- } else {
++ }
++ else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word(M.x86.R_AX, (u16)val);
++ cmp_word(M.x86.R_AX, (u16) val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+@@ -7760,16 +8232,18 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+- } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++ }
++ else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+ /* REPNE */
+ /* move them until CX is ZERO. */
+ while (M.x86.R_CX != 0) {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+- } else {
++ }
++ else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word(M.x86.R_AX, (u16)val);
++ cmp_word(M.x86.R_AX, (u16) val);
+ }
+ M.x86.R_CX -= 1;
+ M.x86.R_DI += inc;
+@@ -7777,13 +8251,15 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ break; /* zero flag set means equal */
+ }
+ M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+- } else {
++ }
++ else {
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+ cmp_long(M.x86.R_EAX, val);
+- } else {
++ }
++ else {
+ val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+- cmp_word(M.x86.R_AX, (u16)val);
++ cmp_word(M.x86.R_AX, (u16) val);
+ }
+ M.x86.R_DI += inc;
+ }
+@@ -7795,7 +8271,8 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb0
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7813,7 +8290,8 @@ static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb1
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7831,7 +8309,8 @@ static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb2
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7849,7 +8328,8 @@ static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb3
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7867,7 +8347,8 @@ static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb4
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7885,7 +8366,8 @@ static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb5
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7903,7 +8385,8 @@ static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb6
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7921,7 +8404,8 @@ static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb7
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 imm;
+
+@@ -7939,7 +8423,8 @@ static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb8
+ ****************************************************************************/
+-static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -7947,7 +8432,8 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEAX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tAX,");
+ srcval = fetch_word_imm();
+ }
+@@ -7955,8 +8441,9 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EAX = srcval;
+- } else {
+- M.x86.R_AX = (u16)srcval;
++ }
++ else {
++ M.x86.R_AX = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -7966,7 +8453,8 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb9
+ ****************************************************************************/
+-static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -7974,7 +8462,8 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tECX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tCX,");
+ srcval = fetch_word_imm();
+ }
+@@ -7982,8 +8471,9 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ECX = srcval;
+- } else {
+- M.x86.R_CX = (u16)srcval;
++ }
++ else {
++ M.x86.R_CX = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -7993,7 +8483,8 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xba
+ ****************************************************************************/
+-static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8001,7 +8492,8 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tDX,");
+ srcval = fetch_word_imm();
+ }
+@@ -8009,8 +8501,9 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDX = srcval;
+- } else {
+- M.x86.R_DX = (u16)srcval;
++ }
++ else {
++ M.x86.R_DX = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8020,7 +8513,8 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbb
+ ****************************************************************************/
+-static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8028,7 +8522,8 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBX,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tBX,");
+ srcval = fetch_word_imm();
+ }
+@@ -8036,8 +8531,9 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBX = srcval;
+- } else {
+- M.x86.R_BX = (u16)srcval;
++ }
++ else {
++ M.x86.R_BX = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8047,7 +8543,8 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbc
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8055,7 +8552,8 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESP,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tSP,");
+ srcval = fetch_word_imm();
+ }
+@@ -8063,8 +8561,9 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESP = srcval;
+- } else {
+- M.x86.R_SP = (u16)srcval;
++ }
++ else {
++ M.x86.R_SP = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8074,7 +8573,8 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbd
+ ****************************************************************************/
+-static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8082,7 +8582,8 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEBP,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tBP,");
+ srcval = fetch_word_imm();
+ }
+@@ -8090,8 +8591,9 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EBP = srcval;
+- } else {
+- M.x86.R_BP = (u16)srcval;
++ }
++ else {
++ M.x86.R_BP = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8101,7 +8603,8 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbe
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8109,7 +8612,8 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tESI,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tSI,");
+ srcval = fetch_word_imm();
+ }
+@@ -8117,8 +8621,9 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_ESI = srcval;
+- } else {
+- M.x86.R_SI = (u16)srcval;
++ }
++ else {
++ M.x86.R_SI = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8128,7 +8633,8 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbf
+ ****************************************************************************/
+-static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u32 srcval;
+
+@@ -8136,7 +8642,8 @@ static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("MOV\tEDI,");
+ srcval = fetch_long_imm();
+- } else {
++ }
++ else {
+ DECODE_PRINTF("MOV\tDI,");
+ srcval = fetch_word_imm();
+ }
+@@ -8144,31 +8651,25 @@ static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ M.x86.R_EDI = srcval;
+- } else {
+- M.x86.R_DI = (u16)srcval;
++ }
++ else {
++ M.x86.R_DI = (u16) srcval;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+
+ /* used by opcodes c0, d0, and d2. */
+-static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
+-{
+- rol_byte,
+- ror_byte,
+- rcl_byte,
+- rcr_byte,
+- shl_byte,
+- shr_byte,
+- shl_byte, /* sal_byte === shl_byte by definition */
+- sar_byte,
+-};
++static u8(*opcD0_byte_operation[]) (u8 d, u8 s) = {
++ rol_byte, ror_byte, rcl_byte, rcr_byte, shl_byte, shr_byte, shl_byte, /* sal_byte === shl_byte by definition */
++sar_byte,};
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0xc0
+ ****************************************************************************/
+-static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -8251,7 +8752,7 @@ static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ amt = fetch_byte_imm();
+ DECODE_PRINTF2(",%x\n", amt);
+@@ -8265,36 +8766,21 @@ static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+ }
+
+ /* used by opcodes c1, d1, and d3. */
+-static u16(*opcD1_word_operation[])(u16 s, u8 d) =
+-{
+- rol_word,
+- ror_word,
+- rcl_word,
+- rcr_word,
+- shl_word,
+- shr_word,
+- shl_word, /* sal_byte === shl_byte by definition */
+- sar_word,
+-};
++static u16(*opcD1_word_operation[]) (u16 s, u8 d) = {
++ rol_word, ror_word, rcl_word, rcr_word, shl_word, shr_word, shl_word, /* sal_byte === shl_byte by definition */
++sar_word,};
+
+ /* used by opcodes c1, d1, and d3. */
+-static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
+-{
+- rol_long,
+- ror_long,
+- rcl_long,
+- rcr_long,
+- shl_long,
+- shr_long,
+- shl_long, /* sal_byte === shl_byte by definition */
+- sar_long,
+-};
++static u32(*opcD1_long_operation[]) (u32 s, u8 d) = {
++ rol_long, ror_long, rcl_long, rcr_long, shl_long, shr_long, shl_long, /* sal_byte === shl_byte by definition */
++sar_long,};
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0xc1
+ ****************************************************************************/
+-static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -8357,7 +8843,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8382,7 +8869,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8407,7 +8895,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8420,7 +8909,7 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+@@ -8429,7 +8918,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2(",%x\n", amt);
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -8448,7 +8938,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc2
+ ****************************************************************************/
+-static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 imm;
+
+@@ -8456,8 +8947,8 @@ static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("RET\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+- RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+- TRACE_AND_STEP();
++ RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
++ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_SP += imm;
+ DECODE_CLEAR_SEGOVR();
+@@ -8468,12 +8959,13 @@ static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc3
+ ****************************************************************************/
+-static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("RET\n");
+- RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+- TRACE_AND_STEP();
++ RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
++ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -8483,7 +8975,8 @@ static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc4
+ ****************************************************************************/
+-static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rh, rl;
+ u16 *dstreg;
+@@ -8520,7 +9013,7 @@ static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_ES = fetch_data_word(srcoffset + 2);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+@@ -8532,7 +9025,8 @@ static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc5
+ ****************************************************************************/
+-static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rh, rl;
+ u16 *dstreg;
+@@ -8569,7 +9063,7 @@ static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_DS = fetch_data_word(srcoffset + 2);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+@@ -8581,7 +9075,8 @@ static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc6
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -8620,7 +9115,7 @@ static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, imm);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ imm = fetch_byte_imm();
+ DECODE_PRINTF2(",%2x\n", imm);
+@@ -8636,7 +9131,8 @@ static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc7
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -8659,7 +9155,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+- } else {
++ }
++ else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8680,7 +9177,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+- } else {
++ }
++ else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8701,7 +9199,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ store_data_long(destoffset, imm);
+- } else {
++ }
++ else {
+ u16 imm;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -8712,19 +9211,20 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, imm);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg;
+- u32 imm;
++ u32 *destreg;
++ u32 imm;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ imm = fetch_long_imm();
+ DECODE_PRINTF2(",%x\n", imm);
+ TRACE_AND_STEP();
+ *destreg = imm;
+- } else {
+- u16 *destreg;
+- u16 imm;
++ }
++ else {
++ u16 *destreg;
++ u16 imm;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ imm = fetch_word_imm();
+@@ -8742,10 +9242,11 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc8
+ ****************************************************************************/
+-static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+ {
+- u16 local,frame_pointer;
+- u8 nesting;
++ u16 local, frame_pointer;
++ u8 nesting;
+ int i;
+
+ START_OF_INSTR();
+@@ -8760,11 +9261,11 @@ static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+ for (i = 1; i < nesting; i++) {
+ M.x86.R_BP -= 2;
+ push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+- }
+- push_word(frame_pointer);
+ }
++ push_word(frame_pointer);
++ }
+ M.x86.R_BP = frame_pointer;
+- M.x86.R_SP = (u16)(M.x86.R_SP - local);
++ M.x86.R_SP = (u16) (M.x86.R_SP - local);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -8773,7 +9274,8 @@ static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc9
+ ****************************************************************************/
+-static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("LEAVE\n");
+@@ -8788,7 +9290,8 @@ static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xca
+ ****************************************************************************/
+-static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 imm;
+
+@@ -8796,8 +9299,8 @@ static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("RETF\t");
+ imm = fetch_word_imm();
+ DECODE_PRINTF2("%x\n", imm);
+- RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+- TRACE_AND_STEP();
++ RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
++ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ M.x86.R_SP += imm;
+@@ -8809,12 +9312,13 @@ static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcb
+ ****************************************************************************/
+-static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("RETF\n");
+- RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+- TRACE_AND_STEP();
++ RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
++ TRACE_AND_STEP();
+ M.x86.R_IP = pop_word();
+ M.x86.R_CS = pop_word();
+ DECODE_CLEAR_SEGOVR();
+@@ -8825,15 +9329,17 @@ static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcc
+ ****************************************************************************/
+-static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("INT 3\n");
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[3]) {
+- (*_X86EMU_intrTab[3])(3);
+- } else {
+- push_word((u16)M.x86.R_FLG);
++ (*_X86EMU_intrTab[3]) (3);
++ }
++ else {
++ push_word((u16) M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+@@ -8849,7 +9355,8 @@ static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcd
+ ****************************************************************************/
+-static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 intnum;
+
+@@ -8859,9 +9366,10 @@ static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2("%x\n", intnum);
+ TRACE_AND_STEP();
+ if (_X86EMU_intrTab[intnum]) {
+- (*_X86EMU_intrTab[intnum])(intnum);
+- } else {
+- push_word((u16)M.x86.R_FLG);
++ (*_X86EMU_intrTab[intnum]) (intnum);
++ }
++ else {
++ push_word((u16) M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+@@ -8877,16 +9385,18 @@ static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xce
+ ****************************************************************************/
+-static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_into(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("INTO\n");
+ TRACE_AND_STEP();
+ if (ACCESS_FLAG(F_OF)) {
+- if (_X86EMU_intrTab[4]) {
+- (*_X86EMU_intrTab[4])(4);
+- } else {
+- push_word((u16)M.x86.R_FLG);
++ if (_X86EMU_intrTab[4]) {
++ (*_X86EMU_intrTab[4]) (4);
++ }
++ else {
++ push_word((u16) M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+@@ -8903,7 +9413,8 @@ static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcf
+ ****************************************************************************/
+-static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("IRET\n");
+@@ -8921,7 +9432,8 @@ static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd0
+ ****************************************************************************/
+-static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -8999,7 +9511,7 @@ static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+ destval = (*opcD0_byte_operation[rh]) (destval, 1);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+@@ -9015,7 +9527,8 @@ static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd1
+ ****************************************************************************/
+-static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -9075,7 +9588,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -9098,7 +9612,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -9121,7 +9636,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, 1);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("BYTE PTR ");
+@@ -9133,19 +9649,20 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval;
+- u32 *destreg;
++ u32 destval;
++ u32 *destreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (*destreg, 1);
+ *destreg = destval;
+- } else {
+- u16 destval;
+- u16 *destreg;
++ }
++ else {
++ u16 destval;
++ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",1\n");
+@@ -9163,7 +9680,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd2
+ ****************************************************************************/
+-static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -9243,7 +9761,7 @@ static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+ destval = (*opcD0_byte_operation[rh]) (destval, amt);
+ store_data_byte(destoffset, destval);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+@@ -9259,7 +9777,8 @@ static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd3
+ ****************************************************************************/
+-static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -9321,7 +9840,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -9344,7 +9864,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -9367,7 +9888,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = (*opcD1_long_operation[rh]) (destval, amt);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("WORD PTR ");
+@@ -9379,7 +9901,7 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+
+@@ -9387,7 +9909,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -9405,16 +9928,17 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd4
+ ****************************************************************************/
+-static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+ {
+ u8 a;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("AAM\n");
+- a = fetch_byte_imm(); /* this is a stupid encoding. */
++ a = fetch_byte_imm(); /* this is a stupid encoding. */
+ if (a != 10) {
+- /* fix: add base decoding
+- aam_word(u8 val, int base a) */
++ /* fix: add base decoding
++ aam_word(u8 val, int base a) */
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+@@ -9430,7 +9954,8 @@ static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd5
+ ****************************************************************************/
+-static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+ {
+ u8 a;
+
+@@ -9438,8 +9963,8 @@ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("AAD\n");
+ a = fetch_byte_imm();
+ if (a != 10) {
+- /* fix: add base decoding
+- aad_word(u16 val, int base a) */
++ /* fix: add base decoding
++ aad_word(u16 val, int base a) */
+ DECODE_PRINTF("ERROR DECODING AAM\n");
+ TRACE_REGS();
+ HALT_SYS();
+@@ -9456,14 +9981,15 @@ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd7
+ ****************************************************************************/
+-static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+ {
+ u16 addr;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("XLAT\n");
+ TRACE_AND_STEP();
+- addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
++ addr = (u16) (M.x86.R_BX + (u8) M.x86.R_AL);
+ M.x86.R_AL = fetch_data_byte(addr);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9475,7 +10001,8 @@ static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe0
+ ****************************************************************************/
+-static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+ {
+ s16 ip;
+
+@@ -9486,7 +10013,7 @@ static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+- if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */
++ if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF)) /* CX != 0 and !ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9496,7 +10023,8 @@ static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe1
+ ****************************************************************************/
+-static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+ {
+ s16 ip;
+
+@@ -9507,7 +10035,7 @@ static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+ M.x86.R_CX -= 1;
+- if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */
++ if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF)) /* CX != 0 and ZF */
+ M.x86.R_IP = ip;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9517,7 +10045,8 @@ static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe2
+ ****************************************************************************/
+-static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+ {
+ s16 ip;
+
+@@ -9538,16 +10067,17 @@ static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe3
+ ****************************************************************************/
+-static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+ {
+ u16 target;
+- s8 offset;
++ s8 offset;
+
+ /* jump to byte offset if overflow flag is set */
+ START_OF_INSTR();
+ DECODE_PRINTF("JCXZ\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ if (M.x86.R_CX == 0)
+@@ -9560,16 +10090,17 @@ static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe4
+ ****************************************************************************/
+-static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+- port = (u8) fetch_byte_imm();
++ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+- M.x86.R_AL = (*sys_inb)(port);
++ M.x86.R_AL = (*sys_inb) (port);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9578,23 +10109,26 @@ static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe5
+ ****************************************************************************/
+-static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\t");
+- port = (u8) fetch_byte_imm();
++ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("EAX,%x\n", port);
+- } else {
++ }
++ else {
+ DECODE_PRINTF2("AX,%x\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- M.x86.R_EAX = (*sys_inl)(port);
+- } else {
+- M.x86.R_AX = (*sys_inw)(port);
++ M.x86.R_EAX = (*sys_inl) (port);
++ }
++ else {
++ M.x86.R_AX = (*sys_inw) (port);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9604,16 +10138,17 @@ static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe6
+ ****************************************************************************/
+-static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+ {
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+- port = (u8) fetch_byte_imm();
++ port = (u8) fetch_byte_imm();
+ DECODE_PRINTF2("%x,AL\n", port);
+ TRACE_AND_STEP();
+- (*sys_outb)(port, M.x86.R_AL);
++ (*sys_outb) (port, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9622,23 +10157,26 @@ static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe7
+ ****************************************************************************/
+-static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+ {
+ u8 port;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\t");
+- port = (u8) fetch_byte_imm();
++ port = (u8) fetch_byte_imm();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF2("%x,EAX\n", port);
+- } else {
++ }
++ else {
+ DECODE_PRINTF2("%x,AX\n", port);
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- (*sys_outl)(port, M.x86.R_EAX);
+- } else {
+- (*sys_outw)(port, M.x86.R_AX);
++ (*sys_outl) (port, M.x86.R_EAX);
++ }
++ else {
++ (*sys_outw) (port, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9648,19 +10186,35 @@ static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe8
+ ****************************************************************************/
+-static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+- s16 ip;
++ s16 ip16;
++ s32 ip32;
+
+ START_OF_INSTR();
+- DECODE_PRINTF("CALL\t");
+- ip = (s16) fetch_word_imm();
+- ip += (s16) M.x86.R_IP; /* CHECK SIGN */
+- DECODE_PRINTF2("%04x\n", (u16)ip);
+- CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
++ DECODE_PRINTF("CALL\t");
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ ip32 = (s32) fetch_long_imm();
++ ip32 += (s16) M.x86.R_IP; /* CHECK SIGN */
++ DECODE_PRINTF2("%04x\n", (u16) ip32);
++ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, "");
++ }
++ else {
++ ip16 = (s16) fetch_word_imm();
++ ip16 += (s16) M.x86.R_IP; /* CHECK SIGN */
++ DECODE_PRINTF2("%04x\n", (u16) ip16);
++ CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, "");
++ }
+ TRACE_AND_STEP();
+- push_word(M.x86.R_IP);
+- M.x86.R_IP = ip;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ push_long(M.x86.R_EIP);
++ M.x86.R_EIP = ip32 & 0xffff;
++ }
++ else {
++ push_word(M.x86.R_IP);
++ M.x86.R_EIP = ip16;
++ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9669,17 +10223,27 @@ static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe9
+ ****************************************************************************/
+-static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+- int ip;
++ u32 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+- ip = (s16)fetch_word_imm();
+- ip += (s16)M.x86.R_IP;
+- DECODE_PRINTF2("%04x\n", (u16)ip);
+- TRACE_AND_STEP();
+- M.x86.R_IP = (u16)ip;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ ip = (u32) fetch_long_imm();
++ ip += (u32) M.x86.R_EIP;
++ DECODE_PRINTF2("%08x\n", (u32) ip);
++ TRACE_AND_STEP();
++ M.x86.R_EIP = (u32) ip;
++ }
++ else {
++ ip = (s16) fetch_word_imm();
++ ip += (s16) M.x86.R_IP;
++ DECODE_PRINTF2("%04x\n", (u16) ip);
++ TRACE_AND_STEP();
++ M.x86.R_IP = (u16) ip;
++ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9688,18 +10252,25 @@ static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xea
+ ****************************************************************************/
+-static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+- u16 cs, ip;
++ u16 cs;
++ u32 ip;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\tFAR ");
+- ip = fetch_word_imm();
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ ip = fetch_long_imm();
++ }
++ else {
++ ip = fetch_word_imm();
++ }
+ cs = fetch_word_imm();
+ DECODE_PRINTF2("%04x:", cs);
+ DECODE_PRINTF2("%04x\n", ip);
+ TRACE_AND_STEP();
+- M.x86.R_IP = ip;
++ M.x86.R_EIP = ip & 0xffff;
+ M.x86.R_CS = cs;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9709,15 +10280,16 @@ static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xeb
+ ****************************************************************************/
+-static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+ u16 target;
+ s8 offset;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("JMP\t");
+- offset = (s8)fetch_byte_imm();
+- target = (u16)(M.x86.R_IP + offset);
++ offset = (s8) fetch_byte_imm();
++ target = (u16) (M.x86.R_IP + offset);
+ DECODE_PRINTF2("%x\n", target);
+ TRACE_AND_STEP();
+ M.x86.R_IP = target;
+@@ -9729,12 +10301,13 @@ static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xec
+ ****************************************************************************/
+-static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("IN\tAL,DX\n");
+ TRACE_AND_STEP();
+- M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
++ M.x86.R_AL = (*sys_inb) (M.x86.R_DX);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9743,19 +10316,22 @@ static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xed
+ ****************************************************************************/
+-static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("IN\tEAX,DX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("IN\tAX,DX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
+- } else {
+- M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
++ M.x86.R_EAX = (*sys_inl) (M.x86.R_DX);
++ }
++ else {
++ M.x86.R_AX = (*sys_inw) (M.x86.R_DX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9765,12 +10341,13 @@ static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xee
+ ****************************************************************************/
+-static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("OUT\tDX,AL\n");
+ TRACE_AND_STEP();
+- (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
++ (*sys_outb) (M.x86.R_DX, M.x86.R_AL);
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -9779,19 +10356,22 @@ static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xef
+ ****************************************************************************/
+-static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("OUT\tDX,EAX\n");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("OUT\tDX,AX\n");
+ }
+ TRACE_AND_STEP();
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
+- } else {
+- (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
++ (*sys_outl) (M.x86.R_DX, M.x86.R_EAX);
++ }
++ else {
++ (*sys_outw) (M.x86.R_DX, M.x86.R_AX);
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -9801,7 +10381,8 @@ static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf0
+ ****************************************************************************/
+-static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("LOCK:\n");
+@@ -9816,7 +10397,8 @@ static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf2
+ ****************************************************************************/
+-static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("REPNE\n");
+@@ -9830,7 +10412,8 @@ static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf3
+ ****************************************************************************/
+-static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("REPE\n");
+@@ -9844,7 +10427,8 @@ static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf4
+ ****************************************************************************/
+-static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("HALT\n");
+@@ -9858,7 +10442,8 @@ static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf5
+ ****************************************************************************/
+-static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+ {
+ /* complement the carry flag. */
+ START_OF_INSTR();
+@@ -9873,7 +10458,8 @@ static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf6
+ ****************************************************************************/
+-static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ u8 *destreg;
+@@ -9885,9 +10471,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+- case 0: /* mod=00 */
++ case 0: /* mod=00 */
+ switch (rh) {
+- case 0: /* test byte imm */
++ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF(",");
+@@ -9953,9 +10539,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==00 */
+- case 1: /* mod=01 */
++ case 1: /* mod=01 */
+ switch (rh) {
+- case 0: /* test byte imm */
++ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm01_address(rl);
+ DECODE_PRINTF(",");
+@@ -10021,9 +10607,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==01 */
+- case 2: /* mod=10 */
++ case 2: /* mod=10 */
+ switch (rh) {
+- case 0: /* test byte imm */
++ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\tBYTE PTR ");
+ destoffset = decode_rm10_address(rl);
+ DECODE_PRINTF(",");
+@@ -10089,9 +10675,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==10 */
+- case 3: /* mod=11 */
++ case 3: /* mod=11 */
+ switch (rh) {
+- case 0: /* test byte imm */
++ case 0: /* test byte imm */
+ DECODE_PRINTF("TEST\t");
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -10123,7 +10709,7 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- mul_byte(*destreg); /*!!! */
++ mul_byte(*destreg); /*!!! */
+ break;
+ case 5:
+ DECODE_PRINTF("IMUL\t");
+@@ -10157,7 +10743,8 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf7
+ ****************************************************************************/
+-static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -10167,11 +10754,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ START_OF_INSTR();
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+- case 0: /* mod=00 */
++ case 0: /* mod=00 */
+ switch (rh) {
+- case 0: /* test word imm */
++ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,srcval;
++ u32 destval, srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -10181,8 +10768,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+- } else {
+- u16 destval,srcval;
++ }
++ else {
++ u16 destval, srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm00_address(rl);
+@@ -10209,7 +10797,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10232,7 +10821,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10254,7 +10844,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10275,7 +10866,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10296,7 +10888,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10317,7 +10910,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10330,11 +10924,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==00 */
+- case 1: /* mod=01 */
++ case 1: /* mod=01 */
+ switch (rh) {
+- case 0: /* test word imm */
++ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,srcval;
++ u32 destval, srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -10344,8 +10938,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+- } else {
+- u16 destval,srcval;
++ }
++ else {
++ u16 destval, srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm01_address(rl);
+@@ -10372,7 +10967,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10395,7 +10991,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10417,7 +11014,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10438,7 +11036,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10459,7 +11058,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10480,7 +11080,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10493,11 +11094,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==01 */
+- case 2: /* mod=10 */
++ case 2: /* mod=10 */
+ switch (rh) {
+- case 0: /* test word imm */
++ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 destval,srcval;
++ u32 destval, srcval;
+
+ DECODE_PRINTF("TEST\tDWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -10507,8 +11108,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ test_long(destval, srcval);
+- } else {
+- u16 destval,srcval;
++ }
++ else {
++ u16 destval, srcval;
+
+ DECODE_PRINTF("TEST\tWORD PTR ");
+ destoffset = decode_rm10_address(rl);
+@@ -10535,7 +11137,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = not_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10558,7 +11161,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = neg_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10580,7 +11184,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ mul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10601,7 +11206,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ imul_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10622,7 +11228,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ div_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10643,7 +11250,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ idiv_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10656,9 +11264,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ break;
+ }
+ break; /* end mod==10 */
+- case 3: /* mod=11 */
++ case 3: /* mod=11 */
+ switch (rh) {
+- case 0: /* test word imm */
++ case 0: /* test word imm */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+@@ -10670,7 +11278,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF2("%x\n", srcval);
+ TRACE_AND_STEP();
+ test_long(*destreg, srcval);
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -10696,7 +11305,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = not_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NOT\t");
+@@ -10715,7 +11325,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = neg_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("NEG\t");
+@@ -10733,15 +11344,16 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- mul_long(*destreg); /*!!! */
+- } else {
++ mul_long(*destreg); /*!!! */
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("MUL\t");
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- mul_word(*destreg); /*!!! */
++ mul_word(*destreg); /*!!! */
+ }
+ break;
+ case 5:
+@@ -10753,7 +11365,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ imul_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IMUL\t");
+@@ -10772,7 +11385,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ div_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("DIV\t");
+@@ -10791,7 +11405,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ idiv_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ DECODE_PRINTF("IDIV\t");
+@@ -10812,7 +11427,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf8
+ ****************************************************************************/
+-static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+ {
+ /* clear the carry flag. */
+ START_OF_INSTR();
+@@ -10827,7 +11443,8 @@ static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf9
+ ****************************************************************************/
+-static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+ {
+ /* set the carry flag. */
+ START_OF_INSTR();
+@@ -10842,7 +11459,8 @@ static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfa
+ ****************************************************************************/
+-static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+ {
+ /* clear interrupts. */
+ START_OF_INSTR();
+@@ -10857,7 +11475,8 @@ static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfb
+ ****************************************************************************/
+-static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+ {
+ /* enable interrupts. */
+ START_OF_INSTR();
+@@ -10872,7 +11491,8 @@ static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfc
+ ****************************************************************************/
+-static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+ {
+ /* clear interrupts. */
+ START_OF_INSTR();
+@@ -10887,7 +11507,8 @@ static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfd
+ ****************************************************************************/
+-static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_std(u8 X86EMU_UNUSED(op1))
+ {
+ /* clear interrupts. */
+ START_OF_INSTR();
+@@ -10902,7 +11523,8 @@ static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfe
+ ****************************************************************************/
+-static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rh, rl;
+ u8 destval;
+@@ -10944,13 +11566,13 @@ static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+- case 0: /* inc word ptr ... */
++ case 0: /* inc word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = inc_byte(destval);
+ store_data_byte(destoffset, destval);
+ break;
+- case 1: /* dec word ptr ... */
++ case 1: /* dec word ptr ... */
+ destval = fetch_data_byte(destoffset);
+ TRACE_AND_STEP();
+ destval = dec_byte(destval);
+@@ -11019,12 +11641,13 @@ static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xff
+ ****************************************************************************/
+-static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ {
+ int mod, rh, rl;
+ uint destoffset = 0;
+- u16 *destreg;
+- u16 destval,destval2;
++ u16 *destreg;
++ u16 destval, destval2;
+
+ /* Yet another special case instruction. */
+ START_OF_INSTR();
+@@ -11040,14 +11663,16 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("INC\tDWORD PTR ");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("INC\tWORD PTR ");
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ DECODE_PRINTF("DEC\tDWORD PTR ");
+- } else {
++ }
++ else {
+ DECODE_PRINTF("DEC\tWORD PTR ");
+ }
+ break;
+@@ -11078,7 +11703,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ destoffset = decode_rm00_address(rl);
+ DECODE_PRINTF("\n");
+ switch (rh) {
+- case 0: /* inc word ptr ... */
++ case 0: /* inc word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+@@ -11086,7 +11711,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11095,7 +11721,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 1: /* dec word ptr ... */
++ case 1: /* dec word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+@@ -11103,7 +11729,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11112,13 +11739,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 2: /* call word ptr ... */
++ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 3: /* call far ptr ... */
++ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+@@ -11127,26 +11754,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 4: /* jmp word ptr ... */
++ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+- case 5: /* jmp far ptr ... */
++ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+- case 6: /* push word ptr ... */
++ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11168,7 +11796,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11185,7 +11814,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11194,13 +11824,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 2: /* call word ptr ... */
++ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 3: /* call far ptr ... */
++ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+@@ -11209,26 +11839,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 4: /* jmp word ptr ... */
++ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+- case 5: /* jmp far ptr ... */
++ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+- case 6: /* push word ptr ... */
++ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11250,7 +11881,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = inc_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11267,7 +11899,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ TRACE_AND_STEP();
+ destval = dec_long(destval);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11276,13 +11909,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 2: /* call word ptr ... */
++ case 2: /* call word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 3: /* call far ptr ... */
++ case 3: /* call far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+@@ -11291,26 +11924,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = destval;
+ break;
+- case 4: /* jmp word ptr ... */
++ case 4: /* jmp word ptr ... */
+ destval = fetch_data_word(destoffset);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ break;
+- case 5: /* jmp far ptr ... */
++ case 5: /* jmp far ptr ... */
+ destval = fetch_data_word(destoffset);
+ destval2 = fetch_data_word(destoffset + 2);
+ TRACE_AND_STEP();
+ M.x86.R_IP = destval;
+ M.x86.R_CS = destval2;
+ break;
+- case 6: /* push word ptr ... */
++ case 6: /* push word ptr ... */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 destval;
+
+ destval = fetch_data_long(destoffset);
+ TRACE_AND_STEP();
+ push_long(destval);
+- } else {
++ }
++ else {
+ u16 destval;
+
+ destval = fetch_data_word(destoffset);
+@@ -11330,7 +11964,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = inc_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11347,7 +11982,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = dec_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11356,26 +11992,26 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ *destreg = dec_word(*destreg);
+ }
+ break;
+- case 2: /* call word ptr ... */
++ case 2: /* call word ptr ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = *destreg;
+ break;
+- case 3: /* jmp far ptr ... */
++ case 3: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+ break;
+
+- case 4: /* jmp ... */
++ case 4: /* jmp ... */
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16) (*destreg);
+ break;
+- case 5: /* jmp far ptr ... */
++ case 5: /* jmp far ptr ... */
+ DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+ TRACE_AND_STEP();
+ HALT_SYS();
+@@ -11388,7 +12024,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ push_long(*destreg);
+- } else {
++ }
++ else {
+ u16 *destreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11407,8 +12044,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ /***************************************************************************
+ * Single byte operation code table:
+ **************************************************************************/
+-void (*x86emu_optab[256])(u8) =
+-{
++void (*x86emu_optab[256]) (u8) = {
+ /* 0x00 */ x86emuOp_add_byte_RM_R,
+ /* 0x01 */ x86emuOp_add_word_RM_R,
+ /* 0x02 */ x86emuOp_add_byte_R_RM,
+@@ -11417,7 +12053,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x05 */ x86emuOp_add_word_AX_IMM,
+ /* 0x06 */ x86emuOp_push_ES,
+ /* 0x07 */ x86emuOp_pop_ES,
+-
+ /* 0x08 */ x86emuOp_or_byte_RM_R,
+ /* 0x09 */ x86emuOp_or_word_RM_R,
+ /* 0x0a */ x86emuOp_or_byte_R_RM,
+@@ -11426,7 +12061,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x0d */ x86emuOp_or_word_AX_IMM,
+ /* 0x0e */ x86emuOp_push_CS,
+ /* 0x0f */ x86emuOp_two_byte,
+-
+ /* 0x10 */ x86emuOp_adc_byte_RM_R,
+ /* 0x11 */ x86emuOp_adc_word_RM_R,
+ /* 0x12 */ x86emuOp_adc_byte_R_RM,
+@@ -11435,7 +12069,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x15 */ x86emuOp_adc_word_AX_IMM,
+ /* 0x16 */ x86emuOp_push_SS,
+ /* 0x17 */ x86emuOp_pop_SS,
+-
+ /* 0x18 */ x86emuOp_sbb_byte_RM_R,
+ /* 0x19 */ x86emuOp_sbb_word_RM_R,
+ /* 0x1a */ x86emuOp_sbb_byte_R_RM,
+@@ -11444,7 +12077,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x1d */ x86emuOp_sbb_word_AX_IMM,
+ /* 0x1e */ x86emuOp_push_DS,
+ /* 0x1f */ x86emuOp_pop_DS,
+-
+ /* 0x20 */ x86emuOp_and_byte_RM_R,
+ /* 0x21 */ x86emuOp_and_word_RM_R,
+ /* 0x22 */ x86emuOp_and_byte_R_RM,
+@@ -11453,7 +12085,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x25 */ x86emuOp_and_word_AX_IMM,
+ /* 0x26 */ x86emuOp_segovr_ES,
+ /* 0x27 */ x86emuOp_daa,
+-
+ /* 0x28 */ x86emuOp_sub_byte_RM_R,
+ /* 0x29 */ x86emuOp_sub_word_RM_R,
+ /* 0x2a */ x86emuOp_sub_byte_R_RM,
+@@ -11462,7 +12093,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x2d */ x86emuOp_sub_word_AX_IMM,
+ /* 0x2e */ x86emuOp_segovr_CS,
+ /* 0x2f */ x86emuOp_das,
+-
+ /* 0x30 */ x86emuOp_xor_byte_RM_R,
+ /* 0x31 */ x86emuOp_xor_word_RM_R,
+ /* 0x32 */ x86emuOp_xor_byte_R_RM,
+@@ -11471,7 +12101,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x35 */ x86emuOp_xor_word_AX_IMM,
+ /* 0x36 */ x86emuOp_segovr_SS,
+ /* 0x37 */ x86emuOp_aaa,
+-
+ /* 0x38 */ x86emuOp_cmp_byte_RM_R,
+ /* 0x39 */ x86emuOp_cmp_word_RM_R,
+ /* 0x3a */ x86emuOp_cmp_byte_R_RM,
+@@ -11480,7 +12109,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x3d */ x86emuOp_cmp_word_AX_IMM,
+ /* 0x3e */ x86emuOp_segovr_DS,
+ /* 0x3f */ x86emuOp_aas,
+-
+ /* 0x40 */ x86emuOp_inc_AX,
+ /* 0x41 */ x86emuOp_inc_CX,
+ /* 0x42 */ x86emuOp_inc_DX,
+@@ -11489,7 +12117,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x45 */ x86emuOp_inc_BP,
+ /* 0x46 */ x86emuOp_inc_SI,
+ /* 0x47 */ x86emuOp_inc_DI,
+-
+ /* 0x48 */ x86emuOp_dec_AX,
+ /* 0x49 */ x86emuOp_dec_CX,
+ /* 0x4a */ x86emuOp_dec_DX,
+@@ -11498,7 +12125,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x4d */ x86emuOp_dec_BP,
+ /* 0x4e */ x86emuOp_dec_SI,
+ /* 0x4f */ x86emuOp_dec_DI,
+-
+ /* 0x50 */ x86emuOp_push_AX,
+ /* 0x51 */ x86emuOp_push_CX,
+ /* 0x52 */ x86emuOp_push_DX,
+@@ -11507,7 +12133,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x55 */ x86emuOp_push_BP,
+ /* 0x56 */ x86emuOp_push_SI,
+ /* 0x57 */ x86emuOp_push_DI,
+-
+ /* 0x58 */ x86emuOp_pop_AX,
+ /* 0x59 */ x86emuOp_pop_CX,
+ /* 0x5a */ x86emuOp_pop_DX,
+@@ -11516,16 +12141,16 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x5d */ x86emuOp_pop_BP,
+ /* 0x5e */ x86emuOp_pop_SI,
+ /* 0x5f */ x86emuOp_pop_DI,
+-
+ /* 0x60 */ x86emuOp_push_all,
+ /* 0x61 */ x86emuOp_pop_all,
+-/* 0x62 */ x86emuOp_illegal_op, /* bound */
+-/* 0x63 */ x86emuOp_illegal_op, /* arpl */
++ /* 0x62 */ x86emuOp_illegal_op,
++ /* bound */
++ /* 0x63 */ x86emuOp_illegal_op,
++ /* arpl */
+ /* 0x64 */ x86emuOp_segovr_FS,
+ /* 0x65 */ x86emuOp_segovr_GS,
+ /* 0x66 */ x86emuOp_prefix_data,
+ /* 0x67 */ x86emuOp_prefix_addr,
+-
+ /* 0x68 */ x86emuOp_push_word_IMM,
+ /* 0x69 */ x86emuOp_imul_word_IMM,
+ /* 0x6a */ x86emuOp_push_byte_IMM,
+@@ -11534,7 +12159,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x6d */ x86emuOp_ins_word,
+ /* 0x6e */ x86emuOp_outs_byte,
+ /* 0x6f */ x86emuOp_outs_word,
+-
+ /* 0x70 */ x86emuOp_jump_near_O,
+ /* 0x71 */ x86emuOp_jump_near_NO,
+ /* 0x72 */ x86emuOp_jump_near_B,
+@@ -11543,7 +12167,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x75 */ x86emuOp_jump_near_NZ,
+ /* 0x76 */ x86emuOp_jump_near_BE,
+ /* 0x77 */ x86emuOp_jump_near_NBE,
+-
+ /* 0x78 */ x86emuOp_jump_near_S,
+ /* 0x79 */ x86emuOp_jump_near_NS,
+ /* 0x7a */ x86emuOp_jump_near_P,
+@@ -11552,7 +12175,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x7d */ x86emuOp_jump_near_NL,
+ /* 0x7e */ x86emuOp_jump_near_LE,
+ /* 0x7f */ x86emuOp_jump_near_NLE,
+-
+ /* 0x80 */ x86emuOp_opc80_byte_RM_IMM,
+ /* 0x81 */ x86emuOp_opc81_word_RM_IMM,
+ /* 0x82 */ x86emuOp_opc82_byte_RM_IMM,
+@@ -11561,7 +12183,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x85 */ x86emuOp_test_word_RM_R,
+ /* 0x86 */ x86emuOp_xchg_byte_RM_R,
+ /* 0x87 */ x86emuOp_xchg_word_RM_R,
+-
+ /* 0x88 */ x86emuOp_mov_byte_RM_R,
+ /* 0x89 */ x86emuOp_mov_word_RM_R,
+ /* 0x8a */ x86emuOp_mov_byte_R_RM,
+@@ -11570,7 +12191,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x8d */ x86emuOp_lea_word_R_M,
+ /* 0x8e */ x86emuOp_mov_word_SR_RM,
+ /* 0x8f */ x86emuOp_pop_RM,
+-
+ /* 0x90 */ x86emuOp_nop,
+ /* 0x91 */ x86emuOp_xchg_word_AX_CX,
+ /* 0x92 */ x86emuOp_xchg_word_AX_DX,
+@@ -11579,7 +12199,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x95 */ x86emuOp_xchg_word_AX_BP,
+ /* 0x96 */ x86emuOp_xchg_word_AX_SI,
+ /* 0x97 */ x86emuOp_xchg_word_AX_DI,
+-
+ /* 0x98 */ x86emuOp_cbw,
+ /* 0x99 */ x86emuOp_cwd,
+ /* 0x9a */ x86emuOp_call_far_IMM,
+@@ -11588,7 +12207,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0x9d */ x86emuOp_popf_word,
+ /* 0x9e */ x86emuOp_sahf,
+ /* 0x9f */ x86emuOp_lahf,
+-
+ /* 0xa0 */ x86emuOp_mov_AL_M_IMM,
+ /* 0xa1 */ x86emuOp_mov_AX_M_IMM,
+ /* 0xa2 */ x86emuOp_mov_M_AL_IMM,
+@@ -11605,8 +12223,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xad */ x86emuOp_lods_word,
+ /* 0xac */ x86emuOp_scas_byte,
+ /* 0xad */ x86emuOp_scas_word,
+-
+-
+ /* 0xb0 */ x86emuOp_mov_byte_AL_IMM,
+ /* 0xb1 */ x86emuOp_mov_byte_CL_IMM,
+ /* 0xb2 */ x86emuOp_mov_byte_DL_IMM,
+@@ -11615,7 +12231,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xb5 */ x86emuOp_mov_byte_CH_IMM,
+ /* 0xb6 */ x86emuOp_mov_byte_DH_IMM,
+ /* 0xb7 */ x86emuOp_mov_byte_BH_IMM,
+-
+ /* 0xb8 */ x86emuOp_mov_word_AX_IMM,
+ /* 0xb9 */ x86emuOp_mov_word_CX_IMM,
+ /* 0xba */ x86emuOp_mov_word_DX_IMM,
+@@ -11624,7 +12239,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xbd */ x86emuOp_mov_word_BP_IMM,
+ /* 0xbe */ x86emuOp_mov_word_SI_IMM,
+ /* 0xbf */ x86emuOp_mov_word_DI_IMM,
+-
+ /* 0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
+ /* 0xc1 */ x86emuOp_opcC1_word_RM_MEM,
+ /* 0xc2 */ x86emuOp_ret_near_IMM,
+@@ -11641,14 +12255,14 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xcd */ x86emuOp_int_IMM,
+ /* 0xce */ x86emuOp_into,
+ /* 0xcf */ x86emuOp_iret,
+-
+ /* 0xd0 */ x86emuOp_opcD0_byte_RM_1,
+ /* 0xd1 */ x86emuOp_opcD1_word_RM_1,
+ /* 0xd2 */ x86emuOp_opcD2_byte_RM_CL,
+ /* 0xd3 */ x86emuOp_opcD3_word_RM_CL,
+ /* 0xd4 */ x86emuOp_aam,
+ /* 0xd5 */ x86emuOp_aad,
+-/* 0xd6 */ x86emuOp_illegal_op, /* Undocumented SETALC instruction */
++ /* 0xd6 */ x86emuOp_illegal_op,
++ /* Undocumented SETALC instruction */
+ /* 0xd7 */ x86emuOp_xlat,
+ /* 0xd8 */ x86emuOp_esc_coprocess_d8,
+ /* 0xd9 */ x86emuOp_esc_coprocess_d9,
+@@ -11658,7 +12272,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xdd */ x86emuOp_esc_coprocess_dd,
+ /* 0xde */ x86emuOp_esc_coprocess_de,
+ /* 0xdf */ x86emuOp_esc_coprocess_df,
+-
+ /* 0xe0 */ x86emuOp_loopne,
+ /* 0xe1 */ x86emuOp_loope,
+ /* 0xe2 */ x86emuOp_loop,
+@@ -11667,7 +12280,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xe5 */ x86emuOp_in_word_AX_IMM,
+ /* 0xe6 */ x86emuOp_out_byte_IMM_AL,
+ /* 0xe7 */ x86emuOp_out_word_IMM_AX,
+-
+ /* 0xe8 */ x86emuOp_call_near_IMM,
+ /* 0xe9 */ x86emuOp_jump_near_IMM,
+ /* 0xea */ x86emuOp_jump_far_IMM,
+@@ -11676,7 +12288,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xed */ x86emuOp_in_word_AX_DX,
+ /* 0xee */ x86emuOp_out_byte_DX_AL,
+ /* 0xef */ x86emuOp_out_word_DX_AX,
+-
+ /* 0xf0 */ x86emuOp_lock,
+ /* 0xf1 */ x86emuOp_illegal_op,
+ /* 0xf2 */ x86emuOp_repne,
+@@ -11685,7 +12296,6 @@ void (*x86emu_optab[256])(u8) =
+ /* 0xf5 */ x86emuOp_cmc,
+ /* 0xf6 */ x86emuOp_opcF6_byte_RM,
+ /* 0xf7 */ x86emuOp_opcF7_word_RM,
+-
+ /* 0xf8 */ x86emuOp_clc,
+ /* 0xf9 */ x86emuOp_stc,
+ /* 0xfa */ x86emuOp_cli,
+diff --git a/libs/x86emu/ops2.c b/libs/x86emu/ops2.c
+index 06b7f56..5ed2bf6 100644
+--- a/libs/x86emu/ops2.c
++++ b/libs/x86emu/ops2.c
+@@ -55,16 +55,14 @@ op1 - Instruction op code
+ REMARKS:
+ Handles illegal opcodes.
+ ****************************************************************************/
+-static void x86emuOp2_illegal_op(
+- u8 op2)
++static void
++x86emuOp2_illegal_op(u8 op2)
+ {
+- int mod, rl, rh;
+- START_OF_INSTR();
+- FETCH_DECODE_MODRM(mod, rh, rl);
+- DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+- TRACE_REGS();
+- printk("%04x:%04x: %02X /%d ILLEGAL EXTENDED X86 OPCODE! (mod=%d rl=%d)\n",
+- M.x86.R_CS, M.x86.R_IP-2,op2, rh, mod, rl);
++ START_OF_INSTR();
++ DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
++ TRACE_REGS();
++ printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
++ M.x86.R_CS, M.x86.R_IP - 2, op2);
+ HALT_SYS();
+ END_OF_INSTR();
+ }
+@@ -73,55 +71,10 @@ static void x86emuOp2_illegal_op(
+
+ /****************************************************************************
+ REMARKS:
+-Handles opcode 0x0f,0x01
+-****************************************************************************/
+-static void x86emuOp2_group_g(u8 X86EMU_UNUSED(op2))
+-{
+- int mod, rl, rh;
+- u16 *destreg;
+- uint destoffset;
+-
+- START_OF_INSTR();
+- FETCH_DECODE_MODRM(mod, rh, rl);
+- switch (rh) {
+- case 4: // SMSW (Store Machine Status Word)
+- // Decode the mod byte to find the addressing
+- // Always returns 0x10 (initial value as per intel manual volume 3, figure 8-1
+- switch (mod) {
+- case 0:
+- destoffset = decode_rm00_address(rl);
+- store_data_word(destoffset, 0x10);
+- break;
+- case 1:
+- destoffset = decode_rm01_address(rl);
+- store_data_word(destoffset, 0x10);
+- break;
+- case 2:
+- destoffset = decode_rm10_address(rl);
+- store_data_word(destoffset, 0x10);
+- break;
+- case 3:
+- destreg = DECODE_RM_WORD_REGISTER(rl);
+- *destreg = 0x10;
+- break;
+- }
+- break;
+- default:
+- DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE IN 0F 01\n");
+- TRACE_REGS();
+- printk("%04x:%04x: 0F %02X /%d ILLEGAL EXTENDED X86 OPCODE! (mod=%d rl=%d)\n",
+- M.x86.R_CS, M.x86.R_IP-2,op2, rh, mod, rl);
+- HALT_SYS();
+- break;
+- }
+- END_OF_INSTR();
+-}
+-
+-/****************************************************************************
+-REMARKS:
+ Handles opcode 0x0f,0x31
+ ****************************************************************************/
+-static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
+ {
+ #ifdef __HAS_LONG_LONG__
+ static u64 counter = 0;
+@@ -155,90 +108,91 @@ static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0x80-0x8F
+ ****************************************************************************/
+-static void x86emuOp2_long_jump(u8 op2)
++static void
++x86emuOp2_long_jump(u8 op2)
+ {
+ s32 target;
+- char *name = 0;
++ const char *name = NULL;
+ int cond = 0;
+
+ /* conditional jump to word offset. */
+ START_OF_INSTR();
+ switch (op2) {
+- case 0x80:
++ case 0x80:
+ name = "JO\t";
+- cond = ACCESS_FLAG(F_OF);
++ cond = ACCESS_FLAG(F_OF);
+ break;
+- case 0x81:
++ case 0x81:
+ name = "JNO\t";
+ cond = !ACCESS_FLAG(F_OF);
+ break;
+- case 0x82:
++ case 0x82:
+ name = "JB\t";
+ cond = ACCESS_FLAG(F_CF);
+ break;
+- case 0x83:
++ case 0x83:
+ name = "JNB\t";
+ cond = !ACCESS_FLAG(F_CF);
+ break;
+- case 0x84:
++ case 0x84:
+ name = "JZ\t";
+ cond = ACCESS_FLAG(F_ZF);
+ break;
+- case 0x85:
++ case 0x85:
+ name = "JNZ\t";
+ cond = !ACCESS_FLAG(F_ZF);
+ break;
+- case 0x86:
++ case 0x86:
+ name = "JBE\t";
+ cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+ break;
+- case 0x87:
++ case 0x87:
+ name = "JNBE\t";
+ cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+ break;
+- case 0x88:
++ case 0x88:
+ name = "JS\t";
+ cond = ACCESS_FLAG(F_SF);
+ break;
+- case 0x89:
++ case 0x89:
+ name = "JNS\t";
+ cond = !ACCESS_FLAG(F_SF);
+ break;
+- case 0x8a:
++ case 0x8a:
+ name = "JP\t";
+ cond = ACCESS_FLAG(F_PF);
+ break;
+- case 0x8b:
++ case 0x8b:
+ name = "JNP\t";
+ cond = !ACCESS_FLAG(F_PF);
+ break;
+- case 0x8c:
++ case 0x8c:
+ name = "JL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+- case 0x8d:
++ case 0x8d:
+ name = "JNL\t";
+ cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)));
+ break;
+- case 0x8e:
++ case 0x8e:
+ name = "JLE\t";
+ cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+- case 0x8f:
++ case 0x8f:
+ name = "JNLE\t";
+ cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ }
+ DECODE_PRINTF(name);
+- (void)name;
++ (void) name;
+ target = (s16) fetch_word_imm();
+ target += (s16) M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", target);
+ TRACE_AND_STEP();
+ if (cond)
+- M.x86.R_IP = (u16)target;
++ M.x86.R_IP = (u16) target;
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+ }
+@@ -247,85 +201,86 @@ static void x86emuOp2_long_jump(u8 op2)
+ REMARKS:
+ Handles opcode 0x0f,0x90-0x9F
+ ****************************************************************************/
+-static void x86emuOp2_set_byte(u8 op2)
++static void
++x86emuOp2_set_byte(u8 op2)
+ {
+ int mod, rl, rh;
+ uint destoffset;
+- u8 *destreg;
+- char *name = 0;
++ u8 *destreg;
++ const char *name = NULL;
+ int cond = 0;
+
+ START_OF_INSTR();
+ switch (op2) {
+- case 0x90:
++ case 0x90:
+ name = "SETO\t";
+- cond = ACCESS_FLAG(F_OF);
++ cond = ACCESS_FLAG(F_OF);
+ break;
+- case 0x91:
++ case 0x91:
+ name = "SETNO\t";
+ cond = !ACCESS_FLAG(F_OF);
+ break;
+- case 0x92:
++ case 0x92:
+ name = "SETB\t";
+ cond = ACCESS_FLAG(F_CF);
+ break;
+- case 0x93:
++ case 0x93:
+ name = "SETNB\t";
+ cond = !ACCESS_FLAG(F_CF);
+ break;
+- case 0x94:
++ case 0x94:
+ name = "SETZ\t";
+ cond = ACCESS_FLAG(F_ZF);
+ break;
+- case 0x95:
++ case 0x95:
+ name = "SETNZ\t";
+ cond = !ACCESS_FLAG(F_ZF);
+ break;
+- case 0x96:
++ case 0x96:
+ name = "SETBE\t";
+ cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+ break;
+- case 0x97:
++ case 0x97:
+ name = "SETNBE\t";
+ cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+ break;
+- case 0x98:
++ case 0x98:
+ name = "SETS\t";
+ cond = ACCESS_FLAG(F_SF);
+ break;
+- case 0x99:
++ case 0x99:
+ name = "SETNS\t";
+ cond = !ACCESS_FLAG(F_SF);
+ break;
+- case 0x9a:
++ case 0x9a:
+ name = "SETP\t";
+ cond = ACCESS_FLAG(F_PF);
+ break;
+- case 0x9b:
++ case 0x9b:
+ name = "SETNP\t";
+ cond = !ACCESS_FLAG(F_PF);
+ break;
+- case 0x9c:
++ case 0x9c:
+ name = "SETL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+- case 0x9d:
++ case 0x9d:
+ name = "SETNL\t";
+ cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+ break;
+- case 0x9e:
++ case 0x9e:
+ name = "SETLE\t";
+ cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+- case 0x9f:
++ case 0x9f:
+ name = "SETNLE\t";
+ cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+ ACCESS_FLAG(F_ZF));
+ break;
+ }
+ DECODE_PRINTF(name);
+- (void)name;
++ (void) name;
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (mod) {
+ case 0:
+@@ -343,7 +298,7 @@ static void x86emuOp2_set_byte(u8 op2)
+ TRACE_AND_STEP();
+ store_data_byte(destoffset, cond ? 0x01 : 0x00);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_BYTE_REGISTER(rl);
+ TRACE_AND_STEP();
+ *destreg = cond ? 0x01 : 0x00;
+@@ -357,7 +312,8 @@ static void x86emuOp2_set_byte(u8 op2)
+ REMARKS:
+ Handles opcode 0x0f,0xa0
+ ****************************************************************************/
+-static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tFS\n");
+@@ -371,7 +327,8 @@ static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa1
+ ****************************************************************************/
+-static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tFS\n");
+@@ -385,7 +342,8 @@ static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+ REMARKS: CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output
+ Handles opcode 0x0f,0xa2
+ ****************************************************************************/
+-static void x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("CPUID\n");
+@@ -399,11 +357,12 @@ static void x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa3
+ ****************************************************************************/
+-static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+- int bit,disp;
++ int bit, disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BT\t");
+@@ -419,10 +378,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+- } else {
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++ }
++ else {
+ u16 srcval;
+ u16 *shiftreg;
+
+@@ -431,9 +391,9 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+ }
+ break;
+ case 1:
+@@ -446,10 +406,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+- } else {
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++ }
++ else {
+ u16 srcval;
+ u16 *shiftreg;
+
+@@ -458,9 +419,9 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+ }
+ break;
+ case 2:
+@@ -473,10 +434,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+- } else {
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++ }
++ else {
+ u16 srcval;
+ u16 *shiftreg;
+
+@@ -485,30 +447,31 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *srcreg,*shiftreg;
++ u32 *srcreg, *shiftreg;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+- } else {
+- u16 *srcreg,*shiftreg;
++ CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF);
++ }
++ else {
++ u16 *srcreg, *shiftreg;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
++ CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF);
+ }
+ break;
+ }
+@@ -520,11 +483,12 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa4
+ ****************************************************************************/
+-static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+- u8 shift;
++ u8 shift;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+@@ -543,9 +507,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,shift);
++ destval = shld_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -557,7 +522,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,shift);
++ destval = shld_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -574,9 +539,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,shift);
++ destval = shld_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -588,7 +554,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,shift);
++ destval = shld_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -605,9 +571,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,shift);
++ destval = shld_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -619,13 +586,13 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,shift);
++ destval = shld_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*shiftreg;
++ u32 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -634,9 +601,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+- *destreg = shld_long(*destreg,*shiftreg,shift);
+- } else {
+- u16 *destreg,*shiftreg;
++ *destreg = shld_long(*destreg, *shiftreg, shift);
++ }
++ else {
++ u16 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -645,7 +613,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+- *destreg = shld_word(*destreg,*shiftreg,shift);
++ *destreg = shld_word(*destreg, *shiftreg, shift);
+ }
+ break;
+ }
+@@ -657,7 +625,8 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa5
+ ****************************************************************************/
+-static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -677,9 +646,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -689,7 +659,7 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -704,9 +674,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -716,7 +687,7 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -731,9 +702,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -743,29 +715,30 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*shiftreg;
++ u32 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+- *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
+- } else {
+- u16 *destreg,*shiftreg;
++ *destreg = shld_long(*destreg, *shiftreg, M.x86.R_CL);
++ }
++ else {
++ u16 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+- *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
++ *destreg = shld_word(*destreg, *shiftreg, M.x86.R_CL);
+ }
+ break;
+ }
+@@ -777,7 +750,8 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa8
+ ****************************************************************************/
+-static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("PUSH\tGS\n");
+@@ -791,7 +765,8 @@ static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa9
+ ****************************************************************************/
+-static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("POP\tGS\n");
+@@ -805,11 +780,12 @@ static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xab
+ ****************************************************************************/
+-static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+- int bit,disp;
++ int bit, disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BTS\t");
+@@ -817,7 +793,7 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+@@ -825,13 +801,14 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval | mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval | mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+@@ -839,16 +816,16 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, srcval | mask);
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, srcval | mask);
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+@@ -856,13 +833,14 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval | mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval | mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+@@ -870,16 +848,16 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, srcval | mask);
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, srcval | mask);
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+@@ -887,51 +865,53 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval | mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval | mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, srcval | mask);
+- }
+- break;
+- case 3: /* register to register */
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *srcreg,*shiftreg;
+- u32 mask;
+-
+- srcreg = DECODE_RM_LONG_REGISTER(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0x1F;
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- *srcreg |= mask;
+- } else {
+- u16 *srcreg,*shiftreg;
+- u16 mask;
+-
+- srcreg = DECODE_RM_WORD_REGISTER(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, srcval | mask);
++ }
++ break;
++ case 3: /* register to register */
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 *srcreg, *shiftreg;
++ u32 mask;
++
++ srcreg = DECODE_RM_LONG_REGISTER(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0x1F;
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ *srcreg |= mask;
++ }
++ else {
++ u16 *srcreg, *shiftreg;
++ u16 mask;
++
++ srcreg = DECODE_RM_WORD_REGISTER(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
+ *srcreg |= mask;
+ }
+ break;
+@@ -944,11 +924,12 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xac
+ ****************************************************************************/
+-static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+- u8 shift;
++ u8 shift;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("SHLD\t");
+@@ -967,9 +948,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,shift);
++ destval = shrd_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -981,7 +963,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,shift);
++ destval = shrd_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -998,9 +980,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,shift);
++ destval = shrd_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -1012,7 +995,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,shift);
++ destval = shrd_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -1029,9 +1012,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,shift);
++ destval = shrd_long(destval, *shiftreg, shift);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -1043,13 +1027,13 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,shift);
++ destval = shrd_word(destval, *shiftreg, shift);
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*shiftreg;
++ u32 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1058,9 +1042,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+- *destreg = shrd_long(*destreg,*shiftreg,shift);
+- } else {
+- u16 *destreg,*shiftreg;
++ *destreg = shrd_long(*destreg, *shiftreg, shift);
++ }
++ else {
++ u16 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+@@ -1069,7 +1054,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ shift = fetch_byte_imm();
+ DECODE_PRINTF2("%d\n", shift);
+ TRACE_AND_STEP();
+- *destreg = shrd_word(*destreg,*shiftreg,shift);
++ *destreg = shrd_word(*destreg, *shiftreg, shift);
+ }
+ break;
+ }
+@@ -1081,7 +1066,8 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xad
+ ****************************************************************************/
+-static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint destoffset;
+@@ -1101,9 +1087,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -1113,7 +1100,7 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -1128,9 +1115,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -1140,7 +1128,7 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+@@ -1155,9 +1143,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_long(destoffset);
+- destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+ store_data_long(destoffset, destval);
+- } else {
++ }
++ else {
+ u16 destval;
+ u16 *shiftreg;
+
+@@ -1167,29 +1156,30 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+ destval = fetch_data_word(destoffset);
+- destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++ destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+ store_data_word(destoffset, destval);
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*shiftreg;
++ u32 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+- *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
+- } else {
+- u16 *destreg,*shiftreg;
++ *destreg = shrd_long(*destreg, *shiftreg, M.x86.R_CL);
++ }
++ else {
++ u16 *destreg, *shiftreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",CL\n");
+ TRACE_AND_STEP();
+- *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
++ *destreg = shrd_word(*destreg, *shiftreg, M.x86.R_CL);
+ }
+ break;
+ }
+@@ -1201,7 +1191,8 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xaf
+ ****************************************************************************/
+-static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1214,23 +1205,25 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++ imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -1240,38 +1233,41 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ srcoffset = decode_rm00_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+- res = (s16)*destreg * (s16)srcval;
++ res = (s16) * destreg * (s16) srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++ imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -1281,38 +1277,41 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ srcoffset = decode_rm01_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+- res = (s16)*destreg * (s16)srcval;
++ res = (s16) * destreg * (s16) srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+ u32 srcval;
+- u32 res_lo,res_hi;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_long(srcoffset);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++ imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
++ *destreg = (u32) res_lo;
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+ u32 res;
+@@ -1322,51 +1321,55 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ srcoffset = decode_rm10_address(rl);
+ srcval = fetch_data_word(srcoffset);
+ TRACE_AND_STEP();
+- res = (s16)*destreg * (s16)srcval;
++ res = (s16) * destreg * (s16) srcval;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *destreg,*srcreg;
+- u32 res_lo,res_hi;
++ u32 *destreg, *srcreg;
++ u32 res_lo, res_hi;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ TRACE_AND_STEP();
+- imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
++ imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) * srcreg);
+ if (res_hi != 0) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u32)res_lo;
+- } else {
+- u16 *destreg,*srcreg;
++ *destreg = (u32) res_lo;
++ }
++ else {
++ u16 *destreg, *srcreg;
+ u32 res;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+- res = (s16)*destreg * (s16)*srcreg;
++ res = (s16) * destreg * (s16) * srcreg;
+ if (res > 0xFFFF) {
+ SET_FLAG(F_CF);
+ SET_FLAG(F_OF);
+- } else {
++ }
++ else {
+ CLEAR_FLAG(F_CF);
+ CLEAR_FLAG(F_OF);
+ }
+- *destreg = (u16)res;
++ *destreg = (u16) res;
+ }
+ break;
+ }
+@@ -1378,9 +1381,10 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb2
+ ****************************************************************************/
+-static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+- int mod, rh, rl;
++ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+@@ -1415,7 +1419,7 @@ static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_SS = fetch_data_word(srcoffset + 2);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+@@ -1427,148 +1431,154 @@ static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb3
+ ****************************************************************************/
+-static void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
+ {
+- int mod, rl, rh;
+- uint srcoffset;
+- int bit,disp;
+-
+- START_OF_INSTR();
+- DECODE_PRINTF("BTR\t");
+- FETCH_DECODE_MODRM(mod, rh, rl);
+- switch (mod) {
+- case 0:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
+- u32 *shiftreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval & ~mask);
+- } else {
+- u16 srcval,mask;
+- u16 *shiftreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+- }
+- break;
+- case 1:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
+- u32 *shiftreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval & ~mask);
+- } else {
+- u16 srcval,mask;
+- u16 *shiftreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+- }
+- break;
+- case 2:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
+- u32 *shiftreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval & ~mask);
+- } else {
+- u16 srcval,mask;
+- u16 *shiftreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+- }
+- break;
+- case 3: /* register to register */
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *srcreg,*shiftreg;
+- u32 mask;
+-
+- srcreg = DECODE_RM_LONG_REGISTER(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0x1F;
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- *srcreg &= ~mask;
+- } else {
+- u16 *srcreg,*shiftreg;
+- u16 mask;
+-
+- srcreg = DECODE_RM_WORD_REGISTER(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- *srcreg &= ~mask;
+- }
+- break;
+- }
+- DECODE_CLEAR_SEGOVR();
+- END_OF_INSTR();
++ int mod, rl, rh;
++ uint srcoffset;
++ int bit, disp;
++
++ START_OF_INSTR();
++ DECODE_PRINTF("BTR\t");
++ FETCH_DECODE_MODRM(mod, rh, rl);
++ switch (mod) {
++ case 0:
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, mask;
++ u32 *shiftreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0x1F;
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval & ~mask);
++ }
++ else {
++ u16 srcval, mask;
++ u16 *shiftreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++ }
++ break;
++ case 1:
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, mask;
++ u32 *shiftreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0x1F;
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval & ~mask);
++ }
++ else {
++ u16 srcval, mask;
++ u16 *shiftreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++ }
++ break;
++ case 2:
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, mask;
++ u32 *shiftreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0x1F;
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval & ~mask);
++ }
++ else {
++ u16 srcval, mask;
++ u16 *shiftreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++ }
++ break;
++ case 3: /* register to register */
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 *srcreg, *shiftreg;
++ u32 mask;
++
++ srcreg = DECODE_RM_LONG_REGISTER(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0x1F;
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ *srcreg &= ~mask;
++ }
++ else {
++ u16 *srcreg, *shiftreg;
++ u16 mask;
++
++ srcreg = DECODE_RM_WORD_REGISTER(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ *srcreg &= ~mask;
++ }
++ break;
++ }
++ DECODE_CLEAR_SEGOVR();
++ END_OF_INSTR();
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x0f,0xb4
+ ****************************************************************************/
+-static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+- int mod, rh, rl;
++ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+@@ -1603,7 +1613,7 @@ static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_FS = fetch_data_word(srcoffset + 2);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+@@ -1615,9 +1625,10 @@ static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb5
+ ****************************************************************************/
+-static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+- int mod, rh, rl;
++ int mod, rh, rl;
+ u16 *dstreg;
+ uint srcoffset;
+
+@@ -1652,7 +1663,7 @@ static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+ *dstreg = fetch_data_word(srcoffset);
+ M.x86.R_GS = fetch_data_word(srcoffset + 2);
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ /* UNDEFINED! */
+ TRACE_AND_STEP();
+ }
+@@ -1664,7 +1675,8 @@ static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb6
+ ****************************************************************************/
+-static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1685,7 +1697,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1710,7 +1723,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1735,7 +1749,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+@@ -1748,10 +1763,10 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ *destreg = srcval;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+- u8 *srcreg;
++ u8 *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1759,9 +1774,10 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = *srcreg;
+- } else {
++ }
++ else {
+ u16 *destreg;
+- u8 *srcreg;
++ u8 *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+@@ -1780,7 +1796,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb7
+ ****************************************************************************/
+-static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1819,7 +1836,7 @@ static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -1836,7 +1853,8 @@ static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xba
+ ****************************************************************************/
+-static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -1846,23 +1864,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ FETCH_DECODE_MODRM(mod, rh, rl);
+ switch (rh) {
+ case 4:
+- DECODE_PRINTF("BT\t");
+- break;
++ DECODE_PRINTF("BT\t");
++ break;
+ case 5:
+- DECODE_PRINTF("BTS\t");
+- break;
++ DECODE_PRINTF("BTS\t");
++ break;
+ case 6:
+- DECODE_PRINTF("BTR\t");
+- break;
++ DECODE_PRINTF("BTR\t");
++ break;
+ case 7:
+- DECODE_PRINTF("BTC\t");
+- break;
++ DECODE_PRINTF("BTC\t");
++ break;
+ default:
+- DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+- TRACE_REGS();
+- printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
+- M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
+- HALT_SYS();
++ DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
++ TRACE_REGS();
++ printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
++ M.x86.R_CS, M.x86.R_IP - 3, op2, (mod << 6) | (rh << 3) | rl);
++ HALT_SYS();
+ }
+ switch (mod) {
+ case 0:
+@@ -1876,22 +1894,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_long(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_long(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_long(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
+- } else {
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_long(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_long(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_long(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
++ }
++ else {
+ u16 srcval, mask;
+ u8 shift;
+
+@@ -1901,21 +1920,21 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_word(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_word(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_word(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_word(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_word(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_word(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
+ }
+ break;
+ case 1:
+@@ -1929,22 +1948,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_long(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_long(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_long(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
+- } else {
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_long(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_long(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_long(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
++ }
++ else {
+ u16 srcval, mask;
+ u8 shift;
+
+@@ -1954,21 +1974,21 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_word(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_word(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_word(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_word(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_word(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_word(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
+ }
+ break;
+ case 2:
+@@ -1982,22 +2002,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+ srcval = fetch_data_long(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_long(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_long(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_long(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
+- } else {
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_long(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_long(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_long(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
++ }
++ else {
+ u16 srcval, mask;
+ u8 shift;
+
+@@ -2007,74 +2028,75 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+ srcval = fetch_data_word(srcoffset);
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- switch (rh) {
+- case 5:
+- store_data_word(srcoffset, srcval | mask);
+- break;
+- case 6:
+- store_data_word(srcoffset, srcval & ~mask);
+- break;
+- case 7:
+- store_data_word(srcoffset, srcval ^ mask);
+- break;
+- default:
+- break;
+- }
+- }
+- break;
+- case 3: /* register to register */
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ switch (rh) {
++ case 5:
++ store_data_word(srcoffset, srcval | mask);
++ break;
++ case 6:
++ store_data_word(srcoffset, srcval & ~mask);
++ break;
++ case 7:
++ store_data_word(srcoffset, srcval ^ mask);
++ break;
++ default:
++ break;
++ }
++ }
++ break;
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *srcreg;
+- u32 mask;
+- u8 shift;
++ u32 mask;
++ u8 shift;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0x1F;
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- switch (rh) {
+- case 5:
+- *srcreg |= mask;
+- break;
+- case 6:
+- *srcreg &= ~mask;
+- break;
+- case 7:
+- *srcreg ^= mask;
+- break;
+- default:
+- break;
+- }
+- } else {
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ switch (rh) {
++ case 5:
++ *srcreg |= mask;
++ break;
++ case 6:
++ *srcreg &= ~mask;
++ break;
++ case 7:
++ *srcreg ^= mask;
++ break;
++ default:
++ break;
++ }
++ }
++ else {
+ u16 *srcreg;
+- u16 mask;
+- u8 shift;
++ u16 mask;
++ u8 shift;
+
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF(",");
+ shift = fetch_byte_imm();
+ TRACE_AND_STEP();
+ bit = shift & 0xF;
+- mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- switch (rh) {
+- case 5:
+- *srcreg |= mask;
+- break;
+- case 6:
+- *srcreg &= ~mask;
+- break;
+- case 7:
+- *srcreg ^= mask;
+- break;
+- default:
+- break;
+- }
++ mask = (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ switch (rh) {
++ case 5:
++ *srcreg |= mask;
++ break;
++ case 6:
++ *srcreg &= ~mask;
++ break;
++ case 7:
++ *srcreg ^= mask;
++ break;
++ default:
++ break;
++ }
+ }
+ break;
+ }
+@@ -2086,11 +2108,12 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbb
+ ****************************************************************************/
+-static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+- int bit,disp;
++ int bit, disp;
+
+ START_OF_INSTR();
+ DECODE_PRINTF("BTC\t");
+@@ -2098,7 +2121,7 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ switch (mod) {
+ case 0:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+@@ -2106,13 +2129,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval ^ mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval ^ mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm00_address(rl);
+@@ -2120,16 +2144,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+ }
+ break;
+ case 1:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+@@ -2137,13 +2161,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval ^ mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval ^ mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm01_address(rl);
+@@ -2151,16 +2176,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+ }
+ break;
+ case 2:
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval,mask;
++ u32 srcval, mask;
+ u32 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+@@ -2168,13 +2193,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_LONG_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+- disp = (s16)*shiftreg >> 5;
+- srcval = fetch_data_long(srcoffset+disp);
++ disp = (s16) * shiftreg >> 5;
++ srcval = fetch_data_long(srcoffset + disp);
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_long(srcoffset+disp, srcval ^ mask);
+- } else {
+- u16 srcval,mask;
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_long(srcoffset + disp, srcval ^ mask);
++ }
++ else {
++ u16 srcval, mask;
+ u16 *shiftreg;
+
+ srcoffset = decode_rm10_address(rl);
+@@ -2182,16 +2208,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ shiftreg = DECODE_RM_WORD_REGISTER(rh);
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0xF;
+- disp = (s16)*shiftreg >> 4;
+- srcval = fetch_data_word(srcoffset+disp);
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+- store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++ disp = (s16) * shiftreg >> 4;
++ srcval = fetch_data_word(srcoffset + disp);
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++ store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 *srcreg,*shiftreg;
++ u32 *srcreg, *shiftreg;
+ u32 mask;
+
+ srcreg = DECODE_RM_LONG_REGISTER(rl);
+@@ -2200,19 +2226,20 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ TRACE_AND_STEP();
+ bit = *shiftreg & 0x1F;
+ mask = (0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+- *srcreg ^= mask;
+- } else {
+- u16 *srcreg,*shiftreg;
+- u16 mask;
+-
+- srcreg = DECODE_RM_WORD_REGISTER(rl);
+- DECODE_PRINTF(",");
+- shiftreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- bit = *shiftreg & 0xF;
+- mask = (u16)(0x1 << bit);
+- CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++ *srcreg ^= mask;
++ }
++ else {
++ u16 *srcreg, *shiftreg;
++ u16 mask;
++
++ srcreg = DECODE_RM_WORD_REGISTER(rl);
++ DECODE_PRINTF(",");
++ shiftreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ bit = *shiftreg & 0xF;
++ mask = (u16) (0x1 << bit);
++ CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
+ *srcreg ^= mask;
+ }
+ break;
+@@ -2225,7 +2252,8 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbc
+ ****************************************************************************/
+-static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2233,105 +2261,117 @@ static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+ START_OF_INSTR();
+ DECODE_PRINTF("BSF\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+- switch(mod) {
++ switch (mod) {
+ case 0:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ case 1:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ case 2:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
+- case 3: /* register to register */
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcval = *DECODE_RM_LONG_REGISTER(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcval = *DECODE_RM_WORD_REGISTER(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
++ case 3: /* register to register */
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcval = *DECODE_RM_LONG_REGISTER(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcval = *DECODE_RM_WORD_REGISTER(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -2341,7 +2381,8 @@ static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbd
+ ****************************************************************************/
+-static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2349,105 +2390,117 @@ static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+ START_OF_INSTR();
+ DECODE_PRINTF("BSR\t");
+ FETCH_DECODE_MODRM(mod, rh, rl);
+- switch(mod) {
++ switch (mod) {
+ case 0:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm00_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm00_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ case 1:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm01_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm01_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ case 2:
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_long(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcoffset = decode_rm10_address(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- srcval = fetch_data_word(srcoffset);
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
+- case 3: /* register to register */
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- u32 srcval, *dstreg;
+-
+- srcval = *DECODE_RM_LONG_REGISTER(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_LONG_REGISTER(rh);
+- TRACE_AND_STEP();
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- } else {
+- u16 srcval, *dstreg;
+-
+- srcval = *DECODE_RM_WORD_REGISTER(rl);
+- DECODE_PRINTF(",");
+- dstreg = DECODE_RM_WORD_REGISTER(rh);
+- TRACE_AND_STEP();
+- CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+- for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+- if ((srcval >> *dstreg) & 1) break;
+- }
+- break;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_long(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcoffset = decode_rm10_address(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ srcval = fetch_data_word(srcoffset);
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
++ case 3: /* register to register */
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ u32 srcval, *dstreg;
++
++ srcval = *DECODE_RM_LONG_REGISTER(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_LONG_REGISTER(rh);
++ TRACE_AND_STEP();
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ else {
++ u16 srcval, *dstreg;
++
++ srcval = *DECODE_RM_WORD_REGISTER(rl);
++ DECODE_PRINTF(",");
++ dstreg = DECODE_RM_WORD_REGISTER(rh);
++ TRACE_AND_STEP();
++ CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++ for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++ if ((srcval >> *dstreg) & 1)
++ break;
++ }
++ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+ END_OF_INSTR();
+@@ -2457,7 +2510,8 @@ static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbe
+ ****************************************************************************/
+-static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2474,18 +2528,19 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+- srcval = (s32)((s8)fetch_data_byte(srcoffset));
++ srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+- srcval = (s16)((s8)fetch_data_byte(srcoffset));
++ srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+@@ -2499,18 +2554,19 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+- srcval = (s32)((s8)fetch_data_byte(srcoffset));
++ srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+- srcval = (s16)((s8)fetch_data_byte(srcoffset));
++ srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+@@ -2524,44 +2580,46 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+- srcval = (s32)((s8)fetch_data_byte(srcoffset));
++ srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+- } else {
++ }
++ else {
+ u16 *destreg;
+ u16 srcval;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+- srcval = (s16)((s8)fetch_data_byte(srcoffset));
++ srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ }
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ u32 *destreg;
+- u8 *srcreg;
++ u8 *srcreg;
+
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- *destreg = (s32)((s8)*srcreg);
+- } else {
++ *destreg = (s32) ((s8) * srcreg);
++ }
++ else {
+ u16 *destreg;
+- u8 *srcreg;
++ u8 *srcreg;
+
+ destreg = DECODE_RM_WORD_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_BYTE_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- *destreg = (s16)((s8)*srcreg);
++ *destreg = (s16) ((s8) * srcreg);
+ }
+ break;
+ }
+@@ -2573,7 +2631,8 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbf
+ ****************************************************************************/
+-static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+ int mod, rl, rh;
+ uint srcoffset;
+@@ -2589,7 +2648,7 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm00_address(rl);
+- srcval = (s32)((s16)fetch_data_word(srcoffset));
++ srcval = (s32) ((s16) fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+@@ -2598,7 +2657,7 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm01_address(rl);
+- srcval = (s32)((s16)fetch_data_word(srcoffset));
++ srcval = (s32) ((s16) fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+@@ -2607,18 +2666,18 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcoffset = decode_rm10_address(rl);
+- srcval = (s32)((s16)fetch_data_word(srcoffset));
++ srcval = (s32) ((s16) fetch_data_word(srcoffset));
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+ *destreg = srcval;
+ break;
+- case 3: /* register to register */
++ case 3: /* register to register */
+ destreg = DECODE_RM_LONG_REGISTER(rh);
+ DECODE_PRINTF(",");
+ srcreg = DECODE_RM_WORD_REGISTER(rl);
+ DECODE_PRINTF("\n");
+ TRACE_AND_STEP();
+- *destreg = (s32)((s16)*srcreg);
++ *destreg = (s32) ((s16) * srcreg);
+ break;
+ }
+ DECODE_CLEAR_SEGOVR();
+@@ -2626,40 +2685,41 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ }
+
+ /* Handles opcodes 0xc8-0xcf */
+-static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
+ {
+ START_OF_INSTR();
+ DECODE_PRINTF("BSWAP\n");
+ TRACE_AND_STEP();
+
+ switch (op2) {
+- case 0xc8:
+- M.x86.R_EAX = bswap_32(M.x86.R_EAX);
+- break;
+- case 0xc9:
+- M.x86.R_ECX = bswap_32(M.x86.R_ECX);
+- break;
+- case 0xca:
+- M.x86.R_EDX = bswap_32(M.x86.R_EDX);
+- break;
+- case 0xcb:
+- M.x86.R_EBX = bswap_32(M.x86.R_EBX);
+- break;
+- case 0xcc:
+- M.x86.R_ESP = bswap_32(M.x86.R_ESP);
+- break;
+- case 0xcd:
+- M.x86.R_EBP = bswap_32(M.x86.R_EBP);
+- break;
+- case 0xce:
+- M.x86.R_ESI = bswap_32(M.x86.R_ESI);
+- break;
+- case 0xcf:
+- M.x86.R_EDI = bswap_32(M.x86.R_EDI);
+- break;
+- default:
+- /* can't happen */
+- break;
++ case 0xc8:
++ M.x86.R_EAX = bswap_32(M.x86.R_EAX);
++ break;
++ case 0xc9:
++ M.x86.R_ECX = bswap_32(M.x86.R_ECX);
++ break;
++ case 0xca:
++ M.x86.R_EDX = bswap_32(M.x86.R_EDX);
++ break;
++ case 0xcb:
++ M.x86.R_EBX = bswap_32(M.x86.R_EBX);
++ break;
++ case 0xcc:
++ M.x86.R_ESP = bswap_32(M.x86.R_ESP);
++ break;
++ case 0xcd:
++ M.x86.R_EBP = bswap_32(M.x86.R_EBP);
++ break;
++ case 0xce:
++ M.x86.R_ESI = bswap_32(M.x86.R_ESI);
++ break;
++ case 0xcf:
++ M.x86.R_EDI = bswap_32(M.x86.R_EDI);
++ break;
++ default:
++ /* can't happen */
++ break;
+ }
+
+ DECODE_CLEAR_SEGOVR();
+@@ -2669,25 +2729,32 @@ static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
+ /***************************************************************************
+ * Double byte operation code table:
+ **************************************************************************/
+-void (*x86emu_optab2[256])(u8) =
+-{
+-/* 0x00 */ x86emuOp2_illegal_op, /* Group F (ring 0 PM) */
+-/* 0x01 */ x86emuOp2_group_g, /* Group G (ring 0 PM) */
+-/* 0x02 */ x86emuOp2_illegal_op, /* lar (ring 0 PM) */
+-/* 0x03 */ x86emuOp2_illegal_op, /* lsl (ring 0 PM) */
++void (*x86emu_optab2[256]) (u8) = {
++ /* 0x00 */ x86emuOp2_illegal_op,
++ /* Group F (ring 0 PM) */
++ /* 0x01 */ x86emuOp2_illegal_op,
++ /* Group G (ring 0 PM) */
++ /* 0x02 */ x86emuOp2_illegal_op,
++ /* lar (ring 0 PM) */
++ /* 0x03 */ x86emuOp2_illegal_op,
++ /* lsl (ring 0 PM) */
+ /* 0x04 */ x86emuOp2_illegal_op,
+-/* 0x05 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
+-/* 0x06 */ x86emuOp2_illegal_op, /* clts (ring 0 PM) */
+-/* 0x07 */ x86emuOp2_illegal_op, /* loadall (undocumented) */
+-/* 0x08 */ x86emuOp2_illegal_op, /* invd (ring 0 PM) */
+-/* 0x09 */ x86emuOp2_illegal_op, /* wbinvd (ring 0 PM) */
++ /* 0x05 */ x86emuOp2_illegal_op,
++ /* loadall (undocumented) */
++ /* 0x06 */ x86emuOp2_illegal_op,
++ /* clts (ring 0 PM) */
++ /* 0x07 */ x86emuOp2_illegal_op,
++ /* loadall (undocumented) */
++ /* 0x08 */ x86emuOp2_illegal_op,
++ /* invd (ring 0 PM) */
++ /* 0x09 */ x86emuOp2_illegal_op,
++ /* wbinvd (ring 0 PM) */
+ /* 0x0a */ x86emuOp2_illegal_op,
+ /* 0x0b */ x86emuOp2_illegal_op,
+ /* 0x0c */ x86emuOp2_illegal_op,
+ /* 0x0d */ x86emuOp2_illegal_op,
+ /* 0x0e */ x86emuOp2_illegal_op,
+ /* 0x0f */ x86emuOp2_illegal_op,
+-
+ /* 0x10 */ x86emuOp2_illegal_op,
+ /* 0x11 */ x86emuOp2_illegal_op,
+ /* 0x12 */ x86emuOp2_illegal_op,
+@@ -2704,14 +2771,19 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x1d */ x86emuOp2_illegal_op,
+ /* 0x1e */ x86emuOp2_illegal_op,
+ /* 0x1f */ x86emuOp2_illegal_op,
+-
+-/* 0x20 */ x86emuOp2_illegal_op, /* mov reg32,creg (ring 0 PM) */
+-/* 0x21 */ x86emuOp2_illegal_op, /* mov reg32,dreg (ring 0 PM) */
+-/* 0x22 */ x86emuOp2_illegal_op, /* mov creg,reg32 (ring 0 PM) */
+-/* 0x23 */ x86emuOp2_illegal_op, /* mov dreg,reg32 (ring 0 PM) */
+-/* 0x24 */ x86emuOp2_illegal_op, /* mov reg32,treg (ring 0 PM) */
++ /* 0x20 */ x86emuOp2_illegal_op,
++ /* mov reg32,creg (ring 0 PM) */
++ /* 0x21 */ x86emuOp2_illegal_op,
++ /* mov reg32,dreg (ring 0 PM) */
++ /* 0x22 */ x86emuOp2_illegal_op,
++ /* mov creg,reg32 (ring 0 PM) */
++ /* 0x23 */ x86emuOp2_illegal_op,
++ /* mov dreg,reg32 (ring 0 PM) */
++ /* 0x24 */ x86emuOp2_illegal_op,
++ /* mov reg32,treg (ring 0 PM) */
+ /* 0x25 */ x86emuOp2_illegal_op,
+-/* 0x26 */ x86emuOp2_illegal_op, /* mov treg,reg32 (ring 0 PM) */
++ /* 0x26 */ x86emuOp2_illegal_op,
++ /* mov treg,reg32 (ring 0 PM) */
+ /* 0x27 */ x86emuOp2_illegal_op,
+ /* 0x28 */ x86emuOp2_illegal_op,
+ /* 0x29 */ x86emuOp2_illegal_op,
+@@ -2721,7 +2793,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x2d */ x86emuOp2_illegal_op,
+ /* 0x2e */ x86emuOp2_illegal_op,
+ /* 0x2f */ x86emuOp2_illegal_op,
+-
+ /* 0x30 */ x86emuOp2_illegal_op,
+ /* 0x31 */ x86emuOp2_rdtsc,
+ /* 0x32 */ x86emuOp2_illegal_op,
+@@ -2738,7 +2809,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x3d */ x86emuOp2_illegal_op,
+ /* 0x3e */ x86emuOp2_illegal_op,
+ /* 0x3f */ x86emuOp2_illegal_op,
+-
+ /* 0x40 */ x86emuOp2_illegal_op,
+ /* 0x41 */ x86emuOp2_illegal_op,
+ /* 0x42 */ x86emuOp2_illegal_op,
+@@ -2755,7 +2825,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x4d */ x86emuOp2_illegal_op,
+ /* 0x4e */ x86emuOp2_illegal_op,
+ /* 0x4f */ x86emuOp2_illegal_op,
+-
+ /* 0x50 */ x86emuOp2_illegal_op,
+ /* 0x51 */ x86emuOp2_illegal_op,
+ /* 0x52 */ x86emuOp2_illegal_op,
+@@ -2772,7 +2841,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x5d */ x86emuOp2_illegal_op,
+ /* 0x5e */ x86emuOp2_illegal_op,
+ /* 0x5f */ x86emuOp2_illegal_op,
+-
+ /* 0x60 */ x86emuOp2_illegal_op,
+ /* 0x61 */ x86emuOp2_illegal_op,
+ /* 0x62 */ x86emuOp2_illegal_op,
+@@ -2789,7 +2857,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x6d */ x86emuOp2_illegal_op,
+ /* 0x6e */ x86emuOp2_illegal_op,
+ /* 0x6f */ x86emuOp2_illegal_op,
+-
+ /* 0x70 */ x86emuOp2_illegal_op,
+ /* 0x71 */ x86emuOp2_illegal_op,
+ /* 0x72 */ x86emuOp2_illegal_op,
+@@ -2806,7 +2873,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x7d */ x86emuOp2_illegal_op,
+ /* 0x7e */ x86emuOp2_illegal_op,
+ /* 0x7f */ x86emuOp2_illegal_op,
+-
+ /* 0x80 */ x86emuOp2_long_jump,
+ /* 0x81 */ x86emuOp2_long_jump,
+ /* 0x82 */ x86emuOp2_long_jump,
+@@ -2823,7 +2889,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x8d */ x86emuOp2_long_jump,
+ /* 0x8e */ x86emuOp2_long_jump,
+ /* 0x8f */ x86emuOp2_long_jump,
+-
+ /* 0x90 */ x86emuOp2_set_byte,
+ /* 0x91 */ x86emuOp2_set_byte,
+ /* 0x92 */ x86emuOp2_set_byte,
+@@ -2840,7 +2905,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0x9d */ x86emuOp2_set_byte,
+ /* 0x9e */ x86emuOp2_set_byte,
+ /* 0x9f */ x86emuOp2_set_byte,
+-
+ /* 0xa0 */ x86emuOp2_push_FS,
+ /* 0xa1 */ x86emuOp2_pop_FS,
+ /* 0xa2 */ x86emuOp2_cpuid,
+@@ -2857,9 +2921,10 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0xad */ x86emuOp2_shrd_CL,
+ /* 0xae */ x86emuOp2_illegal_op,
+ /* 0xaf */ x86emuOp2_imul_R_RM,
+-
+-/* 0xb0 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
+-/* 0xb1 */ x86emuOp2_illegal_op, /* TODO: cmpxchg */
++ /* 0xb0 */ x86emuOp2_illegal_op,
++ /* TODO: cmpxchg */
++ /* 0xb1 */ x86emuOp2_illegal_op,
++ /* TODO: cmpxchg */
+ /* 0xb2 */ x86emuOp2_lss_R_IMM,
+ /* 0xb3 */ x86emuOp2_btr_R,
+ /* 0xb4 */ x86emuOp2_lfs_R_IMM,
+@@ -2874,9 +2939,10 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0xbd */ x86emuOp2_bsr,
+ /* 0xbe */ x86emuOp2_movsx_byte_R_RM,
+ /* 0xbf */ x86emuOp2_movsx_word_R_RM,
+-
+-/* 0xc0 */ x86emuOp2_illegal_op, /* TODO: xadd */
+-/* 0xc1 */ x86emuOp2_illegal_op, /* TODO: xadd */
++ /* 0xc0 */ x86emuOp2_illegal_op,
++ /* TODO: xadd */
++ /* 0xc1 */ x86emuOp2_illegal_op,
++ /* TODO: xadd */
+ /* 0xc2 */ x86emuOp2_illegal_op,
+ /* 0xc3 */ x86emuOp2_illegal_op,
+ /* 0xc4 */ x86emuOp2_illegal_op,
+@@ -2891,7 +2957,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0xcd */ x86emuOp2_bswap,
+ /* 0xce */ x86emuOp2_bswap,
+ /* 0xcf */ x86emuOp2_bswap,
+-
+ /* 0xd0 */ x86emuOp2_illegal_op,
+ /* 0xd1 */ x86emuOp2_illegal_op,
+ /* 0xd2 */ x86emuOp2_illegal_op,
+@@ -2908,7 +2973,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0xdd */ x86emuOp2_illegal_op,
+ /* 0xde */ x86emuOp2_illegal_op,
+ /* 0xdf */ x86emuOp2_illegal_op,
+-
+ /* 0xe0 */ x86emuOp2_illegal_op,
+ /* 0xe1 */ x86emuOp2_illegal_op,
+ /* 0xe2 */ x86emuOp2_illegal_op,
+@@ -2925,7 +2989,6 @@ void (*x86emu_optab2[256])(u8) =
+ /* 0xed */ x86emuOp2_illegal_op,
+ /* 0xee */ x86emuOp2_illegal_op,
+ /* 0xef */ x86emuOp2_illegal_op,
+-
+ /* 0xf0 */ x86emuOp2_illegal_op,
+ /* 0xf1 */ x86emuOp2_illegal_op,
+ /* 0xf2 */ x86emuOp2_illegal_op,
+diff --git a/libs/x86emu/prim_ops.c b/libs/x86emu/prim_ops.c
+index ff17c3f..24f76b4 100644
+--- a/libs/x86emu/prim_ops.c
++++ b/libs/x86emu/prim_ops.c
+@@ -102,18 +102,23 @@
+ #define PRIM_OPS_NO_REDEFINE_ASM
+ #include "x86emu/x86emui.h"
+
++#if defined(__GNUC__)
++#if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__)
++#include "x86emu/prim_x86_gcc.h"
++#endif
++#endif
++
+ /*------------------------- Global Variables ------------------------------*/
+
+-static u32 x86emu_parity_tab[8] =
+-{
+- 0x96696996,
+- 0x69969669,
+- 0x69969669,
+- 0x96696996,
+- 0x69969669,
+- 0x96696996,
+- 0x96696996,
+- 0x69969669,
++static u32 x86emu_parity_tab[8] = {
++ 0x96696996,
++ 0x69969669,
++ 0x69969669,
++ 0x96696996,
++ 0x69969669,
++ 0x96696996,
++ 0x96696996,
++ 0x69969669,
+ };
+
+ #define PARITY(x) (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
+@@ -125,88 +130,96 @@ static u32 x86emu_parity_tab[8] =
+ REMARKS:
+ Implements the AAA instruction and side effects.
+ ****************************************************************************/
+-u16 aaa_word(u16 d)
++u16
++aaa_word(u16 d)
+ {
+- u16 res;
+- if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+- d += 0x6;
+- d += 0x100;
+- SET_FLAG(F_AF);
+- SET_FLAG(F_CF);
+- } else {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- }
+- res = (u16)(d & 0xFF0F);
+- CLEAR_FLAG(F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return res;
++ u16 res;
++
++ if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
++ d += 0x6;
++ d += 0x100;
++ SET_FLAG(F_AF);
++ SET_FLAG(F_CF);
++ }
++ else {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ }
++ res = (u16) (d & 0xFF0F);
++ CLEAR_FLAG(F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the AAA instruction and side effects.
+ ****************************************************************************/
+-u16 aas_word(u16 d)
++u16
++aas_word(u16 d)
+ {
+- u16 res;
+- if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+- d -= 0x6;
+- d -= 0x100;
+- SET_FLAG(F_AF);
+- SET_FLAG(F_CF);
+- } else {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- }
+- res = (u16)(d & 0xFF0F);
+- CLEAR_FLAG(F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return res;
++ u16 res;
++
++ if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
++ d -= 0x6;
++ d -= 0x100;
++ SET_FLAG(F_AF);
++ SET_FLAG(F_CF);
++ }
++ else {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ }
++ res = (u16) (d & 0xFF0F);
++ CLEAR_FLAG(F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the AAD instruction and side effects.
+ ****************************************************************************/
+-u16 aad_word(u16 d)
++u16
++aad_word(u16 d)
+ {
+- u16 l;
+- u8 hb, lb;
++ u16 l;
++ u8 hb, lb;
+
+- hb = (u8)((d >> 8) & 0xff);
+- lb = (u8)((d & 0xff));
+- l = (u16)((lb + 10 * hb) & 0xFF);
++ hb = (u8) ((d >> 8) & 0xff);
++ lb = (u8) ((d & 0xff));
++ l = (u16) ((lb + 10 * hb) & 0xFF);
+
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+- return l;
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(l == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
++ return l;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the AAM instruction and side effects.
+ ****************************************************************************/
+-u16 aam_word(u8 d)
++u16
++aam_word(u8 d)
+ {
+ u16 h, l;
+
+- h = (u16)(d / 10);
+- l = (u16)(d % 10);
+- l |= (u16)(h << 8);
++ h = (u16) (d / 10);
++ l = (u16) (d % 10);
++ l |= (u16) (h << 8);
+
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(l == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+ return l;
+ }
+
+@@ -214,155 +227,161 @@ u16 aam_word(u8 d)
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u8 adc_byte(u8 d, u8 s)
++u8
++adc_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- if (ACCESS_FLAG(F_CF))
+- res = 1 + d + s;
+- else
+- res = d + s;
++ if (ACCESS_FLAG(F_CF))
++ res = 1 + d + s;
++ else
++ res = d + s;
+
+- CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (s & d) | ((~res) & (s | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u16 adc_word(u16 d, u16 s)
++u16
++adc_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- if (ACCESS_FLAG(F_CF))
+- res = 1 + d + s;
+- else
+- res = d + s;
++ if (ACCESS_FLAG(F_CF))
++ res = 1 + d + s;
++ else
++ res = d + s;
+
+- CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u16)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (s & d) | ((~res) & (s | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u32 adc_long(u32 d, u32 s)
++u32
++adc_long(u32 d, u32 s)
+ {
+- register u32 lo; /* all operands in native machine order */
+- register u32 hi;
+- register u32 res;
+- register u32 cc;
++ register u32 lo; /* all operands in native machine order */
++ register u32 hi;
++ register u32 res;
++ register u32 cc;
+
+- if (ACCESS_FLAG(F_CF)) {
+- lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
+- res = 1 + d + s;
+- }
+- else {
+- lo = (d & 0xFFFF) + (s & 0xFFFF);
+- res = d + s;
+- }
+- hi = (lo >> 16) + (d >> 16) + (s >> 16);
++ if (ACCESS_FLAG(F_CF)) {
++ lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
++ res = 1 + d + s;
++ }
++ else {
++ lo = (d & 0xFFFF) + (s & 0xFFFF);
++ res = d + s;
++ }
++ hi = (lo >> 16) + (d >> 16) + (s >> 16);
+
+- CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (s & d) | ((~res) & (s | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u8 add_byte(u8 d, u8 s)
++u8
++add_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- res = d + s;
+- CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d + s;
++ CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (s & d) | ((~res) & (s | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u16 add_word(u16 d, u16 s)
++u16
++add_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- res = d + s;
+- CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d + s;
++ CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u16)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (s & d) | ((~res) & (s | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u32 add_long(u32 d, u32 s)
++u32
++add_long(u32 d, u32 s)
+ {
+- register u32 lo; /* all operands in native machine order */
+- register u32 hi;
+- register u32 res;
+- register u32 cc;
++ register u32 lo; /* all operands in native machine order */
++ register u32 hi;
++ register u32 res;
++ register u32 cc;
+
+- lo = (d & 0xFFFF) + (s & 0xFFFF);
+- res = d + s;
+- hi = (lo >> 16) + (d >> 16) + (s >> 16);
++ lo = (d & 0xFFFF) + (s & 0xFFFF);
++ res = d + s;
++ hi = (lo >> 16) + (d >> 16) + (s >> 16);
+
+- CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the carry chain SEE NOTE AT TOP. */
+ cc = (s & d) | ((~res) & (s | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+
+ return res;
+ }
+@@ -371,39 +390,41 @@ u32 add_long(u32 d, u32 s)
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u8 and_byte(u8 d, u8 s)
++u8
++and_byte(u8 d, u8 s)
+ {
+- register u8 res; /* all operands in native machine order */
++ register u8 res; /* all operands in native machine order */
+
+- res = d & s;
++ res = d & s;
+
+- /* set the flags */
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+- return res;
++ /* set the flags */
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u16 and_word(u16 d, u16 s)
++u16
++and_word(u16 d, u16 s)
+ {
+- register u16 res; /* all operands in native machine order */
++ register u16 res; /* all operands in native machine order */
+
+ res = d & s;
+
+ /* set the flags */
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ return res;
+ }
+
+@@ -411,433 +432,456 @@ u16 and_word(u16 d, u16 s)
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u32 and_long(u32 d, u32 s)
++u32
++and_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+- res = d & s;
++ res = d & s;
+
+- /* set the flags */
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return res;
++ /* set the flags */
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u8 cmp_byte(u8 d, u8 s)
++u8
++cmp_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- res = d - s;
+- CLEAR_FLAG(F_CF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d - s;
++ CLEAR_FLAG(F_CF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return d;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return d;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u16 cmp_word(u16 d, u16 s)
++u16
++cmp_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d - s;
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
++ /* calculate the borrow chain. See note at top */
+ bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return d;
++ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return d;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u32 cmp_long(u32 d, u32 s)
++u32
++cmp_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d - s;
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return d;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return d;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DAA instruction and side effects.
+ ****************************************************************************/
+-u8 daa_byte(u8 d)
++u8
++daa_byte(u8 d)
+ {
+- u32 res = d;
+- if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+- res += 6;
+- SET_FLAG(F_AF);
+- }
+- if (res > 0x9F || ACCESS_FLAG(F_CF)) {
+- res += 0x60;
+- SET_FLAG(F_CF);
+- }
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return (u8)res;
++ u32 res = d;
++
++ if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
++ res += 6;
++ SET_FLAG(F_AF);
++ }
++ if (res > 0x9F || ACCESS_FLAG(F_CF)) {
++ res += 0x60;
++ SET_FLAG(F_CF);
++ }
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DAS instruction and side effects.
+ ****************************************************************************/
+-u8 das_byte(u8 d)
++u8
++das_byte(u8 d)
+ {
+- if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+- d -= 6;
+- SET_FLAG(F_AF);
+- }
+- if (d > 0x9F || ACCESS_FLAG(F_CF)) {
+- d -= 0x60;
+- SET_FLAG(F_CF);
+- }
+- CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(d == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
+- return d;
++ if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
++ d -= 6;
++ SET_FLAG(F_AF);
++ }
++ if (d > 0x9F || ACCESS_FLAG(F_CF)) {
++ d -= 0x60;
++ SET_FLAG(F_CF);
++ }
++ CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(d == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
++ return d;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u8 dec_byte(u8 d)
++u8
++dec_byte(u8 d)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- /* based on sub_byte, uses s==1. */
+- bc = (res & (~d | 1)) | (~d & 1);
+- /* carry flag unchanged */
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the borrow chain. See note at top */
++ /* based on sub_byte, uses s==1. */
++ bc = (res & (~d | 1)) | (~d & 1);
++ /* carry flag unchanged */
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u16 dec_word(u16 d)
++u16
++dec_word(u16 d)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+ /* based on the sub_byte routine, with s==1 */
+ bc = (res & (~d | 1)) | (~d & 1);
+ /* carry flag unchanged */
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u16)res;
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u32 dec_long(u32 d)
++u32
++dec_long(u32 d)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - 1;
+
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+ /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | 1)) | (~d & 1);
+- /* carry flag unchanged */
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++ bc = (res & (~d | 1)) | (~d & 1);
++ /* carry flag unchanged */
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u8 inc_byte(u8 d)
++u8
++inc_byte(u8 d)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- res = d + 1;
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d + 1;
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = ((1 & d) | (~res)) & (1 | d);
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = ((1 & d) | (~res)) & (1 | d);
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u16 inc_word(u16 d)
++u16
++inc_word(u16 d)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- res = d + 1;
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d + 1;
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (1 & d) | ((~res) & (1 | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return (u16)res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (1 & d) | ((~res) & (1 | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u32 inc_long(u32 d)
++u32
++inc_long(u32 d)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 cc;
++ register u32 res; /* all operands in native machine order */
++ register u32 cc;
+
+- res = d + 1;
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d + 1;
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the carry chain SEE NOTE AT TOP. */
+- cc = (1 & d) | ((~res) & (1 | d));
+- CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+- return res;
++ /* calculate the carry chain SEE NOTE AT TOP. */
++ cc = (1 & d) | ((~res) & (1 | d));
++ CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u8 or_byte(u8 d, u8 s)
++u8
++or_byte(u8 d, u8 s)
+ {
+- register u8 res; /* all operands in native machine order */
++ register u8 res; /* all operands in native machine order */
+
+- res = d | s;
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+- return res;
++ res = d | s;
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u16 or_word(u16 d, u16 s)
++u16
++or_word(u16 d, u16 s)
+ {
+- register u16 res; /* all operands in native machine order */
++ register u16 res; /* all operands in native machine order */
+
+- res = d | s;
+- /* set the carry flag to be bit 8 */
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return res;
++ res = d | s;
++ /* set the carry flag to be bit 8 */
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u32 or_long(u32 d, u32 s)
++u32
++or_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+- res = d | s;
++ res = d | s;
+
+- /* set the carry flag to be bit 8 */
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- return res;
++ /* set the carry flag to be bit 8 */
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u8 neg_byte(u8 s)
++u8
++neg_byte(u8 s)
+ {
+ register u8 res;
+ register u8 bc;
+
+- CONDITIONAL_SET_FLAG(s != 0, F_CF);
+- res = (u8)-s;
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+- /* calculate the borrow chain --- modified such that d=0.
+- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+- (the one used for sub) and simplifying, since ~d=0xff...,
+- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+- ~d&s == s. So the simplified result is: */
+- bc = res | s;
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++ CONDITIONAL_SET_FLAG(s != 0, F_CF);
++ res = (u8) - s;
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++ /* calculate the borrow chain --- modified such that d=0.
++ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
++ (the one used for sub) and simplifying, since ~d=0xff...,
++ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
++ ~d&s == s. So the simplified result is: */
++ bc = res | s;
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u16 neg_word(u16 s)
+-{
+- register u16 res;
+- register u16 bc;
+-
+- CONDITIONAL_SET_FLAG(s != 0, F_CF);
+- res = (u16)-s;
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-
+- /* calculate the borrow chain --- modified such that d=0.
+- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+- (the one used for sub) and simplifying, since ~d=0xff...,
+- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+- ~d&s == s. So the simplified result is: */
+- bc = res | s;
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++u16
++neg_word(u16 s)
++{
++ register u16 res;
++ register u16 bc;
++
++ CONDITIONAL_SET_FLAG(s != 0, F_CF);
++ res = (u16) - s;
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++
++ /* calculate the borrow chain --- modified such that d=0.
++ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
++ (the one used for sub) and simplifying, since ~d=0xff...,
++ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
++ ~d&s == s. So the simplified result is: */
++ bc = res | s;
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u32 neg_long(u32 s)
++u32
++neg_long(u32 s)
+ {
+- register u32 res;
+- register u32 bc;
+-
+- CONDITIONAL_SET_FLAG(s != 0, F_CF);
+- res = (u32)-s;
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ register u32 res;
++ register u32 bc;
+
+- /* calculate the borrow chain --- modified such that d=0.
+- substitutiing d=0 into bc= res&(~d|s)|(~d&s);
+- (the one used for sub) and simplifying, since ~d=0xff...,
+- ~d|s == 0xffff..., and res&0xfff... == res. Similarly
+- ~d&s == s. So the simplified result is: */
+- bc = res | s;
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++ CONDITIONAL_SET_FLAG(s != 0, F_CF);
++ res = (u32) - s;
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++
++ /* calculate the borrow chain --- modified such that d=0.
++ substitutiing d=0 into bc= res&(~d|s)|(~d&s);
++ (the one used for sub) and simplifying, since ~d=0xff...,
++ ~d|s == 0xffff..., and res&0xfff... == res. Similarly
++ ~d&s == s. So the simplified result is: */
++ bc = res | s;
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u8 not_byte(u8 s)
++u8
++not_byte(u8 s)
+ {
+- return ~s;
++ return ~s;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u16 not_word(u16 s)
++u16
++not_word(u16 s)
+ {
+- return ~s;
++ return ~s;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u32 not_long(u32 s)
++u32
++not_long(u32 s)
+ {
+- return ~s;
++ return ~s;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u8 rcl_byte(u8 d, u8 s)
++u8
++rcl_byte(u8 d, u8 s)
+ {
+ register unsigned int res, cnt, mask, cf;
+
+ /* s is the rotate distance. It varies from 0 - 8. */
+- /* have
++ /* have
+
+ CF B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0
+
+@@ -861,9 +905,9 @@ u8 rcl_byte(u8 d, u8 s)
+ 2) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0
+ 3) B_(n-1) <- cf
+ 4) B_(n-2) .. B_0 <- b_7 .. b_(8-(n-1))
+- */
+- res = d;
+- if ((cnt = s % 9) != 0) {
++ */
++ res = d;
++ if ((cnt = s % 9) != 0) {
+ /* extract the new CARRY FLAG. */
+ /* CF <- b_(8-n) */
+ cf = (d >> (8 - cnt)) & 0x1;
+@@ -872,7 +916,7 @@ u8 rcl_byte(u8 d, u8 s)
+ into the range B_7 .. B_cnt */
+ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_0 */
+ /* note that the right hand side done by the mask */
+- res = (d << cnt) & 0xff;
++ res = (d << cnt) & 0xff;
+
+ /* now the high stuff which rotated around
+ into the positions B_cnt-2 .. B_0 */
+@@ -884,81 +928,81 @@ u8 rcl_byte(u8 d, u8 s)
+ res |= (d >> (9 - cnt)) & mask;
+
+ /* if the carry flag was set, or it in. */
+- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
++ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ /* B_(n-1) <- cf */
+ res |= 1 << (cnt - 1);
+ }
+ /* set the new carry flag, based on the variable "cf" */
+- CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cf, F_CF);
+ /* OVERFLOW is set *IFF* cnt==1, then it is the
+ xor of CF and the most significant bit. Blecck. */
+ /* parenthesized this expression since it appears to
+ be causing OF to be misset */
+- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
+- F_OF);
++ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)), F_OF);
+
+ }
+- return (u8)res;
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u16 rcl_word(u16 d, u8 s)
++u16
++rcl_word(u16 d, u8 s)
+ {
+- register unsigned int res, cnt, mask, cf;
++ register unsigned int res, cnt, mask, cf;
+
+- res = d;
+- if ((cnt = s % 17) != 0) {
+- cf = (d >> (16 - cnt)) & 0x1;
+- res = (d << cnt) & 0xffff;
+- mask = (1 << (cnt - 1)) - 1;
+- res |= (d >> (17 - cnt)) & mask;
+- if (ACCESS_FLAG(F_CF)) {
+- res |= 1 << (cnt - 1);
+- }
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
+- F_OF);
+- }
+- return (u16)res;
++ res = d;
++ if ((cnt = s % 17) != 0) {
++ cf = (d >> (16 - cnt)) & 0x1;
++ res = (d << cnt) & 0xffff;
++ mask = (1 << (cnt - 1)) - 1;
++ res |= (d >> (17 - cnt)) & mask;
++ if (ACCESS_FLAG(F_CF)) {
++ res |= 1 << (cnt - 1);
++ }
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)), F_OF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u32 rcl_long(u32 d, u8 s)
++u32
++rcl_long(u32 d, u8 s)
+ {
+- register u32 res, cnt, mask, cf;
++ register u32 res, cnt, mask, cf;
+
+- res = d;
+- if ((cnt = s % 33) != 0) {
+- cf = (d >> (32 - cnt)) & 0x1;
+- res = (d << cnt) & 0xffffffff;
+- mask = (1 << (cnt - 1)) - 1;
+- res |= (d >> (33 - cnt)) & mask;
+- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+- res |= 1 << (cnt - 1);
+- }
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
+- F_OF);
+- }
+- return res;
++ res = d;
++ if ((cnt = s % 33) != 0) {
++ cf = (d >> (32 - cnt)) & 0x1;
++ res = (d << cnt) & 0xffffffff;
++ mask = (1 << (cnt - 1)) - 1;
++ res |= (d >> (33 - cnt)) & mask;
++ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
++ res |= 1 << (cnt - 1);
++ }
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)), F_OF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u8 rcr_byte(u8 d, u8 s)
++u8
++rcr_byte(u8 d, u8 s)
+ {
+- u32 res, cnt;
+- u32 mask, cf, ocf = 0;
++ u32 res, cnt;
++ u32 mask, cf, ocf = 0;
+
+- /* rotate right through carry */
++ /* rotate right through carry */
+ /*
+ s is the rotate distance. It varies from 0 - 8.
+ d is the byte object rotated.
+@@ -979,9 +1023,9 @@ u8 rcr_byte(u8 d, u8 s)
+ 2) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
+ 3) B_(8-n) <- cf
+ 4) B_(7) .. B_(8-(n-1)) <- b_(n-2) .. b_(0)
+- */
+- res = d;
+- if ((cnt = s % 9) != 0) {
++ */
++ res = d;
++ if ((cnt = s % 9) != 0) {
+ /* extract the new CARRY FLAG. */
+ /* CF <- b_(n-1) */
+ if (cnt == 1) {
+@@ -990,11 +1034,12 @@ u8 rcr_byte(u8 d, u8 s)
+ 0 if flag not set
+ non-zero if flag is set.
+ doing access_flag(..) != 0 casts that into either
+- 0..1 in any representation of the flags register
++ 0..1 in any representation of the flags register
+ (i.e. packed bit array or unpacked.)
+ */
+- ocf = ACCESS_FLAG(F_CF) != 0;
+- } else
++ ocf = ACCESS_FLAG(F_CF) != 0;
++ }
++ else
+ cf = (d >> (cnt - 1)) & 0x1;
+
+ /* B_(8-(n+1)) .. B_(0) <- b_(7) .. b_n */
+@@ -1016,93 +1061,95 @@ u8 rcr_byte(u8 d, u8 s)
+ res |= (d << (9 - cnt));
+
+ /* if the carry flag was set, or it in. */
+- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
++ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+ /* B_(8-n) <- cf */
+ res |= 1 << (8 - cnt);
+ }
+ /* set the new carry flag, based on the variable "cf" */
+- CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cf, F_CF);
+ /* OVERFLOW is set *IFF* cnt==1, then it is the
+ xor of CF and the most significant bit. Blecck. */
+ /* parenthesized... */
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
+- F_OF);
+- }
+- }
+- return (u8)res;
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)), F_OF);
++ }
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u16 rcr_word(u16 d, u8 s)
++u16
++rcr_word(u16 d, u8 s)
+ {
+- u32 res, cnt;
+- u32 mask, cf, ocf = 0;
++ u32 res, cnt;
++ u32 mask, cf, ocf = 0;
+
+- /* rotate right through carry */
+- res = d;
+- if ((cnt = s % 17) != 0) {
+- if (cnt == 1) {
+- cf = d & 0x1;
+- ocf = ACCESS_FLAG(F_CF) != 0;
+- } else
+- cf = (d >> (cnt - 1)) & 0x1;
+- mask = (1 << (16 - cnt)) - 1;
+- res = (d >> cnt) & mask;
+- res |= (d << (17 - cnt));
+- if (ACCESS_FLAG(F_CF)) {
+- res |= 1 << (16 - cnt);
+- }
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
+- F_OF);
+- }
+- }
+- return (u16)res;
++ /* rotate right through carry */
++ res = d;
++ if ((cnt = s % 17) != 0) {
++ if (cnt == 1) {
++ cf = d & 0x1;
++ ocf = ACCESS_FLAG(F_CF) != 0;
++ }
++ else
++ cf = (d >> (cnt - 1)) & 0x1;
++ mask = (1 << (16 - cnt)) - 1;
++ res = (d >> cnt) & mask;
++ res |= (d << (17 - cnt));
++ if (ACCESS_FLAG(F_CF)) {
++ res |= 1 << (16 - cnt);
++ }
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)), F_OF);
++ }
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u32 rcr_long(u32 d, u8 s)
+-{
+- u32 res, cnt;
+- u32 mask, cf, ocf = 0;
+-
+- /* rotate right through carry */
+- res = d;
+- if ((cnt = s % 33) != 0) {
+- if (cnt == 1) {
+- cf = d & 0x1;
+- ocf = ACCESS_FLAG(F_CF) != 0;
+- } else
+- cf = (d >> (cnt - 1)) & 0x1;
+- mask = (1 << (32 - cnt)) - 1;
+- res = (d >> cnt) & mask;
+- if (cnt != 1)
+- res |= (d << (33 - cnt));
+- if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
+- res |= 1 << (32 - cnt);
+- }
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
+- F_OF);
+- }
+- }
+- return res;
++u32
++rcr_long(u32 d, u8 s)
++{
++ u32 res, cnt;
++ u32 mask, cf, ocf = 0;
++
++ /* rotate right through carry */
++ res = d;
++ if ((cnt = s % 33) != 0) {
++ if (cnt == 1) {
++ cf = d & 0x1;
++ ocf = ACCESS_FLAG(F_CF) != 0;
++ }
++ else
++ cf = (d >> (cnt - 1)) & 0x1;
++ mask = (1 << (32 - cnt)) - 1;
++ res = (d >> cnt) & mask;
++ if (cnt != 1)
++ res |= (d << (33 - cnt));
++ if (ACCESS_FLAG(F_CF)) { /* carry flag is set */
++ res |= 1 << (32 - cnt);
++ }
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)), F_OF);
++ }
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u8 rol_byte(u8 d, u8 s)
++u8
++rol_byte(u8 d, u8 s)
+ {
+ register unsigned int res, cnt, mask;
+
+@@ -1121,87 +1168,90 @@ u8 rol_byte(u8 d, u8 s)
+ IF n > 0
+ 1) B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0)
+ 2) B_(n-1) .. B_(0) <- b_(7) .. b_(8-n)
+- */
++ */
+ res = d;
+- if ((cnt = s % 8) != 0) {
+- /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */
+- res = (d << cnt);
++ if ((cnt = s % 8) != 0) {
++ /* B_(7) .. B_(n) <- b_(8-(n+1)) .. b_(0) */
++ res = (d << cnt);
+
+- /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */
+- mask = (1 << cnt) - 1;
+- res |= (d >> (8 - cnt)) & mask;
++ /* B_(n-1) .. B_(0) <- b_(7) .. b_(8-n) */
++ mask = (1 << cnt) - 1;
++ res |= (d >> (8 - cnt)) & mask;
+
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- /* OVERFLOW is set *IFF* s==1, then it is the
+- xor of CF and the most significant bit. Blecck. */
+- CONDITIONAL_SET_FLAG(s == 1 &&
+- XOR2((res & 0x1) + ((res >> 6) & 0x2)),
+- F_OF);
+- } if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- }
+- return (u8)res;
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ /* OVERFLOW is set *IFF* s==1, then it is the
++ xor of CF and the most significant bit. Blecck. */
++ CONDITIONAL_SET_FLAG(s == 1 &&
++ XOR2((res & 0x1) + ((res >> 6) & 0x2)), F_OF);
++ }
++ if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u16 rol_word(u16 d, u8 s)
++u16
++rol_word(u16 d, u8 s)
+ {
+ register unsigned int res, cnt, mask;
+
+- res = d;
+- if ((cnt = s % 16) != 0) {
+- res = (d << cnt);
+- mask = (1 << cnt) - 1;
+- res |= (d >> (16 - cnt)) & mask;
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- CONDITIONAL_SET_FLAG(s == 1 &&
+- XOR2((res & 0x1) + ((res >> 14) & 0x2)),
+- F_OF);
+- } if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- }
+- return (u16)res;
++ res = d;
++ if ((cnt = s % 16) != 0) {
++ res = (d << cnt);
++ mask = (1 << cnt) - 1;
++ res |= (d >> (16 - cnt)) & mask;
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ CONDITIONAL_SET_FLAG(s == 1 &&
++ XOR2((res & 0x1) + ((res >> 14) & 0x2)), F_OF);
++ }
++ if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u32 rol_long(u32 d, u8 s)
++u32
++rol_long(u32 d, u8 s)
+ {
+ register u32 res, cnt, mask;
+
+- res = d;
+- if ((cnt = s % 32) != 0) {
+- res = (d << cnt);
+- mask = (1 << cnt) - 1;
+- res |= (d >> (32 - cnt)) & mask;
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- CONDITIONAL_SET_FLAG(s == 1 &&
+- XOR2((res & 0x1) + ((res >> 30) & 0x2)),
+- F_OF);
+- } if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+- }
+- return res;
++ res = d;
++ if ((cnt = s % 32) != 0) {
++ res = (d << cnt);
++ mask = (1 << cnt) - 1;
++ res |= (d >> (32 - cnt)) & mask;
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ CONDITIONAL_SET_FLAG(s == 1 &&
++ XOR2((res & 0x1) + ((res >> 30) & 0x2)), F_OF);
++ }
++ if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u8 ror_byte(u8 d, u8 s)
++u8
++ror_byte(u8 d, u8 s)
+ {
+ register unsigned int res, cnt, mask;
+
+@@ -1219,9 +1269,9 @@ u8 ror_byte(u8 d, u8 s)
+ IF n > 0
+ 1) B_(8-(n+1)) .. B_(0) <- b_(7) .. b_(n)
+ 2) B_(7) .. B_(8-n) <- b_(n-1) .. b_(0)
+- */
+- res = d;
+- if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */
++ */
++ res = d;
++ if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */
+ /* B_(7) .. B_(8-n) <- b_(n-1) .. b_(0) */
+ res = (d << (8 - cnt));
+
+@@ -1231,291 +1281,317 @@ u8 ror_byte(u8 d, u8 s)
+
+ /* set the new carry flag, Note that it is the low order
+ bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+- /* OVERFLOW is set *IFF* s==1, then it is the
++ CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
++ /* OVERFLOW is set *IFF* s==1, then it is the
+ xor of the two most significant bits. Blecck. */
+- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
+- } else if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+- }
+- return (u8)res;
++ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
++ }
++ else if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u16 ror_word(u16 d, u8 s)
++u16
++ror_word(u16 d, u8 s)
+ {
+ register unsigned int res, cnt, mask;
+
+- res = d;
+- if ((cnt = s % 16) != 0) {
+- res = (d << (16 - cnt));
+- mask = (1 << (16 - cnt)) - 1;
+- res |= (d >> (cnt)) & mask;
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
+- } else if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+- }
+- return (u16)res;
++ res = d;
++ if ((cnt = s % 16) != 0) {
++ res = (d << (16 - cnt));
++ mask = (1 << (16 - cnt)) - 1;
++ res |= (d >> (cnt)) & mask;
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
++ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
++ }
++ else if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u32 ror_long(u32 d, u8 s)
++u32
++ror_long(u32 d, u8 s)
+ {
+- register u32 res, cnt, mask;
++ register u32 res, cnt, mask;
+
+- res = d;
+- if ((cnt = s % 32) != 0) {
+- res = (d << (32 - cnt));
+- mask = (1 << (32 - cnt)) - 1;
+- res |= (d >> (cnt)) & mask;
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+- CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
+- } else if (s != 0) {
+- /* set the new carry flag, Note that it is the low order
+- bit of the result!!! */
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+- }
+- return res;
++ res = d;
++ if ((cnt = s % 32) != 0) {
++ res = (d << (32 - cnt));
++ mask = (1 << (32 - cnt)) - 1;
++ res |= (d >> (cnt)) & mask;
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
++ CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
++ }
++ else if (s != 0) {
++ /* set the new carry flag, Note that it is the low order
++ bit of the result!!! */
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u8 shl_byte(u8 d, u8 s)
++u8
++shl_byte(u8 d, u8 s)
+ {
+- unsigned int cnt, res, cf;
+-
+- if (s < 8) {
+- cnt = s % 8;
++ unsigned int cnt, res, cf;
+
+- /* last bit shifted out goes into carry flag */
+- if (cnt > 0) {
+- res = d << cnt;
+- cf = d & (1 << (8 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = (u8) d;
+- }
++ if (s < 8) {
++ cnt = s % 8;
++
++ /* last bit shifted out goes into carry flag */
++ if (cnt > 0) {
++ res = d << cnt;
++ cf = d & (1 << (8 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = (u8) d;
++ }
+
+- if (cnt == 1) {
+- /* Needs simplification. */
+- CONDITIONAL_SET_FLAG(
+- (((res & 0x80) == 0x80) ^
+- (ACCESS_FLAG(F_CF) != 0)),
+- /* was (M.x86.R_FLG&F_CF)==F_CF)), */
+- F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
++ if (cnt == 1) {
++ /* Needs simplification. */
++ CONDITIONAL_SET_FLAG((((res & 0x80) == 0x80) ^
++ (ACCESS_FLAG(F_CF) != 0)),
++ /* was (M.x86.R_FLG&F_CF)==F_CF)), */
++ F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
+ }
+- return (u8)res;
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u16 shl_word(u16 d, u8 s)
++u16
++shl_word(u16 d, u8 s)
+ {
+ unsigned int cnt, res, cf;
+
+- if (s < 16) {
+- cnt = s % 16;
+- if (cnt > 0) {
+- res = d << cnt;
+- cf = d & (1 << (16 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = (u16) d;
+- }
+-
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(
+- (((res & 0x8000) == 0x8000) ^
+- (ACCESS_FLAG(F_CF) != 0)),
+- F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
+- }
+- return (u16)res;
++ if (s < 16) {
++ cnt = s % 16;
++ if (cnt > 0) {
++ res = d << cnt;
++ cf = d & (1 << (16 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = (u16) d;
++ }
++
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
++ (ACCESS_FLAG(F_CF) != 0)), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u32 shl_long(u32 d, u8 s)
+-{
+- unsigned int cnt, res, cf;
+-
+- if (s < 32) {
+- cnt = s % 32;
+- if (cnt > 0) {
+- res = d << cnt;
+- cf = d & (1 << (32 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+- (ACCESS_FLAG(F_CF) != 0)), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
+- }
+- return res;
++u32
++shl_long(u32 d, u8 s)
++{
++ unsigned int cnt, res, cf;
++
++ if (s < 32) {
++ cnt = s % 32;
++ if (cnt > 0) {
++ res = d << cnt;
++ cf = d & (1 << (32 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
++ (ACCESS_FLAG(F_CF) != 0)), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u8 shr_byte(u8 d, u8 s)
+-{
+- unsigned int cnt, res, cf;
+-
+- if (s < 8) {
+- cnt = s % 8;
+- if (cnt > 0) {
+- cf = d & (1 << (cnt - 1));
+- res = d >> cnt;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = (u8) d;
+- }
+-
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
+- }
+- return (u8)res;
++u8
++shr_byte(u8 d, u8 s)
++{
++ unsigned int cnt, res, cf;
++
++ if (s < 8) {
++ cnt = s % 8;
++ if (cnt > 0) {
++ cf = d & (1 << (cnt - 1));
++ res = d >> cnt;
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = (u8) d;
++ }
++
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d >> (s - 1)) & 0x1, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u16 shr_word(u16 d, u8 s)
++u16
++shr_word(u16 d, u8 s)
+ {
+- unsigned int cnt, res, cf;
++ unsigned int cnt, res, cf;
+
+- if (s < 16) {
+- cnt = s % 16;
+- if (cnt > 0) {
+- cf = d & (1 << (cnt - 1));
+- res = d >> cnt;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
++ if (s < 16) {
++ cnt = s % 16;
++ if (cnt > 0) {
++ cf = d & (1 << (cnt - 1));
++ res = d >> cnt;
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
+
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+ }
+- } else {
+- res = 0;
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
+ }
+- return (u16)res;
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u32 shr_long(u32 d, u8 s)
++u32
++shr_long(u32 d, u8 s)
+ {
+- unsigned int cnt, res, cf;
++ unsigned int cnt, res, cf;
+
+- if (s < 32) {
+- cnt = s % 32;
+- if (cnt > 0) {
+- cf = d & (1 << (cnt - 1));
+- res = d >> cnt;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
++ if (s < 32) {
++ cnt = s % 32;
++ if (cnt > 0) {
++ cf = d & (1 << (cnt - 1));
++ res = d >> cnt;
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
+ res = d;
+ }
+ if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
+ }
+- } else {
++ }
++ else {
+ res = 0;
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
+ }
+ return res;
+ }
+@@ -1524,592 +1600,634 @@ u32 shr_long(u32 d, u8 s)
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u8 sar_byte(u8 d, u8 s)
++u8
++sar_byte(u8 d, u8 s)
+ {
+- unsigned int cnt, res, cf, mask, sf;
++ unsigned int cnt, res, cf, mask, sf;
+
+- res = d;
+- sf = d & 0x80;
++ res = d;
++ sf = d & 0x80;
+ cnt = s % 8;
+- if (cnt > 0 && cnt < 8) {
+- mask = (1 << (8 - cnt)) - 1;
+- cf = d & (1 << (cnt - 1));
+- res = (d >> cnt) & mask;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- if (sf) {
+- res |= ~mask;
+- }
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- } else if (cnt >= 8) {
++ if (cnt > 0 && cnt < 8) {
++ mask = (1 << (8 - cnt)) - 1;
++ cf = d & (1 << (cnt - 1));
++ res = (d >> cnt) & mask;
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ if (sf) {
++ res |= ~mask;
++ }
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ }
++ else if (cnt >= 8) {
+ if (sf) {
+ res = 0xff;
+- SET_FLAG(F_CF);
+- CLEAR_FLAG(F_ZF);
+- SET_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- } else {
+- res = 0;
+- CLEAR_FLAG(F_CF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
+- }
+- }
+- return (u8)res;
++ SET_FLAG(F_CF);
++ CLEAR_FLAG(F_ZF);
++ SET_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ }
++ else {
++ res = 0;
++ CLEAR_FLAG(F_CF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
++ }
++ }
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u16 sar_word(u16 d, u8 s)
++u16
++sar_word(u16 d, u8 s)
+ {
+ unsigned int cnt, res, cf, mask, sf;
+
+ sf = d & 0x8000;
+ cnt = s % 16;
+- res = d;
+- if (cnt > 0 && cnt < 16) {
++ res = d;
++ if (cnt > 0 && cnt < 16) {
+ mask = (1 << (16 - cnt)) - 1;
+ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) & mask;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (sf) {
+ res |= ~mask;
+ }
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else if (cnt >= 16) {
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else if (cnt >= 16) {
+ if (sf) {
+ res = 0xffff;
+- SET_FLAG(F_CF);
+- CLEAR_FLAG(F_ZF);
+- SET_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- } else {
++ SET_FLAG(F_CF);
++ CLEAR_FLAG(F_ZF);
++ SET_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ }
++ else {
+ res = 0;
+- CLEAR_FLAG(F_CF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
++ CLEAR_FLAG(F_CF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
+ }
+ }
+- return (u16)res;
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u32 sar_long(u32 d, u8 s)
++u32
++sar_long(u32 d, u8 s)
+ {
+ u32 cnt, res, cf, mask, sf;
+
+ sf = d & 0x80000000;
+ cnt = s % 32;
+- res = d;
+- if (cnt > 0 && cnt < 32) {
++ res = d;
++ if (cnt > 0 && cnt < 32) {
+ mask = (1 << (32 - cnt)) - 1;
+- cf = d & (1 << (cnt - 1));
++ cf = d & (1 << (cnt - 1));
+ res = (d >> cnt) & mask;
+- CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG(cf, F_CF);
+ if (sf) {
+ res |= ~mask;
+ }
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else if (cnt >= 32) {
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else if (cnt >= 32) {
+ if (sf) {
+ res = 0xffffffff;
+- SET_FLAG(F_CF);
+- CLEAR_FLAG(F_ZF);
+- SET_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- } else {
+- res = 0;
+- CLEAR_FLAG(F_CF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
+- }
+- }
+- return res;
++ SET_FLAG(F_CF);
++ CLEAR_FLAG(F_ZF);
++ SET_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ }
++ else {
++ res = 0;
++ CLEAR_FLAG(F_CF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
++ }
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHLD instruction and side effects.
+ ****************************************************************************/
+-u16 shld_word (u16 d, u16 fill, u8 s)
+-{
+- unsigned int cnt, res, cf;
+-
+- if (s < 16) {
+- cnt = s % 16;
+- if (cnt > 0) {
+- res = (d << cnt) | (fill >> (16-cnt));
+- cf = d & (1 << (16 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
+- (ACCESS_FLAG(F_CF) != 0)), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
+- }
+- return (u16)res;
++u16
++shld_word(u16 d, u16 fill, u8 s)
++{
++ unsigned int cnt, res, cf;
++
++ if (s < 16) {
++ cnt = s % 16;
++ if (cnt > 0) {
++ res = (d << cnt) | (fill >> (16 - cnt));
++ cf = d & (1 << (16 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
++ (ACCESS_FLAG(F_CF) != 0)), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHLD instruction and side effects.
+ ****************************************************************************/
+-u32 shld_long (u32 d, u32 fill, u8 s)
+-{
+- unsigned int cnt, res, cf;
+-
+- if (s < 32) {
+- cnt = s % 32;
+- if (cnt > 0) {
+- res = (d << cnt) | (fill >> (32-cnt));
+- cf = d & (1 << (32 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+- (ACCESS_FLAG(F_CF) != 0)), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
+- }
+- } else {
+- res = 0;
+- CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+- CLEAR_FLAG(F_OF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_PF);
+- SET_FLAG(F_ZF);
+- }
+- return res;
++u32
++shld_long(u32 d, u32 fill, u8 s)
++{
++ unsigned int cnt, res, cf;
++
++ if (s < 32) {
++ cnt = s % 32;
++ if (cnt > 0) {
++ res = (d << cnt) | (fill >> (32 - cnt));
++ cf = d & (1 << (32 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
++ (ACCESS_FLAG(F_CF) != 0)), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
++ }
++ }
++ else {
++ res = 0;
++ CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF);
++ CLEAR_FLAG(F_OF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_PF);
++ SET_FLAG(F_ZF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHRD instruction and side effects.
+ ****************************************************************************/
+-u16 shrd_word (u16 d, u16 fill, u8 s)
++u16
++shrd_word(u16 d, u16 fill, u8 s)
+ {
+- unsigned int cnt, res, cf;
++ unsigned int cnt, res, cf;
+
+- if (s < 16) {
+- cnt = s % 16;
+- if (cnt > 0) {
+- cf = d & (1 << (cnt - 1));
+- res = (d >> cnt) | (fill << (16 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
++ if (s < 16) {
++ cnt = s % 16;
++ if (cnt > 0) {
++ cf = d & (1 << (cnt - 1));
++ res = (d >> cnt) | (fill << (16 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
+
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
+ }
+- } else {
+- res = 0;
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
+ }
+- return (u16)res;
++ else {
++ res = 0;
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
++ }
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SHRD instruction and side effects.
+ ****************************************************************************/
+-u32 shrd_long (u32 d, u32 fill, u8 s)
++u32
++shrd_long(u32 d, u32 fill, u8 s)
+ {
+- unsigned int cnt, res, cf;
++ unsigned int cnt, res, cf;
+
+- if (s < 32) {
+- cnt = s % 32;
+- if (cnt > 0) {
+- cf = d & (1 << (cnt - 1));
+- res = (d >> cnt) | (fill << (32 - cnt));
+- CONDITIONAL_SET_FLAG(cf, F_CF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- } else {
+- res = d;
+- }
+- if (cnt == 1) {
+- CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+- } else {
+- CLEAR_FLAG(F_OF);
++ if (s < 32) {
++ cnt = s % 32;
++ if (cnt > 0) {
++ cf = d & (1 << (cnt - 1));
++ res = (d >> cnt) | (fill << (32 - cnt));
++ CONDITIONAL_SET_FLAG(cf, F_CF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ }
++ else {
++ res = d;
++ }
++ if (cnt == 1) {
++ CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
++ }
++ else {
++ CLEAR_FLAG(F_OF);
+ }
+- } else {
+- res = 0;
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- SET_FLAG(F_ZF);
+- CLEAR_FLAG(F_SF);
+- CLEAR_FLAG(F_PF);
+ }
+- return res;
++ else {
++ res = 0;
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ SET_FLAG(F_ZF);
++ CLEAR_FLAG(F_SF);
++ CLEAR_FLAG(F_PF);
++ }
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u8 sbb_byte(u8 d, u8 s)
++u8
++sbb_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+- if (ACCESS_FLAG(F_CF))
+- res = d - s - 1;
+- else
+- res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ if (ACCESS_FLAG(F_CF))
++ res = d - s - 1;
++ else
++ res = d - s;
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u16 sbb_word(u16 d, u16 s)
++u16
++sbb_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+- if (ACCESS_FLAG(F_CF))
++ if (ACCESS_FLAG(F_CF))
+ res = d - s - 1;
+ else
+ res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u16)res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u32 sbb_long(u32 d, u32 s)
++u32
++sbb_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- if (ACCESS_FLAG(F_CF))
++ if (ACCESS_FLAG(F_CF))
+ res = d - s - 1;
+ else
+ res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u8 sub_byte(u8 d, u8 s)
++u8
++sub_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d - s;
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u8)res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u8) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u16 sub_word(u16 d, u16 s)
++u16
++sub_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+ register u32 bc;
+
+ res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return (u16)res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return (u16) res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u32 sub_long(u32 d, u32 s)
++u32
++sub_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
+- register u32 bc;
++ register u32 res; /* all operands in native machine order */
++ register u32 bc;
+
+- res = d - s;
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ res = d - s;
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+
+- /* calculate the borrow chain. See note at top */
+- bc = (res & (~d | s)) | (~d & s);
+- CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+- CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+- CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+- return res;
++ /* calculate the borrow chain. See note at top */
++ bc = (res & (~d | s)) | (~d & s);
++ CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++ CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++ CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_byte(u8 d, u8 s)
++void
++test_byte(u8 d, u8 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+ res = d & s;
+
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ /* AF == dont care */
+- CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_CF);
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_word(u16 d, u16 s)
++void
++test_word(u16 d, u16 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+- res = d & s;
++ res = d & s;
+
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- /* AF == dont care */
+- CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ /* AF == dont care */
++ CLEAR_FLAG(F_CF);
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_long(u32 d, u32 s)
++void
++test_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+- res = d & s;
++ res = d & s;
+
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- /* AF == dont care */
+- CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ /* AF == dont care */
++ CLEAR_FLAG(F_CF);
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u8 xor_byte(u8 d, u8 s)
++u8
++xor_byte(u8 d, u8 s)
+ {
+- register u8 res; /* all operands in native machine order */
++ register u8 res; /* all operands in native machine order */
+
+- res = d ^ s;
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- return res;
++ res = d ^ s;
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u16 xor_word(u16 d, u16 s)
++u16
++xor_word(u16 d, u16 s)
+ {
+- register u16 res; /* all operands in native machine order */
++ register u16 res; /* all operands in native machine order */
+
+- res = d ^ s;
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- return res;
++ res = d ^ s;
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u32 xor_long(u32 d, u32 s)
++u32
++xor_long(u32 d, u32 s)
+ {
+- register u32 res; /* all operands in native machine order */
++ register u32 res; /* all operands in native machine order */
+
+- res = d ^ s;
+- CLEAR_FLAG(F_OF);
+- CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+- CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- return res;
++ res = d ^ s;
++ CLEAR_FLAG(F_OF);
++ CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++ CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ return res;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_byte(u8 s)
++void
++imul_byte(u8 s)
+ {
+- s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
++ s16 res = (s16) ((s8) M.x86.R_AL * (s8) s);
+
+- M.x86.R_AX = res;
+- if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
+- ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
+- }
++ M.x86.R_AX = res;
++ if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
++ ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
++ }
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_word(u16 s)
++void
++imul_word(u16 s)
+ {
+- s32 res = (s16)M.x86.R_AX * (s16)s;
++ s32 res = (s16) M.x86.R_AX * (s16) s;
+
+- M.x86.R_AX = (u16)res;
+- M.x86.R_DX = (u16)(res >> 16);
+- if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
+- ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
+- }
++ M.x86.R_AX = (u16) res;
++ M.x86.R_DX = (u16) (res >> 16);
++ if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
++ ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
++ }
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
++void
++imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s)
+ {
+ #ifdef __HAS_LONG_LONG__
+- s64 res = (s32)d * (s32)s;
++ s64 res = (s64) (s32) d * (s32) s;
+
+- *res_lo = (u32)res;
+- *res_hi = (u32)(res >> 32);
++ *res_lo = (u32) res;
++ *res_hi = (u32) (res >> 32);
+ #else
+- u32 d_lo,d_hi,d_sign;
+- u32 s_lo,s_hi,s_sign;
+- u32 rlo_lo,rlo_hi,rhi_lo;
+-
+- if ((d_sign = d & 0x80000000) != 0)
+- d = -d;
+- d_lo = d & 0xFFFF;
+- d_hi = d >> 16;
+- if ((s_sign = s & 0x80000000) != 0)
+- s = -s;
+- s_lo = s & 0xFFFF;
+- s_hi = s >> 16;
+- rlo_lo = d_lo * s_lo;
+- rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
+- rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
+- *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+- *res_hi = rhi_lo;
+- if (d_sign != s_sign) {
+- d = ~*res_lo;
+- s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
+- *res_lo = ~*res_lo+1;
+- *res_hi = ~*res_hi+(s >> 16);
+- }
++ u32 d_lo, d_hi, d_sign;
++ u32 s_lo, s_hi, s_sign;
++ u32 rlo_lo, rlo_hi, rhi_lo;
++
++ if ((d_sign = d & 0x80000000) != 0)
++ d = -d;
++ d_lo = d & 0xFFFF;
++ d_hi = d >> 16;
++ if ((s_sign = s & 0x80000000) != 0)
++ s = -s;
++ s_lo = s & 0xFFFF;
++ s_hi = s >> 16;
++ rlo_lo = d_lo * s_lo;
++ rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
++ rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
++ *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
++ *res_hi = rhi_lo;
++ if (d_sign != s_sign) {
++ d = ~*res_lo;
++ s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
++ *res_lo = ~*res_lo + 1;
++ *res_hi = ~*res_hi + (s >> 16);
++ }
+ #endif
+ }
+
+@@ -2117,53 +2235,59 @@ void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_long(u32 s)
++void
++imul_long(u32 s)
+ {
+- imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
+- if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
+- ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
+- }
++ imul_long_direct(&M.x86.R_EAX, &M.x86.R_EDX, M.x86.R_EAX, s);
++ if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
++ ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
++ }
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_byte(u8 s)
++void
++mul_byte(u8 s)
+ {
+- u16 res = (u16)(M.x86.R_AL * s);
++ u16 res = (u16) (M.x86.R_AL * s);
+
+- M.x86.R_AX = res;
+- if (M.x86.R_AH == 0) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
+- }
++ M.x86.R_AX = res;
++ if (M.x86.R_AH == 0) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
++ }
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_word(u16 s)
++void
++mul_word(u16 s)
+ {
+- u32 res = M.x86.R_AX * s;
++ u32 res = M.x86.R_AX * s;
+
+- M.x86.R_AX = (u16)res;
+- M.x86.R_DX = (u16)(res >> 16);
+- if (M.x86.R_DX == 0) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
++ M.x86.R_AX = (u16) res;
++ M.x86.R_DX = (u16) (res >> 16);
++ if (M.x86.R_DX == 0) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
+ }
+ }
+
+@@ -2171,36 +2295,38 @@ void mul_word(u16 s)
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_long(u32 s)
++void
++mul_long(u32 s)
+ {
+ #ifdef __HAS_LONG_LONG__
+- u64 res = (u32)M.x86.R_EAX * (u32)s;
++ u64 res = (u64) M.x86.R_EAX * s;
+
+- M.x86.R_EAX = (u32)res;
+- M.x86.R_EDX = (u32)(res >> 32);
++ M.x86.R_EAX = (u32) res;
++ M.x86.R_EDX = (u32) (res >> 32);
+ #else
+- u32 a,a_lo,a_hi;
+- u32 s_lo,s_hi;
+- u32 rlo_lo,rlo_hi,rhi_lo;
+-
+- a = M.x86.R_EAX;
+- a_lo = a & 0xFFFF;
+- a_hi = a >> 16;
+- s_lo = s & 0xFFFF;
+- s_hi = s >> 16;
+- rlo_lo = a_lo * s_lo;
+- rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
+- rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
+- M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+- M.x86.R_EDX = rhi_lo;
++ u32 a, a_lo, a_hi;
++ u32 s_lo, s_hi;
++ u32 rlo_lo, rlo_hi, rhi_lo;
++
++ a = M.x86.R_EAX;
++ a_lo = a & 0xFFFF;
++ a_hi = a >> 16;
++ s_lo = s & 0xFFFF;
++ s_hi = s >> 16;
++ rlo_lo = a_lo * s_lo;
++ rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
++ rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
++ M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
++ M.x86.R_EDX = rhi_lo;
+ #endif
+
+- if (M.x86.R_EDX == 0) {
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_OF);
+- } else {
+- SET_FLAG(F_CF);
+- SET_FLAG(F_OF);
++ if (M.x86.R_EDX == 0) {
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_OF);
++ }
++ else {
++ SET_FLAG(F_CF);
++ SET_FLAG(F_OF);
+ }
+ }
+
+@@ -2208,309 +2334,319 @@ void mul_long(u32 s)
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_byte(u8 s)
++void
++idiv_byte(u8 s)
+ {
+ s32 dvd, div, mod;
+
+- dvd = (s16)M.x86.R_AX;
+- if (s == 0) {
+- x86emu_intr_raise(0);
++ dvd = (s16) M.x86.R_AX;
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ div = dvd / (s8) s;
++ mod = dvd % (s8) s;
++ if (abs(div) > 0x7f) {
++ x86emu_intr_raise(0);
+ return;
+- }
+- div = dvd / (s8)s;
+- mod = dvd % (s8)s;
+- if (abs(div) > 0x7f) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- M.x86.R_AL = (s8) div;
+- M.x86.R_AH = (s8) mod;
++ }
++ M.x86.R_AL = (s8) div;
++ M.x86.R_AH = (s8) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_word(u16 s)
++void
++idiv_word(u16 s)
+ {
+- s32 dvd, div, mod;
++ s32 dvd, div, mod;
+
+- dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
+- if (s == 0) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- div = dvd / (s16)s;
+- mod = dvd % (s16)s;
+- if (abs(div) > 0x7fff) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_SF);
+- CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++ dvd = (((s32) M.x86.R_DX) << 16) | M.x86.R_AX;
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ div = dvd / (s16) s;
++ mod = dvd % (s16) s;
++ if (abs(div) > 0x7fff) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_SF);
++ CONDITIONAL_SET_FLAG(div == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+- M.x86.R_AX = (u16)div;
+- M.x86.R_DX = (u16)mod;
++ M.x86.R_AX = (u16) div;
++ M.x86.R_DX = (u16) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_long(u32 s)
++void
++idiv_long(u32 s)
+ {
+ #ifdef __HAS_LONG_LONG__
+- s64 dvd, div, mod;
+-
+- dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+- if (s == 0) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- div = dvd / (s32)s;
+- mod = dvd % (s32)s;
+- if (abs(div) > 0x7fffffff) {
+- x86emu_intr_raise(0);
+- return;
+- }
++ s64 dvd, div, mod;
++
++ dvd = (((s64) M.x86.R_EDX) << 32) | M.x86.R_EAX;
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ div = dvd / (s32) s;
++ mod = dvd % (s32) s;
++ if (abs(div) > 0x7fffffff) {
++ x86emu_intr_raise(0);
++ return;
++ }
+ #else
+- s32 div = 0, mod;
+- s32 h_dvd = M.x86.R_EDX;
+- u32 l_dvd = M.x86.R_EAX;
+- u32 abs_s = s & 0x7FFFFFFF;
+- u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
+- u32 h_s = abs_s >> 1;
+- u32 l_s = abs_s << 31;
+- int counter = 31;
+- int carry;
+-
+- if (s == 0) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- do {
+- div <<= 1;
+- carry = (l_dvd >= l_s) ? 0 : 1;
+-
+- if (abs_h_dvd < (h_s + carry)) {
+- h_s >>= 1;
+- l_s = abs_s << (--counter);
+- continue;
+- } else {
+- abs_h_dvd -= (h_s + carry);
+- l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+- : (l_dvd - l_s);
+- h_s >>= 1;
+- l_s = abs_s << (--counter);
+- div |= 1;
+- continue;
+- }
+-
+- } while (counter > -1);
+- /* overflow */
+- if (abs_h_dvd || (l_dvd > abs_s)) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- /* sign */
+- div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
+- mod = l_dvd;
++ s32 div = 0, mod;
++ s32 h_dvd = M.x86.R_EDX;
++ u32 l_dvd = M.x86.R_EAX;
++ u32 abs_s = s & 0x7FFFFFFF;
++ u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
++ u32 h_s = abs_s >> 1;
++ u32 l_s = abs_s << 31;
++ int counter = 31;
++ int carry;
++
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ do {
++ div <<= 1;
++ carry = (l_dvd >= l_s) ? 0 : 1;
++
++ if (abs_h_dvd < (h_s + carry)) {
++ h_s >>= 1;
++ l_s = abs_s << (--counter);
++ continue;
++ }
++ else {
++ abs_h_dvd -= (h_s + carry);
++ l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
++ : (l_dvd - l_s);
++ h_s >>= 1;
++ l_s = abs_s << (--counter);
++ div |= 1;
++ continue;
++ }
++
++ } while (counter > -1);
++ /* overflow */
++ if (abs_h_dvd || (l_dvd > abs_s)) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ /* sign */
++ div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
++ mod = l_dvd;
+
+ #endif
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+- M.x86.R_EAX = (u32)div;
+- M.x86.R_EDX = (u32)mod;
++ M.x86.R_EAX = (u32) div;
++ M.x86.R_EDX = (u32) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_byte(u8 s)
++void
++div_byte(u8 s)
+ {
+- u32 dvd, div, mod;
++ u32 dvd, div, mod;
+
+- dvd = M.x86.R_AX;
++ dvd = M.x86.R_AX;
+ if (s == 0) {
+- x86emu_intr_raise(0);
++ x86emu_intr_raise(0);
+ return;
+ }
+- div = dvd / (u8)s;
+- mod = dvd % (u8)s;
+- if (abs(div) > 0xff) {
+- x86emu_intr_raise(0);
++ div = dvd / (u8) s;
++ mod = dvd % (u8) s;
++ if (abs(div) > 0xff) {
++ x86emu_intr_raise(0);
+ return;
+- }
+- M.x86.R_AL = (u8)div;
+- M.x86.R_AH = (u8)mod;
++ }
++ M.x86.R_AL = (u8) div;
++ M.x86.R_AH = (u8) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_word(u16 s)
++void
++div_word(u16 s)
+ {
+- u32 dvd, div, mod;
++ u32 dvd, div, mod;
+
+- dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
+- if (s == 0) {
+- x86emu_intr_raise(0);
++ dvd = (((u32) M.x86.R_DX) << 16) | M.x86.R_AX;
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ div = dvd / (u16) s;
++ mod = dvd % (u16) s;
++ if (abs(div) > 0xffff) {
++ x86emu_intr_raise(0);
+ return;
+ }
+- div = dvd / (u16)s;
+- mod = dvd % (u16)s;
+- if (abs(div) > 0xffff) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_SF);
+- CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_SF);
++ CONDITIONAL_SET_FLAG(div == 0, F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+- M.x86.R_AX = (u16)div;
+- M.x86.R_DX = (u16)mod;
++ M.x86.R_AX = (u16) div;
++ M.x86.R_DX = (u16) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_long(u32 s)
++void
++div_long(u32 s)
+ {
+ #ifdef __HAS_LONG_LONG__
+- u64 dvd, div, mod;
+-
+- dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+- if (s == 0) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- div = dvd / (u32)s;
+- mod = dvd % (u32)s;
+- if (abs(div) > 0xffffffff) {
+- x86emu_intr_raise(0);
+- return;
+- }
++ u64 dvd, div, mod;
++
++ dvd = (((u64) M.x86.R_EDX) << 32) | M.x86.R_EAX;
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ div = dvd / (u32) s;
++ mod = dvd % (u32) s;
++ if (abs(div) > 0xffffffff) {
++ x86emu_intr_raise(0);
++ return;
++ }
+ #else
+- s32 div = 0, mod;
+- s32 h_dvd = M.x86.R_EDX;
+- u32 l_dvd = M.x86.R_EAX;
+-
+- u32 h_s = s;
+- u32 l_s = 0;
+- int counter = 32;
+- int carry;
+-
+- if (s == 0) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- do {
+- div <<= 1;
+- carry = (l_dvd >= l_s) ? 0 : 1;
+-
+- if (h_dvd < (h_s + carry)) {
+- h_s >>= 1;
+- l_s = s << (--counter);
+- continue;
+- } else {
+- h_dvd -= (h_s + carry);
+- l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+- : (l_dvd - l_s);
+- h_s >>= 1;
+- l_s = s << (--counter);
+- div |= 1;
+- continue;
+- }
+-
+- } while (counter > -1);
+- /* overflow */
+- if (h_dvd || (l_dvd > s)) {
+- x86emu_intr_raise(0);
+- return;
+- }
+- mod = l_dvd;
++ s32 div = 0, mod;
++ s32 h_dvd = M.x86.R_EDX;
++ u32 l_dvd = M.x86.R_EAX;
++
++ u32 h_s = s;
++ u32 l_s = 0;
++ int counter = 32;
++ int carry;
++
++ if (s == 0) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ do {
++ div <<= 1;
++ carry = (l_dvd >= l_s) ? 0 : 1;
++
++ if (h_dvd < (h_s + carry)) {
++ h_s >>= 1;
++ l_s = s << (--counter);
++ continue;
++ }
++ else {
++ h_dvd -= (h_s + carry);
++ l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
++ : (l_dvd - l_s);
++ h_s >>= 1;
++ l_s = s << (--counter);
++ div |= 1;
++ continue;
++ }
++
++ } while (counter > -1);
++ /* overflow */
++ if (h_dvd || (l_dvd > s)) {
++ x86emu_intr_raise(0);
++ return;
++ }
++ mod = l_dvd;
+ #endif
+- CLEAR_FLAG(F_CF);
+- CLEAR_FLAG(F_AF);
+- CLEAR_FLAG(F_SF);
+- SET_FLAG(F_ZF);
+- CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++ CLEAR_FLAG(F_CF);
++ CLEAR_FLAG(F_AF);
++ CLEAR_FLAG(F_SF);
++ SET_FLAG(F_ZF);
++ CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+
+- M.x86.R_EAX = (u32)div;
+- M.x86.R_EDX = (u32)mod;
++ M.x86.R_EAX = (u32) div;
++ M.x86.R_EDX = (u32) mod;
+ }
+
+ /****************************************************************************
+ REMARKS:
+ Implements the IN string instruction and side effects.
+ ****************************************************************************/
+-void ins(int size)
++void
++ins(int size)
+ {
+- int inc = size;
++ int inc = size;
+
+- if (ACCESS_FLAG(F_DF)) {
+- inc = -size;
+- }
+- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
++ if (ACCESS_FLAG(F_DF)) {
++ inc = -size;
++ }
++ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* in until CX is ZERO. */
+- u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+- M.x86.R_ECX : M.x86.R_CX);
++ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
++ M.x86.R_ECX : M.x86.R_CX);
+ switch (size) {
+- case 1:
++ case 1:
+ while (count--) {
+- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inb)(M.x86.R_DX));
+- M.x86.R_DI += inc;
++ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inb) (M.x86.R_DX));
++ M.x86.R_DI += inc;
+ }
+ break;
+
+- case 2:
++ case 2:
+ while (count--) {
+- store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inw)(M.x86.R_DX));
+- M.x86.R_DI += inc;
++ store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inw) (M.x86.R_DX));
++ M.x86.R_DI += inc;
+ }
+ break;
+- case 4:
++ case 4:
+ while (count--) {
+- store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inl)(M.x86.R_DX));
+- M.x86.R_DI += inc;
++ store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inl) (M.x86.R_DX));
++ M.x86.R_DI += inc;
++ break;
+ }
+- break;
+ }
+- M.x86.R_CX = 0;
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- M.x86.R_ECX = 0;
++ M.x86.R_CX = 0;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ M.x86.R_ECX = 0;
+ }
+- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+- } else {
++ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
++ }
++ else {
+ switch (size) {
+- case 1:
+- store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inb)(M.x86.R_DX));
++ case 1:
++ store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inb) (M.x86.R_DX));
+ break;
+- case 2:
+- store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inw)(M.x86.R_DX));
++ case 2:
++ store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inw) (M.x86.R_DX));
+ break;
+- case 4:
+- store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+- (*sys_inl)(M.x86.R_DX));
++ case 4:
++ store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
++ (*sys_inl) (M.x86.R_DX));
+ break;
+ }
+- M.x86.R_DI += inc;
++ M.x86.R_DI += inc;
+ }
+ }
+
+@@ -2518,63 +2654,65 @@ void ins(int size)
+ REMARKS:
+ Implements the OUT string instruction and side effects.
+ ****************************************************************************/
+-void outs(int size)
++void
++outs(int size)
+ {
+ int inc = size;
+
+- if (ACCESS_FLAG(F_DF)) {
++ if (ACCESS_FLAG(F_DF)) {
+ inc = -size;
+ }
+- if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
++ if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+ /* dont care whether REPE or REPNE */
+ /* out until CX is ZERO. */
+- u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+- M.x86.R_ECX : M.x86.R_CX);
++ u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
++ M.x86.R_ECX : M.x86.R_CX);
+ switch (size) {
+- case 1:
++ case 1:
+ while (count--) {
+- (*sys_outb)(M.x86.R_DX,
+- fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+- M.x86.R_SI += inc;
++ (*sys_outb) (M.x86.R_DX,
++ fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
++ M.x86.R_SI += inc;
+ }
+ break;
+
+- case 2:
++ case 2:
+ while (count--) {
+- (*sys_outw)(M.x86.R_DX,
+- fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+- M.x86.R_SI += inc;
++ (*sys_outw) (M.x86.R_DX,
++ fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
++ M.x86.R_SI += inc;
+ }
+ break;
+- case 4:
++ case 4:
+ while (count--) {
+- (*sys_outl)(M.x86.R_DX,
+- fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+- M.x86.R_SI += inc;
++ (*sys_outl) (M.x86.R_DX,
++ fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
++ M.x86.R_SI += inc;
++ break;
+ }
+- break;
+ }
+- M.x86.R_CX = 0;
+- if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+- M.x86.R_ECX = 0;
++ M.x86.R_CX = 0;
++ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++ M.x86.R_ECX = 0;
+ }
+- M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+- } else {
++ M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
++ }
++ else {
+ switch (size) {
+- case 1:
+- (*sys_outb)(M.x86.R_DX,
+- fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
++ case 1:
++ (*sys_outb) (M.x86.R_DX,
++ fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+- case 2:
+- (*sys_outw)(M.x86.R_DX,
+- fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
++ case 2:
++ (*sys_outw) (M.x86.R_DX,
++ fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+- case 4:
+- (*sys_outl)(M.x86.R_DX,
+- fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
++ case 4:
++ (*sys_outl) (M.x86.R_DX,
++ fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+ break;
+ }
+- M.x86.R_SI += inc;
++ M.x86.R_SI += inc;
+ }
+ }
+
+@@ -2585,11 +2723,12 @@ addr - Address to fetch word from
+ REMARKS:
+ Fetches a word from emulator memory using an absolute address.
+ ****************************************************************************/
+-u16 mem_access_word(int addr)
++u16
++mem_access_word(int addr)
+ {
+-DB( if (CHECK_MEM_ACCESS())
+- x86emu_check_mem_access(addr);)
+- return (*sys_rdw)(addr);
++ DB(if (CHECK_MEM_ACCESS())
++ x86emu_check_mem_access(addr);)
++ return (*sys_rdw) (addr);
+ }
+
+ /****************************************************************************
+@@ -2598,12 +2737,13 @@ Pushes a word onto the stack.
+
+ NOTE: Do not inline this, as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void push_word(u16 w)
++void
++push_word(u16 w)
+ {
+-DB( if (CHECK_SP_ACCESS())
+- x86emu_check_sp_access();)
+- M.x86.R_SP -= 2;
+- (*sys_wrw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
++ DB(if (CHECK_SP_ACCESS())
++ x86emu_check_sp_access();)
++ M.x86.R_SP -= 2;
++ (*sys_wrw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w);
+ }
+
+ /****************************************************************************
+@@ -2612,12 +2752,13 @@ Pushes a long onto the stack.
+
+ NOTE: Do not inline this, as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void push_long(u32 w)
++void
++push_long(u32 w)
+ {
+-DB( if (CHECK_SP_ACCESS())
+- x86emu_check_sp_access();)
+- M.x86.R_SP -= 4;
+- (*sys_wrl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP, w);
++ DB(if (CHECK_SP_ACCESS())
++ x86emu_check_sp_access();)
++ M.x86.R_SP -= 4;
++ (*sys_wrl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w);
+ }
+
+ /****************************************************************************
+@@ -2626,15 +2767,16 @@ Pops a word from the stack.
+
+ NOTE: Do not inline this, as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 pop_word(void)
++u16
++pop_word(void)
+ {
+- register u16 res;
++ register u16 res;
+
+-DB( if (CHECK_SP_ACCESS())
+- x86emu_check_sp_access();)
+- res = (*sys_rdw)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
+- M.x86.R_SP += 2;
+- return res;
++ DB(if (CHECK_SP_ACCESS())
++ x86emu_check_sp_access();)
++ res = (*sys_rdw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP);
++ M.x86.R_SP += 2;
++ return res;
+ }
+
+ /****************************************************************************
+@@ -2643,14 +2785,15 @@ Pops a long from the stack.
+
+ NOTE: Do not inline this, as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 pop_long(void)
++u32
++pop_long(void)
+ {
+ register u32 res;
+
+-DB( if (CHECK_SP_ACCESS())
+- x86emu_check_sp_access();)
+- res = (*sys_rdl)(((u32)M.x86.R_SS << 4) + M.x86.R_SP);
+- M.x86.R_SP += 4;
++ DB(if (CHECK_SP_ACCESS())
++ x86emu_check_sp_access();)
++ res = (*sys_rdl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP);
++ M.x86.R_SP += 4;
+ return res;
+ }
+
+@@ -2658,45 +2801,59 @@ DB( if (CHECK_SP_ACCESS())
+ REMARKS:
+ CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output
+ ****************************************************************************/
+-void cpuid (void)
+-{
+- u32 feature = M.x86.R_EAX;
+-
+- switch (feature) {
+- case 0:
+- /* Regardless if we have real data from the hardware, the emulator
+- * will only support upto feature 1, which we set in register EAX.
+- * Registers EBX:EDX:ECX contain a string identifying the CPU.
+- */
+- M.x86.R_EAX = 1;
+- /* EBX:EDX:ECX = "GenuineIntel" */
+- M.x86.R_EBX = 0x756e6547;
+- M.x86.R_EDX = 0x49656e69;
+- M.x86.R_ECX = 0x6c65746e;
+- break;
+- case 1:
+- /* If we don't have x86 compatible hardware, we return values from an
+- * Intel 486dx4; which was one of the first processors to have CPUID.
+- */
+- M.x86.R_EAX = 0x00000480;
+- M.x86.R_EBX = 0x00000000;
+- M.x86.R_ECX = 0x00000000;
+- M.x86.R_EDX = 0x00000002; /* VME */
+- /* In the case that we have hardware CPUID instruction, we make sure
+- * that the features reported are limited to TSC and VME.
+- */
+- M.x86.R_EDX &= 0x00000012;
+- break;
+- default:
+- /* Finally, we don't support any additional features. Most CPUs
+- * return all zeros when queried for invalid or unsupported feature
+- * numbers.
+- */
+- M.x86.R_EAX = 0;
+- M.x86.R_EBX = 0;
+- M.x86.R_ECX = 0;
+- M.x86.R_EDX = 0;
+- break;
+- }
+-}
++void
++cpuid(void)
++{
++ u32 feature = M.x86.R_EAX;
+
++#ifdef X86EMU_HAS_HW_CPUID
++ /* If the platform allows it, we will base our values on the real
++ * results from the CPUID instruction. We limit support to the
++ * first two features, and the results of those are sanitized.
++ */
++ if (feature <= 1)
++ hw_cpuid(&M.x86.R_EAX, &M.x86.R_EBX, &M.x86.R_ECX, &M.x86.R_EDX);
++#endif
++
++ switch (feature) {
++ case 0:
++ /* Regardless if we have real data from the hardware, the emulator
++ * will only support upto feature 1, which we set in register EAX.
++ * Registers EBX:EDX:ECX contain a string identifying the CPU.
++ */
++ M.x86.R_EAX = 1;
++#ifndef X86EMU_HAS_HW_CPUID
++ /* EBX:EDX:ECX = "GenuineIntel" */
++ M.x86.R_EBX = 0x756e6547;
++ M.x86.R_EDX = 0x49656e69;
++ M.x86.R_ECX = 0x6c65746e;
++#endif
++ break;
++ case 1:
++#ifndef X86EMU_HAS_HW_CPUID
++ /* If we don't have x86 compatible hardware, we return values from an
++ * Intel 486dx4; which was one of the first processors to have CPUID.
++ */
++ M.x86.R_EAX = 0x00000480;
++ M.x86.R_EBX = 0x00000000;
++ M.x86.R_ECX = 0x00000000;
++ M.x86.R_EDX = 0x00000002; /* VME */
++#else
++ /* In the case that we have hardware CPUID instruction, we make sure
++ * that the features reported are limited to TSC and VME.
++ */
++ M.x86.R_EDX &= 0x00000012;
++#endif
++ break;
++ default:
++ /* Finally, we don't support any additional features. Most CPUs
++ * return all zeros when queried for invalid or unsupported feature
++ * numbers.
++ */
++ M.x86.R_EAX = 0;
++ M.x86.R_EBX = 0;
++ M.x86.R_ECX = 0;
++ M.x86.R_EDX = 0;
++ break;
++ }
++}
+diff --git a/libs/x86emu/sys.c b/libs/x86emu/sys.c
+index 4d90ea3..c514dde 100644
+--- a/libs/x86emu/sys.c
++++ b/libs/x86emu/sys.c
+@@ -47,223 +47,133 @@
+ #include "x86emu/prim_ops.h"
+ #ifndef NO_SYS_HEADERS
+ #include <string.h>
+-#endif
+-/*------------------------- Global Variables ------------------------------*/
++#endif
+
+-X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */
+-X86EMU_intrFuncs _X86EMU_intrTab[256];
++#ifdef __GNUC__
+
+-/*----------------------------- Implementation ----------------------------*/
+-#if defined(__alpha__) || defined(__alpha)
+-/* to cope with broken egcs-1.1.2 :-(((( */
+-
+-#define ALPHA_UALOADS
+-/*
+- * inline functions to do unaligned accesses
+- * from linux/include/asm-alpha/unaligned.h
+- */
+-
+-/*
+- * EGCS 1.1 knows about arbitrary unaligned loads. Define some
+- * packed structures to talk about such things with.
+- */
+-
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-struct __una_u64 { unsigned long x __attribute__((packed)); };
+-struct __una_u32 { unsigned int x __attribute__((packed)); };
+-struct __una_u16 { unsigned short x __attribute__((packed)); };
+-#endif
++/* Define some packed structures to use with unaligned accesses */
++
++struct __una_u64 {
++ u64 x __attribute__ ((packed));
++};
++struct __una_u32 {
++ u32 x __attribute__ ((packed));
++};
++struct __una_u16 {
++ u16 x __attribute__ ((packed));
++};
++
++/* Elemental unaligned loads */
+
+-static __inline__ unsigned long ldq_u(unsigned long * r11)
++static __inline__ u64
++ldq_u(u64 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+- return ptr->x;
+-#else
+- unsigned long r1,r2;
+- __asm__("ldq_u %0,%3\n\t"
+- "ldq_u %1,%4\n\t"
+- "extql %0,%2,%0\n\t"
+- "extqh %1,%2,%1"
+- :"=&r" (r1), "=&r" (r2)
+- :"r" (r11),
+- "m" (*r11),
+- "m" (*(const unsigned long *)(7+(char *) r11)));
+- return r1 | r2;
+-#endif
++ const struct __una_u64 *ptr = (const struct __una_u64 *) p;
++
++ return ptr->x;
+ }
+
+-static __inline__ unsigned long ldl_u(unsigned int * r11)
++static __inline__ u32
++ldl_u(u32 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+- return ptr->x;
+-#else
+- unsigned long r1,r2;
+- __asm__("ldq_u %0,%3\n\t"
+- "ldq_u %1,%4\n\t"
+- "extll %0,%2,%0\n\t"
+- "extlh %1,%2,%1"
+- :"=&r" (r1), "=&r" (r2)
+- :"r" (r11),
+- "m" (*r11),
+- "m" (*(const unsigned long *)(3+(char *) r11)));
+- return r1 | r2;
+-#endif
++ const struct __una_u32 *ptr = (const struct __una_u32 *) p;
++
++ return ptr->x;
+ }
+
+-static __inline__ unsigned long ldw_u(unsigned short * r11)
++static __inline__ u16
++ldw_u(u16 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+- return ptr->x;
+-#else
+- unsigned long r1,r2;
+- __asm__("ldq_u %0,%3\n\t"
+- "ldq_u %1,%4\n\t"
+- "extwl %0,%2,%0\n\t"
+- "extwh %1,%2,%1"
+- :"=&r" (r1), "=&r" (r2)
+- :"r" (r11),
+- "m" (*r11),
+- "m" (*(const unsigned long *)(1+(char *) r11)));
+- return r1 | r2;
+-#endif
++ const struct __una_u16 *ptr = (const struct __una_u16 *) p;
++
++ return ptr->x;
+ }
+
+-/*
+- * Elemental unaligned stores
+- */
++/* Elemental unaligned stores */
+
+-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
++static __inline__ void
++stq_u(u64 val, u64 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- struct __una_u64 *ptr = (struct __una_u64 *) r11;
+- ptr->x = r5;
+-#else
+- unsigned long r1,r2,r3,r4;
+-
+- __asm__("ldq_u %3,%1\n\t"
+- "ldq_u %2,%0\n\t"
+- "insqh %6,%7,%5\n\t"
+- "insql %6,%7,%4\n\t"
+- "mskqh %3,%7,%3\n\t"
+- "mskql %2,%7,%2\n\t"
+- "bis %3,%5,%3\n\t"
+- "bis %2,%4,%2\n\t"
+- "stq_u %3,%1\n\t"
+- "stq_u %2,%0"
+- :"=m" (*r11),
+- "=m" (*(unsigned long *)(7+(char *) r11)),
+- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+- :"r" (r5), "r" (r11));
+-#endif
++ struct __una_u64 *ptr = (struct __una_u64 *) p;
++
++ ptr->x = val;
+ }
+
+-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
++static __inline__ void
++stl_u(u32 val, u32 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- struct __una_u32 *ptr = (struct __una_u32 *) r11;
+- ptr->x = r5;
+-#else
+- unsigned long r1,r2,r3,r4;
+-
+- __asm__("ldq_u %3,%1\n\t"
+- "ldq_u %2,%0\n\t"
+- "inslh %6,%7,%5\n\t"
+- "insll %6,%7,%4\n\t"
+- "msklh %3,%7,%3\n\t"
+- "mskll %2,%7,%2\n\t"
+- "bis %3,%5,%3\n\t"
+- "bis %2,%4,%2\n\t"
+- "stq_u %3,%1\n\t"
+- "stq_u %2,%0"
+- :"=m" (*r11),
+- "=m" (*(unsigned long *)(3+(char *) r11)),
+- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+- :"r" (r5), "r" (r11));
+-#endif
++ struct __una_u32 *ptr = (struct __una_u32 *) p;
++
++ ptr->x = val;
+ }
+
+-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
++static __inline__ void
++stw_u(u16 val, u16 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+- struct __una_u16 *ptr = (struct __una_u16 *) r11;
+- ptr->x = r5;
+-#else
+- unsigned long r1,r2,r3,r4;
+-
+- __asm__("ldq_u %3,%1\n\t"
+- "ldq_u %2,%0\n\t"
+- "inswh %6,%7,%5\n\t"
+- "inswl %6,%7,%4\n\t"
+- "mskwh %3,%7,%3\n\t"
+- "mskwl %2,%7,%2\n\t"
+- "bis %3,%5,%3\n\t"
+- "bis %2,%4,%2\n\t"
+- "stq_u %3,%1\n\t"
+- "stq_u %2,%0"
+- :"=m" (*r11),
+- "=m" (*(unsigned long *)(1+(char *) r11)),
+- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+- :"r" (r5), "r" (r11));
+-#endif
++ struct __una_u16 *ptr = (struct __una_u16 *) p;
++
++ ptr->x = val;
+ }
++#else /* !__GNUC__ */
+
+-#elif defined(__GNUC__) && ((__GNUC__ < 3)) && \
+- (defined (__ia64__) || defined (ia64__))
+-#define IA64_UALOADS
+-/*
+- * EGCS 1.1 knows about arbitrary unaligned loads. Define some
+- * packed structures to talk about such things with.
+- */
+-struct __una_u64 { unsigned long x __attribute__((packed)); };
+-struct __una_u32 { unsigned int x __attribute__((packed)); };
+-struct __una_u16 { unsigned short x __attribute__((packed)); };
+-
+-static __inline__ unsigned long
+-__uldq (const unsigned long * r11)
++static __inline__ u64
++ldq_u(u64 * p)
+ {
+- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+- return ptr->x;
++ u64 ret;
++
++ memmove(&ret, p, sizeof(*p));
++ return ret;
+ }
+
+-static __inline__ unsigned long
+-uldl (const unsigned int * r11)
++static __inline__ u32
++ldl_u(u32 * p)
+ {
+- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+- return ptr->x;
++ u32 ret;
++
++ memmove(&ret, p, sizeof(*p));
++ return ret;
+ }
+
+-static __inline__ unsigned long
+-uldw (const unsigned short * r11)
++static __inline__ u16
++ldw_u(u16 * p)
+ {
+- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+- return ptr->x;
++ u16 ret;
++
++ memmove(&ret, p, sizeof(*p));
++ return ret;
+ }
+
+ static __inline__ void
+-ustq (unsigned long r5, unsigned long * r11)
++stq_u(u64 val, u64 * p)
+ {
+- struct __una_u64 *ptr = (struct __una_u64 *) r11;
+- ptr->x = r5;
++ u64 tmp = val;
++
++ memmove(p, &tmp, sizeof(*p));
+ }
+
+ static __inline__ void
+-ustl (unsigned long r5, unsigned int * r11)
++stl_u(u32 val, u32 * p)
+ {
+- struct __una_u32 *ptr = (struct __una_u32 *) r11;
+- ptr->x = r5;
++ u32 tmp = val;
++
++ memmove(p, &tmp, sizeof(*p));
+ }
+
+ static __inline__ void
+-ustw (unsigned long r5, unsigned short * r11)
++stw_u(u16 val, u16 * p)
+ {
+- struct __una_u16 *ptr = (struct __una_u16 *) r11;
+- ptr->x = r5;
++ u16 tmp = val;
++
++ memmove(p, &tmp, sizeof(*p));
+ }
+
+-#endif
++#endif /* __GNUC__ */
++/*------------------------- Global Variables ------------------------------*/
++
++X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */
++X86EMU_intrFuncs _X86EMU_intrTab[256];
++
++/*----------------------------- Implementation ----------------------------*/
+
+ /****************************************************************************
+ PARAMETERS:
+@@ -275,19 +185,20 @@ Byte value read from emulator memory.
+ REMARKS:
+ Reads a byte value from the emulator memory.
+ ****************************************************************************/
+-u8 X86API rdb(
+- u32 addr)
++u8 X86API
++rdb(u32 addr)
+ {
+- u8 val;
+-
+- if (addr > M.mem_size - 1) {
+- DB(printk("mem_read: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
+- val = *(u8*)(M.mem_base + addr);
+-DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 1 -> %#x\n", addr, val);)
+- return val;
++ u8 val;
++
++ if (addr > M.mem_size - 1) {
++ DB(printk("mem_read: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
++ val = *(u8 *) (M.mem_base + addr);
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 1 -> %#x\n", addr, val);)
++ return val;
+ }
+
+ /****************************************************************************
+@@ -300,32 +211,27 @@ Word value read from emulator memory.
+ REMARKS:
+ Reads a word value from the emulator memory.
+ ****************************************************************************/
+-u16 X86API rdw(
+- u32 addr)
++u16 X86API
++rdw(u32 addr)
+ {
+- u16 val = 0;
++ u16 val = 0;
+
+- if (addr > M.mem_size - 2) {
+- DB(printk("mem_read: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
++ if (addr > M.mem_size - 2) {
++ DB(printk("mem_read: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
+ #ifdef __BIG_ENDIAN__
+- if (addr & 0x1) {
+- val = (*(u8*)(M.mem_base + addr) |
+- (*(u8*)(M.mem_base + addr + 1) << 8));
+- }
+- else
+-#endif
+-#if defined(ALPHA_UALOADS)
+- val = ldw_u((u16*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+- val = uldw((u16*)(M.mem_base + addr));
+-#else
+- val = *(u16*)(M.mem_base + addr);
++ if (addr & 0x1) {
++ val = (*(u8 *) (M.mem_base + addr) |
++ (*(u8 *) (M.mem_base + addr + 1) << 8));
++ }
++ else
+ #endif
+- DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 2 -> %#x\n", addr, val);)
+- return val;
++ val = ldw_u((u16 *) (M.mem_base + addr));
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 2 -> %#x\n", addr, val);)
++ return val;
+ }
+
+ /****************************************************************************
+@@ -337,34 +243,29 @@ Long value read from emulator memory.
+ REMARKS:
+ Reads a long value from the emulator memory.
+ ****************************************************************************/
+-u32 X86API rdl(
+- u32 addr)
++u32 X86API
++rdl(u32 addr)
+ {
+- u32 val = 0;
++ u32 val = 0;
+
+- if (addr > M.mem_size - 4) {
+- DB(printk("mem_read: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
++ if (addr > M.mem_size - 4) {
++ DB(printk("mem_read: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
+ #ifdef __BIG_ENDIAN__
+- if (addr & 0x3) {
+- val = (*(u8*)(M.mem_base + addr + 0) |
+- (*(u8*)(M.mem_base + addr + 1) << 8) |
+- (*(u8*)(M.mem_base + addr + 2) << 16) |
+- (*(u8*)(M.mem_base + addr + 3) << 24));
+- }
+- else
+-#endif
+-#if defined(ALPHA_UALOADS)
+- val = ldl_u((u32*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+- val = uldl((u32*)(M.mem_base + addr));
+-#else
+- val = *(u32*)(M.mem_base + addr);
++ if (addr & 0x3) {
++ val = (*(u8 *) (M.mem_base + addr + 0) |
++ (*(u8 *) (M.mem_base + addr + 1) << 8) |
++ (*(u8 *) (M.mem_base + addr + 2) << 16) |
++ (*(u8 *) (M.mem_base + addr + 3) << 24));
++ }
++ else
+ #endif
+-DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 4 -> %#x\n", addr, val);)
+- return val;
++ val = ldl_u((u32 *) (M.mem_base + addr));
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 4 -> %#x\n", addr, val);)
++ return val;
+ }
+
+ /****************************************************************************
+@@ -375,17 +276,17 @@ val - Value to store
+ REMARKS:
+ Writes a byte value to emulator memory.
+ ****************************************************************************/
+-void X86API wrb(
+- u32 addr,
+- u8 val)
++void X86API
++wrb(u32 addr, u8 val)
+ {
+-DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 1 <- %#x\n", addr, val);)
+- if (addr > M.mem_size - 1) {
+- DB(printk("mem_write: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
+- *(u8*)(M.mem_base + addr) = val;
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 1 <- %#x\n", addr, val);)
++ if (addr > M.mem_size - 1) {
++ DB(printk("mem_write: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
++ *(u8 *) (M.mem_base + addr) = val;
+ }
+
+ /****************************************************************************
+@@ -396,30 +297,24 @@ val - Value to store
+ REMARKS:
+ Writes a word value to emulator memory.
+ ****************************************************************************/
+-void X86API wrw(
+- u32 addr,
+- u16 val)
++void X86API
++wrw(u32 addr, u16 val)
+ {
+-DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 2 <- %#x\n", addr, val);)
+- if (addr > M.mem_size - 2) {
+- DB(printk("mem_write: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 2 <- %#x\n", addr, val);)
++ if (addr > M.mem_size - 2) {
++ DB(printk("mem_write: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
+ #ifdef __BIG_ENDIAN__
+- if (addr & 0x1) {
+- *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
+- *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
+- }
+- else
+-#endif
+-#if defined(ALPHA_UALOADS)
+- stw_u(val,(u16*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+- ustw(val,(u16*)(M.mem_base + addr));
+-#else
+- *(u16*)(M.mem_base + addr) = val;
++ if (addr & 0x1) {
++ *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff;
++ *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff;
++ }
++ else
+ #endif
++ stw_u(val, (u16 *) (M.mem_base + addr));
+ }
+
+ /****************************************************************************
+@@ -430,32 +325,26 @@ val - Value to store
+ REMARKS:
+ Writes a long value to emulator memory.
+ ****************************************************************************/
+-void X86API wrl(
+- u32 addr,
+- u32 val)
++void X86API
++wrl(u32 addr, u32 val)
+ {
+-DB( if (DEBUG_MEM_TRACE())
+- printk("%#08x 4 <- %#x\n", addr, val);)
+- if (addr > M.mem_size - 4) {
+- DB(printk("mem_write: address %#lx out of range!\n", addr);)
+- HALT_SYS();
+- }
++ DB(if (DEBUG_MEM_TRACE())
++ printk("%#08x 4 <- %#x\n", addr, val);)
++ if (addr > M.mem_size - 4) {
++ DB(printk("mem_write: address %#lx out of range!\n", addr);
++ )
++ HALT_SYS();
++ }
+ #ifdef __BIG_ENDIAN__
+- if (addr & 0x1) {
+- *(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
+- *(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
+- *(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
+- *(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
+- }
+- else
+-#endif
+-#if defined(ALPHA_UALOADS)
+- stl_u(val,(u32*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+- ustl(val,(u32*)(M.mem_base + addr));
+-#else
+- *(u32*)(M.mem_base + addr) = val;
++ if (addr & 0x1) {
++ *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff;
++ *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff;
++ *(u8 *) (M.mem_base + addr + 2) = (val >> 16) & 0xff;
++ *(u8 *) (M.mem_base + addr + 3) = (val >> 24) & 0xff;
++ }
++ else
+ #endif
++ stl_u(val, (u32 *) (M.mem_base + addr));
+ }
+
+ /****************************************************************************
+@@ -466,12 +355,12 @@ RETURN:
+ REMARKS:
+ Default PIO byte read function. Doesn't perform real inb.
+ ****************************************************************************/
+-static u8 X86API p_inb(
+- X86EMU_pioAddr addr)
++static u8 X86API
++p_inb(X86EMU_pioAddr addr)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("inb %#04x \n", addr);)
+- return 0;
++ DB(if (DEBUG_IO_TRACE())
++ printk("inb %#04x \n", addr);)
++ return 0;
+ }
+
+ /****************************************************************************
+@@ -482,12 +371,12 @@ RETURN:
+ REMARKS:
+ Default PIO word read function. Doesn't perform real inw.
+ ****************************************************************************/
+-static u16 X86API p_inw(
+- X86EMU_pioAddr addr)
++static u16 X86API
++p_inw(X86EMU_pioAddr addr)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("inw %#04x \n", addr);)
+- return 0;
++ DB(if (DEBUG_IO_TRACE())
++ printk("inw %#04x \n", addr);)
++ return 0;
+ }
+
+ /****************************************************************************
+@@ -498,12 +387,12 @@ RETURN:
+ REMARKS:
+ Default PIO long read function. Doesn't perform real inl.
+ ****************************************************************************/
+-static u32 X86API p_inl(
+- X86EMU_pioAddr addr)
++static u32 X86API
++p_inl(X86EMU_pioAddr addr)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("inl %#04x \n", addr);)
+- return 0;
++ DB(if (DEBUG_IO_TRACE())
++ printk("inl %#04x \n", addr);)
++ return 0;
+ }
+
+ /****************************************************************************
+@@ -513,13 +402,12 @@ val - Value to store
+ REMARKS:
+ Default PIO byte write function. Doesn't perform real outb.
+ ****************************************************************************/
+-static void X86API p_outb(
+- X86EMU_pioAddr addr,
+- u8 val)
++static void X86API
++p_outb(X86EMU_pioAddr addr, u8 val)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("outb %#02x -> %#04x \n", val, addr);)
+- return;
++ DB(if (DEBUG_IO_TRACE())
++ printk("outb %#02x -> %#04x \n", val, addr);)
++ return;
+ }
+
+ /****************************************************************************
+@@ -529,13 +417,12 @@ val - Value to store
+ REMARKS:
+ Default PIO word write function. Doesn't perform real outw.
+ ****************************************************************************/
+-static void X86API p_outw(
+- X86EMU_pioAddr addr,
+- u16 val)
++static void X86API
++p_outw(X86EMU_pioAddr addr, u16 val)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("outw %#04x -> %#04x \n", val, addr);)
+- return;
++ DB(if (DEBUG_IO_TRACE())
++ printk("outw %#04x -> %#04x \n", val, addr);)
++ return;
+ }
+
+ /****************************************************************************
+@@ -545,29 +432,29 @@ val - Value to store
+ REMARKS:
+ Default PIO ;ong write function. Doesn't perform real outl.
+ ****************************************************************************/
+-static void X86API p_outl(
+- X86EMU_pioAddr addr,
+- u32 val)
++static void X86API
++p_outl(X86EMU_pioAddr addr, u32 val)
+ {
+-DB( if (DEBUG_IO_TRACE())
+- printk("outl %#08x -> %#04x \n", val, addr);)
+- return;
++ DB(if (DEBUG_IO_TRACE())
++ printk("outl %#08x -> %#04x \n", val, addr);)
++ return;
+ }
+
+ /*------------------------- Global Variables ------------------------------*/
+
+-u8 (X86APIP sys_rdb)(u32 addr) = rdb;
+-u16 (X86APIP sys_rdw)(u32 addr) = rdw;
+-u32 (X86APIP sys_rdl)(u32 addr) = rdl;
+-void (X86APIP sys_wrb)(u32 addr,u8 val) = wrb;
+-void (X86APIP sys_wrw)(u32 addr,u16 val) = wrw;
+-void (X86APIP sys_wrl)(u32 addr,u32 val) = wrl;
+-u8 (X86APIP sys_inb)(X86EMU_pioAddr addr) = p_inb;
+-u16 (X86APIP sys_inw)(X86EMU_pioAddr addr) = p_inw;
+-u32 (X86APIP sys_inl)(X86EMU_pioAddr addr) = p_inl;
+-void (X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val) = p_outb;
+-void (X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val) = p_outw;
+-void (X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val) = p_outl;
++u8(X86APIP sys_rdb) (u32 addr) = rdb;
++u16(X86APIP sys_rdw) (u32 addr) = rdw;
++u32(X86APIP sys_rdl) (u32 addr) = rdl;
++void (X86APIP sys_wrb) (u32 addr, u8 val) = wrb;
++void (X86APIP sys_wrw) (u32 addr, u16 val) = wrw;
++void (X86APIP sys_wrl) (u32 addr, u32 val) = wrl;
++
++u8(X86APIP sys_inb) (X86EMU_pioAddr addr) = p_inb;
++u16(X86APIP sys_inw) (X86EMU_pioAddr addr) = p_inw;
++u32(X86APIP sys_inl) (X86EMU_pioAddr addr) = p_inl;
++void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val) = p_outb;
++void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val) = p_outw;
++void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val) = p_outl;
+
+ /*----------------------------- Setup -------------------------------------*/
+
+@@ -580,8 +467,8 @@ This function is used to set the pointers to functions which access
+ memory space, allowing the user application to override these functions
+ and hook them out as necessary for their application.
+ ****************************************************************************/
+-void X86EMU_setupMemFuncs(
+- X86EMU_memFuncs *funcs)
++void
++X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs)
+ {
+ sys_rdb = funcs->rdb;
+ sys_rdw = funcs->rdw;
+@@ -600,8 +487,8 @@ This function is used to set the pointers to functions which access
+ I/O space, allowing the user application to override these functions
+ and hook them out as necessary for their application.
+ ****************************************************************************/
+-void X86EMU_setupPioFuncs(
+- X86EMU_pioFuncs *funcs)
++void
++X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs)
+ {
+ sys_inb = funcs->inb;
+ sys_inw = funcs->inw;
+@@ -624,17 +511,17 @@ in the emulator via the interrupt vector table. This allows the application
+ to get control when the code being emulated executes specific software
+ interrupts.
+ ****************************************************************************/
+-void X86EMU_setupIntrFuncs(
+- X86EMU_intrFuncs funcs[])
++void
++X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[])
+ {
+ int i;
+-
+- for (i=0; i < 256; i++)
+- _X86EMU_intrTab[i] = NULL;
+- if (funcs) {
+- for (i = 0; i < 256; i++)
+- _X86EMU_intrTab[i] = funcs[i];
+- }
++
++ for (i = 0; i < 256; i++)
++ _X86EMU_intrTab[i] = NULL;
++ if (funcs) {
++ for (i = 0; i < 256; i++)
++ _X86EMU_intrTab[i] = funcs[i];
++ }
+ }
+
+ /****************************************************************************
+@@ -649,15 +536,15 @@ so that the code in the emulator will continue processing the software
+ interrupt as per normal. This essentially allows system code to actively
+ hook and handle certain software interrupts as necessary.
+ ****************************************************************************/
+-void X86EMU_prepareForInt(
+- int num)
++void
++X86EMU_prepareForInt(int num)
+ {
+- push_word((u16)M.x86.R_FLG);
++ push_word((u16) M.x86.R_FLG);
+ CLEAR_FLAG(F_IF);
+ CLEAR_FLAG(F_TF);
+ push_word(M.x86.R_CS);
+ M.x86.R_CS = mem_access_word(num * 4 + 2);
+ push_word(M.x86.R_IP);
+ M.x86.R_IP = mem_access_word(num * 4);
+- M.x86.intr = 0;
++ M.x86.intr = 0;
+ }
+diff --git a/libs/x86emu/validate.c b/libs/x86emu/validate.c
+index 239f6c1..4c36e1d 100644
+--- a/libs/x86emu/validate.c
++++ b/libs/x86emu/validate.c
+@@ -591,58 +591,62 @@
+ printk("passed\n"); \
+ }
+
+-void printk(const char *fmt, ...)
++void
++printk(const char *fmt, ...)
+ {
+ va_list argptr;
++
+ va_start(argptr, fmt);
+ vfprintf(stdout, fmt, argptr);
+ fflush(stdout);
+ va_end(argptr);
+ }
+
+-char * print_flags(char *buf,ulong flags)
++char *
++print_flags(char *buf, ulong flags)
+ {
+ char *separator = "";
+
+ buf[0] = 0;
+ if (flags & F_CF) {
+- strcat(buf,separator);
+- strcat(buf,"CF");
++ strcat(buf, separator);
++ strcat(buf, "CF");
+ separator = ",";
+- }
++ }
+ if (flags & F_PF) {
+- strcat(buf,separator);
+- strcat(buf,"PF");
++ strcat(buf, separator);
++ strcat(buf, "PF");
+ separator = ",";
+- }
++ }
+ if (flags & F_AF) {
+- strcat(buf,separator);
+- strcat(buf,"AF");
++ strcat(buf, separator);
++ strcat(buf, "AF");
+ separator = ",";
+- }
++ }
+ if (flags & F_ZF) {
+- strcat(buf,separator);
+- strcat(buf,"ZF");
++ strcat(buf, separator);
++ strcat(buf, "ZF");
+ separator = ",";
+- }
++ }
+ if (flags & F_SF) {
+- strcat(buf,separator);
+- strcat(buf,"SF");
++ strcat(buf, separator);
++ strcat(buf, "SF");
+ separator = ",";
+- }
++ }
+ if (flags & F_OF) {
+- strcat(buf,separator);
+- strcat(buf,"OF");
++ strcat(buf, separator);
++ strcat(buf, "OF");
+ separator = ",";
+- }
++ }
+ if (separator[0] == 0)
+- strcpy(buf,"None");
++ strcpy(buf, "None");
+ return buf;
+ }
+
+-int main(int argc)
++int
++main(int argc)
+ {
+- ulong def_flags;
++ ulong def_flags;
+ int trace = false;
+
+ if (argc > 1)
+@@ -673,7 +677,7 @@ int main(int argc)
+ VAL_LONG_LONG_BINARY(cmp_long);
+
+ VAL_BYTE_UNARY(daa_byte);
+- VAL_BYTE_UNARY(das_byte); // Fails for 0x9A (out of range anyway)
++ VAL_BYTE_UNARY(das_byte); /* Fails for 0x9A (out of range anyway) */
+
+ VAL_BYTE_UNARY(dec_byte);
+ VAL_WORD_UNARY(dec_word);
+diff --git a/libs/x86emu/x86emu.h b/libs/x86emu/x86emu.h
+index 795e2d6..501dd91 100644
+--- a/libs/x86emu/x86emu.h
++++ b/libs/x86emu/x86emu.h
+@@ -56,7 +56,7 @@ typedef int X86EMU_pioAddr;
+ /*---------------------- Macros and type definitions ----------------------*/
+
+ #ifdef PACK
+-# pragma PACK /* Don't pack structs with function pointers! */
++#pragma PACK /* Don't pack structs with function pointers! */
+ #endif
+
+ /****************************************************************************
+@@ -81,13 +81,13 @@ outw - Function to write a word to an I/O port
+ outl - Function to write a dword to an I/O port
+ ****************************************************************************/
+ typedef struct {
+- u8 (X86APIP inb)(X86EMU_pioAddr addr);
+- u16 (X86APIP inw)(X86EMU_pioAddr addr);
+- u32 (X86APIP inl)(X86EMU_pioAddr addr);
+- void (X86APIP outb)(X86EMU_pioAddr addr, u8 val);
+- void (X86APIP outw)(X86EMU_pioAddr addr, u16 val);
+- void (X86APIP outl)(X86EMU_pioAddr addr, u32 val);
+- } X86EMU_pioFuncs;
++ u8(X86APIP inb) (X86EMU_pioAddr addr);
++ u16(X86APIP inw) (X86EMU_pioAddr addr);
++ u32(X86APIP inl) (X86EMU_pioAddr addr);
++ void (X86APIP outb) (X86EMU_pioAddr addr, u8 val);
++ void (X86APIP outw) (X86EMU_pioAddr addr, u16 val);
++ void (X86APIP outl) (X86EMU_pioAddr addr, u32 val);
++} X86EMU_pioFuncs;
+
+ /****************************************************************************
+ REMARKS:
+@@ -112,13 +112,13 @@ wrw - Function to write a word to an address
+ wrl - Function to write a dword to an address
+ ****************************************************************************/
+ typedef struct {
+- u8 (X86APIP rdb)(u32 addr);
+- u16 (X86APIP rdw)(u32 addr);
+- u32 (X86APIP rdl)(u32 addr);
+- void (X86APIP wrb)(u32 addr, u8 val);
+- void (X86APIP wrw)(u32 addr, u16 val);
+- void (X86APIP wrl)(u32 addr, u32 val);
+- } X86EMU_memFuncs;
++ u8(X86APIP rdb) (u32 addr);
++ u16(X86APIP rdw) (u32 addr);
++ u32(X86APIP rdl) (u32 addr);
++ void (X86APIP wrb) (u32 addr, u8 val);
++ void (X86APIP wrw) (u32 addr, u16 val);
++ void (X86APIP wrl) (u32 addr, u32 val);
++} X86EMU_memFuncs;
+
+ /****************************************************************************
+ Here are the default memory read and write
+@@ -132,29 +132,29 @@ extern void X86API wrw(u32 addr, u16 val);
+ extern void X86API wrl(u32 addr, u32 val);
+
+ #ifdef END_PACK
+-# pragma END_PACK
++#pragma END_PACK
+ #endif
+
+ /*--------------------- type definitions -----------------------------------*/
+
+-typedef void (X86APIP X86EMU_intrFuncs)(int num);
++typedef void (X86APIP X86EMU_intrFuncs) (int num);
+ extern X86EMU_intrFuncs _X86EMU_intrTab[256];
+
+ /*-------------------------- Function Prototypes --------------------------*/
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+-void X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
+-void X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
+-void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
+-void X86EMU_prepareForInt(int num);
++ void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs);
++ void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs);
++ void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
++ void X86EMU_prepareForInt(int num);
+
+ /* decode.c */
+
+-void X86EMU_exec(void);
+-void X86EMU_halt_sys(void);
++ void X86EMU_exec(void);
++ void X86EMU_halt_sys(void);
+
+ #ifdef DEBUG
+ #define HALT_SYS() \
+@@ -166,8 +166,8 @@ void X86EMU_halt_sys(void);
+
+ /* Debug options */
+
+-#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
+-#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
++#define DEBUG_DECODE_F 0x000001 /* print decoded instruction */
++#define DEBUG_TRACE_F 0x000002 /* dump regs before/after execution */
+ #define DEBUG_STEP_F 0x000004
+ #define DEBUG_DISASSEMBLE_F 0x000008
+ #define DEBUG_BREAK_F 0x000010
+@@ -175,24 +175,23 @@ void X86EMU_halt_sys(void);
+ #define DEBUG_SAVE_IP_CS_F 0x000040
+ #define DEBUG_FS_F 0x000080
+ #define DEBUG_PROC_F 0x000100
+-#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
++#define DEBUG_SYSINT_F 0x000200 /* bios system interrupts. */
+ #define DEBUG_TRACECALL_F 0x000400
+ #define DEBUG_INSTRUMENT_F 0x000800
+-#define DEBUG_MEM_TRACE_F 0x001000
+-#define DEBUG_IO_TRACE_F 0x002000
++#define DEBUG_MEM_TRACE_F 0x001000
++#define DEBUG_IO_TRACE_F 0x002000
+ #define DEBUG_TRACECALL_REGS_F 0x004000
+-#define DEBUG_DECODE_NOPRINT_F 0x008000
++#define DEBUG_DECODE_NOPRINT_F 0x008000
+ #define DEBUG_EXIT 0x010000
+ #define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
+
+-void X86EMU_trace_regs(void);
+-void X86EMU_trace_xregs(void);
+-void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
+-int X86EMU_trace_on(void);
+-int X86EMU_trace_off(void);
++ void X86EMU_trace_regs(void);
++ void X86EMU_trace_xregs(void);
++ void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
++ int X86EMU_trace_on(void);
++ int X86EMU_trace_off(void);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_X86EMU_H */
++#endif /* __X86EMU_X86EMU_H */
+diff --git a/libs/x86emu/x86emu/debug.h b/libs/x86emu/x86emu/debug.h
+index 47aacb6..385b804 100644
+--- a/libs/x86emu/x86emu/debug.h
++++ b/libs/x86emu/x86emu/debug.h
+@@ -45,65 +45,65 @@
+
+ #define CHECK_IP_FETCH_F 0x1
+ #define CHECK_SP_ACCESS_F 0x2
+-#define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */
+-#define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset*/
++#define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */
++#define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset */
+
+ #ifdef DEBUG
+-# define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F)
+-# define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F)
+-# define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F)
+-# define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F)
++#define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F)
++#define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F)
++#define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F)
++#define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F)
+ #else
+-# define CHECK_IP_FETCH()
+-# define CHECK_SP_ACCESS()
+-# define CHECK_MEM_ACCESS()
+-# define CHECK_DATA_ACCESS()
++#define CHECK_IP_FETCH()
++#define CHECK_SP_ACCESS()
++#define CHECK_MEM_ACCESS()
++#define CHECK_DATA_ACCESS()
+ #endif
+
+ #ifdef DEBUG
+-# define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F)
+-# define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F)
+-# define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F)
+-# define DEBUG_STEP() (M.x86.debug & DEBUG_STEP_F)
+-# define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F)
+-# define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F)
+-# define DEBUG_SVC() (M.x86.debug & DEBUG_SVC_F)
+-# define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F)
+-
+-# define DEBUG_FS() (M.x86.debug & DEBUG_FS_F)
+-# define DEBUG_PROC() (M.x86.debug & DEBUG_PROC_F)
+-# define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F)
+-# define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F)
+-# define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
+-# define DEBUG_SYS() (M.x86.debug & DEBUG_SYS_F)
+-# define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F)
+-# define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F)
+-# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
++#define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F)
++#define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F)
++#define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F)
++#define DEBUG_STEP() (M.x86.debug & DEBUG_STEP_F)
++#define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F)
++#define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F)
++#define DEBUG_SVC() (M.x86.debug & DEBUG_SVC_F)
++#define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F)
++
++#define DEBUG_FS() (M.x86.debug & DEBUG_FS_F)
++#define DEBUG_PROC() (M.x86.debug & DEBUG_PROC_F)
++#define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F)
++#define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F)
++#define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
++#define DEBUG_SYS() (M.x86.debug & DEBUG_SYS_F)
++#define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F)
++#define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F)
++#define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
+ #else
+-# define DEBUG_INSTRUMENT() 0
+-# define DEBUG_DECODE() 0
+-# define DEBUG_TRACE() 0
+-# define DEBUG_STEP() 0
+-# define DEBUG_DISASSEMBLE() 0
+-# define DEBUG_BREAK() 0
+-# define DEBUG_SVC() 0
+-# define DEBUG_SAVE_IP_CS() 0
+-# define DEBUG_FS() 0
+-# define DEBUG_PROC() 0
+-# define DEBUG_SYSINT() 0
+-# define DEBUG_TRACECALL() 0
+-# define DEBUG_TRACECALLREGS() 0
+-# define DEBUG_SYS() 0
+-# define DEBUG_MEM_TRACE() 0
+-# define DEBUG_IO_TRACE() 0
+-# define DEBUG_DECODE_NOPRINT() 0
++#define DEBUG_INSTRUMENT() 0
++#define DEBUG_DECODE() 0
++#define DEBUG_TRACE() 0
++#define DEBUG_STEP() 0
++#define DEBUG_DISASSEMBLE() 0
++#define DEBUG_BREAK() 0
++#define DEBUG_SVC() 0
++#define DEBUG_SAVE_IP_CS() 0
++#define DEBUG_FS() 0
++#define DEBUG_PROC() 0
++#define DEBUG_SYSINT() 0
++#define DEBUG_TRACECALL() 0
++#define DEBUG_TRACECALLREGS() 0
++#define DEBUG_SYS() 0
++#define DEBUG_MEM_TRACE() 0
++#define DEBUG_IO_TRACE() 0
++#define DEBUG_DECODE_NOPRINT() 0
+ #endif
+
+ #ifdef DEBUG
+
+-# define DECODE_PRINTF(x) if (DEBUG_DECODE()) \
++#define DECODE_PRINTF(x) if (DEBUG_DECODE()) \
+ x86emu_decode_printf(x)
+-# define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \
++#define DECODE_PRINTF2(x,y) if (DEBUG_DECODE()) \
+ x86emu_decode_printf2(x,y)
+
+ /*
+@@ -123,10 +123,10 @@
+ M.x86.saved_ip = y; \
+ }
+ #else
+-# define INC_DECODED_INST_LEN(x)
+-# define DECODE_PRINTF(x)
+-# define DECODE_PRINTF2(x,y)
+-# define SAVE_IP_CS(x,y)
++#define INC_DECODED_INST_LEN(x)
++#define DECODE_PRINTF(x)
++#define DECODE_PRINTF2(x,y)
++#define SAVE_IP_CS(x,y)
+ #endif
+
+ #ifdef DEBUG
+@@ -137,13 +137,13 @@
+ } \
+ if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
+ #else
+-# define TRACE_REGS()
++#define TRACE_REGS()
+ #endif
+
+ #ifdef DEBUG
+-# define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step()
++#define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step()
+ #else
+-# define SINGLE_STEP()
++#define SINGLE_STEP()
+ #endif
+
+ #define TRACE_AND_STEP() \
+@@ -151,29 +151,29 @@
+ SINGLE_STEP()
+
+ #ifdef DEBUG
+-# define START_OF_INSTR()
+-# define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr();
+-# define END_OF_INSTR_NO_TRACE() x86emu_end_instr();
++#define START_OF_INSTR()
++#define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr();
++#define END_OF_INSTR_NO_TRACE() x86emu_end_instr();
+ #else
+-# define START_OF_INSTR()
+-# define END_OF_INSTR()
+-# define END_OF_INSTR_NO_TRACE()
++#define START_OF_INSTR()
++#define END_OF_INSTR()
++#define END_OF_INSTR_NO_TRACE()
+ #endif
+
+ #ifdef DEBUG
+-# define CALL_TRACE(u,v,w,x,s) \
++#define CALL_TRACE(u,v,w,x,s) \
+ if (DEBUG_TRACECALLREGS()) \
+ x86emu_dump_regs(); \
+ if (DEBUG_TRACECALL()) \
+ printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
+-# define RETURN_TRACE(n,u,v) \
++#define RETURN_TRACE(n,u,v) \
+ if (DEBUG_TRACECALLREGS()) \
+ x86emu_dump_regs(); \
+ if (DEBUG_TRACECALL()) \
+ printk("%04x:%04x: %s\n",u,v,n);
+ #else
+-# define CALL_TRACE(u,v,w,x,s)
+-# define RETURN_TRACE(n,u,v)
++#define CALL_TRACE(u,v,w,x,s)
++#define RETURN_TRACE(n,u,v)
+ #endif
+
+ #ifdef DEBUG
+@@ -185,26 +185,25 @@
+ /*-------------------------- Function Prototypes --------------------------*/
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+-extern void x86emu_inc_decoded_inst_len (int x);
+-extern void x86emu_decode_printf (char *x);
+-extern void x86emu_decode_printf2 (char *x, int y);
+-extern void x86emu_just_disassemble (void);
+-extern void x86emu_single_step (void);
+-extern void x86emu_end_instr (void);
+-extern void x86emu_dump_regs (void);
+-extern void x86emu_dump_xregs (void);
+-extern void x86emu_print_int_vect (u16 iv);
+-extern void x86emu_instrument_instruction (void);
+-extern void x86emu_check_ip_access (void);
+-extern void x86emu_check_sp_access (void);
+-extern void x86emu_check_mem_access (u32 p);
+-extern void x86emu_check_data_access (uint s, uint o);
++ extern void x86emu_inc_decoded_inst_len(int x);
++ extern void x86emu_decode_printf(const char *x);
++ extern void x86emu_decode_printf2(const char *x, int y);
++ extern void x86emu_just_disassemble(void);
++ extern void x86emu_single_step(void);
++ extern void x86emu_end_instr(void);
++ extern void x86emu_dump_regs(void);
++ extern void x86emu_dump_xregs(void);
++ extern void x86emu_print_int_vect(u16 iv);
++ extern void x86emu_instrument_instruction(void);
++ extern void x86emu_check_ip_access(void);
++ extern void x86emu_check_sp_access(void);
++ extern void x86emu_check_mem_access(u32 p);
++ extern void x86emu_check_data_access(uint s, uint o);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_DEBUG_H */
++#endif /* __X86EMU_DEBUG_H */
+diff --git a/libs/x86emu/x86emu/decode.h b/libs/x86emu/x86emu/decode.h
+index 61cd4dc..49a1f7b 100644
+--- a/libs/x86emu/x86emu/decode.h
++++ b/libs/x86emu/x86emu/decode.h
+@@ -52,37 +52,36 @@
+ /*-------------------------- Function Prototypes --------------------------*/
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+-void x86emu_intr_raise (u8 type);
+-void fetch_decode_modrm (int *mod,int *regh,int *regl);
+-u8 fetch_byte_imm (void);
+-u16 fetch_word_imm (void);
+-u32 fetch_long_imm (void);
+-u8 fetch_data_byte (uint offset);
+-u8 fetch_data_byte_abs (uint segment, uint offset);
+-u16 fetch_data_word (uint offset);
+-u16 fetch_data_word_abs (uint segment, uint offset);
+-u32 fetch_data_long (uint offset);
+-u32 fetch_data_long_abs (uint segment, uint offset);
+-void store_data_byte (uint offset, u8 val);
+-void store_data_byte_abs (uint segment, uint offset, u8 val);
+-void store_data_word (uint offset, u16 val);
+-void store_data_word_abs (uint segment, uint offset, u16 val);
+-void store_data_long (uint offset, u32 val);
+-void store_data_long_abs (uint segment, uint offset, u32 val);
+-u8* decode_rm_byte_register(int reg);
+-u16* decode_rm_word_register(int reg);
+-u32* decode_rm_long_register(int reg);
+-u16* decode_rm_seg_register(int reg);
+-u32 decode_rm00_address(int rm);
+-u32 decode_rm01_address(int rm);
+-u32 decode_rm10_address(int rm);
+-u32 decode_sib_address(int sib, int mod);
++ void x86emu_intr_raise(u8 type);
++ void fetch_decode_modrm(int *mod, int *regh, int *regl);
++ u8 fetch_byte_imm(void);
++ u16 fetch_word_imm(void);
++ u32 fetch_long_imm(void);
++ u8 fetch_data_byte(uint offset);
++ u8 fetch_data_byte_abs(uint segment, uint offset);
++ u16 fetch_data_word(uint offset);
++ u16 fetch_data_word_abs(uint segment, uint offset);
++ u32 fetch_data_long(uint offset);
++ u32 fetch_data_long_abs(uint segment, uint offset);
++ void store_data_byte(uint offset, u8 val);
++ void store_data_byte_abs(uint segment, uint offset, u8 val);
++ void store_data_word(uint offset, u16 val);
++ void store_data_word_abs(uint segment, uint offset, u16 val);
++ void store_data_long(uint offset, u32 val);
++ void store_data_long_abs(uint segment, uint offset, u32 val);
++ u8 *decode_rm_byte_register(int reg);
++ u16 *decode_rm_word_register(int reg);
++ u32 *decode_rm_long_register(int reg);
++ u16 *decode_rm_seg_register(int reg);
++ u32 decode_rm00_address(int rm);
++ u32 decode_rm01_address(int rm);
++ u32 decode_rm10_address(int rm);
++ u32 decode_sib_address(int sib, int mod);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_DECODE_H */
++#endif /* __X86EMU_DECODE_H */
+diff --git a/libs/x86emu/x86emu/fpu.h b/libs/x86emu/x86emu/fpu.h
+index 5fb2714..1c11498 100644
+--- a/libs/x86emu/x86emu/fpu.h
++++ b/libs/x86emu/x86emu/fpu.h
+@@ -40,22 +40,21 @@
+ #define __X86EMU_FPU_H
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+ /* these have to be defined, whether 8087 support compiled in or not. */
+
+-extern void x86emuOp_esc_coprocess_d8 (u8 op1);
+-extern void x86emuOp_esc_coprocess_d9 (u8 op1);
+-extern void x86emuOp_esc_coprocess_da (u8 op1);
+-extern void x86emuOp_esc_coprocess_db (u8 op1);
+-extern void x86emuOp_esc_coprocess_dc (u8 op1);
+-extern void x86emuOp_esc_coprocess_dd (u8 op1);
+-extern void x86emuOp_esc_coprocess_de (u8 op1);
+-extern void x86emuOp_esc_coprocess_df (u8 op1);
++ extern void x86emuOp_esc_coprocess_d8(u8 op1);
++ extern void x86emuOp_esc_coprocess_d9(u8 op1);
++ extern void x86emuOp_esc_coprocess_da(u8 op1);
++ extern void x86emuOp_esc_coprocess_db(u8 op1);
++ extern void x86emuOp_esc_coprocess_dc(u8 op1);
++ extern void x86emuOp_esc_coprocess_dd(u8 op1);
++ extern void x86emuOp_esc_coprocess_de(u8 op1);
++ extern void x86emuOp_esc_coprocess_df(u8 op1);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_FPU_H */
++#endif /* __X86EMU_FPU_H */
+diff --git a/libs/x86emu/x86emu/fpu_regs.h b/libs/x86emu/x86emu/fpu_regs.h
+index e59b807..5a780e6 100644
+--- a/libs/x86emu/x86emu/fpu_regs.h
++++ b/libs/x86emu/x86emu/fpu_regs.h
+@@ -42,23 +42,23 @@
+ #ifdef X86_FPU_SUPPORT
+
+ #ifdef PACK
+-# pragma PACK
++#pragma PACK
+ #endif
+
+ /* Basic 8087 register can hold any of the following values: */
+
+ union x86_fpu_reg_u {
+- s8 tenbytes[10];
+- double dval;
+- float fval;
+- s16 sval;
+- s32 lval;
+- };
++ s8 tenbytes[10];
++ double dval;
++ float fval;
++ s16 sval;
++ s32 lval;
++};
+
+ struct x86_fpu_reg {
+- union x86_fpu_reg_u reg;
+- char tag;
+- };
++ union x86_fpu_reg_u reg;
++ char tag;
++};
+
+ /*
+ * Since we are not going to worry about the problems of aliasing
+@@ -83,14 +83,14 @@ struct x86_fpu_reg {
+ #define X86_FPU_STKTOP 0
+
+ struct x86_fpu_registers {
+- struct x86_fpu_reg x86_fpu_stack[8];
+- int x86_fpu_flags;
+- int x86_fpu_config; /* rounding modes, etc. */
+- short x86_fpu_tos, x86_fpu_bos;
+- };
++ struct x86_fpu_reg x86_fpu_stack[8];
++ int x86_fpu_flags;
++ int x86_fpu_config; /* rounding modes, etc. */
++ short x86_fpu_tos, x86_fpu_bos;
++};
+
+ #ifdef END_PACK
+-# pragma END_PACK
++#pragma END_PACK
+ #endif
+
+ /*
+@@ -104,16 +104,16 @@ struct x86_fpu_registers {
+ * instructions.
+ */
+
+-#endif /* X86_FPU_SUPPORT */
++#endif /* X86_FPU_SUPPORT */
+
+ #ifdef DEBUG
+-# define DECODE_PRINTINSTR32(t,mod,rh,rl) \
++#define DECODE_PRINTINSTR32(t,mod,rh,rl) \
+ DECODE_PRINTF(t[(mod<<3)+(rh)]);
+-# define DECODE_PRINTINSTR256(t,mod,rh,rl) \
++#define DECODE_PRINTINSTR256(t,mod,rh,rl) \
+ DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
+ #else
+-# define DECODE_PRINTINSTR32(t,mod,rh,rl)
+-# define DECODE_PRINTINSTR256(t,mod,rh,rl)
++#define DECODE_PRINTINSTR32(t,mod,rh,rl)
++#define DECODE_PRINTINSTR256(t,mod,rh,rl)
+ #endif
+
+-#endif /* __X86EMU_FPU_REGS_H */
++#endif /* __X86EMU_FPU_REGS_H */
+diff --git a/libs/x86emu/x86emu/ops.h b/libs/x86emu/x86emu/ops.h
+index 65ea676..1bc07a4 100644
+--- a/libs/x86emu/x86emu/ops.h
++++ b/libs/x86emu/x86emu/ops.h
+@@ -39,7 +39,7 @@
+ #ifndef __X86EMU_OPS_H
+ #define __X86EMU_OPS_H
+
+-extern void (*x86emu_optab[0x100])(u8 op1);
+-extern void (*x86emu_optab2[0x100])(u8 op2);
++extern void (*x86emu_optab[0x100]) (u8 op1);
++extern void (*x86emu_optab2[0x100]) (u8 op2);
+
+-#endif /* __X86EMU_OPS_H */
++#endif /* __X86EMU_OPS_H */
+diff --git a/libs/x86emu/x86emu/prim_asm.h b/libs/x86emu/x86emu/prim_asm.h
+index e023cf8..aca132b 100644
+--- a/libs/x86emu/x86emu/prim_asm.h
++++ b/libs/x86emu/x86emu/prim_asm.h
+@@ -49,14 +49,16 @@
+ #define __HAVE_INLINE_ASSEMBLER__
+ #endif
+
+-u32 get_flags_asm(void);
++u32 get_flags_asm(void);
++
+ #pragma aux get_flags_asm = \
+ "pushf" \
+ "pop eax" \
+ value [eax] \
+ modify exact [eax];
+
+-u16 aaa_word_asm(u32 *flags,u16 d);
++u16 aaa_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aaa_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -67,7 +69,8 @@ u16 aaa_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u16 aas_word_asm(u32 *flags,u16 d);
++u16 aas_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aas_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -78,7 +81,8 @@ u16 aas_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u16 aad_word_asm(u32 *flags,u16 d);
++u16 aad_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aad_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -89,7 +93,8 @@ u16 aad_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u16 aam_word_asm(u32 *flags,u8 d);
++u16 aam_word_asm(u32 * flags, u8 d);
++
+ #pragma aux aam_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -100,7 +105,8 @@ u16 aam_word_asm(u32 *flags,u8 d);
+ value [ax] \
+ modify exact [ax];
+
+-u8 adc_byte_asm(u32 *flags,u8 d, u8 s);
++u8 adc_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux adc_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -111,7 +117,8 @@ u8 adc_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 adc_word_asm(u32 *flags,u16 d, u16 s);
++u16 adc_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux adc_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -122,7 +129,8 @@ u16 adc_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 adc_long_asm(u32 *flags,u32 d, u32 s);
++u32 adc_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux adc_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -133,7 +141,8 @@ u32 adc_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 add_byte_asm(u32 *flags,u8 d, u8 s);
++u8 add_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux add_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -144,7 +153,8 @@ u8 add_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 add_word_asm(u32 *flags,u16 d, u16 s);
++u16 add_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux add_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -155,7 +165,8 @@ u16 add_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 add_long_asm(u32 *flags,u32 d, u32 s);
++u32 add_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux add_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -166,7 +177,8 @@ u32 add_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 and_byte_asm(u32 *flags,u8 d, u8 s);
++u8 and_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux and_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -177,7 +189,8 @@ u8 and_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 and_word_asm(u32 *flags,u16 d, u16 s);
++u16 and_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux and_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -188,7 +201,8 @@ u16 and_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 and_long_asm(u32 *flags,u32 d, u32 s);
++u32 and_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux and_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -199,7 +213,8 @@ u32 and_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 cmp_byte_asm(u32 *flags,u8 d, u8 s);
++u8 cmp_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux cmp_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -210,7 +225,8 @@ u8 cmp_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 cmp_word_asm(u32 *flags,u16 d, u16 s);
++u16 cmp_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux cmp_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -221,7 +237,8 @@ u16 cmp_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 cmp_long_asm(u32 *flags,u32 d, u32 s);
++u32 cmp_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux cmp_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -232,7 +249,8 @@ u32 cmp_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 daa_byte_asm(u32 *flags,u8 d);
++u8 daa_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux daa_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -243,7 +261,8 @@ u8 daa_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u8 das_byte_asm(u32 *flags,u8 d);
++u8 das_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux das_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -254,7 +273,8 @@ u8 das_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u8 dec_byte_asm(u32 *flags,u8 d);
++u8 dec_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux dec_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -265,7 +285,8 @@ u8 dec_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u16 dec_word_asm(u32 *flags,u16 d);
++u16 dec_word_asm(u32 * flags, u16 d);
++
+ #pragma aux dec_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -276,7 +297,8 @@ u16 dec_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u32 dec_long_asm(u32 *flags,u32 d);
++u32 dec_long_asm(u32 * flags, u32 d);
++
+ #pragma aux dec_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -287,7 +309,8 @@ u32 dec_long_asm(u32 *flags,u32 d);
+ value [eax] \
+ modify exact [eax];
+
+-u8 inc_byte_asm(u32 *flags,u8 d);
++u8 inc_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux inc_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -298,7 +321,8 @@ u8 inc_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u16 inc_word_asm(u32 *flags,u16 d);
++u16 inc_word_asm(u32 * flags, u16 d);
++
+ #pragma aux inc_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -309,7 +333,8 @@ u16 inc_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u32 inc_long_asm(u32 *flags,u32 d);
++u32 inc_long_asm(u32 * flags, u32 d);
++
+ #pragma aux inc_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -320,7 +345,8 @@ u32 inc_long_asm(u32 *flags,u32 d);
+ value [eax] \
+ modify exact [eax];
+
+-u8 or_byte_asm(u32 *flags,u8 d, u8 s);
++u8 or_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux or_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -331,7 +357,8 @@ u8 or_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 or_word_asm(u32 *flags,u16 d, u16 s);
++u16 or_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux or_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -342,7 +369,8 @@ u16 or_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 or_long_asm(u32 *flags,u32 d, u32 s);
++u32 or_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux or_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -353,7 +381,8 @@ u32 or_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 neg_byte_asm(u32 *flags,u8 d);
++u8 neg_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux neg_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -364,7 +393,8 @@ u8 neg_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u16 neg_word_asm(u32 *flags,u16 d);
++u16 neg_word_asm(u32 * flags, u16 d);
++
+ #pragma aux neg_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -375,7 +405,8 @@ u16 neg_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u32 neg_long_asm(u32 *flags,u32 d);
++u32 neg_long_asm(u32 * flags, u32 d);
++
+ #pragma aux neg_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -386,7 +417,8 @@ u32 neg_long_asm(u32 *flags,u32 d);
+ value [eax] \
+ modify exact [eax];
+
+-u8 not_byte_asm(u32 *flags,u8 d);
++u8 not_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux not_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -397,7 +429,8 @@ u8 not_byte_asm(u32 *flags,u8 d);
+ value [al] \
+ modify exact [al];
+
+-u16 not_word_asm(u32 *flags,u16 d);
++u16 not_word_asm(u32 * flags, u16 d);
++
+ #pragma aux not_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -408,7 +441,8 @@ u16 not_word_asm(u32 *flags,u16 d);
+ value [ax] \
+ modify exact [ax];
+
+-u32 not_long_asm(u32 *flags,u32 d);
++u32 not_long_asm(u32 * flags, u32 d);
++
+ #pragma aux not_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -419,7 +453,8 @@ u32 not_long_asm(u32 *flags,u32 d);
+ value [eax] \
+ modify exact [eax];
+
+-u8 rcl_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rcl_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rcl_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -430,7 +465,8 @@ u8 rcl_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 rcl_word_asm(u32 *flags,u16 d, u8 s);
++u16 rcl_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rcl_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -441,7 +477,8 @@ u16 rcl_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 rcl_long_asm(u32 *flags,u32 d, u8 s);
++u32 rcl_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rcl_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -452,7 +489,8 @@ u32 rcl_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 rcr_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rcr_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rcr_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -463,7 +501,8 @@ u8 rcr_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 rcr_word_asm(u32 *flags,u16 d, u8 s);
++u16 rcr_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rcr_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -474,7 +513,8 @@ u16 rcr_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 rcr_long_asm(u32 *flags,u32 d, u8 s);
++u32 rcr_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rcr_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -485,7 +525,8 @@ u32 rcr_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 rol_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rol_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rol_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -496,7 +537,8 @@ u8 rol_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 rol_word_asm(u32 *flags,u16 d, u8 s);
++u16 rol_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rol_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -507,7 +549,8 @@ u16 rol_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 rol_long_asm(u32 *flags,u32 d, u8 s);
++u32 rol_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rol_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -518,7 +561,8 @@ u32 rol_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 ror_byte_asm(u32 *flags,u8 d, u8 s);
++u8 ror_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux ror_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -529,7 +573,8 @@ u8 ror_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 ror_word_asm(u32 *flags,u16 d, u8 s);
++u16 ror_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux ror_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -540,7 +585,8 @@ u16 ror_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 ror_long_asm(u32 *flags,u32 d, u8 s);
++u32 ror_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux ror_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -551,7 +597,8 @@ u32 ror_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 shl_byte_asm(u32 *flags,u8 d, u8 s);
++u8 shl_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux shl_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -562,7 +609,8 @@ u8 shl_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 shl_word_asm(u32 *flags,u16 d, u8 s);
++u16 shl_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux shl_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -573,7 +621,8 @@ u16 shl_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 shl_long_asm(u32 *flags,u32 d, u8 s);
++u32 shl_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux shl_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -584,7 +633,8 @@ u32 shl_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 shr_byte_asm(u32 *flags,u8 d, u8 s);
++u8 shr_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux shr_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -595,7 +645,8 @@ u8 shr_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 shr_word_asm(u32 *flags,u16 d, u8 s);
++u16 shr_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux shr_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -606,7 +657,8 @@ u16 shr_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 shr_long_asm(u32 *flags,u32 d, u8 s);
++u32 shr_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux shr_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -617,7 +669,8 @@ u32 shr_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u8 sar_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sar_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sar_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -628,7 +681,8 @@ u8 sar_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al cl];
+
+-u16 sar_word_asm(u32 *flags,u16 d, u8 s);
++u16 sar_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux sar_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -639,7 +693,8 @@ u16 sar_word_asm(u32 *flags,u16 d, u8 s);
+ value [ax] \
+ modify exact [ax cl];
+
+-u32 sar_long_asm(u32 *flags,u32 d, u8 s);
++u32 sar_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux sar_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -650,7 +705,8 @@ u32 sar_long_asm(u32 *flags,u32 d, u8 s);
+ value [eax] \
+ modify exact [eax cl];
+
+-u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
++u16 shld_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
++
+ #pragma aux shld_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -661,7 +717,8 @@ u16 shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+ value [ax] \
+ modify exact [ax dx cl];
+
+-u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
++u32 shld_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
++
+ #pragma aux shld_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -672,7 +729,8 @@ u32 shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+ value [eax] \
+ modify exact [eax edx cl];
+
+-u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
++u16 shrd_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
++
+ #pragma aux shrd_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -683,7 +741,8 @@ u16 shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+ value [ax] \
+ modify exact [ax dx cl];
+
+-u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
++u32 shrd_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
++
+ #pragma aux shrd_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -694,7 +753,8 @@ u32 shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+ value [eax] \
+ modify exact [eax edx cl];
+
+-u8 sbb_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sbb_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sbb_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -705,7 +765,8 @@ u8 sbb_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 sbb_word_asm(u32 *flags,u16 d, u16 s);
++u16 sbb_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux sbb_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -716,7 +777,8 @@ u16 sbb_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 sbb_long_asm(u32 *flags,u32 d, u32 s);
++u32 sbb_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux sbb_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -727,7 +789,8 @@ u32 sbb_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-u8 sub_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sub_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sub_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -738,7 +801,8 @@ u8 sub_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 sub_word_asm(u32 *flags,u16 d, u16 s);
++u16 sub_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux sub_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -749,7 +813,8 @@ u16 sub_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 sub_long_asm(u32 *flags,u32 d, u32 s);
++u32 sub_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux sub_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -760,7 +825,8 @@ u32 sub_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-void test_byte_asm(u32 *flags,u8 d, u8 s);
++void test_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux test_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -770,7 +836,8 @@ void test_byte_asm(u32 *flags,u8 d, u8 s);
+ parm [edi] [al] [bl] \
+ modify exact [al bl];
+
+-void test_word_asm(u32 *flags,u16 d, u16 s);
++void test_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux test_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -780,7 +847,8 @@ void test_word_asm(u32 *flags,u16 d, u16 s);
+ parm [edi] [ax] [bx] \
+ modify exact [ax bx];
+
+-void test_long_asm(u32 *flags,u32 d, u32 s);
++void test_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux test_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -790,7 +858,8 @@ void test_long_asm(u32 *flags,u32 d, u32 s);
+ parm [edi] [eax] [ebx] \
+ modify exact [eax ebx];
+
+-u8 xor_byte_asm(u32 *flags,u8 d, u8 s);
++u8 xor_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux xor_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -801,7 +870,8 @@ u8 xor_byte_asm(u32 *flags,u8 d, u8 s);
+ value [al] \
+ modify exact [al bl];
+
+-u16 xor_word_asm(u32 *flags,u16 d, u16 s);
++u16 xor_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux xor_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -812,7 +882,8 @@ u16 xor_word_asm(u32 *flags,u16 d, u16 s);
+ value [ax] \
+ modify exact [ax bx];
+
+-u32 xor_long_asm(u32 *flags,u32 d, u32 s);
++u32 xor_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux xor_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -823,7 +894,8 @@ u32 xor_long_asm(u32 *flags,u32 d, u32 s);
+ value [eax] \
+ modify exact [eax ebx];
+
+-void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
++void imul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
++
+ #pragma aux imul_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -834,7 +906,8 @@ void imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+ parm [edi] [esi] [al] [bl] \
+ modify exact [esi ax bl];
+
+-void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
++void imul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
++
+ #pragma aux imul_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -846,7 +919,8 @@ void imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+ parm [edi] [esi] [ecx] [ax] [bx]\
+ modify exact [esi edi ax bx dx];
+
+-void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
++void imul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
++
+ #pragma aux imul_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -858,7 +932,8 @@ void imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+ parm [edi] [esi] [ecx] [eax] [ebx] \
+ modify exact [esi edi eax ebx edx];
+
+-void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
++void mul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
++
+ #pragma aux mul_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -869,7 +944,8 @@ void mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+ parm [edi] [esi] [al] [bl] \
+ modify exact [esi ax bl];
+
+-void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
++void mul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
++
+ #pragma aux mul_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -881,7 +957,8 @@ void mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+ parm [edi] [esi] [ecx] [ax] [bx]\
+ modify exact [esi edi ax bx dx];
+
+-void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
++void mul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
++
+ #pragma aux mul_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -893,7 +970,8 @@ void mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+ parm [edi] [esi] [ecx] [eax] [ebx] \
+ modify exact [esi edi eax ebx edx];
+
+-void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
++void idiv_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
++
+ #pragma aux idiv_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -905,7 +983,8 @@ void idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+ parm [edi] [esi] [ecx] [ax] [bl]\
+ modify exact [esi edi ax bl];
+
+-void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
++void idiv_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
++
+ #pragma aux idiv_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -917,7 +996,8 @@ void idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+ parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ modify exact [esi edi ax dx bx];
+
+-void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
++void idiv_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
++
+ #pragma aux idiv_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -929,7 +1009,8 @@ void idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+ parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+ modify exact [esi edi eax edx ebx];
+
+-void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
++void div_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
++
+ #pragma aux div_byte_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -941,7 +1022,8 @@ void div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+ parm [edi] [esi] [ecx] [ax] [bl]\
+ modify exact [esi edi ax bl];
+
+-void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
++void div_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
++
+ #pragma aux div_word_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -953,7 +1035,8 @@ void div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+ parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ modify exact [esi edi ax dx bx];
+
+-void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
++void div_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
++
+ #pragma aux div_long_asm = \
+ "push [edi]" \
+ "popf" \
+@@ -967,4 +1050,4 @@ void div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+
+ #endif
+
+-#endif /* __X86EMU_PRIM_ASM_H */
++#endif /* __X86EMU_PRIM_ASM_H */
+diff --git a/libs/x86emu/x86emu/prim_ops.h b/libs/x86emu/x86emu/prim_ops.h
+index bea8357..0f0e78d 100644
+--- a/libs/x86emu/x86emu/prim_ops.h
++++ b/libs/x86emu/x86emu/prim_ops.h
+@@ -40,102 +40,102 @@
+ #define __X86EMU_PRIM_OPS_H
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+-u16 aaa_word (u16 d);
+-u16 aas_word (u16 d);
+-u16 aad_word (u16 d);
+-u16 aam_word (u8 d);
+-u8 adc_byte (u8 d, u8 s);
+-u16 adc_word (u16 d, u16 s);
+-u32 adc_long (u32 d, u32 s);
+-u8 add_byte (u8 d, u8 s);
+-u16 add_word (u16 d, u16 s);
+-u32 add_long (u32 d, u32 s);
+-u8 and_byte (u8 d, u8 s);
+-u16 and_word (u16 d, u16 s);
+-u32 and_long (u32 d, u32 s);
+-u8 cmp_byte (u8 d, u8 s);
+-u16 cmp_word (u16 d, u16 s);
+-u32 cmp_long (u32 d, u32 s);
+-u8 daa_byte (u8 d);
+-u8 das_byte (u8 d);
+-u8 dec_byte (u8 d);
+-u16 dec_word (u16 d);
+-u32 dec_long (u32 d);
+-u8 inc_byte (u8 d);
+-u16 inc_word (u16 d);
+-u32 inc_long (u32 d);
+-u8 or_byte (u8 d, u8 s);
+-u16 or_word (u16 d, u16 s);
+-u32 or_long (u32 d, u32 s);
+-u8 neg_byte (u8 s);
+-u16 neg_word (u16 s);
+-u32 neg_long (u32 s);
+-u8 not_byte (u8 s);
+-u16 not_word (u16 s);
+-u32 not_long (u32 s);
+-u8 rcl_byte (u8 d, u8 s);
+-u16 rcl_word (u16 d, u8 s);
+-u32 rcl_long (u32 d, u8 s);
+-u8 rcr_byte (u8 d, u8 s);
+-u16 rcr_word (u16 d, u8 s);
+-u32 rcr_long (u32 d, u8 s);
+-u8 rol_byte (u8 d, u8 s);
+-u16 rol_word (u16 d, u8 s);
+-u32 rol_long (u32 d, u8 s);
+-u8 ror_byte (u8 d, u8 s);
+-u16 ror_word (u16 d, u8 s);
+-u32 ror_long (u32 d, u8 s);
+-u8 shl_byte (u8 d, u8 s);
+-u16 shl_word (u16 d, u8 s);
+-u32 shl_long (u32 d, u8 s);
+-u8 shr_byte (u8 d, u8 s);
+-u16 shr_word (u16 d, u8 s);
+-u32 shr_long (u32 d, u8 s);
+-u8 sar_byte (u8 d, u8 s);
+-u16 sar_word (u16 d, u8 s);
+-u32 sar_long (u32 d, u8 s);
+-u16 shld_word (u16 d, u16 fill, u8 s);
+-u32 shld_long (u32 d, u32 fill, u8 s);
+-u16 shrd_word (u16 d, u16 fill, u8 s);
+-u32 shrd_long (u32 d, u32 fill, u8 s);
+-u8 sbb_byte (u8 d, u8 s);
+-u16 sbb_word (u16 d, u16 s);
+-u32 sbb_long (u32 d, u32 s);
+-u8 sub_byte (u8 d, u8 s);
+-u16 sub_word (u16 d, u16 s);
+-u32 sub_long (u32 d, u32 s);
+-void test_byte (u8 d, u8 s);
+-void test_word (u16 d, u16 s);
+-void test_long (u32 d, u32 s);
+-u8 xor_byte (u8 d, u8 s);
+-u16 xor_word (u16 d, u16 s);
+-u32 xor_long (u32 d, u32 s);
+-void imul_byte (u8 s);
+-void imul_word (u16 s);
+-void imul_long (u32 s);
+-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
+-void mul_byte (u8 s);
+-void mul_word (u16 s);
+-void mul_long (u32 s);
+-void idiv_byte (u8 s);
+-void idiv_word (u16 s);
+-void idiv_long (u32 s);
+-void div_byte (u8 s);
+-void div_word (u16 s);
+-void div_long (u32 s);
+-void ins (int size);
+-void outs (int size);
+-u16 mem_access_word (int addr);
+-void push_word (u16 w);
+-void push_long (u32 w);
+-u16 pop_word (void);
+-u32 pop_long (void);
++ u16 aaa_word(u16 d);
++ u16 aas_word(u16 d);
++ u16 aad_word(u16 d);
++ u16 aam_word(u8 d);
++ u8 adc_byte(u8 d, u8 s);
++ u16 adc_word(u16 d, u16 s);
++ u32 adc_long(u32 d, u32 s);
++ u8 add_byte(u8 d, u8 s);
++ u16 add_word(u16 d, u16 s);
++ u32 add_long(u32 d, u32 s);
++ u8 and_byte(u8 d, u8 s);
++ u16 and_word(u16 d, u16 s);
++ u32 and_long(u32 d, u32 s);
++ u8 cmp_byte(u8 d, u8 s);
++ u16 cmp_word(u16 d, u16 s);
++ u32 cmp_long(u32 d, u32 s);
++ u8 daa_byte(u8 d);
++ u8 das_byte(u8 d);
++ u8 dec_byte(u8 d);
++ u16 dec_word(u16 d);
++ u32 dec_long(u32 d);
++ u8 inc_byte(u8 d);
++ u16 inc_word(u16 d);
++ u32 inc_long(u32 d);
++ u8 or_byte(u8 d, u8 s);
++ u16 or_word(u16 d, u16 s);
++ u32 or_long(u32 d, u32 s);
++ u8 neg_byte(u8 s);
++ u16 neg_word(u16 s);
++ u32 neg_long(u32 s);
++ u8 not_byte(u8 s);
++ u16 not_word(u16 s);
++ u32 not_long(u32 s);
++ u8 rcl_byte(u8 d, u8 s);
++ u16 rcl_word(u16 d, u8 s);
++ u32 rcl_long(u32 d, u8 s);
++ u8 rcr_byte(u8 d, u8 s);
++ u16 rcr_word(u16 d, u8 s);
++ u32 rcr_long(u32 d, u8 s);
++ u8 rol_byte(u8 d, u8 s);
++ u16 rol_word(u16 d, u8 s);
++ u32 rol_long(u32 d, u8 s);
++ u8 ror_byte(u8 d, u8 s);
++ u16 ror_word(u16 d, u8 s);
++ u32 ror_long(u32 d, u8 s);
++ u8 shl_byte(u8 d, u8 s);
++ u16 shl_word(u16 d, u8 s);
++ u32 shl_long(u32 d, u8 s);
++ u8 shr_byte(u8 d, u8 s);
++ u16 shr_word(u16 d, u8 s);
++ u32 shr_long(u32 d, u8 s);
++ u8 sar_byte(u8 d, u8 s);
++ u16 sar_word(u16 d, u8 s);
++ u32 sar_long(u32 d, u8 s);
++ u16 shld_word(u16 d, u16 fill, u8 s);
++ u32 shld_long(u32 d, u32 fill, u8 s);
++ u16 shrd_word(u16 d, u16 fill, u8 s);
++ u32 shrd_long(u32 d, u32 fill, u8 s);
++ u8 sbb_byte(u8 d, u8 s);
++ u16 sbb_word(u16 d, u16 s);
++ u32 sbb_long(u32 d, u32 s);
++ u8 sub_byte(u8 d, u8 s);
++ u16 sub_word(u16 d, u16 s);
++ u32 sub_long(u32 d, u32 s);
++ void test_byte(u8 d, u8 s);
++ void test_word(u16 d, u16 s);
++ void test_long(u32 d, u32 s);
++ u8 xor_byte(u8 d, u8 s);
++ u16 xor_word(u16 d, u16 s);
++ u32 xor_long(u32 d, u32 s);
++ void imul_byte(u8 s);
++ void imul_word(u16 s);
++ void imul_long(u32 s);
++ void imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s);
++ void mul_byte(u8 s);
++ void mul_word(u16 s);
++ void mul_long(u32 s);
++ void idiv_byte(u8 s);
++ void idiv_word(u16 s);
++ void idiv_long(u32 s);
++ void div_byte(u8 s);
++ void div_word(u16 s);
++ void div_long(u32 s);
++ void ins(int size);
++ void outs(int size);
++ u16 mem_access_word(int addr);
++ void push_word(u16 w);
++ void push_long(u32 w);
++ u16 pop_word(void);
++ u32 pop_long(void);
++ void cpuid(void);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_PRIM_OPS_H */
++#endif /* __X86EMU_PRIM_OPS_H */
+diff --git a/libs/x86emu/x86emu/prim_x86_gcc.h b/libs/x86emu/x86emu/prim_x86_gcc.h
+new file mode 100644
+index 0000000..646ec9d
+--- /dev/null
++++ b/libs/x86emu/x86emu/prim_x86_gcc.h
+@@ -0,0 +1,77 @@
++/****************************************************************************
++*
++* Inline helpers for x86emu
++*
++* Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC
++*
++* ========================================================================
++*
++* Permission to use, copy, modify, distribute, and sell this software and
++* its documentation for any purpose is hereby granted without fee,
++* provided that the above copyright notice appear in all copies and that
++* both that copyright notice and this permission notice appear in
++* supporting documentation, and that the name of the authors not be used
++* in advertising or publicity pertaining to distribution of the software
++* without specific, written prior permission. The authors makes no
++* representations about the suitability of this software for any purpose.
++* It is provided "as is" without express or implied warranty.
++*
++* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
++* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
++* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
++* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
++* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++* PERFORMANCE OF THIS SOFTWARE.
++*
++* ========================================================================
++*
++* Language: GNU C
++* Environment: GCC on i386 or x86-64
++* Developer: Bart Trojanowski
++*
++* Description: This file defines a few x86 macros that can be used by the
++* emulator to execute native instructions.
++*
++* For PIC vs non-PIC code refer to:
++* http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
++*
++****************************************************************************/
++#ifndef __X86EMU_PRIM_X86_GCC_H
++#define __X86EMU_PRIM_X86_GCC_H
++
++#include "x86emu/types.h"
++
++#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__))
++#error This file is intended to be used by gcc on i386 or x86-64 system
++#endif
++
++#if defined(__PIC__) && defined(__i386__)
++
++#define X86EMU_HAS_HW_CPUID 1
++static inline void
++hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d)
++{
++ __asm__ __volatile__("pushl %%ebx \n\t"
++ "cpuid \n\t"
++ "movl %%ebx, %1 \n\t"
++ "popl %%ebx \n\t":"=a"(*a), "=r"(*b),
++ "=c"(*c), "=d"(*d)
++ :"a"(*a), "c"(*c)
++ :"cc");
++}
++
++#else /* ! (__PIC__ && __i386__) */
++
++#define x86EMU_HAS_HW_CPUID 1
++static inline void
++hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d)
++{
++ __asm__ __volatile__("cpuid":"=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d)
++ :"a"(*a), "c"(*c)
++ :"cc");
++}
++
++#endif /* __PIC__ && __i386__ */
++
++#endif /* __X86EMU_PRIM_X86_GCC_H */
+diff --git a/libs/x86emu/x86emu/regs.h b/libs/x86emu/x86emu/regs.h
+index 52cf8e4..6bd0611 100644
+--- a/libs/x86emu/x86emu/regs.h
++++ b/libs/x86emu/x86emu/regs.h
+@@ -42,7 +42,7 @@
+ /*---------------------- Macros and type definitions ----------------------*/
+
+ #ifdef PACK
+-# pragma PACK
++#pragma PACK
+ #endif
+
+ /*
+@@ -64,48 +64,48 @@
+
+ typedef struct {
+ u32 e_reg;
+- } I32_reg_t;
++} I32_reg_t;
+
+ typedef struct {
+- u16 filler0, x_reg;
+- } I16_reg_t;
++ u16 filler0, x_reg;
++} I16_reg_t;
+
+ typedef struct {
+- u8 filler0, filler1, h_reg, l_reg;
+- } I8_reg_t;
++ u8 filler0, filler1, h_reg, l_reg;
++} I8_reg_t;
+
+-#else /* !__BIG_ENDIAN__ */
++#else /* !__BIG_ENDIAN__ */
+
+ typedef struct {
+ u32 e_reg;
+- } I32_reg_t;
++} I32_reg_t;
+
+ typedef struct {
+- u16 x_reg;
+- } I16_reg_t;
++ u16 x_reg;
++} I16_reg_t;
+
+ typedef struct {
+- u8 l_reg, h_reg;
+- } I8_reg_t;
++ u8 l_reg, h_reg;
++} I8_reg_t;
+
+-#endif /* BIG_ENDIAN */
++#endif /* BIG_ENDIAN */
+
+ typedef union {
+- I32_reg_t I32_reg;
+- I16_reg_t I16_reg;
+- I8_reg_t I8_reg;
+- } i386_general_register;
++ I32_reg_t I32_reg;
++ I16_reg_t I16_reg;
++ I8_reg_t I8_reg;
++} i386_general_register;
+
+ struct i386_general_regs {
+- i386_general_register A, B, C, D;
+- };
++ i386_general_register A, B, C, D;
++};
+
+ typedef struct i386_general_regs Gen_reg_t;
+
+ struct i386_special_regs {
+- i386_general_register SP, BP, SI, DI, IP;
+- u32 FLAGS;
+- };
++ i386_general_register SP, BP, SI, DI, IP;
++ u32 FLAGS;
++};
+
+ /*
+ * Segment registers here represent the 16 bit quantities
+@@ -114,7 +114,7 @@ struct i386_special_regs {
+
+ struct i386_segment_regs {
+ u16 CS, DS, SS, ES, FS, GS;
+- };
++};
+
+ /* 8 bit registers */
+ #define R_AH gen.A.I8_reg.h_reg
+@@ -258,9 +258,9 @@ struct i386_segment_regs {
+ #define INTR_HALTED 0x4
+
+ typedef struct {
+- struct i386_general_regs gen;
+- struct i386_special_regs spc;
+- struct i386_segment_regs seg;
++ struct i386_general_regs gen;
++ struct i386_special_regs spc;
++ struct i386_segment_regs seg;
+ /*
+ * MODE contains information on:
+ * REPE prefix 2 bits repe,repne
+@@ -273,21 +273,21 @@ typedef struct {
+ * Extern interrupt 1 bits
+ * Halted 1 bits
+ */
+- u32 mode;
+- volatile int intr; /* mask of pending interrupts */
+- int debug;
++ u32 mode;
++ volatile int intr; /* mask of pending interrupts */
++ int debug;
+ #ifdef DEBUG
+- int check;
+- u16 saved_ip;
+- u16 saved_cs;
+- int enc_pos;
+- int enc_str_pos;
+- char decode_buf[32]; /* encoded byte stream */
+- char decoded_buf[256]; /* disassembled strings */
++ int check;
++ u16 saved_ip;
++ u16 saved_cs;
++ int enc_pos;
++ int enc_str_pos;
++ char decode_buf[32]; /* encoded byte stream */
++ char decoded_buf[256]; /* disassembled strings */
+ #endif
+- u8 intno;
+- u8 __pad[3];
+- } X86EMU_regs;
++ u8 intno;
++ u8 __pad[3];
++} X86EMU_regs;
+
+ /****************************************************************************
+ REMARKS:
+@@ -300,20 +300,20 @@ private - private data pointer
+ x86 - X86 registers
+ ****************************************************************************/
+ typedef struct {
+- unsigned long mem_base;
+- unsigned long mem_size;
+- void* private;
+- X86EMU_regs x86;
+- } X86EMU_sysEnv;
++ unsigned long mem_base;
++ unsigned long mem_size;
++ void *private;
++ X86EMU_regs x86;
++} X86EMU_sysEnv;
+
+ #ifdef END_PACK
+-# pragma END_PACK
++#pragma END_PACK
+ #endif
+
+ /*----------------------------- Global Variables --------------------------*/
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+ /* Global emulator machine state.
+@@ -321,17 +321,16 @@ extern "C" { /* Use "C" linkage when in C++ mode */
+ * We keep it global to avoid pointer dereferences in the code for speed.
+ */
+
+-extern X86EMU_sysEnv _X86EMU_env;
++ extern X86EMU_sysEnv _X86EMU_env;
+ #define M _X86EMU_env
+
+ /*-------------------------- Function Prototypes --------------------------*/
+
+ /* Function to log information at runtime */
+
+-void printk(const char *fmt, ...);
++ void printk(const char *fmt, ...);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_REGS_H */
++#endif /* __X86EMU_REGS_H */
+diff --git a/libs/x86emu/x86emu/types.h b/libs/x86emu/x86emu/types.h
+index c0c09c1..5a6ef01 100644
+--- a/libs/x86emu/x86emu/types.h
++++ b/libs/x86emu/x86emu/types.h
+@@ -36,7 +36,6 @@
+ *
+ ****************************************************************************/
+
+-
+ #ifndef __X86EMU_TYPES_H
+ #define __X86EMU_TYPES_H
+
+@@ -61,46 +60,21 @@
+
+ /*---------------------- Macros and type definitions ----------------------*/
+
+-/* Currently only for Linux/32bit */
+-#undef __HAS_LONG_LONG__
+-#if defined(__GNUC__) && !defined(NO_LONG_LONG)
+-#define __HAS_LONG_LONG__
+-#endif
++#include <stdint.h>
+
+-/* Taken from Xmd.h */
+-#undef NUM32
+-#if defined (_LP64) || \
+- defined(__alpha) || defined(__alpha__) || \
+- defined(__ia64__) || defined(ia64) || \
+- defined(__sparc64__) || \
+- defined(__s390x__) || \
+- (defined(__hppa__) && defined(__LP64)) || \
+- defined(__amd64__) || defined(amd64) || \
+- (defined(__sgi) && (_MIPS_SZLONG == 64))
+-#define NUM32 int
+-#else
+-#define NUM32 long
+-#endif
++typedef uint8_t u8;
++typedef uint16_t u16;
++typedef uint32_t u32;
++typedef uint64_t u64;
+
+-typedef unsigned char u8;
+-typedef unsigned short u16;
+-typedef unsigned NUM32 u32;
+-#ifdef __HAS_LONG_LONG__
+-typedef unsigned long long u64;
+-#endif
++typedef int8_t s8;
++typedef int16_t s16;
++typedef int32_t s32;
++typedef int64_t s64;
+
+-typedef char s8;
+-typedef short s16;
+-typedef NUM32 s32;
+-#ifdef __HAS_LONG_LONG__
+-typedef long long s64;
+-#endif
+-
+-typedef unsigned int uint;
+-typedef int sint;
++typedef unsigned int uint;
++typedef int sint;
+
+ typedef u16 X86EMU_pioAddr;
+
+-#undef NUM32
+-
+-#endif /* __X86EMU_TYPES_H */
++#endif /* __X86EMU_TYPES_H */
+diff --git a/libs/x86emu/x86emu/x86emui.h b/libs/x86emu/x86emu/x86emui.h
+index 112ee36..f11dc10 100644
+--- a/libs/x86emu/x86emu/x86emui.h
++++ b/libs/x86emu/x86emu/x86emui.h
+@@ -38,7 +38,6 @@
+ *
+ ****************************************************************************/
+
+-
+ #ifndef __X86EMU_X86EMUI_H
+ #define __X86EMU_X86EMUI_H
+
+@@ -74,29 +73,28 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#endif
++#endif
+ /*--------------------------- Inline Functions ----------------------------*/
+
+ #ifdef __cplusplus
+-extern "C" { /* Use "C" linkage when in C++ mode */
++extern "C" { /* Use "C" linkage when in C++ mode */
+ #endif
+
+-extern u8 (X86APIP sys_rdb)(u32 addr);
+-extern u16 (X86APIP sys_rdw)(u32 addr);
+-extern u32 (X86APIP sys_rdl)(u32 addr);
+-extern void (X86APIP sys_wrb)(u32 addr,u8 val);
+-extern void (X86APIP sys_wrw)(u32 addr,u16 val);
+-extern void (X86APIP sys_wrl)(u32 addr,u32 val);
++ extern u8(X86APIP sys_rdb) (u32 addr);
++ extern u16(X86APIP sys_rdw) (u32 addr);
++ extern u32(X86APIP sys_rdl) (u32 addr);
++ extern void (X86APIP sys_wrb) (u32 addr, u8 val);
++ extern void (X86APIP sys_wrw) (u32 addr, u16 val);
++ extern void (X86APIP sys_wrl) (u32 addr, u32 val);
+
+-extern u8 (X86APIP sys_inb)(X86EMU_pioAddr addr);
+-extern u16 (X86APIP sys_inw)(X86EMU_pioAddr addr);
+-extern u32 (X86APIP sys_inl)(X86EMU_pioAddr addr);
+-extern void (X86APIP sys_outb)(X86EMU_pioAddr addr,u8 val);
+-extern void (X86APIP sys_outw)(X86EMU_pioAddr addr,u16 val);
+-extern void (X86APIP sys_outl)(X86EMU_pioAddr addr,u32 val);
++ extern u8(X86APIP sys_inb) (X86EMU_pioAddr addr);
++ extern u16(X86APIP sys_inw) (X86EMU_pioAddr addr);
++ extern u32(X86APIP sys_inl) (X86EMU_pioAddr addr);
++ extern void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val);
++ extern void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val);
++ extern void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val);
+
+ #ifdef __cplusplus
+-} /* End of "C" linkage for C++ */
++} /* End of "C" linkage for C++ */
+ #endif
+-
+-#endif /* __X86EMU_X86EMUI_H */
++#endif /* __X86EMU_X86EMUI_H */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-bsp/v86d/v86d/aarch64-host.patch b/poky/meta/recipes-bsp/v86d/v86d/aarch64-host.patch
new file mode 100644
index 000000000..701fed7b5
--- /dev/null
+++ b/poky/meta/recipes-bsp/v86d/v86d/aarch64-host.patch
@@ -0,0 +1,18 @@
+Accept aarch64 as valid build host
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: v86d-0.1.10/configure
+===================================================================
+--- v86d-0.1.10.orig/configure
++++ v86d-0.1.10/configure
+@@ -26,7 +26,7 @@ copt_x86emu_test()
+ local m=`uname -m`
+ if [ "$m" = "i686" -o "$m" = "i586" -o "$m" = "i486" -o "$m" = "i386" ]; then
+ echo "n";
+- elif [ "$m" = "x86_64" ]; then
++ elif [ "$m" = "x86_64" -o "$m" = "aarch64" ]; then
+ echo "y";
+ else
+ echo "It looks like your architecture '$m' isn't supported by this version of v86d." >&2
diff --git a/poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch b/poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch
new file mode 100644
index 000000000..1dcbc71dc
--- /dev/null
+++ b/poky/meta/recipes-bsp/v86d/v86d/ar-from-env.patch
@@ -0,0 +1,33 @@
+Fix cross link using host-cross ar
+
+If building on 32bit host and creating 64bit libraries, the target
+package builds should not invoke the 32bit hosts's ar. Specifically
+you will get an error message like:
+
+x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Llibs/x86emu v86_x86emu.o v86_mem.o v86_common.o v86.o -lx86emu -o v86d
+libs/x86emu/libx86emu.a: could not read symbols: Archive has no index; run ranlib to add one
+collect2: error: ld returned 1 exit status
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+---
+ libs/x86emu/Makefile | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/libs/x86emu/Makefile
++++ b/libs/x86emu/Makefile
+@@ -1,7 +1,11 @@
+ OBJS = decode.o fpu.o ops.o ops2.o prim_ops.o sys.o
+
++ifeq ($(AR),)
++ AR = ar
++endif
++
+ libx86emu.a: $(OBJS)
+- ar rv $@ $+
++ $(AR) rv $@ $+
+
+ %.o: %.c
+ $(CC) -c $(CFLAGS) -o $@ $<
diff --git a/poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
new file mode 100644
index 000000000..f97b80d08
--- /dev/null
+++ b/poky/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -0,0 +1,35 @@
+SUMMARY = "User support binary for the uvesafb kernel module"
+HOMEPAGE = "http://dev.gentoo.org/~spock/projects/uvesafb/"
+
+# the copyright info is at the bottom of README, expect break
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://README;md5=94ac1971e4f2309dc322d598e7b1f7dd"
+
+DEPENDS = "virtual/kernel"
+RRECOMMENDS_${PN} = "kernel-module-uvesafb"
+PR = "r2"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://Update-x86emu-from-X.org.patch \
+ file://ar-from-env.patch \
+ file://aarch64-host.patch \
+"
+
+SRC_URI[md5sum] = "889686ec8424468fe0d205742e77a4c2"
+SRC_URI[sha256sum] = "93575c82e4307d8c4c370ec6b767f5cf87e527b2378146d652a6d8e25d5bdbc5"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+do_configure () {
+ ./configure --with-x86emu
+}
+
+do_compile () {
+ KDIR="${STAGING_DIR_HOST}/usr" make
+}
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install v86d ${D}${base_sbindir}/
+}
diff --git a/poky/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb b/poky/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb
new file mode 100644
index 000000000..5648e386b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/avahi-ui_0.7.bb
@@ -0,0 +1,62 @@
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
+ file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
+ file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
+ file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
+
+require avahi.inc
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
+SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
+
+DEPENDS += "avahi"
+
+AVAHI_GTK = "gtk3"
+
+S = "${WORKDIR}/avahi-${PV}"
+
+PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc avahi-discover"
+
+FILES_${PN} = "${libdir}/libavahi-ui*.so.*"
+FILES_${PN}-dev += "${libdir}/libavahi-ui${SOLIBSDEV}"
+FILES_${PN}-staticdev += "${libdir}/libavahi-ui.a"
+
+FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*"
+
+FILES_avahi-discover = "${datadir}/applications/avahi-discover.desktop \
+ ${datadir}/avahi/interfaces/avahi-discover.ui \
+ ${bindir}/avahi-discover-standalone \
+ "
+
+do_install_append () {
+ rm ${D}${sysconfdir} -rf
+ rm ${D}${base_libdir} -rf
+ rm ${D}${systemd_unitdir} -rf
+ # The ${systemd_unitdir} is /lib/systemd, so we need rmdir /lib,
+ # but not ${base_libdir} here. And the /lib may not exist
+ # whithout systemd.
+ [ ! -d ${D}/lib ] || rmdir ${D}/lib --ignore-fail-on-non-empty
+ rm ${D}${bindir}/avahi-b*
+ rm ${D}${bindir}/avahi-p*
+ rm ${D}${bindir}/avahi-r*
+ rm ${D}${bindir}/avahi-s*
+ rm ${D}${includedir}/avahi-c* -rf
+ rm ${D}${includedir}/avahi-g* -rf
+ rm ${D}${libdir}/libavahi-c*
+ rm ${D}${libdir}/libavahi-g*
+ rm ${D}${libdir}/pkgconfig/avahi-c*
+ rm ${D}${libdir}/pkgconfig/avahi-g*
+ rm ${D}${sbindir} -rf
+ rm ${D}${datadir}/avahi/a*
+ rm ${D}${datadir}/locale/ -rf
+ rm ${D}${datadir}/dbus* -rf
+ rm ${D}${mandir}/man1/a*
+ rm ${D}${mandir}/man5 -rf
+ rm ${D}${mandir}/man8 -rf
+ rm ${D}${libdir}/girepository-1.0/ -rf
+ rm ${D}${datadir}/gir-1.0/ -rf
+}
+
diff --git a/poky/meta/recipes-connectivity/avahi/avahi.inc b/poky/meta/recipes-connectivity/avahi/avahi.inc
new file mode 100644
index 000000000..ec368de4f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/avahi.inc
@@ -0,0 +1,139 @@
+SUMMARY = "Avahi IPv4LL network address configuration daemon"
+DESCRIPTION = 'Avahi is a fully LGPL framework for Multicast DNS Service Discovery. It \
+allows programs to publish and discover services and hosts running on a local network \
+with no specific configuration. This tool implements IPv4LL, "Dynamic Configuration of \
+IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for automatic IP address \
+configuration from the link-local 169.254.0.0/16 range without the need for a central \
+server.'
+AUTHOR = "Lennart Poettering <lennart@poettering.net>"
+HOMEPAGE = "http://avahi.org"
+BUGTRACKER = "https://github.com/lathiat/avahi/issues"
+SECTION = "network"
+
+# major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and
+# python scripts are under GPLv2+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+
+DEPENDS = "expat libcap libdaemon glib-2.0 intltool-native"
+
+SRC_URI = "https://github.com/lathiat/avahi/releases/download/v${PV}/avahi-${PV}.tar.gz \
+ file://00avahi-autoipd \
+ file://99avahi-autoipd \
+ file://initscript.patch \
+ "
+UPSTREAM_CHECK_URI = "https://github.com/lathiat/avahi/releases/"
+
+# For gtk related PACKAGECONFIGs: gtk, gtk3
+AVAHI_GTK ?= ""
+
+PACKAGECONFIG ??= "dbus ${AVAHI_GTK}"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
+PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
+
+USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
+USERADD_PARAM_avahi-daemon = "--system --home /run/avahi-daemon \
+ --no-create-home --shell /bin/false \
+ --user-group avahi"
+
+USERADD_PARAM_avahi-autoipd = "--system --home /run/avahi-autoipd \
+ --no-create-home --shell /bin/false \
+ --user-group \
+ -c \"Avahi autoip daemon\" \
+ avahi-autoipd"
+
+inherit autotools pkgconfig update-rc.d gettext useradd gobject-introspection
+
+EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
+ --disable-stack-protector \
+ --disable-gdbm \
+ --disable-mono \
+ --disable-monodoc \
+ --disable-qt3 \
+ --disable-qt4 \
+ --disable-python \
+ --disable-doxygen-doc \
+ --enable-manpages \
+ ${EXTRA_OECONF_SYSVINIT} \
+ ${EXTRA_OECONF_SYSTEMD} \
+ "
+
+# The distro choice determines what init scripts are installed
+EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
+EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
+
+do_configure_prepend() {
+ sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
+
+ # This m4 file will get in the way of our introspection.m4 with special cross-compilation fixes
+ rm "${S}/common/introspection.m4" || true
+}
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
+}
+
+PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
+
+# As avahi doesn't put any files into PN, clear the files list to avoid problems
+# if extra libraries appear.
+FILES_${PN} = ""
+FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
+ ${sysconfdir}/avahi/avahi-autoipd.action \
+ ${sysconfdir}/dhcp/*/avahi-autoipd \
+ ${sysconfdir}/udhcpc.d/00avahi-autoipd \
+ ${sysconfdir}/udhcpc.d/99avahi-autoipd"
+FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
+FILES_libavahi-core = "${libdir}/libavahi-core.so.* ${libdir}/girepository-1.0/AvahiCore*.typelib"
+FILES_avahi-daemon = "${sbindir}/avahi-daemon \
+ ${sysconfdir}/avahi/avahi-daemon.conf \
+ ${sysconfdir}/avahi/hosts \
+ ${sysconfdir}/avahi/services \
+ ${sysconfdir}/dbus-1 \
+ ${sysconfdir}/init.d/avahi-daemon \
+ ${datadir}/avahi/introspection/*.introspect \
+ ${datadir}/avahi/avahi-service.dtd \
+ ${datadir}/avahi/service-types \
+ ${datadir}/dbus-1/system-services"
+FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
+FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
+FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
+ ${sysconfdir}/avahi/avahi-dnsconfd.action \
+ ${sysconfdir}/init.d/avahi-dnsconfd"
+FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
+FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.* ${libdir}/girepository-1.0/Avahi*.typelib"
+FILES_avahi-utils = "${bindir}/avahi-*"
+
+RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
+
+RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
+RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
+
+CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
+
+INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
+INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
+INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
+INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
+INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
+
+do_install() {
+ autotools_do_install
+ rm -rf ${D}/run
+ rm -rf ${D}${datadir}/dbus-1/interfaces
+ test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
+ rm -rf ${D}${libdir}/avahi
+
+ install -d ${D}${sysconfdir}/udhcpc.d
+ install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+ install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+}
+
+# At the time the postinst runs, dbus might not be setup so only restart if running
+# Don't exit early, because update-rc.d needs to run subsequently.
+
+pkg_postinst_avahi-daemon () {
+if [ -z "$D" ]; then
+ killall -q -HUP dbus-daemon || true
+fi
+}
diff --git a/poky/meta/recipes-connectivity/avahi/avahi_0.7.bb b/poky/meta/recipes-connectivity/avahi/avahi_0.7.bb
new file mode 100644
index 000000000..7c91f10f1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/avahi_0.7.bb
@@ -0,0 +1,20 @@
+require avahi.inc
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
+SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
+SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
+ file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
+ file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
+ file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
+
+SRC_URI[md5sum] = "d76c59d0882ac6c256d70a2a585362a6"
+SRC_URI[sha256sum] = "57a99b5dfe7fdae794e3d1ee7a62973a368e91e414bd0dfa5d84434de5b14804"
+
+DEPENDS += "intltool-native"
+
+PACKAGES =+ "libavahi-gobject"
diff --git a/poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd b/poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd
new file mode 100644
index 000000000..a0ab81460
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/files/00avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+ deconfig|renew|bound)
+ /usr/sbin/avahi-autoipd -k $interface 2> /dev/null
+ ;;
+esac
diff --git a/poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd b/poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd
new file mode 100644
index 000000000..234cdaa3e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/files/99avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+ leasefail)
+ /usr/sbin/avahi-autoipd -wD $interface 2> /dev/null
+ ;;
+esac
diff --git a/poky/meta/recipes-connectivity/avahi/files/initscript.patch b/poky/meta/recipes-connectivity/avahi/files/initscript.patch
new file mode 100644
index 000000000..c856c3df0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/avahi/files/initscript.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+Index: avahi-0.7/initscript/debian/avahi-daemon.in
+===================================================================
+--- avahi-0.7.orig/initscript/debian/avahi-daemon.in
++++ avahi-0.7/initscript/debian/avahi-daemon.in
+@@ -1,5 +1,17 @@
+ #!/bin/sh
+-
++### BEGIN INIT INFO
++# Provides: avahi
++# Required-Start: $remote_fs dbus
++# Required-Stop: $remote_fs dbus
++# Should-Start: $syslog
++# Should-Stop: $syslog
++# Default-Start: 2 3 4 5
++# Default-Stop: 0 1 6
++# Short-Description: Avahi mDNS/DNS-SD Daemon
++# Description: Zeroconf daemon for configuring your network
++# automatically
++### END INIT INFO
++#
+ # This file is part of avahi.
+ #
+ # avahi is free software; you can redistribute it and/or modify it
+Index: avahi-0.7/initscript/debian/avahi-dnsconfd.in
+===================================================================
+--- avahi-0.7.orig/initscript/debian/avahi-dnsconfd.in
++++ avahi-0.7/initscript/debian/avahi-dnsconfd.in
+@@ -1,4 +1,17 @@
+ #!/bin/sh
++### BEGIN INIT INFO
++# Provides: avahi-dnsconfd
++# Required-Start: $remote_fs avahi
++# Required-Stop: $remote_fs avahi
++# Should-Start: $syslog
++# Should-Stop: $syslog
++# Default-Start: 2 3 4 5
++# Default-Stop: 0 1 6
++# Short-Description: Avahi mDNS/DNS-SD DNS configuration
++# Description: Zeroconf daemon for configuring your network
++# automatically
++### END INIT INFO
++#
+
+ # This file is part of avahi.
+ #
diff --git a/poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch b/poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
new file mode 100644
index 000000000..1e23c0f56
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
@@ -0,0 +1,54 @@
+xml2-config is disabled, so change the configure script to use pkgconfig to find
+libxml2.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Update context for version 9.10.3-P2.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Update context for version 9.10.5-P3.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ configure.in | 23 +++--------------------
+ 1 file changed, 3 insertions(+), 20 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 4da73a4..6f2a754 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2282,26 +2282,9 @@ case "$use_libxml2" in
+ DST_LIBXML2_INC=""
+ ;;
+ auto|yes)
+- case X`(xml2-config --version) 2>/dev/null` in
+- X2.[[6789]].*)
+- libxml2_libs=`xml2-config --libs`
+- libxml2_cflags=`xml2-config --cflags`
+- ;;
+- *)
+- if test "yes" = "$use_libxml2" ; then
+- AC_MSG_RESULT(no)
+- AC_MSG_ERROR(required libxml2 version not available)
+- else
+- libxml2_libs=
+- libxml2_cflags=
+- fi
+- ;;
+- esac
+- ;;
+- *)
+- if test -f "$use_libxml2/bin/xml2-config" ; then
+- libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
+- libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
++ if pkg-config --exists libxml-2.0 ; then
++ libxml2_libs=`pkg-config libxml-2.0 --libs`
++ libxml2_cflags=`pkg-config libxml-2.0 --cflags`
+ fi
+ ;;
+ esac
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch b/poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch
new file mode 100644
index 000000000..121509371
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+Subject: gen.c: extend DIRNAMESIZE from 256 to 512
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/dns/gen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/dns/gen.c b/lib/dns/gen.c
+index 7a7dafb..51a0435 100644
+--- a/lib/dns/gen.c
++++ b/lib/dns/gen.c
+@@ -148,7 +148,7 @@ static const char copyright[] =
+ #define TYPECLASSBUF (TYPECLASSLEN + 1)
+ #define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
+ #define ATTRIBUTESIZE 256
+-#define DIRNAMESIZE 256
++#define DIRNAMESIZE 512
+
+ static struct cc {
+ struct cc *next;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch b/poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch
new file mode 100644
index 000000000..1ed858cd3
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/0001-lib-dns-gen.c-fix-too-long-error.patch
@@ -0,0 +1,34 @@
+From 5bc3167a8b714ec0c4a3f1c7f3b9411296ec0a23 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 16 Sep 2015 20:23:47 -0700
+Subject: [PATCH] lib/dns/gen.c: fix too long error
+
+The 512 is a little short when build in deep dir, and cause "too long"
+error, use PATH_MAX if defined.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/dns/gen.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/dns/gen.c b/lib/dns/gen.c
+index 51a0435..3d7214f 100644
+--- a/lib/dns/gen.c
++++ b/lib/dns/gen.c
+@@ -148,7 +148,11 @@ static const char copyright[] =
+ #define TYPECLASSBUF (TYPECLASSLEN + 1)
+ #define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
+ #define ATTRIBUTESIZE 256
++#ifdef PATH_MAX
++#define DIRNAMESIZE PATH_MAX
++#else
+ #define DIRNAMESIZE 512
++#endif
+
+ static struct cc {
+ struct cc *next;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch b/poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
new file mode 100644
index 000000000..8bc4ea30f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
@@ -0,0 +1,48 @@
+From 9b40619ff6fddfef2758ba797789f8487f412df3 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 16 Feb 2015 00:50:01 -0800
+Subject: [PATCH] confgen: don't build unix.o twice
+
+Fixed:
+unix/os.o: file not recognized: File truncated
+collect2: error: ld returned 1 exit status
+
+This is because os.o was built twice:
+* The implicity rule (depends on unix/os.o)
+* The "make all" in unix subdir (depends on unix/os.o)
+
+Depend on subdirs which is unix only rather than unix/os.o will fix the
+problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Update context(trailing whitespace) for version 9.10.5-P3.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ bin/confgen/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
+index dca272f..02becce 100644
+--- a/bin/confgen/Makefile.in
++++ b/bin/confgen/Makefile.in
+@@ -74,11 +74,11 @@ rndc-confgen.@O@: rndc-confgen.c
+ ddns-confgen.@O@: ddns-confgen.c
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c ${srcdir}/ddns-confgen.c
+
+-rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS} ${CONFDEPLIBS}
++rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS} $(SUBDIRS)
+ export BASEOBJS="rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
+ ${FINALBUILDCMD}
+
+-ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS} ${CONFDEPLIBS}
++ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS} $(SUBDIRS)
+ export BASEOBJS="ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
+ ${FINALBUILDCMD}
+
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch b/poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch
new file mode 100644
index 000000000..13df3bb0e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch
@@ -0,0 +1,49 @@
+From 9473d29843579802e96b0293a3e953fed93de82c Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 9 Jun 2015 11:22:00 -0400
+Subject: [PATCH] bind: ensure searching for json headers searches sysroot
+
+Bind can fail configure by detecting headers w/o libs[1], or
+it can fail the host contamination check as per below:
+
+ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+Rerun configure task after fixing this. The path was 'build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/build'
+ERROR: Function failed: do_qa_configure
+ERROR: Logfile of failure stored in: build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/temp/log.do_configure.5242
+ERROR: Task 5 (meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure) failed with exit code '1'
+NOTE: Tasks Summary: Attempted 773 tasks of which 768 didn't need to be rerun and 1 failed.
+No currently running tasks (773 of 781)
+
+Summary: 1 task failed:
+ /meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure
+
+One way to fix it would be to unconditionally disable json in bind
+configure[2] but here we fix it by using the path to where we would
+put the header if we had json in the sysroot, in case someone wants
+to make use of the combination some day.
+
+[1] https://trac.macports.org/ticket/45305
+[2] https://trac.macports.org/changeset/126406
+
+Upstream-Status: Inappropriate [OE Specific]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index c9ef3a601343..17a1f613e9ac 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2139,7 +2139,7 @@ case "$use_libjson" in
+ libjson_libs=""
+ ;;
+ auto|yes)
+- for d in /usr /usr/local /opt/local
++ for d in "${STAGING_INCDIR}"
+ do
+ if test -f "${d}/include/json/json.h"
+ then
+--
+2.4.2
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/bind9 b/poky/meta/recipes-connectivity/bind/bind/bind9
new file mode 100644
index 000000000..968679ff7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/bind9
@@ -0,0 +1,2 @@
+# startup options for the server
+OPTIONS="-u bind"
diff --git a/poky/meta/recipes-connectivity/bind/bind/conf.patch b/poky/meta/recipes-connectivity/bind/bind/conf.patch
new file mode 100644
index 000000000..aad345f9f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/conf.patch
@@ -0,0 +1,330 @@
+Upstream-Status: Inappropriate [configuration]
+
+the patch is imported from openembedded project
+
+11/30/2010 - Qing He <qing.he@intel.com>
+
+diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0
+--- bind-9.3.1.orig/conf/db.0 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.0 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,12 @@
++;
++; BIND reverse data file for broadcast zone
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
+diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127
+--- bind-9.3.1.orig/conf/db.127 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.127 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND reverse data file for local loopback interface
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
++1.0.0 IN PTR localhost.
+diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty
+--- bind-9.3.1.orig/conf/db.empty 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.empty 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,14 @@
++; BIND reverse data file for empty rfc1918 zone
++;
++; DO NOT EDIT THIS FILE - it is used for multiple zones.
++; Instead, copy it, edit named.conf, and use that copy.
++;
++$TTL 86400
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 86400 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
+diff -urN bind-9.3.1.orig/conf/db.255 bind-9.3.1/conf/db.255
+--- bind-9.3.1.orig/conf/db.255 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.255 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,12 @@
++;
++; BIND reserve data file for broadcast zone
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
+diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local
+--- bind-9.3.1.orig/conf/db.local 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.local 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND data file for local loopback interface
++;
++$TTL 604800
++@ IN SOA localhost. root.localhost. (
++ 1 ; Serial
++ 604800 ; Refresh
++ 86400 ; Retry
++ 2419200 ; Expire
++ 604800 ) ; Negative Cache TTL
++;
++@ IN NS localhost.
++@ IN A 127.0.0.1
+diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root
+--- bind-9.3.1.orig/conf/db.root 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.root 2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,45 @@
++
++; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
++;; global options: printcmd
++;; Got answer:
++;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
++;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
++
++;; QUESTION SECTION:
++;. IN NS
++
++;; ANSWER SECTION:
++. 518400 IN NS A.ROOT-SERVERS.NET.
++. 518400 IN NS B.ROOT-SERVERS.NET.
++. 518400 IN NS C.ROOT-SERVERS.NET.
++. 518400 IN NS D.ROOT-SERVERS.NET.
++. 518400 IN NS E.ROOT-SERVERS.NET.
++. 518400 IN NS F.ROOT-SERVERS.NET.
++. 518400 IN NS G.ROOT-SERVERS.NET.
++. 518400 IN NS H.ROOT-SERVERS.NET.
++. 518400 IN NS I.ROOT-SERVERS.NET.
++. 518400 IN NS J.ROOT-SERVERS.NET.
++. 518400 IN NS K.ROOT-SERVERS.NET.
++. 518400 IN NS L.ROOT-SERVERS.NET.
++. 518400 IN NS M.ROOT-SERVERS.NET.
++
++;; ADDITIONAL SECTION:
++A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4
++B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201
++C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12
++D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90
++E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10
++F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241
++G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4
++H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53
++I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17
++J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30
++K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129
++L.ROOT-SERVERS.NET. 3600000 IN A 198.32.64.12
++M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33
++
++;; Query time: 81 msec
++;; SERVER: 198.41.0.4#53(a.root-servers.net.)
++;; WHEN: Sun Feb 1 11:27:14 2004
++;; MSG SIZE rcvd: 436
++
+diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf
+--- bind-9.3.1.orig/conf/named.conf 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf 2005-07-10 22:33:46.000000000 +0200
+@@ -0,0 +1,49 @@
++// This is the primary configuration file for the BIND DNS server named.
++//
++// If you are just adding zones, please do that in /etc/bind/named.conf.local
++
++include "/etc/bind/named.conf.options";
++
++// prime the server with knowledge of the root servers
++zone "." {
++ type hint;
++ file "/etc/bind/db.root";
++};
++
++// be authoritative for the localhost forward and reverse zones, and for
++// broadcast zones as per RFC 1912
++
++zone "localhost" {
++ type master;
++ file "/etc/bind/db.local";
++};
++
++zone "127.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.127";
++};
++
++zone "0.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.0";
++};
++
++zone "255.in-addr.arpa" {
++ type master;
++ file "/etc/bind/db.255";
++};
++
++// zone "com" { type delegation-only; };
++// zone "net" { type delegation-only; };
++
++// From the release notes:
++// Because many of our users are uncomfortable receiving undelegated answers
++// from root or top level domains, other than a few for whom that behaviour
++// has been trusted and expected for quite some length of time, we have now
++// introduced the "root-delegations-only" feature which applies delegation-only
++// logic to all top level domains, and to the root domain. An exception list
++// should be specified, including "MUSEUM" and "DE", and any other top level
++// domains from whom undelegated responses are expected and trusted.
++// root-delegation-only exclude { "DE"; "MUSEUM"; };
++
++include "/etc/bind/named.conf.local";
+diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local
+--- bind-9.3.1.orig/conf/named.conf.local 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.local 2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,8 @@
++//
++// Do any local configuration here
++//
++
++// Consider adding the 1918 zones here, if they are not used in your
++// organization
++//include "/etc/bind/zones.rfc1918";
++
+diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options
+--- bind-9.3.1.orig/conf/named.conf.options 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.options 2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,24 @@
++options {
++ directory "/var/cache/bind";
++
++ // If there is a firewall between you and nameservers you want
++ // to talk to, you might need to uncomment the query-source
++ // directive below. Previous versions of BIND always asked
++ // questions using port 53, but BIND 8.1 and later use an unprivileged
++ // port by default.
++
++ // query-source address * port 53;
++
++ // If your ISP provided one or more IP addresses for stable
++ // nameservers, you probably want to use them as forwarders.
++ // Uncomment the following block, and insert the addresses replacing
++ // the all-0's placeholder.
++
++ // forwarders {
++ // 0.0.0.0;
++ // };
++
++ auth-nxdomain no; # conform to RFC1035
++
++};
++
+diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918
+--- bind-9.3.1.orig/conf/zones.rfc1918 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/zones.rfc1918 2005-07-10 22:14:10.000000000 +0200
+@@ -0,0 +1,20 @@
++zone "10.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++
++zone "16.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "17.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "18.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "19.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "20.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "21.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "22.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "23.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "24.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "25.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "26.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "27.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "28.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "29.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "30.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++zone "31.172.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
++
++zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d
+--- bind-9.3.1.orig/init.d 1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/init.d 2005-07-10 23:09:58.000000000 +0200
+@@ -0,0 +1,70 @@
++#!/bin/sh
++
++PATH=/sbin:/bin:/usr/sbin:/usr/bin
++
++# for a chrooted server: "-u bind -t /var/lib/named"
++# Don't modify this line, change or create /etc/default/bind9.
++OPTIONS=""
++
++test -f /etc/default/bind9 && . /etc/default/bind9
++
++test -x /usr/sbin/rndc || exit 0
++
++case "$1" in
++ start)
++ echo -n "Starting domain name service: named"
++
++ modprobe capability >/dev/null 2>&1 || true
++ if [ ! -f /etc/bind/rndc.key ]; then
++ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
++ chmod 0640 /etc/bind/rndc.key
++ fi
++ if [ -f /var/run/named/named.pid ]; then
++ ps `cat /var/run/named/named.pid` > /dev/null && exit 1
++ fi
++
++ # dirs under /var/run can go away on reboots.
++ mkdir -p /var/run/named
++ mkdir -p /var/cache/bind
++ chmod 775 /var/run/named
++ chown root:bind /var/run/named >/dev/null 2>&1 || true
++
++ if [ ! -x /usr/sbin/named ]; then
++ echo "named binary missing - not starting"
++ exit 1
++ fi
++ if start-stop-daemon --start --quiet --exec /usr/sbin/named \
++ --pidfile /var/run/named/named.pid -- $OPTIONS; then
++ if [ -x /sbin/resolvconf ] ; then
++ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo
++ fi
++ fi
++ echo "."
++ ;;
++
++ stop)
++ echo -n "Stopping domain name service: named"
++ if [ -x /sbin/resolvconf ]; then
++ /sbin/resolvconf -d lo
++ fi
++ /usr/sbin/rndc stop >/dev/null 2>&1
++ echo "."
++ ;;
++
++ reload)
++ /usr/sbin/rndc reload
++ ;;
++
++ restart|force-reload)
++ $0 stop
++ sleep 2
++ $0 start
++ ;;
++
++ *)
++ echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
++ exit 1
++ ;;
++esac
++
++exit 0
diff --git a/poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch b/poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch
new file mode 100644
index 000000000..b02ecb106
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: bind-9.9.5/bin/Makefile.in
+===================================================================
+--- bind-9.9.5.orig/bin/Makefile.in
++++ bind-9.9.5/bin/Makefile.in
+@@ -19,7 +19,7 @@ srcdir = @srcdir@
+ VPATH = @srcdir@
+ top_srcdir = @top_srcdir@
+
+-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \
++SUBDIRS = named rndc dig delv dnssec tools nsupdate \
+ check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
+ TARGETS =
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh b/poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
new file mode 100644
index 000000000..ef915c0ae
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ ! -s /etc/bind/rndc.key ]; then
+ echo -n "Generating /etc/bind/rndc.key:"
+ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
+ chown root:bind /etc/bind/rndc.key
+ chmod 0640 /etc/bind/rndc.key
+fi
diff --git a/poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch b/poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch
new file mode 100644
index 000000000..11db95ede
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch
@@ -0,0 +1,65 @@
+Subject: init.d: add support for read-only rootfs
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ init.d | 40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+
+diff --git a/init.d b/init.d
+index 0111ed4..24677c8 100644
+--- a/init.d
++++ b/init.d
+@@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ # Don't modify this line, change or create /etc/default/bind9.
+ OPTIONS=""
+
++test -f /etc/default/rcS && . /etc/default/rcS
+ test -f /etc/default/bind9 && . /etc/default/bind9
+
++# This function is here because it's possible that /var and / are on different partitions.
++is_on_read_only_partition () {
++ DIRECTORY=$1
++ dir=`readlink -f $DIRECTORY`
++ while true; do
++ if [ ! -d "$dir" ]; then
++ echo "ERROR: $dir is not a directory"
++ exit 1
++ else
++ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
++ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
++ [ "$flag" = "FOUND" ] && partition="read-write"
++ [ "$flag" = "ro" ] && { partition="read-only"; break; }
++ done
++ if [ "$dir" = "/" -o -n "$partition" ]; then
++ break
++ else
++ dir=`dirname $dir`
++ fi
++ fi
++ done
++ [ "$partition" = "read-only" ] && echo "yes" || echo "no"
++}
++
++bind_mount () {
++ olddir=$1
++ newdir=$2
++ mkdir -p $olddir
++ cp -a $newdir/* $olddir
++ mount --bind $olddir $newdir
++}
++
++# Deal with read-only rootfs
++if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
++ [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs"
++ [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind
++ [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named
++fi
++
+ test -x /usr/sbin/rndc || exit 0
+
+ case "$1" in
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch b/poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch
new file mode 100644
index 000000000..146f3e35d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch
@@ -0,0 +1,42 @@
+bind: make "/etc/init.d/bind stop" work
+
+Upstream-Status: Inappropriate [configuration]
+
+Add some configurations, make rndc command be able to controls
+the named daemon.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ conf/named.conf | 5 +++++
+ conf/rndc.conf | 5 +++++
+ 2 files changed, 10 insertions(+), 0 deletions(-)
+ create mode 100644 conf/rndc.conf
+
+diff --git a/conf/named.conf b/conf/named.conf
+index 95829cf..c8899e7 100644
+--- a/conf/named.conf
++++ b/conf/named.conf
+@@ -47,3 +47,8 @@ zone "255.in-addr.arpa" {
+ // root-delegation-only exclude { "DE"; "MUSEUM"; };
+
+ include "/etc/bind/named.conf.local";
++include "/etc/bind/rndc.key" ;
++controls {
++ inet 127.0.0.1 allow { localhost; }
++ keys { rndc-key; };
++};
+diff --git a/conf/rndc.conf b/conf/rndc.conf
+new file mode 100644
+index 0000000..a0b481d
+--- /dev/null
++++ b/conf/rndc.conf
+@@ -0,0 +1,5 @@
++include "/etc/bind/rndc.key";
++options {
++ default-server localhost;
++ default-key rndc-key;
++};
+
+--
+1.7.5.4
+
diff --git a/poky/meta/recipes-connectivity/bind/bind/named.service b/poky/meta/recipes-connectivity/bind/bind/named.service
new file mode 100644
index 000000000..cda56ef01
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/named.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Berkeley Internet Name Domain (DNS)
+Wants=nss-lookup.target
+Before=nss-lookup.target
+After=network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/default/bind9
+PIDFile=/run/named/named.pid
+
+ExecStartPre=@SBINDIR@/generate-rndc-key.sh
+ExecStart=@SBINDIR@/named $OPTIONS
+
+ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID'
+
+ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID'
+
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/bind/bind/use-python3-and-fix-install-lib-path.patch b/poky/meta/recipes-connectivity/bind/bind/use-python3-and-fix-install-lib-path.patch
new file mode 100644
index 000000000..9829f1588
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind/use-python3-and-fix-install-lib-path.patch
@@ -0,0 +1,36 @@
+Use python3 rather default python which maybe links to python2 for oe. And add
+option for setup.py to install files to right directory.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/bin/python/Makefile.in b/bin/python/Makefile.in
+index a43a3c1..2e727f2 100644
+--- a/bin/python/Makefile.in
++++ b/bin/python/Makefile.in
+@@ -55,9 +55,9 @@ install:: ${TARGETS} installdirs
+ ${INSTALL_DATA} ${srcdir}/dnssec-coverage.8 ${DESTDIR}${mandir}/man8
+ if test -n "${PYTHON}" ; then \
+ if test -n "${DESTDIR}" ; then \
+- ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} ; \
++ ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} --install-lib=${PYTHON_SITEPACKAGES_DIR} ; \
+ else \
+- ${PYTHON} ${srcdir}/setup.py install --prefix=${prefix} ; \
++ ${PYTHON} ${srcdir}/setup.py install --prefix=${prefix} --install-lib=${PYTHON_SITEPACKAGES_DIR} ; \
+ fi \
+ fi
+
+diff --git a/configure.in b/configure.in
+index 314bb90..867923e 100644
+--- a/configure.in
++++ b/configure.in
+@@ -227,7 +227,7 @@ AC_ARG_WITH(python,
+ [ --with-python=PATH specify path to python interpreter],
+ use_python="$withval", use_python="unspec")
+
+-python="python python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
++python="python3 python3.5 python3.4 python3.3 python3.2 python2 python2.7"
+
+ testargparse='try: import argparse
+ except: exit(1)'
diff --git a/poky/meta/recipes-connectivity/bind/bind_9.10.6.bb b/poky/meta/recipes-connectivity/bind/bind_9.10.6.bb
new file mode 100644
index 000000000..8b8835ba8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bind/bind_9.10.6.bb
@@ -0,0 +1,123 @@
+SUMMARY = "ISC Internet Domain Name Server"
+HOMEPAGE = "http://www.isc.org/sw/bind/"
+SECTION = "console/network"
+
+LICENSE = "ISC & BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=dba46507446198119bcde32a4feaab43"
+
+DEPENDS = "openssl libcap"
+
+SRC_URI = "https://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
+ file://conf.patch \
+ file://make-etc-initd-bind-stop-work.patch \
+ file://dont-test-on-host.patch \
+ file://generate-rndc-key.sh \
+ file://named.service \
+ file://bind9 \
+ file://init.d-add-support-for-read-only-rootfs.patch \
+ file://bind-confgen-build-unix.o-once.patch \
+ file://0001-build-use-pkg-config-to-find-libxml2.patch \
+ file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
+ file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
+ file://0001-lib-dns-gen.c-fix-too-long-error.patch \
+ file://use-python3-and-fix-install-lib-path.patch \
+ "
+
+SRC_URI[md5sum] = "84e663284b17aee0df1ce6f248b137d7"
+SRC_URI[sha256sum] = "17bbcd2bd7b1d32f5ba4b30d5dbe8a39bce200079048073d1e0d050fdf47e69d"
+
+UPSTREAM_CHECK_URI = "https://ftp.isc.org/isc/bind9/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>9(\.\d+)+(-P\d+)*)/"
+
+
+ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
+EXTRA_OECONF = " ${ENABLE_IPV6} --with-libtool --enable-threads \
+ --disable-devpoll --enable-epoll --with-gost=no \
+ --with-gssapi=no --with-ecdsa=yes \
+ --sysconfdir=${sysconfdir}/bind \
+ --with-openssl=${STAGING_LIBDIR}/.. \
+ "
+
+inherit autotools update-rc.d systemd useradd pkgconfig python3-dir
+
+export PYTHON_SITEPACKAGES_DIR
+
+# PACKAGECONFIGs readline and libedit should NOT be set at same time
+PACKAGECONFIG ?= "readline"
+PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
+PACKAGECONFIG[readline] = "--with-readline=-lreadline,,readline"
+PACKAGECONFIG[libedit] = "--with-readline=-ledit,,libedit"
+PACKAGECONFIG[urandom] = "--with-randomdev=/dev/urandom,--with-randomdev=/dev/random,,"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/cache/bind --no-create-home \
+ --user-group bind"
+
+INITSCRIPT_NAME = "bind"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "named.service"
+
+PARALLEL_MAKE = ""
+
+RDEPENDS_${PN} = "python3-core"
+RDEPENDS_${PN}-dev = ""
+
+PACKAGE_BEFORE_PN += "${PN}-utils"
+FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
+FILES_${PN}-dev += "${bindir}/isc-config.h"
+FILES_${PN} += "${sbindir}/generate-rndc-key.sh ${PYTHON_SITEPACKAGES_DIR}"
+
+PACKAGE_BEFORE_PN += "${PN}-libs"
+FILES_${PN}-libs = "${libdir}/*.so*"
+
+do_install_prepend() {
+ # clean host path in isc-config.sh before the hardlink created
+ # by "make install":
+ # bind9-config -> isc-config.sh
+ sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
+}
+
+do_install_append() {
+ rm "${D}${bindir}/nslookup"
+ rm "${D}${mandir}/man1/nslookup.1"
+ rmdir "${D}${localstatedir}/run"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+ install -d -o bind "${D}${localstatedir}/cache/bind"
+ install -d "${D}${sysconfdir}/bind"
+ install -d "${D}${sysconfdir}/init.d"
+ install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
+ install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
+ sed -i -e '1s,#!.*python3,#! /usr/bin/python3,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
+
+ # Install systemd related files
+ install -d ${D}${sbindir}
+ install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/named.service
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/named 0755 bind bind - -" > ${D}${sysconfdir}/tmpfiles.d/bind.conf
+ fi
+
+ rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/isc/*.pyc
+}
+
+CONFFILES_${PN} = " \
+ ${sysconfdir}/bind/named.conf \
+ ${sysconfdir}/bind/named.conf.local \
+ ${sysconfdir}/bind/named.conf.options \
+ ${sysconfdir}/bind/db.0 \
+ ${sysconfdir}/bind/db.127 \
+ ${sysconfdir}/bind/db.empty \
+ ${sysconfdir}/bind/db.local \
+ ${sysconfdir}/bind/db.root \
+ "
+
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5.inc b/poky/meta/recipes-connectivity/bluez5/bluez5.inc
new file mode 100644
index 000000000..ae2a833c0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -0,0 +1,146 @@
+SUMMARY = "Linux Bluetooth Stack Userland V5"
+DESCRIPTION = "Linux Bluetooth stack V5 userland components. These include a system configurations, daemons, tools and system libraries."
+HOMEPAGE = "http://www.bluez.org"
+SECTION = "libs"
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
+ file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
+DEPENDS = "udev dbus-glib glib-2.0"
+PROVIDES += "bluez-hcidump"
+RPROVIDES_${PN} += "bluez-hcidump"
+
+RCONFLICTS_${PN} = "bluez4"
+
+PACKAGECONFIG ??= "obex-profiles \
+ readline \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ a2dp-profiles \
+ avrcp-profiles \
+ network-profiles \
+ hid-profiles \
+ hog-profiles \
+ tools \
+ deprecated \
+"
+PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
+PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline,"
+PACKAGECONFIG[testing] = "--enable-testing,--disable-testing"
+PACKAGECONFIG[midi] = "--enable-midi,--disable-midi,alsa-lib"
+PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd"
+PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,,cups"
+PACKAGECONFIG[nfc] = "--enable-nfc,--disable-nfc"
+PACKAGECONFIG[sap-profiles] = "--enable-sap,--disable-sap"
+PACKAGECONFIG[a2dp-profiles] = "--enable-a2dp,--disable-a2dp"
+PACKAGECONFIG[avrcp-profiles] = "--enable-avrcp,--disable-avrcp"
+PACKAGECONFIG[network-profiles] = "--enable-network,--disable-network"
+PACKAGECONFIG[hid-profiles] = "--enable-hid,--disable-hid"
+PACKAGECONFIG[hog-profiles] = "--enable-hog,--disable-hog"
+PACKAGECONFIG[health-profiles] = "--enable-health,--disable-health"
+PACKAGECONFIG[sixaxis] = "--enable-sixaxis,--disable-sixaxis"
+PACKAGECONFIG[tools] = "--enable-tools,--disable-tools"
+PACKAGECONFIG[threads] = "--enable-threads,--disable-threads"
+PACKAGECONFIG[deprecated] = "--enable-deprecated,--disable-deprecated"
+PACKAGECONFIG[mesh] = "--enable-mesh,--disable-mesh, json-c"
+
+SRC_URI = "\
+ ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
+ file://out-of-tree.patch \
+ file://init \
+ file://run-ptest \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
+ file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+"
+S = "${WORKDIR}/bluez-${PV}"
+
+CVE_PRODUCT = "bluez"
+
+inherit autotools pkgconfig systemd update-rc.d distro_features_check ptest gobject-introspection-data
+
+EXTRA_OECONF = "\
+ --enable-test \
+ --enable-datafiles \
+ --enable-library \
+"
+
+# bluez5 builds a large number of useful utilities but does not
+# install them. Specify which ones we want put into ${PN}-noinst-tools.
+NOINST_TOOLS_READLINE ??= ""
+NOINST_TOOLS_TESTING ??= ""
+NOINST_TOOLS_BT ??= ""
+NOINST_TOOLS = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'readline', '${NOINST_TOOLS_READLINE}', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'testing', '${NOINST_TOOLS_TESTING}', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'tools', '${NOINST_TOOLS_BT}', '', d)} \
+"
+
+do_install_append() {
+ install -d ${D}${INIT_D_DIR}
+ install -m 0755 ${WORKDIR}/init ${D}${INIT_D_DIR}/bluetooth
+
+ install -d ${D}${sysconfdir}/bluetooth/
+ if [ -f ${S}/profiles/network/network.conf ]; then
+ install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
+ fi
+ if [ -f ${S}/profiles/input/input.conf ]; then
+ install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
+ fi
+
+ if [ -f ${D}/${sysconfdir}/init.d/bluetooth ]; then
+ sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}/${sysconfdir}/init.d/bluetooth
+ fi
+
+ # Install desired tools that upstream leaves in build area
+ for f in ${NOINST_TOOLS} ; do
+ install -m 755 ${B}/$f ${D}/${bindir}
+ done
+
+ # Patch python tools to use Python 3; they should be source compatible, but
+ # still refer to Python 2 in the shebang
+ sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/bluez/test/*
+}
+
+PACKAGES =+ "${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
+
+FILES_${PN} += " \
+ ${libdir}/bluetooth/plugins/*.so \
+ ${systemd_unitdir}/ ${datadir}/dbus-1 \
+ ${libdir}/cups \
+"
+FILES_${PN}-dev += " \
+ ${libdir}/bluetooth/plugins/*.la \
+"
+
+FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
+ ${exec_prefix}/lib/systemd/user/obex.service \
+ ${datadir}/dbus-1/services/org.bluez.obex.service \
+ "
+SYSTEMD_SERVICE_${PN}-obex = "obex.service"
+
+FILES_${PN}-testtools = "${libdir}/bluez/test/*"
+
+def get_noinst_tools_paths (d, bb, tools):
+ s = list()
+ bindir = d.getVar("bindir")
+ for bdp in tools.split():
+ f = os.path.basename(bdp)
+ s.append("%s/%s" % (bindir, f))
+ return "\n".join(s)
+
+FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS'))}"
+
+RDEPENDS_${PN}-testtools += "python3 python3-dbus"
+RDEPENDS_${PN}-testtools += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"
+
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluetooth.service', '', d)}"
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "bluetooth"
+
+do_compile_ptest() {
+ oe_runmake buildtests
+}
+
+do_install_ptest() {
+ cp -r ${B}/unit/ ${D}${PTEST_PATH}
+ rm -f ${D}${PTEST_PATH}/unit/*.o
+}
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
new file mode 100644
index 000000000..2fde7bc06
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
@@ -0,0 +1,63 @@
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+
+Upstream-Status: Denied
+
+Not accepted by upstream maintainer for being a distro specific
+configuration. See thread:
+
+http://thread.gmane.org/gmane.linux.bluez.kernel/38725/focus=38843
+
+Signed-off-by: Javier Viguera <javier.viguera@digi.com>
+---
+ Makefile.obexd | 4 ++--
+ obexd/src/org.bluez.obex.service | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 2e33cbc72f2b..d5d858c857b4 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = @SYSTEMD_USERUNITDIR@
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+
+ dbussessionbusdir = @DBUS_SESSIONBUSDIR@
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+
+ obex_plugindir = $(libdir)/obex/plugins
+
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a53808884554..000000000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 000000000000..9c815f246b77
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@libexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
new file mode 100644
index 000000000..24ddae6b6
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -0,0 +1,28 @@
+From 4bdf0f96dcaa945fd29f26d56e5b36d8c23e4c8b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 1 Apr 2016 17:07:34 +0300
+Subject: [PATCH] tests: add a target for building tests without running them
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.am | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 1a48a71..ba3b92f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -425,6 +425,9 @@ endif
+ TESTS = $(unit_tests)
+ AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
+
++# This allows building tests without running them
++buildtests: $(TESTS)
++
+ if DBUS_RUN_SESSION
+ AM_TESTS_ENVIRONMENT += dbus-run-session --
+ endif
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5/init b/poky/meta/recipes-connectivity/bluez5/bluez5/init
new file mode 100644
index 000000000..d7972f2d9
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5/init
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC=bluetooth
+
+DAEMON=@LIBEXECDIR@/bluetooth/bluetoothd
+
+# If you want to be ignore error of "org.freedesktop.hostname1",
+# please enable NOPLUGIN_OPTION.
+# NOPLUGIN_OPTION="--noplugin=hostname"
+NOPLUGIN_OPTION=""
+SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
+
+test -f $DAEMON || exit 0
+
+# FIXME: any of the sourced files may fail if/with syntax errors
+test -f /etc/default/bluetooth && . /etc/default/bluetooth
+test -f /etc/default/rcS && . /etc/default/rcS
+
+set -e
+
+case $1 in
+ start)
+ echo -n "Starting $DESC: "
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled (see /etc/default/bluetooth)."
+ exit 0
+ fi
+ start-stop-daemon --start --background $SSD_OPTIONS
+ echo "${DAEMON##*/}."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled (see /etc/default/bluetooth)."
+ exit 0
+ fi
+ start-stop-daemon --stop $SSD_OPTIONS
+ echo "${DAEMON##*/}."
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ pidof ${DAEMON} >/dev/null
+ status=$?
+ if [ $status -eq 0 ]; then
+ echo "bluetooth is running."
+ else
+ echo "bluetooth is not running"
+ fi
+ exit $status
+ ;;
+ *)
+ N=/etc/init.d/bluetooth
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# vim:noet
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5/out-of-tree.patch b/poky/meta/recipes-connectivity/bluez5/bluez5/out-of-tree.patch
new file mode 100644
index 000000000..3ee79d704
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5/out-of-tree.patch
@@ -0,0 +1,26 @@
+From ed55b49a226ca3909f52416be2ae5ce1c5ca2cb2 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 22 Apr 2016 15:40:37 +0100
+Subject: [PATCH] Makefile.obexd: add missing mkdir in builtin.h generation
+
+In parallel out-of-tree builds it's possible that obexd/src/builtin.h is
+generated before the target directory has been implicitly created. Solve this by
+creating the directory before writing into it.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ Makefile.obexd | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 2e33cbc..c8286f0 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -105,2 +105,3 @@ obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h
+ obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources)
++ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest b/poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest
new file mode 100644
index 000000000..21df00c32
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5/run-ptest
@@ -0,0 +1,31 @@
+#! /bin/sh
+
+cd unit
+
+failed=0
+all=0
+
+for f in test-*; do
+ "./$f"
+ case "$?" in
+ 0)
+ echo "PASS: $f"
+ all=$((all + 1))
+ ;;
+ 77)
+ echo "SKIP: $f"
+ ;;
+ *)
+ echo "FAIL: $f"
+ failed=$((failed + 1))
+ all=$((all + 1))
+ ;;
+ esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+ echo "All $all tests passed"
+else
+ echo "$failed of $all tests failed"
+fi
+
diff --git a/poky/meta/recipes-connectivity/bluez5/bluez5_5.48.bb b/poky/meta/recipes-connectivity/bluez5/bluez5_5.48.bb
new file mode 100644
index 000000000..84a6cd22d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/bluez5/bluez5_5.48.bb
@@ -0,0 +1,69 @@
+require bluez5.inc
+
+REQUIRED_DISTRO_FEATURES = "bluez5"
+
+SRC_URI[md5sum] = "c9c853f3c90564cabec75ab35106c355"
+SRC_URI[sha256sum] = "b9a8723072ef66bae7ec301c774902ebcb444c9c5b149b5a199e60a1ba970e90"
+
+# noinst programs in Makefile.tools that are conditional on READLINE
+# support
+NOINST_TOOLS_READLINE ?= " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'deprecated', 'attrib/gatttool', '', d)} \
+ tools/obex-client-tool \
+ tools/obex-server-tool \
+ tools/bluetooth-player \
+ tools/obexctl \
+ tools/btmgmt \
+"
+
+# noinst programs in Makefile.tools that are conditional on TESTING
+# support
+NOINST_TOOLS_TESTING ?= " \
+ emulator/btvirt \
+ emulator/b1ee \
+ emulator/hfp \
+ peripheral/btsensor \
+ tools/3dsp \
+ tools/mgmt-tester \
+ tools/gap-tester \
+ tools/l2cap-tester \
+ tools/sco-tester \
+ tools/smp-tester \
+ tools/hci-tester \
+ tools/rfcomm-tester \
+ tools/bnep-tester \
+ tools/userchan-tester \
+"
+
+# noinst programs in Makefile.tools that are conditional on TOOLS
+# support
+NOINST_TOOLS_BT ?= " \
+ tools/bdaddr \
+ tools/avinfo \
+ tools/avtest \
+ tools/scotest \
+ tools/amptest \
+ tools/hwdb \
+ tools/hcieventmask \
+ tools/hcisecfilter \
+ tools/btinfo \
+ tools/btsnoop \
+ tools/btproxy \
+ tools/btiotest \
+ tools/bneptest \
+ tools/mcaptest \
+ tools/cltest \
+ tools/oobtest \
+ tools/advtest \
+ tools/seq2bseq \
+ tools/nokfw \
+ tools/create-image \
+ tools/eddystone \
+ tools/ibeacon \
+ tools/btgatt-client \
+ tools/btgatt-server \
+ tools/test-runner \
+ tools/check-selftest \
+ tools/gatt-service \
+ profiles/iap/iapd \
+"
diff --git a/poky/meta/recipes-connectivity/connman/connman-conf.bb b/poky/meta/recipes-connectivity/connman/connman-conf.bb
new file mode 100644
index 000000000..9a519ec86
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-conf.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Connman config to setup wired interface on qemu machines"
+DESCRIPTION = "This is the ConnMan configuration to set up a Wired \
+network interface for a qemu machine."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit systemd
+
+SRC_URI_append_qemuall = " file://wired.config \
+ file://wired-setup \
+ file://wired-connection.service \
+"
+PR = "r2"
+
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${localstatedir}/* ${datadir}/*"
+
+do_install() {
+ #Configure Wired network interface in case of qemu* machines
+ if test -e ${WORKDIR}/wired.config &&
+ test -e ${WORKDIR}/wired-setup &&
+ test -e ${WORKDIR}/wired-connection.service; then
+ install -d ${D}${localstatedir}/lib/connman
+ install -m 0644 ${WORKDIR}/wired.config ${D}${localstatedir}/lib/connman
+ install -d ${D}${datadir}/connman
+ install -m 0755 ${WORKDIR}/wired-setup ${D}${datadir}/connman
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/wired-connection.service ${D}${systemd_system_unitdir}
+ sed -i -e 's|@SCRIPTDIR@|${datadir}/connman|g' ${D}${systemd_system_unitdir}/wired-connection.service
+ fi
+}
+
+SYSTEMD_SERVICE_${PN}_qemuall = "wired-connection.service"
diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
new file mode 100644
index 000000000..48adfc08a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Setup a wired interface
+Before=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=@SCRIPTDIR@/wired-setup
+
+[Install]
+WantedBy=network.target
diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
new file mode 100644
index 000000000..c46899ef3
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+CONFIGF=/var/lib/connman/wired.config
+
+# Extract wired network config from /proc/cmdline
+NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'`
+
+# Check if eth0 is already set via kernel cmdline
+if [ "x$NET_CONF" = "x" ]; then
+ # Wired interface is not configured via kernel cmdline
+ # Remove connman config file template
+ rm -f ${CONFIGF}
+else
+ # Setup a connman config accordingly
+ sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF}
+fi
diff --git a/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
new file mode 100644
index 000000000..42998ce89
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
@@ -0,0 +1,9 @@
+[global]
+Name = Wired
+Description = Wired network configuration
+
+[service_ethernet]
+Type = ethernet
+IPv4 =
+MAC = 52:54:00:12:34:56
+Nameservers = 8.8.8.8
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch
new file mode 100644
index 000000000..c93e9b465
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Port-to-Gtk3.patch
@@ -0,0 +1,277 @@
+From a59b0fac02e74a971ac3f08bf28c17ce361a9526 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 2 Mar 2016 15:47:49 +0200
+Subject: [PATCH] Port to Gtk3
+
+Some unused (or not useful) code was removed, functionality should stay
+the same.
+
+Code still contains quite a few uses of deprecated API.
+
+Upstream-Status: Submitted
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ applet/agent.c | 3 +--
+ applet/main.c | 43 -------------------------------------------
+ applet/status.c | 8 --------
+ configure.ac | 3 +--
+ properties/ethernet.c | 14 +++++++-------
+ properties/main.c | 2 +-
+ properties/wifi.c | 12 ++++++------
+ 7 files changed, 16 insertions(+), 69 deletions(-)
+
+diff --git a/applet/agent.c b/applet/agent.c
+index 65bed08..04fe86a 100644
+--- a/applet/agent.c
++++ b/applet/agent.c
+@@ -126,7 +126,6 @@ static void request_input_dialog(GHashTable *request,
+ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
+ gtk_window_set_urgency_hint(GTK_WINDOW(dialog), TRUE);
+- gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
+ input->dialog = dialog;
+
+ gtk_dialog_add_button(GTK_DIALOG(dialog),
+@@ -139,7 +138,7 @@ static void request_input_dialog(GHashTable *request,
+ gtk_table_set_row_spacings(GTK_TABLE(table), 4);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 20);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 12);
+- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), table);
++ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG(dialog))), table);
+
+ label = gtk_label_new(_("Please provide some network information:"));
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
+diff --git a/applet/main.c b/applet/main.c
+index f12d371..cd16285 100644
+--- a/applet/main.c
++++ b/applet/main.c
+@@ -157,46 +157,6 @@ static void name_owner_changed(DBusGProxy *proxy, const char *name,
+ }
+ }
+
+-static void open_uri(GtkWindow *parent, const char *uri)
+-{
+- GtkWidget *dialog;
+- GdkScreen *screen;
+- GError *error = NULL;
+- gchar *cmdline;
+-
+- screen = gtk_window_get_screen(parent);
+-
+- cmdline = g_strconcat("xdg-open ", uri, NULL);
+-
+- if (gdk_spawn_command_line_on_screen(screen,
+- cmdline, &error) == FALSE) {
+- dialog = gtk_message_dialog_new(parent,
+- GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
+- GTK_BUTTONS_CLOSE, "%s", error->message);
+- gtk_dialog_run(GTK_DIALOG(dialog));
+- gtk_widget_destroy(dialog);
+- g_error_free(error);
+- }
+-
+- g_free(cmdline);
+-}
+-
+-static void about_url_hook(GtkAboutDialog *dialog,
+- const gchar *url, gpointer data)
+-{
+- open_uri(GTK_WINDOW(dialog), url);
+-}
+-
+-static void about_email_hook(GtkAboutDialog *dialog,
+- const gchar *email, gpointer data)
+-{
+- gchar *uri;
+-
+- uri = g_strconcat("mailto:", email, NULL);
+- open_uri(GTK_WINDOW(dialog), uri);
+- g_free(uri);
+-}
+-
+ static void about_callback(GtkWidget *item, gpointer user_data)
+ {
+ const gchar *authors[] = {
+@@ -204,9 +164,6 @@ static void about_callback(GtkWidget *item, gpointer user_data)
+ NULL
+ };
+
+- gtk_about_dialog_set_url_hook(about_url_hook, NULL, NULL);
+- gtk_about_dialog_set_email_hook(about_email_hook, NULL, NULL);
+-
+ gtk_show_about_dialog(NULL, "version", VERSION,
+ "copyright", "Copyright \xc2\xa9 2008 Intel Corporation",
+ "comments", _("A connection manager for the GNOME desktop"),
+diff --git a/applet/status.c b/applet/status.c
+index aed6f1e..015ff29 100644
+--- a/applet/status.c
++++ b/applet/status.c
+@@ -102,8 +102,6 @@ static void icon_animation_start(IconAnimation *animation,
+ {
+ available = TRUE;
+
+- gtk_status_icon_set_tooltip(statusicon, NULL);
+-
+ animation->start = start;
+ animation->end = (end == 0) ? animation->count - 1 : end;
+
+@@ -120,8 +118,6 @@ static void icon_animation_stop(IconAnimation *animation)
+ {
+ available = TRUE;
+
+- gtk_status_icon_set_tooltip(statusicon, NULL);
+-
+ if (animation->id > 0)
+ g_source_remove(animation->id);
+
+@@ -251,8 +247,6 @@ void status_unavailable(void)
+ available = FALSE;
+
+ gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_notifier);
+- gtk_status_icon_set_tooltip(statusicon,
+- "Connection Manager daemon is not running");
+
+ gtk_status_icon_set_visible(statusicon, TRUE);
+ }
+@@ -299,7 +293,6 @@ static void set_ready(gint signal)
+
+ if (signal < 0) {
+ gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_wired);
+- gtk_status_icon_set_tooltip(statusicon, NULL);
+ return;
+ }
+
+@@ -311,7 +304,6 @@ static void set_ready(gint signal)
+ index = 4;
+
+ gtk_status_icon_set_from_pixbuf(statusicon, pixbuf_signal[index]);
+- gtk_status_icon_set_tooltip(statusicon, NULL);
+ }
+
+ struct timeout_data {
+diff --git a/configure.ac b/configure.ac
+index b972e07..a4dad5d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -55,8 +55,7 @@ AC_SUBST(DBUS_LIBS)
+ DBUS_BINDING_TOOL="dbus-binding-tool"
+ AC_SUBST(DBUS_BINDING_TOOL)
+
+-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8, dummy=yes,
+- AC_MSG_ERROR(gtk+ >= 2.8 is required))
++PKG_CHECK_MODULES(GTK, gtk+-3.0)
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+
+diff --git a/properties/ethernet.c b/properties/ethernet.c
+index 31db7a0..0b6b423 100644
+--- a/properties/ethernet.c
++++ b/properties/ethernet.c
+@@ -82,7 +82,7 @@ void add_ethernet_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
+ gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
+
+- table = gtk_table_new(1, 1, TRUE);
++ table = gtk_table_new(1, 1, FALSE);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 10);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 10);
+ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+@@ -136,7 +136,7 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
+ gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
+
+- table = gtk_table_new(5, 5, TRUE);
++ table = gtk_table_new(5, 5, FALSE);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 10);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 10);
+ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+@@ -144,9 +144,9 @@ void add_ethernet_service(GtkWidget *mainbox, GtkTreeIter *iter, struct config_d
+ label = gtk_label_new(_("Configuration:"));
+ gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 0, 1);
+
+- combo = gtk_combo_box_new_text();
+- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP");
+- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "MANUAL");
++ combo = gtk_combo_box_text_new();
++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP");
++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "MANUAL");
+ gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo),
+ separator_function, NULL, NULL);
+ gtk_table_attach_defaults(GTK_TABLE(table), combo, 2, 4, 0, 1);
+@@ -219,7 +219,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy)
+ case CONNMAN_POLICY_DHCP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
+ for (i = 0; i < 3; i++) {
+- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0);
++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0);
+ gtk_widget_set_sensitive(entry[i], 0);
+ gtk_entry_set_text(GTK_ENTRY(entry[i]), _(""));
+ }
+@@ -227,7 +227,7 @@ void update_ethernet_ipv4(struct config_data *data, guint policy)
+ case CONNMAN_POLICY_MANUAL:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1);
+ for (i = 0; i < 3; i++) {
+- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1);
++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1);
+ gtk_widget_set_sensitive(entry[i], 1);
+ }
+ break;
+diff --git a/properties/main.c b/properties/main.c
+index c05f443..6f76361 100644
+--- a/properties/main.c
++++ b/properties/main.c
+@@ -429,7 +429,7 @@ static GtkWidget *create_interfaces(GtkWidget *window)
+
+ scrolled = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
+- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
++ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
+ GTK_SHADOW_OUT);
+ gtk_box_pack_start(GTK_BOX(hbox), scrolled, FALSE, TRUE, 0);
+diff --git a/properties/wifi.c b/properties/wifi.c
+index bd325ef..a5827e0 100644
+--- a/properties/wifi.c
++++ b/properties/wifi.c
+@@ -125,7 +125,7 @@ void add_wifi_switch_button(GtkWidget *mainbox, GtkTreeIter *iter,
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 24);
+ gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, FALSE, 0);
+
+- table = gtk_table_new(1, 1, TRUE);
++ table = gtk_table_new(1, 1, FALSE);
+ gtk_table_set_row_spacings(GTK_TABLE(table), 10);
+ gtk_table_set_col_spacings(GTK_TABLE(table), 10);
+ gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+@@ -185,9 +185,9 @@ static void wifi_ipconfig(GtkWidget *table, struct config_data *data, GtkTreeIte
+ gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 3, 4);
+ data->ipv4.label[0] = label;
+
+- combo = gtk_combo_box_new_text();
+- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "DHCP");
+- gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Manual");
++ combo = gtk_combo_box_text_new();
++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "DHCP");
++ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), "Manual");
+
+ gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(combo),
+ separator_function, NULL, NULL);
+@@ -335,14 +335,14 @@ void update_wifi_ipv4(struct config_data *data, guint policy)
+ case CONNMAN_POLICY_DHCP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
+ for (i = 0; i < 3; i++) {
+- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 0);
++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 0);
+ gtk_widget_set_sensitive(entry[i], 0);
+ }
+ break;
+ case CONNMAN_POLICY_MANUAL:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 1);
+ for (i = 0; i < 3; i++) {
+- gtk_entry_set_editable(GTK_ENTRY(entry[i]), 1);
++ gtk_editable_set_editable(GTK_EDITABLE(entry[i]), 1);
+ gtk_widget_set_sensitive(entry[i], 1);
+ }
+ break;
+--
+2.8.1
+
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch
new file mode 100644
index 000000000..7957500dc
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch
@@ -0,0 +1,35 @@
+From 5907a23ad2f49702960a33f9e2039552673eabc7 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Mon, 17 Dec 2012 14:01:18 +0200
+Subject: [PATCH] Removed icon from connman-gnome "about" applet
+
+The connman-gnome "about" applet showed a picture that
+can not be displayed. There is no designated picture
+in connman-gnome to be used in the about section, so
+it was removed.
+
+[OE-Core #2509]
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ applet/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/applet/main.c b/applet/main.c
+index f12d371..c7b3c7f 100644
+--- a/applet/main.c
++++ b/applet/main.c
+@@ -212,7 +212,7 @@ static void about_callback(GtkWidget *item, gpointer user_data)
+ "comments", _("A connection manager for the GNOME desktop"),
+ "authors", authors,
+ "translator-credits", _("translator-credits"),
+- "logo-icon-name", "network-wireless", NULL);
++ NULL);
+ }
+
+ static void settings_callback(GtkWidget *item, gpointer user_data)
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch
new file mode 100644
index 000000000..f4049fa3e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch
@@ -0,0 +1,187 @@
+connman-gnome: fix dbus interface name
+
+This patch resolves following error:
+
+"connman-dbus.xml": "connman" is not a valid D-Bus interface name
+
+https://502552.bugs.gentoo.org/attachment.cgi?id=380652
+
+Upstream-Status: Backport
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ common/connman-client.c | 24 ++++++++++++------------
+ common/connman-client.h | 4 ++--
+ common/connman-dbus.c | 6 +++---
+ common/connman-dbus.xml | 2 +-
+ 4 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/common/connman-client.c b/common/connman-client.c
+index c55e25c..9d818b2 100644
+--- a/common/connman-client.c
++++ b/common/connman-client.c
+@@ -289,7 +289,7 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
+
+ g_value_init(&value, DBUS_TYPE_G_DICTIONARY);
+ g_value_set_boxed(&value, ipv4);
+- ret = connman_set_property(proxy, "IPv4.Configuration", &value, NULL);
++ ret = net_connman_set_property(proxy, "IPv4.Configuration", &value, NULL);
+
+ g_object_unref(proxy);
+
+@@ -317,7 +317,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ g_value_set_boolean(&value, powered);
+
+ error = NULL;
+- connman_set_property(proxy, "Powered", &value, &error);
++ net_connman_set_property(proxy, "Powered", &value, &error);
+ if( error )
+ fprintf (stderr, "error: %s\n", error->message);
+
+@@ -325,7 +325,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ }
+
+ void connman_client_scan(ConnmanClient *client, const gchar *device,
+- connman_scan_reply callback, gpointer user_data)
++ net_connman_scan_reply callback, gpointer user_data)
+ {
+ ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
+ DBusGProxy *proxy;
+@@ -339,7 +339,7 @@ void connman_client_scan(ConnmanClient *client, const gchar *device,
+ if (proxy == NULL)
+ return;
+
+- connman_scan_async(proxy, callback, user_data);
++ net_connman_scan_async(proxy, callback, user_data);
+
+ g_object_unref(proxy);
+ }
+@@ -353,7 +353,7 @@ gboolean connman_client_get_offline_status(ConnmanClient *client)
+
+ DBG("client %p", client);
+
+- ret = connman_get_properties(priv->manager, &hash, NULL);
++ ret = net_connman_get_properties(priv->manager, &hash, NULL);
+
+ if (ret == FALSE)
+ goto done;
+@@ -375,7 +375,7 @@ void connman_client_set_offlinemode(ConnmanClient *client, gboolean status)
+ g_value_init(&value, G_TYPE_BOOLEAN);
+ g_value_set_boolean(&value, status);
+
+- connman_set_property(priv->manager, "OfflineMode", &value, NULL);
++ net_connman_set_property(priv->manager, "OfflineMode", &value, NULL);
+ }
+
+ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path,
+@@ -398,7 +398,7 @@ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path,
+ return TRUE;
+
+ if (type == CONNMAN_TYPE_WIFI)
+- connman_disconnect(proxy, NULL);
++ net_connman_disconnect(proxy, NULL);
+
+ g_object_unref(proxy);
+
+@@ -422,13 +422,13 @@ void connman_client_connect(ConnmanClient *client, const gchar *network)
+ if (proxy == NULL)
+ return;
+
+- connman_connect(proxy, NULL);
++ net_connman_connect(proxy, NULL);
+
+ g_object_unref(proxy);
+ }
+
+ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+- connman_connect_reply callback, gpointer userdata)
++ net_connman_connect_reply callback, gpointer userdata)
+ {
+ ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
+ DBusGProxy *proxy;
+@@ -446,7 +446,7 @@ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+ if (proxy == NULL)
+ goto done;
+
+- connman_connect_async(proxy, callback, userdata);
++ net_connman_connect_async(proxy, callback, userdata);
+
+ done:
+ return;
+@@ -476,7 +476,7 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network)
+ if (proxy == NULL)
+ return;
+
+- connman_disconnect(proxy, NULL);
++ net_connman_disconnect(proxy, NULL);
+
+ g_object_unref(proxy);
+ }
+@@ -532,7 +532,7 @@ void connman_client_remove(ConnmanClient *client, const gchar *network)
+ if (proxy == NULL)
+ return;
+
+- connman_remove(proxy, NULL);
++ net_connman_remove(proxy, NULL);
+
+ g_object_unref(proxy);
+ }
+diff --git a/common/connman-client.h b/common/connman-client.h
+index 9e2e6d5..98241de 100644
+--- a/common/connman-client.h
++++ b/common/connman-client.h
+@@ -70,13 +70,13 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
+ struct ipv4_config *ipv4_config);
+ void connman_client_scan(ConnmanClient *client, const gchar *device,
+- connman_scan_reply callback, gpointer user_data);
++ net_connman_scan_reply callback, gpointer user_data);
+
+ void connman_client_connect(ConnmanClient *client, const gchar *network);
+ void connman_client_disconnect(ConnmanClient *client, const gchar *network);
+ gchar *connman_client_get_security(ConnmanClient *client, const gchar *network);
+ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+- connman_connect_reply callback, gpointer userdata);
++ net_connman_connect_reply callback, gpointer userdata);
+ void connman_client_set_remember(ConnmanClient *client, const gchar *network,
+ gboolean remember);
+
+diff --git a/common/connman-dbus.c b/common/connman-dbus.c
+index b82b3e1..543eb43 100644
+--- a/common/connman-dbus.c
++++ b/common/connman-dbus.c
+@@ -655,15 +655,15 @@ DBusGProxy *connman_dbus_create_manager(DBusGConnection *conn,
+
+ DBG("getting manager properties");
+
+- connman_get_properties_async(proxy, manager_properties, store);
++ net_connman_get_properties_async(proxy, manager_properties, store);
+
+ DBG("getting technologies");
+
+- connman_get_technologies_async(proxy, manager_technologies, store);
++ net_connman_get_technologies_async(proxy, manager_technologies, store);
+
+ DBG("getting services");
+
+- connman_get_services_async(proxy, manager_services, store);
++ net_connman_get_services_async(proxy, manager_services, store);
+
+ return proxy;
+ }
+diff --git a/common/connman-dbus.xml b/common/connman-dbus.xml
+index 56b9582..0199d52 100644
+--- a/common/connman-dbus.xml
++++ b/common/connman-dbus.xml
+@@ -1,7 +1,7 @@
+ <?xml version="1.0" encoding="UTF-8" ?>
+
+ <node name="/">
+- <interface name="connman">
++ <interface name="net.connman">
+ <method name="GetProperties">
+ <arg type="a{sv}" direction="out"/>
+ </method>
+--
+1.9.1
+
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
new file mode 100644
index 000000000..33247c1e2
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
Binary files differ
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
new file mode 100644
index 000000000..a94fb952f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
Binary files differ
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
new file mode 100644
index 000000000..b5eb405a9
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
Binary files differ
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
new file mode 100644
index 000000000..be54419fa
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
Binary files differ
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
new file mode 100644
index 000000000..1c40ac9a1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
Binary files differ
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch b/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch
new file mode 100644
index 000000000..0421cda0b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch
@@ -0,0 +1,36 @@
+In networks that don't have a DHCP server configured, ipv4 address
+allocation fails and the ipv4 structure doesn't get populated. When
+the GUI is trying to read the ipv4_config.method field to see whether
+it contains "dhcp" string, a segmentation fault is generated.
+
+Ethernet manual configuration behavior remains unchanged after this fix.
+
+Upstream-Status: Pending
+
+Signed-off-by: Emilia Ciobanu <emilia.maria.silvia.ciobanu@intel.com>
+Index: git/properties/ethernet.c
+===================================================================
+--- git.orig/properties/ethernet.c
++++ git/properties/ethernet.c
+@@ -194,7 +194,7 @@ void add_ethernet_service(GtkWidget *mai
+
+ data->button = button;
+
+- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
++ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ update_ethernet_ipv4(data, CONNMAN_POLICY_DHCP);
+ else
+ update_ethernet_ipv4(data, CONNMAN_POLICY_MANUAL);
+Index: git/properties/wifi.c
+===================================================================
+--- git.orig/properties/wifi.c
++++ git/properties/wifi.c
+@@ -230,7 +230,7 @@ static void wifi_ipconfig(GtkWidget *tab
+
+ data->ipv4_config = ipv4_config;
+
+- if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
++ if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ update_wifi_ipv4(data, CONNMAN_POLICY_DHCP);
+ else
+ update_wifi_ipv4(data, CONNMAN_POLICY_MANUAL);
diff --git a/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb b/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
new file mode 100644
index 000000000..a56bd3751
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
@@ -0,0 +1,30 @@
+SUMMARY = "GTK+ frontend for the ConnMan network connection manager"
+HOMEPAGE = "http://connman.net/"
+SECTION = "libs/network"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://properties/main.c;beginline=1;endline=20;md5=50c77c81871308b033ab7a1504626afb \
+ file://common/connman-dbus.c;beginline=1;endline=20;md5=de6b485c0e717a0236402d220187717a"
+
+DEPENDS = "gtk+3 dbus-glib dbus-glib-native intltool-native gettext-native"
+
+# 0.7 tag
+SRCREV = "cf3c325b23dae843c5499a113591cfbc98acb143"
+SRC_URI = "git://github.com/connectivity/connman-gnome.git \
+ file://0001-Removed-icon-from-connman-gnome-about-applet.patch \
+ file://null_check_for_ipv4_config.patch \
+ file://images/* \
+ file://connman-gnome-fix-dbus-interface-name.patch \
+ file://0001-Port-to-Gtk3.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep gtk-icon-cache pkgconfig distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+RDEPENDS_${PN} = "connman"
+
+do_install_append() {
+ install -m 0644 ${WORKDIR}/images/* ${D}/usr/share/icons/hicolor/22x22/apps/
+}
diff --git a/poky/meta/recipes-connectivity/connman/connman.inc b/poky/meta/recipes-connectivity/connman/connman.inc
new file mode 100644
index 000000000..2b03f9cb0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman.inc
@@ -0,0 +1,216 @@
+SUMMARY = "A daemon for managing internet connections within embedded devices"
+DESCRIPTION = "The ConnMan project provides a daemon for managing \
+internet connections within embedded devices running the Linux \
+operating system. The Connection Manager is designed to be slim and \
+to use as few resources as possible, so it can be easily integrated. \
+It is a fully modular system that can be extended, through plug-ins, \
+to support all kinds of wired or wireless technologies. Also, \
+configuration methods, like DHCP and domain name resolving, are \
+implemented using plug-ins."
+HOMEPAGE = "http://connman.net/"
+BUGTRACKER = "https://01.org/jira/browse/CM"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
+
+inherit autotools pkgconfig systemd update-rc.d bluetooth update-alternatives
+
+DEPENDS = "dbus glib-2.0 ppp readline"
+
+INC_PR = "r20"
+
+EXTRA_OECONF += "\
+ ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
+ ac_cv_path_PPPD=${sbindir}/pppd \
+ --enable-debug \
+ --enable-loopback \
+ --enable-ethernet \
+ --enable-tools \
+ --disable-polkit \
+ --enable-client \
+"
+
+PACKAGECONFIG ??= "wispr \
+ ${@bb.utils.filter('DISTRO_FEATURES', '3g systemd wifi', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ iptables \
+"
+
+# If you want ConnMan to support VPN, add following statement into
+# local.conf or distro config
+# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp"
+
+PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/ --with-tmpfilesdir=${sysconfdir}/tmpfiles.d/,--with-systemdunitdir='' --with-tmpfilesdir=''"
+PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant"
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}, ${BLUEZ}"
+PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
+PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
+PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
+PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
+PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd"
+PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
+# WISPr support for logging into hotspots, requires TLS
+PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
+PACKAGECONFIG[nftables] = "--with-firewall=nftables ,,libmnl libnftnl,,kernel-module-nf-tables-ipv4 kernel-module-nft-chain-nat-ipv4 kernel-module-nft-chain-route-ipv4 kernel-module-nft-meta kernel-module-nft-masq-ipv4 kernel-module-nft-nat"
+PACKAGECONFIG[iptables] = "--with-firewall=iptables ,,iptables,iptables"
+
+INITSCRIPT_NAME = "connman"
+INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
+
+python __anonymous () {
+ systemd_packages = "${PN}"
+ pkgconfig = d.getVar('PACKAGECONFIG')
+ if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
+ systemd_packages += " ${PN}-vpn"
+ d.setVar('SYSTEMD_PACKAGES', systemd_packages)
+}
+
+SYSTEMD_SERVICE_${PN} = "connman.service"
+SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
+SYSTEMD_SERVICE_${PN}-wait-online = "connman-wait-online.service"
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','resolv-conf','',d)}"
+ALTERNATIVE_TARGET[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv-conf.connman','',d)}"
+ALTERNATIVE_LINK_NAME[resolv-conf] = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${sysconfdir}/resolv.conf','',d)}"
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
+ sed -i s%@DATADIR@%${datadir}% ${D}${sysconfdir}/init.d/connman
+ fi
+
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/tools/*-test ${D}${bindir}
+ if [ -e ${B}/tools/wispr ]; then
+ install -m 0755 ${B}/tools/wispr ${D}${bindir}
+ fi
+ install -m 0755 ${B}/client/connmanctl ${D}${bindir}
+
+ # We don't need to package an empty directory
+ rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
+
+ # Automake 1.12 won't install empty directories, but we need the
+ # plugins directory to be present for ownership
+ mkdir -p ${D}${libdir}/connman/plugins
+
+ # For read-only filesystem, do not create links during bootup
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ ln -sf ../run/connman/resolv.conf ${D}${sysconfdir}/resolv-conf.connman
+ fi
+}
+
+# These used to be plugins, but now they are core
+RPROVIDES_${PN} = "\
+ connman-plugin-loopback \
+ connman-plugin-ethernet \
+ ${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
+ "
+
+RDEPENDS_${PN} = "\
+ dbus \
+ "
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
+
+def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
+ plugintype = pkg.split( '-' )[-1]
+ if plugintype in depmap:
+ rdepends = map(lambda x: multilib_prefix + x, \
+ depmap[plugintype].split())
+ d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends))
+ if add_insane_skip:
+ d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so")
+
+python populate_packages_prepend() {
+ depmap = dict(pppd="ppp")
+ multilib_prefix = (d.getVar("MLPREFIX") or "")
+
+ hook = lambda file,pkg,x,y,z: \
+ add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
+ plugin_dir = d.expand('${libdir}/connman/plugins/')
+ plugin_name = d.expand('${PN}-plugin-%s')
+ do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
+ '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
+
+ hook = lambda file,pkg,x,y,z: \
+ add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
+ plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
+ plugin_name = d.expand('${PN}-plugin-vpn-%s')
+ do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
+ '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
+}
+
+PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
+
+FILES_${PN}-tools = "${bindir}/wispr"
+RDEPENDS_${PN}-tools ="${PN}"
+
+FILES_${PN}-tests = "${bindir}/*-test"
+
+FILES_${PN}-client = "${bindir}/connmanctl"
+RDEPENDS_${PN}-client ="${PN}"
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
+ ${libdir}/connman/plugins \
+ ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+ ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
+ ${datadir}/dbus-1/system-services/* \
+ ${sysconfdir}/tmpfiles.d/connman_resolvconf.conf"
+
+FILES_${PN}-dev += "${libdir}/connman/*/*.la"
+
+PACKAGES =+ "${PN}-vpn ${PN}-wait-online"
+
+SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
+DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \
+managing VPN connections within embedded devices running the Linux \
+operating system. The connman-vpnd handles all the VPN connections \
+and starts/stops VPN client processes when necessary. The connman-vpnd \
+provides a DBus API for managing VPN connections. All the different \
+VPN technogies are implemented using plug-ins."
+FILES_${PN}-vpn += "${sbindir}/connman-vpnd \
+ ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
+ ${datadir}/dbus-1/system-services/net.connman.vpn.service \
+ ${systemd_unitdir}/system/connman-vpn.service"
+
+SUMMARY_${PN}-wait-online = "A program that will return once ConnMan has connected to a network"
+DESCRIPTION_${PN}-wait-online = "A service that can be enabled so that \
+the system waits until a network connection is established."
+FILES_${PN}-wait-online += "${sbindir}/connmand-wait-online \
+ ${systemd_unitdir}/system/connman-wait-online.service"
+
+SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
+to create a VPN connection to OpenVPN server."
+FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
+ ${libdir}/connman/plugins-vpn/openvpn.so"
+RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
+to create a VPN connection to Cisco3000 VPN Concentrator."
+FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
+ ${libdir}/connman/plugins-vpn/vpnc.so"
+RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
+to create a VPN connection to L2TP server."
+FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
+ ${libdir}/connman/plugins-vpn/l2tp.so"
+RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
+to create a VPN connection to PPTP server."
+FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
+ ${libdir}/connman/plugins-vpn/pptp.so"
+RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"
diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch b/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch
new file mode 100644
index 000000000..8e2e0bd02
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0001-connman.service-stop-systemd-resolved-when-we-use-co.patch
@@ -0,0 +1,29 @@
+From 9f70b94ebf18f52c115634642652830fa77f27a1 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Mon, 12 Jun 2017 16:52:39 +0300
+Subject: [PATCH] connman.service: stop systemd-resolved when we use connman
+
+Stop systemd-resolved service when we use connman as network manager.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/connman.service.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/connman.service.in b/src/connman.service.in
+index 9f5c10f..dab48bc 100644
+--- a/src/connman.service.in
++++ b/src/connman.service.in
+@@ -6,6 +6,7 @@ RequiresMountsFor=@localstatedir@/lib/connman
+ After=dbus.service network-pre.target systemd-sysusers.service
+ Before=network.target multi-user.target shutdown.target
+ Wants=network.target
++Conflicts=systemd-resolved.service
+
+ [Service]
+ Type=dbus
+--
+2.4.0
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch b/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch
new file mode 100644
index 000000000..f9080d4ba
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch
@@ -0,0 +1,41 @@
+From 929fc9b7068100444e0ffcccd25841f78791e619 Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Fri, 15 Sep 2017 06:40:08 -0400
+Subject: [PATCH] gweb: Fix a crash using wispr over TLS
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+When gnutls_channel is instantiated, the gnutls_channel->established
+has to be initiated as FALSE. Otherwise, check_handshake function
+won't work. A random initial value 1 of gnutls_channel->established
+will make check_handshake return G_IO_STATUS_NORMAL, when the channel
+is actually not ready to be used. The observed behaviours are,
+
+- wispr is getting random errors in wispr_portal_web_result
+- ConnMan crashes on exit after those random errors
+- when wispr is luckly working, ConnMan doesn't crash on exit
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=73e53f3bd9e7debae86341f1eee7b97862a56a5e]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ gweb/giognutls.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gweb/giognutls.c b/gweb/giognutls.c
+index 09dc9e7..c029a8b 100644
+--- a/gweb/giognutls.c
++++ b/gweb/giognutls.c
+@@ -421,7 +421,7 @@ GIOChannel *g_io_channel_gnutls_new(int fd)
+
+ DBG("");
+
+- gnutls_channel = g_new(GIOGnuTLSChannel, 1);
++ gnutls_channel = g_new0(GIOGnuTLSChannel, 1);
+
+ channel = (GIOChannel *) gnutls_channel;
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch b/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch
new file mode 100644
index 000000000..dd7b35674
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0001-inet-Add-prefixlen-to-iproute_default_function.patch
@@ -0,0 +1,63 @@
+From 508dc60a1f0758ebc586b6b086478a176d493086 Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Thu, 5 Oct 2017 09:34:41 +0100
+Subject: [PATCH 1/4] inet: Add prefixlen to iproute_default_function
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+Add prefixlen parameter to this function in preparation for using
+it also in creating subnet route later, e.g.
+
+default via 192.168.100.1 dev eth0
+192.168.100.0/24 dev eth0
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=edda5b695de2ee79f02314abc9b46fdd46b388e1]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ src/inet.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/inet.c b/src/inet.c
+index b887aa0..ab8aec8 100644
+--- a/src/inet.c
++++ b/src/inet.c
+@@ -2796,7 +2796,7 @@ int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmar
+ }
+
+ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
+- const char *gateway)
++ const char *gateway, unsigned char prefixlen)
+ {
+ struct __connman_inet_rtnl_handle rth;
+ unsigned char buf[sizeof(struct in6_addr)];
+@@ -2829,6 +2829,7 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
+ rth.req.u.r.rt.rtm_protocol = RTPROT_BOOT;
+ rth.req.u.r.rt.rtm_scope = RT_SCOPE_UNIVERSE;
+ rth.req.u.r.rt.rtm_type = RTN_UNICAST;
++ rth.req.u.r.rt.rtm_dst_len = prefixlen;
+
+ __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req), RTA_GATEWAY,
+ buf, len);
+@@ -2860,7 +2861,7 @@ int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex,
+ {
+ /* ip route add default via 1.2.3.4 dev wlan0 table 1234 */
+
+- return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway);
++ return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, 0);
+ }
+
+ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex,
+@@ -2868,7 +2869,7 @@ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex,
+ {
+ /* ip route del default via 1.2.3.4 dev wlan0 table 1234 */
+
+- return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway);
++ return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, 0);
+ }
+
+ int __connman_inet_get_interface_ll_address(int index, int family,
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch b/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch
new file mode 100644
index 000000000..e6f03e632
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch
@@ -0,0 +1,35 @@
+From 4ddaf78dad5a9ee4a0658235f71b75132192123e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 7 Apr 2012 18:52:12 -0700
+Subject: [PATCH] plugin.h: Change visibility to default for debug symbols
+
+gold refuses to link in undefined weak symbols which
+have hidden visibility
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Upstream-Status: Pending
+---
+ include/plugin.h | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/plugin.h b/include/plugin.h
+index 692a4e5..a9361c3 100644
+--- a/include/plugin.h
++++ b/include/plugin.h
+@@ -89,9 +89,9 @@ struct connman_plugin_desc {
+ #else
+ #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \
+ extern struct connman_debug_desc __start___debug[] \
+- __attribute__ ((weak, visibility("hidden"))); \
++ __attribute__ ((weak, visibility("default"))); \
+ extern struct connman_debug_desc __stop___debug[] \
+- __attribute__ ((weak, visibility("hidden"))); \
++ __attribute__ ((weak, visibility("default"))); \
+ extern struct connman_plugin_desc connman_plugin_desc \
+ __attribute__ ((visibility("default"))); \
+ struct connman_plugin_desc connman_plugin_desc = { \
+--
+1.7.5.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch b/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch
new file mode 100644
index 000000000..f1b4d0aaa
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0001-session-Keep-track-of-addr-in-fw_snat-session.patch
@@ -0,0 +1,112 @@
+From b5fd5945886fa1845db5c969424b63d894fe0376 Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Fri, 25 Aug 2017 10:02:16 -0400
+Subject: [PATCH 1/2] session: Keep track of addr in fw_snat & session
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+When there is more than one session in fw_snat's list of sessions,
+fw_snat failed to be re-created when update-session-state is triggered
+with new IP address. This is because index alone is not sufficient to
+decide if fw_snat needs to be re-created. The solution here is to keep
+a track of IP addr and use it to avoid false lookup of fw_snat.
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=f9e27d4abfcab5c80a38e0850b5ddb26277f97c1]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ src/session.c | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/session.c b/src/session.c
+index 9e3c559..965ac06 100644
+--- a/src/session.c
++++ b/src/session.c
+@@ -65,6 +65,7 @@ struct connman_session {
+ struct firewall_context *fw;
+ uint32_t mark;
+ int index;
++ char *addr;
+ char *gateway;
+ bool policy_routing;
+ bool snat_enabled;
+@@ -79,6 +80,7 @@ struct fw_snat {
+ GSList *sessions;
+ int id;
+ int index;
++ char *addr;
+ struct firewall_context *fw;
+ };
+
+@@ -200,7 +202,7 @@ static char *service2bearer(enum connman_service_type type)
+ return "";
+ }
+
+-static struct fw_snat *fw_snat_lookup(int index)
++static struct fw_snat *fw_snat_lookup(int index, const char *addr)
+ {
+ struct fw_snat *fw_snat;
+ GSList *list;
+@@ -208,8 +210,11 @@ static struct fw_snat *fw_snat_lookup(int index)
+ for (list = fw_snat_list; list; list = list->next) {
+ fw_snat = list->data;
+
+- if (fw_snat->index == index)
++ if (fw_snat->index == index) {
++ if (g_strcmp0(addr, fw_snat->addr) != 0)
++ continue;
+ return fw_snat;
++ }
+ }
+ return NULL;
+ }
+@@ -224,6 +229,7 @@ static int fw_snat_create(struct connman_session *session,
+
+ fw_snat->fw = __connman_firewall_create();
+ fw_snat->index = index;
++ fw_snat->addr = g_strdup(addr);
+
+ fw_snat->id = __connman_firewall_enable_snat(fw_snat->fw,
+ index, ifname, addr);
+@@ -238,6 +244,7 @@ static int fw_snat_create(struct connman_session *session,
+ return 0;
+ err:
+ __connman_firewall_destroy(fw_snat->fw);
++ g_free(fw_snat->addr);
+ g_free(fw_snat);
+ return err;
+ }
+@@ -393,7 +400,7 @@ static void del_nat_rules(struct connman_session *session)
+ return;
+
+ session->snat_enabled = false;
+- fw_snat = fw_snat_lookup(session->index);
++ fw_snat = fw_snat_lookup(session->index, session->addr);
+
+ if (!fw_snat)
+ return;
+@@ -420,8 +427,11 @@ static void add_nat_rules(struct connman_session *session)
+ if (!addr)
+ return;
+
++ g_free(session->addr);
++ session->addr = g_strdup(addr);
++
+ session->snat_enabled = true;
+- fw_snat = fw_snat_lookup(index);
++ fw_snat = fw_snat_lookup(index, session->addr);
+ if (fw_snat) {
+ fw_snat_ref(session, fw_snat);
+ return;
+@@ -502,6 +512,7 @@ static void free_session(struct connman_session *session)
+ g_free(session->info);
+ g_free(session->info_last);
+ g_free(session->gateway);
++ g_free(session->addr);
+
+ g_free(session);
+ }
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch b/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch
new file mode 100644
index 000000000..9c953e5d5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch
@@ -0,0 +1,69 @@
+From 08cda4004491d3971a8b9df937426c43800d15b1 Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Thu, 5 Oct 2017 09:37:06 +0100
+Subject: [PATCH 2/4] inet: Implement subnet route creation/deletion in
+ iproute_default_modify
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+- Calculate subnet address base on gateway address and prefixlen
+- Differentiate creation of routes to gateway and subnet
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=ff7dcf91f12a2a237feebc6e606d0a8e92975528]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ src/inet.c | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/src/inet.c b/src/inet.c
+index ab8aec8..0ddb030 100644
+--- a/src/inet.c
++++ b/src/inet.c
+@@ -2802,6 +2802,9 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
+ unsigned char buf[sizeof(struct in6_addr)];
+ int ret, len;
+ int family = connman_inet_check_ipaddress(gateway);
++ char *dst = NULL;
++
++ DBG("gateway %s/%u table %u", gateway, prefixlen, table_id);
+
+ switch (family) {
+ case AF_INET:
+@@ -2814,7 +2817,19 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
+ return -EINVAL;
+ }
+
+- ret = inet_pton(family, gateway, buf);
++ if (prefixlen) {
++ struct in_addr ipv4_subnet_addr, ipv4_mask;
++
++ memset(&ipv4_subnet_addr, 0, sizeof(ipv4_subnet_addr));
++ ipv4_mask.s_addr = htonl((0xffffffff << (32 - prefixlen)) & 0xffffffff);
++ ipv4_subnet_addr.s_addr = inet_addr(gateway);
++ ipv4_subnet_addr.s_addr &= ipv4_mask.s_addr;
++
++ dst = g_strdup(inet_ntoa(ipv4_subnet_addr));
++ }
++
++ ret = inet_pton(family, dst ? dst : gateway, buf);
++ g_free(dst);
+ if (ret <= 0)
+ return -EINVAL;
+
+@@ -2831,8 +2846,9 @@ static int iproute_default_modify(int cmd, uint32_t table_id, int ifindex,
+ rth.req.u.r.rt.rtm_type = RTN_UNICAST;
+ rth.req.u.r.rt.rtm_dst_len = prefixlen;
+
+- __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req), RTA_GATEWAY,
+- buf, len);
++ __connman_inet_rtnl_addattr_l(&rth.req.n, sizeof(rth.req),
++ prefixlen > 0 ? RTA_DST : RTA_GATEWAY, buf, len);
++
+ if (table_id < 256) {
+ rth.req.u.r.rt.rtm_table = table_id;
+ } else {
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch b/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch
new file mode 100644
index 000000000..059342771
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0002-resolve-musl-does-not-implement-res_ninit.patch
@@ -0,0 +1,77 @@
+From 10b0d16d04b811b1ccd1f9b0cfe757bce8d876a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 23:02:21 -0700
+Subject: [PATCH 2/3] resolve: musl does not implement res_ninit
+
+ported from
+http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gweb/gresolv.c | 33 ++++++++++++---------------------
+ 1 file changed, 12 insertions(+), 21 deletions(-)
+
+diff --git a/gweb/gresolv.c b/gweb/gresolv.c
+index 5cf7a9a..3ad8e70 100644
+--- a/gweb/gresolv.c
++++ b/gweb/gresolv.c
+@@ -875,8 +875,6 @@ GResolv *g_resolv_new(int index)
+ resolv->index = index;
+ resolv->nameserver_list = NULL;
+
+- res_ninit(&resolv->res);
+-
+ return resolv;
+ }
+
+@@ -916,8 +914,6 @@ void g_resolv_unref(GResolv *resolv)
+
+ flush_nameservers(resolv);
+
+- res_nclose(&resolv->res);
+-
+ g_free(resolv);
+ }
+
+@@ -1020,24 +1016,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname,
+ debug(resolv, "hostname %s", hostname);
+
+ if (!resolv->nameserver_list) {
+- int i;
+-
+- for (i = 0; i < resolv->res.nscount; i++) {
+- char buf[100];
+- int family = resolv->res.nsaddr_list[i].sin_family;
+- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
+-
+- if (family != AF_INET &&
+- resolv->res._u._ext.nsaddrs[i]) {
+- family = AF_INET6;
+- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
++ FILE *f = fopen("/etc/resolv.conf", "r");
++ if (f) {
++ char line[256], *s;
++ int i;
++ while (fgets(line, sizeof(line), f)) {
++ if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
++ continue;
++ for (s = &line[11]; isspace(s[0]); s++);
++ for (i = 0; s[i] && !isspace(s[i]); i++);
++ s[i] = 0;
++ g_resolv_add_nameserver(resolv, s, 53, 0);
+ }
+-
+- if (family != AF_INET && family != AF_INET6)
+- continue;
+-
+- if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
+- g_resolv_add_nameserver(resolv, buf, 53, 0);
++ fclose(f);
+ }
+
+ if (!resolv->nameserver_list)
+--
+2.5.1
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch b/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch
new file mode 100644
index 000000000..56ba5c3f4
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch
@@ -0,0 +1,68 @@
+From a9243f13d6e1aadd69bfcc27f75f69c38be51677 Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Wed, 4 Oct 2017 17:30:17 +0100
+Subject: [PATCH 3/4] inet: Implement APIs for creating and deleting subnet
+ route
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=3a15b0b7fccd053aff91da2cc68585509d0c509b]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ src/connman.h | 4 ++++
+ src/inet.c | 14 ++++++++++++++
+ 2 files changed, 18 insertions(+)
+
+diff --git a/src/connman.h b/src/connman.h
+index 21b7080..da4446a 100644
+--- a/src/connman.h
++++ b/src/connman.h
+@@ -240,7 +240,11 @@ int __connman_inet_rtnl_addattr32(struct nlmsghdr *n, size_t maxlen,
+ int __connman_inet_add_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
+ int __connman_inet_del_fwmark_rule(uint32_t table_id, int family, uint32_t fwmark);
+ int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex, const char *gateway);
++int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex,
++ const char *gateway, unsigned char prefixlen);
+ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex, const char *gateway);
++int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex,
++ const char *gateway, unsigned char prefixlen);
+ int __connman_inet_get_address_netmask(int ifindex,
+ struct sockaddr_in *address, struct sockaddr_in *netmask);
+
+diff --git a/src/inet.c b/src/inet.c
+index 0ddb030..dcd1ab2 100644
+--- a/src/inet.c
++++ b/src/inet.c
+@@ -2880,6 +2880,13 @@ int __connman_inet_add_default_to_table(uint32_t table_id, int ifindex,
+ return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, 0);
+ }
+
++int __connman_inet_add_subnet_to_table(uint32_t table_id, int ifindex,
++ const char *gateway, unsigned char prefixlen)
++{
++ /* ip route add 1.2.3.4/24 dev eth0 table 1234 */
++ return iproute_default_modify(RTM_NEWROUTE, table_id, ifindex, gateway, prefixlen);
++}
++
+ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex,
+ const char *gateway)
+ {
+@@ -2888,6 +2895,13 @@ int __connman_inet_del_default_from_table(uint32_t table_id, int ifindex,
+ return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, 0);
+ }
+
++int __connman_inet_del_subnet_from_table(uint32_t table_id, int ifindex,
++ const char *gateway, unsigned char prefixlen)
++{
++ /* ip route del 1.2.3.4/24 dev eth0 table 1234 */
++ return iproute_default_modify(RTM_DELROUTE, table_id, ifindex, gateway, prefixlen);
++}
++
+ int __connman_inet_get_interface_ll_address(int index, int family,
+ void *address)
+ {
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch b/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch
new file mode 100644
index 000000000..ca213eb18
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/0004-session-Use-subnet-route-creation-and-deletion-APIs.patch
@@ -0,0 +1,77 @@
+From deb9372db8396da4f7cd20555ce7c9a8b3ad96bd Mon Sep 17 00:00:00 2001
+From: Jian Liang <jianliang@tycoint.com>
+Date: Fri, 6 Oct 2017 11:40:16 +0100
+Subject: [PATCH 4/4] session: Use subnet route creation and deletion APIs
+To: connman@lists.01.org
+Cc: wagi@monom.org
+
+As subnet route is address and session specific in this case, so add
+prefixlen into struct connman_session, and update it along with ipconfig.
+Then use it in subnet route related APIs.
+
+Signed-off-by: Jian Liang <jianliang@tycoint.com>
+
+---
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/network/connman/connman.git/commit/?id=285f25ef6cc9e4a43dab83523f3e2eab4365ac26]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+ src/session.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/src/session.c b/src/session.c
+index 965ac06..7b7a14b 100644
+--- a/src/session.c
++++ b/src/session.c
+@@ -67,6 +67,7 @@ struct connman_session {
+ int index;
+ char *addr;
+ char *gateway;
++ unsigned char prefixlen;
+ bool policy_routing;
+ bool snat_enabled;
+ };
+@@ -357,13 +358,17 @@ static void del_default_route(struct connman_session *session)
+ if (!session->gateway)
+ return;
+
+- DBG("index %d routing table %d default gateway %s",
+- session->index, session->mark, session->gateway);
++ DBG("index %d routing table %d default gateway %s/%u",
++ session->index, session->mark, session->gateway, session->prefixlen);
++
++ __connman_inet_del_subnet_from_table(session->mark,
++ session->index, session->gateway, session->prefixlen);
+
+ __connman_inet_del_default_from_table(session->mark,
+ session->index, session->gateway);
+ g_free(session->gateway);
+ session->gateway = NULL;
++ session->prefixlen = 0;
+ session->index = -1;
+ }
+
+@@ -383,13 +388,20 @@ static void add_default_route(struct connman_session *session)
+ if (!session->gateway)
+ session->gateway = g_strdup(inet_ntoa(addr));
+
+- DBG("index %d routing table %d default gateway %s",
+- session->index, session->mark, session->gateway);
++ session->prefixlen = __connman_ipconfig_get_prefixlen(ipconfig);
++
++ DBG("index %d routing table %d default gateway %s/%u",
++ session->index, session->mark, session->gateway, session->prefixlen);
+
+ err = __connman_inet_add_default_to_table(session->mark,
+ session->index, session->gateway);
+ if (err < 0)
+ DBG("session %p %s", session, strerror(-err));
++
++ err = __connman_inet_add_subnet_to_table(session->mark,
++ session->index, session->gateway, session->prefixlen);
++ if (err < 0)
++ DBG("session add subnet route %p %s", session, strerror(-err));
+ }
+
+ static void del_nat_rules(struct connman_session *session)
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/connman/connman/connman b/poky/meta/recipes-connectivity/connman/connman/connman
new file mode 100644
index 000000000..c64fa0d71
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/connman
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/connmand
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+ . /etc/default/connman
+fi
+
+set -e
+
+nfsroot=0
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+
+do_start() {
+ EXTRA_PARAM=""
+ if test $nfsroot -eq 1 ; then
+ NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
+ NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'`
+
+ if [ ! -z "$NET_ADDR" ]; then
+ if [ "$NET_ADDR" = dhcp ]; then
+ ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
+ if [ ! -z "$ethn" ]; then
+ EXTRA_PARAM="-I $ethn"
+ fi
+ else
+ for i in $NET_DEVS; do
+ ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
+ if [ "$NET_ADDR" = "$ADDR" ]; then
+ EXTRA_PARAM="-I $i"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ if [ -f @DATADIR@/connman/wired-setup ] ; then
+ . @DATADIR@/connman/wired-setup
+ fi
+ $DAEMON $EXTRA_PARAM
+}
+
+do_stop() {
+ start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC"
+ do_start
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ do_stop
+ ;;
+ restart|force-reload)
+ echo "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/connman/connman/includes.patch b/poky/meta/recipes-connectivity/connman/connman/includes.patch
new file mode 100644
index 000000000..55cb18793
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/includes.patch
@@ -0,0 +1,423 @@
+Fix various issues which cause problems under musl.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 630516bcc0233b047f65665c003201ba6e77453d Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 9 Aug 2016 16:22:36 +0100
+Subject: [PATCH 1/3] Use AC_USE_SYSTEM_EXTENSIONS
+
+Instead of using #define _GNU_SOURCE in some source files which causes problems
+when building with musl as more files need the define, simply use
+AC_USE_SYSTEM_EXTENSIONS in configure.ac to get it defined globally.
+---
+ configure.ac | 1 +
+ gdhcp/client.c | 1 -
+ plugins/tist.c | 1 -
+ src/backtrace.c | 1 -
+ src/inet.c | 1 -
+ src/log.c | 1 -
+ src/ntp.c | 1 -
+ src/resolver.c | 1 -
+ src/rfkill.c | 1 -
+ src/stats.c | 1 -
+ src/timezone.c | 1 -
+ tools/stats-tool.c | 1 -
+ tools/tap-test.c | 1 -
+ tools/wispr.c | 1 -
+ vpn/plugins/vpn.c | 1 -
+ 15 files changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6e66ab3..bacf5ec 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,6 +20,7 @@ AC_SUBST(abs_top_srcdir)
+ AC_SUBST(abs_top_builddir)
+
+ AC_LANG_C
++AC_USE_SYSTEM_EXTENSIONS
+
+ AC_PROG_CC
+ AM_PROG_CC_C_O
+diff --git a/gdhcp/client.c b/gdhcp/client.c
+index fbb40ab..3aeb089 100644
+--- a/gdhcp/client.c
++++ b/gdhcp/client.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+ #include <unistd.h>
+diff --git a/plugins/tist.c b/plugins/tist.c
+index ad5ef79..cc2800a 100644
+--- a/plugins/tist.c
++++ b/plugins/tist.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdbool.h>
+ #include <stdlib.h>
+diff --git a/src/backtrace.c b/src/backtrace.c
+index 6a66c0a..4dbdda8 100644
+--- a/src/backtrace.c
++++ b/src/backtrace.c
+@@ -24,7 +24,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+diff --git a/src/inet.c b/src/inet.c
+index 69ded19..81d92c2 100644
+--- a/src/inet.c
++++ b/src/inet.c
+@@ -25,7 +25,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+ #include <unistd.h>
+diff --git a/src/log.c b/src/log.c
+index 9bae4a3..f7e82e5 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+diff --git a/src/ntp.c b/src/ntp.c
+index dd246eb..db8ae96 100644
+--- a/src/ntp.c
++++ b/src/ntp.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+diff --git a/src/resolver.c b/src/resolver.c
+index fbe4be7..ef61f92 100644
+--- a/src/resolver.c
++++ b/src/resolver.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/src/rfkill.c b/src/rfkill.c
+index 2bfb092..af49d12 100644
+--- a/src/rfkill.c
++++ b/src/rfkill.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/src/stats.c b/src/stats.c
+index 26343b1..cfcdc94 100644
+--- a/src/stats.c
++++ b/src/stats.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <errno.h>
+ #include <sys/mman.h>
+ #include <sys/types.h>
+diff --git a/src/timezone.c b/src/timezone.c
+index e346b11..8e91267 100644
+--- a/src/timezone.c
++++ b/src/timezone.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <errno.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+diff --git a/tools/stats-tool.c b/tools/stats-tool.c
+index b076478..428d94b 100644
+--- a/tools/stats-tool.c
++++ b/tools/stats-tool.c
+@@ -22,7 +22,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <sys/mman.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff --git a/tools/tap-test.c b/tools/tap-test.c
+index fdc098a..57917f5 100644
+--- a/tools/tap-test.c
++++ b/tools/tap-test.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/tools/wispr.c b/tools/wispr.c
+index d5f9341..e56dfc1 100644
+--- a/tools/wispr.c
++++ b/tools/wispr.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
+index 9a42385..479c3a7 100644
+--- a/vpn/plugins/vpn.c
++++ b/vpn/plugins/vpn.c
+@@ -23,7 +23,6 @@
+ #include <config.h>
+ #endif
+
+-#define _GNU_SOURCE
+ #include <string.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+--
+2.8.1
+
+
+From b8b7878e6cb2a1ed4fcfa256f7e232511a40e3d9 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 9 Aug 2016 15:37:50 +0100
+Subject: [PATCH 2/3] Check for in6_pktinfo.ipi6_addr explicitly
+
+Instead of assuming that just glibc has this structure, check for it at
+configure as musl also has it.
+
+Based on work by Khem Raj <raj.khem@gmail.com>.
+---
+ configure.ac | 2 ++
+ gdhcp/common.h | 5 +++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bacf5ec..ad00456 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -186,6 +186,8 @@ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+ AC_CHECK_HEADERS([execinfo.h])
+ AM_CONDITIONAL([BACKTRACE], [test "${ac_cv_header_execinfo_h}" = "yes"])
+
++AC_CHECK_MEMBERS([struct in6_pktinfo.ipi6_addr], [], [], [[#include <netinet/in.h>]])
++
+ AC_CHECK_FUNC(signalfd, dummy=yes,
+ AC_MSG_ERROR(signalfd support is required))
+
+diff --git a/gdhcp/common.h b/gdhcp/common.h
+index 75abc18..6899499 100644
+--- a/gdhcp/common.h
++++ b/gdhcp/common.h
+@@ -19,6 +19,7 @@
+ *
+ */
+
++#include <config.h>
+ #include <netinet/udp.h>
+ #include <netinet/ip.h>
+
+@@ -170,8 +171,8 @@ static const uint8_t dhcp_option_lengths[] = {
+ [OPTION_U32] = 4,
+ };
+
+-/* already defined within netinet/in.h if using GNU compiler */
+-#ifndef __USE_GNU
++/* already defined within netinet/in.h if using glibc or musl */
++#ifndef HAVE_STRUCT_IN6_PKTINFO_IPI6_ADDR
+ struct in6_pktinfo {
+ struct in6_addr ipi6_addr; /* src/dst IPv6 address */
+ unsigned int ipi6_ifindex; /* send/recv interface index */
+--
+2.8.1
+
+
+From c0726e432fa0274a2b9c70179b03df6720972816 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 9 Aug 2016 15:19:23 +0100
+Subject: [PATCH 3/3] Rationalise includes
+
+gweb/gresolv.c uses snprintf() and isspace() so it should include stdio.h and
+ctype.h.
+
+tools/dnsproxy-test uses functions from stdio.h.
+
+musl warns when sys/ headers are included when the non-sys form should be used,
+so switch sys/errno.h and so on to errno.h.
+
+musl also causes redefinition errors when pieces of the networking headers are
+included, so remove the redundant includes.
+
+Based on work by Khem Raj <raj.khem@gmail.com>.
+---
+ gweb/gresolv.c | 2 ++
+ plugins/wifi.c | 3 +--
+ src/ippool.c | 1 -
+ src/iptables.c | 2 +-
+ src/tethering.c | 2 --
+ tools/dhcp-test.c | 1 -
+ tools/dnsproxy-test.c | 1 +
+ tools/private-network-test.c | 2 +-
+ tools/tap-test.c | 2 +-
+ 9 files changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/gweb/gresolv.c b/gweb/gresolv.c
+index 8a51a9f..d55027c 100644
+--- a/gweb/gresolv.c
++++ b/gweb/gresolv.c
+@@ -23,11 +23,13 @@
+ #include <config.h>
+ #endif
+
++#include <ctype.h>
+ #include <errno.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <stdio.h>
+ #include <resolv.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+diff --git a/plugins/wifi.c b/plugins/wifi.c
+index 9d56671..148131d 100644
+--- a/plugins/wifi.c
++++ b/plugins/wifi.c
+@@ -30,9 +30,8 @@
+ #include <string.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+-#include <linux/if_arp.h>
+-#include <linux/wireless.h>
+ #include <net/ethernet.h>
++#include <linux/wireless.h>
+
+ #ifndef IFF_LOWER_UP
+ #define IFF_LOWER_UP 0x10000
+diff --git a/src/ippool.c b/src/ippool.c
+index cea1dcc..8a645da 100644
+--- a/src/ippool.c
++++ b/src/ippool.c
+@@ -28,7 +28,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+-#include <sys/errno.h>
+ #include <sys/socket.h>
+
+ #include "connman.h"
+diff --git a/src/iptables.c b/src/iptables.c
+index 5ef757a..82e3ac4 100644
+--- a/src/iptables.c
++++ b/src/iptables.c
+@@ -28,7 +28,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/socket.h>
+ #include <xtables.h>
+ #include <inttypes.h>
+diff --git a/src/tethering.c b/src/tethering.c
+index 3153349..ad062d5 100644
+--- a/src/tethering.c
++++ b/src/tethering.c
+@@ -31,10 +31,8 @@
+ #include <stdio.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+-#include <linux/sockios.h>
+ #include <string.h>
+ #include <fcntl.h>
+-#include <linux/if_tun.h>
+ #include <netinet/in.h>
+ #include <linux/if_bridge.h>
+
+diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
+index c34e10a..eae66fc 100644
+--- a/tools/dhcp-test.c
++++ b/tools/dhcp-test.c
+@@ -33,7 +33,6 @@
+ #include <arpa/inet.h>
+ #include <net/route.h>
+ #include <net/ethernet.h>
+-#include <linux/if_arp.h>
+
+ #include <gdhcp/gdhcp.h>
+
+diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
+index 551cae9..371e2e2 100644
+--- a/tools/dnsproxy-test.c
++++ b/tools/dnsproxy-test.c
+@@ -24,6 +24,7 @@
+ #endif
+
+ #include <errno.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/tools/private-network-test.c b/tools/private-network-test.c
+index 3dd115b..2828bb3 100644
+--- a/tools/private-network-test.c
++++ b/tools/private-network-test.c
+@@ -32,7 +32,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <signal.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/signalfd.h>
+ #include <unistd.h>
+
+diff --git a/tools/tap-test.c b/tools/tap-test.c
+index 57917f5..cb3ee62 100644
+--- a/tools/tap-test.c
++++ b/tools/tap-test.c
+@@ -28,7 +28,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <string.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+
+ #include <netinet/in.h>
+--
+2.8.1
diff --git a/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch b/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch
new file mode 100644
index 000000000..e96e38bcf
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman/no-version-scripts.patch
@@ -0,0 +1,27 @@
+With binutils 2.27 on at least MIPS, connmand will crash on startup. This
+appears to be due to the symbol visibilty scripts hiding symbols that stdio
+looks up at runtime, resulting in it segfaulting.
+
+This certainly appears to be a bug in binutils 2.27 although the problem has
+been known about for some time:
+
+https://sourceware.org/bugzilla/show_bug.cgi?id=17908
+
+As the version scripts are only used to hide symbols from plugins we can safely
+remove the scripts to work around the problem until binutils is fixed.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index d70725c..76ae432 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -132,2 +132 @@ src_connmand_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
+-src_connmand_LDFLAGS = -Wl,--export-dynamic \
+- -Wl,--version-script=$(srcdir)/src/connman.ver
++src_connmand_LDFLAGS = -Wl,--export-dynamic
+@@ -166,2 +165 @@ vpn_connman_vpnd_LDADD = gdbus/libgdbus-internal.la $(builtin_vpn_libadd) \
+-vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \
+- -Wl,--version-script=$(srcdir)/vpn/vpn.ver
++vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic
diff --git a/poky/meta/recipes-connectivity/connman/connman_1.35.bb b/poky/meta/recipes-connectivity/connman/connman_1.35.bb
new file mode 100644
index 000000000..ff2118113
--- /dev/null
+++ b/poky/meta/recipes-connectivity/connman/connman_1.35.bb
@@ -0,0 +1,22 @@
+require connman.inc
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+ file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \
+ file://0001-connman.service-stop-systemd-resolved-when-we-use-co.patch \
+ file://connman \
+ file://no-version-scripts.patch \
+ file://includes.patch \
+ file://0001-session-Keep-track-of-addr-in-fw_snat-session.patch \
+ file://0001-giognutls-Fix-a-crash-using-wispr-over-TLS.patch \
+ file://0001-inet-Add-prefixlen-to-iproute_default_function.patch \
+ file://0002-inet-Implement-subnet-route-creation-deletion-in-ipr.patch \
+ file://0003-inet-Implement-APIs-for-creating-and-deleting-subnet.patch \
+ file://0004-session-Use-subnet-route-creation-and-deletion-APIs.patch \
+ "
+SRC_URI_append_libc-musl = " file://0002-resolve-musl-does-not-implement-res_ninit.patch \
+ "
+
+SRC_URI[md5sum] = "bae37b45ee9b3db5ec8115188f8a7652"
+SRC_URI[sha256sum] = "66d7deb98371545c6e417239a9b3b3e3201c1529d08eedf40afbc859842cf2aa"
+
+RRECOMMENDS_${PN} = "connman-conf"
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp.inc b/poky/meta/recipes-connectivity/dhcp/dhcp.inc
new file mode 100644
index 000000000..e94370786
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -0,0 +1,143 @@
+SECTION = "console/network"
+SUMMARY = "Internet Software Consortium DHCP package"
+DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
+which allows individual devices on an IP network to get their own \
+network configuration information from a server. DHCP helps make it \
+easier to administer devices."
+
+HOMEPAGE = "http://www.isc.org/"
+
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=c5c64d696107f84b56fe337d14da1753"
+
+DEPENDS = "openssl bind"
+
+SRC_URI = "http://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
+ file://init-relay file://default-relay \
+ file://init-server file://default-server \
+ file://dhclient.conf file://dhcpd.conf \
+ file://dhclient-systemd-wrapper \
+ file://dhclient.service \
+ file://dhcpd.service file://dhcrelay.service \
+ file://dhcpd6.service \
+ "
+UPSTREAM_CHECK_URI = "ftp://ftp.isc.org/isc/dhcp/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+\.\d+\.(\d+?))/"
+
+inherit autotools systemd useradd update-rc.d
+
+USERADD_PACKAGES = "${PN}-server"
+USERADD_PARAM_${PN}-server = "--system --no-create-home --home-dir /var/run/${BPN} --shell /bin/false --user-group ${BPN}"
+
+SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay ${PN}-client"
+SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service"
+SYSTEMD_AUTO_ENABLE_${PN}-server = "disable"
+
+SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service"
+SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable"
+
+SYSTEMD_SERVICE_${PN}-client = "dhclient.service"
+SYSTEMD_AUTO_ENABLE_${PN}-client = "disable"
+
+INITSCRIPT_PACKAGES = "dhcp-server"
+INITSCRIPT_NAME_dhcp-server = "dhcp-server"
+INITSCRIPT_PARAMS_dhcp-server = "defaults"
+
+TARGET_CFLAGS += "-D_GNU_SOURCE"
+EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
+ --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
+ --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
+ --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
+ --with-libbind=${STAGING_LIBDIR}/ \
+ --enable-paranoia --disable-static \
+ --with-randomdev=/dev/random \
+ "
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
+ install -d ${D}${sysconfdir}/dhcp
+ install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
+ install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
+ install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
+ install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
+
+ rm -f ${D}${sysconfdir}/dhclient.conf*
+ rm -f ${D}${sysconfdir}/dhcpd.conf*
+ install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
+ install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
+
+ install -d ${D}${base_sbindir}/
+ if [ "${sbindir}" != "${base_sbindir}" ]; then
+ mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
+ fi
+ install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+ sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+ sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcrelay.service
+
+ install -d ${D}${base_sbindir}
+ install -m 0755 ${WORKDIR}/dhclient-systemd-wrapper ${D}${base_sbindir}/dhclient-systemd-wrapper
+ install -m 0644 ${WORKDIR}/dhclient.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhclient.service
+ sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/dhclient.service
+}
+
+PACKAGES += "dhcp-libs dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
+
+PACKAGES_remove = "${PN}"
+RDEPENDS_${PN}-dev = ""
+RDEPENDS_${PN}-staticdev = ""
+
+FILES_${PN}-libs = "${libdir}/libdhcpctl.so.0* ${libdir}/libomapi.so.0*"
+
+FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
+RRECOMMENDS_${PN}-server = "dhcp-server-config"
+
+FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
+
+FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
+
+FILES_${PN}-client = "${base_sbindir}/dhclient \
+ ${base_sbindir}/dhclient-script \
+ ${sysconfdir}/dhcp/dhclient.conf \
+ ${base_sbindir}/dhclient-systemd-wrapper \
+ "
+
+FILES_${PN}-omshell = "${bindir}/omshell"
+
+pkg_postinst_dhcp-server() {
+ mkdir -p $D/${localstatedir}/lib/dhcp
+ touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
+ touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+}
+
+pkg_postinst_dhcp-client() {
+ mkdir -p $D/${localstatedir}/lib/dhcp
+}
+
+pkg_postrm_dhcp-server() {
+ rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
+ rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+
+ if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+ echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+ fi
+}
+
+pkg_postrm_dhcp-client() {
+ rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
+ rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
+
+ if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+ echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+ fi
+}
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
new file mode 100644
index 000000000..e5b3cf9bc
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
@@ -0,0 +1,30 @@
+From 7cc29144535a622fc671dc86eb1da65b0473a7c4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 16:14:22 +0800
+Subject: [PATCH 01/11] define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
+
+Upstream-Status: Inappropriate [OE specific]
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ includes/site.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/includes/site.h b/includes/site.h
+index b2f7fd7..280fbb9 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -149,7 +149,8 @@
+ /* Define this if you want the dhcpd.conf file to go somewhere other than
+ the default location. By default, it goes in /etc/dhcpd.conf. */
+
+-/* #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" */
++#define _PATH_DHCPD_CONF "/etc/dhcp/dhcpd.conf"
++#define _PATH_DHCLIENT_CONF "/etc/dhcp/dhclient.conf"
+
+ /* Network API definitions. You do not need to choose one of these - if
+ you don't choose, one will be chosen for you in your system's config
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch
new file mode 100644
index 000000000..101c33f67
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0002-dhclient-dbus.patch
@@ -0,0 +1,117 @@
+From be7540d31c356e80ee02e90e8bf162b7ac6e5ba5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 14:56:56 +0800
+Subject: [PATCH 02/11] dhclient dbus
+
+Upstream-Status: Inappropriate [distribution]
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/bsdos | 5 +++++
+ client/scripts/freebsd | 5 +++++
+ client/scripts/linux | 5 +++++
+ client/scripts/netbsd | 5 +++++
+ client/scripts/openbsd | 5 +++++
+ client/scripts/solaris | 5 +++++
+ 6 files changed, 30 insertions(+)
+
+diff --git a/client/scripts/bsdos b/client/scripts/bsdos
+index d69d0d8..095b143 100755
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+diff --git a/client/scripts/freebsd b/client/scripts/freebsd
+index 8f3e2a2..ad7fb44 100755
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -89,6 +89,11 @@ exit_with_hooks() {
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+index 5fb1612..3d447b6 100755
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -174,6 +174,11 @@ exit_with_hooks() {
+ exit_status=$?
+ fi
+
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+diff --git a/client/scripts/netbsd b/client/scripts/netbsd
+index 07383b7..aaba8e8 100755
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+diff --git a/client/scripts/openbsd b/client/scripts/openbsd
+index e7f4746..56b980c 100644
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -45,6 +45,11 @@ exit_with_hooks() {
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+diff --git a/client/scripts/solaris b/client/scripts/solaris
+index af553b9..4a2aa69 100755
+--- a/client/scripts/solaris
++++ b/client/scripts/solaris
+@@ -26,6 +26,11 @@ exit_with_hooks() {
+ . /etc/dhclient-exit-hooks
+ fi
+ # probably should do something with exit status of the local script
++ if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++ dbus-send --system --dest=com.redhat.dhcp \
++ --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++ 'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++ fi
+ exit $exit_status
+ }
+
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch
new file mode 100644
index 000000000..810c7b6da
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0003-link-with-lcrypto.patch
@@ -0,0 +1,38 @@
+From d80bd792323dbd56269309f85b4506eb6b1b60e9 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei@gherzan.ro>
+Date: Tue, 15 Aug 2017 15:05:47 +0800
+Subject: [PATCH 03/11] link with lcrypto
+
+From 4.2.0 final release, -lcrypto check was removed and we compile
+static libraries
+from bind that are linked to libcrypto. This is why i added a patch in
+order to add
+-lcrypto to LIBS.
+
+Upstream-Status: Pending
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index cdfa352..44fb57e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -591,6 +591,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[void foo() __attribute__((noreturn));
+ # Look for optional headers.
+ AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+
++# find an MD5 library
++AC_SEARCH_LIBS(MD5_Init, [crypto])
++AC_SEARCH_LIBS(MD5Init, [crypto])
++
+ # Solaris needs some libraries for functions
+ AC_SEARCH_LIBS(socket, [socket])
+ AC_SEARCH_LIBS(inet_ntoa, [nsl])
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch
new file mode 100644
index 000000000..7d1d86798
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0004-Fix-out-of-tree-builds.patch
@@ -0,0 +1,100 @@
+From cccec0344d68dac4100b6f260ee24e7c2da9dfda Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 15:08:22 +0800
+Subject: [PATCH 04/11] Fix out of tree builds
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Rebase to 4.3.6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/Makefile.am | 4 ++--
+ common/Makefile.am | 3 ++-
+ dhcpctl/Makefile.am | 2 ++
+ omapip/Makefile.am | 1 +
+ relay/Makefile.am | 2 +-
+ server/Makefile.am | 2 +-
+ 6 files changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+index 2cb83d8..4730bb3 100644
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -7,11 +7,11 @@ SUBDIRS = . tests
+ BINDLIBDIR = @BINDDIR@/lib
+
+ AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+- -DLOCALSTATEDIR='"$(localstatedir)"'
++ -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes
+
+ dist_sysconf_DATA = dhclient.conf.example
+ sbin_PROGRAMS = dhclient
+-dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
++dhclient_SOURCES = $(srcdir)/clparse.c $(srcdir)/dhclient.c $(srcdir)/dhc6.c \
+ scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
+ scripts/netbsd scripts/nextstep scripts/openbsd \
+ scripts/solaris scripts/openwrt
+diff --git a/common/Makefile.am b/common/Makefile.am
+index 113aee8..0f24fbb 100644
+--- a/common/Makefile.am
++++ b/common/Makefile.am
+@@ -1,4 +1,5 @@
+-AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
++
+ AM_CFLAGS = $(LDAP_CFLAGS)
+
+ noinst_LIBRARIES = libdhcp.a
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+index ceb0de1..ba8dd8b 100644
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -1,5 +1,7 @@
+ BINDLIBDIR = @BINDDIR@/lib
+
++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
++
+ bin_PROGRAMS = omshell
+ lib_LIBRARIES = libdhcpctl.a
+ noinst_PROGRAMS = cltest
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+index 446a594..dd1afa0 100644
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -1,4 +1,5 @@
+ BINDLIBDIR = @BINDDIR@/lib
++AM_CPPFLAGS = -I$(top_srcdir)/includes
+
+ lib_LIBRARIES = libomapi.a
+ noinst_PROGRAMS = svtest
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+index 3060eca..6d652f6 100644
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -1,6 +1,6 @@
+ BINDLIBDIR = @BINDDIR@/lib
+
+-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+diff --git a/server/Makefile.am b/server/Makefile.am
+index 54feedf..3990b9c 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -6,7 +6,7 @@ SUBDIRS = . tests
+
+ BINDLIBDIR = @BINDDIR@/lib
+
+-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+
+ dist_sysconf_DATA = dhcpd.conf.example
+ sbin_PROGRAMS = dhcpd
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch
new file mode 100644
index 000000000..dd56381b1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch
@@ -0,0 +1,36 @@
+From 2e8ff0e4f6d39e346ea86b8c514ab4ccc78fa359 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 15:24:14 +0800
+Subject: [PATCH 05/11] dhcp-client: fix invoke dhclient-script failed on
+ Read-only file system
+
+In read-only file system, '/etc' is on the readonly partition,
+and '/etc/resolv.conf' is symlinked to a separate writable
+partition.
+
+In this situation, we create temp files 'resolv.conf.dhclient-new'
+in /tmp dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+index 3d447b6..3122a75 100755
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -40,7 +40,7 @@ make_resolv_conf() {
+ # DHCPv4
+ if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
+ [ -n "$new_domain_name_servers" ]; then
+- new_resolv_conf=/etc/resolv.conf.dhclient-new
++ new_resolv_conf=/tmp/resolv.conf.dhclient-new
+ rm -f $new_resolv_conf
+
+ if [ -n "$new_domain_name" ]; then
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0006-site.h-enable-gentle-shutdown.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0006-site.h-enable-gentle-shutdown.patch
new file mode 100644
index 000000000..c62b283d5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0006-site.h-enable-gentle-shutdown.patch
@@ -0,0 +1,30 @@
+From 01641d146e4e6bea954e4a4ee1f6230b822665b4 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 15 Aug 2017 15:37:49 +0800
+Subject: [PATCH 06/11] site.h: enable gentle shutdown
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ includes/site.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/includes/site.h b/includes/site.h
+index 280fbb9..e6c2972 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -296,7 +296,7 @@
+ situations. We plan to revisit this feature and may
+ make non-backwards compatible changes including the
+ removal of this define. Use at your own risk. */
+-/* #define ENABLE_GENTLE_SHUTDOWN */
++#define ENABLE_GENTLE_SHUTDOWN
+
+ /* Include old error codes. This is provided in case you
+ are building an external program similar to omshell for
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch
new file mode 100644
index 000000000..43c26ea21
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch
@@ -0,0 +1,42 @@
+From 7107511fd209f08f9a96f8938041ae48f3295895 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 15 Aug 2017 16:17:49 +0800
+Subject: [PATCH 07/11] Add configure argument to make the libxml2 dependency
+ explicit and determinisitic.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+Rebase to 4.3.6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 44fb57e..8e9f509 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -611,6 +611,17 @@ AC_CHECK_FUNCS(strlcat)
+ # For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
+ AC_SEARCH_LIBS(if_nametoindex, [ipv6])
+
++AC_ARG_WITH(libxml2,
++ AS_HELP_STRING([--with-libxml2], [link against libxml2. this is needed if bind was built with xml2 support enabled]),
++ with_libxml2="$withval", with_libxml2="no")
++
++if test x$with_libxml2 != xno; then
++ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
++ [if test x$with_libxml2 != xauto; then
++ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
++ fi])
++fi
++
+ # check for /dev/random (declares HAVE_DEV_RANDOM)
+ AC_MSG_CHECKING(for random device)
+ AC_ARG_WITH(randomdev,
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0008-tweak-to-support-external-bind.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0008-tweak-to-support-external-bind.patch
new file mode 100644
index 000000000..006d18ae7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0008-tweak-to-support-external-bind.patch
@@ -0,0 +1,117 @@
+From 92875f5cc44914515e50c11c503a09cec90497b2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 11 Jun 2016 22:51:44 -0400
+Subject: [PATCH 08/11] tweak to support external bind
+
+Tweak the external bind to oe-core's sysroot rather than
+external bind source build.
+
+Upstream-Status: Inappropriate <oe-core specific>
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/Makefile.am | 2 +-
+ client/tests/Makefile.am | 2 +-
+ common/tests/Makefile.am | 2 +-
+ dhcpctl/Makefile.am | 2 +-
+ omapip/Makefile.am | 2 +-
+ relay/Makefile.am | 2 +-
+ server/Makefile.am | 2 +-
+ server/tests/Makefile.am | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+index 4730bb3..84d8131 100644
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -4,7 +4,7 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+ -DLOCALSTATEDIR='"$(localstatedir)"' -I$(top_srcdir)/includes
+diff --git a/client/tests/Makefile.am b/client/tests/Makefile.am
+index 5031d0c..a8dfd26 100644
+--- a/client/tests/Makefile.am
++++ b/client/tests/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = .
+
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
+ AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
+diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
+index f6a43e4..2f98d22 100644
+--- a/common/tests/Makefile.am
++++ b/common/tests/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = .
+
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = $(ATF_CFLAGS) -I$(top_srcdir)/includes
+
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+index ba8dd8b..9b2486e 100644
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -1,4 +1,4 @@
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
+
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+index dd1afa0..e4a8599 100644
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -1,4 +1,4 @@
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+ AM_CPPFLAGS = -I$(top_srcdir)/includes
+
+ lib_LIBRARIES = libomapi.a
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+index 6d652f6..b3bf578 100644
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -1,4 +1,4 @@
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+
+diff --git a/server/Makefile.am b/server/Makefile.am
+index 3990b9c..b5d8c2d 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -4,7 +4,7 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+
+diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
+index a87c5e7..9821081 100644
+--- a/server/tests/Makefile.am
++++ b/server/tests/Makefile.am
+@@ -1,6 +1,6 @@
+ SUBDIRS = .
+
+-BINDLIBDIR = @BINDDIR@/lib
++BINDLIBDIR = @BINDDIR@
+
+ AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
+ AM_CPPFLAGS += -I@BINDDIR@/include -I$(top_srcdir)
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch
new file mode 100644
index 000000000..912b6d631
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0009-remove-dhclient-script-bash-dependency.patch
@@ -0,0 +1,28 @@
+From f3f8b7726e50e24ef3edf5fa5a17e31d39118d7e Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 15 Aug 2017 15:49:31 +0800
+Subject: [PATCH 09/11] remove dhclient-script bash dependency
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+Rebase to 4.3.6
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+index 3122a75..1712d7d 100755
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # dhclient-script for Linux. Dan Halbert, March, 1997.
+ # Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
+ # No guarantees about this. I'm a novice at the details of Linux
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0010-build-shared-libs.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0010-build-shared-libs.patch
new file mode 100644
index 000000000..f128731c6
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0010-build-shared-libs.patch
@@ -0,0 +1,208 @@
+From 76c370a929e5ab5dbc81c2fbcf4e50f4fbc08ce9 Mon Sep 17 00:00:00 2001
+From: Kai Kang <kai.kang@windriver.com>
+Date: Tue, 15 Aug 2017 15:53:37 +0800
+Subject: [PATCH 10/11] build shared libs
+
+Upstream-Status: Pending
+
+Port patches from Fedora to build shared libs rather than static libs.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Rebase to 4.3.6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/Makefile.am | 4 ++--
+ common/tests/Makefile.am | 13 +++++--------
+ configure.ac | 12 ++----------
+ dhcpctl/Makefile.am | 14 ++++++--------
+ omapip/Makefile.am | 7 +++----
+ relay/Makefile.am | 5 ++---
+ server/Makefile.am | 7 +++----
+ server/tests/Makefile.am | 7 +++----
+ 8 files changed, 26 insertions(+), 43 deletions(-)
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+index 84d8131..e776bf0 100644
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -15,7 +15,7 @@ dhclient_SOURCES = $(srcdir)/clparse.c $(srcdir)/dhclient.c $(srcdir)/dhc6.c \
+ scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
+ scripts/netbsd scripts/nextstep scripts/openbsd \
+ scripts/solaris scripts/openwrt
+-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
++ -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff --git a/common/tests/Makefile.am b/common/tests/Makefile.am
+index 2f98d22..8745e88 100644
+--- a/common/tests/Makefile.am
++++ b/common/tests/Makefile.am
+@@ -15,26 +15,23 @@ ATF_TESTS += alloc_unittest dns_unittest misc_unittest ns_name_unittest
+ alloc_unittest_SOURCES = test_alloc.c $(top_srcdir)/tests/t_api_dhcp.c
+ alloc_unittest_LDADD = $(ATF_LDFLAGS)
+ alloc_unittest_LDADD += ../libdhcp.a \
+- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++ ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc
+
+ dns_unittest_SOURCES = dns_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
+ dns_unittest_LDADD = $(ATF_LDFLAGS)
+ dns_unittest_LDADD += ../libdhcp.a \
+- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++ ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc
+
+ misc_unittest_SOURCES = misc_unittest.c $(top_srcdir)/tests/t_api_dhcp.c
+ misc_unittest_LDADD = $(ATF_LDFLAGS)
+ misc_unittest_LDADD += ../libdhcp.a \
+- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++ ../../omapip/libomapi.la -L$(BINDLIBDIR) -ldns -lisccfg -lisc
+
+ ns_name_unittest_SOURCES = ns_name_test.c $(top_srcdir)/tests/t_api_dhcp.c
+ ns_name_unittest_LDADD = $(ATF_LDFLAGS)
+ ns_name_unittest_LDADD += ../libdhcp.a \
+- ../../omapip/libomapi.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++ ../../omapip/libomapi.a -L$(BINDLIBDIR) \
++ -ldns -lisccfg -lisc
+
+ check: $(ATF_TESTS)
+ @if test $(top_srcdir) != ${top_builddir}; then \
+diff --git a/configure.ac b/configure.ac
+index 8e9f509..bfe988a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -47,16 +47,8 @@ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
+ # Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+ AC_USE_SYSTEM_EXTENSIONS
+
+-AC_PROG_RANLIB
+-
+-AC_PATH_PROG(AR, ar)
+-AC_SUBST(AR)
+-
+-if test "X$AR" = "X"; then
+- AC_MSG_ERROR([
+-ar program not found. Please fix your PATH to include the directory in
+-which ar resides, or set AR in the environment with the full path to ar.])
+-fi
++# Use libtool to simplify building of shared libraries
++AC_PROG_LIBTOOL
+
+ AC_CONFIG_HEADERS([includes/config.h])
+
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+index 9b2486e..784cdf7 100644
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -3,19 +3,17 @@ BINDLIBDIR = @BINDDIR@
+ AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
+
+ bin_PROGRAMS = omshell
+-lib_LIBRARIES = libdhcpctl.a
++lib_LTLIBRARIES = libdhcpctl.la
+ noinst_PROGRAMS = cltest
+ man_MANS = omshell.1 dhcpctl.3
+ EXTRA_DIST = $(man_MANS)
+
+ omshell_SOURCES = omshell.c
+-omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
+- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++omshell_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \
++ -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+
+-libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
++libdhcpctl_la_SOURCES = dhcpctl.c callback.c remote.c
+
+ cltest_SOURCES = cltest.c
+-cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
+- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++cltest_LDADD = libdhcpctl.la ../common/libdhcp.a ../omapip/libomapi.la \
++ -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+index e4a8599..c0c7a1e 100644
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -1,10 +1,10 @@
+ BINDLIBDIR = @BINDDIR@
+ AM_CPPFLAGS = -I$(top_srcdir)/includes
+
+-lib_LIBRARIES = libomapi.a
++lib_LTLIBRARIES = libomapi.la
+ noinst_PROGRAMS = svtest
+
+-libomapi_a_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
++libomapi_la_SOURCES = protocol.c buffer.c alloc.c result.c connection.c \
+ errwarn.c listener.c dispatch.c generic.c support.c \
+ handle.c message.c convert.c hash.c auth.c inet_addr.c \
+ array.c trace.c toisc.c iscprint.c isclib.c
+@@ -13,6 +13,5 @@ man_MANS = omapi.3
+ EXTRA_DIST = $(man_MANS)
+
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
+- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++svtest_LDADD = libomapi.la -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+index b3bf578..f47009f 100644
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -4,9 +4,8 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+-dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+- $(BINDLIBDIR)/libirs.a $(BINDLIBDIR)/libdns.a \
+- $(BINDLIBDIR)/libisccfg.a $(BINDLIBDIR)/libisc.a
++dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
++ -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+ man_MANS = dhcrelay.8
+ EXTRA_DIST = $(man_MANS)
+
+diff --git a/server/Makefile.am b/server/Makefile.am
+index b5d8c2d..d7f876d 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -15,10 +15,9 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c confpars.c db.c class.c failover.c \
+ dhcpv6.c mdb6.c ldap.c ldap_casa.c leasechain.c ldap_krb_helper.c
+
+ dhcpd_CFLAGS = $(LDAP_CFLAGS)
+-dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+- ../dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
+- $(BINDLIBDIR)/libisc.a $(LDAP_LIBS)
++dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.la \
++ ../dhcpctl/libdhcpctl.la -L$(BINDLIBDIR) \
++ -lirs -ldns -lisccfg -lisc $(LDAP_LIBS)
+
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
+diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
+index 9821081..de95872 100644
+--- a/server/tests/Makefile.am
++++ b/server/tests/Makefile.am
+@@ -19,10 +19,9 @@ DHCPSRC = ../dhcp.c ../bootp.c ../confpars.c ../db.c ../class.c \
+ ../ddns.c ../dhcpleasequery.c ../dhcpv6.c ../mdb6.c \
+ ../ldap.c ../ldap_casa.c ../dhcpd.c ../leasechain.c
+
+-DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.a \
+- $(top_builddir)/dhcpctl/libdhcpctl.a $(BINDLIBDIR)/libirs.a \
+- $(BINDLIBDIR)/libdns.a $(BINDLIBDIR)/libisccfg.a \
+- $(BINDLIBDIR)/libisc.a
++DHCPLIBS = $(top_builddir)/common/libdhcp.a $(top_builddir)/omapip/libomapi.la \
++ $(top_builddir)/dhcpctl/libdhcpctl.la \
++ -L$(BINDLIBDIR) -lirs -ldns -lisccfg -lisc
+
+ ATF_TESTS =
+ if HAVE_ATF
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch
new file mode 100644
index 000000000..67bb4631a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch
@@ -0,0 +1,81 @@
+From 37725f3e22edb50e0ca2d1fff971321a5a4d5112 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 12 Jul 2017 03:05:13 -0400
+Subject: [PATCH 11/11] Moved the call to isc_app_ctxstart() to not get signal
+ block by all threads
+
+Signed-off-by: Francis Dupont <fdupont@isc.org>
+
+In https://source.isc.org/git/bind9.git, since the following
+commit applied:
+...
+commit b99bfa184bc9375421b5df915eea7dfac6a68a99
+Author: Evan Hunt <each@isc.org>
+Date: Wed Apr 10 13:49:57 2013 -0700
+
+ [master] unify internal and export libraries
+
+ 3550. [func] Unified the internal and export versions of the
+ BIND libraries, allowing external clients to use
+ the same libraries as BIND. [RT #33131]
+...
+(git show b99bfa184bc9375421b5df915eea7dfac6a68a99 -- ./lib/isc/unix/app.c)
+
+In this commit, if bind9 enable threads(ISC_PLATFORM_USETHREADS),
+it blocks signal SIGHUP, SIGINT and SIGTERM in isc__app_ctxstart.
+Which caused dhclient/dhcpd could not be stopped by SIGTERM.
+
+It caused systemd's reboot hung which send SIGTERM by default.
+
+Upstream-Status: Backport [https://source.isc.org/git/dhcp.git]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ omapip/isclib.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/omapip/isclib.c b/omapip/isclib.c
+index ce86490..6a04345 100644
+--- a/omapip/isclib.c
++++ b/omapip/isclib.c
+@@ -185,16 +185,6 @@ dhcp_context_create(int flags,
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
+
+- result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
+- if (result != ISC_R_SUCCESS)
+- return (result);
+- dhcp_gbl_ctx.actx_started = ISC_TRUE;
+-
+- /* Not all OSs support suppressing SIGPIPE through socket
+- * options, so set the sigal action to be ignore. This allows
+- * broken connections to fail gracefully with EPIPE on writes */
+- handle_signal(SIGPIPE, SIG_IGN);
+-
+ result = isc_taskmgr_createinctx(dhcp_gbl_ctx.mctx,
+ dhcp_gbl_ctx.actx,
+ 1, 0,
+@@ -217,6 +207,21 @@ dhcp_context_create(int flags,
+ result = isc_task_create(dhcp_gbl_ctx.taskmgr, 0, &dhcp_gbl_ctx.task);
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
++
++ result = isc_app_ctxstart(dhcp_gbl_ctx.actx);
++ if (result != ISC_R_SUCCESS)
++ return (result);
++ dhcp_gbl_ctx.actx_started = ISC_TRUE;
++
++ /* Not all OSs support suppressing SIGPIPE through socket
++ * options, so set the sigal action to be ignore. This allows
++ * broken connections to fail gracefully with EPIPE on writes */
++ handle_signal(SIGPIPE, SIG_IGN);
++
++ /* Reset handlers installed by isc_app_ctxstart()
++ * to default for control-c and kill */
++ handle_signal(SIGINT, SIG_DFL);
++ handle_signal(SIGTERM, SIG_DFL);
+ }
+
+ #if defined (NSUPDATE)
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch
new file mode 100644
index 000000000..2d3af9db0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/0012-dhcp-correct-the-intention-for-xml2-lib-search.patch
@@ -0,0 +1,37 @@
+From 501543b3ef715488a142e3d301ff2733aa33eec7 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Wed, 25 Oct 2017 21:00:05 +0500
+Subject: [PATCH] dhcp: correct the intention for xml2 lib search
+
+A missing case breaks the build when libxml2 is
+required and found appropriately. The third argument
+to the function AC_SEARCH_LIB is action-if-found which
+was mistakenly been used for the case where the library
+is not found and hence breaks the configure phase
+where it shoud actually pass.
+We now pass on silently when action-if-found is
+executed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bfe988a..f0459e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -608,7 +608,7 @@ AC_ARG_WITH(libxml2,
+ with_libxml2="$withval", with_libxml2="no")
+
+ if test x$with_libxml2 != xno; then
+- AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],
++ AC_SEARCH_LIBS(xmlTextWriterStartElement, [xml2],,
+ [if test x$with_libxml2 != xauto; then
+ AC_MSG_FAILURE([*** Cannot find xmlTextWriterStartElement with -lxml2 and libxml2 was requested])
+ fi])
+--
+2.11.1
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2017-3144.patch b/poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2017-3144.patch
new file mode 100644
index 000000000..2b2688cb2
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp/CVE-2017-3144.patch
@@ -0,0 +1,74 @@
+From 8cfdedee369c26d2869b6ec4a64460b5f5a30934 Mon Sep 17 00:00:00 2001
+From: Thomas Markwalder <tmark@isc.org>
+Date: Thu, 7 Dec 2017 11:39:30 -0500
+Subject: [PATCH] [v4_3] Plugs a socket descriptor leak in OMAPI
+
+ Merges in rt46767.
+
+Upstream-Status: Backport
+[https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=commitdiff;h=5097bc0559f592683faac1f67bf350e1bddf6ed4]
+
+CVE: CVE-2017-3144
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ RELNOTES | 7 +++++++
+ omapip/buffer.c | 9 +++++++++
+ omapip/message.c | 2 +-
+ 3 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/RELNOTES b/RELNOTES
+index dd40aaf..3741b80 100644
+--- a/RELNOTES
++++ b/RELNOTES
+@@ -66,6 +66,13 @@ We welcome comments from DHCP users, about this or anything else we do.
+ Email Vicky Risk, Product Manager at vicky@isc.org or discuss on
+ dhcp-users@lists.isc.org.
+
++- Plugged a socket descriptor leak in OMAPI, that can occur when there is
++ data pending to be written to an OMAPI connection, when the connection
++ is closed by the reader. Thanks to Pavel Zhukov at RedHat for bringing
++ this issue to our attention and whose patch helped guide us in the right
++ direction.
++ [ISc-Bugs #46767]
++
+ Changes since 4.3.6b1
+
+ - None
+diff --git a/omapip/buffer.c b/omapip/buffer.c
+index f7fdc32..809034d 100644
+--- a/omapip/buffer.c
++++ b/omapip/buffer.c
+@@ -566,6 +566,15 @@ isc_result_t omapi_connection_writer (omapi_object_t *h)
+ omapi_buffer_dereference (&buffer, MDL);
+ }
+ }
++
++ /* If we had data left to write when we're told to disconnect,
++ * we need recall disconnect, now that we're done writing.
++ * See rt46767. */
++ if (c->out_bytes == 0 && c->state == omapi_connection_disconnecting) {
++ omapi_disconnect (h, 1);
++ return ISC_R_SHUTTINGDOWN;
++ }
++
+ return ISC_R_SUCCESS;
+ }
+
+diff --git a/omapip/message.c b/omapip/message.c
+index 59ccdc2..21bcfc3 100644
+--- a/omapip/message.c
++++ b/omapip/message.c
+@@ -339,7 +339,7 @@ isc_result_t omapi_message_unregister (omapi_object_t *mo)
+ }
+
+ #ifdef DEBUG_PROTOCOL
+-static const char *omapi_message_op_name(int op) {
++const char *omapi_message_op_name(int op) {
+ switch (op) {
+ case OMAPI_OP_OPEN: return "OMAPI_OP_OPEN";
+ case OMAPI_OP_REFRESH: return "OMAPI_OP_REFRESH";
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/dhcp/dhcp_4.3.6.bb b/poky/meta/recipes-connectivity/dhcp/dhcp_4.3.6.bb
new file mode 100644
index 000000000..cc135493e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/dhcp_4.3.6.bb
@@ -0,0 +1,22 @@
+require dhcp.inc
+
+SRC_URI += "file://0001-define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
+ file://0002-dhclient-dbus.patch \
+ file://0003-link-with-lcrypto.patch \
+ file://0004-Fix-out-of-tree-builds.patch \
+ file://0005-dhcp-client-fix-invoke-dhclient-script-failed-on-Rea.patch \
+ file://0006-site.h-enable-gentle-shutdown.patch \
+ file://0007-Add-configure-argument-to-make-the-libxml2-dependenc.patch \
+ file://0008-tweak-to-support-external-bind.patch \
+ file://0009-remove-dhclient-script-bash-dependency.patch \
+ file://0010-build-shared-libs.patch \
+ file://0011-Moved-the-call-to-isc_app_ctxstart-to-not-get-signal.patch \
+ file://0012-dhcp-correct-the-intention-for-xml2-lib-search.patch \
+ file://CVE-2017-3144.patch \
+ "
+
+SRC_URI[md5sum] = "afa6e9b3eb7539ea048421a82c668adc"
+SRC_URI[sha256sum] = "a41eaf6364f1377fe065d35671d9cf82bbbc8f21207819b2b9f33f652aec6f1b"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[bind-httpstats] = "--with-libxml2,--without-libxml2,libxml2"
diff --git a/poky/meta/recipes-connectivity/dhcp/files/default-relay b/poky/meta/recipes-connectivity/dhcp/files/default-relay
new file mode 100644
index 000000000..7961f014b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/default-relay
@@ -0,0 +1,12 @@
+# Defaults for dhcp-relay initscript
+# sourced by /etc/init.d/dhcp-relay
+
+# What servers should the DHCP relay forward requests to?
+# e.g: SERVERS="192.168.0.1"
+SERVERS=""
+
+# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
+INTERFACES=""
+
+# Additional options that are passed to the DHCP relay daemon?
+OPTIONS=""
diff --git a/poky/meta/recipes-connectivity/dhcp/files/default-server b/poky/meta/recipes-connectivity/dhcp/files/default-server
new file mode 100644
index 000000000..0385d1699
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/default-server
@@ -0,0 +1,7 @@
+# Defaults for dhcp initscript
+# sourced by /etc/init.d/dhcp-server
+# installed at /etc/default/dhcp-server by the maintainer scripts
+
+# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
+# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
+INTERFACES=""
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper b/poky/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
new file mode 100644
index 000000000..7d0e224a1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhclient-systemd-wrapper
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# In case the interface is used for nfs, skip it.
+nfsroot=0
+interfaces=""
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+exec 0<&9 9<&-
+
+if [ $nfsroot -eq 0 ]; then
+ interfaces="$INTERFACES"
+else
+ if [ -x /bin/ip -o -x /sbin/ip ] ; then
+ nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
+ fi
+ for i in $INTERFACES; do
+ if test "x$i" = "x$nfs_iface"; then
+ echo "dhclient skipping nfsroot interface $i"
+ else
+ interfaces="$interfaces $i"
+ fi
+ done
+fi
+
+if test "x$interfaces" != "x"; then
+ /sbin/dhclient -d -cf /etc/dhcp/dhclient.conf -q -lf /var/lib/dhcp/dhclient.leases $interfaces
+fi
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhclient.conf b/poky/meta/recipes-connectivity/dhcp/files/dhclient.conf
new file mode 100644
index 000000000..0e6dcf96c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhclient.conf
@@ -0,0 +1,50 @@
+# Configuration file for /sbin/dhclient, which is included in Debian's
+# dhcp3-client package.
+#
+# This is a sample configuration file for dhclient. See dhclient.conf's
+# man page for more information about the syntax of this file
+# and a more comprehensive list of the parameters understood by
+# dhclient.
+#
+# Normally, if the DHCP server provides reasonable information and does
+# not leave anything out (like the domain name, for example), then
+# few changes must be made to this file, if any.
+#
+
+#send host-name "andare.fugue.com";
+#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
+#send dhcp-lease-time 3600;
+#supersede domain-name "fugue.com home.vix.com";
+#prepend domain-name-servers 127.0.0.1;
+request subnet-mask, broadcast-address, time-offset, routers,
+ domain-name, domain-name-servers, host-name,
+ netbios-name-servers, netbios-scope;
+#require subnet-mask, domain-name-servers;
+#timeout 60;
+#retry 60;
+#reboot 10;
+#select-timeout 5;
+#initial-interval 2;
+#script "/etc/dhcp3/dhclient-script";
+#media "-link0 -link1 -link2", "link0 link1";
+#reject 192.33.137.209;
+
+#alias {
+# interface "eth0";
+# fixed-address 192.5.5.213;
+# option subnet-mask 255.255.255.255;
+#}
+
+#lease {
+# interface "eth0";
+# fixed-address 192.33.137.200;
+# medium "link0 link1";
+# option host-name "andare.swiftmedia.com";
+# option subnet-mask 255.255.255.0;
+# option broadcast-address 192.33.137.255;
+# option routers 192.33.137.250;
+# option domain-name-servers 127.0.0.1;
+# renew 2 2000/1/12 00:00:01;
+# rebind 2 2000/1/12 00:00:01;
+# expire 2 2000/1/12 00:00:01;
+#}
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhclient.service b/poky/meta/recipes-connectivity/dhcp/files/dhclient.service
new file mode 100644
index 000000000..9ddb4d1df
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhclient.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Dynamic Host Configuration Protocol (DHCP)
+Wants=network.target
+Before=network.target
+After=systemd-udevd.service
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/dhcp-client
+ExecStart=@BASE_SBINDIR@/dhclient-systemd-wrapper
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf b/poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf
new file mode 100644
index 000000000..0001c0f00
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhcpd.conf
@@ -0,0 +1,108 @@
+#
+# Sample configuration file for ISC dhcpd for Debian
+#
+# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
+#
+
+# The ddns-updates-style parameter controls whether or not the server will
+# attempt to do a DNS update when a lease is confirmed. We default to the
+# behavior of the version 2 packages ('none', since DHCP v2 didn't
+# have support for DDNS.)
+ddns-update-style none;
+
+# option definitions common to all supported networks...
+option domain-name "example.org";
+option domain-name-servers ns1.example.org, ns2.example.org;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+#authoritative;
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
+# No service will be given on this subnet, but declaring it helps the
+# DHCP server to understand the network topology.
+
+#subnet 10.152.187.0 netmask 255.255.255.0 {
+#}
+
+# This is a very basic subnet declaration.
+
+#subnet 10.254.239.0 netmask 255.255.255.224 {
+# range 10.254.239.10 10.254.239.20;
+# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
+#}
+
+# This declaration allows BOOTP clients to get dynamic addresses,
+# which we don't really recommend.
+
+#subnet 10.254.239.32 netmask 255.255.255.224 {
+# range dynamic-bootp 10.254.239.40 10.254.239.60;
+# option broadcast-address 10.254.239.31;
+# option routers rtr-239-32-1.example.org;
+#}
+
+# A slightly different configuration for an internal subnet.
+#subnet 10.5.5.0 netmask 255.255.255.224 {
+# range 10.5.5.26 10.5.5.30;
+# option domain-name-servers ns1.internal.example.org;
+# option domain-name "internal.example.org";
+# option routers 10.5.5.1;
+# option broadcast-address 10.5.5.31;
+# default-lease-time 600;
+# max-lease-time 7200;
+#}
+
+# Hosts which require special configuration options can be listed in
+# host statements. If no address is specified, the address will be
+# allocated dynamically (if possible), but the host-specific information
+# will still come from the host declaration.
+
+#host passacaglia {
+# hardware ethernet 0:0:c0:5d:bd:95;
+# filename "vmunix.passacaglia";
+# server-name "toccata.fugue.com";
+#}
+
+# Fixed IP addresses can also be specified for hosts. These addresses
+# should not also be listed as being available for dynamic assignment.
+# Hosts for which fixed IP addresses have been specified can boot using
+# BOOTP or DHCP. Hosts for which no fixed address is specified can only
+# be booted with DHCP, unless there is an address range on the subnet
+# to which a BOOTP client is connected which has the dynamic-bootp flag
+# set.
+#host fantasia {
+# hardware ethernet 08:00:07:26:c0:a5;
+# fixed-address fantasia.fugue.com;
+#}
+
+# You can declare a class of clients and then do address allocation
+# based on that. The example below shows a case where all clients
+# in a certain class get addresses on the 10.17.224/24 subnet, and all
+# other clients get addresses on the 10.0.29/24 subnet.
+
+#class "foo" {
+# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
+#}
+
+#shared-network 224-29 {
+# subnet 10.17.224.0 netmask 255.255.255.0 {
+# option routers rtr-224.example.org;
+# }
+# subnet 10.0.29.0 netmask 255.255.255.0 {
+# option routers rtr-29.example.org;
+# }
+# pool {
+# allow members of "foo";
+# range 10.17.224.10 10.17.224.250;
+# }
+# pool {
+# deny members of "foo";
+# range 10.0.29.10 10.0.29.230;
+# }
+#}
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhcpd.service b/poky/meta/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 000000000..ae4f93eca
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhcpd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv4 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=@localstatedir@/run/dhcpd.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
+ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service b/poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service
new file mode 100644
index 000000000..ca96abb83
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhcpd6.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv6 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=@localstatedir@/run/dhcpd6.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases
+ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 000000000..15ff927d3
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-relay
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid -q $SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/dhcp/files/init-relay b/poky/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 000000000..019a7e84c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/init-relay
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
+#
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-relay ]; then
+ echo "/etc/default/dhcp-relay does not exist! - Aborting..."
+ echo "create this file to fix the problem."
+ exit 1
+fi
+
+# Read init script configuration (interfaces the daemon should listen on
+# and the DHCP server we should forward requests to.)
+. /etc/default/dhcp-relay
+
+# Build command line for interfaces (will be passed to dhrelay below.)
+IFCMD=""
+if test "$INTERFACES" != ""; then
+ for I in $INTERFACES; do
+ IFCMD=${IFCMD}"-i "${I}" "
+ done
+fi
+
+DHCRELAYPID=/var/run/dhcrelay.pid
+
+case "$1" in
+ start)
+ start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
+ ;;
+ stop)
+ start-stop-daemon -K -x /usr/sbin/dhcrelay
+ ;;
+ restart | force-reload)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/dhcp/files/init-server b/poky/meta/recipes-connectivity/dhcp/files/init-server
new file mode 100644
index 000000000..5e693adf7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/dhcp/files/init-server
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
+#
+
+test -f /usr/sbin/dhcpd || exit 0
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-server ]; then
+ echo "/etc/default/dhcp-server does not exist! - Aborting..."
+ exit 0
+fi
+
+# Read init script configuration (so far only interfaces the daemon
+# should listen on.)
+. /etc/default/dhcp-server
+
+case "$1" in
+ start)
+ echo -n "Starting DHCP server: "
+ test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
+ test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
+ start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES -user dhcp -group dhcp
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping DHCP server: dhcpd3"
+ start-stop-daemon -K -x /usr/sbin/dhcpd
+ echo "."
+ ;;
+ restart | force-reload)
+ $0 stop
+ sleep 2
+ $0 start
+ if [ "$?" != "0" ]; then
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2.inc b/poky/meta/recipes-connectivity/iproute2/iproute2.inc
new file mode 100644
index 000000000..4fbfec6f0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -0,0 +1,54 @@
+SUMMARY = "TCP / IP networking and traffic control utilities"
+DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
+TCP / IP networking and traffic control in Linux. Of the utilities ip \
+and tc are the most important. ip controls IPv4 and IPv6 \
+configuration and tc stands for traffic control."
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817"
+
+DEPENDS = "flex-native bison-native iptables elfutils"
+
+inherit update-alternatives bash-completion pkgconfig
+
+CLEANBROKEN = "1"
+
+PACKAGECONFIG ??= "tipc"
+PACKAGECONFIG[tipc] = ",,libmnl,"
+
+EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
+
+do_configure_append () {
+ sh configure ${STAGING_INCDIR}
+ # Explicitly disable ATM support
+ sed -i -e '/TC_CONFIG_ATM/d' config.mk
+}
+
+do_install () {
+ oe_runmake DESTDIR=${D} install
+ mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
+ install -d ${D}${datadir}
+ mv ${D}/share/* ${D}${datadir}/ || true
+ rm ${D}/share -rf || true
+}
+
+# The .so files in iproute2-tc are modules, not traditional libraries
+INSANE_SKIP_${PN}-tc = "dev-so"
+
+PACKAGES =+ "${PN}-tc ${PN}-lnstat ${PN}-ifstat ${PN}-genl ${PN}-rtacct ${PN}-nstat ${PN}-ss ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+FILES_${PN}-tc = "${base_sbindir}/tc* \
+ ${libdir}/tc/*.so"
+FILES_${PN}-lnstat = "${base_sbindir}/lnstat ${base_sbindir}/ctstat ${base_sbindir}/rtstat"
+FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
+FILES_${PN}-genl = "${base_sbindir}/genl"
+FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
+FILES_${PN}-nstat = "${base_sbindir}/nstat"
+FILES_${PN}-ss = "${base_sbindir}/ss"
+FILES_${PN}-tipc = "${base_sbindir}/tipc"
+
+ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
+ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2/0001-ip-Remove-unneed-header.patch b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-ip-Remove-unneed-header.patch
new file mode 100644
index 000000000..a9027c5b5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-ip-Remove-unneed-header.patch
@@ -0,0 +1,30 @@
+From 02ed10fc5215c4a32e6740b0a0c2439659be6801 Mon Sep 17 00:00:00 2001
+From: Changhyeok Bae <changhyeok.bae@gmail.com>
+Date: Mon, 13 Nov 2017 15:59:35 +0000
+Subject: [PATCH] ip: Remove unneed header
+
+Fix redefinition of struct ethhdr with a suitably patched musl libc
+that suppresses the kernel if_ether.h.
+
+Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com>
+
+Upstream-Status: Pending [netdev@vger.kernel.org]
+---
+ ip/iplink_bridge.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/ip/iplink_bridge.c b/ip/iplink_bridge.c
+index cccdec1..f065b22 100644
+--- a/ip/iplink_bridge.c
++++ b/ip/iplink_bridge.c
+@@ -13,7 +13,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <netinet/in.h>
+-#include <netinet/ether.h>
+ #include <linux/if_link.h>
+ #include <linux/if_bridge.h>
+ #include <net/if.h>
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
new file mode 100644
index 000000000..c3d3fea9c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
@@ -0,0 +1,63 @@
+Subject: [PATCH] iproute2: de-bash scripts
+
+de-bash these two scripts to make iproute2 not depend on bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ ip/ifcfg | 15 ++++++++-------
+ ip/rtpr | 2 +-
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/ip/ifcfg b/ip/ifcfg
+index 30a2dc4..8677b2e 100644
+--- a/ip/ifcfg
++++ b/ip/ifcfg
+@@ -1,12 +1,13 @@
+-#! /bin/bash
++#! /bin/sh
+
+ CheckForwarding () {
+- local sbase fwd
++ local sbase fwd forwarding
+ sbase=/proc/sys/net/ipv4/conf
+ fwd=0
+ if [ -d $sbase ]; then
+ for dir in $sbase/*/forwarding; do
+- fwd=$[$fwd + `cat $dir`]
++ forwarding=`cat $dir`
++ fwd=$(($fwd+$forwarding))
+ done
+ else
+ fwd=2
+@@ -127,12 +128,12 @@ fi
+ arping -q -A -c 1 -I $dev $ipaddr
+ noarp=$?
+ ( sleep 2 ;
+- arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
++ arping -q -U -c 1 -I $dev $ipaddr ) > /dev/null 2>&1 </dev/null &
+
+-ip route add unreachable 224.0.0.0/24 >& /dev/null
+-ip route add unreachable 255.255.255.255 >& /dev/null
++ip route add unreachable 224.0.0.0/24 > /dev/null 2>&1
++ip route add unreachable 255.255.255.255 > /dev/null 2>&1
+ if [ "`ip link ls $dev | grep -c MULTICAST`" -ge 1 ]; then
+- ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
++ ip route add 224.0.0.0/4 dev $dev scope global > /dev/null 2>&1
+ fi
+
+ if [ $fwd -eq 0 ]; then
+diff --git a/ip/rtpr b/ip/rtpr
+index c3629fd..674198d 100644
+--- a/ip/rtpr
++++ b/ip/rtpr
+@@ -1,4 +1,4 @@
+-#! /bin/bash
++#! /bin/sh
+
+ exec tr "[\\\\]" "[
+ ]"
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch
new file mode 100644
index 000000000..50c4bfb0f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2/0001-libc-compat.h-add-musl-workaround.patch
@@ -0,0 +1,41 @@
+From b7d96340c55afb7023ded0041107c63dbd886196 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Thu, 22 Dec 2016 15:26:30 +0200
+Subject: [PATCH] libc-compat.h: add musl workaround
+
+The libc-compat.h kernel header uses glibc specific macros (__GLIBC__ and
+__USE_MISC) to solve conflicts with libc provided headers. This patch makes
+libc-compat.h work for musl libc as well.
+
+Upstream-Status: Pending
+
+Taken From:
+https://git.buildroot.net/buildroot/tree/package/iproute2/0001-Add-the-musl-workaround-to-the-libc-compat.h-copy.patch
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ include/uapi/linux/libc-compat.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index f38571d..30f0b67 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -49,10 +49,12 @@
+ #define _LIBC_COMPAT_H
+
+ /* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#if 1
++#define __USE_MISC
+
+ /* Coordinate with glibc net/if.h header. */
+ #if defined(_NET_IF_H) && defined(__USE_MISC)
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
+ /* GLIBC headers included first so don't define anything
+ * that would already be defined. */
+--
+2.4.0
+
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
new file mode 100644
index 000000000..8b75a2ada
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
@@ -0,0 +1,32 @@
+From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 3 Nov 2011 10:46:16 +0100
+Subject: [PATCH] make configure cross compile safe
+
+According to Kevin Tian:
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+Index: iproute2-4.14.1/configure
+===================================================================
+--- iproute2-4.14.1.orig/configure
++++ iproute2-4.14.1/configure
+@@ -2,6 +2,7 @@
+ # This is not an autoconf generated configure
+ #
+ INCLUDE=${1:-"$PWD/include"}
++SYSROOT=$1
+
+ # Output file which is input to Makefile
+ CONFIG=config.mk
+@@ -195,7 +196,7 @@ check_ipt_lib_dir()
+ return
+ fi
+
+- for dir in /lib /usr/lib /usr/local/lib
++ for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
+ do
+ for file in $dir/{xtables,iptables}/lib*t_*so ; do
+ if [ -f $file ]; then
diff --git a/poky/meta/recipes-connectivity/iproute2/iproute2_4.14.1.bb b/poky/meta/recipes-connectivity/iproute2/iproute2_4.14.1.bb
new file mode 100644
index 000000000..81e2e4a16
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iproute2/iproute2_4.14.1.bb
@@ -0,0 +1,15 @@
+require iproute2.inc
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
+ file://configure-cross.patch \
+ file://0001-iproute2-de-bash-scripts.patch \
+ file://0001-libc-compat.h-add-musl-workaround.patch \
+ file://0001-ip-Remove-unneed-header.patch \
+ "
+
+SRC_URI[md5sum] = "1075423d7029e02a8f23ed4f42b7e372"
+SRC_URI[sha256sum] = "d43ac068afcc350a448f4581b6e292331ef7e4e7aa746e34981582d5fdb10067"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
diff --git a/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init
new file mode 100755
index 000000000..6f29e9c6e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init
@@ -0,0 +1,78 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: irda
+# Required-Start: $network $remote_fs
+# Required-Stop: $network $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Infrared port support
+### END INIT INFO
+
+NAME="irattach"
+test -x "$IRDA_DAEMON" || IRDA_DAEMON=/usr/sbin/irattach
+test -z "$IRATTACH_PID" && IRATTACH_PID=/var/run/irattach.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+module_id() {
+ awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}
+
+if [ ! -f /etc/sysconfig/irda ]; then
+ case `module_id` in
+ "HP iPAQ H2200" | "HP iPAQ HX4700" | "HTC Universal")
+ IRDA=yes
+ DEVICE=/dev/ttyS2
+ DONGLE=
+ DISCOVERY=
+ ;;
+ *)
+ IRDA=yes
+ DEVICE=/dev/ttyS1
+ DONGLE=
+ DISCOVERY=
+ ;;
+ esac
+else
+ . /etc/sysconfig/irda
+fi
+
+# Check that irda is up.
+[ ${IRDA} = "no" ] && exit 0
+
+[ -f /usr/sbin/irattach ] || exit 0
+
+ARGS=
+if [ $DONGLE ]; then
+ ARGS="$ARGS -d $DONGLE"
+fi
+if [ "$DISCOVERY" = "yes" ];then
+ ARGS="$ARGS -s"
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting IrDA: $NAME"
+ start-stop-daemon --start --quiet --exec "$IRDA_DAEMON" ${DEVICE} ${ARGS} --pidfile "$IRATTACH_PID"
+ sleep 1
+ [ -f /var/run/irattach.pid ] && echo " done" || echo " fail"
+ ;;
+ stop)
+ echo "Stopping IrDA: $NAME"
+ start-stop-daemon --stop --quiet --exec "$IRDA_DAEMON" --pidfile "$IRATTACH_PID"
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ status)
+ status irattach
+ exit $?
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
diff --git a/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
new file mode 100644
index 000000000..b246de8f5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
@@ -0,0 +1,87 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+Index: irda-utils-0.9.18/findchip/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/findchip/Makefile
++++ irda-utils-0.9.18/findchip/Makefile
+@@ -65,5 +65,5 @@ install: findchip
+
+ gfindchip: gfindchip.c
+ $(prn_cc)
+- $(ECMD))$(CC) $(CFLAGS) `gtk-config --cflags` $< -o $@ `gtk-config --libs`
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `gtk-config --cflags` $< -o $@ `gtk-config --libs`
+
+Index: irda-utils-0.9.18/irattach/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/irattach/Makefile
++++ irda-utils-0.9.18/irattach/Makefile
+@@ -49,13 +49,13 @@ all: $(TARGETS)
+
+ irattach: irattach.o util.o
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) irattach.o util.o -o $@
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) irattach.o util.o -o $@
+
+
+
+ dongle_attach: dongle_attach.o
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) dongle_attach.o -o $@
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) dongle_attach.o -o $@
+
+
+ install: $(TARGETS)
+Index: irda-utils-0.9.18/irdadump/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/irdadump/Makefile
++++ irda-utils-0.9.18/irdadump/Makefile
+@@ -40,7 +40,7 @@ lib_irdadump.a: $(LIBIRDADUMP_OBJS)
+
+ irdadump: $(IRDADUMP_OBJS) $(LIBIRDADUMP_TARGET)
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) `pkg-config --libs glib-2.0` -o $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET)
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `pkg-config --libs glib-2.0` -o $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET)
+
+
+ .c.o:
+Index: irda-utils-0.9.18/irdaping/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/irdaping/Makefile
++++ irda-utils-0.9.18/irdaping/Makefile
+@@ -56,7 +56,7 @@ all: $(TARGETS)
+
+ irdaping: $(OBJS)
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
+
+
+ .c.o:
+Index: irda-utils-0.9.18/irnetd/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/irnetd/Makefile
++++ irda-utils-0.9.18/irnetd/Makefile
+@@ -50,7 +50,7 @@ all: $(TARGETS)
+
+ irnetd: $(OBJS)
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
+
+
+ install: irnetd
+Index: irda-utils-0.9.18/psion/Makefile
+===================================================================
+--- irda-utils-0.9.18.orig/psion/Makefile
++++ irda-utils-0.9.18/psion/Makefile
+@@ -25,4 +25,4 @@ install: $(PSION_TARGETS)
+ CFLAGS += -g -I../include -Wall -Wstrict-prototypes $(RPM_OPT_FLAGS)
+ irpsion5:
+ $(prn_cc_o)
+- $(ECMD)$(CC) $(CFLAGS) $(PSION_SRC) -o $@
+\ No newline at end of file
++ $(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(PSION_SRC) -o $@
+\ No newline at end of file
diff --git a/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch
new file mode 100644
index 000000000..97eb97502
--- /dev/null
+++ b/poky/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/musl.patch
@@ -0,0 +1,29 @@
+Replace use of <net/if_packet.h> with <linux/if_packet.h>.
+
+kernel headers <linux/if_packet.h> already provides the
+needed definitions, moreover not all libc implementations
+provide if_packet.h e.g. musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: irda-utils-0.9.18/irdaping/irdaping.c
+===================================================================
+--- irda-utils-0.9.18.orig/irdaping/irdaping.c
++++ irda-utils-0.9.18/irdaping/irdaping.c
+@@ -33,7 +33,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h> /* For struct ifreq */
+-#include <net/if_packet.h> /* For struct sockaddr_pkt */
+ #include <net/if_arp.h> /* For ARPHRD_IRDA */
+ #include <netinet/if_ether.h> /* For ETH_P_ALL */
+ #include <netinet/in.h> /* For htons */
+@@ -46,6 +45,7 @@
+ #include <asm/byteorder.h> /* __cpu_to_le32 and co. */
+
+ #include <linux/types.h> /* For __u8 and co. */
++#include <linux/if_packet.h> /* For struct sockaddr_pkt */
+ #include <irda.h>
+
+ #ifndef AF_IRDA
diff --git a/poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb b/poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb
new file mode 100644
index 000000000..11b2ee911
--- /dev/null
+++ b/poky/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Common files for IrDA"
+DESCRIPTION = "Provides common files needed to use IrDA. \
+IrDA allows communication over Infrared with other devices \
+such as phones and laptops."
+HOMEPAGE = "http://irda.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/p/irda/bugs/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://irdadump/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://smcinit/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://man/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://irdadump/irdadump.c;beginline=1;endline=24;md5=d78b9dce3cd78c2220250c9c7a2be178"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/irda/irda-utils-${PV}.tar.gz \
+ file://ldflags.patch \
+ file://musl.patch \
+ file://init"
+
+SRC_URI[md5sum] = "84dc12aa4c3f61fccb8d8919bf4079bb"
+SRC_URI[sha256sum] = "61980551e46b2eaa9e17ad31cbc1a638074611fc33bff34163d10c7a67a9fdc6"
+
+inherit update-rc.d
+
+EXTRA_OEMAKE = "\
+ 'CC=${CC}' \
+ 'LD=${LD}' \
+ 'CFLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+ 'SYS_INCLUDES=' \
+ 'V=1' \
+"
+
+INITSCRIPT_NAME = "irattach"
+INITSCRIPT_PARAMS = "defaults 20"
+
+TARGETS ??= "irattach irdaping"
+do_compile () {
+ for t in ${TARGETS}; do
+ oe_runmake -C $t
+ done
+}
+
+do_install () {
+ install -d ${D}${sbindir}
+ for t in ${TARGETS}; do
+ oe_runmake -C $t ROOT="${D}" install
+ done
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+}
diff --git a/poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch b/poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
new file mode 100644
index 000000000..715b88d46
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
@@ -0,0 +1,41 @@
+Subject: [PATCH] iw: version.sh: don't use git describe for versioning
+
+It will detect top-level git repositories like the Angstrom setup-scripts and break.
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur iw-4.7-orig/version.sh iw-4.7/version.sh
+--- iw-4.7-orig/version.sh 2016-05-31 12:52:46.000000000 +0300
++++ iw-4.7/version.sh 2016-06-01 11:21:58.307409060 +0300
+@@ -15,27 +15,7 @@
+ SRC_DIR=$(cd ${SRC_DIR}; pwd)
+ cd "${SRC_DIR}"
+
+-v=""
+-if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
+- git update-index --refresh --unmerged > /dev/null
+- descr=$(git describe --match=v* 2>/dev/null)
+- if [ $? -eq 0 ]; then
+- # on git builds check that the version number above
+- # is correct...
+- if [ "${descr%%-*}" = "v$VERSION" ]; then
+- v="${descr#v}"
+- if git diff-index --name-only HEAD | read dummy ; then
+- v="$v"-dirty
+- fi
+- fi
+- fi
+-fi
+-
+-# set to the default version when failed to get the version
+-# information with git
+-if [ -z "${v}" ]; then
+- v="$VERSION"
+-fi
++v="$VERSION"
+
+ echo '#include "iw.h"' > "$OUT"
+ echo "const char iw_version[] = \"$v\";" >> "$OUT"
diff --git a/poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch b/poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch
new file mode 100644
index 000000000..0ea6a5278
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iw/iw/separate-objdir.patch
@@ -0,0 +1,35 @@
+Subject: [PATCH] Support separation of SRCDIR and OBJDIR
+
+Typical use of VPATH to locate the sources.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur iw-4.3-origin/Makefile iw-4.3/Makefile
+--- iw-4.3-origin/Makefile 2015-11-20 16:37:58.752077287 +0200
++++ iw-4.3/Makefile 2015-11-20 16:57:15.510615815 +0200
+@@ -1,5 +1,7 @@
+ MAKEFLAGS += --no-print-directory
+-
++SRCDIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
++OBJDIR ?= $(PWD)
++VPATH = $(SRCDIR)
+ PREFIX ?= /usr
+ SBINDIR ?= $(PREFIX)/sbin
+ MANDIR ?= $(PREFIX)/share/man
+@@ -95,11 +97,11 @@
+ version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) nl80211.h iw.h Makefile \
+ $(wildcard .git/index .git/refs/tags)
+ @$(NQ) ' GEN ' $@
+- $(Q)./version.sh $@
++ $(Q)cd $(SRCDIR) && ./version.sh $(OBJDIR)/$@
+
+ %.o: %.c iw.h nl80211.h
+ @$(NQ) ' CC ' $@
+- $(Q)$(CC) $(CFLAGS) -c -o $@ $<
++ $(Q)$(CC) -I$(SRCDIR) $(CFLAGS) -c -o $@ $<
+
+ ifeq ($(IW_ANDROID_BUILD),)
+ iw: $(OBJS)
diff --git a/poky/meta/recipes-connectivity/iw/iw_4.14.bb b/poky/meta/recipes-connectivity/iw/iw_4.14.bb
new file mode 100644
index 000000000..e1b17de4c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/iw/iw_4.14.bb
@@ -0,0 +1,33 @@
+SUMMARY = "nl80211 based CLI configuration utility for wireless devices"
+DESCRIPTION = "iw is a new nl80211 based CLI configuration utility for \
+wireless devices. It supports almost all new drivers that have been added \
+to the kernel recently. "
+HOMEPAGE = "http://wireless.kernel.org/en/users/Documentation/iw"
+SECTION = "base"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=878618a5c4af25e9b93ef0be1a93f774"
+
+DEPENDS = "libnl"
+
+SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \
+ file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \
+ file://separate-objdir.patch \
+"
+
+SRC_URI[md5sum] = "2067516ca9940fdb8c091ee3250da374"
+SRC_URI[sha256sum] = "a0c3aad6ff52234d03a2522ba2eba570e36abb3e60dc29bf0b1ce88dd725d6d4"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = "\
+ -f '${S}/Makefile' \
+ \
+ 'PREFIX=${prefix}' \
+ 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' \
+"
+B = "${WORKDIR}/build"
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch b/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch
new file mode 100644
index 000000000..f63eb90cd
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns/0001-check-for-nss.h.patch
@@ -0,0 +1,56 @@
+From bdf01a581d58eb5340e9238d143dbcac9db5b11c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 19:29:45 +0000
+Subject: [PATCH] check for nss.h
+
+nss.h may not available on all libc implementations, e.g. musl does not
+have this header, this patch detects nss.h presence and defines the data
+types that are required if nss.h is missing on platform
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 +-
+ src/nss.c | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index aa66bc6..ce19b07 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,7 +71,7 @@ AC_PROG_LIBTOOL
+
+ # Checks for header files.
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h])
++AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h nss.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+diff --git a/src/nss.c b/src/nss.c
+index e48e315..406733b 100644
+--- a/src/nss.c
++++ b/src/nss.c
+@@ -29,7 +29,18 @@
+ #include <assert.h>
+ #include <netdb.h>
+ #include <sys/socket.h>
++#ifdef HAVE_NSS_H
+ #include <nss.h>
++#else
++enum nss_status {
++ NSS_STATUS_TRYAGAIN = -2,
++ NSS_STATUS_UNAVAIL,
++ NSS_STATUS_NOTFOUND,
++ NSS_STATUS_SUCCESS,
++ NSS_STATUS_RETURN
++};
++#endif
++
+ #include <stdio.h>
+ #include <stdlib.h>
+
+--
+2.7.0
+
diff --git a/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb b/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb
new file mode 100644
index 000000000..8d2feec76
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Name Service Switch module for Multicast DNS (zeroconf) name resolution"
+HOMEPAGE = "http://0pointer.de/lennart/projects/nss-mdns/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+DEPENDS = "avahi"
+PR = "r7"
+
+SRC_URI = "http://0pointer.de/lennart/projects/nss-mdns/nss-mdns-${PV}.tar.gz \
+ file://0001-check-for-nss.h.patch \
+ "
+
+SRC_URI[md5sum] = "03938f17646efbb50aa70ba5f99f51d7"
+SRC_URI[sha256sum] = "1e683c2e7c3921814706d62fbbd3e9cbf493a75fa00255e0e715508d8134fa6d"
+
+S = "${WORKDIR}/nss-mdns-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF = "--libdir=${base_libdir} --disable-lynx --enable-avahi"
+
+# suppress warning, but don't bother with autonamer
+LEAD_SONAME = "libnss_mdns.so"
+DEBIANNAME_${PN} = "libnss-mdns"
+
+RDEPENDS_${PN} = "avahi-daemon"
+
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<mdns\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns4_minimal [NOTFOUND=return]\3\4 mdns\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<mdns\>//' \
+ -e '/^hosts:/s/\s*mdns4_minimal\s\+\[NOTFOUND=return\]//' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap.inc b/poky/meta/recipes-connectivity/libpcap/libpcap.inc
new file mode 100644
index 000000000..e57ea87b3
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap.inc
@@ -0,0 +1,42 @@
+SUMMARY = "Interface for user-level network packet capture"
+DESCRIPTION = "Libpcap provides a portable framework for low-level network \
+monitoring. Libpcap can provide network statistics collection, \
+security monitoring and network debugging."
+HOMEPAGE = "http://www.tcpdump.org/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=53067&atid=469577"
+SECTION = "libs/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5eb289217c160e2920d2e35bddc36453 \
+ file://pcap.h;beginline=1;endline=32;md5=39af3510e011f34b8872f120b1dc31d2"
+DEPENDS = "flex-native bison-native"
+
+INC_PR = "r5"
+
+SRC_URI = "http://www.tcpdump.org/release/${BP}.tar.gz"
+
+BINCONFIG = "${bindir}/pcap-config"
+
+inherit autotools binconfig-disabled pkgconfig bluetooth
+
+EXTRA_OECONF = "--with-pcap=linux"
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+# Add a dummy PACKAGECONFIG for bluez5 since it is not supported by libpcap.
+PACKAGECONFIG[bluez5] = ",,"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
+
+CPPFLAGS_prepend = "-I${S} "
+CFLAGS_prepend = "-I${S} "
+CXXFLAGS_prepend = "-I${S} "
+
+do_configure_prepend () {
+ sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch b/poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
new file mode 100644
index 000000000..edb6ae566
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap/0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch
@@ -0,0 +1,41 @@
+From 64aa033a061c43fc15c711f2490ae41d23b868c3 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 17 Nov 2016 09:44:42 -0200
+Subject: [PATCH 1/2] Fix compiler_state_t.ai usage when INET6 is not defined
+Organization: O.S. Systems Software LTDA.
+
+Fix error:
+
+/
+| ../libpcap-1.8.1/gencode.c: In function 'pcap_compile':
+| ../libpcap-1.8.1/gencode.c:693:8: error: 'compiler_state_t
+| {aka struct _compiler_state}' has no member named 'ai'
+| cstate.ai = NULL;
+\
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/the-tcpdump-group/libpcap/pull/541
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ gencode.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gencode.c b/gencode.c
+index a887f27..e103c70 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
+ }
+ initchunks(&cstate);
+ cstate.no_optimize = 0;
++#ifdef INET6
+ cstate.ai = NULL;
++#endif
+ cstate.ic.root = NULL;
+ cstate.ic.cur_mark = 0;
+ cstate.bpf_pcap = p;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch b/poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
new file mode 100644
index 000000000..032b265f0
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap/0002-Add-missing-compiler_state_t-parameter.patch
@@ -0,0 +1,67 @@
+From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 17 Nov 2016 09:47:29 -0200
+Subject: [PATCH 2/2] Add missing compiler_state_t parameter
+Organization: O.S. Systems Software LTDA.
+
+Fix error:
+
+/
+|../libpcap-1.8.1/gencode.c: In function 'gen_gateway':
+|../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared
+| (first use in this function)
+| bpf_error(cstate, "direction applied to 'gateway'");
+\
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/the-tcpdump-group/libpcap/pull/541
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ gencode.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/gencode.c b/gencode.c
+index e103c70..f07c0be 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
+ struct in6_addr *, int, int, int);
+ #endif
+ #ifndef INET6
+-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
++static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
+ #endif
+ static struct block *gen_ipfrag(compiler_state_t *);
+ static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
+@@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
+
+ #ifndef INET6
+ static struct block *
+-gen_gateway(eaddr, alist, proto, dir)
+- const u_char *eaddr;
+- bpf_u_int32 **alist;
+- int proto;
+- int dir;
++gen_gateway(cstate, eaddr, alist, proto, dir)
++ compiler_state_t *cstate;
++ const u_char *eaddr;
++ bpf_u_int32 **alist;
++ int proto;
++ int dir;
+ {
+ struct block *b0, *b1, *tmp;
+
+@@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
+ alist = pcap_nametoaddr(name);
+ if (alist == NULL || *alist == NULL)
+ bpf_error(cstate, "unknown host '%s'", name);
+- b = gen_gateway(eaddr, alist, proto, dir);
++ b = gen_gateway(cstate, eaddr, alist, proto, dir);
+ free(eaddr);
+ return b;
+ #else
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch b/poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
new file mode 100644
index 000000000..7e1eea6b1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap/disable-remote.patch
@@ -0,0 +1,36 @@
+Disable bits of remote capture support inherited from the WinPCAP merge
+which cause applications to FTBFS if they define HAVE_REMOTE.
+
+Patch from:
+https://anonscm.debian.org/cgit/users/rfrancoise/libpcap.git/commit/?
+id=f35949969269dfdcc3549b12fade604755e1e326
+
+Upstream-Status: Pending
+
+--- a/pcap/pcap.h
++++ b/pcap/pcap.h
+@@ -506,6 +506,11 @@
+ #define MODE_STAT 1
+ #define MODE_MON 2
+
++#ifdef HAVE_REMOTE
++ /* Includes most of the public stuff that is needed for the remote capture */
++ #include <remote-ext.h>
++#endif /* HAVE_REMOTE */
++
+ #elif defined(MSDOS)
+
+ /*
+@@ -526,11 +531,6 @@
+
+ #endif /* _WIN32/MSDOS/UN*X */
+
+-#ifdef HAVE_REMOTE
+- /* Includes most of the public stuff that is needed for the remote capture */
+- #include <remote-ext.h>
+-#endif /* HAVE_REMOTE */
+-
+ #ifdef __cplusplus
+ }
+ #endif
+
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch b/poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
new file mode 100644
index 000000000..f40e655c4
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap/fix-grammar-deps.patch
@@ -0,0 +1,29 @@
+Fix a missing dependency that can result in:
+
+../libpcap-1.8.1/grammar.y:78:10: fatal error: scanner.h: No such file or directory
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 0dd90a6bdbce4dca14106859eee63ef643a106e2 Mon Sep 17 00:00:00 2001
+From: Alfredo Alvarez Fernandez <alfredoalvarezernandez@gmail.com>
+Date: Tue, 21 Feb 2017 11:41:43 +0100
+Subject: [PATCH] Makefile.in: Fix missing dependency
+
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 7044f043..f5d443ae 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -465,7 +465,7 @@ grammar.h: grammar.c
+ $(MAKE) $(MAKEFLAGS) grammar.c; \
+ fi
+
+-grammar.o: grammar.c
++grammar.o: grammar.c scanner.h
+ $(CC) $(FULL_CFLAGS) -c grammar.c
+
+ gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch b/poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
new file mode 100644
index 000000000..afaa3bea9
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
@@ -0,0 +1,73 @@
+From 2796129af52901dd68595e5e88a639308541def9 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 3 Nov 2016 17:56:29 -0200
+Subject: [PATCH] libpcap: pkgconfig support
+Organization: O.S. Systems Software LTDA.
+
+Adding basic structure to support pkg-config.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ Makefile.in | 5 +++++
+ configure.ac | 1 +
+ libpcap.pc.in | 10 ++++++++++
+ 3 files changed, 16 insertions(+)
+ create mode 100644 libpcap.pc.in
+
+diff --git a/Makefile.in b/Makefile.in
+index e71d973..d7004ed 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -61,6 +61,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
+ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
+ PROG=libpcap
+
++# pkgconfig support
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libpcap.pc
++
+ # Standard CFLAGS
+ FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
+
+@@ -286,6 +290,7 @@ EXTRA_DIST = \
+ lbl/os-solaris2.h \
+ lbl/os-sunos4.h \
+ lbl/os-ultrix4.h \
++ libpcap.pc \
+ missing/getopt.c \
+ missing/getopt.h \
+ missing/snprintf.c \
+diff --git a/configure.ac b/configure.ac
+index da2f940..4fc67bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1805,6 +1805,7 @@ fi
+ AC_PROG_INSTALL
+
+ AC_CONFIG_HEADER(config.h)
++AC_CONFIG_FILES([libpcap.pc])
+
+ AC_OUTPUT_COMMANDS([if test -f .devel; then
+ echo timestamp > stamp-h
+diff --git a/libpcap.pc.in b/libpcap.pc.in
+new file mode 100644
+index 0000000..4f78ad8
+--- /dev/null
++++ b/libpcap.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libpcap
++Description: System-independent interface for user-level packet capture.
++Version: @VERSION@
++Libs: -L${libdir} -lpcap
++Cflags: -I${includedir}
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb b/poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
new file mode 100644
index 000000000..13dfbd67a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/libpcap/libpcap_1.8.1.bb
@@ -0,0 +1,31 @@
+require libpcap.inc
+
+SRC_URI += " \
+ file://libpcap-pkgconfig-support.patch \
+ file://0001-Fix-compiler_state_t.ai-usage-when-INET6-is-not-defi.patch \
+ file://0002-Add-missing-compiler_state_t-parameter.patch \
+ file://disable-remote.patch \
+ file://fix-grammar-deps.patch \
+"
+
+SRC_URI[md5sum] = "3d48f9cd171ff12b0efd9134b52f1447"
+SRC_URI[sha256sum] = "673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e"
+
+#
+# make install doesn't cover the shared lib
+# make install-shared is just broken (no symlinks)
+#
+
+do_configure_prepend () {
+ #remove hardcoded references to /usr/include
+ sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.ac
+}
+
+do_install_prepend () {
+ install -d ${D}${libdir}
+ install -d ${D}${bindir}
+ oe_runmake install-shared DESTDIR=${D}
+ oe_libinstall -a -so libpcap ${D}${libdir}
+ sed "s|@VERSION@|${PV}|" -i ${B}/libpcap.pc
+ install -D -m 0644 libpcap.pc ${D}${libdir}/pkgconfig/libpcap.pc
+}
diff --git a/poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb b/poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
new file mode 100644
index 000000000..dbc578e2d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Mobile Broadband Service Provider Database"
+HOMEPAGE = "http://live.gnome.org/NetworkManager/MobileBroadband/ServiceProviders"
+SECTION = "network"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
+SRCREV = "befcbbc9867e742ac16415660b0b7521218a530c"
+PV = "20170310"
+PE = "1"
+
+SRC_URI = "git://git.gnome.org/mobile-broadband-provider-info"
+S = "${WORKDIR}/git"
+
+inherit autotools
diff --git a/poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch b/poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch
new file mode 100644
index 000000000..d8e8a5e5d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/neard/neard/0001-Add-header-dependency-to-nciattach.o.patch
@@ -0,0 +1,35 @@
+From affaa2021a54c30353e4e1fee09c13a4de2196be Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 17 Mar 2017 14:24:29 +0200
+Subject: [PATCH] Add header dependency to nciattach.o
+
+This can happen when compiling nciattach.o:
+
+| In file included from ../neard-0.16/tools/nciattach.c:47:0:
+| ../neard-0.16/src/near.h:30:27: fatal error: near/nfc_copy.h: No such
+file or directory
+| #include <near/nfc_copy.h>
+
+Add the missing dependency to local headers.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [mailinglist]
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index fa552ee..acef6ba 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -253,6 +253,7 @@ se/builtin.h: src/genbuiltin $(builtin_se_sources)
+
+ $(src_neard_OBJECTS) \
+ $(tools_nfctool_nfctool_OBJECTS) \
++$(tools_nciattach_OBJECTS) \
+ $(plugin_objects) \
+ $(se_seeld_OBJECTS) \
+ $(unit_test_ndef_parse_OBJECTS) \
+--
+2.11.0
+
diff --git a/poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch b/poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch
new file mode 100644
index 000000000..16875e054
--- /dev/null
+++ b/poky/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch
@@ -0,0 +1,36 @@
+From bfd32d68cfc9f1e31dab88e07446d1c02bc80b5e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 12 Feb 2015 00:39:29 -0800
+Subject: [PATCH] Makefile.am: do not ship version.h
+
+The HEADERS' name has been changed to pkginclude_HEADERS, so use
+nodist_pkginclude_HEADERS, otherwise version.h would be shipped.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3334790..69cd58f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -10,11 +10,11 @@ pkginclude_HEADERS = include/types.h include/log.h include/plugin.h \
+ include/tlv.h include/setting.h include/device.h \
+ include/nfc_copy.h include/snep.h
+
+-nodist_include_HEADERS = include/version.h
++nodist_pkginclude_HEADERS = include/version.h
+
+ noinst_HEADERS = include/dbus.h
+
+-local_headers = $(foreach file,$(pkginclude_HEADERS) $(nodist_include_HEADERS) \
++local_headers = $(foreach file,$(pkginclude_HEADERS) $(nodist_pkginclude_HEADERS) \
+ $(noinst_HEADERS), include/near/$(notdir $(file)))
+
+ gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch b/poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
new file mode 100644
index 000000000..6e864079a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
@@ -0,0 +1,30 @@
+From 43acc56d5506c7e318f717fb3634bc16e3438913 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 15 Jan 2015 18:12:07 -0800
+Subject: [PATCH] Makefile.am: fix parallel issue
+
+There might be no src dir if src/builtin.h runs earlier, create it to
+fix the race issue:
+
+src/genbuiltin nfctype1 nfctype2 nfctype3 nfctype4 p2p > src/builtin.h
+/bin/sh: src/builtin.h: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: neard-0.16/Makefile.am
+===================================================================
+--- neard-0.16.orig/Makefile.am
++++ neard-0.16/Makefile.am
+@@ -244,6 +244,7 @@ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(di
+ src/plugin.$(OBJEXT): src/builtin.h
+
+ src/builtin.h: src/genbuiltin $(builtin_sources)
++ $(AM_V_at)$(MKDIR_P) src
+ $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
+
+ se/plugin.$(OBJEXT): se/builtin.h
diff --git a/poky/meta/recipes-connectivity/neard/neard/neard.in b/poky/meta/recipes-connectivity/neard/neard/neard.in
new file mode 100644
index 000000000..a47d4d96c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/neard/neard/neard.in
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# start/stop neard daemon.
+
+### BEGIN INIT INFO
+# Provides: neard
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: S 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: NFC daemon
+# Description: neard is a daemon used to enable NFC features
+### END INIT INFO
+
+DAEMON=@installpath@/neard
+PIDFILE=/var/run/neard.pid
+DESC="Linux NFC daemon"
+
+if [ -f /etc/default/neard ] ; then
+ . /etc/default/neard
+fi
+
+set -e
+
+do_start() {
+ $DAEMON
+}
+
+do_stop() {
+ start-stop-daemon --stop --name neard --quiet
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC"
+ do_start
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ do_stop
+ ;;
+ restart|force-reload)
+ echo "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/neard/neard_0.16.bb b/poky/meta/recipes-connectivity/neard/neard_0.16.bb
new file mode 100644
index 000000000..cc6af4e1c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/neard/neard_0.16.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Linux NFC daemon"
+DESCRIPTION = "A daemon for the Linux Near Field Communication stack"
+HOMEPAGE = "http://01.org/linux-nfc"
+LICENSE = "GPLv2"
+
+DEPENDS = "dbus glib-2.0 libnl"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BP}.tar.xz \
+ file://neard.in \
+ file://Makefile.am-fix-parallel-issue.patch \
+ file://Makefile.am-do-not-ship-version.h.patch \
+ file://0001-Add-header-dependency-to-nciattach.o.patch \
+ "
+SRC_URI[md5sum] = "5c691fb7872856dc0d909c298bc8cb41"
+SRC_URI[sha256sum] = "eae3b11c541a988ec11ca94b7deab01080cd5b58cfef3ced6ceac9b6e6e65b36"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
+ "
+
+inherit autotools pkgconfig systemd update-rc.d bluetooth
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-systemduserunitdir=${systemd_unitdir}/user/,--disable-systemd"
+
+EXTRA_OECONF += "--enable-tools"
+
+# This would copy neard start-stop shell and test scripts
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d/
+ sed "s:@installpath@:${libexecdir}/nfc:" ${WORKDIR}/neard.in \
+ > ${D}${sysconfdir}/init.d/neard
+ chmod 0755 ${D}${sysconfdir}/init.d/neard
+ fi
+}
+
+RDEPENDS_${PN} = "dbus"
+
+# Bluez & Wifi are not mandatory except for handover
+RRECOMMENDS_${PN} = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
+ "
+
+INITSCRIPT_NAME = "neard"
+INITSCRIPT_PARAMS = "defaults 64"
+
+SYSTEMD_SERVICE_${PN} = "neard.service"
diff --git a/poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch b/poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
new file mode 100644
index 000000000..822939f0d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
@@ -0,0 +1,31 @@
+From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
+Date: Wed, 17 Feb 2016 08:33:45 +0100
+Subject: bugfix: adjust statd service name
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service'
+instead but forgot to update the mount.nfs helper 'start-statd' accordingly.
+
+Upstream-Status: Inappropriate [other]
+
+Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
+---
+ utils/statd/start-statd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: nfs-utils-2.1.1/utils/statd/start-statd
+===================================================================
+--- nfs-utils-2.1.1.orig/utils/statd/start-statd
++++ nfs-utils-2.1.1/utils/statd/start-statd
+@@ -28,7 +28,7 @@ fi
+ # First try systemd if it's installed.
+ if [ -d /run/systemd/system ]; then
+ # Quit only if the call worked.
+- systemctl start rpc-statd.service && exit
++ systemctl start nfs-statd.service && exit
+ fi
+
+ cd /
diff --git a/poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch b/poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
new file mode 100644
index 000000000..ede0dcefc
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
@@ -0,0 +1,42 @@
+[PATCH] nfs-utils: debianize start-statd
+
+Upstream-Status: Pending
+
+make start-statd command to use nfscommon configure, too.
+
+Signed-off-by: Henrik Riomar <henrik.riomar@ericsson.com>
+Signed-off-by: Li Wang <li.wang@windriver.com>
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ utils/statd/start-statd | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index 2fd6039..f591b34 100755
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -17,6 +17,14 @@ then
+ # statd already running - must have been slow to respond.
+ exit 0
+ fi
++
++# Read config
++DEFAULTFILE=/etc/default/nfs-common
++NEED_IDMAPD=
++if [ -f $DEFAULTFILE ]; then
++ . $DEFAULTFILE
++fi
++
+ # First try systemd if it's installed.
+ if [ -d /run/systemd/system ]; then
+ # Quit only if the call worked.
+@@ -25,4 +33,4 @@ fi
+
+ cd /
+ # Fall back to launching it ourselves.
+-exec rpc.statd --no-notify
++exec rpc.statd --no-notify $STATDOPTS
+--
+2.6.6
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch
new file mode 100644
index 000000000..4ac529044
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch
@@ -0,0 +1,27 @@
+From a5e95a42e7bceddc9ecad06694c1a0588f4bafc8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 Apr 2015 07:22:47 -0700
+Subject: [PATCH] include sys/types.h for getting u_* typedefs
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cfg.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cfg.h b/cfg.h
+index d4d4cab..fe49e8f 100644
+--- a/cfg.h
++++ b/cfg.h
+@@ -33,6 +33,7 @@
+ #ifndef _CONF_H_
+ #define _CONF_H_
+
++#include <sys/types.h>
+ #include "queue.h"
+
+ struct conf_list_node {
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch
new file mode 100644
index 000000000..4633da919
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch
@@ -0,0 +1,18 @@
+Set nobody user and group
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+--- a/idmapd.conf
++++ b/idmapd.conf
+@@ -17,8 +17,8 @@
+
+ [Mapping]
+
+-#Nobody-User = nobody
+-#Nobody-Group = nobody
++Nobody-User = nobody
++Nobody-Group = nogroup
+
+ [Translation]
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch
new file mode 100644
index 000000000..d81c7c5f3
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- a/configure.in
++++ b/configure.in
+@@ -1,7 +1,7 @@
+ # -*- Autoconf -*-
+ # Process this file with autoconf to produce a configure script.
+
+-AC_PREREQ([2.68])
++AC_PREREQ([2.65])
+ AC_INIT([libnfsidmap],[0.25],[linux-nfs@vger.kernel.org])
+ AC_CONFIG_SRCDIR([nfsidmap.h])
+ AC_CONFIG_MACRO_DIR([m4])
diff --git a/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
new file mode 100644
index 000000000..256577100
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
@@ -0,0 +1,27 @@
+SUMMARY = "NFS id mapping library"
+HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
+
+SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \
+ file://fix-ac-prereq.patch \
+ file://Set_nobody_user_group.patch \
+ file://0001-include-sys-types.h-for-getting-u_-typedefs.patch \
+ "
+
+SRC_URI[md5sum] = "2ac4893c92716add1a1447ae01df77ab"
+SRC_URI[sha256sum] = "656d245d84400e1030f8f40a5a27da76370690c4a932baf249110f047fe7efcf"
+
+UPSTREAM_CHECK_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-ldap"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/
+ install -m 0644 ${WORKDIR}/${BPN}-${PV}/idmapd.conf ${D}${sysconfdir}/idmapd.conf
+}
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
new file mode 100644
index 000000000..26b558c81
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
@@ -0,0 +1,40 @@
+From 9b84cff305866abd150cf1a4c6e7e5ebf8a7eb3a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 15 Nov 2013 23:21:35 +0100
+Subject: [PATCH] configure: Allow to explicitly disable nfsidmap
+
+* keyutils availability is autodetected and builds aren't reproducible
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure.ac | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+Index: nfs-utils-2.1.1/configure.ac
+===================================================================
+--- nfs-utils-2.1.1.orig/configure.ac
++++ nfs-utils-2.1.1/configure.ac
+@@ -92,6 +92,12 @@ AC_ARG_ENABLE(nfsv4,
+ AC_SUBST(enable_nfsv4)
+ AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])
+
++AC_ARG_ENABLE(nfsidmap,
++ [AC_HELP_STRING([--enable-nfsidmap],
++ [enable support for NFSv4 idmapper @<:@default=yes@:>@])],
++ enable_nfsidmap=$enableval,
++ enable_nfsidmap=yes)
++
+ AC_ARG_ENABLE(nfsv41,
+ [AC_HELP_STRING([--disable-nfsv41],
+ [disable support for NFSv41 @<:@default=no@:>@])],
+@@ -339,7 +345,7 @@ fi
+
+ dnl enable nfsidmap when its support by libnfsidmap
+ AM_CONDITIONAL(CONFIG_NFSDCLTRACK, [test "$enable_nfsdcltrack" = "yes" ])
+-AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyes"])
++AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$enable_nfsidmap$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyesyes"])
+
+
+ if test "$knfsd_cv_glibc2" = no; then
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch
new file mode 100644
index 000000000..235a2c76f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-include-stdint.h-for-UINT16_MAX-definition.patch
@@ -0,0 +1,27 @@
+From 36b48057bce76dced335d67a2894a420967811c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 20 May 2017 14:07:53 -0700
+Subject: [PATCH] include stdint.h for UINT16_MAX definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ support/nsm/rpc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/support/nsm/rpc.c b/support/nsm/rpc.c
+index 4e5f40e..d91c6ea 100644
+--- a/support/nsm/rpc.c
++++ b/support/nsm/rpc.c
+@@ -40,6 +40,7 @@
+
+ #include <time.h>
+ #include <stdbool.h>
++#include <stdint.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+--
+2.13.0
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
new file mode 100644
index 000000000..27ea58d36
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=NFS Mount Daemon
+DefaultDependencies=no
+Requires=proc-fs-nfsd.mount
+After=proc-fs-nfsd.mount
+After=network.target local-fs.target
+BindsTo=nfs-server.service
+ConditionPathExists=@SYSCONFDIR@/exports
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
new file mode 100644
index 000000000..6481377d8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
@@ -0,0 +1,24 @@
+[Unit]
+Description=NFS server and services
+DefaultDependencies=no
+Requires=network.target proc-fs-nfsd.mount
+Requires=nfs-mountd.service
+Wants=rpcbind.service
+After=local-fs.target
+After=network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service
+ConditionPathExists=@SYSCONFDIR@/exports
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStartPre=@SBINDIR@/exportfs -r
+ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
+ExecStop=@SBINDIR@/rpc.nfsd 0
+ExecStopPost=@SBINDIR@/exportfs -au
+ExecStopPost=@SBINDIR@/exportfs -f
+ExecReload=@SBINDIR@/exportfs -r
+StandardError=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
new file mode 100644
index 000000000..6e196b8c8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=NFS status monitor for NFSv2/3 locking.
+DefaultDependencies=no
+Conflicts=umount.target
+Requires=nss-lookup.target rpcbind.service
+After=network.target nss-lookup.target rpcbind.service
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
new file mode 100644
index 000000000..89a8a5726
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
@@ -0,0 +1,37 @@
+Fixes errors like
+sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later
+This error will occur anytime sm-notify is run before the network if fully up,
+which is happening more and more with parallel startup systems.
+The res_init() call is simple, safe, quick, and a patch to use it should be
+able to go upstream. Presumably the whole reason sm-notify tries several
+times is to wait for possible changes to the network configuration, but without
+calling res_init() it will never be aware of those changes
+
+Backported drom Fedora
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: nfs-utils-2.1.1/utils/statd/sm-notify.c
+===================================================================
+--- nfs-utils-2.1.1.orig/utils/statd/sm-notify.c
++++ nfs-utils-2.1.1/utils/statd/sm-notify.c
+@@ -28,6 +28,9 @@
+ #include <netdb.h>
+ #include <errno.h>
+ #include <grp.h>
++#include <netinet/in.h>
++#include <arpa/nameser.h>
++#include <resolv.h>
+
+ #include "conffile.h"
+ #include "sockaddr.h"
+@@ -89,6 +92,7 @@ smn_lookup(const char *name)
+ };
+ int error;
+
++ res_init();
+ error = getaddrinfo(name, NULL, &hint, &ai);
+ if (error != 0) {
+ xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
new file mode 100644
index 000000000..993f1e5ea
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
@@ -0,0 +1,42 @@
+nfs-utils: Do not pass CFLAGS to gcc while building
+
+Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has
+been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD).
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/locktest/Makefile.am | 2 ++
+ tools/rpcgen/Makefile.am | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
+index 3156815..1729fd1 100644
+--- a/tools/locktest/Makefile.am
++++ b/tools/locktest/Makefile.am
+@@ -1,6 +1,8 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
++CFLAGS=
++LDFLAGS=
+ LIBTOOL = @LIBTOOL@ --tag=CC
+
+ noinst_PROGRAMS = testlk
+diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am
+index 8a9ec89..8bacdaa 100644
+--- a/tools/rpcgen/Makefile.am
++++ b/tools/rpcgen/Makefile.am
+@@ -1,6 +1,8 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
++CFLAGS=
++LDFLAGS=
+ LIBTOOL = @LIBTOOL@ --tag=CC
+
+ noinst_PROGRAMS = rpcgen
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
new file mode 100644
index 000000000..a1007a7fb
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
@@ -0,0 +1,35 @@
+# Parameters to be passed to nfs-utils (clients & server) service files.
+#
+
+# Options to pass to rpc.nfsd.
+NFSD_OPTS=""
+
+# Number of servers to start up; the default is 8 servers.
+NFSD_COUNT=""
+
+# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
+PROCNFSD_MOUNTPOINT=""
+
+# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
+PROCNFSD_MOUNTOPTS=""
+
+# Options for rpc.mountd.
+# If you have a port-based firewall, you might want to set up
+# a fixed port here using the --port option.
+MOUNTD_OPTS=""
+
+# Parameters to be passed to nfs-common (nfs clients & server) init script.
+#
+
+# If you do not set values for the NEED_ options, they will be attempted
+# autodetected; this should be sufficient for most people. Valid alternatives
+# for the NEED_ options are "yes" and "no".
+
+# Do you want to start the statd daemon? It is not needed for NFSv4.
+NEED_STATD=""
+
+# Options to pass to rpc.statd.
+# N.B. statd normally runs on both client and server, and run-time
+# options should be specified accordingly.
+# STATD_OPTS="-p 32765 -o 32766"
+STATD_OPTS=""
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
new file mode 100644
index 000000000..992267d5a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -0,0 +1,63 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: nfs-common
+# Required-Start: $portmap hwclock
+# Required-Stop: $portmap hwclock
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: NFS support for both client and server
+# Description: NFS is a popular protocol for file sharing across
+# TCP/IP networks. This service provides various
+# support functions for NFS mounts.
+### END INIT INFO
+#
+# Startup script for nfs-utils
+#
+#
+# Location of executables:
+
+# Source function library.
+. /etc/init.d/functions
+
+test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
+test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
+#
+# The default state directory is /var/lib/nfs
+test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
+#
+#----------------------------------------------------------------------
+# Startup and shutdown functions.
+# Actual startup/shutdown is at the end of this file.
+
+start_statd(){
+ echo -n "starting statd: "
+ start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
+ echo done
+}
+stop_statd(){
+ echo -n 'stopping statd: '
+ start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
+ echo done
+}
+#----------------------------------------------------------------------
+#
+# supported options:
+# start
+# stop
+# restart: stops and starts mountd
+#FIXME: need to create the /var/lib/nfs/... directories
+case "$1" in
+ start)
+ start_statd;;
+ stop)
+ stop_statd;;
+ status)
+ status $NFS_STATD
+ exit $?;;
+ restart)
+ $0 stop
+ $0 start;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1;;
+esac
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
new file mode 100644
index 000000000..d5e9c38a9
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -0,0 +1,130 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: nfs-kernel-server
+# Required-Start: $remote_fs nfs-common $portmap hwclock
+# Required-Stop: $remote_fs nfs-common $portmap hwclock
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Kernel NFS server support
+# Description: NFS is a popular protocol for file sharing across
+# TCP/IP networks. This service provides NFS server
+# functionality, which is configured via the
+# /etc/exports file.
+### END INIT INFO
+#
+# Startup script for nfs-utils
+#
+# Source function library.
+. /etc/init.d/functions
+#
+# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
+# Other control variables may be overridden here too
+test -r /etc/default/nfsd && . /etc/default/nfsd
+#
+# Location of executables:
+test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
+test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
+#
+# The user mode program must also exist (it just starts the kernel
+# threads using the kernel module code).
+test -x "$NFS_MOUNTD" || exit 0
+test -x "$NFS_NFSD" || exit 0
+#
+# Default is 8 threads, value is settable between 1 and the truely
+# ridiculous 99
+test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
+#
+#----------------------------------------------------------------------
+# Startup and shutdown functions.
+# Actual startup/shutdown is at the end of this file.
+#mountd
+start_mountd(){
+ echo -n 'starting mountd: '
+ start-stop-daemon --start --exec "$NFS_MOUNTD" -- "$@"
+ echo done
+}
+stop_mountd(){
+ echo -n 'stopping mountd: '
+ start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
+ echo done
+}
+#
+#nfsd
+start_nfsd(){
+ modprobe -q nfsd
+ grep -q nfsd /proc/filesystems || {
+ echo NFS daemon support not enabled in kernel
+ exit 1
+ }
+ grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
+ grep -q nfsd /proc/mounts || {
+ echo nfsd filesystem could not be mounted at /proc/fs/nfsd
+ exit 1
+ }
+
+ echo -n "starting $1 nfsd kernel threads: "
+ start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
+ echo done
+}
+delay_nfsd(){
+ for delay in 0 1 2 3 4 5 6 7 8 9
+ do
+ if pidof nfsd >/dev/null
+ then
+ echo -n .
+ sleep 1
+ else
+ return 0
+ fi
+ done
+ return 1
+}
+stop_nfsd(){
+ # WARNING: this kills any process with the executable
+ # name 'nfsd'.
+ echo -n 'stopping nfsd: '
+ start-stop-daemon --stop --quiet --signal 1 --name nfsd
+ if delay_nfsd || {
+ echo failed
+ echo ' using signal 9: '
+ start-stop-daemon --stop --quiet --signal 9 --name nfsd
+ delay_nfsd
+ }
+ then
+ echo done
+ else
+ echo failed
+ fi
+}
+
+#----------------------------------------------------------------------
+#
+# supported options:
+# start
+# stop
+# reload: reloads the exports file
+# restart: stops and starts mountd
+#FIXME: need to create the /var/lib/nfs/... directories
+case "$1" in
+ start)
+ exportfs -r
+ start_nfsd "$NFS_SERVERS"
+ start_mountd
+ test -r /etc/exports && exportfs -a;;
+ stop) exportfs -ua
+ stop_mountd
+ stop_nfsd;;
+ status)
+ status /usr/sbin/rpc.mountd
+ RETVAL=$?
+ status nfsd
+ rval=$?
+ [ $RETVAL -eq 0 ] && exit $rval
+ exit $RETVAL;;
+ reload) test -r /etc/exports && exportfs -r;;
+ restart)
+ $0 stop
+ $0 start;;
+ *) echo "Usage: $0 {start|stop|status|reload|restart}"
+ exit 1;;
+esac
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
new file mode 100644
index 000000000..630801b37
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=NFSD configuration filesystem
+After=systemd-modules-load.service
+
+[Mount]
+What=nfsd
+Where=/proc/fs/nfsd
+Type=nfsd
diff --git a/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb
new file mode 100644
index 000000000..79453ad20
--- /dev/null
+++ b/poky/meta/recipes-connectivity/nfs-utils/nfs-utils_2.1.1.bb
@@ -0,0 +1,150 @@
+SUMMARY = "userspace utilities for kernel nfs"
+DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
+NFS server and related tools."
+HOMEPAGE = "http://nfs.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "MIT & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
+
+# util-linux for libblkid
+DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc"
+RDEPENDS_${PN} = "${PN}-client bash"
+RRECOMMENDS_${PN} = "kernel-module-nfsd"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}-client"
+USERADD_PARAM_${PN}-client = "--system --home-dir /var/lib/nfs \
+ --shell /bin/false --user-group rpcuser"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
+ file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
+ file://nfs-utils-1.2.3-sm-notify-res_init.patch \
+ file://nfsserver \
+ file://nfscommon \
+ file://nfs-utils.conf \
+ file://nfs-server.service \
+ file://nfs-mountd.service \
+ file://nfs-statd.service \
+ file://proc-fs-nfsd.mount \
+ file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
+ file://nfs-utils-debianize-start-statd.patch \
+ file://bugfix-adjust-statd-service-name.patch \
+ file://0001-include-stdint.h-for-UINT16_MAX-definition.patch \
+"
+
+SRC_URI[md5sum] = "59dfcb2e6254b129f901f40c86086b13"
+SRC_URI[sha256sum] = "0faeb54c70b84e6bd3b9b6901544b1f6add8d246f35c1683e402daf4e0c719ef"
+
+# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
+# pull in the remainder of the dependencies.
+
+INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
+INITSCRIPT_NAME = "nfsserver"
+INITSCRIPT_PARAMS = "defaults"
+INITSCRIPT_NAME_${PN}-client = "nfscommon"
+INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
+
+inherit autotools-brokensep update-rc.d systemd pkgconfig
+
+SYSTEMD_PACKAGES = "${PN} ${PN}-client"
+SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
+SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
+
+# --enable-uuid is need for cross-compiling
+EXTRA_OECONF = "--with-statduser=rpcuser \
+ --enable-mountconfig \
+ --enable-libmount-mount \
+ --enable-uuid \
+ --disable-gss \
+ --disable-nfsdcltrack \
+ --with-statdpath=/var/lib/nfs/statd \
+ "
+
+PACKAGECONFIG ??= "tcp-wrappers \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
+PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+# libdevmapper is available in meta-oe
+PACKAGECONFIG[nfsv41] = "--enable-nfsv41,--disable-nfsv41,libdevmapper"
+
+PACKAGES =+ "${PN}-client ${PN}-mount ${PN}-stats"
+
+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
+ ${localstatedir}/lib/nfs/rmtab \
+ ${localstatedir}/lib/nfs/xtab \
+ ${localstatedir}/lib/nfs/statd/state \
+ ${sysconfdir}/nfsmount.conf"
+
+FILES_${PN}-client = "${sbindir}/*statd \
+ ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
+ ${sbindir}/showmount ${sbindir}/nfsstat \
+ ${localstatedir}/lib/nfs \
+ ${sysconfdir}/nfs-utils.conf \
+ ${sysconfdir}/nfsmount.conf \
+ ${sysconfdir}/init.d/nfscommon \
+ ${systemd_unitdir}/system/nfs-statd.service"
+RDEPENDS_${PN}-client = "${PN}-mount rpcbind"
+
+FILES_${PN}-mount = "${base_sbindir}/*mount.nfs*"
+
+FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
+RDEPENDS_${PN}-stats = "python3-core"
+
+FILES_${PN} += "${systemd_unitdir}"
+
+do_configure_prepend() {
+ sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+ ${S}/utils/mount/Makefile.am
+
+ sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+ ${S}/utils/osd_login/Makefile.am
+}
+
+# Make clean needed because the package comes with
+# precompiled 64-bit objects that break the build
+do_compile_prepend() {
+ make clean
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
+ install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
+
+ install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
+ install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/*.service
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
+ install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+ ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
+ fi
+
+ # kernel code as of 3.8 hard-codes this path as a default
+ install -d ${D}/var/lib/nfs/v4recovery
+
+ # chown the directories and files
+ chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
+ chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
+
+ # the following are built by CC_FOR_BUILD
+ rm -f ${D}${sbindir}/rpcdebug
+ rm -f ${D}${sbindir}/rpcgen
+ rm -f ${D}${sbindir}/locktest
+
+ # Make python tools use python 3
+ sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${sbindir}/mountstats ${D}${sbindir}/nfsiostat
+
+}
diff --git a/poky/meta/recipes-connectivity/ofono/ofono.inc b/poky/meta/recipes-connectivity/ofono/ofono.inc
new file mode 100644
index 000000000..0472414b1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ofono/ofono.inc
@@ -0,0 +1,39 @@
+HOMEPAGE = "http://www.ofono.org"
+SUMMARY = "open source telephony"
+DESCRIPTION = "oFono is a stack for mobile telephony devices on Linux. oFono supports speaking to telephony devices through specific drivers, or with generic AT commands."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://src/ofono.h;beginline=1;endline=20;md5=3ce17d5978ef3445def265b98899c2ee"
+
+inherit autotools pkgconfig update-rc.d systemd bluetooth gobject-introspection-data
+
+DEPENDS = "dbus glib-2.0 udev mobile-broadband-provider-info"
+
+INITSCRIPT_NAME = "ofono"
+INITSCRIPT_PARAMS = "defaults 22"
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ "
+PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}"
+
+EXTRA_OECONF += "--enable-test"
+
+SYSTEMD_SERVICE_${PN} = "ofono.service"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/ofono ${D}${sysconfdir}/init.d/ofono
+}
+
+PACKAGES =+ "${PN}-tests"
+
+RDEPENDS_${PN} += "dbus"
+RRECOMMENDS_${PN} += "kernel-module-tun mobile-broadband-provider-info"
+
+FILES_${PN} += "${systemd_unitdir}"
+FILES_${PN}-tests = "${libdir}/${BPN}/test"
+RDEPENDS_${PN}-tests = "python3 python3-dbus"
+RDEPENDS_${PN}-tests += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'python3-pygobject', '', d)}"
diff --git a/poky/meta/recipes-connectivity/ofono/ofono/ofono b/poky/meta/recipes-connectivity/ofono/ofono/ofono
new file mode 100644
index 000000000..cc9970929
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ofono/ofono/ofono
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/ofonod
+PIDFILE=/var/run/ofonod.pid
+DESC="Telephony daemon"
+
+if [ -f /etc/default/ofono ] ; then
+ . /etc/default/ofono
+fi
+
+set -e
+
+do_start() {
+ $DAEMON
+}
+
+do_stop() {
+ start-stop-daemon --stop --name ofonod --quiet
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC"
+ do_start
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ do_stop
+ ;;
+ restart|force-reload)
+ echo "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/ofono/ofono/use-python3.patch b/poky/meta/recipes-connectivity/ofono/ofono/use-python3.patch
new file mode 100644
index 000000000..7b8407525
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ofono/ofono/use-python3.patch
@@ -0,0 +1,27 @@
+set-ddr should use Python3 like all the other tests.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 17b69cd1da4c5c5f732acb38ca1602446c567ee7 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 29 Jan 2018 11:31:25 +0000
+Subject: [PATCH] test/setddr: use Python 3
+
+All the other tests use Python 3, so this should to.
+---
+ test/set-ddr | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/set-ddr b/test/set-ddr
+index 5d061b95..33631f31 100755
+--- a/test/set-ddr
++++ b/test/set-ddr
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python3
+
+ import sys
+ import dbus
+--
+2.11.0
diff --git a/poky/meta/recipes-connectivity/ofono/ofono_1.22.bb b/poky/meta/recipes-connectivity/ofono/ofono_1.22.bb
new file mode 100644
index 000000000..e57eaa77e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ofono/ofono_1.22.bb
@@ -0,0 +1,9 @@
+require ofono.inc
+
+SRC_URI = "\
+ ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+ file://ofono \
+ file://use-python3.patch \
+"
+SRC_URI[md5sum] = "2a683ab8e98448ad8bc5dc9868d2893e"
+SRC_URI[sha256sum] = "8e34a6696c300c9841b55e8dff640bd3096e49f5dbe55bbebaa69a71676f687e"
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch b/poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
new file mode 100644
index 000000000..b8402a4de
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
@@ -0,0 +1,47 @@
+Adjust test cases to work with busybox.
+
+- Replace dd parameter "obs" with "bs".
+- Replace "head -<num>" with "head -n <num>".
+
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+
+Index: openssh-7.6p1/regress/cipher-speed.sh
+===================================================================
+--- openssh-7.6p1.orig/regress/cipher-speed.sh
++++ openssh-7.6p1/regress/cipher-speed.sh
+@@ -17,7 +17,7 @@ for c in `${SSH} -Q cipher`; do n=0; for
+ printf "%-60s" "$c/$m:"
+ ( ${SSH} -o 'compression no' \
+ -F $OBJ/ssh_proxy -m $m -c $c somehost \
+- exec sh -c \'"dd of=/dev/null obs=32k"\' \
++ exec sh -c \'"dd of=/dev/null bs=32k"\' \
+ < ${DATA} ) 2>&1 | getbytes
+
+ if [ $? -ne 0 ]; then
+Index: openssh-7.6p1/regress/transfer.sh
+===================================================================
+--- openssh-7.6p1.orig/regress/transfer.sh
++++ openssh-7.6p1/regress/transfer.sh
+@@ -13,7 +13,7 @@ cmp ${DATA} ${COPY} || fail "corrupted
+ for s in 10 100 1k 32k 64k 128k 256k; do
+ trace "dd-size ${s}"
+ rm -f ${COPY}
+- dd if=$DATA obs=${s} 2> /dev/null | \
++ dd if=$DATA bs=${s} 2> /dev/null | \
+ ${SSH} -q -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
+ if [ $? -ne 0 ]; then
+ fail "ssh cat $DATA failed"
+Index: openssh-7.6p1/regress/key-options.sh
+===================================================================
+--- openssh-7.6p1.orig/regress/key-options.sh
++++ openssh-7.6p1/regress/key-options.sh
+@@ -47,7 +47,7 @@ for f in 127.0.0.1 '127.0.0.0\/8'; do
+ fi
+
+ sed 's/.*/from="'"$f"'" &/' $origkeys >$authkeys
+- from=`head -1 $authkeys | cut -f1 -d ' '`
++ from=`head -n 1 $authkeys | cut -f1 -d ' '`
+ verbose "key option $from"
+ r=`${SSH} -q -F $OBJ/ssh_proxy somehost 'echo true'`
+ if [ "$r" = "true" ]; then
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/disable-ciphers-not-supported-by-OpenSSL-DES.patch b/poky/meta/recipes-connectivity/openssh/openssh/disable-ciphers-not-supported-by-OpenSSL-DES.patch
new file mode 100644
index 000000000..8a2d1a0a7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/disable-ciphers-not-supported-by-OpenSSL-DES.patch
@@ -0,0 +1,39 @@
+From 265eaab8b39d8d8721224a48eefed5bf1696d353 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 18 Apr 2018 21:58:32 +0800
+Subject: [PATCH] disable ciphers not supported by OpenSSL DES
+
+While compiling openssl with option `no-des', it caused the openssh
+build failure
+...
+cipher.c:85:41: error: 'EVP_des_ede3_cbc' undeclared here (not in a function);
+...
+
+OpenSSL configured that way defines OPENSSL_NO_DES to disable des
+
+Suggested by dtucker@
+
+Upstream-Status: Submitted [openssh-unix-dev@mindrot.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cipher.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cipher.c b/cipher.c
+index c3cd5dc..86558e1 100644
+--- a/cipher.c
++++ b/cipher.c
+@@ -82,7 +82,9 @@ struct sshcipher {
+
+ static const struct sshcipher ciphers[] = {
+ #ifdef WITH_OPENSSL
++#ifndef OPENSSL_NO_DES
+ { "3des-cbc", 8, 24, 0, 0, CFLAG_CBC, EVP_des_ede3_cbc },
++#endif
+ { "aes128-cbc", 16, 16, 0, 0, CFLAG_CBC, EVP_aes_128_cbc },
+ { "aes192-cbc", 16, 24, 0, 0, CFLAG_CBC, EVP_aes_192_cbc },
+ { "aes256-cbc", 16, 32, 0, 0, CFLAG_CBC, EVP_aes_256_cbc },
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch b/poky/meta/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch
new file mode 100644
index 000000000..7e043a2db
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/fix-potential-signed-overflow-in-pointer-arithmatic.patch
@@ -0,0 +1,99 @@
+From 3328e98bcbf2930cd7eea3e6c92ad5dcbdf4794f Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Wed, 24 Aug 2016 03:15:43 +0000
+Subject: [PATCH] Fix potential signed overflow in pointer arithmatic
+
+Pointer arithmatic results in implementation defined signed integer
+type, so that 's - src' in strlcpy and others may trigger signed overflow.
+In case of compilation by gcc or clang with -ftrapv option, the overflow
+would lead to program abort.
+
+Upstream-Status: Submitted [http://bugzilla.mindrot.org/show_bug.cgi?id=2608]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ openbsd-compat/strlcat.c | 8 ++++++--
+ openbsd-compat/strlcpy.c | 8 ++++++--
+ openbsd-compat/strnlen.c | 8 ++++++--
+ 3 files changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/openbsd-compat/strlcat.c b/openbsd-compat/strlcat.c
+index bcc1b61..e758ebf 100644
+--- a/openbsd-compat/strlcat.c
++++ b/openbsd-compat/strlcat.c
+@@ -23,6 +23,7 @@
+
+ #include <sys/types.h>
+ #include <string.h>
++#include <stdint.h>
+
+ /*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+@@ -55,8 +56,11 @@ strlcat(char *dst, const char *src, size_t siz)
+ s++;
+ }
+ *d = '\0';
+-
+- return(dlen + (s - src)); /* count does not include NUL */
++ /*
++ * Cast pointers to unsigned type before calculation, to avoid signed
++ * overflow when the string ends where the MSB has changed.
++ */
++ return (dlen + ((uintptr_t)s - (uintptr_t)src)); /* count does not include NUL */
+ }
+
+ #endif /* !HAVE_STRLCAT */
+diff --git a/openbsd-compat/strlcpy.c b/openbsd-compat/strlcpy.c
+index b4b1b60..b06f374 100644
+--- a/openbsd-compat/strlcpy.c
++++ b/openbsd-compat/strlcpy.c
+@@ -23,6 +23,7 @@
+
+ #include <sys/types.h>
+ #include <string.h>
++#include <stdint.h>
+
+ /*
+ * Copy src to string dst of size siz. At most siz-1 characters
+@@ -51,8 +52,11 @@ strlcpy(char *dst, const char *src, size_t siz)
+ while (*s++)
+ ;
+ }
+-
+- return(s - src - 1); /* count does not include NUL */
++ /*
++ * Cast pointers to unsigned type before calculation, to avoid signed
++ * overflow when the string ends where the MSB has changed.
++ */
++ return ((uintptr_t)s - (uintptr_t)src - 1); /* count does not include NUL */
+ }
+
+ #endif /* !HAVE_STRLCPY */
+diff --git a/openbsd-compat/strnlen.c b/openbsd-compat/strnlen.c
+index 93d5155..9b8de5d 100644
+--- a/openbsd-compat/strnlen.c
++++ b/openbsd-compat/strnlen.c
+@@ -23,6 +23,7 @@
+ #include <sys/types.h>
+
+ #include <string.h>
++#include <stdint.h>
+
+ size_t
+ strnlen(const char *str, size_t maxlen)
+@@ -31,7 +32,10 @@ strnlen(const char *str, size_t maxlen)
+
+ for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--)
+ ;
+-
+- return (size_t)(cp - str);
++ /*
++ * Cast pointers to unsigned type before calculation, to avoid signed
++ * overflow when the string ends where the MSB has changed.
++ */
++ return (size_t)((uintptr_t)cp - (uintptr_t)str);
+ }
+ #endif
+--
+1.9.1
+
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/init b/poky/meta/recipes-connectivity/openssh/openssh/init
new file mode 100644
index 000000000..34ba0f846
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/init
@@ -0,0 +1,90 @@
+#! /bin/sh
+set -e
+
+PIDFILE=/var/run/sshd.pid
+
+# source function library
+. /etc/init.d/functions
+
+# /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon
+
+test -x /usr/sbin/sshd || exit 0
+( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
+
+# /etc/default/ssh may set SYSCONFDIR and SSHD_OPTS
+if test -f /etc/default/ssh; then
+ . /etc/default/ssh
+fi
+
+[ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
+mkdir -p $SYSCONFDIR
+
+check_for_no_start() {
+ # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
+ if [ -e $SYSCONFDIR/sshd_not_to_be_run ]; then
+ echo "OpenBSD Secure Shell server not in use ($SYSCONFDIR/sshd_not_to_be_run)"
+ exit 0
+ fi
+}
+
+check_privsep_dir() {
+ # Create the PrivSep empty dir if necessary
+ if [ ! -d /var/run/sshd ]; then
+ mkdir /var/run/sshd
+ chmod 0755 /var/run/sshd
+ fi
+}
+
+check_config() {
+ /usr/sbin/sshd -t $SSHD_OPTS || exit 1
+}
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+case "$1" in
+ start)
+ check_for_no_start
+ echo "Starting OpenBSD Secure Shell server: sshd"
+ @LIBEXECDIR@/sshd_check_keys
+ check_privsep_dir
+ start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
+ echo "done."
+ ;;
+ stop)
+ echo -n "Stopping OpenBSD Secure Shell server: sshd"
+ start-stop-daemon -K -p $PIDFILE -x /usr/sbin/sshd
+ echo "."
+ ;;
+
+ reload|force-reload)
+ check_for_no_start
+ @LIBEXECDIR@/sshd_check_keys
+ check_config
+ echo -n "Reloading OpenBSD Secure Shell server's configuration"
+ start-stop-daemon -K -p $PIDFILE -s 1 -x /usr/sbin/sshd
+ echo "."
+ ;;
+
+ restart)
+ @LIBEXECDIR@/sshd_check_keys
+ check_config
+ echo -n "Restarting OpenBSD Secure Shell server: sshd"
+ start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/sbin/sshd
+ check_for_no_start
+ check_privsep_dir
+ sleep 2
+ start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
+ echo "."
+ ;;
+
+ status)
+ status /usr/sbin/sshd
+ exit $?
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/ssh {start|stop|status|reload|force-reload|restart}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/run-ptest b/poky/meta/recipes-connectivity/openssh/openssh/run-ptest
new file mode 100755
index 000000000..36a3d2a7b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/run-ptest
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+export TEST_SHELL=sh
+
+cd regress
+sed -i "/\t\tagent-ptrace /d" Makefile
+make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
+ | sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
+
+SSHAGENT=`which ssh-agent`
+GDB=`which gdb`
+
+if [ -z "${SSHAGENT}" -o -z "${GDB}" ]; then
+ echo "SKIP: agent-ptrace"
+ exit
+fi
+
+useradd openssh-test
+
+eval `su -c "${SSHAGENT} -s" openssh-test` > /dev/null
+r=$?
+if [ $r -ne 0 ]; then
+ echo "FAIL: could not start ssh-agent: exit code $r"
+else
+ su -c "gdb -p ${SSH_AGENT_PID}" openssh-test > /tmp/gdb.out 2>&1 << EOF
+ quit
+EOF
+ r=$?
+ if [ $r -ne 0 ]; then
+ echo "gdb failed: exit code $r"
+ fi
+ egrep 'ptrace: Operation not permitted.|procfs:.*Permission denied.|ttrace.*Permission denied.|procfs:.*: Invalid argument.|Unable to access task ' >/dev/null /tmp/gdb.out
+ r=$?
+ rm -f /tmp/gdb.out
+ if [ $r -ne 0 ]; then
+ echo "FAIL: ptrace agent"
+ else
+ echo "PASS: ptrace agent"
+ fi
+
+ ${SSHAGENT} -k > /dev/null
+fi
+userdel openssh-test
+
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/ssh_config b/poky/meta/recipes-connectivity/openssh/openssh/ssh_config
new file mode 100644
index 000000000..9e919156d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/ssh_config
@@ -0,0 +1,48 @@
+# $OpenBSD: ssh_config,v 1.28 2013/09/16 11:35:43 sthen Exp $
+
+# This is the ssh client system-wide configuration file. See
+# ssh_config(5) for more information. This file provides defaults for
+# users, and the values can be changed in per-user configuration files
+# or on the command line.
+
+# Configuration data is parsed as follows:
+# 1. command line options
+# 2. user-specific file
+# 3. system-wide file
+# Any configuration value is only changed the first time it is set.
+# Thus, host-specific definitions should be at the beginning of the
+# configuration file, and defaults at the end.
+
+# Site-wide defaults for some commonly used options. For a comprehensive
+# list of available options, their meanings and defaults, please see the
+# ssh_config(5) man page.
+
+Host *
+ ForwardAgent yes
+ ForwardX11 yes
+# RhostsRSAAuthentication no
+# RSAAuthentication yes
+# PasswordAuthentication yes
+# HostbasedAuthentication no
+# GSSAPIAuthentication no
+# GSSAPIDelegateCredentials no
+# BatchMode no
+# CheckHostIP yes
+# AddressFamily any
+# ConnectTimeout 0
+# StrictHostKeyChecking ask
+# IdentityFile ~/.ssh/identity
+# IdentityFile ~/.ssh/id_rsa
+# IdentityFile ~/.ssh/id_dsa
+# Port 22
+# Protocol 2,1
+# Cipher 3des
+# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
+# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
+# EscapeChar ~
+# Tunnel no
+# TunnelDevice any:any
+# PermitLocalCommand no
+# VisualHostKey no
+# ProxyCommand ssh -q -W %h:%p gateway.example.com
+# RekeyLimit 1G 1h
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshd b/poky/meta/recipes-connectivity/openssh/openssh/sshd
new file mode 100644
index 000000000..4882e58b4
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshd
@@ -0,0 +1,10 @@
+#%PAM-1.0
+
+auth include common-auth
+account required pam_nologin.so
+account include common-account
+password include common-password
+session optional pam_keyinit.so force revoke
+session include common-session
+session required pam_loginuid.so
+
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshd.socket b/poky/meta/recipes-connectivity/openssh/openssh/sshd.socket
new file mode 100644
index 000000000..12c39b26b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshd.socket
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=sshd.service
+
+[Socket]
+ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshd@.service b/poky/meta/recipes-connectivity/openssh/openssh/sshd@.service
new file mode 100644
index 000000000..9d83dfb2b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshd@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OpenSSH Per-Connection Daemon
+Wants=sshdgenkeys.service
+After=sshdgenkeys.service
+
+[Service]
+Environment="SSHD_OPTS="
+EnvironmentFile=-/etc/default/ssh
+ExecStart=-@SBINDIR@/sshd -i $SSHD_OPTS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+StandardError=syslog
+KillMode=process
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys b/poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
new file mode 100644
index 000000000..5463b1a4c
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshd_check_keys
@@ -0,0 +1,90 @@
+#! /bin/sh
+
+generate_key() {
+ local FILE=$1
+ local TYPE=$2
+ local DIR="$(dirname "$FILE")"
+
+ mkdir -p "$DIR"
+ ssh-keygen -q -f "${FILE}.tmp" -N '' -t $TYPE
+
+ # Atomically rename file public key
+ mv -f "${FILE}.tmp.pub" "${FILE}.pub"
+
+ # This sync does double duty: Ensuring that the data in the temporary
+ # private key file is on disk before the rename, and ensuring that the
+ # public key rename is completed before the private key rename, since we
+ # switch on the existence of the private key to trigger key generation.
+ # This does mean it is possible for the public key to exist, but be garbage
+ # but this is OK because in that case the private key won't exist and the
+ # keys will be regenerated.
+ #
+ # In the event that sync understands arguments that limit what it tries to
+ # fsync(), we provided them. If it does not, it will simply call sync()
+ # which is just as well
+ sync "${FILE}.pub" "$DIR" "${FILE}.tmp"
+
+ mv "${FILE}.tmp" "$FILE"
+
+ # sync to ensure the atomic rename is committed
+ sync "$DIR"
+}
+
+# /etc/default/ssh may set SYSCONFDIR and SSHD_OPTS
+if test -f /etc/default/ssh; then
+ . /etc/default/ssh
+fi
+
+[ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
+mkdir -p $SYSCONFDIR
+
+# parse sshd options
+set -- ${SSHD_OPTS} --
+sshd_config=/etc/ssh/sshd_config
+while true ; do
+ case "$1" in
+ -f*) if [ "$1" = "-f" ] ; then
+ sshd_config="$2"
+ shift
+ else
+ sshd_config="${1#-f}"
+ fi
+ shift
+ ;;
+ --) shift; break;;
+ *) shift;;
+ esac
+done
+
+# parse location of keys
+HOST_KEY_RSA=$(grep ^HostKey "${sshd_config}" | grep _rsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_RSA}" ] && HOST_KEY_RSA=$(grep HostKey "${sshd_config}" | grep _rsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_RSA}" ] && HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
+HOST_KEY_DSA=$(grep ^HostKey "${sshd_config}" | grep _dsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_DSA}" ] && HOST_KEY_DSA=$(grep HostKey "${sshd_config}" | grep _dsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_DSA}" ] && HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
+HOST_KEY_ECDSA=$(grep ^HostKey "${sshd_config}" | grep _ecdsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ECDSA}" ] && HOST_KEY_ECDSA=$(grep HostKey "${sshd_config}" | grep _ecdsa_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ECDSA}" ] && HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
+HOST_KEY_ED25519=$(grep ^HostKey "${sshd_config}" | grep _ed25519_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ED25519}" ] && HOST_KEY_ED25519=$(grep HostKey "${sshd_config}" | grep _ed25519_ | tail -1 | awk ' { print $2 } ')
+[ -z "${HOST_KEY_ED25519}" ] && HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
+
+# create keys if necessary
+if [ ! -f $HOST_KEY_RSA ]; then
+ echo " generating ssh RSA key..."
+ generate_key $HOST_KEY_RSA rsa
+fi
+if [ ! -f $HOST_KEY_ECDSA ]; then
+ echo " generating ssh ECDSA key..."
+ generate_key $HOST_KEY_ECDSA ecdsa
+fi
+if [ ! -f $HOST_KEY_DSA ]; then
+ echo " generating ssh DSA key..."
+ generate_key $HOST_KEY_DSA dsa
+fi
+if [ ! -f $HOST_KEY_ED25519 ]; then
+ echo " generating ssh ED25519 key..."
+ generate_key $HOST_KEY_ED25519 ed25519
+fi
+
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshd_config b/poky/meta/recipes-connectivity/openssh/openssh/sshd_config
new file mode 100644
index 000000000..31fe5d924
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshd_config
@@ -0,0 +1,132 @@
+# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# The default requires explicit activation of protocol 1
+Protocol 2
+
+# HostKey for protocol version 1
+#HostKey /etc/ssh/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_dsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 1024
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin yes
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+
+# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
+# but this is overridden so installations will only check .ssh/authorized_keys
+AuthorizedKeysFile .ssh/authorized_keys
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+ChallengeResponseAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#PermitUserEnvironment no
+Compression no
+ClientAliveInterval 15
+ClientAliveCountMax 4
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+Subsystem sftp /usr/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# PermitTTY no
+# ForceCommand cvs server
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
new file mode 100644
index 000000000..603c33787
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSSH Key Generation
+RequiresMountsFor=/var /run
+
+[Service]
+ExecStart=@LIBEXECDIR@/sshd_check_keys
+Type=oneshot
+RemainAfterExit=yes
diff --git a/poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd b/poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
new file mode 100644
index 000000000..a0d2af3c6
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
@@ -0,0 +1,2 @@
+d root root 0755 /var/run/sshd none
+f root root 0644 /var/log/lastlog none
diff --git a/poky/meta/recipes-connectivity/openssh/openssh_7.6p1.bb b/poky/meta/recipes-connectivity/openssh/openssh_7.6p1.bb
new file mode 100644
index 000000000..e11e8d774
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssh/openssh_7.6p1.bb
@@ -0,0 +1,167 @@
+SUMMARY = "A suite of security-related network utilities based on \
+the SSH protocol including the ssh client and sshd server"
+DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
+Ssh (Secure Shell) is a program for logging into a remote machine \
+and for executing commands on a remote machine."
+HOMEPAGE = "http://www.openssh.com/"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=429658c6612f3a9b1293782366ab29d8"
+
+# openssl 1.1 patches are proposed at https://github.com/openssh/openssh-portable/pull/48
+DEPENDS = "zlib openssl10"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
+ file://sshd_config \
+ file://ssh_config \
+ file://init \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://sshd.socket \
+ file://sshd@.service \
+ file://sshdgenkeys.service \
+ file://volatiles.99_sshd \
+ file://run-ptest \
+ file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
+ file://sshd_check_keys \
+ file://add-test-support-for-busybox.patch \
+ file://disable-ciphers-not-supported-by-OpenSSL-DES.patch \
+ "
+
+PAM_SRC_URI = "file://sshd"
+
+SRC_URI[md5sum] = "06a88699018e5fef13d4655abfed1f63"
+SRC_URI[sha256sum] = "a323caeeddfe145baaa0db16e98d784b1fbc7dd436a6bf1f479dfd5cd1d21723"
+
+inherit useradd update-rc.d update-alternatives systemd
+
+USERADD_PACKAGES = "${PN}-sshd"
+USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
+INITSCRIPT_PACKAGES = "${PN}-sshd"
+INITSCRIPT_NAME_${PN}-sshd = "sshd"
+INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
+
+SYSTEMD_PACKAGES = "${PN}-sshd"
+SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
+
+inherit autotools-brokensep ptest
+
+# LFS support:
+CFLAGS += "-D__FILE_OFFSET_BITS=64"
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+# login path is hardcoded in sshd
+EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+ --without-zlib-version-check \
+ --with-privsep-path=/var/run/sshd \
+ --sysconfdir=${sysconfdir}/ssh \
+ --with-xauth=/usr/bin/xauth \
+ --disable-strip \
+ "
+
+# musl doesn't implement wtmp/utmp
+EXTRA_OECONF_append_libc-musl = " --disable-wtmp"
+
+# Since we do not depend on libbsd, we do not want configure to use it
+# just because it finds libutil.h. But, specifying --disable-libutil
+# causes compile errors, so...
+CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
+
+# passwd path is hardcoded in sshd
+CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
+
+# We don't want to depend on libblockfile
+CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
+
+do_configure_prepend () {
+ export LD="${CC}"
+ install -m 0644 ${WORKDIR}/sshd_config ${B}/
+ install -m 0644 ${WORKDIR}/ssh_config ${B}/
+}
+
+do_compile_ptest() {
+ # skip regress/unittests/ binaries: this will silently skip
+ # unittests in run-ptests which is good because they are so slow.
+ oe_runmake regress/modpipe regress/setuid-allowed regress/netcat
+}
+
+do_install_append () {
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -m 0644 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
+ sed -i -e 's:#UsePAM no:UsePAM yes:' ${D}${sysconfdir}/ssh/sshd_config
+ fi
+
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+ sed -i -e 's:#X11Forwarding no:X11Forwarding yes:' ${D}${sysconfdir}/ssh/sshd_config
+ fi
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
+ rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
+ rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+ install -d ${D}/${sysconfdir}/default/volatiles
+ install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
+ install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
+
+ # Create config files for read-only rootfs
+ install -d ${D}${sysconfdir}/ssh
+ install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
+ sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
+ echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+ echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+ echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+ echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+
+ install -d ${D}${systemd_unitdir}/system
+ install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
+ install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
+ install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
+ ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
+
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
+ ${D}${sysconfdir}/init.d/sshd
+
+ install -D -m 0755 ${WORKDIR}/sshd_check_keys ${D}${libexecdir}/${BPN}/sshd_check_keys
+}
+
+do_install_ptest () {
+ sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libexecdir}/sftp-server|" regress/test-exec.sh
+ cp -r regress ${D}${PTEST_PATH}
+}
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
+FILES_${PN}-scp = "${bindir}/scp.${BPN}"
+FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
+FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
+FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
+FILES_${PN}-sshd += "${libexecdir}/${BPN}/sshd_check_keys"
+FILES_${PN}-sftp = "${bindir}/sftp"
+FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
+FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
+FILES_${PN}-keygen = "${bindir}/ssh-keygen"
+
+RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
+RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
+RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
+
+RPROVIDES_${PN}-ssh = "ssh"
+RPROVIDES_${PN}-sshd = "sshd"
+
+RCONFLICTS_${PN} = "dropbear"
+RCONFLICTS_${PN}-sshd = "dropbear"
+RCONFLICTS_${PN}-keygen = "ssh-keygen"
+
+CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
+CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
+
+ALTERNATIVE_PRIORITY = "90"
+ALTERNATIVE_${PN}-scp = "scp"
+ALTERNATIVE_${PN}-ssh = "ssh"
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-Fix-build-with-clang-using-external-assembler.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-Fix-build-with-clang-using-external-assembler.patch
new file mode 100644
index 000000000..2270962a6
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-Fix-build-with-clang-using-external-assembler.patch
@@ -0,0 +1,45 @@
+From 2f6026cb8b16cf00726e3c5625c023f196680f07 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 17 Mar 2017 12:52:08 -0700
+Subject: [PATCH] Fix build with clang using external assembler
+
+Cherry-picked from
+https://github.com/openssl/openssl/commit/11208dcfb9105e8afa37233185decefd45e89e17
+https://github.com/openssl/openssl/commit/fbab8baddef8d3346ae40ff068871e2ddaf10270
+https://github.com/openssl/openssl/commit/6cf412c473d8145562b76219ce3da73b201b3255
+
+Fixes
+
+| ghash-armv4.S: Assembler messages:
+| ghash-armv4.S:81: Error: bad instruction `ldrbpl r12,[r2,r3]'
+| ghash-armv4.S:91: Error: bad instruction `ldrbpl r8,[r0,r3]'
+| ghash-armv4.S:137: Error: bad instruction `ldrbne r12,[r2,#15]'
+| ghash-armv4.S:224: Error: bad instruction `ldrbpl r12,[r0,r3]'
+| clang-4.0: error: assembler command failed with exit code 1 (use -v to see invocation)
+| make[2]: *** [<builtin>: ghash-armv4.o] Error 1
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ crypto/modes/asm/ghash-armv4.pl | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/crypto/modes/asm/ghash-armv4.pl b/crypto/modes/asm/ghash-armv4.pl
+index 8ccc963ef..442fed4da 100644
+--- a/crypto/modes/asm/ghash-armv4.pl
++++ b/crypto/modes/asm/ghash-armv4.pl
+@@ -124,7 +124,10 @@ $code=<<___;
+ #include "arm_arch.h"
+
+ .text
++#if defined(__thumb2__) || defined(__clang__)
++.syntax unified
++#endif
+ .code 32
+
+ #ifdef __clang__
+ #define ldrplb ldrbpl
+--
+2.12.0
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-openssl-force-soft-link-to-avoid-rare-race.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-openssl-force-soft-link-to-avoid-rare-race.patch
new file mode 100644
index 000000000..dd1a9b1dd
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/0001-openssl-force-soft-link-to-avoid-rare-race.patch
@@ -0,0 +1,46 @@
+From 3d9199423d48766649a2b2ebb3924e892ed16fa4 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Tue, 20 Jun 2017 15:32:08 -0400
+Subject: [PATCH] openssl: Force soft link to avoid rare race
+
+This patch works around a rare parallel build race condition.
+The error seen is:
+
+ln: failed to create symbolic link 'libssl.so': File exists
+make[4]: *** [Makefile.shared:171: link_a.gnu] Error 1
+make[4]: Leaving directory
+'/.../build/tmp-glibc/work/x86_64-linux/openssl-native/1.0.2k-r0/openssl-1.0.2k'
+
+The openssl team is rewriting their build files so it's not
+appropriate for openssl upstream and fixing the root cause of
+the Makefile race condition was also not pursued.
+
+Upstream-Status: Inappropriate [build rules rewrite in progress]
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+---
+ Makefile.shared | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.shared b/Makefile.shared
+index e8d222a..1bff92f 100644
+--- a/Makefile.shared
++++ b/Makefile.shared
+@@ -118,14 +118,14 @@
+ if [ -n "$$SHLIB_COMPAT" ]; then \
+ for x in $$SHLIB_COMPAT; do \
+ ( $(SET_X); rm -f $$SHLIB$$x$$SHLIB_SUFFIX; \
+- ln -s $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
++ ln -sf $$prev $$SHLIB$$x$$SHLIB_SUFFIX ); \
+ prev=$$SHLIB$$x$$SHLIB_SUFFIX; \
+ done; \
+ fi; \
+ if [ -n "$$SHLIB_SOVER" ]; then \
+ [ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \
+ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
+- ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
++ ln -sf $$prev $$SHLIB$$SHLIB_SUFFIX ); \
+ fi; \
+ fi
+
+--
+2.9.3
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Makefiles-ptest.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Makefiles-ptest.patch
new file mode 100644
index 000000000..2122fa1fb
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Makefiles-ptest.patch
@@ -0,0 +1,93 @@
+From a176c69f4fdfbfa7e4ccb79d91c3b6602da7e69a Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@enea.com>
+Date: Thu, 24 Apr 2014 19:28:25 +0200
+Subject: [PATCH 19/28] openssl: enable ptest support
+
+Add 'buildtest' and 'runtest' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+
+---
+ Makefile.org | 10 +-
+ Makefile.org.orig | 7 +-
+ test/Makefile | 13 +-
+ test/Makefile.orig | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 1009 insertions(+), 8 deletions(-)
+ create mode 100644 test/Makefile.orig
+
+diff --git a/Makefile.org b/Makefile.org
+index 111fbba..8e7936c 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -468,8 +468,16 @@ rehash.time: certs apps
+ test: tests
+
+ tests: rehash
++ $(MAKE) buildtest
++ $(MAKE) runtest
++
++buildtest:
++ @(cd test && \
++ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf exe apps);
++
++runtest:
+ @(cd test && echo "testing..." && \
+- $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
++ $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf alltests );
+ OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
+
+ report:
+diff --git a/test/Makefile b/test/Makefile
+index a1f7eeb..b2984c4 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -150,7 +150,7 @@ tests: exe apps $(TESTS)
+ apps:
+ @(cd ..; $(MAKE) DIRS=apps all)
+
+-alltests: \
++all-tests= \
+ test_des test_idea test_sha test_md4 test_md5 test_hmac \
+ test_md2 test_mdc2 test_wp \
+ test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \
+@@ -162,6 +162,11 @@ alltests: \
+ test_constant_time test_verify_extra test_clienthello test_sslv2conftest \
+ test_dtls test_bad_dtls test_fatalerr
+
++alltests:
++ @(for i in $(all-tests); do \
++ ( $(MAKE) $$i && echo "PASS: $$i" ) || echo "FAIL: $$i"; \
++ done)
++
+ test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt
+ ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt
+
+@@ -230,7 +235,7 @@ test_x509: ../apps/openssl$(EXE_EXT) tx509 testx509.pem v3-cert1.pem v3-cert2.pe
+ echo test second x509v3 certificate
+ sh ./tx509 v3-cert2.pem 2>/dev/null
+
+-test_rsa: $(RSATEST)$(EXE_EXT) ../apps/openssl$(EXE_EXT) trsa testrsa.pem
++test_rsa: ../apps/openssl$(EXE_EXT) trsa testrsa.pem
+ @sh ./trsa 2>/dev/null
+ ../util/shlib_wrap.sh ./$(RSATEST)
+
+@@ -331,11 +336,11 @@ test_tsa: ../apps/openssl$(EXE_EXT) testtsa CAtsa.cnf ../util/shlib_wrap.sh
+ sh ./testtsa; \
+ fi
+
+-test_ige: $(IGETEST)$(EXE_EXT)
++test_ige:
+ @echo "Test IGE mode"
+ ../util/shlib_wrap.sh ./$(IGETEST)
+
+-test_jpake: $(JPAKETEST)$(EXE_EXT)
++test_jpake:
+ @echo "Test JPAKE"
+ ../util/shlib_wrap.sh ./$(JPAKETEST)
+
+--
+2.15.1
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Use-SHA256-not-MD5-as-default-digest.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Use-SHA256-not-MD5-as-default-digest.patch
new file mode 100644
index 000000000..58c9ee784
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/Use-SHA256-not-MD5-as-default-digest.patch
@@ -0,0 +1,69 @@
+From d795f5f20a29adecf92c09459a3ee07ffac01a99 Mon Sep 17 00:00:00 2001
+From: Rich Salz <rsalz@akamai.com>
+Date: Sat, 13 Jun 2015 17:03:39 -0400
+Subject: [PATCH] Use SHA256 not MD5 as default digest.
+
+Commit f8547f62c212837dbf44fb7e2755e5774a59a57b upstream.
+
+Upstream-Status: Backport
+Backport from OpenSSL 2.0 to OpenSSL 1.0.2
+Commit f8547f62c212837dbf44fb7e2755e5774a59a57b
+
+CVE: CVE-2004-2761
+
+ The MD5 Message-Digest Algorithm is not collision resistant,
+ which makes it easier for context-dependent attackers to
+ conduct spoofing attacks, as demonstrated by attacks on the
+ use of MD5 in the signature algorithm of an X.509 certificate.
+
+Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+Signed-off-by: T.O. Radzy Radzykewycz <radzy@windriver.com>
+---
+ apps/ca.c | 2 +-
+ apps/dgst.c | 2 +-
+ apps/enc.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/apps/ca.c b/apps/ca.c
+index 3b7336c..8f3a84b 100644
+--- a/apps/ca.c
++++ b/apps/ca.c
+@@ -1612,7 +1612,7 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509,
+ } else
+ BIO_printf(bio_err, "Signature ok\n");
+
+- if ((rreq = X509_to_X509_REQ(req, NULL, EVP_md5())) == NULL)
++ if ((rreq = X509_to_X509_REQ(req, NULL, NULL)) == NULL)
+ goto err;
+
+ ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
+diff --git a/apps/dgst.c b/apps/dgst.c
+index 95e5fa3..0d1529f 100644
+--- a/apps/dgst.c
++++ b/apps/dgst.c
+@@ -442,7 +442,7 @@ int MAIN(int argc, char **argv)
+ goto end;
+ }
+ if (md == NULL)
+- md = EVP_md5();
++ md = EVP_sha256();
+ if (!EVP_DigestInit_ex(mctx, md, impl)) {
+ BIO_printf(bio_err, "Error setting digest %s\n", pname);
+ ERR_print_errors(bio_err);
+diff --git a/apps/enc.c b/apps/enc.c
+index 7b7c70b..a7d944c 100644
+--- a/apps/enc.c
++++ b/apps/enc.c
+@@ -344,7 +344,7 @@ int MAIN(int argc, char **argv)
+ }
+
+ if (dgst == NULL) {
+- dgst = EVP_md5();
++ dgst = EVP_sha256();
+ }
+
+ if (bufsize != NULL) {
+--
+1.9.1
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-musl-target.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-musl-target.patch
new file mode 100644
index 000000000..f357b3f59
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-musl-target.patch
@@ -0,0 +1,25 @@
+Add musl triplet support
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: openssl-1.0.2a/Configure
+===================================================================
+--- openssl-1.0.2a.orig/Configure
++++ openssl-1.0.2a/Configure
+@@ -431,7 +431,7 @@ my %table=(
+ #
+ # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
+ #
+-"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-armv4", "gcc: -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "linux-aarch64","gcc: -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ # Configure script adds minimally required -march for assembly support,
+ # if no -march was specified at command line. mips32 and mips64 below
+@@ -504,4 +504,6 @@ my %table=(
+ "linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-musleabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-musleabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+
+ "linux-avr32","$ENV{'CC'}:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).",
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-targets.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-targets.patch
new file mode 100644
index 000000000..1e0158972
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/configure-targets.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The number of colons are important :)
+
+
+---
+ Configure | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+Index: openssl-1.0.2a/Configure
+===================================================================
+--- openssl-1.0.2a.orig/Configure
++++ openssl-1.0.2a/Configure
+@@ -443,6 +443,21 @@ my %table=(
+ "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
+ "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
+
++
++# Linux on ARM
++"linux-elf-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-elf-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-gnueabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
++"linux-avr32","$ENV{'CC'}:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).",
++
++#### Linux on MIPS/MIPS64
++"linux-mips","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mips64","$ENV{'CC'}:-DB_ENDIAN -mabi=64 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mips64el","$ENV{'CC'}:-DL_ENDIAN -mabi=64 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mipsel","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
+ # Android: linux-* but without pointers to headers and libs.
+ "android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/c_rehash-compat.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/c_rehash-compat.patch
new file mode 100644
index 000000000..3820e3e30
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/c_rehash-compat.patch
@@ -0,0 +1,71 @@
+From 83f318d68bbdab1ca898c94576a838cc97df4700 Mon Sep 17 00:00:00 2001
+From: Ludwig Nussel <ludwig.nussel@suse.de>
+Date: Wed, 21 Apr 2010 15:52:10 +0200
+Subject: [PATCH] also create old hash for compatibility
+
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.2n/tools/c_rehash.in
+===================================================================
+--- openssl-1.0.2n.orig/tools/c_rehash.in
++++ openssl-1.0.2n/tools/c_rehash.in
+@@ -8,8 +8,6 @@ my $prefix;
+
+ my $openssl = $ENV{OPENSSL} || "openssl";
+ my $pwd;
+-my $x509hash = "-subject_hash";
+-my $crlhash = "-hash";
+ my $verbose = 0;
+ my $symlink_exists=eval {symlink("",""); 1};
+ my $removelinks = 1;
+@@ -18,10 +16,7 @@ my $removelinks = 1;
+ while ( $ARGV[0] =~ /^-/ ) {
+ my $flag = shift @ARGV;
+ last if ( $flag eq '--');
+- if ( $flag eq '-old') {
+- $x509hash = "-subject_hash_old";
+- $crlhash = "-hash_old";
+- } elsif ( $flag eq '-h') {
++ if ( $flag eq '-h') {
+ help();
+ } elsif ( $flag eq '-n' ) {
+ $removelinks = 0;
+@@ -113,7 +108,9 @@ sub hash_dir {
+ next;
+ }
+ link_hash_cert($fname) if($cert);
++ link_hash_cert_old($fname) if($cert);
+ link_hash_crl($fname) if($crl);
++ link_hash_crl_old($fname) if($crl);
+ }
+ }
+
+@@ -146,6 +143,7 @@ sub check_file {
+
+ sub link_hash_cert {
+ my $fname = $_[0];
++ my $x509hash = $_[1] || '-subject_hash';
+ $fname =~ s/'/'\\''/g;
+ my ($hash, $fprint) = `"$openssl" x509 $x509hash -fingerprint -noout -in "$fname"`;
+ chomp $hash;
+@@ -177,10 +175,20 @@ sub link_hash_cert {
+ $hashlist{$hash} = $fprint;
+ }
+
++sub link_hash_cert_old {
++ link_hash_cert($_[0], '-subject_hash_old');
++}
++
++sub link_hash_crl_old {
++ link_hash_crl($_[0], '-hash_old');
++}
++
++
+ # Same as above except for a CRL. CRL links are of the form <hash>.r<n>
+
+ sub link_hash_crl {
+ my $fname = $_[0];
++ my $crlhash = $_[1] || "-hash";
+ $fname =~ s/'/'\\''/g;
+ my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`;
+ chomp $hash;
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/ca.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/ca.patch
new file mode 100644
index 000000000..fb745e439
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/ca.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-0.9.8m/apps/CA.pl.in
+===================================================================
+--- openssl-0.9.8m.orig/apps/CA.pl.in 2006-04-28 00:28:51.000000000 +0000
++++ openssl-0.9.8m/apps/CA.pl.in 2010-02-27 00:36:51.000000000 +0000
+@@ -65,6 +65,7 @@
+ foreach (@ARGV) {
+ if ( /^(-\?|-h|-help)$/ ) {
+ print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n";
++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ exit 0;
+ } elsif (/^-newcert$/) {
+ # create a certificate
+@@ -165,6 +166,7 @@
+ } else {
+ print STDERR "Unknown arg $_\n";
+ print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
++ print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ exit 1;
+ }
+ }
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/debian-targets.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/debian-targets.patch
new file mode 100644
index 000000000..35d92bedb
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/debian-targets.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.2n/Configure
+===================================================================
+--- openssl-1.0.2n.orig/Configure
++++ openssl-1.0.2n/Configure
+@@ -133,6 +133,10 @@ my $clang_devteam_warn = "-Wno-unused-pa
+ # Warn that "make depend" should be run?
+ my $warn_make_depend = 0;
+
++# There are no separate CFLAGS/CPPFLAGS/LDFLAGS, set everything in CFLAGS
++my $debian_cflags = `dpkg-buildflags --get CFLAGS` . `dpkg-buildflags --get CPPFLAGS` . `dpkg-buildflags --get LDFLAGS` . "-Wa,--noexecstack -Wall";
++$debian_cflags =~ s/\n/ /g;
++
+ my $strict_warnings = 0;
+
+ my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
+@@ -369,6 +373,55 @@ my %table=(
+ "osf1-alpha-cc", "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
+ "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
+
++# Debian GNU/* (various architectures)
++"debian-alpha","gcc:-DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev4","gcc:-DTERMIO ${debian_cflags} -mcpu=ev4::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev5","gcc:-DTERMIO ${debian_cflags} -mcpu=ev5::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-arm64","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armel","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armhf","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
++"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -fomit-frame-pointer::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -march=i486::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hppa","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ia64","gcc:-DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i486::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i586::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i686::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m68k","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsel", "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsn32", "mips64-linux-gnuabin32-gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsn32el", "mips64el-linux-gnuabin32-gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips64", "mips64-linux-gnuabi64-gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips64el", "mips64el-linux-gnuabi64-gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-m68k", "gcc:-DB_ENDIAN -DTERMIOS ${debian_cflags}::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-sparc", "gcc:-DB_ENDIAN -DTERMIOS ${debian_cflags} -mv8::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-alpha","gcc:-DTERMIOS ${debian_cflags}::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-i386", "gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-mips","gcc:-DL_ENDIAN ${debian_cflags}::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-or1k", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpcspe","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ppc64el","gcc:-m64 -DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-s390","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-s390x","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3", "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4", "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3eb", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4eb", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m32r","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -mcpu=v8 -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -mcpu=v9 -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc64","gcc:-m64 -DB_ENDIAN -DTERMIO ${debian_cflags} -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-x32","gcc:-mx32 -DL_ENDIAN -DTERMIO ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
++
+ ####
+ #### Variety of LINUX:-)
+ ####
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-dir.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-dir.patch
new file mode 100644
index 000000000..4085e3b1d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-dir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.org
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.org 2010-12-12 16:11:27.000000000 +0100
++++ openssl-1.0.0c/Makefile.org 2010-12-12 16:11:37.000000000 +0100
+@@ -131,7 +131,7 @@
+
+ MAKEFILE= Makefile
+
+-MANDIR=$(OPENSSLDIR)/man
++MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+ MANSUFFIX=
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-section.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-section.patch
new file mode 100644
index 000000000..21c1d1a4e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/man-section.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.org
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.org 2010-12-12 16:11:37.000000000 +0100
++++ openssl-1.0.0c/Makefile.org 2010-12-12 16:13:28.000000000 +0100
+@@ -160,7 +160,8 @@
+ MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+-MANSUFFIX=
++MANSUFFIX=ssl
++MANSECTION=SSL
+ HTMLSUFFIX=html
+ HTMLDIR=$(OPENSSLDIR)/html
+ SHELL=/bin/sh
+@@ -651,7 +652,7 @@
+ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ (cd `$(PERL) util/dirname.pl $$i`; \
+ sh -c "$$pod2man \
+- --section=$$sec --center=OpenSSL \
++ --section=$${sec}$(MANSECTION) --center=OpenSSL \
+ --release=$(VERSION) `basename $$i`") \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ $(PERL) util/extract-names.pl < $$i | \
+@@ -668,7 +669,7 @@
+ echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ (cd `$(PERL) util/dirname.pl $$i`; \
+ sh -c "$$pod2man \
+- --section=$$sec --center=OpenSSL \
++ --section=$${sec}$(MANSECTION) --center=OpenSSL \
+ --release=$(VERSION) `basename $$i`") \
+ > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ $(PERL) util/extract-names.pl < $$i | \
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-rpath.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-rpath.patch
new file mode 100644
index 000000000..1ccb3b86e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-rpath.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.shared
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.shared 2010-08-21 13:36:49.000000000 +0200
++++ openssl-1.0.0c/Makefile.shared 2010-12-12 16:13:36.000000000 +0100
+@@ -153,7 +153,7 @@
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
++DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+
+ #This is rather special. It's a special target with which one can link
+ #applications without bothering with any features that have anything to
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-symbolic.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-symbolic.patch
new file mode 100644
index 000000000..cc4408ab7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/no-symbolic.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.shared
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.shared 2010-12-12 16:13:36.000000000 +0100
++++ openssl-1.0.0c/Makefile.shared 2010-12-12 16:13:44.000000000 +0100
+@@ -151,7 +151,7 @@
+ SHLIB_SUFFIX=; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+- SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
++ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+ DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/pic.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/pic.patch
new file mode 100644
index 000000000..bfda3888b
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian/pic.patch
@@ -0,0 +1,177 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.1c/crypto/des/asm/desboth.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/des/asm/desboth.pl 2001-10-24 23:20:56.000000000 +0200
++++ openssl-1.0.1c/crypto/des/asm/desboth.pl 2012-07-29 14:15:26.000000000 +0200
+@@ -16,6 +16,11 @@
+
+ &push("edi");
+
++ &call (&label("pic_point0"));
++ &set_label("pic_point0");
++ &blindpop("ebp");
++ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++
+ &comment("");
+ &comment("Load the data words");
+ &mov($L,&DWP(0,"ebx","",0));
+@@ -47,15 +52,21 @@
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "eax");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+ &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
+ &mov(&swtmp(1), "edi");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+ &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
+ &mov(&swtmp(1), "esi");
+ &mov(&swtmp(0), "ebx");
+- &call("DES_encrypt2");
++ &exch("ebx", "ebp");
++ &call("DES_encrypt2\@PLT");
++ &exch("ebx", "ebp");
+
+ &stack_pop(3);
+ &mov($L,&DWP(0,"ebx","",0));
+Index: openssl-1.0.1c/crypto/perlasm/cbc.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/perlasm/cbc.pl 2011-07-13 08:22:46.000000000 +0200
++++ openssl-1.0.1c/crypto/perlasm/cbc.pl 2012-07-29 14:15:26.000000000 +0200
+@@ -122,7 +122,11 @@
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($enc_func);
++ &call (&label("pic_point0"));
++ &set_label("pic_point0");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++ &call("$enc_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0));
+ &mov("ebx", &DWP($data_off+4,"esp","",0));
+@@ -185,7 +189,11 @@
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($enc_func);
++ &call (&label("pic_point1"));
++ &set_label("pic_point1");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
++ &call("$enc_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0));
+ &mov("ebx", &DWP($data_off+4,"esp","",0));
+@@ -218,7 +226,11 @@
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put back
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($dec_func);
++ &call (&label("pic_point2"));
++ &set_label("pic_point2");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
++ &call("$dec_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0)); # get return
+ &mov("ebx", &DWP($data_off+4,"esp","",0)); #
+@@ -261,7 +273,11 @@
+ &mov(&DWP($data_off,"esp","",0), "eax"); # put back
+ &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
+
+- &call($dec_func);
++ &call (&label("pic_point3"));
++ &set_label("pic_point3");
++ &blindpop("ebx");
++ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
++ &call("$dec_func\@PLT");
+
+ &mov("eax", &DWP($data_off,"esp","",0)); # get return
+ &mov("ebx", &DWP($data_off+4,"esp","",0)); #
+Index: openssl-1.0.1c/crypto/perlasm/x86gas.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/perlasm/x86gas.pl 2011-12-09 20:16:35.000000000 +0100
++++ openssl-1.0.1c/crypto/perlasm/x86gas.pl 2012-07-29 14:15:26.000000000 +0200
+@@ -161,6 +161,7 @@
+ if ($::macosx) { push (@out,"$tmp,2\n"); }
+ elsif ($::elf) { push (@out,"$tmp,4\n"); }
+ else { push (@out,"$tmp\n"); }
++ if ($::elf) { push (@out,".hidden\tOPENSSL_ia32cap_P\n"); }
+ }
+ push(@out,$initseg) if ($initseg);
+ }
+@@ -218,8 +219,23 @@
+ elsif ($::elf)
+ { $initseg.=<<___;
+ .section .init
++___
++ if ($::pic)
++ { $initseg.=<<___;
++ pushl %ebx
++ call .pic_point0
++.pic_point0:
++ popl %ebx
++ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
++ call $f\@PLT
++ popl %ebx
++___
++ }
++ else
++ { $initseg.=<<___;
+ call $f
+ ___
++ }
+ }
+ elsif ($::coff)
+ { $initseg.=<<___; # applies to both Cygwin and Mingw
+Index: openssl-1.0.1c/crypto/x86cpuid.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/x86cpuid.pl 2012-02-28 15:20:34.000000000 +0100
++++ openssl-1.0.1c/crypto/x86cpuid.pl 2012-07-29 14:15:26.000000000 +0200
+@@ -8,6 +8,8 @@
+
+ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
+
++push(@out, ".hidden OPENSSL_ia32cap_P\n");
++
+ &function_begin("OPENSSL_ia32_cpuid");
+ &xor ("edx","edx");
+ &pushf ();
+@@ -139,9 +141,7 @@
+ &set_label("nocpuid");
+ &function_end("OPENSSL_ia32_cpuid");
+
+-&external_label("OPENSSL_ia32cap_P");
+-
+-&function_begin_B("OPENSSL_rdtsc","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_rdtsc");
+ &xor ("eax","eax");
+ &xor ("edx","edx");
+ &picmeup("ecx","OPENSSL_ia32cap_P");
+@@ -155,7 +155,7 @@
+ # This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
+ # but it's safe to call it on any [supported] 32-bit platform...
+ # Just check for [non-]zero return value...
+-&function_begin_B("OPENSSL_instrument_halt","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_instrument_halt");
+ &picmeup("ecx","OPENSSL_ia32cap_P");
+ &bt (&DWP(0,"ecx"),4);
+ &jnc (&label("nohalt")); # no TSC
+@@ -222,7 +222,7 @@
+ &ret ();
+ &function_end_B("OPENSSL_far_spin");
+
+-&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_wipe_cpu");
+ &xor ("eax","eax");
+ &xor ("edx","edx");
+ &picmeup("ecx","OPENSSL_ia32cap_P");
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_digicert_malaysia.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_digicert_malaysia.patch
new file mode 100644
index 000000000..c43bcd1c7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_digicert_malaysia.patch
@@ -0,0 +1,29 @@
+From: Raphael Geissert <geissert@debian.org>
+Description: make X509_verify_cert indicate that any certificate whose
+ name contains "Digicert Sdn. Bhd." (from Malaysia) is revoked.
+Forwarded: not-needed
+Origin: vendor
+Last-Update: 2011-11-05
+
+Upstream-Status: Backport [debian]
+
+
+Index: openssl-1.0.2~beta1/crypto/x509/x509_vfy.c
+===================================================================
+--- openssl-1.0.2~beta1.orig/crypto/x509/x509_vfy.c 2014-02-25 00:16:12.488028844 +0100
++++ openssl-1.0.2~beta1/crypto/x509/x509_vfy.c 2014-02-25 00:16:12.484028929 +0100
+@@ -964,10 +964,11 @@
+ for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
+ {
+ x = sk_X509_value(ctx->chain, i);
+- /* Mark DigiNotar certificates as revoked, no matter
+- * where in the chain they are.
++ /* Mark certificates containing the following names as
++ * revoked, no matter where in the chain they are.
+ */
+- if (x->name && strstr(x->name, "DigiNotar"))
++ if (x->name && (strstr(x->name, "DigiNotar") ||
++ strstr(x->name, "Digicert Sdn. Bhd.")))
+ {
+ ctx->error = X509_V_ERR_CERT_REVOKED;
+ ctx->error_depth = i;
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_diginotar.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_diginotar.patch
new file mode 100644
index 000000000..d81e22cd8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/block_diginotar.patch
@@ -0,0 +1,68 @@
+From: Raphael Geissert <geissert@debian.org>
+Description: make X509_verify_cert indicate that any certificate whose
+ name contains "DigiNotar" is revoked.
+Forwarded: not-needed
+Origin: vendor
+Last-Update: 2011-09-08
+Bug: http://bugs.debian.org/639744
+Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
+Reviewed-by: Dr Stephen N Henson <shenson@drh-consultancy.co.uk>
+
+This is not meant as final patch.
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: openssl-1.0.2g/crypto/x509/x509_vfy.c
+===================================================================
+--- openssl-1.0.2g.orig/crypto/x509/x509_vfy.c
++++ openssl-1.0.2g/crypto/x509/x509_vfy.c
+@@ -119,6 +119,7 @@ static int check_trust(X509_STORE_CTX *c
+ static int check_revocation(X509_STORE_CTX *ctx);
+ static int check_cert(X509_STORE_CTX *ctx);
+ static int check_policy(X509_STORE_CTX *ctx);
++static int check_ca_blacklist(X509_STORE_CTX *ctx);
+
+ static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
+ unsigned int *preasons, X509_CRL *crl, X509 *x);
+@@ -489,6 +490,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx
+ if (!ok)
+ goto err;
+
++ ok = check_ca_blacklist(ctx);
++ if(!ok) goto err;
++
+ #ifndef OPENSSL_NO_RFC3779
+ /* RFC 3779 path validation, now that CRL check has been done */
+ ok = v3_asid_validate_path(ctx);
+@@ -996,6 +1000,29 @@ static int check_crl_time(X509_STORE_CTX
+ return 1;
+ }
+
++static int check_ca_blacklist(X509_STORE_CTX *ctx)
++ {
++ X509 *x;
++ int i;
++ /* Check all certificates against the blacklist */
++ for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
++ {
++ x = sk_X509_value(ctx->chain, i);
++ /* Mark DigiNotar certificates as revoked, no matter
++ * where in the chain they are.
++ */
++ if (x->name && strstr(x->name, "DigiNotar"))
++ {
++ ctx->error = X509_V_ERR_CERT_REVOKED;
++ ctx->error_depth = i;
++ ctx->current_cert = x;
++ if (!ctx->verify_cb(0,ctx))
++ return 0;
++ }
++ }
++ return 1;
++ }
++
+ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
+ X509 **pissuer, int *pscore, unsigned int *preasons,
+ STACK_OF(X509_CRL) *crls)
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/soname.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/soname.patch
new file mode 100644
index 000000000..09dd9eaf8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/soname.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate
+
+Index: openssl-1.0.2d/crypto/opensslv.h
+===================================================================
+--- openssl-1.0.2d.orig/crypto/opensslv.h
++++ openssl-1.0.2d/crypto/opensslv.h
+@@ -88,7 +88,7 @@ extern "C" {
+ * should only keep the versions that are binary compatible with the current.
+ */
+ # define SHLIB_VERSION_HISTORY ""
+-# define SHLIB_VERSION_NUMBER "1.0.0"
++# define SHLIB_VERSION_NUMBER "1.0.2"
+
+
+ #ifdef __cplusplus
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/version-script.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/version-script.patch
new file mode 100644
index 000000000..e404ee331
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/debian1.0.2/version-script.patch
@@ -0,0 +1,4658 @@
+Upstream-Status: Inappropriate
+
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/Configure
+===================================================================
+--- openssl-1.0.2~beta1.obsolete.0.0498436515490575.orig/Configure 2014-02-24 21:02:30.000000000 +0100
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/Configure 2014-02-24 21:02:30.000000000 +0100
+@@ -1651,6 +1651,8 @@
+ }
+ }
+
++$shared_ldflag .= " -Wl,--version-script=openssl.ld";
++
+ open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
+ unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
+ open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld 2014-02-24 22:19:08.601827266 +0100
+@@ -0,0 +1,4608 @@
++OPENSSL_1.0.2d {
++ global:
++ BIO_f_ssl;
++ BIO_new_buffer_ssl_connect;
++ BIO_new_ssl;
++ BIO_new_ssl_connect;
++ BIO_proxy_ssl_copy_session_id;
++ BIO_ssl_copy_session_id;
++ BIO_ssl_shutdown;
++ d2i_SSL_SESSION;
++ DTLSv1_client_method;
++ DTLSv1_method;
++ DTLSv1_server_method;
++ ERR_load_SSL_strings;
++ i2d_SSL_SESSION;
++ kssl_build_principal_2;
++ kssl_cget_tkt;
++ kssl_check_authent;
++ kssl_ctx_free;
++ kssl_ctx_new;
++ kssl_ctx_setkey;
++ kssl_ctx_setprinc;
++ kssl_ctx_setstring;
++ kssl_ctx_show;
++ kssl_err_set;
++ kssl_krb5_free_data_contents;
++ kssl_sget_tkt;
++ kssl_skip_confound;
++ kssl_validate_times;
++ PEM_read_bio_SSL_SESSION;
++ PEM_read_SSL_SESSION;
++ PEM_write_bio_SSL_SESSION;
++ PEM_write_SSL_SESSION;
++ SSL_accept;
++ SSL_add_client_CA;
++ SSL_add_dir_cert_subjects_to_stack;
++ SSL_add_dir_cert_subjs_to_stk;
++ SSL_add_file_cert_subjects_to_stack;
++ SSL_add_file_cert_subjs_to_stk;
++ SSL_alert_desc_string;
++ SSL_alert_desc_string_long;
++ SSL_alert_type_string;
++ SSL_alert_type_string_long;
++ SSL_callback_ctrl;
++ SSL_check_private_key;
++ SSL_CIPHER_description;
++ SSL_CIPHER_get_bits;
++ SSL_CIPHER_get_name;
++ SSL_CIPHER_get_version;
++ SSL_clear;
++ SSL_COMP_add_compression_method;
++ SSL_COMP_get_compression_methods;
++ SSL_COMP_get_compress_methods;
++ SSL_COMP_get_name;
++ SSL_connect;
++ SSL_copy_session_id;
++ SSL_ctrl;
++ SSL_CTX_add_client_CA;
++ SSL_CTX_add_session;
++ SSL_CTX_callback_ctrl;
++ SSL_CTX_check_private_key;
++ SSL_CTX_ctrl;
++ SSL_CTX_flush_sessions;
++ SSL_CTX_free;
++ SSL_CTX_get_cert_store;
++ SSL_CTX_get_client_CA_list;
++ SSL_CTX_get_client_cert_cb;
++ SSL_CTX_get_ex_data;
++ SSL_CTX_get_ex_new_index;
++ SSL_CTX_get_info_callback;
++ SSL_CTX_get_quiet_shutdown;
++ SSL_CTX_get_timeout;
++ SSL_CTX_get_verify_callback;
++ SSL_CTX_get_verify_depth;
++ SSL_CTX_get_verify_mode;
++ SSL_CTX_load_verify_locations;
++ SSL_CTX_new;
++ SSL_CTX_remove_session;
++ SSL_CTX_sess_get_get_cb;
++ SSL_CTX_sess_get_new_cb;
++ SSL_CTX_sess_get_remove_cb;
++ SSL_CTX_sessions;
++ SSL_CTX_sess_set_get_cb;
++ SSL_CTX_sess_set_new_cb;
++ SSL_CTX_sess_set_remove_cb;
++ SSL_CTX_set1_param;
++ SSL_CTX_set_cert_store;
++ SSL_CTX_set_cert_verify_callback;
++ SSL_CTX_set_cert_verify_cb;
++ SSL_CTX_set_cipher_list;
++ SSL_CTX_set_client_CA_list;
++ SSL_CTX_set_client_cert_cb;
++ SSL_CTX_set_client_cert_engine;
++ SSL_CTX_set_cookie_generate_cb;
++ SSL_CTX_set_cookie_verify_cb;
++ SSL_CTX_set_default_passwd_cb;
++ SSL_CTX_set_default_passwd_cb_userdata;
++ SSL_CTX_set_default_verify_paths;
++ SSL_CTX_set_def_passwd_cb_ud;
++ SSL_CTX_set_def_verify_paths;
++ SSL_CTX_set_ex_data;
++ SSL_CTX_set_generate_session_id;
++ SSL_CTX_set_info_callback;
++ SSL_CTX_set_msg_callback;
++ SSL_CTX_set_psk_client_callback;
++ SSL_CTX_set_psk_server_callback;
++ SSL_CTX_set_purpose;
++ SSL_CTX_set_quiet_shutdown;
++ SSL_CTX_set_session_id_context;
++ SSL_CTX_set_ssl_version;
++ SSL_CTX_set_timeout;
++ SSL_CTX_set_tmp_dh_callback;
++ SSL_CTX_set_tmp_ecdh_callback;
++ SSL_CTX_set_tmp_rsa_callback;
++ SSL_CTX_set_trust;
++ SSL_CTX_set_verify;
++ SSL_CTX_set_verify_depth;
++ SSL_CTX_use_cert_chain_file;
++ SSL_CTX_use_certificate;
++ SSL_CTX_use_certificate_ASN1;
++ SSL_CTX_use_certificate_chain_file;
++ SSL_CTX_use_certificate_file;
++ SSL_CTX_use_PrivateKey;
++ SSL_CTX_use_PrivateKey_ASN1;
++ SSL_CTX_use_PrivateKey_file;
++ SSL_CTX_use_psk_identity_hint;
++ SSL_CTX_use_RSAPrivateKey;
++ SSL_CTX_use_RSAPrivateKey_ASN1;
++ SSL_CTX_use_RSAPrivateKey_file;
++ SSL_do_handshake;
++ SSL_dup;
++ SSL_dup_CA_list;
++ SSLeay_add_ssl_algorithms;
++ SSL_free;
++ SSL_get1_session;
++ SSL_get_certificate;
++ SSL_get_cipher_list;
++ SSL_get_ciphers;
++ SSL_get_client_CA_list;
++ SSL_get_current_cipher;
++ SSL_get_current_compression;
++ SSL_get_current_expansion;
++ SSL_get_default_timeout;
++ SSL_get_error;
++ SSL_get_ex_data;
++ SSL_get_ex_data_X509_STORE_CTX_idx;
++ SSL_get_ex_d_X509_STORE_CTX_idx;
++ SSL_get_ex_new_index;
++ SSL_get_fd;
++ SSL_get_finished;
++ SSL_get_info_callback;
++ SSL_get_peer_cert_chain;
++ SSL_get_peer_certificate;
++ SSL_get_peer_finished;
++ SSL_get_privatekey;
++ SSL_get_psk_identity;
++ SSL_get_psk_identity_hint;
++ SSL_get_quiet_shutdown;
++ SSL_get_rbio;
++ SSL_get_read_ahead;
++ SSL_get_rfd;
++ SSL_get_servername;
++ SSL_get_servername_type;
++ SSL_get_session;
++ SSL_get_shared_ciphers;
++ SSL_get_shutdown;
++ SSL_get_SSL_CTX;
++ SSL_get_ssl_method;
++ SSL_get_verify_callback;
++ SSL_get_verify_depth;
++ SSL_get_verify_mode;
++ SSL_get_verify_result;
++ SSL_get_version;
++ SSL_get_wbio;
++ SSL_get_wfd;
++ SSL_has_matching_session_id;
++ SSL_library_init;
++ SSL_load_client_CA_file;
++ SSL_load_error_strings;
++ SSL_new;
++ SSL_peek;
++ SSL_pending;
++ SSL_read;
++ SSL_renegotiate;
++ SSL_renegotiate_pending;
++ SSL_rstate_string;
++ SSL_rstate_string_long;
++ SSL_SESSION_cmp;
++ SSL_SESSION_free;
++ SSL_SESSION_get_ex_data;
++ SSL_SESSION_get_ex_new_index;
++ SSL_SESSION_get_id;
++ SSL_SESSION_get_time;
++ SSL_SESSION_get_timeout;
++ SSL_SESSION_hash;
++ SSL_SESSION_new;
++ SSL_SESSION_print;
++ SSL_SESSION_print_fp;
++ SSL_SESSION_set_ex_data;
++ SSL_SESSION_set_time;
++ SSL_SESSION_set_timeout;
++ SSL_set1_param;
++ SSL_set_accept_state;
++ SSL_set_bio;
++ SSL_set_cipher_list;
++ SSL_set_client_CA_list;
++ SSL_set_connect_state;
++ SSL_set_ex_data;
++ SSL_set_fd;
++ SSL_set_generate_session_id;
++ SSL_set_info_callback;
++ SSL_set_msg_callback;
++ SSL_set_psk_client_callback;
++ SSL_set_psk_server_callback;
++ SSL_set_purpose;
++ SSL_set_quiet_shutdown;
++ SSL_set_read_ahead;
++ SSL_set_rfd;
++ SSL_set_session;
++ SSL_set_session_id_context;
++ SSL_set_session_secret_cb;
++ SSL_set_session_ticket_ext;
++ SSL_set_session_ticket_ext_cb;
++ SSL_set_shutdown;
++ SSL_set_SSL_CTX;
++ SSL_set_ssl_method;
++ SSL_set_tmp_dh_callback;
++ SSL_set_tmp_ecdh_callback;
++ SSL_set_tmp_rsa_callback;
++ SSL_set_trust;
++ SSL_set_verify;
++ SSL_set_verify_depth;
++ SSL_set_verify_result;
++ SSL_set_wfd;
++ SSL_shutdown;
++ SSL_state;
++ SSL_state_string;
++ SSL_state_string_long;
++ SSL_use_certificate;
++ SSL_use_certificate_ASN1;
++ SSL_use_certificate_file;
++ SSL_use_PrivateKey;
++ SSL_use_PrivateKey_ASN1;
++ SSL_use_PrivateKey_file;
++ SSL_use_psk_identity_hint;
++ SSL_use_RSAPrivateKey;
++ SSL_use_RSAPrivateKey_ASN1;
++ SSL_use_RSAPrivateKey_file;
++ SSLv23_client_method;
++ SSLv23_method;
++ SSLv23_server_method;
++ SSLv2_client_method;
++ SSLv2_method;
++ SSLv2_server_method;
++ SSLv3_client_method;
++ SSLv3_method;
++ SSLv3_server_method;
++ SSL_version;
++ SSL_want;
++ SSL_write;
++ TLSv1_client_method;
++ TLSv1_method;
++ TLSv1_server_method;
++
++
++ SSLeay;
++ SSLeay_version;
++ ASN1_BIT_STRING_asn1_meth;
++ ASN1_HEADER_free;
++ ASN1_HEADER_new;
++ ASN1_IA5STRING_asn1_meth;
++ ASN1_INTEGER_get;
++ ASN1_INTEGER_set;
++ ASN1_INTEGER_to_BN;
++ ASN1_OBJECT_create;
++ ASN1_OBJECT_free;
++ ASN1_OBJECT_new;
++ ASN1_PRINTABLE_type;
++ ASN1_STRING_cmp;
++ ASN1_STRING_dup;
++ ASN1_STRING_free;
++ ASN1_STRING_new;
++ ASN1_STRING_print;
++ ASN1_STRING_set;
++ ASN1_STRING_type_new;
++ ASN1_TYPE_free;
++ ASN1_TYPE_new;
++ ASN1_UNIVERSALSTRING_to_string;
++ ASN1_UTCTIME_check;
++ ASN1_UTCTIME_print;
++ ASN1_UTCTIME_set;
++ ASN1_check_infinite_end;
++ ASN1_d2i_bio;
++ ASN1_d2i_fp;
++ ASN1_digest;
++ ASN1_dup;
++ ASN1_get_object;
++ ASN1_i2d_bio;
++ ASN1_i2d_fp;
++ ASN1_object_size;
++ ASN1_parse;
++ ASN1_put_object;
++ ASN1_sign;
++ ASN1_verify;
++ BF_cbc_encrypt;
++ BF_cfb64_encrypt;
++ BF_ecb_encrypt;
++ BF_encrypt;
++ BF_ofb64_encrypt;
++ BF_options;
++ BF_set_key;
++ BIO_CONNECT_free;
++ BIO_CONNECT_new;
++ BIO_accept;
++ BIO_ctrl;
++ BIO_int_ctrl;
++ BIO_debug_callback;
++ BIO_dump;
++ BIO_dup_chain;
++ BIO_f_base64;
++ BIO_f_buffer;
++ BIO_f_cipher;
++ BIO_f_md;
++ BIO_f_null;
++ BIO_f_proxy_server;
++ BIO_fd_non_fatal_error;
++ BIO_fd_should_retry;
++ BIO_find_type;
++ BIO_free;
++ BIO_free_all;
++ BIO_get_accept_socket;
++ BIO_get_filter_bio;
++ BIO_get_host_ip;
++ BIO_get_port;
++ BIO_get_retry_BIO;
++ BIO_get_retry_reason;
++ BIO_gethostbyname;
++ BIO_gets;
++ BIO_new;
++ BIO_new_accept;
++ BIO_new_connect;
++ BIO_new_fd;
++ BIO_new_file;
++ BIO_new_fp;
++ BIO_new_socket;
++ BIO_pop;
++ BIO_printf;
++ BIO_push;
++ BIO_puts;
++ BIO_read;
++ BIO_s_accept;
++ BIO_s_connect;
++ BIO_s_fd;
++ BIO_s_file;
++ BIO_s_mem;
++ BIO_s_null;
++ BIO_s_proxy_client;
++ BIO_s_socket;
++ BIO_set;
++ BIO_set_cipher;
++ BIO_set_tcp_ndelay;
++ BIO_sock_cleanup;
++ BIO_sock_error;
++ BIO_sock_init;
++ BIO_sock_non_fatal_error;
++ BIO_sock_should_retry;
++ BIO_socket_ioctl;
++ BIO_write;
++ BN_CTX_free;
++ BN_CTX_new;
++ BN_MONT_CTX_free;
++ BN_MONT_CTX_new;
++ BN_MONT_CTX_set;
++ BN_add;
++ BN_add_word;
++ BN_hex2bn;
++ BN_bin2bn;
++ BN_bn2hex;
++ BN_bn2bin;
++ BN_clear;
++ BN_clear_bit;
++ BN_clear_free;
++ BN_cmp;
++ BN_copy;
++ BN_div;
++ BN_div_word;
++ BN_dup;
++ BN_free;
++ BN_from_montgomery;
++ BN_gcd;
++ BN_generate_prime;
++ BN_get_word;
++ BN_is_bit_set;
++ BN_is_prime;
++ BN_lshift;
++ BN_lshift1;
++ BN_mask_bits;
++ BN_mod;
++ BN_mod_exp;
++ BN_mod_exp_mont;
++ BN_mod_exp_simple;
++ BN_mod_inverse;
++ BN_mod_mul;
++ BN_mod_mul_montgomery;
++ BN_mod_word;
++ BN_mul;
++ BN_new;
++ BN_num_bits;
++ BN_num_bits_word;
++ BN_options;
++ BN_print;
++ BN_print_fp;
++ BN_rand;
++ BN_reciprocal;
++ BN_rshift;
++ BN_rshift1;
++ BN_set_bit;
++ BN_set_word;
++ BN_sqr;
++ BN_sub;
++ BN_to_ASN1_INTEGER;
++ BN_ucmp;
++ BN_value_one;
++ BUF_MEM_free;
++ BUF_MEM_grow;
++ BUF_MEM_new;
++ BUF_strdup;
++ CONF_free;
++ CONF_get_number;
++ CONF_get_section;
++ CONF_get_string;
++ CONF_load;
++ CRYPTO_add_lock;
++ CRYPTO_dbg_free;
++ CRYPTO_dbg_malloc;
++ CRYPTO_dbg_realloc;
++ CRYPTO_dbg_remalloc;
++ CRYPTO_free;
++ CRYPTO_get_add_lock_callback;
++ CRYPTO_get_id_callback;
++ CRYPTO_get_lock_name;
++ CRYPTO_get_locking_callback;
++ CRYPTO_get_mem_functions;
++ CRYPTO_lock;
++ CRYPTO_malloc;
++ CRYPTO_mem_ctrl;
++ CRYPTO_mem_leaks;
++ CRYPTO_mem_leaks_cb;
++ CRYPTO_mem_leaks_fp;
++ CRYPTO_realloc;
++ CRYPTO_remalloc;
++ CRYPTO_set_add_lock_callback;
++ CRYPTO_set_id_callback;
++ CRYPTO_set_locking_callback;
++ CRYPTO_set_mem_functions;
++ CRYPTO_thread_id;
++ DH_check;
++ DH_compute_key;
++ DH_free;
++ DH_generate_key;
++ DH_generate_parameters;
++ DH_new;
++ DH_size;
++ DHparams_print;
++ DHparams_print_fp;
++ DSA_free;
++ DSA_generate_key;
++ DSA_generate_parameters;
++ DSA_is_prime;
++ DSA_new;
++ DSA_print;
++ DSA_print_fp;
++ DSA_sign;
++ DSA_sign_setup;
++ DSA_size;
++ DSA_verify;
++ DSAparams_print;
++ DSAparams_print_fp;
++ ERR_clear_error;
++ ERR_error_string;
++ ERR_free_strings;
++ ERR_func_error_string;
++ ERR_get_err_state_table;
++ ERR_get_error;
++ ERR_get_error_line;
++ ERR_get_state;
++ ERR_get_string_table;
++ ERR_lib_error_string;
++ ERR_load_ASN1_strings;
++ ERR_load_BIO_strings;
++ ERR_load_BN_strings;
++ ERR_load_BUF_strings;
++ ERR_load_CONF_strings;
++ ERR_load_DH_strings;
++ ERR_load_DSA_strings;
++ ERR_load_ERR_strings;
++ ERR_load_EVP_strings;
++ ERR_load_OBJ_strings;
++ ERR_load_PEM_strings;
++ ERR_load_PROXY_strings;
++ ERR_load_RSA_strings;
++ ERR_load_X509_strings;
++ ERR_load_crypto_strings;
++ ERR_load_strings;
++ ERR_peek_error;
++ ERR_peek_error_line;
++ ERR_print_errors;
++ ERR_print_errors_fp;
++ ERR_put_error;
++ ERR_reason_error_string;
++ ERR_remove_state;
++ EVP_BytesToKey;
++ EVP_CIPHER_CTX_cleanup;
++ EVP_CipherFinal;
++ EVP_CipherInit;
++ EVP_CipherUpdate;
++ EVP_DecodeBlock;
++ EVP_DecodeFinal;
++ EVP_DecodeInit;
++ EVP_DecodeUpdate;
++ EVP_DecryptFinal;
++ EVP_DecryptInit;
++ EVP_DecryptUpdate;
++ EVP_DigestFinal;
++ EVP_DigestInit;
++ EVP_DigestUpdate;
++ EVP_EncodeBlock;
++ EVP_EncodeFinal;
++ EVP_EncodeInit;
++ EVP_EncodeUpdate;
++ EVP_EncryptFinal;
++ EVP_EncryptInit;
++ EVP_EncryptUpdate;
++ EVP_OpenFinal;
++ EVP_OpenInit;
++ EVP_PKEY_assign;
++ EVP_PKEY_copy_parameters;
++ EVP_PKEY_free;
++ EVP_PKEY_missing_parameters;
++ EVP_PKEY_new;
++ EVP_PKEY_save_parameters;
++ EVP_PKEY_size;
++ EVP_PKEY_type;
++ EVP_SealFinal;
++ EVP_SealInit;
++ EVP_SignFinal;
++ EVP_VerifyFinal;
++ EVP_add_alias;
++ EVP_add_cipher;
++ EVP_add_digest;
++ EVP_bf_cbc;
++ EVP_bf_cfb64;
++ EVP_bf_ecb;
++ EVP_bf_ofb;
++ EVP_cleanup;
++ EVP_des_cbc;
++ EVP_des_cfb64;
++ EVP_des_ecb;
++ EVP_des_ede;
++ EVP_des_ede3;
++ EVP_des_ede3_cbc;
++ EVP_des_ede3_cfb64;
++ EVP_des_ede3_ofb;
++ EVP_des_ede_cbc;
++ EVP_des_ede_cfb64;
++ EVP_des_ede_ofb;
++ EVP_des_ofb;
++ EVP_desx_cbc;
++ EVP_dss;
++ EVP_dss1;
++ EVP_enc_null;
++ EVP_get_cipherbyname;
++ EVP_get_digestbyname;
++ EVP_get_pw_prompt;
++ EVP_idea_cbc;
++ EVP_idea_cfb64;
++ EVP_idea_ecb;
++ EVP_idea_ofb;
++ EVP_md2;
++ EVP_md5;
++ EVP_md_null;
++ EVP_rc2_cbc;
++ EVP_rc2_cfb64;
++ EVP_rc2_ecb;
++ EVP_rc2_ofb;
++ EVP_rc4;
++ EVP_read_pw_string;
++ EVP_set_pw_prompt;
++ EVP_sha;
++ EVP_sha1;
++ MD2;
++ MD2_Final;
++ MD2_Init;
++ MD2_Update;
++ MD2_options;
++ MD5;
++ MD5_Final;
++ MD5_Init;
++ MD5_Update;
++ MDC2;
++ MDC2_Final;
++ MDC2_Init;
++ MDC2_Update;
++ NETSCAPE_SPKAC_free;
++ NETSCAPE_SPKAC_new;
++ NETSCAPE_SPKI_free;
++ NETSCAPE_SPKI_new;
++ NETSCAPE_SPKI_sign;
++ NETSCAPE_SPKI_verify;
++ OBJ_add_object;
++ OBJ_bsearch;
++ OBJ_cleanup;
++ OBJ_cmp;
++ OBJ_create;
++ OBJ_dup;
++ OBJ_ln2nid;
++ OBJ_new_nid;
++ OBJ_nid2ln;
++ OBJ_nid2obj;
++ OBJ_nid2sn;
++ OBJ_obj2nid;
++ OBJ_sn2nid;
++ OBJ_txt2nid;
++ PEM_ASN1_read;
++ PEM_ASN1_read_bio;
++ PEM_ASN1_write;
++ PEM_ASN1_write_bio;
++ PEM_SealFinal;
++ PEM_SealInit;
++ PEM_SealUpdate;
++ PEM_SignFinal;
++ PEM_SignInit;
++ PEM_SignUpdate;
++ PEM_X509_INFO_read;
++ PEM_X509_INFO_read_bio;
++ PEM_X509_INFO_write_bio;
++ PEM_dek_info;
++ PEM_do_header;
++ PEM_get_EVP_CIPHER_INFO;
++ PEM_proc_type;
++ PEM_read;
++ PEM_read_DHparams;
++ PEM_read_DSAPrivateKey;
++ PEM_read_DSAparams;
++ PEM_read_PKCS7;
++ PEM_read_PrivateKey;
++ PEM_read_RSAPrivateKey;
++ PEM_read_X509;
++ PEM_read_X509_CRL;
++ PEM_read_X509_REQ;
++ PEM_read_bio;
++ PEM_read_bio_DHparams;
++ PEM_read_bio_DSAPrivateKey;
++ PEM_read_bio_DSAparams;
++ PEM_read_bio_PKCS7;
++ PEM_read_bio_PrivateKey;
++ PEM_read_bio_RSAPrivateKey;
++ PEM_read_bio_X509;
++ PEM_read_bio_X509_CRL;
++ PEM_read_bio_X509_REQ;
++ PEM_write;
++ PEM_write_DHparams;
++ PEM_write_DSAPrivateKey;
++ PEM_write_DSAparams;
++ PEM_write_PKCS7;
++ PEM_write_PrivateKey;
++ PEM_write_RSAPrivateKey;
++ PEM_write_X509;
++ PEM_write_X509_CRL;
++ PEM_write_X509_REQ;
++ PEM_write_bio;
++ PEM_write_bio_DHparams;
++ PEM_write_bio_DSAPrivateKey;
++ PEM_write_bio_DSAparams;
++ PEM_write_bio_PKCS7;
++ PEM_write_bio_PrivateKey;
++ PEM_write_bio_RSAPrivateKey;
++ PEM_write_bio_X509;
++ PEM_write_bio_X509_CRL;
++ PEM_write_bio_X509_REQ;
++ PKCS7_DIGEST_free;
++ PKCS7_DIGEST_new;
++ PKCS7_ENCRYPT_free;
++ PKCS7_ENCRYPT_new;
++ PKCS7_ENC_CONTENT_free;
++ PKCS7_ENC_CONTENT_new;
++ PKCS7_ENVELOPE_free;
++ PKCS7_ENVELOPE_new;
++ PKCS7_ISSUER_AND_SERIAL_digest;
++ PKCS7_ISSUER_AND_SERIAL_free;
++ PKCS7_ISSUER_AND_SERIAL_new;
++ PKCS7_RECIP_INFO_free;
++ PKCS7_RECIP_INFO_new;
++ PKCS7_SIGNED_free;
++ PKCS7_SIGNED_new;
++ PKCS7_SIGNER_INFO_free;
++ PKCS7_SIGNER_INFO_new;
++ PKCS7_SIGN_ENVELOPE_free;
++ PKCS7_SIGN_ENVELOPE_new;
++ PKCS7_dup;
++ PKCS7_free;
++ PKCS7_new;
++ PROXY_ENTRY_add_noproxy;
++ PROXY_ENTRY_clear_noproxy;
++ PROXY_ENTRY_free;
++ PROXY_ENTRY_get_noproxy;
++ PROXY_ENTRY_new;
++ PROXY_ENTRY_set_server;
++ PROXY_add_noproxy;
++ PROXY_add_server;
++ PROXY_check_by_host;
++ PROXY_check_url;
++ PROXY_clear_noproxy;
++ PROXY_free;
++ PROXY_get_noproxy;
++ PROXY_get_proxies;
++ PROXY_get_proxy_entry;
++ PROXY_load_conf;
++ PROXY_new;
++ PROXY_print;
++ RAND_bytes;
++ RAND_cleanup;
++ RAND_file_name;
++ RAND_load_file;
++ RAND_screen;
++ RAND_seed;
++ RAND_write_file;
++ RC2_cbc_encrypt;
++ RC2_cfb64_encrypt;
++ RC2_ecb_encrypt;
++ RC2_encrypt;
++ RC2_ofb64_encrypt;
++ RC2_set_key;
++ RC4;
++ RC4_options;
++ RC4_set_key;
++ RSAPrivateKey_asn1_meth;
++ RSAPrivateKey_dup;
++ RSAPublicKey_dup;
++ RSA_PKCS1_SSLeay;
++ RSA_free;
++ RSA_generate_key;
++ RSA_new;
++ RSA_new_method;
++ RSA_print;
++ RSA_print_fp;
++ RSA_private_decrypt;
++ RSA_private_encrypt;
++ RSA_public_decrypt;
++ RSA_public_encrypt;
++ RSA_set_default_method;
++ RSA_sign;
++ RSA_sign_ASN1_OCTET_STRING;
++ RSA_size;
++ RSA_verify;
++ RSA_verify_ASN1_OCTET_STRING;
++ SHA;
++ SHA1;
++ SHA1_Final;
++ SHA1_Init;
++ SHA1_Update;
++ SHA_Final;
++ SHA_Init;
++ SHA_Update;
++ OpenSSL_add_all_algorithms;
++ OpenSSL_add_all_ciphers;
++ OpenSSL_add_all_digests;
++ TXT_DB_create_index;
++ TXT_DB_free;
++ TXT_DB_get_by_index;
++ TXT_DB_insert;
++ TXT_DB_read;
++ TXT_DB_write;
++ X509_ALGOR_free;
++ X509_ALGOR_new;
++ X509_ATTRIBUTE_free;
++ X509_ATTRIBUTE_new;
++ X509_CINF_free;
++ X509_CINF_new;
++ X509_CRL_INFO_free;
++ X509_CRL_INFO_new;
++ X509_CRL_add_ext;
++ X509_CRL_cmp;
++ X509_CRL_delete_ext;
++ X509_CRL_dup;
++ X509_CRL_free;
++ X509_CRL_get_ext;
++ X509_CRL_get_ext_by_NID;
++ X509_CRL_get_ext_by_OBJ;
++ X509_CRL_get_ext_by_critical;
++ X509_CRL_get_ext_count;
++ X509_CRL_new;
++ X509_CRL_sign;
++ X509_CRL_verify;
++ X509_EXTENSION_create_by_NID;
++ X509_EXTENSION_create_by_OBJ;
++ X509_EXTENSION_dup;
++ X509_EXTENSION_free;
++ X509_EXTENSION_get_critical;
++ X509_EXTENSION_get_data;
++ X509_EXTENSION_get_object;
++ X509_EXTENSION_new;
++ X509_EXTENSION_set_critical;
++ X509_EXTENSION_set_data;
++ X509_EXTENSION_set_object;
++ X509_INFO_free;
++ X509_INFO_new;
++ X509_LOOKUP_by_alias;
++ X509_LOOKUP_by_fingerprint;
++ X509_LOOKUP_by_issuer_serial;
++ X509_LOOKUP_by_subject;
++ X509_LOOKUP_ctrl;
++ X509_LOOKUP_file;
++ X509_LOOKUP_free;
++ X509_LOOKUP_hash_dir;
++ X509_LOOKUP_init;
++ X509_LOOKUP_new;
++ X509_LOOKUP_shutdown;
++ X509_NAME_ENTRY_create_by_NID;
++ X509_NAME_ENTRY_create_by_OBJ;
++ X509_NAME_ENTRY_dup;
++ X509_NAME_ENTRY_free;
++ X509_NAME_ENTRY_get_data;
++ X509_NAME_ENTRY_get_object;
++ X509_NAME_ENTRY_new;
++ X509_NAME_ENTRY_set_data;
++ X509_NAME_ENTRY_set_object;
++ X509_NAME_add_entry;
++ X509_NAME_cmp;
++ X509_NAME_delete_entry;
++ X509_NAME_digest;
++ X509_NAME_dup;
++ X509_NAME_entry_count;
++ X509_NAME_free;
++ X509_NAME_get_entry;
++ X509_NAME_get_index_by_NID;
++ X509_NAME_get_index_by_OBJ;
++ X509_NAME_get_text_by_NID;
++ X509_NAME_get_text_by_OBJ;
++ X509_NAME_hash;
++ X509_NAME_new;
++ X509_NAME_oneline;
++ X509_NAME_print;
++ X509_NAME_set;
++ X509_OBJECT_free_contents;
++ X509_OBJECT_retrieve_by_subject;
++ X509_OBJECT_up_ref_count;
++ X509_PKEY_free;
++ X509_PKEY_new;
++ X509_PUBKEY_free;
++ X509_PUBKEY_get;
++ X509_PUBKEY_new;
++ X509_PUBKEY_set;
++ X509_REQ_INFO_free;
++ X509_REQ_INFO_new;
++ X509_REQ_dup;
++ X509_REQ_free;
++ X509_REQ_get_pubkey;
++ X509_REQ_new;
++ X509_REQ_print;
++ X509_REQ_print_fp;
++ X509_REQ_set_pubkey;
++ X509_REQ_set_subject_name;
++ X509_REQ_set_version;
++ X509_REQ_sign;
++ X509_REQ_to_X509;
++ X509_REQ_verify;
++ X509_REVOKED_add_ext;
++ X509_REVOKED_delete_ext;
++ X509_REVOKED_free;
++ X509_REVOKED_get_ext;
++ X509_REVOKED_get_ext_by_NID;
++ X509_REVOKED_get_ext_by_OBJ;
++ X509_REVOKED_get_ext_by_critical;
++ X509_REVOKED_get_ext_by_critic;
++ X509_REVOKED_get_ext_count;
++ X509_REVOKED_new;
++ X509_SIG_free;
++ X509_SIG_new;
++ X509_STORE_CTX_cleanup;
++ X509_STORE_CTX_init;
++ X509_STORE_add_cert;
++ X509_STORE_add_lookup;
++ X509_STORE_free;
++ X509_STORE_get_by_subject;
++ X509_STORE_load_locations;
++ X509_STORE_new;
++ X509_STORE_set_default_paths;
++ X509_VAL_free;
++ X509_VAL_new;
++ X509_add_ext;
++ X509_asn1_meth;
++ X509_certificate_type;
++ X509_check_private_key;
++ X509_cmp_current_time;
++ X509_delete_ext;
++ X509_digest;
++ X509_dup;
++ X509_free;
++ X509_get_default_cert_area;
++ X509_get_default_cert_dir;
++ X509_get_default_cert_dir_env;
++ X509_get_default_cert_file;
++ X509_get_default_cert_file_env;
++ X509_get_default_private_dir;
++ X509_get_ext;
++ X509_get_ext_by_NID;
++ X509_get_ext_by_OBJ;
++ X509_get_ext_by_critical;
++ X509_get_ext_count;
++ X509_get_issuer_name;
++ X509_get_pubkey;
++ X509_get_pubkey_parameters;
++ X509_get_serialNumber;
++ X509_get_subject_name;
++ X509_gmtime_adj;
++ X509_issuer_and_serial_cmp;
++ X509_issuer_and_serial_hash;
++ X509_issuer_name_cmp;
++ X509_issuer_name_hash;
++ X509_load_cert_file;
++ X509_new;
++ X509_print;
++ X509_print_fp;
++ X509_set_issuer_name;
++ X509_set_notAfter;
++ X509_set_notBefore;
++ X509_set_pubkey;
++ X509_set_serialNumber;
++ X509_set_subject_name;
++ X509_set_version;
++ X509_sign;
++ X509_subject_name_cmp;
++ X509_subject_name_hash;
++ X509_to_X509_REQ;
++ X509_verify;
++ X509_verify_cert;
++ X509_verify_cert_error_string;
++ X509v3_add_ext;
++ X509v3_add_extension;
++ X509v3_add_netscape_extensions;
++ X509v3_add_standard_extensions;
++ X509v3_cleanup_extensions;
++ X509v3_data_type_by_NID;
++ X509v3_data_type_by_OBJ;
++ X509v3_delete_ext;
++ X509v3_get_ext;
++ X509v3_get_ext_by_NID;
++ X509v3_get_ext_by_OBJ;
++ X509v3_get_ext_by_critical;
++ X509v3_get_ext_count;
++ X509v3_pack_string;
++ X509v3_pack_type_by_NID;
++ X509v3_pack_type_by_OBJ;
++ X509v3_unpack_string;
++ _des_crypt;
++ a2d_ASN1_OBJECT;
++ a2i_ASN1_INTEGER;
++ a2i_ASN1_STRING;
++ asn1_Finish;
++ asn1_GetSequence;
++ bn_div_words;
++ bn_expand2;
++ bn_mul_add_words;
++ bn_mul_words;
++ BN_uadd;
++ BN_usub;
++ bn_sqr_words;
++ _ossl_old_crypt;
++ d2i_ASN1_BIT_STRING;
++ d2i_ASN1_BOOLEAN;
++ d2i_ASN1_HEADER;
++ d2i_ASN1_IA5STRING;
++ d2i_ASN1_INTEGER;
++ d2i_ASN1_OBJECT;
++ d2i_ASN1_OCTET_STRING;
++ d2i_ASN1_PRINTABLE;
++ d2i_ASN1_PRINTABLESTRING;
++ d2i_ASN1_SET;
++ d2i_ASN1_T61STRING;
++ d2i_ASN1_TYPE;
++ d2i_ASN1_UTCTIME;
++ d2i_ASN1_bytes;
++ d2i_ASN1_type_bytes;
++ d2i_DHparams;
++ d2i_DSAPrivateKey;
++ d2i_DSAPrivateKey_bio;
++ d2i_DSAPrivateKey_fp;
++ d2i_DSAPublicKey;
++ d2i_DSAparams;
++ d2i_NETSCAPE_SPKAC;
++ d2i_NETSCAPE_SPKI;
++ d2i_Netscape_RSA;
++ d2i_PKCS7;
++ d2i_PKCS7_DIGEST;
++ d2i_PKCS7_ENCRYPT;
++ d2i_PKCS7_ENC_CONTENT;
++ d2i_PKCS7_ENVELOPE;
++ d2i_PKCS7_ISSUER_AND_SERIAL;
++ d2i_PKCS7_RECIP_INFO;
++ d2i_PKCS7_SIGNED;
++ d2i_PKCS7_SIGNER_INFO;
++ d2i_PKCS7_SIGN_ENVELOPE;
++ d2i_PKCS7_bio;
++ d2i_PKCS7_fp;
++ d2i_PrivateKey;
++ d2i_PublicKey;
++ d2i_RSAPrivateKey;
++ d2i_RSAPrivateKey_bio;
++ d2i_RSAPrivateKey_fp;
++ d2i_RSAPublicKey;
++ d2i_X509;
++ d2i_X509_ALGOR;
++ d2i_X509_ATTRIBUTE;
++ d2i_X509_CINF;
++ d2i_X509_CRL;
++ d2i_X509_CRL_INFO;
++ d2i_X509_CRL_bio;
++ d2i_X509_CRL_fp;
++ d2i_X509_EXTENSION;
++ d2i_X509_NAME;
++ d2i_X509_NAME_ENTRY;
++ d2i_X509_PKEY;
++ d2i_X509_PUBKEY;
++ d2i_X509_REQ;
++ d2i_X509_REQ_INFO;
++ d2i_X509_REQ_bio;
++ d2i_X509_REQ_fp;
++ d2i_X509_REVOKED;
++ d2i_X509_SIG;
++ d2i_X509_VAL;
++ d2i_X509_bio;
++ d2i_X509_fp;
++ DES_cbc_cksum;
++ DES_cbc_encrypt;
++ DES_cblock_print_file;
++ DES_cfb64_encrypt;
++ DES_cfb_encrypt;
++ DES_decrypt3;
++ DES_ecb3_encrypt;
++ DES_ecb_encrypt;
++ DES_ede3_cbc_encrypt;
++ DES_ede3_cfb64_encrypt;
++ DES_ede3_ofb64_encrypt;
++ DES_enc_read;
++ DES_enc_write;
++ DES_encrypt1;
++ DES_encrypt2;
++ DES_encrypt3;
++ DES_fcrypt;
++ DES_is_weak_key;
++ DES_key_sched;
++ DES_ncbc_encrypt;
++ DES_ofb64_encrypt;
++ DES_ofb_encrypt;
++ DES_options;
++ DES_pcbc_encrypt;
++ DES_quad_cksum;
++ DES_random_key;
++ _ossl_old_des_random_seed;
++ _ossl_old_des_read_2passwords;
++ _ossl_old_des_read_password;
++ _ossl_old_des_read_pw;
++ _ossl_old_des_read_pw_string;
++ DES_set_key;
++ DES_set_odd_parity;
++ DES_string_to_2keys;
++ DES_string_to_key;
++ DES_xcbc_encrypt;
++ DES_xwhite_in2out;
++ fcrypt_body;
++ i2a_ASN1_INTEGER;
++ i2a_ASN1_OBJECT;
++ i2a_ASN1_STRING;
++ i2d_ASN1_BIT_STRING;
++ i2d_ASN1_BOOLEAN;
++ i2d_ASN1_HEADER;
++ i2d_ASN1_IA5STRING;
++ i2d_ASN1_INTEGER;
++ i2d_ASN1_OBJECT;
++ i2d_ASN1_OCTET_STRING;
++ i2d_ASN1_PRINTABLE;
++ i2d_ASN1_SET;
++ i2d_ASN1_TYPE;
++ i2d_ASN1_UTCTIME;
++ i2d_ASN1_bytes;
++ i2d_DHparams;
++ i2d_DSAPrivateKey;
++ i2d_DSAPrivateKey_bio;
++ i2d_DSAPrivateKey_fp;
++ i2d_DSAPublicKey;
++ i2d_DSAparams;
++ i2d_NETSCAPE_SPKAC;
++ i2d_NETSCAPE_SPKI;
++ i2d_Netscape_RSA;
++ i2d_PKCS7;
++ i2d_PKCS7_DIGEST;
++ i2d_PKCS7_ENCRYPT;
++ i2d_PKCS7_ENC_CONTENT;
++ i2d_PKCS7_ENVELOPE;
++ i2d_PKCS7_ISSUER_AND_SERIAL;
++ i2d_PKCS7_RECIP_INFO;
++ i2d_PKCS7_SIGNED;
++ i2d_PKCS7_SIGNER_INFO;
++ i2d_PKCS7_SIGN_ENVELOPE;
++ i2d_PKCS7_bio;
++ i2d_PKCS7_fp;
++ i2d_PrivateKey;
++ i2d_PublicKey;
++ i2d_RSAPrivateKey;
++ i2d_RSAPrivateKey_bio;
++ i2d_RSAPrivateKey_fp;
++ i2d_RSAPublicKey;
++ i2d_X509;
++ i2d_X509_ALGOR;
++ i2d_X509_ATTRIBUTE;
++ i2d_X509_CINF;
++ i2d_X509_CRL;
++ i2d_X509_CRL_INFO;
++ i2d_X509_CRL_bio;
++ i2d_X509_CRL_fp;
++ i2d_X509_EXTENSION;
++ i2d_X509_NAME;
++ i2d_X509_NAME_ENTRY;
++ i2d_X509_PKEY;
++ i2d_X509_PUBKEY;
++ i2d_X509_REQ;
++ i2d_X509_REQ_INFO;
++ i2d_X509_REQ_bio;
++ i2d_X509_REQ_fp;
++ i2d_X509_REVOKED;
++ i2d_X509_SIG;
++ i2d_X509_VAL;
++ i2d_X509_bio;
++ i2d_X509_fp;
++ idea_cbc_encrypt;
++ idea_cfb64_encrypt;
++ idea_ecb_encrypt;
++ idea_encrypt;
++ idea_ofb64_encrypt;
++ idea_options;
++ idea_set_decrypt_key;
++ idea_set_encrypt_key;
++ lh_delete;
++ lh_doall;
++ lh_doall_arg;
++ lh_free;
++ lh_insert;
++ lh_new;
++ lh_node_stats;
++ lh_node_stats_bio;
++ lh_node_usage_stats;
++ lh_node_usage_stats_bio;
++ lh_retrieve;
++ lh_stats;
++ lh_stats_bio;
++ lh_strhash;
++ sk_delete;
++ sk_delete_ptr;
++ sk_dup;
++ sk_find;
++ sk_free;
++ sk_insert;
++ sk_new;
++ sk_pop;
++ sk_pop_free;
++ sk_push;
++ sk_set_cmp_func;
++ sk_shift;
++ sk_unshift;
++ sk_zero;
++ BIO_f_nbio_test;
++ ASN1_TYPE_get;
++ ASN1_TYPE_set;
++ PKCS7_content_free;
++ ERR_load_PKCS7_strings;
++ X509_find_by_issuer_and_serial;
++ X509_find_by_subject;
++ PKCS7_ctrl;
++ PKCS7_set_type;
++ PKCS7_set_content;
++ PKCS7_SIGNER_INFO_set;
++ PKCS7_add_signer;
++ PKCS7_add_certificate;
++ PKCS7_add_crl;
++ PKCS7_content_new;
++ PKCS7_dataSign;
++ PKCS7_dataVerify;
++ PKCS7_dataInit;
++ PKCS7_add_signature;
++ PKCS7_cert_from_signer_info;
++ PKCS7_get_signer_info;
++ EVP_delete_alias;
++ EVP_mdc2;
++ PEM_read_bio_RSAPublicKey;
++ PEM_write_bio_RSAPublicKey;
++ d2i_RSAPublicKey_bio;
++ i2d_RSAPublicKey_bio;
++ PEM_read_RSAPublicKey;
++ PEM_write_RSAPublicKey;
++ d2i_RSAPublicKey_fp;
++ i2d_RSAPublicKey_fp;
++ BIO_copy_next_retry;
++ RSA_flags;
++ X509_STORE_add_crl;
++ X509_load_crl_file;
++ EVP_rc2_40_cbc;
++ EVP_rc4_40;
++ EVP_CIPHER_CTX_init;
++ HMAC;
++ HMAC_Init;
++ HMAC_Update;
++ HMAC_Final;
++ ERR_get_next_error_library;
++ EVP_PKEY_cmp_parameters;
++ HMAC_cleanup;
++ BIO_ptr_ctrl;
++ BIO_new_file_internal;
++ BIO_new_fp_internal;
++ BIO_s_file_internal;
++ BN_BLINDING_convert;
++ BN_BLINDING_invert;
++ BN_BLINDING_update;
++ RSA_blinding_on;
++ RSA_blinding_off;
++ i2t_ASN1_OBJECT;
++ BN_BLINDING_new;
++ BN_BLINDING_free;
++ EVP_cast5_cbc;
++ EVP_cast5_cfb64;
++ EVP_cast5_ecb;
++ EVP_cast5_ofb;
++ BF_decrypt;
++ CAST_set_key;
++ CAST_encrypt;
++ CAST_decrypt;
++ CAST_ecb_encrypt;
++ CAST_cbc_encrypt;
++ CAST_cfb64_encrypt;
++ CAST_ofb64_encrypt;
++ RC2_decrypt;
++ OBJ_create_objects;
++ BN_exp;
++ BN_mul_word;
++ BN_sub_word;
++ BN_dec2bn;
++ BN_bn2dec;
++ BIO_ghbn_ctrl;
++ CRYPTO_free_ex_data;
++ CRYPTO_get_ex_data;
++ CRYPTO_set_ex_data;
++ ERR_load_CRYPTO_strings;
++ ERR_load_CRYPTOlib_strings;
++ EVP_PKEY_bits;
++ MD5_Transform;
++ SHA1_Transform;
++ SHA_Transform;
++ X509_STORE_CTX_get_chain;
++ X509_STORE_CTX_get_current_cert;
++ X509_STORE_CTX_get_error;
++ X509_STORE_CTX_get_error_depth;
++ X509_STORE_CTX_get_ex_data;
++ X509_STORE_CTX_set_cert;
++ X509_STORE_CTX_set_chain;
++ X509_STORE_CTX_set_error;
++ X509_STORE_CTX_set_ex_data;
++ CRYPTO_dup_ex_data;
++ CRYPTO_get_new_lockid;
++ CRYPTO_new_ex_data;
++ RSA_set_ex_data;
++ RSA_get_ex_data;
++ RSA_get_ex_new_index;
++ RSA_padding_add_PKCS1_type_1;
++ RSA_padding_add_PKCS1_type_2;
++ RSA_padding_add_SSLv23;
++ RSA_padding_add_none;
++ RSA_padding_check_PKCS1_type_1;
++ RSA_padding_check_PKCS1_type_2;
++ RSA_padding_check_SSLv23;
++ RSA_padding_check_none;
++ bn_add_words;
++ d2i_Netscape_RSA_2;
++ CRYPTO_get_ex_new_index;
++ RIPEMD160_Init;
++ RIPEMD160_Update;
++ RIPEMD160_Final;
++ RIPEMD160;
++ RIPEMD160_Transform;
++ RC5_32_set_key;
++ RC5_32_ecb_encrypt;
++ RC5_32_encrypt;
++ RC5_32_decrypt;
++ RC5_32_cbc_encrypt;
++ RC5_32_cfb64_encrypt;
++ RC5_32_ofb64_encrypt;
++ BN_bn2mpi;
++ BN_mpi2bn;
++ ASN1_BIT_STRING_get_bit;
++ ASN1_BIT_STRING_set_bit;
++ BIO_get_ex_data;
++ BIO_get_ex_new_index;
++ BIO_set_ex_data;
++ X509v3_get_key_usage;
++ X509v3_set_key_usage;
++ a2i_X509v3_key_usage;
++ i2a_X509v3_key_usage;
++ EVP_PKEY_decrypt;
++ EVP_PKEY_encrypt;
++ PKCS7_RECIP_INFO_set;
++ PKCS7_add_recipient;
++ PKCS7_add_recipient_info;
++ PKCS7_set_cipher;
++ ASN1_TYPE_get_int_octetstring;
++ ASN1_TYPE_get_octetstring;
++ ASN1_TYPE_set_int_octetstring;
++ ASN1_TYPE_set_octetstring;
++ ASN1_UTCTIME_set_string;
++ ERR_add_error_data;
++ ERR_set_error_data;
++ EVP_CIPHER_asn1_to_param;
++ EVP_CIPHER_param_to_asn1;
++ EVP_CIPHER_get_asn1_iv;
++ EVP_CIPHER_set_asn1_iv;
++ EVP_rc5_32_12_16_cbc;
++ EVP_rc5_32_12_16_cfb64;
++ EVP_rc5_32_12_16_ecb;
++ EVP_rc5_32_12_16_ofb;
++ asn1_add_error;
++ d2i_ASN1_BMPSTRING;
++ i2d_ASN1_BMPSTRING;
++ BIO_f_ber;
++ BN_init;
++ COMP_CTX_new;
++ COMP_CTX_free;
++ COMP_CTX_compress_block;
++ COMP_CTX_expand_block;
++ X509_STORE_CTX_get_ex_new_index;
++ OBJ_NAME_add;
++ BIO_socket_nbio;
++ EVP_rc2_64_cbc;
++ OBJ_NAME_cleanup;
++ OBJ_NAME_get;
++ OBJ_NAME_init;
++ OBJ_NAME_new_index;
++ OBJ_NAME_remove;
++ BN_MONT_CTX_copy;
++ BIO_new_socks4a_connect;
++ BIO_s_socks4a_connect;
++ PROXY_set_connect_mode;
++ RAND_SSLeay;
++ RAND_set_rand_method;
++ RSA_memory_lock;
++ bn_sub_words;
++ bn_mul_normal;
++ bn_mul_comba8;
++ bn_mul_comba4;
++ bn_sqr_normal;
++ bn_sqr_comba8;
++ bn_sqr_comba4;
++ bn_cmp_words;
++ bn_mul_recursive;
++ bn_mul_part_recursive;
++ bn_sqr_recursive;
++ bn_mul_low_normal;
++ BN_RECP_CTX_init;
++ BN_RECP_CTX_new;
++ BN_RECP_CTX_free;
++ BN_RECP_CTX_set;
++ BN_mod_mul_reciprocal;
++ BN_mod_exp_recp;
++ BN_div_recp;
++ BN_CTX_init;
++ BN_MONT_CTX_init;
++ RAND_get_rand_method;
++ PKCS7_add_attribute;
++ PKCS7_add_signed_attribute;
++ PKCS7_digest_from_attributes;
++ PKCS7_get_attribute;
++ PKCS7_get_issuer_and_serial;
++ PKCS7_get_signed_attribute;
++ COMP_compress_block;
++ COMP_expand_block;
++ COMP_rle;
++ COMP_zlib;
++ ms_time_diff;
++ ms_time_new;
++ ms_time_free;
++ ms_time_cmp;
++ ms_time_get;
++ PKCS7_set_attributes;
++ PKCS7_set_signed_attributes;
++ X509_ATTRIBUTE_create;
++ X509_ATTRIBUTE_dup;
++ ASN1_GENERALIZEDTIME_check;
++ ASN1_GENERALIZEDTIME_print;
++ ASN1_GENERALIZEDTIME_set;
++ ASN1_GENERALIZEDTIME_set_string;
++ ASN1_TIME_print;
++ BASIC_CONSTRAINTS_free;
++ BASIC_CONSTRAINTS_new;
++ ERR_load_X509V3_strings;
++ NETSCAPE_CERT_SEQUENCE_free;
++ NETSCAPE_CERT_SEQUENCE_new;
++ OBJ_txt2obj;
++ PEM_read_NETSCAPE_CERT_SEQUENCE;
++ PEM_read_NS_CERT_SEQ;
++ PEM_read_bio_NETSCAPE_CERT_SEQUENCE;
++ PEM_read_bio_NS_CERT_SEQ;
++ PEM_write_NETSCAPE_CERT_SEQUENCE;
++ PEM_write_NS_CERT_SEQ;
++ PEM_write_bio_NETSCAPE_CERT_SEQUENCE;
++ PEM_write_bio_NS_CERT_SEQ;
++ X509V3_EXT_add;
++ X509V3_EXT_add_alias;
++ X509V3_EXT_add_conf;
++ X509V3_EXT_cleanup;
++ X509V3_EXT_conf;
++ X509V3_EXT_conf_nid;
++ X509V3_EXT_get;
++ X509V3_EXT_get_nid;
++ X509V3_EXT_print;
++ X509V3_EXT_print_fp;
++ X509V3_add_standard_extensions;
++ X509V3_add_value;
++ X509V3_add_value_bool;
++ X509V3_add_value_int;
++ X509V3_conf_free;
++ X509V3_get_value_bool;
++ X509V3_get_value_int;
++ X509V3_parse_list;
++ d2i_ASN1_GENERALIZEDTIME;
++ d2i_ASN1_TIME;
++ d2i_BASIC_CONSTRAINTS;
++ d2i_NETSCAPE_CERT_SEQUENCE;
++ d2i_ext_ku;
++ ext_ku_free;
++ ext_ku_new;
++ i2d_ASN1_GENERALIZEDTIME;
++ i2d_ASN1_TIME;
++ i2d_BASIC_CONSTRAINTS;
++ i2d_NETSCAPE_CERT_SEQUENCE;
++ i2d_ext_ku;
++ EVP_MD_CTX_copy;
++ i2d_ASN1_ENUMERATED;
++ d2i_ASN1_ENUMERATED;
++ ASN1_ENUMERATED_set;
++ ASN1_ENUMERATED_get;
++ BN_to_ASN1_ENUMERATED;
++ ASN1_ENUMERATED_to_BN;
++ i2a_ASN1_ENUMERATED;
++ a2i_ASN1_ENUMERATED;
++ i2d_GENERAL_NAME;
++ d2i_GENERAL_NAME;
++ GENERAL_NAME_new;
++ GENERAL_NAME_free;
++ GENERAL_NAMES_new;
++ GENERAL_NAMES_free;
++ d2i_GENERAL_NAMES;
++ i2d_GENERAL_NAMES;
++ i2v_GENERAL_NAMES;
++ i2s_ASN1_OCTET_STRING;
++ s2i_ASN1_OCTET_STRING;
++ X509V3_EXT_check_conf;
++ hex_to_string;
++ string_to_hex;
++ DES_ede3_cbcm_encrypt;
++ RSA_padding_add_PKCS1_OAEP;
++ RSA_padding_check_PKCS1_OAEP;
++ X509_CRL_print_fp;
++ X509_CRL_print;
++ i2v_GENERAL_NAME;
++ v2i_GENERAL_NAME;
++ i2d_PKEY_USAGE_PERIOD;
++ d2i_PKEY_USAGE_PERIOD;
++ PKEY_USAGE_PERIOD_new;
++ PKEY_USAGE_PERIOD_free;
++ v2i_GENERAL_NAMES;
++ i2s_ASN1_INTEGER;
++ X509V3_EXT_d2i;
++ name_cmp;
++ str_dup;
++ i2s_ASN1_ENUMERATED;
++ i2s_ASN1_ENUMERATED_TABLE;
++ BIO_s_log;
++ BIO_f_reliable;
++ PKCS7_dataFinal;
++ PKCS7_dataDecode;
++ X509V3_EXT_CRL_add_conf;
++ BN_set_params;
++ BN_get_params;
++ BIO_get_ex_num;
++ BIO_set_ex_free_func;
++ EVP_ripemd160;
++ ASN1_TIME_set;
++ i2d_AUTHORITY_KEYID;
++ d2i_AUTHORITY_KEYID;
++ AUTHORITY_KEYID_new;
++ AUTHORITY_KEYID_free;
++ ASN1_seq_unpack;
++ ASN1_seq_pack;
++ ASN1_unpack_string;
++ ASN1_pack_string;
++ PKCS12_pack_safebag;
++ PKCS12_MAKE_KEYBAG;
++ PKCS8_encrypt;
++ PKCS12_MAKE_SHKEYBAG;
++ PKCS12_pack_p7data;
++ PKCS12_pack_p7encdata;
++ PKCS12_add_localkeyid;
++ PKCS12_add_friendlyname_asc;
++ PKCS12_add_friendlyname_uni;
++ PKCS12_get_friendlyname;
++ PKCS12_pbe_crypt;
++ PKCS12_decrypt_d2i;
++ PKCS12_i2d_encrypt;
++ PKCS12_init;
++ PKCS12_key_gen_asc;
++ PKCS12_key_gen_uni;
++ PKCS12_gen_mac;
++ PKCS12_verify_mac;
++ PKCS12_set_mac;
++ PKCS12_setup_mac;
++ OPENSSL_asc2uni;
++ OPENSSL_uni2asc;
++ i2d_PKCS12_BAGS;
++ PKCS12_BAGS_new;
++ d2i_PKCS12_BAGS;
++ PKCS12_BAGS_free;
++ i2d_PKCS12;
++ d2i_PKCS12;
++ PKCS12_new;
++ PKCS12_free;
++ i2d_PKCS12_MAC_DATA;
++ PKCS12_MAC_DATA_new;
++ d2i_PKCS12_MAC_DATA;
++ PKCS12_MAC_DATA_free;
++ i2d_PKCS12_SAFEBAG;
++ PKCS12_SAFEBAG_new;
++ d2i_PKCS12_SAFEBAG;
++ PKCS12_SAFEBAG_free;
++ ERR_load_PKCS12_strings;
++ PKCS12_PBE_add;
++ PKCS8_add_keyusage;
++ PKCS12_get_attr_gen;
++ PKCS12_parse;
++ PKCS12_create;
++ i2d_PKCS12_bio;
++ i2d_PKCS12_fp;
++ d2i_PKCS12_bio;
++ d2i_PKCS12_fp;
++ i2d_PBEPARAM;
++ PBEPARAM_new;
++ d2i_PBEPARAM;
++ PBEPARAM_free;
++ i2d_PKCS8_PRIV_KEY_INFO;
++ PKCS8_PRIV_KEY_INFO_new;
++ d2i_PKCS8_PRIV_KEY_INFO;
++ PKCS8_PRIV_KEY_INFO_free;
++ EVP_PKCS82PKEY;
++ EVP_PKEY2PKCS8;
++ PKCS8_set_broken;
++ EVP_PBE_ALGOR_CipherInit;
++ EVP_PBE_alg_add;
++ PKCS5_pbe_set;
++ EVP_PBE_cleanup;
++ i2d_SXNET;
++ d2i_SXNET;
++ SXNET_new;
++ SXNET_free;
++ i2d_SXNETID;
++ d2i_SXNETID;
++ SXNETID_new;
++ SXNETID_free;
++ DSA_SIG_new;
++ DSA_SIG_free;
++ DSA_do_sign;
++ DSA_do_verify;
++ d2i_DSA_SIG;
++ i2d_DSA_SIG;
++ i2d_ASN1_VISIBLESTRING;
++ d2i_ASN1_VISIBLESTRING;
++ i2d_ASN1_UTF8STRING;
++ d2i_ASN1_UTF8STRING;
++ i2d_DIRECTORYSTRING;
++ d2i_DIRECTORYSTRING;
++ i2d_DISPLAYTEXT;
++ d2i_DISPLAYTEXT;
++ d2i_ASN1_SET_OF_X509;
++ i2d_ASN1_SET_OF_X509;
++ i2d_PBKDF2PARAM;
++ PBKDF2PARAM_new;
++ d2i_PBKDF2PARAM;
++ PBKDF2PARAM_free;
++ i2d_PBE2PARAM;
++ PBE2PARAM_new;
++ d2i_PBE2PARAM;
++ PBE2PARAM_free;
++ d2i_ASN1_SET_OF_GENERAL_NAME;
++ i2d_ASN1_SET_OF_GENERAL_NAME;
++ d2i_ASN1_SET_OF_SXNETID;
++ i2d_ASN1_SET_OF_SXNETID;
++ d2i_ASN1_SET_OF_POLICYQUALINFO;
++ i2d_ASN1_SET_OF_POLICYQUALINFO;
++ d2i_ASN1_SET_OF_POLICYINFO;
++ i2d_ASN1_SET_OF_POLICYINFO;
++ SXNET_add_id_asc;
++ SXNET_add_id_ulong;
++ SXNET_add_id_INTEGER;
++ SXNET_get_id_asc;
++ SXNET_get_id_ulong;
++ SXNET_get_id_INTEGER;
++ X509V3_set_conf_lhash;
++ i2d_CERTIFICATEPOLICIES;
++ CERTIFICATEPOLICIES_new;
++ CERTIFICATEPOLICIES_free;
++ d2i_CERTIFICATEPOLICIES;
++ i2d_POLICYINFO;
++ POLICYINFO_new;
++ d2i_POLICYINFO;
++ POLICYINFO_free;
++ i2d_POLICYQUALINFO;
++ POLICYQUALINFO_new;
++ d2i_POLICYQUALINFO;
++ POLICYQUALINFO_free;
++ i2d_USERNOTICE;
++ USERNOTICE_new;
++ d2i_USERNOTICE;
++ USERNOTICE_free;
++ i2d_NOTICEREF;
++ NOTICEREF_new;
++ d2i_NOTICEREF;
++ NOTICEREF_free;
++ X509V3_get_string;
++ X509V3_get_section;
++ X509V3_string_free;
++ X509V3_section_free;
++ X509V3_set_ctx;
++ s2i_ASN1_INTEGER;
++ CRYPTO_set_locked_mem_functions;
++ CRYPTO_get_locked_mem_functions;
++ CRYPTO_malloc_locked;
++ CRYPTO_free_locked;
++ BN_mod_exp2_mont;
++ ERR_get_error_line_data;
++ ERR_peek_error_line_data;
++ PKCS12_PBE_keyivgen;
++ X509_ALGOR_dup;
++ d2i_ASN1_SET_OF_DIST_POINT;
++ i2d_ASN1_SET_OF_DIST_POINT;
++ i2d_CRL_DIST_POINTS;
++ CRL_DIST_POINTS_new;
++ CRL_DIST_POINTS_free;
++ d2i_CRL_DIST_POINTS;
++ i2d_DIST_POINT;
++ DIST_POINT_new;
++ d2i_DIST_POINT;
++ DIST_POINT_free;
++ i2d_DIST_POINT_NAME;
++ DIST_POINT_NAME_new;
++ DIST_POINT_NAME_free;
++ d2i_DIST_POINT_NAME;
++ X509V3_add_value_uchar;
++ d2i_ASN1_SET_OF_X509_ATTRIBUTE;
++ i2d_ASN1_SET_OF_ASN1_TYPE;
++ d2i_ASN1_SET_OF_X509_EXTENSION;
++ d2i_ASN1_SET_OF_X509_NAME_ENTRY;
++ d2i_ASN1_SET_OF_ASN1_TYPE;
++ i2d_ASN1_SET_OF_X509_ATTRIBUTE;
++ i2d_ASN1_SET_OF_X509_EXTENSION;
++ i2d_ASN1_SET_OF_X509_NAME_ENTRY;
++ X509V3_EXT_i2d;
++ X509V3_EXT_val_prn;
++ X509V3_EXT_add_list;
++ EVP_CIPHER_type;
++ EVP_PBE_CipherInit;
++ X509V3_add_value_bool_nf;
++ d2i_ASN1_UINTEGER;
++ sk_value;
++ sk_num;
++ sk_set;
++ i2d_ASN1_SET_OF_X509_REVOKED;
++ sk_sort;
++ d2i_ASN1_SET_OF_X509_REVOKED;
++ i2d_ASN1_SET_OF_X509_ALGOR;
++ i2d_ASN1_SET_OF_X509_CRL;
++ d2i_ASN1_SET_OF_X509_ALGOR;
++ d2i_ASN1_SET_OF_X509_CRL;
++ i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO;
++ i2d_ASN1_SET_OF_PKCS7_RECIP_INFO;
++ d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO;
++ d2i_ASN1_SET_OF_PKCS7_RECIP_INFO;
++ PKCS5_PBE_add;
++ PEM_write_bio_PKCS8;
++ i2d_PKCS8_fp;
++ PEM_read_bio_PKCS8_PRIV_KEY_INFO;
++ PEM_read_bio_P8_PRIV_KEY_INFO;
++ d2i_PKCS8_bio;
++ d2i_PKCS8_PRIV_KEY_INFO_fp;
++ PEM_write_bio_PKCS8_PRIV_KEY_INFO;
++ PEM_write_bio_P8_PRIV_KEY_INFO;
++ PEM_read_PKCS8;
++ d2i_PKCS8_PRIV_KEY_INFO_bio;
++ d2i_PKCS8_fp;
++ PEM_write_PKCS8;
++ PEM_read_PKCS8_PRIV_KEY_INFO;
++ PEM_read_P8_PRIV_KEY_INFO;
++ PEM_read_bio_PKCS8;
++ PEM_write_PKCS8_PRIV_KEY_INFO;
++ PEM_write_P8_PRIV_KEY_INFO;
++ PKCS5_PBE_keyivgen;
++ i2d_PKCS8_bio;
++ i2d_PKCS8_PRIV_KEY_INFO_fp;
++ i2d_PKCS8_PRIV_KEY_INFO_bio;
++ BIO_s_bio;
++ PKCS5_pbe2_set;
++ PKCS5_PBKDF2_HMAC_SHA1;
++ PKCS5_v2_PBE_keyivgen;
++ PEM_write_bio_PKCS8PrivateKey;
++ PEM_write_PKCS8PrivateKey;
++ BIO_ctrl_get_read_request;
++ BIO_ctrl_pending;
++ BIO_ctrl_wpending;
++ BIO_new_bio_pair;
++ BIO_ctrl_get_write_guarantee;
++ CRYPTO_num_locks;
++ CONF_load_bio;
++ CONF_load_fp;
++ i2d_ASN1_SET_OF_ASN1_OBJECT;
++ d2i_ASN1_SET_OF_ASN1_OBJECT;
++ PKCS7_signatureVerify;
++ RSA_set_method;
++ RSA_get_method;
++ RSA_get_default_method;
++ RSA_check_key;
++ OBJ_obj2txt;
++ DSA_dup_DH;
++ X509_REQ_get_extensions;
++ X509_REQ_set_extension_nids;
++ BIO_nwrite;
++ X509_REQ_extension_nid;
++ BIO_nread;
++ X509_REQ_get_extension_nids;
++ BIO_nwrite0;
++ X509_REQ_add_extensions_nid;
++ BIO_nread0;
++ X509_REQ_add_extensions;
++ BIO_new_mem_buf;
++ DH_set_ex_data;
++ DH_set_method;
++ DSA_OpenSSL;
++ DH_get_ex_data;
++ DH_get_ex_new_index;
++ DSA_new_method;
++ DH_new_method;
++ DH_OpenSSL;
++ DSA_get_ex_new_index;
++ DH_get_default_method;
++ DSA_set_ex_data;
++ DH_set_default_method;
++ DSA_get_ex_data;
++ X509V3_EXT_REQ_add_conf;
++ NETSCAPE_SPKI_print;
++ NETSCAPE_SPKI_set_pubkey;
++ NETSCAPE_SPKI_b64_encode;
++ NETSCAPE_SPKI_get_pubkey;
++ NETSCAPE_SPKI_b64_decode;
++ UTF8_putc;
++ UTF8_getc;
++ RSA_null_method;
++ ASN1_tag2str;
++ BIO_ctrl_reset_read_request;
++ DISPLAYTEXT_new;
++ ASN1_GENERALIZEDTIME_free;
++ X509_REVOKED_get_ext_d2i;
++ X509_set_ex_data;
++ X509_reject_set_bit_asc;
++ X509_NAME_add_entry_by_txt;
++ X509_NAME_add_entry_by_NID;
++ X509_PURPOSE_get0;
++ PEM_read_X509_AUX;
++ d2i_AUTHORITY_INFO_ACCESS;
++ PEM_write_PUBKEY;
++ ACCESS_DESCRIPTION_new;
++ X509_CERT_AUX_free;
++ d2i_ACCESS_DESCRIPTION;
++ X509_trust_clear;
++ X509_TRUST_add;
++ ASN1_VISIBLESTRING_new;
++ X509_alias_set1;
++ ASN1_PRINTABLESTRING_free;
++ EVP_PKEY_get1_DSA;
++ ASN1_BMPSTRING_new;
++ ASN1_mbstring_copy;
++ ASN1_UTF8STRING_new;
++ DSA_get_default_method;
++ i2d_ASN1_SET_OF_ACCESS_DESCRIPTION;
++ ASN1_T61STRING_free;
++ DSA_set_method;
++ X509_get_ex_data;
++ ASN1_STRING_type;
++ X509_PURPOSE_get_by_sname;
++ ASN1_TIME_free;
++ ASN1_OCTET_STRING_cmp;
++ ASN1_BIT_STRING_new;
++ X509_get_ext_d2i;
++ PEM_read_bio_X509_AUX;
++ ASN1_STRING_set_default_mask_asc;
++ ASN1_STRING_set_def_mask_asc;
++ PEM_write_bio_RSA_PUBKEY;
++ ASN1_INTEGER_cmp;
++ d2i_RSA_PUBKEY_fp;
++ X509_trust_set_bit_asc;
++ PEM_write_bio_DSA_PUBKEY;
++ X509_STORE_CTX_free;
++ EVP_PKEY_set1_DSA;
++ i2d_DSA_PUBKEY_fp;
++ X509_load_cert_crl_file;
++ ASN1_TIME_new;
++ i2d_RSA_PUBKEY;
++ X509_STORE_CTX_purpose_inherit;
++ PEM_read_RSA_PUBKEY;
++ d2i_X509_AUX;
++ i2d_DSA_PUBKEY;
++ X509_CERT_AUX_print;
++ PEM_read_DSA_PUBKEY;
++ i2d_RSA_PUBKEY_bio;
++ ASN1_BIT_STRING_num_asc;
++ i2d_PUBKEY;
++ ASN1_UTCTIME_free;
++ DSA_set_default_method;
++ X509_PURPOSE_get_by_id;
++ ACCESS_DESCRIPTION_free;
++ PEM_read_bio_PUBKEY;
++ ASN1_STRING_set_by_NID;
++ X509_PURPOSE_get_id;
++ DISPLAYTEXT_free;
++ OTHERNAME_new;
++ X509_CERT_AUX_new;
++ X509_TRUST_cleanup;
++ X509_NAME_add_entry_by_OBJ;
++ X509_CRL_get_ext_d2i;
++ X509_PURPOSE_get0_name;
++ PEM_read_PUBKEY;
++ i2d_DSA_PUBKEY_bio;
++ i2d_OTHERNAME;
++ ASN1_OCTET_STRING_free;
++ ASN1_BIT_STRING_set_asc;
++ X509_get_ex_new_index;
++ ASN1_STRING_TABLE_cleanup;
++ X509_TRUST_get_by_id;
++ X509_PURPOSE_get_trust;
++ ASN1_STRING_length;
++ d2i_ASN1_SET_OF_ACCESS_DESCRIPTION;
++ ASN1_PRINTABLESTRING_new;
++ X509V3_get_d2i;
++ ASN1_ENUMERATED_free;
++ i2d_X509_CERT_AUX;
++ X509_STORE_CTX_set_trust;
++ ASN1_STRING_set_default_mask;
++ X509_STORE_CTX_new;
++ EVP_PKEY_get1_RSA;
++ DIRECTORYSTRING_free;
++ PEM_write_X509_AUX;
++ ASN1_OCTET_STRING_set;
++ d2i_DSA_PUBKEY_fp;
++ d2i_RSA_PUBKEY;
++ X509_TRUST_get0_name;
++ X509_TRUST_get0;
++ AUTHORITY_INFO_ACCESS_free;
++ ASN1_IA5STRING_new;
++ d2i_DSA_PUBKEY;
++ X509_check_purpose;
++ ASN1_ENUMERATED_new;
++ d2i_RSA_PUBKEY_bio;
++ d2i_PUBKEY;
++ X509_TRUST_get_trust;
++ X509_TRUST_get_flags;
++ ASN1_BMPSTRING_free;
++ ASN1_T61STRING_new;
++ ASN1_UTCTIME_new;
++ i2d_AUTHORITY_INFO_ACCESS;
++ EVP_PKEY_set1_RSA;
++ X509_STORE_CTX_set_purpose;
++ ASN1_IA5STRING_free;
++ PEM_write_bio_X509_AUX;
++ X509_PURPOSE_get_count;
++ CRYPTO_add_info;
++ X509_NAME_ENTRY_create_by_txt;
++ ASN1_STRING_get_default_mask;
++ X509_alias_get0;
++ ASN1_STRING_data;
++ i2d_ACCESS_DESCRIPTION;
++ X509_trust_set_bit;
++ ASN1_BIT_STRING_free;
++ PEM_read_bio_RSA_PUBKEY;
++ X509_add1_reject_object;
++ X509_check_trust;
++ PEM_read_bio_DSA_PUBKEY;
++ X509_PURPOSE_add;
++ ASN1_STRING_TABLE_get;
++ ASN1_UTF8STRING_free;
++ d2i_DSA_PUBKEY_bio;
++ PEM_write_RSA_PUBKEY;
++ d2i_OTHERNAME;
++ X509_reject_set_bit;
++ PEM_write_DSA_PUBKEY;
++ X509_PURPOSE_get0_sname;
++ EVP_PKEY_set1_DH;
++ ASN1_OCTET_STRING_dup;
++ ASN1_BIT_STRING_set;
++ X509_TRUST_get_count;
++ ASN1_INTEGER_free;
++ OTHERNAME_free;
++ i2d_RSA_PUBKEY_fp;
++ ASN1_INTEGER_dup;
++ d2i_X509_CERT_AUX;
++ PEM_write_bio_PUBKEY;
++ ASN1_VISIBLESTRING_free;
++ X509_PURPOSE_cleanup;
++ ASN1_mbstring_ncopy;
++ ASN1_GENERALIZEDTIME_new;
++ EVP_PKEY_get1_DH;
++ ASN1_OCTET_STRING_new;
++ ASN1_INTEGER_new;
++ i2d_X509_AUX;
++ ASN1_BIT_STRING_name_print;
++ X509_cmp;
++ ASN1_STRING_length_set;
++ DIRECTORYSTRING_new;
++ X509_add1_trust_object;
++ PKCS12_newpass;
++ SMIME_write_PKCS7;
++ SMIME_read_PKCS7;
++ DES_set_key_checked;
++ PKCS7_verify;
++ PKCS7_encrypt;
++ DES_set_key_unchecked;
++ SMIME_crlf_copy;
++ i2d_ASN1_PRINTABLESTRING;
++ PKCS7_get0_signers;
++ PKCS7_decrypt;
++ SMIME_text;
++ PKCS7_simple_smimecap;
++ PKCS7_get_smimecap;
++ PKCS7_sign;
++ PKCS7_add_attrib_smimecap;
++ CRYPTO_dbg_set_options;
++ CRYPTO_remove_all_info;
++ CRYPTO_get_mem_debug_functions;
++ CRYPTO_is_mem_check_on;
++ CRYPTO_set_mem_debug_functions;
++ CRYPTO_pop_info;
++ CRYPTO_push_info_;
++ CRYPTO_set_mem_debug_options;
++ PEM_write_PKCS8PrivateKey_nid;
++ PEM_write_bio_PKCS8PrivateKey_nid;
++ PEM_write_bio_PKCS8PrivKey_nid;
++ d2i_PKCS8PrivateKey_bio;
++ ASN1_NULL_free;
++ d2i_ASN1_NULL;
++ ASN1_NULL_new;
++ i2d_PKCS8PrivateKey_bio;
++ i2d_PKCS8PrivateKey_fp;
++ i2d_ASN1_NULL;
++ i2d_PKCS8PrivateKey_nid_fp;
++ d2i_PKCS8PrivateKey_fp;
++ i2d_PKCS8PrivateKey_nid_bio;
++ i2d_PKCS8PrivateKeyInfo_fp;
++ i2d_PKCS8PrivateKeyInfo_bio;
++ PEM_cb;
++ i2d_PrivateKey_fp;
++ d2i_PrivateKey_bio;
++ d2i_PrivateKey_fp;
++ i2d_PrivateKey_bio;
++ X509_reject_clear;
++ X509_TRUST_set_default;
++ d2i_AutoPrivateKey;
++ X509_ATTRIBUTE_get0_type;
++ X509_ATTRIBUTE_set1_data;
++ X509at_get_attr;
++ X509at_get_attr_count;
++ X509_ATTRIBUTE_create_by_NID;
++ X509_ATTRIBUTE_set1_object;
++ X509_ATTRIBUTE_count;
++ X509_ATTRIBUTE_create_by_OBJ;
++ X509_ATTRIBUTE_get0_object;
++ X509at_get_attr_by_NID;
++ X509at_add1_attr;
++ X509_ATTRIBUTE_get0_data;
++ X509at_delete_attr;
++ X509at_get_attr_by_OBJ;
++ RAND_add;
++ BIO_number_written;
++ BIO_number_read;
++ X509_STORE_CTX_get1_chain;
++ ERR_load_RAND_strings;
++ RAND_pseudo_bytes;
++ X509_REQ_get_attr_by_NID;
++ X509_REQ_get_attr;
++ X509_REQ_add1_attr_by_NID;
++ X509_REQ_get_attr_by_OBJ;
++ X509at_add1_attr_by_NID;
++ X509_REQ_add1_attr_by_OBJ;
++ X509_REQ_get_attr_count;
++ X509_REQ_add1_attr;
++ X509_REQ_delete_attr;
++ X509at_add1_attr_by_OBJ;
++ X509_REQ_add1_attr_by_txt;
++ X509_ATTRIBUTE_create_by_txt;
++ X509at_add1_attr_by_txt;
++ BN_pseudo_rand;
++ BN_is_prime_fasttest;
++ BN_CTX_end;
++ BN_CTX_start;
++ BN_CTX_get;
++ EVP_PKEY2PKCS8_broken;
++ ASN1_STRING_TABLE_add;
++ CRYPTO_dbg_get_options;
++ AUTHORITY_INFO_ACCESS_new;
++ CRYPTO_get_mem_debug_options;
++ DES_crypt;
++ PEM_write_bio_X509_REQ_NEW;
++ PEM_write_X509_REQ_NEW;
++ BIO_callback_ctrl;
++ RAND_egd;
++ RAND_status;
++ bn_dump1;
++ DES_check_key_parity;
++ lh_num_items;
++ RAND_event;
++ DSO_new;
++ DSO_new_method;
++ DSO_free;
++ DSO_flags;
++ DSO_up;
++ DSO_set_default_method;
++ DSO_get_default_method;
++ DSO_get_method;
++ DSO_set_method;
++ DSO_load;
++ DSO_bind_var;
++ DSO_METHOD_null;
++ DSO_METHOD_openssl;
++ DSO_METHOD_dlfcn;
++ DSO_METHOD_win32;
++ ERR_load_DSO_strings;
++ DSO_METHOD_dl;
++ NCONF_load;
++ NCONF_load_fp;
++ NCONF_new;
++ NCONF_get_string;
++ NCONF_free;
++ NCONF_get_number;
++ CONF_dump_fp;
++ NCONF_load_bio;
++ NCONF_dump_fp;
++ NCONF_get_section;
++ NCONF_dump_bio;
++ CONF_dump_bio;
++ NCONF_free_data;
++ CONF_set_default_method;
++ ERR_error_string_n;
++ BIO_snprintf;
++ DSO_ctrl;
++ i2d_ASN1_SET_OF_ASN1_INTEGER;
++ i2d_ASN1_SET_OF_PKCS12_SAFEBAG;
++ i2d_ASN1_SET_OF_PKCS7;
++ BIO_vfree;
++ d2i_ASN1_SET_OF_ASN1_INTEGER;
++ d2i_ASN1_SET_OF_PKCS12_SAFEBAG;
++ ASN1_UTCTIME_get;
++ X509_REQ_digest;
++ X509_CRL_digest;
++ d2i_ASN1_SET_OF_PKCS7;
++ EVP_CIPHER_CTX_set_key_length;
++ EVP_CIPHER_CTX_ctrl;
++ BN_mod_exp_mont_word;
++ RAND_egd_bytes;
++ X509_REQ_get1_email;
++ X509_get1_email;
++ X509_email_free;
++ i2d_RSA_NET;
++ d2i_RSA_NET_2;
++ d2i_RSA_NET;
++ DSO_bind_func;
++ CRYPTO_get_new_dynlockid;
++ sk_new_null;
++ CRYPTO_set_dynlock_destroy_callback;
++ CRYPTO_set_dynlock_destroy_cb;
++ CRYPTO_destroy_dynlockid;
++ CRYPTO_set_dynlock_size;
++ CRYPTO_set_dynlock_create_callback;
++ CRYPTO_set_dynlock_create_cb;
++ CRYPTO_set_dynlock_lock_callback;
++ CRYPTO_set_dynlock_lock_cb;
++ CRYPTO_get_dynlock_lock_callback;
++ CRYPTO_get_dynlock_lock_cb;
++ CRYPTO_get_dynlock_destroy_callback;
++ CRYPTO_get_dynlock_destroy_cb;
++ CRYPTO_get_dynlock_value;
++ CRYPTO_get_dynlock_create_callback;
++ CRYPTO_get_dynlock_create_cb;
++ c2i_ASN1_BIT_STRING;
++ i2c_ASN1_BIT_STRING;
++ RAND_poll;
++ c2i_ASN1_INTEGER;
++ i2c_ASN1_INTEGER;
++ BIO_dump_indent;
++ ASN1_parse_dump;
++ c2i_ASN1_OBJECT;
++ X509_NAME_print_ex_fp;
++ ASN1_STRING_print_ex_fp;
++ X509_NAME_print_ex;
++ ASN1_STRING_print_ex;
++ MD4;
++ MD4_Transform;
++ MD4_Final;
++ MD4_Update;
++ MD4_Init;
++ EVP_md4;
++ i2d_PUBKEY_bio;
++ i2d_PUBKEY_fp;
++ d2i_PUBKEY_bio;
++ ASN1_STRING_to_UTF8;
++ BIO_vprintf;
++ BIO_vsnprintf;
++ d2i_PUBKEY_fp;
++ X509_cmp_time;
++ X509_STORE_CTX_set_time;
++ X509_STORE_CTX_get1_issuer;
++ X509_OBJECT_retrieve_match;
++ X509_OBJECT_idx_by_subject;
++ X509_STORE_CTX_set_flags;
++ X509_STORE_CTX_trusted_stack;
++ X509_time_adj;
++ X509_check_issued;
++ ASN1_UTCTIME_cmp_time_t;
++ DES_set_weak_key_flag;
++ DES_check_key;
++ DES_rw_mode;
++ RSA_PKCS1_RSAref;
++ X509_keyid_set1;
++ BIO_next;
++ DSO_METHOD_vms;
++ BIO_f_linebuffer;
++ BN_bntest_rand;
++ OPENSSL_issetugid;
++ BN_rand_range;
++ ERR_load_ENGINE_strings;
++ ENGINE_set_DSA;
++ ENGINE_get_finish_function;
++ ENGINE_get_default_RSA;
++ ENGINE_get_BN_mod_exp;
++ DSA_get_default_openssl_method;
++ ENGINE_set_DH;
++ ENGINE_set_def_BN_mod_exp_crt;
++ ENGINE_set_default_BN_mod_exp_crt;
++ ENGINE_init;
++ DH_get_default_openssl_method;
++ RSA_set_default_openssl_method;
++ ENGINE_finish;
++ ENGINE_load_public_key;
++ ENGINE_get_DH;
++ ENGINE_ctrl;
++ ENGINE_get_init_function;
++ ENGINE_set_init_function;
++ ENGINE_set_default_DSA;
++ ENGINE_get_name;
++ ENGINE_get_last;
++ ENGINE_get_prev;
++ ENGINE_get_default_DH;
++ ENGINE_get_RSA;
++ ENGINE_set_default;
++ ENGINE_get_RAND;
++ ENGINE_get_first;
++ ENGINE_by_id;
++ ENGINE_set_finish_function;
++ ENGINE_get_def_BN_mod_exp_crt;
++ ENGINE_get_default_BN_mod_exp_crt;
++ RSA_get_default_openssl_method;
++ ENGINE_set_RSA;
++ ENGINE_load_private_key;
++ ENGINE_set_default_RAND;
++ ENGINE_set_BN_mod_exp;
++ ENGINE_remove;
++ ENGINE_free;
++ ENGINE_get_BN_mod_exp_crt;
++ ENGINE_get_next;
++ ENGINE_set_name;
++ ENGINE_get_default_DSA;
++ ENGINE_set_default_BN_mod_exp;
++ ENGINE_set_default_RSA;
++ ENGINE_get_default_RAND;
++ ENGINE_get_default_BN_mod_exp;
++ ENGINE_set_RAND;
++ ENGINE_set_id;
++ ENGINE_set_BN_mod_exp_crt;
++ ENGINE_set_default_DH;
++ ENGINE_new;
++ ENGINE_get_id;
++ DSA_set_default_openssl_method;
++ ENGINE_add;
++ DH_set_default_openssl_method;
++ ENGINE_get_DSA;
++ ENGINE_get_ctrl_function;
++ ENGINE_set_ctrl_function;
++ BN_pseudo_rand_range;
++ X509_STORE_CTX_set_verify_cb;
++ ERR_load_COMP_strings;
++ PKCS12_item_decrypt_d2i;
++ ASN1_UTF8STRING_it;
++ ENGINE_unregister_ciphers;
++ ENGINE_get_ciphers;
++ d2i_OCSP_BASICRESP;
++ KRB5_CHECKSUM_it;
++ EC_POINT_add;
++ ASN1_item_ex_i2d;
++ OCSP_CERTID_it;
++ d2i_OCSP_RESPBYTES;
++ X509V3_add1_i2d;
++ PKCS7_ENVELOPE_it;
++ UI_add_input_boolean;
++ ENGINE_unregister_RSA;
++ X509V3_EXT_nconf;
++ ASN1_GENERALSTRING_free;
++ d2i_OCSP_CERTSTATUS;
++ X509_REVOKED_set_serialNumber;
++ X509_print_ex;
++ OCSP_ONEREQ_get1_ext_d2i;
++ ENGINE_register_all_RAND;
++ ENGINE_load_dynamic;
++ PBKDF2PARAM_it;
++ EXTENDED_KEY_USAGE_new;
++ EC_GROUP_clear_free;
++ OCSP_sendreq_bio;
++ ASN1_item_digest;
++ OCSP_BASICRESP_delete_ext;
++ OCSP_SIGNATURE_it;
++ X509_CRL_it;
++ OCSP_BASICRESP_add_ext;
++ KRB5_ENCKEY_it;
++ UI_method_set_closer;
++ X509_STORE_set_purpose;
++ i2d_ASN1_GENERALSTRING;
++ OCSP_response_status;
++ i2d_OCSP_SERVICELOC;
++ ENGINE_get_digest_engine;
++ EC_GROUP_set_curve_GFp;
++ OCSP_REQUEST_get_ext_by_OBJ;
++ _ossl_old_des_random_key;
++ ASN1_T61STRING_it;
++ EC_GROUP_method_of;
++ i2d_KRB5_APREQ;
++ _ossl_old_des_encrypt;
++ ASN1_PRINTABLE_new;
++ HMAC_Init_ex;
++ d2i_KRB5_AUTHENT;
++ OCSP_archive_cutoff_new;
++ EC_POINT_set_Jprojective_coordinates_GFp;
++ EC_POINT_set_Jproj_coords_GFp;
++ _ossl_old_des_is_weak_key;
++ OCSP_BASICRESP_get_ext_by_OBJ;
++ EC_POINT_oct2point;
++ OCSP_SINGLERESP_get_ext_count;
++ UI_ctrl;
++ _shadow_DES_rw_mode;
++ asn1_do_adb;
++ ASN1_template_i2d;
++ ENGINE_register_DH;
++ UI_construct_prompt;
++ X509_STORE_set_trust;
++ UI_dup_input_string;
++ d2i_KRB5_APREQ;
++ EVP_MD_CTX_copy_ex;
++ OCSP_request_is_signed;
++ i2d_OCSP_REQINFO;
++ KRB5_ENCKEY_free;
++ OCSP_resp_get0;
++ GENERAL_NAME_it;
++ ASN1_GENERALIZEDTIME_it;
++ X509_STORE_set_flags;
++ EC_POINT_set_compressed_coordinates_GFp;
++ EC_POINT_set_compr_coords_GFp;
++ OCSP_response_status_str;
++ d2i_OCSP_REVOKEDINFO;
++ OCSP_basic_add1_cert;
++ ERR_get_implementation;
++ EVP_CipherFinal_ex;
++ OCSP_CERTSTATUS_new;
++ CRYPTO_cleanup_all_ex_data;
++ OCSP_resp_find;
++ BN_nnmod;
++ X509_CRL_sort;
++ X509_REVOKED_set_revocationDate;
++ ENGINE_register_RAND;
++ OCSP_SERVICELOC_new;
++ EC_POINT_set_affine_coordinates_GFp;
++ EC_POINT_set_affine_coords_GFp;
++ _ossl_old_des_options;
++ SXNET_it;
++ UI_dup_input_boolean;
++ PKCS12_add_CSPName_asc;
++ EC_POINT_is_at_infinity;
++ ENGINE_load_cryptodev;
++ DSO_convert_filename;
++ POLICYQUALINFO_it;
++ ENGINE_register_ciphers;
++ BN_mod_lshift_quick;
++ DSO_set_filename;
++ ASN1_item_free;
++ KRB5_TKTBODY_free;
++ AUTHORITY_KEYID_it;
++ KRB5_APREQBODY_new;
++ X509V3_EXT_REQ_add_nconf;
++ ENGINE_ctrl_cmd_string;
++ i2d_OCSP_RESPDATA;
++ EVP_MD_CTX_init;
++ EXTENDED_KEY_USAGE_free;
++ PKCS7_ATTR_SIGN_it;
++ UI_add_error_string;
++ KRB5_CHECKSUM_free;
++ OCSP_REQUEST_get_ext;
++ ENGINE_load_ubsec;
++ ENGINE_register_all_digests;
++ PKEY_USAGE_PERIOD_it;
++ PKCS12_unpack_authsafes;
++ ASN1_item_unpack;
++ NETSCAPE_SPKAC_it;
++ X509_REVOKED_it;
++ ASN1_STRING_encode;
++ EVP_aes_128_ecb;
++ KRB5_AUTHENT_free;
++ OCSP_BASICRESP_get_ext_by_critical;
++ OCSP_BASICRESP_get_ext_by_crit;
++ OCSP_cert_status_str;
++ d2i_OCSP_REQUEST;
++ UI_dup_info_string;
++ _ossl_old_des_xwhite_in2out;
++ PKCS12_it;
++ OCSP_SINGLERESP_get_ext_by_critical;
++ OCSP_SINGLERESP_get_ext_by_crit;
++ OCSP_CERTSTATUS_free;
++ _ossl_old_des_crypt;
++ ASN1_item_i2d;
++ EVP_DecryptFinal_ex;
++ ENGINE_load_openssl;
++ ENGINE_get_cmd_defns;
++ ENGINE_set_load_privkey_function;
++ ENGINE_set_load_privkey_fn;
++ EVP_EncryptFinal_ex;
++ ENGINE_set_default_digests;
++ X509_get0_pubkey_bitstr;
++ asn1_ex_i2c;
++ ENGINE_register_RSA;
++ ENGINE_unregister_DSA;
++ _ossl_old_des_key_sched;
++ X509_EXTENSION_it;
++ i2d_KRB5_AUTHENT;
++ SXNETID_it;
++ d2i_OCSP_SINGLERESP;
++ EDIPARTYNAME_new;
++ PKCS12_certbag2x509;
++ _ossl_old_des_ofb64_encrypt;
++ d2i_EXTENDED_KEY_USAGE;
++ ERR_print_errors_cb;
++ ENGINE_set_ciphers;
++ d2i_KRB5_APREQBODY;
++ UI_method_get_flusher;
++ X509_PUBKEY_it;
++ _ossl_old_des_enc_read;
++ PKCS7_ENCRYPT_it;
++ i2d_OCSP_RESPONSE;
++ EC_GROUP_get_cofactor;
++ PKCS12_unpack_p7data;
++ d2i_KRB5_AUTHDATA;
++ OCSP_copy_nonce;
++ KRB5_AUTHDATA_new;
++ OCSP_RESPDATA_new;
++ EC_GFp_mont_method;
++ OCSP_REVOKEDINFO_free;
++ UI_get_ex_data;
++ KRB5_APREQBODY_free;
++ EC_GROUP_get0_generator;
++ UI_get_default_method;
++ X509V3_set_nconf;
++ PKCS12_item_i2d_encrypt;
++ X509_add1_ext_i2d;
++ PKCS7_SIGNER_INFO_it;
++ KRB5_PRINCNAME_new;
++ PKCS12_SAFEBAG_it;
++ EC_GROUP_get_order;
++ d2i_OCSP_RESPID;
++ OCSP_request_verify;
++ NCONF_get_number_e;
++ _ossl_old_des_decrypt3;
++ X509_signature_print;
++ OCSP_SINGLERESP_free;
++ ENGINE_load_builtin_engines;
++ i2d_OCSP_ONEREQ;
++ OCSP_REQUEST_add_ext;
++ OCSP_RESPBYTES_new;
++ EVP_MD_CTX_create;
++ OCSP_resp_find_status;
++ X509_ALGOR_it;
++ ASN1_TIME_it;
++ OCSP_request_set1_name;
++ OCSP_ONEREQ_get_ext_count;
++ UI_get0_result;
++ PKCS12_AUTHSAFES_it;
++ EVP_aes_256_ecb;
++ PKCS12_pack_authsafes;
++ ASN1_IA5STRING_it;
++ UI_get_input_flags;
++ EC_GROUP_set_generator;
++ _ossl_old_des_string_to_2keys;
++ OCSP_CERTID_free;
++ X509_CERT_AUX_it;
++ CERTIFICATEPOLICIES_it;
++ _ossl_old_des_ede3_cbc_encrypt;
++ RAND_set_rand_engine;
++ DSO_get_loaded_filename;
++ X509_ATTRIBUTE_it;
++ OCSP_ONEREQ_get_ext_by_NID;
++ PKCS12_decrypt_skey;
++ KRB5_AUTHENT_it;
++ UI_dup_error_string;
++ RSAPublicKey_it;
++ i2d_OCSP_REQUEST;
++ PKCS12_x509crl2certbag;
++ OCSP_SERVICELOC_it;
++ ASN1_item_sign;
++ X509_CRL_set_issuer_name;
++ OBJ_NAME_do_all_sorted;
++ i2d_OCSP_BASICRESP;
++ i2d_OCSP_RESPBYTES;
++ PKCS12_unpack_p7encdata;
++ HMAC_CTX_init;
++ ENGINE_get_digest;
++ OCSP_RESPONSE_print;
++ KRB5_TKTBODY_it;
++ ACCESS_DESCRIPTION_it;
++ PKCS7_ISSUER_AND_SERIAL_it;
++ PBE2PARAM_it;
++ PKCS12_certbag2x509crl;
++ PKCS7_SIGNED_it;
++ ENGINE_get_cipher;
++ i2d_OCSP_CRLID;
++ OCSP_SINGLERESP_new;
++ ENGINE_cmd_is_executable;
++ RSA_up_ref;
++ ASN1_GENERALSTRING_it;
++ ENGINE_register_DSA;
++ X509V3_EXT_add_nconf_sk;
++ ENGINE_set_load_pubkey_function;
++ PKCS8_decrypt;
++ PEM_bytes_read_bio;
++ DIRECTORYSTRING_it;
++ d2i_OCSP_CRLID;
++ EC_POINT_is_on_curve;
++ CRYPTO_set_locked_mem_ex_functions;
++ CRYPTO_set_locked_mem_ex_funcs;
++ d2i_KRB5_CHECKSUM;
++ ASN1_item_dup;
++ X509_it;
++ BN_mod_add;
++ KRB5_AUTHDATA_free;
++ _ossl_old_des_cbc_cksum;
++ ASN1_item_verify;
++ CRYPTO_set_mem_ex_functions;
++ EC_POINT_get_Jprojective_coordinates_GFp;
++ EC_POINT_get_Jproj_coords_GFp;
++ ZLONG_it;
++ CRYPTO_get_locked_mem_ex_functions;
++ CRYPTO_get_locked_mem_ex_funcs;
++ ASN1_TIME_check;
++ UI_get0_user_data;
++ HMAC_CTX_cleanup;
++ DSA_up_ref;
++ _ossl_old_des_ede3_cfb64_encrypt;
++ _ossl_odes_ede3_cfb64_encrypt;
++ ASN1_BMPSTRING_it;
++ ASN1_tag2bit;
++ UI_method_set_flusher;
++ X509_ocspid_print;
++ KRB5_ENCDATA_it;
++ ENGINE_get_load_pubkey_function;
++ UI_add_user_data;
++ OCSP_REQUEST_delete_ext;
++ UI_get_method;
++ OCSP_ONEREQ_free;
++ ASN1_PRINTABLESTRING_it;
++ X509_CRL_set_nextUpdate;
++ OCSP_REQUEST_it;
++ OCSP_BASICRESP_it;
++ AES_ecb_encrypt;
++ BN_mod_sqr;
++ NETSCAPE_CERT_SEQUENCE_it;
++ GENERAL_NAMES_it;
++ AUTHORITY_INFO_ACCESS_it;
++ ASN1_FBOOLEAN_it;
++ UI_set_ex_data;
++ _ossl_old_des_string_to_key;
++ ENGINE_register_all_RSA;
++ d2i_KRB5_PRINCNAME;
++ OCSP_RESPBYTES_it;
++ X509_CINF_it;
++ ENGINE_unregister_digests;
++ d2i_EDIPARTYNAME;
++ d2i_OCSP_SERVICELOC;
++ ENGINE_get_digests;
++ _ossl_old_des_set_odd_parity;
++ OCSP_RESPDATA_free;
++ d2i_KRB5_TICKET;
++ OTHERNAME_it;
++ EVP_MD_CTX_cleanup;
++ d2i_ASN1_GENERALSTRING;
++ X509_CRL_set_version;
++ BN_mod_sub;
++ OCSP_SINGLERESP_get_ext_by_NID;
++ ENGINE_get_ex_new_index;
++ OCSP_REQUEST_free;
++ OCSP_REQUEST_add1_ext_i2d;
++ X509_VAL_it;
++ EC_POINTs_make_affine;
++ EC_POINT_mul;
++ X509V3_EXT_add_nconf;
++ X509_TRUST_set;
++ X509_CRL_add1_ext_i2d;
++ _ossl_old_des_fcrypt;
++ DISPLAYTEXT_it;
++ X509_CRL_set_lastUpdate;
++ OCSP_BASICRESP_free;
++ OCSP_BASICRESP_add1_ext_i2d;
++ d2i_KRB5_AUTHENTBODY;
++ CRYPTO_set_ex_data_implementation;
++ CRYPTO_set_ex_data_impl;
++ KRB5_ENCDATA_new;
++ DSO_up_ref;
++ OCSP_crl_reason_str;
++ UI_get0_result_string;
++ ASN1_GENERALSTRING_new;
++ X509_SIG_it;
++ ERR_set_implementation;
++ ERR_load_EC_strings;
++ UI_get0_action_string;
++ OCSP_ONEREQ_get_ext;
++ EC_POINT_method_of;
++ i2d_KRB5_APREQBODY;
++ _ossl_old_des_ecb3_encrypt;
++ CRYPTO_get_mem_ex_functions;
++ ENGINE_get_ex_data;
++ UI_destroy_method;
++ ASN1_item_i2d_bio;
++ OCSP_ONEREQ_get_ext_by_OBJ;
++ ASN1_primitive_new;
++ ASN1_PRINTABLE_it;
++ EVP_aes_192_ecb;
++ OCSP_SIGNATURE_new;
++ LONG_it;
++ ASN1_VISIBLESTRING_it;
++ OCSP_SINGLERESP_add1_ext_i2d;
++ d2i_OCSP_CERTID;
++ ASN1_item_d2i_fp;
++ CRL_DIST_POINTS_it;
++ GENERAL_NAME_print;
++ OCSP_SINGLERESP_delete_ext;
++ PKCS12_SAFEBAGS_it;
++ d2i_OCSP_SIGNATURE;
++ OCSP_request_add1_nonce;
++ ENGINE_set_cmd_defns;
++ OCSP_SERVICELOC_free;
++ EC_GROUP_free;
++ ASN1_BIT_STRING_it;
++ X509_REQ_it;
++ _ossl_old_des_cbc_encrypt;
++ ERR_unload_strings;
++ PKCS7_SIGN_ENVELOPE_it;
++ EDIPARTYNAME_free;
++ OCSP_REQINFO_free;
++ EC_GROUP_new_curve_GFp;
++ OCSP_REQUEST_get1_ext_d2i;
++ PKCS12_item_pack_safebag;
++ asn1_ex_c2i;
++ ENGINE_register_digests;
++ i2d_OCSP_REVOKEDINFO;
++ asn1_enc_restore;
++ UI_free;
++ UI_new_method;
++ EVP_EncryptInit_ex;
++ X509_pubkey_digest;
++ EC_POINT_invert;
++ OCSP_basic_sign;
++ i2d_OCSP_RESPID;
++ OCSP_check_nonce;
++ ENGINE_ctrl_cmd;
++ d2i_KRB5_ENCKEY;
++ OCSP_parse_url;
++ OCSP_SINGLERESP_get_ext;
++ OCSP_CRLID_free;
++ OCSP_BASICRESP_get1_ext_d2i;
++ RSAPrivateKey_it;
++ ENGINE_register_all_DH;
++ i2d_EDIPARTYNAME;
++ EC_POINT_get_affine_coordinates_GFp;
++ EC_POINT_get_affine_coords_GFp;
++ OCSP_CRLID_new;
++ ENGINE_get_flags;
++ OCSP_ONEREQ_it;
++ UI_process;
++ ASN1_INTEGER_it;
++ EVP_CipherInit_ex;
++ UI_get_string_type;
++ ENGINE_unregister_DH;
++ ENGINE_register_all_DSA;
++ OCSP_ONEREQ_get_ext_by_critical;
++ bn_dup_expand;
++ OCSP_cert_id_new;
++ BASIC_CONSTRAINTS_it;
++ BN_mod_add_quick;
++ EC_POINT_new;
++ EVP_MD_CTX_destroy;
++ OCSP_RESPBYTES_free;
++ EVP_aes_128_cbc;
++ OCSP_SINGLERESP_get1_ext_d2i;
++ EC_POINT_free;
++ DH_up_ref;
++ X509_NAME_ENTRY_it;
++ UI_get_ex_new_index;
++ BN_mod_sub_quick;
++ OCSP_ONEREQ_add_ext;
++ OCSP_request_sign;
++ EVP_DigestFinal_ex;
++ ENGINE_set_digests;
++ OCSP_id_issuer_cmp;
++ OBJ_NAME_do_all;
++ EC_POINTs_mul;
++ ENGINE_register_complete;
++ X509V3_EXT_nconf_nid;
++ ASN1_SEQUENCE_it;
++ UI_set_default_method;
++ RAND_query_egd_bytes;
++ UI_method_get_writer;
++ UI_OpenSSL;
++ PEM_def_callback;
++ ENGINE_cleanup;
++ DIST_POINT_it;
++ OCSP_SINGLERESP_it;
++ d2i_KRB5_TKTBODY;
++ EC_POINT_cmp;
++ OCSP_REVOKEDINFO_new;
++ i2d_OCSP_CERTSTATUS;
++ OCSP_basic_add1_nonce;
++ ASN1_item_ex_d2i;
++ BN_mod_lshift1_quick;
++ UI_set_method;
++ OCSP_id_get0_info;
++ BN_mod_sqrt;
++ EC_GROUP_copy;
++ KRB5_ENCDATA_free;
++ _ossl_old_des_cfb_encrypt;
++ OCSP_SINGLERESP_get_ext_by_OBJ;
++ OCSP_cert_to_id;
++ OCSP_RESPID_new;
++ OCSP_RESPDATA_it;
++ d2i_OCSP_RESPDATA;
++ ENGINE_register_all_complete;
++ OCSP_check_validity;
++ PKCS12_BAGS_it;
++ OCSP_url_svcloc_new;
++ ASN1_template_free;
++ OCSP_SINGLERESP_add_ext;
++ KRB5_AUTHENTBODY_it;
++ X509_supported_extension;
++ i2d_KRB5_AUTHDATA;
++ UI_method_get_opener;
++ ENGINE_set_ex_data;
++ OCSP_REQUEST_print;
++ CBIGNUM_it;
++ KRB5_TICKET_new;
++ KRB5_APREQ_new;
++ EC_GROUP_get_curve_GFp;
++ KRB5_ENCKEY_new;
++ ASN1_template_d2i;
++ _ossl_old_des_quad_cksum;
++ OCSP_single_get0_status;
++ BN_swap;
++ POLICYINFO_it;
++ ENGINE_set_destroy_function;
++ asn1_enc_free;
++ OCSP_RESPID_it;
++ EC_GROUP_new;
++ EVP_aes_256_cbc;
++ i2d_KRB5_PRINCNAME;
++ _ossl_old_des_encrypt2;
++ _ossl_old_des_encrypt3;
++ PKCS8_PRIV_KEY_INFO_it;
++ OCSP_REQINFO_it;
++ PBEPARAM_it;
++ KRB5_AUTHENTBODY_new;
++ X509_CRL_add0_revoked;
++ EDIPARTYNAME_it;
++ NETSCAPE_SPKI_it;
++ UI_get0_test_string;
++ ENGINE_get_cipher_engine;
++ ENGINE_register_all_ciphers;
++ EC_POINT_copy;
++ BN_kronecker;
++ _ossl_old_des_ede3_ofb64_encrypt;
++ _ossl_odes_ede3_ofb64_encrypt;
++ UI_method_get_reader;
++ OCSP_BASICRESP_get_ext_count;
++ ASN1_ENUMERATED_it;
++ UI_set_result;
++ i2d_KRB5_TICKET;
++ X509_print_ex_fp;
++ EVP_CIPHER_CTX_set_padding;
++ d2i_OCSP_RESPONSE;
++ ASN1_UTCTIME_it;
++ _ossl_old_des_enc_write;
++ OCSP_RESPONSE_new;
++ AES_set_encrypt_key;
++ OCSP_resp_count;
++ KRB5_CHECKSUM_new;
++ ENGINE_load_cswift;
++ OCSP_onereq_get0_id;
++ ENGINE_set_default_ciphers;
++ NOTICEREF_it;
++ X509V3_EXT_CRL_add_nconf;
++ OCSP_REVOKEDINFO_it;
++ AES_encrypt;
++ OCSP_REQUEST_new;
++ ASN1_ANY_it;
++ CRYPTO_ex_data_new_class;
++ _ossl_old_des_ncbc_encrypt;
++ i2d_KRB5_TKTBODY;
++ EC_POINT_clear_free;
++ AES_decrypt;
++ asn1_enc_init;
++ UI_get_result_maxsize;
++ OCSP_CERTID_new;
++ ENGINE_unregister_RAND;
++ UI_method_get_closer;
++ d2i_KRB5_ENCDATA;
++ OCSP_request_onereq_count;
++ OCSP_basic_verify;
++ KRB5_AUTHENTBODY_free;
++ ASN1_item_d2i;
++ ASN1_primitive_free;
++ i2d_EXTENDED_KEY_USAGE;
++ i2d_OCSP_SIGNATURE;
++ asn1_enc_save;
++ ENGINE_load_nuron;
++ _ossl_old_des_pcbc_encrypt;
++ PKCS12_MAC_DATA_it;
++ OCSP_accept_responses_new;
++ asn1_do_lock;
++ PKCS7_ATTR_VERIFY_it;
++ KRB5_APREQBODY_it;
++ i2d_OCSP_SINGLERESP;
++ ASN1_item_ex_new;
++ UI_add_verify_string;
++ _ossl_old_des_set_key;
++ KRB5_PRINCNAME_it;
++ EVP_DecryptInit_ex;
++ i2d_OCSP_CERTID;
++ ASN1_item_d2i_bio;
++ EC_POINT_dbl;
++ asn1_get_choice_selector;
++ i2d_KRB5_CHECKSUM;
++ ENGINE_set_table_flags;
++ AES_options;
++ ENGINE_load_chil;
++ OCSP_id_cmp;
++ OCSP_BASICRESP_new;
++ OCSP_REQUEST_get_ext_by_NID;
++ KRB5_APREQ_it;
++ ENGINE_get_destroy_function;
++ CONF_set_nconf;
++ ASN1_PRINTABLE_free;
++ OCSP_BASICRESP_get_ext_by_NID;
++ DIST_POINT_NAME_it;
++ X509V3_extensions_print;
++ _ossl_old_des_cfb64_encrypt;
++ X509_REVOKED_add1_ext_i2d;
++ _ossl_old_des_ofb_encrypt;
++ KRB5_TKTBODY_new;
++ ASN1_OCTET_STRING_it;
++ ERR_load_UI_strings;
++ i2d_KRB5_ENCKEY;
++ ASN1_template_new;
++ OCSP_SIGNATURE_free;
++ ASN1_item_i2d_fp;
++ KRB5_PRINCNAME_free;
++ PKCS7_RECIP_INFO_it;
++ EXTENDED_KEY_USAGE_it;
++ EC_GFp_simple_method;
++ EC_GROUP_precompute_mult;
++ OCSP_request_onereq_get0;
++ UI_method_set_writer;
++ KRB5_AUTHENT_new;
++ X509_CRL_INFO_it;
++ DSO_set_name_converter;
++ AES_set_decrypt_key;
++ PKCS7_DIGEST_it;
++ PKCS12_x5092certbag;
++ EVP_DigestInit_ex;
++ i2a_ACCESS_DESCRIPTION;
++ OCSP_RESPONSE_it;
++ PKCS7_ENC_CONTENT_it;
++ OCSP_request_add0_id;
++ EC_POINT_make_affine;
++ DSO_get_filename;
++ OCSP_CERTSTATUS_it;
++ OCSP_request_add1_cert;
++ UI_get0_output_string;
++ UI_dup_verify_string;
++ BN_mod_lshift;
++ KRB5_AUTHDATA_it;
++ asn1_set_choice_selector;
++ OCSP_basic_add1_status;
++ OCSP_RESPID_free;
++ asn1_get_field_ptr;
++ UI_add_input_string;
++ OCSP_CRLID_it;
++ i2d_KRB5_AUTHENTBODY;
++ OCSP_REQUEST_get_ext_count;
++ ENGINE_load_atalla;
++ X509_NAME_it;
++ USERNOTICE_it;
++ OCSP_REQINFO_new;
++ OCSP_BASICRESP_get_ext;
++ CRYPTO_get_ex_data_implementation;
++ CRYPTO_get_ex_data_impl;
++ ASN1_item_pack;
++ i2d_KRB5_ENCDATA;
++ X509_PURPOSE_set;
++ X509_REQ_INFO_it;
++ UI_method_set_opener;
++ ASN1_item_ex_free;
++ ASN1_BOOLEAN_it;
++ ENGINE_get_table_flags;
++ UI_create_method;
++ OCSP_ONEREQ_add1_ext_i2d;
++ _shadow_DES_check_key;
++ d2i_OCSP_REQINFO;
++ UI_add_info_string;
++ UI_get_result_minsize;
++ ASN1_NULL_it;
++ BN_mod_lshift1;
++ d2i_OCSP_ONEREQ;
++ OCSP_ONEREQ_new;
++ KRB5_TICKET_it;
++ EVP_aes_192_cbc;
++ KRB5_TICKET_free;
++ UI_new;
++ OCSP_response_create;
++ _ossl_old_des_xcbc_encrypt;
++ PKCS7_it;
++ OCSP_REQUEST_get_ext_by_critical;
++ OCSP_REQUEST_get_ext_by_crit;
++ ENGINE_set_flags;
++ _ossl_old_des_ecb_encrypt;
++ OCSP_response_get1_basic;
++ EVP_Digest;
++ OCSP_ONEREQ_delete_ext;
++ ASN1_TBOOLEAN_it;
++ ASN1_item_new;
++ ASN1_TIME_to_generalizedtime;
++ BIGNUM_it;
++ AES_cbc_encrypt;
++ ENGINE_get_load_privkey_function;
++ ENGINE_get_load_privkey_fn;
++ OCSP_RESPONSE_free;
++ UI_method_set_reader;
++ i2d_ASN1_T61STRING;
++ EC_POINT_set_to_infinity;
++ ERR_load_OCSP_strings;
++ EC_POINT_point2oct;
++ KRB5_APREQ_free;
++ ASN1_OBJECT_it;
++ OCSP_crlID_new;
++ OCSP_crlID2_new;
++ CONF_modules_load_file;
++ CONF_imodule_set_usr_data;
++ ENGINE_set_default_string;
++ CONF_module_get_usr_data;
++ ASN1_add_oid_module;
++ CONF_modules_finish;
++ OPENSSL_config;
++ CONF_modules_unload;
++ CONF_imodule_get_value;
++ CONF_module_set_usr_data;
++ CONF_parse_list;
++ CONF_module_add;
++ CONF_get1_default_config_file;
++ CONF_imodule_get_flags;
++ CONF_imodule_get_module;
++ CONF_modules_load;
++ CONF_imodule_get_name;
++ ERR_peek_top_error;
++ CONF_imodule_get_usr_data;
++ CONF_imodule_set_flags;
++ ENGINE_add_conf_module;
++ ERR_peek_last_error_line;
++ ERR_peek_last_error_line_data;
++ ERR_peek_last_error;
++ DES_read_2passwords;
++ DES_read_password;
++ UI_UTIL_read_pw;
++ UI_UTIL_read_pw_string;
++ ENGINE_load_aep;
++ ENGINE_load_sureware;
++ OPENSSL_add_all_algorithms_noconf;
++ OPENSSL_add_all_algo_noconf;
++ OPENSSL_add_all_algorithms_conf;
++ OPENSSL_add_all_algo_conf;
++ OPENSSL_load_builtin_modules;
++ AES_ofb128_encrypt;
++ AES_ctr128_encrypt;
++ AES_cfb128_encrypt;
++ ENGINE_load_4758cca;
++ _ossl_096_des_random_seed;
++ EVP_aes_256_ofb;
++ EVP_aes_192_ofb;
++ EVP_aes_128_cfb128;
++ EVP_aes_256_cfb128;
++ EVP_aes_128_ofb;
++ EVP_aes_192_cfb128;
++ CONF_modules_free;
++ NCONF_default;
++ OPENSSL_no_config;
++ NCONF_WIN32;
++ ASN1_UNIVERSALSTRING_new;
++ EVP_des_ede_ecb;
++ i2d_ASN1_UNIVERSALSTRING;
++ ASN1_UNIVERSALSTRING_free;
++ ASN1_UNIVERSALSTRING_it;
++ d2i_ASN1_UNIVERSALSTRING;
++ EVP_des_ede3_ecb;
++ X509_REQ_print_ex;
++ ENGINE_up_ref;
++ BUF_MEM_grow_clean;
++ CRYPTO_realloc_clean;
++ BUF_strlcat;
++ BIO_indent;
++ BUF_strlcpy;
++ OpenSSLDie;
++ OPENSSL_cleanse;
++ ENGINE_setup_bsd_cryptodev;
++ ERR_release_err_state_table;
++ EVP_aes_128_cfb8;
++ FIPS_corrupt_rsa;
++ FIPS_selftest_des;
++ EVP_aes_128_cfb1;
++ EVP_aes_192_cfb8;
++ FIPS_mode_set;
++ FIPS_selftest_dsa;
++ EVP_aes_256_cfb8;
++ FIPS_allow_md5;
++ DES_ede3_cfb_encrypt;
++ EVP_des_ede3_cfb8;
++ FIPS_rand_seeded;
++ AES_cfbr_encrypt_block;
++ AES_cfb8_encrypt;
++ FIPS_rand_seed;
++ FIPS_corrupt_des;
++ EVP_aes_192_cfb1;
++ FIPS_selftest_aes;
++ FIPS_set_prng_key;
++ EVP_des_cfb8;
++ FIPS_corrupt_dsa;
++ FIPS_test_mode;
++ FIPS_rand_method;
++ EVP_aes_256_cfb1;
++ ERR_load_FIPS_strings;
++ FIPS_corrupt_aes;
++ FIPS_selftest_sha1;
++ FIPS_selftest_rsa;
++ FIPS_corrupt_sha1;
++ EVP_des_cfb1;
++ FIPS_dsa_check;
++ AES_cfb1_encrypt;
++ EVP_des_ede3_cfb1;
++ FIPS_rand_check;
++ FIPS_md5_allowed;
++ FIPS_mode;
++ FIPS_selftest_failed;
++ sk_is_sorted;
++ X509_check_ca;
++ HMAC_CTX_set_flags;
++ d2i_PROXY_CERT_INFO_EXTENSION;
++ PROXY_POLICY_it;
++ i2d_PROXY_POLICY;
++ i2d_PROXY_CERT_INFO_EXTENSION;
++ d2i_PROXY_POLICY;
++ PROXY_CERT_INFO_EXTENSION_new;
++ PROXY_CERT_INFO_EXTENSION_free;
++ PROXY_CERT_INFO_EXTENSION_it;
++ PROXY_POLICY_free;
++ PROXY_POLICY_new;
++ BN_MONT_CTX_set_locked;
++ FIPS_selftest_rng;
++ EVP_sha384;
++ EVP_sha512;
++ EVP_sha224;
++ EVP_sha256;
++ FIPS_selftest_hmac;
++ FIPS_corrupt_rng;
++ BN_mod_exp_mont_consttime;
++ RSA_X931_hash_id;
++ RSA_padding_check_X931;
++ RSA_verify_PKCS1_PSS;
++ RSA_padding_add_X931;
++ RSA_padding_add_PKCS1_PSS;
++ PKCS1_MGF1;
++ BN_X931_generate_Xpq;
++ RSA_X931_generate_key;
++ BN_X931_derive_prime;
++ BN_X931_generate_prime;
++ RSA_X931_derive;
++ BIO_new_dgram;
++ BN_get0_nist_prime_384;
++ ERR_set_mark;
++ X509_STORE_CTX_set0_crls;
++ ENGINE_set_STORE;
++ ENGINE_register_ECDSA;
++ STORE_meth_set_list_start_fn;
++ STORE_method_set_list_start_function;
++ BN_BLINDING_invert_ex;
++ NAME_CONSTRAINTS_free;
++ STORE_ATTR_INFO_set_number;
++ BN_BLINDING_get_thread_id;
++ X509_STORE_CTX_set0_param;
++ POLICY_MAPPING_it;
++ STORE_parse_attrs_start;
++ POLICY_CONSTRAINTS_free;
++ EVP_PKEY_add1_attr_by_NID;
++ BN_nist_mod_192;
++ EC_GROUP_get_trinomial_basis;
++ STORE_set_method;
++ GENERAL_SUBTREE_free;
++ NAME_CONSTRAINTS_it;
++ ECDH_get_default_method;
++ PKCS12_add_safe;
++ EC_KEY_new_by_curve_name;
++ STORE_meth_get_update_store_fn;
++ STORE_method_get_update_store_function;
++ ENGINE_register_ECDH;
++ SHA512_Update;
++ i2d_ECPrivateKey;
++ BN_get0_nist_prime_192;
++ STORE_modify_certificate;
++ EC_POINT_set_affine_coordinates_GF2m;
++ EC_POINT_set_affine_coords_GF2m;
++ BN_GF2m_mod_exp_arr;
++ STORE_ATTR_INFO_modify_number;
++ X509_keyid_get0;
++ ENGINE_load_gmp;
++ pitem_new;
++ BN_GF2m_mod_mul_arr;
++ STORE_list_public_key_endp;
++ o2i_ECPublicKey;
++ EC_KEY_copy;
++ BIO_dump_fp;
++ X509_policy_node_get0_parent;
++ EC_GROUP_check_discriminant;
++ i2o_ECPublicKey;
++ EC_KEY_precompute_mult;
++ a2i_IPADDRESS;
++ STORE_meth_set_initialise_fn;
++ STORE_method_set_initialise_function;
++ X509_STORE_CTX_set_depth;
++ X509_VERIFY_PARAM_inherit;
++ EC_POINT_point2bn;
++ STORE_ATTR_INFO_set_dn;
++ X509_policy_tree_get0_policies;
++ EC_GROUP_new_curve_GF2m;
++ STORE_destroy_method;
++ ENGINE_unregister_STORE;
++ EVP_PKEY_get1_EC_KEY;
++ STORE_ATTR_INFO_get0_number;
++ ENGINE_get_default_ECDH;
++ EC_KEY_get_conv_form;
++ ASN1_OCTET_STRING_NDEF_it;
++ STORE_delete_public_key;
++ STORE_get_public_key;
++ STORE_modify_arbitrary;
++ ENGINE_get_static_state;
++ pqueue_iterator;
++ ECDSA_SIG_new;
++ OPENSSL_DIR_end;
++ BN_GF2m_mod_sqr;
++ EC_POINT_bn2point;
++ X509_VERIFY_PARAM_set_depth;
++ EC_KEY_set_asn1_flag;
++ STORE_get_method;
++ EC_KEY_get_key_method_data;
++ ECDSA_sign_ex;
++ STORE_parse_attrs_end;
++ EC_GROUP_get_point_conversion_form;
++ EC_GROUP_get_point_conv_form;
++ STORE_method_set_store_function;
++ STORE_ATTR_INFO_in;
++ PEM_read_bio_ECPKParameters;
++ EC_GROUP_get_pentanomial_basis;
++ EVP_PKEY_add1_attr_by_txt;
++ BN_BLINDING_set_flags;
++ X509_VERIFY_PARAM_set1_policies;
++ X509_VERIFY_PARAM_set1_name;
++ X509_VERIFY_PARAM_set_purpose;
++ STORE_get_number;
++ ECDSA_sign_setup;
++ BN_GF2m_mod_solve_quad_arr;
++ EC_KEY_up_ref;
++ POLICY_MAPPING_free;
++ BN_GF2m_mod_div;
++ X509_VERIFY_PARAM_set_flags;
++ EC_KEY_free;
++ STORE_meth_set_list_next_fn;
++ STORE_method_set_list_next_function;
++ PEM_write_bio_ECPrivateKey;
++ d2i_EC_PUBKEY;
++ STORE_meth_get_generate_fn;
++ STORE_method_get_generate_function;
++ STORE_meth_set_list_end_fn;
++ STORE_method_set_list_end_function;
++ pqueue_print;
++ EC_GROUP_have_precompute_mult;
++ EC_KEY_print_fp;
++ BN_GF2m_mod_arr;
++ PEM_write_bio_X509_CERT_PAIR;
++ EVP_PKEY_cmp;
++ X509_policy_level_node_count;
++ STORE_new_engine;
++ STORE_list_public_key_start;
++ X509_VERIFY_PARAM_new;
++ ECDH_get_ex_data;
++ EVP_PKEY_get_attr;
++ ECDSA_do_sign;
++ ENGINE_unregister_ECDH;
++ ECDH_OpenSSL;
++ EC_KEY_set_conv_form;
++ EC_POINT_dup;
++ GENERAL_SUBTREE_new;
++ STORE_list_crl_endp;
++ EC_get_builtin_curves;
++ X509_policy_node_get0_qualifiers;
++ X509_pcy_node_get0_qualifiers;
++ STORE_list_crl_end;
++ EVP_PKEY_set1_EC_KEY;
++ BN_GF2m_mod_sqrt_arr;
++ i2d_ECPrivateKey_bio;
++ ECPKParameters_print_fp;
++ pqueue_find;
++ ECDSA_SIG_free;
++ PEM_write_bio_ECPKParameters;
++ STORE_method_set_ctrl_function;
++ STORE_list_public_key_end;
++ EC_KEY_set_private_key;
++ pqueue_peek;
++ STORE_get_arbitrary;
++ STORE_store_crl;
++ X509_policy_node_get0_policy;
++ PKCS12_add_safes;
++ BN_BLINDING_convert_ex;
++ X509_policy_tree_free;
++ OPENSSL_ia32cap_loc;
++ BN_GF2m_poly2arr;
++ STORE_ctrl;
++ STORE_ATTR_INFO_compare;
++ BN_get0_nist_prime_224;
++ i2d_ECParameters;
++ i2d_ECPKParameters;
++ BN_GENCB_call;
++ d2i_ECPKParameters;
++ STORE_meth_set_generate_fn;
++ STORE_method_set_generate_function;
++ ENGINE_set_ECDH;
++ NAME_CONSTRAINTS_new;
++ SHA256_Init;
++ EC_KEY_get0_public_key;
++ PEM_write_bio_EC_PUBKEY;
++ STORE_ATTR_INFO_set_cstr;
++ STORE_list_crl_next;
++ STORE_ATTR_INFO_in_range;
++ ECParameters_print;
++ STORE_meth_set_delete_fn;
++ STORE_method_set_delete_function;
++ STORE_list_certificate_next;
++ ASN1_generate_nconf;
++ BUF_memdup;
++ BN_GF2m_mod_mul;
++ STORE_meth_get_list_next_fn;
++ STORE_method_get_list_next_function;
++ STORE_ATTR_INFO_get0_dn;
++ STORE_list_private_key_next;
++ EC_GROUP_set_seed;
++ X509_VERIFY_PARAM_set_trust;
++ STORE_ATTR_INFO_free;
++ STORE_get_private_key;
++ EVP_PKEY_get_attr_count;
++ STORE_ATTR_INFO_new;
++ EC_GROUP_get_curve_GF2m;
++ STORE_meth_set_revoke_fn;
++ STORE_method_set_revoke_function;
++ STORE_store_number;
++ BN_is_prime_ex;
++ STORE_revoke_public_key;
++ X509_STORE_CTX_get0_param;
++ STORE_delete_arbitrary;
++ PEM_read_X509_CERT_PAIR;
++ X509_STORE_set_depth;
++ ECDSA_get_ex_data;
++ SHA224;
++ BIO_dump_indent_fp;
++ EC_KEY_set_group;
++ BUF_strndup;
++ STORE_list_certificate_start;
++ BN_GF2m_mod;
++ X509_REQ_check_private_key;
++ EC_GROUP_get_seed_len;
++ ERR_load_STORE_strings;
++ PEM_read_bio_EC_PUBKEY;
++ STORE_list_private_key_end;
++ i2d_EC_PUBKEY;
++ ECDSA_get_default_method;
++ ASN1_put_eoc;
++ X509_STORE_CTX_get_explicit_policy;
++ X509_STORE_CTX_get_expl_policy;
++ X509_VERIFY_PARAM_table_cleanup;
++ STORE_modify_private_key;
++ X509_VERIFY_PARAM_free;
++ EC_METHOD_get_field_type;
++ EC_GFp_nist_method;
++ STORE_meth_set_modify_fn;
++ STORE_method_set_modify_function;
++ STORE_parse_attrs_next;
++ ENGINE_load_padlock;
++ EC_GROUP_set_curve_name;
++ X509_CERT_PAIR_it;
++ STORE_meth_get_revoke_fn;
++ STORE_method_get_revoke_function;
++ STORE_method_set_get_function;
++ STORE_modify_number;
++ STORE_method_get_store_function;
++ STORE_store_private_key;
++ BN_GF2m_mod_sqr_arr;
++ RSA_setup_blinding;
++ BIO_s_datagram;
++ STORE_Memory;
++ sk_find_ex;
++ EC_GROUP_set_curve_GF2m;
++ ENGINE_set_default_ECDSA;
++ POLICY_CONSTRAINTS_new;
++ BN_GF2m_mod_sqrt;
++ ECDH_set_default_method;
++ EC_KEY_generate_key;
++ SHA384_Update;
++ BN_GF2m_arr2poly;
++ STORE_method_get_get_function;
++ STORE_meth_set_cleanup_fn;
++ STORE_method_set_cleanup_function;
++ EC_GROUP_check;
++ d2i_ECPrivateKey_bio;
++ EC_KEY_insert_key_method_data;
++ STORE_meth_get_lock_store_fn;
++ STORE_method_get_lock_store_function;
++ X509_VERIFY_PARAM_get_depth;
++ SHA224_Final;
++ STORE_meth_set_update_store_fn;
++ STORE_method_set_update_store_function;
++ SHA224_Update;
++ d2i_ECPrivateKey;
++ ASN1_item_ndef_i2d;
++ STORE_delete_private_key;
++ ERR_pop_to_mark;
++ ENGINE_register_all_STORE;
++ X509_policy_level_get0_node;
++ i2d_PKCS7_NDEF;
++ EC_GROUP_get_degree;
++ ASN1_generate_v3;
++ STORE_ATTR_INFO_modify_cstr;
++ X509_policy_tree_level_count;
++ BN_GF2m_add;
++ EC_KEY_get0_group;
++ STORE_generate_crl;
++ STORE_store_public_key;
++ X509_CERT_PAIR_free;
++ STORE_revoke_private_key;
++ BN_nist_mod_224;
++ SHA512_Final;
++ STORE_ATTR_INFO_modify_dn;
++ STORE_meth_get_initialise_fn;
++ STORE_method_get_initialise_function;
++ STORE_delete_number;
++ i2d_EC_PUBKEY_bio;
++ BIO_dgram_non_fatal_error;
++ EC_GROUP_get_asn1_flag;
++ STORE_ATTR_INFO_in_ex;
++ STORE_list_crl_start;
++ ECDH_get_ex_new_index;
++ STORE_meth_get_modify_fn;
++ STORE_method_get_modify_function;
++ v2i_ASN1_BIT_STRING;
++ STORE_store_certificate;
++ OBJ_bsearch_ex;
++ X509_STORE_CTX_set_default;
++ STORE_ATTR_INFO_set_sha1str;
++ BN_GF2m_mod_inv;
++ BN_GF2m_mod_exp;
++ STORE_modify_public_key;
++ STORE_meth_get_list_start_fn;
++ STORE_method_get_list_start_function;
++ EC_GROUP_get0_seed;
++ STORE_store_arbitrary;
++ STORE_meth_set_unlock_store_fn;
++ STORE_method_set_unlock_store_function;
++ BN_GF2m_mod_div_arr;
++ ENGINE_set_ECDSA;
++ STORE_create_method;
++ ECPKParameters_print;
++ EC_KEY_get0_private_key;
++ PEM_write_EC_PUBKEY;
++ X509_VERIFY_PARAM_set1;
++ ECDH_set_method;
++ v2i_GENERAL_NAME_ex;
++ ECDH_set_ex_data;
++ STORE_generate_key;
++ BN_nist_mod_521;
++ X509_policy_tree_get0_level;
++ EC_GROUP_set_point_conversion_form;
++ EC_GROUP_set_point_conv_form;
++ PEM_read_EC_PUBKEY;
++ i2d_ECDSA_SIG;
++ ECDSA_OpenSSL;
++ STORE_delete_crl;
++ EC_KEY_get_enc_flags;
++ ASN1_const_check_infinite_end;
++ EVP_PKEY_delete_attr;
++ ECDSA_set_default_method;
++ EC_POINT_set_compressed_coordinates_GF2m;
++ EC_POINT_set_compr_coords_GF2m;
++ EC_GROUP_cmp;
++ STORE_revoke_certificate;
++ BN_get0_nist_prime_256;
++ STORE_meth_get_delete_fn;
++ STORE_method_get_delete_function;
++ SHA224_Init;
++ PEM_read_ECPrivateKey;
++ SHA512_Init;
++ STORE_parse_attrs_endp;
++ BN_set_negative;
++ ERR_load_ECDSA_strings;
++ EC_GROUP_get_basis_type;
++ STORE_list_public_key_next;
++ i2v_ASN1_BIT_STRING;
++ STORE_OBJECT_free;
++ BN_nist_mod_384;
++ i2d_X509_CERT_PAIR;
++ PEM_write_ECPKParameters;
++ ECDH_compute_key;
++ STORE_ATTR_INFO_get0_sha1str;
++ ENGINE_register_all_ECDH;
++ pqueue_pop;
++ STORE_ATTR_INFO_get0_cstr;
++ POLICY_CONSTRAINTS_it;
++ STORE_get_ex_new_index;
++ EVP_PKEY_get_attr_by_OBJ;
++ X509_VERIFY_PARAM_add0_policy;
++ BN_GF2m_mod_solve_quad;
++ SHA256;
++ i2d_ECPrivateKey_fp;
++ X509_policy_tree_get0_user_policies;
++ X509_pcy_tree_get0_usr_policies;
++ OPENSSL_DIR_read;
++ ENGINE_register_all_ECDSA;
++ X509_VERIFY_PARAM_lookup;
++ EC_POINT_get_affine_coordinates_GF2m;
++ EC_POINT_get_affine_coords_GF2m;
++ EC_GROUP_dup;
++ ENGINE_get_default_ECDSA;
++ EC_KEY_new;
++ SHA256_Transform;
++ EC_KEY_set_enc_flags;
++ ECDSA_verify;
++ EC_POINT_point2hex;
++ ENGINE_get_STORE;
++ SHA512;
++ STORE_get_certificate;
++ ECDSA_do_sign_ex;
++ ECDSA_do_verify;
++ d2i_ECPrivateKey_fp;
++ STORE_delete_certificate;
++ SHA512_Transform;
++ X509_STORE_set1_param;
++ STORE_method_get_ctrl_function;
++ STORE_free;
++ PEM_write_ECPrivateKey;
++ STORE_meth_get_unlock_store_fn;
++ STORE_method_get_unlock_store_function;
++ STORE_get_ex_data;
++ EC_KEY_set_public_key;
++ PEM_read_ECPKParameters;
++ X509_CERT_PAIR_new;
++ ENGINE_register_STORE;
++ RSA_generate_key_ex;
++ DSA_generate_parameters_ex;
++ ECParameters_print_fp;
++ X509V3_NAME_from_section;
++ EVP_PKEY_add1_attr;
++ STORE_modify_crl;
++ STORE_list_private_key_start;
++ POLICY_MAPPINGS_it;
++ GENERAL_SUBTREE_it;
++ EC_GROUP_get_curve_name;
++ PEM_write_X509_CERT_PAIR;
++ BIO_dump_indent_cb;
++ d2i_X509_CERT_PAIR;
++ STORE_list_private_key_endp;
++ asn1_const_Finish;
++ i2d_EC_PUBKEY_fp;
++ BN_nist_mod_256;
++ X509_VERIFY_PARAM_add0_table;
++ pqueue_free;
++ BN_BLINDING_create_param;
++ ECDSA_size;
++ d2i_EC_PUBKEY_bio;
++ BN_get0_nist_prime_521;
++ STORE_ATTR_INFO_modify_sha1str;
++ BN_generate_prime_ex;
++ EC_GROUP_new_by_curve_name;
++ SHA256_Final;
++ DH_generate_parameters_ex;
++ PEM_read_bio_ECPrivateKey;
++ STORE_meth_get_cleanup_fn;
++ STORE_method_get_cleanup_function;
++ ENGINE_get_ECDH;
++ d2i_ECDSA_SIG;
++ BN_is_prime_fasttest_ex;
++ ECDSA_sign;
++ X509_policy_check;
++ EVP_PKEY_get_attr_by_NID;
++ STORE_set_ex_data;
++ ENGINE_get_ECDSA;
++ EVP_ecdsa;
++ BN_BLINDING_get_flags;
++ PKCS12_add_cert;
++ STORE_OBJECT_new;
++ ERR_load_ECDH_strings;
++ EC_KEY_dup;
++ EVP_CIPHER_CTX_rand_key;
++ ECDSA_set_method;
++ a2i_IPADDRESS_NC;
++ d2i_ECParameters;
++ STORE_list_certificate_end;
++ STORE_get_crl;
++ X509_POLICY_NODE_print;
++ SHA384_Init;
++ EC_GF2m_simple_method;
++ ECDSA_set_ex_data;
++ SHA384_Final;
++ PKCS7_set_digest;
++ EC_KEY_print;
++ STORE_meth_set_lock_store_fn;
++ STORE_method_set_lock_store_function;
++ ECDSA_get_ex_new_index;
++ SHA384;
++ POLICY_MAPPING_new;
++ STORE_list_certificate_endp;
++ X509_STORE_CTX_get0_policy_tree;
++ EC_GROUP_set_asn1_flag;
++ EC_KEY_check_key;
++ d2i_EC_PUBKEY_fp;
++ PKCS7_set0_type_other;
++ PEM_read_bio_X509_CERT_PAIR;
++ pqueue_next;
++ STORE_meth_get_list_end_fn;
++ STORE_method_get_list_end_function;
++ EVP_PKEY_add1_attr_by_OBJ;
++ X509_VERIFY_PARAM_set_time;
++ pqueue_new;
++ ENGINE_set_default_ECDH;
++ STORE_new_method;
++ PKCS12_add_key;
++ DSO_merge;
++ EC_POINT_hex2point;
++ BIO_dump_cb;
++ SHA256_Update;
++ pqueue_insert;
++ pitem_free;
++ BN_GF2m_mod_inv_arr;
++ ENGINE_unregister_ECDSA;
++ BN_BLINDING_set_thread_id;
++ get_rfc3526_prime_8192;
++ X509_VERIFY_PARAM_clear_flags;
++ get_rfc2409_prime_1024;
++ DH_check_pub_key;
++ get_rfc3526_prime_2048;
++ get_rfc3526_prime_6144;
++ get_rfc3526_prime_1536;
++ get_rfc3526_prime_3072;
++ get_rfc3526_prime_4096;
++ get_rfc2409_prime_768;
++ X509_VERIFY_PARAM_get_flags;
++ EVP_CIPHER_CTX_new;
++ EVP_CIPHER_CTX_free;
++ Camellia_cbc_encrypt;
++ Camellia_cfb128_encrypt;
++ Camellia_cfb1_encrypt;
++ Camellia_cfb8_encrypt;
++ Camellia_ctr128_encrypt;
++ Camellia_cfbr_encrypt_block;
++ Camellia_decrypt;
++ Camellia_ecb_encrypt;
++ Camellia_encrypt;
++ Camellia_ofb128_encrypt;
++ Camellia_set_key;
++ EVP_camellia_128_cbc;
++ EVP_camellia_128_cfb128;
++ EVP_camellia_128_cfb1;
++ EVP_camellia_128_cfb8;
++ EVP_camellia_128_ecb;
++ EVP_camellia_128_ofb;
++ EVP_camellia_192_cbc;
++ EVP_camellia_192_cfb128;
++ EVP_camellia_192_cfb1;
++ EVP_camellia_192_cfb8;
++ EVP_camellia_192_ecb;
++ EVP_camellia_192_ofb;
++ EVP_camellia_256_cbc;
++ EVP_camellia_256_cfb128;
++ EVP_camellia_256_cfb1;
++ EVP_camellia_256_cfb8;
++ EVP_camellia_256_ecb;
++ EVP_camellia_256_ofb;
++ a2i_ipadd;
++ ASIdentifiers_free;
++ i2d_ASIdOrRange;
++ EVP_CIPHER_block_size;
++ v3_asid_is_canonical;
++ IPAddressChoice_free;
++ EVP_CIPHER_CTX_set_app_data;
++ BIO_set_callback_arg;
++ v3_addr_add_prefix;
++ IPAddressOrRange_it;
++ BIO_set_flags;
++ ASIdentifiers_it;
++ v3_addr_get_range;
++ BIO_method_type;
++ v3_addr_inherits;
++ IPAddressChoice_it;
++ AES_ige_encrypt;
++ v3_addr_add_range;
++ EVP_CIPHER_CTX_nid;
++ d2i_ASRange;
++ v3_addr_add_inherit;
++ v3_asid_add_id_or_range;
++ v3_addr_validate_resource_set;
++ EVP_CIPHER_iv_length;
++ EVP_MD_type;
++ v3_asid_canonize;
++ IPAddressRange_free;
++ v3_asid_add_inherit;
++ EVP_CIPHER_CTX_key_length;
++ IPAddressRange_new;
++ ASIdOrRange_new;
++ EVP_MD_size;
++ EVP_MD_CTX_test_flags;
++ BIO_clear_flags;
++ i2d_ASRange;
++ IPAddressRange_it;
++ IPAddressChoice_new;
++ ASIdentifierChoice_new;
++ ASRange_free;
++ EVP_MD_pkey_type;
++ EVP_MD_CTX_clear_flags;
++ IPAddressFamily_free;
++ i2d_IPAddressFamily;
++ IPAddressOrRange_new;
++ EVP_CIPHER_flags;
++ v3_asid_validate_resource_set;
++ d2i_IPAddressRange;
++ AES_bi_ige_encrypt;
++ BIO_get_callback;
++ IPAddressOrRange_free;
++ v3_addr_subset;
++ d2i_IPAddressFamily;
++ v3_asid_subset;
++ BIO_test_flags;
++ i2d_ASIdentifierChoice;
++ ASRange_it;
++ d2i_ASIdentifiers;
++ ASRange_new;
++ d2i_IPAddressChoice;
++ v3_addr_get_afi;
++ EVP_CIPHER_key_length;
++ EVP_Cipher;
++ i2d_IPAddressOrRange;
++ ASIdOrRange_it;
++ EVP_CIPHER_nid;
++ i2d_IPAddressChoice;
++ EVP_CIPHER_CTX_block_size;
++ ASIdentifiers_new;
++ v3_addr_validate_path;
++ IPAddressFamily_new;
++ EVP_MD_CTX_set_flags;
++ v3_addr_is_canonical;
++ i2d_IPAddressRange;
++ IPAddressFamily_it;
++ v3_asid_inherits;
++ EVP_CIPHER_CTX_cipher;
++ EVP_CIPHER_CTX_get_app_data;
++ EVP_MD_block_size;
++ EVP_CIPHER_CTX_flags;
++ v3_asid_validate_path;
++ d2i_IPAddressOrRange;
++ v3_addr_canonize;
++ ASIdentifierChoice_it;
++ EVP_MD_CTX_md;
++ d2i_ASIdentifierChoice;
++ BIO_method_name;
++ EVP_CIPHER_CTX_iv_length;
++ ASIdOrRange_free;
++ ASIdentifierChoice_free;
++ BIO_get_callback_arg;
++ BIO_set_callback;
++ d2i_ASIdOrRange;
++ i2d_ASIdentifiers;
++ SEED_decrypt;
++ SEED_encrypt;
++ SEED_cbc_encrypt;
++ EVP_seed_ofb;
++ SEED_cfb128_encrypt;
++ SEED_ofb128_encrypt;
++ EVP_seed_cbc;
++ SEED_ecb_encrypt;
++ EVP_seed_ecb;
++ SEED_set_key;
++ EVP_seed_cfb128;
++ X509_EXTENSIONS_it;
++ X509_get1_ocsp;
++ OCSP_REQ_CTX_free;
++ i2d_X509_EXTENSIONS;
++ OCSP_sendreq_nbio;
++ OCSP_sendreq_new;
++ d2i_X509_EXTENSIONS;
++ X509_ALGORS_it;
++ X509_ALGOR_get0;
++ X509_ALGOR_set0;
++ AES_unwrap_key;
++ AES_wrap_key;
++ X509at_get0_data_by_OBJ;
++ ASN1_TYPE_set1;
++ ASN1_STRING_set0;
++ i2d_X509_ALGORS;
++ BIO_f_zlib;
++ COMP_zlib_cleanup;
++ d2i_X509_ALGORS;
++ CMS_ReceiptRequest_free;
++ PEM_write_CMS;
++ CMS_add0_CertificateChoices;
++ CMS_unsigned_add1_attr_by_OBJ;
++ ERR_load_CMS_strings;
++ CMS_sign_receipt;
++ i2d_CMS_ContentInfo;
++ CMS_signed_delete_attr;
++ d2i_CMS_bio;
++ CMS_unsigned_get_attr_by_NID;
++ CMS_verify;
++ SMIME_read_CMS;
++ CMS_decrypt_set1_key;
++ CMS_SignerInfo_get0_algs;
++ CMS_add1_cert;
++ CMS_set_detached;
++ CMS_encrypt;
++ CMS_EnvelopedData_create;
++ CMS_uncompress;
++ CMS_add0_crl;
++ CMS_SignerInfo_verify_content;
++ CMS_unsigned_get0_data_by_OBJ;
++ PEM_write_bio_CMS;
++ CMS_unsigned_get_attr;
++ CMS_RecipientInfo_ktri_cert_cmp;
++ CMS_RecipientInfo_ktri_get0_algs;
++ CMS_RecipInfo_ktri_get0_algs;
++ CMS_ContentInfo_free;
++ CMS_final;
++ CMS_add_simple_smimecap;
++ CMS_SignerInfo_verify;
++ CMS_data;
++ CMS_ContentInfo_it;
++ d2i_CMS_ReceiptRequest;
++ CMS_compress;
++ CMS_digest_create;
++ CMS_SignerInfo_cert_cmp;
++ CMS_SignerInfo_sign;
++ CMS_data_create;
++ i2d_CMS_bio;
++ CMS_EncryptedData_set1_key;
++ CMS_decrypt;
++ int_smime_write_ASN1;
++ CMS_unsigned_delete_attr;
++ CMS_unsigned_get_attr_count;
++ CMS_add_smimecap;
++ PEM_read_CMS;
++ CMS_signed_get_attr_by_OBJ;
++ d2i_CMS_ContentInfo;
++ CMS_add_standard_smimecap;
++ CMS_ContentInfo_new;
++ CMS_RecipientInfo_type;
++ CMS_get0_type;
++ CMS_is_detached;
++ CMS_sign;
++ CMS_signed_add1_attr;
++ CMS_unsigned_get_attr_by_OBJ;
++ SMIME_write_CMS;
++ CMS_EncryptedData_decrypt;
++ CMS_get0_RecipientInfos;
++ CMS_add0_RevocationInfoChoice;
++ CMS_decrypt_set1_pkey;
++ CMS_SignerInfo_set1_signer_cert;
++ CMS_get0_signers;
++ CMS_ReceiptRequest_get0_values;
++ CMS_signed_get0_data_by_OBJ;
++ CMS_get0_SignerInfos;
++ CMS_add0_cert;
++ CMS_EncryptedData_encrypt;
++ CMS_digest_verify;
++ CMS_set1_signers_certs;
++ CMS_signed_get_attr;
++ CMS_RecipientInfo_set0_key;
++ CMS_SignedData_init;
++ CMS_RecipientInfo_kekri_get0_id;
++ CMS_verify_receipt;
++ CMS_ReceiptRequest_it;
++ PEM_read_bio_CMS;
++ CMS_get1_crls;
++ CMS_add0_recipient_key;
++ SMIME_read_ASN1;
++ CMS_ReceiptRequest_new;
++ CMS_get0_content;
++ CMS_get1_ReceiptRequest;
++ CMS_signed_add1_attr_by_OBJ;
++ CMS_RecipientInfo_kekri_id_cmp;
++ CMS_add1_ReceiptRequest;
++ CMS_SignerInfo_get0_signer_id;
++ CMS_unsigned_add1_attr_by_NID;
++ CMS_unsigned_add1_attr;
++ CMS_signed_get_attr_by_NID;
++ CMS_get1_certs;
++ CMS_signed_add1_attr_by_NID;
++ CMS_unsigned_add1_attr_by_txt;
++ CMS_dataFinal;
++ CMS_RecipientInfo_ktri_get0_signer_id;
++ CMS_RecipInfo_ktri_get0_sigr_id;
++ i2d_CMS_ReceiptRequest;
++ CMS_add1_recipient_cert;
++ CMS_dataInit;
++ CMS_signed_add1_attr_by_txt;
++ CMS_RecipientInfo_decrypt;
++ CMS_signed_get_attr_count;
++ CMS_get0_eContentType;
++ CMS_set1_eContentType;
++ CMS_ReceiptRequest_create0;
++ CMS_add1_signer;
++ CMS_RecipientInfo_set0_pkey;
++ ENGINE_set_load_ssl_client_cert_function;
++ ENGINE_set_ld_ssl_clnt_cert_fn;
++ ENGINE_get_ssl_client_cert_function;
++ ENGINE_get_ssl_client_cert_fn;
++ ENGINE_load_ssl_client_cert;
++ ENGINE_load_capi;
++ OPENSSL_isservice;
++ FIPS_dsa_sig_decode;
++ EVP_CIPHER_CTX_clear_flags;
++ FIPS_rand_status;
++ FIPS_rand_set_key;
++ CRYPTO_set_mem_info_functions;
++ RSA_X931_generate_key_ex;
++ int_ERR_set_state_func;
++ int_EVP_MD_set_engine_callbacks;
++ int_CRYPTO_set_do_dynlock_callback;
++ FIPS_rng_stick;
++ EVP_CIPHER_CTX_set_flags;
++ BN_X931_generate_prime_ex;
++ FIPS_selftest_check;
++ FIPS_rand_set_dt;
++ CRYPTO_dbg_pop_info;
++ FIPS_dsa_free;
++ RSA_X931_derive_ex;
++ FIPS_rsa_new;
++ FIPS_rand_bytes;
++ fips_cipher_test;
++ EVP_CIPHER_CTX_test_flags;
++ CRYPTO_malloc_debug_init;
++ CRYPTO_dbg_push_info;
++ FIPS_corrupt_rsa_keygen;
++ FIPS_dh_new;
++ FIPS_corrupt_dsa_keygen;
++ FIPS_dh_free;
++ fips_pkey_signature_test;
++ EVP_add_alg_module;
++ int_RAND_init_engine_callbacks;
++ int_EVP_CIPHER_set_engine_callbacks;
++ int_EVP_MD_init_engine_callbacks;
++ FIPS_rand_test_mode;
++ FIPS_rand_reset;
++ FIPS_dsa_new;
++ int_RAND_set_callbacks;
++ BN_X931_derive_prime_ex;
++ int_ERR_lib_init;
++ int_EVP_CIPHER_init_engine_callbacks;
++ FIPS_rsa_free;
++ FIPS_dsa_sig_encode;
++ CRYPTO_dbg_remove_all_info;
++ OPENSSL_init;
++ CRYPTO_strdup;
++ JPAKE_STEP3A_process;
++ JPAKE_STEP1_release;
++ JPAKE_get_shared_key;
++ JPAKE_STEP3B_init;
++ JPAKE_STEP1_generate;
++ JPAKE_STEP1_init;
++ JPAKE_STEP3B_process;
++ JPAKE_STEP2_generate;
++ JPAKE_CTX_new;
++ JPAKE_CTX_free;
++ JPAKE_STEP3B_release;
++ JPAKE_STEP3A_release;
++ JPAKE_STEP2_process;
++ JPAKE_STEP3B_generate;
++ JPAKE_STEP1_process;
++ JPAKE_STEP3A_generate;
++ JPAKE_STEP2_release;
++ JPAKE_STEP3A_init;
++ ERR_load_JPAKE_strings;
++ JPAKE_STEP2_init;
++ pqueue_size;
++ i2d_TS_ACCURACY;
++ i2d_TS_MSG_IMPRINT_fp;
++ i2d_TS_MSG_IMPRINT;
++ EVP_PKEY_print_public;
++ EVP_PKEY_CTX_new;
++ i2d_TS_TST_INFO;
++ EVP_PKEY_asn1_find;
++ DSO_METHOD_beos;
++ TS_CONF_load_cert;
++ TS_REQ_get_ext;
++ EVP_PKEY_sign_init;
++ ASN1_item_print;
++ TS_TST_INFO_set_nonce;
++ TS_RESP_dup;
++ ENGINE_register_pkey_meths;
++ EVP_PKEY_asn1_add0;
++ PKCS7_add0_attrib_signing_time;
++ i2d_TS_TST_INFO_fp;
++ BIO_asn1_get_prefix;
++ TS_TST_INFO_set_time;
++ EVP_PKEY_meth_set_decrypt;
++ EVP_PKEY_set_type_str;
++ EVP_PKEY_CTX_get_keygen_info;
++ TS_REQ_set_policy_id;
++ d2i_TS_RESP_fp;
++ ENGINE_get_pkey_asn1_meth_engine;
++ ENGINE_get_pkey_asn1_meth_eng;
++ WHIRLPOOL_Init;
++ TS_RESP_set_status_info;
++ EVP_PKEY_keygen;
++ EVP_DigestSignInit;
++ TS_ACCURACY_set_millis;
++ TS_REQ_dup;
++ GENERAL_NAME_dup;
++ ASN1_SEQUENCE_ANY_it;
++ WHIRLPOOL;
++ X509_STORE_get1_crls;
++ ENGINE_get_pkey_asn1_meth;
++ EVP_PKEY_asn1_new;
++ BIO_new_NDEF;
++ ENGINE_get_pkey_meth;
++ TS_MSG_IMPRINT_set_algo;
++ i2d_TS_TST_INFO_bio;
++ TS_TST_INFO_set_ordering;
++ TS_TST_INFO_get_ext_by_OBJ;
++ CRYPTO_THREADID_set_pointer;
++ TS_CONF_get_tsa_section;
++ SMIME_write_ASN1;
++ TS_RESP_CTX_set_signer_key;
++ EVP_PKEY_encrypt_old;
++ EVP_PKEY_encrypt_init;
++ CRYPTO_THREADID_cpy;
++ ASN1_PCTX_get_cert_flags;
++ i2d_ESS_SIGNING_CERT;
++ TS_CONF_load_key;
++ i2d_ASN1_SEQUENCE_ANY;
++ d2i_TS_MSG_IMPRINT_bio;
++ EVP_PKEY_asn1_set_public;
++ b2i_PublicKey_bio;
++ BIO_asn1_set_prefix;
++ EVP_PKEY_new_mac_key;
++ BIO_new_CMS;
++ CRYPTO_THREADID_cmp;
++ TS_REQ_ext_free;
++ EVP_PKEY_asn1_set_free;
++ EVP_PKEY_get0_asn1;
++ d2i_NETSCAPE_X509;
++ EVP_PKEY_verify_recover_init;
++ EVP_PKEY_CTX_set_data;
++ EVP_PKEY_keygen_init;
++ TS_RESP_CTX_set_status_info;
++ TS_MSG_IMPRINT_get_algo;
++ TS_REQ_print_bio;
++ EVP_PKEY_CTX_ctrl_str;
++ EVP_PKEY_get_default_digest_nid;
++ PEM_write_bio_PKCS7_stream;
++ TS_MSG_IMPRINT_print_bio;
++ BN_asc2bn;
++ TS_REQ_get_policy_id;
++ ENGINE_set_default_pkey_asn1_meths;
++ ENGINE_set_def_pkey_asn1_meths;
++ d2i_TS_ACCURACY;
++ DSO_global_lookup;
++ TS_CONF_set_tsa_name;
++ i2d_ASN1_SET_ANY;
++ ENGINE_load_gost;
++ WHIRLPOOL_BitUpdate;
++ ASN1_PCTX_get_flags;
++ TS_TST_INFO_get_ext_by_NID;
++ TS_RESP_new;
++ ESS_CERT_ID_dup;
++ TS_STATUS_INFO_dup;
++ TS_REQ_delete_ext;
++ EVP_DigestVerifyFinal;
++ EVP_PKEY_print_params;
++ i2d_CMS_bio_stream;
++ TS_REQ_get_msg_imprint;
++ OBJ_find_sigid_by_algs;
++ TS_TST_INFO_get_serial;
++ TS_REQ_get_nonce;
++ X509_PUBKEY_set0_param;
++ EVP_PKEY_CTX_set0_keygen_info;
++ DIST_POINT_set_dpname;
++ i2d_ISSUING_DIST_POINT;
++ ASN1_SET_ANY_it;
++ EVP_PKEY_CTX_get_data;
++ TS_STATUS_INFO_print_bio;
++ EVP_PKEY_derive_init;
++ d2i_TS_TST_INFO;
++ EVP_PKEY_asn1_add_alias;
++ d2i_TS_RESP_bio;
++ OTHERNAME_cmp;
++ GENERAL_NAME_set0_value;
++ PKCS7_RECIP_INFO_get0_alg;
++ TS_RESP_CTX_new;
++ TS_RESP_set_tst_info;
++ PKCS7_final;
++ EVP_PKEY_base_id;
++ TS_RESP_CTX_set_signer_cert;
++ TS_REQ_set_msg_imprint;
++ EVP_PKEY_CTX_ctrl;
++ TS_CONF_set_digests;
++ d2i_TS_MSG_IMPRINT;
++ EVP_PKEY_meth_set_ctrl;
++ TS_REQ_get_ext_by_NID;
++ PKCS5_pbe_set0_algor;
++ BN_BLINDING_thread_id;
++ TS_ACCURACY_new;
++ X509_CRL_METHOD_free;
++ ASN1_PCTX_get_nm_flags;
++ EVP_PKEY_meth_set_sign;
++ CRYPTO_THREADID_current;
++ EVP_PKEY_decrypt_init;
++ NETSCAPE_X509_free;
++ i2b_PVK_bio;
++ EVP_PKEY_print_private;
++ GENERAL_NAME_get0_value;
++ b2i_PVK_bio;
++ ASN1_UTCTIME_adj;
++ TS_TST_INFO_new;
++ EVP_MD_do_all_sorted;
++ TS_CONF_set_default_engine;
++ TS_ACCURACY_set_seconds;
++ TS_TST_INFO_get_time;
++ PKCS8_pkey_get0;
++ EVP_PKEY_asn1_get0;
++ OBJ_add_sigid;
++ PKCS7_SIGNER_INFO_sign;
++ EVP_PKEY_paramgen_init;
++ EVP_PKEY_sign;
++ OBJ_sigid_free;
++ EVP_PKEY_meth_set_init;
++ d2i_ESS_ISSUER_SERIAL;
++ ISSUING_DIST_POINT_new;
++ ASN1_TIME_adj;
++ TS_OBJ_print_bio;
++ EVP_PKEY_meth_set_verify_recover;
++ EVP_PKEY_meth_set_vrfy_recover;
++ TS_RESP_get_status_info;
++ CMS_stream;
++ EVP_PKEY_CTX_set_cb;
++ PKCS7_to_TS_TST_INFO;
++ ASN1_PCTX_get_oid_flags;
++ TS_TST_INFO_add_ext;
++ EVP_PKEY_meth_set_derive;
++ i2d_TS_RESP_fp;
++ i2d_TS_MSG_IMPRINT_bio;
++ TS_RESP_CTX_set_accuracy;
++ TS_REQ_set_nonce;
++ ESS_CERT_ID_new;
++ ENGINE_pkey_asn1_find_str;
++ TS_REQ_get_ext_count;
++ BUF_reverse;
++ TS_TST_INFO_print_bio;
++ d2i_ISSUING_DIST_POINT;
++ ENGINE_get_pkey_meths;
++ i2b_PrivateKey_bio;
++ i2d_TS_RESP;
++ b2i_PublicKey;
++ TS_VERIFY_CTX_cleanup;
++ TS_STATUS_INFO_free;
++ TS_RESP_verify_token;
++ OBJ_bsearch_ex_;
++ ASN1_bn_print;
++ EVP_PKEY_asn1_get_count;
++ ENGINE_register_pkey_asn1_meths;
++ ASN1_PCTX_set_nm_flags;
++ EVP_DigestVerifyInit;
++ ENGINE_set_default_pkey_meths;
++ TS_TST_INFO_get_policy_id;
++ TS_REQ_get_cert_req;
++ X509_CRL_set_meth_data;
++ PKCS8_pkey_set0;
++ ASN1_STRING_copy;
++ d2i_TS_TST_INFO_fp;
++ X509_CRL_match;
++ EVP_PKEY_asn1_set_private;
++ TS_TST_INFO_get_ext_d2i;
++ TS_RESP_CTX_add_policy;
++ d2i_TS_RESP;
++ TS_CONF_load_certs;
++ TS_TST_INFO_get_msg_imprint;
++ ERR_load_TS_strings;
++ TS_TST_INFO_get_version;
++ EVP_PKEY_CTX_dup;
++ EVP_PKEY_meth_set_verify;
++ i2b_PublicKey_bio;
++ TS_CONF_set_certs;
++ EVP_PKEY_asn1_get0_info;
++ TS_VERIFY_CTX_free;
++ TS_REQ_get_ext_by_critical;
++ TS_RESP_CTX_set_serial_cb;
++ X509_CRL_get_meth_data;
++ TS_RESP_CTX_set_time_cb;
++ TS_MSG_IMPRINT_get_msg;
++ TS_TST_INFO_ext_free;
++ TS_REQ_get_version;
++ TS_REQ_add_ext;
++ EVP_PKEY_CTX_set_app_data;
++ OBJ_bsearch_;
++ EVP_PKEY_meth_set_verifyctx;
++ i2d_PKCS7_bio_stream;
++ CRYPTO_THREADID_set_numeric;
++ PKCS7_sign_add_signer;
++ d2i_TS_TST_INFO_bio;
++ TS_TST_INFO_get_ordering;
++ TS_RESP_print_bio;
++ TS_TST_INFO_get_exts;
++ HMAC_CTX_copy;
++ PKCS5_pbe2_set_iv;
++ ENGINE_get_pkey_asn1_meths;
++ b2i_PrivateKey;
++ EVP_PKEY_CTX_get_app_data;
++ TS_REQ_set_cert_req;
++ CRYPTO_THREADID_set_callback;
++ TS_CONF_set_serial;
++ TS_TST_INFO_free;
++ d2i_TS_REQ_fp;
++ TS_RESP_verify_response;
++ i2d_ESS_ISSUER_SERIAL;
++ TS_ACCURACY_get_seconds;
++ EVP_CIPHER_do_all;
++ b2i_PrivateKey_bio;
++ OCSP_CERTID_dup;
++ X509_PUBKEY_get0_param;
++ TS_MSG_IMPRINT_dup;
++ PKCS7_print_ctx;
++ i2d_TS_REQ_bio;
++ EVP_whirlpool;
++ EVP_PKEY_asn1_set_param;
++ EVP_PKEY_meth_set_encrypt;
++ ASN1_PCTX_set_flags;
++ i2d_ESS_CERT_ID;
++ TS_VERIFY_CTX_new;
++ TS_RESP_CTX_set_extension_cb;
++ ENGINE_register_all_pkey_meths;
++ TS_RESP_CTX_set_status_info_cond;
++ TS_RESP_CTX_set_stat_info_cond;
++ EVP_PKEY_verify;
++ WHIRLPOOL_Final;
++ X509_CRL_METHOD_new;
++ EVP_DigestSignFinal;
++ TS_RESP_CTX_set_def_policy;
++ NETSCAPE_X509_it;
++ TS_RESP_create_response;
++ PKCS7_SIGNER_INFO_get0_algs;
++ TS_TST_INFO_get_nonce;
++ EVP_PKEY_decrypt_old;
++ TS_TST_INFO_set_policy_id;
++ TS_CONF_set_ess_cert_id_chain;
++ EVP_PKEY_CTX_get0_pkey;
++ d2i_TS_REQ;
++ EVP_PKEY_asn1_find_str;
++ BIO_f_asn1;
++ ESS_SIGNING_CERT_new;
++ EVP_PBE_find;
++ X509_CRL_get0_by_cert;
++ EVP_PKEY_derive;
++ i2d_TS_REQ;
++ TS_TST_INFO_delete_ext;
++ ESS_ISSUER_SERIAL_free;
++ ASN1_PCTX_set_str_flags;
++ ENGINE_get_pkey_asn1_meth_str;
++ TS_CONF_set_signer_key;
++ TS_ACCURACY_get_millis;
++ TS_RESP_get_token;
++ TS_ACCURACY_dup;
++ ENGINE_register_all_pkey_asn1_meths;
++ ENGINE_reg_all_pkey_asn1_meths;
++ X509_CRL_set_default_method;
++ CRYPTO_THREADID_hash;
++ CMS_ContentInfo_print_ctx;
++ TS_RESP_free;
++ ISSUING_DIST_POINT_free;
++ ESS_ISSUER_SERIAL_new;
++ CMS_add1_crl;
++ PKCS7_add1_attrib_digest;
++ TS_RESP_CTX_add_md;
++ TS_TST_INFO_dup;
++ ENGINE_set_pkey_asn1_meths;
++ PEM_write_bio_Parameters;
++ TS_TST_INFO_get_accuracy;
++ X509_CRL_get0_by_serial;
++ TS_TST_INFO_set_version;
++ TS_RESP_CTX_get_tst_info;
++ TS_RESP_verify_signature;
++ CRYPTO_THREADID_get_callback;
++ TS_TST_INFO_get_tsa;
++ TS_STATUS_INFO_new;
++ EVP_PKEY_CTX_get_cb;
++ TS_REQ_get_ext_d2i;
++ GENERAL_NAME_set0_othername;
++ TS_TST_INFO_get_ext_count;
++ TS_RESP_CTX_get_request;
++ i2d_NETSCAPE_X509;
++ ENGINE_get_pkey_meth_engine;
++ EVP_PKEY_meth_set_signctx;
++ EVP_PKEY_asn1_copy;
++ ASN1_TYPE_cmp;
++ EVP_CIPHER_do_all_sorted;
++ EVP_PKEY_CTX_free;
++ ISSUING_DIST_POINT_it;
++ d2i_TS_MSG_IMPRINT_fp;
++ X509_STORE_get1_certs;
++ EVP_PKEY_CTX_get_operation;
++ d2i_ESS_SIGNING_CERT;
++ TS_CONF_set_ordering;
++ EVP_PBE_alg_add_type;
++ TS_REQ_set_version;
++ EVP_PKEY_get0;
++ BIO_asn1_set_suffix;
++ i2d_TS_STATUS_INFO;
++ EVP_MD_do_all;
++ TS_TST_INFO_set_accuracy;
++ PKCS7_add_attrib_content_type;
++ ERR_remove_thread_state;
++ EVP_PKEY_meth_add0;
++ TS_TST_INFO_set_tsa;
++ EVP_PKEY_meth_new;
++ WHIRLPOOL_Update;
++ TS_CONF_set_accuracy;
++ ASN1_PCTX_set_oid_flags;
++ ESS_SIGNING_CERT_dup;
++ d2i_TS_REQ_bio;
++ X509_time_adj_ex;
++ TS_RESP_CTX_add_flags;
++ d2i_TS_STATUS_INFO;
++ TS_MSG_IMPRINT_set_msg;
++ BIO_asn1_get_suffix;
++ TS_REQ_free;
++ EVP_PKEY_meth_free;
++ TS_REQ_get_exts;
++ TS_RESP_CTX_set_clock_precision_digits;
++ TS_RESP_CTX_set_clk_prec_digits;
++ TS_RESP_CTX_add_failure_info;
++ i2d_TS_RESP_bio;
++ EVP_PKEY_CTX_get0_peerkey;
++ PEM_write_bio_CMS_stream;
++ TS_REQ_new;
++ TS_MSG_IMPRINT_new;
++ EVP_PKEY_meth_find;
++ EVP_PKEY_id;
++ TS_TST_INFO_set_serial;
++ a2i_GENERAL_NAME;
++ TS_CONF_set_crypto_device;
++ EVP_PKEY_verify_init;
++ TS_CONF_set_policies;
++ ASN1_PCTX_new;
++ ESS_CERT_ID_free;
++ ENGINE_unregister_pkey_meths;
++ TS_MSG_IMPRINT_free;
++ TS_VERIFY_CTX_init;
++ PKCS7_stream;
++ TS_RESP_CTX_set_certs;
++ TS_CONF_set_def_policy;
++ ASN1_GENERALIZEDTIME_adj;
++ NETSCAPE_X509_new;
++ TS_ACCURACY_free;
++ TS_RESP_get_tst_info;
++ EVP_PKEY_derive_set_peer;
++ PEM_read_bio_Parameters;
++ TS_CONF_set_clock_precision_digits;
++ TS_CONF_set_clk_prec_digits;
++ ESS_ISSUER_SERIAL_dup;
++ TS_ACCURACY_get_micros;
++ ASN1_PCTX_get_str_flags;
++ NAME_CONSTRAINTS_check;
++ ASN1_BIT_STRING_check;
++ X509_check_akid;
++ ENGINE_unregister_pkey_asn1_meths;
++ ENGINE_unreg_pkey_asn1_meths;
++ ASN1_PCTX_free;
++ PEM_write_bio_ASN1_stream;
++ i2d_ASN1_bio_stream;
++ TS_X509_ALGOR_print_bio;
++ EVP_PKEY_meth_set_cleanup;
++ EVP_PKEY_asn1_free;
++ ESS_SIGNING_CERT_free;
++ TS_TST_INFO_set_msg_imprint;
++ GENERAL_NAME_cmp;
++ d2i_ASN1_SET_ANY;
++ ENGINE_set_pkey_meths;
++ i2d_TS_REQ_fp;
++ d2i_ASN1_SEQUENCE_ANY;
++ GENERAL_NAME_get0_otherName;
++ d2i_ESS_CERT_ID;
++ OBJ_find_sigid_algs;
++ EVP_PKEY_meth_set_keygen;
++ PKCS5_PBKDF2_HMAC;
++ EVP_PKEY_paramgen;
++ EVP_PKEY_meth_set_paramgen;
++ BIO_new_PKCS7;
++ EVP_PKEY_verify_recover;
++ TS_ext_print_bio;
++ TS_ASN1_INTEGER_print_bio;
++ check_defer;
++ DSO_pathbyaddr;
++ EVP_PKEY_set_type;
++ TS_ACCURACY_set_micros;
++ TS_REQ_to_TS_VERIFY_CTX;
++ EVP_PKEY_meth_set_copy;
++ ASN1_PCTX_set_cert_flags;
++ TS_TST_INFO_get_ext;
++ EVP_PKEY_asn1_set_ctrl;
++ TS_TST_INFO_get_ext_by_critical;
++ EVP_PKEY_CTX_new_id;
++ TS_REQ_get_ext_by_OBJ;
++ TS_CONF_set_signer_cert;
++ X509_NAME_hash_old;
++ ASN1_TIME_set_string;
++ EVP_MD_flags;
++ TS_RESP_CTX_free;
++ DSAparams_dup;
++ DHparams_dup;
++ OCSP_REQ_CTX_add1_header;
++ OCSP_REQ_CTX_set1_req;
++ X509_STORE_set_verify_cb;
++ X509_STORE_CTX_get0_current_crl;
++ X509_STORE_CTX_get0_parent_ctx;
++ X509_STORE_CTX_get0_current_issuer;
++ X509_STORE_CTX_get0_cur_issuer;
++ X509_issuer_name_hash_old;
++ X509_subject_name_hash_old;
++ EVP_CIPHER_CTX_copy;
++ UI_method_get_prompt_constructor;
++ UI_method_get_prompt_constructr;
++ UI_method_set_prompt_constructor;
++ UI_method_set_prompt_constructr;
++ EVP_read_pw_string_min;
++ CRYPTO_cts128_encrypt;
++ CRYPTO_cts128_decrypt_block;
++ CRYPTO_cfb128_1_encrypt;
++ CRYPTO_cbc128_encrypt;
++ CRYPTO_ctr128_encrypt;
++ CRYPTO_ofb128_encrypt;
++ CRYPTO_cts128_decrypt;
++ CRYPTO_cts128_encrypt_block;
++ CRYPTO_cbc128_decrypt;
++ CRYPTO_cfb128_encrypt;
++ CRYPTO_cfb128_8_encrypt;
++ SSL_renegotiate_abbreviated;
++ TLSv1_1_method;
++ TLSv1_1_client_method;
++ TLSv1_1_server_method;
++ SSL_CTX_set_srp_client_pwd_callback;
++ SSL_CTX_set_srp_client_pwd_cb;
++ SSL_get_srp_g;
++ SSL_CTX_set_srp_username_callback;
++ SSL_CTX_set_srp_un_cb;
++ SSL_get_srp_userinfo;
++ SSL_set_srp_server_param;
++ SSL_set_srp_server_param_pw;
++ SSL_get_srp_N;
++ SSL_get_srp_username;
++ SSL_CTX_set_srp_password;
++ SSL_CTX_set_srp_strength;
++ SSL_CTX_set_srp_verify_param_callback;
++ SSL_CTX_set_srp_vfy_param_cb;
++ SSL_CTX_set_srp_cb_arg;
++ SSL_CTX_set_srp_username;
++ SSL_CTX_SRP_CTX_init;
++ SSL_SRP_CTX_init;
++ SRP_Calc_A_param;
++ SRP_generate_server_master_secret;
++ SRP_gen_server_master_secret;
++ SSL_CTX_SRP_CTX_free;
++ SRP_generate_client_master_secret;
++ SRP_gen_client_master_secret;
++ SSL_srp_server_param_with_username;
++ SSL_srp_server_param_with_un;
++ SSL_SRP_CTX_free;
++ SSL_set_debug;
++ SSL_SESSION_get0_peer;
++ TLSv1_2_client_method;
++ SSL_SESSION_set1_id_context;
++ TLSv1_2_server_method;
++ SSL_cache_hit;
++ SSL_get0_kssl_ctx;
++ SSL_set0_kssl_ctx;
++ SSL_set_state;
++ SSL_CIPHER_get_id;
++ TLSv1_2_method;
++ kssl_ctx_get0_client_princ;
++ SSL_export_keying_material;
++ SSL_set_tlsext_use_srtp;
++ SSL_CTX_set_next_protos_advertised_cb;
++ SSL_CTX_set_next_protos_adv_cb;
++ SSL_get0_next_proto_negotiated;
++ SSL_get_selected_srtp_profile;
++ SSL_CTX_set_tlsext_use_srtp;
++ SSL_select_next_proto;
++ SSL_get_srtp_profiles;
++ SSL_CTX_set_next_proto_select_cb;
++ SSL_CTX_set_next_proto_sel_cb;
++ SSL_SESSION_get_compress_id;
++
++ SRP_VBASE_get_by_user;
++ SRP_Calc_server_key;
++ SRP_create_verifier;
++ SRP_create_verifier_BN;
++ SRP_Calc_u;
++ SRP_VBASE_free;
++ SRP_Calc_client_key;
++ SRP_get_default_gN;
++ SRP_Calc_x;
++ SRP_Calc_B;
++ SRP_VBASE_new;
++ SRP_check_known_gN_param;
++ SRP_Calc_A;
++ SRP_Verify_A_mod_N;
++ SRP_VBASE_init;
++ SRP_Verify_B_mod_N;
++ EC_KEY_set_public_key_affine_coordinates;
++ EC_KEY_set_pub_key_aff_coords;
++ EVP_aes_192_ctr;
++ EVP_PKEY_meth_get0_info;
++ EVP_PKEY_meth_copy;
++ ERR_add_error_vdata;
++ EVP_aes_128_ctr;
++ EVP_aes_256_ctr;
++ EC_GFp_nistp224_method;
++ EC_KEY_get_flags;
++ RSA_padding_add_PKCS1_PSS_mgf1;
++ EVP_aes_128_xts;
++ EVP_aes_256_xts;
++ EVP_aes_128_gcm;
++ EC_KEY_clear_flags;
++ EC_KEY_set_flags;
++ EVP_aes_256_ccm;
++ RSA_verify_PKCS1_PSS_mgf1;
++ EVP_aes_128_ccm;
++ EVP_aes_192_gcm;
++ X509_ALGOR_set_md;
++ RAND_init_fips;
++ EVP_aes_256_gcm;
++ EVP_aes_192_ccm;
++ CMAC_CTX_copy;
++ CMAC_CTX_free;
++ CMAC_CTX_get0_cipher_ctx;
++ CMAC_CTX_cleanup;
++ CMAC_Init;
++ CMAC_Update;
++ CMAC_resume;
++ CMAC_CTX_new;
++ CMAC_Final;
++ CRYPTO_ctr128_encrypt_ctr32;
++ CRYPTO_gcm128_release;
++ CRYPTO_ccm128_decrypt_ccm64;
++ CRYPTO_ccm128_encrypt;
++ CRYPTO_gcm128_encrypt;
++ CRYPTO_xts128_encrypt;
++ EVP_rc4_hmac_md5;
++ CRYPTO_nistcts128_decrypt_block;
++ CRYPTO_gcm128_setiv;
++ CRYPTO_nistcts128_encrypt;
++ EVP_aes_128_cbc_hmac_sha1;
++ CRYPTO_gcm128_tag;
++ CRYPTO_ccm128_encrypt_ccm64;
++ ENGINE_load_rdrand;
++ CRYPTO_ccm128_setiv;
++ CRYPTO_nistcts128_encrypt_block;
++ CRYPTO_gcm128_aad;
++ CRYPTO_ccm128_init;
++ CRYPTO_nistcts128_decrypt;
++ CRYPTO_gcm128_new;
++ CRYPTO_ccm128_tag;
++ CRYPTO_ccm128_decrypt;
++ CRYPTO_ccm128_aad;
++ CRYPTO_gcm128_init;
++ CRYPTO_gcm128_decrypt;
++ ENGINE_load_rsax;
++ CRYPTO_gcm128_decrypt_ctr32;
++ CRYPTO_gcm128_encrypt_ctr32;
++ CRYPTO_gcm128_finish;
++ EVP_aes_256_cbc_hmac_sha1;
++ PKCS5_pbkdf2_set;
++ CMS_add0_recipient_password;
++ CMS_decrypt_set1_password;
++ CMS_RecipientInfo_set0_password;
++ RAND_set_fips_drbg_type;
++ X509_REQ_sign_ctx;
++ RSA_PSS_PARAMS_new;
++ X509_CRL_sign_ctx;
++ X509_signature_dump;
++ d2i_RSA_PSS_PARAMS;
++ RSA_PSS_PARAMS_it;
++ RSA_PSS_PARAMS_free;
++ X509_sign_ctx;
++ i2d_RSA_PSS_PARAMS;
++ ASN1_item_sign_ctx;
++ EC_GFp_nistp521_method;
++ EC_GFp_nistp256_method;
++ OPENSSL_stderr;
++ OPENSSL_cpuid_setup;
++ OPENSSL_showfatal;
++ BIO_new_dgram_sctp;
++ BIO_dgram_sctp_msg_waiting;
++ BIO_dgram_sctp_wait_for_dry;
++ BIO_s_datagram_sctp;
++ BIO_dgram_is_sctp;
++ BIO_dgram_sctp_notification_cb;
++ CRYPTO_memcmp;
++ SSL_CTX_set_alpn_protos;
++ SSL_set_alpn_protos;
++ SSL_CTX_set_alpn_select_cb;
++ SSL_get0_alpn_selected;
++ SSL_CTX_set_custom_cli_ext;
++ SSL_CTX_set_custom_srv_ext;
++ SSL_CTX_set_srv_supp_data;
++ SSL_CTX_set_cli_supp_data;
++ SSL_set_cert_cb;
++ SSL_CTX_use_serverinfo;
++ SSL_CTX_use_serverinfo_file;
++ SSL_CTX_set_cert_cb;
++ SSL_CTX_get0_param;
++ SSL_get0_param;
++ SSL_certs_clear;
++ DTLSv1_2_method;
++ DTLSv1_2_server_method;
++ DTLSv1_2_client_method;
++ DTLS_method;
++ DTLS_server_method;
++ DTLS_client_method;
++ SSL_CTX_get_ssl_method;
++ SSL_CTX_get0_certificate;
++ SSL_CTX_get0_privatekey;
++ SSL_COMP_set0_compression_methods;
++ SSL_COMP_free_compression_methods;
++ SSL_CIPHER_find;
++ SSL_is_server;
++ SSL_CONF_CTX_new;
++ SSL_CONF_CTX_finish;
++ SSL_CONF_CTX_free;
++ SSL_CONF_CTX_set_flags;
++ SSL_CONF_CTX_clear_flags;
++ SSL_CONF_CTX_set1_prefix;
++ SSL_CONF_CTX_set_ssl;
++ SSL_CONF_CTX_set_ssl_ctx;
++ SSL_CONF_cmd;
++ SSL_CONF_cmd_argv;
++ SSL_CONF_cmd_value_type;
++ SSL_trace;
++ SSL_CIPHER_standard_name;
++ SSL_get_tlsa_record_byname;
++ ASN1_TIME_diff;
++ BIO_hex_string;
++ CMS_RecipientInfo_get0_pkey_ctx;
++ CMS_RecipientInfo_encrypt;
++ CMS_SignerInfo_get0_pkey_ctx;
++ CMS_SignerInfo_get0_md_ctx;
++ CMS_SignerInfo_get0_signature;
++ CMS_RecipientInfo_kari_get0_alg;
++ CMS_RecipientInfo_kari_get0_reks;
++ CMS_RecipientInfo_kari_get0_orig_id;
++ CMS_RecipientInfo_kari_orig_id_cmp;
++ CMS_RecipientEncryptedKey_get0_id;
++ CMS_RecipientEncryptedKey_cert_cmp;
++ CMS_RecipientInfo_kari_set0_pkey;
++ CMS_RecipientInfo_kari_get0_ctx;
++ CMS_RecipientInfo_kari_decrypt;
++ CMS_SharedInfo_encode;
++ DH_compute_key_padded;
++ d2i_DHxparams;
++ i2d_DHxparams;
++ DH_get_1024_160;
++ DH_get_2048_224;
++ DH_get_2048_256;
++ DH_KDF_X9_42;
++ ECDH_KDF_X9_62;
++ ECDSA_METHOD_new;
++ ECDSA_METHOD_free;
++ ECDSA_METHOD_set_app_data;
++ ECDSA_METHOD_get_app_data;
++ ECDSA_METHOD_set_sign;
++ ECDSA_METHOD_set_sign_setup;
++ ECDSA_METHOD_set_verify;
++ ECDSA_METHOD_set_flags;
++ ECDSA_METHOD_set_name;
++ EVP_des_ede3_wrap;
++ EVP_aes_128_wrap;
++ EVP_aes_192_wrap;
++ EVP_aes_256_wrap;
++ EVP_aes_128_cbc_hmac_sha256;
++ EVP_aes_256_cbc_hmac_sha256;
++ CRYPTO_128_wrap;
++ CRYPTO_128_unwrap;
++ OCSP_REQ_CTX_nbio;
++ OCSP_REQ_CTX_new;
++ OCSP_set_max_response_length;
++ OCSP_REQ_CTX_i2d;
++ OCSP_REQ_CTX_nbio_d2i;
++ OCSP_REQ_CTX_get0_mem_bio;
++ OCSP_REQ_CTX_http;
++ RSA_padding_add_PKCS1_OAEP_mgf1;
++ RSA_padding_check_PKCS1_OAEP_mgf1;
++ RSA_OAEP_PARAMS_free;
++ RSA_OAEP_PARAMS_it;
++ RSA_OAEP_PARAMS_new;
++ SSL_get_sigalgs;
++ SSL_get_shared_sigalgs;
++ SSL_check_chain;
++ X509_chain_up_ref;
++ X509_http_nbio;
++ X509_CRL_http_nbio;
++ X509_REVOKED_dup;
++ i2d_re_X509_tbs;
++ X509_get0_signature;
++ X509_get_signature_nid;
++ X509_CRL_diff;
++ X509_chain_check_suiteb;
++ X509_CRL_check_suiteb;
++ X509_check_host;
++ X509_check_email;
++ X509_check_ip;
++ X509_check_ip_asc;
++ X509_STORE_set_lookup_crls_cb;
++ X509_STORE_CTX_get0_store;
++ X509_VERIFY_PARAM_set1_host;
++ X509_VERIFY_PARAM_add1_host;
++ X509_VERIFY_PARAM_set_hostflags;
++ X509_VERIFY_PARAM_get0_peername;
++ X509_VERIFY_PARAM_set1_email;
++ X509_VERIFY_PARAM_set1_ip;
++ X509_VERIFY_PARAM_set1_ip_asc;
++ X509_VERIFY_PARAM_get0_name;
++ X509_VERIFY_PARAM_get_count;
++ X509_VERIFY_PARAM_get0;
++ X509V3_EXT_free;
++ EC_GROUP_get_mont_data;
++ EC_curve_nid2nist;
++ EC_curve_nist2nid;
++ PEM_write_bio_DHxparams;
++ PEM_write_DHxparams;
++ SSL_CTX_add_client_custom_ext;
++ SSL_CTX_add_server_custom_ext;
++ SSL_extension_supported;
++ BUF_strnlen;
++ sk_deep_copy;
++ SSL_test_functions;
++
++ local:
++ *;
++};
++
++OPENSSL_1.0.2g {
++ global:
++ SRP_VBASE_get1_by_user;
++ SRP_user_pwd_free;
++} OPENSSL_1.0.2d;
++
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld 2014-02-24 21:02:30.000000000 +0100
+@@ -0,0 +1,10 @@
++OPENSSL_1.0.2 {
++ global:
++ bind_engine;
++ v_check;
++ OPENSSL_init;
++ OPENSSL_finish;
++ local:
++ *;
++};
++
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/ccgost/openssl.ld
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/ccgost/openssl.ld 2014-02-24 21:02:30.000000000 +0100
+@@ -0,0 +1,10 @@
++OPENSSL_1.0.2 {
++ global:
++ bind_engine;
++ v_check;
++ OPENSSL_init;
++ OPENSSL_finish;
++ local:
++ *;
++};
++
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/engines-install-in-libdir-ssl.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/engines-install-in-libdir-ssl.patch
new file mode 100644
index 000000000..a5746483e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/engines-install-in-libdir-ssl.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Inappropriate [configuration]
+
+
+Index: openssl-1.0.2/engines/Makefile
+===================================================================
+--- openssl-1.0.2.orig/engines/Makefile
++++ openssl-1.0.2/engines/Makefile
+@@ -107,13 +107,13 @@ install:
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+ @if [ -n "$(SHARED_LIBS)" ]; then \
+ set -e; \
+- $(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines; \
++ $(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines; \
+ for l in $(LIBNAMES); do \
+ ( echo installing $$l; \
+ pfx=lib; \
+ if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
+ sfx=".so"; \
+- cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++ cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
+ else \
+ case "$(CFLAGS)" in \
+ *DSO_BEOS*) sfx=".so";; \
+@@ -122,10 +122,10 @@ install:
+ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
+ *) sfx=".bad";; \
+ esac; \
+- cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++ cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
+ fi; \
+- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
+- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
++ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
++ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx ); \
+ done; \
+ fi
+ @target=install; $(RECURSIVE_MAKE)
+Index: openssl-1.0.2/engines/ccgost/Makefile
+===================================================================
+--- openssl-1.0.2.orig/engines/ccgost/Makefile
++++ openssl-1.0.2/engines/ccgost/Makefile
+@@ -47,7 +47,7 @@ install:
+ pfx=lib; \
+ if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
+ sfx=".so"; \
+- cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++ cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ else \
+ case "$(CFLAGS)" in \
+ *DSO_BEOS*) sfx=".so";; \
+@@ -56,10 +56,10 @@ install:
+ *DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
+ *) sfx=".bad";; \
+ esac; \
+- cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++ cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ fi; \
+- chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
++ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx; \
+ fi
+
+ links:
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/find.pl b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/find.pl
new file mode 100644
index 000000000..8e1b42c88
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/find.pl
@@ -0,0 +1,54 @@
+warn "Legacy library @{[(caller(0))[6]]} will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at @{[(caller)[1]]}, line @{[(caller)[2]]}.\n";
+
+# This library is deprecated and unmaintained. It is included for
+# compatibility with Perl 4 scripts which may use it, but it will be
+# removed in a future version of Perl. Please use the File::Find module
+# instead.
+
+# Usage:
+# require "find.pl";
+#
+# &find('/foo','/bar');
+#
+# sub wanted { ... }
+# where wanted does whatever you want. $dir contains the
+# current directory name, and $_ the current filename within
+# that directory. $name contains "$dir/$_". You are cd'ed
+# to $dir when the function is called. The function may
+# set $prune to prune the tree.
+#
+# For example,
+#
+# find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
+#
+# corresponds to this
+#
+# sub wanted {
+# /^\.nfs.*$/ &&
+# (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+# int(-M _) > 7 &&
+# unlink($_)
+# ||
+# ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
+# $dev < 0 &&
+# ($prune = 1);
+# }
+#
+# Set the variable $dont_use_nlink if you're using AFS, since AFS cheats.
+
+use File::Find ();
+
+*name = *File::Find::name;
+*prune = *File::Find::prune;
+*dir = *File::Find::dir;
+*topdir = *File::Find::topdir;
+*topdev = *File::Find::topdev;
+*topino = *File::Find::topino;
+*topmode = *File::Find::topmode;
+*topnlink = *File::Find::topnlink;
+
+sub find {
+ &File::Find::find(\&wanted, @_);
+}
+
+1;
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/oe-ldflags.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/oe-ldflags.patch
new file mode 100644
index 000000000..292e13dc5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/oe-ldflags.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [open-embedded]
+
+Index: openssl-1.0.0/Makefile.shared
+===================================================================
+--- openssl-1.0.0.orig/Makefile.shared
++++ openssl-1.0.0/Makefile.shared
+@@ -92,7 +92,7 @@
+ LINK_APP= \
+ ( $(SET_X); \
+ LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+- LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
++ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$(OE_LDFLAGS) $${LDFLAGS:-$(CFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+@@ -102,7 +102,7 @@
+ ( $(SET_X); \
+ LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+ SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
+- SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
++ SHAREDFLAGS="$(OE_LDFLAGS) $${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-c_rehash.sh b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-c_rehash.sh
new file mode 100644
index 000000000..6620fdcb5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-c_rehash.sh
@@ -0,0 +1,222 @@
+#!/bin/sh
+#
+# Ben Secrest <blsecres@gmail.com>
+#
+# sh c_rehash script, scan all files in a directory
+# and add symbolic links to their hash values.
+#
+# based on the c_rehash perl script distributed with openssl
+#
+# LICENSE: See OpenSSL license
+# ^^acceptable?^^
+#
+
+# default certificate location
+DIR=/etc/openssl
+
+# for filetype bitfield
+IS_CERT=$(( 1 << 0 ))
+IS_CRL=$(( 1 << 1 ))
+
+
+# check to see if a file is a certificate file or a CRL file
+# arguments:
+# 1. the filename to be scanned
+# returns:
+# bitfield of file type; uses ${IS_CERT} and ${IS_CRL}
+#
+check_file()
+{
+ local IS_TYPE=0
+
+ # make IFS a newline so we can process grep output line by line
+ local OLDIFS=${IFS}
+ IFS=$( printf "\n" )
+
+ # XXX: could be more efficient to have two 'grep -m' but is -m portable?
+ for LINE in $( grep '^-----BEGIN .*-----' ${1} )
+ do
+ if echo ${LINE} \
+ | grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----'
+ then
+ IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} ))
+
+ if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ]
+ then
+ break
+ fi
+ elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----'
+ then
+ IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} ))
+
+ if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ]
+ then
+ break
+ fi
+ fi
+ done
+
+ # restore IFS
+ IFS=${OLDIFS}
+
+ return ${IS_TYPE}
+}
+
+
+#
+# use openssl to fingerprint a file
+# arguments:
+# 1. the filename to fingerprint
+# 2. the method to use (x509, crl)
+# returns:
+# none
+# assumptions:
+# user will capture output from last stage of pipeline
+#
+fingerprint()
+{
+ ${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':'
+}
+
+
+#
+# link_hash - create links to certificate files
+# arguments:
+# 1. the filename to create a link for
+# 2. the type of certificate being linked (x509, crl)
+# returns:
+# 0 on success, 1 otherwise
+#
+link_hash()
+{
+ local FINGERPRINT=$( fingerprint ${1} ${2} )
+ local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} )
+ local SUFFIX=0
+ local LINKFILE=''
+ local TAG=''
+
+ if [ ${2} = "crl" ]
+ then
+ TAG='r'
+ fi
+
+ LINKFILE=${HASH}.${TAG}${SUFFIX}
+
+ while [ -f ${LINKFILE} ]
+ do
+ if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ]
+ then
+ echo "NOTE: Skipping duplicate file ${1}" >&2
+ return 1
+ fi
+
+ SUFFIX=$(( ${SUFFIX} + 1 ))
+ LINKFILE=${HASH}.${TAG}${SUFFIX}
+ done
+
+ echo "${3} => ${LINKFILE}"
+
+ # assume any system with a POSIX shell will either support symlinks or
+ # do something to handle this gracefully
+ ln -s ${3} ${LINKFILE}
+
+ return 0
+}
+
+
+# hash_dir create hash links in a given directory
+hash_dir()
+{
+ echo "Doing ${1}"
+
+ cd ${1}
+
+ ls -1 * 2>/dev/null | while read FILE
+ do
+ if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
+ && [ -h "${FILE}" ]
+ then
+ rm ${FILE}
+ fi
+ done
+
+ ls -1 *.pem *.cer *.crt *.crl 2>/dev/null | while read FILE
+ do
+ REAL_FILE=${FILE}
+ # if we run on build host then get to the real files in rootfs
+ if [ -n "${SYSROOT}" -a -h ${FILE} ]
+ then
+ FILE=$( readlink ${FILE} )
+ # check the symlink is absolute (or dangling in other word)
+ if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
+ then
+ REAL_FILE=${SYSROOT}/${FILE}
+ fi
+ fi
+
+ check_file ${REAL_FILE}
+ local FILE_TYPE=${?}
+ local TYPE_STR=''
+
+ if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ]
+ then
+ TYPE_STR='x509'
+ elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ]
+ then
+ TYPE_STR='crl'
+ else
+ echo "NOTE: ${FILE} does not contain a certificate or CRL: skipping" >&2
+ continue
+ fi
+
+ link_hash ${REAL_FILE} ${TYPE_STR} ${FILE}
+ done
+}
+
+
+# choose the name of an ssl application
+if [ -n "${OPENSSL}" ]
+then
+ SSL_CMD=$(which ${OPENSSL} 2>/dev/null)
+else
+ SSL_CMD=/usr/bin/openssl
+ OPENSSL=${SSL_CMD}
+ export OPENSSL
+fi
+
+# fix paths
+PATH=${PATH}:${DIR}/bin
+export PATH
+
+# confirm existance/executability of ssl command
+if ! [ -x ${SSL_CMD} ]
+then
+ echo "${0}: rehashing skipped ('openssl' program not available)" >&2
+ exit 0
+fi
+
+# determine which directories to process
+old_IFS=$IFS
+if [ ${#} -gt 0 ]
+then
+ IFS=':'
+ DIRLIST=${*}
+elif [ -n "${SSL_CERT_DIR}" ]
+then
+ DIRLIST=$SSL_CERT_DIR
+else
+ DIRLIST=${DIR}/certs
+fi
+
+IFS=':'
+
+# process directories
+for CERT_DIR in ${DIRLIST}
+do
+ if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
+ then
+ IFS=$old_IFS
+ hash_dir ${CERT_DIR}
+ IFS=':'
+ fi
+done
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-fix-des.pod-error.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-fix-des.pod-error.patch
new file mode 100644
index 000000000..de49729e5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-fix-des.pod-error.patch
@@ -0,0 +1,19 @@
+openssl: Fix pod2man des.pod error on Ubuntu 12.04
+
+This is a formatting fix, '=back' is required before
+'=head1' on Ubuntu 12.04.
+
+Upstream-Status: Pending
+Signed-off-by: Baogen Shang <baogen.shang@windriver.com>
+diff -urpN a_origin/des.pod b_modify/des.pod
+--- a_origin/crypto/des/des.pod 2013-08-15 15:02:56.211674589 +0800
++++ b_modify/crypto/des/des.pod 2013-08-15 15:04:14.439674580 +0800
+@@ -181,6 +181,8 @@ the uuencoded file to embed in the begin
+ output. If there is no name specified after the B<-u>, the name text.des
+ will be embedded in the header.
+
++=back
++
+ =head1 SEE ALSO
+
+ ps(1),
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-util-perlpath.pl-cwd.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-util-perlpath.pl-cwd.patch
new file mode 100644
index 000000000..065b9b122
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl-util-perlpath.pl-cwd.patch
@@ -0,0 +1,34 @@
+From e427748f3bb5d37e78dc8d70a558c373aa8ababb Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 19 Sep 2016 22:06:28 -0700
+Subject: [PATCH] util/perlpath.pl: make it work when cwd is not in @INC
+
+Fixed when building on Debian-testing:
+| Can't locate find.pl in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.2 /usr/local/share/perl/5.22.2 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at perlpath.pl line 7.
+
+The find.pl is added by oe-core, so once openssl/find.pl is removed,
+then this patch can be dropped.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ util/perlpath.pl | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/util/perlpath.pl b/util/perlpath.pl
+index a1f236b..5599892 100755
+--- a/util/perlpath.pl
++++ b/util/perlpath.pl
+@@ -4,6 +4,8 @@
+ # line in all scripts that rely on perl.
+ #
+
++BEGIN { unshift @INC, "."; }
++
+ require "find.pl";
+
+ $#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
+--
+2.9.0
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl_fix_for_x32.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl_fix_for_x32.patch
new file mode 100644
index 000000000..0f08a642f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/openssl_fix_for_x32.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Pending
+
+Received from H J Liu @ Intel
+Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13
+
+ported the patch to the 1.0.0e version
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
+Index: openssl-1.0.2/crypto/bn/bn.h
+===================================================================
+--- openssl-1.0.2.orig/crypto/bn/bn.h
++++ openssl-1.0.2/crypto/bn/bn.h
+@@ -173,6 +173,13 @@ extern "C" {
+ # endif
+ # endif
+
++/* Address type. */
++#ifdef _WIN64
++#define BN_ADDR unsigned long long
++#else
++#define BN_ADDR unsigned long
++#endif
++
+ /*
+ * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
+ * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
+Index: openssl-1.0.2/crypto/bn/bn_exp.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/bn/bn_exp.c
++++ openssl-1.0.2/crypto/bn/bn_exp.c
+@@ -638,7 +638,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU
+ * multiple.
+ */
+ #define MOD_EXP_CTIME_ALIGN(x_) \
+- ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
++ ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ADDR)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
+
+ /*
+ * This variant of BN_mod_exp_mont() uses fixed windows and the special
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/parallel.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/parallel.patch
new file mode 100644
index 000000000..e5413bf38
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/parallel.patch
@@ -0,0 +1,370 @@
+From 7fb1192f112c1920bfd39f4185f34e9afff3cff2 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Sat, 5 Mar 2016 00:12:02 +0000
+Subject: [PATCH 24/28] Fix the parallel races in the Makefiles.
+
+This patch was taken from the Gentoo packaging:
+https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/openssl/files/openssl-1.0.2g-parallel-build.patch
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Refreshed for 1.0.2i
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+---
+ Makefile.org | 14 +-
+ Makefile.org.orig | 10 +-
+ Makefile.shared | 2 +
+ Makefile.shared.orig | 655 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ crypto/Makefile | 10 +-
+ engines/Makefile | 6 +-
+ engines/Makefile.orig | 338 ++++++++++++++++++++++++++
+ test/Makefile | 92 +++----
+ test/Makefile.orig | 88 ++++---
+ 9 files changed, 1108 insertions(+), 107 deletions(-)
+ create mode 100644 Makefile.shared.orig
+ create mode 100644 engines/Makefile.orig
+
+diff --git a/Makefile.org b/Makefile.org
+index 8e7936c..ed98d2a 100644
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -283,17 +283,17 @@ build_libcrypto: build_crypto build_engines libcrypto.pc
+ build_libssl: build_ssl libssl.pc
+
+ build_crypto:
+- @dir=crypto; target=all; $(BUILD_ONE_CMD)
++ +@dir=crypto; target=all; $(BUILD_ONE_CMD)
+ build_ssl: build_crypto
+- @dir=ssl; target=all; $(BUILD_ONE_CMD)
++ +@dir=ssl; target=all; $(BUILD_ONE_CMD)
+ build_engines: build_crypto
+- @dir=engines; target=all; $(BUILD_ONE_CMD)
++ +@dir=engines; target=all; $(BUILD_ONE_CMD)
+ build_apps: build_libs
+- @dir=apps; target=all; $(BUILD_ONE_CMD)
++ +@dir=apps; target=all; $(BUILD_ONE_CMD)
+ build_tests: build_libs
+- @dir=test; target=all; $(BUILD_ONE_CMD)
++ +@dir=test; target=all; $(BUILD_ONE_CMD)
+ build_tools: build_libs
+- @dir=tools; target=all; $(BUILD_ONE_CMD)
++ +@dir=tools; target=all; $(BUILD_ONE_CMD)
+
+ all_testapps: build_libs build_testapps
+ build_testapps:
+@@ -565,7 +565,7 @@ install_sw:
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
+ done;
+- @set -e; target=install; $(RECURSIVE_BUILD_CMD)
++ +@set -e; target=install; $(RECURSIVE_BUILD_CMD)
+ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
+ do \
+ if [ -f "$$i" ]; then \
+diff --git a/Makefile.shared b/Makefile.shared
+index f6f92e7..8164186 100644
+--- a/Makefile.shared
++++ b/Makefile.shared
+@@ -105,6 +105,7 @@ LINK_SO= \
+ SHAREDFLAGS="$(OE_LDFLAGS) $${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
++ [ -e $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX ] && exit 0; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
+@@ -122,6 +123,7 @@ SYMLINK_SO= \
+ done; \
+ fi; \
+ if [ -n "$$SHLIB_SOVER" ]; then \
++ [ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \
+ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
+ ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
+ fi; \
+diff --git a/crypto/Makefile b/crypto/Makefile
+index 17a87f8..29c2dcf 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -85,11 +85,11 @@ testapps:
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+ subdirs:
+- @target=all; $(RECURSIVE_MAKE)
++ +@target=all; $(RECURSIVE_MAKE)
+
+ files:
+ $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
+- @target=files; $(RECURSIVE_MAKE)
++ +@target=files; $(RECURSIVE_MAKE)
+
+ links:
+ @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
+@@ -100,7 +100,7 @@ links:
+ # lib: $(LIB): are splitted to avoid end-less loop
+ lib: $(LIB)
+ @touch lib
+-$(LIB): $(LIBOBJ)
++$(LIB): $(LIBOBJ) | subdirs
+ $(AR) $(LIB) $(LIBOBJ)
+ test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
+ $(RANLIB) $(LIB) || echo Never mind.
+@@ -111,7 +111,7 @@ shared: buildinf.h lib subdirs
+ fi
+
+ libs:
+- @target=lib; $(RECURSIVE_MAKE)
++ +@target=lib; $(RECURSIVE_MAKE)
+
+ install:
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+@@ -120,7 +120,7 @@ install:
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
+ done;
+- @target=install; $(RECURSIVE_MAKE)
++ +@target=install; $(RECURSIVE_MAKE)
+
+ lint:
+ @target=lint; $(RECURSIVE_MAKE)
+diff --git a/engines/Makefile b/engines/Makefile
+index fe8e9ca..a43d21b 100644
+--- a/engines/Makefile
++++ b/engines/Makefile
+@@ -72,7 +72,7 @@ top:
+
+ all: lib subdirs
+
+-lib: $(LIBOBJ)
++lib: $(LIBOBJ) | subdirs
+ @if [ -n "$(SHARED_LIBS)" ]; then \
+ set -e; \
+ for l in $(LIBNAMES); do \
+@@ -89,7 +89,7 @@ lib: $(LIBOBJ)
+
+ subdirs:
+ echo $(EDIRS)
+- @target=all; $(RECURSIVE_MAKE)
++ +@target=all; $(RECURSIVE_MAKE)
+
+ files:
+ $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+@@ -128,7 +128,7 @@ install:
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx ); \
+ done; \
+ fi
+- @target=install; $(RECURSIVE_MAKE)
++ +@target=install; $(RECURSIVE_MAKE)
+
+ tags:
+ ctags $(SRC)
+diff --git a/test/Makefile b/test/Makefile
+index 40abd60..78d3788 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -145,7 +145,7 @@ install:
+ tags:
+ ctags $(SRC)
+
+-tests: exe apps $(TESTS)
++tests: exe $(TESTS)
+
+ apps:
+ @(cd ..; $(MAKE) DIRS=apps all)
+@@ -444,139 +444,139 @@ BUILD_CMD_STATIC=shlib_target=; \
+ link_app.$${shlib_target}
+
+ $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
+- @target=$(RSATEST); $(BUILD_CMD)
++ +@target=$(RSATEST); $(BUILD_CMD)
+
+ $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
+- @target=$(BNTEST); $(BUILD_CMD)
++ +@target=$(BNTEST); $(BUILD_CMD)
+
+ $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
+- @target=$(ECTEST); $(BUILD_CMD)
++ +@target=$(ECTEST); $(BUILD_CMD)
+
+ $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
+- @target=$(EXPTEST); $(BUILD_CMD)
++ +@target=$(EXPTEST); $(BUILD_CMD)
+
+ $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
+- @target=$(IDEATEST); $(BUILD_CMD)
++ +@target=$(IDEATEST); $(BUILD_CMD)
+
+ $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
+- @target=$(MD2TEST); $(BUILD_CMD)
++ +@target=$(MD2TEST); $(BUILD_CMD)
+
+ $(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO)
+- @target=$(SHATEST); $(BUILD_CMD)
++ +@target=$(SHATEST); $(BUILD_CMD)
+
+ $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
+- @target=$(SHA1TEST); $(BUILD_CMD)
++ +@target=$(SHA1TEST); $(BUILD_CMD)
+
+ $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
+- @target=$(SHA256TEST); $(BUILD_CMD)
++ +@target=$(SHA256TEST); $(BUILD_CMD)
+
+ $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
+- @target=$(SHA512TEST); $(BUILD_CMD)
++ +@target=$(SHA512TEST); $(BUILD_CMD)
+
+ $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
+- @target=$(RMDTEST); $(BUILD_CMD)
++ +@target=$(RMDTEST); $(BUILD_CMD)
+
+ $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
+- @target=$(MDC2TEST); $(BUILD_CMD)
++ +@target=$(MDC2TEST); $(BUILD_CMD)
+
+ $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
+- @target=$(MD4TEST); $(BUILD_CMD)
++ +@target=$(MD4TEST); $(BUILD_CMD)
+
+ $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
+- @target=$(MD5TEST); $(BUILD_CMD)
++ +@target=$(MD5TEST); $(BUILD_CMD)
+
+ $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
+- @target=$(HMACTEST); $(BUILD_CMD)
++ +@target=$(HMACTEST); $(BUILD_CMD)
+
+ $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
+- @target=$(WPTEST); $(BUILD_CMD)
++ +@target=$(WPTEST); $(BUILD_CMD)
+
+ $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
+- @target=$(RC2TEST); $(BUILD_CMD)
++ +@target=$(RC2TEST); $(BUILD_CMD)
+
+ $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
+- @target=$(BFTEST); $(BUILD_CMD)
++ +@target=$(BFTEST); $(BUILD_CMD)
+
+ $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
+- @target=$(CASTTEST); $(BUILD_CMD)
++ +@target=$(CASTTEST); $(BUILD_CMD)
+
+ $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
+- @target=$(RC4TEST); $(BUILD_CMD)
++ +@target=$(RC4TEST); $(BUILD_CMD)
+
+ $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
+- @target=$(RC5TEST); $(BUILD_CMD)
++ +@target=$(RC5TEST); $(BUILD_CMD)
+
+ $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
+- @target=$(DESTEST); $(BUILD_CMD)
++ +@target=$(DESTEST); $(BUILD_CMD)
+
+ $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
+- @target=$(RANDTEST); $(BUILD_CMD)
++ +@target=$(RANDTEST); $(BUILD_CMD)
+
+ $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
+- @target=$(DHTEST); $(BUILD_CMD)
++ +@target=$(DHTEST); $(BUILD_CMD)
+
+ $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
+- @target=$(DSATEST); $(BUILD_CMD)
++ +@target=$(DSATEST); $(BUILD_CMD)
+
+ $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
+- @target=$(METHTEST); $(BUILD_CMD)
++ +@target=$(METHTEST); $(BUILD_CMD)
+
+ $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
+- @target=$(SSLTEST); $(FIPS_BUILD_CMD)
++ +@target=$(SSLTEST); $(FIPS_BUILD_CMD)
+
+ $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
+- @target=$(ENGINETEST); $(BUILD_CMD)
++ +@target=$(ENGINETEST); $(BUILD_CMD)
+
+ $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
+- @target=$(EVPTEST); $(BUILD_CMD)
++ +@target=$(EVPTEST); $(BUILD_CMD)
+
+ $(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
+- @target=$(EVPEXTRATEST); $(BUILD_CMD)
++ +@target=$(EVPEXTRATEST); $(BUILD_CMD)
+
+ $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
+- @target=$(ECDSATEST); $(BUILD_CMD)
++ +@target=$(ECDSATEST); $(BUILD_CMD)
+
+ $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
+- @target=$(ECDHTEST); $(BUILD_CMD)
++ +@target=$(ECDHTEST); $(BUILD_CMD)
+
+ $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
+- @target=$(IGETEST); $(BUILD_CMD)
++ +@target=$(IGETEST); $(BUILD_CMD)
+
+ $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO)
+- @target=$(JPAKETEST); $(BUILD_CMD)
++ +@target=$(JPAKETEST); $(BUILD_CMD)
+
+ $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO)
+- @target=$(ASN1TEST); $(BUILD_CMD)
++ +@target=$(ASN1TEST); $(BUILD_CMD)
+
+ $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
+- @target=$(SRPTEST); $(BUILD_CMD)
++ +@target=$(SRPTEST); $(BUILD_CMD)
+
+ $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
+- @target=$(V3NAMETEST); $(BUILD_CMD)
++ +@target=$(V3NAMETEST); $(BUILD_CMD)
+
+ $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO)
+- @target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
++ +@target=$(HEARTBEATTEST); $(BUILD_CMD_STATIC)
+
+ $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
+- @target=$(CONSTTIMETEST) $(BUILD_CMD)
++ +@target=$(CONSTTIMETEST) $(BUILD_CMD)
+
+ $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
+- @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
++ +@target=$(VERIFYEXTRATEST) $(BUILD_CMD)
+
+ $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o
+- @target=$(CLIENTHELLOTEST) $(BUILD_CMD)
++ +@target=$(CLIENTHELLOTEST) $(BUILD_CMD)
+
+ $(BADDTLSTEST)$(EXE_EXT): $(BADDTLSTEST).o
+- @target=$(BADDTLSTEST) $(BUILD_CMD)
++ +@target=$(BADDTLSTEST) $(BUILD_CMD)
+
+ $(FATALERRTEST)$(EXE_EXT): $(FATALERRTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
+ @target=$(FATALERRTEST); exobj=ssltestlib.o; $(BUILD_CMD)
+
+ $(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFTEST).o
+- @target=$(SSLV2CONFTEST) $(BUILD_CMD)
++ +@target=$(SSLV2CONFTEST) $(BUILD_CMD)
+
+ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
+- @target=$(DTLSTEST); exobj=ssltestlib.o; $(BUILD_CMD)
++ +@target=$(DTLSTEST); exobj=ssltestlib.o; $(BUILD_CMD)
+
+ #$(AESTEST).o: $(AESTEST).c
+ # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
+@@ -589,7 +589,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO)
+ # fi
+
+ dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
+- @target=dummytest; $(BUILD_CMD)
++ +@target=dummytest; $(BUILD_CMD)
+
+ # DO NOT DELETE THIS LINE -- make depend depends on it.
+
+--
+2.15.1
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest-deps.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest-deps.patch
new file mode 100644
index 000000000..ef6d17934
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest-deps.patch
@@ -0,0 +1,34 @@
+Remove Makefile dependencies for test targets
+
+These are probably here because the executables aren't always built for
+other platforms (e.g. Windows); however we can safely assume they'll
+always be there. None of the other test targets have such dependencies
+and if we don't remove them, make tries to rebuild the executables and
+fails during run-ptest.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Index: openssl-1.0.2/test/Makefile
+===================================================================
+--- openssl-1.0.2.orig/test/Makefile
++++ openssl-1.0.2/test/Makefile
+@@ -330,7 +330,7 @@ test_cms: ../apps/openssl$(EXE_EXT) cms-
+ @echo "CMS consistency test"
+ $(PERL) cms-test.pl
+
+-test_srp: $(SRPTEST)$(EXE_EXT)
++test_srp:
+ @echo "Test SRP"
+ ../util/shlib_wrap.sh ./srptest
+
+@@ -342,7 +342,7 @@ test_v3name: $(V3NAMETEST)$(EXE_EXT)
+ @echo "Test X509v3_check_*"
+ ../util/shlib_wrap.sh ./$(V3NAMETEST)
+
+-test_heartbeat: $(HEARTBEATTEST)$(EXE_EXT)
++test_heartbeat:
+ ../util/shlib_wrap.sh ./$(HEARTBEATTEST)
+
+ test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest_makefile_deps.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest_makefile_deps.patch
new file mode 100644
index 000000000..4202e61d1
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/ptest_makefile_deps.patch
@@ -0,0 +1,248 @@
+Additional Makefile dependencies removal for test targets
+
+Removing the dependency check for test targets as these tests are
+causing a number of failures and "noise" during ptest execution.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+
+diff -Naur openssl-1.0.2d-orig/test/Makefile openssl-1.0.2d/test/Makefile
+--- openssl-1.0.2d-orig/test/Makefile 2015-09-28 12:50:41.530022979 +0300
++++ openssl-1.0.2d/test/Makefile 2015-09-28 12:57:45.930717240 +0300
+@@ -155,67 +155,67 @@
+ ( $(MAKE) $$i && echo "PASS: $$i" ) || echo "FAIL: $$i"; \
+ done)
+
+-test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt
++test_evp:
+ ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt
+
+-test_evp_extra: $(EVPEXTRATEST)$(EXE_EXT)
++test_evp_extra:
+ ../util/shlib_wrap.sh ./$(EVPEXTRATEST)
+
+-test_des: $(DESTEST)$(EXE_EXT)
++test_des:
+ ../util/shlib_wrap.sh ./$(DESTEST)
+
+-test_idea: $(IDEATEST)$(EXE_EXT)
++test_idea:
+ ../util/shlib_wrap.sh ./$(IDEATEST)
+
+-test_sha: $(SHATEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT)
++test_sha:
+ ../util/shlib_wrap.sh ./$(SHATEST)
+ ../util/shlib_wrap.sh ./$(SHA1TEST)
+ ../util/shlib_wrap.sh ./$(SHA256TEST)
+ ../util/shlib_wrap.sh ./$(SHA512TEST)
+
+-test_mdc2: $(MDC2TEST)$(EXE_EXT)
++test_mdc2:
+ ../util/shlib_wrap.sh ./$(MDC2TEST)
+
+-test_md5: $(MD5TEST)$(EXE_EXT)
++test_md5:
+ ../util/shlib_wrap.sh ./$(MD5TEST)
+
+-test_md4: $(MD4TEST)$(EXE_EXT)
++test_md4:
+ ../util/shlib_wrap.sh ./$(MD4TEST)
+
+-test_hmac: $(HMACTEST)$(EXE_EXT)
++test_hmac:
+ ../util/shlib_wrap.sh ./$(HMACTEST)
+
+-test_wp: $(WPTEST)$(EXE_EXT)
++test_wp:
+ ../util/shlib_wrap.sh ./$(WPTEST)
+
+-test_md2: $(MD2TEST)$(EXE_EXT)
++test_md2:
+ ../util/shlib_wrap.sh ./$(MD2TEST)
+
+-test_rmd: $(RMDTEST)$(EXE_EXT)
++test_rmd:
+ ../util/shlib_wrap.sh ./$(RMDTEST)
+
+-test_bf: $(BFTEST)$(EXE_EXT)
++test_bf:
+ ../util/shlib_wrap.sh ./$(BFTEST)
+
+-test_cast: $(CASTTEST)$(EXE_EXT)
++test_cast:
+ ../util/shlib_wrap.sh ./$(CASTTEST)
+
+-test_rc2: $(RC2TEST)$(EXE_EXT)
++test_rc2:
+ ../util/shlib_wrap.sh ./$(RC2TEST)
+
+-test_rc4: $(RC4TEST)$(EXE_EXT)
++test_rc4:
+ ../util/shlib_wrap.sh ./$(RC4TEST)
+
+-test_rc5: $(RC5TEST)$(EXE_EXT)
++test_rc5:
+ ../util/shlib_wrap.sh ./$(RC5TEST)
+
+-test_rand: $(RANDTEST)$(EXE_EXT)
++test_rand:
+ ../util/shlib_wrap.sh ./$(RANDTEST)
+
+-test_enc: ../apps/openssl$(EXE_EXT) testenc
++test_enc:
+ @sh ./testenc
+
+-test_x509: ../apps/openssl$(EXE_EXT) tx509 testx509.pem v3-cert1.pem v3-cert2.pem
++test_x509:
+ echo test normal x509v1 certificate
+ sh ./tx509 2>/dev/null
+ echo test first x509v3 certificate
+@@ -223,25 +223,25 @@
+ echo test second x509v3 certificate
+ sh ./tx509 v3-cert2.pem 2>/dev/null
+
+-test_rsa: ../apps/openssl$(EXE_EXT) trsa testrsa.pem
++test_rsa:
+ @sh ./trsa 2>/dev/null
+ ../util/shlib_wrap.sh ./$(RSATEST)
+
+-test_crl: ../apps/openssl$(EXE_EXT) tcrl testcrl.pem
++test_crl:
+ @sh ./tcrl 2>/dev/null
+
+-test_sid: ../apps/openssl$(EXE_EXT) tsid testsid.pem
++test_sid:
+ @sh ./tsid 2>/dev/null
+
+-test_req: ../apps/openssl$(EXE_EXT) treq testreq.pem testreq2.pem
++test_req:
+ @sh ./treq 2>/dev/null
+ @sh ./treq testreq2.pem 2>/dev/null
+
+-test_pkcs7: ../apps/openssl$(EXE_EXT) tpkcs7 tpkcs7d testp7.pem pkcs7-1.pem
++test_pkcs7:
+ @sh ./tpkcs7 2>/dev/null
+ @sh ./tpkcs7d 2>/dev/null
+
+-test_bn: $(BNTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) bctest
++test_bn:
+ @echo starting big number library test, could take a while...
+ @../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest
+ @echo quit >>tmp.bntest
+@@ -250,33 +250,33 @@
+ @echo 'test a^b%c implementations'
+ ../util/shlib_wrap.sh ./$(EXPTEST)
+
+-test_ec: $(ECTEST)$(EXE_EXT)
++test_ec:
+ @echo 'test elliptic curves'
+ ../util/shlib_wrap.sh ./$(ECTEST)
+
+-test_ecdsa: $(ECDSATEST)$(EXE_EXT)
++test_ecdsa:
+ @echo 'test ecdsa'
+ ../util/shlib_wrap.sh ./$(ECDSATEST)
+
+-test_ecdh: $(ECDHTEST)$(EXE_EXT)
++test_ecdh:
+ @echo 'test ecdh'
+ ../util/shlib_wrap.sh ./$(ECDHTEST)
+
+-test_verify: ../apps/openssl$(EXE_EXT)
++test_verify:
+ @echo "The following command should have some OK's and some failures"
+ @echo "There are definitly a few expired certificates"
+ ../util/shlib_wrap.sh ../apps/openssl verify -CApath ../certs/demo ../certs/demo/*.pem
+
+-test_dh: $(DHTEST)$(EXE_EXT)
++test_dh:
+ @echo "Generate a set of DH parameters"
+ ../util/shlib_wrap.sh ./$(DHTEST)
+
+-test_dsa: $(DSATEST)$(EXE_EXT)
++test_dsa:
+ @echo "Generate a set of DSA parameters"
+ ../util/shlib_wrap.sh ./$(DSATEST)
+ ../util/shlib_wrap.sh ./$(DSATEST) -app2_1
+
+-test_gen testreq.pem: ../apps/openssl$(EXE_EXT) testgen test.cnf
++test_gen testreq.pem:
+ @echo "Generate and verify a certificate request"
+ @sh ./testgen
+
+@@ -288,13 +288,11 @@
+ @cat certCA.ss certU.ss > intP1.ss
+ @cat certCA.ss certU.ss certP1.ss > intP2.ss
+
+-test_engine: $(ENGINETEST)$(EXE_EXT)
++test_engine:
+ @echo "Manipulate the ENGINE structures"
+ ../util/shlib_wrap.sh ./$(ENGINETEST)
+
+-test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \
+- intP1.ss intP2.ss $(SSLTEST)$(EXE_EXT) testssl testsslproxy \
+- ../apps/server2.pem serverinfo.pem
++test_ssl:
+ @echo "test SSL protocol"
+ @if [ -n "$(FIPSCANLIB)" ]; then \
+ sh ./testfipsssl keyU.ss certU.ss certCA.ss; \
+@@ -304,7 +302,7 @@
+ @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss
+ @sh ./testsslproxy keyP2.ss certP2.ss intP2.ss
+
+-test_ca: ../apps/openssl$(EXE_EXT) testca CAss.cnf Uss.cnf
++test_ca:
+ @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
+ echo "skipping CA.sh test -- requires RSA"; \
+ else \
+@@ -312,11 +310,11 @@
+ sh ./testca; \
+ fi
+
+-test_aes: #$(AESTEST)
++test_aes:
+ # @echo "test Rijndael"
+ # ../util/shlib_wrap.sh ./$(AESTEST)
+
+-test_tsa: ../apps/openssl$(EXE_EXT) testtsa CAtsa.cnf ../util/shlib_wrap.sh
++test_tsa:
+ @if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then \
+ echo "skipping testtsa test -- requires RSA"; \
+ else \
+@@ -331,7 +329,7 @@
+ @echo "Test JPAKE"
+ ../util/shlib_wrap.sh ./$(JPAKETEST)
+
+-test_cms: ../apps/openssl$(EXE_EXT) cms-test.pl smcont.txt
++test_cms:
+ @echo "CMS consistency test"
+ $(PERL) cms-test.pl
+
+@@ -339,22 +337,22 @@
+ @echo "Test SRP"
+ ../util/shlib_wrap.sh ./srptest
+
+-test_ocsp: ../apps/openssl$(EXE_EXT) tocsp
++test_ocsp:
+ @echo "Test OCSP"
+ @sh ./tocsp
+
+-test_v3name: $(V3NAMETEST)$(EXE_EXT)
++test_v3name:
+ @echo "Test X509v3_check_*"
+ ../util/shlib_wrap.sh ./$(V3NAMETEST)
+
+ test_heartbeat:
+ ../util/shlib_wrap.sh ./$(HEARTBEATTEST)
+
+-test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
++test_constant_time:
+ @echo "Test constant time utilites"
+ ../util/shlib_wrap.sh ./$(CONSTTIMETEST)
+
+-test_verify_extra: $(VERIFYEXTRATEST)$(EXE_EXT)
++test_verify_extra:
+ @echo $(START) $@
+ ../util/shlib_wrap.sh ./$(VERIFYEXTRATEST)
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-cflags.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-cflags.patch
new file mode 100644
index 000000000..2803cb039
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-cflags.patch
@@ -0,0 +1,20 @@
+Allow passing custom c-flags to mkbuildinf.pl in order to pass
+flags without any build host references
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+--- Makefile 2018-03-06 14:50:18.342138147 -0800
++++ Makefile 2018-03-06 15:24:04.794239071 -0800
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -55,7 +55,7 @@
+ all: shared
+
+ buildinf.h: ../Makefile
+- $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
++ $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC_INFO)" "$(PLATFORM)" >buildinf.h
+
+ x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
+ $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-mkbuildinf.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-mkbuildinf.patch
new file mode 100644
index 000000000..b55673121
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/reproducible-mkbuildinf.patch
@@ -0,0 +1,21 @@
+If SOURCE_DATE_EPOCH is present in the environment, use it as build date.
+Also make sure to use UTC time.
+
+Upstream-Status: Backport [ https://github.com/openssl/openssl/blob/master/util/mkbuildinf.pl ]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+--- mkbuildinf.pl 2018-03-06 14:20:09.438048058 -0800
++++ mkbuildinf.pl 2018-03-06 14:19:20.722045632 -0800
+--- a/util/mkbuildinf.pl
++++ b/util/mkbuildinf.pl
+@@ -3,7 +3,8 @@
+ my ($cflags, $platform) = @ARGV;
+
+ $cflags = "compiler: $cflags";
+-$date = localtime();
++my $date = gmtime($ENV{'SOURCE_DATE_EPOCH'} || time()) . " UTC";
++
+ print <<"END_OUTPUT";
+ #ifndef MK1MF_BUILD
+ /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/run-ptest b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/run-ptest
new file mode 100755
index 000000000..3b20fce1e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/shared-libs.patch b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/shared-libs.patch
new file mode 100644
index 000000000..a7ca0a307
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl-1.0.2o/shared-libs.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: openssl-1.0.1e/crypto/Makefile
+===================================================================
+--- openssl-1.0.1e.orig/crypto/Makefile
++++ openssl-1.0.1e/crypto/Makefile
+@@ -108,7 +108,7 @@ $(LIB): $(LIBOBJ)
+
+ shared: buildinf.h lib subdirs
+ if [ -n "$(SHARED_LIBS)" ]; then \
+- (cd ..; $(MAKE) $(SHARED_LIB)); \
++ (cd ..; $(MAKE) -e $(SHARED_LIB)); \
+ fi
+
+ libs:
+Index: openssl-1.0.1e/Makefile.org
+===================================================================
+--- openssl-1.0.1e.orig/Makefile.org
++++ openssl-1.0.1e/Makefile.org
+@@ -310,7 +310,7 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_
+
+ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
+ @if [ "$(SHLIB_TARGET)" != "" ]; then \
+- $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
++ $(MAKE) -e SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
+ else \
+ echo "There's no support for shared libraries on this platform" >&2; \
+ exit 1; \
+Index: openssl-1.0.1e/ssl/Makefile
+===================================================================
+--- openssl-1.0.1e.orig/ssl/Makefile
++++ openssl-1.0.1e/ssl/Makefile
+@@ -62,7 +62,7 @@ lib: $(LIBOBJ)
+
+ shared: lib
+ if [ -n "$(SHARED_LIBS)" ]; then \
+- (cd ..; $(MAKE) $(SHARED_LIB)); \
++ (cd ..; $(MAKE) -e $(SHARED_LIB)); \
+ fi
+
+ files:
diff --git a/poky/meta/recipes-connectivity/openssl/openssl/0001-Take-linking-flags-from-LDFLAGS-env-var.patch b/poky/meta/recipes-connectivity/openssl/openssl/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
new file mode 100644
index 000000000..6ce4e47d7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl/0001-Take-linking-flags-from-LDFLAGS-env-var.patch
@@ -0,0 +1,43 @@
+From 08face4353d80111973aba9c1304c92158cfad0e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 28 Mar 2017 16:40:12 +0300
+Subject: [PATCH] Take linking flags from LDFLAGS env var
+
+This fixes "No GNU_HASH in the elf binary" issues.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Configurations/unix-Makefile.tmpl | 2 +-
+ Configure | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
+index c029817..43b769b 100644
+--- a/Configurations/unix-Makefile.tmpl
++++ b/Configurations/unix-Makefile.tmpl
+@@ -173,7 +173,7 @@ CROSS_COMPILE= {- $config{cross_compile_prefix} -}
+ CC= $(CROSS_COMPILE){- $target{cc} -}
+ CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
+ CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
+-LDFLAGS= {- $target{lflags} -}
++LDFLAGS= {- $target{lflags}." ".$ENV{'LDFLAGS'} -}
+ PLIB_LDFLAGS= {- $target{plib_lflags} -}
+ EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
+ LIB_CFLAGS={- $target{shared_cflag} || "" -}
+diff --git a/Configure b/Configure
+index aee7cc3..274d236 100755
+--- a/Configure
++++ b/Configure
+@@ -979,7 +979,7 @@ $config{build_file} = $target{build_file};
+ $config{defines} = [];
+ $config{cflags} = "";
+ $config{ex_libs} = "";
+-$config{shared_ldflag} = "";
++$config{shared_ldflag} = $ENV{'LDFLAGS'};
+
+ # Make sure build_scheme is consistent.
+ $target{build_scheme} = [ $target{build_scheme} ]
+--
+2.11.0
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh b/poky/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh
new file mode 100644
index 000000000..6620fdcb5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl/openssl-c_rehash.sh
@@ -0,0 +1,222 @@
+#!/bin/sh
+#
+# Ben Secrest <blsecres@gmail.com>
+#
+# sh c_rehash script, scan all files in a directory
+# and add symbolic links to their hash values.
+#
+# based on the c_rehash perl script distributed with openssl
+#
+# LICENSE: See OpenSSL license
+# ^^acceptable?^^
+#
+
+# default certificate location
+DIR=/etc/openssl
+
+# for filetype bitfield
+IS_CERT=$(( 1 << 0 ))
+IS_CRL=$(( 1 << 1 ))
+
+
+# check to see if a file is a certificate file or a CRL file
+# arguments:
+# 1. the filename to be scanned
+# returns:
+# bitfield of file type; uses ${IS_CERT} and ${IS_CRL}
+#
+check_file()
+{
+ local IS_TYPE=0
+
+ # make IFS a newline so we can process grep output line by line
+ local OLDIFS=${IFS}
+ IFS=$( printf "\n" )
+
+ # XXX: could be more efficient to have two 'grep -m' but is -m portable?
+ for LINE in $( grep '^-----BEGIN .*-----' ${1} )
+ do
+ if echo ${LINE} \
+ | grep -q -E '^-----BEGIN (X509 |TRUSTED )?CERTIFICATE-----'
+ then
+ IS_TYPE=$(( ${IS_TYPE} | ${IS_CERT} ))
+
+ if [ $(( ${IS_TYPE} & ${IS_CRL} )) -ne 0 ]
+ then
+ break
+ fi
+ elif echo ${LINE} | grep -q '^-----BEGIN X509 CRL-----'
+ then
+ IS_TYPE=$(( ${IS_TYPE} | ${IS_CRL} ))
+
+ if [ $(( ${IS_TYPE} & ${IS_CERT} )) -ne 0 ]
+ then
+ break
+ fi
+ fi
+ done
+
+ # restore IFS
+ IFS=${OLDIFS}
+
+ return ${IS_TYPE}
+}
+
+
+#
+# use openssl to fingerprint a file
+# arguments:
+# 1. the filename to fingerprint
+# 2. the method to use (x509, crl)
+# returns:
+# none
+# assumptions:
+# user will capture output from last stage of pipeline
+#
+fingerprint()
+{
+ ${SSL_CMD} ${2} -fingerprint -noout -in ${1} | sed 's/^.*=//' | tr -d ':'
+}
+
+
+#
+# link_hash - create links to certificate files
+# arguments:
+# 1. the filename to create a link for
+# 2. the type of certificate being linked (x509, crl)
+# returns:
+# 0 on success, 1 otherwise
+#
+link_hash()
+{
+ local FINGERPRINT=$( fingerprint ${1} ${2} )
+ local HASH=$( ${SSL_CMD} ${2} -hash -noout -in ${1} )
+ local SUFFIX=0
+ local LINKFILE=''
+ local TAG=''
+
+ if [ ${2} = "crl" ]
+ then
+ TAG='r'
+ fi
+
+ LINKFILE=${HASH}.${TAG}${SUFFIX}
+
+ while [ -f ${LINKFILE} ]
+ do
+ if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ]
+ then
+ echo "NOTE: Skipping duplicate file ${1}" >&2
+ return 1
+ fi
+
+ SUFFIX=$(( ${SUFFIX} + 1 ))
+ LINKFILE=${HASH}.${TAG}${SUFFIX}
+ done
+
+ echo "${3} => ${LINKFILE}"
+
+ # assume any system with a POSIX shell will either support symlinks or
+ # do something to handle this gracefully
+ ln -s ${3} ${LINKFILE}
+
+ return 0
+}
+
+
+# hash_dir create hash links in a given directory
+hash_dir()
+{
+ echo "Doing ${1}"
+
+ cd ${1}
+
+ ls -1 * 2>/dev/null | while read FILE
+ do
+ if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \
+ && [ -h "${FILE}" ]
+ then
+ rm ${FILE}
+ fi
+ done
+
+ ls -1 *.pem *.cer *.crt *.crl 2>/dev/null | while read FILE
+ do
+ REAL_FILE=${FILE}
+ # if we run on build host then get to the real files in rootfs
+ if [ -n "${SYSROOT}" -a -h ${FILE} ]
+ then
+ FILE=$( readlink ${FILE} )
+ # check the symlink is absolute (or dangling in other word)
+ if [ "x/" = "x$( echo ${FILE} | cut -c1 -)" ]
+ then
+ REAL_FILE=${SYSROOT}/${FILE}
+ fi
+ fi
+
+ check_file ${REAL_FILE}
+ local FILE_TYPE=${?}
+ local TYPE_STR=''
+
+ if [ $(( ${FILE_TYPE} & ${IS_CERT} )) -ne 0 ]
+ then
+ TYPE_STR='x509'
+ elif [ $(( ${FILE_TYPE} & ${IS_CRL} )) -ne 0 ]
+ then
+ TYPE_STR='crl'
+ else
+ echo "NOTE: ${FILE} does not contain a certificate or CRL: skipping" >&2
+ continue
+ fi
+
+ link_hash ${REAL_FILE} ${TYPE_STR} ${FILE}
+ done
+}
+
+
+# choose the name of an ssl application
+if [ -n "${OPENSSL}" ]
+then
+ SSL_CMD=$(which ${OPENSSL} 2>/dev/null)
+else
+ SSL_CMD=/usr/bin/openssl
+ OPENSSL=${SSL_CMD}
+ export OPENSSL
+fi
+
+# fix paths
+PATH=${PATH}:${DIR}/bin
+export PATH
+
+# confirm existance/executability of ssl command
+if ! [ -x ${SSL_CMD} ]
+then
+ echo "${0}: rehashing skipped ('openssl' program not available)" >&2
+ exit 0
+fi
+
+# determine which directories to process
+old_IFS=$IFS
+if [ ${#} -gt 0 ]
+then
+ IFS=':'
+ DIRLIST=${*}
+elif [ -n "${SSL_CERT_DIR}" ]
+then
+ DIRLIST=$SSL_CERT_DIR
+else
+ DIRLIST=${DIR}/certs
+fi
+
+IFS=':'
+
+# process directories
+for CERT_DIR in ${DIRLIST}
+do
+ if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
+ then
+ IFS=$old_IFS
+ hash_dir ${CERT_DIR}
+ IFS=':'
+ fi
+done
diff --git a/poky/meta/recipes-connectivity/openssl/openssl/run-ptest b/poky/meta/recipes-connectivity/openssl/openssl/run-ptest
new file mode 100644
index 000000000..65c6cc7b8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+cd test
+OPENSSL_ENGINES=../engines BLDTOP=.. SRCTOP=.. perl run_tests.pl
+cd ..
diff --git a/poky/meta/recipes-connectivity/openssl/openssl10.inc b/poky/meta/recipes-connectivity/openssl/openssl10.inc
new file mode 100644
index 000000000..645d64ec8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl10.inc
@@ -0,0 +1,285 @@
+SUMMARY = "Secure Socket Layer"
+DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
+HOMEPAGE = "http://www.openssl.org/"
+BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
+SECTION = "libs/network"
+
+# "openssl | SSLeay" dual license
+LICENSE = "openssl"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
+
+DEPENDS = "makedepend-native hostperl-runtime-native"
+DEPENDS_append_class-target = " openssl-native"
+
+PROVIDES += "openssl10"
+
+SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
+ "
+S = "${WORKDIR}/openssl-${PV}"
+
+PACKAGECONFIG ?= "cryptodev-linux"
+PACKAGECONFIG[perl] = ",,,"
+PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux"
+
+TERMIO_libc-musl = "-DTERMIOS"
+TERMIO ?= "-DTERMIO"
+# Avoid binaries being marked as requiring an executable stack since it
+# doesn't(which causes and this causes issues with SELinux
+CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
+ ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
+
+export DIRS = "crypto ssl apps"
+export EX_LIBS = "-lgcc -ldl"
+export AS = "${CC} -c"
+
+inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
+
+PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
+FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
+FILES_libssl = "${libdir}/libssl${SOLIBS}"
+FILES_${PN} =+ " ${libdir}/ssl/*"
+FILES_${PN}-misc = "${libdir}/ssl/misc"
+RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}"
+
+# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
+# package RRECOMMENDS on this package. This will enable the configuration
+# file to be installed for both the base openssl package and the libcrypto
+# package since the base openssl package depends on the libcrypto package.
+FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
+RRECOMMENDS_libcrypto += "openssl-conf"
+RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
+
+# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
+# vulnerability
+EXTRA_OECONF = " -no-ssl3"
+
+do_configure_prepend_darwin () {
+ sed -i -e '/version-script=openssl\.ld/d' Configure
+}
+
+do_configure () {
+ cd util
+ perl perlpath.pl ${STAGING_BINDIR_NATIVE}
+ cd ..
+ ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
+
+ os=${HOST_OS}
+ case $os in
+ linux-gnueabi |\
+ linux-gnuspe |\
+ linux-musleabi |\
+ linux-muslspe |\
+ linux-musl )
+ os=linux
+ ;;
+ *)
+ ;;
+ esac
+ target="$os-${HOST_ARCH}"
+ case $target in
+ linux-arm)
+ target=linux-armv4
+ ;;
+ linux-armeb)
+ target=linux-elf-armeb
+ ;;
+ linux-aarch64*)
+ target=linux-aarch64
+ ;;
+ linux-sh3)
+ target=debian-sh3
+ ;;
+ linux-sh4)
+ target=debian-sh4
+ ;;
+ linux-i486)
+ target=debian-i386-i486
+ ;;
+ linux-i586 | linux-viac3)
+ target=debian-i386-i586
+ ;;
+ linux-i686)
+ target=debian-i386-i686/cmov
+ ;;
+ linux-gnux32-x86_64 | linux-muslx32-x86_64 )
+ target=linux-x32
+ ;;
+ linux-gnu64-x86_64)
+ target=linux-x86_64
+ ;;
+ linux-gnun32-mips*el)
+ target=debian-mipsn32el
+ ;;
+ linux-gnun32-mips*)
+ target=debian-mipsn32
+ ;;
+ linux-mips*64*el)
+ target=debian-mips64el
+ ;;
+ linux-mips*64*)
+ target=debian-mips64
+ ;;
+ linux-mips*el)
+ target=debian-mipsel
+ ;;
+ linux-mips*)
+ target=debian-mips
+ ;;
+ linux-microblaze*|linux-nios2*|linux-gnu*ilp32**)
+ target=linux-generic32
+ ;;
+ linux-powerpc)
+ target=linux-ppc
+ ;;
+ linux-powerpc64)
+ target=linux-ppc64
+ ;;
+ linux-riscv64)
+ target=linux-generic64
+ ;;
+ linux-riscv32)
+ target=linux-generic32
+ ;;
+ linux-supersparc)
+ target=linux-sparcv8
+ ;;
+ linux-sparc)
+ target=linux-sparcv8
+ ;;
+ darwin-i386)
+ target=darwin-i386-cc
+ ;;
+ esac
+ # inject machine-specific flags
+ sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
+ useprefix=${prefix}
+ if [ "x$useprefix" = "x" ]; then
+ useprefix=/
+ fi
+ libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
+ perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target
+}
+
+do_compile_prepend_class-target () {
+ sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+ oe_runmake depend
+ cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'`
+ oe_runmake CC_INFO="${cc_sanitized}"
+}
+
+do_compile () {
+ oe_runmake depend
+ oe_runmake
+}
+
+do_compile_ptest () {
+ # build dependencies for test directory too
+ export DIRS="$DIRS test"
+ oe_runmake depend
+ oe_runmake buildtest
+}
+
+do_install () {
+ # Create ${D}/${prefix} to fix parallel issues
+ mkdir -p ${D}/${prefix}/
+
+ oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
+
+ oe_libinstall -so libcrypto ${D}${libdir}
+ oe_libinstall -so libssl ${D}${libdir}
+
+ install -d ${D}${includedir}
+ cp --dereference -R include/openssl ${D}${includedir}
+
+ install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+ sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+
+ oe_multilib_header openssl/opensslconf.h
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" ]; then
+ sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
+ sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
+ else
+ rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
+ fi
+
+ # Create SSL structure
+ install -d ${D}${sysconfdir}/ssl/
+ mv ${D}${libdir}/ssl/openssl.cnf \
+ ${D}${libdir}/ssl/certs \
+ ${D}${libdir}/ssl/private \
+ \
+ ${D}${sysconfdir}/ssl/
+ ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
+ ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
+ ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
+
+ # Rename man pages to prefix openssl10-*
+ for f in `find ${D}${mandir} -type f`; do
+ mv $f $(dirname $f)/openssl10-$(basename $f)
+ done
+ for f in `find ${D}${mandir} -type l`; do
+ ln_f=`readlink $f`
+ rm -f $f
+ ln -s openssl10-$ln_f $(dirname $f)/openssl10-$(basename $f)
+ done
+}
+
+do_install_ptest () {
+ cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
+
+ # Replace the path to native perl with the path to target perl
+ sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile
+
+ cp Configure config e_os.h ${D}${PTEST_PATH}
+ cp -r -L include ${D}${PTEST_PATH}
+ ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
+ ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
+ mkdir -p ${D}${PTEST_PATH}/crypto
+ cp crypto/constant_time_locl.h ${D}${PTEST_PATH}/crypto
+ cp -r certs ${D}${PTEST_PATH}
+ mkdir -p ${D}${PTEST_PATH}/apps
+ ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
+ ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
+ ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
+ cp apps/server.pem ${D}${PTEST_PATH}/apps
+ cp apps/server2.pem ${D}${PTEST_PATH}/apps
+ mkdir -p ${D}${PTEST_PATH}/util
+ install util/opensslwrap.sh ${D}${PTEST_PATH}/util
+ install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
+ # Time stamps are relevant for "make alltests", otherwise
+ # make may try to recompile binaries. Not only must the
+ # binary files be newer than the sources, they also must
+ # be more recent than the header files in /usr/include.
+ #
+ # Using "cp -a" is not sufficient, because do_install
+ # does not preserve the original time stamps.
+ #
+ # So instead of using the original file stamps, we set
+ # the current time for all files. Binaries will get
+ # modified again later when stripping them, but that's okay.
+ touch ${D}${PTEST_PATH}
+ find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
+
+ # exclude binary files or the package won't install
+ for d in ssltest_old v3ext x509aux; do
+ rm -rf ${D}${libdir}/${BPN}/ptest/test/$d
+ done
+
+ # Remove build host references
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/openssl \
+ OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
+ SSL_CERT_DIR=${libdir}/ssl/certs \
+ SSL_CERT_FILE=${libdir}/ssl/cert.pem \
+ OPENSSL_ENGINES=${libdir}/ssl/engines
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
new file mode 100644
index 000000000..413ebf37f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb
@@ -0,0 +1,64 @@
+require openssl10.inc
+
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
+CFLAG_append_class-native = " -fPIC"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f475368924827d06d4b416111c8bdb77"
+
+export DIRS = "crypto ssl apps engines"
+export OE_LDFLAGS="${LDFLAGS}"
+
+SRC_URI += "file://find.pl;subdir=openssl-${PV}/util/ \
+ file://run-ptest \
+ file://openssl-c_rehash.sh \
+ file://configure-targets.patch \
+ file://shared-libs.patch \
+ file://oe-ldflags.patch \
+ file://engines-install-in-libdir-ssl.patch \
+ file://debian1.0.2/block_diginotar.patch \
+ file://debian1.0.2/block_digicert_malaysia.patch \
+ file://debian/ca.patch \
+ file://debian/c_rehash-compat.patch \
+ file://debian/debian-targets.patch \
+ file://debian/man-dir.patch \
+ file://debian/man-section.patch \
+ file://debian/no-rpath.patch \
+ file://debian/no-symbolic.patch \
+ file://debian/pic.patch \
+ file://debian1.0.2/version-script.patch \
+ file://debian1.0.2/soname.patch \
+ file://openssl_fix_for_x32.patch \
+ file://openssl-fix-des.pod-error.patch \
+ file://Makefiles-ptest.patch \
+ file://ptest-deps.patch \
+ file://ptest_makefile_deps.patch \
+ file://configure-musl-target.patch \
+ file://parallel.patch \
+ file://openssl-util-perlpath.pl-cwd.patch \
+ file://Use-SHA256-not-MD5-as-default-digest.patch \
+ file://0001-Fix-build-with-clang-using-external-assembler.patch \
+ file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \
+ "
+
+SRC_URI_append_class-target = "\
+ file://reproducible-cflags.patch \
+ file://reproducible-mkbuildinf.patch \
+ "
+SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114"
+SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d"
+
+PACKAGES =+ "${PN}-engines"
+FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+
+# The crypto_use_bigint patch means that perl's bignum module needs to be
+# installed, but some distributions (for example Fedora 23) don't ship it by
+# default. As the resulting error is very misleading check for bignum before
+# building.
+do_configure_prepend() {
+ if ! perl -Mbigint -e true; then
+ bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake."
+ fi
+}
diff --git a/poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb b/poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
new file mode 100644
index 000000000..94b75eb92
--- /dev/null
+++ b/poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb
@@ -0,0 +1,161 @@
+SUMMARY = "Secure Socket Layer"
+DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
+HOMEPAGE = "http://www.openssl.org/"
+BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
+SECTION = "libs/network"
+
+# "openssl | SSLeay" dual license
+LICENSE = "openssl"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d57d511030c9d66ef5f5966bee5a7eff"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "5271477e4d93f4ea032b665ef095ff24"
+SRC_URI[sha256sum] = "5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517"
+
+SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
+ file://run-ptest \
+ file://openssl-c_rehash.sh \
+ file://0001-Take-linking-flags-from-LDFLAGS-env-var.patch \
+ "
+
+S = "${WORKDIR}/openssl-${PV}"
+
+inherit lib_package multilib_header ptest
+
+do_configure () {
+ os=${HOST_OS}
+ case $os in
+ linux-uclibc |\
+ linux-uclibceabi |\
+ linux-gnueabi |\
+ linux-uclibcspe |\
+ linux-gnuspe |\
+ linux-musl*)
+ os=linux
+ ;;
+ *)
+ ;;
+ esac
+ target="$os-${HOST_ARCH}"
+ case $target in
+ linux-arm)
+ target=linux-armv4
+ ;;
+ linux-armeb)
+ target=linux-armv4
+ ;;
+ linux-aarch64*)
+ target=linux-aarch64
+ ;;
+ linux-sh3)
+ target=linux-generic32
+ ;;
+ linux-sh4)
+ target=linux-generic32
+ ;;
+ linux-i486)
+ target=linux-elf
+ ;;
+ linux-i586 | linux-viac3)
+ target=linux-elf
+ ;;
+ linux-i686)
+ target=linux-elf
+ ;;
+ linux-gnux32-x86_64)
+ target=linux-x32
+ ;;
+ linux-gnu64-x86_64)
+ target=linux-x86_64
+ ;;
+ linux-mips)
+ # specifying TARGET_CC_ARCH prevents openssl from (incorrectly) adding target architecture flags
+ target="linux-mips32 ${TARGET_CC_ARCH}"
+ ;;
+ linux-mipsel)
+ target="linux-mips32 ${TARGET_CC_ARCH}"
+ ;;
+ linux-gnun32-mips*)
+ target=linux-mips64
+ ;;
+ linux-*-mips64 | linux-mips64)
+ target=linux64-mips64
+ ;;
+ linux-*-mips64el | linux-mips64el)
+ target=linux64-mips64
+ ;;
+ linux-microblaze*|linux-nios2*)
+ target=linux-generic32
+ ;;
+ linux-powerpc)
+ target=linux-ppc
+ ;;
+ linux-powerpc64)
+ target=linux-ppc64
+ ;;
+ linux-riscv64)
+ target=linux-generic64
+ ;;
+ linux-riscv32)
+ target=linux-generic32
+ ;;
+ linux-supersparc)
+ target=linux-sparcv9
+ ;;
+ linux-sparc)
+ target=linux-sparcv9
+ ;;
+ darwin-i386)
+ target=darwin-i386-cc
+ ;;
+ esac
+ useprefix=${prefix}
+ if [ "x$useprefix" = "x" ]; then
+ useprefix=/
+ fi
+ libdirleaf="$(echo ${libdir} | sed s:$useprefix::)"
+ perl ./Configure ${EXTRA_OECONF} --prefix=$useprefix --openssldir=${libdir}/ssl-1.1 --libdir=${libdirleaf} $target
+}
+
+#| engines/afalg/e_afalg.c: In function 'eventfd':
+#| engines/afalg/e_afalg.c:110:20: error: '__NR_eventfd' undeclared (first use in this function)
+#| return syscall(__NR_eventfd, n);
+#| ^~~~~~~~~~~~
+EXTRA_OECONF_aarch64 += "no-afalgeng"
+
+#| ./libcrypto.so: undefined reference to `getcontext'
+#| ./libcrypto.so: undefined reference to `setcontext'
+#| ./libcrypto.so: undefined reference to `makecontext'
+EXTRA_OECONF_libc-musl += "-DOPENSSL_NO_ASYNC"
+
+do_install () {
+ oe_runmake DESTDIR="${D}" MANDIR="${mandir}" MANSUFFIX=ssl install
+ oe_multilib_header openssl/opensslconf.h
+}
+
+do_install_append_class-native () {
+ # Install a custom version of c_rehash that can handle sysroots properly.
+ # This version is used for example when installing ca-certificates during
+ # image creation.
+ install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
+ sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
+}
+
+do_install_ptest() {
+ cp -r * ${D}${PTEST_PATH}
+
+ # Putting .so files in ptest package will mess up the dependencies of the main openssl package
+ # so we rename them to .so.ptest and patch the test accordingly
+ mv ${D}${PTEST_PATH}/libcrypto.so ${D}${PTEST_PATH}/libcrypto.so.ptest
+ mv ${D}${PTEST_PATH}/libssl.so ${D}${PTEST_PATH}/libssl.so.ptest
+ sed -i 's/$target{shared_extension_simple}/".so.ptest"/' ${D}${PTEST_PATH}/test/recipes/90-test_shlibload.t
+}
+
+RDEPENDS_${PN}-ptest += "perl-module-file-spec-functions bash python"
+
+FILES_${PN} =+ " ${libdir}/ssl-1.1/*"
+
+PACKAGES =+ "${PN}-engines"
+FILES_${PN}-engines = "${libdir}/engines-1.1"
+
diff --git a/poky/meta/recipes-connectivity/ppp-dialin/files/host-peer b/poky/meta/recipes-connectivity/ppp-dialin/files/host-peer
new file mode 100644
index 000000000..e7e2e11d4
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp-dialin/files/host-peer
@@ -0,0 +1,11 @@
+-detach
+defaultroute
+nocrtscts
+lock
+noauth
+lcp-echo-interval 5
+lcp-echo-failure 3
+usepeerdns
+115200
+local
+asyncmap 0
diff --git a/poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin b/poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
new file mode 100644
index 000000000..ea2771311
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/pppd call host
diff --git a/poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb b/poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
new file mode 100644
index 000000000..b5f68951d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Enables PPP dial-in through a serial connection"
+SECTION = "console/network"
+DEPENDS = "ppp"
+RDEPENDS_${PN} = "ppp"
+PR = "r8"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://host-peer \
+ file://ppp-dialin"
+
+inherit allarch useradd
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}/ppp/peers
+ install -m 0644 ${WORKDIR}/host-peer ${D}${sysconfdir}/ppp/peers/host
+
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/ppp-dialin ${D}${sbindir}
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /dev/null \
+ --no-create-home --shell ${sbindir}/ppp-dialin \
+ --no-user-group --gid nogroup ppp"
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch b/poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..763e37448
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/0001-Fix-build-with-musl.patch
@@ -0,0 +1,163 @@
+From 52a1e41d7541b2c936285844c59bd1be21797860 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 May 2015 14:57:05 -0700
+Subject: [PATCH] Fix build with musl
+
+There are several assumption about glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/net/ppp_defs.h | 2 ++
+ pppd/Makefile.linux | 2 +-
+ pppd/magic.h | 6 +++---
+ pppd/plugins/rp-pppoe/config.h | 5 ++++-
+ pppd/plugins/rp-pppoe/plugin.c | 1 -
+ pppd/plugins/rp-pppoe/pppoe-discovery.c | 8 ++++----
+ pppd/plugins/rp-pppoe/pppoe.h | 2 +-
+ pppd/sys-linux.c | 3 ++-
+ 8 files changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/include/net/ppp_defs.h b/include/net/ppp_defs.h
+index b06eda5..dafa36c 100644
+--- a/include/net/ppp_defs.h
++++ b/include/net/ppp_defs.h
+@@ -38,6 +38,8 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+
++#include <sys/time.h>
++
+ /*
+ * The basic PPP frame.
+ */
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index 8ab2102..d7e2564 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -126,7 +126,7 @@ LIBS += -lcrypt
+ #endif
+
+ ifdef USE_LIBUTIL
+-CFLAGS += -DHAVE_LOGWTMP=1
++#CFLAGS += -DHAVE_LOGWTMP=1
+ LIBS += -lutil
+ endif
+
+diff --git a/pppd/magic.h b/pppd/magic.h
+index c81213b..9d399e3 100644
+--- a/pppd/magic.h
++++ b/pppd/magic.h
+@@ -42,8 +42,8 @@
+ * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
+ */
+
+-void magic_init __P((void)); /* Initialize the magic number generator */
+-u_int32_t magic __P((void)); /* Returns the next magic number */
++void magic_init (void); /* Initialize the magic number generator */
++u_int32_t magic (void); /* Returns the next magic number */
+
+ /* Fill buffer with random bytes */
+-void random_bytes __P((unsigned char *buf, int len));
++void random_bytes (unsigned char *buf, int len);
+diff --git a/pppd/plugins/rp-pppoe/config.h b/pppd/plugins/rp-pppoe/config.h
+index 5703087..fff032e 100644
+--- a/pppd/plugins/rp-pppoe/config.h
++++ b/pppd/plugins/rp-pppoe/config.h
+@@ -78,8 +78,9 @@
+ #define HAVE_NET_IF_ARP_H 1
+
+ /* Define if you have the <net/ethernet.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_NET_ETHERNET_H 1
+-
++#endif
+ /* Define if you have the <net/if.h> header file. */
+ #define HAVE_NET_IF_H 1
+
+@@ -102,7 +103,9 @@
+ #define HAVE_NETPACKET_PACKET_H 1
+
+ /* Define if you have the <sys/cdefs.h> header file. */
++#ifdef __GLIBC__
+ #define HAVE_SYS_CDEFS_H 1
++#endif
+
+ /* Define if you have the <sys/dlpi.h> header file. */
+ /* #undef HAVE_SYS_DLPI_H */
+diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
+index a8c2bb4..ca34d79 100644
+--- a/pppd/plugins/rp-pppoe/plugin.c
++++ b/pppd/plugins/rp-pppoe/plugin.c
+@@ -46,7 +46,6 @@ static char const RCSID[] =
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <net/ethernet.h>
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>
+diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+index 3d3bf4e..d42f619 100644
+--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+@@ -27,10 +27,6 @@
+ #include <linux/if_packet.h>
+ #endif
+
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+@@ -47,6 +43,10 @@
+ #include <net/if_arp.h>
+ #endif
+
++#ifndef __GLIBC__
++#define error(x...) fprintf(stderr, x)
++#endif
++
+ char *xstrdup(const char *s);
+ void usage(void);
+
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 9ab2eee..75b9004 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -92,7 +92,7 @@ typedef unsigned long UINT32_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+-#ifndef HAVE_SYS_DLPI_H
++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
+ #include <netinet/if_ether.h>
+ #endif
+ #endif
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index a105505..49b0273 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -112,7 +112,7 @@
+ #include <linux/types.h>
+ #include <linux/if.h>
+ #include <linux/if_arp.h>
+-#include <linux/route.h>
++/* #include <linux/route.h> */
+ #include <linux/if_ether.h>
+ #endif
+ #include <netinet/in.h>
+@@ -145,6 +145,7 @@
+ #endif
+
+ #ifdef INET6
++#include <net/route.h>
+ #ifndef _LINUX_IN6_H
+ /*
+ * This is in linux/include/net/ipv6.h.
+--
+2.1.4
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch b/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
new file mode 100644
index 000000000..ea4969b36
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
@@ -0,0 +1,30 @@
+From ba0f6058d1f25b2b60fc31ab2656bf12a71ffdab Mon Sep 17 00:00:00 2001
+From: Lu Chong <Chong.Lu@windriver.com>
+Date: Tue, 5 Nov 2013 17:32:56 +0800
+Subject: [PATCH] ppp: Fix compilation errors in Makefile
+
+Make can't exit while compilation error occurs in subdir for plugins building.
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+---
+ pppd/plugins/Makefile.linux | 1 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
+index 0a7ec7b..2a2c15a 100644
+--- a/pppd/plugins/Makefile.linux
++++ b/pppd/plugins/Makefile.linux
+@@ -20,7 +20,7 @@ include .depend
+ endif
+
+ all: $(PLUGINS)
+- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
++ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit 1; done
+
+ %.so: %.c
+ $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch b/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch
new file mode 100644
index 000000000..a32f89fbc
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/0001-ppp-Remove-unneeded-include.patch
@@ -0,0 +1,43 @@
+commit cd90fd147844a0cfec101f1e2db7a3c59d236621
+Author: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed Dec 28 14:11:22 2016 +0200
+
+pppol2tp plugin: Remove unneeded include
+
+The include is not required and will break compile on musl libc with
+
+| In file included from pppol2tp.c:34:0:
+| /usr/include/linux/if.h:97:2: error: expected identifier before numeric constant
+| IFF_LOWER_UP = 1<<16, /* __volatile__ */
+
+Patch originally from Khem Raj.
+
+Upstream-Status: Pending [https://github.com/paulusmack/ppp/issues/73]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+diff --git a/pppd/plugins/pppol2tp/openl2tp.c b/pppd/plugins/pppol2tp/openl2tp.c
+index 9643b96..458316b 100644
+--- a/pppd/plugins/pppol2tp/openl2tp.c
++++ b/pppd/plugins/pppol2tp/openl2tp.c
+@@ -47,7 +47,6 @@
+ #include <linux/if_ether.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_ppp.h>
+-#include <linux/if_pppox.h>
+ #include <linux/if_pppol2tp.h>
+
+ #include "l2tp_event.h"
+diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c
+index 0e28606..4f6d98c 100644
+--- a/pppd/plugins/pppol2tp/pppol2tp.c
++++ b/pppd/plugins/pppol2tp/pppol2tp.c
+@@ -46,7 +46,6 @@
+ #include <linux/if_ether.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_ppp.h>
+-#include <linux/if_pppox.h>
+ #include <linux/if_pppol2tp.h>
+
+ /* should be added to system's socket.h... */
+---
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/0001-pppoe-include-netinet-in.h-before-linux-in.h.patch b/poky/meta/recipes-connectivity/ppp/ppp/0001-pppoe-include-netinet-in.h-before-linux-in.h.patch
new file mode 100644
index 000000000..9362d1264
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/0001-pppoe-include-netinet-in.h-before-linux-in.h.patch
@@ -0,0 +1,54 @@
+From 50a2997b256e0e0ef7a46fae133f56f60fce539c Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Mon, 9 Jan 2017 13:34:23 +0000
+Subject: [PATCH] pppoe: include netinet/in.h before linux/in.h
+
+This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
+included before <linux/in.h> otherwise the earlier, unaware of the latter,
+tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't work
+alone anymore, since it pulls the headers in the wrong order, so we better
+include <netinet/in.h> early.
+
+Upstream-Status: Backport
+[https://github.com/paulusmack/ppp/commit/50a2997b256e0e0ef7a46fae133f56f60fce539c]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ pppd/plugins/rp-pppoe/pppoe.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 9ab2eee..c4aaa6e 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -47,6 +47,10 @@
+ #include <sys/socket.h>
+ #endif
+
++/* This has to be included before Linux 4.8's linux/in.h
++ * gets dragged in. */
++#include <netinet/in.h>
++
+ /* Ugly header files on some Linux boxes... */
+ #if defined(HAVE_LINUX_IF_H)
+ #include <linux/if.h>
+@@ -84,8 +88,6 @@ typedef unsigned long UINT32_t;
+ #include <linux/if_ether.h>
+ #endif
+
+-#include <netinet/in.h>
+-
+ #ifdef HAVE_NETINET_IF_ETHER_H
+ #include <sys/types.h>
+
+@@ -98,7 +100,6 @@ typedef unsigned long UINT32_t;
+ #endif
+
+
+-
+ /* Ethernet frame types according to RFC 2516 */
+ #define ETH_PPPOE_DISCOVERY 0x8863
+ #define ETH_PPPOE_SESSION 0x8864
+--
+2.7.4
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/08setupdns b/poky/meta/recipes-connectivity/ppp/ppp/08setupdns
new file mode 100644
index 000000000..998219de9
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/08setupdns
@@ -0,0 +1,12 @@
+#!/bin/sh
+ACTUALCONF=/var/run/resolv.conf
+PPPCONF=/var/run/ppp/resolv.conf
+if [ -f $PPPCONF ] ; then
+ if [ -f $ACTUALCONF ] ; then
+ if [ ! -h $ACTUALCONF -o ! "`readlink $ACTUALCONF 2>&1`" = "$PPPCONF" ] ; then
+ mv $ACTUALCONF $ACTUALCONF.ppporig
+ fi
+ fi
+
+ ln -sf $PPPCONF $ACTUALCONF
+fi
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/92removedns b/poky/meta/recipes-connectivity/ppp/ppp/92removedns
new file mode 100644
index 000000000..2eadec689
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/92removedns
@@ -0,0 +1,5 @@
+#!/bin/sh
+ACTUALCONF=/var/run/resolv.conf
+if [ -f $ACTUALCONF.ppporig ] ; then
+ mv $ACTUALCONF.ppporig $ACTUALCONF
+fi
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch b/poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
new file mode 100644
index 000000000..7dd69d8f4
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
@@ -0,0 +1,297 @@
+This patch comes from OpenEmbedded.
+The original patch is from Debian / SuSE to implement replacedefaultroute
+Rebased it to fit ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [debian/suse patches]
+
+Index: ppp-2.4.7/pppd/ipcp.c
+===================================================================
+--- ppp-2.4.7.orig/pppd/ipcp.c
++++ ppp-2.4.7/pppd/ipcp.c
+@@ -198,6 +198,16 @@ static option_t ipcp_option_list[] = {
+ "disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
+ &ipcp_wantoptions[0].default_route },
+
++#ifdef __linux__
++ { "replacedefaultroute", o_bool,
++ &ipcp_wantoptions[0].replace_default_route,
++ "Replace default route", 1
++ },
++ { "noreplacedefaultroute", o_bool,
++ &ipcp_allowoptions[0].replace_default_route,
++ "Never replace default route", OPT_A2COPY,
++ &ipcp_wantoptions[0].replace_default_route },
++#endif
+ { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
+ "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
+ { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
+@@ -271,7 +281,7 @@ struct protent ipcp_protent = {
+ ip_active_pkt
+ };
+
+-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
++static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
+ static void ipcp_script __P((char *, int)); /* Run an up/down script */
+ static void ipcp_script_done __P((void *));
+
+@@ -1761,7 +1771,12 @@ ip_demand_conf(u)
+ if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
+ return 0;
+ if (wo->default_route)
++#ifndef __linux__
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
++#else
++ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
++ wo->replace_default_route))
++#endif
+ default_route_set[u] = 1;
+ if (wo->proxy_arp)
+ if (sifproxyarp(u, wo->hisaddr))
+@@ -1849,7 +1864,8 @@ ipcp_up(f)
+ */
+ if (demand) {
+ if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
+- ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
++ ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr,
++ wo->replace_default_route);
+ if (go->ouraddr != wo->ouraddr) {
+ warn("Local IP address changed to %I", go->ouraddr);
+ script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
+@@ -1874,7 +1890,12 @@ ipcp_up(f)
+
+ /* assign a default route through the interface if required */
+ if (ipcp_wantoptions[f->unit].default_route)
++#ifndef __linux__
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++ wo->replace_default_route))
++#endif
+ default_route_set[f->unit] = 1;
+
+ /* Make a proxy ARP entry if requested. */
+@@ -1924,7 +1945,12 @@ ipcp_up(f)
+
+ /* assign a default route through the interface if required */
+ if (ipcp_wantoptions[f->unit].default_route)
++#ifndef __linux__
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++ wo->replace_default_route))
++#endif
+ default_route_set[f->unit] = 1;
+
+ /* Make a proxy ARP entry if requested. */
+@@ -2002,7 +2028,7 @@ ipcp_down(f)
+ sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
+ sifdown(f->unit);
+ ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
+- ipcp_hisoptions[f->unit].hisaddr);
++ ipcp_hisoptions[f->unit].hisaddr, 0);
+ }
+
+ /* Execute the ip-down script */
+@@ -2018,12 +2044,21 @@ ipcp_down(f)
+ * proxy arp entries, etc.
+ */
+ static void
+-ipcp_clear_addrs(unit, ouraddr, hisaddr)
++ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
+ int unit;
+ u_int32_t ouraddr; /* local address */
+ u_int32_t hisaddr; /* remote address */
++ bool replacedefaultroute;
+ {
+- if (proxy_arp_set[unit]) {
++ /* If replacedefaultroute, sifdefaultroute will be called soon
++ * with replacedefaultroute set and that will overwrite the current
++ * default route. This is the case only when doing demand, otherwise
++ * during demand, this cifdefaultroute would restore the old default
++ * route which is not what we want in this case. In the non-demand
++ * case, we'll delete the default route and restore the old if there
++ * is one saved by an sifdefaultroute with replacedefaultroute.
++ */
++ if (!replacedefaultroute && default_route_set[unit]) {
+ cifproxyarp(unit, hisaddr);
+ proxy_arp_set[unit] = 0;
+ }
+Index: ppp-2.4.7/pppd/ipcp.h
+===================================================================
+--- ppp-2.4.7.orig/pppd/ipcp.h
++++ ppp-2.4.7/pppd/ipcp.h
+@@ -70,6 +70,7 @@ typedef struct ipcp_options {
+ bool old_addrs; /* Use old (IP-Addresses) option? */
+ bool req_addr; /* Ask peer to send IP address? */
+ bool default_route; /* Assign default route through interface? */
++ bool replace_default_route; /* Replace default route through interface? */
+ bool proxy_arp; /* Make proxy ARP entry for peer? */
+ bool neg_vj; /* Van Jacobson Compression? */
+ bool old_vj; /* use old (short) form of VJ option? */
+Index: ppp-2.4.7/pppd/pppd.8
+===================================================================
+--- ppp-2.4.7.orig/pppd/pppd.8
++++ ppp-2.4.7/pppd/pppd.8
+@@ -121,6 +121,13 @@ the gateway, when IPCP negotiation is su
+ This entry is removed when the PPP connection is broken. This option
+ is privileged if the \fInodefaultroute\fR option has been specified.
+ .TP
++.B replacedefaultroute
++This option is a flag to the defaultroute option. If defaultroute is
++set and this flag is also set, pppd replaces an existing default route
++with the new default route.
++
++
++.TP
+ .B disconnect \fIscript
+ Execute the command specified by \fIscript\fR, by passing it to a
+ shell, after
+@@ -734,7 +741,12 @@ disable both forms of hardware flow cont
+ .TP
+ .B nodefaultroute
+ Disable the \fIdefaultroute\fR option. The system administrator who
+-wishes to prevent users from creating default routes with pppd
++wishes to prevent users from adding a default route with pppd
++can do so by placing this option in the /etc/ppp/options file.
++.TP
++.B noreplacedefaultroute
++Disable the \fIreplacedefaultroute\fR option. The system administrator who
++wishes to prevent users from replacing a default route with pppd
+ can do so by placing this option in the /etc/ppp/options file.
+ .TP
+ .B nodeflate
+Index: ppp-2.4.7/pppd/pppd.h
+===================================================================
+--- ppp-2.4.7.orig/pppd/pppd.h
++++ ppp-2.4.7/pppd/pppd.h
+@@ -665,7 +665,11 @@ int sif6addr __P((int, eui64_t, eui64_t
+ int cif6addr __P((int, eui64_t, eui64_t));
+ /* Remove an IPv6 address from i/f */
+ #endif
++#ifndef __linux__
+ int sifdefaultroute __P((int, u_int32_t, u_int32_t));
++#else
++int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
++#endif
+ /* Create default route through i/f */
+ int cifdefaultroute __P((int, u_int32_t, u_int32_t));
+ /* Delete default route through i/f */
+Index: ppp-2.4.7/pppd/sys-linux.c
+===================================================================
+--- ppp-2.4.7.orig/pppd/sys-linux.c
++++ ppp-2.4.7/pppd/sys-linux.c
+@@ -207,6 +207,8 @@ static unsigned char inbuf[512]; /* buff
+ static int if_is_up; /* Interface has been marked up */
+ static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
+ static int have_default_route; /* Gateway for default route added */
++static struct rtentry old_def_rt; /* Old default route */
++static int default_rt_repl_rest; /* replace and restore old default rt */
+ static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
+ static char proxy_arp_dev[16]; /* Device for proxy arp entry */
+ static u_int32_t our_old_addr; /* for detecting address changes */
+@@ -1545,6 +1547,9 @@ static int read_route_table(struct rtent
+ p = NULL;
+ }
+
++ SET_SA_FAMILY (rt->rt_dst, AF_INET);
++ SET_SA_FAMILY (rt->rt_gateway, AF_INET);
++
+ SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
+ SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
+ SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
+@@ -1614,20 +1619,51 @@ int have_route_to(u_int32_t addr)
+ /********************************************************************
+ *
+ * sifdefaultroute - assign a default route through the address given.
+- */
+-
+-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
+-{
+- struct rtentry rt;
+-
+- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
+- if (rt.rt_flags & RTF_GATEWAY)
+- error("not replacing existing default route via %I",
+- SIN_ADDR(rt.rt_gateway));
+- else
+- error("not replacing existing default route through %s",
+- rt.rt_dev);
+- return 0;
++ *
++ * If the global default_rt_repl_rest flag is set, then this function
++ * already replaced the original system defaultroute with some other
++ * route and it should just replace the current defaultroute with
++ * another one, without saving the current route. Use: demand mode,
++ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
++ * and then changes the temporary addresses to the addresses for the real
++ * ppp connection when it has come up.
++ */
++
++int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
++{
++ struct rtentry rt, tmp_rt;
++ struct rtentry *del_rt = NULL;
++
++ if (default_rt_repl_rest) {
++ /* We have already reclaced the original defaultroute, if we
++ * are called again, we will delete the current default route
++ * and set the new default route in this function.
++ * - this is normally only the case the doing demand: */
++ if (defaultroute_exists( &tmp_rt ))
++ del_rt = &tmp_rt;
++ } else if ( defaultroute_exists( &old_def_rt ) &&
++ strcmp( old_def_rt.rt_dev, ifname ) != 0) {
++ /* We did not yet replace an existing default route, let's
++ * check if we should save and replace a default route:
++ */
++ u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
++ if (old_gateway != gateway) {
++ if (!replace) {
++ error("not replacing default route to %s [%I]",
++ old_def_rt.rt_dev, old_gateway);
++ return 0;
++ } else {
++ // we need to copy rt_dev because we need it permanent too:
++ char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
++ strcpy(tmp_dev, old_def_rt.rt_dev);
++ old_def_rt.rt_dev = tmp_dev;
++
++ notice("replacing old default route to %s [%I]",
++ old_def_rt.rt_dev, old_gateway);
++ default_rt_repl_rest = 1;
++ del_rt = &old_def_rt;
++ }
++ }
+ }
+
+ memset (&rt, 0, sizeof (rt));
+@@ -1646,6 +1682,12 @@ int sifdefaultroute (int unit, u_int32_t
+ error("default route ioctl(SIOCADDRT): %m");
+ return 0;
+ }
++ if (default_rt_repl_rest && del_rt)
++ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
++ if ( ! ok_error ( errno ))
++ error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
++ return 0;
++ }
+
+ have_default_route = 1;
+ return 1;
+@@ -1681,6 +1723,16 @@ int cifdefaultroute (int unit, u_int32_t
+ return 0;
+ }
+ }
++ if (default_rt_repl_rest) {
++ notice("restoring old default route to %s [%I]",
++ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
++ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
++ if ( ! ok_error ( errno ))
++ error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
++ return 0;
++ }
++ default_rt_repl_rest = 0;
++ }
+
+ return 1;
+ }
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/copts.patch b/poky/meta/recipes-connectivity/ppp/ppp/copts.patch
new file mode 100644
index 000000000..53ff06e03
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/copts.patch
@@ -0,0 +1,21 @@
+ppp: use build system CFLAGS when compiling
+
+Upstream-Status: Pending
+
+Override the hard-coded COPTS make variables with
+CFLAGS. Add COPTS into one Makefile that did not
+use it.
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/pppd/plugins/radius/Makefile.linux
++++ b/pppd/plugins/radius/Makefile.linux
+@@ -12,7 +12,7 @@ VERSION = $(shell awk -F '"' '/VERSION/
+ INSTALL = install
+
+ PLUGIN=radius.so radattr.so radrealms.so
+-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+
+ # Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol.
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch b/poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch
new file mode 100644
index 000000000..c5a0be86f
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch
@@ -0,0 +1,30 @@
+ppp: Buffer overflow in radius plugin
+
+From: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;bug=782450
+
+Upstream-Status: Backport
+CVE: CVE-2015-3310
+
+On systems with more than 65535 processes running, pppd aborts when
+sending a "start" accounting message to the RADIUS server because of a
+buffer overflow in rc_mksid.
+
+The process id is used in rc_mksid to generate a pseudo-unique string,
+assuming that the hex representation of the pid will be at most 4
+characters (FFFF). __sprintf_chk(), used when compiling with
+optimization levels greater than 0 and FORTIFY_SOURCE, detects the
+buffer overflow and makes pppd crash.
+
+The following patch fixes the problem.
+
+--- ppp-2.4.6.orig/pppd/plugins/radius/util.c
++++ ppp-2.4.6/pppd/plugins/radius/util.c
+@@ -77,7 +77,7 @@ rc_mksid (void)
+ static unsigned short int cnt = 0;
+ sprintf (buf, "%08lX%04X%02hX",
+ (unsigned long int) time (NULL),
+- (unsigned int) getpid (),
++ (unsigned int) getpid () % 65535,
+ cnt & 0xFF);
+ cnt++;
+ return buf;
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/init b/poky/meta/recipes-connectivity/ppp/ppp/init
new file mode 100755
index 000000000..0c0136049
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/init
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# /etc/init.d/ppp: start or stop PPP link.
+#
+# If you want PPP started on boot time (most dialup systems won't need it)
+# rename the /etc/ppp/no_ppp_on_boot file to /etc/ppp/ppp_on_boot, and
+# follow the instructions in the comments in that file.
+
+# Source function library.
+. /etc/init.d/functions
+
+test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0
+if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
+
+case "$1" in
+ start)
+ echo -n "Starting up PPP link: pppd"
+ if [ "$RUNFILE" = "1" ]; then
+ /etc/ppp/ppp_on_boot
+ else
+ pppd call provider
+ fi
+ echo "."
+ ;;
+ stop)
+ echo -n "Shutting down PPP link: pppd"
+ if [ "$RUNFILE" = "1" ]; then
+ poff
+ else
+ poff provider
+ fi
+ echo "."
+ ;;
+ status)
+ status /usr/sbin/pppd;
+ exit $?
+ ;;
+ restart|force-reload)
+ echo -n "Restarting PPP link: pppd"
+ if [ "$RUNFILE" = "1" ]; then
+ poff
+ sleep 5
+ /etc/ppp/ppp_on_boot
+ else
+ poff provider
+ sleep 5
+ pppd call provider
+ fi
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/ppp {start|stop|status|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/ip-down b/poky/meta/recipes-connectivity/ppp/ppp/ip-down
new file mode 100755
index 000000000..06d35487a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/ip-down
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# $Id: ip-down,v 1.2 1998/02/10 21:21:55 phil Exp $
+#
+# This script is run by the pppd _after_ the link is brought down.
+# It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete
+# routes, unset IP addresses etc. you should create script(s) there.
+#
+# Be aware that other packages may include /etc/ppp/ip-down.d scripts (named
+# after that package), so choose local script names with that in mind.
+#
+# This script is called with the following arguments:
+# Arg Name Example
+# $1 Interface name ppp0
+# $2 The tty ttyS1
+# $3 The link speed 38400
+# $4 Local IP number 12.34.56.78
+# $5 Peer IP number 12.34.56.99
+# $6 Optional ``ipparam'' value foo
+
+# The environment is cleared before executing this script
+# so the path must be reset
+PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
+export PATH
+# These variables are for the use of the scripts run by run-parts
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+
+# as an additional convenience, $PPP_TTYNAME is set to the tty name,
+# stripped of /dev/ (if present) for easier matching.
+PPP_TTYNAME=`/usr/bin/basename "$2"`
+export PPP_TTYNAME
+
+# Main Script starts here
+
+run-parts /etc/ppp/ip-down.d
+
+# last line
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/ip-up b/poky/meta/recipes-connectivity/ppp/ppp/ip-up
new file mode 100755
index 000000000..fc2fae9fe
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/ip-up
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $
+#
+# This script is run by the pppd after the link is established.
+# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
+# set IP address, run the mailq etc. you should create script(s) there.
+#
+# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named
+# after that package), so choose local script names with that in mind.
+#
+# This script is called with the following arguments:
+# Arg Name Example
+# $1 Interface name ppp0
+# $2 The tty ttyS1
+# $3 The link speed 38400
+# $4 Local IP number 12.34.56.78
+# $5 Peer IP number 12.34.56.99
+# $6 Optional ``ipparam'' value foo
+
+# The environment is cleared before executing this script
+# so the path must be reset
+PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
+export PATH
+# These variables are for the use of the scripts run by run-parts
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+
+
+# as an additional convenience, $PPP_TTYNAME is set to the tty name,
+# stripped of /dev/ (if present) for easier matching.
+PPP_TTYNAME=`/usr/bin/basename "$2"`
+export PPP_TTYNAME
+
+# Main Script starts here
+
+run-parts /etc/ppp/ip-up.d
+
+# last line
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch b/poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
new file mode 100644
index 000000000..8a69396cc
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
@@ -0,0 +1,38 @@
+The patch comes from OpenEmbedded.
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Updated from OE-Classic to include the pcap hunk.
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: ppp-2.4.7/pppd/Makefile.linux
+===================================================================
+--- ppp-2.4.7.orig/pppd/Makefile.linux
++++ ppp-2.4.7/pppd/Makefile.linux
+@@ -120,10 +120,10 @@ CFLAGS += -DHAS_SHADOW
+ #LIBS += -lshadow $(LIBS)
+ endif
+
+-ifneq ($(wildcard /usr/include/crypt.h),)
++#ifneq ($(wildcard /usr/include/crypt.h),)
+ CFLAGS += -DHAVE_CRYPT_H=1
+ LIBS += -lcrypt
+-endif
++#endif
+
+ ifdef USE_LIBUTIL
+ CFLAGS += -DHAVE_LOGWTMP=1
+@@ -177,10 +177,10 @@ LIBS += -ldl
+ endif
+
+ ifdef FILTER
+-ifneq ($(wildcard /usr/include/pcap-bpf.h),)
++#ifneq ($(wildcard /usr/include/pcap-bpf.h),)
+ LIBS += -lpcap
+ CFLAGS += -DPPP_FILTER
+-endif
++#endif
+ endif
+
+ ifdef HAVE_INET6
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/makefile.patch b/poky/meta/recipes-connectivity/ppp/ppp/makefile.patch
new file mode 100644
index 000000000..2d09baf5d
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/makefile.patch
@@ -0,0 +1,95 @@
+The patch comes from OpenEmbedded
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN ppp-2.4.5-orig/chat/Makefile.linux ppp-2.4.5/chat/Makefile.linux
+--- ppp-2.4.5-orig/chat/Makefile.linux 2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/chat/Makefile.linux 2010-06-30 15:51:30.450118446 +0800
+@@ -25,7 +25,7 @@
+
+ install: chat
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c chat $(BINDIR)
++ $(INSTALL) -c chat $(BINDIR)
+ $(INSTALL) -c -m 644 chat.8 $(MANDIR)
+
+ clean:
+diff -ruN ppp-2.4.5-orig/pppd/Makefile.linux ppp-2.4.5/pppd/Makefile.linux
+--- ppp-2.4.5-orig/pppd/Makefile.linux 2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/Makefile.linux 2010-06-30 15:52:11.214170607 +0800
+@@ -99,7 +99,7 @@
+ CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
+ LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
+ TARGETS += srp-entry
+-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
++EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
+ MANPAGES += srp-entry.8
+ EXTRACLEAN += srp-entry.o
+ NEEDDES=y
+@@ -200,7 +200,7 @@
+ install: pppd
+ mkdir -p $(BINDIR) $(MANDIR)
+ $(EXTRAINSTALL)
+- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
++ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
+ if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
+ chmod o-rx,u+s $(BINDIR)/pppd; fi
+ $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+diff -ruN ppp-2.4.5-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.5/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.5-orig/pppd/plugins/radius/Makefile.linux 2010-06-30 15:51:12.047676187 +0800
++++ ppp-2.4.5/pppd/plugins/radius/Makefile.linux 2010-06-30 15:53:47.750182267 +0800
+@@ -36,11 +36,11 @@
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
+- $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+- $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
++ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
++ $(INSTALL) -m 444 pppd-radius.8 $(MANDIR)
++ $(INSTALL) -m 444 pppd-radattr.8 $(MANDIR)
+
+ radius.so: radius.o libradiusclient.a
+ $(CC) -o radius.so -shared radius.o libradiusclient.a
+diff -ruN ppp-2.4.5-orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux
+--- ppp-2.4.5-orig/pppd/plugins/rp-pppoe/Makefile.linux 2010-06-30 15:51:12.047676187 +0800
++++ ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux 2010-06-30 15:53:15.454486877 +0800
+@@ -43,9 +43,9 @@
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
++ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
+ $(INSTALL) -d -m 755 $(BINDIR)
+- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
++ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
+
+ clean:
+ rm -f *.o *.so pppoe-discovery
+diff -ruN ppp-2.4.5-orig/pppdump/Makefile.linux ppp-2.4.5/pppdump/Makefile.linux
+--- ppp-2.4.5-orig/pppdump/Makefile.linux 2010-06-30 15:51:12.058183383 +0800
++++ ppp-2.4.5/pppdump/Makefile.linux 2010-06-30 15:52:25.762183537 +0800
+@@ -17,5 +17,5 @@
+
+ install:
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c pppdump $(BINDIR)
++ $(INSTALL) -c pppdump $(BINDIR)
+ $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
+diff -ruN ppp-2.4.5-orig/pppstats/Makefile.linux ppp-2.4.5/pppstats/Makefile.linux
+--- ppp-2.4.5-orig/pppstats/Makefile.linux 2010-06-30 15:51:12.058183383 +0800
++++ ppp-2.4.5/pppstats/Makefile.linux 2010-06-30 15:52:42.486341081 +0800
+@@ -22,7 +22,7 @@
+
+ install: pppstats
+ -mkdir -p $(MANDIR)
+- $(INSTALL) -s -c pppstats $(BINDIR)
++ $(INSTALL) -c pppstats $(BINDIR)
+ $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
+
+ pppstats: $(PPPSTATSRCS)
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/pap b/poky/meta/recipes-connectivity/ppp/ppp/pap
new file mode 100644
index 000000000..093c32607
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/pap
@@ -0,0 +1,22 @@
+# You can use this script unmodified to connect to sites which allow
+# authentication via PAP, CHAP and similar protocols.
+# This script can be shared among different pppd peer configurations.
+# To use it, add something like this to your /etc/ppp/peers/ file:
+#
+# connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER"
+# user YOUR-USERNAME-IN-PAP-SECRETS
+# noauth
+
+# Uncomment the following line to see the connect speed.
+# It will be logged to stderr or to the file specified with the -r chat option.
+#REPORT CONNECT
+
+ABORT BUSY
+ABORT VOICE
+ABORT "NO CARRIER"
+ABORT "NO DIALTONE"
+ABORT "NO DIAL TONE"
+"" ATZ
+OK ATDT\T
+CONNECT ""
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/poff b/poky/meta/recipes-connectivity/ppp/ppp/poff
new file mode 100644
index 000000000..0521a9406
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/poff
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Lets see how many pppds are running....
+set -- `cat /var/run/ppp*.pid 2>/dev/null`
+
+case $# in
+ 0) # pppd only creates a pid file once ppp is up, so let's try killing pppd
+ # on the assumption that we've not got that far yet.
+ killall pppd
+ ;;
+ 1) # If only one was running then it can be killed (apparently killall
+ # caused problems for some, so lets try killing the pid from the file)
+ kill $1
+ ;;
+ *) # More than one! Aieehh.. Dont know which one to kill.
+ echo "More than one pppd running. None stopped"
+ exit 1
+ ;;
+esac
+
+if [ -r /var/run/ppp-quick ]
+then
+ rm -f /var/run/ppp-quick
+fi
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/pon b/poky/meta/recipes-connectivity/ppp/ppp/pon
new file mode 100644
index 000000000..91c059501
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/pon
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = "quick" ]
+then
+ touch /var/run/ppp-quick
+ shift
+fi
+
+/usr/sbin/pppd call ${1:-provider}
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/ppp@.service b/poky/meta/recipes-connectivity/ppp/ppp/ppp@.service
new file mode 100644
index 000000000..2bf0b5e34
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/ppp@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=PPP link to %I
+Before=network.target
+
+[Service]
+ExecStart=@SBINDIR@/pppd call %I nodetach nolog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot b/poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot
new file mode 100644
index 000000000..979376184
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/ppp_on_boot
@@ -0,0 +1,21 @@
+###!/bin/sh
+#
+# Rename this file to ppp_on_boot and pppd will be fired up as
+# soon as the system comes up, connecting to `provider'.
+#
+# If you also make this file executable, and replace the first line
+# with just "#!/bin/sh", the commands below will be executed instead.
+#
+
+# The location of the ppp daemon itself (shouldn't need to be changed)
+PPPD=/usr/sbin/pppd
+
+# The default provider to connect to
+$PPPD call provider
+
+# Additional connections, which would just use settings from
+# /etc/ppp/options.<tty>
+#$PPPD ttyS0
+#$PPPD ttyS1
+#$PPPD ttyS2
+#$PPPD ttyS3
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch b/poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch
new file mode 100644
index 000000000..a72414ff8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch
@@ -0,0 +1,45 @@
+The patch comes from OpenEmbedded
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff -ruN ppp-2.4.5-orig/pppd/ipcp.c ppp-2.4.5/pppd/ipcp.c
+--- ppp-2.4.5-orig/pppd/ipcp.c 2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/ipcp.c 2010-06-30 17:02:33.930393283 +0800
+@@ -55,6 +55,8 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #include "pppd.h"
+ #include "fsm.h"
+@@ -2095,6 +2097,14 @@
+ u_int32_t peerdns1, peerdns2;
+ {
+ FILE *f;
++ struct stat dirinfo;
++
++ if(stat(_PATH_OUTDIR, &dirinfo)) {
++ if(mkdir(_PATH_OUTDIR, 0775)) {
++ error("Failed to create directory %s: %m", _PATH_OUTDIR);
++ return;
++ }
++ }
+
+ f = fopen(_PATH_RESOLV, "w");
+ if (f == NULL) {
+diff -ruN ppp-2.4.5-orig/pppd/pathnames.h ppp-2.4.5/pppd/pathnames.h
+--- ppp-2.4.5-orig/pppd/pathnames.h 2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/pathnames.h 2010-06-30 17:03:20.594371055 +0800
+@@ -30,7 +30,8 @@
+ #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
+ #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
+ #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
+-#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
++#define _PATH_OUTDIR _ROOT_PATH _PATH_VARRUN "/ppp"
++#define _PATH_RESOLV _PATH_OUTDIR "/resolv.conf"
+
+ #define _PATH_USEROPT ".ppprc"
+ #define _PATH_PSEUDONYM ".ppp_pseudonym"
diff --git a/poky/meta/recipes-connectivity/ppp/ppp/provider b/poky/meta/recipes-connectivity/ppp/ppp/provider
new file mode 100644
index 000000000..e74d71a8e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp/provider
@@ -0,0 +1,35 @@
+# example configuration for a dialup connection authenticated with PAP or CHAP
+#
+# This is the default configuration used by pon(1) and poff(1).
+# See the manual page pppd(8) for information on all the options.
+
+# MUST CHANGE: replace myusername@realm with the PPP login name given to
+# your by your provider.
+# There should be a matching entry with the password in /etc/ppp/pap-secrets
+# and/or /etc/ppp/chap-secrets.
+user "myusername@realm"
+
+# MUST CHANGE: replace ******** with the phone number of your provider.
+# The /etc/chatscripts/pap chat script may be modified to change the
+# modem initialization string.
+connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
+
+# Serial device to which the modem is connected.
+/dev/modem
+
+# Speed of the serial line.
+115200
+
+# Assumes that your IP address is allocated dynamically by the ISP.
+noipdefault
+# Try to get the name server addresses from the ISP.
+usepeerdns
+# Use this connection as the default route.
+defaultroute
+
+# Makes pppd "dial again" when the connection is lost.
+persist
+
+# Do not ask the remote to authenticate.
+noauth
+
diff --git a/poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb b/poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
new file mode 100644
index 000000000..a5f764f6e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
@@ -0,0 +1,101 @@
+SUMMARY = "Point-to-Point Protocol (PPP) support"
+DESCRIPTION = "ppp (Paul's PPP Package) is an open source package which implements \
+the Point-to-Point Protocol (PPP) on Linux and Solaris systems."
+SECTION = "console/network"
+HOMEPAGE = "http://samba.org/ppp/"
+BUGTRACKER = "http://ppp.samba.org/cgi-bin/ppp-bugs"
+DEPENDS = "libpcap"
+LICENSE = "BSD & GPLv2+ & LGPLv2+ & PD"
+LIC_FILES_CHKSUM = "file://pppd/ccp.c;beginline=1;endline=29;md5=e2c43fe6e81ff77d87dc9c290a424dea \
+ file://pppd/plugins/passprompt.c;beginline=1;endline=10;md5=3bcbcdbf0e369c9a3e0b8c8275b065d8 \
+ file://pppd/tdb.c;beginline=1;endline=27;md5=4ca3a9991b011038d085d6675ae7c4e6 \
+ file://chat/chat.c;beginline=1;endline=15;md5=0d374b8545ee5c62d7aff1acbd38add2"
+
+SRC_URI = "https://download.samba.org/pub/${BPN}/${BP}.tar.gz \
+ file://makefile.patch \
+ file://cifdefroute.patch \
+ file://pppd-resolv-varrun.patch \
+ file://makefile-remove-hard-usr-reference.patch \
+ file://pon \
+ file://poff \
+ file://init \
+ file://ip-up \
+ file://ip-down \
+ file://08setupdns \
+ file://92removedns \
+ file://copts.patch \
+ file://pap \
+ file://ppp_on_boot \
+ file://provider \
+ file://0001-ppp-Fix-compilation-errors-in-Makefile.patch \
+ file://ppp@.service \
+ file://fix-CVE-2015-3310.patch \
+ file://0001-pppoe-include-netinet-in.h-before-linux-in.h.patch \
+ file://0001-ppp-Remove-unneeded-include.patch \
+"
+
+SRC_URI_append_libc-musl = "\
+ file://0001-Fix-build-with-musl.patch \
+"
+SRC_URI[md5sum] = "78818f40e6d33a1d1de68a1551f6595a"
+SRC_URI[sha256sum] = "02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30"
+
+inherit autotools-brokensep systemd
+
+TARGET_CC_ARCH += " ${LDFLAGS}"
+EXTRA_OEMAKE = "STRIPPROG=${STRIP} MANDIR=${D}${datadir}/man/man8 INCDIR=${D}${includedir} LIBDIR=${D}${libdir}/pppd/${PV} BINDIR=${D}${sbindir}"
+EXTRA_OECONF = "--disable-strip"
+
+# Package Makefile computes CFLAGS, referencing COPTS.
+# Typically hard-coded to '-O2 -g' in the Makefile's.
+#
+EXTRA_OEMAKE += ' COPTS="${CFLAGS} -I${S}/include"'
+
+do_configure () {
+ oe_runconf
+}
+
+do_install_append () {
+ make install-etcppp ETCDIR=${D}/${sysconfdir}/ppp
+ mkdir -p ${D}${bindir}/ ${D}${sysconfdir}/init.d
+ mkdir -p ${D}${sysconfdir}/ppp/ip-up.d/
+ mkdir -p ${D}${sysconfdir}/ppp/ip-down.d/
+ install -m 0755 ${WORKDIR}/pon ${D}${bindir}/pon
+ install -m 0755 ${WORKDIR}/poff ${D}${bindir}/poff
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/ppp
+ install -m 0755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/
+ install -m 0755 ${WORKDIR}/ip-down ${D}${sysconfdir}/ppp/
+ install -m 0755 ${WORKDIR}/08setupdns ${D}${sysconfdir}/ppp/ip-up.d/
+ install -m 0755 ${WORKDIR}/92removedns ${D}${sysconfdir}/ppp/ip-down.d/
+ mkdir -p ${D}${sysconfdir}/chatscripts
+ mkdir -p ${D}${sysconfdir}/ppp/peers
+ install -m 0755 ${WORKDIR}/pap ${D}${sysconfdir}/chatscripts
+ install -m 0755 ${WORKDIR}/ppp_on_boot ${D}${sysconfdir}/ppp/ppp_on_boot
+ install -m 0755 ${WORKDIR}/provider ${D}${sysconfdir}/ppp/peers/provider
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ppp@.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/ppp@.service
+ rm -rf ${D}/${mandir}/man8/man8
+ chmod u+s ${D}${sbindir}/pppd
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ppp/pap-secrets ${sysconfdir}/ppp/chap-secrets ${sysconfdir}/ppp/options"
+PACKAGES =+ "${PN}-oa ${PN}-oe ${PN}-radius ${PN}-winbind ${PN}-minconn ${PN}-password ${PN}-l2tp ${PN}-tools"
+FILES_${PN} = "${sysconfdir} ${bindir} ${sbindir}/chat ${sbindir}/pppd ${systemd_unitdir}/system/ppp@.service"
+FILES_${PN}-oa = "${libdir}/pppd/${PV}/pppoatm.so"
+FILES_${PN}-oe = "${sbindir}/pppoe-discovery ${libdir}/pppd/${PV}/rp-pppoe.so"
+FILES_${PN}-radius = "${libdir}/pppd/${PV}/radius.so ${libdir}/pppd/${PV}/radattr.so ${libdir}/pppd/${PV}/radrealms.so"
+FILES_${PN}-winbind = "${libdir}/pppd/${PV}/winbind.so"
+FILES_${PN}-minconn = "${libdir}/pppd/${PV}/minconn.so"
+FILES_${PN}-password = "${libdir}/pppd/${PV}/pass*.so"
+FILES_${PN}-l2tp = "${libdir}/pppd/${PV}/*l2tp.so"
+FILES_${PN}-tools = "${sbindir}/pppstats ${sbindir}/pppdump"
+SUMMARY_${PN}-oa = "Plugin for PPP for PPP-over-ATM support"
+SUMMARY_${PN}-oe = "Plugin for PPP for PPP-over-Ethernet support"
+SUMMARY_${PN}-radius = "Plugin for PPP for RADIUS support"
+SUMMARY_${PN}-winbind = "Plugin for PPP to authenticate against Samba or Windows"
+SUMMARY_${PN}-minconn = "Plugin for PPP to set a delay before the idle timeout applies"
+SUMMARY_${PN}-password = "Plugin for PPP to get passwords via a pipe"
+SUMMARY_${PN}-l2tp = "Plugin for PPP for l2tp support"
+SUMMARY_${PN}-tools = "Additional tools for the PPP package"
diff --git a/poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf b/poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf
new file mode 100644
index 000000000..3790d774a
--- /dev/null
+++ b/poky/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf
@@ -0,0 +1,4 @@
+d root root 0755 /var/run/resolvconf/interface none
+f root root 0644 /etc/resolvconf/run/resolv.conf none
+f root root 0644 /etc/resolvconf/run/enable-updates none
+l root root 0644 /etc/resolv.conf /etc/resolvconf/run/resolv.conf
diff --git a/poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch b/poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch
new file mode 100644
index 000000000..1aead0786
--- /dev/null
+++ b/poky/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch
@@ -0,0 +1,20 @@
+
+busybox installs readlink into /usr/bin, so ensure /usr/bin
+is in the path.
+
+Upstream-Status: Submitted
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: resolvconf-1.76/etc/resolvconf/update.d/libc
+===================================================================
+--- resolvconf-1.76.orig/etc/resolvconf/update.d/libc
++++ resolvconf-1.76/etc/resolvconf/update.d/libc
+@@ -16,7 +16,7 @@
+ #
+
+ set -e
+-PATH=/sbin:/bin
++PATH=/sbin:/bin:/usr/bin
+
+ [ -x /lib/resolvconf/list-records ] || exit 1
+
diff --git a/poky/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb b/poky/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
new file mode 100644
index 000000000..855017728
--- /dev/null
+++ b/poky/meta/recipes-connectivity/resolvconf/resolvconf_1.79.bb
@@ -0,0 +1,67 @@
+SUMMARY = "name server information handler"
+DESCRIPTION = "Resolvconf is a framework for keeping track of the system's \
+information about currently available nameservers. It sets \
+itself up as the intermediary between programs that supply \
+nameserver information and programs that need nameserver \
+information."
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+AUTHOR = "Thomas Hood"
+HOMEPAGE = "http://packages.debian.org/resolvconf"
+RDEPENDS_${PN} = "bash"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160520T044340Z/pool/main/r/${BPN}/${BPN}_1.79.tar.xz \
+ file://fix-path-for-busybox.patch \
+ file://99_resolvconf \
+ "
+
+SRC_URI[md5sum] = "aab2382020fc518f06a06e924c56d300"
+SRC_URI[sha256sum] = "8e2843cd4162b706f0481b3c281657728cbc2822e50a64fff79b79bd8aa870a0"
+
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/r/resolvconf/"
+
+inherit allarch
+
+do_compile () {
+ :
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/99_resolvconf ${D}${sysconfdir}/default/volatiles
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/${BPN}/interface - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/resolvconf.conf
+ fi
+ install -d ${D}${base_libdir}/${BPN}
+ install -d ${D}${sysconfdir}/${BPN}
+ ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
+ install -d ${D}${sysconfdir} ${D}${base_sbindir}
+ install -d ${D}${mandir}/man8 ${D}${docdir}/${P}
+ cp -pPR etc/* ${D}${sysconfdir}/
+ chown -R root:root ${D}${sysconfdir}/
+ install -m 0755 bin/resolvconf ${D}${base_sbindir}/
+ install -m 0755 bin/list-records ${D}${base_libdir}/${BPN}
+ install -d ${D}/${sysconfdir}/network/if-up.d
+ install -m 0755 debian/resolvconf.000resolvconf.if-up ${D}/${sysconfdir}/network/if-up.d/000resolvconf
+ install -d ${D}/${sysconfdir}/network/if-down.d
+ install -m 0755 debian/resolvconf.resolvconf.if-down ${D}/${sysconfdir}/network/if-down.d/resolvconf
+ install -m 0644 README ${D}${docdir}/${P}/
+ install -m 0644 man/resolvconf.8 ${D}${mandir}/man8/
+}
+
+pkg_postinst_${PN} () {
+ if [ -z "$D" ]; then
+ if command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/resolvconf.conf
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
+
+FILES_${PN} += "${base_libdir}/${BPN}"
diff --git a/poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch b/poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch
new file mode 100644
index 000000000..c0e27f3d7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/socat/socat/0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch
@@ -0,0 +1,52 @@
+From fb10ab134d630705cae0c7be42437cc289af7d32 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Mar 2016 21:36:02 +0000
+Subject: [PATCH] Use __c_ispeed and __c_ospeed on musl
+
+Original intention of these asserts is to find if termios structure
+is mapped correctly to locally define union, the get* APIs for
+baudrate would not do the right thing since they do not return the
+value from c_ospeed/c_ispeed but the value which is stored in iflag
+for baudrate.
+
+So we check if we are on Linux but not using glibc then we use
+__c_ispeed and __c_ospeed as defined in musl, however these are
+internal elements of structs it should not have been used this
+way.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+Upstream-Status: Pending
+
+ xioinitialize.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/xioinitialize.c b/xioinitialize.c
+index 9f50155..8fb2e4c 100644
+--- a/xioinitialize.c
++++ b/xioinitialize.c
+@@ -65,6 +65,12 @@ int xioinitialize(void) {
+ #if HAVE_TERMIOS_ISPEED && (ISPEED_OFFSET != -1) && (OSPEED_OFFSET != -1)
+ #if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
+ #if defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
++#if defined(__linux__) && !defined(__GLIBC__)
++ tdata.termarg.__c_ispeed = 0x56789abc;
++ tdata.termarg.__c_ospeed = 0x6789abcd;
++ assert(tdata.termarg.__c_ispeed == tdata.speeds[ISPEED_OFFSET]);
++ assert(tdata.termarg.__c_ospeed == tdata.speeds[OSPEED_OFFSET]);
++#else
+ tdata.termarg.c_ispeed = 0x56789abc;
+ tdata.termarg.c_ospeed = 0x6789abcd;
+ assert(tdata.termarg.c_ispeed == tdata.speeds[ISPEED_OFFSET]);
+@@ -72,6 +78,7 @@ int xioinitialize(void) {
+ #endif
+ #endif
+ #endif
++#endif
+ }
+ #endif
+
+--
+2.8.0
+
diff --git a/poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch b/poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch
new file mode 100644
index 000000000..4bbd36766
--- /dev/null
+++ b/poky/meta/recipes-connectivity/socat/socat/0001-define-NETDB_INTERNAL-to-1-if-not-available.patch
@@ -0,0 +1,32 @@
+From e6a7d96fa3675bdd3f4d7a3d7682381789eef22f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 15 Feb 2016 20:25:34 +0000
+Subject: [PATCH] define NETDB_INTERNAL to -1 if not available
+
+helps build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ compat.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/compat.h b/compat.h
+index c8bee4d..bfb013a 100644
+--- a/compat.h
++++ b/compat.h
+@@ -666,6 +666,10 @@ typedef int sig_atomic_t;
+ # define NETDB_INTERNAL h_NETDB_INTERNAL
+ #endif
+
++#if !defined(NETDB_INTERNAL)
++# define NETDB_INTERNAL (-1)
++#endif
++
+ #ifndef INET_ADDRSTRLEN
+ # define INET_ADDRSTRLEN sizeof(struct sockaddr_in)
+ #endif
+--
+2.7.1
+
diff --git a/poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch b/poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch
new file mode 100644
index 000000000..aa4db65a7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch
@@ -0,0 +1,35 @@
+From c6f0080b55679b6e8b5d332d6e05fdcbda1e4064 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 May 2015 00:58:47 -0700
+Subject: [PATCH] Makefile.in: fix for parallel build
+
+Fixed:
+vsnprintf_r.o: file not recognized: File truncated
+collect2: error: ld returned 3 exit status
+Makefile:122: recipe for target 'filan' failed
+
+Let filan depend on vsnprintf_r.o and snprinterr.o to fix the issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f2a6edb..88b784b 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -118,7 +118,7 @@ PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysut
+ procan: $(PROCAN_OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS)
+
+-filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o
++filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o $(CLIBS)
+
+ libxio.a: $(XIOOBJS) $(UTLOBJS)
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb b/poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb
new file mode 100644
index 000000000..4dcb7b4ad
--- /dev/null
+++ b/poky/meta/recipes-connectivity/socat/socat_1.7.3.2.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Multipurpose relay for bidirectional data transfer"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+HOMEPAGE = "http://www.dest-unreach.org/socat/"
+
+SECTION = "console/network"
+
+DEPENDS = "openssl readline"
+
+LICENSE = "GPL-2.0+-with-OpenSSL-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://README;beginline=257;endline=287;md5=338c05eadd013872abb1d6e198e10a3f"
+
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
+ file://Makefile.in-fix-for-parallel-build.patch \
+ file://0001-define-NETDB_INTERNAL-to-1-if-not-available.patch \
+ file://0001-Access-c_ispeed-and-c_ospeed-via-APIs.patch \
+"
+
+SRC_URI[md5sum] = "607a24c15bd2cb54e9328bfbbd3a1ae9"
+SRC_URI[sha256sum] = "e3561f808739383eb10fada1e5d4f26883f0311b34fd0af7837d0c95ef379251"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+EXTRA_OECONF += "ac_cv_have_z_modifier=yes \
+ ac_cv_header_bsd_libutil_h=no \
+"
+
+PACKAGECONFIG_class-target ??= "tcp-wrappers"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+do_install_prepend () {
+ mkdir -p ${D}${bindir}
+ install -d ${D}${bindir} ${D}${mandir}/man1
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch
new file mode 100644
index 000000000..f34e243de
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch
@@ -0,0 +1,21 @@
+wireless_tools: Avoid stripping iwmulticall
+
+Upstream-Status: Inappropriate [other]
+ The removed code was from upstream.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur wireless_tools.29.orig/Makefile wireless_tools.29/Makefile
+--- wireless_tools.29.orig/Makefile 2011-06-18 11:35:12.183907453 -0500
++++ wireless_tools.29/Makefile 2011-06-18 11:38:09.995907985 -0500
+@@ -135,9 +135,8 @@
+
+ macaddr: macaddr.o $(IWLIB)
+
+-# Always do symbol stripping here
+ iwmulticall: iwmulticall.o
+- $(CC) $(LDFLAGS) -Wl,-s $(XCFLAGS) -o $@ $^ $(LIBS)
++ $(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS)
+
+ # It's a kind of magic...
+ wireless.h:
diff --git a/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch
new file mode 100644
index 000000000..6c0d8cbd2
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch
@@ -0,0 +1,22 @@
+wireless-tools: Remove QA warning: No GNU_HASH in the elf binary
+
+Upstream-Status: Inappropriate [other]
+ Useful within bitbake environment only.
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- wireless_tools.29.orig/Makefile
++++ wireless_tools.29/Makefile
+@@ -144,7 +144,7 @@ wireless.h:
+
+ # Compilation of the dynamic library
+ $(DYNAMIC): $(OBJS:.o=.so)
+- $(CC) -shared -o $@ -Wl,-soname,$@ $(STRIPFLAGS) $(LIBS) -lc $^
++ $(CC) -shared -o $@ -Wl,-soname,$@ $(LDFLAGS) $(STRIPFLAGS) $(LIBS) -lc $^
+
+ # Compilation of the static library
+ $(STATIC): $(OBJS:.o=.so)
diff --git a/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch
new file mode 100644
index 000000000..6a757dae7
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: wireless_tools.30/Makefile
+===================================================================
+--- wireless_tools.30.orig/Makefile 2014-02-01 00:21:04.148463382 -0800
++++ wireless_tools.30/Makefile 2014-02-01 00:23:35.448072279 -0800
+@@ -76,7 +76,7 @@
+ INSTALL_DIR= $(PREFIX)/sbin
+ INSTALL_LIB= $(PREFIX)/lib
+ INSTALL_INC= $(PREFIX)/include
+-INSTALL_MAN= $(PREFIX)/man
++INSTALL_MAN= $(PREFIX)/share/man
+
+ # Various commands
+ RM = rm -f
diff --git a/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch
new file mode 100644
index 000000000..3a22c3f1e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch
@@ -0,0 +1,19 @@
+When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache
+(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call
+touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Upstream-Status: Inappropriate [disable feature]
+
+diff -uNr wireless_tools.29.orig/Makefile wireless_tools.29/Makefile
+--- wireless_tools.29.orig/Makefile 2007-09-18 01:56:46.000000000 +0200
++++ wireless_tools.29/Makefile 2012-02-15 20:46:41.780763514 +0100
+@@ -163,7 +163,6 @@
+ install -m 755 $(DYNAMIC) $(INSTALL_LIB)
+ ln -sfn $(DYNAMIC) $(INSTALL_LIB)/$(DYNAMIC_LINK)
+ @echo "*** Don't forget to add $(INSTALL_LIB) to /etc/ld.so.conf, and run ldconfig as root. ***"
+- @$(LDCONFIG) || echo "*** Could not run ldconfig ! ***"
+
+ # Install the static library
+ install-static:: $(STATIC)
diff --git a/poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
new file mode 100644
index 000000000..0a342071e
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Tools for the Linux Standard Wireless Extension Subsystem"
+HOMEPAGE = "https://hewlettpackard.github.io/wireless-tools/Tools.html"
+LICENSE = "GPLv2 & (LGPLv2.1 | MPL-1.1 | BSD)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://iwconfig.c;beginline=1;endline=12;md5=cf710eb1795c376eb10ea4ff04649caf \
+ file://iwevent.c;beginline=59;endline=72;md5=d66a10026d4394f0a5b1c5587bce4537 \
+ file://sample_enc.c;beginline=1;endline=4;md5=838372be07874260b566bae2f6ed33b6"
+SECTION = "base"
+PE = "1"
+
+SRC_URI = "https://hewlettpackard.github.io/wireless-tools/wireless_tools.${PV}.tar.gz \
+ file://remove.ldconfig.call.patch \
+ file://man.patch \
+ file://avoid_strip.patch \
+ file://ldflags.patch \
+ "
+SRC_URI[md5sum] = "ca91ba7c7eff9bfff6926b1a34a4697d"
+SRC_URI[sha256sum] = "abd9c5c98abf1fdd11892ac2f8a56737544fe101e1be27c6241a564948f34c63"
+
+UPSTREAM_CHECK_URI = "https://hewlettpackard.github.io/wireless-tools/Tools.html"
+UPSTREAM_CHECK_REGEX = "wireless_tools\.(?P<pver>(\d+)(\..*|))\.tar\.gz"
+
+S = "${WORKDIR}/wireless_tools.30"
+
+CFLAGS =+ "-I${S}"
+EXTRA_OEMAKE = "-e 'BUILD_SHARED=y' \
+ 'INSTALL_DIR=${D}${base_sbindir}' \
+ 'INSTALL_LIB=${D}${libdir}' \
+ 'INSTALL_INC=${D}${includedir}' \
+ 'INSTALL_MAN=${D}${mandir}'"
+
+do_compile() {
+ oe_runmake all libiw.a
+}
+
+do_install() {
+ oe_runmake PREFIX=${D} install-iwmulticall install-dynamic install-man install-hdr
+ install -d ${D}${sbindir}
+ install -m 0755 ifrename ${D}${sbindir}/ifrename
+}
+
+PACKAGES = "libiw libiw-dev libiw-doc ifrename-doc ifrename ${PN} ${PN}-doc ${PN}-dbg"
+
+FILES_libiw = "${libdir}/*.so.*"
+FILES_libiw-dev = "${libdir}/*.a ${libdir}/*.so ${includedir}"
+FILES_libiw-doc = "${mandir}/man7"
+FILES_ifrename = "${sbindir}/ifrename"
+FILES_ifrename-doc = "${mandir}/man8/ifrename.8 ${mandir}/man5/iftab.5"
+FILES_${PN} = "${bindir} ${sbindir}/iw* ${base_sbindir} ${base_bindir} ${sysconfdir}/network"
+FILES_${PN}-doc = "${mandir}"
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant
new file mode 100644
index 000000000..6ff4dd882
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant
@@ -0,0 +1 @@
+d root root 0700 /var/run/wpa_supplicant none
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig
new file mode 100644
index 000000000..f04e398fd
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig
@@ -0,0 +1,552 @@
+# Example wpa_supplicant build time configuration
+#
+# This file lists the configuration options that are used when building the
+# hostapd binary. All lines starting with # are ignored. Configuration option
+# lines must be commented out complete, if they are not to be included, i.e.,
+# just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cases, these lines should use += in order not
+# to override previous values of the variables.
+
+
+# Uncomment following two lines and fix the paths if you have installed OpenSSL
+# or GnuTLS in non-default location
+#CFLAGS += -I/usr/local/openssl/include
+#LIBS += -L/usr/local/openssl/lib
+
+# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
+# the kerberos files are not in the default include path. Following line can be
+# used to fix build issues on such systems (krb5.h not found).
+#CFLAGS += -I/usr/include/kerberos
+
+# Example configuration for various cross-compilation platforms
+
+#### sveasoft (e.g., for Linksys WRT54G) ######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
+#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
+###############################################################################
+
+#### openwrt (e.g., for Linksys WRT54G) #######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
+# -I../WRT54GS/release/src/include
+#LIBS = -lssl
+###############################################################################
+
+
+# Driver interface for Host AP driver
+CONFIG_DRIVER_HOSTAP=y
+
+# Driver interface for Agere driver
+#CONFIG_DRIVER_HERMES=y
+# Change include directories to match with the local setup
+#CFLAGS += -I../../hcf -I../../include -I../../include/hcf
+#CFLAGS += -I../../include/wireless
+
+# Driver interface for madwifi driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_MADWIFI=y
+# Set include directory to the madwifi source tree
+#CFLAGS += -I../../madwifi
+
+# Driver interface for ndiswrapper
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_NDISWRAPPER=y
+
+# Driver interface for Atmel driver
+# CONFIG_DRIVER_ATMEL=y
+
+# Driver interface for old Broadcom driver
+# Please note that the newer Broadcom driver ("hybrid Linux driver") supports
+# Linux wireless extensions and does not need (or even work) with the old
+# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver.
+#CONFIG_DRIVER_BROADCOM=y
+# Example path for wlioctl.h; change to match your configuration
+#CFLAGS += -I/opt/WRT54GS/release/src/include
+
+# Driver interface for Intel ipw2100/2200 driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_IPW=y
+
+# Driver interface for Ralink driver
+#CONFIG_DRIVER_RALINK=y
+
+# Driver interface for generic Linux wireless extensions
+# Note: WEXT is deprecated in the current Linux kernel version and no new
+# functionality is added to it. nl80211-based interface is the new
+# replacement for WEXT and its use allows wpa_supplicant to properly control
+# the driver to improve existing functionality like roaming and to support new
+# functionality.
+CONFIG_DRIVER_WEXT=y
+
+# Driver interface for Linux drivers using the nl80211 kernel interface
+CONFIG_DRIVER_NL80211=y
+
+# driver_nl80211.c requires libnl. If you are compiling it yourself
+# you may need to point hostapd to your version of libnl.
+#
+#CFLAGS += -I$<path to libnl include files>
+#LIBS += -L$<path to libnl library files>
+
+# Use libnl v2.0 (or 3.0) libraries.
+#CONFIG_LIBNL20=y
+
+# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
+CONFIG_LIBNL32=y
+
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
+
+# Driver interface for Windows NDIS
+#CONFIG_DRIVER_NDIS=y
+#CFLAGS += -I/usr/include/w32api/ddk
+#LIBS += -L/usr/local/lib
+# For native build using mingw
+#CONFIG_NATIVE_WINDOWS=y
+# Additional directories for cross-compilation on Linux host for mingw target
+#CFLAGS += -I/opt/mingw/mingw32/include/ddk
+#LIBS += -L/opt/mingw/mingw32/lib
+#CC=mingw32-gcc
+# By default, driver_ndis uses WinPcap for low-level operations. This can be
+# replaced with the following option which replaces WinPcap calls with NDISUIO.
+# However, this requires that WZC is disabled (net stop wzcsvc) before starting
+# wpa_supplicant.
+# CONFIG_USE_NDISUIO=y
+
+# Driver interface for development testing
+#CONFIG_DRIVER_TEST=y
+
+# Driver interface for wired Ethernet drivers
+CONFIG_DRIVER_WIRED=y
+
+# Driver interface for the Broadcom RoboSwitch family
+#CONFIG_DRIVER_ROBOSWITCH=y
+
+# Driver interface for no driver (e.g., WPS ER only)
+#CONFIG_DRIVER_NONE=y
+
+# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
+# included)
+CONFIG_IEEE8021X_EAPOL=y
+
+# EAP-MD5
+CONFIG_EAP_MD5=y
+
+# EAP-MSCHAPv2
+CONFIG_EAP_MSCHAPV2=y
+
+# EAP-TLS
+CONFIG_EAP_TLS=y
+
+# EAL-PEAP
+CONFIG_EAP_PEAP=y
+
+# EAP-TTLS
+CONFIG_EAP_TTLS=y
+
+# EAP-FAST
+# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed
+# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g.,
+# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions.
+#CONFIG_EAP_FAST=y
+
+# EAP-GTC
+CONFIG_EAP_GTC=y
+
+# EAP-OTP
+CONFIG_EAP_OTP=y
+
+# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
+#CONFIG_EAP_SIM=y
+
+# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
+#CONFIG_EAP_PSK=y
+
+# EAP-pwd (secure authentication using only a password)
+#CONFIG_EAP_PWD=y
+
+# EAP-PAX
+#CONFIG_EAP_PAX=y
+
+# LEAP
+CONFIG_EAP_LEAP=y
+
+# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
+#CONFIG_EAP_AKA=y
+
+# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
+# This requires CONFIG_EAP_AKA to be enabled, too.
+#CONFIG_EAP_AKA_PRIME=y
+
+# Enable USIM simulator (Milenage) for EAP-AKA
+#CONFIG_USIM_SIMULATOR=y
+
+# EAP-SAKE
+#CONFIG_EAP_SAKE=y
+
+# EAP-GPSK
+#CONFIG_EAP_GPSK=y
+# Include support for optional SHA256 cipher suite in EAP-GPSK
+#CONFIG_EAP_GPSK_SHA256=y
+
+# EAP-TNC and related Trusted Network Connect support (experimental)
+#CONFIG_EAP_TNC=y
+
+# Wi-Fi Protected Setup (WPS)
+CONFIG_WPS=y
+# Enable WSC 2.0 support
+#CONFIG_WPS2=y
+# Enable WPS external registrar functionality
+#CONFIG_WPS_ER=y
+# Disable credentials for an open network by default when acting as a WPS
+# registrar.
+#CONFIG_WPS_REG_DISABLE_OPEN=y
+# Enable WPS support with NFC config method
+#CONFIG_WPS_NFC=y
+
+# EAP-IKEv2
+#CONFIG_EAP_IKEV2=y
+
+# EAP-EKE
+#CONFIG_EAP_EKE=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+CONFIG_PKCS12=y
+
+# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
+# engine.
+CONFIG_SMARTCARD=y
+
+# PC/SC interface for smartcards (USIM, GSM SIM)
+# Enable this if EAP-SIM or EAP-AKA is included
+#CONFIG_PCSC=y
+
+# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
+#CONFIG_HT_OVERRIDES=y
+
+# Support VHT overrides (disable VHT, mask MCS rates, etc.)
+#CONFIG_VHT_OVERRIDES=y
+
+# Development testing
+#CONFIG_EAPOL_TEST=y
+
+# Select control interface backend for external programs, e.g, wpa_cli:
+# unix = UNIX domain sockets (default for Linux/*BSD)
+# udp = UDP sockets using localhost (127.0.0.1)
+# named_pipe = Windows Named Pipe (default for Windows)
+# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
+# y = use default (backwards compatibility)
+# If this option is commented out, control interface is not included in the
+# build.
+CONFIG_CTRL_IFACE=y
+
+# Include support for GNU Readline and History Libraries in wpa_cli.
+# When building a wpa_cli binary for distribution, please note that these
+# libraries are licensed under GPL and as such, BSD license may not apply for
+# the resulting binary.
+#CONFIG_READLINE=y
+
+# Include internal line edit mode in wpa_cli. This can be used as a replacement
+# for GNU Readline to provide limited command line editing and history support.
+#CONFIG_WPA_CLI_EDIT=y
+
+# Remove debugging code that is printing out debug message to stdout.
+# This can be used to reduce the size of the wpa_supplicant considerably
+# if debugging code is not needed. The size reduction can be around 35%
+# (e.g., 90 kB).
+#CONFIG_NO_STDOUT_DEBUG=y
+
+# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
+# 35-50 kB in code size.
+#CONFIG_NO_WPA=y
+
+# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
+# This option can be used to reduce code size by removing support for
+# converting ASCII passphrases into PSK. If this functionality is removed, the
+# PSK can only be configured as the 64-octet hexstring (e.g., from
+# wpa_passphrase). This saves about 0.5 kB in code size.
+#CONFIG_NO_WPA_PASSPHRASE=y
+
+# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
+# This can be used if ap_scan=1 mode is never enabled.
+#CONFIG_NO_SCAN_PROCESSING=y
+
+# Select configuration backend:
+# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
+# path is given on command line, not here; this option is just used to
+# select the backend that allows configuration files to be used)
+# winreg = Windows registry (see win_example.reg for an example)
+CONFIG_BACKEND=file
+
+# Remove configuration write functionality (i.e., to allow the configuration
+# file to be updated based on runtime configuration changes). The runtime
+# configuration can still be changed, the changes are just not going to be
+# persistent over restarts. This option can be used to reduce code size by
+# about 3.5 kB.
+#CONFIG_NO_CONFIG_WRITE=y
+
+# Remove support for configuration blobs to reduce code size by about 1.5 kB.
+#CONFIG_NO_CONFIG_BLOBS=y
+
+# Select program entry point implementation:
+# main = UNIX/POSIX like main() function (default)
+# main_winsvc = Windows service (read parameters from registry)
+# main_none = Very basic example (development use only)
+#CONFIG_MAIN=main
+
+# Select wrapper for operatins system and C library specific functions
+# unix = UNIX/POSIX like systems (default)
+# win32 = Windows systems
+# none = Empty template
+#CONFIG_OS=unix
+
+# Select event loop implementation
+# eloop = select() loop (default)
+# eloop_win = Windows events and WaitForMultipleObject() loop
+#CONFIG_ELOOP=eloop
+
+# Should we use poll instead of select? Select is used by default.
+#CONFIG_ELOOP_POLL=y
+
+# Select layer 2 packet implementation
+# linux = Linux packet socket (default)
+# pcap = libpcap/libdnet/WinPcap
+# freebsd = FreeBSD libpcap
+# winpcap = WinPcap with receive thread
+# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
+# none = Empty template
+#CONFIG_L2_PACKET=linux
+
+# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
+CONFIG_PEERKEY=y
+
+# IEEE 802.11w (management frame protection), also known as PMF
+# Driver support is also needed for IEEE 802.11w.
+#CONFIG_IEEE80211W=y
+
+# Select TLS implementation
+# openssl = OpenSSL (default)
+# gnutls = GnuTLS
+# internal = Internal TLSv1 implementation (experimental)
+# none = Empty template
+#CONFIG_TLS=openssl
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
+# can be enabled to get a stronger construction of messages when block ciphers
+# are used. It should be noted that some existing TLS v1.0 -based
+# implementation may not be compatible with TLS v1.1 message (ClientHello is
+# sent prior to negotiating which version will be used)
+#CONFIG_TLSV11=y
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
+# can be enabled to enable use of stronger crypto algorithms. It should be
+# noted that some existing TLS v1.0 -based implementation may not be compatible
+# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
+# will be used)
+#CONFIG_TLSV12=y
+
+# If CONFIG_TLS=internal is used, additional library and include paths are
+# needed for LibTomMath. Alternatively, an integrated, minimal version of
+# LibTomMath can be used. See beginning of libtommath.c for details on benefits
+# and drawbacks of this option.
+#CONFIG_INTERNAL_LIBTOMMATH=y
+#ifndef CONFIG_INTERNAL_LIBTOMMATH
+#LTM_PATH=/usr/src/libtommath-0.39
+#CFLAGS += -I$(LTM_PATH)
+#LIBS += -L$(LTM_PATH)
+#LIBS_p += -L$(LTM_PATH)
+#endif
+# At the cost of about 4 kB of additional binary size, the internal LibTomMath
+# can be configured to include faster routines for exptmod, sqr, and div to
+# speed up DH and RSA calculation considerably
+#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
+
+# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
+# This is only for Windows builds and requires WMI-related header files and
+# WbemUuid.Lib from Platform SDK even when building with MinGW.
+#CONFIG_NDIS_EVENTS_INTEGRATED=y
+#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
+
+# Add support for old DBus control interface
+# (fi.epitest.hostap.WPASupplicant)
+#CONFIG_CTRL_IFACE_DBUS=y
+
+# Add support for new DBus control interface
+# (fi.w1.hostap.wpa_supplicant1)
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# Add introspection support for new DBus control interface
+#CONFIG_CTRL_IFACE_DBUS_INTRO=y
+
+# Add support for loading EAP methods dynamically as shared libraries.
+# When this option is enabled, each EAP method can be either included
+# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
+# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
+# be loaded in the beginning of the wpa_supplicant configuration file
+# (see load_dynamic_eap parameter in the example file) before being used in
+# the network blocks.
+#
+# Note that some shared parts of EAP methods are included in the main program
+# and in order to be able to use dynamic EAP methods using these parts, the
+# main program must have been build with the EAP method enabled (=y or =dyn).
+# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
+# unless at least one of them was included in the main build to force inclusion
+# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
+# in the main build to be able to load these methods dynamically.
+#
+# Please also note that using dynamic libraries will increase the total binary
+# size. Thus, it may not be the best option for targets that have limited
+# amount of memory/flash.
+#CONFIG_DYNAMIC_EAP_METHODS=y
+
+# IEEE Std 802.11r-2008 (Fast BSS Transition)
+#CONFIG_IEEE80211R=y
+
+# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
+#CONFIG_DEBUG_FILE=y
+
+# Send debug messages to syslog instead of stdout
+#CONFIG_DEBUG_SYSLOG=y
+# Set syslog facility for debug messages
+#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
+
+# Add support for sending all debug messages (regardless of debug verbosity)
+# to the Linux kernel tracing facility. This helps debug the entire stack by
+# making it easy to record everything happening from the driver up into the
+# same file, e.g., using trace-cmd.
+#CONFIG_DEBUG_LINUX_TRACING=y
+
+# Enable privilege separation (see README 'Privilege separation' for details)
+#CONFIG_PRIVSEP=y
+
+# Enable mitigation against certain attacks against TKIP by delaying Michael
+# MIC error reports by a random amount of time between 0 and 60 seconds
+#CONFIG_DELAYED_MIC_ERROR_REPORT=y
+
+# Enable tracing code for developer debugging
+# This tracks use of memory allocations and other registrations and reports
+# incorrect use with a backtrace of call (or allocation) location.
+#CONFIG_WPA_TRACE=y
+# For BSD, uncomment these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
+
+# Use libbfd to get more details for developer debugging
+# This enables use of libbfd to get more detailed symbols for the backtraces
+# generated by CONFIG_WPA_TRACE=y.
+#CONFIG_WPA_TRACE_BFD=y
+# For BSD, uncomment these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
+
+CONFIG_TLS = %ssl%
+CONFIG_CTRL_IFACE_DBUS=y
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# wpa_supplicant depends on strong random number generation being available
+# from the operating system. os_get_random() function is used to fetch random
+# data when needed, e.g., for key generation. On Linux and BSD systems, this
+# works by reading /dev/urandom. It should be noted that the OS entropy pool
+# needs to be properly initialized before wpa_supplicant is started. This is
+# important especially on embedded devices that do not have a hardware random
+# number generator and may by default start up with minimal entropy available
+# for random number generation.
+#
+# As a safety net, wpa_supplicant is by default trying to internally collect
+# additional entropy for generating random data to mix in with the data fetched
+# from the OS. This by itself is not considered to be very strong, but it may
+# help in cases where the system pool is not initialized properly. However, it
+# is very strongly recommended that the system pool is initialized with enough
+# entropy either by using hardware assisted random number generator or by
+# storing state over device reboots.
+#
+# wpa_supplicant can be configured to maintain its own entropy store over
+# restarts to enhance random number generation. This is not perfect, but it is
+# much more secure than using the same sequence of random numbers after every
+# reboot. This can be enabled with -e<entropy file> command line option. The
+# specified file needs to be readable and writable by wpa_supplicant.
+#
+# If the os_get_random() is known to provide strong random data (e.g., on
+# Linux/BSD, the board in question is known to have reliable source of random
+# data from /dev/urandom), the internal wpa_supplicant random pool can be
+# disabled. This will save some in binary size and CPU use. However, this
+# should only be considered for builds that are known to be used on devices
+# that meet the requirements described above.
+#CONFIG_NO_RANDOM_POOL=y
+
+# IEEE 802.11n (High Throughput) support (mainly for AP mode)
+#CONFIG_IEEE80211N=y
+
+# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
+# (depends on CONFIG_IEEE80211N)
+#CONFIG_IEEE80211AC=y
+
+# Wireless Network Management (IEEE Std 802.11v-2011)
+# Note: This is experimental and not complete implementation.
+#CONFIG_WNM=y
+
+# Interworking (IEEE 802.11u)
+# This can be used to enable functionality to improve interworking with
+# external networks (GAS/ANQP to learn more about the networks and network
+# selection based on available credentials).
+#CONFIG_INTERWORKING=y
+
+# Hotspot 2.0
+#CONFIG_HS20=y
+
+# Disable roaming in wpa_supplicant
+#CONFIG_NO_ROAMING=y
+
+# AP mode operations with wpa_supplicant
+# This can be used for controlling AP mode operations with wpa_supplicant. It
+# should be noted that this is mainly aimed at simple cases like
+# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
+# external RADIUS server can be supported with hostapd.
+CONFIG_AP=y
+
+CONFIG_BGSCAN_SIMPLE=y
+
+# P2P (Wi-Fi Direct)
+# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
+# more information on P2P operations.
+#CONFIG_P2P=y
+
+# Enable TDLS support
+#CONFIG_TDLS=y
+
+# Wi-Fi Direct
+# This can be used to enable Wi-Fi Direct extensions for P2P using an external
+# program to control the additional information exchanges in the messages.
+#CONFIG_WIFI_DISPLAY=y
+
+# Autoscan
+# This can be used to enable automatic scan support in wpa_supplicant.
+# See wpa_supplicant.conf for more information on autoscan usage.
+#
+# Enabling directly a module will enable autoscan support.
+# For exponential module:
+CONFIG_AUTOSCAN_EXPONENTIAL=y
+# For periodic module:
+#CONFIG_AUTOSCAN_PERIODIC=y
+
+# Password (and passphrase, etc.) backend for external storage
+# These optional mechanisms can be used to add support for storing passwords
+# and other secrets in external (to wpa_supplicant) location. This allows, for
+# example, operating system specific key storage to be used
+#
+# External password backend for testing purposes (developer use)
+#CONFIG_EXT_PASSWORD_TEST=y
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch
new file mode 100644
index 000000000..436520fe6
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/key-replay-cve-multiple.patch
@@ -0,0 +1,1025 @@
+The WPA2 four-way handshake protocol is vulnerable to replay attacks which can
+result in unauthenticated clients gaining access to the network.
+
+Backport a number of patches from upstream to fix this.
+
+CVE: CVE-2017-13077
+CVE: CVE-2017-13078
+CVE: CVE-2017-13079
+CVE: CVE-2017-13080
+CVE: CVE-2017-13081
+CVE: CVE-2017-13082
+CVE: CVE-2017-13086
+CVE: CVE-2017-13087
+CVE: CVE-2017-13088
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From cf4cab804c7afd5c45505528a8d16e46163243a2 Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 14 Jul 2017 15:15:35 +0200
+Subject: [PATCH 1/8] hostapd: Avoid key reinstallation in FT handshake
+
+Do not reinstall TK to the driver during Reassociation Response frame
+processing if the first attempt of setting the TK succeeded. This avoids
+issues related to clearing the TX/RX PN that could result in reusing
+same PN values for transmitted frames (e.g., due to CCM nonce reuse and
+also hitting replay protection on the receiver) and accepting replayed
+frames on RX side.
+
+This issue was introduced by the commit
+0e84c25434e6a1f283c7b4e62e483729085b78d2 ('FT: Fix PTK configuration in
+authenticator') which allowed wpa_ft_install_ptk() to be called multiple
+times with the same PTK. While the second configuration attempt is
+needed with some drivers, it must be done only if the first attempt
+failed.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/ap/ieee802_11.c | 16 +++++++++++++---
+ src/ap/wpa_auth.c | 11 +++++++++++
+ src/ap/wpa_auth.h | 3 ++-
+ src/ap/wpa_auth_ft.c | 10 ++++++++++
+ src/ap/wpa_auth_i.h | 1 +
+ 5 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
+index 4e04169..333035f 100644
+--- a/src/ap/ieee802_11.c
++++ b/src/ap/ieee802_11.c
+@@ -1841,6 +1841,7 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ {
+ struct ieee80211_ht_capabilities ht_cap;
+ struct ieee80211_vht_capabilities vht_cap;
++ int set = 1;
+
+ /*
+ * Remove the STA entry to ensure the STA PS state gets cleared and
+@@ -1848,9 +1849,18 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ * FT-over-the-DS, where a station re-associates back to the same AP but
+ * skips the authentication flow, or if working with a driver that
+ * does not support full AP client state.
++ *
++ * Skip this if the STA has already completed FT reassociation and the
++ * TK has been configured since the TX/RX PN must not be reset to 0 for
++ * the same key.
+ */
+- if (!sta->added_unassoc)
++ if (!sta->added_unassoc &&
++ (!(sta->flags & WLAN_STA_AUTHORIZED) ||
++ !wpa_auth_sta_ft_tk_already_set(sta->wpa_sm))) {
+ hostapd_drv_sta_remove(hapd, sta->addr);
++ wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED);
++ set = 0;
++ }
+
+ #ifdef CONFIG_IEEE80211N
+ if (sta->flags & WLAN_STA_HT)
+@@ -1873,11 +1883,11 @@ static int add_associated_sta(struct hostapd_data *hapd,
+ sta->flags & WLAN_STA_VHT ? &vht_cap : NULL,
+ sta->flags | WLAN_STA_ASSOC, sta->qosinfo,
+ sta->vht_opmode, sta->p2p_ie ? 1 : 0,
+- sta->added_unassoc)) {
++ set)) {
+ hostapd_logger(hapd, sta->addr,
+ HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE,
+ "Could not %s STA to kernel driver",
+- sta->added_unassoc ? "set" : "add");
++ set ? "set" : "add");
+
+ if (sta->added_unassoc) {
+ hostapd_drv_sta_remove(hapd, sta->addr);
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 3587086..707971d 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1745,6 +1745,9 @@ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event)
+ #else /* CONFIG_IEEE80211R */
+ break;
+ #endif /* CONFIG_IEEE80211R */
++ case WPA_DRV_STA_REMOVED:
++ sm->tk_already_set = FALSE;
++ return 0;
+ }
+
+ #ifdef CONFIG_IEEE80211R
+@@ -3250,6 +3253,14 @@ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm)
+ }
+
+
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm)
++{
++ if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt))
++ return 0;
++ return sm->tk_already_set;
++}
++
++
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ struct rsn_pmksa_cache_entry *entry)
+ {
+diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
+index 0de8d97..97461b0 100644
+--- a/src/ap/wpa_auth.h
++++ b/src/ap/wpa_auth.h
+@@ -267,7 +267,7 @@ void wpa_receive(struct wpa_authenticator *wpa_auth,
+ u8 *data, size_t data_len);
+ enum wpa_event {
+ WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
+- WPA_REAUTH_EAPOL, WPA_ASSOC_FT
++ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED
+ };
+ void wpa_remove_ptk(struct wpa_state_machine *sm);
+ int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
+@@ -280,6 +280,7 @@ int wpa_auth_pairwise_set(struct wpa_state_machine *sm);
+ int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
+ int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
+ int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
+ int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
+ struct rsn_pmksa_cache_entry *entry);
+ struct rsn_pmksa_cache_entry *
+diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
+index 42242a5..e63b99a 100644
+--- a/src/ap/wpa_auth_ft.c
++++ b/src/ap/wpa_auth_ft.c
+@@ -780,6 +780,14 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+ return;
+ }
+
++ if (sm->tk_already_set) {
++ /* Must avoid TK reconfiguration to prevent clearing of TX/RX
++ * PN in the driver */
++ wpa_printf(MSG_DEBUG,
++ "FT: Do not re-install same PTK to the driver");
++ return;
++ }
++
+ /* FIX: add STA entry to kernel/driver here? The set_key will fail
+ * most likely without this.. At the moment, STA entry is added only
+ * after association has been completed. This function will be called
+@@ -792,6 +800,7 @@ void wpa_ft_install_ptk(struct wpa_state_machine *sm)
+
+ /* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */
+ sm->pairwise_set = TRUE;
++ sm->tk_already_set = TRUE;
+ }
+
+
+@@ -898,6 +907,7 @@ static int wpa_ft_process_auth_req(struct wpa_state_machine *sm,
+
+ sm->pairwise = pairwise;
+ sm->PTK_valid = TRUE;
++ sm->tk_already_set = FALSE;
+ wpa_ft_install_ptk(sm);
+
+ buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
+index 72b7eb3..7fd8f05 100644
+--- a/src/ap/wpa_auth_i.h
++++ b/src/ap/wpa_auth_i.h
+@@ -65,6 +65,7 @@ struct wpa_state_machine {
+ struct wpa_ptk PTK;
+ Boolean PTK_valid;
+ Boolean pairwise_set;
++ Boolean tk_already_set;
+ int keycount;
+ Boolean Pair;
+ struct wpa_key_replay_counter {
+--
+2.7.4
+
+From 927f891007c402fefd1ff384645b3f07597c3ede Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Wed, 12 Jul 2017 16:03:24 +0200
+Subject: [PATCH 2/8] Prevent reinstallation of an already in-use group key
+
+Track the current GTK and IGTK that is in use and when receiving a
+(possibly retransmitted) Group Message 1 or WNM-Sleep Mode Response, do
+not install the given key if it is already in use. This prevents an
+attacker from trying to trick the client into resetting or lowering the
+sequence counter associated to the group key.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h | 11 +++++
+ src/rsn_supp/wpa.c | 116 ++++++++++++++++++++++++++++++------------------
+ src/rsn_supp/wpa_i.h | 4 ++
+ 3 files changed, 87 insertions(+), 44 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index af1d0f0..d200285 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -217,6 +217,17 @@ struct wpa_ptk {
+ size_t tk_len;
+ };
+
++struct wpa_gtk {
++ u8 gtk[WPA_GTK_MAX_LEN];
++ size_t gtk_len;
++};
++
++#ifdef CONFIG_IEEE80211W
++struct wpa_igtk {
++ u8 igtk[WPA_IGTK_MAX_LEN];
++ size_t igtk_len;
++};
++#endif /* CONFIG_IEEE80211W */
+
+ /* WPA IE version 1
+ * 00-50-f2:1 (OUI:OUI type)
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 3c47879..95bd7be 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -714,6 +714,15 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ const u8 *_gtk = gd->gtk;
+ u8 gtk_buf[32];
+
++ /* Detect possible key reinstallation */
++ if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++ os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++ "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
++ gd->keyidx, gd->tx, gd->gtk_len);
++ return 0;
++ }
++
+ wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len);
+ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ "WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)",
+@@ -748,6 +757,9 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ }
+ os_memset(gtk_buf, 0, sizeof(gtk_buf));
+
++ sm->gtk.gtk_len = gd->gtk_len;
++ os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++
+ return 0;
+ }
+
+@@ -854,6 +866,48 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ }
+
+
++#ifdef CONFIG_IEEE80211W
++static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
++ const struct wpa_igtk_kde *igtk)
++{
++ size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
++ u16 keyidx = WPA_GET_LE16(igtk->keyid);
++
++ /* Detect possible key reinstallation */
++ if (sm->igtk.igtk_len == len &&
++ os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++ "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
++ keyidx);
++ return 0;
++ }
++
++ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
++ "WPA: IGTK keyid %d pn %02x%02x%02x%02x%02x%02x",
++ keyidx, MAC2STR(igtk->pn));
++ wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK", igtk->igtk, len);
++ if (keyidx > 4095) {
++ wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++ "WPA: Invalid IGTK KeyID %d", keyidx);
++ return -1;
++ }
++ if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
++ broadcast_ether_addr,
++ keyidx, 0, igtk->pn, sizeof(igtk->pn),
++ igtk->igtk, len) < 0) {
++ wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
++ "WPA: Failed to configure IGTK to the driver");
++ return -1;
++ }
++
++ sm->igtk.igtk_len = len;
++ os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++
++ return 0;
++}
++#endif /* CONFIG_IEEE80211W */
++
++
+ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ struct wpa_eapol_ie_parse *ie)
+ {
+@@ -864,30 +918,14 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ if (ie->igtk) {
+ size_t len;
+ const struct wpa_igtk_kde *igtk;
+- u16 keyidx;
++
+ len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ if (ie->igtk_len != WPA_IGTK_KDE_PREFIX_LEN + len)
+ return -1;
++
+ igtk = (const struct wpa_igtk_kde *) ie->igtk;
+- keyidx = WPA_GET_LE16(igtk->keyid);
+- wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: IGTK keyid %d "
+- "pn %02x%02x%02x%02x%02x%02x",
+- keyidx, MAC2STR(igtk->pn));
+- wpa_hexdump_key(MSG_DEBUG, "WPA: IGTK",
+- igtk->igtk, len);
+- if (keyidx > 4095) {
+- wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+- "WPA: Invalid IGTK KeyID %d", keyidx);
+- return -1;
+- }
+- if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+- broadcast_ether_addr,
+- keyidx, 0, igtk->pn, sizeof(igtk->pn),
+- igtk->igtk, len) < 0) {
+- wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
+- "WPA: Failed to configure IGTK to the driver");
++ if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ return -1;
+- }
+ }
+
+ return 0;
+@@ -2307,7 +2345,7 @@ void wpa_sm_deinit(struct wpa_sm *sm)
+ */
+ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ {
+- int clear_ptk = 1;
++ int clear_keys = 1;
+
+ if (sm == NULL)
+ return;
+@@ -2333,11 +2371,11 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ /* Prepare for the next transition */
+ wpa_ft_prepare_auth_request(sm, NULL);
+
+- clear_ptk = 0;
++ clear_keys = 0;
+ }
+ #endif /* CONFIG_IEEE80211R */
+
+- if (clear_ptk) {
++ if (clear_keys) {
+ /*
+ * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if
+ * this is not part of a Fast BSS Transition.
+@@ -2347,6 +2385,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ sm->tptk_set = 0;
+ os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++ os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++ os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ }
+
+ #ifdef CONFIG_TDLS
+@@ -2877,6 +2919,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ os_memset(sm->pmk, 0, sizeof(sm->pmk));
+ os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ os_memset(&sm->tptk, 0, sizeof(sm->tptk));
++ os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++#ifdef CONFIG_IEEE80211W
++ os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++#endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+ os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0));
+@@ -2949,29 +2995,11 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ os_memset(&gd, 0, sizeof(gd));
+ #ifdef CONFIG_IEEE80211W
+ } else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
+- struct wpa_igtk_kde igd;
+- u16 keyidx;
+-
+- os_memset(&igd, 0, sizeof(igd));
+- keylen = wpa_cipher_key_len(sm->mgmt_group_cipher);
+- os_memcpy(igd.keyid, buf + 2, 2);
+- os_memcpy(igd.pn, buf + 4, 6);
+-
+- keyidx = WPA_GET_LE16(igd.keyid);
+- os_memcpy(igd.igtk, buf + 10, keylen);
+-
+- wpa_hexdump_key(MSG_DEBUG, "Install IGTK (WNM SLEEP)",
+- igd.igtk, keylen);
+- if (wpa_sm_set_key(sm, wpa_cipher_to_alg(sm->mgmt_group_cipher),
+- broadcast_ether_addr,
+- keyidx, 0, igd.pn, sizeof(igd.pn),
+- igd.igtk, keylen) < 0) {
+- wpa_printf(MSG_DEBUG, "Failed to install the IGTK in "
+- "WNM mode");
+- os_memset(&igd, 0, sizeof(igd));
++ const struct wpa_igtk_kde *igtk;
++
++ igtk = (const struct wpa_igtk_kde *) (buf + 2);
++ if (wpa_supplicant_install_igtk(sm, igtk) < 0)
+ return -1;
+- }
+- os_memset(&igd, 0, sizeof(igd));
+ #endif /* CONFIG_IEEE80211W */
+ } else {
+ wpa_printf(MSG_DEBUG, "Unknown element id");
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index f653ba6..afc9e37 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -31,6 +31,10 @@ struct wpa_sm {
+ u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
+ int rx_replay_counter_set;
+ u8 request_counter[WPA_REPLAY_COUNTER_LEN];
++ struct wpa_gtk gtk;
++#ifdef CONFIG_IEEE80211W
++ struct wpa_igtk igtk;
++#endif /* CONFIG_IEEE80211W */
+
+ struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+
+--
+2.7.4
+
+From 8280294e74846ea342389a0cd17215050fa5afe8 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:12:24 +0300
+Subject: [PATCH 3/8] Extend protection of GTK/IGTK reinstallation of WNM-Sleep
+ Mode cases
+
+This extends the protection to track last configured GTK/IGTK value
+separately from EAPOL-Key frames and WNM-Sleep Mode frames to cover a
+corner case where these two different mechanisms may get used when the
+GTK/IGTK has changed and tracking a single value is not sufficient to
+detect a possible key reconfiguration.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c | 53 +++++++++++++++++++++++++++++++++++++---------------
+ src/rsn_supp/wpa_i.h | 2 ++
+ 2 files changed, 40 insertions(+), 15 deletions(-)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 95bd7be..7a2c68d 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -709,14 +709,17 @@ struct wpa_gtk_data {
+
+ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ const struct wpa_gtk_data *gd,
+- const u8 *key_rsc)
++ const u8 *key_rsc, int wnm_sleep)
+ {
+ const u8 *_gtk = gd->gtk;
+ u8 gtk_buf[32];
+
+ /* Detect possible key reinstallation */
+- if (sm->gtk.gtk_len == (size_t) gd->gtk_len &&
+- os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) {
++ if ((sm->gtk.gtk_len == (size_t) gd->gtk_len &&
++ os_memcmp(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len) == 0) ||
++ (sm->gtk_wnm_sleep.gtk_len == (size_t) gd->gtk_len &&
++ os_memcmp(sm->gtk_wnm_sleep.gtk, gd->gtk,
++ sm->gtk_wnm_sleep.gtk_len) == 0)) {
+ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)",
+ gd->keyidx, gd->tx, gd->gtk_len);
+@@ -757,8 +760,14 @@ static int wpa_supplicant_install_gtk(struct wpa_sm *sm,
+ }
+ os_memset(gtk_buf, 0, sizeof(gtk_buf));
+
+- sm->gtk.gtk_len = gd->gtk_len;
+- os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++ if (wnm_sleep) {
++ sm->gtk_wnm_sleep.gtk_len = gd->gtk_len;
++ os_memcpy(sm->gtk_wnm_sleep.gtk, gd->gtk,
++ sm->gtk_wnm_sleep.gtk_len);
++ } else {
++ sm->gtk.gtk_len = gd->gtk_len;
++ os_memcpy(sm->gtk.gtk, gd->gtk, sm->gtk.gtk_len);
++ }
+
+ return 0;
+ }
+@@ -852,7 +861,7 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+ (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
+ gtk_len, gtk_len,
+ &gd.key_rsc_len, &gd.alg) ||
+- wpa_supplicant_install_gtk(sm, &gd, key_rsc))) {
++ wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0))) {
+ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ "RSN: Failed to install GTK");
+ os_memset(&gd, 0, sizeof(gd));
+@@ -868,14 +877,18 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
+
+ #ifdef CONFIG_IEEE80211W
+ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+- const struct wpa_igtk_kde *igtk)
++ const struct wpa_igtk_kde *igtk,
++ int wnm_sleep)
+ {
+ size_t len = wpa_cipher_key_len(sm->mgmt_group_cipher);
+ u16 keyidx = WPA_GET_LE16(igtk->keyid);
+
+ /* Detect possible key reinstallation */
+- if (sm->igtk.igtk_len == len &&
+- os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) {
++ if ((sm->igtk.igtk_len == len &&
++ os_memcmp(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len) == 0) ||
++ (sm->igtk_wnm_sleep.igtk_len == len &&
++ os_memcmp(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++ sm->igtk_wnm_sleep.igtk_len) == 0)) {
+ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)",
+ keyidx);
+@@ -900,8 +913,14 @@ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
+ return -1;
+ }
+
+- sm->igtk.igtk_len = len;
+- os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++ if (wnm_sleep) {
++ sm->igtk_wnm_sleep.igtk_len = len;
++ os_memcpy(sm->igtk_wnm_sleep.igtk, igtk->igtk,
++ sm->igtk_wnm_sleep.igtk_len);
++ } else {
++ sm->igtk.igtk_len = len;
++ os_memcpy(sm->igtk.igtk, igtk->igtk, sm->igtk.igtk_len);
++ }
+
+ return 0;
+ }
+@@ -924,7 +943,7 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
+ return -1;
+
+ igtk = (const struct wpa_igtk_kde *) ie->igtk;
+- if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++ if (wpa_supplicant_install_igtk(sm, igtk, 0) < 0)
+ return -1;
+ }
+
+@@ -1574,7 +1593,7 @@ static void wpa_supplicant_process_1_of_2(struct wpa_sm *sm,
+ if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc))
+ key_rsc = null_rsc;
+
+- if (wpa_supplicant_install_gtk(sm, &gd, key_rsc) ||
++ if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 0) ||
+ wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0)
+ goto failed;
+ os_memset(&gd, 0, sizeof(gd));
+@@ -2386,8 +2405,10 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
+ sm->tptk_set = 0;
+ os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++ os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++ os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ }
+
+@@ -2920,8 +2941,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
+ os_memset(&sm->ptk, 0, sizeof(sm->ptk));
+ os_memset(&sm->tptk, 0, sizeof(sm->tptk));
+ os_memset(&sm->gtk, 0, sizeof(sm->gtk));
++ os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
+ #ifdef CONFIG_IEEE80211W
+ os_memset(&sm->igtk, 0, sizeof(sm->igtk));
++ os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
+ #endif /* CONFIG_IEEE80211W */
+ #ifdef CONFIG_IEEE80211R
+ os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
+@@ -2986,7 +3009,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+
+ wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)",
+ gd.gtk, gd.gtk_len);
+- if (wpa_supplicant_install_gtk(sm, &gd, key_rsc)) {
++ if (wpa_supplicant_install_gtk(sm, &gd, key_rsc, 1)) {
+ os_memset(&gd, 0, sizeof(gd));
+ wpa_printf(MSG_DEBUG, "Failed to install the GTK in "
+ "WNM mode");
+@@ -2998,7 +3021,7 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
+ const struct wpa_igtk_kde *igtk;
+
+ igtk = (const struct wpa_igtk_kde *) (buf + 2);
+- if (wpa_supplicant_install_igtk(sm, igtk) < 0)
++ if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
+ return -1;
+ #endif /* CONFIG_IEEE80211W */
+ } else {
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index afc9e37..9a54631 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -32,8 +32,10 @@ struct wpa_sm {
+ int rx_replay_counter_set;
+ u8 request_counter[WPA_REPLAY_COUNTER_LEN];
+ struct wpa_gtk gtk;
++ struct wpa_gtk gtk_wnm_sleep;
+ #ifdef CONFIG_IEEE80211W
+ struct wpa_igtk igtk;
++ struct wpa_igtk igtk_wnm_sleep;
+ #endif /* CONFIG_IEEE80211W */
+
+ struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
+--
+2.7.4
+
+From 8f82bc94e8697a9d47fa8774dfdaaede1084912c Mon Sep 17 00:00:00 2001
+From: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+Date: Fri, 29 Sep 2017 04:22:51 +0200
+Subject: [PATCH 4/8] Prevent installation of an all-zero TK
+
+Properly track whether a PTK has already been installed to the driver
+and the TK part cleared from memory. This prevents an attacker from
+trying to trick the client into installing an all-zero TK.
+
+This fixes the earlier fix in commit
+ad00d64e7d8827b3cebd665a0ceb08adabf15e1e ('Fix TK configuration to the
+driver in EAPOL-Key 3/4 retry case') which did not take into account
+possibility of an extra message 1/4 showing up between retries of
+message 3/4.
+
+Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
+---
+ src/common/wpa_common.h | 1 +
+ src/rsn_supp/wpa.c | 5 ++---
+ src/rsn_supp/wpa_i.h | 1 -
+ 3 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
+index d200285..1021ccb 100644
+--- a/src/common/wpa_common.h
++++ b/src/common/wpa_common.h
+@@ -215,6 +215,7 @@ struct wpa_ptk {
+ size_t kck_len;
+ size_t kek_len;
+ size_t tk_len;
++ int installed; /* 1 if key has already been installed to driver */
+ };
+
+ struct wpa_gtk {
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 7a2c68d..0550a41 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -510,7 +510,6 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
+ os_memset(buf, 0, sizeof(buf));
+ }
+ sm->tptk_set = 1;
+- sm->tk_to_set = 1;
+
+ kde = sm->assoc_wpa_ie;
+ kde_len = sm->assoc_wpa_ie_len;
+@@ -615,7 +614,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+ enum wpa_alg alg;
+ const u8 *key_rsc;
+
+- if (!sm->tk_to_set) {
++ if (sm->ptk.installed) {
+ wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
+ "WPA: Do not re-install same PTK to the driver");
+ return 0;
+@@ -659,7 +658,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
+
+ /* TK is not needed anymore in supplicant */
+ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
+- sm->tk_to_set = 0;
++ sm->ptk.installed = 1;
+
+ if (sm->wpa_ptk_rekey) {
+ eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL);
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 9a54631..41f371f 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -24,7 +24,6 @@ struct wpa_sm {
+ struct wpa_ptk ptk, tptk;
+ int ptk_set, tptk_set;
+ unsigned int msg_3_of_4_ok:1;
+- unsigned int tk_to_set:1;
+ u8 snonce[WPA_NONCE_LEN];
+ u8 anonce[WPA_NONCE_LEN]; /* ANonce from the last 1/4 msg */
+ int renew_snonce;
+--
+2.7.4
+
+From 12fac09b437a1dc8a0f253e265934a8aaf4d2f8b Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sun, 1 Oct 2017 12:32:57 +0300
+Subject: [PATCH 5/8] Fix PTK rekeying to generate a new ANonce
+
+The Authenticator state machine path for PTK rekeying ended up bypassing
+the AUTHENTICATION2 state where a new ANonce is generated when going
+directly to the PTKSTART state since there is no need to try to
+determine the PMK again in such a case. This is far from ideal since the
+new PTK would depend on a new nonce only from the supplicant.
+
+Fix this by generating a new ANonce when moving to the PTKSTART state
+for the purpose of starting new 4-way handshake to rekey PTK.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/ap/wpa_auth.c | 24 +++++++++++++++++++++---
+ 1 file changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
+index 707971d..bf10cc1 100644
+--- a/src/ap/wpa_auth.c
++++ b/src/ap/wpa_auth.c
+@@ -1901,6 +1901,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2)
+ }
+
+
++static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm)
++{
++ if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) {
++ wpa_printf(MSG_ERROR,
++ "WPA: Failed to get random data for ANonce");
++ sm->Disconnect = TRUE;
++ return -1;
++ }
++ wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce,
++ WPA_NONCE_LEN);
++ sm->TimeoutCtr = 0;
++ return 0;
++}
++
++
+ SM_STATE(WPA_PTK, INITPMK)
+ {
+ u8 msk[2 * PMK_LEN];
+@@ -2458,9 +2473,12 @@ SM_STEP(WPA_PTK)
+ SM_ENTER(WPA_PTK, AUTHENTICATION);
+ else if (sm->ReAuthenticationRequest)
+ SM_ENTER(WPA_PTK, AUTHENTICATION2);
+- else if (sm->PTKRequest)
+- SM_ENTER(WPA_PTK, PTKSTART);
+- else switch (sm->wpa_ptk_state) {
++ else if (sm->PTKRequest) {
++ if (wpa_auth_sm_ptk_update(sm) < 0)
++ SM_ENTER(WPA_PTK, DISCONNECTED);
++ else
++ SM_ENTER(WPA_PTK, PTKSTART);
++ } else switch (sm->wpa_ptk_state) {
+ case WPA_PTK_INITIALIZE:
+ break;
+ case WPA_PTK_DISCONNECT:
+--
+2.7.4
+
+From 6c4bed4f47d1960ec04981a9d50e5076aea5223d Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 11:03:15 +0300
+Subject: [PATCH 6/8] TDLS: Reject TPK-TK reconfiguration
+
+Do not try to reconfigure the same TPK-TK to the driver after it has
+been successfully configured. This is an explicit check to avoid issues
+related to resetting the TX/RX packet number. There was already a check
+for this for TPK M2 (retries of that message are ignored completely), so
+that behavior does not get modified.
+
+For TPK M3, the TPK-TK could have been reconfigured, but that was
+followed by immediate teardown of the link due to an issue in updating
+the STA entry. Furthermore, for TDLS with any real security (i.e.,
+ignoring open/WEP), the TPK message exchange is protected on the AP path
+and simple replay attacks are not feasible.
+
+As an additional corner case, make sure the local nonce gets updated if
+the peer uses a very unlikely "random nonce" of all zeros.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/tdls.c | 38 ++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
+index e424168..9eb9738 100644
+--- a/src/rsn_supp/tdls.c
++++ b/src/rsn_supp/tdls.c
+@@ -112,6 +112,7 @@ struct wpa_tdls_peer {
+ u8 tk[16]; /* TPK-TK; assuming only CCMP will be used */
+ } tpk;
+ int tpk_set;
++ int tk_set; /* TPK-TK configured to the driver */
+ int tpk_success;
+ int tpk_in_progress;
+
+@@ -192,6 +193,20 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ u8 rsc[6];
+ enum wpa_alg alg;
+
++ if (peer->tk_set) {
++ /*
++ * This same TPK-TK has already been configured to the driver
++ * and this new configuration attempt (likely due to an
++ * unexpected retransmitted frame) would result in clearing
++ * the TX/RX sequence number which can break security, so must
++ * not allow that to happen.
++ */
++ wpa_printf(MSG_INFO, "TDLS: TPK-TK for the peer " MACSTR
++ " has already been configured to the driver - do not reconfigure",
++ MAC2STR(peer->addr));
++ return -1;
++ }
++
+ os_memset(rsc, 0, 6);
+
+ switch (peer->cipher) {
+@@ -209,12 +224,15 @@ static int wpa_tdls_set_key(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ return -1;
+ }
+
++ wpa_printf(MSG_DEBUG, "TDLS: Configure pairwise key for peer " MACSTR,
++ MAC2STR(peer->addr));
+ if (wpa_sm_set_key(sm, alg, peer->addr, -1, 1,
+ rsc, sizeof(rsc), peer->tpk.tk, key_len) < 0) {
+ wpa_printf(MSG_WARNING, "TDLS: Failed to set TPK to the "
+ "driver");
+ return -1;
+ }
++ peer->tk_set = 1;
+ return 0;
+ }
+
+@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
+ peer->cipher = 0;
+ peer->qos_info = 0;
+ peer->wmm_capable = 0;
+- peer->tpk_set = peer->tpk_success = 0;
++ peer->tk_set = peer->tpk_set = peer->tpk_success = 0;
+ peer->chan_switch_enabled = 0;
+ os_memset(&peer->tpk, 0, sizeof(peer->tpk));
+ os_memset(peer->inonce, 0, WPA_NONCE_LEN);
+@@ -1159,6 +1177,7 @@ skip_rsnie:
+ wpa_tdls_peer_free(sm, peer);
+ return -1;
+ }
++ peer->tk_set = 0; /* A new nonce results in a new TK */
+ wpa_hexdump(MSG_DEBUG, "TDLS: Initiator Nonce for TPK handshake",
+ peer->inonce, WPA_NONCE_LEN);
+ os_memcpy(ftie->Snonce, peer->inonce, WPA_NONCE_LEN);
+@@ -1751,6 +1770,19 @@ static int wpa_tdls_addset_peer(struct wpa_sm *sm, struct wpa_tdls_peer *peer,
+ }
+
+
++static int tdls_nonce_set(const u8 *nonce)
++{
++ int i;
++
++ for (i = 0; i < WPA_NONCE_LEN; i++) {
++ if (nonce[i])
++ return 1;
++ }
++
++ return 0;
++}
++
++
+ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
+ const u8 *buf, size_t len)
+ {
+@@ -2004,7 +2036,8 @@ skip_rsn:
+ peer->rsnie_i_len = kde.rsn_ie_len;
+ peer->cipher = cipher;
+
+- if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0) {
++ if (os_memcmp(peer->inonce, ftie->Snonce, WPA_NONCE_LEN) != 0 ||
++ !tdls_nonce_set(peer->inonce)) {
+ /*
+ * There is no point in updating the RNonce for every obtained
+ * TPK M1 frame (e.g., retransmission due to timeout) with the
+@@ -2020,6 +2053,7 @@ skip_rsn:
+ "TDLS: Failed to get random data for responder nonce");
+ goto error;
+ }
++ peer->tk_set = 0; /* A new nonce results in a new TK */
+ }
+
+ #if 0
+--
+2.7.4
+
+From 53c5eb58e95004f86e65ee9fbfccbc291b139057 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 11:25:02 +0300
+Subject: [PATCH 7/8] WNM: Ignore WNM-Sleep Mode Response without pending
+ request
+
+Commit 03ed0a52393710be6bdae657d1b36efa146520e5 ('WNM: Ignore WNM-Sleep
+Mode Response if WNM-Sleep Mode has not been used') started ignoring the
+response when no WNM-Sleep Mode Request had been used during the
+association. This can be made tighter by clearing the used flag when
+successfully processing a response. This adds an additional layer of
+protection against unexpected retransmissions of the response frame.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ wpa_supplicant/wnm_sta.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c
+index 1b3409c..67a07ff 100644
+--- a/wpa_supplicant/wnm_sta.c
++++ b/wpa_supplicant/wnm_sta.c
+@@ -260,7 +260,7 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
+
+ if (!wpa_s->wnmsleep_used) {
+ wpa_printf(MSG_DEBUG,
+- "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode has not been used in this association");
++ "WNM: Ignore WNM-Sleep Mode Response frame since WNM-Sleep Mode operation has not been requested");
+ return;
+ }
+
+@@ -299,6 +299,8 @@ static void ieee802_11_rx_wnmsleep_resp(struct wpa_supplicant *wpa_s,
+ return;
+ }
+
++ wpa_s->wnmsleep_used = 0;
++
+ if (wnmsleep_ie->status == WNM_STATUS_SLEEP_ACCEPT ||
+ wnmsleep_ie->status == WNM_STATUS_SLEEP_EXIT_ACCEPT_GTK_UPDATE) {
+ wpa_printf(MSG_DEBUG, "Successfully recv WNM-Sleep Response "
+--
+2.7.4
+
+From b372ab0b7daea719749194dc554b26e6367603f2 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 22 Sep 2017 12:06:37 +0300
+Subject: [PATCH 8/8] FT: Do not allow multiple Reassociation Response frames
+
+The driver is expected to not report a second association event without
+the station having explicitly request a new association. As such, this
+case should not be reachable. However, since reconfiguring the same
+pairwise or group keys to the driver could result in nonce reuse issues,
+be extra careful here and do an additional state check to avoid this
+even if the local driver ends up somehow accepting an unexpected
+Reassociation Response frame.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/rsn_supp/wpa.c | 3 +++
+ src/rsn_supp/wpa_ft.c | 8 ++++++++
+ src/rsn_supp/wpa_i.h | 1 +
+ 3 files changed, 12 insertions(+)
+
+diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
+index 0550a41..2a53c6f 100644
+--- a/src/rsn_supp/wpa.c
++++ b/src/rsn_supp/wpa.c
+@@ -2440,6 +2440,9 @@ void wpa_sm_notify_disassoc(struct wpa_sm *sm)
+ #ifdef CONFIG_TDLS
+ wpa_tdls_disassoc(sm);
+ #endif /* CONFIG_TDLS */
++#ifdef CONFIG_IEEE80211R
++ sm->ft_reassoc_completed = 0;
++#endif /* CONFIG_IEEE80211R */
+
+ /* Keys are not needed in the WPA state machine anymore */
+ wpa_sm_drop_sa(sm);
+diff --git a/src/rsn_supp/wpa_ft.c b/src/rsn_supp/wpa_ft.c
+index 205793e..d45bb45 100644
+--- a/src/rsn_supp/wpa_ft.c
++++ b/src/rsn_supp/wpa_ft.c
+@@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
+ u16 capab;
+
+ sm->ft_completed = 0;
++ sm->ft_reassoc_completed = 0;
+
+ buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
+ 2 + sm->r0kh_id_len + ric_ies_len + 100;
+@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ return -1;
+ }
+
++ if (sm->ft_reassoc_completed) {
++ wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
++ return 0;
++ }
++
+ if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
+ wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
+ return -1;
+@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
+ return -1;
+ }
+
++ sm->ft_reassoc_completed = 1;
++
+ if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
+ return -1;
+
+diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
+index 41f371f..56f88dc 100644
+--- a/src/rsn_supp/wpa_i.h
++++ b/src/rsn_supp/wpa_i.h
+@@ -128,6 +128,7 @@ struct wpa_sm {
+ size_t r0kh_id_len;
+ u8 r1kh_id[FT_R1KH_ID_LEN];
+ int ft_completed;
++ int ft_reassoc_completed;
+ int over_the_ds_in_progress;
+ u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
+ int set_ptk_after_assoc;
+--
+2.7.4
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
new file mode 100644
index 000000000..35a1aa639
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+
+WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
+WPA_SUP_PNAME="wpa_supplicant"
+WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
+WPA_COMMON_CTRL_IFACE="/var/run/wpa_supplicant"
+WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"
+
+VERBOSITY=0
+
+
+if [ -s "$IF_WPA_CONF" ]; then
+ WPA_SUP_CONF="-c $IF_WPA_CONF"
+else
+ exit 0
+fi
+
+if [ ! -x "$WPA_SUP_BIN" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
+ fi
+
+ exit 1
+fi
+
+if [ "$MODE" = "start" ] ; then
+ # driver type of interface, defaults to wext when undefined
+ if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
+ IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
+ elif [ -z "$IF_WPA_DRIVER" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
+ fi
+
+ IF_WPA_DRIVER="wext"
+ fi
+
+ # if we have passed the criteria, start wpa_supplicant
+ if [ -n "$WPA_SUP_CONF" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
+ fi
+
+ start-stop-daemon --start --quiet \
+ --name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
+ -- $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
+ fi
+
+ # if the interface socket exists, then wpa_supplicant was invoked successfully
+ if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
+ fi
+
+ exit 0
+
+ fi
+
+elif [ "$MODE" = "stop" ]; then
+
+ if [ -f "$WPA_SUP_PIDFILE" ]; then
+
+ if [ "$VERBOSITY" = "1" ]; then
+ echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
+ fi
+
+ start-stop-daemon --stop --quiet \
+ --name $WPA_SUP_PNAME --pidfile $WPA_SUP_PIDFILE
+
+ if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+ rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
+ fi
+
+ if [ -f "$WPA_SUP_PIDFILE" ]; then
+ rm -f $WPA_SUP_PIDFILE
+ fi
+ fi
+
+fi
+
+exit 0
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf
new file mode 100644
index 000000000..68258f5ee
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf
@@ -0,0 +1,690 @@
+##### Example wpa_supplicant configuration file ###############################
+#
+# This file describes configuration file format and lists all available option.
+# Please also take a look at simpler configuration examples in 'examples'
+# subdirectory.
+#
+# Empty lines and lines starting with # are ignored
+
+# NOTE! This file may contain password information and should probably be made
+# readable only by root user on multiuser systems.
+
+# Note: All file paths in this configuration file should use full (absolute,
+# not relative to working directory) path in order to allow working directory
+# to be changed. This can happen if wpa_supplicant is run in the background.
+
+# Whether to allow wpa_supplicant to update (overwrite) configuration
+#
+# This option can be used to allow wpa_supplicant to overwrite configuration
+# file whenever configuration is changed (e.g., new network block is added with
+# wpa_cli or wpa_gui, or a password is changed). This is required for
+# wpa_cli/wpa_gui to be able to store the configuration changes permanently.
+# Please note that overwriting configuration file will remove the comments from
+# it.
+#update_config=1
+
+# global configuration (shared by all network blocks)
+#
+# Parameters for the control interface. If this is specified, wpa_supplicant
+# will open a control interface that is available for external programs to
+# manage wpa_supplicant. The meaning of this string depends on which control
+# interface mechanism is used. For all cases, the existence of this parameter
+# in configuration is used to determine whether the control interface is
+# enabled.
+#
+# For UNIX domain sockets (default on Linux and BSD): This is a directory that
+# will be created for UNIX domain sockets for listening to requests from
+# external programs (CLI/GUI, etc.) for status information and configuration.
+# The socket file will be named based on the interface name, so multiple
+# wpa_supplicant processes can be run at the same time if more than one
+# interface is used.
+# /var/run/wpa_supplicant is the recommended directory for sockets and by
+# default, wpa_cli will use it when trying to connect with wpa_supplicant.
+#
+# Access control for the control interface can be configured by setting the
+# directory to allow only members of a group to use sockets. This way, it is
+# possible to run wpa_supplicant as root (since it needs to change network
+# configuration and open raw sockets) and still allow GUI/CLI components to be
+# run as non-root users. However, since the control interface can be used to
+# change the network configuration, this access needs to be protected in many
+# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you
+# want to allow non-root users to use the control interface, add a new group
+# and change this value to match with that group. Add users that should have
+# control interface access to this group. If this variable is commented out or
+# not included in the configuration file, group will not be changed from the
+# value it got by default when the directory or socket was created.
+#
+# When configuring both the directory and group, use following format:
+# DIR=/var/run/wpa_supplicant GROUP=wheel
+# DIR=/var/run/wpa_supplicant GROUP=0
+# (group can be either group name or gid)
+#
+# For UDP connections (default on Windows): The value will be ignored. This
+# variable is just used to select that the control interface is to be created.
+# The value can be set to, e.g., udp (ctrl_interface=udp)
+#
+# For Windows Named Pipe: This value can be used to set the security descriptor
+# for controlling access to the control interface. Security descriptor can be
+# set using Security Descriptor String Format (see http://msdn.microsoft.com/
+# library/default.asp?url=/library/en-us/secauthz/security/
+# security_descriptor_string_format.asp). The descriptor string needs to be
+# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty
+# DACL (which will reject all connections). See README-Windows.txt for more
+# information about SDDL string format.
+#
+ctrl_interface=/var/run/wpa_supplicant
+
+# IEEE 802.1X/EAPOL version
+# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines
+# EAPOL version 2. However, there are many APs that do not handle the new
+# version number correctly (they seem to drop the frames completely). In order
+# to make wpa_supplicant interoperate with these APs, the version number is set
+# to 1 by default. This configuration value can be used to set it to the new
+# version (2).
+eapol_version=1
+
+# AP scanning/selection
+# By default, wpa_supplicant requests driver to perform AP scanning and then
+# uses the scan results to select a suitable AP. Another alternative is to
+# allow the driver to take care of AP scanning and selection and use
+# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
+# information from the driver.
+# 1: wpa_supplicant initiates scanning and AP selection
+# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
+# parameters (e.g., WPA IE generation); this mode can also be used with
+# non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
+# APs (i.e., external program needs to control association). This mode must
+# also be used when using wired Ethernet drivers.
+# 2: like 0, but associate with APs using security policy and SSID (but not
+# BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to
+# enable operation with hidden SSIDs and optimized roaming; in this mode,
+# the network blocks in the configuration file are tried one by one until
+# the driver reports successful association; each network block should have
+# explicit security policy (i.e., only one option in the lists) for
+# key_mgmt, pairwise, group, proto variables
+ap_scan=1
+
+# EAP fast re-authentication
+# By default, fast re-authentication is enabled for all EAP methods that
+# support it. This variable can be used to disable fast re-authentication.
+# Normally, there is no need to disable this.
+fast_reauth=1
+
+# OpenSSL Engine support
+# These options can be used to load OpenSSL engines.
+# The two engines that are supported currently are shown below:
+# They are both from the opensc project (http://www.opensc.org/)
+# By default no engines are loaded.
+# make the opensc engine available
+#opensc_engine_path=/usr/lib/opensc/engine_opensc.so
+# make the pkcs11 engine available
+#pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
+# configure the path to the pkcs11 module required by the pkcs11 engine
+#pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
+
+# Dynamic EAP methods
+# If EAP methods were built dynamically as shared object files, they need to be
+# loaded here before being used in the network blocks. By default, EAP methods
+# are included statically in the build, so these lines are not needed
+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so
+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so
+
+# Driver interface parameters
+# This field can be used to configure arbitrary driver interace parameters. The
+# format is specific to the selected driver interface. This field is not used
+# in most cases.
+#driver_param="field=value"
+
+# Maximum lifetime for PMKSA in seconds; default 43200
+#dot11RSNAConfigPMKLifetime=43200
+# Threshold for reauthentication (percentage of PMK lifetime); default 70
+#dot11RSNAConfigPMKReauthThreshold=70
+# Timeout for security association negotiation in seconds; default 60
+#dot11RSNAConfigSATimeout=60
+
+# network block
+#
+# Each network (usually AP's sharing the same SSID) is configured as a separate
+# block in this configuration file. The network blocks are in preference order
+# (the first match is used).
+#
+# network block fields:
+#
+# disabled:
+# 0 = this network can be used (default)
+# 1 = this network block is disabled (can be enabled through ctrl_iface,
+# e.g., with wpa_cli or wpa_gui)
+#
+# id_str: Network identifier string for external scripts. This value is passed
+# to external action script through wpa_cli as WPA_ID_STR environment
+# variable to make it easier to do network specific configuration.
+#
+# ssid: SSID (mandatory); either as an ASCII string with double quotation or
+# as hex string; network name
+#
+# scan_ssid:
+# 0 = do not scan this SSID with specific Probe Request frames (default)
+# 1 = scan with SSID-specific Probe Request frames (this can be used to
+# find APs that do not accept broadcast SSID or use multiple SSIDs;
+# this will add latency to scanning, so enable this only when needed)
+#
+# bssid: BSSID (optional); if set, this network block is used only when
+# associating with the AP using the configured BSSID
+#
+# priority: priority group (integer)
+# By default, all networks will get same priority group (0). If some of the
+# networks are more desirable, this field can be used to change the order in
+# which wpa_supplicant goes through the networks when selecting a BSS. The
+# priority groups will be iterated in decreasing priority (i.e., the larger the
+# priority value, the sooner the network is matched against the scan results).
+# Within each priority group, networks will be selected based on security
+# policy, signal strength, etc.
+# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not
+# using this priority to select the order for scanning. Instead, they try the
+# networks in the order that used in the configuration file.
+#
+# mode: IEEE 802.11 operation mode
+# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default)
+# 1 = IBSS (ad-hoc, peer-to-peer)
+# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP)
+# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has
+# to be set to 2 for IBSS. WPA-None requires following network block options:
+# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not
+# both), and psk must also be set.
+#
+# proto: list of accepted protocols
+# WPA = WPA/IEEE 802.11i/D3.0
+# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
+# If not set, this defaults to: WPA RSN
+#
+# key_mgmt: list of accepted authenticated key management protocols
+# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
+# WPA-EAP = WPA using EAP authentication (this can use an external
+# program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication
+# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically
+# generated WEP keys
+# NONE = WPA is not used; plaintext or static WEP could be used
+# If not set, this defaults to: WPA-PSK WPA-EAP
+#
+# auth_alg: list of allowed IEEE 802.11 authentication algorithms
+# OPEN = Open System authentication (required for WPA/WPA2)
+# SHARED = Shared Key authentication (requires static WEP keys)
+# LEAP = LEAP/Network EAP (only used with LEAP)
+# If not set, automatic selection is used (Open System with LEAP enabled if
+# LEAP is allowed as one of the EAP methods).
+#
+# pairwise: list of accepted pairwise (unicast) ciphers for WPA
+# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
+# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
+# NONE = Use only Group Keys (deprecated, should not be included if APs support
+# pairwise keys)
+# If not set, this defaults to: CCMP TKIP
+#
+# group: list of accepted group (broadcast/multicast) ciphers for WPA
+# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
+# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
+# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
+# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11]
+# If not set, this defaults to: CCMP TKIP WEP104 WEP40
+#
+# psk: WPA preshared key; 256-bit pre-shared key
+# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e.,
+# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be
+# generated using the passphrase and SSID). ASCII passphrase must be between
+# 8 and 63 characters (inclusive).
+# This field is not needed, if WPA-EAP is used.
+# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys
+# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant
+# startup and reconfiguration time can be optimized by generating the PSK only
+# only when the passphrase or SSID has actually changed.
+#
+# eapol_flags: IEEE 802.1X/EAPOL options (bit field)
+# Dynamic WEP key required for non-WPA mode
+# bit0 (1): require dynamically generated unicast WEP key
+# bit1 (2): require dynamically generated broadcast WEP key
+# (3 = require both keys; default)
+# Note: When using wired authentication, eapol_flags must be set to 0 for the
+# authentication to be completed successfully.
+#
+# proactive_key_caching:
+# Enable/disable opportunistic PMKSA caching for WPA2.
+# 0 = disabled (default)
+# 1 = enabled
+#
+# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or
+# hex without quotation, e.g., 0102030405)
+# wep_tx_keyidx: Default WEP key index (TX) (0..3)
+#
+# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is
+# allowed. This is only used with RSN/WPA2.
+# 0 = disabled (default)
+# 1 = enabled
+#peerkey=1
+#
+# Following fields are only used with internal EAP implementation.
+# eap: space-separated list of accepted EAP methods
+# MD5 = EAP-MD5 (unsecure and does not generate keying material ->
+# cannot be used with WPA; to be used as a Phase 2 method
+# with EAP-PEAP or EAP-TTLS)
+# MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used
+# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+# OTP = EAP-OTP (cannot be used separately with WPA; to be used
+# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+# GTC = EAP-GTC (cannot be used separately with WPA; to be used
+# as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+# TLS = EAP-TLS (client and server certificate)
+# PEAP = EAP-PEAP (with tunnelled EAP authentication)
+# TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2
+# authentication)
+# If not set, all compiled in methods are allowed.
+#
+# identity: Identity string for EAP
+# anonymous_identity: Anonymous identity string for EAP (to be used as the
+# unencrypted identity with EAP types that support different tunnelled
+# identity, e.g., EAP-TTLS)
+# password: Password string for EAP
+# ca_cert: File path to CA certificate file (PEM/DER). This file can have one
+# or more trusted CA certificates. If ca_cert and ca_path are not
+# included, server certificate will not be verified. This is insecure and
+# a trusted CA certificate should always be configured when using
+# EAP-TLS/TTLS/PEAP. Full path should be used since working directory may
+# change when wpa_supplicant is run in the background.
+# On Windows, trusted CA certificates can be loaded from the system
+# certificate store by setting this to cert_store://<name>, e.g.,
+# ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
+# Note that when running wpa_supplicant as an application, the user
+# certificate store (My user account) is used, whereas computer store
+# (Computer account) is used when running wpasvc as a service.
+# ca_path: Directory path for CA certificate files (PEM). This path may
+# contain multiple CA certificates in OpenSSL format. Common use for this
+# is to point to system trusted CA list which is often installed into
+# directory like /etc/ssl/certs. If configured, these certificates are
+# added to the list of trusted CAs. ca_cert may also be included in that
+# case, but it is not required.
+# client_cert: File path to client certificate file (PEM/DER)
+# Full path should be used since working directory may change when
+# wpa_supplicant is run in the background.
+# Alternatively, a named configuration blob can be used by setting this
+# to blob://<blob name>.
+# private_key: File path to client private key file (PEM/DER/PFX)
+# When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
+# commented out. Both the private key and certificate will be read from
+# the PKCS#12 file in this case. Full path should be used since working
+# directory may change when wpa_supplicant is run in the background.
+# Windows certificate store can be used by leaving client_cert out and
+# configuring private_key in one of the following formats:
+# cert://substring_to_match
+# hash://certificate_thumbprint_in_hex
+# for example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
+# Note that when running wpa_supplicant as an application, the user
+# certificate store (My user account) is used, whereas computer store
+# (Computer account) is used when running wpasvc as a service.
+# Alternatively, a named configuration blob can be used by setting this
+# to blob://<blob name>.
+# private_key_passwd: Password for private key file (if left out, this will be
+# asked through control interface)
+# dh_file: File path to DH/DSA parameters file (in PEM format)
+# This is an optional configuration file for setting parameters for an
+# ephemeral DH key exchange. In most cases, the default RSA
+# authentication does not use this configuration. However, it is possible
+# setup RSA to use ephemeral DH key exchange. In addition, ciphers with
+# DSA keys always use ephemeral DH keys. This can be used to achieve
+# forward secrecy. If the file is in DSA parameters format, it will be
+# automatically converted into DH params.
+# subject_match: Substring to be matched against the subject of the
+# authentication server certificate. If this string is set, the server
+# sertificate is only accepted if it contains this string in the subject.
+# The subject string is in following format:
+# /C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com
+# altsubject_match: Semicolon separated string of entries to be matched against
+# the alternative subject name of the authentication server certificate.
+# If this string is set, the server sertificate is only accepted if it
+# contains one of the entries in an alternative subject name extension.
+# altSubjectName string is in following format: TYPE:VALUE
+# Example: EMAIL:server@example.com
+# Example: DNS:server.example.com;DNS:server2.example.com
+# Following types are supported: EMAIL, DNS, URI
+# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters
+# (string with field-value pairs, e.g., "peapver=0" or
+# "peapver=1 peaplabel=1")
+# 'peapver' can be used to force which PEAP version (0 or 1) is used.
+# 'peaplabel=1' can be used to force new label, "client PEAP encryption",
+# to be used during key derivation when PEAPv1 or newer. Most existing
+# PEAPv1 implementation seem to be using the old label, "client EAP
+# encryption", and wpa_supplicant is now using that as the default value.
+# Some servers, e.g., Radiator, may require peaplabel=1 configuration to
+# interoperate with PEAPv1; see eap_testing.txt for more details.
+# 'peap_outer_success=0' can be used to terminate PEAP authentication on
+# tunneled EAP-Success. This is required with some RADIUS servers that
+# implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
+# Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode)
+# include_tls_length=1 can be used to force wpa_supplicant to include
+# TLS Message Length field in all TLS messages even if they are not
+# fragmented.
+# sim_min_num_chal=3 can be used to configure EAP-SIM to require three
+# challenges (by default, it accepts 2 or 3)
+# phase2: Phase2 (inner authentication with TLS tunnel) parameters
+# (string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
+# "autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS)
+# Following certificate/private key fields are used in inner Phase2
+# authentication when using EAP-TTLS or EAP-PEAP.
+# ca_cert2: File path to CA certificate file. This file can have one or more
+# trusted CA certificates. If ca_cert2 and ca_path2 are not included,
+# server certificate will not be verified. This is insecure and a trusted
+# CA certificate should always be configured.
+# ca_path2: Directory path for CA certificate files (PEM)
+# client_cert2: File path to client certificate file
+# private_key2: File path to client private key file
+# private_key2_passwd: Password for private key file
+# dh_file2: File path to DH/DSA parameters file (in PEM format)
+# subject_match2: Substring to be matched against the subject of the
+# authentication server certificate.
+# altsubject_match2: Substring to be matched against the alternative subject
+# name of the authentication server certificate.
+#
+# fragment_size: Maximum EAP fragment size in bytes (default 1398).
+# This value limits the fragment size for EAP methods that support
+# fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
+# small enough to make the EAP messages fit in MTU of the network
+# interface used for EAPOL. The default value is suitable for most
+# cases.
+#
+# EAP-PSK variables:
+# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
+# nai: user NAI
+#
+# EAP-PAX variables:
+# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
+#
+# EAP-SAKE variables:
+# eappsk: 32-byte (256-bit, 64 hex digits) pre-shared key in hex format
+# (this is concatenation of Root-Secret-A and Root-Secret-B)
+# nai: user NAI (PEERID)
+#
+# EAP-GPSK variables:
+# eappsk: Pre-shared key in hex format (at least 128 bits, i.e., 32 hex digits)
+# nai: user NAI (ID_Client)
+#
+# EAP-FAST variables:
+# pac_file: File path for the PAC entries. wpa_supplicant will need to be able
+# to create this file and write updates to it when PAC is being
+# provisioned or refreshed. Full path to the file should be used since
+# working directory may change when wpa_supplicant is run in the
+# background. Alternatively, a named configuration blob can be used by
+# setting this to blob://<blob name>
+# phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST
+# credentials (PAC)
+#
+# wpa_supplicant supports number of "EAP workarounds" to work around
+# interoperability issues with incorrectly behaving authentication servers.
+# These are enabled by default because some of the issues are present in large
+# number of authentication servers. Strict EAP conformance mode can be
+# configured by disabling workarounds with eap_workaround=0.
+
+# Example blocks:
+
+# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
+network={
+ ssid="simple"
+ psk="very secret passphrase"
+ priority=5
+}
+
+# Same as previous, but request SSID-specific scanning (for APs that reject
+# broadcast SSID)
+network={
+ ssid="second ssid"
+ scan_ssid=1
+ psk="very secret passphrase"
+ priority=2
+}
+
+# Only WPA-PSK is used. Any valid cipher combination is accepted.
+network={
+ ssid="example"
+ proto=WPA
+ key_mgmt=WPA-PSK
+ pairwise=CCMP TKIP
+ group=CCMP TKIP WEP104 WEP40
+ psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
+ priority=2
+}
+
+# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104
+# or WEP40 as the group cipher will not be accepted.
+network={
+ ssid="example"
+ proto=RSN
+ key_mgmt=WPA-EAP
+ pairwise=CCMP TKIP
+ group=CCMP TKIP
+ eap=TLS
+ identity="user@example.com"
+ ca_cert="/etc/cert/ca.pem"
+ client_cert="/etc/cert/user.pem"
+ private_key="/etc/cert/user.prv"
+ private_key_passwd="password"
+ priority=1
+}
+
+# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel
+# (e.g., Radiator)
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=PEAP
+ identity="user@example.com"
+ password="foobar"
+ ca_cert="/etc/cert/ca.pem"
+ phase1="peaplabel=1"
+ phase2="auth=MSCHAPV2"
+ priority=10
+}
+
+# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
+# unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=TTLS
+ identity="user@example.com"
+ anonymous_identity="anonymous@example.com"
+ password="foobar"
+ ca_cert="/etc/cert/ca.pem"
+ priority=2
+}
+
+# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted
+# use. Real identity is sent only within an encrypted TLS tunnel.
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=TTLS
+ identity="user@example.com"
+ anonymous_identity="anonymous@example.com"
+ password="foobar"
+ ca_cert="/etc/cert/ca.pem"
+ phase2="auth=MSCHAPV2"
+}
+
+# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner
+# authentication.
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=TTLS
+ # Phase1 / outer authentication
+ anonymous_identity="anonymous@example.com"
+ ca_cert="/etc/cert/ca.pem"
+ # Phase 2 / inner authentication
+ phase2="autheap=TLS"
+ ca_cert2="/etc/cert/ca2.pem"
+ client_cert2="/etc/cer/user.pem"
+ private_key2="/etc/cer/user.prv"
+ private_key2_passwd="password"
+ priority=2
+}
+
+# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and
+# group cipher.
+network={
+ ssid="example"
+ bssid=00:11:22:33:44:55
+ proto=WPA RSN
+ key_mgmt=WPA-PSK WPA-EAP
+ pairwise=CCMP
+ group=CCMP
+ psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
+}
+
+# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP
+# and all valid ciphers.
+network={
+ ssid=00010203
+ psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
+}
+
+
+# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using
+# EAP-TLS for authentication and key generation; require both unicast and
+# broadcast WEP keys.
+network={
+ ssid="1x-test"
+ key_mgmt=IEEE8021X
+ eap=TLS
+ identity="user@example.com"
+ ca_cert="/etc/cert/ca.pem"
+ client_cert="/etc/cert/user.pem"
+ private_key="/etc/cert/user.prv"
+ private_key_passwd="password"
+ eapol_flags=3
+}
+
+
+# LEAP with dynamic WEP keys
+network={
+ ssid="leap-example"
+ key_mgmt=IEEE8021X
+ eap=LEAP
+ identity="user"
+ password="foobar"
+}
+
+# Plaintext connection (no WPA, no IEEE 802.1X)
+network={
+ ssid="plaintext-test"
+ key_mgmt=NONE
+}
+
+
+# Shared WEP key connection (no WPA, no IEEE 802.1X)
+network={
+ ssid="static-wep-test"
+ key_mgmt=NONE
+ wep_key0="abcde"
+ wep_key1=0102030405
+ wep_key2="1234567890123"
+ wep_tx_keyidx=0
+ priority=5
+}
+
+
+# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key
+# IEEE 802.11 authentication
+network={
+ ssid="static-wep-test2"
+ key_mgmt=NONE
+ wep_key0="abcde"
+ wep_key1=0102030405
+ wep_key2="1234567890123"
+ wep_tx_keyidx=0
+ priority=5
+ auth_alg=SHARED
+}
+
+
+# IBSS/ad-hoc network with WPA-None/TKIP.
+network={
+ ssid="test adhoc"
+ mode=1
+ proto=WPA
+ key_mgmt=WPA-NONE
+ pairwise=NONE
+ group=TKIP
+ psk="secret passphrase"
+}
+
+
+# Catch all example that allows more or less all configuration modes
+network={
+ ssid="example"
+ scan_ssid=1
+ key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
+ pairwise=CCMP TKIP
+ group=CCMP TKIP WEP104 WEP40
+ psk="very secret passphrase"
+ eap=TTLS PEAP TLS
+ identity="user@example.com"
+ password="foobar"
+ ca_cert="/etc/cert/ca.pem"
+ client_cert="/etc/cert/user.pem"
+ private_key="/etc/cert/user.prv"
+ private_key_passwd="password"
+ phase1="peaplabel=0"
+}
+
+# Example of EAP-TLS with smartcard (openssl engine)
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=TLS
+ proto=RSN
+ pairwise=CCMP TKIP
+ group=CCMP TKIP
+ identity="user@example.com"
+ ca_cert="/etc/cert/ca.pem"
+ client_cert="/etc/cert/user.pem"
+
+ engine=1
+
+ # The engine configured here must be available. Look at
+ # OpenSSL engine support in the global section.
+ # The key available through the engine must be the private key
+ # matching the client certificate configured above.
+
+ # use the opensc engine
+ #engine_id="opensc"
+ #key_id="45"
+
+ # use the pkcs11 engine
+ engine_id="pkcs11"
+ key_id="id_45"
+
+ # Optional PIN configuration; this can be left out and PIN will be
+ # asked through the control interface
+ pin="1234"
+}
+
+# Example configuration showing how to use an inlined blob as a CA certificate
+# data instead of using external file
+network={
+ ssid="example"
+ key_mgmt=WPA-EAP
+ eap=TTLS
+ identity="user@example.com"
+ anonymous_identity="anonymous@example.com"
+ password="foobar"
+ ca_cert="blob://exampleblob"
+ priority=20
+}
+
+blob-base64-exampleblob={
+SGVsbG8gV29ybGQhCg==
+}
+
+
+# Wildcard match for SSID (plaintext APs only). This example select any
+# open AP regardless of its SSID.
+network={
+ key_mgmt=NONE
+}
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane
new file mode 100644
index 000000000..c91ffe0c8
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane
@@ -0,0 +1,7 @@
+ctrl_interface=/var/run/wpa_supplicant
+ctrl_interface_group=0
+update_config=1
+
+network={
+ key_mgmt=NONE
+}
diff --git a/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
new file mode 100644
index 000000000..d6d4206a5
--- /dev/null
+++ b/poky/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.6.bb
@@ -0,0 +1,111 @@
+SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
+HOMEPAGE = "http://w1.fi/wpa_supplicant/"
+BUGTRACKER = "http://w1.fi/security/"
+SECTION = "network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=292eece3f2ebbaa25608eed8464018a3 \
+ file://README;beginline=1;endline=56;md5=3f01d778be8f953962388307ee38ed2b \
+ file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=4061612fc5715696134e3baf933e8aba"
+DEPENDS = "dbus libnl"
+RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[gnutls] = ",,gnutls libgcrypt"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+inherit pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+SRC_URI = "http://w1.fi/releases/wpa_supplicant-${PV}.tar.gz \
+ file://defconfig \
+ file://wpa-supplicant.sh \
+ file://wpa_supplicant.conf \
+ file://wpa_supplicant.conf-sane \
+ file://99_wpa_supplicant \
+ file://key-replay-cve-multiple.patch \
+ "
+SRC_URI[md5sum] = "091569eb4440b7d7f2b4276dbfc03c3c"
+SRC_URI[sha256sum] = "b4936d34c4e6cdd44954beba74296d964bc2c9668ecaa5255e499636fe2b1450"
+
+CVE_PRODUCT = "wpa_supplicant"
+
+S = "${WORKDIR}/wpa_supplicant-${PV}"
+
+PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
+FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
+FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
+FILES_${PN} += "${datadir}/dbus-1/system-services/*"
+CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
+
+do_configure () {
+ ${MAKE} -C wpa_supplicant clean
+ install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
+ echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+ echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+
+ if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
+ ssl=openssl
+ elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
+ ssl=gnutls
+ fi
+ if [ -n "$ssl" ]; then
+ sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
+ fi
+
+ # For rebuild
+ rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
+}
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export BINDIR = "${sbindir}"
+
+do_compile () {
+ unset CFLAGS CPPFLAGS CXXFLAGS
+ sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
+ oe_runmake -C wpa_supplicant
+}
+
+do_install () {
+ install -d ${D}${sbindir}
+ install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
+ install -m 755 wpa_supplicant/wpa_cli ${D}${sbindir}
+
+ install -d ${D}${bindir}
+ install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
+
+ install -d ${D}${docdir}/wpa_supplicant
+ install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
+
+ install -d ${D}${sysconfdir}
+ install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
+
+ install -d ${D}${sysconfdir}/network/if-pre-up.d/
+ install -d ${D}${sysconfdir}/network/if-post-down.d/
+ install -d ${D}${sysconfdir}/network/if-down.d/
+ install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
+ cd ${D}${sysconfdir}/network/ && \
+ ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
+
+ install -d ${D}/${sysconfdir}/dbus-1/system.d
+ install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
+ install -d ${D}/${datadir}/dbus-1/system-services
+ install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}/${systemd_unitdir}/system
+ install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
+ fi
+
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
+}
+
+pkg_postinst_wpa-supplicant () {
+ # If we're offline, we don't need to do this.
+ if [ "x$D" = "x" ]; then
+ killall -q -HUP dbus-daemon || true
+ fi
+
+}
diff --git a/poky/meta/recipes-core/base-files/base-files/filesystems b/poky/meta/recipes-core/base-files/base-files/filesystems
new file mode 100644
index 000000000..7e6c41c38
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/filesystems
@@ -0,0 +1,8 @@
+ext4
+ext3
+ext2
+vfat
+fat
+btrfs
+minix
+*
diff --git a/poky/meta/recipes-core/base-files/base-files/fstab b/poky/meta/recipes-core/base-files/base-files/fstab
new file mode 100644
index 000000000..d79a01602
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/fstab
@@ -0,0 +1,11 @@
+# stock fstab - you probably want to override this with a machine specific one
+
+/dev/root / auto defaults 1 1
+proc /proc proc defaults 0 0
+devpts /dev/pts devpts mode=0620,gid=5 0 0
+tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
+tmpfs /var/volatile tmpfs defaults 0 0
+
+# uncomment this if your device has a SD/MMC/Transflash slot
+#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
+
diff --git a/poky/meta/recipes-core/base-files/base-files/host.conf b/poky/meta/recipes-core/base-files/base-files/host.conf
new file mode 100644
index 000000000..1a8c1e151
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/host.conf
@@ -0,0 +1,2 @@
+order hosts,bind
+multi on
diff --git a/poky/meta/recipes-core/base-files/base-files/issue b/poky/meta/recipes-core/base-files/base-files/issue
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/issue
diff --git a/poky/meta/recipes-core/base-files/base-files/issue.net b/poky/meta/recipes-core/base-files/base-files/issue.net
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/issue.net
diff --git a/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2
new file mode 100644
index 000000000..d60c31a97
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/poky/meta/recipes-core/base-files/base-files/motd b/poky/meta/recipes-core/base-files/base-files/motd
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/motd
diff --git a/poky/meta/recipes-core/base-files/base-files/nsswitch.conf b/poky/meta/recipes-core/base-files/base-files/nsswitch.conf
new file mode 100644
index 000000000..06f03d22a
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/nsswitch.conf
@@ -0,0 +1,19 @@
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+# If you have the `glibc-doc' and `info' packages installed, try:
+# `info libc "Name Service Switch"' for information about this file.
+
+passwd: compat
+group: compat
+shadow: compat
+
+hosts: files dns
+networks: files
+
+protocols: db files
+services: db files
+ethers: db files
+rpc: db files
+
+netgroup: nis
diff --git a/poky/meta/recipes-core/base-files/base-files/profile b/poky/meta/recipes-core/base-files/base-files/profile
new file mode 100644
index 000000000..a06202822
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/profile
@@ -0,0 +1,34 @@
+# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
+# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
+
+PATH="/usr/local/bin:/usr/bin:/bin"
+EDITOR="vi" # needed for packages like cron, git-commit
+[ "$TERM" ] || TERM="vt100" # Basic terminal capab. For screen etc.
+
+# Add /sbin & co to $PATH for the root user
+[ "$HOME" != "ROOTHOME" ] || PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
+
+# Set the prompt for bash and ash (no other shells known to be in use here)
+[ -z "$PS1" ] || PS1='\u@\h:\w\$ '
+
+if [ -d /etc/profile.d ]; then
+ for i in /etc/profile.d/*.sh; do
+ if [ -f $i -a -r $i ]; then
+ . $i
+ fi
+ done
+ unset i
+fi
+
+if command -v resize >/dev/null && command -v tty >/dev/null; then
+ # Make sure we are on a serial console (i.e. the device used starts with
+ # /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which
+ # tries do use ssh
+ case $(tty) in
+ /dev/tty[A-z]*) resize >/dev/null;;
+ esac
+fi
+
+export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
+
+umask 022
diff --git a/poky/meta/recipes-core/base-files/base-files/rotation b/poky/meta/recipes-core/base-files/base-files/rotation
new file mode 100644
index 000000000..c22708346
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/rotation
@@ -0,0 +1 @@
+0 \ No newline at end of file
diff --git a/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc b/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc
new file mode 100644
index 000000000..4be63686c
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc
@@ -0,0 +1,16 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+
+export PS1='\h:\w\$ '
+umask 022
+
+# You may uncomment the following lines if you want `ls' to be colorized:
+# export LS_OPTIONS='--color=auto'
+# eval `dircolors`
+# alias ls='ls $LS_OPTIONS'
+# alias ll='ls $LS_OPTIONS -l'
+# alias l='ls $LS_OPTIONS -lA'
+#
+# Some more alias to avoid making mistakes:
+# alias rm='rm -i'
+# alias cp='cp -i'
+# alias mv='mv -i'
diff --git a/poky/meta/recipes-core/base-files/base-files/share/dot.profile b/poky/meta/recipes-core/base-files/base-files/share/dot.profile
new file mode 100644
index 000000000..a87316077
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -0,0 +1,11 @@
+# ~/.profile: executed by Bourne-compatible login shells.
+
+if [ -f ~/.bashrc ]; then
+ . ~/.bashrc
+fi
+
+# path set by /etc/profile
+# export PATH
+
+# Might fail after "su - myuser" when /dev/tty* is not writable by "myuser".
+mesg n 2>/dev/null
diff --git a/poky/meta/recipes-core/base-files/base-files/shells b/poky/meta/recipes-core/base-files/base-files/shells
new file mode 100644
index 000000000..3f639874d
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/shells
@@ -0,0 +1,2 @@
+# /etc/shells: valid login shells
+/bin/sh
diff --git a/poky/meta/recipes-core/base-files/base-files/usbd b/poky/meta/recipes-core/base-files/base-files/usbd
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files/usbd
diff --git a/poky/meta/recipes-core/base-files/base-files_3.0.14.bb b/poky/meta/recipes-core/base-files/base-files_3.0.14.bb
new file mode 100644
index 000000000..1c0863b1c
--- /dev/null
+++ b/poky/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -0,0 +1,176 @@
+SUMMARY = "Miscellaneous files for the base system"
+DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system."
+SECTION = "base"
+PR = "r89"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f"
+# Removed all license related tasks in this recipe as license.bbclass
+# now deals with this. In order to get accurate licensing on to the image:
+# Set COPY_LIC_MANIFEST to just copy just the license.manifest to the image
+# For the manifest and the license text for each package:
+# Set COPY_LIC_MANIFEST and COPY_LIC_DIRS
+
+SRC_URI = "file://rotation \
+ file://nsswitch.conf \
+ file://motd \
+ file://host.conf \
+ file://profile \
+ file://shells \
+ file://fstab \
+ file://filesystems \
+ file://issue.net \
+ file://issue \
+ file://usbd \
+ file://share/dot.bashrc \
+ file://share/dot.profile \
+ file://licenses/GPL-2 \
+ "
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+docdir_append = "/${P}"
+dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
+dirs2775 = ""
+dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
+ ${sysconfdir} ${sysconfdir}/default \
+ ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run \
+ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
+ ${libdir} ${sbindir} ${datadir} \
+ ${datadir}/common-licenses ${datadir}/dict ${infodir} \
+ ${mandir} ${datadir}/misc ${localstatedir} \
+ ${localstatedir}/backups ${localstatedir}/lib \
+ /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
+ ${localstatedir}/volatile \
+ ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \
+ /home ${prefix}/src ${localstatedir}/local \
+ /media"
+
+dirs755-lsb = "/srv \
+ ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \
+ ${prefix}/local/include ${prefix}/local/lib ${prefix}/local/sbin \
+ ${prefix}/local/share ${prefix}/local/src \
+ ${prefix}/lib/locale"
+dirs2775-lsb = "/var/mail"
+
+volatiles = "${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''} tmp"
+conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
+ ${sysconfdir}/issue /${sysconfdir}/issue.net \
+ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
+ ${sysconfdir}/default"
+
+# By default the hostname is the machine name. If the hostname is unset then a
+# /etc/hostname file isn't written, suitable for environments with dynamic
+# hostnames.
+#
+# The hostname can be changed outside of this recipe by using
+# hostname_pn-base-files = "my-host-name".
+hostname = "${MACHINE}"
+
+BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
+
+# In previous versions of base-files, /run was a softlink to /var/run and the
+# directory was located in /var/volatlie/run. Also, /var/lock was a softlink
+# to /var/volatile/lock which is where the real directory was located. Now,
+# /run and /run/lock are the real directories. If we are upgrading, we may
+# need to remove the symbolic links first before we create the directories.
+# Otherwise the directory creation will fail and we will have circular symbolic
+# links.
+#
+pkg_preinst_${PN} () {
+ #!/bin/sh -e
+ if [ x"$D" = "x" ]; then
+ if [ -h "/var/lock" ]; then
+ # Remove the symbolic link
+ rm -f /var/lock
+ fi
+
+ if [ -h "/run" ]; then
+ # Remove the symbolic link
+ rm -f /run
+ fi
+ fi
+}
+
+do_install () {
+ for d in ${dirs755}; do
+ install -m 0755 -d ${D}$d
+ done
+ for d in ${dirs1777}; do
+ install -m 1777 -d ${D}$d
+ done
+ for d in ${dirs2775}; do
+ install -m 2775 -d ${D}$d
+ done
+ for d in ${volatiles}; do
+ ln -sf volatile/$d ${D}${localstatedir}/$d
+ done
+
+ ln -snf ../run ${D}${localstatedir}/run
+ ln -snf ../run/lock ${D}${localstatedir}/lock
+
+ ${BASEFILESISSUEINSTALL}
+
+ rotation=`cat ${WORKDIR}/rotation`
+ if [ "$rotation" != "0" ]; then
+ install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation
+ fi
+
+ install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
+ install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
+ install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
+ install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
+ sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
+ install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
+ install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
+ install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
+ install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
+ install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
+ install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
+
+ ln -sf /proc/mounts ${D}${sysconfdir}/mtab
+}
+
+DISTRO_VERSION[vardepsexclude] += "DATE"
+do_install_basefilesissue () {
+ if [ "${hostname}" ]; then
+ echo ${hostname} > ${D}${sysconfdir}/hostname
+ fi
+
+ install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
+ if [ -n "${DISTRO_NAME}" ]; then
+ printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
+ printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
+ if [ -n "${DISTRO_VERSION}" ]; then
+ distro_version_nodate=${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}
+ printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue
+ printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue.net
+ fi
+ printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
+ echo >> ${D}${sysconfdir}/issue
+ echo "%h" >> ${D}${sysconfdir}/issue.net
+ echo >> ${D}${sysconfdir}/issue.net
+ fi
+}
+do_install_basefilesissue[vardepsexclude] += "DATE"
+
+do_install_append_linuxstdbase() {
+ for d in ${dirs755-lsb}; do
+ install -m 0755 -d ${D}$d
+ done
+
+ for d in ${dirs2775-lsb}; do
+ install -m 2775 -d ${D}$d
+ done
+}
+
+SYSROOT_DIRS += "${sysconfdir}/skel"
+
+PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
+FILES_${PN} = "/"
+FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
new file mode 100644
index 000000000..5f357d889
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
@@ -0,0 +1,19 @@
+
+We need to have a shutdown group to allow the shutdown icon
+to work correctly. Any users that want to use shutdown like
+the xuser should be added to this group.
+
+Upstream-Status: Inappropriate [Embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -36,5 +36,6 @@ sasl:*:45:
+ plugdev:*:46:
+ staff:*:50:
+ games:*:60:
++shutdown:*:70:
+ users:*:100:
+ nogroup:*:65534:
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
new file mode 100644
index 000000000..14c08b748
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
@@ -0,0 +1,24 @@
+Disable documentation for now as it uses tools currently not supported
+by OE-Core. It uses sgmltools and po4a.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: base-passwd-3.5.28/Makefile.in
+===================================================================
+--- base-passwd-3.5.28.orig/Makefile.in
++++ base-passwd-3.5.28/Makefile.in
+@@ -25,13 +25,10 @@ gen_configure = config.cache config.stat
+ confdefhs.h config.h Makefile
+
+ all: update-passwd
+- $(MAKE) -C doc all
+- $(MAKE) -C man all
+
+ install: all
+ mkdir -p $(DESTDIR)$(sbindir)
+ $(INSTALL) update-passwd $(DESTDIR)$(sbindir)/
+- $(MAKE) -C man install
+
+ update-passwd.o: version.h
+
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd/input.patch b/poky/meta/recipes-core/base-passwd/base-passwd/input.patch
new file mode 100644
index 000000000..3abbcad5d
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd/input.patch
@@ -0,0 +1,22 @@
+Add an input group for the /dev/input/* devices.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+---
+ group.master | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -12,6 +12,7 @@ uucp:*:10:
+ man:*:12:
+ proxy:*:13:
+ kmem:*:15:
++input:*:19:
+ dialout:*:20:
+ fax:*:21:
+ voice:*:22:
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch
new file mode 100644
index 000000000..b5a692295
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch
@@ -0,0 +1,15 @@
+use /bin/sh instead of /bin/bash, since the latter may not be included in
+some images such as minimal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/bash
++root:*:0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
new file mode 100644
index 000000000..e27bf7d9b
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
@@ -0,0 +1,14 @@
+remove "*" for root since we don't have a /etc/shadow so far.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/sh
++root::0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 000000000..c6be1c1d0
--- /dev/null
+++ b/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Base system master password/group files"
+DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+RECIPE_NO_UPDATE_REASON = "Version 3.5.38 requires cdebconf for update-passwd utility"
+
+SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar.gz \
+ file://add_shutdown.patch \
+ file://nobash.patch \
+ file://noshadow.patch \
+ file://input.patch \
+ file://disable-docs.patch \
+ "
+
+SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
+SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
+
+# the package is taken from launchpad; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/"
+
+inherit autotools
+
+do_install () {
+ install -d -m 755 ${D}${sbindir}
+ install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
+ install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
+ install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
+ install -p -m 644 ${S}/man/update-passwd.pl.8 \
+ ${D}${mandir}/pl/man8/update-passwd.8
+ gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
+ install -d -m 755 ${D}${datadir}/base-passwd
+ install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
+ sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
+ install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
+
+ install -d -m 755 ${D}${docdir}/${BPN}
+ install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
+ gzip -9 ${D}${docdir}/${BPN}/*
+ install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
+ install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
+}
+
+basepasswd_sysroot_postinst() {
+#!/bin/sh
+
+# Install passwd.master and group.master to sysconfdir
+install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
+for i in passwd group; do
+ install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/\$i.master \
+ ${STAGING_DIR_TARGET}${sysconfdir}/\$i
+done
+
+# Run any useradd postinsts
+for script in ${STAGING_DIR_TARGET}${bindir}/postinst-useradd-*; do
+ if [ -f \$script ]; then
+ \$script
+ fi
+done
+}
+
+SYSROOT_DIRS += "${sysconfdir}"
+SYSROOT_PREPROCESS_FUNCS += "base_passwd_tweaksysroot"
+
+base_passwd_tweaksysroot () {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+ echo "${basepasswd_sysroot_postinst}" > $dest
+ chmod 0755 $dest
+}
+
+python populate_packages_prepend() {
+ # Add in the preinst function for ${PN}
+ # We have to do this here as prior to this, passwd/group.master
+ # would be unavailable. We need to create these files at preinst
+ # time before the files from the package may be available, hence
+ # storing the data from the files in the preinst directly.
+
+ f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
+ passwd = "".join(f.readlines())
+ f.close()
+ f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
+ group = "".join(f.readlines())
+ f.close()
+
+ preinst = """#!/bin/sh
+mkdir -p $D${sysconfdir}
+if [ ! -e $D${sysconfdir}/passwd ]; then
+\tcat << 'EOF' > $D${sysconfdir}/passwd
+""" + passwd + """EOF
+fi
+if [ ! -e $D${sysconfdir}/group ]; then
+\tcat << 'EOF' > $D${sysconfdir}/group
+""" + group + """EOF
+fi
+"""
+ d.setVar(d.expand('pkg_preinst_${PN}'), preinst)
+}
+
+addtask do_package after do_populate_sysroot
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-update"
+FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
+
+pkg_postinst_${PN}-update () {
+#!/bin/sh
+if [ -n "$D" ]; then
+ exit 0
+fi
+${sbindir}/update-passwd
+}
diff --git a/poky/meta/recipes-core/busybox/busybox-inittab_1.27.2.bb b/poky/meta/recipes-core/busybox/busybox-inittab_1.27.2.bb
new file mode 100644
index 000000000..a83620e85
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox-inittab_1.27.2.bb
@@ -0,0 +1,32 @@
+SUMMARY = "inittab configuration for BusyBox"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://inittab"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+ tmp="${SERIAL_CONSOLES}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/\;/\ /g`
+ id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
+ echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ done
+}
+
+# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
diff --git a/poky/meta/recipes-core/busybox/busybox.inc b/poky/meta/recipes-core/busybox/busybox.inc
new file mode 100644
index 000000000..d1675c37a
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox.inc
@@ -0,0 +1,447 @@
+SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable"
+DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system."
+HOMEPAGE = "http://www.busybox.net"
+BUGTRACKER = "https://bugs.busybox.net/"
+
+DEPENDS += "kern-tools-native"
+
+# bzip2 applet in busybox is based on lightly-modified bzip2 source
+# the GPL is version 2 only
+LICENSE = "GPLv2 & bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
+
+SECTION = "base"
+
+# Whether to split the suid apps into a seperate binary
+BUSYBOX_SPLIT_SUID ?= "1"
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export EXTRA_LDFLAGS = "${LDFLAGS}"
+
+EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'"
+
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+
+FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
+FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*"
+FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
+FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
+FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
+
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
+
+INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
+INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
+INITSCRIPT_NAME_${PN}-mdev = "mdev"
+INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ."
+INITSCRIPT_NAME_${PN}-syslog = "syslog"
+INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
+
+SYSTEMD_PACKAGES = "${PN}-syslog"
+SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}"
+
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf"
+RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng"
+
+CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
+
+RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
+
+RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}"
+
+inherit cml1 systemd update-rc.d ptest
+
+# internal helper
+def busybox_cfg(feature, tokens, cnf, rem):
+ if type(tokens) == type(""):
+ tokens = [tokens]
+ rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+ if feature:
+ cnf.extend([token + '=y' for token in tokens])
+ else:
+ cnf.extend(['# ' + token + ' is not set' for token in tokens])
+
+# Map distro features to config settings
+def features_to_busybox_settings(d):
+ cnf, rem = ([], [])
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
+ busybox_cfg(True, 'CONFIG_LFS', cnf, rem)
+ busybox_cfg(True, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+ return "\n".join(cnf), "\n".join(rem)
+
+# X, Y = ${@features_to_busybox_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_busybox_conf(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return cnf
+def features_to_busybox_del(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return rem
+
+configmangle = '/CONFIG_EXTRA_CFLAGS/d; \
+ '
+OE_FEATURES := "${@features_to_busybox_conf(d)}"
+OE_DEL := "${@features_to_busybox_del(d)}"
+DO_IPv4 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}"
+DO_IPv6 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}"
+
+python () {
+ if "${OE_DEL}":
+ d.setVar('configmangle_append', "${OE_DEL}" + "\n")
+ if "${OE_FEATURES}":
+ d.setVar('configmangle_append',
+ "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+ ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
+ d.setVar('configmangle_append',
+ "/^### CROSS$/a\\\n%s\n" %
+ ("\\n".join(["CONFIG_EXTRA_CFLAGS=\"${CFLAGS} ${HOST_CC_ARCH}\""
+ ])
+ ))
+}
+
+do_prepare_config () {
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ export KCONFIG_NOTIMESTAMP=1
+ fi
+ sed -e '/CONFIG_STATIC/d' \
+ < ${WORKDIR}/defconfig > ${S}/.config
+ echo "# CONFIG_STATIC is not set" >> .config
+ for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
+ ${S}/.config
+ sed -i -e '${configmangle}' ${S}/.config
+ if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
+ # disable networking applets
+ mv ${S}/.config ${S}/.config.oe-tmp
+ awk 'BEGIN{net=0}
+ /^# Networking Utilities/{net=1}
+ /^#$/{if(net){net=net+1}}
+ {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
+ ${S}/.config.oe-tmp > ${S}/.config
+ fi
+ sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
+ sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
+}
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ if s.endswith('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
+do_configure () {
+ do_prepare_config
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+ cml1_do_configure
+}
+
+do_compile() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ export KCONFIG_NOTIMESTAMP=1
+ fi
+ if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
+ # split the .config into two parts, and make two busybox binaries
+ if [ -e .config.orig ]; then
+ # Need to guard again an interrupted do_compile - restore any backup
+ cp .config.orig .config
+ fi
+ cp .config .config.orig
+ oe_runmake busybox.cfg.suid
+ oe_runmake busybox.cfg.nosuid
+
+ # workaround for suid bug 10346
+ if ! grep -q "CONFIG_SH_IS_NONE" busybox.cfg.nosuid; then
+ echo "CONFIG_SH_IS_NONE" >> busybox.cfg.suid
+ fi
+
+ for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
+ echo "# $i is not set" >> .config.disable.apps
+ done
+ merge_config.sh -m .config.orig .config.disable.apps
+ cp .config .config.nonapps
+ for s in suid nosuid; do
+ cat busybox.cfg.$s | while read item; do
+ grep -w "$item" .config.orig
+ done > .config.app.$s
+
+ # workaround for suid bug 10346
+ if [ "$s" = "suid" ] ; then
+ sed "s/.*CONFIG_SH_IS_NONE.*$/CONFIG_SH_IS_NONE=y/" -i .config.app.suid
+ fi
+
+ merge_config.sh -m .config.nonapps .config.app.$s
+ oe_runmake busybox_unstripped
+ mv busybox_unstripped busybox.$s
+ oe_runmake busybox.links
+ mv busybox.links busybox.links.$s
+ done
+
+ # hard fail if sh is being linked to the suid busybox (detects bug 10346)
+ if grep -q -x "/bin/sh" busybox.links.suid; then
+ bbfatal "busybox suid binary incorrectly provides /bin/sh"
+ fi
+
+ # copy .config.orig back to .config, because the install process may check this file
+ cp .config.orig .config
+ # cleanup
+ rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
+ else
+ oe_runmake busybox_unstripped
+ cp busybox_unstripped busybox
+ oe_runmake busybox.links
+ fi
+}
+
+do_install () {
+ sed -i "s:^/bin/:BASE_BINDIR/:" busybox.links*
+ sed -i "s:^/sbin/:BASE_SBINDIR/:" busybox.links*
+ sed -i "s:^/usr/bin/:BINDIR/:" busybox.links*
+ sed -i "s:^/usr/sbin/:SBINDIR/:" busybox.links*
+
+ sed -i "s:^BASE_BINDIR/:${base_bindir}/:" busybox.links*
+ sed -i "s:^BASE_SBINDIR/:${base_sbindir}/:" busybox.links*
+ sed -i "s:^BINDIR/:${bindir}/:" busybox.links*
+ sed -i "s:^SBINDIR/:${sbindir}/:" busybox.links*
+
+ install -d ${D}${sysconfdir}/init.d
+
+ if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
+ # Install ${base_bindir}/busybox, and the ${base_bindir}/sh link so the postinst script
+ # can run. Let update-alternatives handle the rest.
+ install -d ${D}${base_bindir}
+ if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
+ install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
+ install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
+ install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
+ install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
+ if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
+ ln -sf busybox.nosuid ${D}${base_bindir}/sh
+ fi
+ # Keep a default busybox for people who want to invoke busybox directly.
+ # This is also useful for the on device upgrade. Because we want
+ # to use the busybox command in postinst.
+ ln -sf busybox.nosuid ${D}${base_bindir}/busybox
+ else
+ if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
+ install -m 4755 ${B}/busybox ${D}${base_bindir}
+ else
+ install -m 0755 ${B}/busybox ${D}${base_bindir}
+ fi
+ install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+ if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
+ ln -sf busybox ${D}${base_bindir}/sh
+ fi
+ # We make this symlink here to eliminate the error when upgrading together
+ # with busybox-syslog. Without this symlink, the opkg may think of the
+ # busybox.nosuid as obsolete and remove it, resulting in dead links like
+ # ${base_bindir}/sed -> ${base_bindir}/busybox.nosuid. This will make upgrading busybox-syslog fail.
+ # This symlink will be safely deleted in postinst, thus no negative effect.
+ ln -sf busybox ${D}${base_bindir}/busybox.nosuid
+ fi
+ else
+ install -d ${D}${base_bindir} ${D}${base_sbindir}
+ install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
+ cat busybox.links | while read FILE; do
+ NAME=`basename "$FILE"`
+ install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
+ done
+ # add suid bit where needed
+ for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
+ find ${D} -name $i.${BPN} -exec chmod a+s {} \;
+ done
+ install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
+ ln -sf sh.${BPN} ${D}${base_bindir}/sh
+ ln -sf ln.${BPN} ${D}${base_bindir}/ln
+ ln -sf test.${BPN} ${D}${bindir}/test
+ if [ -f ${D}/linuxrc.${BPN} ]; then
+ mv ${D}/linuxrc.${BPN} ${D}/linuxrc
+ fi
+ install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+ fi
+
+ if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
+ install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+ fi
+ if grep "CONFIG_CROND=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_HTTPD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
+ install -d ${D}/srv/www
+ fi
+ if grep "CONFIG_UDHCPD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_HWCLOCK=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
+ fi
+ if grep "CONFIG_UDHCPC=y" ${B}/.config; then
+ install -d ${D}${sysconfdir}/udhcpc.d
+ install -d ${D}${datadir}/udhcpc
+ install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
+ sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default
+ install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
+ fi
+ if grep "CONFIG_INETD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
+ sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
+ install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
+ fi
+ if grep "CONFIG_MDEV=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
+ if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
+ install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
+ install -d ${D}${sysconfdir}/mdev
+ install -m 0755 ${WORKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev
+ install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
+ fi
+ fi
+ if grep "CONFIG_INIT=y" ${B}/.config; then
+ install -D -m 0777 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
+ install -D -m 0777 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
+ install -D -m 0755 ${WORKDIR}/runlevel ${D}${base_sbindir}/runlevel
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+ install -d ${D}${systemd_unitdir}/system
+ sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+ > ${D}${systemd_unitdir}/system/busybox-syslog.service
+ if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
+ fi
+ fi
+ if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
+ install -d ${D}${systemd_unitdir}/system
+ sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
+ > ${D}${systemd_unitdir}/system/busybox-klogd.service
+ fi
+ fi
+
+ # Remove the sysvinit specific configuration file for systemd systems to avoid confusion
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
+ rm -f ${D}${sysconfdir}/syslog-startup.conf
+ fi
+}
+
+do_install_ptest () {
+ cp -r ${B}/testsuite ${D}${PTEST_PATH}/
+ cp ${B}/.config ${D}${PTEST_PATH}/
+ ln -s /bin/busybox ${D}${PTEST_PATH}/busybox
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "50"
+
+python do_package_prepend () {
+ # We need to load the full set of busybox provides from the /etc/busybox.links
+ # Use this to see the update-alternatives with the right information
+
+ dvar = d.getVar('D')
+ pn = d.getVar('PN')
+ def set_alternative_vars(links, target):
+ links = d.expand(links)
+ target = d.expand(target)
+ f = open('%s%s' % (dvar, links), 'r')
+ for alt_link_name in f:
+ alt_link_name = alt_link_name.strip()
+ alt_name = os.path.basename(alt_link_name)
+ # Match coreutils
+ if alt_name == '[':
+ alt_name = 'lbracket'
+ d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
+ if os.path.exists('%s%s' % (dvar, target)):
+ d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
+ f.close()
+ return
+
+ if os.path.exists('%s/etc/busybox.links' % (dvar)):
+ set_alternative_vars("${sysconfdir}/busybox.links", "${base_bindir}/busybox")
+ else:
+ set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid")
+ set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid")
+}
+
+pkg_postinst_${PN} () {
+ # This part of code is dedicated to the on target upgrade problem.
+ # It's known that if we don't make appropriate symlinks before update-alternatives calls,
+ # there will be errors indicating missing commands such as 'sed'.
+ # These symlinks will later be updated by update-alternatives calls.
+ test -n 2 > /dev/null || alias test='busybox test'
+ if test "x$D" = "x"; then
+ # Remove busybox.nosuid if it's a symlink, because this situation indicates
+ # that we're installing or upgrading to a one-binary busybox.
+ if test -h ${base_bindir}/busybox.nosuid; then
+ rm -f ${base_bindir}/busybox.nosuid
+ fi
+ for suffix in "" ".nosuid" ".suid"; do
+ if test -e ${sysconfdir}/busybox.links$suffix; then
+ while read link; do
+ if test ! -e "$link"; then
+ # we can use busybox here because even if we are using splitted busybox
+ # we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
+ busybox rm -f $link
+ busybox ln -s "${base_bindir}/busybox$suffix" $link
+ fi
+ done < ${sysconfdir}/busybox.links$suffix
+ fi
+ done
+ fi
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+ fi
+}
+
+pkg_prerm_${PN} () {
+ # This is so you can make busybox commit suicide - removing busybox with no other packages
+ # providing its files, this will make update-alternatives work, but the update-rc.d part
+ # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
+ tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
+ ln -s ${base_bindir}/busybox $tmpdir/[
+ ln -s ${base_bindir}/busybox $tmpdir/test
+ ln -s ${base_bindir}/busybox $tmpdir/head
+ ln -s ${base_bindir}/busybox $tmpdir/sh
+ ln -s ${base_bindir}/busybox $tmpdir/basename
+ ln -s ${base_bindir}/busybox $tmpdir/echo
+ ln -s ${base_bindir}/busybox $tmpdir/mv
+ ln -s ${base_bindir}/busybox $tmpdir/ln
+ ln -s ${base_bindir}/busybox $tmpdir/dirname
+ ln -s ${base_bindir}/busybox $tmpdir/rm
+ ln -s ${base_bindir}/busybox $tmpdir/sed
+ ln -s ${base_bindir}/busybox $tmpdir/sort
+ ln -s ${base_bindir}/busybox $tmpdir/grep
+ ln -s ${base_bindir}/busybox $tmpdir/tail
+ export PATH=$PATH:$tmpdir
+}
+
+pkg_postrm_${PN} () {
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links* && [ ! -e $D${base_bindir}/bash ]; then
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+ fi
+}
+
+pkg_prerm_${PN}-syslog () {
+ # remove syslog
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ ${sysconfdir}/init.d/syslog stop || :
+ fi
+ fi
+}
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
diff --git a/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch b/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch
new file mode 100644
index 000000000..2bf2b91c7
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch
@@ -0,0 +1,114 @@
+From a9333eb6a7b8dbda735947cd5bc981ff9352a2c9 Mon Sep 17 00:00:00 2001
+From: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
+Date: Thu, 10 Mar 2011 00:27:08 -0500
+Subject: [PATCH 1/2] Use $(CC) when linking instead of $(LD) and use $(CFLAGS)
+ and $(EXTRA_CFLAGS) when linking.
+
+This fixes the issue where LDFLAGS escaped with -Wl are ignored during
+compilation. It also simplifies using CFLAGS or EXTRA_CFLAGS (such as
+-m32 on x86_64 or -flto) which apply to both compilation and linking
+situations.
+
+Signed-off-by: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
+---
+Upstream-Status: Pending
+
+ Makefile | 7 ++++---
+ scripts/Makefile.build | 8 ++++----
+ scripts/Makefile.lib | 13 +++----------
+ 3 files changed, 11 insertions(+), 17 deletions(-)
+
+Index: busybox-1.23.2/Makefile
+===================================================================
+--- busybox-1.23.2.orig/Makefile
++++ busybox-1.23.2/Makefile
+@@ -309,7 +309,8 @@ CHECKFLAGS := -D__linux__ -Dlinux -D
+ MODFLAGS = -DMODULE
+ CFLAGS_MODULE = $(MODFLAGS)
+ AFLAGS_MODULE = $(MODFLAGS)
+-LDFLAGS_MODULE = -r
++LDFLAGS_RELOCATABLE = -r -nostdlib
++LDFLAGS_MODULE = $(LDFLAGS_RELOCATABLE)
+ CFLAGS_KERNEL =
+ AFLAGS_KERNEL =
+
+@@ -331,7 +332,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL)
+ export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \
+ ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
+ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
+- HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
++ HOSTCXX HOSTCXXFLAGS LDFLAGS_RELOCATABLE LDFLAGS_MODULE CHECK CHECKFLAGS
+
+ export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
+ export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
+@@ -610,7 +611,7 @@ quiet_cmd_busybox__ ?= LINK $@
+ cmd_busybox__ ?= $(srctree)/scripts/trylink \
+ "$@" \
+ "$(CC)" \
+- "$(CFLAGS) $(CFLAGS_busybox)" \
++ "$(CFLAGS) $(CFLAGS_busybox) $(EXTRA_CFLAGS)" \
+ "$(LDFLAGS) $(EXTRA_LDFLAGS)" \
+ "$(core-y)" \
+ "$(libs-y)" \
+Index: busybox-1.23.2/scripts/Makefile.build
+===================================================================
+--- busybox-1.23.2.orig/scripts/Makefile.build
++++ busybox-1.23.2/scripts/Makefile.build
+@@ -174,7 +174,7 @@ cmd_modversions = \
+ | $(GENKSYMS) -a $(ARCH) \
+ > $(@D)/.tmp_$(@F:.o=.ver); \
+ \
+- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
++ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(@D)/.tmp_$(@F) \
+ -T $(@D)/.tmp_$(@F:.o=.ver); \
+ rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
+ else \
+@@ -257,7 +257,7 @@ quiet_cmd_link_o_target = LD $@
+ # If the list of objects to link is empty, just create an empty built-in.o
+ # -nostdlib is added to make "make LD=gcc ..." work (some people use that)
+ cmd_link_o_target = $(if $(strip $(obj-y)),\
+- $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
++ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(filter $(obj-y), $^),\
+ rm -f $@; $(AR) rcs $@)
+
+ $(builtin-target): $(obj-y) FORCE
+@@ -292,10 +292,10 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
+ $($(subst $(obj)/,,$(@:.o=-y)))), $^)
+
+ quiet_cmd_link_multi-y = LD $@
+-cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
++cmd_link_multi-y = $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(link_multi_deps)
+
+ quiet_cmd_link_multi-m = LD [M] $@
+-cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
++cmd_link_multi-m = $(CC) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
+
+ # We would rather have a list of rules like
+ # foo.o: $(foo-objs)
+Index: busybox-1.23.2/scripts/Makefile.lib
+===================================================================
+--- busybox-1.23.2.orig/scripts/Makefile.lib
++++ busybox-1.23.2/scripts/Makefile.lib
+@@ -121,7 +121,8 @@ cpp_flags = -Wp,-MD,$(depfile) $(NO
+ # yet ld_flags is fed to ld.
+ #ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
+ # Remove the -Wl, prefix from linker options normally passed through gcc
+-ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS))
++ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS) $(CFLAGS) $(EXTRA_CFLAGS))
++ld_flags_partial = $($(filter-out -shared%, $(filter-out -pie%,$(ld_flags))))
+
+
+ # Finds the multi-part object the current object will be linked into
+@@ -151,10 +152,8 @@ $(obj)/%:: $(src)/%_shipped
+ # Linking
+ # ---------------------------------------------------------------------------
+
+-# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's.
+-# but here we feed them to ld!
+-quiet_cmd_ld = LD $@
+-cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
++quiet_cmd_ld = CC $@
++cmd_ld = $(CC) $(ld_flags) $(LDFLAGS_$(@F)) \
+ $(filter-out FORCE,$^) -o $@
+
+ # Objcopy
diff --git a/poky/meta/recipes-core/busybox/busybox/CVE-2011-5325.patch b/poky/meta/recipes-core/busybox/busybox/CVE-2011-5325.patch
new file mode 100755
index 000000000..0926107be
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/CVE-2011-5325.patch
@@ -0,0 +1,481 @@
+busybox-1.27.2: Fix CVE-2011-5325
+
+[No upstream tracking] -- https://bugs.busybox.net/show_bug.cgi?id=8411
+
+libarchive: do not extract unsafe symlinks
+
+Prevent unsafe links extracting unless env variable $EXTRACT_UNSAFE_SYMLINKS=1
+is not set. Untarring file with -C DESTDIR parameter could be extracted with
+unwanted symlinks. This doesn't feel right, and IIRC GNU tar doesn't do that.
+Include necessary changes from previous commits.
+
+Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=bc9bbeb2b81001e8731cd2ae501c8fccc8d87cc7]
+CVE: CVE-2011-5325
+bug: 8411
+Signed-off-by: Radovan Scasny <radovan.scasny@siemens.com>
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src
+index 942e755..e1a8a75 100644
+--- a/archival/libarchive/Kbuild.src
++++ b/archival/libarchive/Kbuild.src
+@@ -12,6 +12,8 @@ COMMON_FILES:= \
+ data_extract_all.o \
+ data_extract_to_stdout.o \
+ \
++ unsafe_symlink_target.o \
++\
+ filter_accept_all.o \
+ filter_accept_list.o \
+ filter_accept_reject_list.o \
+diff --git a/archival/libarchive/data_extract_all.c b/archival/libarchive/data_extract_all.c
+index 1830ffb..b828b65 100644
+--- a/archival/libarchive/data_extract_all.c
++++ b/archival/libarchive/data_extract_all.c
+@@ -128,10 +128,9 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
+ res = link(hard_link, dst_name);
+ if (res != 0 && !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)) {
+ /* shared message */
+- bb_perror_msg("can't create %slink "
+- "%s to %s", "hard",
+- dst_name,
+- hard_link);
++ bb_perror_msg("can't create %slink '%s' to '%s'",
++ "hard", dst_name, hard_link
++ );
+ }
+ /* Hardlinks have no separate mode/ownership, skip chown/chmod */
+ goto ret;
+@@ -178,15 +177,17 @@ void FAST_FUNC data_extract_all(archive_handle_t *archive_handle)
+ case S_IFLNK:
+ /* Symlink */
+ //TODO: what if file_header->link_target == NULL (say, corrupted tarball?)
+- res = symlink(file_header->link_target, dst_name);
+- if (res != 0
+- && !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
+- ) {
+- /* shared message */
+- bb_perror_msg("can't create %slink "
+- "%s to %s", "sym",
+- dst_name,
+- file_header->link_target);
++ if (!unsafe_symlink_target(file_header->link_target)) {
++ res = symlink(file_header->link_target, dst_name);
++ if (res != 0
++ && !(archive_handle->ah_flags & ARCHIVE_EXTRACT_QUIET)
++ ) {
++ /* shared message */
++ bb_perror_msg("can't create %slink '%s' to '%s'",
++ "sym",
++ dst_name, file_header->link_target
++ );
++ }
+ }
+ break;
+ case S_IFSOCK:
+diff --git a/archival/libarchive/unsafe_symlink_target.c b/archival/libarchive/unsafe_symlink_target.c
+new file mode 100644
+index 0000000..ee46e28
+--- /dev/null
++++ b/archival/libarchive/unsafe_symlink_target.c
+@@ -0,0 +1,48 @@
++/* vi: set sw=4 ts=4: */
++/*
++ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
++ */
++#include "libbb.h"
++#include "bb_archive.h"
++
++int FAST_FUNC unsafe_symlink_target(const char *target)
++{
++ const char *dot;
++
++ if (target[0] == '/') {
++ const char *var;
++unsafe:
++ var = getenv("EXTRACT_UNSAFE_SYMLINKS");
++ if (var) {
++ if (LONE_CHAR(var, '1'))
++ return 0; /* pretend it's safe */
++ return 1; /* "UNSAFE!" */
++ }
++ bb_error_msg("skipping unsafe symlink to '%s' in archive,"
++ " set %s=1 to extract",
++ target,
++ "EXTRACT_UNSAFE_SYMLINKS"
++ );
++ /* Prevent further messages */
++ setenv("EXTRACT_UNSAFE_SYMLINKS", "0", 0);
++ return 1; /* "UNSAFE!" */
++ }
++
++ dot = target;
++ for (;;) {
++ dot = strchr(dot, '.');
++ if (!dot)
++ return 0; /* safe target */
++
++ /* Is it a path component starting with ".."? */
++ if ((dot[1] == '.')
++ && (dot == target || dot[-1] == '/')
++ /* Is it exactly ".."? */
++ && (dot[2] == '/' || dot[2] == '\0')
++ ) {
++ goto unsafe;
++ }
++ /* NB: it can even be trailing ".", should only add 1 */
++ dot += 1;
++ }
++}
+\ No newline at end of file
+diff --git a/archival/unzip.c b/archival/unzip.c
+index 9037262..270e261 100644
+--- a/archival/unzip.c
++++ b/archival/unzip.c
+@@ -335,6 +335,44 @@ static void unzip_create_leading_dirs(const char *fn)
+ free(name);
+ }
+
++static void unzip_extract_symlink(zip_header_t *zip, const char *dst_fn)
++{
++ char *target;
++
++ if (zip->fmt.ucmpsize > 0xfff) /* no funny business please */
++ bb_error_msg_and_die("bad archive");
++
++ if (zip->fmt.method == 0) {
++ /* Method 0 - stored (not compressed) */
++ target = xzalloc(zip->fmt.ucmpsize + 1);
++ xread(zip_fd, target, zip->fmt.ucmpsize);
++ } else {
++#if 1
++ bb_error_msg_and_die("compressed symlink is not supported");
++#else
++ transformer_state_t xstate;
++ init_transformer_state(&xstate);
++ xstate.mem_output_size_max = zip->fmt.ucmpsize;
++ /* ...unpack... */
++ if (!xstate.mem_output_buf)
++ WTF();
++ target = xstate.mem_output_buf;
++ target = xrealloc(target, xstate.mem_output_size + 1);
++ target[xstate.mem_output_size] = '\0';
++#endif
++ }
++ if (!unsafe_symlink_target(target)) {
++//TODO: libbb candidate
++ if (symlink(target, dst_fn)) {
++ /* shared message */
++ bb_perror_msg_and_die("can't create %slink '%s' to '%s'",
++ "sym", dst_fn, target
++ );
++ }
++ }
++ free(target);
++}
++
+ static void unzip_extract(zip_header_t *zip, int dst_fd)
+ {
+ transformer_state_t xstate;
+@@ -813,7 +851,7 @@ int unzip_main(int argc, char **argv)
+ }
+ check_file:
+ /* Extract file */
+- if (stat(dst_fn, &stat_buf) == -1) {
++ if (lstat(dst_fn, &stat_buf) == -1) {
+ /* File does not exist */
+ if (errno != ENOENT) {
+ bb_perror_msg_and_die("can't stat '%s'", dst_fn);
+@@ -834,6 +872,7 @@ int unzip_main(int argc, char **argv)
+ goto do_open_and_extract;
+ printf("replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", dst_fn);
+ my_fgets80(key_buf);
++//TODO: redo lstat + ISREG check! user input could have taken a long time!
+
+ switch (key_buf[0]) {
+ case 'A':
+@@ -842,7 +881,8 @@ int unzip_main(int argc, char **argv)
+ do_open_and_extract:
+ unzip_create_leading_dirs(dst_fn);
+ #if ENABLE_FEATURE_UNZIP_CDF
+- dst_fd = xopen3(dst_fn, O_WRONLY | O_CREAT | O_TRUNC, file_mode);
++ if (!S_ISLNK(file_mode))
++ dst_fd = xopen3(dst_fn, O_WRONLY | O_CREAT | O_TRUNC, file_mode);
+ #else
+ dst_fd = xopen(dst_fn, O_WRONLY | O_CREAT | O_TRUNC);
+ #endif
+@@ -852,10 +892,18 @@ int unzip_main(int argc, char **argv)
+ ? " extracting: %s\n"
+ : */ " inflating: %s\n", dst_fn);
+ }
+- unzip_extract(&zip, dst_fd);
+- if (dst_fd != STDOUT_FILENO) {
+- /* closing STDOUT is potentially bad for future business */
+- close(dst_fd);
++#if ENABLE_FEATURE_UNZIP_CDF
++ if (S_ISLNK(file_mode)) {
++ if (dst_fd != STDOUT_FILENO) /* no -p */
++ unzip_extract_symlink(&zip, dst_fn);
++ } else
++#endif
++ {
++ unzip_extract(&zip, dst_fd);
++ if (dst_fd != STDOUT_FILENO) {
++ /* closing STDOUT is potentially bad for future business */
++ close(dst_fd);
++ };
+ }
+ break;
+
+diff --git a/coreutils/link.c b/coreutils/link.c
+index ac3ef85..aab249d 100644
+--- a/coreutils/link.c
++++ b/coreutils/link.c
+@@ -32,9 +32,8 @@ int link_main(int argc UNUSED_PARAM, char **argv)
+ argv += optind;
+ if (link(argv[0], argv[1]) != 0) {
+ /* shared message */
+- bb_perror_msg_and_die("can't create %slink "
+- "%s to %s", "hard",
+- argv[1], argv[0]
++ bb_perror_msg_and_die("can't create %slink '%s' to '%s'",
++ "hard", argv[1], argv[0]
+ );
+ }
+ return EXIT_SUCCESS;
+diff --git a/include/bb_archive.h b/include/bb_archive.h
+index 2b9c5f0..1e4da3c 100644
+--- a/include/bb_archive.h
++++ b/include/bb_archive.h
+@@ -196,6 +196,7 @@ void seek_by_jump(int fd, off_t amount) FAST_FUNC;
+ void seek_by_read(int fd, off_t amount) FAST_FUNC;
+
+ const char *strip_unsafe_prefix(const char *str) FAST_FUNC;
++int unsafe_symlink_target(const char *target) FAST_FUNC;
+
+ void data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC;
+ const llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC;
+diff --git a/libbb/copy_file.c b/libbb/copy_file.c
+index 23c0f83..be90066 100644
+--- a/libbb/copy_file.c
++++ b/libbb/copy_file.c
+@@ -371,7 +371,10 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
+ int r = symlink(lpath, dest);
+ free(lpath);
+ if (r < 0) {
+- bb_perror_msg("can't create symlink '%s'", dest);
++ /* shared message */
++ bb_perror_msg("can't create %slink '%s' to '%s'",
++ "sym", dest, lpath
++ );
+ return -1;
+ }
+ if (flags & FILEUTILS_PRESERVE_STATUS)
+diff --git a/testsuite/tar.tests b/testsuite/tar.tests
+index 9f7ce15..b7cd74c 100755
+--- a/testsuite/tar.tests
++++ b/testsuite/tar.tests
+@@ -10,9 +10,6 @@ unset LC_COLLATE
+ unset LC_ALL
+ umask 022
+
+-rm -rf tar.tempdir 2>/dev/null
+-mkdir tar.tempdir && cd tar.tempdir || exit 1
+-
+ # testing "test name" "script" "expected result" "file input" "stdin"
+
+ testing "Empty file is not a tarball" '\
+@@ -53,6 +50,7 @@ dd if=/dev/zero bs=512 count=20 2>/dev/null | tar xvf - 2>&1; echo $?
+ "" ""
+ SKIP=
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # "tar cf test.tar input input_dir/ input_hard1 input_hard2 input_hard1 input_dir/ input":
+ # GNU tar 1.26 records as hardlinks:
+ # input_hard2 -> input_hard1
+@@ -64,7 +62,6 @@ SKIP=
+ # We also don't use "hrw-r--r--" notation for hardlinks in "tar tv" listing.
+ optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
+ testing "tar hardlinks and repeated files" '\
+-rm -rf input_* test.tar 2>/dev/null
+ >input_hard1
+ ln input_hard1 input_hard2
+ mkdir input_dir
+@@ -95,10 +92,11 @@ drwxr-xr-x input_dir
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
+ testing "tar hardlinks mode" '\
+-rm -rf input_* test.tar 2>/dev/null
+ >input_hard1
+ chmod 741 input_hard1
+ ln input_hard1 input_hard2
+@@ -128,10 +126,11 @@ Ok: 0
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ optional FEATURE_TAR_CREATE FEATURE_LS_SORTFILES
+ testing "tar symlinks mode" '\
+-rm -rf input_* test.tar 2>/dev/null
+ >input_file
+ chmod 741 input_file
+ ln -s input_file input_soft
+@@ -159,10 +158,11 @@ lrwxrwxrwx input_file
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ optional FEATURE_TAR_CREATE FEATURE_TAR_LONG_OPTIONS
+ testing "tar --overwrite" "\
+-rm -rf input_* test.tar 2>/dev/null
+ ln input input_hard
+ tar cf test.tar input_hard
+ echo WRONG >input
+@@ -174,12 +174,13 @@ Ok
+ " \
+ "Ok\n" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ test x"$SKIP_KNOWN_BUGS" = x"" && {
+ # Needs to be run under non-root for meaningful test
+ optional FEATURE_TAR_CREATE
+ testing "tar writing into read-only dir" '\
+-rm -rf input_* test.tar 2>/dev/null
+ mkdir input_dir
+ >input_dir/input_file
+ chmod 550 input_dir
+@@ -201,7 +202,9 @@ dr-xr-x--- input_dir
+ "" ""
+ SKIP=
+ }
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # Had a bug where on extract autodetect first "switched off" -z
+ # and then failed to recognize .tgz extension
+ optional FEATURE_TAR_CREATE FEATURE_SEAMLESS_GZ GUNZIP
+@@ -217,7 +220,9 @@ Ok
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # Do we detect XZ-compressed data (even w/o .tar.xz or txz extension)?
+ # (the uuencoded hello_world.txz contains one empty file named "hello_world")
+ optional UUDECODE FEATURE_TAR_AUTODETECT FEATURE_SEAMLESS_XZ
+@@ -236,7 +241,9 @@ AAAEWVo=
+ ====
+ "
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # On extract, everything up to and including last ".." component is stripped
+ optional FEATURE_TAR_CREATE
+ testing "tar strips /../ on extract" "\
+@@ -255,7 +262,9 @@ Ok
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # attack.tar.bz2 has symlink pointing to a system file
+ # followed by a regular file with the same name
+ # containing "root::0:0::/root:/bin/sh":
+@@ -270,6 +279,7 @@ optional UUDECODE FEATURE_TAR_AUTODETECT FEATURE_SEAMLESS_BZ2
+ testing "tar does not extract into symlinks" "\
+ >>/tmp/passwd && uudecode -o input && tar xf input 2>&1 && rm passwd; cat /tmp/passwd; echo \$?
+ " "\
++tar: skipping unsafe symlink to '/tmp/passwd' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract
+ 0
+ " \
+ "" "\
+@@ -281,12 +291,15 @@ l4/V8LDoe90yiWJhOJvIypgEfxdyRThQkBVn/bI=
+ ====
+ "
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
++
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ # And same with -k
+ optional UUDECODE FEATURE_TAR_AUTODETECT FEATURE_SEAMLESS_BZ2
+ testing "tar -k does not extract into symlinks" "\
+ >>/tmp/passwd && uudecode -o input && tar xf input -k 2>&1 && rm passwd; cat /tmp/passwd; echo \$?
+ " "\
+-tar: can't open 'passwd': File exists
++tar: skipping unsafe symlink to '/tmp/passwd' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract
+ 0
+ " \
+ "" "\
+@@ -298,7 +311,9 @@ l4/V8LDoe90yiWJhOJvIypgEfxdyRThQkBVn/bI=
+ ====
+ "
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
++mkdir tar.tempdir && cd tar.tempdir || exit 1
+ optional UNICODE_SUPPORT FEATURE_TAR_GNU_EXTENSIONS FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT
+ testing "Pax-encoded UTF8 names and symlinks" '\
+ tar xvf ../tar.utf8.tar.bz2 2>&1; echo $?
+@@ -309,17 +324,45 @@ rm -rf etc usr
+ ' "\
+ etc/ssl/certs/3b2716e5.0
+ etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
++tar: skipping unsafe symlink to '/usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract
+ etc/ssl/certs/f80cc7f6.0
+ usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt
+ 0
+ etc/ssl/certs/3b2716e5.0 -> EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
+-etc/ssl/certs/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem -> /usr/share/ca-certificates/mozilla/EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.crt
+ etc/ssl/certs/f80cc7f6.0 -> EBG_Elektronik_Sertifika_Hizmet_Sağlayıcısı.pem
+ " \
+ "" ""
+ SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
+-
+-cd .. && rm -rf tar.tempdir || exit 1
++mkdir tar.tempdir && cd tar.tempdir || exit 1
++optional UUDECODE FEATURE_SEAMLESS_BZ2 FEATURE_TAR_AUTODETECT
++testing "Symlink attack: create symlink and then write through it" '\
++exec 2>&1
++uudecode -o input && tar xvf input; echo $?
++ls /tmp/bb_test_evilfile
++ls bb_test_evilfile
++ls symlink/bb_test_evilfile
++' "\
++anything.txt
++symlink
++tar: skipping unsafe symlink to '/tmp' in archive, set EXTRACT_UNSAFE_SYMLINKS=1 to extract
++symlink/bb_test_evilfile
++0
++ls: /tmp/bb_test_evilfile: No such file or directory
++ls: bb_test_evilfile: No such file or directory
++symlink/bb_test_evilfile
++" \
++"" "\
++begin-base64 644 tar_symlink_attack.tar.bz2
++QlpoOTFBWSZTWZgs7bQAALT/hMmQAFBAAf+AEMAGJPPv32AAAIAIMAC5thlR
++omAjAmCMADQT1BqNE0AEwAAjAEwElTKeo9NTR6h6gaeoA0DQNLVdwZZ5iNTk
++AQwCAV6S00QFJYhrlfFkVCEDEGtgNVqYrI0uK3ggnt30gqk4e1TTQm5QIAKa
++SJqzRGSFLMmOloHSAcvLiFxxRiQtQZF+qPxbo173ZDISOAoNoPN4PQPhBhKS
++n8fYaKlioCTzL2oXYczyUUIP4u5IpwoSEwWdtoA=
++====
++"
++SKIP=
++cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
+
+ exit $FAILCOUNT
diff --git a/poky/meta/recipes-core/busybox/busybox/CVE-2017-15873.patch b/poky/meta/recipes-core/busybox/busybox/CVE-2017-15873.patch
new file mode 100644
index 000000000..5a027c9bc
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/CVE-2017-15873.patch
@@ -0,0 +1,95 @@
+busybox-1.27.2: Fix CVE-2017-15873
+
+[No upstream tracking] -- https://bugs.busybox.net/show_bug.cgi?id=10431
+
+bunzip2: fix runCnt overflow
+
+The get_next_block function in archival/libarchive/decompress_bunzip2.c
+in BusyBox 1.27.2 has an Integer Overflow that may lead to a write
+access violation.
+
+Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=0402cb32df015d9372578e3db27db47b33d5c7b0]
+CVE: CVE-2017-15873
+bug: 10431
+Signed-off-by: Radovan Scasny <radovan.scasny@siemens.com>
+
+diff --git a/archival/libarchive/decompress_bunzip2.c b/archival/libarchive/decompress_bunzip2.c
+index 7cd18f5..bec89ed 100644
+--- a/archival/libarchive/decompress_bunzip2.c
++++ b/archival/libarchive/decompress_bunzip2.c
+@@ -156,15 +156,15 @@ static unsigned get_bits(bunzip_data *bd, int bits_wanted)
+ static int get_next_block(bunzip_data *bd)
+ {
+ struct group_data *hufGroup;
+- int dbufCount, dbufSize, groupCount, *base, *limit, selector,
+- i, j, runPos, symCount, symTotal, nSelectors, byteCount[256];
+- int runCnt = runCnt; /* for compiler */
++ int groupCount, *base, *limit, selector,
++ i, j, symCount, symTotal, nSelectors, byteCount[256];
+ uint8_t uc, symToByte[256], mtfSymbol[256], *selectors;
+ uint32_t *dbuf;
+ unsigned origPtr, t;
++ unsigned dbufCount, runPos;
++ unsigned runCnt = runCnt; /* for compiler */
+
+ dbuf = bd->dbuf;
+- dbufSize = bd->dbufSize;
+ selectors = bd->selectors;
+
+ /* In bbox, we are ok with aborting through setjmp which is set up in start_bunzip */
+@@ -187,7 +187,7 @@ static int get_next_block(bunzip_data *bd)
+ it didn't actually work. */
+ if (get_bits(bd, 1)) return RETVAL_OBSOLETE_INPUT;
+ origPtr = get_bits(bd, 24);
+- if ((int)origPtr > dbufSize) return RETVAL_DATA_ERROR;
++ if (origPtr > bd->dbufSize) return RETVAL_DATA_ERROR;
+
+ /* mapping table: if some byte values are never used (encoding things
+ like ascii text), the compression code removes the gaps to have fewer
+@@ -435,7 +435,14 @@ static int get_next_block(bunzip_data *bd)
+ symbols, but a run of length 0 doesn't mean anything in this
+ context). Thus space is saved. */
+ runCnt += (runPos << nextSym); /* +runPos if RUNA; +2*runPos if RUNB */
+- if (runPos < dbufSize) runPos <<= 1;
++//The 32-bit overflow of runCnt wasn't yet seen, but probably can happen.
++//This would be the fix (catches too large count way before it can overflow):
++// if (runCnt > bd->dbufSize) {
++// dbg("runCnt:%u > dbufSize:%u RETVAL_DATA_ERROR",
++// runCnt, bd->dbufSize);
++// return RETVAL_DATA_ERROR;
++// }
++ if (runPos < bd->dbufSize) runPos <<= 1;
+ goto end_of_huffman_loop;
+ }
+
+@@ -445,14 +452,15 @@ static int get_next_block(bunzip_data *bd)
+ literal used is the one at the head of the mtfSymbol array.) */
+ if (runPos != 0) {
+ uint8_t tmp_byte;
+- if (dbufCount + runCnt > dbufSize) {
+- dbg("dbufCount:%d+runCnt:%d %d > dbufSize:%d RETVAL_DATA_ERROR",
+- dbufCount, runCnt, dbufCount + runCnt, dbufSize);
++ if (dbufCount + runCnt > bd->dbufSize) {
++ dbg("dbufCount:%u+runCnt:%u %u > dbufSize:%u RETVAL_DATA_ERROR",
++ dbufCount, runCnt, dbufCount + runCnt, bd->dbufSize);
+ return RETVAL_DATA_ERROR;
+ }
+ tmp_byte = symToByte[mtfSymbol[0]];
+ byteCount[tmp_byte] += runCnt;
+- while (--runCnt >= 0) dbuf[dbufCount++] = (uint32_t)tmp_byte;
++ while ((int)--runCnt >= 0)
++ dbuf[dbufCount++] = (uint32_t)tmp_byte;
+ runPos = 0;
+ }
+
+@@ -466,7 +474,7 @@ static int get_next_block(bunzip_data *bd)
+ first symbol in the mtf array, position 0, would have been handled
+ as part of a run above. Therefore 1 unused mtf position minus
+ 2 non-literal nextSym values equals -1.) */
+- if (dbufCount >= dbufSize) return RETVAL_DATA_ERROR;
++ if (dbufCount >= bd->dbufSize) return RETVAL_DATA_ERROR;
+ i = nextSym - 1;
+ uc = mtfSymbol[i];
+
+--
+cgit v0.12
diff --git a/poky/meta/recipes-core/busybox/busybox/busybox-CVE-2017-16544.patch b/poky/meta/recipes-core/busybox/busybox/busybox-CVE-2017-16544.patch
new file mode 100644
index 000000000..fc19ee335
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/busybox-CVE-2017-16544.patch
@@ -0,0 +1,43 @@
+From c3797d40a1c57352192c6106cc0f435e7d9c11e8 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Tue, 7 Nov 2017 18:09:29 +0100
+Subject: lineedit: do not tab-complete any strings which have control
+ characters
+
+function old new delta
+add_match 41 68 +27
+
+CVE: CVE-2017-16544
+Upstream-Status: Backport
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+---
+ libbb/lineedit.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/libbb/lineedit.c b/libbb/lineedit.c
+index c0e35bb..56e8140 100644
+--- a/libbb/lineedit.c
++++ b/libbb/lineedit.c
+@@ -645,6 +645,18 @@ static void free_tab_completion_data(void)
+
+ static void add_match(char *matched)
+ {
++ unsigned char *p = (unsigned char*)matched;
++ while (*p) {
++ /* ESC attack fix: drop any string with control chars */
++ if (*p < ' '
++ || (!ENABLE_UNICODE_SUPPORT && *p >= 0x7f)
++ || (ENABLE_UNICODE_SUPPORT && *p == 0x7f)
++ ) {
++ free(matched);
++ return;
++ }
++ p++;
++ }
+ matches = xrealloc_vector(matches, 4, num_matches);
+ matches[num_matches] = matched;
+ num_matches++;
+--
+cgit v0.12
diff --git a/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch b/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
new file mode 100644
index 000000000..6faca227f
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
@@ -0,0 +1,71 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sun, 3 Mar 2013 12:31:40 -0600
+Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses location
+
+Upstream-Status: Submitted
+
+[ based on: https://lkml.org/lkml/2013/3/3/103 ]
+
+This patch syncs up with the way the menuconfig ncurses / curses
+is detected and the HOST_EXTRACFLAGS works in the Linux kernel
+and it allows the menuconfig to work with a sysroot version
+of the curses libraries.
+
+---
+
+In some cross build environments such as the Yocto Project build
+environment it provides an ncurses library that is compiled
+differently than the host's version. This causes display corruption
+problems when the host's curses includes are used instead of the
+includes from the provided compiler are overridden. There is a second
+case where there is no curses libraries at all on the host system and
+menuconfig will just fail entirely.
+
+The solution is simply to allow an override variable in
+check-lxdialog.sh for environments such as the Yocto Project. Adding
+a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
+compiling and linking against the right headers and libraries.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+cc: Michal Marek <mmarek@suse.cz>
+cc: linux-kbuild@vger.kernel.org
+---
+ scripts/kconfig/lxdialog/Makefile | 2 +-
+ scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
+@@ -4,6 +4,10 @@
+ # What library to link
+ ldflags()
+ {
++ if [ x"$CROSS_CURSES_LIB" != x ]; then
++ echo "$CROSS_CURSES_LIB"
++ exit
++ fi
+ pkg-config --libs ncursesw 2>/dev/null && exit
+ pkg-config --libs ncurses 2>/dev/null && exit
+ for ext in so a dll.a dylib ; do
+@@ -21,6 +25,10 @@
+ # Where is ncurses.h?
+ ccflags()
+ {
++ if [ x"$CROSS_CURSES_INC" != x ]; then
++ echo "$CROSS_CURSES_INC"
++ exit
++ fi
+ if pkg-config --cflags ncursesw 2>/dev/null; then
+ echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
+ elif pkg-config --cflags ncurses 2>/dev/null; then
+--- a/scripts/kconfig/lxdialog/Makefile
++++ b/scripts/kconfig/lxdialog/Makefile
+@@ -5,7 +5,7 @@
+
+ # Use reursively expanded variables so we do not call gcc unless
+ # we really need to do so. (Do not call gcc as part of make mrproper)
+-HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
++HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
+ HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+
+ HOST_EXTRACFLAGS += -DLOCALE
diff --git a/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 000000000..582a25893
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -0,0 +1,137 @@
+From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Thu, 3 Nov 2011 08:51:31 +0100
+Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
+
+Upstream-Status: Pending
+
+Add a new option -D to the udhcpc client that allows for
+dhcp renewal to occur without having to down the interface
+in the process.
+
+Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
+
+Updated to latest Busybox 1.17.3
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Updated to Busybox 1.18.4
+option spec is changed
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+Updated to Busybox 1.19.3
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+
+Fixed options -b, -a and -P.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ networking/udhcp/dhcpc.c | 29 ++++++++++++++++------
+ 1 file changed, 21 insertions(+), 8 deletions(-)
+
+Index: busybox-1.27.2/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.27.2.orig/networking/udhcp/dhcpc.c
++++ busybox-1.27.2/networking/udhcp/dhcpc.c
+@@ -49,6 +49,8 @@ struct tpacket_auxdata {
+ };
+ #endif
+
++/* option whether to down the interface when reconfiguring */
++static int allow_deconfig = 1;
+
+ /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
+
+@@ -104,8 +106,9 @@ enum {
+ OPT_x = 1 << 18,
+ OPT_f = 1 << 19,
+ OPT_B = 1 << 20,
++ OPT_D = 1 << 21,
+ /* The rest has variable bit positions, need to be clever */
+- OPTBIT_B = 20,
++ OPTBIT_D = 21,
+ USE_FOR_MMU( OPTBIT_b,)
+ IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
+ IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
+@@ -1110,7 +1113,8 @@ static void perform_renew(void)
+ state = RENEW_REQUESTED;
+ break;
+ case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ case REQUESTING:
+ case RELEASED:
+ change_listen_mode(LISTEN_RAW);
+@@ -1146,7 +1150,8 @@ static void perform_release(uint32_t server_addr, uint32_t requested_ip)
+ * Users requested to be notified in all cases, even if not in one
+ * of the states above.
+ */
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+
+ change_listen_mode(LISTEN_NONE);
+ state = RELEASED;
+@@ -1298,7 +1303,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ /* O,x: list; -T,-t,-A take numeric param */
+ IF_UDHCP_VERBOSE(opt_complementary = "vv";)
+ IF_LONG_OPTS(applet_long_options = udhcpc_longopts;)
+- opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fB"
++ opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fBD"
+ USE_FOR_MMU("b")
+ IF_FEATURE_UDHCPC_ARPING("a::")
+ IF_FEATURE_UDHCP_PORT("P:")
+@@ -1409,6 +1414,10 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ logmode |= LOGMODE_SYSLOG;
+ }
+
++ if (opt & OPT_D) {
++ allow_deconfig = 0;
++ }
++
+ /* Make sure fd 0,1,2 are open */
+ bb_sanitize_stdio();
+ /* Equivalent of doing a fflush after every \n */
+@@ -1423,7 +1432,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ srand(monotonic_us());
+
+ state = INIT_SELECTING;
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ change_listen_mode(LISTEN_RAW);
+ packet_num = 0;
+ timeout = 0;
+@@ -1577,7 +1587,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ }
+ /* Timed out, enter init state */
+ bb_error_msg("lease lost, entering init state");
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ state = INIT_SELECTING;
+ client_config.first_secs = 0; /* make secs field count from 0 */
+ /*timeout = 0; - already is */
+@@ -1770,7 +1781,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ send_decline(/*xid,*/ server_addr, packet.yiaddr);
+
+ if (state != REQUESTING)
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ change_listen_mode(LISTEN_RAW);
+ state = INIT_SELECTING;
+ client_config.first_secs = 0; /* make secs field count from 0 */
+@@ -1840,7 +1852,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ bb_error_msg("received %s", "DHCP NAK");
+ udhcp_run_script(&packet, "nak");
+ if (state != REQUESTING)
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ change_listen_mode(LISTEN_RAW);
+ sleep(3); /* avoid excessive network traffic */
+ state = INIT_SELECTING;
diff --git a/poky/meta/recipes-core/busybox/busybox/defconfig b/poky/meta/recipes-core/busybox/busybox/defconfig
new file mode 100644
index 000000000..fbb5fd852
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/defconfig
@@ -0,0 +1,1149 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.27.2
+# Wed Sep 27 08:56:13 2017
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_FEDORA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+CONFIG_FEATURE_COMPRESS_USAGE=y
+CONFIG_BUSYBOX=y
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_PAM is not set
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+CONFIG_FEATURE_PIDFILE=y
+CONFIG_PID_FILE_PATH="/var/run"
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SUID_CONFIG=y
+CONFIG_FEATURE_SUID_CONFIG_QUIET=y
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+CONFIG_FEATURE_SYSLOG=y
+# CONFIG_FEATURE_HAVE_RPC is not set
+CONFIG_PLATFORM_LINUX=y
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS=""
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_DEBUG_SANITIZE is not set
+# CONFIG_UNIT_TEST is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Busybox Library Tuning
+#
+# CONFIG_FEATURE_USE_BSS_TAIL is not set
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_SHA3_SMALL=1
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+CONFIG_FEATURE_USERNAME_COMPLETION=y
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+CONFIG_FEATURE_SEAMLESS_XZ=y
+CONFIG_FEATURE_SEAMLESS_LZMA=y
+CONFIG_FEATURE_SEAMLESS_BZ2=y
+CONFIG_FEATURE_SEAMLESS_GZ=y
+CONFIG_FEATURE_SEAMLESS_Z=y
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_UNCOMPRESS is not set
+CONFIG_GUNZIP=y
+CONFIG_ZCAT=y
+CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y
+CONFIG_BUNZIP2=y
+CONFIG_BZCAT=y
+# CONFIG_UNLZMA is not set
+CONFIG_LZCAT=y
+# CONFIG_LZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_UNXZ is not set
+CONFIG_XZCAT=y
+# CONFIG_XZ is not set
+# CONFIG_BZIP2 is not set
+CONFIG_FEATURE_BZIP2_DECOMPRESS=y
+CONFIG_CPIO=y
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_FEATURE_GZIP_LEVELS is not set
+CONFIG_FEATURE_GZIP_DECOMPRESS=y
+# CONFIG_LZOP is not set
+# CONFIG_UNLZOP is not set
+# CONFIG_LZOPCAT is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
+CONFIG_TAR=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_AUTODETECT=y
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
+# CONFIG_FEATURE_TAR_SELINUX is not set
+CONFIG_UNZIP=y
+CONFIG_FEATURE_UNZIP_CDF=y
+# CONFIG_FEATURE_UNZIP_BZIP2 is not set
+# CONFIG_FEATURE_UNZIP_LZMA is not set
+# CONFIG_FEATURE_UNZIP_XZ is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+# CONFIG_FEATURE_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+# CONFIG_FEATURE_DD_STATUS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+# CONFIG_FACTOR is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+CONFIG_GROUPS=y
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+# CONFIG_LINK is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_WIDTH=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+# CONFIG_SHA3SUM is not set
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MKTEMP=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+# CONFIG_NL is not set
+CONFIG_NOHUP=y
+CONFIG_NPROC=y
+CONFIG_OD=y
+# CONFIG_PASTE is not set
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+# CONFIG_SHRED is not set
+CONFIG_SHUF=y
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_FEATURE_FLOAT_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_FEATURE_STAT_FILESYSTEM=y
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+# CONFIG_FEATURE_SYNC_FANCY is not set
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TEST=y
+CONFIG_TEST1=y
+CONFIG_TEST2=y
+CONFIG_FEATURE_TEST_64=y
+# CONFIG_TIMEOUT is not set
+CONFIG_TOUCH=y
+CONFIG_FEATURE_TOUCH_NODEREF=y
+CONFIG_FEATURE_TOUCH_SUSV3=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+# CONFIG_TRUNCATE is not set
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNAME_OSNAME="GNU/Linux"
+CONFIG_UNIQ=y
+CONFIG_UNLINK=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_BASE64 is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHO=y
+# CONFIG_W is not set
+CONFIG_USERS=y
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+# CONFIG_FGCONSOLE is not set
+# CONFIG_KBD_MODE is not set
+CONFIG_LOADFONT=y
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+
+#
+# Common options for loadfont and setfont
+#
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_RUN_PARTS=y
+CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_LIBM=y
+CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y
+CONFIG_CMP=y
+CONFIG_DIFF=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_ED is not set
+CONFIG_PATCH=y
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=1024
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+CONFIG_FEATURE_VI_UNDO=y
+CONFIG_FEATURE_VI_UNDO_QUEUE=y
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_MAXDEPTH=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_EXEC_PLUS=y
+CONFIG_FEATURE_FIND_USER=y
+CONFIG_FEATURE_FIND_GROUP=y
+CONFIG_FEATURE_FIND_NOT=y
+CONFIG_FEATURE_FIND_DEPTH=y
+CONFIG_FEATURE_FIND_PAREN=y
+CONFIG_FEATURE_FIND_SIZE=y
+CONFIG_FEATURE_FIND_PRUNE=y
+# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_PATH=y
+CONFIG_FEATURE_FIND_REGEX=y
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_EGREP=y
+CONFIG_FGREP=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+CONFIG_POWEROFF=y
+CONFIG_REBOOT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_LINUXRC is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_INIT_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=60000
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# CONFIG_CRYPTPW is not set
+# CONFIG_MKPASSWD is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODPROBE_SMALL is not set
+CONFIG_DEPMOD=y
+CONFIG_INSMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_MODINFO is not set
+CONFIG_MODPROBE=y
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+CONFIG_RMMOD=y
+
+#
+# Options common to multiple modutils
+#
+CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS=y
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
+CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
+CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
+
+#
+# Linux System Utilities
+#
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKDISCARD is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+# CONFIG_BLOCKDEV is not set
+# CONFIG_CAL is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+# CONFIG_FALLOCATE is not set
+# CONFIG_FATATTR is not set
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+CONFIG_FLOCK=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_FSFREEZE is not set
+CONFIG_FSTRIM=y
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+# CONFIG_XXD is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_MESG=y
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+# CONFIG_MKE2FS is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKDOSFS is not set
+# CONFIG_MKFS_VFAT is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+# CONFIG_FEATURE_MOUNT_OTHERTAB is not set
+# CONFIG_NSENTER is not set
+# CONFIG_FEATURE_NSENTER_LONG_OPTS is not set
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+CONFIG_RENICE=y
+# CONFIG_REV is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_LINUX32 is not set
+# CONFIG_LINUX64 is not set
+# CONFIG_SETPRIV is not set
+CONFIG_SWAPON=y
+CONFIG_FEATURE_SWAPON_DISCARD=y
+CONFIG_FEATURE_SWAPON_PRI=y
+CONFIG_SWAPOFF=y
+CONFIG_SWITCH_ROOT=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_UEVENT is not set
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+# CONFIG_UNSHARE is not set
+# CONFIG_WALL is not set
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_BCACHE is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_F2FS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_NILFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_UBIFS is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_I2CGET is not set
+# CONFIG_I2CSET is not set
+# CONFIG_I2CDUMP is not set
+# CONFIG_I2CDETECT is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_TRUNCATE is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_LSSCSI is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_PARTPROBE is not set
+CONFIG_RFKILL=y
+# CONFIG_SETSERIAL is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_UBIRENAME is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+CONFIG_MICROCOM=y
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+CONFIG_STRINGS=y
+CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTPD_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+CONFIG_DNSDOMAINNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+CONFIG_IFUP=y
+CONFIG_IFDOWN=y
+CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+CONFIG_FEATURE_IFUPDOWN_IP=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPNEIGH is not set
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2"
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_NEIGH is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_NETSTAT=y
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_SSL_CLIENT is not set
+# CONFIG_TCPSVD is not set
+# CONFIG_UDPSVD is not set
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+CONFIG_FEATURE_TELNET_WIDTH=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+CONFIG_TFTP=y
+# CONFIG_TFTPD is not set
+
+#
+# Common options for tftp/tftpd
+#
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+CONFIG_TLS=y
+CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+CONFIG_FEATURE_WGET_HTTPS=y
+# CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_WHOIS is not set
+# CONFIG_ZCIP is not set
+# CONFIG_UDHCPC6 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set
+CONFIG_UDHCPD=y
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
+CONFIG_DUMPLEASES=y
+# CONFIG_DHCPRELAY is not set
+CONFIG_UDHCPC=y
+CONFIG_FEATURE_UDHCPC_ARPING=y
+CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
+CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+
+#
+# Process Utilities
+#
+CONFIG_FREE=y
+CONFIG_FUSER=y
+# CONFIG_IOSTAT is not set
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PGREP is not set
+# CONFIG_PKILL is not set
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_FEATURE_PS_LONG=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+# CONFIG_FEATURE_TOP_INTERACTIVE is not set
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+CONFIG_UPTIME=y
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+CONFIG_WATCH=y
+# CONFIG_FEATURE_SHOW_THREADS is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVC is not set
+# CONFIG_SVLOGD is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SESTATUS is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_SETSEBOOL is not set
+
+#
+# Shells
+#
+CONFIG_SH_IS_ASH=y
+# CONFIG_SH_IS_HUSH is not set
+# CONFIG_SH_IS_NONE is not set
+# CONFIG_BASH_IS_ASH is not set
+# CONFIG_BASH_IS_HUSH is not set
+CONFIG_BASH_IS_NONE=y
+CONFIG_ASH=y
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+CONFIG_ASH_INTERNAL_GLOB=y
+CONFIG_ASH_BASH_COMPAT=y
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_ECHO=y
+CONFIG_ASH_PRINTF=y
+CONFIG_ASH_TEST=y
+CONFIG_ASH_HELP=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_CMDCMD=y
+# CONFIG_CTTYHACK is not set
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_HUSH_ECHO is not set
+# CONFIG_HUSH_PRINTF is not set
+# CONFIG_HUSH_TEST is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_EXPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_KILL is not set
+# CONFIG_HUSH_WAIT is not set
+# CONFIG_HUSH_TRAP is not set
+# CONFIG_HUSH_TYPE is not set
+# CONFIG_HUSH_READ is not set
+# CONFIG_HUSH_SET is not set
+# CONFIG_HUSH_UNSET is not set
+# CONFIG_HUSH_ULIMIT is not set
+# CONFIG_HUSH_UMASK is not set
+# CONFIG_HUSH_MEMLEAK is not set
+# CONFIG_MSH is not set
+
+#
+# Options common to all shells
+#
+CONFIG_FEATURE_SH_MATH=y
+# CONFIG_FEATURE_SH_MATH_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+CONFIG_FEATURE_SH_HISTFILESIZE=y
+
+#
+# System Logging Utilities
+#
+CONFIG_KLOGD=y
+CONFIG_FEATURE_KLOGD_KLOGCTL=y
+CONFIG_LOGGER=y
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+# CONFIG_FEATURE_SYSLOGD_CFG is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_FEATURE_KMSG_SYSLOG is not set
diff --git a/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
new file mode 100644
index 000000000..820acc268
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Denied
+[https://www.mail-archive.com/busybox@busybox.net/msg22354.html]
+
+The current behaviour of busybox is to try all fstype when automounting
+even when no media exists. The util-linux mount command bails when no
+media exists, so change the behaviour of busybox to do the same.
+
+It could also be argued that the KERN_INFO message from btrfs could be
+removed, but that would be harder to accomplish.
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: busybox-1.20.2/util-linux/mount.c
+===================================================================
+--- busybox-1.20.2.orig/util-linux/mount.c
++++ busybox-1.20.2/util-linux/mount.c
+@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
+ break;
+ errno = errno_save;
+ }
+-
++ /*
++ * Break if there is no media, no point retrying for all
++ * fs types since there is no media available
++ */
++ if (rc == -1 && errno == ENOMEDIUM) {
++ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
++ }
+ if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
+ break;
+ if (!(vfsflags & MS_SILENT))
diff --git a/poky/meta/recipes-core/busybox/busybox/getopts.cfg b/poky/meta/recipes-core/busybox/busybox/getopts.cfg
new file mode 100644
index 000000000..8db0a4a8f
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/getopts.cfg
@@ -0,0 +1,3 @@
+CONFIG_GETOPT=y
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_GETOPT_LONG=y
diff --git a/poky/meta/recipes-core/busybox/busybox/init.cfg b/poky/meta/recipes-core/busybox/busybox/init.cfg
new file mode 100644
index 000000000..006d4c633
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/init.cfg
@@ -0,0 +1,3 @@
+CONFIG_INIT=y
+CONFIG_FEATURE_USE_INITTAB=y
+
diff --git a/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg b/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg
new file mode 100644
index 000000000..cc9b2db50
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg
@@ -0,0 +1,13 @@
+CONFIG_FEATURE_SHADOWPASSWDS=y
+CONFIG_ADDUSER=y
+CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
+CONFIG_ADDGROUP=y
+CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y
+CONFIG_DELUSER=y
+CONFIG_DELGROUP=y
+CONFIG_GETTY=y
+CONFIG_LOGIN=y
+CONFIG_PASSWD=y
+CONFIG_SU=y
+CONFIG_SULOGIN=y
+CONFIG_VLOCK=y
diff --git a/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch b/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch
new file mode 100644
index 000000000..97278ab97
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch
@@ -0,0 +1,34 @@
+There is a potential race when building libbb, as some header files
+needed by libbb are not generated yet (or are being modified) at the time
+libbb is compiled.
+This patch avoids this scenario by building libbb as the last directory.
+
+Upstream-Status: Submitted
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Index: busybox-1.24.1/Makefile
+===================================================================
+diff --git a/Makefile b/Makefile
+index 5cfc763..69f3831 100644
+--- a/Makefile
++++ b/Makefile
+@@ -738,9 +738,18 @@ $(sort $(busybox-all)): $(busybox-dirs) ;
+ # Error messages still appears in the original language
+
+ PHONY += $(busybox-dirs)
+-$(busybox-dirs): prepare scripts
++
++libbb-dir = $(filter libbb,$(busybox-dirs))
++busybox-dirs1 = $(filter-out libbb,$(busybox-dirs))
++
++$(busybox-dirs1): prepare scripts
+ $(Q)$(MAKE) $(build)=$@
+
++ifneq ($(libbb-dir),)
++$(libbb-dir): | $(busybox-dirs1)
++ $(Q)$(MAKE) $(build)=$@
++endif
++
+ # Build the kernel release string
+ # The KERNELRELEASE is stored in a file named .kernelrelease
+ # to be used when executing for example make install or make modules_install
diff --git a/poky/meta/recipes-core/busybox/busybox/mdev.cfg b/poky/meta/recipes-core/busybox/busybox/mdev.cfg
new file mode 100644
index 000000000..6aefe90e4
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/mdev.cfg
@@ -0,0 +1,11 @@
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
+
+CONFIG_SETSID=y
+CONFIG_CTTYHACK=y
+
+CONFIG_FEATURE_SHADOWPASSWDS=y
diff --git a/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg b/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg
new file mode 100644
index 000000000..2fe7ab2e5
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg
@@ -0,0 +1,9 @@
+CONFIG_BLKID=y
+CONFIG_FEATURE_BLKID_TYPE=y
+CONFIG_FEATURE_MOUNT_LABEL=y
+CONFIG_VOLUMEID=y
+CONFIG_FEATURE_VOLUMEID_BTRFS=y
+CONFIG_FEATURE_VOLUMEID_EXT=y
+CONFIG_FEATURE_VOLUMEID_F2FS=y
+CONFIG_FEATURE_VOLUMEID_FAT=y
+CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
diff --git a/poky/meta/recipes-core/busybox/busybox/musl.cfg b/poky/meta/recipes-core/busybox/busybox/musl.cfg
new file mode 100644
index 000000000..6fffc9109
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/musl.cfg
@@ -0,0 +1,11 @@
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_HAVE_RPC is not set
+# CONFIG_WERROR is not set
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+# CONFIG_PAM is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_UTMP is not set
+
diff --git a/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch b/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch
new file mode 100644
index 000000000..f42c74caa
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch
@@ -0,0 +1,21 @@
+This adds connmand to the list of know dhcp clients
+
+Upstream-Status: Inappropriate [OE-Core]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: busybox-1.22.1/networking/ifupdown.c
+===================================================================
+--- busybox-1.22.1.orig/networking/ifupdown.c
++++ busybox-1.22.1/networking/ifupdown.c
+@@ -521,6 +521,10 @@ struct dhcp_client_t {
+ };
+
+ static const struct dhcp_client_t ext_dhcp_clients[] = {
++ { "connmand",
++ "true",
++ "true",
++ },
+ { "dhcpcd",
+ "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%",
+ "dhcpcd -k %iface%",
diff --git a/poky/meta/recipes-core/busybox/busybox/resize.cfg b/poky/meta/recipes-core/busybox/busybox/resize.cfg
new file mode 100644
index 000000000..a1d9c95b2
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/resize.cfg
@@ -0,0 +1,2 @@
+CONFIG_RESIZE=y
+CONFIG_FEATURE_RESIZE_PRINT=y
diff --git a/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg b/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
new file mode 100644
index 000000000..20e72d926
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA1SUM=y
diff --git a/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg b/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
new file mode 100644
index 000000000..ce652ae4c
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA256SUM=y
diff --git a/poky/meta/recipes-core/busybox/busybox/syslog.cfg b/poky/meta/recipes-core/busybox/busybox/syslog.cfg
new file mode 100644
index 000000000..e2425ed80
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox/syslog.cfg
@@ -0,0 +1,11 @@
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_SYSLOGD_DUP=y
+CONFIG_FEATURE_SYSLOGD_CFG=y
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_FEATURE_KMSG_SYSLOG=y
diff --git a/poky/meta/recipes-core/busybox/busybox_1.27.2.bb b/poky/meta/recipes-core/busybox/busybox_1.27.2.bb
new file mode 100644
index 000000000..36a6342aa
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/busybox_1.27.2.bb
@@ -0,0 +1,52 @@
+require busybox.inc
+
+SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
+ file://busybox-udhcpc-no_deconfig.patch \
+ file://find-touchscreen.sh \
+ file://busybox-cron \
+ file://busybox-httpd \
+ file://busybox-udhcpd \
+ file://default.script \
+ file://simple.script \
+ file://hwclock.sh \
+ file://mount.busybox \
+ file://syslog \
+ file://syslog-startup.conf \
+ file://syslog.conf \
+ file://busybox-syslog.default \
+ file://mdev \
+ file://mdev.conf \
+ file://mdev-mount.sh \
+ file://umount.busybox \
+ file://defconfig \
+ file://busybox-syslog.service.in \
+ file://busybox-klogd.service.in \
+ file://fail_on_no_media.patch \
+ file://run-ptest \
+ file://inetd.conf \
+ file://inetd \
+ file://login-utilities.cfg \
+ file://recognize_connmand.patch \
+ file://busybox-cross-menuconfig.patch \
+ file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
+ file://mount-via-label.cfg \
+ file://sha1sum.cfg \
+ file://sha256sum.cfg \
+ file://getopts.cfg \
+ file://resize.cfg \
+ ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]} \
+ ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager') == 'busybox-mdev')]} \
+ file://syslog.cfg \
+ file://inittab \
+ file://rcS \
+ file://rcK \
+ file://runlevel \
+ file://makefile-libbb-race.patch \
+ file://CVE-2011-5325.patch \
+ file://CVE-2017-15873.patch \
+ file://busybox-CVE-2017-16544.patch \
+"
+SRC_URI_append_libc-musl = " file://musl.cfg "
+
+SRC_URI[tarball.md5sum] = "476186f4bab81781dab2369bfd42734e"
+SRC_URI[tarball.sha256sum] = "9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df"
diff --git a/poky/meta/recipes-core/busybox/files/busybox-cron b/poky/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 000000000..f0e6b1562
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/usr/sbin/crond
+NAME=crond
+DESC="Busybox Periodic Command Scheduler"
+ARGS="-c /etc/cron/crontabs"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo -n "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/busybox/files/busybox-httpd b/poky/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 000000000..c8348e54a
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
+#!/bin/sh
+DAEMON=/usr/sbin/httpd
+NAME=httpd
+DESC="Busybox HTTP Daemon"
+HTTPROOT="/srv/www"
+ARGS="-h $HTTPROOT"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -d $HTTPROOT ]; then
+ echo "$HTTPROOT is missing."
+ exit 1
+ fi
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in b/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in
new file mode 100644
index 000000000..d7c77558f
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Kernel Logging Service
+
+[Service]
+ExecStart=@base_sbindir@/klogd -n
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-core/busybox/files/busybox-syslog.default b/poky/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 000000000..2dced8023
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-syslog.default
@@ -0,0 +1,25 @@
+#OPTIONS="-C"
+# The above option means syslogd will log to 16K shm circular buffer.
+# You could use `logread' to read it.
+
+# All available options are:
+# -O FILE : Log to FILE (default:/var/log/messages)
+# -l N : Log only messages more urgent than prio N (1-8)
+# -S : Smaller output
+# -s SIZE : Max size (KB) before rotation (default:200KB, 0=off)
+# -b N : N rotated logs to keep (default:1, max=99, 0=purge)
+# -R HOST[:PORT]: Log to HOST:PORT (default PORT:514)
+# -L : Log locally and via network
+# -D : Drop duplicates
+# -C[size_kb] : Log to shared mem buffer (use logread to read it)
+# -f FILE : Use FILE as config (default:/etc/syslog.conf)
+# -m MIN : Minutes between mark lines (default:20, 0=off)
+# -K : Log to kernel printk buffer (use dmesg to read it)
+
+# Example 1:
+# Log to local file /var/log/mylog
+# OPTIONS="-O /var/log/mylog"
+#
+# Example 2:
+# Log to remote host
+# OPTIONS="-R 192.168.1.1:601"
diff --git a/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in b/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in
new file mode 100644
index 000000000..2e0432138
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logging Service
+Wants=busybox-klogd.service
+
+[Service]
+EnvironmentFile=-/etc/default/busybox-syslog
+ExecStart=@base_sbindir@/syslogd -n $OPTIONS
+Sockets=syslog.socket
+
+[Install]
+WantedBy=multi-user.target
+Also=busybox-klogd.service
+Alias=syslog.service
diff --git a/poky/meta/recipes-core/busybox/files/busybox-udhcpd b/poky/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 000000000..c43903e8d
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
+#!/bin/sh
+DAEMON=/usr/sbin/udhcpd
+NAME=udhcpd
+DESC="Busybox UDHCP Server"
+ARGS="/etc/udhcpd.conf"
+
+test -f $DAEMON || exit 1
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -f /etc/udhcpd.conf ]; then
+ echo "error: /etc/udhcpd.conf is missing."
+ exit 1
+ fi
+ /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ /sbin/start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/busybox/files/default.script b/poky/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 000000000..f2ac987a2
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec run-parts -a "$1" /etc/udhcpc.d
+
diff --git a/poky/meta/recipes-core/busybox/files/find-touchscreen.sh b/poky/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 000000000..52c5e7a09
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/find-touchscreen.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if grep -q "input:.*-e0.*,3,.*a0,1,\|ads7846" /sys/class/$MDEV/device/modalias ; then
+ ln -sf /dev/$MDEV /dev/input/touchscreen0
+fi
+
diff --git a/poky/meta/recipes-core/busybox/files/hwclock.sh b/poky/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 000000000..be5f94d86
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hwclock
+# Required-Start:
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Set system clock
+# Description: Set system clock to hardware clock, according to the UTC
+# setting in /etc/default/rcS (see also rcS(5)).
+### END INIT INFO
+#
+# WARNING: If your hardware clock is not in UTC/GMT, this script
+# must know the local time zone. This information is
+# stored in /etc/localtime. This might be a problem if
+# your /etc/localtime is a symlink to something in
+# /usr/share/zoneinfo AND /usr isn't in the root
+# partition! The workaround is to define TZ either
+# in /etc/default/rcS, or in the proper place below.
+
+[ ! -x /sbin/hwclock ] && exit 0
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime"
+case "$1" in
+ start)
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System time was `date`."
+ echo "Setting the System Clock using the Hardware Clock as reference..."
+ fi
+
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ if [ -z "$TZ" ]
+ then
+ hwclock $tz --hctosys
+ else
+ TZ="$TZ" hwclock $tz --hctosys
+ fi
+ fi
+
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System Clock set. System local time is now `date`."
+ fi
+ ;;
+ stop|restart|reload|force-reload)
+ #
+ # Updates the Hardware Clock with the System Clock time.
+ # This will *override* any changes made to the Hardware Clock.
+ #
+ # WARNING: If you disable this, any changes to the system
+ # clock will not be carried across reboots.
+ #
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Saving the System Clock time to the Hardware Clock..."
+ fi
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock $tz --systohc
+ fi
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Hardware Clock updated to `date`."
+ fi
+ exit 0
+ ;;
+ show)
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock $tz --show
+ fi
+ ;;
+ *)
+ echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
+ echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
+ echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
+ exit 1
+ ;;
+esac
diff --git a/poky/meta/recipes-core/busybox/files/inetd b/poky/meta/recipes-core/busybox/files/inetd
new file mode 100644
index 000000000..cf50bcd54
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/inetd
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# start/stop inetd super server.
+
+if ! [ -x /usr/sbin/inetd ]; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ restart)
+ echo -n "Restarting internet superserver:"
+ echo -n " inetd "
+ killall -HUP inetd
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/inetd {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-core/busybox/files/inetd.conf b/poky/meta/recipes-core/busybox/files/inetd.conf
new file mode 100644
index 000000000..b02fe850c
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/inetd.conf
@@ -0,0 +1,20 @@
+# /etc/inetd.conf: see inetd(8) for further informations.
+#
+# Internet server configuration database
+#
+# If you want to disable an entry so it isn't touched during
+# package updates just comment it out with a single '#' character.
+#
+# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
+#
+#:INTERNAL: Internal services
+#echo stream tcp nowait root internal
+#echo dgram udp wait root internal
+#chargen stream tcp nowait root internal
+#chargen dgram udp wait root internal
+#discard stream tcp nowait root internal
+#discard dgram udp wait root internal
+#daytime stream tcp nowait root internal
+#daytime dgram udp wait root internal
+#time stream tcp nowait root internal
+#time dgram udp wait root internal
diff --git a/poky/meta/recipes-core/busybox/files/inittab b/poky/meta/recipes-core/busybox/files/inittab
new file mode 100644
index 000000000..2bc831c7c
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/inittab
@@ -0,0 +1,24 @@
+# This is run first except when booting in single-user mode.
+
+# Startup the system
+::sysinit:/bin/mount -t proc proc /proc
+::sysinit:/bin/mount -t sysfs sysfs /sys
+::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+::sysinit:/bin/mount -o remount,rw /
+::sysinit:/bin/mkdir -p /dev/pts
+::sysinit:/bin/mount -t devpts devpts /dev/pts
+::sysinit:/bin/mount -a
+
+::sysinit:/etc/init.d/rcS
+
+# Stuff to do before rebooting
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rcK
+::shutdown:/sbin/swapoff -a
+::shutdown:/bin/umount -a -r
+
+# Stuff to do when restarting the init process
+::restart:/sbin/init
+
+# set hostname
+null::sysinit:/bin/busybox hostname -F /etc/hostname
diff --git a/poky/meta/recipes-core/busybox/files/mdev b/poky/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 000000000..8c9c06e96
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,21 @@
+#!/bin/sh
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t tmpfs tmpfs /dev -o size=64k,mode=0755
+mkdir /dev/pts /dev/shm
+chmod 777 /dev/shm
+mount -t devpts devpts /dev/pts
+touch /dev/mdev.seq
+#sysctl -w kernel.hotplug=/sbin/mdev
+echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+mdev -s
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+ rm -f /dev/initctl
+ mknod -m 600 /dev/initctl p
+fi
+
diff --git a/poky/meta/recipes-core/busybox/files/mdev-mount.sh b/poky/meta/recipes-core/busybox/files/mdev-mount.sh
new file mode 100644
index 000000000..b4385a157
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/mdev-mount.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+MDEV_AUTOMOUNT=y
+MDEV_AUTOMOUNT_ROOT=/run/media
+[ -f /etc/default/mdev ] && . /etc/default/mdev
+if [ "${MDEV_AUTOMOUNT}" = "n" ] ; then
+ exit 0
+fi
+
+case "$ACTION" in
+ add|"")
+ ACTION="add"
+ # check if already mounted
+ if grep -q "^/dev/${MDEV} " /proc/mounts ; then
+ # Already mounted
+ exit 0
+ fi
+ DEVBASE=`expr substr $MDEV 1 3`
+ if [ "${DEVBASE}" = "mmc" ] ; then
+ DEVBASE=`expr substr $MDEV 1 7`
+ fi
+ # check for "please don't mount it" file
+ if [ -f "/dev/nomount.${DEVBASE}" ] ; then
+ # blocked
+ exit 0
+ fi
+ # check for full-disk partition
+ if [ "${DEVBASE}" = "${MDEV}" ] ; then
+ if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then
+ # Partition detected, just quit
+ exit 0
+ fi
+ if [ ! -f /sys/block/${DEVBASE}/size ] ; then
+ # No size at all
+ exit 0
+ fi
+ if [ "`cat /sys/block/${DEVBASE}/size`" = "0" ] ; then
+ # empty device, bail out
+ exit 0
+ fi
+ fi
+ # first allow fstab to determine the mountpoint
+ if ! mount /dev/$MDEV > /dev/null 2>&1
+ then
+ MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
+ mkdir -p "$MOUNTPOINT"
+ mount -t auto /dev/$MDEV "$MOUNTPOINT"
+ fi
+ ;;
+ remove)
+ MOUNTPOINT=`grep "^/dev/$MDEV\s" /proc/mounts | cut -d' ' -f 2`
+ if [ ! -z "$MOUNTPOINT" ]
+ then
+ umount "$MOUNTPOINT"
+ rmdir "$MOUNTPOINT"
+ else
+ umount /dev/$MDEV
+ fi
+ ;;
+ *)
+ # Unexpected keyword
+ exit 1
+ ;;
+esac
diff --git a/poky/meta/recipes-core/busybox/files/mdev.conf b/poky/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 000000000..4e9c23f14
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,44 @@
+$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
+
+console 0:0 0600
+cpu_dma_latency 0:0 0660
+fb0:0 44 0660
+full 0:0 0666
+initctl 0:0 0600
+ircomm[0-9].* 0:20 0660
+kmem 0:15 0640
+kmsg 0:0 0660
+log 0:0 0666
+loop[0-9].* 0:6 0640
+mem 0:15 0640
+network_latency 0:0 0660
+network_throughput 0:0 0660
+null 0:0 0666
+port 0:15 0640
+ptmx 0:5 0666
+ram[0-9].* 0:6 0640
+random 0:0 0666
+sda 0:6 0640
+tty 0:5 0666
+tty.* 0:0 0620
+urandom 0:0 0666
+usbdev.* 0:0 0660 */etc/mdev/usb.sh
+vcs.* 0:5 0660
+zero 0:0 0666
+
+snd/pcm.* 0:0 0660
+snd/control.* 0:0 0660
+snd/timer 0:0 0660
+snd/seq 0:0 0660
+snd/mini.* 0:00 0660
+
+input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh
+input/mice 0:0 0660
+input/mouse.* 0:0 0660
+
+tun[0-9]* 0:0 0660 =net/
+
+[hs]d[a-z][0-9]? 0:0 660 */etc/mdev/mdev-mount.sh
+mmcblk[0-9]rpmb 0:0 660
+mmcblk[0-9]boot[0-9] 0:0 660
+mmcblk[0-9].* 0:0 660 */etc/mdev/mdev-mount.sh
diff --git a/poky/meta/recipes-core/busybox/files/mount.busybox b/poky/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 000000000..fef945b7b
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox mount $@
diff --git a/poky/meta/recipes-core/busybox/files/rcK b/poky/meta/recipes-core/busybox/files/rcK
new file mode 100644
index 000000000..f8a63e132
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/rcK
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/rc6.d
+# executing them in numerical order.
+#
+for i in /etc/rc6.d/K??*; do
+
+ # Ignore dangling symlinks (if any).
+ [ ! -f "$i" ] && continue
+
+ case "$i" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ set stop
+ . $i
+ )
+ ;;
+ *)
+ # No sh extension, so fork subprocess.
+ $i stop
+ ;;
+ esac
+done
+
diff --git a/poky/meta/recipes-core/busybox/files/rcS b/poky/meta/recipes-core/busybox/files/rcS
new file mode 100644
index 000000000..bb03eb608
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/rcS
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Start all init scripts in /etc/rcS.d and /etc/rc5.d
+# executing them in numerical order.
+#
+
+for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
+
+ # Ignore dangling symlinks (if any).
+ [ ! -f "$i" ] && continue
+
+ case "$i" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ set start
+ . $i
+ )
+ ;;
+ *)
+ # No sh extension, so fork subprocess.
+ $i start
+ ;;
+ esac
+done
+
diff --git a/poky/meta/recipes-core/busybox/files/run-ptest b/poky/meta/recipes-core/busybox/files/run-ptest
new file mode 100644
index 000000000..3608a8eb6
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+current_dir=$(readlink -f $0)
+export bindir=$(dirname $current_dir)
+
+cd testsuite || exit 1
+./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
diff --git a/poky/meta/recipes-core/busybox/files/runlevel b/poky/meta/recipes-core/busybox/files/runlevel
new file mode 100644
index 000000000..866f3b594
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/runlevel
@@ -0,0 +1,11 @@
+#!/bin/sh
+# busybox init does not have LSB ( sysvinit ) like initlevels
+# so lets fake it to 5 which is what we default anyway
+# this helps with opkg post installs where it tries to invoke
+# update-rc.d ad post install step.
+# for package upgrades
+# See code in update-rc.d around line 190 where it calls runlevel
+# program
+#
+echo "5"
+
diff --git a/poky/meta/recipes-core/busybox/files/simple.script b/poky/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 000000000..6ed029352
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+RESOLV_CONF="/etc/resolv.conf"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+# return 0 if root is mounted on a network filesystem
+root_is_nfs() {
+ sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+ grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
+}
+
+have_bin_ip=0
+if [ -x /SBIN_DIR/ip ]; then
+ have_bin_ip=1
+ BROADCAST="broadcast +"
+fi
+
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+
+case "$1" in
+ deconfig)
+ if [ -x /SBIN_DIR/resolvconf ]; then
+ /SBIN_DIR/resolvconf -d "${interface}.udhcpc"
+ fi
+ if ! root_is_nfs ; then
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip addr flush dev $interface
+ /SBIN_DIR/ip link set dev $interface up
+ else
+ /SBIN_DIR/ifconfig $interface 0.0.0.0
+ fi
+ fi
+ ;;
+
+ renew|bound)
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip addr add dev $interface local $ip/$mask $BROADCAST
+ else
+ /SBIN_DIR/ifconfig $interface $ip $BROADCAST $NETMASK
+ fi
+
+ if [ -n "$router" ] ; then
+ if ! root_is_nfs ; then
+ if [ $have_bin_ip -eq 1 ]; then
+ while /SBIN_DIR/ip route del default dev $interface 2>/dev/null ; do
+ :
+ done
+ else
+ while /SBIN_DIR/route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+ :
+ done
+ fi
+ fi
+
+ metric=10
+ for i in $router ; do
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip route add default via $i metric $metric
+ else
+ /SBIN_DIR/route add default gw $i dev $interface metric $metric 2>/dev/null
+ fi
+ metric=$(($metric + 1))
+ done
+ fi
+
+ # Update resolver configuration file
+ R=""
+ [ -n "$domain" ] && R="domain $domain
+"
+ for i in $dns; do
+ echo "$0: Adding DNS $i"
+ R="${R}nameserver $i
+"
+ done
+
+ if [ -x /SBIN_DIR/resolvconf ]; then
+ echo -n "$R" | /SBIN_DIR/resolvconf -a "${interface}.udhcpc"
+ else
+ echo -n "$R" > "$RESOLV_CONF"
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/busybox/files/syslog b/poky/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 000000000..89c4d12e9
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,77 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+set -e
+
+if [ -f /etc/syslog-startup.conf ]; then
+ . /etc/syslog-startup.conf
+ LOG_LOCAL=0
+ LOG_REMOTE=0
+ for D in $DESTINATION; do
+ if [ "$D" = "buffer" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
+ LOG_LOCAL=1
+ elif [ "$D" = "file" ]; then
+ if [ -n "$LOGFILE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
+ fi
+ if [ -n "$ROTATESIZE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
+ fi
+ if [ -n "$ROTATEGENS" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
+ fi
+ LOG_LOCAL=1
+ elif [ "$D" = "remote" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
+ LOG_REMOTE=1
+ fi
+ done
+ if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -L"
+ fi
+ if [ "$REDUCE" = "yes" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -S"
+ fi
+ if [ "$DROPDUPLICATES" = "yes" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -D"
+ fi
+ if [ -n "$LOGLEVEL" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
+ fi
+else
+ # default: log to 16K shm circular buffer
+ SYSLOG_ARGS="-C"
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting syslogd/klogd: "
+ start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
+ start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
+ echo "done"
+ ;;
+ stop)
+ echo -n "Stopping syslogd/klogd: "
+ start-stop-daemon -K -n syslogd
+ start-stop-daemon -K -n klogd
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: syslog { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/busybox/files/syslog-startup.conf b/poky/meta/recipes-core/busybox/files/syslog-startup.conf
new file mode 100644
index 000000000..fda450aa0
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/syslog-startup.conf
@@ -0,0 +1,13 @@
+# This configuration file is used by the busybox syslog init script,
+# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
+
+DESTINATION=file # log destinations (buffer file remote)
+LOGFILE=/var/log/messages # where to log (file)
+REMOTE=loghost:514 # where to log (syslog remote)
+REDUCE=no # reduce-size logging
+DROPDUPLICATES=no # whether to drop duplicate log entries
+#ROTATESIZE=0 # rotate log if grown beyond X [kByte]
+#ROTATEGENS=3 # keep X generations of rotated logs
+BUFFERSIZE=64 # size of circular buffer [kByte]
+FOREGROUND=no # run in foreground (don't use!)
+#LOGLEVEL=5 # local log level (between 1 and 8)
diff --git a/poky/meta/recipes-core/busybox/files/syslog.conf b/poky/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 000000000..75bb6309a
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1 @@
+# /etc/syslog.conf Configuration file for busybox's syslogd utility
diff --git a/poky/meta/recipes-core/busybox/files/umount.busybox b/poky/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 000000000..f3731626e
--- /dev/null
+++ b/poky/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch
new file mode 100644
index 000000000..ace4bf0a7
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch
@@ -0,0 +1,51 @@
+From b6a59b05f1fa514c6b387c9544bd63b1bfcf2eed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 05:38:29 +0000
+Subject: [PATCH] Cover the else with __GLIBC__
+
+Fixes build errors on musl/x86
+
+| In file included from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/asm/termios.h:1:0,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/linux/termios.h:5,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/console-tools/0.3.2-r8/console-tools-0.3.2/vttools/resizecons.c:86:
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/asm-generic/termios.h:14:8:
+error: redefinition of 'struct winsize'
+| struct winsize {
+| ^
+| In file included from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/sys/ioctl.h:7:0,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/console-tools/0.3.2-r8/console-tools-0.3.2/vttools/resizecons.c:81:
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/bits/ioctl.h:90:8:
+note: originally defined here
+| struct winsize {
+| ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ vttools/resizecons.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vttools/resizecons.c b/vttools/resizecons.c
+index f0a7055..e8753b1 100644
+--- a/vttools/resizecons.c
++++ b/vttools/resizecons.c
+@@ -81,7 +81,7 @@
+ #include <sys/ioctl.h>
+ #if (__GNU_LIBRARY__ >= 6)
+ # include <sys/perm.h>
+-#else
++#elif defined __GLIBC__
+ # include <linux/types.h>
+ # include <linux/termios.h>
+ #endif
+--
+2.7.0
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
new file mode 100644
index 000000000..6e72ec665
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
@@ -0,0 +1,57 @@
+Subject: Fix 'format-security' compilation error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ kbdtools/kbd_mode.c | 6 +++---
+ kbdtools/setmetamode.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/kbdtools/kbd_mode.c b/kbdtools/kbd_mode.c
+index 02dca38..8dbcd39 100644
+--- a/kbdtools/kbd_mode.c
++++ b/kbdtools/kbd_mode.c
+@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
+ /* report mode */
+ if (ioctl(fd, KDGKBMODE, &mode))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error reading keyboard mode\n"));
+ exit(1);
+ }
+@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
+ kbd_rep.period = rate;
+ if (ioctl(fd, KDKBDREP, &kbd_rep))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error setting keyboard repeat mode\n"));
+ exit(1);
+ }
+@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
+
+ if (ioctl(fd, KDSKBMODE, mode))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error setting keyboard mode\n"));
+ exit(1);
+ }
+diff --git a/kbdtools/setmetamode.c b/kbdtools/setmetamode.c
+index 5bed945..0ba7676 100644
+--- a/kbdtools/setmetamode.c
++++ b/kbdtools/setmetamode.c
+@@ -42,7 +42,7 @@ void report(int meta)
+ default:
+ s = N_("Strange mode for Meta key?\n");
+ }
+- printf(_(s));
++ printf("%s", _(s));
+ }
+
+ struct meta
+--
+2.8.3
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
new file mode 100644
index 000000000..64b5b044d
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
@@ -0,0 +1,44 @@
+From 0fd5dda51d68e1ec2a87e27b5ed0dff3503b4681 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 08:12:38 +0000
+Subject: [PATCH] kbdtools: Include sys/types.h for u_char and u_short
+ definition
+
+on musl this gets exposed since sys/types.h is not
+included via some other indirect inclusion as is the case with glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ kbdtools/dumpkeys.c | 1 +
+ kbdtools/loadkeys.y | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/kbdtools/dumpkeys.c b/kbdtools/dumpkeys.c
+index 6159d49..c19fb21 100644
+--- a/kbdtools/dumpkeys.c
++++ b/kbdtools/dumpkeys.c
+@@ -26,6 +26,7 @@
+ #include <errno.h>
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <linux/types.h>
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+diff --git a/kbdtools/loadkeys.y b/kbdtools/loadkeys.y
+index b6a8e01..4468f77 100644
+--- a/kbdtools/loadkeys.y
++++ b/kbdtools/loadkeys.y
+@@ -71,6 +71,7 @@
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <ctype.h>
+ #include <sysexits.h>
+ #include <signal.h>
+--
+2.6.4
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
new file mode 100644
index 000000000..32692ab4b
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
new file mode 100644
index 000000000..c28701476
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- console-tools-0.3.2/contrib/codepage.c~codepage
++++ console-tools-0.3.2/contrib/codepage.c
+@@ -229,7 +229,7 @@
+ return 0;
+
+ fprintf(stderr, "\
+-Warning: CP format is a hack!\n
++Warning: CP format is a hack!\n\
+ The files produced may or may not be usable!\n");
+
+ sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
new file mode 100644
index 000000000..c93f51195
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/showkey.c~compile 1999-08-25 17:20:08.000000000 -0400
++++ console-tools-0.3.2/kbdtools/showkey.c 2004-05-09 03:03:23.000000000 -0400
+@@ -264,7 +264,6 @@
+ break;
+ case cmd_keymap:
+ printf(")\n");
+- default:
+ }
+ }
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
new file mode 100644
index 000000000..15c100c90
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/configure.in~configure
++++ console-tools-0.3.2/configure.in
+@@ -2,13 +2,14 @@
+ dnl Process this file with autoconf to produce a configure script.
+
+ # Initialize
+-AC_INIT(kbdtools/loadkeys.y)
++AC_INIT
++AC_CONFIG_SRCDIR([kbdtools/loadkeys.y])
+
+ define(ct_unicodedata_default,/usr/share/unidata/UnicodeData-2.txt)
+ ct_localdatadir_default=/usr/local/share # iff --enable-localdatadir without specific dir
+
+ #AC_CONFIG_AUX_DIR(autoconf)
+-AC_CANONICAL_SYSTEM
++AC_CANONICAL_TARGET([])
+ AM_INIT_AUTOMAKE(console-tools, 0.3.2)
+
+ # Defaults
+@@ -25,7 +26,6 @@
+ # i18n stuff
+ ALL_LINGUAS="cs de ru ga fr"
+ AM_GNU_GETTEXT
+-AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
+
+ AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/share/locale")
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
new file mode 100644
index 000000000..be61eb846
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
@@ -0,0 +1,56 @@
+Fix the following error detected with i586-pokymllib32-linux-gcc (the
+multilib x86-64 lib32 compiler):
+ ../lib/ctutils/.libs/libctutils.so: undefined reference to `get_kernel_sfm'
+ collect2: error: ld returned 1 exit status
+
+It seems that libctutils.so (the library that uses get_kernel_sfm) must
+be stated before libconsole.so (the library that exports the function) when
+using multilib gcc
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: console-tools-0.3.2/fontfiletools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/fontfiletools/Makefile.am
++++ console-tools-0.3.2/fontfiletools/Makefile.am
+@@ -10,5 +10,5 @@ EXTRA_DIST = fonts2virfont.c virfont.h
+
+ # libconsole is needed by ctutils
+ LDADD = ../lib/ctlocal/libctlocal.a ../lib/cfont/libcfont.la \
+- ../lib/console/libconsole.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/ctutils/libctutils.la \
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+Index: console-tools-0.3.2/vttools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/vttools/Makefile.am
++++ console-tools-0.3.2/vttools/Makefile.am
+@@ -7,9 +7,9 @@ bin_PROGRAMS = chvt deallocvt writevt fg
+ vcstime vt-is-UTF8 openvt @RESIZECONS@
+ EXTRA_PROGRAMS = resizecons
+
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ ../lib/cfont/libcfont.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+ vcstime_LDADD = ../lib/ctlocal/libctlocal.a
+ screendump_LDADD = ../lib/ctlocal/libctlocal.a
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -15,9 +15,9 @@ EXTRA_PROGRAMS = getkeycodes setkeycodes
+ loadkeys_SOURCES = loadkeys.y analyze.l
+
+ YFLAGS = -d
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ ../lib/cfont/libcfont.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+ loadkeys_LDADD = $(LDADD) @LEXLIB@
+
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 000000000..f370be859
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
@@ -0,0 +1,75 @@
+Patch from Matthias Goebl <oe@m.goebl.net>
+Added via OE bugtracker: bug #478
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
++++ console-tools-0.3.2/kbdtools/kbd_mode.c
+@@ -29,11 +29,16 @@
+ OPT("-u --unicode ", _("UTF-8 mode (UNICODE)"));
+ OPT("-s --scancode ", _("scancode mode (RAW)"));
+ OPT(" --mode={8bit,keycode,unicode,scancode} ", _("set mode"));
++ OPT("-r --rate=RATE ", _("set repeat rate (default: 33)"));
++ OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)"));
+
+ OPT("-h --help ", HELPDESC);
+ OPT("-V --version ", VERSIONDESC);
+ }
+
++int rate=-1;
++int delay=-1;
++
+ static int parse_cmdline (int argc, char *argv[])
+ {
+ int mode = -1;
+@@ -46,11 +51,13 @@
+ { "mode" , required_argument, NULL, 'm' },
+ { "scancode" , no_argument, NULL, 's' },
+ { "unicode" , no_argument, NULL, 'u' },
++ { "rate" , required_argument, NULL, 'r' },
++ { "delay" , required_argument, NULL, 'd' },
+ { NULL, 0, NULL, 0 }
+ };
+ int c;
+
+- while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF)
++ while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF)
+ switch (c) {
+ case 'h':
+ usage ();
+@@ -58,6 +65,14 @@
+ case 'V':
+ version ();
+ exit(0);
++ case 'r':
++ rate = atoi(optarg);
++ mode = -2;
++ break;
++ case 'd':
++ delay = atoi(optarg);
++ mode = -2;
++ break;
+ case 'a':
+ mode = K_XLATE;
+ break;
+@@ -129,6 +144,20 @@
+ exit(0);
+ }
+
++ if ( rate != -1 || delay != -1 )
++ {
++ struct kbd_repeat kbd_rep;
++ kbd_rep.delay = delay;
++ kbd_rep.period = rate;
++ if (ioctl(fd, KDKBDREP, &kbd_rep))
++ {
++ fprintf(stderr, progname);
++ perror(_(": error setting keyboard repeat mode\n"));
++ exit(1);
++ }
++ if(mode==-2) exit(0);
++ }
++
+ if (ioctl(fd, KDSKBMODE, mode))
+ {
+ fprintf(stderr, progname);
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
new file mode 100644
index 000000000..18d47a94f
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
@@ -0,0 +1,24 @@
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License or the GNU Library General Public License but which still want
+# to provide support for the GNU gettext functionality.
+# Please note that the actual code of the GNU gettext library is covered
+# by the GNU Library General Public License, and the rest of the GNU
+# gettext package package is covered by the GNU General Public License.
+# They are *not* in the public domain.
+
+# serial 2
+
+AC_DEFUN([AM_LC_MESSAGES],
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+ fi])
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
new file mode 100644
index 000000000..a6735a53f
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
@@ -0,0 +1,19 @@
+No reason to link with libfl since 'loadkeys' implements
+its own yywrap()/yylex() functions.
+
+Upstream-Status: Pending
+Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
+
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -19,8 +19,6 @@ LDADD = ../lib/ctlocal/libctlocal.a ../l
+ ../lib/cfont/libcfont.la \
+ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+-loadkeys_LDADD = $(LDADD) @LEXLIB@
+-
+ bin_SCRIPTS = mk_modmap
+
+ noinst_HEADERS = loadkeys.h
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
new file mode 100644
index 000000000..2ed609219
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
@@ -0,0 +1,22 @@
+The docs need tools we don't have to build so disable them.
+
+Also remove intl since the Makefile doesn't work with 3.82 and we
+don't want to build libintl anyway.
+
+Upstream-Status: Inappropriate [configuration]
+RP 2012/10/17
+
+Index: console-tools-0.3.2/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/Makefile.am 1999-04-15 01:33:24.000000000 +0000
++++ console-tools-0.3.2/Makefile.am 2012-10-17 11:48:14.107069145 +0000
+@@ -1,7 +1,7 @@
+ # -*- makefile -*-
+ AUTOMAKE_OPTIONS = foreign
+
+-SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib doc \
+- compat include examples po intl
++SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib \
++ compat include examples po
+
+ EXTRA_DIST = BUGS RELEASE CREDITS COPYING.kbd local-scripts/* debian/* *.lsm
diff --git a/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
new file mode 100644
index 000000000..0c95068a3
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
@@ -0,0 +1,49 @@
+Fixing the locale issues isn't enough, console-tools also does a couple of
+other pretty stupid things (like FILE *f; f->_fileno instead of fileno(f)),
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/lib/cfont/fontstruct.c.ark 2005-05-22 19:12:38.000000000 +0000
++++ console-tools-0.3.2/lib/cfont/fontstruct.c 2005-05-22 19:13:23.000000000 +0000
+@@ -50,8 +50,7 @@
+ * get filesize
+ */
+
+- /* FIXME: should not use _fileno ! */
+- if (fstat(fontfile->_fileno, &stbuf) == -1)
++ if (fstat(fileno(fontfile), &stbuf) == -1)
+ goto rsf_return_error;
+
+ if (S_ISREG(stbuf.st_mode))
+@@ -211,8 +210,7 @@
+ * get filesize
+ */
+
+- /* FIXME: should not use _fileno ! */
+- if (fstat(fontfile->_fileno, &stbuf) == -1)
++ if (fstat(fileno(fontfile), &stbuf) == -1)
+ goto rfg_return_error;
+
+ if (S_ISREG(stbuf.st_mode))
+--- console-tools-0.3.2/lib/console/acm.c.ark 2005-05-22 19:17:15.000000000 +0000
++++ console-tools-0.3.2/lib/console/acm.c 2005-05-22 19:17:23.000000000 +0000
+@@ -30,7 +30,7 @@
+ lct_boolean parse_failed = False;
+ lct_boolean is_unicode;
+
+- if (fstat(fp->_fileno, &stbuf))
++ if (fstat(fileno(fp), &stbuf))
+ perror(_("Cannot stat ACM file")), exit(1);
+
+ /* first try a wg15-charmap (glibc) file format */
+--- console-tools-0.3.2/include/lct/local.h.ark 2005-05-22 19:08:54.000000000 +0000
++++ console-tools-0.3.2/include/lct/local.h 2005-05-22 19:09:12.000000000 +0000
+@@ -8,7 +8,7 @@
+ #include <locale.h>
+
+
+-#ifdef HAVE_LOCALE_H
++#if defined(HAVE_LOCALE_H) && defined(HAVE_LIBINTL_H)
+ # include <libintl.h>
+ # define _(String) gettext (String)
+ # ifdef gettext_noop
diff --git a/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
new file mode 100644
index 000000000..286c2a475
--- /dev/null
+++ b/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -0,0 +1,45 @@
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.kbd;md5=9b2d91511d3d80d4d20ac6e6b0137fe9"
+SUMMARY = "Allows you to set-up and manipulate the Linux console"
+DESCRIPTION = "Provides tools that enable the set-up and manipulation of the linux console and console-font files."
+PR = "r8"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
+ file://codepage.patch \
+ file://configure.patch \
+ file://compile.patch \
+ file://kbdrate.patch \
+ file://uclibc-fileno.patch \
+ file://nodocs.patch \
+ file://fix-libconsole-linking.patch \
+ file://no-dep-on-libfl.patch \
+ file://0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch \
+ file://0001-Cover-the-else-with-__GLIBC__.patch \
+ file://0001-Fix-format-security-compilation-error.patch \
+ file://lcmessage.m4 \
+ file://Makevars"
+
+SRC_URI[md5sum] = "bf21564fc38b3af853ef724babddbacd"
+SRC_URI[sha256sum] = "eea6b441672dacd251079fc85ed322e196282e0e66c16303ec64c3a2b1c126c2"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lct/files/console-tools-devel/"
+UPSTREAM_CHECK_REGEX = "/console-tools-devel/(?P<pver>(\d\d?\.)+\d\d?)/"
+
+CFLAGS_append_aarch64 = " -D_USE_TERMIOS "
+
+do_configure_prepend () {
+ mkdir -p ${S}/m4
+ cp ${WORKDIR}/lcmessage.m4 ${S}/m4/
+ rm -f ${S}/acinclude.m4
+ cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+inherit autotools gettext update-alternatives
+
+ALTERNATIVE_PRIORITY = "30"
+
+bindir_progs = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_${PN} = "${bindir_progs}"
+
+RDEPENDS_${PN} = "bash"
diff --git a/poky/meta/recipes-core/coreutils/coreutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-core/coreutils/coreutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch b/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch
new file mode 100644
index 000000000..66f9a716c
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch
@@ -0,0 +1,26 @@
+Subject: local.mk: fix cross compiling problem
+
+We meet the following error when cross compiling.
+| Makefile:3418: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
+This patch fixes this problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/local.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/local.mk b/src/local.mk
+index 36dfa4e..c5898cc 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
+ else
+ cu_install_program = src/ginstall
+ endif
+-INSTALL = $(cu_install_program) -c
++INSTALL_PROGRAM = $(cu_install_program)
+--
+2.1.0
+
diff --git a/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch b/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch
new file mode 100644
index 000000000..3c43e1d5d
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Denied
+
+Subject: uname: report processor and hardware correctly
+
+This patch is rejected by coreutils upstream, but distros like debian and fedora
+uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/uname.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/uname.c b/src/uname.c
+index 39bd28c..c84582d 100644
+--- a/src/uname.c
++++ b/src/uname.c
+@@ -299,13 +299,19 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_PROCESSOR)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_ARCHITECTURE
+ {
+ static char processor[257];
+ if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+ element = processor;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ }
+ #endif
+ #ifdef UNAME_PROCESSOR
+ if (element == unknown)
+@@ -343,7 +349,7 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_HARDWARE_PLATFORM)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_PLATFORM
+ {
+ static char hardware_platform[257];
+@@ -361,6 +367,14 @@ main (int argc, char **argv)
+ if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+ element = hardware_platform;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
++ element[1]='3';
++ }
+ #endif
+ if (! (toprint == UINT_MAX && element == unknown))
+ print_element (element);
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch b/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch
new file mode 100644
index 000000000..e68c21355
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch
@@ -0,0 +1,49 @@
+Subject: revert inconsistent ls quoting
+
+This is a revert of upstream commit 109b9220cead6e979d22d16327c4d9f8350431cc.
+
+Bug-Debian: https://bugs.debian.org/813164
+
+Upstream-Status: Submitted
+
+Originally-by: Adam Borowski <kilobyte@angband.pl>
+[PG: patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813164#78 ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+---
+
+--- coreutils-8.25.orig/NEWS
++++ coreutils-8.25/NEWS
+@@ -71,9 +71,6 @@ GNU coreutils NEWS
+ df now prefers sources towards the root of a device when
+ eliding duplicate bind mounted entries.
+
+- ls now quotes file names unambiguously and appropriate for use in a shell,
+- when outputting to a terminal.
+-
+ join, sort, uniq with --zero-terminated, now treat '\n' as a field delimiter.
+
+ ** Improvements
+--- coreutils-8.25.orig/doc/coreutils.texi
++++ coreutils-8.25/doc/coreutils.texi
+@@ -7750,8 +7750,8 @@ this"} in the default C locale. This lo
+
+ You can specify the default value of the @option{--quoting-style} option
+ with the environment variable @env{QUOTING_STYLE}@. If that environment
+-variable is not set, the default value is @samp{shell-escape} when the
+-output is a terminal, and @samp{literal} otherwise.
++variable is not set, the default value is @samp{literal}, but this
++default may change to @samp{shell} in a future version of this package.
+
+ @item --show-control-chars
+ @opindex --show-control-chars
+--- coreutils-8.25.orig/src/ls.c
++++ coreutils-8.25/src/ls.c
+@@ -1581,7 +1581,6 @@ decode_switches (int argc, char **argv)
+ if (isatty (STDOUT_FILENO))
+ {
+ format = many_per_line;
+- set_quoting_style (NULL, shell_escape_quoting_style);
+ /* See description of qmark_funny_chars, above. */
+ qmark_funny_chars = true;
+ }
diff --git a/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch b/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch
new file mode 100644
index 000000000..9d1ae55d4
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch
@@ -0,0 +1,39 @@
+From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 16 Sep 2014 01:59:08 -0700
+Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to
+ with_selinux
+
+Fixed when build with meta-selinux even when --without-selinux:
+runcon.c:49:28: fatal error: selinux/flask.h: No such file or directory
+ # include <selinux/flask.h>
+ ^
+compilation terminated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ m4/gnulib-comp.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
+index 472d3a0..5f09734 100644
+--- a/m4/gnulib-comp.m4
++++ b/m4/gnulib-comp.m4
+@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT],
+ AC_LIBOBJ([select])
+ fi
+ gl_SYS_SELECT_MODULE_INDICATOR([select])
+- AC_CHECK_HEADERS([selinux/flask.h])
+ AC_LIBOBJ([selinux-at])
+ gl_HEADERS_SELINUX_SELINUX_H
+ gl_HEADERS_SELINUX_CONTEXT_H
+ if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
++ AC_CHECK_HEADERS([selinux/flask.h])
+ AC_LIBOBJ([getfilecon])
+ fi
+ gl_SERVENT
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch b/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 000000000..2ef8a548a
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,31 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+
+Index: coreutils-8.14/m4/getloadavg.m4
+===================================================================
+--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700
++++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700
+@@ -41,16 +41,6 @@
+ [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
+ fi
+
+- if test $gl_func_getloadavg_done = no; then
+- # There is a commonly available library for RS/6000 AIX.
+- # Since it is not a standard part of AIX, it might be installed locally.
+- gl_getloadavg_LIBS=$LIBS
+- LIBS="-L/usr/local/lib $LIBS"
+- AC_CHECK_LIB([getloadavg], [getloadavg],
+- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
+- [LIBS=$gl_getloadavg_LIBS])
+- fi
+-
+ # Set up the replacement function if necessary.
+ if test $gl_func_getloadavg_done = no; then
+ HAVE_GETLOADAVG=0
diff --git a/poky/meta/recipes-core/coreutils/coreutils_8.29.bb b/poky/meta/recipes-core/coreutils/coreutils_8.29.bb
new file mode 100644
index 000000000..0b8acc588
--- /dev/null
+++ b/poky/meta/recipes-core/coreutils/coreutils_8.29.bb
@@ -0,0 +1,133 @@
+SUMMARY = "The basic file, shell and text manipulation utilities"
+DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
+manipulation utilities. These are the core utilities which are expected to exist on \
+every system."
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://src/ls.c;beginline=1;endline=15;md5=1c3f9411e1842a062ce5ce9210beee0e"
+DEPENDS = "gmp libcap"
+DEPENDS_class-native = ""
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
+ file://remove-usr-local-lib-from-m4.patch \
+ file://fix-selinux-flask.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-uname-report-processor-and-hardware-correctly.patch \
+ file://disable-ls-output-quoting.patch \
+ file://0001-local.mk-fix-cross-compiling-problem.patch \
+ "
+
+SRC_URI[md5sum] = "960cfe75a42c9907c71439f8eb436303"
+SRC_URI[sha256sum] = "92d0fa1c311cacefa89853bdb53c62f4110cdfda3820346b59cbd098f40f955e"
+
+EXTRA_OECONF_class-native = "--without-gmp"
+EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
+EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch"
+
+# acl and xattr are not default features
+#
+PACKAGECONFIG_class-target ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
+"
+
+# The lib/oe/path.py requires xattr
+PACKAGECONFIG_class-native ??= "xattr"
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
+
+# [ df mktemp base64 gets a special treatment and is not included in this
+bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
+ env expand expr factor fmt fold groups head hostid id install \
+ join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
+ pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
+ sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
+ tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
+ mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
+
+sbindir_progs= "chroot"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since coreutils has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
+do_compile_prepend () {
+ mkdir -p ${B}/src
+}
+
+do_install_class-native() {
+ autotools_do_install
+ # remove groups to fix conflict with shadow-native
+ rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
+ # The return is a must since native doesn't need the
+ # do_install_append() in the below.
+ return
+}
+
+do_install_append() {
+ for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
+
+ install -d ${D}${base_bindir}
+ [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
+
+ install -d ${D}${sbindir}
+ [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
+
+ # [ requires special handling because [.coreutils will cause the sed stuff
+ # in update-alternatives to fail, therefore use lbracket - the name used
+ # for the actual source file.
+ mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+# Make hostname's priority higher than busybox but lower than net-tools
+ALTERNATIVE_PRIORITY[hostname] = "90"
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
+ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
+
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+
+ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
+ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
+ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
+
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
+
+ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
+ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
+ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+python __anonymous() {
+ for prog in d.getVar('base_bindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
+
+ for prog in d.getVar('sbindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
new file mode 100644
index 000000000..c24295b53
--- /dev/null
+++ b/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "A simple tool to wait for a specific signal over DBus"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "dbus"
+
+SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-core/dbus/dbus-glib.inc b/poky/meta/recipes-core/dbus/dbus-glib.inc
new file mode 100644
index 000000000..55f710f85
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus-glib.inc
@@ -0,0 +1,39 @@
+SUMMARY = "High level language (GLib) binding for D-Bus"
+DESCRIPTION = "GLib bindings for the D-Bus message bus that integrate \
+the D-Bus library with the GLib thread abstraction and main loop."
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cf5b3a2f7083750d504333114e738656 \
+ file://dbus/dbus-glib.h;beginline=7;endline=21;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+SECTION = "base"
+
+DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
+DEPENDS_class-native = "glib-2.0-native dbus-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
+ file://no-examples.patch \
+ file://test-install-makefile.patch \
+"
+
+inherit autotools pkgconfig gettext bash-completion gtk-doc
+
+#default disable regression tests, some unit test code in non testing code
+#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tests] = "--enable-tests,,,"
+
+EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \
+ --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
+EXTRA_OECONF_class-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml"
+
+PACKAGES += "${PN}-tests"
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS}"
+FILES_${PN}-bash-completion += "${libexecdir}/dbus-bash-completion-helper"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
+FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
+
+RDEPENDS_${PN}-tests += "dbus-x11"
+FILES_${PN}-tests = "${datadir}/${BPN}/tests"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch b/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
new file mode 100644
index 000000000..32e761171
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
@@ -0,0 +1,17 @@
+Disable compiling examples
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dbus-glib-0.108/dbus/Makefile.am
+===================================================================
+--- dbus-glib-0.108.orig/dbus/Makefile.am
++++ dbus-glib-0.108/dbus/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+
+ AM_CPPFLAGS = \
+ -I$(top_srcdir) \
diff --git a/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch b/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
new file mode 100644
index 000000000..027c82b27
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
@@ -0,0 +1,57 @@
+Change Makefile.am to install regression tests for test package purpose.
+
+Upstream-Status: Inappropriate [test not install is for purpose from upstream]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ test/Makefile.am | 3 ++-
+ test/core/Makefile.am | 3 ++-
+ test/interfaces/Makefile.am | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 379c8c3..6580927 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -48,7 +48,8 @@ TESTS = \
+ $(test_scripts) \
+ $(NULL)
+
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests
++test_PROGRAMS = \
+ $(test_programs) \
+ $(test_related_programs) \
+ $(NULL)
+diff --git a/test/core/Makefile.am b/test/core/Makefile.am
+index e4bceb4..54b077d 100644
+--- a/test/core/Makefile.am
++++ b/test/core/Makefile.am
+@@ -64,7 +64,8 @@ endif
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests/core
++test_PROGRAMS = \
+ test-dbus-glib \
+ test-error-mapping \
+ test-service-glib \
+diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
+index a94d08d..707dcac 100644
+--- a/test/interfaces/Makefile.am
++++ b/test/interfaces/Makefile.am
+@@ -57,7 +57,8 @@ if DBUS_BUILD_TESTS
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = test-service test-client
++testdir = $(datadir)/@PACKAGE@/tests/interfaces
++test_PROGRAMS = test-service test-client
+
+ test_service_SOURCES = \
+ test-interfaces.c \
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/dbus/dbus-glib_0.108.bb b/poky/meta/recipes-core/dbus/dbus-glib_0.108.bb
new file mode 100644
index 000000000..7a9a69e1e
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus-glib_0.108.bb
@@ -0,0 +1,4 @@
+require dbus-glib.inc
+
+SRC_URI[md5sum] = "a66a613705870752ca9786e0359aea97"
+SRC_URI[sha256sum] = "9f340c7e2352e9cdf113893ca77ca9075d9f8d5e81476bf2bf361099383c602c"
diff --git a/poky/meta/recipes-core/dbus/dbus-test_1.12.2.bb b/poky/meta/recipes-core/dbus/dbus-test_1.12.2.bb
new file mode 100644
index 000000000..dce047a13
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus-test_1.12.2.bb
@@ -0,0 +1,82 @@
+SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+ file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+
+DEPENDS = "dbus glib-2.0"
+
+RDEPENDS_${PN} += "make"
+RDEPENDS_${PN}-dev = ""
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+ file://tmpdir.patch \
+ file://run-ptest \
+ file://python-config.patch \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+ "
+
+SRC_URI[md5sum] = "3361456cadb99aa6601bed5b48964254"
+SRC_URI[sha256sum] = "272bb5091770b047c8188b926d5e6038fa4fe6745488b2add96b23e2d9a83d88"
+
+S="${WORKDIR}/dbus-${PV}"
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
+
+inherit autotools pkgconfig gettext ptest upstream-version-is-even
+
+EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
+EXTRA_OECONF_X_class-native = "--without-x"
+
+EXTRA_OECONF = "--enable-tests \
+ --enable-modular-tests \
+ --enable-installed-tests \
+ --enable-checks \
+ --enable-asserts \
+ --enable-verbose-mode \
+ --enable-largefile \
+ --disable-xml-docs \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --with-dbus-test-dir=${PTEST_PATH} \
+ ${EXTRA_OECONF_X}"
+
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
+do_install() {
+ :
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/test
+ l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
+ variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
+ for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
+ l="bus bus-system bus-launch-helper"
+ for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
+ cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+ install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
+ install -d ${D}${PTEST_PATH}/test/.libs
+ cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
+
+ # Remove build host references...
+ find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf -o -name "*.aaprofile" \) -type f -exec \
+ sed -i \
+ -e 's:${B}:${PTEST_PATH}:g' \
+ {} +
+}
+
+RDEPENDS_${PN}-ptest += "bash"
+
+PRIVATE_LIBS_${PN}-ptest = "libdbus-1.so.3"
diff --git a/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
new file mode 100644
index 000000000..6bb6d9c82
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
@@ -0,0 +1,104 @@
+From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Thu, 27 Feb 2014 09:05:02 +0800
+Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd
+ failed
+
+Upstream-Status: Submitted
+
+bus-test dispatch test failed with below information:
+ ./bus/bus-test: Running message dispatch test
+ Activating service name='org.freedesktop.DBus.TestSuiteEchoService'
+ Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService'
+ 6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok
+ ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969]
+ ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44]
+ ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3]
+ ./bus/bus-test() [0x80e24da]
+ ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848]
+ ./bus/bus-test() [0x80aea49]
+ ./bus/bus-test() [0x80affde]
+ ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841]
+ ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174]
+ ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8]
+ ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509]
+ ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d]
+ ./bus/bus-test() [0x806cab0]
+ ./bus/bus-test() [0x806e0ca]
+ ./bus/bus-test() [0x806da6f]
+ ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c]
+ ./bus/bus-test() [0x806f723]
+ ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac]
+ ./bus/bus-test(main+0x1b7) [0x805acc7]
+ /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3]
+ ./bus/bus-test() [0x805ae39]
+
+The stack is below:
+ #0 0xffffe425 in __kernel_vsyscall ()
+ #1 0x45fa62d6 in raise () from /lib/libc.so.6
+ #2 0x45fa9653 in abort () from /lib/libc.so.6
+ #3 0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94
+ #4 0x080b52c3 in _dbus_real_assert (condition=0,
+ condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+ file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545,
+ func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok")
+ data=0x8157290) at dbus-connection.c:1515
+ #0 0x00000033fee353e9 in raise () from /lib64/libc.so.6
+ #1 0x00000033fee38508 in abort () from /lib64/libc.so.6
+ #2 0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94
+ #3 0x0000000000466486 in _dbus_real_assert (condition=<optimized out>,
+ condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+ file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546,
+ func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok")
+ at dbus-internals.c:931
+ #4 0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480,
+ auth=0x6ff340) at dbus-auth.c:1546
+ #5 handle_client_state_waiting_for_data (auth=0x6ff340,
+ command=<optimized out>, args=0x7fffffffe480) at dbus-auth.c:1996
+ #6 0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208
+ #7 _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458
+ #8 0x000000000046091d in do_authentication (
+ transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1,
+ do_writing=do_writing@entry=0,
+ auth_completed=auth_completed@entry=0x7fffffffe55c)
+ at dbus-transport-socket.c:442
+ #9 0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0,
+ watch=0x6f4190, flags=1) at dbus-transport-socket.c:921
+ #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0,
+
+Once send_negotiate_unix_fd failed, this failure will happen, since
+auth->guid_from_server has been set to some value before
+send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to
+this auth be handled by process_ok again, but this auth->guid_from_server
+is not zero.
+
+So we should clear auth->guid_from_server if send_negotiate_unix_fd failed
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ dbus/dbus-auth.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
+index d2c37a7..37b45c6 100644
+--- a/dbus/dbus-auth.c
++++ b/dbus/dbus-auth.c
+@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth,
+ _dbus_verbose ("Got GUID '%s' from the server\n",
+ _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
+
+- if (auth->unix_fd_possible)
+- return send_negotiate_unix_fd(auth);
++ if (auth->unix_fd_possible) {
++ if (!send_negotiate_unix_fd(auth)) {
++ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
++ return FALSE;
++ }
++ return TRUE;
++ }
+
+ _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
+ return send_begin (auth);
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-core/dbus/dbus/dbus-1.init b/poky/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 000000000..42c86297c
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,123 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: dbus
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: D-Bus systemwide message bus
+# Description: D-Bus is a simple interprocess messaging system, used
+# for sending messages between applications.
+### END INIT INFO
+#
+# -*- coding: utf-8 -*-
+# Debian init.d script for D-BUS
+# Copyright © 2003 Colin Walters <walters@debian.org>
+
+# set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+DAEMON=@bindir@/dbus-daemon
+NAME=dbus
+DAEMONUSER=messagebus # must match /etc/dbus-1/system.conf
+PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
+UUIDDIR=/var/lib/dbus
+DESC="system message bus"
+EVENTDIR=/etc/dbus-1/event.d
+
+test -x $DAEMON || exit 0
+
+# Source defaults file; edit that file to configure this script.
+ENABLED=1
+PARAMS=""
+if [ -e /etc/default/dbus ]; then
+ . /etc/default/dbus
+fi
+
+test "$ENABLED" != "0" || exit 0
+
+start_it_up()
+{
+ mkdir -p "`dirname $PIDFILE`"
+ if [ -e $PIDFILE ]; then
+ PIDDIR=/proc/$(cat $PIDFILE)
+ if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
+ echo "$DESC already started; not starting."
+ else
+ echo "Removing stale PID file $PIDFILE."
+ rm -f $PIDFILE
+ fi
+ fi
+
+ if [ ! -d $UUIDDIR ]; then
+ mkdir -p $UUIDDIR
+ chown $DAEMONUSER $UUIDDIR
+ chgrp $DAEMONUSER $UUIDDIR
+ fi
+
+ dbus-uuidgen --ensure
+
+ echo -n "Starting $DESC: "
+ start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
+ --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
+ echo "$NAME."
+ if [ -d $EVENTDIR ]; then
+ run-parts --arg=start $EVENTDIR
+ fi
+}
+
+shut_it_down()
+{
+ if [ -d $EVENTDIR ]; then
+ # TODO: --reverse when busybox supports it
+ run-parts --arg=stop $EVENTDIR
+ fi
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \
+ --user $DAEMONUSER
+ # We no longer include these arguments so that start-stop-daemon
+ # can do its job even given that we may have been upgraded.
+ # We rely on the pidfile being sanely managed
+ # --exec $DAEMON -- --system $PARAMS
+ echo "$NAME."
+ rm -f $PIDFILE
+}
+
+reload_it()
+{
+ echo -n "Reloading $DESC config: "
+ dbus-send --print-reply --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig > /dev/null
+ # hopefully this is enough time for dbus to reload it's config file.
+ echo "done."
+}
+
+case "$1" in
+ start)
+ start_it_up
+ ;;
+ stop)
+ shut_it_down
+ ;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ reload|force-reload)
+ reload_it
+ ;;
+ restart)
+ shut_it_down
+ sleep 1
+ start_it_up
+ ;;
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/dbus/dbus/python-config.patch b/poky/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 000000000..da2f10c72
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus/python-config.patch
@@ -0,0 +1,34 @@
+When building the dbus-ptest package, we have to enable python. However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+ configure.ac | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 80d27b4..becc1cc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -279,13 +279,6 @@ if test "x$enable_tests" = xyes; then
+ # full test coverage is required, Python is a hard dependency
+ AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygi])
+ AM_PATH_PYTHON([2.6])
+- AC_MSG_CHECKING([for Python modules for full test coverage])
+- if "$PYTHON" -c "import dbus, gi.repository.GObject, dbus.mainloop.glib"; then
+- AC_MSG_RESULT([yes])
+- else
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([cannot import dbus, gi.repository.GObject, dbus.mainloop.glib Python modules])
+- fi
+ else
+ # --enable-tests not given: do not abort if Python is missing
+ AM_PATH_PYTHON([2.6], [], [:])
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/dbus/dbus/run-ptest b/poky/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 000000000..8a8970ee2
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+output() {
+ retcode=$?
+ if [ $retcode -eq 0 ]
+ then echo "PASS: $i"
+ elif [ $retcode -eq 77 ]
+ then echo "SKIP: $i"
+ else echo "FAIL: $i"
+ fi
+}
+
+export DBUS_TEST_HOMEDIR=./test
+export XDG_RUNTIME_DIR=./test
+export LD_LIBRARY_PATH=/usr/lib/dbus-test/ptest/test/.libs
+
+files=`ls test/test-*`
+
+for i in $files
+ do
+ ./$i ./test/data >/dev/null
+ output
+ done
+
diff --git a/poky/meta/recipes-core/dbus/dbus/tmpdir.patch b/poky/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 000000000..bf086e178
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,44 @@
+From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 23 Jun 2011 13:52:09 +0200
+Subject: [PATCH] buildsys: hardcode socketdir to /tmp
+
+the TMPDIR env var isn't always pointing to the right target path
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Original comment:
+
+ avoid to check tmp dir at build time. instead uses hard coded /tmp here
+ comment added by Kevin Tian <kevin.tian@intel.com>
+---
+ configure.ac | 11 +----------
+ 1 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 408054b..6d26180 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
+ AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
+ [Full path to the launch helper test program in the builddir])
+
+-#### Find socket directories
+-if ! test -z "$TMPDIR" ; then
+- DEFAULT_SOCKET_DIR=$TMPDIR
+-elif ! test -z "$TEMP" ; then
+- DEFAULT_SOCKET_DIR=$TEMP
+-elif ! test -z "$TMP" ; then
+- DEFAULT_SOCKET_DIR=$TMP
+-else
+- DEFAULT_SOCKET_DIR=/tmp
+-fi
++DEFAULT_SOCKET_DIR=/tmp
+
+ DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
+
+--
+1.6.6.1
+
diff --git a/poky/meta/recipes-core/dbus/dbus_1.12.2.bb b/poky/meta/recipes-core/dbus/dbus_1.12.2.bb
new file mode 100644
index 000000000..fb5b69aa4
--- /dev/null
+++ b/poky/meta/recipes-core/dbus/dbus_1.12.2.bb
@@ -0,0 +1,181 @@
+SUMMARY = "D-Bus message bus"
+DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+ file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+DEPENDS = "expat virtual/libintl autoconf-archive"
+RDEPENDS_dbus_class-native = ""
+RDEPENDS_dbus_class-nativesdk = ""
+PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
+ALLOW_EMPTY_dbus-ptest = "1"
+RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+ file://tmpdir.patch \
+ file://dbus-1.init \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+"
+
+SRC_URI[md5sum] = "3361456cadb99aa6601bed5b48964254"
+SRC_URI[sha256sum] = "272bb5091770b047c8188b926d5e6038fa4fe6745488b2add96b23e2d9a83d88"
+
+inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
+
+INITSCRIPT_NAME = "dbus-1"
+INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
+
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r netdev"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+ --no-create-home --shell /bin/false \
+ --user-group messagebus"
+
+CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
+
+DEBIANNAME_${PN} = "dbus-1"
+
+PACKAGES =+ "${PN}-lib"
+
+OLDPKGNAME = "dbus-x11"
+OLDPKGNAME_class-nativesdk = ""
+
+# for compatibility
+RPROVIDES_${PN} = "${OLDPKGNAME}"
+RREPLACES_${PN} += "${OLDPKGNAME}"
+
+FILES_${PN} = "${bindir}/dbus-daemon* \
+ ${bindir}/dbus-uuidgen \
+ ${bindir}/dbus-cleanup-sockets \
+ ${bindir}/dbus-send \
+ ${bindir}/dbus-monitor \
+ ${bindir}/dbus-launch \
+ ${bindir}/dbus-run-session \
+ ${bindir}/dbus-update-activation-environment \
+ ${libexecdir}/dbus* \
+ ${sysconfdir} \
+ ${localstatedir} \
+ ${datadir}/dbus-1/services \
+ ${datadir}/dbus-1/system-services \
+ ${datadir}/dbus-1/session.d \
+ ${datadir}/dbus-1/session.conf \
+ ${datadir}/dbus-1/system.d \
+ ${datadir}/dbus-1/system.conf \
+ ${datadir}/xml/dbus-1 \
+ ${systemd_system_unitdir} \
+ ${systemd_user_unitdir} \
+ ${nonarch_libdir}/sysusers.d/dbus.conf \
+ ${nonarch_libdir}/tmpfiles.d/dbus.conf \
+"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+RRECOMMENDS_${PN}-lib = "${PN}"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool"
+
+PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
+pkg_postinst_dbus() {
+ # If both systemd and sysvinit are enabled, mask the dbus-1 init script
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask dbus-1.service
+ fi
+
+ if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
+
+EXTRA_OECONF = "--disable-tests \
+ --disable-xml-docs \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --enable-largefile \
+ "
+
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+EXTRA_OECONF_append_class-native = " --disable-selinux"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
+do_install() {
+ autotools_do_install
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
+ install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
+ install -d ${D}${systemd_system_unitdir}/$i; done
+ install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
+ ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
+ ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
+ ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
+ fi
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
+ > ${D}${sysconfdir}/default/volatiles/99_dbus
+
+
+ mkdir -p ${D}${localstatedir}/lib/dbus
+
+ chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
+
+ chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+ chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+
+ # Remove Red Hat initscript
+ rm -rf ${D}${sysconfdir}/rc.d
+
+ # Remove empty testexec directory as we don't build tests
+ rm -rf ${D}${libdir}/dbus-1.0/test
+
+ # Remove /var/run as it is created on startup
+ rm -rf ${D}${localstatedir}/run
+}
+
+do_install_class-native() {
+ autotools_do_install
+
+ # for dbus-glib-native introspection generation
+ install -d ${D}${STAGING_DATADIR_NATIVE}/dbus/
+ # N.B. is below install actually required?
+ install -m 0644 bus/session.conf ${D}${STAGING_DATADIR_NATIVE}/dbus/session.conf
+
+ # dbus-glib-native and dbus-glib need this xml file
+ ./bus/dbus-daemon --introspect > ${D}${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
+
+ # dbus-launch has no X support so lets not install it in case the host
+ # has a more featured and useful version
+ rm -f ${D}${bindir}/dbus-launch
+}
+
+do_install_class-nativesdk() {
+ autotools_do_install
+
+ # dbus-launch has no X support so lets not install it in case the host
+ # has a more featured and useful version
+ rm -f ${D}${bindir}/dbus-launch
+
+ # Remove /var/run to avoid QA error
+ rm -rf ${D}${localstatedir}/run
+}
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP_${PN}-ptest += "build-deps"
diff --git a/poky/meta/recipes-core/dropbear/dropbear.inc b/poky/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 000000000..b6b436c58
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,107 @@
+SUMMARY = "A lightweight SSH and SCP implementation"
+HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
+SECTION = "console/network"
+
+# some files are from other projects and have others license terms:
+# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
+LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5ec40cafba26fc4396d0b550f824e01"
+
+DEPENDS = "zlib"
+RPROVIDES_${PN} = "ssh sshd"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
+ file://0001-urandom-xauth-changes-to-options.h.patch \
+ file://0003-configure.patch \
+ file://0004-fix-2kb-keys.patch \
+ file://0007-dropbear-fix-for-x32-abi.patch \
+ file://fix-libtomcrypt-libtommath-ordering.patch \
+ file://init \
+ file://dropbearkey.service \
+ file://dropbear@.service \
+ file://dropbear.socket \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
+
+PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
+ file://0006-dropbear-configuration-file.patch \
+ file://dropbear"
+
+PAM_PLUGINS = "libpam-runtime \
+ pam-plugin-deny \
+ pam-plugin-permit \
+ pam-plugin-unix \
+ "
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
+
+inherit autotools update-rc.d systemd
+
+INITSCRIPT_NAME = "dropbear"
+INITSCRIPT_PARAMS = "defaults 10"
+
+SYSTEMD_SERVICE_${PN} = "dropbear.socket"
+
+SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
+BINCOMMANDS = "dbclient ssh scp"
+EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
+
+EXTRA_OECONF += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+do_install() {
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/default \
+ ${D}${sysconfdir}/dropbear \
+ ${D}${bindir} \
+ ${D}${sbindir} \
+ ${D}${localstatedir}
+
+ install -m 0755 dropbearmulti ${D}${sbindir}/
+ ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
+
+ for i in ${SBINCOMMANDS}
+ do
+ ln -s ./dropbearmulti ${D}${sbindir}/$i
+ done
+ sed -e 's,/etc,${sysconfdir},g' \
+ -e 's,/usr/sbin,${sbindir},g' \
+ -e 's,/var,${localstatedir},g' \
+ -e 's,/usr/bin,${bindir},g' \
+ -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
+ chmod 755 ${D}${sysconfdir}/init.d/dropbear
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
+ fi
+
+ # deal with systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "20"
+ALTERNATIVE_${PN} = "scp ssh"
+
+ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
+
+pkg_postrm_append_${PN} () {
+ if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
+ rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
+ fi
+ if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
+ rm ${sysconfdir}/dropbear/dropbear_dss_host_key
+ fi
+}
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 000000000..dc9d5782e
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,23 @@
+Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
+
+Upstream-Status: Inappropriate [configuration]
+---
+ options.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/options.h b/options.h
+index 7d06322..71a21c2 100644
+--- a/options.h
++++ b/options.h
+@@ -247,7 +247,7 @@ much traffic. */
+ /* The command to invoke for xauth when using X11 forwarding.
+ * "-q" for quiet */
+ #ifndef XAUTH_COMMAND
+-#define XAUTH_COMMAND "/usr/bin/xauth -q"
++#define XAUTH_COMMAND "xauth -q"
+ #endif
+
+ /* if you want to enable running an sftp server (such as the one included with
+--
+1.7.11.7
+
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch
new file mode 100644
index 000000000..8469a50ef
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0003-configure.patch
@@ -0,0 +1,43 @@
+From 58dd24a80ca0f400d0761afd9ce2b7f684fc9125 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
+Date: Thu, 25 Apr 2013 00:27:25 +0200
+Subject: [PATCH] configure: add a variable to allow openpty check to be cached
+
+Upstream-Status: Submitted [ https://github.com/mkj/dropbear/pull/48 ]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.ac | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 893b904..245408d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -177,15 +177,20 @@ AC_ARG_ENABLE(openpty,
+ AC_MSG_NOTICE(Not using openpty)
+ else
+ AC_MSG_NOTICE(Using openpty if available)
+- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ fi
+ ],
+ [
+ AC_MSG_NOTICE(Using openpty if available)
+- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
++ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ ]
+ )
+-
++
++if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
++ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
++ no_ptc_check=yes
++ no_ptmx_check=yes
++fi
+
+ AC_ARG_ENABLE(syslog,
+ [ --disable-syslog Don't include syslog support],
+--
+2.8.1
+
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
new file mode 100644
index 000000000..60c6a29d6
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
@@ -0,0 +1,19 @@
+Subject: [PATCH 4/6] fix 2kb keys
+
+Upstream-Status: Inappropriate [configuration]
+---
+ kex.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: dropbear-2017.75/kex.h
+===================================================================
+--- dropbear-2017.75.orig/kex.h
++++ dropbear-2017.75/kex.h
+@@ -106,6 +106,6 @@ int curve25519_donna(unsigned char *out,
+ #endif
+
+
+-#define MAX_KEXHASHBUF 2000
++#define MAX_KEXHASHBUF 3000
+
+ #endif /* DROPBEAR_KEX_H_ */
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 000000000..539cb12e9
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
@@ -0,0 +1,36 @@
+From b8cece92ba19aa77ac013ea161bfe4c7147747c9 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 2 Dec 2015 11:36:02 +0200
+Subject: Enable pam
+
+We need modify file option.h besides enabling pam in
+configure if we want dropbear to support pam.
+
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ options.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/options.h b/options.h
+index 94261f6..90bfe2f 100644
+--- a/options.h
++++ b/options.h
+@@ -208,10 +208,10 @@ If you test it please contact the Dropbear author */
+
+ /* This requires crypt() */
+ #ifdef HAVE_CRYPT
+-#define ENABLE_SVR_PASSWORD_AUTH
++/*#define ENABLE_SVR_PASSWORD_AUTH*/
+ #endif
+ /* PAM requires ./configure --enable-pam */
+-/*#define ENABLE_SVR_PAM_AUTH */
++#define ENABLE_SVR_PAM_AUTH
+ #define ENABLE_SVR_PUBKEY_AUTH
+
+ /* Whether to take public key options in
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 000000000..fa4c8d0a6
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
@@ -0,0 +1,22 @@
+Subject: [PATCH 6/6] dropbear configuration file
+
+dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
+to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+---
+diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c
+--- dropbear-2013.60-orig/svr-authpam.c 2013-10-16 16:34:53.000000000 +0200
++++ dropbear-2013.60/svr-authpam.c 2013-10-21 17:04:04.969416055 +0200
+@@ -211,7 +211,7 @@
+ userData.passwd = password;
+
+ /* Init pam */
+- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
++ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
+ rc, pam_strerror(pamHandlep, rc));
+ goto cleanup;
diff --git a/poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
new file mode 100644
index 000000000..60b302b5c
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
@@ -0,0 +1,140 @@
+Upstream-Status: Pending
+
+The dropbearkey utility built in x32 abi format, when generating ssh
+keys, was getting lost in the infinite loop.
+
+This patch fixes the issue by fixing types of variables and
+parameters of functions used in the code, which were getting
+undesired size, when compiled with the x32 abi toolchain.
+
+2013/05/23
+Received this fix from H J Lu.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344079 25200
+# Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
+# Parent e76614145aea67f66e4a4257685c771efba21aa1
+Typdef mp_digit to unsigned long long for MP_64BIT
+
+When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned
+long long instead of unsigned long since for x32, unsigned long is
+32-bit and unsigned long long is 64-bit and it is safe to use unsigned
+long long for 64-bit integer with GCC.
+
+diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h
+--- a/libtommath/tommath.h Thu Apr 18 22:57:47 2013 +0800
++++ b/libtommath/tommath.h Thu May 23 14:21:19 2013 -0700
+@@ -73,7 +73,7 @@
+ typedef signed long long long64;
+ #endif
+
+- typedef unsigned long mp_digit;
++ typedef unsigned long long mp_digit;
+ typedef unsigned long mp_word __attribute__ ((mode(TI)));
+
+ #define DIGIT_BIT 60
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344241 25200
+# Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536
+# Parent a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
+Cast to mp_digit when updating *rho
+
+There is
+
+int
+mp_montgomery_setup (mp_int * n, mp_digit * rho)
+
+We should cast to mp_digit instead of unsigned long when updating
+*rho since mp_digit may be unsigned long long and unsigned long long
+may be different from unsigned long, like in x32.
+
+diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c
+--- a/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:21:19 2013 -0700
++++ b/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:24:01 2013 -0700
+@@ -48,7 +48,7 @@
+ #endif
+
+ /* rho = -1/m mod b */
+- *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
++ *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
+
+ return MP_OKAY;
+ }
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344541 25200
+# Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a
+# Parent c7555a4cb7ded3a88409ba85f4027baa7af5f536
+Define LTC_FAST_TYPE to unsigned long long for __x86_64__
+
+We should define LTC_FAST_TYPE to unsigned long long instead of unsigned
+long if __x86_64__ to support x32 where unsigned long long is 64-bit
+and unsigned long is 32-bit.
+
+diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h
+--- a/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:24:01 2013 -0700
++++ b/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:29:01 2013 -0700
+@@ -74,7 +74,7 @@
+ #define ENDIAN_LITTLE
+ #define ENDIAN_64BITWORD
+ #define LTC_FAST
+- #define LTC_FAST_TYPE unsigned long
++ #define LTC_FAST_TYPE unsigned long long
+ #endif
+
+ /* detect PPC32 */
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344730 25200
+# Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee
+# Parent 7c656e7071a6412688b2f30a529a9afac6c7bf5a
+Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC
+
+We should use unsigned long long instead of unsigned long as unsigned
+64-bit integer for x86-64 GCC to support x32 where unsigned long is
+32-bit.
+
+diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h
+--- a/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:29:01 2013 -0700
++++ b/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:32:10 2013 -0700
+@@ -343,7 +343,7 @@
+ /* 64-bit Rotates */
+ #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
+
+-static inline unsigned long ROL64(unsigned long word, int i)
++static inline unsigned long long ROL64(unsigned long long word, int i)
+ {
+ asm("rolq %%cl,%0"
+ :"=r" (word)
+@@ -351,7 +351,7 @@
+ return word;
+ }
+
+-static inline unsigned long ROR64(unsigned long word, int i)
++static inline unsigned long long ROR64(unsigned long long word, int i)
+ {
+ asm("rorq %%cl,%0"
+ :"=r" (word)
+@@ -361,7 +361,7 @@
+
+ #ifndef LTC_NO_ROLC
+
+-static inline unsigned long ROL64c(unsigned long word, const int i)
++static inline unsigned long long ROL64c(unsigned long long word, const int i)
+ {
+ asm("rolq %2,%0"
+ :"=r" (word)
+@@ -369,7 +369,7 @@
+ return word;
+ }
+
+-static inline unsigned long ROR64c(unsigned long word, const int i)
++static inline unsigned long long ROR64c(unsigned long long word, const int i)
+ {
+ asm("rorq %2,%0"
+ :"=r" (word)
+
diff --git a/poky/meta/recipes-core/dropbear/dropbear/dropbear b/poky/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 000000000..47e787fb1
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/dropbear
@@ -0,0 +1,4 @@
+#%PAM-1.0
+
+auth include common-auth
+account include common-account
diff --git a/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket b/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 000000000..e5c61b755
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=dropbear.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
+Also=dropbearkey.service
diff --git a/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service b/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 000000000..b420bcddc
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SSH Per-Connection Server
+Wants=dropbearkey.service
+After=syslog.target dropbearkey.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=-/etc/default/dropbear
+ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 000000000..c49053d57
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=SSH Key Generation
+RequiresMountsFor=/var /var/lib
+ConditionPathExists=!/etc/dropbear/dropbear_rsa_host_key
+ConditionPathExists=!/var/lib/dropbear/dropbear_rsa_host_key
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=-/etc/default/dropbear
+Type=oneshot
+ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}
+ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key
+RemainAfterExit=yes
diff --git a/poky/meta/recipes-core/dropbear/dropbear/fix-libtomcrypt-libtommath-ordering.patch b/poky/meta/recipes-core/dropbear/dropbear/fix-libtomcrypt-libtommath-ordering.patch
new file mode 100644
index 000000000..2b05e1893
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/fix-libtomcrypt-libtommath-ordering.patch
@@ -0,0 +1,49 @@
+From f37fa9a41f248fa41dd74a41c66cb41a291c03d2 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 16 Sep 2016 12:18:23 -0700
+Subject: [PATCH] fix libtomcrypt/libtommath ordering
+
+To prevent build failures when using system libtom libraries and
+linking with --as-needed, LIBTOM_LIBS should be in the order
+-ltomcrypt -ltommath, not the other way around, ie libs should be
+prepended to LIBTOM_LIBS as they are found, not appended.
+
+Note that LIBTOM_LIBS is not used when linking with the bundled
+libtom libs.
+
+Upstream-Status: Backport [ https://github.com/mkj/dropbear/commit/f9e6bc2aecab0f4b5b529e07a92cc63c8a66cd4b ]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 245408d..d624853 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -393,16 +393,16 @@ AC_ARG_ENABLE(bundled-libtom,
+ AC_MSG_NOTICE(Forcing bundled libtom*)
+ else
+ BUNDLED_LIBTOM=0
+- AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath",
++ AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS",
+ [AC_MSG_ERROR([Missing system libtommath and --disable-bundled-libtom was specified])] )
+- AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt",
++ AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS",
+ [AC_MSG_ERROR([Missing system libtomcrypt and --disable-bundled-libtom was specified])] )
+ fi
+ ],
+ [
+ BUNDLED_LIBTOM=0
+- AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="$LIBTOM_LIBS -ltommath", BUNDLED_LIBTOM=1)
+- AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="$LIBTOM_LIBS -ltomcrypt", BUNDLED_LIBTOM=1)
++ AC_CHECK_LIB(tommath, mp_exptmod, LIBTOM_LIBS="-ltommath $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
++ AC_CHECK_LIB(tomcrypt, register_cipher, LIBTOM_LIBS="-ltomcrypt $LIBTOM_LIBS", BUNDLED_LIBTOM=1)
+ ]
+ )
+
+--
+2.8.1
+
diff --git a/poky/meta/recipes-core/dropbear/dropbear/init b/poky/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 000000000..f6e1c462f
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,89 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: sshd
+# Required-Start: $remote_fs $syslog $networking
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Dropbear Secure Shell server
+### END INIT INFO
+#
+# Do not configure this file. Edit /etc/default/dropbear instead!
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dropbear
+NAME=dropbear
+DESC="Dropbear SSH server"
+PIDFILE=/var/run/dropbear.pid
+
+DROPBEAR_PORT=22
+DROPBEAR_EXTRA_ARGS=
+NO_START=0
+
+set -e
+
+test ! -r /etc/default/dropbear || . /etc/default/dropbear
+test "$NO_START" = "0" || exit 0
+test -x "$DAEMON" || exit 0
+test ! -h /var/service/dropbear || exit 0
+
+readonly_rootfs=0
+for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
+ case $flag in
+ ro)
+ readonly_rootfs=1
+ ;;
+ esac
+done
+
+if [ $readonly_rootfs = "1" ]; then
+ mkdir -p /var/lib/dropbear
+ DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
+else
+ DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
+fi
+
+test -z "$DROPBEAR_BANNER" || \
+ DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
+test -n "$DROPBEAR_RSAKEY" || \
+ DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
+
+gen_keys() {
+ if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+ rm $DROPBEAR_RSAKEY || true
+ fi
+ test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ gen_keys
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+ sleep 1
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/dropbear/dropbear_2017.75.bb b/poky/meta/recipes-core/dropbear/dropbear_2017.75.bb
new file mode 100644
index 000000000..cfb0d199b
--- /dev/null
+++ b/poky/meta/recipes-core/dropbear/dropbear_2017.75.bb
@@ -0,0 +1,5 @@
+require dropbear.inc
+
+SRC_URI[md5sum] = "e57e9b9d25705dcb073ba15c416424fd"
+SRC_URI[sha256sum] = "6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c"
+
diff --git a/poky/meta/recipes-core/expat/expat/autotools.patch b/poky/meta/recipes-core/expat/expat/autotools.patch
new file mode 100644
index 000000000..104717eab
--- /dev/null
+++ b/poky/meta/recipes-core/expat/expat/autotools.patch
@@ -0,0 +1,25 @@
+Avoid using expat's m4 files
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Updated to apply over expat 2.1.0
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Index: expat-2.2.5/configure.ac
+===================================================================
+--- expat-2.2.5.orig/configure.ac
++++ expat-2.2.5/configure.ac
+@@ -53,8 +53,6 @@ LIBAGE=6 # CMakeLists.txt!
+ CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
+ AC_CONFIG_HEADER(expat_config.h)
+
+-sinclude(conftools/ac_c_bigendian_cross.m4)
+-
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+
diff --git a/poky/meta/recipes-core/expat/expat/libtool-tag.patch b/poky/meta/recipes-core/expat/expat/libtool-tag.patch
new file mode 100644
index 000000000..0a0aed23e
--- /dev/null
+++ b/poky/meta/recipes-core/expat/expat/libtool-tag.patch
@@ -0,0 +1,30 @@
+From 10342e6b600858b091bc7771e454d9e06af06410 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Nov 2017 18:20:57 +0800
+Subject: [PATCH] Add CC tag to build
+
+Add CC tag to build
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 9560a95..d444bd6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -319,7 +319,7 @@ LIBCURRENT = @LIBCURRENT@
+ LIBOBJS = @LIBOBJS@
+ LIBREVISION = @LIBREVISION@
+ LIBS = @LIBS@
+-LIBTOOL = @LIBTOOL@
++LIBTOOL = @LIBTOOL@ --tag CC
+ LIPO = @LIPO@
+ LN_S = @LN_S@
+ LTLIBOBJS = @LTLIBOBJS@
+--
+2.7.4
+
diff --git a/poky/meta/recipes-core/expat/expat_2.2.5.bb b/poky/meta/recipes-core/expat/expat_2.2.5.bb
new file mode 100644
index 000000000..c68a2ef36
--- /dev/null
+++ b/poky/meta/recipes-core/expat/expat_2.2.5.bb
@@ -0,0 +1,23 @@
+SUMMARY = "A stream-oriented XML parser library"
+DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)"
+HOMEPAGE = "http://expat.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5b8620d98e49772d95fc1d291c26aa79"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \
+ file://autotools.patch \
+ file://libtool-tag.patch \
+ "
+
+SRC_URI[md5sum] = "789e297f547980fc9ecc036f9a070d49"
+SRC_URI[sha256sum] = "d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6"
+
+inherit autotools lib_package
+
+do_configure_prepend () {
+ rm -f ${S}/conftools/libtool.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-core/fts/fts.bb b/poky/meta/recipes-core/fts/fts.bb
new file mode 100644
index 000000000..02f54086a
--- /dev/null
+++ b/poky/meta/recipes-core/fts/fts.bb
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "POSIX file tree stream operations library"
+HOMEPAGE = "https://sites.google.com/a/bostic.com/keithbostic"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5ffe358174aad383f1b69ce3b53da982"
+SECTION = "libs"
+
+SRCREV = "944333aed9dc24cfa76cc64bfe70c75d25652753"
+PV = "1.2+git${SRCPV}"
+
+SRC_URI = "git://github.com/voidlinux/musl-fts \
+"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch
new file mode 100644
index 000000000..35a131067
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch
@@ -0,0 +1,58 @@
+From 04bd40fe2c48c6e01ab418a04d27c4aff644ad96 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Feb 2016 23:54:02 -0500
+Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
+ BISON_LOCALEDIR
+
+The variable BISON_LOCALEDIR is assigned only by the output of
+'bison --print-localedir', we add option --with-bisonlocaledir
+to assign it explicitly. It is helpful for user to split the
+native compile and cross compile.
+
+For backward compatibility, if option not used, it still
+make use of the output of 'bison --print-localedir'.
+
+Upstream-Status: Submitted [bison-patches@gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gettext-tools/gnulib-m4/bison-i18n.m4 | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gettext-tools/gnulib-m4/bison-i18n.m4 b/gettext-tools/gnulib-m4/bison-i18n.m4
+index f5cfd3a..fb6ac4d 100644
+--- a/gettext-tools/gnulib-m4/bison-i18n.m4
++++ b/gettext-tools/gnulib-m4/bison-i18n.m4
+@@ -14,11 +14,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+ dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+ AC_DEFUN([BISON_I18N],
+ [
++ dnl Default is not to set bisonlocaledir
++ AC_ARG_WITH([bisonlocaledir],
++ [ --with-bisonlocaledir sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
++ BISON_LOCALEDIR=$withval,
++ BISON_LOCALEDIR=)
++
+ if test -z "$USE_NLS"; then
+ echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+ exit 1
+ fi
+- BISON_LOCALEDIR=
+ BISON_USE_NLS=no
+ if test "$USE_NLS" = yes; then
+ dnl Determine bison's localedir.
+@@ -26,9 +31,10 @@ AC_DEFUN([BISON_I18N],
+ dnl But even is YACC is called "yacc", it may be a script that invokes bison
+ dnl and accepts the --print-localedir option.
+ dnl YACC's default value is empty; BISON's default value is :.
+- if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
++ if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
+ BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+ fi
++ AC_MSG_RESULT([$BISON_LOCALEDIR])
+ AC_SUBST([BISON_LOCALEDIR])
+ if test -n "$BISON_LOCALEDIR"; then
+ dnl There is no need to enable internationalization if the user doesn't
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
new file mode 100644
index 000000000..6af160419
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
@@ -0,0 +1,87 @@
+From e546de65a333789e83f5485757967cee29ee3681 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 19 Feb 2017 23:32:46 -0800
+Subject: [PATCH] cr-statement.c/timsort.h: fix formatting issues
+
+Fixed when compile with "-Wformat -Wformat-security -Werror=format-security":
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c: In function 'cr_statement_dump_charset':
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c:2661:17: error: format not a string literal and no format arguments [-Werror=format-security]
+| fprintf (a_fp, str) ;
+
+And:
+gettext-tools/gnulib-lib/libxml/timsort.h:326:80: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
+ fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ gettext-tools/gnulib-lib/libcroco/cr-statement.c | 10 +++++-----
+ gettext-tools/gnulib-lib/libxml/timsort.h | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gettext-tools/gnulib-lib/libcroco/cr-statement.c b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+index 617520f..100104b 100644
+--- a/gettext-tools/gnulib-lib/libcroco/cr-statement.c
++++ b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+@@ -2607,7 +2607,7 @@ cr_statement_dump_ruleset (CRStatement * a_this, FILE * a_fp, glong a_indent)
+ g_return_if_fail (a_fp && a_this);
+ str = cr_statement_ruleset_to_string (a_this, a_indent);
+ if (str) {
+- fprintf (a_fp, str);
++ fprintf (a_fp, "%s", str);
+ g_free (str);
+ str = NULL;
+ }
+@@ -2658,7 +2658,7 @@ cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+ str = cr_statement_charset_to_string (a_this,
+ a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2685,7 +2685,7 @@ cr_statement_dump_page (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+
+ str = cr_statement_at_page_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str);
++ fprintf (a_fp, "%s", str);
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2711,7 +2711,7 @@ cr_statement_dump_media_rule (CRStatement * a_this,
+
+ str = cr_statement_media_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2737,7 +2737,7 @@ cr_statement_dump_import_rule (CRStatement * a_this, FILE * a_fp,
+
+ str = cr_statement_import_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+diff --git a/gettext-tools/gnulib-lib/libxml/timsort.h b/gettext-tools/gnulib-lib/libxml/timsort.h
+index 795f272..443918a 100644
+--- a/gettext-tools/gnulib-lib/libxml/timsort.h
++++ b/gettext-tools/gnulib-lib/libxml/timsort.h
+@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
+ SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
+ if (tempstore == NULL)
+ {
+- fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
++ fprintf(stderr, "Error allocating temporary storage for tim sort: need %zu bytes", sizeof(SORT_TYPE) * new_size);
+ exit(1);
+ }
+ store->storage = tempstore;
+--
+2.10.2
+
diff --git a/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch
new file mode 100644
index 000000000..c8e2c94af
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch
@@ -0,0 +1,23 @@
+instal libgettextlib.a before removing it
+
+In a multiple job build, Makefile can simultaneously
+be installing and removing libgettextlib.a. We serialize
+the operations.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/gettext-tools/gnulib-lib/Makefile.am
++++ b/gettext-tools/gnulib-lib/Makefile.am
+@@ -57,6 +57,10 @@ endif
+ # Rules generated and collected by gnulib-tool.
+ include Makefile.gnulib
+
++# defined in Makefile.gnulib but missing this dependency
++#
++install-exec-clean: install-libLTLIBRARIES
++
+ # Which classes to export from the shared library.
+ MOOPPFLAGS += --dllexport=styled_ostream
+
diff --git a/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch
new file mode 100644
index 000000000..6156a153f
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch
@@ -0,0 +1,321 @@
+For reasons which I just can't fathom gnulib doesn't use the expected tools to
+find libraries but badly reinvents the wheel. This will trivially lead to host
+contamination (explicit searches of /usr/lib) or incorrect RPATHs (bad
+canonicalisation resulting in relative paths).
+
+Simply delete all the crazy, and replace with a single call to pkg-config.
+
+Upstream-Status: Inappropriate (upstream still refuse to consider pkg-config)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/gnulib-local/m4/libcroco.m4 b/gnulib-local/m4/libcroco.m4
+index f79ea82f1..1f67274db 100644
+--- a/gettext-tools/gnulib-m4/libcroco.m4
++++ b/gettext-tools/gnulib-m4/libcroco.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBCROCO],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ dnl libcroco depends on libglib.
+ AC_REQUIRE([gl_LIBGLIB])
+
+@@ -23,65 +24,10 @@ AC_DEFUN([gl_LIBCROCO],
+ LTLIBCROCO=
+ INCCROCO=
+ if test "$gl_cv_libcroco_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libcroco-0.6, or have to
+- dnl use the included one.
+- AC_CACHE_VAL([gl_cv_libcroco], [
+- gl_cv_libcroco=no
+- gl_cv_LIBCROCO=
+- gl_cv_LTLIBCROCO=
+- gl_cv_INCCROCO=
+- gl_save_LIBS="$LIBS"
+- dnl Search for libcroco and define LIBCROCO_0_6, LTLIBCROCO_0_6 and
+- dnl INCCROCO_0_6 accordingly.
+- dnl Don't use croco-0.6-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- AC_LIB_LINKFLAGS_BODY([croco-0.6], [glib-2.0])
+- LIBS="$gl_save_LIBS $LIBCROCO_0_6"
+- AC_TRY_LINK([#include <libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- ])
+- if test "$gl_cv_libcroco" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCCROCO_0_6"
+- AC_TRY_LINK([#include <libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- gl_cv_INCCROCO="$INCCROCO_0_6"
+- ])
+- if test "$gl_cv_libcroco" != yes; then
+- dnl Often the include files are installed in
+- dnl /usr/include/libcroco-0.6/libcroco.
+- AC_TRY_LINK([#include <libcroco-0.6/libcroco/libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_ABSOLUTE_HEADER([libcroco-0.6/libcroco/libcroco-config.h])
+- libcroco_include_dir=`echo "$gl_cv_absolute_libcroco_0_6_libcroco_libcroco_config_h" | sed -e 's,.libcroco-config\.h$,,'`
+- if test -d "$libcroco_include_dir"; then
+- gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- gl_cv_INCCROCO="-I$libcroco_include_dir"
+- fi
+- ])
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for libcroco])
+- AC_MSG_RESULT([$gl_cv_libcroco])
+- if test $gl_cv_libcroco = yes; then
+- LIBCROCO="$gl_cv_LIBCROCO"
+- LTLIBCROCO="$gl_cv_LTLIBCROCO"
+- INCCROCO="$gl_cv_INCCROCO"
+- else
+- gl_cv_libcroco_use_included=yes
+- fi
++ PKG_CHECK_MODULES([CROCO], [libcroco-0.6])
++ LIBCROCO=$CROCO_LIBS
++ LTLIBCROCO=$CROCO_LIBS
++ INCCROCO=$CROCO_CFLAGS
+ fi
+ AC_SUBST([LIBCROCO])
+ AC_SUBST([LTLIBCROCO])
+diff --git a/gnulib-local/m4/libglib.m4 b/gnulib-local/m4/libglib.m4
+index 42e55e6fd..ab25a5b22 100644
+--- a/gettext-tools/gnulib-m4/libglib.m4
++++ b/gettext-tools/gnulib-m4/libglib.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBGLIB],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AC_MSG_CHECKING([whether included glib is requested])
+ AC_ARG_WITH([included-glib],
+ [ --with-included-glib use the glib2 included here],
+@@ -20,76 +21,10 @@ AC_DEFUN([gl_LIBGLIB],
+ LTLIBGLIB=
+ INCGLIB=
+ if test "$gl_cv_libglib_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libglib-2.0, or have to use
+- dnl the included one.
+- AC_CACHE_VAL([gl_cv_libglib], [
+- gl_cv_libglib=no
+- gl_cv_LIBGLIB=
+- gl_cv_LTLIBGLIB=
+- gl_cv_INCGLIB=
+- gl_save_LIBS="$LIBS"
+- dnl Search for libglib2 and define LIBGLIB_2_0, LTLIBGLIB_2_0 and
+- dnl INCGLIB_2_0 accordingly.
+- dnl Don't use glib-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- AC_LIB_LINKFLAGS_BODY([glib-2.0])
+- LIBS="$gl_save_LIBS $LIBGLIB_2_0"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- ])
+- if test "$gl_cv_libglib" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCGLIB_2_0"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- gl_cv_INCGLIB="$INCGLIB_2_0"
+- ])
+- if test "$gl_cv_libglib" != yes; then
+- dnl Often the include files are installed in /usr/include/glib-2.0
+- dnl and /usr/lib/glib-2.0/include.
+- if test -n "$LIBGLIB_2_0_PREFIX"; then
+- CPPFLAGS="$gl_save_CPPFLAGS -I$LIBGLIB_2_0_PREFIX/include/glib-2.0 -I$LIBGLIB_2_0_PREFIX/$acl_libdirstem/glib-2.0/include"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- gl_cv_INCGLIB="-I$LIBGLIB_2_0_PREFIX/include/glib-2.0 -I$LIBGLIB_2_0_PREFIX/$acl_libdirstem/glib-2.0/include"
+- ])
+- fi
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for glib])
+- AC_MSG_RESULT([$gl_cv_libglib])
+- if test $gl_cv_libglib = yes; then
+- LIBGLIB="$gl_cv_LIBGLIB"
+- LTLIBGLIB="$gl_cv_LTLIBGLIB"
+- INCGLIB="$gl_cv_INCGLIB"
+- else
+- gl_cv_libglib_use_included=yes
+- fi
++ PKG_CHECK_MODULES([GLIB], [glib-2.0])
++ LIBGLIB="$GLIB_LIBS"
++ LTLIBGLIB="$GLIB_LIBS"
++ INCGLIB="$GLIB_CFLAGS"
+ fi
+ AC_SUBST([LIBGLIB])
+ AC_SUBST([LTLIBGLIB])
+diff --git a/gnulib-local/m4/libxml.m4 b/gnulib-local/m4/libxml.m4
+index 480c700d2..cb39309d5 100644
+--- a/gettext-tools/gnulib-m4/libxml.m4
++++ b/gettext-tools/gnulib-m4/libxml.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBXML],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AC_REQUIRE([AM_ICONV_LINK])
+
+ AC_MSG_CHECKING([whether included libxml is requested])
+@@ -22,100 +22,10 @@ AC_DEFUN([gl_LIBXML],
+ LTLIBXML=
+ INCXML=
+ if test "$gl_cv_libxml_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libxml2, or have to use
+- dnl the included one.
+- AC_CACHE_VAL([gl_cv_libxml], [
+- gl_cv_libxml=no
+- gl_cv_LIBXML=
+- gl_cv_LTLIBXML=
+- gl_cv_INCXML=
+- gl_save_LIBS="$LIBS"
+- LIBS="$LIBS $LIBICONV"
+- dnl Search for libxml2 and define LIBXML2, LTLIBXML2 and INCXML2
+- dnl accordingly.
+- dnl Don't use xml2-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- dnl Use a test program that tries to invoke xmlFree. On Cygwin 1.7.x,
+- dnl libxml2 is built in such a way that uses of xmlFree work fine with
+- dnl -Wl,--enable-auto-import but lead to a link error with
+- dnl -Wl,--disable-auto-import.
+- AC_LIB_LINKFLAGS_BODY([xml2])
+- LIBS="$gl_save_LIBS $LIBXML2 $LIBICONV"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- ])
+- if test "$gl_cv_libxml" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCXML2"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- gl_cv_INCXML="$INCXML2"
+- ])
+- if test "$gl_cv_libxml" != yes; then
+- dnl Often the include files are installed in /usr/include/libxml2.
+- dnl In libxml2-2.5, <libxml/xmlversion.h> is self-contained.
+- dnl In libxml2-2.6, it includes <libxml/xmlexports.h> which is
+- dnl self-contained.
+- libxml2_include_dir=
+- AC_TRY_CPP([#include <libxml2/libxml/xmlexports.h>],
+- [gl_ABSOLUTE_HEADER([libxml2/libxml/xmlexports.h])
+- libxml2_include_dir=`echo "$gl_cv_absolute_libxml2_libxml_xmlexports_h" | sed -e 's,.libxml.xmlexports\.h$,,'`
+- ])
+- if test -z "$libxml2_include_dir"; then
+- AC_TRY_CPP([#include <libxml2/libxml/xmlversion.h>],
+- [gl_ABSOLUTE_HEADER([libxml2/libxml/xmlversion.h])
+- libxml2_include_dir=`echo "$gl_cv_absolute_libxml2_libxml_xmlversion_h" | sed -e 's,.libxml.xmlversion\.h$,,'`
+- ])
+- fi
+- if test -n "$libxml2_include_dir" && test -d "$libxml2_include_dir"; then
+- CPPFLAGS="$gl_save_CPPFLAGS -I$libxml2_include_dir"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- gl_cv_INCXML="-I$libxml2_include_dir"
+- ])
+- fi
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for libxml])
+- AC_MSG_RESULT([$gl_cv_libxml])
+- if test $gl_cv_libxml = yes; then
+- LIBXML="$gl_cv_LIBXML"
+- LTLIBXML="$gl_cv_LTLIBXML"
+- INCXML="$gl_cv_INCXML"
+- else
+- gl_cv_libxml_use_included=yes
+- fi
++ PKG_CHECK_MODULES([XML], [libxml-2.0])
++ LIBXML=$XML_LIBS
++ LTLIBXML=$XML_LIBS
++ INCXML=$XML_CFLAGS
+ fi
+ AC_SUBST([LIBXML])
+ AC_SUBST([LTLIBXML])
+diff --git a/gnulib-local/lib/term-styled-ostream.oo.c b/gnulib-local/lib/term-styled-ostream.oo.c
+index 81a407467..218565329 100644
+--- a/gettext-tools/gnulib-lib/term-styled-ostream.oo.c
++++ b/gettext-tools/gnulib-lib/term-styled-ostream.oo.c
+@@ -25,4 +25,4 @@
+-#include <cr-om-parser.h>
+-#include <cr-sel-eng.h>
+-#include <cr-style.h>
+-#include <cr-rgb.h>
++#include <libcroco/cr-om-parser.h>
++#include <libcroco/cr-sel-eng.h>
++#include <libcroco/cr-style.h>
++#include <libcroco/cr-rgb.h>
+@@ -31 +31 @@
+-# include <cr-fonts.h>
++# include <libcroco/cr-fonts.h>
+@@ -33 +33 @@
+-#include <cr-string.h>
++#include <libcroco/cr-string.h>
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
new file mode 100644
index 000000000..29ef2a5a6
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,38 @@
+[PATCH] Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guile-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/iconv.m4 b/iconv.m4
+index 4e37363..35f54bd 100644
+--- a/iconv.m4
++++ b/iconv.m4
+@@ -165,6 +165,7 @@ AC_DEFUN([AM_ICONV_LINK],
+ }
+ }
+ #endif
++#if 0
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+@@ -176,6 +177,7 @@ AC_DEFUN([AM_ICONV_LINK],
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
++#endif
+ return result;
+ ]])],
+ [am_cv_func_iconv_works=yes], ,
+--
+2.0.1
+
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING
new file mode 100644
index 000000000..3671ab698
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING
@@ -0,0 +1,4 @@
+dnl Copyright (C) 1995-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in
new file mode 100644
index 000000000..38c293d2e
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in
@@ -0,0 +1,483 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+#
+# Origin: gettext-0.19.8
+GETTEXT_MACRO_VERSION = 0.19
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+# When building gettext-tools, we prefer to use the built programs
+# rather than installed programs. However, we can't do that when we
+# are cross compiling.
+CROSS_COMPILING = @CROSS_COMPILING@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ @$(CHECK_MACRO_VERSION)
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ package_gnu="$(PACKAGE_GNU)"; \
+ test -n "$$package_gnu" || { \
+ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
+ -size -10000000c -exec grep 'GNU @PACKAGE@' \
+ /dev/null '{}' ';' 2>/dev/null; \
+ else \
+ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+ fi; \
+ } | grep -v 'libtool:' >/dev/null; then \
+ package_gnu=yes; \
+ else \
+ package_gnu=no; \
+ fi; \
+ }; \
+ if test "$$package_gnu" = "yes"; then \
+ package_prefix='GNU '; \
+ else \
+ package_prefix=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_prefix}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot-header; then \
+ sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \
+ cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po; \
+ rm -f $(DOMAIN).1po; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(POFILESDEPS)
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz
new file mode 100644
index 000000000..9b2d1f561
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz
Binary files differ
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath
new file mode 100755
index 000000000..98183ff2f
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2016 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin
new file mode 100644
index 000000000..2436c49e7
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb b/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb
new file mode 100644
index 000000000..26ff19975
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Minimal gettext for supporting native autoconf/automake"
+DESCRIPTION = "Contains the m4 macros sufficient to support building \
+autoconf/automake. This provides a significant build time speedup by \
+the removal of gettext-native from most dependency chains (now only \
+needed for gettext for the target)."
+SRC_URI = "file://aclocal.tgz \
+ file://config.rpath \
+ file://Makefile.in.in \
+ file://remove-potcdate.sin \
+ file://COPYING \
+ file://0001-PATCH-Disable-the-test-to-convert-euc-jp.patch \
+"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+LICENSE = "FSF-Unlimited"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4bd090a20bfcd1a18f1f79837b5e3e91"
+
+inherit native
+
+S = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${datadir}/aclocal/
+ cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/
+ install -d ${D}${datadir}/gettext/po/
+ cp ${WORKDIR}/config.rpath ${D}${datadir}/gettext/
+ cp ${WORKDIR}/Makefile.in.in ${D}${datadir}/gettext/po/
+ cp ${WORKDIR}/remove-potcdate.sin ${D}${datadir}/gettext/po/
+}
diff --git a/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb b/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
new file mode 100644
index 000000000..68f5cc329
--- /dev/null
+++ b/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
@@ -0,0 +1,127 @@
+SUMMARY = "Utilities and libraries for producing multi-lingual messages"
+DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. \
+These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file \
+naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and \
+a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
+HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
+SECTION = "libs"
+LICENSE = "GPLv3+ & LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "gettext-native virtual/libiconv"
+DEPENDS_class-native = "gettext-minimal-native"
+PROVIDES = "virtual/libintl virtual/gettext"
+PROVIDES_class-native = "virtual/gettext-native"
+RCONFLICTS_${PN} = "proxy-libintl"
+SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
+ file://parallel.patch \
+ file://add-with-bisonlocaledir.patch \
+ file://cr-statement.c-timsort.h-fix-formatting-issues.patch \
+ file://use-pkgconfig.patch \
+"
+
+SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
+SRC_URI[sha256sum] = "ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43"
+
+inherit autotools texinfo pkgconfig
+
+EXTRA_OECONF += "--without-lispdir \
+ --disable-csharp \
+ --disable-libasprintf \
+ --disable-java \
+ --disable-native-java \
+ --disable-openmp \
+ --disable-acl \
+ --without-emacs \
+ --without-cvs \
+ --without-git \
+ "
+EXTRA_OECONF_append_class-target = " \
+ --with-bisonlocaledir=${datadir}/locale \
+"
+
+PACKAGECONFIG ??= "croco glib libxml"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[croco] = "--without-included-libcroco,--with-included-libcroco,libcroco"
+PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
+PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"
+# Need paths here to avoid host contamination but this can cause RPATH warnings
+# or problems if $libdir isn't $prefix/lib.
+PACKAGECONFIG[libunistring] = "--with-libunistring-prefix=${STAGING_LIBDIR}/..,--with-included-libunistring,libunistring"
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
+acpaths = '-I ${S}/gettext-runtime/m4 \
+ -I ${S}/gettext-tools/m4'
+
+do_install_append_libc-musl () {
+ rm -f ${D}${libdir}/charset.alias
+ rm -f ${D}${includedir}/libintl.h
+ rm -f ${D}${libdir}/libintl.la
+}
+
+# these lack the .x behind the .so, but shouldn't be in the -dev package
+# Otherwise you get the following results:
+# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# because gettext depends on gettext-dev, which pulls in more -dev packages:
+# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
+# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
+# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
+# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
+
+PACKAGES =+ "libgettextlib libgettextsrc"
+FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
+FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
+
+PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+
+# The its/Makefile.am has defined:
+# itsdir = $(pkgdatadir)$(PACKAGE_SUFFIX)/its
+# not itsdir = $(pkgdatadir), so use wildcard to match the version.
+FILES_${PN} += "${datadir}/${BPN}-*/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+ ${bindir}/ngettext \
+ ${bindir}/envsubst \
+ ${bindir}/gettext.sh \
+ ${libdir}/libasprintf.so* \
+ ${libdir}/GNU.Gettext.dll \
+ "
+FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
+ ${includedir}/autosprintf.h \
+ "
+FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
+ ${mandir}/man1/ngettext.* \
+ ${mandir}/man1/envsubst.* \
+ ${mandir}/man1/.* \
+ ${mandir}/man3/* \
+ ${docdir}/gettext/gettext.* \
+ ${docdir}/gettext/ngettext.* \
+ ${docdir}/gettext/envsubst.* \
+ ${docdir}/gettext/*.3.html \
+ ${datadir}/gettext/ABOUT-NLS \
+ ${docdir}/gettext/csharpdoc/* \
+ ${docdir}/libasprintf/autosprintf.html \
+ ${infodir}/autosprintf.info \
+ "
+
+do_install_append() {
+ rm -f ${D}${libdir}/preloadable_libintl.so
+}
+
+do_install_append_class-native () {
+ rm ${D}${datadir}/aclocal/*
+ rm ${D}${datadir}/gettext/config.rpath
+ rm ${D}${datadir}/gettext/po/Makefile.in.in
+ rm ${D}${datadir}/gettext/po/remove-potcdate.sin
+
+ create_wrapper ${D}${bindir}/msgfmt \
+ GETTEXTDATADIR="${STAGING_DATADIR_NATIVE}/gettext-0.19.8/"
+
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
new file mode 100644
index 000000000..aee96aaa6
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
@@ -0,0 +1,42 @@
+From d6501b107940e9f548c89236d773c6d33c15a5c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 16 Apr 2016 13:28:59 -0700
+Subject: [PATCH 1/2] Do not ignore return value of write()
+
+gcc warns about ignoring return value when compiling
+with fortify turned on.
+
+assert when write() fails
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ glib/tests/unix.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/glib/tests/unix.c b/glib/tests/unix.c
+index 3543458..4e7ed85 100644
+--- a/glib/tests/unix.c
++++ b/glib/tests/unix.c
+@@ -32,14 +32,15 @@ test_pipe (void)
+ GError *error = NULL;
+ int pipefd[2];
+ char buf[1024];
+- ssize_t bytes_read;
++ ssize_t bytes_read, bytes_written;
+ gboolean res;
+
+ res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
+ g_assert (res);
+ g_assert_no_error (error);
+
+- write (pipefd[1], "hello", sizeof ("hello"));
++ bytes_written = write (pipefd[1], "hello", sizeof ("hello"));
++ g_assert (bytes_written != -1 && "write() failed");
+ memset (buf, 0, sizeof (buf));
+ bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
+ g_assert_cmpint (bytes_read, >, 0);
+--
+2.8.0
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch
new file mode 100644
index 000000000..561d10020
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch
@@ -0,0 +1,31 @@
+From 80682c171ccb27d01343d4cfcfb4dd49b7863ccc Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 22 Mar 2016 15:14:58 +0200
+Subject: [PATCH] Install gio-querymodules as libexec_PROGRAM
+
+We want to install this binary with the gio library, and debian
+renamer does not cope with library packages with files in ${bindir}
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Inappropriate [OE specific]
+---
+ gio/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index b7f91cc..4d81cc0 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -702,7 +702,8 @@ gio.def: libgio-2.0.la
+ gio-2.0.lib: libgio-2.0.la gio.def
+ $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gio.def -out:$@
+
+-bin_PROGRAMS = gio-querymodules glib-compile-schemas glib-compile-resources gsettings
++bin_PROGRAMS = glib-compile-schemas glib-compile-resources gsettings
++libexec_PROGRAMS = gio-querymodules
+
+ glib_compile_resources_LDADD = libgio-2.0.la \
+ $(top_builddir)/gobject/libgobject-2.0.la \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
new file mode 100644
index 000000000..67ca6240b
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
@@ -0,0 +1,43 @@
+From 2acf40361eecd17c6981743dabd06e25a9934258 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 12 Jun 2015 17:08:46 +0300
+Subject: [PATCH 05/10] Remove the warning about deprecated paths in schemas
+
+Some schemas in gsettings-desktop-schemas (such as proxy and locale)
+are still using deprecated paths, as of 3.16.1. This causes warning
+messages, and meta/lib/oe/rootfs.py complaints about them.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ gio/glib-compile-schemas.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+index b8de090..130f89b 100644
+--- a/gio/glib-compile-schemas.c
++++ b/gio/glib-compile-schemas.c
+@@ -1219,19 +1219,6 @@ parse_state_start_schema (ParseState *state,
+ return;
+ }
+
+- if (path && (g_str_has_prefix (path, "/apps/") ||
+- g_str_has_prefix (path, "/desktop/") ||
+- g_str_has_prefix (path, "/system/")))
+- {
+- gchar *message = NULL;
+- message = g_strdup_printf (_("Warning: Schema “%s†has path “%sâ€. "
+- "Paths starting with "
+- "“/apps/â€, “/desktop/†or “/system/†are deprecated."),
+- id, path);
+- g_printerr ("%s\n", message);
+- g_free (message);
+- }
+-
+ state->schema_state = schema_state_new (path, gettext_domain,
+ extends, extends_name, list_of);
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
new file mode 100644
index 000000000..c6e4966bb
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Test-for-pthread_getname_np-before-using-it.patch
@@ -0,0 +1,70 @@
+From f627fe16099a2b08d8b4e9023ae6b4f352451967 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 08:59:08 -0800
+Subject: [PATCH] Test for pthread_getname_np before using it
+
+Its a GNU extention and not all libc implement it
+musl e.g. implements the setname API but not getname
+in any case, it seems to be safer to check for the
+function before using it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ config.h.in | 3 +++
+ configure.ac | 10 ++++++++++
+ glib/tests/thread.c | 2 +-
+ 3 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/config.h.in b/config.h.in
+index 2c35ff1..da7ac30 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -326,6 +326,9 @@
+ #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP
+
+ /* Have function pthread_setname_np(const char*) */
++#undef HAVE_PTHREAD_GETNAME_NP
++
++/* Have function pthread_setname_np(const char*) */
+ #undef HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID
+
+ /* Have function pthread_setname_np(pthread_t, const char*) */
+diff --git a/configure.ac b/configure.ac
+index 4309671..209770a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2121,6 +2121,16 @@ AS_IF([ test x"$have_threads" = xposix], [
+ AC_DEFINE(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP,1,
+ [Have function pthread_cond_timedwait_relative_np])],
+ [AC_MSG_RESULT(no)])
++ dnl gets thread names
++ AC_MSG_CHECKING(for pthread_getname_np(pthread_t, char*, size_t))
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <pthread.h>],
++ [pthread_getname_np(pthread_self(),"example",0)])],
++ [AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_PTHREAD_GETNAME_NP,1,
++ [Have function pthread_setname_np(const char*)])],
++ [AC_MSG_RESULT(no)])
+ dnl Sets thread names on OS X 10.6, iOS 3.2 (and higher)
+ AC_MSG_CHECKING(for pthread_setname_np(const char*))
+ AC_LINK_IFELSE(
+diff --git a/glib/tests/thread.c b/glib/tests/thread.c
+index 5447836..2f248a6 100644
+--- a/glib/tests/thread.c
++++ b/glib/tests/thread.c
+@@ -174,7 +174,7 @@ test_thread5 (void)
+ static gpointer
+ thread6_func (gpointer data)
+ {
+-#ifdef HAVE_PTHREAD_SETNAME_NP_WITH_TID
++#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) && defined(HAVE_PTHREAD_GETNAME_NP)
+ char name[16];
+
+ pthread_getname_np (pthread_self(), name, 16);
+--
+2.10.2
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch
new file mode 100644
index 000000000..697d63d5f
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch
@@ -0,0 +1,46 @@
+From b9160d951b9af647b97766c57295ca4f45cf9521 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 3 Oct 2017 10:45:55 +0300
+Subject: [PATCH 10/10] Do not hardcode python path into various tools
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +-
+ gobject/glib-genmarshal.in | 2 +-
+ gobject/glib-mkenums.in | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+index 8050981..e693ef3 100644
+--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # GDBus - GLib D-Bus Library
+ #
+diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in
+index 09e8408..b2f9d99 100755
+--- a/gobject/glib-genmarshal.in
++++ b/gobject/glib-genmarshal.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # pylint: disable=too-many-lines, missing-docstring, invalid-name
+
+diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
+index d4bfd11..051fce4 100755
+--- a/gobject/glib-mkenums.in
++++ b/gobject/glib-mkenums.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # If the code below looks horrible and unpythonic, do not panic.
+ #
+--
+2.14.1
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
new file mode 100644
index 000000000..b98f933da
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
@@ -0,0 +1,85 @@
+From d762907d33b81cf7469b5696c87f2188d2050afb Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 9 Nov 2015 11:07:27 +0200
+Subject: [PATCH 06/10] Enable more tests while cross-compiling
+
+Upstream disables a few tests while cross-compiling because their build requires
+running other built binaries. This usually makes sense but in the cross-compile
+case we can depend on glib-2.0-native.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ gio/tests/Makefile.am | 10 ++++++----
+ tests/gobject/Makefile.am | 8 +++++---
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index acc1da4..9176640 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -516,10 +516,9 @@ test_programs += \
+ endif
+
+ # -----------------------------------------------------------------------------
+-# The resources test is a bit more complicated, and we cannot build it when
+-# cross-compiling GIO because it requires running a binary...
++# The resources test is a bit more complicated, and requires glib-native
++# for running a binary
+
+-if !CROSS_COMPILING
+ test_programs += resources
+ resources_SOURCES = resources.c
+ nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
+@@ -543,7 +542,11 @@ if !ENABLE_INSTALLED_TESTS
+ libresourceplugin_la_LDFLAGS += -rpath /
+ endif
+
++if !CROSS_COMPILING
+ glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
++else
++glib_compile_resources=glib-compile-resources
++endif
+
+ test-generated.txt: test1.txt
+ $(AM_V_GEN) echo "Generated" > $@ && \
+@@ -564,7 +567,6 @@ test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --
+
+ EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
+ CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
+-endif # !CROSS_COMPILING
+
+ BUILT_SOURCES += giotypefuncs.inc
+
+diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am
+index 656941d..68555ff 100644
+--- a/tests/gobject/Makefile.am
++++ b/tests/gobject/Makefile.am
+@@ -48,10 +48,13 @@ if ENABLE_TIMELOOP
+ installed_test_programs += timeloop-closure
+ endif
+
+-# The marshal test requires running a binary, which means we cannot
+-# build it when cross-compiling
++# The marshal test requires running a binary, which means we require
++# glib-native when cross-compiling
+ if !CROSS_COMPILING
+ glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
++else
++glib_genmarshal=$(shell which glib-genmarshal)
++endif
+
+ testmarshal.h: stamp-testmarshal.h
+ @true
+@@ -69,7 +72,6 @@ BUILT_SOURCES += testmarshal.h testmarshal.c
+ CLEANFILES += stamp-testmarshal.h
+ EXTRA_DIST += testcommon.h testmarshal.list
+ BUILT_EXTRA_DIST += testmarshal.h testmarshal.c
+-endif # !CROSS_COMPILING
+
+ dist-hook: $(BUILT_EXTRA_DIST)
+ files='$(BUILT_EXTRA_DIST)'; \
+--
+2.14.1
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
new file mode 100644
index 000000000..3d0c008bb
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
@@ -0,0 +1,39 @@
+From c53e94a520b573aa0dcf12903e9563fe8badc34c Mon Sep 17 00:00:00 2001
+From: Marius Avram <marius.avram@intel.com>
+Date: Wed, 27 Aug 2014 12:10:41 +0300
+Subject: [PATCH] Allow /run/media/sdX drive mount if username root
+
+In case that the username logged in the system is root
+the drives are directly mounted in /run/media/sdX and
+not /run/media/<username>/sdX as the function
+g_unix_mount_guess_should_display() expects.
+
+Without this change USB stick mounts are not accesible from
+graphical applications such as the File Manager (pcmanfm).
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marius Avram <marius.avram@intel.com>
+---
+ gio/gunixmounts.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
+index 4999354..f6c1472 100644
+--- a/gio/gunixmounts.c
++++ b/gio/gunixmounts.c
+@@ -2136,6 +2136,11 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
+ mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/')
+ is_in_runtime_dir = TRUE;
+
++ /* Allow no username in path in /run/media if current user is root */
++ if (strcmp(user_name, "root") == 0 &&
++ strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0)
++ is_in_runtime_dir = TRUE;
++
+ if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/"))
+ {
+ char *path;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
new file mode 100644
index 000000000..59b891347
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
@@ -0,0 +1,44 @@
+From 1dd1e6ddca5deada049bac2e1ee1fe4ecc5342c5 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 28 Apr 2012 18:24:50 +0200
+Subject: [PATCH 01/10] configure: use $host_alias-libtool instead of libtool
+ directly
+
+Poky renames libtool to $host_alias-libtool.
+./$host_alias-libtool isn't created until after configure runs with
+libtool >= 2.2.2
+so we can't call # it at this point. We can safely assume a version is
+available
+from PATH though
+
+Rebased to glib-2.27.3 by Dongxiao Xu <dongxiao.xu@intel.com>
+Rebased to glib-2.32.1 by Martin Jansa <Martin.Jansa@gmail.com>
+Rebased to glib-2.31.20+ by Andre McCurdy <armccurdy@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6fa6eb0..b6f78a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1428,9 +1428,9 @@ AS_IF([ test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL" ], [
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ echo "void glib_plugin_test(void) { }" > plugin.c
+- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./$host_alias-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./$host_alias-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ ${LDFLAGS} -module -o plugin.la -export-dynamic \
+ -shrext ".o" -avoid-version plugin.lo \
+ -rpath /dont/care >/dev/null 2>&1
+--
+2.14.1
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
new file mode 100644
index 000000000..f3be02770
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
@@ -0,0 +1,30 @@
+Instead of writing the temporary mapping files in the mappedfile test to the
+user runtime directory, write them to $TMP. The runtime directory may not
+currently exist if the test is executed on a non-desktop system and the test
+doesn't attempt to create the directory structure.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c
+index 40e0e60..27a24be 100644
+--- a/glib/tests/mappedfile.c
++++ b/glib/tests/mappedfile.c
+@@ -81,7 +81,7 @@ test_writable (void)
+ const gchar *new = "abcdefghijklmnopqrstuvxyz";
+ gchar *tmp_copy_path;
+
+- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
+
+ g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
+ g_assert_no_error (error);
+@@ -125,7 +125,7 @@ test_writable_fd (void)
+ int fd;
+ gchar *tmp_copy_path;
+
+- tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
++ tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
+
+ g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
+ g_assert_no_error (error);
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
new file mode 100644
index 000000000..65d5b43f9
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
@@ -0,0 +1,47 @@
+Instead of hard-coding GIO_MODULE_PATH when glib is built, use dladdr() to
+determine where libglib.so is and use that path to calculate GIO_MODULES_DIR.
+
+This solves relocation problems with GIOModule for native builds of glib.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Port patch to 2.48
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gio/giomodule.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gio/giomodule.c b/gio/giomodule.c
+index da7c167..cc0bc7c 100644
+--- a/gio/giomodule.c
++++ b/gio/giomodule.c
+@@ -40,6 +40,8 @@
+ #include "gnetworkmonitor.h"
+ #ifdef G_OS_WIN32
+ #include "gregistrysettingsbackend.h"
++#else
++#include <dlfcn.h>
+ #endif
+ #include <glib/gstdio.h>
+
+@@ -1036,7 +1038,15 @@ get_gio_module_dir (void)
+ #endif
+ g_free (install_dir);
+ #else
+- module_dir = g_strdup (GIO_MODULE_DIR);
++ Dl_info info;
++
++ if (dladdr (g_io_module_new, &info)) {
++ char *libdir = g_path_get_dirname (info.dli_fname);
++ module_dir = g_build_filename (libdir, "gio", "modules", NULL);
++ g_free (libdir);
++ } else {
++ module_dir = g_strdup (GIO_MODULE_DIR);
++ }
+ #endif
+ }
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 000000000..5b85e8fab
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -0,0 +1,5 @@
+#! /bin/sh
+
+useradd glib2-test
+su glib2-test -c gnome-desktop-testing-runner glib
+userdel glib2-test
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch
new file mode 100644
index 000000000..7aa6217d6
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch
@@ -0,0 +1,22 @@
+Fix DATADIRNAME on uclibc/Linux
+
+translation files are always installed under PREFIX/share/locale in uclibc
+based systems therefore lets set DATADIRNAME to "share".
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: glib-2.46.1/m4macros/glib-gettext.m4
+===================================================================
+--- glib-2.46.1.orig/m4macros/glib-gettext.m4
++++ glib-2.46.1/m4macros/glib-gettext.m4
+@@ -243,6 +243,10 @@ msgstr ""
+ CATOBJEXT=.mo
+ DATADIRNAME=share
+ ;;
++ *-*-musl* | *-*-linux-uclibc*)
++ CATOBJEXT=.gmo
++ DATADIRNAME=share
++ ;;
+ *)
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb
new file mode 100644
index 000000000..faf594569
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.54.3.bb
@@ -0,0 +1,24 @@
+require glib.inc
+
+PE = "1"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
+ file://configure-libtool.patch \
+ file://run-ptest \
+ file://ptest-paths.patch \
+ file://uclibc_musl_translation.patch \
+ file://allow-run-media-sdX-drive-mount-if-username-root.patch \
+ file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
+ file://Enable-more-tests-while-cross-compiling.patch \
+ file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
+ file://0001-Do-not-ignore-return-value-of-write.patch \
+ file://0001-Test-for-pthread_getname_np-before-using-it.patch \
+ file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
+ "
+
+SRC_URI_append_class-native = " file://relocate-modules.patch"
+
+SRC_URI[md5sum] = "16e886ad677bf07b7d48eb8188bcf759"
+SRC_URI[sha256sum] = "963fdc6685dc3da8e5381dfb9f15ca4b5709b28be84d9d05a9bb8e446abac0a8"
diff --git a/poky/meta/recipes-core/glib-2.0/glib.inc b/poky/meta/recipes-core/glib-2.0/glib.inc
new file mode 100644
index 000000000..f645ed6f0
--- /dev/null
+++ b/poky/meta/recipes-core/glib-2.0/glib.inc
@@ -0,0 +1,157 @@
+SUMMARY = "A general-purpose utility library"
+DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on."
+HOMEPAGE = "https://developer.gnome.org/glib/"
+
+# pcre is under BSD;
+# docs/reference/COPYING is with a 'public domain'-like license!
+LICENSE = "LGPLv2.1+ & BSD & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
+ file://gmodule/COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://gmodule/gmodule.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
+ file://glib/pcre/COPYING;md5=266ebc3ff74ee9ce6fad65577667c0f4 \
+ file://glib/pcre/pcre.h;beginline=11;endline=35;md5=de27f2bf633d20a2b7af0b1983423283 \
+ file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+
+CVE_PRODUCT = "glib"
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "glib-2.0-native \
+ virtual/libintl \
+ virtual/libiconv \
+ libffi \
+ zlib \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus', '', d)}"
+
+PACKAGES += "${PN}-codegen ${PN}-utils"
+
+LEAD_SONAME = "libglib-2.0.*"
+
+inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages
+
+S = "${WORKDIR}/glib-${PV}"
+
+PACKAGECONFIG ??= "system-pcre libmount"
+# To use the system pcre it must be configured with --enable-unicode-properties
+PACKAGECONFIG[system-pcre] = "--with-pcre=system,--with-pcre=internal,libpcre"
+PACKAGECONFIG[libmount] = "--enable-libmount,--disable-libmount,util-linux"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
+
+CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap"
+
+PRINTF = "--enable-included-printf=no"
+PRINTF_darwin = "--enable-included-printf=yes"
+PRINTF_mingw32 = "--enable-included-printf=yes"
+EXTRA_OECONF = "${PRINTF} ${CORECONF}"
+EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux"
+
+# Tell configure that we'll have dbus-daemon on the target for the tests
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' ac_cv_prog_DBUS_DAEMON=dbus-daemon', '', d)}"
+
+do_configure_prepend() {
+ sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
+}
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS} \
+ ${libdir}/gio \
+ ${libexecdir}/*gio-querymodules \
+ ${datadir}/glib-2.0/schemas"
+FILES_${PN}-dev += "${libdir}/glib-2.0/include \
+ ${libdir}/gio/modules/lib*${SOLIBSDEV} \
+ ${libdir}/gio/modules/*.la \
+ ${bindir}/glib-genmarshal \
+ ${bindir}/glib-gettextize \
+ ${bindir}/glib-mkenums \
+ ${bindir}/glib-compile-resources \
+ ${datadir}/glib-2.0/gettext/po/Makefile.in.in \
+ ${datadir}/glib-2.0/schemas/gschema.dtd \
+ ${datadir}/glib-2.0/valgrind/glib.supp \
+ ${datadir}/gettext/its"
+FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb"
+FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
+ ${bindir}/gdbus-codegen"
+FILES_${PN}-utils = "${bindir}/*"
+
+RRECOMMENDS_${PN} += "shared-mime-info"
+# When cross compiling for Windows we don't want to include this
+RRECOMMENDS_${PN}_remove_mingw32 = "shared-mime-info"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+# Valgrind runtime detection works using hand-written assembly, which
+# doesn't support mips16e
+CPPFLAGS_append_class-target_mips16e = " -DNVALGRIND=1"
+
+# GLib generally requires gettext to be present so for USE_NLS to yes. For
+# native builds as i18n is disabled globally we can tell it to use a fake msgfmt.
+USE_NLS_class-target = "yes"
+USE_NLS_class-nativesdk = "yes"
+CACHED_CONFIGUREVARS_append_class-native = " ac_cv_path_MSGFMT=/bin/false"
+
+EXEEXT = ""
+EXEEXT_mingw32 = ".exe"
+
+do_install_append () {
+ if [ -f ${D}${bindir}/gtester-report ]; then
+ sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|'
+ fi
+
+ # Remove some unpackaged files
+ rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
+
+ if [ -e ${D}${libdir}/charset.alias ]; then
+ rm -f ${D}${libdir}/charset.alias
+ fi
+
+ # Make sure gio-querymodules is unique among multilibs
+ if test "x${MLPREFIX}" != "x"; then
+ mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT}
+ fi
+}
+
+do_install_append_class-target () {
+ # Tests are only installed on targets, not native builds. Separating this out
+ # keeps glib-2.0-native from depending on ${DISTRO_FEATURES}
+ if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
+ if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
+ rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
+ fi
+ fi
+}
+
+CODEGEN_PYTHON_RDEPENDS = "python3 python3-distutils python3-xml"
+CODEGEN_PYTHON_RDEPENDS_mingw32 = ""
+
+RDEPENDS_${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}"
+
+RDEPENDS_${PN}-ptest += "\
+ dbus \
+ gnome-desktop-testing \
+ tzdata \
+ tzdata-americas \
+ tzdata-asia \
+ tzdata-europe \
+ tzdata-posix \
+ shared-mime-info \
+ "
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = "\
+ glibc-gconv-utf-16 \
+ glibc-charmap-utf-8 \
+ glibc-gconv-cp1255 \
+ glibc-charmap-cp1255 \
+ glibc-gconv-utf-32 \
+ glibc-gconv-utf-7 \
+ glibc-gconv-euc-jp \
+ glibc-gconv-iso8859-1 \
+ glibc-gconv-iso8859-15 \
+ glibc-charmap-invariant \
+ glibc-localedata-translit-cjk-variants \
+ "
+
+INSANE_SKIP_${PN}-ptest += "libdir"
diff --git a/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb b/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb
new file mode 100644
index 000000000..2a6f8af2b
--- /dev/null
+++ b/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb
@@ -0,0 +1,29 @@
+SUMMARY = "GLib networking extensions"
+DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
+HOMEPAGE = "http://git.gnome.org/browse/glib-networking/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+SECTION = "libs"
+DEPENDS = "glib-2.0"
+
+SRC_URI[archive.md5sum] = "99867463f182c2767bce0c74bc9cc981"
+SRC_URI[archive.sha256sum] = "eaa787b653015a0de31c928e9a17eb57b4ce23c8cf6f277afaec0d685335012f"
+
+PACKAGECONFIG ??= "ca-certificates gnutls"
+
+# No explicit dependency as it works without ca-certificates installed
+PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
+
+EXTRA_OECONF = "--without-gnome-proxy"
+
+inherit gnomebase gettext upstream-version-is-even gio-module-cache
+
+FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
+FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
+FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb b/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb
new file mode 100644
index 000000000..5e92eb71d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Cross locale generation tool for glibc"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+# Tell autotools that we're working in the localedef directory
+#
+AUTOTOOLS_SCRIPT_PATH = "${S}/localedef"
+
+inherit native
+inherit autotools
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
+
+SRCBRANCH ?= "release/${PV}/master"
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
+
+SRCREV_glibc ?= "df3ff4e49d4ee3cbbdaeb0b1cb5dc2344c08be98"
+SRCREV_localedef ?= "de5bdbd5e76b5403a4151b9b9f958b6cca36b3e7"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
+ file://0015-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0016-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0017-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0018-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0019-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0021-eglibc-Install-PIC-archives.patch \
+ file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
+ file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+ file://archive-path.patch \
+"
+# Makes for a rather long rev (22 characters), but...
+#
+SRCREV_FORMAT = "glibc_localedef"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--with-glibc=${S}"
+CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/poky/meta/recipes-core/glibc/glibc-collateral.inc b/poky/meta/recipes-core/glibc/glibc-collateral.inc
new file mode 100644
index 000000000..aa871ac83
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-collateral.inc
@@ -0,0 +1,22 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
+ file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
+HOMEPAGE = "http://www.gnu.org/software/libc/index.html"
+
+# This needs to match with glibc.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_stash_locale"
+
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+
diff --git a/poky/meta/recipes-core/glibc/glibc-common.inc b/poky/meta/recipes-core/glibc/glibc-common.inc
new file mode 100644
index 000000000..b05e162f8
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-common.inc
@@ -0,0 +1,10 @@
+SUMMARY = "GLIBC (GNU C Library)"
+DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel."
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
+ file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
+CVE_PRODUCT = "glibc"
diff --git a/poky/meta/recipes-core/glibc/glibc-initial.inc b/poky/meta/recipes-core/glibc/glibc-initial.inc
new file mode 100644
index 000000000..b86e2fb2d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-initial.inc
@@ -0,0 +1,57 @@
+DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+do_configure () {
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ cfgscript=`python3 -c "import os; print(os.path.relpath('${S}', '.'))"`/configure
+ $cfgscript --host=${TARGET_SYS} --build=${BUILD_SYS} \
+ --prefix=/usr \
+ --without-cvs --disable-sanity-checks \
+ --with-headers=${STAGING_DIR_TARGET}${includedir} \
+ --enable-hacker-mode --enable-addons
+}
+
+do_compile () {
+ :
+}
+
+do_install () {
+ oe_runmake cross-compiling=yes install_root=${D} \
+ includedir='${includedir}' prefix='${prefix}' \
+ install-bootstrap-headers=yes install-headers
+
+ oe_runmake csu/subdir_lib
+ mkdir -p ${D}${libdir}/
+ install -m 644 csu/crt[1in].o ${D}${libdir}
+
+ # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
+ # so do them by hand. We can tolerate an empty stubs.h for the moment.
+ # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
+ mkdir -p ${D}${includedir}/gnu/
+ touch ${D}${includedir}/gnu/stubs.h
+ cp ${S}/include/features.h ${D}${includedir}/features.h
+
+ if [ -e ${B}/bits/stdio_lim.h ]; then
+ cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/
+ fi
+}
+
+do_stash_locale() {
+ :
+}
+
+do_siteconfig () {
+ :
+}
+
+inherit nopackages
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/poky/meta/recipes-core/glibc/glibc-initial_2.27.bb b/poky/meta/recipes-core/glibc/glibc-initial_2.27.bb
new file mode 100644
index 000000000..e86770e12
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-initial_2.27.bb
@@ -0,0 +1,9 @@
+require glibc_${PV}.bb
+require glibc-initial.inc
+
+# main glibc recipes muck with TARGET_CPPFLAGS to point into
+# final target sysroot but we
+# are not there when building glibc-initial
+# so reset it here
+
+TARGET_CPPFLAGS = ""
diff --git a/poky/meta/recipes-core/glibc/glibc-ld.inc b/poky/meta/recipes-core/glibc/glibc-ld.inc
new file mode 100644
index 000000000..c1d635dc8
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-ld.inc
@@ -0,0 +1,48 @@
+def ld_append_if_tune_exists(d, infos, dict):
+ tune = d.getVar("DEFAULTTUNE") or ""
+ libdir = d.getVar("base_libdir") or ""
+ if tune in dict:
+ infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
+ infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
+
+def glibc_dl_info(d):
+ ld_info_all = {
+ "mipsarch": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "mipsarchr6": ["ld-linux-mipsn8.so.1", "FLAG_ELF_LIBC6"],
+ "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+ "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+ "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+ "core2-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+ "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+ "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+ "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+ "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+ "corei7-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+ "corei7-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+ }
+
+ infos = {'ldconfig':set(), 'lddrewrite':set()}
+ ld_append_if_tune_exists(d, infos, ld_info_all)
+
+ #DEFAULTTUNE_MULTILIB_ORIGINAL
+ original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL")
+ if original_tune:
+ localdata = bb.data.createCopy(d)
+ localdata.setVar("DEFAULTTUNE", original_tune)
+ ld_append_if_tune_exists(localdata, infos, ld_info_all)
+
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ localdata = bb.data.createCopy(d)
+ overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ ld_append_if_tune_exists(localdata, infos, ld_info_all)
+ infos['ldconfig'] = ','.join(infos['ldconfig'])
+ infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
+ return infos
+
+EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
+RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
+RTLDLIST_class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}"
+glibc_dl_info[vardepsexclude] = "OVERRIDES"
diff --git a/poky/meta/recipes-core/glibc/glibc-locale.inc b/poky/meta/recipes-core/glibc/glibc-locale.inc
new file mode 100644
index 000000000..b3cb10b87
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-locale.inc
@@ -0,0 +1,98 @@
+require glibc-collateral.inc
+
+SUMMARY = "Locale data from glibc"
+
+BPN = "glibc"
+LOCALEBASEPN = "${MLPREFIX}glibc"
+
+# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy
+# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so')
+# ERROR: Function failed: split_and_strip_files
+BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
+BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
+do_package[depends] += "${BINUTILSDEP}"
+
+# localedef links with libc.so and glibc-collateral.inc inhibits all default deps
+# cannot add virtual/libc to DEPENDS, because it would conflict with libc-initial in RSS
+RDEPENDS_localedef += "glibc"
+
+# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
+# is set. The idea is to avoid running localedef on the target (at first boot)
+# to decrease initial boot time and avoid localedef being killed by the OOM
+# killer which used to effectively break i18n on machines with < 128MB RAM.
+
+# default to disabled
+ENABLE_BINARY_LOCALE_GENERATION ?= "0"
+ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "1"
+
+#enable locale generation on these arches
+# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
+BINARY_LOCALE_ARCHES ?= "arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64"
+
+# set "1" to use cross-localedef for locale generation
+# set "0" for qemu emulation of native localedef for locale generation
+LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
+
+PROVIDES = "virtual/libc-locale"
+
+PACKAGES = "localedef ${PN}-dbg"
+
+PACKAGES_DYNAMIC = "^locale-base-.* \
+ ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
+ ^${MLPREFIX}glibc-gconv$"
+
+# Create a glibc-binaries package
+ALLOW_EMPTY_${BPN}-binaries = "1"
+PACKAGES += "${BPN}-binaries"
+RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}"
+
+# Create a glibc-charmaps package
+ALLOW_EMPTY_${BPN}-charmaps = "1"
+PACKAGES += "${BPN}-charmaps"
+RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}"
+
+# Create a glibc-gconvs package
+ALLOW_EMPTY_${BPN}-gconvs = "1"
+PACKAGES += "${BPN}-gconvs"
+RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}"
+
+# Create a glibc-localedatas package
+ALLOW_EMPTY_${BPN}-localedatas = "1"
+PACKAGES += "${BPN}-localedatas"
+RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}"
+
+DESCRIPTION_localedef = "glibc: compile locale definition files"
+
+# glibc-gconv is dynamically added into PACKAGES, thus
+# FILES_glibc-gconv will not be automatically extended in multilib.
+# Explicitly add ${MLPREFIX} for FILES_glibc-gconv.
+FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
+FILES_localedef = "${bindir}/localedef"
+
+LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+
+do_install () {
+ mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
+ if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
+ cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
+ fi
+ if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
+ mkdir -p ${D}${localedir}
+ cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
+ fi
+ if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
+ cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
+ fi
+ if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
+ cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+ fi
+ if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
+ cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
+ fi
+ chown root:root -R ${D}
+ cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
+}
+
+inherit libc-package
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-core/glibc/glibc-locale_2.27.bb b/poky/meta/recipes-core/glibc/glibc-locale_2.27.bb
new file mode 100644
index 000000000..f7702e035
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-locale_2.27.bb
@@ -0,0 +1 @@
+require glibc-locale.inc
diff --git a/poky/meta/recipes-core/glibc/glibc-mtrace.inc b/poky/meta/recipes-core/glibc/glibc-mtrace.inc
new file mode 100644
index 000000000..d703c14bd
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -0,0 +1,13 @@
+require glibc-collateral.inc
+
+SUMMARY = "mtrace utility provided by glibc"
+DESCRIPTION = "mtrace utility provided by glibc"
+RDEPENDS_${PN} = "perl"
+RPROVIDES_${PN} = "libc-mtrace"
+
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ install -m 0755 ${SRC}/mtrace ${D}${bindir}/
+}
diff --git a/poky/meta/recipes-core/glibc/glibc-mtrace_2.27.bb b/poky/meta/recipes-core/glibc/glibc-mtrace_2.27.bb
new file mode 100644
index 000000000..0b69bad46
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-mtrace_2.27.bb
@@ -0,0 +1 @@
+require glibc-mtrace.inc
diff --git a/poky/meta/recipes-core/glibc/glibc-package.inc b/poky/meta/recipes-core/glibc/glibc-package.inc
new file mode 100644
index 000000000..728bc5381
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-package.inc
@@ -0,0 +1,231 @@
+INHIBIT_SYSROOT_STRIP = "1"
+
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+
+# The ld.so in this glibc supports the GNU_HASH
+RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
+RPROVIDES_${PN}-utils = "eglibc-utils"
+RPROVIDES_${PN}-mtrace = "eglibc-mtrace libc-mtrace"
+RPROVIDES_${PN}-pic = "eglibc-pic"
+RPROVIDES_${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev"
+RPROVIDES_${PN}-staticdev = "eglibc-staticdev"
+RPROVIDES_${PN}-doc = "eglibc-doc"
+RPROVIDES_glibc-extra-nss = "eglibc-extra-nss"
+RPROVIDES_glibc-thread-db = "eglibc-thread-db"
+RPROVIDES_${PN}-pcprofile = "eglibc-pcprofile"
+RPROVIDES_${PN}-dbg = "eglibc-dbg"
+libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/libmvec-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
+libc_baselibs_append_aarch64 = " /lib/ld-linux-aarch64*.so.1"
+INSANE_SKIP_${PN}_append_aarch64 = " libdir"
+
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf"
+FILES_ldd = "${bindir}/ldd"
+FILES_libsegfault = "${base_libdir}/libSegFault*"
+FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
+FILES_libmemusage = "${base_libdir}/libmemusage.so"
+FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
+FILES_sln = "${base_sbindir}/sln"
+FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
+FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
+FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
+FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \
+ ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd"
+FILES_${PN}-mtrace = "${bindir}/mtrace"
+FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${sbindir}/zdump"
+FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
+FILES_catchsegv = "${bindir}/catchsegv"
+RDEPENDS_catchsegv = "libsegfault"
+FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
+FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
+RPROVIDES_${PN}-dev += "libc-dev"
+RPROVIDES_${PN}-staticdev += "libc-staticdev"
+
+SUMMARY_sln = "The static ln"
+DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
+SUMMARY_nscd = "Name service cache daemon"
+DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services."
+SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
+DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services."
+SUMMARY_ldd = "print shared library dependencies"
+DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
+SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc"
+DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, rpcgen, ..."
+DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
+DESCRIPTION_tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+
+inherit libc-common multilib_header
+
+do_install_append () {
+ rm -f ${D}${sysconfdir}/localtime
+ rm -rf ${D}${localstatedir}
+
+ # remove empty glibc dir
+ if [ -d ${D}${libexecdir} ]; then
+ rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
+ fi
+
+ oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h
+
+ if [ -f ${D}${bindir}/mtrace ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
+ fi
+ rm -rf ${D}${includedir}/rpcsvc/rquota*
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
+ # The distro doesn't want these files so let's not install them
+ rm -f ${D}${sysconfdir}/ld.so.conf
+ rm -f ${D}${base_sbindir}/ldconfig
+ # This directory will be empty now so remove it too.
+ # But check whether it exists first, since it won't for glibc-initial.
+ if [ -d ${D}${sysconfdir} ]; then
+ rmdir ${D}${sysconfdir}
+ fi
+ fi
+
+ if echo ${PN}|grep -q "glibc-initial"; then
+ return
+ fi
+
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${localstatedir}/db/nscd
+ install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
+ install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+ sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
+ sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/nscd 755 root root -" \
+ > ${D}${sysconfdir}/tmpfiles.d/nscd.conf
+ else
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d root root 0755 /var/run/nscd none" \
+ > ${D}${sysconfdir}/default/volatiles/98_nscd
+ fi
+}
+
+do_install_append_aarch64 () {
+ if [ "${base_libdir}" != "${nonarch_base_libdir}" ]; then
+ # The aarch64 ABI says the dynamic linker -must- be /lib/ld-linux-aarch64[_be].so.1
+ install -d ${D}${nonarch_base_libdir}
+ if [ -e ${D}${base_libdir}/ld-linux-aarch64.so.1 ]; then
+ ln -s ${@oe.path.relative('${nonarch_base_libdir}', '${base_libdir}')}/ld-linux-aarch64.so.1 \
+ ${D}${nonarch_base_libdir}/ld-linux-aarch64.so.1
+ elif [ -e ${D}${base_libdir}/ld-linux-aarch64_be.so.1 ]; then
+ ln -s ${@oe.path.relative('${nonarch_base_libdir}', '${base_libdir}')}/ld-linux-aarch64_be.so.1 \
+ ${D}${nonarch_base_libdir}/ld-linux-aarch64_be.so.1
+ fi
+ fi
+ do_install_armmultilib
+}
+
+do_install_append_arm () {
+ do_install_armmultilib
+}
+
+do_install_append_armeb () {
+ do_install_armmultilib
+}
+
+do_install_armmultilib () {
+
+ oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h bits/wordsize.h
+ oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h bits/pthreadtypes-arch.h bits/sem.h bits/semaphore.h bits/setjmp.h
+ oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h
+
+ oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
+
+ oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
+}
+
+
+LOCALESTASH = "${WORKDIR}/stashed-locale"
+bashscripts = "mtrace sotruss xtrace"
+
+do_stash_locale () {
+ dest=${LOCALESTASH}
+ install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
+ if [ "${base_libdir}" != "${libdir}" ]; then
+ cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
+ fi
+ if [ -e ${D}${bindir}/localedef ]; then
+ mv -f ${D}${bindir}/localedef ${dest}${bindir}
+ fi
+ if [ -e ${D}${libdir}/gconv ]; then
+ mv -f ${D}${libdir}/gconv ${dest}${libdir}
+ fi
+ if [ -e ${D}${exec_prefix}/lib ]; then
+ cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
+ fi
+ if [ -e ${D}${datadir}/i18n ]; then
+ mv ${D}${datadir}/i18n ${dest}${datadir}
+ fi
+ cp -fpPR ${D}${datadir}/* ${dest}${datadir}
+ rm -rf ${D}${datadir}/locale/
+ cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
+
+ target=${dest}/scripts
+ mkdir -p $target
+ for i in ${bashscripts}; do
+ if [ -f ${D}${bindir}/$i ]; then
+ cp ${D}${bindir}/$i $target/
+ fi
+ done
+}
+
+addtask do_stash_locale after do_install before do_populate_sysroot do_package
+do_stash_locale[dirs] = "${B}"
+do_stash_locale[cleandirs] = "${LOCALESTASH}"
+SSTATETASKS += "do_stash_locale"
+do_stash_locale[sstate-inputdirs] = "${LOCALESTASH}"
+do_stash_locale[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+do_stash_locale[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+
+python do_stash_locale_setscene () {
+ sstate_setscene(d)
+}
+addtask do_stash_locale_setscene
+
+do_poststash_install_cleanup () {
+ # Remove all files which do_stash_locale would remove (mv)
+ # since that task could have come from sstate and not get run.
+ for i in ${bashscripts}; do
+ rm -f ${D}${bindir}/$i
+ done
+ rm -f ${D}${bindir}/localedef
+ rm -rf ${D}${datadir}/i18n
+ rm -rf ${D}${libdir}/gconv
+ rm -rf ${D}/${localedir}
+ rm -rf ${D}${datadir}/locale
+ if [ "${libdir}" != "${exec_prefix}/lib" ]; then
+ if [ -d ${D}${exec_prefix}/lib/locale ] ; then
+ rm -rf ${D}${exec_prefix}/lib/locale
+ # error out if directory isn't empty
+ rm -f ${D}${exec_prefix}/lib
+ fi
+ fi
+}
+addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package
+
+pkg_postinst_nscd () {
+ if [ -z "$D" ]; then
+ if command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
+CONFFILES_nscd="${sysconfdir}/nscd.conf"
+
+SYSTEMD_PACKAGES = "nscd"
+SYSTEMD_SERVICE_nscd = "nscd.service"
diff --git a/poky/meta/recipes-core/glibc/glibc-scripts.inc b/poky/meta/recipes-core/glibc/glibc-scripts.inc
new file mode 100644
index 000000000..2a2b41507
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-scripts.inc
@@ -0,0 +1,20 @@
+require glibc-collateral.inc
+
+SUMMARY = "utility scripts provided by glibc"
+DESCRIPTION = "utility scripts provided by glibc"
+RDEPENDS_${PN} = "bash glibc-mtrace"
+
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+
+bashscripts = "sotruss xtrace"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ for i in ${bashscripts}; do
+ install -m 0755 ${SRC}/$i ${D}${bindir}/
+ done
+}
+
+# sotruss script requires sotruss-lib.so (given by libsotruss package),
+# to produce trace of the library calls.
+RDEPENDS_${PN} += "libsotruss"
diff --git a/poky/meta/recipes-core/glibc/glibc-scripts_2.27.bb b/poky/meta/recipes-core/glibc/glibc-scripts_2.27.bb
new file mode 100644
index 000000000..5a89bd802
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-scripts_2.27.bb
@@ -0,0 +1 @@
+require glibc-scripts.inc
diff --git a/poky/meta/recipes-core/glibc/glibc-testing.inc b/poky/meta/recipes-core/glibc/glibc-testing.inc
new file mode 100644
index 000000000..0a42ae7f7
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc-testing.inc
@@ -0,0 +1,95 @@
+do_compile_append () {
+ # now generate script to drive testing
+ echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testglibc
+ set >> ${B}/${HOST_PREFIX}testglibc
+ # prune out the unneeded vars
+ sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testglibc
+
+ # point to real sysroot not the toolchain bootstrap sysroot
+ sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testglibc
+
+ # use the final cross-gcc to test since some tests need libstdc++
+ sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testglibc
+
+ # append execution part script
+cat >> ${B}/${HOST_PREFIX}testglibc << STOP
+target="\$1"
+if [ "x\$target" = "x" ]
+then
+ echo "Please specify the target machine and remote user in form of user@target"
+ exit 1;
+fi
+ssh \$target ls \$PWD\ 2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+ echo "Failed connecting to \$target it could be because of:"
+ echo "1. You dont have passwordless ssh setup to access \$target"
+ echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
+ echo " The tree should be accessible at same location on build host and target"
+ echo " You can add nfs-client to IMAGE_FEATURES to get the nfs client on target"
+ echo "3. nfs server on build host is not running."
+ echo " Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
+ echo " to test as root user on target (usually its recommended to create a non"
+ echo " root user."
+ echo " As a sanity check make sure that target can read/write to the glibc build tree"
+ echo " Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
+ exit 1
+fi
+ echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
+ echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
+ fgrep tcbootstrap ${B}/config.make > ${B}/configparms
+ sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+
+# g++ uses flag -nostdinc, so the locations of system include headers must be explicitly specified
+# If the locations are not already specified in config.make, then we provide the following locations:
+# <sysroot>/usr/include/c++/<g++ version>
+# <sysroot>/usr/include/c++/<g++ version>/<machine>
+
+cxxincludes=\`cat ${B}/config.make | gawk '\$1 == "c++-sysincludes"' | gawk -F"=" '{print \$2}' | sed "s/[ \t]\?//g"\`
+
+if [ -z "\$cxxincludes" ]; then
+ sysroot=\`cat ${B}/configparms | sed -n "/CXX/p" | sed -e "s/^.*--sysroot=//"\`
+ cxx=\`cat ${B}/configparms | gawk '\$1 ~ /^CXX/' | gawk -F"=" '{print \$2}' | gawk '{print \$1}'\`
+ cxxmachine=\`\$cxx -dumpmachine\`
+ cxxversion=\`\$cxx -dumpversion\`
+ # pass the new value of c++-sysincludes via configparms
+ echo "# c++-sysincludes added:" >> ${B}/configparms
+ echo "c++-sysincludes = -isystem \$sysroot/usr/include/c++/\$cxxversion -isystem \$sysroot/usr/include/c++/\$cxxversion/\$cxxmachine" >> ${B}/configparms
+fi
+
+wrapper="${S}/scripts/cross-test-ssh.sh \$target"
+localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
+make tests-clean
+make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
+rm -rf ${B}/configparms
+STOP
+
+ chmod +x ${B}/${HOST_PREFIX}testglibc
+}
diff --git a/poky/meta/recipes-core/glibc/glibc.inc b/poky/meta/recipes-core/glibc/glibc.inc
new file mode 100644
index 000000000..ce1222be6
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc.inc
@@ -0,0 +1,89 @@
+require glibc-common.inc
+require glibc-ld.inc
+require glibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+python () {
+ opt_effective = "-O"
+ for opt in d.getVar('SELECTED_OPTIMIZATION').split():
+ if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
+ opt_effective = opt
+ if opt_effective == "-O0":
+ bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
+ if opt_effective in ("-O", "-O1", "-Os"):
+ bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN'), opt_effective))
+ d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
+}
+
+# siteconfig.bbclass runs configure which needs a working compiler
+# For the compiler to work we need a working libc yet libc isn't
+# in the sysroots directory at this point. This means the libc.so
+# linker script won't work as the --sysroot setting isn't correct.
+# Here we create a hacked up libc linker script and pass in the right
+# flags to let configure work. Ugly.
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
+siteconfig_do_siteconfig_gencache_prepend = " \
+ mkdir -p ${WORKDIR}/site_config_libc; \
+ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
+ sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
+"
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
+#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
+
+CRYPTPROVIDES = "virtual/crypt"
+CRYPTPROVIDES_class-nativesdk = ""
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc ${CRYPTPROVIDES}"
+PROVIDES += "virtual/libintl virtual/libiconv"
+inherit autotools texinfo distro_features_check systemd
+
+LEAD_SONAME = "libc.so"
+
+CACHED_CONFIGUREVARS += " \
+ ac_cv_path_BASH_SHELL=${base_bindir}/bash \
+ libc_cv_slibdir=${base_libdir} \
+ libc_cv_rootsbindir=${base_sbindir} \
+ libc_cv_localedir=${localedir} \
+ libc_cv_ssp_strong=no \
+ libc_cv_ssp_all=no \
+ libc_cv_ssp=no \
+"
+
+GLIBC_EXTRA_OECONF ?= ""
+GLIBC_EXTRA_OECONF_class-nativesdk = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+# This needs to match with glibc-collateral.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
+# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
+EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
+EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
+EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
+PARALLEL_MAKE = ""
+
+# glibc make-syscalls.sh has a number of issues with /bin/dash and
+# it's output which make calls via the SHELL also has issues, so
+# ensure make uses /bin/bash
+EXTRA_OEMAKE += "SHELL=/bin/bash"
+
+do_configure_prepend() {
+ sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+}
+
+GLIBC_ADDONS ?= "nptl,libidn"
+
+# Enable backtrace from abort()
+do_configure_append_arm () {
+ echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+ echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+}
diff --git a/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
new file mode 100644
index 000000000..86234c9d2
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -0,0 +1,69 @@
+From bd91b60ce6ff01f49b173b6b45e23ce94911b2a6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:48:24 +0000
+Subject: [PATCH 01/27] nativesdk-glibc: Look for host system ld.so.cache as
+ well
+
+Upstream-Status: Inappropriate [embedded specific]
+
+The default lib search path order is:
+
+ 1) LD_LIBRARY_PATH
+ 2) RPATH from the binary
+ 3) ld.so.cache
+ 4) default search paths embedded in the linker
+
+For nativesdk binaries which are being used alongside binaries on a host system, we
+need the search paths to firstly search the shipped nativesdk libs but then also
+cover the host system. For example we want the host system's libGL and this may be
+in a non-standard location like /usr/lib/mesa. The only place the location is know
+about is in the ld.so.cache of the host system.
+
+Since nativesdk has a simple structure and doesn't need to use a cache itself, we
+repurpose the cache for use as a last resort in finding host system binaries. This
+means we need to switch the order of 3 and 4 above to make this work effectively.
+
+RP 14/10/2010
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 7554a99b5a..a73d11a62f 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2007,6 +2007,14 @@ _dl_map_object (struct link_map *loader, const char *name,
+ }
+ }
+
++ /* try the default path. */
++ if (fd == -1
++ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
++ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
++ && rtld_search_dirs.dirs != (void *) -1)
++ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
++ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
++ /* Finally try ld.so.cache */
+ #ifdef USE_LDCONFIG
+ if (fd == -1
+ && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2065,14 +2073,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ }
+ #endif
+
+- /* Finally, try the default path. */
+- if (fd == -1
+- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
+- || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
+- && rtld_search_dirs.dirs != (void *) -1)
+- fd = open_path (name, namelen, mode, &rtld_search_dirs,
+- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
+-
+ /* Add another newline when we are tracing the library loading. */
+ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+ _dl_debug_printf ("\n");
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
new file mode 100644
index 000000000..899481f05
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -0,0 +1,50 @@
+From 50736f7fc1fdc9e1f7c05f1fec75c977d9be9228 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:50:00 +0000
+Subject: [PATCH 02/27] nativesdk-glibc: Fix buffer overrun with a relocated
+ SDK
+
+When ld-linux-*.so.2 is relocated to a path that is longer than the
+original fixed location, the dynamic loader will crash in open_path
+because it implicitly assumes that max_dirnamelen is a fixed size that
+never changes.
+
+The allocated buffer will not be large enough to contain the directory
+path string which is larger than the fixed location provided at build
+time.
+
+Upstream-Status: Inappropriate [OE SDK specific]
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index a73d11a62f..62e3eee478 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1707,7 +1707,19 @@ open_path (const char *name, size_t namelen, int mode,
+ given on the command line when rtld is run directly. */
+ return -1;
+
++ do
++ {
++ struct r_search_path_elem *this_dir = *dirs;
++ if (this_dir->dirnamelen > max_dirnamelen)
++ {
++ max_dirnamelen = this_dir->dirnamelen;
++ }
++ }
++ while (*++dirs != NULL);
++
+ buf = alloca (max_dirnamelen + max_capstrlen + namelen);
++
++ dirs = sps->dirs;
+ do
+ {
+ struct r_search_path_elem *this_dir = *dirs;
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
new file mode 100644
index 000000000..03f99916f
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -0,0 +1,140 @@
+From 695e1cbff6ee6db3435c33e55311c67adf44476d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:51:38 +0000
+Subject: [PATCH 03/27] nativesdk-glibc: Raise the size of arrays containing dl
+ paths
+
+This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
+and lengths as well as ld.so.cache path in the dynamic loader to specific
+sections in memory. The sections that contain paths have been allocated a 4096
+byte section, which is the maximum path length in linux. This will allow the
+relocating script to parse the ELF binary, detect the section and easily replace
+the strings in a certain path.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-cache.c | 4 ++++
+ elf/dl-load.c | 4 ++--
+ elf/interp.c | 2 +-
+ elf/ldconfig.c | 3 +++
+ elf/rtld.c | 5 +++--
+ iconv/gconv_conf.c | 2 +-
+ sysdeps/generic/dl-cache.h | 4 ----
+ 7 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 6ee5153ff9..37a5f701fa 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -133,6 +133,10 @@ do \
+ while (0)
+
+
++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) =
++ SYSCONFDIR "/ld.so.cache";
++
++
+ int
+ _dl_cache_libcmp (const char *p1, const char *p2)
+ {
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 62e3eee478..6ddba73650 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -109,8 +109,8 @@ static size_t max_capstrlen attribute_relro;
+ gen-trusted-dirs.awk. */
+ #include "trusted-dirs.h"
+
+-static const char system_dirs[] = SYSTEM_DIRS;
+-static const size_t system_dirs_len[] =
++static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS;
++volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) =
+ {
+ SYSTEM_DIRS_LEN
+ };
+diff --git a/elf/interp.c b/elf/interp.c
+index 9cd50c7291..fc2f39d73c 100644
+--- a/elf/interp.c
++++ b/elf/interp.c
+@@ -18,5 +18,5 @@
+
+ #include <runtime-linker.h>
+
+-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
++const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
+ = RUNTIME_LINKER;
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index fbdd814edf..9f4d8d69b1 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -168,6 +168,9 @@ static struct argp argp =
+ options, parse_opt, NULL, doc, NULL, more_help, NULL
+ };
+
++
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
++
+ /* Check if string corresponds to an important hardware capability or
+ a platform. */
+ static int
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 453f56eb15..08e0c4c94b 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -128,6 +128,7 @@ dso_name_valid_for_suid (const char *p)
+ }
+ return *p != '\0';
+ }
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
+
+ /* LD_AUDIT variable contents. Must be processed before the
+ audit_list below. */
+@@ -1000,12 +1001,12 @@ of this helper program; chances are you did not intend to run this program.\n\
+ --list list all dependencies and how they are resolved\n\
+ --verify verify that given object really is a dynamically linked\n\
+ object we can handle\n\
+- --inhibit-cache Do not use " LD_SO_CACHE "\n\
++ --inhibit-cache Do not use %s\n\
+ --library-path PATH use given PATH instead of content of the environment\n\
+ variable LD_LIBRARY_PATH\n\
+ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
+ in LIST\n\
+- --audit LIST use objects named in LIST as auditors\n");
++ --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE);
+
+ ++_dl_skip_args;
+ --_dl_argc;
+diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
+index d6cf9d2a3e..9fcf970144 100644
+--- a/iconv/gconv_conf.c
++++ b/iconv/gconv_conf.c
+@@ -36,7 +36,7 @@
+
+
+ /* This is the default path where we look for module lists. */
+-static const char default_gconv_path[] = GCONV_PATH;
++static char default_gconv_path[4096] __attribute__ ((section (".gccrelocprefix"))) = GCONV_PATH;
+
+ /* The path elements, as determined by the __gconv_get_path function.
+ All path elements end in a slash. */
+diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index cf43f1cf3b..7f07adde53 100644
+--- a/sysdeps/generic/dl-cache.h
++++ b/sysdeps/generic/dl-cache.h
+@@ -27,10 +27,6 @@
+ ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
+ #endif
+
+-#ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
+-#endif
+-
+ #ifndef add_system_dir
+ # define add_system_dir(dir) add_dir (dir)
+ #endif
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
new file mode 100644
index 000000000..f9d70c2a0
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -0,0 +1,34 @@
+From 2bafdbd7067794c6a24e5e85608c0ec4638c5667 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 14:35:35 -0800
+Subject: [PATCH 04/27] nativesdk-glibc: Allow 64 bit atomics for x86
+
+The fix consist of allowing 64bit atomic ops for x86.
+This should be safe for i586 and newer CPUs.
+It also makes the synchronization more efficient.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/i386/atomic-machine.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/i386/atomic-machine.h b/sysdeps/i386/atomic-machine.h
+index 272da5dd8f..409c759f14 100644
+--- a/sysdeps/i386/atomic-machine.h
++++ b/sysdeps/i386/atomic-machine.h
+@@ -54,7 +54,7 @@ typedef uintmax_t uatomic_max_t;
+ # endif
+ #endif
+
+-#define __HAVE_64B_ATOMICS 0
++#define __HAVE_64B_ATOMICS 1
+ #define USE_ATOMIC_COMPILER_BUILTINS 0
+ #define ATOMIC_EXCHANGE_USES_CAS 0
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
new file mode 100644
index 000000000..ad9106eef
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
@@ -0,0 +1,1584 @@
+From 661adfe9c220d10617bf6bb283827471c3956b01 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:01:50 +0000
+Subject: [PATCH 05/27] fsl e500/e5500/e6500/603e fsqrt implementation
+
+Upstream-Status: Pending
+Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 101 ++++++++++++++++
+ .../sysv/linux/powerpc/powerpc32/603e/fpu/Implies | 1 +
+ .../linux/powerpc/powerpc32/e300c3/fpu/Implies | 2 +
+ .../linux/powerpc/powerpc32/e500mc/fpu/Implies | 1 +
+ .../sysv/linux/powerpc/powerpc32/e5500/fpu/Implies | 1 +
+ .../sysv/linux/powerpc/powerpc32/e6500/fpu/Implies | 1 +
+ .../sysv/linux/powerpc/powerpc64/e5500/fpu/Implies | 1 +
+ .../sysv/linux/powerpc/powerpc64/e6500/fpu/Implies | 1 +
+ 19 files changed, 1418 insertions(+)
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+new file mode 100644
+index 0000000000..b103b4dea5
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+new file mode 100644
+index 0000000000..64db17fada
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+@@ -0,0 +1,2 @@
++# e300c3 is a variant of 603e so use the same optimizations for sqrt
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+new file mode 100644
+index 0000000000..7eac5fcf02
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e500mc/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+new file mode 100644
+index 0000000000..264b2a7700
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+new file mode 100644
+index 0000000000..a25934467b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e6500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+new file mode 100644
+index 0000000000..a7bc854be8
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+new file mode 100644
+index 0000000000..04ff8cc181
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e6500/fpu
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
new file mode 100644
index 000000000..a3d50fd05
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
@@ -0,0 +1,33 @@
+From 615598fcca64461a71d84f756d75374f02d914ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:11:22 +0000
+Subject: [PATCH 06/27] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known
+ names
+
+This bolts in a hook for OE to pass its own version of interpreter
+names into glibc especially for multilib case, where it differs from any
+other distros
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/readlib.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/elf/readlib.c b/elf/readlib.c
+index 573c01476c..d8c7412287 100644
+--- a/elf/readlib.c
++++ b/elf/readlib.c
+@@ -51,6 +51,7 @@ static struct known_names interpreters[] =
+ #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
+ SYSDEP_KNOWN_INTERPRETER_NAMES
+ #endif
++ OECORE_KNOWN_INTERPRETER_NAMES
+ };
+
+ static struct known_names known_libs[] =
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
new file mode 100644
index 000000000..1234df0a0
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
@@ -0,0 +1,208 @@
+From 804b73ae295bdfda29341e89f2d0c1b99492dc9a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:15:07 +0000
+Subject: [PATCH 07/27] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
+
+on ppc fixes the errors like below
+| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
+| collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+ChangeLog
+
+2012-01-06 Khem Raj <raj.khem@gmail.com>
+
+ * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
+ Remove cruft.
+ * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
+ * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
+ * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 7 +------
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 7 +------
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 7 +------
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 7 +------
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 1 +
+ 12 files changed, 12 insertions(+), 24 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 71e516d1c8..1795fd6c3e 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+ We find the actual square root and half of its reciprocal
+ simultaneously. */
+
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+- double b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index 26fa067abf..a917f313ab 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+ We find the reciprocal square root and use that to compute the actual
+ square root. */
+
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+- float b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 71e516d1c8..1795fd6c3e 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+ We find the actual square root and half of its reciprocal
+ simultaneously. */
+
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+- double b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index 26fa067abf..a917f313ab 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+ We find the reciprocal square root and use that to compute the actual
+ square root. */
+
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+- float b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 000000000..1b4364751
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,387 @@
+From 1a53084249d9dae1ef4281246efc899c8f9d63ed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:16:38 +0000
+Subject: [PATCH 08/27] __ieee754_sqrt{,f} are now inline functions and call
+ out __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 8 +++++++-
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 8 ++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 8 ++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 9 ++++++++-
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 12 ++++++++++--
+ 12 files changed, 114 insertions(+), 21 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 1795fd6c3e..daa83f3fe8 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+ simultaneously. */
+
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index a917f313ab..b812cf1705 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+ square root. */
+
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
+ }
+ return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index fc4a74990e..1c34244bd8 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 9d175122a8..812653558f 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 1795fd6c3e..13a81973e3 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+ simultaneously. */
+
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index a917f313ab..fae2d81210 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+ square root. */
+
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
+ }
+ return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
new file mode 100644
index 000000000..ea498569b
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
@@ -0,0 +1,62 @@
+From 48262b6dda935278a40374ddf0080ab6cc999582 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:20:09 +0000
+Subject: [PATCH 09/27] Quote from bug 1443 which explains what the patch does
+ :
+
+ We build some random program and link it with -lust. When we run it,
+ it dies with a SIGSEGV before reaching main().
+
+ Libust.so depends on liburcu-bp.so from the usermode-rcu package.
+ Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
+ is critical.
+
+ Libust.so uses a TLS / __thread variable that is defined in liburcu-
+ bp.so. There are special ARM-specific relocation types that allow two
+ shared libraries to share thread-specific data. This is critical too.
+
+ One more critical issue: although liburcu-bp.so is prelinked, we can't
+ load it at its prelinked address, because we also link against
+ librt.so, and librt.so uses that address.
+
+ The dynamic linker is forced to relink liburcu-bp.so at a different
+ address. In the course of relinking, it processes the special ARM
+ relocation record mentioned above. The prelinker has already filled
+ in the information, which is a short offset into a table of thread-
+ specific data that is allocated per-thread for each library that uses
+ TLS. Because the normal behavior of a relocation is to add the symbol
+ value to an addend stored at the address being relocated, we end up
+ adding the short offset to itself, doubling it.
+
+ Now we have an awkward situation. The libust.so library doesn't know
+ about the addend, so its TLS data for this element is correct. The
+ liburcu-bp.so library has a different offset for the element. When we
+ go to initialize the element for the first time in liburcu-bp.so, we
+ write the address of the result at the doubled (broken) offset.
+ Later, when we refer to the address from libust.so, we check the value
+ at the correct offset, but it's NULL, so we eat hot SIGSEGV.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/arm/dl-machine.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
+index 8a00eab5e3..623edcb1bd 100644
+--- a/sysdeps/arm/dl-machine.h
++++ b/sysdeps/arm/dl-machine.h
+@@ -510,7 +510,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+
+ case R_ARM_TLS_DTPOFF32:
+ if (sym != NULL)
+- *reloc_addr += sym->st_value;
++ *reloc_addr = sym->st_value;
+ break;
+
+ case R_ARM_TLS_TPOFF32:
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
new file mode 100644
index 000000000..17513185d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,36 @@
+From 72ea5410909aef6b6aee70e7f9a88d534583aa00 Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Wed, 19 Dec 2012 04:39:57 -0600
+Subject: [PATCH 10/27] eglibc: run libm-err-tab.pl with specific dirs in ${S}
+
+libm-err-tab.pl will parse all the files named "libm-test-ulps"
+in the given dir recursively. To avoid parsing the one in
+${S}/.pc/ (it does exist after eglibc adds aarch64 support,
+${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
+aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
+in ${S}.
+
+Upstream-Status: inappropriate [OE specific]
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ manual/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/manual/Makefile b/manual/Makefile
+index c2756640a7..1b5bb16a96 100644
+--- a/manual/Makefile
++++ b/manual/Makefile
+@@ -102,7 +102,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
+ $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
+ $(dir)/libm-test-ulps))
+ pwd=`pwd`; \
+- $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
++ $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp
++ $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp
+ $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
+ touch $@
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 000000000..1e70b2a30
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,61 @@
+From 8ae998a10b24545e0c12f1f3d8be97b191178204 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:24:46 +0000
+Subject: [PATCH 11/27] __ieee754_sqrt{,f} are now inline functions and call
+ out __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: chunrong guo <B40290@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 6 +++---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 1c34244bd8..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 812653558f..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/poky/meta/recipes-core/glibc/glibc/0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
new file mode 100644
index 000000000..c35b759a2
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
@@ -0,0 +1,42 @@
+From 4f9f39761909e67bd6d29b970b7165863e33e565 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:27:10 +0000
+Subject: [PATCH 12/27] sysdeps/gnu/configure.ac: handle correctly
+ $libc_cv_rootsbindir
+
+Upstream-Status:Pending
+
+Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/gnu/configure | 2 +-
+ sysdeps/gnu/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
+index c15d1087e8..37cc983f2a 100644
+--- a/sysdeps/gnu/configure
++++ b/sysdeps/gnu/configure
+@@ -32,6 +32,6 @@ case "$prefix" in
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
+- libc_cv_rootsbindir=/sbin
++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+ ;;
+ esac
+diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac
+index 634fe4de2a..3db1697f4f 100644
+--- a/sysdeps/gnu/configure.ac
++++ b/sysdeps/gnu/configure.ac
+@@ -21,6 +21,6 @@ case "$prefix" in
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
+- libc_cv_rootsbindir=/sbin
++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+ ;;
+ esac
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0013-Add-unused-attribute.patch b/poky/meta/recipes-core/glibc/glibc/0013-Add-unused-attribute.patch
new file mode 100644
index 000000000..62c65253d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0013-Add-unused-attribute.patch
@@ -0,0 +1,34 @@
+From bba7a647b636618d5fd083e904f995f7736b9168 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:28:41 +0000
+Subject: [PATCH 13/27] Add unused attribute
+
+Helps in avoiding gcc warning when header is is included in
+a source file which does not use both functions
+
+ * iconv/gconv_charset.h (strip):
+ Add unused attribute.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ iconv/gconv_charset.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
+index 123e2a62ce..63cc83ec84 100644
+--- a/iconv/gconv_charset.h
++++ b/iconv/gconv_charset.h
+@@ -21,7 +21,7 @@
+ #include <locale.h>
+
+
+-static void
++static void __attribute__ ((unused))
+ strip (char *wp, const char *s)
+ {
+ int slash_count = 0;
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0014-yes-within-the-path-sets-wrong-config-variables.patch b/poky/meta/recipes-core/glibc/glibc/0014-yes-within-the-path-sets-wrong-config-variables.patch
new file mode 100644
index 000000000..66911285a
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0014-yes-within-the-path-sets-wrong-config-variables.patch
@@ -0,0 +1,263 @@
+From 62f44ce3dd01a257cf67116e355492cb1659a917 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:31:06 +0000
+Subject: [PATCH 14/27] 'yes' within the path sets wrong config variables
+
+It seems that the 'AC_EGREP_CPP(yes...' example is quite popular
+but being such a short word to grep it is likely to produce
+false-positive matches with the path it is configured into.
+
+The change is to use a more elaborated string to grep for.
+
+Upstream-Status: Submitted [libc-alpha@sourceware.org]
+
+Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/aarch64/configure | 4 ++--
+ sysdeps/aarch64/configure.ac | 4 ++--
+ sysdeps/arm/configure | 4 ++--
+ sysdeps/arm/configure.ac | 4 ++--
+ sysdeps/mips/configure | 4 ++--
+ sysdeps/mips/configure.ac | 4 ++--
+ sysdeps/nios2/configure | 4 ++--
+ sysdeps/nios2/configure.ac | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++--
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++----
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++----
+ 12 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
+index 5bd355a691..3bc5537bc0 100644
+--- a/sysdeps/aarch64/configure
++++ b/sysdeps/aarch64/configure
+@@ -148,12 +148,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __AARCH64EB__
+- yes
++ is_aarch64_be
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_aarch64_be" >/dev/null 2>&1; then :
+ libc_cv_aarch64_be=yes
+ else
+ libc_cv_aarch64_be=no
+diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
+index 7851dd4dac..6e9238171f 100644
+--- a/sysdeps/aarch64/configure.ac
++++ b/sysdeps/aarch64/configure.ac
+@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([for big endian],
+ [libc_cv_aarch64_be],
+- [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
+- yes
++ [AC_EGREP_CPP(is_aarch64_be,[#ifdef __AARCH64EB__
++ is_aarch64_be
+ #endif
+ ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+ if test $libc_cv_aarch64_be = yes; then
+diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
+index 431e843b2b..e152461138 100644
+--- a/sysdeps/arm/configure
++++ b/sysdeps/arm/configure
+@@ -151,12 +151,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __ARM_PCS_VFP
+- yes
++ use_arm_pcs_vfp
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then :
+ libc_cv_arm_pcs_vfp=yes
+ else
+ libc_cv_arm_pcs_vfp=no
+diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
+index 90cdd69c75..05a262ba00 100644
+--- a/sysdeps/arm/configure.ac
++++ b/sysdeps/arm/configure.ac
+@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN)
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
+ [libc_cv_arm_pcs_vfp],
+- [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
+- yes
++ [AC_EGREP_CPP(use_arm_pcs_vfp,[#ifdef __ARM_PCS_VFP
++ use_arm_pcs_vfp
+ #endif
+ ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
+ if test $libc_cv_arm_pcs_vfp = yes; then
+diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure
+index 4e13248c03..f14af952d0 100644
+--- a/sysdeps/mips/configure
++++ b/sysdeps/mips/configure
+@@ -143,11 +143,11 @@ else
+ /* end confdefs.h. */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+ libc_cv_mips_nan2008=yes
+ else
+ libc_cv_mips_nan2008=no
+diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac
+index bcbdaffd9f..ad3057f4cc 100644
+--- a/sysdeps/mips/configure.ac
++++ b/sysdeps/mips/configure.ac
+@@ -6,9 +6,9 @@ dnl position independent way.
+ dnl AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+ if test x$libc_cv_mips_nan2008 = xyes; then
+ AC_DEFINE(HAVE_MIPS_NAN2008)
+diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure
+index 14c8a3a014..dde3814ef2 100644
+--- a/sysdeps/nios2/configure
++++ b/sysdeps/nios2/configure
+@@ -142,12 +142,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __nios2_big_endian__
+- yes
++ is_nios2_be
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_nios2_be" >/dev/null 2>&1; then :
+ libc_cv_nios2_be=yes
+ else
+ libc_cv_nios2_be=no
+diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac
+index f05f43802b..dc8639902d 100644
+--- a/sysdeps/nios2/configure.ac
++++ b/sysdeps/nios2/configure.ac
+@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # Nios II big endian is not yet supported.
+ AC_CACHE_CHECK([for big endian],
+ [libc_cv_nios2_be],
+- [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__
+- yes
++ [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__
++ is_nios2_be
+ #endif
+ ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)])
+ if test $libc_cv_nios2_be = yes; then
+diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
+index 1ee7f41a36..77e38bebde 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure
++++ b/sysdeps/unix/sysv/linux/mips/configure
+@@ -414,11 +414,11 @@ else
+ /* end confdefs.h. */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+ libc_cv_mips_nan2008=yes
+ else
+ libc_cv_mips_nan2008=no
+diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac
+index 9147aa4582..7898e24738 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure.ac
++++ b/sysdeps/unix/sysv/linux/mips/configure.ac
+@@ -105,9 +105,9 @@ AC_COMPILE_IFELSE(
+ LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}])
+
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+
+ libc_mips_nan=
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+index ae7f254da4..874519000b 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+@@ -155,12 +155,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #if _CALL_ELF == 2
+- yes
++ use_ppc_elfv2_abi
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then :
+ libc_cv_ppc64_elfv2_abi=yes
+ else
+ libc_cv_ppc64_elfv2_abi=no
+@@ -188,12 +188,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef _CALL_ELF
+- yes
++ is_def_call_elf
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_def_call_elf" >/dev/null 2>&1; then :
+ libc_cv_ppc64_def_call_elf=yes
+ else
+ libc_cv_ppc64_def_call_elf=no
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+index f9cba6e15d..b21f72f1e4 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+@@ -6,8 +6,8 @@ LIBC_SLIBDIR_RTLDDIR([lib64], [lib64])
+ # Define default-abi according to compiler flags.
+ AC_CACHE_CHECK([whether the compiler is using the PowerPC64 ELFv2 ABI],
+ [libc_cv_ppc64_elfv2_abi],
+- [AC_EGREP_CPP(yes,[#if _CALL_ELF == 2
+- yes
++ [AC_EGREP_CPP(use_ppc_elfv2_abi,[#if _CALL_ELF == 2
++ use_ppc_elfv2_abi
+ #endif
+ ], libc_cv_ppc64_elfv2_abi=yes, libc_cv_ppc64_elfv2_abi=no)])
+ if test $libc_cv_ppc64_elfv2_abi = yes; then
+@@ -19,8 +19,8 @@ else
+ # Compiler that do not support ELFv2 ABI does not define _CALL_ELF
+ AC_CACHE_CHECK([whether the compiler defines _CALL_ELF],
+ [libc_cv_ppc64_def_call_elf],
+- [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF
+- yes
++ [AC_EGREP_CPP(is_def_call_elf,[#ifdef _CALL_ELF
++ is_def_call_elf
+ #endif
+ ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)])
+ if test $libc_cv_ppc64_def_call_elf = no; then
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0015-timezone-re-written-tzselect-as-posix-sh.patch b/poky/meta/recipes-core/glibc/glibc/0015-timezone-re-written-tzselect-as-posix-sh.patch
new file mode 100644
index 000000000..66bf4fdab
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0015-timezone-re-written-tzselect-as-posix-sh.patch
@@ -0,0 +1,45 @@
+From ac240fb01f6470ac207968adfbe20ccc93b16f8b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:33:03 +0000
+Subject: [PATCH 15/27] timezone: re-written tzselect as posix sh
+
+To avoid the bash dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ timezone/Makefile | 2 +-
+ timezone/tzselect.ksh | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/timezone/Makefile b/timezone/Makefile
+index 0194aba4a1..58e5405a05 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -122,7 +122,7 @@ $(testdata)/XT%: testdata/XT%
+ cp $< $@
+
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+- sed -e 's|/bin/bash|$(BASH)|' \
++ sed -e 's|/bin/bash|/bin/sh|' \
+ -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
+ -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+ -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
+index d2c3a6d1dd..089679f306 100755
+--- a/timezone/tzselect.ksh
++++ b/timezone/tzselect.ksh
+@@ -35,7 +35,7 @@ REPORT_BUGS_TO=tz@iana.org
+
+ # Specify default values for environment variables if they are unset.
+ : ${AWK=awk}
+-: ${TZDIR=`pwd`}
++: ${TZDIR=$(pwd)}
+
+ # Output one argument as-is to standard output.
+ # Safer than 'echo', which can mishandle '\' or leading '-'.
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0016-Remove-bash-dependency-for-nscd-init-script.patch b/poky/meta/recipes-core/glibc/glibc/0016-Remove-bash-dependency-for-nscd-init-script.patch
new file mode 100644
index 000000000..0b1ee9687
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0016-Remove-bash-dependency-for-nscd-init-script.patch
@@ -0,0 +1,75 @@
+From 790b133ff2bc5b77ed8533b8999abc65ed0da02b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 14:33:02 -0800
+Subject: [PATCH 16/27] Remove bash dependency for nscd init script
+
+The nscd init script uses #! /bin/bash but only really uses one bashism
+(translated strings), so remove them and switch the shell to #!/bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ nscd/nscd.init | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/nscd/nscd.init b/nscd/nscd.init
+index a882da7d8b..b02986ec15 100644
+--- a/nscd/nscd.init
++++ b/nscd/nscd.init
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # nscd: Starts the Name Switch Cache Daemon
+ #
+@@ -49,7 +49,7 @@ prog=nscd
+ start () {
+ [ -d /var/run/nscd ] || mkdir /var/run/nscd
+ [ -d /var/db/nscd ] || mkdir /var/db/nscd
+- echo -n $"Starting $prog: "
++ echo -n "Starting $prog: "
+ daemon /usr/sbin/nscd
+ RETVAL=$?
+ echo
+@@ -58,7 +58,7 @@ start () {
+ }
+
+ stop () {
+- echo -n $"Stopping $prog: "
++ echo -n "Stopping $prog: "
+ /usr/sbin/nscd -K
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+@@ -67,9 +67,9 @@ stop () {
+ # a non-privileged user
+ rm -f /var/run/nscd/nscd.pid
+ rm -f /var/run/nscd/socket
+- success $"$prog shutdown"
++ success "$prog shutdown"
+ else
+- failure $"$prog shutdown"
++ failure "$prog shutdown"
+ fi
+ echo
+ return $RETVAL
+@@ -103,13 +103,13 @@ case "$1" in
+ RETVAL=$?
+ ;;
+ force-reload | reload)
+- echo -n $"Reloading $prog: "
++ echo -n "Reloading $prog: "
+ killproc /usr/sbin/nscd -HUP
+ RETVAL=$?
+ echo
+ ;;
+ *)
+- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
++ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
+ RETVAL=1
+ ;;
+ esac
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0017-eglibc-Cross-building-and-testing-instructions.patch b/poky/meta/recipes-core/glibc/glibc/0017-eglibc-Cross-building-and-testing-instructions.patch
new file mode 100644
index 000000000..fd821323d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0017-eglibc-Cross-building-and-testing-instructions.patch
@@ -0,0 +1,619 @@
+From 897430bbb65a0f22284d7957206b5fd4efd6607f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:42:58 +0000
+Subject: [PATCH 17/27] eglibc: Cross building and testing instructions
+
+Ported from eglibc
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ GLIBC.cross-building | 383 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ GLIBC.cross-testing | 205 +++++++++++++++++++++++++++
+ 2 files changed, 588 insertions(+)
+ create mode 100644 GLIBC.cross-building
+ create mode 100644 GLIBC.cross-testing
+
+diff --git a/GLIBC.cross-building b/GLIBC.cross-building
+new file mode 100644
+index 0000000000..e6e0da1aaf
+--- /dev/null
++++ b/GLIBC.cross-building
+@@ -0,0 +1,383 @@
++ -*- mode: text -*-
++
++ Cross-Compiling GLIBC
++ Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Most GNU tools have a simple build procedure: you run their
++'configure' script, and then you run 'make'. Unfortunately, the
++process of cross-compiling the GNU C library is quite a bit more
++involved:
++
++1) Build a cross-compiler, with certain facilities disabled.
++
++2) Configure the C library using the compiler you built in step 1).
++ Build a few of the C run-time object files, but not the rest of the
++ library. Install the library's header files and the run-time
++ object files, and create a dummy libc.so.
++
++3) Build a second cross-compiler, using the header files and object
++ files you installed in step 2.
++
++4) Configure, build, and install a fresh C library, using the compiler
++ built in step 3.
++
++5) Build a third cross-compiler, based on the C library built in step 4.
++
++The reason for this complexity is that, although GCC and the GNU C
++library are distributed separately, they are not actually independent
++of each other: GCC requires the C library's headers and some object
++files to compile its own libraries, while the C library depends on
++GCC's libraries. GLIBC includes features and bug fixes to the stock
++GNU C library that simplify this process, but the fundamental
++interdependency stands.
++
++In this document, we explain how to cross-compile an GLIBC/GCC pair
++from source. Our intended audience is developers who are already
++familiar with the GNU toolchain and comfortable working with
++cross-development tools. While we do present a worked example to
++accompany the explanation, for clarity's sake we do not cover many of
++the options available to cross-toolchain users.
++
++
++Preparation
++
++GLIBC requires recent versions of the GNU binutils, GCC, and the
++Linux kernel. The web page <http://www.eglibc.org/prerequisites>
++documents the current requirements, and lists patches needed for
++certain target architectures. As of this writing, these build
++instructions have been tested with binutils 2.22.51, GCC 4.6.2,
++and Linux 3.1.
++
++First, let's set some variables, to simplify later commands. We'll
++build GLIBC and GCC for an ARM target, known to the Linux kernel
++as 'arm', and we'll do the build on an Intel x86_64 Linux box:
++
++ $ build=x86_64-pc-linux-gnu
++ $ host=$build
++ $ target=arm-none-linux-gnueabi
++ $ linux_arch=arm
++
++We're using the aforementioned versions of Binutils, GCC, and Linux:
++
++ $ binutilsv=binutils-2.22.51
++ $ gccv=gcc-4.6.2
++ $ linuxv=linux-3.1
++
++We're carrying out the entire process under '~/cross-build', which
++contains unpacked source trees for binutils, gcc, and linux kernel,
++along with GLIBC svn trunk (which can be checked-out with
++'svn co http://www.eglibc.org/svn/trunk eglibc'):
++
++ $ top=$HOME/cross-build/$target
++ $ src=$HOME/cross-build/src
++ $ ls $src
++ binutils-2.22.51 glibc gcc-4.6.2 linux-3.1
++
++We're going to place our build directories in a subdirectory 'obj',
++we'll install the cross-development toolchain in 'tools', and we'll
++place our sysroot (containing files to be installed on the target
++system) in 'sysroot':
++
++ $ obj=$top/obj
++ $ tools=$top/tools
++ $ sysroot=$top/sysroot
++
++
++Binutils
++
++Configuring and building binutils for the target is straightforward:
++
++ $ mkdir -p $obj/binutils
++ $ cd $obj/binutils
++ $ $src/$binutilsv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot
++ $ make
++ $ make install
++
++
++The First GCC
++
++For our work, we need a cross-compiler targeting an ARM Linux
++system. However, that configuration includes the shared library
++'libgcc_s.so', which is compiled against the GLIBC headers (which we
++haven't installed yet) and linked against 'libc.so' (which we haven't
++built yet).
++
++Fortunately, there are configuration options for GCC which tell it not
++to build 'libgcc_s.so'. The '--without-headers' option is supposed to
++take care of this, but its implementation is incomplete, so you must
++also configure with the '--with-newlib' option. While '--with-newlib'
++appears to mean "Use the Newlib C library", its effect is to tell the
++GCC build machinery, "Don't assume there is a C library available."
++
++We also need to disable some of the libraries that would normally be
++built along with GCC, and specify that only the compiler for the C
++language is needed.
++
++So, we create a build directory, configure, make, and install.
++
++ $ mkdir -p $obj/gcc1
++ $ cd $obj/gcc1
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --without-headers --with-newlib \
++ > --disable-shared --disable-threads --disable-libssp \
++ > --disable-libgomp --disable-libmudflap --disable-libquadmath \
++ > --disable-decimal-float --disable-libffi \
++ > --enable-languages=c
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++
++Linux Kernel Headers
++
++To configure GLIBC, we also need Linux kernel headers in place.
++Fortunately, the Linux makefiles have a target that installs them for
++us. Since the process does modify the source tree a bit, we make a
++copy first:
++
++ $ cp -r $src/$linuxv $obj/linux
++ $ cd $obj/linux
++
++Now we're ready to install the headers into the sysroot:
++
++ $ PATH=$tools/bin:$PATH \
++ > make headers_install \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++ > INSTALL_HDR_PATH=$sysroot/usr
++
++
++GLIBC Headers and Preliminary Objects
++
++Using the cross-compiler we've just built, we can now configure GLIBC
++well enough to install the headers and build the object files that the
++full cross-compiler will need:
++
++ $ mkdir -p $obj/glibc-headers
++ $ cd $obj/glibc-headers
++ $ BUILD_CC=gcc \
++ > CC=$tools/bin/$target-gcc \
++ > CXX=$tools/bin/$target-g++ \
++ > AR=$tools/bin/$target-ar \
++ > RANLIB=$tools/bin/$target-ranlib \
++ > $src/glibc/libc/configure \
++ > --prefix=/usr \
++ > --with-headers=$sysroot/usr/include \
++ > --build=$build \
++ > --host=$target \
++ > --disable-profile --without-gd --without-cvs \
++ > --enable-add-ons=nptl,libidn,../ports
++
++The option '--prefix=/usr' may look strange, but you should never
++configure GLIBC with a prefix other than '/usr': in various places,
++GLIBC's build system checks whether the prefix is '/usr', and does
++special handling only if that is the case. Unless you use this
++prefix, you will get a sysroot that does not use the standard Linux
++directory layouts and cannot be used as a basis for the root
++filesystem on your target system compatibly with normal GLIBC
++installations.
++
++The '--with-headers' option tells GLIBC where the Linux headers have
++been installed.
++
++The '--enable-add-ons=nptl,libidn,../ports' option tells GLIBC to look
++for the listed glibc add-ons. Most notably the ports add-on (located
++just above the libc sources in the GLIBC svn tree) is required to
++support ARM targets.
++
++We can now use the 'install-headers' makefile target to install the
++headers:
++
++ $ make install-headers install_root=$sysroot \
++ > install-bootstrap-headers=yes
++
++The 'install_root' variable indicates where the files should actually
++be installed; its value is treated as the parent of the '--prefix'
++directory we passed to the configure script, so the headers will go in
++'$sysroot/usr/include'. The 'install-bootstrap-headers' variable
++requests special handling for certain tricky header files.
++
++Next, there are a few object files needed to link shared libraries,
++which we build and install by hand:
++
++ $ mkdir -p $sysroot/usr/lib
++ $ make csu/subdir_lib
++ $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib
++
++Finally, 'libgcc_s.so' requires a 'libc.so' to link against. However,
++since we will never actually execute its code, it doesn't matter what
++it contains. So, treating '/dev/null' as a C source file, we produce
++a dummy 'libc.so' in one step:
++
++ $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \
++ > -o $sysroot/usr/lib/libc.so
++
++
++The Second GCC
++
++With the GLIBC headers and selected object files installed, we can
++now build a GCC that is capable of compiling GLIBC. We configure,
++build, and install the second GCC, again building only the C compiler,
++and avoiding libraries we won't use:
++
++ $ mkdir -p $obj/gcc2
++ $ cd $obj/gcc2
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot \
++ > --disable-libssp --disable-libgomp --disable-libmudflap \
++ > --disable-libffi --disable-libquadmath \
++ > --enable-languages=c
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++
++GLIBC, Complete
++
++With the second compiler built and installed, we're now ready for the
++full GLIBC build:
++
++ $ mkdir -p $obj/glibc
++ $ cd $obj/glibc
++ $ BUILD_CC=gcc \
++ > CC=$tools/bin/$target-gcc \
++ > CXX=$tools/bin/$target-g++ \
++ > AR=$tools/bin/$target-ar \
++ > RANLIB=$tools/bin/$target-ranlib \
++ > $src/glibc/libc/configure \
++ > --prefix=/usr \
++ > --with-headers=$sysroot/usr/include \
++ > --with-kconfig=$obj/linux/scripts/kconfig \
++ > --build=$build \
++ > --host=$target \
++ > --disable-profile --without-gd --without-cvs \
++ > --enable-add-ons=nptl,libidn,../ports
++
++Note the additional '--with-kconfig' option. This tells GLIBC where to
++find the host config tools used by the kernel 'make config' and 'make
++menuconfig'. These tools can be re-used by GLIBC for its own 'make
++*config' support, which will create 'option-groups.config' for you.
++But first make sure those tools have been built by running some
++dummy 'make *config' calls in the kernel directory:
++
++ $ cd $obj/linux
++ $ PATH=$tools/bin:$PATH make config \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++ $ PATH=$tools/bin:$PATH make menuconfig \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++
++Now we can configure and build the full GLIBC:
++
++ $ cd $obj/glibc
++ $ PATH=$tools/bin:$PATH make defconfig
++ $ PATH=$tools/bin:$PATH make menuconfig
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install install_root=$sysroot
++
++At this point, we have a complete GLIBC installation in '$sysroot',
++with header files, library files, and most of the C runtime startup
++files in place.
++
++
++The Third GCC
++
++Finally, we recompile GCC against this full installation, enabling
++whatever languages and libraries we would like to use:
++
++ $ mkdir -p $obj/gcc3
++ $ cd $obj/gcc3
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot \
++ > --enable-__cxa_atexit \
++ > --disable-libssp --disable-libgomp --disable-libmudflap \
++ > --enable-languages=c,c++
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++The '--enable-__cxa_atexit' option tells GCC what sort of C++
++destructor support to expect from the C library; it's required with
++GLIBC.
++
++And since GCC's installation process isn't designed to help construct
++sysroot trees, we must manually copy certain libraries into place in
++the sysroot.
++
++ $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib
++ $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib
++
++
++Trying Things Out
++
++At this point, '$tools' contains a cross toolchain ready to use
++the GLIBC installation in '$sysroot':
++
++ $ cat > hello.c <<EOF
++ > #include <stdio.h>
++ > int
++ > main (int argc, char **argv)
++ > {
++ > puts ("Hello, world!");
++ > return 0;
++ > }
++ > EOF
++ $ $tools/bin/$target-gcc -Wall hello.c -o hello
++ $ cat > c++-hello.cc <<EOF
++ > #include <iostream>
++ > int
++ > main (int argc, char **argv)
++ > {
++ > std::cout << "Hello, C++ world!" << std::endl;
++ > return 0;
++ > }
++ > EOF
++ $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello
++
++
++We can use 'readelf' to verify that these are indeed executables for
++our target, using our dynamic linker:
++
++ $ $tools/bin/$target-readelf -hl hello
++ ELF Header:
++ ...
++ Type: EXEC (Executable file)
++ Machine: ARM
++
++ ...
++ Program Headers:
++ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
++ PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
++ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1
++ [Requesting program interpreter: /lib/ld-linux.so.3]
++ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000
++ ...
++
++Looking at the dynamic section of the installed 'libgcc_s.so', we see
++that the 'NEEDED' entry for the C library does include the '.6'
++suffix, indicating that was linked against our fully build GLIBC, and
++not our dummy 'libc.so':
++
++ $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1
++ Dynamic section at offset 0x1083c contains 24 entries:
++ Tag Type Name/Value
++ 0x00000001 (NEEDED) Shared library: [libc.so.6]
++ 0x0000000e (SONAME) Library soname: [libgcc_s.so.1]
++ ...
++
++
++And on the target machine, we can run our programs:
++
++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++ > ./hello
++ Hello, world!
++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++ > ./c++-hello
++ Hello, C++ world!
+diff --git a/GLIBC.cross-testing b/GLIBC.cross-testing
+new file mode 100644
+index 0000000000..b67b468466
+--- /dev/null
++++ b/GLIBC.cross-testing
+@@ -0,0 +1,205 @@
++ -*- mode: text -*-
++
++ Cross-Testing With GLIBC
++ Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Developers writing software for embedded systems often use a desktop
++or other similarly capable computer for development, but need to run
++tests on the embedded system, or perhaps on a simulator. When
++configured for cross-compilation, the stock GNU C library simply
++disables running tests altogether: the command 'make tests' builds
++test programs, but does not run them. GLIBC, however, provides
++facilities for compiling tests and generating data files on the build
++system, but running the test programs themselves on a remote system or
++simulator.
++
++
++Test environment requirements
++
++The test environment must meet certain conditions for GLIBC's
++cross-testing facilities to work:
++
++- Shared filesystems. The 'build' system, on which you configure and
++ compile GLIBC, and the 'host' system, on which you intend to run
++ GLIBC, must share a filesystem containing the GLIBC build and
++ source trees. Files must appear at the same paths on both systems.
++
++- Remote-shell like invocation. There must be a way to run a program
++ on the host system from the build system, passing it properly quoted
++ command-line arguments, setting environment variables, and
++ inheriting the caller's standard input and output.
++
++
++Usage
++
++To use GLIBC's cross-testing support, provide values for the
++following Make variables when you invoke 'make':
++
++- cross-test-wrapper
++
++ This should be the name of the cross-testing wrapper command, along
++ with any arguments.
++
++- cross-localedef
++
++ This should be the name of a cross-capable localedef program, like
++ that included in the GLIBC 'localedef' module, along with any
++ arguments needed.
++
++These are each explained in detail below.
++
++
++The Cross-Testing Wrapper
++
++To run test programs reliably, the stock GNU C library takes care to
++ensure that test programs use the newly compiled dynamic linker and
++shared libraries, and never the host system's installed libraries. To
++accomplish this, it runs the tests by explicitly invoking the dynamic
++linker from the build tree, passing it a list of build tree
++directories to search for shared libraries, followed by the name of
++the executable to run and its arguments.
++
++For example, where one might normally run a test program like this:
++
++ $ ./tst-foo arg1 arg2
++
++the GNU C library might run that program like this:
++
++ $ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++(where $objdir is the path to the top of the build tree, and the
++trailing backslash indicates a continuation of the command). In other
++words, each test program invocation is 'wrapped up' inside an explicit
++invocation of the dynamic linker, which must itself execute the test
++program, having loaded shared libraries from the appropriate
++directories.
++
++To support cross-testing, GLIBC allows the developer to optionally
++set the 'cross-test-wrapper' Make variable to another wrapper command,
++to which it passes the entire dynamic linker invocation shown above as
++arguments. For example, if the developer supplies a wrapper of
++'my-wrapper hostname', then GLIBC would run the test above as
++follows:
++
++ $ my-wrapper hostname \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++The 'my-wrapper' command is responsible for executing the command
++given on the host system.
++
++Since tests are run in varying directories, the wrapper should either
++be in your command search path, or 'cross-test-wrapper' should give an
++absolute path for the wrapper.
++
++The wrapper must meet several requirements:
++
++- It must preserve the current directory. As explained above, the
++ build directory tree must be visible on both the build and host
++ systems, at the same path. The test wrapper must ensure that the
++ current directory it inherits is also inherited by the dynamic
++ linker (and thus the test program itself).
++
++- It must preserve environment variables' values. Many GLIBC tests
++ set environment variables for test runs; in native testing, it
++ invokes programs like this:
++
++ $ GCONV_PATH=$objdir/iconvdata \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++ With the cross-testing wrapper, that invocation becomes:
++
++ $ GCONV_PATH=$objdir/iconvdata \
++ my-wrapper hostname \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++ Here, 'my-wrapper' must ensure that the value it sees for
++ 'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo'
++ itself. (The wrapper supplied with GLIBC simply preserves the
++ values of *all* enviroment variables, with a fixed set of
++ exceptions.)
++
++ If your wrapper is a shell script, take care to correctly propagate
++ environment variables whose values contain spaces and shell
++ metacharacters.
++
++- It must pass the command's arguments, unmodified. The arguments
++ seen by the test program should be exactly those seen by the wrapper
++ (after whatever arguments are given to the wrapper itself). The
++ GLIBC test framework performs all needed shell word splitting and
++ expansion (wildcard expansion, parameter substitution, and so on)
++ before invoking the wrapper; further expansion may break the tests.
++
++
++The 'cross-test-ssh.sh' script
++
++If you want to use 'ssh' (or something sufficiently similar) to run
++test programs on your host system, GLIBC includes a shell script,
++'scripts/cross-test-ssh.sh', which you can use as your wrapper
++command. This script takes care of setting the test command's current
++directory, propagating environment variable values, and carrying
++command-line arguments, all across an 'ssh' connection. You may even
++supply an alternative to 'ssh' on the command line, if needed.
++
++For more details, pass 'cross-test-ssh.sh' the '--help' option.
++
++
++The Cross-Compiling Locale Definition Command
++
++Some GLIBC tests rely on locales generated especially for the test
++process. In a native configuration, these tests simply run the
++'localedef' command built by the normal GLIBC build process,
++'locale/localedef', to process and install their locales. However, in
++a cross-compiling configuration, this 'localedef' is built for the
++host system, not the build system, and since it requires quite a bit
++of memory to run (we have seen it fail on systems with 64MiB of
++memory), it may not be practical to run it on the host system.
++
++If set, GLIBC uses the 'cross-localedef' Make variable as the command
++to run on the build system to process and install locales. The
++localedef program built from the GLIBC 'localedef' module is
++suitable.
++
++The value of 'cross-localedef' may also include command-line arguments
++to be passed to the program; if you are using GLIBC's 'localedef',
++you may include endianness and 'uint32_t' alignment arguments here.
++
++
++Example
++
++In developing GLIBC's cross-testing facility, we invoked 'make' with
++the following script:
++
++ #!/bin/sh
++
++ srcdir=...
++ test_hostname=...
++ localedefdir=...
++ cross_gxx=...-g++
++
++ wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname"
++ localedef="$localedefdir/localedef --little-endian --uint32-align=4"
++
++ make cross-test-wrapper="$wrapper" \
++ cross-localedef="$localedef" \
++ CXX="$cross_gxx" \
++ "$@"
++
++
++Other Cross-Testing Concerns
++
++Here are notes on some other issues which you may encounter in running
++the GLIBC tests in a cross-compiling environment:
++
++- Some tests require a C++ cross-compiler; you should set the 'CXX'
++ Make variable to the name of an appropriate cross-compiler.
++
++- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we
++ simply place copies of these libraries in the top GLIBC build
++ directory.
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Help-bootstrap-cross-toolchain.patch b/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Help-bootstrap-cross-toolchain.patch
new file mode 100644
index 000000000..80d547c80
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -0,0 +1,100 @@
+From fcfa19b69e8749477022161a808a201807ef72ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:49:28 +0000
+Subject: [PATCH 18/27] eglibc: Help bootstrap cross toolchain
+
+Taken from EGLIBC, r1484 + r1525
+
+ 2007-02-20 Jim Blandy <jimb@codesourcery.com>
+
+ * Makefile (install-headers): Preserve old behavior: depend on
+ $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers
+ is set; otherwise, place gnu/stubs.h on the 'install-others' list.
+
+ 2007-02-16 Jim Blandy <jimb@codesourcery.com>
+
+ * Makefile: Amend make install-headers to install everything
+ necessary for building a cross-compiler. Install gnu/stubs.h as
+ part of 'install-headers', not 'install-others'.
+ If install-bootstrap-headers is 'yes', install a dummy copy of
+ gnu/stubs.h, instead of computing the real thing.
+ * include/stubs-bootstrap.h: New file.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 22 +++++++++++++++++++++-
+ include/stubs-bootstrap.h | 12 ++++++++++++
+ 2 files changed, 33 insertions(+), 1 deletion(-)
+ create mode 100644 include/stubs-bootstrap.h
+
+diff --git a/Makefile b/Makefile
+index bea4e27f8d..8c83cfadc6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -70,9 +70,18 @@ subdir-dirs = include
+ vpath %.h $(subdir-dirs)
+
+ # What to install.
+-install-others = $(inst_includedir)/gnu/stubs.h
+ install-bin-script =
+
++# If we're bootstrapping, install a dummy gnu/stubs.h along with the
++# other headers, so 'make install-headers' produces a useable include
++# tree. Otherwise, install gnu/stubs.h later, after the rest of the
++# build is done.
++ifeq ($(install-bootstrap-headers),yes)
++install-headers: $(inst_includedir)/gnu/stubs.h
++else
++install-others = $(inst_includedir)/gnu/stubs.h
++endif
++
+ ifeq (yes,$(build-shared))
+ headers += gnu/lib-names.h
+ endif
+@@ -152,6 +161,16 @@ others: $(common-objpfx)testrun.sh
+
+ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
+
++# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o
++# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty
++# gnu/stubs.h is good enough.
++ifeq ($(install-bootstrap-headers),yes)
++$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force)
++ $(make-target-directory)
++ $(INSTALL_DATA) $< $@
++
++installed-stubs =
++else
+ ifndef abi-variants
+ installed-stubs = $(inst_includedir)/gnu/stubs.h
+ else
+@@ -178,6 +197,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
+
+ install-others-nosubdir: $(installed-stubs)
+ endif
++endif
+
+
+ # Since stubs.h is never needed when building the library, we simplify the
+diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h
+new file mode 100644
+index 0000000000..1d2b669aff
+--- /dev/null
++++ b/include/stubs-bootstrap.h
+@@ -0,0 +1,12 @@
++/* Placeholder stubs.h file for bootstrapping.
++
++ When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC
++ headers be installed, but we can't fully build EGLIBC without that
++ GCC. So we run the command:
++
++ make install-headers install-bootstrap-headers=yes
++
++ to install the headers GCC needs, but avoid building certain
++ difficult headers. The <gnu/stubs.h> header depends, via the
++ EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but
++ an empty stubs.h like this will do fine for GCC. */
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Clear-cache-lines-on-ppc8xx.patch b/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Clear-cache-lines-on-ppc8xx.patch
new file mode 100644
index 000000000..17bfe4fe8
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Clear-cache-lines-on-ppc8xx.patch
@@ -0,0 +1,83 @@
+From c6f2db0d7c5c65bfa19766a0e1ce8210111f9c7d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 15:15:09 -0800
+Subject: [PATCH 19/27] eglibc: Clear cache lines on ppc8xx
+
+2007-06-13 Nathan Sidwell <nathan@codesourcery.com>
+ Mark Shinwell <shinwell@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c
+ (__libc_start_main): Detect 8xx parts and clear
+ __cache_line_size if detected.
+ * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+ (DL_PLATFORM_AUXV): Likewise.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c | 14 +++++++++++++-
+ sysdeps/unix/sysv/linux/powerpc/libc-start.c | 16 +++++++++++++++-
+ 2 files changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+index 78051bc7bc..e24f442320 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
++++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+@@ -24,9 +24,21 @@ int __cache_line_size attribute_hidden;
+ /* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
+ verify that the static extern __cache_line_size is defined by checking
+ for not NULL. If it is defined then assign the cache block size
+- value to __cache_line_size. */
++ value to __cache_line_size. This is used by memset to
++ optimize setting to zero. We have to detect 8xx processors, which
++ have buggy dcbz implementations that cannot report page faults
++ correctly. That requires reading SPR, which is a privileged
++ operation. Fortunately 2.2.18 and later emulates PowerPC mfspr
++ reads from the PVR register. */
+ #define DL_PLATFORM_AUXV \
+ case AT_DCACHEBSIZE: \
++ if (__LINUX_KERNEL_VERSION >= 0x020218) \
++ { \
++ unsigned pvr = 0; \
++ asm ("mfspr %0, 287" : "=r" (pvr)); \
++ if ((pvr & 0xffff0000) == 0x00500000) \
++ break; \
++ } \
+ __cache_line_size = av->a_un.a_val; \
+ break;
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+index f2ad0c355d..3e6773795e 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
++++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+@@ -73,11 +73,25 @@ __libc_start_main (int argc, char **argv,
+
+ /* Initialize the __cache_line_size variable from the aux vector. For the
+ static case, we also need _dl_hwcap, _dl_hwcap2 and _dl_platform, so we
+- can call __tcb_parse_hwcap_and_convert_at_platform (). */
++ can call __tcb_parse_hwcap_and_convert_at_platform ().
++
++ This is used by memset to optimize setting to zero. We have to
++ detect 8xx processors, which have buggy dcbz implementations that
++ cannot report page faults correctly. That requires reading SPR,
++ which is a privileged operation. Fortunately 2.2.18 and later
++ emulates PowerPC mfspr reads from the PVR register. */
+ for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av)
+ switch (av->a_type)
+ {
+ case AT_DCACHEBSIZE:
++ if (__LINUX_KERNEL_VERSION >= 0x020218)
++ {
++ unsigned pvr = 0;
++
++ asm ("mfspr %0, 287" : "=r" (pvr) :);
++ if ((pvr & 0xffff0000) == 0x00500000)
++ break;
++ }
+ __cache_line_size = av->a_un.a_val;
+ break;
+ #ifndef SHARED
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch b/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch
new file mode 100644
index 000000000..09f767075
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -0,0 +1,56 @@
+From 577085016bb926a687abec145557fe8cb8f5af0e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:55:53 +0000
+Subject: [PATCH 20/27] eglibc: Resolve __fpscr_values on SH4
+
+2010-09-29 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ Andrew Stubbs <ams@codesourcery.com>
+
+ Resolve SH's __fpscr_values to symbol in libc.so.
+
+ * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype.
+ * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values.
+ * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/sh/Versions | 1 +
+ sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
+index e0938c4165..ca1d7da339 100644
+--- a/sysdeps/unix/sysv/linux/sh/Versions
++++ b/sysdeps/unix/sysv/linux/sh/Versions
+@@ -2,6 +2,7 @@ libc {
+ GLIBC_2.2 {
+ # functions used in other libraries
+ __xstat64; __fxstat64; __lxstat64;
++ __fpscr_values;
+
+ # a*
+ alphasort64;
+diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
+index c4e28ffb98..648bae03d5 100644
+--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
++++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
+@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
+
+ #define __syscall_error __syscall_error_1
+ #include <sysdeps/unix/sh/sysdep.S>
++
++ .data
++ .align 3
++ .globl ___fpscr_values
++ .type ___fpscr_values, @object
++ .size ___fpscr_values, 8
++___fpscr_values:
++ .long 0
++ .long 0x80000
++weak_alias (___fpscr_values, __fpscr_values)
++
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Install-PIC-archives.patch b/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Install-PIC-archives.patch
new file mode 100644
index 000000000..530f4e108
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Install-PIC-archives.patch
@@ -0,0 +1,123 @@
+From c1beab8a11985f96f5eb644e7103d343b705afc6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:57:01 +0000
+Subject: [PATCH 21/27] eglibc: Install PIC archives
+
+Forward port from eglibc
+
+2008-02-07 Joseph Myers <joseph@codesourcery.com>
+
+ * Makerules (install-extras, install-map): New variables.
+ (installed-libcs): Add libc_pic.a.
+ (install-lib): Include _pic.a files for versioned shared
+ libraries.
+ (install-map-nosubdir, install-extras-nosubdir): Add rules for
+ installing extra files.
+ (install-no-libc.a-nosubdir): Depend on install-map-nosubdir and
+ install-extras-nosubdir.
+
+2008-04-01 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * Makerules (install-lib): Don't install libpthread_pic.a.
+ (install-map): Don't install libpthread_pic.map.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makerules | 42 ++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 40 insertions(+), 2 deletions(-)
+
+diff --git a/Makerules b/Makerules
+index ef6abeac6d..eeaa667f49 100644
+--- a/Makerules
++++ b/Makerules
+@@ -778,6 +778,9 @@ ifeq ($(build-shared),yes)
+ $(common-objpfx)libc.so: $(common-objpfx)libc.map
+ endif
+ common-generated += libc.so libc_pic.os
++ifndef subdir
++install-extras := soinit.o sofini.o
++endif
+ ifdef libc.so-version
+ $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
+ $(make-link)
+@@ -1029,6 +1032,7 @@ endif
+
+ install: check-install-supported
+
++installed-libcs := $(installed-libcs) $(inst_libdir)/libc_pic.a
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ $(make-target-directory)
+@@ -1057,6 +1061,22 @@ versioned := $(strip $(foreach so,$(install-lib.so),\
+ install-lib.so-versioned := $(filter $(versioned), $(install-lib.so))
+ install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
+
++# Install the _pic.a files for versioned libraries, and corresponding
++# .map files.
++# libpthread_pic.a breaks mklibs, so don't install it and its map.
++install-lib := $(install-lib) $(install-lib.so-versioned:%.so=%_pic.a)
++install-lib := $(filter-out libpthread_pic.a,$(install-lib))
++# Despite having a soname libhurduser and libmachuser do not use symbol
++# versioning, so don't install the corresponding .map files.
++ifeq ($(build-shared),yes)
++install-map := $(patsubst %.so,%.map,\
++ $(foreach L,$(install-lib.so-versioned),$(notdir $L)))
++install-map := $(filter-out libhurduser.map libmachuser.map libpthread.map,$(install-map))
++ifndef subdir
++install-map := $(install-map) libc.map
++endif
++endif
++
+ # For versioned libraries, we install three files:
+ # $(inst_libdir)/libfoo.so -- for linking, symlink or ld script
+ # $(inst_slibdir)/libfoo.so.NN -- for loading by SONAME, symlink
+@@ -1311,9 +1331,22 @@ $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
+ endif # headers-nonh
+ endif # headers
+
++ifdef install-map
++$(addprefix $(inst_libdir)/,$(patsubst lib%.map,lib%_pic.map,$(install-map))): \
++ $(inst_libdir)/lib%_pic.map: $(common-objpfx)lib%.map $(+force)
++ $(do-install)
++endif
++
++ifdef install-extras
++$(addprefix $(inst_libdir)/libc_pic/,$(install-extras)): \
++ $(inst_libdir)/libc_pic/%.o: $(elf-objpfx)%.os $(+force)
++ $(do-install)
++endif
++
+ .PHONY: install-bin-nosubdir install-bin-script-nosubdir \
+ install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
+- install-data-nosubdir install-headers-nosubdir
++ install-data-nosubdir install-headers-nosubdir install-map-nosubdir \
++ install-extras-nosubdir
+ install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
+ install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script))
+ install-rootsbin-nosubdir: \
+@@ -1326,6 +1359,10 @@ install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
+ install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
+ install-others-nosubdir: $(install-others)
+ install-others-programs-nosubdir: $(install-others-programs)
++install-map-nosubdir: $(addprefix $(inst_libdir)/,\
++ $(patsubst lib%.map,lib%_pic.map,$(install-map)))
++install-extras-nosubdir: $(addprefix $(inst_libdir)/libc_pic/,\
++ $(install-extras))
+
+ # We need all the `-nosubdir' targets so that `install' in the parent
+ # doesn't depend on several things which each iterate over the subdirs.
+@@ -1335,7 +1372,8 @@ install-%:: install-%-nosubdir ;
+
+ .PHONY: install install-no-libc.a-nosubdir
+ install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir \
+- install-lib-nosubdir install-others-nosubdir
++ install-lib-nosubdir install-others-nosubdir \
++ install-map-nosubdir install-extras-nosubdir
+ ifeq ($(build-programs),yes)
+ install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \
+ install-rootsbin-nosubdir install-sbin-nosubdir \
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch b/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch
new file mode 100644
index 000000000..a629ce141
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -0,0 +1,566 @@
+From e019fe6a2b410db6043e21803f497b5cbdd90a83 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:33:49 +0000
+Subject: [PATCH 22/27] eglibc: Forward port cross locale generation support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/Makefile | 3 ++-
+ locale/catnames.c | 48 +++++++++++++++++++++++++++++++++++
+ locale/localeinfo.h | 2 +-
+ locale/programs/charmap-dir.c | 6 +++++
+ locale/programs/ld-collate.c | 17 ++++++-------
+ locale/programs/ld-ctype.c | 27 ++++++++++----------
+ locale/programs/ld-time.c | 31 +++++++++++++++--------
+ locale/programs/linereader.c | 2 +-
+ locale/programs/localedef.c | 8 ++++++
+ locale/programs/locfile.c | 5 +++-
+ locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++++++++++--
+ locale/setlocale.c | 30 ----------------------
+ 12 files changed, 169 insertions(+), 69 deletions(-)
+ create mode 100644 locale/catnames.c
+
+diff --git a/locale/Makefile b/locale/Makefile
+index fd9972279b..176b3946de 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -26,7 +26,8 @@ headers = langinfo.h locale.h bits/locale.h \
+ bits/types/locale_t.h bits/types/__locale_t.h
+ routines = setlocale findlocale loadlocale loadarchive \
+ localeconv nl_langinfo nl_langinfo_l mb_cur_max \
+- newlocale duplocale freelocale uselocale
++ newlocale duplocale freelocale uselocale \
++ catnames
+ tests = tst-C-locale tst-locname tst-duplocale
+ categories = ctype messages monetary numeric time paper name \
+ address telephone measurement identification collate
+diff --git a/locale/catnames.c b/locale/catnames.c
+new file mode 100644
+index 0000000000..9fad357db1
+--- /dev/null
++++ b/locale/catnames.c
+@@ -0,0 +1,48 @@
++/* Copyright (C) 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include "localeinfo.h"
++
++/* Define an array of category names (also the environment variable names). */
++const union catnamestr_t _nl_category_names attribute_hidden =
++ {
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ category_name,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ }
++ };
++
++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ };
++
++/* An array of their lengths, for convenience. */
++const uint8_t _nl_category_name_sizes[] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = sizeof (category_name) - 1,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ [LC_ALL] = sizeof ("LC_ALL") - 1
++ };
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index 68822a6319..fa36123776 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -224,7 +224,7 @@ __libc_tsd_define (extern, locale_t, LOCALE)
+ unused. We can manage this playing some tricks with weak references.
+ But with thread-local locale settings, it becomes quite ungainly unless
+ we can use __thread variables. So only in that case do we attempt this. */
+-#ifndef SHARED
++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF
+ # include <tls.h>
+ # define NL_CURRENT_INDIRECT 1
+ #endif
+diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
+index 34a8d32c92..cbb9436cd1 100644
+--- a/locale/programs/charmap-dir.c
++++ b/locale/programs/charmap-dir.c
+@@ -18,7 +18,9 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <libintl.h>
++#ifndef NO_UNCOMPRESS
+ #include <spawn.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -154,6 +156,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
+ return closedir (dir);
+ }
+
++#ifndef NO_UNCOMPRESS
+ /* Creates a subprocess decompressing the given pathname, and returns
+ a stream reading its output (the decompressed data). */
+ static
+@@ -202,6 +205,7 @@ fopen_uncompressed (const char *pathname, const char *compressor)
+ }
+ return NULL;
+ }
++#endif
+
+ /* Opens a charmap for reading, given its name (not an alias name). */
+ FILE *
+@@ -224,6 +228,7 @@ charmap_open (const char *directory, const char *name)
+ if (stream != NULL)
+ return stream;
+
++#ifndef NO_UNCOMPRESS
+ memcpy (p, ".gz", 4);
+ stream = fopen_uncompressed (pathname, "gzip");
+ if (stream != NULL)
+@@ -233,6 +238,7 @@ charmap_open (const char *directory, const char *name)
+ stream = fopen_uncompressed (pathname, "bzip2");
+ if (stream != NULL)
+ return stream;
++#endif
+
+ return NULL;
+ }
+diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
+index d2eebcfdbb..c3718d6589 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
+ }
+ if (wcs != NULL)
+ {
+- size_t nwcs = wcslen ((wchar_t *) wcs);
++ size_t nwcs = wcslen_uint32 (wcs);
+ uint32_t zero = 0;
+ /* Handle <U0000> as a single character. */
+ if (nwcs == 0)
+@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
+
+ if ((*eptr)->nwcs == runp->nwcs)
+ {
+- int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
+- (wchar_t *) runp->wcs, runp->nwcs);
++ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs);
+
+ if (c == 0)
+ {
+@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ one consecutive entry. */
+ if (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+ {
+@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ runp = runp->wcnext;
+ while (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+
+diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
+index f791e6b7e9..d809d6db7f 100644
+--- a/locale/programs/ld-ctype.c
++++ b/locale/programs/ld-ctype.c
+@@ -915,7 +915,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ allocate_arrays (ctype, charmap, ctype->repertoire);
+
+ default_missing_len = (ctype->default_missing
+- ? wcslen ((wchar_t *) ctype->default_missing)
++ ? wcslen_uint32 (ctype->default_missing)
+ : 0);
+
+ init_locale_data (&file, nelems);
+@@ -1926,7 +1926,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
+ ignore = 1;
+ else
+ /* This value is usable. */
+- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4);
++ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4);
+
+ first = 0;
+ }
+@@ -2460,8 +2460,8 @@ with character code range values one must use the absolute ellipsis `...'"));
+ }
+
+ handle_tok_digit:
+- class_bit = _ISwdigit;
+- class256_bit = _ISdigit;
++ class_bit = BITw (tok_digit);
++ class256_bit = BIT (tok_digit);
+ handle_digits = 1;
+ goto read_charclass;
+
+@@ -3901,8 +3901,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+
+ while (idx < number)
+ {
+- int res = wcscmp ((const wchar_t *) sorted[idx]->from,
+- (const wchar_t *) runp->from);
++ int res = wcscmp_uint32 (sorted[idx]->from, runp->from);
+ if (res == 0)
+ {
+ replace = 1;
+@@ -3939,11 +3938,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ for (size_t cnt = 0; cnt < number; ++cnt)
+ {
+ struct translit_to_t *srunp;
+- from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
++ from_len += wcslen_uint32 (sorted[cnt]->from) + 1;
+ srunp = sorted[cnt]->to;
+ while (srunp != NULL)
+ {
+- to_len += wcslen ((const wchar_t *) srunp->str) + 1;
++ to_len += wcslen_uint32 (srunp->str) + 1;
+ srunp = srunp->next;
+ }
+ /* Plus one for the extra NUL character marking the end of
+@@ -3967,18 +3966,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ ctype->translit_from_idx[cnt] = from_len;
+ ctype->translit_to_idx[cnt] = to_len;
+
+- len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
+- wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len],
+- (const wchar_t *) sorted[cnt]->from, len);
++ len = wcslen_uint32 (sorted[cnt]->from) + 1;
++ wmemcpy_uint32 (&ctype->translit_from_tbl[from_len],
++ sorted[cnt]->from, len);
+ from_len += len;
+
+ ctype->translit_to_idx[cnt] = to_len;
+ srunp = sorted[cnt]->to;
+ while (srunp != NULL)
+ {
+- len = wcslen ((const wchar_t *) srunp->str) + 1;
+- wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len],
+- (const wchar_t *) srunp->str, len);
++ len = wcslen_uint32 (srunp->str) + 1;
++ wmemcpy_uint32 (&ctype->translit_to_tbl[to_len],
++ srunp->str, len);
+ to_len += len;
+ srunp = srunp->next;
+ }
+diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
+index a755792363..e8b2f85522 100644
+--- a/locale/programs/ld-time.c
++++ b/locale/programs/ld-time.c
+@@ -220,8 +220,10 @@ No definition for %s category found"), "LC_TIME");
+ }
+ else
+ {
++ static const uint32_t wt_fmt_ampm[]
++ = { '%','I',':','%','M',':','%','S',' ','%','p',0 };
+ time->t_fmt_ampm = "%I:%M:%S %p";
+- time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p";
++ time->wt_fmt_ampm = wt_fmt_ampm;
+ }
+ }
+
+@@ -231,7 +233,7 @@ No definition for %s category found"), "LC_TIME");
+ const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
+ 31, 31, 30, 31 ,30, 31 };
+ size_t idx;
+- wchar_t *wstr;
++ uint32_t *wstr;
+
+ time->era_entries =
+ (struct era_data *) xmalloc (time->num_era
+@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME");
+ }
+
+ /* Now generate the wide character name and format. */
+- wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */
++ wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */
+ if (wstr != NULL)
+ {
+- time->era_entries[idx].wname = (uint32_t *) wstr + 1;
+- wstr = wcschr (wstr + 1, L':'); /* end name */
++ time->era_entries[idx].wname = wstr + 1;
++ wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */
+ if (wstr != NULL)
+ {
+ *wstr = L'\0';
+- time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
++ time->era_entries[idx].wformat = wstr + 1;
+ }
+ else
+ time->era_entries[idx].wname =
+@@ -527,7 +529,16 @@ No definition for %s category found"), "LC_TIME");
+ if (time->date_fmt == NULL)
+ time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
+ if (time->wdate_fmt == NULL)
+- time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y";
++ {
++ static const uint32_t wdate_fmt[] =
++ { '%','a',' ',
++ '%','b',' ',
++ '%','e',' ',
++ '%','H',':','%','M',':','%','S',' ',
++ '%','Z',' ',
++ '%','Y',0 };
++ time->wdate_fmt = wdate_fmt;
++ }
+ }
+
+
+diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
+index 3525c8a43d..f8a7fd9c24 100644
+--- a/locale/programs/linereader.c
++++ b/locale/programs/linereader.c
+@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
+ {
+ int return_widestr = lr->return_widestr;
+ char *buf;
+- wchar_t *buf2 = NULL;
++ uint32_t *buf2 = NULL;
+ size_t bufact;
+ size_t bufmax = 56;
+
+diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
+index d718d2e9f4..e0a3ad5a83 100644
+--- a/locale/programs/localedef.c
++++ b/locale/programs/localedef.c
+@@ -105,6 +105,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ #define OPT_BIG_ENDIAN 401
+ #define OPT_NO_WARN 402
+ #define OPT_WARN 403
++#define OPT_UINT32_ALIGN 404
+
+ /* Definitions of arguments for argp functions. */
+ static const struct argp_option options[] =
+@@ -147,6 +148,8 @@ static const struct argp_option options[] =
+ N_("Generate little-endian output") },
+ { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
+ N_("Generate big-endian output") },
++ { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0,
++ N_("Set the target's uint32_t alignment in bytes (default 4)") },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+@@ -236,12 +239,14 @@ main (int argc, char *argv[])
+ ctype locale. (P1003.2 4.35.5.2) */
+ setlocale (LC_CTYPE, "POSIX");
+
++#ifndef NO_SYSCONF
+ /* Look whether the system really allows locale definitions. POSIX
+ defines error code 3 for this situation so I think it must be
+ a fatal error (see P1003.2 4.35.8). */
+ if (sysconf (_SC_2_LOCALEDEF) < 0)
+ record_error (3, 0, _("\
+ FATAL: system does not define `_POSIX2_LOCALEDEF'"));
++#endif
+
+ /* Process charmap file. */
+ charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
+@@ -389,6 +394,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
+ /* Enable the warnings. */
+ set_warnings (arg, true);
+ break;
++ case OPT_UINT32_ALIGN:
++ uint32_align_mask = strtol (arg, NULL, 0) - 1;
++ break;
+ case 'c':
+ force_output = 1;
+ break;
+diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
+index 32e5f761f2..b41e77bd8d 100644
+--- a/locale/programs/locfile.c
++++ b/locale/programs/locfile.c
+@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
+ machine running localedef. */
+ bool swap_endianness_p;
+
++/* The target's value of __align__(uint32_t) - 1. */
++unsigned int uint32_align_mask = 3;
++
+ /* When called outside a start_locale_structure/end_locale_structure
+ or start_locale_prelude/end_locale_prelude block, record that the
+ next byte in FILE's obstack will be the first byte of a new element.
+@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string)
+ void
+ add_locale_wstring (struct locale_file *file, const uint32_t *string)
+ {
+- add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1);
++ add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1);
+ }
+
+ /* Record that FILE's next element is the 32-bit integer VALUE. */
+diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
+index 89b347c72d..a636fc2960 100644
+--- a/locale/programs/locfile.h
++++ b/locale/programs/locfile.h
+@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions,
+
+ extern bool swap_endianness_p;
+
++extern unsigned int uint32_align_mask;
++
+ /* Change the output to be big-endian if BIG_ENDIAN is true and
+ little-endian otherwise. */
+ static inline void
+@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
+ }
+
+ /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_array (uint32_t *array, size_t n)
+ {
+ if (swap_endianness_p)
+@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
+
+ /* Like maybe_swap_uint32_array, but the array of N elements is at
+ the end of OBSTACK's current object. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
+ {
+ maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
+@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale,
+ const struct charmap_t *charmap,
+ const char *output_path);
+
++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++
++static size_t
++wcslen_uint32 (const uint32_t *str)
++{
++ size_t len = 0;
++ while (str[len] != 0)
++ len++;
++ return len;
++}
++
++static int
++wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
++{
++ while (n-- != 0)
++ {
++ int diff = *s1++ - *s2++;
++ if (diff != 0)
++ return diff;
++ }
++ return 0;
++}
++
++static int
++wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
++{
++ while (*s1 != 0 && *s1 == *s2)
++ s1++, s2++;
++ return *s1 - *s2;
++}
++
++static uint32_t *
++wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
++{
++ return memcpy (s1, s2, n * sizeof (uint32_t));
++}
++
++static uint32_t *
++wcschr_uint32 (const uint32_t *s, uint32_t ch)
++{
++ do
++ if (*s == ch)
++ return (uint32_t *) s;
++ while (*s++ != 0);
++ return 0;
++}
++
+ #endif /* locfile.h */
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index e4de907e1f..b5d8f5c17d 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
+@@ -64,36 +64,6 @@ static char *const _nl_current_used[] =
+ #endif
+
+
+-/* Define an array of category names (also the environment variable names). */
+-const union catnamestr_t _nl_category_names attribute_hidden =
+- {
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- category_name,
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- }
+- };
+-
+-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- };
+-
+-/* An array of their lengths, for convenience. */
+-const uint8_t _nl_category_name_sizes[] attribute_hidden =
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- [category] = sizeof (category_name) - 1,
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- [LC_ALL] = sizeof ("LC_ALL") - 1
+- };
+-
+-
+ #ifdef NL_CURRENT_INDIRECT
+ # define WEAK_POSTLOAD(postload) weak_extern (postload)
+ #else
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch b/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch
new file mode 100644
index 000000000..ae708ef83
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch
@@ -0,0 +1,32 @@
+From 9d71526be21abe68dd8ca3a5a219445851bbc2f4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 20 Apr 2016 21:11:00 -0700
+Subject: [PATCH 23/27] Define DUMMY_LOCALE_T if not defined
+
+This is a hack to fix building the locale bits on an older
+CentOs 5.X machine
+
+Upstream-Status: Inappropriate [other]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/programs/config.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/locale/programs/config.h b/locale/programs/config.h
+index 9956cd8446..04342f3644 100644
+--- a/locale/programs/config.h
++++ b/locale/programs/config.h
+@@ -19,6 +19,9 @@
+ #ifndef _LD_CONFIG_H
+ #define _LD_CONFIG_H 1
+
++#ifndef DUMMY_LOCALE_T
++#define DUMMY_LOCALE_T
++#endif
+ /* Use the internal textdomain used for libc messages. */
+ #define PACKAGE _libc_intl_domainname
+ #ifndef VERSION
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
new file mode 100644
index 000000000..42ff66781
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
@@ -0,0 +1,56 @@
+From 03873af286f1dab1062f598d6deb774ce513421d Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Thu, 18 Aug 2016 14:07:58 -0500
+Subject: [PATCH 24/27] elf/dl-deps.c: Make _dl_build_local_scope breadth first
+
+According to the ELF specification:
+
+When resolving symbolic references, the dynamic linker examines the symbol
+tables with a breadth-first search.
+
+This function was using a depth first search. By doing so the conflict
+resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
+was incorrect. This caused problems when their were various circular
+dependencies between libraries. The problem usually manifested itself by
+the wrong IFUNC being executed.
+
+[BZ# 20488]
+
+Upstream-Status: Submitted [libc-alpha]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ elf/dl-deps.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/elf/dl-deps.c b/elf/dl-deps.c
+index c975fcffd7..6ee58c74e0 100644
+--- a/elf/dl-deps.c
++++ b/elf/dl-deps.c
+@@ -72,13 +72,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
+ {
+ struct link_map **p = list;
+ struct link_map **q;
++ struct link_map **r;
+
+ *p++ = map;
+ map->l_reserved = 1;
+- if (map->l_initfini)
+- for (q = map->l_initfini + 1; *q; ++q)
+- if (! (*q)->l_reserved)
+- p += _dl_build_local_scope (p, *q);
++
++ for (r = list; r < p; ++r)
++ if ((*r)->l_initfini)
++ for (q = (*r)->l_initfini + 1; *q; ++q)
++ if (! (*q)->l_reserved)
++ {
++ *p++ = *q;
++ (*q)->l_reserved = 1;
++ }
+ return p - list;
+ }
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch b/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch
new file mode 100644
index 000000000..7f5d1421d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch
@@ -0,0 +1,38 @@
+From 56dab024751941c07eb479f47ef6682e2168c86a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
+Date: Mon, 22 Aug 2016 16:09:25 +0200
+Subject: [PATCH 25/27] locale: fix hard-coded reference to gcc -E
+
+When new version of compilers are published, they may not be compatible with
+older versions of software. This is particularly common when software is built
+with -Werror.
+
+Autotools provides a way for a user to specify the name of his compiler using a
+set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when
+compiling glibc but the script used to generate transliterations in the locale/
+subdirectory directly calls the gcc binary to get the output of the
+preprocessor instead of using the $CPP variable provided by the build
+environment.
+
+This patch replaces the hard-coded reference to the gcc binary with the proper
+environment variable, thus allowing a user to override it.
+
+Upstream-Status: Submitted [https://sourceware.org/ml/libc-alpha/2016-08/msg00746.html]
+---
+ locale/gen-translit.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl
+index 30d3f2f195..e97653017c 100644
+--- a/locale/gen-translit.pl
++++ b/locale/gen-translit.pl
+@@ -1,5 +1,5 @@
+ #!/usr/bin/perl -w
+-open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file";
++open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file";
+
+
+ sub cstrlen {
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0026-reset-dl_load_write_lock-after-forking.patch b/poky/meta/recipes-core/glibc/glibc/0026-reset-dl_load_write_lock-after-forking.patch
new file mode 100644
index 000000000..eca1193dd
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0026-reset-dl_load_write_lock-after-forking.patch
@@ -0,0 +1,40 @@
+From 847d37d5a34e4bf294de4ba98de3668950e28bc7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Jan 2018 10:05:07 -0800
+Subject: [PATCH 26/27] reset dl_load_write_lock after forking
+
+The patch in this Bugzilla entry was requested by a customer:
+
+ https://www.sourceware.org/bugzilla/show_bug.cgi?id=19282
+
+The __libc_fork() code reset dl_load_lock, but it also needed to reset
+dl_load_write_lock. The patch has not yet been integrated upstream.
+
+Upstream-Status: Pending [ No Author See bugzilla]
+
+Signed-off-by: Damodar Sonone <damodar.sonone@kpit.com>
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/nptl/fork.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
+index 846fa49ef2..f87506f398 100644
+--- a/sysdeps/nptl/fork.c
++++ b/sysdeps/nptl/fork.c
+@@ -194,9 +194,9 @@ __libc_fork (void)
+ _IO_list_resetlock ();
+ }
+
+- /* Reset the lock the dynamic loader uses to protect its data. */
++ /* Reset the locks the dynamic loader uses to protect its data. */
+ __rtld_lock_initialize (GL(dl_load_lock));
+-
++ __rtld_lock_initialize (GL(dl_load_write_lock));
+ /* Run the handlers registered for the child. */
+ while (allp != NULL)
+ {
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch b/poky/meta/recipes-core/glibc/glibc/0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch
new file mode 100644
index 000000000..9ec234bd5
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch
@@ -0,0 +1,70 @@
+From 94225ab4bcc1613531558a632270b5edce779bc9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 27 Jan 2018 10:08:04 -0800
+Subject: [PATCH 27/27] Acquire ld.so lock before switching to malloc_atfork
+
+The patch is from
+ https://sourceware.org/bugzilla/show_bug.cgi?id=4578
+
+If a thread happens to hold dl_load_lock and have r_state set to RT_ADD or
+RT_DELETE at the time another thread calls fork(), then the child exit code
+from fork (in nptl/sysdeps/unix/sysv/linux/fork.c in our case) re-initializes
+dl_load_lock but does not restore r_state to RT_CONSISTENT. If the child
+subsequently requires ld.so functionality before calling exec(), then the
+assertion will fire.
+
+The patch acquires dl_load_lock on entry to fork() and releases it on exit
+from the parent path. The child path is initialized as currently done.
+This is essentially pthreads_atfork, but forced to be first because the
+acquisition of dl_load_lock must happen before malloc_atfork is active
+to avoid a deadlock.
+
+The patch has not yet been integrated upstream.
+
+Upstream-Status: Pending [ Not Author See bugzilla]
+
+Signed-off-by: Raghunath Lolur <Raghunath.Lolur@kpit.com>
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/nptl/fork.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/sysdeps/nptl/fork.c b/sysdeps/nptl/fork.c
+index f87506f398..225e7b51f8 100644
+--- a/sysdeps/nptl/fork.c
++++ b/sysdeps/nptl/fork.c
+@@ -25,6 +25,7 @@
+ #include <tls.h>
+ #include <hp-timing.h>
+ #include <ldsodefs.h>
++#include <libc-lock.h>
+ #include <stdio-lock.h>
+ #include <atomic.h>
+ #include <nptl/pthreadP.h>
+@@ -60,6 +61,10 @@ __libc_fork (void)
+ but our current fork implementation is not. */
+ bool multiple_threads = THREAD_GETMEM (THREAD_SELF, header.multiple_threads);
+
++ /* grab ld.so lock BEFORE switching to malloc_atfork */
++ __rtld_lock_lock_recursive (GL(dl_load_lock));
++ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
++
+ /* Run all the registered preparation handlers. In reverse order.
+ While doing this we build up a list of all the entries. */
+ struct fork_handler *runp;
+@@ -246,6 +251,10 @@ __libc_fork (void)
+
+ allp = allp->next;
+ }
++
++ /* unlock ld.so last, because we locked it first */
++ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
++ __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ }
+
+ return pid;
+--
+2.16.1
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch b/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch
new file mode 100644
index 000000000..436c84778
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch
@@ -0,0 +1,69 @@
+From af3054b3856379d353a779801678f330e1b58c9a Mon Sep 17 00:00:00 2001
+Message-Id: <af3054b3856379d353a779801678f330e1b58c9a.1490183611.git.panand@redhat.com>
+From: Pratyush Anand <panand@redhat.com>
+Date: Wed, 22 Mar 2017 17:02:38 +0530
+Subject: [PATCH] bits/siginfo-consts.h: enum definition for TRAP_HWBKPT is missing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compile following linux kernel test code with latest glibc:
+
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
+
+and we get following error:
+breakpoint_test_arm64.c: In function ‘run_test’:
+breakpoint_test_arm64.c:171:25: error: ‘TRAP_HWBKPT’ undeclared (first use in this function)
+ if (siginfo.si_code != TRAP_HWBKPT) {
+ ^
+I can compile test code by modifying my local
+/usr/include/bits/siginfo.h and test works great. Therefore, this patch
+will be needed in upstream glibc so that issue is fixed there as well.
+
+Signed-off-by: Pratyush Anand <panand@redhat.com>
+
+Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=21286]
+---
+ bits/siginfo-consts.h | 6 +++++-
+ sysdeps/unix/sysv/linux/bits/siginfo-consts.h | 6 +++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/bits/siginfo-consts.h b/bits/siginfo-consts.h
+index a58ac4b..8448fac 100644
+--- a/bits/siginfo-consts.h
++++ b/bits/siginfo-consts.h
+@@ -106,8 +106,12 @@ enum
+ {
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+ # define TRAP_BRKPT TRAP_BRKPT
+- TRAP_TRACE /* Process trace trap. */
++ TRAP_TRACE, /* Process trace trap. */
+ # define TRAP_TRACE TRAP_TRACE
++ TRAP_BRANCH, /* Process branch trap. */
++# define TRAP_BRANCH TRAP_BRANCH
++ TRAP_HWBKPT /* hardware breakpoint/watchpoint */
++# define TRAP_HWBKPT TRAP_HWBKPT
+ };
+ # endif
+
+diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
+index 525840c..57a9edb 100644
+--- a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
++++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
+@@ -137,8 +137,12 @@ enum
+ {
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+ # define TRAP_BRKPT TRAP_BRKPT
+- TRAP_TRACE /* Process trace trap. */
++ TRAP_TRACE, /* Process trace trap. */
+ # define TRAP_TRACE TRAP_TRACE
++ TRAP_BRANCH, /* Process branch trap. */
++# define TRAP_BRANCH TRAP_BRANCH
++ TRAP_HWBKPT /* hardware breakpoint/watchpoint */
++# define TRAP_HWBKPT TRAP_HWBKPT
+ };
+ # endif
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch b/poky/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch
new file mode 100644
index 000000000..fa29f4165
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch
@@ -0,0 +1,40 @@
+From 113e0516fbd3ce18253f0423762416d4c4b38fb0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 22 Mar 2018 17:57:37 -0700
+Subject: [PATCH 29/29] Replace strncpy with memccpy to fix
+ -Wstringop-truncation.
+
+ * nis/nss_nisplus/nisplus-parser.c: Replace strncpy with memcpy to
+ avoid -Wstringop-truncation.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted [https://sourceware.org/ml/libc-alpha/2018-03/msg00531.html]
+
+ nis/nss_nisplus/nisplus-parser.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nis/nss_nisplus/nisplus-parser.c b/nis/nss_nisplus/nisplus-parser.c
+index 8dc021e73d..b53284f889 100644
+--- a/nis/nss_nisplus/nisplus-parser.c
++++ b/nis/nss_nisplus/nisplus-parser.c
+@@ -87,7 +87,7 @@ _nss_nisplus_parse_pwent (nis_result *result, struct passwd *pw,
+ if (len >= room_left)
+ goto no_more_room;
+
+- strncpy (first_unused, numstr, len);
++ memcpy (first_unused, numstr, len);
+ first_unused[len] = '\0';
+ numstr = first_unused;
+ }
+@@ -103,7 +103,7 @@ _nss_nisplus_parse_pwent (nis_result *result, struct passwd *pw,
+ if (len >= room_left)
+ goto no_more_room;
+
+- strncpy (first_unused, numstr, len);
++ memcpy (first_unused, numstr, len);
+ first_unused[len] = '\0';
+ numstr = first_unused;
+ }
+--
+2.16.2
+
diff --git a/poky/meta/recipes-core/glibc/glibc/0030-plural_c_no_preprocessor_lines.patch b/poky/meta/recipes-core/glibc/glibc/0030-plural_c_no_preprocessor_lines.patch
new file mode 100644
index 000000000..6f03e1c62
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0030-plural_c_no_preprocessor_lines.patch
@@ -0,0 +1,21 @@
+Improve reproducibility:
+Do not put any #line preprocessor commands in bison generated files.
+These lines contain absolute paths containing file locations on
+the host build machine.
+
+Upstream-Status: Pending
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+diff --git a/intl/Makefile b/intl/Makefile
+index 2219717..a203780 100644
+--- a/intl/Makefile
++++ b/intl/Makefile
+@@ -151,7 +151,7 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
+
+ CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \
+ -D'LOCALE_ALIAS_PATH="$(localedir)"'
+-BISONFLAGS = --yacc --name-prefix=__gettext --output
++BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output
+
+ $(inst_localedir)/locale.alias: locale.alias $(+force)
+ $(do-install)
diff --git a/poky/meta/recipes-core/glibc/glibc/0031-nativesdk-deprecate-libcrypt.patch b/poky/meta/recipes-core/glibc/glibc/0031-nativesdk-deprecate-libcrypt.patch
new file mode 100644
index 000000000..a9132ed3d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/0031-nativesdk-deprecate-libcrypt.patch
@@ -0,0 +1,419 @@
+Background information:
+
+https://sourceware.org/ml/libc-alpha/2017-08/msg01257.html
+https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt
+
+Upstream-Status: Submitted [libc-alpha@sourceware.org]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+From: Zack Weinberg <zackw@panix.com>
+Subject: [PATCH] Deprecate libcrypt and don't build it by default
+
+Back in June, Björn Esser proposed to add OpenBSD-compatible bcrypt
+support to our implementation of crypt(3), and Zack Weinberg replied
+that it might actually make more sense to _remove_ libcrypt from
+glibc, freeing up libcrypt.so.1 and crypt.h to be provided by a
+separate project that could move faster. (For instance, libxcrypt:
+https://github.com/besser82/libxcrypt)
+
+This patch disables build and installation of libcrypt by default. It
+can be re-enabled with --enable-obsolete-crypt to configure. Unlike
+libnsl, we do *not* install a runtime shared library; that's left to
+the replacement. (Unlike the SunRPC situation, I think we can
+probably drop this code altogether in a release or two.)
+
+The function prototypes for crypt and encrypt are removed from
+unistd.h, and the function prototype for setkey is removed from
+stdlib.h; they do *not* come back with --enable-obsolete-crypt. This
+means glibc no longer provides the POSIX CRYPT option, and the macro
+_XOPEN_CRYPT is also removed from unistd.h to indicate that.
+(_SC_XOPEN_CRYPT is still defined, but sysconf(_SC_XOPEN_CRYPT) will
+return -1 at runtime.) These functions are also unconditionally
+removed from conform/data/{stdlib,unistd}.h-data.
+
+ * posix/unistd.h (_XOPEN_CRYPT, crypt, encrypt): Don't declare.
+ * stdlib/stdlib.h (setkey): Don't declare.
+
+ * configure.ac (--enable-obsolete-crypt): New configure option.
+ * configure: Regenerate.
+ * config.make.in (build-obsolete-crypt): New makefile variable.
+ * crypt/Banner: Delete file.
+ * crypt/Makefile: Don't build anything unless
+ $(build-obsolete-crypt) is 'yes'.
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile: Only add things
+ to libcrypt-sysdep_routines when $(build-obsolete-crypt) is 'yes'.
+ * sysdeps/sparc/sparc64/multiarch/Makefile: Likewise.
+ * sysdeps/unix/sysv/linux/arm/Makefile: Likewise.
+
+ * conform/Makefile: Only include libcrypt.a in linknamespace tests
+ when $(build-obsolete-crypt) is 'yes'.
+ * conform/data/stdlib.h-data (setkey): Don't expect.
+ * conform/data/unistd.h-data (crypt, encrypt): Don't expect.
+ * elf/Makefile: Only perform various tests of libcrypt.so/libcrypt.a
+ when $(build-obsolete-crypt) is 'yes'.
+ * elf/tst-linkall-static.c: Don't include crypt.h when USE_CRYPT
+ is false.
+---
+ NEWS | 18 ++++++++++++++++++
+ config.make.in | 1 +
+ configure | 13 +++++++++++++
+ configure.ac | 8 ++++++++
+ conform/Makefile | 14 ++++++++++----
+ conform/data/stdlib.h-data | 3 ---
+ conform/data/unistd.h-data | 6 ------
+ crypt/Makefile | 5 +++++
+ elf/Makefile | 16 ++++++++++++----
+ elf/tst-linkall-static.c | 2 ++
+ posix/unistd.h | 16 ----------------
+ stdlib/stdlib.h | 6 ------
+ sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile | 2 ++
+ sysdeps/sparc/sparc64/multiarch/Makefile | 2 ++
+ sysdeps/unix/sysv/linux/arm/Makefile | 2 ++
+ 15 files changed, 75 insertions(+), 39 deletions(-)
+
+diff --git a/config.make.in b/config.make.in
+index 9e5e24b2c6..8fe610d04d 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -82,6 +82,7 @@ mach-interface-list = @mach_interface_list@
+
+ experimental-malloc = @experimental_malloc@
+
++build-obsolete-crypt = @build_obsolete_crypt@
+ nss-crypt = @libc_cv_nss_crypt@
+ static-nss-crypt = @libc_cv_static_nss_crypt@
+
+diff --git a/configure b/configure
+index 7a8bd3f817..46f6bd7f86 100755
+--- a/configure
++++ b/configure
+@@ -672,6 +672,7 @@ base_machine
+ have_tunables
+ build_pt_chown
+ build_nscd
++build_obsolete_crypt
+ build_obsolete_nsl
+ link_obsolete_rpc
+ libc_cv_static_nss_crypt
+@@ -782,6 +783,7 @@ enable_experimental_malloc
+ enable_nss_crypt
+ enable_obsolete_rpc
+ enable_obsolete_nsl
++enable_obsolete_crypt
+ enable_systemtap
+ enable_build_nscd
+ enable_nscd
+@@ -1453,6 +1455,7 @@ Optional Features:
+ link-time usage
+ --enable-obsolete-nsl build and install the obsolete libnsl library and
+ depending NSS modules
++ --enable-obsolete-crypt build and install the obsolete libcrypt library
+ --enable-systemtap enable systemtap static probe points [default=no]
+ --disable-build-nscd disable building and installing the nscd daemon
+ --disable-nscd library functions will not contact the nscd daemon
+@@ -3632,6 +3635,16 @@ if test "$build_obsolete_nsl" = yes; then
+
+ fi
+
++# Check whether --enable-obsolete-crypt was given.
++if test "${enable_obsolete_crypt+set}" = set; then :
++ enableval=$enable_obsolete_crypt; build_obsolete_crypt=$enableval
++else
++ build_obsolete_crypt=no
++fi
++
++
++
++
+ # Check whether --enable-systemtap was given.
+ if test "${enable_systemtap+set}" = set; then :
+ enableval=$enable_systemtap; systemtap=$enableval
+diff --git a/configure.ac b/configure.ac
+index ca1282a6b3..0142353740 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -378,6 +378,14 @@ if test "$build_obsolete_nsl" = yes; then
+ AC_DEFINE(LINK_OBSOLETE_NSL)
+ fi
+
++AC_ARG_ENABLE([obsolete-crypt],
++ AC_HELP_STRING([--enable-obsolete-crypt],
++ [build and install the obsolete libcrypt library]),
++ [build_obsolete_crypt=$enableval],
++ [build_obsolete_crypt=no])
++AC_SUBST(build_obsolete_crypt)
++
++
+ AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [enable systemtap static probe points @<:@default=no@:>@])],
+diff --git a/conform/Makefile b/conform/Makefile
+index 864fdeca21..5ef474fb24 100644
+--- a/conform/Makefile
++++ b/conform/Makefile
+@@ -193,22 +193,28 @@ linknamespace-libs-thr = $(linknamespace-libs-isoc) \
+ $(common-objpfx)rt/librt.a $(static-thread-library)
+ linknamespace-libs-posix = $(linknamespace-libs-thr) \
+ $(common-objpfx)dlfcn/libdl.a
+-linknamespace-libs-xsi = $(linknamespace-libs-posix) \
+- $(common-objpfx)crypt/libcrypt.a
++linknamespace-libs-xsi = $(linknamespace-libs-posix)
+ linknamespace-libs-ISO = $(linknamespace-libs-isoc)
+ linknamespace-libs-ISO99 = $(linknamespace-libs-isoc)
+ linknamespace-libs-ISO11 = $(linknamespace-libs-isoc)
+-linknamespace-libs-XPG4 = $(linknamespace-libs-isoc) \
+- $(common-objpfx)crypt/libcrypt.a
++linknamespace-libs-XPG4 = $(linknamespace-libs-isoc)
+ linknamespace-libs-XPG42 = $(linknamespace-libs-XPG4)
+ linknamespace-libs-POSIX = $(linknamespace-libs-thr)
+ linknamespace-libs-UNIX98 = $(linknamespace-libs-xsi)
+ linknamespace-libs-XOPEN2K = $(linknamespace-libs-xsi)
+ linknamespace-libs-POSIX2008 = $(linknamespace-libs-posix)
+ linknamespace-libs-XOPEN2K8 = $(linknamespace-libs-xsi)
++
++ifeq ($(build-obsolete-crypt),yes)
++linknamespace-libs-xsi += $(common-objpfx)crypt/libcrypt.a
++linknamespace-libs-XPG4 += $(common-objpfx)crypt/libcrypt.a
++endif
++
+ linknamespace-libs = $(foreach std,$(conformtest-standards),\
+ $(linknamespace-libs-$(std)))
+
++
++
+ $(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \
+ $(linknamespace-libs)
+ LC_ALL=C $(READELF) -W -s $(linknamespace-libs-$*) > $@; \
+diff --git a/conform/data/stdlib.h-data b/conform/data/stdlib.h-data
+index d8fcccc2fb..6913828196 100644
+--- a/conform/data/stdlib.h-data
++++ b/conform/data/stdlib.h-data
+@@ -149,9 +149,6 @@ function {unsigned short int*} seed48 (unsigned short int[3])
+ #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98
+ function int setenv (const char*, const char*, int)
+ #endif
+-#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008
+-function void setkey (const char*)
+-#endif
+ #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008
+ function {char*} setstate (char*)
+ #endif
+diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data
+index ddf4f25132..aa070528e8 100644
+--- a/conform/data/unistd.h-data
++++ b/conform/data/unistd.h-data
+@@ -437,9 +437,6 @@ function int chroot (const char*)
+ function int chown (const char*, uid_t, gid_t)
+ function int close (int)
+ function size_t confstr (int, char*, size_t)
+-#if !defined POSIX && !defined POSIX2008
+-function {char*} crypt (const char*, const char*)
+-#endif
+ #if defined XPG4 || defined XPG42 || defined UNIX98
+ function {char*} ctermid (char*)
+ function {char*} cuserid (char*)
+@@ -449,9 +446,6 @@ allow cuserid
+ #endif
+ function int dup (int)
+ function int dup2 (int, int)
+-#if !defined POSIX && !defined POSIX2008
+-function void encrypt (char[64], int)
+-#endif
+ function int execl (const char*, const char*, ...)
+ function int execle (const char*, const char*, ...)
+ function int execlp (const char*, const char*, ...)
+diff --git a/crypt/Makefile b/crypt/Makefile
+index 303800df73..024ec2c6ab 100644
+--- a/crypt/Makefile
++++ b/crypt/Makefile
+@@ -22,6 +22,8 @@ subdir := crypt
+
+ include ../Makeconfig
+
++ifeq ($(build-obsolete-crypt),yes)
++
+ headers := crypt.h
+
+ extra-libs := libcrypt
+@@ -52,9 +54,11 @@ tests += md5test sha256test sha512test
+ # machine over a minute.
+ xtests = md5test-giant
+ endif
++endif
+
+ include ../Rules
+
++ifeq ($(build-obsolete-crypt),yes)
+ ifneq ($(nss-crypt),yes)
+ md5-routines := md5 $(filter md5%,$(libcrypt-sysdep_routines))
+ sha256-routines := sha256 $(filter sha256%,$(libcrypt-sysdep_routines))
+@@ -71,3 +75,4 @@ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
+ else
+ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
+ endif
++endif
+diff --git a/elf/Makefile b/elf/Makefile
+index 2a432d8bee..366f7b80ec 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -385,15 +385,19 @@ $(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os
+ CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag)
+ endif
+
+-# By default tst-linkall-static should try to use crypt routines to test
+-# static libcrypt use.
+-CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1
++ifeq ($(build-obsolete-crypt),yes)
++# If the libcrypt library is being built, tst-linkall-static should
++# try to use crypt routines to test static libcrypt use.
++CFLAGS-tst-linkall-static.c = -DUSE_CRYPT=1
+ # However, if we are using NSS crypto and we don't have a static
+ # library, then we exclude the use of crypt functions in the test.
+ # We similarly exclude libcrypt.a from the static link (see below).
+ ifeq (yesno,$(nss-crypt)$(static-nss-crypt))
+ CFLAGS-tst-linkall-static.c += -UUSE_CRYPT -DUSE_CRYPT=0
+ endif
++else
++CFLAGS-tst-linkall-static.c = -DUSE_CRYPT=0
++endif
+
+ include ../Rules
+
+@@ -1113,8 +1117,10 @@ localplt-built-dso := $(addprefix $(common-objpfx),\
+ rt/librt.so \
+ dlfcn/libdl.so \
+ resolv/libresolv.so \
+- crypt/libcrypt.so \
+ )
++ifeq ($(build-obsolete-crypt),yes)
++localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so)
++endif
+ ifeq ($(build-mathvec),yes)
+ localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so)
+ endif
+@@ -1395,6 +1401,7 @@ $(objpfx)tst-linkall-static: \
+ $(common-objpfx)resolv/libanl.a \
+ $(static-thread-library)
+
++ifeq ($(build-obsolete-crypt),yes)
+ # If we are using NSS crypto and we have the ability to link statically
+ # then we include libcrypt.a, otherwise we leave out libcrypt.a and
+ # link as much as we can into the tst-linkall-static test. This assumes
+@@ -1410,6 +1417,7 @@ ifeq (no,$(nss-crypt))
+ $(objpfx)tst-linkall-static: \
+ $(common-objpfx)crypt/libcrypt.a
+ endif
++endif
+
+ # The application depends on the DSO, and the DSO loads the plugin.
+ # The plugin also depends on the DSO. This creates the circular
+diff --git a/elf/tst-linkall-static.c b/elf/tst-linkall-static.c
+index e8df38f74e..0ffae7c723 100644
+--- a/elf/tst-linkall-static.c
++++ b/elf/tst-linkall-static.c
+@@ -18,7 +18,9 @@
+
+ #include <math.h>
+ #include <pthread.h>
++#if USE_CRYPT
+ #include <crypt.h>
++#endif
+ #include <resolv.h>
+ #include <dlfcn.h>
+ #include <utmp.h>
+diff --git a/posix/unistd.h b/posix/unistd.h
+index 4d149f9945..e75ce4d4ec 100644
+--- a/posix/unistd.h
++++ b/posix/unistd.h
+@@ -107,9 +107,6 @@ __BEGIN_DECLS
+ /* The X/Open Unix extensions are available. */
+ #define _XOPEN_UNIX 1
+
+-/* Encryption is present. */
+-#define _XOPEN_CRYPT 1
+-
+ /* The enhanced internationalization capabilities according to XPG4.2
+ are present. */
+ #define _XOPEN_ENH_I18N 1
+@@ -1118,20 +1115,7 @@ ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
+ extern int fdatasync (int __fildes);
+ #endif /* Use POSIX199309 */
+
+-
+-/* XPG4.2 specifies that prototypes for the encryption functions must
+- be defined here. */
+ #ifdef __USE_XOPEN
+-/* Encrypt at most 8 characters from KEY using salt to perturb DES. */
+-extern char *crypt (const char *__key, const char *__salt)
+- __THROW __nonnull ((1, 2));
+-
+-/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
+- block in place. */
+-extern void encrypt (char *__glibc_block, int __edflag)
+- __THROW __nonnull ((1));
+-
+-
+ /* Swab pairs bytes in the first N bytes of the area pointed to by
+ FROM and copy the result to TO. The value of TO must not be in the
+ range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM
+diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
+index 6b1ead31e0..8e23e93557 100644
+--- a/stdlib/stdlib.h
++++ b/stdlib/stdlib.h
+@@ -958,12 +958,6 @@ extern int getsubopt (char **__restrict __optionp,
+ #endif
+
+
+-#ifdef __USE_XOPEN
+-/* Setup DES tables according KEY. */
+-extern void setkey (const char *__key) __THROW __nonnull ((1));
+-#endif
+-
+-
+ /* X/Open pseudo terminal handling. */
+
+ #ifdef __USE_XOPEN2KXSI
+diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+index a6d08f3a00..d8b8297fb0 100644
+--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
++++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+@@ -1,6 +1,8 @@
+ ifeq ($(subdir),crypt)
++ifeq ($(build-obsolete-crypt),yes)
+ libcrypt-sysdep_routines += md5-crop sha256-crop sha512-crop
+ endif
++endif
+
+ ifeq ($(subdir),locale)
+ localedef-aux += md5-crop
+diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile
+index eaf758e7aa..0198f9886f 100644
+--- a/sysdeps/sparc/sparc64/multiarch/Makefile
++++ b/sysdeps/sparc/sparc64/multiarch/Makefile
+@@ -1,6 +1,8 @@
+ ifeq ($(subdir),crypt)
++ifeq ($(build-obsolete-crypt),yes)
+ libcrypt-sysdep_routines += md5-crop sha256-crop sha512-crop
+ endif
++endif
+
+ ifeq ($(subdir),locale)
+ localedef-aux += md5-crop
+diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile
+index 4adc35de04..6cab4f3a31 100644
+--- a/sysdeps/unix/sysv/linux/arm/Makefile
++++ b/sysdeps/unix/sysv/linux/arm/Makefile
+@@ -19,8 +19,10 @@ endif
+ # Add a syscall function to each library that needs one.
+
+ ifeq ($(subdir),crypt)
++ifeq ($(build-obsolete-crypt),yes)
+ libcrypt-sysdep_routines += libc-do-syscall
+ endif
++endif
+
+ ifeq ($(subdir),rt)
+ librt-sysdep_routines += libc-do-syscall
+--
+2.16.0
+
diff --git a/poky/meta/recipes-core/glibc/glibc/archive-path.patch b/poky/meta/recipes-core/glibc/glibc/archive-path.patch
new file mode 100644
index 000000000..b0d3158cf
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/archive-path.patch
@@ -0,0 +1,39 @@
+localedef --add-to-archive uses a hard-coded locale path which doesn't exist in
+normal use, and there's no way to pass an alternative filename.
+
+Add a fallback of $LOCALEARCHIVE from the environment, and allow creation of new locale archives that are not the system archive.
+
+Upstream-Status: Inappropriate (OE-specific)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
+index ca332a34..6b7ba9b2 100644
+--- a/locale/programs/locarchive.c
++++ b/locale/programs/locarchive.c
+@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly)
+ /* If ah has a non-NULL fname open that otherwise open the default. */
+ if (archivefname == NULL)
+ {
+- archivefname = default_fname;
+- if (output_prefix)
+- memcpy (default_fname, output_prefix, prefix_len);
+- strcpy (default_fname + prefix_len, ARCHIVE_NAME);
++ archivefname = getenv("LOCALEARCHIVE");
++ if (archivefname == NULL) {
++ archivefname = default_fname;
++ if (output_prefix)
++ memcpy (default_fname, output_prefix, prefix_len);
++ strcpy (default_fname + prefix_len, ARCHIVE_NAME);
++ }
+ }
+
+ while (1)
+@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+ the default locale archive we ignore the failure and
+ list an empty archive, otherwise we print an error
+ and exit. */
+- if (errno == ENOENT && archivefname == default_fname)
++ if (errno == ENOENT)
+ {
+ if (readonly)
+ {
diff --git a/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf b/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
diff --git a/poky/meta/recipes-core/glibc/glibc/generate-supported.mk b/poky/meta/recipes-core/glibc/glibc/generate-supported.mk
new file mode 100644
index 000000000..d2a28c2dc
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/poky/meta/recipes-core/glibc/glibc/relocate-locales.patch b/poky/meta/recipes-core/glibc/glibc/relocate-locales.patch
new file mode 100644
index 000000000..2aea37f5c
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc/relocate-locales.patch
@@ -0,0 +1,55 @@
+The glibc locale path is hard-coded to the install prefix, but in SDKs we need
+to be able to relocate the binaries. Expand the strings to 4K and put them in a
+magic segment that we can relocate at install time.
+
+Upstream-Status: Inappropriate (OE-specific)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/locale/findlocale.c b/locale/findlocale.c
+index 872cadb5..da14fa39 100644
+--- a/locale/findlocale.c
++++ b/locale/findlocale.c
+@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden =
+ which are somehow addressed. */
+ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
+
+-const char _nl_default_locale_path[] attribute_hidden = COMPLOCALEDIR;
++char _nl_default_locale_path[4096] attribute_hidden __attribute__ ((section (".gccrelocprefix"))) = COMPLOCALEDIR;
+
+ /* Checks if the name is actually present, that is, not NULL and not
+ empty. */
+@@ -167,7 +167,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
+
+ /* Nothing in the archive. Set the default path to search below. */
+ locale_path = _nl_default_locale_path;
+- locale_path_len = sizeof _nl_default_locale_path;
++ locale_path_len = strlen(locale_path) + 1;
+ }
+ else
+ /* We really have to load some data. First see whether the name is
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index 68822a63..537bc351 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -325,7 +325,7 @@ _nl_lookup_word (locale_t l, int category, int item)
+ }
+
+ /* Default search path if no LOCPATH environment variable. */
+-extern const char _nl_default_locale_path[] attribute_hidden;
++extern char _nl_default_locale_path[4096] attribute_hidden;
+
+ /* Load the locale data for CATEGORY from the file specified by *NAME.
+ If *NAME is "", use environment variables as specified by POSIX, and
+diff --git a/locale/loadarchive.c b/locale/loadarchive.c
+index 516d30d8..792b37fb 100644
+--- a/locale/loadarchive.c
++++ b/locale/loadarchive.c
+@@ -42,7 +43,7 @@
+
+
+ /* Name of the locale archive file. */
+-static const char archfname[] = COMPLOCALEDIR "/locale-archive";
++static const char archfname[4096] __attribute__ ((section (".gccrelocprefix"))) = COMPLOCALEDIR "/locale-archive";
+
+ /* Size of initial mapping window, optimal if large enough to
+ cover the header plus the initial locale. */
diff --git a/poky/meta/recipes-core/glibc/glibc_2.27.bb b/poky/meta/recipes-core/glibc/glibc_2.27.bb
new file mode 100644
index 000000000..c814798bb
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/glibc_2.27.bb
@@ -0,0 +1,146 @@
+require glibc.inc
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS += "gperf-native bison-native"
+
+SRCREV ?= "df3ff4e49d4ee3cbbdaeb0b1cb5dc2344c08be98"
+
+SRCBRANCH ?= "release/${PV}/master"
+
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ file://etc/ld.so.conf \
+ file://generate-supported.mk \
+ \
+ ${NATIVESDKFIXES} \
+ file://0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
+ file://0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
+ file://0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
+ file://0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+ file://0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
+ file://0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
+ file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+ file://0012-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
+ file://0013-Add-unused-attribute.patch \
+ file://0014-yes-within-the-path-sets-wrong-config-variables.patch \
+ file://0015-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0016-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0017-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0018-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0019-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0021-eglibc-Install-PIC-archives.patch \
+ file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
+ file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+ file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
+ file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \
+ file://0026-reset-dl_load_write_lock-after-forking.patch \
+ file://0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch \
+ file://0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch \
+ file://0029-Replace-strncpy-with-memccpy-to-fix-Wstringop-trunca.patch \
+ file://0030-plural_c_no_preprocessor_lines.patch \
+"
+
+NATIVESDKFIXES ?= ""
+NATIVESDKFIXES_class-nativesdk = "\
+ file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
+ file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
+ file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
+ file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
+ file://relocate-locales.patch \
+ file://0031-nativesdk-deprecate-libcrypt.patch \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = ""
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+GLIBC_BROKEN_LOCALES = ""
+#
+# We will skip parsing glibc when target system C library selection is not glibc
+# this helps in easing out parsing for non-glibc system libraries
+#
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+
+GLIBCPIE ??= ""
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+ --without-cvs --disable-profile \
+ --disable-debug --without-gd \
+ --enable-clocale=gnu \
+ --enable-add-ons=libidn \
+ --with-headers=${STAGING_INCDIR} \
+ --without-selinux \
+ --enable-obsolete-rpc \
+ --enable-obsolete-nsl \
+ --enable-tunables \
+ --enable-bind-now \
+ --enable-stack-protector=strong \
+ --enable-stackguard-randomization \
+ ${GLIBCPIE} \
+ ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
+
+
+do_patch_append() {
+ bb.build.exec_func('do_fix_readlib_c', d)
+}
+
+do_fix_readlib_c () {
+ sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+ yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+ rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+ # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+ unset LDFLAGS
+ base_do_compile
+ (
+ cd ${S}/sunrpc/rpcsvc
+ for r in ${rpcsvc}; do
+ h=`echo $r|sed -e's,\.x$,.h,'`
+ rm -f $h
+ ${B}/sunrpc/cross-rpcgen -h $r -o $h || bbwarn "${PN}: unable to generate header for $r"
+ done
+ )
+ echo "Adjust ldd script"
+ if [ -n "${RTLDLIST}" ]
+ then
+ prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
+ if [ "${prevrtld}" != "${RTLDLIST}" ]
+ then
+ sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+ fi
+ fi
+
+}
+
+require glibc-package.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 000000000..cdfeaeadd
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -0,0 +1,331 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We run the ldconfig in the cross fashion. make the code bitsize aware so that
+we can cross build ldconfig cache for various architectures.
+
+Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
+Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -40,39 +40,212 @@ do \
+
+ /* Returns 0 if everything is ok, != 0 in case of error. */
+ int
+-process_elf_file (const char *file_name, const char *lib, int *flag,
++process_elf_file32 (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname, void *file_contents,
+ size_t file_length)
+ {
+ int i;
+ unsigned int j;
+- ElfW(Addr) loadaddr;
++ Elf32_Addr loadaddr;
+ unsigned int dynamic_addr;
+ size_t dynamic_size;
+ char *program_interpreter;
+
+- ElfW(Ehdr) *elf_header;
+- ElfW(Phdr) *elf_pheader, *segment;
+- ElfW(Dyn) *dynamic_segment, *dyn_entry;
++ Elf32_Ehdr *elf_header;
++ Elf32_Phdr *elf_pheader, *segment;
++ Elf32_Dyn *dynamic_segment, *dyn_entry;
+ char *dynamic_strings;
+
+- elf_header = (ElfW(Ehdr) *) file_contents;
++ elf_header = (Elf32_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
++ if (elf_header->e_type != ET_DYN)
+ {
+- if (opt_verbose)
++ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
++ elf_header->e_type);
++ return 1;
++ }
++
++ /* Get information from elf program header. */
++ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++ check_ptr (elf_pheader);
++
++ /* The library is an elf library, now search for soname and
++ libc5/libc6. */
++ *flag = FLAG_ELF;
++
++ loadaddr = -1;
++ dynamic_addr = 0;
++ dynamic_size = 0;
++ program_interpreter = NULL;
++ for (i = 0, segment = elf_pheader;
++ i < elf_header->e_phnum; i++, segment++)
++ {
++ check_ptr (segment);
++
++ switch (segment->p_type)
+ {
+- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
+- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
+- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
+- else
+- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++ case PT_LOAD:
++ if (loadaddr == (Elf32_Addr) -1)
++ loadaddr = segment->p_vaddr - segment->p_offset;
++ break;
++
++ case PT_DYNAMIC:
++ if (dynamic_addr)
++ error (0, 0, _("more than one dynamic segment\n"));
++
++ dynamic_addr = segment->p_offset;
++ dynamic_size = segment->p_filesz;
++ break;
++
++ case PT_INTERP:
++ program_interpreter = (char *) (file_contents + segment->p_offset);
++ check_ptr (program_interpreter);
++
++ /* Check if this is enough to classify the binary. */
++ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
++ ++j)
++ if (strcmp (program_interpreter, interpreters[j].soname) == 0)
++ {
++ *flag = interpreters[j].flag;
++ break;
++ }
++ break;
++
++ case PT_NOTE:
++ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ {
++ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
++ + segment->p_offset);
++ Elf32_Addr size = segment->p_filesz;
++
++ while (abi_note [0] != 4 || abi_note [1] != 16
++ || abi_note [2] != 1
++ || memcmp (abi_note + 3, "GNU", 4) != 0)
++ {
++#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
++ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
++ + ROUND (abi_note[0])
++ + ROUND (abi_note[1]);
++
++ if (size - 32 < note_size || note_size == 0)
++ {
++ size = 0;
++ break;
++ }
++ size -= note_size;
++ abi_note = (void *) abi_note + note_size;
++ }
++
++ if (size == 0)
++ break;
++
++ *osversion = (abi_note [4] << 24) |
++ ((abi_note [5] & 0xff) << 16) |
++ ((abi_note [6] & 0xff) << 8) |
++ (abi_note [7] & 0xff);
++ }
++ break;
++
++ default:
++ break;
++ }
++
++ }
++ if (loadaddr == (Elf32_Addr) -1)
++ {
++ /* Very strange. */
++ loadaddr = 0;
++ }
++
++ /* Now we can read the dynamic sections. */
++ if (dynamic_size == 0)
++ return 1;
++
++ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
++ check_ptr (dynamic_segment);
++
++ /* Find the string table. */
++ dynamic_strings = NULL;
++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ ++dyn_entry)
++ {
++ check_ptr (dyn_entry);
++ if (dyn_entry->d_tag == DT_STRTAB)
++ {
++ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ check_ptr (dynamic_strings);
++ break;
+ }
+- return 1;
+ }
+
++ if (dynamic_strings == NULL)
++ return 1;
++
++ /* Now read the DT_NEEDED and DT_SONAME entries. */
++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ ++dyn_entry)
++ {
++ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ {
++ char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ check_ptr (name);
++
++ if (dyn_entry->d_tag == DT_NEEDED)
++ {
++
++ if (*flag == FLAG_ELF)
++ {
++ /* Check if this is enough to classify the binary. */
++ for (j = 0;
++ j < sizeof (known_libs) / sizeof (known_libs [0]);
++ ++j)
++ if (strcmp (name, known_libs [j].soname) == 0)
++ {
++ *flag = known_libs [j].flag;
++ break;
++ }
++ }
++ }
++
++ else if (dyn_entry->d_tag == DT_SONAME)
++ *soname = xstrdup (name);
++
++ /* Do we have everything we need? */
++ if (*soname && *flag != FLAG_ELF)
++ return 0;
++ }
++ }
++
++ /* We reach this point only if the file doesn't contain a DT_SONAME
++ or if we can't classify the library. If it doesn't have a
++ soname, return the name of the library. */
++ if (*soname == NULL)
++ *soname = xstrdup (lib);
++
++ return 0;
++}
++
++int
++process_elf_file64 (const char *file_name, const char *lib, int *flag,
++ unsigned int *osversion, char **soname, void *file_contents,
++ size_t file_length)
++{
++ int i;
++ unsigned int j;
++ Elf64_Addr loadaddr;
++ unsigned int dynamic_addr;
++ size_t dynamic_size;
++ char *program_interpreter;
++
++ Elf64_Ehdr *elf_header;
++ Elf64_Phdr *elf_pheader, *segment;
++ Elf64_Dyn *dynamic_segment, *dyn_entry;
++ char *dynamic_strings;
++
++ elf_header = (Elf64_Ehdr *) file_contents;
++ *osversion = 0;
++
+ if (elf_header->e_type != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
+ switch (segment->p_type)
+ {
+ case PT_LOAD:
+- if (loadaddr == (ElfW(Addr)) -1)
++ if (loadaddr == (Elf64_Addr) -1)
+ loadaddr = segment->p_vaddr - segment->p_offset;
+ break;
+
+@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
+ case PT_NOTE:
+ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
+ {
+- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
++ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ + segment->p_offset);
+- ElfW(Addr) size = segment->p_filesz;
++ Elf64_Addr size = segment->p_filesz;
+
+ while (abi_note [0] != 4 || abi_note [1] != 16
+ || abi_note [2] != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
+-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
+- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
++#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
++ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+ + ROUND (abi_note[0])
+ + ROUND (abi_note[1]);
+
+@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
+ }
+
+ }
+- if (loadaddr == (ElfW(Addr)) -1)
++ if (loadaddr == (Elf64_Addr) -1)
+ {
+ /* Very strange. */
+ loadaddr = 0;
+@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
+ if (dynamic_size == 0)
+ return 1;
+
+- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
++ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
+ check_ptr (dynamic_segment);
+
+ /* Find the string table. */
+@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
+
+ return 0;
+ }
++/* Returns 0 if everything is ok, != 0 in case of error. */
++int
++process_elf_file (const char *file_name, const char *lib, int *flag,
++ unsigned int *osversion, char **soname, void *file_contents,
++ size_t file_length)
++{
++ int i;
++ unsigned int j;
++ ElfW(Addr) loadaddr;
++ unsigned int dynamic_addr;
++ size_t dynamic_size;
++ char *program_interpreter;
++
++ ElfW(Ehdr) *elf_header;
++ ElfW(Phdr) *elf_pheader, *segment;
++ ElfW(Dyn) *dynamic_segment, *dyn_entry;
++ char *dynamic_strings;
++
++ elf_header = (ElfW(Ehdr) *) file_contents;
++ *osversion = 0;
++
++ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
++ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
++ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
++ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
++ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++ return 1;
++}
++
++
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
new file mode 100644
index 000000000..43fb98372
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
+The files are pulled verbatim from glibc 2.5 and then patched to allow
+standalone compilation of ldconfig.
+
+Richard Purdie
+OpenedHand Ltd.
+
+Upgraded the ldconfig recipe to eglibc 2.12.1
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
new file mode 100644
index 000000000..f4e38d425
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
@@ -0,0 +1,116 @@
+From 9d62544090b08849218cd1fc52a36cdd5d90363e Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 24 Apr 2015 03:29:31 +0000
+Subject: [PATCH] Add 64-bit flag for ELF64 entries.
+
+ldconfig-native was grepped from an old version of glibc, and its output
+lacks neccessary 64bit flag in entries.
+Due to this defect, ctypes.util.find_library() python function fails to
+detect any library due to the old file format that ldconfig-native
+creates. This fix sets architecture-dependent 64bit flags for 64-bit ELF.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ cache.c | 4 ++++
+ ldconfig.h | 4 ++++
+ readelflib.c | 34 ++++++++++++++++++++++++++++++++++
+ 3 files changed, 42 insertions(+)
+
+diff --git a/cache.c b/cache.c
+index a904d44..c4f5411 100644
+--- a/cache.c
++++ b/cache.c
+@@ -121,6 +121,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
+ break;
+ case FLAG_MIPS64_LIBN64:
+ fputs (",64bit", stdout);
++ break;
++ case FLAG_AARCH64_LIB64:
++ fputs (",AArch64", stdout);
++ break;
+ case 0:
+ break;
+ default:
+diff --git a/ldconfig.h b/ldconfig.h
+index fadd5ec..6a8a750 100644
+--- a/ldconfig.h
++++ b/ldconfig.h
+@@ -34,6 +34,10 @@
+ #define FLAG_POWERPC_LIB64 0x0500
+ #define FLAG_MIPS64_LIBN32 0x0600
+ #define FLAG_MIPS64_LIBN64 0x0700
++#define FLAG_X8664_LIBX32 0x0800
++#define FLAG_ARM_LIBHF 0x0900
++#define FLAG_AARCH64_LIB64 0x0a00
++#define FLAG_ARM_LIBSF 0x0b00
+
+ /* Name of auxiliary cache. */
+ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
+diff --git a/readelflib.c b/readelflib.c
+index 0bf0de3..6e87afc 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -28,6 +28,11 @@
+
+ #include "endian_extra.h"
+
++/* Work-around for old host that does not have AArch64 defined in elf.h. */
++#ifndef EM_AARCH64
++#define EM_AARCH64 183 /* ARM AARCH64 */
++#endif
++
+ #undef check_ptr
+ #define check_ptr(ptr) \
+ do \
+@@ -290,6 +295,48 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ libc5/libc6. */
+ *flag = FLAG_ELF;
+
++ /* Set flags according to information in ELF header to align with target
++ ldconfig */
++ switch (elf_header->e_machine)
++ {
++ case EM_IA_64:
++ /* Intel 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/ia64/readelflib.c */
++ *flag |= FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_X86_64:
++ /* X86-64 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/i386/readelflib.c */
++ *flag |= FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_S390:
++ /* S/390 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/s390/readelflib.c */
++ *flag |= FLAG_S390_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_PPC64:
++ /* PowerPC 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/powerpc/readelflib.c */
++ *flag |= FLAG_POWERPC_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_MIPS:
++ case EM_MIPS_RS3_LE:
++ /* n64 libraries are always libc.so.6+. */
++ /* NOTE: This does not correctly distinguish NAN2008 binaries and is possibly broken */
++ /* see sysdeps/unix/sysv/linux/mips/readelflib.c */
++ *flag |= FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6;
++ break;
++ case EM_AARCH64:
++ /* AArch64 libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/arm/readelflib.c */
++ *flag |= FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
++ break;
++ default:
++ error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n",
++ file_name, (long)elf_header->e_machine);
++ break;
++ }
++
+ loadaddr = -1;
+ dynamic_addr = 0;
+ dynamic_size = 0;
+--
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 000000000..7f8e4db78
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,454 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Do data input/output handling according to endien-ness of the library file. That
+enables use of ldconfig in the cross fashion for any architecture.
+
+2011/04/04
+Richard Purdie <richard.purdie@linuxfoundation.org>
+Nitin Kamble <nitin.a.kamble@intel.com>
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -38,6 +38,28 @@ do \
+ } \
+ while (0);
+
++int be;
++static uint16_t read16(uint16_t x, int be)
++{
++ if (be)
++ return be16toh(x);
++ return le16toh(x);
++}
++
++static uint32_t read32(uint32_t x, int be)
++{
++ if (be)
++ return be32toh(x);
++ return le32toh(x);
++}
++
++static uint64_t read64(uint64_t x, int be)
++{
++ if (be)
++ return be64toh(x);
++ return le64toh(x);
++}
++
+ /* Returns 0 if everything is ok, != 0 in case of error. */
+ int
+ process_elf_file32 (const char *file_name, const char *lib, int *flag,
+@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
+ elf_header = (Elf32_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_type != ET_DYN)
++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++ if (read16(elf_header->e_type, be) != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+- elf_header->e_type);
++ read16(elf_header->e_type, be));
+ return 1;
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
+ dynamic_size = 0;
+ program_interpreter = NULL;
+ for (i = 0, segment = elf_pheader;
+- i < elf_header->e_phnum; i++, segment++)
++ i < read16(elf_header->e_phnum, be); i++, segment++)
+ {
+ check_ptr (segment);
+
+- switch (segment->p_type)
++ switch (read32(segment->p_type, be))
+ {
+ case PT_LOAD:
+ if (loadaddr == (Elf32_Addr) -1)
+- loadaddr = segment->p_vaddr - segment->p_offset;
++ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
+ break;
+
+ case PT_DYNAMIC:
+ if (dynamic_addr)
+ error (0, 0, _("more than one dynamic segment\n"));
+
+- dynamic_addr = segment->p_offset;
+- dynamic_size = segment->p_filesz;
++ dynamic_addr = read32(segment->p_offset, be);
++ dynamic_size = read32(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+- program_interpreter = (char *) (file_contents + segment->p_offset);
++ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
+ check_ptr (program_interpreter);
+
+ /* Check if this is enough to classify the binary. */
+@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
+ {
+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
+- + segment->p_offset);
+- Elf32_Addr size = segment->p_filesz;
++ + read32(segment->p_offset, be));
++ Elf32_Addr size = read32(segment->p_filesz, be);
+
+- while (abi_note [0] != 4 || abi_note [1] != 16
+- || abi_note [2] != 1
++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++ || read32(abi_note [2], be) != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
+-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
+- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
+- + ROUND (abi_note[0])
+- + ROUND (abi_note[1]);
++#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
++ Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
++ + ROUND (read32(abi_note[0], be))
++ + ROUND (read32(abi_note[1], be));
+
+ if (size - 32 < note_size || note_size == 0)
+ {
+@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
+ if (size == 0)
+ break;
+
+- *osversion = (abi_note [4] << 24) |
+- ((abi_note [5] & 0xff) << 16) |
+- ((abi_note [6] & 0xff) << 8) |
+- (abi_note [7] & 0xff);
++ *osversion = (read32(abi_note [4], be) << 24) |
++ ((read32(abi_note [5], be) & 0xff) << 16) |
++ ((read32(abi_note [6], be) & 0xff) << 8) |
++ (read32(abi_note [7], be) & 0xff);
+ }
+ break;
+
+@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
+
+ /* Find the string table. */
+ dynamic_strings = NULL;
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+ check_ptr (dyn_entry);
+- if (dyn_entry->d_tag == DT_STRTAB)
++ if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
+ {
+- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
+ check_ptr (dynamic_strings);
+ break;
+ }
+@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
+ return 1;
+
+ /* Now read the DT_NEEDED and DT_SONAME entries. */
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
+ {
+- char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
+ check_ptr (name);
+
+- if (dyn_entry->d_tag == DT_NEEDED)
++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
+ {
+
+ if (*flag == FLAG_ELF)
+@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
+ }
+ }
+
+- else if (dyn_entry->d_tag == DT_SONAME)
++ else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
+ *soname = xstrdup (name);
+
+ /* Do we have everything we need? */
+@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
+ elf_header = (Elf64_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_type != ET_DYN)
++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++ if (read16(elf_header->e_type, be) != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+- elf_header->e_type);
++ read16(elf_header->e_type, be));
+ return 1;
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
+ dynamic_size = 0;
+ program_interpreter = NULL;
+ for (i = 0, segment = elf_pheader;
+- i < elf_header->e_phnum; i++, segment++)
++ i < read16(elf_header->e_phnum, be); i++, segment++)
+ {
+ check_ptr (segment);
+
+- switch (segment->p_type)
++ switch (read32(segment->p_type, be))
+ {
+ case PT_LOAD:
+ if (loadaddr == (Elf64_Addr) -1)
+- loadaddr = segment->p_vaddr - segment->p_offset;
++ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
+ break;
+
+ case PT_DYNAMIC:
+ if (dynamic_addr)
+ error (0, 0, _("more than one dynamic segment\n"));
+
+- dynamic_addr = segment->p_offset;
+- dynamic_size = segment->p_filesz;
++ dynamic_addr = read64(segment->p_offset, be);
++ dynamic_size = read32(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+- program_interpreter = (char *) (file_contents + segment->p_offset);
++ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
+ check_ptr (program_interpreter);
+
+ /* Check if this is enough to classify the binary. */
+@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
+ {
+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+- + segment->p_offset);
+- Elf64_Addr size = segment->p_filesz;
++ + read64(segment->p_offset, be));
++ Elf64_Addr size = read32(segment->p_filesz, be);
+
+- while (abi_note [0] != 4 || abi_note [1] != 16
+- || abi_note [2] != 1
++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++ || read32(abi_note [2], be) != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
++#undef ROUND
+ #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
+ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+- + ROUND (abi_note[0])
+- + ROUND (abi_note[1]);
++ + ROUND (read32(abi_note[0], be))
++ + ROUND (read32(abi_note[1], be));
+
+ if (size - 32 < note_size || note_size == 0)
+ {
+@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
+ if (size == 0)
+ break;
+
+- *osversion = (abi_note [4] << 24) |
+- ((abi_note [5] & 0xff) << 16) |
+- ((abi_note [6] & 0xff) << 8) |
+- (abi_note [7] & 0xff);
++ *osversion = (read32(abi_note [4], be) << 24) |
++ ((read32(abi_note [5], be) & 0xff) << 16) |
++ ((read32(abi_note [6], be) & 0xff) << 8) |
++ (read32(abi_note [7], be) & 0xff);
+ }
+ break;
+
+@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
+
+ /* Find the string table. */
+ dynamic_strings = NULL;
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+ check_ptr (dyn_entry);
+- if (dyn_entry->d_tag == DT_STRTAB)
++ if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
+ {
+- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
+ check_ptr (dynamic_strings);
+ break;
+ }
+@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
+ return 1;
+
+ /* Now read the DT_NEEDED and DT_SONAME entries. */
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
+ {
+- char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
+ check_ptr (name);
+
+- if (dyn_entry->d_tag == DT_NEEDED)
++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
+ {
+
+ if (*flag == FLAG_ELF)
+@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
+ }
+ }
+
+- else if (dyn_entry->d_tag == DT_SONAME)
++ else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
+ *soname = xstrdup (name);
+
+ /* Do we have everything we need? */
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -169,7 +169,8 @@ process_file (const char *real_file_name
+ ret = 1;
+ }
+ /* Libraries have to be shared object files. */
+- else if (elf_header->e_type != ET_DYN)
++ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
++ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
+ ret = 1;
+ else if (process_elf_file (file_name, lib, flag, osversion, soname,
+ file_contents, statbuf.st_size))
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -39,6 +39,29 @@
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
++extern int be;
++
++static uint16_t write16(uint16_t x, int be)
++{
++ if (be)
++ return htobe16(x);
++ return htole16(x);
++}
++
++static uint32_t write32(uint32_t x, int be)
++{
++ if (be)
++ return htobe32(x);
++ return htole32(x);
++}
++
++static uint64_t write64(uint64_t x, int be)
++{
++ if (be)
++ return htobe64(x);
++ return htole64(x);
++}
++
+ struct cache_entry
+ {
+ char *lib; /* Library name. */
+@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
+ /* Number of normal cache entries. */
+ int cache_entry_old_count = 0;
+
+- for (entry = entries; entry != NULL; entry = entry->next)
++ if (be)
++ printf("saving cache in big endian encoding\n");
++ else
++ printf("saving cache in little endian encoding\n");
++
++ for (entry = entries; entry != NULL; entry = entry->next)
+ {
+ /* Account the final NULs. */
+ total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
+@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
+ memset (file_entries, '\0', sizeof (struct cache_file));
+ memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
+
+- file_entries->nlibs = cache_entry_old_count;
++ file_entries->nlibs = write32(cache_entry_old_count, be);
+ }
+
+ struct cache_file_new *file_entries_new = NULL;
+@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
+ memcpy (file_entries_new->version, CACHE_VERSION,
+ sizeof CACHE_VERSION - 1);
+
+- file_entries_new->nlibs = cache_entry_count;
+- file_entries_new->len_strings = total_strlen;
++ file_entries_new->nlibs = write32(cache_entry_count, be);
++ file_entries_new->len_strings = write32(total_strlen, be);
+ }
+
+ /* Pad for alignment of cache_file_new. */
+@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
+ /* First the library. */
+ if (opt_format != 2 && entry->hwcap == 0)
+ {
+- file_entries->libs[idx_old].flags = entry->flags;
++ file_entries->libs[idx_old].flags = write32(entry->flags, be);
+ /* XXX: Actually we can optimize here and remove duplicates. */
+- file_entries->libs[idx_old].key = str_offset + pad;
++ file_entries->libs[idx_old].key = write32(str_offset + pad, be);
+ }
+ if (opt_format != 0)
+ {
+@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
+ not doing so makes the code easier, the string table
+ always begins at the beginning of the the new cache
+ struct. */
+- file_entries_new->libs[idx_new].flags = entry->flags;
+- file_entries_new->libs[idx_new].osversion = entry->osversion;
+- file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+- file_entries_new->libs[idx_new].key = str_offset;
++ file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
++ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
++ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
++ file_entries_new->libs[idx_new].key = write32(str_offset, be);
+ }
+
+ size_t len = strlen (entry->lib) + 1;
+@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
+ str_offset += len;
+ /* Then the path. */
+ if (opt_format != 2 && entry->hwcap == 0)
+- file_entries->libs[idx_old].value = str_offset + pad;
++ file_entries->libs[idx_old].value = write32(str_offset + pad, be);
+ if (opt_format != 0)
+- file_entries_new->libs[idx_new].value = str_offset;
++ file_entries_new->libs[idx_new].value = write32(str_offset, be);
+ len = strlen (entry->path) + 1;
+ str = mempcpy (str, entry->path, len);
+ str_offset += len;
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
new file mode 100644
index 000000000..6aecfe526
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fix problem during parsing of ELF headers for 64bit on big-endian.
+Some header fields were read with wrong size.
+
+2014/10/24
+Par Olsson <Par.Olsson@windriver.com>
+Shan Hai <shan.hai@windriver.com>
+
+diff --git a/readelflib.c b/readelflib.c
+index 3f5b25b..0bf0de3 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -261,8 +261,8 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ int i;
+ unsigned int j;
+ Elf64_Addr loadaddr;
+- unsigned int dynamic_addr;
+- size_t dynamic_size;
++ Elf64_Addr dynamic_addr;
++ Elf64_Xword dynamic_size;
+ char *program_interpreter;
+
+ Elf64_Ehdr *elf_header;
+@@ -311,7 +311,7 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ error (0, 0, _("more than one dynamic segment\n"));
+
+ dynamic_addr = read64(segment->p_offset, be);
+- dynamic_size = read32(segment->p_filesz, be);
++ dynamic_size = read64(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+@@ -329,11 +329,11 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
++ if (!*osversion && read64(segment->p_filesz, be) >= 32 && read64(segment->p_align, be) >= 4)
+ {
+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ + read64(segment->p_offset, be));
+- Elf64_Addr size = read32(segment->p_filesz, be);
++ Elf64_Xword size = read64(segment->p_filesz, be);
+
+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
+ || read32(abi_note [2], be) != 1
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 000000000..a18b2c20d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
@@ -0,0 +1,113 @@
+Upstream-Status: Inappropriate [fix poky patch]
+
+This patch fixes build issues with a previous endian-ness_handling.patch on
+distros that don't have macros referenced
+
+7/20/2011
+Matthew McClintock <msm@freescale.com>
+
+diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
+--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
++++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500
+@@ -0,0 +1,64 @@
++/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <endian.h>
++
++#ifndef _ENDIAN_EXTRA_H
++#define _ENDIAN_EXTRA_H 1
++
++/* Don't redefine these macros if they already exist */
++#ifndef htobe16
++#ifdef __USE_BSD
++/* Conversion interfaces. */
++# include <byteswap.h>
++
++# if __BYTE_ORDER == __LITTLE_ENDIAN
++# define htobe16(x) __bswap_16 (x)
++# define htole16(x) (x)
++# define be16toh(x) __bswap_16 (x)
++# define le16toh(x) (x)
++
++# define htobe32(x) __bswap_32 (x)
++# define htole32(x) (x)
++# define be32toh(x) __bswap_32 (x)
++# define le32toh(x) (x)
++
++# define htobe64(x) __bswap_64 (x)
++# define htole64(x) (x)
++# define be64toh(x) __bswap_64 (x)
++# define le64toh(x) (x)
++# else
++# define htobe16(x) (x)
++# define htole16(x) __bswap_16 (x)
++# define be16toh(x) (x)
++# define le16toh(x) __bswap_16 (x)
++
++# define htobe32(x) (x)
++# define htole32(x) __bswap_32 (x)
++# define be32toh(x) (x)
++# define le32toh(x) __bswap_32 (x)
++
++# define htobe64(x) (x)
++# define htole64(x) __bswap_64 (x)
++# define be64toh(x) (x)
++# define le64toh(x) __bswap_64 (x)
++# endif
++#endif
++#endif
++
++#endif /* endian_extra.h */
+diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
+--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500
++++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500
+@@ -39,6 +39,8 @@
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
++#include "endian_extra.h"
++
+ extern int be;
+
+ static uint16_t write16(uint16_t x, int be)
+diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
+--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500
+@@ -25,6 +25,9 @@
+
+ /* check_ptr checks that a pointer is in the mmaped file and doesn't
+ point outside it. */
++
++#include "endian_extra.h"
++
+ #undef check_ptr
+ #define check_ptr(ptr) \
+ do \
+diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
+--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500
+@@ -40,6 +40,8 @@
+
+ #include "ldconfig.h"
+
++#include "endian_extra.h"
++
+ #define _(msg) msg
+
+ #define Elf32_CLASS ELFCLASS32
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 000000000..4e9aab941
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The native version of ldconfig was using native definition of LD_SO (i.e.
+ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
+This was causing libc.so on the target marked as ELF lib rather than
+FLAG_ELF_LIBC6 in the ld.so.cache.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
+
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -51,6 +51,10 @@ struct known_names
+ int flag;
+ };
+
++/* don't use host's definition of LD_SO */
++#undef LD_SO
++#define LD_SO "ld.so.1"
++
+ static struct known_names interpreters[] =
+ {
+ { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
new file mode 100644
index 000000000..5ed4f6ff6
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+make ldconfig default to both /lib+/usr/lib, /lib32+/usr/lib32 and
+/lib64+/usr/lib64 on bi-ABI architectures.
+
+---
+ ldconfig.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff -urpN a/ldconfig.c b/ldconfig.c
+--- a/ldconfig.c
++++ b/ldconfig.c
+@@ -52,7 +52,11 @@
+
+ #define SYSCONFDIR "/etc"
+ #define LIBDIR "/usr/lib"
++#define LIBDIR32 "/usr/lib32"
++#define LIBDIR64 "/usr/lib64"
+ #define SLIBDIR "/lib"
++#define SLIBDIR32 "/lib32"
++#define SLIBDIR64 "/lib64"
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
+@@ -1373,6 +1377,12 @@ main (int argc, char **argv)
+ add_system_dir (SLIBDIR);
+ if (strcmp (SLIBDIR, LIBDIR))
+ add_system_dir (LIBDIR);
++ add_system_dir (SLIBDIR32);
++ if (strcmp (SLIBDIR32, LIBDIR32))
++ add_system_dir (LIBDIR32);
++ add_system_dir (SLIBDIR64);
++ if (strcmp (SLIBDIR64, LIBDIR64))
++ add_system_dir (LIBDIR64);
+ }
+
+ const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 000000000..dc1e79888
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 000000000..52986e61c
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,471 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+enable standalone building of ldconfig
+
+---
+ cache.c | 11 +-
+ chroot_canon.c | 7 +
+ dl-cache.c | 235 ---------------------------------------------------------
+ dl-cache.h | 3
+ ldconfig.c | 27 ++++--
+ readlib.c | 7 +
+ xstrdup.c | 11 --
+ 7 files changed, 45 insertions(+), 256 deletions(-)
+
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -16,6 +16,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <errno.h>
+ #include <error.h>
+ #include <dirent.h>
+@@ -31,8 +34,10 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++# define N_(msgid) msgid
++#define _(msg) msg
+
+ struct cache_entry
+ {
+Index: ldconfig-native-2.12.1/chroot_canon.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/chroot_canon.c
++++ ldconfig-native-2.12.1/chroot_canon.c
+@@ -17,6 +17,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+@@ -27,7 +30,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define __set_errno(Val) errno = (Val)
+
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+Index: ldconfig-native-2.12.1/dl-cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.c
++++ ldconfig-native-2.12.1/dl-cache.c
+@@ -20,12 +20,12 @@
+
+ #include <assert.h>
+ #include <unistd.h>
+-#include <ldsodefs.h>
++//#include "ldsodefs.h"
+ #include <sys/mman.h>
+ #include <dl-cache.h>
+ #include <dl-procinfo.h>
+
+-#include <stdio-common/_itoa.h>
++//#include "_itoa.h"
+
+ #ifndef _DL_PLATFORMS_COUNT
+ # define _DL_PLATFORMS_COUNT 0
+@@ -39,103 +39,7 @@ static size_t cachesize;
+ /* 1 if cache_data + PTR points into the cache. */
+ #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
+
+-#define SEARCH_CACHE(cache) \
+-/* We use binary search since the table is sorted in the cache file. \
+- The first matching entry in the table is returned. \
+- It is important to use the same algorithm as used while generating \
+- the cache file. */ \
+-do \
+- { \
+- left = 0; \
+- right = cache->nlibs - 1; \
+- \
+- while (left <= right) \
+- { \
+- __typeof__ (cache->libs[0].key) key; \
+- \
+- middle = (left + right) / 2; \
+- \
+- key = cache->libs[middle].key; \
+- \
+- /* Make sure string table indices are not bogus before using \
+- them. */ \
+- if (! _dl_cache_verify_ptr (key)) \
+- { \
+- cmpres = 1; \
+- break; \
+- } \
+- \
+- /* Actually compare the entry with the key. */ \
+- cmpres = _dl_cache_libcmp (name, cache_data + key); \
+- if (__builtin_expect (cmpres == 0, 0)) \
+- { \
+- /* Found it. LEFT now marks the last entry for which we \
+- know the name is correct. */ \
+- left = middle; \
+- \
+- /* There might be entries with this name before the one we \
+- found. So we have to find the beginning. */ \
+- while (middle > 0) \
+- { \
+- __typeof__ (cache->libs[0].key) key; \
+- \
+- key = cache->libs[middle - 1].key; \
+- /* Make sure string table indices are not bogus before \
+- using them. */ \
+- if (! _dl_cache_verify_ptr (key) \
+- /* Actually compare the entry. */ \
+- || _dl_cache_libcmp (name, cache_data + key) != 0) \
+- break; \
+- --middle; \
+- } \
+- \
+- do \
+- { \
+- int flags; \
+- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \
+- \
+- /* Only perform the name test if necessary. */ \
+- if (middle > left \
+- /* We haven't seen this string so far. Test whether the \
+- index is ok and whether the name matches. Otherwise \
+- we are done. */ \
+- && (! _dl_cache_verify_ptr (lib->key) \
+- || (_dl_cache_libcmp (name, cache_data + lib->key) \
+- != 0))) \
+- break; \
+- \
+- flags = lib->flags; \
+- if (_dl_cache_check_flags (flags) \
+- && _dl_cache_verify_ptr (lib->value)) \
+- { \
+- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \
+- { \
+- HWCAP_CHECK; \
+- best = cache_data + lib->value; \
+- \
+- if (flags == GLRO(dl_correct_cache_id)) \
+- /* We've found an exact match for the shared \
+- object and no general `ELF' release. Stop \
+- searching. */ \
+- break; \
+- } \
+- } \
+- } \
+- while (++middle <= right); \
+- break; \
+- } \
+- \
+- if (cmpres < 0) \
+- left = middle + 1; \
+- else \
+- right = middle - 1; \
+- } \
+- } \
+-while (0)
+-
+-
+ int
+-internal_function
+ _dl_cache_libcmp (const char *p1, const char *p2)
+ {
+ while (*p1 != '\0')
+@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
+ }
+ return *p1 - *p2;
+ }
+-
+-
+-/* Look up NAME in ld.so.cache and return the file name stored there,
+- or null if none is found. */
+-
+-const char *
+-internal_function
+-_dl_load_cache_lookup (const char *name)
+-{
+- int left, right, middle;
+- int cmpres;
+- const char *cache_data;
+- uint32_t cache_data_size;
+- const char *best;
+-
+- /* Print a message if the loading of libs is traced. */
+- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
+- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
+-
+- if (cache == NULL)
+- {
+- /* Read the contents of the file. */
+- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
+- PROT_READ);
+-
+- /* We can handle three different cache file formats here:
+- - the old libc5/glibc2.0/2.1 format
+- - the old format with the new format in it
+- - only the new format
+- The following checks if the cache contains any of these formats. */
+- if (file != MAP_FAILED && cachesize > sizeof *cache
+- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
+- {
+- size_t offset;
+- /* Looks ok. */
+- cache = file;
+-
+- /* Check for new version. */
+- offset = ALIGN_CACHE (sizeof (struct cache_file)
+- + cache->nlibs * sizeof (struct file_entry));
+-
+- cache_new = (struct cache_file_new *) ((void *) cache + offset);
+- if (cachesize < (offset + sizeof (struct cache_file_new))
+- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
+- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
+- cache_new = (void *) -1;
+- }
+- else if (file != MAP_FAILED && cachesize > sizeof *cache_new
+- && memcmp (file, CACHEMAGIC_VERSION_NEW,
+- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
+- {
+- cache_new = file;
+- cache = file;
+- }
+- else
+- {
+- if (file != MAP_FAILED)
+- __munmap (file, cachesize);
+- cache = (void *) -1;
+- }
+-
+- assert (cache != NULL);
+- }
+-
+- if (cache == (void *) -1)
+- /* Previously looked for the cache file and didn't find it. */
+- return NULL;
+-
+- best = NULL;
+-
+- if (cache_new != (void *) -1)
+- {
+- uint64_t platform;
+-
+- /* This is where the strings start. */
+- cache_data = (const char *) cache_new;
+-
+- /* Now we can compute how large the string table is. */
+- cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+- platform = _dl_string_platform (GLRO(dl_platform));
+- if (platform != (uint64_t) -1)
+- platform = 1ULL << platform;
+-
+-#define _DL_HWCAP_TLS_MASK (1LL << 63)
+- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
+- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
+-
+- /* Only accept hwcap if it's for the right platform. */
+-#define HWCAP_CHECK \
+- if (lib->hwcap & hwcap_exclude) \
+- continue; \
+- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
+- continue; \
+- if (_DL_PLATFORMS_COUNT \
+- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
+- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
+- continue
+- SEARCH_CACHE (cache_new);
+- }
+- else
+- {
+- /* This is where the strings start. */
+- cache_data = (const char *) &cache->libs[cache->nlibs];
+-
+- /* Now we can compute how large the string table is. */
+- cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+-#undef HWCAP_CHECK
+-#define HWCAP_CHECK do {} while (0)
+- SEARCH_CACHE (cache);
+- }
+-
+- /* Print our result if wanted. */
+- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
+- && best != NULL)
+- _dl_debug_printf (" trying file=%s\n", best);
+-
+- return best;
+-}
+-
+-#ifndef MAP_COPY
+-/* If the system does not support MAP_COPY we cannot leave the file open
+- all the time since this would create problems when the file is replaced.
+- Therefore we provide this function to close the file and open it again
+- once needed. */
+-void
+-_dl_unload_cache (void)
+-{
+- if (cache != NULL && cache != (struct cache_file *) -1)
+- {
+- __munmap (cache, cachesize);
+- cache = NULL;
+- }
+-}
+-#endif
+Index: ldconfig-native-2.12.1/dl-cache.h
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.h
++++ ldconfig-native-2.12.1/dl-cache.h
+@@ -101,5 +101,4 @@ struct cache_file_new
+ (((addr) + __alignof__ (struct cache_file_new) -1) \
+ & (~(__alignof__ (struct cache_file_new) - 1)))
+
+-extern int _dl_cache_libcmp (const char *p1, const char *p2)
+- internal_function;
++extern int _dl_cache_libcmp (const char *p1, const char *p2);
+Index: ldconfig-native-2.12.1/ldconfig.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/ldconfig.c
++++ ldconfig-native-2.12.1/ldconfig.c
+@@ -16,6 +16,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #define PROCINFO_CLASS static
+ #include <alloca.h>
+ #include <argp.h>
+@@ -39,10 +42,20 @@
+ #include <glob.h>
+ #include <libgen.h>
+
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++
++#include "dl-procinfo.h"
++
++#include "argp.h"
++
++
++#define SYSCONFDIR "/etc"
++#define LIBDIR "/usr/lib"
++#define SLIBDIR "/lib"
++# define N_(msgid) msgid
++#define _(msg) msg
+
+-#include <dl-procinfo.h>
+
+ #ifdef _DL_FIRST_PLATFORM
+ # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
+@@ -55,7 +68,7 @@
+ #endif
+
+ /* Get libc version number. */
+-#include <version.h>
++#include "version.h"
+
+ #define PACKAGE _libc_intl_domainname
+
+@@ -152,8 +165,8 @@ static const struct argp_option options[
+ { NULL, 0, NULL, 0, NULL, 0 }
+ };
+
+-#define PROCINFO_CLASS static
+-#include <dl-procinfo.c>
++//#define PROCINFO_CLASS static
++//#include <dl-procinfo.c>
+
+ /* Short description of program. */
+ static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
+@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
+ return 0;
+ }
+
++#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
+ /* Print bug-reporting information in the help message. */
+ static char *
+ more_help (int key, const char *text, void *input)
+@@ -315,7 +329,7 @@ For bug reporting instructions, please s
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+ {
+- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
++ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
+ fprintf (stream, gettext ("\
+ Copyright (C) %s Free Software Foundation, Inc.\n\
+ This is free software; see the source for copying conditions. There is NO\n\
+@@ -1233,6 +1247,7 @@ set_hwcap (void)
+ hwcap_mask = strtoul (mask, NULL, 0);
+ }
+
++const char _libc_intl_domainname[] = "libc";
+
+ int
+ main (int argc, char **argv)
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -22,6 +22,9 @@
+ development version. Besides the simplification, it has also been
+ modified to read some other file formats. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <a.out.h>
+ #include <elf.h>
+ #include <error.h>
+@@ -35,7 +38,9 @@
+ #include <sys/stat.h>
+ #include <gnu/lib-names.h>
+
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define _(msg) msg
+
+ #define Elf32_CLASS ELFCLASS32
+ #define Elf64_CLASS ELFCLASS64
+Index: ldconfig-native-2.12.1/xstrdup.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/xstrdup.c
++++ ldconfig-native-2.12.1/xstrdup.c
+@@ -16,15 +16,10 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+-#ifdef HAVE_CONFIG_H
+-# include <config.h>
+-#endif
++#define _GNU_SOURCE
++
++#include <string.h>
+
+-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
+-# include <string.h>
+-#else
+-# include <strings.h>
+-#endif
+ void *xmalloc (size_t n) __THROW;
+ char *xstrdup (char *string) __THROW;
+
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 000000000..27bc41107
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Pending
+
+Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
+
+Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
+
+--- ldconfig-native-2.12.1.orig/ldconfig.c
++++ ldconfig-native-2.12.1/ldconfig.c
+@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
+
+ const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+ if (opt_chroot)
+- {
+- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+- if (aux_cache_file == NULL)
+- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
+- _PATH_LDCONFIG_AUX_CACHE);
+- }
++ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+
+- if (! opt_ignore_aux_cache)
++ if (! opt_ignore_aux_cache && aux_cache_file)
+ load_aux_cache (aux_cache_file);
+ else
+ init_aux_cache ();
+@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
+ if (opt_build_cache)
+ {
+ save_cache (cache_file);
+- save_aux_cache (aux_cache_file);
++ if (aux_cache_file)
++ save_aux_cache (aux_cache_file);
+ }
+
+ return 0;
+
diff --git a/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb b/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 000000000..93c0b1867
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "A standalone native ldconfig build"
+
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
+
+SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
+ file://ldconfig.patch \
+ file://ldconfig_aux-cache_path_fix.patch \
+ file://32and64bit.patch \
+ file://endian-ness_handling.patch \
+ file://flag_fix.patch \
+ file://endianess-header.patch \
+ file://ldconfig-default-to-all-multilib-dirs.patch \
+ file://endian-ness_handling_fix.patch \
+ file://add-64-bit-flag-for-ELF64-entries.patch \
+"
+
+PR = "r2"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:"
+
+inherit native
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+do_compile () {
+ $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
+}
+
+do_install () {
+ install -d ${D}/${bindir}/
+ install ldconfig ${D}/${bindir}/
+}
diff --git a/poky/meta/recipes-core/glibc/site_config/funcs b/poky/meta/recipes-core/glibc/site_config/funcs
new file mode 100644
index 000000000..ccc85392d
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/site_config/funcs
@@ -0,0 +1,474 @@
+a64l
+abs
+access
+__adjtimex
+alarm
+alphasort
+argz_append
+__argz_count
+argz_create_sep
+argz_insert
+__argz_next
+argz_next
+__argz_stringify
+argz_stringify
+asprintf
+atexit
+atof
+atoi
+bcmp
+bcopy
+bindresvport
+bind_textdomain_codeset
+btowc
+bzero
+calloc
+canonicalize_file_name
+catgets
+cfgetospeed
+cfsetispeed
+cfsetspeed
+chmod
+chown
+chroot
+clock
+close
+closedir
+closelog
+confstr
+connect
+daemon
+dcgettext
+difftime
+dirfd
+dirname
+dngettext
+dup2
+ecvt
+endgrent
+endmntent
+endpwent
+endutent
+endutxent
+epoll_ctl
+err
+ether_hostton
+ether_ntohost
+euidaccess
+execv
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fcntl
+fcvt
+fdatasync
+fdopendir
+feof_unlocked
+fgets_unlocked
+fgetxattr
+finite
+flistxattr
+flock
+flockfile
+fnmatch
+fork
+fpathconf
+__fpending
+fprintf
+free
+freeaddrinfo
+freeifaddrs
+fseeko
+__fsetlocking
+fsetxattr
+fstat64
+fstat
+fstatfs
+fsync
+ftello
+ftime
+ftruncate
+funlockfile
+futimes
+futimesat
+gai_strerror
+gcvt
+getaddrinfo
+getc_unlocked
+getcwd
+getdelim
+getdomainname
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrent_r
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostbyaddr_r
+gethostbyname2
+gethostbyname
+gethostbyname_r
+gethostent
+gethostid
+gethostname
+getifaddrs
+getline
+getloadavg
+getmntent
+getmsg
+getnameinfo
+getnetbyaddr_r
+getnetgrent_r
+getopt
+getopt_long
+getopt_long_only
+getpagesize
+getpass
+getpeername
+getpgrp
+getpid
+getppid
+getprotoent_r
+getpwent
+getpwent_r
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresuid
+getrlimit
+getrusage
+getservbyname
+getservbyname_r
+getservbyport_r
+getservent
+getservent_r
+getspnam
+getspnam_r
+gettimeofday
+getttyent
+getttynam
+getuid
+getusershell
+getutent
+getutid
+getutline
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getwd
+getxattr
+glob
+gmtime
+gmtime_r
+grantpt
+group_member
+herror
+hstrerror
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_ntoa
+inet_ntop
+inet_pton
+initgroups
+innetgr
+iruserok
+isascii
+isatty
+isblank
+isgraph
+isinf
+isnan
+isprint
+isspace
+iswalnum
+iswcntrl
+iswctype
+iswprint
+iswspace
+iswupper
+isxdigit
+kill
+killpg
+lchown
+lckpwdf
+lgetxattr
+link
+listxattr
+llistxattr
+localtime
+localtime_r
+lockf
+lrand48
+lsearch
+lseek64
+lsetxattr
+lstat
+mallinfo
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbtowc
+memalign
+memchr
+memcmp
+memcpy
+memmove
+mempcpy
+memrchr
+memset
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mkstemp64
+mkstemp
+mktime
+mlock
+mmap
+mtrace
+munlock
+munmap
+nanosleep
+nice
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+_obstack_free
+on_exit
+open64
+open
+openat
+opendir
+openlog
+pathconf
+pipe
+poll
+popen
+posix_memalign
+prctl
+pread
+printf
+__progname
+pselect
+pthread_mutex_lock
+ptsname
+putenv
+putgrent
+putpwent
+putspent
+pututline
+pututxline
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+read
+readdir
+readdir_r
+readlink
+realloc
+realpath
+re_comp
+recvmsg
+re_exec
+regcomp
+regexec
+remove
+rename
+re_search
+rmdir
+rpmatch
+rresvport_af
+ruserok
+ruserok_af
+sbrk
+scandir
+sched_setscheduler
+sched_yield
+__secure_getenv
+select
+semctl
+semget
+sendmsg
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+sethostname
+setitimer
+_setjmp
+setjmp
+setlinebuf
+setlocale
+setmntent
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setutxent
+setvbuf
+setxattr
+sgetspent
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigblock
+sigemptyset
+sighold
+siginterrupt
+signal
+sigprocmask
+sigset
+sigsetmask
+sigstack
+sigsuspend
+sigvec
+snprintf
+socket
+socketpair
+sprintf
+srand48
+srand
+srandom
+sscanf
+stat
+statfs
+statvfs
+stime
+stpcpy
+strcasecmp
+strcasestr
+strchr
+strchrnul
+strcmp
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlen
+strncasecmp
+strncmp
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok_r
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strverscmp
+strxfrm
+symlink
+sync
+sysconf
+sysctl
+sysinfo
+syslog
+_sys_siglist
+sys_siglist
+system
+tcgetattr
+tcgetpgrp
+tcsetattr
+tcsetpgrp
+time
+timegm
+times
+timezone
+tmpnam
+towlower
+towupper
+truncate
+tsearch
+ttyname
+tzset
+ulimit
+umask
+uname
+unlink
+unsetenv
+unshare
+updwtmp
+updwtmpx
+usleep
+ustat
+utime
+utimes
+utmpname
+utmpxname
+valloc
+vasprintf
+verrx
+vfork
+vfprintf
+vfscanf
+vhangup
+vprintf
+vsnprintf
+vsprintf
+wait3
+wait4
+waitpid
+wcrtomb
+wcscoll
+wcsdup
+wcslen
+wctob
+wctomb
+wctype
+wcwidth
+wmemchr
+wmemcpy
+wmempcpy
diff --git a/poky/meta/recipes-core/glibc/site_config/headers b/poky/meta/recipes-core/glibc/site_config/headers
new file mode 100644
index 000000000..69fedea4e
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/site_config/headers
@@ -0,0 +1,155 @@
+aio.h
+alloca.h
+argz.h
+arpa/inet.h
+arpa/nameser.h
+asm/byteorder.h
+asm/ioctls.h
+asm/page.h
+asm/types.h
+assert.h
+byteswap.h
+ctype.h
+dirent.h
+dlfcn.h
+elf.h
+endian.h
+err.h
+errno.h
+execinfo.h
+fcntl.h
+features.h
+float.h
+fstab.h
+ftw.h
+getopt.h
+glob.h
+grp.h
+iconv.h
+ifaddrs.h
+inttypes.h
+langinfo.h
+lastlog.h
+libgen.h
+libintl.h
+limits.h
+linux/capability.h
+linux/fd.h
+linux/fs.h
+linux/hayesesp.h
+linux/hdreg.h
+linux/icmp.h
+linux/in6.h
+linux/joystick.h
+linux/ptrace.h
+linux/serial.h
+linux/sonypi.h
+linux/unistd.h
+linux/utsname.h
+linux/version.h
+locale.h
+malloc.h
+math.h
+mcheck.h
+memory.h
+mntent.h
+mqueue.h
+netdb.h
+net/if.h
+netinet/ether.h
+netinet/in.h
+netinet/ip6.h
+netinet/ip.h
+netinet/tcp.h
+netinet/udp.h
+netipx/ipx.h
+net/route.h
+paths.h
+poll.h
+pthread.h
+pty.h
+pwd.h
+regex.h
+resolv.h
+rpc/rpc.h
+rpc/types.h
+sched.h
+scsi/scsi.h
+search.h
+semaphore.h
+setjmp.h
+sgtty.h
+shadow.h
+signal.h
+stdarg.h
+stdbool.h
+stdc
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+string.h
+strings.h
+stropts.h
+sys/bitypes.h
+sys/cdefs.h
+sys/dir.h
+sys/epoll.h
+sysexits.h
+sys/fcntl.h
+sys/file.h
+sys/fsuid.h
+sys/ioctl.h
+sys/ipc.h
+syslog.h
+sys/mman.h
+sys/mount.h
+sys/mtio.h
+sys/param.h
+sys/poll.h
+sys/prctl.h
+sys/ptrace.h
+sys/queue.h
+sys/reg.h
+sys/resource.h
+sys/select.h
+sys/sem.h
+sys/shm.h
+sys/signal.h
+sys/socket.h
+sys/socketvar.h
+sys/soundcard.h
+sys/statfs.h
+sys/stat.h
+sys/statvfs.h
+sys/stropts.h
+sys/swap.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/sysmacros.h
+sys/termios.h
+sys/timeb.h
+sys/time.h
+sys/times.h
+sys/timex.h
+sys/types.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/user.h
+sys/utsname.h
+sys/vfs.h
+sys/wait.h
+termio.h
+termios.h
+time.h
+ttyent.h
+ulimit.h
+unistd.h
+ustat.h
+utime.h
+utmp.h
+utmpx.h
+values.h
+wchar.h
+wctype.h
diff --git a/poky/meta/recipes-core/glibc/site_config/types b/poky/meta/recipes-core/glibc/site_config/types
new file mode 100644
index 000000000..178bd85a0
--- /dev/null
+++ b/poky/meta/recipes-core/glibc/site_config/types
@@ -0,0 +1,21 @@
+char
+char *
+double
+float
+int
+long
+long double
+long int
+long long
+long long int
+short
+short int
+signed char
+unsigned char
+unsigned int
+unsigned long
+unsigned long int
+unsigned long long int
+unsigned short
+unsigned short int
+void *
diff --git a/poky/meta/recipes-core/ifupdown/files/99_network b/poky/meta/recipes-core/ifupdown/files/99_network
new file mode 100644
index 000000000..42d5895d7
--- /dev/null
+++ b/poky/meta/recipes-core/ifupdown/files/99_network
@@ -0,0 +1 @@
+d root root 0755 /run/network none
diff --git a/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch b/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
new file mode 100644
index 000000000..a24b8cda6
--- /dev/null
+++ b/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
@@ -0,0 +1,57 @@
+From 7af9db748974cb3a2c6ef8f9e03d7db1f9f8ee16 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 6 Aug 2014 14:54:12 -0400
+Subject: [PATCH 1/2] defn2[c|man]: don't rely on dpkg-architecture to set arch
+
+In yocto we'll always be cross compiling, and we'll always
+be building on linux for linux (vs. *BSD, hurd, etc.)
+
+Without this the arch is not detected, but it doesn't error
+out, and hence you get useless binaries that don't know any
+arch specific methods, and the end result will be strangeness
+like the loopback device not being configured/enabled.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Upstream-Status: Pending
+---
+ defn2c.pl | 6 +++---
+ defn2man.pl | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/defn2c.pl b/defn2c.pl
+index c449de2f3d1c..38845e374c76 100755
+--- a/defn2c.pl
++++ b/defn2c.pl
+@@ -2,9 +2,9 @@
+
+ use strict;
+
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS ="linux";
+
+ # declarations
+ my $address_family = "";
+diff --git a/defn2man.pl b/defn2man.pl
+index 6ddcfdd4fe68..c9c4dd046597 100755
+--- a/defn2man.pl
++++ b/defn2man.pl
+@@ -2,9 +2,9 @@
+
+ use strict;
+
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS = "linux";
+
+ # declarations
+ my $line;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
new file mode 100644
index 000000000..2013933b6
--- /dev/null
+++ b/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
@@ -0,0 +1,422 @@
+From d88af5aa0312ea18aac791d66661da79b7bcd032 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 21 Dec 2016 15:32:07 +0200
+Subject: [PATCH] inet[6].defn: fix inverted checks for loopback
+
+Compared to the hurd link.defn for loopback, we see these
+are inverted, meaning that you would only be able to configure
+a loopback device that was _not_ named "lo" (unlikely to exist).
+
+The result was that we'd update /run/network/ifstate for "lo"
+but never actually do anything for up/down, as shown below:
+
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736329 0 2016 0 5289422 0 0 0 BMRU
+lo 65536 0 18 0 0 0 18 0 0 0 LRU
+root@localhost:~# ifdown lo
+root@localhost:~# echo $?
+0
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736406 0 2016 0 5289455 0 0 0 BMRU
+lo 65536 0 18 0 0 0 18 0 0 0 LRU
+root@localhost:~# ifconfig lo down
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736474 0 2016 0 5289481 0 0 0 BMRU
+root@localhost:~#
+
+Also reverted the commit:
+commit 80b878497663dae08f70b4d3cffe127b57a3cfc
+which uses absolute paths to binaries called by ifup/ifdown.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ inet.defn | 148 +++++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 74 insertions(+), 74 deletions(-)
+
+diff --git a/inet.defn b/inet.defn
+index 75e6744..b5f5da2 100644
+--- a/inet.defn
++++ b/inet.defn
+@@ -6,10 +6,10 @@ method loopback
+ This method may be used to define the IPv4 loopback interface.
+
+ up
+- /bin/ip link set dev %iface% up if (!iface_is_lo())
++ ip link set dev %iface% up if (iface_is_lo())
+
+ down
+- /bin/ip link set dev %iface% down if (!iface_is_lo())
++ ip link set dev %iface% down if (iface_is_lo())
+
+ method static
+ description
+@@ -36,17 +36,17 @@ method static
+ broadcast compute_v4_broadcast
+
+ up
+- /bin/ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++ ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+- /bin/ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
++ ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
+
+- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+
+ down
+- [[ /bin/ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
+- /bin/ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++ [[ ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
++ ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method manual
+@@ -63,12 +63,12 @@ method manual
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/bin/ip link set dev %iface% mtu %mtu%]]
+- [[/bin/ip link set dev %iface% address %hwaddress%]]
+- /bin/ip link set dev %iface% up 2>/dev/null || true
++ [[ip link set dev %iface% mtu %mtu%]]
++ [[ip link set dev %iface% address %hwaddress%]]
++ ip link set dev %iface% up 2>/dev/null || true
+
+ down
+- /bin/ip link set dev %iface% down 2>/dev/null || true \
++ ip link set dev %iface% down 2>/dev/null || true \
+ if (iface_is_link() && !do_all)
+
+ method dhcp
+@@ -93,33 +93,33 @@ method dhcp
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/bin/ip link set dev %iface% address %hwaddress%]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ [[ip link set dev %iface% address %hwaddress%]]
++ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ [[-e IF_METRIC=%metric%]] \
+ if (execable("/sbin/dhclient"))
+- /sbin/pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
++ pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
+ elsif (execable("/sbin/pump"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] [[-m %metric%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- /sbin/pump -i %iface% -r \
++ pump -i %iface% -r \
+ elsif (execable("/sbin/pump"))
+- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method bootp
+@@ -134,11 +134,11 @@ method bootp
+ whatever it really is.
+
+ up
+- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+ [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+
+ down
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method tunnel
+@@ -158,13 +158,13 @@ method tunnel
+ ttl time -- TTL setting
+ mtu size -- MTU size
+ up
+- /bin/ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
++ ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
+ [[ttl %ttl%]]
+- /bin/ip link set %iface% up [[mtu %mtu%]]
+- /bin/ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
+- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++ ip link set %iface% up [[mtu %mtu%]]
++ ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
++ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+ down
+- /bin/ip tunnel del %iface%
++ ip tunnel del %iface%
+
+ method ppp
+ description
+@@ -175,9 +175,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -186,10 +186,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -s 2
+
+
+@@ -200,9 +200,9 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+
+ architecture kfreebsd
+
+@@ -211,12 +211,12 @@ method loopback
+ This method may be used to define the IPv4 loopback interface.
+
+ up
+- /sbin/ifconfig %iface% 127.0.0.1 up \
+- if (!iface_is_lo())
++ ifconfig %iface% 127.0.0.1 up \
++ if (iface_is_lo())
+
+ down
+- /sbin/ifconfig %iface% down \
+- if (!iface_is_lo())
++ ifconfig %iface% down \
++ if (iface_is_lo())
+
+ method static
+ description
+@@ -238,15 +238,15 @@ method static
+ hwaddress cleanup_hwaddress
+
+ up
+- [[ /sbin/ifconfig %iface% link %hwaddress%]]
+- /sbin/ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
++ [[ ifconfig %iface% link %hwaddress%]]
++ ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
+ [[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \
+ up
+- [[ /sbin/route add default %gateway% ]]
++ [[ route add default %gateway% ]]
+
+ down
+- [[ /sbin/route del default %gateway% 2>&1 1>/dev/null || true ]]
+- /sbin/ifconfig %iface% down
++ [[ route del default %gateway% 2>&1 1>/dev/null || true ]]
++ ifconfig %iface% down
+
+ method manual
+ description
+@@ -279,30 +279,30 @@ method dhcp
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/sbin/ifconfig %iface% link %hwaddress%]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ [[ifconfig %iface% link %hwaddress%]]
++ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ [[-e IF_METRIC=%metric%]] \
+ if (execable("/sbin/dhclient"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
+ [[-c %client%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+- /sbin/ifconfig %iface% down
++ ifconfig %iface% down
+
+ method bootp
+ description
+@@ -316,11 +316,11 @@ method bootp
+ whatever it really is.
+
+ up
+- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+ [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+
+ down
+- /sbin/ifconfig %iface% down
++ ifconfig %iface% down
+
+ method ppp
+ description
+@@ -331,9 +331,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -342,10 +342,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -s 2
+
+
+@@ -356,9 +356,9 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+ architecture hurd
+
+ method loopback
+@@ -367,11 +367,11 @@ method loopback
+
+ up
+ inetutils-ifconfig --interface %iface% --address 127.0.0.1 --up \
+- if (!iface_is_lo())
++ if (iface_is_lo())
+
+ down
+ inetutils-ifconfig --interface %iface% --down \
+- if (!iface_is_lo())
++ if (iface_is_lo())
+
+ method static
+ description
+@@ -432,23 +432,23 @@ method dhcp
+
+ up
+ [[Warning: Option hwaddress: %hwaddress% not yet supported]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++ dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
+ [[-c %client%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface///.%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface///.%.pid); fi \
++ if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(cat /run/udhcpc.%iface///.%.pid); kill -TERM $(cat /run/udhcpc.%iface///.%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+@@ -482,9 +482,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -493,10 +493,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface///.%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface///.%.pid -s 2
+
+
+@@ -507,6 +507,6 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+--
+2.4.0
+
diff --git a/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb b/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
new file mode 100644
index 000000000..e9f3a2aee
--- /dev/null
+++ b/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
@@ -0,0 +1,46 @@
+SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
+DESCRIPTION = "High level tools to configure network interfaces \
+This package provides the tools ifup and ifdown which may be used to \
+configure (or, respectively, deconfigure) network interfaces, based on \
+the file /etc/network/interfaces."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https \
+ file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
+ file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \
+ file://99_network \
+ "
+SRCREV = "11b9f99f7ecc7052497e6786156cfed531f11823"
+
+S = "${WORKDIR}/git"
+
+
+inherit update-alternatives
+
+do_compile () {
+ chmod a+rx *.pl *.sh
+ oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
+}
+
+do_install () {
+ install -d ${D}${mandir}/man8 \
+ ${D}${mandir}/man5 \
+ ${D}${base_sbindir}
+
+ # If volatiles are used, then we'll also need /run/network there too.
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_network ${D}/etc/default/volatiles
+
+ install -m 0755 ifup ${D}${base_sbindir}/
+ ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
+ install -m 0644 ifup.8 ${D}${mandir}/man8
+ install -m 0644 interfaces.5 ${D}${mandir}/man5
+ cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+}
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "ifup ifdown"
+
+ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
+ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
diff --git a/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt
new file mode 100644
index 000000000..e7298f2c3
--- /dev/null
+++ b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt
@@ -0,0 +1,75 @@
+
+Installing VirtualBox Guest Additions
+=====================================
+
+In order to use VirtualBox guest additions, they have to be build
+first. They may have to be rebuilt each time the time you upgrade to
+a new version of VirtualBox.
+
+Make sure VM is configured with an Optical Drive.
+
+Please follow these steps to install the VirtualBox Guest Additions on the
+Build Appliance VM:
+
+1. Boot VM, select root "Terminal" instead of the default "Terminal <2>"
+
+2. Insert Guest additions CD into VM optical drive:
+ VM menu "Devices"->"Optical Drives"-> Select "VBoxGuestAdditions<version>.iso"
+
+3. Find your CDROM device. Typically it is /dev/hda for IDE. You can determine
+ the actual name <cdromedev> by viewing the cdrom info:
+
+ # cat /proc/sys/dev/cdrom/info
+
+ Mount the cdrom drive:
+ # mount -t iso9660 <cdromdev> /media/cdrom
+ i.e.:
+ # mount -t iso9660 /dev/hda /media/cdrom
+
+4. Build the additions:
+
+ First, we need to build of some prerequisite utilities.
+ (This is only needed to be done once)
+
+ # cd /lib/modules/<kernel-version>-yocto-standard/build
+ # make scripts
+
+ Now build the guest additions:
+
+ # /media/cdrom/VBoxLinuxAdditions.run --nox11
+
+ At this point, providing there were no build errors, the guest additions are
+ built and installed.
+
+5. Check if vbox additions running:
+
+ # /etc/init.d/vboxadd status
+
+ If not running, try manually starting:
+
+ # /etc/init.d/vboxadd start
+
+6. Check if additons actually work, in particular folder sharing.
+
+ Host: Devices->Shared Folders->Shared Folder Settings...
+ Add any host folder and name it (i.e. "images")
+
+ Guest VM: create mount point for the shared folder, i.e.:
+
+ # mkdir ~/my-host
+
+ Mount the shared folder: (Watch out for spelling: it's vboxsf NOT vboxfs)
+
+ # mount -t vboxsf images ~/my-host
+
+ Verify mount, should see the contents of the shared folder:
+
+ # ls ~/my-host
+
+
+
+
+
+
+
+
diff --git a/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
new file mode 100644
index 000000000..a0aede2fb
--- /dev/null
+++ b/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
@@ -0,0 +1,78 @@
+
+Running Toaster in VirtualBox
+=============================
+
+Toaster is launched via the command in VM:
+
+ $ source toaster start webport=<IPADDR:PORT>
+
+The interaction with Toaster web server is done via a host internet
+browser.
+The particular steps depend on the actual networking being used
+by the VirtualBox.
+
+
+Bridged Network
+===============
+
+Find out your VM network IP address:
+
+ $ ifconfig
+
+IP address is listed under eth0 inet addr.
+It should be something like:
+ inet addr:192.168.1.18
+
+Launch the Toaster web server in VM:
+
+ $ source toaster start webport=192.168.1.18:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+ http://192.168.1.18:8000
+
+
+NAT Network
+===========
+Find out your VM network IP address:
+
+ $ ifconfig
+
+IP address is listed under eth0 inet addr.
+For NAT network it should be something like:
+ inet addr:10.0.2.15
+
+When using NAT network, the VM web server can be accessed using
+Port Forwarding.
+
+Using the VirtualBox GUI, navigate to:
+ Settings->Network->Adapter1
+
+You should set:
+ Attached to: NAT
+
+Select "Advanced", click on "Port Forwarding"
+
+This will open a new dialog box "Port Forwarding Rules".
+Create a new rule that looks like this:
+
+| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
++-------+----------+---------+-----------+----------+------------+
+| Rule1 | TCP | | 8000 | | 8000 |
+------------------------------------------------------------------
+
+Now we can launch the Toaster web server in VM:
+
+ $ source toaster start webport=10.0.2.15:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+ http://127.0.0.1:8000
+
+
+
+
+
+
+
+
diff --git a/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
new file mode 100644
index 000000000..6472e8750
--- /dev/null
+++ b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
@@ -0,0 +1,46 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "10"
+numvcpus = "2"
+vcpu.hotadd = "TRUE"
+memsize = "4096"
+mem.hotadd = "TRUE"
+sata0.present = "TRUE"
+sata0:0.present = "TRUE"
+sata0:0.fileName = "Yocto_Build_Appliance.vmdk"
+ethernet0.present = "TRUE"
+ethernet0.virtualDev = "e1000"
+ethernet0.wakeOnPcktRcv = "FALSE"
+ethernet0.addressType = "generated"
+usb.present = "TRUE"
+ehci.pciSlotNumber = "0"
+sound.present = "TRUE"
+sound.fileName = "-1"
+sound.autodetect = "TRUE"
+pciBridge0.present = "TRUE"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+vmci0.present = "TRUE"
+hpet0.present = "TRUE"
+usb.vbluetooth.startConnected = "TRUE"
+displayName = "Yocto Build Appliance"
+guestOS = "other3xlinux-64"
+virtualHW.productCompatibility = "hosted"
+gui.exitOnCLIHLT = "FALSE"
+powerType.powerOff = "soft"
+powerType.powerOn = "soft"
+powerType.suspend = "soft"
+powerType.reset = "soft"
+extendedConfigFile = "Yocto_Build_Appliance.vmxf"
+scsi0:0.present = "FALSE"
+floppy0.present = "FALSE"
diff --git a/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
new file mode 100644
index 000000000..9e941ff2f
--- /dev/null
+++ b/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Foundry>
+<VM>
+<VMId type="string">52 a5 d8 cb ed 6c 85 48-cd 99 68 af cc 30 a0 98</VMId>
+<ClientMetaData>
+<clientMetaDataAttributes/>
+<HistoryEventList/></ClientMetaData>
+<vmxPathName type="string">Yocto_Build_Appliance.vmx</vmxPathName></VM></Foundry>
diff --git a/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
new file mode 100644
index 000000000..db2f58dfb
--- /dev/null
+++ b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
@@ -0,0 +1,136 @@
+SUMMARY = "An image containing the build system itself"
+DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation."
+HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \
+ kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \
+ tzdata python3-pip perl-misc"
+
+IMAGE_FEATURES += "x11-base package-management splash"
+
+# Ensure there's enough space to do a core-image-sato build, with rm_work enabled
+IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
+
+# Do a quiet boot with limited console messages
+APPEND += "rootfstype=ext4 quiet"
+
+DEPENDS = "zip-native python3-pip-native"
+IMAGE_FSTYPES = "wic.vmdk"
+
+inherit core-image module-base setuptools3
+
+SRCREV ?= "14d62d5c14e3552f2aeabdbd80d1504bb2c6ed64"
+SRC_URI = "git://git.yoctoproject.org/poky;branch=sumo \
+ file://Yocto_Build_Appliance.vmx \
+ file://Yocto_Build_Appliance.vmxf \
+ file://README_VirtualBox_Guest_Additions.txt \
+ file://README_VirtualBox_Toaster.txt \
+ "
+BA_INCLUDE_SOURCES ??= "0"
+
+IMAGE_CMD_ext4_append () {
+ # We don't need to reserve much space for root, 0.5% is more than enough
+ tune2fs -m 0.5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4
+}
+
+fakeroot do_populate_poky_src () {
+ # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo
+ # will become invalid in the target.
+ rm -rf ${WORKDIR}/git/.git
+ rm -f ${WORKDIR}/git/.gitignore
+
+ cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky
+
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads
+ if [ ${BA_INCLUDE_SOURCES} != 0 ]; then
+ cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/
+ # Remove the git2_* tarballs -- this is ok since we still have the git2/.
+ rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_*
+ fi
+
+ # Place the README_VirtualBox_Guest_Additions file in builders home folder.
+ cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/
+
+ # Place the README_VirtualBox_Toaster file in builders home folder.
+ cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
+
+ # Create a symlink, needed for out-of-tree kernel modules build
+ rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
+ lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
+
+ echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
+ echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ # Also save (for reference only) the actual SRCREV used to create this image
+ echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo 'export PATH=$PATH:/sbin' >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ echo "# If working behind a proxy and using the provided oe-git-proxy script" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# you need to set ALL_PROXY based on your proxy settings." >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# Example ALL_PROXY values:" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# export ALL_PROXY=https://proxy.example.com:8080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# export ALL_PROXY=socks://socks.example.com:1080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky
+ chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky
+
+ # Assume we will need CDROM to install guest additions
+ mkdir -p ${IMAGE_ROOTFS}/media/cdrom
+
+ # Allow builder to use sudo
+ echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers
+
+ # Load tap/tun at startup
+ rm -f ${IMAGE_ROOTFS}/sbin/iptables
+ lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
+ echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
+
+ # Use Clearlooks GTK+ theme
+ mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0
+ echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
+
+ # Install modules needed for toaster
+ export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}
+ export STAGING_INCDIR=${STAGING_INCDIR_NATIVE}
+ export HOME=${IMAGE_ROOTFS}/home/builder
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip
+ pip3_install_params="--user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt"
+ if [ -n "${http_proxy}" ]; then
+ pip3_install_params="${pip3_install_params} --proxy ${http_proxy}"
+ fi
+ pip3 install ${pip3_install_params}
+ chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.local
+ chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.cache
+}
+
+IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
+
+addtask rootfs after do_unpack
+
+python () {
+ # Ensure we run these usually noexec tasks
+ d.delVarFlag("do_fetch", "noexec")
+ d.delVarFlag("do_unpack", "noexec")
+}
+
+create_bundle_files () {
+ cd ${WORKDIR}
+ mkdir -p Yocto_Build_Appliance
+ cp *.vmx* Yocto_Build_Appliance
+ ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
+ zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
+ ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/Yocto_Build_Appliance.zip
+}
+create_bundle_files[vardepsexclude] = "DATETIME"
+
+python do_bundle_files() {
+ bb.build.exec_func('create_bundle_files', d)
+}
+
+addtask bundle_files after do_image_wic before do_image_complete
diff --git a/poky/meta/recipes-core/images/core-image-base.bb b/poky/meta/recipes-core/images/core-image-base.bb
new file mode 100644
index 000000000..75a08cfc9
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-base.bb
@@ -0,0 +1,8 @@
+SUMMARY = "A console-only image that fully supports the target device \
+hardware."
+
+IMAGE_FEATURES += "splash"
+
+LICENSE = "MIT"
+
+inherit core-image
diff --git a/poky/meta/recipes-core/images/core-image-minimal-dev.bb b/poky/meta/recipes-core/images/core-image-minimal-dev.bb
new file mode 100644
index 000000000..93ead2055
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-minimal-dev.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "A small image just capable of allowing a device to boot and \
+is suitable for development work."
+
+IMAGE_FEATURES += "dev-pkgs"
+
diff --git a/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb b/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
new file mode 100644
index 000000000..6de860e43
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
@@ -0,0 +1,33 @@
+# Simple initramfs image. Mostly used for live images.
+DESCRIPTION = "Small image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently."
+
+INITRAMFS_SCRIPTS ?= "\
+ initramfs-framework-base \
+ initramfs-module-setup-live \
+ initramfs-module-udev \
+ initramfs-module-install \
+ initramfs-module-install-efi \
+ "
+
+PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "${MLPREFIX}core-image-minimal-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
new file mode 100644
index 000000000..c92234c08
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "Small image capable of booting a device with support for the \
+Minimal MTD Utilities, which let the user interact with the MTD subsystem in \
+the kernel to perform operations on flash devices."
+
+IMAGE_INSTALL += "mtd-utils"
diff --git a/poky/meta/recipes-core/images/core-image-minimal.bb b/poky/meta/recipes-core/images/core-image-minimal.bb
new file mode 100644
index 000000000..4630026aa
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-minimal.bb
@@ -0,0 +1,12 @@
+SUMMARY = "A small image just capable of allowing a device to boot."
+
+IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE ?= "8192"
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
diff --git a/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb b/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
new file mode 100644
index 000000000..51d08a0cd
--- /dev/null
+++ b/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
@@ -0,0 +1,43 @@
+# Simple initramfs image artifact generation for tiny images.
+DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
+actually generate an image but rather generates boot and rootfs artifacts \
+that can subsequently be picked up by external image generation tools such as wic."
+
+PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-tiny-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+# don't actually generate an image, just the artifacts needed for one
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+python tinyinitrd () {
+ # Modify our init file so the user knows we drop to shell prompt on purpose
+ newinit = None
+ with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
+ newinit = init.read()
+ newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
+ with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
+ init.write(newinit)
+}
+
+IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"
+
+QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 000000000..2a8e0d126
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
@@ -0,0 +1,11 @@
+This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
+Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
+<ajt@debian.org> until 2001.
+It is currently maintained by Marco d'Itri <md@linux.it>.
+
+Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
+
+The programs in this package are distributed under the terms of the GNU
+General Public License, version 2 as distributed by the Free Software
+Foundation. On Debian systems, a copy of this license may be found in
+/usr/share/common-licenses/GPL-2.
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 000000000..fb31c635b
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
@@ -0,0 +1,90 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides: networking
+# Required-Start: mountvirtfs $local_fs
+# Required-Stop: $local_fs
+# Should-Start: ifupdown
+# Should-Stop: ifupdown
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Raise network interfaces.
+### END INIT INFO
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+[ -x /sbin/ifup ] || exit 0
+
+check_network_file_systems() {
+ [ -e /proc/mounts ] || return 0
+
+ if [ -e /etc/iscsi/iscsi.initramfs ]; then
+ echo "not deconfiguring network interfaces: iSCSI root is mounted."
+ exit 0
+ fi
+
+ exec 9<&0 < /proc/mounts
+ while read DEV MTPT FSTYPE REST; do
+ case $DEV in
+ /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+ echo "not deconfiguring network interfaces: network devices still mounted."
+ exit 0
+ ;;
+ esac
+ case $FSTYPE in
+ nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
+ echo "not deconfiguring network interfaces: network file systems still mounted."
+ exit 0
+ ;;
+ esac
+ done
+ exec 0<&9 9<&-
+}
+
+check_network_swap() {
+ [ -e /proc/swaps ] || return 0
+
+ exec 9<&0 < /proc/swaps
+ while read DEV MTPT FSTYPE REST; do
+ case $DEV in
+ /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+ echo "not deconfiguring network interfaces: network swap still mounted."
+ exit 0
+ ;;
+ esac
+ done
+ exec 0<&9 9<&-
+}
+
+case "$1" in
+start)
+ echo -n "Configuring network interfaces... "
+ sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
+ ifup -a
+ echo "done."
+ ;;
+
+stop)
+ check_network_file_systems
+ check_network_swap
+
+ echo -n "Deconfiguring network interfaces... "
+ ifdown -a
+ echo "done."
+ ;;
+
+force-reload|restart)
+ echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
+ echo "Reconfiguring network interfaces... "
+ ifdown -a || true
+ ifup -a
+ echo "done."
+ ;;
+
+*)
+ echo "Usage: /etc/init.d/networking {start|stop}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 000000000..0acf4cf44
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -0,0 +1,31 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+# Wireless interfaces
+iface wlan0 inet dhcp
+ wireless_mode managed
+ wireless_essid any
+ wpa-driver wext
+ wpa-conf /etc/wpa_supplicant.conf
+
+iface atml0 inet dhcp
+
+# Wired or wireless interfaces
+auto eth0
+iface eth0 inet dhcp
+iface eth1 inet dhcp
+
+# Ethernet/RNDIS gadget (g_ether)
+# ... or on host side, usbnet and random hwaddr
+iface usb0 inet static
+ address 192.168.7.2
+ netmask 255.255.255.0
+ network 192.168.7.0
+ gateway 192.168.7.1
+
+# Bluetooth networking
+iface bnep0 inet dhcp
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 000000000..750c0a98f
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# In case the interface is used as nfsroot, avoid ifup, otherwise
+# nfsroot may lose response
+
+nfsroot=0
+
+if test "x$IFACE" = xlo ; then
+ exit 0
+fi
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+exec 0<&9 9<&-
+
+test $nfsroot -eq 0 && exit 0
+
+if [ -x /bin/ip -o -x /sbin/ip ] ; then
+ nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
+fi
+
+if test "x$IFACE" = "x$nfs_iface" ; then
+ echo "ifup skipped for nfsroot interface $nfs_iface"
+ exit 1
+fi
+
+exit 0
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 000000000..16967763e
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 000000000..f62b9a897
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 000000000..733ae41f2
--- /dev/null
+++ b/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Basic TCP/IP networking init scripts and configuration files"
+DESCRIPTION = "This package provides high level tools to configure network interfaces"
+HOMEPAGE = "http://packages.debian.org/ifupdown"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PR = "r7"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "networking"
+INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ."
+
+SRC_URI = "file://copyright \
+ file://init \
+ file://interfaces \
+ file://nfsroot"
+
+S = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/network/if-pre-up.d \
+ ${D}${sysconfdir}/network/if-up.d \
+ ${D}${sysconfdir}/network/if-down.d \
+ ${D}${sysconfdir}/network/if-post-down.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking
+ install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces
+ install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d
+}
+
+do_install_append_qemuall () {
+ # Disable network manager on machines that commonly do NFS booting
+ touch ${D}${sysconfdir}/network/nm-disabled-eth0
+}
+
+PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}"
+RDEPENDS_${PN} = "netbase"
+RCONFLICTS_${PN} = "netbase (< 1:5.0)"
+
+CONFFILES_${PN} = "${sysconfdir}/network/interfaces"
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-boot.sh b/poky/meta/recipes-core/initrdscripts/files/init-boot.sh
new file mode 100644
index 000000000..e82eba025
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-boot.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+mkdir /proc
+mkdir /sys
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+exec sh
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
new file mode 100644
index 000000000..9c4b263d5
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -0,0 +1,199 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 200 Mb for the boot partition
+boot_size=200
+
+# 50% for the second rootfs
+testfs_ratio=50
+
+found="no"
+
+echo "Searching for a hard drive..."
+for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1'
+do
+ if [ -e /sys/block/${device}/removable ]; then
+ if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then
+ found="yes"
+
+ while true; do
+ # Try sleeping here to avoid getting kernel messages
+ # obscuring/confusing user
+ sleep 5
+ echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]"
+ read answer
+ if [ "$answer" = "y" ] ; then
+ break
+ fi
+
+ if [ "$answer" = "n" ] ; then
+ found=no
+ break
+ fi
+
+ echo "Please answer y or n"
+ done
+ fi
+ fi
+
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+
+done
+
+if [ "$found" = "no" ]; then
+ exit 1
+fi
+
+echo "Installing image on /dev/${device}"
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+cat /proc/mounts > /etc/mtab
+
+disk_size=$(parted /dev/${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size: $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+parted /dev/${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat -n "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "platform" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /ssd
+mkdir /rootmnt
+mkdir /bootmnt
+
+mount $rootfs /ssd
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
+
+echo "Copying rootfs files..."
+cp -a /rootmnt/* /ssd
+
+touch /ssd/etc/masterimage
+
+if [ -d /ssd/etc/ ] ; then
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /ssd/etc/udev/ ] ; then
+ echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist
+ fi
+fi
+
+umount /ssd
+umount /rootmnt
+
+echo "Preparing boot partition..."
+mount $bootfs /ssd
+
+EFIDIR="/ssd/EFI/BOOT"
+mkdir -p $EFIDIR
+cp /run/media/$1/vmlinuz /ssd
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+ GRUBCFG="$EFIDIR/grub.cfg"
+ cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+ # Update grub config for the installed image
+ # Delete the install entry
+ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+ # Delete the initrd lines
+ sed -i "/initrd /d" $GRUBCFG
+ # Delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+ # Delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $GRUBCFG
+ # Add the root= and other standard boot options
+ sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+ SYSTEMDBOOT_CFGS="/ssd/loader/entries/*.conf"
+ # copy config files for systemd-boot
+ cp -dr /run/media/$1/loader /ssd
+ # delete the install entry
+ rm -f /ssd/loader/entries/install.conf
+ # delete the initrd lines
+ sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
+ # Add the test label
+ echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf
+fi
+
+umount /ssd
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
new file mode 100644
index 000000000..82b0aa819
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -0,0 +1,299 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# figure out how big of a boot partition we need
+boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
+# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
+if [ -e /run/media/$1/$2 ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
+fi
+# remove initrd from size since its not currently installed
+if [ -e /run/media/$1/initrd ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
+fi
+# add 10M to provide some extra space for users and account
+# for rounding in the above subtractions
+boot_size=$(( boot_size + 10 ))
+
+# 5% for swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+ mmcblk*)
+ ;;
+ nvme*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+# Some eMMC devices have special sub devices such as mmcblk0boot0 etc
+# we're currently only interested in the root device so pick them wisely
+devices=`ls /sys/block/ | grep -v mmcblk` || true
+mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true
+devices="$devices $mmc_devices"
+
+for device in $devices; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ sr*)
+ # skip CDROM device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ case $device in
+ $live_dev_name*)
+ # skip the device we are running from
+ ;;
+ *)
+ hdnamelist="$hdnamelist $device"
+ ;;
+ esac
+ ;;
+ esac
+done
+
+if [ -z "${hdnamelist}" ]; then
+ echo "You need another device (besides the live device /dev/${live_dev_name}) to install the image. Installation aborted."
+ exit 1
+fi
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ if [ -r /sys/block/$hdname/device/model ]; then
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ fi
+ if [ -r /sys/block/$hdname/device/uevent ]; then
+ echo -n "UEVENT="
+ cat /sys/block/$hdname/device/uevent
+ fi
+ echo
+done
+
+# Get user choice
+while true; do
+ echo "Please select an install target or press n to exit ($hdnamelist ): "
+ read answer
+ if [ "$answer" = "n" ]; then
+ echo "Installation manually aborted."
+ exit 1
+ fi
+ for hdname in $hdnamelist; do
+ if [ "$answer" = "$hdname" ]; then
+ TARGET_DEVICE_NAME=$answer
+ break
+ fi
+ done
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+
+# Create /etc/mtab if not present
+if [ ! -e /etc/mtab ] && [ -e /proc/mounts ]; then
+ ln -sf /proc/mounts /etc/mtab
+fi
+
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-boot_size-swap_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
+bootfs=${device}${part_prefix}1
+rootfs=${device}${part_prefix}2
+swap=${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size: $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+parted ${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted ${device} mkpart boot fat32 0% $boot_size
+parted ${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted ${device} mkpart root ext4 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+parted ${device} mkpart swap linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Waiting for device nodes..."
+C=0
+while [ $C -ne 3 ] && [ ! -e $bootfs -o ! -e $rootfs -o ! -e $swap ]; do
+ C=$(( C + 1 ))
+ sleep 1
+done
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat $bootfs
+
+echo "Formatting $rootfs to ext4..."
+mkfs.ext4 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
+ echo "/dev/disk/by-partuuid/$swap_part_uuid swap swap defaults 0 0" >> /tgt_root/etc/fstab
+ echo "UUID=$boot_uuid /boot vfat defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+
+EFIDIR="/boot/EFI/BOOT"
+mkdir -p $EFIDIR
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+ root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
+ GRUBCFG="$EFIDIR/grub.cfg"
+ cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+ # Update grub config for the installed image
+ # Delete the install entry
+ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+ # Delete the initrd lines
+ sed -i "/initrd /d" $GRUBCFG
+ # Delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+ # Replace root= and add additional standard boot options
+ # We use root as a sentinel value, as vmlinuz is no longer guaranteed
+ sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait quiet /g" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+ rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
+ SYSTEMDBOOT_CFGS="/boot/loader/entries/*.conf"
+ # copy config files for systemd-boot
+ cp -dr /run/media/$1/loader /boot
+ # delete the install entry
+ rm -f /boot/loader/entries/install.conf
+ # delete the initrd lines
+ sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
+fi
+
+umount /tgt_root
+
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+ for kernel in `find /run/media/$1/ -name $types*`; do
+ cp $kernel /boot
+ done
+done
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
new file mode 100644
index 000000000..ac6216052
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -0,0 +1,220 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 20 Mb for the boot partition
+boot_size=200
+
+# 50% for the the test partition
+testfs_ratio=50
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=${1%%/*}
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ if [ $device != $live_dev_name -a -e /dev/$device ]; then
+ hdnamelist="$hdnamelist $device"
+ fi
+ ;;
+ esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ cat /sys/block/$hdname/device/uevent
+ echo
+ # Get user choice
+ while true; do
+ echo -n "Do you want to install this image there? [y/n] "
+ read answer
+ if [ "$answer" = "y" -o "$answer" = "n" ]; then
+ break
+ fi
+ echo "Please answer y or n"
+ done
+ if [ "$answer" = "y" ]; then
+ TARGET_DEVICE_NAME=$hdname
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+ mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ]; then
+ cat /proc/mounts > /etc/mtab
+fi
+
+disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size: $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel msdos
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 -L "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "rootfs" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+
+touch /tgt_root/etc/masterimage
+
+if [ -d /tgt_root/etc/ ] ; then
+ echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+umount /tgt_root
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+if [ -f /etc/grub.d/00_header ] ; then
+ echo "Preparing custom grub2 menu..."
+ GRUBCFG="/boot/grub/grub.cfg"
+ mkdir -p $(dirname $GRUBCFG)
+ cat >$GRUBCFG <<_EOF
+serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
+terminal_input --append serial
+terminal_output --append serial
+set timeout_style=hidden
+set timeout=5
+menuentry "Linux" {
+ set root=(hd0,1)
+ linux /vmlinuz root=$rootfs $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+ # Add the test label
+ echo -ne "\nmenuentry 'test' --hotkey x {\nlinux /test-kernel root=$testfs rw $rootwait quiet\n}\n" >> $GRUBCFG
+
+ chmod 0444 $GRUBCFG
+fi
+grub-install /dev/${device}
+echo "(hd0) /dev/${device}" > /boot/grub/device.map
+
+# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
+if [ ! -f /boot/grub/grub.cfg ] ; then
+ echo "Preparing custom grub menu..."
+ echo "default 0" > /boot/grub/menu.lst
+ echo "timeout 30" >> /boot/grub/menu.lst
+ echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+ echo "root (hd0,0)" >> /boot/grub/menu.lst
+ echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+cp /run/media/$1/vmlinuz /boot/
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-install.sh b/poky/meta/recipes-core/initrdscripts/files/init-install.sh
new file mode 100644
index 000000000..28e8f09d1
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -0,0 +1,341 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# figure out how big of a boot partition we need
+boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
+# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
+if [ -e /run/media/$1/$2 ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
+fi
+# remove initrd from size since its not currently installed
+if [ -e /run/media/$1/initrd ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
+fi
+# add 10M to provide some extra space for users and account
+# for rounding in the above subtractions
+boot_size=$(( boot_size + 10 ))
+
+# 5% for the swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+ mmcblk*)
+ ;;
+ nvme*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+# Some eMMC devices have special sub devices such as mmcblk0boot0 etc
+# we're currently only interested in the root device so pick them wisely
+devices=`ls /sys/block/ | grep -v mmcblk` || true
+mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true
+devices="$devices $mmc_devices"
+
+for device in $devices; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ sr*)
+ # skip CDROM device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ case $device in
+ $live_dev_name*)
+ # skip the device we are running from
+ ;;
+ *)
+ hdnamelist="$hdnamelist $device"
+ ;;
+ esac
+ ;;
+ esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ if [ -r /sys/block/$hdname/device/model ]; then
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ fi
+ if [ -r /sys/block/$hdname/device/uevent ]; then
+ echo -n "UEVENT="
+ cat /sys/block/$hdname/device/uevent
+ fi
+ echo
+done
+
+# Get user choice
+while true; do
+ echo "Please select an install target or press n to exit ($hdnamelist ): "
+ read answer
+ if [ "$answer" = "n" ]; then
+ echo "Installation manually aborted."
+ exit 1
+ fi
+ for hdname in $hdnamelist; do
+ if [ "$answer" = "$hdname" ]; then
+ TARGET_DEVICE_NAME=$answer
+ break
+ fi
+ done
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+ mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ] && [ -e /proc/mounts ]; then
+ ln -sf /proc/mounts /etc/mtab
+fi
+
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+grub_version=$(grub-install -V|sed 's/.* \([0-9]\).*/\1/')
+
+if [ $grub_version -eq 0 ] ; then
+ bios_boot_size=0
+else
+ # For GRUB 2 we need separate parition to store stage2 grub image
+ # 2Mb value is chosen to align partition for best performance.
+ bios_boot_size=2
+fi
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-bios_boot_size-boot_size-swap_size))
+
+boot_start=$((bios_boot_size))
+rootfs_start=$((bios_boot_size+boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
+if [ $grub_version -eq 0 ] ; then
+ bios_boot=''
+ bootfs=${device}${part_prefix}1
+ rootfs=${device}${part_prefix}2
+ swap=${device}${part_prefix}3
+else
+ bios_boot=${device}${part_prefix}1
+ bootfs=${device}${part_prefix}2
+ rootfs=${device}${part_prefix}3
+ swap=${device}${part_prefix}4
+fi
+
+echo "*****************"
+[ $grub_version -ne 0 ] && echo "BIOS boot partition size: $bios_boot_size MB ($bios_boot)"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size: $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+if [ $grub_version -eq 0 ] ; then
+ parted ${device} mktable msdos
+ echo "Creating boot partition on $bootfs"
+ parted ${device} mkpart primary ext3 0% $boot_size
+else
+ parted ${device} mktable gpt
+ echo "Creating BIOS boot partition on $bios_boot"
+ parted ${device} mkpart bios_boot 0% $bios_boot_size
+ parted ${device} set 1 bios_grub on
+ echo "Creating boot partition on $bootfs"
+ parted ${device} mkpart boot ext3 $boot_start $boot_size
+fi
+
+echo "Creating rootfs partition on $rootfs"
+[ $grub_version -eq 0 ] && pname='primary' || pname='root'
+parted ${device} mkpart $pname ext4 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+[ $grub_version -eq 0 ] && pname='primary' || pname='swap'
+parted ${device} mkpart $pname linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Waiting for device nodes..."
+C=0
+while [ $C -ne 3 ] && [ ! -e $bootfs -o ! -e $rootfs -o ! -e $swap ]; do
+ C=$(( C + 1 ))
+ sleep 1
+done
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 $bootfs
+
+echo "Formatting $rootfs to ext4..."
+mkfs.ext4 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+ if [ $grub_version -ne 0 ] ; then
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
+ bootdev="UUID=$boot_uuid"
+ swapdev=/dev/disk/by-partuuid/$swap_part_uuid
+ else
+ bootdev=${bootfs}
+ swapdev=${swap}
+ fi
+ echo "$swapdev swap swap defaults 0 0" >> /tgt_root/etc/fstab
+ echo "$bootdev /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+umount /tgt_root
+umount /src_root
+
+echo "Looking for kernels to use as boot target.."
+# Find kernel to boot to
+# Give user options if multiple are found
+kernels="$(find /run/media/$1/ -type f \
+ -name bzImage* -o -name zImage* \
+ -o -name vmlinux* -o -name vmlinuz* \
+ -o -name fitImage* \
+ | sed s:.*/::)"
+if [ -n "$(echo $kernels)" ]; then
+ # only one kernel entry if no space
+ if [ -z "$(echo $kernels | grep " ")" ]; then
+ kernel=$kernels
+ echo "$kernel will be used as the boot target"
+ else
+ echo "Which kernel do we want to boot by default? The following kernels were found:"
+ echo $kernels
+ read answer
+ kernel=$answer
+ fi
+else
+ echo "No kernels found, exiting..."
+ exit 1
+fi
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+
+if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
+ echo "Preparing custom grub2 menu..."
+ root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ GRUBCFG="/boot/grub/grub.cfg"
+ mkdir -p $(dirname $GRUBCFG)
+ cat >$GRUBCFG <<_EOF
+menuentry "Linux" {
+ search --no-floppy --fs-uuid $boot_uuid --set root
+ linux /$kernel root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+ chmod 0444 $GRUBCFG
+fi
+grub-install ${device}
+
+if [ $grub_version -eq 0 ] ; then
+ echo "(hd0) ${device}" > /boot/grub/device.map
+ echo "Preparing custom grub menu..."
+ echo "default 0" > /boot/grub/menu.lst
+ echo "timeout 30" >> /boot/grub/menu.lst
+ echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+ echo "root (hd0,0)" >> /boot/grub/menu.lst
+ echo "kernel /$kernel root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+ for kernel in `find /run/media/$1/ -name $types*`; do
+ cp $kernel /boot
+ done
+done
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/poky/meta/recipes-core/initrdscripts/files/init-live.sh b/poky/meta/recipes-core/initrdscripts/files/init-live.sh
new file mode 100644
index 000000000..46cab6cc7
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -0,0 +1,236 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+ROOT_MOUNT="/rootfs"
+ROOT_IMAGE="rootfs.img"
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+ISOLINUX=""
+
+ROOT_DISK=""
+
+# Copied from initramfs-framework. The core of this script probably should be
+# turned into initramfs-framework modules to reduce duplication.
+udev_daemon() {
+ OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+ for o in $OPTIONS; do
+ if [ -x "$o" ]; then
+ echo $o
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+early_setup() {
+ mkdir -p /proc
+ mkdir -p /sys
+ mount -t proc proc /proc
+ mount -t sysfs sysfs /sys
+ mount -t devtmpfs none /dev
+
+ # support modular kernel
+ modprobe isofs 2> /dev/null
+
+ mkdir -p /run
+ mkdir -p /var/run
+
+ $_UDEV_DAEMON --daemon
+ udevadm trigger --action=add
+}
+
+read_args() {
+ [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
+ for arg in $CMDLINE; do
+ optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+ case $arg in
+ root=*)
+ ROOT_DEVICE=$optarg ;;
+ rootimage=*)
+ ROOT_IMAGE=$optarg ;;
+ rootfstype=*)
+ modprobe $optarg 2> /dev/null ;;
+ LABEL=*)
+ label=$optarg ;;
+ video=*)
+ video_mode=$arg ;;
+ vga=*)
+ vga_mode=$arg ;;
+ console=*)
+ if [ -z "${console_params}" ]; then
+ console_params=$arg
+ else
+ console_params="$console_params $arg"
+ fi ;;
+ debugshell*)
+ if [ -z "$optarg" ]; then
+ shelltimeout=30
+ else
+ shelltimeout=$optarg
+ fi
+ esac
+ done
+}
+
+boot_live_root() {
+ # Watches the udev event queue, and exits if all current events are handled
+ udevadm settle --timeout=3 --quiet
+ # Kills the current udev running processes, which survived after
+ # device node creation events were handled, to avoid unexpected behavior
+ killall -9 "${_UDEV_DAEMON##*/}" 2>/dev/null
+
+ # Don't run systemd-update-done on systemd-based live systems
+ # because it triggers a slow rebuild of ldconfig caches.
+ touch ${ROOT_MOUNT}/etc/.updated ${ROOT_MOUNT}/var/.updated
+
+ # Allow for identification of the real root even after boot
+ mkdir -p ${ROOT_MOUNT}/media/realroot
+ mount -n --move "/run/media/${ROOT_DISK}" ${ROOT_MOUNT}/media/realroot
+
+ # Move the mount points of some filesystems over to
+ # the corresponding directories under the real root filesystem.
+ for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
+ mkdir -p ${ROOT_MOUNT}/media/${dir##*/}
+ mount -n --move $dir ${ROOT_MOUNT}/media/${dir##*/}
+ done
+ mount -n --move /proc ${ROOT_MOUNT}/proc
+ mount -n --move /sys ${ROOT_MOUNT}/sys
+ mount -n --move /dev ${ROOT_MOUNT}/dev
+
+ cd $ROOT_MOUNT
+
+ # busybox switch_root supports -c option
+ exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
+ fatal "Couldn't switch_root, dropping to shell"
+}
+
+fatal() {
+ echo $1 >$CONSOLE
+ echo >$CONSOLE
+ exec sh
+}
+
+early_setup
+
+[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
+
+read_args
+
+echo "Waiting for removable media..."
+C=0
+while true
+do
+ for i in `ls /run/media 2>/dev/null`; do
+ if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
+ found="yes"
+ ROOT_DISK="$i"
+ break
+ elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
+ found="yes"
+ ISOLINUX="isolinux"
+ ROOT_DISK="$i"
+ break
+ fi
+ done
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+ # don't wait for more than $shelltimeout seconds, if it's set
+ if [ -n "$shelltimeout" ]; then
+ echo -n " " $(( $shelltimeout - $C ))
+ if [ $C -ge $shelltimeout ]; then
+ echo "..."
+ echo "Mounted filesystems"
+ mount | grep media
+ echo "Available block devices"
+ cat /proc/partitions
+ fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
+ fi
+ C=$(( C + 1 ))
+ fi
+ sleep 1
+done
+
+# Try to mount the root image read-write and then boot it up.
+# This function distinguishes between a read-only image and a read-write image.
+# In the former case (typically an iso), it tries to make a union mount if possible.
+# In the latter case, the root image could be mounted and then directly booted up.
+mount_and_boot() {
+ mkdir $ROOT_MOUNT
+ mknod /dev/loop0 b 7 0 2>/dev/null
+
+ if ! mount -o rw,loop,noatime,nodiratime /run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+ fatal "Could not mount rootfs image"
+ fi
+
+ if touch $ROOT_MOUNT/bin 2>/dev/null; then
+ # The root image is read-write, directly boot it up.
+ boot_live_root
+ fi
+
+ # determine which unification filesystem to use
+ union_fs_type=""
+ if grep -q -w "overlay" /proc/filesystems; then
+ union_fs_type="overlay"
+ elif grep -q -w "aufs" /proc/filesystems; then
+ union_fs_type="aufs"
+ else
+ union_fs_type=""
+ fi
+
+ # make a union mount if possible
+ case $union_fs_type in
+ "overlay")
+ mkdir -p /rootfs.ro /rootfs.rw
+ if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+ rm -rf /rootfs.ro /rootfs.rw
+ fatal "Could not move rootfs mount point"
+ else
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+ mkdir -p /rootfs.rw/upperdir /rootfs.rw/work
+ mount -t overlay overlay -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw/upperdir,workdir=/rootfs.rw/work" $ROOT_MOUNT
+ mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+ mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+ mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+ fi
+ ;;
+ "aufs")
+ mkdir -p /rootfs.ro /rootfs.rw
+ if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+ rm -rf /rootfs.ro /rootfs.rw
+ fatal "Could not move rootfs mount point"
+ else
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+ mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
+ mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+ mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+ mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+ fi
+ ;;
+ "")
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
+ ;;
+ esac
+
+ # boot the image
+ boot_live_root
+}
+
+if [ "$label" != "boot" -a -f $label.sh ] ; then
+ if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+ ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
+ else
+ fatal "Could not find $label script"
+ fi
+
+ # If we're getting here, we failed...
+ fatal "Target $label failed"
+fi
+
+mount_and_boot
+
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
new file mode 100644
index 000000000..7ae7969f5
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Extremely basic live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-boot.sh"
+
+PR = "r2"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
+}
+
+inherit allarch
+
+FILES_${PN} += " /init "
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug b/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug
new file mode 100644
index 000000000..00bfd7d3f
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug
@@ -0,0 +1,82 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+# Adds support to dynamic debugging of initramfs using bootparam in
+# following format:
+# shell : starts a shell before and after each module
+# shell=before:<module> : starts a shell before <module> is loaded and run
+# shell=after:<module> : starts a shell after <module> is loaded and run
+#
+# shell-debug : run set -x as soon as possible
+# shell-debug=before:<module> : run set -x before <module> is loaded and run
+# shell-debug=after:<module> : run set -x after <module> is loaded and run
+
+DEBUG_SHELL="false"
+
+debug_hook_handler() {
+ status=$1
+ module=$2
+
+ if [ -n "$bootparam_shell" ] && [ "$bootparam_shell" != "true" ]; then
+ shell_wanted_status=`expr $bootparam_shell : '\(.*\):.*'`
+ shell_wanted_module=`expr $bootparam_shell : '.*:\(.*\)'`
+
+ if [ "$shell_wanted_status" = "before" ]; then
+ shell_wanted_status=pre
+ else
+ shell_wanted_status=post
+ fi
+ fi
+
+ if [ "$bootparam_shell" = "true" ] ||
+ ( [ "$status" = "$shell_wanted_status" ] &&
+ [ "$module" = "$shell_wanted_module" ] ); then
+ if [ "$status" = "pre" ]; then
+ status_msg="before"
+ else
+ status_msg="after"
+ fi
+
+ msg "Starting shell $status_msg $module..."
+ sh
+ fi
+
+ if [ -n "$bootparam_shell_debug" ] && [ "$bootparam_shell_debug" != "true" ]; then
+ shell_debug_wanted_status=`expr $bootparam_shell_debug : '\(.*\):.*'`
+ shell_debug_wanted_module=`expr $bootparam_shell_debug : '.*:\(.*\)'`
+
+ if [ "$shell_debug_wanted_status" = "before" ]; then
+ shell_debug_wanted_status=pre
+ else
+ shell_debug_wanted_status=post
+ fi
+ fi
+
+ if [ "$bootparam_shell_debug" = "true" ] ||
+ ( [ "$status" = "$shell_debug_wanted_status" ] &&
+ [ "$module" = "$shell_debug_wanted_module" ] ); then
+ if [ "$DEBUG_SHELL" = "true" ]; then
+ return 0
+ fi
+
+ if [ "$status" = "pre" ]; then
+ status_msg="before"
+ else
+ status_msg="after"
+ fi
+
+ msg "Starting shell debugging $status_msg $module..."
+ DEBUG_SHELL="true"
+ set -x
+ fi
+}
+
+debug_enabled() {
+ return 0
+}
+
+debug_run() {
+ add_module_pre_hook "debug_hook_handler"
+ add_module_post_hook "debug_hook_handler"
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
new file mode 100755
index 000000000..29f801a7b
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+e2fs_enabled() {
+ return 0
+}
+
+e2fs_run() {
+ filesystems="ext4 ext3 ext2"
+
+ # load modules
+ for fs in $filesystems; do
+ load_kernel_module $fs
+ done
+
+ for fs in $filesystems; do
+ eval "fs_options=\$bootparam_${fs}"
+ if [ -n "$fs_options" ]; then
+ dev=`expr "$fs_options" : '\([^:]*\).*'`
+ path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'`
+
+ info "Mounting $dev as $fs on $path as $fs..."
+ mkdir -p $path
+ mount -t $fs $dev $path
+ fi
+ done
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec b/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec
new file mode 100644
index 000000000..a8e2432bb
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Copyright (C) 2017 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+EXEC_DIR=/exec.d # place to look for modules
+
+exec_enabled() {
+ return 0
+}
+
+exec_run() {
+ if [ ! -d $EXEC_DIR ]; then
+ msg "No contents to exec in $EXEC_DIR. Starting shell ..."
+ sh
+ fi
+
+ # Load and run modules
+ for m in $EXEC_DIR/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ debug "Starting $m"
+
+ # process module
+ ./$m
+ done
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish b/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
new file mode 100755
index 000000000..717383eba
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+finish_enabled() {
+ return 0
+}
+
+finish_run() {
+ if [ -n "$ROOTFS_DIR" ]; then
+ if [ ! -d $ROOTFS_DIR/dev ]; then
+ fatal "ERROR: There's no '/dev' on rootfs."
+ fi
+
+ info "Switching root to '$ROOTFS_DIR'..."
+
+ debug "Moving /dev, /proc and /sys onto rootfs..."
+ mount --move /dev $ROOTFS_DIR/dev
+ mount --move /proc $ROOTFS_DIR/proc
+ mount --move /sys $ROOTFS_DIR/sys
+
+ cd $ROOTFS_DIR
+ exec switch_root -c /dev/console $ROOTFS_DIR ${bootparam_init:-/sbin/init}
+ else
+ debug "No rootfs has been set"
+ fi
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/init b/poky/meta/recipes-core/initrdscripts/initramfs-framework/init
new file mode 100755
index 000000000..37527a840
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -0,0 +1,145 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+#
+# Provides the API to be used by the initramfs modules
+#
+# Modules need to provide the following functions:
+#
+# <module>_enabled : check if the module ought to run (return 1 to skip)
+# <module>_run : do what is need
+#
+# Boot parameters are available on environment in the as:
+#
+# 'foo=value' as 'bootparam_foo=value'
+# 'foo' as 'bootparam_foo=true'
+# 'foo.bar[=value] as 'foo_bar=[value|true]'
+
+# Register a function to be called before running a module
+# The hook is called as:
+# <function> pre <module>
+add_module_pre_hook() {
+ MODULE_PRE_HOOKS="$MODULE_PRE_HOOKS $1"
+}
+
+# Register a function to be called after running a module
+# The hook is called as:
+# <function> post <module>
+add_module_post_hook() {
+ MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1"
+}
+
+# Load kernel module
+load_kernel_module() {
+ if modprobe $1 >/dev/null 2>&1; then
+ info "Loaded module $1"
+ else
+ debug "Failed to load module $1"
+ fi
+}
+
+# Prints information
+msg() {
+ echo "$@" >/dev/console
+}
+
+# Prints information if verbose bootparam is used
+info() {
+ [ -n "$bootparam_verbose" ] && echo "$@" >/dev/console
+}
+
+# Prints information if debug bootparam is used
+debug() {
+ [ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console
+}
+
+# Prints a message and start a endless loop
+fatal() {
+ echo $1 >/dev/console
+ echo >/dev/console
+
+ if [ -n "$bootparam_init_fatal_sh" ]; then
+ sh
+ else
+ while [ "true" ]; do
+ sleep 3600
+ done
+ fi
+}
+
+# Variables shared amoung modules
+ROOTFS_DIR="/rootfs" # where to do the switch root
+MODULE_PRE_HOOKS="" # functions to call before running each module
+MODULE_POST_HOOKS="" # functions to call after running each module
+MODULES_DIR=/init.d # place to look for modules
+
+# make mount stop complaining about missing /etc/fstab
+touch /etc/fstab
+
+# initialize /proc, /sys, /run/lock and /var/lock
+mkdir -p /proc /sys /run/lock /var/lock
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+# populate bootparam environment
+for p in `cat /proc/cmdline`; do
+ opt=`echo $p | cut -d'=' -f1`
+ opt=`echo $opt | tr '.-' '__'`
+ if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
+ eval "bootparam_${opt}=true"
+ else
+ value="`echo $p | cut -d'=' -f2-`"
+ eval "bootparam_${opt}=\"${value}\""
+ fi
+done
+
+# use /dev with devtmpfs
+if grep -q devtmpfs /proc/filesystems; then
+ mkdir -p /dev
+ mount -t devtmpfs devtmpfs /dev
+else
+ if [ ! -d /dev ]; then
+ fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled."
+ fi
+fi
+
+mkdir $ROOTFS_DIR
+
+# Load and run modules
+for m in $MODULES_DIR/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ module=`basename $m | cut -d'-' -f 2`
+ debug "Loading module $module"
+
+ # pre hooks
+ for h in $MODULE_PRE_HOOKS; do
+ debug "Calling module hook (pre): $h"
+ eval "$h pre $module"
+ debug "Finished module hook (pre): $h"
+ done
+
+ # process module
+ . $m
+
+ if ! eval "${module}_enabled"; then
+ debug "Skipping module $module"
+ continue
+ fi
+
+ debug "Running ${module}_run"
+ eval "${module}_run"
+
+ # post hooks
+ for h in $MODULE_POST_HOOKS; do
+ debug "Calling module hook (post): $h"
+ eval "$h post $module"
+ debug "Finished module hook (post): $h"
+ done
+done
+
+# Catch all
+fatal "ERROR: Initramfs failed to initialize the system."
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
new file mode 100644
index 000000000..9814d9764
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2011, 2017 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+mdev_enabled() {
+ if [ ! -e /sbin/mdev ]; then
+ debug "/sbin/mdev doesn't exist"
+ return 1
+ fi
+
+ return 0
+}
+
+mdev_run() {
+ # setup the environment
+ mount -t tmpfs tmpfs /dev
+
+ mkdir -m 1777 /dev/shm
+
+ mkdir -m 0755 /dev/pts
+ mount -t devpts devpts /dev/pts
+
+ echo /sbin/mdev > /proc/sys/kernel/hotplug
+ mdev -s
+
+ # load modules for devices
+ find /sys -name modalias | while read m; do
+ load_kernel_module $(cat "$m")
+ done
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
new file mode 100644
index 000000000..76fa84d35
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
@@ -0,0 +1,67 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+rootfs_enabled() {
+ return 0
+}
+
+rootfs_run() {
+ if [ -z "$ROOTFS_DIR" ]; then
+ return
+ fi
+ C=0
+ delay=${bootparam_rootdelay:-1}
+ timeout=${bootparam_roottimeout:-5}
+ while [ ! -d $ROOTFS_DIR/dev ]; do
+ if [ $(( $C * $delay )) -gt $timeout ]; then
+ fatal "root '$bootparam_root' doesn't exist or does not contain a /dev."
+ fi
+
+ if [ -n "$bootparam_root" ]; then
+ debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
+
+ if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
+ root_uuid=`echo $bootparam_root | cut -c6-`
+ bootparam_root="/dev/disk/by-uuid/$root_uuid"
+ fi
+
+ if [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
+ root_uuid=`echo $bootparam_root | cut -c10-`
+ bootparam_root="/dev/disk/by-partuuid/$root_uuid"
+ fi
+
+ if [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
+ root_label=`echo $bootparam_root | cut -c7-`
+ bootparam_root="/dev/disk/by-label/$root_label"
+ fi
+
+ if [ -e "$bootparam_root" ]; then
+ flags=""
+ if [ -n "$bootparam_ro" ] && ! echo "$bootparam_rootflags" | grep -w -q "ro"; then
+ if [ -n "$bootparam_rootflags" ]; then
+ bootparam_rootflags="$bootparam_rootflags,"
+ fi
+ bootparam_rootflags="${bootparam_rootflags}ro"
+ fi
+ if [ -n "$bootparam_rootflags" ]; then
+ flags="$flags -o$bootparam_rootflags"
+ fi
+ if [ -n "$bootparam_rootfstype" ]; then
+ flags="$flags -t$bootparam_rootfstype"
+ fi
+ mount $flags $bootparam_root $ROOTFS_DIR
+ if [ -d $ROOTFS_DIR/dev ]; then
+ break
+ else
+ # It is unlikely to change, but keep trying anyway.
+ # Perhaps we pick a different device next time.
+ umount $ROOTFS_DIR
+ fi
+ fi
+ fi
+ debug "Sleeping for $delay second(s) to wait root to settle..."
+ sleep $delay
+ C=$(( $C + 1 ))
+ done
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live b/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
new file mode 100644
index 000000000..4c79f4128
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
@@ -0,0 +1,64 @@
+#/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+setup_enabled() {
+ return 0
+}
+
+setup_run() {
+ROOT_IMAGE="rootfs.img"
+ISOLINUX=""
+ROOT_DISK=""
+shelltimeout=30
+
+ if [ -z "$bootparam_root" -o "$bootparam_root" = "/dev/ram0" ]; then
+ echo "Waiting for removable media..."
+ C=0
+ while true
+ do
+ for i in `ls /run/media 2>/dev/null`; do
+ if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
+ found="yes"
+ ROOT_DISK="$i"
+ break
+ elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
+ found="yes"
+ ISOLINUX="isolinux"
+ ROOT_DISK="$i"
+ break
+ fi
+ done
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+ # don't wait for more than $shelltimeout seconds, if it's set
+ if [ -n "$shelltimeout" ]; then
+ echo -n " " $(( $shelltimeout - $C ))
+ if [ $C -ge $shelltimeout ]; then
+ echo "..."
+ echo "Mounted filesystems"
+ mount | grep media
+ echo "Available block devices"
+ cat /proc/partitions
+ fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
+ fi
+ C=$(( C + 1 ))
+ fi
+ sleep 1
+ done
+ # The existing rootfs module has no support for rootfs images. Assign the rootfs image.
+ bootparam_root="/run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE"
+ fi
+
+ if [ "$bootparam_LABEL" != "boot" -a -f /init.d/$bootparam_LABEL.sh ] ; then
+ if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+ ./init.d/$bootparam_LABEL.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
+ else
+ fatal "Could not find $bootparam_LABEL script"
+ fi
+
+ # If we're getting here, we failed...
+ fatal "Target $bootparam_LABEL failed"
+ fi
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev b/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev
new file mode 100644
index 000000000..79c886782
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -0,0 +1,46 @@
+#!/bin/sh
+# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+udev_shutdown_hook_handler() {
+ status=$1
+ module=$2
+ if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
+ killall `basename $_UDEV_DAEMON` 2>/dev/null
+ fi
+}
+
+udev_daemon() {
+ OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+ for o in $OPTIONS; do
+ if [ -x "$o" ]; then
+ echo $o
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+udev_enabled() {
+ if [ -z "$_UDEV_DAEMON" ]; then
+ msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs."
+ return 1
+ fi
+
+ return 0
+}
+
+udev_run() {
+ add_module_pre_hook "udev_shutdown_hook_handler"
+
+ mkdir -p /run
+ mkdir -p /var/run
+
+ $_UDEV_DAEMON --daemon
+ udevadm trigger --action=add
+ udevadm settle
+}
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
new file mode 100644
index 000000000..75d965f06
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -0,0 +1,92 @@
+SUMMARY = "Modular initramfs system"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}"
+
+PR = "r4"
+
+inherit allarch
+
+SRC_URI = "file://init \
+ file://exec \
+ file://rootfs \
+ file://finish \
+ file://mdev \
+ file://udev \
+ file://e2fs \
+ file://debug \
+ "
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+
+ # base
+ install -m 0755 ${WORKDIR}/init ${D}/init
+ install -m 0755 ${WORKDIR}/rootfs ${D}/init.d/90-rootfs
+ install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
+
+ # exec
+ install -m 0755 ${WORKDIR}/exec ${D}/init.d/89-exec
+
+ # mdev
+ install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
+
+ # udev
+ install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
+
+ # e2fs
+ install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
+
+ # debug
+ install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
+
+ # Create device nodes expected by some kernels in initramfs
+ # before even executing /init.
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+PACKAGES = "${PN}-base \
+ initramfs-module-exec \
+ initramfs-module-mdev \
+ initramfs-module-udev \
+ initramfs-module-e2fs \
+ initramfs-module-rootfs \
+ initramfs-module-debug \
+ "
+
+FILES_${PN}-base = "/init /init.d/99-finish /dev"
+
+# 99-finish in base depends on some other module which mounts
+# the rootfs, like 90-rootfs. To replace that default, use
+# BAD_RECOMMENDATIONS += "initramfs-module-rootfs" in your
+# initramfs recipe and install something else, or install
+# something that runs earlier (for example, a 89-my-rootfs)
+# and mounts the rootfs. Then 90-rootfs will proceed immediately.
+RRECOMMENDS_${PN}-base += "initramfs-module-rootfs"
+
+SUMMARY_initramfs-module-exec = "initramfs support for easy execution of applications"
+RDEPENDS_initramfs-module-exec = "${PN}-base"
+FILES_initramfs-module-exec = "/init.d/89-exec"
+
+SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
+RDEPENDS_initramfs-module-mdev = "${PN}-base busybox-mdev"
+FILES_initramfs-module-mdev = "/init.d/01-mdev"
+
+SUMMARY_initramfs-module-udev = "initramfs support for udev"
+RDEPENDS_initramfs-module-udev = "${PN}-base udev"
+FILES_initramfs-module-udev = "/init.d/01-udev"
+
+SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
+RDEPENDS_initramfs-module-e2fs = "${PN}-base"
+FILES_initramfs-module-e2fs = "/init.d/10-e2fs"
+
+SUMMARY_initramfs-module-rootfs = "initramfs support for locating and mounting the root partition"
+RDEPENDS_initramfs-module-rootfs = "${PN}-base"
+FILES_initramfs-module-rootfs = "/init.d/90-rootfs"
+
+SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
+RDEPENDS_initramfs-module-debug = "${PN}-base"
+FILES_initramfs-module-debug = "/init.d/00-debug"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb
new file mode 100644
index 000000000..7a9a8ecae
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+DEPENDS = "virtual/kernel"
+RDEPENDS_${PN} = "busybox-mdev"
+SRC_URI = "file://init-live.sh"
+
+PR = "r12"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /dev "
+
+# Due to kernel dependency
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
new file mode 100644
index 000000000..57b30254a
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+DEPENDS = "virtual/kernel"
+RDEPENDS_${PN} = "udev udev-extraconf"
+SRC_URI = "file://init-live.sh"
+
+PR = "r12"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /dev "
+
+# Due to kernel dependency
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
new file mode 100644
index 000000000..c03bd2d76
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script for with a second rootfs/kernel option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi-testfs.sh"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-efi-testfs.sh ${D}/install-efi.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install-efi.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
new file mode 100644
index 000000000..f588a1077
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Live image install script for grub-efi"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi.sh"
+
+PR = "r1"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/install-efi.sh
+}
+
+# While this package maybe an allarch due to it being a
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install-efi.sh "
+
+COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
new file mode 100644
index 000000000..937bfd4d3
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script with a second rootfs/kernel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-testfs.sh"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-testfs.sh ${D}/install.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
new file mode 100644
index 000000000..9222d57c1
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Live image install script for grub"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install.sh"
+
+PR = "r9"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh
+}
+
+# While this package maybe an allarch due to it being a
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install.sh "
+
+COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb
new file mode 100644
index 000000000..78a61cde2
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb
@@ -0,0 +1,17 @@
+SUMMARY = "initramfs-framework module for EFI installation option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+
+PR = "r4"
+
+SRC_URI = "file://init-install-efi.sh"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/init.d/install-efi.sh
+}
+
+FILES_${PN} = "/init.d/install-efi.sh"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb
new file mode 100644
index 000000000..04e90cd30
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "initramfs-framework module for installation option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+
+# The same restriction as grub
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
+COMPATIBLE_HOST_armv7a = 'null'
+COMPATIBLE_HOST_armv7ve = 'null'
+
+PR = "r1"
+
+SRC_URI = "file://init-install.sh"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/init-install.sh ${D}/init.d/install.sh
+}
+
+FILES_${PN} = "/init.d/install.sh"
diff --git a/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb b/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb
new file mode 100644
index 000000000..4d2fe9dd2
--- /dev/null
+++ b/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "initramfs-framework module for live booting"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base udev-extraconf"
+
+PR = "r4"
+
+inherit allarch
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/initramfs-framework:"
+SRC_URI = "file://setup-live"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/setup-live ${D}/init.d/80-setup-live
+}
+
+FILES_${PN} = "/init.d/80-setup-live"
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
new file mode 100644
index 000000000..1ee8181f1
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
@@ -0,0 +1,347 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
new file mode 100644
index 000000000..b577b9a03
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: alignment
+# Required-Start: mountkernfs
+# Required-Stop: mountkernfs
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ -e /proc/cpu/alignment ]; then
+ echo "3" > /proc/cpu/alignment
+fi
+
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
new file mode 100644
index 000000000..9e2b09125
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: banner
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ ! -e /dev/tty ]; then
+ /bin/mknod -m 0666 /dev/tty c 5 0
+fi
+
+if ( > /dev/tty0 ) 2>/dev/null; then
+ vtmaster=/dev/tty0
+elif ( > /dev/vc/0 ) 2>/dev/null; then
+ vtmaster=/dev/vc/0
+elif ( > /dev/console ) 2>/dev/null; then
+ vtmaster=/dev/console
+else
+ vtmaster=/dev/null
+fi
+echo > $vtmaster
+echo "Please wait: booting..." > $vtmaster
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
new file mode 100755
index 000000000..df553bc07
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bootmisc
+# Required-Start: $local_fs mountvirtfs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Misc and other.
+### END INIT INFO
+
+. /etc/default/rcS
+#
+# Put a nologin file in /etc to prevent people from logging in before
+# system startup is complete.
+#
+if test "$DELAYLOGIN" = yes
+then
+ echo "System bootup in progress - please wait" > /etc/nologin
+ cp /etc/nologin /etc/nologin.boot
+fi
+
+#
+# Set pseudo-terminal access permissions.
+#
+if test -c /dev/ttyp0
+then
+ chmod 666 /dev/tty[p-za-e][0-9a-f]
+ chown root:tty /dev/tty[p-za-e][0-9a-f]
+fi
+
+#
+# Apply /proc settings if defined
+#
+SYSCTL_CONF="/etc/sysctl.conf"
+if [ -f "${SYSCTL_CONF}" ]
+then
+ if [ -x "/sbin/sysctl" ]
+ then
+ # busybox sysctl does not support -q
+ VERBOSE_REDIR="1>/dev/null"
+ if [ "${VERBOSE}" != "no" ]; then
+ VERBOSE_REDIR="1>&1"
+ fi
+ eval /sbin/sysctl -p "${SYSCTL_CONF}" $VERBOSE_REDIR
+ else
+ echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
+ fi
+fi
+
+#
+# Update /etc/motd.
+#
+if test "$EDITMOTD" != no
+then
+ uname -a > /etc/motd.tmp
+ sed 1d /etc/motd >> /etc/motd.tmp
+ mv /etc/motd.tmp /etc/motd
+fi
+
+#
+# This is as good a place as any for a sanity check
+#
+# Set the system clock from hardware clock
+# If the timestamp is more recent than the current time,
+# use the timestamp instead.
+test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
+if test -e /etc/timestamp
+then
+ SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
+ read TIMESTAMP < /etc/timestamp
+ if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
+ # format the timestamp as date expects it (2m2d2H2M4Y.2S)
+ TS_YR=${TIMESTAMP%??????????}
+ TS_SEC=${TIMESTAMP#????????????}
+ TS_FIRST12=${TIMESTAMP%??}
+ TS_MIDDLE8=${TS_FIRST12#????}
+ date -u ${TS_MIDDLE8}${TS_YR}.${TS_SEC}
+ test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
+ fi
+fi
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
new file mode 100755
index 000000000..62869451b
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: checkfs
+# Required-Start: checkroot
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Check all other file systems
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Check the rest of the filesystems.
+#
+if test ! -f /fastboot
+then
+ if test -f /forcefsck
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if test "$FSCKFIX" = yes
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ spinner="-C"
+ case "$TERM" in
+ dumb|network|unknown|"") spinner="" ;;
+ esac
+ test "`uname -m`" = "s390" && spinner="" # This should go away
+ test "$VERBOSE" != no && echo "Checking all filesystems..."
+ fsck $spinner -R -A $fix $force
+ if test "$?" -gt 1
+ then
+ echo
+ echo "fsck failed. Please repair manually."
+ echo
+ echo "CONTROL-D will exit from this shell and continue system startup."
+ echo
+ # Start a single user shell on the console
+ /sbin/sulogin $CONSOLE
+ fi
+fi
+rm -f /fastboot /forcefsck
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
new file mode 100755
index 000000000..02f0351fc
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -0,0 +1,148 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: checkroot
+# Required-Start: udev
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Check to root file system.
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
+# from this script *before anything else* with a timeout, like SCO does.
+#
+test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
+
+#
+# Read /etc/fstab.
+#
+exec 9< /etc/fstab
+rootmode=rw
+rootopts=rw
+rootcheck=$ENABLE_ROOTFS_FSCK
+swap_on_md=no
+devfs=
+while read fs mnt type opts dump pass junk <&9
+do
+ case "$fs" in
+ ""|\#*)
+ continue;
+ ;;
+ /dev/md*)
+ # Swap on md device.
+ test "$type" = swap && swap_on_md=yes
+ ;;
+ /dev/*)
+ ;;
+ *)
+ # Might be a swapfile.
+ test "$type" = swap && swap_on_md=yes
+ ;;
+ esac
+ test "$type" = devfs && devfs="$fs"
+ test "$mnt" != / && continue
+ rootopts="$opts"
+ test "$pass" = 0 -o "$pass" = "" && rootcheck=no
+ case "$opts" in
+ ro|ro,*|*,ro|*,ro,*)
+ rootmode=ro
+ ;;
+ esac
+done
+exec 0>&9 9>&-
+
+# Check for conflicting configurations
+if [ "$rootmode" = "ro" -a "$ROOTFS_READ_ONLY" = "no" ] || \
+ [ "$rootmode" = "rw" -a "$ROOTFS_READ_ONLY" = "yes" ]; then
+ echo ""
+ echo "WARN: conflicting configurations in /etc/fstab and /etc/default/rcS"
+ echo " regarding the writability of rootfs. Please fix one of them."
+ echo ""
+fi
+
+
+#
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+test "$VERBOSE" != no && echo "Activating swap"
+[ -x /sbin/swapon ] && swapon -a
+
+#
+# Check the root filesystem.
+#
+if test -f /fastboot || test $rootcheck = no
+then
+ test $rootcheck = yes && echo "Fast boot, no filesystem check"
+else
+ #
+ # Ensure that root is quiescent and read-only before fsck'ing.
+ #
+ mount -n -o remount,ro /
+ if test $? = 0
+ then
+ if test -f /forcefsck
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if test "$FSCKFIX" = yes
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ spinner="-C"
+ case "$TERM" in
+ dumb|network|unknown|"") spinner="" ;;
+ esac
+ test `uname -m` = s390 && spinner="" # This should go away
+ test "$VERBOSE" != no && echo "Checking root filesystem..."
+ fsck $spinner $force $fix /
+ #
+ # If there was a failure, drop into single-user mode.
+ #
+ # NOTE: "failure" is defined as exiting with a return code of
+ # 2 or larger. A return code of 1 indicates that filesystem
+ # errors were corrected but that the boot may proceed.
+ #
+ if test "$?" -gt 1
+ then
+ # Surprise! Re-directing from a HERE document (as in
+ # "cat << EOF") won't work, because the root is read-only.
+ echo
+ echo "fsck failed. Please repair manually and reboot. Please note"
+ echo "that the root filesystem is currently mounted read-only. To"
+ echo "remount it read-write:"
+ echo
+ echo " # mount -n -o remount,rw /"
+ echo
+ echo "CONTROL-D will exit from this shell and REBOOT the system."
+ echo
+ # Start a single user shell on the console
+ /sbin/sulogin $CONSOLE
+ reboot -f
+ fi
+ else
+ echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
+ echo
+ fi
+fi
+
+#
+# If the root filesystem was not marked as read-only in /etc/fstab,
+# remount the rootfs rw but do not try to change mtab because it
+# is on a ro fs until the remount succeeded. Then clean up old mtabs
+# and finally write the new mtab.
+#
+mount -n -o remount,$rootmode /
+if test "$rootmode" = rw
+then
+ ln -sf /proc/mounts /dev/mtab
+fi
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts b/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts
new file mode 100644
index 000000000..4a0978b40
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts
@@ -0,0 +1,5 @@
+# GID of the `tty' group
+TTYGRP=5
+
+# Set to 600 to have `mesg n' be the default
+TTYMODE=620
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
new file mode 100755
index 000000000..c6043fb1e
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: devpts
+# Required-Start: udev
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount /dev/pts file systems.
+### END INIT INFO
+
+. /etc/default/devpts
+
+if grep -q devpts /proc/filesystems
+then
+ #
+ # Create multiplexor device.
+ #
+ test -c /dev/ptmx || mknod -m 666 /dev/ptmx c 5 2
+
+ #
+ # Mount /dev/pts if needed.
+ #
+ if ! grep -q devpts /proc/mounts
+ then
+ mkdir -p /dev/pts
+ mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
+ fi
+fi
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
new file mode 100755
index 000000000..2b9eba64c
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: dmesg
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ -f /var/log/dmesg ]; then
+ if LOGPATH=$(which logrotate); then
+ $LOGPATH -f /etc/logrotate-dmesg.conf
+ else
+ mv -f /var/log/dmesg /var/log/dmesg.old
+ fi
+fi
+dmesg -s 131072 > /var/log/dmesg
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/functions b/poky/meta/recipes-core/initscripts/initscripts-1.0/functions
new file mode 100755
index 000000000..01ad1edd3
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -0,0 +1,91 @@
+# -*-Shell-script-*-
+#
+# functions This file contains functions to be used by most or all
+# shell scripts in the /etc/init.d directory.
+#
+
+NORMAL="\\033[0;39m" # Standard console grey
+SUCCESS="\\033[1;32m" # Success is green
+WARNING="\\033[1;33m" # Warnings are yellow
+FAILURE="\\033[1;31m" # Failures are red
+INFO="\\033[1;36m" # Information is light cyan
+BRACKET="\\033[1;34m" # Brackets are blue
+
+# NOTE: The pidofproc () doesn't support the process which is a script unless
+# the pidof supports "-x" option. If you want to use it for such a
+# process:
+# 1) If there is no "pidof -x", replace the "pidof $1" with another
+# command like(for core-image-minimal):
+# ps | awk '/'"$1"'/ {print $1}'
+# Or
+# 2) If there is "pidof -x", replace "pidof" with "pidof -x".
+#
+# pidofproc - print the pid of a process
+# $1: the name of the process
+pidofproc () {
+
+ # pidof output null when no program is running, so no "2>/dev/null".
+ pid=`pidof $1`
+ status=$?
+ case $status in
+ 0)
+ echo $pid
+ return 0
+ ;;
+ 127)
+ echo "ERROR: command pidof not found" >&2
+ exit 127
+ ;;
+ *)
+ return $status
+ ;;
+ esac
+}
+
+machine_id() { # return the machine ID
+ awk 'BEGIN { FS=": " } /Hardware/ \
+ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+ pid=`pidofproc $1` && kill $pid
+}
+
+status() {
+ local pid
+ if [ "$#" = 0 ]; then
+ echo "Usage: status {program}"
+ return 1
+ fi
+ pid=`pidofproc $1`
+ if [ -n "$pid" ]; then
+ echo "$1 (pid $pid) is running..."
+ return 0
+ else
+ echo "$1 is stopped"
+ fi
+ return 3
+}
+
+success() {
+ echo -n -e "${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
+ return 0
+}
+
+failure() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
+ return $rc
+}
+
+warning() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
+ return $rc
+}
+
+passed() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
+ return $rc
+}
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/halt b/poky/meta/recipes-core/initscripts/initscripts-1.0/halt
new file mode 100755
index 000000000..a56f73421
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/halt
@@ -0,0 +1,29 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: halt
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 0
+# Short-Description: Execute the halt command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# See if we need to cut the power.
+if test -x /etc/init.d/ups-monitor
+then
+ /etc/init.d/ups-monitor poweroff
+fi
+
+# Don't shut down drives if we're using RAID.
+hddown="-h"
+if grep -qs '^md.*active' /proc/mdstat
+then
+ hddown=""
+fi
+
+halt SED_HALTARGS -p $hddown
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
new file mode 100755
index 000000000..95287cc13
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hostname
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Set hostname based on /etc/hostname
+### END INIT INFO
+HOSTNAME=$(/bin/hostname)
+
+hostname -b -F /etc/hostname 2> /dev/null
+if [ $? -eq 0 ]; then
+ exit
+fi
+
+# Busybox hostname doesn't support -b so we need implement it on our own
+if [ -f /etc/hostname ];then
+ hostname `cat /etc/hostname`
+elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then
+ hostname localhost
+fi
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
new file mode 100644
index 000000000..6f46e4216
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
@@ -0,0 +1,9 @@
+# see "man logrotate" for details
+# rotate dmesg, and keep 5 versions.
+
+/var/log/dmesg {
+ create
+ rotate 5
+ nodateext
+}
+
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
new file mode 100755
index 000000000..c719be5d9
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountall
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount all filesystems.
+# Description:
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Mount local filesystems in /etc/fstab. For some reason, people
+# might want to mount "proc" several times, and mount -v complains
+# about this. So we mount "proc" filesystems without -v.
+#
+test "$VERBOSE" != no && echo "Mounting local filesystems..."
+mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+ rm -f /dev/initctl
+ mknod -m 600 /dev/initctl p
+fi
+kill -USR1 1
+
+#
+# Execute swapon command again, in case we want to swap to
+# a file on a now mounted filesystem.
+#
+[ -x /sbin/swapon ] && swapon -a
+
+: exit 0
+
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 000000000..fe6c19605
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountnfs
+# Required-Start: $local_fs $network $rpcbind
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+#
+# Run in a subshell because of I/O redirection.
+#
+test -f /etc/fstab && (
+
+#
+# Read through fstab line by line. If it is NFS, set the flag
+# for mounting NFS filesystems. If any NFS partition is found and it
+# not mounted with the nolock option, we start the rpcbind.
+#
+rpcbind=no
+mount_nfs=no
+mount_smb=no
+mount_ncp=no
+mount_cifs=no
+while read device mountpt fstype options
+do
+ case "$device" in
+ ""|\#*)
+ continue
+ ;;
+ esac
+
+ case "$options" in
+ *noauto*)
+ continue
+ ;;
+ esac
+
+ if test "$fstype" = nfs
+ then
+ mount_nfs=yes
+ case "$options" in
+ *nolock*)
+ ;;
+ *)
+ rpcbind=yes
+ ;;
+ esac
+ fi
+ if test "$fstype" = smbfs
+ then
+ mount_smb=yes
+ fi
+ if test "$fstype" = ncpfs
+ then
+ mount_ncp=yes
+ fi
+ if test "$fstype" = cifs
+ then
+ mount_cifs=yes
+ fi
+done
+
+exec 0>&1
+
+if test "$rpcbind" = yes
+then
+ if test -x /usr/sbin/rpcbind
+ then
+ echo -n "Starting rpcbind... "
+ start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
+ sleep 2
+ fi
+fi
+
+if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes
+then
+ echo "Mounting remote filesystems..."
+ test "$mount_nfs" = yes && mount -a -t nfs
+ test "$mount_smb" = yes && mount -a -t smbfs
+ test "$mount_ncp" = yes && mount -a -t ncpfs
+ test "$mount_cifs" = yes && mount -a -t cifs
+fi
+
+) < /etc/fstab
+
+: exit 0
+
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
new file mode 100755
index 000000000..35316ec2b
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -0,0 +1,244 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: volatile
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Populate the volatile filesystem
+### END INIT INFO
+
+# Get ROOT_DIR
+DIRNAME=`dirname $0`
+ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
+
+[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
+# When running populate-volatile.sh at rootfs time, disable cache.
+[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
+# If rootfs is read-only, disable cache.
+[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
+
+CFGDIR="${ROOT_DIR}/etc/default/volatiles"
+TMPROOT="${ROOT_DIR}/var/volatile/tmp"
+COREDEF="00_core"
+
+[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
+
+create_file() {
+ EXEC=""
+ [ -z "$2" ] && {
+ EXEC="
+ touch \"$1\";
+ "
+ } || {
+ EXEC="
+ cp \"$2\" \"$1\";
+ "
+ }
+ EXEC="
+ ${EXEC}
+ chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+ chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+
+ [ -e "$1" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+ } || {
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # Creating some files at rootfs time may fail and should fail,
+ # but these failures should not be logged to make sure the do_rootfs
+ # process doesn't fail. This does no harm, as this script will
+ # run on target to set up the correct files and directories.
+ eval $EXEC > /dev/null 2>&1
+ fi
+ }
+}
+
+mk_dir() {
+ EXEC="
+ mkdir -p \"$1\";
+ chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+ chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+ [ -e "$1" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+ } || {
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # For the same reason with create_file(), failures should
+ # not be logged.
+ eval $EXEC > /dev/null 2>&1
+ fi
+ }
+}
+
+link_file() {
+ EXEC="
+ if [ -L \"$2\" ]; then
+ [ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+ elif [ -d \"$2\" ]; then
+ if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
+ cp -a $2/* $1 2>/dev/null;
+ cp -a $2/.[!.]* $1 2>/dev/null;
+ rm -rf \"$2\";
+ ln -sf \"$1\" \"$2\";
+ fi
+ else
+ ln -sf \"$1\" \"$2\";
+ fi
+ "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build
+
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # For the same reason with create_file(), failures should
+ # not be logged.
+ eval $EXEC > /dev/null 2>&1
+ fi
+}
+
+check_requirements() {
+ cleanup() {
+ rm "${TMP_INTERMED}"
+ rm "${TMP_DEFINED}"
+ rm "${TMP_COMBINED}"
+ }
+
+ CFGFILE="$1"
+ [ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0
+
+ TMP_INTERMED="${TMPROOT}/tmp.$$"
+ TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
+ TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
+
+ sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > "${TMP_DEFINED}"
+ cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
+ cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+ NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
+ NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
+
+ [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
+ echo "Undefined users:"
+ diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+ cleanup
+ return 1
+ }
+
+
+ sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > "${TMP_DEFINED}"
+ cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
+ cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+
+ NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
+ NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
+
+ [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
+ echo "Undefined groups:"
+ diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+ cleanup
+ return 1
+ }
+
+ # Add checks for required directories here
+
+ cleanup
+ return 0
+}
+
+apply_cfgfile() {
+ CFGFILE="$1"
+
+ check_requirements "${CFGFILE}" || {
+ echo "Skipping ${CFGFILE}"
+ return 1
+ }
+
+ cat ${CFGFILE} | sed 's/#.*//' | \
+ while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do
+ test -z "${TLTARGET}" && continue
+ TNAME=${ROOT_DIR}${TNAME}
+ [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
+
+ [ "${TTYPE}" = "l" ] && {
+ TSOURCE="$TLTARGET"
+ [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
+ link_file "${TSOURCE}" "${TNAME}"
+ continue
+ }
+
+ [ "${TTYPE}" = "b" ] && {
+ TSOURCE="$TLTARGET"
+ [ "${VERBOSE}" != "no" ] && echo "Creating mount-bind -${TNAME}- from -${TSOURCE}-."
+ mount --bind "${TSOURCE}" "${TNAME}"
+ EXEC="
+ mount --bind \"${TSOURCE}\" \"${TNAME}\""
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+ continue
+ }
+
+ [ -L "${TNAME}" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Found link."
+ NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
+ echo ${NEWNAME} | grep -v "^/" >/dev/null && {
+ TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
+ [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
+ } || {
+ TNAME="${NEWNAME}"
+ [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
+ }
+ }
+
+ case "${TTYPE}" in
+ "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
+ TSOURCE="$TLTARGET"
+ [ "${TSOURCE}" = "none" ] && TSOURCE=""
+ create_file "${TNAME}" "${TSOURCE}" &
+ ;;
+ "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
+ mk_dir "${TNAME}"
+ # Add check to see if there's an entry in fstab to mount.
+ ;;
+ *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
+ continue
+ ;;
+ esac
+ done
+ return 0
+}
+
+clearcache=0
+exec 9</proc/cmdline
+while read line <&9
+do
+ case "$line" in
+ *clearcache*) clearcache=1
+ ;;
+ *) continue
+ ;;
+ esac
+done
+exec 9>&-
+
+if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
+then
+ sh ${ROOT_DIR}/etc/volatile.cache
+else
+ rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build
+ for file in `ls -1 "${CFGDIR}" | sort`; do
+ apply_cfgfile "${CFGDIR}/${file}"
+ done
+
+ [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
+fi
+
+if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
+then
+ ln -s /etc/ld.so.cache /var/run/ld.so.cache
+fi
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
new file mode 100644
index 000000000..1a0328d63
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. /etc/default/rcS
+
+[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
+
+is_on_read_only_partition () {
+ DIRECTORY=$1
+ dir=`readlink -f $DIRECTORY`
+ while true; do
+ if [ ! -d "$dir" ]; then
+ echo "ERROR: $dir is not a directory"
+ exit 1
+ else
+ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
+ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
+ [ "$flag" = "FOUND" ] && partition="read-write"
+ [ "$flag" = "ro" ] && { partition="read-only"; break; }
+ done
+ if [ "$dir" = "/" -o -n "$partition" ]; then
+ break
+ else
+ dir=`dirname $dir`
+ fi
+ fi
+ done
+ [ "$partition" = "read-only" ] && echo "yes" || echo "no"
+}
+
+if [ "$1" = "start" ] ; then
+ if [ `is_on_read_only_partition /var/lib` = "yes" ]; then
+ grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
+ mkdir -p /var/volatile/lib
+ cp -a /var/lib/* /var/volatile/lib
+ mount --bind /var/volatile/lib /var/lib
+ fi
+fi
+
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot b/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot
new file mode 100755
index 000000000..087d8d5da
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot
@@ -0,0 +1,15 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: reboot
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 6
+# Short-Description: Execute the reboot command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo -n "Rebooting... "
+reboot SED_HALTARGS
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
new file mode 100755
index 000000000..76de3418a
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: rmnologin
+# Required-Start: $remote_fs $all
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Remove /etc/nologin at boot
+# Description: This script removes the /etc/nologin file as the
+# last step in the boot process, if DELAYLOGIN=yes.
+# If DELAYLOGIN=no, /etc/nologin was not created by
+# bootmisc earlier in the boot process.
+### END INIT INFO
+
+if test -f /etc/nologin.boot
+then
+ rm -f /etc/nologin /etc/nologin.boot
+fi
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
new file mode 100644
index 000000000..1632a5f64
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: save-rtc
+# Required-Start:
+# Required-Stop: $local_fs hwclock
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Store system clock into file
+# Description:
+### END INIT INFO
+
+# Update the timestamp
+date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > /etc/timestamp
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
new file mode 100755
index 000000000..34e1b7714
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
@@ -0,0 +1,21 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: sendsigs
+# Required-Start:
+# Required-Stop: umountnfs
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Kill all remaining processes.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/single b/poky/meta/recipes-core/initscripts/initscripts-1.0/single
new file mode 100755
index 000000000..da82d178a
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/single
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: single
+# Required-Start: $local_fs $all killprocs
+# Required-Stop:
+# Default-Start: 1
+# Default-Stop:
+# Short-Description: executed by init(8) upon entering runlevel 1 (single).
+### END INIT INFO
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+# We start update here, since we just killed it.
+test -x /sbin/update && update
+
+echo "Entering single-user mode..."
+exec init -t1 S
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell b/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell
new file mode 100644
index 000000000..c319d95bf
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -z "$SUSHELL" ] && SUSHELL=/bin/sh
+
+exec $SUSHELL
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
new file mode 100644
index 000000000..f5b5b9904
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountvirtfs
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount kernel virtual file systems.
+# Description: Mount initial set of virtual filesystems the kernel
+# provides and that are required by everything.
+### END INIT INFO
+
+if [ -e /proc ] && ! [ -e /proc/mounts ]; then
+ mount -t proc proc /proc
+fi
+
+if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
+ mount -t sysfs sysfs /sys
+fi
+
+if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
+ mount -t debugfs debugfs /sys/kernel/debug
+fi
+
+if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then
+ mount -t configfs configfs /sys/kernel/config
+fi
+
+if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
+ mount -n -t devtmpfs devtmpfs /dev
+fi
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs
new file mode 100755
index 000000000..7fb5c58b3
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: umountfs
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Turn off swap and unmount all local file systems.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo "Deactivating swap..."
+[ -x /sbin/swapoff ] && swapoff -a
+
+# We leave /proc mounted.
+echo "Unmounting local filesystems..."
+grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
+mount -o remount,ro /
+
+umount -f -a -r > /dev/null 2>&1
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
new file mode 100755
index 000000000..af075407f
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: umountnfs
+# Required-Start:
+# Required-Stop: umountfs
+# Should-Stop: $network $portmap
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Unmount all network filesystems
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Write a reboot record to /var/log/wtmp before unmounting
+halt -w
+
+echo "Unmounting remote filesystems..."
+
+test -f /etc/fstab && (
+
+#
+# Read through fstab line by line and unount network file systems
+#
+while read device mountpt fstype options
+do
+ if test "$fstype" = nfs || test "$fstype" = smbfs || test "$fstype" = ncpfs || test "$fstype" = cifs
+ then
+ umount -f $mountpt
+ fi
+done
+) < /etc/fstab
+
+: exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom b/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom
new file mode 100755
index 000000000..af1625b5f
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom
@@ -0,0 +1,49 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: urandom
+# Required-Start: $local_fs mountvirtfs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Save and restore the random seed
+# Description: Save the random seed on shutdown and restore it on boot,
+# to ensure that the seed isn't predicable on startup
+# (because the boot process is predictable)
+### END INIT INFO
+
+test -c /dev/urandom || exit 0
+
+RANDOM_SEED_FILE=/var/lib/urandom/random-seed
+
+. /etc/default/rcS
+[ -f /etc/default/urandom ] && . /etc/default/urandom
+
+case "$1" in
+ start|"")
+ test "$VERBOSE" != no && echo "Initializing random number generator..."
+ # Load and then save 512 bytes, which is the size of the entropy
+ # pool. Also load the current date, in case the seed file is
+ # empty.
+ ( date +%s.%N; [ -f "$RANDOM_SEED_FILE" ] && cat "$RANDOM_SEED_FILE" ) \
+ >/dev/urandom
+ rm -f "$RANDOM_SEED_FILE"
+ umask 077
+ dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+ >/dev/null 2>&1 || echo "urandom start: failed."
+ umask 022
+ ;;
+ stop)
+ # Carry a random seed from shut-down to start-up;
+ # see documentation in linux/drivers/char/random.c
+ test "$VERBOSE" != no && echo "Saving random seed..."
+ umask 077
+ dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+ >/dev/null 2>&1 || echo "urandom stop: failed."
+ ;;
+ *)
+ echo "Usage: urandom {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
new file mode 100644
index 000000000..201106645
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -0,0 +1,37 @@
+# This configuration file lists filesystem objects that should get verified
+# during startup and be created if missing.
+#
+# Entries have the following format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# The # character introduces a comment lasting until end of line.
+# Blank lines are ignored.
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check it's existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
+d root root 1777 /run/lock none
+d root root 0755 /var/volatile/log none
+d root root 1777 /var/volatile/tmp none
+l root root 1777 /var/lock /run/lock
+l root root 0755 /var/run /run
+l root root 1777 /var/tmp /var/volatile/tmp
+l root root 1777 /tmp /var/tmp
+d root root 0755 /var/lock/subsys none
+f root root 0664 /var/log/wtmp none
+f root root 0664 /var/run/utmp none
+l root root 0644 /etc/resolv.conf /var/run/resolv.conf
+f root root 0644 /var/run/resolv.conf none
diff --git a/poky/meta/recipes-core/initscripts/initscripts_1.0.bb b/poky/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 000000000..91eea4b8c
--- /dev/null
+++ b/poky/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,186 @@
+SUMMARY = "SysV init scripts"
+HOMEPAGE = "https://github.com/fedora-sysv/initscripts"
+DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+PR = "r155"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://functions \
+ file://halt \
+ file://umountfs \
+ file://devpts.sh \
+ file://devpts \
+ file://hostname.sh \
+ file://mountall.sh \
+ file://banner.sh \
+ file://bootmisc.sh \
+ file://mountnfs.sh \
+ file://reboot \
+ file://checkfs.sh \
+ file://single \
+ file://sendsigs \
+ file://urandom \
+ file://rmnologin.sh \
+ file://checkroot.sh \
+ file://umountnfs.sh \
+ file://sysfs.sh \
+ file://populate-volatile.sh \
+ file://read-only-rootfs-hook.sh \
+ file://volatiles \
+ file://save-rtc.sh \
+ file://GPLv2.patch \
+ file://dmesg.sh \
+ file://logrotate-dmesg.conf \
+ ${@bb.utils.contains('DISTRO_FEATURES','selinux','file://sushell','',d)} \
+"
+
+S = "${WORKDIR}"
+
+SRC_URI_append_arm = " file://alignment.sh"
+
+KERNEL_VERSION = ""
+
+DEPENDS_append = " update-rc.d-native"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+
+PACKAGES =+ "${PN}-functions ${PN}-sushell"
+RDEPENDS_${PN} = "initd-functions \
+ ${@bb.utils.contains('DISTRO_FEATURES','selinux','${PN}-sushell','',d)} \
+ "
+# Recommend pn-functions so that it will be a preferred default provider for initd-functions
+RRECOMMENDS_${PN} = "${PN}-functions"
+RPROVIDES_${PN}-functions = "initd-functions"
+RCONFLICTS_${PN}-functions = "lsbinitscripts"
+FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
+FILES_${PN}-sushell = "${base_sbindir}/sushell"
+
+HALTARGS ?= "-d -f"
+
+do_configure() {
+ sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
+ sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
+}
+
+do_install () {
+#
+# Create directories and install device independent scripts
+#
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+ install -d ${D}${sysconfdir}/rc0.d
+ install -d ${D}${sysconfdir}/rc1.d
+ install -d ${D}${sysconfdir}/rc2.d
+ install -d ${D}${sysconfdir}/rc3.d
+ install -d ${D}${sysconfdir}/rc4.d
+ install -d ${D}${sysconfdir}/rc5.d
+ install -d ${D}${sysconfdir}/rc6.d
+ install -d ${D}${sysconfdir}/default
+ install -d ${D}${sysconfdir}/default/volatiles
+ # Holds state information pertaining to urandom
+ install -d ${D}${localstatedir}/lib/urandom
+
+ install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/halt ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/hostname.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/mountall.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/mountnfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/reboot ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/rmnologin.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/sendsigs ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/single ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/umountnfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/urandom ${D}${sysconfdir}/init.d
+ sed -i ${D}${sysconfdir}/init.d/urandom -e 's,/var/,${localstatedir}/,g;s,/etc/,${sysconfdir}/,g'
+ install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
+ if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
+ echo "l root root 0755 /var/log /var/volatile/log" >> ${D}${sysconfdir}/default/volatiles/00_core
+ fi
+ install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
+
+ if [ "${TARGET_ARCH}" = "arm" ]; then
+ install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','selinux','true','false',d)}; then
+ install -d ${D}/${base_sbindir}
+ install -m 0755 ${WORKDIR}/sushell ${D}/${base_sbindir}
+ fi
+#
+# Install device dependent scripts
+#
+ install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh
+ install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs
+#
+# Create runlevel links
+#
+ update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
+ update-rc.d -r ${D} sendsigs start 20 0 6 .
+ update-rc.d -r ${D} urandom start 38 S 0 6 .
+ update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
+ update-rc.d -r ${D} umountfs start 40 0 6 .
+ update-rc.d -r ${D} reboot start 90 6 .
+ update-rc.d -r ${D} halt start 90 0 .
+ update-rc.d -r ${D} save-rtc.sh start 25 0 6 .
+ update-rc.d -r ${D} banner.sh start 02 S .
+ update-rc.d -r ${D} checkroot.sh start 06 S .
+ update-rc.d -r ${D} mountall.sh start 03 S .
+ update-rc.d -r ${D} hostname.sh start 39 S .
+ update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 .
+ update-rc.d -r ${D} bootmisc.sh start 36 S .
+ update-rc.d -r ${D} sysfs.sh start 02 S .
+ update-rc.d -r ${D} populate-volatile.sh start 37 S .
+ update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
+ update-rc.d -r ${D} devpts.sh start 06 S .
+ if [ "${TARGET_ARCH}" = "arm" ]; then
+ update-rc.d -r ${D} alignment.sh start 06 S .
+ fi
+ # We wish to have /var/log ready at this stage so execute this after
+ # populate-volatile.sh
+ update-rc.d -r ${D} dmesg.sh start 38 S .
+}
+
+MASKED_SCRIPTS = " \
+ banner \
+ bootmisc \
+ checkfs \
+ checkroot \
+ devpts \
+ dmesg \
+ hostname \
+ mountall \
+ mountnfs \
+ populate-volatile \
+ read-only-rootfs-hook \
+ rmnologin \
+ sysfs \
+ urandom"
+
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ for SERVICE in ${MASKED_SCRIPTS}; do
+ systemctl $OPTS mask $SERVICE.service
+ done
+ fi
+
+ # Delete any old volatile cache script, as directories may have moved
+ if [ -z "$D" ]; then
+ rm -f "/etc/volatile.cache"
+ fi
+}
+
+CONFFILES_${PN} += "${sysconfdir}/init.d/checkroot.sh"
diff --git a/poky/meta/recipes-core/kbd/kbd/run-ptest b/poky/meta/recipes-core/kbd/kbd/run-ptest
new file mode 100644
index 000000000..7a2d205f5
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+CURDIR=$(dirname `readlink -f $0`)
+make -k -C ${CURDIR}/tests check-TESTS
diff --git a/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch b/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
new file mode 100644
index 000000000..a9a3ab8ab
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+kbd is out of source built, then the value of $(srcdir) is relative path of
+${S}/tests to ${B}/tests. Macro DATADIR is defined with $(srcdir) and replaced
+in .c files by compiler, and string @DATADIR@ is replaced with $(srdir) by rule
+"%: %.in" in Makefile.
+
+But kbd-ptest puts test cases and resource files in same directory, then some
+ptest cases fail to find resources.
+
+Replace DATADIR and @DATADIR@ with current directory(dot) to make test cases
+run as expected.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Index: kbd-2.0.4/tests/Makefile.am
+===================================================================
+--- kbd-2.0.4.orig/tests/Makefile.am
++++ kbd-2.0.4/tests/Makefile.am
+@@ -1,7 +1,7 @@
+ AM_CPPFLAGS = \
+ -I$(srcdir)/../src/libkeymap \
+ -I$(builddir)/../src/libkeymap \
+- -DDATADIR=\"$(srcdir)\" -DBUILDDIR=\"$(builddir)\"
++ -DDATADIR=\".\" -DBUILDDIR=\"$(builddir)\"
+
+ AM_CFLAGS = $(CHECK_CFLAGS)
+ LDADD = $(top_builddir)/src/libkeymap/libkeymap.la $(CHECK_LIBS) @INTLLIBS@
+Index: kbd-2.0.4/tests/alt-is-meta.in
+===================================================================
+--- kbd-2.0.4.orig/tests/alt-is-meta.in
++++ kbd-2.0.4/tests/alt-is-meta.in
+@@ -7,8 +7,8 @@ cd "$cwd"
+ rc=0
+ temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"
+
+-./libkeymap-showmaps "@DATADIR@"/alt-is-meta.map > "$temp" || rc=$?
+-cmp -s "@DATADIR@//alt-is-meta.output" "$temp" || rc=$?
++./libkeymap-showmaps ./alt-is-meta.map > "$temp" || rc=$?
++cmp -s "./alt-is-meta.output" "$temp" || rc=$?
+
+ if [ "$rc" != 0 ]; then
+ printf 'failed\n'
+Index: kbd-2.0.4/tests/dumpkeys-fulltable.in
+===================================================================
+--- kbd-2.0.4.orig/tests/dumpkeys-fulltable.in
++++ kbd-2.0.4/tests/dumpkeys-fulltable.in
+@@ -5,7 +5,7 @@ cwd="$(readlink -ev "${0%/*}")"
+ cd "$cwd"
+
+ BUILDDIR="@BUILDDIR@"
+-DATADIR="@DATADIR@"
++DATADIR="."
+
+ check_keymap() {
+ local kmap temp rc
diff --git a/poky/meta/recipes-core/kbd/kbd_2.0.4.bb b/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
new file mode 100644
index 000000000..4af3256ff
--- /dev/null
+++ b/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Keytable files and keyboard utilities"
+HOMEPAGE = "http://www.kbd-project.org/"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+
+inherit autotools gettext ptest pkgconfig
+
+RREPLACES_${PN} = "console-tools"
+RPROVIDES_${PN} = "console-tools"
+RCONFLICTS_${PN} = "console-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+ file://run-ptest \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
+ "
+
+SRC_URI[md5sum] = "c1635a5a83b63aca7f97a3eab39ebaa6"
+SRC_URI[sha256sum] = "5fd90af6beb225a9bb9b9fb414c090fba53c9a55793e172f508cd43652e59a88"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests','', d)} \
+ "
+
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+PACKAGECONFIG[tests] = "--enable-tests, --disable-tests, libcheck"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
+}
+
+do_install_ptest() {
+ install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
+ sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+ -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+ -e 's:${DEBUG_PREFIX_MAP}::g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${S}/config/missing::g' \
+ -e 's:${WORKDIR}::g' \
+ -e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
+
+ find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
+ find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
+
+ install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
+}
+
+PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
+
+FILES_${PN}-consolefonts = "${datadir}/consolefonts"
+FILES_${PN}-consoletrans = "${datadir}/consoletrans"
+FILES_${PN}-keymaps = "${datadir}/keymaps"
+FILES_${PN}-unimaps = "${datadir}/unimaps"
+
+RDEPENDS_${PN}-ptest = "make"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt showkey"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
new file mode 100644
index 000000000..65f4ef9a5
--- /dev/null
+++ b/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
@@ -0,0 +1,235 @@
+commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date: Fri Sep 5 22:35:32 2014 -0700
+
+ Remove __.*DECLS nonsense
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libcgroup-0.41/include/libcgroup/config.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/config.h
++++ libcgroup-0.41/include/libcgroup/config.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_config 5. Configuration
+@@ -107,6 +109,8 @@ int cgroup_config_create_template_group(
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /*_LIBCGROUP_CONFIG_H*/
+Index: libcgroup-0.41/include/libcgroup/error.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/error.h
++++ libcgroup-0.41/include/libcgroup/error.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_errors 6. Error handling
+@@ -99,6 +101,8 @@ int cgroup_get_last_errno(void);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/groups.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/groups.h
++++ libcgroup-0.41/include/libcgroup/groups.h
+@@ -11,7 +11,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * Flags for cgroup_delete_cgroup_ext().
+@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro
+ */
+
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_GROUPS_H */
+Index: libcgroup-0.41/include/libcgroup/init.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/init.h
++++ libcgroup-0.41/include/libcgroup/init.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_init 1. Initialization
+@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/iterators.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/iterators.h
++++ libcgroup-0.41/include/libcgroup/iterators.h
+@@ -11,7 +11,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_iterators 3. Iterators
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo
+ * @}
+ */
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_ITERATORS_H */
+Index: libcgroup-0.41/include/libcgroup/tasks.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/tasks.h
++++ libcgroup-0.41/include/libcgroup/tasks.h
+@@ -12,7 +12,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /** Flags for cgroup_change_cgroup_uid_gid(). */
+ enum cgflags {
+@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_TASKS_H */
+Index: libcgroup-0.41/src/daemon/cgrulesengd.h
+===================================================================
+--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h
++++ libcgroup-0.41/src/daemon/cgrulesengd.h
+@@ -17,7 +17,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include "libcgroup.h"
+@@ -119,7 +121,9 @@ void cgre_flash_templates(int signum);
+ */
+ void cgre_catch_term(int signum);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _CGRULESENGD_H */
+
+Index: libcgroup-0.41/src/libcgroup-internal.h
+===================================================================
+--- libcgroup-0.41.orig/src/libcgroup-internal.h
++++ libcgroup-0.41/src/libcgroup-internal.h
+@@ -16,7 +16,9 @@
+
+ #define __LIBCG_INTERNAL
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include <fts.h>
+@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e
+ */
+ int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+Index: libcgroup-0.41/include/libcgroup/log.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/log.h
++++ libcgroup-0.41/include/libcgroup/log.h
+@@ -11,7 +11,9 @@
+
+ #include <stdarg.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_log 7. Logging
+@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_LOG_H */
diff --git a/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
new file mode 100644
index 000000000..7ddc81e9b
--- /dev/null
+++ b/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Linux control group abstraction library"
+HOMEPAGE = "http://libcg.sourceforge.net/"
+DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
+in Linux. Control groups allow you to limit, account and isolate resource usage \
+(CPU, memory, disk I/O, etc.) of groups of processes."
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+inherit autotools pkgconfig
+
+DEPENDS = "bison-native flex-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2"
+SRC_URI_append_libc-musl = " file://musl-decls-compat.patch"
+
+SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
+SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libcg/files/libcgroup/"
+
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = " LIBS=-lfts"
+
+PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam"
+
+PACKAGES =+ "cgroups-pam-plugin"
+FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
+FILES_${PN}-dev += "${base_libdir}/security/*.la"
+
+do_install_append() {
+ # Moving libcgroup to base_libdir
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mkdir -p ${D}/${base_libdir}/
+ mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/
+ rm -f ${D}${libdir}/libcgroup.so
+ lnr ${D}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so
+ fi
+ # pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks.
+ if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then
+ mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so
+ rm -f ${D}${base_libdir}/security/pam_cgroup.so.*
+ fi
+}
diff --git a/poky/meta/recipes-core/libxcrypt/libxcrypt_4.0.1.bb b/poky/meta/recipes-core/libxcrypt/libxcrypt_4.0.1.bb
new file mode 100644
index 000000000..6ed67a676
--- /dev/null
+++ b/poky/meta/recipes-core/libxcrypt/libxcrypt_4.0.1.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Extended cryptographic library (from glibc)"
+DESCRIPTION = "Forked code from glibc libary to extract only crypto part."
+HOMEPAGE = "https://github.com/besser82/libxcrypt"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSING;md5=d1cc18f512ded3bd6000f3729f31be08 \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
+"
+
+inherit autotools
+
+SRCREV ?= "089479bb24acd168613757a6f12d63caa95416b4"
+SRCBRANCH ?= "master"
+
+SRC_URI = "git://github.com/besser82/libxcrypt.git;branch=${SRCBRANCH} \
+ "
+
+PROVIDES = "virtual/crypt"
+
+FILES_${PN} = "${libdir}/libcrypt*.so.* ${libdir}/libcrypt-*.so ${libdir}/libowcrypt*.so.* ${libdir}/libowcrypt-*.so"
+
+S = "${WORKDIR}/git"
+
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE} -std=gnu99"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+python () {
+ if not bb.data.inherits_class('nativesdk', d):
+ raise bb.parse.SkipRecipe("Recipe only applies in nativesdk case for now")
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch b/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
new file mode 100644
index 000000000..2b92dbc8d
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
@@ -0,0 +1,96 @@
+From 78dbd4c09d617a9cb730d796f94ee4d93840d3cc Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 9 Jun 2017 17:50:46 +0200
+Subject: [PATCH] Make ptest run the python tests if python is enabled
+
+One of the tests (tstLastError.py) needed a minor correction. It might
+be due to the fact that the tests are forced to run with Python 3.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ Makefile.am | 2 +-
+ python/Makefile.am | 9 +++++++++
+ python/tests/Makefile.am | 12 ++++++++++--
+ python/tests/tstLastError.py | 2 +-
+ 4 files changed, 21 insertions(+), 4 deletions(-)
+
+Index: libxml2-2.9.7/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/Makefile.am
++++ libxml2-2.9.7/Makefile.am
+@@ -207,9 +207,9 @@ install-ptest:
+ install $(check_PROGRAMS) $(DESTDIR))
+ cp -r $(srcdir)/test $(DESTDIR)
+ cp -r $(srcdir)/result $(DESTDIR)
+- cp -r $(srcdir)/python $(DESTDIR)
+ cp Makefile $(DESTDIR)
+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++ $(MAKE) -C python install-ptest
+
+ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
+Index: libxml2-2.9.7/python/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/python/Makefile.am
++++ libxml2-2.9.7/python/Makefile.am
+@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class
+
+ $(GENERATED): $(srcdir)/generator.py $(API_DESC)
+ $(PYTHON) $(srcdir)/generator.py $(srcdir)
++
++install-ptest:
++ cp -r $(srcdir) $(DESTDIR)
++ sed -e 's|^Makefile:|_Makefile:|' \
++ -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
++ $(MAKE) -C tests install-ptest
++else
++install-ptest:
+ endif
+
++.PHONY: tests test
+ tests test: all
+ cd tests && $(MAKE) tests
+Index: libxml2-2.9.7/python/tests/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/python/tests/Makefile.am
++++ libxml2-2.9.7/python/tests/Makefile.am
+@@ -59,6 +59,11 @@ XMLS= \
+ CLEANFILES = core tmp.xml *.pyc
+
+ if WITH_PYTHON
++install-ptest:
++ cp -r $(srcdir) $(DESTDIR)/python
++ sed -e 's|^Makefile:|_Makefile:|' \
++ -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
++
+ tests: $(PYTESTS)
+ @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
+ @echo "## running Python regression tests"
+@@ -68,8 +73,11 @@ tests: $(PYTESTS)
+ export LD_LIBRARY_PATH; \
+ for test in $(PYTESTS) ; \
+ do log=`$(PYTHON) $(srcdir)/$$test` ; \
+- if [ "`echo $$log | grep OK`" = "" ] ; then \
+- echo "-- $$test" ; echo "$$log" ; fi ; done)
++ if [ "`echo $$log | grep OK`" ]; then \
++ echo "PASS: $$test"; else \
++ echo "$$log"; echo "FAIL: $$test"; fi; done)
+ else
++install-ptest:
++
+ tests:
+ endif
+Index: libxml2-2.9.7/python/tests/tstLastError.py
+===================================================================
+--- libxml2-2.9.7.orig/python/tests/tstLastError.py
++++ libxml2-2.9.7/python/tests/tstLastError.py
+@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase):
+ when the exception is raised, check the libxml2.lastError for
+ expected values."""
+ # disable the default error handler
+- libxml2.registerErrorHandler(None,None)
++ libxml2.registerErrorHandler(lambda ctx,str: None,None)
+ try:
+ f(*args)
+ except exc:
diff --git a/poky/meta/recipes-core/libxml/libxml2/ansidecl.patch b/poky/meta/recipes-core/libxml/libxml2/ansidecl.patch
new file mode 100644
index 000000000..1085c680b
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/ansidecl.patch
@@ -0,0 +1,25 @@
+Sadly cmake is broken. If it sees this reference and ansidecl is present, it will add a
+dependency upon it, even if HAVE_ANSIDEC_H is never set.
+
+The easiest solution is to remove these lines, otherwise recipes like libzypp can have a
+dependency on the ansidecl.h header via cmake. This can lead to odd results if the
+header is removed (clean binutils) and then the code is recompiled.
+
+RP 2012/7/10
+
+Upstream-Status: Inappropriate [its really a cmake bug]
+
+diff --git a/configure.ac b/configure.ac
+index 0260281..fdb58e9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -484 +483,0 @@ AC_CHECK_HEADERS([time.h])
+-AC_CHECK_HEADERS([ansidecl.h])
+diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
+index b173be9..d10f975 100644
+--- a/include/libxml/xmlversion.h.in
++++ b/include/libxml/xmlversion.h.in
+@@ -413,3 +412,0 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
+-#ifdef HAVE_ANSIDECL_H
+-#include <ansidecl.h>
+-#endif
diff --git a/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch b/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch
new file mode 100644
index 000000000..51a9e1935
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch
@@ -0,0 +1,21 @@
+Make sure that Makefile doesn't try to compile these tests again
+on the target where the source dependencies won't be available.
+
+Upstream-Status: Inappropriate [cross-compile specific]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+
+Index: libxml2-2.9.7/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/Makefile.am
++++ libxml2-2.9.7/Makefile.am
+@@ -211,8 +211,7 @@ install-ptest:
+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
+ $(MAKE) -C python install-ptest
+
+-runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+- testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
++runtests:
+ [ -d test ] || $(LN_S) $(srcdir)/test .
+ [ -d result ] || $(LN_S) $(srcdir)/result .
+ $(CHECKER) ./runtest$(EXEEXT) && \
diff --git a/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
new file mode 100644
index 000000000..1147017b6
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Backport [from debian: bugs.debian.org/439843]
+
+---
+ libxml.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- libxml2-2.6.29.orig/libxml.h
++++ libxml2-2.6.29/libxml.h
+@@ -11,10 +11,13 @@
+
+ #ifndef NO_LARGEFILE_SOURCE
+ #ifndef _LARGEFILE_SOURCE
+ #define _LARGEFILE_SOURCE
+ #endif
++#ifndef _LARGEFILE64_SOURCE
++#define _LARGEFILE64_SOURCE
++#endif
+ #ifndef _FILE_OFFSET_BITS
+ #define _FILE_OFFSET_BITS 64
+ #endif
+ #endif
+
diff --git a/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
new file mode 100644
index 000000000..d9ed1516f
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
@@ -0,0 +1,204 @@
+AM_PATH_XML2 uses xml-config which we disable through
+binconfig-disabled.bbclass, so port it to use pkg-config instead.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/libxml.m4 b/libxml.m4
+index 68cd824..5fa0a9b 100644
+--- a/libxml.m4
++++ b/libxml.m4
+@@ -1,188 +1,12 @@
+-# Configure paths for LIBXML2
+-# Mike Hommey 2004-06-19
+-# use CPPFLAGS instead of CFLAGS
+-# Toshio Kuratomi 2001-04-21
+-# Adapted from:
+-# Configure paths for GLIB
+-# Owen Taylor 97-11-3
+-
+ dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+ dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
+ dnl
+-AC_DEFUN([AM_PATH_XML2],[
+-AC_ARG_WITH(xml-prefix,
+- [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
+- xml_config_prefix="$withval", xml_config_prefix="")
+-AC_ARG_WITH(xml-exec-prefix,
+- [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
+- xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
+-AC_ARG_ENABLE(xmltest,
+- [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
+- enable_xmltest=yes)
+-
+- if test x$xml_config_exec_prefix != x ; then
+- xml_config_args="$xml_config_args"
+- if test x${XML2_CONFIG+set} != xset ; then
+- XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
+- fi
+- fi
+- if test x$xml_config_prefix != x ; then
+- xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
+- if test x${XML2_CONFIG+set} != xset ; then
+- XML2_CONFIG=$xml_config_prefix/bin/xml2-config
+- fi
+- fi
+-
+- AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
+- min_xml_version=ifelse([$1], ,2.0.0,[$1])
+- AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
+- no_xml=""
+- if test "$XML2_CONFIG" = "no" ; then
+- no_xml=yes
+- else
+- XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
+- XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
+- xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+- xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+- xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+- if test "x$enable_xmltest" = "xyes" ; then
+- ac_save_CPPFLAGS="$CPPFLAGS"
+- ac_save_LIBS="$LIBS"
+- CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+- LIBS="$XML_LIBS $LIBS"
+-dnl
+-dnl Now check if the installed libxml is sufficiently new.
+-dnl (Also sanity checks the results of xml2-config to some extent)
+-dnl
+- rm -f conf.xmltest
+- AC_TRY_RUN([
+-#include <stdlib.h>
+-#include <stdio.h>
+-#include <string.h>
+-#include <libxml/xmlversion.h>
+-
+-int
+-main()
+-{
+- int xml_major_version, xml_minor_version, xml_micro_version;
+- int major, minor, micro;
+- char *tmp_version;
+-
+- system("touch conf.xmltest");
+-
+- /* Capture xml2-config output via autoconf/configure variables */
+- /* HP/UX 9 (%@#!) writes to sscanf strings */
+- tmp_version = (char *)strdup("$min_xml_version");
+- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+- printf("%s, bad version string from xml2-config\n", "$min_xml_version");
+- exit(1);
+- }
+- free(tmp_version);
+-
+- /* Capture the version information from the header files */
+- tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
+- if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
+- printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
+- exit(1);
+- }
+- free(tmp_version);
+-
+- /* Compare xml2-config output to the libxml headers */
+- if ((xml_major_version != $xml_config_major_version) ||
+- (xml_minor_version != $xml_config_minor_version) ||
+- (xml_micro_version != $xml_config_micro_version))
+- {
+- printf("*** libxml header files (version %d.%d.%d) do not match\n",
+- xml_major_version, xml_minor_version, xml_micro_version);
+- printf("*** xml2-config (version %d.%d.%d)\n",
+- $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
+- return 1;
+- }
+-/* Compare the headers to the library to make sure we match */
+- /* Less than ideal -- doesn't provide us with return value feedback,
+- * only exits if there's a serious mismatch between header and library.
+- */
+- LIBXML_TEST_VERSION;
+-
+- /* Test that the library is greater than our minimum version */
+- if ((xml_major_version > major) ||
+- ((xml_major_version == major) && (xml_minor_version > minor)) ||
+- ((xml_major_version == major) && (xml_minor_version == minor) &&
+- (xml_micro_version >= micro)))
+- {
+- return 0;
+- }
+- else
+- {
+- printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
+- xml_major_version, xml_minor_version, xml_micro_version);
+- printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
+- major, minor, micro);
+- printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
+- printf("***\n");
+- printf("*** If you have already installed a sufficiently new version, this error\n");
+- printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
+- printf("*** being found. The easiest way to fix this is to remove the old version\n");
+- printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
+- printf("*** correct copy of xml2-config. (In this case, you will have to\n");
+- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+- printf("*** so that the correct libraries are found at run-time))\n");
+- }
+- return 1;
+-}
+-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+- CPPFLAGS="$ac_save_CPPFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
++AC_DEFUN([AM_PATH_XML2],[
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+
+- if test "x$no_xml" = x ; then
+- AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
+- ifelse([$2], , :, [$2])
+- else
+- AC_MSG_RESULT(no)
+- if test "$XML2_CONFIG" = "no" ; then
+- echo "*** The xml2-config script installed by LIBXML could not be found"
+- echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
+- echo "*** your path, or set the XML2_CONFIG environment variable to the"
+- echo "*** full path to xml2-config."
+- else
+- if test -f conf.xmltest ; then
+- :
+- else
+- echo "*** Could not run libxml test program, checking why..."
+- CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+- LIBS="$LIBS $XML_LIBS"
+- AC_TRY_LINK([
+-#include <libxml/xmlversion.h>
+-#include <stdio.h>
+-], [ LIBXML_TEST_VERSION; return 0;],
+- [ echo "*** The test program compiled, but did not run. This usually means"
+- echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
+- echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
+- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+- echo "*** to the installed location Also, make sure you have run ldconfig if that"
+- echo "*** is required on your system"
+- echo "***"
+- echo "*** If you have an old version installed, it is best to remove it, although"
+- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+- [ echo "*** The test program failed to compile or link. See the file config.log for the"
+- echo "*** exact error that occurred. This usually means LIBXML was incorrectly installed"
+- echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
+- echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
+- CPPFLAGS="$ac_save_CPPFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
++ verdep=ifelse([$1], [], [], [">= $1"])
++ PKG_CHECK_MODULES(XML, [libxml-2.0 $verdep], [$2], [$3])
+
+- XML_CPPFLAGS=""
+- XML_LIBS=""
+- ifelse([$3], , :, [$3])
+- fi
++ XML_CPPFLAGS=$XML_CFLAGS
+ AC_SUBST(XML_CPPFLAGS)
+- AC_SUBST(XML_LIBS)
+- rm -f conf.xmltest
+ ])
diff --git a/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
new file mode 100644
index 000000000..e83c8325e
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
@@ -0,0 +1,30 @@
+Allow us to pass in PYTHON_SITE_PACKAGES
+
+The python binary used when building for nativesdk doesn't give us the
+correct path here so we need to be able to specify it ourselves.
+
+Upstream-Status: Inappropriate [config]
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebase to 2.9.2
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -813,7 +813,8 @@ dnl
+
+ PYTHON_VERSION=
+ PYTHON_INCLUDES=
+-PYTHON_SITE_PACKAGES=
++# Allow this to be set externally
++#PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+ if test "$with_python" != "no" ; then
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/libxml/libxml2/run-ptest b/poky/meta/recipes-core/libxml/libxml2/run-ptest
new file mode 100644
index 000000000..c313d8326
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export LC_ALL=en_US.UTF-8
+make -k runtests
diff --git a/poky/meta/recipes-core/libxml/libxml2/runtest.patch b/poky/meta/recipes-core/libxml/libxml2/runtest.patch
new file mode 100644
index 000000000..cb171d5b3
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -0,0 +1,817 @@
+Add 'install-ptest' rule.
+Print a standard result line for each test.
+
+Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+Upstream-Status: Backport
+
+diff -uNr a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2017-08-28 15:01:14.000000000 +0200
++++ b/Makefile.am 2017-09-05 08:06:05.752287323 +0200
+@@ -202,6 +202,15 @@
+ #testOOM_DEPENDENCIES = $(DEPS)
+ #testOOM_LDADD= $(LDADDS)
+
++install-ptest:
++ @(if [ -d .libs ] ; then cd .libs; fi; \
++ install $(check_PROGRAMS) $(DESTDIR))
++ cp -r $(srcdir)/test $(DESTDIR)
++ cp -r $(srcdir)/result $(DESTDIR)
++ cp -r $(srcdir)/python $(DESTDIR)
++ cp Makefile $(DESTDIR)
++ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++
+ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
+ [ -d test ] || $(LN_S) $(srcdir)/test .
+
+diff -uNr a/runsuite.c b/runsuite.c
+--- a/runsuite.c 2013-04-12 16:17:11.462823238 +0200
++++ b/runsuite.c 2013-04-17 14:07:24.352693211 +0200
+@@ -1162,6 +1162,7 @@
+
+ if (logfile != NULL)
+ fclose(logfile);
++ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+ #else /* !SCHEMAS */
+diff -uNr a/runtest.c b/runtest.c
+--- a/runtest.c 2013-04-16 13:19:15.087997290 +0200
++++ b/runtest.c 2013-04-17 14:08:29.529949655 +0200
+@@ -4386,6 +4386,7 @@
+ err++;
+ }
+ }
++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+ return(err);
+ }
+
+@@ -4455,6 +4456,7 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+
+diff -uNr a/runxmlconf.c b/runxmlconf.c
+--- a/runxmlconf.c 2013-04-16 12:53:49.900982990 +0200
++++ b/runxmlconf.c 2013-04-17 14:09:21.111778104 +0200
+@@ -595,6 +595,7 @@
+
+ if (logfile != NULL)
+ fclose(logfile);
++ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+
+diff -uNr a/testapi.c b/testapi.c
+--- a/testapi.c 2013-04-12 16:16:57.763417659 +0200
++++ b/testapi.c 2013-04-17 14:10:28.876924881 +0200
+@@ -1245,49 +1245,91 @@
+ testlibxml2(void)
+ {
+ int test_ret = 0;
++ int ret = 0;
+
+- test_ret += test_HTMLparser();
+- test_ret += test_HTMLtree();
+- test_ret += test_SAX2();
+- test_ret += test_c14n();
+- test_ret += test_catalog();
+- test_ret += test_chvalid();
+- test_ret += test_debugXML();
+- test_ret += test_dict();
+- test_ret += test_encoding();
+- test_ret += test_entities();
+- test_ret += test_hash();
+- test_ret += test_list();
+- test_ret += test_nanoftp();
+- test_ret += test_nanohttp();
+- test_ret += test_parser();
+- test_ret += test_parserInternals();
+- test_ret += test_pattern();
+- test_ret += test_relaxng();
+- test_ret += test_schemasInternals();
+- test_ret += test_schematron();
+- test_ret += test_tree();
+- test_ret += test_uri();
+- test_ret += test_valid();
+- test_ret += test_xinclude();
+- test_ret += test_xmlIO();
+- test_ret += test_xmlautomata();
+- test_ret += test_xmlerror();
+- test_ret += test_xmlmodule();
+- test_ret += test_xmlreader();
+- test_ret += test_xmlregexp();
+- test_ret += test_xmlsave();
+- test_ret += test_xmlschemas();
+- test_ret += test_xmlschemastypes();
+- test_ret += test_xmlstring();
+- test_ret += test_xmlunicode();
+- test_ret += test_xmlwriter();
+- test_ret += test_xpath();
+- test_ret += test_xpathInternals();
+- test_ret += test_xpointer();
++ test_ret += (ret = test_HTMLparser());
++ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_HTMLtree());
++ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_SAX2());
++ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_c14n());
++ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_catalog());
++ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_chvalid());
++ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_debugXML());
++ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_dict());
++ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_encoding());
++ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_entities());
++ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_hash());
++ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_list());
++ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_nanoftp());
++ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_nanohttp());
++ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_parser());
++ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_parserInternals());
++ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_pattern());
++ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_relaxng());
++ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_schemasInternals());
++ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_schematron());
++ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_tree());
++ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_uri());
++ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_valid());
++ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xinclude());
++ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlIO());
++ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlautomata());
++ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlerror());
++ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlmodule());
++ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlreader());
++ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlregexp());
++ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlsave());
++ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlschemas());
++ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlschemastypes());
++ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlstring());
++ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlunicode());
++ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlwriter());
++ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpath());
++ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpathInternals());
++ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpointer());
++ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
+
+ printf("Total: %d functions, %d tests, %d errors\n",
+ function_tests, call_tests, test_ret);
++
++ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
+ return(test_ret);
+ }
+
+diff -uNr a/testchar.c b/testchar.c
+--- a/testchar.c 2013-04-17 10:50:30.250147418 +0200
++++ b/testchar.c 2013-04-18 16:11:28.455733800 +0200
+@@ -23,7 +23,7 @@
+ char document1[100] = "<doc>XXXX</doc>";
+ char document2[100] = "<doc foo='XXXX'/>";
+
+-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data, int forbid1, int forbid2) {
+ int i;
+ xmlDocPtr res;
+@@ -37,33 +37,41 @@
+ res = xmlReadMemory(document, len, "test", NULL, 0);
+
+ if ((i == forbid1) || (i == forbid2)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X: %c\n",
+ i, i);
++ return(1);
++ }
+ }
+
+ else if ((i == '<') || (i == '&')) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
++ return(1);
++ }
+ }
+ else if (((i < 0x20) || (i >= 0x80)) &&
+ (i != 0x9) && (i != 0xA) && (i != 0xD)) {
+- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
++ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ }
+ else if (res == NULL) {
+ fprintf(stderr,
+ "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
++ return(1);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
++ return(0);
+ }
+
+-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data) {
+ int i, j;
+ xmlDocPtr res;
+@@ -80,10 +88,12 @@
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -91,10 +101,12 @@
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -102,10 +114,12 @@
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -113,10 +127,12 @@
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -125,11 +141,13 @@
+ else if ((lastError != 0) || (res == NULL)) {
+ fprintf(stderr,
+ "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
++ return(1);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
+ }
++ return(0);
+ }
+
+ /**
+@@ -141,9 +159,10 @@
+ * CDATA in text or in attribute values.
+ */
+
+-static void testDocumentRanges(void) {
++static int testDocumentRanges(void) {
+ xmlParserCtxtPtr ctxt;
+ char *data;
++ int test_ret = 0;
+
+ /*
+ * Set up a parsing context using the first document as
+@@ -152,7 +171,7 @@
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+- return;
++ return(1);
+ }
+
+ printf("testing 1 byte char in document: 1");
+@@ -163,7 +182,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data, -1, -1);
+ printf(" 2");
+ fflush(stdout);
+@@ -172,7 +191,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data + 3, -1, -1);
+
+ printf(" 3");
+@@ -183,7 +202,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data, '\'', -1);
+ printf(" 4");
+ fflush(stdout);
+@@ -192,7 +211,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data + 3, '\'', -1);
+ printf(" done\n");
+
+@@ -204,7 +223,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data);
+ printf(" 2");
+ fflush(stdout);
+@@ -213,7 +232,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data + 2);
+
+ printf(" 3");
+@@ -224,7 +243,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data);
+ printf(" 4");
+ fflush(stdout);
+@@ -233,14 +252,15 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data + 2);
+ printf(" done\n");
+
+ xmlFreeParserCtxt(ctxt);
++ return(test_ret);
+ }
+
+-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
+ int i = 0;
+ int len, c;
+
+@@ -255,19 +275,25 @@
+ c = xmlCurrentChar(ctxt, &len);
+ if ((i == 0) || (i >= 0x80)) {
+ /* we must see an error there */
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ } else if (i == 0xD) {
+- if ((c != 0xA) || (len != 1))
++ if ((c != 0xA) || (len != 1)) {
+ fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ } else if ((c != i) || (len != 1)) {
+ fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
++ return(1);
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j;
+ int len, c;
+
+@@ -284,10 +310,12 @@
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -295,10 +323,12 @@
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
++ return(1);
++ }
+ }
+
+ /*
+@@ -306,10 +336,12 @@
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
++ return(1);
++ }
+ }
+
+ /*
+@@ -317,10 +349,12 @@
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -329,6 +363,7 @@
+ else if ((lastError != 0) || (len != 2)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
++ return(1);
+ }
+
+ /*
+@@ -338,12 +373,14 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
++ return(1);
+ }
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -368,20 +405,24 @@
+ * at least 4 bytes, but we give only 3 !
+ */
+ if ((i & 0xF0) == 0xF0) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
++ return(1);
++ }
+ }
+
+ /*
+ * The second and the third bytes must start with 10
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -390,10 +431,12 @@
+ * the 6th byte of data[1] must be set
+ */
+ else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -401,10 +444,12 @@
+ */
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000))) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -414,6 +459,7 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
+ }
+
+ /*
+@@ -423,13 +469,15 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
++ return(1);
+ }
+ }
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K, l, L;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -458,10 +506,12 @@
+ * at least 5 bytes, but we give only 4 !
+ */
+ if ((i & 0xF8) == 0xF8) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
++ return(1);
++ }
+ }
+
+ /*
+@@ -469,10 +519,12 @@
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
+ ((L & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -481,10 +533,12 @@
+ * the 6 or 5th byte of j must be set
+ */
+ else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -493,10 +547,12 @@
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000)) ||
+ (value > 0x10FFFF)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -506,6 +562,7 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
+ }
+
+ /*
+@@ -515,11 +572,13 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
++ return(1);
+ }
+ }
+ }
+ }
+ }
++ return(0);
+ }
+
+ /**
+@@ -530,11 +589,12 @@
+ * cover the full range of UTF-8 chars accepted by XML-1.0
+ */
+
+-static void testCharRanges(void) {
++static int testCharRanges(void) {
+ char data[5];
+ xmlParserCtxtPtr ctxt;
+ xmlParserInputBufferPtr buf;
+ xmlParserInputPtr input;
++ int test_ret = 0;
+
+ memset(data, 0, 5);
+
+@@ -545,17 +605,19 @@
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+- return;
++ return(1);
+ }
+ buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
+ XML_CHAR_ENCODING_NONE);
+ if (buf == NULL) {
+ fprintf(stderr, "Failed to allocate input buffer\n");
++ test_ret = 1;
+ goto error;
+ }
+ input = xmlNewInputStream(ctxt);
+ if (input == NULL) {
+ xmlFreeParserInputBuffer(buf);
++ test_ret = 1;
+ goto error;
+ }
+ input->filename = NULL;
+@@ -567,25 +629,28 @@
+
+ printf("testing char range: 1");
+ fflush(stdout);
+- testCharRangeByte1(ctxt, data);
++ test_ret += testCharRangeByte1(ctxt, data);
+ printf(" 2");
+ fflush(stdout);
+- testCharRangeByte2(ctxt, data);
++ test_ret += testCharRangeByte2(ctxt, data);
+ printf(" 3");
+ fflush(stdout);
+- testCharRangeByte3(ctxt, data);
++ test_ret += testCharRangeByte3(ctxt, data);
+ printf(" 4");
+ fflush(stdout);
+- testCharRangeByte4(ctxt, data);
++ test_ret += testCharRangeByte4(ctxt, data);
+ printf(" done\n");
+ fflush(stdout);
+
+ error:
+ xmlFreeParserCtxt(ctxt);
++ return(test_ret);
+ }
+
+ int main(void) {
+
++ int ret = 0;
++
+ /*
+ * this initialize the library and check potential ABI mismatches
+ * between the version it was compiled for and the actual shared
+@@ -602,8 +667,9 @@
+ /*
+ * Run the tests
+ */
+- testCharRanges();
+- testDocumentRanges();
++ ret += testCharRanges();
++ ret += testDocumentRanges();
++ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
+
+ /*
+ * Cleanup function for the XML library.
+diff -uNr a/testdict.c b/testdict.c
+--- a/testdict.c 2013-04-16 15:08:42.971177193 +0200
++++ b/testdict.c 2013-04-18 15:59:00.699482439 +0200
+@@ -440,5 +440,6 @@
+ clean_strings();
+ xmlCleanupParser();
+ xmlMemoryDump();
++ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+diff -uNr a/testlimits.c b/testlimits.c
+--- a/testlimits.c 2013-04-12 16:16:36.180354177 +0200
++++ b/testlimits.c 2013-04-17 14:03:17.203092987 +0200
+@@ -1630,5 +1630,6 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+diff -uNr a/testrecurse.c b/testrecurse.c
+--- a/testrecurse.c 2013-04-16 13:19:49.366536295 +0200
++++ b/testrecurse.c 2013-04-17 14:06:27.367091622 +0200
+@@ -892,6 +892,7 @@
+ err++;
+ }
+ }
++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+ return(err);
+ }
+
+@@ -961,5 +962,6 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
diff --git a/poky/meta/recipes-core/libxml/libxml2_2.9.7.bb b/poky/meta/recipes-core/libxml/libxml2_2.9.7.bb
new file mode 100644
index 000000000..2fb90a68a
--- /dev/null
+++ b/poky/meta/recipes-core/libxml/libxml2_2.9.7.bb
@@ -0,0 +1,105 @@
+SUMMARY = "XML C Parser Library and Toolkit"
+DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
+HOMEPAGE = "http://www.xmlsoft.org/"
+BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \
+ file://hash.c;beginline=6;endline=15;md5=96f7296605eae807670fb08947829969 \
+ file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \
+ file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"
+
+DEPENDS = "zlib virtual/libiconv"
+
+SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
+ http://www.w3.org/XML/Test/xmlts20080827.tar.gz;name=testtar \
+ file://libxml-64bit.patch \
+ file://ansidecl.patch \
+ file://runtest.patch \
+ file://run-ptest \
+ file://python-sitepackages-dir.patch \
+ file://libxml-m4-use-pkgconfig.patch \
+ file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
+ file://fix-execution-of-ptests.patch \
+ "
+
+SRC_URI[libtar.md5sum] = "896608641a08b465098a40ddf51cefba"
+SRC_URI[libtar.sha256sum] = "f63c5e7d30362ed28b38bfa1ac6313f9a80230720b7fb6c80575eeab3ff5900c"
+SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
+SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
+
+BINCONFIG = "${bindir}/xml2-config"
+
+PACKAGECONFIG ??= "python \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+inherit autotools pkgconfig binconfig-disabled ptest
+
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
+
+RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
+
+RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us glibc-gconv-ibm1141 glibc-gconv-iso8859-5"
+
+export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
+
+# WARNING: zlib is required for RPM use
+EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
+EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib"
+
+python populate_packages_prepend () {
+ # autonamer would call this libxml2-2, but we don't want that
+ if d.getVar('DEBIAN_NAMES'):
+ d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
+}
+
+PACKAGES += "${PN}-utils ${PN}-python"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*"
+FILES_${PN}-utils += "${bindir}/*"
+FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"
+
+do_configure_prepend () {
+ # executables take longer to package: these should not be executable
+ find ${WORKDIR}/xmlconf/ -type f -exec chmod -x {} \+
+}
+
+do_compile_ptest() {
+ oe_runmake check-am
+}
+
+do_install_ptest () {
+ cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
+ sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
+ ${D}${PTEST_PATH}/python/tests/Makefile
+ grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
+ xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
+ fi
+ #Remove build host references from various Makefiles
+ find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ -e '/^RELDATE/d' \
+ {} +
+}
+
+do_install_append_class-native () {
+ # Docs are not needed in the native case
+ rm ${D}${datadir}/gtk-doc -rf
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-core/meta/build-sysroots.bb b/poky/meta/recipes-core/meta/build-sysroots.bb
new file mode 100644
index 000000000..7a712e2f3
--- /dev/null
+++ b/poky/meta/recipes-core/meta/build-sysroots.bb
@@ -0,0 +1,38 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "MIT"
+
+STANDALONE_SYSROOT = "${STAGING_DIR}/${MACHINE}"
+STANDALONE_SYSROOT_NATIVE = "${STAGING_DIR}/${BUILD_ARCH}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+EXCLUDE_FROM_WORLD = "1"
+
+inherit nopackages
+deltask fetch
+deltask unpack
+deltask patch
+deltask prepare_recipe_sysroot
+deltask populate_lic
+deltask configure
+deltask compile
+deltask install
+deltask populate_sysroot
+
+python do_build_native_sysroot () {
+ targetsysroot = d.getVar("STANDALONE_SYSROOT")
+ nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+ staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d)
+}
+do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}"
+do_build_native_sysroot[nostamp] = "1"
+addtask do_build_native_sysroot before do_build
+
+python do_build_target_sysroot () {
+ targetsysroot = d.getVar("STANDALONE_SYSROOT")
+ nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+ staging_populate_sysroot_dir(targetsysroot, nativesysroot, False, d)
+}
+do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}"
+do_build_target_sysroot[nostamp] = "1"
+addtask do_build_target_sysroot before do_build
+
+do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}"
diff --git a/poky/meta/recipes-core/meta/buildtools-tarball.bb b/poky/meta/recipes-core/meta/buildtools-tarball.bb
new file mode 100644
index 000000000..d98a9c901
--- /dev/null
+++ b/poky/meta/recipes-core/meta/buildtools-tarball.bb
@@ -0,0 +1,83 @@
+DESCRIPTION = "SDK type target for building a standalone tarball containing python3, chrpath, make, git and tar. The \
+ tarball can be used to run bitbake builds on systems which don't meet the usual version requirements."
+SUMMARY = "Standalone tarball for running builds on systems with inadequate software"
+LICENSE = "MIT"
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "\
+ nativesdk-python3-core \
+ nativesdk-python3-modules \
+ nativesdk-python3-misc \
+ nativesdk-python3-git \
+ nativesdk-ncurses-terminfo-base \
+ nativesdk-chrpath \
+ nativesdk-tar \
+ nativesdk-buildtools-perl-dummy \
+ nativesdk-git \
+ nativesdk-git-perltools \
+ nativesdk-pigz \
+ nativesdk-make \
+ nativesdk-wget \
+ nativesdk-ca-certificates \
+ nativesdk-texinfo \
+ "
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+SDK_PACKAGE_ARCHS += "buildtools-dummy-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
+
+SDK_TITLE = "Build tools"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit toolchain-scripts-base
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+create_sdk_files_append () {
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
+
+ # Generate new (mini) sdk-environment-setup file
+ script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
+ touch $script
+ echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
+ # In order for the self-extraction script to correctly extract and set up things,
+ # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
+ # However, buildtools-tarball is inherently a tool set instead of a fully functional SDK,
+ # so instead of exporting the variable, we use a comment here.
+ echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
+
+ echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
+
+ if [ "${SDKMACHINE}" = "i686" ]; then
+ echo 'export NO32LIBS="0"' >>$script
+ echo 'echo "$BB_ENV_EXTRAWHITE" | grep -q "NO32LIBS"' >>$script
+ echo '[ $? != 0 ] && export BB_ENV_EXTRAWHITE="NO32LIBS $BB_ENV_EXTRAWHITE"' >>$script
+ fi
+}
+
+# buildtools-tarball doesn't need config site
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
+
+# The recipe doesn't need any default deps
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/poky/meta/recipes-core/meta/dummy-sdk-package.inc b/poky/meta/recipes-core/meta/dummy-sdk-package.inc
new file mode 100644
index 000000000..ed83dd77d
--- /dev/null
+++ b/poky/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -0,0 +1,24 @@
+SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools"
+LICENSE = "MIT"
+
+inherit allarch
+
+python() {
+ # Put the package somewhere separate to ensure it's never used except
+ # when we want it
+ # (note that we have to do this in anonymous python here to avoid
+ # allarch.bbclass disabling itself)
+ d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
+}
+
+ALLOW_EMPTY_${PN} = "1"
+
+PR[vardeps] += "DUMMYPROVIDES"
+
+python populate_packages_prepend() {
+ p = d.getVar("PN")
+ d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}")
+ #d.appendVar("RCONFLICTS_%s" % p, "${DUMMYPROVIDES}")
+ #d.appendVar("RREPLACES_%s" % p, "${DUMMYPROVIDES}")
+}
+
diff --git a/poky/meta/recipes-core/meta/meta-environment-extsdk.bb b/poky/meta/recipes-core/meta/meta-environment-extsdk.bb
new file mode 100644
index 000000000..2076b56f2
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-environment-extsdk.bb
@@ -0,0 +1,12 @@
+# meta-environment for extensible SDK
+
+require meta-environment.bb
+
+PN = "meta-environment-extsdk-${MACHINE}"
+
+create_sdk_files_append() {
+ local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${MACHINE}
+ local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${BUILD_ARCH}
+
+ toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
+}
diff --git a/poky/meta/recipes-core/meta/meta-environment.bb b/poky/meta/recipes-core/meta/meta-environment.bb
new file mode 100644
index 000000000..09f757a08
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,78 @@
+SUMMARY = "Package of environment files for SDK"
+LICENSE = "MIT"
+PR = "r8"
+
+EXCLUDE_FROM_WORLD = "1"
+
+MODIFYTOS = "0"
+
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+inherit toolchain-scripts
+TOOLCHAIN_NEED_CONFIGSITE_CACHE_append = " zlib"
+# Need to expand here before cross-candian changes HOST_ARCH -> SDK_ARCH
+TOOLCHAIN_CONFIGSITE_NOCACHE := "${TOOLCHAIN_CONFIGSITE_NOCACHE}"
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
+inherit cross-canadian
+
+do_generate_content[cleandirs] = "${SDK_OUTPUT}"
+do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}"
+# Need to ensure we have the virtual mappings and site files for all multtilib variants
+do_generate_content[depends] = "${@oe.utils.build_depends_string(all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}"
+python do_generate_content() {
+ # Handle multilibs in the SDK environment, siteconfig, etc files...
+ localdata = bb.data.createCopy(d)
+
+ # make sure we only use the WORKDIR value from 'd', or it can change
+ localdata.setVar('WORKDIR', d.getVar('WORKDIR'))
+
+ # make sure we only use the SDKTARGETSYSROOT value from 'd'
+ localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT'))
+ localdata.setVar('libdir', d.getVar('target_libdir', False))
+
+ # Process DEFAULTTUNE
+ bb.build.exec_func("create_sdk_files", localdata)
+
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ # Load overrides from 'd' to avoid having to reset the value...
+ overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.build.exec_func("create_sdk_files", localdata)
+}
+addtask generate_content before do_install after do_compile
+
+create_sdk_files() {
+ # Setup site file for external use
+ toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
+
+ toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+
+ # Add version information
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
+
+ toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh
+}
+
+do_install() {
+ install -d ${D}/${SDKPATH}
+ install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
+}
+
+PN = "meta-environment-${MACHINE}"
+PACKAGES = "${PN}"
+FILES_${PN}= " \
+ ${SDKPATH}/* \
+ "
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_populate_sysroot
diff --git a/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
new file mode 100644
index 000000000..235d6ecc0
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Extensible SDK toolchain meta-recipe"
+DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+
+do_populate_sysroot[deptask] = "do_populate_sysroot"
+
+# NOTE: There is logic specific to this recipe in setscene_depvalid()
+# within sstate.bbclass, so if you copy or rename this and expect the same
+# functionality you'll need to modify that as well.
+
+LOCKED_SIGS_INDIR = "${WORKDIR}/locked-sigs"
+
+addtask do_locked_sigs after do_populate_sysroot
+SSTATETASKS += "do_locked_sigs"
+do_locked_sigs[sstate-inputdirs] = "${LOCKED_SIGS_INDIR}"
+do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR}/${PACKAGE_ARCH}/${PN}/locked-sigs"
+
+python do_locked_sigs() {
+ import oe.copy_buildsystem
+ outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR'))
+ bb.utils.mkdirhier(outdir)
+ sigfile = os.path.join(outdir, 'locked-sigs-extsdk-toolchain.inc')
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
diff --git a/poky/meta/recipes-core/meta/meta-go-toolchain.bb b/poky/meta/recipes-core/meta/meta-go-toolchain.bb
new file mode 100644
index 000000000..dde385c1b
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-go-toolchain.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Meta package for building a installable Go toolchain"
+LICENSE = "MIT"
+
+inherit populate_sdk
+
+TOOLCHAIN_HOST_TASK_append = " \
+ packagegroup-go-cross-canadian-${MACHINE} \
+"
+
+TOOLCHAIN_TARGET_TASK_append = " \
+ ${@multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \
+"
diff --git a/poky/meta/recipes-core/meta/meta-ide-support.bb b/poky/meta/recipes-core/meta/meta-ide-support.bb
new file mode 100644
index 000000000..0692ec8b9
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-ide-support.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Integrated Development Environment support"
+DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+PR = "r3"
+RM_WORK_EXCLUDE += "${PN}"
+
+inherit meta toolchain-scripts nopackages
+
+do_populate_ide_support () {
+ toolchain_create_tree_env_script
+}
+
+addtask populate_ide_support before do_build after do_install
diff --git a/poky/meta/recipes-core/meta/meta-toolchain.bb b/poky/meta/recipes-core/meta/meta-toolchain.bb
new file mode 100644
index 000000000..b02b0665e
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-toolchain.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Meta package for building a installable toolchain"
+LICENSE = "MIT"
+
+PR = "r7"
+
+inherit populate_sdk
diff --git a/poky/meta/recipes-core/meta/meta-world-pkgdata.bb b/poky/meta/recipes-core/meta/meta-world-pkgdata.bb
new file mode 100644
index 000000000..b29986137
--- /dev/null
+++ b/poky/meta/recipes-core/meta/meta-world-pkgdata.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Pulls in pkgdata for world"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+addtask do_allpackagedata before do_build
+do_allpackagedata() {
+ :
+}
+do_allpackagedata[recrdeptask] = "do_packagedata do_allpackagedata"
+do_allpackagedata[noexec] = "1"
+
+WORLD_PKGDATADIR = "${D}/world-pkgdata"
+
+addtask do_collect_packagedata after do_allpackagedata
+SSTATETASKS += "do_collect_packagedata"
+do_collect_packagedata[sstate-inputdirs] = "${WORLD_PKGDATADIR}"
+do_collect_packagedata[sstate-outputdirs] = "${STAGING_DIR_HOST}/world-pkgdata"
+
+python do_collect_packagedata() {
+ import oe.copy_buildsystem
+ outdir = os.path.join(d.getVar('WORLD_PKGDATADIR'))
+ bb.utils.mkdirhier(outdir)
+ sigfile = os.path.join(outdir, 'locked-sigs-pkgdata.inc')
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+
+do_prepare_recipe_sysroot[deptask] = ""
+
+WORLD_PKGDATA_EXCLUDE ?= ""
+
+python calculate_extra_depends() {
+ exclude = '${WORLD_PKGDATA_EXCLUDE}'.split()
+ for p in world_target:
+ if p == self_pn:
+ continue
+
+ if p in exclude:
+ continue
+
+ deps.append(p)
+}
+
+PACKAGES = ""
diff --git a/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
new file mode 100644
index 000000000..f5bcb8254
--- /dev/null
+++ b/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -0,0 +1,11 @@
+DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
+
+DUMMYPROVIDES = "\
+ nativesdk-perl \
+ nativesdk-perl-module-file-path"
+
+PR = "r2"
+
+require dummy-sdk-package.inc
+
+inherit nativesdk
diff --git a/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb b/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
new file mode 100644
index 000000000..11a727d48
--- /dev/null
+++ b/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
@@ -0,0 +1,15 @@
+DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}"
+
+# Add /bin/sh?
+DUMMYPROVIDES = "\
+ /bin/bash \
+ /usr/bin/env \
+ /usr/bin/perl \
+ pkgconfig \
+ libGL.so()(64bit) \
+ libGL.so \
+"
+
+require dummy-sdk-package.inc
+
+inherit nativesdk
diff --git a/poky/meta/recipes-core/meta/package-index.bb b/poky/meta/recipes-core/meta/package-index.bb
new file mode 100644
index 000000000..a4123b762
--- /dev/null
+++ b/poky/meta/recipes-core/meta/package-index.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Rebuilds the package index"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGES = ""
+
+inherit nopackages
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+
+do_package_index[nostamp] = "1"
+do_package_index[depends] += "${PACKAGEINDEXDEPS}"
+
+python do_package_index() {
+ from oe.rootfs import generate_index_files
+ generate_index_files(d)
+}
+addtask do_package_index before do_build
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta/recipes-core/meta/signing-keys.bb b/poky/meta/recipes-core/meta/signing-keys.bb
new file mode 100644
index 000000000..1e1c7e345
--- /dev/null
+++ b/poky/meta/recipes-core/meta/signing-keys.bb
@@ -0,0 +1,83 @@
+# Copyright (C) 2015 Intel Corporation
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Makes public keys of the signing keys available"
+LICENSE = "MIT"
+
+
+inherit allarch deploy
+
+EXCLUDE_FROM_WORLD = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SYSROOT_DIRS += "${sysconfdir}/pki"
+
+PACKAGES =+ "${PN}-ipk ${PN}-rpm ${PN}-packagefeed"
+
+FILES_${PN}-rpm = "${sysconfdir}/pki/rpm-gpg"
+FILES_${PN}-ipk = "${sysconfdir}/pki/ipk-gpg"
+FILES_${PN}-packagefeed = "${sysconfdir}/pki/packagefeed-gpg"
+
+python do_get_public_keys () {
+ from oe.gpg_sign import get_signer
+
+ if d.getVar("RPM_SIGN_PACKAGES"):
+ # Export public key of the rpm signing key
+ signer = get_signer(d, d.getVar('RPM_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'),
+ d.getVar('RPM_GPG_NAME'))
+
+ if d.getVar("IPK_SIGN_PACKAGES"):
+ # Export public key of the ipk signing key
+ signer = get_signer(d, d.getVar('IPK_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'),
+ d.getVar('IPK_GPG_NAME'))
+
+ if d.getVar('PACKAGE_FEED_SIGN') == '1':
+ # Export public key of the feed signing key
+ signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'pf-key'),
+ d.getVar('PACKAGE_FEED_GPG_NAME'))
+}
+do_get_public_keys[cleandirs] = "${B}"
+addtask get_public_keys before do_install
+do_get_public_keys[depends] += "gnupg-native:do_populate_sysroot"
+
+do_install () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+}
+
+do_deploy () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+}
+do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_RPM}"
+# cleandirs should possibly be in deploy.bbclass but we need it
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+# clear stamp-extra-info since MACHINE_ARCH is normally put there by
+# deploy.bbclass
+do_deploy[stamp-extra-info] = ""
+addtask deploy after do_get_public_keys
+
+# Delete unnecessary tasks. In particular, "do_unpack" _must_ be deleted because
+# it cleans ${B} and will wipe any keys exported by do_get_public_keys.
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
diff --git a/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb b/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb
new file mode 100644
index 000000000..714d15d8b
--- /dev/null
+++ b/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb
@@ -0,0 +1,11 @@
+DUMMYARCH = "sdk-provides-dummy-target"
+
+DUMMYPROVIDES = "\
+ /bin/sh \
+ /bin/bash \
+ /usr/bin/env \
+ /usr/bin/perl \
+ pkgconfig \
+"
+
+require dummy-sdk-package.inc
diff --git a/poky/meta/recipes-core/meta/testexport-tarball.bb b/poky/meta/recipes-core/meta/testexport-tarball.bb
new file mode 100644
index 000000000..c38ac902a
--- /dev/null
+++ b/poky/meta/recipes-core/meta/testexport-tarball.bb
@@ -0,0 +1,70 @@
+DESCRIPTION = "SDK type target for standalone tarball containing packages defined by TEST_EXPORT_TOOLS. The \
+ tarball can be used to run missing programs on testing systems which don't have such tools.\
+ This recipe is almost the same as buildtools-tarball"
+SUMMARY = "Standalone tarball for test systems with missing software"
+LICENSE = "MIT"
+
+TEST_EXPORT_SDK_PACKAGES ??= ""
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "${TEST_EXPORT_SDK_PACKAGES}"
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+SDK_PACKAGE_ARCHS += "testexport-tools-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${TEST_EXPORT_SDK_NAME}"
+
+SDK_TITLE = "Testexport tools"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit toolchain-scripts-base
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+create_sdk_files_append () {
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
+
+ # Generate new (mini) sdk-environment-setup file
+ script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
+ touch $script
+ echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
+ # In order for the self-extraction script to correctly extract and set up things,
+ # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
+ # However, testexport-tarball is inherently a tool set instead of a fully functional SDK,
+ # so instead of exporting the variable, we use a comment here.
+ echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
+
+ echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
+
+ if [ "${SDKMACHINE}" = "i686" ]; then
+ echo 'export NO32LIBS="0"' >>$script
+ echo 'echo "$BB_ENV_EXTRAWHITE" | grep -q "NO32LIBS"' >>$script
+ echo '[ $? != 0 ] && export BB_ENV_EXTRAWHITE="NO32LIBS $BB_ENV_EXTRAWHITE"' >>$script
+ fi
+}
+
+# testexport-tarball doesn't need config site
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
+
+# The recipe doesn't need any default deps
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/poky/meta/recipes-core/meta/uninative-tarball.bb b/poky/meta/recipes-core/meta/uninative-tarball.bb
new file mode 100644
index 000000000..38c3a314e
--- /dev/null
+++ b/poky/meta/recipes-core/meta/uninative-tarball.bb
@@ -0,0 +1,66 @@
+SUMMARY = "libc and patchelf tarball for use with uninative.bbclass"
+LICENSE = "MIT"
+
+TOOLCHAIN_TARGET_TASK = ""
+
+# ibm850 - mcopy from mtools
+# iso8859-1 - guile
+# utf-16, cp1252 - binutils-windres
+TOOLCHAIN_HOST_TASK = "\
+ nativesdk-glibc \
+ nativesdk-glibc-gconv-ibm850 \
+ nativesdk-glibc-gconv-iso8859-1 \
+ nativesdk-glibc-gconv-utf-16 \
+ nativesdk-glibc-gconv-cp1252 \
+ nativesdk-patchelf \
+ nativesdk-libxcrypt \
+ "
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-nativesdk-libc"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+SDK_DEPENDS += "patchelf-native"
+
+SDK_PACKAGING_FUNC = ""
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+fakeroot create_sdk_files() {
+ cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+ # Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+ # Escape special characters like '+' and '.' in the SDKPATH
+ escaped_sdkpath=$(echo ${SDKPATH}/sysroots/${SDK_SYS} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+ sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+}
+
+
+fakeroot tar_sdk() {
+ cd ${SDK_OUTPUT}/${SDKPATH}
+
+ DEST="./${SDK_ARCH}-${SDK_OS}"
+ mv sysroots/${SDK_SYS} $DEST
+ rm sysroots -rf
+ patchelf --set-interpreter ${@''.join('a' for n in range(1024))} $DEST/usr/bin/patchelf
+ mv $DEST/usr/bin/patchelf $DEST/usr/bin/patchelf-uninative
+ tar ${SDKTAROPTS} -c -j --file=${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+}
diff --git a/poky/meta/recipes-core/meta/wic-tools.bb b/poky/meta/recipes-core/meta/wic-tools.bb
new file mode 100644
index 000000000..09eb409e8
--- /dev/null
+++ b/poky/meta/recipes-core/meta/wic-tools.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A meta recipe to build native tools used by wic."
+
+LICENSE = "MIT"
+
+DEPENDS = "\
+ parted-native syslinux-native gptfdisk-native dosfstools-native \
+ mtools-native bmap-tools-native grub-efi-native cdrtools-native \
+ btrfs-tools-native squashfs-tools-native pseudo-native \
+ e2fsprogs-native util-linux-native \
+ "
+DEPENDS_append_x86 = " syslinux grub-efi systemd-boot"
+DEPENDS_append_x86-64 = " syslinux grub-efi systemd-boot"
+DEPENDS_append_x86-x32 = " syslinux grub-efi"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+inherit nopackages
+
+# The sysroot of wic-tools is needed for wic, but if rm_work is enabled, it will
+# be removed before wic has a chance to use it, hence the exclusion below.
+RM_WORK_EXCLUDE += "${PN}"
+
+python do_build_sysroot () {
+ bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask do_build_sysroot after do_prepare_recipe_sysroot before do_build
diff --git a/poky/meta/recipes-core/musl/bsd-headers.bb b/poky/meta/recipes-core/musl/bsd-headers.bb
new file mode 100644
index 000000000..c9945d45e
--- /dev/null
+++ b/poky/meta/recipes-core/musl/bsd-headers.bb
@@ -0,0 +1,31 @@
+# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "BSD compatible headers"
+LICENSE = "BSD-3-Clause & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://sys-queue.h;beginline=1;endline=32;md5=c6352b0f03bb448600456547d334b56f"
+SECTION = "devel"
+
+SRC_URI = "file://sys-queue.h \
+ file://sys-tree.h \
+ file://sys-cdefs.h \
+ "
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -Dm 0644 ${S}/sys-queue.h ${D}${includedir}/sys/queue.h
+ install -Dm 0644 ${S}/sys-tree.h ${D}${includedir}/sys/tree.h
+ install -Dm 0644 ${S}/sys-cdefs.h ${D}${includedir}/sys/cdefs.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+
+COMPATIBLE_HOST = ".*-musl.*"
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h b/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h
new file mode 100644
index 000000000..209a623c0
--- /dev/null
+++ b/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h
@@ -0,0 +1,26 @@
+#warning usage of non-standard #include <sys/cdefs.h> is deprecated
+
+#undef __P
+#undef __PMT
+
+#define __P(args) args
+#define __PMT(args) args
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+#if defined(__GNUC__) && !defined(__cplusplus)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+#else
+# define __THROW
+# define __NTH(fct) fct
+#endif
diff --git a/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h b/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h
new file mode 100644
index 000000000..99d01a55b
--- /dev/null
+++ b/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h
@@ -0,0 +1,846 @@
+/* $NetBSD: queue.h,v 1.68 2014/11/19 08:10:01 uebayasi Exp $ */
+
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list. Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction. Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * Include the definition of NULL only on NetBSD because sys/null.h
+ * is not available elsewhere. This conditional makes the header
+ * portable and it can simply be dropped verbatim into any system.
+ * The caveat is that on other systems some other header
+ * must provide NULL before the macros can be used.
+ */
+#ifdef __NetBSD__
+#include <sys/null.h>
+#endif
+
+#if defined(QUEUEDEBUG)
+# if defined(_KERNEL)
+# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__)
+# else
+# include <err.h>
+# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__)
+# endif
+#endif
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+
+/*
+ * Singly-linked List access methods.
+ */
+#define SLIST_FIRST(head) ((head)->slh_first)
+#define SLIST_END(head) NULL
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_FOREACH(var, head, field) \
+ for((var) = (head)->slh_first; \
+ (var) != SLIST_END(head); \
+ (var) = (var)->field.sle_next)
+
+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var) != SLIST_END(head) && \
+ ((tvar) = SLIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+/*
+ * Singly-linked List functions.
+ */
+#define SLIST_INIT(head) do { \
+ (head)->slh_first = SLIST_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ (elm)->field.sle_next = (slistelm)->field.sle_next; \
+ (slistelm)->field.sle_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ (elm)->field.sle_next = (head)->slh_first; \
+ (head)->slh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_AFTER(slistelm, field) do { \
+ (slistelm)->field.sle_next = \
+ SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ (head)->slh_first = (head)->slh_first->field.sle_next; \
+} while (/*CONSTCOND*/0)
+
+#define SLIST_REMOVE(head, elm, type, field) do { \
+ if ((head)->slh_first == (elm)) { \
+ SLIST_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ struct type *curelm = (head)->slh_first; \
+ while(curelm->field.sle_next != (elm)) \
+ curelm = curelm->field.sle_next; \
+ curelm->field.sle_next = \
+ curelm->field.sle_next->field.sle_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List access methods.
+ */
+#define LIST_FIRST(head) ((head)->lh_first)
+#define LIST_END(head) NULL
+#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head))
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = ((head)->lh_first); \
+ (var) != LIST_END(head); \
+ (var) = ((var)->field.le_next))
+
+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = LIST_FIRST((head)); \
+ (var) != LIST_END(head) && \
+ ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define LIST_MOVE(head1, head2) do { \
+ LIST_INIT((head2)); \
+ if (!LIST_EMPTY((head1))) { \
+ (head2)->lh_first = (head1)->lh_first; \
+ LIST_INIT((head1)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+/*
+ * List functions.
+ */
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \
+ if ((head)->lh_first && \
+ (head)->lh_first->field.le_prev != &(head)->lh_first) \
+ QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_LIST_OP(elm, field) \
+ if ((elm)->field.le_next && \
+ (elm)->field.le_next->field.le_prev != \
+ &(elm)->field.le_next) \
+ QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \
+ __FILE__, __LINE__); \
+ if (*(elm)->field.le_prev != (elm)) \
+ QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
+ (elm)->field.le_next = (void *)1L; \
+ (elm)->field.le_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
+#define QUEUEDEBUG_LIST_OP(elm, field)
+#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
+#endif
+
+#define LIST_INIT(head) do { \
+ (head)->lh_first = LIST_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ QUEUEDEBUG_LIST_OP((listelm), field) \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != \
+ LIST_END(head)) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ QUEUEDEBUG_LIST_OP((listelm), field) \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
+ if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REMOVE(elm, field) do { \
+ QUEUEDEBUG_LIST_OP((elm), field) \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+#define LIST_REPLACE(elm, elm2, field) do { \
+ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
+ (elm2)->field.le_next->field.le_prev = \
+ &(elm2)->field.le_next; \
+ (elm2)->field.le_prev = (elm)->field.le_prev; \
+ *(elm2)->field.le_prev = (elm2); \
+ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type) \
+struct name { \
+ struct type *sqh_first; /* first element */ \
+ struct type **sqh_last; /* addr of last next element */ \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type) \
+struct { \
+ struct type *sqe_next; /* next element */ \
+}
+
+/*
+ * Simple queue access methods.
+ */
+#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
+#define SIMPLEQ_END(head) NULL
+#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head))
+#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
+
+#define SIMPLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->sqh_first); \
+ (var) != SIMPLEQ_END(head); \
+ (var) = ((var)->field.sqe_next))
+
+#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \
+ for ((var) = ((head)->sqh_first); \
+ (var) != SIMPLEQ_END(head) && \
+ ((next = ((var)->field.sqe_next)), 1); \
+ (var) = (next))
+
+/*
+ * Simple queue functions.
+ */
+#define SIMPLEQ_INIT(head) do { \
+ (head)->sqh_first = NULL; \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (head)->sqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.sqe_next = NULL; \
+ *(head)->sqh_last = (elm); \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+ (listelm)->field.sqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(head)->sqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \
+ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
+ == NULL) \
+ (head)->sqh_last = &(elm)->field.sqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->sqh_first == (elm)) { \
+ SIMPLEQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->sqh_first; \
+ while (curelm->field.sqe_next != (elm)) \
+ curelm = curelm->field.sqe_next; \
+ if ((curelm->field.sqe_next = \
+ curelm->field.sqe_next->field.sqe_next) == NULL) \
+ (head)->sqh_last = &(curelm)->field.sqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_CONCAT(head1, head2) do { \
+ if (!SIMPLEQ_EMPTY((head2))) { \
+ *(head1)->sqh_last = (head2)->sqh_first; \
+ (head1)->sqh_last = (head2)->sqh_last; \
+ SIMPLEQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define SIMPLEQ_LAST(head, type, field) \
+ (SIMPLEQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *)(void *) \
+ ((char *)((head)->sqh_last) - offsetof(struct type, field))))
+
+/*
+ * Tail queue definitions.
+ */
+#define _TAILQ_HEAD(name, type, qual) \
+struct name { \
+ qual type *tqh_first; /* first element */ \
+ qual type *qual *tqh_last; /* addr of last next element */ \
+}
+#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { TAILQ_END(head), &(head).tqh_first }
+
+#define _TAILQ_ENTRY(type, qual) \
+struct { \
+ qual type *tqe_next; /* next element */ \
+ qual type *qual *tqe_prev; /* address of previous next element */\
+}
+#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue access methods.
+ */
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+#define TAILQ_END(head) (NULL)
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head))
+
+
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->tqh_first); \
+ (var) != TAILQ_END(head); \
+ (var) = ((var)->field.tqe_next))
+
+#define TAILQ_FOREACH_SAFE(var, head, field, next) \
+ for ((var) = ((head)->tqh_first); \
+ (var) != TAILQ_END(head) && \
+ ((next) = TAILQ_NEXT(var, field), 1); (var) = (next))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));\
+ (var) != TAILQ_END(head); \
+ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \
+ for ((var) = TAILQ_LAST((head), headname); \
+ (var) != TAILQ_END(head) && \
+ ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev))
+
+/*
+ * Tail queue functions.
+ */
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
+ if ((head)->tqh_first && \
+ (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
+ QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
+ if (*(head)->tqh_last != NULL) \
+ QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_OP(elm, field) \
+ if ((elm)->field.tqe_next && \
+ (elm)->field.tqe_next->field.tqe_prev != \
+ &(elm)->field.tqe_next) \
+ QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \
+ __FILE__, __LINE__); \
+ if (*(elm)->field.tqe_prev != (elm)) \
+ QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
+ if ((elm)->field.tqe_next == NULL && \
+ (head)->tqh_last != &(elm)->field.tqe_next) \
+ QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\
+ (head), (elm), __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
+ (elm)->field.tqe_next = (void *)1L; \
+ (elm)->field.tqe_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
+#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
+#define QUEUEDEBUG_TAILQ_OP(elm, field)
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
+#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
+#endif
+
+#define TAILQ_INIT(head) do { \
+ (head)->tqh_first = TAILQ_END(head); \
+ (head)->tqh_last = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
+ (elm)->field.tqe_next = TAILQ_END(head); \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ QUEUEDEBUG_TAILQ_OP((listelm), field) \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \
+ TAILQ_END(head)) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ QUEUEDEBUG_TAILQ_OP((listelm), field) \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
+ QUEUEDEBUG_TAILQ_OP((elm), field) \
+ if (((elm)->field.tqe_next) != TAILQ_END(head)) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_REPLACE(head, elm, elm2, field) do { \
+ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \
+ TAILQ_END(head)) \
+ (elm2)->field.tqe_next->field.tqe_prev = \
+ &(elm2)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm2)->field.tqe_next; \
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
+ *(elm2)->field.tqe_prev = (elm2); \
+ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
+} while (/*CONSTCOND*/0)
+
+#define TAILQ_CONCAT(head1, head2, field) do { \
+ if (!TAILQ_EMPTY(head2)) { \
+ *(head1)->tqh_last = (head2)->tqh_first; \
+ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+ (head1)->tqh_last = (head2)->tqh_last; \
+ TAILQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define STAILQ_HEAD(name, type) \
+struct name { \
+ struct type *stqh_first; /* first element */ \
+ struct type **stqh_last; /* addr of last next element */ \
+}
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).stqh_first }
+
+#define STAILQ_ENTRY(type) \
+struct { \
+ struct type *stqe_next; /* next element */ \
+}
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+#define STAILQ_END(head) NULL
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head))
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define STAILQ_INIT(head) do { \
+ (head)->stqh_first = NULL; \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field) do { \
+ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (head)->stqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field) do { \
+ (elm)->field.stqe_next = NULL; \
+ *(head)->stqh_last = (elm); \
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+ (head)->stqh_last = &(elm)->field.stqe_next; \
+ (listelm)->field.stqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(head)->stqh_first; \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_REMOVE(head, elm, type, field) do { \
+ if ((head)->stqh_first == (elm)) { \
+ STAILQ_REMOVE_HEAD((head), field); \
+ } else { \
+ struct type *curelm = (head)->stqh_first; \
+ while (curelm->field.stqe_next != (elm)) \
+ curelm = curelm->field.stqe_next; \
+ if ((curelm->field.stqe_next = \
+ curelm->field.stqe_next->field.stqe_next) == NULL) \
+ (head)->stqh_last = &(curelm)->field.stqe_next; \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->stqh_first); \
+ (var); \
+ (var) = ((var)->field.stqe_next))
+
+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = STAILQ_FIRST((head)); \
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define STAILQ_CONCAT(head1, head2) do { \
+ if (!STAILQ_EMPTY((head2))) { \
+ *(head1)->stqh_last = (head2)->stqh_first; \
+ (head1)->stqh_last = (head2)->stqh_last; \
+ STAILQ_INIT((head2)); \
+ } \
+} while (/*CONSTCOND*/0)
+
+#define STAILQ_LAST(head, type, field) \
+ (STAILQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *)(void *) \
+ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
+
+
+#ifndef _KERNEL
+/*
+ * Circular queue definitions. Do not use. We still keep the macros
+ * for compatibility but because of pointer aliasing issues their use
+ * is discouraged!
+ */
+
+/*
+ * __launder_type(): We use this ugly hack to work around the the compiler
+ * noticing that two types may not alias each other and elide tests in code.
+ * We hit this in the CIRCLEQ macros when comparing 'struct name *' and
+ * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC
+ * 4.8) declare these comparisons as always false, causing the code to
+ * not run as designed.
+ *
+ * This hack is only to be used for comparisons and thus can be fully const.
+ * Do not use for assignment.
+ *
+ * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix
+ * this by changing the head/tail sentinal values, but see the note above
+ * this one.
+ */
+static __inline const void * __launder_type(const void *);
+static __inline const void *
+__launder_type(const void *__x)
+{
+ __asm __volatile("" : "+r" (__x));
+ return __x;
+}
+
+#if defined(QUEUEDEBUG)
+#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \
+ if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \
+ (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \
+ __FILE__, __LINE__); \
+ if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \
+ (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \
+ __FILE__, __LINE__);
+#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \
+ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \
+ if ((head)->cqh_last != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } else { \
+ if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } \
+ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \
+ if ((head)->cqh_first != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ } else { \
+ if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \
+ QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \
+ (elm), __FILE__, __LINE__); \
+ }
+#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \
+ (elm)->field.cqe_next = (void *)1L; \
+ (elm)->field.cqe_prev = (void *)1L;
+#else
+#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field)
+#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field)
+#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field)
+#endif
+
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head) \
+ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) do { \
+ (head)->cqh_first = CIRCLEQ_END(head); \
+ (head)->cqh_last = CIRCLEQ_END(head); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
+ if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ (elm)->field.cqe_next = CIRCLEQ_END(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_REMOVE(head, elm, field) do { \
+ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
+ QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \
+ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+ QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \
+} while (/*CONSTCOND*/0)
+
+#define CIRCLEQ_FOREACH(var, head, field) \
+ for ((var) = ((head)->cqh_first); \
+ (var) != CIRCLEQ_ENDC(head); \
+ (var) = ((var)->field.cqe_next))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
+ for ((var) = ((head)->cqh_last); \
+ (var) != CIRCLEQ_ENDC(head); \
+ (var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
+#define CIRCLEQ_LAST(head) ((head)->cqh_last)
+/* For comparisons */
+#define CIRCLEQ_ENDC(head) (__launder_type(head))
+/* For assignments */
+#define CIRCLEQ_END(head) ((void *)(head))
+#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
+#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
+#define CIRCLEQ_EMPTY(head) \
+ (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head))
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
+ (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
+ ? ((head)->cqh_first) \
+ : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field) \
+ (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
+ ? ((head)->cqh_last) \
+ : (elm->field.cqe_prev))
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h b/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h
new file mode 100644
index 000000000..eaea56aae
--- /dev/null
+++ b/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h
@@ -0,0 +1,761 @@
+/* $NetBSD: tree.h,v 1.20 2013/09/14 13:20:45 joerg Exp $ */
+/* $OpenBSD: tree.h,v 1.13 2011/07/09 00:19:45 pirofti Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline __unused struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __unused __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-black tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x) do {} while (/*CONSTCOND*/ 0)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
+#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
+attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
+attr struct type *name##_RB_INSERT(struct name *, struct type *); \
+attr struct type *name##_RB_FIND(struct name *, struct type *); \
+attr struct type *name##_RB_NFIND(struct name *, struct type *); \
+attr struct type *name##_RB_NEXT(struct type *); \
+attr struct type *name##_RB_PREV(struct type *); \
+attr struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp,)
+#define RB_GENERATE_STATIC(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
+attr void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) != NULL && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+attr void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+attr struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field)) != NULL) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field)) != NULL); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+attr struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+attr struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+/* Finds the first node greater than or equal to the search key */ \
+attr struct type * \
+name##_RB_NFIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *res = NULL; \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) { \
+ res = tmp; \
+ tmp = RB_LEFT(tmp, field); \
+ } \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (res); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_PREV(struct type *elm) \
+{ \
+ if (RB_LEFT(elm, field)) { \
+ elm = RB_LEFT(elm, field); \
+ while (RB_RIGHT(elm, field)) \
+ elm = RB_RIGHT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+attr struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_PREV(name, x, y) name##_RB_PREV(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#define RB_FOREACH_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_SAFE(x, name, head, y) \
+ for ((x) = RB_MIN(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE(x, name, head) \
+ for ((x) = RB_MAX(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_PREV(x))
+
+#define RB_FOREACH_REVERSE_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \
+ for ((x) = RB_MAX(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/poky/meta/recipes-core/musl/musl-utils.bb b/poky/meta/recipes-core/musl/musl-utils.bb
new file mode 100644
index 000000000..74b846df5
--- /dev/null
+++ b/poky/meta/recipes-core/musl/musl-utils.bb
@@ -0,0 +1,25 @@
+# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "getconf, getent and iconv implementations for musl"
+HOMEPAGE = "https://git.alpinelinux.org/cgit/aports/tree/main/musl"
+LICENSE = "BSD-2-Clause & GPL-2.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9d08215e611db87b357e8674b4b42564"
+SECTION = "utils"
+
+# Date of the commit in SRCREV
+PV = "20170421"
+
+SRCREV = "fb5630138ccabbbc14a19d372096a04e42573c7d"
+SRC_URI = "git://github.com/boltlinux/musl-utils"
+
+inherit autotools
+
+S = "${WORKDIR}/git"
+
+PACKAGES =+ "${PN}-iconv"
+
+FILES_${PN}-iconv = "${bindir}/iconv"
+
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/poky/meta/recipes-core/musl/musl.inc b/poky/meta/recipes-core/musl/musl.inc
new file mode 100644
index 000000000..ba9b1a046
--- /dev/null
+++ b/poky/meta/recipes-core/musl/musl.inc
@@ -0,0 +1,33 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "An implementation of the standard library for Linux-based systems"
+DESCRIPTION = "A new standard library to power a new generation of Linux-based devices. \
+musl is lightweight, fast, simple, free, and strives to be correct in the sense of \
+standards-conformance and safety."
+
+HOMEPAGE = "http://www.musl-libc.org/"
+LICENSE = "MIT"
+SECTION = "libs"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=2b9032093c4765e49ae85ddeba29afff"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}"
+INSANE_SKIP_${PN} = "dev-so"
+
+# Doesn't compile in MIPS16e mode due to use of hand-written
+# assembly
+MIPS_INSTRUCTION_SET = "mips"
+
+# thumb1 is unsupported
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
diff --git a/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
new file mode 100644
index 000000000..462d338b9
--- /dev/null
+++ b/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -0,0 +1,76 @@
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
+Subject: [PATCH] Make dynamic linker a relative symlink to libc
+
+absolute symlink into $(libdir) fails to load in a cross build
+environment, especially when executing qemu in usermode to run target
+applications, which cross build systems often do, since not everything
+can be computed during cross builds, qemu in usermode often comes to aid
+in such situations to feed into cross builds.
+
+V2:
+ Make use of 'ln -r' to create relative symlinks, as most fo the distros
+ shipping coreutils 8.16+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+Upstream-Status: Pending
+---
+ Makefile | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8246b78..d1dbe39 100644
+--- a/Makefile
++++ b/Makefile
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
+ $(INSTALL) -D -m 644 $< $@
+
+ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
+- $(INSTALL) -D -l $(libdir)/libc.so $@ || true
++ $(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
+
+ install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
+
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
+--
+2.7.4
+
diff --git a/poky/meta/recipes-core/musl/musl_git.bb b/poky/meta/recipes-core/musl/musl_git.bb
new file mode 100644
index 000000000..9f8c5126e
--- /dev/null
+++ b/poky/meta/recipes-core/musl/musl_git.bb
@@ -0,0 +1,72 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require musl.inc
+
+SRCREV = "55df09bfccbfe21fc9dd7d8f94550c0ff25ace04"
+
+PV = "1.1.19+git${SRCPV}"
+
+# mirror is at git://github.com/kraj/musl.git
+
+SRC_URI = "git://git.musl-libc.org/musl \
+ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl virtual/crypt"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ libgcc-initial \
+ linux-libc-headers \
+ bsd-headers \
+ "
+
+export CROSS_COMPILE="${TARGET_PREFIX}"
+
+LDFLAGS += "-Wl,-soname,libc.so"
+
+# When compiling for Thumb or Thumb2, frame pointers _must_ be disabled since the
+# Thumb frame pointer in r7 clashes with musl's use of inline asm to make syscalls
+# (where r7 is used for the syscall NR). In most cases, frame pointers will be
+# disabled automatically due to the optimisation level, but append an explicit
+# -fomit-frame-pointer to handle cases where optimisation is set to -O0 or frame
+# pointers have been enabled by -fno-omit-frame-pointer earlier in CFLAGS, etc.
+CFLAGS_append_arm = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
+
+CONFIGUREOPTS = " \
+ --prefix=${prefix} \
+ --exec-prefix=${exec_prefix} \
+ --bindir=${bindir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --syslibdir=${base_libdir} \
+"
+
+do_configure() {
+ ${S}/configure ${CONFIGUREOPTS}
+}
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake install DESTDIR='${D}'
+
+ install -d ${D}${bindir}
+ rm -f ${D}${bindir}/ldd
+ lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
+ for l in crypt dl m pthread resolv rt util xnet
+ do
+ ln -sf libc.so ${D}${libdir}/lib$l.so
+ done
+}
+
+RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev"
+RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
+RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)"
+
+LEAD_SONAME = "libc.so"
diff --git a/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch b/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch
new file mode 100644
index 000000000..4a970561d
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch
@@ -0,0 +1,43 @@
+From a95590f676209832fe0b27226e6de3cb50e2b97c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Aug 2017 14:31:51 +0800
+Subject: [PATCH 1/2] tic hang
+
+Upstream-Status: Inappropriate [configuration]
+
+'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
+loop when processing the original file.
+
+Signed-off-by: anonymous
+
+Rebase to 6.0+20170715
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ misc/terminfo.src | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/misc/terminfo.src b/misc/terminfo.src
+index ee3fab3..176d593 100644
+--- a/misc/terminfo.src
++++ b/misc/terminfo.src
+@@ -5177,12 +5177,11 @@ konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm,
+ # The value for kbs reflects local customization rather than the settings used
+ # for XFree86 xterm.
+ konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
+- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
+- use=konsole-vt100,
+-# Konsole does not implement shifted cursor-keys.
+-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
+- kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2,
+- use=xterm+pcf0,
++ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
++ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
++ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
++ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
++ khome=\EOH, use=konsole-vt100,
+ # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
+ # it is still useful for deriving the other entries.
+ konsole-vt100|KDE console window with vt100 (sic) keyboard,
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch b/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch
new file mode 100644
index 000000000..c47ce6a8c
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch
@@ -0,0 +1,35 @@
+From 939c994f3756c2d6d3cab2e6a04d05fa7c2b1d56 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Aug 2017 14:45:27 +0800
+Subject: [PATCH 2/2] configure: reproducible
+
+"configure" enforces -U for ar flags, breaking deterministic builds.
+The flag was added to fix some vaguely specified "recent POSIX binutil
+build problems" in 2015.
+
+Upstream-Status: Pending
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Rebase to Rebase to 6.0+20170715
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 7d7d2c1..f444354 100755
+--- a/configure
++++ b/configure
+@@ -4458,7 +4458,7 @@ if test "${cf_cv_ar_flags+set}" = set; then
+ else
+
+ cf_cv_ar_flags=unknown
+- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
++ for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+ do
+
+ # check if $ARFLAGS already contains this choice
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-core/ncurses/files/config.cache b/poky/meta/recipes-core/ncurses/files/config.cache
new file mode 100644
index 000000000..6a9217d5b
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/files/config.cache
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+cf_cv_func_nanosleep=yes
+cf_cv_func_mkstemp=yes
diff --git a/poky/meta/recipes-core/ncurses/ncurses.inc b/poky/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 000000000..01e41d5f7
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,318 @@
+SUMMARY = "The New Curses library"
+DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
+HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
+SECTION = "libs"
+DEPENDS = "ncurses-native"
+DEPENDS_class-native = ""
+
+BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config \
+ ${bindir}/ncurses6-config ${bindir}/ncursesw6-config"
+
+inherit autotools binconfig-disabled multilib_header pkgconfig
+
+# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
+SRC_URI = "git://salsa.debian.org/debian/ncurses.git;protocol=https"
+
+EXTRA_AUTORECONF = "-I m4"
+CONFIG_SITE =+ "${WORKDIR}/config.cache"
+
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -I${SYSROOT_DESTDIR}${includedir}'"
+
+# Whether to enable separate widec libraries; must be 'true' or 'false'
+#
+# TODO: remove this variable when widec is supported in every setup?
+ENABLE_WIDEC ?= "true"
+
+# _GNU_SOURCE is required for widec stuff and is detected automatically
+# for target objects. But it must be set manually for native and sdk
+# builds.
+BUILD_CPPFLAGS += "-D_GNU_SOURCE"
+
+# natives don't generally look in base_libdir
+base_libdir_class-native = "${libdir}"
+
+# Display corruption occurs on 64 bit hosts without these settings
+# This was derrived from the upstream debian ncurses which uses
+# these settings for 32 and 64 bit hosts.
+EXCONFIG_ARGS = ""
+EXCONFIG_ARGS_class-native = " \
+ --disable-lp64 \
+ --with-chtype='long' \
+ --with-mmask-t='long'"
+EXCONFIG_ARGS_class-nativesdk = " \
+ --disable-lp64 \
+ --with-chtype='long' \
+ --with-mmask-t='long'"
+
+PACKAGES_DYNAMIC = "^${PN}-lib.*"
+
+# Fall back to the host termcap / terminfo for -nativesdk and -native
+# The reality is a work around for strange problems with things like
+# "bitbake -c menuconfig busybox" where it cannot find the terminfo
+# because the sstate had a hard coded search path. Until this is fixed
+# another way this is deemed good enough.
+EX_TERMCAP = ""
+EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMINFO = ""
+EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+EX_TERMLIB ?= "tinfo"
+
+# Helper function for do_configure to allow multiple configurations
+# $1 the directory to run configure in
+# $@ the arguments to pass to configure
+ncurses_configure() {
+ mkdir -p $1
+ cd $1
+ shift
+ oe_runconf \
+ --without-debug \
+ --without-ada \
+ --without-gpm \
+ --enable-hard-tabs \
+ --enable-xmc-glitch \
+ --enable-colorfgbg \
+ --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
+ --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
+ --with-shared \
+ --disable-big-core \
+ --program-prefix= \
+ --with-ticlib \
+ --with-termlib=${EX_TERMLIB} \
+ --enable-sigwinch \
+ --enable-pc-files \
+ --disable-rpath-hack \
+ ${EXCONFIG_ARGS} \
+ --with-manpage-format=normal \
+ "$@" || return 1
+ cd ..
+}
+
+# Override the function from the autotools class; ncurses requires a
+# patched autoconf213 to generate the configure script. This autoconf
+# is not available so that the shipped script will be used.
+do_configure() {
+ # check does not work with cross-compiling and is generally
+ # broken because it requires stdin to be pollable (which is
+ # not the case for /dev/null redirections)
+ export cf_cv_working_poll=yes
+ #Remove ${includedir} from CPPFLAGS, need for cross compile
+ sed -i 's#-I${cf_includedir}##g' ${S}/configure || die "sed CPPFLAGS"
+
+ # The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
+ mkdir -p ${PKG_CONFIG_LIBDIR}
+ ( cd ${S}; gnu-configize --force )
+ ncurses_configure "narrowc" || \
+ return 1
+ ! ${ENABLE_WIDEC} || \
+ ncurses_configure "widec" "--enable-widec" "--without-progs"
+
+}
+
+do_compile() {
+ oe_runmake -C narrowc libs
+ oe_runmake -C narrowc/progs
+
+ ! ${ENABLE_WIDEC} || \
+ oe_runmake -C widec libs
+}
+
+# set of expected differences between narrowc and widec header
+#
+# TODO: the NCURSES_CH_T difference can cause real problems :(
+_unifdef_cleanup = " \
+ -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
+ -e '/^#define NCURSES_CH_T /d' \
+ -e '/^#include <wchar.h>/d' \
+ -e '\!^/\* .* \*/!d' \
+"
+
+do_test[depends] = "unifdef-native:do_populate_sysroot"
+do_test[dirs] = "${S}"
+do_test() {
+ ${ENABLE_WIDEC} || return 0
+
+ # make sure that the narrow and widec header are compatible
+ # and differ only in minor details.
+ unifdef -k narrowc/include/curses.h | \
+ sed ${_unifdef_cleanup} > curses-narrowc.h
+ unifdef -k widec/include/curses.h | \
+ sed ${_unifdef_cleanup} > curses-widec.h
+
+ diff curses-narrowc.h curses-widec.h
+}
+
+# Split original _install_opts to two parts.
+# One is the options to install contents, the other is the parameters \
+# when running command "make install"
+# Note that install.libs will also implicitly install header files,
+# so we do not need to explicitly specify install.includes.
+# Doing so could in fact result in a race condition, as both targets
+# (install.libs and install.includes) would install the same headers
+# at the same time
+
+_install_opts = " install.libs install.man "
+
+_install_cfgs = "\
+ DESTDIR='${D}' \
+ PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
+"
+
+do_install() {
+ # Order of installation is important; widec installs a 'curses.h'
+ # header with more definitions and must be installed last hence.
+ # Compatibility of these headers will be checked in 'do_test()'.
+ oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \
+ install.progs
+
+ # The install.data should run after install.libs, otherwise
+ # there would be a race issue in a very critical conditon, since
+ # tic will be run by install.data, and tic needs libtinfo.so
+ # which would be regenerated by install.libs.
+ oe_runmake -C narrowc ${_install_cfgs} \
+ install.data
+
+
+ ! ${ENABLE_WIDEC} || \
+ oe_runmake -C widec ${_install_cfgs} ${_install_opts}
+
+ cd narrowc
+
+ # include some basic terminfo files
+ # stolen ;) from gentoo and modified a bit
+ for x in ansi console dumb linux rxvt screen screen-256color sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
+ do
+ local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
+ local basedir="$(basename $(dirname "${termfile}"))"
+
+ if [ -n "${termfile}" ]
+ then
+ install -d ${D}${sysconfdir}/terminfo/${basedir}
+ mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
+ ln -s /etc/terminfo/${basedir}/${x} \
+ ${D}${datadir}/terminfo/${basedir}/${x}
+ fi
+ done
+ # i think we can use xterm-color as default xterm
+ if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
+ then
+ ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
+ fi
+
+ # When changing ${libdir} to e.g. /usr/lib/myawesomelib/ ncurses
+ # still installs '/usr/lib/terminfo', so try to rm both
+ # the proper path and a slightly hardcoded one
+ rm -f ${D}${libdir}/terminfo ${D}${prefix}/lib/terminfo
+
+ # create linker scripts for libcurses.so and libncurses to
+ # link against -ltinfo when needed. Some builds might break
+ # else when '-Wl,--no-copy-dt-needed-entries' has been set in
+ # linker flags.
+ for i in libncurses libncursesw; do
+ f=${D}${libdir}/$i.so
+ test -h $f || continue
+ rm -f $f
+ echo '/* GNU ld script */' >$f
+ echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
+ done
+
+ # Make sure that libcurses is linked so that it gets -ltinfo
+ # also, this should be addressed upstream really.
+ ln -sf libncurses.so ${D}${libdir}/libcurses.so
+
+ # create libtermcap.so linker script for backward compatibility
+ f=${D}${libdir}/libtermcap.so
+ echo '/* GNU ld script */' >$f
+ echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
+
+ if [ ! -d "${D}${base_libdir}" ]; then
+ # Setting base_libdir to libdir as is done in the -native
+ # case will skip this code
+ mkdir -p ${D}${base_libdir}
+ mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
+ ! ${ENABLE_WIDEC} || \
+ mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
+
+ mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
+ rm ${D}${libdir}/libtinfo.so
+
+ # Use lnr to ensure this is a relative link despite absolute paths
+ # (as we can't know the relationship between base_libdir and libdir).
+ # At some point we can rely on coreutils 8.16 which has ln -r.
+ lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
+ fi
+ if [ -d "${D}${includedir}/ncurses" ]; then
+ for f in `find ${D}${includedir}/ncurses -name "*.h"`
+ do
+ f=`basename $f`
+ test -e ${D}${includedir}/$f && continue
+ ln -sf ncurses/$f ${D}${includedir}/$f
+ done
+ fi
+ oe_multilib_header curses.h
+}
+
+python populate_packages_prepend () {
+ libdir = d.expand("${libdir}")
+ base_libdir = d.expand("${base_libdir}")
+ pnbase = d.expand("${PN}-lib%s")
+ do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+ if libdir is not base_libdir:
+ do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+}
+
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_ncurses-tools_class-target = "clear reset"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES += " \
+ ${PN}-tools \
+ ${PN}-terminfo-base \
+ ${PN}-terminfo \
+"
+
+FILES_${PN} = "\
+ ${bindir}/tput \
+ ${bindir}/tset \
+ ${bindir}/ncurses5-config \
+ ${bindir}/ncursesw5-config \
+ ${bindir}/ncurses6-config \
+ ${bindir}/ncursesw6-config \
+ ${datadir}/tabset \
+"
+
+# This keeps only tput/tset in ncurses
+# clear/reset are in already busybox
+FILES_${PN}-tools = "\
+ ${bindir}/tic \
+ ${bindir}/toe \
+ ${bindir}/infotocap \
+ ${bindir}/captoinfo \
+ ${bindir}/infocmp \
+ ${bindir}/clear${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
+ ${bindir}/reset${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
+ ${bindir}/tack \
+ ${bindir}/tabs \
+"
+
+# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
+RDEPENDS_${PN}-tools = "${PN}"
+
+FILES_${PN}-terminfo = "\
+ ${datadir}/terminfo \
+"
+
+FILES_${PN}-terminfo-base = "\
+ ${sysconfdir}/terminfo \
+"
+
+RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
+RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"
diff --git a/poky/meta/recipes-core/ncurses/ncurses_6.0+20171125.bb b/poky/meta/recipes-core/ncurses/ncurses_6.0+20171125.bb
new file mode 100644
index 000000000..6c4b96f42
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/ncurses_6.0+20171125.bb
@@ -0,0 +1,11 @@
+require ncurses.inc
+
+SRC_URI += "file://0001-tic-hang.patch \
+ file://0002-configure-reproducible.patch \
+ file://config.cache \
+"
+# commit id corresponds to the revision in package version
+SRCREV = "5d849e836052459901cfe0b85a0b2939ff8d2b2a"
+S = "${WORKDIR}/git"
+EXTRA_OECONF += "--with-abi-version=5"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"
diff --git a/poky/meta/recipes-core/ncurses/site_config/headers b/poky/meta/recipes-core/ncurses/site_config/headers
new file mode 100644
index 000000000..087b7bfd5
--- /dev/null
+++ b/poky/meta/recipes-core/ncurses/site_config/headers
@@ -0,0 +1,5 @@
+curses.h
+ncurses/curses.h
+ncurses.h
+ncurses/termcap.h
+
diff --git a/poky/meta/recipes-core/netbase/netbase/hosts b/poky/meta/recipes-core/netbase/netbase/hosts
new file mode 100644
index 000000000..b94f414d5
--- /dev/null
+++ b/poky/meta/recipes-core/netbase/netbase/hosts
@@ -0,0 +1,8 @@
+127.0.0.1 localhost.localdomain localhost
+
+# The following lines are desirable for IPv6 capable hosts
+::1 localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
diff --git a/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch b/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
new file mode 100644
index 000000000..56c8d5b5c
--- /dev/null
+++ b/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
@@ -0,0 +1,48 @@
+From 76989205a1411f16d7ab09ff9d279539a73dc259 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Thu, 12 Jan 2017 16:50:58 +0200
+Subject: [PATCH] netbase: add rpcbind as an alias to sunrpc
+
+the patch comes from:
+https://bugs.archlinux.org/task/20273
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ etc-rpc | 2 +-
+ etc-services | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/etc-rpc b/etc-rpc
+index 1b30625..9a9a81a 100644
+--- a/etc-rpc
++++ b/etc-rpc
+@@ -1,7 +1,7 @@
+ # This file contains user readable names that can be used in place of rpc
+ # program numbers.
+
+-portmapper 100000 portmap sunrpc
++portmapper 100000 portmap sunrpc rpcbind
+ rstatd 100001 rstat rstat_svc rup perfmeter
+ rusersd 100002 rusers
+ nfs 100003 nfsprog
+diff --git a/etc-services b/etc-services
+index e3202ec..a039d7e 100644
+--- a/etc-services
++++ b/etc-services
+@@ -64,8 +64,8 @@ csnet-ns 105/udp cso-ns
+ rtelnet 107/tcp # Remote Telnet
+ rtelnet 107/udp
+ pop3 110/tcp pop-3 # POP version 3
+-sunrpc 111/tcp portmapper # RPC 4.0 portmapper
+-sunrpc 111/udp portmapper
++sunrpc 111/tcp portmapper rpcbind # RPC 4.0 portmapper
++sunrpc 111/udp portmapper rpcbind
+ auth 113/tcp authentication tap ident
+ sftp 115/tcp
+ nntp 119/tcp readnews untp # USENET News Transfer Protocol
+--
+2.4.0
+
diff --git a/poky/meta/recipes-core/netbase/netbase_5.4.bb b/poky/meta/recipes-core/netbase/netbase_5.4.bb
new file mode 100644
index 000000000..5ab0c58f8
--- /dev/null
+++ b/poky/meta/recipes-core/netbase/netbase_5.4.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Basic TCP/IP networking support"
+DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
+HOMEPAGE = "http://packages.debian.org/netbase"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PE = "1"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20170112T093812Z/pool/main/n/${BPN}/${BPN}_${PV}.tar.xz \
+ file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
+ file://hosts"
+
+SRC_URI[md5sum] = "117cb70c55ef3c1c002f127812b114c1"
+SRC_URI[sha256sum] = "66ff73d2d162e2d49db43988d8b8cd328cf7fffca042db73397f14c71825e80d"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netbase/"
+do_install () {
+ install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
+ install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
+ install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
+ install -m 0644 etc-services ${D}${sysconfdir}/services
+}
+
+CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/poky/meta/recipes-core/os-release/os-release.bb b/poky/meta/recipes-core/os-release/os-release.bb
new file mode 100644
index 000000000..f98870475
--- /dev/null
+++ b/poky/meta/recipes-core/os-release/os-release.bb
@@ -0,0 +1,47 @@
+inherit allarch
+
+SUMMARY = "Operating system identification"
+DESCRIPTION = "The /etc/os-release file contains operating system identification data."
+LICENSE = "MIT"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+
+# Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME
+# HOME_URL SUPPORT_URL BUG_REPORT_URL
+OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME"
+
+ID = "${DISTRO}"
+NAME = "${DISTRO_NAME}"
+VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
+VERSION_ID = "${DISTRO_VERSION}"
+PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
+BUILD_ID ?= "${DATETIME}"
+BUILD_ID[vardepsexclude] = "DATETIME"
+
+def sanitise_version(ver):
+ # VERSION_ID should be (from os-release(5)):
+ # lower-case string (mostly numeric, no spaces or other characters
+ # outside of 0-9, a-z, ".", "_" and "-")
+ ret = ver.replace('+', '-').replace(' ','_')
+ return ret.lower()
+
+python do_compile () {
+ import shutil
+ with open(d.expand('${B}/os-release'), 'w') as f:
+ for field in d.getVar('OS_RELEASE_FIELDS').split():
+ value = d.getVar(field)
+ if value and field == 'VERSION_ID':
+ value = sanitise_version(value)
+ if value:
+ f.write('{0}="{1}"\n'.format(field, value))
+}
+do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
+
+do_install () {
+ install -d ${D}${sysconfdir}
+ install -m 0644 os-release ${D}${sysconfdir}/
+}
diff --git a/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb b/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
new file mode 100644
index 000000000..0d2b8bf52
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "boot image with UEFI shell and tools"
+
+# For this image recipe, only the wic format with a
+# single vfat partition makes sense. Because we have no
+# boot loader and no rootfs partition, not additional
+# tools are needed for this .wks file.
+IMAGE_FSTYPES_forcevariable = 'wic'
+WKS_FILE = "ovmf/ovmf-shell-image.wks"
+WKS_FILE_DEPENDS = ""
+
+inherit image
+
+# We want a minimal image with just ovmf-shell-efi unpacked in it. We
+# avoid installing unnecessary stuff as much as possible, but some
+# things still get through and need to be removed.
+PACKAGE_INSTALL = "ovmf-shell-efi"
+LINGUAS_INSTALL = ""
+do_image () {
+ rm -rf `ls -d ${IMAGE_ROOTFS}/* | grep -v efi`
+}
diff --git a/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch b/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch
new file mode 100644
index 000000000..5bb418b95
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch
@@ -0,0 +1,46 @@
+From f65e9cc025278387b494c2383c5d9ff3bed98687 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 11 Jun 2017 00:47:24 -0700
+Subject: [PATCH] ia32: Dont use -pie
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ BaseTools/Conf/tools_def.template | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/BaseTools/Conf/tools_def.template
+===================================================================
+--- git.orig/BaseTools/Conf/tools_def.template
++++ git/BaseTools/Conf/tools_def.template
+@@ -4336,7 +4336,7 @@ RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
+ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
+
+ DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
+-DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
++DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe -fno-PIE -no-pie
+ DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
+ DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
+ DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
+@@ -4369,9 +4369,9 @@ DEFINE GCC_ARM_RC_FLAGS = -I
+ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
+
+ DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+-DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
++DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie
+ DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables
+-DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
++DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 -no-pie
+ DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+ DEFINE GCC44_IA32_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC44_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
+@@ -4451,7 +4451,7 @@ DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = D
+
+ DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS)
+ DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
+-DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
++DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -no-pie
+ DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+ DEFINE GCC49_IA32_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC49_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS)
diff --git a/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch b/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
new file mode 100644
index 000000000..94ae5d449
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
@@ -0,0 +1,33 @@
+From 9e632e3f9edd09632cc877dff6ea57608f979aab Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Thu, 9 Jun 2016 02:23:01 -0700
+Subject: [PATCH] ovmf: update path to native BaseTools
+
+BaseTools is a set of utilities to build EDK-based firmware. These utilities
+are used during the build process. Thus, they need to be built natively.
+When cross-compiling, we need to provide a path to the location of these
+tools. The BBAKE_EDK_TOOLS_PATH string is used as a pattern to be replaced
+with the appropriate location before building.
+
+Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Upstream-Status: Pending
+---
+ OvmfPkg/build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
+index eb5eb73..9058fca 100755
+--- a/OvmfPkg/build.sh
++++ b/OvmfPkg/build.sh
+@@ -30,7 +30,7 @@ then
+ # this assumes svn pulls have the same root dir
+ # export EDK_TOOLS_PATH=`pwd`/../BaseTools
+ # This version is for the tools source in edk2
+- export EDK_TOOLS_PATH=`pwd`/BaseTools
++ export EDK_TOOLS_PATH=BBAKE_EDK_TOOLS_PATH/BaseTools
+ echo $EDK_TOOLS_PATH
+ source edksetup.sh BaseTools
+ else
+--
+2.8.1
+
diff --git a/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
new file mode 100644
index 000000000..65b5c16dc
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
@@ -0,0 +1,39 @@
+From 2320650c6d381b914fe91b2dedaa5870279a8bcf Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Sun, 27 Nov 2016 18:42:55 -0800
+Subject: [PATCH] BaseTools: makefile: adjust to build in under bitbake
+
+Prepend the build flags with those of bitbake. This is to build
+using the bitbake native sysroot include and library directories.
+
+Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
+Upstream-Status: Pending
+---
+ BaseTools/Source/C/Makefiles/header.makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: git/BaseTools/Source/C/Makefiles/header.makefile
+===================================================================
+--- git.orig/BaseTools/Source/C/Makefiles/header.makefile
++++ git/BaseTools/Source/C/Makefiles/header.makefile
+@@ -44,15 +44,15 @@ ARCH_INCLUDE = -I $(MAKEROOT)/Include/AA
+ endif
+
+ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
+-BUILD_CPPFLAGS = $(INCLUDE) -O2
++BUILD_CPPFLAGS += $(INCLUDE) -O2
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
+ else
+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
+ endif
+-BUILD_LFLAGS =
+-BUILD_CXXFLAGS = -Wno-unused-result
++BUILD_LFLAGS = $(LDFLAGS)
++BUILD_CXXFLAGS += -Wno-unused-result
+
+ ifeq ($(ARCH), IA32)
+ #
diff --git a/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch b/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch
new file mode 100644
index 000000000..d954fbe31
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch
@@ -0,0 +1,18 @@
+From 032fc6b1f7691bd537fd2a6bd13821fcf3c45e64 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Mon, 11 Sep 2017 02:21:55 -0400
+Subject: [PATCH] ovmf: enable long path file
+
+Upstream-Status: Pending
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ BaseTools/Source/C/Common/CommonLib.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h
+index 2041b89e2d..8116aa2e35 100644
+--- a/BaseTools/Source/C/Common/CommonLib.h
++++ b/BaseTools/Source/C/Common/CommonLib.h
+@@ -22 +22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-#define MAX_LONG_FILE_PATH 500
++#define MAX_LONG_FILE_PATH 1023
diff --git a/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch b/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
new file mode 100644
index 000000000..3aa6cc4ac
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
@@ -0,0 +1,1124 @@
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Mon, 6 Jul 2015 20:22:02 +0200
+Subject: [PATCH] OvmfPkg: EnrollDefaultKeys: application for enrolling default
+ keys
+
+(A port of the <https://bugzilla.redhat.com/show_bug.cgi?id=1148296> patch
+to Gerd's public RPMs.)
+
+This application is meant to be invoked by the management layer, after
+booting the UEFI shell and getting a shell prompt on the serial console.
+The app enrolls a number of certificates (see below), and then reports
+status to the serial console as well. The expected output is "info:
+success":
+
+> Shell> EnrollDefaultKeys.efi
+> info: SetupMode=1 SecureBoot=0 SecureBootEnable=0 CustomMode=0 VendorKeys=1
+> info: SetupMode=0 SecureBoot=1 SecureBootEnable=1 CustomMode=0 VendorKeys=0
+> info: success
+> Shell>
+
+In case of success, the management layer can force off or reboot the VM
+(for example with the "reset -s" or "reset -c" UEFI shell commands,
+respectively), and start the guest installation with SecureBoot enabled.
+
+PK:
+- A unique, static, ad-hoc certificate whose private half has been
+ destroyed (more precisely, never saved) and is therefore unusable for
+ signing. (The command for creating this certificate is saved in the
+ source code.)
+
+KEK:
+- same ad-hoc certificate as used for the PK,
+- "Microsoft Corporation KEK CA 2011" -- the dbx data in Fedora's dbxtool
+ package is signed (indirectly, through a chain) with this; enrolling
+ such a KEK should allow guests to install those updates.
+
+DB:
+- "Microsoft Windows Production PCA 2011" -- to load Windows 8 and Windows
+ Server 2012 R2,
+- "Microsoft Corporation UEFI CA 2011" -- to load Linux and signed PCI
+ oproms.
+
+Contributed-under: TianoCore Contribution Agreement 1.0
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 960 ++++++++++++++++++++++++
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf | 51 ++
+ OvmfPkg/OvmfPkgIa32.dsc | 4 +
+ OvmfPkg/OvmfPkgIa32X64.dsc | 4 +
+ OvmfPkg/OvmfPkgX64.dsc | 4 +
+ 5 files changed, 1023 insertions(+)
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+new file mode 100644
+index 0000000..081212b
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+@@ -0,0 +1,960 @@
++/** @file
++ Enroll default PK, KEK, DB.
++
++ Copyright (C) 2014, Red Hat, Inc.
++
++ This program and the accompanying materials are licensed and made available
++ under the terms and conditions of the BSD License which accompanies this
++ distribution. The full text of the license may be found at
++ http://opensource.org/licenses/bsd-license.
++
++ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
++ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
++**/
++#include <Guid/AuthenticatedVariableFormat.h> // gEfiCustomModeEnableGuid
++#include <Guid/GlobalVariable.h> // EFI_SETUP_MODE_NAME
++#include <Guid/ImageAuthentication.h> // EFI_IMAGE_SECURITY_DATABASE
++#include <Library/BaseMemoryLib.h> // CopyGuid()
++#include <Library/DebugLib.h> // ASSERT()
++#include <Library/MemoryAllocationLib.h> // FreePool()
++#include <Library/ShellCEntryLib.h> // ShellAppMain()
++#include <Library/UefiLib.h> // AsciiPrint()
++#include <Library/UefiRuntimeServicesTableLib.h> // gRT
++
++//
++// The example self-signed certificate below, which we'll use for both Platform
++// Key, and first Key Exchange Key, has been generated with the following
++// non-interactive openssl command. The passphrase is read from /dev/urandom,
++// and not saved, and the private key is written to /dev/null. In other words,
++// we can't sign anything else against this certificate, which is our purpose.
++//
++/*
++ openssl req \
++ -passout file:<(head -c 16 /dev/urandom) \
++ -x509 \
++ -newkey rsa:2048 \
++ -keyout /dev/null \
++ -outform DER \
++ -subj $(
++ printf /C=US
++ printf /ST=TestStateOrProvince
++ printf /L=TestLocality
++ printf /O=TestOrganization
++ printf /OU=TestOrganizationalUnit
++ printf /CN=TestCommonName
++ printf /emailAddress=test@example.com
++ ) \
++ 2>/dev/null \
++ | xxd -i
++*/
++STATIC CONST UINT8 ExampleCert[] = {
++ 0x30, 0x82, 0x04, 0x45, 0x30, 0x82, 0x03, 0x2d, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x09, 0x00, 0xcf, 0x9f, 0x51, 0xa3, 0x07, 0xdb, 0x54, 0xa1, 0x30, 0x0d,
++ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,
++ 0x30, 0x81, 0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
++ 0x02, 0x55, 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c,
++ 0x13, 0x54, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50,
++ 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
++ 0x55, 0x04, 0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61,
++ 0x6c, 0x69, 0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x0c, 0x10, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a,
++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04,
++ 0x0b, 0x0c, 0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69,
++ 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31,
++ 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73,
++ 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f,
++ 0x30, 0x1d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01,
++ 0x16, 0x10, 0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
++ 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x34, 0x31, 0x30,
++ 0x30, 0x39, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x17, 0x0d, 0x31, 0x34,
++ 0x31, 0x31, 0x30, 0x38, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x30, 0x81,
++ 0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
++ 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x13, 0x54,
++ 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50, 0x72, 0x6f,
++ 0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
++ 0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69,
++ 0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x10,
++ 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c,
++ 0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61,
++ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x17, 0x30,
++ 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x43,
++ 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f, 0x30, 0x1d,
++ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x10,
++ 0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
++ 0x63, 0x6f, 0x6d, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
++ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
++ 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbf, 0xf1, 0xce,
++ 0x17, 0x32, 0xac, 0xc4, 0x4b, 0xb2, 0xed, 0x84, 0x76, 0xe5, 0xd0, 0xf8, 0x21,
++ 0xac, 0x10, 0xf8, 0x18, 0x09, 0x0e, 0x07, 0x13, 0x76, 0x21, 0x5c, 0xc4, 0xcc,
++ 0xd5, 0xe6, 0x25, 0xa7, 0x26, 0x53, 0x79, 0x2f, 0x16, 0x4b, 0x85, 0xbd, 0xae,
++ 0x42, 0x64, 0x58, 0xcb, 0x5e, 0xe8, 0x6e, 0x5a, 0xd0, 0xc4, 0x0f, 0x38, 0x16,
++ 0xbe, 0xd3, 0x22, 0xa7, 0x3c, 0x9b, 0x8b, 0x5e, 0xcb, 0x62, 0x35, 0xc5, 0x9b,
++ 0xe2, 0x8e, 0x4c, 0x65, 0x57, 0x4f, 0xcb, 0x27, 0xad, 0xe7, 0x63, 0xa7, 0x77,
++ 0x2b, 0xd5, 0x02, 0x42, 0x70, 0x46, 0xac, 0xba, 0xb6, 0x60, 0x57, 0xd9, 0xce,
++ 0x31, 0xc5, 0x12, 0x03, 0x4a, 0xf7, 0x2a, 0x2b, 0x40, 0x06, 0xb4, 0xdb, 0x31,
++ 0xb7, 0x83, 0x6c, 0x67, 0x87, 0x98, 0x8b, 0xce, 0x1b, 0x30, 0x7a, 0xfa, 0x35,
++ 0x6c, 0x86, 0x20, 0x74, 0xc5, 0x7d, 0x32, 0x31, 0x18, 0xeb, 0x69, 0xf7, 0x2d,
++ 0x20, 0xc4, 0xf0, 0xd2, 0xfa, 0x67, 0x81, 0xc1, 0xbb, 0x23, 0xbb, 0x75, 0x1a,
++ 0xe4, 0xb4, 0x49, 0x99, 0xdf, 0x12, 0x4c, 0xe3, 0x6d, 0x76, 0x24, 0x85, 0x24,
++ 0xae, 0x5a, 0x9e, 0xbd, 0x54, 0x1c, 0xf9, 0x0e, 0xed, 0x96, 0xb5, 0xd8, 0xa2,
++ 0x0d, 0x2a, 0x38, 0x5d, 0x12, 0x97, 0xb0, 0x4d, 0x75, 0x85, 0x1e, 0x47, 0x6d,
++ 0xe1, 0x25, 0x59, 0xcb, 0xe9, 0x33, 0x86, 0x6a, 0xef, 0x98, 0x24, 0xa0, 0x2b,
++ 0x02, 0x7b, 0xc0, 0x9f, 0x88, 0x03, 0xb0, 0xbe, 0x22, 0x65, 0x83, 0x77, 0xb3,
++ 0x30, 0xba, 0xe0, 0x3b, 0x54, 0x31, 0x3a, 0x45, 0x81, 0x9c, 0x48, 0xaf, 0xc1,
++ 0x11, 0x5b, 0xf2, 0x3a, 0x1e, 0x33, 0x1b, 0x8f, 0x0e, 0x04, 0xa4, 0x16, 0xd4,
++ 0x6b, 0x57, 0xee, 0xe7, 0xba, 0xf5, 0xee, 0xaf, 0xe2, 0x4c, 0x50, 0xf8, 0x68,
++ 0x57, 0x88, 0xfb, 0x7f, 0xa3, 0xcf, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50,
++ 0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
++ 0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e, 0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3,
++ 0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29, 0x61, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
++ 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e,
++ 0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3, 0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29,
++ 0x61, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01,
++ 0x01, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
++ 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x12, 0x9c, 0x3e, 0x38,
++ 0xfc, 0x26, 0xea, 0x6d, 0xb7, 0x5c, 0x29, 0x3c, 0x76, 0x20, 0x0c, 0xb2, 0xa9,
++ 0x0f, 0xdf, 0xc0, 0x85, 0xfe, 0xeb, 0xec, 0x1d, 0x5d, 0x73, 0x84, 0xac, 0x8a,
++ 0xb4, 0x2a, 0x86, 0x38, 0x30, 0xaf, 0xd2, 0x2d, 0x2a, 0xde, 0x54, 0xc8, 0x5c,
++ 0x29, 0x90, 0x24, 0xf2, 0x39, 0xc1, 0xa5, 0x00, 0xb4, 0xb7, 0xd8, 0xdc, 0x59,
++ 0x64, 0x50, 0x62, 0x5f, 0x54, 0xf1, 0x73, 0x02, 0x4d, 0x43, 0xc5, 0xc3, 0xc4,
++ 0x0e, 0x62, 0x60, 0x8c, 0x53, 0x66, 0x57, 0x77, 0xb5, 0x81, 0xda, 0x1f, 0x81,
++ 0xda, 0xe9, 0xd6, 0x5e, 0x82, 0xce, 0xa7, 0x5c, 0xc0, 0xa6, 0xbe, 0x9c, 0x5c,
++ 0x7b, 0xa5, 0x15, 0xc8, 0xd7, 0x14, 0x53, 0xd3, 0x5c, 0x1c, 0x9f, 0x8a, 0x9f,
++ 0x66, 0x15, 0xd5, 0xd3, 0x2a, 0x27, 0x0c, 0xee, 0x9f, 0x80, 0x39, 0x88, 0x7b,
++ 0x24, 0xde, 0x0c, 0x61, 0xa3, 0x44, 0xd8, 0x8d, 0x2e, 0x79, 0xf8, 0x1e, 0x04,
++ 0x5a, 0xcb, 0xd6, 0x9c, 0xa3, 0x22, 0x8f, 0x09, 0x32, 0x1e, 0xe1, 0x65, 0x8f,
++ 0x10, 0x5f, 0xd8, 0x52, 0x56, 0xd5, 0x77, 0xac, 0x58, 0x46, 0x60, 0xba, 0x2e,
++ 0xe2, 0x3f, 0x58, 0x7d, 0x60, 0xfc, 0x31, 0x4a, 0x3a, 0xaf, 0x61, 0x55, 0x5f,
++ 0xfb, 0x68, 0x14, 0x74, 0xda, 0xdc, 0x42, 0x78, 0xcc, 0xee, 0xff, 0x5c, 0x03,
++ 0x24, 0x26, 0x2c, 0xb8, 0x3a, 0x81, 0xad, 0xdb, 0xe7, 0xed, 0xe1, 0x62, 0x84,
++ 0x07, 0x1a, 0xc8, 0xa4, 0x4e, 0xb0, 0x87, 0xf7, 0x96, 0xd8, 0x33, 0x9b, 0x0d,
++ 0xa7, 0x77, 0xae, 0x5b, 0xaf, 0xad, 0xe6, 0x5a, 0xc9, 0xfa, 0xa4, 0xe4, 0xe5,
++ 0x57, 0xbb, 0x97, 0xdd, 0x92, 0x85, 0xd8, 0x03, 0x45, 0xfe, 0xd8, 0x6b, 0xb1,
++ 0xdb, 0x85, 0x36, 0xb9, 0xd9, 0x28, 0xbf, 0x17, 0xae, 0x11, 0xde, 0x10, 0x19,
++ 0x26, 0x5b, 0xc0, 0x3d, 0xc7
++};
++
++//
++// Second KEK: "Microsoft Corporation KEK CA 2011".
++// SHA1: 31:59:0b:fd:89:c9:d7:4e:d0:87:df:ac:66:33:4b:39:31:25:4b:30
++//
++// "dbx" updates in "dbxtool" are signed with a key derived from this KEK.
++//
++STATIC CONST UINT8 MicrosoftKEK[] = {
++ 0x30, 0x82, 0x05, 0xe8, 0x30, 0x82, 0x03, 0xd0, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x0a, 0xd1, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++ 0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++ 0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++ 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++ 0x36, 0x32, 0x34, 0x32, 0x30, 0x34, 0x31, 0x32, 0x39, 0x5a, 0x17, 0x0d, 0x32,
++ 0x36, 0x30, 0x36, 0x32, 0x34, 0x32, 0x30, 0x35, 0x31, 0x32, 0x39, 0x5a, 0x30,
++ 0x81, 0x80, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++ 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++ 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++ 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++ 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++ 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++ 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2a, 0x30, 0x28, 0x06,
++ 0x03, 0x55, 0x04, 0x03, 0x13, 0x21, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++ 0x6e, 0x20, 0x4b, 0x45, 0x4b, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31,
++ 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
++ 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82,
++ 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc4, 0xe8, 0xb5, 0x8a, 0xbf, 0xad,
++ 0x57, 0x26, 0xb0, 0x26, 0xc3, 0xea, 0xe7, 0xfb, 0x57, 0x7a, 0x44, 0x02, 0x5d,
++ 0x07, 0x0d, 0xda, 0x4a, 0xe5, 0x74, 0x2a, 0xe6, 0xb0, 0x0f, 0xec, 0x6d, 0xeb,
++ 0xec, 0x7f, 0xb9, 0xe3, 0x5a, 0x63, 0x32, 0x7c, 0x11, 0x17, 0x4f, 0x0e, 0xe3,
++ 0x0b, 0xa7, 0x38, 0x15, 0x93, 0x8e, 0xc6, 0xf5, 0xe0, 0x84, 0xb1, 0x9a, 0x9b,
++ 0x2c, 0xe7, 0xf5, 0xb7, 0x91, 0xd6, 0x09, 0xe1, 0xe2, 0xc0, 0x04, 0xa8, 0xac,
++ 0x30, 0x1c, 0xdf, 0x48, 0xf3, 0x06, 0x50, 0x9a, 0x64, 0xa7, 0x51, 0x7f, 0xc8,
++ 0x85, 0x4f, 0x8f, 0x20, 0x86, 0xce, 0xfe, 0x2f, 0xe1, 0x9f, 0xff, 0x82, 0xc0,
++ 0xed, 0xe9, 0xcd, 0xce, 0xf4, 0x53, 0x6a, 0x62, 0x3a, 0x0b, 0x43, 0xb9, 0xe2,
++ 0x25, 0xfd, 0xfe, 0x05, 0xf9, 0xd4, 0xc4, 0x14, 0xab, 0x11, 0xe2, 0x23, 0x89,
++ 0x8d, 0x70, 0xb7, 0xa4, 0x1d, 0x4d, 0xec, 0xae, 0xe5, 0x9c, 0xfa, 0x16, 0xc2,
++ 0xd7, 0xc1, 0xcb, 0xd4, 0xe8, 0xc4, 0x2f, 0xe5, 0x99, 0xee, 0x24, 0x8b, 0x03,
++ 0xec, 0x8d, 0xf2, 0x8b, 0xea, 0xc3, 0x4a, 0xfb, 0x43, 0x11, 0x12, 0x0b, 0x7e,
++ 0xb5, 0x47, 0x92, 0x6c, 0xdc, 0xe6, 0x04, 0x89, 0xeb, 0xf5, 0x33, 0x04, 0xeb,
++ 0x10, 0x01, 0x2a, 0x71, 0xe5, 0xf9, 0x83, 0x13, 0x3c, 0xff, 0x25, 0x09, 0x2f,
++ 0x68, 0x76, 0x46, 0xff, 0xba, 0x4f, 0xbe, 0xdc, 0xad, 0x71, 0x2a, 0x58, 0xaa,
++ 0xfb, 0x0e, 0xd2, 0x79, 0x3d, 0xe4, 0x9b, 0x65, 0x3b, 0xcc, 0x29, 0x2a, 0x9f,
++ 0xfc, 0x72, 0x59, 0xa2, 0xeb, 0xae, 0x92, 0xef, 0xf6, 0x35, 0x13, 0x80, 0xc6,
++ 0x02, 0xec, 0xe4, 0x5f, 0xcc, 0x9d, 0x76, 0xcd, 0xef, 0x63, 0x92, 0xc1, 0xaf,
++ 0x79, 0x40, 0x84, 0x79, 0x87, 0x7f, 0xe3, 0x52, 0xa8, 0xe8, 0x9d, 0x7b, 0x07,
++ 0x69, 0x8f, 0x15, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x4f, 0x30,
++ 0x82, 0x01, 0x4b, 0x30, 0x10, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82,
++ 0x37, 0x15, 0x01, 0x04, 0x03, 0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55,
++ 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x62, 0xfc, 0x43, 0xcd, 0xa0, 0x3e, 0xa4,
++ 0xcb, 0x67, 0x12, 0xd2, 0x5b, 0xd9, 0x55, 0xac, 0x7b, 0xcc, 0xb6, 0x8a, 0x5f,
++ 0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02,
++ 0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00,
++ 0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01,
++ 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05,
++ 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04,
++ 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58, 0x11,
++ 0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8, 0x30,
++ 0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51, 0xa0,
++ 0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63,
++ 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e,
++ 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70,
++ 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f,
++ 0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f,
++ 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63,
++ 0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01,
++ 0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05,
++ 0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++ 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x74,
++ 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61,
++ 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d,
++ 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09,
++ 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82,
++ 0x02, 0x01, 0x00, 0xd4, 0x84, 0x88, 0xf5, 0x14, 0x94, 0x18, 0x02, 0xca, 0x2a,
++ 0x3c, 0xfb, 0x2a, 0x92, 0x1c, 0x0c, 0xd7, 0xa0, 0xd1, 0xf1, 0xe8, 0x52, 0x66,
++ 0xa8, 0xee, 0xa2, 0xb5, 0x75, 0x7a, 0x90, 0x00, 0xaa, 0x2d, 0xa4, 0x76, 0x5a,
++ 0xea, 0x79, 0xb7, 0xb9, 0x37, 0x6a, 0x51, 0x7b, 0x10, 0x64, 0xf6, 0xe1, 0x64,
++ 0xf2, 0x02, 0x67, 0xbe, 0xf7, 0xa8, 0x1b, 0x78, 0xbd, 0xba, 0xce, 0x88, 0x58,
++ 0x64, 0x0c, 0xd6, 0x57, 0xc8, 0x19, 0xa3, 0x5f, 0x05, 0xd6, 0xdb, 0xc6, 0xd0,
++ 0x69, 0xce, 0x48, 0x4b, 0x32, 0xb7, 0xeb, 0x5d, 0xd2, 0x30, 0xf5, 0xc0, 0xf5,
++ 0xb8, 0xba, 0x78, 0x07, 0xa3, 0x2b, 0xfe, 0x9b, 0xdb, 0x34, 0x56, 0x84, 0xec,
++ 0x82, 0xca, 0xae, 0x41, 0x25, 0x70, 0x9c, 0x6b, 0xe9, 0xfe, 0x90, 0x0f, 0xd7,
++ 0x96, 0x1f, 0xe5, 0xe7, 0x94, 0x1f, 0xb2, 0x2a, 0x0c, 0x8d, 0x4b, 0xff, 0x28,
++ 0x29, 0x10, 0x7b, 0xf7, 0xd7, 0x7c, 0xa5, 0xd1, 0x76, 0xb9, 0x05, 0xc8, 0x79,
++ 0xed, 0x0f, 0x90, 0x92, 0x9c, 0xc2, 0xfe, 0xdf, 0x6f, 0x7e, 0x6c, 0x0f, 0x7b,
++ 0xd4, 0xc1, 0x45, 0xdd, 0x34, 0x51, 0x96, 0x39, 0x0f, 0xe5, 0x5e, 0x56, 0xd8,
++ 0x18, 0x05, 0x96, 0xf4, 0x07, 0xa6, 0x42, 0xb3, 0xa0, 0x77, 0xfd, 0x08, 0x19,
++ 0xf2, 0x71, 0x56, 0xcc, 0x9f, 0x86, 0x23, 0xa4, 0x87, 0xcb, 0xa6, 0xfd, 0x58,
++ 0x7e, 0xd4, 0x69, 0x67, 0x15, 0x91, 0x7e, 0x81, 0xf2, 0x7f, 0x13, 0xe5, 0x0d,
++ 0x8b, 0x8a, 0x3c, 0x87, 0x84, 0xeb, 0xe3, 0xce, 0xbd, 0x43, 0xe5, 0xad, 0x2d,
++ 0x84, 0x93, 0x8e, 0x6a, 0x2b, 0x5a, 0x7c, 0x44, 0xfa, 0x52, 0xaa, 0x81, 0xc8,
++ 0x2d, 0x1c, 0xbb, 0xe0, 0x52, 0xdf, 0x00, 0x11, 0xf8, 0x9a, 0x3d, 0xc1, 0x60,
++ 0xb0, 0xe1, 0x33, 0xb5, 0xa3, 0x88, 0xd1, 0x65, 0x19, 0x0a, 0x1a, 0xe7, 0xac,
++ 0x7c, 0xa4, 0xc1, 0x82, 0x87, 0x4e, 0x38, 0xb1, 0x2f, 0x0d, 0xc5, 0x14, 0x87,
++ 0x6f, 0xfd, 0x8d, 0x2e, 0xbc, 0x39, 0xb6, 0xe7, 0xe6, 0xc3, 0xe0, 0xe4, 0xcd,
++ 0x27, 0x84, 0xef, 0x94, 0x42, 0xef, 0x29, 0x8b, 0x90, 0x46, 0x41, 0x3b, 0x81,
++ 0x1b, 0x67, 0xd8, 0xf9, 0x43, 0x59, 0x65, 0xcb, 0x0d, 0xbc, 0xfd, 0x00, 0x92,
++ 0x4f, 0xf4, 0x75, 0x3b, 0xa7, 0xa9, 0x24, 0xfc, 0x50, 0x41, 0x40, 0x79, 0xe0,
++ 0x2d, 0x4f, 0x0a, 0x6a, 0x27, 0x76, 0x6e, 0x52, 0xed, 0x96, 0x69, 0x7b, 0xaf,
++ 0x0f, 0xf7, 0x87, 0x05, 0xd0, 0x45, 0xc2, 0xad, 0x53, 0x14, 0x81, 0x1f, 0xfb,
++ 0x30, 0x04, 0xaa, 0x37, 0x36, 0x61, 0xda, 0x4a, 0x69, 0x1b, 0x34, 0xd8, 0x68,
++ 0xed, 0xd6, 0x02, 0xcf, 0x6c, 0x94, 0x0c, 0xd3, 0xcf, 0x6c, 0x22, 0x79, 0xad,
++ 0xb1, 0xf0, 0xbc, 0x03, 0xa2, 0x46, 0x60, 0xa9, 0xc4, 0x07, 0xc2, 0x21, 0x82,
++ 0xf1, 0xfd, 0xf2, 0xe8, 0x79, 0x32, 0x60, 0xbf, 0xd8, 0xac, 0xa5, 0x22, 0x14,
++ 0x4b, 0xca, 0xc1, 0xd8, 0x4b, 0xeb, 0x7d, 0x3f, 0x57, 0x35, 0xb2, 0xe6, 0x4f,
++ 0x75, 0xb4, 0xb0, 0x60, 0x03, 0x22, 0x53, 0xae, 0x91, 0x79, 0x1d, 0xd6, 0x9b,
++ 0x41, 0x1f, 0x15, 0x86, 0x54, 0x70, 0xb2, 0xde, 0x0d, 0x35, 0x0f, 0x7c, 0xb0,
++ 0x34, 0x72, 0xba, 0x97, 0x60, 0x3b, 0xf0, 0x79, 0xeb, 0xa2, 0xb2, 0x1c, 0x5d,
++ 0xa2, 0x16, 0xb8, 0x87, 0xc5, 0xe9, 0x1b, 0xf6, 0xb5, 0x97, 0x25, 0x6f, 0x38,
++ 0x9f, 0xe3, 0x91, 0xfa, 0x8a, 0x79, 0x98, 0xc3, 0x69, 0x0e, 0xb7, 0xa3, 0x1c,
++ 0x20, 0x05, 0x97, 0xf8, 0xca, 0x14, 0xae, 0x00, 0xd7, 0xc4, 0xf3, 0xc0, 0x14,
++ 0x10, 0x75, 0x6b, 0x34, 0xa0, 0x1b, 0xb5, 0x99, 0x60, 0xf3, 0x5c, 0xb0, 0xc5,
++ 0x57, 0x4e, 0x36, 0xd2, 0x32, 0x84, 0xbf, 0x9e
++};
++
++//
++// First DB entry: "Microsoft Windows Production PCA 2011"
++// SHA1: 58:0a:6f:4c:c4:e4:b6:69:b9:eb:dc:1b:2b:3e:08:7b:80:d0:67:8d
++//
++// Windows 8 and Windows Server 2012 R2 boot loaders are signed with a chain
++// rooted in this certificate.
++//
++STATIC CONST UINT8 MicrosoftPCA[] = {
++ 0x30, 0x82, 0x05, 0xd7, 0x30, 0x82, 0x03, 0xbf, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x07, 0x76, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x88, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x32, 0x30,
++ 0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x29, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72,
++ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68,
++ 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x32, 0x30, 0x31, 0x30, 0x30, 0x1e, 0x17,
++ 0x0d, 0x31, 0x31, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x34, 0x31, 0x34, 0x32,
++ 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x35, 0x31,
++ 0x34, 0x32, 0x5a, 0x30, 0x81, 0x84, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
++ 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
++ 0x04, 0x08, 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f,
++ 0x6e, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52,
++ 0x65, 0x64, 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55,
++ 0x04, 0x0a, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31,
++ 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x25, 0x4d, 0x69, 0x63,
++ 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
++ 0x73, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
++ 0x50, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31, 0x30, 0x82, 0x01, 0x22, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
++ 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
++ 0x01, 0x00, 0xdd, 0x0c, 0xbb, 0xa2, 0xe4, 0x2e, 0x09, 0xe3, 0xe7, 0xc5, 0xf7,
++ 0x96, 0x69, 0xbc, 0x00, 0x21, 0xbd, 0x69, 0x33, 0x33, 0xef, 0xad, 0x04, 0xcb,
++ 0x54, 0x80, 0xee, 0x06, 0x83, 0xbb, 0xc5, 0x20, 0x84, 0xd9, 0xf7, 0xd2, 0x8b,
++ 0xf3, 0x38, 0xb0, 0xab, 0xa4, 0xad, 0x2d, 0x7c, 0x62, 0x79, 0x05, 0xff, 0xe3,
++ 0x4a, 0x3f, 0x04, 0x35, 0x20, 0x70, 0xe3, 0xc4, 0xe7, 0x6b, 0xe0, 0x9c, 0xc0,
++ 0x36, 0x75, 0xe9, 0x8a, 0x31, 0xdd, 0x8d, 0x70, 0xe5, 0xdc, 0x37, 0xb5, 0x74,
++ 0x46, 0x96, 0x28, 0x5b, 0x87, 0x60, 0x23, 0x2c, 0xbf, 0xdc, 0x47, 0xa5, 0x67,
++ 0xf7, 0x51, 0x27, 0x9e, 0x72, 0xeb, 0x07, 0xa6, 0xc9, 0xb9, 0x1e, 0x3b, 0x53,
++ 0x35, 0x7c, 0xe5, 0xd3, 0xec, 0x27, 0xb9, 0x87, 0x1c, 0xfe, 0xb9, 0xc9, 0x23,
++ 0x09, 0x6f, 0xa8, 0x46, 0x91, 0xc1, 0x6e, 0x96, 0x3c, 0x41, 0xd3, 0xcb, 0xa3,
++ 0x3f, 0x5d, 0x02, 0x6a, 0x4d, 0xec, 0x69, 0x1f, 0x25, 0x28, 0x5c, 0x36, 0xff,
++ 0xfd, 0x43, 0x15, 0x0a, 0x94, 0xe0, 0x19, 0xb4, 0xcf, 0xdf, 0xc2, 0x12, 0xe2,
++ 0xc2, 0x5b, 0x27, 0xee, 0x27, 0x78, 0x30, 0x8b, 0x5b, 0x2a, 0x09, 0x6b, 0x22,
++ 0x89, 0x53, 0x60, 0x16, 0x2c, 0xc0, 0x68, 0x1d, 0x53, 0xba, 0xec, 0x49, 0xf3,
++ 0x9d, 0x61, 0x8c, 0x85, 0x68, 0x09, 0x73, 0x44, 0x5d, 0x7d, 0xa2, 0x54, 0x2b,
++ 0xdd, 0x79, 0xf7, 0x15, 0xcf, 0x35, 0x5d, 0x6c, 0x1c, 0x2b, 0x5c, 0xce, 0xbc,
++ 0x9c, 0x23, 0x8b, 0x6f, 0x6e, 0xb5, 0x26, 0xd9, 0x36, 0x13, 0xc3, 0x4f, 0xd6,
++ 0x27, 0xae, 0xb9, 0x32, 0x3b, 0x41, 0x92, 0x2c, 0xe1, 0xc7, 0xcd, 0x77, 0xe8,
++ 0xaa, 0x54, 0x4e, 0xf7, 0x5c, 0x0b, 0x04, 0x87, 0x65, 0xb4, 0x43, 0x18, 0xa8,
++ 0xb2, 0xe0, 0x6d, 0x19, 0x77, 0xec, 0x5a, 0x24, 0xfa, 0x48, 0x03, 0x02, 0x03,
++ 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x43, 0x30, 0x82, 0x01, 0x3f, 0x30, 0x10,
++ 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x01, 0x04, 0x03,
++ 0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
++ 0x14, 0xa9, 0x29, 0x02, 0x39, 0x8e, 0x16, 0xc4, 0x97, 0x78, 0xcd, 0x90, 0xf9,
++ 0x9e, 0x4f, 0x9a, 0xe1, 0x7c, 0x55, 0xaf, 0x53, 0x30, 0x19, 0x06, 0x09, 0x2b,
++ 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00,
++ 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00, 0x41, 0x30, 0x0b, 0x06, 0x03,
++ 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03,
++ 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff,
++ 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
++ 0xd5, 0xf6, 0x56, 0xcb, 0x8f, 0xe8, 0xa2, 0x5c, 0x62, 0x68, 0xd1, 0x3d, 0x94,
++ 0x90, 0x5b, 0xd7, 0xce, 0x9a, 0x18, 0xc4, 0x30, 0x56, 0x06, 0x03, 0x55, 0x1d,
++ 0x1f, 0x04, 0x4f, 0x30, 0x4d, 0x30, 0x4b, 0xa0, 0x49, 0xa0, 0x47, 0x86, 0x45,
++ 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69,
++ 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
++ 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
++ 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72, 0x41,
++ 0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x33,
++ 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x5a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05,
++ 0x07, 0x01, 0x01, 0x04, 0x4e, 0x30, 0x4c, 0x30, 0x4a, 0x06, 0x08, 0x2b, 0x06,
++ 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x3a,
++ 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65,
++ 0x72, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72,
++ 0x41, 0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32,
++ 0x33, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++ 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x14,
++ 0xfc, 0x7c, 0x71, 0x51, 0xa5, 0x79, 0xc2, 0x6e, 0xb2, 0xef, 0x39, 0x3e, 0xbc,
++ 0x3c, 0x52, 0x0f, 0x6e, 0x2b, 0x3f, 0x10, 0x13, 0x73, 0xfe, 0xa8, 0x68, 0xd0,
++ 0x48, 0xa6, 0x34, 0x4d, 0x8a, 0x96, 0x05, 0x26, 0xee, 0x31, 0x46, 0x90, 0x61,
++ 0x79, 0xd6, 0xff, 0x38, 0x2e, 0x45, 0x6b, 0xf4, 0xc0, 0xe5, 0x28, 0xb8, 0xda,
++ 0x1d, 0x8f, 0x8a, 0xdb, 0x09, 0xd7, 0x1a, 0xc7, 0x4c, 0x0a, 0x36, 0x66, 0x6a,
++ 0x8c, 0xec, 0x1b, 0xd7, 0x04, 0x90, 0xa8, 0x18, 0x17, 0xa4, 0x9b, 0xb9, 0xe2,
++ 0x40, 0x32, 0x36, 0x76, 0xc4, 0xc1, 0x5a, 0xc6, 0xbf, 0xe4, 0x04, 0xc0, 0xea,
++ 0x16, 0xd3, 0xac, 0xc3, 0x68, 0xef, 0x62, 0xac, 0xdd, 0x54, 0x6c, 0x50, 0x30,
++ 0x58, 0xa6, 0xeb, 0x7c, 0xfe, 0x94, 0xa7, 0x4e, 0x8e, 0xf4, 0xec, 0x7c, 0x86,
++ 0x73, 0x57, 0xc2, 0x52, 0x21, 0x73, 0x34, 0x5a, 0xf3, 0xa3, 0x8a, 0x56, 0xc8,
++ 0x04, 0xda, 0x07, 0x09, 0xed, 0xf8, 0x8b, 0xe3, 0xce, 0xf4, 0x7e, 0x8e, 0xae,
++ 0xf0, 0xf6, 0x0b, 0x8a, 0x08, 0xfb, 0x3f, 0xc9, 0x1d, 0x72, 0x7f, 0x53, 0xb8,
++ 0xeb, 0xbe, 0x63, 0xe0, 0xe3, 0x3d, 0x31, 0x65, 0xb0, 0x81, 0xe5, 0xf2, 0xac,
++ 0xcd, 0x16, 0xa4, 0x9f, 0x3d, 0xa8, 0xb1, 0x9b, 0xc2, 0x42, 0xd0, 0x90, 0x84,
++ 0x5f, 0x54, 0x1d, 0xff, 0x89, 0xea, 0xba, 0x1d, 0x47, 0x90, 0x6f, 0xb0, 0x73,
++ 0x4e, 0x41, 0x9f, 0x40, 0x9f, 0x5f, 0xe5, 0xa1, 0x2a, 0xb2, 0x11, 0x91, 0x73,
++ 0x8a, 0x21, 0x28, 0xf0, 0xce, 0xde, 0x73, 0x39, 0x5f, 0x3e, 0xab, 0x5c, 0x60,
++ 0xec, 0xdf, 0x03, 0x10, 0xa8, 0xd3, 0x09, 0xe9, 0xf4, 0xf6, 0x96, 0x85, 0xb6,
++ 0x7f, 0x51, 0x88, 0x66, 0x47, 0x19, 0x8d, 0xa2, 0xb0, 0x12, 0x3d, 0x81, 0x2a,
++ 0x68, 0x05, 0x77, 0xbb, 0x91, 0x4c, 0x62, 0x7b, 0xb6, 0xc1, 0x07, 0xc7, 0xba,
++ 0x7a, 0x87, 0x34, 0x03, 0x0e, 0x4b, 0x62, 0x7a, 0x99, 0xe9, 0xca, 0xfc, 0xce,
++ 0x4a, 0x37, 0xc9, 0x2d, 0xa4, 0x57, 0x7c, 0x1c, 0xfe, 0x3d, 0xdc, 0xb8, 0x0f,
++ 0x5a, 0xfa, 0xd6, 0xc4, 0xb3, 0x02, 0x85, 0x02, 0x3a, 0xea, 0xb3, 0xd9, 0x6e,
++ 0xe4, 0x69, 0x21, 0x37, 0xde, 0x81, 0xd1, 0xf6, 0x75, 0x19, 0x05, 0x67, 0xd3,
++ 0x93, 0x57, 0x5e, 0x29, 0x1b, 0x39, 0xc8, 0xee, 0x2d, 0xe1, 0xcd, 0xe4, 0x45,
++ 0x73, 0x5b, 0xd0, 0xd2, 0xce, 0x7a, 0xab, 0x16, 0x19, 0x82, 0x46, 0x58, 0xd0,
++ 0x5e, 0x9d, 0x81, 0xb3, 0x67, 0xaf, 0x6c, 0x35, 0xf2, 0xbc, 0xe5, 0x3f, 0x24,
++ 0xe2, 0x35, 0xa2, 0x0a, 0x75, 0x06, 0xf6, 0x18, 0x56, 0x99, 0xd4, 0x78, 0x2c,
++ 0xd1, 0x05, 0x1b, 0xeb, 0xd0, 0x88, 0x01, 0x9d, 0xaa, 0x10, 0xf1, 0x05, 0xdf,
++ 0xba, 0x7e, 0x2c, 0x63, 0xb7, 0x06, 0x9b, 0x23, 0x21, 0xc4, 0xf9, 0x78, 0x6c,
++ 0xe2, 0x58, 0x17, 0x06, 0x36, 0x2b, 0x91, 0x12, 0x03, 0xcc, 0xa4, 0xd9, 0xf2,
++ 0x2d, 0xba, 0xf9, 0x94, 0x9d, 0x40, 0xed, 0x18, 0x45, 0xf1, 0xce, 0x8a, 0x5c,
++ 0x6b, 0x3e, 0xab, 0x03, 0xd3, 0x70, 0x18, 0x2a, 0x0a, 0x6a, 0xe0, 0x5f, 0x47,
++ 0xd1, 0xd5, 0x63, 0x0a, 0x32, 0xf2, 0xaf, 0xd7, 0x36, 0x1f, 0x2a, 0x70, 0x5a,
++ 0xe5, 0x42, 0x59, 0x08, 0x71, 0x4b, 0x57, 0xba, 0x7e, 0x83, 0x81, 0xf0, 0x21,
++ 0x3c, 0xf4, 0x1c, 0xc1, 0xc5, 0xb9, 0x90, 0x93, 0x0e, 0x88, 0x45, 0x93, 0x86,
++ 0xe9, 0xb1, 0x20, 0x99, 0xbe, 0x98, 0xcb, 0xc5, 0x95, 0xa4, 0x5d, 0x62, 0xd6,
++ 0xa0, 0x63, 0x08, 0x20, 0xbd, 0x75, 0x10, 0x77, 0x7d, 0x3d, 0xf3, 0x45, 0xb9,
++ 0x9f, 0x97, 0x9f, 0xcb, 0x57, 0x80, 0x6f, 0x33, 0xa9, 0x04, 0xcf, 0x77, 0xa4,
++ 0x62, 0x1c, 0x59, 0x7e
++};
++
++//
++// Second DB entry: "Microsoft Corporation UEFI CA 2011"
++// SHA1: 46:de:f6:3b:5c:e6:1c:f8:ba:0d:e2:e6:63:9c:10:19:d0:ed:14:f3
++//
++// To verify the "shim" binary and PCI expansion ROMs with.
++//
++STATIC CONST UINT8 MicrosoftUefiCA[] = {
++ 0x30, 0x82, 0x06, 0x10, 0x30, 0x82, 0x03, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x08, 0xd3, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++ 0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++ 0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++ 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++ 0x36, 0x32, 0x37, 0x32, 0x31, 0x32, 0x32, 0x34, 0x35, 0x5a, 0x17, 0x0d, 0x32,
++ 0x36, 0x30, 0x36, 0x32, 0x37, 0x32, 0x31, 0x33, 0x32, 0x34, 0x35, 0x5a, 0x30,
++ 0x81, 0x81, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++ 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++ 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++ 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++ 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++ 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++ 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2b, 0x30, 0x29, 0x06,
++ 0x03, 0x55, 0x04, 0x03, 0x13, 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++ 0x6e, 0x20, 0x55, 0x45, 0x46, 0x49, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31,
++ 0x31, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++ 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30,
++ 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa5, 0x08, 0x6c, 0x4c, 0xc7,
++ 0x45, 0x09, 0x6a, 0x4b, 0x0c, 0xa4, 0xc0, 0x87, 0x7f, 0x06, 0x75, 0x0c, 0x43,
++ 0x01, 0x54, 0x64, 0xe0, 0x16, 0x7f, 0x07, 0xed, 0x92, 0x7d, 0x0b, 0xb2, 0x73,
++ 0xbf, 0x0c, 0x0a, 0xc6, 0x4a, 0x45, 0x61, 0xa0, 0xc5, 0x16, 0x2d, 0x96, 0xd3,
++ 0xf5, 0x2b, 0xa0, 0xfb, 0x4d, 0x49, 0x9b, 0x41, 0x80, 0x90, 0x3c, 0xb9, 0x54,
++ 0xfd, 0xe6, 0xbc, 0xd1, 0x9d, 0xc4, 0xa4, 0x18, 0x8a, 0x7f, 0x41, 0x8a, 0x5c,
++ 0x59, 0x83, 0x68, 0x32, 0xbb, 0x8c, 0x47, 0xc9, 0xee, 0x71, 0xbc, 0x21, 0x4f,
++ 0x9a, 0x8a, 0x7c, 0xff, 0x44, 0x3f, 0x8d, 0x8f, 0x32, 0xb2, 0x26, 0x48, 0xae,
++ 0x75, 0xb5, 0xee, 0xc9, 0x4c, 0x1e, 0x4a, 0x19, 0x7e, 0xe4, 0x82, 0x9a, 0x1d,
++ 0x78, 0x77, 0x4d, 0x0c, 0xb0, 0xbd, 0xf6, 0x0f, 0xd3, 0x16, 0xd3, 0xbc, 0xfa,
++ 0x2b, 0xa5, 0x51, 0x38, 0x5d, 0xf5, 0xfb, 0xba, 0xdb, 0x78, 0x02, 0xdb, 0xff,
++ 0xec, 0x0a, 0x1b, 0x96, 0xd5, 0x83, 0xb8, 0x19, 0x13, 0xe9, 0xb6, 0xc0, 0x7b,
++ 0x40, 0x7b, 0xe1, 0x1f, 0x28, 0x27, 0xc9, 0xfa, 0xef, 0x56, 0x5e, 0x1c, 0xe6,
++ 0x7e, 0x94, 0x7e, 0xc0, 0xf0, 0x44, 0xb2, 0x79, 0x39, 0xe5, 0xda, 0xb2, 0x62,
++ 0x8b, 0x4d, 0xbf, 0x38, 0x70, 0xe2, 0x68, 0x24, 0x14, 0xc9, 0x33, 0xa4, 0x08,
++ 0x37, 0xd5, 0x58, 0x69, 0x5e, 0xd3, 0x7c, 0xed, 0xc1, 0x04, 0x53, 0x08, 0xe7,
++ 0x4e, 0xb0, 0x2a, 0x87, 0x63, 0x08, 0x61, 0x6f, 0x63, 0x15, 0x59, 0xea, 0xb2,
++ 0x2b, 0x79, 0xd7, 0x0c, 0x61, 0x67, 0x8a, 0x5b, 0xfd, 0x5e, 0xad, 0x87, 0x7f,
++ 0xba, 0x86, 0x67, 0x4f, 0x71, 0x58, 0x12, 0x22, 0x04, 0x22, 0x22, 0xce, 0x8b,
++ 0xef, 0x54, 0x71, 0x00, 0xce, 0x50, 0x35, 0x58, 0x76, 0x95, 0x08, 0xee, 0x6a,
++ 0xb1, 0xa2, 0x01, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x76,
++ 0x30, 0x82, 0x01, 0x72, 0x30, 0x12, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01,
++ 0x82, 0x37, 0x15, 0x01, 0x04, 0x05, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x23,
++ 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x02, 0x04, 0x16,
++ 0x04, 0x14, 0xf8, 0xc1, 0x6b, 0xb7, 0x7f, 0x77, 0x53, 0x4a, 0xf3, 0x25, 0x37,
++ 0x1d, 0x4e, 0xa1, 0x26, 0x7b, 0x0f, 0x20, 0x70, 0x80, 0x30, 0x1d, 0x06, 0x03,
++ 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x13, 0xad, 0xbf, 0x43, 0x09, 0xbd,
++ 0x82, 0x70, 0x9c, 0x8c, 0xd5, 0x4f, 0x31, 0x6e, 0xd5, 0x22, 0x98, 0x8a, 0x1b,
++ 0xd4, 0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14,
++ 0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43,
++ 0x00, 0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02,
++ 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
++ 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23,
++ 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58,
++ 0x11, 0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8,
++ 0x30, 0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51,
++ 0xa0, 0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++ 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f,
++ 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43,
++ 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f,
++ 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e,
++ 0x63, 0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
++ 0x01, 0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01,
++ 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
++ 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66,
++ 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72,
++ 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50,
++ 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30,
++ 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06,
++ 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03,
++ 0x82, 0x02, 0x01, 0x00, 0x35, 0x08, 0x42, 0xff, 0x30, 0xcc, 0xce, 0xf7, 0x76,
++ 0x0c, 0xad, 0x10, 0x68, 0x58, 0x35, 0x29, 0x46, 0x32, 0x76, 0x27, 0x7c, 0xef,
++ 0x12, 0x41, 0x27, 0x42, 0x1b, 0x4a, 0xaa, 0x6d, 0x81, 0x38, 0x48, 0x59, 0x13,
++ 0x55, 0xf3, 0xe9, 0x58, 0x34, 0xa6, 0x16, 0x0b, 0x82, 0xaa, 0x5d, 0xad, 0x82,
++ 0xda, 0x80, 0x83, 0x41, 0x06, 0x8f, 0xb4, 0x1d, 0xf2, 0x03, 0xb9, 0xf3, 0x1a,
++ 0x5d, 0x1b, 0xf1, 0x50, 0x90, 0xf9, 0xb3, 0x55, 0x84, 0x42, 0x28, 0x1c, 0x20,
++ 0xbd, 0xb2, 0xae, 0x51, 0x14, 0xc5, 0xc0, 0xac, 0x97, 0x95, 0x21, 0x1c, 0x90,
++ 0xdb, 0x0f, 0xfc, 0x77, 0x9e, 0x95, 0x73, 0x91, 0x88, 0xca, 0xbd, 0xbd, 0x52,
++ 0xb9, 0x05, 0x50, 0x0d, 0xdf, 0x57, 0x9e, 0xa0, 0x61, 0xed, 0x0d, 0xe5, 0x6d,
++ 0x25, 0xd9, 0x40, 0x0f, 0x17, 0x40, 0xc8, 0xce, 0xa3, 0x4a, 0xc2, 0x4d, 0xaf,
++ 0x9a, 0x12, 0x1d, 0x08, 0x54, 0x8f, 0xbd, 0xc7, 0xbc, 0xb9, 0x2b, 0x3d, 0x49,
++ 0x2b, 0x1f, 0x32, 0xfc, 0x6a, 0x21, 0x69, 0x4f, 0x9b, 0xc8, 0x7e, 0x42, 0x34,
++ 0xfc, 0x36, 0x06, 0x17, 0x8b, 0x8f, 0x20, 0x40, 0xc0, 0xb3, 0x9a, 0x25, 0x75,
++ 0x27, 0xcd, 0xc9, 0x03, 0xa3, 0xf6, 0x5d, 0xd1, 0xe7, 0x36, 0x54, 0x7a, 0xb9,
++ 0x50, 0xb5, 0xd3, 0x12, 0xd1, 0x07, 0xbf, 0xbb, 0x74, 0xdf, 0xdc, 0x1e, 0x8f,
++ 0x80, 0xd5, 0xed, 0x18, 0xf4, 0x2f, 0x14, 0x16, 0x6b, 0x2f, 0xde, 0x66, 0x8c,
++ 0xb0, 0x23, 0xe5, 0xc7, 0x84, 0xd8, 0xed, 0xea, 0xc1, 0x33, 0x82, 0xad, 0x56,
++ 0x4b, 0x18, 0x2d, 0xf1, 0x68, 0x95, 0x07, 0xcd, 0xcf, 0xf0, 0x72, 0xf0, 0xae,
++ 0xbb, 0xdd, 0x86, 0x85, 0x98, 0x2c, 0x21, 0x4c, 0x33, 0x2b, 0xf0, 0x0f, 0x4a,
++ 0xf0, 0x68, 0x87, 0xb5, 0x92, 0x55, 0x32, 0x75, 0xa1, 0x6a, 0x82, 0x6a, 0x3c,
++ 0xa3, 0x25, 0x11, 0xa4, 0xed, 0xad, 0xd7, 0x04, 0xae, 0xcb, 0xd8, 0x40, 0x59,
++ 0xa0, 0x84, 0xd1, 0x95, 0x4c, 0x62, 0x91, 0x22, 0x1a, 0x74, 0x1d, 0x8c, 0x3d,
++ 0x47, 0x0e, 0x44, 0xa6, 0xe4, 0xb0, 0x9b, 0x34, 0x35, 0xb1, 0xfa, 0xb6, 0x53,
++ 0xa8, 0x2c, 0x81, 0xec, 0xa4, 0x05, 0x71, 0xc8, 0x9d, 0xb8, 0xba, 0xe8, 0x1b,
++ 0x44, 0x66, 0xe4, 0x47, 0x54, 0x0e, 0x8e, 0x56, 0x7f, 0xb3, 0x9f, 0x16, 0x98,
++ 0xb2, 0x86, 0xd0, 0x68, 0x3e, 0x90, 0x23, 0xb5, 0x2f, 0x5e, 0x8f, 0x50, 0x85,
++ 0x8d, 0xc6, 0x8d, 0x82, 0x5f, 0x41, 0xa1, 0xf4, 0x2e, 0x0d, 0xe0, 0x99, 0xd2,
++ 0x6c, 0x75, 0xe4, 0xb6, 0x69, 0xb5, 0x21, 0x86, 0xfa, 0x07, 0xd1, 0xf6, 0xe2,
++ 0x4d, 0xd1, 0xda, 0xad, 0x2c, 0x77, 0x53, 0x1e, 0x25, 0x32, 0x37, 0xc7, 0x6c,
++ 0x52, 0x72, 0x95, 0x86, 0xb0, 0xf1, 0x35, 0x61, 0x6a, 0x19, 0xf5, 0xb2, 0x3b,
++ 0x81, 0x50, 0x56, 0xa6, 0x32, 0x2d, 0xfe, 0xa2, 0x89, 0xf9, 0x42, 0x86, 0x27,
++ 0x18, 0x55, 0xa1, 0x82, 0xca, 0x5a, 0x9b, 0xf8, 0x30, 0x98, 0x54, 0x14, 0xa6,
++ 0x47, 0x96, 0x25, 0x2f, 0xc8, 0x26, 0xe4, 0x41, 0x94, 0x1a, 0x5c, 0x02, 0x3f,
++ 0xe5, 0x96, 0xe3, 0x85, 0x5b, 0x3c, 0x3e, 0x3f, 0xbb, 0x47, 0x16, 0x72, 0x55,
++ 0xe2, 0x25, 0x22, 0xb1, 0xd9, 0x7b, 0xe7, 0x03, 0x06, 0x2a, 0xa3, 0xf7, 0x1e,
++ 0x90, 0x46, 0xc3, 0x00, 0x0d, 0xd6, 0x19, 0x89, 0xe3, 0x0e, 0x35, 0x27, 0x62,
++ 0x03, 0x71, 0x15, 0xa6, 0xef, 0xd0, 0x27, 0xa0, 0xa0, 0x59, 0x37, 0x60, 0xf8,
++ 0x38, 0x94, 0xb8, 0xe0, 0x78, 0x70, 0xf8, 0xba, 0x4c, 0x86, 0x87, 0x94, 0xf6,
++ 0xe0, 0xae, 0x02, 0x45, 0xee, 0x65, 0xc2, 0xb6, 0xa3, 0x7e, 0x69, 0x16, 0x75,
++ 0x07, 0x92, 0x9b, 0xf5, 0xa6, 0xbc, 0x59, 0x83, 0x58
++};
++
++//
++// The most important thing about the variable payload is that it is a list of
++// lists, where the element size of any given *inner* list is constant.
++//
++// Since X509 certificates vary in size, each of our *inner* lists will contain
++// one element only (one X.509 certificate). This is explicitly mentioned in
++// the UEFI specification, in "28.4.1 Signature Database", in a Note.
++//
++// The list structure looks as follows:
++//
++// struct EFI_VARIABLE_AUTHENTICATION_2 { |
++// struct EFI_TIME { |
++// UINT16 Year; |
++// UINT8 Month; |
++// UINT8 Day; |
++// UINT8 Hour; |
++// UINT8 Minute; |
++// UINT8 Second; |
++// UINT8 Pad1; |
++// UINT32 Nanosecond; |
++// INT16 TimeZone; |
++// UINT8 Daylight; |
++// UINT8 Pad2; |
++// } TimeStamp; |
++// |
++// struct WIN_CERTIFICATE_UEFI_GUID { | |
++// struct WIN_CERTIFICATE { | |
++// UINT32 dwLength; ----------------------------------------+ |
++// UINT16 wRevision; | |
++// UINT16 wCertificateType; | |
++// } Hdr; | +- DataSize
++// | |
++// EFI_GUID CertType; | |
++// UINT8 CertData[1] = { <--- "struct hack" | |
++// struct EFI_SIGNATURE_LIST { | | |
++// EFI_GUID SignatureType; | | |
++// UINT32 SignatureListSize; -------------------------+ | |
++// UINT32 SignatureHeaderSize; | | |
++// UINT32 SignatureSize; ---------------------------+ | | |
++// UINT8 SignatureHeader[SignatureHeaderSize]; | | | |
++// v | | |
++// struct EFI_SIGNATURE_DATA { | | | |
++// EFI_GUID SignatureOwner; | | | |
++// UINT8 SignatureData[1] = { <--- "struct hack" | | | |
++// X.509 payload | | | |
++// } | | | |
++// } Signatures[]; | | |
++// } SigLists[]; | |
++// }; | |
++// } AuthInfo; | |
++// }; |
++//
++// Given that the "struct hack" invokes undefined behavior (which is why C99
++// introduced the flexible array member), and because subtracting those pesky
++// sizes of 1 is annoying, and because the format is fully specified in the
++// UEFI specification, we'll introduce two matching convenience structures that
++// are customized for our X.509 purposes.
++//
++#pragma pack(1)
++typedef struct {
++ EFI_TIME TimeStamp;
++
++ //
++ // dwLength covers data below
++ //
++ UINT32 dwLength;
++ UINT16 wRevision;
++ UINT16 wCertificateType;
++ EFI_GUID CertType;
++} SINGLE_HEADER;
++
++typedef struct {
++ //
++ // SignatureListSize covers data below
++ //
++ EFI_GUID SignatureType;
++ UINT32 SignatureListSize;
++ UINT32 SignatureHeaderSize; // constant 0
++ UINT32 SignatureSize;
++
++ //
++ // SignatureSize covers data below
++ //
++ EFI_GUID SignatureOwner;
++
++ //
++ // X.509 certificate follows
++ //
++} REPEATING_HEADER;
++#pragma pack()
++
++/**
++ Enroll a set of DER-formatted X.509 certificates in a global variable,
++ overwriting it.
++
++ The variable will be rewritten with NV+BS+RT+AT attributes.
++
++ @param[in] VariableName The name of the variable to overwrite.
++
++ @param[in] VendorGuid The namespace (ie. vendor GUID) of the variable to
++ overwrite.
++
++ @param[in] ... A list of
++
++ IN CONST UINT8 *Cert,
++ IN UINTN CertSize,
++ IN CONST EFI_GUID *OwnerGuid
++
++ triplets. If the first component of a triplet is
++ NULL, then the other two components are not
++ accessed, and processing is terminated. The list of
++ X.509 certificates is enrolled in the variable
++ specified, overwriting it. The OwnerGuid component
++ identifies the agent installing the certificate.
++
++ @retval EFI_INVALID_PARAMETER The triplet list is empty (ie. the first Cert
++ value is NULL), or one of the CertSize values
++ is 0, or one of the CertSize values would
++ overflow the accumulated UINT32 data size.
++
++ @retval EFI_OUT_OF_RESOURCES Out of memory while formatting variable
++ payload.
++
++ @retval EFI_SUCCESS Enrollment successful; the variable has been
++ overwritten (or created).
++
++ @return Error codes from gRT->GetTime() and
++ gRT->SetVariable().
++**/
++STATIC
++EFI_STATUS
++EFIAPI
++EnrollListOfX509Certs (
++ IN CHAR16 *VariableName,
++ IN EFI_GUID *VendorGuid,
++ ...
++ )
++{
++ UINTN DataSize;
++ SINGLE_HEADER *SingleHeader;
++ REPEATING_HEADER *RepeatingHeader;
++ VA_LIST Marker;
++ CONST UINT8 *Cert;
++ EFI_STATUS Status = EFI_SUCCESS;
++ UINT8 *Data;
++ UINT8 *Position;
++
++ //
++ // compute total size first, for UINT32 range check, and allocation
++ //
++ DataSize = sizeof *SingleHeader;
++ VA_START (Marker, VendorGuid);
++ for (Cert = VA_ARG (Marker, CONST UINT8 *);
++ Cert != NULL;
++ Cert = VA_ARG (Marker, CONST UINT8 *)) {
++ UINTN CertSize;
++
++ CertSize = VA_ARG (Marker, UINTN);
++ (VOID)VA_ARG (Marker, CONST EFI_GUID *);
++
++ if (CertSize == 0 ||
++ CertSize > MAX_UINT32 - sizeof *RepeatingHeader ||
++ DataSize > MAX_UINT32 - sizeof *RepeatingHeader - CertSize) {
++ Status = EFI_INVALID_PARAMETER;
++ break;
++ }
++ DataSize += sizeof *RepeatingHeader + CertSize;
++ }
++ VA_END (Marker);
++
++ if (DataSize == sizeof *SingleHeader) {
++ Status = EFI_INVALID_PARAMETER;
++ }
++ if (EFI_ERROR (Status)) {
++ goto Out;
++ }
++
++ Data = AllocatePool (DataSize);
++ if (Data == NULL) {
++ Status = EFI_OUT_OF_RESOURCES;
++ goto Out;
++ }
++
++ Position = Data;
++
++ SingleHeader = (SINGLE_HEADER *)Position;
++ Status = gRT->GetTime (&SingleHeader->TimeStamp, NULL);
++ if (EFI_ERROR (Status)) {
++ goto FreeData;
++ }
++ SingleHeader->TimeStamp.Pad1 = 0;
++ SingleHeader->TimeStamp.Nanosecond = 0;
++ SingleHeader->TimeStamp.TimeZone = 0;
++ SingleHeader->TimeStamp.Daylight = 0;
++ SingleHeader->TimeStamp.Pad2 = 0;
++#if 0
++ SingleHeader->dwLength = DataSize - sizeof SingleHeader->TimeStamp;
++#else
++ //
++ // This looks like a bug in edk2. According to the UEFI specification,
++ // dwLength is "The length of the entire certificate, including the length of
++ // the header, in bytes". That shouldn't stop right after CertType -- it
++ // should include everything below it.
++ //
++ SingleHeader->dwLength = sizeof *SingleHeader
++ - sizeof SingleHeader->TimeStamp;
++#endif
++ SingleHeader->wRevision = 0x0200;
++ SingleHeader->wCertificateType = WIN_CERT_TYPE_EFI_GUID;
++ CopyGuid (&SingleHeader->CertType, &gEfiCertPkcs7Guid);
++ Position += sizeof *SingleHeader;
++
++ VA_START (Marker, VendorGuid);
++ for (Cert = VA_ARG (Marker, CONST UINT8 *);
++ Cert != NULL;
++ Cert = VA_ARG (Marker, CONST UINT8 *)) {
++ UINTN CertSize;
++ CONST EFI_GUID *OwnerGuid;
++
++ CertSize = VA_ARG (Marker, UINTN);
++ OwnerGuid = VA_ARG (Marker, CONST EFI_GUID *);
++
++ RepeatingHeader = (REPEATING_HEADER *)Position;
++ CopyGuid (&RepeatingHeader->SignatureType, &gEfiCertX509Guid);
++ RepeatingHeader->SignatureListSize = sizeof *RepeatingHeader + CertSize;
++ RepeatingHeader->SignatureHeaderSize = 0;
++ RepeatingHeader->SignatureSize =
++ sizeof RepeatingHeader->SignatureOwner + CertSize;
++ CopyGuid (&RepeatingHeader->SignatureOwner, OwnerGuid);
++ Position += sizeof *RepeatingHeader;
++
++ CopyMem (Position, Cert, CertSize);
++ Position += CertSize;
++ }
++ VA_END (Marker);
++
++ ASSERT (Data + DataSize == Position);
++
++ Status = gRT->SetVariable (VariableName, VendorGuid,
++ (EFI_VARIABLE_NON_VOLATILE |
++ EFI_VARIABLE_BOOTSERVICE_ACCESS |
++ EFI_VARIABLE_RUNTIME_ACCESS |
++ EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS),
++ DataSize, Data);
++
++FreeData:
++ FreePool (Data);
++
++Out:
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: %a(\"%s\", %g): %r\n", __FUNCTION__, VariableName,
++ VendorGuid, Status);
++ }
++ return Status;
++}
++
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetExact (
++ IN CHAR16 *VariableName,
++ IN EFI_GUID *VendorGuid,
++ OUT VOID *Data,
++ IN UINTN DataSize,
++ IN BOOLEAN AllowMissing
++ )
++{
++ UINTN Size;
++ EFI_STATUS Status;
++
++ Size = DataSize;
++ Status = gRT->GetVariable (VariableName, VendorGuid, NULL, &Size, Data);
++ if (EFI_ERROR (Status)) {
++ if (Status == EFI_NOT_FOUND && AllowMissing) {
++ ZeroMem (Data, DataSize);
++ return EFI_SUCCESS;
++ }
++
++ AsciiPrint ("error: GetVariable(\"%s\", %g): %r\n", VariableName,
++ VendorGuid, Status);
++ return Status;
++ }
++
++ if (Size != DataSize) {
++ AsciiPrint ("error: GetVariable(\"%s\", %g): expected size 0x%Lx, "
++ "got 0x%Lx\n", VariableName, VendorGuid, (UINT64)DataSize, (UINT64)Size);
++ return EFI_PROTOCOL_ERROR;
++ }
++
++ return EFI_SUCCESS;
++}
++
++typedef struct {
++ UINT8 SetupMode;
++ UINT8 SecureBoot;
++ UINT8 SecureBootEnable;
++ UINT8 CustomMode;
++ UINT8 VendorKeys;
++} SETTINGS;
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetSettings (
++ OUT SETTINGS *Settings
++ )
++{
++ EFI_STATUS Status;
++
++ Status = GetExact (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->SetupMode, sizeof Settings->SetupMode, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->SecureBoot, sizeof Settings->SecureBoot, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_SECURE_BOOT_ENABLE_NAME,
++ &gEfiSecureBootEnableDisableGuid, &Settings->SecureBootEnable,
++ sizeof Settings->SecureBootEnable, TRUE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ &Settings->CustomMode, sizeof Settings->CustomMode, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_VENDOR_KEYS_VARIABLE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->VendorKeys, sizeof Settings->VendorKeys, FALSE);
++ return Status;
++}
++
++STATIC
++VOID
++EFIAPI
++PrintSettings (
++ IN CONST SETTINGS *Settings
++ )
++{
++ AsciiPrint ("info: SetupMode=%d SecureBoot=%d SecureBootEnable=%d "
++ "CustomMode=%d VendorKeys=%d\n", Settings->SetupMode, Settings->SecureBoot,
++ Settings->SecureBootEnable, Settings->CustomMode, Settings->VendorKeys);
++}
++
++
++INTN
++EFIAPI
++ShellAppMain (
++ IN UINTN Argc,
++ IN CHAR16 **Argv
++ )
++{
++ EFI_STATUS Status;
++ SETTINGS Settings;
++
++ Status = GetSettings (&Settings);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++ PrintSettings (&Settings);
++
++ if (Settings.SetupMode != 1) {
++ AsciiPrint ("error: already in User Mode\n");
++ return 1;
++ }
++
++ if (Settings.CustomMode != CUSTOM_SECURE_BOOT_MODE) {
++ Settings.CustomMode = CUSTOM_SECURE_BOOT_MODE;
++ Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ (EFI_VARIABLE_NON_VOLATILE |
++ EFI_VARIABLE_BOOTSERVICE_ACCESS),
++ sizeof Settings.CustomMode, &Settings.CustomMode);
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++ &gEfiCustomModeEnableGuid, Status);
++ return 1;
++ }
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_IMAGE_SECURITY_DATABASE,
++ &gEfiImageSecurityDatabaseGuid,
++ MicrosoftPCA, sizeof MicrosoftPCA, &gEfiCallerIdGuid,
++ MicrosoftUefiCA, sizeof MicrosoftUefiCA, &gEfiCallerIdGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_KEY_EXCHANGE_KEY_NAME,
++ &gEfiGlobalVariableGuid,
++ ExampleCert, sizeof ExampleCert, &gEfiCallerIdGuid,
++ MicrosoftKEK, sizeof MicrosoftKEK, &gEfiCallerIdGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_PLATFORM_KEY_NAME,
++ &gEfiGlobalVariableGuid,
++ ExampleCert, sizeof ExampleCert, &gEfiGlobalVariableGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Settings.CustomMode = STANDARD_SECURE_BOOT_MODE;
++ Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
++ sizeof Settings.CustomMode, &Settings.CustomMode);
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++ &gEfiCustomModeEnableGuid, Status);
++ return 1;
++ }
++
++ Status = GetSettings (&Settings);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++ PrintSettings (&Settings);
++
++ if (Settings.SetupMode != 0 || Settings.SecureBoot != 1 ||
++ Settings.SecureBootEnable != 1 || Settings.CustomMode != 0 ||
++ Settings.VendorKeys != 0) {
++ AsciiPrint ("error: unexpected\n");
++ return 1;
++ }
++
++ AsciiPrint ("info: success\n");
++ return 0;
++}
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+new file mode 100644
+index 0000000..ac919bb
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+@@ -0,0 +1,51 @@
++## @file
++# Enroll default PK, KEK, DB.
++#
++# Copyright (C) 2014, Red Hat, Inc.
++#
++# This program and the accompanying materials are licensed and made available
++# under the terms and conditions of the BSD License which accompanies this
++# distribution. The full text of the license may be found at
++# http://opensource.org/licenses/bsd-license.
++#
++# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
++# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
++# IMPLIED.
++##
++
++[Defines]
++ INF_VERSION = 0x00010006
++ BASE_NAME = EnrollDefaultKeys
++ FILE_GUID = D5C1DF0B-1BAC-4EDF-BA48-08834009CA5A
++ MODULE_TYPE = UEFI_APPLICATION
++ VERSION_STRING = 0.1
++ ENTRY_POINT = ShellCEntryLib
++
++#
++# VALID_ARCHITECTURES = IA32 X64
++#
++
++[Sources]
++ EnrollDefaultKeys.c
++
++[Packages]
++ MdePkg/MdePkg.dec
++ MdeModulePkg/MdeModulePkg.dec
++ SecurityPkg/SecurityPkg.dec
++ ShellPkg/ShellPkg.dec
++
++[Guids]
++ gEfiCertPkcs7Guid
++ gEfiCertX509Guid
++ gEfiCustomModeEnableGuid
++ gEfiGlobalVariableGuid
++ gEfiImageSecurityDatabaseGuid
++ gEfiSecureBootEnableDisableGuid
++
++[LibraryClasses]
++ BaseMemoryLib
++ DebugLib
++ MemoryAllocationLib
++ ShellCEntryLib
++ UefiLib
++ UefiRuntimeServicesTableLib
+diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
+index fa9661c..e2e6ba3 100644
+--- a/OvmfPkg/OvmfPkgIa32.dsc
++++ b/OvmfPkg/OvmfPkgIa32.dsc
+@@ -764,6 +764,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
+diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
+index 667584a..a0ae1aa 100644
+--- a/OvmfPkg/OvmfPkgIa32X64.dsc
++++ b/OvmfPkg/OvmfPkgIa32X64.dsc
+@@ -773,6 +773,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
+diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
+index 5ae8469..87cee52 100644
+--- a/OvmfPkg/OvmfPkgX64.dsc
++++ b/OvmfPkg/OvmfPkgX64.dsc
+@@ -771,6 +771,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
diff --git a/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch b/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
new file mode 100644
index 000000000..bb12d8beb
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
@@ -0,0 +1,33 @@
+From c7722d10c7bcf6be0adcf54abb1d406599dd7914 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 24 Feb 2017 01:40:02 +0100
+Subject: [PATCH] VfrCompile: increase path length limit
+
+The VfrCompile tool has a hard-coded maximum length for path names
+which turned out to be too small by around 20 characters in the Yocto
+autobuilder setup. Increasing the maximum by a factor of 4 is
+relatively easy and makes the problem less likely.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ BaseTools/Source/C/VfrCompile/EfiVfr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+index d187902..9ad4a7b 100644
+--- a/BaseTools/Source/C/VfrCompile/EfiVfr.h
++++ b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #include "Common/UefiInternalFormRepresentation.h"
+ #include "Common/MdeModuleHii.h"
+
+-#define MAX_PATH 255
++#define MAX_PATH 1023
+ #define MAX_VFR_LINE_LEN 4096
+
+ #define EFI_IFR_MAX_LENGTH 0xFF
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch b/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch
new file mode 100644
index 000000000..25e5b58e7
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch
@@ -0,0 +1,20 @@
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Description: pass -fno-stack-protector to all GCC toolchains
+ The upstream build rules inexplicably pass -fno-stack-protector only
+ when building for i386 and amd64. Add this essential argument to the
+ generic rules for gcc 4.4 and later.
+Last-Updated: 2016-04-12
+Upstream-Status: Pending
+Index: git/BaseTools/Conf/tools_def.template
+===================================================================
+--- git.orig/BaseTools/Conf/tools_def.template
++++ git/BaseTools/Conf/tools_def.template
+@@ -4368,7 +4368,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I
+ DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
+ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
+
+-DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
++DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-stack-protector -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie
+ DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables
+ DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 -no-pie
diff --git a/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks b/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
new file mode 100644
index 000000000..1d2f16bd3
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
@@ -0,0 +1,4 @@
+# short-description: Create an EFI disk image with just the EFI system partition
+
+part / --source rootfs --ondisk sda --fstype=vfat --align 1024
+bootloader --ptable gpt --timeout=5
diff --git a/poky/meta/recipes-core/ovmf/ovmf_git.bb b/poky/meta/recipes-core/ovmf/ovmf_git.bb
new file mode 100644
index 000000000..8750b3c52
--- /dev/null
+++ b/poky/meta/recipes-core/ovmf/ovmf_git.bb
@@ -0,0 +1,248 @@
+SUMMARY = "OVMF - UEFI firmware for Qemu and KVM"
+DESCRIPTION = "OVMF is an EDK II based project to enable UEFI support for \
+Virtual Machines. OVMF contains sample UEFI firmware for QEMU and KVM"
+HOMEPAGE = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"
+LICENSE = "BSD"
+LICENSE_class-target = "${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'BSD & OpenSSL', 'BSD', d)}"
+LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=343dc88e82ff33d042074f62050c3496"
+
+# Enabling Secure Boot adds a dependency on OpenSSL and implies
+# compiling OVMF twice, so it is disabled by default. Distros
+# may change that default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[secureboot] = ",,,"
+
+SRC_URI = "git://github.com/tianocore/edk2.git;branch=master \
+ file://0001-ia32-Dont-use-pie.patch \
+ file://0002-ovmf-update-path-to-native-BaseTools.patch \
+ file://0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
+ file://0004-ovmf-enable-long-path-file.patch \
+ file://VfrCompile-increase-path-length-limit.patch \
+ file://no-stack-protector-all-archs.patch \
+ "
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+OPENSSL_RELEASE = "openssl-1.1.0e"
+
+SRC_URI_append_class-target = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'http://www.openssl.org/source/${OPENSSL_RELEASE}.tar.gz;name=openssl;subdir=${S}/CryptoPkg/Library/OpensslLib', '', d)} \
+ file://0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch \
+"
+
+SRCREV="ec4910cd3336565fdb61dafdd9ec4ae7a6160ba3"
+SRC_URI[openssl.md5sum] = "51c42d152122e474754aea96f66928c6"
+SRC_URI[openssl.sha256sum] = "57be8618979d80c910728cfc99369bf97b2a1abd8f366ab6ebdee8975ad3874c"
+
+inherit deploy
+
+PARALLEL_MAKE_class-native = ""
+
+S = "${WORKDIR}/git"
+
+DEPENDS_class-native="util-linux-native iasl-native ossp-uuid-native qemu-native"
+
+DEPENDS_class-target="ovmf-native"
+
+DEPENDS_append = " nasm-native"
+
+EDK_TOOLS_DIR="edk2_basetools"
+
+# OVMF has trouble building with the default optimization of -O2.
+BUILD_OPTIMIZATION="-pipe"
+
+# OVMF supports IA only, although it could conceivably support ARM someday.
+COMPATIBLE_HOST='(i.86|x86_64).*'
+
+# Additional build flags for OVMF with Secure Boot.
+# Fedora also uses "-D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD".
+OVMF_SECURE_BOOT_EXTRA_FLAGS ??= ""
+OVMF_SECURE_BOOT_FLAGS = "-DSECURE_BOOT_ENABLE=TRUE ${OVMF_SECURE_BOOT_EXTRA_FLAGS}"
+
+do_patch[postfuncs] += "fix_basetools_location"
+fix_basetools_location () {
+}
+fix_basetools_location_class-target() {
+ # Replaces the fake path inserted by 0002-ovmf-update-path-to-native-BaseTools.patch.
+ # Necessary for finding the actual BaseTools from ovmf-native.
+ sed -i -e 's#BBAKE_EDK_TOOLS_PATH#${STAGING_BINDIR_NATIVE}/${EDK_TOOLS_DIR}#' ${S}/OvmfPkg/build.sh
+}
+
+do_patch[postfuncs] += "fix_iasl"
+fix_iasl() {
+}
+fix_iasl_class-native() {
+ # iasl is not installed under /usr/bin when building with OE.
+ sed -i -e 's#/usr/bin/iasl#${STAGING_BINDIR_NATIVE}/iasl#' ${S}/BaseTools/Conf/tools_def.template
+}
+
+# Inject CC and friends into the build. LINKER already is in GNUmakefile.
+# Must be idempotent and thus remove old assignments that were inserted
+# earlier.
+do_patch[postfuncs] += "fix_toolchain"
+fix_toolchain() {
+ sed -i \
+ -e '/^\(CC\|CXX\|AS\|AR\|LD\|LINKER\) =/d' \
+ -e '/^APPLICATION/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}\nLINKER = $(CC)' \
+ ${S}/BaseTools/Source/C/Makefiles/app.makefile
+ sed -i \
+ -e '/^\(CC\|CXX\|AS\|AR\|LD\)/d' \
+ -e '/^VFR_CPPFLAGS/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}' \
+ ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+}
+fix_toolchain_append_class-native() {
+ # This tools_def.template is going to be used by the target ovmf and
+ # defines which compilers to use. For the GCC toolchain definitions,
+ # that will be ${HOST_PREFIX}gcc. However, "make" doesn't need that
+ # prefix.
+ #
+ # Injecting ENV(HOST_PREFIX) matches exporting that value as env
+ # variable in do_compile_class-target.
+ sed -i \
+ -e 's#\(ENV\|DEF\)(GCC.*_PREFIX)#ENV(HOST_PREFIX)#' \
+ -e 's#ENV(HOST_PREFIX)make#make#' \
+ ${S}/BaseTools/Conf/tools_def.template
+ sed -i \
+ -e '/^\(LFLAGS\|CFLAGS\) +=/d' \
+ -e '/^LINKER/a LFLAGS += ${BUILD_LDFLAGS}\nCFLAGS += ${BUILD_CFLAGS}' \
+ ${S}/BaseTools/Source/C/Makefiles/app.makefile \
+ ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+ # Linking with gold fails:
+ # internal error in do_layout, at ../../gold/object.cc:1821
+ # make: *** [.../OUTPUT/Facs.acpi] Error 1
+ # We intentionally hard-code the use of ld.bfd regardless of DISTRO_FEATURES
+ # to make ovmf-native reusable across distros.
+ sed -i \
+ -e 's#^\(DEFINE GCC.*DLINK.*FLAGS *=\)#\1 -fuse-ld=bfd#' \
+ ${S}/BaseTools/Conf/tools_def.template
+}
+
+GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')"
+
+fixup_target_tools() {
+ case ${1} in
+ 4.4.*)
+ FIXED_GCCVER=GCC44
+ ;;
+ 4.5.*)
+ FIXED_GCCVER=GCC45
+ ;;
+ 4.6.*)
+ FIXED_GCCVER=GCC46
+ ;;
+ 4.7.*)
+ FIXED_GCCVER=GCC47
+ ;;
+ 4.8.*)
+ FIXED_GCCVER=GCC48
+ ;;
+ 4.9.*)
+ FIXED_GCCVER=GCC49
+ ;;
+ *)
+ FIXED_GCCVER=GCC5
+ ;;
+ esac
+ echo ${FIXED_GCCVER}
+}
+
+do_compile_class-native() {
+ oe_runmake -C ${S}/BaseTools
+}
+
+do_compile_class-target() {
+ export LFLAGS="${LDFLAGS}"
+ PARALLEL_JOBS="${@oe.utils.parallel_make_argument(d, '-n %d')}"
+ OVMF_ARCH="X64"
+ if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+ OVMF_ARCH="IA32"
+ fi
+
+ # The build for the target uses BaseTools/Conf/tools_def.template
+ # from ovmf-native to find the compiler, which depends on
+ # exporting HOST_PREFIX.
+ export HOST_PREFIX="${HOST_PREFIX}"
+
+ # BaseTools/Conf gets copied to Conf, but only if that does not
+ # exist yet. To ensure that an updated template gets used during
+ # incremental builds, we need to remove the copy before we start.
+ rm -f `ls ${S}/Conf/*.txt | grep -v ReadMe.txt`
+
+ # ${WORKDIR}/ovmf is a well-known location where do_install and
+ # do_deploy will be able to find the files.
+ rm -rf ${WORKDIR}/ovmf
+ mkdir ${WORKDIR}/ovmf
+ OVMF_DIR_SUFFIX="X64"
+ if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+ OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
+ fi
+ FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
+ bbnote FIXED_GCCVER is ${FIXED_GCCVER}
+ build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
+
+ bbnote "Building without Secure Boot."
+ rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+ ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER}
+ ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd
+ ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd
+ ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd
+ ln ${build_dir}/${OVMF_ARCH}/Shell.efi ${WORKDIR}/ovmf/
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+ # See CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt and
+ # https://src.fedoraproject.org/cgit/rpms/edk2.git/tree/ for
+ # building with Secure Boot enabled.
+ bbnote "Building with Secure Boot."
+ rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+ ln -sf ${OPENSSL_RELEASE} ${S}/CryptoPkg/Library/OpensslLib/openssl
+ ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER} ${OVMF_SECURE_BOOT_FLAGS}
+ ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.secboot.fd
+ ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.secboot.code.fd
+ ln ${build_dir}/${OVMF_ARCH}/EnrollDefaultKeys.efi ${WORKDIR}/ovmf/
+ fi
+}
+
+do_install_class-native() {
+ install -d ${D}/${bindir}/edk2_basetools
+ cp -r ${S}/BaseTools ${D}/${bindir}/${EDK_TOOLS_DIR}
+}
+
+do_install_class-target() {
+ # Content for UEFI shell iso. We install the EFI shell as
+ # bootx64/ia32.efi because then it can be started even when the
+ # firmware itself does not contain it.
+ install -d ${D}/efi/boot
+ install ${WORKDIR}/ovmf/Shell.efi ${D}/efi/boot/boot${@ "ia32" if "${TARGET_ARCH}" != "x86_64" else "x64"}.efi
+ if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+ install ${WORKDIR}/ovmf/EnrollDefaultKeys.efi ${D}
+ fi
+}
+
+# This always gets packaged because ovmf-shell-image depends on it.
+# This allows testing that recipe in all configurations because it
+# can always be part of a world build.
+#
+# However, EnrollDefaultKeys.efi is only included when Secure Boot is enabled.
+PACKAGES =+ "ovmf-shell-efi"
+FILES_ovmf-shell-efi = " \
+ EnrollDefaultKeys.efi \
+ efi/ \
+"
+
+do_deploy() {
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy_class-target() {
+ # For use with "runqemu ovmf".
+ for i in \
+ ovmf \
+ ovmf.code \
+ ovmf.vars \
+ ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'ovmf.secboot ovmf.secboot.code', '', d)} \
+ ; do
+ qemu-img convert -f raw -O qcow2 ${WORKDIR}/ovmf/$i.fd ${DEPLOYDIR}/$i.qcow2
+ done
+}
+addtask do_deploy after do_compile before do_build
+
+BBCLASSEXTEND = "native"
+TOOLCHAIN = "gcc"
diff --git a/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
new file mode 100644
index 000000000..e2f616999
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd
+#
+
+SUMMARY = "Host packages for the standalone SDK or external toolchain"
+PR = "r12"
+
+inherit packagegroup nativesdk
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+RDEPENDS_${PN} = "\
+ nativesdk-pkgconfig \
+ nativesdk-qemu \
+ nativesdk-qemu-helper \
+ nativesdk-pseudo \
+ nativesdk-unfs3 \
+ nativesdk-opkg \
+ nativesdk-libtool \
+ nativesdk-autoconf \
+ nativesdk-automake \
+ nativesdk-shadow \
+ nativesdk-makedevs \
+ nativesdk-dnf \
+ nativesdk-cmake \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'nativesdk-wayland', '', d)} \
+ nativesdk-sdk-provides-dummy \
+ "
+
+RDEPENDS_${PN}_darwin = "\
+ nativesdk-pkgconfig \
+ nativesdk-opkg \
+ nativesdk-libtool \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-base.bb b/poky/meta/recipes-core/packagegroups/packagegroup-base.bb
new file mode 100644
index 000000000..bb192aed2
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -0,0 +1,364 @@
+SUMMARY = "Merge machine and distro options to create a basic machine task/package"
+PR = "r83"
+
+#
+# packages which content depend on MACHINE_FEATURES need to be MACHINE_ARCH
+#
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+inherit bluetooth
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = ' \
+ packagegroup-base \
+ packagegroup-base-extended \
+ packagegroup-distro-base \
+ packagegroup-machine-base \
+ \
+ ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "pci", "packagegroup-base-pci", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "pcmcia", "packagegroup-base-pcmcia", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "phone", "packagegroup-base-phone", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "serial", "packagegroup-base-serial", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "usbgadget", "packagegroup-base-usbgadget", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "usbhost", "packagegroup-base-usbhost", "", d)} \
+ \
+ ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "nfs", "packagegroup-base-nfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ppp", "packagegroup-base-ppp", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "smbfs", "packagegroup-base-smbfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "zeroconf", "packagegroup-base-zeroconf", "", d)} \
+ \
+ '
+
+# Override by distro if needed
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+#
+# packagegroup-base contain stuff needed for base system (machine related)
+#
+RDEPENDS_packagegroup-base = "\
+ packagegroup-distro-base \
+ packagegroup-machine-base \
+ \
+ module-init-tools \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'apm', 'packagegroup-base-apm', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'packagegroup-base-acpi', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'keyboard', 'packagegroup-base-keyboard', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'phone', 'packagegroup-base-phone', '',d)} \
+ \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'packagegroup-base-alsa', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'ext2', 'packagegroup-base-ext2', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'vfat', 'packagegroup-base-vfat', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'irda', 'packagegroup-base-irda', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pci', 'packagegroup-base-pci', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'packagegroup-base-pcmcia', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', 'packagegroup-base-usbgadget', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'packagegroup-base-usbhost', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
+ \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'smbfs', 'packagegroup-base-smbfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'packagegroup-base-ipv6', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipsec', 'packagegroup-base-ipsec', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'packagegroup-base-ppp', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '',d)} \
+ "
+
+
+RRECOMMENDS_packagegroup-base = "\
+ kernel-module-nls-utf8 \
+ kernel-module-input \
+ kernel-module-uinput \
+ kernel-module-rtc-dev \
+ kernel-module-rtc-proc \
+ kernel-module-rtc-sysfs \
+ kernel-module-unix"
+
+RDEPENDS_packagegroup-base-extended = "\
+ packagegroup-base \
+ ${ADD_WIFI} \
+ ${ADD_BT} \
+ ${ADD_3G} \
+ ${ADD_NFC} \
+ "
+
+ADD_WIFI = ""
+ADD_BT = ""
+ADD_3G = ""
+ADD_NFC = ""
+
+python __anonymous () {
+ # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
+ # then include packagegroup-base-wifi in packagegroup-base
+
+ distro_features = set(d.getVar("DISTRO_FEATURES").split())
+ machine_features= set(d.getVar("MACHINE_FEATURES").split())
+
+ if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_BT", "packagegroup-base-bluetooth")
+
+ if "wifi" in distro_features and not "wifi" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_WIFI", "packagegroup-base-wifi")
+
+ if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_3G", "packagegroup-base-3g")
+
+ if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
+ d.setVar("ADD_NFC", "packagegroup-base-nfc")
+}
+
+#
+# packages added by distribution
+#
+SUMMARY_packagegroup-distro-base = "${DISTRO} extras"
+DEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_DEPENDS}"
+RDEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RRECOMMENDS}"
+
+#
+# packages added by machine config
+#
+SUMMARY_packagegroup-machine-base = "${MACHINE} extras"
+SUMMARY_packagegroup-machine-base = "Extra packages required to fully support ${MACHINE} hardware"
+RDEPENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RRECOMMENDS}"
+
+SUMMARY_packagegroup-base-keyboard = "Keyboard support"
+RDEPENDS_packagegroup-base-keyboard = "\
+ ${VIRTUAL-RUNTIME_keymaps}"
+
+SUMMARY_packagegroup-base-pci = "PCI bus support"
+RDEPENDS_packagegroup-base-pci = "\
+ pciutils"
+
+SUMMARY_packagegroup-base-acpi = "ACPI support"
+RDEPENDS_packagegroup-base-acpi = "\
+ acpid"
+
+SUMMARY_packagegroup-base-apm = "APM support"
+RDEPENDS_packagegroup-base-apm = "\
+ ${VIRTUAL-RUNTIME_apm} \
+ apmd"
+
+SUMMARY_packagegroup-base-ext2 = "ext2 filesystem support"
+RDEPENDS_packagegroup-base-ext2 = "\
+ hdparm \
+ e2fsprogs \
+ e2fsprogs-e2fsck \
+ e2fsprogs-mke2fs"
+
+SUMMARY_packagegroup-base-vfat = "FAT filesystem support"
+RRECOMMENDS_packagegroup-base-vfat = "\
+ kernel-module-msdos \
+ kernel-module-vfat \
+ kernel-module-nls-iso8859-1 \
+ kernel-module-nls-cp437 \
+ dosfstools"
+
+SUMMARY_packagegroup-base-alsa = "ALSA sound support"
+RDEPENDS_packagegroup-base-alsa = "\
+ alsa-utils-alsactl \
+ alsa-utils-alsamixer \
+ ${VIRTUAL-RUNTIME_alsa-state}"
+
+RRECOMMENDS_packagegroup-base-alsa = "\
+ kernel-module-snd-mixer-oss \
+ kernel-module-snd-pcm-oss"
+
+SUMMARY_packagegroup-base-pcmcia = "PC card slot support"
+RDEPENDS_packagegroup-base-pcmcia = "\
+ pcmciautils \
+ "
+
+RRECOMMENDS_packagegroup-base-pcmcia = "\
+ kernel-module-pcmcia \
+ kernel-module-airo-cs \
+ kernel-module-pcnet-cs \
+ kernel-module-serial-cs \
+ kernel-module-ide-cs \
+ kernel-module-ide-disk \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-hostap-cs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-orinoco-cs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-spectrum-cs', '',d)}"
+
+SUMMARY_packagegroup-base-bluetooth = "Bluetooth support"
+RDEPENDS_packagegroup-base-bluetooth = "\
+ ${BLUEZ} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', bb.utils.contains('BLUEZ', 'bluez4', 'libasound-module-bluez', '', d), '',d)} \
+ "
+
+RRECOMMENDS_packagegroup-base-bluetooth = "\
+ kernel-module-bluetooth \
+ kernel-module-l2cap \
+ kernel-module-rfcomm \
+ kernel-module-hci-vhci \
+ kernel-module-bnep \
+ kernel-module-hidp \
+ kernel-module-hci-uart \
+ kernel-module-sco \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-hci-usb', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetooth3c-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluecard-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetoothuart-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-dtl1-cs', '',d)} \
+ "
+
+SUMMARY_packagegroup-base-irda = "IrDA support"
+RDEPENDS_packagegroup-base-irda = "\
+ irda-utils"
+
+RRECOMMENDS_packagegroup-base-irda = "\
+ kernel-module-pxaficp-ir \
+ kernel-module-irda \
+ kernel-module-ircomm \
+ kernel-module-ircomm-tty \
+ kernel-module-irlan \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \
+ kernel-module-irport \
+ kernel-module-irtty \
+ kernel-module-irtty-sir \
+ kernel-module-sir-dev \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} "
+
+SUMMARY_packagegroup-base-usbgadget = "USB gadget support"
+RRECOMMENDS_packagegroup-base-usbgadget = "\
+ kernel-module-pxa27x_udc \
+ kernel-module-gadgetfs \
+ kernel-module-g-file-storage \
+ kernel-module-g-serial \
+ kernel-module-g-ether"
+
+SUMMARY_packagegroup-base-usbhost = "USB host support"
+RDEPENDS_packagegroup-base-usbhost = "\
+ usbutils "
+
+RRECOMMENDS_packagegroup-base-usbhost = "\
+ kernel-module-uhci-hcd \
+ kernel-module-ohci-hcd \
+ kernel-module-ehci-hcd \
+ kernel-module-usbcore \
+ kernel-module-usbhid \
+ kernel-module-usbnet \
+ kernel-module-sd-mod \
+ kernel-module-scsi-mod \
+ kernel-module-usbmouse \
+ kernel-module-mousedev \
+ kernel-module-usbserial \
+ kernel-module-usb-storage "
+
+SUMMARY_packagegroup-base-ppp = "PPP dial-up protocol support"
+RDEPENDS_packagegroup-base-ppp = "\
+ ppp \
+ ppp-dialin"
+
+RRECOMMENDS_packagegroup-base-ppp = "\
+ kernel-module-ppp-async \
+ kernel-module-ppp-deflate \
+ kernel-module-ppp-generic \
+ kernel-module-ppp-mppe \
+ kernel-module-slhc"
+
+SUMMARY_packagegroup-base-ipsec = "IPSEC support"
+RDEPENDS_packagegroup-base-ipsec = "\
+ "
+
+RRECOMMENDS_packagegroup-base-ipsec = "\
+ kernel-module-ipsec"
+
+#
+# packagegroup-base-wifi contain everything needed to get WiFi working
+# WEP/WPA connection needs to be supported out-of-box
+#
+SUMMARY_packagegroup-base-wifi = "WiFi support"
+RDEPENDS_packagegroup-base-wifi = "\
+ ${VIRTUAL-RUNTIME_wireless-tools} \
+ wpa-supplicant"
+
+RRECOMMENDS_packagegroup-base-wifi = "\
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \
+ kernel-module-ieee80211-crypt \
+ kernel-module-ieee80211-crypt-ccmp \
+ kernel-module-ieee80211-crypt-tkip \
+ kernel-module-ieee80211-crypt-wep \
+ kernel-module-ecb \
+ kernel-module-arc4 \
+ kernel-module-crypto_algapi \
+ kernel-module-cryptomgr \
+ kernel-module-michael-mic \
+ kernel-module-aes-generic \
+ kernel-module-aes"
+
+SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
+RDEPENDS_packagegroup-base-nfc = "\
+ neard"
+
+RRECOMMENDS_packagegroup-base-nfc = "\
+ kernel-module-nfc"
+
+SUMMARY_packagegroup-base-3g = "Cellular data support"
+RDEPENDS_packagegroup-base-3g = "\
+ ofono"
+
+RRECOMMENDS_packagegroup-base-3g = "\
+ kernel-module-cdc-acm \
+ kernel-module-cdc-wdm"
+
+SUMMARY_packagegroup-base-smbfs = "SMB network filesystem support"
+RRECOMMENDS_packagegroup-base-smbfs = "\
+ kernel-module-cifs \
+ kernel-module-smbfs"
+
+SUMMARY_packagegroup-base-cramfs = "cramfs filesystem support"
+RRECOMMENDS_packagegroup-base-cramfs = "\
+ kernel-module-cramfs"
+
+#
+# packagegroup-base-nfs provides ONLY client support - server is in nfs-utils package
+#
+SUMMARY_packagegroup-base-nfs = "NFS network filesystem support"
+RDEPENDS_packagegroup-base-nfs = "\
+ rpcbind"
+
+RRECOMMENDS_packagegroup-base-nfs = "\
+ kernel-module-nfs "
+
+SUMMARY_packagegroup-base-zeroconf = "Zeroconf support"
+RDEPENDS_packagegroup-base-zeroconf = "\
+ avahi-daemon"
+RDEPENDS_packagegroup-base-zeroconf_append_libc-glibc = "\
+ libnss-mdns \
+ "
+
+SUMMARY_packagegroup-base-ipv6 = "IPv6 support"
+RDEPENDS_packagegroup-base-ipv6 = "\
+ "
+
+RRECOMMENDS_packagegroup-base-ipv6 = "\
+ kernel-module-ipv6 "
+
+SUMMARY_packagegroup-base-serial = "Serial port support"
+RDEPENDS_packagegroup-base-serial = "\
+ setserial \
+ lrzsz "
+
+SUMMARY_packagegroup-base-phone = "Cellular telephony (voice) support"
+RDEPENDS_packagegroup-base-phone = "\
+ ofono"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
new file mode 100644
index 000000000..76cd7fc4e
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+PR = "r17"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#
+# Set by the machine configuration with packages essential for device bootup
+#
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+# Distro can override the following VIRTUAL-RUNTIME providers:
+VIRTUAL-RUNTIME_dev_manager ?= "udev"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+EFI_PROVIDER ??= "grub-efi"
+
+SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', '${VIRTUAL-RUNTIME_base-utils-hwclock}', '', d)} \
+ modutils-initscripts \
+ init-ifupdown \
+ ${VIRTUAL-RUNTIME_initscripts} \
+ "
+
+RDEPENDS_${PN} = "\
+ base-files \
+ base-passwd \
+ ${VIRTUAL-RUNTIME_base-utils} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER} kernel", "", d)} \
+ netbase \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ${VIRTUAL-RUNTIME_dev_manager} \
+ ${VIRTUAL-RUNTIME_update-alternatives} \
+ ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
+
+RRECOMMENDS_${PN} = "\
+ ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
new file mode 100644
index 000000000..78cc65db8
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+# Copyright (C) 2012 Red Hat, Inc.
+#
+
+SUMMARY = "Essential build dependencies"
+
+inherit packagegroup
+
+RDEPENDS_packagegroup-core-buildessential = "\
+ autoconf \
+ automake \
+ binutils \
+ binutils-symlinks \
+ cpp \
+ cpp-symlinks \
+ gcc \
+ gcc-symlinks \
+ g++ \
+ g++-symlinks \
+ gettext \
+ make \
+ libstdc++ \
+ libstdc++-dev \
+ libtool \
+ pkgconfig \
+ "
+
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
new file mode 100644
index 000000000..c45463fc6
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Remote debugging tools for Eclipse integration"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ gdbserver \
+ tcf-agent \
+ openssh-sftp-server \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
new file mode 100644
index 000000000..b345e314a
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "NFS package groups"
+PR = "r2"
+
+inherit packagegroup
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = "${PN}-server ${PN}-client"
+
+SUMMARY_${PN}-client = "NFS client"
+RDEPENDS_${PN}-client = "nfs-utils-client"
+
+SUMMARY_${PN}-server = "NFS server"
+RDEPENDS_${PN}-server = "\
+ nfs-utils \
+ nfs-utils-client \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
new file mode 100644
index 000000000..45e8c1358
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -0,0 +1,80 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Software development tools"
+PR = "r9"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#PACKAGEFUNCS =+ 'generate_sdk_pkgs'
+
+RDEPENDS_packagegroup-core-sdk = "\
+ packagegroup-core-buildessential \
+ coreutils \
+ ccache \
+ diffutils \
+ intltool \
+ perl-module-re \
+ perl-module-text-wrap \
+ findutils \
+ quilt \
+ less \
+ ldd \
+ file \
+ tcl"
+
+SANITIZERS = "libasan-dev libubsan-dev"
+SANITIZERS_microblaze = ""
+SANITIZERS_mipsarch = ""
+SANITIZERS_nios2 = ""
+SANITIZERS_riscv64 = ""
+SANITIZERS_libc-musl = ""
+
+RRECOMMENDS_packagegroup-core-sdk = "\
+ libgomp \
+ libgomp-dev \
+ ${SANITIZERS}"
+
+#python generate_sdk_pkgs () {
+# poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
+# pkgs = d.getVar('PACKAGES').split()
+# for pkg in poky_pkgs.split():
+# newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk')
+#
+# # for each of the task packages, add a corresponding sdk task
+# pkgs.append(newpkg)
+#
+# # for each sdk task, take the rdepends of the non-sdk task, and turn
+# # that into rrecommends upon the -dev versions of those, not unlike
+# # the package depchain code
+# spkgdata = read_subpkgdata(pkg, d)
+#
+# rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '')
+# rreclist = []
+#
+# for depend in rdepends:
+# split_depend = depend.split(' (')
+# name = split_depend[0].strip()
+# if packaged('%s-dev' % name, d):
+# rreclist.append('%s-dev' % name)
+# else:
+# deppkgdata = read_subpkgdata(name, d)
+# rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '')
+# for depend in rdepends2:
+# split_depend = depend.split(' (')
+# name = split_depend[0].strip()
+# if packaged('%s-dev' % name, d):
+# rreclist.append('%s-dev' % name)
+#
+# oldrrec = d.getVar('RRECOMMENDS_%s' % newpkg, False) or ''
+# d.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist))
+# # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, d.getVar('RRECOMMENDS_%s' % newpkg, False)))
+#
+# # bb.note('pkgs is %s' % pkgs)
+# d.setVar('PACKAGES', ' '.join(pkgs))
+#}
+#
+#PACKAGES_DYNAMIC += "^packagegroup-core-sdk-.*"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
new file mode 100644
index 000000000..5ec3f6c92
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Dropbear SSH client/server"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "dropbear"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
new file mode 100644
index 000000000..703f956ae
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
@@ -0,0 +1,6 @@
+SUMMARY = "OpenSSH SSH client/server"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "openssh"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
new file mode 100644
index 000000000..43fc599c7
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Target packages for the standalone SDK"
+PR = "r8"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ libgcc \
+ libgcc-dev \
+ libatomic \
+ libatomic-dev \
+ libstdc++ \
+ libstdc++-dev \
+ ${LIBC_DEPENDENCIES} \
+ "
+
+RRECOMMENDS_${PN} = "\
+ libssp \
+ libssp-dev \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
new file mode 100644
index 000000000..9fc2b0ef4
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Debugging tools"
+
+inherit packagegroup
+
+PR = "r3"
+
+MTRACE = ""
+MTRACE_libc-glibc = "libc-mtrace"
+
+RDEPENDS_${PN} = "\
+ gdb \
+ gdbserver \
+ strace \
+ ${MTRACE} \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
new file mode 100644
index 000000000..fa0e363d8
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -0,0 +1,72 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Profiling tools"
+
+PR = "r3"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+PROFILE_TOOLS_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}"
+# sysprof doesn't support aarch64 and nios2
+PROFILE_TOOLS_X_aarch64 = ""
+PROFILE_TOOLS_X_nios2 = ""
+PROFILE_TOOLS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)}"
+
+RRECOMMENDS_${PN} = "\
+ ${PERF} \
+ trace-cmd \
+ blktrace \
+ ${PROFILE_TOOLS_X} \
+ ${PROFILE_TOOLS_SYSTEMD} \
+ "
+
+PROFILETOOLS = "\
+ powertop \
+ "
+PERF = "perf"
+PERF_libc-musl = ""
+
+# systemtap needs elfutils which is not fully buildable on some arches/libcs
+SYSTEMTAP = "systemtap"
+SYSTEMTAP_libc-musl = ""
+SYSTEMTAP_nios2 = ""
+
+# lttng-ust uses sched_getcpu() which is not there on for some platforms.
+LTTNGUST = "lttng-ust"
+LTTNGUST_libc-musl = ""
+LTTNGUST_riscv64 = ""
+
+LTTNGTOOLS = "lttng-tools"
+LTTNGTOOLS_libc-musl = ""
+LTTNGTOOLS_riscv64 = ""
+
+LTTNGMODULES = "lttng-modules"
+
+BABELTRACE = "babeltrace"
+
+# valgrind does not work on the following configurations/architectures
+
+VALGRIND = "valgrind"
+VALGRIND_libc-musl = ""
+VALGRIND_mipsarch = ""
+VALGRIND_nios2 = ""
+VALGRIND_armv4 = ""
+VALGRIND_armv5 = ""
+VALGRIND_armv6 = ""
+VALGRIND_armeb = ""
+VALGRIND_aarch64 = ""
+VALGRIND_linux-gnux32 = ""
+
+RDEPENDS_${PN} = "\
+ ${PROFILETOOLS} \
+ ${LTTNGUST} \
+ ${LTTNGTOOLS} \
+ ${LTTNGMODULES} \
+ ${BABELTRACE} \
+ ${SYSTEMTAP} \
+ ${VALGRIND} \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
new file mode 100644
index 000000000..b8e507073
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Testing tools/applications"
+
+PR = "r2"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+# kexec-tools doesn't work on e5500-64b, microblaze and nios2 yet
+KEXECTOOLS ?= "kexec"
+KEXECTOOLS_e5500-64b ?= ""
+KEXECTOOLS_microblaze ?= ""
+KEXECTOOLS_nios2 ?= ""
+
+X11GLTOOLS = "\
+ mesa-demos \
+ "
+
+3GTOOLS = "\
+ ofono-tests \
+ "
+
+X11TOOLS = "\
+ fstests \
+ gst-examples \
+ x11perf \
+ xrestop \
+ xwininfo \
+ xprop \
+ xvideo-tests \
+ "
+
+RDEPENDS_${PN} = "\
+ blktool \
+ lrzsz \
+ ${KEXECTOOLS} \
+ alsa-utils-amixer \
+ alsa-utils-aplay \
+ ltp \
+ connman-tools \
+ connman-tests \
+ connman-client \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
new file mode 100644
index 000000000..d551147b5
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Host SDK package for cross canadian toolchain"
+PN = "packagegroup-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+# Use indirection to stop these being expanded prematurely
+BINUTILS = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS_${PN} = "\
+ ${@all_multilib_tune_values(d, 'BINUTILS')} \
+ ${@all_multilib_tune_values(d, 'GCC')} \
+ ${@all_multilib_tune_values(d, 'GDB')} \
+ meta-environment-${MACHINE} \
+ "
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb b/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb
new file mode 100644
index 000000000..3daace1a4
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Host SDK package for Go cross canadian toolchain"
+PN = "packagegroup-go-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+GO = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS_${PN} = " \
+ ${@all_multilib_tune_values(d, 'GO')} \
+"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb b/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
new file mode 100644
index 000000000..7d2ccbda2
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Target packages for the Go SDK"
+
+inherit packagegroup goarch
+
+RDEPENDS_${PN} = " \
+ go-runtime \
+ go-runtime-dev \
+ go-runtime-staticdev \
+"
diff --git a/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
new file mode 100644
index 000000000..adb0c56c3
--- /dev/null
+++ b/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -0,0 +1,197 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Self-hosting"
+DESCRIPTION = "Packages required to run the build system"
+PR = "r13"
+
+inherit packagegroup distro_features_check
+# rdepends on libx11-dev
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# rdepends on libgl
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+PACKAGES = "\
+ packagegroup-self-hosted \
+ packagegroup-self-hosted-debug \
+ packagegroup-self-hosted-sdk \
+ packagegroup-self-hosted-extended \
+ packagegroup-self-hosted-graphics \
+ packagegroup-self-hosted-host-tools \
+ "
+
+RDEPENDS_packagegroup-self-hosted = "\
+ packagegroup-self-hosted-debug \
+ packagegroup-self-hosted-sdk \
+ packagegroup-self-hosted-extended \
+ packagegroup-self-hosted-graphics \
+ packagegroup-self-hosted-host-tools \
+ "
+
+RDEPENDS_packagegroup-self-hosted-host-tools = "\
+ e2fsprogs \
+ e2fsprogs-e2fsck \
+ e2fsprogs-mke2fs \
+ e2fsprogs-tune2fs \
+ hdparm \
+ iptables \
+ lsb \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ parted \
+ ${PSEUDO} \
+ screen \
+ "
+PSEUDO = "pseudo"
+PSEUDO_libc-musl = ""
+
+RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
+ kernel-module-tun \
+ kernel-module-iptable-raw \
+ kernel-module-iptable-nat \
+ kernel-module-iptable-mangle \
+ kernel-module-iptable-filter \
+ "
+
+RDEPENDS_packagegroup-self-hosted-sdk = "\
+ autoconf \
+ automake \
+ binutils \
+ binutils-symlinks \
+ ccache \
+ coreutils \
+ cpp \
+ cpp-symlinks \
+ distcc \
+ file \
+ findutils \
+ g++ \
+ g++-symlinks \
+ gcc \
+ gcc-symlinks \
+ intltool \
+ ldd \
+ less \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libstdc++ \
+ libstdc++-dev \
+ libtool \
+ make \
+ mktemp \
+ perl-module-re \
+ perl-module-text-wrap \
+ pkgconfig \
+ quilt \
+ sed \
+ "
+# glibc-utils: for rpcgen
+RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
+ glibc-gconv-ibm850 \
+ glibc-utils \
+ "
+RDEPENDS_packagegroup-self-hosted-debug = " \
+ gdb \
+ gdbserver \
+ rsync \
+ strace \
+ tcf-agent"
+
+
+RDEPENDS_packagegroup-self-hosted-extended = "\
+ bzip2 \
+ chkconfig \
+ chrpath \
+ cpio \
+ curl \
+ diffstat \
+ diffutils \
+ elfutils \
+ expat \
+ gawk \
+ gdbm \
+ gettext \
+ gettext-runtime \
+ git \
+ git-perltools \
+ grep \
+ groff \
+ gzip \
+ settings-daemon \
+ libaio \
+ libusb1 \
+ libxml2 \
+ lrzsz \
+ lsof \
+ lzo \
+ man \
+ man-pages \
+ mdadm \
+ minicom \
+ mtools \
+ ncurses \
+ ncurses-terminfo-base \
+ nfs-utils \
+ nfs-utils-client \
+ openssl \
+ openssh-scp \
+ openssh-sftp-server \
+ openssh-ssh \
+ opkg \
+ opkg-utils \
+ patch \
+ perl \
+ perl-dev \
+ perl-misc \
+ perl-modules \
+ perl-pod \
+ python \
+ python-modules \
+ python3 \
+ python3-modules \
+ python3-git \
+ quota \
+ readline \
+ rpm \
+ setserial \
+ socat \
+ subversion \
+ sudo \
+ sysstat \
+ tar \
+ tcl \
+ texi2html \
+ texinfo \
+ unzip \
+ usbutils \
+ watchdog \
+ wget \
+ which \
+ xinetd \
+ zip \
+ zlib \
+ xz \
+ "
+
+
+RDEPENDS_packagegroup-self-hosted-graphics = "\
+ builder \
+ libgl \
+ libgl-dev \
+ libglu \
+ libglu-dev \
+ libsdl \
+ libsdl-dev \
+ libx11-dev \
+ adwaita-icon-theme \
+ xdg-utils \
+ epiphany \
+ l3afpad \
+ pcmanfm \
+ vte \
+ "
diff --git a/poky/meta/recipes-core/psplash/files/psplash-init b/poky/meta/recipes-core/psplash/files/psplash-init
new file mode 100755
index 000000000..0bce1de53
--- /dev/null
+++ b/poky/meta/recipes-core/psplash/files/psplash-init
@@ -0,0 +1,35 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: psplash
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ ! -e /dev/fb0 ]; then
+ echo "Framebuffer /dev/fb0 not detected"
+ echo "Boot splashscreen disabled"
+ exit 0;
+fi
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+ case $x in
+ psplash=false)
+ echo "Boot splashscreen disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+export TMPDIR=/mnt/.psplash
+mount tmpfs -t tmpfs $TMPDIR -o,size=40k
+
+rotation=0
+if [ -e /etc/rotation ]; then
+ read rotation < /etc/rotation
+fi
+
+/usr/bin/psplash --angle $rotation &
+
diff --git a/poky/meta/recipes-core/psplash/files/psplash-poky-img.h b/poky/meta/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 000000000..8d56aa020
--- /dev/null
+++ b/poky/meta/recipes-core/psplash/files/psplash-poky-img.h
@@ -0,0 +1,1259 @@
+/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
+
+#define POKY_IMG_ROWSTRIDE (1920)
+#define POKY_IMG_WIDTH (640)
+#define POKY_IMG_HEIGHT (480)
+#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
+#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\237\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+ "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+ "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+ "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\363\376\377\374\3\373\375" \
+ "\372\360\366\370\353\360\363\202\347\355\357\5\346\354\356\347\355\357" \
+ "\351\356\360\360\366\370\371\373\370\363\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\353\376\377\374\10\356" \
+ "\363\366\324\331\333\277\304\306\252\262\272\227\237\247}\220\233p\203" \
+ "\216ew\202\212]oz\10dv\201n\201\214~\215\223\216\236\244\247\257\267" \
+ "\274\301\303\320\326\330\352\357\362\353\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\346\376\377\374\5\366" \
+ "\370\364\320\326\330\255\265\275\210\227\235j}\210\232]oz\5gy\204\204" \
+ "\223\231\250\260\270\314\321\324\355\362\365\346\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\342\376\377" \
+ "\374\5\373\375\372\327\334\337\253\263\273x\213\227^p{\243]oz\4q\204" \
+ "\217\242\252\262\320\326\330\365\372\375\342\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\337\376\377\374" \
+ "\4\371\373\370\317\324\327\225\245\253ew\202\252]oz\4bt\177\211\230\236" \
+ "\306\314\316\367\371\366\337\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\335\376\377\374\3\333\340\343\236" \
+ "\246\256fx\203\260]oz\3bt\177\225\235\245\320\326\330\335\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\332" \
+ "\376\377\374\3\367\371\366\276\303\305u\210\224\266]oz\3m\200\213\257" \
+ "\267\277\355\362\365\332\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\330\376\377\374\3\353\360\363\252\262" \
+ "\272fx\203\272]oz\3as~\230\250\256\342\347\352\330\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\326\376\377" \
+ "\374\3\352\357\362\236\246\256as~\276]oz\3^p{\216\236\244\341\346\351" \
+ "\326\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\324\376\377\374\3\354\361\364\246\256\266as~\302]oz\3^p" \
+ "{\227\237\247\346\354\356\324\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\322\376\377\374\3\372\374\371\265" \
+ "\276\306fx\203\306]oz\3as~\250\260\270\362\367\371\322\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\321\376" \
+ "\377\374\2\320\326\330p\203\216\312]oz\2hz\205\302\307\312\321\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\317\376\377\374\2\356\363\366\231\241\251\316]oz\2\204\223\231\345\352" \
+ "\355\317\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\316\376\377\374\2\311\316\321i{\206\320]oz\2bt\177\264" \
+ "\274\305\316\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\314\376\377\374\2\362\367\371\226\246\254\324]o" \
+ "z\2\206\225\233\353\360\363\314\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\313\376\377\374\2\334\342\344o\202" \
+ "\215\326]oz\2gy\204\315\322\325\313\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\312\376\377\374\2\302\307\312" \
+ "as~\330]oz\3^p{\254\264\274\373\375\372\311\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\310\376\377\374\2\372" \
+ "\374\371\236\246\256\334]oz\2\210\227\235\360\366\370\310\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\307" \
+ "\376\377\374\2\360\366\370\205\224\232\336]oz\2s\206\221\347\355\357" \
+ "\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\306\376\377\374\2\347\355\357t\207\222\340]oz\2i{\206\333" \
+ "\340\343\306\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\305\376\377\374\2\343\350\353j}\210\251]oz\7bt\177" \
+ "w\212\226\215\234\243\236\246\256\246\256\266\254\264\274\264\274\305" \
+ "\202\300\305\310\7\264\274\305\255\265\275\250\260\270\233\252\261\222" \
+ "\241\247~\215\223ew\202\251]oz\2cu\200\322\330\332\305\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\304\376" \
+ "\377\374\2\337\344\346i{\206\245]oz\5j}\210\230\240\250\270\300\311\322" \
+ "\330\332\351\356\360\220\376\377\374\5\354\361\364\326\333\335\300\305" \
+ "\310\236\246\256p\203\216\245]oz\2as~\316\323\326\304\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\303\376" \
+ "\377\374\2\335\343\345gy\204\242]oz\4ew\202\222\241\247\276\303\305\342" \
+ "\347\352\232\376\377\374\4\352\357\362\304\311\314\233\243\253j}\210" \
+ "\242]oz\2as~\313\320\322\303\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\302\376\377\374\2\341\346\351hz" \
+ "\205\240]oz\4_q|\211\230\236\307\315\317\370\372\367\240\376\377\374" \
+ "\4\373\375\372\320\326\330\231\241\251bt\177\240]oz\2as~\317\324\327" \
+ "\302\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\301\376\377\374\2\343\350\353i{\206\237]oz\3q\204\217\266" \
+ "\277\307\354\361\364\246\376\377\374\3\366\370\364\303\310\313\177\216" \
+ "\224\237]oz\2bt\177\325\332\334\301\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\300\376\377\374\2\355\362\365" \
+ "l\177\212\236]oz\3u\210\224\307\315\317\373\375\372\253\376\377\374\2" \
+ "\324\331\333\204\223\231\236]oz\2ew\202\341\346\351\300\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\277\376" \
+ "\377\374\2\365\372\375\177\216\224\235]oz\2~\215\223\315\322\325\260" \
+ "\376\377\374\2\331\336\341\211\230\236\235]oz\2l\177\212\353\360\363" \
+ "\277\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\277\376\377\374\1\214\233\242\234]oz\2i{\206\305\312\315" \
+ "\264\376\377\374\2\324\331\333q\204\217\234]oz\2u\210\224\367\371\366" \
+ "\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\276\376\377\374\1\257\267\277\233]oz\3^p{\242\252\262\362" \
+ "\367\371\266\376\377\374\3\372\374\371\261\271\302bt\177\233]oz\1\225" \
+ "\235\245\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\275\376\377\374\2\317\324\327^p{\232]oz\2w\212\226" \
+ "\335\343\345\272\376\377\374\2\351\356\360\211\230\236\233]oz\1\264\274" \
+ "\305\275\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\274\376\377\374\2\347\355\357ew\202\232]oz\2\242\252" \
+ "\262\371\373\370\225\376\377\374\10\336\367\374\262\355\370\220\343\361" \
+ "m\332\361G\317\353,\311\352(\307\350#\304\346\202\0\301\350\10\0\304" \
+ "\352(\307\350,\311\352B\314\347i\326\356\207\341\364\260\353\366\333" \
+ "\364\371\226\376\377\374\2\266\277\307as~\231]oz\2_q|\327\334\337\274" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\273\376\377\374\2\373\375\372}\220\233\231]oz\2ew\202\313\320" \
+ "\322\223\376\377\374\4\334\365\372\233\345\364M\323\357\0\304\352\222" \
+ "\25\274\344\4\0\301\350J\321\355\211\342\365\314\361\372\223\376\377" \
+ "\374\2\332\337\342m\200\213\231]oz\2l\177\212\360\366\370\273\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\273\376\377\374\1\257\267\277\231]oz\2x\213\227\347\355\357\221\376" \
+ "\377\374\3\336\367\374\206\340\363*\310\351\232\25\274\344\3#\304\346" \
+ "w\333\356\316\363\374\221\376\377\374\2\360\366\370\214\233\242\231]" \
+ "oz\1\227\237\247\273\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\272\376\377\374\2\335\343\345_q|\230]oz" \
+ "\2\210\227\235\364\371\374\217\376\377\374\3\370\376\377\256\350\364" \
+ "B\314\347\240\25\274\344\3*\310\351\233\345\364\367\375\377\217\376\377" \
+ "\374\2\373\375\372\242\252\262\231]oz\1\305\312\315\272\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\271\376" \
+ "\377\374\2\372\374\371w\212\226\230]oz\2\231\241\251\372\374\371\216" \
+ "\376\377\374\3\367\375\377\233\345\364(\307\350\244\25\274\344\3\0\302" \
+ "\351\206\340\363\356\373\374\217\376\377\374\1\257\267\277\230]oz\2h" \
+ "z\205\356\363\366\271\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\271\376\377\374\1\257\267\277\230]oz\1\246" \
+ "\256\266\217\376\377\374\2\237\350\367\0\304\352\250\25\274\344\3\0\276" \
+ "\345\207\341\364\370\376\377\216\376\377\374\2\277\304\306_q|\227]oz" \
+ "\1\231\241\251\271\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\270\376\377\374\2\346\354\356bt\177\227]oz\1" \
+ "\251\261\271\216\376\377\374\2\315\362\3731\313\354\254\25\274\344\2" \
+ "(\307\350\262\355\370\216\376\377\374\2\305\312\315^p{\227]oz\1\322\330" \
+ "\332\270\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\270\376\377\374\1\215\234\243\227]oz\1\233\252\261\215" \
+ "\376\377\374\3\367\375\377m\332\361\0\276\345\257\25\274\344\2L\322\356" \
+ "\356\373\374\215\376\377\374\1\274\301\303\227]oz\2t\207\222\373\375" \
+ "\372\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\267\376\377\374\1\325\332\334\227]oz\2\214\233\242\373" \
+ "\375\372\214\376\377\374\2\333\364\371,\311\352\262\25\274\344\2\0\304" \
+ "\352\301\356\366\215\376\377\374\1\252\262\272\227]oz\1\274\301\303\267" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\267\376\377\374\1v\211\225\226]oz\2\205\224\232\365\372\375" \
+ "\214\376\377\374\2\236\347\366\0\276\345\264\25\274\344\3\0\276\345\203" \
+ "\334\360\370\376\377\214\376\377\374\1\236\246\256\226]oz\2hz\205\362" \
+ "\367\371\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\266\376\377\374\1\307\315\317\226]oz\2n\201\214" \
+ "\360\366\370\214\376\377\374\1m\332\361\270\25\274\344\2I\320\354\366" \
+ "\373\376\213\376\377\374\2\373\375\372\203\222\230\226]oz\1\254\264\274" \
+ "\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\265\376\377\374\2\373\375\372s\206\221\225]oz\2as~\333\340" \
+ "\343\213\376\377\374\2\370\376\377M\323\357\272\25\274\344\2""1\313\354" \
+ "\356\373\374\213\376\377\374\2\353\360\363i{\206\225]oz\2ew\202\357\365" \
+ "\367\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\265\376\377\374\1\305\312\315\226]oz\1\265\276\306\213" \
+ "\376\377\374\2\366\373\376B\314\347\274\25\274\344\2(\307\350\336\367" \
+ "\374\213\376\377\374\2\322\330\332^p{\225]oz\1\252\262\272\265\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\265\376\377\374\1u\210\224\225]oz\1\214\233\242\213\376\377\374\2\366" \
+ "\373\376B\314\347\276\25\274\344\2#\304\346\337\370\375\213\376\377\374" \
+ "\1\253\263\273\225]oz\2fx\203\367\371\366\264\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374" \
+ "\1\322\330\332\225]oz\2i{\206\360\366\370\212\376\377\374\2\370\376\377" \
+ "I\320\354\300\25\274\344\2*\310\351\357\374\375\212\376\377\374\2\373" \
+ "\375\372~\215\223\225]oz\1\264\274\305\264\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1\210" \
+ "\227\235\225]oz\1\303\310\313\213\376\377\374\1i\326\356\302\25\274\344" \
+ "\2B\314\347\370\376\377\212\376\377\374\2\335\343\345^p{\224]oz\2m\200" \
+ "\213\373\375\372\263\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\263\376\377\374\2\345\352\355^p{\224]oz" \
+ "\1~\221\235\213\376\377\374\1y\336\360\304\25\274\344\1M\323\357\213" \
+ "\376\377\374\1\242\252\262\225]oz\1\315\322\325\263\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\263\376\377" \
+ "\374\1\252\262\272\224]oz\2_q|\341\346\351\212\376\377\374\2\274\355" \
+ "\373\0\276\345\305\25\274\344\1\220\343\361\212\376\377\374\2\360\366" \
+ "\370i{\206\224]oz\1\211\230\236\263\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\262\376\377\374\2\372\374\371" \
+ "i{\206\224]oz\1\250\260\270\212\376\377\374\2\350\371\377\0\304\352\306" \
+ "\25\274\344\2\0\276\345\316\363\374\212\376\377\374\1\303\310\313\224" \
+ "]oz\2^p{\352\357\362\262\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\262\376\377\374\1\315\322\325\224]o" \
+ "z\2dv\201\357\365\367\212\376\377\374\1G\317\353\240\25\274\344\3\0\302" \
+ "\351,\311\352J\321\355\203L\322\356\2B\314\347#\304\346\240\25\274\344" \
+ "\2*\310\351\367\375\377\212\376\377\374\1q\204\217\224]oz\1\257\267\277" \
+ "\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\262\376\377\374\1\230\240\250\224]oz\1\247\257\267\212\376" \
+ "\377\374\1\233\345\364\235\25\274\344\4*\310\351n\333\362\273\354\371" \
+ "\360\375\376\210\376\377\374\4\357\374\375\303\361\370\206\340\363/\312" \
+ "\353\235\25\274\344\1w\333\356\212\376\377\374\1\303\310\313\224]oz\1" \
+ "v\211\225\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\261\376\377\374\2\365\372\375dv\201\223]oz\2as~" \
+ "\353\360\363\211\376\377\374\2\356\373\374\0\302\351\232\25\274\344\3" \
+ "\0\276\345m\332\361\335\366\373\220\376\377\374\2\336\367\374(\307\350" \
+ "\232\25\274\344\2%\305\347\336\367\374\212\376\377\374\2\372\374\371" \
+ "n\201\214\224]oz\1\343\350\353\261\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\261\376\377\374\1\313\320\322" \
+ "\224]oz\1\233\252\261\212\376\377\374\1k\327\357\231\25\274\344\3\0\276" \
+ "\345\206\340\363\357\374\375\222\376\377\374\1k\327\357\232\25\274\344" \
+ "\2%\305\347\336\367\374\214\376\377\374\1\276\303\305\224]oz\1\257\267" \
+ "\277\261\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\261\376\377\374\1\226\246\254\223]oz\2^p{\347\355\357" \
+ "\211\376\377\374\2\316\363\374\0\276\345\230\25\274\344\2J\321\355\337" \
+ "\370\375\223\376\377\374\1k\327\357\232\25\274\344\2%\305\347\336\367" \
+ "\374\215\376\377\374\2\370\372\367i{\206\223]oz\1\177\216\224\261\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\261\376\377\374\1k~\211\223]oz\1\205\224\232\212\376\377\374\1J" \
+ "\321\355\227\25\274\344\2\0\276\345\257\351\365\224\376\377\374\1m\332" \
+ "\361\232\25\274\344\2%\305\347\336\367\374\217\376\377\374\1\246\256" \
+ "\266\223]oz\2^p{\356\363\366\260\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\260\376\377\374\1\335\343\345" \
+ "\224]oz\1\303\310\313\211\376\377\374\2\333\364\371\0\276\345\226\25" \
+ "\274\344\2#\304\346\316\363\374\224\376\377\374\1m\332\361\232\25\274" \
+ "\344\2%\305\347\336\367\374\220\376\377\374\1\335\343\345\224]oz\1\306" \
+ "\314\316\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\260\376\377\374\1\264\274\305\223]oz\2cu\200\367" \
+ "\371\366\211\376\377\374\1i\326\356\226\25\274\344\2,\311\352\347\370" \
+ "\376\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367\374" \
+ "\222\376\377\374\1t\207\222\223]oz\1\236\246\256\260\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\260\376" \
+ "\377\374\1\215\234\243\223]oz\1\231\241\251\211\376\377\374\2\347\370" \
+ "\376\0\276\345\225\25\274\344\2*\310\351\357\374\375\224\376\377\374" \
+ "\1m\332\361\232\25\274\344\2%\305\347\336\367\374\223\376\377\374\1\261" \
+ "\271\302\223]oz\1q\204\217\260\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\260\376\377\374\1i{\206\223]oz\1" \
+ "\317\324\327\211\376\377\374\1\207\341\364\225\25\274\344\2#\304\346" \
+ "\337\370\375\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336" \
+ "\367\374\224\376\377\374\1\351\356\360\224]oz\1\356\363\366\257\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\257\376\377\374\1\345\352\355\223]oz\2as~\370\372\367\211\376\377\374" \
+ "\1,\311\352\224\25\274\344\2\0\276\345\313\360\371\224\376\377\374\1" \
+ "m\332\361\232\25\274\344\2%\305\347\336\367\374\226\376\377\374\1q\204" \
+ "\217\223]oz\1\314\321\324\257\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\257\376\377\374\1\311\316\321\223" \
+ "]oz\1\202\221\227\211\376\377\374\1\320\365\376\225\25\274\344\1\207" \
+ "\341\364\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367" \
+ "\374\214\376\377\374\2\236\347\366\237\350\367\211\376\377\374\1\236" \
+ "\246\256\223]oz\1\255\265\275\257\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\254\264\274" \
+ "\223]oz\1\255\265\275\211\376\377\374\1y\336\360\224\25\274\344\2/\312" \
+ "\353\370\376\377\223\376\377\374\1m\332\361\232\25\274\344\2%\305\347" \
+ "\336\367\374\214\376\377\374\3\236\347\366\0\276\345J\321\355\211\376" \
+ "\377\374\1\311\316\321\223]oz\1\215\234\243\257\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374" \
+ "\1\214\233\242\223]oz\1\326\333\335\211\376\377\374\1,\311\352\224\25" \
+ "\274\344\1\312\357\370\223\376\377\374\1n\333\362\232\25\274\344\2%\305" \
+ "\347\336\367\374\214\376\377\374\5\236\347\366\0\276\345\25\274\344\0" \
+ "\276\345\367\375\377\210\376\377\374\2\356\363\366^p{\222]oz\1o\202\215" \
+ "\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\257\376\377\374\1o\202\215\222]oz\2as~\366\373\376\210\376" \
+ "\377\374\2\357\374\375\0\276\345\223\25\274\344\1J\321\355\223\376\377" \
+ "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+ "\2\236\347\366\0\276\345\203\25\274\344\1\274\355\373\211\376\377\374" \
+ "\1u\210\224\222]oz\2^p{\370\372\367\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\2\373\375" \
+ "\372_q|\222]oz\1u\210\224\211\376\377\374\1\261\354\367\224\25\274\344" \
+ "\1\312\357\370\222\376\377\374\1n\333\362\232\25\274\344\2%\305\347\336" \
+ "\367\374\214\376\377\374\2\236\347\366\0\276\345\204\25\274\344\1\204" \
+ "\335\361\211\376\377\374\1\230\240\250\223]oz\1\342\347\352\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\351\356\360\223]oz\1\225\235\245\211\376\377\374\1" \
+ "n\333\362\223\25\274\344\1,\311\352\222\376\377\374\1n\333\362\232\25" \
+ "\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345" \
+ "\205\25\274\344\1B\314\347\211\376\377\374\1\257\267\277\223]oz\1\317" \
+ "\324\327\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\256\376\377\374\1\326\333\335\223]oz\1\253\263\273" \
+ "\211\376\377\374\1B\314\347\223\25\274\344\1\211\342\365\221\376\377" \
+ "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+ "\2\236\347\366\0\276\345\206\25\274\344\1\0\302\351\211\376\377\374\1" \
+ "\307\315\317\223]oz\1\276\303\305\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\306\314" \
+ "\316\223]oz\1\305\312\315\211\376\377\374\1#\304\346\223\25\274\344\1" \
+ "\337\370\375\220\376\377\374\1w\333\356\232\25\274\344\2%\305\347\336" \
+ "\367\374\214\376\377\374\2\236\347\366\0\276\345\210\25\274\344\1\356" \
+ "\373\374\210\376\377\374\1\337\344\346\223]oz\1\253\263\273\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\274\301\303\223]oz\1\333\340\343\210\376\377\374\2" \
+ "\367\375\377\0\276\345\222\25\274\344\1(\307\350\220\376\377\374\1\231" \
+ "\342\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236" \
+ "\347\366\0\276\345\211\25\274\344\1\302\357\367\210\376\377\374\2\364" \
+ "\371\374^p{\222]oz\1\236\246\256\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\257\267" \
+ "\277\223]oz\1\353\360\363\210\376\377\374\1\316\363\374\223\25\274\344" \
+ "\1\\\326\355\217\376\377\374\2\320\365\376\31\275\345\231\25\274\344" \
+ "\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\212\25" \
+ "\274\344\1\237\350\367\211\376\377\374\1gy\204\222]oz\1\216\236\244\256" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\256\376\377\374\1\242\252\262\223]oz\1\366\370\364\210\376\377" \
+ "\374\1\262\355\370\223\25\274\344\1\220\343\361\217\376\377\374\1J\321" \
+ "\355\231\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347" \
+ "\366\0\276\345\213\25\274\344\1\211\342\365\211\376\377\374\1m\200\213" \
+ "\222]oz\1\204\223\231\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\226\246\254\223]o" \
+ "z\211\376\377\374\1\237\350\367\223\25\274\344\1\262\355\370\216\376" \
+ "\377\374\2\350\371\377\0\276\345\230\25\274\344\2%\305\347\336\367\374" \
+ "\214\376\377\374\2\236\347\366\0\276\345\214\25\274\344\1n\333\362\211" \
+ "\376\377\374\1u\210\224\222]oz\1y\214\230\256\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+ "\1\231\241\251\222]oz\1cu\200\211\376\377\374\1\233\345\364\223\25\274" \
+ "\344\1\316\363\374\216\376\377\374\1\235\346\365\230\25\274\344\2%\305" \
+ "\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\215\25\274\344" \
+ "\1k\327\357\211\376\377\374\1\200\217\225\222]oz\1u\210\224\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\222\241\247\222]oz\1j}\210\211\376\377\374\1\220\343" \
+ "\361\223\25\274\344\1\336\367\374\216\376\377\374\1w\333\356\227\25\274" \
+ "\344\2#\304\346\336\367\374\214\376\377\374\2\236\347\366\0\276\345\216" \
+ "\25\274\344\1M\323\357\211\376\377\374\1\210\227\235\222]oz\1s\206\221" \
+ "\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\256\376\377\374\1\211\230\236\222]oz\1n\201\214\211\376" \
+ "\377\374\1\206\340\363\223\25\274\344\1\350\371\377\216\376\377\374\1" \
+ "i\326\356\226\25\274\344\2#\304\346\336\367\374\214\376\377\374\2\236" \
+ "\347\366\0\276\345\217\25\274\344\1M\323\357\211\376\377\374\1\215\234" \
+ "\243\222]oz\1m\200\213\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\222\241\247\222]o" \
+ "z\1l\177\212\211\376\377\374\1\207\341\364\223\25\274\344\1\336\367\374" \
+ "\216\376\377\374\1n\333\362\225\25\274\344\2#\304\346\336\367\374\214" \
+ "\376\377\374\2\235\346\365\0\276\345\220\25\274\344\1M\323\357\211\376" \
+ "\377\374\1\211\230\236\222]oz\1s\206\221\256\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+ "\1\231\241\251\222]oz\1ew\202\211\376\377\374\1\231\342\362\223\25\274" \
+ "\344\1\320\365\376\216\376\377\374\1\221\344\362\224\25\274\344\2#\304" \
+ "\346\336\367\374\214\376\377\374\2\235\346\365\0\276\345\221\25\274\344" \
+ "\1i\326\356\211\376\377\374\1\202\221\227\222]oz\1u\210\224\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\242\252\262\222]oz\1^p{\211\376\377\374\1\237\350" \
+ "\367\223\25\274\344\1\301\356\366\216\376\377\374\1\333\364\371\223\25" \
+ "\274\344\2#\304\346\336\367\374\214\376\377\374\2\356\373\374\0\276\345" \
+ "\222\25\274\344\1n\333\362\211\376\377\374\1w\212\226\222]oz\1\202\221" \
+ "\227\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\256\376\377\374\1\246\256\266\223]oz\1\370\372\367\210" \
+ "\376\377\374\1\260\353\366\223\25\274\344\1\233\345\364\217\376\377\374" \
+ "\1,\311\352\221\25\274\344\2#\304\346\336\367\374\215\376\377\374\1\312" \
+ "\357\370\223\25\274\344\1\204\335\361\211\376\377\374\1o\202\215\222" \
+ "]oz\1\205\224\232\256\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\256\376\377\374\1\252\262\272\223]oz\1\355" \
+ "\362\365\210\376\377\374\1\314\361\372\223\25\274\344\1m\332\361\217" \
+ "\376\377\374\1\273\354\371\220\25\274\344\2#\304\346\336\367\374\216" \
+ "\376\377\374\1\233\345\364\223\25\274\344\1\236\347\366\211\376\377\374" \
+ "\1i{\206\222]oz\1\211\230\236\256\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\266\277\307" \
+ "\223]oz\1\340\345\350\210\376\377\374\1\356\373\374\223\25\274\344\1" \
+ ",\311\352\220\376\377\374\1i\326\356\216\25\274\344\2#\304\346\336\367" \
+ "\374\217\376\377\374\1\\\326\355\223\25\274\344\1\274\355\373\210\376" \
+ "\377\374\2\372\374\371_q|\222]oz\1\226\246\254\256\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377" \
+ "\374\1\307\315\317\223]oz\1\313\320\322\211\376\377\374\1\0\302\351\222" \
+ "\25\274\344\2\0\276\345\357\374\375\217\376\377\374\2\370\376\377G\317" \
+ "\353\214\25\274\344\2(\307\350\336\367\374\220\376\377\374\1%\305\347" \
+ "\223\25\274\344\1\336\367\374\210\376\377\374\1\343\350\353\223]oz\1" \
+ "\254\264\274\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\256\376\377\374\1\327\334\337\223]oz\1\257\267" \
+ "\277\211\376\377\374\1B\314\347\223\25\274\344\1\237\350\367\220\376" \
+ "\377\374\3\370\376\377n\333\362\31\275\345\211\25\274\344\2J\321\355" \
+ "\356\373\374\220\376\377\374\1\315\362\373\223\25\274\344\1\0\301\350" \
+ "\211\376\377\374\1\316\323\326\223]oz\1\276\303\305\256\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376" \
+ "\377\374\1\346\354\356\223]oz\1\225\245\253\211\376\377\374\1k\327\357" \
+ "\223\25\274\344\1G\317\353\222\376\377\374\3\320\365\376Z\325\354\0\301" \
+ "\350\204\25\274\344\3\0\276\345G\317\353\274\355\373\222\376\377\374" \
+ "\1w\333\356\223\25\274\344\1""3\314\355\211\376\377\374\1\264\274\305" \
+ "\223]oz\1\315\322\325\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\366\373\376\223]o" \
+ "z\1z\215\231\211\376\377\374\1\237\350\367\223\25\274\344\2\31\275\345" \
+ "\335\366\373\223\376\377\374\2\370\376\377\316\363\374\202\261\354\367" \
+ "\2\313\360\371\366\373\376\223\376\377\374\2\370\376\377\0\302\351\223" \
+ "\25\274\344\1n\333\362\211\376\377\374\1\230\250\256\223]oz\1\334\342" \
+ "\344\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\257\376\377\374\1m\200\213\222]oz\1ew\202\211\376\377" \
+ "\374\1\347\370\376\224\25\274\344\1m\332\361\254\376\377\374\1\233\345" \
+ "\364\224\25\274\344\1\261\354\367\211\376\377\374\1}\220\233\223]oz\1" \
+ "\366\370\364\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\257\376\377\374\1\211\230\236\223]oz\1\335\343" \
+ "\345\211\376\377\374\1%\305\347\223\25\274\344\2\0\276\345\336\367\374" \
+ "\252\376\377\374\2\367\375\377#\304\346\223\25\274\344\2\31\275\345\357" \
+ "\374\375\210\376\377\374\2\370\372\367as~\222]oz\1m\200\213\257\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\257\376\377\374\1\251\261\271\223]oz\1\264\274\305\211\376\377\374\1" \
+ "k\327\357\224\25\274\344\1L\322\356\252\376\377\374\1\206\340\363\224" \
+ "\25\274\344\1""3\314\355\211\376\377\374\1\322\330\332\223]oz\1\211\230" \
+ "\236\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\257\376\377\374\1\305\312\315\223]oz\1\211\230\236\211" \
+ "\376\377\374\1\301\356\366\225\25\274\344\1\262\355\370\250\376\377\374" \
+ "\2\334\365\372\0\276\345\224\25\274\344\1\220\343\361\211\376\377\374" \
+ "\1\252\262\272\223]oz\1\251\261\271\257\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\337\344" \
+ "\346\223]oz\2ew\202\373\375\372\210\376\377\374\2\370\376\377#\304\346" \
+ "\224\25\274\344\2\0\302\351\347\370\376\246\376\377\374\2\367\375\377" \
+ ",\311\352\224\25\274\344\2\0\276\345\337\370\375\211\376\377\374\1\177" \
+ "\216\224\223]oz\1\305\312\315\257\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\2\373\375\372" \
+ "dv\201\223]oz\1\331\336\341\211\376\377\374\1n\333\362\225\25\274\344" \
+ "\2B\314\347\370\376\377\245\376\377\374\1i\326\356\225\25\274\344\1B" \
+ "\314\347\211\376\377\374\2\362\367\371_q|\223]oz\1\346\354\356\257\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\260\376\377\374\1\210\227\235\223]oz\1\246\256\266\211\376\377\374" \
+ "\1\316\363\374\226\25\274\344\2M\323\357\370\376\377\243\376\377\374" \
+ "\1\206\340\363\226\25\274\344\1\256\350\364\211\376\377\374\1\301\306" \
+ "\311\223]oz\1k~\211\260\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\260\376\377\374\1\257\267\277\223]oz\2i" \
+ "{\206\373\375\372\211\376\377\374\1G\317\353\226\25\274\344\2\\\326\355" \
+ "\370\376\377\241\376\377\374\1\220\343\361\226\25\274\344\2\0\304\352" \
+ "\370\376\377\211\376\377\374\1\204\223\231\223]oz\1\230\240\250\260\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\260\376\377\374\1\331\336\341\224]oz\1\317\324\327\211\376\377\374" \
+ "\1\301\356\366\227\25\274\344\2J\321\355\367\375\377\237\376\377\374" \
+ "\1w\333\356\227\25\274\344\1\206\340\363\211\376\377\374\2\351\356\360" \
+ "^p{\223]oz\1\277\304\306\260\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\260\376\377\374\2\372\374\371cu" \
+ "\200\223]oz\1\222\241\247\212\376\377\374\1/\312\353\227\25\274\344\2" \
+ ",\311\352\334\365\372\234\376\377\374\2\356\373\374I\320\354\227\25\274" \
+ "\344\2\0\301\350\366\373\376\211\376\377\374\1\261\271\302\224]oz\1\343" \
+ "\350\353\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\261\376\377\374\1\216\236\244\223]oz\2cu\200\362" \
+ "\367\371\211\376\377\374\1\261\354\367\230\25\274\344\3\0\276\345\233" \
+ "\345\364\370\376\377\231\376\377\374\2\262\355\370\0\304\352\230\25\274" \
+ "\344\1\206\340\363\212\376\377\374\1s\206\221\223]oz\1q\204\217\261\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\261\376\377\374\1\305\312\315\224]oz\1\257\267\277\212\376\377\374" \
+ "\1B\314\347\231\25\274\344\2""1\313\354\303\361\370\226\376\377\374\2" \
+ "\334\365\372J\321\355\231\25\274\344\2#\304\346\366\373\376\211\376\377" \
+ "\374\1\315\322\325\224]oz\1\251\261\271\261\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\261\376\377\374\2\362" \
+ "\367\371as~\223]oz\2hz\205\370\372\367\211\376\377\374\2\334\365\372" \
+ "\0\276\345\232\25\274\344\3B\314\347\262\355\370\370\376\377\221\376" \
+ "\377\374\3\313\360\371L\322\356\0\276\345\232\25\274\344\1\256\350\364" \
+ "\212\376\377\374\1z\215\231\224]oz\1\333\340\343\261\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376" \
+ "\377\374\1\207\226\234\224]oz\1\270\300\311\212\376\377\374\1w\333\356" \
+ "\234\25\274\344\4\0\304\352m\332\361\273\354\371\366\373\376\212\376" \
+ "\377\374\4\370\376\377\302\357\367y\336\360(\307\350\234\25\274\344\1" \
+ "B\314\347\212\376\377\374\1\324\331\333\224]oz\1k~\211\262\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262" \
+ "\376\377\374\1\301\306\311\224]oz\2k~\211\372\374\371\211\376\377\374" \
+ "\2\366\373\376(\307\350\236\25\274\344\5\31\275\345,\311\352M\323\357" \
+ "y\336\360\211\342\365\202\233\345\364\5\220\343\361\204\335\361Z\325" \
+ "\3541\313\354\0\276\345\236\25\274\344\2\0\301\350\336\367\374\212\376" \
+ "\377\374\1\205\224\232\224]oz\1\246\256\266\262\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376\377\374" \
+ "\2\367\371\366dv\201\224]oz\1\274\301\303\212\376\377\374\2\315\362\373" \
+ "\0\276\345\307\25\274\344\1\236\347\366\212\376\377\374\1\325\332\334" \
+ "\225]oz\1\341\346\351\262\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\263\376\377\374\1\236\246\256\224]o" \
+ "z\2fx\203\356\363\366\212\376\377\374\1\221\344\362\306\25\274\344\1" \
+ "M\323\357\212\376\377\374\2\372\374\371t\207\222\224]oz\1\177\216\224" \
+ "\263\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\263\376\377\374\1\333\340\343\225]oz\1\226\246\254\213\376" \
+ "\377\374\1L\322\356\304\25\274\344\2,\311\352\366\373\376\212\376\377" \
+ "\374\1\265\276\306\225]oz\1\302\307\312\263\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1u\210" \
+ "\224\224]oz\2^p{\331\336\341\212\376\377\374\2\366\373\376/\312\353\302" \
+ "\25\274\344\2\0\302\351\336\367\374\212\376\377\374\2\353\360\363dv\201" \
+ "\224]oz\2dv\201\364\371\374\263\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\264\376\377\374\1\302\307\312\225" \
+ "]oz\2w\212\226\372\374\371\212\376\377\374\2\350\371\377%\305\347\300" \
+ "\25\274\344\2\0\301\350\314\361\372\213\376\377\374\1\227\237\247\225" \
+ "]oz\1\246\256\266\264\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\264\376\377\374\2\372\374\371l\177\212\225" \
+ "]oz\1\252\262\272\213\376\377\374\2\337\370\375\0\304\352\276\25\274" \
+ "\344\2\0\276\345\274\355\373\213\376\377\374\1\305\312\315\225]oz\2a" \
+ "s~\353\360\363\264\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\265\376\377\374\1\270\300\311\225]oz\2^p{\322" \
+ "\330\332\213\376\377\374\2\332\363\370#\304\346\274\25\274\344\2\0\276" \
+ "\345\273\354\371\213\376\377\374\2\343\350\353dv\201\225]oz\1\236\246" \
+ "\256\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\265\376\377\374\2\365\372\375hz\205\225]oz\2i{\206\354" \
+ "\361\364\213\376\377\374\2\337\370\375*\310\351\272\25\274\344\2\0\302" \
+ "\351\314\361\372\213\376\377\374\2\371\373\370x\213\227\225]oz\2_q|\346" \
+ "\354\356\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\266\376\377\374\1\261\271\302\226]oz\2\205\224\232" \
+ "\373\375\372\213\376\377\374\2\356\373\374B\314\347\270\25\274\344\2" \
+ "%\305\347\335\366\373\214\376\377\374\1\242\252\262\226]oz\1\231\241" \
+ "\251\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\266\376\377\374\2\370\372\367m\200\213\226]oz\1\242" \
+ "\252\262\214\376\377\374\2\367\375\377i\326\356\266\25\274\344\2B\314" \
+ "\347\350\371\377\214\376\377\374\1\277\304\306\226]oz\2bt\177\351\356" \
+ "\360\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\267\376\377\374\1\305\312\315\227]oz\1\261\271\302\215" \
+ "\376\377\374\2\250\347\371\0\301\350\262\25\274\344\3\31\275\345\206" \
+ "\340\363\370\376\377\214\376\377\374\2\316\323\326_q|\226]oz\1\251\261" \
+ "\271\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\270\376\377\374\1y\214\230\226]oz\2^p{\301\306\311\215" \
+ "\376\377\374\2\335\366\373/\312\353\260\25\274\344\2#\304\346\312\357" \
+ "\370\215\376\377\374\2\330\335\340cu\200\226]oz\2hz\205\366\370\364\267" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\270\376\377\374\1\332\337\342\230\222\241\247\1\353\360\363" \
+ "\215\376\377\374\3\370\376\377\231\342\362\0\301\350\254\25\274\344\3" \
+ "\0\276\345w\333\356\366\373\376\215\376\377\374\2\365\372\375\236\246" \
+ "\256\227\222\241\247\1\307\315\317\270\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\341\376\377\374\3\356\373" \
+ "\374i\326\356\0\276\345\251\25\274\344\2J\321\355\335\366\373\341\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\343\376\377\374\3\316\363\374Z\325\354\31\275\345\245\25\274\344" \
+ "\2G\317\353\302\357\367\343\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\345\376\377\374\3\336\367\374m\332\361" \
+ "\0\276\345\240\25\274\344\3\31\275\345M\323\357\316\363\374\345\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\347\376\377\374\4\366\373\376\237\350\367I\320\354\31\275\345\232\25" \
+ "\274\344\4\0\276\345B\314\347\231\342\362\356\373\374\347\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\352" \
+ "\376\377\374\4\356\373\374\235\346\365Z\325\354#\304\346\224\25\274\344" \
+ "\4\0\302\351L\322\356\221\344\362\336\367\374\352\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\356\376\377" \
+ "\374\6\336\367\374\237\350\367w\333\356M\323\357,\311\352\0\276\345\210" \
+ "\25\274\344\6\0\276\345*\310\351J\321\355n\333\362\233\345\364\320\365" \
+ "\376\356\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\364\376\377\374\10\367\375\377\356\373\374\335\366\373" \
+ "\316\363\374\315\362\373\335\366\373\350\371\377\366\373\376\364\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\375\376\377\374\202" \
+ "\370\376\377\250\376\377\374\1\367\375\377\217\376\377\374\1\367\375" \
+ "\377\237\376\377\374\1\367\375\377\230\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374\4\237\350" \
+ "\367\0\276\345\31\275\345\203\334\360\245\376\377\374\5\316\363\374#" \
+ "\304\346\25\274\344G\317\353\367\375\377\213\376\377\374\5\335\366\373" \
+ "(\307\350\25\274\344B\314\347\366\373\376\233\376\377\374\5\356\373\374" \
+ "/\312\353\25\274\344*\310\351\337\370\375\226\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374" \
+ "\1#\304\346\203\25\274\344\1\357\374\375\244\376\377\374\1i\326\356\203" \
+ "\25\274\344\1\260\353\366\213\376\377\374\1n\333\362\203\25\274\344\1" \
+ "\235\346\365\233\376\377\374\1\231\342\362\203\25\274\344\1y\336\360" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+ "\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340" \
+ "\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\374\376\377\374\1\0\301\350" \
+ "\203\25\274\344\1\336\367\374\244\376\377\374\1I\320\354\203\25\274\344" \
+ "\1\231\342\362\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363" \
+ "\233\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377" \
+ "\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357" \
+ "\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274" \
+ "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1" \
+ "\336\367\374\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362" \
+ "\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377" \
+ "\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377" \
+ "\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377\374\1I\320" \
+ "\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+ "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\232\376\377\374\7\311\316\321\211\230\236j}\210cu\200" \
+ "n\201\214\233\243\253\333\340\343\206\376\377\374\2\236\246\256dv\201" \
+ "\205]oz\4_q|k~\211\222\241\247\337\344\346\210\376\377\374\7\322\330" \
+ "\332\222\241\247l\177\212cu\200k~\211\222\241\247\322\330\332\206\376" \
+ "\377\374\2\257\267\277gy\204\205]oz\4^p{i{\206\211\230\236\325\332\334" \
+ "\210\376\377\374\10\313\360\371\\\326\355%\305\347\0\276\345\0\302\351" \
+ "G\317\353\237\350\367\370\376\377\205\376\377\374\2\235\346\365\0\304" \
+ "\352\212\25\274\344\4\0\276\345\0\304\352M\323\357\315\362\373\205\376" \
+ "\377\374\1\0\301\350\207\25\274\344\4\0\301\350B\314\347\233\345\364" \
+ "\370\376\377\207\376\377\374\7\302\357\367M\323\357#\304\346\0\276\345" \
+ "\0\304\352J\321\355\260\353\366\210\376\377\374\4\315\362\373M\323\357" \
+ "#\304\346\31\275\345\207\25\274\344\1\231\342\362\204\376\377\374\4\323" \
+ "\364\367\\\326\355%\305\347\0\276\345\207\25\274\344\1\206\340\363\205" \
+ "\376\377\374\10\334\365\372m\332\361(\307\350\0\276\345\0\302\351B\314" \
+ "\347\233\345\364\370\376\377\207\376\377\374\4\336\367\374m\332\361(" \
+ "\307\350\0\276\345\207\25\274\344\1k\327\357\226\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\230\376\377" \
+ "\374\2\356\363\366\202\221\227\206]oz\3^p{\247\257\267\373\375\372\203" \
+ "\376\377\374\1\327\334\337\212]oz\2_q|\303\310\313\205\376\377\374\2" \
+ "\364\371\374\222\241\247\207]oz\2\222\241\247\370\372\367\203\376\377" \
+ "\374\2\353\360\363^p{\212]oz\1\254\264\274\205\376\377\374\2\370\376" \
+ "\377m\332\361\207\25\274\344\2B\314\347\350\371\377\203\376\377\374\2" \
+ "\370\376\377\0\276\345\216\25\274\344\2\31\275\345\235\346\365\204\376" \
+ "\377\374\1\0\301\350\212\25\274\344\2B\314\347\357\374\375\204\376\377" \
+ "\374\2\367\375\377Z\325\354\207\25\274\344\2G\317\353\357\374\375\205" \
+ "\376\377\374\2\235\346\365\31\275\345\212\25\274\344\1\231\342\362\203" \
+ "\376\377\374\2\256\350\364\0\276\345\212\25\274\344\1\206\340\363\204" \
+ "\376\377\374\2\206\340\363\31\275\345\206\25\274\344\2*\310\351\335\366" \
+ "\373\205\376\377\374\2\302\357\367\0\301\350\212\25\274\344\1k\327\357" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\227\376\377\374\2\364\371\374u\210\224\211]oz\1\242\252" \
+ "\262\203\376\377\374\1\306\314\316\213]oz\2_q|\325\332\334\203\376\377" \
+ "\374\2\373\375\372\210\227\235\211]oz\2\211\230\236\373\375\372\202\376" \
+ "\377\374\1\330\335\340\214]oz\1\304\311\314\204\376\377\374\1i\326\356" \
+ "\211\25\274\344\2*\310\351\366\373\376\202\376\377\374\1\357\374\375" \
+ "\220\25\274\344\2\0\276\345\274\355\373\203\376\377\374\1\0\301\350\213" \
+ "\25\274\344\1M\323\357\204\376\377\374\1L\322\356\211\25\274\344\2""3" \
+ "\314\355\370\376\377\203\376\377\374\2\313\360\371\0\276\345\213\25\274" \
+ "\344\1\231\342\362\202\376\377\374\2\333\364\371\0\276\345\213\25\274" \
+ "\344\1\206\340\363\203\376\377\374\1\206\340\363\211\25\274\344\2\0\304" \
+ "\352\347\370\376\203\376\377\374\2\356\373\374\0\304\352\213\25\274\344" \
+ "\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\227\376\377\374\1\251\261\271\213]oz\1\322\330\332" \
+ "\202\376\377\374\1\306\314\316\214]oz\1\200\217\225\203\376\377\374\1" \
+ "\277\304\306\213]oz\1\277\304\306\202\376\377\374\1\330\335\340\214]" \
+ "oz\2j}\210\373\375\372\202\376\377\374\1\273\354\371\213\25\274\344\1" \
+ "n\333\362\202\376\377\374\1\357\374\375\221\25\274\344\1""1\313\354\203" \
+ "\376\377\374\1\0\301\350\214\25\274\344\1\332\363\370\202\376\377\374" \
+ "\1\237\350\367\213\25\274\344\1\206\340\363\203\376\377\374\1I\320\354" \
+ "\214\25\274\344\1\231\342\362\202\376\377\374\1M\323\357\214\25\274\344" \
+ "\1\206\340\363\202\376\377\374\2\320\365\376\31\275\345\212\25\274\344" \
+ "\1L\322\356\203\376\377\374\1\203\334\360\214\25\274\344\1k\327\357\226" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\226\376\377\374\2\370\372\367cu\200\203]oz\5s\206\221\317\324" \
+ "\327\343\350\353\276\303\305ew\202\203]oz\1\210\227\235\202\376\377\374" \
+ "\1\306\314\316\203]oz\1y\214\230\203\347\355\357\2\346\354\356\264\274" \
+ "\305\203]oz\2^p{\357\365\367\202\376\377\374\1p\203\216\203]oz\5k~\211" \
+ "\307\315\317\343\350\353\306\314\316k~\211\203]oz\1p\203\216\202\376" \
+ "\377\374\1\330\335\340\203]oz\1k~\211\204\347\355\357\2\304\311\314_" \
+ "q|\203]oz\1\334\342\344\202\376\377\374\1B\314\347\203\25\274\344\5\0" \
+ "\301\350\233\345\364\333\364\371\260\353\366(\307\350\203\25\274\344" \
+ "\4\0\276\345\367\375\377\376\377\374\357\374\375\204\25\274\344\203\335" \
+ "\366\373\204\25\274\344\3\302\357\367\335\366\373\206\340\363\204\25" \
+ "\274\344\1\356\373\374\202\376\377\374\1\0\301\350\203\25\274\344\1\302" \
+ "\357\367\203\335\366\373\2\302\357\367\0\304\352\203\25\274\344\1\207" \
+ "\341\364\202\376\377\374\1,\311\352\203\25\274\344\5\0\302\351\236\347" \
+ "\366\332\363\370\256\350\364#\304\346\203\25\274\344\5\0\302\351\370" \
+ "\376\377\376\377\374\370\376\377\0\276\345\203\25\274\344\1w\333\356" \
+ "\204\335\366\373\1B\314\347\203\25\274\344\1\231\342\362\202\376\377" \
+ "\374\1\0\276\345\203\25\274\344\2m\332\361\334\365\372\203\335\366\373" \
+ "\1I\320\354\203\25\274\344\1\206\340\363\202\376\377\374\1i\326\356\203" \
+ "\25\274\344\5\0\276\345\206\340\363\323\364\367\273\354\3711\313\354" \
+ "\204\25\274\344\1\335\366\373\202\376\377\374\1,\311\352\203\25\274\344" \
+ "\2L\322\356\332\363\370\203\335\366\373\1n\333\362\203\25\274\344\1k" \
+ "\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\226\376\377\374\1\324\331\333\203]oz\2cu\200\353" \
+ "\360\363\203\376\377\374\1\307\315\317\203]oz\4as~\372\374\371\376\377" \
+ "\374\306\314\316\203]oz\1\202\221\227\205\376\377\374\1hz\205\203]oz" \
+ "\3\341\346\351\376\377\374\347\355\357\203]oz\2^p{\335\343\345\203\376" \
+ "\377\374\1\333\340\343\204]oz\3\347\355\357\376\377\374\330\335\340\203" \
+ "]oz\1m\200\213\205\376\377\374\1~\215\223\203]oz\4\313\320\322\376\377" \
+ "\374\370\376\377\31\275\345\203\25\274\344\1\256\350\364\203\376\377" \
+ "\374\2\336\367\374\0\276\345\203\25\274\344\3\274\355\373\376\377\374" \
+ "\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367" \
+ "\374\202\376\377\374\1\0\301\350\203\25\274\344\1\323\364\367\202\376" \
+ "\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374\1n" \
+ "\333\362\203\25\274\344\3m\332\361\376\377\374\356\373\374\204\25\274" \
+ "\344\1\274\355\373\203\376\377\374\2\323\364\367\0\276\345\203\25\274" \
+ "\344\3\315\362\373\376\377\374\335\366\373\203\25\274\344\2\0\276\345" \
+ "\370\376\377\204\376\377\374\1I\320\354\203\25\274\344\3\231\342\362" \
+ "\376\377\374\366\373\376\204\25\274\344\1\366\373\376\204\376\377\374" \
+ "\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\1%\305\347\203" \
+ "\25\274\344\1\207\341\364\203\376\377\374\2\360\375\376\0\304\352\203" \
+ "\25\274\344\1\233\345\364\202\376\377\374\1\0\301\350\203\25\274\344" \
+ "\1\323\364\367\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\226\376\377\374\1\303\310\313\203]oz\1\204\223\231\204\376" \
+ "\377\374\2\370\372\367_q|\203]oz\3\354\361\364\376\377\374\306\314\316" \
+ "\203]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351" \
+ "\376\377\374\326\333\335\203]oz\1n\201\214\205\376\377\374\1l\177\212" \
+ "\203]oz\3\327\334\337\376\377\374\330\335\340\203]oz\1m\200\213\205\376" \
+ "\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\337\370\375\203" \
+ "\25\274\344\2\31\275\345\370\376\377\204\376\377\374\1""3\314\355\203" \
+ "\25\274\344\3\236\347\366\376\377\374\357\374\375\204\25\274\344\203" \
+ "\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346" \
+ "\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274" \
+ "\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357" \
+ "\376\377\374\315\362\373\203\25\274\344\1\0\301\350\205\376\377\374\1" \
+ "*\310\351\203\25\274\344\3\261\354\367\376\377\374\316\363\374\203\25" \
+ "\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+ "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+ "\357\203\25\274\344\1\206\340\363\202\376\377\374\1\31\275\345\203\25" \
+ "\274\344\1\335\366\373\204\376\377\374\1M\323\357\203\25\274\344\1\203" \
+ "\334\360\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204" \
+ "\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226" \
+ "\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202" \
+ "\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205" \
+ "\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327" \
+ "\203]oz\1as~\205o\202\215\1as~\203]oz\3\317\324\327\376\377\374\330\335" \
+ "\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306\314" \
+ "\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\205%\305\347" \
+ "\1\0\276\345\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204" \
+ "\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377" \
+ "\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301" \
+ "\350\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274" \
+ "\344\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\31\275\345\205" \
+ "%\305\347\1\0\276\345\203\25\274\344\3\237\350\367\376\377\374\316\363" \
+ "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274" \
+ "\344\1#\304\346\204%\305\347\1\0\301\350\203\25\274\344\1w\333\356\202" \
+ "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+ "\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376\377\374" \
+ "\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203]oz\3" \
+ "\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376\377" \
+ "\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215]oz\3" \
+ "\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374" \
+ "\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376\377" \
+ "\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274" \
+ "\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+ "\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376\377\374" \
+ "\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363\374\203" \
+ "\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+ "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+ "\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274\344\1w\333" \
+ "\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376" \
+ "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376" \
+ "\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203" \
+ "]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376" \
+ "\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215" \
+ "]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377" \
+ "\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25" \
+ "\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376" \
+ "\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203" \
+ "\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344" \
+ "\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376" \
+ "\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363" \
+ "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274" \
+ "\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+ "\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\226\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374" \
+ "\1ew\202\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221" \
+ "\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317" \
+ "\324\327\215]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213" \
+ "\205\376\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367" \
+ "\374\215\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274" \
+ "\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#" \
+ "\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203" \
+ "\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3" \
+ "k\327\357\376\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377" \
+ "\374\316\363\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354" \
+ "\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344" \
+ "\205\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377" \
+ "\374\215\25\274\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274" \
+ "\344\1\336\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+ "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\226\376\377\374\1\300\305\310\203]oz\1\211\230\236\205" \
+ "\376\377\374\1bt\177\203]oz\3\352\357\362\376\377\374\306\314\316\203" \
+ "]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376" \
+ "\377\374\317\324\327\203]oz\1p\203\216\211\335\343\345\3\366\370\364" \
+ "\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+ "\227\203]oz\3\306\314\316\376\377\374\336\367\374\203\25\274\344\1\0" \
+ "\276\345\211\314\361\372\3\350\371\377\376\377\374\357\374\375\204\25" \
+ "\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374" \
+ "\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350" \
+ "\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344" \
+ "\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\0\302\351\211\314" \
+ "\361\372\3\356\373\374\376\377\374\316\363\374\203\25\274\344\1\0\301" \
+ "\350\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376\377" \
+ "\374\357\374\375\204\25\274\344\205\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\202\376\377\374\204\25\274\344\1\301\356\366\210\314" \
+ "\361\372\1\337\370\375\202\376\377\374\1\0\301\350\203\25\274\344\1\336" \
+ "\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\226\376\377\374\1\314\321\324\203]oz\2l\177\212\372\374\371" \
+ "\203\376\377\374\1\333\340\343\203]oz\4^p{\366\373\376\376\377\374\306" \
+ "\314\316\203]oz\1\202\221\227\205\376\377\374\1k~\211\203]oz\3\341\346" \
+ "\351\376\377\374\320\326\330\203]oz\1t\207\222\213\376\377\374\1\330" \
+ "\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306" \
+ "\314\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\213\376\377" \
+ "\374\1\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336" \
+ "\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202" \
+ "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+ "\1n\333\362\203\25\274\344\3k\327\357\376\377\374\303\361\370\203\25" \
+ "\274\344\1\0\304\352\213\376\377\374\1\332\363\370\203\25\274\344\1\0" \
+ "\276\345\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376" \
+ "\377\374\357\374\375\204\25\274\344\1\370\376\377\204\376\377\374\1M" \
+ "\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274\344" \
+ "\1\356\373\374\213\376\377\374\1\0\301\350\203\25\274\344\1\335\366\373" \
+ "\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\226\376\377\374\2\353\360\363^p{\203]oz\5\236\246\256\366\373\376\376" \
+ "\377\374\347\355\357w\212\226\203]oz\1~\215\223\202\376\377\374\1\306" \
+ "\314\316\203]oz\1\202\221\227\204\376\377\374\2\335\343\345^p{\203]o" \
+ "z\3\351\356\360\376\377\374\335\343\345\203]oz\2bt\177\343\350\353\212" \
+ "\376\377\374\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+ "\227\203]oz\3\306\314\316\376\377\374\356\373\374\204\25\274\344\1\274" \
+ "\355\373\212\376\377\374\1\357\374\375\204\25\274\344\203\376\377\374" \
+ "\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344" \
+ "\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+ "\203\376\377\374\2\367\375\377/\312\353\203\25\274\344\3\204\335\361" \
+ "\376\377\374\334\365\372\203\25\274\344\2\0\276\345\314\361\372\212\376" \
+ "\377\374\1\356\373\374\204\25\274\344\1\274\355\373\204\376\377\374\1" \
+ "I\320\354\203\25\274\344\4\231\342\362\376\377\374\370\376\377\0\276" \
+ "\345\203\25\274\344\1\257\351\365\204\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\202\376\377\374\1\0\301\350\203\25\274\344\1\233\345" \
+ "\364\213\376\377\374\1#\304\346\203\25\274\344\1\207\341\364\204\376" \
+ "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\227\376" \
+ "\377\374\1\211\230\236\204]oz\3cu\200p\203\216^p{\204]oz\1\277\304\306" \
+ "\202\376\377\374\1\306\314\316\203]oz\1dv\201\203~\215\223\2v\211\225" \
+ "as~\203]oz\1n\201\214\202\376\377\374\2\371\373\370dv\201\203]oz\2bt" \
+ "\177w\212\226\205~\215\223\2\203\222\230\304\311\314\202\376\377\374" \
+ "\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]o" \
+ "z\1\306\314\316\202\376\377\374\1(\307\350\203\25\274\344\2\0\276\345" \
+ "*\310\351\205,\311\352\2""1\313\354\207\341\364\202\376\377\374\1\357" \
+ "\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374" \
+ "\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377" \
+ "\374\1\0\301\350\203\25\274\344\1*\310\351\203,\311\352\1\0\302\351\204" \
+ "\25\274\344\4\274\355\373\376\377\374\370\376\377\0\302\351\203\25\274" \
+ "\344\2\31\275\345*\310\351\205,\311\352\2B\314\347\231\342\362\203\376" \
+ "\377\374\1%\305\347\203\25\274\344\2\0\276\345*\310\351\203,\311\352" \
+ "\1\0\301\350\203\25\274\344\1\231\342\362\202\376\377\374\1/\312\353" \
+ "\203\25\274\344\2\0\276\345*\310\351\203,\311\352\1\0\301\350\203\25" \
+ "\274\344\1\206\340\363\202\376\377\374\1G\317\353\204\25\274\344\1(\307" \
+ "\350\205,\311\352\3""1\313\354w\333\356\370\376\377\202\376\377\374\1" \
+ "M\323\357\204\25\274\344\1(\307\350\203,\311\352\1\0\304\352\203\25\274" \
+ "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\227\376\377\374\2\343\350\353ew\202\211]oz\2" \
+ "\177\216\224\373\375\372\202\376\377\374\1\306\314\316\214]oz\1\270\300" \
+ "\311\203\376\377\374\1\253\263\273\213]oz\4_q|\352\357\362\376\377\374" \
+ "\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\1" \
+ "\306\314\316\202\376\377\374\1\233\345\364\214\25\274\344\3\301\356\366" \
+ "\376\377\374\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344" \
+ "\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374" \
+ "\202\376\377\374\1\0\301\350\213\25\274\344\2,\311\352\370\376\377\202" \
+ "\376\377\374\1\206\340\363\214\25\274\344\1\316\363\374\202\376\377\374" \
+ "\1\233\345\364\214\25\274\344\1\231\342\362\202\376\377\374\1\250\347" \
+ "\371\214\25\274\344\1\206\340\363\202\376\377\374\1\273\354\371\214\25" \
+ "\274\344\1\236\347\366\202\376\377\374\2\313\360\371\0\276\345\213\25" \
+ "\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\230\376\377\374\2\325\332\334gy\204\207" \
+ "]oz\2x\213\227\354\361\364\203\376\377\374\1\306\314\316\213]oz\1\225" \
+ "\235\245\204\376\377\374\2\372\374\371~\221\235\213]oz\3\333\340\343" \
+ "\376\377\374\342\347\352\203]oz\1t\207\222\205\376\377\374\1\211\230" \
+ "\236\203]oz\1\317\324\327\203\376\377\374\1M\323\357\213\25\274\344\4" \
+ "\237\350\367\376\377\374\367\375\377\0\276\345\202\25\274\344\1\0\276" \
+ "\345\203\376\377\374\1\0\301\350\203\25\274\344\1\357\374\375\202\376" \
+ "\377\374\1(\307\350\203\25\274\344\1\335\366\373\202\376\377\374\1\0" \
+ "\302\351\212\25\274\344\2\0\301\350\333\364\371\203\376\377\374\2\370" \
+ "\376\377G\317\353\213\25\274\344\1\273\354\371\203\376\377\374\1M\323" \
+ "\357\213\25\274\344\1\237\350\367\203\376\377\374\1k\327\357\213\25\274" \
+ "\344\1\231\342\362\203\376\377\374\1w\333\356\213\25\274\344\1\206\340" \
+ "\363\203\376\377\374\1\207\341\364\213\25\274\344\1n\333\362\226\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\231\376\377\374\3\351\356\360\231\241\251bt\177\203]oz\3k~\211\257" \
+ "\267\277\370\372\367\204\376\377\374\1\306\314\316\211]oz\3gy\204\261" \
+ "\271\302\373\375\372\205\376\377\374\3\371\373\370\252\262\272dv\201" \
+ "\210]oz\2x\213\227\372\374\371\202\376\377\374\4}\220\233]oz^p{\266\277" \
+ "\307\205\376\377\374\5\311\316\321_q|]ozq\204\217\370\372\367\203\376" \
+ "\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344\2\0\304\352" \
+ "\356\373\374\202\376\377\374\1M\323\357\202\25\274\344\1m\332\361\203" \
+ "\376\377\374\1n\333\362\202\25\274\344\1L\322\356\203\376\377\374\1\206" \
+ "\340\363\202\25\274\344\2B\314\347\370\376\377\202\376\377\374\1w\333" \
+ "\356\210\25\274\344\3\0\276\345L\322\356\336\367\374\205\376\377\374" \
+ "\3\370\376\377\204\335\361\0\301\350\210\25\274\344\2(\307\350\366\373" \
+ "\376\203\376\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344" \
+ "\2#\304\346\356\373\374\204\376\377\374\2\233\345\364\0\302\351\210\25" \
+ "\274\344\2\0\302\351\337\370\375\204\376\377\374\2\237\350\367#\304\346" \
+ "\210\25\274\344\2\0\301\350\333\364\371\204\376\377\374\2\257\351\365" \
+ "%\305\347\210\25\274\344\2\0\276\345\314\361\372\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\233\376" \
+ "\377\374\4\365\372\375\335\343\345\325\332\334\343\350\353\207\376\377" \
+ "\374\1\306\314\316\203]oz\1u\210\224\204\324\331\333\2\335\343\345\373" \
+ "\375\372\211\376\377\374\2\372\374\371\334\342\344\206\324\331\333\2" \
+ "\331\336\341\372\374\371\203\376\377\374\3\373\375\372\332\337\342\343" \
+ "\350\353\207\376\377\374\3\351\356\360\330\335\340\366\373\376\206\376" \
+ "\377\374\2\370\376\377\316\363\374\206\273\354\371\2\302\357\367\366" \
+ "\373\376\204\376\377\374\2\314\361\372\315\362\373\205\376\377\374\2" \
+ "\316\363\374\313\360\371\205\376\377\374\3\332\363\370\312\357\370\370" \
+ "\376\377\204\376\377\374\1\316\363\374\206\273\354\371\2\302\357\367" \
+ "\356\373\374\211\376\377\374\2\370\376\377\314\361\372\206\273\354\371" \
+ "\2\302\357\367\367\375\377\206\376\377\374\2\370\376\377\316\363\374" \
+ "\206\273\354\371\2\302\357\367\366\373\376\206\376\377\374\2\370\376" \
+ "\377\316\363\374\206\273\354\371\2\301\356\366\357\374\375\207\376\377" \
+ "\374\1\332\363\370\206\273\354\371\2\301\356\366\356\373\374\207\376" \
+ "\377\374\2\333\364\371\274\355\373\205\273\354\371\2\274\355\373\350" \
+ "\371\377\227\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202\221\227" \
+ "\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202" \
+ "\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203" \
+ "]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314" \
+ "\316\203]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374" \
+ "\1\315\322\325\203]oz\1\211\230\236\377\376\377\374\306\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376" \
+ "\377\374\2\360\366\370i{\206\202]oz\1\302\307\312\377\376\377\374\306" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\247\376\377\374\3\357\365\367\313\320\322\335\343\345\377\376" \
+ "\377\374\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+ "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+ "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+ "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\232\377\377\377")
+
+
diff --git a/poky/meta/recipes-core/psplash/psplash_git.bb b/poky/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 000000000..aab2c0360
--- /dev/null
+++ b/poky/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,122 @@
+SUMMARY = "Userspace framebuffer boot logo based on usplash"
+DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information."
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6"
+
+SRCREV = "2015f7073e98dd9562db0936a254af5ef56356cf"
+PV = "0.1+git${SRCPV}"
+PR = "r15"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://psplash-init \
+ ${SPLASH_IMAGES}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
+
+python __anonymous() {
+ oldpkgs = d.getVar("PACKAGES").split()
+ splashfiles = d.getVar('SPLASH_IMAGES').split()
+ pkgs = []
+ localpaths = []
+ haspng = False
+ for uri in splashfiles:
+ fetcher = bb.fetch2.Fetch([uri], d)
+ flocal = os.path.basename(fetcher.localpath(uri))
+ fbase = os.path.splitext(flocal)[0]
+ outsuffix = fetcher.ud[uri].parm.get("outsuffix")
+ if not outsuffix:
+ if fbase.startswith("psplash-"):
+ outsuffix = fbase[8:]
+ else:
+ outsuffix = fbase
+ if outsuffix.endswith('-img'):
+ outsuffix = outsuffix[:-4]
+ outname = "psplash-%s" % outsuffix
+ if outname == '' or outname in oldpkgs:
+ bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
+ else:
+ pkgs.append(outname)
+ if flocal.endswith(".png"):
+ haspng = True
+ localpaths.append(flocal)
+
+ # Set these so that we have less work to do in do_compile and do_install_append
+ d.setVar("SPLASH_INSTALL", " ".join(pkgs))
+ d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths))
+
+ if haspng:
+ d.appendVar("DEPENDS", " gdk-pixbuf-native")
+
+ d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
+ mlprefix = d.getVar('MLPREFIX') or ''
+ pn = d.getVar('PN') or ''
+ for p in pkgs:
+ ep = '%s%s' % (mlprefix, p)
+ epsplash = '%s%s' % (mlprefix, 'psplash')
+ d.setVar("FILES_%s" % ep, "${bindir}/%s" % p)
+ d.setVar("ALTERNATIVE_%s" % ep, 'psplash')
+ d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p)
+ d.appendVar("RDEPENDS_%s" % ep, " %s" % pn)
+ if p == "psplash-default":
+ d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep)
+}
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash"
+
+python do_compile () {
+ import shutil
+
+ # Build a separate executable for each splash image
+ workdir = d.getVar('WORKDIR')
+ convertscript = "%s/make-image-header.sh" % d.getVar('S')
+ destfile = "%s/psplash-poky-img.h" % d.getVar('S')
+ localfiles = d.getVar('SPLASH_LOCALPATHS').split()
+ outputfiles = d.getVar('SPLASH_INSTALL').split()
+ for localfile, outputfile in zip(localfiles, outputfiles):
+ if localfile.endswith(".png"):
+ outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
+ print(outp[1])
+ fbase = os.path.splitext(localfile)[0]
+ shutil.copyfile("%s-img.h" % fbase, destfile)
+ else:
+ shutil.copyfile(os.path.join(workdir, localfile), destfile)
+ # For some reason just updating the header is not enough, we have to touch the .c
+ # file in order to get it to rebuild
+ os.utime("%s/psplash.c" % d.getVar('S'), None)
+ bb.build.exec_func("oe_runmake", d)
+ shutil.copyfile("psplash", outputfile)
+}
+
+do_install_append() {
+ install -d ${D}/mnt/.psplash/
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
+ install -d ${D}${bindir}
+ for i in ${SPLASH_INSTALL} ; do
+ install -m 0755 $i ${D}${bindir}/$i
+ done
+ rm -f ${D}${bindir}/psplash
+}
+
+FILES_${PN} += "/mnt/.psplash"
+
+INITSCRIPT_NAME = "psplash.sh"
+INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
+
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask psplash.service
+ fi
+}
diff --git a/poky/meta/recipes-core/readline/files/inputrc b/poky/meta/recipes-core/readline/files/inputrc
new file mode 100644
index 000000000..b5c4c8af2
--- /dev/null
+++ b/poky/meta/recipes-core/readline/files/inputrc
@@ -0,0 +1,61 @@
+# /etc/inputrc - global inputrc for libreadline
+# See readline(3readline) and `info rluserman' for more information.
+
+# Be 8 bit clean.
+set input-meta on
+set output-meta on
+
+# To allow the use of 8bit-characters like the german umlauts, comment out
+# the line below. However this makes the meta key not work as a meta key,
+# which is annoying to those which don't need to type in 8-bit characters.
+
+# set convert-meta off
+
+# try to enable the application keypad when it is called. Some systems
+# need this to enable the arrow keys.
+# set enable-keypad on
+
+# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
+
+# do not bell on tab-completion
+# set bell-style none
+
+# some defaults / modifications for the emacs mode
+$if mode=emacs
+
+# allow the use of the Home/End keys
+# "\e[1~": beginning-of-line
+# "\e[4~": end-of-line
+
+# allow the use of the Delete/Insert keys
+# "\e[3~": delete-char
+# "\e[2~": quoted-insert
+
+# mappings for "page up" and "page down" to step to the beginning/end
+# of the history
+# "\e[5~": beginning-of-history
+# "\e[6~": end-of-history
+
+# alternate mappings for "page up" and "page down" to search the history
+# "\e[5~": history-search-backward
+# "\e[6~": history-search-forward
+
+# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
+# "\e[5C": forward-word
+# "\e[5D": backward-word
+# "\e\e[C": forward-word
+# "\e\e[D": backward-word
+
+# $if term=rxvt
+# "\e[8~": end-of-line
+# $endif
+
+# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
+# "\eOH": beginning-of-line
+# "\eOF": end-of-line
+
+# for freebsd console
+# "\e[H": beginning-of-line
+# "\e[F": end-of-line
+
+$endif
diff --git a/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch b/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
new file mode 100644
index 000000000..ef3104f8a
--- /dev/null
+++ b/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+Without this it fails to link against libtermcap causing various missing
+symbols issues.
+
+RP - 8/10/08
+
+Support 6.3 which uses configure.ac rather than configure.in.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cea8f91..9075b8f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then
+ AC_MSG_CHECKING(configuration for building shared libraries)
+ eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+
+-# case "$SHLIB_LIBS" in
+-# *curses*|*termcap*|*termlib*) ;;
+-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+-# esac
++ case "$SHLIB_LIBS" in
++ *curses*|*termcap*|*termlib*) ;;
++ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
++ esac
+
+ AC_SUBST(SHOBJ_CC)
+ AC_SUBST(SHOBJ_CFLAGS)
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-core/readline/readline-7.0/norpath.patch b/poky/meta/recipes-core/readline/readline-7.0/norpath.patch
new file mode 100644
index 000000000..5d71582b7
--- /dev/null
+++ b/poky/meta/recipes-core/readline/readline-7.0/norpath.patch
@@ -0,0 +1,21 @@
+This support script ends up hardcoding unnecessary rpaths into the libraries. We
+will search $libdir automatically so this is just wastes space. There may be some
+cases this is necessary but our use cases aren't one of them.
+
+Upstream-Status: Inappropriate
+
+RP 2012/2/23
+
+Index: readline-6.2/support/shobj-conf
+===================================================================
+--- readline-6.2.orig/support/shobj-conf 2012-02-23 11:06:37.193179379 +0000
++++ readline-6.2/support/shobj-conf 2012-02-23 11:06:50.049178918 +0000
+@@ -114,7 +114,7 @@
+ SHOBJ_LD='${CC}'
+ SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ ;;
+
diff --git a/poky/meta/recipes-core/readline/readline.inc b/poky/meta/recipes-core/readline/readline.inc
new file mode 100644
index 000000000..e9665228d
--- /dev/null
+++ b/poky/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,45 @@
+SUMMARY = "Library for editing typed command lines"
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+HOMEPAGE = "https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+
+# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "ncurses"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive"
+SRC_URI += "file://inputrc"
+
+inherit autotools texinfo
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+do_install_append () {
+ # Make install doesn't properly install these
+ oe_libinstall -so -C shlib libhistory ${D}${libdir}
+ oe_libinstall -so -C shlib libreadline ${D}${libdir}
+
+ rmdir ${D}${bindir}
+ rm -rf ${D}${datadir}/${BPN}/*.c
+ rmdir ${D}${datadir}/${BPN} || true
+
+ install -m 0755 -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} += "${sysconfdir}/inputrc"
diff --git a/poky/meta/recipes-core/readline/readline_7.0.bb b/poky/meta/recipes-core/readline/readline_7.0.bb
new file mode 100644
index 000000000..85dfaa629
--- /dev/null
+++ b/poky/meta/recipes-core/readline/readline_7.0.bb
@@ -0,0 +1,7 @@
+require readline.inc
+
+SRC_URI += "file://configure-fix.patch \
+ file://norpath.patch"
+
+SRC_URI[archive.md5sum] = "205b03a87fc83dab653b628c59b9fc91"
+SRC_URI[archive.sha256sum] = "750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334"
diff --git a/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
new file mode 100644
index 000000000..9d828d702
--- /dev/null
+++ b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3600345&group_id=44427&atid=439544]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd sysfsutils-2.1.0/configure.ac sysfsutils-2.1.0/configure.ac
+--- sysfsutils-2.1.0/configure.ac 2006-08-07 08:08:00.000000000 +0300
++++ sysfsutils-2.1.0/configure.ac 2013-01-11 08:13:08.651550634 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(sysfsutils, 2.1.0, linux-diag-devel@lists.sourceforge.net)
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_SRCDIR([config.h.in])
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ # Checks for KLIBC support (should be before AC_PROG_LIBTOOL and AC_PROG_CC)
+ AC_CHECK_KLIBC
diff --git a/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
new file mode 100644
index 000000000..82e725e2a
--- /dev/null
+++ b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Pending
+
+Fix out of tree build issues so ${B} != ${S} works.
+
+RP 2013/03/18
+
+Index: sysfsutils-2.1.0/cmd/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/cmd/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/cmd/Makefile.am 2013-03-08 08:57:27.480556502 +0000
+@@ -1,6 +1,6 @@
+ bin_PROGRAMS = systool
+ systool_SOURCES = systool.c names.c names.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CFLAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS)
+Index: sysfsutils-2.1.0/lib/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/lib/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/lib/Makefile.am 2013-03-08 08:57:27.480556502 +0000
+@@ -1,7 +1,7 @@
+ lib_LTLIBRARIES = libsysfs.la
+ libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \
+ sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ libsysfs_la_LDFLAGS = -version-info 2:1:0
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ libsysfs_la_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/test/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/test/Makefile.am 2013-03-08 09:06:48.196543326 +0000
+@@ -2,14 +2,14 @@
+ BUILT_SOURCES = test.h
+ CLEANFILES = test.h
+ test.h:
+- ./create-test
++ $(srcdir)/create-test $(srcdir)/libsysfs.conf
+ get_device_SOURCES = get_device.c
+ get_driver_SOURCES = get_driver.c
+ get_module_SOURCES = get_module.c
+ testlibsysfs_SOURCES = test.c test_attr.c test_bus.c test_class.c \
+ test_device.c test_driver.c test_module.c test_utils.c \
+ testout.c test-defs.h libsysfs.conf create-test
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/create-test
+===================================================================
+--- sysfsutils-2.1.0.orig/test/create-test 2005-11-28 10:22:10.000000000 +0000
++++ sysfsutils-2.1.0/test/create-test 2013-03-08 09:07:03.372542838 +0000
+@@ -2,7 +2,7 @@
+
+ rm -f test.h
+
+-conf_file=./libsysfs.conf
++conf_file=$1
+
+ . $conf_file
+
diff --git a/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
new file mode 100644
index 000000000..1a35b7897
--- /dev/null
+++ b/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport [from fedora core 9]
+
+This patch is from the Fedora Core 9 sysfsutils-2.1.0-3.fc9 package.
+
+It fixes a problem in the upstream package where not all devices
+will be returned by the function.
+
+The package License indicates this is GPLv2 licensed.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
+--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup 2006-09-07 17:01:26.000000000 -0500
++++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c 2006-09-07 17:01:26.000000000 -0500
+@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
+ return 0;
+
+ if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
+- strlen((char *)a)) == 0)
++ SYSFS_NAME_LEN) == 0)
+ return 1;
+
+ return 0;
diff --git a/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 000000000..f9f067dca
--- /dev/null
+++ b/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Tools for working with sysfs"
+DESCRIPTION = "Tools for working with the sysfs virtual filesystem. The tool 'systool' can query devices by bus, class and topology."
+HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE_${PN} = "GPLv2"
+LICENSE_libsysfs = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
+ file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
+ file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
+PR = "r5"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
+ file://sysfsutils-2.0.0-class-dup.patch \
+ file://obsolete_automake_macros.patch \
+ file://separatebuild.patch"
+
+SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc"
+SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linux-diag/files/sysfsutils/"
+UPSTREAM_CHECK_REGEX = "/sysfsutils/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/sysfsutils-${PV}"
+
+inherit autotools
+
+PACKAGES =+ "libsysfs"
+FILES_libsysfs = "${libdir}/lib*${SOLIBS}"
+FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libsysfs-staticdev = "${libdir}/lib*.a"
+
+export libdir = "${base_libdir}"
diff --git a/poky/meta/recipes-core/systemd/systemd-boot_237.bb b/poky/meta/recipes-core/systemd/systemd-boot_237.bb
new file mode 100644
index 000000000..afd3848f2
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-boot_237.bb
@@ -0,0 +1,70 @@
+require systemd.inc
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
+
+DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
+
+SRC_URI += "file://0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
+ file://0027-remove-nobody-user-group-checking.patch \
+ file://0001-Also-check-i386-i586-and-i686-for-ia32.patch \
+ file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \
+ "
+
+inherit meson pkgconfig gettext
+inherit deploy
+
+EFI_CC ?= "${CC}"
+EXTRA_OEMESON += "-Defi=true \
+ -Dgnu-efi=true \
+ -Defi-includedir=${STAGING_INCDIR}/efi \
+ -Defi-ldsdir=${STAGING_LIBDIR} \
+ -Defi-libdir=${STAGING_LIBDIR} \
+ -Dman=false \
+ -Defi-cc='${EFI_CC}' \
+ -Defi-ld='${LD}' \
+ "
+
+# install to the image as boot*.efi if its the EFI_PROVIDER,
+# otherwise install as the full name.
+# This allows multiple bootloaders to coexist in a single image.
+python __anonymous () {
+ import re
+ target = d.getVar('TARGET_ARCH')
+ prefix = "" if d.getVar('EFI_PROVIDER', True) == "systemd-boot" else "systemd-"
+ if target == "x86_64":
+ systemdimage = prefix + "bootx64.efi"
+ else:
+ systemdimage = prefix + "bootia32.efi"
+ d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
+ prefix = "systemd-" if prefix == "" else ""
+ d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
+}
+
+FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}"
+
+RDEPENDS_${PN} += "virtual/systemd-bootconf"
+
+# Imported from the old gummiboot recipe
+TUNE_CCARGS_remove = "-mfpmath=sse"
+COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
+COMPATIBLE_HOST_x86-x32 = "null"
+
+do_compile() {
+ SYSTEMD_BOOT_EFI_ARCH="ia32"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ SYSTEMD_BOOT_EFI_ARCH="x64"
+ fi
+
+ ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
+}
+
+do_install() {
+ install -d ${D}/boot
+ install -d ${D}/boot/EFI
+ install -d ${D}/boot/EFI/BOOT
+ install ${B}/src/boot/efi/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}
+}
+
+do_deploy () {
+ install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
diff --git a/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb b/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
new file mode 100644
index 000000000..e9c246645
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
@@ -0,0 +1,31 @@
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SUMMARY = "Basic systemd-boot configuration files"
+
+RPROVIDES_${PN} += "virtual/systemd-bootconf"
+
+inherit systemd-boot-cfg
+
+S = "${WORKDIR}"
+
+LABELS = "boot"
+
+ROOT ?= "root=/dev/sda2"
+APPEND_append = " ${ROOT}"
+
+python do_configure() {
+ bb.build.exec_func('build_efi_cfg', d)
+}
+
+do_configure[vardeps] += "APPEND"
+
+do_install() {
+ install -d ${D}/boot
+ install -d ${D}/boot/loader
+ install -d ${D}/boot/loader/entries
+ install loader.conf ${D}/boot/loader/
+ rm loader.conf
+ install *.conf ${D}/boot/loader/entries/
+}
+
+FILES_${PN} = "/boot/loader/* /boot/loader/entries/*"
diff --git a/poky/meta/recipes-core/systemd/systemd-compat-units.bb b/poky/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 000000000..d228a51c1
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+LICENSE = "MIT"
+
+PR = "r29"
+
+PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
+
+S = "${WORKDIR}"
+
+inherit distro_features_check
+
+ALLOW_EMPTY_${PN} = "1"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SYSTEMD_DISABLED_SYSV_SERVICES = " \
+ busybox-udhcpc \
+ hwclock \
+ networking \
+ nfsserver \
+ nfscommon \
+ syslog.busybox \
+"
+
+pkg_postinst_${PN} () {
+
+ cd $D${sysconfdir}/init.d || exit 0
+
+ echo "Disabling the following sysv scripts: "
+
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ else
+ OPTS=""
+ fi
+
+ for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
+ if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service ] ; then
+ echo -n "$i: "
+ systemctl $OPTS mask $i.service
+ fi
+ done
+ echo
+}
+
+RDEPENDS_${PN} = "systemd"
diff --git a/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb b/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb
new file mode 100644
index 000000000..02756f43d
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Machine specific systemd units"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PR = "r19"
+
+inherit systemd
+SYSTEMD_SERVICE_${PN} = ""
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/poky/meta/recipes-core/systemd/systemd-serialgetty.bb b/poky/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 000000000..d67a3c91b
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Serial terminal support for systemd"
+HOMEPAGE = "https://www.freedesktop.org/wiki/Software/systemd/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r5"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+SRC_URI = "file://serial-getty@.service"
+
+S = "${WORKDIR}"
+
+# As this package is tied to systemd, only build it when we're also building systemd.
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+do_install() {
+ if [ ! -z "${SERIAL_CONSOLES}" ] ; then
+ default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
+ install -d ${D}${systemd_unitdir}/system/
+ install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
+ install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
+ sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
+
+ tmp="${SERIAL_CONSOLES}"
+ for entry in $tmp ; do
+ baudrate=`echo $entry | sed 's/\;.*//'`
+ ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+ if [ "$baudrate" = "$default_baudrate" ] ; then
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
+ else
+ # install custom service file for the non-default baudrate
+ install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+ sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
+ fi
+ done
+ fi
+}
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 000000000..e8b027e97
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,37 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Serial Getty on %I
+Documentation=man:agetty(8) man:systemd-getty-generator(8)
+Documentation=http://0pointer.de/blog/projects/serial-console.html
+BindsTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
+After=rc-local.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+IgnoreOnIsolate=yes
+
+[Service]
+Environment="TERM=xterm"
+ExecStart=-/sbin/agetty -8 -L %I @BAUDRATE@ $TERM
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+IgnoreSIGPIPE=no
+SendSIGHUP=yes
+
+[Install]
+WantedBy=getty.target
diff --git a/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb b/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 000000000..fadc8433d
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"
+
+inherit native
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl b/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 000000000..6e5a1b718
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,195 @@
+#!/bin/sh
+echo "Started $0 $*"
+
+ROOT=
+
+# parse command line params
+action=
+while [ $# != 0 ]; do
+ opt="$1"
+
+ case "$opt" in
+ enable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ disable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ mask)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ preset)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ --root=*)
+ ROOT=${opt##--root=}
+ cmd_args="0"
+ shift
+ ;;
+ *)
+ if [ "$cmd_args" = "1" ]; then
+ services="$services $opt"
+ shift
+ else
+ echo "'$opt' is an unkown option; exiting with error"
+ exit 1
+ fi
+ ;;
+ esac
+done
+if [ "$action" = "preset" -a "$service_file" = "" ]; then
+ services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done)
+ services="$services $opt"
+ presetall=1
+fi
+
+for service in $services; do
+ if [ "$presetall" = "1" ]; then
+ action="preset"
+ fi
+ if [ "$action" = "mask" ]; then
+ if [ ! -d $ROOT/etc/systemd/system/ ]; then
+ mkdir -p $ROOT/etc/systemd/system/
+ fi
+ cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
+ echo "$cmd"
+ $cmd
+ exit 0
+ fi
+
+ service_base_file=`echo $service | sed 's/\(@\).*\(\.[^.]\+\)/\1\2/'`
+ if [ -z `echo $service | sed '/@/p;d'` ]; then
+ echo "Try to find location of $service..."
+ service_template=false
+ else
+ echo "Try to find location of template $service_base_file of instance $service..."
+ service_template=true
+ if [ -z `echo $service | sed 's/^.\+@\(.*\)\.[^.]\+/\1/'` ]; then
+ instance_specified=false
+ else
+ instance_specified=true
+ fi
+ fi
+
+ # find service file
+ for p in $ROOT/etc/systemd/system \
+ $ROOT/lib/systemd/system \
+ $ROOT/usr/lib/systemd/system; do
+ if [ -e $p/$service_base_file ]; then
+ service_file=$p/$service_base_file
+ service_file=${service_file##$ROOT}
+ fi
+ done
+ if [ -z "$service_file" ]; then
+ echo "'$service_base_file' couldn't be found; exiting with error"
+ exit 1
+ fi
+ echo "Found $service in $service_file"
+
+ # If any new unit types are added to systemd they should be added
+ # to this regular expression.
+ unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|target\.wants\|path\|timer\|snapshot\)\s*$'
+ if [ "$action" = "preset" ]; then
+ action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+ if [ -z "$action" ]; then
+ globalpreset=`egrep -sh '\*' $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+ if [ -n "$globalpreset" ]; then
+ action="$globalpreset"
+ else
+ action="enable"
+ fi
+ fi
+ fi
+ # create the required symbolic links
+ wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ required_by=$(sed '/^RequiredBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ for dependency in WantedBy RequiredBy; do
+ if [ "$dependency" = "WantedBy" ]; then
+ suffix="wants"
+ dependency_list="$wanted_by"
+ elif [ "$dependency" = "RequiredBy" ]; then
+ suffix="requires"
+ dependency_list="$required_by"
+ fi
+ for r in $dependency_list; do
+ echo "$dependency=$r found in $service"
+ if [ "$action" = "enable" ]; then
+ enable_service=$service
+ if [ "$service_template" = true -a "$instance_specified" = false ]; then
+ default_instance=$(sed '/^DefaultInstance[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file")
+ if [ -z $default_instance ]; then
+ echo "Template unit without instance or DefaultInstance directive, nothing to enable"
+ continue
+ else
+ echo "Found DefaultInstance $default_instance, enabling it"
+ enable_service=$(echo $service | sed "s/@/@$(echo $default_instance | sed 's/\\/\\\\/g')/")
+ fi
+ fi
+ mkdir -p $ROOT/etc/systemd/system/$r.$suffix
+ ln -s $service_file $ROOT/etc/systemd/system/$r.$suffix/$enable_service
+ echo "Enabled $enable_service for $r."
+ else
+ if [ "$service_template" = true -a "$instance_specified" = false ]; then
+ disable_service="$ROOT/etc/systemd/system/$r.$suffix/`echo $service | sed 's/@/@*/'`"
+ else
+ disable_service="$ROOT/etc/systemd/system/$r.$suffix/$service"
+ fi
+ rm -f $disable_service
+ [ -d $ROOT/etc/systemd/system/$r.$suffix ] && rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.$suffix
+ echo "Disabled ${disable_service##$ROOT/etc/systemd/system/$r.$suffix/} for $r."
+ fi
+ done
+ done
+
+ # create the required symbolic 'Alias' links
+ alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ for r in $alias; do
+ if [ "$action" = "enable" ]; then
+ mkdir -p $ROOT/etc/systemd/system
+ ln -s $service_file $ROOT/etc/systemd/system/$r
+ echo "Enabled $service for $alias."
+ else
+ rm -f $ROOT/etc/systemd/system/$r
+ echo "Disabled $service for $alias."
+ fi
+ done
+
+ # call us for the other required scripts
+ also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n')
+ for a in $also; do
+ echo "Also=$a found in $service"
+ if [ "$action" = "enable" ]; then
+ $0 --root=$ROOT enable $a
+ fi
+ done
+done
diff --git a/poky/meta/recipes-core/systemd/systemd.inc b/poky/meta/recipes-core/systemd/systemd.inc
new file mode 100644
index 000000000..5fa48e7ab
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd.inc
@@ -0,0 +1,21 @@
+SUMMARY = "A System and service manager"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+
+DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \
+SysV and LSB init scripts. systemd provides aggressive parallelization \
+capabilities, uses socket and D-Bus activation for starting services, \
+offers on-demand starting of daemons, keeps track of processes using \
+Linux cgroups, supports snapshotting and restoring of the system \
+state, maintains mount and automount points and implements an \
+elaborate transactional dependency-based service control logic. It can \
+work as a drop-in replacement for sysvinit."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
+ file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
+
+SRCREV = "46659f7deb962f55c728e70597e37c2a3ab6326d"
+
+SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
+
+S = "${WORKDIR}/git"
diff --git a/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf
new file mode 100644
index 000000000..87cbe1e7d
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf
@@ -0,0 +1,7 @@
+#This goes hand-in-hand with the base-files of OE-Core. The file must
+# be sorted before 'systemd.conf' becuase this attempts to create a file
+# inside /var/log.
+
+
+d /var/volatile/log - - - -
+d /var/volatile/tmp 1777 - -
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-Also-check-i386-i586-and-i686-for-ia32.patch b/poky/meta/recipes-core/systemd/systemd/0001-Also-check-i386-i586-and-i686-for-ia32.patch
new file mode 100644
index 000000000..877bb1c65
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-Also-check-i386-i586-and-i686-for-ia32.patch
@@ -0,0 +1,28 @@
+From 3e8c19bb1bbc4493c591f75c00c1fefe3b1c8a69 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 20:42:41 -0800
+Subject: [PATCH] Also check i386, i586 and i686 for ia32
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 28cb8b60e..489531a43 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1217,7 +1217,7 @@ conf.set10('SYSTEMD_SLOW_TESTS_DEFAULT', slow_tests)
+ if get_option('efi')
+ efi_arch = host_machine.cpu_family()
+
+- if efi_arch == 'x86'
++ if efi_arch == 'x86' or efi_arch == 'i386' or efi_arch == 'i586' or efi_arch == 'i686'
+ EFI_MACHINE_TYPE_NAME = 'ia32'
+ gnu_efi_arch = 'ia32'
+ elif efi_arch == 'x86_64'
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch b/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch
new file mode 100644
index 000000000..e2e19ba06
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch
@@ -0,0 +1,62 @@
+From 527413ec243564a89ffaad6368d446de44415970 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 21:42:23 -0800
+Subject: [PATCH] Fix to run efi_cc and efi_ld correctly when cross-compiling
+
+When cross-compiling, efi_cc and efi_ld may take the form of
+'xxx-gcc --sysroot=xxx', and this would cause run_command and
+the alike fail.
+
+Fix to split them to make commands run correctly.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/boot/efi/meson.build | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
+index 992a3ba4c..9f9ec4911 100644
+--- a/src/boot/efi/meson.build
++++ b/src/boot/efi/meson.build
+@@ -157,7 +157,7 @@ if have_gnu_efi
+ o_file = custom_target(file + '.o',
+ input : file,
+ output : file + '.o',
+- command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
++ command : efi_cc.split() + ['-c', '@INPUT@', '-o', '@OUTPUT@']
+ + compile_args,
+ depend_files : efi_headers)
+ if (common_sources + systemd_boot_sources).contains(file)
+@@ -168,7 +168,17 @@ if have_gnu_efi
+ endif
+ endforeach
+
+- libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip()
++ find_libgcc_cmd_all = efi_cc + ' -print-libgcc-file-name'
++ find_libgcc_cmd = find_libgcc_cmd_all.split()[0]
++ find_libgcc_args = []
++ cmd_args_all = find_libgcc_cmd_all.split()
++ foreach arg : cmd_args_all
++ if arg != find_libgcc_cmd
++ find_libgcc_args += arg
++ endif
++ endforeach
++
++ libgcc_file_name = run_command(find_libgcc_cmd, find_libgcc_args).stdout().strip()
+ systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
+ stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
+ no_undefined_symbols = find_program('no-undefined-symbols.sh')
+@@ -179,7 +189,7 @@ if have_gnu_efi
+ tuple[0],
+ input : tuple[2],
+ output : tuple[0],
+- command : [efi_ld, '-o', '@OUTPUT@'] +
++ command : efi_ld.split() + ['-o', '@OUTPUT@'] +
+ efi_ldflags + tuple[2] +
+ ['-lefi', '-lgnuefi', libgcc_file_name])
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/poky/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
new file mode 100644
index 000000000..2cffc426e
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
@@ -0,0 +1,34 @@
+From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Mar 2018 18:00:17 -0800
+Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
+
+for currently unknown reasons they get exported to the shared libries
+even without being listed in the sym file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+
+Upstream-Status: Pending [ Conditional on master needing this, 234 does need it ]
+
+ src/libsystemd/sd-bus/bus-error.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
+index 378f7a377..49d797abd 100644
+--- a/src/libsystemd/sd-bus/bus-error.c
++++ b/src/libsystemd/sd-bus/bus-error.c
+@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
+ };
+
+ /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
+-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
+-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];
++extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_;
++extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_;
+
+ /* Additional maps registered with sd_bus_error_add_map() are in this
+ * NULL terminated array */
+--
+2.16.2
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch b/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
new file mode 100644
index 000000000..e913e3f7b
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
@@ -0,0 +1,33 @@
+From e361f6b4aefae57efff7e457df8db4d1067bec23 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:50:23 -0800
+Subject: [PATCH] Remove fstack-protector flags to workaround musl build
+
+Remove fstack-protector and fstack-protector-strong flags to fix
+the following build failure for qemux86 and qemuppc with musl.
+
+ undefined reference to `__stack_chk_fail_local'
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 7610ab12b..591b9cbab 100644
+--- a/meson.build
++++ b/meson.build
+@@ -329,8 +329,6 @@ foreach arg : ['-Wextra',
+ '-fdiagnostics-show-option',
+ '-fno-strict-aliasing',
+ '-fvisibility=hidden',
+- '-fstack-protector',
+- '-fstack-protector-strong',
+ '--param=ssp-buffer-size=4',
+ ]
+ if cc.has_argument(arg)
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch b/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
new file mode 100644
index 000000000..f4c15e1c4
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
@@ -0,0 +1,33 @@
+From b1192a6e171413291d9d64fafc04773c6bbc9cab Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 23 Feb 2018 10:04:48 +0800
+Subject: [PATCH 01/31] Use getenv when secure versions are not available
+
+musl doesnt implement secure version, so we default
+to it if configure does not detect a secure implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Denied
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 1280e6c41..39c1fb700 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -605,7 +605,7 @@ struct btrfs_ioctl_quota_ctl_args {
+ # if HAVE___SECURE_GETENV
+ # define secure_getenv __secure_getenv
+ # else
+-# error "neither secure_getenv nor __secure_getenv are available"
++# define secure_getenv getenv
+ # endif
+ #endif
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch b/poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
new file mode 100644
index 000000000..98c83620f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0001-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -0,0 +1,30 @@
+From 7844e070745611a52e355b73e7890f360dd540d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Dec 2015 04:09:19 +0000
+Subject: [PATCH] core/device.c: Change the default device timeout to 240 sec.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [Specific case QEMU/AB]
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/core/device.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/device.c b/src/core/device.c
+index a43664d3b..4b16a8aec 100644
+--- a/src/core/device.c
++++ b/src/core/device.c
+@@ -113,7 +113,7 @@ static void device_init(Unit *u) {
+ * indefinitely for plugged in devices, something which cannot
+ * happen for the other units since their operations time out
+ * anyway. */
+- u->job_running_timeout = u->manager->default_timeout_start_usec;
++ u->job_running_timeout = (240 * USEC_PER_SEC);
+
+ u->ignore_on_isolate = true;
+ }
diff --git a/poky/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/poky/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch
new file mode 100644
index 000000000..c3f4b3934
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -0,0 +1,81 @@
+From c93eb6cdec03f5e243e59e95dc49273fcb90e7c1 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 23 Feb 2018 10:23:40 +0800
+Subject: [PATCH 02/31] binfmt: Don't install dependency links at install time
+ for the binfmt services
+
+use [Install] blocks so that they get created when the service is enabled
+like a traditional service.
+
+The [Install] blocks were rejected upstream as they don't have a way to
+"enable" it on install without static symlinks which can't be disabled,
+only masked. We however can do that in a postinst.
+
+Upstream-Status: Denied
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ units/meson.build | 6 ++----
+ units/proc-sys-fs-binfmt_misc.automount | 3 +++
+ units/systemd-binfmt.service.in | 4 ++++
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/units/meson.build b/units/meson.build
+index 814ee7885..49ace0d0f 100644
+--- a/units/meson.build
++++ b/units/meson.build
+@@ -60,8 +60,7 @@ units = [
+ ['poweroff.target', '',
+ 'runlevel0.target'],
+ ['printer.target', ''],
+- ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
+- 'sysinit.target.wants/'],
++ ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'],
+ ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
+ ['reboot.target', '',
+ 'runlevel6.target ctrl-alt-del.target'],
+@@ -144,8 +143,7 @@ in_units = [
+ ['systemd-ask-password-console.service', ''],
+ ['systemd-ask-password-wall.service', ''],
+ ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
+- ['systemd-binfmt.service', 'ENABLE_BINFMT',
+- 'sysinit.target.wants/'],
++ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
+ ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
+ ['systemd-exit.service', ''],
+ ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
+diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
+index 30a6bc991..4231f3b70 100644
+--- a/units/proc-sys-fs-binfmt_misc.automount
++++ b/units/proc-sys-fs-binfmt_misc.automount
+@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
+
+ [Automount]
+ Where=/proc/sys/fs/binfmt_misc
++
++[Install]
++WantedBy=sysinit.target
+diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
+index df9396d89..0687f4648 100644
+--- a/units/systemd-binfmt.service.in
++++ b/units/systemd-binfmt.service.in
+@@ -13,6 +13,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5)
+ Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt
+ DefaultDependencies=no
+ Conflicts=shutdown.target
++Wants=proc-sys-fs-binfmt_misc.automount
+ After=proc-sys-fs-binfmt_misc.automount
+ Before=sysinit.target shutdown.target
+ ConditionPathIsReadWrite=/proc/sys/
+@@ -27,3 +28,6 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-binfmt
+ TimeoutSec=90s
++
++[Install]
++WantedBy=sysinit.target
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/poky/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
new file mode 100644
index 000000000..28f1b217e
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -0,0 +1,64 @@
+From 8b9d194e956848e0d1fb35ef2fba714b2691ebe6 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 20:47:49 -0800
+Subject: [PATCH 03/31] use lnr wrapper instead of looking for --relative
+ option for ln
+
+Remove file manually to avoid the 'File Exists' error when creating
+symlink. This is because the original 'ln' command uses '-f' option.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 4 ----
+ tools/meson-make-symlink.sh | 3 ++-
+ units/meson-add-wants.sh | 7 ++++++-
+ 3 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 36a62d280..7347ea880 100644
+--- a/meson.build
++++ b/meson.build
+@@ -570,10 +570,6 @@ endforeach
+
+ conf.set_quoted('TELINIT', get_option('telinit-path'))
+
+-if run_command('ln', '--relative', '--help').returncode() != 0
+- error('ln does not support --relative')
+-endif
+-
+ ############################################################
+
+ gperf = find_program('gperf')
+diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
+index 501cd43d4..f4e4ac9ac 100755
+--- a/tools/meson-make-symlink.sh
++++ b/tools/meson-make-symlink.sh
+@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
+ if [ "$(dirname $1)" = . ]; then
+ ln -vfs -T "$1" "${DESTDIR:-}$2"
+ else
+- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
++ rm -f "${DESTDIR:-}$2"
++ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+ fi
+diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
+index 70f7172ae..a42666aac 100755
+--- a/units/meson-add-wants.sh
++++ b/units/meson-add-wants.sh
+@@ -25,4 +25,9 @@ case "$target" in
+ ;;
+ esac
+
+-ln -vfs --relative "$unitpath" "$dir"
++if [ -d "$dir" ]; then
++ rm -f "$dir/$unit"
++ lnr "$unitpath" "$dir/$unit"
++else
++ lnr "$unitpath" "$dir"
++fi
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch b/poky/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch
new file mode 100644
index 000000000..83fdb530b
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0004-implment-systemd-sysv-install-for-OE.patch
@@ -0,0 +1,43 @@
+From 70d456fb21de2a80697fa364f08475339d6396c1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Sep 2015 06:31:47 +0000
+Subject: [PATCH 04/31] implment systemd-sysv-install for OE
+
+Use update-rc.d for enabling/disabling and status command
+to check the status of the sysv service
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemctl/systemd-sysv-install.SKELETON | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
+index a53a3e622..5d877b06e 100755
+--- a/src/systemctl/systemd-sysv-install.SKELETON
++++ b/src/systemctl/systemd-sysv-install.SKELETON
+@@ -30,17 +30,17 @@ case "$1" in
+ enable)
+ # call the command to enable SysV init script $NAME here
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
++ update-rc.d -f $NAME defaults
+ ;;
+ disable)
+ # call the command to disable SysV init script $NAME here
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
++ update-rc.d -f $NAME remove
+ ;;
+ is-enabled)
+ # exit with 0 if $NAME is enabled, non-zero if it is disabled
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: checking SysV init.d script $NAME"
++ /etc/init.d/$NAME status
+ ;;
+ *)
+ usage ;;
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch b/poky/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch
new file mode 100644
index 000000000..e4421c826
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0005-rules-whitelist-hd-devices.patch
@@ -0,0 +1,33 @@
+From 7b5b34993002b4418ba8a3c2ae661a7337fd8ed0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:41:13 -0800
+Subject: [PATCH 05/31] rules: whitelist hd* devices
+
+qemu by default emulates IDE and the linux-yocto kernel(s) use
+CONFIG_IDE instead of the more modern libsata, so disks appear as
+/dev/hd*. Patch rejected upstream because CONFIG_IDE is deprecated.
+
+Upstream-Status: Denied [https://github.com/systemd/systemd/pull/1276]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ rules/60-persistent-storage.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
+index 0de8cf3a1..d3f58f153 100644
+--- a/rules/60-persistent-storage.rules
++++ b/rules/60-persistent-storage.rules
+@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
+ ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
+
+ SUBSYSTEM!="block", GOTO="persistent_storage_end"
+-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*", GOTO="persistent_storage_end"
++KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|hd*", GOTO="persistent_storage_end"
+
+ # ignore partitions that span the entire disk
+ TEST=="whole_disk", GOTO="persistent_storage_end"
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch b/poky/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch
new file mode 100644
index 000000000..5ba966168
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0006-Make-root-s-home-directory-configurable.patch
@@ -0,0 +1,78 @@
+From 9d63227420f0c4f093c1c2066eafe2b6152070cf Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 23 Feb 2018 13:47:37 +0800
+Subject: [PATCH 06/31] Make root's home directory configurable
+
+OpenEmbedded has a configurable home directory for root. Allow
+systemd to be built using its idea of what root's home directory
+should be.
+
+Upstream-Status: Denied
+Upstream wants to have a unified hierarchy where everyone is
+using the same root folder.
+https://github.com/systemd/systemd/issues/541
+
+Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 8 ++++++++
+ meson_options.txt | 2 ++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 7347ea880..918101d6b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -94,6 +94,11 @@ if rootlibdir == ''
+ rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
+ endif
+
++roothomedir = get_option('roothomedir')
++if roothomedir == ''
++ roothomedir = '/root'
++endif
++
+ # Dirs of external packages
+ pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
+ pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
+@@ -205,6 +210,7 @@ conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
+ conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
+ conf.set_quoted('LIBDIR', libdir)
+ conf.set_quoted('ROOTLIBDIR', rootlibdir)
++conf.set_quoted('ROOTHOMEDIR', roothomedir)
+ conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
+ conf.set_quoted('BOOTLIBDIR', bootlibdir)
+ conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
+@@ -221,6 +227,7 @@ substs.set('prefix', prefixdir)
+ substs.set('exec_prefix', prefixdir)
+ substs.set('libdir', libdir)
+ substs.set('rootlibdir', rootlibdir)
++substs.set('roothomedir', roothomedir)
+ substs.set('includedir', includedir)
+ substs.set('pkgsysconfdir', pkgsysconfdir)
+ substs.set('bindir', bindir)
+@@ -2705,6 +2712,7 @@ status = [
+ 'include directory: @0@'.format(includedir),
+ 'lib directory: @0@'.format(libdir),
+ 'rootlib directory: @0@'.format(rootlibdir),
++ 'roothome directory: @0@'.format(roothomedir),
+ 'SysV init scripts: @0@'.format(sysvinit_path),
+ 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
+ 'PAM modules directory: @0@'.format(pamlibdir),
+diff --git a/meson_options.txt b/meson_options.txt
+index 39822d6cd..0b24f0e0f 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -22,6 +22,8 @@ option('rootlibdir', type : 'string',
+ description : '''[/usr]/lib/x86_64-linux-gnu or such''')
+ option('rootprefix', type : 'string',
+ description : '''override the root prefix''')
++option('roothomedir', type : 'string',
++ description : '''override the root home directory''')
+ option('link-udev-shared', type : 'boolean',
+ description : 'link systemd-udev and its helpers to libsystemd-shared.so')
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch b/poky/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 000000000..bb12d30a4
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0007-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 35d6d384e83ac38077603611bb791969ef95fe68 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH 07/31] Revert "rules: remove firmware loading rules"
+
+This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ rules/50-firmware.rules | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 rules/50-firmware.rules
+
+diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
+new file mode 100644
+index 000000000..f0ae68451
+--- /dev/null
++++ b/rules/50-firmware.rules
+@@ -0,0 +1,3 @@
++# do not edit this file, it will be overwritten on update
++
++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/poky/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 000000000..15d7e0290
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,377 @@
+From 5cce7626f33e92f624ac06b613125813fb47d445 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:05:39 -0800
+Subject: [PATCH 08/31] Revert "udev: remove userspace firmware loading
+ support"
+
+This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ README | 4 +-
+ TODO | 1 +
+ meson.build | 9 +++
+ meson_options.txt | 2 +
+ rules/meson.build | 4 +
+ src/udev/meson.build | 4 +
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c | 3 +
+ src/udev/udev.h | 6 ++
+ src/udev/udevd.c | 12 +++
+ 10 files changed, 197 insertions(+), 2 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+diff --git a/README b/README
+index 8807e5cfe..bfd7a35de 100644
+--- a/README
++++ b/README
+@@ -58,8 +58,8 @@ REQUIREMENTS:
+ Legacy hotplug slows down the system and confuses udev:
+ CONFIG_UEVENT_HELPER_PATH=""
+
+- Userspace firmware loading is not supported and should
+- be disabled in the kernel:
++ Userspace firmware loading is deprecated, will go away, and
++ sometimes causes problems:
+ CONFIG_FW_LOADER_USER_HELPER=n
+
+ Some udev rules and virtualization detection relies on it:
+diff --git a/TODO b/TODO
+index a77028c7b..39e72d7ec 100644
+--- a/TODO
++++ b/TODO
+@@ -783,6 +783,7 @@ Features:
+ * initialize the hostname from the fs label of /, if /etc/hostname does not exist?
+
+ * udev:
++ - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
+ - move to LGPL
+ - kill scsi_id
+ - add trigger --subsystem-match=usb/usb_device device
+diff --git a/meson.build b/meson.build
+index 918101d6b..9c25022a4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -72,6 +72,12 @@ conf.set10('HAVE_SYSV_COMPAT', have,
+ description : 'SysV init scripts and rcN.d links are supported')
+ m4_defines += have ? ['-DHAVE_SYSV_COMPAT'] : []
+
++firmware_path = get_option('firmware-path')
++have = firmware_path != ''
++conf.set10('HAVE_FIRMWARE', have,
++ description : 'Userspace firmware loading is supported')
++m4_defines += have ? ['-DHAVE_FIRMWARE'] : []
++
+ # join_paths ignore the preceding arguments if an absolute component is
+ # encountered, so this should canonicalize various paths when they are
+ # absolute or relative.
+@@ -178,6 +184,7 @@ conf.set_quoted('SYSTEM_CONFIG_UNIT_PATH', join_paths(pkgsysc
+ conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir)
+ conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path)
+ conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
++conf.set_quoted('FIRMWARE_PATH', firmware_path)
+ conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
+ conf.set_quoted('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
+ conf.set_quoted('USER_CONFIG_UNIT_PATH', join_paths(pkgsysconfdir, 'user'))
+@@ -258,6 +265,7 @@ substs.set('SYSTEMCTL', join_paths(rootbin
+ substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
+ substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
+ substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)
++substs.set('FIRMWARE_PATH', firmware_path)
+ substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local'))
+ substs.set('RC_LOCAL_SCRIPT_PATH_STOP', get_option('halt-local'))
+
+@@ -2715,6 +2723,7 @@ status = [
+ 'roothome directory: @0@'.format(roothomedir),
+ 'SysV init scripts: @0@'.format(sysvinit_path),
+ 'SysV rc?.d directories: @0@'.format(sysvrcnd_path),
++ 'firmware path: @0@'.format(firmware_path),
+ 'PAM modules directory: @0@'.format(pamlibdir),
+ 'PAM configuration directory: @0@'.format(pamconfdir),
+ 'RPM macros directory: @0@'.format(rpmmacrosdir),
+diff --git a/meson_options.txt b/meson_options.txt
+index 0b24f0e0f..92d25fa35 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -108,6 +108,8 @@ option('tmpfiles', type : 'boolean',
+ description : 'support for tmpfiles.d')
+ option('importd', type : 'combo', choices : ['auto', 'true', 'false'],
+ description : 'install the systemd-importd daemon')
++option('firmware-path', type : 'string', value : '',
++ description : 'Firmware search path')
+ option('hwdb', type : 'boolean',
+ description : 'support for the hardware database')
+ option('rfkill', type : 'boolean',
+diff --git a/rules/meson.build b/rules/meson.build
+index e253b9f59..5eee5fbca 100644
+--- a/rules/meson.build
++++ b/rules/meson.build
+@@ -41,6 +41,10 @@ rules = files('''
+ install_data(rules,
+ install_dir : udevrulesdir)
+
++if conf.get('HAVE_FIRMWARE') == 1
++ install_data('50-firmware.rules', install_dir : udevrulesdir)
++endif
++
+ all_rules = rules
+
+ rules_in = '''
+diff --git a/src/udev/meson.build b/src/udev/meson.build
+index de2fd2d9c..b6b0ca006 100644
+--- a/src/udev/meson.build
++++ b/src/udev/meson.build
+@@ -67,6 +67,10 @@ if conf.get('HAVE_ACL') == 1
+ sd_login_c]
+ endif
+
++if conf.get('HAVE_FIRMWARE') == 1
++ libudev_core_sources += ['udev-builtin-firmware.c']
++endif
++
+ ############################################################
+
+ generate_keyboard_keys_list = find_program('generate-keyboard-keys-list.sh')
+diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
+new file mode 100644
+index 000000000..bd8c2fb96
+--- /dev/null
++++ b/src/udev/udev-builtin-firmware.c
+@@ -0,0 +1,154 @@
++/*
++ * firmware - Kernel firmware loader
++ *
++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details:*
++ */
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <getopt.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++
++#include "udev.h"
++
++static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
++ FILE *ldfile;
++
++ ldfile = fopen(loadpath, "we");
++ if (ldfile == NULL) {
++ log_error("error: can not open '%s'", loadpath);
++ return false;
++ };
++ fprintf(ldfile, "%s\n", state);
++ fclose(ldfile);
++ return true;
++}
++
++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
++ char *buf;
++ FILE *fsource = NULL, *ftarget = NULL;
++ bool ret = false;
++
++ buf = malloc(size);
++ if (buf == NULL) {
++ log_error("No memory available to load firmware file");
++ return false;
++ }
++
++ log_debug("writing '%s' (%zi) to '%s'", source, size, target);
++
++ fsource = fopen(source, "re");
++ if (fsource == NULL)
++ goto exit;
++ ftarget = fopen(target, "we");
++ if (ftarget == NULL)
++ goto exit;
++ if (fread(buf, size, 1, fsource) != 1)
++ goto exit;
++ if (fwrite(buf, size, 1, ftarget) == 1)
++ ret = true;
++exit:
++ if (ftarget != NULL)
++ fclose(ftarget);
++ if (fsource != NULL)
++ fclose(fsource);
++ free(buf);
++ return ret;
++}
++
++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
++ struct udev *udev = udev_device_get_udev(dev);
++ static const char *searchpath[] = { FIRMWARE_PATH };
++ char loadpath[UTIL_PATH_SIZE];
++ char datapath[UTIL_PATH_SIZE];
++ char fwpath[UTIL_PATH_SIZE];
++ const char *firmware;
++ FILE *fwfile = NULL;
++ struct utsname kernel;
++ struct stat statbuf;
++ unsigned int i;
++ int rc = EXIT_SUCCESS;
++
++ firmware = udev_device_get_property_value(dev, "FIRMWARE");
++ if (firmware == NULL) {
++ log_error("firmware parameter missing");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ /* lookup firmware file */
++ uname(&kernel);
++ for (i = 0; i < ELEMENTSOF(searchpath); i++) {
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++ }
++
++ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
++
++ if (fwfile == NULL) {
++ log_debug("did not find firmware file '%s'", firmware);
++ rc = EXIT_FAILURE;
++ /*
++ * Do not cancel the request in the initrd, the real root might have
++ * the firmware file and the 'coldplug' run in the real root will find
++ * this pending request and fulfill or cancel it.
++ * */
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ goto exit;
++ }
++
++ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ if (!set_loading(udev, loadpath, "1"))
++ goto exit;
++
++ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
++ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
++ log_error("error sending firmware '%s' to device", firmware);
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ };
++
++ set_loading(udev, loadpath, "0");
++exit:
++ if (fwfile)
++ fclose(fwfile);
++ return rc;
++}
++
++const struct udev_builtin udev_builtin_firmware = {
++ .name = "firmware",
++ .cmd = builtin_firmware,
++ .help = "kernel firmware loader",
++ .run_once = true,
++};
+diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
+index db2b6874f..ccd88638c 100644
+--- a/src/udev/udev-builtin.c
++++ b/src/udev/udev-builtin.c
+@@ -32,6 +32,9 @@ static const struct udev_builtin *builtins[] = {
+ [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
+ #endif
+ [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
++#if HAVE_FIRMWARE
++ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
++#endif
+ [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
+ [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+ [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
+diff --git a/src/udev/udev.h b/src/udev/udev.h
+index ea11c2d29..c47dd3d88 100644
+--- a/src/udev/udev.h
++++ b/src/udev/udev.h
+@@ -151,6 +151,9 @@ enum udev_builtin_cmd {
+ UDEV_BUILTIN_BLKID,
+ #endif
+ UDEV_BUILTIN_BTRFS,
++#if HAVE_FIRMWARE
++ UDEV_BUILTIN_FIRMWARE,
++#endif
+ UDEV_BUILTIN_HWDB,
+ UDEV_BUILTIN_INPUT_ID,
+ UDEV_BUILTIN_KEYBOARD,
+@@ -179,6 +182,9 @@ struct udev_builtin {
+ extern const struct udev_builtin udev_builtin_blkid;
+ #endif
+ extern const struct udev_builtin udev_builtin_btrfs;
++#if HAVE_FIRMWARE
++extern const struct udev_builtin udev_builtin_firmware;
++#endif
+ extern const struct udev_builtin udev_builtin_hwdb;
+ extern const struct udev_builtin udev_builtin_input_id;
+ extern const struct udev_builtin udev_builtin_keyboard;
+diff --git a/src/udev/udevd.c b/src/udev/udevd.c
+index 5c757d513..2f3313007 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -127,6 +127,9 @@ struct event {
+ bool is_block;
+ sd_event_source *timeout_warning;
+ sd_event_source *timeout;
++#if HAVE_FIRMWARE
++ bool nodelay;
++#endif
+ };
+
+ static void event_queue_cleanup(Manager *manager, enum event_state type);
+@@ -609,6 +612,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
+ event->devnum = udev_device_get_devnum(dev);
+ event->is_block = streq("block", udev_device_get_subsystem(dev));
+ event->ifindex = udev_device_get_ifindex(dev);
++#if HAVE_FIRMWARE
++ if (streq(udev_device_get_subsystem(dev), "firmware"))
++ event->nodelay = true;
++#endif
+
+ log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
+ udev_device_get_action(dev), udev_device_get_subsystem(dev));
+@@ -692,6 +699,11 @@ static bool is_devpath_busy(Manager *manager, struct event *event) {
+ return true;
+ }
+
++#if HAVE_FIRMWARE
++ /* allow to bypass the dependency tracking */
++ if (event->nodelay)
++ continue;
++#endif
+ /* parent device event found */
+ if (event->devpath[common] == '/') {
+ event->delaying_seqnum = loop_event->seqnum;
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch b/poky/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch
new file mode 100644
index 000000000..1b14369ce
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0009-remove-duplicate-include-uchar.h.patch
@@ -0,0 +1,41 @@
+From ffdf9cb6ba0d932b81933d824f23a878c313a8d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 22 Feb 2016 05:59:01 +0000
+Subject: [PATCH 09/31] remove duplicate include uchar.h
+
+missing.h already includes it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ src/basic/escape.h | 1 -
+ src/basic/utf8.h | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/src/basic/escape.h b/src/basic/escape.h
+index de89f43a8..9921ccbbd 100644
+--- a/src/basic/escape.h
++++ b/src/basic/escape.h
+@@ -24,7 +24,6 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <sys/types.h>
+-#include <uchar.h>
+
+ #include "string-util.h"
+ #include "missing.h"
+diff --git a/src/basic/utf8.h b/src/basic/utf8.h
+index b0a7485ae..fa06d2906 100644
+--- a/src/basic/utf8.h
++++ b/src/basic/utf8.h
+@@ -23,7 +23,6 @@
+ #include <stdbool.h>
+ #include <stddef.h>
+ #include <stdint.h>
+-#include <uchar.h>
+
+ #include "macro.h"
+ #include "missing.h"
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch b/poky/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch
new file mode 100644
index 000000000..9a44b5484
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0010-check-for-uchar.h-in-meson.build.patch
@@ -0,0 +1,45 @@
+From ea4caaa1c6a6dc682bb04548ab05c5c73d0b45d6 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 26 Feb 2018 15:34:52 +0800
+Subject: [PATCH 10/31] check for uchar.h in meson.build
+
+Use #if HAVE_UCHAR_H to include uchar.h conditionally.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/missing.h | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 9c25022a4..94a16712b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -623,6 +623,7 @@ foreach header : ['crypt.h',
+ 'sys/auxv.h',
+ 'valgrind/memcheck.h',
+ 'valgrind/valgrind.h',
++ 'uchar.h',
+ ]
+
+ conf.set10('HAVE_' + header.underscorify().to_upper(),
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 39c1fb700..84d6d9167 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -38,7 +38,9 @@
+ #include <sys/resource.h>
+ #include <sys/socket.h>
+ #include <sys/syscall.h>
++#if HAVE_UCHAR_H
+ #include <uchar.h>
++#endif
+ #include <unistd.h>
+
+ #if HAVE_AUDIT
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/poky/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
new file mode 100644
index 000000000..b0923d15f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -0,0 +1,39 @@
+From 60dd411e9756fc2b14c0e061ad803782b4aee874 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 26 Feb 2018 15:46:05 +0800
+Subject: [PATCH 11/31] socket-util: don't fail if libc doesn't support IDN
+
+Upstream-Status: Pending
+
+Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/socket-util.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
+index 2c70cade1..67aedadd4 100644
+--- a/src/basic/socket-util.c
++++ b/src/basic/socket-util.c
+@@ -50,6 +50,16 @@
+ #include "utf8.h"
+ #include "util.h"
+
++/* Don't fail if the standard library
++ * doesn't support IDN */
++#ifndef NI_IDN
++#define NI_IDN 0
++#endif
++
++#ifndef NI_IDN_USE_STD3_ASCII_RULES
++#define NI_IDN_USE_STD3_ASCII_RULES 0
++#endif
++
+ #if ENABLE_IDN
+ # define IDN_FLAGS (NI_IDN|NI_IDN_USE_STD3_ASCII_RULES)
+ #else
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch b/poky/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch
new file mode 100644
index 000000000..720786371
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0012-rules-watch-metadata-changes-in-ide-devices.patch
@@ -0,0 +1,43 @@
+From 406a4c8692316e8c7e14c78f9a802689be304a95 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 17 Nov 2017 09:46:00 +0800
+Subject: [PATCH 12/31] rules: watch metadata changes in ide devices
+
+Formatting IDE storage does not trigger "change" uevents. As a result
+clients using udev API don't get any updates afterwards and get outdated
+information about the device.
+...
+root@qemux86-64:~# mkfs.ext4 -F /dev/hda1
+Creating filesystem with 262144 4k blocks and 65536 inodes
+Filesystem UUID: 98791eb2-2bf3-47ad-b4d8-4cf7e914eee2
+
+root@qemux86-64:~# ls /dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2
+ls: cannot access '/dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2': No such file or directory
+...
+Include hd* in a match for watch option assignment.
+
+Upstream-Status: Denied
+
+qemu by default emulates IDE and the linux-yocto kernel(s) use
+CONFIG_IDE instead of the more modern libsata, so disks appear as
+/dev/hd*. A similar patch rejected by upstream because CONFIG_IDE
+is deprecated.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ rules/60-block.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rules/60-block.rules b/rules/60-block.rules
+index 343fc06f8..b5237dac4 100644
+--- a/rules/60-block.rules
++++ b/rules/60-block.rules
+@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_
+ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+ # watch metadata changes, caused by tools closing the device node which was opened for writing
+-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch"
++ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch"
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch b/poky/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch
new file mode 100644
index 000000000..9c9278d3f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0013-add-fallback-parse_printf_format-implementation.patch
@@ -0,0 +1,431 @@
+From 580d23cf0b32e36a8fb96710336ffef432b3c7ce Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:10:58 -0800
+Subject: [PATCH] add fallback parse_printf_format implementation
+
+Upstream-Status: Pending
+
+Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/meson.build | 4 +
+ src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++
+ src/basic/parse-printf-format.h | 57 +++++++++
+ src/basic/stdio-util.h | 2 +-
+ src/journal/journal-send.c | 2 +-
+ 6 files changed, 337 insertions(+), 2 deletions(-)
+ create mode 100644 src/basic/parse-printf-format.c
+ create mode 100644 src/basic/parse-printf-format.h
+
+diff --git a/meson.build b/meson.build
+index 94a16712b..4eabaafe8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -620,6 +620,7 @@ foreach header : ['crypt.h',
+ 'linux/btrfs.h',
+ 'linux/memfd.h',
+ 'linux/vm_sockets.h',
++ 'printf.h',
+ 'sys/auxv.h',
+ 'valgrind/memcheck.h',
+ 'valgrind/valgrind.h',
+diff --git a/src/basic/meson.build b/src/basic/meson.build
+index 44cd31ecb..435c6ee02 100644
+--- a/src/basic/meson.build
++++ b/src/basic/meson.build
+@@ -310,6 +310,10 @@ endforeach
+
+ basic_sources += [missing_h] + generated_gperf_headers
+
++if conf.get('HAVE_PRINTF_H') != 1
++ basic_sources += [files('parse-printf-format.c')]
++endif
++
+ libbasic = static_library(
+ 'basic',
+ basic_sources,
+diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
+new file mode 100644
+index 000000000..49437e544
+--- /dev/null
++++ b/src/basic/parse-printf-format.c
+@@ -0,0 +1,273 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the musl C library
++ Copyright 2005-2014 Rich Felker, et al.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#include <stddef.h>
++#include <string.h>
++
++#include "parse-printf-format.h"
++
++static const char *consume_nonarg(const char *fmt)
++{
++ do {
++ if (*fmt == '\0')
++ return fmt;
++ } while (*fmt++ != '%');
++ return fmt;
++}
++
++static const char *consume_num(const char *fmt)
++{
++ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
++ /* do nothing */;
++ return fmt;
++}
++
++static const char *consume_argn(const char *fmt, size_t *arg)
++{
++ const char *p = fmt;
++ size_t val = 0;
++
++ if (*p < '1' || *p > '9')
++ return fmt;
++ do {
++ val = 10*val + (*p++ - '0');
++ } while (*p >= '0' && *p <= '9');
++
++ if (*p != '$')
++ return fmt;
++ *arg = val;
++ return p+1;
++}
++
++static const char *consume_flags(const char *fmt)
++{
++ while (1) {
++ switch (*fmt) {
++ case '#':
++ case '0':
++ case '-':
++ case ' ':
++ case '+':
++ case '\'':
++ case 'I':
++ fmt++;
++ continue;
++ }
++ return fmt;
++ }
++}
++
++enum state {
++ BARE,
++ LPRE,
++ LLPRE,
++ HPRE,
++ HHPRE,
++ BIGLPRE,
++ ZTPRE,
++ JPRE,
++ STOP
++};
++
++enum type {
++ NONE,
++ PTR,
++ INT,
++ UINT,
++ ULLONG,
++ LONG,
++ ULONG,
++ SHORT,
++ USHORT,
++ CHAR,
++ UCHAR,
++ LLONG,
++ SIZET,
++ IMAX,
++ UMAX,
++ PDIFF,
++ UIPTR,
++ DBL,
++ LDBL,
++ MAXTYPE
++};
++
++static const short pa_types[MAXTYPE] = {
++ [NONE] = PA_INT,
++ [PTR] = PA_POINTER,
++ [INT] = PA_INT,
++ [UINT] = PA_INT,
++ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [LONG] = PA_INT | PA_FLAG_LONG,
++ [ULONG] = PA_INT | PA_FLAG_LONG,
++ [SHORT] = PA_INT | PA_FLAG_SHORT,
++ [USHORT] = PA_INT | PA_FLAG_SHORT,
++ [CHAR] = PA_CHAR,
++ [UCHAR] = PA_CHAR,
++ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [SIZET] = PA_INT | PA_FLAG_LONG,
++ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
++ [UIPTR] = PA_INT | PA_FLAG_LONG,
++ [DBL] = PA_DOUBLE,
++ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
++};
++
++#define S(x) [(x)-'A']
++#define E(x) (STOP + (x))
++
++static const unsigned char states[]['z'-'A'+1] = {
++ { /* 0: bare types */
++ S('d') = E(INT), S('i') = E(INT),
++ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(CHAR),S('C') = E(INT),
++ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
++ S('m') = E(NONE),
++ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
++ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
++ }, { /* 1: l-prefixed */
++ S('d') = E(LONG), S('i') = E(LONG),
++ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
++ S('l') = LLPRE
++ }, { /* 2: ll-prefixed */
++ S('d') = E(LLONG), S('i') = E(LLONG),
++ S('o') = E(ULLONG),S('u') = E(ULLONG),
++ S('x') = E(ULLONG),S('X') = E(ULLONG),
++ S('n') = E(PTR)
++ }, { /* 3: h-prefixed */
++ S('d') = E(SHORT), S('i') = E(SHORT),
++ S('o') = E(USHORT),S('u') = E(USHORT),
++ S('x') = E(USHORT),S('X') = E(USHORT),
++ S('n') = E(PTR),
++ S('h') = HHPRE
++ }, { /* 4: hh-prefixed */
++ S('d') = E(CHAR), S('i') = E(CHAR),
++ S('o') = E(UCHAR),S('u') = E(UCHAR),
++ S('x') = E(UCHAR),S('X') = E(UCHAR),
++ S('n') = E(PTR)
++ }, { /* 5: L-prefixed */
++ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
++ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
++ S('n') = E(PTR)
++ }, { /* 6: z- or t-prefixed (assumed to be same size) */
++ S('d') = E(PDIFF),S('i') = E(PDIFF),
++ S('o') = E(SIZET),S('u') = E(SIZET),
++ S('x') = E(SIZET),S('X') = E(SIZET),
++ S('n') = E(PTR)
++ }, { /* 7: j-prefixed */
++ S('d') = E(IMAX), S('i') = E(IMAX),
++ S('o') = E(UMAX), S('u') = E(UMAX),
++ S('x') = E(UMAX), S('X') = E(UMAX),
++ S('n') = E(PTR)
++ }
++};
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types)
++{
++ size_t i = 0;
++ size_t last = 0;
++
++ memset(types, 0, n);
++
++ while (1) {
++ size_t arg;
++ unsigned int state;
++
++ fmt = consume_nonarg(fmt);
++ if (*fmt == '\0')
++ break;
++ if (*fmt == '%') {
++ fmt++;
++ continue;
++ }
++ arg = 0;
++ fmt = consume_argn(fmt, &arg);
++ /* flags */
++ fmt = consume_flags(fmt);
++ /* width */
++ if (*fmt == '*') {
++ size_t warg = 0;
++ fmt = consume_argn(fmt+1, &warg);
++ if (warg == 0)
++ warg = ++i;
++ if (warg > last)
++ last = warg;
++ if (warg <= n && types[warg-1] == NONE)
++ types[warg-1] = INT;
++ } else
++ fmt = consume_num(fmt);
++ /* precision */
++ if (*fmt == '.') {
++ fmt++;
++ if (*fmt == '*') {
++ size_t parg = 0;
++ fmt = consume_argn(fmt+1, &parg);
++ if (parg == 0)
++ parg = ++i;
++ if (parg > last)
++ last = parg;
++ if (parg <= n && types[parg-1] == NONE)
++ types[parg-1] = INT;
++ } else {
++ if (*fmt == '-')
++ fmt++;
++ fmt = consume_num(fmt);
++ }
++ }
++ /* length modifier and conversion specifier */
++ state = BARE;
++ do {
++ unsigned char c = *fmt++;
++
++ if (c < 'A' || c > 'z')
++ continue;
++ state = states[state]S(c);
++ if (state == 0)
++ continue;
++ } while (state < STOP);
++
++ if (state == E(NONE))
++ continue;
++
++ if (arg == 0)
++ arg = ++i;
++ if (arg > last)
++ last = arg;
++ if (arg <= n)
++ types[arg-1] = state - STOP;
++ }
++
++ if (last > n)
++ last = n;
++ for (i = 0; i < last; i++)
++ types[i] = pa_types[types[i]];
++
++ return last;
++}
+diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
+new file mode 100644
+index 000000000..47be7522d
+--- /dev/null
++++ b/src/basic/parse-printf-format.h
+@@ -0,0 +1,57 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the GNU C Library
++ Copyright 1991-2014 Free Software Foundation, Inc.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#pragma once
++
++#include "config.h"
++
++#if HAVE_PRINTF_H
++#include <printf.h>
++#else
++
++#include <stddef.h>
++
++enum { /* C type: */
++ PA_INT, /* int */
++ PA_CHAR, /* int, cast to char */
++ PA_WCHAR, /* wide char */
++ PA_STRING, /* const char *, a '\0'-terminated string */
++ PA_WSTRING, /* const wchar_t *, wide character string */
++ PA_POINTER, /* void * */
++ PA_FLOAT, /* float */
++ PA_DOUBLE, /* double */
++ PA_LAST
++};
++
++/* Flag bits that can be set in a type returned by `parse_printf_format'. */
++#define PA_FLAG_MASK 0xff00
++#define PA_FLAG_LONG_LONG (1 << 8)
++#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
++#define PA_FLAG_LONG (1 << 9)
++#define PA_FLAG_SHORT (1 << 10)
++#define PA_FLAG_PTR (1 << 11)
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types);
++
++#endif /* HAVE_PRINTF_H */
+diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
+index dbfafba26..8038380d6 100644
+--- a/src/basic/stdio-util.h
++++ b/src/basic/stdio-util.h
+@@ -20,12 +20,12 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#include <printf.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ #include "macro.h"
++#include "parse-printf-format.h"
+
+ #define xsprintf(buf, fmt, ...) \
+ assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), "xsprintf: " #buf "[] must be big enough")
+diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
+index 73329ba02..70bb9e0e8 100644
+--- a/src/journal/journal-send.c
++++ b/src/journal/journal-send.c
+@@ -20,7 +20,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <printf.h>
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+@@ -39,6 +38,7 @@
+ #include "stdio-util.h"
+ #include "string-util.h"
+ #include "util.h"
++#include "parse-printf-format.h"
+
+ #define SNDBUF_SIZE (8*1024*1024)
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch b/poky/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
new file mode 100644
index 000000000..9f62cbbe6
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0014-src-basic-missing.h-check-for-missing-strndupa.patch
@@ -0,0 +1,118 @@
+From 33be9052315cc4ec8e929fa238e1f0cc0161ad07 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:15:28 -0800
+Subject: [PATCH] src/basic/missing.h: check for missing strndupa
+
+include missing.h for definition of strndupa
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/missing.h | 11 +++++++++++
+ src/basic/mkdir.c | 1 +
+ src/basic/parse-util.c | 1 +
+ src/basic/procfs-util.c | 1 +
+ src/shared/pager.c | 1 +
+ src/shared/uid-range.c | 1 +
+ 7 files changed, 17 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 4eabaafe8..12811b3f3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -525,6 +525,7 @@ foreach ident : [
+ ['bpf', '''#include <sys/syscall.h>
+ #include <unistd.h>'''],
+ ['explicit_bzero' , '''#include <string.h>'''],
++ ['strndupa' , '''#include <string.h>'''],
+ ]
+
+ have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 84d6d9167..07a8c8364 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1187,6 +1187,17 @@ struct input_mask {
+ typedef int32_t key_serial_t;
+ #endif
+
++#if ! HAVE_STRNDUPA
++#define strndupa(s, n) \
++ ({ \
++ const char *__old = (s); \
++ size_t __len = strnlen(__old, (n)); \
++ char *__new = (char *)alloca(__len + 1); \
++ __new[__len] = '\0'; \
++ (char *)memcpy(__new, __old, __len); \
++ })
++#endif
++
+ #ifndef KEYCTL_JOIN_SESSION_KEYRING
+ #define KEYCTL_JOIN_SESSION_KEYRING 1
+ #endif
+diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
+index de4746c86..d51518a5a 100644
+--- a/src/basic/mkdir.c
++++ b/src/basic/mkdir.c
+@@ -30,6 +30,7 @@
+ #include "path-util.h"
+ #include "stat-util.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, bool follow_symlink, mkdir_func_t _mkdir) {
+ struct stat st;
+diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
+index 2c22753de..97533721d 100644
+--- a/src/basic/parse-util.c
++++ b/src/basic/parse-util.c
+@@ -33,6 +33,7 @@
+ #include "parse-util.h"
+ #include "process-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int parse_boolean(const char *v) {
+ assert(v);
+diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
+index 9bb42cc7b..23bbd9e67 100644
+--- a/src/basic/procfs-util.c
++++ b/src/basic/procfs-util.c
+@@ -9,6 +9,7 @@
+ #include "procfs-util.h"
+ #include "stdio-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int procfs_tasks_get_limit(uint64_t *ret) {
+ _cleanup_free_ char *value = NULL;
+diff --git a/src/shared/pager.c b/src/shared/pager.c
+index 75db3c985..84f06bf7d 100644
+--- a/src/shared/pager.c
++++ b/src/shared/pager.c
+@@ -39,6 +39,7 @@
+ #include "string-util.h"
+ #include "strv.h"
+ #include "terminal-util.h"
++#include "missing.h"
+
+ static pid_t pager_pid = 0;
+
+diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
+index c38b7cc98..8ec6bf08d 100644
+--- a/src/shared/uid-range.c
++++ b/src/shared/uid-range.c
+@@ -25,6 +25,7 @@
+ #include "macro.h"
+ #include "uid-range.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
+ assert(range);
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/poky/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
new file mode 100644
index 000000000..450947667
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
@@ -0,0 +1,157 @@
+From b45cf4923c7e1f1165925e9b4d7db2108faf2eae Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Mon, 23 Oct 2017 10:50:14 -0700
+Subject: [PATCH 15/31] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
+ defined
+
+If the standard library doesn't provide brace
+expansion users just won't get it.
+
+Dont use GNU GLOB extentions on non-glibc systems
+
+Conditionalize use of GLOB_ALTDIRFUNC
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/glob-util.c | 20 +++++++++++++++++---
+ src/test/test-glob-util.c | 17 +++++++++++++++--
+ src/tmpfiles/tmpfiles.c | 8 ++++++++
+ 3 files changed, 40 insertions(+), 5 deletions(-)
+
+diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
+index 6e80a1e23..312bb3fd1 100644
+--- a/src/basic/glob-util.c
++++ b/src/basic/glob-util.c
+@@ -28,13 +28,18 @@
+ #include "macro.h"
+ #include "path-util.h"
+ #include "strv.h"
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
+
+ int safe_glob(const char *path, int flags, glob_t *pglob) {
+ int k;
+
++#ifdef GLOB_ALTDIRFUNC
+ /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
+ assert(!(flags & GLOB_ALTDIRFUNC));
+-
+ if (!pglob->gl_closedir)
+ pglob->gl_closedir = (void (*)(void *)) closedir;
+ if (!pglob->gl_readdir)
+@@ -45,10 +50,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
+ pglob->gl_lstat = lstat;
+ if (!pglob->gl_stat)
+ pglob->gl_stat = stat;
+-
++#endif
+ errno = 0;
++#ifdef GLOB_ALTDIRFUNC
+ k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
+-
++#else
++ k = glob(path, flags, NULL, pglob);
++#endif
+ if (k == GLOB_NOMATCH)
+ return -ENOENT;
+ if (k == GLOB_NOSPACE)
+@@ -61,6 +69,12 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
+ return 0;
+ }
+
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
++
+ int glob_exists(const char *path) {
+ _cleanup_globfree_ glob_t g = {};
+ int k;
+diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
+index bd2f8fcfd..a10c77427 100644
+--- a/src/test/test-glob-util.c
++++ b/src/test/test-glob-util.c
+@@ -30,6 +30,11 @@
+ #include "glob-util.h"
+ #include "macro.h"
+ #include "rm-rf.h"
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
+
+ static void test_glob_exists(void) {
+ char name[] = "/tmp/test-glob_exists.XXXXXX";
+@@ -52,25 +57,33 @@ static void test_glob_exists(void) {
+ static void test_glob_no_dot(void) {
+ char template[] = "/tmp/test-glob-util.XXXXXXX";
+ const char *fn;
+-
+ _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+ .gl_closedir = (void (*)(void *)) closedir,
+ .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
+ .gl_opendir = (void *(*)(const char *)) opendir,
+ .gl_lstat = lstat,
+ .gl_stat = stat,
++#endif
+ };
+-
+ int r;
+
+ assert_se(mkdtemp(template));
+
+ fn = strjoina(template, "/*");
++#ifdef GLOB_ALTDIRFUNC
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
++#else
++ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
++#endif
+ assert_se(r == GLOB_NOMATCH);
+
+ fn = strjoina(template, "/.*");
++#ifdef GLOB_ALTDIRFUNC
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
++#else
++ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
++#endif
+ assert_se(r == GLOB_NOMATCH);
+
+ (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
+diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
+index 38cbb739c..88cc543f0 100644
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -76,6 +76,12 @@
+ #include "umask-util.h"
+ #include "user-util.h"
+ #include "util.h"
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
++
+
+ /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
+ * them in the file system. This is intended to be used to create
+@@ -1288,7 +1294,9 @@ static int item_do_children(Item *i, const char *path, action_t action) {
+
+ static int glob_item(Item *i, action_t action, bool recursive) {
+ _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+ .gl_opendir = (void *(*)(const char *)) opendir_nomod,
++#endif
+ };
+ int r = 0, k;
+ char **fn;
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch b/poky/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
new file mode 100644
index 000000000..53037ea6d
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
@@ -0,0 +1,47 @@
+From efc57856f961c1f3bf016c511c53d990db8abdff Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Mon, 23 Oct 2017 11:31:03 -0700
+Subject: [PATCH 16/31] src/basic/missing.h: check for missing __compar_fn_t
+ typedef
+
+include missing.h for missing __compar_fn_t
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/missing.h | 5 +++++
+ src/basic/strbuf.c | 1 +
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 07a8c8364..1aee3346a 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1162,6 +1162,11 @@ struct input_mask {
+ #define RENAME_NOREPLACE (1 << 0)
+ #endif
+
++#ifndef __COMPAR_FN_T
++#define __COMPAR_FN_T
++typedef int (*__compar_fn_t)(const void *, const void *);
++#endif
++
+ #ifndef KCMP_FILE
+ #define KCMP_FILE 0
+ #endif
+diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
+index 8befffa66..bcb860f95 100644
+--- a/src/basic/strbuf.c
++++ b/src/basic/strbuf.c
+@@ -24,6 +24,7 @@
+
+ #include "alloc-util.h"
+ #include "strbuf.h"
++#include "missing.h"
+
+ /*
+ * Strbuf stores given strings in a single continuous allocated memory
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch b/poky/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch
new file mode 100644
index 000000000..a09cfddaa
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0017-Include-netinet-if_ether.h.patch
@@ -0,0 +1,85 @@
+From f2b0173cd9807864db1ef3b102abaa76ef37e506 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:19:12 -0800
+Subject: [PATCH 17/31] Include netinet/if_ether.h
+
+Fixes
+/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
+ struct ethhdr {
+ ^~~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/libsystemd/sd-netlink/netlink-types.c | 1 +
+ src/network/netdev/tuntap.c | 1 +
+ src/network/networkd-brvlan.c | 1 +
+ src/udev/net/ethtool-util.c | 1 +
+ src/udev/udev-builtin-net_setup_link.c | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
+index 0ee7d6f0d..ef75893a6 100644
+--- a/src/libsystemd/sd-netlink/netlink-types.c
++++ b/src/libsystemd/sd-netlink/netlink-types.c
+@@ -21,6 +21,7 @@
+ #include <netinet/in.h>
+ #include <stdint.h>
+ #include <sys/socket.h>
++#include <netinet/if_ether.h>
+ #include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/genetlink.h>
+diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
+index 4fc9b610a..628c61c57 100644
+--- a/src/network/netdev/tuntap.c
++++ b/src/network/netdev/tuntap.c
+@@ -20,6 +20,7 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#include <netinet/if_ether.h>
+ #include <linux/if_tun.h>
+ #include <net/if.h>
+ #include <netinet/if_ether.h>
+diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
+index 99dd41629..90407c9d8 100644
+--- a/src/network/networkd-brvlan.c
++++ b/src/network/networkd-brvlan.c
+@@ -19,6 +19,7 @@
+ ***/
+
+ #include <netinet/in.h>
++#include <netinet/if_ether.h>
+ #include <linux/if_bridge.h>
+ #include <stdbool.h>
+
+diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
+index 9bdaef8d9..948f89cf8 100644
+--- a/src/udev/net/ethtool-util.c
++++ b/src/udev/net/ethtool-util.c
+@@ -18,6 +18,7 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <netinet/if_ether.h>
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+ #include <linux/ethtool.h>
+diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
+index 40158e0af..b24b3fce8 100644
+--- a/src/udev/udev-builtin-net_setup_link.c
++++ b/src/udev/udev-builtin-net_setup_link.c
+@@ -18,6 +18,7 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <netinet/if_ether.h>
+ #include "alloc-util.h"
+ #include "link-config.h"
+ #include "log.h"
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch b/poky/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch
new file mode 100644
index 000000000..ab7edf5ca
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0018-check-for-missing-canonicalize_file_name.patch
@@ -0,0 +1,47 @@
+From 690eeef9590c7ef1d9d2c31d8c1d5d8071da8c4c Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 26 Feb 2018 17:21:11 +0800
+Subject: [PATCH 18/31] check for missing canonicalize_file_name
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 2 ++
+ src/basic/missing_syscall.h | 6 ++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 12811b3f3..f6515e97c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -520,6 +520,8 @@ foreach ident : [
+ ['kcmp', '''#include <linux/kcmp.h>'''],
+ ['keyctl', '''#include <sys/types.h>
+ #include <keyutils.h>'''],
++ ['canonicalize_file_name', '''#define _GNU_SOURCE
++ #include <stdlib.h>'''],
+ ['copy_file_range', '''#include <sys/syscall.h>
+ #include <unistd.h>'''],
+ ['bpf', '''#include <sys/syscall.h>
+diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h
+index c938d0d97..308b9472b 100644
+--- a/src/basic/missing_syscall.h
++++ b/src/basic/missing_syscall.h
+@@ -31,6 +31,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
+ }
+ #endif
+
++#if !HAVE_CANONICALIZE_FILE_NAME
++static inline char *canonicalize_file_name(const char *path) {
++ return realpath(path, NULL);
++}
++#endif
++
+ /* ======================================================================= */
+
+ #if !HAVE_MEMFD_CREATE
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch b/poky/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
new file mode 100644
index 000000000..16b21a068
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
@@ -0,0 +1,29 @@
+From f5f313915d78bc43eb96e2aafb8ce3cda304c277 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 26 Feb 2018 17:27:56 +0800
+Subject: [PATCH 19/31] Do not enable nss tests if nss-systemd is not enabled
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/test/meson.build b/src/test/meson.build
+index 1db8aa107..df3a1f5c5 100644
+--- a/src/test/meson.build
++++ b/src/test/meson.build
+@@ -646,7 +646,7 @@ tests += [
+ [['src/test/test-nss.c'],
+ [],
+ [libdl],
+- '', 'manual'],
++ 'ENABLE_NSS_SYSTEMD', 'manual'],
+ ]
+
+ ############################################################
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch b/poky/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
new file mode 100644
index 000000000..ad49cfe8f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
@@ -0,0 +1,28 @@
+From d63d2fedcd80e58ee53655aeaf2836d4b0a14652 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Oct 2017 12:33:22 -0700
+Subject: [PATCH 20/31] test-hexdecoct.c: Include missing.h for strndupa
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/test-hexdecoct.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
+index 3e25a0bac..ab3e508f1 100644
+--- a/src/test/test-hexdecoct.c
++++ b/src/test/test-hexdecoct.c
+@@ -24,6 +24,7 @@
+ #include "hexdecoct.h"
+ #include "macro.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ static void test_hexchar(void) {
+ assert_se(hexchar(0xa) == 'a');
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch b/poky/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
new file mode 100644
index 000000000..9c8aeca9a
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
@@ -0,0 +1,42 @@
+From dfea4b98844795a0cd14fdaf40c67df389dbd27e Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:25:22 -0800
+Subject: [PATCH 21/31] test-sizeof.c: Disable tests for missing typedefs in
+ musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/test-sizeof.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
+index aed6db842..0de6fa63c 100644
+--- a/src/test/test-sizeof.c
++++ b/src/test/test-sizeof.c
+@@ -50,8 +50,10 @@ int main(void) {
+ info(unsigned);
+ info(long unsigned);
+ info(long long unsigned);
++#ifdef __GLIBC__
+ info(__syscall_ulong_t);
+ info(__syscall_slong_t);
++#endif
+
+ info(float);
+ info(double);
+@@ -61,7 +63,9 @@ int main(void) {
+ info(ssize_t);
+ info(time_t);
+ info(usec_t);
++#ifdef __GLIBC__
+ info(__time_t);
++#endif
+ info(pid_t);
+ info(uid_t);
+ info(gid_t);
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch b/poky/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch
new file mode 100644
index 000000000..a5f74421a
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0022-don-t-use-glibc-specific-qsort_r.patch
@@ -0,0 +1,105 @@
+From d343757d629402c70ca8e5eaa551deaf175c96f3 Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Thu, 18 Sep 2014 15:24:56 +0200
+Subject: [PATCH 22/31] don't use glibc-specific qsort_r
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/hwdb/hwdb.c | 18 +++++++++++-------
+ src/udev/udevadm-hwdb.c | 16 ++++++++++------
+ 2 files changed, 21 insertions(+), 13 deletions(-)
+
+diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
+index 4540260f9..81aca7a9b 100644
+--- a/src/hwdb/hwdb.c
++++ b/src/hwdb/hwdb.c
+@@ -152,13 +152,12 @@ static void trie_free(struct trie *trie) {
+
+ DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
+
+-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
++static struct trie *trie_node_add_value_trie;
++static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *val1 = v1;
+ const struct trie_value_entry *val2 = v2;
+- struct trie *trie = arg;
+-
+- return strcmp(trie->strings->buf + val1->key_off,
+- trie->strings->buf + val2->key_off);
++ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
++ trie_node_add_value_trie->strings->buf + val2->key_off);
+ }
+
+ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+@@ -183,7 +182,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ .value_off = v,
+ };
+
+- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
++
+ if (val) {
+ /* At this point we have 2 identical properties on the same match-string.
+ * Since we process files in order, we just replace the previous value.
+@@ -208,7 +210,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ node->values[node->values_count].file_priority = file_priority;
+ node->values[node->values_count].line_number = line_number;
+ node->values_count++;
+- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ return 0;
+ }
+
+diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
+index ab5dc7ab6..c777e30ab 100644
+--- a/src/udev/udevadm-hwdb.c
++++ b/src/udev/udevadm-hwdb.c
+@@ -130,13 +130,13 @@ static void trie_node_cleanup(struct trie_node *node) {
+ free(node);
+ }
+
+-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
++static struct trie *trie_node_add_value_trie;
++static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *val1 = v1;
+ const struct trie_value_entry *val2 = v2;
+- struct trie *trie = arg;
+
+- return strcmp(trie->strings->buf + val1->key_off,
+- trie->strings->buf + val2->key_off);
++ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
++ trie_node_add_value_trie->strings->buf + val2->key_off);
+ }
+
+ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+@@ -157,7 +157,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ .value_off = v,
+ };
+
+- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ if (val) {
+ /* replace existing earlier key with new value */
+ val->value_off = v;
+@@ -174,7 +176,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ node->values[node->values_count].key_off = k;
+ node->values[node->values_count].value_off = v;
+ node->values_count++;
+- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ return 0;
+ }
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/poky/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
new file mode 100644
index 000000000..09c2b5c10
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
@@ -0,0 +1,99 @@
+From 7b802ada1207ed00ed3867b9804dd0f316641b9b Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 10 Oct 2017 14:33:30 -0700
+Subject: [PATCH 23/31] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
+
+Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
+thing to do and it's not portable (not supported by musl). See:
+
+ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
+ http://www.openwall.com/lists/musl/2015/02/05/2
+
+Note that laccess() is never passing AT_EACCESS so a lot of the
+discussion in the links above doesn't apply. Note also that
+(currently) all systemd callers of laccess() pass mode as F_OK, so
+only check for existence of a file, not access permissions.
+Therefore, in this case, the only distiction between faccessat()
+with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the behaviour
+for broken symlinks; laccess() on a broken symlink will succeed with
+(flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
+
+The laccess() macros was added to systemd some time ago and it's not
+clear if or why it needs to return success for broken symlinks. Maybe
+just historical and not actually necessary or desired behaviour?
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ src/basic/fs-util.h | 22 +++++++++++++++++++++-
+ src/shared/base-filesystem.c | 6 +++---
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
+index 4dba1ea56..9c4b02ecc 100644
+--- a/src/basic/fs-util.h
++++ b/src/basic/fs-util.h
+@@ -50,7 +50,27 @@ int fchmod_umask(int fd, mode_t mode);
+
+ int fd_warn_permissions(const char *path, int fd);
+
+-#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
++/*
++ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
++ do and it's not portable (not supported by musl). See:
++
++ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
++ http://www.openwall.com/lists/musl/2015/02/05/2
++
++ Note that laccess() is never passing AT_EACCESS so a lot of the discussion in
++ the links above doesn't apply. Note also that (currently) all systemd callers
++ of laccess() pass mode as F_OK, so only check for existence of a file, not
++ access permissions. Therefore, in this case, the only distiction between
++ faccessat() with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the
++ behaviour for broken symlinks; laccess() on a broken symlink will succeed
++ with (flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
++
++ The laccess() macros was added to systemd some time ago and it's not clear if
++ or why it needs to return success for broken symlinks. Maybe just historical
++ and not actually necessary or desired behaviour?
++*/
++
++#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), 0)
+
+ int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
+ int touch(const char *path);
+diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
+index 3c25aa534..574ca71c7 100644
+--- a/src/shared/base-filesystem.c
++++ b/src/shared/base-filesystem.c
+@@ -71,7 +71,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+ return log_error_errno(errno, "Failed to open root file system: %m");
+
+ for (i = 0; i < ELEMENTSOF(table); i ++) {
+- if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
++ if (faccessat(fd, table[i].dir, F_OK, 0) >= 0)
+ continue;
+
+ if (table[i].target) {
+@@ -79,7 +79,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+
+ /* check if one of the targets exists */
+ NULSTR_FOREACH(s, table[i].target) {
+- if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
++ if (faccessat(fd, s, F_OK, 0) < 0)
+ continue;
+
+ /* check if a specific file exists at the target path */
+@@ -90,7 +90,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+ if (!p)
+ return log_oom();
+
+- if (faccessat(fd, p, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
++ if (faccessat(fd, p, F_OK, 0) < 0)
+ continue;
+ }
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/poky/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
new file mode 100644
index 000000000..fe7e623ff
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
@@ -0,0 +1,31 @@
+From 76c71aa889155f29be1d5d2b74a2c4faa5909c8c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 12 Sep 2015 18:53:31 +0000
+Subject: [PATCH 24/31] comparison_fn_t is glibc specific, use raw signature in
+ function pointer
+
+make it work with musl where comparison_fn_t is not provided
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/util.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/util.h b/src/basic/util.h
+index 9d1b10756..12db53a93 100644
+--- a/src/basic/util.h
++++ b/src/basic/util.h
+@@ -95,7 +95,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
+ * Normal qsort requires base to be nonnull. Here were require
+ * that only if nmemb > 0.
+ */
+-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
++static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+ if (nmemb <= 1)
+ return;
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch b/poky/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch
new file mode 100644
index 000000000..9376a8f75
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch
@@ -0,0 +1,43 @@
+From a0b1496322f4d7ce83f4fbfd2a90b91d0721f643 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 24 Oct 2017 23:08:24 -0700
+Subject: [PATCH 25/31] Define _PATH_WTMPX and _PATH_UTMPX if not defined
+
+Musl needs these defines
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/shared/utmp-wtmp.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
+index cab1cd6a2..f5eedac18 100644
+--- a/src/shared/utmp-wtmp.c
++++ b/src/shared/utmp-wtmp.c
+@@ -28,6 +28,7 @@
+ #include <sys/time.h>
+ #include <sys/utsname.h>
+ #include <unistd.h>
++#include <utmp.h>
+ #include <utmpx.h>
+
+ #include "alloc-util.h"
+@@ -42,6 +43,13 @@
+ #include "util.h"
+ #include "utmp-wtmp.h"
+
++#if defined _PATH_UTMP && !defined _PATH_UTMPX
++# define _PATH_UTMPX _PATH_UTMP
++#endif
++#if defined _PATH_WTMP && !defined _PATH_WTMPX
++# define _PATH_WTMPX _PATH_WTMP
++#endif
++
+ int utmp_get_runlevel(int *runlevel, int *previous) {
+ struct utmpx *found, lookup = { .ut_type = RUN_LVL };
+ int r;
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch b/poky/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
new file mode 100644
index 000000000..46d75ada7
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0026-Use-uintmax_t-for-handling-rlim_t.patch
@@ -0,0 +1,89 @@
+From 88c48ea84db6fda19dfaeb64545fccf8fa0525ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 27 Oct 2017 13:00:41 -0700
+Subject: [PATCH 26/31] Use uintmax_t for handling rlim_t
+
+PRIu{32,64} is not right format to represent rlim_t type
+therefore use %ju and typecast the rlim_t variables to
+uintmax_t.
+
+Fixes portablility errors like
+
+execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
+| fprintf(f, "%s%s: " RLIM_FMT "\n",
+| ^~~~~~~~
+| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
+| ~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/7199]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/format-util.h | 8 --------
+ src/basic/rlimit-util.c | 8 ++++----
+ src/core/execute.c | 8 ++++----
+ 3 files changed, 8 insertions(+), 16 deletions(-)
+
+diff --git a/src/basic/format-util.h b/src/basic/format-util.h
+index d9a78f781..9a1bc21d7 100644
+--- a/src/basic/format-util.h
++++ b/src/basic/format-util.h
+@@ -61,14 +61,6 @@
+ # define PRI_TIMEX "li"
+ #endif
+
+-#if SIZEOF_RLIM_T == 8
+-# define RLIM_FMT "%" PRIu64
+-#elif SIZEOF_RLIM_T == 4
+-# define RLIM_FMT "%" PRIu32
+-#else
+-# error Unknown rlim_t size
+-#endif
+-
+ #if SIZEOF_DEV_T == 8
+ # define DEV_FMT "%" PRIu64
+ #elif SIZEOF_DEV_T == 4
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index 00648211d..df3d9ecc1 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -286,13 +286,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
+ if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
+ s = strdup("infinity");
+ else if (rl->rlim_cur >= RLIM_INFINITY)
+- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
++ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max);
+ else if (rl->rlim_max >= RLIM_INFINITY)
+- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
++ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur);
+ else if (rl->rlim_cur == rl->rlim_max)
+- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
++ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur);
+ else
+- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
++ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
+
+ if (!s)
+ return -ENOMEM;
+diff --git a/src/core/execute.c b/src/core/execute.c
+index 0df3971df..aabdddb68 100644
+--- a/src/core/execute.c
++++ b/src/core/execute.c
+@@ -3991,10 +3991,10 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
+
+ for (i = 0; i < RLIM_NLIMITS; i++)
+ if (c->rlimit[i]) {
+- fprintf(f, "%s%s: " RLIM_FMT "\n",
+- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
+- fprintf(f, "%s%sSoft: " RLIM_FMT "\n",
+- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
++ fprintf(f, "%s%s: %ju\n",
++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
++ fprintf(f, "%s%sSoft: %ju\n",
++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
+ }
+
+ if (c->ioprio_set) {
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch b/poky/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch
new file mode 100644
index 000000000..42f59b082
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0027-remove-nobody-user-group-checking.patch
@@ -0,0 +1,63 @@
+From 5354eb767d1eba2ec41eb273f6b657f4a630ca8a Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 9 Jan 2018 14:45:46 +0800
+Subject: [PATCH 27/31] remove nobody user/group checking
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 37 -------------------------------------
+ 1 file changed, 37 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f6515e97c..1b947adac 100644
+--- a/meson.build
++++ b/meson.build
+@@ -700,43 +700,6 @@ substs.set('containeruidbasemax', container_uid_base_max)
+ nobody_user = get_option('nobody-user')
+ nobody_group = get_option('nobody-group')
+
+-getent_result = run_command('getent', 'passwd', '65534')
+-if getent_result.returncode() == 0
+- name = getent_result.stdout().split(':')[0]
+- if name != nobody_user
+- message('WARNING:\n' +
+- ' The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
+- ' Your build will result in an user table setup that is incompatible with the local system.')
+- endif
+-endif
+-id_result = run_command('id', '-u', nobody_user)
+-if id_result.returncode() == 0
+- id = id_result.stdout().to_int()
+- if id != 65534
+- message('WARNING:\n' +
+- ' The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
+- ' Your build will result in an user table setup that is incompatible with the local system.')
+- endif
+-endif
+-
+-getent_result = run_command('getent', 'group', '65534')
+-if getent_result.returncode() == 0
+- name = getent_result.stdout().split(':')[0]
+- if name != nobody_group
+- message('WARNING:\n' +
+- ' The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
+- ' Your build will result in an group table setup that is incompatible with the local system.')
+- endif
+-endif
+-id_result = run_command('id', '-g', nobody_group)
+-if id_result.returncode() == 0
+- id = id_result.stdout().to_int()
+- if id != 65534
+- message('WARNING:\n' +
+- ' The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
+- ' Your build will result in an group table setup that is incompatible with the local system.')
+- endif
+-endif
+ if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
+ message('WARNING:\n' +
+ ' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch b/poky/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch
new file mode 100644
index 000000000..9ec3137b0
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0028-add-missing-FTW_-macros-for-musl.patch
@@ -0,0 +1,50 @@
+From 03cdd33be62db4c72a7fcf21b61d0d056c23c6a9 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:36:32 -0800
+Subject: [PATCH 28/31] add missing FTW_ macros for musl
+
+This is to avoid build failures like below for musl.
+
+ locale-util.c:296:24: error: 'FTW_STOP' undeclared
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 1aee3346a..5b9fde692 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -207,6 +207,26 @@ struct sockaddr_vm {
+ #define BTRFS_QGROUP_LEVEL_SHIFT 48
+ #endif
+
++#ifndef FTW_ACTIONRETVAL
++#define FTW_ACTIONRETVAL 16
++#endif
++
++#ifndef FTW_CONTINUE
++#define FTW_CONTINUE 0
++#endif
++
++#ifndef FTW_STOP
++#define FTW_STOP 1
++#endif
++
++#ifndef FTW_SKIP_SUBTREE
++#define FTW_SKIP_SUBTREE 2
++#endif
++
++#ifndef FTW_SKIP_SIBLINGS
++#define FTW_SKIP_SIBLINGS 3
++#endif
++
+ #if ! HAVE_LINUX_BTRFS_H
+ #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
+ struct btrfs_ioctl_qgroup_assign_args)
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch b/poky/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
new file mode 100644
index 000000000..517249f43
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
@@ -0,0 +1,43 @@
+From 5845c82d1016a3e3f2696180d5ac91b46950540a Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 12:56:21 +0800
+Subject: [PATCH 29/31] nss-mymachines: Build conditionally when
+ ENABLE_MYHOSTNAME is set
+
+Fixes build failures when building with --disable-myhostname
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 1b947adac..1ed4dde72 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1351,12 +1351,15 @@ test_dlopen = executable(
+ link_with : [libbasic],
+ dependencies : [libdl])
+
+-foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
+- ['systemd', 'ENABLE_NSS_SYSTEMD'],
+- ['mymachines', 'ENABLE_MACHINED'],
+- ['resolve', 'ENABLE_RESOLVE']]
++foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME', ''],
++ ['systemd', 'ENABLE_NSS_SYSTEMD', ''],
++ ['mymachines', 'ENABLE_MACHINED', 'ENABLE_MYHOSTNAME'],
++ ['resolve', 'ENABLE_RESOLVE', '']]
+
+ condition = tuple[1] == '' or conf.get(tuple[1]) == 1
++ if tuple[2] != '' and condition
++ condition = conf.get(tuple[2]) == 1
++ endif
+ if condition
+ module = tuple[0]
+
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch b/poky/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch
new file mode 100644
index 000000000..7f0b4bf81
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch
@@ -0,0 +1,45 @@
+From b7eacdf0388f930fc5271bdecfa46612c71dd65c Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 13:27:47 +0800
+Subject: [PATCH 30/31] fix missing of __register_atfork for non-glibc builds
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/process-util.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/basic/process-util.c b/src/basic/process-util.c
+index dc7c9ef9e..85ce8a0cc 100644
+--- a/src/basic/process-util.c
++++ b/src/basic/process-util.c
+@@ -39,6 +39,9 @@
+ #if HAVE_VALGRIND_VALGRIND_H
+ #include <valgrind/valgrind.h>
+ #endif
++#ifndef __GLIBC__
++#include <pthread.h>
++#endif
+
+ #include "alloc-util.h"
+ #include "architecture.h"
+@@ -1112,11 +1115,15 @@ void reset_cached_pid(void) {
+ cached_pid = CACHED_PID_UNSET;
+ }
+
++#ifdef __GLIBC__
+ /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
+ * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
+ * libpthread, as it is part of glibc anyway. */
+ extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
+ extern void* __dso_handle __attribute__ ((__weak__));
++#else
++#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)
++#endif
+
+ pid_t getpid_cached(void) {
+ pid_t current_value;
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch b/poky/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
new file mode 100644
index 000000000..319c4b65f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
@@ -0,0 +1,30 @@
+From adcd7e426fcd80e754274a730221d1a1f49dbc21 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 14:01:30 +0800
+Subject: [PATCH 31/31] fix missing ULONG_LONG_MAX definition in case of musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 5b9fde692..a922f1346 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -72,6 +72,10 @@ struct sockaddr_vm {
+ };
+ #endif /* !HAVE_LINUX_VM_SOCKETS_H */
+
++#ifndef ULONG_LONG_MAX
++#define ULONG_LONG_MAX ULLONG_MAX
++#endif
++
+ #ifndef RLIMIT_RTTIME
+ #define RLIMIT_RTTIME 15
+ #endif
+--
+2.13.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0032-memfd.patch b/poky/meta/recipes-core/systemd/systemd/0032-memfd.patch
new file mode 100644
index 000000000..f7cfd60a3
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0032-memfd.patch
@@ -0,0 +1,272 @@
+missing_syscall: when adding syscall replacements, use different names (
+
+#8229)
+
+In meson.build we check that functions are available using:
+ meson.get_compiler('c').has_function('foo')
+which checks the following:
+- if __stub_foo or __stub___foo are defined, return false
+- if foo is declared (a pointer to the function can be taken), return true
+- otherwise check for __builtin_memfd_create
+
+_stub is documented by glibc as
+ It defines a symbol '__stub_FUNCTION' for each function
+ in the C library which is a stub, meaning it will fail
+ every time called, usually setting errno to ENOSYS.
+
+So if __stub is defined, we know we don't want to use the glibc version, but
+this doesn't tell us if the name itself is defined or not. If it _is_ defined,
+and we define our replacement as an inline static function, we get an error:
+
+In file included from ../src/basic/missing.h:1358:0,
+ from ../src/basic/util.h:47,
+ from ../src/basic/calendarspec.h:29,
+ from ../src/basic/calendarspec.c:34:
+../src/basic/missing_syscall.h:65:19: error: static declaration of 'memfd_create' follows non-static declaration
+ static inline int memfd_create(const char *name, unsigned int flags) {
+ ^~~~~~~~~~~~
+.../usr/include/bits/mman-shared.h:46:5: note: previous declaration of 'memfd_create' was here
+ int memfd_create (const char *__name, unsigned int __flags) __THROW;
+ ^~~~~~~~~~~~
+
+To avoid this problem, call our inline functions different than glibc,
+and use a #define to map the official name to our replacement.
+
+Fixes #8099.
+
+v2:
+- use "missing_" as the prefix instead of "_"
+
+v3:
+- rebase and update for statx()
+
+ Unfortunately "statx" is also present in "struct statx", so the define
+ causes issues. Work around this by using a typedef.
+
+I checked that systemd compiles with current glibc
+(glibc-devel-2.26-24.fc27.x86_64) if HAVE_MEMFD_CREATE, HAVE_GETTID,
+HAVE_PIVOT_ROOT, HAVE_SETNS, HAVE_RENAMEAT2, HAVE_KCMP, HAVE_KEYCTL,
+HAVE_COPY_FILE_RANGE, HAVE_BPF, HAVE_STATX are forced to 0.
+
+Setting HAVE_NAME_TO_HANDLE_AT to 0 causes an issue, but it's not because of
+the define, but because of struct file_handle.
+
+
+backport https://github.com/systemd/systemd/commit/5187dd2c403caf92d09f3491e41f1ceb3f10491f
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [https://github.com/systemd/systemd/issues/8099]
+Index: git/src/basic/missing_syscall.h
+===================================================================
+--- git.orig/src/basic/missing_syscall.h
++++ git/src/basic/missing_syscall.h
+@@ -26,9 +26,11 @@
+ #include <sys/types.h>
+
+ #if !HAVE_PIVOT_ROOT
+-static inline int pivot_root(const char *new_root, const char *put_old) {
++static inline int missing_pivot_root(const char *new_root, const char *put_old) {
+ return syscall(SYS_pivot_root, new_root, put_old);
+ }
++
++# define pivot_root missing_pivot_root
+ #endif
+
+ #if !HAVE_CANONICALIZE_FILE_NAME
+@@ -68,7 +70,7 @@ static inline char *canonicalize_file_na
+ # endif
+ # endif
+
+-static inline int memfd_create(const char *name, unsigned int flags) {
++static inline int missing_memfd_create(const char *name, unsigned int flags) {
+ # ifdef __NR_memfd_create
+ return syscall(__NR_memfd_create, name, flags);
+ # else
+@@ -76,6 +78,8 @@ static inline int memfd_create(const cha
+ return -1;
+ # endif
+ }
++
++# define memfd_create missing_memfd_create
+ #endif
+
+ /* ======================================================================= */
+@@ -115,7 +119,7 @@ static inline int memfd_create(const cha
+ # endif
+ # endif
+
+-static inline int getrandom(void *buffer, size_t count, unsigned flags) {
++static inline int missing_getrandom(void *buffer, size_t count, unsigned flags) {
+ # ifdef __NR_getrandom
+ return syscall(__NR_getrandom, buffer, count, flags);
+ # else
+@@ -123,14 +127,18 @@ static inline int getrandom(void *buffer
+ return -1;
+ # endif
+ }
++
++# define getrandom missing_getrandom
+ #endif
+
+ /* ======================================================================= */
+
+ #if !HAVE_GETTID
+-static inline pid_t gettid(void) {
++static inline pid_t missing_gettid(void) {
+ return (pid_t) syscall(SYS_gettid);
+ }
++
++# define gettid missing_gettid
+ #endif
+
+ /* ======================================================================= */
+@@ -158,7 +166,7 @@ struct file_handle {
+ unsigned char f_handle[0];
+ };
+
+-static inline int name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
++static inline int missing_name_to_handle_at(int fd, const char *name, struct file_handle *handle, int *mnt_id, int flags) {
+ # ifdef __NR_name_to_handle_at
+ return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
+ # else
+@@ -166,6 +174,8 @@ static inline int name_to_handle_at(int
+ return -1;
+ # endif
+ }
++
++# define name_to_handle_at missing_name_to_handle_at
+ #endif
+
+ /* ======================================================================= */
+@@ -183,7 +193,7 @@ static inline int name_to_handle_at(int
+ # endif
+ # endif
+
+-static inline int setns(int fd, int nstype) {
++static inline int missing_setns(int fd, int nstype) {
+ # ifdef __NR_setns
+ return syscall(__NR_setns, fd, nstype);
+ # else
+@@ -191,6 +201,8 @@ static inline int setns(int fd, int nsty
+ return -1;
+ # endif
+ }
++
++# define setns missing_setns
+ #endif
+
+ /* ======================================================================= */
+@@ -236,7 +248,7 @@ static inline pid_t raw_getpid(void) {
+ # endif
+ # endif
+
+-static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
++static inline int missing_renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
+ # ifdef __NR_renameat2
+ return syscall(__NR_renameat2, oldfd, oldname, newfd, newname, flags);
+ # else
+@@ -244,12 +256,14 @@ static inline int renameat2(int oldfd, c
+ return -1;
+ # endif
+ }
++
++# define renameat2 missing_renameat2
+ #endif
+
+ /* ======================================================================= */
+
+ #if !HAVE_KCMP
+-static inline int kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
++static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
+ # ifdef __NR_kcmp
+ return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
+ # else
+@@ -257,36 +271,44 @@ static inline int kcmp(pid_t pid1, pid_t
+ return -1;
+ # endif
+ }
++
++# define kcmp missing_kcmp
+ #endif
+
+ /* ======================================================================= */
+
+ #if !HAVE_KEYCTL
+-static inline long keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) {
++static inline long missing_keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4,unsigned long arg5) {
+ # ifdef __NR_keyctl
+ return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
+ # else
+ errno = ENOSYS;
+ return -1;
+ # endif
++
++# define keyctl missing_keyctl
+ }
+
+-static inline key_serial_t add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
++static inline key_serial_t missing_add_key(const char *type, const char *description, const void *payload, size_t plen, key_serial_t ringid) {
+ # ifdef __NR_add_key
+ return syscall(__NR_add_key, type, description, payload, plen, ringid);
+ # else
+ errno = ENOSYS;
+ return -1;
+ # endif
++
++# define add_key missing_add_key
+ }
+
+-static inline key_serial_t request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
++static inline key_serial_t missing_request_key(const char *type, const char *description, const char * callout_info, key_serial_t destringid) {
+ # ifdef __NR_request_key
+ return syscall(__NR_request_key, type, description, callout_info, destringid);
+ # else
+ errno = ENOSYS;
+ return -1;
+ # endif
++
++# define request_key missing_request_key
+ }
+ #endif
+
+@@ -313,10 +335,10 @@ static inline key_serial_t request_key(c
+ # endif
+ # endif
+
+-static inline ssize_t copy_file_range(int fd_in, loff_t *off_in,
+- int fd_out, loff_t *off_out,
+- size_t len,
+- unsigned int flags) {
++static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in,
++ int fd_out, loff_t *off_out,
++ size_t len,
++ unsigned int flags) {
+ # ifdef __NR_copy_file_range
+ return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags);
+ # else
+@@ -324,6 +346,8 @@ static inline ssize_t copy_file_range(in
+ return -1;
+ # endif
+ }
++
++# define copy_file_range missing_copy_file_range
+ #endif
+
+ /* ======================================================================= */
+@@ -351,7 +375,7 @@ static inline ssize_t copy_file_range(in
+
+ union bpf_attr;
+
+-static inline int bpf(int cmd, union bpf_attr *attr, size_t size) {
++static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
+ #ifdef __NR_bpf
+ return (int) syscall(__NR_bpf, cmd, attr, size);
+ #else
+@@ -360,6 +384,7 @@ static inline int bpf(int cmd, union bpf
+ #endif
+ }
+
++# define bpf missing_bpf
+ #endif
+
+ /* ======================================================================= */
diff --git a/poky/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch b/poky/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch
new file mode 100644
index 000000000..59647b22f
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch
@@ -0,0 +1,203 @@
+From 848e863acc51ecfb0f3955c498874588201d9130 Mon Sep 17 00:00:00 2001
+From: Franck Bui <fbui@suse.com>
+Date: Thu, 15 Mar 2018 06:23:46 +0100
+Subject: [PATCH] basic/macros: rename noreturn into _noreturn_ (#8456)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+"noreturn" is reserved and can be used in other header files we include:
+
+ [ 16s] In file included from /usr/include/gcrypt.h:30:0,
+ [ 16s] from ../src/journal/journal-file.h:26,
+ [ 16s] from ../src/journal/journal-vacuum.c:31:
+ [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token
+ [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
+
+Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
+"noreturn" was defined in macro.h.
+---
+ src/basic/log.c | 4 ++--
+ src/basic/log.h | 4 ++--
+ src/basic/macro.h | 19 +++++++++----------
+ src/basic/process-util.c | 2 +-
+ src/basic/process-util.h | 2 +-
+ src/core/main.c | 4 ++--
+ src/journal/test-journal-interleaving.c | 2 +-
+ src/shared/pager.c | 2 +-
+ src/udev/collect/collect.c | 2 +-
+ 9 files changed, 20 insertions(+), 21 deletions(-)
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/pull/8456]
+
+diff --git a/src/basic/log.c b/src/basic/log.c
+index 7a7f2cbec..16a2431c5 100644
+--- a/src/basic/log.c
++++ b/src/basic/log.c
+@@ -814,7 +814,7 @@ static void log_assert(
+ log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
+ }
+
+-noreturn void log_assert_failed_realm(
++_noreturn_ void log_assert_failed_realm(
+ LogRealm realm,
+ const char *text,
+ const char *file,
+@@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
+ abort();
+ }
+
+-noreturn void log_assert_failed_unreachable_realm(
++_noreturn_ void log_assert_failed_unreachable_realm(
+ LogRealm realm,
+ const char *text,
+ const char *file,
+diff --git a/src/basic/log.h b/src/basic/log.h
+index efcf0f1bf..314be128a 100644
+--- a/src/basic/log.h
++++ b/src/basic/log.h
+@@ -186,7 +186,7 @@ int log_dump_internal(
+ char *buffer);
+
+ /* Logging for various assertions */
+-noreturn void log_assert_failed_realm(
++_noreturn_ void log_assert_failed_realm(
+ LogRealm realm,
+ const char *text,
+ const char *file,
+@@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
+ #define log_assert_failed(text, ...) \
+ log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
+
+-noreturn void log_assert_failed_unreachable_realm(
++_noreturn_ void log_assert_failed_unreachable_realm(
+ LogRealm realm,
+ const char *text,
+ const char *file,
+diff --git a/src/basic/macro.h b/src/basic/macro.h
+index 95be63a20..8911edfc4 100644
+--- a/src/basic/macro.h
++++ b/src/basic/macro.h
+@@ -53,6 +53,15 @@
+ #else
+ #define _fallthrough_
+ #endif
++/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
++ * compiler versions */
++#ifndef _noreturn_
++#if __STDC_VERSION__ >= 201112L
++#define _noreturn_ _Noreturn
++#else
++#define _noreturn_ __attribute__((noreturn))
++#endif
++#endif
+
+ /* Temporarily disable some warnings */
+ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
+@@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
+ #endif
+ #endif
+
+-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
+- * compiler versions */
+-#ifndef noreturn
+-#if __STDC_VERSION__ >= 201112L
+-#define noreturn _Noreturn
+-#else
+-#define noreturn __attribute__((noreturn))
+-#endif
+-#endif
+-
+ #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
+ static inline void func##p(type *p) { \
+ if (*p) \
+diff --git a/src/basic/process-util.c b/src/basic/process-util.c
+index aa9846db5..e6120af5b 100644
+--- a/src/basic/process-util.c
++++ b/src/basic/process-util.c
+@@ -987,7 +987,7 @@ bool is_main_thread(void) {
+ return cached > 0;
+ }
+
+-noreturn void freeze(void) {
++_noreturn_ void freeze(void) {
+
+ log_close();
+
+diff --git a/src/basic/process-util.h b/src/basic/process-util.h
+index 93029e36e..5170adec7 100644
+--- a/src/basic/process-util.h
++++ b/src/basic/process-util.h
+@@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
+
+ bool is_main_thread(void);
+
+-noreturn void freeze(void);
++_noreturn_ void freeze(void);
+
+ bool oom_score_adjust_is_valid(int oa);
+
+diff --git a/src/core/main.c b/src/core/main.c
+index 076846a41..4b2d14923 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
+ static sd_id128_t arg_machine_id = {};
+ static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
+
+-noreturn static void freeze_or_reboot(void) {
++_noreturn_ static void freeze_or_reboot(void) {
+
+ if (arg_crash_reboot) {
+ log_notice("Rebooting in 10s...");
+@@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
+ freeze();
+ }
+
+-noreturn static void crash(int sig) {
++_noreturn_ static void crash(int sig) {
+ struct sigaction sa;
+ pid_t pid;
+
+diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
+index 5a88b2774..d87bdbdd3 100644
+--- a/src/journal/test-journal-interleaving.c
++++ b/src/journal/test-journal-interleaving.c
+@@ -37,7 +37,7 @@
+
+ static bool arg_keep = false;
+
+-noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
++_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
+ log_internal(LOG_CRIT, error, file, line, func,
+ "'%s' failed at %s:%u (%s): %m", text, file, line, func);
+ abort();
+diff --git a/src/shared/pager.c b/src/shared/pager.c
+index 75db3c985..681af9c40 100644
+--- a/src/shared/pager.c
++++ b/src/shared/pager.c
+@@ -47,7 +47,7 @@ static int stored_stderr = -1;
+ static bool stdout_redirected = false;
+ static bool stderr_redirected = false;
+
+-noreturn static void pager_fallback(void) {
++_noreturn_ static void pager_fallback(void) {
+ int r;
+
+ r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
+diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
+index 2821640e9..c8fa47b3d 100644
+--- a/src/udev/collect/collect.c
++++ b/src/udev/collect/collect.c
+@@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
+ return container_of(node, struct _mate, node);
+ }
+
+-noreturn static void sig_alrm(int signo)
++_noreturn_ static void sig_alrm(int signo)
+ {
+ exit(4);
+ }
+--
+2.17.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch b/poky/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch
new file mode 100644
index 000000000..e56061f41
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0034-Fix-format-truncation-compile-failure-by-typecasting.patch
@@ -0,0 +1,173 @@
+From c2b3ebe112ebfd9f9e82fb1531ee225c3152ca83 Mon Sep 17 00:00:00 2001
+From: Patrick Uiterwijk <patrick@puiterwijk.org>
+Date: Thu, 22 Feb 2018 19:41:30 +0100
+Subject: [PATCH] Fix format-truncation compile failure by typecasting USB IDs
+ (#8250)
+
+This patch adds safe_atoux16 for parsing an unsigned hexadecimal 16bit int, and
+uses that for parsing USB device and vendor IDs.
+
+This fixes a compile error with gcc-8 because while we know that USB IDs are 2 bytes,
+the compiler does not know that.
+
+../src/udev/udev-builtin-hwdb.c:80:38: error: '%04X' directive output may be
+truncated writing between 4 and 8 bytes into a region of size between 2 and 6
+[-Werror=format-truncation=]
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/5547c12503a683290eaed47954ffcfb2d1bc03cd]
+
+Signed-off-by: Adam Williamson <awilliam@redhat.com>
+Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
+---
+ src/basic/parse-util.c | 24 ++++++++++++++++++++++
+ src/basic/parse-util.h | 2 ++
+ src/test/test-parse-util.c | 39 ++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin-hwdb.c | 13 ++++++------
+ 4 files changed, 71 insertions(+), 7 deletions(-)
+
+diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
+index 97533721d..ff3fc298a 100644
+--- a/src/basic/parse-util.c
++++ b/src/basic/parse-util.c
+@@ -532,6 +532,30 @@ int safe_atoi16(const char *s, int16_t *ret) {
+ return 0;
+ }
+
++int safe_atoux16(const char *s, uint16_t *ret) {
++ char *x = NULL;
++ unsigned long l;
++
++ assert(s);
++ assert(ret);
++
++ s += strspn(s, WHITESPACE);
++
++ errno = 0;
++ l = strtoul(s, &x, 16);
++ if (errno > 0)
++ return -errno;
++ if (!x || x == s || *x != 0)
++ return -EINVAL;
++ if (s[0] == '-')
++ return -ERANGE;
++ if ((unsigned long) (uint16_t) l != l)
++ return -ERANGE;
++
++ *ret = (uint16_t) l;
++ return 0;
++}
++
+ int safe_atod(const char *s, double *ret_d) {
+ _cleanup_(freelocalep) locale_t loc = (locale_t) 0;
+ char *x = NULL;
+diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h
+index 1eda1d7f9..727422056 100644
+--- a/src/basic/parse-util.h
++++ b/src/basic/parse-util.h
+@@ -54,6 +54,8 @@ int safe_atou8(const char *s, uint8_t *ret);
+ int safe_atou16(const char *s, uint16_t *ret);
+ int safe_atoi16(const char *s, int16_t *ret);
+
++int safe_atoux16(const char *s, uint16_t *ret);
++
+ static inline int safe_atou32(const char *s, uint32_t *ret_u) {
+ assert_cc(sizeof(uint32_t) == sizeof(unsigned));
+ return safe_atou(s, (unsigned*) ret_u);
+diff --git a/src/test/test-parse-util.c b/src/test/test-parse-util.c
+index 937500213..a99cea5a1 100644
+--- a/src/test/test-parse-util.c
++++ b/src/test/test-parse-util.c
+@@ -468,6 +468,44 @@ static void test_safe_atoi16(void) {
+ assert_se(r == -EINVAL);
+ }
+
++static void test_safe_atoux16(void) {
++ int r;
++ uint16_t l;
++
++ r = safe_atoux16("1234", &l);
++ assert_se(r == 0);
++ assert_se(l == 0x1234);
++
++ r = safe_atoux16("abcd", &l);
++ assert_se(r == 0);
++ assert_se(l == 0xabcd);
++
++ r = safe_atoux16(" 1234", &l);
++ assert_se(r == 0);
++ assert_se(l == 0x1234);
++
++ r = safe_atoux16("12345", &l);
++ assert_se(r == -ERANGE);
++
++ r = safe_atoux16("-1", &l);
++ assert_se(r == -ERANGE);
++
++ r = safe_atoux16(" -1", &l);
++ assert_se(r == -ERANGE);
++
++ r = safe_atoux16("junk", &l);
++ assert_se(r == -EINVAL);
++
++ r = safe_atoux16("123x", &l);
++ assert_se(r == -EINVAL);
++
++ r = safe_atoux16("12.3", &l);
++ assert_se(r == -EINVAL);
++
++ r = safe_atoux16("", &l);
++ assert_se(r == -EINVAL);
++}
++
+ static void test_safe_atou64(void) {
+ int r;
+ uint64_t l;
+@@ -745,6 +783,7 @@ int main(int argc, char *argv[]) {
+ test_safe_atolli();
+ test_safe_atou16();
+ test_safe_atoi16();
++ test_safe_atoux16();
+ test_safe_atou64();
+ test_safe_atoi64();
+ test_safe_atod();
+diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
+index ca7f7c230..dbfe02429 100644
+--- a/src/udev/udev-builtin-hwdb.c
++++ b/src/udev/udev-builtin-hwdb.c
+@@ -27,6 +27,7 @@
+
+ #include "alloc-util.h"
+ #include "hwdb-util.h"
++#include "parse-util.h"
+ #include "string-util.h"
+ #include "udev-util.h"
+ #include "udev.h"
+@@ -63,7 +64,7 @@ int udev_builtin_hwdb_lookup(struct udev_device *dev,
+
+ static const char *modalias_usb(struct udev_device *dev, char *s, size_t size) {
+ const char *v, *p;
+- int vn, pn;
++ uint16_t vn, pn;
+
+ v = udev_device_get_sysattr_value(dev, "idVendor");
+ if (!v)
+@@ -71,12 +72,10 @@ static const char *modalias_usb(struct udev_device *dev, char *s, size_t size) {
+ p = udev_device_get_sysattr_value(dev, "idProduct");
+ if (!p)
+ return NULL;
+- vn = strtol(v, NULL, 16);
+- if (vn <= 0)
+- return NULL;
+- pn = strtol(p, NULL, 16);
+- if (pn <= 0)
+- return NULL;
++ if (safe_atoux16(v, &vn) < 0)
++ return NULL;
++ if (safe_atoux16(p, &pn) < 0)
++ return NULL;
+ snprintf(s, size, "usb:v%04Xp%04X*", vn, pn);
+ return s;
+ }
+--
+2.17.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/poky/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch
new file mode 100644
index 000000000..736d525ad
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch
@@ -0,0 +1,33 @@
+From 5f1f064c81ea30acf93cfa0fb466b38f094f488c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 27 May 2018 08:36:44 -0700
+Subject: [PATCH] Define glibc compatible basename() for non-glibc systems
+
+Fixes builds with musl, even though systemd is adamant about
+using non-posix basename implementation, we have a way out
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/machine/machine-dbus.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
+index 2d7806491b..9a3bdb1d76 100644
+--- a/src/machine/machine-dbus.c
++++ b/src/machine/machine-dbus.c
+@@ -29,6 +29,10 @@
+ #include <libgen.h>
+ #undef basename
+
++#if !defined(__GLIBC__)
++#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
++#endif
++
+ #include "alloc-util.h"
+ #include "bus-common-errors.h"
+ #include "bus-internal.h"
+--
+2.17.0
+
diff --git a/poky/meta/recipes-core/systemd/systemd/init b/poky/meta/recipes-core/systemd/systemd/init
new file mode 100644
index 000000000..ea52be482
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/init
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: udev
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+. /etc/init.d/functions
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+readfile () {
+ filename=$1
+ READDATA=""
+ if [ -r $filename ]; then
+ while read line; do
+ READDATA="$READDATA$line"
+ done < $filename
+ fi
+}
+
+case "$1" in
+ start)
+ export ACTION=add
+ # propagate /dev from /sys
+ echo "Starting udev"
+
+ # mount the devtmpfs on /dev, if not already done
+ LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+ mount -n -o mode=0755 -t devtmpfs none "/dev"
+ }
+ [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+ [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+ mount -a -t tmpfs 2>/dev/null
+
+ # cache handling
+ if [ "$DEVCACHE" != "" ]; then
+ readfile /proc/version
+ VERSION="$READDATA"
+ readfile /proc/cmdline
+ CMDLINE="$READDATA"
+ readfile /proc/devices
+ DEVICES="$READDATA"
+ readfile /proc/atags
+ ATAGS="$READDATA"
+
+ if [ -e $DEVCACHE ]; then
+ readfile /etc/udev/cache.data
+ if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
+ (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
+ not_first_boot=1
+ [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
+ [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
+ else
+ echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+ fi
+ else
+ echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+ fi
+ fi
+
+ # make_extra_nodes
+ killproc systemd-udevd > "/dev/null" 2>&1
+
+ # trigger the sorted events
+ echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+ @UDEVD@ -d
+
+ udevadm control --env=STARTUP=1
+ if [ "$not_first_boot" != "" ];then
+ udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
+ (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+ else
+ udevadm trigger --action=add
+ udevadm settle
+ fi
+ ;;
+ stop)
+ echo "Stopping udevd"
+ start-stop-daemon --stop --name systemd-udevd --quiet
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ status systemd-udevd
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+exit 0
diff --git a/poky/meta/recipes-core/systemd/systemd/libmount.patch b/poky/meta/recipes-core/systemd/systemd/libmount.patch
new file mode 100644
index 000000000..b59d5b7d7
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/libmount.patch
@@ -0,0 +1,75 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Mon, 26 Mar 2018 17:34:53 +0200
+Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
+
+linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
+definitions.
+
+To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
+should be included. And missing.h must be included last.
+
+Without this, building systemd may fail with:
+
+In file included from [...]/libmount/libmount.h:31:0,
+ from ../systemd-238/src/core/manager.h:23,
+ from ../systemd-238/src/core/emergency-action.h:37,
+ from ../systemd-238/src/core/unit.h:34,
+ from ../systemd-238/src/core/dbus-timer.h:25,
+ from ../systemd-238/src/core/timer.c:26:
+[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
+---
+ src/core/dbus-execute.c | 1 +
+ src/core/manager.h | 3 ++-
+ src/core/mount.c | 2 ++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
+index 7344623ebf6..c342093bca4 100644
+--- a/src/core/dbus-execute.c
++++ b/src/core/dbus-execute.c
+@@ -18,6 +18,7 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <sys/mount.h>
+ #include <sys/prctl.h>
+ #include <stdio_ext.h>
+
+diff --git a/src/core/manager.h b/src/core/manager.h
+index 28c5da225b1..e09e0cdf5e9 100644
+--- a/src/core/manager.h
++++ b/src/core/manager.h
+@@ -20,7 +20,6 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#include <libmount.h>
+ #include <stdbool.h>
+ #include <stdio.h>
+
+@@ -34,6 +33,8 @@
+ #include "list.h"
+ #include "ratelimit.h"
+
++struct libmnt_monitor;
++
+ /* Enforce upper limit how many names we allow */
+ #define MANAGER_MAX_NAMES 131072 /* 128K */
+
+diff --git a/src/core/mount.c b/src/core/mount.c
+index 0e755da5c02..0154ebda5d6 100644
+--- a/src/core/mount.c
++++ b/src/core/mount.c
+@@ -23,6 +23,8 @@
+ #include <stdio.h>
+ #include <sys/epoll.h>
+
++#include <libmount.h>
++
+ #include "sd-messages.h"
+
+ #include "alloc-util.h"
diff --git a/poky/meta/recipes-core/systemd/systemd/touchscreen.rules b/poky/meta/recipes-core/systemd/systemd/touchscreen.rules
new file mode 100644
index 000000000..d83fd1673
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd/touchscreen.rules
@@ -0,0 +1,18 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/poky/meta/recipes-core/systemd/systemd_237.bb b/poky/meta/recipes-core/systemd/systemd_237.bb
new file mode 100644
index 000000000..2e6558ded
--- /dev/null
+++ b/poky/meta/recipes-core/systemd/systemd_237.bb
@@ -0,0 +1,595 @@
+require systemd.inc
+
+PROVIDES = "udev"
+
+PE = "1"
+
+DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup util-linux"
+
+SECTION = "base/shell"
+
+inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages distro_features_check
+
+# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
+# that we don't build both udev and systemd in world builds.
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SRC_URI += "file://touchscreen.rules \
+ file://00-create-volatile.conf \
+ file://init \
+ file://0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
+ file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
+ file://0002-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
+ file://0003-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
+ file://0004-implment-systemd-sysv-install-for-OE.patch \
+ file://0005-rules-whitelist-hd-devices.patch \
+ file://0006-Make-root-s-home-directory-configurable.patch \
+ file://0007-Revert-rules-remove-firmware-loading-rules.patch \
+ file://0008-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+ file://0009-remove-duplicate-include-uchar.h.patch \
+ file://0010-check-for-uchar.h-in-meson.build.patch \
+ file://0011-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
+ file://0012-rules-watch-metadata-changes-in-ide-devices.patch \
+ file://0013-add-fallback-parse_printf_format-implementation.patch \
+ file://0014-src-basic-missing.h-check-for-missing-strndupa.patch \
+ file://0015-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
+ file://0016-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
+ file://0017-Include-netinet-if_ether.h.patch \
+ file://0018-check-for-missing-canonicalize_file_name.patch \
+ file://0019-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
+ file://0020-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
+ file://0021-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
+ file://0022-don-t-use-glibc-specific-qsort_r.patch \
+ file://0023-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
+ file://0024-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
+ file://0025-Define-_PATH_WTMPX-and-_PATH_UTMPX-if-not-defined.patch \
+ file://0026-Use-uintmax_t-for-handling-rlim_t.patch \
+ file://0027-remove-nobody-user-group-checking.patch \
+ file://0028-add-missing-FTW_-macros-for-musl.patch \
+ file://0029-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
+ file://0030-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
+ file://0031-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
+ file://0032-memfd.patch \
+ file://0033-basic-macros-rename-noreturn-into-_noreturn_-8456.patch \
+ file://libmount.patch \
+ file://0034-Fix-format-truncation-compile-failure-by-typecasting.patch \
+ file://0035-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
+ "
+SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
+
+# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
+SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
+SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
+
+PAM_PLUGINS = " \
+ pam-plugin-unix \
+ pam-plugin-loginuid \
+ pam-plugin-keyinit \
+"
+
+PACKAGECONFIG ??= " \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+ backlight \
+ binfmt \
+ firstboot \
+ hibernate \
+ hostnamed \
+ ima \
+ localed \
+ logind \
+ machined \
+ myhostname \
+ networkd \
+ nss \
+ polkit \
+ quotacheck \
+ randomseed \
+ resolved \
+ smack \
+ sysusers \
+ timedated \
+ timesyncd \
+ utmp \
+ vconsole \
+ xz \
+"
+
+PACKAGECONFIG_remove_libc-musl = " \
+ localed \
+ myhostname \
+ nss \
+ resolved \
+ selinux \
+ smack \
+ sysusers \
+ utmp \
+"
+
+# Use the upstream systemd serial-getty@.service and rely on
+# systemd-getty-generator instead of using the OE-core specific
+# systemd-serialgetty.bb - not enabled by default.
+PACKAGECONFIG[serial-getty-generator] = ""
+
+PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
+PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
+PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
+PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
+PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
+PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
+PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
+PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
+PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
+PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
+# Sign the journal for anti-tampering
+PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
+PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
+PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
+PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
+# importd requires curl/xz/zlib/bzip2/gcrypt
+PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
+# Update NAT firewall rules
+PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
+PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
+PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
+PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
+PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
+PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
+PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
+PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
+PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
+PACKAGECONFIG[myhostname] = "-Dmyhostname=true,-Dmyhostname=false"
+PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
+PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
+PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
+PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
+PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
+PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
+PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
+PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
+PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
+# libseccomp is found in meta-security
+PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
+PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
+PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
+PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
+PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
+PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
+PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
+PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
+PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
+PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
+# Verify keymaps on locale change
+PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
+PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
+PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
+
+# Helper variables to clarify locations. This mirrors the logic in systemd's
+# build system.
+rootprefix ?= "${root_prefix}"
+rootlibdir ?= "${base_libdir}"
+rootlibexecdir = "${rootprefix}/lib"
+
+# This links udev statically with systemd helper library.
+# Otherwise udev package would depend on systemd package (which has the needed shared library),
+# and always pull it into images.
+EXTRA_OEMESON += "-Dlink-udev-shared=false"
+
+EXTRA_OEMESON += "-Dnobody-user=nobody \
+ -Dnobody-group=nobody \
+ -Droothomedir=${ROOTHOME} \
+ -Drootlibdir=${rootlibdir} \
+ -Drootprefix=${rootprefix} \
+ -Dsysvrcnd-path=${sysconfdir} \
+ -Dfirmware-path=${nonarch_base_libdir}/firmware \
+ "
+
+# Hardcode target binary paths to avoid using paths from sysroot
+EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
+ -Dkill-path=${base_bindir}/kill \
+ -Dkmod-path=${base_bindir}/kmod \
+ -Dmount-path=${base_bindir}/mount \
+ -Dquotacheck-path=${sbindir}/quotacheck \
+ -Dquotaon-path=${sbindir}/quotaon \
+ -Dsulogin-path=${base_sbindir}/sulogin \
+ -Dumount-path=${base_bindir}/umount"
+
+do_install() {
+ meson_do_install
+ install -d ${D}/${base_sbindir}
+ if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
+ # Provided by a separate recipe
+ rm ${D}${systemd_unitdir}/system/serial-getty* -f
+ fi
+
+ # Provide support for initramfs
+ [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
+ [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
+
+ # Create machine-id
+ # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
+ touch ${D}${sysconfdir}/machine-id
+
+ install -d ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${libdir}/pkgconfig
+ install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
+
+ install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
+ sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
+ fi
+
+ chown root:systemd-journal ${D}/${localstatedir}/log/journal
+
+ # Delete journal README, as log can be symlinked inside volatile.
+ rm -f ${D}/${localstatedir}/log/README
+
+ install -d ${D}${systemd_unitdir}/system/graphical.target.wants
+ install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+ install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
+ install -d ${D}${systemd_unitdir}/system/reboot.target.wants
+ install -d ${D}${systemd_unitdir}/system/rescue.target.wants
+
+ # Create symlinks for systemd-update-utmp-runlevel.service
+ if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
+ fi
+
+ # Enable journal to forward message to syslog daemon
+ sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+ # Set the maximium size of runtime journal to 64M as default
+ sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf
+
+ # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
+ # for existence else it fails
+ if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
+ ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)}
+ fi
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
+ echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
+ echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
+ echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
+ ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
+ else
+ sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
+ ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
+ fi
+ install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
+
+ # If polkit is setup fixup permissions and ownership
+ if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
+ if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
+ chmod 700 ${D}${datadir}/polkit-1/rules.d
+ chown polkitd:root ${D}${datadir}/polkit-1/rules.d
+ fi
+ fi
+}
+
+
+python populate_packages_prepend (){
+ systemdlibdir = d.getVar("rootlibdir")
+ do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
+}
+PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
+
+PACKAGES =+ "\
+ ${PN}-gui \
+ ${PN}-vconsole-setup \
+ ${PN}-initramfs \
+ ${PN}-analyze \
+ ${PN}-kernel-install \
+ ${PN}-rpm-macros \
+ ${PN}-binfmt \
+ ${PN}-zsh-completion \
+ ${PN}-xorg-xinitrc \
+ ${PN}-container \
+ ${PN}-extra-utils \
+"
+
+SUMMARY_${PN}-container = "Tools for containers and VMs"
+DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
+
+SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}"
+SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
+
+USERADD_PACKAGES = "${PN} ${PN}-extra-utils"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
+GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
+USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;"
+
+FILES_${PN}-analyze = "${bindir}/systemd-analyze"
+
+FILES_${PN}-initramfs = "/init"
+RDEPENDS_${PN}-initramfs = "${PN}"
+
+FILES_${PN}-gui = "${bindir}/systemadm"
+
+FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
+ ${systemd_unitdir}/system/systemd-vconsole-setup.service \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
+
+RDEPENDS_${PN}-kernel-install += "bash"
+FILES_${PN}-kernel-install = "${bindir}/kernel-install \
+ ${sysconfdir}/kernel/ \
+ ${exec_prefix}/lib/kernel \
+ "
+FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
+ "
+
+FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
+
+FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
+
+FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
+ ${exec_prefix}/lib/binfmt.d \
+ ${rootlibexecdir}/systemd/systemd-binfmt \
+ ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
+ ${systemd_unitdir}/system/systemd-binfmt.service"
+RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
+
+RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
+
+FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
+ ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
+ ${base_bindir}/machinectl \
+ ${bindir}/systemd-nspawn \
+ ${nonarch_libdir}/systemd/import-pubring.gpg \
+ ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
+ ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
+ ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
+ ${systemd_system_unitdir}/machine.slice \
+ ${systemd_system_unitdir}/machines.target \
+ ${systemd_system_unitdir}/org.freedesktop.import1.busname \
+ ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
+ ${systemd_system_unitdir}/systemd-importd.service \
+ ${systemd_system_unitdir}/systemd-machined.service \
+ ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
+ ${systemd_system_unitdir}/var-lib-machines.mount \
+ ${rootlibexecdir}/systemd/systemd-import \
+ ${rootlibexecdir}/systemd/systemd-importd \
+ ${rootlibexecdir}/systemd/systemd-journal-gatewayd \
+ ${rootlibexecdir}/systemd/systemd-journal-remote \
+ ${rootlibexecdir}/systemd/systemd-journal-upload \
+ ${rootlibexecdir}/systemd/systemd-machined \
+ ${rootlibexecdir}/systemd/systemd-pull \
+ ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
+ ${systemd_system_unitdir}/systemd-nspawn@.service \
+ ${libdir}/libnss_mymachines.so.2 \
+ ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
+ ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
+ ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
+ ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
+ ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
+ "
+
+FILES_${PN}-extra-utils = "\
+ ${base_bindir}/systemd-escape \
+ ${base_bindir}/systemd-inhibit \
+ ${bindir}/systemd-detect-virt \
+ ${bindir}/systemd-path \
+ ${bindir}/systemd-run \
+ ${bindir}/systemd-cat \
+ ${bindir}/systemd-delta \
+ ${bindir}/systemd-cgls \
+ ${bindir}/systemd-cgtop \
+ ${bindir}/systemd-stdio-bridge \
+ ${base_bindir}/systemd-ask-password \
+ ${base_bindir}/systemd-tty-ask-password-agent \
+ ${systemd_unitdir}/system/systemd-ask-password-console.path \
+ ${systemd_unitdir}/system/systemd-ask-password-console.service \
+ ${systemd_unitdir}/system/systemd-ask-password-wall.path \
+ ${systemd_unitdir}/system/systemd-ask-password-wall.service \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
+ ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
+ ${rootlibexecdir}/systemd/systemd-resolve-host \
+ ${rootlibexecdir}/systemd/systemd-ac-power \
+ ${rootlibexecdir}/systemd/systemd-activate \
+ ${rootlibexecdir}/systemd/systemd-bus-proxyd \
+ ${systemd_unitdir}/system/systemd-bus-proxyd.service \
+ ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
+ ${rootlibexecdir}/systemd/systemd-socket-proxyd \
+ ${rootlibexecdir}/systemd/systemd-reply-password \
+ ${rootlibexecdir}/systemd/systemd-sleep \
+ ${rootlibexecdir}/systemd/system-sleep \
+ ${systemd_unitdir}/system/systemd-hibernate.service \
+ ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
+ ${systemd_unitdir}/system/systemd-suspend.service \
+ ${systemd_unitdir}/system/sleep.target \
+ ${rootlibexecdir}/systemd/systemd-initctl \
+ ${systemd_unitdir}/system/systemd-initctl.service \
+ ${systemd_unitdir}/system/systemd-initctl.socket \
+ ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
+ ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
+ ${rootlibexecdir}/systemd/systemd-cgroups-agent \
+"
+
+CONFFILES_${PN} = "${sysconfdir}/machine-id \
+ ${sysconfdir}/systemd/coredump.conf \
+ ${sysconfdir}/systemd/journald.conf \
+ ${sysconfdir}/systemd/logind.conf \
+ ${sysconfdir}/systemd/system.conf \
+ ${sysconfdir}/systemd/user.conf"
+
+FILES_${PN} = " ${base_bindir}/* \
+ ${datadir}/dbus-1/services \
+ ${datadir}/dbus-1/system-services \
+ ${datadir}/polkit-1 \
+ ${datadir}/${BPN} \
+ ${datadir}/factory \
+ ${sysconfdir}/dbus-1/ \
+ ${sysconfdir}/machine-id \
+ ${sysconfdir}/modules-load.d/ \
+ ${sysconfdir}/pam.d/ \
+ ${sysconfdir}/sysctl.d/ \
+ ${sysconfdir}/systemd/ \
+ ${sysconfdir}/tmpfiles.d/ \
+ ${sysconfdir}/xdg/ \
+ ${sysconfdir}/init.d/README \
+ ${sysconfdir}/resolv-conf.systemd \
+ ${rootlibexecdir}/systemd/* \
+ ${systemd_unitdir}/* \
+ ${base_libdir}/security/*.so \
+ /cgroup \
+ ${bindir}/systemd* \
+ ${bindir}/busctl \
+ ${bindir}/coredumpctl \
+ ${bindir}/localectl \
+ ${bindir}/hostnamectl \
+ ${bindir}/timedatectl \
+ ${bindir}/bootctl \
+ ${bindir}/kernel-install \
+ ${exec_prefix}/lib/tmpfiles.d/*.conf \
+ ${exec_prefix}/lib/systemd \
+ ${exec_prefix}/lib/modules-load.d \
+ ${exec_prefix}/lib/sysctl.d \
+ ${exec_prefix}/lib/sysusers.d \
+ ${exec_prefix}/lib/environment.d \
+ ${localstatedir} \
+ ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
+ ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
+ ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
+ ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
+ ${nonarch_base_libdir}/modprobe.d/systemd.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
+ "
+
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
+
+RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV}) util-linux-agetty"
+RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
+RDEPENDS_${PN} += "volatile-binds update-rc.d"
+
+RRECOMMENDS_${PN} += "systemd-extra-utils \
+ systemd-compat-units udev-hwdb \
+ util-linux-fsck e2fsprogs-e2fsck \
+ kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+ os-release \
+"
+
+INSANE_SKIP_${PN} += "dev-so libdir"
+INSANE_SKIP_${PN}-dbg += "libdir"
+INSANE_SKIP_${PN}-doc += " libdir"
+
+PACKAGES =+ "udev udev-hwdb"
+
+RPROVIDES_udev = "hotplug"
+
+RDEPENDS_udev-hwdb += "udev"
+
+FILES_udev += "${base_sbindir}/udevd \
+ ${rootlibexecdir}/systemd/systemd-udevd \
+ ${rootlibexecdir}/udev/accelerometer \
+ ${rootlibexecdir}/udev/ata_id \
+ ${rootlibexecdir}/udev/cdrom_id \
+ ${rootlibexecdir}/udev/collect \
+ ${rootlibexecdir}/udev/findkeyboards \
+ ${rootlibexecdir}/udev/keyboard-force-release.sh \
+ ${rootlibexecdir}/udev/keymap \
+ ${rootlibexecdir}/udev/mtd_probe \
+ ${rootlibexecdir}/udev/scsi_id \
+ ${rootlibexecdir}/udev/v4l_id \
+ ${rootlibexecdir}/udev/keymaps \
+ ${rootlibexecdir}/udev/rules.d/*.rules \
+ ${sysconfdir}/udev \
+ ${sysconfdir}/init.d/systemd-udevd \
+ ${systemd_unitdir}/system/*udev* \
+ ${systemd_unitdir}/system/*.wants/*udev* \
+ ${base_bindir}/udevadm \
+ ${datadir}/bash-completion/completions/udevadm \
+ "
+
+FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
+
+INITSCRIPT_PACKAGES = "udev"
+INITSCRIPT_NAME_udev = "systemd-udevd"
+INITSCRIPT_PARAMS_udev = "start 03 S ."
+
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+# TODO:
+# u-a for runlevel and telinit
+
+ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel resolv-conf"
+
+ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] ?= "300"
+
+ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_PRIORITY[halt] ?= "300"
+
+ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_PRIORITY[reboot] ?= "300"
+
+ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_PRIORITY[shutdown] ?= "300"
+
+ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+ALTERNATIVE_PRIORITY[poweroff] ?= "300"
+
+ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_PRIORITY[runlevel] ?= "300"
+
+ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
+ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
+ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
+
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e '/^hosts:/s/\s*myhostname//' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+pkg_postinst_udev-hwdb () {
+ if test -n "$D"; then
+ ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
+ --root $D
+ chown root:root $D${sysconfdir}/udev/hwdb.bin
+ else
+ udevadm hwdb --update
+ fi
+}
+
+pkg_prerm_udev-hwdb () {
+ rm -f $D${sysconfdir}/udev/hwdb.bin
+}
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
new file mode 100644
index 000000000..7b342901e
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [configuration]
+
+# The src Makefile was checking for libcrypt.a on the host, not in the
+# build environment. This patch checks for $LCRYPT in the environment
+# and uses it if it's there.
+# - jdike@linux.intel.com
+
+Index: sysvinit-2.88dsf/src/Makefile
+===================================================================
+--- sysvinit-2.88dsf.orig/src/Makefile
++++ sysvinit-2.88dsf/src/Makefile
+@@ -85,9 +85,13 @@ else
+ endif
+
+ # Additional libs for GNU libc.
++ifneq ($(LCRYPT),)
++ SULOGINLIBS += $(LCRYPT)
++else
+ ifneq ($(wildcard /usr/lib*/libcrypt.a),)
+ SULOGINLIBS += -lcrypt
+ endif
++endif
+
+ all: $(BIN) $(SBIN) $(USRBIN)
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
new file mode 100644
index 000000000..6c4225a67
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Pending
+
+diff --git a/src/Makefile b/src/Makefile
+index e2b8028..3e11e92 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -65,7 +65,14 @@ else
+ INSTALL_DATA = install -m 644
+ endif
+ INSTALL_DIR = install -m 755 -d
+-MANDIR = /usr/share/man
++
++ROOT ?=
++base_bindir ?= /bin
++base_sbindir ?= /sbin
++bindir ?= /usr/bin
++sysconfdir ?= /etc
++includedir ?= /usr/include
++mandir ?= /usr/share/man
+
+ ifeq ($(WITH_SELINUX),yes)
+ SELINUX_DEF = -DWITH_SELINUX
+@@ -138,39 +145,39 @@ clobber: cleanobjs
+ distclean: clobber
+
+ install:
+- $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
+- $(INSTALL_DIR) $(ROOT)/usr/bin/
++ $(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/
++ $(INSTALL_DIR) $(ROOT)$(bindir)/
+ for i in $(BIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \
+ done
+ for i in $(SBIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \
+ done
+ for i in $(USRBIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \
+ done
+- # $(INSTALL_DIR) $(ROOT)/etc/
+- # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
+- ln -sf halt $(ROOT)/sbin/reboot
+- ln -sf halt $(ROOT)/sbin/poweroff
+- ln -sf init $(ROOT)/sbin/telinit
+- ln -sf /sbin/killall5 $(ROOT)/bin/pidof
+- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
+- ln -sf last $(ROOT)/usr/bin/lastb; \
++ # $(INSTALL_DIR) $(ROOT)$(sysconfdir)/
++ # $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/
++ ln -sf halt $(ROOT)$(base_sbindir)/reboot
++ ln -sf halt $(ROOT)$(base_sbindir)/poweroff
++ ln -sf init $(ROOT)$(base_sbindir)/telinit
++ ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof
++ if [ ! -f $(ROOT)$(bindir)/lastb ]; then \
++ ln -sf last $(ROOT)$(bindir)/lastb; \
+ fi
+- $(INSTALL_DIR) $(ROOT)/usr/include/
+- $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
++ $(INSTALL_DIR) $(ROOT)$(includedir)/
++ $(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man1/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man5/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man8/
+ for i in $(MAN1); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \
+ done
+ for i in $(MAN5); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \
+ done
+ for i in $(MAN8); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \
+ done
+ ifeq ($(ROOT),)
+ #
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
new file mode 100644
index 000000000..5b5dfdc00
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
@@ -0,0 +1,189 @@
+pidof: add -m option
+
+When used with -o, will also omit any processes that have the same
+argv[0] and argv[1] as any explicitly omitted process ids. This can be
+used to avoid multiple shell scripts concurrently calling pidof returning
+each other's pids.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=883856
+
+Upstream-Status: backport
+Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ man/pidof.8 | 6 ++++++
+ src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 65 insertions(+), 3 deletions(-)
+
+diff --git a/man/pidof.8 b/man/pidof.8
+--- a/man/pidof.8
++++ b/man/pidof.8
+@@ -24,6 +24,7 @@ pidof -- find the process ID of a running program.
+ .RB [ \-c ]
+ .RB [ \-n ]
+ .RB [ \-x ]
++.RB [ \-m ]
+ .RB [ \-o
+ .IR omitpid[,omitpid..] ]
+ .RB [ \-o
+@@ -63,6 +64,11 @@ shells running the named scripts.
+ Tells \fIpidof\fP to omit processes with that process id. The special
+ pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
+ program, in other words the calling shell or shell script.
++.IP -m
++When used with -o, will also omit any processes that have the same
++argv[0] and argv[1] as any explicitly omitted process ids. This can be
++used to avoid multiple shell scripts concurrently calling pidof returning
++each other's pids.
+ .SH "EXIT STATUS"
+ .TP
+ .B 0
+diff --git a/src/killall5.c b/src/killall5.c
+index 5937d98..e73885e 100644
+--- a/src/killall5.c
++++ b/src/killall5.c
+@@ -118,6 +118,7 @@ typedef struct _s_nfs
+
+ /* List of processes. */
+ PROC *plist;
++PROC *olist;
+
+ /* List of processes to omit. */
+ OMIT *omit;
+@@ -345,6 +346,20 @@ static void clear_mnt(void)
+ }
+ }
+
++static void clear_omit(void)
++{
++ OMIT *o;
++ PROC *p;
++ for (o = omit; o; o = omit) {
++ omit = omit->next;
++ free(o);
++ }
++ for (p = olist; p; p = olist) {
++ olist = olist->next;
++ free(p);
++ }
++}
++
+ /*
+ * Check if path is ia shadow off a NFS partition.
+ */
+@@ -452,6 +467,7 @@ int readproc(int do_stat)
+ DIR *dir;
+ FILE *fp;
+ PROC *p, *n;
++ OMIT *o, *m;
+ struct dirent *d;
+ struct stat st;
+ char path[PATH_MAX+1];
+@@ -624,6 +640,17 @@ int readproc(int do_stat)
+ p->next = plist;
+ plist = p;
+ p->pid = pid;
++ /* Could be smarter, but it's a small list. */
++ m = omit;
++ for (o = omit; m; o = m) {
++ m = o->next;
++ if (o->pid == p->pid) {
++ n = (PROC*)xmalloc(sizeof(PROC));
++ *n = *p;
++ n->next = olist;
++ olist = n;
++ }
++ }
+ }
+ closedir(dir);
+
+@@ -813,6 +840,26 @@ PIDQ_HEAD *pidof(char *prog)
+ return q;
+ }
+
++int matches(PROC *o, PROC *p)
++{
++ int ret = 0;
++ char *oargv1, *pargv1;
++ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
++ if (o->argv1 && p->argv1) {
++ if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++ oargv1 = strdup(o->argv1);
++ if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++ pargv1 = strdup(p->argv1);
++ if (! strcmp(oargv1, pargv1)) {
++ ret = 1;
++ }
++ free(oargv1);
++ free(pargv1);
++ }
++ }
++ return ret;
++}
++
+ /* Give usage message and exit. */
+ void usage(void)
+ {
+@@ -845,6 +892,7 @@ void nsyslog(int pri, char *fmt, ...)
+ #define PIDOF_SINGLE 0x01
+ #define PIDOF_OMIT 0x02
+ #define PIDOF_NETFS 0x04
++#define PIDOF_OMIT_OMIT_MATCHES 0x08
+
+ /*
+ * Pidof functionality.
+@@ -861,6 +909,7 @@ int main_pidof(int argc, char **argv)
+ struct stat st;
+ char tmp[512];
+
++ olist = (PROC*)0;
+ omit = (OMIT*)0;
+ nlist = (NFS*)0;
+ opterr = 0;
+@@ -868,7 +917,7 @@ int main_pidof(int argc, char **argv)
+ if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
+ flags |= PIDOF_NETFS;
+
+- while ((opt = getopt(argc,argv,"hco:sxn")) != EOF) switch (opt) {
++ while ((opt = getopt(argc,argv,"hcmo:sxn")) != EOF) switch (opt) {
+ case '?':
+ nsyslog(LOG_ERR,"invalid options on command line!\n");
+ closelog();
+@@ -907,6 +956,9 @@ int main_pidof(int argc, char **argv)
+ case 'x':
+ scripts_too++;
+ break;
++ case 'm':
++ flags |= PIDOF_OMIT_OMIT_MATCHES;
++ break;
+ case 'n':
+ flags |= PIDOF_NETFS;
+ break;
+@@ -938,10 +990,13 @@ int main_pidof(int argc, char **argv)
+ pid_t spid = 0;
+ while ((p = get_next_from_pid_q(q))) {
+ if ((flags & PIDOF_OMIT) && omit) {
+- OMIT * optr;
+- for (optr = omit; optr; optr = optr->next) {
++ PROC * optr;
++ for (optr = olist; optr; optr = optr->next) {
+ if (optr->pid == p->pid)
+ break;
++ if (flags & PIDOF_OMIT_OMIT_MATCHES)
++ if (matches(optr, p))
++ break;
+ }
+
+ /*
+@@ -977,6 +1032,7 @@ int main_pidof(int argc, char **argv)
+ if (!first)
+ printf("\n");
+
++ clear_omit();
+ clear_mnt();
+
+ closelog();
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
new file mode 100644
index 000000000..6abbdf455
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
@@ -0,0 +1,30 @@
+# /etc/inittab: init(8) configuration.
+# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
+
+# The default runlevel.
+id:5:initdefault:
+
+# Boot-time system configuration/initialization script.
+# This is run first except when booting in emergency (-b) mode.
+si::sysinit:/etc/init.d/rcS
+
+# What to do in single-user mode.
+~~:S:wait:/sbin/sulogin
+
+# /etc/init.d executes the S and K scripts upon change
+# of runlevel.
+#
+# Runlevel 0 is halt.
+# Runlevel 1 is single-user.
+# Runlevels 2-5 are multi-user.
+# Runlevel 6 is reboot.
+
+l0:0:wait:/etc/init.d/rc 0
+l1:1:wait:/etc/init.d/rc 1
+l2:2:wait:/etc/init.d/rc 2
+l3:3:wait:/etc/init.d/rc 3
+l4:4:wait:/etc/init.d/rc 4
+l5:5:wait:/etc/init.d/rc 5
+l6:6:wait:/etc/init.d/rc 6
+# Normally not reached, but fallthrough in case of emergency.
+z6:6:respawn:/sbin/sulogin
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
new file mode 100644
index 000000000..e15ae35f9
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -0,0 +1,43 @@
+#!/bin/sh
+###############################################################################
+# This script is used to automatically set up the serial console(s) on startup.
+# The variable SERIAL_CONSOLES can be set in meta/conf/machine/*.conf.
+# Script enhancement has been done based on Bug YOCTO #10844.
+# Most of the information is retrieved from /proc virtual filesystem containing
+# all the runtime system information (eg. system memory, device mount, etc).
+###############################################################################
+
+# Get active serial filename.
+active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//")
+
+# Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc).
+runtime_tty=$(echo $2 | grep -oh '[0-9]')
+
+# Backup $IFS.
+DEFAULT_IFS=$IFS
+# Customize Internal Field Separator.
+IFS="$(printf '\n\t')"
+
+for line in $active_serial; do
+ # Check we have the file containing current active serial target index.
+ if [ -e "/proc/tty/driver/$line" ]
+ then
+ # Remove all unknown entries and discard the first line (desc).
+ activetty=$(grep -v "unknown" "/proc/tty/driver/$line" \
+ | tail -n +2 | grep -oh "^\s*\S*[0-9]")
+ for active in $activetty; do
+ # If indexes do match then enable the serial console.
+ if [ $active -eq $runtime_tty ]
+ then
+ if [ -c /dev/$2 ]
+ then
+ /sbin/getty -L $1 $2 $3
+ fi
+ break
+ fi
+ done
+ fi
+done
+
+# Restore $IFS.
+IFS=$DEFAULT_IFS
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
new file mode 100644
index 000000000..8585a418a
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -0,0 +1,93 @@
+SUMMARY = "Inittab configuration for SysVinit"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r10"
+
+SRC_URI = "file://inittab \
+ file://start_getty"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+ install -d ${D}${base_bindir}
+ install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty
+
+ set -x
+ tmp="${SERIAL_CONSOLES}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/\;/\ /g`
+ l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+ label=`echo $l | sed 's/.*\(....\)/\1/'`
+ echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab
+ done
+
+ if [ "${USE_VT}" = "1" ]; then
+ cat <<EOF >>${D}${sysconfdir}/inittab
+# ${base_sbindir}/getty invocations for the runlevels.
+#
+# The "id" field MUST be the same as the last
+# characters of the device (after "tty").
+#
+# Format:
+# <id>:<runlevels>:<action>:<process>
+#
+
+EOF
+
+ for n in ${SYSVINIT_ENABLED_GETTYS}
+ do
+ echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
+ done
+ echo "" >> ${D}${sysconfdir}/inittab
+ fi
+}
+
+pkg_postinst_${PN} () {
+# run this on host and on target
+if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+ exit 0
+fi
+}
+
+pkg_postinst_ontarget_${PN} () {
+# run this on the target
+if [ -e /proc/consoles ]; then
+ tmp="${SERIAL_CONSOLES_CHECK}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g`
+ k=`echo ${i} | sed s/^.*\://g`
+ if [ -z "`grep ${j} /proc/consoles`" ]; then
+ if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
+ sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
+ fi
+ fi
+ done
+ kill -HUP 1
+else
+ exit 1
+fi
+}
+
+# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
+
+USE_VT ?= "1"
+SYSVINIT_ENABLED_GETTYS ?= "1"
+
+
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch b/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
new file mode 100644
index 000000000..f35c15cb3
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
@@ -0,0 +1,52 @@
+From 36ac97bfe51797458442a6035219a504a42e703a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Aug 2015 10:56:40 -0700
+Subject: [PATCH] This fixes an issue that clang reports about mutliple output
+ files
+
+Issue is that we are passing .h file to link step as seen below.
+
+| arm-oe-linux-gnueabi-clang -march=armv7-a -mthumb -mfloat-abi=hard
+-mfpu=neon-vfpv4 -mtune=cortex-a7 -D__extern_always_inline=inline
+-no-integrated-as
+--sysroot=/mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/sysroots/raspberrypi2
+-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed halt.o ifdown.o hddown.o
+utmp.o reboot.h -o halt
+| clang-3.7: error: cannot specify -o when generating multiple output
+files
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e77ed5f..a6f9f40 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -103,9 +103,9 @@ all: $(BIN) $(SBIN) $(USRBIN)
+ init: LDLIBS += $(INITLIBS) $(STATIC)
+ init: init.o init_utmp.o
+
+-halt: halt.o ifdown.o hddown.o utmp.o reboot.h
++halt: halt.o ifdown.o hddown.o utmp.o
+
+-last: last.o oldutmp.h
++last: last.o
+
+ mesg: mesg.o
+
+@@ -120,7 +120,7 @@ sulogin: sulogin.o
+
+ wall: dowall.o wall.o
+
+-shutdown: dowall.o shutdown.o utmp.o reboot.h
++shutdown: dowall.o shutdown.o utmp.o
+
+ bootlogd: LDLIBS += -lutil
+ bootlogd: bootlogd.o
+--
+2.1.4
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd b/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
new file mode 100644
index 000000000..a689d92d6
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
@@ -0,0 +1 @@
+f root root 0644 /var/log/boot none
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 000000000..df5aa430c
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,98 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: bootlogd
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop: 2 3 4 5
+# Short-Description: One of the first scripts to be executed. Starts or stops
+# the bootlogd log program. If this script is called as
+# "stop-bootlogd", it will stop the daemon instead of
+# starting it even when called with the "start" argument.
+#
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/sbin/bootlogd
+NAME=bootlogd
+DESC="Bootlog daemon"
+
+# source function library
+. /etc/init.d/functions
+
+test -f $DAEMON || exit 0
+
+[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
+
+## set -e # not needed
+
+case "$BOOTLOGD_ENABLE" in
+ [Nn]*)
+ exit 0
+ ;;
+esac
+
+STOPPER=
+ACTION="$1"
+case "$0" in
+ *stop-bootlog*)
+ STOPPER=Y
+ if [ "$ACTION" = start ]
+ then
+ ACTION=stop
+ fi
+ ;;
+esac
+
+case "$ACTION" in
+ start)
+ [ "${VERBOSE}" != "no" ] && echo -n "Starting $DESC: "
+ if [ -d /proc/1/. ]
+ then
+ umask 027
+ start-stop-daemon --start --quiet \
+ --exec $DAEMON -- -r -c
+ else
+ $DAEMON -r -c
+ fi
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ stop)
+ # stop may get called during bootup, so let it honor
+ # rcS VERBOSE setting
+ [ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+
+ if [ "$STOPPER" ] && [ "$(which savelog 2>/dev/null)" ] && \
+ [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
+ then
+ cd /var/log
+ chgrp adm boot
+ savelog -p -c 5 boot > /dev/null 2>&1
+ mv boot.0 boot
+ mv boot~ boot.0
+ fi
+
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+ sleep 1
+ start-stop-daemon --start --quiet --exec $DAEMON
+ echo "$NAME."
+ ;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ *)
+ N=${0##*/}
+ N=${N#[SK]??}
+ echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rc b/poky/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 000000000..7ca41ae1a
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rc
@@ -0,0 +1,182 @@
+#!/bin/sh
+#
+# rc This file is responsible for starting/stopping
+# services when the runlevel changes.
+#
+# Optimization feature:
+# A startup script is _not_ run when the service was
+# running in the previous runlevel and it wasn't stopped
+# in the runlevel transition (most Debian services don't
+# have K?? links in rc{1,2,3,4,5} )
+#
+# Author: Miquel van Smoorenburg <miquels@cistron.nl>
+# Bruce Perens <Bruce@Pixar.com>
+#
+# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl
+#
+
+. /etc/default/rcS
+export VERBOSE
+
+startup_progress() {
+ step=$(($step + $step_change))
+ if [ "$num_steps" != "0" ]; then
+ progress=$((($step * $progress_size / $num_steps) + $first_step))
+ else
+ progress=$progress_size
+ fi
+ #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
+ #if type psplash-write >/dev/null 2>&1; then
+ # TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+ #fi
+ if [ -e /mnt/.psplash/psplash_fifo ]; then
+ echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo
+ fi
+}
+
+
+#
+# Start script or program.
+#
+startup() {
+ # Handle verbosity
+ [ "$VERBOSE" = very ] && echo "INIT: Running $@..."
+
+ case "$1" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ scriptname=$1
+ shift
+ . $scriptname
+ )
+ ;;
+ *)
+ "$@"
+ ;;
+ esac
+ startup_progress
+}
+
+ # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
+ trap ":" INT QUIT TSTP
+
+ # Set onlcr to avoid staircase effect.
+ stty onlcr 0>&1
+
+ # Limit stack size for startup scripts
+ [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
+
+ # Now find out what the current and what the previous runlevel are.
+
+ runlevel=$RUNLEVEL
+ # Get first argument. Set new runlevel to this argument.
+ [ "$1" != "" ] && runlevel=$1
+ if [ "$runlevel" = "" ]
+ then
+ echo "Usage: $0 <runlevel>" >&2
+ exit 1
+ fi
+ previous=$PREVLEVEL
+ [ "$previous" = "" ] && previous=N
+
+ export runlevel previous
+
+ # Is there an rc directory for this new runlevel?
+ if [ -d /etc/rc$runlevel.d ]
+ then
+ # Find out where in the progress bar the initramfs got to.
+ PROGRESS_STATE=0
+ #if [ -f /dev/.initramfs/progress_state ]; then
+ # . /dev/.initramfs/progress_state
+ #fi
+
+ # Split the remaining portion of the progress bar into thirds
+ progress_size=$(((100 - $PROGRESS_STATE) / 3))
+
+ case "$runlevel" in
+ 0|6)
+ # Count down from -100 to 0 and use the entire bar
+ first_step=-100
+ progress_size=100
+ step_change=1
+ ;;
+ S)
+ # Begin where the initramfs left off and use 2/3
+ # of the remaining space
+ first_step=$PROGRESS_STATE
+ progress_size=$(($progress_size * 2))
+ step_change=1
+ ;;
+ *)
+ # Begin where rcS left off and use the final 1/3 of
+ # the space (by leaving progress_size unchanged)
+ first_step=$(($progress_size * 2 + $PROGRESS_STATE))
+ step_change=1
+ ;;
+ esac
+
+ num_steps=0
+ for s in /etc/rc$runlevel.d/[SK]*; do
+ case "${s##/etc/rc$runlevel.d/S??}" in
+ gdm|xdm|kdm|reboot|halt)
+ break
+ ;;
+ esac
+ num_steps=$(($num_steps + 1))
+ done
+ step=0
+
+ # First, run the KILL scripts.
+ if [ $previous != N ]
+ then
+ for i in /etc/rc$runlevel.d/K[0-9][0-9]*
+ do
+ # Check if the script is there.
+ [ ! -f $i ] && continue
+
+ # Stop the service.
+ startup $i stop
+ done
+ fi
+
+ # Now run the START scripts for this runlevel.
+ for i in /etc/rc$runlevel.d/S*
+ do
+ [ ! -f $i ] && continue
+
+ if [ $previous != N ] && [ $previous != S ]
+ then
+ #
+ # Find start script in previous runlevel and
+ # stop script in this runlevel.
+ #
+ suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
+ stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
+ previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
+ #
+ # If there is a start script in the previous level
+ # and _no_ stop script in this level, we don't
+ # have to re-start the service.
+ #
+ [ -f $previous_start ] && [ ! -f $stop ] && continue
+ fi
+ case "$runlevel" in
+ 0|6)
+ startup $i stop
+ ;;
+ *)
+ startup $i start
+ ;;
+ esac
+ done
+ fi
+
+#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
+if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
+ if type psplash-write >/dev/null 2>&1; then
+ TMPDIR=/mnt/.psplash psplash-write "QUIT" || true
+ umount -l /mnt/.psplash
+ fi
+fi
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rcS b/poky/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 000000000..080b04f32
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# rcS Call all S??* scripts in /etc/rcS.d in
+# numerical/alphabetical order.
+#
+# Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+runlevel=S
+prevlevel=N
+umask 022
+export PATH runlevel prevlevel
+
+# Make sure proc is mounted
+#
+[ -d "/proc/1" ] || mount /proc
+
+#
+# Source defaults.
+#
+. /etc/default/rcS
+
+#
+# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
+#
+trap ":" INT QUIT TSTP
+
+#
+# Call all parts in order.
+#
+exec /etc/init.d/rc S
+
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default b/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 000000000..709cdf6ec
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -0,0 +1,29 @@
+#
+# Defaults for the boot scripts in /etc/rcS.d
+#
+
+# Time files in /tmp are kept in days.
+TMPTIME=0
+# Set to yes if you want sulogin to be spawned on bootup
+SULOGIN=no
+# Set to no if you want to be able to login over telnet/rlogin
+# before system startup is complete (as soon as inetd is started)
+DELAYLOGIN=no
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
+# Set VERBOSE to "no" if you would like a more quiet bootup.
+VERBOSE=no
+# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
+EDITMOTD=no
+# Whether to fsck root on boot
+ENABLE_ROOTFS_FSCK=no
+# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+FSCKFIX=yes
+# Set TICKADJ to the correct tick value for this specific machine
+#TICKADJ=10000
+# Enable caching in populate-volatile.sh
+VOLATILE_ENABLE_CACHE=yes
+# Indicate whether the rootfs is intended to be read-only or not.
+# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
+# Normally you should not change this value.
+ROOTFS_READ_ONLY=no
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch b/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
new file mode 100644
index 000000000..5e0dca3bf
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
@@ -0,0 +1,78 @@
+Fix build on musl use realpath() API its available on all libcs
+
+realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
+However for Linux it should always work
+
+Upstream-Status: Inappropriate[Linux specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: sysvinit-2.88dsf/src/ifdown.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/ifdown.c 2010-03-23 07:37:01.000000000 -0700
++++ sysvinit-2.88dsf/src/ifdown.c 2014-04-02 00:43:43.675437029 -0700
+@@ -26,11 +26,11 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <string.h>
++#include <errno.h>
+
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#include <sys/errno.h>
+
+ #include <net/if.h>
+ #include <netinet/in.h>
+Index: sysvinit-2.88dsf/src/init.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/init.c 2014-04-02 00:42:10.488770162 -0700
++++ sysvinit-2.88dsf/src/init.c 2014-04-02 00:42:59.432103823 -0700
+@@ -49,6 +49,7 @@
+ #include <utmp.h>
+ #include <ctype.h>
+ #include <stdarg.h>
++#include <sys/ttydefaults.h>
+ #include <sys/syslog.h>
+ #include <sys/time.h>
+
+Index: sysvinit-2.88dsf/src/mountpoint.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/mountpoint.c 2009-09-10 01:28:49.000000000 -0700
++++ sysvinit-2.88dsf/src/mountpoint.c 2014-04-02 00:44:18.248770942 -0700
+@@ -23,6 +23,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+Index: sysvinit-2.88dsf/src/killall5.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/killall5.c 2014-03-26 00:49:52.982668074 -0700
++++ sysvinit-2.88dsf/src/killall5.c 2014-04-02 00:46:45.838771653 -0700
+@@ -846,9 +846,9 @@
+ char *oargv1, *pargv1;
+ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
+ if (o->argv1 && p->argv1) {
+- if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++ if ((oargv1 = realpath(o->argv1, NULL)) == NULL)
+ oargv1 = strdup(o->argv1);
+- if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++ if ((pargv1 = realpath(p->argv1, NULL)) == NULL)
+ pargv1 = strdup(p->argv1);
+ if (! strcmp(oargv1, pargv1)) {
+ ret = 1;
+Index: sysvinit-2.88dsf/src/wall.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/wall.c 2009-11-22 14:05:53.000000000 -0800
++++ sysvinit-2.88dsf/src/wall.c 2014-04-02 00:49:15.258772217 -0700
+@@ -29,6 +29,7 @@
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <syslog.h>
++#include <time.h>
+ #include "init.h"
+
+
diff --git a/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
new file mode 100644
index 000000000..ad65819b2
--- /dev/null
+++ b/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -0,0 +1,109 @@
+SUMMARY = "System-V like init"
+DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts."
+HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
+PR = "r14"
+
+RDEPENDS_${PN} = "${PN}-inittab"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \
+ file://install.patch \
+ file://crypt-lib.patch \
+ file://pidof-add-m-option.patch \
+ file://0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch \
+ file://realpath.patch \
+ file://rcS-default \
+ file://rc \
+ file://rcS \
+ file://bootlogd.init \
+ file://01_bootlogd \
+"
+
+SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f"
+SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519"
+
+S = "${WORKDIR}/sysvinit-${PV}"
+B = "${S}/src"
+
+inherit update-alternatives distro_features_check
+DEPENDS_append = " update-rc.d-native base-passwd"
+
+REQUIRED_DISTRO_FEATURES = "sysvinit"
+
+ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall"
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] = "50"
+
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+ALTERNATIVE_PRIORITY[mountpoint] = "20"
+
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+
+ALTERNATIVE_${PN}-pidof = "pidof"
+ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
+
+ALTERNATIVE_${PN}-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 sulogin.8 utmpdump.1"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+
+PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
+FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
+FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
+FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
+
+RDEPENDS_${PN} += "sysvinit-pidof initd-functions"
+
+CFLAGS_prepend = "-D_GNU_SOURCE "
+export LCRYPT = "-lcrypt"
+EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \
+ 'base_sbindir=${base_sbindir}' \
+ 'bindir=${bindir}' \
+ 'sbindir=${sbindir}' \
+ 'sysconfdir=${sysconfdir}' \
+ 'includedir=${includedir}' \
+ 'mandir=${mandir}'"
+
+do_install () {
+ oe_runmake 'ROOT=${D}' install
+
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/default \
+ ${D}${sysconfdir}/init.d
+ for level in S 0 1 2 3 4 5 6; do
+ install -d ${D}${sysconfdir}/rc$level.d
+ done
+
+ install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS
+ install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd
+ ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd
+
+ update-rc.d -r ${D} bootlogd start 07 S .
+ update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 .
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles
+
+ chown root.shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+ chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+}
diff --git a/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch b/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 000000000..fe2ba5328
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH] Revert "rules: remove firmware loading rules"
+
+This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ rules/50-firmware.rules | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 rules/50-firmware.rules
+
+diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
+new file mode 100644
+index 0000000..f0ae684
+--- /dev/null
++++ b/rules/50-firmware.rules
+@@ -0,0 +1,3 @@
++# do not edit this file, it will be overwritten on update
++
++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
+--
+2.3.3
+
diff --git a/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch b/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 000000000..db333e937
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,364 @@
+From e415372cc7a2f52e70e1cfa8c6c1f633b411355d Mon Sep 17 00:00:00 2001
+From: Lauren Post <lauren.post@nxp.com>
+Date: Wed, 8 Jun 2016 06:51:56 -0500
+Subject: [PATCH] Revert "udev: remove userspace firmware loading support"
+
+This reverts commit 3b717594600fa717cdf9bcfd0c7c1b703b245482.
+
+Conflicts:
+ configure.ac
+ src/udev/udevd.c
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lauren Post <lauren.post@nxp.com>
+---
+ configure.ac | 39 +++++++++-
+ rules/Makefile.am | 5 ++
+ src/udev/Makefile.am | 10 +++
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c | 3 +
+ src/udev/udev.h | 6 ++
+ src/udev/udevd.c | 13 ++++
+ 7 files changed, 227 insertions(+), 3 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+diff --git a/configure.ac b/configure.ac
+index 8691891..65028c2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -238,9 +238,42 @@ AC_CHECK_DECL([unshare],
+ [#include <sched.h>])
+
+ # ------------------------------------------------------------------------------
+-AC_PATH_TOOL(GPERF, gperf)
+-if test -z "$GPERF" ; then
+- AC_MSG_ERROR([*** gperf not found])
++AC_ARG_WITH(firmware-path,
++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
++ [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
++ [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
++OLD_IFS=$IFS
++IFS=:
++for i in $with_firmware_path; do
++ if test "x${FIRMWARE_PATH}" = "x"; then
++ FIRMWARE_PATH="\\\"${i}/\\\""
++ else
++ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
++ fi
++done
++IFS=$OLD_IFS
++AC_SUBST(FIRMWARE_PATH)
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([gudev],
++ AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
++ [], [enable_gudev=yes])
++AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
++AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([keymap],
++ AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
++ [], [enable_keymap=yes])
++
++if test "x$enable_keymap" = "xyes"; then
++ AC_PATH_TOOL(GPERF, gperf)
++ if test -z "$GPERF" ; then
++ AC_MSG_ERROR([*** gperf not found])
++ fi
++ AC_DEFINE([ENABLE_KEYMAP], [1], [Define if we are enabling rule generator])
+ fi
+
+ # ------------------------------------------------------------------------------
+diff --git a/rules/Makefile.am b/rules/Makefile.am
+index 24c099c..d714ae3 100644
+--- a/rules/Makefile.am
++++ b/rules/Makefile.am
+@@ -22,6 +22,11 @@ dist_udevrules_DATA += \
+ 80-net-name-slot.rules
+ endif
+
++if ENABLE_FIRMWARE
++dist_udevrules_DATA += \
++ 50-firmware.rules
++endif
++
+ if HAVE_BLKID
+ dist_udevrules_DATA += \
+ 60-persistent-storage.rules
+diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
+index 401af01..742fbc8 100644
+--- a/src/udev/Makefile.am
++++ b/src/udev/Makefile.am
+@@ -53,12 +53,18 @@ libudev_core_la_SOURCES = \
+ udev-ctrl.c \
+ udev-builtin.c \
+ udev-builtin-btrfs.c \
++ udev-builtin-firmware.c \
+ udev-builtin-hwdb.c \
+ udev-builtin-input_id.c \
+ udev-builtin-net_id.c \
+ udev-builtin-path_id.c \
+ udev-builtin-usb_id.c
+
++if ENABLE_FIRMWARE
++libudev_core_la_SOURCES += \
++ udev-builtin-firmware.c
++endif
++
+ include_HEADERS = \
+ udev.h
+
+@@ -86,6 +92,10 @@ libudev_core_la_LIBADD += \
+ $(KMOD_LIBS)
+ endif
+
++libudev_core_la_CPPFLAGS = \
++ $(AM_CPPFLAGS) \
++ -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
++
+ #
+ # Extras
+ #
+diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
+new file mode 100644
+index 0000000..bd8c2fb
+--- /dev/null
++++ b/src/udev/udev-builtin-firmware.c
+@@ -0,0 +1,154 @@
++/*
++ * firmware - Kernel firmware loader
++ *
++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details:*
++ */
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <getopt.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++
++#include "udev.h"
++
++static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
++ FILE *ldfile;
++
++ ldfile = fopen(loadpath, "we");
++ if (ldfile == NULL) {
++ log_error("error: can not open '%s'", loadpath);
++ return false;
++ };
++ fprintf(ldfile, "%s\n", state);
++ fclose(ldfile);
++ return true;
++}
++
++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
++ char *buf;
++ FILE *fsource = NULL, *ftarget = NULL;
++ bool ret = false;
++
++ buf = malloc(size);
++ if (buf == NULL) {
++ log_error("No memory available to load firmware file");
++ return false;
++ }
++
++ log_debug("writing '%s' (%zi) to '%s'", source, size, target);
++
++ fsource = fopen(source, "re");
++ if (fsource == NULL)
++ goto exit;
++ ftarget = fopen(target, "we");
++ if (ftarget == NULL)
++ goto exit;
++ if (fread(buf, size, 1, fsource) != 1)
++ goto exit;
++ if (fwrite(buf, size, 1, ftarget) == 1)
++ ret = true;
++exit:
++ if (ftarget != NULL)
++ fclose(ftarget);
++ if (fsource != NULL)
++ fclose(fsource);
++ free(buf);
++ return ret;
++}
++
++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
++ struct udev *udev = udev_device_get_udev(dev);
++ static const char *searchpath[] = { FIRMWARE_PATH };
++ char loadpath[UTIL_PATH_SIZE];
++ char datapath[UTIL_PATH_SIZE];
++ char fwpath[UTIL_PATH_SIZE];
++ const char *firmware;
++ FILE *fwfile = NULL;
++ struct utsname kernel;
++ struct stat statbuf;
++ unsigned int i;
++ int rc = EXIT_SUCCESS;
++
++ firmware = udev_device_get_property_value(dev, "FIRMWARE");
++ if (firmware == NULL) {
++ log_error("firmware parameter missing");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ /* lookup firmware file */
++ uname(&kernel);
++ for (i = 0; i < ELEMENTSOF(searchpath); i++) {
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++ }
++
++ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
++
++ if (fwfile == NULL) {
++ log_debug("did not find firmware file '%s'", firmware);
++ rc = EXIT_FAILURE;
++ /*
++ * Do not cancel the request in the initrd, the real root might have
++ * the firmware file and the 'coldplug' run in the real root will find
++ * this pending request and fulfill or cancel it.
++ * */
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ goto exit;
++ }
++
++ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ if (!set_loading(udev, loadpath, "1"))
++ goto exit;
++
++ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
++ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
++ log_error("error sending firmware '%s' to device", firmware);
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ };
++
++ set_loading(udev, loadpath, "0");
++exit:
++ if (fwfile)
++ fclose(fwfile);
++ return rc;
++}
++
++const struct udev_builtin udev_builtin_firmware = {
++ .name = "firmware",
++ .cmd = builtin_firmware,
++ .help = "kernel firmware loader",
++ .run_once = true,
++};
+diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
+index 74b3bdc..3657106 100644
+--- a/src/udev/udev-builtin.c
++++ b/src/udev/udev-builtin.c
+@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = {
+ [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
+ #endif
+ [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
++#ifdef HAVE_FIRMWARE
++ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
++#endif
+ [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
+ [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+ [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
+diff --git a/src/udev/udev.h b/src/udev/udev.h
+index 198cb2c..01a1e9c 100644
+--- a/src/udev/udev.h
++++ b/src/udev/udev.h
+@@ -149,6 +149,9 @@ enum udev_builtin_cmd {
+ UDEV_BUILTIN_BLKID,
+ #endif
+ UDEV_BUILTIN_BTRFS,
++#ifdef HAVE_FIRMWARE
++ UDEV_BUILTIN_FIRMWARE,
++#endif
+ UDEV_BUILTIN_HWDB,
+ UDEV_BUILTIN_INPUT_ID,
+ UDEV_BUILTIN_KEYBOARD,
+@@ -173,6 +176,9 @@ struct udev_builtin {
+ extern const struct udev_builtin udev_builtin_blkid;
+ #endif
+ extern const struct udev_builtin udev_builtin_btrfs;
++#ifdef HAVE_FIRMWARE
++extern const struct udev_builtin udev_builtin_firmware;
++#endif
+ extern const struct udev_builtin udev_builtin_hwdb;
+ extern const struct udev_builtin udev_builtin_input_id;
+ extern const struct udev_builtin udev_builtin_keyboard;
+diff --git a/src/udev/udevd.c b/src/udev/udevd.c
+index b1de97a..35655d8 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -101,6 +101,9 @@ struct event {
+ bool is_block;
+ usec_t start_usec;
+ bool warned;
++#ifdef HAVE_FIRMWARE
++ bool nodelay;
++#endif
+ };
+
+ static inline struct event *node_to_event(struct udev_list_node *node) {
+@@ -491,6 +494,10 @@ static int event_queue_insert(struct udev_device *dev) {
+ event->devnum = udev_device_get_devnum(dev);
+ event->is_block = streq("block", udev_device_get_subsystem(dev));
+ event->ifindex = udev_device_get_ifindex(dev);
++#ifdef HAVE_FIRMWARE
++ if (streq(udev_device_get_subsystem(dev), "firmware"))
++ event->nodelay = true;
++#endif
+
+ log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
+ udev_device_get_action(dev), udev_device_get_subsystem(dev));
+@@ -566,6 +573,12 @@ static bool is_devpath_busy(struct event *event) {
+ return true;
+ }
+
++#ifdef HAVE_FIRMWARE
++ /* allow to bypass the dependency tracking */
++ if (event->nodelay)
++ continue;
++#endif
++
+ /* parent device event found */
+ if (event->devpath[common] == '/') {
+ event->delaying_seqnum = loop_event->seqnum;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-core/udev/eudev/devfs-udev.rules b/poky/meta/recipes-core/udev/eudev/devfs-udev.rules
new file mode 100644
index 000000000..0ba1ad4e7
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/devfs-udev.rules
@@ -0,0 +1,108 @@
+# The use of these rules is not recommended or supported.
+# In a world where devices can come and go at any time, the devfs scheme
+# of simple device enumeration does not help _anything_. Just forget about
+# it. Use custom rules to name your device or look at the persistent device
+# naming scheme, which is implemented for disks and add your subsystem.
+
+# ide block devices
+BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
+
+# md block devices
+KERNEL="md[0-9]*", NAME="md/%n"
+
+# floppy devices
+KERNEL="fd[0-9]*", NAME="floppy/%n"
+
+# tty devices
+KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
+KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
+KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
+
+# vc devices
+KERNEL="vcs", NAME="vcc/0"
+KERNEL="vcs[0-9]*", NAME="vcc/%n"
+KERNEL="vcsa", NAME="vcc/a0"
+KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
+
+# v4l devices
+KERNEL="video[0-9]*", NAME="v4l/video%n"
+KERNEL="radio[0-9]*", NAME="v4l/radio%n"
+KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
+KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
+
+# dm devices (ignore them)
+KERNEL="dm-[0-9]*", NAME=""
+
+# i2c devices
+KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
+
+# loop devices
+KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
+
+# ramdisks
+KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
+
+# framebuffer devices
+KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
+
+# misc
+KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
+KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
+KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
+KERNEL="uinput", NAME="misc/%k", SYMLINK="%k"
+
+# alsa devices
+KERNEL="controlC[0-9]*", NAME="snd/%k"
+KERNEL="hw[CD0-9]*", NAME="snd/%k"
+KERNEL="pcm[CD0-9cp]*", NAME="snd/%k"
+KERNEL="midi[CD0-9]*", NAME="snd/%k"
+KERNEL="timer", NAME="snd/%k"
+KERNEL="seq", NAME="snd/%k"
+
+# oss devices
+KERNEL="audio*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k"
+KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="midi*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k"
+
+# input devices
+KERNEL="mice", NAME="input/%k"
+KERNEL="mouse*", NAME="input/%k"
+KERNEL="event*", NAME="input/%k"
+KERNEL="js*", NAME="input/%k"
+KERNEL="ts*", NAME="input/%k"
+
+# USB devices
+KERNEL="hiddev*", NAME="usb/%k"
+KERNEL="auer*", NAME="usb/%k"
+KERNEL="legousbtower*", NAME="usb/%k"
+KERNEL="dabusb*", NAME="usb/%k"
+BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k"
+
+# netlink devices
+KERNEL="route", NAME="netlink/%k"
+KERNEL="skip", NAME="netlink/%k"
+KERNEL="usersock", NAME="netlink/%k"
+KERNEL="fwmonitor", NAME="netlink/%k"
+KERNEL="tcpdiag", NAME="netlink/%k"
+KERNEL="nflog", NAME="netlink/%k"
+KERNEL="xfrm", NAME="netlink/%k"
+KERNEL="arpd", NAME="netlink/%k"
+KERNEL="route6", NAME="netlink/%k"
+KERNEL="ip6_fw", NAME="netlink/%k"
+KERNEL="dnrtmsg", NAME="netlink/%k"
+KERNEL="tap*", NAME="netlink/%k"
+
+# CAPI devices
+KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20"
+KERNEL="capi*", NAME="capi/%n"
+
+# Network devices
+KERNEL="tun", NAME="net/%k"
+
+# raw devices
+KERNEL="raw[0-9]*", NAME="raw/%k"
diff --git a/poky/meta/recipes-core/udev/eudev/init b/poky/meta/recipes-core/udev/eudev/init
new file mode 100644
index 000000000..0455ade25
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/init
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: udev
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+kill_udevd () {
+ pid=`pidof -x udevd`
+ [ -n "$pid" ] && kill $pid
+}
+
+case "$1" in
+ start)
+ export ACTION=add
+ # propagate /dev from /sys
+ echo "Starting udev"
+
+ # Check for requireed devtmpfs before trying to start udev and
+ # mount a no-existant fs.
+ if ! grep -q devtmpfs /proc/filesystems
+ then
+ echo "Missing devtmpfs, which is required for udev to run";
+ echo "Halting..."
+ halt
+ fi
+ # mount the devtmpfs on /dev, if not already done
+ LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+ mount -n -o mode=0755 -t devtmpfs none "/dev"
+ }
+ [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+ [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+ # the automount rule for udev needs /tmp directory available, as /tmp is a symlink
+ # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure
+ # /var/volatile/tmp directory to be available.
+ mkdir -m 1777 -p /var/volatile/tmp
+
+ # make_extra_nodes
+ kill_udevd > "/dev/null" 2>&1
+
+ # trigger the sorted events
+ [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
+ @UDEVD@ -d
+
+ udevadm control --env=STARTUP=1
+ if [ "$not_first_boot" != "" ];then
+ if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then
+ PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform"
+ else
+ PLATFORM_BUS_NOMATCH=""
+ fi
+ udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH
+ (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+ else
+ udevadm trigger --action=add
+ udevadm settle
+ fi
+ ;;
+ stop)
+ echo "Stopping udevd"
+ start-stop-daemon --stop --name udevd --quiet
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ pid=`pidof -x udevd`
+ if [ -n "$pid" ]; then
+ echo "udevd (pid $pid) is running ..."
+ else
+ echo "udevd is stopped"
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+exit 0
diff --git a/poky/meta/recipes-core/udev/eudev/links.conf b/poky/meta/recipes-core/udev/eudev/links.conf
new file mode 100644
index 000000000..8fff922db
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/links.conf
@@ -0,0 +1,21 @@
+# This file does not exist. Please do not ask the debian maintainer about it.
+# You may use it to do strange and wonderful things, at your risk.
+
+L fd /proc/self/fd
+L stdin /proc/self/fd/0
+L stdout /proc/self/fd/1
+L stderr /proc/self/fd/2
+L core /proc/kcore
+L sndstat /proc/asound/oss/sndstat
+L MAKEDEV /sbin/MAKEDEV
+
+D pts
+D shm
+
+# Hic sunt leones.
+M ppp c 108 0
+D loop
+M loop/0 b 7 0
+D net
+M net/tun c 10 200
+
diff --git a/poky/meta/recipes-core/udev/eudev/local.rules b/poky/meta/recipes-core/udev/eudev/local.rules
new file mode 100644
index 000000000..d502cdd6b
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/local.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS,
+# has an EV_ABS value (-a) which is used for touchscreen type devices.
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
diff --git a/poky/meta/recipes-core/udev/eudev/permissions.rules b/poky/meta/recipes-core/udev/eudev/permissions.rules
new file mode 100644
index 000000000..205b73329
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/permissions.rules
@@ -0,0 +1,131 @@
+ACTION!="add", GOTO="permissions_end"
+
+# workarounds needed to synchronize with sysfs
+# only needed for kernels < v2.6.18-rc1
+ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
+SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
+# only needed for kernels < 2.6.16
+SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
+# only needed for kernels < 2.6.17
+SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
+
+# devices needed to load the drivers providing them
+KERNEL=="tun", OPTIONS+="ignore_remove"
+KERNEL=="ppp", OPTIONS+="ignore_remove"
+KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove"
+
+# default permissions for block devices
+SUBSYSTEM=="block", GROUP="disk"
+# the aacraid driver is broken and reports that disks removable (see #404927)
+SUBSYSTEM=="block", ATTRS{removable}=="1", \
+ DRIVERS!="aacraid", GROUP="floppy"
+# all block devices on these buses are "removable"
+SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
+
+# IDE devices
+KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \
+ IMPORT{program}="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*", GROUP="cdrom"
+KERNEL=="ht[0-9]*", GROUP="tape"
+KERNEL=="nht[0-9]*", GROUP="tape"
+
+# SCSI devices
+KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
+SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape"
+
+# USB devices
+KERNEL=="legousbtower*", MODE="0666"
+KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
+
+# usbfs-like devices
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
+ MODE="0664"
+
+# iRiver music players
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
+ ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
+
+# serial devices
+SUBSYSTEM=="tty", GROUP="dialout"
+SUBSYSTEM=="capi", GROUP="dialout"
+SUBSYSTEM=="slamr", GROUP="dialout"
+SUBSYSTEM=="zaptel", GROUP="dialout"
+
+# vc devices (all members of the tty subsystem)
+KERNEL=="ptmx", MODE="0666", GROUP="root"
+KERNEL=="console", MODE="0600", GROUP="root"
+KERNEL=="tty", MODE="0666", GROUP="root"
+KERNEL=="tty[0-9]*", GROUP="root"
+KERNEL=="pty*", MODE="0666", GROUP="tty"
+
+# video devices
+SUBSYSTEM=="video4linux", GROUP="video"
+SUBSYSTEM=="drm", GROUP="video"
+SUBSYSTEM=="dvb", GROUP="video"
+SUBSYSTEM=="em8300", GROUP="video"
+SUBSYSTEM=="graphics", GROUP="video"
+SUBSYSTEM=="nvidia", GROUP="video"
+
+# misc devices
+KERNEL=="random", MODE="0666"
+KERNEL=="urandom", MODE="0666"
+KERNEL=="mem", MODE="0640", GROUP="kmem"
+KERNEL=="kmem", MODE="0640", GROUP="kmem"
+KERNEL=="port", MODE="0640", GROUP="kmem"
+KERNEL=="full", MODE="0666"
+KERNEL=="null", MODE="0666"
+KERNEL=="zero", MODE="0666"
+KERNEL=="inotify", MODE="0666"
+KERNEL=="sgi_fetchop", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+KERNEL=="agpgart", GROUP="video"
+KERNEL=="nvram", GROUP="nvram"
+KERNEL=="rtc|rtc[0-9]*", GROUP="audio"
+KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss"
+KERNEL=="fuse", GROUP="fuse"
+KERNEL=="kqemu", MODE="0666"
+KERNEL=="kvm", GROUP="kvm"
+KERNEL=="tun", MODE="0666",
+
+KERNEL=="cdemu[0-9]*", GROUP="cdrom"
+KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
+KERNEL=="pktcdvd", MODE="0644"
+
+KERNEL=="uverbs*", GROUP="rdma"
+KERNEL=="ucm*", GROUP="rdma"
+KERNEL=="rdma_ucm", GROUP="rdma"
+
+# printers and parallel devices
+SUBSYSTEM=="printer", GROUP="lp"
+SUBSYSTEM=="ppdev", GROUP="lp"
+KERNEL=="irlpt*", GROUP="lp"
+KERNEL=="pt[0-9]*", GROUP="tape"
+KERNEL=="pht[0-9]*", GROUP="tape"
+
+# sound devices
+SUBSYSTEM=="sound", GROUP="audio"
+
+# ieee1394 devices
+KERNEL=="raw1394", GROUP="disk"
+KERNEL=="dv1394*", GROUP="video"
+KERNEL=="video1394*", GROUP="video"
+
+# input devices
+KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
+ MODE="0664", GROUP="video"
+KERNEL=="js[0-9]*", MODE="0664"
+KERNEL=="lirc[0-9]*", GROUP="video"
+
+# AOE character devices
+SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
+SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
+
+LABEL="permissions_end"
+
diff --git a/poky/meta/recipes-core/udev/eudev/run.rules b/poky/meta/recipes-core/udev/eudev/run.rules
new file mode 100644
index 000000000..75d71375b
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/run.rules
@@ -0,0 +1,14 @@
+# debugging monitor
+RUN+="socket:/org/kernel/udev/monitor"
+
+# run a command on remove events
+ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
+
+# ignore the events generated by virtual consoles
+KERNEL=="ptmx", OPTIONS+="last_rule"
+KERNEL=="console", OPTIONS+="last_rule"
+KERNEL=="tty" , OPTIONS+="last_rule"
+KERNEL=="tty[0-9]*", OPTIONS+="last_rule"
+KERNEL=="pty*", OPTIONS+="last_rule"
+SUBSYSTEM=="vc", OPTIONS+="last_rule"
+
diff --git a/poky/meta/recipes-core/udev/eudev/udev.rules b/poky/meta/recipes-core/udev/eudev/udev.rules
new file mode 100644
index 000000000..a19d4a0bf
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev/udev.rules
@@ -0,0 +1,116 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# workaround for devices which do not report media changes
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
+ ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions"
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
+ OPTIONS+="all_partitions"
+
+# SCSI devices
+SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
+
+# USB devices
+SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
+ ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
+ SYMLINK+="pilot"
+
+# usbfs-like devices
+SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
+ NAME="%c"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
+
+# serial devices
+KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
+KERNEL=="capi[0-9]*", NAME="capi/%n"
+
+# video devices
+KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \
+ NAME="%c"
+KERNEL=="card[0-9]*", NAME="dri/%k"
+
+# misc devices
+KERNEL=="hw_random", NAME="hwrng"
+KERNEL=="tun", NAME="net/%k"
+KERNEL=="evtchn", NAME="xen/%k"
+
+KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
+KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
+KERNEL=="pktcdvd", NAME="pktcdvd/control"
+
+KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
+KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
+KERNEL=="microcode", NAME="cpu/microcode"
+
+KERNEL=="umad*", NAME="infiniband/%k"
+KERNEL=="issm*", NAME="infiniband/%k"
+KERNEL=="uverbs*", NAME="infiniband/%k"
+KERNEL=="ucm*", NAME="infiniband/%k"
+KERNEL=="rdma_ucm", NAME="infiniband/%k"
+
+# ALSA devices
+KERNEL=="controlC[0-9]*", NAME="snd/%k"
+KERNEL=="hwC[D0-9]*", NAME="snd/%k"
+KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
+KERNEL=="midiC[D0-9]*", NAME="snd/%k"
+KERNEL=="timer", NAME="snd/%k"
+KERNEL=="seq", NAME="snd/%k"
+
+# ieee1394 devices
+KERNEL=="dv1394*", NAME="dv1394/%n"
+KERNEL=="video1394*", NAME="video1394/%n"
+
+# input devices
+KERNEL=="mice", NAME="input/%k"
+KERNEL=="mouse[0-9]*", NAME="input/%k"
+KERNEL=="event[0-9]*", NAME="input/%k"
+KERNEL=="js[0-9]*", NAME="input/%k"
+KERNEL=="ts[0-9]*", NAME="input/%k"
+KERNEL=="uinput", NAME="input/%k"
+
+# Zaptel
+KERNEL=="zapctl", NAME="zap/ctl"
+KERNEL=="zaptimer", NAME="zap/timer"
+KERNEL=="zapchannel", NAME="zap/channel"
+KERNEL=="zappseudo", NAME="zap/pseudo"
+KERNEL=="zap[0-9]*", NAME="zap/%n"
+
+# AOE character devices
+SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k"
+
+# device mapper creates its own device nodes, so ignore these
+KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
+KERNEL=="device-mapper", NAME="mapper/control"
+
+KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
+
+# Firmware Helper
+ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh"
+
+# Samsung UARTS
+KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n"
+
+# MXC UARTs
+KERNEL=="ttymxc[0-4]", NAME="ttymxc%n"
+
diff --git a/poky/meta/recipes-core/udev/eudev_3.2.5.bb b/poky/meta/recipes-core/udev/eudev_3.2.5.bb
new file mode 100644
index 000000000..88ad8f1b3
--- /dev/null
+++ b/poky/meta/recipes-core/udev/eudev_3.2.5.bb
@@ -0,0 +1,92 @@
+SUMMARY = "eudev is a fork of systemd's udev"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+LICENSE = "GPLv2.0+ & LGPL-2.1+"
+LICENSE_libudev = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
+
+PROVIDES = "udev"
+
+SRC_URI = "http://dev.gentoo.org/~blueness/${BPN}/${BP}.tar.gz \
+ file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+ file://Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+ file://devfs-udev.rules \
+ file://init \
+ file://links.conf \
+ file://local.rules \
+ file://permissions.rules \
+ file://run.rules \
+ file://udev.rules \
+"
+
+SRC_URI[md5sum] = "6ca08c0e14380f87df8e8aceac123671"
+SRC_URI[sha256sum] = "49c2d04105cad2526302627e040fa24b1916a9a3e059539bc8bb919b973890af"
+
+inherit autotools update-rc.d qemu pkgconfig distro_features_check
+
+CONFLICT_DISTRO_FEATURES = "systemd"
+
+EXTRA_OECONF = " \
+ --sbindir=${base_sbindir} \
+ --with-rootlibdir=${base_libdir} \
+ --with-rootprefix= \
+"
+
+PACKAGECONFIG ??= "hwdb"
+PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+ sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
+
+ # Use classic network interface naming scheme
+ touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
+
+ # hid2hci has moved to bluez4. removed in udev as of version 169
+ rm -f ${D}${base_libdir}/udev/hid2hci
+}
+
+do_install_prepend_class-target () {
+ # Remove references to buildmachine
+ sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ ${B}/src/udev/keyboard-keys-from-name.h
+}
+
+INITSCRIPT_NAME = "udev"
+INITSCRIPT_PARAMS = "start 04 S ."
+
+PACKAGES =+ "libudev"
+PACKAGES =+ "eudev-hwdb"
+
+
+FILES_${PN} += "${libexecdir} ${base_libdir}/udev ${bindir}/udevadm"
+FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
+ ${includedir}/libudev.h ${libdir}/libudev.so \
+ ${includedir}/udev.h ${libdir}/libudev.la \
+ ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
+
+RDEPENDS_eudev-hwdb += "eudev"
+
+RPROVIDES_${PN} = "hotplug udev"
+RPROVIDES_eudev-hwdb += "udev-hwdb"
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+pkg_postinst_eudev-hwdb () {
+ if test -n "$D"; then
+ ${@qemu_run_binary(d, '$D', '${bindir}/udevadm')} hwdb --update --root $D
+ chown root:root $D${sysconfdir}/udev/hwdb.bin
+ else
+ udevadm hwdb --update
+ fi
+}
+
+pkg_prerm_eudev-hwdb () {
+ rm -f $D${sysconfdir}/udev/hwdb.bin
+}
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/automount.rules b/poky/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 000000000..62578ea63
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/automount.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules b/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 000000000..19676aa13
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules b/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 000000000..3d51d3e39
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules
@@ -0,0 +1,23 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+#The first framebuffer is symlinked to /dev/fb
+KERNEL=="fb0", SYMLINK+="fb"
+
+# Make all input devices read-write to the input group
+SUBSYSTEM=="input", GROUP="input", MODE="660"
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 000000000..e49349428
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist
@@ -0,0 +1,5 @@
+/dev/loop
+/dev/ram
+/dev/mtdblock
+/dev/md
+/dev/dm-*
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/mount.sh b/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 000000000..d760328a0
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# Called from udev
+#
+# Attempt to mount any added block devices and umount any removed devices
+
+
+MOUNT="/bin/mount"
+PMOUNT="/usr/bin/pmount"
+UMOUNT="/bin/umount"
+for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*`
+do
+ if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
+ then
+ logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
+ exit 0
+ fi
+done
+
+automount() {
+ name="`basename "$DEVNAME"`"
+
+ ! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
+ # Silent util-linux's version of mounting auto
+ if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
+ then
+ MOUNT="$MOUNT -o silent"
+ fi
+
+ # If filesystem type is vfat, change the ownership group to 'disk', and
+ # grant it with w/r/x permissions.
+ case $ID_FS_TYPE in
+ vfat|fat)
+ MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
+ ;;
+ # TODO
+ *)
+ ;;
+ esac
+
+ if ! $MOUNT -t auto $DEVNAME "/run/media/$name"
+ then
+ #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!"
+ rm_dir "/run/media/$name"
+ else
+ logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful"
+ touch "/tmp/.automount-$name"
+ fi
+}
+
+rm_dir() {
+ # We do not want to rm -r populated directories
+ if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
+ then
+ ! test -z "$1" && rm -r "$1"
+ else
+ logger "mount.sh/automount" "Not removing non-empty directory [$1]"
+ fi
+}
+
+# No ID_FS_TYPE for cdrom device, yet it should be mounted
+name="`basename "$DEVNAME"`"
+[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
+
+if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
+ if [ -x "$PMOUNT" ]; then
+ $PMOUNT $DEVNAME 2> /dev/null
+ elif [ -x $MOUNT ]; then
+ $MOUNT $DEVNAME 2> /dev/null
+ fi
+
+ # If the device isn't mounted at this point, it isn't
+ # configured in fstab (note the root filesystem can show up as
+ # /dev/root in /proc/mounts, so check the device number too)
+ if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
+ grep -q "^$DEVNAME " /proc/mounts || automount
+ fi
+fi
+
+
+if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
+ for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
+ do
+ $UMOUNT $mnt
+ done
+
+ # Remove empty directories from auto-mounter
+ name="`basename "$DEVNAME"`"
+ test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name"
+fi
diff --git a/poky/meta/recipes-core/udev/udev-extraconf/network.sh b/poky/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 000000000..3ee92714a
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf/network.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# We get two "add" events for hostap cards due to wifi0
+echo "$INTERFACE" | grep -q wifi && exit 0
+
+# udevd does clearenv(). Export shell PATH to children.
+export PATH
+
+# Check if /etc/init.d/network has been run yet to see if we are
+# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
+#
+# At this stage, network interfaces should not be brought up
+# automatically because:
+# a) /etc/init.d/network has not been run yet (security issue)
+# b) /var has not been populated yet so /etc/resolv,conf points to
+# oblivion, making the network unusable
+#
+
+spoofp="`grep ^spoofprotect /etc/network/options`"
+if test -z "$spoofp"
+then
+ # This is the default from /etc/init.d/network
+ spoofp_val=yes
+else
+ spoofp_val=${spoofp#spoofprotect=}
+fi
+
+test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
+
+# I think it is safe to assume that "lo" will always be there ;)
+if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
+then
+ echo "$INTERFACE" >> /dev/udev_network_queue
+ exit 0
+fi
+
+#
+# Code taken from pcmcia-cs:/etc/pcmcia/network
+#
+
+# if this interface has an entry in /etc/network/interfaces, let ifupdown
+# handle it
+if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
+ case $ACTION in
+ add)
+ ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
+ ;;
+ remove)
+ ifdown $INTERFACE
+ ;;
+ esac
+
+ exit 0
+fi
diff --git a/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb b/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
new file mode 100644
index 000000000..43a1cff73
--- /dev/null
+++ b/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Extra machine specific configuration files"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+ file://automount.rules \
+ file://mount.sh \
+ file://mount.blacklist \
+ file://autonet.rules \
+ file://network.sh \
+ file://localextra.rules \
+"
+
+S = "${WORKDIR}"
+
+
+do_install() {
+ install -d ${D}${sysconfdir}/udev/rules.d
+
+ install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules
+ install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules
+ install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules
+
+ install -d ${D}${sysconfdir}/udev/mount.blacklist.d
+ install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
+
+ install -d ${D}${sysconfdir}/udev/scripts/
+
+ install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
+ install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
+}
+
+FILES_${PN} = "${sysconfdir}/udev"
+RDEPENDS_${PN} = "udev"
+CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist"
+
+# to replace udev-extra-rules from meta-oe
+RPROVIDES_${PN} = "udev-extra-rules"
+RREPLACES_${PN} = "udev-extra-rules"
+RCONFLICTS_${PN} = "udev-extra-rules"
diff --git a/poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
new file mode 100644
index 000000000..fb443ff15
--- /dev/null
+++ b/poky/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+--- update-rc.d/update-rc.d.org 2005-01-03 00:30:47.000000000 +0200
++++ update-rc.d/update-rc.d 2007-12-01 19:41:08.000000000 +0200
+@@ -19,6 +19,7 @@
+ notreally=0
+ force=0
+ dostart=0
++verbose=0
+
+ usage()
+ {
+@@ -28,6 +29,7 @@
+ update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] .
+ -n: not really
+ -f: force
++ -v: verbose
+ -r: alternate root path (default is /)
+ -s: invoke start methods if appropriate to current runlevel
+ EOF
+@@ -69,7 +71,7 @@
+ lev=`echo $2 | cut -d/ -f1`
+ nn=`echo $2 | cut -d/ -f2`
+ fn="${etcd}${lev}.d/${startstop}${nn}${bn}"
+- echo " $fn -> ../init.d/$bn"
++ [ $verbose -eq 1 ] && echo " $fn -> ../init.d/$bn"
+ if [ $notreally -eq 0 ]; then
+ mkdir -p `dirname $fn`
+ ln -s ../init.d/$bn $fn
+@@ -89,7 +91,7 @@
+ exit 0
+ fi
+
+- echo " Adding system startup for $initd/$bn ..."
++ echo " Adding system startup for $initd/$bn."
+
+ for i in $startlinks; do
+ dolink S $i
+@@ -105,6 +107,10 @@
+ shift
+ continue
+ ;;
++ -v) verbose=1
++ shift
++ continue
++ ;;
+ -f) force=1
+ shift
+ continue
diff --git a/poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
new file mode 100644
index 000000000..075171a5a
--- /dev/null
+++ b/poky/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
@@ -0,0 +1,59 @@
+Check if symlinks are valid
+
+When using root option and $initd/$bn is a symlink, the script would fail because
+the symlink points to a path on target. For example:
+
+/path/to/target/rootfs/etc/init.d/syslog -> /etc/init.d/syslog.busybox
+
+Hence, [ -f /path/to/target/rootfs/etc/init.d/syslog ] condition would return
+false.
+
+This patch adds the posibility to check whether the file the symlink points to
+actually exists in rootfs path and then continue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+Index: git/update-rc.d
+===================================================================
+--- git.orig/update-rc.d
++++ git/update-rc.d
+@@ -147,13 +147,34 @@ fi
+ bn=$1
+ shift
+
++sn=$initd/$bn
++if [ -L "$sn" -a -n "$root" ]; then
++ if which readlink >/dev/null; then
++ while true; do
++ linksn="$(readlink "$sn")"
++ if [ -z "$linksn" ]; then
++ break
++ fi
++
++ sn="$linksn"
++ case "$sn" in
++ /*) sn="$root$sn" ;;
++ *) sn="$initd/$sn" ;;
++ esac
++ done
++ else
++ echo "update-rc.d: readlink tool not present, cannot check whether \
++ $sn symlink points to a valid file." >&2
++ fi
++fi
++
+ if [ $1 != "remove" ]; then
+- if [ ! -f "$initd/$bn" ]; then
++ if [ ! -f "$sn" ]; then
+ echo "update-rc.d: $initd/$bn: file does not exist" >&2
+ exit 1
+ fi
+ else
+- if [ -f "$initd/$bn" ]; then
++ if [ -f "$sn" ]; then
+ if [ $force -eq 1 ]; then
+ echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2
+ else
diff --git a/poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch b/poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch
new file mode 100644
index 000000000..85bc234a2
--- /dev/null
+++ b/poky/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Fix to handle priority numbers correctly.
+Previously, if the priority number is '08' or '09', for example,
+the script cannot handle them correctly as these numbers are treated
+as octal numbers.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ update-rc.d | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/update-rc.d b/update-rc.d
+index ec50d15..c70b859 100644
+--- a/update-rc.d
++++ b/update-rc.d
+@@ -205,7 +205,7 @@ case $1 in
+ exit 1
+ fi
+ shift
+- NN=`printf %02d $1`
++ NN=`printf %02d $(expr $1 + 0)`
+ shift
+ while [ "x$1" != "x." ]; do
+ if [ $# -eq 0 ]; then
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb b/poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
new file mode 100644
index 000000000..76d4312d8
--- /dev/null
+++ b/poky/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
@@ -0,0 +1,33 @@
+SUMMARY = "manage symlinks in /etc/rcN.d"
+HOMEPAGE = "http://github.com/philb/update-rc.d/"
+DESCRIPTION = "update-rc.d is a utility that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure."
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75"
+
+PR = "r5"
+
+# Revision corresponding to tag update-rc.d_0.7
+SRCREV = "eca680ddf28d024954895f59a241a622dd575c11"
+
+SRC_URI = "git://github.com/philb/update-rc.d.git \
+ file://add-verbose.patch \
+ file://check-if-symlinks-are-valid.patch \
+ file://fix-to-handle-priority-numbers-correctly.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+do_compile() {
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-core/util-linux/util-linux.inc b/poky/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 000000000..0b7db529f
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,338 @@
+SUMMARY = "A suite of basic system administration utilities"
+HOMEPAGE = "http://userweb.kernel.org/~kzak/util-linux/"
+DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \
+commonly found on most Linux systems. Some of the more important utilities include \
+disk partitioning, kernel message management, filesystem creation, and system login."
+
+SECTION = "base"
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
+
+LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+ file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+ file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
+ file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \
+ file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
+ file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
+
+#gtk-doc is not enabled as it requires xmlto which requires util-linux
+inherit autotools gettext pkgconfig systemd update-alternatives python3-dir bash-completion ptest
+DEPENDS = "zlib ncurses virtual/crypt"
+DEPENDS_append_class-native = " lzo-native"
+DEPENDS_append_class-nativesdk = " lzo-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \
+ "
+
+PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
+ util-linux-swaponoff util-linux-losetup util-linux-umount \
+ util-linux-mount util-linux-readprofile util-linux-uuidd \
+ util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+ util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-rfkill \
+ util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
+ util-linux-partx util-linux-hwclock util-linux-mountpoint \
+ util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit \
+ util-linux-ionice util-linux-switch-root"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
+
+PACKAGES_DYNAMIC = "^util-linux-lib.*"
+
+SHARED_EXTRA_OECONF = "--disable-use-tty-group \
+ --disable-makeinstall-chown \
+ --enable-kill --enable-last --enable-mesg --enable-partx \
+ --enable-raw --enable-rfkill --disable-login \
+ --disable-vipw --disable-newgrp --disable-chfn-chsh \
+ --enable-write --enable-mount \
+ --enable-libuuid --enable-libblkid --enable-fsck \
+ --disable-minix --disable-bfs --without-udev \
+ usrsbin_execdir='${sbindir}' \
+"
+
+EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+
+PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
+
+# Respect the systemd feature for uuidd
+PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemd --without-systemdsystemunitdir,systemd"
+
+# Build setpriv requires libcap-ng
+PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
+
+# Build python bindings for libmount
+PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3"
+
+# Readline support
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+
+FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
+
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
+
+FILES_util-linux-agetty = "${base_sbindir}/agetty"
+FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
+FILES_util-linux-fstrim = "${base_sbindir}/fstrim"
+FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
+FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
+FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}"
+FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
+FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
+FILES_util-linux-mcookie = "${bindir}/mcookie"
+FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
+FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
+FILES_util-linux-uuidgen = "${bindir}/uuidgen"
+FILES_util-linux-uuidd = "${sbindir}/uuidd"
+FILES_util-linux-rfkill = "${sbindir}/rfkill*"
+FILES_util-linux-partx = "${sbindir}/partx"
+FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
+FILES_util-linux-findfs = "${sbindir}/findfs"
+FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
+FILES_util-linux-runuser = "${sbindir}/runuser"
+FILES_util-linux-prlimit = "${bindir}/prlimit"
+FILES_util-linux-ionice = "${bindir}/ionice"
+FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l"
+CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
+
+FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
+ ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
+ ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
+FILES_util-linux-lsblk = "${bindir}/lsblk"
+FILES_util-linux-lscpu = "${bindir}/lscpu"
+
+FILES_util-linux-fsck = "${base_sbindir}/fsck*"
+FILES_util-linux-mkfs = "${sbindir}/mkfs"
+
+FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
+FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
+
+FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
+
+FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
+
+# Util-linux' blkid replaces the e2fsprogs one
+FILES_util-linux-blkid = "${base_sbindir}/blkid*"
+RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
+RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
+
+RDEPENDS_util-linux-runuser += "libpam"
+RDEPENDS_util-linux-su += "libpam"
+
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
+
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit util-linux-ionice util-linux-switch-root"
+
+RRECOMMENDS_${PN}_class-native = ""
+RRECOMMENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
+
+#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim"
+SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service"
+SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable"
+SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service"
+SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable"
+
+do_compile () {
+ set -e
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'
+}
+
+do_install () {
+ # with ccache the timestamps on compiled files may
+ # end up earlier than on their inputs, this allows
+ # for the resultant compilation in the install step.
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+ mkdir -p ${D}${base_bindir}
+
+ sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
+ sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
+ binprogs_a="dmesg getopt kill more umount mount login su mountpoint"
+
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ mkdir -p ${D}${base_sbindir}
+ for p in $sbinprogs $sbinprogs_a; do
+ if [ -f "${D}${sbindir}/$p" ]; then
+ mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
+ fi
+ done
+ fi
+
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ for p in $binprogs_a; do
+ if [ -f "${D}${bindir}/$p" ]; then
+ mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
+ fi
+ done
+ fi
+
+ install -d ${D}${sysconfdir}/default/
+ echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
+
+ rm -f ${D}${bindir}/chkdupexe
+
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser
+ install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l
+ fi
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
+ # Required for "su -" aka "su --login" because
+ # otherwise it uses "other", which has "auth pam_deny.so"
+ # and thus prevents the operation.
+ ln -s su ${D}${sysconfdir}/pam.d/su-l
+ fi
+}
+
+# nologin causes a conflict with shadow-native
+# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir})
+do_install_append_class-native () {
+ rm -f ${D}${base_sbindir}/nologin
+ rm -f ${D}${base_bindir}/kill
+}
+
+ALTERNATIVE_PRIORITY = "80"
+
+ALTERNATIVE_${PN} = "dmesg kill more mkswap blockdev pivot_root switch_root"
+ALTERNATIVE_${PN} += "hexdump last lastb logger mesg renice wall"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject nologin taskset"
+
+ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
+ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
+ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
+ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
+ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
+ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
+ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
+ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 eject.1 logger.1"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
+ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
+ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
+ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
+ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
+ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
+
+ALTERNATIVE_util-linux-hwclock = "hwclock"
+ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
+
+ALTERNATIVE_util-linux-fdisk = "fdisk"
+ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
+
+ALTERNATIVE_util-linux-agetty = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
+
+ALTERNATIVE_util-linux-mount = "mount"
+ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
+
+ALTERNATIVE_util-linux-umount = "umount"
+ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
+
+ALTERNATIVE_util-linux-readprofile = "readprofile"
+ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile"
+
+ALTERNATIVE_util-linux-losetup = "losetup"
+ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
+
+ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
+ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
+ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
+
+ALTERNATIVE_util-linux-fsck = "fsck"
+ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
+
+ALTERNATIVE_util-linux-blkid = "blkid"
+ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
+
+ALTERNATIVE_util-linux-rfkill = "rfkill"
+ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill"
+
+ALTERNATIVE_util-linux-getopt = "getopt"
+ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
+
+ALTERNATIVE_util-linux-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+ALTERNATIVE_util-linux-mountpoint = "mountpoint"
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+
+BBCLASSEXTEND = "native nativesdk"
+
+python do_package_prepend () {
+ if '--enable-su' in d.getVar('EXTRA_OECONF').split():
+ d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
+ d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
+
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", d.expand('${base_bindir}/su'))
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", d.expand('${mandir}/man1/su.1'))
+}
+
+python populate_packages_prepend() {
+ do_split_packages(d, '${base_libdir}', '^lib(.*)\.so\..*$',
+ output_pattern='util-linux-lib%s',
+ description='util-linux lib%s',
+ extra_depends='', prepend=True, allow_links=True)
+}
+
+RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
+RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid util-linux-fsck btrfs-tools"
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/tests/ts
+ find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+ find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+ find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+
+ cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/
+ cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
+ cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/
+ cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH}
+
+ # The original paths of executables to be tested point to a local folder containing
+ # the executables. We want to test the installed executables, not the local copies.
+ # So strip the paths, the executables will be located via "which"
+ sed -i \
+ -e '/^TS_CMD/ s|$top_builddir/||g' \
+ -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \
+ ${D}${PTEST_PATH}/tests/commands.sh
+
+ # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]'
+ sed -i -e \
+ '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \
+ ${D}${PTEST_PATH}/tests/functions.sh
+
+ # "kill -L" behaves differently than "/bin/kill -L" so we need an additional fix
+ sed -i -e \
+ '/^TS_CMD_KILL/ s|kill|/bin/kill|g' \
+ ${D}${PTEST_PATH}/tests/commands.sh
+}
diff --git a/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 000000000..748b6ef09
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,20 @@
+Ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+Revert run.sh script accordingly to serialize running tests
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate
+
+Index: util-linux-2.32/configure.ac
+===================================================================
+--- util-linux-2.32.orig/configure.ac
++++ util-linux-2.32/configure.ac
+@@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR([m4])
+ dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
+ dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
+ AC_USE_SYSTEM_EXTENSIONS
+-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects])
++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests])
+
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
diff --git a/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
new file mode 100644
index 000000000..e475289f6
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
@@ -0,0 +1,23 @@
+util-linux: take ${sbindir} from the environment if it is set there
+fix the test, the [ ] syntax was getting eaten by autoconf
+
+Signed-off-by: Phil Blundell <pb@pbcl.net>
+Signed-off-by: Saul Wold <sgw@linux.intel.com
+Upstream-Status: Inappropriate [configuration]
+
+Index: util-linux-2.31/configure.ac
+===================================================================
+--- util-linux-2.31.orig/configure.ac
++++ util-linux-2.31/configure.ac
+@@ -89,7 +89,10 @@ AC_SUBST([runstatedir])
+ usrbin_execdir='${exec_prefix}/bin'
+ AC_SUBST([usrbin_execdir])
+
+-usrsbin_execdir='${exec_prefix}/sbin'
++if test -z "$usrsbin_execdir" ;
++then
++ usrsbin_execdir='${exec_prefix}/sbin'
++fi
+ AC_SUBST([usrsbin_execdir])
+
+ AS_CASE([$libdir],
diff --git a/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 000000000..417ca1d98
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,25 @@
+Display testname for subtest
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+---
+ tests/functions.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/functions.sh b/tests/functions.sh
+index 5246605..b24dc15 100644
+--- a/tests/functions.sh
++++ b/tests/functions.sh
+@@ -320,7 +320,7 @@ function ts_init_subtest {
+
+ if [ "$TS_PARSABLE" != "yes" ]; then
+ [ $TS_NSUBTESTS -eq 1 ] && echo
+- printf "%16s: %-27s ..." "" "$TS_SUBNAME"
++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME"
+ fi
+ }
+
+--
+2.8.3
+
diff --git a/poky/meta/recipes-core/util-linux/util-linux/ptest.patch b/poky/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 000000000..0537f7d85
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,23 @@
+Define TESTS variable
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index bbaccb1..7d5a6bb 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -48,6 +48,7 @@ systemdsystemunit_DATA =
+ dist_bashcompletion_DATA =
+ check_PROGRAMS =
+ dist_check_SCRIPTS =
++TESTS = $(check_PROGRAMS)
+
+ PATHFILES =
+
+--
+2.8.3
+
diff --git a/poky/meta/recipes-core/util-linux/util-linux/run-ptest b/poky/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 000000000..fbc2f9b56
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+cd tests || exit 1
+
+comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
+
+
+echo
+echo "-------------------- util-linux regression tests --------------------"
+echo
+echo " For development purpose only. "
+echo " Don't execute on production system! "
+echo
+
+res=0
+count=0
+for ts in $comps;
+do
+ $ts | sed '{
+ s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/
+ s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/
+ s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/
+ }'
+done
+
diff --git a/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd b/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
new file mode 100644
index 000000000..4b368ccf5
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
@@ -0,0 +1,3 @@
+auth include runuser
+session optional pam_keyinit.so force revoke
+session include runuser
diff --git a/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd b/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd
new file mode 100644
index 000000000..48d133b9e
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd
@@ -0,0 +1,4 @@
+auth sufficient pam_rootok.so
+session optional pam_keyinit.so revoke
+session required pam_limits.so
+session required pam_unix.so
diff --git a/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
new file mode 100644
index 000000000..68bf22de8
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
@@ -0,0 +1,33 @@
+From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 26 Mar 2014 01:30:29 +0000
+Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
+
+qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
+the host like CentOS 5.x.
+
+Upstream-Status: Inappropriate [Other]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libfdisk/src/sun.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+Index: util-linux-2.24.2/libfdisk/src/sun.c
+===================================================================
+--- util-linux-2.24.2.orig/libfdisk/src/sun.c
++++ util-linux-2.24.2/libfdisk/src/sun.c
+@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f
+ }
+ verify_sun_starts = starts;
+
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
+-
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
++ (int (*)(const void *,const void *)) verify_sun_cmp);
++
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined."));
+ return 0;
diff --git a/poky/meta/recipes-core/util-linux/util-linux_2.32.bb b/poky/meta/recipes-core/util-linux/util-linux_2.32.bb
new file mode 100644
index 000000000..55cc98c20
--- /dev/null
+++ b/poky/meta/recipes-core/util-linux/util-linux_2.32.bb
@@ -0,0 +1,30 @@
+MAJOR_VERSION = "2.32"
+require util-linux.inc
+
+# To support older hosts, we need to patch and/or revert
+# some upstream changes. Only do this for native packages.
+OLDHOST = ""
+OLDHOST_class-native = "file://util-linux-native-qsort.patch"
+
+SRC_URI += "file://configure-sbindir.patch \
+ file://runuser.pamd \
+ file://runuser-l.pamd \
+ ${OLDHOST} \
+ file://ptest.patch \
+ file://run-ptest \
+ file://display_testname_for_subtest.patch \
+ file://avoid_parallel_tests.patch \
+"
+SRC_URI[md5sum] = "e0d8a25853f88cd15ff557e5d8cb4ea7"
+SRC_URI[sha256sum] = "6c7397abc764e32e8159c2e96042874a190303e77adceb4ac5bd502a272a4734"
+
+CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
+
+EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
+ --disable-fallocate \
+ --disable-use-tty-group \
+"
+EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
+ --disable-fallocate \
+ --disable-use-tty-group \
+"
diff --git a/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT b/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT
new file mode 100644
index 000000000..7e7d57413
--- /dev/null
+++ b/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/poky/meta/recipes-core/volatile-binds/files/mount-copybind b/poky/meta/recipes-core/volatile-binds/files/mount-copybind
new file mode 100755
index 000000000..2aeaf84dd
--- /dev/null
+++ b/poky/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# Perform a bind mount, copying existing files as we do so to ensure the
+# overlaid path has the necessary content.
+
+if [ $# -lt 2 ]; then
+ echo >&2 "Usage: $0 spec mountpoint [OPTIONS]"
+ exit 1
+fi
+
+spec=$1
+mountpoint=$2
+
+if [ $# -gt 2 ]; then
+ options=$3
+else
+ options=
+fi
+
+[ -n "$options" ] && options=",$options"
+
+mkdir -p "${spec%/*}"
+if [ -d "$mountpoint" ]; then
+ if [ ! -d "$spec" ]; then
+ mkdir "$spec"
+ cp -pPR "$mountpoint"/. "$spec/"
+ fi
+elif [ -f "$mountpoint" ]; then
+ if [ ! -f "$spec" ]; then
+ cp -pP "$mountpoint" "$spec"
+ fi
+fi
+
+mount -o "bind$options" "$spec" "$mountpoint"
diff --git a/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in b/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
new file mode 100644
index 000000000..b23355a71
--- /dev/null
+++ b/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
@@ -0,0 +1,19 @@
+[Unit]
+Description=Bind mount volatile @where@
+DefaultDependencies=false
+Before=local-fs.target
+RequiresMountsFor=@whatparent@ @whereparent@
+ConditionPathIsReadWrite=@whatparent@
+ConditionPathExists=@where@
+ConditionPathIsReadWrite=!@where@
+
+[Service]
+Type=oneshot
+RemainAfterExit=Yes
+StandardOutput=syslog
+TimeoutSec=0
+ExecStart=/sbin/mount-copybind @what@ @where@
+ExecStop=/bin/umount @where@
+
+[Install]
+WantedBy=local-fs.target
diff --git a/poky/meta/recipes-core/volatile-binds/volatile-binds.bb b/poky/meta/recipes-core/volatile-binds/volatile-binds.bb
new file mode 100644
index 000000000..d861a71a6
--- /dev/null
+++ b/poky/meta/recipes-core/volatile-binds/volatile-binds.bb
@@ -0,0 +1,80 @@
+SUMMARY = "Volatile bind mount setup and configuration for read-only-rootfs"
+DESCRIPTION = "${SUMMARY}"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=5750f3aa4ea2b00c2bf21b2b2a7b714d"
+
+SRC_URI = "\
+ file://mount-copybind \
+ file://COPYING.MIT \
+ file://volatile-binds.service.in \
+"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+VOLATILE_BINDS ?= "\
+ /var/volatile/lib /var/lib\n\
+ /var/volatile/cache /var/cache\n\
+ /var/volatile/spool /var/spool\n\
+ /var/volatile/srv /srv\n\
+"
+VOLATILE_BINDS[type] = "list"
+VOLATILE_BINDS[separator] = "\n"
+
+def volatile_systemd_services(d):
+ services = []
+ for line in oe.data.typed_value("VOLATILE_BINDS", d):
+ if not line:
+ continue
+ what, where = line.split(None, 1)
+ services.append("%s.service" % what[1:].replace("/", "-"))
+ return " ".join(services)
+
+SYSTEMD_SERVICE_${PN} = "${@volatile_systemd_services(d)}"
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+
+do_compile () {
+ while read spec mountpoint; do
+ if [ -z "$spec" ]; then
+ continue
+ fi
+
+ servicefile="${spec#/}"
+ servicefile="$(echo "$servicefile" | tr / -).service"
+ sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \
+ -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \
+ volatile-binds.service.in >$servicefile
+ done <<END
+${@d.getVar('VOLATILE_BINDS').replace("\\n", "\n")}
+END
+
+ if [ -e var-volatile-lib.service ]; then
+ # As the seed is stored under /var/lib, ensure that this service runs
+ # after the volatile /var/lib is mounted.
+ sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \
+ -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \
+ var-volatile-lib.service
+ fi
+}
+do_compile[dirs] = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -m 0755 mount-copybind ${D}${base_sbindir}/
+
+ install -d ${D}${systemd_unitdir}/system
+ for service in ${SYSTEMD_SERVICE_${PN}}; do
+ install -m 0644 $service ${D}${systemd_unitdir}/system/
+ done
+
+ # Suppress attempts to process some tmpfiles that are not temporary.
+ #
+ install -d ${D}${sysconfdir}/tmpfiles.d ${D}/var/cache
+ ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/etc.conf
+ ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/home.conf
+}
+do_install[dirs] = "${WORKDIR}"
diff --git a/poky/meta/recipes-core/zlib/site_config/headers b/poky/meta/recipes-core/zlib/site_config/headers
new file mode 100644
index 000000000..50268918a
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/site_config/headers
@@ -0,0 +1 @@
+zlib.h
diff --git a/poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch b/poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch
new file mode 100644
index 000000000..61eea8238
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/zlib-1.2.11/Makefile-runtests.patch
@@ -0,0 +1,38 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/Makefile.in b/Makefile.in
+--- a/Makefile.in 2013-06-10 13:48:14.321959162 +0200
++++ b/Makefile.in 2013-06-10 13:49:36.686476448 +0200
+@@ -83,6 +83,9 @@
+ test: all teststatic testshared
+
+ teststatic: static
++ @make runteststatic
++
++runteststatic:
+ @TMPST=tmpst_$$; \
+ if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
+ echo ' *** zlib test OK ***'; \
+@@ -92,6 +95,9 @@
+ rm -f $$TMPST
+
+ testshared: shared
++ @make runtestshared
++
++runtestshared:
+ @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
+ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
+@@ -105,6 +111,9 @@
+ rm -f $$TMPSH
+
+ test64: all64
++ @make runtestall64
++
++runtestall64:
+ @TMP64=tmp64_$$; \
+ if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
+ echo ' *** zlib 64-bit test OK ***'; \
diff --git a/poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch b/poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch
new file mode 100644
index 000000000..19c40b745
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/zlib-1.2.11/ldflags-tests.patch
@@ -0,0 +1,45 @@
+Obey LDFLAGS for tests
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- zlib-1.2.8.orig/Makefile.in
++++ zlib-1.2.8/Makefile.in
+@@ -26,7 +26,7 @@ CFLAGS=-O
+
+ SFLAGS=-O
+ LDFLAGS=
+-TEST_LDFLAGS=-L. libz.a
++TEST_LDFLAGS=-L. $(LDFLAGS)
+ LDSHARED=$(CC)
+ CPP=$(CC) -E
+
+@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.
+ -@rmdir objs
+
+ example$(EXE): example.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip$(EXE): minigzip.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ examplesh$(EXE): example.o $(SHAREDLIBV)
+- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ example64$(EXE): example64.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip64$(EXE): minigzip64.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ install-libs: $(LIBS)
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
diff --git a/poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch b/poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch
new file mode 100644
index 000000000..7ccbe1f44
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/zlib-1.2.11/remove.ldconfig.call.patch
@@ -0,0 +1,21 @@
+
+When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache
+(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call
+touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Upstream-Status: Inappropriate [disable feature]
+
+Index: zlib-1.2.11/Makefile.in
+===================================================================
+--- zlib-1.2.11.orig/Makefile.in
++++ zlib-1.2.11/Makefile.in
+@@ -322,7 +322,6 @@ install-libs: $(LIBS)
+ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+- ($(LDCONFIG) || true) >/dev/null 2>&1; \
+ fi
+ rm -f $(DESTDIR)$(man3dir)/zlib.3
+ cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
diff --git a/poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest b/poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest
new file mode 100644
index 000000000..884d9dc69
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/zlib-1.2.11/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runteststatic runtestshared | sed -r -e 's/^(\s+\*+ (.+?) test OK \*+)/\1\nPASS: \2/' -e 's/^(\s+\*+ (.+?) test FAILED \*+)/\1\nFAIL: \2/'
diff --git a/poky/meta/recipes-core/zlib/zlib_1.2.11.bb b/poky/meta/recipes-core/zlib/zlib_1.2.11.bb
new file mode 100644
index 000000000..641051988
--- /dev/null
+++ b/poky/meta/recipes-core/zlib/zlib_1.2.11.bb
@@ -0,0 +1,67 @@
+SUMMARY = "Zlib Compression Library"
+DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
+library which is used by many different programs."
+HOMEPAGE = "http://zlib.net/"
+SECTION = "libs"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+ file://remove.ldconfig.call.patch \
+ file://Makefile-runtests.patch \
+ file://ldflags-tests.patch \
+ file://run-ptest \
+ "
+UPSTREAM_CHECK_URI = "http://zlib.net/"
+
+SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
+SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
+
+CFLAGS += "-D_REENTRANT"
+
+RDEPENDS_${PN}-ptest += "make"
+
+inherit ptest
+
+do_configure() {
+ uname=GNU ./configure --prefix=${prefix} --shared --libdir=${libdir}
+}
+
+do_compile() {
+ oe_runmake shared
+}
+
+do_compile_ptest() {
+ oe_runmake test
+}
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+}
+
+do_install_ptest() {
+ install ${B}/Makefile ${D}${PTEST_PATH}
+ install ${B}/example ${D}${PTEST_PATH}
+ install ${B}/minigzip ${D}${PTEST_PATH}
+ install ${B}/examplesh ${D}${PTEST_PATH}
+ install ${B}/minigzipsh ${D}${PTEST_PATH}
+
+ # Remove buildhost references...
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${PTEST_PATH}/Makefile
+}
+
+# Move zlib shared libraries for target builds to $base_libdir so the library
+# can be used in early boot before $prefix is mounted.
+do_install_append_class-target() {
+ if [ ${base_libdir} != ${libdir} ]
+ then
+ mkdir -p ${D}/${base_libdir}
+ mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
+ libname=`readlink ${D}/${libdir}/libz.so`
+ ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/apt/apt-native.inc b/poky/meta/recipes-devtools/apt/apt-native.inc
new file mode 100644
index 000000000..ef232c1eb
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt-native.inc
@@ -0,0 +1,76 @@
+require apt.inc
+inherit native
+
+DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
+PACKAGES = ""
+USE_NLS = "yes"
+
+SRC_URI += "file://db_linking_hack.patch \
+ file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+ file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+ file://0001-fix-the-gcc-version-check.patch \
+"
+
+python do_install () {
+ bb.build.exec_func('do_install_base', d)
+ bb.build.exec_func('do_install_config', d)
+}
+
+python do_install_config () {
+ indir = os.path.dirname(d.getVar('FILE'))
+ infile = open(oe.path.join(indir, 'files', 'apt.conf'), 'r')
+ data = infile.read()
+ infile.close()
+
+ data = d.expand(data)
+
+ outdir = oe.path.join(d.getVar('D'), d.getVar('sysconfdir'), 'apt')
+ if not os.path.exists(outdir):
+ os.makedirs(outdir)
+
+ outpath = oe.path.join(outdir, 'apt.conf.sample')
+ if not os.path.exists(outpath):
+ outfile = open(outpath, 'w')
+ outfile.write(data)
+ outfile.close()
+}
+
+do_install_base () {
+ install -d ${D}${bindir}
+ install -m 0755 bin/apt-cdrom ${D}${bindir}/
+ install -m 0755 bin/apt-get ${D}${bindir}/
+ install -m 0755 bin/apt-config ${D}${bindir}/
+ install -m 0755 bin/apt-cache ${D}${bindir}/
+ install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+ install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+ install -m 0755 bin/apt-ftparchive ${D}${bindir}/
+
+ oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+
+ oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+ oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+
+ install -d ${D}${libdir}/apt/methods
+ install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+ install -d ${D}${libdir}/dpkg/methods/apt
+ install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
+ install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
+
+ install -d ${D}${sysconfdir}/apt
+ install -d ${D}${sysconfdir}/apt/apt.conf.d
+ install -d ${D}${sysconfdir}/apt/preferences.d
+ install -d ${D}${localstatedir}/lib/apt/lists/partial
+ install -d ${D}${localstatedir}/cache/apt/archives/partial
+
+ install -d ${D}${localstatedir}/log/apt/
+
+ install -d ${D}${includedir}/apt-pkg
+ for h in `find ${S}/apt-pkg ${S}/apt-inst -name '*.h'`
+ do
+ install -m 0644 $h ${D}${includedir}/apt-pkg
+ done
+}
diff --git a/poky/meta/recipes-devtools/apt/apt-native_1.2.24.bb b/poky/meta/recipes-devtools/apt/apt-native_1.2.24.bb
new file mode 100644
index 000000000..5b16b503d
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt-native_1.2.24.bb
@@ -0,0 +1,7 @@
+require apt-native.inc
+
+SRC_URI += "file://noconfigure.patch \
+ file://no-curl.patch \
+ file://gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch \
+ file://gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch \
+ file://gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch"
diff --git a/poky/meta/recipes-devtools/apt/apt-package.inc b/poky/meta/recipes-devtools/apt/apt-package.inc
new file mode 100644
index 000000000..6a01f99c6
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,93 @@
+apt-manpages="doc/apt-cache.8 \
+ doc/apt-cdrom.8 \
+ doc/apt-config.8 \
+ doc/apt-get.8 \
+ doc/apt.8 \
+ doc/apt.conf.5 \
+ doc/apt_preferences.5 \
+ doc/sources.list.5"
+apt-utils-manpages="doc/apt-extracttemplates.1 \
+ doc/apt-sortpkgs.1"
+
+def get_files_apt_doc(d, bb, manpages):
+ import re
+ manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
+ manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
+ return manpages
+
+def get_commands_apt_doc(d, bb, manpages):
+ s = list()
+ __dir_cache__ = list()
+ for m in manpages.split():
+ dest = get_files_apt_doc(d, bb, m)
+ dir = os.path.dirname(dest)
+ if not dir in __dir_cache__:
+ s.append("install -d ${D}/%s" % dir)
+ __dir_cache__.append(dir)
+ s.append("install -m 0644 %s ${D}/%s" % (m, dest))
+ return "\n".join(s)
+
+PACKAGES += "${PN}-utils ${PN}-utils-doc"
+FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
+ ${bindir}/apt-config ${bindir}/apt-cache \
+ ${libdir}/apt ${libdir}/libapt*.so.* \
+ ${localstatedir} ${sysconfdir} \
+ ${libdir}/dpkg \
+ ${systemd_unitdir}/system \
+ "
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages'))} \
+ ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages'))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "apt-daily.timer"
+
+do_install () {
+ set -x
+ install -d ${D}${bindir}
+ install -m 0755 bin/apt-key ${D}${bindir}/
+ install -m 0755 bin/apt-cdrom ${D}${bindir}/
+ install -m 0755 bin/apt-get ${D}${bindir}/
+ install -m 0755 bin/apt-config ${D}${bindir}/
+ install -m 0755 bin/apt-cache ${D}${bindir}/
+
+ install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+ install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+
+ oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
+ oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+
+ install -d ${D}${libdir}/apt/methods
+ install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+ install -d ${D}${libdir}/dpkg/methods/apt
+ install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/
+ install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/
+ install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/
+
+ install -d ${D}${sysconfdir}/apt
+ install -d ${D}${sysconfdir}/apt/apt.conf.d
+ install -d ${D}${sysconfdir}/apt/sources.list.d
+ install -d ${D}${sysconfdir}/apt/preferences.d
+ install -d ${D}${localstatedir}/lib/apt/lists/partial
+ install -d ${D}${localstatedir}/cache/apt/archives/partial
+ install -d ${D}${docdir}/apt/examples
+ install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+
+ install -d ${D}${includedir}/apt-pkg/
+ install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
+ install -m 0644 ${S}/debian/apt-daily.service ${D}${systemd_unitdir}/system/
+ sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${systemd_unitdir}/system/apt-daily.service
+ install -m 0644 ${S}/debian/apt-daily.timer ${D}${systemd_unitdir}/system/
+ install -d ${D}${sysconfdir}/cron.daily/
+ install -m 0755 ${S}/debian/apt.apt-compat.cron.daily ${D}${sysconfdir}/cron.daily/
+ sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' ${D}${sysconfdir}/cron.daily/apt.apt-compat.cron.daily
+}
diff --git a/poky/meta/recipes-devtools/apt/apt.inc b/poky/meta/recipes-devtools/apt/apt.inc
new file mode 100644
index 000000000..f1cde3068
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt.inc
@@ -0,0 +1,35 @@
+SUMMARY = "Advanced front-end for dpkg"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
+ file://use-host.patch \
+ file://makerace.patch \
+ file://no-nls-dpkg.patch \
+ file://fix-gcc-4.6-null-not-defined.patch \
+ file://truncate-filename.patch \
+ file://nodoc.patch \
+ file://disable-configure-in-makefile.patch \
+ file://disable-test.patch \
+ file://0001-environment.mak-musl-based-systems-can-generate-shar.patch \
+ file://0001-apt-1.2.12-Fix-musl-build.patch \
+ "
+SRC_URI[md5sum] = "ce8f9ab11f4fd0a08ec73eaffd75c8f0"
+SRC_URI[sha256sum] = "fa1311a9ce00e72379a0a3bc6d240ba30c0968cfbbb3472859e50b99e24e9598"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/apt/"
+
+inherit autotools gettext useradd
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+ rm -rf ${S}/buildlib/config.sub
+ rm -rf ${S}/buildlib/config.guess
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /nonexistent --shell /bin/false --user-group _apt"
diff --git a/poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
new file mode 100644
index 000000000..734ba00d4
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,126 @@
+From dfc1370d50322e2e9d225a7a63b44993fc01a727 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 22 May 2015 08:05:15 +0800
+Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
+ dpkg callings"
+
+Upstream-Status: Inappropriate [embedded specific]
+
+This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
+always run 'dpkg --configure -a' at the end of our dpkg callings,
+but it does not work for cross-compile, since the rootfs dir can not
+be passed into dpkg, and lead to the below similar error:
+ -------
+ |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
+ -------
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/deb/dpkgpm.cc | 9 ++-------
+ test/integration/test-apt-progress-fd-deb822 | 14 +++++++-------
+ test/integration/test-no-fds-leaked-to-maintainer-scripts | 6 ++----
+ 3 files changed, 11 insertions(+), 18 deletions(-)
+
+diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
+index 533d9b367..6ce81bbd9 100644
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -1041,12 +1041,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
+ PackagesTotal++;
+ }
+ }
+- /* one extra: We don't want the progress bar to reach 100%, especially not
+- if we call dpkg --configure --pending and process a bunch of triggers
+- while showing 100%. Also, spindown takes a while, so never reaching 100%
+- is way more correct than reaching 100% while still doing stuff even if
+- doing it this way is slightly bending the rules */
+- ++PackagesTotal;
+ }
+ /*}}}*/
+ bool pkgDPkgPM::Go(int StatusFd)
+@@ -1268,8 +1262,9 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
+
+ // support subpressing of triggers processing for special
+ // cases like d-i that runs the triggers handling manually
++ bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
+ bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
+- if (_config->FindB("DPkg::ConfigurePending", true) == true)
++ if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
+ List.push_back(Item(Item::ConfigurePending, PkgIterator()));
+
+ // for the progress
+diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
+index a8d59608d..0c6a9bbbf 100755
+--- a/test/integration/test-apt-progress-fd-deb822
++++ b/test/integration/test-apt-progress-fd-deb822
+@@ -27,36 +27,36 @@ Message: Installing testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 16.6667
++Percent: 20
+ Message: Preparing testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 33.3333
++Percent: 40
+ Message: Unpacking testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 50.0000
++Percent: 60.0000
+ Message: Preparing to configure testing (amd64)
+
+ Status: progress
+-Percent: 50.0000
++Percent: 60.0000
+ Message: Running dpkg
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 50.0000
++Percent: 60.0000
+ Message: Configuring testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 66.6667
++Percent: 80
+ Message: Configuring testing (amd64)
+
+ Status: progress
+ Package: testing:amd64
+-Percent: 83.3333
++Percent: 100
+ Message: Installed testing (amd64)
+
+ Status: progress
+diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+index d86e638cd..ef6d23be2 100755
+--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
++++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+@@ -59,8 +59,7 @@ startup packages configure
+ configure $PKGNAME 1.0 <none>
+ status unpacked $PKGNAME 1.0
+ status half-configured $PKGNAME 1.0
+-status installed $PKGNAME 1.0
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkinstall
+
+@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+-status not-installed $PKGNAME <none>
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkpurge
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/apt/apt/0001-apt-1.2.12-Fix-musl-build.patch b/poky/meta/recipes-devtools/apt/apt/0001-apt-1.2.12-Fix-musl-build.patch
new file mode 100644
index 000000000..f7ac19bfd
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/0001-apt-1.2.12-Fix-musl-build.patch
@@ -0,0 +1,50 @@
+From 33b97e089d4a98d3acd20bd78337dd915b989bc2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Fri, 5 Aug 2016 15:24:27 -0500
+Subject: [PATCH] apt 1.2.12: Fix musl build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+methods/connect.cc: Musl doesn't support AI_IDN flag in netdb.h
+header so define it manually.
+apt-pkg/contrib/srvrec.h: Add explicity include of sys/types.h
+to avoid errors in types u_int_SIZE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ apt-pkg/contrib/srvrec.h | 1 +
+ methods/connect.cc | 3 +++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/apt-pkg/contrib/srvrec.h b/apt-pkg/contrib/srvrec.h
+index 01b8102..15b6875 100644
+--- a/apt-pkg/contrib/srvrec.h
++++ b/apt-pkg/contrib/srvrec.h
+@@ -9,6 +9,7 @@
+ #ifndef SRVREC_H
+ #define SRVREC_H
+
++#include <sys/types.h>
+ #include <arpa/nameser.h>
+ #include <vector>
+ #include <string>
+diff --git a/methods/connect.cc b/methods/connect.cc
+index 07a730b..bb0ab5a 100644
+--- a/methods/connect.cc
++++ b/methods/connect.cc
+@@ -33,6 +33,9 @@
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
++#ifndef AI_IDN
++#define AI_IDN 0x0040
++#endif
+
+ #include "connect.h"
+ #include "rfc2553emu.h"
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch b/poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
new file mode 100644
index 000000000..042372b51
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/0001-environment.mak-musl-based-systems-can-generate-shar.patch
@@ -0,0 +1,29 @@
+From 2f8aa21ace375c18977ed908b291c80a210a93c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 08:06:12 +0000
+Subject: [PATCH] environment.mak: musl based systems can generate shared
+ objects too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ buildlib/environment.mak.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..3a52344 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -68,7 +68,7 @@ NEED_SOCKLEN_T_DEFINE = @NEED_SOCKLEN_T_DEFINE@
+
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter gnu% linux-gnu% kfreebsd-gnu% %-gnu linux-musl%,$(HOST_OS))),0)
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+ else
+--
+2.6.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch b/poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
new file mode 100644
index 000000000..3ac92462c
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
@@ -0,0 +1,74 @@
+From 53c5d0982f03fd0e24c4195d6e1e42b9ade9d500 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 14:30:28 +0800
+Subject: [PATCH] fix the gcc version check
+
+Upstream-Status: pending
+
+"GCC diagnostic push" is gcc 4.6 feature, gcc 4.4.7 on centos did not know it
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/contrib/macros.h | 2 +-
+ apt-pkg/deb/debsrcrecords.cc | 4 ++--
+ apt-pkg/srcrecords.cc | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
+index 2727fd8..0ecae50 100644
+--- a/apt-pkg/contrib/macros.h
++++ b/apt-pkg/contrib/macros.h
+@@ -136,7 +136,7 @@
+ #endif
+ #endif
+
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #define APT_IGNORE_DEPRECATED_PUSH \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
+index e8295de..40160b2 100644
+--- a/apt-pkg/deb/debsrcrecords.cc
++++ b/apt-pkg/deb/debsrcrecords.cc
+@@ -139,13 +139,13 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
+ for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
+ {
+ pkgSrcRecords::File2 f;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ f.MD5Hash = f2->MD5Hash;
+ f.Size = f2->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ f.Path = f2->Path;
+diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
+index 53d7e60..1484828 100644
+--- a/apt-pkg/srcrecords.cc
++++ b/apt-pkg/srcrecords.cc
+@@ -157,7 +157,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+ for (std::vector<pkgSrcRecords::File>::const_iterator f = F.begin(); f != F.end(); ++f)
+ {
+ pkgSrcRecords::File2 f2;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -165,7 +165,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+ f2.Size = f->Size;
+ f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash));
+ f2.FileSize = f->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ #pragma GCC diagnostic pop
+ #endif
+ f2.Path = f->Path;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch b/poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
new file mode 100644
index 000000000..47870e3c8
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
@@ -0,0 +1,43 @@
+From 9fdf50d63df08ee65e7d8e62c35f19ac4841bca9 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 09:48:45 +0800
+Subject: [PATCH] remove Wsuggest-attribute from CXXFLAGS
+
+Upstream-Status: Inappropriate
+
+Wsuggest-attribute is GCC 4.6 feature, centos6 is using GCC
+4.4.7 which unknown this flag, so remove it from CXXFLAGS
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ buildlib/environment.mak.in | 1 -
+ test/libapt/makefile | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index 9620722..c344d01 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -14,7 +14,6 @@ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra
+ CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations
+ CXXFLAGS+= -Wctor-dtor-privacy -Wdisabled-optimization -Winit-self -Wmissing-include-dirs -Wnoexcept -Wsign-promo -Wundef
+ # suggests methods which already have such an attribute
+-#CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn
+ # sanitize options to be enabled for testing
+ #CXXFLAGS+= -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
+ # a bit too pedantic to be run by default
+diff --git a/test/libapt/makefile b/test/libapt/makefile
+index 5ff9cf6..c5b5190 100644
+--- a/test/libapt/makefile
++++ b/test/libapt/makefile
+@@ -40,7 +40,6 @@ CXXFLAGS += -pthread
+ # disable some flags for gtest again
+ CXXFLAGS+= -Wno-missing-declarations
+ CXXFLAGS+= -Wno-missing-field-initializers
+-CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn
+ CXXFLAGS+= -Wno-undef
+
+ # All Google Test headers. Usually you shouldn't change this definition.
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch b/poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
new file mode 100644
index 000000000..7c2f64e3e
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
@@ -0,0 +1,18 @@
+Disable configure at compilation stage
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -33,7 +33,7 @@ veryclean: clean
+ # The startup target builds the necessary configure scripts. It should
+ # be used after a CVS checkout.
+ CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile
+-include buildlib/configure.mak
++#include buildlib/configure.mak
+ $(BUILDDIR)/include/config.h: buildlib/config.h.in
+ $(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
+ $(BUILDDIR)/environment.mak: buildlib/environment.mak.in
diff --git a/poky/meta/recipes-devtools/apt/apt/disable-test.patch b/poky/meta/recipes-devtools/apt/apt/disable-test.patch
new file mode 100644
index 000000000..d16b5c771
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/disable-test.patch
@@ -0,0 +1,72 @@
+From 67bc7948e0a721c75d636931abc105da5dcb0763 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 26 May 2016 15:32:11 -0500
+Subject: [PATCH] [PATCH] disable test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [configuration]
+
+test needs gtest package, so not build the test dir
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ Makefile | 9 +++------
+ configure.ac | 7 -------
+ 2 files changed, 3 insertions(+), 13 deletions(-)
+
+Index: apt-1.2.24/Makefile
+===================================================================
+--- apt-1.2.24.orig/Makefile
++++ apt-1.2.24/Makefile
+@@ -9,8 +9,8 @@ endif
+ .PHONY: default
+ default: startup all
+
+-.PHONY: fast headers library clean veryclean all binary program doc test update-po
+-all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs:
++.PHONY: fast headers library clean veryclean all binary program doc update-po
++all headers library clean veryclean binary program doc manpages docbook update-po startup dirs:
+ $(MAKE) -C vendor $@
+ $(MAKE) -C apt-pkg $@
+ $(MAKE) -C apt-inst $@
+@@ -21,8 +21,6 @@ all headers library clean veryclean bina
+ $(MAKE) -C dselect $@
+ # $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+- # FIXME: -C test has issue swith parallel builds, investigate!
+- -$(MAKE) -C test $@
+
+ fast:
+ $(MAKE) -C vendor all
+@@ -32,9 +30,8 @@ fast:
+ $(MAKE) -C methods all
+ $(MAKE) -C cmdline all
+ $(MAKE) -C ftparchive all
+- $(MAKE) -C test all
+
+-all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs
++all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs
+
+ dirs: startup
+
+Index: apt-1.2.24/configure.ac
+===================================================================
+--- apt-1.2.24.orig/configure.ac
++++ apt-1.2.24/configure.ac
+@@ -90,13 +90,6 @@ AC_CHECK_LIB(curl, curl_easy_init,
+ AC_MSG_ERROR([failed: I need CURL due https support]),
+ )
+
+-AC_LANG_PUSH([C++])
+-AC_CHECK_HEADER(gtest/gtest.h,,
+- AC_MSG_WARN([failed: I need gtest (packaged as libgtest-dev) for unit testing]),
+-)
+-AC_LANG_POP([C++])
+-
+-
+ AC_SUBST(BDBLIB)
+
+ HAVE_ZLIB=no
diff --git a/poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch b/poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
new file mode 100644
index 000000000..899c6ef2f
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Index: apt-1.2.24/apt-pkg/contrib/weakptr.h
+===================================================================
+--- apt-1.2.24.orig/apt-pkg/contrib/weakptr.h
++++ apt-1.2.24/apt-pkg/contrib/weakptr.h
+@@ -21,6 +21,7 @@
+ #ifndef WEAK_POINTER_H
+ #define WEAK_POINTER_H
+
++#include <cstdlib>
+ #include <set>
+ #include <stddef.h>
+
diff --git a/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch
new file mode 100644
index 000000000..438de209a
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-avoid-changing-the-global-LC_TIME-for-Release.patch
@@ -0,0 +1,80 @@
+From 7ef2b2dba0e0bee450da3c8450ea782a3e7d6429 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Tue, 22 Aug 2017 11:49:01 -0500
+Subject: [PATCH 3/3] Revert "avoid changing the global LC_TIME for Release
+ writing"
+
+This reverts commit 78e7b683c645e907db12658405a4b201a6243ea8.
+
+After we drop debian8 and centos7 that has gcc < 5 (std::put_time not available)
+versions this patch can be remove.
+
+Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ ftparchive/writer.cc | 29 +++++++++++++++++------------
+ 1 file changed, 17 insertions(+), 12 deletions(-)
+
+diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
+index 2596382..e43a643 100644
+--- a/ftparchive/writer.cc
++++ b/ftparchive/writer.cc
+@@ -37,7 +37,6 @@
+ #include <unistd.h>
+ #include <ctime>
+ #include <iostream>
+-#include <iomanip>
+ #include <sstream>
+ #include <memory>
+ #include <utility>
+@@ -984,29 +983,35 @@ ReleaseWriter::ReleaseWriter(FileFd * const GivenOutput, string const &/*DB*/) :
+ AddPatterns(_config->FindVector("APT::FTPArchive::Release::Patterns"));
+
+ time_t const now = time(NULL);
+- auto const posix = std::locale("C.UTF-8");
+
+- // FIXME: use TimeRFC1123 here? But that uses GMT to satisfy HTTP/1.1
+- std::ostringstream datestr;
+- datestr.imbue(posix);
+- datestr << std::put_time(gmtime(&now), "%a, %d %b %Y %H:%M:%S UTC");
++ setlocale(LC_TIME, "C");
++
++ char datestr[128];
++ if (strftime(datestr, sizeof(datestr), "%a, %d %b %Y %H:%M:%S UTC",
++ gmtime(&now)) == 0)
++ {
++ datestr[0] = '\0';
++ }
+
+ time_t const validuntil = now + _config->FindI("APT::FTPArchive::Release::ValidTime", 0);
+- std::ostringstream validstr;
+- if (validuntil != now)
++ char validstr[128];
++ if (now == validuntil ||
++ strftime(validstr, sizeof(validstr), "%a, %d %b %Y %H:%M:%S UTC",
++ gmtime(&validuntil)) == 0)
+ {
+- datestr.imbue(posix);
+- validstr << std::put_time(gmtime(&validuntil), "%a, %d %b %Y %H:%M:%S UTC");
++ validstr[0] = '\0';
+ }
+
++ setlocale(LC_TIME, "");
++
+ map<string,string> Fields;
+ Fields["Origin"] = "";
+ Fields["Label"] = "";
+ Fields["Suite"] = "";
+ Fields["Version"] = "";
+ Fields["Codename"] = "";
+- Fields["Date"] = datestr.str();
+- Fields["Valid-Until"] = validstr.str();
++ Fields["Date"] = datestr;
++ Fields["Valid-Until"] = validstr;
+ Fields["Architectures"] = "";
+ Fields["Components"] = "";
+ Fields["Description"] = "";
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch
new file mode 100644
index 000000000..088a66a3c
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_Revert-use-de-localed-std-put_time-instead-rolling-o.patch
@@ -0,0 +1,46 @@
+From c72ef9b6ae83a0a2fbbefd5c050335f65f0d2bc9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Tue, 22 Aug 2017 11:48:46 -0500
+Subject: [PATCH 2/3] Revert "use de-localed std::put_time instead rolling our
+ own"
+
+This reverts commit 4ed2a17ab4334f019c00512aa54a162f0bf083c4.
+
+After we drop debian8 and centos7 that has gcc < 5 (std::put_time not available)
+versions this patch can be remove.
+
+Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ apt-pkg/contrib/strutl.cc | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+index c2ff01d..e9ef2be 100644
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -760,11 +760,15 @@ string TimeRFC1123(time_t Date)
+ if (gmtime_r(&Date, &Conv) == NULL)
+ return "";
+
+- auto const posix = std::locale::classic();
+- std::ostringstream datestr;
+- datestr.imbue(posix);
+- datestr << std::put_time(&Conv, "%a, %d %b %Y %H:%M:%S GMT");
+- return datestr.str();
++ char Buf[300];
++ const char *Day[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
++ const char *Month[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul",
++ "Aug","Sep","Oct","Nov","Dec"};
++
++ snprintf(Buf, sizeof(Buf), "%s, %02i %s %i %02i:%02i:%02i GMT",Day[Conv.tm_wday],
++ Conv.tm_mday,Month[Conv.tm_mon],Conv.tm_year+1900,Conv.tm_hour,
++ Conv.tm_min,Conv.tm_sec);
++ return Buf;
+ }
+ /*}}}*/
+ // ReadMessages - Read messages from the FD /*{{{*/
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch
new file mode 100644
index 000000000..cb3259187
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/gcc_4.x_apt-pkg-contrib-strutl.cc-Include-array-header.patch
@@ -0,0 +1,33 @@
+From ff8562f7724c4db4b83635af9e627f3495222327 Mon Sep 17 00:00:00 2001
+From: Anibal Limon <limon.anibal@gmail.com>
+Date: Tue, 22 Aug 2017 04:41:31 -0500
+Subject: [PATCH 1/3] apt-pkg/contrib/strutl.cc: Include array header
+
+If GCC version is less than 5 the array header needs to be included
+to support std::array.
+
+After we drop debian8 and centos7 that has gcc < 5 versions this patch
+can be remove.
+
+Signed-off-by: Anibal Limon <limon.anibal@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ apt-pkg/contrib/strutl.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+index 60d0ca8..c2ff01d 100644
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -27,6 +27,7 @@
+ #include <sstream>
+ #include <string>
+ #include <vector>
++#include <array>
+
+ #include <stddef.h>
+ #include <stdlib.h>
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/makerace.patch b/poky/meta/recipes-devtools/apt/apt/makerace.patch
new file mode 100644
index 000000000..0c686d6e2
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/makerace.patch
@@ -0,0 +1,23 @@
+I was seeing various issues with parallel make, mainly due to to what was likely
+partially installed headers. If you change into the source directory and
+"NOISY=1 make ../obj/apt-pkg/sourcelist.opic" in apt-pkg, you'll see it
+doesn't have any dependencies on the headers being installed. This patch
+fixes that so things build correctly.
+
+RP 2012/3/19
+
+Upstream-Status: Pending
+
+Index: apt-1.2.24/buildlib/library.mak
+===================================================================
+--- apt-1.2.24.orig/buildlib/library.mak
++++ apt-1.2.24/buildlib/library.mak
+@@ -65,7 +65,7 @@ $(LIB)/lib$(LIBRARY).so.$(MAJOR).$(MINOR
+
+ # Compilation rules
+ vpath %.cc $(SUBDIRS)
+-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS)
++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS)
+ echo Compiling $< to $@
+ $(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXSTD) $(CXXFLAGS) $(PICFLAGS) -o $@ '$(abspath $<)'
+ $(DoDep)
diff --git a/poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch b/poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
new file mode 100644
index 000000000..98b6c96ca
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Index: apt-1.2.24/apt-pkg/deb/dpkgpm.cc
+===================================================================
+--- apt-1.2.24.orig/apt-pkg/deb/dpkgpm.cc
++++ apt-1.2.24/apt-pkg/deb/dpkgpm.cc
+@@ -54,6 +54,12 @@
+ #include <apti18n.h>
+ /*}}}*/
+
++#ifdef USE_NLS
++#define _dpkg(x) dgettext("dpkg", x)
++#else
++#define _dpkg(x) x
++#endif
++
+ using namespace std;
+
+ APT_PURE static string
+@@ -1703,7 +1709,7 @@ void pkgDPkgPM::WriteApportReport(const
+ }
+
+ // check if its not a follow up error
+- const char *needle = dgettext("dpkg", "dependency problems - leaving unconfigured");
++ const char *needle = _dpkg("dependency problems - leaving unconfigured");
+ if(strstr(errormsg, needle) != NULL) {
+ std::clog << _("No apport report written because the error message indicates its a followup error from a previous failure.") << std::endl;
+ return;
diff --git a/poky/meta/recipes-devtools/apt/apt/noconfigure.patch b/poky/meta/recipes-devtools/apt/apt/noconfigure.patch
new file mode 100644
index 000000000..ebc67203b
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/noconfigure.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+
+diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
+index 249542c..0a1911f 100644
+--- a/apt-pkg/packagemanager.cc
++++ b/apt-pkg/packagemanager.cc
+@@ -952,10 +952,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
+ return false;
+
+ if (Immediate == true) {
++#if 0
+ // Perform immedate configuration of the package.
+ if (SmartConfigure(Pkg, Depth + 1) == false)
+ _error->Error(_("Could not perform immediate configuration on '%s'. "
+ "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
++#endif
+ }
+
+ return true;
+@@ -1038,6 +1040,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ }
+ }
+
++#if 0
+ // Final run through the configure phase
+ if (ConfigureAll() == false)
+ return Failed;
+@@ -1052,6 +1055,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ return Failed;
+ }
+ }
++#endif
+
+ return Completed;
+ }
diff --git a/poky/meta/recipes-devtools/apt/apt/nodoc.patch b/poky/meta/recipes-devtools/apt/apt/nodoc.patch
new file mode 100644
index 000000000..78cf53884
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/nodoc.patch
@@ -0,0 +1,18 @@
+Disable documentation
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-1.2.24/Makefile
+===================================================================
+--- apt-1.2.24.orig/Makefile
++++ apt-1.2.24/Makefile
+@@ -19,7 +19,7 @@ all headers library clean veryclean bina
+ $(MAKE) -C cmdline $@
+ $(MAKE) -C ftparchive $@
+ $(MAKE) -C dselect $@
+- $(MAKE) -C doc $@
++# $(MAKE) -C doc $@
+ $(MAKE) -C po $@
+ # FIXME: -C test has issue swith parallel builds, investigate!
+ -$(MAKE) -C test $@
diff --git a/poky/meta/recipes-devtools/apt/apt/truncate-filename.patch b/poky/meta/recipes-devtools/apt/apt/truncate-filename.patch
new file mode 100644
index 000000000..db1c42b66
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/truncate-filename.patch
@@ -0,0 +1,35 @@
+strutl.cc: the filename can't be longer than 255
+
+The URItoFileName translates the path into the filename, but the
+filename can't be longer than 255 according to
+/usr/include/linux/limits.h.
+
+Truncate it when it is longer than 240 (leave some spaces for
+".Packages" and "._Release" suffix)
+
+Upstream-Status: Pending
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ apt-pkg/contrib/strutl.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -399,7 +399,12 @@ string URItoFileName(const string &URI)
+ // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
+ string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
+ replace(NewURI.begin(),NewURI.end(),'/','_');
+- return NewURI;
++
++ // Truncate from the head when it is longer than 240
++ if(NewURI.length() > 240)
++ return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1);
++ else
++ return NewURI;
+ }
+ /*}}}*/
+ // Base64Encode - Base64 Encoding routine for short strings /*{{{*/
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-devtools/apt/apt/use-host.patch b/poky/meta/recipes-devtools/apt/apt/use-host.patch
new file mode 100644
index 000000000..b30fcff0d
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt/use-host.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: apt-0.9.7.7/configure.ac
+===================================================================
+--- apt-0.9.7.7.orig/configure.ac
++++ apt-0.9.7.7/configure.ac
+@@ -112,7 +112,7 @@ dnl This is often the dpkg architecture
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`echo $host_alias|cut -d'-' -f1`"
+ if test "x$archset" = "x"; then
+ AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
diff --git a/poky/meta/recipes-devtools/apt/apt_1.2.24.bb b/poky/meta/recipes-devtools/apt/apt_1.2.24.bb
new file mode 100644
index 000000000..ae0bce933
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/apt_1.2.24.bb
@@ -0,0 +1,20 @@
+DEPENDS = "curl db zlib"
+RDEPENDS_${PN} = "dpkg bash debianutils"
+require apt.inc
+
+require apt-package.inc
+
+PACKAGECONFIG ??= "lzma"
+PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+PACKAGECONFIG[bz2] = "ac_cv_lib_bz2_BZ2_bzopen=yes,ac_cv_lib_bz2_BZ2_bzopen=no,bzip2"
+PACKAGECONFIG[lz4] = "ac_cv_lib_lz4_LZ4F_createCompressionContext=yes,ac_cv_lib_lz4_LZ4F_createCompressionContext=no,lz4"
+
+FILES_${PN} += "${bindir}/apt-key"
+apt-manpages += "doc/apt-key.8"
+
+do_install_append() {
+ #Write the correct apt-architecture to apt.conf
+ APT_CONF=${D}/etc/apt/apt.conf
+ echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+ oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+}
diff --git a/poky/meta/recipes-devtools/apt/files/apt.conf b/poky/meta/recipes-devtools/apt/files/apt.conf
new file mode 100644
index 000000000..03351356b
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/files/apt.conf
@@ -0,0 +1,42 @@
+Dir "${STAGING_DIR_NATIVE}/"
+{
+ State "var/lib/apt/"
+ {
+ Lists "#APTCONF#/lists/";
+ status "#ROOTFS#/var/lib/dpkg/status";
+ };
+ Cache "var/cache/apt/"
+ {
+ Archives "archives/";
+ pkgcache "";
+ srcpkgcache "";
+ };
+ Bin "${STAGING_BINDIR_NATIVE}/"
+ {
+ methods "${STAGING_LIBDIR}/apt/methods/";
+ gzip "/bin/gzip";
+ dpkg "dpkg";
+ dpkg-source "dpkg-source";
+ dpkg-buildpackage "dpkg-buildpackage";
+ apt-get "apt-get";
+ apt-cache "apt-cache";
+ };
+ Etc "#APTCONF#"
+ {
+ Preferences "preferences";
+ };
+};
+
+APT
+{
+ Install-Recommends "true";
+ Immediate-Configure "false";
+ Architecture "i586";
+ Get
+ {
+ Assume-Yes "true";
+ Force-Yes "true"
+ };
+};
+
+DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
diff --git a/poky/meta/recipes-devtools/apt/files/db_linking_hack.patch b/poky/meta/recipes-devtools/apt/files/db_linking_hack.patch
new file mode 100644
index 000000000..a61d4b07c
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/files/db_linking_hack.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+
+Index: apt-0.7.3/configure.ac
+===================================================================
+--- apt-0.7.3.orig/configure.ac 2007-07-01 10:38:45.000000000 +0000
++++ apt-0.7.3/configure.ac 2007-08-21 13:39:26.000000000 +0000
+@@ -67,8 +67,20 @@
+ [AC_DEFINE(HAVE_BDB)
+ BDBLIB="-ldb"
+ AC_MSG_RESULT(yes)],
+- [BDBLIB=""
+- AC_MSG_RESULT(no)]
++
++ LIBS="$LIBS -lpthread"
++ [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread)
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <db.h>],
++ [int r, s, t; db_version(&r, &s, &t);]
++ )],
++ [AC_DEFINE(HAVE_BDB)
++ BDBLIB="-ldb -lpthread"
++ AC_MSG_RESULT(yes)],
++ [BDBLIB=""
++ AC_MSG_RESULT(no)]
++ )]
+ )]
+ )
+
diff --git a/poky/meta/recipes-devtools/apt/files/environment.patch b/poky/meta/recipes-devtools/apt/files/environment.patch
new file mode 100644
index 000000000..9a0303803
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/files/environment.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport
+
+Index: apt-0.6.46.2/buildlib/environment.mak.in
+===================================================================
+--- apt-0.6.46.2.orig/buildlib/environment.mak.in 2007-03-29 11:38:58.000000000 +0100
++++ apt-0.6.46.2/buildlib/environment.mak.in 2007-03-29 11:39:12.000000000 +0100
+@@ -62,7 +62,7 @@
+
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0)
+ SONAME_MAGIC=-Wl,-soname -Wl,
+ LFLAGS_SO=
+ else
diff --git a/poky/meta/recipes-devtools/apt/files/no-curl.patch b/poky/meta/recipes-devtools/apt/files/no-curl.patch
new file mode 100644
index 000000000..0838552b2
--- /dev/null
+++ b/poky/meta/recipes-devtools/apt/files/no-curl.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [configuration]
+From 5d61ac822fd9a3871cd5089389c210606232ecdc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 26 May 2016 15:34:45 -0500
+Subject: [PATCH] Upstream-Status: Inappropriate [configuration]
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ configure.ac | 7 -------
+ methods/makefile | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e47f459..cd24264 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,13 +83,6 @@ AC_CHECK_HEADER(db.h,
+
+ LIBS="$saveLIBS"
+
+-AC_CHECK_LIB(curl, curl_easy_init,
+- [AC_CHECK_HEADER(curl/curl.h,
+- curl_ok=yes,
+- curl_ok=no)],
+- AC_MSG_ERROR([failed: I need CURL due https support]),
+-)
+-
+ AC_SUBST(BDBLIB)
+
+ HAVE_ZLIB=no
+diff --git a/methods/makefile b/methods/makefile
+index 3274e92..255086b 100644
+--- a/methods/makefile
++++ b/methods/makefile
+@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile
+ SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
+ include $(PROGRAM_H)
+
+-# The https method
+-PROGRAM=https
+-SLIBS = -lapt-pkg -lcurl $(INTLLIBS) -lresolv
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc server.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS) -lresolv
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb b/poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb
new file mode 100644
index 000000000..7d62e52ab
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf-archive/autoconf-archive_2018.03.13.bb
@@ -0,0 +1,18 @@
+SUMMARY = "a collection of freely re-usable Autoconf macros"
+HOMEPAGE = "http://www.gnu.org/software/autoconf-archive/"
+SECTION = "devel"
+LICENSE = "GPL-3.0-with-autoconf-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=11cc2d3ee574f9d6b7ee797bdce4d423 \
+ file://COPYING.EXCEPTION;md5=fdef168ebff3bc2f13664c365a5fb515"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "46b13a5936372297b6d49980327a3c35"
+SRC_URI[sha256sum] = "6175f90d9fa64c4d939bdbb3e8511ae0ee2134863a2c7bf8d9733819efa6e159"
+
+inherit autotools allarch
+
+PACKAGES = "${PN} ${PN}-doc"
+
+FILES_${PN} += "${datadir}/aclocal"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf.inc b/poky/meta/recipes-devtools/autoconf/autoconf.inc
new file mode 100644
index 000000000..df81bc610
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf.inc
@@ -0,0 +1,53 @@
+SUMMARY = "A GNU tool that produce shell scripts to automatically configure software"
+DESCRIPTION = "Autoconf is an extensible package of M4 macros that produce shell scripts to automatically \
+configure software source code packages. Autoconf creates a configuration script for a package from a template \
+file that lists the operating system features that the package can use, in the form of M4 macro calls."
+LICENSE = "GPLv3"
+HOMEPAGE = "http://www.gnu.org/software/autoconf/"
+SECTION = "devel"
+DEPENDS += "m4-native"
+DEPENDS_class-native = "m4-native gnu-config-native"
+DEPENDS_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN} = "m4 gnu-config \
+ perl \
+ perl-module-carp \
+ perl-module-constant \
+ perl-module-errno \
+ perl-module-exporter \
+ perl-module-file-basename \
+ perl-module-file-compare \
+ perl-module-file-copy \
+ perl-module-file-glob \
+ perl-module-file-path \
+ perl-module-file-stat \
+ perl-module-file-find \
+ perl-module-getopt-long \
+ perl-module-io-file \
+ perl-module-posix \
+ perl-module-data-dumper \
+ "
+RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
+RDEPENDS_${PN}_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+
+SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
+ file://program_prefix.patch"
+
+inherit autotools texinfo
+
+PERL = "${USRBINPATH}/perl"
+PERL_class-native = "/usr/bin/env perl"
+PERL_class-nativesdk = "/usr/bin/env perl"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
+
+do_configure() {
+ # manually install a newer config.guess/.sub
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/build-aux
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/build-aux
+
+ oe_runconf
+}
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch b/poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch
new file mode 100644
index 000000000..fc37236bf
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/AC_HEADER_MAJOR-port-to-glibc-2.25.patch
@@ -0,0 +1,162 @@
+From e17a30e987d7ee695fb4294a82d987ec3dc9b974 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Wed, 14 Sep 2016 08:17:06 -0500
+Subject: [PATCH] AC_HEADER_MAJOR: port to glibc 2.25
+
+glibc 2.25 is deprecating the namespace pollution of <sys/types.h>
+injecting major(), minor(), and makedev() into the compilation
+environment, with a warning that insists that users include
+<sys/sysmacros.h> instead. However, because the expansion of
+AC_HEADER_MAJOR didn't bother checking sys/sysmacros.h until
+after probing whether sys/types.h pollutes the namespace, it was
+not defining MAJOR_IN_SYSMACROS, with the result that code
+compiled with -Werror chokes on the deprecation warnings because
+it was not including sysmacros.h.
+
+In addition to fixing autoconf (which only benefits projects
+that rebuild configure after this fix is released), we can also
+give a hint to distros on how they can populate config.site with
+a cache variable to force pre-existing configure scripts without
+the updated macro to behave sanely in the presence of glibc 2.25
+(the documentation is especially useful since that cache variable
+is no longer present in autoconf after this patch).
+
+Note that mingw lacks major/minor/makedev in any of its standard
+headers; for that platform, the behavior of this macro is unchanged
+(code using the recommended include formula will get a compile error
+when trying to use major(), whether before or after this patch); but
+for now, it is assumed that programs actually concerned with
+creating devices are not worried about portability to mingw. If
+desired, a later patch could tighten AC_HEADER_MAJOR to fail at
+configure time if the macros are unavailable in any of the three
+system headers, but that semantic change is not worth mixing into
+this patch.
+
+* lib/autoconf/headers.m4 (AC_HEADER_MAJOR): Drop check for
+major within sys/types.h; it interferes with the need to check
+sysmacros.h first.
+* doc/autoconf.texi (Particular Headers) <AC_HEADER_MAJOR>: Expand
+details on usage, and on workarounds for non-updated projects.
+
+Signed-off-by: Eric Blake <eblake@redhat.com>
+---
+Upstream-Status: Backport
+
+ doc/autoconf.texi | 35 +++++++++++++++++++++++++++++++----
+ lib/autoconf/headers.m4 | 30 ++++++++++++++----------------
+ 2 files changed, 45 insertions(+), 20 deletions(-)
+
+Index: autoconf-2.69/doc/autoconf.texi
+===================================================================
+--- autoconf-2.69.orig/doc/autoconf.texi
++++ autoconf-2.69/doc/autoconf.texi
+@@ -15,7 +15,7 @@
+ @c The ARG is an optional argument. To be used for macro arguments in
+ @c their documentation (@defmac).
+ @macro ovar{varname}
+-@r{[}@var{\varname\}@r{]}@c
++@r{[}@var{\varname\}@r{]}
+ @end macro
+
+ @c @dvar(ARG, DEFAULT)
+@@ -23,7 +23,7 @@
+ @c The ARG is an optional argument, defaulting to DEFAULT. To be used
+ @c for macro arguments in their documentation (@defmac).
+ @macro dvar{varname, default}
+-@r{[}@var{\varname\} = @samp{\default\}@r{]}@c
++@r{[}@var{\varname\} = @samp{\default\}@r{]}
+ @end macro
+
+ @c Handling the indexes with Texinfo yields several different problems.
+@@ -5926,10 +5926,37 @@ Also see @code{AC_STRUCT_DIRENT_D_INO} a
+ @cvindex MAJOR_IN_SYSMACROS
+ @hdrindex{sys/mkdev.h}
+ @hdrindex{sys/sysmacros.h}
+-If @file{sys/types.h} does not define @code{major}, @code{minor}, and
+-@code{makedev}, but @file{sys/mkdev.h} does, define
+-@code{MAJOR_IN_MKDEV}; otherwise, if @file{sys/sysmacros.h} does, define
+-@code{MAJOR_IN_SYSMACROS}.
++Detect the headers required to use @code{makedev}, @code{major}, and
++@code{minor}. These functions may be defined by @file{sys/mkdev.h},
++@code{sys/sysmacros.h}, or @file{sys/types.h}.
++
++@code{AC_HEADER_MAJOR} defines @code{MAJOR_IN_MKDEV} if they are in
++@file{sys/mkdev.h}, or @code{MAJOR_IN_SYSMACROS} if they are in
++@file{sys/sysmacros.h}. If neither macro is defined, they are either in
++@file{sys/types.h} or unavailable.
++
++To properly use these functions, your code should contain something
++like:
++
++@verbatim
++#include <sys/types.h>
++#ifdef MAJOR_IN_MKDEV
++# include <sys/mkdev.h>
++#elif defined MAJOR_IN_SYSMACROS
++# include <sys/sysmacros.h>
++#endif
++@end verbatim
++
++Note: Configure scripts built with Autoconf 2.69 or earlier will not
++detect a problem if @file{sys/types.h} contains definitions of
++@code{major}, @code{minor}, and/or @code{makedev} that trigger compiler
++warnings upon use. This is known to occur with GNU libc 2.25, where
++those definitions are being deprecated to reduce namespace pollution.
++If it is not practical to use Autoconf 2.70 to regenerate the configure
++script of affected software, you can work around the problem by setting
++@samp{ac_cv_header_sys_types_h_makedev=no}, as an argument to
++@command{configure} or as part of a @file{config.site} site default file
++(@pxref{Site Defaults}).
+ @end defmac
+
+ @defmac AC_HEADER_RESOLV
+Index: autoconf-2.69/lib/autoconf/headers.m4
+===================================================================
+--- autoconf-2.69.orig/lib/autoconf/headers.m4
++++ autoconf-2.69/lib/autoconf/headers.m4
+@@ -502,31 +502,29 @@ fi
+
+ # AC_HEADER_MAJOR
+ # ---------------
++# Thanks to glibc 2.25 deprecating macros in sys/types.h, coupled with
++# back-compat to autoconf 2.69, we need the following logic:
++# Check whether <sys/types.h> compiles.
++# If <sys/mkdev.h> compiles, assume it provides major/minor/makedev.
++# Otherwise, if <sys/sysmacros.h> compiles, assume it provides the macros.
++# Otherwise, either the macros were provided by <sys/types.h>, or do
++# not exist on the platform. Code trying to use these three macros is
++# assumed to not care about platforms that lack the macros.
+ AN_FUNCTION([major], [AC_HEADER_MAJOR])
+ AN_FUNCTION([makedev], [AC_HEADER_MAJOR])
+ AN_FUNCTION([minor], [AC_HEADER_MAJOR])
+ AN_HEADER([sys/mkdev.h], [AC_HEADER_MAJOR])
+ AC_DEFUN([AC_HEADER_MAJOR],
+-[AC_CACHE_CHECK(whether sys/types.h defines makedev,
+- ac_cv_header_sys_types_h_makedev,
+-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <sys/types.h>]],
+- [[return makedev(0, 0);]])],
+- [ac_cv_header_sys_types_h_makedev=yes],
+- [ac_cv_header_sys_types_h_makedev=no])
+-])
+-
+-if test $ac_cv_header_sys_types_h_makedev = no; then
++[AC_CHECK_HEADERS_ONCE([sys/types.h])
+ AC_CHECK_HEADER(sys/mkdev.h,
+ [AC_DEFINE(MAJOR_IN_MKDEV, 1,
+ [Define to 1 if `major', `minor', and `makedev' are
+ declared in <mkdev.h>.])])
+-
+- if test $ac_cv_header_sys_mkdev_h = no; then
+- AC_CHECK_HEADER(sys/sysmacros.h,
+- [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+- [Define to 1 if `major', `minor', and `makedev'
+- are declared in <sysmacros.h>.])])
+- fi
++if test $ac_cv_header_sys_mkdev_h = no; then
++ AC_CHECK_HEADER(sys/sysmacros.h,
++ [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
++ [Define to 1 if `major', `minor', and `makedev'
++ are declared in <sysmacros.h>.])])
+ fi
+ ])# AC_HEADER_MAJOR
+
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch b/poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
new file mode 100644
index 000000000..a9094d212
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/add_musl_config.patch
@@ -0,0 +1,26 @@
+backport http://git.savannah.gnu.org/cgit/config.git/commit/config.sub?id=062587eaa891396c936555ae51f7e77eeb71a5fe
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+Index: autoconf-2.69/build-aux/config.sub
+===================================================================
+--- autoconf-2.69.orig/build-aux/config.sub
++++ autoconf-2.69/build-aux/config.sub
+@@ -123,7 +123,7 @@ esac
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
++ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+@@ -1360,7 +1360,7 @@ case $os in
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-android* \
+- | -linux-newlib* | -linux-uclibc* \
++ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
new file mode 100644
index 000000000..ae0e3825f
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch
@@ -0,0 +1,120 @@
+From 236552ff5b9f1ebf666d8d0e9850007dcce03d26 Mon Sep 17 00:00:00 2001
+From: Serhii Popovych <spopovyc@cisco.com>
+Date: Wed, 10 Feb 2016 16:32:44 +0000
+Subject: [PATCH] perl: Replace -w option in shebangs with modern "use
+ warnings"
+
+In some builds we might provide ac_cv_path_PERL as /usr/bin/env perl
+to use newer version of the perl from users PATH rather than
+older from standard system path.
+
+However using /usr/bin/env perl -w from shebang line isn't
+possible because it translates to something like
+/usr/bin/env -w perl and env complains about illegal option.
+
+To address this we can remove -w option from perl shebang
+line and add "use warnings" statement.
+
+Upstream-Status: Pending
+Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
+---
+ bin/autom4te.in | 3 ++-
+ bin/autoreconf.in | 3 ++-
+ bin/autoscan.in | 3 ++-
+ bin/autoupdate.in | 3 ++-
+ bin/ifnames.in | 3 ++-
+ 5 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/bin/autom4te.in b/bin/autom4te.in
+index 11773c9..a8f5e41 100644
+--- a/bin/autom4te.in
++++ b/bin/autom4te.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -42,6 +42,7 @@ use Autom4te::General;
+ use Autom4te::XFile;
+ use File::Basename;
+ use strict;
++use warnings;
+
+ # Data directory.
+ my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
+diff --git a/bin/autoreconf.in b/bin/autoreconf.in
+index e245db4..1a318cb 100644
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -45,6 +45,7 @@ use Autom4te::XFile;
+ # Do not use Cwd::chdir, since it might hang.
+ use Cwd 'cwd';
+ use strict;
++use warnings;
+
+ ## ----------- ##
+ ## Variables. ##
+diff --git a/bin/autoscan.in b/bin/autoscan.in
+index a67c48d..b931249 100644
+--- a/bin/autoscan.in
++++ b/bin/autoscan.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -43,6 +43,7 @@ use Autom4te::XFile;
+ use File::Basename;
+ use File::Find;
+ use strict;
++use warnings;
+
+ use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
+
+diff --git a/bin/autoupdate.in b/bin/autoupdate.in
+index 9737d49..92cb147 100644
+--- a/bin/autoupdate.in
++++ b/bin/autoupdate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -44,6 +44,7 @@ use Autom4te::General;
+ use Autom4te::XFile;
+ use File::Basename;
+ use strict;
++use warnings;
+
+ # Lib files.
+ my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
+diff --git a/bin/ifnames.in b/bin/ifnames.in
+index ba2cd05..74b0278 100644
+--- a/bin/ifnames.in
++++ b/bin/ifnames.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -44,6 +44,7 @@ BEGIN
+ use Autom4te::General;
+ use Autom4te::XFile;
+ use Autom4te::FileUtils;
++use warnings;
+
+ # $HELP
+ # -----
+--
+2.3.0
+
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch b/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
new file mode 100644
index 000000000..d1bd3a2a3
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
@@ -0,0 +1,139 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-12-31 17:39:01.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:43:38.000000000 +0000
+@@ -76,6 +76,7 @@
+ -i, --install copy missing auxiliary files
+ --no-recursive don't rebuild sub-packages
+ -s, --symlink with -i, install symbolic links instead of copies
++ -x, --exclude=STEPS steps we should not run
+ -m, --make when applicable, re-run ./configure && make
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
+
+@@ -136,6 +137,13 @@
+ # Recurse into subpackages
+ my $recursive = 1;
+
++# Steps to exclude
++my @exclude;
++my @ex;
++
++my $uses_gettext;
++my $configure_ac;
++
+ ## ---------- ##
+ ## Routines. ##
+ ## ---------- ##
+@@ -153,6 +161,7 @@
+ 'B|prepend-include=s' => \@prepend_include,
+ 'i|install' => \$install,
+ 's|symlink' => \$symlink,
++ 'x|exclude=s' => \@exclude,
+ 'm|make' => \$run_make,
+ 'recursive!' => \$recursive);
+
+@@ -162,6 +171,8 @@
+ parse_WARNINGS;
+ parse_warnings '--warnings', @warning;
+
++ @exclude = map { split /,/ } @exclude;
++
+ # Even if the user specified a configure.ac, trim to get the
+ # directory, and look for configure.ac again. Because (i) the code
+ # is simpler, and (ii) we are still able to diagnose simultaneous
+@@ -255,6 +266,11 @@
+ {
+ my ($aclocal, $flags) = @_;
+
++ @ex = grep (/^aclocal$/, @exclude);
++ if ($#ex != -1) {
++ return;
++ }
++
+ # aclocal 1.8+ does all this for free. It can be recognized by its
+ # --force support.
+ if ($aclocal_supports_force)
+@@ -368,7 +384,10 @@
+ }
+ else
+ {
+- xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++ @ex = grep (/^autopoint$/, @exclude);
++ if ($#ex == -1) {
++ xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++ }
+ }
+
+
+@@ -532,16 +551,17 @@
+ {
+ $libtoolize .= " --ltdl";
+ }
+- xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
+- $rerun_aclocal = 1;
++ @ex = grep (/^libtoolize$/, @exclude);
++ if ($#ex == -1) {
++ xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
++ $rerun_aclocal = 1;
++ }
+ }
+ else
+ {
+ verb "$configure_ac: not running libtoolize: --install not given";
+ }
+
+-
+-
+ # ------------------- #
+ # Rerunning aclocal. #
+ # ------------------- #
+@@ -572,7 +592,10 @@
+ # latter runs the former, and (ii) autoconf is stricter than
+ # autoheader. So all in all, autoconf should give better error
+ # messages.
+- xsystem ($autoconf);
++ @ex = grep (/^autoconf$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$autoconf");
++ }
+
+
+ # -------------------- #
+@@ -593,7 +616,10 @@
+ }
+ else
+ {
+- xsystem ($autoheader);
++ @ex = grep (/^autoheader$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$autoheader");
++ }
+ }
+
+
+@@ -610,7 +636,10 @@
+ # We should always run automake, and let it decide whether it shall
+ # update the file or not. In fact, the effect of `$force' is already
+ # included in `$automake' via `--no-force'.
+- xsystem ($automake);
++ @ex = grep (/^automake$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$automake");
++ }
+ }
+
+
+@@ -634,7 +663,10 @@
+ }
+ else
+ {
+- xsystem ("$make");
++ @ex = grep (/^make$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$make");
++ }
+ }
+ }
+ }
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch b/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
new file mode 100644
index 000000000..5ff18c235
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in 2008-12-31 17:43:55.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in 2008-12-31 17:46:16.000000000 +0000
+@@ -58,7 +58,7 @@
+ $help = "Usage: $0 [OPTION]... [DIRECTORY]...
+
+ Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
+-(formerly `gettextize'), and `libtoolize' where appropriate)
++(formerly `gettextize'), `libtoolize', and `gnu-configize' where appropriate)
+ repeatedly to remake the GNU Build System files in specified
+ DIRECTORIES and their subdirectories (defaulting to `.').
+
+@@ -115,6 +115,7 @@
+ my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+ my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
+ my $make = $ENV{'MAKE'} || 'make';
++my $gnuconfigize = $ENV{'GNUCONFIGIZE'} || 'gnu-configize';
+
+ # --install -- as --add-missing in other tools.
+ my $install = 0;
+@@ -644,6 +645,10 @@
+ }
+ }
+
++ @ex = grep (/^gnu-configize$/, @exclude);
++ if ($#ex == -1) {
++ xsystem ("$gnuconfigize");
++ }
+
+ # -------------- #
+ # Running make. #
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch b/poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
new file mode 100644
index 000000000..b5e8174ef
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
@@ -0,0 +1,136 @@
+From a7e722f974e2529d3e564d8d94c86cc8bdbc40e7 Mon Sep 17 00:00:00 2001
+From: Radu Patriu <radu.patriu@enea.com>
+Date: Mon, 24 Mar 2014 16:33:19 +0200
+Subject: [PATCH] autotest: new testsuite option to enable automake test
+ result format
+
+* lib/autotest/general.m4: added "--am-fmt | -A" command line
+parameter for testsuite script to enable "RESULT: testname" output;
+will be used by yocto ptest packages.
+
+Upstream-Status: Pending
+
+Signed-off-by: Radu Patriu <radu.patriu@enea.com>
+---
+ lib/autotest/general.m4 | 39 +++++++++++++++++++++++++++++----------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
+index 60c0352..c1f5a9b 100644
+--- a/lib/autotest/general.m4
++++ b/lib/autotest/general.m4
+@@ -412,6 +412,9 @@ at_recheck=
+ # Whether a write failure occurred
+ at_write_fail=0
+
++# Automake result format "result: testname"
++at_am_fmt=false
++
+ # The directory we run the suite in. Default to . if no -C option.
+ at_dir=`pwd`
+ # An absolute reference to this testsuite script.
+@@ -530,6 +533,10 @@ do
+ at_check_filter_trace=at_fn_filter_trace
+ ;;
+
++ --am-fmt | -A )
++ at_am_fmt=:
++ ;;
++
+ [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
+ at_fn_validate_ranges at_option
+ AS_VAR_APPEND([at_groups], ["$at_option$as_nl"])
+@@ -718,10 +725,10 @@ m4_divert_push([HELP_MODES])dnl
+ cat <<_ATEOF || at_write_fail=1
+
+ Operation modes:
+- -h, --help print the help message, then exit
+- -V, --version print version number, then exit
+- -c, --clean remove all the files this test suite might create and exit
+- -l, --list describes all the tests, or the selected TESTS
++ -h, --help print the help message, then exit
++ -V, --version print version number, then exit
++ -c, --clean remove all the files this test suite might create and exit
++ -l, --list describes all the tests, or the selected TESTS
+ _ATEOF
+ m4_divert_pop([HELP_MODES])dnl
+ m4_wrap([m4_divert_push([HELP_TUNING_BEGIN])dnl
+@@ -747,6 +754,7 @@ Execution tuning:
+ -d, --debug inhibit clean up and top-level logging
+ [ default for debugging scripts]
+ -x, --trace enable tests shell tracing
++ -A, --am-fmt automake result format "result: testname"
+ _ATEOF
+ m4_divert_pop([HELP_TUNING_BEGIN])])dnl
+ m4_divert_push([HELP_END])dnl
+@@ -1162,7 +1170,9 @@ at_fn_group_banner ()
+ [*]) at_desc_line="$[1]: " ;;
+ esac
+ AS_VAR_APPEND([at_desc_line], ["$[3]$[4]"])
+- $at_quiet AS_ECHO_N(["$at_desc_line"])
++ if ! $at_am_fmt; then
++ $at_quiet AS_ECHO_N(["$at_desc_line"])
++ fi
+ echo "# -*- compilation -*-" >> "$at_group_log"
+ }
+
+@@ -1188,42 +1198,51 @@ _ATEOF
+ case $at_xfail:$at_status in
+ yes:0)
+ at_msg="UNEXPECTED PASS"
++ at_am_msg="XPASS"
+ at_res=xpass
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ no:0)
+ at_msg="ok"
++ at_am_msg="PASS"
+ at_res=pass
+ at_errexit=false
+ at_color=$at_grn
+ ;;
+ *:77)
+ at_msg='skipped ('`cat "$at_check_line_file"`')'
++ at_am_msg="SKIP"
+ at_res=skip
+ at_errexit=false
+ at_color=$at_blu
+ ;;
+ no:* | *:99)
+ at_msg='FAILED ('`cat "$at_check_line_file"`')'
++ at_am_msg="FAIL"
+ at_res=fail
+ at_errexit=$at_errexit_p
+ at_color=$at_red
+ ;;
+ yes:*)
+ at_msg='expected failure ('`cat "$at_check_line_file"`')'
++ at_am_msg="XFAIL"
+ at_res=xfail
+ at_errexit=false
+ at_color=$at_lgn
+ ;;
+ esac
+ echo "$at_res" > "$at_job_dir/$at_res"
+- # In parallel mode, output the summary line only afterwards.
+- if test $at_jobs -ne 1 && test -n "$at_verbose"; then
+- AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++ if $at_am_fmt; then
++ AS_ECHO(["$at_am_msg: $at_desc"])
+ else
+- # Make sure there is a separator even with long titles.
+- AS_ECHO([" $at_color$at_msg$at_std"])
++ # In parallel mode, output the summary line only afterwards.
++ if test $at_jobs -ne 1 && test -n "$at_verbose"; then
++ AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++ else
++ # Make sure there is a separator even with long titles.
++ AS_ECHO([" $at_color$at_msg$at_std"])
++ fi
+ fi
+ at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
+ case $at_status in
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch b/poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
new file mode 100644
index 000000000..73394d7d5
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
@@ -0,0 +1,34 @@
+Use --warning=cross only if supported by automake
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -127,6 +127,8 @@ my $aclocal_supports_warnings = 0;
+ my $automake_supports_force_missing = 0;
+ # Does automake support -Wfoo?
+ my $automake_supports_warnings = 0;
++# Does automake support --warning=cross
++my $automake_supports_cross_warning = 0;
+
+ my @prepend_include;
+ my @include;
+@@ -191,6 +193,7 @@ sub parse_args ()
+ $aclocal_supports_warnings = $aclocal_help =~ /--warnings/;
+ $automake_supports_force_missing = $automake_help =~ /--force-missing/;
+ $automake_supports_warnings = $automake_help =~ /--warnings/;
++ $automake_supports_cross_warning = $automake_help =~ /cross/;
+
+ # Dispatch autoreconf's option to the tools.
+ # --include;
+@@ -244,6 +247,8 @@ sub parse_args ()
+ $libtoolize .= ' --debug';
+ }
+ # --warnings;
++ @warning = grep { $_ ne "cross" } @warning
++ if ! $automake_supports_cross_warning;
+ if (@warning)
+ {
+ my $warn = ' --warnings=' . join (',', @warning);
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch b/poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch
new file mode 100644
index 000000000..9f044404d
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/config_site.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+Poky provides a list of site files in CONFIG_SITE whereas autoconf
+only expects one file. This patch changes autoconf to accept a list of
+them.
+
+RP 1/2/10
+
+Updated for 2.68 version: the CONFIG_SITE var was not getting used at all
+fixed the 2.68 code
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/27
+
+Index: autoconf-2.68/lib/autoconf/general.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/general.m4
++++ autoconf-2.68/lib/autoconf/general.m4
+@@ -1878,7 +1878,6 @@ AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPL
+ m4_define([AC_SITE_LOAD],
+ [# Prefer an explicitly selected file to automatically selected ones.
+ ac_site_file1=NONE
+-ac_site_file2=NONE
+ if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in @%:@((
+@@ -1886,14 +1885,8 @@ if test -n "$CONFIG_SITE"; then
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+-elif test "x$prefix" != xNONE; then
+- ac_site_file1=$prefix/share/config.site
+- ac_site_file2=$prefix/etc/config.site
+-else
+- ac_site_file1=$ac_default_prefix/share/config.site
+- ac_site_file2=$ac_default_prefix/etc/config.site
+ fi
+-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
++for ac_site_file in $ac_site_file1
+ do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch b/poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
new file mode 100644
index 000000000..65df88f8f
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
@@ -0,0 +1,120 @@
+Upstream-Status: Pending
+
+We don't build xmkmf so any values returned from it are going to be wrong.
+Using any paths in /usr/ for x headers/libs is a bad idea when cross compiling.
+This patch removes them to stop any confusion.
+
+RP - 20071115
+
+Index: autoconf-2.68/lib/autoconf/libs.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/libs.m4
++++ autoconf-2.68/lib/autoconf/libs.m4
+@@ -159,53 +159,6 @@ m4_popdef([AC_Lib_Name])dnl
+ # --------------------- #
+
+
+-# _AC_PATH_X_XMKMF
+-# ----------------
+-# Internal subroutine of _AC_PATH_X.
+-# Set ac_x_includes and/or ac_x_libraries.
+-m4_define([_AC_PATH_X_XMKMF],
+-[AC_ARG_VAR(XMKMF, [Path to xmkmf, Makefile generator for X Window System])dnl
+-rm -f -r conftest.dir
+-if mkdir conftest.dir; then
+- cd conftest.dir
+- cat >Imakefile <<'_ACEOF'
+-incroot:
+- @echo incroot='${INCROOT}'
+-usrlibdir:
+- @echo usrlibdir='${USRLIBDIR}'
+-libdir:
+- @echo libdir='${LIBDIR}'
+-_ACEOF
+- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+- for ac_var in incroot usrlibdir libdir; do
+- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+- done
+- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+- for ac_extension in a so sl dylib la dll; do
+- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+- test -f "$ac_im_libdir/libX11.$ac_extension"; then
+- ac_im_usrlibdir=$ac_im_libdir; break
+- fi
+- done
+- # Screen out bogus values from the imake configuration. They are
+- # bogus both because they are the default anyway, and because
+- # using them would break gcc on systems where it needs fixed includes.
+- case $ac_im_incroot in
+- /usr/include) ac_x_includes= ;;
+- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+- esac
+- case $ac_im_usrlibdir in
+- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+- esac
+- fi
+- cd ..
+- rm -f -r conftest.dir
+-fi
+-])# _AC_PATH_X_XMKMF
+-
+-
+ # _AC_PATH_X_DIRECT
+ # -----------------
+ # Internal subroutine of _AC_PATH_X.
+@@ -213,44 +166,7 @@ fi
+ m4_define([_AC_PATH_X_DIRECT],
+ [# Standard set of common directories for X headers.
+ # Check X11 before X11Rn because it is often a symlink to the current release.
+-ac_x_header_dirs='
+-/usr/X11/include
+-/usr/X11R7/include
+-/usr/X11R6/include
+-/usr/X11R5/include
+-/usr/X11R4/include
+-
+-/usr/include/X11
+-/usr/include/X11R7
+-/usr/include/X11R6
+-/usr/include/X11R5
+-/usr/include/X11R4
+-
+-/usr/local/X11/include
+-/usr/local/X11R7/include
+-/usr/local/X11R6/include
+-/usr/local/X11R5/include
+-/usr/local/X11R4/include
+-
+-/usr/local/include/X11
+-/usr/local/include/X11R7
+-/usr/local/include/X11R6
+-/usr/local/include/X11R5
+-/usr/local/include/X11R4
+-
+-/usr/X386/include
+-/usr/x386/include
+-/usr/XFree86/include/X11
+-
+-/usr/include
+-/usr/local/include
+-/usr/unsupported/include
+-/usr/athena/include
+-/usr/local/x11r5/include
+-/usr/lpp/Xamples/include
+-
+-/usr/openwin/include
+-/usr/openwin/share/include'
++ac_x_header_dirs=''
+
+ if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+@@ -299,7 +215,6 @@ AC_DEFUN([_AC_PATH_X],
+ [AC_CACHE_VAL(ac_cv_have_x,
+ [# One or both of the vars are not set, and there is no cached value.
+ ac_x_includes=no ac_x_libraries=no
+-_AC_PATH_X_XMKMF
+ _AC_PATH_X_DIRECT
+ case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/performance.patch b/poky/meta/recipes-devtools/autoconf/autoconf/performance.patch
new file mode 100644
index 000000000..1842fe92b
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/performance.patch
@@ -0,0 +1,60 @@
+The check for solaris 'print' causes significant problems on a linux machine
+with dash as /bin/sh since it triggers the execution of "print" which on some
+linux systems is a perl script which is part of mailcap. Worse, this perl
+script calls "which file" and if successful ignores the path file was found
+in and just runs "file" without a path. Each exection causes PATH to be searched.
+
+Simply assuming the shell's printf function works cuts out all the fork overhead
+and when parallel tasks are running, this overhead appears to be significant.
+
+RP
+2015/11/28
+Upstream-Status: Inappropriate
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4
++++ autoconf-2.69/lib/m4sugar/m4sh.m4
+@@ -1045,40 +1045,8 @@ m4_defun([_AS_ECHO_PREPARE],
+ [[as_nl='
+ '
+ export as_nl
+-# Printing a long string crashes Solaris 7 /usr/bin/printf.
+-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+-# Prefer a ksh shell builtin over an external printf program on Solaris,
+-# but without wasting forks for bash or zsh.
+-if test -z "$BASH_VERSION$ZSH_VERSION" \
+- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+- as_echo='print -r --'
+- as_echo_n='print -rn --'
+-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+- as_echo='printf %s\n'
+- as_echo_n='printf %s'
+-else
+- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+- as_echo_body='eval /usr/ucb/echo -n "$][1$as_nl"'
+- as_echo_n='/usr/ucb/echo -n'
+- else
+- as_echo_body='eval expr "X$][1" : "X\\(.*\\)"'
+- as_echo_n_body='eval
+- arg=$][1;
+- case $arg in @%:@(
+- *"$as_nl"*)
+- expr "X$arg" : "X\\(.*\\)$as_nl";
+- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+- esac;
+- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+- '
+- export as_echo_n_body
+- as_echo_n='sh -c $as_echo_n_body as_echo'
+- fi
+- export as_echo_body
+- as_echo='sh -c $as_echo_body as_echo'
+-fi
++as_echo='printf %s\n'
++as_echo_n='printf %s'
+ ]])# _AS_ECHO_PREPARE
+
+
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch b/poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
new file mode 100644
index 000000000..fa76ee9bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
@@ -0,0 +1,25 @@
+This value is used to determine CONFIG_SHELL and SHELL which may get exported into
+scripts shared via sstate onto other systems.
+
+Some systems have /bin/sh -> dash and others /bin/sh -> bash. Bash is preferred
+but sometimes we can sometimes end up exporting /bin/sh yet use bashisms.
+
+This patch puts bash first in the search results which avoids the bash/dash confusion.
+
+RP 2012/9/23
+
+Upstream-Status: Inappropriate [OE specific configuration]
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4 2012-03-07 17:35:26.000000000 +0000
++++ autoconf-2.69/lib/m4sugar/m4sh.m4 2013-09-23 16:12:38.853597515 +0000
+@@ -229,7 +229,7 @@
+ [_AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+ [case $as_dir in @%:@(
+ /*)
+- for as_base in sh bash ksh sh5; do
++ for as_base in bash sh ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } &&
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch b/poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
new file mode 100644
index 000000000..978a401f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- autoconf-2.57/lib/autoconf/general.m4~program_prefix
++++ autoconf-2.57/lib/autoconf/general.m4
+@@ -1676,8 +1676,9 @@
+ # The aliases save the names the user supplied, while $host etc.
+ # will get canonicalized.
+ test -n "$target_alias" &&
+- test "$program_prefix$program_suffix$program_transform_name" = \
+- NONENONEs,x,x, &&
++ test "$target_alias" != "$host_alias" &&
++ test "$program_prefix$program_suffix$program_transform_name" = \
++ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-[]dnl
+ ])# AC_CANONICAL_TARGET
+
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch b/poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 000000000..55d2e2fe7
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,29 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+Index: autoconf-2.68/lib/autoconf/functions.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/functions.m4 2010-09-22 14:52:19.000000000 -0700
++++ autoconf-2.68/lib/autoconf/functions.m4 2011-08-03 11:57:05.822199513 -0700
+@@ -749,15 +749,6 @@ if test $ac_have_func = no; then
+ [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
+ fi
+
+-if test $ac_have_func = no; then
+- # There is a commonly available library for RS/6000 AIX.
+- # Since it is not a standard part of AIX, it might be installed locally.
+- ac_getloadavg_LIBS=$LIBS
+- LIBS="-L/usr/local/lib $LIBS"
+- AC_CHECK_LIB(getloadavg, getloadavg,
+- [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
+-fi
+-
+ # Make sure it is really in the library, if we think we found it,
+ # otherwise set up the replacement function.
+ AC_CHECK_FUNCS(getloadavg, [],
diff --git a/poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
new file mode 100644
index 000000000..8e67f4b82
--- /dev/null
+++ b/poky/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -0,0 +1,28 @@
+require autoconf.inc
+
+PR = "r11"
+
+LICENSE = "GPLv2 & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
+SRC_URI += "file://check-automake-cross-warning.patch \
+ file://autoreconf-exclude.patch \
+ file://autoreconf-gnuconfigize.patch \
+ file://config_site.patch \
+ file://remove-usr-local-lib-from-m4.patch \
+ file://preferbash.patch \
+ file://autotest-automake-result-format.patch \
+ file://add_musl_config.patch \
+ file://performance.patch \
+ file://AC_HEADER_MAJOR-port-to-glibc-2.25.patch \
+ file://autoconf-replace-w-option-in-shebangs-with-modern-use-warnings.patch \
+ "
+
+SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"
+SRC_URI[sha256sum] = "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969"
+
+SRC_URI_append_class-native = " file://fix_path_xtra.patch"
+
+EXTRA_OECONF += "ac_cv_path_M4=m4 ac_cv_prog_TEST_EMACS=no"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/automake/automake.inc b/poky/meta/recipes-devtools/automake/automake.inc
new file mode 100644
index 000000000..87cedc983
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake.inc
@@ -0,0 +1,21 @@
+SUMMARY = "A GNU tool for automatically generating Makefiles"
+DESCRIPTION = "Automake is a tool for automatically generating `Makefile.in' files compliant with the GNU Coding \
+Standards. Automake requires the use of Autoconf."
+LICENSE = "GPLv2"
+HOMEPAGE = "http://www.gnu.org/software/automake/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/automake/automake-${PV}.tar.gz"
+
+inherit autotools texinfo
+
+do_configure() {
+ # We can end up patching macros, which would then mean autoreconf
+ # Cheat by saying everything is up to date.
+ touch ${S}/aclocal.m4 ${S}/Makefile.in ${S}/configure
+ oe_runconf
+}
+
+export AUTOMAKE = "${@bb.utils.which('automake', d.getVar('PATH'))}"
+
+FILES_${PN} += "${datadir}/automake* ${datadir}/aclocal*"
diff --git a/poky/meta/recipes-devtools/automake/automake/0001-automake-Add-default-libtool_tag-to-cppasm.patch b/poky/meta/recipes-devtools/automake/automake/0001-automake-Add-default-libtool_tag-to-cppasm.patch
new file mode 100644
index 000000000..1221f1306
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/0001-automake-Add-default-libtool_tag-to-cppasm.patch
@@ -0,0 +1,27 @@
+From 25a8ac30486798d23f516722d73eb622e6264f28 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 26 Jul 2017 11:19:56 -0700
+Subject: [PATCH] automake: Add default libtool_tag to cppasm.
+
+ * bin/automake.in (register_language): Define default libtool tag to be CC
+ since CPPASCOMPILE is using CC to call assembler
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ bin/automake.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: automake-1.15.1/bin/automake.in
+===================================================================
+--- automake-1.15.1.orig/bin/automake.in
++++ automake-1.15.1/bin/automake.in
+@@ -831,6 +831,7 @@ register_language ('name' => 'cppasm',
+ 'compiler' => 'CPPASCOMPILE',
+ 'compile_flag' => '-c',
+ 'output_flag' => '-o',
++ 'libtool_tag' => 'CC',
+ 'extensions' => ['.S', '.sx']);
+
+ # Fortran 77
diff --git a/poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch b/poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch
new file mode 100644
index 000000000..96b5a3d6b
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch
@@ -0,0 +1,96 @@
+From 41e06b7a354774913dcd2e32a35440e407843357 Mon Sep 17 00:00:00 2001
+From: Serhii Popovych <spopovyc@cisco.com>
+Date: Wed, 10 Feb 2016 17:07:32 +0000
+Subject: [PATCH] perl: Replace -w option in shebangs with modern "use
+ warnings" In some builds we might provide ac_cv_path_PERL as /usr/bin/env
+ perl to use newer version of the perl from users PATH rather than older from
+ standard system path.
+
+However using /usr/bin/env perl -w from shebang line isn't
+possible because it translates to something like
+/usr/bin/env -w perl and env complains about illegal option.
+
+To address this we can remove -w option from perl shebang
+line and add "use warnings" statement.
+
+Upstream-Status: Pending
+Signed-off-by: Serhii Popovych <spopovyc@cisco.com>
+---
+ bin/aclocal.in | 3 ++-
+ bin/automake.in | 3 ++-
+ t/wrap/aclocal.in | 3 ++-
+ t/wrap/automake.in | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+Index: automake-1.15.1/bin/aclocal.in
+===================================================================
+--- automake-1.15.1.orig/bin/aclocal.in
++++ automake-1.15.1/bin/aclocal.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -33,6 +33,7 @@ BEGIN
+ }
+
+ use strict;
++use warnings;
+
+ use Automake::Config;
+ use Automake::General;
+Index: automake-1.15.1/bin/automake.in
+===================================================================
+--- automake-1.15.1.orig/bin/automake.in
++++ automake-1.15.1/bin/automake.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # -*- perl -*-
+ # @configure_input@
+
+@@ -28,6 +28,7 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+ package Automake;
+
+ use strict;
++use warnings;
+
+ BEGIN
+ {
+Index: automake-1.15.1/t/wrap/aclocal.in
+===================================================================
+--- automake-1.15.1.orig/t/wrap/aclocal.in
++++ automake-1.15.1/t/wrap/aclocal.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # @configure_input@
+
+ # Copyright (C) 2012-2017 Free Software Foundation, Inc.
+@@ -19,6 +19,7 @@
+ BEGIN
+ {
+ use strict;
++ use warnings;
+ @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib');
+ unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib'
+ if '@srcdir@' ne '.';
+Index: automake-1.15.1/t/wrap/automake.in
+===================================================================
+--- automake-1.15.1.orig/t/wrap/automake.in
++++ automake-1.15.1/t/wrap/automake.in
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ # @configure_input@
+
+ # Copyright (C) 2012-2017 Free Software Foundation, Inc.
+@@ -19,6 +19,7 @@
+ BEGIN
+ {
+ use strict;
++ use warnings;
+ @Automake::perl_libdirs = ('@abs_top_srcdir@/lib');
+ unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib'
+ if '@srcdir@' ne '.';
diff --git a/poky/meta/recipes-devtools/automake/automake/buildtest.patch b/poky/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 000000000..c32cd1fb1
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/buildtest.patch
@@ -0,0 +1,35 @@
+Split "check-TESTS" into a buildtest and runtest target, so that they can
+be run separately.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+Index: automake-1.15.1/lib/am/check.am
+===================================================================
+--- automake-1.15.1.orig/lib/am/check.am
++++ automake-1.15.1/lib/am/check.am
+@@ -41,7 +41,7 @@ am__tty_colors = { \
+ fi; \
+ }
+
+-.PHONY: check-TESTS
++.PHONY: check-TESTS buildtest-TESTS runtest-TESTS
+
+ if !%?SERIAL_TESTS%
+
+@@ -466,7 +466,14 @@ else %?SERIAL_TESTS%
+
+ ## Obsolescent serial testsuite driver.
+
+-check-TESTS: $(TESTS)
++AM_RECURSIVE_TARGETS += buildtest runtest
++
++buildtest-TESTS: $(TESTS)
++
++check-TESTS: buildtest-TESTS
++ $(MAKE) $(AM_MAKEFLAGS) runtest-TESTS
++
++runtest-TESTS:
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ ## Make sure Solaris VPATH-expands all members of this list, even
diff --git a/poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch b/poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch
new file mode 100644
index 000000000..2c6594f52
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/new_rt_path_for_test-driver.patch
@@ -0,0 +1,36 @@
+Set relative to top_builddir path in Makefile to access test-driver
+
+Signed-off-by: Adrian Calianu <adrian.calianu@enea.com>
+Upstream-Status: Pending
+Bug-Report: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19042
+
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -272,6 +272,9 @@
+ # $AM_CONFIG_AUX_DIR is prefixed with $(top_srcdir), so it can be used
+ # in Makefiles.
+ my $am_config_aux_dir = '';
++# Directory used at runtime like running test-driver that should not
++# depend on $(top_srcdir)
++my $am_config_rt_aux_dir = '';
+
+ # Directory to search for AC_LIBSOURCE files, as set by AC_CONFIG_LIBOBJ_DIR
+ # in configure.ac.
+@@ -4700,7 +4703,7 @@
+ {
+ require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
+ define_variable ("${pfx}LOG_DRIVER",
+- "\$(SHELL) $am_config_aux_dir/test-driver",
++ "\$(SHELL) $am_config_rt_aux_dir/test-driver",
+ INTERNAL);
+ }
+ my $driver = '$(' . $pfx . 'LOG_DRIVER)';
+@@ -7284,6 +7287,10 @@
+ $am_config_aux_dir =
+ '$(top_srcdir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
+ $am_config_aux_dir =~ s,/*$,,;
++
++ $am_config_rt_aux_dir =
++ '$(top_builddir)' . ($config_aux_dir eq '.' ? "" : "/$config_aux_dir");
++ $am_config_rt_aux_dir =~ s,/*$,,;
+ }
diff --git a/poky/meta/recipes-devtools/automake/automake/performance.patch b/poky/meta/recipes-devtools/automake/automake/performance.patch
new file mode 100644
index 000000000..3e6d5694d
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/performance.patch
@@ -0,0 +1,73 @@
+By default automake puts "sleep 1" into the start of configure scripts
+which adds pointless delays to them. Rather than do this, lets just assume
+our systems are sane.
+
+RP
+2015/12/7
+Upstream-Status: Inappropriate
+
+Index: automake-1.15/m4/sanity.m4
+===================================================================
+--- automake-1.15.orig/m4/sanity.m4
++++ automake-1.15/m4/sanity.m4
+@@ -23,60 +23,5 @@ case $srcdir in
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+ esac
+
+-# Do 'set' in a subshell so we don't clobber the current shell's
+-# arguments. Must try -L first in case configure is actually a
+-# symlink; some systems play weird games with the mod time of symlinks
+-# (eg FreeBSD returns the mod time of the symlink's containing
+-# directory).
+-if (
+- am_has_slept=no
+- for am_try in 1 2; do
+- echo "timestamp, slept: $am_has_slept" > conftest.file
+- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+- if test "$[*]" = "X"; then
+- # -L didn't work.
+- set X `ls -t "$srcdir/configure" conftest.file`
+- fi
+- if test "$[*]" != "X $srcdir/configure conftest.file" \
+- && test "$[*]" != "X conftest.file $srcdir/configure"; then
+-
+- # If neither matched, then we have a broken ls. This can happen
+- # if, for instance, CONFIG_SHELL is bash and it inherits a
+- # broken ls alias from the environment. This has actually
+- # happened. Such a system could not be considered "sane".
+- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+- alias in your environment])
+- fi
+- if test "$[2]" = conftest.file || test $am_try -eq 2; then
+- break
+- fi
+- # Just in case.
+- sleep 1
+- am_has_slept=yes
+- done
+- test "$[2]" = conftest.file
+- )
+-then
+- # Ok.
+- :
+-else
+- AC_MSG_ERROR([newly created file is older than distributed files!
+-Check your system clock])
+-fi
+ AC_MSG_RESULT([yes])
+-# If we didn't sleep, we still need to ensure time stamps of config.status and
+-# generated files are strictly newer.
+-am_sleep_pid=
+-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+- ( sleep 1 ) &
+- am_sleep_pid=$!
+-fi
+-AC_CONFIG_COMMANDS_PRE(
+- [AC_MSG_CHECKING([that generated files are newer than configure])
+- if test -n "$am_sleep_pid"; then
+- # Hide warnings about reused PIDs.
+- wait $am_sleep_pid 2>/dev/null
+- fi
+- AC_MSG_RESULT([done])])
+-rm -f conftest.file
+ ])
diff --git a/poky/meta/recipes-devtools/automake/automake/python-libdir.patch b/poky/meta/recipes-devtools/automake/automake/python-libdir.patch
new file mode 100644
index 000000000..2a48b133e
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake/python-libdir.patch
@@ -0,0 +1,91 @@
+From 472a3d36c97ef7535f05d6c185edcbc22b0074c4 Mon Sep 17 00:00:00 2001
+From: Kumar Gala <galak@kernel.crashing.org>
+Date: Thu, 11 Aug 2011 01:26:33 -0500
+Subject: [PATCH 1/4] automake: Update for python.m4 to respect libdir
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+Updated for automake-1.12.6
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ m4/python.m4 | 27 +++++++--------------------
+ 1 file changed, 7 insertions(+), 20 deletions(-)
+
+diff --git a/m4/python.m4 b/m4/python.m4
+index 5b2c695..ed19261 100644
+--- a/m4/python.m4
++++ b/m4/python.m4
+@@ -91,12 +91,13 @@ AC_DEFUN([AM_PATH_PYTHON],
+ [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+ AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+- dnl Use the values of $prefix and $exec_prefix for the corresponding
+- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
++ dnl Use the values of $prefix, $libdir and $exec_prefix for the corresponding
++ dnl values of PYTHON_PREFIX PYTHON_LIB_PREFIX, and PYTHON_EXEC_PREFIX. These are made
+ dnl distinct variables so they can be overridden if need be. However,
+ dnl general consensus is that you shouldn't need this ability.
+
+ AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
++ AC_SUBST([PYTHON_LIB_PREFIX], ['${libdir}'])
+ AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+ dnl At times (like when building shared libraries) you may want
+@@ -141,14 +142,7 @@ except ImportError:
+ else
+ am_py_prefix=$prefix
+ fi
+- am_cv_python_pythondir=`$PYTHON -c "
+-$am_python_setup_sysconfig
+-if can_use_sysconfig:
+- sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+-else:
+- from distutils import sysconfig
+- sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++ am_cv_python_pythondir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+ case $am_cv_python_pythondir in
+ $am_py_prefix*)
+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+@@ -158,7 +152,7 @@ sys.stdout.write(sitedir)"`
+ case $am_py_prefix in
+ /usr|/System*) ;;
+ *)
+- am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
++ am_cv_python_pythondir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+@@ -183,14 +177,7 @@ sys.stdout.write(sitedir)"`
+ else
+ am_py_exec_prefix=$exec_prefix
+ fi
+- am_cv_python_pyexecdir=`$PYTHON -c "
+-$am_python_setup_sysconfig
+-if can_use_sysconfig:
+- sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+-else:
+- from distutils import sysconfig
+- sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++ am_cv_python_pyexecdir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+ case $am_cv_python_pyexecdir in
+ $am_py_exec_prefix*)
+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+@@ -200,7 +187,7 @@ sys.stdout.write(sitedir)"`
+ case $am_py_exec_prefix in
+ /usr|/System*) ;;
+ *)
+- am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
++ am_cv_python_pyexecdir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+--
+2.8.1
+
diff --git a/poky/meta/recipes-devtools/automake/automake_1.15.1.bb b/poky/meta/recipes-devtools/automake/automake_1.15.1.bb
new file mode 100644
index 000000000..4f9b616b6
--- /dev/null
+++ b/poky/meta/recipes-devtools/automake/automake_1.15.1.bb
@@ -0,0 +1,43 @@
+require automake.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS_class-native = "autoconf-native"
+
+NAMEVER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+RDEPENDS_${PN} += "\
+ autoconf \
+ perl \
+ perl-module-bytes \
+ perl-module-data-dumper \
+ perl-module-strict \
+ perl-module-text-parsewords \
+ perl-module-thread-queue \
+ perl-module-threads \
+ perl-module-vars "
+
+RDEPENDS_${PN}_class-native = "autoconf-native hostperl-runtime-native"
+RDEPENDS_${PN}_class-nativesdk = "nativesdk-autoconf"
+
+SRC_URI += "file://python-libdir.patch \
+ file://buildtest.patch \
+ file://performance.patch \
+ file://new_rt_path_for_test-driver.patch \
+ file://automake-replace-w-option-in-shebangs-with-modern-use-warnings.patch \
+ file://0001-automake-Add-default-libtool_tag-to-cppasm.patch \
+ "
+
+SRC_URI[md5sum] = "95df3f2d6eb8f81e70b8cb63a93c8853"
+SRC_URI[sha256sum] = "988e32527abe052307d21c8ca000aa238b914df363a617e38f4fb89f5abf6260"
+
+PERL = "${USRBINPATH}/perl"
+PERL_class-native = "${USRBINPATH}/env perl"
+PERL_class-nativesdk = "${USRBINPATH}/env perl"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='${PERL}'"
+
+do_install_append () {
+ install -d ${D}${datadir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/binutils/binutils-2.30.inc b/poky/meta/recipes-devtools/binutils/binutils-2.30.inc
new file mode 100644
index 000000000..9c883acc5
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-2.30.inc
@@ -0,0 +1,43 @@
+LIC_FILES_CHKSUM="\
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
+ file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+ file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+ file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
+ file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ "
+
+def binutils_branch_version(d):
+ pvsplit = d.getVar('PV').split('.')
+ return pvsplit[0] + "_" + pvsplit[1]
+
+BINUPV = "${@binutils_branch_version(d)}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
+
+SRCREV ?= "caa839fba66600a6c36d3639906ed9110b79c307"
+BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git"
+SRC_URI = "\
+ ${BINUTILS_GIT_URI} \
+ file://0003-configure-widen-the-regexp-for-SH-architectures.patch \
+ file://0004-Point-scripts-location-to-libdir.patch \
+ file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+ file://0006-Use-libtool-2.4.patch \
+ file://0007-Add-the-armv5e-architecture-to-binutils.patch \
+ file://0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
+ file://0009-warn-for-uses-of-system-directories-when-cross-linki.patch \
+ file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
+ file://0011-Change-default-emulation-for-mips64-linux.patch \
+ file://0012-Add-support-for-Netlogic-XLP.patch \
+ file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
+ file://0014-Detect-64-bit-MIPS-targets.patch \
+ file://0015-sync-with-OE-libtool-changes.patch \
+"
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+ rm -rf ${S}/gdb ${S}/libdecnumber ${S}/readline ${S}/sim
+}
diff --git a/poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
new file mode 100644
index 000000000..e98f31f9c
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,32 @@
+inherit cross-canadian
+
+SUMMARY = "GNU binary utilities (cross-canadian for ${TARGET_ARCH} target)"
+PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "binutils"
+
+DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-libc nativesdk-zlib nativesdk-gettext nativesdk-flex"
+EXTRA_OECONF += "--with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
+ --enable-poison-system-directories \
+ "
+
+# We have to point binutils at a sysroot but we don't need to rebuild if this changes
+# e.g. we switch between different machines with different tunes.
+EXTRA_OECONF[vardepsexclude] = "TUNE_PKGARCH"
+
+LDGOLD_sdkmingw32 = ""
+
+do_install () {
+ autotools_do_install
+
+ # We're not interested in the libs or headers, these would come from the
+ # nativesdk or target version of the binutils recipe
+ rm -rf ${D}${prefix}/${TARGET_SYS}
+ rm -f ${D}${libdir}/libbfd*
+ rm -f ${D}${libdir}/libiberty*
+ rm -f ${D}${libdir}/libopcodes*
+ rm -f ${D}${includedir}/*.h
+
+ cross_canadian_bindirlinks
+}
+
+BBCLASSEXTEND = ""
diff --git a/poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.30.bb b/poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.30.bb
new file mode 100644
index 000000000..5dbaa0301
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-cross-canadian_2.30.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross-canadian.inc
diff --git a/poky/meta/recipes-devtools/binutils/binutils-cross.inc b/poky/meta/recipes-devtools/binutils/binutils-cross.inc
new file mode 100644
index 000000000..02ec89160
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,38 @@
+inherit cross
+PROVIDES = "virtual/${TARGET_PREFIX}binutils"
+
+PN = "binutils-cross-${TARGET_ARCH}"
+BPN = "binutils"
+
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+SRC_URI += "file://0002-binutils-cross-Do-not-generate-linker-script-directo.patch"
+
+# Specify lib-path else we use a load of search dirs which we don't use
+# and mean the linker scripts have to be relocated.
+EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
+ --disable-install-libbfd \
+ --enable-poison-system-directories \
+ --with-lib-path==${target_base_libdir}:=${target_libdir} \
+ "
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+
+ # We don't really need these, so we'll remove them...
+ rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
+ rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
+}
diff --git a/poky/meta/recipes-devtools/binutils/binutils-cross_2.30.bb b/poky/meta/recipes-devtools/binutils/binutils-cross_2.30.bb
new file mode 100644
index 000000000..fbd1f7d25
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-cross_2.30.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross.inc
diff --git a/poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.30.bb b/poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.30.bb
new file mode 100644
index 000000000..37f4d6d2e
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils-crosssdk_2.30.bb
@@ -0,0 +1,13 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PN = "binutils-crosssdk-${SDK_SYS}"
+
+PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
+
+SRC_URI += "file://0001-binutils-crosssdk-Generate-relocatable-SDKs.patch"
+
+do_configure_prepend () {
+ sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
+}
diff --git a/poky/meta/recipes-devtools/binutils/binutils.inc b/poky/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 000000000..37813dd86
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils.inc
@@ -0,0 +1,162 @@
+SUMMARY = "GNU binary utilities"
+DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
+The main ones are ld (GNU Linker), and as (GNU Assembler). This \
+package also includes addition tools such as addr2line (Converts \
+addresses into filenames and line numbers), ar (utility for creating, \
+modifying and extracting archives), nm (list symbols in object \
+files), objcopy (copy and translate object files), objdump (Display \
+object information), and other tools and related libraries."
+HOMEPAGE = "http://www.gnu.org/software/binutils/"
+BUGTRACKER = "http://sourceware.org/bugzilla/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+
+DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
+
+#
+# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath
+#
+DEPENDS_append_class-target = " chrpath-replacement-native"
+EXTRANATIVEPATH_append_class-target = " chrpath-native"
+
+inherit autotools gettext multilib_header texinfo
+
+FILES_${PN} = " \
+ ${bindir}/${TARGET_PREFIX}* \
+ ${libdir}/lib*-*.so \
+ ${prefix}/${TARGET_SYS}/bin/* \
+ ${bindir}/embedspu"
+
+RPROVIDES_${PN} += "${PN}-symlinks"
+
+FILES_${PN}-dev = " \
+ ${includedir} \
+ ${libdir}/*.la \
+ ${libdir}/libbfd.so \
+ ${libdir}/libopcodes.so"
+
+# Rather than duplicating multiple entries for these, make one
+# list and reuse it.
+
+USE_ALTERNATIVES_FOR = " \
+ addr2line \
+ ar \
+ as \
+ c++filt \
+ elfedit \
+ gprof \
+ ld \
+ ld.bfd \
+ ld.gold dwp \
+ nm \
+ objcopy \
+ objdump \
+ ranlib \
+ readelf \
+ size \
+ strings \
+ strip \
+"
+
+python do_package_prepend() {
+ make_alts = d.getVar("USE_ALTERNATIVES_FOR") or ""
+ prefix = d.getVar("TARGET_PREFIX")
+ bindir = d.getVar("bindir")
+ for alt in make_alts.split():
+ d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
+}
+
+B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
+
+EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
+ --disable-werror \
+ --enable-deterministic-archives \
+ --enable-plugins \
+ ${LDGOLD} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
+
+LDGOLD_class-native = ""
+LDGOLD_class-crosssdk = ""
+LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
+
+# This is necessary due to a bug in the binutils Makefiles
+# EXTRA_OEMAKE = "configure-build-libiberty all"
+
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as"
+export LD = "${HOST_PREFIX}ld"
+export NM = "${HOST_PREFIX}nm"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+
+export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+
+# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need
+# to unset LD_LIBRARY_PATH.
+export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
+
+MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
+do_configure[vardeps] += "MULTIARCH"
+do_configure () {
+ (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+ oe_runconf
+#
+# must prime config.cache to ensure the build of libiberty
+#
+ mkdir -p ${B}/build-${BUILD_SYS}
+ for i in ${CONFIG_SITE}; do
+ cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true
+ done
+}
+
+do_compile_append_class-target() {
+ chrpath -d ${B}/binutils/elfedit
+ chrpath -d ${B}/binutils/readelf
+}
+do_install () {
+ autotools_do_install
+
+ # We don't really need these, so we'll remove them...
+ rm -rf ${D}${libdir}/ldscripts
+
+ # Fix the /usr/${TARGET_SYS}/bin/* links
+ for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
+ rm -f $l
+ ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
+ | tr -s / \
+ | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+ done
+
+ # Install the libiberty header
+ install -d ${D}${includedir}
+ install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+ install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+ cd ${D}${bindir}
+
+ # Symlinks for ease of running these on the native target
+ for p in ${TARGET_PREFIX}* ; do
+ ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
+ done
+
+ for alt in ${USE_ALTERNATIVES_FOR}; do
+ rm -f ${D}${bindir}/$alt
+ done
+
+ oe_multilib_header bfd.h
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}"
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch b/poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
new file mode 100644
index 000000000..2df836057
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch
@@ -0,0 +1,62 @@
+From 2e1b5e24a6759de7f73aa6060a574848d9131b5a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs
+
+This patch will modify the ELF linker scripts so that the crosssdk
+linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
+will be relocated, at SDK install time, the interpreter path can be easily
+changed by the relocating script.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/genscripts.sh | 3 +++
+ ld/scripttempl/elf.sc | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index 8732422b3a..1f257e99ca 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -277,6 +277,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
+ LD_FLAG=r
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
+ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -r: link without relocation */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+@@ -285,10 +286,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
+ LD_FLAG=u
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
+ CONSTRUCTING=" "
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
+ . ${CUSTOMIZER_SCRIPT}
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu
++unset PARTIAL_LINKING
+
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_}
+ RELOCATING=" "
+diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
+index 9787ab5dac..0c8a93c2c8 100644
+--- a/ld/scripttempl/elf.sc
++++ b/ld/scripttempl/elf.sc
+@@ -139,8 +139,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
+ DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
+ fi
+ fi
+-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
+- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
++if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
++ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
+ fi
+ if test -z "$PLT"; then
+ IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch b/poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch
new file mode 100644
index 000000000..bac7fb2d1
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch
@@ -0,0 +1,61 @@
+From 58ddf38fa53abb48b69dd76e398c73451ad1a5eb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Mar 2017 23:37:05 -0800
+Subject: [PATCH 02/15] binutils-cross: Do not generate linker script
+ directories
+
+We don't place target libraries within ${exec_prefix}, we'd always place these
+within the target sysroot within the standard library directories. Worse, the
+append_to_lib_path code prefixes these paths with the sysroot which makes even
+less sense.
+
+These directories therefore don't make sense in our case and mean we have to
+relocate all the linker scripts if they're present. Dropping them
+gives a reasonable performance improvement/simplification.
+
+Upstream-Status: Inappropriate
+
+RP 2017/01/30
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/genscripts.sh | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index 1f257e99ca..1583b73a2b 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -189,29 +189,6 @@ append_to_lib_path()
+ fi
+ }
+
+-# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib when native
+-# except when LIBPATH=":".
+-if [ "${LIB_PATH}" != ":" ] ; then
+- libs=
+- if [ "x${TOOL_LIB}" = "x" ] ; then
+- if [ "x${NATIVE}" = "xyes" ] ; then
+- libs="${exec_prefix}/${target_alias}/lib"
+- fi
+- else
+- # For multilib'ed targets, ensure both ${target_alias}/lib${LIBPATH_SUFFIX}
+- # and ${TOOL_LIB}/lib${LIBPATH_SUFFIX} are in the default search path,
+- # because 64bit libraries may be in both places, depending on
+- # cross-development setup method (e.g.: /usr/s390x-linux/lib64
+- # vs. /usr/s390-linux/lib64)
+- case "${NATIVE}:${LIBPATH_SUFFIX}:${TOOL_LIB}" in
+- :* | *::* | *:*:*${LIBPATH_SUFFIX}) ;;
+- *) libs="${exec_prefix}/${target_alias}/lib${LIBPATH_SUFFIX}" ;;
+- esac
+- libs="${exec_prefix}/${TOOL_LIB}/lib ${libs}"
+- fi
+- append_to_lib_path ${libs}
+-fi
+-
+ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
+ libs=${NATIVE_LIB_DIRS}
+ if [ "x${NATIVE}" = "xyes" ] ; then
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch b/poky/meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch
new file mode 100644
index 000000000..306afe701
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch
@@ -0,0 +1,47 @@
+From 5089be88f670bcadf7db0e778894f900b2c05d7b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:07:33 +0000
+Subject: [PATCH 03/15] configure: widen the regexp for SH architectures
+
+gprof needs to know about uclibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 2 +-
+ gprof/configure | 5 +++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 2d615a9996..c4ad45c06c 100755
+--- a/configure
++++ b/configure
+@@ -3835,7 +3835,7 @@ case "${target}" in
+ nvptx*-*-*)
+ noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+ ;;
+- sh-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
+diff --git a/gprof/configure b/gprof/configure
+index 1e25102976..6b43bf2b18 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -5874,6 +5874,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch b/poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
new file mode 100644
index 000000000..3e29c5815
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
@@ -0,0 +1,42 @@
+From a0e893ea094c48fa803046ffa89e31907aee0597 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:09:58 +0000
+Subject: [PATCH 04/15] Point scripts location to libdir
+
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/Makefile.am | 2 +-
+ ld/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ld/Makefile.am b/ld/Makefile.am
+index 6243c12528..3c5d6c8202 100644
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -57,7 +57,7 @@ endif
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff --git a/ld/Makefile.in b/ld/Makefile.in
+index 760c037f9d..6dea692869 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -446,7 +446,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
new file mode 100644
index 000000000..2f4996937
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
@@ -0,0 +1,41 @@
+From 518abb195d0eb47d8eef581d7fd0a5fd9fa73f7d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:27:17 +0000
+Subject: [PATCH 05/15] Only generate an RPATH entry if LD_RUN_PATH is not
+ empty
+
+for cases where -rpath isn't specified. debian (#151024)
+
+Upstream-Status: Pending
+
+Signed-off-by: Chris Chimelis <chris@debian.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/emultempl/elf32.em | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index c0925fc9b9..7d7670a89f 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1470,6 +1470,8 @@ fragment <<EOF
+ && command_line.rpath == NULL)
+ {
+ path = (const char *) getenv ("LD_RUN_PATH");
++ if ((path) && (strlen (path) == 0))
++ path = NULL;
+ if (path
+ && gld${EMULATION_NAME}_search_needed (path, &n, force))
+ break;
+@@ -1750,6 +1752,8 @@ gld${EMULATION_NAME}_before_allocation (void)
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+
+ for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch b/poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
new file mode 100644
index 000000000..333e2ee17
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
@@ -0,0 +1,21143 @@
+From fad053cc59baa6277182b0fc90415a214060ba99 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 17:04:07 +0000
+Subject: [PATCH 06/15] Use libtool 2.4
+
+get libtool sysroot support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/configure | 1318 +++++++++++++++++------
+ bfd/configure.ac | 2 +-
+ binutils/configure | 1316 +++++++++++++++++------
+ gas/configure | 1314 +++++++++++++++++------
+ gprof/configure | 1321 +++++++++++++++++------
+ ld/configure | 1691 +++++++++++++++++++++--------
+ libtool.m4 | 1080 +++++++++++++------
+ ltmain.sh | 2925 +++++++++++++++++++++++++++++++++-----------------
+ ltoptions.m4 | 2 +-
+ ltversion.m4 | 12 +-
+ lt~obsolete.m4 | 2 +-
+ opcodes/configure | 1318 +++++++++++++++++------
+ opcodes/configure.ac | 2 +-
+ zlib/configure | 1316 +++++++++++++++++------
+ 14 files changed, 9926 insertions(+), 3693 deletions(-)
+
+diff --git a/bfd/configure b/bfd/configure
+index 6c2b24ebe3..5fdd723b7f 100755
+--- a/bfd/configure
++++ b/bfd/configure
+@@ -672,6 +672,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -785,6 +788,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1461,6 +1465,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+ --with-mmap try using mmap for BFD input files if available
+ --with-separate-debug-dir=DIR
+ Look for global separate debug info in DIR
+@@ -5393,8 +5399,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5434,7 +5440,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6120,8 +6126,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -6170,6 +6176,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6186,6 +6266,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6354,7 +6439,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -6508,6 +6594,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6521,11 +6622,164 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
+
+
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6541,7 +6795,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6561,11 +6815,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6581,7 +6839,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6600,6 +6858,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6611,16 +6873,72 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
+
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
+
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
+
+
+
+@@ -6962,8 +7280,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6999,6 +7317,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -7040,6 +7359,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7051,7 +7382,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -7077,8 +7408,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7088,8 +7419,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -7126,6 +7457,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
+
+
+
+@@ -7142,6 +7483,45 @@ fi
+
+
+
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -7353,6 +7733,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -7916,6 +8413,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8080,7 +8579,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8169,7 +8669,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8467,8 +8967,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8634,6 +9132,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8696,7 +9200,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -8753,13 +9257,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8820,6 +9328,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9170,7 +9683,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9269,12 +9783,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -9288,8 +9802,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -9307,8 +9821,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9354,8 +9868,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9485,7 +9999,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9498,22 +10018,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9525,7 +10052,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9538,22 +10071,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9598,20 +10138,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9672,7 +10255,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9680,7 +10263,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9696,7 +10279,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -9720,10 +10303,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -9802,23 +10385,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9903,7 +10499,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -9922,9 +10518,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -10500,8 +11096,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10534,13 +11131,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10632,7 +11287,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -11472,10 +12127,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11578,10 +12233,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -14172,7 +14827,7 @@ SHARED_LDFLAGS=
+ if test "$enable_shared" = "yes"; then
+ x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ if test -n "$x"; then
+- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+ fi
+
+ # More hacks to build DLLs on Windows.
+@@ -16879,13 +17534,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -16900,14 +17562,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -16940,12 +17605,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -17000,8 +17665,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -17011,12 +17681,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -17032,7 +17704,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -17068,6 +17739,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -17847,7 +18519,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -17950,19 +18623,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -17992,6 +18688,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -18001,6 +18703,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -18115,12 +18820,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -18207,9 +18912,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -18225,6 +18927,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -18257,210 +18962,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+diff --git a/bfd/configure.ac b/bfd/configure.ac
+index 2342f3faea..a6451fccda 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -254,7 +254,7 @@ changequote(,)dnl
+ x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+ if test -n "$x"; then
+- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+ fi
+
+ # More hacks to build DLLs on Windows.
+diff --git a/binutils/configure b/binutils/configure
+index 5d9c9105a7..a65b2b4518 100755
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -659,8 +659,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -772,6 +775,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1444,6 +1448,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+ --with-system-zlib use installed libz
+ --with-gnu-ld assume the C compiler uses GNU ld default=no
+ --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
+@@ -5160,8 +5166,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5201,7 +5207,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5887,8 +5893,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -5937,6 +5943,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5953,6 +6033,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6121,7 +6206,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -6275,6 +6361,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6290,9 +6391,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6308,7 +6562,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6328,11 +6582,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6348,7 +6606,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6367,6 +6625,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6378,12 +6640,10 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+
+
+
+@@ -6395,6 +6655,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6729,8 +7047,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6766,6 +7084,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -6807,6 +7126,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6818,7 +7149,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -6844,8 +7175,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6855,8 +7186,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -6893,6 +7224,21 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6908,6 +7254,40 @@ fi
+
+
+
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -7120,6 +7500,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -7683,6 +8180,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7878,7 +8377,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7967,7 +8467,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8265,8 +8765,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8432,6 +8930,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8494,7 +8998,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -8551,13 +9055,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8618,6 +9126,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8968,7 +9481,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9067,12 +9581,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -9086,8 +9600,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -9105,8 +9619,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9152,8 +9666,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9283,7 +9797,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9296,22 +9816,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9323,7 +9850,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9336,22 +9869,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9396,20 +9936,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9470,7 +10053,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9478,7 +10061,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9494,7 +10077,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -9518,10 +10101,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -9600,23 +10183,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9701,7 +10297,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -9720,9 +10316,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -10298,8 +10894,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10332,13 +10929,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10430,7 +11085,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -11270,10 +11925,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11376,10 +12031,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15446,13 +16101,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15467,14 +16129,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15507,12 +16172,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15567,8 +16232,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15578,12 +16248,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15599,7 +16271,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15635,6 +16306,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16392,7 +17064,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -16495,19 +17168,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -16537,6 +17233,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -16546,6 +17248,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -16660,12 +17365,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -16752,9 +17457,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -16770,6 +17472,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -16802,210 +17507,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+diff --git a/gas/configure b/gas/configure
+index fbac8f44d5..a40ac2144f 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -650,8 +650,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -763,6 +766,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -4921,8 +4925,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4962,7 +4966,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5648,8 +5652,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -5698,6 +5702,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5714,6 +5792,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5882,7 +5965,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -6036,6 +6120,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6051,9 +6150,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6069,7 +6321,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6089,11 +6341,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6109,7 +6365,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6128,6 +6384,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6139,12 +6399,10 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+
+
+
+@@ -6156,6 +6414,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6490,8 +6806,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6527,6 +6843,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -6568,6 +6885,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6579,7 +6908,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -6605,8 +6934,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6616,8 +6945,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -6654,6 +6983,21 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
++
+
+
+
+@@ -6669,6 +7013,40 @@ fi
+
+
+
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -6881,6 +7259,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -7444,6 +7939,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7639,7 +8136,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7728,7 +8226,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8026,8 +8524,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8193,6 +8689,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8255,7 +8757,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -8312,13 +8814,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8379,6 +8885,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8729,7 +9240,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8828,12 +9340,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -8847,8 +9359,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -8866,8 +9378,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -8913,8 +9425,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9044,7 +9556,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9057,22 +9575,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9084,7 +9609,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9097,22 +9628,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9157,20 +9695,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9231,7 +9812,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9239,7 +9820,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9255,7 +9836,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -9279,10 +9860,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -9361,23 +9942,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9462,7 +10056,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -9481,9 +10075,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -10059,8 +10653,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10093,13 +10688,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10191,7 +10844,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -11031,10 +11684,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11137,10 +11790,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15437,13 +16090,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15458,14 +16118,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15498,12 +16161,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15558,8 +16221,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15569,12 +16237,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15590,7 +16260,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15626,6 +16295,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16390,7 +17060,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -16493,19 +17164,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -16535,6 +17229,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -16544,6 +17244,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -16658,12 +17361,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -16750,9 +17453,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -16768,6 +17468,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -16800,210 +17503,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+diff --git a/gprof/configure b/gprof/configure
+index 6b43bf2b18..245ee48bc3 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -631,8 +631,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -744,6 +747,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1402,6 +1406,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -4836,8 +4842,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -4877,7 +4883,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5563,8 +5569,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -5613,6 +5619,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5629,6 +5709,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5797,7 +5882,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -5874,11 +5960,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+-linux-uclibc*)
+- lt_cv_deplibs_check_method=pass_all
+- lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+- ;;
+-
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+@@ -5956,6 +6037,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -5971,9 +6067,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -5989,7 +6238,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6009,11 +6258,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6029,7 +6282,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6048,6 +6301,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6059,12 +6316,10 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+
+
+
+@@ -6076,6 +6331,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6410,8 +6723,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6447,6 +6760,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -6488,6 +6802,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6499,7 +6825,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -6525,8 +6851,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6536,8 +6862,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -6574,6 +6900,18 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
++
++
+
+
+
+@@ -6590,6 +6928,43 @@ fi
+
+
+
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -6801,6 +7176,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -7364,6 +7856,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7559,7 +8053,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7648,7 +8143,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -7946,8 +8441,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8113,6 +8606,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8175,7 +8674,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -8232,13 +8731,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8299,6 +8802,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8649,7 +9157,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8748,12 +9257,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -8767,8 +9276,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -8786,8 +9295,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -8833,8 +9342,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -8964,7 +9473,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -8977,22 +9492,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9004,7 +9526,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9017,22 +9545,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9077,20 +9612,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9151,7 +9729,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9159,7 +9737,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9175,7 +9753,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -9199,10 +9777,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -9281,23 +9859,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9382,7 +9973,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -9401,9 +9992,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -9979,8 +10570,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10013,13 +10605,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10111,7 +10761,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -10951,10 +11601,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11057,10 +11707,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -13005,13 +13655,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -13026,14 +13683,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -13066,12 +13726,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13126,8 +13786,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13137,12 +13802,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13158,7 +13825,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13194,6 +13860,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -13950,7 +14617,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -14053,19 +14721,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -14095,6 +14786,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -14104,6 +14801,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -14218,12 +14918,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -14310,9 +15010,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -14328,6 +15025,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -14360,210 +15060,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+diff --git a/ld/configure b/ld/configure
+index 0cc6e8a50f..db8b998722 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -655,8 +655,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -778,6 +781,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1464,6 +1468,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+ --with-lib-path=dir1:dir2... set default LIB_PATH
+ --with-sysroot=DIR Search for usr/lib et al within DIR.
+
+@@ -5658,8 +5664,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5699,7 +5705,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6385,8 +6391,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -6435,6 +6441,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6451,6 +6531,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6619,7 +6704,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -6773,6 +6859,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6788,9 +6889,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6806,7 +7060,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6826,11 +7080,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6846,7 +7104,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6865,6 +7123,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6876,12 +7138,12 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
+
+
+
+@@ -6891,6 +7153,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
++
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
+
+
+ if test -n "$ac_tool_prefix"; then
+@@ -7227,8 +7545,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -7264,6 +7582,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -7305,6 +7624,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7316,7 +7647,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -7342,8 +7673,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7353,8 +7684,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -7391,6 +7722,19 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
+
+
+
+@@ -7404,6 +7748,42 @@ fi
+
+
+
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -7618,6 +7998,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -8181,6 +8678,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8249,6 +8748,16 @@ done
+
+
+
++func_stripname_cnf ()
++{
++ case ${2} in
++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++ esac
++} # func_stripname_cnf
++
++
++
+
+
+ # Set options
+@@ -8377,7 +8886,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -8466,7 +8976,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8764,8 +9274,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8931,6 +9439,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8993,7 +9507,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -9050,13 +9564,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -9117,6 +9635,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9467,7 +9990,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9566,12 +10090,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -9585,8 +10109,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -9604,8 +10128,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9651,8 +10175,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9782,7 +10306,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9795,22 +10325,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9822,7 +10359,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9835,22 +10378,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9894,21 +10444,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+- # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ # no search path for DLLs.
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9969,7 +10562,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9977,7 +10570,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9993,7 +10586,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -10017,10 +10610,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -10099,23 +10692,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -10200,7 +10806,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -10219,9 +10825,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -10797,8 +11403,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10831,13 +11438,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10929,7 +11594,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -11769,10 +12434,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11875,10 +12540,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12270,6 +12935,7 @@ $RM -r conftest*
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
++ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+@@ -12287,6 +12953,7 @@ $RM -r conftest*
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
++ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ for cc_temp in $compiler""; do
+@@ -12569,7 +13236,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -12582,22 +13255,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath__CXX"; then
++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath__CXX"; then
++ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+@@ -12610,7 +13290,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -12623,22 +13309,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath__CXX"; then
++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath__CXX"; then
++ lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -12681,29 +13374,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+- # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+- # as there is no search path for DLLs.
+- hardcode_libdir_flag_spec_CXX='-L$libdir'
+- export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+- allow_undefined_flag_CXX=unsupported
+- always_export_symbols_CXX=no
+- enable_shared_with_static_runtimes_CXX=yes
+-
+- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+- # If the export-symbols file already is a .def file (1st line
+- # is EXPORTS), use it as is; otherwise, prepend...
+- archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+- cp $export_symbols $output_objdir/$soname.def;
+- else
+- echo EXPORTS > $output_objdir/$soname.def;
+- cat $export_symbols >> $output_objdir/$soname.def;
+- fi~
+- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+- else
+- ld_shlibs_CXX=no
+- fi
+- ;;
++ case $GXX,$cc_basename in
++ ,cl* | no,cl*)
++ # Native MSVC
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ hardcode_libdir_flag_spec_CXX=' '
++ allow_undefined_flag_CXX=unsupported
++ always_export_symbols_CXX=yes
++ file_list_spec_CXX='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
++ enable_shared_with_static_runtimes_CXX=yes
++ # Don't use ranlib
++ old_postinstall_cmds_CXX='chmod 644 $oldlib'
++ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ func_to_tool_file "$lt_outputfile"~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # g++
++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
++ # as there is no search path for DLLs.
++ hardcode_libdir_flag_spec_CXX='-L$libdir'
++ export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
++ allow_undefined_flag_CXX=unsupported
++ always_export_symbols_CXX=no
++ enable_shared_with_static_runtimes_CXX=yes
++
++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is; otherwise, prepend...
++ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ cp $export_symbols $output_objdir/$soname.def;
++ else
++ echo EXPORTS > $output_objdir/$soname.def;
++ cat $export_symbols >> $output_objdir/$soname.def;
++ fi~
++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++ else
++ ld_shlibs_CXX=no
++ fi
++ ;;
++ esac
++ ;;
+ darwin* | rhapsody*)
+
+
+@@ -12809,7 +13548,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ ;;
+ *)
+ if test "$GXX" = yes; then
+- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+@@ -12880,10 +13619,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+@@ -12924,9 +13663,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+@@ -12996,20 +13735,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -13204,7 +13943,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+@@ -13250,7 +13989,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+@@ -13291,9 +14030,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+@@ -13428,6 +14167,13 @@ private:
+ };
+ _LT_EOF
+
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+@@ -13441,7 +14187,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+- case $p in
++ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+@@ -13450,13 +14196,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ test $p = "-R"; then
+ prev=$p
+ continue
+- else
+- prev=
+ fi
+
++ # Expand the sysroot to ease extracting the directories later.
++ if test -z "$prev"; then
++ case $p in
++ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++ esac
++ fi
++ case $p in
++ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++ esac
+ if test "$pre_test_object_deps_done" = no; then
+- case $p in
+- -L* | -R*)
++ case ${prev} in
++ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+@@ -13476,8 +14231,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
++ prev=
+ ;;
+
++ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+@@ -13513,6 +14270,7 @@ else
+ fi
+
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+
+ # PORTME: override above test on systems where it is broken
+ case $host_os in
+@@ -13548,7 +14306,7 @@ linux*)
+
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -13613,8 +14371,6 @@ fi
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+@@ -13719,6 +14475,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ ;;
+ esac
+ ;;
++ mingw* | cygwin* | os2* | pw32* | cegcc*)
++ # This hack is so that the source file can tell whether it is being
++ # built for inclusion in a dll (and should export symbols for example).
++ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
++ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+@@ -13871,7 +14632,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ ;;
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+@@ -13936,10 +14697,17 @@ case $host_os in
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
+-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
++lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -13997,6 +14765,8 @@ fi
+
+
+
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -14174,6 +14944,7 @@ fi
+ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+@@ -14188,15 +14959,20 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+- ;;
++ ;;
+ cygwin* | mingw* | cegcc*)
+- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+- ;;
++ case $cc_basename in
++ cl*) ;;
++ *)
++ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
++ ;;
++ esac
++ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+- ;;
++ ;;
+ esac
+- exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+ $as_echo "$ld_shlibs_CXX" >&6; }
+@@ -14459,8 +15235,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -14492,13 +15269,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -14589,7 +15424,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -15048,6 +15883,7 @@ fi
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
++ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+@@ -18083,13 +18919,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -18104,14 +18947,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -18144,12 +18990,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -18188,8 +19034,8 @@ old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote
+ compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+ GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+ archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -18216,12 +19062,12 @@ hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_
+ hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
++postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+ hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+ compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -18259,8 +19105,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -18270,12 +19121,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -18291,7 +19144,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -18313,8 +19165,8 @@ LD_CXX \
+ reload_flag_CXX \
+ compiler_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+-lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
++lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ export_dynamic_flag_spec_CXX \
+@@ -18326,7 +19178,6 @@ no_undefined_flag_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+-fix_srcfile_path_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX \
+ file_list_spec_CXX \
+@@ -18360,6 +19211,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -18374,7 +19226,8 @@ archive_expsym_cmds_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ export_symbols_cmds_CXX \
+-prelink_cmds_CXX; do
++prelink_cmds_CXX \
++postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+@@ -19167,7 +20020,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -19270,19 +20124,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -19312,6 +20189,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -19321,6 +20204,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -19435,12 +20321,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -19527,9 +20413,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -19545,6 +20428,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -19591,210 +20477,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+@@ -19822,12 +20667,12 @@ with_gcc=$GCC_CXX
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl_CXX
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic_CXX
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl_CXX
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+@@ -19914,9 +20759,6 @@ inherit_rpath=$inherit_rpath_CXX
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs_CXX
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path_CXX
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols_CXX
+
+@@ -19932,6 +20774,9 @@ include_expsyms=$lt_include_expsyms_CXX
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds_CXX
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds_CXX
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec_CXX
+
+diff --git a/libtool.m4 b/libtool.m4
+index 24d13f3440..e45fdc6998 100644
+--- a/libtool.m4
++++ b/libtool.m4
+@@ -1,7 +1,8 @@
+ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is free software; the Free Software Foundation gives
+@@ -10,7 +11,8 @@
+
+ m4_define([_LT_COPYING], [dnl
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ])
+
+-# serial 56 LT_INIT
++# serial 57 LT_INIT
+
+
+ # LT_PREREQ(VERSION)
+@@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+
+ _LT_SETUP
+@@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+ dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_CHECK_SHELL_FEATURES])dnl
++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+ m4_require([_LT_CMD_RELOAD])dnl
+ m4_require([_LT_CHECK_MAGIC_METHOD])dnl
++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+ m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+ m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
++m4_require([_LT_WITH_SYSROOT])dnl
+
+ _LT_CONFIG_LIBTOOL_INIT([
+ # See if we are running on zsh, and set the options which allow our
+@@ -199,7 +205,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+ configured by $[0], generated by m4_PACKAGE_STRING.
+
+-Copyright (C) 2009 Free Software Foundation, Inc.
++Copyright (C) 2010 Free Software Foundation, Inc.
+ This config.lt script is free software; the Free Software Foundation
+ gives unlimited permision to copy, distribute and modify it."
+
+@@ -746,15 +752,12 @@ _LT_EOF
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
+
+- _LT_PROG_XSI_SHELLFNS
++ _LT_PROG_REPLACE_SHELLFNS
+
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+ ],
+@@ -980,6 +983,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
++ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
++ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
+ fi
+ ])
+
+-# _LT_SYS_MODULE_PATH_AIX
+-# -----------------------
++# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
++# ----------------------------------
+ # Links a minimal program and checks the executable
+ # for the system default hardcoded library path. In most cases,
+ # this is /usr/lib:/lib, but when the MPI compilers are used
+ # the location of the communication and MPI libs are included too.
+ # If we don't find anything, use the default library path according
+ # to the aix ld manual.
++# Store the results from the different compilers for each TAGNAME.
++# Allow to override them for all tags through lt_cv_aix_libpath.
+ m4_defun([_LT_SYS_MODULE_PATH_AIX],
+ [m4_require([_LT_DECL_SED])dnl
+-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi],[])
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
++ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
++ lt_aix_libpath_sed='[
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }]'
++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi],[])
++ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
++ fi
++ ])
++ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
++fi
+ ])# _LT_SYS_MODULE_PATH_AIX
+
+
+@@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+ AC_MSG_CHECKING([how to print strings])
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ ])# _LT_PROG_ECHO_BACKSLASH
+
+
++# _LT_WITH_SYSROOT
++# ----------------
++AC_DEFUN([_LT_WITH_SYSROOT],
++[AC_MSG_CHECKING([for sysroot])
++AC_ARG_WITH([libtool-sysroot],
++[ --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).],
++[], [with_libtool_sysroot=no])
++
++dnl lt_sysroot will always be passed unquoted. We quote it here
++dnl in case the user passed a directory name.
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ AC_MSG_RESULT([${with_libtool_sysroot}])
++ AC_MSG_ERROR([The sysroot must be an absolute path.])
++ ;;
++esac
++
++ AC_MSG_RESULT([${lt_sysroot:-no}])
++_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
++[dependent libraries, and in which our libraries should be installed.])])
++
+ # _LT_ENABLE_LOCK
+ # ---------------
+ m4_defun([_LT_ENABLE_LOCK],
+@@ -1320,14 +1369,47 @@ need_locks="$enable_libtool_lock"
+ ])# _LT_ENABLE_LOCK
+
+
++# _LT_PROG_AR
++# -----------
++m4_defun([_LT_PROG_AR],
++[AC_CHECK_TOOLS(AR, [ar], false)
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++_LT_DECL([], [AR], [1], [The archiver])
++_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
++
++AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
++ [lt_cv_ar_at_file=no
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
++ [echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
++ AC_TRY_EVAL([lt_ar_try])
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ AC_TRY_EVAL([lt_ar_try])
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
++ ])
++ ])
++
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
++_LT_DECL([], [archiver_list_spec], [1],
++ [How to feed a file listing to the archiver])
++])# _LT_PROG_AR
++
++
+ # _LT_CMD_OLD_ARCHIVE
+ # -------------------
+ m4_defun([_LT_CMD_OLD_ARCHIVE],
+-[AC_CHECK_TOOL(AR, ar, false)
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
+-_LT_DECL([], [AR], [1], [The archiver])
+-_LT_DECL([], [AR_FLAGS], [1])
++[_LT_PROG_AR
+
+ AC_CHECK_TOOL(STRIP, strip, :)
+ test -z "$STRIP" && STRIP=:
+@@ -1623,7 +1705,7 @@ else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+-[#line __oline__ "configure"
++[#line $LINENO "configure"
+ #include "confdefs.h"
+
+ #if HAVE_DLFCN_H
+@@ -1667,10 +1749,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -2210,8 +2292,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -2244,13 +2327,71 @@ m4_if([$1], [],[
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -2342,7 +2483,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -2950,6 +3091,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -3016,7 +3162,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -3167,6 +3314,21 @@ tpf*)
+ ;;
+ esac
+ ])
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -3174,7 +3336,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ _LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+ _LT_DECL([], [file_magic_cmd], [1],
+- [Command to use when deplibs_check_method == "file_magic"])
++ [Command to use when deplibs_check_method = "file_magic"])
++_LT_DECL([], [file_magic_glob], [1],
++ [How to find potential files when deplibs_check_method = "file_magic"])
++_LT_DECL([], [want_nocaseglob], [1],
++ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+ ])# _LT_CHECK_MAGIC_METHOD
+
+
+@@ -3277,6 +3443,67 @@ dnl aclocal-1.4 backwards compatibility:
+ dnl AC_DEFUN([AM_PROG_NM], [])
+ dnl AC_DEFUN([AC_PROG_NM], [])
+
++# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++# --------------------------------
++# how to determine the name of the shared library
++# associated with a specific link library.
++# -- PORTME fill in with the dynamic library characteristics
++m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
++[m4_require([_LT_DECL_EGREP])
++m4_require([_LT_DECL_OBJDUMP])
++m4_require([_LT_DECL_DLLTOOL])
++AC_CACHE_CHECK([how to associate runtime and link libraries],
++lt_cv_sharedlib_from_linklib_cmd,
++[lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++])
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
++ [Command to associate shared and link libraries])
++])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++
++
++# _LT_PATH_MANIFEST_TOOL
++# ----------------------
++# locate the manifest tool
++m4_defun([_LT_PATH_MANIFEST_TOOL],
++[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
++ [lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&AS_MESSAGE_LOG_FD
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*])
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
++])# _LT_PATH_MANIFEST_TOOL
++
+
+ # LT_LIB_M
+ # --------
+@@ -3403,8 +3630,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -3440,6 +3667,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -3473,6 +3701,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT@&t@_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT@&t@_DLSYM_CONST
++#else
++# define LT@&t@_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -3484,7 +3724,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -3510,15 +3750,15 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+@@ -3551,6 +3791,13 @@ else
+ AC_MSG_RESULT(ok)
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
+ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+ _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+@@ -3561,6 +3808,8 @@ _LT_DECL([global_symbol_to_c_name_address],
+ _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
++_LT_DECL([], [nm_file_list_spec], [1],
++ [Specify filename containing input files for $NM])
+ ]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+@@ -3572,7 +3821,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+-AC_MSG_CHECKING([for $compiler option to produce PIC])
+ m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+@@ -3678,6 +3926,12 @@ m4_if([$1], [CXX], [
+ ;;
+ esac
+ ;;
++ mingw* | cygwin* | os2* | pw32* | cegcc*)
++ # This hack is so that the source file can tell whether it is being
++ # built for inclusion in a dll (and should export symbols for example).
++ m4_if([$1], [GCJ], [],
++ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
++ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+@@ -3830,7 +4084,7 @@ m4_if([$1], [CXX], [
+ ;;
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+@@ -4053,6 +4307,12 @@ m4_if([$1], [CXX], [
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -4115,7 +4375,7 @@ m4_if([$1], [CXX], [
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+@@ -4172,9 +4432,11 @@ case $host_os in
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+ esac
+-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+- [How to pass a linker flag through the compiler])
++
++AC_CACHE_CHECK([for $compiler option to produce PIC],
++ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
++ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
++_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -4193,6 +4455,8 @@ fi
+ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
++ [How to pass a linker flag through the compiler])
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -4213,6 +4477,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ m4_defun([_LT_LINKER_SHLIBS],
+ [AC_REQUIRE([LT_PATH_LD])dnl
+ AC_REQUIRE([LT_PATH_NM])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
+ m4_require([_LT_DECL_SED])dnl
+@@ -4221,6 +4486,7 @@ m4_require([_LT_TAG_COMPILER])dnl
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+@@ -4235,15 +4501,20 @@ m4_if([$1], [CXX], [
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+- ;;
++ ;;
+ cygwin* | mingw* | cegcc*)
+- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+- ;;
++ case $cc_basename in
++ cl*) ;;
++ *)
++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
++ ;;
++ esac
++ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+- ;;
++ ;;
+ esac
+- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ ], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -4411,7 +4682,8 @@ _LT_EOF
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -4510,12 +4782,12 @@ _LT_EOF
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -4529,8 +4801,8 @@ _LT_EOF
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -4548,8 +4820,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+@@ -4595,8 +4867,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+@@ -4726,7 +4998,7 @@ _LT_EOF
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- _LT_SYS_MODULE_PATH_AIX
++ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+@@ -4737,7 +5009,7 @@ _LT_EOF
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- _LT_SYS_MODULE_PATH_AIX
++ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+@@ -4781,20 +5053,63 @@ _LT_EOF
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+- # FIXME: Should let the user specify the lib program.
+- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_TAGVAR(always_export_symbols, $1)=yes
++ _LT_TAGVAR(file_list_spec, $1)='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++ # FIXME: Should let the user specify the lib program.
++ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -4828,7 +5143,7 @@ _LT_EOF
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+@@ -4836,7 +5151,7 @@ _LT_EOF
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -4852,7 +5167,7 @@ _LT_EOF
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -4876,10 +5191,10 @@ _LT_EOF
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -4926,16 +5241,31 @@ _LT_EOF
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- AC_LINK_IFELSE(int foo(void) {},
+- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+- )
+- LDFLAGS="$save_LDFLAGS"
++ # This should be the same for all languages, so no per-tag cache variable.
++ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
++ [lt_cv_irix_exported_symbol],
++ [save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ AC_LINK_IFELSE(
++ [AC_LANG_SOURCE(
++ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
++ [C++], [[int foo (void) { return 0; }]],
++ [Fortran 77], [[
++ subroutine foo
++ end]],
++ [Fortran], [[
++ subroutine foo
++ end]])])],
++ [lt_cv_irix_exported_symbol=yes],
++ [lt_cv_irix_exported_symbol=no])
++ LDFLAGS="$save_LDFLAGS"])
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -5020,7 +5350,7 @@ _LT_EOF
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+@@ -5039,9 +5369,9 @@ _LT_EOF
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -5313,8 +5643,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
+ to runtime path list])
+ _LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+-_LT_TAGDECL([], [fix_srcfile_path], [1],
+- [Fix the shell variable $srcfile for the compiler])
+ _LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+ _LT_TAGDECL([], [export_symbols_cmds], [2],
+@@ -5325,6 +5653,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+ _LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
++_LT_TAGDECL([], [postlink_cmds], [2],
++ [Commands necessary for finishing linking programs])
+ _LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+ dnl FIXME: Not yet implemented
+@@ -5426,6 +5756,7 @@ CC="$lt_save_CC"
+ m4_defun([_LT_LANG_CXX_CONFIG],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+@@ -5487,6 +5818,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
++ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+@@ -5504,6 +5836,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
++ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -5667,7 +6000,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+- _LT_SYS_MODULE_PATH_AIX
++ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -5679,7 +6012,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- _LT_SYS_MODULE_PATH_AIX
++ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+@@ -5721,29 +6054,75 @@ if test "$_lt_caught_CXX_error" != yes; then
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+- # as there is no search path for DLLs.
+- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+- _LT_TAGVAR(always_export_symbols, $1)=no
+- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-
+- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+- # If the export-symbols file already is a .def file (1st line
+- # is EXPORTS), use it as is; otherwise, prepend...
+- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+- cp $export_symbols $output_objdir/$soname.def;
+- else
+- echo EXPORTS > $output_objdir/$soname.def;
+- cat $export_symbols >> $output_objdir/$soname.def;
+- fi~
+- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+- else
+- _LT_TAGVAR(ld_shlibs, $1)=no
+- fi
+- ;;
++ case $GXX,$cc_basename in
++ ,cl* | no,cl*)
++ # Native MSVC
++ # hardcode_libdir_flag_spec is actually meaningless, as there is
++ # no search path for DLLs.
++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_TAGVAR(always_export_symbols, $1)=yes
++ _LT_TAGVAR(file_list_spec, $1)='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++ # Don't use ranlib
++ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ func_to_tool_file "$lt_outputfile"~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # g++
++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++ # as there is no search path for DLLs.
++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
++ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++ _LT_TAGVAR(always_export_symbols, $1)=no
++ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++
++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++ # If the export-symbols file already is a .def file (1st line
++ # is EXPORTS), use it as is; otherwise, prepend...
++ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ cp $export_symbols $output_objdir/$soname.def;
++ else
++ echo EXPORTS > $output_objdir/$soname.def;
++ cat $export_symbols >> $output_objdir/$soname.def;
++ fi~
++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++ else
++ _LT_TAGVAR(ld_shlibs, $1)=no
++ fi
++ ;;
++ esac
++ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+@@ -5818,7 +6197,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ ;;
+ *)
+ if test "$GXX" = yes; then
+- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+@@ -5889,10 +6268,10 @@ if test "$_lt_caught_CXX_error" != yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+@@ -5933,9 +6312,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+@@ -6005,20 +6384,20 @@ if test "$_lt_caught_CXX_error" != yes; then
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -6213,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+@@ -6259,7 +6638,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+@@ -6300,9 +6679,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+@@ -6431,6 +6810,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
++ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+@@ -6445,6 +6825,29 @@ AC_LANG_POP
+ ])# _LT_LANG_CXX_CONFIG
+
+
++# _LT_FUNC_STRIPNAME_CNF
++# ----------------------
++# func_stripname_cnf prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++#
++# This function is identical to the (non-XSI) version of func_stripname,
++# except this one can be used by m4 code that may be executed by configure,
++# rather than the libtool script.
++m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
++AC_REQUIRE([_LT_DECL_SED])
++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
++func_stripname_cnf ()
++{
++ case ${2} in
++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++ esac
++} # func_stripname_cnf
++])# _LT_FUNC_STRIPNAME_CNF
++
+ # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+ # ---------------------------------
+ # Figure out "hidden" library dependencies from verbose
+@@ -6453,6 +6856,7 @@ AC_LANG_POP
+ # objects, libraries and library flags.
+ m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
++AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+ # Dependencies to place before and after the object being linked:
+ _LT_TAGVAR(predep_objects, $1)=
+ _LT_TAGVAR(postdep_objects, $1)=
+@@ -6503,6 +6907,13 @@ public class foo {
+ };
+ _LT_EOF
+ ])
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ dnl Parse the compiler output and extract the necessary
+ dnl objects, libraries and library flags.
+ if AC_TRY_EVAL(ac_compile); then
+@@ -6514,7 +6925,7 @@ if AC_TRY_EVAL(ac_compile); then
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+- case $p in
++ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+@@ -6523,13 +6934,22 @@ if AC_TRY_EVAL(ac_compile); then
+ test $p = "-R"; then
+ prev=$p
+ continue
+- else
+- prev=
+ fi
+
++ # Expand the sysroot to ease extracting the directories later.
++ if test -z "$prev"; then
++ case $p in
++ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++ esac
++ fi
++ case $p in
++ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++ esac
+ if test "$pre_test_object_deps_done" = no; then
+- case $p in
+- -L* | -R*)
++ case ${prev} in
++ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+@@ -6549,8 +6969,10 @@ if AC_TRY_EVAL(ac_compile); then
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
++ prev=
+ ;;
+
++ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+@@ -6586,6 +7008,7 @@ else
+ fi
+
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+
+ # PORTME: override above test on systems where it is broken
+ m4_if([$1], [CXX],
+@@ -6622,7 +7045,7 @@ linux*)
+
+ solaris*)
+ case $cc_basename in
+- CC*)
++ CC* | sunCC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -6735,7 +7158,9 @@ if test "$_lt_disable_F77" != yes; then
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
++ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
++ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -6789,6 +7214,7 @@ if test "$_lt_disable_F77" != yes; then
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
++ CFLAGS="$lt_save_CFLAGS"
+ fi # test "$_lt_disable_F77" != yes
+
+ AC_LANG_POP
+@@ -6865,7 +7291,9 @@ if test "$_lt_disable_FC" != yes; then
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
++ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
++ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+@@ -6921,7 +7349,8 @@ if test "$_lt_disable_FC" != yes; then
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+- CC="$lt_save_CC"
++ CC=$lt_save_CC
++ CFLAGS=$lt_save_CFLAGS
+ fi # test "$_lt_disable_FC" != yes
+
+ AC_LANG_POP
+@@ -6958,10 +7387,12 @@ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+-lt_save_CC="$CC"
++lt_save_CC=$CC
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=yes
+ CC=${GCJ-"gcj"}
++CFLAGS=$GCJFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_TAGVAR(LD, $1)="$LD"
+@@ -6992,7 +7423,8 @@ fi
+ AC_LANG_RESTORE
+
+ GCC=$lt_save_GCC
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_GCJ_CONFIG
+
+
+@@ -7027,9 +7459,11 @@ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=
+ CC=${RC-"windres"}
++CFLAGS=
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -7042,7 +7476,8 @@ fi
+
+ GCC=$lt_save_GCC
+ AC_LANG_RESTORE
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_RC_CONFIG
+
+
+@@ -7101,6 +7536,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+ AC_SUBST([OBJDUMP])
+ ])
+
++# _LT_DECL_DLLTOOL
++# ----------------
++# Ensure DLLTOOL variable is set.
++m4_defun([_LT_DECL_DLLTOOL],
++[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
++AC_SUBST([DLLTOOL])
++])
+
+ # _LT_DECL_SED
+ # ------------
+@@ -7194,8 +7638,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -7234,206 +7678,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+ ])# _LT_CHECK_SHELL_FEATURES
+
+
+-# _LT_PROG_XSI_SHELLFNS
+-# ---------------------
+-# Bourne and XSI compatible variants of some useful shell functions.
+-m4_defun([_LT_PROG_XSI_SHELLFNS],
+-[case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $[*] ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
++# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
++# ------------------------------------------------------
++# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
++# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
++m4_defun([_LT_PROG_FUNCTION_REPLACE],
++[dnl {
++sed -e '/^$1 ()$/,/^} # $1 /c\
++$1 ()\
++{\
++m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
++} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++])
+
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
++# _LT_PROG_REPLACE_SHELLFNS
++# -------------------------
++# Replace existing portable implementations of several shell functions with
++# equivalent extended shell implementations where those features are available..
++m4_defun([_LT_PROG_REPLACE_SHELLFNS],
++[if test x"$xsi_shell" = xyes; then
++ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
++ case ${1} in
++ */*) func_dirname_result="${1%/*}${2}" ;;
++ * ) func_dirname_result="${3}" ;;
++ esac])
++
++ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
++ func_basename_result="${1##*/}"])
++
++ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
++ case ${1} in
++ */*) func_dirname_result="${1%/*}${2}" ;;
++ * ) func_dirname_result="${3}" ;;
++ esac
++ func_basename_result="${1##*/}"])
+
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
++ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
++ # positional parameters, so assign one to ordinary parameter first.
++ func_stripname_result=${3}
++ func_stripname_result=${func_stripname_result#"${1}"}
++ func_stripname_result=${func_stripname_result%"${2}"}])
+
+-dnl func_dirname_and_basename
+-dnl A portable version of this function is already defined in general.m4sh
+-dnl so there is no need for it here.
++ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
++ func_split_long_opt_name=${1%%=*}
++ func_split_long_opt_arg=${1#*=}])
+
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
++ func_split_short_opt_arg=${1#??}
++ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[[^=]]*=//'
++ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
++ case ${1} in
++ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
++ *) func_lo2o_result=${1} ;;
++ esac])
+
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
++fi
+
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$[@]"`
+-}
++if test x"$lt_shell_append" = xyes; then
++ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
++ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
++ func_quote_for_eval "${2}"
++dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
++ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+-_LT_EOF
+-esac
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
+
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
++if test x"$_lt_function_replace_fail" = x":"; then
++ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
++fi
++])
+
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$[1]+=\$[2]"
+-}
+-_LT_EOF
++# _LT_PATH_CONVERSION_FUNCTIONS
++# -----------------------------
++# Determine which file name conversion functions should be used by
++# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
++# for certain cross-compile configurations and native mingw.
++m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_MSG_CHECKING([how to convert $build file names to $host format])
++AC_CACHE_VAL(lt_cv_to_host_file_cmd,
++[case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
+ ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$[1]=\$$[1]\$[2]"
+-}
+-
+-_LT_EOF
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
+ ;;
+- esac
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++])
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
++_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
++ [0], [convert $build file names to $host format])dnl
++
++AC_MSG_CHECKING([how to convert $build file names to toolchain format])
++AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
++[#assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
+ ])
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
++_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
++ [0], [convert $build files to toolchain format])dnl
++])# _LT_PATH_CONVERSION_FUNCTIONS
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec85d7..70e856e065 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -1,10 +1,9 @@
+-# Generated from ltmain.m4sh.
+
+-# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
++# libtool (GNU libtool) 2.4
+ # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+-# 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ # This is free software; see the source for copying conditions. There is NO
+ # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+@@ -38,7 +37,6 @@
+ # -n, --dry-run display commands without modifying any files
+ # --features display basic configuration information and exit
+ # --mode=MODE use operation mode MODE
+-# --no-finish let install mode avoid finish commands
+ # --preserve-dup-deps don't remove duplicate dependency libraries
+ # --quiet, --silent don't print informational messages
+ # --no-quiet, --no-silent
+@@ -71,17 +69,19 @@
+ # compiler: $LTCC
+ # compiler flags: $LTCFLAGS
+ # linker: $LD (gnu? $with_gnu_ld)
+-# $progname: (GNU libtool 1.3134 2009-11-29) 2.2.7a
++# $progname: (GNU libtool) 2.4
+ # automake: $automake_version
+ # autoconf: $autoconf_version
+ #
+ # Report bugs to <bug-libtool@gnu.org>.
++# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
++# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+ PROGRAM=libtool
+ PACKAGE=libtool
+-VERSION=2.2.7a
+-TIMESTAMP=" 1.3134 2009-11-29"
+-package_revision=1.3134
++VERSION=2.4
++TIMESTAMP=""
++package_revision=1.3293
+
+ # Be Bourne compatible
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -106,9 +106,6 @@ _LTECHO_EOF'
+ }
+
+ # NLS nuisances: We save the old values to restore during execute mode.
+-# Only set LANG and LC_ALL to C if already set.
+-# These must not be set unconditionally because not all systems understand
+-# e.g. LANG=C (notably SCO).
+ lt_user_locale=
+ lt_safe_locale=
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+@@ -121,15 +118,13 @@ do
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+ done
++LC_ALL=C
++LANGUAGE=C
++export LANGUAGE LC_ALL
+
+ $lt_unset CDPATH
+
+
+-
+-
+-
+-
+-
+ # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+ # is ksh but when the shell is invoked as "sh" and the current value of
+ # the _XPG environment variable is not equal to 1 (one), the special
+@@ -140,7 +135,7 @@ progpath="$0"
+
+
+ : ${CP="cp -f"}
+-: ${ECHO=$as_echo}
++test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+ : ${EGREP="/bin/grep -E"}
+ : ${FGREP="/bin/grep -F"}
+ : ${GREP="/bin/grep"}
+@@ -149,7 +144,7 @@ progpath="$0"
+ : ${MKDIR="mkdir"}
+ : ${MV="mv -f"}
+ : ${RM="rm -f"}
+-: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
++: ${SED="/bin/sed"}
+ : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+ : ${Xsed="$SED -e 1s/^X//"}
+
+@@ -169,6 +164,27 @@ IFS=" $lt_nl"
+ dirname="s,/[^/]*$,,"
+ basename="s,^.*/,,"
+
++# func_dirname file append nondir_replacement
++# Compute the dirname of FILE. If nonempty, add APPEND to the result,
++# otherwise set result to NONDIR_REPLACEMENT.
++func_dirname ()
++{
++ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
++ if test "X$func_dirname_result" = "X${1}"; then
++ func_dirname_result="${3}"
++ else
++ func_dirname_result="$func_dirname_result${2}"
++ fi
++} # func_dirname may be replaced by extended shell implementation
++
++
++# func_basename file
++func_basename ()
++{
++ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
++} # func_basename may be replaced by extended shell implementation
++
++
+ # func_dirname_and_basename file append nondir_replacement
+ # perform func_basename and func_dirname in a single function
+ # call:
+@@ -183,17 +199,31 @@ basename="s,^.*/,,"
+ # those functions but instead duplicate the functionality here.
+ func_dirname_and_basename ()
+ {
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+-}
++ # Extract subdirectory from the argument.
++ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
++ if test "X$func_dirname_result" = "X${1}"; then
++ func_dirname_result="${3}"
++ else
++ func_dirname_result="$func_dirname_result${2}"
++ fi
++ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
++} # func_dirname_and_basename may be replaced by extended shell implementation
++
++
++# func_stripname prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++# func_strip_suffix prefix name
++func_stripname ()
++{
++ case ${2} in
++ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++ esac
++} # func_stripname may be replaced by extended shell implementation
+
+-# Generated shell functions inserted here.
+
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ pathcar='s,^/\([^/]*\).*$,\1,'
+@@ -376,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+ # Same as above, but do not quote variable references.
+ double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
++# Sed substitution that turns a string into a regex matching for the
++# string literally.
++sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
++
++# Sed substitution that converts a w32 file name or path
++# which contains forward slashes, into one that contains
++# (escaped) backslashes. A very naive implementation.
++lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
++
+ # Re-`\' parameter expansions in output of double_quote_subst that were
+ # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+ # in input to double_quote_subst, that '$' was protected from expansion.
+@@ -404,7 +443,7 @@ opt_warning=:
+ # name if it has been set yet.
+ func_echo ()
+ {
+- $ECHO "$progname${mode+: }$mode: $*"
++ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ }
+
+ # func_verbose arg...
+@@ -430,14 +469,14 @@ func_echo_all ()
+ # Echo program name prefixed message to standard error.
+ func_error ()
+ {
+- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
++ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ }
+
+ # func_warning arg...
+ # Echo program name prefixed warning message to standard error.
+ func_warning ()
+ {
+- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
++ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+@@ -656,19 +695,35 @@ func_show_eval_locale ()
+ fi
+ }
+
+-
+-
++# func_tr_sh
++# Turn $1 into a string suitable for a shell variable name.
++# Result is stored in $func_tr_sh_result. All characters
++# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
++# if $1 begins with a digit, a '_' is prepended as well.
++func_tr_sh ()
++{
++ case $1 in
++ [0-9]* | *[!a-zA-Z0-9_]*)
++ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
++ ;;
++ * )
++ func_tr_sh_result=$1
++ ;;
++ esac
++}
+
+
+ # func_version
+ # Echo version message to standard output and exit.
+ func_version ()
+ {
++ $opt_debug
++
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+- s/\n# //
++ s/\n# / /
+ b more
+ }
+ :go
+@@ -685,7 +740,9 @@ func_version ()
+ # Echo short help message to standard output and exit.
+ func_usage ()
+ {
+- $SED -n '/^# Usage:/,/^# *-h/ {
++ $opt_debug
++
++ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+@@ -701,7 +758,10 @@ func_usage ()
+ # unless 'noexit' is passed as argument.
+ func_help ()
+ {
++ $opt_debug
++
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
++ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+@@ -714,7 +774,11 @@ func_help ()
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+- }' < "$progpath"
++ d
++ }
++ /^# .* home page:/b print
++ /^# General help using/b print
++ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+@@ -726,12 +790,39 @@ func_help ()
+ # exit_cmd.
+ func_missing_arg ()
+ {
+- func_error "missing argument for $1"
++ $opt_debug
++
++ func_error "missing argument for $1."
+ exit_cmd=exit
+ }
+
+-exit_cmd=:
+
++# func_split_short_opt shortopt
++# Set func_split_short_opt_name and func_split_short_opt_arg shell
++# variables after splitting SHORTOPT after the 2nd character.
++func_split_short_opt ()
++{
++ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
++ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
++
++ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
++ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
++} # func_split_short_opt may be replaced by extended shell implementation
++
++
++# func_split_long_opt longopt
++# Set func_split_long_opt_name and func_split_long_opt_arg shell
++# variables after splitting LONGOPT at the `=' sign.
++func_split_long_opt ()
++{
++ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
++ my_sed_long_arg='1s/^--[^=]*=//'
++
++ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
++ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
++} # func_split_long_opt may be replaced by extended shell implementation
++
++exit_cmd=:
+
+
+
+@@ -741,26 +832,64 @@ magic="%%%MAGIC variable%%%"
+ magic_exe="%%%MAGIC EXE variable%%%"
+
+ # Global variables.
+-# $mode is unset
+ nonopt=
+-execute_dlfiles=
+ preserve_args=
+ lo2o="s/\\.lo\$/.${objext}/"
+ o2lo="s/\\.${objext}\$/.lo/"
+ extracted_archives=
+ extracted_serial=0
+
+-opt_dry_run=false
+-opt_finish=:
+-opt_duplicate_deps=false
+-opt_silent=false
+-opt_debug=:
+-
+ # If this variable is set in any of the actions, the command in it
+ # will be execed at the end. This prevents here-documents from being
+ # left over by shells.
+ exec_cmd=
+
++# func_append var value
++# Append VALUE to the end of shell variable VAR.
++func_append ()
++{
++ eval "${1}=\$${1}\${2}"
++} # func_append may be replaced by extended shell implementation
++
++# func_append_quoted var value
++# Quote VALUE and append to the end of shell variable VAR, separated
++# by a space.
++func_append_quoted ()
++{
++ func_quote_for_eval "${2}"
++ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
++} # func_append_quoted may be replaced by extended shell implementation
++
++
++# func_arith arithmetic-term...
++func_arith ()
++{
++ func_arith_result=`expr "${@}"`
++} # func_arith may be replaced by extended shell implementation
++
++
++# func_len string
++# STRING may not start with a hyphen.
++func_len ()
++{
++ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
++} # func_len may be replaced by extended shell implementation
++
++
++# func_lo2o object
++func_lo2o ()
++{
++ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
++} # func_lo2o may be replaced by extended shell implementation
++
++
++# func_xform libobj-or-source
++func_xform ()
++{
++ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
++} # func_xform may be replaced by extended shell implementation
++
++
+ # func_fatal_configuration arg...
+ # Echo program name prefixed message to standard error, followed by
+ # a configuration failure hint, and exit.
+@@ -850,130 +979,204 @@ func_enable_tag ()
+ esac
+ }
+
+-# Parse options once, thoroughly. This comes as soon as possible in
+-# the script to make things like `libtool --version' happen quickly.
++# func_check_version_match
++# Ensure that we are using m4 macros, and libtool script from the same
++# release of libtool.
++func_check_version_match ()
+ {
++ if test "$package_revision" != "$macro_revision"; then
++ if test "$VERSION" != "$macro_version"; then
++ if test -z "$macro_version"; then
++ cat >&2 <<_LT_EOF
++$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from an older release.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++ else
++ cat >&2 <<_LT_EOF
++$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++ fi
++ else
++ cat >&2 <<_LT_EOF
++$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
++$progname: but the definition of this LT_INIT comes from revision $macro_revision.
++$progname: You should recreate aclocal.m4 with macros from revision $package_revision
++$progname: of $PACKAGE $VERSION and run autoconf again.
++_LT_EOF
++ fi
+
+- # Shorthand for --mode=foo, only valid as the first argument
+- case $1 in
+- clean|clea|cle|cl)
+- shift; set dummy --mode clean ${1+"$@"}; shift
+- ;;
+- compile|compil|compi|comp|com|co|c)
+- shift; set dummy --mode compile ${1+"$@"}; shift
+- ;;
+- execute|execut|execu|exec|exe|ex|e)
+- shift; set dummy --mode execute ${1+"$@"}; shift
+- ;;
+- finish|finis|fini|fin|fi|f)
+- shift; set dummy --mode finish ${1+"$@"}; shift
+- ;;
+- install|instal|insta|inst|ins|in|i)
+- shift; set dummy --mode install ${1+"$@"}; shift
+- ;;
+- link|lin|li|l)
+- shift; set dummy --mode link ${1+"$@"}; shift
+- ;;
+- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+- shift; set dummy --mode uninstall ${1+"$@"}; shift
+- ;;
+- esac
++ exit $EXIT_MISMATCH
++ fi
++}
++
++
++# Shorthand for --mode=foo, only valid as the first argument
++case $1 in
++clean|clea|cle|cl)
++ shift; set dummy --mode clean ${1+"$@"}; shift
++ ;;
++compile|compil|compi|comp|com|co|c)
++ shift; set dummy --mode compile ${1+"$@"}; shift
++ ;;
++execute|execut|execu|exec|exe|ex|e)
++ shift; set dummy --mode execute ${1+"$@"}; shift
++ ;;
++finish|finis|fini|fin|fi|f)
++ shift; set dummy --mode finish ${1+"$@"}; shift
++ ;;
++install|instal|insta|inst|ins|in|i)
++ shift; set dummy --mode install ${1+"$@"}; shift
++ ;;
++link|lin|li|l)
++ shift; set dummy --mode link ${1+"$@"}; shift
++ ;;
++uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
++ shift; set dummy --mode uninstall ${1+"$@"}; shift
++ ;;
++esac
+
+- # Parse non-mode specific arguments:
+- while test "$#" -gt 0; do
++
++
++# Option defaults:
++opt_debug=:
++opt_dry_run=false
++opt_config=false
++opt_preserve_dup_deps=false
++opt_features=false
++opt_finish=false
++opt_help=false
++opt_help_all=false
++opt_silent=:
++opt_verbose=:
++opt_silent=false
++opt_verbose=false
++
++
++# Parse options once, thoroughly. This comes as soon as possible in the
++# script to make things like `--version' happen as quickly as we can.
++{
++ # this just eases exit handling
++ while test $# -gt 0; do
+ opt="$1"
+ shift
+-
+ case $opt in
+- --config) func_config ;;
+-
+- --debug) preserve_args="$preserve_args $opt"
++ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+- opt_debug='set -x'
+ $opt_debug
+ ;;
+-
+- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
+- execute_dlfiles="$execute_dlfiles $1"
+- shift
++ --dry-run|--dryrun|-n)
++ opt_dry_run=:
+ ;;
+-
+- --dry-run | -n) opt_dry_run=: ;;
+- --features) func_features ;;
+- --finish) mode="finish" ;;
+- --no-finish) opt_finish=false ;;
+-
+- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
+- case $1 in
+- # Valid mode arguments:
+- clean) ;;
+- compile) ;;
+- execute) ;;
+- finish) ;;
+- install) ;;
+- link) ;;
+- relink) ;;
+- uninstall) ;;
+-
+- # Catch anything else as an error
+- *) func_error "invalid argument for $opt"
+- exit_cmd=exit
+- break
+- ;;
+- esac
+-
+- mode="$1"
++ --config)
++ opt_config=:
++func_config
++ ;;
++ --dlopen|-dlopen)
++ optarg="$1"
++ opt_dlopen="${opt_dlopen+$opt_dlopen
++}$optarg"
+ shift
+ ;;
+-
+ --preserve-dup-deps)
+- opt_duplicate_deps=: ;;
+-
+- --quiet|--silent) preserve_args="$preserve_args $opt"
+- opt_silent=:
+- opt_verbose=false
++ opt_preserve_dup_deps=:
+ ;;
+-
+- --no-quiet|--no-silent)
+- preserve_args="$preserve_args $opt"
+- opt_silent=false
++ --features)
++ opt_features=:
++func_features
+ ;;
+-
+- --verbose| -v) preserve_args="$preserve_args $opt"
++ --finish)
++ opt_finish=:
++set dummy --mode finish ${1+"$@"}; shift
++ ;;
++ --help)
++ opt_help=:
++ ;;
++ --help-all)
++ opt_help_all=:
++opt_help=': help-all'
++ ;;
++ --mode)
++ test $# = 0 && func_missing_arg $opt && break
++ optarg="$1"
++ opt_mode="$optarg"
++case $optarg in
++ # Valid mode arguments:
++ clean|compile|execute|finish|install|link|relink|uninstall) ;;
++
++ # Catch anything else as an error
++ *) func_error "invalid argument for $opt"
++ exit_cmd=exit
++ break
++ ;;
++esac
++ shift
++ ;;
++ --no-silent|--no-quiet)
+ opt_silent=false
+- opt_verbose=:
++func_append preserve_args " $opt"
+ ;;
+-
+- --no-verbose) preserve_args="$preserve_args $opt"
++ --no-verbose)
+ opt_verbose=false
++func_append preserve_args " $opt"
+ ;;
+-
+- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
+- preserve_args="$preserve_args $opt $1"
+- func_enable_tag "$1" # tagname is set here
++ --silent|--quiet)
++ opt_silent=:
++func_append preserve_args " $opt"
++ opt_verbose=false
++ ;;
++ --verbose|-v)
++ opt_verbose=:
++func_append preserve_args " $opt"
++opt_silent=false
++ ;;
++ --tag)
++ test $# = 0 && func_missing_arg $opt && break
++ optarg="$1"
++ opt_tag="$optarg"
++func_append preserve_args " $opt $optarg"
++func_enable_tag "$optarg"
+ shift
+ ;;
+
++ -\?|-h) func_usage ;;
++ --help) func_help ;;
++ --version) func_version ;;
++
+ # Separate optargs to long options:
+- -dlopen=*|--mode=*|--tag=*)
+- func_opt_split "$opt"
+- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
++ --*=*)
++ func_split_long_opt "$opt"
++ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+- -\?|-h) func_usage ;;
+- --help) opt_help=: ;;
+- --help-all) opt_help=': help-all' ;;
+- --version) func_version ;;
+-
+- -*) func_fatal_help "unrecognized option \`$opt'" ;;
+-
+- *) nonopt="$opt"
+- break
++ # Separate non-argument short options:
++ -\?*|-h*|-n*|-v*)
++ func_split_short_opt "$opt"
++ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
++ shift
+ ;;
++
++ --) break ;;
++ -*) func_fatal_help "unrecognized option \`$opt'" ;;
++ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
++ # Validate options:
++
++ # save first non-option argument
++ if test "$#" -gt 0; then
++ nonopt="$opt"
++ shift
++ fi
++
++ # preserve --debug
++ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* )
+@@ -981,82 +1184,44 @@ func_enable_tag ()
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
++ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+- # Having warned about all mis-specified options, bail out if
+- # anything was wrong.
+- $exit_cmd $EXIT_FAILURE
+-}
++ $opt_help || {
++ # Sanity checks first:
++ func_check_version_match
+
+-# func_check_version_match
+-# Ensure that we are using m4 macros, and libtool script from the same
+-# release of libtool.
+-func_check_version_match ()
+-{
+- if test "$package_revision" != "$macro_revision"; then
+- if test "$VERSION" != "$macro_version"; then
+- if test -z "$macro_version"; then
+- cat >&2 <<_LT_EOF
+-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from an older release.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+- else
+- cat >&2 <<_LT_EOF
+-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+- fi
+- else
+- cat >&2 <<_LT_EOF
+-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+-$progname: of $PACKAGE $VERSION and run autoconf again.
+-_LT_EOF
++ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
++ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+- exit $EXIT_MISMATCH
+- fi
+-}
+-
++ # Darwin sucks
++ eval std_shrext=\"$shrext_cmds\"
+
+-## ----------- ##
+-## Main. ##
+-## ----------- ##
+-
+-$opt_help || {
+- # Sanity checks first:
+- func_check_version_match
+-
+- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+- func_fatal_configuration "not configured to build any kind of library"
+- fi
++ # Only execute mode is allowed to have -dlopen flags.
++ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
++ func_error "unrecognized option \`-dlopen'"
++ $ECHO "$help" 1>&2
++ exit $EXIT_FAILURE
++ fi
+
+- test -z "$mode" && func_fatal_error "error: you must specify a MODE."
++ # Change the help message to a mode-specific one.
++ generic_help="$help"
++ help="Try \`$progname --help --mode=$opt_mode' for more information."
++ }
+
+
+- # Darwin sucks
+- eval "std_shrext=\"$shrext_cmds\""
++ # Bail if the options were screwed
++ $exit_cmd $EXIT_FAILURE
++}
+
+
+- # Only execute mode is allowed to have -dlopen flags.
+- if test -n "$execute_dlfiles" && test "$mode" != execute; then
+- func_error "unrecognized option \`-dlopen'"
+- $ECHO "$help" 1>&2
+- exit $EXIT_FAILURE
+- fi
+
+- # Change the help message to a mode-specific one.
+- generic_help="$help"
+- help="Try \`$progname --help --mode=$mode' for more information."
+-}
+
++## ----------- ##
++## Main. ##
++## ----------- ##
+
+ # func_lalib_p file
+ # True iff FILE is a libtool `.la' library or `.lo' object file.
+@@ -1121,12 +1286,9 @@ func_ltwrapper_executable_p ()
+ # temporary ltwrapper_script.
+ func_ltwrapper_scriptname ()
+ {
+- func_ltwrapper_scriptname_result=""
+- if func_ltwrapper_executable_p "$1"; then
+- func_dirname_and_basename "$1" "" "."
+- func_stripname '' '.exe' "$func_basename_result"
+- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+- fi
++ func_dirname_and_basename "$1" "" "."
++ func_stripname '' '.exe' "$func_basename_result"
++ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ }
+
+ # func_ltwrapper_p file
+@@ -1149,7 +1311,7 @@ func_execute_cmds ()
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+- eval "cmd=\"$cmd\""
++ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+@@ -1172,6 +1334,37 @@ func_source ()
+ }
+
+
++# func_resolve_sysroot PATH
++# Replace a leading = in PATH with a sysroot. Store the result into
++# func_resolve_sysroot_result
++func_resolve_sysroot ()
++{
++ func_resolve_sysroot_result=$1
++ case $func_resolve_sysroot_result in
++ =*)
++ func_stripname '=' '' "$func_resolve_sysroot_result"
++ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
++ ;;
++ esac
++}
++
++# func_replace_sysroot PATH
++# If PATH begins with the sysroot, replace it with = and
++# store the result into func_replace_sysroot_result.
++func_replace_sysroot ()
++{
++ case "$lt_sysroot:$1" in
++ ?*:"$lt_sysroot"*)
++ func_stripname "$lt_sysroot" '' "$1"
++ func_replace_sysroot_result="=$func_stripname_result"
++ ;;
++ *)
++ # Including no sysroot.
++ func_replace_sysroot_result=$1
++ ;;
++ esac
++}
++
+ # func_infer_tag arg
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+@@ -1184,8 +1377,7 @@ func_infer_tag ()
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+- func_quote_for_eval "$arg"
+- CC_quoted="$CC_quoted $func_quote_for_eval_result"
++ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1204,8 +1396,7 @@ func_infer_tag ()
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+- func_quote_for_eval "$arg"
+- CC_quoted="$CC_quoted $func_quote_for_eval_result"
++ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1274,6 +1465,486 @@ EOF
+ }
+ }
+
++
++##################################################
++# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
++##################################################
++
++# func_convert_core_file_wine_to_w32 ARG
++# Helper function used by file name conversion functions when $build is *nix,
++# and $host is mingw, cygwin, or some other w32 environment. Relies on a
++# correctly configured wine environment available, with the winepath program
++# in $build's $PATH.
++#
++# ARG is the $build file name to be converted to w32 format.
++# Result is available in $func_convert_core_file_wine_to_w32_result, and will
++# be empty on error (or when ARG is empty)
++func_convert_core_file_wine_to_w32 ()
++{
++ $opt_debug
++ func_convert_core_file_wine_to_w32_result="$1"
++ if test -n "$1"; then
++ # Unfortunately, winepath does not exit with a non-zero error code, so we
++ # are forced to check the contents of stdout. On the other hand, if the
++ # command is not found, the shell will set an exit code of 127 and print
++ # *an error message* to stdout. So we must check for both error code of
++ # zero AND non-empty stdout, which explains the odd construction:
++ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
++ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
++ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
++ $SED -e "$lt_sed_naive_backslashify"`
++ else
++ func_convert_core_file_wine_to_w32_result=
++ fi
++ fi
++}
++# end: func_convert_core_file_wine_to_w32
++
++
++# func_convert_core_path_wine_to_w32 ARG
++# Helper function used by path conversion functions when $build is *nix, and
++# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
++# configured wine environment available, with the winepath program in $build's
++# $PATH. Assumes ARG has no leading or trailing path separator characters.
++#
++# ARG is path to be converted from $build format to win32.
++# Result is available in $func_convert_core_path_wine_to_w32_result.
++# Unconvertible file (directory) names in ARG are skipped; if no directory names
++# are convertible, then the result may be empty.
++func_convert_core_path_wine_to_w32 ()
++{
++ $opt_debug
++ # unfortunately, winepath doesn't convert paths, only file names
++ func_convert_core_path_wine_to_w32_result=""
++ if test -n "$1"; then
++ oldIFS=$IFS
++ IFS=:
++ for func_convert_core_path_wine_to_w32_f in $1; do
++ IFS=$oldIFS
++ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
++ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
++ if test -z "$func_convert_core_path_wine_to_w32_result"; then
++ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
++ else
++ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
++ fi
++ fi
++ done
++ IFS=$oldIFS
++ fi
++}
++# end: func_convert_core_path_wine_to_w32
++
++
++# func_cygpath ARGS...
++# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
++# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
++# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
++# (2), returns the Cygwin file name or path in func_cygpath_result (input
++# file name or path is assumed to be in w32 format, as previously converted
++# from $build's *nix or MSYS format). In case (3), returns the w32 file name
++# or path in func_cygpath_result (input file name or path is assumed to be in
++# Cygwin format). Returns an empty string on error.
++#
++# ARGS are passed to cygpath, with the last one being the file name or path to
++# be converted.
++#
++# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
++# environment variable; do not put it in $PATH.
++func_cygpath ()
++{
++ $opt_debug
++ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
++ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
++ if test "$?" -ne 0; then
++ # on failure, ensure result is empty
++ func_cygpath_result=
++ fi
++ else
++ func_cygpath_result=
++ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
++ fi
++}
++#end: func_cygpath
++
++
++# func_convert_core_msys_to_w32 ARG
++# Convert file name or path ARG from MSYS format to w32 format. Return
++# result in func_convert_core_msys_to_w32_result.
++func_convert_core_msys_to_w32 ()
++{
++ $opt_debug
++ # awkward: cmd appends spaces to result
++ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
++ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
++}
++#end: func_convert_core_msys_to_w32
++
++
++# func_convert_file_check ARG1 ARG2
++# Verify that ARG1 (a file name in $build format) was converted to $host
++# format in ARG2. Otherwise, emit an error message, but continue (resetting
++# func_to_host_file_result to ARG1).
++func_convert_file_check ()
++{
++ $opt_debug
++ if test -z "$2" && test -n "$1" ; then
++ func_error "Could not determine host file name corresponding to"
++ func_error " \`$1'"
++ func_error "Continuing, but uninstalled executables may not work."
++ # Fallback:
++ func_to_host_file_result="$1"
++ fi
++}
++# end func_convert_file_check
++
++
++# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
++# Verify that FROM_PATH (a path in $build format) was converted to $host
++# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
++# func_to_host_file_result to a simplistic fallback value (see below).
++func_convert_path_check ()
++{
++ $opt_debug
++ if test -z "$4" && test -n "$3"; then
++ func_error "Could not determine the host path corresponding to"
++ func_error " \`$3'"
++ func_error "Continuing, but uninstalled executables may not work."
++ # Fallback. This is a deliberately simplistic "conversion" and
++ # should not be "improved". See libtool.info.
++ if test "x$1" != "x$2"; then
++ lt_replace_pathsep_chars="s|$1|$2|g"
++ func_to_host_path_result=`echo "$3" |
++ $SED -e "$lt_replace_pathsep_chars"`
++ else
++ func_to_host_path_result="$3"
++ fi
++ fi
++}
++# end func_convert_path_check
++
++
++# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
++# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
++# and appending REPL if ORIG matches BACKPAT.
++func_convert_path_front_back_pathsep ()
++{
++ $opt_debug
++ case $4 in
++ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
++ ;;
++ esac
++ case $4 in
++ $2 ) func_append func_to_host_path_result "$3"
++ ;;
++ esac
++}
++# end func_convert_path_front_back_pathsep
++
++
++##################################################
++# $build to $host FILE NAME CONVERSION FUNCTIONS #
++##################################################
++# invoked via `$to_host_file_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# Result will be available in $func_to_host_file_result.
++
++
++# func_to_host_file ARG
++# Converts the file name ARG from $build format to $host format. Return result
++# in func_to_host_file_result.
++func_to_host_file ()
++{
++ $opt_debug
++ $to_host_file_cmd "$1"
++}
++# end func_to_host_file
++
++
++# func_to_tool_file ARG LAZY
++# converts the file name ARG from $build format to toolchain format. Return
++# result in func_to_tool_file_result. If the conversion in use is listed
++# in (the comma separated) LAZY, no conversion takes place.
++func_to_tool_file ()
++{
++ $opt_debug
++ case ,$2, in
++ *,"$to_tool_file_cmd",*)
++ func_to_tool_file_result=$1
++ ;;
++ *)
++ $to_tool_file_cmd "$1"
++ func_to_tool_file_result=$func_to_host_file_result
++ ;;
++ esac
++}
++# end func_to_tool_file
++
++
++# func_convert_file_noop ARG
++# Copy ARG to func_to_host_file_result.
++func_convert_file_noop ()
++{
++ func_to_host_file_result="$1"
++}
++# end func_convert_file_noop
++
++
++# func_convert_file_msys_to_w32 ARG
++# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper. Returns result in
++# func_to_host_file_result.
++func_convert_file_msys_to_w32 ()
++{
++ $opt_debug
++ func_to_host_file_result="$1"
++ if test -n "$1"; then
++ func_convert_core_msys_to_w32 "$1"
++ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
++ fi
++ func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_w32
++
++
++# func_convert_file_cygwin_to_w32 ARG
++# Convert file name ARG from Cygwin to w32 format. Returns result in
++# func_to_host_file_result.
++func_convert_file_cygwin_to_w32 ()
++{
++ $opt_debug
++ func_to_host_file_result="$1"
++ if test -n "$1"; then
++ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
++ # LT_CYGPATH in this case.
++ func_to_host_file_result=`cygpath -m "$1"`
++ fi
++ func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_cygwin_to_w32
++
++
++# func_convert_file_nix_to_w32 ARG
++# Convert file name ARG from *nix to w32 format. Requires a wine environment
++# and a working winepath. Returns result in func_to_host_file_result.
++func_convert_file_nix_to_w32 ()
++{
++ $opt_debug
++ func_to_host_file_result="$1"
++ if test -n "$1"; then
++ func_convert_core_file_wine_to_w32 "$1"
++ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
++ fi
++ func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_w32
++
++
++# func_convert_file_msys_to_cygwin ARG
++# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_file_msys_to_cygwin ()
++{
++ $opt_debug
++ func_to_host_file_result="$1"
++ if test -n "$1"; then
++ func_convert_core_msys_to_w32 "$1"
++ func_cygpath -u "$func_convert_core_msys_to_w32_result"
++ func_to_host_file_result="$func_cygpath_result"
++ fi
++ func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_cygwin
++
++
++# func_convert_file_nix_to_cygwin ARG
++# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
++# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
++# in func_to_host_file_result.
++func_convert_file_nix_to_cygwin ()
++{
++ $opt_debug
++ func_to_host_file_result="$1"
++ if test -n "$1"; then
++ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
++ func_convert_core_file_wine_to_w32 "$1"
++ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
++ func_to_host_file_result="$func_cygpath_result"
++ fi
++ func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_cygwin
++
++
++#############################################
++# $build to $host PATH CONVERSION FUNCTIONS #
++#############################################
++# invoked via `$to_host_path_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# The result will be available in $func_to_host_path_result.
++#
++# Path separators are also converted from $build format to $host format. If
++# ARG begins or ends with a path separator character, it is preserved (but
++# converted to $host format) on output.
++#
++# All path conversion functions are named using the following convention:
++# file name conversion function : func_convert_file_X_to_Y ()
++# path conversion function : func_convert_path_X_to_Y ()
++# where, for any given $build/$host combination the 'X_to_Y' value is the
++# same. If conversion functions are added for new $build/$host combinations,
++# the two new functions must follow this pattern, or func_init_to_host_path_cmd
++# will break.
++
++
++# func_init_to_host_path_cmd
++# Ensures that function "pointer" variable $to_host_path_cmd is set to the
++# appropriate value, based on the value of $to_host_file_cmd.
++to_host_path_cmd=
++func_init_to_host_path_cmd ()
++{
++ $opt_debug
++ if test -z "$to_host_path_cmd"; then
++ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
++ to_host_path_cmd="func_convert_path_${func_stripname_result}"
++ fi
++}
++
++
++# func_to_host_path ARG
++# Converts the path ARG from $build format to $host format. Return result
++# in func_to_host_path_result.
++func_to_host_path ()
++{
++ $opt_debug
++ func_init_to_host_path_cmd
++ $to_host_path_cmd "$1"
++}
++# end func_to_host_path
++
++
++# func_convert_path_noop ARG
++# Copy ARG to func_to_host_path_result.
++func_convert_path_noop ()
++{
++ func_to_host_path_result="$1"
++}
++# end func_convert_path_noop
++
++
++# func_convert_path_msys_to_w32 ARG
++# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper. Returns result in
++# func_to_host_path_result.
++func_convert_path_msys_to_w32 ()
++{
++ $opt_debug
++ func_to_host_path_result="$1"
++ if test -n "$1"; then
++ # Remove leading and trailing path separator characters from ARG. MSYS
++ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
++ # and winepath ignores them completely.
++ func_stripname : : "$1"
++ func_to_host_path_tmp1=$func_stripname_result
++ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
++ func_convert_path_check : ";" \
++ "$func_to_host_path_tmp1" "$func_to_host_path_result"
++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++ fi
++}
++# end func_convert_path_msys_to_w32
++
++
++# func_convert_path_cygwin_to_w32 ARG
++# Convert path ARG from Cygwin to w32 format. Returns result in
++# func_to_host_file_result.
++func_convert_path_cygwin_to_w32 ()
++{
++ $opt_debug
++ func_to_host_path_result="$1"
++ if test -n "$1"; then
++ # See func_convert_path_msys_to_w32:
++ func_stripname : : "$1"
++ func_to_host_path_tmp1=$func_stripname_result
++ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
++ func_convert_path_check : ";" \
++ "$func_to_host_path_tmp1" "$func_to_host_path_result"
++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++ fi
++}
++# end func_convert_path_cygwin_to_w32
++
++
++# func_convert_path_nix_to_w32 ARG
++# Convert path ARG from *nix to w32 format. Requires a wine environment and
++# a working winepath. Returns result in func_to_host_file_result.
++func_convert_path_nix_to_w32 ()
++{
++ $opt_debug
++ func_to_host_path_result="$1"
++ if test -n "$1"; then
++ # See func_convert_path_msys_to_w32:
++ func_stripname : : "$1"
++ func_to_host_path_tmp1=$func_stripname_result
++ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
++ func_convert_path_check : ";" \
++ "$func_to_host_path_tmp1" "$func_to_host_path_result"
++ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++ fi
++}
++# end func_convert_path_nix_to_w32
++
++
++# func_convert_path_msys_to_cygwin ARG
++# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_path_msys_to_cygwin ()
++{
++ $opt_debug
++ func_to_host_path_result="$1"
++ if test -n "$1"; then
++ # See func_convert_path_msys_to_w32:
++ func_stripname : : "$1"
++ func_to_host_path_tmp1=$func_stripname_result
++ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
++ func_to_host_path_result="$func_cygpath_result"
++ func_convert_path_check : : \
++ "$func_to_host_path_tmp1" "$func_to_host_path_result"
++ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++ fi
++}
++# end func_convert_path_msys_to_cygwin
++
++
++# func_convert_path_nix_to_cygwin ARG
++# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
++# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
++# func_to_host_file_result.
++func_convert_path_nix_to_cygwin ()
++{
++ $opt_debug
++ func_to_host_path_result="$1"
++ if test -n "$1"; then
++ # Remove leading and trailing path separator characters from
++ # ARG. msys behavior is inconsistent here, cygpath turns them
++ # into '.;' and ';.', and winepath ignores them completely.
++ func_stripname : : "$1"
++ func_to_host_path_tmp1=$func_stripname_result
++ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
++ func_to_host_path_result="$func_cygpath_result"
++ func_convert_path_check : : \
++ "$func_to_host_path_tmp1" "$func_to_host_path_result"
++ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++ fi
++}
++# end func_convert_path_nix_to_cygwin
++
++
+ # func_mode_compile arg...
+ func_mode_compile ()
+ {
+@@ -1314,12 +1985,12 @@ func_mode_compile ()
+ ;;
+
+ -pie | -fpie | -fPIE)
+- pie_flag="$pie_flag $arg"
++ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+- later="$later $arg"
++ func_append later " $arg"
+ continue
+ ;;
+
+@@ -1340,15 +2011,14 @@ func_mode_compile ()
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+- func_quote_for_eval "$arg"
+- lastarg="$lastarg $func_quote_for_eval_result"
++ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+- base_compile="$base_compile $lastarg"
++ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+@@ -1364,8 +2034,7 @@ func_mode_compile ()
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+- func_quote_for_eval "$lastarg"
+- base_compile="$base_compile $func_quote_for_eval_result"
++ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+@@ -1496,17 +2165,16 @@ compiler."
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+- removelist="$removelist $output_obj"
++ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+- removelist="$removelist $lockfile"
++ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+- if test -n "$fix_srcfile_path"; then
+- eval "srcfile=\"$fix_srcfile_path\""
+- fi
++ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
++ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+@@ -1526,7 +2194,7 @@ compiler."
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+- command="$command -o $lobj"
++ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+@@ -1573,11 +2241,11 @@ compiler."
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+- command="$command -o $obj"
++ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+- command="$command$suppress_output"
++ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+@@ -1622,13 +2290,13 @@ compiler."
+ }
+
+ $opt_help || {
+- test "$mode" = compile && func_mode_compile ${1+"$@"}
++ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+ }
+
+ func_mode_help ()
+ {
+ # We need to display help for each of the modes.
+- case $mode in
++ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+@@ -1659,8 +2327,8 @@ This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+- -prefer-pic try to building PIC objects only
+- -prefer-non-pic try to building non-PIC objects only
++ -prefer-pic try to build PIC objects only
++ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+@@ -1804,7 +2472,7 @@ Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+- func_fatal_help "invalid operation mode \`$mode'"
++ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+@@ -1819,13 +2487,13 @@ if $opt_help; then
+ else
+ {
+ func_help noexit
+- for mode in compile link execute install finish uninstall clean; do
++ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+- for mode in compile link execute install finish uninstall clean; do
++ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+@@ -1854,13 +2522,16 @@ func_mode_execute ()
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+- for file in $execute_dlfiles; do
++ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
++ func_resolve_sysroot "$file"
++ file=$func_resolve_sysroot_result
++
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+@@ -1882,7 +2553,7 @@ func_mode_execute ()
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+- dir="$dir/$objdir"
++ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+@@ -1907,10 +2578,10 @@ func_mode_execute ()
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+- if eval test -z \"\$$shlibpath_var\"; then
+- eval $shlibpath_var=\$dir
++ if eval "test -z \"\$$shlibpath_var\""; then
++ eval "$shlibpath_var=\"\$dir\""
+ else
+- eval $shlibpath_var=\$dir:\$$shlibpath_var
++ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+@@ -1939,8 +2610,7 @@ func_mode_execute ()
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+- func_quote_for_eval "$file"
+- args="$args $func_quote_for_eval_result"
++ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+@@ -1972,22 +2642,59 @@ func_mode_execute ()
+ fi
+ }
+
+-test "$mode" = execute && func_mode_execute ${1+"$@"}
++test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+ # func_mode_finish arg...
+ func_mode_finish ()
+ {
+ $opt_debug
+- libdirs="$nonopt"
++ libs=
++ libdirs=
+ admincmds=
+
+- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+- for dir
+- do
+- libdirs="$libdirs $dir"
+- done
++ for opt in "$nonopt" ${1+"$@"}
++ do
++ if test -d "$opt"; then
++ func_append libdirs " $opt"
+
++ elif test -f "$opt"; then
++ if func_lalib_unsafe_p "$opt"; then
++ func_append libs " $opt"
++ else
++ func_warning "\`$opt' is not a valid libtool archive"
++ fi
++
++ else
++ func_fatal_error "invalid argument \`$opt'"
++ fi
++ done
++
++ if test -n "$libs"; then
++ if test -n "$lt_sysroot"; then
++ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
++ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
++ else
++ sysroot_cmd=
++ fi
++
++ # Remove sysroot references
++ if $opt_dry_run; then
++ for lib in $libs; do
++ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
++ done
++ else
++ tmpdir=`func_mktempdir`
++ for lib in $libs; do
++ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
++ > $tmpdir/tmp-la
++ mv -f $tmpdir/tmp-la $lib
++ done
++ ${RM}r "$tmpdir"
++ fi
++ fi
++
++ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+@@ -1997,7 +2704,7 @@ func_mode_finish ()
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+- $opt_dry_run || eval "$cmds" || admincmds="$admincmds
++ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+@@ -2006,53 +2713,55 @@ func_mode_finish ()
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+- echo "----------------------------------------------------------------------"
+- echo "Libraries have been installed in:"
+- for libdir in $libdirs; do
+- $ECHO " $libdir"
+- done
+- echo
+- echo "If you ever happen to want to link against installed libraries"
+- echo "in a given directory, LIBDIR, you must either use libtool, and"
+- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+- echo "flag during linking and do at least one of the following:"
+- if test -n "$shlibpath_var"; then
+- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+- echo " during execution"
+- fi
+- if test -n "$runpath_var"; then
+- echo " - add LIBDIR to the \`$runpath_var' environment variable"
+- echo " during linking"
+- fi
+- if test -n "$hardcode_libdir_flag_spec"; then
+- libdir=LIBDIR
+- eval "flag=\"$hardcode_libdir_flag_spec\""
++ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
++ echo "----------------------------------------------------------------------"
++ echo "Libraries have been installed in:"
++ for libdir in $libdirs; do
++ $ECHO " $libdir"
++ done
++ echo
++ echo "If you ever happen to want to link against installed libraries"
++ echo "in a given directory, LIBDIR, you must either use libtool, and"
++ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
++ echo "flag during linking and do at least one of the following:"
++ if test -n "$shlibpath_var"; then
++ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
++ echo " during execution"
++ fi
++ if test -n "$runpath_var"; then
++ echo " - add LIBDIR to the \`$runpath_var' environment variable"
++ echo " during linking"
++ fi
++ if test -n "$hardcode_libdir_flag_spec"; then
++ libdir=LIBDIR
++ eval flag=\"$hardcode_libdir_flag_spec\"
+
+- $ECHO " - use the \`$flag' linker flag"
+- fi
+- if test -n "$admincmds"; then
+- $ECHO " - have your system administrator run these commands:$admincmds"
+- fi
+- if test -f /etc/ld.so.conf; then
+- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+- fi
+- echo
++ $ECHO " - use the \`$flag' linker flag"
++ fi
++ if test -n "$admincmds"; then
++ $ECHO " - have your system administrator run these commands:$admincmds"
++ fi
++ if test -f /etc/ld.so.conf; then
++ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
++ fi
++ echo
+
+- echo "See any operating system documentation about shared libraries for"
+- case $host in
+- solaris2.[6789]|solaris2.1[0-9])
+- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+- echo "pages."
+- ;;
+- *)
+- echo "more information, such as the ld(1) and ld.so(8) manual pages."
+- ;;
+- esac
+- echo "----------------------------------------------------------------------"
++ echo "See any operating system documentation about shared libraries for"
++ case $host in
++ solaris2.[6789]|solaris2.1[0-9])
++ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
++ echo "pages."
++ ;;
++ *)
++ echo "more information, such as the ld(1) and ld.so(8) manual pages."
++ ;;
++ esac
++ echo "----------------------------------------------------------------------"
++ fi
+ exit $EXIT_SUCCESS
+ }
+
+-test "$mode" = finish && func_mode_finish ${1+"$@"}
++test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+ # func_mode_install arg...
+@@ -2077,7 +2786,7 @@ func_mode_install ()
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+- install_prog="$install_prog$func_quote_for_eval_result"
++ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+@@ -2097,7 +2806,7 @@ func_mode_install ()
+ do
+ arg2=
+ if test -n "$dest"; then
+- files="$files $dest"
++ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+@@ -2135,11 +2844,11 @@ func_mode_install ()
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+- install_prog="$install_prog $func_quote_for_eval_result"
++ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+- install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
++ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+@@ -2151,7 +2860,7 @@ func_mode_install ()
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+- install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
++ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+@@ -2209,10 +2918,13 @@ func_mode_install ()
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+- staticlibs="$staticlibs $file"
++ func_append staticlibs " $file"
+ ;;
+
+ *.la)
++ func_resolve_sysroot "$file"
++ file=$func_resolve_sysroot_result
++
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+@@ -2226,23 +2938,30 @@ func_mode_install ()
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+- *) current_libdirs="$current_libdirs $libdir" ;;
++ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+- *) future_libdirs="$future_libdirs $libdir" ;;
++ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+- dir="$dir$objdir"
++ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
++ # Strip any trailing slash from the destination.
++ func_stripname '' '/' "$libdir"
++ destlibdir=$func_stripname_result
++
++ func_stripname '' '/' "$destdir"
++ s_destdir=$func_stripname_result
++
+ # Determine the prefix the user has applied to our future dir.
+- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
++ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+@@ -2315,7 +3034,7 @@ func_mode_install ()
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
++ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+@@ -2503,7 +3222,7 @@ func_mode_install ()
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+- if test -n "$current_libdirs" && $opt_finish; then
++ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+@@ -2512,7 +3231,7 @@ func_mode_install ()
+ fi
+ }
+
+-test "$mode" = install && func_mode_install ${1+"$@"}
++test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+ # func_generate_dlsyms outputname originator pic_p
+@@ -2559,6 +3278,18 @@ extern \"C\" {
+ #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+ #endif
+
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ /* External symbol declarations for the compiler. */\
+ "
+
+@@ -2570,21 +3301,22 @@ extern \"C\" {
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+- func_verbose "extracting global C symbols from \`$progfile'"
+- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
++ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
++ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
++ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+- $MV "$nlist"T "$nlist"
++ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
++ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+- $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
+- $MV "$nlist"T "$nlist"
++ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
++ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+@@ -2593,23 +3325,23 @@ extern \"C\" {
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+- ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
++ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+- echo EXPORTS > "$output_objdir/$outputname.def"
+- cat "$export_symbols" >> "$output_objdir/$outputname.def"
++ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+- ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
+- $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
+- $MV "$nlist"T "$nlist"
++ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
++ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
++ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+- echo EXPORTS > "$output_objdir/$outputname.def"
+- cat "$nlist" >> "$output_objdir/$outputname.def"
++ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+@@ -2620,10 +3352,52 @@ extern \"C\" {
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+- $opt_dry_run || {
+- $ECHO ": $name " >> "$nlist"
+- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+- }
++ case $host in
++ *cygwin* | *mingw* | *cegcc* )
++ # if an import library, we need to obtain dlname
++ if func_win32_import_lib_p "$dlprefile"; then
++ func_tr_sh "$dlprefile"
++ eval "curr_lafile=\$libfile_$func_tr_sh_result"
++ dlprefile_dlbasename=""
++ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
++ # Use subshell, to avoid clobbering current variable values
++ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
++ if test -n "$dlprefile_dlname" ; then
++ func_basename "$dlprefile_dlname"
++ dlprefile_dlbasename="$func_basename_result"
++ else
++ # no lafile. user explicitly requested -dlpreopen <import library>.
++ $sharedlib_from_linklib_cmd "$dlprefile"
++ dlprefile_dlbasename=$sharedlib_from_linklib_result
++ fi
++ fi
++ $opt_dry_run || {
++ if test -n "$dlprefile_dlbasename" ; then
++ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
++ else
++ func_warning "Could not compute DLL name from $name"
++ eval '$ECHO ": $name " >> "$nlist"'
++ fi
++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
++ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
++ }
++ else # not an import lib
++ $opt_dry_run || {
++ eval '$ECHO ": $name " >> "$nlist"'
++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++ }
++ fi
++ ;;
++ *)
++ $opt_dry_run || {
++ eval '$ECHO ": $name " >> "$nlist"'
++ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++ }
++ ;;
++ esac
+ done
+
+ $opt_dry_run || {
+@@ -2661,26 +3435,9 @@ typedef struct {
+ const char *name;
+ void *address;
+ } lt_dlsymlist;
+-"
+- case $host in
+- *cygwin* | *mingw* | *cegcc* )
+- echo >> "$output_objdir/$my_dlsyms" "\
+-/* DATA imports from DLLs on WIN32 con't be const, because
+- runtime relocations are performed -- see ld's documentation
+- on pseudo-relocs. */"
+- lt_dlsym_const= ;;
+- *osf5*)
+- echo >> "$output_objdir/$my_dlsyms" "\
+-/* This system does not cope well with relocations in const data */"
+- lt_dlsym_const= ;;
+- *)
+- lt_dlsym_const=const ;;
+- esac
+-
+- echo >> "$output_objdir/$my_dlsyms" "\
+-extern $lt_dlsym_const lt_dlsymlist
++extern LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[];
+-$lt_dlsym_const lt_dlsymlist
++LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[] =
+ {\
+ { \"$my_originator\", (void *) 0 },"
+@@ -2736,7 +3493,7 @@ static const void *lt_preloaded_setup() {
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+- *) symtab_cflags="$symtab_cflags $arg" ;;
++ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+@@ -2796,9 +3553,11 @@ func_win32_libid ()
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+- if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
+- $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+- win32_nmres=`$NM -f posix -A "$1" |
++ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
++ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
++ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
++ func_to_tool_file "$1" func_convert_file_msys_to_w32
++ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+@@ -2827,6 +3586,131 @@ func_win32_libid ()
+ $ECHO "$win32_libid_type"
+ }
+
++# func_cygming_dll_for_implib ARG
++#
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++# Invoked by eval'ing the libtool variable
++# $sharedlib_from_linklib_cmd
++# Result is available in the variable
++# $sharedlib_from_linklib_result
++func_cygming_dll_for_implib ()
++{
++ $opt_debug
++ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
++}
++
++# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
++#
++# The is the core of a fallback implementation of a
++# platform-specific function to extract the name of the
++# DLL associated with the specified import library LIBNAME.
++#
++# SECTION_NAME is either .idata$6 or .idata$7, depending
++# on the platform and compiler that created the implib.
++#
++# Echos the name of the DLL associated with the
++# specified import library.
++func_cygming_dll_for_implib_fallback_core ()
++{
++ $opt_debug
++ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
++ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
++ $SED '/^Contents of section '"$match_literal"':/{
++ # Place marker at beginning of archive member dllname section
++ s/.*/====MARK====/
++ p
++ d
++ }
++ # These lines can sometimes be longer than 43 characters, but
++ # are always uninteresting
++ /:[ ]*file format pe[i]\{,1\}-/d
++ /^In archive [^:]*:/d
++ # Ensure marker is printed
++ /^====MARK====/p
++ # Remove all lines with less than 43 characters
++ /^.\{43\}/!d
++ # From remaining lines, remove first 43 characters
++ s/^.\{43\}//' |
++ $SED -n '
++ # Join marker and all lines until next marker into a single line
++ /^====MARK====/ b para
++ H
++ $ b para
++ b
++ :para
++ x
++ s/\n//g
++ # Remove the marker
++ s/^====MARK====//
++ # Remove trailing dots and whitespace
++ s/[\. \t]*$//
++ # Print
++ /./p' |
++ # we now have a list, one entry per line, of the stringified
++ # contents of the appropriate section of all members of the
++ # archive which possess that section. Heuristic: eliminate
++ # all those which have a first or second character that is
++ # a '.' (that is, objdump's representation of an unprintable
++ # character.) This should work for all archives with less than
++ # 0x302f exports -- but will fail for DLLs whose name actually
++ # begins with a literal '.' or a single character followed by
++ # a '.'.
++ #
++ # Of those that remain, print the first one.
++ $SED -e '/^\./d;/^.\./d;q'
++}
++
++# func_cygming_gnu_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is a GNU/binutils-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_gnu_implib_p ()
++{
++ $opt_debug
++ func_to_tool_file "$1" func_convert_file_msys_to_w32
++ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
++ test -n "$func_cygming_gnu_implib_tmp"
++}
++
++# func_cygming_ms_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is an MS-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_ms_implib_p ()
++{
++ $opt_debug
++ func_to_tool_file "$1" func_convert_file_msys_to_w32
++ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
++ test -n "$func_cygming_ms_implib_tmp"
++}
++
++# func_cygming_dll_for_implib_fallback ARG
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++#
++# This fallback implementation is for use when $DLLTOOL
++# does not support the --identify-strict option.
++# Invoked by eval'ing the libtool variable
++# $sharedlib_from_linklib_cmd
++# Result is available in the variable
++# $sharedlib_from_linklib_result
++func_cygming_dll_for_implib_fallback ()
++{
++ $opt_debug
++ if func_cygming_gnu_implib_p "$1" ; then
++ # binutils import library
++ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
++ elif func_cygming_ms_implib_p "$1" ; then
++ # ms-generated import library
++ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
++ else
++ # unknown
++ sharedlib_from_linklib_result=""
++ fi
++}
+
+
+ # func_extract_an_archive dir oldlib
+@@ -2917,7 +3801,7 @@ func_extract_archives ()
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
++ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+@@ -2932,7 +3816,7 @@ func_extract_archives ()
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
++ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+@@ -3014,7 +3898,110 @@ func_fallback_echo ()
+ _LTECHO_EOF'
+ }
+ ECHO=\"$qECHO\"
+- fi\
++ fi
++
++# Very basic option parsing. These options are (a) specific to
++# the libtool wrapper, (b) are identical between the wrapper
++# /script/ and the wrapper /executable/ which is used only on
++# windows platforms, and (c) all begin with the string "--lt-"
++# (application programs are unlikely to have options which match
++# this pattern).
++#
++# There are only two supported options: --lt-debug and
++# --lt-dump-script. There is, deliberately, no --lt-help.
++#
++# The first argument to this parsing function should be the
++# script's $0 value, followed by "$@".
++lt_option_debug=
++func_parse_lt_options ()
++{
++ lt_script_arg0=\$0
++ shift
++ for lt_opt
++ do
++ case \"\$lt_opt\" in
++ --lt-debug) lt_option_debug=1 ;;
++ --lt-dump-script)
++ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
++ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
++ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
++ cat \"\$lt_dump_D/\$lt_dump_F\"
++ exit 0
++ ;;
++ --lt-*)
++ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
++ exit 1
++ ;;
++ esac
++ done
++
++ # Print the debug banner immediately:
++ if test -n \"\$lt_option_debug\"; then
++ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
++ fi
++}
++
++# Used when --lt-debug. Prints its arguments to stdout
++# (redirection is the responsibility of the caller)
++func_lt_dump_args ()
++{
++ lt_dump_args_N=1;
++ for lt_arg
++ do
++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
++ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
++ done
++}
++
++# Core function for launching the target application
++func_exec_program_core ()
++{
++"
++ case $host in
++ # Backslashes separate directories on plain windows
++ *-*-mingw | *-*-os2* | *-cegcc*)
++ $ECHO "\
++ if test -n \"\$lt_option_debug\"; then
++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
++ func_lt_dump_args \${1+\"\$@\"} 1>&2
++ fi
++ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
++"
++ ;;
++
++ *)
++ $ECHO "\
++ if test -n \"\$lt_option_debug\"; then
++ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
++ func_lt_dump_args \${1+\"\$@\"} 1>&2
++ fi
++ exec \"\$progdir/\$program\" \${1+\"\$@\"}
++"
++ ;;
++ esac
++ $ECHO "\
++ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
++ exit 1
++}
++
++# A function to encapsulate launching the target application
++# Strips options in the --lt-* namespace from \$@ and
++# launches target application with the remaining arguments.
++func_exec_program ()
++{
++ for lt_wr_arg
++ do
++ case \$lt_wr_arg in
++ --lt-*) ;;
++ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
++ esac
++ shift
++ done
++ func_exec_program_core \${1+\"\$@\"}
++}
++
++ # Parse options
++ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+@@ -3078,7 +4065,7 @@ _LTECHO_EOF'
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+- if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
++ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+@@ -3102,6 +4089,18 @@ _LTECHO_EOF'
+
+ if test -f \"\$progdir/\$program\"; then"
+
++ # fixup the dll searchpath if we need to.
++ #
++ # Fix the DLL searchpath if we need to. Do this before prepending
++ # to shlibpath, because on Windows, both are PATH and uninstalled
++ # libraries must come first.
++ if test -n "$dllsearchpath"; then
++ $ECHO "\
++ # Add the dll search path components to the executable PATH
++ PATH=$dllsearchpath:\$PATH
++"
++ fi
++
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+@@ -3116,35 +4115,10 @@ _LTECHO_EOF'
+ "
+ fi
+
+- # fixup the dll searchpath if we need to.
+- if test -n "$dllsearchpath"; then
+- $ECHO "\
+- # Add the dll search path components to the executable PATH
+- PATH=$dllsearchpath:\$PATH
+-"
+- fi
+-
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+-"
+- case $host in
+- # Backslashes separate directories on plain windows
+- *-*-mingw | *-*-os2* | *-cegcc*)
+- $ECHO "\
+- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+-"
+- ;;
+-
+- *)
+- $ECHO "\
+- exec \"\$progdir/\$program\" \${1+\"\$@\"}
+-"
+- ;;
+- esac
+- $ECHO "\
+- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+- exit 1
++ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+@@ -3158,166 +4132,6 @@ fi\
+ }
+
+
+-# func_to_host_path arg
+-#
+-# Convert paths to host format when used with build tools.
+-# Intended for use with "native" mingw (where libtool itself
+-# is running under the msys shell), or in the following cross-
+-# build environments:
+-# $build $host
+-# mingw (msys) mingw [e.g. native]
+-# cygwin mingw
+-# *nix + wine mingw
+-# where wine is equipped with the `winepath' executable.
+-# In the native mingw case, the (msys) shell automatically
+-# converts paths for any non-msys applications it launches,
+-# but that facility isn't available from inside the cwrapper.
+-# Similar accommodations are necessary for $host mingw and
+-# $build cygwin. Calling this function does no harm for other
+-# $host/$build combinations not listed above.
+-#
+-# ARG is the path (on $build) that should be converted to
+-# the proper representation for $host. The result is stored
+-# in $func_to_host_path_result.
+-func_to_host_path ()
+-{
+- func_to_host_path_result="$1"
+- if test -n "$1"; then
+- case $host in
+- *mingw* )
+- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+- case $build in
+- *mingw* ) # actually, msys
+- # awkward: cmd appends spaces to result
+- func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
+- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+- ;;
+- *cygwin* )
+- func_to_host_path_result=`cygpath -w "$1" |
+- $SED -e "$lt_sed_naive_backslashify"`
+- ;;
+- * )
+- # Unfortunately, winepath does not exit with a non-zero
+- # error code, so we are forced to check the contents of
+- # stdout. On the other hand, if the command is not
+- # found, the shell will set an exit code of 127 and print
+- # *an error message* to stdout. So we must check for both
+- # error code of zero AND non-empty stdout, which explains
+- # the odd construction:
+- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+- func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
+- $SED -e "$lt_sed_naive_backslashify"`
+- else
+- # Allow warning below.
+- func_to_host_path_result=
+- fi
+- ;;
+- esac
+- if test -z "$func_to_host_path_result" ; then
+- func_error "Could not determine host path corresponding to"
+- func_error " \`$1'"
+- func_error "Continuing, but uninstalled executables may not work."
+- # Fallback:
+- func_to_host_path_result="$1"
+- fi
+- ;;
+- esac
+- fi
+-}
+-# end: func_to_host_path
+-
+-# func_to_host_pathlist arg
+-#
+-# Convert pathlists to host format when used with build tools.
+-# See func_to_host_path(), above. This function supports the
+-# following $build/$host combinations (but does no harm for
+-# combinations not listed here):
+-# $build $host
+-# mingw (msys) mingw [e.g. native]
+-# cygwin mingw
+-# *nix + wine mingw
+-#
+-# Path separators are also converted from $build format to
+-# $host format. If ARG begins or ends with a path separator
+-# character, it is preserved (but converted to $host format)
+-# on output.
+-#
+-# ARG is a pathlist (on $build) that should be converted to
+-# the proper representation on $host. The result is stored
+-# in $func_to_host_pathlist_result.
+-func_to_host_pathlist ()
+-{
+- func_to_host_pathlist_result="$1"
+- if test -n "$1"; then
+- case $host in
+- *mingw* )
+- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+- # Remove leading and trailing path separator characters from
+- # ARG. msys behavior is inconsistent here, cygpath turns them
+- # into '.;' and ';.', and winepath ignores them completely.
+- func_stripname : : "$1"
+- func_to_host_pathlist_tmp1=$func_stripname_result
+- case $build in
+- *mingw* ) # Actually, msys.
+- # Awkward: cmd appends spaces to result.
+- func_to_host_pathlist_result=`
+- ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
+- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+- ;;
+- *cygwin* )
+- func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
+- $SED -e "$lt_sed_naive_backslashify"`
+- ;;
+- * )
+- # unfortunately, winepath doesn't convert pathlists
+- func_to_host_pathlist_result=""
+- func_to_host_pathlist_oldIFS=$IFS
+- IFS=:
+- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+- IFS=$func_to_host_pathlist_oldIFS
+- if test -n "$func_to_host_pathlist_f" ; then
+- func_to_host_path "$func_to_host_pathlist_f"
+- if test -n "$func_to_host_path_result" ; then
+- if test -z "$func_to_host_pathlist_result" ; then
+- func_to_host_pathlist_result="$func_to_host_path_result"
+- else
+- func_append func_to_host_pathlist_result ";$func_to_host_path_result"
+- fi
+- fi
+- fi
+- done
+- IFS=$func_to_host_pathlist_oldIFS
+- ;;
+- esac
+- if test -z "$func_to_host_pathlist_result"; then
+- func_error "Could not determine the host path(s) corresponding to"
+- func_error " \`$1'"
+- func_error "Continuing, but uninstalled executables may not work."
+- # Fallback. This may break if $1 contains DOS-style drive
+- # specifications. The fix is not to complicate the expression
+- # below, but for the user to provide a working wine installation
+- # with winepath so that path translation in the cross-to-mingw
+- # case works properly.
+- lt_replace_pathsep_nix_to_dos="s|:|;|g"
+- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+- $SED -e "$lt_replace_pathsep_nix_to_dos"`
+- fi
+- # Now, add the leading and trailing path separators back
+- case "$1" in
+- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+- ;;
+- esac
+- case "$1" in
+- *: ) func_append func_to_host_pathlist_result ";"
+- ;;
+- esac
+- ;;
+- esac
+- fi
+-}
+-# end: func_to_host_pathlist
+-
+ # func_emit_cwrapperexe_src
+ # emit the source code for a wrapper executable on stdout
+ # Must ONLY be called from within func_mode_link because
+@@ -3334,10 +4148,6 @@ func_emit_cwrapperexe_src ()
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+-
+- Currently, it simply execs the wrapper *script* "$SHELL $output",
+- but could eventually absorb all of the scripts functionality and
+- exec $objdir/$outputname directly.
+ */
+ EOF
+ cat <<"EOF"
+@@ -3462,22 +4272,13 @@ int setenv (const char *, const char *, int);
+ if (stale) { free ((void *) stale); stale = 0; } \
+ } while (0)
+
+-#undef LTWRAPPER_DEBUGPRINTF
+-#if defined LT_DEBUGWRAPPER
+-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+-static void
+-ltwrapper_debugprintf (const char *fmt, ...)
+-{
+- va_list args;
+- va_start (args, fmt);
+- (void) vfprintf (stderr, fmt, args);
+- va_end (args);
+-}
++#if defined(LT_DEBUGWRAPPER)
++static int lt_debug = 1;
+ #else
+-# define LTWRAPPER_DEBUGPRINTF(args)
++static int lt_debug = 0;
+ #endif
+
+-const char *program_name = NULL;
++const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+ void *xmalloc (size_t num);
+ char *xstrdup (const char *string);
+@@ -3487,7 +4288,10 @@ char *chase_symlinks (const char *pathspec);
+ int make_executable (const char *path);
+ int check_executable (const char *path);
+ char *strendzap (char *str, const char *pat);
+-void lt_fatal (const char *message, ...);
++void lt_debugprintf (const char *file, int line, const char *fmt, ...);
++void lt_fatal (const char *file, int line, const char *message, ...);
++static const char *nonnull (const char *s);
++static const char *nonempty (const char *s);
+ void lt_setenv (const char *name, const char *value);
+ char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+ void lt_update_exe_path (const char *name, const char *value);
+@@ -3497,14 +4301,14 @@ void lt_dump_script (FILE *f);
+ EOF
+
+ cat <<EOF
+-const char * MAGIC_EXE = "$magic_exe";
++volatile const char * MAGIC_EXE = "$magic_exe";
+ const char * LIB_PATH_VARNAME = "$shlibpath_var";
+ EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+- func_to_host_pathlist "$temp_rpath"
++ func_to_host_path "$temp_rpath"
+ cat <<EOF
+-const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
++const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+ EOF
+ else
+ cat <<"EOF"
+@@ -3513,10 +4317,10 @@ EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+- func_to_host_pathlist "$dllsearchpath:"
++ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+ const char * EXE_PATH_VARNAME = "PATH";
+-const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
++const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+ EOF
+ else
+ cat <<"EOF"
+@@ -3539,12 +4343,10 @@ EOF
+ cat <<"EOF"
+
+ #define LTWRAPPER_OPTION_PREFIX "--lt-"
+-#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+-static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+ static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+-
+ static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
++static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+ int
+ main (int argc, char *argv[])
+@@ -3561,10 +4363,13 @@ main (int argc, char *argv[])
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+- LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+- LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
++ newargz = XMALLOC (char *, argc + 1);
+
+- /* very simple arg parsing; don't want to rely on getopt */
++ /* very simple arg parsing; don't want to rely on getopt
++ * also, copy all non cwrapper options to newargz, except
++ * argz[0], which is handled differently
++ */
++ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+@@ -3581,21 +4386,54 @@ EOF
+ lt_dump_script (stdout);
+ return 0;
+ }
++ if (strcmp (argv[i], debug_opt) == 0)
++ {
++ lt_debug = 1;
++ continue;
++ }
++ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
++ {
++ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
++ namespace, but it is not one of the ones we know about and
++ have already dealt with, above (inluding dump-script), then
++ report an error. Otherwise, targets might begin to believe
++ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
++ namespace. The first time any user complains about this, we'll
++ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
++ or a configure.ac-settable value.
++ */
++ lt_fatal (__FILE__, __LINE__,
++ "unrecognized %s option: '%s'",
++ ltwrapper_option_prefix, argv[i]);
++ }
++ /* otherwise ... */
++ newargz[++newargc] = xstrdup (argv[i]);
+ }
++ newargz[++newargc] = NULL;
++
++EOF
++ cat <<EOF
++ /* The GNU banner must be the first non-error debug message */
++ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
++EOF
++ cat <<"EOF"
++ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
++ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+- newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+- lt_fatal ("Couldn't find %s", argv[0]);
+- LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+- tmp_pathspec));
++ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
++ lt_debugprintf (__FILE__, __LINE__,
++ "(main) found exe (before symlink chase) at: %s\n",
++ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+- LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+- actual_cwrapper_path));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(main) found exe (after symlink chase) at: %s\n",
++ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+- actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
++ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+@@ -3613,8 +4451,9 @@ EOF
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+- LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+- target_name));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(main) libtool target name: %s\n",
++ target_name);
+ EOF
+
+ cat <<EOF
+@@ -3664,35 +4503,19 @@ EOF
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
++ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
++ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
++ because on Windows, both *_VARNAMEs are PATH but uninstalled
++ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
++ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+- newargc=0;
+- for (i = 1; i < argc; i++)
+- {
+- if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+- {
+- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+- namespace, but it is not one of the ones we know about and
+- have already dealt with, above (inluding dump-script), then
+- report an error. Otherwise, targets might begin to believe
+- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+- namespace. The first time any user complains about this, we'll
+- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+- or a configure.ac-settable value.
+- */
+- lt_fatal ("Unrecognized option in %s namespace: '%s'",
+- ltwrapper_option_prefix, argv[i]);
+- }
+- /* otherwise ... */
+- newargz[++newargc] = xstrdup (argv[i]);
+- }
+- newargz[++newargc] = NULL;
+-
+- LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
++ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
++ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+- LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
++ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
++ i, nonnull (newargz[i]));
+ }
+
+ EOF
+@@ -3706,7 +4529,9 @@ EOF
+ if (rval == -1)
+ {
+ /* failed to start process */
+- LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(main) failed to launch target \"%s\": %s\n",
++ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+@@ -3728,7 +4553,7 @@ xmalloc (size_t num)
+ {
+ void *p = (void *) malloc (num);
+ if (!p)
+- lt_fatal ("Memory exhausted");
++ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+ }
+@@ -3762,8 +4587,8 @@ check_executable (const char *path)
+ {
+ struct stat st;
+
+- LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
+- path ? (*path ? path : "EMPTY!") : "NULL!"));
++ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
++ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+@@ -3780,8 +4605,8 @@ make_executable (const char *path)
+ int rval = 0;
+ struct stat st;
+
+- LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
+- path ? (*path ? path : "EMPTY!") : "NULL!"));
++ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
++ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+@@ -3807,8 +4632,8 @@ find_executable (const char *wrapper)
+ int tmp_len;
+ char *concat_name;
+
+- LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
+- wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
++ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
++ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+@@ -3861,7 +4686,8 @@ find_executable (const char *wrapper)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+- lt_fatal ("getcwd failed");
++ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+@@ -3886,7 +4712,8 @@ find_executable (const char *wrapper)
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+- lt_fatal ("getcwd failed");
++ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+@@ -3912,8 +4739,9 @@ chase_symlinks (const char *pathspec)
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+- LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+- tmp_pathspec));
++ lt_debugprintf (__FILE__, __LINE__,
++ "checking path component for symlinks: %s\n",
++ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+@@ -3935,8 +4763,9 @@ chase_symlinks (const char *pathspec)
+ }
+ else
+ {
+- char *errstr = strerror (errno);
+- lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
++ lt_fatal (__FILE__, __LINE__,
++ "error accessing file \"%s\": %s",
++ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+@@ -3949,7 +4778,8 @@ chase_symlinks (const char *pathspec)
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+- lt_fatal ("Could not follow symlinks for %s", pathspec);
++ lt_fatal (__FILE__, __LINE__,
++ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+ #endif
+@@ -3975,11 +4805,25 @@ strendzap (char *str, const char *pat)
+ return str;
+ }
+
++void
++lt_debugprintf (const char *file, int line, const char *fmt, ...)
++{
++ va_list args;
++ if (lt_debug)
++ {
++ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
++ va_start (args, fmt);
++ (void) vfprintf (stderr, fmt, args);
++ va_end (args);
++ }
++}
++
+ static void
+-lt_error_core (int exit_status, const char *mode,
++lt_error_core (int exit_status, const char *file,
++ int line, const char *mode,
+ const char *message, va_list ap)
+ {
+- fprintf (stderr, "%s: %s: ", program_name, mode);
++ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+@@ -3988,20 +4832,32 @@ lt_error_core (int exit_status, const char *mode,
+ }
+
+ void
+-lt_fatal (const char *message, ...)
++lt_fatal (const char *file, int line, const char *message, ...)
+ {
+ va_list ap;
+ va_start (ap, message);
+- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
++ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+ }
+
++static const char *
++nonnull (const char *s)
++{
++ return s ? s : "(null)";
++}
++
++static const char *
++nonempty (const char *s)
++{
++ return (s && !*s) ? "(empty)" : nonnull (s);
++}
++
+ void
+ lt_setenv (const char *name, const char *value)
+ {
+- LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+- (name ? name : "<NULL>"),
+- (value ? value : "<NULL>")));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(lt_setenv) setting '%s' to '%s'\n",
++ nonnull (name), nonnull (value));
+ {
+ #ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+@@ -4049,9 +4905,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
+ void
+ lt_update_exe_path (const char *name, const char *value)
+ {
+- LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+- (name ? name : "<NULL>"),
+- (value ? value : "<NULL>")));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
++ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+@@ -4070,9 +4926,9 @@ lt_update_exe_path (const char *name, const char *value)
+ void
+ lt_update_lib_path (const char *name, const char *value)
+ {
+- LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+- (name ? name : "<NULL>"),
+- (value ? value : "<NULL>")));
++ lt_debugprintf (__FILE__, __LINE__,
++ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
++ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+@@ -4222,7 +5078,7 @@ EOF
+ func_win32_import_lib_p ()
+ {
+ $opt_debug
+- case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
++ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+@@ -4401,9 +5257,9 @@ func_mode_link ()
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+- dlfiles="$dlfiles $arg"
++ func_append dlfiles " $arg"
+ else
+- dlprefiles="$dlprefiles $arg"
++ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+@@ -4427,7 +5283,7 @@ func_mode_link ()
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
++ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+@@ -4446,7 +5302,7 @@ func_mode_link ()
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+-# moreargs="$moreargs $fil"
++# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+@@ -4475,7 +5331,7 @@ func_mode_link ()
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+- dlfiles="$dlfiles $pic_object"
++ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+@@ -4487,7 +5343,7 @@ func_mode_link ()
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+- dlprefiles="$dlprefiles $pic_object"
++ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+@@ -4557,12 +5413,12 @@ func_mode_link ()
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+- *) rpath="$rpath $arg" ;;
++ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+- *) xrpath="$xrpath $arg" ;;
++ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+@@ -4574,28 +5430,28 @@ func_mode_link ()
+ continue
+ ;;
+ weak)
+- weak_libs="$weak_libs $arg"
++ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+- linker_flags="$linker_flags $qarg"
+- compiler_flags="$compiler_flags $qarg"
++ func_append linker_flags " $qarg"
++ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+- compiler_flags="$compiler_flags $qarg"
++ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+- linker_flags="$linker_flags $qarg"
+- compiler_flags="$compiler_flags $wl$qarg"
++ func_append linker_flags " $qarg"
++ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+@@ -4686,15 +5542,16 @@ func_mode_link ()
+ ;;
+
+ -L*)
+- func_stripname '-L' '' "$arg"
+- dir=$func_stripname_result
+- if test -z "$dir"; then
++ func_stripname "-L" '' "$arg"
++ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
++ func_resolve_sysroot "$func_stripname_result"
++ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+@@ -4706,10 +5563,16 @@ func_mode_link ()
+ ;;
+ esac
+ case "$deplibs " in
+- *" -L$dir "*) ;;
++ *" -L$dir "* | *" $arg "*)
++ # Will only happen for absolute or sysroot arguments
++ ;;
+ *)
+- deplibs="$deplibs -L$dir"
+- lib_search_path="$lib_search_path $dir"
++ # Preserve sysroot, but never include relative directories
++ case $dir in
++ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
++ *) func_append deplibs " -L$dir" ;;
++ esac
++ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+@@ -4718,12 +5581,12 @@ func_mode_link ()
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+- *) dllsearchpath="$dllsearchpath:$dir";;
++ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+- *) dllsearchpath="$dllsearchpath:$testbindir";;
++ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+@@ -4747,7 +5610,7 @@ func_mode_link ()
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+- deplibs="$deplibs System.ltframework"
++ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+@@ -4758,9 +5621,6 @@ func_mode_link ()
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+- *-*-linux*)
+- test "X$arg" = "X-lc" && continue
+- ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+@@ -4770,7 +5630,7 @@ func_mode_link ()
+ ;;
+ esac
+ fi
+- deplibs="$deplibs $arg"
++ func_append deplibs " $arg"
+ continue
+ ;;
+
+@@ -4782,8 +5642,8 @@ func_mode_link ()
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+- -model|-arch|-isysroot)
+- compiler_flags="$compiler_flags $arg"
++ -model|-arch|-isysroot|--sysroot)
++ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+@@ -4791,12 +5651,12 @@ func_mode_link ()
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+- compiler_flags="$compiler_flags $arg"
++ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
++ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+@@ -4863,13 +5723,17 @@ func_mode_link ()
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
++ =*)
++ func_stripname '=' '' "$dir"
++ dir=$lt_sysroot$func_stripname_result
++ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+- *) xrpath="$xrpath $dir" ;;
++ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+@@ -4922,8 +5786,8 @@ func_mode_link ()
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+- arg="$arg $func_quote_for_eval_result"
+- compiler_flags="$compiler_flags $func_quote_for_eval_result"
++ func_append arg " $func_quote_for_eval_result"
++ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+@@ -4938,9 +5802,9 @@ func_mode_link ()
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+- arg="$arg $wl$func_quote_for_eval_result"
+- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+- linker_flags="$linker_flags $func_quote_for_eval_result"
++ func_append arg " $wl$func_quote_for_eval_result"
++ func_append compiler_flags " $wl$func_quote_for_eval_result"
++ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+@@ -4968,24 +5832,27 @@ func_mode_link ()
+ arg="$func_quote_for_eval_result"
+ ;;
+
+- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+- # -r[0-9][0-9]* specifies the processor on the SGI compiler
+- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+- # +DA*, +DD* enable 64-bit mode on the HP compiler
+- # -q* pass through compiler args for the IBM compiler
+- # -m*, -t[45]*, -txscale* pass through architecture-specific
+- # compiler args for GCC
+- # -F/path gives path to uninstalled frameworks, gcc on darwin
+- # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+- # @file GCC response files
+- # -tp=* Portland pgcc target processor selection
++ # Flags to be passed through unchanged, with rationale:
++ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
++ # -r[0-9][0-9]* specify processor for the SGI compiler
++ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
++ # +DA*, +DD* enable 64-bit mode for the HP compiler
++ # -q* compiler args for the IBM compiler
++ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
++ # -F/path path to uninstalled frameworks, gcc on darwin
++ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
++ # @file GCC response files
++ # -tp=* Portland pgcc target processor selection
++ # --sysroot=* for sysroot support
++ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
++ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
++ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+- compiler_flags="$compiler_flags $arg"
++ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+@@ -4997,7 +5864,7 @@ func_mode_link ()
+
+ *.$objext)
+ # A standard object.
+- objs="$objs $arg"
++ func_append objs " $arg"
+ ;;
+
+ *.lo)
+@@ -5028,7 +5895,7 @@ func_mode_link ()
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+- dlfiles="$dlfiles $pic_object"
++ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+@@ -5040,7 +5907,7 @@ func_mode_link ()
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+- dlprefiles="$dlprefiles $pic_object"
++ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+@@ -5085,24 +5952,25 @@ func_mode_link ()
+
+ *.$libext)
+ # An archive.
+- deplibs="$deplibs $arg"
+- old_deplibs="$old_deplibs $arg"
++ func_append deplibs " $arg"
++ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
++ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+- dlfiles="$dlfiles $arg"
++ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+- dlprefiles="$dlprefiles $arg"
++ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+- deplibs="$deplibs $arg"
++ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+@@ -5127,7 +5995,7 @@ func_mode_link ()
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+- eval "arg=\"$export_dynamic_flag_spec\""
++ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+@@ -5144,11 +6012,13 @@ func_mode_link ()
+ else
+ shlib_search_path=
+ fi
+- eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
+- eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
++ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
++ func_to_tool_file "$output_objdir/"
++ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+@@ -5169,12 +6039,12 @@ func_mode_link ()
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+- if $opt_duplicate_deps ; then
++ if $opt_preserve_dup_deps ; then
+ case "$libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+- libs="$libs $deplib"
++ func_append libs " $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+@@ -5187,9 +6057,9 @@ func_mode_link ()
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
++ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+- pre_post_deps="$pre_post_deps $pre_post_dep"
++ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+@@ -5256,8 +6126,9 @@ func_mode_link ()
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
++ func_resolve_sysroot "$lib"
+ case $lib in
+- *.la) func_source "$lib" ;;
++ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+@@ -5267,7 +6138,7 @@ func_mode_link ()
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+- *) deplibs="$deplibs $deplib" ;;
++ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+@@ -5288,11 +6159,11 @@ func_mode_link ()
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+- compiler_flags="$compiler_flags $deplib"
++ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+@@ -5377,7 +6248,7 @@ func_mode_link ()
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+@@ -5390,7 +6261,8 @@ func_mode_link ()
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+- newlib_search_path="$newlib_search_path $func_stripname_result"
++ func_resolve_sysroot "$func_stripname_result"
++ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+@@ -5404,7 +6276,8 @@ func_mode_link ()
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+- newlib_search_path="$newlib_search_path $func_stripname_result"
++ func_resolve_sysroot "$func_stripname_result"
++ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+@@ -5415,17 +6288,21 @@ func_mode_link ()
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+- dir=$func_stripname_result
++ func_resolve_sysroot "$func_stripname_result"
++ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+- *) xrpath="$xrpath $dir" ;;
++ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+- *.la) lib="$deplib" ;;
++ *.la)
++ func_resolve_sysroot "$deplib"
++ lib=$func_resolve_sysroot_result
++ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+@@ -5488,11 +6365,11 @@ func_mode_link ()
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+- newdlprefiles="$newdlprefiles $deplib"
++ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+- newdlfiles="$newdlfiles $deplib"
++ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+@@ -5538,7 +6415,7 @@ func_mode_link ()
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
++ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+@@ -5546,8 +6423,8 @@ func_mode_link ()
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++ test -n "$dlopen" && func_append dlfiles " $dlopen"
++ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+@@ -5558,20 +6435,20 @@ func_mode_link ()
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+- convenience="$convenience $ladir/$objdir/$old_library"
+- old_convenience="$old_convenience $ladir/$objdir/$old_library"
++ func_append convenience " $ladir/$objdir/$old_library"
++ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+- if $opt_duplicate_deps ; then
++ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+- tmp_libs="$tmp_libs $deplib"
++ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+@@ -5579,9 +6456,15 @@ func_mode_link ()
+
+ # Get the name of the library we link against.
+ linklib=
+- for l in $old_library $library_names; do
+- linklib="$l"
+- done
++ if test -n "$old_library" &&
++ { test "$prefer_static_libs" = yes ||
++ test "$prefer_static_libs,$installed" = "built,no"; }; then
++ linklib=$old_library
++ else
++ for l in $old_library $library_names; do
++ linklib="$l"
++ done
++ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+@@ -5598,9 +6481,9 @@ func_mode_link ()
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+- dlprefiles="$dlprefiles $lib $dependency_libs"
++ func_append dlprefiles " $lib $dependency_libs"
+ else
+- newdlfiles="$newdlfiles $lib"
++ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+@@ -5622,14 +6505,14 @@ func_mode_link ()
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+- dir="$libdir"
+- absdir="$libdir"
++ dir="$lt_sysroot$libdir"
++ absdir="$lt_sysroot$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+@@ -5637,12 +6520,12 @@ func_mode_link ()
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+- notinst_path="$notinst_path $abs_ladir"
++ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+- notinst_path="$notinst_path $abs_ladir"
++ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+@@ -5653,20 +6536,46 @@ func_mode_link ()
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+- # Prefer using a static library (so that no silly _DYNAMIC symbols
+- # are required to link).
+- if test -n "$old_library"; then
+- newdlprefiles="$newdlprefiles $dir/$old_library"
+- # Keep a list of preopened convenience libraries to check
+- # that they are being used correctly in the link pass.
+- test -z "$libdir" && \
+- dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+- # Otherwise, use the dlname, so that lt_dlopen finds it.
+- elif test -n "$dlname"; then
+- newdlprefiles="$newdlprefiles $dir/$dlname"
+- else
+- newdlprefiles="$newdlprefiles $dir/$linklib"
+- fi
++ case "$host" in
++ # special handling for platforms with PE-DLLs.
++ *cygwin* | *mingw* | *cegcc* )
++ # Linker will automatically link against shared library if both
++ # static and shared are present. Therefore, ensure we extract
++ # symbols from the import library if a shared library is present
++ # (otherwise, the dlopen module name will be incorrect). We do
++ # this by putting the import library name into $newdlprefiles.
++ # We recover the dlopen module name by 'saving' the la file
++ # name in a special purpose variable, and (later) extracting the
++ # dlname from the la file.
++ if test -n "$dlname"; then
++ func_tr_sh "$dir/$linklib"
++ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
++ func_append newdlprefiles " $dir/$linklib"
++ else
++ func_append newdlprefiles " $dir/$old_library"
++ # Keep a list of preopened convenience libraries to check
++ # that they are being used correctly in the link pass.
++ test -z "$libdir" && \
++ func_append dlpreconveniencelibs " $dir/$old_library"
++ fi
++ ;;
++ * )
++ # Prefer using a static library (so that no silly _DYNAMIC symbols
++ # are required to link).
++ if test -n "$old_library"; then
++ func_append newdlprefiles " $dir/$old_library"
++ # Keep a list of preopened convenience libraries to check
++ # that they are being used correctly in the link pass.
++ test -z "$libdir" && \
++ func_append dlpreconveniencelibs " $dir/$old_library"
++ # Otherwise, use the dlname, so that lt_dlopen finds it.
++ elif test -n "$dlname"; then
++ func_append newdlprefiles " $dir/$dlname"
++ else
++ func_append newdlprefiles " $dir/$linklib"
++ fi
++ ;;
++ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+@@ -5684,7 +6593,7 @@ func_mode_link ()
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+- newlib_search_path="$newlib_search_path $ladir"
++ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+@@ -5697,7 +6606,8 @@ func_mode_link ()
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+- newlib_search_path="$newlib_search_path $func_stripname_result"
++ func_resolve_sysroot "$func_stripname_result"
++ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+@@ -5708,12 +6618,12 @@ func_mode_link ()
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+- if $opt_duplicate_deps ; then
++ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+- tmp_libs="$tmp_libs $deplib"
++ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+@@ -5728,7 +6638,7 @@ func_mode_link ()
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+- *) temp_rpath="$temp_rpath$absdir:" ;;
++ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+@@ -5740,7 +6650,7 @@ func_mode_link ()
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+- *) compile_rpath="$compile_rpath $absdir"
++ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+@@ -5749,7 +6659,7 @@ func_mode_link ()
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+- *) finalize_rpath="$finalize_rpath $libdir"
++ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+@@ -5774,12 +6684,12 @@ func_mode_link ()
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+- notinst_deplibs="$notinst_deplibs $lib"
++ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+- notinst_deplibs="$notinst_deplibs $lib"
++ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+@@ -5814,7 +6724,7 @@ func_mode_link ()
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+- *) compile_rpath="$compile_rpath $absdir"
++ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+@@ -5823,7 +6733,7 @@ func_mode_link ()
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+- *) finalize_rpath="$finalize_rpath $libdir"
++ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+@@ -5835,7 +6745,7 @@ func_mode_link ()
+ shift
+ realname="$1"
+ shift
+- eval "libname=\"$libname_spec\""
++ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+@@ -5848,7 +6758,7 @@ func_mode_link ()
+ versuffix="-$major"
+ ;;
+ esac
+- eval "soname=\"$soname_spec\""
++ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+@@ -5877,7 +6787,7 @@ func_mode_link ()
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+- if test "$linkmode" = prog || test "$mode" != relink; then
++ if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+@@ -5933,7 +6843,7 @@ func_mode_link ()
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+- add_dir="$add_dir -L$inst_prefix_dir$libdir"
++ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+@@ -5955,7 +6865,7 @@ func_mode_link ()
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+@@ -5969,13 +6879,13 @@ func_mode_link ()
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+- if test "$linkmode" = prog || test "$mode" = relink; then
++ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+@@ -5989,7 +6899,7 @@ func_mode_link ()
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+@@ -6001,12 +6911,12 @@ func_mode_link ()
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+- add_dir="-L$libdir"
++ add_dir="-L$lt_sysroot$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+- add_dir="$add_dir -L$inst_prefix_dir$libdir"
++ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+@@ -6083,27 +6993,33 @@ func_mode_link ()
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+- *) xrpath="$xrpath $temp_xrpath";;
++ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+- *) temp_deplibs="$temp_deplibs $libdir";;
++ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+- newlib_search_path="$newlib_search_path $absdir"
++ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+- if $opt_duplicate_deps ; then
++ case $deplib in
++ -L*) func_stripname '-L' '' "$deplib"
++ func_resolve_sysroot "$func_stripname_result";;
++ *) func_resolve_sysroot "$deplib" ;;
++ esac
++ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++ *" $func_resolve_sysroot_result "*)
++ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+- tmp_libs="$tmp_libs $deplib"
++ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+@@ -6113,8 +7029,10 @@ func_mode_link ()
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
++ func_resolve_sysroot "$deplib"
++ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+- dir="$func_dirname_result"
++ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+@@ -6130,7 +7048,7 @@ func_mode_link ()
+ case $host in
+ *-*-darwin*)
+ depdepl=
+- deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
++ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+@@ -6141,8 +7059,8 @@ func_mode_link ()
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
++ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
++ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+@@ -6152,7 +7070,7 @@ func_mode_link ()
+ ;;
+ esac
+ else
+- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+@@ -6192,7 +7110,7 @@ func_mode_link ()
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+- *) lib_search_path="$lib_search_path $dir" ;;
++ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+@@ -6205,7 +7123,7 @@ func_mode_link ()
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+- eval tmp_libs=\$$var
++ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+@@ -6250,13 +7168,13 @@ func_mode_link ()
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+- *) tmp_libs="$tmp_libs $deplib" ;;
++ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+- *) tmp_libs="$tmp_libs $deplib" ;;
++ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+- eval $var=\$tmp_libs
++ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+@@ -6269,7 +7187,7 @@ func_mode_link ()
+ ;;
+ esac
+ if test -n "$i" ; then
+- tmp_libs="$tmp_libs $i"
++ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+@@ -6310,7 +7228,7 @@ func_mode_link ()
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+- objs="$objs$old_deplibs"
++ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+@@ -6319,8 +7237,8 @@ func_mode_link ()
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+- eval "shared_ext=\"$shrext_cmds\""
+- eval "libname=\"$libname_spec\""
++ eval shared_ext=\"$shrext_cmds\"
++ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+@@ -6330,8 +7248,8 @@ func_mode_link ()
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+- eval "shared_ext=\"$shrext_cmds\""
+- eval "libname=\"$libname_spec\""
++ eval shared_ext=\"$shrext_cmds\"
++ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+@@ -6346,7 +7264,7 @@ func_mode_link ()
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+- libobjs="$libobjs $objs"
++ func_append libobjs " $objs"
+ fi
+ fi
+
+@@ -6544,7 +7462,7 @@ func_mode_link ()
+ done
+
+ # Make executables depend on our current version.
+- verstring="$verstring:${current}.0"
++ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+@@ -6612,10 +7530,10 @@ func_mode_link ()
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+- libobjs="$libobjs $symfileobj"
++ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+- if test "$mode" != relink; then
++ if test "$opt_mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+@@ -6631,7 +7549,7 @@ func_mode_link ()
+ continue
+ fi
+ fi
+- removelist="$removelist $p"
++ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+@@ -6642,7 +7560,7 @@ func_mode_link ()
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+- oldlibs="$oldlibs $output_objdir/$libname.$libext"
++ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+@@ -6659,10 +7577,11 @@ func_mode_link ()
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+- temp_xrpath="$temp_xrpath -R$libdir"
++ func_replace_sysroot "$libdir"
++ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+- *) finalize_rpath="$finalize_rpath $libdir" ;;
++ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+@@ -6676,7 +7595,7 @@ func_mode_link ()
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+- *) dlfiles="$dlfiles $lib" ;;
++ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+@@ -6686,7 +7605,7 @@ func_mode_link ()
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+- *) dlprefiles="$dlprefiles $lib" ;;
++ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+@@ -6698,7 +7617,7 @@ func_mode_link ()
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+- deplibs="$deplibs System.ltframework"
++ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+@@ -6715,7 +7634,7 @@ func_mode_link ()
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+- deplibs="$deplibs -lc"
++ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+@@ -6764,18 +7683,18 @@ EOF
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+- eval "libname=\"$libname_spec\""
+- eval "deplib_matches=\"$library_names_spec\""
++ libname=`eval "\\$ECHO \"$libname_spec\""`
++ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+@@ -6789,7 +7708,7 @@ EOF
+ fi
+ ;;
+ *)
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+@@ -6807,18 +7726,18 @@ EOF
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+- eval "libname=\"$libname_spec\""
+- eval "deplib_matches=\"$library_names_spec\""
++ libname=`eval "\\$ECHO \"$libname_spec\""`
++ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+@@ -6840,7 +7759,7 @@ EOF
+ fi
+ ;;
+ *)
+- newdeplibs="$newdeplibs $i"
++ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+@@ -6857,15 +7776,27 @@ EOF
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+- eval "libname=\"$libname_spec\""
++ libname=`eval "\\$ECHO \"$libname_spec\""`
++ if test -n "$file_magic_glob"; then
++ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
++ else
++ libnameglob=$libname
++ fi
++ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++ if test "$want_nocaseglob" = yes; then
++ shopt -s nocaseglob
++ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++ $nocaseglob
++ else
++ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+@@ -6885,10 +7816,10 @@ EOF
+ *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+- if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
++ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+@@ -6913,7 +7844,7 @@ EOF
+ ;;
+ *)
+ # Add a -L argument.
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+@@ -6929,20 +7860,20 @@ EOF
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+- eval "libname=\"$libname_spec\""
++ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+@@ -6967,7 +7898,7 @@ EOF
+ ;;
+ *)
+ # Add a -L argument.
+- newdeplibs="$newdeplibs $a_deplib"
++ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+@@ -7071,7 +8002,7 @@ EOF
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+- new_libs="$new_libs -L$path/$objdir" ;;
++ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+@@ -7081,10 +8012,10 @@ EOF
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+- *) new_libs="$new_libs $deplib" ;;
++ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+- *) new_libs="$new_libs $deplib" ;;
++ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+@@ -7101,10 +8032,12 @@ EOF
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+- test "$mode" != relink && rpath="$compile_rpath$rpath"
++ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+@@ -7113,18 +8046,18 @@ EOF
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+- eval "flag=\"$hardcode_libdir_flag_spec\""
+- dep_rpath="$dep_rpath $flag"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+- *) perm_rpath="$perm_rpath $libdir" ;;
++ *) func_apped perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+@@ -7133,40 +8066,38 @@ EOF
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+- eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
++ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
++ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+- rpath="$rpath$dir:"
++ func_append rpath "$dir:"
+ done
+- eval $runpath_var=\$rpath\$$runpath_var
+- export $runpath_var
++ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+- eval $shlibpath_var=\$shlibpath\$$shlibpath_var
+- export $shlibpath_var
++ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+- eval "shared_ext=\"$shrext_cmds\""
+- eval "library_names=\"$library_names_spec\""
++ eval shared_ext=\"$shrext_cmds\"
++ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+- eval "soname=\"$soname_spec\""
++ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+@@ -7178,7 +8109,7 @@ EOF
+ linknames=
+ for link
+ do
+- linknames="$linknames $link"
++ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+@@ -7189,7 +8120,7 @@ EOF
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+- delfiles="$delfiles $export_symbols"
++ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+@@ -7220,13 +8151,45 @@ EOF
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+- for cmd in $cmds; do
++ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+- eval "cmd=\"$cmd\""
+- func_len " $cmd"
+- len=$func_len_result
+- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
++ # Take the normal branch if the nm_file_list_spec branch
++ # doesn't work or if tool conversion is not needed.
++ case $nm_file_list_spec~$to_tool_file_cmd in
++ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
++ try_normal_branch=yes
++ eval cmd=\"$cmd1\"
++ func_len " $cmd"
++ len=$func_len_result
++ ;;
++ *)
++ try_normal_branch=no
++ ;;
++ esac
++ if test "$try_normal_branch" = yes \
++ && { test "$len" -lt "$max_cmd_len" \
++ || test "$max_cmd_len" -le -1; }
++ then
++ func_show_eval "$cmd" 'exit $?'
++ skipped_export=false
++ elif test -n "$nm_file_list_spec"; then
++ func_basename "$output"
++ output_la=$func_basename_result
++ save_libobjs=$libobjs
++ save_output=$output
++ output=${output_objdir}/${output_la}.nm
++ func_to_tool_file "$output"
++ libobjs=$nm_file_list_spec$func_to_tool_file_result
++ func_append delfiles " $output"
++ func_verbose "creating $NM input file list: $output"
++ for obj in $save_libobjs; do
++ func_to_tool_file "$obj"
++ $ECHO "$func_to_tool_file_result"
++ done > "$output"
++ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
++ output=$save_output
++ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+@@ -7248,7 +8211,7 @@ EOF
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+- $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+@@ -7260,7 +8223,7 @@ EOF
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+@@ -7270,7 +8233,7 @@ EOF
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+- tmp_deplibs="$tmp_deplibs $test_deplib"
++ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+@@ -7286,43 +8249,43 @@ EOF
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+- eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+- libobjs="$libobjs $func_extract_archives_result"
++ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+- eval "flag=\"$thread_safe_flag_spec\""
+- linker_flags="$linker_flags $flag"
++ eval flag=\"$thread_safe_flag_spec\"
++ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+- if test "$mode" = relink; then
+- $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
++ if test "$opt_mode" = relink; then
++ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+- eval "test_cmds=\"$module_expsym_cmds\""
++ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+- eval "test_cmds=\"$module_cmds\""
++ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+- eval "test_cmds=\"$archive_expsym_cmds\""
++ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+- eval "test_cmds=\"$archive_cmds\""
++ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+@@ -7366,10 +8329,13 @@ EOF
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+- $ECHO "$obj" >> $output
++ func_to_tool_file "$obj"
++ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+- delfiles="$delfiles $output"
++ func_append delfiles " $output"
++ func_to_tool_file "$output"
++ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+@@ -7383,15 +8349,17 @@ EOF
+ fi
+ for obj
+ do
+- $ECHO "$obj" >> $output
++ func_to_tool_file "$obj"
++ $ECHO "$func_to_tool_file_result" >> $output
+ done
+- delfiles="$delfiles $output"
+- output=$firstobj\"$file_list_spec$output\"
++ func_append delfiles " $output"
++ func_to_tool_file "$output"
++ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+- eval "test_cmds=\"$reload_cmds\""
++ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+@@ -7411,12 +8379,12 @@ EOF
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+- eval "concat_cmds=\"$reload_cmds\""
++ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+- eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
++ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+@@ -7433,11 +8401,11 @@ EOF
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+- eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
++ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+- eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
++ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+- delfiles="$delfiles $output"
++ func_append delfiles " $output"
+
+ else
+ output=
+@@ -7450,9 +8418,9 @@ EOF
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+- eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
++ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+- eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
++ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+@@ -7471,7 +8439,7 @@ EOF
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+- if test "$mode" = relink; then
++ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+@@ -7492,7 +8460,7 @@ EOF
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+- $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+@@ -7504,7 +8472,7 @@ EOF
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+@@ -7515,7 +8483,7 @@ EOF
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+- eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+@@ -7539,23 +8507,23 @@ EOF
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+- eval "cmds=\"\$cmds~\$RM $delfiles\""
++ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+- libobjs="$libobjs $func_extract_archives_result"
++ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+- eval "cmd=\"$cmd\""
++ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+@@ -7564,7 +8532,7 @@ EOF
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+- if test "$mode" = relink; then
++ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+@@ -7576,8 +8544,8 @@ EOF
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+- if test "$mode" = relink; then
+- $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
++ if test "$opt_mode" = relink; then
++ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+@@ -7656,17 +8624,20 @@ EOF
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+- eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
++ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
++ # If we're not building shared, we need to use non_pic_objs
++ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
++
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+@@ -7690,7 +8661,7 @@ EOF
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+- # $opt_dry_run || echo timestamp > $libobj || exit $?
++ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+@@ -7740,8 +8711,8 @@ EOF
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+- compile_command="$compile_command ${wl}-bind_at_load"
+- finalize_command="$finalize_command ${wl}-bind_at_load"
++ func_append compile_command " ${wl}-bind_at_load"
++ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+@@ -7761,7 +8732,7 @@ EOF
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+- new_libs="$new_libs -L$path/$objdir" ;;
++ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+@@ -7771,17 +8742,17 @@ EOF
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+- *) new_libs="$new_libs $deplib" ;;
++ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+- *) new_libs="$new_libs $deplib" ;;
++ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+- compile_command="$compile_command $compile_deplibs"
+- finalize_command="$finalize_command $finalize_deplibs"
++ func_append compile_command " $compile_deplibs"
++ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+@@ -7789,7 +8760,7 @@ EOF
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+- *) finalize_rpath="$finalize_rpath $libdir" ;;
++ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+@@ -7808,18 +8779,18 @@ EOF
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+- eval "flag=\"$hardcode_libdir_flag_spec\""
+- rpath="$rpath $flag"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+- *) perm_rpath="$perm_rpath $libdir" ;;
++ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+@@ -7828,12 +8799,12 @@ EOF
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+- *) dllsearchpath="$dllsearchpath:$libdir";;
++ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+- *) dllsearchpath="$dllsearchpath:$testbindir";;
++ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+@@ -7842,7 +8813,7 @@ EOF
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+- eval "rpath=\" $hardcode_libdir_flag_spec\""
++ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+@@ -7859,18 +8830,18 @@ EOF
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+- eval "flag=\"$hardcode_libdir_flag_spec\""
+- rpath="$rpath $flag"
++ eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
++ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+@@ -7878,7 +8849,7 @@ EOF
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+- eval "rpath=\" $hardcode_libdir_flag_spec\""
++ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+@@ -7921,6 +8892,12 @@ EOF
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
++ if test -n "$postlink_cmds"; then
++ func_to_tool_file "$output"
++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++ func_execute_cmds "$postlink_cmds" 'exit $?'
++ fi
++
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+@@ -7943,7 +8920,7 @@ EOF
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+- rpath="$rpath$dir:"
++ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+@@ -7951,7 +8928,7 @@ EOF
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+- rpath="$rpath$dir:"
++ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+@@ -7966,6 +8943,13 @@ EOF
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
++
++ if test -n "$postlink_cmds"; then
++ func_to_tool_file "$output"
++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++ func_execute_cmds "$postlink_cmds" 'exit $?'
++ fi
++
+ exit $EXIT_SUCCESS
+ fi
+
+@@ -7999,6 +8983,12 @@ EOF
+
+ func_show_eval "$link_command" 'exit $?'
+
++ if test -n "$postlink_cmds"; then
++ func_to_tool_file "$output_objdir/$outputname"
++ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++ func_execute_cmds "$postlink_cmds" 'exit $?'
++ fi
++
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+@@ -8096,7 +9086,7 @@ EOF
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+- oldobjs="$oldobjs $symfileobj"
++ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+@@ -8104,10 +9094,10 @@ EOF
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+- oldobjs="$oldobjs $func_extract_archives_result"
++ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+@@ -8118,10 +9108,10 @@ EOF
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+- oldobjs="$oldobjs $func_extract_archives_result"
++ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+@@ -8139,7 +9129,7 @@ EOF
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+- generated="$generated $gentop"
++ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+@@ -8163,18 +9153,28 @@ EOF
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+- oldobjs="$oldobjs $gentop/$newobj"
++ func_append oldobjs " $gentop/$newobj"
+ ;;
+- *) oldobjs="$oldobjs $obj" ;;
++ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+- eval "cmds=\"$old_archive_cmds\""
++ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
++ elif test -n "$archiver_list_spec"; then
++ func_verbose "using command file archive linking..."
++ for obj in $oldobjs
++ do
++ func_to_tool_file "$obj"
++ $ECHO "$func_to_tool_file_result"
++ done > $output_objdir/$libname.libcmd
++ func_to_tool_file "$output_objdir/$libname.libcmd"
++ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
++ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+@@ -8189,7 +9189,7 @@ EOF
+ do
+ last_oldobj=$obj
+ done
+- eval "test_cmds=\"$old_archive_cmds\""
++ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+@@ -8208,7 +9208,7 @@ EOF
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+- eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
++ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+@@ -8216,9 +9216,9 @@ EOF
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+- eval "cmds=\"\$concat_cmds\""
++ eval cmds=\"\$concat_cmds\"
+ else
+- eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
++ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+@@ -8268,12 +9268,23 @@ EOF
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++ func_resolve_sysroot "$deplib"
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+- newdependency_libs="$newdependency_libs $libdir/$name"
++ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
++ ;;
++ -L*)
++ func_stripname -L '' "$deplib"
++ func_replace_sysroot "$func_stripname_result"
++ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+- *) newdependency_libs="$newdependency_libs $deplib" ;;
++ -R*)
++ func_stripname -R '' "$deplib"
++ func_replace_sysroot "$func_stripname_result"
++ func_append newdependency_libs " -R$func_replace_sysroot_result"
++ ;;
++ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+@@ -8284,12 +9295,14 @@ EOF
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ func_resolve_sysroot "$lib"
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
++
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+- newdlfiles="$newdlfiles $libdir/$name"
++ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+- *) newdlfiles="$newdlfiles $lib" ;;
++ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+@@ -8303,10 +9316,11 @@ EOF
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+- libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++ func_resolve_sysroot "$lib"
++ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+- newdlprefiles="$newdlprefiles $libdir/$name"
++ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+@@ -8318,7 +9332,7 @@ EOF
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+- newdlfiles="$newdlfiles $abs"
++ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+@@ -8327,7 +9341,7 @@ EOF
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+- newdlprefiles="$newdlprefiles $abs"
++ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+@@ -8412,7 +9426,7 @@ relink_command=\"$relink_command\""
+ exit $EXIT_SUCCESS
+ }
+
+-{ test "$mode" = link || test "$mode" = relink; } &&
++{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+@@ -8432,9 +9446,9 @@ func_mode_uninstall ()
+ for arg
+ do
+ case $arg in
+- -f) RM="$RM $arg"; rmforce=yes ;;
+- -*) RM="$RM $arg" ;;
+- *) files="$files $arg" ;;
++ -f) func_append RM " $arg"; rmforce=yes ;;
++ -*) func_append RM " $arg" ;;
++ *) func_append files " $arg" ;;
+ esac
+ done
+
+@@ -8443,24 +9457,23 @@ func_mode_uninstall ()
+
+ rmdirs=
+
+- origobjdir="$objdir"
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+- objdir="$origobjdir"
++ odir="$objdir"
+ else
+- objdir="$dir/$origobjdir"
++ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+- test "$mode" = uninstall && objdir="$dir"
++ test "$opt_mode" = uninstall && odir="$dir"
+
+- # Remember objdir for removal later, being careful to avoid duplicates
+- if test "$mode" = clean; then
++ # Remember odir for removal later, being careful to avoid duplicates
++ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+- *" $objdir "*) ;;
+- *) rmdirs="$rmdirs $objdir" ;;
++ *" $odir "*) ;;
++ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+@@ -8486,18 +9499,17 @@ func_mode_uninstall ()
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+- rmfiles="$rmfiles $objdir/$n"
++ func_append rmfiles " $odir/$n"
+ done
+- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+- case "$mode" in
++ case "$opt_mode" in
+ clean)
+- case " $library_names " in
+- # " " in the beginning catches empty $dlname
++ case " $library_names " in
+ *" $dlname "*) ;;
+- *) rmfiles="$rmfiles $objdir/$dlname" ;;
++ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
++ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+@@ -8525,19 +9537,19 @@ func_mode_uninstall ()
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+- rmfiles="$rmfiles $dir/$pic_object"
++ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+- rmfiles="$rmfiles $dir/$non_pic_object"
++ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+- if test "$mode" = clean ; then
++ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+@@ -8547,7 +9559,7 @@ func_mode_uninstall ()
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+- rmfiles="$rmfiles $file"
++ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+@@ -8556,7 +9568,7 @@ func_mode_uninstall ()
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+- rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
++ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+@@ -8564,12 +9576,12 @@ func_mode_uninstall ()
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+- rmfiles="$rmfiles $objdir/lt-$name"
++ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
++ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+@@ -8577,7 +9589,6 @@ func_mode_uninstall ()
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+- objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+@@ -8589,16 +9600,16 @@ func_mode_uninstall ()
+ exit $exit_status
+ }
+
+-{ test "$mode" = uninstall || test "$mode" = clean; } &&
++{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+-test -z "$mode" && {
++test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+ }
+
+ test -z "$exec_cmd" && \
+- func_fatal_help "invalid operation mode \`$mode'"
++ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+ if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+diff --git a/ltoptions.m4 b/ltoptions.m4
+index 5ef12ced2a..17cfd51c0b 100644
+--- a/ltoptions.m4
++++ b/ltoptions.m4
+@@ -8,7 +8,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+
+-# serial 6 ltoptions.m4
++# serial 7 ltoptions.m4
+
+ # This is to help aclocal find these macros, as it can't see m4_define.
+ AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+diff --git a/ltversion.m4 b/ltversion.m4
+index bf87f77132..9c7b5d4118 100644
+--- a/ltversion.m4
++++ b/ltversion.m4
+@@ -7,17 +7,17 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+
+-# Generated from ltversion.in.
++# @configure_input@
+
+-# serial 3134 ltversion.m4
++# serial 3293 ltversion.m4
+ # This file is part of GNU Libtool
+
+-m4_define([LT_PACKAGE_VERSION], [2.2.7a])
+-m4_define([LT_PACKAGE_REVISION], [1.3134])
++m4_define([LT_PACKAGE_VERSION], [2.4])
++m4_define([LT_PACKAGE_REVISION], [1.3293])
+
+ AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.2.7a'
+-macro_revision='1.3134'
++[macro_version='2.4'
++macro_revision='1.3293'
+ _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+ _LT_DECL(, macro_revision, 0)
+ ])
+diff --git a/lt~obsolete.m4 b/lt~obsolete.m4
+index bf92b5e079..c573da90c5 100644
+--- a/lt~obsolete.m4
++++ b/lt~obsolete.m4
+@@ -7,7 +7,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+
+-# serial 4 lt~obsolete.m4
++# serial 5 lt~obsolete.m4
+
+ # These exist entirely to fool aclocal when bootstrapping libtool.
+ #
+diff --git a/opcodes/configure b/opcodes/configure
+index 4f29887098..2127d39288 100755
+--- a/opcodes/configure
++++ b/opcodes/configure
+@@ -650,6 +650,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -763,6 +766,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_targets
+ enable_werror
+@@ -1423,6 +1427,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -5115,8 +5121,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -5156,7 +5162,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5842,8 +5848,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -5892,6 +5898,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5908,6 +5988,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6076,7 +6161,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -6230,6 +6316,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6243,11 +6344,164 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
+
+
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6263,7 +6517,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6283,11 +6537,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6303,7 +6561,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -6322,6 +6580,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -6333,16 +6595,72 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
+
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
+
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
+
+
+
+@@ -6684,8 +7002,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6721,6 +7039,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -6762,6 +7081,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6773,7 +7104,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -6799,8 +7130,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6810,8 +7141,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -6848,6 +7179,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
+
+
+
+@@ -6864,6 +7205,45 @@ fi
+
+
+
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -7075,6 +7455,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -7638,6 +8135,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7803,7 +8302,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7892,7 +8392,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8190,8 +8690,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -8357,6 +8855,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -8419,7 +8923,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -8476,13 +8980,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8543,6 +9051,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8893,7 +9406,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8992,12 +9506,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -9011,8 +9525,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -9030,8 +9544,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9077,8 +9591,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -9208,7 +9722,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9221,22 +9741,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9248,7 +9775,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+ int
+@@ -9261,22 +9794,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -9321,20 +9861,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -9395,7 +9978,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -9403,7 +9986,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -9419,7 +10002,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -9443,10 +10026,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -9525,23 +10108,36 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9626,7 +10222,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -9645,9 +10241,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -10223,8 +10819,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -10257,13 +10854,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -10355,7 +11010,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -11195,10 +11850,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11301,10 +11956,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12543,7 +13198,7 @@ if test "$enable_shared" = "yes"; then
+ # since libbfd may not pull in the entirety of libiberty.
+ x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ if test -n "$x"; then
+- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+ fi
+
+ case "${host}" in
+@@ -13520,13 +14175,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -13541,14 +14203,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -13581,12 +14246,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13641,8 +14306,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13652,12 +14322,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13673,7 +14345,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13709,6 +14380,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -14465,7 +15137,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -14568,19 +15241,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -14610,6 +15306,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -14619,6 +15321,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -14733,12 +15438,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -14825,9 +15530,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -14843,6 +15545,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -14875,210 +15580,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+diff --git a/opcodes/configure.ac b/opcodes/configure.ac
+index b07f3f3629..5a32d9b1fc 100644
+--- a/opcodes/configure.ac
++++ b/opcodes/configure.ac
+@@ -167,7 +167,7 @@ changequote(,)dnl
+ x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+ if test -n "$x"; then
+- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++ SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+ fi
+
+ case "${host}" in
+diff --git a/zlib/configure b/zlib/configure
+index dc2d9ed383..ed9a492f5c 100755
+--- a/zlib/configure
++++ b/zlib/configure
+@@ -614,8 +614,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -737,6 +740,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_host_shared
+ '
+@@ -1385,6 +1389,8 @@ Optional Packages:
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
++ --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++ (or the compiler's sysroot if not specified).
+
+ Some influential environment variables:
+ CC C compiler command
+@@ -3910,8 +3916,8 @@ esac
+
+
+
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+
+
+
+@@ -3951,7 +3957,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -4767,8 +4773,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+- = c,a/b,, \
++ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+@@ -4817,6 +4823,80 @@ esac
+
+
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++ ;;
++ esac
++ ;;
++ *-*-cygwin* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++ ;;
++ *-*-cygwin* )
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++ * ) # otherwise, assume *nix
++ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++ ;;
++ esac
++ ;;
++ * ) # unhandled hosts (and "normal" native builds)
++ lt_cv_to_host_file_cmd=func_convert_file_noop
++ ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++ *-*-mingw* )
++ case $build in
++ *-*-mingw* ) # actually msys
++ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++ ;;
++ esac
++ ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -4833,6 +4913,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++ cygwin* | mingw* | pw32* | cegcc*)
++ if test "$GCC" != yes; then
++ reload_cmds=false
++ fi
++ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5001,7 +5086,8 @@ mingw* | pw32*)
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++ # Keep this pattern in sync with the one in func_win32_libid.
++ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+@@ -5155,6 +5241,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++ case $host_os in
++ mingw* | pw32*)
++ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++ want_nocaseglob=yes
++ else
++ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++ fi
++ ;;
++ esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -5168,11 +5269,165 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
++
++
++
++
++
++
++
++
++
++
+
+
+ if test -n "$ac_tool_prefix"; then
+- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$DLLTOOL"; then
++ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++ ac_ct_DLLTOOL=$DLLTOOL
++ # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_DLLTOOL"; then
++ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_DLLTOOL" = x; then
++ DLLTOOL="false"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ DLLTOOL=$ac_ct_DLLTOOL
++ fi
++else
++ DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++ # two different shell functions defined in ltmain.sh
++ # decide which to use based on capabilities of $DLLTOOL
++ case `$DLLTOOL --help 2>&1` in
++ *--identify-strict*)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++ ;;
++ *)
++ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++ ;;
++ esac
++ ;;
++*)
++ # fallback: assume linklib IS sharedlib
++ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++ ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++ for ac_prog in ar
++ do
++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -5188,7 +5443,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_AR="${ac_tool_prefix}ar"
++ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -5208,11 +5463,15 @@ $as_echo "no" >&6; }
+ fi
+
+
++ test -n "$AR" && break
++ done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+ ac_ct_AR=$AR
+- # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++ for ac_prog in ar
++do
++ # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -5228,7 +5487,7 @@ do
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+- ac_cv_prog_ac_ct_AR="ar"
++ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+@@ -5247,6 +5506,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+
++
++ test -n "$ac_ct_AR" && break
++done
++
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+@@ -5258,16 +5521,72 @@ ac_tool_warned=yes ;;
+ esac
+ AR=$ac_ct_AR
+ fi
+-else
+- AR="$ac_cv_prog_AR"
+ fi
+
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_ar_at_file=no
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++int
++main ()
++{
+
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++ echo conftest.$ac_objext > conftest.lst
++ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -eq 0; then
++ # Ensure the archiver fails upon bogus file names.
++ rm -f conftest.$ac_objext libconftest.a
++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++ (eval $lt_ar_try) 2>&5
++ ac_status=$?
++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++ test $ac_status = 0; }
++ if test "$ac_status" -ne 0; then
++ lt_cv_ar_at_file=@
++ fi
++ fi
++ rm -f conftest.* libconftest.a
+
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+
++if test "x$lt_cv_ar_at_file" = xno; then
++ archiver_list_spec=
++else
++ archiver_list_spec=$lt_cv_ar_at_file
++fi
+
+
+
+@@ -5609,8 +5928,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -5646,6 +5965,7 @@ for ac_symprfx in "" "_"; do
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
++ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+@@ -5687,6 +6007,18 @@ _LT_EOF
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++ relocations are performed -- see ld's documentation on pseudo-relocs. */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data. */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -5698,7 +6030,7 @@ _LT_EOF
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+ /* The mapping between symbol names and symbols. */
+-const struct {
++LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+ }
+@@ -5724,8 +6056,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+- lt_save_LIBS="$LIBS"
+- lt_save_CFLAGS="$CFLAGS"
++ lt_globsym_save_LIBS=$LIBS
++ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -5735,8 +6067,8 @@ _LT_EOF
+ test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+- LIBS="$lt_save_LIBS"
+- CFLAGS="$lt_save_CFLAGS"
++ LIBS=$lt_globsym_save_LIBS
++ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+@@ -5773,6 +6105,19 @@ else
+ $as_echo "ok" >&6; }
+ fi
+
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++ nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++ nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
+
+
+
+@@ -5790,6 +6135,41 @@ fi
+
+
+
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++ withval=$with_libtool_sysroot;
++else
++ with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++ if test "$GCC" = yes; then
++ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ fi
++ ;; #(
++ /*)
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++ ;; #(
++ no|'')
++ ;; #(
++ *)
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++ as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++ ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+@@ -6004,6 +6384,123 @@ esac
+
+ need_locks="$enable_libtool_lock"
+
++if test -n "$ac_tool_prefix"; then
++ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$MANIFEST_TOOL"; then
++ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++ # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test -n "$ac_ct_MANIFEST_TOOL"; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++ IFS=$as_save_IFS
++ test -z "$as_dir" && as_dir=.
++ for ac_exec_ext in '' $ac_executable_extensions; do
++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++ break 2
++ fi
++done
++ done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++ if test "x$ac_ct_MANIFEST_TOOL" = x; then
++ MANIFEST_TOOL=":"
++ else
++ case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++ fi
++else
++ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_path_mainfest_tool=no
++ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++ cat conftest.err >&5
++ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++ lt_cv_path_mainfest_tool=yes
++ fi
++ rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++ MANIFEST_TOOL=:
++fi
++
++
++
++
++
+
+ case $host_os in
+ rhapsody* | darwin*)
+@@ -6570,6 +7067,8 @@ _LT_EOF
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
++ echo "$RANLIB libconftest.a" >&5
++ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7033,7 +7532,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+
+
+
+@@ -7122,7 +7622,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -7420,8 +7920,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+@@ -7587,6 +8085,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
++ nagfor*)
++ # NAG Fortran compiler
++ lt_prog_compiler_wl='-Wl,-Wl,,'
++ lt_prog_compiler_pic='-PIC'
++ lt_prog_compiler_static='-Bstatic'
++ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+@@ -7649,7 +8153,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+- f77* | f90* | f95*)
++ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+@@ -7706,13 +8210,17 @@ case $host_os in
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -7773,6 +8281,11 @@ fi
+
+
+
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8123,7 +8636,8 @@ _LT_EOF
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8222,12 +8736,12 @@ _LT_EOF
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+- archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+@@ -8241,8 +8755,8 @@ _LT_EOF
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+@@ -8260,8 +8774,8 @@ _LT_EOF
+
+ _LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -8307,8 +8821,8 @@ _LT_EOF
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+@@ -8438,7 +8952,13 @@ _LT_EOF
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- if test x$gcc_no_link = xyes; then
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -8454,22 +8974,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -8481,7 +9008,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+- if test x$gcc_no_link = xyes; then
++ if test "${lt_cv_aix_libpath+set}" = set; then
++ aix_libpath=$lt_cv_aix_libpath
++else
++ if test "${lt_cv_aix_libpath_+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -8497,22 +9030,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+-lt_aix_libpath_sed='
+- /Import File Strings/,/^$/ {
+- /^0/ {
+- s/^0 *\(.*\)$/\1/
+- p
+- }
+- }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++ lt_aix_libpath_sed='
++ /Import File Strings/,/^$/ {
++ /^0/ {
++ s/^0 *\([^ ]*\) *$/\1/
++ p
++ }
++ }'
++ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ # Check for a 64-bit object if we didn't find anything.
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++ fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++ if test -z "$lt_cv_aix_libpath_"; then
++ lt_cv_aix_libpath_="/usr/lib:/lib"
++ fi
++
++fi
++
++ aix_libpath=$lt_cv_aix_libpath_
++fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+@@ -8557,20 +9097,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+- hardcode_libdir_flag_spec=' '
+- allow_undefined_flag=unsupported
+- # Tell ltmain to make .lib files, not .a files.
+- libext=lib
+- # Tell ltmain to make .dll files, not .so files.
+- shrext_cmds=".dll"
+- # FIXME: Setting linknames here is a bad hack.
+- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+- # The linker will automatically build a .lib file if we build a DLL.
+- old_archive_from_new_cmds='true'
+- # FIXME: Should let the user specify the lib program.
+- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+- fix_srcfile_path='`cygpath -w "$srcfile"`'
+- enable_shared_with_static_runtimes=yes
++ case $cc_basename in
++ cl*)
++ # Native MSVC
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ always_export_symbols=yes
++ file_list_spec='@'
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++ else
++ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++ fi~
++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++ linknames='
++ # The linker will not automatically build a static lib if we build a DLL.
++ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++ enable_shared_with_static_runtimes=yes
++ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++ # Don't use ranlib
++ old_postinstall_cmds='chmod 644 $oldlib'
++ postlink_cmds='lt_outputfile="@OUTPUT@"~
++ lt_tool_outputfile="@TOOL_OUTPUT@"~
++ case $lt_outputfile in
++ *.exe|*.EXE) ;;
++ *)
++ lt_outputfile="$lt_outputfile.exe"
++ lt_tool_outputfile="$lt_tool_outputfile.exe"
++ ;;
++ esac~
++ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++ $RM "$lt_outputfile.manifest";
++ fi'
++ ;;
++ *)
++ # Assume MSVC wrapper
++ hardcode_libdir_flag_spec=' '
++ allow_undefined_flag=unsupported
++ # Tell ltmain to make .lib files, not .a files.
++ libext=lib
++ # Tell ltmain to make .dll files, not .so files.
++ shrext_cmds=".dll"
++ # FIXME: Setting linknames here is a bad hack.
++ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++ # The linker will automatically build a .lib file if we build a DLL.
++ old_archive_from_new_cmds='true'
++ # FIXME: Should let the user specify the lib program.
++ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++ enable_shared_with_static_runtimes=yes
++ ;;
++ esac
+ ;;
+
+ darwin* | rhapsody*)
+@@ -8631,7 +9214,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+@@ -8639,7 +9222,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux9*)
+ if test "$GCC" = yes; then
+- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+@@ -8655,7 +9238,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+@@ -8679,10 +9262,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+@@ -8761,26 +9344,39 @@ fi
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+- save_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+- if test x$gcc_no_link = xyes; then
++ # This should be the same for all languages, so no per-tag cache variable.
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++ $as_echo_n "(cached) " >&6
++else
++ save_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++ if test x$gcc_no_link = xyes; then
+ as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++ lt_cv_irix_exported_symbol=yes
++else
++ lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+- LDFLAGS="$save_LDFLAGS"
++ LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++ if test "$lt_cv_irix_exported_symbol" = yes; then
++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -8865,7 +9461,7 @@ rm -f core conftest.err conftest.$ac_objext \
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+@@ -8884,9 +9480,9 @@ rm -f core conftest.err conftest.$ac_objext \
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+@@ -9462,8 +10058,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+ need_version=no
+ need_lib_prefix=no
+
+- case $GCC,$host_os in
+- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++ case $GCC,$cc_basename in
++ yes,*)
++ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+@@ -9496,13 +10093,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
++ dynamic_linker='Win32 ld.exe'
++ ;;
++
++ *,cl*)
++ # Native MSVC
++ libname_spec='$name'
++ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++ library_names_spec='${libname}.dll.lib'
++
++ case $build_os in
++ mingw*)
++ sys_lib_search_path_spec=
++ lt_save_ifs=$IFS
++ IFS=';'
++ for lt_path in $LIB
++ do
++ IFS=$lt_save_ifs
++ # Let DOS variable expansion print the short 8.3 style file name.
++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++ done
++ IFS=$lt_save_ifs
++ # Convert to MSYS style.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++ ;;
++ cygwin*)
++ # Convert to unix form, then to dos form, then back to unix form
++ # but this time dos style (no spaces!) so that the unix form looks
++ # like /cygdrive/c/PROGRA~1:/cygdr...
++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ ;;
++ *)
++ sys_lib_search_path_spec="$LIB"
++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++ # It is most probably a Windows format PATH.
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++ else
++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++ fi
++ # FIXME: find the short name or the path components, as spaces are
++ # common. (e.g. "Program Files" -> "PROGRA~1")
++ ;;
++ esac
++
++ # DLL is installed to $(libdir)/../bin by postinstall_cmds
++ postinstall_cmds='base_file=`basename \${file}`~
++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++ dldir=$destdir/`dirname \$dlpath`~
++ test -d \$dldir || mkdir -p \$dldir~
++ $install_prog $dir/$dlname \$dldir/$dlname'
++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++ dlpath=$dir/\$dldll~
++ $RM \$dlpath'
++ shlibpath_overrides_runpath=yes
++ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
++ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+- dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+@@ -9594,7 +10249,7 @@ haiku*)
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+@@ -10452,10 +11107,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -10558,10 +11213,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11992,13 +12647,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -12013,14 +12675,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -12053,12 +12718,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -12113,8 +12778,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -12124,12 +12794,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -12145,7 +12817,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -12181,6 +12852,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -12770,7 +13442,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++# Inc.
+ # Written by Gordon Matzigkeit, 1996
+ #
+ # This file is part of GNU Libtool.
+@@ -12873,19 +13546,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+
+@@ -12915,6 +13611,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+
+@@ -12924,6 +13626,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+
+@@ -13038,12 +13743,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+
+@@ -13130,9 +13835,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+
+@@ -13148,6 +13850,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+
+@@ -13180,210 +13885,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- case $xsi_shell in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-# dirname: Compute the dirname of FILE. If nonempty,
+-# add APPEND to the result, otherwise set result
+-# to NONDIR_REPLACEMENT.
+-# value returned in "$func_dirname_result"
+-# basename: Compute filename of FILE.
+-# value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+- case ${1} in
+- */*) func_dirname_result="${1%/*}${2}" ;;
+- * ) func_dirname_result="${3}" ;;
+- esac
+- func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+- # positional parameters, so assign one to ordinary parameter first.
+- func_stripname_result=${3}
+- func_stripname_result=${func_stripname_result#"${1}"}
+- func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=${1%%=*}
+- func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- case ${1} in
+- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+- *) func_lo2o_result=${1} ;;
+- esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=${#1}
+-}
+-
+-_LT_EOF
+- ;;
+- *) # Bourne compatible functions.
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+- # Extract subdirectory from the argument.
+- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+- if test "X$func_dirname_result" = "X${1}"; then
+- func_dirname_result="${3}"
+- else
+- func_dirname_result="$func_dirname_result${2}"
+- fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+- case ${2} in
+- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+- esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+- func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+- yes)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1+=\$2"
+-}
+-_LT_EOF
+- ;;
+- *)
+- cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+- eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+- ;;
+- esac
+-
+-
+- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+- || (rm -f "$cfgfile"; exit 1)
+-
+- mv -f "$cfgfile" "$ofile" ||
++ sed '$q' "$ltmain" >> "$cfgfile" \
++ || (rm -f "$cfgfile"; exit 1)
++
++ if test x"$xsi_shell" = xyes; then
++ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\ case ${1} in\
++\ */*) func_dirname_result="${1%/*}${2}" ;;\
++\ * ) func_dirname_result="${3}" ;;\
++\ esac\
++\ func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\ # positional parameters, so assign one to ordinary parameter first.\
++\ func_stripname_result=${3}\
++\ func_stripname_result=${func_stripname_result#"${1}"}\
++\ func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\ func_split_long_opt_name=${1%%=*}\
++\ func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\ func_split_short_opt_arg=${1#??}\
++\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\ case ${1} in\
++\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\ *) func_lo2o_result=${1} ;;\
++\ esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++ func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++ func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++ func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++ sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++ eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\ func_quote_for_eval "${2}"\
++\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++ # Save a `func_append' function call where possible by direct use of '+='
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++else
++ # Save a `func_append' function call even when '+=' is not available
++ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++ && mv -f "$cfgfile.tmp" "$cfgfile" \
++ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++ test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch b/poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
new file mode 100644
index 000000000..4a5127380
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
@@ -0,0 +1,35 @@
+From 697903256e09533778baa8af66402c44d70219d9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:37:10 +0000
+Subject: [PATCH 07/15] Add the armv5e architecture to binutils
+
+Binutils has a comment that indicates it is supposed to match gcc for
+all of the support "-march=" settings, but it was lacking the armv5e setting.
+This was a simple way to add it, as thumb instructions shouldn't be generated
+by the compiler anyway.
+
+Upstream-Status: Denied
+Upstream maintainer indicated that we should not be using armv5e, even
+though it is a legal archicture defined by our gcc.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/config/tc-arm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
+index ec50420518..a25d1721af 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -26195,6 +26195,7 @@ static const struct arm_arch_option_table arm_archs[] =
+ ARM_ARCH_OPT ("armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA),
+ ARM_ARCH_OPT ("armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA),
+ ARM_ARCH_OPT ("armv5", ARM_ARCH_V5, FPU_ARCH_VFP),
++ ARM_ARCH_OPT ("armv5e", ARM_ARCH_V5TE, FPU_ARCH_VFP),
+ ARM_ARCH_OPT ("armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP),
+ ARM_ARCH_OPT ("armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP),
+ ARM_ARCH_OPT ("armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP),
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch b/poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
new file mode 100644
index 000000000..939be67b5
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
@@ -0,0 +1,35 @@
+From 622d66634eb2e509d4126f5bdcab26de367241a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:39:01 +0000
+Subject: [PATCH 08/15] don't let the distro compiler point to the wrong
+ installation location
+
+Thanks to RP for helping find the source code causing the issue.
+
+2010/08/13
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libiberty/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index ed1b334c36..d4ffd8b57b 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -364,7 +364,8 @@ install-strip: install
+ # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+ # default multilib, so we have to take CFLAGS into account as well,
+ # since it will be passed the multilib flags.
+-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++MULTIOSDIR = ""
+ install_to_libdir: all
+ if test -n "${target_header_dir}"; then \
+ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch b/poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
new file mode 100644
index 000000000..e75104722
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch
@@ -0,0 +1,273 @@
+From 27e38ee92c24fca86b1c3f6ef156a1892dd06bfd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Jan 2016 06:31:09 +0000
+Subject: [PATCH 09/15] warn for uses of system directories when cross linking
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.in (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/config.in | 3 +++
+ ld/configure | 16 ++++++++++++++++
+ ld/configure.ac | 10 ++++++++++
+ ld/ld.h | 8 ++++++++
+ ld/ld.texinfo | 12 ++++++++++++
+ ld/ldfile.c | 17 +++++++++++++++++
+ ld/ldlex.h | 2 ++
+ ld/ldmain.c | 2 ++
+ ld/lexsup.c | 16 ++++++++++++++++
+ 9 files changed, 86 insertions(+)
+
+diff --git a/ld/config.in b/ld/config.in
+index a846743da6..df3cd5fb60 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -27,6 +27,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+diff --git a/ld/configure b/ld/configure
+index db8b998722..489ead5c13 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -789,6 +789,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1448,6 +1449,8 @@ Optional Features:
+ --disable-largefile omit support for large files
+ --enable-targets alternative target configurations
+ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
++ --enable-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -16315,6 +16318,19 @@ fi
+
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Check whether --enable-gold was given.
+ if test "${enable_gold+set}" = set; then :
+ enableval=$enable_gold; case "${enableval}" in
+diff --git a/ld/configure.ac b/ld/configure.ac
+index bada1b50b0..d074a3820b 100644
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -95,6 +95,16 @@ AC_SUBST(use_sysroot)
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+diff --git a/ld/ld.h b/ld/ld.h
+index ba914b921e..9df17dab6c 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -180,6 +180,14 @@ typedef struct
+ in the linker script. */
+ bfd_boolean force_group_allocation;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Big or little endian as set on command line. */
+ enum endian_enum endian;
+
+diff --git a/ld/ld.texinfo b/ld/ld.texinfo
+index c89915f1aa..df430837e2 100644
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2498,6 +2498,18 @@ string identifying the original linked file does not change.
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+diff --git a/ld/ldfile.c b/ld/ldfile.c
+index 6532a57d96..f943f0b2e5 100644
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -116,6 +116,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
+ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+diff --git a/ld/ldlex.h b/ld/ldlex.h
+index 140ed1d9da..9965cbc04f 100644
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -147,6 +147,8 @@ enum option_values
+ OPTION_REQUIRE_DEFINED_SYMBOL,
+ OPTION_ORPHAN_HANDLING,
+ OPTION_FORCE_GROUP_ALLOCATION,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index c473ed24c3..adae0b4610 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -261,6 +261,8 @@ main (int argc, char **argv)
+ command_line.warn_mismatch = TRUE;
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+diff --git a/ld/lexsup.c b/ld/lexsup.c
+index f2191602d4..bccb3bdeef 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -538,6 +538,14 @@ static const struct ld_option ld_options[] =
+ { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING},
+ '\0', N_("=MODE"), N_("Control how orphan sections are handled."),
+ TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -1568,6 +1576,14 @@ parse_args (unsigned argc, char **argv)
+ einfo (_("%P%F: invalid argument to option"
+ " \"--orphan-handling\"\n"));
+ break;
++
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
+ }
+ }
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch b/poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
new file mode 100644
index 000000000..33dfff9bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
@@ -0,0 +1,52 @@
+From e205ae05c41a8cc8d47708f0a3b6f740e2bf2526 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:42:38 +0000
+Subject: [PATCH 10/15] Fix rpath in libtool when sysroot is enabled
+
+Enabling sysroot support in libtool exposed a bug where the final
+library had an RPATH encoded into it which still pointed to the
+sysroot. This works around the issue until it gets sorted out
+upstream.
+
+Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 70e856e065..11ee684ccc 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -8035,9 +8035,11 @@ EOF
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
++ func_stripname '=' '' "$libdir"
++ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+- func_replace_sysroot "$libdir"
+- libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+@@ -8770,6 +8772,10 @@ EOF
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
++ func_stripname '=' '' "$libdir"
++ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch b/poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
new file mode 100644
index 000000000..80fcbc119
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
@@ -0,0 +1,59 @@
+From 7978c1299021033c35c29c94e0997235f7ede248 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:44:14 +0000
+Subject: [PATCH 11/15] Change default emulation for mips64*-*-linux
+
+we change the default emulations to be N64 instead of N32
+
+Upstream-Status: Inappropriate [ OE configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/config.bfd | 8 ++++----
+ ld/configure.tgt | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index f04a993f06..8777f96bd2 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1189,12 +1189,12 @@ case "${targ}" in
+ targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+ ;;
+ mips64*el-*-linux*)
+- targ_defvec=mips_elf32_ntrad_le_vec
+- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
++ targ_defvec=mips_elf64_trad_le_vec
++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
+ ;;
+ mips64*-*-linux*)
+- targ_defvec=mips_elf32_ntrad_be_vec
+- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++ targ_defvec=mips_elf64_trad_be_vec
++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_be_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
+ ;;
+ mips*el-*-linux*)
+ targ_defvec=mips_elf32_trad_le_vec
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index 6183a85b3d..1d78465590 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -535,11 +535,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmipvxworks
+ mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
+ targ_extra_emuls="elf32elmipvxworks" ;;
+ mips*-*-windiss) targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
+- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
++mips64*el-*-linux-*) targ_emul=elf64ltsmip
++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
+ targ_extra_libpath=$targ_extra_emuls ;;
+-mips64*-*-linux-*) targ_emul=elf32btsmipn32
+- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
++mips64*-*-linux-*) targ_emul=elf64btsmip
++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
+ targ_extra_libpath=$targ_extra_emuls ;;
+ mips*el-*-linux-*) targ_emul=elf32ltsmip
+ targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch b/poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
new file mode 100644
index 000000000..1fefb680f
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch
@@ -0,0 +1,393 @@
+From 3b40bf584615f794b85fd50d4d0a5c0a1d2ee7bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 14 Feb 2016 17:06:19 +0000
+Subject: [PATCH 12/15] Add support for Netlogic XLP
+
+Patch From: Nebu Philips <nphilips@netlogicmicro.com>
+
+Using the mipsisa64r2nlm target, add support for XLP from
+Netlogic. Also, update vendor name to NLM wherever applicable.
+
+Use 0x00000080 for INSN_XLP, the value 0x00000040 has already been
+assigned to INSN_OCTEON3
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ bfd/aoutx.h | 1 +
+ bfd/archures.c | 1 +
+ bfd/bfd-in2.h | 1 +
+ bfd/config.bfd | 5 +++++
+ bfd/cpu-mips.c | 6 ++++--
+ bfd/elfxx-mips.c | 8 ++++++++
+ binutils/readelf.c | 1 +
+ gas/config/tc-mips.c | 4 +++-
+ gas/configure | 3 +++
+ include/elf/mips.h | 1 +
+ include/opcode/mips.h | 6 ++++++
+ ld/configure.tgt | 2 ++
+ opcodes/mips-dis.c | 12 +++++-------
+ opcodes/mips-opc.c | 31 ++++++++++++++++++++-----------
+ 14 files changed, 61 insertions(+), 21 deletions(-)
+
+diff --git a/bfd/aoutx.h b/bfd/aoutx.h
+index eec9c4ad2a..3bf0a71e63 100644
+--- a/bfd/aoutx.h
++++ b/bfd/aoutx.h
+@@ -814,6 +814,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
+ case bfd_mach_mipsisa64r6:
+ case bfd_mach_mips_sb1:
+ case bfd_mach_mips_xlr:
++ case bfd_mach_mips_xlp:
+ /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
+ arch_flags = M_MIPS2;
+ break;
+diff --git a/bfd/archures.c b/bfd/archures.c
+index e83c57a2f3..3016ea1bae 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -201,6 +201,7 @@ DESCRIPTION
+ .#define bfd_mach_mips_octeon3 6503
+ .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR'. *}
+ .#define bfd_mach_mips_interaptiv_mr2 736550 {* decimal 'IA2'. *}
++.#define bfd_mach_mips_xlp 887680 {* decimal 'XLP'. *}
+ .#define bfd_mach_mipsisa32 32
+ .#define bfd_mach_mipsisa32r2 33
+ .#define bfd_mach_mipsisa32r3 34
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index 42991e7848..27abc5d5a8 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -2062,6 +2062,7 @@ enum bfd_architecture
+ #define bfd_mach_mips_octeon3 6503
+ #define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
+ #define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
++#define bfd_mach_mips_xlp 887680 /* decimal 'XLP'. */
+ #define bfd_mach_mipsisa32 32
+ #define bfd_mach_mipsisa32r2 33
+ #define bfd_mach_mipsisa32r3 34
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index 8777f96bd2..7b80bda8c9 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1172,6 +1172,11 @@ case "${targ}" in
+ targ_defvec=mips_elf32_le_vec
+ targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
+ ;;
++ mipsisa64*-*-elf*)
++ targ_defvec=mips_elf32_trad_be_vec
++ targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++ want64=true
++ ;;
+ mips*-*-elf* | mips*-*-rtems* | mips*-*-windiss | mips*-*-none)
+ targ_defvec=mips_elf32_be_vec
+ targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
+diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
+index cb50c64371..2b9d1d6ecf 100644
+--- a/bfd/cpu-mips.c
++++ b/bfd/cpu-mips.c
+@@ -105,7 +105,8 @@ enum
+ I_mipsocteon3,
+ I_xlr,
+ I_interaptiv_mr2,
+- I_micromips
++ I_micromips,
++ I_xlp
+ };
+
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -158,7 +159,8 @@ static const bfd_arch_info_type arch_info_struct[] =
+ N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)),
+ N (32, 32, bfd_mach_mips_interaptiv_mr2, "mips:interaptiv-mr2", FALSE,
+ NN(I_interaptiv_mr2)),
+- N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
++ N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
++ N (64, 64, bfd_mach_mips_xlp, "mips:xlp", FALSE, 0)
+ };
+
+ /* The default architecture is mips:3000, but with a machine number of
+diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
+index 285401367d..14ebb5f175 100644
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -6806,6 +6806,9 @@ _bfd_elf_mips_mach (flagword flags)
+ case E_MIPS_MACH_IAMR2:
+ return bfd_mach_mips_interaptiv_mr2;
+
++ case E_MIPS_MACH_XLP:
++ return bfd_mach_mips_xlp;
++
+ default:
+ switch (flags & EF_MIPS_ARCH)
+ {
+@@ -11963,6 +11966,10 @@ mips_set_isa_flags (bfd *abfd)
+ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
+ break;
+
++ case bfd_mach_mips_xlp:
++ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP;
++ break;
++
+ case bfd_mach_mipsisa32:
+ val = E_MIPS_ARCH_32;
+ break;
+@@ -13936,6 +13943,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
+ { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
+ { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+ { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64r2 },
++ { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 },
+
+ /* MIPS64 extensions. */
+ { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index ae1cda9a7b..fed0387a94 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -3370,6 +3370,7 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
+ case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
+ case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); break;
+ case E_MIPS_MACH_IAMR2: strcat (buf, ", interaptiv-mr2"); break;
++ case E_MIPS_MACH_XLP: strcat (buf, ", xlp"); break;
+ case 0:
+ /* We simply ignore the field in this case to avoid confusion:
+ MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
+diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
+index c135131b59..d8fbda8e31 100644
+--- a/gas/config/tc-mips.c
++++ b/gas/config/tc-mips.c
+@@ -552,6 +552,7 @@ static int mips_32bitmode = 0;
+ || mips_opts.arch == CPU_RM7000 \
+ || mips_opts.arch == CPU_VR5500 \
+ || mips_opts.micromips \
++ || mips_opts.arch == CPU_XLP \
+ )
+
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -581,6 +582,7 @@ static int mips_32bitmode = 0;
+ && mips_opts.isa != ISA_MIPS3) \
+ || mips_opts.arch == CPU_R4300 \
+ || mips_opts.micromips \
++ || mips_opts.arch == CPU_XLP \
+ )
+
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -19737,7 +19739,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
+ /* Broadcom XLP.
+ XLP is mostly like XLR, with the prominent exception that it is
+ MIPS64R2 rather than MIPS64. */
+- { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLR },
++ { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLP },
+
+ /* MIPS 64 Release 6 */
+ { "i6400", 0, ASE_MSA, ISA_MIPS64R6, CPU_MIPS64R6},
+diff --git a/gas/configure b/gas/configure
+index a40ac2144f..65a6995243 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -12989,6 +12989,9 @@ _ACEOF
+ mipsisa64r6 | mipsisa64r6el)
+ mips_cpu=mips64r6
+ ;;
++ mipsisa64r2nlm | mipsisa64r2nlmel)
++ mips_cpu=xlp
++ ;;
+ mipstx39 | mipstx39el)
+ mips_cpu=r3900
+ ;;
+diff --git a/include/elf/mips.h b/include/elf/mips.h
+index 9de0b4e175..74fc4f7e55 100644
+--- a/include/elf/mips.h
++++ b/include/elf/mips.h
+@@ -290,6 +290,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
+ #define E_MIPS_MACH_SB1 0x008a0000
+ #define E_MIPS_MACH_OCTEON 0x008b0000
+ #define E_MIPS_MACH_XLR 0x008c0000
++#define E_MIPS_MACH_XLP 0x008f0000
+ #define E_MIPS_MACH_OCTEON2 0x008d0000
+ #define E_MIPS_MACH_OCTEON3 0x008e0000
+ #define E_MIPS_MACH_5400 0x00910000
+diff --git a/include/opcode/mips.h b/include/opcode/mips.h
+index 5eea72f139..90f6d57e15 100644
+--- a/include/opcode/mips.h
++++ b/include/opcode/mips.h
+@@ -1259,6 +1259,8 @@ static const unsigned int mips_isa_table[] = {
+ #define INSN_XLR 0x00000020
+ /* Imagination interAptiv MR2. */
+ #define INSN_INTERAPTIV_MR2 0x04000000
++/* Netlogic XlP instruction */
++#define INSN_XLP 0x00000080
+
+ /* DSP ASE */
+ #define ASE_DSP 0x00000001
+@@ -1365,6 +1367,7 @@ static const unsigned int mips_isa_table[] = {
+ #define CPU_OCTEON3 6503
+ #define CPU_XLR 887682 /* decimal 'XLR' */
+ #define CPU_INTERAPTIV_MR2 736550 /* decimal 'IA2' */
++#define CPU_XLP 887680 /* decimal 'XLP' */
+
+ /* Return true if the given CPU is included in INSN_* mask MASK. */
+
+@@ -1445,6 +1448,9 @@ cpu_is_member (int cpu, unsigned int mask)
+ return ((mask & INSN_ISA_MASK) == INSN_ISA32R6)
+ || ((mask & INSN_ISA_MASK) == INSN_ISA64R6);
+
++ case CPU_XLP:
++ return (mask & INSN_XLP) != 0;
++
+ default:
+ return FALSE;
+ }
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index 1d78465590..307e787b64 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -521,6 +521,8 @@ mips*el-sde-elf* | mips*el-mti-elf* | mips*el-img-elf*)
+ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ targ_emul=elf32btsmip
+ targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
++mipsisa64*-*-elf*) targ_emul=elf32btsmip
++ targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;;
+ mips64*el-ps2-elf*) targ_emul=elf32lr5900n32
+ targ_extra_emuls="elf32lr5900"
+ targ_extra_libpath=$targ_extra_emuls ;;
+diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
+index 984fcbb802..95b107d216 100644
+--- a/opcodes/mips-dis.c
++++ b/opcodes/mips-dis.c
+@@ -655,13 +655,11 @@ const struct mips_arch_choice mips_arch_choices[] =
+ mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+ mips_cp1_names_mips3264, mips_hwr_names_numeric },
+
+- /* XLP is mostly like XLR, with the prominent exception it is being
+- MIPS64R2. */
+- { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR,
+- ISA_MIPS64R2 | INSN_XLR, 0,
+- mips_cp0_names_xlr,
+- mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+- mips_cp1_names_mips3264, mips_hwr_names_numeric },
++ { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP,
++ ISA_MIPS64R2 | INSN_XLP, 0,
++ mips_cp0_names_mips3264r2,
++ mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
++ mips_cp1_names_mips3264, mips_hwr_names_mips3264r2 },
+
+ /* This entry, mips16, is here only for ISA/processor selection; do
+ not print its name. */
+diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
+index 180d613c93..65b7b8cc23 100644
+--- a/opcodes/mips-opc.c
++++ b/opcodes/mips-opc.c
+@@ -328,6 +328,7 @@ decode_mips_operand (const char *p)
+ #define IOCT3 INSN_OCTEON3
+ #define XLR INSN_XLR
+ #define IAMR2 INSN_INTERAPTIV_MR2
++#define XLP INSN_XLP
+ #define IVIRT ASE_VIRT
+ #define IVIRT64 ASE_VIRT64
+
+@@ -966,6 +967,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, I37 },
+ {"clz", "d,s", 0x00000050, 0xfc1f07ff, WR_1|RD_2, 0, I37, 0, 0 },
+ {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, I37 },
++{"crc", "d,s,t", 0x7000001c, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
+ /* ctc0 is at the bottom of the table. */
+ {"ctc1", "t,G", 0x44c00000, 0xffe007ff, RD_1|WR_CC|CM, 0, I1, 0, 0 },
+ {"ctc1", "t,S", 0x44c00000, 0xffe007ff, RD_1|WR_CC|CM, 0, I1, 0, 0 },
+@@ -998,12 +1000,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_1|RD_2, 0, I3, 0, 0 },
+ {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I3, 0, 0 },
+ {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3, 0, 0 },
+-{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR, 0, 0 },
++{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR|XLP, 0, 0 },
+ {"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5, 0, 0 },
+ {"dclo", "d,s", 0x00000053, 0xfc1f07ff, WR_1|RD_2, 0, I69, 0, 0 },
+ {"dclo", "U,s", 0x70000025, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, I69 },
+ {"dclz", "d,s", 0x00000052, 0xfc1f07ff, WR_1|RD_2, 0, I69, 0, 0 },
+ {"dclz", "U,s", 0x70000024, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, I69 },
++{"dcrc", "d,s,t", 0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
+ /* dctr and dctw are used on the r5000. */
+ {"dctr", "o(b)", 0xbc050000, 0xfc1f0000, RD_2, 0, I3, 0, 0 },
+ {"dctw", "o(b)", 0xbc090000, 0xfc1f0000, RD_2, 0, I3, 0, 0 },
+@@ -1075,6 +1078,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"dmfc0", "t,G,H", 0x40200000, 0xffe007f8, WR_1|RD_C0|LC, 0, I64, 0, 0 },
+ {"dmfgc0", "t,G", 0x40600100, 0xffe007ff, WR_1|RD_C0|LC, 0, 0, IVIRT64, 0 },
+ {"dmfgc0", "t,G,H", 0x40600100, 0xffe007f8, WR_1|RD_C0|LC, 0, 0, IVIRT64, 0 },
++{"dmfur", "t,d", 0x7000001e, 0xffe007ff, WR_1, 0, XLP, 0, 0 },
+ {"dmt", "", 0x41600bc1, 0xffffffff, TRAP, 0, 0, MT32, 0 },
+ {"dmt", "t", 0x41600bc1, 0xffe0ffff, WR_1|TRAP, 0, 0, MT32, 0 },
+ {"dmtc0", "t,G", 0x40a00000, 0xffe007ff, RD_1|WR_C0|WR_CC|CM, 0, I3, 0, EE },
+@@ -1090,6 +1094,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* dmfc3 is at the bottom of the table. */
+ /* dmtc3 is at the bottom of the table. */
+ {"dmuh", "d,s,t", 0x000000dc, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I69, 0, 0 },
++{"dmtur", "t,d", 0x7000001f, 0xffe007ff, RD_1, 0, XLP, 0, 0 },
++{"dmul", "d,s,t", 0x70000006, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
+ {"dmul", "d,s,t", 0x0000009c, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I69, 0, 0 },
+ {"dmul", "d,v,t", 0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO, 0, IOCT, 0, 0 },
+ {"dmul", "d,v,t", 0, (int) M_DMUL, INSN_MACRO, 0, I3, 0, M32|I69 },
+@@ -1243,9 +1249,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"ld", "s,-b(+R)", 0xec180000, 0xfc1c0000, WR_1, RD_pc, I69, 0, 0 },
+ {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1, 0, 0 },
+ {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_1|RD_3|LM, 0, I3, 0, 0 },
+-{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
+-{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
+-{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
++{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
++{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
++{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
+ {"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF },
+ {"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF },
+ {"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, INSN2_M_FP_D, I2, 0, SF },
+@@ -1410,7 +1416,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mflo", "d,9", 0x00000012, 0xff9f07ff, WR_1|RD_LO, 0, 0, D32, 0 },
+ {"mflo1", "d", 0x70000012, 0xffff07ff, WR_1|RD_LO, 0, EE, 0, 0 },
+ {"mflhxu", "d", 0x00000052, 0xffff07ff, WR_1|MOD_HILO, 0, 0, SMT, 0 },
+-{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1|RD_2, 0, XLR, 0, 0 },
++{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1, 0, XLR|XLP, 0, 0 },
+ {"mfsa", "d", 0x00000028, 0xffff07ff, WR_1, 0, EE, 0, 0 },
+ {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, SB1, MX, 0 },
+ {"min.ob", "D,S,Q", 0x48000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, N54, 0, 0 },
+@@ -1455,10 +1461,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* move is at the top of the table. */
+ {"msgn.qh", "X,Y,Q", 0x78200000, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, 0, MX, 0 },
+ {"msgsnd", "t", 0, (int) M_MSGSND, INSN_MACRO, 0, XLR, 0, 0 },
++{"msgsnds", "d,t", 0x4a000001, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 },
+ {"msgld", "", 0, (int) M_MSGLD, INSN_MACRO, 0, XLR, 0, 0 },
+ {"msgld", "t", 0, (int) M_MSGLD_T, INSN_MACRO, 0, XLR, 0, 0 },
+-{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR, 0, 0 },
+-{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR, 0, 0 },
++{"msglds", "d,t", 0x4a000002, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 },
++{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR|XLP, 0, 0 },
++{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR|XLP, 0, 0 },
++{"msgsync", "", 0x4a000004, 0xffffffff,0, 0, XLP, 0, 0 },
+ {"msub.d", "D,R,S,T", 0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0, I4_33, 0, I37 },
+ {"msub.d", "D,S,T", 0x46200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2E, 0, 0 },
+ {"msub.d", "D,S,T", 0x72200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2F, 0, 0 },
+@@ -1508,7 +1517,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mtlo", "s,7", 0x00000013, 0xfc1fe7ff, RD_1|WR_LO, 0, 0, D32, 0 },
+ {"mtlo1", "s", 0x70000013, 0xfc1fffff, RD_1|WR_LO, 0, EE, 0, 0 },
+ {"mtlhx", "s", 0x00000053, 0xfc1fffff, RD_1|MOD_HILO, 0, 0, SMT, 0 },
+-{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1|RD_2, 0, XLR, 0, 0 },
++{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1, 0, XLR|XLP, 0, 0 },
+ {"mtm0", "s", 0x70000008, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 },
+ {"mtm0", "s,t", 0x70000008, 0xfc00ffff, RD_1|RD_2, 0, IOCT3, 0, 0 },
+ {"mtm1", "s", 0x7000000c, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 },
+@@ -1945,9 +1954,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"suxc1", "S,t(b)", 0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D, 0, I5_33|N55, 0, I37},
+ {"sw", "t,o(b)", 0xac000000, 0xfc000000, RD_1|RD_3|SM, 0, I1, 0, 0 },
+ {"sw", "t,A(b)", 0, (int) M_SW_AB, INSN_MACRO, 0, I1, 0, 0 },
+-{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
+-{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
+-{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|LM|SM, 0, XLR, 0, 0 },
++{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
++{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
++{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
+ {"swc0", "E,o(b)", 0xe0000000, 0xfc000000, RD_3|RD_C0|SM, 0, I1, 0, IOCT|IOCTP|IOCT2|I37 },
+ {"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, 0, I1, 0, IOCT|IOCTP|IOCT2|I37 },
+ {"swc1", "T,o(b)", 0xe4000000, 0xfc000000, RD_1|RD_3|SM|FP_S, 0, I1, 0, 0 },
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch b/poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
new file mode 100644
index 000000000..c3e1b1384
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
@@ -0,0 +1,36 @@
+From 27ec22ca3cd56cfdf060d2e1f414bedce269b322 Mon Sep 17 00:00:00 2001
+From: Zhenhua Luo <zhenhua.luo@nxp.com>
+Date: Sat, 11 Jun 2016 22:08:29 -0500
+Subject: [PATCH 13/15] fix the incorrect assembling for ppc wait mnemonic
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
+
+Upstream-Status: Pending
+---
+ opcodes/ppc-opc.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
+index bb17f26c2e..dbdd762b4e 100644
+--- a/opcodes/ppc-opc.c
++++ b/opcodes/ppc-opc.c
+@@ -5338,7 +5338,6 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+ {"ldepx", X(31,29), X_MASK, E500MC|PPCA2, 0, {RT, RA0, RB}},
+
+ {"waitasec", X(31,30), XRTRARB_MASK, POWER8, POWER9, {0}},
+-{"wait", X(31,30), XWC_MASK, POWER9, 0, {WC}},
+
+ {"lwepx", X(31,31), X_MASK, E500MC|PPCA2, 0, {RT, RA0, RB}},
+
+@@ -5392,7 +5391,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
+
+ {"waitrsv", X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
+ {"waitimpl", X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, 0, {0}},
+-{"wait", X(31,62), XWC_MASK, E500MC|PPCA2, 0, {WC}},
++{"wait", X(31,62), XWC_MASK, E500MC|PPCA2|POWER9, 0, {WC}},
+
+ {"dcbstep", XRT(31,63,0), XRT_MASK, E500MC|PPCA2, 0, {RA0, RB}},
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch b/poky/meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch
new file mode 100644
index 000000000..cf3690f25
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch
@@ -0,0 +1,50 @@
+From 7dfbd6889d868a09d695dd2736104848c1a9c9c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 11:42:03 -0700
+Subject: [PATCH 14/15] Detect 64-bit MIPS targets
+
+Add mips64 target triplets and default to N64
+
+Upstream-Status: Submitted
+https://sourceware.org/ml/binutils/2016-08/msg00048.html
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gold/configure.tgt | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/gold/configure.tgt b/gold/configure.tgt
+index 8aef22a318..7030026ffa 100644
+--- a/gold/configure.tgt
++++ b/gold/configure.tgt
+@@ -153,6 +153,13 @@ aarch64*-*)
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
++mips*64*el*-*-*|mips*64*le*-*-*)
++ targ_obj=mips
++ targ_machine=EM_MIPS_RS3_LE
++ targ_size=64
++ targ_big_endian=false
++ targ_extra_big_endian=true
++ ;;
+ mips*el*-*-*|mips*le*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS_RS3_LE
+@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*)
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
++mips*64*-*-*)
++ targ_obj=mips
++ targ_machine=EM_MIPS
++ targ_size=64
++ targ_big_endian=true
++ targ_extra_big_endian=false
++ ;;
+ mips*-*-*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch b/poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch
new file mode 100644
index 000000000..8c9fd237e
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch
@@ -0,0 +1,89 @@
+From 298804f430939d6cc94b09732ee93e64c5e6be18 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 6 Mar 2017 23:33:27 -0800
+Subject: [PATCH 15/15] sync with OE libtool changes
+
+Apply these patches from our libtool patches as not only are redundant RPATHs a
+waste of space but they can cause incorrect linking when native packages are
+restored from sstate.
+
+fix-rpath.patch:
+We don't want to add RPATHS which match default linker
+search paths, they're a waste of space. This patch
+filters libtools list and removes the ones we don't need.
+
+norm-rpath.patch:
+Libtool may be passed link paths of the form "/usr/lib/../lib", which
+fool its detection code into thinking it should be included as an
+RPATH in the generated binary. Normalize before comparision.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 34 ++++++++++++++++++++++++++++------
+ 1 file changed, 28 insertions(+), 6 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 11ee684ccc..3b19ac1532 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -8053,8 +8053,16 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append dep_rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir_norm "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append dep_rpath " $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+@@ -8790,8 +8798,16 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir_norm "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ rpath+=" $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+@@ -8841,8 +8857,14 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append rpath " $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/binutils/binutils_2.30.bb b/poky/meta/recipes-devtools/binutils/binutils_2.30.bb
new file mode 100644
index 000000000..51a974890
--- /dev/null
+++ b/poky/meta/recipes-devtools/binutils/binutils_2.30.bb
@@ -0,0 +1,49 @@
+require binutils.inc
+require binutils-${PV}.inc
+
+DEPENDS += "flex bison zlib"
+
+EXTRA_OECONF += "--with-sysroot=/ \
+ --enable-install-libbfd \
+ --enable-install-libiberty \
+ --enable-shared \
+ --with-system-zlib \
+ "
+
+EXTRA_OEMAKE_append_libc-musl = "\
+ gt_cv_func_gnugettext1_libc=yes \
+ gt_cv_func_gnugettext2_libc=yes \
+ "
+EXTRA_OECONF_class-native = "--enable-targets=all \
+ --enable-64-bit-bfd \
+ --enable-install-libiberty \
+ --enable-install-libbfd \
+ --disable-werror"
+
+do_install_class-native () {
+ autotools_do_install
+
+ # Install the libiberty header
+ install -d ${D}${includedir}
+ install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+ install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+ # We only want libiberty, libbfd and libopcodes
+ rm -rf ${D}${bindir}
+ rm -rf ${D}${prefix}/${TARGET_SYS}
+ rm -rf ${D}${prefix}/lib/ldscripts
+ rm -rf ${D}${prefix}/share/info
+ rm -rf ${D}${prefix}/share/locale
+ rm -rf ${D}${prefix}/share/man
+ rmdir ${D}${prefix}/share || :
+ rmdir ${D}/${libdir}/gcc-lib || :
+ rmdir ${D}/${libdir}64/gcc-lib || :
+ rmdir ${D}/${libdir} || :
+ rmdir ${D}/${libdir}64 || :
+}
+
+# Split out libbfd-*.so so including perf doesn't include extra stuff
+PACKAGE_BEFORE_PN += "libbfd"
+FILES_libbfd = "${libdir}/libbfd-*.so"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch b/poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
new file mode 100644
index 000000000..1e86f5522
--- /dev/null
+++ b/poky/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
@@ -0,0 +1,34 @@
+From 5b9204eee4b06b48d54ecc3ef3a0b56fc5cc84f8 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 24 Apr 2015 00:38:32 -0700
+Subject: [PATCH] src/local.mk: fix parallel issue
+
+Fixed:
+rm -f src/yacc src/yacc.tmp
+echo '#! /bin/sh' >src/yacc.tmp
+/bin/bash: src/yacc.tmp: No such file or directory
+Makefile:6670: recipe for target 'src/yacc' failed
+
+Upstream-Status: Submitted [ http://lists.gnu.org/archive/html/bison-patches/2017-07/msg00000.html ]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ src/local.mk | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/local.mk b/src/local.mk
+index 573ad00..28bfae4 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -119,6 +119,7 @@ MOSTLYCLEANFILES += src/yacc
+
+ src/yacc:
+ $(AM_V_GEN)rm -f $@ $@.tmp
++ $(AM_V_at)$(MKDIR_P) src
+ $(AM_V_at)echo '#! /bin/sh' >$@.tmp
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp
+ $(AM_V_at)chmod a+x $@.tmp
+--
+2.8.1
+
diff --git a/poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch b/poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
new file mode 100644
index 000000000..35c0f6fa3
--- /dev/null
+++ b/poky/meta/recipes-devtools/bison/bison/add-with-bisonlocaledir.patch
@@ -0,0 +1,58 @@
+From 41fdca818cdc7bd686c31aff4088b89280d71a42 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Feb 2016 22:01:28 -0500
+Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
+ BISON_LOCALEDIR
+
+The variable BISON_LOCALEDIR is assigned only by the output of
+'bison --print-localedir', we add option --with-bisonlocaledir
+to assign it explicitly. It is helpful for user to split the
+native compile and cross compile.
+
+For backward compatibility, if option not used, it still
+make use of the output of 'bison --print-localedir'.
+
+Upstream-Status: Submitted [bison-patches@gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/bison-i18n.m4 | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/m4/bison-i18n.m4 b/m4/bison-i18n.m4
+index 8e57caf..c36f498 100644
+--- a/m4/bison-i18n.m4
++++ b/m4/bison-i18n.m4
+@@ -16,11 +16,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+ dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+ AC_DEFUN([BISON_I18N],
+ [
++ dnl Default is not to set bisonlocaledir
++ AC_ARG_WITH([bisonlocaledir],
++ [ --with-bisonlocaledir sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
++ BISON_LOCALEDIR=$withval,
++ BISON_LOCALEDIR=)
++
+ if test -z "$USE_NLS"; then
+ echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+ exit 1
+ fi
+- BISON_LOCALEDIR=
+ BISON_USE_NLS=no
+ if test "$USE_NLS" = yes; then
+ dnl Determine bison's localedir.
+@@ -28,9 +33,10 @@ AC_DEFUN([BISON_I18N],
+ dnl But even is YACC is called "yacc", it may be a script that invokes bison
+ dnl and accepts the --print-localedir option.
+ dnl YACC's default value is empty; BISON's default value is :.
+- if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
++ if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
+ BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+ fi
++ AC_MSG_RESULT([$BISON_LOCALEDIR])
+ AC_SUBST([BISON_LOCALEDIR])
+ if test -n "$BISON_LOCALEDIR"; then
+ dnl There is no need to enable internationalization if the user doesn't
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch b/poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
new file mode 100644
index 000000000..ac16c5770
--- /dev/null
+++ b/poky/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
@@ -0,0 +1,46 @@
+From 4c0d7733f30903f8d7c7cd7433f5c8a7505e35f5 Mon Sep 17 00:00:00 2001
+From: Marko Lindqvist <cazfi74@gmail.com>
+Date: Tue, 21 Apr 2015 00:48:45 -0700
+Subject: [PATCH] doc/local.mk: dont-depend-on-help2man.patch
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Updated for bison 3.0.4
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ doc/local.mk | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/doc/local.mk b/doc/local.mk
+index c340452..642f385 100644
+--- a/doc/local.mk
++++ b/doc/local.mk
+@@ -98,10 +98,7 @@ endif ! CROSS_COMPILING
+ ## Man Pages. ##
+ ## ----------- ##
+
+-dist_man_MANS = $(top_srcdir)/doc/bison.1
+-
+-EXTRA_DIST += $(dist_man_MANS:.1=.x)
+-MAINTAINERCLEANFILES += $(dist_man_MANS)
++EXTRA_DIST += bison.x
+
+ # Differences to ignore when comparing the man page (the date).
+ remove_time_stamp = \
+@@ -124,10 +121,6 @@ $(top_srcdir)/doc/bison.1: $(MAN_DEPS)
+ fi
+ $(AM_V_at)rm -f $@*.t
+
+-if ENABLE_YACC
+-nodist_man_MANS = doc/yacc.1
+-endif
+-
+ ## ----------------------------- ##
+ ## Graphviz examples generation. ##
+ ## ----------------------------- ##
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/bison/bison_3.0.4.bb b/poky/meta/recipes-devtools/bison/bison_3.0.4.bb
new file mode 100644
index 000000000..58728f502
--- /dev/null
+++ b/poky/meta/recipes-devtools/bison/bison_3.0.4.bb
@@ -0,0 +1,38 @@
+SUMMARY = "GNU Project parser generator (yacc replacement)"
+DESCRIPTION = "Bison is a general-purpose parser generator that converts an annotated context-free grammar into \
+an LALR(1) or GLR parser for that grammar. Bison is upward compatible with Yacc: all properly-written Yacc \
+grammars ought to work with Bison with no change. Anyone familiar with Yacc should be able to use Bison with \
+little trouble."
+HOMEPAGE = "http://www.gnu.org/software/bison/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+SECTION = "devel"
+DEPENDS = "bison-native flex-native"
+
+SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://dont-depend-on-help2man.patch.patch \
+ file://0001-src-local.mk-fix-parallel-issue.patch \
+ file://add-with-bisonlocaledir.patch \
+"
+
+# No point in hardcoding path to m4, just use PATH
+EXTRA_OECONF += "M4=m4"
+
+SRC_URI[md5sum] = "c342201de104cc9ce0a21e0ad10d4021"
+SRC_URI[sha256sum] = "a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1"
+
+inherit autotools gettext texinfo
+
+# The automatic m4 path detection gets confused, so force the right value
+acpaths = "-I ${S}/m4"
+
+do_compile_prepend() {
+ for i in mfcalc calc++ rpcalc; do mkdir -p ${B}/examples/$i; done
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/bison \
+ BISON_PKGDATADIR=${STAGING_DATADIR_NATIVE}/bison
+}
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch
new file mode 100644
index 000000000..118814a80
--- /dev/null
+++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch
@@ -0,0 +1,30 @@
+From 2225ab2038bfe50f16f972e39d89bcd0bd7767f5 Mon Sep 17 00:00:00 2001
+From: Steffen Pankratz <kratz00@gmx.de>
+Date: Tue, 9 Feb 2016 13:49:42 +0100
+Subject: [PATCH] Fixed: Missing default value for BOOTLOG_DEST
+
+Upstream-Status: Backport
+
+BUILDLOG_DEST seems to be a typo or mix-up which was introduced with 281d1df80884bf2969c509ec60ee8a6593524fe8
+
+Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com>
+---
+ bootchartd.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bootchartd.in b/bootchartd.in
+index f58ab9e..30af677 100755
+--- a/bootchartd.in
++++ b/bootchartd.in
+@@ -37,7 +37,7 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin:$PATH"
+
+ # Defaults, in case we can't find our configuration
+ SAMPLE_HZ=50
+-BUILDLOG_DEST=/var/log/bootchart.tgz
++BOOTLOG_DEST=/var/log/bootchart.tgz
+ AUTO_RENDER="no"
+ AUTO_RENDER_DIR="/var/log"
+ AUTO_RENDER_FORMAT="png"
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch
new file mode 100644
index 000000000..7a8813e96
--- /dev/null
+++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch
@@ -0,0 +1,45 @@
+From 09505532b49573663fb4ff4dad424dc2ef4c1f84 Mon Sep 17 00:00:00 2001
+From: Kyle Russell <bkylerussell@gmail.com>
+Date: Wed, 13 Jul 2016 17:30:00 -0400
+Subject: [PATCH] collector: Allocate space on heap for chunks
+
+Nicer for embedded devices which may have smaller stack limitations.
+
+Upstream-Status: Submitted [https://github.com/xrmx/bootchart/pull/74]
+
+Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
+---
+ collector/dump.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/collector/dump.c b/collector/dump.c
+index e673b5b..2f094b4 100644
+--- a/collector/dump.c
++++ b/collector/dump.c
+@@ -184,12 +184,12 @@ static void dump_buffers (DumpState *s)
+ log ("reading %d chunks (of %d) ...\n", max_chunk, s->map.max_chunk);
+ for (i = 0; i < max_chunk; i++) {
+ FILE *output;
+- char buffer[CHUNK_SIZE];
+- Chunk *c = (Chunk *)&buffer;
++ char *buffer = malloc(CHUNK_SIZE);
++ Chunk *c = (Chunk *)buffer;
+ size_t addr = (size_t) s->map.chunks[i];
+
+ lseek (s->mem, addr, SEEK_SET);
+- read (s->mem, &buffer, CHUNK_SIZE);
++ read (s->mem, buffer, CHUNK_SIZE);
+ /* log ("type: '%s' len %d\n",
+ c->dest_stream, (int)c->length); */
+
+@@ -197,6 +197,7 @@ static void dump_buffers (DumpState *s)
+ fwrite (c->data, 1, c->length, output);
+ bytes_dumped += c->length;
+ fclose (output);
++ free(buffer);
+ }
+ log ("wrote %ld kb\n", (long)(bytes_dumped+1023)/1024);
+ }
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
new file mode 100644
index 000000000..21a78877a
--- /dev/null
+++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bootchartd_stop
+# Required-Start: $remote_fs $all
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Stop bootchartd collection
+# Description: This script accompanies bootchartd from bootchart2.
+# bootchartd should stop detect the end of the boot process
+# automatically if a window manager is launched, but for
+# command-line only operating systems, this script should be
+# used instead.
+### END INIT INFO
+
+/sbin/bootchartd stop
+
+: exit 0
diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb b/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
new file mode 100644
index 000000000..b3c889b0a
--- /dev/null
+++ b/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
@@ -0,0 +1,156 @@
+# Copyright (c) 2013 LG Electronics, Inc.
+# Copyright (C) 2014 Intel Corp.
+
+# This recipe creates packages for the bootchart2 system-wide profiler daemon
+# and related utilities. Depending on the images you're building, additional
+# configuration may be needed in order to use it.
+#
+# Packages:
+# * bootchart2 - The daemon itself.
+# * pybootchartgui - Python program to visualize and display the data
+# collected by bootchart2 or compatible daemons such as the original
+# bootchart.
+# * bootchartd-stop-initscript - A SysV init script to stop data collection
+# when booting completes (see below for details.)
+#
+# While bootchart2 is designed to stop collecting data roughly when the boot
+# process completes, it is not exactly a stopwatch. It has a list of programs
+# which are supposed signify that the boot process has completed (for example,
+# openbox or gnome-shell,) but it waits a full 20 seconds after such a program
+# is launched before stopping itself, to collect additional data.
+#
+# If you are using a window manager or GUI which isn't included in bootchart2's
+# default configuration file, you should write bbappend file to amend
+# bootchartd.conf and add it to EXIT_PROC. An example of this is shown in this
+# recipe, where the Matchbox window manager (used by Sato) is added.
+#
+# If you want data collection to end at a certain point exactly, you should
+# arrange for the following command to be run:
+# bootchartd stop
+# You might set this command to be launched by the desktop environment shipped
+# on the image you're building after the other startup programs are complete.
+# This will not incur the 20 second wait period and will cause bootchart2 to
+# behave a bit more like a stopwatch. An example of this is shown in this
+# recipe, specifically the bootchartd-stop-initscript package, which stops data
+# collection as the last action when switching to runlevels 2 through 5. You can
+# add bootchartd-stop-initscript to IMAGE_INSTALL if you need to use it.
+#
+# Unless you're doing something special, if your image does not launch an X
+# window manager, you will need to add bootchartd-stop-initscript to your image.
+#
+# Bootchart2 can be started in two ways. Data collection can be initiated by
+# running the following command:
+# bootchartd start
+# However, for the most complete data, the bootchart2 developers recommend
+# running it as PID 1. This can be done by adding the following to the kernel
+# command line parameters in the bootloader setup:
+# init=/sbin/bootchartd
+# When invoked this way, bootchart2 will set itself up and then automatically
+# run /sbin/init. For example, when booting the default qemux86 image, one might
+# use a command like this:
+# runqemu qemux86 bootparams="initcall_debug printk.time=y quiet \
+# init=/sbin/bootchartd"
+#
+# Neither method is actually implemented here, choose what works for you.
+#
+# If you are building your image with systemd instead of SysV init, bootchart2
+# includes systemd service files to begin collection automatically at boot and
+# end collection automatically 20 seconds after the boot process has completed.
+# However, be aware that systemd tends to start bootchart2 relatively late into
+# the boot process, so it's highly recommended to use bootchart2 as PID 1. If
+# you're using systemd and you wish to use another method to stop data
+# collection at a time of your choosing, you may do so as long as you get to it
+# before the 20 second timeout of the systemd service files. Also, you may write
+# a bbappend to patch bootchart2-done.timer.in to increase or decrease the
+# timeout. Decreasing it to 0 will make it behave like
+# bootchartd-stop-initscript.
+#
+# By default, when data collection is stopped, a file named bootchart.tgz will
+# be created in /var/log. If pybootchartgui is included in your image,
+# bootchart.png will also be created at the same time. However, this results in
+# a noticeable hitch or pause at boot time, which may not be what you want on an
+# embedded device. So you may prefer to omit pybootchartgui from your image. In
+# that case, copy bootchart.tgz over to your development system and generate
+# bootchart.png there. To get pybootchartgui on your development system, you can
+# either install it directly from some other source, or build bootchart2-native
+# and find pybootchartgui in the native sysroot:
+# bitbake bootchart2-native
+# ./tmp/sysroots/x86_64-linux/usr/bin/pybootchartgui /path/to/bootchart.tgz
+# Note that, whether installed on your build system or on your image, the
+# pybootchartgui provided by this recipe does not support the -i option. You
+# will need to install pybootchartgui by other means in order to run it in
+# interactive mode.
+
+SUMMARY = "Booting sequence and CPU,I/O usage monitor"
+DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time."
+AUTHOR = "Wonhong Kwon <wonhong.kwon@lge.com>"
+HOMEPAGE = "https://github.com/mmeeks/bootchart"
+LICENSE = "GPL-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=44ac4678311254db62edf8fd39cb8124"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+SRC_URI = "git://github.com/xrmx/bootchart.git \
+ file://bootchartd_stop.sh \
+ file://0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch \
+ file://0001-collector-Allocate-space-on-heap-for-chunks.patch \
+ "
+
+S = "${WORKDIR}/git"
+SRCREV = "48e0071048564c6af75ab969e842d6dec808da09"
+
+inherit systemd update-rc.d python3native update-alternatives
+
+ALTERNATIVE_${PN} = "bootchartd"
+ALTERNATIVE_LINK_NAME[bootchartd] = "${base_sbindir}/bootchartd"
+ALTERNATIVE_PRIORITY = "100"
+
+# The only reason to build bootchart2-native is for a native pybootchartgui.
+BBCLASSEXTEND = "native"
+
+SYSTEMD_SERVICE_${PN} = "bootchart2.service bootchart2-done.service bootchart2-done.timer"
+
+UPDATERCPN = "bootchartd-stop-initscript"
+INITSCRIPT_NAME = "bootchartd_stop.sh"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
+do_compile_prepend () {
+ export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+ export BINDIR="${bindir}"
+ export LIBDIR="${base_libdir}"
+}
+
+do_install () {
+ install -d ${D}${sysconfdir} # needed for -native
+ export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+ export BINDIR="${bindir}"
+ export DESTDIR="${D}"
+ export LIBDIR="${base_libdir}"
+
+ oe_runmake install
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootchartd_stop.sh ${D}${sysconfdir}/init.d
+
+ echo 'EXIT_PROC="$EXIT_PROC matchbox-window-manager"' >> ${D}${sysconfdir}/bootchartd.conf
+
+ # Use python 3 instead of python 2
+ sed -i -e '1s,#!.*python.*,#!${USRBINPATH}/env python3,' ${D}${bindir}/pybootchartgui
+}
+
+PACKAGES =+ "pybootchartgui"
+FILES_pybootchartgui += "${PYTHON_SITEPACKAGES_DIR}/pybootchartgui ${bindir}/pybootchartgui"
+RDEPENDS_pybootchartgui = "python3-pycairo python3-compression python3-image python3-shell python3-compression python3-codecs"
+RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+RDEPENDS_${PN}_class-target += "lsb"
+DEPENDS_append_class-native = " python3-pycairo-native"
+
+PACKAGES =+ "bootchartd-stop-initscript"
+FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d"
+RDEPENDS_bootchartd-stop-initscript = "${PN}"
+
+FILES_${PN} += "${base_libdir}/bootchart/bootchart-collector"
+FILES_${PN} += "${base_libdir}/bootchart/tmpfs"
+FILES_${PN} += "${libdir}"
+FILES_${PN}-doc += "${datadir}/docs"
+
+RCONFLICTS_${PN} = "bootchart"
diff --git a/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch
new file mode 100644
index 000000000..790676b9c
--- /dev/null
+++ b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch
@@ -0,0 +1,26 @@
+From bc35c4caebb57cc8b96c30c25432b12ca8dc18d5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 6 Oct 2017 15:03:49 +0300
+Subject: [PATCH] Fix build with musl (missing header include for dev_t).
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ convert/source-fs.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/convert/source-fs.h b/convert/source-fs.h
+index 23f3356..6fd770f 100644
+--- a/convert/source-fs.h
++++ b/convert/source-fs.h
+@@ -20,6 +20,7 @@
+ #include "kerncompat.h"
+ #include <linux/kdev_t.h>
+ #include <pthread.h>
++#include <sys/types.h>
+
+ #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-build-mktables-using-native-gcc.patch b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-build-mktables-using-native-gcc.patch
new file mode 100644
index 000000000..467de3275
--- /dev/null
+++ b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-build-mktables-using-native-gcc.patch
@@ -0,0 +1,27 @@
+From e58369f6d36bc51eb59d6afa34c1cae3ff0810ef Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 7 Aug 2017 14:10:38 +0300
+Subject: [PATCH] Makefile: build mktables using native gcc
+
+It's a throwaway helper binary used during build, and so it needs to
+be native.
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -343,7 +343,7 @@ version.h: version.sh version.h.in confi
+
+ mktables: kernel-lib/mktables.c
+ @echo " [CC] $@"
+- $(Q)$(CC) $(CFLAGS) $< -o $@
++ $(Q)$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
+
+ # the target can be regenerated manually using mktables, but a local copy is
+ # kept so the build process is simpler
diff --git a/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.13.3.bb b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.13.3.bb
new file mode 100644
index 000000000..bc157e267
--- /dev/null
+++ b/poky/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.13.3.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Checksumming Copy on Write Filesystem utilities"
+DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \
+implementing advanced features while focusing on fault tolerance, repair and \
+easy administration. \
+This package contains utilities (mkfs, fsck, btrfsctl) used to work with \
+btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3."
+
+HOMEPAGE = "https://btrfs.wiki.kernel.org"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067"
+SECTION = "base"
+DEPENDS = "util-linux attr e2fsprogs lzo acl"
+DEPENDS_append_class-target = " udev"
+RDEPENDS_${PN} = "libgcc"
+
+SRCREV = "a7a1ea0f4f2a1d6eeeb3d106e062c7f1034f16d4"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
+ file://0001-Makefile-build-mktables-using-native-gcc.patch \
+ file://0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch \
+ "
+
+RECIPE_NO_UPDATE_REASON = "Waiting for resolution of https://github.com/kdave/btrfs-progs/issues/109"
+inherit autotools-brokensep pkgconfig manpages
+
+CLEANBROKEN = "1"
+
+PACKAGECONFIG[manpages] = "--enable-documentation, --disable-documentation, asciidoc-native xmlto-native"
+EXTRA_OECONF_append_libc-musl = " --disable-backtrace "
+
+do_configure_prepend() {
+ # Upstream doesn't ship this and autoreconf won't install it as automake isn't used.
+ mkdir -p ${S}/config
+ cp -f $(automake --print-libdir)/install-sh ${S}/config/
+}
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/build-compare/build-compare_git.bb b/poky/meta/recipes-devtools/build-compare/build-compare_git.bb
new file mode 100644
index 000000000..efcf6b6dd
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Build Result Compare Script"
+DESCRIPTION = "This package contains scripts to find out if the build result\
+differs to a former build."
+HOMEPAGE = "https://github.com/openSUSE/build-compare"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://github.com/openSUSE/build-compare.git \
+ file://Rename-rpm-check.sh-to-pkg-diff.sh.patch;striplevel=1 \
+ file://Ignore-DWARF-sections.patch;striplevel=1 \
+ file://0001-Add-support-for-deb-and-ipk-packaging.patch \
+ file://functions.sh-remove-space-at-head.patch \
+ file://functions.sh-run-rpm-once-to-make-it-faster.patch \
+ file://pkg-diff.sh-check-for-fifo-named-pipe.patch \
+ file://pkg-diff.sh-check_single_file-return-at-once-when-sa.patch \
+ file://pkg-diff.sh-remove-space-in-the-end-for-ftype.patch \
+ file://functions.sh-improve-deb-and-ipk-checking.patch \
+ "
+
+# Date matches entry in build-compare.changes and date of SRCREV.
+#
+SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
+PE = "1"
+PV = "2015.02.10+git${SRCPV}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 755 functions.sh ${D}/${bindir}
+ install -m 755 pkg-diff.sh ${D}/${bindir}
+ install -m 755 same-build-result.sh ${D}/${bindir}
+ install -m 755 srpm-check.sh ${D}/${bindir}
+}
+
+RDEPENDS_${PN} += "bash"
diff --git a/poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch b/poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
new file mode 100644
index 000000000..82fd8169f
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
@@ -0,0 +1,64 @@
+From 02dbc7e3478e409d6f5e3e1c53daddf8838be999 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 1 Sep 2015 12:04:33 +0100
+Subject: [PATCH] Add support for deb and ipk packaging
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ functions.sh | 15 +++++++++++++++
+ pkg-diff.sh | 6 ++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/functions.sh b/functions.sh
+index 06079df..85c9003 100644
+--- a/functions.sh
++++ b/functions.sh
+@@ -85,6 +85,13 @@ function unpackage()
+ CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
+ rpm2cpio $file | cpio ${CPIO_OPTS}
+ ;;
++ *.ipk|*.deb)
++ ar x $file
++ tar xf control.tar.gz
++ rm control.tar.gz
++ tar xf data.tar.gz
++ rm data.tar.gz
++ ;;
+ esac
+ popd 1>/dev/null
+ }
+@@ -255,4 +262,12 @@ function cmp_spec ()
+ rm $file1 $file2
+ return $RES
+ }
++
++function adjust_controlfile() {
++ cat $1/control | sed '/^Version: /d' > $1/control.fixed
++ mv $1/control.fixed $1/control
++ cat $2/control | sed '/^Version: /d' > $2/control.fixed
++ mv $2/control.fixed $2/control
++}
++
+ # vim: tw=666 ts=2 et
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 0f1fa76..3cf10aa 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -138,6 +138,12 @@ echo "Extracting packages"
+ unpackage $oldpkg $dir/old
+ unpackage $newpkg $dir/new
+
++case $oldpkg in
++ *.deb|*.ipk)
++ adjust_controlfile $dir/old $dir/new
++ ;;
++esac
++
+ # files is set in cmp_spec for rpms, so if RES is empty we should assume
+ # it wasn't an rpm and pick all files for comparison.
+ if [ -z $RES ]; then
+--
+2.1.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch b/poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
new file mode 100644
index 000000000..7dda1acbf
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
@@ -0,0 +1,40 @@
+From 015715694eadd714b903f30ade876e0738d44974 Mon Sep 17 00:00:00 2001
+From: Randy Witt <randy.e.witt@linux.intel.com>
+Date: Mon, 5 Jan 2015 15:09:20 -0800
+Subject: [PATCH] Ignore DWARF sections.
+
+Assume for now that we don't care about the DWARF sections due to path
+differences. However, in the case the tool is ran on a "debug" package
+it will most likely falsely say the packages have no differences.
+
+Upstream-Status: Inappropriate [other]
+
+The package difference tool is correctly labelling the packages as different
+when the DWARF sections don't match due to paths. The paths in the debug info
+should actually be made to be the same using compile flags or some other
+mechanism.
+
+However, to make the tool more useful to Yocto until the work can be done
+to ensure identical paths in debug sections, this patch is being applied.
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+---
+ pkg-diff.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 56035c1..0f1fa76 100755
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -658,7 +658,7 @@ check_single_file()
+ echo "" >$file1
+ echo "" >$file2
+ # Don't compare .build-id and .gnu_debuglink sections
+- sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++ sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" -e "\.debug_abbrev" -e "\.debug_aranges" -e "\.debug_frame" -e "\.debug_info" -e "\.debug_line" -e "\.debug_loc" -e "\.debug_macinfo" -e "\.debug_pubnames" -e "\.debug_pubtypes" -e "\.debug_ranges" -e "\.debug_str" | tr "\n" " ")"
+ for section in $sections; do
+ objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+ objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+--
+1.9.3
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch b/poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
new file mode 100644
index 000000000..cff3a9e23
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
@@ -0,0 +1,1599 @@
+From 4de3df5a1b361cd09a081f0e0bdb94cbf684ed48 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 19 Feb 2015 00:34:47 -0800
+Subject: [PATCH] Rename rpm-check.sh to pkg-diff.sh.
+
+The tool now accepts package input other than rpm, so change the name
+which could be misleading.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pulls]
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+
+Updated for rpm-check.sh.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ build-compare.spec | 2 +-
+ pkg-diff.sh | 765 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ rpm-check.sh | 764 -------------------------------------------------
+ same-build-result.sh | 4 +-
+ 4 files changed, 768 insertions(+), 767 deletions(-)
+ create mode 100644 pkg-diff.sh
+ delete mode 100755 rpm-check.sh
+
+diff --git a/build-compare.spec b/build-compare.spec
+index 14a97e9..5f47ca1 100644
+--- a/build-compare.spec
++++ b/build-compare.spec
+@@ -25,7 +25,7 @@ Version: 2015.02.10
+ Release: 0
+ Source1: COPYING
+ Source2: same-build-result.sh
+-Source3: rpm-check.sh
++Source3: pkg-diff.sh
+ Source4: functions.sh
+ Source5: srpm-check.sh
+ BuildRoot: %{_tmppath}/%{name}-%{version}-build
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+new file mode 100644
+index 0000000..56035c1
+--- /dev/null
++++ b/pkg-diff.sh
+@@ -0,0 +1,765 @@
++#! /bin/bash
++#
++# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
++# Licensed under GPL v2, see COPYING file for details.
++#
++# Written by Michael Matz and Stephan Coolo
++# Enhanced by Andreas Jaeger
++
++FUNCTIONS=${0%/*}/functions.sh
++
++check_all=
++case $1 in
++ -a | --check-all)
++ check_all=1
++ shift
++esac
++
++if test "$#" != 2; then
++ echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
++ exit 1
++fi
++
++self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
++
++source $FUNCTIONS
++
++oldpkg=`readlink -f $1`
++newpkg=`readlink -f $2`
++rename_script=`mktemp`
++
++if test ! -f "$oldpkg"; then
++ echo "can't open $1"
++ exit 1
++fi
++
++if test ! -f "$newpkg"; then
++ echo "can't open $2"
++ exit 1
++fi
++
++#usage unjar <file>
++function unjar()
++{
++ local file
++ file=$1
++
++ if [[ $(type -p fastjar) ]]; then
++ UNJAR=fastjar
++ elif [[ $(type -p jar) ]]; then
++ UNJAR=jar
++ elif [[ $(type -p unzip) ]]; then
++ UNJAR=unzip
++ else
++ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++ exit 1
++ fi
++
++ case $UNJAR in
++ jar|fastjar)
++ # echo jar -xf $file
++ ${UNJAR} -xf $file
++ ;;
++ unzip)
++ unzip -oqq $file
++ ;;
++ esac
++}
++
++# list files in directory
++#usage unjar_l <file>
++function unjar_l()
++{
++ local file
++ file=$1
++
++ if [[ $(type -p fastjar) ]]; then
++ UNJAR=fastjar
++ elif [[ $(type -p jar) ]]; then
++ UNJAR=jar
++ elif [[ $(type -p unzip) ]]; then
++ UNJAR=unzip
++ else
++ echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++ exit 1
++ fi
++
++ case $UNJAR in
++ jar|fastjar)
++ ${UNJAR} -tf $file
++ ;;
++ unzip)
++ unzip -l $file
++ ;;
++ esac
++}
++
++filter_disasm()
++{
++ sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
++}
++
++echo "Comparing `basename $oldpkg` to `basename $newpkg`"
++
++case $oldpkg in
++ *.rpm)
++ cmp_spec $rename_script $oldpkg $newpkg
++ RES=$?
++ case $RES in
++ 0)
++ echo "RPM meta information is identical"
++ if test -z "$check_all"; then
++ exit 0
++ fi
++ ;;
++ 1)
++ echo "RPM meta information is different"
++ if test -z "$check_all"; then
++ exit 1
++ fi
++ ;;
++ 2)
++ echo "RPM file checksum differs."
++ RES=0
++ ;;
++ *)
++ echo "Wrong exit code!"
++ exit 1
++ ;;
++ esac
++ ;;
++esac
++
++file1=`mktemp`
++file2=`mktemp`
++
++dir=`mktemp -d`
++echo "Extracting packages"
++unpackage $oldpkg $dir/old
++unpackage $newpkg $dir/new
++
++# files is set in cmp_spec for rpms, so if RES is empty we should assume
++# it wasn't an rpm and pick all files for comparison.
++if [ -z $RES ]; then
++ oldfiles=`cd $dir/old; find . -type f`
++ newfiles=`cd $dir/new; find . -type f`
++
++ files=`echo -e "$oldfiles\n$newfiles" | sort -u`
++fi
++
++cd $dir
++bash $rename_script
++
++dfile=`mktemp`
++
++diff_two_files()
++{
++ if ! cmp -s old/$file new/$file; then
++ echo "$file differs ($ftype)"
++ hexdump -C old/$file > $file1
++ hexdump -C new/$file > $file2
++ diff -u $file1 $file2 | head -n 200
++ return 1
++ fi
++ return 0
++}
++
++trim_man_first_line()
++{
++ # Handles the first line if it is like:
++ #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
++ #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3.
++ local f=$1
++ sed -i -e '1{
++ s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
++ s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
++ }' $f
++}
++
++trim_man_TH()
++{
++ # Handles lines like:
++ # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
++ # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
++ # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
++ # .TH QEMU-IMG 1 "2010-03-14" " " " "
++ # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
++ # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
++ # .TH gv 3guile "13 May 2010"
++ #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
++ # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
++ # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
++ # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++ # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
++ # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
++ #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
++ local f=$1
++ # (.TH quoted section) (quoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
++ # (.TH unquoted section) (quoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
++ # (.TH quoted section) (unquoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
++ # (.TH unquoted section) (unquoted_date)(*)
++ sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
++}
++
++strip_numbered_anchors()
++{
++ # Remove numbered anchors on Docbook / HTML files.
++ # This should be save since we remove them from old and new files.
++ # A trailing </a> or </div> tag will stay also on both files.
++ for f in old/$file new/$file; do
++ sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
++ -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
++ -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
++ done
++}
++
++
++check_compressed_file()
++{
++ local file=$1
++ local ext=$2
++ local tmpdir=`mktemp -d`
++ local ftype
++ local ret=0
++ echo "$ext file with odd filename: $file"
++ if test -n "$tmpdir"; then
++ mkdir $tmpdir/{old,new}
++ cp --parents --dereference old/$file $tmpdir/
++ cp --parents --dereference new/$file $tmpdir/
++ if pushd $tmpdir > /dev/null ; then
++ case "$ext" in
++ bz2)
++ mv old/$file{,.bz2}
++ mv new/$file{,.bz2}
++ bzip2 -d old/$file.bz2
++ bzip2 -d new/$file.bz2
++ ;;
++ gzip)
++ mv old/$file{,.gz}
++ mv new/$file{,.gz}
++ gzip -d old/$file.gz
++ gzip -d new/$file.gz
++ ;;
++ xz)
++ mv old/$file{,.xz}
++ mv new/$file{,.xz}
++ xz -d old/$file.xz
++ xz -d new/$file.xz
++ ;;
++ esac
++ ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++ case $ftype in
++ POSIX\ tar\ archive)
++ echo "$ext content is: $ftype"
++ mv old/$file{,.tar}
++ mv new/$file{,.tar}
++ if ! check_single_file ${file}.tar; then
++ ret=1
++ fi
++ ;;
++ ASCII\ cpio\ archive\ *)
++ echo "$ext content is: $ftype"
++ mv old/$file{,.cpio}
++ mv new/$file{,.cpio}
++ if ! check_single_file ${file}.cpio; then
++ ret=1
++ fi
++ ;;
++ *)
++ echo "unhandled $ext content: $ftype"
++ if ! diff_two_files; then
++ ret=1
++ fi
++ ;;
++ esac
++ popd > /dev/null
++ fi
++ rm -rf "$tmpdir"
++ fi
++ return $ret
++}
++
++check_single_file()
++{
++ local file="$1"
++ case $file in
++ *.spec)
++ sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
++ sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
++ ;;
++ *.exe.mdb|*.dll.mdb)
++ # Just debug information, we can skip them
++ echo "$file skipped as debug file."
++ return 0
++ ;;
++ *.a)
++ flist=`ar t new/$file`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ ar x `basename $file`
++ cd $pwd/new/$fdir
++ ar x `basename $file`
++ cd $pwd
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ return 1
++ fi
++ done
++ return 0
++ ;;
++ *.cpio)
++ flist=`cpio --quiet --list --force-local < "new/$file"`
++ pwd=$PWD
++ fdir=$file.extract.$PPID.$$
++ mkdir old/$fdir new/$fdir
++ cd old/$fdir
++ cpio --quiet --extract --force-local < "../${file##*/}"
++ cd $pwd/new/$fdir
++ cpio --quiet --extract --force-local < "../${file##*/}"
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ rm -rf old/$fdir new/$fdir
++ return $ret
++ ;;
++ *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
++ flist=`tar tf new/$file`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ tar xf `basename $file`
++ cd $pwd/new/$fdir
++ tar xf `basename $file`
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ return $ret
++ ;;
++ *.zip|*.jar|*.war)
++ cd old
++ unjar_l ./$file |sort > flist
++ # 10-05-2010 14:39
++ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
++ # 2012-02-03 07:59
++ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++ cd ../new
++ unjar_l ./$file |sort> flist
++ sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
++ sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++ cd ..
++ if ! cmp -s old/flist new/flist; then
++ echo "$file has different file list"
++ diff -u old/flist new/flist
++ return 1
++ fi
++ flist=`grep date new/flist | sed -e 's,.* date ,,'`
++ pwd=$PWD
++ fdir=`dirname $file`
++ cd old/$fdir
++ unjar `basename $file`
++ cd $pwd/new/$fdir
++ unjar `basename $file`
++ cd $pwd
++ local ret=0
++ for f in $flist; do
++ if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++ done
++ return $ret;;
++ *.pyc|*.pyo)
++ perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++ perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++ ;;
++ *.bz2)
++ bunzip2 -c old/$file > old/${file/.bz2/}
++ bunzip2 -c new/$file > new/${file/.bz2/}
++ check_single_file ${file/.bz2/}
++ return $?
++ ;;
++ *.gz)
++ gunzip -c old/$file > old/${file/.gz/}
++ gunzip -c new/$file > new/${file/.gz/}
++ check_single_file ${file/.gz/}
++ return $?
++ ;;
++ *.rpm)
++ $self_script -a old/$file new/$file
++ return $?
++ ;;
++ *png)
++ # Try to remove timestamps, only if convert from ImageMagick is installed
++ if [[ $(type -p convert) ]]; then
++ convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
++ convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
++ if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
++ echo "$file differs ($ftype)"
++ hexdump -C old/${file/.png/_n.png} > $file1
++ hexdump -C new/${file/.png/_n.png} > $file2
++ diff -u $file1 $file2 | head -n 20
++ return 1
++ fi
++ return 0
++ fi
++ ;;
++ /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
++ for f in old/$file new/$file; do
++ sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
++ done
++ ;;
++ /usr/share/doc/packages/*/*.html|\
++ /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
++ for f in old/$file new/$file; do
++ # texi2html output, e.g. in kvm, indent, qemu
++ sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
++ sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$| This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
++ # doxygen docu, e.g. in libssh and log4c
++ sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++ # Generated on Sat Aug 14 2010 16:49:48 for libssh
++ sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++ done
++ strip_numbered_anchors
++ ;;
++ /usr/share/javadoc/*.html |\
++ /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
++ strip_numbered_anchors
++ # There are more timestamps in html, so far we handle only some primitive versions.
++ for f in old/$file new/$file; do
++ # Javadoc:
++ # <head>
++ # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
++ # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
++ # <meta name="date" content="2015-02-03">
++ # </head>
++ sed -i -e '
++ /^<head>/{
++ : next
++ n
++ /^<\/head>/{
++ b end_head
++ }
++ s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
++ t next
++ s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
++ t next
++ s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
++ b next
++ }
++ : end_head
++ ' $f
++ # Gjdoc HtmlDoclet:
++ sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
++ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
++ sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
++ # deprecated-list is randomly ordered, sort it for comparison
++ case $f in
++ */deprecated-list.html)
++ sort -o $f $f
++ ;;
++ esac
++ done
++ ;;
++ /usr/share/javadoc/gjdoc.properties |\
++ /usr/share/javadoc/*/gjdoc.properties)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
++ done
++ ;;
++ */fonts.scale|*/fonts.dir|*/encodings.dir)
++ for f in old/$file new/$file; do
++ # sort files before comparing
++ sort -o $f $f
++ done
++ ;;
++ /var/adm/perl-modules/*)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul 1 00:00:00 2009: C<Module>|' $f
++ done
++ ;;
++ /usr/share/man/man3/*3pm)
++ for f in old/$file new/$file; do
++ sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
++ trim_man_TH $f
++ trim_man_first_line $f
++ done
++ ;;
++ /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
++
++ for f in old/$file new/$file; do
++ trim_man_TH $f
++ trim_man_first_line $f
++ # generated by docbook xml:
++ #.\" Date: 09/13/2010
++ sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
++ done
++ ;;
++ *.elc)
++ # emacs lisp files
++ for f in old/$file new/$file; do
++ sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
++ done
++ ;;
++ /var/lib/texmf/web2c/*/*fmt |\
++ /var/lib/texmf/web2c/metafont/*.base|\
++ /var/lib/texmf/web2c/metapost/*.mem)
++ # binary dump of TeX and Metafont formats, we can ignore them for good
++ echo "difference in $file ignored."
++ return 0
++ ;;
++ */libtool)
++ for f in old/$file new/$file; do
++ sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
++ done
++ ;;
++ /etc/mail/*cf|/etc/sendmail.cf)
++ # from sendmail package
++ for f in old/$file new/$file; do
++ # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
++ sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
++ done
++ ;;
++ /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
++ /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
++ # various kde and gtk packages
++ strip_numbered_anchors
++ ;;
++ */created.rid)
++ # ruby documentation
++ # file just contains a timestamp and nothing else, so ignore it
++ echo "Ignore $file"
++ return 0
++ ;;
++ */rdoc/files/*.html)
++ # ruby documentation
++ # <td>Mon Sep 20 19:02:43 +0000 2010</td>
++ for f in old/$file new/$file; do
++ sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
++ done
++ strip_numbered_anchors
++ ;;
++ */Linux*Env.Set.sh)
++ # LibreOffice files, contains:
++ # Generated on: Mon Apr 18 13:19:22 UTC 2011
++ for f in old/$file new/$file; do
++ sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
++ done
++ ;;
++ /usr/lib/libreoffice/solver/inc/*/deliver.log)
++ # LibreOffice log file
++ echo "Ignore $file"
++ return 0
++ ;;
++ /var/adm/update-messages/*|/var/adm/update-scripts/*)
++ # encode version-release inside
++ oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
++
++ # fetchmsttfonts embeds the release number in the update shell script.
++ echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++ sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++
++ if ! diff -u old/$oldfn new/$file; then
++ echo "$oldfn is not same as $file"
++ return 1
++ fi
++ echo "$file and $oldfn are same"
++ return 0
++ ;;
++ *.ps)
++ for f in "old/$file" "new/$file"; do
++ sed -i -e '
++ /^%%CreationDate:[[:blank:]]/d
++ /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
++ /^%DVIPSSource:[[:blank:]]/d
++ ' "$f"
++ done
++ ;;
++ *pdf)
++ # PDF files contain a unique ID, remove it
++ # Format of the ID is:
++ # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
++ # with optional spaces. pdftex creates also:
++ # /CreationDate (D:20120103083206Z)
++ # /ModDate (D:20120103083206Z)
++ # and possibly XML metadata as well
++ for f in "old/$file" "new/$file"; do
++ sed -i \
++ '/obj/,/endobj/{
++ s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
++ s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
++ s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
++ s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
++ s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
++ s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
++ s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
++ s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
++ }' "$f"
++ done
++ ;;
++ esac
++
++ ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++ case $ftype in
++ PE32\ executable*Mono\/\.Net\ assembly*)
++ echo "PE32 Mono/.Net assembly: $file"
++ if [ -x /usr/bin/monodis ] ; then
++ monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
++ monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
++ if ! cmp -s ${file1} ${file2}; then
++ echo "$file differs ($ftype)"
++ diff -u ${file1} ${file2}
++ return 1
++ fi
++ else
++ echo "Cannot compare, no monodis installed"
++ return 1
++ fi
++ ;;
++ ELF*executable*|ELF*[LM]SB\ shared\ object*)
++ objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
++ if ! test -s $file1; then
++ # objdump has no idea how to handle it
++ if ! diff_two_files; then
++ ret=1
++ break
++ fi
++ fi
++ elfdiff=
++ sed -i -e "s,old/,," $file1
++ objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
++ sed -i -e "s,new/,," $file2
++ if ! diff -u $file1 $file2 > $dfile; then
++ echo "$file differs in assembler output"
++ head -n 200 $dfile
++ elfdiff="1"
++ fi
++ echo "" >$file1
++ echo "" >$file2
++ # Don't compare .build-id and .gnu_debuglink sections
++ sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++ for section in $sections; do
++ objdump -s -j $section old/$file | sed "s,^old/,," > $file1
++ objdump -s -j $section new/$file | sed "s,^new/,," > $file2
++ if ! diff -u $file1 $file2 > $dfile; then
++ echo "$file differs in ELF section $section"
++ head -n 200 $dfile
++ elfdiff="1"
++ fi
++ done
++ if test -z "$elfdiff"; then
++ echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
++ return 0
++ fi
++ return 1
++ ;;
++ *ASCII*|*text*)
++ if ! cmp -s old/$file new/$file; then
++ echo "$file differs ($ftype)"
++ diff -u old/$file new/$file | head -n 200
++ return 1
++ fi
++ ;;
++ directory|setuid,\ directory|sticky,\ directory)
++ # tar might package directories - ignore them here
++ return 0
++ ;;
++ bzip2\ compressed\ data*)
++ if ! check_compressed_file "$file" "bz2"; then
++ return 1
++ fi
++ ;;
++ gzip\ compressed\ data*)
++ if ! check_compressed_file "$file" "gzip"; then
++ return 1
++ fi
++ ;;
++ XZ\ compressed\ data*)
++ if ! check_compressed_file "$file" "xz"; then
++ return 1
++ fi
++ ;;
++ POSIX\ tar\ archive)
++ mv old/$file{,.tar}
++ mv new/$file{,.tar}
++ if ! check_single_file ${file}.tar; then
++ return 1
++ fi
++ ;;
++ cpio\ archive)
++ mv old/$file{,.cpio}
++ mv new/$file{,.cpio}
++ if ! check_single_file ${file}.cpio; then
++ return 1
++ fi
++ ;;
++ symbolic\ link\ to\ *)
++ readlink "old/$file" > $file1
++ readlink "new/$file" > $file2
++ if ! diff -u $file1 $file2; then
++ echo "symlink target for $file differs"
++ return 1
++ fi
++ ;;
++ *)
++ if ! diff_two_files; then
++ return 1
++ fi
++ ;;
++ esac
++ return 0
++}
++
++# We need /proc mounted for some tests, so check that it's mounted and
++# complain if not.
++PROC_MOUNTED=0
++if [ ! -d /proc/self/ ]; then
++ echo "/proc is not mounted"
++ mount -orw -n -tproc none /proc
++ PROC_MOUNTED=1
++fi
++
++# preserve cmp_spec result for check_all runs
++ret=$RES
++for file in $files; do
++ if ! check_single_file $file; then
++ ret=1
++ if test -z "$check_all"; then
++ break
++ fi
++ fi
++done
++
++if [ "$PROC_MOUNTED" -eq "1" ]; then
++ echo "Unmounting proc"
++ umount /proc
++fi
++
++rm $file1 $file2 $dfile $rename_script
++rm -rf $dir
++if test "$ret" = 0; then
++ echo "Package content is identical"
++fi
++exit $ret
++# vim: tw=666 ts=2 et
+diff --git a/rpm-check.sh b/rpm-check.sh
+deleted file mode 100755
+index dd47642..0000000
+--- a/rpm-check.sh
++++ /dev/null
+@@ -1,764 +0,0 @@
+-#! /bin/bash
+-#
+-# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
+-# Licensed under GPL v2, see COPYING file for details.
+-#
+-# Written by Michael Matz and Stephan Coolo
+-# Enhanced by Andreas Jaeger
+-
+-FUNCTIONS=${0%/*}/functions.sh
+-
+-check_all=
+-case $1 in
+- -a | --check-all)
+- check_all=1
+- shift
+-esac
+-
+-if test "$#" != 2; then
+- echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
+- exit 1
+-fi
+-
+-self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
+-
+-source $FUNCTIONS
+-
+-oldpkg=`readlink -f $1`
+-newpkg=`readlink -f $2`
+-rename_script=`mktemp`
+-
+-if test ! -f "$oldpkg"; then
+- echo "can't open $1"
+- exit 1
+-fi
+-
+-if test ! -f "$newpkg"; then
+- echo "can't open $2"
+- exit 1
+-fi
+-
+-#usage unjar <file>
+-function unjar()
+-{
+- local file
+- file=$1
+-
+- if [[ $(type -p fastjar) ]]; then
+- UNJAR=fastjar
+- elif [[ $(type -p jar) ]]; then
+- UNJAR=jar
+- elif [[ $(type -p unzip) ]]; then
+- UNJAR=unzip
+- else
+- echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+- exit 1
+- fi
+-
+- case $UNJAR in
+- jar|fastjar)
+- # echo jar -xf $file
+- ${UNJAR} -xf $file
+- ;;
+- unzip)
+- unzip -oqq $file
+- ;;
+- esac
+-}
+-
+-# list files in directory
+-#usage unjar_l <file>
+-function unjar_l()
+-{
+- local file
+- file=$1
+-
+- if [[ $(type -p fastjar) ]]; then
+- UNJAR=fastjar
+- elif [[ $(type -p jar) ]]; then
+- UNJAR=jar
+- elif [[ $(type -p unzip) ]]; then
+- UNJAR=unzip
+- else
+- echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+- exit 1
+- fi
+-
+- case $UNJAR in
+- jar|fastjar)
+- ${UNJAR} -tf $file
+- ;;
+- unzip)
+- unzip -l $file
+- ;;
+- esac
+-}
+-
+-filter_disasm()
+-{
+- sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/# /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/'
+-}
+-
+-echo "Comparing `basename $oldpkg` to `basename $newpkg`"
+-
+-case $oldpkg in
+- *.rpm)
+- cmp_spec $rename_script $oldpkg $newpkg
+- RES=$?
+- case $RES in
+- 0)
+- echo "RPM meta information is identical"
+- if test -z "$check_all"; then
+- exit 0
+- fi
+- ;;
+- 1)
+- echo "RPM meta information is different"
+- if test -z "$check_all"; then
+- exit 1
+- fi
+- ;;
+- 2)
+- echo "RPM file checksum differs."
+- RES=0
+- ;;
+- *)
+- echo "Wrong exit code!"
+- exit 1
+- ;;
+- esac
+- ;;
+-esac
+-
+-file1=`mktemp`
+-file2=`mktemp`
+-
+-dir=`mktemp -d`
+-echo "Extracting packages"
+-unpackage $oldpkg $dir/old
+-unpackage $newpkg $dir/new
+-
+-# files is set in cmp_spec for rpms, so if RES is empty we should assume
+-# it wasn't an rpm and pick all files for comparison.
+-if [ -z $RES ]; then
+- oldfiles=`cd $dir/old; find . -type f`
+- newfiles=`cd $dir/new; find . -type f`
+-
+- files=`echo -e "$oldfiles\n$newfiles" | sort -u`
+-fi
+-
+-cd $dir
+-bash $rename_script
+-
+-dfile=`mktemp`
+-
+-diff_two_files()
+-{
+- if ! cmp -s old/$file new/$file; then
+- echo "$file differs ($ftype)"
+- hexdump -C old/$file > $file1
+- hexdump -C new/$file > $file2
+- diff -u $file1 $file2 | head -n 200
+- return 1
+- fi
+- return 0
+-}
+-
+-trim_man_first_line()
+-{
+- # Handles the first line if it is like:
+- #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+- #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3.
+- local f=$1
+- sed -i -e '1{
+- s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
+- s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
+- }' $f
+-}
+-
+-trim_man_TH()
+-{
+- # Handles lines like:
+- # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
+- # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
+- # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
+- # .TH QEMU-IMG 1 "2010-03-14" " " " "
+- # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
+- # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
+- # .TH gv 3guile "13 May 2010"
+- #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
+- # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
+- # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
+- # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+- # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
+- # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
+- #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
+- local f=$1
+- # (.TH quoted section) (quoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
+- # (.TH unquoted section) (quoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
+- # (.TH quoted section) (unquoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
+- # (.TH unquoted section) (unquoted_date)(*)
+- sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
+-}
+-
+-strip_numbered_anchors()
+-{
+- # Remove numbered anchors on Docbook / HTML files.
+- # This should be save since we remove them from old and new files.
+- # A trailing </a> or </div> tag will stay also on both files.
+- for f in old/$file new/$file; do
+- sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
+- -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
+- -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
+- done
+-}
+-
+-
+-check_compressed_file()
+-{
+- local file=$1
+- local ext=$2
+- local tmpdir=`mktemp -d`
+- local ftype
+- local ret=0
+- echo "$ext file with odd filename: $file"
+- if test -n "$tmpdir"; then
+- mkdir $tmpdir/{old,new}
+- cp --parents --dereference old/$file $tmpdir/
+- cp --parents --dereference new/$file $tmpdir/
+- if pushd $tmpdir > /dev/null ; then
+- case "$ext" in
+- bz2)
+- mv old/$file{,.bz2}
+- mv new/$file{,.bz2}
+- bzip2 -d old/$file.bz2
+- bzip2 -d new/$file.bz2
+- ;;
+- gzip)
+- mv old/$file{,.gz}
+- mv new/$file{,.gz}
+- gzip -d old/$file.gz
+- gzip -d new/$file.gz
+- ;;
+- xz)
+- mv old/$file{,.xz}
+- mv new/$file{,.xz}
+- xz -d old/$file.xz
+- xz -d new/$file.xz
+- ;;
+- esac
+- ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+- case $ftype in
+- POSIX\ tar\ archive)
+- echo "$ext content is: $ftype"
+- mv old/$file{,.tar}
+- mv new/$file{,.tar}
+- if ! check_single_file ${file}.tar; then
+- ret=1
+- fi
+- ;;
+- ASCII\ cpio\ archive\ *)
+- echo "$ext content is: $ftype"
+- mv old/$file{,.cpio}
+- mv new/$file{,.cpio}
+- if ! check_single_file ${file}.cpio; then
+- ret=1
+- fi
+- ;;
+- *)
+- echo "unhandled $ext content: $ftype"
+- if ! diff_two_files; then
+- ret=1
+- fi
+- ;;
+- esac
+- popd > /dev/null
+- fi
+- rm -rf "$tmpdir"
+- fi
+- return $ret
+-}
+-
+-check_single_file()
+-{
+- local file="$1"
+- case $file in
+- *.spec)
+- sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+- sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
+- ;;
+- *.exe.mdb|*.dll.mdb)
+- # Just debug information, we can skip them
+- echo "$file skipped as debug file."
+- return 0
+- ;;
+- *.a)
+- flist=`ar t new/$file`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- ar x `basename $file`
+- cd $pwd/new/$fdir
+- ar x `basename $file`
+- cd $pwd
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- return 1
+- fi
+- done
+- return 0
+- ;;
+- *.cpio)
+- flist=`cpio --quiet --list --force-local < "new/$file"`
+- pwd=$PWD
+- fdir=$file.extract.$PPID.$$
+- mkdir old/$fdir new/$fdir
+- cd old/$fdir
+- cpio --quiet --extract --force-local < "../${file##*/}"
+- cd $pwd/new/$fdir
+- cpio --quiet --extract --force-local < "../${file##*/}"
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- rm -rf old/$fdir new/$fdir
+- return $ret
+- ;;
+- *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
+- flist=`tar tf new/$file`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- tar xf `basename $file`
+- cd $pwd/new/$fdir
+- tar xf `basename $file`
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- return $ret
+- ;;
+- *.zip|*.jar|*.war)
+- cd old
+- unjar_l ./$file |sort > flist
+- # 10-05-2010 14:39
+- sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
+- # 2012-02-03 07:59
+- sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+- cd ../new
+- unjar_l ./$file |sort> flist
+- sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
+- sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+- cd ..
+- if ! cmp -s old/flist new/flist; then
+- echo "$file has different file list"
+- diff -u old/flist new/flist
+- return 1
+- fi
+- flist=`grep date new/flist | sed -e 's,.* date ,,'`
+- pwd=$PWD
+- fdir=`dirname $file`
+- cd old/$fdir
+- unjar `basename $file`
+- cd $pwd/new/$fdir
+- unjar `basename $file`
+- cd $pwd
+- local ret=0
+- for f in $flist; do
+- if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+- done
+- return $ret;;
+- *.pyc|*.pyo)
+- perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+- perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+- ;;
+- *.bz2)
+- bunzip2 -c old/$file > old/${file/.bz2/}
+- bunzip2 -c new/$file > new/${file/.bz2/}
+- check_single_file ${file/.bz2/}
+- return $?
+- ;;
+- *.gz)
+- gunzip -c old/$file > old/${file/.gz/}
+- gunzip -c new/$file > new/${file/.gz/}
+- check_single_file ${file/.gz/}
+- return $?
+- ;;
+- *.rpm)
+- $self_script -a old/$file new/$file
+- return $?
+- ;;
+- *png)
+- # Try to remove timestamps, only if convert from ImageMagick is installed
+- if [[ $(type -p convert) ]]; then
+- convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
+- convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
+- if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
+- echo "$file differs ($ftype)"
+- hexdump -C old/${file/.png/_n.png} > $file1
+- hexdump -C new/${file/.png/_n.png} > $file2
+- diff -u $file1 $file2 | head -n 20
+- return 1
+- fi
+- return 0
+- fi
+- ;;
+- /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
+- for f in old/$file new/$file; do
+- sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
+- done
+- ;;
+- /usr/share/doc/packages/*/*.html|\
+- /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
+- for f in old/$file new/$file; do
+- # texi2html output, e.g. in kvm, indent, qemu
+- sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
+- sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$| This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
+- # doxygen docu, e.g. in libssh and log4c
+- sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+- # Generated on Sat Aug 14 2010 16:49:48 for libssh
+- sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+- done
+- strip_numbered_anchors
+- ;;
+- /usr/share/javadoc/*.html |\
+- /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
+- strip_numbered_anchors
+- # There are more timestamps in html, so far we handle only some primitive versions.
+- for f in old/$file new/$file; do
+- # Javadoc:
+- # <head>
+- # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
+- # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
+- # <meta name="date" content="2015-02-03">
+- # </head>
+- sed -i -e '
+- /^<head>/{
+- : next
+- n
+- /^<\/head>/{
+- b end_head
+- }
+- s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
+- t next
+- s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
+- t next
+- s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
+- b next
+- }
+- : end_head
+- ' $f
+- # Gjdoc HtmlDoclet:
+- sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
+- sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
+- sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
+- # deprecated-list is randomly ordered, sort it for comparison
+- case $f in
+- */deprecated-list.html)
+- sort -o $f $f
+- ;;
+- esac
+- done
+- ;;
+- /usr/share/javadoc/gjdoc.properties |\
+- /usr/share/javadoc/*/gjdoc.properties)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
+- done
+- ;;
+- */fonts.scale|*/fonts.dir|*/encodings.dir)
+- for f in old/$file new/$file; do
+- # sort files before comparing
+- sort -o $f $f
+- done
+- ;;
+- /var/adm/perl-modules/*)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul 1 00:00:00 2009: C<Module>|' $f
+- done
+- ;;
+- /usr/share/man/man3/*3pm)
+- for f in old/$file new/$file; do
+- sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
+- trim_man_TH $f
+- trim_man_first_line $f
+- done
+- ;;
+- /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
+-
+- for f in old/$file new/$file; do
+- trim_man_TH $f
+- trim_man_first_line $f
+- # generated by docbook xml:
+- #.\" Date: 09/13/2010
+- sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
+- done
+- ;;
+- *.elc)
+- # emacs lisp files
+- for f in old/$file new/$file; do
+- sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
+- done
+- ;;
+- /var/lib/texmf/web2c/*/*fmt |\
+- /var/lib/texmf/web2c/metafont/*.base|\
+- /var/lib/texmf/web2c/metapost/*.mem)
+- # binary dump of TeX and Metafont formats, we can ignore them for good
+- echo "difference in $file ignored."
+- return 0
+- ;;
+- */libtool)
+- for f in old/$file new/$file; do
+- sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
+- done
+- ;;
+- /etc/mail/*cf|/etc/sendmail.cf)
+- # from sendmail package
+- for f in old/$file new/$file; do
+- # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
+- sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
+- done
+- ;;
+- /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
+- /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
+- # various kde and gtk packages
+- strip_numbered_anchors
+- ;;
+- */created.rid)
+- # ruby documentation
+- # file just contains a timestamp and nothing else, so ignore it
+- echo "Ignore $file"
+- return 0
+- ;;
+- */rdoc/files/*.html)
+- # ruby documentation
+- # <td>Mon Sep 20 19:02:43 +0000 2010</td>
+- for f in old/$file new/$file; do
+- sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
+- done
+- strip_numbered_anchors
+- ;;
+- */Linux*Env.Set.sh)
+- # LibreOffice files, contains:
+- # Generated on: Mon Apr 18 13:19:22 UTC 2011
+- for f in old/$file new/$file; do
+- sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
+- done
+- ;;
+- /usr/lib/libreoffice/solver/inc/*/deliver.log)
+- # LibreOffice log file
+- echo "Ignore $file"
+- return 0
+- ;;
+- /var/adm/update-messages/*|/var/adm/update-scripts/*)
+- # encode version-release inside
+- oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
+-
+- # fetchmsttfonts embeds the release number in the update shell script.
+- echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+- sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+-
+- if ! diff -u old/$oldfn new/$file; then
+- echo "$oldfn is not same as $file"
+- return 1
+- fi
+- echo "$file and $oldfn are same"
+- return 0
+- ;;
+- *.ps)
+- for f in "old/$file" "new/$file"; do
+- sed -i -e '
+- /^%%CreationDate:[[:blank:]]/d
+- /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
+- ' "$f"
+- done
+- ;;
+- *pdf)
+- # PDF files contain a unique ID, remove it
+- # Format of the ID is:
+- # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
+- # with optional spaces. pdftex creates also:
+- # /CreationDate (D:20120103083206Z)
+- # /ModDate (D:20120103083206Z)
+- # and possibly XML metadata as well
+- for f in "old/$file" "new/$file"; do
+- sed -i \
+- '/obj/,/endobj/{
+- s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
+- s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
+- s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
+- s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
+- s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
+- s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
+- s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
+- s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
+- }' "$f"
+- done
+- ;;
+- esac
+-
+- ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+- case $ftype in
+- PE32\ executable*Mono\/\.Net\ assembly*)
+- echo "PE32 Mono/.Net assembly: $file"
+- if [ -x /usr/bin/monodis ] ; then
+- monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
+- monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
+- if ! cmp -s ${file1} ${file2}; then
+- echo "$file differs ($ftype)"
+- diff -u ${file1} ${file2}
+- return 1
+- fi
+- else
+- echo "Cannot compare, no monodis installed"
+- return 1
+- fi
+- ;;
+- ELF*executable*|ELF*[LM]SB\ shared\ object*)
+- objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
+- if ! test -s $file1; then
+- # objdump has no idea how to handle it
+- if ! diff_two_files; then
+- ret=1
+- break
+- fi
+- fi
+- elfdiff=
+- sed -i -e "s,old/,," $file1
+- objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
+- sed -i -e "s,new/,," $file2
+- if ! diff -u $file1 $file2 > $dfile; then
+- echo "$file differs in assembler output"
+- head -n 200 $dfile
+- elfdiff="1"
+- fi
+- echo "" >$file1
+- echo "" >$file2
+- # Don't compare .build-id and .gnu_debuglink sections
+- sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
+- for section in $sections; do
+- objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+- objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+- if ! diff -u $file1 $file2 > $dfile; then
+- echo "$file differs in ELF section $section"
+- head -n 200 $dfile
+- elfdiff="1"
+- fi
+- done
+- if test -z "$elfdiff"; then
+- echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
+- return 0
+- fi
+- return 1
+- ;;
+- *ASCII*|*text*)
+- if ! cmp -s old/$file new/$file; then
+- echo "$file differs ($ftype)"
+- diff -u old/$file new/$file | head -n 200
+- return 1
+- fi
+- ;;
+- directory|setuid,\ directory|sticky,\ directory)
+- # tar might package directories - ignore them here
+- return 0
+- ;;
+- bzip2\ compressed\ data*)
+- if ! check_compressed_file "$file" "bz2"; then
+- return 1
+- fi
+- ;;
+- gzip\ compressed\ data*)
+- if ! check_compressed_file "$file" "gzip"; then
+- return 1
+- fi
+- ;;
+- XZ\ compressed\ data*)
+- if ! check_compressed_file "$file" "xz"; then
+- return 1
+- fi
+- ;;
+- POSIX\ tar\ archive)
+- mv old/$file{,.tar}
+- mv new/$file{,.tar}
+- if ! check_single_file ${file}.tar; then
+- return 1
+- fi
+- ;;
+- cpio\ archive)
+- mv old/$file{,.cpio}
+- mv new/$file{,.cpio}
+- if ! check_single_file ${file}.cpio; then
+- return 1
+- fi
+- ;;
+- symbolic\ link\ to\ *)
+- readlink "old/$file" > $file1
+- readlink "new/$file" > $file2
+- if ! diff -u $file1 $file2; then
+- echo "symlink target for $file differs"
+- return 1
+- fi
+- ;;
+- *)
+- if ! diff_two_files; then
+- return 1
+- fi
+- ;;
+- esac
+- return 0
+-}
+-
+-# We need /proc mounted for some tests, so check that it's mounted and
+-# complain if not.
+-PROC_MOUNTED=0
+-if [ ! -d /proc/self/ ]; then
+- echo "/proc is not mounted"
+- mount -orw -n -tproc none /proc
+- PROC_MOUNTED=1
+-fi
+-
+-# preserve cmp_spec result for check_all runs
+-ret=$RES
+-for file in $files; do
+- if ! check_single_file $file; then
+- ret=1
+- if test -z "$check_all"; then
+- break
+- fi
+- fi
+-done
+-
+-if [ "$PROC_MOUNTED" -eq "1" ]; then
+- echo "Unmounting proc"
+- umount /proc
+-fi
+-
+-rm $file1 $file2 $dfile $rename_script
+-rm -rf $dir
+-if test "$ret" = 0; then
+- echo "Package content is identical"
+-fi
+-exit $ret
+-# vim: tw=666 ts=2 et
+diff --git a/same-build-result.sh b/same-build-result.sh
+index c8907e2..7e9bd4f 100644
+--- a/same-build-result.sh
++++ b/same-build-result.sh
+@@ -7,11 +7,11 @@
+ # Enhanced by Andreas Jaeger <aj@suse.de>
+ #
+ # The script decides if the new build differes from the former one,
+-# using rpm-check.sh.
++# using pkg-diff.sh.
+ # The script is called as part of the build process as:
+ # /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS
+
+-CMPSCRIPT=${0%/*}/rpm-check.sh
++CMPSCRIPT=${0%/*}/pkg-diff.sh
+ SCMPSCRIPT=${0%/*}/srpm-check.sh
+
+ check_all=1
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch b/poky/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch
new file mode 100644
index 000000000..05420f89f
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/functions.sh-improve-deb-and-ipk-checking.patch
@@ -0,0 +1,117 @@
+From b4eb7fde10318162bd2d02b9017ef51746752a91 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 14 Jul 2016 23:14:21 -0700
+Subject: [PATCH 4/4] functions.sh: improve deb and ipk checking
+
+* The deb and ipk's depends version string is like:
+ Depends: libc6 (>= 2.24)
+ Update trim_release_old and trim_release_new to match the bracket in
+ the end ")".
+
+* The deb's data tarball now is .tar.xz, and ipk's is .tar.gz.
+
+* Update adjust_controlfile() to make ituse trim_release_old and
+ trim_release_new.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ functions.sh | 45 ++++++++++++++++++++++++++++-----------------
+ 1 file changed, 28 insertions(+), 17 deletions(-)
+
+diff --git a/functions.sh b/functions.sh
+index aa572f9..fe493ba 100755
+--- a/functions.sh
++++ b/functions.sh
+@@ -78,7 +78,7 @@ check_header()
+ function trim_release_old()
+ {
+ sed -e "
+- /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
++ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\|$version_release_old_regex_l)\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
+ s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
+ s/^ *//g
+ "
+@@ -86,7 +86,7 @@ function trim_release_old()
+ function trim_release_new()
+ {
+ sed -e "
+- /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
++ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\|$version_release_new_regex_l)\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
+ s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
+ s/^ *//g
+ "
+@@ -133,8 +133,8 @@ function unpackage()
+ ar x $file
+ tar xf control.tar.gz
+ rm control.tar.gz
+- tar xf data.tar.gz
+- rm data.tar.gz
++ tar xf data.tar.[xg]z
++ rm data.tar.[xg]z
+ ;;
+ esac
+ popd 1>/dev/null
+@@ -164,6 +164,22 @@ function get_value()
+ sed -n -e "/^___${1}___/,/^___${1}___/p" $2 | sed -e "/^___${1}___/d"
+ }
+
++# Set version_release_old_regex_s, version_release_old_regex_l and
++# name_ver_rel_old_regex_l, also the new ones.
++function set_regex() {
++ # Remember to quote the . which is in release
++ # Short version without B_CN
++ version_release_old_regex_s=${version_release_old%.*}
++ version_release_old_regex_s=${version_release_old_regex_s//./\\.}
++ version_release_new_regex_s=${version_release_new%.*}
++ version_release_new_regex_s=${version_release_new_regex_s//./\\.}
++ # Long version with B_CNT
++ version_release_old_regex_l=${version_release_old//./\\.}
++ version_release_new_regex_l=${version_release_new//./\\.}
++ name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
++ name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
++}
++
+ # Compare just the rpm meta data of two rpms
+ # Returns:
+ # 0 in case of same content
+@@ -194,17 +210,7 @@ function cmp_spec ()
+ version_release_old="$(get_value QF_VER_REL $spec_old)"
+ name_ver_rel_old="$(get_value QF_NAME_VER_REL $spec_old)"
+
+- # Remember to quote the . which is in release
+- # Short version without B_CN
+- version_release_old_regex_s=${version_release_old%.*}
+- version_release_old_regex_s=${version_release_old_regex_s//./\\.}
+- version_release_new_regex_s=${version_release_new%.*}
+- version_release_new_regex_s=${version_release_new_regex_s//./\\.}
+- # Long version with B_CNT
+- version_release_old_regex_l=${version_release_old//./\\.}
+- version_release_new_regex_l=${version_release_new//./\\.}
+- name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
+- name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
++ set_regex
+
+ # Check the whole spec file at first, return 0 immediately if the
+ # are the same.
+@@ -285,9 +291,14 @@ function cmp_spec ()
+ }
+
+ function adjust_controlfile() {
+- cat $1/control | sed '/^Version: /d' > $1/control.fixed
++ version_release_old="`sed -ne 's/^Version: \(.*\)/\1/p' $1/control`"
++ name_ver_rel_old="`sed -n -e 's/^Package: \(.*\)/\1/p' $1/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $1/control`"
++ version_release_new="`sed -ne 's/^Version: \(.*\)/\1/p' $2/control`"
++ name_ver_rel_new="`sed -n -e 's/^Package: \(.*\)/\1/p' $2/control`-`sed -n -e 's/^Version: \(.*\)/\1/p' $2/control`"
++ set_regex
++ cat $1/control | trim_release_old > $1/control.fixed
+ mv $1/control.fixed $1/control
+- cat $2/control | sed '/^Version: /d' > $2/control.fixed
++ cat $2/control | trim_release_new > $2/control.fixed
+ mv $2/control.fixed $2/control
+ }
+
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/functions.sh-remove-space-at-head.patch b/poky/meta/recipes-devtools/build-compare/files/functions.sh-remove-space-at-head.patch
new file mode 100644
index 000000000..02e96bab5
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/functions.sh-remove-space-at-head.patch
@@ -0,0 +1,41 @@
+From 402a821e604f280e62c34bf4d40c6d1b4c6c892d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 Jul 2016 20:11:33 -0700
+Subject: [PATCH] functions.sh: remove space at head
+
+The command like:
+rpm -qp --nodigest --nosignature --qf '<foo> [%{REQUIRENAME}\n]\n'
+ ^^space
+
+The space will be printed, and will impact the check result, so remove it.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/9]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ functions.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/functions.sh b/functions.sh
+index 85c9003..b1069d2 100644
+--- a/functions.sh
++++ b/functions.sh
+@@ -26,6 +26,7 @@ function trim_release_old()
+ sed -e "
+ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_old_regex_l\$\)/{s,$version_release_old_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_old_regex_s,@VERSION@-@RELEASE_SHORT@,g}
+ s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_old_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
++ s/^ *//g
+ "
+ }
+ function trim_release_new()
+@@ -33,6 +34,7 @@ function trim_release_new()
+ sed -e "
+ /\(\/boot\|\/lib\/modules\|\/lib\/firmware\|\/usr\/src\|$version_release_new_regex_l\$\)/{s,$version_release_new_regex_l,@VERSION@-@RELEASE_LONG@,g;s,$version_release_new_regex_s,@VERSION@-@RELEASE_SHORT@,g}
+ s/\(\/var\/adm\/update-scripts\/\)${name_ver_rel_new_regex_l}\([^[:blank:]]\+\)/\1@NAME_VER_REL@\2/g
++ s/^ *//g
+ "
+ }
+ # Get single directory or filename with long or short release string
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/functions.sh-run-rpm-once-to-make-it-faster.patch b/poky/meta/recipes-devtools/build-compare/files/functions.sh-run-rpm-once-to-make-it-faster.patch
new file mode 100644
index 000000000..f5b99d944
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/functions.sh-run-rpm-once-to-make-it-faster.patch
@@ -0,0 +1,361 @@
+From f34d632c427b1e1570ef9136454fc01d8c9f10a6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 7 Jul 2016 19:34:09 -0700
+Subject: [PATCH] functions.sh: run rpm once to make it faster
+
+The rpm tool is a heavy process, it ran 16 (or 17 for kernel)
+"rpm -qp" times when the pkgs are identical, now we only run
+"rpm -qp --qf <all we need>" twice (one is for old pkg, and one is for
+new), save the results to spec_old and spec_new, then use sed command to
+get what we need later, this can make it 75% faster when the pkgs are
+identical. Here is the rough data on my host Ubuntu 14.04.4, 32 cores
+CPU and 128G mem:
+* When the pkgs are identical:
+ - Before the patch: 1s
+ - After the patch: 0.26s
+ I compare the whole spec firstly, and return 0 if they are the same,
+ or go on checking one by one if not, without this, it would be 0.46s,
+ the gain is great when there are lot of packages, usually, we have
+ more than 10,000 rpms to compare.
+
+* When the pkgs are different:
+ That depends on where is the different, if the different is at the
+ comparing rpmtags stage:
+ - Before the patch: 0.26s
+ - After the patch: 0.29s
+ Increased 0.03s, but if the different is happend later than comparing
+ rpmtags, it will save time.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/9]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ functions.sh | 245 ++++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 132 insertions(+), 113 deletions(-)
+ mode change 100644 => 100755 functions.sh
+
+diff --git a/functions.sh b/functions.sh
+old mode 100644
+new mode 100755
+index b1069d2..aa572f9
+--- a/functions.sh
++++ b/functions.sh
+@@ -10,9 +10,63 @@
+
+ RPM="rpm -qp --nodigest --nosignature"
+
+-check_header()
++# Name, Version, Release
++QF_NAME="%{NAME}"
++QF_VER_REL="%{VERSION}-%{RELEASE}"
++QF_NAME_VER_REL="%{NAME}-%{VERSION}-%{RELEASE}"
++
++# provides destroy this because at least the self-provide includes the
++# -buildnumber :-(
++QF_PROVIDES="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
++QF_PROVIDES="$QF_PROVIDES [%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
++QF_PROVIDES="$QF_PROVIDES [%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
++QF_PROVIDES="$QF_PROVIDES [%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
++
++# don't look at RELEASE, it contains our build number
++QF_TAGS="%{NAME} %{VERSION} %{EPOCH}\\n"
++QF_TAGS="$QF_TAGS %{SUMMARY}\\n%{DESCRIPTION}\\n"
++# the DISTURL tag can be used as checkin ID
++QF_TAGS="$QF_TAGS %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
++QF_TAGS="$QF_TAGS %{LICENSE} %{LICENSE}\\n"
++QF_TAGS="$QF_TAGS %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
++QF_TAGS="$QF_TAGS %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
++QF_TAGS="$QF_TAGS %{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n"
++
++# XXX We also need to check the existence (but not the content (!))
++# of SIGGPG (and perhaps the other SIG*)
++# XXX We don't look at triggers
++QF_TAGS="$QF_TAGS [%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
++# Only the first ChangeLog entry; should be enough
++QF_TAGS="$QF_TAGS %{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
++
++# scripts, might contain release number
++QF_SCRIPT="[%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
++
++# Now the files. We leave out mtime and size. For normal files
++# the size will influence the MD5 anyway. For directories the sizes can
++# differ, depending on which file system the package was built. To not
++# have to filter out directories we simply ignore all sizes.
++# Also leave out FILEDEVICES, FILEINODES (depends on the build host),
++# FILECOLORS, FILECLASS (normally useful but file output contains mtimes),
++# FILEDEPENDSX and FILEDEPENDSN.
++# Also FILELANGS (or?)
++QF_FILELIST="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILERDEVS} %{FILEVERIFYFLAGS} %{FILELINKTOS}\n]\\n"
++# ??? what to do with FILEPROVIDE and FILEREQUIRE?
++
++QF_CHECKSUM="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n"
++
++QF_ALL="\n___QF_NAME___\n${QF_NAME}\n___QF_NAME___\n"
++QF_ALL="$QF_ALL\n___QF_TAGS___\n${QF_TAGS}\n___QF_TAGS___\n"
++QF_ALL="$QF_ALL\n___QF_VER_REL___\n${QF_VER_REL}\n___QF_VER_REL___\n"
++QF_ALL="$QF_ALL\n___QF_NAME_VER_REL___\n${QF_NAME_VER_REL}\n___QF_NAME_VER_REL___\n"
++QF_ALL="$QF_ALL\n___QF_PROVIDES___\n${QF_PROVIDES}\n___QF_PROVIDES___\n"
++QF_ALL="$QF_ALL\n___QF_SCRIPT___\n${QF_SCRIPT}\n___QF_SCRIPT___\n"
++QF_ALL="$QF_ALL\n___QF_FILELIST___\n${QF_FILELIST}\n___QF_FILELIST___\n"
++QF_ALL="$QF_ALL\n___QF_CHECKSUM___\n${QF_CHECKSUM}\n___QF_CHECKSUM___\n"
++
++check_header()
+ {
+- $RPM --qf "$QF" "$1"
++ $RPM --qf "$1" "$2"
+ }
+
+ # Trim version-release string:
+@@ -47,18 +101,6 @@ function grep_release_new()
+ grep -E "(/boot|/lib/modules|/lib/firmware|/usr/src)/[^/]+(${version_release_new_regex_l}(\$|[^/]+\$)|${version_release_new_regex_s}(\$|[^/]+\$))"
+ }
+
+-function check_provides()
+-{
+- local pkg=$1
+- # provides destroy this because at least the self-provide includes the
+- # -buildnumber :-(
+- QF="[%{PROVIDENAME} %{PROVIDEFLAGS} %{PROVIDEVERSION}\\n]\\n"
+- QF="$QF [%{REQUIRENAME} %{REQUIREFLAGS} %{REQUIREVERSION}\\n]\\n"
+- QF="$QF [%{CONFLICTNAME} %{CONFLICTFLAGS} %{CONFLICTVERSION}\\n]\\n"
+- QF="$QF [%{OBSOLETENAME} %{OBSOLETEFLAGS} %{OBSOLETEVERSION}\\n]\\n"
+- check_header "$pkg"
+-}
+-
+ #usage unpackage <file> $dir
+ # Unpack files in directory $dir
+ # like /usr/bin/unpackage - just for one file and with no options
+@@ -98,6 +140,30 @@ function unpackage()
+ popd 1>/dev/null
+ }
+
++# Run diff command on the files
++# $1: printed info
++# $2: file1
++# $3: file2
++function comp_file()
++{
++ echo "comparing $1"
++ if ! diff -au $2 $3; then
++ if test -z "$check_all"; then
++ rm $2 $3 $spec_old $spec_new
++ return 1
++ fi
++ fi
++ return 0
++}
++
++# Get var's value from specfile.
++# $1: var name
++# $2: specfile
++function get_value()
++{
++ sed -n -e "/^___${1}___/,/^___${1}___/p" $2 | sed -e "/^___${1}___/d"
++}
++
+ # Compare just the rpm meta data of two rpms
+ # Returns:
+ # 0 in case of same content
+@@ -107,56 +173,29 @@ function unpackage()
+ function cmp_spec ()
+ {
+ local RES
+- local file1 file2
++ local file_old file_new
+ local f
+ local sh=$1
+ local oldrpm=$2
+ local newrpm=$3
+
+- QF="%{NAME}"
+-
+- # don't look at RELEASE, it contains our build number
+- QF="$QF %{VERSION} %{EPOCH}\\n"
+- QF="$QF %{SUMMARY}\\n%{DESCRIPTION}\\n"
+- QF="$QF %{VENDOR} %{DISTRIBUTION} %{DISTURL}"
+- QF="$QF %{LICENSE} %{LICENSE}\\n"
+- QF="$QF %{GROUP} %{URL} %{EXCLUDEARCH} %{EXCLUDEOS} %{EXCLUSIVEARCH}\\n"
+- QF="$QF %{EXCLUSIVEOS} %{RPMVERSION} %{PLATFORM}\\n"
+- QF="$QF %{PAYLOADFORMAT} %{PAYLOADCOMPRESSOR} %{PAYLOADFLAGS}\\n"
+-
+-
+- # XXX We also need to check the existence (but not the content (!))
+- # of SIGGPG (and perhaps the other SIG*)
+-
+- # XXX We don't look at triggers
+-
+- QF="$QF [%{VERIFYSCRIPTPROG} %{VERIFYSCRIPT}]\\n"
+-
+- # Only the first ChangeLog entry; should be enough
+- QF="$QF %{CHANGELOGTIME} %{CHANGELOGNAME} %{CHANGELOGTEXT}\\n"
+-
+- file1=`mktemp`
+- file2=`mktemp`
+-
+- check_header $oldrpm > $file1
+- check_header $newrpm > $file2
+-
+- # the DISTURL tag can be used as checkin ID
+- #echo "$QF"
+- echo "comparing rpmtags"
+- if ! diff -au $file1 $file2; then
+- if test -z "$check_all"; then
+- rm $file1 $file2
+- return 1
+- fi
+- fi
+-
++ file_old=`mktemp`
++ file_new=`mktemp`
++ spec_old=`mktemp`
++ spec_new=`mktemp`
++
++ check_header "$QF_ALL" $oldrpm > $spec_old
++ check_header "$QF_ALL" $newrpm > $spec_new
++
++ name_new="$(get_value QF_NAME $spec_new)"
++ version_release_new="$(get_value QF_VER_REL $spec_new)"
++ name_ver_rel_new="$(get_value QF_NAME_VER_REL $spec_new)"
++
++ version_release_old="$(get_value QF_VER_REL $spec_old)"
++ name_ver_rel_old="$(get_value QF_NAME_VER_REL $spec_old)"
++
+ # Remember to quote the . which is in release
+- version_release_old=$($RPM --qf "%{VERSION}-%{RELEASE}" "$oldrpm")
+- version_release_new=$($RPM --qf "%{VERSION}-%{RELEASE}" "$newrpm")
+- name_ver_rel_old=$($RPM --qf "%{NAME}-%{VERSION}-%{RELEASE}" "$oldrpm")
+- name_ver_rel_new=$($RPM --qf "%{NAME}-%{VERSION}-%{RELEASE}" "$newrpm")
+- # Short version without B_CNT
++ # Short version without B_CN
+ version_release_old_regex_s=${version_release_old%.*}
+ version_release_old_regex_s=${version_release_old_regex_s//./\\.}
+ version_release_new_regex_s=${version_release_new%.*}
+@@ -166,10 +205,27 @@ function cmp_spec ()
+ version_release_new_regex_l=${version_release_new//./\\.}
+ name_ver_rel_old_regex_l=${name_ver_rel_old//./\\.}
+ name_ver_rel_new_regex_l=${name_ver_rel_new//./\\.}
++
++ # Check the whole spec file at first, return 0 immediately if the
++ # are the same.
++ cat $spec_old | trim_release_old > $file_old
++ cat $spec_new | trim_release_new > $file_new
++ echo "comparing the whole specfile"
++ if diff -au $spec_old $spec_new; then
++ if test -z "$check_all"; then
++ rm $file_old $file_new $spec_old $spec_new
++ return 0
++ fi
++ fi
++
++ get_value QF_TAGS $spec_old > $file_old
++ get_value QF_TAGS $spec_new > $file_new
++ comp_file rpmtags $file_old $file_new || return 1
++
+ # This might happen when?!
+ echo "comparing RELEASE"
+ if [ "${version_release_old%.*}" != "${version_release_new%.*}" ] ; then
+- case $($RPM --qf '%{NAME}' "$newrpm") in
++ case $name_new in
+ kernel-*)
+ # Make sure all kernel packages have the same %RELEASE
+ echo "release prefix mismatch"
+@@ -181,71 +237,34 @@ function cmp_spec ()
+ *) ;;
+ esac
+ fi
+-
+- check_provides $oldrpm | trim_release_old | sort > $file1
+- check_provides $newrpm | trim_release_new | sort > $file2
+-
+- echo "comparing PROVIDES"
+- if ! diff -au $file1 $file2; then
+- if test -z "$check_all"; then
+- rm $file1 $file2
+- return 1
+- fi
+- fi
+
+- # scripts, might contain release number
+- QF="[%{PREINPROG} %{PREIN}\\n]\\n[%{POSTINPROG} %{POSTIN}\\n]\\n[%{PREUNPROG} %{PREUN}\\n]\\n[%{POSTUNPROG} %{POSTUN}\\n]\\n"
+- check_header $oldrpm | trim_release_old > $file1
+- check_header $newrpm | trim_release_new > $file2
++ get_value QF_PROVIDES $spec_old | trim_release_old | sort > $file_old
++ get_value QF_PROVIDES $spec_new | trim_release_new | sort > $file_new
++ comp_file PROVIDES $file_old $file_new || return 1
++
++ get_value QF_SCRIPT $spec_old | trim_release_old > $file_old
++ get_value QF_SCRIPT $spec_new | trim_release_new > $file_new
++ comp_file scripts $file_old $file_new || return 1
+
+- echo "comparing scripts"
+- if ! diff -au $file1 $file2; then
+- if test -z "$check_all"; then
+- rm $file1 $file2
+- return 1
+- fi
+- fi
+-
+ # First check the file attributes and later the md5s
+-
+- # Now the files. We leave out mtime and size. For normal files
+- # the size will influence the MD5 anyway. For directories the sizes can
+- # differ, depending on which file system the package was built. To not
+- # have to filter out directories we simply ignore all sizes.
+- # Also leave out FILEDEVICES, FILEINODES (depends on the build host),
+- # FILECOLORS, FILECLASS (normally useful but file output contains mtimes),
+- # FILEDEPENDSX and FILEDEPENDSN.
+- # Also FILELANGS (or?)
+- QF="[%{FILENAMES} %{FILEFLAGS} %{FILESTATES} %{FILEMODES:octal} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILERDEVS} %{FILEVERIFYFLAGS} %{FILELINKTOS}\n]\\n"
+- # ??? what to do with FILEPROVIDE and FILEREQUIRE?
+-
+- check_header $oldrpm | trim_release_old > $file1
+- check_header $newrpm | trim_release_new > $file2
+-
+- echo "comparing filelist"
+- if ! diff -au $file1 $file2; then
+- if test -z "$check_all"; then
+- rm $file1 $file2
+- return 1
+- fi
+- fi
+-
++ get_value QF_FILELIST $spec_old | trim_release_old > $file_old
++ get_value QF_FILELIST $spec_new | trim_release_new > $file_new
++ comp_file filelist $file_old $file_new || return 1
++
+ # now the md5sums. if they are different, we check more detailed
+ # if there are different filenames, we will already have aborted before
+ # file flag 64 means "ghost", filter those out.
+- QF="[%{FILENAMES} %{FILEMD5S} %{FILEFLAGS}\n]\\n"
+- check_header $oldrpm |grep -v " 64$"| trim_release_old > $file1
+- check_header $newrpm |grep -v " 64$"| trim_release_new > $file2
+-
++ get_value QF_CHECKSUM $spec_old | grep -v " 64$" | trim_release_old > $file_old
++ get_value QF_CHECKSUM $spec_new | grep -v " 64$" | trim_release_new > $file_new
+ RES=2
+ # done if the same
+ echo "comparing file checksum"
+- if cmp -s $file1 $file2; then
++ if cmp -s $file_old $file_new; then
+ RES=0
+ fi
+-
++
+ # Get only files with different MD5sums
+- files=`diff -U0 $file1 $file2 | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
++ files=`diff -U0 $file_old $file_new | fgrep -v +++ | grep ^+ | cut -b2- | awk '{print $1}'`
+
+ if test -f "$sh"; then
+ echo "creating rename script"
+@@ -261,7 +280,7 @@ function cmp_spec ()
+ done >> "${sh}"
+ fi
+ #
+- rm $file1 $file2
++ rm $file_old $file_new
+ return $RES
+ }
+
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check-for-fifo-named-pipe.patch b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check-for-fifo-named-pipe.patch
new file mode 100644
index 000000000..e4f0c5416
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check-for-fifo-named-pipe.patch
@@ -0,0 +1,35 @@
+From a78fe4f792a9ac9f4d364e836c8855f48561d6f2 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 14 Jul 2016 19:52:18 -0700
+Subject: [PATCH 3/4] pkg-diff.sh: check for fifo(named pipe)
+
+Otherwise "cmp -s fifo1 fifo2" will wait for inputing forever.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ pkg-diff.sh | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 5dd3a38..1f353aa 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -735,6 +735,13 @@ check_single_file()
+ return 1
+ fi
+ ;;
++ fifo*pipe*)
++ ftype_new="`/usr/bin/file new/$file | sed -e 's@^[^:]\+:[[:blank:]]*@@' -e 's@[[:blank:]]*$@@'`"
++ if [ "$ftype_new" = "$ftype" ]; then
++ return 0
++ fi
++ return 1
++ ;;
+ *)
+ if ! diff_two_files; then
+ return 1
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check_single_file-return-at-once-when-sa.patch b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check_single_file-return-at-once-when-sa.patch
new file mode 100644
index 000000000..b42af2531
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-check_single_file-return-at-once-when-sa.patch
@@ -0,0 +1,37 @@
+From 657983ef9ca8f8354172682e17408c4f6b5bc667 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 14 Jul 2016 19:46:08 -0700
+Subject: [PATCH 1/4] pkg-diff.sh: check_single_file(): return at once when
+ same
+
+If the two files are the same, return at once, this can save a lot of
+time when there are archives inside archives.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ pkg-diff.sh | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 3cf10aa..402d4a4 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -293,6 +293,13 @@ check_compressed_file()
+ check_single_file()
+ {
+ local file="$1"
++
++ # If the two files are the same, return at once.
++ if [ -f old/$file -a -f new/$file ]; then
++ if cmp -s old/$file new/$file; then
++ return 0
++ fi
++ fi
+ case $file in
+ *.spec)
+ sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-remove-space-in-the-end-for-ftype.patch b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-remove-space-in-the-end-for-ftype.patch
new file mode 100644
index 000000000..807717233
--- /dev/null
+++ b/poky/meta/recipes-devtools/build-compare/files/pkg-diff.sh-remove-space-in-the-end-for-ftype.patch
@@ -0,0 +1,32 @@
+From 836a6783df9c582a834fca239f227063a5687715 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 14 Jul 2016 19:49:12 -0700
+Subject: [PATCH 2/4] pkg-diff.sh: remove space in the end for ftype
+
+Versions of file like 5.14 returns a " " in the end, for example:
+ftype="directory ", but we need ftype="directory", remove the space to
+fix the problem.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pull/10]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ pkg-diff.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 402d4a4..5dd3a38 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -633,7 +633,7 @@ check_single_file()
+ ;;
+ esac
+
+- ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++ ftype=`/usr/bin/file old/$file | sed -e 's@^[^:]\+:[[:blank:]]*@@' -e 's@[[:blank:]]*$@@'`
+ case $ftype in
+ PE32\ executable*Mono\/\.Net\ assembly*)
+ echo "PE32 Mono/.Net assembly: $file"
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/ccache/ccache.inc b/poky/meta/recipes-devtools/ccache/ccache.inc
new file mode 100644
index 000000000..656632893
--- /dev/null
+++ b/poky/meta/recipes-devtools/ccache/ccache.inc
@@ -0,0 +1,16 @@
+SUMMARY = "a fast C/C++ compiler cache"
+DESCRIPTION = "ccache is a compiler cache. It speeds up recompilation \
+by caching the result of previous compilations and detecting when the \
+same compilation is being done again. Supported languages are C, C\+\+, \
+Objective-C and Objective-C++."
+HOMEPAGE = "http://ccache.samba.org"
+SECTION = "devel"
+LICENSE = "GPLv3+"
+
+DEPENDS = "zlib"
+
+SRC_URI = "https://download.samba.org/pub/${BPN}/${BP}.tar.xz"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/ccache/ccache_3.3.5.bb b/poky/meta/recipes-devtools/ccache/ccache_3.3.5.bb
new file mode 100644
index 000000000..929f0f127
--- /dev/null
+++ b/poky/meta/recipes-devtools/ccache/ccache_3.3.5.bb
@@ -0,0 +1,12 @@
+require ccache.inc
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=dae379a85bb6e9d594773e0aa64876f6"
+
+SRC_URI[md5sum] = "eee58db7cce892febddb989308dc568f"
+SRC_URI[sha256sum] = "190576a6e938760ec8113523e6fd380141117303e90766cc4802e770422b30c6"
+
+SRC_URI += " \
+ file://0002-dev.mk.in-fix-file-name-too-long.patch \
+ file://Revert-Create-man-page-in-the-make-install-from-git-.patch \
+"
diff --git a/poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch b/poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
new file mode 100644
index 000000000..3f01c69b2
--- /dev/null
+++ b/poky/meta/recipes-devtools/ccache/files/0002-dev.mk.in-fix-file-name-too-long.patch
@@ -0,0 +1,29 @@
+From 71bd0082c6edcf73f054a8a4fa34bd8dd4de7cd7 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 16 Sep 2015 19:45:40 -0700
+Subject: [PATCH] dev.mk.in: fix file name too long
+
+The all_cppflags change paths to filename which cause file name too long
+error when the path is longer than NAME_MAX (usually 255). Strip srcdir
+to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ dev.mk.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ccache-3.3.4/dev.mk.in
+===================================================================
+--- ccache-3.3.4.orig/dev.mk.in
++++ ccache-3.3.4/dev.mk.in
+@@ -1,7 +1,7 @@
+ # GNU make syntax reigns in this file.
+
+ all_cflags += -Werror
+-all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
++all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$(subst $(srcdir)/,,$<))).d
+
+ ASCIIDOC = asciidoc
+ CPPCHECK = cppcheck
diff --git a/poky/meta/recipes-devtools/ccache/files/Revert-Create-man-page-in-the-make-install-from-git-.patch b/poky/meta/recipes-devtools/ccache/files/Revert-Create-man-page-in-the-make-install-from-git-.patch
new file mode 100644
index 000000000..f0208b9dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/ccache/files/Revert-Create-man-page-in-the-make-install-from-git-.patch
@@ -0,0 +1,33 @@
+From 94fabcdda5c7e54ccdbc1f0aeccb26ce30e61226 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 18 Jul 2016 19:53:00 -0700
+Subject: [PATCH] Revert "Create man page in the make-install-from-git-repo
+ case"
+
+This reverts commit b86784902d28defd5e475c8922de594787df4541.
+
+We dont' have asciidoc, so revert it.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index d474f2a..c6cdc04 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -76,7 +76,7 @@ ccache$(EXEEXT): $(ccache_objs) $(extra_libs)
+ $(CC) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
+
+ .PHONY: install
+-install: all $(srcdir)/ccache.1
++install: all
+ $(installcmd) -d $(DESTDIR)$(bindir)
+ $(installcmd) -m 755 ccache$(EXEEXT) $(DESTDIR)$(bindir)
+ $(installcmd) -d $(DESTDIR)$(mandir)/man1
+--
+2.9.0
+
diff --git a/poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb b/poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
new file mode 100644
index 000000000..78e1565e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
@@ -0,0 +1,30 @@
+# cdrtools-native OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "A set of tools for CD recording, including cdrecord"
+HOMEPAGE = "http://sourceforge.net/projects/cdrtools/"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & CDDL-1.0 & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/cdrtools/cdrtools-${REALPV}.tar.bz2"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+SRC_URI[md5sum] = "7d45c5b7e1f78d85d1583b361aee6e8b"
+SRC_URI[sha256sum] = "ed282eb6276c4154ce6a0b5dee0bdb81940d0cbbfc7d03f769c4735ef5f5860f"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+# Stop failures when 'cc' can't be found
+export ac_cv_prog_CC = "${CC}"
+
+inherit native
+
+PV = "3.01a31+really3.01"
+REALPV = "3.01"
+
+S = "${WORKDIR}/${BPN}-${REALPV}"
+
+do_install() {
+ make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
+}
diff --git a/poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch b/poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
new file mode 100644
index 000000000..3d303fbc6
--- /dev/null
+++ b/poky/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
@@ -0,0 +1,32 @@
+From 285b5fbf1d6b25ff55d305c17edf4d327bf19dd3 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Tue, 5 Jul 2011 23:42:29 +0100
+Subject: [PATCH] chrpath: Ensure the package respects the docdir variable
+
+autoconf/automake set docdir automatically, use their value ensuring
+doc files are placed into $datadir/doc, not $prefix/doc.
+
+RP 5/7/2011
+
+Upstream-Status: Submitted [ http://lists.alioth.debian.org/pipermail/chrpath-devel/Week-of-Mon-20170710/000013.html ]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile.am | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b50ad21..5f7e861 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,7 +1,5 @@
+ SUBDIRS = testsuite deb
+
+-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+-
+ doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
+
+ bin_PROGRAMS = chrpath
+--
+2.8.1
+
diff --git a/poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb b/poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
new file mode 100644
index 000000000..b61eef9c8
--- /dev/null
+++ b/poky/meta/recipes-devtools/chrpath/chrpath_0.16.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Tool to edit rpath in ELF binaries"
+DESCRIPTION = "chrpath allows you to change the rpath (where the \
+application looks for libraries) in an application. It does not \
+(yet) allow you to add an rpath if there isn't one already."
+HOMEPAGE = "http://alioth.debian.org/projects/chrpath/"
+BUGTRACKER = "http://alioth.debian.org/tracker/?atid=412807&group_id=31052"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "https://alioth.debian.org/frs/download.php/file/3979/chrpath-0.16.tar.gz \
+ file://standarddoc.patch"
+
+SRC_URI[md5sum] = "2bf8d1d1ee345fc8a7915576f5649982"
+SRC_URI[sha256sum] = "bb0d4c54bac2990e1bdf8132f2c9477ae752859d523e141e72b3b11a12c26e7b"
+
+UPSTREAM_CHECK_URI = "http://alioth.debian.org/frs/?group_id=31052"
+
+inherit autotools
+
+# We don't have a staged chrpath-native for ensuring our binary is
+# relocatable, so use the one we've just built
+CHRPATH_BIN_class-native = "${B}/chrpath"
+
+PROVIDES_append_class-native = " chrpath-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/cmake/cmake-native_3.10.3.bb b/poky/meta/recipes-devtools/cmake/cmake-native_3.10.3.bb
new file mode 100644
index 000000000..e55e8b1cf
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake-native_3.10.3.bb
@@ -0,0 +1,38 @@
+require cmake.inc
+inherit native
+
+DEPENDS += "bzip2-replacement-native expat-native xz-native zlib-native curl-native"
+
+SRC_URI += "\
+ file://cmlibarchive-disable-ext2fs.patch \
+"
+
+B = "${WORKDIR}/build"
+do_configure[cleandirs] = "${B}"
+
+# Disable ccmake since we don't depend on ncurses
+CMAKE_EXTRACONF = "\
+ -DCMAKE_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE} \
+ -DBUILD_CursesDialog=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
+ -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
+ -DHAVE_SYS_ACL_H=0 \
+"
+
+do_configure () {
+ ${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+}
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+do_compile[progress] = "percent"
diff --git a/poky/meta/recipes-devtools/cmake/cmake.inc b/poky/meta/recipes-devtools/cmake/cmake.inc
new file mode 100644
index 000000000..394c9ebb5
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake.inc
@@ -0,0 +1,28 @@
+# Copyright (C) 2005, Koninklijke Philips Electronics NV. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "Cross-platform, open-source make system"
+HOMEPAGE = "http://www.cmake.org/"
+BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://Copyright.txt;md5=79b5b78197c74d5c5f9c7ccadeee4e8c \
+ file://Source/cmake.h;md5=4494dee184212fc89c469c3acd555a14;beginline=1;endline=3 \
+ "
+
+CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+
+SRC_URI = "https://cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \
+ file://support-oe-qt4-tools-names.patch \
+ file://qt4-fail-silent.patch \
+ file://cmake-Prevent-the-detection-of-Qt5.patch \
+ file://0001-FindBoost-Boost-1.66.0-dependency-and-release-update.patch \
+ file://0001-FindBoost-Fix-incorrect-alphabetisation-of-headers-l.patch \
+ file://0002-FindBoost-Implement-Architecture-and-Address-Model-t.patch \
+ file://0003-FindBoost-Search-for-upstream-packaged-libs-next-to-.patch \
+ "
+
+SRC_URI[md5sum] = "1c38c67295ca696aeafd8c059d748b38"
+SRC_URI[sha256sum] = "0c3a1dcf0be03e40cf4f341dda79c96ffb6c35ae35f2f911845b72dab3559cf8"
+
+UPSTREAM_CHECK_REGEX = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"
diff --git a/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Boost-1.66.0-dependency-and-release-update.patch b/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Boost-1.66.0-dependency-and-release-update.patch
new file mode 100644
index 000000000..fda60e3f1
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Boost-1.66.0-dependency-and-release-update.patch
@@ -0,0 +1,52 @@
+From 433a2d495a2481c63b82c11a30f7c642d6abe63f Mon Sep 17 00:00:00 2001
+From: "Paul \"TBBle\" Hampson" <Paul.Hampson@Pobox.com>
+Date: Fri, 29 Dec 2017 19:55:49 +1100
+Subject: [PATCH] FindBoost: Boost 1.66.0 dependency and release update
+
+Release notes: http://www.boost.org/users/history/version_1_66_0.html
+
+* All new libraries are header-only.
+* _Boost_COMPONENT_DEPENDENCIES is unchanged from 1.65.1
+* _Boost_FIBER_COMPILER_FEATURES is unchanged from 1.64.0
+
+Upstream-Status: Backport
+[Yocto 12762]
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+---
+ Modules/FindBoost.cmake | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: cmake-3.10.3/Modules/FindBoost.cmake
+===================================================================
+--- cmake-3.10.3.orig/Modules/FindBoost.cmake
++++ cmake-3.10.3/Modules/FindBoost.cmake
+@@ -797,7 +797,7 @@ function(_Boost_COMPONENT_DEPENDENCIES c
+ set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ endif()
+- if(NOT Boost_VERSION VERSION_LESS 106600)
++ if(NOT Boost_VERSION VERSION_LESS 106700)
+ message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
+ set(_Boost_IMPORTED_TARGETS FALSE)
+ endif()
+@@ -931,8 +931,8 @@ endfunction()
+ # `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`.
+ #
+ function(_Boost_COMPILER_FEATURES component _ret)
+- # Boost >= 1.62 and < 1.65
+- if(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106500)
++ # Boost >= 1.62 and < 1.67
++ if(NOT Boost_VERSION VERSION_LESS 106200 AND Boost_VERSION VERSION_LESS 106700)
+ set(_Boost_FIBER_COMPILER_FEATURES
+ cxx_alias_templates
+ cxx_auto_type
+@@ -1038,7 +1038,7 @@ else()
+ # _Boost_COMPONENT_HEADERS. See the instructions at the top of
+ # _Boost_COMPONENT_DEPENDENCIES.
+ set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+- "1.65.1" "1.65.0" "1.65"
++ "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
+ "1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
+ "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
+ "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51"
diff --git a/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Fix-incorrect-alphabetisation-of-headers-l.patch b/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Fix-incorrect-alphabetisation-of-headers-l.patch
new file mode 100644
index 000000000..a45eda520
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/0001-FindBoost-Fix-incorrect-alphabetisation-of-headers-l.patch
@@ -0,0 +1,29 @@
+From b1e9f67137733bc109d355450fcd06edda4784c5 Mon Sep 17 00:00:00 2001
+From: "Paul \"TBBle\" Hampson" <Paul.Hampson@Pobox.com>
+Date: Fri, 29 Dec 2017 20:07:31 +1100
+Subject: [PATCH 1/6] FindBoost: Fix incorrect alphabetisation of headers list
+
+Affects cmake < 3.11.0
+
+Upsteam-Status: Backport
+[Yocto 12762]
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+---
+ Modules/FindBoost.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: cmake-3.10.3/Modules/FindBoost.cmake
+===================================================================
+--- cmake-3.10.3.orig/Modules/FindBoost.cmake
++++ cmake-3.10.3/Modules/FindBoost.cmake
+@@ -831,8 +831,8 @@ function(_Boost_COMPONENT_HEADERS compon
+ set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
+ set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
+ set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
+- set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
+ set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
++ set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")
+ set(_Boost_FIBER_HEADERS "boost/fiber/all.hpp")
+ set(_Boost_FILESYSTEM_HEADERS "boost/filesystem/path.hpp")
+ set(_Boost_GRAPH_HEADERS "boost/graph/adjacency_list.hpp")
diff --git a/poky/meta/recipes-devtools/cmake/cmake/0002-FindBoost-Implement-Architecture-and-Address-Model-t.patch b/poky/meta/recipes-devtools/cmake/cmake/0002-FindBoost-Implement-Architecture-and-Address-Model-t.patch
new file mode 100644
index 000000000..88301c64c
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/0002-FindBoost-Implement-Architecture-and-Address-Model-t.patch
@@ -0,0 +1,132 @@
+From b044f69a413123f15a05034c00a8e3763764a1e5 Mon Sep 17 00:00:00 2001
+From: "Paul \"TBBle\" Hampson" <Paul.Hampson@Pobox.com>
+Date: Fri, 29 Dec 2017 21:50:54 +1100
+Subject: [PATCH 2/6] FindBoost: Implement "Architecture and Address Model" tag
+
+This tag is new in Boost 1.66.0, and is present in the 'versioned'
+library file name layout.
+
+Affects cmake < 3.11.0
+
+Upsteam-Status: Backport
+[Yocto 12762]
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+---
+ Modules/FindBoost.cmake | 52 +++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 42 insertions(+), 10 deletions(-)
+
+Index: cmake-3.10.3/Modules/FindBoost.cmake
+===================================================================
+--- cmake-3.10.3.orig/Modules/FindBoost.cmake
++++ cmake-3.10.3/Modules/FindBoost.cmake
+@@ -1385,8 +1385,11 @@ if(Boost_DEBUG)
+ endif()
+
+ #======================
+-# Systematically build up the Boost ABI tag
+-# http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming
++# Systematically build up the Boost ABI tag for the 'tagged' and 'versioned' layouts
++# http://boost.org/doc/libs/1_66_0/more/getting_started/windows.html#library-naming
++# http://boost.org/doc/libs/1_66_0/boost/config/auto_link.hpp
++# http://boost.org/doc/libs/1_66_0/tools/build/src/tools/common.jam
++# http://boost.org/doc/libs/1_66_0/boostcpp.jam
+ set( _boost_RELEASE_ABI_TAG "-")
+ set( _boost_DEBUG_ABI_TAG "-")
+ # Key Use this library when:
+@@ -1418,11 +1421,40 @@ if(Boost_USE_STLPORT)
+ string(APPEND _boost_DEBUG_ABI_TAG "p")
+ endif()
+ # n using the STLport deprecated "native iostreams" feature
++# removed from the documentation in 1.43.0 but still present in
++# boost/config/auto_link.hpp
+ if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS)
+ string(APPEND _boost_RELEASE_ABI_TAG "n")
+ string(APPEND _boost_DEBUG_ABI_TAG "n")
+ endif()
+
++# -x86 Architecture and address model tag
++# First character is the architecture, then word-size, either 32 or 64
++# Only used in 'versioned' layout, added in Boost 1.66.0
++set(_boost_ARCHITECTURE_TAG "")
++# {CMAKE_CXX_COMPILER_ARCHITECTURE_ID} is not currently set for all compilers
++if(NOT "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x" AND NOT Boost_VERSION VERSION_LESS 106600)
++ string(APPEND _boost_ARCHITECTURE_TAG "-")
++ # This needs to be kept in-sync with the section of CMakePlatformId.h.in
++ # inside 'defined(_WIN32) && defined(_MSC_VER)'
++ if(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "IA64")
++ string(APPEND _boost_ARCHITECTURE_TAG "i")
++ elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "X86"
++ OR ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "x64")
++ string(APPEND _boost_ARCHITECTURE_TAG "x")
++ elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} MATCHES "^ARM")
++ string(APPEND _boost_ARCHITECTURE_TAG "a")
++ elseif(${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} STREQUAL "MIPS")
++ string(APPEND _boost_ARCHITECTURE_TAG "m")
++ endif()
++
++ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
++ string(APPEND _boost_ARCHITECTURE_TAG "64")
++ else()
++ string(APPEND _boost_ARCHITECTURE_TAG "32")
++ endif()
++endif()
++
+ if(Boost_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}")
+@@ -1616,22 +1648,22 @@ foreach(COMPONENT ${Boost_FIND_COMPONENT
+ unset(_boost_RELEASE_NAMES)
+ foreach(compiler IN LISTS _boost_COMPILER)
+ list(APPEND _boost_RELEASE_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
+ endforeach()
+ list(APPEND _boost_RELEASE_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+ if(_boost_STATIC_RUNTIME_WORKAROUND)
+ set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
+ foreach(compiler IN LISTS _boost_COMPILER)
+ list(APPEND _boost_RELEASE_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+ endforeach()
+ list(APPEND _boost_RELEASE_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
+@@ -1666,11 +1698,11 @@ foreach(COMPONENT ${Boost_FIND_COMPONENT
+ unset(_boost_DEBUG_NAMES)
+ foreach(compiler IN LISTS _boost_COMPILER)
+ list(APPEND _boost_DEBUG_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
+ endforeach()
+ list(APPEND _boost_DEBUG_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+@@ -1678,11 +1710,11 @@ foreach(COMPONENT ${Boost_FIND_COMPONENT
+ set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
+ foreach(compiler IN LISTS _boost_COMPILER)
+ list(APPEND _boost_DEBUG_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+ endforeach()
+ list(APPEND _boost_DEBUG_NAMES
+- ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION}
++ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
+ endif()
+ if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread")
diff --git a/poky/meta/recipes-devtools/cmake/cmake/0003-FindBoost-Search-for-upstream-packaged-libs-next-to-.patch b/poky/meta/recipes-devtools/cmake/cmake/0003-FindBoost-Search-for-upstream-packaged-libs-next-to-.patch
new file mode 100644
index 000000000..5178f5c4d
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/0003-FindBoost-Search-for-upstream-packaged-libs-next-to-.patch
@@ -0,0 +1,31 @@
+From d56deff7d127b030739bd0034609d0046121d8cd Mon Sep 17 00:00:00 2001
+From: "Paul \"TBBle\" Hampson" <Paul.Hampson@Pobox.com>
+Date: Fri, 29 Dec 2017 22:38:36 +1100
+Subject: [PATCH 3/6] FindBoost: Search for upstream-packaged libs next to
+ includes
+
+Upstream packages Boost binaries for Windows with the 'boost' directory
+(the INCLUDE_DIR) next to the lib-... directory (the LIBRARY_DIR).
+
+Affects cmake < 3.11.0
+
+Upsteam-Status: Backport
+[Yocto 12762]
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+---
+ Modules/FindBoost.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: cmake-3.10.3/Modules/FindBoost.cmake
+===================================================================
+--- cmake-3.10.3.orig/Modules/FindBoost.cmake
++++ cmake-3.10.3/Modules/FindBoost.cmake
+@@ -1502,6 +1502,7 @@ foreach(c DEBUG RELEASE)
+ ${Boost_INCLUDE_DIR}/stage/lib
+ )
+ _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}/..")
++ _Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "${Boost_INCLUDE_DIR}")
+ if( Boost_NO_SYSTEM_PATHS )
+ list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
+ else()
diff --git a/poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
new file mode 100644
index 000000000..dc8477ea3
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -0,0 +1,22 @@
+set( CMAKE_SYSTEM_NAME Linux )
+set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE )
+set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
+set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )
+
+set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
+
+# Set CMAKE_SYSTEM_PROCESSOR from the sysroot name (assuming processor-distro-os).
+if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
+ set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1})
+endif()
+
+# Include the toolchain configuration subscripts
+file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
+foreach(config ${toolchain_config_files})
+ include(${config})
+endforeach()
diff --git a/poky/meta/recipes-devtools/cmake/cmake/cmake-Prevent-the-detection-of-Qt5.patch b/poky/meta/recipes-devtools/cmake/cmake/cmake-Prevent-the-detection-of-Qt5.patch
new file mode 100644
index 000000000..88b7e9474
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/cmake-Prevent-the-detection-of-Qt5.patch
@@ -0,0 +1,215 @@
+From 875c11dbf87d1258ad7d3697a40d605d503e5673 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Wed, 17 Jan 2018 10:02:14 -0200
+Subject: [PATCH] cmake: Prevent the detection of Qt5
+Organization: O.S. Systems Software LTDA.
+
+CMake doesn't have dependency on qt4/qt5, so these tests usually fail
+but still can cause undeterministic results or build failures (when
+OE_QMAKE_PATH_EXTERNAL_HOST_BINS is undefined or native qmake removed
+while running the test in cmake)
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ Source/QtDialog/CMakeLists.txt | 2 +-
+ Tests/CMakeLists.txt | 2 +-
+ Tests/Qt4And5Automoc/CMakeLists.txt | 4 ++--
+ Tests/QtAutoUicInterface/CMakeLists.txt | 2 +-
+ Tests/QtAutogen/CMakeLists.txt | 2 +-
+ Tests/QtAutogen/macosFW/CMakeLists.txt | 2 +-
+ Tests/QtAutogen/mocDepends/CMakeLists.txt | 2 +-
+ Tests/QtAutogenRerun/CMakeLists.txt | 4 ++--
+ Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt | 2 +-
+ Tests/QtAutogenRerun/mocRerun/CMakeLists.txt | 2 +-
+ Tests/QtAutogenRerun/rccDepends/CMakeLists.txt | 2 +-
+ Tests/RunCMake/CMakeLists.txt | 2 +-
+ Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake | 2 +-
+ 13 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
+index b38797bca..b5fbfc5fa 100644
+--- a/Source/QtDialog/CMakeLists.txt
++++ b/Source/QtDialog/CMakeLists.txt
+@@ -6,7 +6,7 @@ if(POLICY CMP0020)
+ cmake_policy(SET CMP0020 NEW) # Drop when CMake >= 2.8.11 required
+ endif()
+ CMake_OPTIONAL_COMPONENT(cmake-gui)
+-find_package(Qt5Widgets QUIET)
++#find_package(Qt5Widgets QUIET)
+ if (Qt5Widgets_FOUND)
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ add_definitions(${Qt5Widgets_DEFINITONS})
+diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
+index 533788a44..32ef03c55 100644
+--- a/Tests/CMakeLists.txt
++++ b/Tests/CMakeLists.txt
+@@ -1260,7 +1260,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
+ set(CMake_TEST_Qt5 1)
+ endif()
+ if(CMake_TEST_Qt5)
+- find_package(Qt5Widgets QUIET NO_MODULE)
++ #find_package(Qt5Widgets QUIET NO_MODULE)
+ endif()
+ if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
+ add_test(NAME Qt5Autogen COMMAND ${CMAKE_CTEST_COMMAND}
+diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt
+index ad74961d9..a9dd74b15 100644
+--- a/Tests/Qt4And5Automoc/CMakeLists.txt
++++ b/Tests/Qt4And5Automoc/CMakeLists.txt
+@@ -3,11 +3,11 @@ cmake_minimum_required(VERSION 2.8.12)
+ project(Qt4And5Automoc)
+
+ if (QT_REVERSE_FIND_ORDER)
+- find_package(Qt5Core REQUIRED)
++ #find_package(Qt5Core REQUIRED)
+ find_package(Qt4 REQUIRED)
+ else()
+ find_package(Qt4 REQUIRED)
+- find_package(Qt5Core REQUIRED)
++ #find_package(Qt5Core REQUIRED)
+ endif()
+
+ set(CMAKE_AUTOMOC ON)
+diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutoUicInterface/CMakeLists.txt
+index a5c2d99b2..2d640e4a3 100644
+--- a/Tests/QtAutoUicInterface/CMakeLists.txt
++++ b/Tests/QtAutoUicInterface/CMakeLists.txt
+@@ -14,7 +14,7 @@ else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+- find_package(Qt5Widgets REQUIRED)
++ #find_package(Qt5Widgets REQUIRED)
+
+ set(QT_CORE_TARGET Qt5::Core)
+ set(QT_GUI_TARGET Qt5::Widgets)
+diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
+index dff9d0c66..c6e8fc3f5 100644
+--- a/Tests/QtAutogen/CMakeLists.txt
++++ b/Tests/QtAutogen/CMakeLists.txt
+@@ -23,7 +23,7 @@ else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+- find_package(Qt5Widgets REQUIRED)
++ #find_package(Qt5Widgets REQUIRED)
+
+ set(QT_QTCORE_TARGET Qt5::Core)
+
+diff --git a/Tests/QtAutogen/macosFW/CMakeLists.txt b/Tests/QtAutogen/macosFW/CMakeLists.txt
+index 114d9bac0..157fe0aaa 100644
+--- a/Tests/QtAutogen/macosFW/CMakeLists.txt
++++ b/Tests/QtAutogen/macosFW/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 3.8)
+ project(macos-fw-test)
+
+-find_package(Qt5Test REQUIRED)
++#find_package(Qt5Test REQUIRED)
+
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/bin)
+diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/mocDepends/CMakeLists.txt
+index 8217b8dbf..86bb7bc7f 100644
+--- a/Tests/QtAutogen/mocDepends/CMakeLists.txt
++++ b/Tests/QtAutogen/mocDepends/CMakeLists.txt
+@@ -10,7 +10,7 @@ else()
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+
+- find_package(Qt5Core REQUIRED)
++ #find_package(Qt5Core REQUIRED)
+ set(QT_CORE_TARGET Qt5::Core)
+ endif()
+
+diff --git a/Tests/QtAutogenRerun/CMakeLists.txt b/Tests/QtAutogenRerun/CMakeLists.txt
+index e72c1912e..d7e6884ce 100644
+--- a/Tests/QtAutogenRerun/CMakeLists.txt
++++ b/Tests/QtAutogenRerun/CMakeLists.txt
+@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.9)
+ cmake_policy(SET CMP0071 NEW)
+ project(QtAutogenRerun)
+
+-# Tell find_package(Qt5) where to find Qt.
++# Tell #find_package(Qt5) where to find Qt.
+ if(QT_QMAKE_EXECUTABLE)
+ get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+ get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
+@@ -23,7 +23,7 @@ else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+- find_package(Qt5Widgets REQUIRED)
++ #find_package(Qt5Widgets REQUIRED)
+
+ set(QT_QTCORE_TARGET Qt5::Core)
+
+diff --git a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
+index b7cc5e9ff..e1d109953 100644
+--- a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
++++ b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt
+@@ -9,7 +9,7 @@ set(CMAKE_AUTOMOC_DEPEND_FILTERS
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+-find_package(Qt5Widgets REQUIRED)
++#find_package(Qt5Widgets REQUIRED)
+
+ if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
+diff --git a/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt b/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt
+index bafd9cf48..43ec933d2 100644
+--- a/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt
++++ b/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt
+@@ -10,7 +10,7 @@ else()
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+
+- find_package(Qt5Core REQUIRED)
++ #find_package(Qt5Core REQUIRED)
+ set(QT_CORE_TARGET Qt5::Core)
+ endif()
+
+diff --git a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
+index 291592e7d..40cd52868 100644
+--- a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
++++ b/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
+@@ -9,7 +9,7 @@ else()
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+
+- find_package(Qt5Core REQUIRED)
++ #find_package(Qt5Core REQUIRED)
+ set(QT_CORE_TARGET Qt5::Core)
+ endif()
+
+diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
+index 29325ff0a..d30d01e78 100644
+--- a/Tests/RunCMake/CMakeLists.txt
++++ b/Tests/RunCMake/CMakeLists.txt
+@@ -274,7 +274,7 @@ add_RunCMake_test(configure_file)
+ add_RunCMake_test(CTestTimeoutAfterMatch)
+
+ find_package(Qt4 QUIET)
+-find_package(Qt5Core QUIET)
++#find_package(Qt5Core QUIET)
+ if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
+ add_RunCMake_test(IncompatibleQt)
+ endif()
+diff --git a/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake b/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
+index 4fccdc418..b76e1e531 100644
+--- a/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
++++ b/Tests/RunCMake/IncompatibleQt/IncompatibleQt.cmake
+@@ -1,6 +1,6 @@
+
+ find_package(Qt4 REQUIRED)
+-find_package(Qt5Core REQUIRED)
++#find_package(Qt5Core REQUIRED)
+
+ add_executable(mainexe main.cpp)
+ target_link_libraries(mainexe Qt4::QtCore Qt5::Core)
+--
+2.15.1
+
diff --git a/poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch b/poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
new file mode 100644
index 000000000..bf3671259
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
@@ -0,0 +1,26 @@
+Disable use of ext2fs/ext2_fs.h by cmake's internal libarchive copy
+
+We don't want to add a dependency on e2fsprogs-native for cmake-native,
+and we don't use CPack so just disable this functionality.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -237,12 +237,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
+ LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
+ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+ LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
+-LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H)
+-
+-CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+-#include <ext2fs/ext2_fs.h>
+-int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS)
+-
++SET(HAVE_EXT2FS_EXT2_FS_H 0)
++SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0)
+ LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
+ LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
+ LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
diff --git a/poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
new file mode 100644
index 000000000..0eb56b66f
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
@@ -0,0 +1 @@
+alias cmake="cmake -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake"
diff --git a/poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch b/poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
new file mode 100644
index 000000000..80fc277fa
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
@@ -0,0 +1,77 @@
+Fail silently if system Qt installation is broken
+
+Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the
+following error if the system Qt installation is broken:
+
+CMake Error at Modules/FindQt4.cmake:1028 (set_property):
+ set_property could not find TARGET Qt4::QtCore. Perhaps it has not yet
+ been created.
+Call Stack (most recent call first):
+ Tests/RunCMake/CMakeLists.txt:79 (find_package)
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Another set_property was introduced which had to be included
+within the if(QT_QTCORE_FOUND) statement.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+---
+ Modules/FindQt4.cmake | 39 ++++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index 6704769..9048e35 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -1000,25 +1000,26 @@ if (QT_QMAKE_EXECUTABLE AND
+ endif()
+ endmacro()
+
+-
+- # Set QT_xyz_LIBRARY variable and add
+- # library include path to QT_INCLUDES
+- _QT4_ADJUST_LIB_VARS(QtCore)
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- INTERFACE_INCLUDE_DIRECTORIES
+- "${QT_MKSPECS_DIR}/default"
+- ${QT_INCLUDE_DIR}
+- )
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- INTERFACE_COMPILE_DEFINITIONS
+- $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
+- )
+- set_property(TARGET Qt4::QtCore PROPERTY
+- INTERFACE_QT_MAJOR_VERSION 4
+- )
+- set_property(TARGET Qt4::QtCore APPEND PROPERTY
+- COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+- )
++ if(QT_QTCORE_FOUND)
++ # Set QT_xyz_LIBRARY variable and add
++ # library include path to QT_INCLUDES
++ _QT4_ADJUST_LIB_VARS(QtCore)
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ INTERFACE_INCLUDE_DIRECTORIES
++ "${QT_MKSPECS_DIR}/default"
++ ${QT_INCLUDE_DIR}
++ )
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ INTERFACE_COMPILE_DEFINITIONS
++ $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
++ )
++ set_property(TARGET Qt4::QtCore PROPERTY
++ INTERFACE_QT_MAJOR_VERSION 4
++ )
++ set_property(TARGET Qt4::QtCore APPEND PROPERTY
++ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
++ )
++ endif()
+
+ foreach(QT_MODULE ${QT_MODULES})
+ _QT4_ADJUST_LIB_VARS(${QT_MODULE})
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch b/poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
new file mode 100644
index 000000000..684155476
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
@@ -0,0 +1,58 @@
+From 10b8b523869124d2fc8cd98d9e028c0bcffd61b1 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Thu, 12 May 2011 15:36:03 +0000
+Subject: [PATCH 1/2] cmake: support OpenEmbedded Qt4 tool binary names
+
+The FindQt4 module looks for Qt4 binaries to be able to gather the
+paths used for compilation and also to be using during other processes
+(translation update, translation binary generating and like) however
+OpenEmbedded has renamed those to allow old QMake to be used in
+parallel with the current one. This patch adds support for the
+OpenEmbedded specific binary names.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Instead of find_program, _find_qt4_program is now used.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+
+---
+ Modules/FindQt4.cmake | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index c67d0be..0cf169b 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -516,7 +516,7 @@ endfunction()
+
+ set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+
+-set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac)
++set(_QT4_QMAKE_NAMES qmake qmake2 qmake4 qmake-qt4 qmake-mac)
+ _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
+
+ if (QT_QMAKE_EXECUTABLE AND
+@@ -1142,12 +1142,12 @@ if (QT_QMAKE_EXECUTABLE AND
+ _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
+ _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
+ _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
+- _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc)
+- _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml)
+- _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp)
++ _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc4 rcc)
++ _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml4 qdbuscpp2xml)
++ _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp4 qdbusxml2cpp)
+ _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate)
+ _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease)
+- _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
++ _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator qcollectiongenerator4)
+ _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
+ _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/cmake/cmake_3.10.3.bb b/poky/meta/recipes-devtools/cmake/cmake_3.10.3.bb
new file mode 100644
index 000000000..3f8fd7a99
--- /dev/null
+++ b/poky/meta/recipes-devtools/cmake/cmake_3.10.3.bb
@@ -0,0 +1,50 @@
+require cmake.inc
+
+inherit cmake
+
+DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
+
+SRC_URI_append_class-nativesdk = " \
+ file://OEToolchainConfig.cmake \
+ file://environment.d-cmake.sh"
+
+# Strip ${prefix} from ${docdir}, set result into docdir_stripped
+python () {
+ prefix=d.getVar("prefix")
+ docdir=d.getVar("docdir")
+
+ if not docdir.startswith(prefix):
+ bb.fatal('docdir must contain prefix as its prefix')
+
+ docdir_stripped = docdir[len(prefix):]
+ if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
+ docdir_stripped = docdir_stripped[1:]
+
+ d.setVar("docdir_stripped", docdir_stripped)
+}
+
+EXTRA_OECMAKE=" \
+ -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
+ -DCMAKE_USE_SYSTEM_LIBRARIES=1 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=0 \
+ -DCMAKE_USE_SYSTEM_LIBRARY_LIBRHASH=0 \
+ -DKWSYS_CHAR_IS_SIGNED=1 \
+ -DBUILD_CursesDialog=0 \
+ -DKWSYS_LFS_WORKS=1 \
+"
+
+do_install_append_class-nativesdk() {
+ mkdir -p ${D}${datadir}/cmake
+ install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
+
+ mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+ install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
+}
+
+FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
+
+FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
+FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch b/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch
new file mode 100644
index 000000000..cd72084ee
--- /dev/null
+++ b/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Correctly-install-the-shared-library.patch
@@ -0,0 +1,28 @@
+From fef835e1fdedc72c97d9c3e5704302e56e1bdef0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 2 Jan 2017 17:23:59 +0200
+Subject: [PATCH] Correctly install the shared library
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/createrepo_c/pull/78]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index f3635e8..46dc037 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -110,7 +110,8 @@ CONFIGURE_FILE("deltarpms.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/deltarpms.h" @ONLY)
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++#SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
+
+ INSTALL(FILES ${headers} DESTINATION "include/createrepo_c")
+ INSTALL(FILES "createrepo_c.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 000000000..953107093
--- /dev/null
+++ b/poky/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,27 @@
+From bef487b5c2515062c5dd73c21082ce42f69aa717 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:31:02 +0200
+Subject: [PATCH] Do not set PYTHON_INSTALL_DIR by running python
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/python/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
+index 9f1ac64..eae0cbb 100644
+--- a/src/python/CMakeLists.txt
++++ b/src/python/CMakeLists.txt
+@@ -19,7 +19,7 @@ else()
+ FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+ endif()
+
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb b/poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb
new file mode 100644
index 000000000..31761368b
--- /dev/null
+++ b/poky/meta/recipes-devtools/createrepo-c/createrepo-c_git.bb
@@ -0,0 +1,31 @@
+DESCRIPTION = "C implementation of createrepo."
+HOMEPAGE = "https://github.com/rpm-software-management/createrepo_c/wiki"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/rpm-software-management/createrepo_c \
+ file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+ file://0001-Correctly-install-the-shared-library.patch \
+ "
+
+PV = "0.10.0+git${SRCPV}"
+SRCREV = "748891ff8ee524c2d37926c608cd2794f88013f3"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "expat curl glib-2.0 libxml2 openssl bzip2 zlib file sqlite3 xz rpm"
+DEPENDS_append_class-native = " file-replacement-native"
+
+inherit cmake pkgconfig bash-completion distutils3-base
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+
+BBCLASSEXTEND = "native"
+
+# Direct createrepo to read rpm configuration from our sysroot, not the one it was compiled in
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/createrepo_c \
+ RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm
+}
+
diff --git a/poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb b/poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
new file mode 100644
index 000000000..1c84fb1cf
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
@@ -0,0 +1,62 @@
+SUMMARY = "cve-check-tool"
+DESCRIPTION = "cve-check-tool is a tool for checking known (public) CVEs.\
+The tool will identify potentially vunlnerable software packages within Linux distributions through version matching."
+HOMEPAGE = "https://github.com/ikeydoherty/cve-check-tool"
+SECTION = "Development/Tools"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e8c1458438ead3c34974bc0be3a03ed6"
+
+SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.tar.xz \
+ file://check-for-malloc_trim-before-using-it.patch \
+ file://0001-print-progress-in-percent-when-downloading-CVE-db.patch \
+ file://0001-curl-allow-overriding-default-CA-certificate-file.patch \
+ file://0001-update-Compare-computed-vs-expected-sha256-digit-str.patch \
+ file://0001-Fix-freeing-memory-allocated-by-sqlite.patch \
+ "
+
+SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
+SRC_URI[sha256sum] = "b8f283be718af8d31232ac1bfc10a0378fb958aaaa49af39168f8acf501e6a5b"
+
+UPSTREAM_CHECK_URI = "https://github.com/ikeydoherty/cve-check-tool/releases"
+
+DEPENDS = "libcheck glib-2.0 json-glib curl libxml2 sqlite3 openssl ca-certificates"
+
+RDEPENDS_${PN} = "ca-certificates"
+
+inherit pkgconfig autotools
+
+EXTRA_OECONF = "--disable-coverage --enable-relative-plugins"
+CFLAGS_append = " -Wno-error=pedantic"
+
+do_populate_cve_db() {
+ if [ "${BB_NO_NETWORK}" = "1" ] ; then
+ bbwarn "BB_NO_NETWORK is set; Can't update cve-check-tool database, new CVEs won't be detected"
+ return
+ fi
+
+ # In case we don't inherit cve-check class, use default values defined in the class.
+ cve_dir="${CVE_CHECK_DB_DIR}"
+ cve_file="${CVE_CHECK_TMP_FILE}"
+
+ [ -z "${cve_dir}" ] && cve_dir="${DL_DIR}/CVE_CHECK"
+ [ -z "${cve_file}" ] && cve_file="${TMPDIR}/cve_check"
+
+ unused="${@bb.utils.export_proxies(d)}"
+ bbdebug 2 "Updating cve-check-tool database located in $cve_dir"
+ # --cacert works around curl-native not finding the CA bundle
+ if cve-check-update --cacert ${sysconfdir}/ssl/certs/ca-certificates.crt -d "$cve_dir" ; then
+ printf "CVE database was updated on %s UTC\n\n" "$(LANG=C date --utc +'%F %T')" > "$cve_file"
+ else
+ bbwarn "Error in executing cve-check-update"
+ if [ "${@'1' if bb.data.inherits_class('cve-check', d) else '0'}" -ne 0 ] ; then
+ bbwarn "Failed to update cve-check-tool database, CVEs won't be checked"
+ fi
+ fi
+}
+
+addtask populate_cve_db after do_populate_sysroot
+do_populate_cve_db[depends] = "cve-check-tool-native:do_populate_sysroot"
+do_populate_cve_db[nostamp] = "1"
+do_populate_cve_db[progress] = "percent"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch b/poky/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch
new file mode 100644
index 000000000..4a82cf2dd
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch
@@ -0,0 +1,50 @@
+From a3353429652f83bb8b0316500faa88fa2555542d Mon Sep 17 00:00:00 2001
+From: Peter Marko <peter.marko@siemens.com>
+Date: Thu, 13 Apr 2017 23:09:52 +0200
+Subject: [PATCH] Fix freeing memory allocated by sqlite
+
+Upstream-Status: Backport
+Signed-off-by: Peter Marko <peter.marko@siemens.com>
+---
+ src/core.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/core.c b/src/core.c
+index 6263031..6788f16 100644
+--- a/src/core.c
++++ b/src/core.c
+@@ -82,7 +82,7 @@ static bool ensure_table(CveDB *self)
+ rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
+ if (rc != SQLITE_OK) {
+ fprintf(stderr, "ensure_table(): %s\n", err);
+- free(err);
++ sqlite3_free(err);
+ return false;
+ }
+
+@@ -91,7 +91,7 @@ static bool ensure_table(CveDB *self)
+ rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
+ if (rc != SQLITE_OK) {
+ fprintf(stderr, "ensure_table(): %s\n", err);
+- free(err);
++ sqlite3_free(err);
+ return false;
+ }
+
+@@ -99,11 +99,11 @@ static bool ensure_table(CveDB *self)
+ rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
+ if (rc != SQLITE_OK) {
+ fprintf(stderr, "ensure_table(): %s\n", err);
+- free(err);
++ sqlite3_free(err);
+ return false;
+ }
+ if (err) {
+- free(err);
++ sqlite3_free(err);
+ }
+
+ return true;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch b/poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch
new file mode 100644
index 000000000..3d8ebd1bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/files/0001-curl-allow-overriding-default-CA-certificate-file.patch
@@ -0,0 +1,215 @@
+From 825a9969dea052b02ba868bdf39e676349f10dce Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 9 Feb 2017 14:51:28 +0200
+Subject: [PATCH] curl: allow overriding default CA certificate file
+
+Similar to curl, --cacert can now be used in cve-check-tool and
+cve-check-update to override the default CA certificate file. Useful
+in cases where the system default is unsuitable (for example,
+out-dated) or broken (as in OE's current native libcurl, which embeds
+a path string from one build host and then uses it on another although
+the right path may have become something different).
+
+Upstream-Status: Submitted [https://github.com/ikeydoherty/cve-check-tool/pull/45]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+
+Took Patrick Ohlys original patch from meta-security-isafw, rebased
+on top of other patches.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/library/cve-check-tool.h | 1 +
+ src/library/fetch.c | 10 +++++++++-
+ src/library/fetch.h | 3 ++-
+ src/main.c | 5 ++++-
+ src/update-main.c | 4 +++-
+ src/update.c | 12 +++++++-----
+ src/update.h | 2 +-
+ 7 files changed, 27 insertions(+), 10 deletions(-)
+
+diff --git a/src/library/cve-check-tool.h b/src/library/cve-check-tool.h
+index e4bb5b1..f89eade 100644
+--- a/src/library/cve-check-tool.h
++++ b/src/library/cve-check-tool.h
+@@ -43,6 +43,7 @@ typedef struct CveCheckTool {
+ bool bugs; /**<Whether bug tracking is enabled */
+ GHashTable *mapping; /**<CVE Mapping */
+ const char *output_file; /**<Output file, if any */
++ const char *cacert_file; /**<Non-default SSL certificate file, if any */
+ } CveCheckTool;
+
+ /**
+diff --git a/src/library/fetch.c b/src/library/fetch.c
+index 0fe6d76..8f998c3 100644
+--- a/src/library/fetch.c
++++ b/src/library/fetch.c
+@@ -60,7 +60,8 @@ static int progress_callback_new(void *ptr, curl_off_t dltotal, curl_off_t dlnow
+ }
+
+ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+- unsigned int start_percent, unsigned int end_percent)
++ unsigned int start_percent, unsigned int end_percent,
++ const char *cacert_file)
+ {
+ FetchStatus ret = FETCH_STATUS_FAIL;
+ CURLcode res;
+@@ -74,6 +75,13 @@ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+ return ret;
+ }
+
++ if (cacert_file) {
++ res = curl_easy_setopt(curl, CURLOPT_CAINFO, cacert_file);
++ if (res != CURLE_OK) {
++ goto bail;
++ }
++ }
++
+ if (stat(target, &st) == 0) {
+ res = curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+ if (res != CURLE_OK) {
+diff --git a/src/library/fetch.h b/src/library/fetch.h
+index 4cce5d1..836c7d7 100644
+--- a/src/library/fetch.h
++++ b/src/library/fetch.h
+@@ -29,7 +29,8 @@ typedef enum {
+ * @return A FetchStatus, indicating the operation taken
+ */
+ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
+- unsigned int this_percent, unsigned int next_percent);
++ unsigned int this_percent, unsigned int next_percent,
++ const char *cacert_file);
+
+ /**
+ * Attempt to extract the given gzipped file
+diff --git a/src/main.c b/src/main.c
+index 8e6f158..ae69d47 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -280,6 +280,7 @@ static bool csv_mode = false;
+ static char *modified_stamp = NULL;
+ static gchar *mapping_file = NULL;
+ static gchar *output_file = NULL;
++static gchar *cacert_file = NULL;
+
+ static GOptionEntry _entries[] = {
+ { "not-patched", 'n', 0, G_OPTION_ARG_NONE, &hide_patched, "Hide patched/addressed CVEs", NULL },
+@@ -294,6 +295,7 @@ static GOptionEntry _entries[] = {
+ { "csv", 'c', 0, G_OPTION_ARG_NONE, &csv_mode, "Output CSV formatted data only", NULL },
+ { "mapping", 'M', 0, G_OPTION_ARG_STRING, &mapping_file, "Path to a mapping file", NULL},
+ { "output-file", 'o', 0, G_OPTION_ARG_STRING, &output_file, "Path to the output file (output plugin specific)", NULL},
++ { "cacert", 'C', 0, G_OPTION_ARG_STRING, &cacert_file, "Path to the combined SSL certificates file (system default is used if not set)", NULL},
+ { .short_name = 0 }
+ };
+
+@@ -492,6 +494,7 @@ int main(int argc, char **argv)
+
+ quiet = csv_mode || !no_html;
+ self->output_file = output_file;
++ self->cacert_file = cacert_file;
+
+ if (!csv_mode && self->output_file) {
+ quiet = false;
+@@ -530,7 +533,7 @@ int main(int argc, char **argv)
+ if (status) {
+ fprintf(stderr, "Update of db forced\n");
+ cve_db_unlock();
+- if (!update_db(quiet, db_path->str)) {
++ if (!update_db(quiet, db_path->str, self->cacert_file)) {
+ fprintf(stderr, "DB update failure\n");
+ goto cleanup;
+ }
+diff --git a/src/update-main.c b/src/update-main.c
+index 2379cfa..c52d9d0 100644
+--- a/src/update-main.c
++++ b/src/update-main.c
+@@ -43,11 +43,13 @@ the Free Software Foundation; either version 2 of the License, or\n\
+ static gchar *nvds = NULL;
+ static bool _show_version = false;
+ static bool _quiet = false;
++static const char *_cacert_file = NULL;
+
+ static GOptionEntry _entries[] = {
+ { "nvd-dir", 'd', 0, G_OPTION_ARG_STRING, &nvds, "NVD directory in filesystem", NULL },
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &_show_version, "Show version", NULL },
+ { "quiet", 'q', 0, G_OPTION_ARG_NONE, &_quiet, "Run silently", NULL },
++ { "cacert", 'C', 0, G_OPTION_ARG_STRING, &_cacert_file, "Path to the combined SSL certificates file (system default is used if not set)", NULL},
+ { .short_name = 0 }
+ };
+
+@@ -88,7 +90,7 @@ int main(int argc, char **argv)
+ goto end;
+ }
+
+- if (update_db(_quiet, db_path->str)) {
++ if (update_db(_quiet, db_path->str, _cacert_file)) {
+ ret = EXIT_SUCCESS;
+ } else {
+ fprintf(stderr, "Failed to update database\n");
+diff --git a/src/update.c b/src/update.c
+index 070560a..8cb4a39 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -267,7 +267,8 @@ static inline void update_end(int fd, const char *update_fname, bool ok)
+
+ static int do_fetch_update(int year, const char *db_dir, CveDB *cve_db,
+ bool db_exist, bool verbose,
+- unsigned int this_percent, unsigned int next_percent)
++ unsigned int this_percent, unsigned int next_percent,
++ const char *cacert_file)
+ {
+ const char nvd_uri[] = URI_PREFIX;
+ autofree(cve_string) *uri_meta = NULL;
+@@ -331,14 +332,14 @@ refetch:
+ }
+
+ /* Fetch NVD META file */
+- st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose, this_percent, this_percent);
++ st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose, this_percent, this_percent, cacert_file);
+ if (st == FETCH_STATUS_FAIL) {
+ fprintf(stderr, "Failed to fetch %s\n", uri_meta->str);
+ return -1;
+ }
+
+ /* Fetch NVD XML file */
+- st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose, this_percent, next_percent);
++ st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose, this_percent, next_percent, cacert_file);
+ switch (st) {
+ case FETCH_STATUS_FAIL:
+ fprintf(stderr, "Failed to fetch %s\n", uri_data_gz->str);
+@@ -391,7 +392,7 @@ refetch:
+ return 0;
+ }
+
+-bool update_db(bool quiet, const char *db_file)
++bool update_db(bool quiet, const char *db_file, const char *cacert_file)
+ {
+ autofree(char) *db_dir = NULL;
+ autofree(CveDB) *cve_db = NULL;
+@@ -466,7 +467,8 @@ bool update_db(bool quiet, const char *db_file)
+ if (!quiet)
+ fprintf(stderr, "completed: %u%%\r", start_percent);
+ rc = do_fetch_update(y, db_dir, cve_db, db_exist, !quiet,
+- start_percent, end_percent);
++ start_percent, end_percent,
++ cacert_file);
+ switch (rc) {
+ case 0:
+ if (!quiet)
+diff --git a/src/update.h b/src/update.h
+index b8e9911..ceea0c3 100644
+--- a/src/update.h
++++ b/src/update.h
+@@ -15,7 +15,7 @@ cve_string *get_db_path(const char *path);
+
+ int update_required(const char *db_file);
+
+-bool update_db(bool quiet, const char *db_file);
++bool update_db(bool quiet, const char *db_file, const char *cacert_file);
+
+
+ /*
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/cve-check-tool/files/0001-print-progress-in-percent-when-downloading-CVE-db.patch b/poky/meta/recipes-devtools/cve-check-tool/files/0001-print-progress-in-percent-when-downloading-CVE-db.patch
new file mode 100644
index 000000000..8ea6f686e
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/files/0001-print-progress-in-percent-when-downloading-CVE-db.patch
@@ -0,0 +1,135 @@
+From e9ed26cde63f8ca7607a010a518329339f8c02d3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Mon, 26 Sep 2016 12:12:41 +0100
+Subject: [PATCH] print progress in percent when downloading CVE db
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+Signed-off-by: André Draszik <git@andred.net>
+---
+ src/library/fetch.c | 28 +++++++++++++++++++++++++++-
+ src/library/fetch.h | 3 ++-
+ src/update.c | 16 ++++++++++++----
+ 3 files changed, 41 insertions(+), 6 deletions(-)
+
+diff --git a/src/library/fetch.c b/src/library/fetch.c
+index 06d4b30..0fe6d76 100644
+--- a/src/library/fetch.c
++++ b/src/library/fetch.c
+@@ -37,13 +37,37 @@ static size_t write_func(void *ptr, size_t size, size_t nmemb, struct fetch_t *f
+ return fwrite(ptr, size, nmemb, f->f);
+ }
+
+-FetchStatus fetch_uri(const char *uri, const char *target, bool verbose)
++struct percent_t {
++ unsigned int start;
++ unsigned int end;
++};
++
++static int progress_callback_new(void *ptr, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
++{
++ (void) ultotal;
++ (void) ulnow;
++
++ struct percent_t *percent = (struct percent_t *) ptr;
++
++ if (dltotal && percent && percent->end >= percent->start) {
++ unsigned int diff = percent->end - percent->start;
++ if (diff) {
++ fprintf(stderr,"completed: %"CURL_FORMAT_CURL_OFF_T"%%\r", percent->start + (diff * dlnow / dltotal));
++ }
++ }
++
++ return 0;
++}
++
++FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
++ unsigned int start_percent, unsigned int end_percent)
+ {
+ FetchStatus ret = FETCH_STATUS_FAIL;
+ CURLcode res;
+ struct stat st;
+ CURL *curl = NULL;
+ struct fetch_t *f = NULL;
++ struct percent_t percent = { .start = start_percent, .end = end_percent };
+
+ curl = curl_easy_init();
+ if (!curl) {
+@@ -67,6 +91,8 @@ FetchStatus fetch_uri(const char *uri, const char *target, bool verbose)
+ }
+ if (verbose) {
+ (void)curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);
++ (void)curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &percent);
++ (void)curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback_new);
+ }
+ res = curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, (curl_write_callback)write_func);
+ if (res != CURLE_OK) {
+diff --git a/src/library/fetch.h b/src/library/fetch.h
+index 70c3779..4cce5d1 100644
+--- a/src/library/fetch.h
++++ b/src/library/fetch.h
+@@ -28,7 +28,8 @@ typedef enum {
+ * @param verbose Whether to be verbose
+ * @return A FetchStatus, indicating the operation taken
+ */
+-FetchStatus fetch_uri(const char *uri, const char *target, bool verbose);
++FetchStatus fetch_uri(const char *uri, const char *target, bool verbose,
++ unsigned int this_percent, unsigned int next_percent);
+
+ /**
+ * Attempt to extract the given gzipped file
+diff --git a/src/update.c b/src/update.c
+index 30fbe96..eaeeefd 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -266,7 +266,8 @@ static inline void update_end(int fd, const char *update_fname, bool ok)
+ }
+
+ static int do_fetch_update(int year, const char *db_dir, CveDB *cve_db,
+- bool db_exist, bool verbose)
++ bool db_exist, bool verbose,
++ unsigned int this_percent, unsigned int next_percent)
+ {
+ const char nvd_uri[] = URI_PREFIX;
+ autofree(cve_string) *uri_meta = NULL;
+@@ -330,14 +331,14 @@ refetch:
+ }
+
+ /* Fetch NVD META file */
+- st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose);
++ st = fetch_uri(uri_meta->str, nvdcve_meta->str, verbose, this_percent, this_percent);
+ if (st == FETCH_STATUS_FAIL) {
+ fprintf(stderr, "Failed to fetch %s\n", uri_meta->str);
+ return -1;
+ }
+
+ /* Fetch NVD XML file */
+- st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose);
++ st = fetch_uri(uri_data_gz->str, nvdcve_data_gz->str, verbose, this_percent, next_percent);
+ switch (st) {
+ case FETCH_STATUS_FAIL:
+ fprintf(stderr, "Failed to fetch %s\n", uri_data_gz->str);
+@@ -459,10 +460,17 @@ bool update_db(bool quiet, const char *db_file)
+ for (int i = YEAR_START; i <= year+1; i++) {
+ int y = i > year ? -1 : i;
+ int rc;
++ unsigned int start_percent = ((i+0 - YEAR_START) * 100) / (year+2 - YEAR_START);
++ unsigned int end_percent = ((i+1 - YEAR_START) * 100) / (year+2 - YEAR_START);
+
+- rc = do_fetch_update(y, db_dir, cve_db, db_exist, !quiet);
++ if (!quiet)
++ fprintf(stderr, "completed: %u%%\r", start_percent);
++ rc = do_fetch_update(y, db_dir, cve_db, db_exist, !quiet,
++ start_percent, end_percent);
+ switch (rc) {
+ case 0:
++ if (!quiet)
++ fprintf(stderr,"completed: %u%%\r", end_percent);
+ continue;
+ case ENOMEM:
+ goto oom;
+--
+2.9.3
+
diff --git a/poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch b/poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch
new file mode 100644
index 000000000..458c0cc84
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/files/0001-update-Compare-computed-vs-expected-sha256-digit-str.patch
@@ -0,0 +1,52 @@
+From b0426e63c9ac61657e029f689bcb8dd051e752c6 Mon Sep 17 00:00:00 2001
+From: Sergey Popovich <popovich_sergei@mail.ua>
+Date: Fri, 21 Apr 2017 07:32:23 -0700
+Subject: [PATCH] update: Compare computed vs expected sha256 digit string
+ ignoring case
+
+We produce sha256 digest string using %x snprintf()
+qualifier for each byte of digest which uses alphabetic
+characters from "a" to "f" in lower case to represent
+integer values from 10 to 15.
+
+Previously all of the NVD META files supply sha256
+digest string for corresponding XML file in lower case.
+
+However due to some reason this changed recently to
+provide digest digits in upper case causing fetched
+data consistency checks to fail. This prevents database
+from being updated periodically.
+
+While commit c4f6e94 (update: Do not treat sha256 failure
+as fatal if requested) adds useful option to skip
+digest validation at all and thus provides workaround for
+this situation, it might be unacceptable for some
+deployments where we need to ensure that downloaded
+data is consistent before start parsing it and update
+SQLite database.
+
+Use strcasecmp() to compare two digest strings case
+insensitively and addressing this case.
+
+Upstream-Status: Backport
+Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
+---
+ src/update.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/update.c b/src/update.c
+index 8588f38..3cc6b67 100644
+--- a/src/update.c
++++ b/src/update.c
+@@ -187,7 +187,7 @@ static bool nvdcve_data_ok(const char *meta, const char *data)
+ snprintf(&csum_data[idx], len, "%02hhx", digest[i]);
+ }
+
+- ret = streq(csum_meta, csum_data);
++ ret = !strcasecmp(csum_meta, csum_data);
+
+ err_unmap:
+ munmap(buffer, length);
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/cve-check-tool/files/check-for-malloc_trim-before-using-it.patch b/poky/meta/recipes-devtools/cve-check-tool/files/check-for-malloc_trim-before-using-it.patch
new file mode 100644
index 000000000..0774ad946
--- /dev/null
+++ b/poky/meta/recipes-devtools/cve-check-tool/files/check-for-malloc_trim-before-using-it.patch
@@ -0,0 +1,51 @@
+From ce64633b9733e962b8d8482244301f614d8b5845 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 22 Aug 2016 22:54:24 -0700
+Subject: [PATCH] Check for malloc_trim before using it
+
+malloc_trim is gnu specific and not all libc
+implement it, threfore write a configure check
+to poke for it first and use the define to
+guard its use.
+
+Helps in compiling on musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://github.com/ikeydoherty/cve-check-tool/pull/48]
+ configure.ac | 2 ++
+ src/core.c | 4 ++--
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index d3b66ce..79c3542 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -19,6 +19,8 @@ m4_define([json_required_version], [0.16.0])
+ m4_define([openssl_required_version],[1.0.0])
+ # TODO: Set minimum sqlite
+
++AC_CHECK_FUNCS_ONCE(malloc_trim)
++
+ PKG_CHECK_MODULES(CVE_CHECK_TOOL,
+ [
+ glib-2.0 >= glib_required_version,
+diff --git a/src/core.c b/src/core.c
+index 6263031..0d5df29 100644
+--- a/src/core.c
++++ b/src/core.c
+@@ -498,9 +498,9 @@ bool cve_db_load(CveDB *self, const char *fname)
+ }
+
+ b = true;
+-
++#ifdef HAVE_MALLOC_TRIM
+ malloc_trim(0);
+-
++#endif
+ xmlFreeTextReader(r);
+ if (fd) {
+ close(fd);
+--
+2.9.3
+
diff --git a/poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb b/poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb
new file mode 100644
index 000000000..54daabef5
--- /dev/null
+++ b/poky/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.23.bb
@@ -0,0 +1,18 @@
+SECTION = "console/utils"
+SUMMARY = "Command line utilities for working with *.desktop files"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/desktop-file-utils"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "glib-2.0-native"
+
+SRC_URI = "http://freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "599133d51cc9a41bfec186414906b6f1"
+SRC_URI[sha256sum] = "6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385"
+
+inherit autotools native
+
+S = "${WORKDIR}/desktop-file-utils-${PV}"
+
+EXTRA_OECONF += "ac_cv_prog_EMACS=no"
diff --git a/poky/meta/recipes-devtools/devel-config/distcc-config.bb b/poky/meta/recipes-devtools/devel-config/distcc-config.bb
new file mode 100644
index 000000000..3cd661d54
--- /dev/null
+++ b/poky/meta/recipes-devtools/devel-config/distcc-config.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Sets up distcc for compilation on the target device"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://distcc.sh"
+
+S = "${WORKDIR}"
+
+# Default to the host machine for a running qemu session
+DISTCC_HOSTS ?= "192.168.7.1"
+
+do_configure() {
+ sed -i "s%@DISTCC_HOSTS@%${DISTCC_HOSTS}%" distcc.sh
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}/profile.d
+ install -m 0755 distcc.sh ${D}${sysconfdir}/profile.d/
+}
+
+RDEPENDS_${PN} = "distcc"
diff --git a/poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh b/poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
new file mode 100644
index 000000000..b4205931d
--- /dev/null
+++ b/poky/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
@@ -0,0 +1,4 @@
+DISTCC_HOSTS="@DISTCC_HOSTS@"
+#DISTCC_VERBOSE="1"
+
+export DISTCC_HOSTS
diff --git a/poky/meta/recipes-devtools/devel-config/nfs-export-root.bb b/poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
new file mode 100644
index 000000000..56375a47b
--- /dev/null
+++ b/poky/meta/recipes-devtools/devel-config/nfs-export-root.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Configuration script to export target rootfs filesystem"
+DESCRIPTION = "Enables NFS access from any host to the entire filesystem (for development purposes)."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r1"
+
+SRC_URI = "file://exports"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 exports ${D}${sysconfdir}/
+}
+
+RDEPENDS_${PN} = "packagegroup-core-nfs-server"
diff --git a/poky/meta/recipes-devtools/devel-config/nfs-export-root/exports b/poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
new file mode 100644
index 000000000..1353c5ad8
--- /dev/null
+++ b/poky/meta/recipes-devtools/devel-config/nfs-export-root/exports
@@ -0,0 +1 @@
+/ *(rw,no_root_squash,async,no_subtree_check)
diff --git a/poky/meta/recipes-devtools/diffstat/diffstat/run-ptest b/poky/meta/recipes-devtools/diffstat/diffstat/run-ptest
new file mode 100644
index 000000000..a936b3d3f
--- /dev/null
+++ b/poky/meta/recipes-devtools/diffstat/diffstat/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./testing/run_test.sh ./testing/case*.pat |sed \
+ -e 's|** ok|PASS|' \
+ -e 's|?? fail|FAIL|'
diff --git a/poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb b/poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
new file mode 100644
index 000000000..f8b7b06cf
--- /dev/null
+++ b/poky/meta/recipes-devtools/diffstat/diffstat_1.61.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Tool to produce a statistics based on a diff"
+DESCRIPTION = "diffstat reads the output of diff and displays a histogram of \
+the insertions, deletions, and modifications per-file. It is useful for \
+reviewing large, complex patch files."
+HOMEPAGE = "http://invisible-island.net/diffstat/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://install-sh;endline=42;md5=b3549726c1022bee09c174c72a0ca4a5"
+
+SRC_URI = "http://invisible-mirror.net/archives/${BPN}/${BP}.tgz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "c048a32d55d8bd6724f382baf41f325f"
+SRC_URI[sha256sum] = "25359e0c27183f997b36c9202583b5dc2df390c20e22a92606af4bf7856a55ee"
+
+S = "${WORKDIR}/diffstat-${PV}"
+
+inherit autotools gettext ptest
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
+
+do_install_ptest() {
+ cp -r ${S}/testing ${D}${PTEST_PATH}
+}
diff --git a/poky/meta/recipes-devtools/distcc/distcc_3.2.bb b/poky/meta/recipes-devtools/distcc/distcc_3.2.bb
new file mode 100644
index 000000000..66046480b
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/distcc_3.2.bb
@@ -0,0 +1,69 @@
+SUMMARY = "A parallel build system"
+DESCRIPTION = "distcc is a parallel build system that distributes \
+compilation of C/C++/ObjC code across machines on a network."
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "avahi binutils"
+
+PACKAGECONFIG ??= "popt"
+PACKAGECONFIG[gtk] = "--with-gtk,--without-gtk --without-gnome,gtk+"
+# use system popt by default
+PACKAGECONFIG[popt] = "--without-included-popt,--with-included-popt,popt"
+
+RRECOMMENDS_${PN} = "avahi-daemon"
+
+SRC_URI = "git://github.com/akuster/distcc.git;branch=${PV} \
+ file://separatebuilddir.patch \
+ file://0001-zeroconf-Include-fcntl.h.patch \
+ file://default \
+ file://distccmon-gnome.desktop \
+ file://distcc \
+ file://distcc.service"
+SRCREV = "d8b18df3e9dcbe4f092bed565835d3975e99432c"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d useradd systemd
+
+EXTRA_OECONF += "--disable-Werror PYTHON='' --disable-pump-mode"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system \
+ --home /dev/null \
+ --no-create-home \
+ --gid nogroup \
+ distcc"
+
+INITSCRIPT_NAME = "distcc"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "distcc.service"
+
+do_install() {
+ # Improve reproducibility: compress w/o timestamps
+ oe_runmake 'DESTDIR=${D}' "GZIP_BIN=gzip -n" install
+ install -d ${D}${sysconfdir}/init.d/
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/distcc.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/distcc.service
+ ${DESKTOPINSTALL}
+}
+DESKTOPINSTALL = ""
+DESKTOPINSTALL_libc-glibc () {
+ install -d ${D}${datadir}/distcc/
+ install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
+}
+PACKAGES += "distcc-distmon-gnome"
+
+FILES_${PN} = " ${sysconfdir} \
+ ${bindir}/distcc \
+ ${bindir}/lsdistcc \
+ ${bindir}/distccd \
+ ${bindir}/distccmon-text \
+ ${systemd_unitdir}/system/distcc.service"
+FILES_distcc-distmon-gnome = " ${bindir}/distccmon-gnome \
+ ${datadir}/distcc"
diff --git a/poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch b/poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
new file mode 100644
index 000000000..b17ec9c95
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
@@ -0,0 +1,29 @@
+From 8331fc4759d809512f404e7a27f817ad6d616450 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:00:33 -0700
+Subject: [PATCH] zeroconf: Include fcntl.h
+
+We need it for getting deinitions for O_* e.g. O_CREAT
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/zeroconf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/zeroconf.c b/src/zeroconf.c
+index 414ddc4..31bd33f 100644
+--- a/src/zeroconf.c
++++ b/src/zeroconf.c
+@@ -33,6 +33,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <limits.h>
++#include <fcntl.h>
+
+ #include <avahi-common/domain.h>
+ #include <avahi-common/error.h>
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/distcc/files/default b/poky/meta/recipes-devtools/distcc/files/default
new file mode 100644
index 000000000..63c4159b9
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/default
@@ -0,0 +1,24 @@
+# Defaults for distcc initscript
+# sourced by /etc/init.d/distcc
+
+#
+# should distcc be started on boot?
+#
+# STARTDISTCC="true"
+
+STARTDISTCC="true"
+
+#
+# Which networks/hosts should be allowed to connect to the daemon?
+# You can list multiple hosts/networks separated by spaces.
+# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
+# Hosts are represented by a single IP Adress
+#
+# ALLOWEDNETS="127.0.0.1"
+
+ALLOWEDNETS="192.168.7.0/24"
+
+#
+# OPTIONS is used for the systemd service file
+#
+OPTIONS="--allow 192.168.7.0/24"
diff --git a/poky/meta/recipes-devtools/distcc/files/distcc b/poky/meta/recipes-devtools/distcc/files/distcc
new file mode 100755
index 000000000..e36f0fa69
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/distcc
@@ -0,0 +1,119 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: distcc
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: simple distributed compiler client and server
+### END INIT INFO
+#
+# distccd Debian init.d script contributed by Jason Thomas. (Debian #161136)
+#
+# skeleton example file to build /etc/init.d/ scripts.
+# This file should be used to construct scripts for /etc/init.d.
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian GNU/Linux
+# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/distccd
+NAME=distcc
+DESC="Distributed Compiler Daemon"
+DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon"
+# please change those variables by overriding them in /etc/defaults/distcc
+ALLOWEDNETS="127.0.0.1"
+
+# Reads config file (will override defaults above)
+[ -r /etc/default/distcc ] && . /etc/default/distcc
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+# construct access list
+ALLOW=""
+for net in $ALLOWEDNETS
+do
+ ALLOW="$ALLOW --allow $net"
+done
+
+should_start() {
+ if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then
+ echo "STARTDISTCC is set to false in /etc/default/distcc"
+ echo "$DAEMON not starting"
+ exit 0
+ fi
+ # we need permission to write to the pid file
+ touch /var/run/$NAME.pid
+ chown distcc /var/run/$NAME.pid
+}
+
+case "$1" in
+ start)
+ should_start
+ echo -n "Starting $DESC: $NAME"
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+ {
+ code=$?
+ echo "$0: start failed with error code $code" >&2
+ exit $code
+ }
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: $NAME"
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON ||
+ {
+ code=$?
+ echo "$0: stop failed with error code $code" >&2
+ exit $code
+ }
+ rm -f /var/run/$NAME.pid >/dev/null 2>&1
+ echo "."
+ ;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo -n "Restarting $DESC: $NAME"
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON
+ sleep 1
+ should_start
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+ {
+ code=$?
+ rm -f /var/run/$NAME.pid >/dev/null 2>&1
+ echo "$0: restart failed with error code $code" >&2
+ exit $code
+ }
+ echo "."
+ ;;
+
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+
diff --git a/poky/meta/recipes-devtools/distcc/files/distcc.service b/poky/meta/recipes-devtools/distcc/files/distcc.service
new file mode 100644
index 000000000..0253ddf52
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/distcc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Distccd A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+EnvironmentFile=-/etc/default/distcc
+ExecStart=@BINDIR@/distccd --verbose --no-detach --daemon $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop b/poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
new file mode 100644
index 000000000..7b5d85ce4
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=0.9.4
+Exec=distccmon-gnome
+Name=distcc monitor
+GenericName=Distributed Compile Monitor
+Comment=Graphical view of distributed compile tasks
+Icon=distccmon-gnome-icon
+TryExec=distccmon-gnome
+Terminal=false
+Type=Application
+Categories=GNOME;Development;
+StartupNotify=true
diff --git a/poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch b/poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch
new file mode 100644
index 000000000..7580b5584
--- /dev/null
+++ b/poky/meta/recipes-devtools/distcc/files/separatebuilddir.patch
@@ -0,0 +1,21 @@
+When building with a separate build directory, make install fails,
+unable to find the gnome_data files. This patch corrects the
+patch and ensures the build works in this case.
+
+RP 2013/3/8
+
+Upstream-Status: Pending
+
+Index: git/Makefile.in
+===================================================================
+--- git.orig/Makefile.in
++++ git/Makefile.in
+@@ -1117,7 +1117,7 @@ install-example: $(example_DOCS)
+ install-gnome-data: $(gnome_data)
+ $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
+ for p in $(gnome_data); do \
+- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
++ $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+ done
+
+ install-conf: $(conf_files) $(default_files)
diff --git a/poky/meta/recipes-devtools/dmidecode/dmidecode_3.1.bb b/poky/meta/recipes-devtools/dmidecode/dmidecode_3.1.bb
new file mode 100644
index 000000000..f83281e23
--- /dev/null
+++ b/poky/meta/recipes-devtools/dmidecode/dmidecode_3.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "DMI (Desktop Management Interface) table related utilities"
+HOMEPAGE = "http://www.nongnu.org/dmidecode/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/dmidecode/${BP}.tar.xz"
+
+COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm|powerpc|powerpc64).*-linux"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ oe_runmake DESTDIR="${D}" install
+}
+
+do_unpack_extra() {
+ sed -i -e '/^prefix/s:/usr/local:${exec_prefix}:' ${S}/Makefile
+}
+addtask unpack_extra after do_unpack before do_patch
+
+SRC_URI[md5sum] = "679c2c015c515aa6ca5f229aee49c102"
+SRC_URI[sha256sum] = "d766ce9b25548c59b1e7e930505b4cad9a7bb0b904a1a391fbb604d529781ac0"
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch b/poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
new file mode 100644
index 000000000..6692b41a1
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf/0001-Corretly-install-tmpfiles.d-configuration.patch
@@ -0,0 +1,22 @@
+From 05e059cd4e9910c00b32d377f4f98e3c8dde6bc6 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 26 Jan 2017 16:36:20 +0200
+Subject: [PATCH 4/5] Corretly install tmpfiles.d configuration
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ etc/tmpfiles.d/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/etc/tmpfiles.d/CMakeLists.txt b/etc/tmpfiles.d/CMakeLists.txt
+index f69c773e..3eb6d0e8 100644
+--- a/etc/tmpfiles.d/CMakeLists.txt
++++ b/etc/tmpfiles.d/CMakeLists.txt
+@@ -1 +1 @@
+-INSTALL (FILES dnf.conf DESTINATION /usr/lib/tmpfiles.d/)
++INSTALL (FILES dnf.conf DESTINATION ${SYSCONFDIR}/tmpfiles.d/)
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch b/poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
new file mode 100644
index 000000000..15a7bfc73
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf/0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch
@@ -0,0 +1,30 @@
+From a8ef81c115a45f05dad145c98e10f3c4940e4e29 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 26 Jan 2017 16:25:47 +0200
+Subject: [PATCH 3/5] Do not hardcode /etc and systemd unit directories
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 650b624a..10199618 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,8 +7,8 @@ if (NOT PYTHON_DESIRED)
+ set (PYTHON_DESIRED "2")
+ endif()
+
+-SET( SYSCONFDIR /etc)
+-SET( SYSTEMD_DIR /usr/lib/systemd/system)
++SET( SYSCONFDIR ${CMAKE_INSTALL_SYSCONFDIR})
++SET( SYSTEMD_DIR $ENV{systemd_system_unitdir})
+
+ if (${PYTHON_DESIRED} STREQUAL "2")
+ FIND_PACKAGE (PythonInterp REQUIRED)
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch b/poky/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch
new file mode 100644
index 000000000..aa20009ce
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf/0005-Do-not-prepend-installroot-to-logdir.patch
@@ -0,0 +1,31 @@
+From 6365389074a1b86962f3d8b22a2ead2202026a98 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 11 Jan 2017 15:10:13 +0200
+Subject: [PATCH 5/5] Do not prepend installroot to logdir.
+
+This would otherwise write the logs into rootfs/var/log
+(whereas we want them in $T),
+and will break installation of base-files rpm.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ dnf/cli/cli.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
+index d2d9c082..82270ecf 100644
+--- a/dnf/cli/cli.py
++++ b/dnf/cli/cli.py
+@@ -920,7 +920,7 @@ class Cli(object):
+ logger.warning(_("Unable to detect release version (use '--releasever' to specify "
+ "release version)"))
+
+- for opt in ('cachedir', 'logdir', 'persistdir'):
++ for opt in ('cachedir', 'persistdir'):
+ conf.prepend_installroot(opt)
+
+ self.base._logging._setup_from_dnf_conf(conf)
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 000000000..6e011915d
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf/0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,28 @@
+From 7205033e44d8fba1d3b18b490e7eaab82da1ffa3 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:29:07 +0200
+Subject: [PATCH 1/5] Do not set PYTHON_INSTALL_DIR by running python
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 23e5f889..650b624a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,7 +18,7 @@ else()
+ FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+ endif()
+
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib())" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; sys.stdout.write('%s.%s' % (sys.version_info.major, sys.version_info.minor))" OUTPUT_VARIABLE PYTHON_MAJOR_DOT_MINOR_VERSION)
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch b/poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
new file mode 100644
index 000000000..eedbb5723
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf/0030-Run-python-scripts-using-env.patch
@@ -0,0 +1,38 @@
+From 8d97b72a1d77149e2f9048d1ca6cef66da1a8aa5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:29:37 +0200
+Subject: [PATCH 2/5] Run python scripts using env
+
+Otherwise the build tools hardcode the python path into them.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ bin/dnf-automatic.in | 2 +-
+ bin/dnf.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bin/dnf-automatic.in b/bin/dnf-automatic.in
+index 5b06aa26..891b4c24 100755
+--- a/bin/dnf-automatic.in
++++ b/bin/dnf-automatic.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!/usr/bin/env python3
+ # dnf-automatic executable.
+ #
+ # Copyright (C) 2014-2016 Red Hat, Inc.
+diff --git a/bin/dnf.in b/bin/dnf.in
+index 645d0f06..bdf7b3c4 100755
+--- a/bin/dnf.in
++++ b/bin/dnf.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON_EXECUTABLE@
++#!/usr/bin/env python3
+ # The dnf executable script.
+ #
+ # Copyright (C) 2012-2016 Red Hat, Inc.
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/dnf/dnf_2.7.5.bb b/poky/meta/recipes-devtools/dnf/dnf_2.7.5.bb
new file mode 100644
index 000000000..b88ddb445
--- /dev/null
+++ b/poky/meta/recipes-devtools/dnf/dnf_2.7.5.bb
@@ -0,0 +1,74 @@
+SUMMARY = "Package manager forked from Yum, using libsolv as a dependency resolver"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://PACKAGE-LICENSING;md5=bfc29916e11321be06924c4fb096fdcc \
+ "
+
+SRC_URI = "git://github.com/rpm-software-management/dnf.git \
+ file://0001-Corretly-install-tmpfiles.d-configuration.patch \
+ file://0001-Do-not-hardcode-etc-and-systemd-unit-directories.patch \
+ file://0005-Do-not-prepend-installroot-to-logdir.patch \
+ file://0029-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+ file://0030-Run-python-scripts-using-env.patch \
+ "
+
+SRCREV = "564c44667c7014843fa6f1732621093114ec59b2"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake gettext bash-completion distutils3-base systemd
+
+DEPENDS += "libdnf librepo libcomps python3-iniparse"
+
+# manpages generation requires http://www.sphinx-doc.org/
+EXTRA_OECMAKE = " -DWITH_MAN=0 -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+
+BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS_${PN}_class-target += " \
+ python3-core \
+ python3-codecs \
+ python3-netclient \
+ python3-email \
+ python3-threading \
+ python3-distutils \
+ python3-logging \
+ python3-fcntl \
+ librepo \
+ python3-shell \
+ libcomps \
+ libdnf \
+ python3-sqlite3 \
+ python3-compression \
+ python3-rpm \
+ python3-iniparse \
+ python3-json \
+ python3-curses \
+ python3-misc \
+ python3-gpg \
+ "
+
+RRECOMMENDS_${PN}_class-target += "gnupg"
+
+# Create a symlink called 'dnf' as 'make install' does not do it, but
+# .spec file in dnf source tree does (and then Fedora and dnf documentation
+# says that dnf binary is plain 'dnf').
+do_install_append() {
+ lnr ${D}/${bindir}/dnf-3 ${D}/${bindir}/dnf
+ lnr ${D}/${bindir}/dnf-automatic-3 ${D}/${bindir}/dnf-automatic
+}
+
+# Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/dnf \
+ RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
+ RPM_NO_CHROOT_FOR_SCRIPTS=1
+}
+
+SYSTEMD_SERVICE_${PN} = "dnf-makecache.service dnf-makecache.timer \
+ dnf-automatic.service dnf-automatic.timer \
+ dnf-automatic-download.service dnf-automatic-download.timer \
+ dnf-automatic-install.service dnf-automatic-install.timer \
+ dnf-automatic-notifyonly.service dnf-automatic-notifyonly.timer \
+"
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
new file mode 100644
index 000000000..6da7f5b8c
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
@@ -0,0 +1,16 @@
+Permission to use, copy, modify and distribute the DocBook XML DTD
+and its accompanying documentation for any purpose and without fee
+is hereby granted in perpetuity, provided that the above copyright
+notice and this paragraph appear in all copies. The copyright
+holders make no representation about the suitability of the DTD for
+any purpose. It is provided "as is" without expressed or implied
+warranty.
+
+If you modify the DocBook DTD in any way, except for declaring and
+referencing additional sets of general entities and declaring
+additional notations, label your DTD as a variant of DocBook. See
+the maintenance documentation for more information.
+
+Please direct all questions, bug reports, or suggestions for
+changes to the docbook@lists.oasis-open.org mailing list. For more
+information, see http://www.oasis-open.org/docbook/.
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
new file mode 100644
index 000000000..59703609c
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
@@ -0,0 +1,515 @@
+docbook-xml: update catalog.xml
+
+Refer Ubuntu 13.04 to update catalog.xml
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ docbook-4.0/catalog.xml | 72 +++++++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.1.2/catalog.xml | 66 +++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.2/catalog.xml | 69 ++++++---------------------------------------
+ docbook-4.3/catalog.xml | 72 ++++++++---------------------------------------
+ docbook-4.4/catalog.xml | 63 ++---------------------------------------
+ docbook-4.5/catalog.xml | 63 ++---------------------------------------
+ 6 files changed, 165 insertions(+), 240 deletions(-)
+ create mode 100644 docbook-4.0/catalog.xml
+ create mode 100644 docbook-4.1.2/catalog.xml
+
+diff --git a/docbook-4.0/catalog.xml b/docbook-4.0/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.0/catalog.xml
+@@ -0,0 +1,72 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.0............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- Please direct all questions, bug reports, or suggestions for
++ changes to the docbook@lists.oasis-open.org mailing list. For more
++ information, see http://www.oasis-open.org/.
++ -->
++
++<!-- This is the catalog data file for DocBook V4.0. It is provided as
++ a convenience in building your own catalog files. You need not use
++ the filenames listed here, and need not use the filename method of
++ identifying storage objects at all. See the documentation for
++ detailed information on the files associated with the DocBook DTD.
++ See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++ detailed information on supplying and using catalog data.
++ -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//Norman Walsh//DTD DocBk XML V4.0//EN"
++ uri="docbookx.dtd"/>
++
++<!-- Other ways to refer to DocBook XML v4.0............................... -->
++<public publicId="-//Norman Walsh//DTD DocBook XML V4.0//EN"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN"
++ uri="dbnotnx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN"
++ uri="dbcentx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN"
++ uri="dbpoolx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN"
++ uri="dbhierx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN"
++ uri="dbgenent.mod"/>
++
++<public publicId="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN"
++ uri="calstblx.dtd"/>
++
++<!-- UNOFFICIAL conversion of the exchange table model to XML, based on the OASIS Exchange -->
++<!-- Table Model PUBLIC "-//SGML Open//DTD Exchange Table Model 19960430//EN" -->
++<public publicId="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN"
++ uri="soextblx.dtd"/>
++
++<!-- the following FPI is declared for the DTD inside the DTD, but we'll -->
++<!-- use the version from the latest DocBook
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++ uri="soextblx.dtd"/> -->
++
++<!-- End of catalog data for DocBook XML V4.0 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.1.2/catalog.xml b/docbook-4.1.2/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.1.2/catalog.xml
+@@ -0,0 +1,66 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.1.2............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- Please direct all questions, bug reports, or suggestions for
++ changes to the docbook@lists.oasis-open.org mailing list. For more
++ information, see http://www.oasis-open.org/.
++ -->
++
++<!-- This is the catalog data file for DocBook V4.1.2. It is provided as
++ a convenience in building your own catalog files. You need not use
++ the filenames listed here, and need not use the filename method of
++ identifying storage objects at all. See the documentation for
++ detailed information on the files associated with the DocBook DTD.
++ See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++ detailed information on supplying and using catalog data.
++ -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.1.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN"
++ uri="calstblx.dtd"/>
++
++ <!-- already included in docbook 4.2
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++ uri="soextblx.dtd"/> -->
++
++<public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN"
++ uri="dbpoolx.mod"/>
++
++<public publicId="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN"
++ uri="dbhierx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN"
++ uri="dbgenent.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN"
++ uri="dbnotnx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN"
++ uri="dbcentx.mod"/>
++
++
++<!-- End of catalog data for DocBook XML V4.1.2 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.2/catalog.xml b/docbook-4.2/catalog.xml
+--- a/docbook-4.2/catalog.xml
++++ b/docbook-4.2/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+
+ <!-- ...................................................................... -->
+@@ -25,6 +28,12 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
+ uri="docbookx.dtd"/>
+
++<system systemId="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.2/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+
+@@ -49,66 +58,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.2 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.3/catalog.xml b/docbook-4.3/catalog.xml
+--- a/docbook-4.3/catalog.xml
++++ b/docbook-4.3/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+
+ <!-- ...................................................................... -->
+@@ -25,12 +28,21 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.3//EN"
+ uri="docbookx.dtd"/>
+
++<system systemId="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.3/docbookx.dtd"
++ uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+
+ <public publicId="-//OASIS//DTD DocBook CALS Table Model V4.3//EN"
+ uri="calstblx.dtd"/>
+
++<public publicId="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN"
++ uri="htmltblx.mod"/>
++
+ <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+ uri="soextblx.dtd"/>
+
+@@ -49,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.3 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.4/catalog.xml b/docbook-4.4/catalog.xml
+--- a/docbook-4.4/catalog.xml
++++ b/docbook-4.4/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.4 ............................. -->
+ <!-- ...................................................................... -->
+
+diff --git a/docbook-4.5/catalog.xml b/docbook-4.5/catalog.xml
+--- a/docbook-4.5/catalog.xml
++++ b/docbook-4.5/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
+ uri="dbcentx.mod"/>
+
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+- uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+- uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+- uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+- uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+- uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+- uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+- uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+- uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+- uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+- uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+- uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+- uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+- uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+- uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+- uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+- uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+- uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+- uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+- uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.5 ............................. -->
+ <!-- ...................................................................... -->
+
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
new file mode 100644
index 000000000..b71f559ef
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://docbook.org/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+ <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+</catalog>
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
new file mode 100644
index 000000000..da62b77a6
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Document type definitions for verification of XML data files"
+DESCRIPTION = "Document type definitions for verification of XML data \
+files against the DocBook rule set, it ships with the latest DocBook 4.5 \
+XML DTD, as well as a selected set of legacy DTDs for use with older \
+documents, including 4.0, 4.1.2, 4.2, 4.3 and 4.4"
+HOMEPAGE = "http://www.docbook.org/xml/"
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+# Note: the upstream sources are not distributed with a license file.
+# LICENSE-OASIS is included as a "patch" to workaround this. When
+# upgrading this recipe, please verify whether this is still needed.
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/d/docbook-xml/docbook-xml_${PV}.orig.tar.gz \
+ file://LICENSE-OASIS \
+ file://docbook-xml-update-catalog.xml.patch \
+ file://docbook-xml.xml \
+"
+
+SRC_URI[md5sum] = "487b4d44e15cffb1f4048af23f98208e"
+SRC_URI[sha256sum] = "b0f8edcf697f5318e63dd98c9a931f3fee167af0805ba441db372e0f17b2a44f"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/docbook-xml/"
+
+S="${WORKDIR}/docbook-xml-4.5.c31424"
+
+inherit allarch
+BBCLASSEXTEND = "native"
+
+do_configure (){
+ :
+}
+
+do_compile (){
+ :
+}
+
+do_install () {
+ # Refer debian https://packages.debian.org/sid/all/docbook-xml/filelist
+ for DTDVERSION in 4.0 4.1.2 4.2 4.3 4.4 4.5; do
+ install -d -m 755 ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+ cp -v -R docbook-${DTDVERSION}/* ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+ done
+
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/docbook-xml.xml ${D}${sysconfdir}/xml/docbook-xml.xml
+}
+
+do_install_append_class-native () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${D}${sysconfdir}/xml/docbook-xml.xml
+}
+
+FILES_${PN} = "${datadir}/* ${sysconfdir}/xml/docbook-xml.xml"
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
new file mode 100644
index 000000000..0559a5c0d
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
@@ -0,0 +1,24 @@
+docbook-xsl-stylesheets: no bashism in docbook-xsl-update
+
+The checkbashisms shows there is no bashism, so use /bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/bin/docbook-xsl-update | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/bin/docbook-xsl-update b/tools/bin/docbook-xsl-update
+index aba0016..cc73aa2 100755
+--- a/tools/bin/docbook-xsl-update
++++ b/tools/bin/docbook-xsl-update
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # vim: number
+
+ # docbook-xsl-update - Update environment to latest docbook-xsl snapshot
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
new file mode 100644
index 000000000..c60555ae1
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets/catalog.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets/catalog.xml"/>
+</catalog>
diff --git a/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb
new file mode 100644
index 000000000..07d32ce97
--- /dev/null
+++ b/poky/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.79.1.bb
@@ -0,0 +1,63 @@
+SUMMARY = "XSL stylesheets for processing DocBook XML to various output formats"
+HOMEPAGE = "http://docbook.sourceforge.net"
+LICENSE = "XSL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6beadd98f9c54ab0c387e14211ee4d0e"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-xsl-${PV}.tar.bz2 \
+ file://docbook-xsl.xml \
+ file://docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch \
+"
+
+SRC_URI[md5sum] = "b48cbf929a2ad85e6672f710777ca7bc"
+SRC_URI[sha256sum] = "725f452e12b296956e8bfb876ccece71eeecdd14b94f667f3ed9091761a4a968"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/docbook/files/docbook-xsl/"
+# Reject versions ending in .0 as those are release candidates
+UPSTREAM_CHECK_REGEX = "/docbook-xsl/(?P<pver>(\d+[\.\-_]*)+(?!\.0)\.\d+)/"
+
+S = "${WORKDIR}/docbook-xsl-${PV}"
+
+inherit allarch
+BBCLASSEXTEND = "native"
+
+do_configure (){
+ :
+}
+
+do_compile (){
+ :
+}
+
+do_install () {
+ # Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-xsl.html
+ # for details.
+ install -v -m755 -d ${D}${datadir}/xml/docbook/xsl-stylesheets-${PV}
+ ln -s xsl-stylesheets-${PV} ${D}${datadir}/xml/docbook/xsl-stylesheets
+
+ cp -v -R VERSION assembly common eclipse epub epub3 fo \
+ highlighting html htmlhelp images javahelp lib manpages \
+ params profiling roundtrip slides template webhelp website \
+ xhtml xhtml-1_1 xhtml5 catalog.xml \
+ ${D}${datadir}/xml/docbook/xsl-stylesheets-${PV}
+
+ ln -s VERSION ${D}/${datadir}/xml/docbook/xsl-stylesheets-${PV}/VERSION.xsl
+
+ install -v -m644 -D README \
+ ${D}${datadir}/doc/docbook-xsl-${PV}/README.txt
+ install -v -m644 RELEASE-NOTES* NEWS* \
+ ${D}${datadir}/doc/docbook-xsl-${PV}
+
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/docbook-xsl.xml ${D}${sysconfdir}/xml/docbook-xsl.xml
+
+}
+
+do_install_append_class-native () {
+ # Ensure that the catalog file sgml-docbook.cat is properly
+ # updated when the package is installed from sstate cache.
+ sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${D}${sysconfdir}/xml/docbook-xsl.xml
+}
+
+RDEPENDS_${PN} += "perl"
+FILES_${PN} = "${datadir}/xml/* ${sysconfdir}/xml/docbook-xsl.xml"
+FILES_${PN}-doc = "${datadir}/doc/*"
diff --git a/poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb b/poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
new file mode 100644
index 000000000..69aa81af4
--- /dev/null
+++ b/poky/meta/recipes-devtools/dosfstools/dosfstools_4.1.bb
@@ -0,0 +1,25 @@
+# dosfstools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc. All Rights Reserved
+# Copyright (C) 2015, Sören Brinkmann <soeren.brinkmann@gmail> All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "DOS FAT Filesystem Utilities"
+HOMEPAGE = "https://github.com/dosfstools/dosfstools"
+
+SECTION = "base"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${BP}.tar.xz \
+ "
+SRC_URI[md5sum] = "07a1050db1a898e9a2e03b0c4569c4bd"
+SRC_URI[sha256sum] = "e6b2aca70ccc3fe3687365009dd94a2e18e82b688ed4e260e04b7412471cc173"
+
+UPSTREAM_CHECK_URI = "https://github.com/dosfstools/dosfstools/releases"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--without-udev --enable-compat-symlinks"
+
+CFLAGS += "-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg.inc b/poky/meta/recipes-devtools/dpkg/dpkg.inc
new file mode 100644
index 000000000..fe4732d1d
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,101 @@
+SUMMARY = "Package maintenance system from Debian"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+DEPENDS = "zlib bzip2 perl ncurses"
+DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} perl"
+RDEPENDS_${PN}_class-native = ""
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
+
+inherit autotools gettext perlnative pkgconfig systemd perl-version
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ pn = d.getVar('PN')
+ d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
+}
+
+export PERL = "${bindir}/perl"
+PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
+
+export PERL_LIBDIR = "${libdir}/perl/${@get_perl_version(d)}"
+PERL_LIBDIR_class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}"
+
+EXTRA_OECONF = "\
+ --disable-dselect \
+ --enable-start-stop-daemon \
+ --with-libz \
+ --with-libbz2 \
+ --without-libselinux \
+ "
+
+PACKAGECONFIG = "liblzma"
+PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
+
+EXTRA_OECONF += "TAR=tar"
+EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
+
+do_install_append () {
+ if [ "${PN}" = "dpkg-native" ]; then
+ # update-alternatives doesn't have an offline mode
+ rm ${D}${bindir}/update-alternatives
+ sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+ else
+ sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+ ${D}${systemd_unitdir}/system/dpkg-configure.service
+ fi
+}
+
+PROV = "virtual/update-alternatives"
+PROV_class-native = ""
+
+PROVIDES += "${PROV}"
+
+PACKAGES =+ "update-alternatives-dpkg"
+FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
+RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+
+PACKAGES += "${PN}-perl"
+FILES_${PN}-perl = "${libdir}/perl/${@get_perl_version(d)}"
+
+RDEPENDS_${PN}-perl += "perl-module-carp perl-module-constant \
+ perl-module-cwd perl-module-digest \
+ perl-module-digest-md5 perl-module-errno \
+ perl-module-exporter perl-module-fcntl \
+ perl-module-feature perl-module-file-basename \
+ perl-module-file-compare perl-module-file-copy \
+ perl-module-file-find perl-module-file-path \
+ perl-module-file-spec perl-module-file-temp \
+ perl-module-list-util perl-module-overload \
+ perl-module-parent perl-module-storable \
+ perl-module-filehandle perl-module-io \
+ perl-module-io-handle perl-module-io-seekable \
+ perl-module-posix perl-module-scalar-util \
+ perl-module-selectsaver perl-module-symbol \
+ perl-module-term-ansicolor perl-module-tie-handle \
+ perl-module-tie-hash perl-module-storable \
+ perl-module-time-hires perl-module-time-piece \
+ perl-module-xsloader"
+
+# Split out start-stop-daemon to its own package. Note that it
+# is installed in a different directory than the one used for
+# the bitbake version.
+#
+PACKAGES =+ "${PN}-start-stop"
+FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon"
+
+RDEPENDS_${PN} += "${PN}-start-stop"
+
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0001-arch-Add-support-for-riscv64-CPU.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0001-arch-Add-support-for-riscv64-CPU.patch
new file mode 100644
index 000000000..45c606e69
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0001-arch-Add-support-for-riscv64-CPU.patch
@@ -0,0 +1,54 @@
+From 319f32d743f5b5e725012654d124e49226d5de91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Mar 2018 20:28:24 -0700
+Subject: [PATCH] arch: Add support for riscv64 CPU
+
+ * Architecture support:
+ - Add support for riscv64 CPU. Closes: #822914
+ Thanks to Manuel A. Fernandez Montecelo <mafm@debian.org>
+
+Upstream-Status: Backport [https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=dpkg%2Fdpkg.git;a=commitdiff_plain;h=ee0855cc66076691de4796be48f8a0d889fde001;hp=2f5816d8be40b449d2473b22f9e0c33b32f3bd78]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ data/cputable | 1 +
+ scripts/t/Dpkg_Arch.t | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/data/cputable b/data/cputable
+index a2bd7d6..9f2a8e0 100644
+--- a/data/cputable
++++ b/data/cputable
+@@ -41,6 +41,7 @@ powerpc powerpc (powerpc|ppc) 32 big
+ powerpcel powerpcle powerpcle 32 little
+ ppc64 powerpc64 (powerpc|ppc)64 64 big
+ ppc64el powerpc64le powerpc64le 64 little
++riscv64 riscv64 riscv64 64 little
+ s390 s390 s390 32 big
+ s390x s390x s390x 64 big
+ sh3 sh3 sh3 32 little
+diff --git a/scripts/t/Dpkg_Arch.t b/scripts/t/Dpkg_Arch.t
+index d478b49..ecd5d66 100644
+--- a/scripts/t/Dpkg_Arch.t
++++ b/scripts/t/Dpkg_Arch.t
+@@ -16,7 +16,7 @@
+ use strict;
+ use warnings;
+
+-use Test::More tests => 16367;
++use Test::More tests => 16832;
+
+ use_ok('Dpkg::Arch', qw(debarch_to_debtuple debarch_to_multiarch
+ debarch_eq debarch_is debarch_is_wildcard
+@@ -162,7 +162,7 @@ is(gnutriplet_to_debarch(undef), undef, 'undef gnutriplet');
+ is(gnutriplet_to_debarch('unknown-unknown-unknown'), undef, 'unknown gnutriplet');
+ is(gnutriplet_to_debarch('x86_64-linux-gnu'), 'amd64', 'known gnutriplet');
+
+-is(scalar get_valid_arches(), 524, 'expected amount of known architectures');
++is(scalar get_valid_arches(), 539, 'expected amount of known architectures');
+
+ {
+ local $ENV{CC} = 'false';
+--
+2.16.2
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0001-dpkg-Support-muslx32-build.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0001-dpkg-Support-muslx32-build.patch
new file mode 100644
index 000000000..50e689440
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0001-dpkg-Support-muslx32-build.patch
@@ -0,0 +1,41 @@
+From a328c8bec0bf8071ae8f20fee4c7475205064ba1 Mon Sep 17 00:00:00 2001
+From: sweeaun <swee.aun.khor@intel.com>
+Date: Sun, 10 Sep 2017 00:14:15 -0700
+Subject: [PATCH] dpkg: Support muslx32 build
+
+Upstream-Status: Pending.
+Changes made on ostable and tupletable to enable muslx32 build.
+
+Signed-off-by: sweeaun <swee.aun.khor@intel.com>
+---
+ data/ostable | 1 +
+ data/tupletable | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/data/ostable b/data/ostable
+index be64342..87db273 100644
+--- a/data/ostable
++++ b/data/ostable
+@@ -19,6 +19,7 @@ base-uclibc-linux linux-uclibc linux[^-]*-uclibc
+ eabihf-musl-linux linux-musleabihf linux[^-]*-musleabihf
+ eabi-musl-linux linux-musleabi linux[^-]*-musleabi
+ base-musl-linux linux-musl linux[^-]*-musl
++x32-musl-linux linux-muslx32 linux[^-]*-muslx32
+ eabihf-gnu-linux linux-gnueabihf linux[^-]*-gnueabihf
+ eabi-gnu-linux linux-gnueabi linux[^-]*-gnueabi
+ abin32-gnu-linux linux-gnuabin32 linux[^-]*-gnuabin32
+diff --git a/data/tupletable b/data/tupletable
+index 28f00bf..748ffab 100644
+--- a/data/tupletable
++++ b/data/tupletable
+@@ -10,6 +10,7 @@ base-uclibc-linux-<cpu> uclibc-linux-<cpu>
+ eabihf-musl-linux-arm musl-linux-armhf
+ eabi-musl-linux-arm musl-linux-armel
+ base-musl-linux-<cpu> musl-linux-<cpu>
++x32-musl-linux-amd64 x32
+ ilp32-gnu-linux-arm64 arm64ilp32
+ eabihf-gnu-linux-arm armhf
+ eabi-gnu-linux-arm armel
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
new file mode 100644
index 000000000..9fe0ca760
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
@@ -0,0 +1,38 @@
+From b4ea54158c399874e12394ebc91afe98954695e2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:16:16 +0300
+Subject: [PATCH 2/5] Adapt to linux-wrs kernel version, which has character
+ '_' inside. Remove the first-char-digit-check (as the 1.15.8.5 version does).
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ lib/dpkg/parsehelp.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
+index 453077fd9..f42ea2882 100644
+--- a/lib/dpkg/parsehelp.c
++++ b/lib/dpkg/parsehelp.c
+@@ -243,14 +243,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
+ ptr = rversion->version;
+ if (!*ptr)
+ return dpkg_put_error(err, _("version number is empty"));
+- if (*ptr && !c_isdigit(*ptr++))
+- return dpkg_put_warn(err, _("version number does not start with digit"));
+ for (; *ptr; ptr++) {
+- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
++ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
+ return dpkg_put_warn(err, _("invalid character in version number"));
+ }
+ for (ptr = rversion->revision; *ptr; ptr++) {
+- if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".+~", *ptr) == NULL)
++ if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
+ return dpkg_put_warn(err, _("invalid character in revision number"));
+ }
+
+
+--
+2.11.0
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
new file mode 100644
index 000000000..93d870443
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -0,0 +1,75 @@
+From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:25:45 +0300
+Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
+ sysroot and don't expect a chroot. This matches up our system expectations
+ with what dpkg does.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2011/12/07
+ALIMON 2016/05/26
+ALIMON 2017/02/21
+---
+ src/script.c | 44 +++-----------------------------------------
+ 1 file changed, 3 insertions(+), 41 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index 2f252ae..768a9d1 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -97,48 +97,10 @@ setexecute(const char *path, struct stat *stab)
+ static const char *
+ maintscript_pre_exec(struct command *cmd)
+ {
+- const char *admindir = dpkg_db_get_dir();
+- const char *changedir;
+- size_t instdirlen = strlen(instdir);
+-
+- if (instdirlen > 0 && fc_script_chrootless)
+- changedir = instdir;
+- else
+- changedir = "/";
+-
+- if (instdirlen > 0 && !fc_script_chrootless) {
+- if (strncmp(admindir, instdir, instdirlen) != 0)
+- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
+- if (setenv("DPKG_ADMINDIR", admindir + instdirlen, 1) < 0)
+- ohshite(_("unable to setenv for subprocesses"));
+- if (setenv("DPKG_ROOT", "", 1) < 0)
+- ohshite(_("unable to setenv for subprocesses"));
+-
+- if (chroot(instdir))
+- ohshite(_("failed to chroot to '%.250s'"), instdir);
++ if (*instdir) {
++ setenv("D", instdir, 1);
+ }
+- /* Switch to a known good directory to give the maintainer script
+- * a saner environment, also needed after the chroot(). */
+- if (chdir(changedir))
+- ohshite(_("failed to chdir to '%.255s'"), changedir);
+- if (debug_has_flag(dbg_scripts)) {
+- struct varbuf args = VARBUF_INIT;
+- const char **argv = cmd->argv;
+-
+- while (*++argv) {
+- varbuf_add_char(&args, ' ');
+- varbuf_add_str(&args, *argv);
+- }
+- varbuf_end_str(&args);
+- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
+- args.buf);
+- varbuf_destroy(&args);
+- }
+- if (instdirlen == 0 || fc_script_chrootless)
+- return cmd->filename;
+-
+- assert(strlen(cmd->filename) >= instdirlen);
+- return cmd->filename + instdirlen;
++ return cmd->filename;
+ }
+
+ /**
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
new file mode 100644
index 000000000..56c85c773
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
@@ -0,0 +1,31 @@
+From adb6bfd0feeceaf030df0debe3343d7f73e708a0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:27:45 +0300
+Subject: [PATCH 4/5] The lutimes function doesn't work properly for all
+ systems.
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/archives.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/archives.c b/src/archives.c
+index bff5f14..b711013 100644
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -449,8 +449,9 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
+
+ if (te->type == TAR_FILETYPE_SYMLINK) {
+ #ifdef HAVE_LUTIMES
+- if (lutimes(path, tv) && errno != ENOSYS)
++/* if (lutimes(path, tv) && errno != ENOSYS)
+ ohshite(_("error setting timestamps of '%.255s'"), path);
++*/
+ #endif
+ } else {
+ if (utimes(path, tv))
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
new file mode 100644
index 000000000..96e96f277
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
@@ -0,0 +1,36 @@
+From 0ad7bba80d5b9035089ff2b2f77a774b5b201915 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:28:59 +0300
+Subject: [PATCH 5/5] dpkg-compiler.m4: remove -Wvla
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove the -Wvla flag from the set of compiler warning flags, since gcc
+on old host systems such as CentOS 5.8 doesn't support it, and it
+causes a build error for dpkg-native.
+
+Upstream-Status: Pending
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ m4/dpkg-compiler.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
+index 682857c..23ed7d0 100644
+--- a/m4/dpkg-compiler.m4
++++ b/m4/dpkg-compiler.m4
+@@ -52,7 +52,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [
+ DPKG_CHECK_COMPILER_FLAG([-Wlogical-op])
+ DPKG_CHECK_COMPILER_FLAG([-Wlogical-not-parentheses])
+ DPKG_CHECK_COMPILER_FLAG([-Wswitch-bool])
+- DPKG_CHECK_COMPILER_FLAG([-Wvla])
+ DPKG_CHECK_COMPILER_FLAG([-Winit-self])
+ DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings])
+ DPKG_CHECK_COMPILER_FLAG([-Wcast-align])
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
new file mode 100644
index 000000000..8797ea55c
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0006-add-musleabi-to-known-target-tripets.patch
@@ -0,0 +1,42 @@
+From f8910022dc3ec622272f168cd0022dbdf6dff93a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 23:05:41 +0000
+Subject: [PATCH] add musleabi to known target tripets
+
+helps compiling dpkg for musl/arm-softfloat
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ data/ostable | 1 +
+ data/tupletable | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/data/ostable b/data/ostable
+index 99c1f889d..be6434271 100644
+--- a/data/ostable
++++ b/data/ostable
+@@ -17,6 +17,7 @@
+ eabi-uclibc-linux linux-uclibceabi linux[^-]*-uclibceabi
+ base-uclibc-linux linux-uclibc linux[^-]*-uclibc
+ eabihf-musl-linux linux-musleabihf linux[^-]*-musleabihf
++eabi-musl-linux linux-musleabi linux[^-]*-musleabi
+ base-musl-linux linux-musl linux[^-]*-musl
+ eabihf-gnu-linux linux-gnueabihf linux[^-]*-gnueabihf
+ eabi-gnu-linux linux-gnueabi linux[^-]*-gnueabi
+diff --git a/data/tupletable b/data/tupletable
+index 5f500f6ca..28f00bfe6 100644
+--- a/data/tupletable
++++ b/data/tupletable
+@@ -8,6 +8,7 @@
+ eabi-uclibc-linux-arm uclibc-linux-armel
+ base-uclibc-linux-<cpu> uclibc-linux-<cpu>
+ eabihf-musl-linux-arm musl-linux-armhf
++eabi-musl-linux-arm musl-linux-armel
+ base-musl-linux-<cpu> musl-linux-<cpu>
+ ilp32-gnu-linux-arm64 arm64ilp32
+ eabihf-gnu-linux-arm armhf
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch b/poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch
new file mode 100644
index 000000000..1b985df0f
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch
@@ -0,0 +1,39 @@
+From 8659eeeeda74d71e12080121f0b13a88cbdda433 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Tue, 21 Feb 2017 11:23:27 -0600
+Subject: [PATCH] dpkg-deb/build.c: Remove usage of --clamp-mtime in tar
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recently dpkg added --clamp-mtime to tar to create reproducible
+build tarballs [1].
+
+But host tools doesn't support this option because is new on tar
+so disable in our builds.
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Upstream-Status: Inappropriate [Configuration]
+
+[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759999#20
+[2] https://lists.gnu.org/archive/html/help-tar/2016-01/msg00000.html
+---
+ dpkg-deb/build.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index a92b58e..a3d1912 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -450,7 +450,7 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
+
+ command_init(&cmd, TAR, "tar -cf");
+ command_add_args(&cmd, "tar", "-cf", "-", "--format=gnu",
+- "--mtime", mtime, "--clamp-mtime", NULL);
++ "--mtime", mtime, NULL);
+ /* Mode might become a positional argument, pass it before -T. */
+ if (mode)
+ command_add_args(&cmd, "--mode", mode, NULL);
+--
+2.11.0
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch b/poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
new file mode 100644
index 000000000..d165616a1
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
@@ -0,0 +1,48 @@
+Author: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Date: Wed Apr 8 18:08:14 2015 +0530
+
+[PATCH] add armeb triplet entry into triplettable.
+
+Cross-compling dpkg application for armeb fails with below error
+during configure task,
+
+(snip)
+ configure:23141: checking dpkg cpu type
+ configure:23148: result: armeb
+ configure:23150: WARNING: armeb not found in cputable
+ configure:23162: checking dpkg operating system type
+ configure:23169: result: linux-gnueabi
+ configure:23171: WARNING: linux-gnueabi not found in ostable
+ configure:23183: checking dpkg architecture name
+ configure:23189: error: cannot determine host dpkg architecture
+-- CUT --
+
+the required combination of "gnueabi-linux-armeb" was not found in
+the triplettable file thereby returning dpkg_arch as
+empty in configure script.
+
+Upstream-Status: Pending
+
+Signed-off-by: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+---
+ data/tupletable | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/data/tupletable b/data/tupletable
+index b7802bec3..5f500f6ca 100644
+--- a/data/tupletable
++++ b/data/tupletable
+@@ -12,6 +12,7 @@ base-musl-linux-<cpu> musl-linux-<cpu>
+ ilp32-gnu-linux-arm64 arm64ilp32
+ eabihf-gnu-linux-arm armhf
+ eabi-gnu-linux-arm armel
++eabi-gnu-linux-armeb armeb
+ abin32-gnu-linux-mips64r6el mipsn32r6el
+ abin32-gnu-linux-mips64r6 mipsn32r6
+ abin32-gnu-linux-mips64el mipsn32el
+--
+2.11.0
+
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 000000000..4e0d22acb
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,29 @@
+configure cannot determine the proper cpu, os, or
+architecture for mips64, and possibly other arch's
+because of faulty code added to Arch.pm in the latest
+release from upstream. We remove that code.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+---
+ scripts/Dpkg/Arch.pm | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
+index 1720847b8..6345ce3b9 100644
+--- a/scripts/Dpkg/Arch.pm
++++ b/scripts/Dpkg/Arch.pm
+@@ -323,9 +323,6 @@ sub _load_tupletable()
+ (my $dt = $debtuple) =~ s/<cpu>/$_cpu/;
+ (my $da = $debarch) =~ s/<cpu>/$_cpu/;
+
+- next if exists $debarch_to_debtuple{$da}
+- or exists $debtuple_to_debarch{$dt};
+-
+ $debarch_to_debtuple{$da} = $dt;
+ $debtuple_to_debarch{$dt} = $da;
+ }
+--
+2.11.0
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service b/poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
new file mode 100644
index 000000000..9a248ccb4
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=dpkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/dpkg --configure -a > $LOGFILE 2>&1; else @BINDIR@/dpkg --configure -a; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable dpkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch b/poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
new file mode 100644
index 000000000..d48386647
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
@@ -0,0 +1,97 @@
+From 9d260d408f9e17abd1d1dccd685bd7e80a3655a9 Mon Sep 17 00:00:00 2001
+From: Donn Seeley <donn.seeley@windriver.com>
+Date: Tue, 25 Feb 2014 17:44:04 +0800
+Subject: [PATCH] dpkg: fix a link problem for dpkg-native on CentOS 5.8
+
+CentOS 5.8 kernels and headers support the sync_file_range() system call,
+but glibc 2.5 doesn't provide the syscall stub. It appears that this
+problem is known but will never be fixed:
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=518581
+
+ Bug 518581 - [RHEL5] glibc misses sync_file_range syscall interface
+
+ Status: CLOSED CANTFIX
+ Last Closed: 2009-11-22 22:19:55
+
+ Kirby Zhou 2009-08-20 23:37:55 EDT
+
+ Description of problem:
+
+ glibc misses sync_file_range syscall interface. The header file and
+ man page both say 'sync_file_range' should exist. From man page,
+ sync_file_range should exist sinc kernel-2.6.17
+
+ Andreas Schwab 2009-08-21 03:24:24 EDT
+
+ It has only been added to glibc 2.6, and cannot be backported due to
+ ABI breakage. You can always fall back to syscall(3).
+
+ Ulrich Drepper 2009-11-22 22:19:55 EST
+
+ As comment #1 says, no chance to backport this.
+
+ See the syscall man page for instructions.
+
+ Jon E 2010-03-19 10:32:37 EDT
+
+ then why document it if it's broken and you're not going to fix it?
+ .. might want to FTFM over at sync_file_range(2) - in the meantime -
+ borrowing from glibc 2.6 .. any thoughts on this implementation for a
+ hacky workaround for those still on your "ancient releases" .. (eg:
+ RHEL5.3)?:
+
+ #ifdef ULI_WONT_FIX_THIS_IN_GLIBC2.5
+ #define NR_sync_file_range 277
+ int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+ {
+ return syscall (NR_sync_file_range, fd,
+ __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+ __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+ flags);
+ }
+ #endif
+
+ assuming of course that you're on an x86_64 and include/asm-
+ x86_64/unistd.h has the correct entry
+
+ (fwiw - fio is starting to use this now)
+
+Rather than attempting to provide an implementation using syscall(),
+we take the more conservative route and ignore header support for
+sync_file_range() flags when the glibc version is <= 2.5.
+
+Upstream-Status: Inappropriate [everyone else builds on newer hosts :-)]
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Lei Liu <lei.liu2@windriver.com>
+
+---
+ src/archives.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/archives.c b/src/archives.c
+index 4b2fc92..a92b795 100644
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -69,7 +69,7 @@ fd_writeback_init(int fd)
+ /* Ignore the return code as it should be considered equivalent to an
+ * asynchronous hint for the kernel, we are doing an fsync() later on
+ * anyway. */
+-#if defined(SYNC_FILE_RANGE_WRITE)
++#if defined(SYNC_FILE_RANGE_WRITE) && __GLIBC_PREREQ(2, 6)
+ sync_file_range(fd, 0, 0, SYNC_FILE_RANGE_WRITE);
+ #elif defined(HAVE_POSIX_FADVISE)
+ posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+@@ -1078,7 +1078,7 @@ tarobject(void *ctx, struct tar_entry *ti)
+ return 0;
+ }
+
+-#if defined(SYNC_FILE_RANGE_WAIT_BEFORE)
++#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) && __GLIBC_PREREQ(2, 6)
+ static void
+ tar_writeback_barrier(struct fileinlist *files, struct pkginfo *pkg)
+ {
+--
+2.16.2
+
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/noman.patch b/poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 000000000..a7f3cb8f4
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [disable feature]
+
+---
+ Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 0da52cb16..a1f79e0a2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -13,8 +13,7 @@ SUBDIRS = \
+ $(MAYBE_DSELECT) \
+ scripts \
+ t-func \
+- po \
+- man
++ po
+
+ ACLOCAL_AMFLAGS = -I m4
+
+--
+2.11.0
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 000000000..4f408ff77
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
@@ -0,0 +1,17 @@
+busybox-1.19.4 tar utility doesn't support --warning=no-timestamp
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+Index: dpkg-1.17.1/dpkg-deb/extract.c
+===================================================================
+--- dpkg-1.17.1.orig/dpkg-deb/extract.c
++++ dpkg-1.17.1/dpkg-deb/extract.c
+@@ -318,7 +318,6 @@ extracthalf(const char *debar, const cha
+
+ command_add_arg(&cmd, "-f");
+ command_add_arg(&cmd, "-");
+- command_add_arg(&cmd, "--warning=no-timestamp");
+
+ m_dup2(p2[0],0);
+ close(p2[0]);
diff --git a/poky/meta/recipes-devtools/dpkg/dpkg_1.18.24.bb b/poky/meta/recipes-devtools/dpkg/dpkg_1.18.24.bb
new file mode 100644
index 000000000..6d8ec3476
--- /dev/null
+++ b/poky/meta/recipes-devtools/dpkg/dpkg_1.18.24.bb
@@ -0,0 +1,22 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20170518T093838Z/pool/main/d/dpkg/dpkg_1.18.24.tar.xz \
+ file://noman.patch \
+ file://remove-tar-no-timestamp.patch \
+ file://arch_pm.patch \
+ file://dpkg-configure.service \
+ file://add_armeb_triplet_entry.patch \
+ file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
+ file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+ file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
+ file://0005-dpkg-compiler.m4-remove-Wvla.patch \
+ file://0006-add-musleabi-to-known-target-tripets.patch \
+ file://0007-dpkg-deb-build.c-Remove-usage-of-clamp-mtime-in-tar.patch \
+ file://0001-dpkg-Support-muslx32-build.patch \
+ file://0001-arch-Add-support-for-riscv64-CPU.patch \
+ "
+SRC_URI_append_class-native = " file://glibc2.5-sync_file_range.patch "
+
+SRC_URI[md5sum] = "02e8af8faf1e689228da806c3e8c6882"
+SRC_URI[sha256sum] = "d853081d3e06bfd46a227056e591f094e42e78fa8a5793b0093bad30b710d7b4"
diff --git a/poky/meta/recipes-devtools/dwarfsrcfiles/dwarfsrcfiles.bb b/poky/meta/recipes-devtools/dwarfsrcfiles/dwarfsrcfiles.bb
new file mode 100644
index 000000000..c59a006ed
--- /dev/null
+++ b/poky/meta/recipes-devtools/dwarfsrcfiles/dwarfsrcfiles.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A small utility for printing debig source file locations embedded in binaries"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://../dwarfsrcfiles.c;md5=31483894e453a77acbb67847565f1b5c;beginline=1;endline=8"
+
+SRC_URI = "file://dwarfsrcfiles.c"
+BBCLASSEXTEND = "native"
+DEPENDS = "elfutils"
+DEPENDS_append_libc-musl = " argp-standalone"
+
+do_compile () {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o dwarfsrcfiles ../dwarfsrcfiles.c -lelf -ldw
+}
+
+do_compile_libc-musl () {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o dwarfsrcfiles ../dwarfsrcfiles.c -lelf -ldw -largp
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -t ${D}${bindir} dwarfsrcfiles
+}
+
diff --git a/poky/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c b/poky/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c
new file mode 100644
index 000000000..af7af524e
--- /dev/null
+++ b/poky/meta/recipes-devtools/dwarfsrcfiles/files/dwarfsrcfiles.c
@@ -0,0 +1,111 @@
+// dwarfsrcfiles.c - Get source files associated with the dwarf in a elf file.
+// gcc -Wall -g -O2 -lelf -ldw -o dwarfsrcfiles dwarfsrcfiles.c
+//
+// Copyright (C) 2011, Mark Wielaard <mjw@redhat.com>
+//
+// This file is free software. You can redistribute it and/or modify
+// it under the terms of the GNU General Public License (GPL); either
+// version 2, or (at your option) any later version.
+
+#include <argp.h>
+#include <stdio.h>
+
+#include <dwarf.h>
+#include <elfutils/libdw.h>
+#include <elfutils/libdwfl.h>
+
+static int
+process_cu (Dwarf_Die *cu_die)
+{
+ Dwarf_Attribute attr;
+ const char *name;
+ const char *dir = NULL;
+
+ Dwarf_Files *files;
+ size_t n;
+ int i;
+
+ if (dwarf_tag (cu_die) != DW_TAG_compile_unit)
+ {
+ fprintf (stderr, "DIE isn't a compile unit");
+ return -1;
+ }
+
+ if (dwarf_attr (cu_die, DW_AT_name, &attr) == NULL)
+ {
+ fprintf(stderr, "CU doesn't have a DW_AT_name");
+ return -1;
+ }
+
+ name = dwarf_formstring (&attr);
+ if (name == NULL)
+ {
+ fprintf(stderr, "Couldn't get DW_AT_name as string, %s",
+ dwarf_errmsg (-1));
+ return -1;
+ }
+
+ if (dwarf_attr (cu_die, DW_AT_comp_dir, &attr) != NULL)
+ {
+ dir = dwarf_formstring (&attr);
+ if (dir == NULL)
+ {
+ fprintf(stderr, "Couldn't get DW_AT_comp_die as string, %s",
+ dwarf_errmsg (-1));
+ return -1;
+ }
+ }
+
+ if (dir == NULL)
+ printf ("%s\n", name);
+ else
+ printf ("%s/%s\n", dir, name);
+
+ if (dwarf_getsrcfiles (cu_die, &files, &n) != 0)
+ {
+ fprintf(stderr, "Couldn't get CU file table, %s",
+ dwarf_errmsg (-1));
+ return -1;
+ }
+
+ for (i = 1; i < n; i++)
+ {
+ const char *file = dwarf_filesrc (files, i, NULL, NULL);
+ if (dir != NULL && file[0] != '/')
+ printf ("\t%s/%s\n", dir, file);
+ else
+ printf ("\t%s\n", file);
+ }
+
+ return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ char* args[3];
+ int res = 0;
+ Dwfl *dwfl;
+ Dwarf_Addr bias;
+
+ if (argc != 2)
+ fprintf(stderr, "Usage %s <file>", argv[0]);
+
+ // Pretend "dwarfsrcfiles -e <file>" was given, so we can use standard
+ // dwfl argp parser to open the file for us and get our Dwfl. Useful
+ // in case argument is an ET_REL file (like kernel modules). libdwfl
+ // will fix up relocations for us.
+ args[0] = argv[0];
+ args[1] = "-e";
+ args[2] = argv[1];
+
+ argp_parse (dwfl_standard_argp (), 3, args, 0, NULL, &dwfl);
+
+ Dwarf_Die *cu = NULL;
+ while ((cu = dwfl_nextcu (dwfl, cu, &bias)) != NULL)
+ res |= process_cu (cu);
+
+ dwfl_end (dwfl);
+
+ return res;
+}
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
new file mode 100644
index 000000000..81d90a134
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
@@ -0,0 +1,27 @@
+SUMMARY = "Ext2 Filesystem Utilities"
+DESCRIPTION = "The Ext2 Filesystem Utilities (e2fsprogs) contain all of the standard utilities for creating, \
+fixing, configuring , and debugging ext2 filesystems."
+HOMEPAGE = "http://e2fsprogs.sourceforge.net/"
+
+LICENSE = "GPLv2 & LGPLv2 & BSD & MIT"
+LICENSE_e2fsprogs-e2fsck = "GPLv2"
+LICENSE_e2fsprogs-mke2fs = "GPLv2"
+LICENSE_e2fsprogs-fsck = "GPLv2"
+LICENSE_e2fsprogs-tune2fs = "GPLv2"
+LICENSE_e2fsprogs-badblocks = "GPLv2"
+LIC_FILES_CHKSUM = "file://NOTICE;md5=b48f21d765b875bd10400975d12c1ca2 \
+ file://lib/ext2fs/ext2fs.h;beginline=1;endline=9;md5=596a8dedcb4e731c6b21c7a46fba6bef \
+ file://lib/e2p/e2p.h;beginline=1;endline=7;md5=8a74ade8f9d65095d70ef2d4bf48e36a \
+ file://lib/uuid/uuid.h.in;beginline=1;endline=32;md5=dbb8079e114a5f841934b99e59c8820a \
+ file://lib/uuid/COPYING;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+ file://lib/et/et_name.c;beginline=1;endline=11;md5=ead236447dac7b980dbc5b4804d8c836 \
+ file://lib/ss/ss.h;beginline=1;endline=20;md5=6e89ad47da6e75fecd2b5e0e81e1d4a6"
+SECTION = "base"
+DEPENDS = "util-linux attr"
+
+SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git"
+S = "${WORKDIR}/git"
+
+inherit autotools gettext texinfo pkgconfig multilib_header update-alternatives ptest
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-build-failure-in-swapfs.c-on-big-endia.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-build-failure-in-swapfs.c-on-big-endia.patch
new file mode 100644
index 000000000..ff1284edc
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-build-failure-in-swapfs.c-on-big-endia.patch
@@ -0,0 +1,40 @@
+From ae6603206176b771c9ed1f82569f68fc1257f014 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Wed, 3 Jan 2018 01:32:02 -0500
+Subject: [PATCH] libext2fs: fix build failure in swapfs.c on big-endian
+ systems
+
+Addresses-Debian-Bug: #886119
+
+Reported-by: James Clarke <jrtc27@debian.org>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+Upstream-Status: Backport
+
+ lib/ext2fs/swapfs.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
+index 6e5cff97..b13dc422 100644
+--- a/lib/ext2fs/swapfs.c
++++ b/lib/ext2fs/swapfs.c
+@@ -19,6 +19,7 @@
+
+ #include "ext2_fs.h"
+ #include "ext2fs.h"
++#include "ext2fsP.h"
+ #include <ext2fs/ext2_ext_attr.h>
+
+ #ifdef WORDS_BIGENDIAN
+@@ -358,7 +359,7 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t,
+ if (inode_includes(inode_size, i_projid))
+ t->i_projid = ext2fs_swab16(f->i_projid);
+ /* catch new static fields added after i_projid */
+- EXT2FS_BUILD_BUG_ON(sizeof(ext2_inode_large) != 160);
++ EXT2FS_BUILD_BUG_ON(sizeof(struct ext2_inode_large) != 160);
+
+ i = sizeof(struct ext2_inode) + extra_isize + sizeof(__u32);
+ if (bufsize < (int) i)
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch
new file mode 100644
index 000000000..fc4a54098
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch
@@ -0,0 +1,41 @@
+From f6d188580c2c9599319076fee22f2424652c711c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 13 Sep 2017 19:55:35 -0700
+Subject: [PATCH] misc/create_inode.c: set dir's mode correctly
+
+The dir's mode has been set by ext2fs_mkdir() with umask, so
+reset it to the source's mode in set_inode_extra().
+
+Fixed when source dir's mode is 521, but tarball would be 721, this was
+incorrect.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ misc/create_inode.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 8ce3faf..50fbaa8 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -116,7 +116,14 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
+
+ inode.i_uid = st->st_uid;
+ inode.i_gid = st->st_gid;
+- inode.i_mode |= st->st_mode;
++ /*
++ * The dir's mode has been set by ext2fs_mkdir() with umask, so
++ * reset it to the source's mode
++ */
++ if S_ISDIR(st->st_mode)
++ inode.i_mode = LINUX_S_IFDIR | st->st_mode;
++ else
++ inode.i_mode |= st->st_mode;
+ inode.i_atime = st->st_atime;
+ inode.i_mtime = st->st_mtime;
+ inode.i_ctime = st->st_ctime;
+--
+2.10.2
+
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
new file mode 100644
index 000000000..38e1bdb3d
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch
@@ -0,0 +1,36 @@
+From 0a392baf1874964651115d9f77b0daa6851d1daa Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Tue, 1 Mar 2016 14:28:01 +1100
+Subject: [PATCH] Revert "mke2fs: enable the metadata_csum and 64bit features
+ by default"
+
+This reverts commit cd27af3ecb83e8fd1e3eaa14994284a1818c7c15 as we
+don't want to enable features by default that are not supported by
+the latest stable e2fsprogs release.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+Rebase to 1.43:
+The upstream has disabled metadata_csum by default
+this rebase just revert 64bit feature.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ misc/mke2fs.conf.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: git/misc/mke2fs.conf.in
+===================================================================
+--- git.orig/misc/mke2fs.conf.in
++++ git/misc/mke2fs.conf.in
+@@ -11,8 +11,9 @@
+ features = has_journal
+ }
+ ext4 = {
+- features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
++ features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
+ inode_size = 256
++ auto_64-bit_support = 1
+ }
+ small = {
+ blocksize = 1024
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch
new file mode 100644
index 000000000..69c09bc1d
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch
@@ -0,0 +1,36 @@
+From c7914309aeee6209ddb6995c084805a911d9cc82 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 10 Aug 2016 11:19:44 +0800
+Subject: [PATCH] Fix missing check for permission denied.
+
+If the path to "ROOT_SYSCONFDIR/mke2fs.conf" has a permission denied problem,
+then the get_dirlist() call will return EACCES. But the code in profile_init
+will treat that as a fatal error and all executions will fail with:
+ Couldn't init profile successfully (error: 13).
+
+Upstream-Status: Pending
+
+Written-by: Henrik Wallin <henrik.b.wallin@ericsson.com>
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ lib/support/profile.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/support/profile.c b/lib/support/profile.c
+index 9e96673b..32d83002 100644
+--- a/lib/support/profile.c
++++ b/lib/support/profile.c
+@@ -335,7 +335,7 @@ profile_init(const char * const *files, profile_t *ret_profile)
+ *last = new_file;
+ last = &new_file->next;
+ }
+- } else if ((retval != ENOTDIR) &&
++ } else if ((retval != ENOTDIR) && (retval != EACCES) &&
+ strcmp(*fs, default_filename))
+ goto errout;
+
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch
new file mode 100644
index 000000000..b0fa4b8cc
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch
@@ -0,0 +1,20 @@
+e2fsprogs: expand @mkdir_p@
+
+Add AC_SUBST to configure.ac. @mkdir_p@ is currently
+not expanded so no locale data is written into usr/share/locale.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -811,6 +811,8 @@ AC_SUBST(PACKAGE)
+ AC_SUBST(VERSION)
+
+ AM_GNU_GETTEXT
++dnl @MKDIR_P@ is expanded in AM_GNU_GETTEXT
++AC_SUBST([mkdir_p],['$(MKDIR_P)'])
+ dnl
+ dnl End of configuration options
+ dnl
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
new file mode 100644
index 000000000..7c4bb39fd
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
@@ -0,0 +1,82 @@
+Upstream-Status: Inappropriate
+
+Index: git/tests/Makefile.in
+===================================================================
+--- git.orig/tests/Makefile.in
++++ git/tests/Makefile.in
+@@ -18,7 +18,7 @@ test_one: $(srcdir)/test_one.in Makefile
+ @echo "#!/bin/sh" > test_one
+ @echo "HTREE=y" >> test_one
+ @echo "QUOTA=y" >> test_one
+- @echo "SRCDIR=@srcdir@" >> test_one
++ @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one
+ @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
+ @echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one
+ @echo "DD=@DD@" >>test_one
+@@ -28,7 +28,7 @@ test_one: $(srcdir)/test_one.in Makefile
+ test_script: test_one test_script.in Makefile mke2fs.conf
+ @echo "Creating test_script..."
+ @echo "#!/bin/sh" > test_script
+- @echo "SRCDIR=@srcdir@" >> test_script
++ @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script
+ @cat $(srcdir)/test_script.in >> test_script
+ @chmod +x test_script
+
+Index: git/tests/test_config
+===================================================================
+--- git.orig/tests/test_config
++++ git/tests/test_config
+@@ -3,24 +3,24 @@
+ #
+
+ unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME PAGER
+-FSCK="$USE_VALGRIND ../e2fsck/e2fsck"
+-MKE2FS="$USE_VALGRIND ../misc/mke2fs"
+-DUMPE2FS="$USE_VALGRIND ../misc/dumpe2fs"
+-TUNE2FS="$USE_VALGRIND ../misc/tune2fs"
+-CHATTR="$USE_VALGRIND../misc/chattr"
+-LSATTR="$USE_VALGRIND ../misc/lsattr"
+-E2IMAGE="$USE_VALGRIND ../misc/e2image"
+-E2IMAGE_EXE="../misc/e2image"
+-DEBUGFS="$USE_VALGRIND ../debugfs/debugfs"
+-DEBUGFS_EXE="../debugfs/debugfs"
+-TEST_BITS="../debugfs/debugfs"
+-RESIZE2FS_EXE="../resize/resize2fs"
++FSCK="$USE_VALGRIND e2fsck"
++MKE2FS="$USE_VALGRIND mke2fs"
++DUMPE2FS="$USE_VALGRIND dumpe2fs"
++TUNE2FS="$USE_VALGRIND tune2fs"
++CHATTR="$USE_VALGRIND chattr"
++LSATTR="$USE_VALGRIND lsattr"
++E2IMAGE="$USE_VALGRIND e2image"
++E2IMAGE_EXE="/sbin/e2image"
++DEBUGFS="$USE_VALGRIND debugfs"
++DEBUGFS_EXE="/sbin/debugfs"
++TEST_BITS="/sbin/debugfs"
++RESIZE2FS_EXE="/sbin/resize2fs"
+ RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE"
+-E2UNDO_EXE="../misc/e2undo"
++E2UNDO_EXE="/sbin/e2undo"
+ E2UNDO="$USE_VALGRIND $E2UNDO_EXE"
+-TEST_REL=../tests/progs/test_rel
+-TEST_ICOUNT=../tests/progs/test_icount
+-CRCSUM=../tests/progs/crcsum
++TEST_REL=./progs/test_rel
++TEST_ICOUNT=./progs/test_icount
++CRCSUM=./progs/crcsum
+ CLEAN_OUTPUT="sed -f $cmd_dir/filter.sed"
+ LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${LD_LIBRARY_PATH}
+ DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${DYLD_LIBRARY_PATH}
+Index: git/tests/test_script.in
+===================================================================
+--- git.orig/tests/test_script.in
++++ git/tests/test_script.in
+@@ -39,7 +39,7 @@ for i; do
+ done
+
+ if test "$TESTS"x = x ; then
+- if test -n "DO_FAILED"; then
++ if test -n "$DO_FAILED"; then
+ exit 0
+ fi
+ TESTS=`ls -d $SRCDIR/[a-zA-Z]_*`
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
new file mode 100644
index 000000000..830e9d57a
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
@@ -0,0 +1,19 @@
+When executing a script don't echo every command, as we do this for entire
+filesystems at rootfs time.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index 5590295..ac57292 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -2378,7 +2378,7 @@ static int source_file(const char *cmd_file, int ss_idx)
+ cp = strchr(buf, '\r');
+ if (cp)
+ *cp = 0;
+- printf("debugfs: %s\n", buf);
++ /*printf("debugfs: %s\n", buf);*/
+ retval = ss_execute_line(ss_idx, buf);
+ if (retval) {
+ ss_perror(ss_idx, retval, buf);
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
new file mode 100644
index 000000000..f3e6eb778
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
@@ -0,0 +1,44 @@
+From b139e03ac2f72e644e547c7ee9b1514383af4d97 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Wed, 30 Jan 2013 15:22:04 +0200
+Subject: [PATCH] When /etc/ld.so.cache is writeable by user running bitbake
+ then it creates invalid cache (in my case libstdc++.so
+ cannot be found after building zlib(-native) and I have to
+ call touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Patch authored by Martin Jansa.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ lib/Makefile.elf-lib | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib
+index 78479d3..4a4a5ac 100644
+--- a/lib/Makefile.elf-lib
++++ b/lib/Makefile.elf-lib
+@@ -50,8 +50,6 @@ install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK)
+ $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).so"
+ $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ $(libdir)/$(ELF_IMAGE).so $(DESTDIR)
+- $(E) " LDCONFIG"
+- $(Q) -$(LDCONFIG)
+
+ install-strip: install
+ $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
+@@ -67,7 +65,6 @@ uninstall-shlibs uninstall::
+ $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
+ $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ $(DESTDIR)$(libdir)/$(ELF_IMAGE).so
+- -$(LDCONFIG)
+
+ clean::
+ $(RM) -rf elfshared
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
new file mode 100644
index 000000000..ef10b08bc
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cd ./test
+./test_script | sed -u -e '/:[[:space:]]ok/s/^/PASS: /' -e '/:[[:space:]]failed/s/^/FAIL: /' -e '/:[[:space:]]skipped/s/^/SKIP: /'
+rm -rf /var/volatile/tmp/*e2fsprogs*
+rm -f tmp-*
+rm -f *.tmp
+rm -f *.ok
+rm -f *.failed
+rm -f *.log
diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.8.bb b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.8.bb
new file mode 100644
index 000000000..56abb3b5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.8.bb
@@ -0,0 +1,120 @@
+require e2fsprogs.inc
+
+SRC_URI += "file://remove.ldconfig.call.patch \
+ file://run-ptest \
+ file://ptest.patch \
+ file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
+ file://mkdir_p.patch \
+ file://0001-misc-create_inode.c-set-dir-s-mode-correctly.patch \
+ file://0001-libext2fs-fix-build-failure-in-swapfs.c-on-big-endia.patch \
+ "
+
+SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \
+ file://quiet-debugfs.patch \
+"
+
+SRCREV = "af2eac481cf426c05ae12b946396980e16c8ab19"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$"
+
+EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \
+ --enable-elf-shlibs --disable-libuuid --disable-uuidd \
+ --disable-libblkid --enable-verbose-makecmds"
+
+EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse'
+
+# make locale rules sometimes fire, sometimes don't as git doesn't preserve
+# file mktime. Touch the files introducing non-determinism to the build
+do_compile_prepend (){
+ find ${S}/po -type f -name "*.po" -exec touch {} +
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+ oe_runmake 'DESTDIR=${D}' install-libs
+ # We use blkid from util-linux now so remove from here
+ rm -f ${D}${base_libdir}/libblkid*
+ rm -rf ${D}${includedir}/blkid
+ rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
+ rm -f ${D}${base_sbindir}/blkid
+ rm -f ${D}${base_sbindir}/fsck
+ rm -f ${D}${base_sbindir}/findfs
+
+ # e2initrd_helper and the pkgconfig files belong in libdir
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ install -d ${D}${libdir}
+ mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
+ mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+ fi
+
+ oe_multilib_header ext2fs/ext2_types.h
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
+
+ install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
+
+ # Clean host path (build directory) in compile_et, mk_cmds
+ sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et
+ sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds
+}
+
+# Need to find the right mke2fs.conf file
+e2fsprogs_conf_fixup () {
+ for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do
+ create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf
+ done
+}
+
+do_install_append_class-native() {
+ e2fsprogs_conf_fixup
+}
+
+do_install_append_class-nativesdk() {
+ e2fsprogs_conf_fixup
+}
+
+RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
+RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
+
+PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
+PACKAGES =+ "libcomerr libss libe2p libext2fs"
+
+FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
+FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
+FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
+FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
+FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
+FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
+FILES_libss = "${base_libdir}/libss.so.*"
+FILES_libe2p = "${base_libdir}/libe2p.so.*"
+FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
+FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds"
+
+ALTERNATIVE_${PN} = "chattr"
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
+ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
+
+ALTERNATIVE_${PN}-doc = "fsck.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+
+RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps bash"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests
+}
+
+do_install_ptest() {
+ cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test
+ cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test
+ sed -e 's!../e2fsck/e2fsck!e2fsck!g' \
+ -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect*
+ sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script
+
+ # Remove various files
+ find "${D}${PTEST_PATH}" -type f \
+ \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\
+ -exec rm -f {} +
+}
diff --git a/poky/meta/recipes-devtools/elfutils/elfutils_0.170.bb b/poky/meta/recipes-devtools/elfutils/elfutils_0.170.bb
new file mode 100644
index 000000000..14ac22ee6
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/elfutils_0.170.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://sourceware.org/elfutils"
+SECTION = "base"
+LICENSE = "(GPLv3 & Elfutils-Exception)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "libtool bzip2 zlib virtual/libintl"
+DEPENDS_append_libc-musl = " argp-standalone fts "
+# The Debian patches below are from:
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.168-0.2.debian.tar.xz
+SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
+ file://0001-dso-link-change.patch \
+ file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
+ file://0003-fixheadercheck.patch \
+ file://0004-Disable-the-test-to-convert-euc-jp.patch \
+ file://0005-fix-a-stack-usage-warning.patch \
+ file://0006-Fix-build-on-aarch64-musl.patch \
+ file://0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch \
+ file://0001-libasm-may-link-with-libbz2-if-found.patch \
+ file://debian/hppa_backend.diff \
+ file://debian/arm_backend.diff \
+ file://debian/mips_backend.patch \
+ file://debian/mips_readelf_w.patch \
+ file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \
+ file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
+ file://debian/0003-Add-mips-n64-relocation-format-hack.patch \
+ file://0001-Use-fallthrough-attribute.patch \
+ file://0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch \
+ "
+SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch"
+SRC_URI[md5sum] = "03599aee98c9b726c7a732a2dd0245d5"
+SRC_URI[sha256sum] = "1f844775576b79bdc9f9c717a50058d08620323c1e935458223a12f249c9e066"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+
+do_install_append() {
+ if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
+ rm -f ${D}${bindir}/eu-objdump
+ fi
+}
+
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+ALLOW_EMPTY_${PN}_libc-musl = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Package utilities separately
+PACKAGES =+ "${PN}-binutils libelf libasm libdw"
+FILES_${PN}-binutils = "\
+ ${bindir}/eu-addr2line \
+ ${bindir}/eu-ld \
+ ${bindir}/eu-nm \
+ ${bindir}/eu-readelf \
+ ${bindir}/eu-size \
+ ${bindir}/eu-strip"
+
+FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
+FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
+FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
+#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
+
+# The package contains symlinks that trip up insane
+INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/poky/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch b/poky/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch
new file mode 100644
index 000000000..cf4d1dfe7
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0001-Ensure-that-packed-structs-follow-the-gcc-memory-lay.patch
@@ -0,0 +1,34 @@
+From 732913a8c35c7b25c0cbf6903cab1ad6b602b525 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 22 Mar 2018 22:44:03 -0700
+Subject: [PATCH] Ensure that packed structs follow the gcc memory layout
+
+Partial backport of
+https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d
+
+Helps fixing alignment errors e.g.
+linux-core-note.c:116:1: error: alignment 2 of 'struct m68k_prstatus
+' is less than 4 [-Werror=packed-not-aligned]
+ ;
+ ^
+
+Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ backends/linux-core-note.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
+index 5f06c896..9faae4c3 100644
+--- a/backends/linux-core-note.c
++++ b/backends/linux-core-note.c
+@@ -111,7 +111,7 @@ struct EBLHOOK(prstatus)
+ FIELD (INT, pr_fpvalid);
+ }
+ #ifdef ALIGN_PRSTATUS
+- __attribute__ ((packed, aligned (ALIGN_PRSTATUS)))
++ attribute_packed __attribute__ ((aligned (ALIGN_PRSTATUS)))
+ #endif
+ ;
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0001-Use-fallthrough-attribute.patch b/poky/meta/recipes-devtools/elfutils/files/0001-Use-fallthrough-attribute.patch
new file mode 100644
index 000000000..5e2155b3c
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0001-Use-fallthrough-attribute.patch
@@ -0,0 +1,791 @@
+From 5cb883f67d00a63531ef195c242763d36b1905ca Mon Sep 17 00:00:00 2001
+From: Joshua Watt <Joshua.Watt@garmin.com>
+Date: Fri, 9 Feb 2018 12:46:38 -0600
+Subject: [PATCH] Use fallthrough attribute
+
+Use __attribute__ ((fallthrough)) to indicate switch case fall through
+instead of a comment. This ensure that the fallthrough warning is not
+triggered even if the file is pre-processed (hence stripping the
+comments) before it is compiled.
+
+The actual fallback implementation is hidden behind a FALLBACK macro in
+case the compiler doesn't support it.
+
+Finally, the -Wimplict-fallthrough warning was upgraded to only allow
+the attribute to satisfy it; a comment alone is no longer sufficient.
+
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+
+Upstream-Status: Submitted [1]
+
+[1] https://sourceware.org/ml/elfutils-devel/2018-q1/msg00027.html
+---
+ backends/aarch64_retval.c | 2 +-
+ backends/alpha_retval.c | 4 ++--
+ backends/arm_regs.c | 2 +-
+ backends/arm_retval.c | 2 +-
+ backends/i386_regs.c | 2 +-
+ backends/i386_retval.c | 4 ++--
+ backends/ia64_retval.c | 2 +-
+ backends/linux-core-note.c | 2 +-
+ backends/m68k_retval.c | 4 ++--
+ backends/mips_retval.c | 4 ++--
+ backends/parisc_retval.c | 5 +++--
+ backends/ppc64_retval.c | 6 +++---
+ backends/ppc_regs.c | 2 +-
+ backends/ppc_retval.c | 4 ++--
+ backends/s390_retval.c | 4 ++--
+ backends/sh_retval.c | 2 +-
+ backends/sparc_retval.c | 2 +-
+ backends/tilegx_retval.c | 4 ++--
+ backends/x86_64_regs.c | 2 +-
+ backends/x86_64_retval.c | 2 +-
+ config/eu.am | 4 +++-
+ configure.ac | 6 ++++++
+ lib/eu-config.h | 7 +++++++
+ libcpu/i386_disasm.c | 2 +-
+ libcpu/i386_parse.c | 4 ++--
+ libdw/cfi.c | 4 ++--
+ libdw/dwarf_frame_register.c | 2 +-
+ libdwfl/dwfl_report_elf.c | 2 +-
+ libdwfl/frame_unwind.c | 2 +-
+ libebl/eblobjnote.c | 2 +-
+ libelf/elf32_updatenull.c | 2 +-
+ libelf/elf_begin.c | 4 ++--
+ libelf/elf_cntl.c | 2 +-
+ src/addr2line.c | 2 +-
+ src/elfcompress.c | 2 +-
+ src/elflint.c | 8 ++++----
+ src/objdump.c | 2 +-
+ src/readelf.c | 8 ++++----
+ src/strings.c | 2 +-
+ tests/backtrace.c | 2 +-
+ tests/elfstrmerge.c | 3 ++-
+ 41 files changed, 75 insertions(+), 58 deletions(-)
+
+diff --git a/backends/aarch64_retval.c b/backends/aarch64_retval.c
+index 68de307..1308340 100644
+--- a/backends/aarch64_retval.c
++++ b/backends/aarch64_retval.c
+@@ -292,7 +292,7 @@ aarch64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ assert (count > 0);
+ if (count <= 4)
+ return pass_hfa (locp, base_size, count);
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case 1:
+ /* Not a HFA. */
+diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c
+index 53dbfa4..d9bae3b 100644
+--- a/backends/alpha_retval.c
++++ b/backends/alpha_retval.c
+@@ -85,7 +85,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -131,7 +131,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ }
+ }
+
+- /* Else fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+diff --git a/backends/arm_regs.c b/backends/arm_regs.c
+index 4ee1039..418c931 100644
+--- a/backends/arm_regs.c
++++ b/backends/arm_regs.c
+@@ -81,7 +81,7 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
+ * but gcc maps FPA registers here
+ */
+ regno += 96 - 16;
+- /* Fall through. */
++ FALLTHROUGH;
+ case 96 + 0 ... 96 + 7:
+ *setname = "FPA";
+ *type = DW_ATE_float;
+diff --git a/backends/arm_retval.c b/backends/arm_retval.c
+index 8687eab..313e4eb 100644
+--- a/backends/arm_retval.c
++++ b/backends/arm_retval.c
+@@ -90,7 +90,7 @@ arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+diff --git a/backends/i386_regs.c b/backends/i386_regs.c
+index fd963a6..7ec93bb 100644
+--- a/backends/i386_regs.c
++++ b/backends/i386_regs.c
+@@ -92,7 +92,7 @@ i386_register_info (Ebl *ebl __attribute__ ((unused)),
+ case 5:
+ case 8:
+ *type = DW_ATE_address;
+- /* Fallthrough */
++ FALLTHROUGH;
+ case 0 ... 3:
+ case 6 ... 7:
+ name[0] = 'e';
+diff --git a/backends/i386_retval.c b/backends/i386_retval.c
+index 4aa646f..32fec72 100644
+--- a/backends/i386_retval.c
++++ b/backends/i386_retval.c
+@@ -85,7 +85,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -123,7 +123,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ if (size <= 8)
+ return nloc_intregpair;
+ }
+- /* Fallthrough */
++ FALLTHROUGH;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+diff --git a/backends/ia64_retval.c b/backends/ia64_retval.c
+index dcd5f28..03ea4d8 100644
+--- a/backends/ia64_retval.c
++++ b/backends/ia64_retval.c
+@@ -260,7 +260,7 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
+index 67638d7..5f06c89 100644
+--- a/backends/linux-core-note.c
++++ b/backends/linux-core-note.c
+@@ -226,7 +226,7 @@ EBLHOOK(core_note) (const GElf_Nhdr *nhdr, const char *name,
+ if (memcmp (name, "CORE", nhdr->n_namesz) == 0)
+ break;
+ /* Buggy old Linux kernels didn't terminate "LINUX". */
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case sizeof "LINUX":
+ if (memcmp (name, "LINUX", nhdr->n_namesz) == 0)
+diff --git a/backends/m68k_retval.c b/backends/m68k_retval.c
+index c68ed02..a653ba3 100644
+--- a/backends/m68k_retval.c
++++ b/backends/m68k_retval.c
+@@ -92,7 +92,7 @@ m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -135,7 +135,7 @@ m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ if (size <= 8)
+ return nloc_intregpair;
+ }
+- /* Fallthrough */
++ FALLTHROUGH;
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+diff --git a/backends/mips_retval.c b/backends/mips_retval.c
+index 57487bb..c6e1ffe 100644
+--- a/backends/mips_retval.c
++++ b/backends/mips_retval.c
+@@ -306,7 +306,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = dwarf_tag (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -389,7 +389,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ }
+ }
+
+- /* Fallthrough to handle large types */
++ FALLTHROUGH; /* Fallthrough to handle large types */
+
+ case DW_TAG_array_type:
+ large:
+diff --git a/backends/parisc_retval.c b/backends/parisc_retval.c
+index df7ec3a..1f1e91a 100644
+--- a/backends/parisc_retval.c
++++ b/backends/parisc_retval.c
+@@ -116,7 +116,7 @@ parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, in
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = dwarf_tag (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -167,6 +167,7 @@ parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, in
+
+ /* Else fall through. */
+ }
++ FALLTHROUGH;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+@@ -189,7 +190,7 @@ parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, in
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+ #endif
+- /* fall through. */
++ FALLTHROUGH;
+ }
+ }
+
+diff --git a/backends/ppc64_retval.c b/backends/ppc64_retval.c
+index a251983..eb1c11e 100644
+--- a/backends/ppc64_retval.c
++++ b/backends/ppc64_retval.c
+@@ -96,7 +96,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -141,7 +141,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_intreg;
+ }
+
+- /* Else fall through. */
++ FALLTHROUGH;
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+@@ -161,7 +161,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_vmxreg;
+ }
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_string_type:
+ if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 8)
+diff --git a/backends/ppc_regs.c b/backends/ppc_regs.c
+index c2d5011..43d2534 100644
+--- a/backends/ppc_regs.c
++++ b/backends/ppc_regs.c
+@@ -140,7 +140,7 @@ ppc_register_info (Ebl *ebl __attribute__ ((unused)),
+ case 100:
+ if (*bits == 32)
+ return stpcpy (name, "mq") + 1 - name;
+- /* Fallthrough */
++ FALLTHROUGH;
+ case 102 ... 107:
+ name[0] = 's';
+ name[1] = 'p';
+diff --git a/backends/ppc_retval.c b/backends/ppc_retval.c
+index b14a99f..39b42da 100644
+--- a/backends/ppc_retval.c
++++ b/backends/ppc_retval.c
+@@ -108,7 +108,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -172,7 +172,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_intregquad;
+ }
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+diff --git a/backends/s390_retval.c b/backends/s390_retval.c
+index a927d46..2043f98 100644
+--- a/backends/s390_retval.c
++++ b/backends/s390_retval.c
+@@ -87,7 +87,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -127,7 +127,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return size <= asize ? nloc_intreg : nloc_intregpair;
+ }
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+diff --git a/backends/sh_retval.c b/backends/sh_retval.c
+index d44f260..33d7d96 100644
+--- a/backends/sh_retval.c
++++ b/backends/sh_retval.c
+@@ -84,7 +84,7 @@ sh_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+diff --git a/backends/sparc_retval.c b/backends/sparc_retval.c
+index e1b1775..fb81cdc 100644
+--- a/backends/sparc_retval.c
++++ b/backends/sparc_retval.c
+@@ -91,7 +91,7 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+diff --git a/backends/tilegx_retval.c b/backends/tilegx_retval.c
+index db81a20..7f7d24b 100644
+--- a/backends/tilegx_retval.c
++++ b/backends/tilegx_retval.c
+@@ -79,7 +79,7 @@ tilegx_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+@@ -113,7 +113,7 @@ tilegx_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ return nloc_intreg;
+ }
+
+- /* Else fall through. */
++ FALLTHROUGH;
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c
+index 8430440..ef987da 100644
+--- a/backends/x86_64_regs.c
++++ b/backends/x86_64_regs.c
+@@ -87,7 +87,7 @@ x86_64_register_info (Ebl *ebl __attribute__ ((unused)),
+
+ case 6 ... 7:
+ *type = DW_ATE_address;
+- /* Fallthrough */
++ FALLTHROUGH;
+ case 0 ... 5:
+ name[0] = 'r';
+ name[1] = baseregs[regno][0];
+diff --git a/backends/x86_64_retval.c b/backends/x86_64_retval.c
+index b3799ae..f9114cb 100644
+--- a/backends/x86_64_retval.c
++++ b/backends/x86_64_retval.c
+@@ -100,7 +100,7 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ typedie = dwarf_formref_die (attr, &die_mem);
+ tag = DWARF_TAG_OR_RETURN (typedie);
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_TAG_base_type:
+ case DW_TAG_enumeration_type:
+diff --git a/config/eu.am b/config/eu.am
+index 8fe1e25..b6ec581 100644
+--- a/config/eu.am
++++ b/config/eu.am
+@@ -62,7 +62,9 @@ NULL_DEREFERENCE_WARNING=
+ endif
+
+ if HAVE_IMPLICIT_FALLTHROUGH_WARNING
+-IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
++# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the
++# warning
++IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5
+ else
+ IMPLICIT_FALLTHROUGH_WARNING=
+ endif
+diff --git a/configure.ac b/configure.ac
+index 1f1856d..698efbb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -360,6 +360,12 @@ CFLAGS="$old_CFLAGS"])
+ AM_CONDITIONAL(HAVE_IMPLICIT_FALLTHROUGH_WARNING,
+ [test "x$ac_cv_implicit_fallthrough" != "xno"])
+
++# Assume the fallthrough attribute is supported if -Wimplict-fallthrough is supported
++if test "$ac_cv_implicit_fallthrough" = "yes"; then
++ AC_DEFINE([HAVE_FALLTHROUGH], [1],
++ [Defined if __attribute__((fallthrough)) is supported])
++fi
++
+ dnl Check if we have argp available from our libc
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+diff --git a/lib/eu-config.h b/lib/eu-config.h
+index 400cdc6..e8d4ec2 100644
+--- a/lib/eu-config.h
++++ b/lib/eu-config.h
+@@ -186,5 +186,12 @@ asm (".section predict_data, \"aw\"; .previous\n"
+ # define COMPAT_VERSION(name, version, prefix) error "should use #ifdef SYMBOL_VERSIONING"
+ #endif
+
++#ifndef FALLTHROUGH
++# ifdef HAVE_FALLTHROUGH
++# define FALLTHROUGH __attribute__ ((fallthrough))
++# else
++# define FALLTHROUGH ((void) 0)
++# endif
++#endif
+
+ #endif /* eu-config.h */
+diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
+index 60fd6d4..837a3a8 100644
+--- a/libcpu/i386_disasm.c
++++ b/libcpu/i386_disasm.c
+@@ -819,7 +819,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
+ ++param_start;
+ break;
+ }
+- /* Fallthrough */
++ FALLTHROUGH;
+ default:
+ str = "";
+ assert (! "INVALID not handled");
+diff --git a/libcpu/i386_parse.c b/libcpu/i386_parse.c
+index ef1ac35..6fa7ce3 100644
+--- a/libcpu/i386_parse.c
++++ b/libcpu/i386_parse.c
+@@ -1047,7 +1047,7 @@ yytnamerr (char *yyres, const char *yystr)
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+- /* Fall through. */
++ FALLTHROUGH;
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+@@ -2042,7 +2042,7 @@ yyabortlab:
+ yyexhaustedlab:
+ yyerror (YY_("memory exhausted"));
+ yyresult = 2;
+- /* Fall through. */
++ FALLTHROUGH;
+ #endif
+
+ yyreturn:
+diff --git a/libdw/cfi.c b/libdw/cfi.c
+index daa845f..341e055 100644
+--- a/libdw/cfi.c
++++ b/libdw/cfi.c
+@@ -138,7 +138,7 @@ execute_cfi (Dwarf_CFI *cache,
+
+ case DW_CFA_advance_loc1:
+ operand = *program++;
+- /* Fallthrough */
++ FALLTHROUGH;
+ case DW_CFA_advance_loc + 0 ... DW_CFA_advance_loc + CFI_PRIMARY_MAX:
+ advance_loc:
+ loc += operand * cie->code_alignment_factor;
+@@ -301,7 +301,7 @@ execute_cfi (Dwarf_CFI *cache,
+
+ case DW_CFA_restore_extended:
+ get_uleb128 (operand, program, end);
+- /* Fallthrough */
++ FALLTHROUGH;
+ case DW_CFA_restore + 0 ... DW_CFA_restore + CFI_PRIMARY_MAX:
+
+ if (unlikely (abi_cfi) && likely (opcode == DW_CFA_restore))
+diff --git a/libdw/dwarf_frame_register.c b/libdw/dwarf_frame_register.c
+index 37e8e91..d0159fb 100644
+--- a/libdw/dwarf_frame_register.c
++++ b/libdw/dwarf_frame_register.c
+@@ -62,7 +62,7 @@ dwarf_frame_register (Dwarf_Frame *fs, int regno, Dwarf_Op *ops_mem,
+ /* Use the default rule for registers not yet mentioned in CFI. */
+ if (fs->cache->default_same_value)
+ goto same_value;
+- /*FALLTHROUGH*/
++ FALLTHROUGH;
+ case reg_undefined:
+ /* The value is known to be unavailable. */
+ break;
+diff --git a/libdwfl/dwfl_report_elf.c b/libdwfl/dwfl_report_elf.c
+index 6950a37..3fc9384 100644
+--- a/libdwfl/dwfl_report_elf.c
++++ b/libdwfl/dwfl_report_elf.c
+@@ -174,7 +174,7 @@ __libdwfl_elf_address_range (Elf *elf, GElf_Addr base, bool add_p_vaddr,
+ /* An assigned base address is meaningless for these. */
+ base = 0;
+ add_p_vaddr = true;
+- /* Fallthrough. */
++ FALLTHROUGH;
+ case ET_DYN:
+ default:;
+ size_t phnum;
+diff --git a/libdwfl/frame_unwind.c b/libdwfl/frame_unwind.c
+index 4dc9c43..eaea495 100644
+--- a/libdwfl/frame_unwind.c
++++ b/libdwfl/frame_unwind.c
+@@ -442,7 +442,7 @@ expr_eval (Dwfl_Frame *state, Dwarf_Frame *frame, const Dwarf_Op *ops,
+ }
+ if (val1 == 0)
+ break;
+- /* FALLTHRU */
++ FALLTHROUGH;
+ case DW_OP_skip:;
+ Dwarf_Word offset = op->offset + 1 + 2 + (int16_t) op->number;
+ const Dwarf_Op *found = bsearch ((void *) (uintptr_t) offset, ops, nops,
+diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c
+index f80a1a5..ca4f155 100644
+--- a/libebl/eblobjnote.c
++++ b/libebl/eblobjnote.c
+@@ -223,7 +223,7 @@ ebl_object_note (Ebl *ebl, const char *name, uint32_t type,
+ free (buf);
+ break;
+ }
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ default:
+ /* Unknown type. */
+diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
+index a51bf70..5351518 100644
+--- a/libelf/elf32_updatenull.c
++++ b/libelf/elf32_updatenull.c
+@@ -232,7 +232,7 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
+ __libelf_seterrno (ELF_E_GROUP_NOT_REL);
+ return -1;
+ }
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+ case SHT_SYMTAB_SHNDX:
+ sh_entsize = elf_typesize (32, ELF_T_WORD, 1);
+ break;
+diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
+index 6f85038..6de206a 100644
+--- a/libelf/elf_begin.c
++++ b/libelf/elf_begin.c
+@@ -582,7 +582,7 @@ read_unmmaped_file (int fildes, off_t offset, size_t maxsize, Elf_Cmd cmd,
+ ? sizeof (Elf32_Ehdr) : sizeof (Elf64_Ehdr)))
+ return file_read_elf (fildes, NULL, mem.header, offset, maxsize, cmd,
+ parent);
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ default:
+ break;
+@@ -1097,7 +1097,7 @@ elf_begin (int fildes, Elf_Cmd cmd, Elf *ref)
+ retval = NULL;
+ break;
+ }
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ case ELF_C_READ:
+ case ELF_C_READ_MMAP:
+diff --git a/libelf/elf_cntl.c b/libelf/elf_cntl.c
+index ab13ffb..fd68178 100644
+--- a/libelf/elf_cntl.c
++++ b/libelf/elf_cntl.c
+@@ -62,7 +62,7 @@ elf_cntl (Elf *elf, Elf_Cmd cmd)
+ result = -1;
+ break;
+ }
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ case ELF_C_FDDONE:
+ /* Mark the file descriptor as not usable. */
+diff --git a/src/addr2line.c b/src/addr2line.c
+index ba414a7..444ee52 100644
+--- a/src/addr2line.c
++++ b/src/addr2line.c
+@@ -618,7 +618,7 @@ handle_address (const char *string, Dwfl *dwfl)
+ case 1:
+ addr = 0;
+ j = i;
+- /* Fallthrough */
++ FALLTHROUGH;
+ case 2:
+ if (string[j] != '\0')
+ break;
+diff --git a/src/elfcompress.c b/src/elfcompress.c
+index 8e0d5c5..25378a4 100644
+--- a/src/elfcompress.c
++++ b/src/elfcompress.c
+@@ -149,7 +149,7 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
+ N_("Only one input file allowed together with '-o'"));
+ /* We only use this for checking the number of arguments, we don't
+ actually want to consume them. */
+- /* Fallthrough */
++ FALLTHROUGH;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+diff --git a/src/elflint.c b/src/elflint.c
+index 51e53c2..df1b3a0 100644
+--- a/src/elflint.c
++++ b/src/elflint.c
+@@ -1764,7 +1764,7 @@ section [%2d] '%s': entry %zu: pointer does not match address of section [%2d] '
+ if (dyn->d_tag < DT_ADDRRNGLO || dyn->d_tag > DT_ADDRRNGHI)
+ /* Value is no pointer. */
+ break;
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ case DT_AUXILIARY:
+ case DT_FILTER:
+@@ -3993,7 +3993,7 @@ section [%2zu] '%s': merge flag set but entry size is zero\n"),
+ case SHT_NOBITS:
+ if (is_debuginfo)
+ break;
+- /* Fallthrough */
++ FALLTHROUGH;
+ default:
+ ERROR (gettext ("\
+ section [%2zu] '%s' has unexpected type %d for an executable section\n"),
+@@ -4137,7 +4137,7 @@ section [%2zu] '%s': ELF header says this is the section header string table but
+ ERROR (gettext ("\
+ section [%2zu] '%s': relocatable files cannot have dynamic symbol tables\n"),
+ cnt, section_name (ebl, cnt));
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+ case SHT_SYMTAB:
+ check_symtab (ebl, ehdr, shdr, cnt);
+ break;
+@@ -4336,7 +4336,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32
+ if (nhdr.n_namesz == sizeof "Linux"
+ && !memcmp (data->d_buf + name_offset, "Linux", sizeof "Linux"))
+ break;
+- /* Fallthrough */
++ FALLTHROUGH;
+ default:
+ if (shndx == 0)
+ ERROR (gettext ("\
+diff --git a/src/objdump.c b/src/objdump.c
+index 860cfac..0dd9a6a 100644
+--- a/src/objdump.c
++++ b/src/objdump.c
+@@ -223,7 +223,7 @@ parse_opt (int key, char *arg,
+ }
+ /* We only use this for checking the number of arguments, we don't
+ actually want to consume them. */
+- /* Fallthrough */
++ FALLTHROUGH;
+ default:
+ return ARGP_ERR_UNKNOWN;
+ }
+diff --git a/src/readelf.c b/src/readelf.c
+index 346eccd..6a27e7e 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -465,7 +465,7 @@ parse_opt (int key, char *arg,
+ print_string_sections = true;
+ break;
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+ case 'x':
+ add_dump_section (arg, false);
+ any_control_option = true;
+@@ -6029,7 +6029,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
+ dwarf_form_name (form), (uintmax_t) num);
+ return DWARF_CB_OK;
+ }
+- /* else fallthrough */
++ FALLTHROUGH;
+
+ /* These cases always take a loclistptr and no constant. */
+ case DW_AT_location:
+@@ -6195,7 +6195,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
+ print_block (block.length, block.data);
+ break;
+ }
+- /* Fall through. */
++ FALLTHROUGH;
+
+ case DW_AT_location:
+ case DW_AT_data_location:
+@@ -9227,7 +9227,7 @@ handle_auxv_note (Ebl *ebl, Elf *core, GElf_Word descsz, GElf_Off desc_pos)
+ printf (" %s\n", name);
+ break;
+ }
+- /* Fall through */
++ FALLTHROUGH;
+ case 'x': /* hex */
+ case 'p': /* address */
+ case 's': /* address of string */
+diff --git a/src/strings.c b/src/strings.c
+index d214356..03d0f13 100644
+--- a/src/strings.c
++++ b/src/strings.c
+@@ -246,7 +246,7 @@ parse_opt (int key, char *arg,
+ case 'b':
+ case 'B':
+ big_endian = true;
+- /* FALLTHROUGH */
++ FALLTHROUGH;
+
+ case 'l':
+ case 'L':
+diff --git a/tests/backtrace.c b/tests/backtrace.c
+index 21abe8a..f5dd761 100644
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -127,7 +127,7 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
+ assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
+ break;
+ }
+- /* FALLTHRU */
++ FALLTHROUGH;
+ case 4:
+ /* Some simple frame unwinders get this wrong and think sigusr2
+ is calling itself again. Allow it and just pretend there is
+diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
+index 8d5b53c..62c549d 100644
+--- a/tests/elfstrmerge.c
++++ b/tests/elfstrmerge.c
+@@ -578,7 +578,8 @@ main (int argc, char **argv)
+ break;
+
+ case SHT_DYNAMIC:
+- /* Fallthrough. There are string indexes in here, but
++ FALLTHROUGH;
++ /* There are string indexes in here, but
+ they (should) point to a allocated string table,
+ which we don't alter. */
+ default:
+--
+2.14.3
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch b/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
new file mode 100644
index 000000000..28c57f236
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
@@ -0,0 +1,52 @@
+From 0a69a26c9f7487daca900db87cd1195857a4603f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:10:57 +0800
+Subject: [PATCH 1/7] dso link change
+
+Upstream-Status: Pending
+
+This patch makes the link to the dependencies of libdw explicit, as
+recent ld no longer implicitly links them. See
+http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html
+as a similar example of the error message you can encounter without this
+patch, and https://fedoraproject.org/wiki/UnderstandingDSOLinkChange and
+https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking for
+more details.
+
+Rebase to 0.170
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/Makefile.am | 2 +-
+ tests/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 2b1c0dc..9305b84 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,7 +44,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.a -lz
+ else
+ libasm = ../libasm/libasm.so
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ endif
+ libebl = ../libebl/libebl.a
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 3735084..528615d 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -400,7 +400,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.a -lz
+ libasm = ../libasm/libasm.a
+ else
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ libasm = ../libasm/libasm.so
+ endif
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch b/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
new file mode 100644
index 000000000..fb0b060b4
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
@@ -0,0 +1,39 @@
+From 7672e363468271b4c63ff58770c5aac15ab8f722 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 4 Oct 2017 22:30:46 -0700
+Subject: [PATCH] libasm may link with libbz2 if found
+
+This can fail to link binaries like objdump
+where indirect libraries may be not found by linker
+
+| /mnt/a/oe/build/tmp/work/riscv64-bec-linux/elfutils/0.170-r0/recipe-sysroot/usr/lib/libbz2.so.1: error adding symbols: DSO missing from command line
+| collect2: error: ld returned 1 exit status
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/Makefile.am | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index e03bc32..9b7e853 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -39,11 +39,11 @@ EXTRA_DIST += make-debug-archive.in
+ CLEANFILES += make-debug-archive
+
+ if BUILD_STATIC
+-libasm = ../libasm/libasm.a
++libasm = ../libasm/libasm.a $(zip_LIBS)
+ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.a -lz
+ else
+-libasm = ../libasm/libasm.so
++libasm = ../libasm/libasm.so $(zip_LIBS)
+ libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ endif
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch b/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
new file mode 100644
index 000000000..2f718eb82
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
@@ -0,0 +1,42 @@
+From e98670f7c7b4c73fb65534949716fd8d043960d5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:13:59 +0800
+Subject: [PATCH 2/7] Fix elf_cvt_gunhash if dest and src are same.
+
+Upstream-Status: Pending
+
+The 'dest' and 'src' can be same, we need to save the value of src32[2]
+before swaping it.
+
+Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libelf/gnuhash_xlate.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
+index 6faf113..04d9ca1 100644
+--- a/libelf/gnuhash_xlate.h
++++ b/libelf/gnuhash_xlate.h
+@@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+ words. We must detangle them here. */
+ Elf32_Word *dest32 = dest;
+ const Elf32_Word *src32 = src;
++ Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src
+
+ /* First four control words, 32 bits. */
+ for (unsigned int cnt = 0; cnt < 4; ++cnt)
+@@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+ len -= 4;
+ }
+
+- Elf32_Word bitmask_words = encode ? src32[2] : dest32[2];
++ Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2];
+
+ /* Now the 64 bit words. */
+ Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch b/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
new file mode 100644
index 000000000..7c49fced1
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
@@ -0,0 +1,40 @@
+From 565d5935abf5b58773f9c8385c00189221980d98 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:17:20 +0800
+Subject: [PATCH 3/7] fixheadercheck
+
+For some binaries we can get a invalid section alignment, for example if
+sh_align = 1 and sh_addralign is 0. In the case of a zero size section
+like
+".note.GNU-stack", this is irrelavent as far as I can tell and we
+shouldn't
+error in this case.
+
+RP 2014/6/11
+
+Upstream-Status: Pending
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libelf/elf32_updatenull.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
+index d83c0b3..a51bf70 100644
+--- a/libelf/elf32_updatenull.c
++++ b/libelf/elf32_updatenull.c
+@@ -339,8 +339,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
+ we test for the alignment of the section being large
+ enough for the largest alignment required by a data
+ block. */
+- if (unlikely (! powerof2 (shdr->sh_addralign))
+- || unlikely ((shdr->sh_addralign ?: 1) < sh_align))
++ if (shdr->sh_size && (unlikely (! powerof2 (shdr->sh_addralign))
++ || unlikely ((shdr->sh_addralign ?: 1) < sh_align)))
+ {
+ __libelf_seterrno (ELF_E_INVALID_ALIGN);
+ return -1;
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch b/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
new file mode 100644
index 000000000..d893ad68f
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,44 @@
+From bb7ed11950101798aae82f7fda8b3dcb05f755c5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:24:06 +0800
+Subject: [PATCH 4/7] Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guild-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/iconv.m4 b/m4/iconv.m4
+index a503646..299f1eb 100644
+--- a/m4/iconv.m4
++++ b/m4/iconv.m4
+@@ -159,6 +159,7 @@ int main ()
+ }
+ }
+ #endif
++#if 0
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+@@ -170,6 +171,7 @@ int main ()
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
++#endif
+ return result;
+ }]])],
+ [am_cv_func_iconv_works=yes],
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch b/poky/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch
new file mode 100644
index 000000000..22a01cfa7
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0005-fix-a-stack-usage-warning.patch
@@ -0,0 +1,35 @@
+From dd6dbf6af396519380f48c0ef1ce6cf4dd77f6d7 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:25:16 +0800
+Subject: [PATCH 5/7] fix a stack-usage warning
+
+Upstream-Status: Pending
+
+not use a variable to as a array size, otherwise the warning to error
+that
+stack usage might be unbounded [-Werror=stack-usage=] will happen
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/ppc_initreg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
+index 69d623b..de41dec 100644
+--- a/backends/ppc_initreg.c
++++ b/backends/ppc_initreg.c
+@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
+ return false;
+ }
+ const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
+- Dwarf_Word dwarf_regs[gprs];
++ Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)];
+ for (unsigned gpr = 0; gpr < gprs; gpr++)
+ dwarf_regs[gpr] = user_regs.r.gpr[gpr];
+ if (! setfunc (0, gprs, dwarf_regs, arg))
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch b/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
new file mode 100644
index 000000000..5f29a0375
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
@@ -0,0 +1,61 @@
+From e57ad47fc8549353ca80c23b9b4f38f31fde13e5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:27:30 +0800
+Subject: [PATCH 6/7] Fix build on aarch64/musl
+
+Errors
+
+invalid operands to binary & (have 'long double' and 'unsigned int')
+
+error: redefinition
+ of 'struct iovec'
+ struct iovec { void *iov_base; size_t iov_len; };
+ ^
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/aarch64_initreg.c | 4 ++--
+ backends/arm_initreg.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c
+index daf6f37..6445276 100644
+--- a/backends/aarch64_initreg.c
++++ b/backends/aarch64_initreg.c
+@@ -33,7 +33,7 @@
+ #include "system.h"
+ #include <assert.h>
+ #if defined(__aarch64__) && defined(__linux__)
+-# include <linux/uio.h>
++# include <sys/uio.h>
+ # include <sys/user.h>
+ # include <sys/ptrace.h>
+ /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
+@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
+
+ Dwarf_Word dwarf_fregs[32];
+ for (int r = 0; r < 32; r++)
+- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
++ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
+
+ if (! setfunc (64, 32, dwarf_fregs, arg))
+ return false;
+diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c
+index efcabaf..062bb9e 100644
+--- a/backends/arm_initreg.c
++++ b/backends/arm_initreg.c
+@@ -38,7 +38,7 @@
+ #endif
+
+ #ifdef __aarch64__
+-# include <linux/uio.h>
++# include <sys/uio.h>
+ # include <sys/user.h>
+ # include <sys/ptrace.h>
+ /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch b/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch
new file mode 100644
index 000000000..224770478
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch
@@ -0,0 +1,45 @@
+From 1e91c1d4e37c05cf95058b4b3c3f352d72886f58 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 17:31:38 +0800
+Subject: [PATCH 7/7] Fix control path where we have str as uninitialized
+ string
+
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:
+In function 'i386_disasm':
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5:
+error: 'str' may be used uninitialized in this function
+[-Werror=maybe-uninitialized]
+| memcpy (buf + bufcnt, _str, _len); \
+| ^
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17:
+note: 'str' was declared here
+| const char *str;
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Rebase to 0.170
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libcpu/i386_disasm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
+index 831afbe..60fd6d4 100644
+--- a/libcpu/i386_disasm.c
++++ b/libcpu/i386_disasm.c
+@@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
+ }
+ /* Fallthrough */
+ default:
++ str = "";
+ assert (! "INVALID not handled");
+ }
+ }
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
new file mode 100644
index 000000000..a42ce7b35
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -0,0 +1,1029 @@
+From ef0981744669149a00dd0439a54dac30de7b56a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Aug 2017 10:06:26 +0800
+Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
+ compiling it on musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Rebase to 0.170
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ Makefile.am | 2 +-
+ lib/color.c | 3 ++-
+ lib/fixedsizehash.h | 1 -
+ lib/system.h | 10 ++++++++++
+ lib/xmalloc.c | 2 +-
+ libasm/asm_end.c | 2 +-
+ libasm/asm_newscn.c | 2 +-
+ libcpu/i386_gendis.c | 2 +-
+ libcpu/i386_lex.c | 2 +-
+ libcpu/i386_parse.c | 2 +-
+ libdw/Makefile.am | 3 ++-
+ libdw/libdw_alloc.c | 2 +-
+ libdwfl/dwfl_build_id_find_elf.c | 3 ++-
+ libdwfl/dwfl_error.c | 4 +++-
+ libdwfl/dwfl_module_getdwarf.c | 1 +
+ libdwfl/find-debuginfo.c | 2 +-
+ libdwfl/libdwfl_crc32_file.c | 9 +++++++++
+ libdwfl/linux-kernel-modules.c | 1 +
+ libebl/eblopenbackend.c | 2 +-
+ libelf/elf.h | 8 ++++++--
+ libelf/libelf.h | 1 +
+ libelf/libelfP.h | 1 +
+ src/addr2line.c | 2 +-
+ src/ar.c | 2 +-
+ src/arlib.c | 2 +-
+ src/arlib2.c | 2 +-
+ src/elfcmp.c | 2 +-
+ src/elflint.c | 2 +-
+ src/findtextrel.c | 2 +-
+ src/nm.c | 2 +-
+ src/objdump.c | 2 +-
+ src/ranlib.c | 2 +-
+ src/readelf.c | 2 +-
+ src/size.c | 2 +-
+ src/stack.c | 2 +-
+ src/strings.c | 2 +-
+ src/strip.c | 2 +-
+ src/unstrip.c | 2 +-
+ tests/addrscopes.c | 2 +-
+ tests/allregs.c | 2 +-
+ tests/backtrace-data.c | 2 +-
+ tests/backtrace-dwarf.c | 2 +-
+ tests/backtrace.c | 2 +-
+ tests/buildid.c | 2 +-
+ tests/debugaltlink.c | 2 +-
+ tests/debuglink.c | 2 +-
+ tests/deleted.c | 2 +-
+ tests/dwfl-addr-sect.c | 2 +-
+ tests/dwfl-bug-addr-overflow.c | 2 +-
+ tests/dwfl-bug-fd-leak.c | 2 +-
+ tests/dwfl-bug-getmodules.c | 2 +-
+ tests/dwfl-report-elf-align.c | 2 +-
+ tests/dwfllines.c | 2 +-
+ tests/dwflmodtest.c | 2 +-
+ tests/dwflsyms.c | 2 +-
+ tests/early-offscn.c | 2 +-
+ tests/ecp.c | 2 +-
+ tests/find-prologues.c | 2 +-
+ tests/funcretval.c | 2 +-
+ tests/funcscopes.c | 2 +-
+ tests/getsrc_die.c | 2 +-
+ tests/line2addr.c | 2 +-
+ tests/low_high_pc.c | 2 +-
+ tests/md5-sha1-test.c | 2 +-
+ tests/rdwrmmap.c | 2 +-
+ tests/saridx.c | 2 +-
+ tests/sectiondump.c | 2 +-
+ tests/varlocs.c | 2 +-
+ tests/vdsosyms.c | 2 +-
+ 69 files changed, 95 insertions(+), 64 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 2ff444e7..41f77df8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -28,7 +28,7 @@ pkginclude_HEADERS = version.h
+
+ # Add doc back when we have some real content.
+ SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
+- backends src po tests
++ backends po tests
+
+ EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
+ COPYING COPYING-GPLV2 COPYING-LGPLV3
+diff --git a/lib/color.c b/lib/color.c
+index f62389d5..a2a84b46 100644
+--- a/lib/color.c
++++ b/lib/color.c
+@@ -32,13 +32,14 @@
+ #endif
+
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ #include "libeu.h"
+ #include "color.h"
++#include "system.h"
+
+ /* Prototype for option handler. */
+ static error_t parse_opt (int key, char *arg, struct argp_state *state);
+diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
+index dac2a5f5..43016fc3 100644
+--- a/lib/fixedsizehash.h
++++ b/lib/fixedsizehash.h
+@@ -30,7 +30,6 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/cdefs.h>
+
+ #include <system.h>
+
+diff --git a/lib/system.h b/lib/system.h
+index 92033355..1a601319 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -50,6 +50,16 @@
+ #else
+ # error "Unknown byte order"
+ #endif
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
++#define error(status, errno, ...) err(status, __VA_ARGS__)
+
+ #ifndef MAX
+ #define MAX(m, n) ((m) < (n) ? (n) : (m))
+diff --git a/lib/xmalloc.c b/lib/xmalloc.c
+index 0cde384f..217b0541 100644
+--- a/lib/xmalloc.c
++++ b/lib/xmalloc.c
+@@ -30,7 +30,7 @@
+ # include <config.h>
+ #endif
+
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stddef.h>
+ #include <stdlib.h>
+diff --git a/libasm/asm_end.c b/libasm/asm_end.c
+index ced24f50..4ad918c4 100644
+--- a/libasm/asm_end.c
++++ b/libasm/asm_end.c
+@@ -32,7 +32,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c
+index ddbb25df..74a598d9 100644
+--- a/libasm/asm_newscn.c
++++ b/libasm/asm_newscn.c
+@@ -32,7 +32,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/libcpu/i386_gendis.c b/libcpu/i386_gendis.c
+index aae5eae6..6d760165 100644
+--- a/libcpu/i386_gendis.c
++++ b/libcpu/i386_gendis.c
+@@ -31,7 +31,7 @@
+ # include <config.h>
+ #endif
+
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+diff --git a/libcpu/i386_lex.c b/libcpu/i386_lex.c
+index ba5f4aa5..b1e41916 100644
+--- a/libcpu/i386_lex.c
++++ b/libcpu/i386_lex.c
+@@ -577,7 +577,7 @@ char *i386_text;
+ #endif
+
+ #include <ctype.h>
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+
+ #include <libeu.h>
+diff --git a/libcpu/i386_parse.c b/libcpu/i386_parse.c
+index 6fa7ce3d..bb270061 100644
+--- a/libcpu/i386_parse.c
++++ b/libcpu/i386_parse.c
+@@ -107,7 +107,7 @@
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+ #include <math.h>
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index ff8c291e..89e792aa 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -105,7 +105,8 @@ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
++fts_LDADD = -lfts
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) $(fts_LDADD)
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ # The rpath is necessary for libebl because its $ORIGIN use will
+diff --git a/libdw/libdw_alloc.c b/libdw/libdw_alloc.c
+index 28a8cf6e..29aeb3f7 100644
+--- a/libdw/libdw_alloc.c
++++ b/libdw/libdw_alloc.c
+@@ -31,7 +31,7 @@
+ # include <config.h>
+ #endif
+
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #include <stdlib.h>
+ #include "libdwP.h"
+diff --git a/libdwfl/dwfl_build_id_find_elf.c b/libdwfl/dwfl_build_id_find_elf.c
+index ee0c1646..b06ab596 100644
+--- a/libdwfl/dwfl_build_id_find_elf.c
++++ b/libdwfl/dwfl_build_id_find_elf.c
+@@ -31,6 +31,7 @@
+ #endif
+
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+@@ -99,7 +100,7 @@ __libdwfl_open_by_build_id (Dwfl_Module *mod, bool debug, char **file_name,
+ {
+ if (*file_name != NULL)
+ free (*file_name);
+- *file_name = canonicalize_file_name (name);
++ *file_name = realpath (name, NULL);
+ if (*file_name == NULL)
+ {
+ *file_name = name;
+diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c
+index 7bcf61cc..c345797a 100644
+--- a/libdwfl/dwfl_error.c
++++ b/libdwfl/dwfl_error.c
+@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
+ const char *
+ dwfl_errmsg (int error)
+ {
++ static __thread char s[64] = "";
+ if (error == 0 || error == -1)
+ {
+ int last_error = global_error;
+@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
+ switch (error &~ 0xffff)
+ {
+ case OTHER_ERROR (ERRNO):
+- return strerror_r (error & 0xffff, "bad", 0);
++ strerror_r (error & 0xffff, s, sizeof(s));
++ return s;
+ case OTHER_ERROR (LIBELF):
+ return elf_errmsg (error & 0xffff);
+ case OTHER_ERROR (LIBDW):
+diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c
+index 9775aced..511c4a6a 100644
+--- a/libdwfl/dwfl_module_getdwarf.c
++++ b/libdwfl/dwfl_module_getdwarf.c
+@@ -35,6 +35,7 @@
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h>
++#include "system.h"
+ #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
+ #include "../libelf/libelfP.h"
+ #include "system.h"
+diff --git a/libdwfl/find-debuginfo.c b/libdwfl/find-debuginfo.c
+index 6d5a42a6..9267788d 100644
+--- a/libdwfl/find-debuginfo.c
++++ b/libdwfl/find-debuginfo.c
+@@ -389,7 +389,7 @@ dwfl_standard_find_debuginfo (Dwfl_Module *mod,
+ /* If FILE_NAME is a symlink, the debug file might be associated
+ with the symlink target name instead. */
+
+- char *canon = canonicalize_file_name (file_name);
++ char *canon = realpath (file_name, NULL);
+ if (canon != NULL && strcmp (file_name, canon))
+ fd = find_debuginfo_in_path (mod, canon,
+ debuglink_file, debuglink_crc,
+diff --git a/libdwfl/libdwfl_crc32_file.c b/libdwfl/libdwfl_crc32_file.c
+index f849128d..6f0aca1b 100644
+--- a/libdwfl/libdwfl_crc32_file.c
++++ b/libdwfl/libdwfl_crc32_file.c
+@@ -29,6 +29,15 @@
+ # include <config.h>
+ #endif
+
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++#endif
++
+ #define crc32_file attribute_hidden __libdwfl_crc32_file
+ #define crc32 __libdwfl_crc32
+ #include <libdwflP.h>
+diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
+index 9d0fef2c..9fc09b88 100644
+--- a/libdwfl/linux-kernel-modules.c
++++ b/libdwfl/linux-kernel-modules.c
+@@ -40,6 +40,7 @@
+ #include <system.h>
+
+ #include "libdwflP.h"
++#include "system.h"
+ #include <inttypes.h>
+ #include <errno.h>
+ #include <stdio.h>
+diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
+index 53713963..2e66dfdd 100644
+--- a/libebl/eblopenbackend.c
++++ b/libebl/eblopenbackend.c
+@@ -32,7 +32,7 @@
+
+ #include <assert.h>
+ #include <dlfcn.h>
+-#include <error.h>
++#include <err.h>
+ #include <libelfP.h>
+ #include <dwarf.h>
+ #include <stdlib.h>
+diff --git a/libelf/elf.h b/libelf/elf.h
+index 5cf2b934..990b3afb 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -21,7 +21,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Standard ELF types. */
+
+@@ -3705,6 +3707,8 @@ enum
+ #define R_BPF_NONE 0 /* No reloc */
+ #define R_BPF_MAP_FD 1 /* Map fd to pointer */
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* elf.h */
+diff --git a/libelf/libelf.h b/libelf/libelf.h
+index 547c0f50..dd78799e 100644
+--- a/libelf/libelf.h
++++ b/libelf/libelf.h
+@@ -29,6 +29,7 @@
+ #ifndef _LIBELF_H
+ #define _LIBELF_H 1
+
++#include <fcntl.h>
+ #include <stdint.h>
+ #include <sys/types.h>
+
+diff --git a/libelf/libelfP.h b/libelf/libelfP.h
+index 7ee6625a..58408997 100644
+--- a/libelf/libelfP.h
++++ b/libelf/libelfP.h
+@@ -32,6 +32,7 @@
+
+ #include <ar.h>
+ #include <gelf.h>
++#include <libelf.h>
+
+ #include <errno.h>
+ #include <stdbool.h>
+diff --git a/src/addr2line.c b/src/addr2line.c
+index 444ee52c..9596fa67 100644
+--- a/src/addr2line.c
++++ b/src/addr2line.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libdwfl.h>
+diff --git a/src/ar.c b/src/ar.c
+index ec32cee5..4efd729c 100644
+--- a/src/ar.c
++++ b/src/ar.c
+@@ -22,7 +22,7 @@
+
+ #include <argp.h>
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libintl.h>
+diff --git a/src/arlib.c b/src/arlib.c
+index e0839aab..1143658f 100644
+--- a/src/arlib.c
++++ b/src/arlib.c
+@@ -21,7 +21,7 @@
+ #endif
+
+ #include <assert.h>
+-#include <error.h>
++#include <err.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+diff --git a/src/arlib2.c b/src/arlib2.c
+index 553fc57b..46443d0e 100644
+--- a/src/arlib2.c
++++ b/src/arlib2.c
+@@ -20,7 +20,7 @@
+ # include <config.h>
+ #endif
+
+-#include <error.h>
++#include <err.h>
+ #include <libintl.h>
+ #include <limits.h>
+ #include <string.h>
+diff --git a/src/elfcmp.c b/src/elfcmp.c
+index 50464207..cff183fa 100644
+--- a/src/elfcmp.c
++++ b/src/elfcmp.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <locale.h>
+ #include <libintl.h>
+diff --git a/src/elflint.c b/src/elflint.c
+index df1b3a03..67d8d134 100644
+--- a/src/elflint.c
++++ b/src/elflint.c
+@@ -24,7 +24,7 @@
+ #include <assert.h>
+ #include <byteswap.h>
+ #include <endian.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/findtextrel.c b/src/findtextrel.c
+index 8f1e239a..71463af3 100644
+--- a/src/findtextrel.c
++++ b/src/findtextrel.c
+@@ -23,7 +23,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libdw.h>
+diff --git a/src/nm.c b/src/nm.c
+index 969c6d35..3113c04c 100644
+--- a/src/nm.c
++++ b/src/nm.c
+@@ -26,7 +26,7 @@
+ #include <ctype.h>
+ #include <dwarf.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/objdump.c b/src/objdump.c
+index 0dd9a6aa..9c8bf149 100644
+--- a/src/objdump.c
++++ b/src/objdump.c
+@@ -21,7 +21,7 @@
+ #endif
+
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libintl.h>
+diff --git a/src/ranlib.c b/src/ranlib.c
+index cc0ee233..ae851e40 100644
+--- a/src/ranlib.c
++++ b/src/ranlib.c
+@@ -24,7 +24,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <libintl.h>
+diff --git a/src/readelf.c b/src/readelf.c
+index 6a27e7e0..4759a965 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -25,7 +25,7 @@
+ #include <ctype.h>
+ #include <dwarf.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/size.c b/src/size.c
+index ad8dbcbb..fd83be06 100644
+--- a/src/size.c
++++ b/src/size.c
+@@ -21,7 +21,7 @@
+ #endif
+
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/stack.c b/src/stack.c
+index 6f2ff69f..6da0243d 100644
+--- a/src/stack.c
++++ b/src/stack.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include <assert.h>
+ #include <argp.h>
+-#include <error.h>
++#include <err.h>
+ #include <stdlib.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+diff --git a/src/strings.c b/src/strings.c
+index 03d0f133..5c311cbd 100644
+--- a/src/strings.c
++++ b/src/strings.c
+@@ -25,7 +25,7 @@
+ #include <ctype.h>
+ #include <endian.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/src/strip.c b/src/strip.c
+index c7830ec6..0d7f148d 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -24,7 +24,7 @@
+ #include <assert.h>
+ #include <byteswap.h>
+ #include <endian.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+ #include <gelf.h>
+diff --git a/src/unstrip.c b/src/unstrip.c
+index 50749093..3d4f9525 100644
+--- a/src/unstrip.c
++++ b/src/unstrip.c
+@@ -31,7 +31,7 @@
+ #include <argp.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+ #include <libintl.h>
+diff --git a/tests/addrscopes.c b/tests/addrscopes.c
+index 791569f5..54f4311b 100644
+--- a/tests/addrscopes.c
++++ b/tests/addrscopes.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+
+
+diff --git a/tests/allregs.c b/tests/allregs.c
+index 286f7e3c..c9de0897 100644
+--- a/tests/allregs.c
++++ b/tests/allregs.c
+@@ -21,7 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include <assert.h>
+diff --git a/tests/backtrace-data.c b/tests/backtrace-data.c
+index a387d8ff..955c27d1 100644
+--- a/tests/backtrace-data.c
++++ b/tests/backtrace-data.c
+@@ -27,7 +27,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+ #if defined(__x86_64__) && defined(__linux__)
+diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
+index 2dc8a9a2..24ca7fb0 100644
+--- a/tests/backtrace-dwarf.c
++++ b/tests/backtrace-dwarf.c
+@@ -22,7 +22,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+diff --git a/tests/backtrace.c b/tests/backtrace.c
+index f5dd761f..a93a8f03 100644
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -24,7 +24,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+ #ifdef __linux__
+diff --git a/tests/buildid.c b/tests/buildid.c
+index 87c18773..2953e6bb 100644
+--- a/tests/buildid.c
++++ b/tests/buildid.c
+@@ -23,7 +23,7 @@
+ #include ELFUTILS_HEADER(elf)
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/debugaltlink.c b/tests/debugaltlink.c
+index 6d97d500..ee7e559e 100644
+--- a/tests/debugaltlink.c
++++ b/tests/debugaltlink.c
+@@ -23,7 +23,7 @@
+ #include ELFUTILS_HEADER(dw)
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/debuglink.c b/tests/debuglink.c
+index 935d1029..741cb814 100644
+--- a/tests/debuglink.c
++++ b/tests/debuglink.c
+@@ -21,7 +21,7 @@
+ #include <errno.h>
+ #include ELFUTILS_HEADER(dwelf)
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff --git a/tests/deleted.c b/tests/deleted.c
+index 6be35bc2..01907113 100644
+--- a/tests/deleted.c
++++ b/tests/deleted.c
+@@ -21,7 +21,7 @@
+ #include <unistd.h>
+ #include <assert.h>
+ #include <stdio.h>
+-#include <error.h>
++#include <err.h>
+ #include <errno.h>
+ #ifdef __linux__
+ #include <sys/prctl.h>
+diff --git a/tests/dwfl-addr-sect.c b/tests/dwfl-addr-sect.c
+index 21e470a3..1ea1e3b2 100644
+--- a/tests/dwfl-addr-sect.c
++++ b/tests/dwfl-addr-sect.c
+@@ -23,7 +23,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include ELFUTILS_HEADER(dwfl)
+diff --git a/tests/dwfl-bug-addr-overflow.c b/tests/dwfl-bug-addr-overflow.c
+index aa8030e1..02c8bef9 100644
+--- a/tests/dwfl-bug-addr-overflow.c
++++ b/tests/dwfl-bug-addr-overflow.c
+@@ -20,7 +20,7 @@
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include ELFUTILS_HEADER(dwfl)
+
+diff --git a/tests/dwfl-bug-fd-leak.c b/tests/dwfl-bug-fd-leak.c
+index 689cdd79..5973da39 100644
+--- a/tests/dwfl-bug-fd-leak.c
++++ b/tests/dwfl-bug-fd-leak.c
+@@ -24,7 +24,7 @@
+ #include <dirent.h>
+ #include <stdlib.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <unistd.h>
+ #include <dwarf.h>
+
+diff --git a/tests/dwfl-bug-getmodules.c b/tests/dwfl-bug-getmodules.c
+index 1ee989f8..fd62e653 100644
+--- a/tests/dwfl-bug-getmodules.c
++++ b/tests/dwfl-bug-getmodules.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include ELFUTILS_HEADER(dwfl)
+
+-#include <error.h>
++#include <err.h>
+
+ static const Dwfl_Callbacks callbacks =
+ {
+diff --git a/tests/dwfl-report-elf-align.c b/tests/dwfl-report-elf-align.c
+index a4e97d3c..f471587c 100644
+--- a/tests/dwfl-report-elf-align.c
++++ b/tests/dwfl-report-elf-align.c
+@@ -20,7 +20,7 @@
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdio_ext.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <string.h>
+ #include <stdlib.h>
+diff --git a/tests/dwfllines.c b/tests/dwfllines.c
+index 90379dd2..cbdf6c4c 100644
+--- a/tests/dwfllines.c
++++ b/tests/dwfllines.c
+@@ -27,7 +27,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+
+ int
+ main (int argc, char *argv[])
+diff --git a/tests/dwflmodtest.c b/tests/dwflmodtest.c
+index 0027f96b..e68d3bca 100644
+--- a/tests/dwflmodtest.c
++++ b/tests/dwflmodtest.c
+@@ -23,7 +23,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+ #include <locale.h>
+ #include <argp.h>
+ #include ELFUTILS_HEADER(dwfl)
+diff --git a/tests/dwflsyms.c b/tests/dwflsyms.c
+index 49ac3346..cf078301 100644
+--- a/tests/dwflsyms.c
++++ b/tests/dwflsyms.c
+@@ -25,7 +25,7 @@
+ #include <stdio.h>
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+
+ static const char *
+diff --git a/tests/early-offscn.c b/tests/early-offscn.c
+index 924cb9ef..6f60d5a3 100644
+--- a/tests/early-offscn.c
++++ b/tests/early-offscn.c
+@@ -19,7 +19,7 @@
+ #endif
+
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdio.h>
+diff --git a/tests/ecp.c b/tests/ecp.c
+index 38a6859e..743cea5d 100644
+--- a/tests/ecp.c
++++ b/tests/ecp.c
+@@ -20,7 +20,7 @@
+ #endif
+
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdlib.h>
+diff --git a/tests/find-prologues.c b/tests/find-prologues.c
+index ba8ae371..76f5f047 100644
+--- a/tests/find-prologues.c
++++ b/tests/find-prologues.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+
+diff --git a/tests/funcretval.c b/tests/funcretval.c
+index 8d19d117..c8aaa93d 100644
+--- a/tests/funcretval.c
++++ b/tests/funcretval.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+
+diff --git a/tests/funcscopes.c b/tests/funcscopes.c
+index 9c901858..dbccb89e 100644
+--- a/tests/funcscopes.c
++++ b/tests/funcscopes.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+
+diff --git a/tests/getsrc_die.c b/tests/getsrc_die.c
+index 055aede0..9c394dd0 100644
+--- a/tests/getsrc_die.c
++++ b/tests/getsrc_die.c
+@@ -19,7 +19,7 @@
+ #endif
+
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <inttypes.h>
+ #include <libelf.h>
+diff --git a/tests/line2addr.c b/tests/line2addr.c
+index e0d65d3d..9bf0023b 100644
+--- a/tests/line2addr.c
++++ b/tests/line2addr.c
+@@ -26,7 +26,7 @@
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+
+
+ static void
+diff --git a/tests/low_high_pc.c b/tests/low_high_pc.c
+index d0f43023..8da4fbdf 100644
+--- a/tests/low_high_pc.c
++++ b/tests/low_high_pc.c
+@@ -25,7 +25,7 @@
+ #include <stdio_ext.h>
+ #include <locale.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <fnmatch.h>
+
+diff --git a/tests/md5-sha1-test.c b/tests/md5-sha1-test.c
+index d50355e9..3c41f40b 100644
+--- a/tests/md5-sha1-test.c
++++ b/tests/md5-sha1-test.c
+@@ -19,7 +19,7 @@
+ #endif
+
+ #include <string.h>
+-#include <error.h>
++#include <err.h>
+
+ #include "md5.h"
+ #include "sha1.h"
+diff --git a/tests/rdwrmmap.c b/tests/rdwrmmap.c
+index 6f027dfe..1ce5e6ed 100644
+--- a/tests/rdwrmmap.c
++++ b/tests/rdwrmmap.c
+@@ -19,7 +19,7 @@
+ #endif
+
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+diff --git a/tests/saridx.c b/tests/saridx.c
+index 8a450d82..b3878013 100644
+--- a/tests/saridx.c
++++ b/tests/saridx.c
+@@ -17,7 +17,7 @@
+
+ #include <config.h>
+
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <stdio.h>
+diff --git a/tests/sectiondump.c b/tests/sectiondump.c
+index 3033fedc..8e888db3 100644
+--- a/tests/sectiondump.c
++++ b/tests/sectiondump.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <fcntl.h>
+ #include <gelf.h>
+ #include <inttypes.h>
+diff --git a/tests/varlocs.c b/tests/varlocs.c
+index c3fba89e..e043ea2c 100644
+--- a/tests/varlocs.c
++++ b/tests/varlocs.c
+@@ -25,7 +25,7 @@
+ #include <dwarf.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <error.h>
++#include <err.h>
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c
+index b876c10b..afb28232 100644
+--- a/tests/vdsosyms.c
++++ b/tests/vdsosyms.c
+@@ -18,7 +18,7 @@
+ #include <config.h>
+ #include <assert.h>
+ #include <errno.h>
+-#include <error.h>
++#include <err.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <string.h>
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch b/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
new file mode 100644
index 000000000..e0291b4cf
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/0001-Ignore-differences-between-mips-machine-identifiers.patch
@@ -0,0 +1,35 @@
+From 77cb4a53c270d5854d3af24f19547bc3de825233 Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:16:58 +0000
+Subject: [PATCH 1/3] Ignore differences between mips machine identifiers
+
+Little endian binaries actually use EM_MIPS so you can't tell the endianness
+from the elf machine id. Also, the EM_MIPS_RS3_LE machine is dead anyway (the
+kernel will not load binaries containing it).
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ backends/mips_init.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+Index: b/backends/mips_init.c
+===================================================================
+--- a/backends/mips_init.c
++++ b/backends/mips_init.c
+@@ -45,11 +45,7 @@ mips_init (Elf *elf __attribute__ ((unus
+ return NULL;
+
+ /* We handle it. */
+- if (machine == EM_MIPS)
+- eh->name = "MIPS R3000 big-endian";
+- else if (machine == EM_MIPS_RS3_LE)
+- eh->name = "MIPS R3000 little-endian";
+-
++ eh->name = "MIPS";
+ mips_init_reloc (eh);
+ HOOK (eh, reloc_simple_type);
+ HOOK (eh, return_value_location);
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch b/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
new file mode 100644
index 000000000..b17498f5f
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch
@@ -0,0 +1,171 @@
+From fdaab18a65ed2529656baa64cb6169f34d7e507b Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:17:01 +0000
+Subject: [PATCH 2/3] Add support for mips64 abis in mips_retval.c
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/mips_retval.c | 104 ++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 94 insertions(+), 10 deletions(-)
+
+diff --git a/backends/mips_retval.c b/backends/mips_retval.c
+index 33f12a7..d5c6ef0 100644
+--- a/backends/mips_retval.c
++++ b/backends/mips_retval.c
+@@ -91,6 +91,8 @@ enum mips_abi find_mips_abi(Elf *elf)
+ default:
+ if ((elf_flags & EF_MIPS_ABI2))
+ return MIPS_ABI_N32;
++ else if ((ehdr->e_ident[EI_CLASS] == ELFCLASS64))
++ return MIPS_ABI_N64;
+ }
+
+ /* GCC creates a pseudo-section whose name describes the ABI. */
+@@ -195,6 +197,57 @@ static const Dwarf_Op loc_aggregate[] =
+ };
+ #define nloc_aggregate 1
+
++/* Test if a struct member is a float */
++static int is_float_child(Dwarf_Die *childdie)
++{
++ /* Test if this is actually a struct member */
++ if (dwarf_tag(childdie) != DW_TAG_member)
++ return 0;
++
++ /* Get type of member */
++ Dwarf_Attribute attr_mem;
++ Dwarf_Die child_type_mem;
++ Dwarf_Die *child_typedie =
++ dwarf_formref_die(dwarf_attr_integrate(childdie,
++ DW_AT_type,
++ &attr_mem), &child_type_mem);
++
++ if (dwarf_tag(child_typedie) != DW_TAG_base_type)
++ return 0;
++
++ /* Get base subtype */
++ Dwarf_Word encoding;
++ if (dwarf_formudata (dwarf_attr_integrate (child_typedie,
++ DW_AT_encoding,
++ &attr_mem), &encoding) != 0)
++ return 0;
++
++ return encoding == DW_ATE_float;
++}
++
++/* Returns the number of fpregs which can be returned in the given struct */
++static int get_struct_fpregs(Dwarf_Die *structtypedie)
++{
++ Dwarf_Die child_mem;
++ int fpregs = 0;
++
++ /* Get first structure member */
++ if (dwarf_child(structtypedie, &child_mem) != 0)
++ return 0;
++
++ do
++ {
++ /* Ensure this register is a float */
++ if (!is_float_child(&child_mem))
++ return 0;
++
++ fpregs++;
++ }
++ while (dwarf_siblingof (&child_mem, &child_mem) == 0);
++
++ return fpregs;
++}
++
+ int
+ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ {
+@@ -240,6 +293,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ tag = dwarf_tag (typedie);
+ }
+
++ Dwarf_Word size;
+ switch (tag)
+ {
+ case -1:
+@@ -258,8 +312,6 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ case DW_TAG_enumeration_type:
+ case DW_TAG_pointer_type:
+ case DW_TAG_ptr_to_member_type:
+- {
+- Dwarf_Word size;
+ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
+ &attr_mem), &size) != 0)
+ {
+@@ -289,7 +341,7 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ if (size <= 4*regsize && abi == MIPS_ABI_O32)
+ return nloc_fpregquad;
+
+- goto aggregate;
++ goto large;
+ }
+ }
+ *locp = ABI_LOC(loc_intreg, regsize);
+@@ -298,18 +350,50 @@ mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ if (size <= 2*regsize)
+ return nloc_intregpair;
+
+- /* Else fall through. Shouldn't happen though (at least with gcc) */
+- }
++ /* Else pass in memory. Shouldn't happen though (at least with gcc) */
++ goto large;
+
+ case DW_TAG_structure_type:
+ case DW_TAG_class_type:
+ case DW_TAG_union_type:
+- case DW_TAG_array_type:
+- aggregate:
+- /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
+- if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
+- return -2;
++ /* Handle special cases for structures <= 128 bytes in newer ABIs */
++ if (abi == MIPS_ABI_EABI32 || abi == MIPS_ABI_EABI64 ||
++ abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64)
++ {
++ if (dwarf_aggregate_size (typedie, &size) == 0 && size <= 16)
++ {
++ /*
++ * Special case in N64 / N32 -
++ * structures containing only floats are returned in fp regs.
++ * Everything else is returned in integer regs.
++ */
++ if (tag != DW_TAG_union_type &&
++ (abi == MIPS_ABI_N32 || abi == MIPS_ABI_N64))
++ {
++ int num_fpregs = get_struct_fpregs(typedie);
++ if (num_fpregs == 1 || num_fpregs == 2)
++ {
++ *locp = loc_fpreg;
++ if (num_fpregs == 1)
++ return nloc_fpreg;
++ else
++ return nloc_fpregpair;
++ }
++ }
++
++ *locp = loc_intreg;
++ if (size <= 8)
++ return nloc_intreg;
++ else
++ return nloc_intregpair;
++ }
++ }
++
++ /* Fallthrough to handle large types */
+
++ case DW_TAG_array_type:
++ large:
++ /* Return large structures in memory */
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+ }
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch b/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch
new file mode 100644
index 000000000..2a5f8628d
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/0003-Add-mips-n64-relocation-format-hack.patch
@@ -0,0 +1,229 @@
+From 59d4b8c48e5040af7e02b34eb26ea602ec82a38e Mon Sep 17 00:00:00 2001
+From: James Cowgill <james410@cowgill.org.uk>
+Date: Mon, 5 Jan 2015 15:17:02 +0000
+Subject: [PATCH 3/3] Add mips n64 relocation format hack
+
+MIPSEL N64 ELF files use a slightly different format for storing relocation
+entries which is incompatible with the normal R_SYM / R_INFO macros.
+To workaround this, we rearrange the bytes in the relocation's r_info field
+when reading and writing the relocations.
+
+This patch also ensures that strip.c sets the correct value of e_machine
+before manipulating relocations so that these changes take effect.
+
+Signed-off-by: James Cowgill <james410@cowgill.org.uk>
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libelf/gelf_getrel.c | 25 +++++++++++++++++++++++--
+ libelf/gelf_getrela.c | 25 +++++++++++++++++++++++--
+ libelf/gelf_update_rel.c | 20 +++++++++++++++++++-
+ libelf/gelf_update_rela.c | 20 +++++++++++++++++++-
+ src/strip.c | 17 +++++++++++++++++
+ 5 files changed, 101 insertions(+), 6 deletions(-)
+
+Index: b/libelf/gelf_getrel.c
+===================================================================
+--- a/libelf/gelf_getrel.c
++++ b/libelf/gelf_getrel.c
+@@ -36,6 +36,7 @@
+
+ #include "libelfP.h"
+
++#define EF_MIPS_ABI 0x0000F000
+
+ GElf_Rel *
+ gelf_getrel (Elf_Data *data, int ndx, GElf_Rel *dst)
+@@ -89,8 +90,28 @@ gelf_getrel (Elf_Data *data, int ndx, GE
+ result = NULL;
+ }
+ else
+- result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
+- sizeof (Elf64_Rel));
++ {
++ GElf_Ehdr hdr;
++ result = memcpy (dst, &((Elf64_Rel *) data_scn->d.d_buf)[ndx],
++ sizeof (Elf64_Rel));
++
++ if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++ hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++ hdr.e_machine == EM_MIPS &&
++ (hdr.e_flags & EF_MIPS_ABI) == 0)
++ {
++ /*
++ * The relocation format is mangled on MIPSEL N64
++ * We'll adjust it so at least R_SYM will work on it
++ */
++ GElf_Xword r_info = dst->r_info;
++ dst->r_info = (r_info << 32) |
++ ((r_info >> 8) & 0xFF000000) |
++ ((r_info >> 24) & 0x00FF0000) |
++ ((r_info >> 40) & 0x0000FF00) |
++ ((r_info >> 56) & 0x000000FF);
++ }
++ }
+ }
+
+ rwlock_unlock (scn->elf->lock);
+Index: b/libelf/gelf_getrela.c
+===================================================================
+--- a/libelf/gelf_getrela.c
++++ b/libelf/gelf_getrela.c
+@@ -36,6 +36,7 @@
+
+ #include "libelfP.h"
+
++#define EF_MIPS_ABI 0x0000F000
+
+ GElf_Rela *
+ gelf_getrela (Elf_Data *data, int ndx, GElf_Rela *dst)
+@@ -90,8 +91,28 @@ gelf_getrela (Elf_Data *data, int ndx, G
+ result = NULL;
+ }
+ else
+- result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
+- sizeof (Elf64_Rela));
++ {
++ GElf_Ehdr hdr;
++ result = memcpy (dst, &((Elf64_Rela *) data_scn->d.d_buf)[ndx],
++ sizeof (Elf64_Rela));
++
++ if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++ hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++ hdr.e_machine == EM_MIPS &&
++ (hdr.e_flags & EF_MIPS_ABI) == 0)
++ {
++ /*
++ * The relocation format is mangled on MIPSEL N64
++ * We'll adjust it so at least R_SYM will work on it
++ */
++ GElf_Xword r_info = dst->r_info;
++ dst->r_info = (r_info << 32) |
++ ((r_info >> 8) & 0xFF000000) |
++ ((r_info >> 24) & 0x00FF0000) |
++ ((r_info >> 40) & 0x0000FF00) |
++ ((r_info >> 56) & 0x000000FF);
++ }
++ }
+ }
+
+ rwlock_unlock (scn->elf->lock);
+Index: b/libelf/gelf_update_rel.c
+===================================================================
+--- a/libelf/gelf_update_rel.c
++++ b/libelf/gelf_update_rel.c
+@@ -36,6 +36,7 @@
+
+ #include "libelfP.h"
+
++#define EF_MIPS_ABI 0x0000F000
+
+ int
+ gelf_update_rel (Elf_Data *dst, int ndx, GElf_Rel *src)
+@@ -86,6 +87,9 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ }
+ else
+ {
++ GElf_Ehdr hdr;
++ GElf_Rel value = *src;
++
+ /* Check whether we have to resize the data buffer. */
+ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ {
+@@ -93,7 +97,21 @@ gelf_update_rel (Elf_Data *dst, int ndx,
+ goto out;
+ }
+
+- ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = *src;
++ if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++ hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++ hdr.e_machine == EM_MIPS &&
++ (hdr.e_flags & EF_MIPS_ABI) == 0)
++ {
++ /* Undo the MIPSEL N64 hack from gelf_getrel */
++ GElf_Xword r_info = value.r_info;
++ value.r_info = (r_info >> 32) |
++ ((r_info << 8) & 0x000000FF00000000) |
++ ((r_info << 24) & 0x0000FF0000000000) |
++ ((r_info << 40) & 0x00FF000000000000) |
++ ((r_info << 56) & 0xFF00000000000000);
++ }
++
++ ((Elf64_Rel *) data_scn->d.d_buf)[ndx] = value;
+ }
+
+ result = 1;
+Index: b/libelf/gelf_update_rela.c
+===================================================================
+--- a/libelf/gelf_update_rela.c
++++ b/libelf/gelf_update_rela.c
+@@ -36,6 +36,7 @@
+
+ #include "libelfP.h"
+
++#define EF_MIPS_ABI 0x0000F000
+
+ int
+ gelf_update_rela (Elf_Data *dst, int ndx, GElf_Rela *src)
+@@ -89,6 +90,9 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ }
+ else
+ {
++ GElf_Ehdr hdr;
++ GElf_Rela value = *src;
++
+ /* Check whether we have to resize the data buffer. */
+ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ {
+@@ -96,7 +100,21 @@ gelf_update_rela (Elf_Data *dst, int ndx
+ goto out;
+ }
+
+- ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = *src;
++ if (gelf_getehdr(scn->elf, &hdr) != NULL &&
++ hdr.e_ident[EI_DATA] == ELFDATA2LSB &&
++ hdr.e_machine == EM_MIPS &&
++ (hdr.e_flags & EF_MIPS_ABI) == 0)
++ {
++ /* Undo the MIPSEL N64 hack from gelf_getrel */
++ GElf_Xword r_info = value.r_info;
++ value.r_info = (r_info >> 32) |
++ ((r_info << 8) & 0x000000FF00000000) |
++ ((r_info << 24) & 0x0000FF0000000000) |
++ ((r_info << 40) & 0x00FF000000000000) |
++ ((r_info << 56) & 0xFF00000000000000);
++ }
++
++ ((Elf64_Rela *) data_scn->d.d_buf)[ndx] = value;
+ }
+
+ result = 1;
+Index: b/src/strip.c
+===================================================================
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -532,6 +532,23 @@ handle_elf (int fd, Elf *elf, const char
+ goto fail;
+ }
+
++ /* Copy identity part of the ELF header now */
++ newehdr = gelf_getehdr (newelf, &newehdr_mem);
++ if (newehdr == NULL)
++ INTERNAL_ERROR (fname);
++
++ memcpy (newehdr->e_ident, ehdr->e_ident, EI_NIDENT);
++ newehdr->e_type = ehdr->e_type;
++ newehdr->e_machine = ehdr->e_machine;
++ newehdr->e_version = ehdr->e_version;
++
++ if (gelf_update_ehdr (newelf, newehdr) == 0)
++ {
++ error (0, 0, gettext ("%s: error while creating ELF header: %s"),
++ fname, elf_errmsg (-1));
++ return 1;
++ }
++
+ /* Copy over the old program header if needed. */
+ if (ehdr->e_type != ET_REL)
+ for (cnt = 0; cnt < phnum; ++cnt)
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff b/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff
new file mode 100644
index 000000000..50f4b059e
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/arm_backend.diff
@@ -0,0 +1,603 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/backends/arm_init.c
+===================================================================
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
+@@ -35,20 +35,31 @@
+ #define RELOC_PREFIX R_ARM_
+ #include "libebl_CPU.h"
+
++#include "libebl_arm.h"
++
+ /* This defines the common reloc hooks based on arm_reloc.def. */
+ #include "common-reloc.c"
+
+
+ const char *
+-arm_init (Elf *elf __attribute__ ((unused)),
++arm_init (Elf *elf,
+ GElf_Half machine __attribute__ ((unused)),
+ Ebl *eh,
+ size_t ehlen)
+ {
++ int soft_float = 0;
++
+ /* Check whether the Elf_BH object has a sufficent size. */
+ if (ehlen < sizeof (Ebl))
+ return NULL;
+
++ if (elf) {
++ GElf_Ehdr ehdr_mem;
++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++ if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
++ soft_float = 1;
++ }
++
+ /* We handle it. */
+ eh->name = "ARM";
+ arm_init_reloc (eh);
+@@ -60,7 +71,10 @@ arm_init (Elf *elf __attribute__ ((unuse
+ HOOK (eh, core_note);
+ HOOK (eh, auxv_info);
+ HOOK (eh, check_object_attribute);
+- HOOK (eh, return_value_location);
++ if (soft_float)
++ eh->return_value_location = arm_return_value_location_soft;
++ else
++ eh->return_value_location = arm_return_value_location_hard;
+ HOOK (eh, abi_cfi);
+ HOOK (eh, check_reloc_target_type);
+ HOOK (eh, symbol_type_name);
+Index: b/backends/arm_regs.c
+===================================================================
+--- a/backends/arm_regs.c
++++ b/backends/arm_regs.c
+@@ -31,6 +31,7 @@
+ #endif
+
+ #include <string.h>
++#include <stdio.h>
+ #include <dwarf.h>
+
+ #define BACKEND arm_
+@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute_
+ break;
+
+ case 16 + 0 ... 16 + 7:
++ /* AADWARF says that there are no registers in that range,
++ * but gcc maps FPA registers here
++ */
+ regno += 96 - 16;
+ /* Fall through. */
+ case 96 + 0 ... 96 + 7:
+@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute_
+ namelen = 2;
+ break;
+
++ case 64 + 0 ... 64 + 9:
++ *setname = "VFP";
++ *bits = 32;
++ *type = DW_ATE_float;
++ name[0] = 's';
++ name[1] = regno - 64 + '0';
++ namelen = 2;
++ break;
++
++ case 64 + 10 ... 64 + 31:
++ *setname = "VFP";
++ *bits = 32;
++ *type = DW_ATE_float;
++ name[0] = 's';
++ name[1] = (regno - 64) / 10 + '0';
++ name[2] = (regno - 64) % 10 + '0';
++ namelen = 3;
++ break;
++
++ case 104 + 0 ... 104 + 7:
++ /* XXX TODO:
++ * This can be either intel wireless MMX general purpose/control
++ * registers or xscale accumulator, which have different usage.
++ * We only have the intel wireless MMX here now.
++ * The name needs to be changed for the xscale accumulator too. */
++ *setname = "MMX";
++ *type = DW_ATE_unsigned;
++ *bits = 32;
++ memcpy(name, "wcgr", 4);
++ name[4] = regno - 104 + '0';
++ namelen = 5;
++ break;
++
++ case 112 + 0 ... 112 + 9:
++ *setname = "MMX";
++ *type = DW_ATE_unsigned;
++ *bits = 64;
++ name[0] = 'w';
++ name[1] = 'r';
++ name[2] = regno - 112 + '0';
++ namelen = 3;
++ break;
++
++ case 112 + 10 ... 112 + 15:
++ *setname = "MMX";
++ *type = DW_ATE_unsigned;
++ *bits = 64;
++ name[0] = 'w';
++ name[1] = 'r';
++ name[2] = '1';
++ name[3] = regno - 112 - 10 + '0';
++ namelen = 4;
++ break;
++
+ case 128:
++ *setname = "state";
+ *type = DW_ATE_unsigned;
+ return stpcpy (name, "spsr") + 1 - name;
+
++ case 129:
++ *setname = "state";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_fiq") + 1 - name;
++
++ case 130:
++ *setname = "state";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_irq") + 1 - name;
++
++ case 131:
++ *setname = "state";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_abt") + 1 - name;
++
++ case 132:
++ *setname = "state";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_und") + 1 - name;
++
++ case 133:
++ *setname = "state";
++ *type = DW_ATE_unsigned;
++ return stpcpy(name, "spsr_svc") + 1 - name;
++
++ case 144 ... 150:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
++
++ case 151 ... 157:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
++
++ case 158 ... 159:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
++
++ case 160 ... 161:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
++
++ case 162 ... 163:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
++
++ case 164 ... 165:
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
++
++ case 192 ... 199:
++ *setname = "MMX";
++ *bits = 32;
++ *type = DW_ATE_unsigned;
++ name[0] = 'w';
++ name[1] = 'c';
++ name[2] = regno - 192 + '0';
++ namelen = 3;
++ break;
++
+ case 256 + 0 ... 256 + 9:
++ /* XXX TODO: Neon also uses those registers and can contain
++ * both float and integers */
+ *setname = "VFP";
+ *type = DW_ATE_float;
+ *bits = 64;
+Index: b/backends/arm_retval.c
+===================================================================
+--- a/backends/arm_retval.c
++++ b/backends/arm_retval.c
+@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
+ #define nloc_intreg 1
+ #define nloc_intregs(n) (2 * (n))
+
++/* f1 */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
++static const Dwarf_Op loc_fpreg[] =
++ {
++ { .atom = DW_OP_reg16 },
++ };
++#define nloc_fpreg 1
++
+ /* The return value is a structure and is actually stored in stack space
+ passed in a hidden argument by the caller. But, the compiler
+ helpfully returns the address of that space in r0. */
+@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
+ #define nloc_aggregate 1
+
+
+-int
+-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++static int
++arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
++ int soft_float)
+ {
+ /* Start with the function's type, and get the DW_AT_type attribute,
+ which is the type of the return value. */
+@@ -98,6 +106,21 @@ arm_return_value_location (Dwarf_Die *fu
+ else
+ return -1;
+ }
++ if (tag == DW_TAG_base_type)
++ {
++ Dwarf_Word encoding;
++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++ &attr_mem), &encoding) != 0)
++ return -1;
++
++ if ((encoding == DW_ATE_float) && !soft_float)
++ {
++ *locp = loc_fpreg;
++ if (size <= 8)
++ return nloc_fpreg;
++ goto aggregate;
++ }
++ }
+ if (size <= 16)
+ {
+ intreg:
+@@ -106,6 +129,7 @@ arm_return_value_location (Dwarf_Die *fu
+ }
+
+ aggregate:
++ /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
+ *locp = loc_aggregate;
+ return nloc_aggregate;
+ }
+@@ -125,3 +149,18 @@ arm_return_value_location (Dwarf_Die *fu
+ DWARF and might be valid. */
+ return -2;
+ }
++
++/* return location for -mabi=apcs-gnu -msoft-float */
++int
++arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ return arm_return_value_location_ (functypedie, locp, 1);
++}
++
++/* return location for -mabi=apcs-gnu -mhard-float (current default) */
++int
++arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ return arm_return_value_location_ (functypedie, locp, 0);
++}
++
+Index: b/libelf/elf.h
+===================================================================
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2593,6 +2593,9 @@ enum
+ #define EF_ARM_EABI_VER4 0x04000000
+ #define EF_ARM_EABI_VER5 0x05000000
+
++/* EI_OSABI values */
++#define ELFOSABI_ARM_AEABI 64 /* Contains symbol versioning. */
++
+ /* Additional symbol types for Thumb. */
+ #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
+ #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
+@@ -2610,12 +2613,19 @@ enum
+
+ /* Processor specific values for the Phdr p_type field. */
+ #define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */
++#define PT_ARM_UNWIND PT_ARM_EXIDX
+
+ /* Processor specific values for the Shdr sh_type field. */
+ #define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */
+ #define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */
+ #define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */
+
++/* Processor specific values for the Dyn d_tag field. */
++#define DT_ARM_RESERVED1 (DT_LOPROC + 0)
++#define DT_ARM_SYMTABSZ (DT_LOPROC + 1)
++#define DT_ARM_PREEMTMAB (DT_LOPROC + 2)
++#define DT_ARM_RESERVED2 (DT_LOPROC + 3)
++#define DT_ARM_NUM 4
+
+ /* AArch64 relocs. */
+
+@@ -2908,6 +2918,7 @@ enum
+ TLS block (LDR, STR). */
+ #define R_ARM_TLS_IE12GP 111 /* 12 bit GOT entry relative
+ to GOT origin (LDR). */
++/* 112 - 127 private range */
+ #define R_ARM_ME_TOO 128 /* Obsolete. */
+ #define R_ARM_THM_TLS_DESCSEQ 129
+ #define R_ARM_THM_TLS_DESCSEQ16 129
+Index: b/backends/libebl_arm.h
+===================================================================
+--- /dev/null
++++ b/backends/libebl_arm.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_ARM_H
++#define _LIBEBL_ARM_H 1
++
++#include <libdw.h>
++
++extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
++extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: b/tests/run-allregs.sh
+===================================================================
+--- a/tests/run-allregs.sh
++++ b/tests/run-allregs.sh
+@@ -2672,7 +2672,28 @@ integer registers:
+ 13: sp (sp), address 32 bits
+ 14: lr (lr), address 32 bits
+ 15: pc (pc), address 32 bits
+- 128: spsr (spsr), unsigned 32 bits
++ 144: r8_usr (r8_usr), signed 32 bits
++ 145: r9_usr (r9_usr), signed 32 bits
++ 146: r10_usr (r10_usr), signed 32 bits
++ 147: r11_usr (r11_usr), signed 32 bits
++ 148: r12_usr (r12_usr), signed 32 bits
++ 149: r13_usr (r13_usr), signed 32 bits
++ 150: r14_usr (r14_usr), signed 32 bits
++ 151: r8_fiq (r8_fiq), signed 32 bits
++ 152: r9_fiq (r9_fiq), signed 32 bits
++ 153: r10_fiq (r10_fiq), signed 32 bits
++ 154: r11_fiq (r11_fiq), signed 32 bits
++ 155: r12_fiq (r12_fiq), signed 32 bits
++ 156: r13_fiq (r13_fiq), signed 32 bits
++ 157: r14_fiq (r14_fiq), signed 32 bits
++ 158: r13_irq (r13_irq), signed 32 bits
++ 159: r14_irq (r14_irq), signed 32 bits
++ 160: r13_abt (r13_abt), signed 32 bits
++ 161: r14_abt (r14_abt), signed 32 bits
++ 162: r13_und (r13_und), signed 32 bits
++ 163: r14_und (r14_und), signed 32 bits
++ 164: r13_svc (r13_svc), signed 32 bits
++ 165: r14_svc (r14_svc), signed 32 bits
+ FPA registers:
+ 16: f0 (f0), float 96 bits
+ 17: f1 (f1), float 96 bits
+@@ -2690,7 +2711,72 @@ FPA registers:
+ 101: f5 (f5), float 96 bits
+ 102: f6 (f6), float 96 bits
+ 103: f7 (f7), float 96 bits
++MMX registers:
++ 104: wcgr0 (wcgr0), unsigned 32 bits
++ 105: wcgr1 (wcgr1), unsigned 32 bits
++ 106: wcgr2 (wcgr2), unsigned 32 bits
++ 107: wcgr3 (wcgr3), unsigned 32 bits
++ 108: wcgr4 (wcgr4), unsigned 32 bits
++ 109: wcgr5 (wcgr5), unsigned 32 bits
++ 110: wcgr6 (wcgr6), unsigned 32 bits
++ 111: wcgr7 (wcgr7), unsigned 32 bits
++ 112: wr0 (wr0), unsigned 64 bits
++ 113: wr1 (wr1), unsigned 64 bits
++ 114: wr2 (wr2), unsigned 64 bits
++ 115: wr3 (wr3), unsigned 64 bits
++ 116: wr4 (wr4), unsigned 64 bits
++ 117: wr5 (wr5), unsigned 64 bits
++ 118: wr6 (wr6), unsigned 64 bits
++ 119: wr7 (wr7), unsigned 64 bits
++ 120: wr8 (wr8), unsigned 64 bits
++ 121: wr9 (wr9), unsigned 64 bits
++ 122: wr10 (wr10), unsigned 64 bits
++ 123: wr11 (wr11), unsigned 64 bits
++ 124: wr12 (wr12), unsigned 64 bits
++ 125: wr13 (wr13), unsigned 64 bits
++ 126: wr14 (wr14), unsigned 64 bits
++ 127: wr15 (wr15), unsigned 64 bits
++ 192: wc0 (wc0), unsigned 32 bits
++ 193: wc1 (wc1), unsigned 32 bits
++ 194: wc2 (wc2), unsigned 32 bits
++ 195: wc3 (wc3), unsigned 32 bits
++ 196: wc4 (wc4), unsigned 32 bits
++ 197: wc5 (wc5), unsigned 32 bits
++ 198: wc6 (wc6), unsigned 32 bits
++ 199: wc7 (wc7), unsigned 32 bits
+ VFP registers:
++ 64: s0 (s0), float 32 bits
++ 65: s1 (s1), float 32 bits
++ 66: s2 (s2), float 32 bits
++ 67: s3 (s3), float 32 bits
++ 68: s4 (s4), float 32 bits
++ 69: s5 (s5), float 32 bits
++ 70: s6 (s6), float 32 bits
++ 71: s7 (s7), float 32 bits
++ 72: s8 (s8), float 32 bits
++ 73: s9 (s9), float 32 bits
++ 74: s10 (s10), float 32 bits
++ 75: s11 (s11), float 32 bits
++ 76: s12 (s12), float 32 bits
++ 77: s13 (s13), float 32 bits
++ 78: s14 (s14), float 32 bits
++ 79: s15 (s15), float 32 bits
++ 80: s16 (s16), float 32 bits
++ 81: s17 (s17), float 32 bits
++ 82: s18 (s18), float 32 bits
++ 83: s19 (s19), float 32 bits
++ 84: s20 (s20), float 32 bits
++ 85: s21 (s21), float 32 bits
++ 86: s22 (s22), float 32 bits
++ 87: s23 (s23), float 32 bits
++ 88: s24 (s24), float 32 bits
++ 89: s25 (s25), float 32 bits
++ 90: s26 (s26), float 32 bits
++ 91: s27 (s27), float 32 bits
++ 92: s28 (s28), float 32 bits
++ 93: s29 (s29), float 32 bits
++ 94: s30 (s30), float 32 bits
++ 95: s31 (s31), float 32 bits
+ 256: d0 (d0), float 64 bits
+ 257: d1 (d1), float 64 bits
+ 258: d2 (d2), float 64 bits
+@@ -2723,6 +2809,13 @@ VFP registers:
+ 285: d29 (d29), float 64 bits
+ 286: d30 (d30), float 64 bits
+ 287: d31 (d31), float 64 bits
++state registers:
++ 128: spsr (spsr), unsigned 32 bits
++ 129: spsr_fiq (spsr_fiq), unsigned 32 bits
++ 130: spsr_irq (spsr_irq), unsigned 32 bits
++ 131: spsr_abt (spsr_abt), unsigned 32 bits
++ 132: spsr_und (spsr_und), unsigned 32 bits
++ 133: spsr_svc (spsr_svc), unsigned 32 bits
+ EOF
+
+ # See run-readelf-mixed-corenote.sh for instructions to regenerate
+Index: b/tests/run-readelf-mixed-corenote.sh
+===================================================================
+--- a/tests/run-readelf-mixed-corenote.sh
++++ b/tests/run-readelf-mixed-corenote.sh
+@@ -31,12 +31,11 @@ Note segment of 892 bytes at offset 0x27
+ pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+ utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
+ orig_r0: -1, fpvalid: 1
+- r0: 1 r1: -1091672508 r2: -1091672500
+- r3: 0 r4: 0 r5: 0
+- r6: 33728 r7: 0 r8: 0
+- r9: 0 r10: -1225703496 r11: -1091672844
+- r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48
+- pc: 0x00008500 spsr: 0x60000010
++ r0: 1 r1: -1091672508 r2: -1091672500 r3: 0
++ r4: 0 r5: 0 r6: 33728 r7: 0
++ r8: 0 r9: 0 r10: -1225703496 r11: -1091672844
++ r12: 0 sp: 0xbeee64f4 lr: 0xb6dc3f48 pc: 0x00008500
++ spsr: 0x60000010
+ CORE 124 PRPSINFO
+ state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
+ uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+Index: b/tests/run-addrcfi.sh
+===================================================================
+--- a/tests/run-addrcfi.sh
++++ b/tests/run-addrcfi.sh
+@@ -3554,6 +3554,38 @@ dwarf_cfi_addrframe (.eh_frame): no matc
+ FPA reg21 (f5): undefined
+ FPA reg22 (f6): undefined
+ FPA reg23 (f7): undefined
++ VFP reg64 (s0): undefined
++ VFP reg65 (s1): undefined
++ VFP reg66 (s2): undefined
++ VFP reg67 (s3): undefined
++ VFP reg68 (s4): undefined
++ VFP reg69 (s5): undefined
++ VFP reg70 (s6): undefined
++ VFP reg71 (s7): undefined
++ VFP reg72 (s8): undefined
++ VFP reg73 (s9): undefined
++ VFP reg74 (s10): undefined
++ VFP reg75 (s11): undefined
++ VFP reg76 (s12): undefined
++ VFP reg77 (s13): undefined
++ VFP reg78 (s14): undefined
++ VFP reg79 (s15): undefined
++ VFP reg80 (s16): undefined
++ VFP reg81 (s17): undefined
++ VFP reg82 (s18): undefined
++ VFP reg83 (s19): undefined
++ VFP reg84 (s20): undefined
++ VFP reg85 (s21): undefined
++ VFP reg86 (s22): undefined
++ VFP reg87 (s23): undefined
++ VFP reg88 (s24): undefined
++ VFP reg89 (s25): undefined
++ VFP reg90 (s26): undefined
++ VFP reg91 (s27): undefined
++ VFP reg92 (s28): undefined
++ VFP reg93 (s29): undefined
++ VFP reg94 (s30): undefined
++ VFP reg95 (s31): undefined
+ FPA reg96 (f0): undefined
+ FPA reg97 (f1): undefined
+ FPA reg98 (f2): undefined
+@@ -3562,7 +3594,66 @@ dwarf_cfi_addrframe (.eh_frame): no matc
+ FPA reg101 (f5): undefined
+ FPA reg102 (f6): undefined
+ FPA reg103 (f7): undefined
+- integer reg128 (spsr): undefined
++ MMX reg104 (wcgr0): undefined
++ MMX reg105 (wcgr1): undefined
++ MMX reg106 (wcgr2): undefined
++ MMX reg107 (wcgr3): undefined
++ MMX reg108 (wcgr4): undefined
++ MMX reg109 (wcgr5): undefined
++ MMX reg110 (wcgr6): undefined
++ MMX reg111 (wcgr7): undefined
++ MMX reg112 (wr0): undefined
++ MMX reg113 (wr1): undefined
++ MMX reg114 (wr2): undefined
++ MMX reg115 (wr3): undefined
++ MMX reg116 (wr4): undefined
++ MMX reg117 (wr5): undefined
++ MMX reg118 (wr6): undefined
++ MMX reg119 (wr7): undefined
++ MMX reg120 (wr8): undefined
++ MMX reg121 (wr9): undefined
++ MMX reg122 (wr10): undefined
++ MMX reg123 (wr11): undefined
++ MMX reg124 (wr12): undefined
++ MMX reg125 (wr13): undefined
++ MMX reg126 (wr14): undefined
++ MMX reg127 (wr15): undefined
++ state reg128 (spsr): undefined
++ state reg129 (spsr_fiq): undefined
++ state reg130 (spsr_irq): undefined
++ state reg131 (spsr_abt): undefined
++ state reg132 (spsr_und): undefined
++ state reg133 (spsr_svc): undefined
++ integer reg144 (r8_usr): undefined
++ integer reg145 (r9_usr): undefined
++ integer reg146 (r10_usr): undefined
++ integer reg147 (r11_usr): undefined
++ integer reg148 (r12_usr): undefined
++ integer reg149 (r13_usr): undefined
++ integer reg150 (r14_usr): undefined
++ integer reg151 (r8_fiq): undefined
++ integer reg152 (r9_fiq): undefined
++ integer reg153 (r10_fiq): undefined
++ integer reg154 (r11_fiq): undefined
++ integer reg155 (r12_fiq): undefined
++ integer reg156 (r13_fiq): undefined
++ integer reg157 (r14_fiq): undefined
++ integer reg158 (r13_irq): undefined
++ integer reg159 (r14_irq): undefined
++ integer reg160 (r13_abt): undefined
++ integer reg161 (r14_abt): undefined
++ integer reg162 (r13_und): undefined
++ integer reg163 (r14_und): undefined
++ integer reg164 (r13_svc): undefined
++ integer reg165 (r14_svc): undefined
++ MMX reg192 (wc0): undefined
++ MMX reg193 (wc1): undefined
++ MMX reg194 (wc2): undefined
++ MMX reg195 (wc3): undefined
++ MMX reg196 (wc4): undefined
++ MMX reg197 (wc5): undefined
++ MMX reg198 (wc6): undefined
++ MMX reg199 (wc7): undefined
+ VFP reg256 (d0): undefined
+ VFP reg257 (d1): undefined
+ VFP reg258 (d2): undefined
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff b/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff
new file mode 100644
index 000000000..56f852a41
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/hppa_backend.diff
@@ -0,0 +1,802 @@
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: elfutils-0.170/backends/parisc_init.c
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/parisc_init.c
+@@ -0,0 +1,73 @@
++/* Initialization of PA-RISC specific backend library.
++ Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++ Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND parisc_
++#define RELOC_PREFIX R_PARISC_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* This defines the common reloc hooks based on parisc_reloc.def. */
++#include "common-reloc.c"
++
++
++const char *
++parisc_init (Elf *elf __attribute__ ((unused)),
++ GElf_Half machine __attribute__ ((unused)),
++ Ebl *eh,
++ size_t ehlen)
++{
++ int pa64 = 0;
++
++ /* Check whether the Elf_BH object has a sufficent size. */
++ if (ehlen < sizeof (Ebl))
++ return NULL;
++
++ if (elf) {
++ GElf_Ehdr ehdr_mem;
++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++ if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
++ pa64 = 1;
++ }
++ /* We handle it. */
++ eh->name = "PA-RISC";
++ parisc_init_reloc (eh);
++ HOOK (eh, reloc_simple_type);
++ HOOK (eh, machine_flag_check);
++ HOOK (eh, symbol_type_name);
++ HOOK (eh, segment_type_name);
++ HOOK (eh, section_type_name);
++ HOOK (eh, register_info);
++ if (pa64)
++ eh->return_value_location = parisc_return_value_location_64;
++ else
++ eh->return_value_location = parisc_return_value_location_32;
++
++ return MODVERSION;
++}
+Index: elfutils-0.170/backends/parisc_regs.c
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/parisc_regs.c
+@@ -0,0 +1,159 @@
++/* Register names and numbers for PA-RISC DWARF.
++ Copyright (C) 2005, 2006 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++
++ssize_t
++parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
++ const char **prefix, const char **setname,
++ int *bits, int *type)
++{
++ int pa64 = 0;
++
++ if (ebl->elf) {
++ GElf_Ehdr ehdr_mem;
++ GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
++ if (ehdr->e_flags & EF_PARISC_WIDE)
++ pa64 = 1;
++ }
++
++ int nregs = pa64 ? 127 : 128;
++
++ if (name == NULL)
++ return nregs;
++
++ if (regno < 0 || regno >= nregs || namelen < 6)
++ return -1;
++
++ *prefix = "%";
++
++ if (regno < 32)
++ {
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ if (pa64)
++ {
++ *bits = 64;
++ }
++ else
++ {
++ *bits = 32;
++ }
++ }
++ else if (regno == 32)
++ {
++ *setname = "special";
++ if (pa64)
++ {
++ *bits = 6;
++ }
++ else
++ {
++ *bits = 5;
++ }
++ *type = DW_ATE_unsigned;
++ }
++ else
++ {
++ *setname = "FPU";
++ *type = DW_ATE_float;
++ if (pa64)
++ {
++ *bits = 64;
++ }
++ else
++ {
++ *bits = 32;
++ }
++ }
++
++ if (regno < 33) {
++ switch (regno)
++ {
++ case 0 ... 9:
++ name[0] = 'r';
++ name[1] = regno + '0';
++ namelen = 2;
++ break;
++ case 10 ... 31:
++ name[0] = 'r';
++ name[1] = regno / 10 + '0';
++ name[2] = regno % 10 + '0';
++ namelen = 3;
++ break;
++ case 32:
++ *prefix = NULL;
++ name[0] = 'S';
++ name[1] = 'A';
++ name[2] = 'R';
++ namelen = 3;
++ break;
++ }
++ }
++ else {
++ if (pa64 && ((regno - 72) % 2)) {
++ *setname = NULL;
++ return 0;
++ }
++
++ switch (regno)
++ {
++ case 72 + 0 ... 72 + 11:
++ name[0] = 'f';
++ name[1] = 'r';
++ name[2] = (regno + 8 - 72) / 2 + '0';
++ namelen = 3;
++ if ((regno + 8 - 72) % 2) {
++ name[3] = 'R';
++ namelen++;
++ }
++ break;
++ case 72 + 12 ... 72 + 55:
++ name[0] = 'f';
++ name[1] = 'r';
++ name[2] = (regno + 8 - 72) / 2 / 10 + '0';
++ name[3] = (regno + 8 - 72) / 2 % 10 + '0';
++ namelen = 4;
++ if ((regno + 8 - 72) % 2) {
++ name[4] = 'R';
++ namelen++;
++ }
++ break;
++ default:
++ *setname = NULL;
++ return 0;
++ }
++ }
++ name[namelen++] = '\0';
++ return namelen;
++}
+Index: elfutils-0.170/backends/parisc_reloc.def
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/parisc_reloc.def
+@@ -0,0 +1,128 @@
++/* List the relocation types for PA-RISC. -*- C -*-
++ Copyright (C) 2005 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++/* NAME, REL|EXEC|DYN */
++
++RELOC_TYPE (NONE, EXEC|DYN)
++RELOC_TYPE (DIR32, REL|EXEC|DYN)
++RELOC_TYPE (DIR21L, REL|EXEC|DYN)
++RELOC_TYPE (DIR17R, REL)
++RELOC_TYPE (DIR17F, REL)
++RELOC_TYPE (DIR14R, REL|DYN)
++RELOC_TYPE (PCREL32, REL)
++RELOC_TYPE (PCREL21L, REL)
++RELOC_TYPE (PCREL17R, REL)
++RELOC_TYPE (PCREL17F, REL)
++RELOC_TYPE (PCREL14R, REL|EXEC)
++RELOC_TYPE (DPREL21L, REL)
++RELOC_TYPE (DPREL14WR, REL)
++RELOC_TYPE (DPREL14DR, REL)
++RELOC_TYPE (DPREL14R, REL)
++RELOC_TYPE (GPREL21L, 0)
++RELOC_TYPE (GPREL14R, 0)
++RELOC_TYPE (LTOFF21L, REL)
++RELOC_TYPE (LTOFF14R, REL)
++RELOC_TYPE (DLTIND14F, 0)
++RELOC_TYPE (SETBASE, 0)
++RELOC_TYPE (SECREL32, REL)
++RELOC_TYPE (BASEREL21L, 0)
++RELOC_TYPE (BASEREL17R, 0)
++RELOC_TYPE (BASEREL14R, 0)
++RELOC_TYPE (SEGBASE, 0)
++RELOC_TYPE (SEGREL32, REL)
++RELOC_TYPE (PLTOFF21L, 0)
++RELOC_TYPE (PLTOFF14R, 0)
++RELOC_TYPE (PLTOFF14F, 0)
++RELOC_TYPE (LTOFF_FPTR32, 0)
++RELOC_TYPE (LTOFF_FPTR21L, 0)
++RELOC_TYPE (LTOFF_FPTR14R, 0)
++RELOC_TYPE (FPTR64, 0)
++RELOC_TYPE (PLABEL32, REL|DYN)
++RELOC_TYPE (PCREL64, 0)
++RELOC_TYPE (PCREL22C, 0)
++RELOC_TYPE (PCREL22F, 0)
++RELOC_TYPE (PCREL14WR, 0)
++RELOC_TYPE (PCREL14DR, 0)
++RELOC_TYPE (PCREL16F, 0)
++RELOC_TYPE (PCREL16WF, 0)
++RELOC_TYPE (PCREL16DF, 0)
++RELOC_TYPE (DIR64, REL|DYN)
++RELOC_TYPE (DIR14WR, REL)
++RELOC_TYPE (DIR14DR, REL)
++RELOC_TYPE (DIR16F, REL)
++RELOC_TYPE (DIR16WF, REL)
++RELOC_TYPE (DIR16DF, REL)
++RELOC_TYPE (GPREL64, 0)
++RELOC_TYPE (GPREL14WR, 0)
++RELOC_TYPE (GPREL14DR, 0)
++RELOC_TYPE (GPREL16F, 0)
++RELOC_TYPE (GPREL16WF, 0)
++RELOC_TYPE (GPREL16DF, 0)
++RELOC_TYPE (LTOFF64, 0)
++RELOC_TYPE (LTOFF14WR, 0)
++RELOC_TYPE (LTOFF14DR, 0)
++RELOC_TYPE (LTOFF16F, 0)
++RELOC_TYPE (LTOFF16WF, 0)
++RELOC_TYPE (LTOFF16DF, 0)
++RELOC_TYPE (SECREL64, 0)
++RELOC_TYPE (BASEREL14WR, 0)
++RELOC_TYPE (BASEREL14DR, 0)
++RELOC_TYPE (SEGREL64, 0)
++RELOC_TYPE (PLTOFF14WR, 0)
++RELOC_TYPE (PLTOFF14DR, 0)
++RELOC_TYPE (PLTOFF16F, 0)
++RELOC_TYPE (PLTOFF16WF, 0)
++RELOC_TYPE (PLTOFF16DF, 0)
++RELOC_TYPE (LTOFF_FPTR64, 0)
++RELOC_TYPE (LTOFF_FPTR14WR, 0)
++RELOC_TYPE (LTOFF_FPTR14DR, 0)
++RELOC_TYPE (LTOFF_FPTR16F, 0)
++RELOC_TYPE (LTOFF_FPTR16WF, 0)
++RELOC_TYPE (LTOFF_FPTR16DF, 0)
++RELOC_TYPE (COPY, EXEC)
++RELOC_TYPE (IPLT, EXEC|DYN)
++RELOC_TYPE (EPLT, 0)
++RELOC_TYPE (TPREL32, DYN)
++RELOC_TYPE (TPREL21L, 0)
++RELOC_TYPE (TPREL14R, 0)
++RELOC_TYPE (LTOFF_TP21L, 0)
++RELOC_TYPE (LTOFF_TP14R, 0)
++RELOC_TYPE (LTOFF_TP14F, 0)
++RELOC_TYPE (TPREL64, 0)
++RELOC_TYPE (TPREL14WR, 0)
++RELOC_TYPE (TPREL14DR, 0)
++RELOC_TYPE (TPREL16F, 0)
++RELOC_TYPE (TPREL16WF, 0)
++RELOC_TYPE (TPREL16DF, 0)
++RELOC_TYPE (LTOFF_TP64, 0)
++RELOC_TYPE (LTOFF_TP14WR, 0)
++RELOC_TYPE (LTOFF_TP14DR, 0)
++RELOC_TYPE (LTOFF_TP16F, 0)
++RELOC_TYPE (LTOFF_TP16WF, 0)
++RELOC_TYPE (LTOFF_TP16DF, 0)
++RELOC_TYPE (TLS_DTPMOD32, DYN)
++RELOC_TYPE (TLS_DTPMOD64, DYN)
++
++#define NO_RELATIVE_RELOC 1
+Index: elfutils-0.170/backends/parisc_retval.c
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/parisc_retval.c
+@@ -0,0 +1,213 @@
++/* Function return value location for Linux/PA-RISC ABI.
++ Copyright (C) 2005 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <assert.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* %r28, or pair %r28, %r29. */
++static const Dwarf_Op loc_intreg32[] =
++ {
++ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
++ };
++
++static const Dwarf_Op loc_intreg[] =
++ {
++ { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
++ { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
++ };
++#define nloc_intreg 1
++#define nloc_intregpair 4
++
++/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
++static const Dwarf_Op loc_fpreg32[] =
++ {
++ { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
++ };
++#define nloc_fpreg32 2
++#define nloc_fpregpair32 4
++
++/* $fr4 */
++static const Dwarf_Op loc_fpreg[] =
++ {
++ { .atom = DW_OP_regx, .number = 72 },
++ };
++#define nloc_fpreg 1
++
++#if 0
++/* The return value is a structure and is actually stored in stack space
++ passed in a hidden argument by the caller. Address of the location is stored
++ in %r28 before function call, but it may be changed by function. */
++static const Dwarf_Op loc_aggregate[] =
++ {
++ { .atom = DW_OP_breg28 },
++ };
++#define nloc_aggregate 1
++#endif
++
++static int
++parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
++{
++ Dwarf_Word regsize = pa64 ? 8 : 4;
++
++ /* Start with the function's type, and get the DW_AT_type attribute,
++ which is the type of the return value. */
++
++ Dwarf_Attribute attr_mem;
++ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++ if (attr == NULL)
++ /* The function has no return value, like a `void' function in C. */
++ return 0;
++
++ Dwarf_Die die_mem;
++ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++ int tag = dwarf_tag (typedie);
++
++ /* Follow typedefs and qualifiers to get to the actual type. */
++ while (tag == DW_TAG_typedef
++ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++ || tag == DW_TAG_restrict_type)
++ {
++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++ typedie = dwarf_formref_die (attr, &die_mem);
++ tag = dwarf_tag (typedie);
++ }
++
++ switch (tag)
++ {
++ case -1:
++ return -1;
++
++ case DW_TAG_subrange_type:
++ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++ {
++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++ typedie = dwarf_formref_die (attr, &die_mem);
++ tag = dwarf_tag (typedie);
++ }
++ /* Fall through. */
++
++ case DW_TAG_base_type:
++ case DW_TAG_enumeration_type:
++ case DW_TAG_pointer_type:
++ case DW_TAG_ptr_to_member_type:
++ {
++ Dwarf_Word size;
++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++ &attr_mem), &size) != 0)
++ {
++ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++ size = 4;
++ else
++ return -1;
++ }
++ if (tag == DW_TAG_base_type)
++ {
++ Dwarf_Word encoding;
++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++ &attr_mem), &encoding) != 0)
++ return -1;
++
++ if (encoding == DW_ATE_float)
++ {
++ if (pa64) {
++ *locp = loc_fpreg;
++ if (size <= 8)
++ return nloc_fpreg;
++ }
++ else {
++ *locp = loc_fpreg32;
++ if (size <= 4)
++ return nloc_fpreg32;
++ else if (size <= 8)
++ return nloc_fpregpair32;
++ }
++ goto aggregate;
++ }
++ }
++ if (pa64)
++ *locp = loc_intreg;
++ else
++ *locp = loc_intreg32;
++ if (size <= regsize)
++ return nloc_intreg;
++ if (size <= 2 * regsize)
++ return nloc_intregpair;
++
++ /* Else fall through. */
++ }
++
++ case DW_TAG_structure_type:
++ case DW_TAG_class_type:
++ case DW_TAG_union_type:
++ case DW_TAG_array_type:
++ aggregate: {
++ Dwarf_Word size;
++ if (dwarf_aggregate_size (typedie, &size) != 0)
++ return -1;
++ if (pa64)
++ *locp = loc_intreg;
++ else
++ *locp = loc_intreg32;
++ if (size <= regsize)
++ return nloc_intreg;
++ if (size <= 2 * regsize)
++ return nloc_intregpair;
++#if 0
++ /* there should be some way to know this location... But I do not see it. */
++ *locp = loc_aggregate;
++ return nloc_aggregate;
++#endif
++ /* fall through. */
++ }
++ }
++
++ /* XXX We don't have a good way to return specific errors from ebl calls.
++ This value means we do not understand the type, but it is well-formed
++ DWARF and might be valid. */
++ return -2;
++}
++
++int
++parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ return parisc_return_value_location_ (functypedie, locp, 0);
++}
++
++int
++parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ return parisc_return_value_location_ (functypedie, locp, 1);
++}
++
+Index: elfutils-0.170/backends/parisc_symbol.c
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/parisc_symbol.c
+@@ -0,0 +1,112 @@
++/* PA-RISC specific symbolic name handling.
++ Copyright (C) 2002, 2005 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++ Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++
++const char *
++parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
++ size_t len __attribute__ ((unused)))
++{
++ switch (segment)
++ {
++ case PT_PARISC_ARCHEXT:
++ return "PARISC_ARCHEXT";
++ case PT_PARISC_UNWIND:
++ return "PARISC_UNWIND";
++ default:
++ break;
++ }
++ return NULL;
++}
++
++/* Return symbolic representation of symbol type. */
++const char *
++parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
++ size_t len __attribute__ ((unused)))
++{
++ if (symbol == STT_PARISC_MILLICODE)
++ return "PARISC_MILLI";
++ return NULL;
++}
++
++/* Return symbolic representation of section type. */
++const char *
++parisc_section_type_name (int type,
++ char *buf __attribute__ ((unused)),
++ size_t len __attribute__ ((unused)))
++{
++ switch (type)
++ {
++ case SHT_PARISC_EXT:
++ return "PARISC_EXT";
++ case SHT_PARISC_UNWIND:
++ return "PARISC_UNWIND";
++ case SHT_PARISC_DOC:
++ return "PARISC_DOC";
++ }
++
++ return NULL;
++}
++
++/* Check whether machine flags are valid. */
++bool
++parisc_machine_flag_check (GElf_Word flags)
++{
++ if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
++ EF_PARISC_WIDE | EF_PARISC_NO_KABP |
++ EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
++ return 0;
++
++ GElf_Word arch = flags & EF_PARISC_ARCH;
++
++ return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
++ (arch == EFA_PARISC_2_0));
++}
++
++/* Check for the simple reloc types. */
++Elf_Type
++parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++ switch (type)
++ {
++ case R_PARISC_DIR64:
++ case R_PARISC_SECREL64:
++ return ELF_T_XWORD;
++ case R_PARISC_DIR32:
++ case R_PARISC_SECREL32:
++ return ELF_T_WORD;
++ default:
++ return ELF_T_NUM;
++ }
++}
+Index: elfutils-0.170/backends/libebl_parisc.h
+===================================================================
+--- /dev/null
++++ elfutils-0.170/backends/libebl_parisc.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_HPPA_H
++#define _LIBEBL_HPPA_H 1
++
++#include <libdw.h>
++
++extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
++extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: elfutils-0.170/backends/Makefile.am
+===================================================================
+--- elfutils-0.170.orig/backends/Makefile.am
++++ elfutils-0.170/backends/Makefile.am
+@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I
+
+
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+- tilegx m68k bpf
++ tilegx m68k bpf parisc
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
+ libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
+ libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+- libebl_m68k_pic.a libebl_bpf_pic.a
++ libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -124,6 +124,9 @@ cpu_bpf = ../libcpu/libcpu_bpf.a
+ libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
+ am_libebl_bpf_pic_a_OBJECTS = $(bpf_SRCS:.c=.os)
+
++parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
++libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
++am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu)
+ @rm -f $(@:.so=.map)
+Index: elfutils-0.170/libelf/elf.h
+===================================================================
+--- elfutils-0.170.orig/libelf/elf.h
++++ elfutils-0.170/libelf/elf.h
+@@ -2056,16 +2056,24 @@ enum
+ #define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */
+ #define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */
+ #define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */
++#define R_PARISC_DPREL14WR 19
++#define R_PARISC_DPREL14DR 20
+ #define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */
+ #define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */
+ #define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */
+ #define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */
+ #define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */
++#define R_PARISC_DLTIND14F 39
++#define R_PARISC_SETBASE 40
+ #define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */
++#define R_PARISC_BASEREL21L 42
++#define R_PARISC_BASEREL17R 43
++#define R_PARISC_BASEREL14R 46
+ #define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */
+ #define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */
+ #define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */
+ #define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */
++#define R_PARISC_PLTOFF14F 55
+ #define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */
+ #define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */
+ #define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */
+@@ -2074,6 +2082,7 @@ enum
+ #define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */
+ #define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */
+ #define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */
++#define R_PARISC_PCREL22C 73
+ #define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */
+ #define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */
+ #define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */
+@@ -2099,6 +2108,8 @@ enum
+ #define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */
+ #define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */
+ #define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */
++#define R_PARISC_BASEREL14WR 107
++#define R_PARISC_BASEREL14DR 108
+ #define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */
+ #define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */
+ #define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch b/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch
new file mode 100644
index 000000000..2e0e54b0c
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/mips_backend.patch
@@ -0,0 +1,715 @@
+From 46d0d0ca718093486eeeedf1b44134e9e29b56f7 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Aug 2017 09:18:59 +0800
+Subject: [PATCH] mips backends
+
+Upstream-Status: Backport [from debian]
+
+Rebase to 0.170
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/Makefile.am | 8 +-
+ backends/mips_init.c | 59 +++++++++
+ backends/mips_regs.c | 104 ++++++++++++++++
+ backends/mips_reloc.def | 79 ++++++++++++
+ backends/mips_retval.c | 321 ++++++++++++++++++++++++++++++++++++++++++++++++
+ backends/mips_symbol.c | 52 ++++++++
+ libebl/eblopenbackend.c | 2 +
+ 7 files changed, 623 insertions(+), 2 deletions(-)
+ create mode 100644 backends/mips_init.c
+ create mode 100644 backends/mips_regs.c
+ create mode 100644 backends/mips_reloc.def
+ create mode 100644 backends/mips_retval.c
+ create mode 100644 backends/mips_symbol.c
+
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index 7f1f5d4..91baf6e 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -33,12 +33,12 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
+
+
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+- tilegx m68k bpf parisc
++ tilegx m68k bpf parisc mips
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
+ libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
+ libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+- libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a
++ libebl_m68k_pic.a libebl_bpf_pic.a libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+
+@@ -128,6 +128,10 @@ parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
+ libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
+ am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++libebl_mips_pic_a_SOURCES = $(mips_SRCS)
++am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw) $(libeu)
+ @rm -f $(@:.so=.map)
+ $(AM_V_at)echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+diff --git a/backends/mips_init.c b/backends/mips_init.c
+new file mode 100644
+index 0000000..975c04e
+--- /dev/null
++++ b/backends/mips_init.c
+@@ -0,0 +1,59 @@
++/* Initialization of mips specific backend library.
++ Copyright (C) 2006 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND mips_
++#define RELOC_PREFIX R_MIPS_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on mips_reloc.def. */
++#include "common-reloc.c"
++
++const char *
++mips_init (Elf *elf __attribute__ ((unused)),
++ GElf_Half machine __attribute__ ((unused)),
++ Ebl *eh,
++ size_t ehlen)
++{
++ /* Check whether the Elf_BH object has a sufficent size. */
++ if (ehlen < sizeof (Ebl))
++ return NULL;
++
++ /* We handle it. */
++ if (machine == EM_MIPS)
++ eh->name = "MIPS R3000 big-endian";
++ else if (machine == EM_MIPS_RS3_LE)
++ eh->name = "MIPS R3000 little-endian";
++
++ mips_init_reloc (eh);
++ HOOK (eh, reloc_simple_type);
++ HOOK (eh, return_value_location);
++ HOOK (eh, register_info);
++
++ return MODVERSION;
++}
+diff --git a/backends/mips_regs.c b/backends/mips_regs.c
+new file mode 100644
+index 0000000..44f86cb
+--- /dev/null
++++ b/backends/mips_regs.c
+@@ -0,0 +1,104 @@
++/* Register names and numbers for MIPS DWARF.
++ Copyright (C) 2006 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++ssize_t
++mips_register_info (Ebl *ebl __attribute__((unused)),
++ int regno, char *name, size_t namelen,
++ const char **prefix, const char **setname,
++ int *bits, int *type)
++{
++ if (name == NULL)
++ return 66;
++
++ if (regno < 0 || regno > 65 || namelen < 4)
++ return -1;
++
++ *prefix = "$";
++
++ if (regno < 32)
++ {
++ *setname = "integer";
++ *type = DW_ATE_signed;
++ *bits = 32;
++ if (regno < 32 + 10)
++ {
++ name[0] = regno + '0';
++ namelen = 1;
++ }
++ else
++ {
++ name[0] = (regno / 10) + '0';
++ name[1] = (regno % 10) + '0';
++ namelen = 2;
++ }
++ }
++ else if (regno < 64)
++ {
++ *setname = "FPU";
++ *type = DW_ATE_float;
++ *bits = 32;
++ name[0] = 'f';
++ if (regno < 32 + 10)
++ {
++ name[1] = (regno - 32) + '0';
++ namelen = 2;
++ }
++ else
++ {
++ name[1] = (regno - 32) / 10 + '0';
++ name[2] = (regno - 32) % 10 + '0';
++ namelen = 3;
++ }
++ }
++ else if (regno == 64)
++ {
++ *type = DW_ATE_signed;
++ *bits = 32;
++ name[0] = 'h';
++ name[1] = 'i';
++ namelen = 2;
++ }
++ else
++ {
++ *type = DW_ATE_signed;
++ *bits = 32;
++ name[0] = 'l';
++ name[1] = 'o';
++ namelen = 2;
++ }
++
++ name[namelen++] = '\0';
++ return namelen;
++}
+diff --git a/backends/mips_reloc.def b/backends/mips_reloc.def
+new file mode 100644
+index 0000000..4579970
+--- /dev/null
++++ b/backends/mips_reloc.def
+@@ -0,0 +1,79 @@
++/* List the relocation types for mips. -*- C -*-
++ Copyright (C) 2006 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++/* NAME, REL|EXEC|DYN */
++
++RELOC_TYPE (NONE, 0)
++RELOC_TYPE (16, 0)
++RELOC_TYPE (32, 0)
++RELOC_TYPE (REL32, 0)
++RELOC_TYPE (26, 0)
++RELOC_TYPE (HI16, 0)
++RELOC_TYPE (LO16, 0)
++RELOC_TYPE (GPREL16, 0)
++RELOC_TYPE (LITERAL, 0)
++RELOC_TYPE (GOT16, 0)
++RELOC_TYPE (PC16, 0)
++RELOC_TYPE (CALL16, 0)
++RELOC_TYPE (GPREL32, 0)
++
++RELOC_TYPE (SHIFT5, 0)
++RELOC_TYPE (SHIFT6, 0)
++RELOC_TYPE (64, 0)
++RELOC_TYPE (GOT_DISP, 0)
++RELOC_TYPE (GOT_PAGE, 0)
++RELOC_TYPE (GOT_OFST, 0)
++RELOC_TYPE (GOT_HI16, 0)
++RELOC_TYPE (GOT_LO16, 0)
++RELOC_TYPE (SUB, 0)
++RELOC_TYPE (INSERT_A, 0)
++RELOC_TYPE (INSERT_B, 0)
++RELOC_TYPE (DELETE, 0)
++RELOC_TYPE (HIGHER, 0)
++RELOC_TYPE (HIGHEST, 0)
++RELOC_TYPE (CALL_HI16, 0)
++RELOC_TYPE (CALL_LO16, 0)
++RELOC_TYPE (SCN_DISP, 0)
++RELOC_TYPE (REL16, 0)
++RELOC_TYPE (ADD_IMMEDIATE, 0)
++RELOC_TYPE (PJUMP, 0)
++RELOC_TYPE (RELGOT, 0)
++RELOC_TYPE (JALR, 0)
++RELOC_TYPE (TLS_DTPMOD32, 0)
++RELOC_TYPE (TLS_DTPREL32, 0)
++RELOC_TYPE (TLS_DTPMOD64, 0)
++RELOC_TYPE (TLS_DTPREL64, 0)
++RELOC_TYPE (TLS_GD, 0)
++RELOC_TYPE (TLS_LDM, 0)
++RELOC_TYPE (TLS_DTPREL_HI16, 0)
++RELOC_TYPE (TLS_DTPREL_LO16, 0)
++RELOC_TYPE (TLS_GOTTPREL, 0)
++RELOC_TYPE (TLS_TPREL32, 0)
++RELOC_TYPE (TLS_TPREL64, 0)
++RELOC_TYPE (TLS_TPREL_HI16, 0)
++RELOC_TYPE (TLS_TPREL_LO16, 0)
++
++#define NO_COPY_RELOC 1
++#define NO_RELATIVE_RELOC 1
+diff --git a/backends/mips_retval.c b/backends/mips_retval.c
+new file mode 100644
+index 0000000..656cd1f
+--- /dev/null
++++ b/backends/mips_retval.c
+@@ -0,0 +1,321 @@
++/* Function return value location for Linux/mips ABI.
++ Copyright (C) 2005 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <assert.h>
++#include <dwarf.h>
++#include <elf.h>
++
++#include "../libebl/libeblP.h"
++#include "../libdw/libdwP.h"
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++/* The ABI of the file. Also see EF_MIPS_ABI2 above. */
++#define EF_MIPS_ABI 0x0000F000
++
++/* The original o32 abi. */
++#define E_MIPS_ABI_O32 0x00001000
++
++/* O32 extended to work on 64 bit architectures */
++#define E_MIPS_ABI_O64 0x00002000
++
++/* EABI in 32 bit mode */
++#define E_MIPS_ABI_EABI32 0x00003000
++
++/* EABI in 64 bit mode */
++#define E_MIPS_ABI_EABI64 0x00004000
++
++/* All the possible MIPS ABIs. */
++enum mips_abi
++ {
++ MIPS_ABI_UNKNOWN = 0,
++ MIPS_ABI_N32,
++ MIPS_ABI_O32,
++ MIPS_ABI_N64,
++ MIPS_ABI_O64,
++ MIPS_ABI_EABI32,
++ MIPS_ABI_EABI64,
++ MIPS_ABI_LAST
++ };
++
++/* Find the mips ABI of the current file */
++enum mips_abi find_mips_abi(Elf *elf)
++{
++ GElf_Ehdr ehdr_mem;
++ GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++
++ if (ehdr == NULL)
++ return MIPS_ABI_LAST;
++
++ GElf_Word elf_flags = ehdr->e_flags;
++
++ /* Check elf_flags to see if it specifies the ABI being used. */
++ switch ((elf_flags & EF_MIPS_ABI))
++ {
++ case E_MIPS_ABI_O32:
++ return MIPS_ABI_O32;
++ case E_MIPS_ABI_O64:
++ return MIPS_ABI_O64;
++ case E_MIPS_ABI_EABI32:
++ return MIPS_ABI_EABI32;
++ case E_MIPS_ABI_EABI64:
++ return MIPS_ABI_EABI64;
++ default:
++ if ((elf_flags & EF_MIPS_ABI2))
++ return MIPS_ABI_N32;
++ }
++
++ /* GCC creates a pseudo-section whose name describes the ABI. */
++ size_t shstrndx;
++ if (elf_getshdrstrndx (elf, &shstrndx) < 0)
++ return MIPS_ABI_LAST;
++
++ const char *name;
++ Elf_Scn *scn = NULL;
++ while ((scn = elf_nextscn (elf, scn)) != NULL)
++ {
++ GElf_Shdr shdr_mem;
++ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
++ if (shdr == NULL)
++ return MIPS_ABI_LAST;
++
++ name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
++ if (strncmp (name, ".mdebug.", 8) != 0)
++ continue;
++
++ if (strcmp (name, ".mdebug.abi32") == 0)
++ return MIPS_ABI_O32;
++ else if (strcmp (name, ".mdebug.abiN32") == 0)
++ return MIPS_ABI_N32;
++ else if (strcmp (name, ".mdebug.abi64") == 0)
++ return MIPS_ABI_N64;
++ else if (strcmp (name, ".mdebug.abiO64") == 0)
++ return MIPS_ABI_O64;
++ else if (strcmp (name, ".mdebug.eabi32") == 0)
++ return MIPS_ABI_EABI32;
++ else if (strcmp (name, ".mdebug.eabi64") == 0)
++ return MIPS_ABI_EABI64;
++ else
++ return MIPS_ABI_UNKNOWN;
++ }
++
++ return MIPS_ABI_UNKNOWN;
++}
++
++unsigned int
++mips_abi_regsize (enum mips_abi abi)
++{
++ switch (abi)
++ {
++ case MIPS_ABI_EABI32:
++ case MIPS_ABI_O32:
++ return 4;
++ case MIPS_ABI_N32:
++ case MIPS_ABI_N64:
++ case MIPS_ABI_O64:
++ case MIPS_ABI_EABI64:
++ return 8;
++ case MIPS_ABI_UNKNOWN:
++ case MIPS_ABI_LAST:
++ default:
++ return 0;
++ }
++}
++
++
++/* $v0 or pair $v0, $v1 */
++static const Dwarf_Op loc_intreg_o32[] =
++ {
++ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
++ };
++
++static const Dwarf_Op loc_intreg[] =
++ {
++ { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
++ { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
++ };
++#define nloc_intreg 1
++#define nloc_intregpair 4
++
++/* $f0 (float), or pair $f0, $f1 (double).
++ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
++static const Dwarf_Op loc_fpreg_o32[] =
++ {
++ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
++ { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
++ };
++
++/* $f0, or pair $f0, $f2. */
++static const Dwarf_Op loc_fpreg[] =
++ {
++ { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
++ { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
++ };
++#define nloc_fpreg 1
++#define nloc_fpregpair 4
++#define nloc_fpregquad 8
++
++/* The return value is a structure and is actually stored in stack space
++ passed in a hidden argument by the caller. But, the compiler
++ helpfully returns the address of that space in $v0. */
++static const Dwarf_Op loc_aggregate[] =
++ {
++ { .atom = DW_OP_breg2, .number = 0 }
++ };
++#define nloc_aggregate 1
++
++int
++mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++ /* First find the ABI used by the elf object */
++ enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
++
++ /* Something went seriously wrong while trying to figure out the ABI */
++ if (abi == MIPS_ABI_LAST)
++ return -1;
++
++ /* We couldn't identify the ABI, but the file seems valid */
++ if (abi == MIPS_ABI_UNKNOWN)
++ return -2;
++
++ /* Can't handle EABI variants */
++ if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
++ return -2;
++
++ unsigned int regsize = mips_abi_regsize (abi);
++ if (!regsize)
++ return -2;
++
++ /* Start with the function's type, and get the DW_AT_type attribute,
++ which is the type of the return value. */
++
++ Dwarf_Attribute attr_mem;
++ Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++ if (attr == NULL)
++ /* The function has no return value, like a `void' function in C. */
++ return 0;
++
++ Dwarf_Die die_mem;
++ Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++ int tag = dwarf_tag (typedie);
++
++ /* Follow typedefs and qualifiers to get to the actual type. */
++ while (tag == DW_TAG_typedef
++ || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++ || tag == DW_TAG_restrict_type)
++ {
++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++ typedie = dwarf_formref_die (attr, &die_mem);
++ tag = dwarf_tag (typedie);
++ }
++
++ switch (tag)
++ {
++ case -1:
++ return -1;
++
++ case DW_TAG_subrange_type:
++ if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++ {
++ attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++ typedie = dwarf_formref_die (attr, &die_mem);
++ tag = dwarf_tag (typedie);
++ }
++ /* Fall through. */
++
++ case DW_TAG_base_type:
++ case DW_TAG_enumeration_type:
++ case DW_TAG_pointer_type:
++ case DW_TAG_ptr_to_member_type:
++ {
++ Dwarf_Word size;
++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++ &attr_mem), &size) != 0)
++ {
++ if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++ size = regsize;
++ else
++ return -1;
++ }
++ if (tag == DW_TAG_base_type)
++ {
++ Dwarf_Word encoding;
++ if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++ &attr_mem), &encoding) != 0)
++ return -1;
++
++#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
++
++ if (encoding == DW_ATE_float)
++ {
++ *locp = ABI_LOC(loc_fpreg, regsize);
++ if (size <= regsize)
++ return nloc_fpreg;
++
++ if (size <= 2*regsize)
++ return nloc_fpregpair;
++
++ if (size <= 4*regsize && abi == MIPS_ABI_O32)
++ return nloc_fpregquad;
++
++ goto aggregate;
++ }
++ }
++ *locp = ABI_LOC(loc_intreg, regsize);
++ if (size <= regsize)
++ return nloc_intreg;
++ if (size <= 2*regsize)
++ return nloc_intregpair;
++
++ /* Else fall through. Shouldn't happen though (at least with gcc) */
++ }
++
++ case DW_TAG_structure_type:
++ case DW_TAG_class_type:
++ case DW_TAG_union_type:
++ case DW_TAG_array_type:
++ aggregate:
++ /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
++ if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
++ return -2;
++
++ *locp = loc_aggregate;
++ return nloc_aggregate;
++ }
++
++ /* XXX We don't have a good way to return specific errors from ebl calls.
++ This value means we do not understand the type, but it is well-formed
++ DWARF and might be valid. */
++ return -2;
++}
+diff --git a/backends/mips_symbol.c b/backends/mips_symbol.c
+new file mode 100644
+index 0000000..ba465fe
+--- /dev/null
++++ b/backends/mips_symbol.c
+@@ -0,0 +1,52 @@
++/* MIPS specific symbolic name handling.
++ Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
++ This file is part of Red Hat elfutils.
++ Written by Jakub Jelinek <jakub@redhat.com>, 2002.
++
++ Red Hat elfutils is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by the
++ Free Software Foundation; version 2 of the License.
++
++ Red Hat elfutils is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with Red Hat elfutils; if not, write to the Free Software Foundation,
++ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++ Red Hat elfutils is an included package of the Open Invention Network.
++ An included package of the Open Invention Network is a package for which
++ Open Invention Network licensees cross-license their patents. No patent
++ license is granted, either expressly or impliedly, by designation as an
++ included package. Should you wish to participate in the Open Invention
++ Network licensing program, please visit www.openinventionnetwork.com
++ <http://www.openinventionnetwork.com>. */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types. */
++Elf_Type
++mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++ switch (type)
++ {
++ case R_MIPS_16:
++ return ELF_T_HALF;
++ case R_MIPS_32:
++ return ELF_T_WORD;
++ case R_MIPS_64:
++ return ELF_T_XWORD;
++ default:
++ return ELF_T_NUM;
++ }
++}
+diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
+index 1f81477..5371396 100644
+--- a/libebl/eblopenbackend.c
++++ b/libebl/eblopenbackend.c
+@@ -72,6 +72,8 @@ static const struct
+ { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
+ { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
+ { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
++ { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
++ { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
+
+ { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
+ { "m68k", "elf_m68k", "m68k", 4, EM_68K, ELFCLASS32, ELFDATA2MSB },
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch b/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch
new file mode 100644
index 000000000..790930cf3
--- /dev/null
+++ b/poky/meta/recipes-devtools/elfutils/files/debian/mips_readelf_w.patch
@@ -0,0 +1,25 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+Subject: Make readelf -w output debug information on mips
+Bug-Debian: http://bugs.debian.org/662041
+Forwarded: not-needed
+
+Upstreams wants a change where this is handled by a hook that needs
+to be filled in by the backend for the arch.
+
+Upstream-Status: Backport [from debian]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Index: b/src/readelf.c
+===================================================================
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -8343,7 +8343,8 @@ print_debug (Dwfl_Module *dwflmod, Ebl *
+ GElf_Shdr shdr_mem;
+ GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+
+- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
++ if (shdr != NULL && (
++ (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
+ {
+ static const struct
+ {
diff --git a/poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch b/poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch
new file mode 100644
index 000000000..af1d8c626
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/0001-Resolve-string-formatting-issues.patch
@@ -0,0 +1,29 @@
+From 107cc370705d8520ba42f1416d89ed3544277c83 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 23 Mar 2017 13:44:41 +0200
+Subject: [PATCH] Resolve string formatting issues.
+
+Upstream-Status: Inappropriate [upstream seems dead]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ exp_clib.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/exp_clib.c b/exp_clib.c
+index 172c05e..809200e 100644
+--- a/exp_clib.c
++++ b/exp_clib.c
+@@ -1476,8 +1476,8 @@ expDiagLogU(str)
+ char *str;
+ {
+ if (exp_is_debugging) {
+- fprintf(stderr,str);
+- if (exp_logfile) fprintf(exp_logfile,str);
++ fprintf(stderr, "%s", str);
++ if (exp_logfile) fprintf(exp_logfile, "%s", str);
+ }
+ }
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch b/poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch
new file mode 100644
index 000000000..7595a254a
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/0001-configure.in.patch
@@ -0,0 +1,108 @@
+Allow cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/configure.in b/configure.in
+--- a/configure.in 2012-12-14 15:31:32.623180450 +0100
++++ b/configure.in 2012-12-14 15:53:34.518233519 +0100
+@@ -481,7 +481,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ AC_MSG_CHECKING([if any value exists for WNOHANG])
+@@ -506,7 +506,9 @@
+ AC_MSG_RESULT(no)
+ AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(yes)
++ AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
++ rm -f wnohang
+ )
+
+ #
+@@ -574,7 +576,8 @@
+ AC_DEFINE(REARM_SIG)
+ ,
+ AC_MSG_RESULT(no)
+-, AC_MSG_WARN([Expect can't be cross compiled])
++,
++ AC_MSG_RESULT(no)
+ )
+
+ # HPUX7 has trouble with the big cat so split it
+@@ -725,7 +728,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(yes)
++ AC_DEFINE(HAVE_SGTTYB)
++ PTY_TYPE=sgttyb
+ )
+
+ # mach systems have include files for unimplemented features
+@@ -749,7 +754,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_TERMIO)
++ PTY_TYPE=termios
++ AC_MSG_RESULT(yes)
+ )
+
+ # now check for the new style ttys (not yet posix)
+@@ -771,7 +778,9 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_TERMIOS)
++ PTY_TYPE=termios
++ AC_MSG_RESULT(yes)
+ )
+ fi
+
+@@ -794,7 +803,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
+@@ -816,7 +825,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ # finally check for Cray style ttys
+@@ -837,7 +846,7 @@
+ ,
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_MSG_RESULT(no)
+ )
+
+ #
+@@ -889,7 +898,8 @@
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no)
+ ,
+- AC_MSG_ERROR([Expect can't be cross compiled])
++ AC_DEFINE(HAVE_SV_TIMEZONE)
++ AC_MSG_RESULT(yes),
+ )
+
+
diff --git a/poky/meta/recipes-devtools/expect/expect/0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch b/poky/meta/recipes-devtools/expect/expect/0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch
new file mode 100644
index 000000000..b1d322d5c
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch
@@ -0,0 +1,91 @@
+From f0049b4b2ea55b3b3c53bf6f0275654801c755d2 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 28 Sep 2017 15:54:55 +0800
+Subject: [PATCH] expect: Fix segfaults if Tcl is built with stubs and Expect
+ is used directly from C program
+
+Description: This dirty hack fixes segfaults if Tcl is built with stubs
+ and Expect is used directly from C program.
+Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588817
+Example:
+ #include <stdio.h>
+ #include <tcl8.5/expect.h>
+ int main()
+ {
+ FILE *pipe;
+ char *some_command = "uname";
+ char datum;
+ pipe = exp_popen(some_command);
+ if (pipe == NULL) return 1;
+ while ((datum = getc (pipe)) != EOF)
+ printf("%c",datum);
+ }
+Example:
+ #include <stdio.h>
+ #include "expect.h"
+ main()
+ {
+ int fd = 0;
+ fd = exp_spawnl("echo", "echo", "Hello User: Whats up?", (char*) 0);
+ switch (exp_expectl(fd, exp_regexp, "ser:", 1, exp_end)) {
+ case 1: {
+ printf("GOT ser:\n");
+ break;
+ }
+ default: {
+ printf("DEFAULT\n");
+ return 1;
+ }
+ }
+ printf("Normal Exit\n");
+ return 0;
+ }
+Author: Sergei Golovan <sgolovan@debian.org>
+
+Upstream-Status: Pending
+This patch is backported from fedora changes for expect:
+http://pkgs.fedoraproject.org/cgit/rpms/expect.git/commit/
+?h=master&id=b6737eed550be93182f2ed194e836a6cbbcf4fa3
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ exp_clib.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/exp_clib.c b/exp_clib.c
+index 172c05e..19341d5 100644
+--- a/exp_clib.c
++++ b/exp_clib.c
+@@ -114,7 +114,11 @@ extern unsigned long strtoul _ANSI_ARGS_((CONST char *string,
+ #include <stdlib.h> /* for malloc */
+ #endif
+
+-#include <tcl.h>
++#define ckalloc(x) Tcl_Alloc(x)
++#define ckfree(x) Tcl_Free(x)
++extern char *Tcl_ErrnoMsg(int err);
++extern char *Tcl_Alloc(unsigned int size);
++extern void Tcl_Free(char *ptr);
+ #include "expect.h"
+ #define TclRegError exp_TclRegError
+
+@@ -389,7 +393,7 @@ char *exp;
+ FAIL("regexp too big");
+
+ /* Allocate space. */
+- r = (regexp *)ckalloc(sizeof(regexp) + (unsigned)rcstate->regsize);
++ r = (regexp *)malloc(sizeof(regexp) + (unsigned)rcstate->regsize);
+ if (r == NULL)
+ FAIL("out of space");
+
+@@ -399,7 +403,7 @@ char *exp;
+ rcstate->regcode = r->program;
+ regc(MAGIC, rcstate);
+ if (reg(0, &flags, rcstate) == NULL) {
+- ckfree ((char*) r);
++ free((char*) r);
+ return(NULL);
+ }
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch b/poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
new file mode 100644
index 000000000..274ad8635
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Inappropriate [wrlinux specific]
+
+Subject: expect: install scripts without using the fixline1 tcl script
+
+On older machines like SLED11.2, we are encountering do_install failures
+complaining that 'GLIBC_2.14' is not found in /lib64/libc.so.6 but is required
+by libtcl8.6.so.0.
+
+This is because that we're executing the fixline1 tcl script which requires
+libtcl8.6.so.0 in sysroot. However, all commands in SCRIPTS already have got
+the correct first line, that is '#!/bin/sh'. We don't need to modify anything.
+That's why we could just copy them.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c05c880..f1394ff 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -380,7 +380,7 @@ dist: dist-clean doc
+ cp $(DIST_ROOT)/$(PKG_DIR).tar.gz $(top_builddir)
+
+ $(SCRIPTS):
+- $(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@
++ cp $(srcdir)/example/$@ $@
+
+ ## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its
+ ## expansion references the contents of LIBS, which contains linker
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch b/poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
new file mode 100644
index 000000000..dc4c6ba40
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
@@ -0,0 +1,17 @@
+Use proper -L path when cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
+--- a/tclconfig/tcl.m4 2012-12-14 09:16:58.789861281 +0100
++++ b/tclconfig/tcl.m4 2012-12-14 10:55:43.542297010 +0100
+@@ -371,7 +371,7 @@
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+- if test -f "${TCL_BIN_DIR}/Makefile" ; then
++ if test -f "${TCL_BIN_DIR}/Makefile" || test "$cross_compiling" = yes; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
diff --git a/poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch b/poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch
new file mode 100644
index 000000000..8597f3138
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect/01-example-shebang.patch
@@ -0,0 +1,144 @@
+Author: Mike Markley <mike@markley.org>
+Author: Sergei Golovan <sgolovan@debian.org>
+Description: Fixes shebangs in examples (Closes: #152367).
+
+Backported from Debian
+
+Upstream-Status: Pending
+Index: expect5.45/example/beer.exp
+===================================================================
+--- expect5.45.orig/example/beer.exp 2006-01-25 13:51:39.000000000 -0800
++++ expect5.45/example/beer.exp 2013-11-01 17:35:19.817318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # 99 bottles of beer on the wall, Expect-style
+ # Author: Don Libes <libes@nist.gov>
+Index: expect5.45/example/expectd.proto
+===================================================================
+--- expect5.45.orig/example/expectd.proto 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/expectd.proto 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/tcl/src/expect/e --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # Description: Simple fragment to begin a telnet daemon
+ # For more information, see Chapter 17 of "Exploring Expect"
+ # Author: Don Libes, NIST
+Index: expect5.45/example/irsh
+===================================================================
+--- expect5.45.orig/example/irsh 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/irsh 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # Do rsh interactively. For example, consider the following command:
+ # rsh <remote> ls -l "|" more
+Index: expect5.45/example/passwd.cgi
+===================================================================
+--- expect5.45.orig/example/passwd.cgi 2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/passwd.cgi 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # This is a CGI script to process requests created by the accompanying
+ # passwd.html form. This script is pretty basic, although it is
+Index: expect5.45/example/passwdprompt
+===================================================================
+--- expect5.45.orig/example/passwdprompt 2003-09-05 12:01:59.000000000 -0700
++++ expect5.45/example/passwdprompt 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # This script prompts for a passwd from stdin while echoing *'s
+
+Index: expect5.45/example/reprompt
+===================================================================
+--- expect5.45.orig/example/reprompt 2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/reprompt 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+ # Name: reprompt
+ # Description: reprompt every so often until user enters something
+Index: expect5.45/example/term_expect
+===================================================================
+--- expect5.45.orig/example/term_expect 2005-02-15 10:11:31.000000000 -0800
++++ expect5.45/example/term_expect 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expectk
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec wish "$0" ${1+"$@"}
++
++package require Expect
+
+ # Name: tkterm - terminal emulator using Expect and Tk text widget, v3.0
+ # Author: Don Libes, July '94
+Index: expect5.45/example/vrfy
+===================================================================
+--- expect5.45.orig/example/vrfy 2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/vrfy 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+
+
+ # separate address into user and host
+Index: expect5.45/example/xrlogin
+===================================================================
+--- expect5.45.orig/example/xrlogin 2000-01-06 15:22:08.000000000 -0800
++++ expect5.45/example/xrlogin 2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # xrlogin - rlogin but with current DISPLAY
+ #
+ # You can extend this idea to save any arbitrary information across rlogin
diff --git a/poky/meta/recipes-devtools/expect/expect_5.45.4.bb b/poky/meta/recipes-devtools/expect/expect_5.45.4.bb
new file mode 100644
index 000000000..96eacd929
--- /dev/null
+++ b/poky/meta/recipes-devtools/expect/expect_5.45.4.bb
@@ -0,0 +1,76 @@
+SUMMARY = "tool for automating interactive applications according to a script"
+DESCRIPTION = "Expect is a tool for automating interactive applications according to a script. \
+Following the script, Expect knows what can be expected from a program and what \
+the correct response should be. Expect is also useful for testing these same \
+applications. And by adding Tk, you can also wrap interactive applications in \
+X11 GUIs. An interpreted language provides branching and high-level control \
+structures to direct the dialogue. In addition, the user can take control and \
+interact directly when desired, afterward returning control to the script. \
+"
+HOMEPAGE = "http://sourceforge.net/projects/expect/"
+LICENSE = "PD"
+SECTION = "devel"
+
+LIC_FILES_CHKSUM = "file://license.terms;md5=fbf2de7e9102505b1439db06fc36ce5c"
+
+DEPENDS += "tcl"
+RDEPENDS_${PN} = "tcl"
+
+inherit autotools update-alternatives
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expect/Expect/${PV}/${BPN}${PV}.tar.gz \
+ file://0001-configure.in.patch \
+ file://0002-tcl.m4.patch \
+ file://01-example-shebang.patch \
+ file://0001-expect-install-scripts-without-using-the-fixline1-tc.patch \
+ file://0001-Resolve-string-formatting-issues.patch \
+ file://0001-expect-Fix-segfaults-if-Tcl-is-built-with-stubs-and-.patch \
+ "
+SRC_URI[md5sum] = "00fce8de158422f5ccd2666512329bd2"
+SRC_URI[sha256sum] = "49a7da83b0bdd9f46d04a04deec19c7767bb9a323e40c4781f89caf760b92c34"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/expect/files/Expect/"
+UPSTREAM_CHECK_REGEX = "/Expect/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/${BPN}${PV}"
+
+do_install_append() {
+ install -d ${D}${libdir}
+ install -m 0755 ${D}${libdir}/expect${PV}/libexpect*.so ${D}${libdir}/
+ install -m 0755 ${S}/fixline1 ${D}${libdir}/expect${PV}/
+ install -m 0755 ${S}/example/* ${D}${libdir}/expect${PV}/
+ rm ${D}${libdir}/expect${PV}/libexpect*.so
+ sed -e 's|$dir|${libdir}|' -i ${D}${libdir}/expect${PV}/pkgIndex.tcl
+}
+
+# Apparently the public Tcl headers are only in /usr/include/tcl8.6
+# when building for the target.
+TCL_INCLUDE_PATH = ""
+TCL_INCLUDE_PATH_class-target = "--with-tclinclude=${STAGING_INCDIR}/tcl8.6"
+
+EXTRA_OECONF += "--with-tcl=${STAGING_LIBDIR} \
+ --enable-shared \
+ --enable-threads \
+ --disable-rpath \
+ ${TCL_INCLUDE_PATH} \
+ "
+EXTRA_OEMAKE_install = " 'SCRIPTS=' "
+
+ALTERNATIVE_${PN} = "mkpasswd"
+ALTERNATIVE_LINK_NAME[mkpasswd] = "${bindir}/mkpasswd"
+# Use lower priority than busybox's mkpasswd (created when built with CONFIG_CRYPTPW)
+ALTERNATIVE_PRIORITY[mkpasswd] = "40"
+
+FILES_${PN}-dev = "${libdir_native}/expect${PV}/libexpect*.so \
+ ${includedir}/expect.h \
+ ${includedir}/expect_tcl.h \
+ ${includedir}/expect_comm.h \
+ ${includedir}/tcldbg.h \
+ ${includedir}/*.h \
+ "
+
+FILES_${PN} += "${libdir}/libexpect${PV}.so \
+ ${libdir}/expect${PV}/* \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.3.bb b/poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.3.bb
new file mode 100644
index 000000000..4d617e3e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.3.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Utility for modifying GPT disk partitioning"
+DESCRIPTION = "GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk, but used for modifying GUID Partition Table (GPT) disks. The related FixParts utility fixes some common problems on Master Boot Record (MBR) disks."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+DEPENDS = "util-linux popt ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz"
+SRC_URI[md5sum] = "07b625a583b66c8c5840be5923f3e3fe"
+SRC_URI[sha256sum] = "89fd5aec35c409d610a36cb49c65b442058565ed84042f767bba614b8fc91b5c"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/gptfdisk/files/gptfdisk/"
+UPSTREAM_CHECK_REGEX = "/gptfdisk/(?P<pver>(\d+[\.\-_]*)+)/"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'CXX=${CXX}'"
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 cgdisk ${D}${sbindir}
+ install -m 0755 gdisk ${D}${sbindir}
+ install -m 0755 sgdisk ${D}${sbindir}
+ install -m 0755 fixparts ${D}${sbindir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch b/poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
new file mode 100644
index 000000000..8a16b2cf7
--- /dev/null
+++ b/poky/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
@@ -0,0 +1,39 @@
+From 08abf944b2bff27b6dd325dd15b4861cebef113a Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Wed, 8 Apr 2015 03:26:57 +0000
+Subject: [PATCH] Add -P prompt into Usage info
+
+Currently, Usage info doesn't include -P prompt, add it:
+
+root@arma9el:~# file
+Usage: file [-bcEhikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
+ [-e testname] [-F separator] [-f namefile] [-m magicfiles]
+ [-P parameter=limits] file ...
+ file -C [-m magicfiles]
+ file [--help]
+
+Upstream-Status: Submitted
+
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+---
+ src/file.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/file.c b/src/file.c
+index 2b15e21..e5a957b 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -76,8 +76,8 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc
+ # define USAGE \
+ "Usage: %s [" FILE_FLAGS \
+ "] [--apple] [--extension] [--mime-encoding] [--mime-type]\n" \
+- " [-e testname] [-F separator] [-f namefile] [-m magicfiles] " \
+- "file ...\n" \
++ " [-e testname] [-F separator] [-f namefile] [-m magicfiles]\n " \
++ " [-P parameter=limits] file ...\n" \
+ " %s -C [-m magicfiles]\n" \
+ " %s [--help]\n"
+
+--
+1.8.3.4
+
diff --git a/poky/meta/recipes-devtools/file/file/debian-742262.patch b/poky/meta/recipes-devtools/file/file/debian-742262.patch
new file mode 100644
index 000000000..319f9dbcf
--- /dev/null
+++ b/poky/meta/recipes-devtools/file/file/debian-742262.patch
@@ -0,0 +1,27 @@
+The awk pattern was checked *before* the Perl pattern, so the
+perl script with BEGIN{...} would be reported as awk, this patch fixes it.
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Rebase on 5.31
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ magic/Magdir/commands | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/magic/Magdir/commands b/magic/Magdir/commands
+index f6ad1c8..f79e7dd 100644
+--- a/magic/Magdir/commands
++++ b/magic/Magdir/commands
+@@ -57,6 +57,7 @@
+ 0 string/wt #!\ /usr/bin/awk awk script text executable
+ !:mime text/x-awk
+ 0 regex/4096 =^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{] awk or perl script text
++!:strength - 12
+
+ # AT&T Bell Labs' Plan 9 shell
+ 0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
diff --git a/poky/meta/recipes-devtools/file/file_5.32.bb b/poky/meta/recipes-devtools/file/file_5.32.bb
new file mode 100644
index 000000000..5e1592512
--- /dev/null
+++ b/poky/meta/recipes-devtools/file/file_5.32.bb
@@ -0,0 +1,48 @@
+SUMMARY = "File classification tool"
+DESCRIPTION = "File attempts to classify files depending \
+on their contents and prints a description if a match is found."
+HOMEPAGE = "http://www.darwinsys.com/file/"
+SECTION = "console/utils"
+
+# two clause BSD
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188"
+
+DEPENDS = "zlib file-replacement-native"
+DEPENDS_class-native = "zlib-native"
+
+# Blacklist a bogus tag in upstream check
+UPSTREAM_CHECK_GITTAGREGEX = "FILE(?P<pver>(?!6_23).+)"
+
+SRC_URI = "git://github.com/file/file.git \
+ file://debian-742262.patch \
+ file://0001-Add-P-prompt-into-Usage-info.patch \
+ "
+
+SRCREV = "d474e35513940dbca039b510b4de705b44f5bd9c"
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OEMAKE_append_class-target = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+EXTRA_OEMAKE_append_class-nativesdk = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+
+CFLAGS_append = " -std=c99"
+
+FILES_${PN} += "${datadir}/misc/*.mgc"
+
+do_install_append_class-native() {
+ create_cmdline_wrapper ${D}/${bindir}/file \
+ --magic-file ${datadir}/misc/magic.mgc
+}
+
+do_install_append_class-nativesdk() {
+ create_cmdline_wrapper ${D}/${bindir}/file \
+ --magic-file ${datadir}/misc/magic.mgc
+}
+
+BBCLASSEXTEND = "native nativesdk"
+PROVIDES_append_class-native = " file-replacement-native"
+# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
+# depends on file-replacement-native.
+bindir_append_class-native = "/file-native"
diff --git a/poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
new file mode 100644
index 000000000..556c240b2
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -0,0 +1,28 @@
+From b4aa18d939fc0c8825fa584dfcee1a7da61099cf Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 10 Dec 2015 16:09:26 +0200
+Subject: [PATCH] tests: add a target for building tests without running them
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/Makefile.am | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 4ac3c17..0025cfe 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -21,6 +21,9 @@
+
+ TESTS = $(check_PROGRAMS) options.cn
+
++# This allows building tests without running them
++buildtests: $(TESTS)
++
+ # The script testwrapper.sh will run most tests as is. A couple tests
+ # in the suite end in .reject, .table and the like so that we can pass
+ # different arguments to the test runner. We list those extensions so
+--
+2.6.2
+
diff --git a/poky/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch b/poky/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
new file mode 100644
index 000000000..438ca5f52
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
@@ -0,0 +1,64 @@
+From 7072befe1397af4eb01c3ff7edf99f0cd5076089 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 30 Aug 2016 14:25:32 +0200
+Subject: [PATCH] avoid c++ comments in c-code - fails with gcc-6
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fixes:
+
+| error: C++ style comments are not allowed in ISO C90
+| num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ src/flex.skl | 2 +-
+ src/scan.c | 2 +-
+ src/skel.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/flex.skl b/src/flex.skl
+index 73a0b9e..ed71627 100644
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -2350,7 +2350,7 @@ void yyFlexLexer::yyensure_buffer_stack(void)
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+- num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
++ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ M4_YY_CALL_LAST_ARG);
+diff --git a/src/scan.c b/src/scan.c
+index b55df2d..f1dce75 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -4672,7 +4672,7 @@ static void yyensure_buffer_stack (void)
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+- num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
++ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways...*/
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+diff --git a/src/skel.c b/src/skel.c
+index ef657d3..26cc889 100644
+--- a/src/skel.c
++++ b/src/skel.c
+@@ -2561,7 +2561,7 @@ const char *skel[] = {
+ " * scanner will even need a stack. We use 2 instead of 1 to avoid an",
+ " * immediate realloc on the next call.",
+ " */",
+- " num_to_alloc = 1; // After all that talk, this was set to 1 anyways...",
++ " num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */",
+ " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc",
+ " (num_to_alloc * sizeof(struct yy_buffer_state*)",
+ " M4_YY_CALL_LAST_ARG);",
+--
+2.5.5
+
diff --git a/poky/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch b/poky/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch
new file mode 100644
index 000000000..216ac7ae1
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/CVE-2016-6354.patch
@@ -0,0 +1,59 @@
+From 3939eccdff598f47e5b37b05d58bf1b44d3796e7 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Oct 2016 14:15:38 +0300
+Subject: [PATCH] Prevent buffer overflow in yy_get_next_buffer
+
+This is upstream commit a5cbe929ac3255d371e698f62dc256afe7006466
+with some additional backporting to make binutils build again.
+
+Upstream-Status: Backport
+CVE: CVE-2016-6354
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/flex.skl | 2 +-
+ src/scan.c | 2 +-
+ src/skel.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/flex.skl b/src/flex.skl
+index ed71627..814d562 100644
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -1718,7 +1718,7 @@ int yyFlexLexer::yy_get_next_buffer()
+
+ else
+ {
+- yy_size_t num_to_read =
++ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+diff --git a/src/scan.c b/src/scan.c
+index f1dce75..1949872 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -4181,7 +4181,7 @@ static int yy_get_next_buffer (void)
+
+ else
+ {
+- yy_size_t num_to_read =
++ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+diff --git a/src/skel.c b/src/skel.c
+index 26cc889..0344d18 100644
+--- a/src/skel.c
++++ b/src/skel.c
+@@ -1929,7 +1929,7 @@ const char *skel[] = {
+ "",
+ " else",
+ " {",
+- " yy_size_t num_to_read =",
++ " int num_to_read =",
+ " YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;",
+ "",
+ " while ( num_to_read <= 0 )",
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/flex/flex/disable-tests.patch b/poky/meta/recipes-devtools/flex/flex/disable-tests.patch
new file mode 100644
index 000000000..4dc801d72
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/disable-tests.patch
@@ -0,0 +1,19 @@
+Due to automake stupidity the Makefile in tests/ has an 'all' target that
+depends on $(BUILD_SOURCES), which means when building flex parts of the test
+suite are built even if they're not needed, resulting in flex needing
+flex-native and bison-native to build.
+
+This patch removes the tests directory from SUBDIRS and will be conditionally
+applied by the recipe.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 076ccad..0574d7b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -55,3 +55,2 @@ SUBDIRS = \
+ po \
+- tests \
+ tools
diff --git a/poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch b/poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
new file mode 100644
index 000000000..29792efee
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/do_not_create_pdf_doc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate (embedded specific)
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: flex-2.6.0/doc/Makefile.am
+===================================================================
+--- flex-2.6.0.orig/doc/Makefile.am
++++ flex-2.6.0/doc/Makefile.am
+@@ -2,7 +2,7 @@ help2man = @HELP2MAN@
+
+ info_TEXINFOS = flex.texi
+ dist_man_MANS = flex.1
+-dist_doc_DATA= flex.pdf
++EXTRA_DIST= flex.pdf
+
+ CLEANFILES = \
+ flex.aux \
diff --git a/poky/meta/recipes-devtools/flex/flex/run-ptest b/poky/meta/recipes-devtools/flex/flex/run-ptest
new file mode 100755
index 000000000..19db33790
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# make would want to rebuild some files with a compiler otherwise :-/
+make FLEX=/usr/bin/flex -t check-TESTS || true
+make FLEX=/usr/bin/flex check-TESTS
diff --git a/poky/meta/recipes-devtools/flex/flex_2.6.0.bb b/poky/meta/recipes-devtools/flex/flex_2.6.0.bb
new file mode 100644
index 000000000..b89b7515b
--- /dev/null
+++ b/poky/meta/recipes-devtools/flex/flex_2.6.0.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Flex (The Fast Lexical Analyzer)"
+DESCRIPTION = "Flex is a fast lexical analyser generator. Flex is a tool for generating programs that recognize \
+lexical patterns in text."
+HOMEPAGE = "http://sourceforge.net/projects/flex/"
+SECTION = "devel"
+LICENSE = "BSD"
+
+DEPENDS = "${@bb.utils.contains('PTEST_ENABLED', '1', 'bison-native flex-native', '', d)}"
+BBCLASSEXTEND = "native nativesdk"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
+ file://run-ptest \
+ file://do_not_create_pdf_doc.patch \
+ file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+ file://0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch \
+ file://CVE-2016-6354.patch \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
+ "
+
+SRC_URI[md5sum] = "266270f13c48ed043d95648075084d59"
+SRC_URI[sha256sum] = "24e611ef5a4703a191012f80c1027dc9d12555183ce0ecd46f3636e587e9b8e9"
+
+# Flex has moved to github from 2.6.1 onwards
+UPSTREAM_CHECK_URI = "https://github.com/westes/flex/releases"
+UPSTREAM_CHECK_REGEX = "flex-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools gettext texinfo ptest
+
+M4 = "${bindir}/m4"
+M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
+EXTRA_OECONF += "ac_cv_path_M4=${M4}"
+EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
+
+EXTRA_OEMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', 'FLEX=${STAGING_BINDIR_NATIVE}/flex', '', d)}"
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+do_install_append_class-nativesdk() {
+ create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+PACKAGES =+ "${PN}-libfl"
+
+FILES_${PN}-libfl = "${libdir}/libfl.so.* ${libdir}/libfl_pic.so.*"
+
+RDEPENDS_${PN} += "m4"
+RDEPENDS_${PN}-ptest += "bash gawk"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests -f ${B}/tests/Makefile top_builddir=${B} INCLUDES=-I${S}/src buildtests
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/build-aux/
+ cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
+ cp -r ${S}/tests/* ${D}${PTEST_PATH}
+ cp -r ${B}/tests/* ${D}${PTEST_PATH}
+ sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \-e 's/^Makefile:/_Makefile:/' \
+ -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \
+ -e 's/^builddir = \(.*\)/builddir = ./' -e 's/^top_builddir = \(.*\)/top_builddir = ./' \
+ -i ${D}${PTEST_PATH}/Makefile
+}
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3.inc b/poky/meta/recipes-devtools/gcc/gcc-7.3.inc
new file mode 100644
index 000000000..6dff694a1
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3.inc
@@ -0,0 +1,132 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "7.3.0"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "7.3.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-7.3:${FILE_DIRNAME}/gcc-7.3/backport:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib flex-native"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native flex-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+#RELEASE = "7-20170504"
+BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.xz"
+#SRCREV = "f7cf798b73fd1a07098f9a490deec1e2a36e0bed"
+#BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-6-branch;protocol=git"
+#BASEURI ?= "http://mirrors.concertpass.com/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.bz2"
+
+SRC_URI = "\
+ ${BASEURI} \
+ file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+ file://0008-c99-snprintf.patch \
+ file://0009-gcc-poison-system-directories.patch \
+ file://0010-gcc-poison-dir-extend.patch \
+ file://0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0012-64-bit-multilib-hack.patch \
+ file://0013-optional-libstdc.patch \
+ file://0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0015-COLLECT_GCC_OPTIONS.patch \
+ file://0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0017-fortran-cross-compile-hack.patch \
+ file://0018-cpp-honor-sysroot.patch \
+ file://0019-MIPS64-Default-to-N64-ABI.patch \
+ file://0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0021-gcc-Fix-argument-list-too-long-error.patch \
+ file://0022-Disable-sdt.patch \
+ file://0023-libtool.patch \
+ file://0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+ file://0027-export-CPP.patch \
+ file://0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+ file://0030-Ensure-target-gcc-headers-can-be-included.patch \
+ file://0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+ file://0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+ file://0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0034-aarch64-Add-support-for-musl-ldso.patch \
+ file://0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+ file://0036-handle-sysroot-support-for-nativesdk-gcc.patch \
+ file://0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
+ file://0038-Fix-various-_FOR_BUILD-and-related-variables.patch \
+ file://0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
+ file://0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch \
+ file://0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
+ file://0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
+ file://0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
+ file://0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
+ file://0047-sync-gcc-stddef.h-with-musl.patch \
+ file://0048-gcc-Enable-static-PIE.patch \
+ file://fix-segmentation-fault-precompiled-hdr.patch \
+ file://no-sse-fix-test-case-failures.patch \
+ ${BACKPORTS} \
+"
+BACKPORTS = "\
+ file://0001-Fix-internal-compiler-error-in-testcase.patch \
+ file://0001-PR-rtl-optimization-83030.patch \
+ file://0001-PR-c-80290-memory-hog-with-std-pair.patch \
+ file://0001-Fix-ppc64le-build-Partial-backport-r256656.patch \
+"
+
+SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
+SRC_URI[sha256sum] = "832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --enable-libitm \
+ --disable-bootstrap \
+ --disable-libmudflap \
+ --with-system-zlib \
+ ${@'--with-linker-hash-style=${LINKER_HASH_STYLE}' if '${LINKER_HASH_STYLE}' else ''} \
+ --enable-linker-build-id \
+ --with-ppl=no \
+ --with-cloog=no \
+ --enable-checking=release \
+ --enable-cheaders=c_global \
+ --without-isl \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libitm \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+ --without-isl \
+ gcc_cv_libc_provides_ssp=yes \
+"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch
new file mode 100644
index 000000000..45cc0eeec
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-internal-compiler-error-in-testcase.patch
@@ -0,0 +1,212 @@
+From d3cdd96a300f9003a1cc242541605169aacdc811 Mon Sep 17 00:00:00 2001
+From: willschm <willschm@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 25 Sep 2017 14:35:02 +0000
+Subject: [PATCH] [gcc]
+
+2017-09-25 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling
+ for early folding of vector stores (ALTIVEC_BUILTIN_ST_*).
+ (rs6000_builtin_valid_without_lhs): New helper function.
+ * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
+ Remove obsoleted code for handling ALTIVEC_BUILTIN_VEC_ST.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253152 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Fix internal compiler error for testcase gcc.dg/vmx/7d-02.c
+
+Upstream commit: d3cdd96a300f9003a1cc242541605169aacdc811
+
+Backport by Kaushik Phatak <Kaushik.Phatak@kpit.com>
+
+This patch removes changes to Changelog from the original upstream patch.
+This will help us avoid conflicts.
+
+Upstream-Status: Backport
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ gcc/ChangeLog | 8 +++++
+ gcc/config/rs6000/rs6000-c.c | 72 -------------------------------------------
+ gcc/config/rs6000/rs6000.c | 73 ++++++++++++++++++++++++++++++++++++++++++--
+ 3 files changed, 78 insertions(+), 75 deletions(-)
+
+diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
+index a49db97..4a363a1 100644
+--- a/gcc/config/rs6000/rs6000-c.c
++++ b/gcc/config/rs6000/rs6000-c.c
+@@ -6279,70 +6279,6 @@ altivec_resolve_overloaded_builtin (loca
+ }
+ }
+
+- /* Similarly for stvx. */
+- if (fcode == ALTIVEC_BUILTIN_VEC_ST
+- && (BYTES_BIG_ENDIAN || !VECTOR_ELT_ORDER_BIG)
+- && nargs == 3)
+- {
+- tree arg0 = (*arglist)[0];
+- tree arg1 = (*arglist)[1];
+- tree arg2 = (*arglist)[2];
+-
+- /* Construct the masked address. Let existing error handling take
+- over if we don't have a constant offset. */
+- arg1 = fold (arg1);
+-
+- if (TREE_CODE (arg1) == INTEGER_CST)
+- {
+- if (!ptrofftype_p (TREE_TYPE (arg1)))
+- arg1 = build1 (NOP_EXPR, sizetype, arg1);
+-
+- tree arg2_type = TREE_TYPE (arg2);
+- if (TREE_CODE (arg2_type) == ARRAY_TYPE && c_dialect_cxx ())
+- {
+- /* Force array-to-pointer decay for C++. */
+- arg2 = default_conversion (arg2);
+- arg2_type = TREE_TYPE (arg2);
+- }
+-
+- /* Find the built-in to make sure a compatible one exists; if not
+- we fall back to default handling to get the error message. */
+- for (desc = altivec_overloaded_builtins;
+- desc->code && desc->code != fcode; desc++)
+- continue;
+-
+- for (; desc->code == fcode; desc++)
+- if (rs6000_builtin_type_compatible (TREE_TYPE (arg0), desc->op1)
+- && rs6000_builtin_type_compatible (TREE_TYPE (arg1), desc->op2)
+- && rs6000_builtin_type_compatible (TREE_TYPE (arg2),
+- desc->op3))
+- {
+- tree addr = fold_build2_loc (loc, POINTER_PLUS_EXPR, arg2_type,
+- arg2, arg1);
+- tree aligned
+- = fold_build2_loc (loc, BIT_AND_EXPR, arg2_type,
+- addr, build_int_cst (arg2_type, -16));
+-
+- tree arg0_type = TREE_TYPE (arg0);
+- if (TYPE_MODE (arg0_type) == V2DImode)
+- /* Type-based aliasing analysis thinks vector long
+- and vector long long are different and will put them
+- in distinct alias classes. Force our address type
+- to be a may-alias type to avoid this. */
+- arg0_type
+- = build_pointer_type_for_mode (arg0_type, Pmode,
+- true/*can_alias_all*/);
+- else
+- arg0_type = build_pointer_type (arg0_type);
+- aligned = build1 (NOP_EXPR, arg0_type, aligned);
+- tree stg = build_indirect_ref (loc, aligned, RO_NULL);
+- tree retval = build2 (MODIFY_EXPR, TREE_TYPE (stg), stg,
+- convert (TREE_TYPE (stg), arg0));
+- return retval;
+- }
+- }
+- }
+-
+ for (n = 0;
+ !VOID_TYPE_P (TREE_VALUE (fnargs)) && n < nargs;
+ fnargs = TREE_CHAIN (fnargs), n++)
+diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
+index a49db97..4a363a1 100644
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -55,6 +55,7 @@
+ #include "reload.h"
+ #include "sched-int.h"
+ #include "gimplify.h"
++#include "gimple-fold.h"
+ #include "gimple-iterator.h"
+ #include "gimple-ssa.h"
+ #include "gimple-walk.h"
+@@ -17089,6 +17090,25 @@ rs6000_fold_builtin (tree fndecl, int n_
+ #endif
+ }
+
++/* Helper function to sort out which built-ins may be valid without having
++ a LHS. */
++bool
++rs6000_builtin_valid_without_lhs (enum rs6000_builtins fn_code)
++{
++ switch (fn_code)
++ {
++ case ALTIVEC_BUILTIN_STVX_V16QI:
++ case ALTIVEC_BUILTIN_STVX_V8HI:
++ case ALTIVEC_BUILTIN_STVX_V4SI:
++ case ALTIVEC_BUILTIN_STVX_V4SF:
++ case ALTIVEC_BUILTIN_STVX_V2DI:
++ case ALTIVEC_BUILTIN_STVX_V2DF:
++ return true;
++ default:
++ return false;
++ }
++}
++
+ /* Fold a machine-dependent built-in in GIMPLE. (For folding into
+ a constant, use rs6000_fold_builtin.) */
+
+@@ -17102,6 +17122,10 @@ rs6000_gimple_fold_builtin (gimple_stmt_
+ = (enum rs6000_builtins) DECL_FUNCTION_CODE (fndecl);
+ tree arg0, arg1, lhs;
+
++ /* Prevent gimple folding for code that does not have a LHS, unless it is
++ allowed per the rs6000_builtin_valid_without_lhs helper function. */
++ if (!gimple_call_lhs (stmt) && !rs6000_builtin_valid_without_lhs (fn_code))
++ return false;
+ switch (fn_code)
+ {
+ /* Flavors of vec_add. We deliberately don't expand
+@@ -17169,6 +17193,54 @@ rs6000_gimple_fold_builtin (gimple_stmt_
+ gsi_replace (gsi, g, true);
+ return true;
+ }
++ /* Vector stores. */
++ case ALTIVEC_BUILTIN_STVX_V16QI:
++ case ALTIVEC_BUILTIN_STVX_V8HI:
++ case ALTIVEC_BUILTIN_STVX_V4SI:
++ case ALTIVEC_BUILTIN_STVX_V4SF:
++ case ALTIVEC_BUILTIN_STVX_V2DI:
++ case ALTIVEC_BUILTIN_STVX_V2DF:
++ {
++ /* Do not fold for -maltivec=be on LE targets. */
++ if (VECTOR_ELT_ORDER_BIG && !BYTES_BIG_ENDIAN)
++ return false;
++ arg0 = gimple_call_arg (stmt, 0); /* Value to be stored. */
++ arg1 = gimple_call_arg (stmt, 1); /* Offset. */
++ tree arg2 = gimple_call_arg (stmt, 2); /* Store-to address. */
++ location_t loc = gimple_location (stmt);
++ tree arg0_type = TREE_TYPE (arg0);
++ /* Use ptr_type_node (no TBAA) for the arg2_type.
++ FIXME: (Richard) "A proper fix would be to transition this type as
++ seen from the frontend to GIMPLE, for example in a similar way we
++ do for MEM_REFs by piggy-backing that on an extra argument, a
++ constant zero pointer of the alias pointer type to use (which would
++ also serve as a type indicator of the store itself). I'd use a
++ target specific internal function for this (not sure if we can have
++ those target specific, but I guess if it's folded away then that's
++ fine) and get away with the overload set."
++ */
++ tree arg2_type = ptr_type_node;
++ /* POINTER_PLUS_EXPR wants the offset to be of type 'sizetype'. Create
++ the tree using the value from arg0. The resulting type will match
++ the type of arg2. */
++ gimple_seq stmts = NULL;
++ tree temp_offset = gimple_convert (&stmts, loc, sizetype, arg1);
++ tree temp_addr = gimple_build (&stmts, loc, POINTER_PLUS_EXPR,
++ arg2_type, arg2, temp_offset);
++ /* Mask off any lower bits from the address. */
++ tree aligned_addr = gimple_build (&stmts, loc, BIT_AND_EXPR,
++ arg2_type, temp_addr,
++ build_int_cst (arg2_type, -16));
++ gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
++ /* The desired gimple result should be similar to:
++ MEM[(__vector floatD.1407 *)_1] = vf1D.2697; */
++ gimple *g;
++ g = gimple_build_assign (build2 (MEM_REF, arg0_type, aligned_addr,
++ build_int_cst (arg2_type, 0)), arg0);
++ gimple_set_location (g, loc);
++ gsi_replace (gsi, g, true);
++ return true;
++ }
+
+ default:
+ break;
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch
new file mode 100644
index 000000000..5d8ffb7ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-Fix-ppc64le-build-Partial-backport-r256656.patch
@@ -0,0 +1,40 @@
+From aa65a43516da1d48011ef621ed5988289711d99b Mon Sep 17 00:00:00 2001
+From: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 29 Jun 2018 09:31:30 +0000
+Subject: [PATCH] Partial backport r256656
+
+2018-06-29 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2018-01-10 Kelvin Nilsen <kelvin@gcc.gnu.org>
+
+ * lex.c (search_line_fast): Remove illegal coercion of an
+ unaligned pointer value to vector pointer type and replace with
+ use of __builtin_vec_vsx_ld () built-in function, which operates
+ on unaligned pointer values.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@261621 138bc75d-0d04-0410-961f-82ee72b054a4
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@262243 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ libcpp/lex.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletion(-)
+
+diff --git a/libcpp/lex.c b/libcpp/lex.c
+index 097c78002cbb..e0fb9e822c44 100644
+--- a/libcpp/lex.c
++++ b/libcpp/lex.c
+@@ -568,7 +568,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
+ {
+ vc m_nl, m_cr, m_bs, m_qm;
+
+- data = *((const vc *)s);
++ data = __builtin_vec_vsx_ld (0, s);
+ s += 16;
+
+ m_nl = (vc) __builtin_vec_cmpeq(data, repl_nl);
+--
+2.17.1
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
new file mode 100644
index 000000000..ba43af92f
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
@@ -0,0 +1,58 @@
+From 8c014bceeca6a558519e86b16a8142accc41e94f Mon Sep 17 00:00:00 2001
+From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 28 Jun 2018 00:25:21 +0000
+Subject: [PATCH] PR c++/80290 - memory-hog with std::pair.
+
+ * pt.c (type_unification_real): Skip non-dependent conversion
+ check for a nested list argument.
+ (braced_init_depth): New.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@262204 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Joel Stanley <joel@jms.id.au>
+---
+ gcc/cp/pt.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
+index 79cfd0129226..71077a3b0498 100644
+--- a/gcc/cp/pt.c
++++ b/gcc/cp/pt.c
+@@ -19242,6 +19242,24 @@ try_array_deduction (tree tparms, tree targs, tree parm)
+ /*nondeduced*/false, array_deduction_r);
+ }
+
++/* Returns how many levels of { } INIT contains. */
++
++static int
++braced_init_depth (tree init)
++{
++ if (!init || !BRACE_ENCLOSED_INITIALIZER_P (init))
++ return 0;
++ unsigned i; tree val;
++ unsigned max = 0;
++ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, val)
++ {
++ unsigned elt_d = braced_init_depth (val);
++ if (elt_d > max)
++ max = elt_d;
++ }
++ return max + 1;
++}
++
+ /* Most parms like fn_type_unification.
+
+ If SUBR is 1, we're being called recursively (to unify the
+@@ -19478,6 +19496,10 @@ type_unification_real (tree tparms,
+
+ if (uses_template_parms (parm))
+ continue;
++ /* Workaround for c++/80290: avoid combinatorial explosion on
++ deeply nested braced init-lists. */
++ if (braced_init_depth (arg) > 2)
++ continue;
+ if (check_non_deducible_conversion (parm, arg, strict, flags,
+ explain_p))
+ return 1;
+--
+2.17.1
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
new file mode 100644
index 000000000..71f7988ea
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
@@ -0,0 +1,272 @@
+From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
+From: ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Nov 2017 21:43:22 +0000
+Subject: [PATCH] PR rtl-optimization/83030 * doc/rtl.texi (Flags
+ in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P and
+ mention usage of 'jump' for JUMP_INSNs. (Insns): Delete entry for
+ REG_CROSSING_JUMP in register notes. * bb-reorder.c
+ (update_crossing_jump_flags): Do not test whether the CROSSING_JUMP_P flag
+ is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
+ Likewise. * reorg.c (relax_delay_slots): Do not consider a
+ CROSSING_JUMP_P insn as useless.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+
+This patch removes changes to Changelog from the original upstream patch.
+This will help us avoid conflicts.
+
+Original backport to GCC 7.x by Amruta Pawar <Amruta.Pawar@kpit.com>
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+ gcc/bb-reorder.c | 5 +--
+ gcc/cfgrtl.c | 3 +-
+ gcc/doc/rtl.texi | 129 ++++++++++++++++++++++++++++---------------------------
+ gcc/reorg.c | 7 +--
+ 5 files changed, 84 insertions(+), 72 deletions(-)
+
+diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
+index 55e6dc6..794283c 100644
+--- a/gcc/bb-reorder.c
++++ b/gcc/bb-reorder.c
+@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->flags & EDGE_CROSSING)
+ {
+- if (JUMP_P (BB_END (bb))
+- /* Some flags were added during fix_up_fall_thru_edges, via
+- force_nonfallthru_and_redirect. */
+- && !CROSSING_JUMP_P (BB_END (bb)))
++ if (JUMP_P (BB_END (bb)))
+ CROSSING_JUMP_P (BB_END (bb)) = 1;
+ break;
+ }
+diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
+index d6e5ac0..a2ad075 100644
+--- a/gcc/cfgrtl.c
++++ b/gcc/cfgrtl.c
+@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
+ if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
+ {
+ e->flags |= EDGE_CROSSING;
+- if (JUMP_P (BB_END (e->src))
+- && !CROSSING_JUMP_P (BB_END (e->src)))
++ if (JUMP_P (BB_END (e->src)))
+ CROSSING_JUMP_P (BB_END (e->src)) = 1;
+ }
+ else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
+diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
+index 21524f5..a58eedc 100644
+--- a/gcc/doc/rtl.texi
++++ b/gcc/doc/rtl.texi
+@@ -565,6 +565,16 @@ that are used in certain types of expression. Most often they
+ are accessed with the following macros, which expand into lvalues.
+
+ @table @code
++@findex CROSSING_JUMP_P
++@cindex @code{jump_insn} and @samp{/j}
++@item CROSSING_JUMP_P (@var{x})
++Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
++which could potentially be very far apart in the executable. The presence
++of this flag indicates to other optimizations that this branching instruction
++should not be ``collapsed'' into a simpler branching construct. It is used
++when the optimization to partition basic blocks into hot and cold sections
++is turned on.
++
+ @findex CONSTANT_POOL_ADDRESS_P
+ @cindex @code{symbol_ref} and @samp{/u}
+ @cindex @code{unchanging}, in @code{symbol_ref}
+@@ -577,37 +587,6 @@ In either case GCC assumes these addresses can be addressed directly,
+ perhaps with the help of base registers.
+ Stored in the @code{unchanging} field and printed as @samp{/u}.
+
+-@findex RTL_CONST_CALL_P
+-@cindex @code{call_insn} and @samp{/u}
+-@cindex @code{unchanging}, in @code{call_insn}
+-@item RTL_CONST_CALL_P (@var{x})
+-In a @code{call_insn} indicates that the insn represents a call to a
+-const function. Stored in the @code{unchanging} field and printed as
+-@samp{/u}.
+-
+-@findex RTL_PURE_CALL_P
+-@cindex @code{call_insn} and @samp{/i}
+-@cindex @code{return_val}, in @code{call_insn}
+-@item RTL_PURE_CALL_P (@var{x})
+-In a @code{call_insn} indicates that the insn represents a call to a
+-pure function. Stored in the @code{return_val} field and printed as
+-@samp{/i}.
+-
+-@findex RTL_CONST_OR_PURE_CALL_P
+-@cindex @code{call_insn} and @samp{/u} or @samp{/i}
+-@item RTL_CONST_OR_PURE_CALL_P (@var{x})
+-In a @code{call_insn}, true if @code{RTL_CONST_CALL_P} or
+-@code{RTL_PURE_CALL_P} is true.
+-
+-@findex RTL_LOOPING_CONST_OR_PURE_CALL_P
+-@cindex @code{call_insn} and @samp{/c}
+-@cindex @code{call}, in @code{call_insn}
+-@item RTL_LOOPING_CONST_OR_PURE_CALL_P (@var{x})
+-In a @code{call_insn} indicates that the insn represents a possibly
+-infinite looping call to a const or pure function. Stored in the
+-@code{call} field and printed as @samp{/c}. Only true if one of
+-@code{RTL_CONST_CALL_P} or @code{RTL_PURE_CALL_P} is true.
+-
+ @findex INSN_ANNULLED_BRANCH_P
+ @cindex @code{jump_insn} and @samp{/u}
+ @cindex @code{call_insn} and @samp{/u}
+@@ -702,6 +681,29 @@ Stored in the @code{call} field and printed as @samp{/c}.
+ Nonzero in a @code{mem} if the memory reference holds a pointer.
+ Stored in the @code{frame_related} field and printed as @samp{/f}.
+
++@findex MEM_READONLY_P
++@cindex @code{mem} and @samp{/u}
++@cindex @code{unchanging}, in @code{mem}
++@item MEM_READONLY_P (@var{x})
++Nonzero in a @code{mem}, if the memory is statically allocated and read-only.
++
++Read-only in this context means never modified during the lifetime of the
++program, not necessarily in ROM or in write-disabled pages. A common
++example of the later is a shared library's global offset table. This
++table is initialized by the runtime loader, so the memory is technically
++writable, but after control is transferred from the runtime loader to the
++application, this memory will never be subsequently modified.
++
++Stored in the @code{unchanging} field and printed as @samp{/u}.
++
++@findex PREFETCH_SCHEDULE_BARRIER_P
++@cindex @code{prefetch} and @samp{/v}
++@cindex @code{volatile}, in @code{prefetch}
++@item PREFETCH_SCHEDULE_BARRIER_P (@var{x})
++In a @code{prefetch}, indicates that the prefetch is a scheduling barrier.
++No other INSNs will be moved over it.
++Stored in the @code{volatil} field and printed as @samp{/v}.
++
+ @findex REG_FUNCTION_VALUE_P
+ @cindex @code{reg} and @samp{/i}
+ @cindex @code{return_val}, in @code{reg}
+@@ -731,6 +733,37 @@ The same hard register may be used also for collecting the values of
+ functions called by this one, but @code{REG_FUNCTION_VALUE_P} is zero
+ in this kind of use.
+
++@findex RTL_CONST_CALL_P
++@cindex @code{call_insn} and @samp{/u}
++@cindex @code{unchanging}, in @code{call_insn}
++@item RTL_CONST_CALL_P (@var{x})
++In a @code{call_insn} indicates that the insn represents a call to a
++const function. Stored in the @code{unchanging} field and printed as
++@samp{/u}.
++
++@findex RTL_PURE_CALL_P
++@cindex @code{call_insn} and @samp{/i}
++@cindex @code{return_val}, in @code{call_insn}
++@item RTL_PURE_CALL_P (@var{x})
++In a @code{call_insn} indicates that the insn represents a call to a
++pure function. Stored in the @code{return_val} field and printed as
++@samp{/i}.
++
++@findex RTL_CONST_OR_PURE_CALL_P
++@cindex @code{call_insn} and @samp{/u} or @samp{/i}
++@item RTL_CONST_OR_PURE_CALL_P (@var{x})
++In a @code{call_insn}, true if @code{RTL_CONST_CALL_P} or
++@code{RTL_PURE_CALL_P} is true.
++
++@findex RTL_LOOPING_CONST_OR_PURE_CALL_P
++@cindex @code{call_insn} and @samp{/c}
++@cindex @code{call}, in @code{call_insn}
++@item RTL_LOOPING_CONST_OR_PURE_CALL_P (@var{x})
++In a @code{call_insn} indicates that the insn represents a possibly
++infinite looping call to a const or pure function. Stored in the
++@code{call} field and printed as @samp{/c}. Only true if one of
++@code{RTL_CONST_CALL_P} or @code{RTL_PURE_CALL_P} is true.
++
+ @findex RTX_FRAME_RELATED_P
+ @cindex @code{insn} and @samp{/f}
+ @cindex @code{call_insn} and @samp{/f}
+@@ -765,21 +798,6 @@ computation performed by this instruction, i.e., one that
+ This flag is required for exception handling support on targets with RTL
+ prologues.
+
+-@findex MEM_READONLY_P
+-@cindex @code{mem} and @samp{/u}
+-@cindex @code{unchanging}, in @code{mem}
+-@item MEM_READONLY_P (@var{x})
+-Nonzero in a @code{mem}, if the memory is statically allocated and read-only.
+-
+-Read-only in this context means never modified during the lifetime of the
+-program, not necessarily in ROM or in write-disabled pages. A common
+-example of the later is a shared library's global offset table. This
+-table is initialized by the runtime loader, so the memory is technically
+-writable, but after control is transferred from the runtime loader to the
+-application, this memory will never be subsequently modified.
+-
+-Stored in the @code{unchanging} field and printed as @samp{/u}.
+-
+ @findex SCHED_GROUP_P
+ @cindex @code{insn} and @samp{/s}
+ @cindex @code{call_insn} and @samp{/s}
+@@ -879,14 +897,6 @@ Stored in the @code{volatil} field and printed as @samp{/v}.
+ Most uses of @code{SYMBOL_REF_FLAG} are historic and may be subsumed
+ by @code{SYMBOL_REF_FLAGS}. Certainly use of @code{SYMBOL_REF_FLAGS}
+ is mandatory if the target requires more than one bit of storage.
+-
+-@findex PREFETCH_SCHEDULE_BARRIER_P
+-@cindex @code{prefetch} and @samp{/v}
+-@cindex @code{volatile}, in @code{prefetch}
+-@item PREFETCH_SCHEDULE_BARRIER_P (@var{x})
+-In a @code{prefetch}, indicates that the prefetch is a scheduling barrier.
+-No other INSNs will be moved over it.
+-Stored in the @code{volatil} field and printed as @samp{/v}.
+ @end table
+
+ These are the fields to which the above macros refer:
+@@ -974,6 +985,8 @@ In a @code{set}, 1 means it is for a return.
+
+ In a @code{call_insn}, 1 means it is a sibling call.
+
++In a @code{jump_insn}, 1 means it is a crossing jump.
++
+ In an RTL dump, this flag is represented as @samp{/j}.
+
+ @findex unchanging
+@@ -3887,16 +3900,6 @@ multiple targets; the last label in the insn (in the highest numbered
+ insn-field) goes into the @code{JUMP_LABEL} field and does not have a
+ @code{REG_LABEL_TARGET} note. @xref{Insns, JUMP_LABEL}.
+
+-@findex REG_CROSSING_JUMP
+-@item REG_CROSSING_JUMP
+-This insn is a branching instruction (either an unconditional jump or
+-an indirect jump) which crosses between hot and cold sections, which
+-could potentially be very far apart in the executable. The presence
+-of this note indicates to other optimizations that this branching
+-instruction should not be ``collapsed'' into a simpler branching
+-construct. It is used when the optimization to partition basic blocks
+-into hot and cold sections is turned on.
+-
+ @findex REG_SETJMP
+ @item REG_SETJMP
+ Appears attached to each @code{CALL_INSN} to @code{setjmp} or a
+diff --git a/gcc/reorg.c b/gcc/reorg.c
+index 5914af6..77f3fe7 100644
+--- a/gcc/reorg.c
++++ b/gcc/reorg.c
+@@ -3360,10 +3360,11 @@ relax_delay_slots (rtx_insn *first)
+ }
+
+ /* See if we have a simple (conditional) jump that is useless. */
+- if (! INSN_ANNULLED_BRANCH_P (delay_jump_insn)
+- && ! condjump_in_parallel_p (delay_jump_insn)
++ if (!CROSSING_JUMP_P (delay_jump_insn)
++ && !INSN_ANNULLED_BRANCH_P (delay_jump_insn)
++ && !condjump_in_parallel_p (delay_jump_insn)
+ && prev_active_insn (as_a<rtx_insn *> (target_label)) == insn
+- && ! BARRIER_P (prev_nonnote_insn (as_a<rtx_insn *> (target_label)))
++ && !BARRIER_P (prev_nonnote_insn (as_a<rtx_insn *> (target_label)))
+ /* If the last insn in the delay slot sets CC0 for some insn,
+ various code assumes that it is in a delay slot. We could
+ put it back where it belonged and delete the register notes,
+--
+1.8.5.6
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..1af1c74e6
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From 2fcf1e23ef4b2a5c93526f12212aa892595261f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/47] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 32a38633ad8..b4760952085 100755
+--- a/configure
++++ b/configure
+@@ -7472,7 +7472,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 12377499295..176ebb921ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3065,7 +3065,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0008-c99-snprintf.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0008-c99-snprintf.patch
new file mode 100644
index 000000000..ebd562b63
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0008-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From 732f10eead61830a8aee1bf38cce892da25c35b1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 08/47] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index 43969892aa2..12148457909 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -144,7 +144,7 @@ namespace std
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99_STDIO
++#if _GLIBCXX_USE_C99_STDIO || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch
new file mode 100644
index 000000000..fe13ed6e2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0009-gcc-poison-system-directories.patch
@@ -0,0 +1,192 @@
+From 4791a0a0f4595d0a18974f4e85a759a0789943db Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 09/47] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/common.opt | 4 ++++
+ gcc/config.in | 6 ++++++
+ gcc/configure | 16 ++++++++++++++++
+ gcc/configure.ac | 10 ++++++++++
+ gcc/doc/invoke.texi | 9 +++++++++
+ gcc/gcc.c | 2 ++
+ gcc/incpath.c | 19 +++++++++++++++++++
+ 7 files changed, 66 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index a5c3aeaa336..f02fe66367e 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -662,6 +662,10 @@ Wreturn-local-addr
+ Common Var(warn_return_local_addr) Init(1) Warning
+ Warn about returning a pointer/reference to a local or temporary variable.
+
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one variable shadows another. Same as -Wshadow=global.
+diff --git a/gcc/config.in b/gcc/config.in
+index bf2aa7b2e7d..b1203987e15 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -194,6 +194,12 @@
+ #endif
+
+
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+ optimizer and back end) to be checked for dynamic type safety at runtime.
+ This is quite expensive. */
+diff --git a/gcc/configure b/gcc/configure
+index c823ffe6290..4898f04fa6b 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -949,6 +949,7 @@ with_system_zlib
+ enable_maintainer_mode
+ enable_link_mutex
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_host_shared
+ enable_libquadmath_support
+@@ -1691,6 +1692,8 @@ Optional Features:
+ --enable-version-specific-runtime-libs
+ specify that runtime libraries should be installed
+ in a compiler-specific directory
++ --enable-poison-system-directories
++ warn for use of native system header directories
+ --enable-plugin enable plugin support
+ --enable-host-shared build host code as shared libraries
+ --disable-libquadmath-support
+@@ -29347,6 +29350,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Substitute configuration variables
+
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index acfe9797389..9dc1dc7fc96 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -6101,6 +6101,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
+ [specify that runtime libraries should be
+ installed in a compiler-specific directory])])
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system header directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 68a558e9992..060cd7169c6 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -298,6 +298,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wpacked -Wpacked-bitfield-compat -Wpadded @gol
+ -Wparentheses -Wno-pedantic-ms-format @gol
+ -Wplacement-new -Wplacement-new=@var{n} @gol
++-Wno-poison-system-directories @gol
+ -Wpointer-arith -Wpointer-compare -Wno-pointer-to-int-cast @gol
+ -Wno-pragmas -Wredundant-decls -Wrestrict -Wno-return-local-addr @gol
+ -Wreturn-type -Wsequence-point -Wshadow -Wno-shadow-ivar @gol
+@@ -5395,6 +5396,14 @@ made up of data only and thus requires no special treatment. But, for
+ most targets, it is made up of code and thus requires the stack to be
+ made executable in order for the program to work properly.
+
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling. This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index c48178f..f63d53d 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1029,6 +1029,8 @@ proper position among the other output files. */
+ "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "%X %{o*} %{e*} %{N} %{n} %{r}\
+ %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \
++ %{Wno-poison-system-directories:--no-poison-system-directories} \
++ %{Werror=poison-system-directories:--error-poison-system-directories} \
+ %{static|no-pie:} %{L*} %(mfwrap) %(link_libgcc) " \
+ VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \
+ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index 98fe5ec9ab3..f90e74dbd73 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -26,6 +26,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+
+ /* Microsoft Windows does not natively support inodes.
+ VMS has non-numeric inodes. */
+@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ }
+ fprintf (stderr, _("End of search list.\n"));
+ }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (flag_poison_system_directories)
++ {
++ struct cpp_dir *p;
++
++ for (p = heads[QUOTE]; p; p = p->next)
++ {
++ if ((!strncmp (p->name, "/usr/include", 12))
++ || (!strncmp (p->name, "/usr/local/include", 18))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ warning (OPT_Wpoison_system_directories,
++ "include location \"%s\" is unsafe for "
++ "cross-compilation",
++ p->name);
++ }
++ }
++#endif
+ }
+
+ /* Use given -I paths for #include "..." but not #include <...>, and
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch
new file mode 100644
index 000000000..4e06aa2f6
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0010-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From e74ef84ad609b3b6a5c37d207ffc3c6e70d1f025 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 10/47] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch. The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan. If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index f90e74dbd73..c583ee5061d 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ {
+ if ((!strncmp (p->name, "/usr/include", 12))
+ || (!strncmp (p->name, "/usr/local/include", 18))
+- || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++ || (!strncmp (p->name, "/usr/X11R6/include", 18))
++ || (!strncmp (p->name, "/sw/include", 11))
++ || (!strncmp (p->name, "/opt/include", 12)))
+ warning (OPT_Wpoison_system_directories,
+ "include location \"%s\" is unsafe for "
+ "cross-compilation",
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 000000000..b39ff1ec2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From a41d3a53a4e313c20802330d6b5c75358a4ed882 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 11/47] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index b4760952085..72a8ba94c4e 100755
+--- a/configure
++++ b/configure
+@@ -6736,6 +6736,38 @@ fi
+
+
+
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++ CFLAGS_FOR_TARGET=$CFLAGS
++ case " $CFLAGS " in
++ *" -O2 "*) ;;
++ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++ esac
++ case " $CFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++ esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++ CXXFLAGS_FOR_TARGET=$CXXFLAGS
++ case " $CXXFLAGS " in
++ *" -O2 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++ esac
++ case " $CXXFLAGS " in
++ *" -g "* | *" -g3 "*) ;;
++ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++ esac
++fi
++
++
+ # Handle --with-headers=XXX. If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch
new file mode 100644
index 000000000..f3b39120b
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0012-64-bit-multilib-hack.patch
@@ -0,0 +1,85 @@
+From 3af9fbbd14e83242ac2acb54bbb4bb726845fd34 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 12/47] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64 | 6 ++----
+ gcc/config/mips/t-linux64 | 10 +++-------
+ gcc/config/rs6000/t-linux64 | 5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
+index e422c442dae..cc885e24457 100644
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
+index 100f9da5e14..601cdf08d05 100644
+--- a/gcc/config/mips/t-linux64
++++ b/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+- ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+- ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+- ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
+index 2830ed0d861..d057facd2fd 100644
+--- a/gcc/config/rs6000/t-linux64
++++ b/gcc/config/rs6000/t-linux64
+@@ -26,10 +26,9 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+
+ MULTILIB_OPTIONS := m64/m32
+-MULTILIB_DIRNAMES := 64 32
++MULTILIB_DIRNAMES := . .
+ MULTILIB_EXTRA_OPTS :=
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ $(COMPILE) $<
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch
new file mode 100644
index 000000000..3439bf67d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0013-optional-libstdc.patch
@@ -0,0 +1,125 @@
+From 26a58d05844274915d011edbf9330c6151687b22 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 13/47] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt | 4 ++++
+ gcc/cp/g++spec.c | 1 +
+ gcc/doc/invoke.texi | 32 +++++++++++++++++++++++++++++++-
+ gcc/gcc.c | 1 +
+ 4 files changed, 37 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 9ad2f6e1fcc..c4ef7796282 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1848,6 +1848,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++.
+
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
+index ffcc87c79c9..28d8a9cf530 100644
+--- a/gcc/cp/g++spec.c
++++ b/gcc/cp/g++spec.c
+@@ -137,6 +137,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
+ switch (decoded_options[i].opt_index)
+ {
+ case OPT_nostdlib:
++ case OPT_nostdlib__:
+ case OPT_nodefaultlibs:
+ library = -1;
+ break;
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 060cd7169c6..8e2adc25644 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -211,6 +211,9 @@ in the following sections.
+ -fno-weak -nostdinc++ @gol
+ -fvisibility-inlines-hidden @gol
+ -fvisibility-ms-compat @gol
++-fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
++-fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fext-numeric-literals @gol
+ -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol
+ -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
+@@ -496,7 +499,7 @@ Objective-C and Objective-C++ Dialects}.
+ -s -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
+ -static-libmpx -static-libmpxwrappers @gol
+--shared -shared-libgcc -symbolic @gol
++-shared -shared-libgcc -symbolic -nostdlib++ @gol
+ -T @var{script} -Wl,@var{option} -Xlinker @var{option} @gol
+ -u @var{symbol} -z @var{keyword}}
+
+@@ -11606,6 +11609,33 @@ library subroutines.
+ constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
+ GNU Compiler Collection (GCC) Internals}.)
+
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
++@cindex @option{-lgcc}, use with @option{-nostdlib}
++@cindex @option{-nostdlib} and unresolved references
++@cindex unresolved references and @option{-nostdlib}
++@cindex @option{-lgcc}, use with @option{-nodefaultlibs}
++@cindex @option{-nodefaultlibs} and unresolved references
++@cindex unresolved references and @option{-nodefaultlibs}
++One of the standard libraries bypassed by @option{-nostdlib} and
++@option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
++which GCC uses to overcome shortcomings of particular machines, or special
++needs for some languages.
++(@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
++Collection (GCC) Internals},
++for more discussion of @file{libgcc.a}.)
++In most cases, you need @file{libgcc.a} even when you want to avoid
++other standard libraries. In other words, when you specify @option{-nostdlib}
++or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
++This ensures that you have no unresolved references to internal GCC
++library subroutines.
++(An example of such an internal subroutine is @code{__main}, used to ensure C++
++constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
++GNU Compiler Collection (GCC) Internals}.)
++
+ @item -pie
+ @opindex pie
+ Produce a position independent executable on targets that support it.
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 6315aa0dd16..a5fafbe5107 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1046,6 +1046,7 @@ proper position among the other output files. */
+ %(mflib) " STACK_SPLIT_SPEC "\
+ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++ %{!nostdlib++:}\
+ %{!nostdlib:%{!nostartfiles:%E}} %{T*} \n%(post_link) }}}}}}"
+ #endif
+
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 000000000..f92b5fbaa
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 716de5db6859fd1ea21078c94a41fac7a885b7e9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 14/47] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 7 -------
+ gcc/configure.ac | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 4898f04fa6b..640e4643805 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27303,13 +27303,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 9dc1dc7fc96..9a2dae55ba2 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4641,13 +4641,6 @@ x:
+ rm -f conftest.*
+ fi
+ fi
+- if test $gcc_cv_as_ld_jalr_reloc = yes; then
+- if test x$target_cpu_default = x; then
+- target_cpu_default=MASK_RELAX_PIC_CALLS
+- else
+- target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+- fi
+- fi
+ AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+
+ AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 000000000..6e62945e5
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0015-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 04a7a672301bb07caea6a7cad8378f63f1fe3200 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 15/47] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index a5fafbe5107..05896e19926 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4654,6 +4654,15 @@ set_collect_gcc_options (void)
+ sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+
+ first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++ if (target_system_root_changed && target_system_root)
++ {
++ obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++ obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++ obstack_grow (&collect_obstack, "'", 1);
++ first_time = FALSE;
++ }
++#endif
+ for (i = 0; (int) i < n_switches; i++)
+ {
+ const char *const *args;
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 000000000..1991251c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From 47071cbd4f13ff5a4974f71f359a04afcfb125da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 16/47] Use the defaults.h in ${B} instead of ${S}, and t-oe in
+ ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 2 +-
+ gcc/configure | 4 ++--
+ gcc/configure.ac | 4 ++--
+ gcc/mkconfig.sh | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 2411671cea3..7b590c9bbd3 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -532,7 +532,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index 640e4643805..b5ac1552541 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -12150,8 +12150,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 9a2dae55ba2..cb1479d1ef4 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1922,8 +1922,8 @@ for f in $tm_file; do
+ tm_include_list="${tm_include_list} $f"
+ ;;
+ defaults.h )
+- tm_file_list="${tm_file_list} \$(srcdir)/$f"
+- tm_include_list="${tm_include_list} $f"
++ tm_file_list="${tm_file_list} ./$f"
++ tm_include_list="${tm_include_list} ./$f"
+ ;;
+ * )
+ tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index 9fc7b5ca734..04abecfe648 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+ if [ $# -ge 1 ]; then
+ echo '#ifdef IN_GCC' >> ${output}T
+ for file in "$@"; do
+- if test x"$file" = x"defaults.h"; then
++ if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
+ postpone_defaults_h="yes"
+ else
+ echo "# include \"$file\"" >> ${output}T
+@@ -109,7 +109,7 @@ esac
+
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+- echo "# include \"defaults.h\"" >> ${output}T
++ echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+
+ # Add multiple inclusion protection guard, part two.
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch
new file mode 100644
index 000000000..e2830c59d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0017-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From 4fc35a2bb7666a7de35568eb5d47f0ce6acebe62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 17/47] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure | 2 +-
+ libgfortran/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 81238fcb79c..7ded7abd456 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12792,7 +12792,7 @@ esac
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 37b12d2998f..63a4166ef62 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -243,7 +243,7 @@ AC_SUBST(enable_static)
+
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+
+ # extra LD Flags which are required for targets
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch
new file mode 100644
index 000000000..555907417
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0018-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From 1c8a332469ca4bfefb10df70720e0dc83ff9a756 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 18/47] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h | 2 +-
+ gcc/gcc.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index 6b383e1d86d..c7c7d6a56ec 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -64,5 +64,5 @@ along with GCC; see the file COPYING3. If not see
+ {".ii", "@c++-cpp-output", 0, 0, 0},
+ {"@c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+- cc1plus -fpreprocessed %i %(cc1_options) %2\
++ cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 05896e19926..c73d4023987 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1351,7 +1351,7 @@ static const struct compiler default_compilers[] =
+ %W{o*:--output-pch=%*}}%V}}}}}}}", 0, 0, 0},
+ {".i", "@cpp-output", 0, 0, 0},
+ {"@cpp-output",
+- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {".s", "@assembler", 0, 0, 0},
+ {"@assembler",
+ "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 000000000..742a4012a
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0019-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,57 @@
+From 0a3b3cc45ea7ba83b46df7464b41c377e3966d88 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 19/47] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index b8bb4d65825..5e45f4b5199 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2084,29 +2084,29 @@ mips*-*-linux*) # Linux MIPS, either endian.
+ default_mips_arch=mips32
+ ;;
+ mips64el-st-linux-gnu)
+- default_mips_abi=n32
++ default_mips_abi=64
+ tm_file="${tm_file} mips/st.h"
+ tmake_file="${tmake_file} mips/t-st"
+ enable_mips_multilibs="yes"
+ ;;
+ mips64octeon*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
+ target_cpu_default=MASK_SOFT_FLOAT_ABI
+ enable_mips_multilibs="yes"
+ ;;
+ mipsisa64r6*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ default_mips_arch=mips64r6
+ enable_mips_multilibs="yes"
+ ;;
+ mipsisa64r2*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ default_mips_arch=mips64r2
+ enable_mips_multilibs="yes"
+ ;;
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+- default_mips_abi=n32
++ default_mips_abi=64
+ enable_mips_multilibs="yes"
+ ;;
+ esac
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 000000000..de7b4df57
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,234 @@
+From d6c983b685ee03e9cf21189108d31ed9f760ff3f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 20/47] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h | 4 ++--
+ gcc/config/arm/linux-eabi.h | 4 ++--
+ gcc/config/arm/linux-elf.h | 2 +-
+ gcc/config/i386/linux.h | 2 +-
+ gcc/config/i386/linux64.h | 6 +++---
+ gcc/config/linux.h | 8 ++++----
+ gcc/config/mips/linux.h | 12 ++++++------
+ gcc/config/rs6000/linux64.h | 16 ++++++----------
+ gcc/config/sh/linux.h | 2 +-
+ gcc/config/sparc/linux.h | 2 +-
+ gcc/config/sparc/linux64.h | 4 ++--
+ 11 files changed, 29 insertions(+), 33 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index 2c39fbe601c..6d88e21abe2 100644
+--- a/gcc/config/alpha/linux-elf.h
++++ b/gcc/config/alpha/linux-elf.h
+@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index a08cfb34377..fbac9a9d994 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -62,8 +62,8 @@
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
+
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+
+ #define GLIBC_DYNAMIC_LINKER \
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 3d62367ae68..e8a16191849 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
+
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} \
+ %{static:-Bstatic} \
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index 59132124d6b..336d158629c 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index e65c404ff91..c34ded98481 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -27,9 +27,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+
+ #undef MUSL_DYNAMIC_LINKER32
+ #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index b3a9e85e77f..2e683d0c430 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -81,10 +81,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+ GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+ supporting both 32-bit and 64-bit compilation. */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index 44132b8e44d..80505ad9f48 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3. If not see
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+
+ #define GLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+
+ #undef UCLIBC_DYNAMIC_LINKER32
+ #define UCLIBC_DYNAMIC_LINKER32 \
+- "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ #undef UCLIBC_DYNAMIC_LINKER64
+ #define UCLIBC_DYNAMIC_LINKER64 \
+- "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+- "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
++ "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+
+ #undef MUSL_DYNAMIC_LINKER32
+ #define MUSL_DYNAMIC_LINKER32 \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 71e35b709ad..3b00ec0fcf0 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -412,16 +412,11 @@ extern int dot_symbols;
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "%(dynamic_linker_prefix)/lib/ld.so.1"
+-
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 \
+-"%{mabi=elfv1:%(dynamic_linker_prefix)/lib64/ld64.so.1;" \
+-":%(dynamic_linker_prefix)/lib64/ld64.so.2}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
+ #else
+-#define GLIBC_DYNAMIC_LINKER64 \
+-"%{mabi=elfv2:%(dynamic_linker_prefix)/lib64/ld64.so.2;" \
+-":%(dynamic_linker_prefix)/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+
+ #define MUSL_DYNAMIC_LINKER32 \
+@@ -429,8 +424,9 @@ extern int dot_symbols;
+ #define MUSL_DYNAMIC_LINKER64 \
+ "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
+
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U, M) \
+ "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index c30083423f2..196b82725f8 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see
+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP \
+ "%{mfdpic:-fdpic}.so.1"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "%{mfdpic:_fd;:_linux}"
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index ce084656fca..bed6300cb2a 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
+index 573ce8a9a4c..6749f6b5d9c 100644
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -84,8 +84,8 @@ along with GCC; see the file COPYING3. If not see
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+
+ #ifdef SPARC_BI_ARCH
+
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 000000000..4e562144e
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0021-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From 80c24247fed52c1269791088090bc0fa85280983 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 21/47] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 7b590c9bbd3..23cca7f0d5a 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3459,7 +3459,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+- headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
++ headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ for file in $$headers; do \
+ if [ -f $$file ] ; then \
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch
new file mode 100644
index 000000000..871f195c9
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0022-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From 3021fec485f44478a3d5fffb4adac13d831fcdc1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 22/47] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure | 12 ++++++------
+ gcc/configure.ac | 18 +++++++++---------
+ libstdc++-v3/configure | 6 +++---
+ libstdc++-v3/configure.ac | 2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index b5ac1552541..08b2f63c7fa 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -28967,12 +28967,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index cb1479d1ef4..0581fe963dc 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5754,15 +5754,15 @@ fi
+ AC_SUBST([enable_default_ssp])
+
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+- have_sys_sdt_h=yes
+- AC_DEFINE(HAVE_SYS_SDT_H, 1,
+- [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++# have_sys_sdt_h=yes
++# AC_DEFINE(HAVE_SYS_SDT_H, 1,
++# [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index fb7e126c0b0..a18057feb88 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -21856,11 +21856,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+- if test $glibcxx_cv_sys_sdt_h = yes; then
++# if test $glibcxx_cv_sys_sdt_h = yes; then
+
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+
+- fi
++# fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 8e973503be0..a46d25e740d 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -230,7 +230,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch
new file mode 100644
index 000000000..27dfb1fdd
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0023-libtool.patch
@@ -0,0 +1,42 @@
+From e79a4f8169e836c8deabca5a45884cfe11d07847 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 23/47] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec85d70..0121fba707f 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
++ if test -n "$install_libdir"; then
++ func_normal_abspath "$install_libdir"
++ install_libdir=$func_normal_abspath_result
++ fi
+
+ oldlibs=
+ if test -z "$rpath"; then
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 000000000..aa1e1bb8b
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,43 @@
+From 74d8dc48cb185e304c60067b4d8b50447ec328ec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 24/47] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index fbac9a9d994..5a51a8a7095 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -88,10 +88,14 @@
+ #define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
+
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC \
++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 000000000..b23413231
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From ac50dc3010a66220ad483c09efe270bb3f4c9424 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 25/47] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure | 22 ++++++++++++++++++----
+ gcc/configure.ac | 22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 08b2f63c7fa..6ba391ed068 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -12130,10 +12130,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -12144,6 +12154,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 0581fe963dc..8551a412df3 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1902,10 +1902,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+- if test -f ${srcdir}/config/$f
+- then
+- tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+- fi
++ case $f in
++ */t-linux64 )
++ if test -f ./config/$f
++ then
++ tmake_file_="${tmake_file_} ./config/$f"
++ fi
++ ;;
++ * )
++ if test -f ${srcdir}/config/$f
++ then
++ tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++ fi
++ ;;
++ esac
+ done
+ tmake_file="${tmake_file_}"
+
+@@ -1916,6 +1926,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+ case $f in
++ */linux64.h )
++ tm_file_list="${tm_file_list} ./config/$f"
++ tm_include_list="${tm_include_list} ./config/$f"
++ ;;
+ ./* )
+ f=`echo $f | sed 's/^..//'`
+ tm_file_list="${tm_file_list} $f"
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
new file mode 100644
index 000000000..fe2471347
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -0,0 +1,31 @@
+From 9fab47d8662986ad887d9eddc39fcbe25e576383 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:39:38 +0000
+Subject: [PATCH 26/47] Avoid using libdir from .la which usually points to a
+ host path
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 0121fba707f..52bdbdb5f9c 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
++ # Instead of using libdir from .la which usually points to a host path,
++ # use the path the .la is contained in.
++ libdir="$abs_ladir"
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch
new file mode 100644
index 000000000..4f9e1f0b2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0027-export-CPP.patch
@@ -0,0 +1,53 @@
+From fa6a46fdf73de7eacd289c084bbde6643b23f73b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:40:59 +0000
+Subject: [PATCH 27/47] export CPP
+
+The OE environment sets and exports CPP as being the target gcc. When
+building gcc-cross-canadian for a mingw targetted sdk, the following can be found
+in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be
+using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32
+headers are very different, using the wrong cpp is a real problem. It is leaking
+into configure through the CPP variable. Ultimately this leads to build
+failures related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build
+environment when using build targets. We could define a CPP_FOR_BUILD value which may be
+the version which needs to be upstreamed but for now, this fix is good enough to
+avoid the problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index b824e0a0ca1..e34e9555388 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -149,6 +149,7 @@ BUILD_EXPORTS = \
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
++ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 000000000..b903349d5
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,56 @@
+From 2c05b4072f982df8002d61327837e18a724e934f Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH 28/47] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc | 9 ++++++++-
+ gcc/config/rs6000/linuxspe.h | 3 ---
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 5e45f4b5199..9b381dfd9af 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2415,7 +2415,14 @@ powerpc-*-rtems*)
+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
+ ;;
+ powerpc*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++ case ${target} in
++ powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++ ;;
++ *)
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h"
++ ;;
++ esac
+ extra_options="${extra_options} rs6000/sysv4.opt"
+ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
+ extra_objs="$extra_objs rs6000-linux.o"
+diff --git a/gcc/config/rs6000/linuxspe.h b/gcc/config/rs6000/linuxspe.h
+index 92efabfe664..6d486451a7e 100644
+--- a/gcc/config/rs6000/linuxspe.h
++++ b/gcc/config/rs6000/linuxspe.h
+@@ -27,6 +27,3 @@
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT MASK_STRICT_ALIGN
+ #endif
+-
+-#undef ASM_DEFAULT_SPEC
+-#define ASM_DEFAULT_SPEC "-mppc -mspe -me500"
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
new file mode 100644
index 000000000..7306a282b
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
@@ -0,0 +1,42 @@
+From ec0f843b86c0f76bc5ebb20fafbc4aae1be4db61 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:21:55 +0000
+Subject: [PATCH 29/47] Disable the MULTILIB_OSDIRNAMES and other multilib
+ options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64. This is allowed by the
+ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the
+normal libdir.
+
+Upstream-Status: Inappropriate[OE-Specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/t-aarch64-linux | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
+index ab064ab6f22..f4b1f98b216 100644
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -21,8 +21,8 @@
+ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
++#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch
new file mode 100644
index 000000000..568ba95ea
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0030-Ensure-target-gcc-headers-can-be-included.patch
@@ -0,0 +1,98 @@
+From bf5836989e0ffc1c1df1369df06877e96c08df41 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:25:11 +0000
+Subject: [PATCH 30/47] Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/Makefile.in | 2 ++
+ gcc/cppdefault.c | 4 ++++
+ gcc/defaults.h | 9 +++++++++
+ gcc/gcc.c | 7 -------
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 23cca7f0d5a..95d21effad3 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -608,6 +608,7 @@ libexecdir = @libexecdir@
+
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+ # Directory in which all plugin resources are installed
+@@ -2791,6 +2792,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
+
+ PREPROCESSOR_DEFINES = \
+ -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++ -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+ -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+ -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index 10b96eca0a7..c8da0884872 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -59,6 +59,10 @@ const struct default_include cpp_include_defaults[]
+ /* This is the dir for gcc's private headers. */
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++ /* This is the dir for gcc's private headers under the specified sysroot. */
++ { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index 7ad92d920f8..39848cc9c0e 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1475,4 +1475,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB
+ #endif
+
++/* Default prefixes to attach to command names. */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index c73d4023987..b27245dbf77 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1472,13 +1472,6 @@ static const char *gcc_libexec_prefix;
+
+ /* Default prefixes to attach to command names. */
+
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
new file mode 100644
index 000000000..0184010f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
@@ -0,0 +1,54 @@
+From c7b4d957edda955fbe405fd5295846614529f517 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 11:17:19 +0000
+Subject: [PATCH 31/47] gcc 4.8+ won't build with --disable-dependency-tracking
+
+since the *.Ppo files don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP
+2012/09/22
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libatomic/Makefile.am | 3 ++-
+ libatomic/Makefile.in | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
+index d731406fdbd..2fafc72d2e7 100644
+--- a/libatomic/Makefile.am
++++ b/libatomic/Makefile.am
+@@ -101,7 +101,8 @@ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
+index f6eeab312ea..3f06a894058 100644
+--- a/libatomic/Makefile.in
++++ b/libatomic/Makefile.in
+@@ -331,7 +331,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch
new file mode 100644
index 000000000..e8905f525
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -0,0 +1,38 @@
+From 3be6b766a5881b0b187c3c3c68250a9e4f7c0fa3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Mar 2015 08:21:19 +0000
+Subject: [PATCH 32/47] Don't search host directory during "relink" if
+ $inst_prefix is provided
+
+http://lists.gnu.org/archive/html/libtool-patches/2011-01/msg00026.html
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 52bdbdb5f9c..82bcec39f05 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6004,12 +6004,13 @@ func_mode_link ()
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
++ # Default if $libdir is not relative to the prefix:
+ add_dir="-L$libdir"
+- # Try looking first in the location we're being installed to.
++
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+- add_dir="$add_dir -L$inst_prefix_dir$libdir"
++ add_dir="-L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 000000000..c0b8df3e7
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,29 @@
+From 6edcab9046b862cbb9b46892fc390ce69976539c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:15:27 -0700
+Subject: [PATCH 33/47] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [OE-Specific]
+
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index c45fc1d35d1..a7afe197266 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,7 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch
new file mode 100644
index 000000000..7d866d906
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0034-aarch64-Add-support-for-musl-ldso.patch
@@ -0,0 +1,28 @@
+From b140d6839cfba9cac892bc736d984540552d6a56 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:18:39 -0700
+Subject: [PATCH 34/47] aarch64: Add support for musl ldso
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [OE-Specific]
+
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index a7afe197266..580c2c7ea15 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -24,7 +24,7 @@
+ #define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
+ #undef MUSL_DYNAMIC_LINKER
+-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define MUSL_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch
new file mode 100644
index 000000000..e2c1956d1
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -0,0 +1,54 @@
+From 63617f2da153db10fa2fe938cce31bee01d47fe8 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 5 Jul 2015 20:25:18 -0700
+Subject: [PATCH 35/47] libcc1: fix libcc1's install path and rpath
+
+* Install libcc1.so and libcc1plugin.so into
+ $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version), as what we
+ had done to lto-plugin.
+* Fix bad RPATH iussue:
+ gcc-5.2.0: package gcc-plugins contains bad RPATH /patht/to/tmp/sysroots/qemux86-64/usr/lib64/../lib64 in file
+ /path/to/gcc/5.2.0-r0/packages-split/gcc-plugins/usr/lib64/gcc/x86_64-poky-linux/5.2.0/plugin/libcc1plugin.so.0.0.0
+ [rpaths]
+
+Upstream-Status: Inappropriate [OE configuration]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libcc1/Makefile.am | 4 ++--
+ libcc1/Makefile.in | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
+index 5e61a92a26b..e8b627f9cec 100644
+--- a/libcc1/Makefile.am
++++ b/libcc1/Makefile.am
+@@ -37,8 +37,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ $(Wc)$(libiberty_normal)))
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+
+ if ENABLE_PLUGIN
+ plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
+diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
+index 54babb02a49..e51d87ffdce 100644
+--- a/libcc1/Makefile.in
++++ b/libcc1/Makefile.in
+@@ -303,8 +303,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ $(Wc)$(libiberty_normal)))
+
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+ @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
+ @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
+ BUILT_SOURCES = c-compiler-name.h cp-compiler-name.h
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch
new file mode 100644
index 000000000..aa0b10827
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0036-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -0,0 +1,213 @@
+From ca14820ae834a62ef2b80b283e8f900714636272 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:39:54 +0000
+Subject: [PATCH 36/47] handle sysroot support for nativesdk-gcc
+
+Being able to build a nativesdk gcc is useful, particularly in cases
+where the host compiler may be of an incompatible version (or a 32
+bit compiler is needed).
+
+Sadly, building nativesdk-gcc is not straight forward. We install
+nativesdk-gcc into a relocatable location and this means that its
+library locations can change. "Normal" sysroot support doesn't help
+in this case since the values of paths like "libdir" change, not just
+base root directory of the system.
+
+In order to handle this we do two things:
+
+a) Add %r into spec file markup which can be used for injected paths
+ such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
+b) Add other paths which need relocation into a .gccrelocprefix section
+ which the relocation code will notice and adjust automatically.
+
+Upstream-Status: Inappropriate
+RP 2015/7/28
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/cppdefault.c | 50 +++++++++++++++++++++++++++++++++++++-------------
+ gcc/cppdefault.h | 3 ++-
+ gcc/gcc.c | 20 ++++++++++++++------
+ 3 files changed, 53 insertions(+), 20 deletions(-)
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index c8da0884872..43dc597a0c3 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -35,6 +35,30 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+
++static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
++static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
++static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
++static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
++static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
++#ifdef LOCAL_INCLUDE_DIR
++static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
++#endif
++#ifdef PREFIX_INCLUDE_DIR
++static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
++#endif
++#ifdef FIXED_INCLUDE_DIR
++static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
++#endif
++#ifdef CROSS_INCLUDE_DIR
++static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
++#endif
++#ifdef TOOL_INCLUDE_DIR
++static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
++#endif
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
++#endif
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+ /* Pick up GNU C++ generic include files. */
+- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+ /* Pick up GNU C++ target-dependent include files. */
+- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+ /* Pick up GNU C++ backward and deprecated include files. */
+- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+ /* This is the dir for gcc's private headers. */
+- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_SUBDIR_TARGET
+ /* This is the dir for gcc's private headers under the specified sysroot. */
+- { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++ { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+ /* /usr/local/include comes before the fixincluded header files. */
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+- { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
++ { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
++ { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef FIXED_INCLUDE_DIR
+ /* This is the dir for fixincludes. */
+- { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
++ { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
+ /* A multilib suffix needs adding if different multilibs use
+ different headers. */
+ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
+@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+ /* One place the target system's headers might be. */
+- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++ { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+ /* Another place the target system's headers might be. */
+- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
++ { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+ /* /usr/include comes dead last. */
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
+- { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
++ { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
+ #endif
+ { 0, 0, 0, 0, 0, 0 }
+ };
+diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
+index 17bbb0eaef7..a937ec1d187 100644
+--- a/gcc/cppdefault.h
++++ b/gcc/cppdefault.h
+@@ -33,7 +33,8 @@
+
+ struct default_include
+ {
+- const char *const fname; /* The name of the directory. */
++ const char *fname; /* The name of the directory. */
++
+ const char *const component; /* The component containing the directory
+ (see update_path in prefix.c) */
+ const char cplusplus; /* Only look here if we're compiling C++. */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index b27245dbf77..e015c77f15f 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -247,6 +247,8 @@ FILE *report_times_to_file = NULL;
+ #endif
+ static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
+
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
++
+ /* Nonzero means pass the updated target_system_root to the compiler. */
+
+ static int target_system_root_changed;
+@@ -518,6 +520,7 @@ or with constant text in a single argument.
+ %G process LIBGCC_SPEC as a spec.
+ %R Output the concatenation of target_system_root and
+ target_sysroot_suffix.
++ %r Output the base path target_relocatable_prefix
+ %S process STARTFILE_SPEC as a spec. A capital S is actually used here.
+ %E process ENDFILE_SPEC as a spec. A capital E is actually used here.
+ %C process CPP_SPEC as a spec.
+@@ -1495,10 +1498,10 @@ static const char *gcc_libexec_prefix;
+ gcc_exec_prefix is set because, in that case, we know where the
+ compiler has been installed, and use paths relative to that
+ location instead. */
+-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
++static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
++static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
++static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
++static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+
+ /* For native compilers, these are well-known paths containing
+ components that may be provided by the system. For cross
+@@ -1506,9 +1509,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+ static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_1
++static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_2
++static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
+ = STANDARD_STARTFILE_PREFIX_2;
+
+ /* A relative path to be used in finding the location of tools
+@@ -5826,6 +5829,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
+ }
+ break;
+
++ case 'r':
++ obstack_grow (&obstack, target_relocatable_prefix,
++ strlen (target_relocatable_prefix));
++ break;
++
+ case 'S':
+ value = do_spec_1 (startfile_spec, 0, NULL);
+ if (value != 0)
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch
new file mode 100644
index 000000000..6c85a03f4
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch
@@ -0,0 +1,102 @@
+From 16a326bcd126b395b29019072905bae7a5d47500 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:41:45 +0000
+Subject: [PATCH 37/47] Search target sysroot gcc version specific dirs with
+ multilib.
+
+We install the gcc libraries (such as crtbegin.p) into
+<sysroot><libdir>/<target-sys>/5.2.0/
+which is a default search path for GCC (aka multi_suffix in the
+code below). <target-sys> is 'machine' in gcc's terminology. We use
+these directories so that multiple gcc versions could in theory
+co-exist on target.
+
+We only want to build one gcc-cross-canadian per arch and have this work
+for all multilibs. <target-sys> can be handled by mapping the multilib
+<target-sys> to the one used by gcc-cross-canadian, e.g.
+mips64-polkmllib32-linux
+is symlinked to by mips64-poky-linux.
+
+The default gcc search path in the target sysroot for a "lib64" mutlilib
+is:
+
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+which means that the lib32 crtbegin.o will be found and the lib64 ones
+will not which leads to compiler failures.
+
+This patch injects a multilib version of that path first so the lib64
+binaries can be found first. With this change the search path becomes:
+
+<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+Upstream-Status: Pending
+RP 2015/7/31
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/gcc.c | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index e015c77f15f..84af5d5a2e1 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -2533,7 +2533,7 @@ for_each_path (const struct path_prefix *paths,
+ if (path == NULL)
+ {
+ len = paths->max_len + extra_space + 1;
+- len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
++ len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
+ path = XNEWVEC (char, len);
+ }
+
+@@ -2545,6 +2545,33 @@ for_each_path (const struct path_prefix *paths,
+ /* Look first in MACHINE/VERSION subdirectory. */
+ if (!skip_multi_dir)
+ {
++ if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++ {
++ const char *this_multi;
++ size_t this_multi_len;
++
++ if (pl->os_multilib)
++ {
++ this_multi = multi_os_dir;
++ this_multi_len = multi_os_dir_len;
++ }
++ else
++ {
++ this_multi = multi_dir;
++ this_multi_len = multi_dir_len;
++ }
++
++ /* Look in multilib MACHINE/VERSION subdirectory first */
++ if (this_multi_len)
++ {
++ memcpy (path + len, this_multi, this_multi_len + 1);
++ memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
++ ret = callback (path, callback_info);
++ if (ret)
++ break;
++ }
++ }
++
+ memcpy (path + len, multi_suffix, suffix_len + 1);
+ ret = callback (path, callback_info);
+ if (ret)
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch
new file mode 100644
index 000000000..a226d10d0
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0038-Fix-various-_FOR_BUILD-and-related-variables.patch
@@ -0,0 +1,137 @@
+From 6e7f526e71a76aac3d49ba8f1742fe1b359c1060 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Dec 2015 23:42:45 +0000
+Subject: [PATCH 38/47] Fix various _FOR_BUILD and related variables
+
+When doing a FOR_BUILD thing, you have to override CFLAGS with
+CFLAGS_FOR_BUILD. And if you use C++, you also have to override
+CXXFLAGS with CXXFLAGS_FOR_BUILD.
+Without this, when building for mingw, you end up trying to use
+the mingw headers for a host build.
+
+The same goes for other variables as well, such as CPPFLAGS,
+CPP, and GMPINC.
+
+Upstream-Status: Pending
+
+Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 6 ++++++
+ Makefile.tpl | 5 +++++
+ gcc/Makefile.in | 2 +-
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ 5 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index e34e9555388..a03740f3f9d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -152,6 +152,7 @@ BUILD_EXPORTS = \
+ CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+@@ -169,6 +170,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -186,6 +190,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+@@ -734,6 +739,7 @@ BASE_FLAGS_TO_PASS = \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
+ "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
++ "CXXFLAGS_FOR_BUILD=$(CXXFLAGS_FOR_BUILD)" \
+ "EXPECT=$(EXPECT)" \
+ "FLEX=$(FLEX)" \
+ "INSTALL=$(INSTALL)" \
+diff --git a/Makefile.tpl b/Makefile.tpl
+index d0fa07005be..953376c658d 100644
+--- a/Makefile.tpl
++++ b/Makefile.tpl
+@@ -154,6 +154,7 @@ BUILD_EXPORTS = \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+@@ -171,6 +172,9 @@ BUILD_EXPORTS = \
+ # built for the build system to override those in BASE_FLAGS_TO_PASS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
++ CPP="$(CC_FOR_BUILD) -E" \
++ CPPFLAGS="$(CPPFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
+@@ -188,6 +192,7 @@ HOST_SUBDIR = @host_subdir@
+ HOST_EXPORTS = \
+ $(BASE_EXPORTS) \
+ CC="$(CC)"; export CC; \
++ CPP="$(CC) -E"; export CPP; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 95d21effad3..dbe2bacde50 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -795,7 +795,7 @@ BUILD_LDFLAGS=@BUILD_LDFLAGS@
+ BUILD_NO_PIE_FLAG = @BUILD_NO_PIE_FLAG@
+ BUILD_LDFLAGS += $(BUILD_NO_PIE_FLAG)
+ BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
+- -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS)
++ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS_FOR_BUILD)
+
+ # Actual name to use when installing a native compiler.
+ GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
+diff --git a/gcc/configure b/gcc/configure
+index 6ba391ed068..72ca6e5c535 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11789,7 +11789,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 8551a412df3..6eefb61dc2b 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1708,7 +1708,7 @@ else
+ CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+ CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \
+ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \
+- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \
+ ${realsrcdir}/configure \
+ --enable-languages=${enable_languages-all} \
+ --target=$target_alias --host=$build_alias --build=$build_alias
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch
new file mode 100644
index 000000000..a7aeccdf0
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch
@@ -0,0 +1,28 @@
+From 6d03ddfb7a092942be6b58b1830f6986d012d5e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 2 Feb 2016 10:26:10 -0800
+Subject: [PATCH 39/47] nios2: Define MUSL_DYNAMIC_LINKER
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [OE-Specific]
+
+ gcc/config/nios2/linux.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gcc/config/nios2/linux.h b/gcc/config/nios2/linux.h
+index 5177fa641a4..1b8accda6ee 100644
+--- a/gcc/config/nios2/linux.h
++++ b/gcc/config/nios2/linux.h
+@@ -30,6 +30,7 @@
+ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-nios2.so.1"
+
+ #undef LINK_SPEC
+ #define LINK_SPEC LINK_SPEC_ENDIAN \
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
new file mode 100644
index 000000000..29b7ce72d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0040-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch
@@ -0,0 +1,87 @@
+From 210f6b3b82084cc756e02b8bc12f909a43b14ee8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 18:10:54 -0700
+Subject: [PATCH 40/49] Add ssp_nonshared to link commandline for musl targets
+
+when -fstack-protector options are enabled we need to
+link with ssp_shared on musl since it does not provide
+the __stack_chk_fail_local() so essentially it provides
+libssp but not libssp_nonshared something like
+TARGET_LIBC_PROVIDES_SSP_BUT_NOT_SSP_NONSHARED
+ where-as for glibc the needed symbols
+are already present in libc_nonshared library therefore
+we do not need any library helper on glibc based systems
+but musl needs the libssp_noshared from gcc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/linux.h | 7 +++++++
+ gcc/config/rs6000/linux.h | 10 ++++++++++
+ gcc/config/rs6000/linux64.h | 10 ++++++++++
+ 3 files changed, 27 insertions(+)
+
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 2e683d0c430..1b4df798671 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -182,6 +182,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
+ { 0, 0, 0, 0, 0, 0 } \
+ }
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++ "|fstack-protector-strong|fstack-protector-explicit" \
++ ":-lssp_nonshared}"
++#endif
++
+ #endif
+
+ #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
+diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
+index 684afd6c190..22cfa391b89 100644
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -91,6 +91,16 @@
+ " -m elf32ppclinux")
+ #endif
+
++/* link libssp_nonshared.a with musl */
++#if DEFAULT_LIBC == LIBC_MUSL
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++ "|fstack-protector-strong|fstack-protector-explicit" \
++ ":-lssp_nonshared}"
++#endif
++#endif
++
+ #undef LINK_OS_LINUX_SPEC
+ #define LINK_OS_LINUX_SPEC LINK_OS_LINUX_EMUL " %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 3b00ec0fcf0..8371f8d7b6b 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -465,6 +465,16 @@ extern int dot_symbols;
+ " -m elf64ppc")
+ #endif
+
++/* link libssp_nonshared.a with musl */
++#if DEFAULT_LIBC == LIBC_MUSL
++#ifdef TARGET_LIBC_PROVIDES_SSP
++#undef LINK_SSP_SPEC
++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
++ "|fstack-protector-strong|fstack-protector-explicit" \
++ ":-lssp_nonshared}"
++#endif
++#endif
++
+ #define LINK_OS_LINUX_SPEC32 LINK_OS_LINUX_EMUL32 " %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
+--
+2.13.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch
new file mode 100644
index 000000000..5260e363d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch
@@ -0,0 +1,284 @@
+From 4eadc99bdd0974761bf48f0fd32994dd9a3ffcfe Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 02:27:43 -0400
+Subject: [PATCH 41/47] gcc/libcpp: support -ffile-prefix-map=<old>=<new>
+
+Similar -fdebug-prefix-map, add option -ffile-prefix-map to map one
+directory name (old) to another (new) in __FILE__, __BASE_FILE__ and
+__builtin_FILE ().
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/c-family/c-opts.c | 13 +++++++
+ gcc/c-family/c.opt | 4 +++
+ gcc/dwarf2out.c | 1 +
+ gcc/gimplify.c | 2 ++
+ libcpp/Makefile.in | 10 +++---
+ libcpp/file-map.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++
+ libcpp/include/file-map.h | 30 ++++++++++++++++
+ libcpp/macro.c | 2 ++
+ 8 files changed, 149 insertions(+), 5 deletions(-)
+ create mode 100644 libcpp/file-map.c
+ create mode 100644 libcpp/include/file-map.h
+
+diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
+index ea0e01b101c..a741c75a78f 100644
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -39,6 +39,14 @@ along with GCC; see the file COPYING3. If not see
+ #include "opts.h"
+ #include "plugin.h" /* For PLUGIN_INCLUDE_FILE event. */
+ #include "mkdeps.h"
++#include "file-map.h"
++#include "c-target.h"
++#include "tm.h" /* For BYTES_BIG_ENDIAN,
++ DOLLARS_IN_IDENTIFIERS,
++ STDC_0_IN_SYSTEM_HEADERS,
++ TARGET_FLT_EVAL_METHOD_NON_DEFAULT and
++ TARGET_OPTF. */
++#include "tm_p.h" /* For C_COMMON_OVERRIDE_OPTIONS. */
+ #include "dumpfile.h"
+
+ #ifndef DOLLARS_IN_IDENTIFIERS
+@@ -517,6 +525,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
+ cpp_opts->narrow_charset = arg;
+ break;
+
++ case OPT_ffile_prefix_map_:
++ if (add_file_prefix_map (arg) < 0)
++ error ("invalid argument %qs to -ffile-prefix-map", arg);
++ break;
++
+ case OPT_fwide_exec_charset_:
+ cpp_opts->wide_charset = arg;
+ break;
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index c4ef7796282..73333dfd57c 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1372,6 +1372,10 @@ fexec-charset=
+ C ObjC C++ ObjC++ Joined RejectNegative
+ -fexec-charset=<cset> Convert all strings and character constants to character set <cset>.
+
++ffile-prefix-map=
++C ObjC C++ ObjC++ Joined RejectNegative
++-ffile-prefix-map=<old=new> Map one directory name to another in __FILE__, __BASE_FILE__ and __builtin_FILE ()
++
+ fextended-identifiers
+ C ObjC C++ ObjC++
+ Permit universal character names (\\u and \\U) in identifiers.
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 98c51576ec2..762f69ae88e 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -23421,6 +23421,7 @@ gen_producer_string (void)
+ case OPT_fltrans_output_list_:
+ case OPT_fresolution_:
+ case OPT_fdebug_prefix_map_:
++ case OPT_ffile_prefix_map_:
+ /* Ignore these. */
+ continue;
+ default:
+diff --git a/gcc/gimplify.c b/gcc/gimplify.c
+index fd27eb1523f..5542b379f28 100644
+--- a/gcc/gimplify.c
++++ b/gcc/gimplify.c
+@@ -58,6 +58,8 @@ along with GCC; see the file COPYING3. If not see
+ #include "gomp-constants.h"
+ #include "tree-dump.h"
+ #include "gimple-walk.h"
++#include "file-map.h"
++
+ #include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
+ #include "builtins.h"
+ #include "asan.h"
+diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
+index 0bd3787c25e..d3b52956b52 100644
+--- a/libcpp/Makefile.in
++++ b/libcpp/Makefile.in
+@@ -84,12 +84,12 @@ DEPMODE = $(CXXDEPMODE)
+
+
+ libcpp_a_OBJS = charset.o directives.o directives-only.o errors.o \
+- expr.o files.o identifiers.o init.o lex.o line-map.o macro.o \
+- mkdeps.o pch.o symtab.o traditional.o
++ expr.o file-map.o files.o identifiers.o init.o lex.o line-map.o \
++ macro.o mkdeps.o pch.o symtab.o traditional.o
+
+ libcpp_a_SOURCES = charset.c directives.c directives-only.c errors.c \
+- expr.c files.c identifiers.c init.c lex.c line-map.c macro.c \
+- mkdeps.c pch.c symtab.c traditional.c
++ expr.c file-map.c files.c identifiers.c init.c lex.c line-map.c \
++ macro.c mkdeps.c pch.c symtab.c traditional.c
+
+ all: libcpp.a $(USED_CATALOGS)
+
+@@ -263,7 +263,7 @@ po/$(PACKAGE).pot: $(libcpp_a_SOURCES)
+
+ TAGS_SOURCES = $(libcpp_a_SOURCES) internal.h ucnid.h \
+ include/line-map.h include/symtab.h include/cpp-id-data.h \
+- include/cpplib.h include/mkdeps.h system.h
++ include/cpplib.h include/mkdeps.h system.h include/file-map.h
+
+ TAGS: $(TAGS_SOURCES)
+ cd $(srcdir) && etags $(TAGS_SOURCES)
+diff --git a/libcpp/file-map.c b/libcpp/file-map.c
+new file mode 100644
+index 00000000000..18035ef6a72
+--- /dev/null
++++ b/libcpp/file-map.c
+@@ -0,0 +1,92 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#include "config.h"
++#include "system.h"
++#include "file-map.h"
++
++/* Structure recording the mapping from source file and directory
++ names at compile time to __FILE__ */
++typedef struct file_prefix_map
++{
++ const char *old_prefix;
++ const char *new_prefix;
++ size_t old_len;
++ size_t new_len;
++ struct file_prefix_map *next;
++} file_prefix_map;
++
++/* Linked list of such structures. */
++static file_prefix_map *file_prefix_maps;
++
++/* Record prefix mapping of __FILE__. ARG is the argument to
++ -ffile-prefix-map and must be of the form OLD=NEW. */
++int
++add_file_prefix_map (const char *arg)
++{
++ file_prefix_map *map;
++ const char *p;
++
++ p = strchr (arg, '=');
++ if (!p)
++ {
++ fprintf(stderr, "invalid argument %qs to -ffile-prefix-map", arg);
++ return -1;
++ }
++ map = XNEW (file_prefix_map);
++ map->old_prefix = xstrndup (arg, p - arg);
++ map->old_len = p - arg;
++ p++;
++ map->new_prefix = xstrdup (p);
++ map->new_len = strlen (p);
++ map->next = file_prefix_maps;
++ file_prefix_maps = map;
++
++ return 0;
++}
++
++/* Perform user-specified mapping of __FILE__ prefixes. Return
++ the new name corresponding to filename. */
++
++const char *
++remap_file_filename (const char *filename)
++{
++ file_prefix_map *map;
++ char *s;
++ const char *name;
++ size_t name_len;
++
++ for (map = file_prefix_maps; map; map = map->next)
++ if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ break;
++ if (!map)
++ return filename;
++ name = filename + map->old_len;
++ name_len = strlen (name) + 1;
++ s = (char *) alloca (name_len + map->new_len);
++ memcpy (s, map->new_prefix, map->new_len);
++ memcpy (s + map->new_len, name, name_len);
++
++ return xstrdup (s);
++}
++
++
+diff --git a/libcpp/include/file-map.h b/libcpp/include/file-map.h
+new file mode 100644
+index 00000000000..87503152d27
+--- /dev/null
++++ b/libcpp/include/file-map.h
+@@ -0,0 +1,30 @@
++/* Map one directory name to another in __FILE__, __BASE_FILE__
++ and __builtin_FILE ().
++ Copyright (C) 2001-2016 Free Software Foundation, Inc.
++
++This program is free software; you can redistribute it and/or modify it
++under the terms of the GNU General Public License as published by the
++Free Software Foundation; either version 3, or (at your option) any
++later version.
++
++This program is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with this program; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>.
++
++ In other words, you are welcome to use, share and improve this program.
++ You are forbidden to forbid anyone else to use, share and improve
++ what you give them. Help stamp out software-hoarding! */
++
++#ifndef LIBCPP_FILE_MAP_H
++#define LIBCPP_FILE_MAP_H
++
++const char * remap_file_filename (const char *filename);
++
++int add_file_prefix_map (const char *arg);
++
++#endif /* !LIBCPP_FILE_MAP_H */
+diff --git a/libcpp/macro.c b/libcpp/macro.c
+index de18c2210cf..2748c70d520 100644
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -26,6 +26,7 @@ along with this program; see the file COPYING3. If not see
+ #include "system.h"
+ #include "cpplib.h"
+ #include "internal.h"
++#include "file-map.h"
+
+ typedef struct macro_arg macro_arg;
+ /* This structure represents the tokens of a macro argument. These
+@@ -301,6 +302,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node,
+ if (!name)
+ abort ();
+ }
++ name = remap_file_filename (name);
+ len = strlen (name);
+ buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ result = buf;
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
new file mode 100644
index 000000000..524716790
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch
@@ -0,0 +1,43 @@
+From ddddc7335539fb8a6d30beba21781762df159186 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Mar 2016 05:39:59 -0400
+Subject: [PATCH 42/47] Reuse -fdebug-prefix-map to replace -ffile-prefix-map
+
+The oe-core may use external toolchain to compile,
+which may not support -ffile-prefix-map.
+
+Since we use -fdebug-prefix-map to do the same thing,
+so we could reuse it to replace -ffile-prefix-map.
+
+Upstream-Status: Inappropriate[oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/opts-global.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gcc/opts-global.c b/gcc/opts-global.c
+index 50bad77c347..32b1d286721 100644
+--- a/gcc/opts-global.c
++++ b/gcc/opts-global.c
+@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "langhooks.h"
+ #include "dbgcnt.h"
+ #include "debug.h"
++#include "file-map.h"
+ #include "output.h"
+ #include "plugin.h"
+ #include "toplev.h"
+@@ -357,6 +358,9 @@ handle_common_deferred_options (void)
+
+ case OPT_fdebug_prefix_map_:
+ add_debug_prefix_map (opt->arg);
++
++ /* Reuse -fdebug-prefix-map to replace -ffile-prefix-map */
++ add_file_prefix_map (opt->arg);
+ break;
+
+ case OPT_fdump_:
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
new file mode 100644
index 000000000..74a5c8644
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch
@@ -0,0 +1,54 @@
+From 5bc97be388485a5f8dd85db34372a1299bffd263 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 24 Mar 2016 11:23:14 -0400
+Subject: [PATCH 43/47] gcc/final.c: -fdebug-prefix-map support to remap
+ sources with relative path
+
+PR other/70428
+* final.c (remap_debug_filename): Use lrealpath to translate
+relative path before remapping
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70428
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/final.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/final.c b/gcc/final.c
+index 820162b2d28..d74cb901abd 100644
+--- a/gcc/final.c
++++ b/gcc/final.c
+@@ -1559,16 +1559,25 @@ remap_debug_filename (const char *filename)
+ const char *name;
+ size_t name_len;
+
++ /* Support to remap filename with relative path */
++ char *realpath = lrealpath (filename);
++ if (realpath == NULL)
++ return filename;
++
+ for (map = debug_prefix_maps; map; map = map->next)
+- if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
++ if (filename_ncmp (realpath, map->old_prefix, map->old_len) == 0)
+ break;
+ if (!map)
+- return filename;
+- name = filename + map->old_len;
++ {
++ free (realpath);
++ return filename;
++ }
++ name = realpath + map->old_len;
+ name_len = strlen (name) + 1;
+ s = (char *) alloca (name_len + map->new_len);
+ memcpy (s, map->new_prefix, map->new_len);
+ memcpy (s + map->new_len, name, name_len);
++ free (realpath);
+ return ggc_strdup (s);
+ }
+
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
new file mode 100644
index 000000000..e39af9b1a
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
@@ -0,0 +1,124 @@
+From 847aec764540636ec654fd7a012e271afa8d4e0f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Apr 2016 20:03:28 +0000
+Subject: [PATCH 44/47] libgcc: Add knob to use ldbl-128 on ppc
+
+musl does not support ldbl 128 so we can not assume
+that linux as a whole supports ldbl-128 bits, instead
+act upon configure option passed to gcc and assume no
+on musl and yes otherwise if no option is passed since
+default behaviour is to assume ldbl128 it does not
+change the defaults
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ libgcc/Makefile.in | 1 +
+ libgcc/config/rs6000/t-linux | 5 ++++-
+ libgcc/configure | 18 ++++++++++++++++++
+ libgcc/configure.ac | 12 ++++++++++++
+ 4 files changed, 35 insertions(+), 1 deletion(-)
+ mode change 100644 => 100755 libgcc/configure
+
+diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
+index a1a392de88d..2fe6889a342 100644
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -48,6 +48,7 @@ unwind_header = @unwind_header@
+ md_unwind_header = @md_unwind_header@
+ sfp_machine_header = @sfp_machine_header@
+ thread_header = @thread_header@
++with_ldbl128 = @with_ldbl128@
+
+ host_noncanonical = @host_noncanonical@
+ real_host_noncanonical = @real_host_noncanonical@
+diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
+index 4f6d4c4a4d2..c50dd94a2da 100644
+--- a/libgcc/config/rs6000/t-linux
++++ b/libgcc/config/rs6000/t-linux
+@@ -1,3 +1,6 @@
+ SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
+
+-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
++ifeq ($(with_ldbl128),yes)
++HOST_LIBGCC2_CFLAGS += -mlong-double-128
++endif
++HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
+diff --git a/libgcc/configure b/libgcc/configure
+old mode 100644
+new mode 100755
+index 45c459788c3..e2d19b144b8
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -618,6 +618,7 @@ build_vendor
+ build_cpu
+ build
+ with_aix_soname
++with_ldbl128
+ enable_vtable_verify
+ enable_shared
+ libgcc_topdir
+@@ -667,6 +668,7 @@ with_cross_host
+ with_ld
+ enable_shared
+ enable_vtable_verify
++with_long_double_128
+ with_aix_soname
+ enable_version_specific_runtime_libs
+ with_slibdir
+@@ -1324,6 +1326,7 @@ Optional Packages:
+ --with-target-subdir=SUBDIR Configuring in a subdirectory for target
+ --with-cross-host=HOST Configuring with a cross compiler
+ --with-ld arrange to use the specified ld (full pathname)
++ --with-long-double-128 use 128-bit long double by default
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX
+@@ -2208,6 +2211,21 @@ fi
+
+
+
++# Check whether --with-long-double-128 was given.
++if test "${with_long_double_128+set}" = set; then :
++ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
++else
++ case "${host}" in
++ power*-*-musl*)
++ with_ldbl128="no";;
++ *) with_ldbl128="yes";;
++ esac
++
++fi
++
++
++
++
+ # Check whether --with-aix-soname was given.
+ if test "${with_aix_soname+set}" = set; then :
+ withval=$with_aix_soname; case "${host}:${enable_shared}" in
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index af151473709..dada52416da 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -77,6 +77,18 @@ AC_ARG_ENABLE(vtable-verify,
+ [enable_vtable_verify=no])
+ AC_SUBST(enable_vtable_verify)
+
++AC_ARG_WITH(long-double-128,
++[AS_HELP_STRING([--with-long-double-128],
++ [use 128-bit long double by default])],
++ with_ldbl128="$with_long_double_128",
++[case "${host}" in
++ power*-*-musl*)
++ with_ldbl128="no";;
++ *) with_ldbl128="yes";;
++ esac
++])
++AC_SUBST(with_ldbl128)
++
+ AC_ARG_WITH(aix-soname,
+ [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ [shared library versioning (aka "SONAME") variant to provide on AIX])],
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
new file mode 100644
index 000000000..3aa038c91
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch
@@ -0,0 +1,29 @@
+From 92beb883ab57a23a35ba76c496bc1f4cabb1690e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 4 May 2016 21:11:34 -0700
+Subject: [PATCH 45/47] Link libgcc using LDFLAGS, not just SHLIB_LDFLAGS
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgcc/config/t-slibgcc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/t-slibgcc b/libgcc/config/t-slibgcc
+index 76be7710960..a1ee2ee26ed 100644
+--- a/libgcc/config/t-slibgcc
++++ b/libgcc/config/t-slibgcc
+@@ -32,7 +32,7 @@ SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
+ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+
+ SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
+- $(SHLIB_LDFLAGS) \
++ $(LDFLAGS) $(SHLIB_LDFLAGS) \
+ -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
+ $(SHLIB_OBJS) $(SHLIB_LC) && \
+ rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch
new file mode 100644
index 000000000..65d22f169
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0047-sync-gcc-stddef.h-with-musl.patch
@@ -0,0 +1,91 @@
+From 9b951c8f6b0aaff7c16dc4db72b5e56ec73810bb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Feb 2017 12:56:00 -0800
+Subject: [PATCH 47/47] sync gcc stddef.h with musl
+
+musl defines ptrdiff_t size_t and wchar_t
+so dont define them here if musl is definining them
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [OE-Specific]
+
+ gcc/ginclude/stddef.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
+index 872f451cac9..7e90938387c 100644
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -134,6 +134,7 @@ _TYPE_wchar_t;
+ #ifndef ___int_ptrdiff_t_h
+ #ifndef _GCC_PTRDIFF_T
+ #ifndef _PTRDIFF_T_DECLARED /* DragonFly */
++#ifndef __DEFINED_ptrdiff_t /* musl */
+ #define _PTRDIFF_T
+ #define _T_PTRDIFF_
+ #define _T_PTRDIFF
+@@ -143,10 +144,12 @@ _TYPE_wchar_t;
+ #define ___int_ptrdiff_t_h
+ #define _GCC_PTRDIFF_T
+ #define _PTRDIFF_T_DECLARED
++#define __DEFINED_ptrdiff_t /* musl */
+ #ifndef __PTRDIFF_TYPE__
+ #define __PTRDIFF_TYPE__ long int
+ #endif
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
++#endif /* __DEFINED_ptrdiff_t */
+ #endif /* _PTRDIFF_T_DECLARED */
+ #endif /* _GCC_PTRDIFF_T */
+ #endif /* ___int_ptrdiff_t_h */
+@@ -184,6 +187,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+ #ifndef __size_t
++#ifndef __DEFINED_size_t /* musl */
+ #define __size_t__ /* BeOS */
+ #define __SIZE_T__ /* Cray Unicos/Mk */
+ #define _SIZE_T
+@@ -200,6 +204,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || defined(__DragonFly__) \
+ || defined(__FreeBSD_kernel__)
+@@ -235,6 +240,7 @@ typedef long ssize_t;
+ #endif /* _SIZE_T */
+ #endif /* __SIZE_T__ */
+ #endif /* __size_t__ */
++#endif /* __DEFINED_size_t */
+ #undef __need_size_t
+ #endif /* _STDDEF_H or __need_size_t. */
+
+@@ -264,6 +270,7 @@ typedef long ssize_t;
+ #ifndef ___int_wchar_t_h
+ #ifndef __INT_WCHAR_T_H
+ #ifndef _GCC_WCHAR_T
++#ifndef __DEFINED_wchar_t /* musl */
+ #define __wchar_t__ /* BeOS */
+ #define __WCHAR_T__ /* Cray Unicos/Mk */
+ #define _WCHAR_T
+@@ -279,6 +286,7 @@ typedef long ssize_t;
+ #define __INT_WCHAR_T_H
+ #define _GCC_WCHAR_T
+ #define _WCHAR_T_DECLARED
++#define __DEFINED_wchar_t /* musl */
+
+ /* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
+ instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
+@@ -344,6 +352,7 @@ typedef __WCHAR_TYPE__ wchar_t;
+ #endif
+ #endif /* __WCHAR_T__ */
+ #endif /* __wchar_t__ */
++#endif /* __DEFINED_wchar_t musl */
+ #undef __need_wchar_t
+ #endif /* _STDDEF_H or __need_wchar_t. */
+
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch
new file mode 100644
index 000000000..a96e91339
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/0048-gcc-Enable-static-PIE.patch
@@ -0,0 +1,46 @@
+From 44ef80688b56beea85c0070840dea1e2a4e34aed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 13 Jun 2017 12:12:52 -0700
+Subject: [PATCH 49/49] gcc: Enable static PIE
+
+Static PIE support in GCC
+see
+https://gcc.gnu.org/ml/gcc/2015-06/msg00008.html
+
+startfiles before patch:
+ -static -> crt1.o crti.o crtbeginT.o
+ -static -PIE -> crt1.o crti.o crtbeginT.o
+
+after patch:
+ -static -> crt1.o crti.o crtbeginT.o
+ -static -PIE -> rcrt1.o crti.o crtbeginS.o
+
+Upstream-Status: Pending
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+---
+ gcc/config/gnu-user.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
+index de605b0..b035bbe 100644
+--- a/gcc/config/gnu-user.h
++++ b/gcc/config/gnu-user.h
+@@ -52,11 +52,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GNU_USER_TARGET_STARTFILE_SPEC \
+ "%{shared:; \
+ pg|p|profile:gcrt1.o%s; \
+- static:crt1.o%s; \
++ static: %{" PIE_SPEC ": rcrt1.o%s; :crt1.o%s}; \
+ " PIE_SPEC ":Scrt1.o%s; \
+ :crt1.o%s} \
+ crti.o%s \
+- %{static:crtbeginT.o%s; \
++ %{static: %{" PIE_SPEC ": crtbeginS.o%s; :crtbeginT.o%s}; \
+ shared|" PIE_SPEC ":crtbeginS.o%s; \
+ :crtbegin.o%s} \
+ %{fvtable-verify=none:%s; \
+
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch
new file mode 100644
index 000000000..c0adef6f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/fix-segmentation-fault-precompiled-hdr.patch
@@ -0,0 +1,49 @@
+
+Prevent a segmentation fault which occurs when using incorrect
+structure trying to access name of some named operators, such as
+CPP_NOT, CPP_AND etc. "token->val.node.spelling" cannot be used in
+those cases, as is may not be initialized at all.
+
+
+[YOCTO #11738]
+
+Upstream-Status: Pending
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+diff --git a/libcpp/lex.c b/libcpp/lex.c
+--- a/libcpp/lex.c
++++ b/libcpp/lex.c
+@@ -3229,11 +3229,27 @@
+ spell_ident:
+ case SPELL_IDENT:
+ if (forstring)
+- {
+- memcpy (buffer, NODE_NAME (token->val.node.spelling),
+- NODE_LEN (token->val.node.spelling));
+- buffer += NODE_LEN (token->val.node.spelling);
+- }
++ {
++ if (token->type == CPP_NAME)
++ {
++ memcpy (buffer, NODE_NAME (token->val.node.spelling),
++ NODE_LEN (token->val.node.spelling));
++ buffer += NODE_LEN (token->val.node.spelling);
++ break;
++ }
++ /* NAMED_OP, cannot use node.spelling */
++ if (token->flags & NAMED_OP)
++ {
++ const char *str = cpp_named_operator2name (token->type);
++ if (str)
++ {
++ size_t len = strlen(str);
++ memcpy(buffer, str, len);
++ buffer += len;
++ }
++ break;
++ }
++ }
+ else
+ buffer = _cpp_spell_ident_ucns (buffer, token->val.node.node);
+ break;
diff --git a/poky/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch b/poky/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch
new file mode 100644
index 000000000..cb87c5ab7
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-7.3/no-sse-fix-test-case-failures.patch
@@ -0,0 +1,259 @@
+From f22830da2ba64577deb6f717d05d86c03dd2e50d Mon Sep 17 00:00:00 2001
+From: RAGHUNATH LOLUR <raghunath.lolur@kpit.com>
+Date: Wed, 6 Dec 2017 22:52:26 -0800
+Subject: [PATCH] Fix for testsuite failure
+
+2017-11-16 Raghunath Lolur <raghunath.lolur@kpit.com>
+
+ * gcc.dg/pr56275.c: If SSE is disabled, ensure that
+ "-mfpmath" is not set to use SSE. Set "-mfpmath=387".
+ * gcc.dg/pr68306.c: Likewise
+ * gcc.dg/pr68306-2.c: Likewise
+ * gcc.dg/pr68306-3.c: Likewise
+ * gcc.dg/pr69634.c: Likewise
+ * gcc.target/i386/amd64-abi-1.c: Likewise
+ * gcc.target/i386/funcspec-6.c: Likewise
+ * gcc.target/i386/interrupt-387-err-1.c: Likewise
+ * gcc.target/i386/isa-14.c: Likewise
+ * gcc.target/i386/pr44948-2b.c: Likewise
+ * gcc.target/i386/pr53425-1.c: Likewise
+ * gcc.target/i386/pr53425-2.c: Likewise
+ * gcc.target/i386/pr55247.c: Likewise
+ * gcc.target/i386/pr59644.c: Likewise
+ * gcc.target/i386/pr62120.c: Likewise
+ * gcc.target/i386/pr70467-1.c: Likewise
+ * gcc.target/i386/warn-vect-op-1.c: Likewise
+
+If -Wall, -Werror are used during compilation various test cases fail
+to compile.
+
+If SSE is disabled, be sure to -mfpmath=387 to resolve this.
+
+This patch removes the changes to Changelog from the original patch.
+This will help us avoid conflicts.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ gcc/testsuite/ChangeLog | 21 +++++++++++++++++++++
+ gcc/testsuite/gcc.dg/pr56275.c | 2 +-
+ gcc/testsuite/gcc.dg/pr68306-2.c | 2 +-
+ gcc/testsuite/gcc.dg/pr68306-3.c | 2 +-
+ gcc/testsuite/gcc.dg/pr68306.c | 2 +-
+ gcc/testsuite/gcc.dg/pr69634.c | 2 +-
+ .../gcc/testsuite/gcc.target/i386/amd64-abi-1.c | 2 +-
+ .../gcc/testsuite/gcc.target/i386/funcspec-6.c | 1 +
+ .../testsuite/gcc.target/i386/interrupt-387-err-1.c | 2 +-
+ gcc/testsuite/gcc.target/i386/isa-14.c | 2 +-
+ .../gcc/testsuite/gcc.target/i386/pr44948-2b.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr53425-1.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr53425-2.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr55247.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr59644.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr62120.c | 2 +-
+ gcc/testsuite/gcc.target/i386/pr70467-1.c | 2 +-
+ .../gcc/testsuite/gcc.target/i386/warn-vect-op-1.c | 2 +-
+ 18 files changed, 38 insertions(+), 16 deletions(-)
+
+diff --git a/gcc/testsuite/gcc.dg/pr56275.c b/gcc/testsuite/gcc.dg/pr56275.c
+index b901bb2..a4f6c95 100644
+--- a/gcc/testsuite/gcc.dg/pr56275.c
++++ b/gcc/testsuite/gcc.dg/pr56275.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile } */
+ /* { dg-options "-O2" } */
+-/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
++/* { dg-additional-options "-mno-sse -mfpmath=387" { target { i?86-*-* x86_64-*-* } } } */
+
+ typedef long long v2tw __attribute__ ((vector_size (2 * sizeof (long long))));
+
+diff --git a/gcc/testsuite/gcc.dg/pr68306-2.c b/gcc/testsuite/gcc.dg/pr68306-2.c
+index 4672ebe..2a368c4 100644
+--- a/gcc/testsuite/gcc.dg/pr68306-2.c
++++ b/gcc/testsuite/gcc.dg/pr68306-2.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
++/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
+
+ struct {
+ int tz_minuteswest;
+diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c
+index f5a8c10..df3390c 100644
+--- a/gcc/testsuite/gcc.dg/pr68306-3.c
++++ b/gcc/testsuite/gcc.dg/pr68306-3.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
++/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
+ /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */
+
+ extern void fn2();
+diff --git a/gcc/testsuite/gcc.dg/pr68306.c b/gcc/testsuite/gcc.dg/pr68306.c
+index 54e5b40..0813389 100644
+--- a/gcc/testsuite/gcc.dg/pr68306.c
++++ b/gcc/testsuite/gcc.dg/pr68306.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+-/* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
++/* { dg-additional-options "-mno-sse -mno-mmx -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
+
+ enum powerpc_pmc_type { PPC_PMC_IBM };
+ struct {
+diff --git a/gcc/testsuite/gcc.dg/pr69634.c b/gcc/testsuite/gcc.dg/pr69634.c
+index 60a5614..bcc23f9 100644
+--- a/gcc/testsuite/gcc.dg/pr69634.c
++++ b/gcc/testsuite/gcc.dg/pr69634.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile } */
+ /* { dg-options "-O2 -fno-dce -fschedule-insns -fno-tree-vrp -fcompare-debug -Wno-psabi" } */
+-/* { dg-additional-options "-mno-sse" { target i?86-*-* x86_64-*-* } } */
++/* { dg-additional-options "-mno-sse -mfpmath=387" { target i?86-*-* x86_64-*-* } } */
+ /* { dg-require-effective-target scheduling } */
+
+ typedef unsigned short u16;
+diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
+index 69fde57..7f1f1c0 100644
+--- a/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
++++ b/gcc/testsuite/gcc.target/i386/amd64-abi-1.c
+@@ -1,5 +1,5 @@
+ /* { dg-do compile { target { ! ia32 } } } */
+-/* { dg-options "-mno-sse" } */
++/* { dg-options "-mno-sse -mfpmath=387" } */
+ /* { dg-additional-options "-mabi=sysv" { target *-*-mingw* } } */
+
+ double foo(void) { return 0; } /* { dg-error "SSE disabled" } */
+diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c
+index ea896b7..bf15569 100644
+--- a/gcc/testsuite/gcc.target/i386/funcspec-6.c
++++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c
+@@ -1,6 +1,7 @@
+ /* Test whether all of the 64-bit function specific options are accepted
+ without error. */
+ /* { dg-do compile { target { ! ia32 } } } */
++/* { dg-additional-options "-mfpmath=387" } */
+
+ #include "funcspec-56.inc"
+
+diff --git a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
+index 3fbdc88..6b4d9d1 100644
+--- a/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
++++ b/gcc/testsuite/gcc.target/i386/interrupt-387-err-1.c
+@@ -1,5 +1,5 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387" } */
++/* { dg-options "-O2 -mgeneral-regs-only -mno-cld -mno-iamcu -m80387 -mfpmath=387" } */
+
+ typedef unsigned int uword_t __attribute__ ((mode (__word__)));
+
+diff --git a/gcc/testsuite/gcc.target/i386/isa-14.c b/gcc/testsuite/gcc.target/i386/isa-14.c
+index 5d49e6e..1de2db9 100644
+--- a/gcc/testsuite/gcc.target/i386/isa-14.c
++++ b/gcc/testsuite/gcc.target/i386/isa-14.c
+@@ -1,5 +1,5 @@
+ /* { dg-do run } */
+-/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse" } */
++/* { dg-options "-march=x86-64 -msse4a -mfma4 -mno-sse -mfpmath=387" } */
+
+ extern void abort (void);
+
+diff --git a/gcc/testsuite/gcc.target/i386/pr44948-2b.c b/gcc/testsuite/gcc.target/i386/pr44948-2b.c
+index fa1769b..f79fb12 100644
+--- a/gcc/testsuite/gcc.target/i386/pr44948-2b.c
++++ b/gcc/testsuite/gcc.target/i386/pr44948-2b.c
+@@ -1,5 +1,5 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic" } */
++/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic -mfpmath=387" } */
+
+ struct A
+ {
+diff --git a/gcc/testsuite/gcc.target/i386/pr53425-1.c b/gcc/testsuite/gcc.target/i386/pr53425-1.c
+index 2e89ff7..6339bf6 100644
+--- a/gcc/testsuite/gcc.target/i386/pr53425-1.c
++++ b/gcc/testsuite/gcc.target/i386/pr53425-1.c
+@@ -1,6 +1,6 @@
+ /* PR target/53425 */
+ /* { dg-do compile { target { ! ia32 } } } */
+-/* { dg-options "-O2 -mno-sse" } */
++/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
+ /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */
+
+ typedef double __v2df __attribute__ ((__vector_size__ (16)));
+diff --git a/gcc/testsuite/gcc.target/i386/pr53425-2.c b/gcc/testsuite/gcc.target/i386/pr53425-2.c
+index 61f6283..2c5a55f 100644
+--- a/gcc/testsuite/gcc.target/i386/pr53425-2.c
++++ b/gcc/testsuite/gcc.target/i386/pr53425-2.c
+@@ -1,6 +1,6 @@
+ /* PR target/53425 */
+ /* { dg-do compile { target { ! ia32 } } } */
+-/* { dg-options "-O2 -mno-sse" } */
++/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
+ /* { dg-skip-if "no SSE vector" { x86_64-*-mingw* } } */
+
+ typedef float __v2sf __attribute__ ((__vector_size__ (8)));
+diff --git a/gcc/testsuite/gcc.target/i386/pr55247.c b/gcc/testsuite/gcc.target/i386/pr55247.c
+index 23366d0..9810e3a 100644
+--- a/gcc/testsuite/gcc.target/i386/pr55247.c
++++ b/gcc/testsuite/gcc.target/i386/pr55247.c
+@@ -1,6 +1,6 @@
+ /* { dg-do compile { target { ! ia32 } } } */
+ /* { dg-require-effective-target maybe_x32 } */
+-/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long" } */
++/* { dg-options "-O2 -mno-sse -mno-mmx -mx32 -maddress-mode=long -mfpmath=387" } */
+
+ typedef unsigned int uint32_t;
+ typedef uint32_t Elf32_Word;
+diff --git a/gcc/testsuite/gcc.target/i386/pr59644.c b/gcc/testsuite/gcc.target/i386/pr59644.c
+index 96006b3..4287e45 100644
+--- a/gcc/testsuite/gcc.target/i386/pr59644.c
++++ b/gcc/testsuite/gcc.target/i386/pr59644.c
+@@ -1,6 +1,6 @@
+ /* PR target/59644 */
+ /* { dg-do run { target lp64 } } */
+-/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone" } */
++/* { dg-options "-O2 -ffreestanding -mno-sse -mpreferred-stack-boundary=3 -maccumulate-outgoing-args -mno-red-zone -mfpmath=387" } */
+
+ /* This test uses __builtin_trap () instead of e.g. abort,
+ because due to -mpreferred-stack-boundary=3 it should not call
+diff --git a/gcc/testsuite/gcc.target/i386/pr62120.c b/gcc/testsuite/gcc.target/i386/pr62120.c
+index bfb8c47..ed04cf1 100644
+--- a/gcc/testsuite/gcc.target/i386/pr62120.c
++++ b/gcc/testsuite/gcc.target/i386/pr62120.c
+@@ -1,5 +1,5 @@
+ /* { dg-do compile } */
+-/* { dg-options "-mno-sse" } */
++/* { dg-options "-mno-sse -mfpmath=387" } */
+
+ void foo ()
+ {
+diff --git a/gcc/testsuite/gcc.target/i386/pr70467-1.c b/gcc/testsuite/gcc.target/i386/pr70467-1.c
+index 4e112c8..bcfb396 100644
+--- a/gcc/testsuite/gcc.target/i386/pr70467-1.c
++++ b/gcc/testsuite/gcc.target/i386/pr70467-1.c
+@@ -1,6 +1,6 @@
+ /* PR rtl-optimization/70467 */
+ /* { dg-do compile } */
+-/* { dg-options "-O2 -mno-sse" } */
++/* { dg-options "-O2 -mno-sse -mfpmath=387" } */
+
+ void foo (unsigned long long *);
+
+diff --git a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
+index 6cda153..26e37f5 100644
+--- a/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
++++ b/gcc/testsuite/gcc.target/i386/warn-vect-op-1.c
+@@ -1,5 +1,5 @@
+ /* { dg-do compile { target { ! ia32 } } } */
+-/* { dg-options "-mno-sse -Wvector-operation-performance" } */
++/* { dg-options "-mno-sse -Wvector-operation-performance -mfpmath=387" } */
+ #define vector(elcount, type) \
+ __attribute__((vector_size((elcount)*sizeof(type)))) type
+
+--
+1.8.5.6
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-common.inc b/poky/meta/recipes-devtools/gcc/gcc-common.inc
new file mode 100644
index 000000000..aa3b53e64
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-common.inc
@@ -0,0 +1,119 @@
+SUMMARY = "GNU cc and gcc C compilers"
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+
+NATIVEDEPS = ""
+
+CVE_PRODUCT = "gcc"
+
+inherit autotools gettext texinfo
+
+BPN = "gcc"
+COMPILERINITIAL = ""
+COMPILERDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}gcc${COMPILERINITIAL}:do_gcc_stash_builddir"
+COMPILERDEP_class-nativesdk = "virtual/${TARGET_PREFIX}gcc${COMPILERINITIAL}-crosssdk:do_gcc_stash_builddir"
+
+python extract_stashed_builddir () {
+ src = d.expand("${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}")
+ dest = d.getVar("B")
+ oe.path.copyhardlinktree(src, dest)
+ staging_processfixme([src + "/fixmepath"], dest, dest, dest, d)
+}
+
+def get_gcc_float_setting(bb, d):
+ if d.getVar('ARMPKGSFX_EABI') == "hf" and d.getVar('TRANSLATED_TARGET_ARCH') == "arm":
+ return "--with-float=hard"
+ if d.getVar('TARGET_FPU') in [ 'soft' ]:
+ return "--with-float=soft"
+ if d.getVar('TARGET_FPU') in [ 'ppc-efd' ]:
+ return "--enable-e500_double"
+ return ""
+
+get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
+
+def get_gcc_mips_plt_setting(bb, d):
+ if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
+ return "--with-mips-plt"
+ return ""
+
+def get_gcc_ppc_plt_settings(bb, d):
+ if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc' ] and not bb.utils.contains('DISTRO_FEATURES', 'bssplt', True, False, d):
+ return "--enable-secureplt"
+ return ""
+
+def get_long_double_setting(bb, d):
+ if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC') in [ 'glibc' ]:
+ return "--with-long-double-128"
+ else:
+ return "--without-long-double-128"
+ return ""
+
+def get_gcc_multiarch_setting(bb, d):
+ target_arch = d.getVar('TRANSLATED_TARGET_ARCH')
+ multiarch_options = {
+ "i586": "--enable-targets=all",
+ "i686": "--enable-targets=all",
+ "powerpc": "--enable-targets=powerpc64",
+ "mips": "--enable-targets=all",
+ "sparc": "--enable-targets=all",
+ }
+
+ if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
+ if target_arch in multiarch_options :
+ return multiarch_options[target_arch]
+ return ""
+
+# this is used by the multilib setup of gcc
+def get_tune_parameters(tune, d):
+ availtunes = d.getVar('AVAILTUNES')
+ if tune not in availtunes.split():
+ bb.error('The tune: %s is not one of the available tunes: %s' % (tune or None, availtunes))
+
+ localdata = bb.data.createCopy(d)
+ override = ':tune-' + tune
+ localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
+
+ retdict = {}
+ retdict['tune'] = tune
+ retdict['ccargs'] = localdata.getVar('TUNE_CCARGS')
+ retdict['features'] = localdata.getVar('TUNE_FEATURES')
+ # BASELIB is used by the multilib code to change library paths
+ retdict['baselib'] = localdata.getVar('BASE_LIB') or localdata.getVar('BASELIB')
+ retdict['arch'] = localdata.getVar('TUNE_ARCH')
+ retdict['abiextension'] = localdata.getVar('ABIEXTENSION')
+ retdict['target_fpu'] = localdata.getVar('TARGET_FPU')
+ retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH')
+ retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS')
+ return retdict
+
+get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
+
+DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
+
+MIRRORS =+ "\
+${GNU_MIRROR}/gcc ftp://gcc.gnu.org/pub/gcc/releases/ \n \
+${GNU_MIRROR}/gcc ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
+${GNU_MIRROR}/gcc http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
+${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
+${GNU_MIRROR}/gcc http://gcc.get-software.com/releases/ \n \
+"
+#
+# Set some default values
+#
+gcclibdir = "${libdir}/gcc"
+BINV = "${PV}"
+#S = "${WORKDIR}/gcc-${PV}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+target_includedir ?= "${includedir}"
+target_libdir ?= "${libdir}"
+target_base_libdir ?= "${base_libdir}"
+target_prefix ?= "${prefix}"
+
+# We need to ensure that for the shared work directory, the do_patch signatures match
+# The real WORKDIR location isn't a dependency for the shared workdir.
+src_patches[vardepsexclude] = "WORKDIR"
+should_apply[vardepsexclude] += "PN"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-configure-common.inc b/poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
new file mode 100644
index 000000000..e2ce234aa
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -0,0 +1,123 @@
+require gcc-multilib-config.inc
+require gcc-shared-source.inc
+#
+# Build the list of lanaguages to build.
+#
+# These can be overridden by the version specific .inc file.
+
+# Java (gcj doesn't work on all architectures)
+JAVA ?= ",java"
+JAVA_arm ?= ""
+JAVA_armeb ?= ""
+JAVA_mipsel ?= ""
+JAVA_sh3 ?= ""
+# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
+FORTRAN ?= ",f77"
+LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
+
+EXTRA_OECONF_BASE ?= ""
+EXTRA_OECONF_PATHS ?= ""
+EXTRA_OECONF_INITIAL ?= ""
+
+GCCMULTILIB ?= "--disable-multilib"
+GCCTHREADS ?= "posix"
+
+GCCPIE ??= ""
+
+EXTRA_OECONF = "\
+ ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS') != 'no']} \
+ --with-gnu-ld \
+ --enable-shared \
+ --enable-languages=${LANGUAGES} \
+ --enable-threads=${GCCTHREADS} \
+ ${GCCMULTILIB} \
+ ${GCCPIE} \
+ --enable-c99 \
+ --enable-long-long \
+ --enable-symvers=gnu \
+ --enable-libstdcxx-pch \
+ --program-prefix=${TARGET_PREFIX} \
+ --without-local-prefix \
+ ${EXTRA_OECONF_BASE} \
+ ${EXTRA_OECONF_GCC_FLOAT} \
+ ${EXTRA_OECONF_PATHS} \
+ ${@get_gcc_mips_plt_setting(bb, d)} \
+ ${@get_gcc_ppc_plt_settings(bb, d)} \
+ ${@get_long_double_setting(bb, d)} \
+ ${@get_gcc_multiarch_setting(bb, d)} \
+"
+
+# Set this here since GCC configure won't auto-detect and enable
+# initfini-arry when cross compiling.
+EXTRA_OECONF_append = " --enable-initfini-array"
+
+export gcc_cv_collect2_libs = 'none required'
+# We need to set gcc_cv_collect2_libs else there is cross-compilation badness
+# in the config.log files (which might not get generated until do_compile
+# hence being missed by the insane do_configure check).
+
+EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
+
+EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mipsisa32r6el = " --with-abi=32 --with-arch=mips32r6"
+EXTRA_OECONF_append_mipsisa32r6 = " --with-abi=32 --with-arch=mips32r6"
+EXTRA_OECONF_append_mipsisa64r6el = " --with-abi=64 --with-arch-64=mips64r6"
+EXTRA_OECONF_append_mipsisa64r6 = " --with-abi=64 --with-arch-64=mips64r6"
+
+EXTRA_OECONF_GCC_FLOAT ??= ""
+CPPFLAGS = ""
+
+SYSTEMHEADERS = "${target_includedir}"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+do_configure_prepend () {
+ # teach gcc to find correct target includedir when checking libc ssp support
+ mkdir -p ${B}/gcc
+ echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
+ cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
+ cat >>${B}/gcc/defaults.h.new <<_EOF
+#define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}"
+#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
+#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
+#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
+#endif /* ! GCC_DEFAULTS_H */
+_EOF
+ mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
+}
+
+do_configure () {
+ # Setup these vars for cross building only
+ # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
+ # gcc build stuff when the build is producing a cross compiler - i.e.
+ # when the 'current' target is the 'host' system, and the host is not
+ # the target (because the build is actually making a cross compiler!)
+ if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+ export CC_FOR_TARGET="${CC}"
+ export GCC_FOR_TARGET="${CC}"
+ export CXX_FOR_TARGET="${CXX}"
+ export AS_FOR_TARGET="${HOST_PREFIX}as"
+ export LD_FOR_TARGET="${HOST_PREFIX}ld"
+ export NM_FOR_TARGET="${HOST_PREFIX}nm"
+ export AR_FOR_TARGET="${HOST_PREFIX}ar"
+ export GFORTRAN_FOR_TARGET="gfortran"
+ export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
+ fi
+ export CC_FOR_BUILD="${BUILD_CC}"
+ export CXX_FOR_BUILD="${BUILD_CXX}"
+ export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+ export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+ export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+ export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+
+ oe_runconf
+}
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
new file mode 100644
index 000000000..bdd6f7ec8
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -0,0 +1,173 @@
+inherit cross-canadian
+
+SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
+PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext flex-native"
+
+GCCMULTILIB = "--enable-multilib"
+
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+# We have to point gcc at a sysroot but we don't need to rebuild if this changes
+# e.g. we switch between different machines with different tunes.
+EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH"
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+get_gcc_float_setting[vardepvalue] = ""
+
+#
+# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
+# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse.
+#
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool"
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
+export GCC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip"
+export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres"
+
+#
+# We need to override this and make sure the compiler can find staging
+#
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
+
+do_configure () {
+ export CC_FOR_BUILD="${BUILD_CC}"
+ export CXX_FOR_BUILD="${BUILD_CXX}"
+ export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+ export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+ export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+ export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+ oe_runconf
+}
+
+do_compile () {
+ oe_runmake all-host configure-target-libgcc
+ (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
+}
+
+# Having anything auto depending on gcc-cross-sdk is a really bad idea...
+EXCLUDE_FROM_SHLIBS = "1"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc"
+
+FILES_${PN} = "\
+ ${exec_prefix}/bin/* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \
+ ${includedir}/c++/${BINV} \
+ ${prefix}/${TARGET_SYS}/bin/* \
+ ${prefix}/${TARGET_SYS}/lib/* \
+ ${prefix}/${TARGET_SYS}${target_includedir}/* \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-doc = "\
+ ${infodir} \
+ ${mandir} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+EXEEXT = ""
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h )
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+ rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+ # We care about g++ not c++
+ rm -f ${D}${bindir}/*c++
+
+ # We don't care about the gcc-<version> copies
+ rm -f ${D}${bindir}/*gcc-?.?*
+
+ # We use libiberty from binutils
+ rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
+ # Not sure where the strange paths come from
+ rm -f ${D}${libdir}/../lib/libiberty.a
+ rm -f ${D}${libdir}/libiberty.a
+
+ # Cleanup empty directories which are not shipped
+ # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
+ # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
+ local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
+ for i in $empty_dirs; do
+ [ -d $i ] && rmdir --ignore-fail-on-non-empty $i
+ done
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ suffix=${EXEEXT}
+ for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
+ continue
+ fi
+
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
+ done
+ t=real-ld
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld$suffix $dest$t$suffix
+
+ # libquadmath headers need to be available in the gcc libexec dir
+ install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ chown -R root:root ${D}
+
+ cross_canadian_bindirlinks
+}
+
+ELFUTILS = "nativesdk-elfutils"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
+RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+
+SYSTEMHEADERS = "${target_includedir}/"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
+ --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix} \
+"
+
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--with-sysroot=/not/exist"
+EXTRA_OECONF_remove_libc-baremetal = "--with-build-sysroot=${STAGING_DIR_TARGET}"
+
+# gcc 4.7 needs -isystem
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb
new file mode 100644
index 000000000..bf53c5cd7
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross-canadian_7.3.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
new file mode 100644
index 000000000..892b1dbf2
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -0,0 +1,89 @@
+DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
+PACKAGES = ""
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+# We still need gnu-config-native
+DEPENDS_prepend = "gnu-config-native autoconf-native "
+
+PN = "gcc-cross-initial-${TARGET_ARCH}"
+
+CROSS_TARGET_SYS_DIR_append = ".${PN}"
+
+# This is intended to be a -very- basic config
+# sysroot is needed in case we use libc-initial
+EXTRA_OECONF = "\
+ --with-newlib \
+ --without-headers \
+ --disable-shared \
+ --disable-threads \
+ --disable-multilib \
+ --disable-__cxa_atexit \
+ --enable-languages=c \
+ --program-prefix=${TARGET_PREFIX} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+ ${EXTRA_OECONF_INITIAL} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
+ ${EXTRA_OECONF_GCC_FLOAT} \
+ ${@get_gcc_ppc_plt_settings(bb, d)} \
+"
+
+EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
+
+do_compile () {
+ oe_runmake all-gcc configure-target-libgcc
+ (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
+}
+
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h)
+ oe_runmake 'DESTDIR=${D}' install-gcc
+
+ # We don't really need this (here shares/ contains man/, info/, locale/).
+ rm -rf ${D}${datadir}/
+
+ # We use libiberty from binutils
+ find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
+ find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found. These need to be relative paths so they work in different locations.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
+ for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+ done
+ # fixed limits.h infact includes the so called real limits.h
+ # which should come from libc but when we build libc-initial
+ # then bunch of configure tests include fixed limits.h which in turn
+ # includes real limits.h but this real limits.h is not staged yet
+ # so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
+ # to get rid references to real limits.h
+ cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
+}
+#
+# Override the default sysroot staging copy since this won't look like a target system
+#
+sysroot_stage_all() {
+ sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+ install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
+ install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
+ mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
+ mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
+}
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/"
+do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
+
+inherit nopackages
+
+COMPILERINITIAL = "-initial"
+
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb
new file mode 100644
index 000000000..4c73e5ce6
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross-initial_7.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross.inc b/poky/meta/recipes-devtools/gcc/gcc-cross.inc
new file mode 100644
index 000000000..1e184a60d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -0,0 +1,218 @@
+inherit cross
+
+INHIBIT_DEFAULT_DEPS = "1"
+EXTRADEPENDS = ""
+DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+python () {
+ if d.getVar("TARGET_OS").startswith("linux"):
+ d.setVar("EXTRADEPENDS", "linux-libc-headers")
+}
+
+PN = "gcc-cross-${TARGET_ARCH}"
+
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
+require gcc-configure-common.inc
+
+# While we want the 'gnu' hash style, we explicitly set it to sysv here to
+# ensure that any recipe which doesn't obey our LDFLAGS (which also set it to
+# gnu) will hit a QA failure.
+LINKER_HASH_STYLE ?= "sysv"
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+EXTRA_OECONF_append_sh4 = " \
+ --with-multilib-list= \
+ --enable-incomplete-targets \
+"
+
+EXTRA_OECONF += "\
+ --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+ --with-system-zlib \
+"
+
+DEPENDS_remove_libc-baremetal := "virtual/${TARGET_PREFIX}libc-for-gcc"
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--enable-threads=posix"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
+
+do_compile () {
+ export CC="${BUILD_CC}"
+ export AR_FOR_TARGET="${TARGET_SYS}-ar"
+ export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
+ export LD_FOR_TARGET="${TARGET_SYS}-ld"
+ export NM_FOR_TARGET="${TARGET_SYS}-nm"
+ export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc"
+ export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+ export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+ export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+ export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+ oe_runmake all-host configure-target-libgcc
+ (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
+ # now generate script to drive testing
+ echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
+ set >> ${B}/${TARGET_PREFIX}testgcc
+ # prune out the unneeded vars
+ sed -i -e "/^BASH/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^USER/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^OPT/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^DIRSTACK/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^EUID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^FUNCNAME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^GROUPS/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^HOST/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^HOME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^IFS/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LC_ALL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LOGNAME/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^MACHTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^OSTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PIPE/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^SHELL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^'/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^UID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^TERM/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PKG_/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^POSIXLY_/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PPID/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PS4/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^Q/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^SHLVL/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^STAGING/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${TARGET_PREFIX}testgcc
+ sed -i -e "/^PSEUDO/d" ${B}/${TARGET_PREFIX}testgcc
+
+ # append execution part of the script
+cat >> ${B}/${TARGET_PREFIX}testgcc << STOP
+target="\$1"
+usage () {
+ echo "Usage:"
+ echo "\$0 user@target 'extra options to dejagnu'"
+ echo "\$0 target 'extra options to dejagnu'"
+ echo "\$0 target"
+ echo "e.g. \$0 192.168.7.2 ' dg.exp=visibility-d.c'"
+ echo "will only run visibility-d.c test case"
+ echo "e.g. \$0 192.168.7.2 '/-mthumb dg.exp=visibility-d.c'"
+ echo "will only run visibility-d.c test case in thumb mode"
+ echo "You need to have dejagnu autogen expect installed"
+ echo "on the build host"
+ }
+if [ "x\$target" = "x" ]
+then
+ echo "Please specify the target machine and remote user in form of user@target\n"
+ usage
+ exit 1;
+fi
+
+shift
+
+echo "\$target" | grep "@" 2>&1 > /dev/null
+if [ "x\$?" = "x0" ]
+then
+ user=\$(echo \$target | cut -d '@' -f 1)
+ target=\$(echo \$target | cut -d '@' -f 2)
+else
+ user=\$USER
+fi
+ssh \$user@\$target date 2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+ echo "Failed connecting to \$user@\$target it could be because"
+ echo "you don't have passwordless ssh setup to access \$target"
+ echo "or sometimes host key has been changed"
+ echo "in such case do something like below on build host"
+ echo "ssh-keygen -f "~/.ssh/known_hosts" -R \$target"
+ echo "and then try ssh \$user@\$target"
+
+ usage
+ exit 1
+fi
+ echo "lappend boards_dir [pwd]/../../.." > ${B}/site.exp
+ echo "load_generic_config \"unix\"" > ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info username \$user" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info rsh_prog ssh" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info rcp_prog scp" >> ${B}/${PACKAGE_ARCH}.exp
+ echo "set_board_info hostname \$target" >> ${B}/${PACKAGE_ARCH}.exp
+ DEJAGNU=${B}/site.exp make -k check RUNTESTFLAGS="--target_board=${PACKAGE_ARCH}\$@"
+
+STOP
+
+ chmod +x ${B}/${TARGET_PREFIX}testgcc
+
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+ ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h-forbuild install-unwind_h )
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ install -d ${D}${target_base_libdir}
+ install -d ${D}${target_libdir}
+
+ # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+ # gfortran is fully backwards compatible. This is a safe and practical solution.
+ if [ -n "${@d.getVar('FORTRAN')}" ]; then
+ ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
+ fortsymlinks="g77 gfortran"
+ fi
+
+ # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+ # found. These need to be relative paths so they work in different locations.
+ dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+ install -d $dest
+ for t in ar as ld ld.bfd ld.gold nm objcopy objdump ranlib strip gcc cpp $fortsymlinks; do
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+ ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+ done
+
+ # Remove things we don't need but keep share/java
+ for d in info man share/doc share/locale share/man share/info; do
+ rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
+ done
+
+ # libquadmath headers need to be available in the gcc libexec dir
+ install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+ cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ # We use libiberty from binutils
+ find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
+ find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
+}
+
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+
+BUILDDIRSTASH = "${WORKDIR}/stashed-builddir"
+do_gcc_stash_builddir[dirs] = "${B}"
+do_gcc_stash_builddir[cleandirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir () {
+ dest=${BUILDDIRSTASH}
+ hardlinkdir . $dest
+}
+addtask do_gcc_stash_builddir after do_compile before do_install
+SSTATETASKS += "do_gcc_stash_builddir"
+do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
+do_gcc_stash_builddir[sstate-outputdirs] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+do_gcc_stash_builddir[sstate-fixmedir] = "${COMPONENTS_DIR}/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
+
+python do_gcc_stash_builddir_setscene () {
+ sstate_setscene(d)
+}
+addtask do_gcc_stash_builddir_setscene
diff --git a/poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb
new file mode 100644
index 000000000..b43cca0c5
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-cross_7.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
new file mode 100644
index 000000000..08eda5d4c
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
@@ -0,0 +1,10 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-initial-${SDK_SYS}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb
new file mode 100644
index 000000000..fd90e1140
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
new file mode 100644
index 000000000..cda292779
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -0,0 +1,12 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-${SDK_SYS}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+GCCMULTILIB = "--disable-multilib"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/nativesdk-${TARGET_PREFIX}libc-for-gcc gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb
new file mode 100644
index 000000000..40a6c4fef
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-crosssdk_7.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
new file mode 100644
index 000000000..31b8619be
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -0,0 +1,235 @@
+# following code modifies these definitions in the gcc config
+# MULTILIB_OPTIONS
+# MULTILIB_DIRNAMES
+# MULTILIB_OSDIRNAMES
+# GLIBC_DYNAMIC_LINKER32
+# GLIBC_DYNAMIC_LINKER64
+# GLIBC_DYNAMIC_LINKERX32
+# GLIBC_DYNAMIC_LINKERN32
+# For more information on use of these variables look at these files in the gcc source code
+# gcc/config/i386/t-linux64
+# gcc/config/mips/t-linux64
+# gcc/config/rs6000/t-linux64
+# gcc/config/i386/linux64.h
+# gcc/config/mips/linux64.h
+# gcc/config/rs6000/linux64.h
+
+MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64"
+
+python gcc_multilib_setup() {
+ import re
+ import shutil
+ import glob
+
+ srcdir = d.getVar('S')
+ builddir = d.getVar('B')
+ src_conf_dir = '%s/gcc/config' % srcdir
+ build_conf_dir = '%s/gcc/config' % builddir
+
+ bb.utils.remove(build_conf_dir, True)
+ ml_globs = ('%s/*/t-linux64' % src_conf_dir,
+ '%s/*/linux64.h' % src_conf_dir,
+ '%s/aarch64/t-aarch64' % src_conf_dir,
+ '%s/aarch64/aarch64.h' % src_conf_dir,
+ '%s/aarch64/aarch64-cores.def' % src_conf_dir,
+ '%s/*/linux.h' % src_conf_dir,
+ '%s/linux.h' % src_conf_dir)
+
+ # copy the target multilib config files to ${B}
+ for ml_glob in ml_globs:
+ for fn in glob.glob(ml_glob):
+ rel_path = os.path.relpath(fn, src_conf_dir)
+ parent_dir = os.path.dirname(rel_path)
+ bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir))
+ bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path))
+
+ pn = d.getVar('PN')
+ multilibs = (d.getVar('MULTILIB_VARIANTS') or '').split()
+ if not multilibs and pn != "nativesdk-gcc":
+ return
+
+ mlprefix = d.getVar('MLPREFIX')
+
+ if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc":
+ return
+
+
+ def write_config(root, files, options, dirnames, osdirnames):
+ for ml_conf_file in files:
+ with open(root + '/' + ml_conf_file, 'r') as f:
+ filelines = f.readlines()
+ # recreate multilib configuration variables
+ substs = [
+ (r'^(\s*(MULTILIB_OPTIONS\s*=).*)$', r'\2 %s' % '/'.join(options)),
+ (r'^(\s*MULTILIB_OPTIONS\s*\+=.*)$', ''),
+ (r'^(\s*(MULTILIB_DIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(dirnames)),
+ (r'^(\s*MULTILIB_DIRNAMES\s*\+=.*)$', ''),
+ (r'^(\s*(MULTILIB_OSDIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(osdirnames)),
+ (r'^(\s*MULTILIB_OSDIRNAMES\s*\+=.*)$', ''),
+ ]
+
+ for (i, line) in enumerate(filelines):
+ for subst in substs:
+ line = re.sub(subst[0], subst[1], line)
+ filelines[i] = line
+
+ with open(root + '/' + ml_conf_file, 'w') as f:
+ f.write(''.join(filelines))
+
+ def write_headers(root, files, libdir32, libdir64, libdirx32, libdirn32):
+ def wrap_libdir(libdir):
+ if libdir.find('SYSTEMLIBS_DIR') != -1:
+ return '"%r"'
+ else:
+ return '"/%s/"' % libdir
+
+ for ml_conf_file in files:
+ fn = root + '/' + ml_conf_file
+ if not os.path.exists(fn):
+ continue
+ with open(fn, 'r') as f:
+ filelines = f.readlines()
+
+ # replace lines like
+ # #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
+ # by
+ # #define GLIBC_DYNAMIC_LINKER32 "/lib/" "ld-linux.so.2"
+ # this is needed to put the correct dynamic loader path in the generated binaries
+ substs = [
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\"\S+\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirx32) + r'\3'),
+ (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirn32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir64) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdirn32) + r'\3'),
+ (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$',
+ r'\1' + wrap_libdir(libdir32) + r'\3'),
+ ]
+
+ for (i, line) in enumerate(filelines):
+ for subst in substs:
+ line = re.sub(subst[0], subst[1], line)
+ filelines[i] = line
+
+ with open(root + '/' + ml_conf_file, 'w') as f:
+ f.write(''.join(filelines))
+
+
+ gcc_target_config_files = {
+ 'x86_64' : ['gcc/config/i386/t-linux64'],
+ 'i586' : ['gcc/config/i386/t-linux64'],
+ 'i686' : ['gcc/config/i386/t-linux64'],
+ 'mips' : ['gcc/config/mips/t-linux64'],
+ 'mips64' : ['gcc/config/mips/t-linux64'],
+ 'powerpc' : ['gcc/config/rs6000/t-linux64'],
+ 'powerpc64' : ['gcc/config/rs6000/t-linux64'],
+ 'aarch64' : ['gcc/config/aarch64/t-aarch64'],
+ 'arm' : ['gcc/config/aarch64/t-aarch64'],
+ }
+
+ gcc_header_config_files = {
+ 'x86_64' : ['gcc/config/i386/linux64.h'],
+ 'i586' : ['gcc/config/i386/linux64.h'],
+ 'i686' : ['gcc/config/i386/linux64.h'],
+ 'mips' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+ 'mips64' : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+ 'powerpc' : ['gcc/config/rs6000/linux64.h'],
+ 'powerpc64' : ['gcc/config/rs6000/linux64.h'],
+ 'aarch64' : ['gcc/config/aarch64/aarch64.h'],
+ 'arm' : ['gcc/config/aarch64/aarch64.h'],
+ }
+
+ libdir32 = 'SYSTEMLIBS_DIR'
+ libdir64 = 'SYSTEMLIBS_DIR'
+ libdirx32 = 'SYSTEMLIBS_DIR'
+ libdirn32 = 'SYSTEMLIBS_DIR'
+
+
+ target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
+ else d.getVar('TARGET_ARCH'))
+ if pn == "nativesdk-gcc":
+ header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")]
+ write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+ return
+
+ if target_arch not in gcc_target_config_files:
+ bb.warn('gcc multilib setup is not supported for TARGET_ARCH=' + target_arch)
+ return
+
+ target_config_files = gcc_target_config_files[target_arch]
+ header_config_files = gcc_header_config_files[target_arch]
+
+ ml_list = ['DEFAULTTUNE_MULTILIB_ORIGINAL' if mlprefix else 'DEFAULTTUNE']
+ mltunes = [('DEFAULTTUNE_virtclass-multilib-%s' % ml) for ml in multilibs]
+ if mlprefix:
+ mlindex = 0
+ for ml in multilibs:
+ if mlprefix == ml + '-':
+ break
+ mlindex += 1
+
+ ml_list.extend(mltunes[:mlindex] + ['DEFAULTTUNE'] + mltunes[(mlindex + 1):])
+ else:
+ ml_list.extend(mltunes)
+
+ options = []
+ dirnames = []
+ osdirnames = []
+ optsets = []
+
+ for ml in ml_list:
+ tune = d.getVar(ml)
+ if not tune:
+ bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml)
+ continue
+ tune_parameters = get_tune_parameters(tune, d)
+
+ tune_baselib = tune_parameters['baselib']
+ if not tune_baselib:
+ bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+ continue
+
+ if tune_baselib == 'lib64':
+ libdir64 = tune_baselib
+ elif tune_baselib == 'libx32':
+ libdirx32 = tune_baselib
+ elif tune_baselib == 'lib32':
+ libdirn32 = tune_baselib
+ elif tune_baselib == 'lib':
+ libdir32 = tune_baselib
+ else:
+ bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
+
+ # take out '-' mcpu='s and march='s from parameters
+ opts = []
+ whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST") or "").split()
+ for i in d.expand(tune_parameters['ccargs']).split():
+ if i in whitelist:
+ # Need to strip '-' from option
+ opts.append(i[1:])
+ options.append(" ".join(opts))
+
+ if tune_baselib == 'lib':
+ dirnames.append('32') # /lib => 32bit lib
+ else:
+ dirnames.append(tune_baselib.replace('lib', ''))
+ osdirnames.append('../' + tune_baselib)
+
+ write_config(builddir, target_config_files, options, dirnames, osdirnames)
+ write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+}
+
+gcc_multilib_setup[cleandirs] = "${B}/gcc/config"
+gcc_multilib_setup[vardepsexclude] = "SDK_ARCH"
+
+EXTRACONFFUNCS += "gcc_multilib_setup"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-runtime.inc b/poky/meta/recipes-devtools/gcc/gcc-runtime.inc
new file mode 100644
index 000000000..7629fa56f
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -0,0 +1,291 @@
+require gcc-configure-common.inc
+
+SUMMARY = "Runtime libraries from GCC"
+
+# Over-ride the LICENSE set by gcc-${PV}.inc to remove "& GPLv3"
+# All gcc-runtime packages are now covered by the runtime exception.
+LICENSE = "GPL-3.0-with-GCC-exception"
+
+CXXFLAGS_remove = "-fvisibility-inlines-hidden"
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+RUNTIMELIBITM = "libitm"
+RUNTIMELIBITM_mipsarch = ""
+RUNTIMELIBITM_nios2 = ""
+RUNTIMELIBITM_microblaze = ""
+RUNTIMELIBITM_riscv32 = ""
+RUNTIMELIBITM_riscv64 = ""
+
+RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
+ ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
+"
+RUNTIMETARGET_append_x86 = " libmpx"
+RUNTIMETARGET_append_x86-64 = " libmpx"
+RUNTIMETARGET_remove_libc-musl = "libmpx"
+
+# libiberty
+# libmudflap
+# libgfortran needs separate recipe due to libquadmath dependency
+
+SLIB = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+SLIB_NEW = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
+
+DEBUG_PREFIX_MAP_class-target = " \
+ -fdebug-prefix-map=${WORKDIR}/recipe-sysroot= \
+ -fdebug-prefix-map=${WORKDIR}/recipe-sysroot-native= \
+ -fdebug-prefix-map=${SLIB}=${SLIB_NEW} \
+ -fdebug-prefix-map=${SLIB}/include=${SLIB_NEW}/libstdc++-v3/../include \
+ -fdebug-prefix-map=${SLIB}/libiberty=${SLIB_NEW}/libstdc++-v3/../libiberty \
+ -fdebug-prefix-map=${B}=${SLIB_NEW} \
+ "
+
+do_configure () {
+ export CXX="${CXX} -nostdinc++ -nostdlib++"
+ for d in libgcc ${RUNTIMETARGET}; do
+ echo "Configuring $d"
+ rm -rf ${B}/${TARGET_SYS}/$d/
+ mkdir -p ${B}/${TARGET_SYS}/$d/
+ cd ${B}/${TARGET_SYS}/$d/
+ chmod a+x ${S}/$d/configure
+ relpath=${@os.path.relpath("${S}/$d", "${B}/${TARGET_SYS}/$d")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ if [ "$d" = "libgcc" ]; then
+ (cd ${B}/${TARGET_SYS}/libgcc; oe_runmake enable-execute-stack.c unwind.h md-unwind-support.h sfp-machine.h gthr-default.h)
+ fi
+ done
+}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
+
+do_compile () {
+ for d in libgcc ${RUNTIMETARGET}; do
+ cd ${B}/${TARGET_SYS}/$d/
+ oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/
+ done
+}
+
+do_install () {
+ for d in ${RUNTIMETARGET}; do
+ cd ${B}/${TARGET_SYS}/$d/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/$d/ install
+ done
+ rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
+ rm -rf ${D}${infodir}/libitm.info ${D}${infodir}/dir
+ rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
+ if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+ fi
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ if [ "${TARGET_VENDOR_MULTILIB_ORIGINAL}" != "" -a "${TARGET_VENDOR}" != "${TARGET_VENDOR_MULTILIB_ORIGINAL}" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR_MULTILIB_ORIGINAL}-${TARGET_OS}
+ fi
+
+}
+
+do_install_append_class-target () {
+ if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ fi
+
+ if [ "${TARGET_OS}" = "linux-gnun32" ]; then
+ if [ "${MULTILIBS}" != "" ]; then
+ mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux
+ ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-pokymllib64-linux/32
+ else
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ fi
+ fi
+ if [ "${TARGET_OS}" = "linux-gnux32" ]; then
+ if [ "${MULTILIBS}" != "" ]; then
+ mkdir ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux
+ ln -s ../${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}-poky-linux/x32
+ else
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+ fi
+ fi
+
+ if [ "${TCLIBC}" != "glibc" ]; then
+ case "${TARGET_OS}" in
+ "linux-musl" | "linux-*spe") extra_target_os="linux";;
+ "linux-musleabi") extra_target_os="linux-gnueabi";;
+ *) extra_target_os="linux";;
+ esac
+ ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
+PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+ ${PN}-dbg \
+ libstdc++ \
+ libstdc++-precompile-dev \
+ libstdc++-dev \
+ libstdc++-staticdev \
+ libg2c \
+ libg2c-dev \
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ libmudflap \
+ libmudflap-dev \
+ libmudflap-staticdev \
+ libquadmath \
+ libquadmath-dev \
+ libquadmath-staticdev \
+ libgomp \
+ libgomp-dev \
+ libgomp-staticdev \
+ libatomic \
+ libatomic-dev \
+ libatomic-staticdev \
+ libitm \
+ libitm-dev \
+ libitm-staticdev \
+"
+PACKAGES_append_x86 = "\
+ libmpx \
+ libmpx-dev \
+ libmpx-staticdev \
+"
+
+PACKAGES_append_x86-64 = "\
+ libmpx \
+ libmpx-dev \
+ libmpx-staticdev \
+"
+
+# The base package doesn't exist, so we clear the recommends.
+RRECOMMENDS_${PN}-dbg = ""
+
+# include python debugging scripts
+FILES_${PN}-dbg += "\
+ ${libdir}/libstdc++.so.*-gdb.py \
+ ${datadir}/gcc-${BINV}/python/libstdcxx \
+"
+
+FILES_libg2c = "${target_libdir}/libg2c.so.*"
+SUMMARY_libg2c = "Companion runtime library for g77"
+FILES_libg2c-dev = "\
+ ${libdir}/libg2c.so \
+ ${libdir}/libg2c.a \
+ ${libdir}/libfrtbegin.a \
+"
+SUMMARY_libg2c-dev = "Companion runtime library for g77 - development files"
+
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+SUMMARY_libstdc++ = "GNU standard C++ library"
+FILES_libstdc++-dev = "\
+ ${includedir}/c++/ \
+ ${libdir}/libstdc++.so \
+ ${libdir}/libstdc++*.la \
+ ${libdir}/libsupc++.la \
+"
+SUMMARY_libstdc++-dev = "GNU standard C++ library - development files"
+FILES_libstdc++-staticdev = "\
+ ${libdir}/libstdc++*.a \
+ ${libdir}/libsupc++.a \
+"
+SUMMARY_libstdc++-staticdev = "GNU standard C++ library - static development files"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+SUMMARY_libstdc++-precompile-dev = "GNU standard C++ library - precompiled header files"
+
+FILES_libssp = "${libdir}/libssp.so.*"
+SUMMARY_libssp = "GNU stack smashing protection library"
+FILES_libssp-dev = "\
+ ${libdir}/libssp*.so \
+ ${libdir}/libssp*_nonshared.a \
+ ${libdir}/libssp*.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+"
+SUMMARY_libssp-dev = "GNU stack smashing protection library - development files"
+FILES_libssp-staticdev = "${libdir}/libssp*.a"
+SUMMARY_libssp-staticdev = "GNU stack smashing protection library - static development files"
+
+FILES_libquadmath = "${libdir}/libquadmath*.so.*"
+SUMMARY_libquadmath = "GNU quad-precision math library"
+FILES_libquadmath-dev = "\
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+ ${libdir}/libquadmath*.so \
+ ${libdir}/libquadmath.la \
+"
+SUMMARY_libquadmath-dev = "GNU quad-precision math library - development files"
+FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
+SUMMARY_libquadmath-staticdev = "GNU quad-precision math library - static development files"
+
+# NOTE: mudflap has been removed as of gcc 4.9 and has been superseded by the address sanitiser
+FILES_libmudflap = "${libdir}/libmudflap*.so.*"
+SUMMARY_libmudflap = "Pointer debugging library for gcc"
+FILES_libmudflap-dev = "\
+ ${libdir}/libmudflap*.so \
+ ${libdir}/libmudflap.la \
+"
+SUMMARY_libmudflap-dev = "Pointer debugging library for gcc - development files"
+FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
+SUMMARY_libmudflap-staticdev = "Pointer debugging library for gcc - static development files"
+
+FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
+SUMMARY_libgomp = "GNU OpenMP parallel programming library"
+FILES_libgomp-dev = "\
+ ${libdir}/libgomp*${SOLIBSDEV} \
+ ${libdir}/libgomp*.la \
+ ${libdir}/libgomp.spec \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+"
+SUMMARY_libgomp-dev = "GNU OpenMP parallel programming library - development files"
+FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
+SUMMARY_libgomp-staticdev = "GNU OpenMP parallel programming library - static development files"
+
+FILES_libatomic = "${libdir}/libatomic.so.*"
+SUMMARY_libatomic = "GNU C++11 atomics support library"
+FILES_libatomic-dev = "\
+ ${libdir}/libatomic.so \
+ ${libdir}/libatomic.la \
+"
+SUMMARY_libatomic-dev = "GNU C++11 atomics support library - development files"
+FILES_libatomic-staticdev = "${libdir}/libatomic.a"
+SUMMARY_libatomic-staticdev = "GNU C++11 atomics support library - static development files"
+
+FILES_libitm = "${libdir}/libitm.so.*"
+SUMMARY_libitm = "GNU transactional memory support library"
+FILES_libitm-dev = "\
+ ${libdir}/libitm.so \
+ ${libdir}/libitm.la \
+ ${libdir}/libitm.spec \
+"
+SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
+FILES_libitm-staticdev = "${libdir}/libitm.a"
+SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
+
+
+FILES_libmpx = "${libdir}/libmpx.so.* ${libdir}/libmpxwrappers.so.*"
+SUMMARY_libmpx = "Intel Memory Protection Extension library"
+FILES_libmpx-dev = "\
+ ${libdir}/libmpxwrappers.so \
+ ${libdir}/libmpxwrappers.la \
+ ${libdir}/libmpx.so \
+ ${libdir}/libmpx.la \
+ ${libdir}/libmpx.spec \
+"
+SUMMARY_libmpx-dev = "Intel Memory Protection Extension library - development files"
+FILES_libmpx-staticdev = "${libdir}/libmpx.a ${libdir}/libmpxwrappers.a"
+SUMMARY_libmpx-staticdev = "Intel Memory Protection Extension library - static development files"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb
new file mode 100644
index 000000000..8f31e7792
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-runtime_7.3.bb
@@ -0,0 +1,7 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
+FILES_libgomp-dev += "\
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
+"
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
new file mode 100644
index 000000000..3b7e0028f
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -0,0 +1,108 @@
+require gcc-configure-common.inc
+
+LICENSE = "NCSA | MIT"
+
+LIC_FILES_CHKSUM = "\
+ file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \
+"
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+ rm -rf ${B}/${TARGET_SYS}/libsanitizer/
+ mkdir -p ${B}/${TARGET_SYS}/libsanitizer/
+ cd ${B}/${TARGET_SYS}/libsanitizer/
+ chmod a+x ${S}/libsanitizer/configure
+ relpath=${@os.path.relpath("${S}/libsanitizer", "${B}/${TARGET_SYS}/libsanitizer")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ # Easiest way to stop bad RPATHs getting into the library since we have a
+ # broken libtool here
+ sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/libsanitizer/libtool
+ # Link to the sysroot's libstdc++ instead of one gcc thinks it just built
+ sed -i -e '/LIBSTDCXX_RAW_CXX_\(CXXFLAGS\|LDFLAGS\)\s*=/d' ${B}/${TARGET_SYS}/libsanitizer/*/Makefile
+}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
+
+do_compile () {
+ cd ${B}/${TARGET_SYS}/libsanitizer/
+ oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/
+}
+
+do_install () {
+ cd ${B}/${TARGET_SYS}/libsanitizer/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libsanitizer/ install
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+ALLOW_EMPTY_${PN} = "1"
+DEPENDS = "gcc-runtime virtual/${TARGET_PREFIX}gcc"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "${PN} ${PN}-dbg"
+PACKAGES += "libasan libubsan liblsan libtsan"
+PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev"
+PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev"
+
+RDEPENDS_libasan += "libstdc++"
+RDEPENDS_libubsan += "libstdc++"
+RDEPENDS_liblsan += "libstdc++"
+RDEPENDS_libtsan += "libstdc++"
+RDEPENDS_libasan-dev += "${PN}"
+RDEPENDS_libubsan-dev += "${PN}"
+RDEPENDS_liblsan-dev += "${PN}"
+RDEPENDS_libtsan-dev += "${PN}"
+RRECOMMENDS_${PN} += "libasan libubsan"
+RRECOMMENDS_${PN}_append_x86 = " liblsan"
+RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_powerpc64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_aarch64 = " liblsan libtsan"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+
+# Only x86, powerpc, sparc, s390, arm, and aarch64 are supported
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|sparc|s390|arm|aarch64).*-linux'
+# musl is currently broken entirely
+COMPATIBLE_HOST_libc-musl = 'null'
+
+FILES_libasan += "${libdir}/libasan.so.*"
+FILES_libasan-dev += "\
+ ${libdir}/libasan_preinit.o \
+ ${libdir}/libasan.so \
+ ${libdir}/libasan.la \
+"
+FILES_libasan-staticdev += "${libdir}/libasan.a"
+
+FILES_libubsan += "${libdir}/libubsan.so.*"
+FILES_libubsan-dev += "\
+ ${libdir}/libubsan.so \
+ ${libdir}/libubsan.la \
+"
+FILES_libubsan-staticdev += "${libdir}/libubsan.a"
+
+FILES_liblsan += "${libdir}/liblsan.so.*"
+FILES_liblsan-dev += "\
+ ${libdir}/liblsan.so \
+ ${libdir}/liblsan.la \
+"
+FILES_liblsan-staticdev += "${libdir}/liblsan.a"
+
+FILES_libtsan += "${libdir}/libtsan.so.*"
+FILES_libtsan-dev += "\
+ ${libdir}/libtsan.so \
+ ${libdir}/libtsan.la \
+ ${libdir}/libtsan_*.o \
+"
+FILES_libtsan-staticdev += "${libdir}/libtsan.a"
+
+FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb
new file mode 100644
index 000000000..601f66602
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-sanitizers_7.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/poky/meta/recipes-devtools/gcc/gcc-shared-source.inc b/poky/meta/recipes-devtools/gcc/gcc-shared-source.inc
new file mode 100644
index 000000000..aac4b4931
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -0,0 +1,11 @@
+do_fetch() {
+ :
+}
+do_fetch[noexec] = "1"
+deltask do_unpack
+deltask do_patch
+
+SRC_URI = ""
+
+do_configure[depends] += "gcc-source-${PV}:do_preconfigure"
+do_populate_lic[depends] += "gcc-source-${PV}:do_unpack"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-source.inc b/poky/meta/recipes-devtools/gcc/gcc-source.inc
new file mode 100644
index 000000000..03bab9781
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-source.inc
@@ -0,0 +1,39 @@
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+deltask do_populate_lic
+RM_WORK_EXCLUDE += "${PN}"
+
+inherit nopackages
+
+PN = "gcc-source-${PV}"
+WORKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
+SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
+
+STAMP = "${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/work-shared/gcc-${PV}-*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = ""
+PACKAGES = ""
+
+
+# This needs to be Python to avoid lots of shell variables becoming dependencies.
+python do_preconfigure () {
+ import subprocess
+ cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ # See 0044-gengtypes.patch, we need to regenerate this file
+ bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
+ cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+
+ # Easiest way to stop bad RPATHs getting into the library since we have a
+ # broken libtool here (breaks cross-canadian and target at least)
+ cmd = d.expand("sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure")
+ subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+}
+addtask do_preconfigure after do_patch
+do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
+
diff --git a/poky/meta/recipes-devtools/gcc/gcc-source_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc-source_7.3.bb
new file mode 100644
index 000000000..b890fa33e
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-source_7.3.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/poky/meta/recipes-devtools/gcc/gcc-target.inc b/poky/meta/recipes-devtools/gcc/gcc-target.inc
new file mode 100644
index 000000000..b6e31f5d9
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,237 @@
+GCCMULTILIB = "--enable-multilib"
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/ \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+ --with-gxx-include-dir=${includedir}/c++/${BINV} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+# ARMv6+ adds atomic instructions that affect the ABI in libraries built
+# with TUNE_CCARGS in gcc-runtime. Make the compiler default to a
+# compatible architecture. armv6 and armv7a cover the minimum tune
+# features used in OE.
+EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
+EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
+EXTRA_OECONF_append_armv7ve = " --with-arch=armv7-a"
+
+# libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
+# set in subdir gcc, so subdir libcc1 can't use it, export it here to
+# fix the problem.
+export gcc_cv_objdump = "${TARGET_PREFIX}objdump"
+
+EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}"
+
+PACKAGES = "\
+ ${PN} ${PN}-plugins ${PN}-symlinks \
+ g++ g++-symlinks \
+ cpp cpp-symlinks \
+ g77 g77-symlinks \
+ gfortran gfortran-symlinks \
+ gcov gcov-symlinks \
+ ${PN}-doc \
+ ${PN}-dev \
+ ${PN}-dbg \
+"
+
+FILES_${PN} = "\
+ ${bindir}/${TARGET_PREFIX}gcc* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+"
+INSANE_SKIP_${PN} += "dev-so"
+RRECOMMENDS_${PN} += "\
+ libssp \
+ libssp-dev \
+"
+RDEPENDS_${PN} += "cpp"
+
+FILES_${PN}-dev = "\
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
+"
+FILES_${PN}-symlinks = "\
+ ${bindir}/cc \
+ ${bindir}/gcc \
+ ${bindir}/gccbug \
+"
+
+FILES_${PN}-plugins = "\
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
+"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+FILES_g77 = "\
+ ${bindir}/${TARGET_PREFIX}g77 \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
+"
+FILES_g77-symlinks = "\
+ ${bindir}/g77 \
+ ${bindir}/f77 \
+"
+RRECOMMENDS_g77 = "\
+ libg2c \
+ libg2c-dev \
+"
+
+FILES_gfortran = "\
+ ${bindir}/${TARGET_PREFIX}gfortran \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+"
+RRECOMMENDS_gfortran = "\
+ libquadmath \
+ libquadmath-dev \
+"
+FILES_gfortran-symlinks = "\
+ ${bindir}/gfortran \
+ ${bindir}/f95"
+
+FILES_cpp = "\
+ ${bindir}/${TARGET_PREFIX}cpp* \
+ ${base_libdir}/cpp \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
+FILES_cpp-symlinks = "${bindir}/cpp"
+
+FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov* \
+ ${bindir}/${TARGET_PREFIX}gcov-tool* \
+"
+FILES_gcov-symlinks = "${bindir}/gcov \
+ ${bindir}/gcov-tool \
+"
+
+FILES_g++ = "\
+ ${bindir}/${TARGET_PREFIX}g++* \
+ ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+"
+FILES_g++-symlinks = "\
+ ${bindir}/c++ \
+ ${bindir}/g++ \
+"
+RRECOMMENDS_g++ = "\
+ libstdc++ \
+ libstdc++-dev \
+ libatomic \
+ libatomic-dev \
+"
+
+FILES_${PN}-doc = "\
+ ${infodir} \
+ ${mandir} \
+ ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+do_compile () {
+ oe_runmake all-host
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install-host
+
+ # Add unwind.h, it comes from libgcc which we don't want to build again
+ install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ # Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+ rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+ rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
+ rmdir ${D}${includedir}
+ rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+ # Hack around specs file assumptions
+ test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
+
+ # Cleanup manpages..
+ rm -rf ${D}${mandir}/man7
+
+ cd ${D}${bindir}
+
+ # We care about g++ not c++
+ rm -f *c++*
+
+ # We don't care about the gcc-<version> ones for this
+ rm -f *gcc-?.?*
+
+ # We use libiberty from binutils
+ find ${D}${libdir} -name libiberty.a | xargs rm -f
+ find ${D}${libdir} -name libiberty.h | xargs rm -f
+
+ # Not sure why we end up with these but we don't want them...
+ rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
+
+ # Symlinks so we can use these trivially on the target
+ if [ -e ${TARGET_PREFIX}g77 ]; then
+ ln -sf ${TARGET_PREFIX}g77 g77 || true
+ ln -sf g77 f77 || true
+ fi
+ if [ -e ${TARGET_PREFIX}gfortran ]; then
+ ln -sf ${TARGET_PREFIX}gfortran gfortran || true
+ ln -sf gfortran f95 || true
+ fi
+ ln -sf ${TARGET_PREFIX}g++ g++
+ ln -sf ${TARGET_PREFIX}gcc gcc
+ ln -sf ${TARGET_PREFIX}cpp cpp
+ ln -sf ${TARGET_PREFIX}gcov gcov
+ ln -sf ${TARGET_PREFIX}gcov-tool gcov-tool
+ install -d ${D}${base_libdir}
+ ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
+ ln -sf g++ c++
+ ln -sf gcc cc
+
+ chown -R root:root ${D}
+}
+
+do_install_append () {
+ #
+ # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header
+ # files and places the modified files into
+ # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the
+ # build not deterministic. The following code prunes all those headers
+ # except those under include-fixed/linux, *limits.h and README, yielding
+ # the same include-fixed folders no matter what sysroot
+
+ include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed"
+ for f in $(find ${include_fixed} -type f); do
+ case $f in
+ */include-fixed/linux/*)
+ continue
+ ;;
+ */include-fixed/*limits.h)
+ continue
+ ;;
+ */include-fixed/README)
+ continue
+ ;;
+ *)
+ # remove file and directory if empty
+ bbdebug 2 "Pruning $f"
+ rm $f
+ find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \;
+ ;;
+ esac
+ done
+}
+
+# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
+# and one from here. These can confuse gcc cross where includes use #include_next
+# and builds track file dependencies (e.g. perl and its makedepends code).
+# For determinism we don't install this ever and rely on the copy from gcc-cross.
+# [YOCTO #7287]
+SYSROOT_DIRS_BLACKLIST += "${libdir}/gcc"
diff --git a/poky/meta/recipes-devtools/gcc/gcc_7.3.bb b/poky/meta/recipes-devtools/gcc/gcc_7.3.bb
new file mode 100644
index 000000000..ab208e702
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/gcc_7.3.bb
@@ -0,0 +1,10 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t armv5t fails with
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/gcc/libgcc-common.inc b/poky/meta/recipes-devtools/gcc/libgcc-common.inc
new file mode 100644
index 000000000..848a47620
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -0,0 +1,155 @@
+BPN = "libgcc"
+
+require gcc-configure-common.inc
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_configure () {
+ install -d ${D}${base_libdir} ${D}${libdir}
+ mkdir -p ${B}/${BPN}
+ mkdir -p ${B}/${TARGET_SYS}/${BPN}/
+ cd ${B}/${BPN}
+ chmod a+x ${S}/${BPN}/configure
+ relpath=${@os.path.relpath("${S}/${BPN}", "${B}/${BPN}")}
+ $relpath/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
+
+do_compile () {
+ cd ${B}/${BPN}
+ oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/
+}
+
+do_install () {
+ cd ${B}/${BPN}
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/${BPN}/ install
+
+ # Move libgcc_s into /lib
+ mkdir -p ${D}${base_libdir}
+ if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
+ mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
+ else
+ mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
+ fi
+
+ # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
+ # so that cross-gcc can find it in the sysroot
+
+ mv ${D}${libdir}/gcc/* ${D}${libdir}
+ rm -rf ${D}${libdir}/gcc/
+ # unwind.h is installed here which is shipped in gcc-cross
+ # as well as target gcc and they are identical so we dont
+ # ship one with libgcc here
+ rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
+}
+
+do_install_append_libc-baremetal () {
+ rmdir ${D}${base_libdir}
+}
+
+RDEPENDS_${PN}-dev_libc-baremetal = ""
+
+BBCLASSEXTEND = "nativesdk"
+
+addtask multilib_install after do_install before do_package do_populate_sysroot
+# this makes multilib gcc files findable for target gcc
+# e.g.
+# /usr/lib/i586-pokymllib32-linux/4.7/
+# by creating this symlink to it
+# /usr/lib64/x86_64-poky-linux/4.7/32
+
+fakeroot python do_multilib_install() {
+ import re
+
+ multilibs = d.getVar('MULTILIB_VARIANTS')
+ if not multilibs or bb.data.inherits_class('nativesdk', d):
+ return
+
+ binv = d.getVar('BINV')
+
+ mlprefix = d.getVar('MLPREFIX')
+ if ('%slibgcc' % mlprefix) != d.getVar('PN'):
+ return
+
+ if mlprefix:
+ orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL')
+ orig_tune_params = get_tune_parameters(orig_tune, d)
+ orig_tune_baselib = orig_tune_params['baselib']
+ orig_tune_bitness = orig_tune_baselib.replace('lib', '')
+ if not orig_tune_bitness:
+ orig_tune_bitness = '32'
+
+ src = '../../../' + orig_tune_baselib + '/' + \
+ d.getVar('TARGET_SYS_MULTILIB_ORIGINAL') + '/' + binv + '/'
+
+ dest = d.getVar('D') + d.getVar('libdir') + '/' + \
+ d.getVar('TARGET_SYS') + '/' + binv + '/' + orig_tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+ return
+
+
+ for ml in multilibs.split():
+ tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml)
+ if not tune:
+ bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
+ continue
+
+ tune_parameters = get_tune_parameters(tune, d)
+ tune_baselib = tune_parameters['baselib']
+ if not tune_baselib:
+ bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+ continue
+
+ tune_arch = tune_parameters['arch']
+ tune_bitness = tune_baselib.replace('lib', '')
+ if not tune_bitness:
+ tune_bitness = '32' # /lib => 32bit lib
+
+ tune_abiextension = tune_parameters['abiextension']
+ if tune_abiextension:
+ libcextension = '-gnu' + tune_abiextension
+ else:
+ libcextension = ''
+
+ src = '../../../' + tune_baselib + '/' + \
+ tune_arch + d.getVar('TARGET_VENDOR') + 'ml' + ml + \
+ '-' + d.getVar('TARGET_OS') + libcextension + '/' + binv + '/'
+
+ dest = d.getVar('D') + d.getVar('libdir') + '/' + \
+ d.getVar('TARGET_SYS') + '/' + binv + '/' + tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+}
+
+def get_original_os(d):
+ vendoros = d.expand('${TARGET_ARCH}${ORIG_TARGET_VENDOR}-${TARGET_OS}')
+ for suffix in [d.getVar('ABIEXTENSION'), d.getVar('LIBCEXTENSION')]:
+ if suffix and vendoros.endswith(suffix):
+ vendoros = vendoros[:-len(suffix)]
+ # Arm must use linux-gnueabi not linux as only the former is accepted by gcc
+ if vendoros.startswith("arm-") and not vendoros.endswith("-gnueabi"):
+ vendoros = vendoros + "-gnueabi"
+ return vendoros
+
+ORIG_TARGET_VENDOR := "${TARGET_VENDOR}"
+BASETARGET_SYS = "${@get_original_os(d)}"
+
+addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
+fakeroot python do_extra_symlinks() {
+ if bb.data.inherits_class('nativesdk', d):
+ return
+
+ targetsys = d.getVar('BASETARGET_SYS')
+
+ if targetsys != d.getVar('TARGET_SYS'):
+ dest = d.getVar('D') + d.getVar('libdir') + '/' + targetsys
+ src = d.getVar('TARGET_SYS')
+ if not os.path.lexists(dest) and os.path.lexists(d.getVar('D') + d.getVar('libdir')):
+ os.symlink(src, dest)
+}
diff --git a/poky/meta/recipes-devtools/gcc/libgcc-initial.inc b/poky/meta/recipes-devtools/gcc/libgcc-initial.inc
new file mode 100644
index 000000000..950ad861e
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -0,0 +1,20 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
+
+LICENSE = "GPL-3.0-with-GCC-exception"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+PACKAGES = ""
+
+EXTRA_OECONF += "--disable-shared"
+
+COMPILERINITIAL = "-initial"
+
+inherit nopackages
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/poky/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb b/poky/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb
new file mode 100644
index 000000000..19f253fce
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgcc-initial_7.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/poky/meta/recipes-devtools/gcc/libgcc.inc b/poky/meta/recipes-devtools/gcc/libgcc.inc
new file mode 100644
index 000000000..5f1dff609
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgcc.inc
@@ -0,0 +1,42 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+do_install_append_class-target () {
+ if [ "${TCLIBC}" != "glibc" ]; then
+ case "${TARGET_OS}" in
+ "linux-musl" | "linux-*spe") extra_target_os="linux";;
+ "linux-musleabi") extra_target_os="linux-gnueabi";;
+ *) extra_target_os="linux";;
+ esac
+ ln -s ${TARGET_SYS} ${D}${libdir}/${TARGET_ARCH}${TARGET_VENDOR}-$extra_target_os
+ fi
+}
+
+PACKAGES = "\
+ ${PN} \
+ ${PN}-dev \
+ ${PN}-dbg \
+"
+
+# All libgcc source is marked with the exception.
+#
+LICENSE_${PN} = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception"
+
+
+FILES_${PN}-dev = "\
+ ${base_libdir}/libgcc*.so \
+ ${@oe.utils.conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
+ ${libdir}/${TARGET_SYS}/${BINV}* \
+ ${libdir}/${TARGET_ARCH}${TARGET_VENDOR}* \
+"
+
+do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+INSANE_SKIP_${PN}-dev = "staticdev"
+
diff --git a/poky/meta/recipes-devtools/gcc/libgcc_7.3.bb b/poky/meta/recipes-devtools/gcc/libgcc_7.3.bb
new file mode 100644
index 000000000..a5152f28e
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgcc_7.3.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/poky/meta/recipes-devtools/gcc/libgfortran.inc b/poky/meta/recipes-devtools/gcc/libgfortran.inc
new file mode 100644
index 000000000..05237647d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgfortran.inc
@@ -0,0 +1,77 @@
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+ for target in libbacktrace libgfortran
+ do
+ rm -rf ${B}/${TARGET_SYS}/$target/
+ mkdir -p ${B}/${TARGET_SYS}/$target/
+ cd ${B}/${TARGET_SYS}/$target/
+ chmod a+x ${S}/$target/configure
+ relpath=${@os.path.relpath("${S}", "${B}/${TARGET_SYS}")}
+ ../$relpath/$target/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+ # Easiest way to stop bad RPATHs getting into the library since we have a
+ # broken libtool here
+ sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/${TARGET_SYS}/$target/libtool
+ done
+}
+EXTRACONFFUNCS += "extract_stashed_builddir"
+do_configure[depends] += "${COMPILERDEP}"
+
+do_compile () {
+ for target in libbacktrace libgfortran
+ do
+ cd ${B}/${TARGET_SYS}/$target/
+ oe_runmake MULTIBUILDTOP=${B}/${TARGET_SYS}/$target/
+ done
+}
+
+do_install () {
+ cd ${B}/${TARGET_SYS}/libgfortran/
+ oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/${TARGET_SYS}/libgfortran/ install
+ if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+ fi
+ if [ -d ${D}${infodir} ]; then
+ rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+ fi
+ chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "gcc-runtime gcc-cross-${TARGET_ARCH}"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+ ${PN}-dbg \
+ libgfortran \
+ libgfortran-dev \
+ libgfortran-staticdev \
+"
+FILES_${PN} = "${libdir}/libgfortran.so.*"
+FILES_${PN}-dev = "\
+ ${libdir}/libgfortran*.so \
+ ${libdir}/libgfortran.spec \
+ ${libdir}/libgfortran.la \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \
+ ${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude/ \
+"
+FILES_${PN}-staticdev = "${libdir}/libgfortran.a"
+
+INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+python __anonymous () {
+ f = d.getVar("FORTRAN")
+ if "fortran" not in f:
+ raise bb.parse.SkipRecipe("libgfortran needs fortran support to be enabled in the compiler")
+}
diff --git a/poky/meta/recipes-devtools/gcc/libgfortran_7.3.bb b/poky/meta/recipes-devtools/gcc/libgfortran_7.3.bb
new file mode 100644
index 000000000..71dd8b4bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/gcc/libgfortran_7.3.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb-8.0.1.inc b/poky/meta/recipes-devtools/gdb/gdb-8.0.1.inc
new file mode 100644
index 000000000..4a5299b73
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-8.0.1.inc
@@ -0,0 +1,24 @@
+LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
+ file://0001-include-sys-types.h-for-mode_t.patch \
+ file://0002-make-man-install-relative-to-DESTDIR.patch \
+ file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch \
+ file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch \
+ file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch \
+ file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \
+ file://0007-use-asm-sgidefs.h.patch \
+ file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
+ file://0009-Change-order-of-CFLAGS.patch \
+ file://0010-resolve-restrict-keyword-conflict.patch \
+ file://package_devel_gdb_patches_120-sigprocmask-invalid-call.patch \
+ file://0012-Unbreak-GDBserver-build-for-x32.patch \
+ file://gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch \
+"
+SRC_URI[md5sum] = "48cac527e6f3018b865ece021e9723ac"
+SRC_URI[sha256sum] = "3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3"
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb-common.inc b/poky/meta/recipes-devtools/gdb/gdb-common.inc
new file mode 100644
index 000000000..039577b8e
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-common.inc
@@ -0,0 +1,61 @@
+SUMMARY = "GNU debugger"
+HOMEPAGE = "http://www.gnu.org/software/gdb/"
+SECTION = "devel"
+DEPENDS = "expat zlib ncurses virtual/libiconv ${LTTNGUST}"
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_aarch64 = ""
+LTTNGUST_riscv64 = ""
+LTTNGUST_mipsarch = ""
+LTTNGUST_sh4 = ""
+LTTNGUST_libc-musl = ""
+
+inherit autotools texinfo
+
+UPSTREAM_CHECK_GITTAGREGEX = "gdb\-(?P<pver>.+)\-release"
+
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'"
+
+EXPAT = "--with-expat --with-libexpat-prefix=${STAGING_DIR_HOST}"
+
+EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x --disable-werror \
+ --with-curses --disable-multilib --disable-sim \
+ --without-lzma --without-guile \
+ ${GDBPROPREFIX} ${EXPAT} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
+ --disable-rpath \
+ --disable-gas --disable-binutils \
+ --disable-ld --disable-gold \
+ --disable-gprof \
+"
+
+PACKAGECONFIG ??= "readline"
+# Use --without-system-readline to compile with readline 5.
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python3,python3 python3-codecs"
+PACKAGECONFIG[babeltrace] = "--with-babeltrace,--without-babeltrace,babeltrace"
+
+GDBPROPREFIX = "--program-prefix=''"
+
+do_configure () {
+ # override this function to avoid the autoconf/automake/aclocal/autoheader
+ # calls for now
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ oe_runconf
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils. Same for bfd.info -- also from binutils.
+do_install_append() {
+ rm -rf ${D}${libdir}
+ rm -rf ${D}${includedir}
+ rm -rf ${D}${datadir}/locale
+ rm -f ${D}${infodir}/bfd.info
+}
+
+RRECOMMENDS_gdb_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux-gnueabi = " glibc-thread-db "
diff --git a/poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
new file mode 100644
index 000000000..4fc6747d9
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -0,0 +1,43 @@
+inherit cross-canadian
+inherit python3-dir
+
+SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
+PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "gdb"
+
+DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext \
+ virtual/${HOST_PREFIX}gcc-crosssdk virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc"
+
+GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
+
+# Overrides PACKAGECONFIG variables in gdb-common.inc
+PACKAGECONFIG ??= "python readline"
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,nativesdk-python3, \
+ nativesdk-python3-core \
+ nativesdk-python3-codecs nativesdk-python3-netclient \
+ "
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,nativesdk-readline"
+
+SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+ --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
+ --exec-prefix) echo "${exec_prefix}" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils.
+do_install_append() {
+ rm -rf ${D}${exec_prefix}/lib
+ cross_canadian_bindirlinks
+}
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb-cross-canadian_8.0.1.bb b/poky/meta/recipes-devtools/gdb/gdb-cross-canadian_8.0.1.bb
new file mode 100644
index 000000000..301035940
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-cross-canadian_8.0.1.bb
@@ -0,0 +1,3 @@
+require gdb-common.inc
+require gdb-cross-canadian.inc
+require gdb-${PV}.inc
diff --git a/poky/meta/recipes-devtools/gdb/gdb-cross.inc b/poky/meta/recipes-devtools/gdb/gdb-cross.inc
new file mode 100644
index 000000000..ebe329f6d
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-cross.inc
@@ -0,0 +1,30 @@
+require gdb-common.inc
+
+DEPENDS = "expat-native ncurses-native flex-native bison-native"
+
+inherit python3native
+
+# Overrides PACKAGECONFIG variables in gdb-common.inc
+PACKAGECONFIG ??= "python readline"
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3-native"
+PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline-native"
+
+do_compile_prepend() {
+ export STAGING_LIBDIR="${STAGING_LIBDIR_NATIVE}"
+ export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}"
+}
+
+#EXTRA_OEMAKE += "LDFLAGS='${BUILD_LDFLAGS}'"
+
+GDBPROPREFIX = ""
+
+PN = "gdb-cross-${TARGET_ARCH}"
+BPN = "gdb"
+
+# Ignore how TARGET_ARCH is computed.
+TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}"
+
+inherit cross
+inherit gettext
+
+datadir .= "/gdb-${TARGET_SYS}${TARGET_VENDOR}-${TARGET_OS}"
diff --git a/poky/meta/recipes-devtools/gdb/gdb-cross_8.0.1.bb b/poky/meta/recipes-devtools/gdb/gdb-cross_8.0.1.bb
new file mode 100644
index 000000000..50cf159fd
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb-cross_8.0.1.bb
@@ -0,0 +1,2 @@
+require gdb-cross.inc
+require gdb-${PV}.inc
diff --git a/poky/meta/recipes-devtools/gdb/gdb.inc b/poky/meta/recipes-devtools/gdb/gdb.inc
new file mode 100644
index 000000000..52119a0aa
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb.inc
@@ -0,0 +1,10 @@
+require gdb-common.inc
+
+inherit gettext
+
+#LDFLAGS_append = " -s"
+#export CFLAGS_append=" -L${STAGING_LIBDIR}"
+
+# cross-canadian must not see this
+PACKAGES =+ "gdbserver"
+FILES_gdbserver = "${bindir}/gdbserver"
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch b/poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
new file mode 100644
index 000000000..4f06d46d7
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0001-include-sys-types.h-for-mode_t.patch
@@ -0,0 +1,30 @@
+From 91da0458b333249eb9c2f4c1f1e53fa4bc085cc9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Jan 2016 18:18:52 -0800
+Subject: [PATCH 01/10] include sys/types.h for mode_t
+
+mode_t is used in target.h, so we need to include sys/types.h to get the
+defintion
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/gdbserver/target.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
+index 3cc2bc4bab..e6b19b06b9 100644
+--- a/gdb/gdbserver/target.h
++++ b/gdb/gdbserver/target.h
+@@ -28,6 +28,7 @@
+ #include "target/waitstatus.h"
+ #include "mem-break.h"
+ #include "btrace-common.h"
++#include <sys/types.h>
+
+ struct emit_ops;
+ struct buffer;
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch b/poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch
new file mode 100644
index 000000000..83c4dded3
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch
@@ -0,0 +1,28 @@
+From 9ce61f97b7758794f06894e934fbb256ff62163e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:27:55 +0000
+Subject: [PATCH 02/10] make man install relative to DESTDIR
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sim/common/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
+index 3944956b5d..aa355e8347 100644
+--- a/sim/common/Makefile.in
++++ b/sim/common/Makefile.in
+@@ -35,7 +35,7 @@ tooldir = $(libdir)/$(target_alias)
+ datarootdir = @datarootdir@
+ datadir = @datadir@
+ mandir = @mandir@
+-man1dir = $(mandir)/man1
++man1dir = $(DESTDIR)$(mandir)/man1
+ infodir = @infodir@
+ includedir = @includedir@
+
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch b/poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
new file mode 100644
index 000000000..6f7955be1
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
@@ -0,0 +1,37 @@
+From ca0ef06b7320912df350e730e63f9bafdaa6ea70 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 23 Mar 2016 06:30:09 +0000
+Subject: [PATCH 03/10] mips-linux-nat: Define _ABIO32 if not defined
+
+This helps building gdb on mips64 on musl, since
+musl does not provide sgidefs.h this define is
+only defined when GCC is using o32 ABI, in that
+case gcc emits it as built-in define and hence
+it works ok for mips32
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/mips-linux-nat.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index 8041d84be7..f2df1b9907 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -47,6 +47,11 @@
+ #define PTRACE_GET_THREAD_AREA 25
+ #endif
+
++/* musl does not define and relies on compiler built-in macros for it */
++#ifndef _ABIO32
++#define _ABIO32 1
++#endif
++
+ /* Assume that we have PTRACE_GETREGS et al. support. If we do not,
+ we'll clear this and use PTRACE_PEEKUSER instead. */
+ static int have_ptrace_regsets = 1;
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch b/poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
new file mode 100644
index 000000000..357db25ec
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
@@ -0,0 +1,53 @@
+From 0f6d71118ca914002fcad78d2c8a518223d06bfb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 18:32:14 -0700
+Subject: [PATCH 04/10] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC
+ systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/gdbserver/linux-ppc-low.c | 6 ++++++
+ gdb/nat/ppc-linux.h | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 33a9feb12c..1a9141faef 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -21,7 +21,13 @@
+ #include "linux-low.h"
+
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+
+ #include "nat/ppc-linux.h"
+ #include "linux-ppc-tdesc.h"
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index 5837ea1767..7233929192 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef PPC_LINUX_H
+ #define PPC_LINUX_H 1
+
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+
+ /* This sometimes isn't defined. */
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch b/poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch
new file mode 100644
index 000000000..cb1b7abd0
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0005-Add-support-for-Renesas-SH-sh4-architecture.patch
@@ -0,0 +1,922 @@
+From 60ac68f601885ea6480229a5c8a89a0257da376c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:31:12 +0000
+Subject: [PATCH 05/10] Add support for Renesas SH (sh4) architecture.
+
+gdb (7.4-1~cvs20111117.2) experimental; urgency=low
+ .
+ * Add Renesas SH (sh4) support (Closes: #576242)
+ - Thanks Nobuhiro Iwamatsu, Takashi Yoshii.
+Author: Hector Oron <zumbi@debian.org>
+Bug-Debian: http://bugs.debian.org/576242
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/Makefile.in | 2 +
+ gdb/configure.host | 1 +
+ gdb/sh-linux-tdep.c | 519 +++++++++++++++++++++++++++++++++++
+ gdb/sh-tdep.c | 54 ++--
+ gdb/sh-tdep.h | 49 ++++
+ gdb/testsuite/gdb.asm/asm-source.exp | 5 +
+ gdb/testsuite/gdb.asm/sh.inc | 3 +-
+ gdb/testsuite/gdb.base/annota1.c | 3 +
+ gdb/testsuite/gdb.base/annota3.c | 4 +
+ gdb/testsuite/gdb.base/sigall.c | 3 +
+ gdb/testsuite/gdb.base/signals.c | 4 +
+ 11 files changed, 618 insertions(+), 29 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 8be73ba423..e287ff6a2e 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -2638,6 +2638,8 @@ ALLDEPFILES = \
+ sh-nbsd-tdep.c \
+ sh-tdep.c \
+ sh64-tdep.c \
++ sh-linux-tdep.c \
++ sh-linux-nat.c \
+ sol2-tdep.c \
+ solib-aix.c \
+ solib-spu.c \
+diff --git a/gdb/configure.host b/gdb/configure.host
+index d74fd04934..be12de1446 100644
+--- a/gdb/configure.host
++++ b/gdb/configure.host
+@@ -150,6 +150,7 @@ powerpc*-*-linux*) gdb_host=linux ;;
+
+ s390*-*-linux*) gdb_host=linux ;;
+
++sh*-*-linux*) gdb_host=linux ;;
+ sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu)
+ gdb_host=nbsd ;;
+ sh*-*-openbsd*) gdb_host=nbsd ;;
+diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c
+index c5c745d218..84e539aad3 100644
+--- a/gdb/sh-linux-tdep.c
++++ b/gdb/sh-linux-tdep.c
+@@ -18,14 +18,37 @@
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ #include "defs.h"
++#include "gdbcore.h"
++#include "frame.h"
++#include "frame-base.h"
++#include "frame-unwind.h"
++#include "dwarf2-frame.h"
++#include "value.h"
++#include "regcache.h"
++#include "inferior.h"
+ #include "osabi.h"
+
++#include "reggroups.h"
++#include "arch-utils.h"
++#include "floatformat.h"
+ #include "solib-svr4.h"
+ #include "symtab.h"
++#include "gdb_string.h"
++#include "command.h"
++#include "gdb_assert.h"
+
+ #include "trad-frame.h"
+ #include "tramp-frame.h"
+
++#include <sys/ptrace.h>
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/user.h>
++#include <sys/syscall.h>
++
++#include <asm/ptrace.h>
++
++#include "regset.h"
+ #include "glibc-tdep.h"
+ #include "sh-tdep.h"
+ #include "linux-tdep.h"
+@@ -180,9 +203,505 @@ static struct tramp_frame sh_linux_rt_sigreturn_tramp_frame = {
+ sh_linux_rt_sigreturn_init
+ };
+
++/* Recognizing signal handler frames. */
++
++/* GNU/Linux has two flavors of signals. Normal signal handlers, and
++ "realtime" (RT) signals. The RT signals can provide additional
++ information to the signal handler if the SA_SIGINFO flag is set
++ when establishing a signal handler using `sigaction'. It is not
++ unlikely that future versions of GNU/Linux will support SA_SIGINFO
++ for normal signals too. */
++
++/* When the SH Linux kernel calls a signal handler and the
++ SA_RESTORER flag isn't set, the return address points to a bit of
++ code on the stack. This function returns whether the PC appears to
++ be within this bit of code.
++
++ The instruction sequence for normal signals is
++ mov.w 1f,r3
++ trapa #16
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ 1: .word __NR_sigreturn
++ or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x0077.
++
++ Checking for the code sequence should be somewhat reliable, because
++ the effect is to call the system call sigreturn. This is unlikely
++ to occur anywhere other than a signal trampoline.
++
++ It kind of sucks that we have to read memory from the process in
++ order to identify a signal trampoline, but there doesn't seem to be
++ any other way. The PC_IN_SIGTRAMP macro in tm-linux.h arranges to
++ only call us if no function name could be identified, which should
++ be the case since the code is on the stack.
++
++ Detection of signal trampolines for handlers that set the
++ SA_RESTORER flag is in general not possible. Unfortunately this is
++ what the GNU C Library has been doing for quite some time now.
++ However, as of version 2.1.2, the GNU C Library uses signal
++ trampolines (named __restore and __restore_rt) that are identical
++ to the ones used by the kernel. Therefore, these trampolines are
++ supported too. */
++
++#define MOVW(n) (0x9300|((n)-2)) /* Move mem word at PC+n to R3 */
++#define TRAP16 0xc310 /* Syscall w/no args (NR in R3) */
++#define OR_R0_R0 0x200b /* or r0,r0 (insert to avoid hardware bug) */
++
++#define LINUX_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */
++#define LINUX_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */
++#define LINUX_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_sigtramp_code[] =
++{
++ LINUX_SIGTRAMP_INSN0,
++ LINUX_SIGTRAMP_INSN1,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ LINUX_SIGTRAMP_INSN2,
++ __NR_sigreturn
++};
++
++#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
++
++/* If PC is in a sigtramp routine, return the address of the start of
++ the routine. Otherwise, return 0. */
++
++static CORE_ADDR
++sh_linux_sigtramp_start (struct frame_info *next_frame)
++{
++ CORE_ADDR pc = get_frame_pc (next_frame);
++ gdb_byte buf[LINUX_SIGTRAMP_LEN];
++
++ /* We only recognize a signal trampoline if PC is at the start of
++ one of the three instructions. We optimize for finding the PC at
++ the start, as will be the case when the trampoline is not the
++ first frame on the stack. We assume that in the case where the
++ PC is not at the start of the instruction sequence, there will be
++ a few trailing readable bytes on the stack. */
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++ return 0;
++
++ if (buf[0] != LINUX_SIGTRAMP_INSN0)
++ {
++ if (buf[0] != LINUX_SIGTRAMP_INSN1)
++ return 0;
++
++ pc -= 2;
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++ return 0;
++ }
++
++ if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
++ return 0;
++
++ return pc;
++}
++
++/* This function does the same for RT signals. Here the instruction
++ sequence is
++ mov.w 1f,r3
++ trapa #16
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ or r0, r0
++ 1: .word __NR_rt_sigreturn
++ or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x00ad.
++
++ The effect is to call the system call rt_sigreturn. */
++
++#define LINUX_RT_SIGTRAMP_INSN0 MOVW(7) /* Move mem word at PC+7 to R3 */
++#define LINUX_RT_SIGTRAMP_INSN1 TRAP16 /* Syscall w/no args (NR in R3) */
++#define LINUX_RT_SIGTRAMP_INSN2 OR_R0_R0 /* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_rt_sigtramp_code[] =
++{
++ LINUX_RT_SIGTRAMP_INSN0,
++ LINUX_RT_SIGTRAMP_INSN1,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ LINUX_RT_SIGTRAMP_INSN2,
++ __NR_rt_sigreturn
++};
++
++#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
++
++/* If PC is in a RT sigtramp routine, return the address of the start
++ of the routine. Otherwise, return 0. */
++
++static CORE_ADDR
++sh_linux_rt_sigtramp_start (struct frame_info *next_frame)
++{
++ CORE_ADDR pc = get_frame_pc (next_frame);
++ gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
++
++ /* We only recognize a signal trampoline if PC is at the start of
++ one of the two instructions. We optimize for finding the PC at
++ the start, as will be the case when the trampoline is not the
++ first frame on the stack. We assume that in the case where the
++ PC is not at the start of the instruction sequence, there will be
++ a few trailing readable bytes on the stack. */
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
++ return 0;
++
++ if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
++ {
++ if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
++ return 0;
++
++ pc -= 2;
++
++ if (!safe_frame_unwind_memory (next_frame, pc, buf,
++ LINUX_RT_SIGTRAMP_LEN))
++ return 0;
++ }
++
++ if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
++ return 0;
++
++ return pc;
++}
++
++/* Return whether PC is in a GNU/Linux sigtramp routine. */
++
++static int
++sh_linux_sigtramp_p (struct frame_info *this_frame)
++{
++ CORE_ADDR pc = get_frame_pc (this_frame);
++ char *name;
++
++ find_pc_partial_function (pc, &name, NULL, NULL);
++
++ /* If we have NAME, we can optimize the search. The trampolines are
++ named __restore and __restore_rt. However, they aren't dynamically
++ exported from the shared C library, so the trampoline may appear to
++ be part of the preceding function. This should always be sigaction,
++ __sigaction, or __libc_sigaction (all aliases to the same function). */
++ if (name == NULL || strstr (name, "sigaction") != NULL)
++ return (sh_linux_sigtramp_start (this_frame) != 0
++ || sh_linux_rt_sigtramp_start (this_frame) != 0);
++
++ return (strcmp ("__restore", name) == 0
++ || strcmp ("__restore_rt", name) == 0);
++}
++
++/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
++#define SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 12
++
++
++/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
++ routine, return the address of the associated sigcontext structure. */
++
++static CORE_ADDR
++sh_linux_sigcontext_addr (struct frame_info *this_frame)
++{
++ CORE_ADDR pc;
++ CORE_ADDR sp;
++
++ sp = get_frame_register_unsigned (this_frame, SP_REGNUM);
++
++ pc = sh_linux_sigtramp_start (this_frame);
++ if (pc)
++ {
++ return sp;
++ }
++
++ pc = sh_linux_rt_sigtramp_start (this_frame);
++ if (pc)
++ {
++ CORE_ADDR ucontext_addr;
++
++ /* The sigcontext structure is part of the user context. A
++ pointer to the user context is passed as the third argument
++ to the signal handler. */
++ ucontext_addr = get_frame_register_unsigned (this_frame, ARG0_REGNUM+2);
++ return ucontext_addr + SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
++ }
++
++ error ("Couldn't recognize signal trampoline.");
++ return 0;
++}
++
++/* Signal trampolines. */
++extern struct sh_frame_cache *sh_alloc_frame_cache (void);
++
++static struct sh_frame_cache *
++sh_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
++{
++ struct sh_frame_cache *cache;
++ struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ());
++ CORE_ADDR sigcontext_addr;
++
++ if (*this_cache)
++ return *this_cache;
++
++ cache = sh_alloc_frame_cache ();
++
++ cache->base = get_frame_register_unsigned (this_frame, SP_REGNUM);
++ sigcontext_addr = tdep->sigcontext_addr (this_frame);
++ if (tdep->sc_reg_offset)
++ {
++ int i;
++
++ gdb_assert (tdep->sc_num_regs <= SH_NUM_REGS);
++
++ for (i = 0; i < tdep->sc_num_regs; i++)
++ if (tdep->sc_reg_offset[i] != -1)
++ cache->saved_regs[i] = sigcontext_addr + tdep->sc_reg_offset[i];
++ }
++
++ *this_cache = cache;
++ return cache;
++}
++
++static void
++sh_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
++ struct frame_id *this_id)
++{
++ struct sh_frame_cache *cache =
++ sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++ (*this_id) = frame_id_build (cache->base + 64, cache->pc);
++}
++
++extern struct value * sh_frame_prev_register ();
++static struct value *
++sh_linux_sigtramp_frame_prev_register (struct frame_info *this_frame,
++ void **this_cache, int regnum)
++{
++ sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++ return sh_frame_prev_register (this_frame, this_cache, regnum);
++}
++
++static int
++sh_linux_sigtramp_frame_sniffer (const struct frame_unwind *self,
++ struct frame_info *this_frame,
++ void **this_prologue_cache)
++{
++ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
++
++ /* We shouldn't even bother if we don't have a sigcontext_addr
++ handler. */
++ if (tdep->sigcontext_addr == NULL)
++ return 0;
++
++ if (tdep->sigtramp_p != NULL)
++ {
++ if (tdep->sigtramp_p (this_frame))
++ return 1;
++ }
++
++ return 0;
++}
++
++static const struct frame_unwind sh_linux_sigtramp_frame_unwind =
++{
++ SIGTRAMP_FRAME,
++ sh_linux_sigtramp_frame_this_id,
++ sh_linux_sigtramp_frame_prev_register,
++ NULL,
++ sh_linux_sigtramp_frame_sniffer
++};
++
++/* Supply register REGNUM from the buffer specified by GREGS and LEN
++ in the general-purpose register set REGSET to register cache
++ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
++
++void
++sh_supply_gregset (const struct regset *regset, struct regcache *regcache,
++ int regnum, const void *gregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ const char *regs = gregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_gregset);
++
++ for (i = 0; i < tdep->gregset_num_regs; i++)
++ {
++ if ((regnum == i || regnum == -1)
++ && tdep->gregset_reg_offset[i] != -1)
++ regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]);
++ }
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++ it in the buffer specified by GREGS and LEN as described by the
++ general-purpose register set REGSET. If REGNUM is -1, do this for
++ all registers in REGSET. */
++
++void
++sh_collect_gregset (const struct regset *regset,
++ const struct regcache *regcache,
++ int regnum, void *gregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ char *regs = gregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_gregset);
++
++ for (i = 0; i < tdep->gregset_num_regs; i++)
++ {
++ if ((regnum == i || regnum == -1)
++ && tdep->gregset_reg_offset[i] != -1)
++ regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]);
++ }
++}
++
++/* Supply register REGNUM from the buffer specified by FPREGS and LEN
++ in the floating-point register set REGSET to register cache
++ REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
++
++static void
++sh_supply_fpregset (const struct regset *regset, struct regcache *regcache,
++ int regnum, const void *fpregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ const char *regs = fpregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_fpregset);
++ for (i = 0; i < 16; i++)
++ {
++ if (regnum == i+25 || regnum == -1)
++ regcache_raw_supply (regcache, i+25, regs + i*4);
++ }
++ if (regnum == FPSCR_REGNUM || regnum == -1)
++ regcache_raw_supply (regcache, FPSCR_REGNUM, regs + 32*4);
++ if (regnum == FPUL_REGNUM || regnum == -1)
++ regcache_raw_supply (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++ it in the buffer specified by FPREGS and LEN as described by the
++ floating-point register set REGSET. If REGNUM is -1, do this for
++ all registers in REGSET. */
++
++static void
++sh_collect_fpregset (const struct regset *regset,
++ const struct regcache *regcache,
++ int regnum, void *fpregs, size_t len)
++{
++ const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++ char *regs = fpregs;
++ int i;
++
++ gdb_assert (len == tdep->sizeof_fpregset);
++ for (i = 0; i < 16; i++)
++ {
++ if (regnum == i+25 || regnum == -1)
++ regcache_raw_collect (regcache, i+25, regs + i*4);
++ }
++ if (regnum == FPSCR_REGNUM || regnum == -1)
++ regcache_raw_collect (regcache, FPSCR_REGNUM, regs + 32*4);
++ if (regnum == FPUL_REGNUM || regnum == -1)
++ regcache_raw_collect (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Return the appropriate register set for the core section identified
++ by SECT_NAME and SECT_SIZE. */
++
++const struct regset *
++sh_linux_regset_from_core_section (struct gdbarch *gdbarch,
++ const char *sect_name, size_t sect_size)
++{
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++
++ if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
++ {
++ if (tdep->gregset == NULL)
++ tdep->gregset = regset_alloc (gdbarch, sh_supply_gregset,
++ sh_collect_gregset);
++ return tdep->gregset;
++ }
++
++ if ((strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset))
++ {
++ if (tdep->fpregset == NULL)
++ tdep->fpregset = regset_alloc (gdbarch, sh_supply_fpregset,
++ sh_collect_fpregset);
++ return tdep->fpregset;
++ }
++
++ return NULL;
++}
++
++/* The register sets used in GNU/Linux ELF core-dumps are identical to
++ the register sets in `struct user' that are used for a.out
++ core-dumps. These are also used by ptrace(2). The corresponding
++ types are `elf_gregset_t' for the general-purpose registers (with
++ `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
++ for the floating-point registers.
++
++ Those types used to be available under the names `gregset_t' and
++ `fpregset_t' too, and GDB used those names in the past. But those
++ names are now used for the register sets used in the `mcontext_t'
++ type, which have a different size and layout. */
++
++/* Mapping between the general-purpose registers in `struct user'
++ format and GDB's register cache layout. */
++
++/* From <sys/reg.h>. */
++static int sh_linux_gregset_reg_offset[] =
++{
++ 0, 4, 8, 12, 16, 20, 24, 28,
++ 32, 36, 40, 44, 48, 52, 56, 60,
++
++ REG_PC*4, REG_PR*4, REG_GBR*4, -1,
++ REG_MACH*4, REG_MACL*4, REG_SR*4,
++};
++
++/* Mapping between the general-purpose registers in `struct
++ sigcontext' format and GDB's register cache layout. */
++
++/* From <asm/sigcontext.h>. */
++static int sh_linux_sc_reg_offset[] =
++{
++ 4, 8, 12, 16, 20, 24, 28, 32,
++ 36, 40, 44, 48, 52, 56, 60, 64,
++ 68, 72, 80, -1,
++ 84, 88, 76
++};
++
+ static void
+ sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+ {
++ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++ bfd abfd;
++
++ tdep->gregset_reg_offset = sh_linux_gregset_reg_offset;
++ tdep->gregset_num_regs = ARRAY_SIZE (sh_linux_gregset_reg_offset);
++ tdep->sizeof_gregset = 23 * 4;
++
++ tdep->jb_pc_offset = 32; /* From <bits/setjmp.h>. */
++
++ tdep->sigtramp_p = sh_linux_sigtramp_p;
++ tdep->sigcontext_addr = sh_linux_sigcontext_addr;
++ tdep->sc_reg_offset = sh_linux_sc_reg_offset;
++ tdep->sc_num_regs = ARRAY_SIZE (sh_linux_sc_reg_offset);
++
++ frame_unwind_append_unwinder(gdbarch, &sh_linux_sigtramp_frame_unwind);
++
++ /* If we have a register mapping, enable the generic core file
++ support, unless it has already been enabled. */
++ if (tdep->gregset_reg_offset
++ && !gdbarch_regset_from_core_section_p (gdbarch))
++ set_gdbarch_regset_from_core_section (gdbarch,
++ sh_linux_regset_from_core_section);
++
+ linux_init_abi (info, gdbarch);
+
+ /* GNU/Linux uses SVR4-style shared libraries. */
+diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
+index 2c2b26847d..14f5281ed4 100644
+--- a/gdb/sh-tdep.c
++++ b/gdb/sh-tdep.c
+@@ -21,6 +21,9 @@
+ sac@cygnus.com. */
+
+ #include "defs.h"
++#include "arch-utils.h"
++#include "command.h"
++#include "dummy-frame.h"
+ #include "frame.h"
+ #include "frame-base.h"
+ #include "frame-unwind.h"
+@@ -35,6 +38,7 @@
+ #include "arch-utils.h"
+ #include "floatformat.h"
+ #include "regcache.h"
++#include "regset.h"
+ #include "doublest.h"
+ #include "osabi.h"
+ #include "reggroups.h"
+@@ -68,23 +72,6 @@ static const char *const sh_cc_enum[] = {
+
+ static const char *sh_active_calling_convention = sh_cc_gcc;
+
+-#define SH_NUM_REGS 67
+-
+-struct sh_frame_cache
+-{
+- /* Base address. */
+- CORE_ADDR base;
+- LONGEST sp_offset;
+- CORE_ADDR pc;
+-
+- /* Flag showing that a frame has been created in the prologue code. */
+- int uses_fp;
+-
+- /* Saved registers. */
+- CORE_ADDR saved_regs[SH_NUM_REGS];
+- CORE_ADDR saved_sp;
+-};
+-
+ static int
+ sh_is_renesas_calling_convention (struct type *func_type)
+ {
+@@ -1052,7 +1039,7 @@ sh_treat_as_flt_p (struct type *type)
+ return 0;
+ /* Otherwise if the type of that member is float, the whole type is
+ treated as float. */
+- if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_FLT)
++ if (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0))) == TYPE_CODE_FLT)
+ return 1;
+ /* Otherwise it's not treated as float. */
+ return 0;
+@@ -1102,7 +1089,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
+ in four registers available. Loop thru args from first to last. */
+ for (argnum = 0; argnum < nargs; argnum++)
+ {
+- type = value_type (args[argnum]);
++ type = check_typedef (value_type (args[argnum]));
+ len = TYPE_LENGTH (type);
+ val = sh_justify_value_in_reg (gdbarch, args[argnum], len);
+
+@@ -1828,7 +1815,7 @@ sh_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+ reg->how = DWARF2_FRAME_REG_UNDEFINED;
+ }
+
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ sh_alloc_frame_cache (void)
+ {
+ struct sh_frame_cache *cache;
+@@ -1855,7 +1842,7 @@ sh_alloc_frame_cache (void)
+ return cache;
+ }
+
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+@@ -1922,9 +1909,9 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
+ return cache;
+ }
+
+-static struct value *
+-sh_frame_prev_register (struct frame_info *this_frame,
+- void **this_cache, int regnum)
++struct value *
++sh_frame_prev_register (struct frame_info *this_frame, void **this_cache,
++ int regnum)
+ {
+ struct gdbarch *gdbarch = get_frame_arch (this_frame);
+ struct sh_frame_cache *cache = sh_frame_cache (this_frame, this_cache);
+@@ -1938,7 +1925,7 @@ sh_frame_prev_register (struct frame_info *this_frame,
+ the current frame. Frob regnum so that we pull the value from
+ the correct place. */
+ if (regnum == gdbarch_pc_regnum (gdbarch))
+- regnum = PR_REGNUM;
++ regnum = PR_REGNUM; /* XXX: really? */
+
+ if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1)
+ return frame_unwind_got_memory (this_frame, regnum,
+@@ -2247,8 +2234,8 @@ sh_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+ static struct gdbarch *
+ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ {
+- struct gdbarch *gdbarch;
+ struct gdbarch_tdep *tdep;
++ struct gdbarch *gdbarch;
+
+ /* SH5 is handled entirely in sh64-tdep.c. */
+ if (info.bfd_arch_info->mach == bfd_mach_sh5)
+@@ -2264,6 +2251,18 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ tdep = XCNEW (struct gdbarch_tdep);
+ gdbarch = gdbarch_alloc (&info, tdep);
+
++ /* General-purpose registers. */
++ tdep->gregset = NULL;
++ tdep->gregset_reg_offset = NULL;
++ tdep->gregset_num_regs = 23;
++ tdep->sizeof_gregset = 0;
++
++ /* Floating-point registers. */
++ tdep->fpregset = NULL;
++ tdep->sizeof_fpregset = 34*4;
++
++ tdep->jb_pc_offset = -1;
++
+ set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+ set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+ set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+@@ -2418,10 +2417,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ break;
+ }
+
++ dwarf2_append_unwinders (gdbarch);
++
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch);
+
+- dwarf2_append_unwinders (gdbarch);
+ frame_unwind_append_unwinder (gdbarch, &sh_stub_unwind);
+ frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind);
+
+diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
+index d15ef050e0..c4642cefa4 100644
+--- a/gdb/sh-tdep.h
++++ b/gdb/sh-tdep.h
+@@ -21,6 +21,12 @@
+
+ /* Contributed by Steve Chamberlain sac@cygnus.com. */
+
++struct frame_info;
++struct gdbarch;
++struct reggroup;
++struct regset;
++struct regcache;
++
+ /* Registers for all SH variants. Used also by sh3-rom.c. */
+ enum
+ {
+@@ -29,6 +35,7 @@ enum
+ ARG0_REGNUM = 4,
+ ARGLAST_REGNUM = 7,
+ FP_REGNUM = 14,
++ SP_REGNUM = 15,
+ PC_REGNUM = 16,
+ PR_REGNUM = 17,
+ GBR_REGNUM = 18,
+@@ -81,6 +88,24 @@ enum
+ FV0_REGNUM = 76,
+ FV_LAST_REGNUM = 79
+ };
++#define SH_NUM_REGS 67
++
++struct sh_frame_cache
++{
++ /* Base address. */
++ CORE_ADDR base;
++ LONGEST sp_offset;
++ CORE_ADDR pc;
++
++ /* Flag showing that a frame has been created in the prologue code. */
++ int uses_fp;
++
++ /* Saved registers. */
++ CORE_ADDR saved_regs[SH_NUM_REGS];
++ CORE_ADDR saved_sp;
++};
++
++extern struct sh_frame_cache *sh_frame_cache (struct frame_info *next_frame, void **this_cache);
+
+ /* This structure describes a register in a core-file. */
+ struct sh_corefile_regmap
+@@ -89,8 +114,32 @@ struct sh_corefile_regmap
+ unsigned int offset;
+ };
+
++/* sh architecture specific information. */
+ struct gdbarch_tdep
+ {
++ /* General-purpose registers. */
++ struct regset *gregset;
++ int *gregset_reg_offset;
++ int gregset_num_regs;
++ size_t sizeof_gregset;
++
++ /* Floating-point registers. */
++ struct regset *fpregset;
++ size_t sizeof_fpregset;
++
++ /* Offset of saved PC in jmp_buf. */
++ int jb_pc_offset;
++
++ /* Detect sigtramp. */
++ int (*sigtramp_p) (struct frame_info *);
++
++ /* Get address of sigcontext for sigtramp. */
++ CORE_ADDR (*sigcontext_addr) (struct frame_info *);
++
++ /* Offset of registers in `struct sigcontext'. */
++ int *sc_reg_offset;
++ int sc_num_regs;
++
+ /* Non-NULL when debugging from a core file. Provides the offset
+ where each general-purpose register is stored inside the associated
+ core file section. */
+diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
+index e07e5543f2..f5e60e1002 100644
+--- a/gdb/testsuite/gdb.asm/asm-source.exp
++++ b/gdb/testsuite/gdb.asm/asm-source.exp
+@@ -116,6 +116,11 @@ switch -glob -- [istarget] {
+ append link-flags " -m elf32ppc"
+ }
+ }
++ "sh*-linux*" {
++ set asm-arch sh-linux
++ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
++ set debug-flags "-gdwarf-2"
++ }
+ "sh*-*-*" {
+ set asm-arch sh
+ set debug-flags "-gdwarf-2"
+diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc
+index a4a5fc545e..89efed7795 100644
+--- a/gdb/testsuite/gdb.asm/sh.inc
++++ b/gdb/testsuite/gdb.asm/sh.inc
+@@ -40,9 +40,8 @@
+ mov.l .Lconst\@,r1
+ bra .Lafterconst\@
+ nop
+- nop
+-.Lconst\@:
+ .align 2
++.Lconst\@:
+ .long \subr
+ .align 1
+ .Lafterconst\@:
+diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
+index 424e1b8327..0de2e7b633 100644
+--- a/gdb/testsuite/gdb.base/annota1.c
++++ b/gdb/testsuite/gdb.base/annota1.c
+@@ -1,6 +1,9 @@
+ #include <stdio.h>
+ #include <signal.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
+
+ void
+ handle_USR1 (int sig)
+diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c
+index 424e1b8327..952aaf218a 100644
+--- a/gdb/testsuite/gdb.base/annota3.c
++++ b/gdb/testsuite/gdb.base/annota3.c
+@@ -1,6 +1,10 @@
+ #include <stdio.h>
+ #include <signal.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
++
+
+ void
+ handle_USR1 (int sig)
+diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
+index 81f3b08d6b..1574b2d6cb 100644
+--- a/gdb/testsuite/gdb.base/sigall.c
++++ b/gdb/testsuite/gdb.base/sigall.c
+@@ -1,6 +1,9 @@
+ #include <signal.h>
+ #include <unistd.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#endif
+
+ /* Signal handlers, we set breakpoints in them to make sure that the
+ signals really get delivered. */
+diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
+index 756606880f..1205a9bc9c 100644
+--- a/gdb/testsuite/gdb.base/signals.c
++++ b/gdb/testsuite/gdb.base/signals.c
+@@ -3,6 +3,10 @@
+ #include <signal.h>
+ #include <unistd.h>
+
++#ifdef __sh__
++#define signal(a,b) /* Signals not supported on this target - make them go away */
++#define alarm(a) /* Ditto for alarm() */
++#endif
+
+ static int count = 0;
+
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch b/poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch
new file mode 100644
index 000000000..8b1395810
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch
@@ -0,0 +1,50 @@
+From 5c92ebd5e117e4cf118c984171e0703dfcfb8cd8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 15:25:03 -0700
+Subject: [PATCH 06/10] Dont disable libreadline.a when using --disable-static
+
+If gdb is configured with --disable-static then this is dutifully passed to
+readline which then disables libreadline.a, which causes a problem when gdb
+tries to link against that.
+
+To ensure that readline always builds static libraries, pass --enable-static to
+the sub-configure.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.def | 3 ++-
+ Makefile.in | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.def b/Makefile.def
+index 0d13f037d0..8bcd86e13f 100644
+--- a/Makefile.def
++++ b/Makefile.def
+@@ -105,7 +105,8 @@ host_modules= { module= libiconv;
+ missing= install-html;
+ missing= install-info; };
+ host_modules= { module= m4; };
+-host_modules= { module= readline; };
++host_modules= { module= readline;
++ extra_configure_flags='--enable-static';};
+ host_modules= { module= sid; };
+ host_modules= { module= sim; };
+ host_modules= { module= texinfo; no_install= true; };
+diff --git a/Makefile.in b/Makefile.in
+index 3acb83b8de..e348907128 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -25470,7 +25470,7 @@ configure-readline:
+ $$s/$$module_srcdir/configure \
+ --srcdir=$${topdir}/$$module_srcdir \
+ $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+- --target=${target_alias} \
++ --target=${target_alias} --enable-static \
+ || exit 1
+ @endif readline
+
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch b/poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch
new file mode 100644
index 000000000..33b4c30ee
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0007-use-asm-sgidefs.h.patch
@@ -0,0 +1,36 @@
+From 12a0b8d81e1fda6ba98abdce8d6f09f9555ebcf5 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <amccurdy@gmail.com>
+Date: Sat, 30 Apr 2016 15:29:06 -0700
+Subject: [PATCH 07/10] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> which provides the same definitions, so use that
+instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/mips-linux-nat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index f2df1b9907..d24664cb56 100644
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch b/poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch
new file mode 100644
index 000000000..4f64dea25
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch
@@ -0,0 +1,50 @@
+From d3f240b38eed7cd08f6c50ea896572f1327b437a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 15:31:40 -0700
+Subject: [PATCH 08/10] Use exorted definitions of SIGRTMIN
+
+Define W_STOPCODE if not defined already
+
+__SIGRTMIN is internal to glibc and other libcs e.g. musl
+may not provide them
+
+Fixes
+https://sourceware.org/bugzilla/show_bug.cgi?id=13012
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/linux-nat.c | 4 ++--
+ gdb/nat/linux-nat.h | 4 ++++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
+index 8b29245c3d..f424ae9711 100644
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -5021,6 +5021,6 @@ lin_thread_get_thread_signals (sigset_t *set)
+ /* NPTL reserves the first two RT signals, but does not provide any
+ way for the debugger to query the signal numbers - fortunately
+ they don't change. */
+- sigaddset (set, __SIGRTMIN);
+- sigaddset (set, __SIGRTMIN + 1);
++ sigaddset (set, SIGRTMIN);
++ sigaddset (set, SIGRTMIN + 1);
+ }
+diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h
+index 7dd18fefff..35137ab34f 100644
+--- a/gdb/nat/linux-nat.h
++++ b/gdb/nat/linux-nat.h
+@@ -90,4 +90,8 @@ extern void linux_stop_lwp (struct lwp_info *lwp);
+
+ extern int lwp_is_stepping (struct lwp_info *lwp);
+
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
+ #endif /* LINUX_NAT_H */
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch b/poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch
new file mode 100644
index 000000000..0c103ef3f
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch
@@ -0,0 +1,30 @@
+From 3f54036b891054072b3e43ea8daaa57aa367b2e0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 15:35:39 -0700
+Subject: [PATCH 09/10] Change order of CFLAGS
+
+Lets us override Werror if need be
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/gdbserver/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
+index 01dfdc0b89..f6aebef464 100644
+--- a/gdb/gdbserver/Makefile.in
++++ b/gdb/gdbserver/Makefile.in
+@@ -140,7 +140,7 @@ CPPFLAGS = @CPPFLAGS@
+ INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
+ ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
+ INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
+-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
++INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${COMPILER_CFLAGS} -DGDBSERVER
+
+ # LDFLAGS is specifically reserved for setting from the command line
+ # when running make.
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch b/poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch
new file mode 100644
index 000000000..c9507109b
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch
@@ -0,0 +1,48 @@
+From 3ead0dd143521b0ba69c9e753bc4a236f9445ad9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 10 May 2016 08:47:05 -0700
+Subject: [PATCH 10/10] resolve restrict keyword conflict
+
+GCC detects that we call 'restrict' as param name in function
+signatures and complains since both params are called 'restrict'
+therefore we use __restrict to denote the C99 keywork
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/gnulib/import/sys_time.in.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gdb/gnulib/import/sys_time.in.h b/gdb/gnulib/import/sys_time.in.h
+index d535a6a48b..7c34d5a1aa 100644
+--- a/gdb/gnulib/import/sys_time.in.h
++++ b/gdb/gnulib/import/sys_time.in.h
+@@ -93,20 +93,20 @@ struct timeval
+ # define gettimeofday rpl_gettimeofday
+ # endif
+ _GL_FUNCDECL_RPL (gettimeofday, int,
+- (struct timeval *restrict, void *restrict)
++ (struct timeval *__restrict, void *__restrict)
+ _GL_ARG_NONNULL ((1)));
+ _GL_CXXALIAS_RPL (gettimeofday, int,
+- (struct timeval *restrict, void *restrict));
++ (struct timeval *__restrict, void *__restrict));
+ # else
+ # if !@HAVE_GETTIMEOFDAY@
+ _GL_FUNCDECL_SYS (gettimeofday, int,
+- (struct timeval *restrict, void *restrict)
++ (struct timeval *__restrict, void *__restrict)
+ _GL_ARG_NONNULL ((1)));
+ # endif
+ /* Need to cast, because on glibc systems, by default, the second argument is
+ struct timezone *. */
+ _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+- (struct timeval *restrict, void *restrict));
++ (struct timeval *__restrict, void *__restrict));
+ # endif
+ _GL_CXXALIASWARN (gettimeofday);
+ # if defined __cplusplus && defined GNULIB_NAMESPACE
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/0012-Unbreak-GDBserver-build-for-x32.patch b/poky/meta/recipes-devtools/gdb/gdb/0012-Unbreak-GDBserver-build-for-x32.patch
new file mode 100644
index 000000000..18a3ce3d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/0012-Unbreak-GDBserver-build-for-x32.patch
@@ -0,0 +1,101 @@
+From 3e1e401053ea5f02a9e9c65abddd31a03baa1bd1 Mon Sep 17 00:00:00 2001
+From: Yao Qi <yao.qi@linaro.org>
+Date: Fri, 29 Dec 2017 12:57:25 +0800
+Subject: [PATCH] Unbreak GDBserver build for x32
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When I verify my target description changes, I build GDB and GDBserver for
+x32, but it failed.
+
+/../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c
+../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c: In function ‘const target_desc* get_ipa_tdesc(int)’:
+../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:184:10: error: ‘X86_TDESC_AVX512’ was not declared in this scope
+ case X86_TDESC_AVX512:
+ ^
+../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:185:14: error: ‘tdesc_x32_avx512_linux’ was not declared in this scope
+ return tdesc_x32_avx512_linux;
+ ^
+../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c: In function ‘void initialize_low_tracepoint()’:
+../../../binutils-gdb/gdb/gdbserver/linux-amd64-ipa.c:282:36: error: ‘init_registers_x32_avx512_linux’ was not declared in this scope
+ init_registers_x32_avx512_linux ();
+ ^
+
+ipa_x32_linux_regobj use to be there, but removed by
+22049425ce40324139be82d9a6ec518c46b65815 by mistake.
+
+gdb/gdbserver:
+
+2017-08-04 Yao Qi <yao.qi@linaro.org>
+
+ * configure.srv (ipa_x32_linux_regobj): New.
+ * linux-amd64-ipa.c (get_ipa_tdesc): Use X86_TDESC_AVX_AVX512
+ instead of X86_TDESC_AVX512.
+ (initialize_low_tracepoint): Call
+ init_registers_x32_avx_avx512_linux.
+
+Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=f02fd7745d003d65fd3b981618e07b874b721d79]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ ChangeLog | 8 ++++++++
+ gdb/gdbserver/configure.srv | 1 +
+ gdb/gdbserver/linux-amd64-ipa.c | 6 +++---
+ 3 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 4ac2d63..b5b8228 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,11 @@
++ 2017-08-04 Yao Qi <yao.qi@linaro.org>
++
++ * configure.srv (ipa_x32_linux_regobj): New.
++ * linux-amd64-ipa.c (get_ipa_tdesc): Use X86_TDESC_AVX_AVX512
++ instead of X86_TDESC_AVX512.
++ (initialize_low_tracepoint): Call
++ init_registers_x32_avx_avx512_linux.
++
+ 2017-04-13 Andrew Jenner <andrew@codesourcery.com>
+
+ * config.sub: Sync with master version in config project.
+diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
+index d00d9e2..56951c8 100644
+--- a/gdb/gdbserver/configure.srv
++++ b/gdb/gdbserver/configure.srv
+@@ -31,6 +31,7 @@ srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o amd64-avx-avx512-linux.o
+
+ ipa_i386_linux_regobj="i386-linux-ipa.o i386-avx-linux-ipa.o i386-avx-mpx-linux-ipa.o i386-avx-avx512-linux-ipa.o i386-avx-mpx-avx512-pku-linux-ipa.o i386-mpx-linux-ipa.o i386-mmx-linux-ipa.o"
+ ipa_amd64_linux_regobj="amd64-linux-ipa.o amd64-avx-linux-ipa.o amd64-avx-mpx-linux-ipa.o amd64-avx-avx512-linux-ipa.o amd64-avx-mpx-avx512-pku-linux-ipa.o amd64-mpx-linux-ipa.o"
++ipa_x32_linux_regobj="x32-linux-ipa.o x32-avx-linux-ipa.o x32-avx-avx512-linux-ipa.o"
+ ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-cell32l-ipa.o powerpc-vsx32l-ipa.o powerpc-isa205-32l-ipa.o powerpc-isa205-altivec32l-ipa.o powerpc-isa205-vsx32l-ipa.o powerpc-e500l-ipa.o powerpc-64l-ipa.o powerpc-altivec64l-ipa.o powerpc-cell64l-ipa.o powerpc-vsx64l-ipa.o powerpc-isa205-64l-ipa.o powerpc-isa205-altivec64l-ipa.o powerpc-isa205-vsx64l-ipa.o"
+
+ srv_i386_32bit_xmlfiles="i386/32bit-core.xml i386/32bit-sse.xml i386/32bit-avx.xml i386/32bit-avx512.xml i386/32bit-mpx.xml i386/32bit-pkeys.xml"
+diff --git a/gdb/gdbserver/linux-amd64-ipa.c b/gdb/gdbserver/linux-amd64-ipa.c
+index 67f36c2..683339b 100644
+--- a/gdb/gdbserver/linux-amd64-ipa.c
++++ b/gdb/gdbserver/linux-amd64-ipa.c
+@@ -181,8 +181,8 @@ get_ipa_tdesc (int idx)
+ return tdesc_x32_linux;
+ case X86_TDESC_AVX:
+ return tdesc_x32_avx_linux;
+- case X86_TDESC_AVX512:
+- return tdesc_x32_avx512_linux;
++ case X86_TDESC_AVX_AVX512:
++ return tdesc_x32_avx_avx512_linux;
+ default:
+ break;
+ }
+@@ -279,7 +279,7 @@ initialize_low_tracepoint (void)
+ #if defined __ILP32__
+ init_registers_x32_linux ();
+ init_registers_x32_avx_linux ();
+- init_registers_x32_avx512_linux ();
++ init_registers_x32_avx_avx512_linux ();
+ #else
+ init_registers_amd64_linux ();
+ init_registers_amd64_avx_linux ();
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch b/poky/meta/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch
new file mode 100644
index 000000000..ef97de777
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch
@@ -0,0 +1,56 @@
+From b033a9663053eed87cb572397176747b88e9a699 Mon Sep 17 00:00:00 2001
+From: James Clarke <jrtc27@jrtc27.com>
+Date: Fri, 19 Jan 2018 17:22:49 +0000
+Subject: [PATCH] gdb: Fix ia64 defining TRAP_HWBKPT before including
+ gdb_wait.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
+contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
+define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
+earlier; include it from linux-ptrace.h so it can never come afterwards.
+
+gdb/ChangeLog:
+
+ * nat/linux-ptrace.c: Remove unnecessary reinclusion of
+ gdb_ptrace.h, and move including gdb_wait.h ...
+ * nat/linux-ptrace.h: ... to here.
+
+Upstream-Status: Accepted [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8]
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+---
+ gdb/nat/linux-ptrace.c | 2 --
+ gdb/nat/linux-ptrace.h | 1 +
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
+index 3265b16..559c2de 100644
+--- a/gdb/nat/linux-ptrace.c
++++ b/gdb/nat/linux-ptrace.c
+@@ -21,8 +21,6 @@
+ #include "linux-procfs.h"
+ #include "linux-waitpid.h"
+ #include "buffer.h"
+-#include "gdb_wait.h"
+-#include "gdb_ptrace.h"
+ #ifdef HAVE_SYS_PROCFS_H
+ #include <sys/procfs.h>
+ #endif
+diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
+index 5954945..6faa89b 100644
+--- a/gdb/nat/linux-ptrace.h
++++ b/gdb/nat/linux-ptrace.h
+@@ -21,6 +21,7 @@
+ struct buffer;
+
+ #include "nat/gdb_ptrace.h"
++#include "gdb_wait.h"
+
+ #ifdef __UCLIBC__
+ #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch b/poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch
new file mode 100644
index 000000000..c5484f789
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch
@@ -0,0 +1,45 @@
+From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Fri, 24 Mar 2017 10:36:03 +0800
+Subject: [PATCH] Fix invalid sigprocmask call
+
+The POSIX document says
+
+ The pthread_sigmask() and sigprocmask() functions shall fail if:
+
+ [EINVAL]
+ The value of the how argument is not equal to one of the defined values.
+
+and this is how musl-libc is currently doing. Fix the call to be safe
+and correct
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
+
+gdb/ChangeLog:
+2017-03-24 Yousong Zhou <yszhou4tech@gmail.com>
+
+ * common/signals-state-save-restore.c (save_original_signals_state):
+ Fix invalid sigprocmask call.
+---
+Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ gdb/ChangeLog | 5 +++++
+ gdb/common/signals-state-save-restore.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c
+index d11a9ae..734335c 100644
+--- a/gdb/common/signals-state-save-restore.c
++++ b/gdb/common/signals-state-save-restore.c
+@@ -41,7 +41,7 @@ save_original_signals_state (void)
+ int i;
+ int res;
+
+- res = sigprocmask (0, NULL, &original_signal_mask);
++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask);
+ if (res == -1)
+ perror_with_name (("sigprocmask"));
+
+--
+2.6.4
+
diff --git a/poky/meta/recipes-devtools/gdb/gdb_8.0.1.bb b/poky/meta/recipes-devtools/gdb/gdb_8.0.1.bb
new file mode 100644
index 000000000..ea8fef122
--- /dev/null
+++ b/poky/meta/recipes-devtools/gdb/gdb_8.0.1.bb
@@ -0,0 +1,27 @@
+require gdb.inc
+require gdb-${PV}.inc
+
+inherit python3-dir
+
+EXTRA_OEMAKE_append_libc-musl = "\
+ gt_cv_func_gnugettext1_libc=yes \
+ gt_cv_func_gnugettext2_libc=yes \
+ gl_cv_func_gettimeofday_clobber=no \
+ "
+
+do_configure_prepend() {
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
+ cat > ${WORKDIR}/python << EOF
+#!/bin/sh
+case "\$2" in
+ --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
+ --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
+ --exec-prefix) echo "${exec_prefix}" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+ fi
+}
+CFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday"
diff --git a/poky/meta/recipes-devtools/git/git.inc b/poky/meta/recipes-devtools/git/git.inc
new file mode 100644
index 000000000..dd9d792c5
--- /dev/null
+++ b/poky/meta/recipes-devtools/git/git.inc
@@ -0,0 +1,145 @@
+SUMMARY = "Distributed version control system"
+HOMEPAGE = "http://git-scm.com"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+DEPENDS = "openssl curl zlib expat"
+
+PROVIDES_append_class-native = " git-replacement-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
+ ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
+
+S = "${WORKDIR}/git-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cvsserver] = ""
+PACKAGECONFIG[svn] = ""
+
+EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
+ --without-tcltk \
+"
+
+# Needs brokensep as this doesn't use automake
+inherit autotools-brokensep perlnative bash-completion
+
+EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
+EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
+
+do_compile_prepend () {
+ # Remove perl/perl.mak to fix the out-of-date perl.mak error
+ # during rebuild
+ rm -f perl/perl.mak
+}
+
+do_install () {
+ oe_runmake install DESTDIR="${D}" bindir=${bindir} \
+ template_dir=${datadir}/git-core/templates
+ install -d ${D}/${mandir}/man1
+ install -d ${D}/${mandir}/man5
+ install -d ${D}/${mandir}/man7
+ install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
+ install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
+ install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
+ install -d ${D}/${datadir}/bash-completion/completions/
+ install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
+}
+
+perl_native_fixup () {
+ sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
+ -e 's#${libdir}/perl-native/#${libdir}/#' \
+ ${@d.getVar("PERLTOOLS").replace(' /',d.getVar('D') + '/')}
+
+ # ${libdir} is not applicable here, perl-native files are always
+ # installed to /usr/lib on both 32/64 bits targets.
+
+ mkdir -p ${D}${libdir}
+ mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
+ rmdir -p ${D}${exec_prefix}/lib/perl-native || true
+
+ if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'cvsserver', d)}" ]; then
+ # Only install the git cvsserver command if explicitly requested
+ # as it requires the DBI Perl module, which does not exist in
+ # OE-Core.
+ rm ${D}${libexecdir}/git-core/git-cvsserver \
+ ${D}${bindir}/git-cvsserver
+ fi
+
+ if [ ! "${@bb.utils.filter('PACKAGECONFIG', 'svn', d)}" ]; then
+ # Only install the git svn command and all Git::SVN Perl modules
+ # if explicitly requested as they require the SVN::Core Perl
+ # module, which does not exist in OE-Core.
+ rm -r ${D}${libexecdir}/git-core/git-svn \
+ ${D}${libdir}/perl/site_perl/*/Git/SVN*
+ sed -i -e '/SVN/d' ${D}${libdir}/perl/site_perl/*/auto/Git/.packlist
+ fi
+}
+
+REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
+REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
+
+do_install_append_class-target () {
+ perl_native_fixup
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/git \
+ GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+ GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+}
+
+do_install_append_class-nativesdk() {
+ create_wrapper ${D}${bindir}/git \
+ GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+ GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+ perl_native_fixup
+}
+
+FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
+
+PERLTOOLS = " \
+ ${libexecdir}/git-core/git-add--interactive \
+ ${libexecdir}/git-core/git-archimport \
+ ${libexecdir}/git-core/git-cvsexportcommit \
+ ${libexecdir}/git-core/git-cvsimport \
+ ${libexecdir}/git-core/git-cvsserver \
+ ${bindir}/git-cvsserver \
+ ${libexecdir}/git-core/git-difftool \
+ ${libexecdir}/git-core/git-send-email \
+ ${libexecdir}/git-core/git-svn \
+ ${libexecdir}/git-core/git-instaweb \
+ ${libexecdir}/git-core/git-submodule \
+ ${libexecdir}/git-core/git-am \
+ ${libexecdir}/git-core/git-request-pull \
+ ${datadir}/gitweb/gitweb.cgi \
+ ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
+ ${datadir}/git-core/templates/hooks/pre-rebase.sample \
+ ${datadir}/git-core/templates/hooks/fsmonitor-watchman.sample \
+"
+
+# Git tools requiring perl
+PACKAGES =+ "${PN}-perltools"
+FILES_${PN}-perltools += " \
+ ${PERLTOOLS} \
+ ${libdir}/perl \
+ ${datadir}/perl \
+"
+
+RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
+
+# git-tk package with gitk and git-gui
+PACKAGES =+ "${PN}-tk"
+#RDEPENDS_${PN}-tk = "${PN} tk tcl"
+#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
+FILES_${PN}-tk = " \
+ ${bindir}/gitk \
+ ${datadir}/gitk \
+"
+
+PACKAGES =+ "gitweb"
+FILES_gitweb = "${datadir}/gitweb/"
+RDEPENDS_gitweb = "perl"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/git/git_2.16.1.bb b/poky/meta/recipes-devtools/git/git_2.16.1.bb
new file mode 100644
index 000000000..9dc4eba88
--- /dev/null
+++ b/poky/meta/recipes-devtools/git/git_2.16.1.bb
@@ -0,0 +1,11 @@
+require git.inc
+
+EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
+ ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
+ "
+EXTRA_OEMAKE += "NO_GETTEXT=1"
+
+SRC_URI[tarball.md5sum] = "37467da8e79e72f28598d667f219f75e"
+SRC_URI[tarball.sha256sum] = "56cfa48af2b289bba172ca0a47c29f0083f5846cf4759978b70988e4f07fc9fd"
+SRC_URI[manpages.md5sum] = "5587407f3c28446af12fde3f3131ba34"
+SRC_URI[manpages.sha256sum] = "d499e825f429d76862be415f579c20cc26b046573a3a39237acaf9682cb71be7"
diff --git a/poky/meta/recipes-devtools/glide/glide_0.13.1.bb b/poky/meta/recipes-devtools/glide/glide_0.13.1.bb
new file mode 100644
index 000000000..1a5b145cf
--- /dev/null
+++ b/poky/meta/recipes-devtools/glide/glide_0.13.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Vendor Package Management for Golang"
+HOMEPAGE = "https://glide.sh"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=54905cf894f8cc416a92f4fc350c35b2"
+
+GO_IMPORT = "github.com/Masterminds/glide"
+SRC_URI = "git://${GO_IMPORT}"
+SRCREV = "67790b3dbede72cfdc54aa53be4706322c9499e0"
+
+inherit go
+
+RDEPENDS_${PN}-dev += "bash"
+RDEPENDS_${PN}-ptest += "bash"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
new file mode 100755
index 000000000..d4908fc4f
--- /dev/null
+++ b/poky/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
@@ -0,0 +1,267 @@
+#! /usr/bin/env perl
+# -*- perl -*-
+
+eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
+ if 0;
+
+# gnu-configize - install the GNU config.guess / config.sub in a directory tree
+# Based on autoreconf:
+# Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+BEGIN
+{
+ my $datadir = $ENV{'autom4te_perllibdir'} || '@autom4te_perllibdir@';
+# '/home/kergoth/code/build-arm/tmp/staging/share/autoconf';
+ unshift @INC, $datadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+ # that can handle redirection and quote arguments correctly,
+ # e.g.: COMMAND.COM. For DJGPP always use the shell that configure
+ # has detected.
+ $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
+}
+
+use Autom4te::ChannelDefs;
+use Autom4te::Channels;
+use Autom4te::Configure_ac;
+use Autom4te::FileUtils;
+use Autom4te::General;
+use Autom4te::XFile;
+# Do not use Cwd::chdir, since it might hang.
+use Cwd 'cwd';
+use strict;
+
+## ----------- ##
+## Variables. ##
+## ----------- ##
+
+# $HELP
+# -----
+$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ...
+
+Install the GNU config.sub and config.guess scripts in the
+DIRECTORIES or the directory trees driven by CONFIGURE-AC
+(defaulting to `.').
+
+Operation modes:
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -v, --verbose verbosely report processing
+ -f, --force consider all files obsolete
+ -s, --symlink install symbolic links instead of copies
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax]
+
+" . Autom4te::ChannelDefs::usage . "
+
+The environment variable \`WARNINGS\' is honored. Some subtools might
+support other warning types, using \`all' is encouraged.
+";
+
+# $VERSION
+# --------
+$version = "gnu-configize 1.0
+
+Copyright (C) 2004 Chris Larson
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+";
+
+my $configdir = '@gnu-configdir@';
+#'/home/kergoth/code/build-arm/tmp/staging/i686-linux/share/gnu-config';
+my $autoconf = $ENV{'AUTOCONF'} || 'autoconf';
+
+# use symlinks instead.
+my $symlink = 0;
+
+my $configure_ac;
+
+my $rm = "rm -f";
+my $ln_s = "ln -sf";
+my $cp = "cp -f";
+my $mkdir = "mkdir";
+my $chmod = "chmod";
+
+## ---------- ##
+## Routines. ##
+## ---------- ##
+
+
+# parse_args ()
+# -------------
+# Process any command line arguments.
+sub parse_args ()
+{
+ my $srcdir;
+
+ getopt ('s|symlink' => \$symlink);
+
+ # Even if the user specified a configure.ac, trim to get the
+ # directory, and look for configure.ac again. Because (i) the code
+ # is simpler, and (ii) we are still able to diagnose simultaneous
+ # presence of configure.ac and configure.in.
+ @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
+ push @ARGV, '.' unless @ARGV;
+}
+
+
+# &gnu_configize_current_directory
+# -----------------------------
+sub gnu_configize_current_directory ()
+{
+ my $configure_ac = require_configure_ac;
+
+ # ---------------------- #
+ # Is it using Autoconf? #
+ # ---------------------- #
+
+ my $uses_autoconf;
+ my $uses_gettext;
+ my $configure_ac_file = new Autom4te::XFile $configure_ac;
+ while ($_ = $configure_ac_file->getline)
+ {
+ s/#.*//;
+ s/dnl.*//;
+ $uses_autoconf = 1 if /AC_INIT/;
+ }
+
+ if (!$uses_autoconf)
+ {
+ verb "$configure_ac: not using Autoconf";
+ return;
+ }
+
+ my $aux_dir;
+ my @subdir;
+ my $cmd;
+ my $dest;
+
+ verb "$configure_ac: tracing";
+ my $traces = new Autom4te::XFile
+ ("$autoconf"
+ . join (' --trace=', '',
+ # If you change this list, update the
+ # `Autoreconf-preselections' section of autom4te.in.
+ 'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
+ 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
+ 'AC_INIT',
+ )
+ . ' |');
+ while ($_ = $traces->getline)
+ {
+ $aux_dir = $1 if /AC_CONFIG_AUX_DIR:(.*)/;
+ $uses_autoconf = 1 if /AC_INIT/;
+ push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
+ }
+
+ # The subdirs are *optional*, they may not exist.
+ foreach (@subdir)
+ {
+ if (-d)
+ {
+ verb "$configure_ac: subdirectory $_ to gnu-configize";
+ gnu_configize ($_);
+ }
+ else
+ {
+ verb "$configure_ac: subdirectory $_ not present";
+ }
+ }
+
+ $dest = ".";
+
+ if (defined $aux_dir)
+ {
+ $dest = $aux_dir;
+ if (! -d $aux_dir)
+ {
+ verb "$configure_ac: creating directory $aux_dir";
+ mkdir $aux_dir
+ or error "cannot create $aux_dir: $!";
+ }
+ }
+
+ if (!$symlink)
+ {
+ $cmd = $cp;
+ }
+ else
+ {
+ $cmd = $ln_s;
+ }
+
+ xsystem ("$cmd $configdir/config.guess $dest/");
+ xsystem ("$chmod u+x $dest/config.guess");
+ xsystem ("$cmd $configdir/config.sub $dest/");
+ xsystem ("$chmod u+x $dest/config.sub");
+}
+
+
+# &gnu_configize ($DIRECTORY)
+# ------------------------
+# Reconf the $DIRECTORY.
+sub gnu_configize ($)
+{
+ my ($directory) = @_;
+ my $cwd = cwd;
+
+ # The format for this message is not free: taken from Emacs, itself
+ # using GNU Make's format.
+ verb "Entering directory `$directory'";
+ chdir $directory
+ or error "cannot chdir to $directory: $!";
+
+ gnu_configize_current_directory;
+
+ # The format is not free: taken from Emacs, itself using GNU Make's
+ # format.
+ verb "Leaving directory `$directory'";
+ chdir $cwd
+ or error "cannot chdir to $cwd: $!";
+}
+
+
+## ------ ##
+## Main. ##
+## ------ ##
+
+parse_args;
+
+# Autoreconf all the given configure.ac. A while loop, not a for,
+# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
+for my $directory (@ARGV)
+ {
+ gnu_configize ($directory);
+ }
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
diff --git a/poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch b/poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
new file mode 100644
index 000000000..3147435a6
--- /dev/null
+++ b/poky/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
@@ -0,0 +1,25 @@
+support musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gnu-config-20120814/config.sub
+===================================================================
+--- gnu-config-20120814.orig/config.sub 2012-09-18 02:27:45.000000000 -0700
++++ gnu-config-20120814/config.sub 2014-03-26 00:34:19.955996709 -0700
+@@ -123,6 +123,7 @@
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
++ linux-musl* | \
+ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+@@ -1365,6 +1366,7 @@
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-uclibc* \
++ | -linux-musl* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb b/poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
new file mode 100644
index 000000000..3d428b9b7
--- /dev/null
+++ b/poky/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
@@ -0,0 +1,40 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://config.guess;endline=39;md5=b79a4663475f4d724846463277817e0d"
+
+DEPENDS_class-native = "hostperl-runtime-native"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/gnu-config/gnu-config-${PV}.tar.bz2 \
+ file://musl-support.patch \
+ file://gnu-configize.in"
+
+SRC_URI[md5sum] = "bcfca5a2bb39edad4aae5a65efc84094"
+SRC_URI[sha256sum] = "44f99a8e76f3e8e4fec0bb5ad4762f8e44366168554ce66cb85afbe2ed3efd8b"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+ install -d ${D}${datadir}/gnu-config \
+ ${D}${bindir}
+ cat ${WORKDIR}/gnu-configize.in | \
+ sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+ -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+ # In the native case we want the system perl as perl-native can't have built yet
+ if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+ sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+ fi
+ chmod 755 ${D}${bindir}/gnu-configize
+ install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb b/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
new file mode 100644
index 000000000..8de813812
--- /dev/null
+++ b/poky/meta/recipes-devtools/gnu-config/gnu-config_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPL-3.0-with-autoconf-exception"
+LIC_FILES_CHKSUM = "file://config.guess;beginline=7;endline=27;md5=9bac8b1743c2240ae07cce6e546ac2f2"
+
+DEPENDS_class-native = "hostperl-runtime-native"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRCREV = "b576fa87c140b824466ef1638e945e87dc5c0343"
+PV = "20150728+git${SRCPV}"
+
+SRC_URI = "git://git.savannah.gnu.org/config.git \
+ file://gnu-configize.in"
+S = "${WORKDIR}/git"
+UPSTREAM_CHECK_COMMITS = "1"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+ install -d ${D}${datadir}/gnu-config \
+ ${D}${bindir}
+ cat ${WORKDIR}/gnu-configize.in | \
+ sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+ -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+ # In the native case we want the system perl as perl-native can't have built yet
+ if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+ sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+ fi
+ chmod 755 ${D}${bindir}/gnu-configize
+ install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/go/go-1.10.inc b/poky/meta/recipes-devtools/go/go-1.10.inc
new file mode 100644
index 000000000..3a135bf28
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10.inc
@@ -0,0 +1,24 @@
+require go-common.inc
+
+GO_BASEVERSION = "1.10"
+GO_MINOR = ".2"
+PV .= "${GO_MINOR}"
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+ file://0001-allow-CC-and-CXX-to-have-multiple-words.patch \
+ file://0002-cmd-go-make-content-based-hash-generation-less-pedan.patch \
+ file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \
+ file://0004-ld-add-soname-to-shareable-objects.patch \
+ file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
+ file://0006-cmd-dist-separate-host-and-target-builds.patch \
+ file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
+ file://0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch \
+"
+
+SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
+
+SRC_URI[main.md5sum] = "c63b35075bed693bbfc84d4a6262948a"
+SRC_URI[main.sha256sum] = "6264609c6b9cd8ed8e02ca84605d727ce1898d74efa79841660b2e3e985a98bd"
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/poky/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
new file mode 100644
index 000000000..3bb33b014
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
@@ -0,0 +1,33 @@
+From 7a7de46129fa6859fb6311096eb9f54c53c7fe2f Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Mon, 19 Feb 2018 08:49:33 -0800
+Subject: [PATCH 1/9] allow CC and CXX to have multiple words
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/envcmd/env.go | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
+index 603f7b5060..f891123f9c 100644
+--- a/src/cmd/go/internal/envcmd/env.go
++++ b/src/cmd/go/internal/envcmd/env.go
+@@ -82,11 +82,11 @@ func MkEnv() []cfg.EnvVar {
+
+ cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
+ if env := strings.Fields(os.Getenv("CC")); len(env) > 0 {
+- cc = env[0]
++ cc = strings.Join(env, " ")
+ }
+ cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch)
+ if env := strings.Fields(os.Getenv("CXX")); len(env) > 0 {
+- cxx = env[0]
++ cxx = strings.Join(env, " ")
+ }
+ env = append(env, cfg.EnvVar{Name: "CC", Value: cc})
+ env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx})
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/poky/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
new file mode 100644
index 000000000..74f37a99e
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
@@ -0,0 +1,220 @@
+From 8b2feaee81d7a16adc59e61d06c1e7314d3a5408 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Mon, 19 Feb 2018 08:50:59 -0800
+Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic
+
+Go 1.10's build tool now uses content-based hashes to
+determine when something should be built or re-built.
+This same mechanism is used to maintain a built-artifact
+cache for speeding up builds.
+
+However, the hashes it generates include information that
+doesn't work well with OE, nor with using a shared runtime
+library.
+
+First, it embeds path names to source files, unless
+building within GOROOT. This prevents the building
+of a package in GOPATH for later staging into GOROOT.
+
+This patch adds support for the environment variable
+GOPATH_OMIT_IN_ACTIONID. If present, path name
+embedding is disabled.
+
+Second, if cgo is enabled, the build ID for cgo-related
+packages will include the current value of the environment
+variables for invoking the compiler (CC, CXX, FC) and
+any CGO_xxFLAGS variables. Only if the settings used
+during a compilation exactly match, character for character,
+the values used for compiling runtime/cgo or any other
+cgo-enabled package being imported, will the tool
+decide that the imported package is up-to-date.
+
+This is done to help ensure correctness, but is overly
+simplistic and effectively prevents the reuse of built
+artifacts that use cgo (or shared runtime, which includes
+runtime/cgo).
+
+This patch filters out all compiler flags except those
+beginning with '-m'. The default behavior can be restored
+by setting the CGO_PEDANTIC environment variable.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/envcmd/env.go | 2 +-
+ src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++++++++-----------
+ 2 files changed, 46 insertions(+), 19 deletions(-)
+
+diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
+index f891123f9c..ebacfbfdbc 100644
+--- a/src/cmd/go/internal/envcmd/env.go
++++ b/src/cmd/go/internal/envcmd/env.go
+@@ -113,7 +113,7 @@ func findEnv(env []cfg.EnvVar, name string) string {
+ func ExtraEnvVars() []cfg.EnvVar {
+ var b work.Builder
+ b.Init()
+- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{})
++ cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false)
+ if err != nil {
+ // Should not happen - b.CFlags was given an empty package.
+ fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
+diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
+index c4c1500eb2..b0f6b45647 100644
+--- a/src/cmd/go/internal/work/exec.go
++++ b/src/cmd/go/internal/work/exec.go
+@@ -173,6 +173,8 @@ func (b *Builder) Do(root *Action) {
+ wg.Wait()
+ }
+
++var omitGopath = os.Getenv("GOPATH_OMIT_IN_ACTIONID") != ""
++
+ // buildActionID computes the action ID for a build action.
+ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+ p := a.Package
+@@ -189,7 +191,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+ // but it does not hide the exact value of $GOPATH.
+ // Include the full dir in that case.
+ // Assume b.WorkDir is being trimmed properly.
+- if !p.Goroot && !strings.HasPrefix(p.Dir, b.WorkDir) {
++ if !p.Goroot && !omitGopath && !strings.HasPrefix(p.Dir, b.WorkDir) {
+ fmt.Fprintf(h, "dir %s\n", p.Dir)
+ }
+ fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
+@@ -197,13 +199,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
+ fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix)
+ if len(p.CgoFiles)+len(p.SwigFiles) > 0 {
+ fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
+- cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p)
+- fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(), cppflags, cflags)
++ cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p, true)
++ fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(true), cppflags, cflags)
+ if len(p.CXXFiles)+len(p.SwigFiles) > 0 {
+- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags)
++ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags)
+ }
+ if len(p.FFiles) > 0 {
+- fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(), fflags)
++ fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(true), fflags)
+ }
+ // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions?
+ }
+@@ -1731,33 +1733,33 @@ var (
+ // gccCmd returns a gcc command line prefix
+ // defaultCC is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *Builder) GccCmd(incdir, workdir string) []string {
+- return b.compilerCmd(b.ccExe(), incdir, workdir)
++ return b.compilerCmd(b.ccExe(false), incdir, workdir)
+ }
+
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *Builder) GxxCmd(incdir, workdir string) []string {
+- return b.compilerCmd(b.cxxExe(), incdir, workdir)
++ return b.compilerCmd(b.cxxExe(false), incdir, workdir)
+ }
+
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *Builder) gfortranCmd(incdir, workdir string) []string {
+- return b.compilerCmd(b.fcExe(), incdir, workdir)
++ return b.compilerCmd(b.fcExe(false), incdir, workdir)
+ }
+
+ // ccExe returns the CC compiler setting without all the extra flags we add implicitly.
+-func (b *Builder) ccExe() []string {
+- return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch))
++func (b *Builder) ccExe(filtered bool) []string {
++ return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch), filtered)
+ }
+
+ // cxxExe returns the CXX compiler setting without all the extra flags we add implicitly.
+-func (b *Builder) cxxExe() []string {
+- return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch))
++func (b *Builder) cxxExe(filtered bool) []string {
++ return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch), filtered)
+ }
+
+ // fcExe returns the FC compiler setting without all the extra flags we add implicitly.
+-func (b *Builder) fcExe() []string {
+- return b.compilerExe(os.Getenv("FC"), "gfortran")
++func (b *Builder) fcExe(filtered bool) []string {
++ return b.compilerExe(os.Getenv("FC"), "gfortran", filtered)
+ }
+
+ // compilerExe returns the compiler to use given an
+@@ -1766,11 +1768,14 @@ func (b *Builder) fcExe() []string {
+ // of the compiler but can have additional arguments if they
+ // were present in the environment value.
+ // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"].
+-func (b *Builder) compilerExe(envValue string, def string) []string {
++func (b *Builder) compilerExe(envValue string, def string, filtered bool) []string {
+ compiler := strings.Fields(envValue)
+ if len(compiler) == 0 {
+ compiler = []string{def}
+ }
++ if filtered {
++ return append(compiler[0:1], filterCompilerFlags(compiler[1:])...)
++ }
+ return compiler
+ }
+
+@@ -1920,8 +1925,23 @@ func envList(key, def string) []string {
+ return strings.Fields(v)
+ }
+
++var filterFlags = os.Getenv("CGO_PEDANTIC") == ""
++
++func filterCompilerFlags(flags []string) []string {
++ var newflags []string
++ if !filterFlags {
++ return flags
++ }
++ for _, flag := range flags {
++ if strings.HasPrefix(flag, "-m") {
++ newflags = append(newflags, flag)
++ }
++ }
++ return newflags
++}
++
+ // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo.
+-func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
++func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
+ defaults := "-g -O2"
+
+ if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
+@@ -1939,6 +1959,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
+ if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
+ return
+ }
++ if filtered {
++ cppflags = filterCompilerFlags(cppflags)
++ cflags = filterCompilerFlags(cflags)
++ cxxflags = filterCompilerFlags(cxxflags)
++ fflags = filterCompilerFlags(fflags)
++ ldflags = filterCompilerFlags(ldflags)
++ }
+
+ return
+ }
+@@ -1954,7 +1981,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`)
+
+ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
+ p := a.Package
+- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p)
++ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p, false)
+ if err != nil {
+ return nil, nil, err
+ }
+@@ -2306,7 +2333,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
+
+ // Run SWIG on one SWIG input file.
+ func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
+- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p)
++ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p, false)
+ if err != nil {
+ return "", "", err
+ }
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
new file mode 100644
index 000000000..818fe6670
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
@@ -0,0 +1,64 @@
+From acd179b49f1fc8d6f7f69e569fb4a56039c725a1 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Sat, 17 Feb 2018 05:24:20 -0800
+Subject: [PATCH 3/9] allow GOTOOLDIR to be overridden in the environment
+
+to allow for split host/target build roots
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/dist/build.go | 4 +++-
+ src/cmd/go/internal/cfg/cfg.go | 6 +++++-
+ src/go/build/build.go | 2 +-
+ 3 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
+index 49ed80033e..afc615b5c2 100644
+--- a/src/cmd/dist/build.go
++++ b/src/cmd/dist/build.go
+@@ -220,7 +220,9 @@ func xinit() {
+ workdir = xworkdir()
+ xatexit(rmworkdir)
+
+- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
++ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
++ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
++ }
+ }
+
+ // compilerEnv returns a map from "goos/goarch" to the
+diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
+index 1de4f0dc79..4f6010d660 100644
+--- a/src/cmd/go/internal/cfg/cfg.go
++++ b/src/cmd/go/internal/cfg/cfg.go
+@@ -96,7 +96,11 @@ func init() {
+ // as the tool directory does not move based on environment variables.
+ // This matches the initialization of ToolDir in go/build,
+ // except for using GOROOT rather than runtime.GOROOT().
+- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++ if s := os.Getenv("GOTOOLDIR"); s != "" {
++ build.ToolDir = filepath.Clean(s)
++ } else {
++ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++ }
+ }
+
+ func findGOROOT() string {
+diff --git a/src/go/build/build.go b/src/go/build/build.go
+index 68fb423983..81b1b32270 100644
+--- a/src/go/build/build.go
++++ b/src/go/build/build.go
+@@ -1594,7 +1594,7 @@ func init() {
+ }
+
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch b/poky/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
new file mode 100644
index 000000000..c23ca9429
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
@@ -0,0 +1,47 @@
+From 85252f0bd8743223eb778edbe9fb31dff17a23d8 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Sat, 17 Feb 2018 06:26:10 -0800
+Subject: [PATCH 4/9] ld: add soname to shareable objects
+
+so that OE's shared library dependency handling
+can find them.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/link/internal/ld/lib.go | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
+index 6dcaf64122..11cbb8a8bb 100644
+--- a/src/cmd/link/internal/ld/lib.go
++++ b/src/cmd/link/internal/ld/lib.go
+@@ -1134,6 +1134,7 @@ func (ctxt *Link) hostlink() {
+ argv = append(argv, "-Wl,-z,relro")
+ }
+ argv = append(argv, "-shared")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ if ctxt.HeadType != objabi.Hwindows {
+ // Pass -z nodelete to mark the shared library as
+ // non-closeable: a dlclose will do nothing.
+@@ -1145,6 +1146,8 @@ func (ctxt *Link) hostlink() {
+ argv = append(argv, "-Wl,-z,relro")
+ }
+ argv = append(argv, "-shared")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
++
+ case BuildModePlugin:
+ if ctxt.HeadType == objabi.Hdarwin {
+ argv = append(argv, "-dynamiclib")
+@@ -1153,6 +1156,7 @@ func (ctxt *Link) hostlink() {
+ argv = append(argv, "-Wl,-z,relro")
+ }
+ argv = append(argv, "-shared")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ }
+ }
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/poky/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
new file mode 100644
index 000000000..67a93939f
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -0,0 +1,40 @@
+From 16124d84648f4dfdfa4738c5660b5400b30bf9da Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Sat, 17 Feb 2018 06:32:45 -0800
+Subject: [PATCH 5/9] make.bash: override CC when building dist and
+ go_bootstrap
+
+for handling OE cross-canadian builds.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index 93a5c43d11..3a63682bc4 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -162,7 +162,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
+ exit 1
+ fi
+ rm -f cmd/dist/dist
+-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+@@ -193,7 +193,7 @@ fi
+ # Run dist bootstrap to complete make.bash.
+ # Bootstrap installs a proper cmd/dist, built with the new toolchain.
+ # Throw ours, built with Go 1.4, away after bootstrap.
+-./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
++CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
+ rm -f ./cmd/dist/dist
+
+ # DO NOT ADD ANY NEW CODE HERE.
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch b/poky/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
new file mode 100644
index 000000000..9fe699628
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
@@ -0,0 +1,277 @@
+From 2f07af34697c61decdcfa5b11434451fbcf37704 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Sat, 17 Feb 2018 10:03:48 -0800
+Subject: [PATCH 6/9] cmd/dist: separate host and target builds
+
+Change the dist tool to allow for OE-style cross-
+and cross-canadian builds:
+
+ - command flags --host-only and --target only are added;
+ if one is present, the other changes mentioned below
+ take effect, and arguments may also be specified on
+ the command line to enumerate the package(s) to be
+ built.
+
+ - for OE cross builds, go_bootstrap is always built for
+ the current build host, and is moved, along with the supporting
+ toolchain (asm, compile, etc.) to a separate 'native_native'
+ directory under GOROOT/pkg/tool.
+
+ - go_bootstrap is not automatically removed after the build,
+ so it can be reused later (e.g., building both static and
+ shared runtime).
+
+Note that for --host-only builds, it would be nice to specify
+just the "cmd" package to build only the go commands/tools,
+the staleness checks in the dist tool will fail if the "std"
+library has not also been built. So host-only builds have to
+build everything anyway.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+
+more dist cleanup
+---
+ src/cmd/dist/build.go | 149 +++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 111 insertions(+), 38 deletions(-)
+
+diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
+index afc615b5c2..36262665b2 100644
+--- a/src/cmd/dist/build.go
++++ b/src/cmd/dist/build.go
+@@ -38,6 +38,7 @@ var (
+ goldflags string
+ workdir string
+ tooldir string
++ build_tooldir string
+ oldgoos string
+ oldgoarch string
+ exe string
+@@ -49,6 +50,7 @@ var (
+
+ rebuildall bool
+ defaultclang bool
++ crossBuild bool
+
+ vflag int // verbosity
+ )
+@@ -223,6 +225,8 @@ func xinit() {
+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
+ }
++ build_tooldir = pathf("%s/pkg/tool/native_native", goroot)
++
+ }
+
+ // compilerEnv returns a map from "goos/goarch" to the
+@@ -252,7 +256,6 @@ func compilerEnv(envName, def string) map[string]string {
+ if gohostos != goos || gohostarch != goarch {
+ m[gohostos+"/"+gohostarch] = m[""]
+ }
+- m[""] = env
+ }
+
+ for _, goos := range okgoos {
+@@ -479,8 +482,10 @@ func setup() {
+ // We keep it in pkg/, just like the object directory above.
+ if rebuildall {
+ xremoveall(tooldir)
++ xremoveall(build_tooldir)
+ }
+ xmkdirall(tooldir)
++ xmkdirall(build_tooldir)
+
+ // Remove tool binaries from before the tool/gohostos_gohostarch
+ xremoveall(pathf("%s/bin/tool", goroot))
+@@ -1130,11 +1135,29 @@ func cmdbootstrap() {
+
+ var noBanner bool
+ var debug bool
++ var hostOnly bool
++ var targetOnly bool
++ var toBuild = []string { "std", "cmd" }
++
+ flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all")
+ flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process")
+ flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner")
++ flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target")
++ flag.BoolVar(&targetOnly, "target-only", targetOnly, "build only target binaries, not host")
+
+- xflagparse(0)
++ xflagparse(-1)
++
++ if (hostOnly && targetOnly) {
++ fatalf("specify only one of --host-only or --target-only\n")
++ }
++ crossBuild = hostOnly || targetOnly
++ if flag.NArg() > 0 {
++ if crossBuild {
++ toBuild = flag.Args()
++ } else {
++ fatalf("package names not permitted without --host-only or --target-only\n")
++ }
++ }
+
+ if debug {
+ // cmd/buildid is used in debug mode.
+@@ -1182,8 +1205,13 @@ func cmdbootstrap() {
+ xprintf("\n")
+ }
+
+- gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
+- goldflags = os.Getenv("GO_LDFLAGS")
++ // For split host/target cross/cross-canadian builds, we don't
++ // want to be setting these flags until after we have compiled
++ // the toolchain that runs on the build host.
++ if ! crossBuild {
++ gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
++ goldflags = os.Getenv("GO_LDFLAGS")
++ }
+ goBootstrap := pathf("%s/go_bootstrap", tooldir)
+ cmdGo := pathf("%s/go", gobin)
+ if debug {
+@@ -1212,7 +1240,11 @@ func cmdbootstrap() {
+ xprintf("\n")
+ }
+ xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
+- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ if crossBuild {
++ os.Setenv("CC", defaultcc[""])
++ } else {
++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ }
+ goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...)
+ if debug {
+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
+@@ -1249,45 +1281,82 @@ func cmdbootstrap() {
+ }
+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
+
+- if goos == oldgoos && goarch == oldgoarch {
+- // Common case - not setting up for cross-compilation.
+- timelog("build", "toolchain")
+- if vflag > 0 {
+- xprintf("\n")
++ if crossBuild {
++ gogcflags = os.Getenv("GO_GCFLAGS")
++ goldflags = os.Getenv("GO_LDFLAGS")
++ tool_files, _ := filepath.Glob(pathf("%s/*", tooldir))
++ for _, f := range tool_files {
++ copyfile(pathf("%s/%s", build_tooldir, filepath.Base(f)), f, writeExec)
++ xremove(f)
++ }
++ os.Setenv("GOTOOLDIR", build_tooldir)
++ goBootstrap = pathf("%s/go_bootstrap", build_tooldir)
++ if hostOnly {
++ timelog("build", "host toolchain")
++ if vflag > 0 {
++ xprintf("\n")
++ }
++ xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
++ goInstall(goBootstrap, toBuild...)
++ checkNotStale(goBootstrap, toBuild...)
++ // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary
++
++ timelog("build", "target toolchain")
++ if vflag > 0 {
++ xprintf("\n")
++ }
++ } else if targetOnly {
++ goos = oldgoos
++ goarch = oldgoarch
++ os.Setenv("GOOS", goos)
++ os.Setenv("GOARCH", goarch)
++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
++ goInstall(goBootstrap, toBuild...)
++ checkNotStale(goBootstrap, toBuild...)
++ // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
+ }
+- xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
+ } else {
+- // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
+- // Finish GOHOSTOS/GOHOSTARCH installation and then
+- // run GOOS/GOARCH installation.
+- timelog("build", "host toolchain")
+- if vflag > 0 {
+- xprintf("\n")
++ if goos == oldgoos && goarch == oldgoarch {
++ // Common case - not setting up for cross-compilation.
++ timelog("build", "toolchain")
++ if vflag > 0 {
++ xprintf("\n")
++ }
++ xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
++ } else {
++ // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
++ // Finish GOHOSTOS/GOHOSTARCH installation and then
++ // run GOOS/GOARCH installation.
++ timelog("build", "host toolchain")
++ if vflag > 0 {
++ xprintf("\n")
++ }
++ xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
++ goInstall(goBootstrap, "std", "cmd")
++ checkNotStale(goBootstrap, "std", "cmd")
++ checkNotStale(cmdGo, "std", "cmd")
++
++ timelog("build", "target toolchain")
++ if vflag > 0 {
++ xprintf("\n")
++ }
++ goos = oldgoos
++ goarch = oldgoarch
++ os.Setenv("GOOS", goos)
++ os.Setenv("GOARCH", goarch)
++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++ xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
+ }
+- xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
+ goInstall(goBootstrap, "std", "cmd")
+ checkNotStale(goBootstrap, "std", "cmd")
+ checkNotStale(cmdGo, "std", "cmd")
+-
+- timelog("build", "target toolchain")
+- if vflag > 0 {
+- xprintf("\n")
++ if debug {
++ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
++ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
++ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
++ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
+ }
+- goos = oldgoos
+- goarch = oldgoarch
+- os.Setenv("GOOS", goos)
+- os.Setenv("GOARCH", goarch)
+- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
+- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
+- }
+- goInstall(goBootstrap, "std", "cmd")
+- checkNotStale(goBootstrap, "std", "cmd")
+- checkNotStale(cmdGo, "std", "cmd")
+- if debug {
+- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
+- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
+- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
+- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
+ }
+
+ // Check that there are no new files in $GOROOT/bin other than
+@@ -1305,7 +1374,11 @@ func cmdbootstrap() {
+ }
+
+ // Remove go_bootstrap now that we're done.
+- xremove(pathf("%s/go_bootstrap", tooldir))
++ // Except that for split host/target cross-builds, we need to
++ // keep it.
++ if ! crossBuild {
++ xremove(pathf("%s/go_bootstrap", tooldir))
++ }
+
+ // Print trailing banner unless instructed otherwise.
+ if !noBanner {
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch b/poky/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
new file mode 100644
index 000000000..72427627b
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
@@ -0,0 +1,108 @@
+From f98aa287941417226a6e4f78759f8a5e19732cde Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Fri, 2 Mar 2018 06:00:20 -0800
+Subject: [PATCH 7/9] cmd/go: make GOROOT precious by default
+
+The go build tool normally rebuilds whatever it detects is
+stale. This can be a problem when GOROOT is intended to
+be read-only and the go runtime has been built as a shared
+library, since we don't want every application to be rebuilding
+the shared runtime - particularly in cross-build/packaging
+setups, since that would lead to 'abi mismatch' runtime errors.
+
+This patch prevents the install and linkshared actions from
+installing to GOROOT unless overridden with the GOROOT_OVERRIDE
+environment variable.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/work/action.go | 3 +++
+ src/cmd/go/internal/work/build.go | 5 +++++
+ src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++
+ 3 files changed, 33 insertions(+)
+
+diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
+index 9f1f8f8a50..a382880474 100644
+--- a/src/cmd/go/internal/work/action.go
++++ b/src/cmd/go/internal/work/action.go
+@@ -563,6 +563,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) {
+ if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
+ continue
+ }
++ if goRootPrecious && (p1.Standard || p1.Goroot) {
++ continue
++ }
+ haveShlib[filepath.Base(p1.Shlib)] = true
+ // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
+ // we'll end up building an overall library or executable that depends at runtime
+diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
+index 57b7b00879..e2ba95420e 100644
+--- a/src/cmd/go/internal/work/build.go
++++ b/src/cmd/go/internal/work/build.go
+@@ -143,6 +143,7 @@ See also: go install, go get, go clean.
+ }
+
+ const concurrentGCBackendCompilationEnabledByDefault = true
++var goRootPrecious bool = true
+
+ func init() {
+ // break init cycle
+@@ -156,6 +157,10 @@ func init() {
+
+ AddBuildFlags(CmdBuild)
+ AddBuildFlags(CmdInstall)
++
++ if x := os.Getenv("GOROOT_OVERRIDE"); x != "" {
++ goRootPrecious = false
++ }
+ }
+
+ // Note that flags consulted by other parts of the code
+diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
+index b0f6b45647..c8f266a8ad 100644
+--- a/src/cmd/go/internal/work/exec.go
++++ b/src/cmd/go/internal/work/exec.go
+@@ -371,6 +371,23 @@ func (b *Builder) build(a *Action) (err error) {
+ return fmt.Errorf("missing or invalid binary-only package")
+ }
+
++ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) {
++ _, err := os.Stat(a.Package.Target)
++ if err == nil {
++ a.built = a.Package.Target
++ a.Target = a.Package.Target
++ a.buildID = b.fileHash(a.Package.Target)
++ a.Package.Stale = false
++ a.Package.StaleReason = "GOROOT-resident package"
++ return nil
++ }
++ if b.ComputeStaleOnly {
++ a.Package.Stale = true
++ a.Package.StaleReason = "missing or invalid GOROOT-resident package"
++ return nil
++ }
++ }
++
+ if err := b.Mkdir(a.Objdir); err != nil {
+ return err
+ }
+@@ -1097,6 +1114,14 @@ func BuildInstallFunc(b *Builder, a *Action) (err error) {
+ return nil
+ }
+
++ if goRootPrecious && a.Package != nil {
++ p := a.Package
++ if p.Standard || p.Goroot {
++ err := fmt.Errorf("attempting to install package %s into read-only GOROOT", p.ImportPath)
++ return err
++ }
++ }
++
+ if err := b.Mkdir(a.Objdir); err != nil {
+ return err
+ }
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch b/poky/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
new file mode 100644
index 000000000..1e754178d
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
@@ -0,0 +1,58 @@
+From 41b90ed7af10a071ccfeede6a429e0d80518436d Mon Sep 17 00:00:00 2001
+From: Cherry Zhang <cherryyz@google.com>
+Date: Sat, 17 Feb 2018 10:31:39 -0500
+Subject: [PATCH 8/9] cmd/internal/obj/arm64: fix branch-too-far with TBZ like
+ instructions
+
+The compiler now emits TBZ like instructions, but the assembler's
+too-far-branch patch code didn't include that case. Add it.
+
+Fixes #23889.
+
+Change-Id: Ib75f9250c660b9fb652835fbc83263a5d5073dc5
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ src/cmd/internal/obj/arm64/asm7.go | 11 +++++++++--
+ src/cmd/internal/obj/arm64/asm_test.go | 1 +
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
+index ca81238c93..b1ee552489 100644
+--- a/src/cmd/internal/obj/arm64/asm7.go
++++ b/src/cmd/internal/obj/arm64/asm7.go
+@@ -696,9 +696,16 @@ func span7(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
+ o = c.oplook(p)
+
+ /* very large branches */
+- if (o.type_ == 7 || o.type_ == 39) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like
++ if (o.type_ == 7 || o.type_ == 39 || o.type_ == 40) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like, 40: TBZ and like
+ otxt := p.Pcond.Pc - pc
+- if otxt <= -(1<<18)+10 || otxt >= (1<<18)-10 {
++ var toofar bool
++ switch o.type_ {
++ case 7, 39: // branch instruction encodes 19 bits
++ toofar = otxt <= -(1<<20)+10 || otxt >= (1<<20)-10
++ case 40: // branch instruction encodes 14 bits
++ toofar = otxt <= -(1<<15)+10 || otxt >= (1<<15)-10
++ }
++ if toofar {
+ q := c.newprog()
+ q.Link = p.Link
+ p.Link = q
+diff --git a/src/cmd/internal/obj/arm64/asm_test.go b/src/cmd/internal/obj/arm64/asm_test.go
+index 369c48f510..3e0c9c13a6 100644
+--- a/src/cmd/internal/obj/arm64/asm_test.go
++++ b/src/cmd/internal/obj/arm64/asm_test.go
+@@ -52,6 +52,7 @@ func TestLarge(t *testing.T) {
+ // gen generates a very large program, with a very far conditional branch.
+ func gen(buf *bytes.Buffer) {
+ fmt.Fprintln(buf, "TEXT f(SB),0,$0-0")
++ fmt.Fprintln(buf, "TBZ $5, R0, label")
+ fmt.Fprintln(buf, "CBZ R0, label")
+ fmt.Fprintln(buf, "BEQ label")
+ for i := 0; i < 1<<19; i++ {
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch b/poky/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
new file mode 100644
index 000000000..06b00b3cc
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
@@ -0,0 +1,130 @@
+From f575d85c4bd9b2903223d6c0dcc38a12775d582f Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Sun, 18 Feb 2018 08:24:05 -0800
+Subject: [PATCH 9/9] ld: replace glibc dynamic linker with musl
+
+Rework of patch by Khem Raj <raj.khem@gmail.com>
+for go 1.10. Should be applied conditionally on
+musl being the system C library.
+
+Upstream-Status: Inappropriate [Real fix should be portable across libcs]
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/link/internal/amd64/obj.go | 2 +-
+ src/cmd/link/internal/arm/obj.go | 2 +-
+ src/cmd/link/internal/arm64/obj.go | 2 +-
+ src/cmd/link/internal/mips/obj.go | 2 +-
+ src/cmd/link/internal/mips64/obj.go | 2 +-
+ src/cmd/link/internal/ppc64/obj.go | 2 +-
+ src/cmd/link/internal/s390x/obj.go | 2 +-
+ src/cmd/link/internal/x86/obj.go | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go
+index 87e809166a..f522a63034 100644
+--- a/src/cmd/link/internal/amd64/obj.go
++++ b/src/cmd/link/internal/amd64/obj.go
+@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ PEreloc1: pereloc1,
+ TLSIEtoLE: tlsIEtoLE,
+
+- Linuxdynld: "/lib64/ld-linux-x86-64.so.2",
++ Linuxdynld: "/lib64/ld-musl-x86-64.so.1",
+ Freebsddynld: "/libexec/ld-elf.so.1",
+ Openbsddynld: "/usr/libexec/ld.so",
+ Netbsddynld: "/libexec/ld.elf_so",
+diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go
+index da16f92345..fd14940ede 100644
+--- a/src/cmd/link/internal/arm/obj.go
++++ b/src/cmd/link/internal/arm/obj.go
+@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Gentext: gentext,
+ Machoreloc1: machoreloc1,
+
+- Linuxdynld: "/lib/ld-linux.so.3", // 2 for OABI, 3 for EABI
++ Linuxdynld: "/lib/ld-musl-armhf.so.1",
+ Freebsddynld: "/usr/libexec/ld-elf.so.1",
+ Openbsddynld: "/usr/libexec/ld.so",
+ Netbsddynld: "/libexec/ld.elf_so",
+diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go
+index 6b386ad737..99863712cc 100644
+--- a/src/cmd/link/internal/arm64/obj.go
++++ b/src/cmd/link/internal/arm64/obj.go
+@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Gentext: gentext,
+ Machoreloc1: machoreloc1,
+
+- Linuxdynld: "/lib/ld-linux-aarch64.so.1",
++ Linuxdynld: "/lib/ld-musl-aarch64.so.1",
+
+ Freebsddynld: "XXX",
+ Openbsddynld: "XXX",
+diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go
+index c5d3451c39..fd85e6368d 100644
+--- a/src/cmd/link/internal/mips/obj.go
++++ b/src/cmd/link/internal/mips/obj.go
+@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Gentext: gentext,
+ Machoreloc1: machoreloc1,
+
+- Linuxdynld: "/lib/ld.so.1",
++ Linuxdynld: "/lib/ld-musl-mipsle.so.1",
+
+ Freebsddynld: "XXX",
+ Openbsddynld: "XXX",
+diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go
+index 83974e5b56..097224f6da 100644
+--- a/src/cmd/link/internal/mips64/obj.go
++++ b/src/cmd/link/internal/mips64/obj.go
+@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Gentext: gentext,
+ Machoreloc1: machoreloc1,
+
+- Linuxdynld: "/lib64/ld64.so.1",
++ Linuxdynld: "/lib64/ld-musl-mips64le.so.1",
+ Freebsddynld: "XXX",
+ Openbsddynld: "XXX",
+ Netbsddynld: "XXX",
+diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
+index 273d9b42cb..a503abe8ea 100644
+--- a/src/cmd/link/internal/ppc64/obj.go
++++ b/src/cmd/link/internal/ppc64/obj.go
+@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Machoreloc1: machoreloc1,
+
+ // TODO(austin): ABI v1 uses /usr/lib/ld.so.1,
+- Linuxdynld: "/lib64/ld64.so.1",
++ Linuxdynld: "/lib64/ld-musl-powerpc64le.so.1",
+
+ Freebsddynld: "XXX",
+ Openbsddynld: "XXX",
+diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go
+index 9ac7eb8217..3825ff7abe 100644
+--- a/src/cmd/link/internal/s390x/obj.go
++++ b/src/cmd/link/internal/s390x/obj.go
+@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Gentext: gentext,
+ Machoreloc1: machoreloc1,
+
+- Linuxdynld: "/lib64/ld64.so.1",
++ Linuxdynld: "/lib64/ld-musl-s390x.so.1",
+
+ // not relevant for s390x
+ Freebsddynld: "XXX",
+diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go
+index 6a744dc04e..d81f392549 100644
+--- a/src/cmd/link/internal/x86/obj.go
++++ b/src/cmd/link/internal/x86/obj.go
+@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
+ Machoreloc1: machoreloc1,
+ PEreloc1: pereloc1,
+
+- Linuxdynld: "/lib/ld-linux.so.2",
++ Linuxdynld: "/lib/ld-musl-i386.so.1",
+ Freebsddynld: "/usr/libexec/ld-elf.so.1",
+ Openbsddynld: "/usr/libexec/ld.so",
+ Netbsddynld: "/usr/libexec/ld.elf_so",
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9.inc b/poky/meta/recipes-devtools/go/go-1.9.inc
new file mode 100644
index 000000000..a942f6d8a
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9.inc
@@ -0,0 +1,26 @@
+require go-common.inc
+
+GO_BASEVERSION = "1.9"
+GO_MINOR = ".6"
+PV .= "${GO_MINOR}"
+
+FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
+
+SRC_URI += "\
+ file://0001-make.bash-quote-CC_FOR_TARGET.patch \
+ file://0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch \
+ file://0003-make.bash-better-separate-host-and-target-builds.patch \
+ file://0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch \
+ file://0005-cmd-go-make-GOROOT-precious-by-default.patch \
+ file://0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch \
+ file://0007-ld-add-soname-to-shareable-objects.patch \
+ file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \
+ file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \
+ file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \
+"
+SRC_URI_append_libc-musl = " file://set-external-linker.patch"
+
+SRC_URI[main.md5sum] = "52c1a3063291036597552d3fed0b2917"
+SRC_URI[main.sha256sum] = "36f4059be658f7f07091e27fe04bb9e97a0c4836eb446e4c5bac3c90ff9e5828"
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch b/poky/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
new file mode 100644
index 000000000..7800975e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
@@ -0,0 +1,32 @@
+From d24734ad44006791fd48fc45ea34fe608ff672fb Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:04:23 -0700
+Subject: [PATCH 1/7] make.bash: quote CC_FOR_TARGET
+
+For OE cross-builds, $CC_FOR_TARGET has more than
+one word and needs to be quoted.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index 71e7531..dcf3256 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -175,7 +175,7 @@ echo "##### Building packages and commands for $GOOS/$GOARCH."
+
+ old_bin_files=$(cd $GOROOT/bin && echo *)
+
+-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+
+ # Check that there are no new files in $GOROOT/bin other than go and gofmt
+ # and $GOOS_$GOARCH (a directory used when cross-compiling).
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch b/poky/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
new file mode 100644
index 000000000..a4e42261c
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
@@ -0,0 +1,67 @@
+From a7170d32a13aead608abd18996f6dab2e2a631b5 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:06:37 -0700
+Subject: [PATCH 2/7] cmd/go: fix CC and CXX environment variable construction
+
+For OE cross-builds, CC and CXX have multiple words, and
+we need their complete definitions when setting up the
+environment during Go builds.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/envcmd/env.go | 4 ++--
+ src/cmd/go/internal/work/build.go | 12 ++++++++++++
+ 2 files changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
+index 43d4334..529d21d 100644
+--- a/src/cmd/go/internal/envcmd/env.go
++++ b/src/cmd/go/internal/envcmd/env.go
+@@ -74,10 +74,10 @@ func MkEnv() []cfg.EnvVar {
+ }
+
+ cmd := b.GccCmd(".")
+- env = append(env, cfg.EnvVar{Name: "CC", Value: cmd[0]})
++ env = append(env, cfg.EnvVar{Name: "CC", Value: strings.Join(b.GccCmdForReal(), " ")})
+ env = append(env, cfg.EnvVar{Name: "GOGCCFLAGS", Value: strings.Join(cmd[3:], " ")})
+ cmd = b.GxxCmd(".")
+- env = append(env, cfg.EnvVar{Name: "CXX", Value: cmd[0]})
++ env = append(env, cfg.EnvVar{Name: "CXX", Value: strings.Join(b.GxxCmdForReal(), " ")})
+
+ if cfg.BuildContext.CgoEnabled {
+ env = append(env, cfg.EnvVar{Name: "CGO_ENABLED", Value: "1"})
+diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
+index 7d667ff..85df0b3 100644
+--- a/src/cmd/go/internal/work/build.go
++++ b/src/cmd/go/internal/work/build.go
+@@ -3127,12 +3127,24 @@ func (b *Builder) GccCmd(objdir string) []string {
+ return b.ccompilerCmd("CC", cfg.DefaultCC, objdir)
+ }
+
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *Builder) GccCmdForReal() []string {
++ return envList("CC", cfg.DefaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *Builder) GxxCmd(objdir string) []string {
+ return b.ccompilerCmd("CXX", cfg.DefaultCXX, objdir)
+ }
+
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *Builder) GxxCmdForReal() []string {
++ return envList("CXX", cfg.DefaultCXX)
++}
++
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *Builder) gfortranCmd(objdir string) []string {
+ return b.ccompilerCmd("FC", "gfortran", objdir)
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch b/poky/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
new file mode 100644
index 000000000..ffd9f2359
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
@@ -0,0 +1,92 @@
+From 31e88f06af7ab787d8fe0c1ca625193e1799e167 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:12:04 -0700
+Subject: [PATCH 3/7] make.bash: better separate host and target builds
+
+Fore OE cross-builds, the simple checks in make.bash are
+insufficient for distinguishing host and target build
+environments, so add some options for telling the
+script which parts are being built.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 51 ++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 28 insertions(+), 23 deletions(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index dcf3256..9553623 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -156,13 +156,22 @@ if [ "$1" = "--no-clean" ]; then
+ buildall=""
+ shift
+ fi
+-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++do_host_build="yes"
++do_target_build="yes"
++if [ "$1" = "--target-only" ]; then
++ do_host_build="no"
++ shift
++elif [ "$1" = "--host-only" ]; then
++ do_target_build="no"
++ shift
++fi
+
+-# Delay move of dist tool to now, because bootstrap may clear tool directory.
+-mv cmd/dist/dist "$GOTOOLDIR"/dist
+-echo
++if [ "$do_host_build" = "yes" ]; then
++ ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++ # Delay move of dist tool to now, because bootstrap may clear tool directory.
++ mv cmd/dist/dist "$GOTOOLDIR"/dist
++ echo
+
+-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+ echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ # use the host compiler, CC, from `cmd/dist/dist env` instead.
+@@ -171,24 +180,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+ echo
+ fi
+
+-echo "##### Building packages and commands for $GOOS/$GOARCH."
+-
+-old_bin_files=$(cd $GOROOT/bin && echo *)
+-
+-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+-
+-# Check that there are no new files in $GOROOT/bin other than go and gofmt
+-# and $GOOS_$GOARCH (a directory used when cross-compiling).
+-(cd $GOROOT/bin && for f in *; do
+- if ! expr " $old_bin_files go gofmt ${GOOS}_${GOARCH} " : ".* $f " >/dev/null 2>/dev/null; then
+- echo 1>&2 "ERROR: unexpected new file in $GOROOT/bin: $f"
+- exit 1
+- fi
+-done)
+-
+-echo
+-
+-rm -f "$GOTOOLDIR"/go_bootstrap
++if [ "$do_target_build" = "yes" ]; then
++ GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
++ echo "##### Building packages and commands for $GOOS/$GOARCH."
++ if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
++ rm -rf ./host-tools
++ mkdir ./host-tools
++ mv "$GOTOOLDIR"/* ./host-tools
++ GOTOOLDIR="$PWD/host-tools"
++ fi
++ GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
++ echo
++
++ rm -f "$GOTOOLDIR"/go_bootstrap
++fi
+
+ if [ "$1" != "--no-banner" ]; then
+ "$GOTOOLDIR"/dist banner
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch b/poky/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
new file mode 100644
index 000000000..180b06a4d
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
@@ -0,0 +1,68 @@
+From 1369178b497b12088ec4c2794606cc9f14cc327c Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:15:03 -0700
+Subject: [PATCH 4/7] cmd/go: allow GOTOOLDIR to be overridden in the
+ environment
+
+For OE cross-builds, host-side tools reside in the native
+GOROOT, not the target GOROOT. Allow GOTOOLDIR to be set
+in the environment to allow that split, rather than always
+computing GOTOOLDIR relative to the GOROOT setting.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/cfg/cfg.go | 7 ++++++-
+ src/cmd/go/internal/work/build.go | 2 +-
+ src/go/build/build.go | 2 +-
+ 3 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
+index b3ad1ce..c1dc974 100644
+--- a/src/cmd/go/internal/cfg/cfg.go
++++ b/src/cmd/go/internal/cfg/cfg.go
+@@ -91,7 +91,12 @@ func init() {
+ // as the tool directory does not move based on environment variables.
+ // This matches the initialization of ToolDir in go/build,
+ // except for using GOROOT rather than runtime.GOROOT().
+- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++ s := os.Getenv("GOTOOLDIR")
++ if s == "" {
++ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++ } else {
++ build.ToolDir = s
++ }
+ }
+
+ func findGOROOT() string {
+diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
+index 85df0b3..7b9a69e 100644
+--- a/src/cmd/go/internal/work/build.go
++++ b/src/cmd/go/internal/work/build.go
+@@ -1337,7 +1337,7 @@ func (b *Builder) build(a *Action) (err error) {
+ }
+
+ var cgoExe string
+- if a.cgo != nil && a.cgo.Target != "" {
++ if a.cgo != nil && a.cgo.Target != "" && os.Getenv("GOTOOLDIR") == "" {
+ cgoExe = a.cgo.Target
+ } else {
+ cgoExe = base.Tool("cgo")
+diff --git a/src/go/build/build.go b/src/go/build/build.go
+index fd89871..e16145b 100644
+--- a/src/go/build/build.go
++++ b/src/go/build/build.go
+@@ -1588,7 +1588,7 @@ func init() {
+ }
+
+ // ToolDir is the directory containing build tools.
+-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
++var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
+
+ // IsLocalImport reports whether the import path is
+ // a local import path, like ".", "..", "./foo", or "../foo".
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch b/poky/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
new file mode 100644
index 000000000..6e93bcb6c
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
@@ -0,0 +1,41 @@
+From 44f961975dac6cf464a77b5f6dd0c47cc192c4fd Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:19:52 -0700
+Subject: [PATCH 5/7] cmd/go: make GOROOT precious by default
+
+For OE builds, we never want packages that have
+already been installed into the build root to be
+modified, so prevent the go build tool from checking
+if they should be rebuilt.
+
+Also add an environment variable to override this
+behavior, just for building the Go runtime.
+
+Upstream-Status: Pending
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/go/internal/load/pkg.go | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
+index 60de666..2660d3f 100644
+--- a/src/cmd/go/internal/load/pkg.go
++++ b/src/cmd/go/internal/load/pkg.go
+@@ -1530,6 +1530,13 @@ func isStale(p *Package) (bool, string) {
+ return true, "build ID mismatch"
+ }
+
++ // For OE builds, make anything in GOROOT non-stale,
++ // to prevent a package build from overwriting the
++ // build root.
++ if p.Goroot && os.Getenv("GOROOT_OVERRIDE") != "1" {
++ return false, "GOROOT-resident packages do not get rebuilt"
++ }
++
+ // Package is stale if a dependency is.
+ for _, p1 := range p.Internal.Deps {
+ if p1.Stale {
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch b/poky/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
new file mode 100644
index 000000000..f0f564044
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
@@ -0,0 +1,36 @@
+From aae74d1045ca03306ba4159206ee3bac72bcdfbb Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:23:23 -0700
+Subject: [PATCH 6/7] make.bash: add GOTOOLDIR_BOOTSTRAP environment variable
+
+For cross-canadian builds, we need to use the native
+GOTOOLDIR during the bootstrap phase, so provide a way
+to pass that setting into the build script.
+
+Upstream-Status: Pending
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index 9553623..2e6fb05 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then
+ mv cmd/dist/dist "$GOTOOLDIR"/dist
+ echo
+
++ GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
+ echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ # use the host compiler, CC, from `cmd/dist/dist env` instead.
+- CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
++ CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOTOOLDIR="$GOTOOLDIR_BOOTSTRAP" \
+ "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
+ echo
+ fi
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch b/poky/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
new file mode 100644
index 000000000..6459782d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
@@ -0,0 +1,46 @@
+From e957c3458d53e37bf416f51d2f8bf54c195e50f5 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Wed, 13 Sep 2017 08:27:02 -0700
+Subject: [PATCH 7/7] ld: add soname to shareable objects
+
+Shared library handling in OE depends on the inclusion
+of an soname header, so update the go linker to add that
+header for both internal and external linking.
+
+Upstream-Status: Pending
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/cmd/link/internal/ld/lib.go | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
+index 0234105..0b9e2d0 100644
+--- a/src/cmd/link/internal/ld/lib.go
++++ b/src/cmd/link/internal/ld/lib.go
+@@ -1124,12 +1124,14 @@ func (l *Link) hostlink() {
+ // Pass -z nodelete to mark the shared library as
+ // non-closeable: a dlclose will do nothing.
+ argv = append(argv, "-shared", "-Wl,-z,nodelete")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ }
+ case BuildmodeShared:
+ if UseRelro() {
+ argv = append(argv, "-Wl,-z,relro")
+ }
+ argv = append(argv, "-shared")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ case BuildmodePlugin:
+ if Headtype == objabi.Hdarwin {
+ argv = append(argv, "-dynamiclib")
+@@ -1138,6 +1140,7 @@ func (l *Link) hostlink() {
+ argv = append(argv, "-Wl,-z,relro")
+ }
+ argv = append(argv, "-shared")
++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
+ }
+ }
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch b/poky/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
new file mode 100644
index 000000000..0977c7835
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
@@ -0,0 +1,33 @@
+From 03e6c339d4fb712fbb8c4ca6ef2fc7100dcdb3d7 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Thu, 14 Sep 2017 05:38:10 -0700
+Subject: [PATCH 8/8] make.bash: add GOHOSTxx indirection for cross-canadian
+ builds
+
+Add environment variables for specifying the host OS/arch
+that we are building the compiler for, so it can differ from
+the build host OS/arch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/make.bash b/src/make.bash
+index 2e6fb05..0bdadc6 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -173,6 +173,8 @@ if [ "$do_host_build" = "yes" ]; then
+ echo
+
+ GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
++ GOHOSTOS="${GOHOSTOS_CROSS:-$GOHOSTOS}"
++ GOHOSTARCH="${GOHOSTARCH_CROSS:-$GOHOSTARCH}"
+ echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+ # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
+ # use the host compiler, CC, from `cmd/dist/dist env` instead.
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch b/poky/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
new file mode 100644
index 000000000..aa5fcfdd2
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
@@ -0,0 +1,47 @@
+From aae44527c8065d54f6acaf87c82cba1ac96fae59 Mon Sep 17 00:00:00 2001
+From: Ian Lance Taylor <iant@golang.org>
+Date: Fri, 18 Aug 2017 17:46:03 -0700
+Subject: [PATCH] cmd/go: -buildmode=pie forces external linking mode on all
+ systems
+
+The go tool assumed that -buildmode=pie implied internal linking on
+linux-amd64. However, that was changed by CL 36417 for issue #18968.
+
+Fixes #21452
+
+Change-Id: I8ed13aea52959cc5c53223f4c41ba35329445545
+Reviewed-on: https://go-review.googlesource.com/57231
+Run-TryBot: Ian Lance Taylor <iant@golang.org>
+TryBot-Result: Gobot Gobot <gobot@golang.org>
+Reviewed-by: Avelino <t@avelino.xxx>
+Reviewed-by: Rob Pike <r@golang.org>
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ src/cmd/go/internal/load/pkg.go | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
+index 2660d3f..d40773b 100644
+--- a/src/cmd/go/internal/load/pkg.go
++++ b/src/cmd/go/internal/load/pkg.go
+@@ -954,11 +954,12 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) *Package
+
+ if cfg.BuildContext.CgoEnabled && p.Name == "main" && !p.Goroot {
+ // Currently build modes c-shared, pie (on systems that do not
+- // support PIE with internal linking mode), plugin, and
+- // -linkshared force external linking mode, as of course does
++ // support PIE with internal linking mode (currently all
++ // systems: issue #18968)), plugin, and -linkshared force
++ // external linking mode, as of course does
+ // -ldflags=-linkmode=external. External linking mode forces
+ // an import of runtime/cgo.
+- pieCgo := cfg.BuildBuildmode == "pie" && (cfg.BuildContext.GOOS != "linux" || cfg.BuildContext.GOARCH != "amd64")
++ pieCgo := cfg.BuildBuildmode == "pie"
+ linkmodeExternal := false
+ for i, a := range cfg.BuildLdflags {
+ if a == "-linkmode=external" {
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/poky/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
new file mode 100644
index 000000000..83fd78c3d
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -0,0 +1,43 @@
+From 21d83dd9499e5be30eea28dd7034d1ea2a01c838 Mon Sep 17 00:00:00 2001
+From: Matt Madison <matt@madison.systems>
+Date: Tue, 14 Nov 2017 07:38:42 -0800
+Subject: [PATCH 10/10] make.bash: override CC when building dist and
+ go_bootstrap
+
+For cross-canadian builds, dist and go_bootstrap
+run on the build host, so CC needs to point to the
+build host's C compiler. Add a BUILD_CC environment
+for this, falling back to $CC if not present.
+
+Upstream-Status: Pending
+
+Signed-off-by: Matt Madison <matt@madison.systems>
+---
+ src/make.bash | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/make.bash b/src/make.bash
+index 0bdadc6..f199349 100755
+--- a/src/make.bash
++++ b/src/make.bash
+@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
+ exit 1
+ fi
+ rm -f cmd/dist/dist
+-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
++CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then
+ fi
+
+ if [ "$do_host_build" = "yes" ]; then
+- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
++ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
+ # Delay move of dist tool to now, because bootstrap may clear tool directory.
+ mv cmd/dist/dist "$GOTOOLDIR"/dist
+ echo
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/go/go-1.9/set-external-linker.patch b/poky/meta/recipes-devtools/go/go-1.9/set-external-linker.patch
new file mode 100644
index 000000000..d6bd7fa39
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-1.9/set-external-linker.patch
@@ -0,0 +1,111 @@
+Change the dynamic linker hardcoding to use musl when not using glibc
+this should be applied conditional to musl being the system C library
+
+Upstream-Status: Inappropriate [Real Fix should be portable across libcs]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: go/src/cmd/link/internal/amd64/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/amd64/obj.go
++++ go/src/cmd/link/internal/amd64/obj.go
+@@ -67,7 +67,7 @@ func Init() {
+ ld.Thearch.Append64 = ld.Append64l
+ ld.Thearch.TLSIEtoLE = tlsIEtoLE
+
+- ld.Thearch.Linuxdynld = "/lib64/ld-linux-x86-64.so.2"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-x86_64.so.1"
+ ld.Thearch.Freebsddynld = "/libexec/ld-elf.so.1"
+ ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
+ ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
+Index: go/src/cmd/link/internal/arm/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/arm/obj.go
++++ go/src/cmd/link/internal/arm/obj.go
+@@ -63,7 +63,7 @@ func Init() {
+ ld.Thearch.Append32 = ld.Append32l
+ ld.Thearch.Append64 = ld.Append64l
+
+- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.3" // 2 for OABI, 3 for EABI
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-armhf.so.1"
+ ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
+ ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
+ ld.Thearch.Netbsddynld = "/libexec/ld.elf_so"
+Index: go/src/cmd/link/internal/arm64/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/arm64/obj.go
++++ go/src/cmd/link/internal/arm64/obj.go
+@@ -62,7 +62,7 @@ func Init() {
+ ld.Thearch.Append32 = ld.Append32l
+ ld.Thearch.Append64 = ld.Append64l
+
+- ld.Thearch.Linuxdynld = "/lib/ld-linux-aarch64.so.1"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-aarch64.so.1"
+
+ ld.Thearch.Freebsddynld = "XXX"
+ ld.Thearch.Openbsddynld = "XXX"
+Index: go/src/cmd/link/internal/mips/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/mips/obj.go
++++ go/src/cmd/link/internal/mips/obj.go
+@@ -77,7 +77,7 @@ func Init() {
+ ld.Thearch.Append64 = ld.Append64b
+ }
+
+- ld.Thearch.Linuxdynld = "/lib/ld.so.1"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-mipsle.so.1"
+
+ ld.Thearch.Freebsddynld = "XXX"
+ ld.Thearch.Openbsddynld = "XXX"
+Index: go/src/cmd/link/internal/mips64/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/mips64/obj.go
++++ go/src/cmd/link/internal/mips64/obj.go
+@@ -75,7 +75,7 @@ func Init() {
+ ld.Thearch.Append64 = ld.Append64b
+ }
+
+- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
++ ld.Thearch.Linuxdynld = "/lib64/ld-musl-mips64le.so.1"
+
+ ld.Thearch.Freebsddynld = "XXX"
+ ld.Thearch.Openbsddynld = "XXX"
+Index: go/src/cmd/link/internal/ppc64/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/ppc64/obj.go
++++ go/src/cmd/link/internal/ppc64/obj.go
+@@ -77,7 +77,7 @@ func Init() {
+ }
+
+ // TODO(austin): ABI v1 uses /usr/lib/ld.so.1
+- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-powerpc64le.so.1"
+
+ ld.Thearch.Freebsddynld = "XXX"
+ ld.Thearch.Openbsddynld = "XXX"
+Index: go/src/cmd/link/internal/s390x/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/s390x/obj.go
++++ go/src/cmd/link/internal/s390x/obj.go
+@@ -62,7 +62,7 @@ func Init() {
+ ld.Thearch.Append32 = ld.Append32b
+ ld.Thearch.Append64 = ld.Append64b
+
+- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-s390x.so.1"
+
+ // not relevant for s390x
+ ld.Thearch.Freebsddynld = "XXX"
+Index: go/src/cmd/link/internal/x86/obj.go
+===================================================================
+--- go.orig/src/cmd/link/internal/x86/obj.go
++++ go/src/cmd/link/internal/x86/obj.go
+@@ -63,7 +63,7 @@ func Init() {
+ ld.Thearch.Append32 = ld.Append32l
+ ld.Thearch.Append64 = ld.Append64l
+
+- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.2"
++ ld.Thearch.Linuxdynld = "/lib/ld-musl-i386.so.1"
+ ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1"
+ ld.Thearch.Openbsddynld = "/usr/libexec/ld.so"
+ ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"
diff --git a/poky/meta/recipes-devtools/go/go-common.inc b/poky/meta/recipes-devtools/go/go-common.inc
new file mode 100644
index 000000000..11d55c4d3
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-common.inc
@@ -0,0 +1,33 @@
+SUMMARY = "Go programming language compiler"
+DESCRIPTION = " The Go programming language is an open source project to make \
+ programmers more productive. Go is expressive, concise, clean, and\
+ efficient. Its concurrency mechanisms make it easy to write programs\
+ that get the most out of multicore and networked machines, while its\
+ novel type system enables flexible and modular program construction.\
+ Go compiles quickly to machine code yet has the convenience of\
+ garbage collection and the power of run-time reflection. It's a\
+ fast, statically typed, compiled language that feels like a\
+ dynamically typed, interpreted language."
+
+HOMEPAGE = " http://golang.org/"
+LICENSE = "BSD-3-Clause"
+
+inherit goarch
+
+SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz;name=main"
+S = "${WORKDIR}/go"
+B = "${S}"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
+
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+SSTATE_SCAN_CMD = "true"
+
+export GOROOT_OVERRIDE = "1"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+export GOCACHE = "off"
+export CGO_ENABLED = "1"
+
+do_compile_prepend() {
+ BUILD_CC=${BUILD_CC}
+}
diff --git a/poky/meta/recipes-devtools/go/go-cross-canadian.inc b/poky/meta/recipes-devtools/go/go-cross-canadian.inc
new file mode 100644
index 000000000..ea68b8875
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -0,0 +1,58 @@
+inherit cross-canadian
+
+DEPENDS = "go-native virtual/${HOST_PREFIX}go-crosssdk virtual/nativesdk-${HOST_PREFIX}go-runtime \
+ virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc \
+ virtual/nativesdk-${HOST_PREFIX}compilerlibs"
+PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
+export GOROOT_FINAL = "${libdir}/go"
+export CGO_CFLAGS = "${CFLAGS}"
+export CGO_LDFLAGS = "${LDFLAGS}"
+export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} ${LDFLAGS}"'
+
+do_configure[noexec] = "1"
+
+do_compile() {
+ export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+ export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+ cd src
+ ./make.bash --host-only --no-banner
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
+
+
+make_wrapper() {
+ rm -f ${D}${bindir}/$2
+ cat <<END >${D}${bindir}/$2
+#!/bin/sh
+here=\`dirname \$0\`
+native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\`
+export GOARCH="${TARGET_GOARCH}"
+export GOOS="${TARGET_GOOS}"
+test -n "\$GOARM" || export GOARM="${TARGET_GOARM}"
+test -n "\$GO386" || export GO386="${TARGET_GO386}"
+test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}"
+export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
+test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
+\$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
+END
+ chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+ install -d ${D}${libdir}/go/pkg/tool
+ cp --preserve=mode,timestamps -R ${B}/pkg/tool/${HOST_GOTUPLE} ${D}${libdir}/go/pkg/tool/
+ install -d ${D}${bindir} ${D}${libdir}/go/bin
+ for f in ${B}/${GO_BUILD_BINDIR}/*
+ do
+ base=`basename $f`
+ install -m755 $f ${D}${libdir}/go/bin
+ make_wrapper $base ${TARGET_PREFIX}$base
+ done
+}
diff --git a/poky/meta/recipes-devtools/go/go-cross-canadian_1.10.bb b/poky/meta/recipes-devtools/go/go-cross-canadian_1.10.bb
new file mode 100644
index 000000000..7ac9449e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross-canadian_1.10.bb
@@ -0,0 +1,2 @@
+require go-cross-canadian.inc
+require go-${PV}.inc
diff --git a/poky/meta/recipes-devtools/go/go-cross-canadian_1.9.bb b/poky/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
new file mode 100644
index 000000000..367a96705
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
@@ -0,0 +1,12 @@
+require go-cross-canadian.inc
+require go-${PV}.inc
+
+export GOHOSTOS_CROSS = "${HOST_GOOS}"
+export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
+export CC_FOR_TARGET = "${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+export CXX_FOR_TARGET = "${HOST_PREFIX}g++ --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+
+do_compile_prepend() {
+ export GOBIN="${B}/bin"
+ export TMPDIR="$GOTMPDIR"
+}
diff --git a/poky/meta/recipes-devtools/go/go-cross.inc b/poky/meta/recipes-devtools/go/go-cross.inc
new file mode 100644
index 000000000..44f230b8b
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross.inc
@@ -0,0 +1,62 @@
+inherit cross
+
+PROVIDES = "virtual/${TARGET_PREFIX}go"
+DEPENDS = "go-native"
+
+PN = "go-cross-${TARGET_ARCH}"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOROOT_FINAL = "${libdir}/go"
+export GOCACHE = "off"
+CC = "${@d.getVar('BUILD_CC').strip()}"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+ export CC_FOR_${GOOS}_${GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+ export CXX_FOR_${GOOS}_${GOARCh}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+ cd src
+ ./make.bash --host-only --no-banner
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
+
+make_wrapper() {
+ rm -f ${D}${bindir}/$2
+ cat <<END >${D}${bindir}/$2
+#!/bin/bash
+here=\`dirname \$0\`
+export GOARCH="${TARGET_GOARCH}"
+export GOOS="${TARGET_GOOS}"
+export GOARM="\${GOARM:-${TARGET_GOARM}}"
+export GO386="\${GO386:-${TARGET_GO386}}"
+export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}"
+\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
+END
+ chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+ install -d ${D}${libdir}/go
+ cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
+ install -d ${D}${libdir}/go/src
+ (cd ${S}/src; for d in *; do \
+ [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \
+ done)
+ find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
+ install -d ${D}${bindir} ${D}${libdir}/go/bin
+ for f in ${B}/bin/*
+ do
+ base=`basename $f`
+ install -m755 $f ${D}${libdir}/go/bin
+ make_wrapper $base ${TARGET_PREFIX}$base
+ done
+}
diff --git a/poky/meta/recipes-devtools/go/go-cross_1.10.bb b/poky/meta/recipes-devtools/go/go-cross_1.10.bb
new file mode 100644
index 000000000..80b5a03f6
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross_1.10.bb
@@ -0,0 +1,2 @@
+require go-cross.inc
+require go-${PV}.inc
diff --git a/poky/meta/recipes-devtools/go/go-cross_1.9.bb b/poky/meta/recipes-devtools/go/go-cross_1.9.bb
new file mode 100644
index 000000000..4739c7d5c
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-cross_1.9.bb
@@ -0,0 +1,10 @@
+require go-cross.inc
+require go-${PV}.inc
+
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+
+do_compile_prepend() {
+ export GOBIN="${B}/bin"
+ export TMPDIR="$GOTMPDIR"
+}
diff --git a/poky/meta/recipes-devtools/go/go-crosssdk.inc b/poky/meta/recipes-devtools/go/go-crosssdk.inc
new file mode 100644
index 000000000..4391b3242
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-crosssdk.inc
@@ -0,0 +1,50 @@
+inherit crosssdk
+
+DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/${TARGET_PREFIX}binutils-crosssdk"
+PN = "go-crosssdk-${TARGET_ARCH}"
+PROVIDES = "virtual/${TARGET_PREFIX}go-crosssdk"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOROOT_FINAL = "${libdir}/go"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+ export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
+ export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
+ cd src
+ ./make.bash --host-only --no-banner
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
+
+make_wrapper() {
+ rm -f ${D}${bindir}/$2
+ cat <<END >${D}${bindir}/$2
+#!/bin/bash
+here=\`dirname \$0\`
+export GOARCH="${TARGET_GOARCH}"
+export GOOS="${TARGET_GOOS}"
+\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
+END
+ chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+ install -d ${D}${libdir}/go
+ install -d ${D}${libdir}/go/bin
+ install -d ${D}${libdir}/go/pkg/tool
+ install -d ${D}${bindir}
+ cp --preserve=mode,timestamps -R ${S}/pkg/tool/${BUILD_GOTUPLE} ${D}${libdir}/go/pkg/tool/
+ for f in ${B}/bin/*
+ do
+ base=`basename $f`
+ install -m755 $f ${D}${libdir}/go/bin
+ make_wrapper $base ${TARGET_PREFIX}$base
+ done
+}
diff --git a/poky/meta/recipes-devtools/go/go-crosssdk_1.10.bb b/poky/meta/recipes-devtools/go/go-crosssdk_1.10.bb
new file mode 100644
index 000000000..1857c8a57
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-crosssdk_1.10.bb
@@ -0,0 +1,2 @@
+require go-crosssdk.inc
+require go-${PV}.inc
diff --git a/poky/meta/recipes-devtools/go/go-crosssdk_1.9.bb b/poky/meta/recipes-devtools/go/go-crosssdk_1.9.bb
new file mode 100644
index 000000000..3ac629bd4
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-crosssdk_1.9.bb
@@ -0,0 +1,11 @@
+require go-crosssdk.inc
+require go-${PV}.inc
+
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+export GO_INSTALL = "cmd"
+
+do_compile_prepend() {
+ export GOBIN="${B}/bin"
+ export TMPDIR="$GOTMPDIR"
+}
diff --git a/poky/meta/recipes-devtools/go/go-dep/0001-Add-support-for-mips-mips64.patch b/poky/meta/recipes-devtools/go/go-dep/0001-Add-support-for-mips-mips64.patch
new file mode 100644
index 000000000..34ec9876f
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-dep/0001-Add-support-for-mips-mips64.patch
@@ -0,0 +1,54 @@
+From f0fb80604385ae3266a472601ef685896b4cc0af Mon Sep 17 00:00:00 2001
+From: Vladimir Stefanovic <vladimir.stefanovic@imgtec.com>
+Date: Fri, 17 Feb 2017 20:44:43 +0100
+Subject: [PATCH] Add support for mips, mips64
+
+---
+Upstream-Status: Submitted
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ vendor/github.com/boltdb/bolt/bolt_mips64x.go | 12 ++++++++++++
+ vendor/github.com/boltdb/bolt/bolt_mipsx.go | 12 ++++++++++++
+ 2 files changed, 24 insertions(+)
+ create mode 100644 vendor/github.com/boltdb/bolt/bolt_mips64x.go
+ create mode 100644 vendor/github.com/boltdb/bolt/bolt_mipsx.go
+
+diff --git a/vendor/github.com/boltdb/bolt/bolt_mips64x.go b/vendor/github.com/boltdb/bolt/bolt_mips64x.go
+new file mode 100644
+index 00000000..134b578b
+--- /dev/null
++++ b/vendor/github.com/boltdb/bolt/bolt_mips64x.go
+@@ -0,0 +1,12 @@
++// +build mips64 mips64le
++
++package bolt
++
++// maxMapSize represents the largest mmap size supported by Bolt.
++const maxMapSize = 0x8000000000 // 512GB
++
++// maxAllocSize is the size used when creating array pointers.
++const maxAllocSize = 0x7FFFFFFF
++
++// Are unaligned load/stores broken on this arch?
++var brokenUnaligned = false
+diff --git a/vendor/github.com/boltdb/bolt/bolt_mipsx.go b/vendor/github.com/boltdb/bolt/bolt_mipsx.go
+new file mode 100644
+index 00000000..d5ecb059
+--- /dev/null
++++ b/vendor/github.com/boltdb/bolt/bolt_mipsx.go
+@@ -0,0 +1,12 @@
++// +build mips mipsle
++
++package bolt
++
++// maxMapSize represents the largest mmap size supported by Bolt.
++const maxMapSize = 0x40000000 // 1GB
++
++// maxAllocSize is the size used when creating array pointers.
++const maxAllocSize = 0xFFFFFFF
++
++// Are unaligned load/stores broken on this arch?
++var brokenUnaligned = false
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/go/go-dep_0.4.1.bb b/poky/meta/recipes-devtools/go/go-dep_0.4.1.bb
new file mode 100644
index 000000000..d82e63720
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-dep_0.4.1.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Dependency management tool for Golang"
+HOMEPAGE = "https://github.com/golang/dep"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=1bad315647751fab0007812f70d42c0d"
+
+GO_IMPORT = "github.com/golang/dep"
+SRC_URI = "git://${GO_IMPORT} \
+ file://0001-Add-support-for-mips-mips64.patch;patchdir=src/github.com/golang/dep \
+ "
+
+# Points to 0.4.1 tag
+SRCREV = "37d9ea0ac16f0e0a05afc3b60e1ac8c364b6c329"
+
+inherit go
+
+GO_INSTALL = "${GO_IMPORT}/cmd/dep"
+
+RDEPENDS_${PN}-dev += "bash"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/go/go-native.inc b/poky/meta/recipes-devtools/go/go-native.inc
new file mode 100644
index 000000000..b76fb0825
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-native.inc
@@ -0,0 +1,59 @@
+# Use immediate assingment here to get the original (/usr/lib)
+# instead of the one rewritten by native.bbclass.
+nonstaging_libdir := "${libdir}"
+
+inherit native
+
+SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
+SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016"
+SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
+
+export GOOS = "${BUILD_GOOS}"
+export GOARCH = "${BUILD_GOARCH}"
+CC = "${@d.getVar('BUILD_CC').strip()}"
+
+GOMAKEARGS ?= "--no-banner"
+
+do_configure() {
+ cd ${WORKDIR}/go1.4/go/src
+ CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
+}
+
+do_compile() {
+ export GOROOT_FINAL="${nonstaging_libdir}/go"
+ export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
+
+ cd src
+ ./make.bash ${GOMAKEARGS}
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
+
+make_wrapper() {
+ rm -f ${D}${bindir}/$2$3
+ cat <<END >${D}${bindir}/$2$3
+#!/bin/bash
+here=\`dirname \$0\`
+export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
+\$here/../lib/go/bin/$1 "\$@"
+END
+ chmod +x ${D}${bindir}/$2
+}
+
+do_install() {
+ install -d ${D}${libdir}/go
+ cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
+ install -d ${D}${libdir}/go/src
+ (cd ${S}/src; for d in *; do \
+ [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
+ done)
+ find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
+ install -d ${D}${bindir} ${D}${libdir}/go/bin
+ for f in ${B}/bin/*
+ do
+ base=`basename $f`
+ install -m755 $f ${D}${libdir}/go/bin
+ make_wrapper $base $base
+ done
+}
diff --git a/poky/meta/recipes-devtools/go/go-native_1.10.bb b/poky/meta/recipes-devtools/go/go-native_1.10.bb
new file mode 100644
index 000000000..bbf3c0dd7
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-native_1.10.bb
@@ -0,0 +1,2 @@
+require ${PN}.inc
+require go-${PV}.inc
diff --git a/poky/meta/recipes-devtools/go/go-native_1.9.bb b/poky/meta/recipes-devtools/go/go-native_1.9.bb
new file mode 100644
index 000000000..8621e1df3
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-native_1.9.bb
@@ -0,0 +1,4 @@
+require ${PN}.inc
+require go-${PV}.inc
+
+GOMAKEARGS = "--host-only --no-banner"
diff --git a/poky/meta/recipes-devtools/go/go-runtime.inc b/poky/meta/recipes-devtools/go/go-runtime.inc
new file mode 100644
index 000000000..0041e8afa
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-runtime.inc
@@ -0,0 +1,92 @@
+DEPENDS = "virtual/${TARGET_PREFIX}go go-native"
+DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk"
+PROVIDES = "virtual/${TARGET_PREFIX}go-runtime"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOROOT_FINAL = "${libdir}/go"
+export CGO_CFLAGS = "${CFLAGS}"
+export CGO_CPPFLAGS = "${CPPFLAGS}"
+export CGO_CXXFLAGS = "${CXXFLAGS}"
+export CGO_LDFLAGS = "${LDFLAGS}"
+
+GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
+GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags '${GO_EXTLDFLAGS}'"'
+
+do_configure() {
+ :
+}
+
+do_configure_libc-musl() {
+ rm -f ${S}/src/runtime/race/*.syso
+}
+
+do_compile() {
+ export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
+ export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
+
+ cd src
+ ./make.bash --target-only --no-banner std
+ if [ -n "${GO_DYNLINK}" ]; then
+ export GOTOOLDIR="${B}/pkg/tool/native_native"
+ CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
+ $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std
+ fi
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
+
+do_install() {
+ install -d ${D}${libdir}/go/src
+ cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
+ if [ "${BUILD_GOTUPLE}" != "${TARGET_GOTUPLE}" ]; then
+ rm -rf ${D}${libdir}/go/pkg/${BUILD_GOTUPLE}
+ rm -rf ${D}${libdir}/go/pkg/obj/${BUILD_GOTUPLE}
+ fi
+ rm -rf ${D}${libdir}/go/pkg/tool
+ rm -rf ${D}${libdir}/go/pkg/obj
+ rm -rf ${D}${libdir}/go/pkg/bootstrap
+ find src -mindepth 1 -maxdepth 1 -type d | while read srcdir; do
+ cp --preserve=mode,timestamps -R $srcdir ${D}${libdir}/go/src/
+ done
+ find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
+ rm -f ${D}${libdir}/go/src/cmd/dist/dist
+}
+
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}"
+FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \
+ ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \
+"
+FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE}"
+
+# Go sources include some scripts and pre-built binaries for
+# multiple architectures. The static .a files for dynamically-linked
+# runtime are also required in -dev.
+INSANE_SKIP_${PN}-dev = "staticdev file-rdeps arch"
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_SYSROOT_STRIP = "1"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/go/go-runtime_1.10.bb b/poky/meta/recipes-devtools/go/go-runtime_1.10.bb
new file mode 100644
index 000000000..43b68b4e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-runtime_1.10.bb
@@ -0,0 +1,2 @@
+require go-${PV}.inc
+require go-runtime.inc
diff --git a/poky/meta/recipes-devtools/go/go-runtime_1.9.bb b/poky/meta/recipes-devtools/go/go-runtime_1.9.bb
new file mode 100644
index 000000000..d5279ea89
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-runtime_1.9.bb
@@ -0,0 +1,23 @@
+require go-${PV}.inc
+require go-runtime.inc
+
+export GO_TARGET_INSTALL = "std"
+export CC_FOR_TARGET = "${CC}"
+export CXX_FOR_TARGET = "${CXX}"
+
+do_compile() {
+ export GOBIN="${B}/bin"
+ export TMPDIR="$GOTMPDIR"
+ export CC=$BUILD_CC
+
+ cd src
+ CGO_CFLAGS="${BUILD_CFLAGS}" CGO_LDFLAGS="${BUILD_LDFLAGS}" ./make.bash --host-only
+ cp ${B}/pkg/tool/${BUILD_GOTUPLE}/go_bootstrap ${B}
+ rm -rf ${B}/pkg/${TARGET_GOTUPLE}
+ ./make.bash --target-only
+ if [ -n "${GO_DYNLINK}" ]; then
+ cp ${B}/go_bootstrap ${B}/pkg/tool/${BUILD_GOTUPLE}
+ GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash --target-only
+ fi
+ cd ${B}
+}
diff --git a/poky/meta/recipes-devtools/go/go-target.inc b/poky/meta/recipes-devtools/go/go-target.inc
new file mode 100644
index 000000000..29a134467
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go-target.inc
@@ -0,0 +1,53 @@
+DEPENDS = "virtual/${TARGET_PREFIX}go go-native"
+DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
+
+export GOHOSTOS = "${BUILD_GOOS}"
+export GOHOSTARCH = "${BUILD_GOARCH}"
+export GOOS = "${TARGET_GOOS}"
+export GOARCH = "${TARGET_GOARCH}"
+export GOARM = "${TARGET_GOARM}"
+export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
+export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
+export GOROOT_FINAL = "${libdir}/go"
+GO_LDFLAGS = ""
+GO_LDFLAGS_class-nativesdk = "-linkmode external"
+export GO_LDFLAGS
+
+CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+ export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
+ export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
+
+ cd src
+ ./make.bash --target-only --no-banner
+ cd ${B}
+}
+do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
+do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
+
+do_install() {
+ install -d ${D}${libdir}/go/pkg/tool
+ cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
+ install -d ${D}${libdir}/go/src
+ cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
+ find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
+ install -d ${D}${libdir}/go/bin
+ install -d ${D}${bindir}
+ for f in ${B}/${GO_BUILD_BINDIR}/*; do
+ name=`basename $f`
+ install -m 0755 $f ${D}${libdir}/go/bin/
+ ln -sf ../${BASELIB}/go/bin/$name ${D}${bindir}/
+ done
+}
+
+PACKAGES = "${PN} ${PN}-dev"
+FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}"
+FILES_${PN}-dev = "${libdir}/go"
+RDEPENDS_${PN}-dev = "perl bash"
+INSANE_SKIP_${PN} = "ldflags"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/go/go_1.10.bb b/poky/meta/recipes-devtools/go/go_1.10.bb
new file mode 100644
index 000000000..c67e2cb05
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go_1.10.bb
@@ -0,0 +1,2 @@
+require go-${PV}.inc
+require go-target.inc
diff --git a/poky/meta/recipes-devtools/go/go_1.9.bb b/poky/meta/recipes-devtools/go/go_1.9.bb
new file mode 100644
index 000000000..ec5a314e7
--- /dev/null
+++ b/poky/meta/recipes-devtools/go/go_1.9.bb
@@ -0,0 +1,17 @@
+require go-${PV}.inc
+require go-target.inc
+
+export GO_TARGET_INSTALL = "cmd"
+export GO_FLAGS = "-a"
+export CC_FOR_TARGET = "${CC}"
+export CXX_FOR_TARGET = "${CXX}"
+
+do_compile() {
+ export GOBIN="${B}/bin"
+ export TMPDIR="$GOTMPDIR"
+ export CC=$BUILD_CC
+
+ cd src
+ ./make.bash
+ cd ${B}
+}
diff --git a/poky/meta/recipes-devtools/help2man/help2man-native_1.47.5.bb b/poky/meta/recipes-devtools/help2man/help2man-native_1.47.5.bb
new file mode 100644
index 000000000..2dd6d3882
--- /dev/null
+++ b/poky/meta/recipes-devtools/help2man/help2man-native_1.47.5.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Program for creating simple man pages"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "autoconf-native automake-native"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "1c886063c9e0ab463906de804596aa2f"
+SRC_URI[sha256sum] = "7ca60b2519fdbe97f463fe2df66a6188d18b514bfd44127d985f0234ee2461b1"
+
+inherit autotools native
+
+EXTRA_OECONF = "--disable-nls"
+
+# We don't want to reconfigure things as it would require 'perlnative' to be
+# used.
+do_configure() {
+ oe_runconf
+}
+
+do_install_append () {
+ # Make sure we use /usr/bin/env perl
+ sed -i -e "1s:#!.*:#! /usr/bin/env perl:" ${D}${bindir}/help2man
+}
diff --git a/poky/meta/recipes-devtools/i2c-tools/files/0001-i2c-tools-eeprog-Module.mk-Add-missing-dependency.patch b/poky/meta/recipes-devtools/i2c-tools/files/0001-i2c-tools-eeprog-Module.mk-Add-missing-dependency.patch
new file mode 100644
index 000000000..5b1a53844
--- /dev/null
+++ b/poky/meta/recipes-devtools/i2c-tools/files/0001-i2c-tools-eeprog-Module.mk-Add-missing-dependency.patch
@@ -0,0 +1,32 @@
+From 01674fefe3bd24fd93412fbb3eb4e85fe70c80aa Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Mon, 18 Dec 2017 16:01:39 +0200
+Subject: [PATCH] i2c-tools: eeprog/Module.mk: Add missing dependency
+
+Absence of this dependency caused parallel build to run into a race
+and break.
+
+Upstream-Status: Accepted
+https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/commit/?id=f87c97317012a3b96b67237925893b8ffd5f4f50
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ eeprog/Module.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/eeprog/Module.mk b/eeprog/Module.mk
+index 9d36869..d215855 100644
+--- a/eeprog/Module.mk
++++ b/eeprog/Module.mk
+@@ -20,7 +20,7 @@ EEPROG_TARGETS := eeprog
+ # Programs
+ #
+
+-$(EEPROG_DIR)/eeprog: $(EEPROG_DIR)/eeprog.o $(EEPROG_DIR)/24cXX.o
++$(EEPROG_DIR)/eeprog: $(EEPROG_DIR)/eeprog.o $(EEPROG_DIR)/24cXX.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(EEPROG_LDFLAGS)
+
+ #
+--
+2.4.0
+
diff --git a/poky/meta/recipes-devtools/i2c-tools/files/0001-lib-Module.mk-Add-missing-dependencies.patch b/poky/meta/recipes-devtools/i2c-tools/files/0001-lib-Module.mk-Add-missing-dependencies.patch
new file mode 100644
index 000000000..426b4330e
--- /dev/null
+++ b/poky/meta/recipes-devtools/i2c-tools/files/0001-lib-Module.mk-Add-missing-dependencies.patch
@@ -0,0 +1,37 @@
+From a6a59693066fd8da81f7107479df3e32a129247d Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Wed, 6 Dec 2017 09:55:04 +0100
+Subject: [PATCH] lib/Module.mk: Add missing dependencies
+
+The lib symlinks lacked a dependency to the actual library file, so
+parallel builds could run into a race and break.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ lib/Module.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Module.mk b/lib/Module.mk
+index 432a051..fd2c8c4 100644
+--- a/lib/Module.mk
++++ b/lib/Module.mk
+@@ -42,11 +42,11 @@ endif
+ $(LIB_DIR)/$(LIB_SHLIBNAME): $(LIB_DIR)/smbus.o
+ $(CC) -shared $(LDFLAGS) -Wl,--version-script=$(LIB_DIR)/libi2c.map -Wl,-soname,$(LIB_SHSONAME) -o $@ $^ -lc
+
+-$(LIB_DIR)/$(LIB_SHSONAME):
++$(LIB_DIR)/$(LIB_SHSONAME): $(LIB_DIR)/$(LIB_SHLIBNAME)
+ $(RM) $@
+ $(LN) $(LIB_SHLIBNAME) $@
+
+-$(LIB_DIR)/$(LIB_SHBASENAME):
++$(LIB_DIR)/$(LIB_SHBASENAME): $(LIB_DIR)/$(LIB_SHLIBNAME)
+ $(RM) $@
+ $(LN) $(LIB_SHLIBNAME) $@
+
+--
+2.4.0
+
diff --git a/poky/meta/recipes-devtools/i2c-tools/files/0001-tools-Module.mk-Add-missing-dependencies.patch b/poky/meta/recipes-devtools/i2c-tools/files/0001-tools-Module.mk-Add-missing-dependencies.patch
new file mode 100644
index 000000000..33cf2d42a
--- /dev/null
+++ b/poky/meta/recipes-devtools/i2c-tools/files/0001-tools-Module.mk-Add-missing-dependencies.patch
@@ -0,0 +1,66 @@
+From 08b0d67ba7eceb862cb17f52eb1911e9579726ea Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Thu, 14 Dec 2017 08:52:26 +0100
+Subject: [PATCH] tools/Module.mk: Add missing dependencies
+
+Better build the library before building the tools which link against
+it, otherwise parallel builds could run into a race and break.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Acked-by: Angelo Compagnucci <angelo@amarulasolutions.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ lib/Module.mk | 7 +++++++
+ tools/Module.mk | 10 +++++-----
+ 2 files changed, 12 insertions(+), 5 deletions(-)
+
+Index: i2c-tools-4.0/lib/Module.mk
+===================================================================
+--- i2c-tools-4.0.orig/lib/Module.mk
++++ i2c-tools-4.0/lib/Module.mk
+@@ -35,6 +35,13 @@ LIB_TARGETS += $(LIB_STLIBNAME)
+ LIB_OBJECTS += smbus.ao
+ endif
+
++# Library file to link against (static or dynamic)
++ifeq ($(USE_STATIC_LIB),1)
++LIB_DEPS := $(LIB_DIR)/$(LIB_STLIBNAME)
++else
++LIB_DEPS := $(LIB_DIR)/$(LIB_SHBASENAME)
++endif
++
+ #
+ # Libraries
+ #
+Index: i2c-tools-4.0/tools/Module.mk
+===================================================================
+--- i2c-tools-4.0.orig/tools/Module.mk
++++ i2c-tools-4.0/tools/Module.mk
+@@ -24,19 +24,19 @@ TOOLS_TARGETS := i2cdetect i2cdump i2cse
+ # Programs
+ #
+
+-$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o
++$(TOOLS_DIR)/i2cdetect: $(TOOLS_DIR)/i2cdetect.o $(TOOLS_DIR)/i2cbusses.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
+
+-$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
++$(TOOLS_DIR)/i2cdump: $(TOOLS_DIR)/i2cdump.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
+
+-$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
++$(TOOLS_DIR)/i2cset: $(TOOLS_DIR)/i2cset.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
+
+-$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
++$(TOOLS_DIR)/i2cget: $(TOOLS_DIR)/i2cget.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
+
+-$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o
++$(TOOLS_DIR)/i2ctransfer: $(TOOLS_DIR)/i2ctransfer.o $(TOOLS_DIR)/i2cbusses.o $(TOOLS_DIR)/util.o $(LIB_DEPS)
+ $(CC) $(LDFLAGS) -o $@ $^ $(TOOLS_LDFLAGS)
+
+ #
diff --git a/poky/meta/recipes-devtools/i2c-tools/files/remove-i2c-dev.patch b/poky/meta/recipes-devtools/i2c-tools/files/remove-i2c-dev.patch
new file mode 100644
index 000000000..703688d08
--- /dev/null
+++ b/poky/meta/recipes-devtools/i2c-tools/files/remove-i2c-dev.patch
@@ -0,0 +1,98 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 226bc03acca44cf4b300597308064c44676b6f4b Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Tue, 23 Jan 2018 14:24:16 +0100
+Subject: Delete duplicate i2c-dev.h
+
+The <linux/i2c-dev.h> header file is provided by the kernel, so drop
+our own copy of this file.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Acked-by: Wolfram Sang <wsa@the-dreams.de>
+---
+ include/linux/i2c-dev.h | 72 -------------------------------------------------
+ 1 file changed, 72 deletions(-)
+ delete mode 100644 include/linux/i2c-dev.h
+
+diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
+deleted file mode 100644
+index 839d25a..0000000
+--- a/include/linux/i2c-dev.h
++++ /dev/null
+@@ -1,72 +0,0 @@
+-/*
+- i2c-dev.h - i2c-bus driver, char device interface
+-
+- Copyright (C) 1995-97 Simon G. Vogl
+- Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
+-
+- This program is free software; you can redistribute it and/or modify
+- it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 2 of the License, or
+- (at your option) any later version.
+-
+- This program is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
+-
+- You should have received a copy of the GNU General Public License
+- along with this program; if not, write to the Free Software
+- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+- MA 02110-1301 USA.
+-*/
+-
+-#ifndef _LINUX_I2C_DEV_H
+-#define _LINUX_I2C_DEV_H
+-
+-#include <linux/types.h>
+-
+-
+-/* /dev/i2c-X ioctl commands. The ioctl's parameter is always an
+- * unsigned long, except for:
+- * - I2C_FUNCS, takes pointer to an unsigned long
+- * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
+- * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
+- */
+-#define I2C_RETRIES 0x0701 /* number of times a device address should
+- be polled when not acknowledging */
+-#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
+-
+-/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
+- * are NOT supported! (due to code brokenness)
+- */
+-#define I2C_SLAVE 0x0703 /* Use this slave address */
+-#define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it
+- is already in use by a driver! */
+-#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */
+-
+-#define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */
+-
+-#define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */
+-
+-#define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */
+-#define I2C_SMBUS 0x0720 /* SMBus transfer */
+-
+-
+-/* This is the structure as used in the I2C_SMBUS ioctl call */
+-struct i2c_smbus_ioctl_data {
+- __u8 read_write;
+- __u8 command;
+- __u32 size;
+- union i2c_smbus_data *data;
+-};
+-
+-/* This is the structure as used in the I2C_RDWR ioctl call */
+-struct i2c_rdwr_ioctl_data {
+- struct i2c_msg *msgs; /* pointers to i2c_msgs */
+- __u32 nmsgs; /* number of i2c_msgs */
+-};
+-
+-#define I2C_RDRW_IOCTL_MAX_MSGS 42
+-
+-
+-#endif /* _LINUX_I2C_DEV_H */
+--
+cgit v1.1
diff --git a/poky/meta/recipes-devtools/i2c-tools/i2c-tools_4.0.bb b/poky/meta/recipes-devtools/i2c-tools/i2c-tools_4.0.bb
new file mode 100644
index 000000000..01ac47f61
--- /dev/null
+++ b/poky/meta/recipes-devtools/i2c-tools/i2c-tools_4.0.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Set of i2c tools for linux"
+HOMEPAGE = "https://i2c.wiki.kernel.org/index.php/I2C_Tools"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/utils/i2c-tools/${BP}.tar.gz \
+ file://0001-lib-Module.mk-Add-missing-dependencies.patch \
+ file://0001-tools-Module.mk-Add-missing-dependencies.patch \
+ file://0001-i2c-tools-eeprog-Module.mk-Add-missing-dependency.patch \
+ file://remove-i2c-dev.patch \
+"
+
+SRC_URI[md5sum] = "d92a288d70f306d3895e3a7e9c14c9aa"
+SRC_URI[sha256sum] = "5b60daf6f011de0acb61de57dba62f2054bb39f19961d67e0c91610f071ca403"
+
+EXTRA_OEMAKE = "bindir=${bindir} sbindir=${sbindir} \
+ incdir=${includedir} libdir=${libdir} \
+ mandir=${mandir} \
+ EXTRA=eeprog"
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${sbindir}/i2c-stub-from-dump \
+ ${bindir}/ddcmon \
+ ${bindir}/decode-edid \
+ ${bindir}/decode-dimms \
+ ${bindir}/decode-vaio \
+ "
+RDEPENDS_${PN}-misc = "${PN} perl perl-module-posix \
+ perl-module-constant perl-module-file-basename \
+ perl-module-fcntl perl-module-strict perl-module-vars \
+ "
diff --git a/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env b/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
new file mode 100755
index 000000000..64b5e2078
--- /dev/null
+++ b/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
@@ -0,0 +1,382 @@
+#! /usr/bin/env bash
+# icecc -- A simple distributed compiler system
+#
+# Copyright (C) 2004 by the Icecream Authors
+# GPL
+
+target_paths=
+target_aliases=
+
+# Always prints, optionally to a log file
+print_output ()
+{
+ if test -n "$log_path"; then
+ echo "$@" | tee -a "$log_path"
+ else
+ echo "$@"
+ fi
+}
+
+# Only prints if the debug flag is specified
+print_debug ()
+{
+ if test -n "$debug"; then
+ print_output "$@"
+ fi
+}
+
+is_dynamic_elf ()
+{
+ # Is the file an dynamically linked ELF executable?
+ (file -L "$1" | grep 'ELF' > /dev/null 2>&1) && (! file -L "$1" | grep 'static' > /dev/null 2>&1)
+}
+
+fix_rpath ()
+{
+ # Patches the RPATH for a file. When the program is executed in the chroot
+ # be iceccd, /proc is not mounted. As such, $ORIGIN can't be resolved. To
+ # work around this, replace all instances of $ORIGIN in RPATH with the
+ # known chroot path to the executables directory
+ local path="$1"
+ local origin="$2"
+ if ! is_dynamic_elf "$path"; then
+ return
+ fi
+ local old_rpath="`$PATCHELF --print-rpath "$path"`"
+ local new_rpath="`echo "$old_rpath" | \
+ sed 's/.*\[\(.*\)\]/\1/g' | \
+ sed "s,\\\$ORIGIN,/$origin,g"`"
+
+ if test -n "$new_rpath"; then
+ print_debug "Converting RPATH '$old_rpath' -> '$new_rpath'"
+ $PATCHELF --set-rpath "$new_rpath" "$path"
+ fi
+}
+
+add_path ()
+{
+ case " $target_paths " in
+ *" $1 "*)
+ return 1
+ ;;
+ *)
+ target_paths="$target_paths $1"
+ return 0
+ ;;
+ esac
+}
+
+add_alias ()
+{
+ if test "$1" != "$2"; then
+ local alias="$1=$2"
+ case " $target_aliases " in
+ *" $alias "*)
+ ;;
+ *)
+ print_debug "Adding alias '$2' -> '$1'"
+ target_aliases="$target_aliases $alias"
+ ;;
+ esac
+ fi
+}
+
+normalize_path ()
+{
+ # Normalizes the path to a file or directory, removing all "." and ".."
+ # entries. Use pwd -L to explicitly prevent symlink expansion
+ local path=$1
+ if test -f "$path"; then
+ pushd $(dirname $path) > /dev/null 2>&1
+ dir_path=$(pwd -L)
+ path=$dir_path/$(basename $path)
+ popd > /dev/null 2>&1
+ elif test -d "$path"; then
+ pushd $path > /dev/null 2>&1
+ path=$(pwd -L)
+ popd > /dev/null 2>&1
+ fi
+ echo $path
+}
+
+add_file_common()
+{
+ local p="$1"
+ local path="$2"
+ local alias="$3"
+
+ add_alias "$path" "$p"
+ if test -n "$alias"; then
+ add_alias "$path" "$alias"
+ fi
+
+ add_path "$path" || return 1
+ print_debug "Adding file '$path'"
+
+ return 0
+}
+
+add_deps()
+{
+ local path="$1"
+ local interp="$2"
+
+ if test -n "$interp" && test -x "$interp"; then
+ # Use the dynamic loaders --list argument to list the
+ # dependencies. The program may have a different program
+ # interpreter (typical when using uninative tarballs), which is
+ # why we can't just call ldd.
+ deps="`$interp --list "$path"`"
+ else
+ deps="`ldd "$path"`"
+ fi
+
+ print_debug "Dependencies are:"
+ print_debug "$deps"
+ if test -n "$deps"; then
+ for lib in $deps; do
+ # ldd now outputs ld as /lib/ld-linux.so.xx on current nptl
+ # based glibc this regexp parse the outputs like:
+ # ldd /usr/bin/gcc
+ # linux-gate.so.1 => (0xffffe000)
+ # libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000)
+ # /lib/ld-linux.so.2 (0xb7fe8000)
+ # covering both situations ( with => and without )
+ lib="`echo "$lib" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`"
+
+ test -f "$lib" || continue
+ # Check whether the same library also exists in the parent
+ # directory, and prefer that on the assumption that it is a
+ # more generic one.
+ local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
+ test -f "$baselib" && lib=$baselib
+ add_dependency "$lib" "$interp"
+ done
+ fi
+}
+
+add_dependency()
+{
+ local p=`normalize_path $1`
+ # readlink is required for Yocto, so we can use it
+ local path=`readlink -f "$p"`
+ local interp="$2"
+
+ add_file_common "$p" "$path" || return
+
+ if test -x "$path" && is_dynamic_elf "$path"; then
+ add_deps "$path" "$interp"
+ fi
+}
+
+add_file ()
+{
+ local p=`normalize_path $1`
+ # readlink is required for Yocto, so we can use it
+ local path=`readlink -f "$p"`
+
+ add_file_common "$p" "$path" "$2" || return
+
+ if test -x "$path" && is_dynamic_elf "$path"; then
+ # Request the program interpeter (dynamic loader)
+ interp=`readelf -W -l "$path" | grep "Requesting program interpreter:" | sed "s/\s*\[Requesting program interpreter:\s*\(.*\)\]/\1/g"`
+ print_debug "Interpreter is '$interp'"
+
+ add_deps "$path" "$interp"
+ fi
+}
+
+while test -n "$1"; do
+ case "$1" in
+ --respect-path)
+ # Ignore for backward compatability
+ ;;
+ --debug)
+ debug=1
+ ;;
+ --log)
+ do_log=1
+ ;;
+ --extra=*)
+ extra_tools="$extra_tools ${1#--extra=}"
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+added_gcc=$1
+shift
+added_gxx=$1
+shift
+added_as=$1
+shift
+archive_name=$1
+
+if test -n "$do_log"; then
+ log_path="$archive_name.log"
+ rm -f "$log_path"
+fi
+
+if test -z "$PATCHELF"; then
+ PATCHELF=`which patchelf 2> /dev/null`
+fi
+if test -z "$PATCHELF"; then
+ PATCHELF=`which patchelf-uninative 2> /dev/null`
+fi
+if test -z "$PATCHELF"; then
+ print_output "patchelf is required"
+ exit 1
+fi
+
+if test -z "$added_gcc" || test -z "$added_gxx" ; then
+ print_output "usage: $0 <gcc_path> <g++_path>"
+ exit 1
+fi
+
+if ! test -x "$added_gcc" ; then
+ print_output "'$added_gcc' is not executable."
+ exit 1
+fi
+
+if ! test -x "$added_gxx" ; then
+ print_output "'$added_gcc' is not executable."
+ exit 1
+fi
+
+
+
+add_file $added_gcc /usr/bin/gcc
+add_file $added_gxx /usr/bin/g++
+
+if test -z "$added_as" ; then
+ add_file /usr/bin/as /usr/bin/as
+else
+ if ! test -x "$added_as" ; then
+ print_output "'$added_as' is not executable."
+ exit 1
+ fi
+
+ add_file $added_as /usr/bin/as
+fi
+
+add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1
+add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus
+specfile=`$added_gcc -print-file-name=specs`
+if test -n "$specfile" && test -e "$specfile"; then
+ add_file "$specfile"
+fi
+
+ltofile=`$added_gcc -print-prog-name=lto1`
+pluginfile=`normalize_path "${ltofile%lto1}liblto_plugin.so"`
+if test -r "$pluginfile"
+then
+ add_file $pluginfile ${pluginfile#*usr}
+ add_file $pluginfile /usr${pluginfile#*usr}
+fi
+
+# for testing the environment is usable at all
+if test -x /bin/true; then
+ add_file /bin/true
+elif test -x /usr/bin/true; then
+ add_file /usr/bin/true /bin/true
+else
+ print_output "'true' not found"
+ exit 1
+fi
+
+for extra in $extra_tools; do
+ if test -x "$extra"; then
+ add_file "$extra"
+ else
+ print_output "'$extra' not found"
+ exit 1
+ fi
+done
+
+link_rel ()
+{
+ local target="$1"
+ local name="$2"
+ local base="$3"
+
+ local prefix=`dirname $name`
+
+ prefix=`echo $prefix | sed 's,[^/]\+,..,g' | sed 's,^/*,,g'`
+
+ ln -s $prefix/$target $base/$name
+}
+
+tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
+target_files=
+for path in $target_paths; do
+ mkdir -p $tempdir/`dirname $path`
+ cp -pH $path $tempdir/$path
+
+ if test -f $tempdir/$path -a -x $tempdir/$path; then
+ strip -s $tempdir/$path 2>/dev/null
+ fi
+
+ fix_rpath $tempdir/$path `dirname $path`
+ target_files="$target_files $path"
+done
+
+for i in $target_aliases; do
+ target=`echo $i | cut -d= -f1`
+ link_name=`echo $i | cut -d= -f2`
+
+ mkdir -p $tempdir/`dirname $link_name`
+ # Relative links are used because the files are checked for being
+ # executable outside the chroot
+ link_rel $target $link_name $tempdir
+
+ link_name=`echo $link_name | cut -b2-`
+ target_files="$target_files $link_name"
+done
+
+#sort the files
+target_files=`for i in $target_files; do echo $i; done | sort`
+
+#test if an archive name was supplied
+#if not use the md5 of all files as the archive name
+if test -z "$archive_name"; then
+ md5sum=NONE
+ for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
+ if test -x $file; then
+ md5sum=$file
+ break
+ fi
+ done
+
+ #calculate md5 and use it as the archive name
+ archive_name=`for i in $target_files; do test -f $tempdir/$i && $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'`.tar.gz || {
+ print_output "Couldn't compute MD5 sum."
+ exit 2
+ }
+ mydir=`pwd`
+else
+ mydir="`dirname "$archive_name"`"
+
+ #check if we have a full path or only a filename
+ if test "$mydir" = "." ; then
+ mydir=`pwd`
+ else
+ mydir=""
+ fi
+fi
+
+print_output "creating $archive_name"
+
+cd $tempdir
+# Add everything in the temp directory. Tar doesn't like to be given files with
+# ".." in them, which frequently happens in $target_files, and will strip off
+# the path prefix past the offending "..". This makes the archive generate
+# incorrectly
+tar -czf "$mydir/$archive_name" . || {
+ print_output "Couldn't create archive"
+ exit 3
+}
+cd ..
+rm -rf $tempdir
diff --git a/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb b/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb
new file mode 100644
index 000000000..053945ebb
--- /dev/null
+++ b/poky/meta/recipes-devtools/icecc-create-env/icecc-create-env_0.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "icecc environment setup script"
+DESCRIPTION = "This is a version of the icecc-create-env script that has \
+been modified in order to make it work with OE."
+SECTION = "base"
+# source file has just a "GPL" word, but upstream is GPLv2+.
+# most probably just GPL would be a mistake
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
+
+PR = "r2"
+
+DEPENDS = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+# This is needed, because otherwise there is dependency loop from quilt-native
+# Dependency loop #1 found:
+# Task 10907 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_install) (dependent Tasks ['quilt-native, do_compile'])
+# Task 10908 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_populate_sysroot) (dependent Tasks ['quilt-native, do_install'])
+# Task 10997 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_patch) (dependent Tasks ['icecc-create-env-native, do_unpack', 'quilt-native, do_populate_sysroot'])
+# Task 11001 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_configure) (dependent Tasks ['icecc-create-env-native, do_patch'])
+# Task 11002 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_compile) (dependent Tasks ['icecc-create-env-native, do_configure'])
+# Task 10998 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_install) (dependent Tasks ['icecc-create-env-native, do_compile'])
+# Task 10999 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_populate_sysroot) (dependent Tasks ['icecc-create-env-native, do_install'])
+# Task 10910 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_configure) (dependent Tasks ['quilt-native, do_patch', 'icecc-create-env-native, do_populate_sysroot'])
+# Task 10911 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_compile) (dependent Tasks ['quilt-native, do_configure'])
+PATCHTOOL = "patch"
+SRC_URI = "file://icecc-create-env"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/icecc-create-env ${D}/${bindir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-env.sh b/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-env.sh
new file mode 100644
index 000000000..94760076b
--- /dev/null
+++ b/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-env.sh
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (c) 2018 Joshua Watt, Garmin International,Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
+if [ -z "$ICECC_PATH" ]; then
+ ICECC_PATH=$(which icecc 2> /dev/null)
+fi
+
+if [ -n "$ICECC_PATH" ]; then
+ # Default to disabling the caret workaround. If set to "1", icecc will
+ # locally recompile any files that have warnings, which can adversely
+ # affect performance.
+ #
+ # See: https://github.com/icecc/icecream/issues/190
+ if [ -z "$ICECC_CARET_WORKAROUND" ]; then
+ ICECC_CARET_WORKAROUND="0"
+ fi
+ if [ "$ICECC_CARET_WORKAROUND" != "1" ]; then
+ CFLAGS="$CFLAGS -fno-diagnostics-show-caret"
+ CXXFLAGS="$CXXFLAGS -fno-diagnostics-show-caret"
+ fi
+ export ICECC_PATH ICECC_CARET_WORKAROUND
+ export ICECC_VERSION="$OECORE_NATIVE_SYSROOT/usr/share/icecream/@TOOLCHAIN_ENV@"
+ export ICECC="$(which ${CROSS_COMPILE}gcc)"
+ export ICECXX="$(which ${CROSS_COMPILE}g++)"
+ export ICEAS="$(which ${CROSS_COMPILE}as)"
+ export PATH="$OECORE_NATIVE_SYSROOT/usr/share/icecream/bin:$PATH"
+else
+ echo "Icecc not found. Disabling distributed compiling"
+fi
+
diff --git a/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-setup.sh b/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-setup.sh
new file mode 100644
index 000000000..048082657
--- /dev/null
+++ b/poky/meta/recipes-devtools/icecc-toolchain/icecc-toolchain/icecc-setup.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+# Copyright (c) 2018 Joshua Watt, Garmin International,Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+
+# Setup environment
+for env_setup_script in `ls $1/environment-setup-*`; do
+ . $env_setup_script
+done
+
+# ICECC_PATH will have been found icecc-env.sh
+if [ -z "$ICECC_PATH" ]; then
+ exit 0
+fi
+
+echo "Setting up IceCream distributed compiling..."
+
+# Create the environment
+mkdir -p "`dirname $ICECC_VERSION`"
+icecc-create-env $ICECC $ICECXX $ICEAS $ICECC_VERSION || exit $?
+
+# Create symbolic links
+d="$OECORE_NATIVE_SYSROOT/usr/share/icecream/bin"
+mkdir -p "$d"
+ln -s "$ICECC_PATH" "$d/${CROSS_COMPILE}gcc"
+ln -s "$ICECC_PATH" "$d/${CROSS_COMPILE}g++"
diff --git a/poky/meta/recipes-devtools/icecc-toolchain/nativesdk-icecc-toolchain_0.1.bb b/poky/meta/recipes-devtools/icecc-toolchain/nativesdk-icecc-toolchain_0.1.bb
new file mode 100644
index 000000000..9d2750e47
--- /dev/null
+++ b/poky/meta/recipes-devtools/icecc-toolchain/nativesdk-icecc-toolchain_0.1.bb
@@ -0,0 +1,38 @@
+# Copyright (c) 2018 Joshua Watt, Garmin International,Inc.
+# Released under the MIT license (see COPYING.MIT for the terms)
+SUMMARY = "Generates Icecream toolchain for SDK"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/icecc-env.sh;beginline=2;endline=20;md5=dd6b68c1efed8a9fb04e409b3b287d47"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "\
+ file://icecc-env.sh \
+ file://icecc-setup.sh \
+ "
+
+inherit nativesdk
+
+ENV_NAME="${DISTRO}-${TCLIBC}-${SDK_ARCH}-${TUNE_PKGARCH}-${DISTRO_VERSION}.tar.gz"
+
+do_compile() {
+}
+
+do_install() {
+ install -d ${D}${SDKPATHNATIVE}${datadir}/icecream/bin
+
+ install -d ${D}${SDKPATHNATIVE}/environment-setup.d/
+ install -m 0644 ${WORKDIR}/icecc-env.sh ${D}${SDKPATHNATIVE}/environment-setup.d/
+ sed -i ${D}${SDKPATHNATIVE}/environment-setup.d/icecc-env.sh \
+ -e "s,@TOOLCHAIN_ENV@,${ENV_NAME},g"
+
+ install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
+ install -m 0755 ${WORKDIR}/icecc-setup.sh ${D}${SDKPATHNATIVE}/post-relocate-setup.d/
+ sed -i ${D}${SDKPATHNATIVE}/post-relocate-setup.d/icecc-setup.sh \
+ -e "s,@TOOLCHAIN_ENV@,${ENV_NAME},g"
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${SDKPATHNATIVE}"
+RDEPENDS_${PN} += "nativesdk-icecc-create-env"
+
diff --git a/poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb b/poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
new file mode 100644
index 000000000..6b356b0d4
--- /dev/null
+++ b/poky/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Enables backwards compatibility with current desktop icon themes"
+DESCRIPTION = "A Perl script used for maintaining backwards \
+compatibility with current desktop icon themes, while migrating to the \
+names specified in the Icon Naming Specification. The Icon Naming \
+Utilities map the icon names used by the GNOME and KDE desktops to the \
+icon names proposed in the Icon Naming Specification, and generate the \
+icon files appropriate to the desktop environment you use. The Icon \
+Naming Specification provides a standard list of common icon contexts \
+and names that can be used to make icon themes work in a desktop \
+environment or application that implements the naming specification. "
+LICENSE = "GPLv2"
+DEPENDS = "libxml-simple-perl-native"
+PR = "r5"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://tango.freedesktop.org/releases/icon-naming-utils-${PV}.tar.gz"
+SRC_URI[md5sum] = "2c5c7a418e5eb3268f65e21993277fba"
+SRC_URI[sha256sum] = "044ab2199ed8c6a55ce36fd4fcd8b8021a5e21f5bab028c0a7cdcf52a5902e1c"
+
+inherit autotools allarch perlnative
+
+do_configure_append() {
+ # Make sure we use our nativeperl wrapper.
+ sed -i -e "1s:#!.*:#!/usr/bin/env nativeperl:" ${S}/icon-name-mapping.pl.in
+}
+
+FILES_${PN} += "${datadir}/dtds"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch b/poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
new file mode 100644
index 000000000..06c938b7e
--- /dev/null
+++ b/poky/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: intltool-0.40.0/intltool-extract.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-extract.in 2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-extract.in 2011-12-07 16:04:07.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
+Index: intltool-0.50.0/intltool-merge.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-merge.in 2011-10-08 17:52:01.000000000 +0300
++++ intltool-0.50.0/intltool-merge.in 2011-12-07 16:05:55.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
+Index: intltool-0.50.0/intltool-prepare.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-prepare.in 2011-10-08 09:16:58.000000000 +0300
++++ intltool-0.50.0/intltool-prepare.in 2011-12-07 16:06:13.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ # Intltool .desktop, .directory Prepare Tool
+Index: intltool-0.50.0/intltool-update.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-update.in 2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-update.in 2011-12-07 16:06:39.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+
+ #
diff --git a/poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch b/poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
new file mode 100644
index 000000000..853ee1a43
--- /dev/null
+++ b/poky/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
@@ -0,0 +1,40 @@
+In the target case, we can't check if perl exists or try running it. If we
+don't patch the code, the native perl location would be used, not the target
+which is also incorrect. We therefore disable this code and rely on the
+correct value of PERL being passed in.
+
+RP 31/8/2011
+
+Upstream-Status: Inappropriate [OE specific]
+
+diff --git a/configure.ac b/configure.ac
+index 5338a76..e709a2b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,24 +11,10 @@ AC_SUBST(pkgdatadir) dnl automake does not need this, but libtoolize does
+ aclocaldir='${datadir}'/aclocal
+ AC_SUBST(aclocaldir)
+
+-AC_PATH_PROG(PERL, perl)
+ if test -z "$PERL"; then
+- AC_MSG_ERROR([perl not found])
+-fi
+-AC_MSG_CHECKING([for perl >= 5.8.1])
+-$PERL -e "use 5.8.1;" > /dev/null 2>&1
+-if test $? -ne 0; then
+- AC_MSG_ERROR([perl 5.8.1 is required for intltool])
+-else
+- PERL_VERSION="`$PERL -e \"printf '%vd', $^V\"`"
+- AC_MSG_RESULT([$PERL_VERSION])
+-fi
+-AC_MSG_CHECKING([for XML::Parser])
+-if `$PERL -e "require XML::Parser" 2>/dev/null`; then
+- AC_MSG_RESULT([ok])
+-else
+- AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++ AC_MSG_ERROR([PERL variable not set])
+ fi
++AC_SUBST(PERL)
+ AC_PATH_PROG(BZR, bzr)
+
+
diff --git a/poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch b/poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
new file mode 100644
index 000000000..f1049e433
--- /dev/null
+++ b/poky/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
@@ -0,0 +1,57 @@
+Perl 5.22 has deprecated some regex features, which causes warnings when
+intltool-update runs:
+
+Unescaped left brace in regex is deprecated, passed through in regex; marked by
+<-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at
+/data/poky-master/tmp/sysroots/x86_64-linux/usr/bin/intltool-update line 1065.
+
+Take a patch from Debian to solve this.
+
+Upstream-Status: Submitted (https://bugs.launchpad.net/intltool/+bug/1465010)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Index: intltool-0.51.0/intltool-update.in
+===================================================================
+--- intltool-0.51.0.orig/intltool-update.in
++++ intltool-0.51.0/intltool-update.in
+@@ -1062,7 +1062,7 @@ sub SubstituteVariable
+ }
+ }
+
+- if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
++ if ($str =~ /^(.*)\$\{?([A-Z_]+)\}?(.*)$/)
+ {
+ my $rest = $3;
+ my $untouched = $1;
+@@ -1190,10 +1190,10 @@ sub FindPackageName
+ $name =~ s/\(+$//g;
+ $version =~ s/\(+$//g;
+
+- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
++ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
+ }
+
+ if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
+@@ -1219,11 +1219,11 @@ sub FindPackageName
+ $version =~ s/\(+$//g;
+ $bugurl =~ s/\(+$//g if (defined $bugurl);
+
+- $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+- $varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+- $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+- $varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+- $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
++ $varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++ $varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++ $varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++ $varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
++ $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+\}?/);
+ }
+
+ # \s makes this not work, why?
diff --git a/poky/meta/recipes-devtools/intltool/intltool/remove-perl-check.patch b/poky/meta/recipes-devtools/intltool/intltool/remove-perl-check.patch
new file mode 100644
index 000000000..5f57ea333
--- /dev/null
+++ b/poky/meta/recipes-devtools/intltool/intltool/remove-perl-check.patch
@@ -0,0 +1,45 @@
+Remove the perl checks in intltool.m4. This can find a different perl binary to
+the one that the intltool scripts will actually be using (as they hard-code a
+specific binary), for example in the intltool-native case they'll be using
+nativeperl yet this fragment can find and test the host perl.
+
+This can result in recipes failing in do_configure as intltool.m4 finds a host
+perl which doesn't have XML::Parser installed, despite the fact that intltool
+will work fine as nativeperl has XML::Parser.
+
+Upstream-Status: Submitted (https://bugs.launchpad.net/intltool/+bug/1197875)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- a/intltool.m4.orig 2013-07-02 11:22:23.000000000 -0700
++++ b/intltool.m4 2013-07-02 11:22:32.000000000 -0700
+@@ -26,1 +26,1 @@ dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
+-# serial 42 IT_PROG_INTLTOOL
++# serial 42.1 IT_PROG_INTLTOOL
+@@ -131,27 +131,6 @@ if test -z "$xgversion" -o -z "$mmversio
+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+ fi
+
+-AC_PATH_PROG(INTLTOOL_PERL, perl)
+-if test -z "$INTLTOOL_PERL"; then
+- AC_MSG_ERROR([perl not found])
+-fi
+-AC_MSG_CHECKING([for perl >= 5.8.1])
+-$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
+-if test $? -ne 0; then
+- AC_MSG_ERROR([perl 5.8.1 is required for intltool])
+-else
+- IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
+- AC_MSG_RESULT([$IT_PERL_VERSION])
+-fi
+-if test "x$2" != "xno-xml"; then
+- AC_MSG_CHECKING([for XML::Parser])
+- if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+- AC_MSG_RESULT([ok])
+- else
+- AC_MSG_ERROR([XML::Parser perl module is required for intltool])
+- fi
+-fi
+-
+ # Substitute ALL_LINGUAS so we can use it in po/Makefile
+ AC_SUBST(ALL_LINGUAS)
+
diff --git a/poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb b/poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
new file mode 100644
index 000000000..ecff2faf2
--- /dev/null
+++ b/poky/meta/recipes-devtools/intltool/intltool_0.51.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Utility scripts for internationalizing XML"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://launchpad.net/${BPN}/trunk/${PV}/+download/${BP}.tar.gz \
+ file://intltool-nowarn.patch \
+ file://perl-522-deprecations.patch \
+ file://remove-perl-check.patch \
+ file://noperlcheck.patch \
+ "
+SRC_URI[md5sum] = "12e517cac2b57a0121cda351570f1e63"
+SRC_URI[sha256sum] = "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
+
+UPSTREAM_CHECK_URI = "https://launchpad.net/intltool/trunk/"
+
+DEPENDS = "libxml-parser-perl-native"
+RDEPENDS_${PN} = "gettext-dev libxml-parser-perl"
+DEPENDS_class-native = "libxml-parser-perl-native gettext-native"
+
+inherit autotools pkgconfig perlnative
+
+export PERL = "${bindir}/env perl"
+PERL_class-native = "/usr/bin/env nativeperl"
+PERL_class-nativesdk = "/usr/bin/env perl"
+
+# gettext is assumed to exist on the host
+RDEPENDS_${PN}_class-native = "libxml-parser-perl-native"
+RRECOMMENDS_${PN} = "perl-modules"
+RRECOMMENDS_${PN}_class-native = ""
+
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal"
+
+INSANE_SKIP_${PN} += "dev-deps"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/json-c/json-c_0.13.bb b/poky/meta/recipes-devtools/json-c/json-c_0.13.bb
new file mode 100644
index 000000000..06319de32
--- /dev/null
+++ b/poky/meta/recipes-devtools/json-c/json-c_0.13.bb
@@ -0,0 +1,31 @@
+SUMMARY = "C bindings for apps which will manipulate JSON data"
+DESCRIPTION = "JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C."
+HOMEPAGE = "https://github.com/json-c/json-c/wiki"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
+
+SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+ "
+SRC_URI[md5sum] = "11fc5d90c77375e5fc8401e8b9efbf21"
+SRC_URI[sha256sum] = "0316780be9ad16c42d7c26b015a784fd5df4b0909fef0aba51cfb13e492ac24d"
+
+UPSTREAM_CHECK_REGEX = "json-c-(?P<pver>\d+(\.\d+)+).tar"
+# json-c releases page is fetching the list of releases in some weird XML format
+# from https://s3.amazonaws.com/json-c_releases and processes it with javascript :-/
+#UPSTREAM_CHECK_URI = "https://s3.amazonaws.com/json-c_releases/releases/index.html"
+RECIPE_UPSTREAM_VERSION = "0.13"
+RECIPE_UPSTREAM_DATE = "Dec 07, 2017"
+CHECK_DATE = "Jan 31, 2018"
+
+RPROVIDES_${PN} = "libjson"
+
+inherit autotools
+
+EXTRA_OECONF = "--enable-rdrand"
+
+do_configure_prepend() {
+ # Clean up autoconf cruft that should not be in the tarball
+ rm -f ${S}/config.status
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch b/poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
new file mode 100644
index 000000000..26e8b06f3
--- /dev/null
+++ b/poky/meta/recipes-devtools/libcomps/libcomps/0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch
@@ -0,0 +1,41 @@
+From ff4aae4c8beaf17cb8e7a3431f6c541eccfae244 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:22:09 +0200
+Subject: [PATCH 1/2] Do not set PYTHON_INSTALL_DIR by running python.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libcomps/src/python/src/python2/CMakeLists.txt | 2 +-
+ libcomps/src/python/src/python3/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libcomps/src/python/src/python2/CMakeLists.txt b/libcomps/src/python/src/python2/CMakeLists.txt
+index 3ad9e18..0e7dd4b 100644
+--- a/libcomps/src/python/src/python2/CMakeLists.txt
++++ b/libcomps/src/python/src/python2/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ find_package (PythonLibs 2.6)
+ find_package (PythonInterp 2.6 REQUIRED)
+
+-execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+
+ include_directories(${PYTHON_INCLUDE_PATH})
+ include_directories(${LIBCOMPS_INCLUDE_PATH})
+diff --git a/libcomps/src/python/src/python3/CMakeLists.txt b/libcomps/src/python/src/python3/CMakeLists.txt
+index 7fafa9f..ed82d3d 100644
+--- a/libcomps/src/python/src/python3/CMakeLists.txt
++++ b/libcomps/src/python/src/python3/CMakeLists.txt
+@@ -2,7 +2,7 @@ find_package (PythonLibs 3.0)
+ find_package (PythonInterp 3.0)
+ #add_custom_target(py3-copy)
+
+-execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#execute_process (COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+
+ include_directories(${PYTHON_INCLUDE_PATH})
+ include_directories(${LIBCOMPS_INCLUDE_PATH})
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch b/poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch
new file mode 100644
index 000000000..88469fb33
--- /dev/null
+++ b/poky/meta/recipes-devtools/libcomps/libcomps/0001-Make-__comps_objmrtree_all-static-inline.patch
@@ -0,0 +1,35 @@
+From 91a324f8771818b81017fdf4daaad0c8c4b6987c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 Mar 2017 11:38:54 -0700
+Subject: [PATCH] Make __comps_objmrtree_all() static inline
+
+This helps compilers to scope the symbol correctly
+and apply the inlining optimizations, clang e.g.
+emits the functions and calls in code which is
+suboptimal, therefore give a little help to compiler
+this function is not used anywhere else to have
+a global scope.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libcomps/src/comps_objmradix.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcomps/src/comps_objmradix.c b/libcomps/src/comps_objmradix.c
+index 9be6648..55f7793 100644
+--- a/libcomps/src/comps_objmradix.c
++++ b/libcomps/src/comps_objmradix.c
+@@ -604,7 +604,7 @@ inline void comps_objmrtree_pair_destroy_v(void * pair) {
+ free(pair);
+ }
+
+-inline COMPS_HSList* __comps_objmrtree_all(COMPS_ObjMRTree * rt, char keyvalpair) {
++static inline COMPS_HSList* __comps_objmrtree_all(COMPS_ObjMRTree * rt, char keyvalpair) {
+ COMPS_HSList *to_process, *ret;
+ COMPS_HSListItem *hsit, *oldit;
+ size_t x;
+--
+2.12.0
+
diff --git a/poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch b/poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch
new file mode 100644
index 000000000..dc3d97635
--- /dev/null
+++ b/poky/meta/recipes-devtools/libcomps/libcomps/0002-Set-library-installation-path-correctly.patch
@@ -0,0 +1,27 @@
+From b1f61296e2f16c2b9a39c5501e4538628ff01ab4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:26:00 +0200
+Subject: [PATCH 2/2] Set library installation path correctly
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libcomps/pull/32]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libcomps/src/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcomps/src/CMakeLists.txt b/libcomps/src/CMakeLists.txt
+index e553d77..e2eef9c 100644
+--- a/libcomps/src/CMakeLists.txt
++++ b/libcomps/src/CMakeLists.txt
+@@ -52,7 +52,7 @@ add_dependencies(libcomps src-copy)
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-set (LIB_INST_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
++set (LIB_INST_DIR ${CMAKE_INSTALL_LIBDIR})
+
+
+ install (FILES ${libcomps_HEADERS} DESTINATION include/libcomps)
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/libcomps/libcomps_git.bb b/poky/meta/recipes-devtools/libcomps/libcomps_git.bb
new file mode 100644
index 000000000..e69bf6772
--- /dev/null
+++ b/poky/meta/recipes-devtools/libcomps/libcomps_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Libcomps is alternative for yum.comps library (which is for managing rpm package groups)."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/rpm-software-management/libcomps.git \
+ file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
+ file://0002-Set-library-installation-path-correctly.patch \
+ file://0001-Make-__comps_objmrtree_all-static-inline.patch \
+ "
+
+PV = "0.1.8+git${SRCPV}"
+SRCREV = "01a4759894cccff64d2561614a58281adf5ce859"
+
+S = "${WORKDIR}/git"
+
+inherit cmake distutils3-base
+
+DEPENDS += "libxml2 expat libcheck"
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+OECMAKE_SOURCEPATH = "${S}/libcomps"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch b/poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch
new file mode 100644
index 000000000..791a32e74
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf/0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch
@@ -0,0 +1,31 @@
+From 9bb7630915c3e787732463a3e2064fe0e177101b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 24 Nov 2016 14:33:07 +0200
+Subject: [PATCH 1/4] FindGtkDoc.cmake: drop the requirement for
+ GTKDOC_SCANGOBJ_WRAPPER
+
+For some reason cmake is not able to find it when building in openembedded,
+and it's bundled with the source code anyway.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ cmake/modules/FindGtkDoc.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/modules/FindGtkDoc.cmake b/cmake/modules/FindGtkDoc.cmake
+index 92b2cc7..39f34bd 100644
+--- a/cmake/modules/FindGtkDoc.cmake
++++ b/cmake/modules/FindGtkDoc.cmake
+@@ -52,7 +52,7 @@ find_program(GTKDOC_MKHTML_EXE gtkdoc-mkhtml PATH "${GLIB_PREFIX}/bin")
+ find_program(GTKDOC_FIXXREF_EXE gtkdoc-fixxref PATH "${GLIB_PREFIX}/bin")
+
+ find_package_handle_standard_args(GtkDoc
+- REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_SCANGOBJ_WRAPPER GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE
++ REQUIRED_VARS GTKDOC_SCAN_EXE GTKDOC_SCANGOBJ_EXE GTKDOC_MKDB_EXE GTKDOC_MKHTML_EXE GTKDOC_FIXXREF_EXE
+ VERSION_VAR GtkDoc_VERSION)
+
+ # ::
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch b/poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch
new file mode 100644
index 000000000..cbd0362c8
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf/0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch
@@ -0,0 +1,30 @@
+From 2bf0666544293dcfac2f67b678e24353acdcd4e7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 7 Feb 2017 12:16:03 +0200
+Subject: [PATCH 2/2] Get parameters for both libsolv and libsolvext (libdnf is
+
+ using both)
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ca280f3..6ab9827 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -29,7 +29,7 @@ find_package (PkgConfig REQUIRED)
+ SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ PKG_CHECK_MODULES(GLIB gio-unix-2.0>=2.46.0 REQUIRED)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
+-PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv)
++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv libsolvext)
+ set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES})
+ if (ENABLE_RHSM_SUPPORT)
+ pkg_check_modules (RHSM REQUIRED librhsm)
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch b/poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch
new file mode 100644
index 000000000..7eecc3d05
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf/0002-Prefix-sysroot-path-to-introspection-tools-path.patch
@@ -0,0 +1,36 @@
+From c8211ad99ccaa4af4a75e0ba639527267fcfd69e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:17:19 +0200
+Subject: [PATCH 2/4] Prefix sysroot path to introspection tools path.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ libdnf/CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libdnf/CMakeLists.txt b/libdnf/CMakeLists.txt
+index 63f07bf..837792b 100644
+--- a/libdnf/CMakeLists.txt
++++ b/libdnf/CMakeLists.txt
+@@ -133,7 +133,7 @@ if (GOBJECT_INTROSPECTION_FOUND)
+ set(GIR_TYPELIB "${GIR_PREFIX}.typelib")
+
+ add_custom_command(OUTPUT ${GIR_XML}
+- COMMAND env CFLAGS=${CMAKE_C_FLAGS} ${GOBJECT_INTROSPECTION_1.0_G_IR_SCANNER}
++ COMMAND env CFLAGS=${CMAKE_C_FLAGS} $ENV{PKG_CONFIG_SYSROOT_DIR}${GOBJECT_INTROSPECTION_1.0_G_IR_SCANNER}
+ --namespace=Dnf
+ --nsversion=${DNF_SO_VERSION}.0
+ --library-path=${CMAKE_CURRENT_BINARY_DIR}
+@@ -153,7 +153,7 @@ if (GOBJECT_INTROSPECTION_FOUND)
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ add_custom_command(OUTPUT ${GIR_TYPELIB}
+- COMMAND ${GOBJECT_INTROSPECTION_1.0_G_IR_COMPILER}
++ COMMAND $ENV{PKG_CONFIG_SYSROOT_DIR}${GOBJECT_INTROSPECTION_1.0_G_IR_COMPILER}
+ -o ${GIR_TYPELIB}
+ ${GIR_XML}
+ DEPENDS ${GIR_XML}
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch b/poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch
new file mode 100644
index 000000000..81264094e
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf/0003-Set-the-library-installation-directory-correctly.patch
@@ -0,0 +1,29 @@
+From 8d29879fe3606c78769c1bcdddf0bcfc7191c710 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:20:01 +0200
+Subject: [PATCH 3/4] Set the library installation directory correctly.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d35f0d7..8edb627 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -62,7 +62,9 @@ ADD_DEFINITIONS(-DPACKAGE_VERSION=\\"${LIBDNF_VERSION}\\")
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET (LIB_SUFFIX "64")
+ ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+-SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++#SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
++SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
++
+
+ ADD_SUBDIRECTORY (libdnf)
+ ENABLE_TESTING()
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch b/poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch
new file mode 100644
index 000000000..6cf48a49f
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf/0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch
@@ -0,0 +1,31 @@
+From bcea5c5063a2d5f07dbe6f40aee30370fc4ba656 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:24:50 +0200
+Subject: [PATCH 1/2] Set libsolv variables with pkg-config (cmake's own module
+
+ doesn't work properly).
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/312]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8875bbf..ca280f3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -29,7 +29,8 @@ find_package (PkgConfig REQUIRED)
+ SET (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ PKG_CHECK_MODULES(GLIB gio-unix-2.0>=2.46.0 REQUIRED)
+ FIND_LIBRARY (RPMDB_LIBRARY NAMES rpmdb)
+-find_package (LibSolv 0.6.21 REQUIRED COMPONENTS ext)
++PKG_CHECK_MODULES (LIBSOLV REQUIRED libsolv)
++set(LIBSOLV_LIBRARY ${LIBSOLV_LIBRARIES})
+ if (ENABLE_RHSM_SUPPORT)
+ pkg_check_modules (RHSM REQUIRED librhsm)
+ include_directories (${RHSM_INCLUDE_DIRS})
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/libdnf/libdnf_0.11.1.bb b/poky/meta/recipes-devtools/libdnf/libdnf_0.11.1.bb
new file mode 100644
index 000000000..4fc1d6def
--- /dev/null
+++ b/poky/meta/recipes-devtools/libdnf/libdnf_0.11.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Library providing simplified C and Python API to libsolv"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/rpm-software-management/libdnf \
+ file://0001-FindGtkDoc.cmake-drop-the-requirement-for-GTKDOC_SCA.patch \
+ file://0002-Prefix-sysroot-path-to-introspection-tools-path.patch \
+ file://0003-Set-the-library-installation-directory-correctly.patch \
+ file://0004-Set-libsolv-variables-with-pkg-config-cmake-s-own-mo.patch \
+ file://0001-Get-parameters-for-both-libsolv-and-libsolvext-libdn.patch \
+ "
+
+SRCREV = "60f979bd8db651229c559c1412f1eb880257127d"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "glib-2.0 libsolv libcheck librepo rpm gtk-doc"
+
+inherit gtk-doc gobject-introspection cmake pkgconfig distutils3-base
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DWITH_MAN=OFF -DPYTHON_DESIRED=3 \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DWITH_GIR=ON', '-DWITH_GIR=OFF', d)} \
+ "
+EXTRA_OECMAKE_append_class-native = " -DWITH_GIR=OFF"
+EXTRA_OECMAKE_append_class-nativesdk = " -DWITH_GIR=OFF"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch b/poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch
new file mode 100644
index 000000000..d69deb511
--- /dev/null
+++ b/poky/meta/recipes-devtools/librepo/librepo/0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch
@@ -0,0 +1,62 @@
+From 5b6849d9d7e030c3a521b5245d86f853b0271a61 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:05:36 +0200
+Subject: [PATCH 1/2] Do not try to obtain PYTHON_INSTALL_DIR by running
+ python.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ librepo/python/python2/CMakeLists.txt | 12 ++++++------
+ librepo/python/python3/CMakeLists.txt | 12 ++++++------
+ 2 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/librepo/python/python2/CMakeLists.txt b/librepo/python/python2/CMakeLists.txt
+index 5ffbd62..90d3c22 100644
+--- a/librepo/python/python2/CMakeLists.txt
++++ b/librepo/python/python2/CMakeLists.txt
+@@ -1,11 +1,11 @@
+ FIND_PACKAGE (PythonLibs 2 )
+ FIND_PACKAGE (PythonInterp 2 REQUIRED)
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
+-from sys import stdout
+-from distutils import sysconfig
+-path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
+-stdout.write(path)"
+-OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
++#from sys import stdout
++#from distutils import sysconfig
++#path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
++#stdout.write(path)"
++#OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+
+ MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}")
+diff --git a/librepo/python/python3/CMakeLists.txt b/librepo/python/python3/CMakeLists.txt
+index 47559f7..b39adc2 100644
+--- a/librepo/python/python3/CMakeLists.txt
++++ b/librepo/python/python3/CMakeLists.txt
+@@ -10,12 +10,12 @@ message("--- ${PYTHON_INCLUDE_DIR}")
+
+ FIND_PACKAGE(PythonLibs 3.0)
+ FIND_PACKAGE(PythonInterp 3.0 REQUIRED)
+-EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
+-from sys import stdout
+-from distutils import sysconfig
+-path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
+-stdout.write(path)"
+-OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
++#EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "
++#from sys import stdout
++#from distutils import sysconfig
++#path=sysconfig.get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')
++#stdout.write(path)"
++#OUTPUT_VARIABLE PYTHON_INSTALL_DIR)
+ INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH})
+
+ MESSAGE(STATUS "Python3 install dir is ${PYTHON_INSTALL_DIR}")
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch b/poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch
new file mode 100644
index 000000000..f7d7ab3a2
--- /dev/null
+++ b/poky/meta/recipes-devtools/librepo/librepo/0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch
@@ -0,0 +1,29 @@
+From a36be8192615e2a1fb5a5856d44565277f15583b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Dec 2016 18:23:27 +0200
+Subject: [PATCH 4/4] Set gpgme variables with pkg-config, not with cmake
+ module (which doesn't work properly)
+
+Upstream-Status: Inappropriate [gpgme upstream does not have pkg-config support and is not interested in it]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ CMakeLists.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ef07d2d..f1fa09b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,7 +31,8 @@ PKG_CHECK_MODULES(GLIB2 glib-2.0 REQUIRED)
+ PKG_SEARCH_MODULE(LIBCRYPTO REQUIRED libcrypto openssl)
+ FIND_PACKAGE(EXPAT REQUIRED)
+ FIND_PACKAGE(CURL REQUIRED)
+-FIND_PACKAGE(Gpgme REQUIRED)
++PKG_CHECK_MODULES(GPGME gpgme REQUIRED)
++set(GPGME_VANILLA_LIBRARIES ${GPGME_LIBRARIES})
+ FIND_PACKAGE(Xattr REQUIRED)
+
+ INCLUDE_DIRECTORIES(${GLIB2_INCLUDE_DIRS})
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/librepo/librepo_1.8.1.bb b/poky/meta/recipes-devtools/librepo/librepo_1.8.1.bb
new file mode 100644
index 000000000..456988558
--- /dev/null
+++ b/poky/meta/recipes-devtools/librepo/librepo_1.8.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = " A library providing C and Python (libcURL like) API for downloading linux repository metadata and packages."
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/rpm-software-management/librepo.git \
+ file://0002-Do-not-try-to-obtain-PYTHON_INSTALL_DIR-by-running-p.patch \
+ file://0004-Set-gpgme-variables-with-pkg-config-not-with-cmake-m.patch \
+ "
+
+SRCREV = "7b9b7bf388f3f059529c6f50c40b30919fef30f9"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "curl expat glib-2.0 openssl attr gpgme"
+
+inherit cmake distutils3-base pkgconfig
+
+EXTRA_OECMAKE = " -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3 -DENABLE_TESTS=OFF -DENABLE_DOCS=OFF"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc
new file mode 100644
index 000000000..f307a1075
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc
@@ -0,0 +1,48 @@
+SUMMARY = "Generic library support script"
+DESCRIPTION = "This is GNU libtool, a generic library support script. \
+Libtool hides the complexity of generating special library types \
+(such as shared libraries) behind a consistent interface."
+HOMEPAGE = "http://www.gnu.org/software/libtool/libtool.html"
+SECTION = "devel"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://libltdl/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c "
+
+SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
+ file://trailingslash.patch \
+ file://rename-with-sysroot.patch \
+ file://use-sysroot-in-libpath.patch \
+ file://fix-final-rpath.patch \
+ file://fix-rpath.patch \
+ file://norm-rpath.patch \
+ file://dont-depend-on-help2man.patch \
+ file://fix-resolve-lt-sysroot.patch \
+ file://nohardcodepaths.patch \
+ file://unwind-opt-parsing.patch \
+ file://0001-libtool-Fix-support-for-NIOS2-processor.patch \
+ "
+
+SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
+SRC_URI[sha256sum] = "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3"
+
+do_compile_prepend () {
+ # Sometimes this file doesn't get rebuilt, force the issue
+ rm -f ${S}/build-aux/ltmain.sh
+ make build-aux/ltmain.sh
+ ./config.status
+}
+
+inherit autotools texinfo
+EXTRA_AUTORECONF = "--exclude=libtoolize"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_GREP=grep"
+
+DEPENDS = "libtool-native"
+
+PACKAGES =+ "libltdl"
+FILES_${PN} += "${datadir}/aclocal"
+
+FILES_${PN}-dev_remove = "${datadir}/aclocal"
+FILES_libltdl = "${libdir}/libltdl${SOLIBS}"
+
+export CONFIG_SHELL="/bin/bash"
diff --git a/poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
new file mode 100644
index 000000000..b26831046
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
@@ -0,0 +1,40 @@
+require libtool-${PV}.inc
+
+PACKAGES = ""
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+datadir = "${STAGING_DIR_TARGET}${target_datadir}"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ install -d ${D}${bindir_crossscripts}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -e 's@^\(predep_objects="\).*@\1"@' \
+ -e 's@^\(postdep_objects="\).*@\1"@' \
+ -i ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -i '/^archive_cmds=/s/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ sed -i '/^archive_expsym_cmds=/s/\-nostdlib//g' ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+ GREP='/bin/grep' SED='sed' ${S}/build-aux/inline-source libtoolize > ${D}${bindir_crossscripts}/libtoolize
+ chmod 0755 ${D}${bindir_crossscripts}/libtoolize
+ install -d ${D}${target_datadir}/libtool/build-aux/
+ install -d ${D}${target_datadir}/aclocal/
+ install -c ${S}/build-aux/compile ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/config.guess ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/config.sub ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/depcomp ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/install-sh ${D}${target_datadir}/libtool/build-aux/
+ install -c ${S}/build-aux/missing ${D}${target_datadir}/libtool/build-aux/
+ install -c -m 0644 ${S}/build-aux/ltmain.sh ${D}${target_datadir}/libtool/build-aux/
+ install -c -m 0644 ${S}/m4/*.m4 ${D}${target_datadir}/aclocal/
+}
+
+SYSROOT_DIRS += "${bindir_crossscripts} ${target_datadir}"
+
+SSTATE_SCAN_FILES += "libtoolize *-libtool"
diff --git a/poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb b/poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
new file mode 100644
index 000000000..4c5218ade
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
@@ -0,0 +1,22 @@
+require libtool-${PV}.inc
+
+DEPENDS = ""
+
+SRC_URI += "file://prefix.patch"
+
+inherit native
+
+EXTRA_OECONF = " --with-libtool-sysroot=${STAGING_DIR_NATIVE}"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${bindir}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/${HOST_SYS}-libtool
+}
diff --git a/poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch b/poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch
new file mode 100644
index 000000000..bbd36d8dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/0001-libtool-Fix-support-for-NIOS2-processor.patch
@@ -0,0 +1,68 @@
+From df2cd898e48208f26320d40c3ed6b19c75c27142 Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Thu, 17 Sep 2015 00:43:15 +0200
+Subject: [PATCH] libtool: Fix support for NIOS2 processor
+
+The name of the system contains the string "nios2". This string
+is caught by the some of the greedy checks for OS/2 in libtool,
+in particular the *os2* branches of switch statements match for
+the nios2 string, which results in incorrect behavior of libtool.
+
+This patch adds an explicit check for *nios2* before the *os2*
+checks to prevent the OS/2 check incorrectly trapping the nios2
+as well.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted
+---
+ build-aux/ltmain.in | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..4164284 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -504,6 +504,12 @@ libtool_validate_options ()
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+ case $host in
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ *nios2*)
++ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
++ ;;
+ # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+ # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+@@ -6220,6 +6226,15 @@ func_mode_link ()
+ if test -n "$library_names" &&
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
+ case $host in
++ *nios2*)
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ if test no = "$installed"; then
++ func_append notinst_deplibs " $lib"
++ need_relink=yes
++ fi
++ ;;
+ *cygwin* | *mingw* | *cegcc* | *os2*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+@@ -6290,6 +6305,11 @@ func_mode_link ()
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
++ *nios2*)
++ # For NIOS2, we want to make sure that it's not caught by the
++ # more general OS/2 check below. Otherwise, NIOS2 is the same
++ # as the default option.
++ ;;
+ *cygwin* | mingw* | *cegcc* | *os2*)
+ func_arith $current - $age
+ major=$func_arith_result
+--
+2.5.1
+
diff --git a/poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch b/poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..fd4084c85
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -404,21 +404,6 @@ $(notes_txt): $(notes_texi)
+ $(AM_V_GEN)$(MAKEINFO) -P '$(srcdir)/doc' --no-headers \
+ $(MAKEINFOFLAGS) -o '$@' '$(notes_texi)'
+
+-dist_man1_MANS = $(libtool_1) $(libtoolize_1)
+-MAINTAINERCLEANFILES += $(dist_man1_MANS)
+-update_mans = \
+- PATH=".$(PATH_SEPARATOR)$$PATH"; export PATH; \
+- $(HELP2MAN) --output='$@'
+-
+-# It's wrong to make distributed files (e.g. $(libtool_1)) rely on
+-# files created in the build tree, so instead we regenerate the
+-# manual pages if the sources for the build-tree files we want to
+-# run have changed.
+-$(libtool_1): $(ltmain_sh)
+- $(AM_V_GEN)$(update_mans) --help-option=--help-all libtool
+-$(libtoolize_1): $(libtoolize_in)
+- $(AM_V_GEN)$(update_mans) libtoolize
+-
+
+ ## ------------- ##
+ ## Installation. ##
diff --git a/poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch b/poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
new file mode 100644
index 000000000..5c9f8cc9c
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Enalbing sysroot support exposed a bug where the final library
+had an RPATH encoded into it which still pointed to the sysroot.
+This works around the issue until it gets sorted out upstream.
+
+Fix suggested by Richard Purdie <richard.purdie@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -7569,9 +7569,11 @@ EOF
+ test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
++ func_stripname '=' '' "$libdir"
++ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+- func_replace_sysroot "$libdir"
+- libdir=$func_replace_sysroot_result
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
+ else
+@@ -8301,6 +8303,10 @@ EOF
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
++ func_stripname '=' '' "$libdir"
++ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
+@@ -8352,6 +8358,10 @@ EOF
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
++ func_replace_sysroot "$libdir"
++ libdir=$func_replace_sysroot_result
++ func_stripname '=' '' "$libdir"
++ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
diff --git a/poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch b/poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
new file mode 100644
index 000000000..1bd95980c
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+This patch updates libtool.m4 (and its output) to resolve a problem
+with variable 'lt_sysroot' not being properly updated if the option
+'--with[-libtool]-sysroot' is not provided when running the 'configure'
+script for a package.
+
+I have also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
+
+Signed-off-by: Hans Beckerus <hans.beckerus at gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+---
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1225,16 +1225,21 @@ dnl lt_sysroot will always be passed unquoted. We quote it here
+ dnl in case the user passed a directory name.
+ lt_sysroot=
+ case $with_libtool_sysroot in #(
+- yes)
++ no)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++ # Treat "/" the same a an unset sysroot. It seems to be more
++ # compatible across host platforms that way!?
++ if test "$lt_sysroot" = /; then
++ lt_sysroot=
++ fi
+ fi
+ ;; #(
++ yes|''|/)
++ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+- no|'')
+- ;; #(
+ *)
+ AC_MSG_RESULT([$with_libtool_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
diff --git a/poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch b/poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
new file mode 100644
index 000000000..a2ec9473e
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
@@ -0,0 +1,65 @@
+We don't want to add RPATHS which match default linker
+search paths, they're a waste of space. This patch
+filters libtools list and removes the ones we don't need.
+
+RP 23/9/2011
+
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+Index: libtool-2.4.2/build-aux/ltmain.in
+===================================================================
+--- libtool-2.4.2.orig/build-aux/ltmain.in
++++ libtool-2.4.2/build-aux/ltmain.in
+@@ -7286,8 +7286,14 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append dep_rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append dep_rpath " $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+@@ -8019,8 +8025,14 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ rpath+=" $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+@@ -8070,8 +8082,14 @@ EOF
+ esac
+ fi
+ else
+- eval flag=\"$hardcode_libdir_flag_spec\"
+- func_append rpath " $flag"
++ # We only want to hardcode in an rpath if it isn't in the
++ # default dlsearch path.
++ case " $sys_lib_dlsearch_path " in
++ *" $libdir "*) ;;
++ *) eval flag=\"$hardcode_libdir_flag_spec\"
++ func_append rpath " $flag"
++ ;;
++ esac
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
diff --git a/poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch b/poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch
new file mode 100644
index 000000000..8f343bf43
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/fixinstall.patch
@@ -0,0 +1,102 @@
+There is no point in having "executable" binaries in the .libs
+directory linked with different rpaths to the target which
+could concivably be run on the build system when cross compiling.
+
+This patch removes the extra rpaths ($compile_rpath) so that the
+output from the "link" stage can be used on the target. We can then
+avoid having to "relink" during the install stage.
+
+This saves some build time (do_install is over 2 minutes faster for
+pulseaudio).
+
+This patch also removes an annoying "seems to be moved" warning
+which is totally bogus in the sysroot case.
+
+Upstream-Status: Inappropriate [upstream are unlikely to take a patch like this]
+
+RP 2011/11/16
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2355,7 +2355,7 @@ func_mode_install ()
+ dir=$func_dirname_result
+ func_append dir "$objdir"
+
+- if test -n "$relink_command"; then
++ if test "$fast_install" = no && test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+@@ -2394,7 +2394,7 @@ func_mode_install ()
+ shift
+
+ srcname=$realname
+- test -n "$relink_command" && srcname=${realname}T
++ test "$fast_install" = no && test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+@@ -6162,15 +6162,15 @@ func_mode_link ()
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+- case " $sys_lib_dlsearch_path " in
+- *" $absdir "*) ;;
+- *)
+- case "$compile_rpath " in
+- *" $absdir "*) ;;
+- *) func_append compile_rpath " $absdir" ;;
+- esac
+- ;;
+- esac
++ #case " $sys_lib_dlsearch_path " in
++ #*" $absdir "*) ;;
++ #*)
++ # case "$compile_rpath " in
++ # *" $absdir "*) ;;
++ # *) func_append compile_rpath " $absdir" ;;
++ # esac
++ # ;;
++ #esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+@@ -6236,15 +6236,15 @@ func_mode_link ()
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+- case " $sys_lib_dlsearch_path " in
+- *" $absdir "*) ;;
+- *)
+- case "$compile_rpath " in
+- *" $absdir "*) ;;
+- *) func_append compile_rpath " $absdir" ;;
+- esac
+- ;;
+- esac
++ #case " $sys_lib_dlsearch_path " in
++ #*" $absdir "*) ;;
++ #*)
++ # case "$compile_rpath " in
++ # *" $absdir "*) ;;
++ # *) func_append compile_rpath " $absdir" ;;
++ # esac
++ # ;;
++ #esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+@@ -6590,8 +6590,8 @@ func_mode_link ()
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+- test "$absdir" != "$libdir" && \
+- func_warning "'$deplib' seems to be moved"
++ #test "$absdir" != "$libdir" && \
++ # func_warning "'$deplib' seems to be moved"
+
+ path=-L$absdir
+ fi
diff --git a/poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch b/poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
new file mode 100644
index 000000000..fcbce7286
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
@@ -0,0 +1,29 @@
+If for example you build on a machine with /bin/grep, then restore that sstate
+onto a machine with /usr/bin/grep, things will fail. Simply don't bother
+hardcoding paths.
+
+RP 2015/2/3
+
+Upstream-Status: Inappropriate
+
+Index: libtool-2.4.5/libtoolize.in
+===================================================================
+--- libtool-2.4.5.orig/libtoolize.in
++++ libtool-2.4.5/libtoolize.in
+@@ -40,11 +40,11 @@
+
+ : ${AUTOCONF="autoconf"}
+ : ${AUTOMAKE="automake"}
+-: ${EGREP="@EGREP@"}
+-: ${FGREP="@FGREP@"}
+-: ${GREP="@GREP@"}
+-: ${LN_S="@LN_S@"}
+-: ${SED="@SED@"}
++: ${EGREP="egrep"}
++: ${FGREP="fgrep"}
++: ${GREP="grep"}
++: ${LN_S="ln -s"}
++: ${SED="sed"}
+
+
+ ## -------------------------- ##
diff --git a/poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
new file mode 100644
index 000000000..1e4c65e02
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
@@ -0,0 +1,38 @@
+libtool: normalize link paths before considering for RPATH
+
+Libtool may be passed link paths of the form "/usr/lib/../lib", which
+fool its detection code into thinking it should be included as an
+RPATH in the generated binary. Normalize before comparision.
+
+Signed-off-by: Andy Ross <andy.ross@windriver.com>
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff -ur a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in 2012-08-16 13:58:55.058900363 -0700
++++ b/build-aux/ltmain.in 2012-08-22 11:01:34.191345989 -0700
+@@ -7288,8 +7288,10 @@
+ else
+ # We only want to hardcode in an rpath if it isn't in the
+ # default dlsearch path.
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
+ case " $sys_lib_dlsearch_path " in
+- *" $libdir "*) ;;
++ *" $libdir_norm "*) ;;
+ *) eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ ;;
+@@ -8027,8 +8029,10 @@
+ else
+ # We only want to hardcode in an rpath if it isn't in the
+ # default dlsearch path.
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
+ case " $sys_lib_dlsearch_path " in
+- *" $libdir "*) ;;
++ *" $libdir_norm "*) ;;
+ *) eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath+=" $flag"
+ ;;
diff --git a/poky/meta/recipes-devtools/libtool/libtool/prefix.patch b/poky/meta/recipes-devtools/libtool/libtool/prefix.patch
new file mode 100644
index 000000000..a73df2e4a
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/prefix.patch
@@ -0,0 +1,98 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Renames "libtool" -> "${TARGET_PREFIX}libtool" which makes sure
+it can't be confused with the host libtool.
+
+Originally by: RP
+
+Updated: Date: 2010/06/28
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+It also adjusts libtool so that the header at the script is used for
+script execution and not thevalue of $SHELL. This is because many
+Makefiles change $SHELL so dash can get used to execute what is
+otherwise configured as a bash shell script. Since we don't need to
+execute scipts this way on any system I'm aware of us building upon,
+the simplest fix is just to remove $SHELL.
+
+Updated: Date: 2011/11/09
+RP
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -31,7 +31,7 @@ SUBDIRS = .
+ DIST_SUBDIRS = $(SUBDIRS)
+ EXTRA_DIST =
+
+-BUILT_SOURCES = libtool libtoolize
++BUILT_SOURCES = $(host_alias)-libtool libtoolize
+
+ CLEANFILES =
+ MOSTLYCLEANFILES =
+@@ -67,7 +67,7 @@ build_scripts = $(srcdir)/$(aux_dir)/announce-gen \
+
+ EXTRA_DIST += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
+ GNUmakefile
+-CLEANFILES += libtool libtoolize
++CLEANFILES += $(host_alias)-libtool libtoolize
+
+ ## If a file is named several times below, and especially if it
+ ## is a distributed file created during Libtool bootstrap, we
+@@ -276,7 +276,7 @@ configure_edit = $(bootstrap_edit) \
+ -e 's|@srcdir\@|$(srcdir)|g'
+
+ # The libtool distributor and the standalone libtool script.
+-bin_SCRIPTS = libtool
++bin_SCRIPTS = $(host_alias)-libtool
+
+ libtoolize: $(libtoolize_in) $(config_status)
+ $(AM_V_at)rm -f '$@'
+@@ -287,7 +287,7 @@ libtoolize: $(libtoolize_in) $(config_status)
+ # We used to do this with a 'stamp-vcl' file, but non-gmake builds
+ # would rerun configure on every invocation, so now we manually
+ # check the version numbers from the build rule when necessary.
+-libtool: $(ltmain_sh) $(config_status) $(dotversion)
++$(host_alias)-libtool: $(ltmain_sh) $(config_status) $(dotversion)
+ @$(rebuild); \
+ if test -f '$@'; then \
+ eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
+@@ -731,12 +731,12 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
+
+ BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
+ LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
+- LIBTOOL="$(abs_top_builddir)/libtool" \
++ LIBTOOL="$(abs_top_builddir)/$(host_alias)-libtool" \
+ tst_aclocaldir="$(abs_top_srcdir)/m4"
+
+ INSTALLCHECK_ENVIRONMENT = \
+ LIBTOOLIZE="$(bindir)/`echo libtoolize |$(SED) '$(program_transform_name)'`" \
+- LIBTOOL="$(bindir)/`echo libtool |$(SED) '$(program_transform_name)'`" \
++ LIBTOOL="$(bindir)/`echo $(host_alias)-libtool |$(SED) '$(program_transform_name)'`" \
+ LTDLINCL="-I$(includedir)" \
+ LIBLTDL="$(libdir)/libltdl.la" \
+ tst_aclocaldir="$(aclocaldir)"
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -86,7 +86,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS=$ltmain
+
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+
+ _LT_SETUP
+@@ -199,7 +200,7 @@ aix3*)
+ esac
+
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+
+ # All known linkers require a '.a' archive for static linking (except MSVC,
diff --git a/poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch b/poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
new file mode 100644
index 000000000..ad2b11053
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
@@ -0,0 +1,166 @@
+Upstream-Status: Pending
+
+This patch renames the --with-sysroot option to --with-libtool-sysroot
+to avoid namespace conflict with binutils, gcc and other toolchain
+components.
+
+I also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html
+
+-Khem Raj <raj.khem@gmail.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1215,28 +1215,28 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ # ----------------
+ AC_DEFUN([_LT_WITH_SYSROOT],
+ [AC_MSG_CHECKING([for sysroot])
+-AC_ARG_WITH([sysroot],
+-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
++AC_ARG_WITH([libtool-sysroot],
++[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+-[], [with_sysroot=no])
++[], [with_libtool_sysroot=no])
+
+ dnl lt_sysroot will always be passed unquoted. We quote it here
+ dnl in case the user passed a directory name.
+ lt_sysroot=
+-case $with_sysroot in #(
++case $with_libtool_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
++ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+- AC_MSG_RESULT([$with_sysroot])
++ AC_MSG_RESULT([$with_libtool_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+ esac
+diff --git a/tests/sysroot.at b/tests/sysroot.at
+--- a/tests/sysroot.at
++++ b/tests/sysroot.at
+@@ -64,7 +64,7 @@ while read file; do
+ done])
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+@@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+diff --git a/tests/testsuite b/tests/testsuite
+--- a/tests/testsuite
++++ b/tests/testsuite
+@@ -48945,7 +48945,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49694,7 +49694,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50443,7 +50443,7 @@ $at_traceon; }
+
+
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
diff --git a/poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch b/poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch
new file mode 100644
index 000000000..e8824d7db
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/trailingslash.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio)
+
+This is because libdir has a trailing slash which breaks the comparision.
+
+RP 2/1/10
+
+Merged a patch received from Gary Thomas <gary@mlbassoc.com>
+
+Date: 2010/07/12
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2356,8 +2356,15 @@ func_mode_install ()
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
++ # Strip any trailing slash from the destination.
++ func_stripname '' '/' "$libdir"
++ destlibdir=$func_stripname_result
++
++ func_stripname '' '/' "$destdir"
++ s_destdir=$func_stripname_result
++
+ # Determine the prefix the user has applied to our future dir.
+- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
++ inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
diff --git a/poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch b/poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
new file mode 100644
index 000000000..b633bc41b
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
@@ -0,0 +1,179 @@
+Cut and paste the pieces of build-aux/options-parser inline into the main
+ltmain.sh code. This removes a performance degradation caused by the
+repeated calls to func_quote_for_eval, the mechanism funclib uses
+to construct the functions used for option parsing.
+
+Upstream-Status: Submitted [Being discussed on mailing list Feb 2015]
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..0f54303 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -342,11 +342,15 @@ _LT_EOF
+ # libtool_options_prep [ARG]...
+ # -----------------------------
+ # Preparation for options parsed by libtool.
+-libtool_options_prep ()
+-{
++#libtool_options_prep ()
++#{
+ $debug_mode
+
+ # Option defaults:
++ opt_verbose=false
++ opt_warning_types=
++
++ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+@@ -382,19 +386,14 @@ libtool_options_prep ()
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+-
+- # Pass back the list of options.
+- func_quote_for_eval ${1+"$@"}
+- libtool_options_prep_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_options_prep libtool_options_prep
++#}
+
+
+ # libtool_parse_options [ARG]...
+ # ---------------------------------
+ # Provide handling for libtool specific options.
+-libtool_parse_options ()
+-{
++#libtool_parse_options ()
++#{
+ $debug_cmd
+
+ # Perform our own loop to consume as many options as possible in
+@@ -474,29 +473,90 @@ libtool_parse_options ()
+ func_append preserve_args " $_G_opt"
+ ;;
+
+- # An option not handled by this hook function:
+- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+- esac
+- done
++ --debug|-x) debug_cmd='set -x'
++ func_echo "enabling shell trace mode"
++ $debug_cmd
++ ;;
+
++ --no-warnings|--no-warning|--no-warn)
++ set dummy --warnings none ${1+"$@"}
++ shift
++ ;;
+
+- # save modified positional parameters for caller
+- func_quote_for_eval ${1+"$@"}
+- libtool_parse_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_parse_options libtool_parse_options
++ --warnings|--warning|-W)
++ test $# = 0 && func_missing_arg $_G_opt && break
++ case " $warning_categories $1" in
++ *" $1 "*)
++ # trailing space prevents matching last $1 above
++ func_append_uniq opt_warning_types " $1"
++ ;;
++ *all)
++ opt_warning_types=$warning_categories
++ ;;
++ *none)
++ opt_warning_types=none
++ warning_func=:
++ ;;
++ *error)
++ opt_warning_types=$warning_categories
++ warning_func=func_fatal_error
++ ;;
++ *)
++ func_fatal_error \
++ "unsupported warning category: '$1'"
++ ;;
++ esac
++ shift
++ ;;
++
++ --verbose|-v) opt_verbose=: ;;
++ --version) func_version ;;
++ -\?|-h) func_usage ;;
++ --help) func_help ;;
++
++ # Separate optargs to long options (plugins may need this):
++ --*=*) func_split_equals "$_G_opt"
++ set dummy "$func_split_equals_lhs" \
++ "$func_split_equals_rhs" ${1+"$@"}
++ shift
++ ;;
++
++ # Separate optargs to short options:
++ -W*)
++ func_split_short_opt "$_G_opt"
++ set dummy "$func_split_short_opt_name" \
++ "$func_split_short_opt_arg" ${1+"$@"}
++ shift
++ ;;
++
++ # Separate non-argument short options:
++ -\?*|-h*|-v*|-x*)
++ func_split_short_opt "$_G_opt"
++ set dummy "$func_split_short_opt_name" \
++ "-$func_split_short_opt_arg" ${1+"$@"}
++ shift
++ ;;
++
++ --) break ;;
++ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
++ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
++ esac
++ done
++#}
+
++# Display all warnings if -W was not given.
++test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+
+ # libtool_validate_options [ARG]...
+ # ---------------------------------
+ # Perform any sanity checks on option settings and/or unconsumed
+ # arguments.
+-libtool_validate_options ()
+-{
++#libtool_validate_options ()
++#{
+ # save first non-option argument
+ if test 0 -lt $#; then
+- nonopt=$1
++ nonopt=$_G_opt
+ shift
+ fi
+
+@@ -537,20 +597,10 @@ libtool_validate_options ()
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
++#}
+
+- # Pass back the unparsed argument list
+- func_quote_for_eval ${1+"$@"}
+- libtool_validate_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_validate_options libtool_validate_options
+-
+-
+-# Process options as early as possible so that --help and --version
+-# can return quickly.
+-func_options ${1+"$@"}
+-eval set dummy "$func_options_result"; shift
+-
+-
++# Bail if the options were screwed!
++$exit_cmd $EXIT_FAILURE
+
+ ## ----------- ##
+ ## Main. ##
diff --git a/poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch b/poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
new file mode 100644
index 000000000..6af99f327
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+When using sysroot we should append it to libdir, which is helpful in
+cross builds as the system is staged in the sysroot. For normal builds,
+i.e. when lt_sysroot is not set, it will still behave the same and add
+-L/usr/lib to the relink command.
+
+-Khem Raj <raj.khem@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -6421,7 +6421,7 @@ func_mode_link ()
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+- add_dir=-L$libdir
++ add_dir="-L$lt_sysroot$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
diff --git a/poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
new file mode 100644
index 000000000..b02620b4b
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -0,0 +1,28 @@
+require libtool-${PV}.inc
+
+RDEPENDS_${PN} += "bash"
+
+#
+# We want the results of libtool-cross preserved - don't stage anything ourselves.
+#
+SYSROOT_DIRS_BLACKLIST += " \
+ ${bindir} \
+ ${datadir}/aclocal \
+ ${datadir}/libtool/build-aux \
+"
+
+ACLOCALEXTRAPATH_class-target = ""
+
+do_install_append () {
+ sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+ -e "s@${DEBUG_PREFIX_MAP}@@g" \
+ -e 's@${STAGING_DIR_HOST}@@g' \
+ -e 's@${STAGING_DIR_NATIVE}@@g' \
+ -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+ -e 's@^\(predep_objects="\).*@\1"@' \
+ -e 's@^\(postdep_objects="\).*@\1"@' \
+ -e "s@${HOSTTOOLS_DIR}/@@g" \
+ -i ${D}${bindir}/libtool
+}
diff --git a/poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb b/poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
new file mode 100644
index 000000000..508eade32
--- /dev/null
+++ b/poky/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
@@ -0,0 +1,31 @@
+require libtool-${PV}.inc
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/libtool:"
+
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+inherit nativesdk
+
+S = "${WORKDIR}/libtool-${PV}"
+FILES_${PN} += "${datadir}/libtool/*"
+
+do_configure_prepend () {
+ # Remove any existing libtool m4 since old stale versions would break
+ # any upgrade
+ rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+ rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${bindir}/
+ install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"
+
+libtoolnativesdk_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${D}${bindir}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${bindir_crossscripts}/${HOST_SYS}-libtool
+}
diff --git a/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch b/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
new file mode 100644
index 000000000..2809e4c59
--- /dev/null
+++ b/poky/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
@@ -0,0 +1,41 @@
+From 7f7743ce233fcd735ec580c75270413493658aa6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 19 Apr 2018 18:08:31 -0700
+Subject: [PATCH] Disable generating a native llvm-config
+
+OpenEmbedded already builds this as part of llvm-native
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/llvm-config/CMakeLists.txt | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
+index 25f99cec978..c45e9b642a8 100644
+--- a/tools/llvm-config/CMakeLists.txt
++++ b/tools/llvm-config/CMakeLists.txt
+@@ -63,19 +63,3 @@ endif()
+
+ # Add the dependency on the generation step.
+ add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
+-
+-if(CMAKE_CROSSCOMPILING)
+- set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
+- set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
+-
+- add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
+- COMMAND ${CMAKE_COMMAND} --build . --target llvm-config --config $<CONFIGURATION>
+- DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
+- WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
+- COMMENT "Building native llvm-config..."
+- USES_TERMINAL)
+- add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
+- add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
+-
+- add_dependencies(llvm-config ${project}NativeLLVMConfig)
+-endif(CMAKE_CROSSCOMPILING)
+--
+2.17.0
+
diff --git a/poky/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/poky/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
new file mode 100644
index 000000000..209764c8b
--- /dev/null
+++ b/poky/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch
@@ -0,0 +1,93 @@
+From 96558c4f25d5132936014f6f2d6252cfdfdf478a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 21 May 2016 00:33:20 +0000
+Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they
+ are macros
+
+musl defines some functions as macros and not inline functions
+if this is the case then make sure to undefine them
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def
+index a461ed813b9..f9fd9faeee0 100644
+--- a/include/llvm/Analysis/TargetLibraryInfo.def
++++ b/include/llvm/Analysis/TargetLibraryInfo.def
+@@ -665,6 +665,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl")
+ TLI_DEFINE_ENUM_INTERNAL(fopen)
+ TLI_DEFINE_STRING_INTERNAL("fopen")
+ /// FILE *fopen64(const char *filename, const char *opentype)
++#ifdef fopen64
++#undef fopen64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(fopen64)
+ TLI_DEFINE_STRING_INTERNAL("fopen64")
+ /// int fprintf(FILE *stream, const char *format, ...);
+@@ -700,6 +703,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek")
+ /// int fseeko(FILE *stream, off_t offset, int whence);
+ TLI_DEFINE_ENUM_INTERNAL(fseeko)
+ TLI_DEFINE_STRING_INTERNAL("fseeko")
++#ifdef fseeko64
++#undef fseeko64
++#endif
+ /// int fseeko64(FILE *stream, off64_t offset, int whence)
+ TLI_DEFINE_ENUM_INTERNAL(fseeko64)
+ TLI_DEFINE_STRING_INTERNAL("fseeko64")
+@@ -710,6 +716,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos")
+ TLI_DEFINE_ENUM_INTERNAL(fstat)
+ TLI_DEFINE_STRING_INTERNAL("fstat")
+ /// int fstat64(int filedes, struct stat64 *buf)
++#ifdef fstat64
++#undef fstat64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(fstat64)
+ TLI_DEFINE_STRING_INTERNAL("fstat64")
+ /// int fstatvfs(int fildes, struct statvfs *buf);
+@@ -725,6 +734,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell")
+ TLI_DEFINE_ENUM_INTERNAL(ftello)
+ TLI_DEFINE_STRING_INTERNAL("ftello")
+ /// off64_t ftello64(FILE *stream)
++#ifdef ftello64
++#undef ftello64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(ftello64)
+ TLI_DEFINE_STRING_INTERNAL("ftello64")
+ /// int ftrylockfile(FILE *file);
+@@ -845,6 +857,9 @@ TLI_DEFINE_STRING_INTERNAL("logl")
+ TLI_DEFINE_ENUM_INTERNAL(lstat)
+ TLI_DEFINE_STRING_INTERNAL("lstat")
+ /// int lstat64(const char *path, struct stat64 *buf);
++#ifdef lstat64
++#undef lstat64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(lstat64)
+ TLI_DEFINE_STRING_INTERNAL("lstat64")
+ /// void *malloc(size_t size);
+@@ -1064,6 +1079,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf")
+ TLI_DEFINE_ENUM_INTERNAL(stat)
+ TLI_DEFINE_STRING_INTERNAL("stat")
+ /// int stat64(const char *path, struct stat64 *buf);
++#ifdef stat64
++#undef stat64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(stat64)
+ TLI_DEFINE_STRING_INTERNAL("stat64")
+ /// int statvfs(const char *path, struct statvfs *buf);
+@@ -1193,6 +1211,9 @@ TLI_DEFINE_STRING_INTERNAL("times")
+ TLI_DEFINE_ENUM_INTERNAL(tmpfile)
+ TLI_DEFINE_STRING_INTERNAL("tmpfile")
+ /// FILE *tmpfile64(void)
++#ifdef tmpfile64
++#undef tmpfile64
++#endif
+ TLI_DEFINE_ENUM_INTERNAL(tmpfile64)
+ TLI_DEFINE_STRING_INTERNAL("tmpfile64")
+ /// int toascii(int c);
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
new file mode 100644
index 000000000..21d2f81b5
--- /dev/null
+++ b/poky/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch
@@ -0,0 +1,39 @@
+From 2f8ea767afdaa440c6368040630e1b3ea6a0977a Mon Sep 17 00:00:00 2001
+From: Martin Kelly <mkelly@xevo.com>
+Date: Fri, 19 May 2017 00:22:57 -0700
+Subject: [PATCH 2/2] llvm: allow env override of exe path
+
+When using a native llvm-config from inside a sysroot, we need llvm-config to
+return the libraries, include directories, etc. from inside the sysroot rather
+than from the native sysroot. Thus provide an env override for calling
+llvm-config from a target sysroot.
+
+Signed-off-by: Martin Kelly <mkelly@xevo.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tools/llvm-config/llvm-config.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 08b096afb05..d8d7742744e 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -225,6 +225,13 @@ Typical components:\n\
+
+ /// \brief Compute the path to the main executable.
+ std::string GetExecutablePath(const char *Argv0) {
++ // Hack for Yocto: we need to override the root path when we are using
++ // llvm-config from within a target sysroot.
++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
++ if (Sysroot != nullptr) {
++ return Sysroot;
++ }
++
+ // This just needs to be some symbol in the binary; C++ doesn't
+ // allow taking the address of ::main however.
+ void *P = (void *)(intptr_t)GetExecutablePath;
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/llvm/llvm_git.bb b/poky/meta/recipes-devtools/llvm/llvm_git.bb
new file mode 100644
index 000000000..cb3bba6fa
--- /dev/null
+++ b/poky/meta/recipes-devtools/llvm/llvm_git.bb
@@ -0,0 +1,187 @@
+# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "The LLVM Compiler Infrastructure"
+HOMEPAGE = "http://llvm.org"
+LICENSE = "NCSA"
+SECTION = "devel"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=e825e017edc35cfd58e26116e5251771"
+
+DEPENDS = "libffi libxml2 zlib ninja-native llvm-native"
+
+RDEPENDS_${PN}_append_class-target = " ncurses-terminfo"
+
+inherit perlnative pythonnative cmake pkgconfig
+
+PROVIDES += "llvm${PV}"
+
+LLVM_RELEASE = "${PV}"
+LLVM_DIR = "llvm${LLVM_RELEASE}"
+
+SRCREV = "089d4c0c490687db6c75f1d074e99c4d42936a50"
+PV = "6.0"
+BRANCH = "release_60"
+PATCH_VERSION = "0"
+SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=${BRANCH};protocol=http \
+ file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
+ file://0002-llvm-allow-env-override-of-exe-path.patch \
+ file://0001-Disable-generating-a-native-llvm-config.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+S = "${WORKDIR}/git"
+
+LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
+def get_llvm_arch(bb, d, arch_var):
+ import re
+ a = d.getVar(arch_var)
+ if re.match('(i.86|athlon|x86.64)$', a): return 'X86'
+ elif re.match('arm$', a): return 'ARM'
+ elif re.match('armeb$', a): return 'ARM'
+ elif re.match('aarch64$', a): return 'AArch64'
+ elif re.match('aarch64_be$', a): return 'AArch64'
+ elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips'
+ elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC'
+ else:
+ raise bb.parse.SkipRecipe("Cannot map '%s' to a supported LLVM architecture" % a)
+
+def get_llvm_target_arch(bb, d):
+ return get_llvm_arch(bb, d, 'TARGET_ARCH')
+#
+# Default to build all OE-Core supported target arches (user overridable).
+#
+LLVM_TARGETS ?= "${@get_llvm_target_arch(bb, d)}"
+LLVM_TARGETS_prepend_x86 = "AMDGPU;"
+LLVM_TARGETS_prepend_x86-64 = "AMDGPU;"
+
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv4t = "arm"
+
+EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
+ -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \
+ -DLLVM_ENABLE_PIC=ON \
+ -DLLVM_BINDINGS_LIST='' \
+ -DLLVM_LINK_LLVM_DYLIB=ON \
+ -DLLVM_ENABLE_FFI=ON \
+ -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
+ -DLLVM_OPTIMIZED_TABLEGEN=ON \
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS}" \
+ -G Ninja"
+
+EXTRA_OECMAKE_append_class-target = "\
+ -DCMAKE_CROSSCOMPILING:BOOL=ON \
+ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
+ "
+
+EXTRA_OECMAKE_append_class-nativesdk = "\
+ -DCMAKE_CROSSCOMPILING:BOOL=ON \
+ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
+ "
+
+do_configure_prepend() {
+# Fix paths in llvm-config
+ sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" ${S}/tools/llvm-config/llvm-config.cpp
+ sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" ${S}/tools/llvm-config/llvm-config.cpp
+ sed -ri "s#lib/${LLVM_DIR}#${baselib}/${LLVM_DIR}#g" ${S}/tools/llvm-config/llvm-config.cpp
+}
+
+do_compile() {
+ ninja -v ${PARALLEL_MAKE}
+}
+
+do_compile_class-native() {
+ ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
+}
+
+do_install() {
+ DESTDIR=${LLVM_INSTALL_DIR} ninja -v install
+ install -D -m 0755 ${B}/bin/llvm-config ${D}${libdir}/${LLVM_DIR}/llvm-config
+
+ install -d ${D}${bindir}/${LLVM_DIR}
+ cp -r ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/
+
+ install -d ${D}${includedir}/${LLVM_DIR}
+ cp -r ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/
+
+ install -d ${D}${libdir}/${LLVM_DIR}
+
+ # The LLVM sources have "/lib" embedded and so we cannot completely rely on the ${libdir} variable
+ if [ -d ${LLVM_INSTALL_DIR}${libdir}/ ]; then
+ cp -r ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/
+ elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib ]; then
+ cp -r ${LLVM_INSTALL_DIR}${prefix}/lib/* ${D}${libdir}/${LLVM_DIR}/
+ elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib64 ]; then
+ cp -r ${LLVM_INSTALL_DIR}${prefix}/lib64/* ${D}${libdir}/${LLVM_DIR}/
+ fi
+
+ # Remove unnecessary cmake files
+ rm -rf ${D}${libdir}/${LLVM_DIR}/cmake
+
+ ln -s ${LLVM_DIR}/libLLVM-${PV}${SOLIBSDEV} ${D}${libdir}/libLLVM-${PV}${SOLIBSDEV}
+
+ # We'll have to delete the libLLVM.so due to multiple reasons...
+ rm -rf ${D}${libdir}/${LLVM_DIR}/libLLVM.so
+ rm -rf ${D}${libdir}/${LLVM_DIR}/libLTO.so
+}
+do_install_class-native() {
+ install -D -m 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen${PV}
+ install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV}
+ install -D -m 0755 ${B}/lib/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so
+}
+
+PACKAGES += "${PN}-bugpointpasses ${PN}-llvmhello"
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-staticdev = "1"
+FILES_${PN} = ""
+FILES_${PN}-staticdev = ""
+FILES_${PN}-dbg = " \
+ ${bindir}/${LLVM_DIR}/.debug \
+ ${libdir}/${LLVM_DIR}/.debug/BugpointPasses.so \
+ ${libdir}/${LLVM_DIR}/.debug/LLVMHello.so \
+ ${libdir}/${LLVM_DIR}/.debug/libLTO.so* \
+ ${libdir}/${LLVM_DIR}/.debug/llvm-config \
+ /usr/src/debug \
+"
+
+FILES_${PN}-dev = " \
+ ${bindir}/${LLVM_DIR} \
+ ${includedir}/${LLVM_DIR} \
+ ${libdir}/${LLVM_DIR}/llvm-config \
+"
+
+RRECOMMENDS_${PN}-dev += "${PN}-bugpointpasses ${PN}-llvmhello"
+
+FILES_${PN}-bugpointpasses = "\
+ ${libdir}/${LLVM_DIR}/BugpointPasses.so \
+"
+FILES_${PN} += "\
+ ${libdir}/${LLVM_DIR}/libLTO.so.* \
+"
+
+FILES_${PN}-llvmhello = "\
+ ${libdir}/${LLVM_DIR}/LLVMHello.so \
+"
+
+PACKAGES_DYNAMIC = "^libllvm${LLVM_RELEASE}-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm-${LLVM_RELEASE}.${PATCH_VERSION} += "dev-so"
+INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm-${LLVM_RELEASE} += "dev-so"
+INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm += "dev-so"
+
+python llvm_populate_packages() {
+ libdir = bb.data.expand('${libdir}', d)
+ libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d)
+ split_dbg_packages = do_split_packages(d, libllvm_libdir+'/.debug', '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s-dbg', 'Split debug package for %s', allow_dirs=True)
+ split_packages = do_split_packages(d, libdir, '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s', 'Split package for %s', allow_dirs=True, allow_links=True, recursive=True)
+ split_staticdev_packages = do_split_packages(d, libllvm_libdir, '^lib(.*)\.a$', 'libllvm${LLVM_RELEASE}-%s-staticdev', 'Split staticdev package for %s', allow_dirs=True)
+ if split_packages:
+ pn = d.getVar('PN')
+ d.appendVar('RDEPENDS_' + pn, ' '+' '.join(split_packages))
+ d.appendVar('RDEPENDS_' + pn + '-dbg', ' '+' '.join(split_dbg_packages))
+ d.appendVar('RDEPENDS_' + pn + '-staticdev', ' '+' '.join(split_staticdev_packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "llvm_populate_packages "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/m4/m4-1.4.18.inc b/poky/meta/recipes-devtools/m4/m4-1.4.18.inc
new file mode 100644
index 000000000..ee8bee446
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4-1.4.18.inc
@@ -0,0 +1,29 @@
+SUMMARY = "Traditional Unix macro processor"
+HOMEPAGE = "https://www.gnu.org/software/m4/m4.html"
+DESCRIPTION = "GNU m4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 \
+compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). \
+GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
+
+inherit autotools texinfo
+
+SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz \
+ file://ac_config_links.patch \
+ file://remove-gets.patch \
+ "
+
+SRC_URI_append_class-target = " file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "a077779db287adf4e12a035029002d28"
+SRC_URI[sha256sum] = "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab"
+
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede"
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+EXTRA_OEMAKE += "'infodir=${infodir}'"
diff --git a/poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb b/poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb
new file mode 100644
index 000000000..407ad8933
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4-native_1.4.18.bb
@@ -0,0 +1,14 @@
+require m4-${PV}.inc
+
+inherit native
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+DEPENDS += "gnu-config-native"
+
+do_configure() {
+ install -m 0644 ${STAGING_DATADIR}/gnu-config/config.sub .
+ install -m 0644 ${STAGING_DATADIR}/gnu-config/config.guess .
+ oe_runconf
+}
+
+UPSTREAM_CHECK_URI = "${GNU_MIRROR}/m4/"
diff --git a/poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/m4/m4/ac_config_links.patch b/poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
new file mode 100644
index 000000000..71edf5951
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4/ac_config_links.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [configuration]
+
+This patch fixes a build problem for m4-native experienced on Ubuntu 9.10,
+where autoconf/automake (AC_CONFIG_LINKS) ends up making GNUmakefile a
+symlink to itself.
+
+The patch comments out ac_config_links directly in configure,
+as autoreconf is not actually run for m4-native.
+
+I believe it should be safe, as GNUmakefile is actually unpacked from
+source, and what we want is to is to not touch it.
+
+Tested on x86_64_linux (Ubuntu 8.04 and 9.10).
+
+2009-11-10 Esben Haabendal <eha@doredevelopment.dk>
+
+Index: m4-1.4.18/configure
+===================================================================
+--- m4-1.4.18.orig/configure
++++ m4-1.4.18/configure
+@@ -24415,8 +24415,8 @@ $as_echo "#define GNULIB_TEST_GETTIMEOFD
+ # only, it does not matter if we skip the link with older autoconf.
+ # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+ # builds, so use a shell variable to bypass this.
+- GNUmakefile=GNUmakefile
+- ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
++ # GNUmakefile=GNUmakefile
++ # ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
+
+
+ :
diff --git a/poky/meta/recipes-devtools/m4/m4/remove-gets.patch b/poky/meta/recipes-devtools/m4/m4/remove-gets.patch
new file mode 100644
index 000000000..abe82f3b2
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4/remove-gets.patch
@@ -0,0 +1,24 @@
+eglibc has remove gets starting 2.16
+therefore check for its being there before
+undefining it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index 5727452..f04a691 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -742,10 +742,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ /* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
++#if defined gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS && !defined __cplusplus
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+ struct obstack;
diff --git a/poky/meta/recipes-devtools/m4/m4_1.4.18.bb b/poky/meta/recipes-devtools/m4/m4_1.4.18.bb
new file mode 100644
index 000000000..b12c0adf3
--- /dev/null
+++ b/poky/meta/recipes-devtools/m4/m4_1.4.18.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/make/make.inc b/poky/meta/recipes-devtools/make/make.inc
new file mode 100644
index 000000000..b8905bc6d
--- /dev/null
+++ b/poky/meta/recipes-devtools/make/make.inc
@@ -0,0 +1,15 @@
+SUMMARY = "GNU tool that controls the build process"
+DESCRIPTION = "Make is a tool which controls the generation of executables and other non-source files of a \
+program from the program's source files. Make gets its knowledge of how to build your program from a file \
+called the makefile, which lists each of the non-source files and how to compute it from other files."
+HOMEPAGE = "http://www.gnu.org/software/make/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/make/make-${PV}.tar.bz2 \
+ file://0001-glob-Do-not-assume-glibc-glob-internals.patch \
+ file://0002-glob-Do-not-assume-glibc-glob-internals.patch \
+ "
+
+inherit autotools gettext pkgconfig texinfo
+
+PROVIDES = "virtual/make"
diff --git a/poky/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch b/poky/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch
new file mode 100644
index 000000000..2b6e4d40c
--- /dev/null
+++ b/poky/meta/recipes-devtools/make/make/0001-glob-Do-not-assume-glibc-glob-internals.patch
@@ -0,0 +1,70 @@
+From c90a7dda6c572f79b8e78da44b6ebf8704edef65 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun, 24 Sep 2017 09:12:58 -0400
+Subject: [PATCH 1/2] glob: Do not assume glibc glob internals.
+
+It has been proposed that glibc glob start using gl_lstat,
+which the API allows it to do. GNU 'make' should not get in
+the way of this. See:
+https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
+
+* dir.c (local_lstat): New function, like local_stat.
+(dir_setup_glob): Use it to initialize gl_lstat too, as the API
+requires.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ dir.c | 29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/dir.c b/dir.c
+index f34bbf5..12eef30 100644
+--- a/dir.c
++++ b/dir.c
+@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
+ }
+ #endif
+
++/* Similarly for lstat. */
++#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
++# ifndef VMS
++# ifndef HAVE_SYS_STAT_H
++int lstat (const char *path, struct stat *sbuf);
++# endif
++# else
++ /* We are done with the fake lstat. Go back to the real lstat */
++# ifdef lstat
++# undef lstat
++# endif
++# endif
++# define local_lstat lstat
++#elif defined(WINDOWS32)
++/* Windows doesn't support lstat(). */
++# define local_lstat local_stat
++#else
++static int
++local_lstat (const char *path, struct stat *buf)
++{
++ int e;
++ EINTRLOOP (e, lstat (path, buf));
++ return e;
++}
++#endif
++
+ void
+ dir_setup_glob (glob_t *gl)
+ {
+ gl->gl_opendir = open_dirstream;
+ gl->gl_readdir = read_dirstream;
+ gl->gl_closedir = free;
++ gl->gl_lstat = local_lstat;
+ gl->gl_stat = local_stat;
+- /* We don't bother setting gl_lstat, since glob never calls it.
+- The slot is only there for compatibility with 4.4 BSD. */
+ }
+
+ void
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/make/make/0002-glob-Do-not-assume-glibc-glob-internals.patch b/poky/meta/recipes-devtools/make/make/0002-glob-Do-not-assume-glibc-glob-internals.patch
new file mode 100644
index 000000000..d49acd9f6
--- /dev/null
+++ b/poky/meta/recipes-devtools/make/make/0002-glob-Do-not-assume-glibc-glob-internals.patch
@@ -0,0 +1,38 @@
+From 9858702dbd1e137262c06765919937660879f63c Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun, 24 Sep 2017 09:12:58 -0400
+Subject: [PATCH 2/2] glob: Do not assume glibc glob internals.
+
+It has been proposed that glibc glob start using gl_lstat,
+which the API allows it to do. GNU 'make' should not get in
+the way of this. See:
+https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
+
+* dir.c (local_lstat): New function, like local_stat.
+(dir_setup_glob): Use it to initialize gl_lstat too, as the API
+requires.
+---
+Upstream-Status: Backport
+
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 64ec870..e87901c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -399,10 +399,9 @@ AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
+ #include <glob.h>
+ #include <fnmatch.h>
+
+-#define GLOB_INTERFACE_VERSION 1
+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
+ # include <gnu-versions.h>
+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
++if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
+ gnu glob
+ # endif
+ #endif],
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/make/make_4.2.1.bb b/poky/meta/recipes-devtools/make/make_4.2.1.bb
new file mode 100644
index 000000000..c6e6a0cd5
--- /dev/null
+++ b/poky/meta/recipes-devtools/make/make_4.2.1.bb
@@ -0,0 +1,12 @@
+LICENSE = "GPLv3 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require make.inc
+
+EXTRA_OECONF += "--without-guile"
+
+SRC_URI[md5sum] = "15b012617e7c44c0ed482721629577ac"
+SRC_URI[sha256sum] = "d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch b/poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
new file mode 100644
index 000000000..3a8902b97
--- /dev/null
+++ b/poky/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
@@ -0,0 +1,346 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff -ruN makedevs-1.0.0-orig/COPYING makedevs-1.0.0/COPYING
+--- makedevs-1.0.0-orig/COPYING 1970-01-01 08:00:00.000000000 +0800
++++ makedevs-1.0.0/COPYING 2010-12-09 16:42:20.274984665 +0800
+@@ -0,0 +1,340 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Library General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Library General
++Public License instead of this License.
diff --git a/poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c
new file mode 100644
index 000000000..cba768141
--- /dev/null
+++ b/poky/meta/recipes-devtools/makedevs/makedevs/makedevs.c
@@ -0,0 +1,589 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <time.h>
+#include <getopt.h>
+#include <libgen.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#define MINORBITS 8
+#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
+#define MAX_ID_LEN 40
+#define MAX_NAME_LEN 40
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+#define VERSION "1.0.1"
+
+/* These are all stolen from busybox's libbb to make
+ * error handling simpler (and since I maintain busybox,
+ * I'm rather partial to these for error handling).
+ * -Erik
+ */
+static const char *const app_name = "makedevs";
+static const char *const memory_exhausted = "memory exhausted";
+static char default_rootdir[]=".";
+static char *rootdir = default_rootdir;
+static int trace = 0;
+
+struct name_id {
+ char name[MAX_NAME_LEN+1];
+ unsigned long id;
+ struct name_id *next;
+};
+
+static struct name_id *usr_list = NULL;
+static struct name_id *grp_list = NULL;
+
+static void verror_msg(const char *s, va_list p)
+{
+ fflush(stdout);
+ fprintf(stderr, "%s: ", app_name);
+ vfprintf(stderr, s, p);
+}
+
+static void error_msg_and_die(const char *s, ...)
+{
+ va_list p;
+
+ va_start(p, s);
+ verror_msg(s, p);
+ va_end(p);
+ putc('\n', stderr);
+ exit(EXIT_FAILURE);
+}
+
+static void vperror_msg(const char *s, va_list p)
+{
+ int err = errno;
+
+ if (s == 0)
+ s = "";
+ verror_msg(s, p);
+ if (*s)
+ s = ": ";
+ fprintf(stderr, "%s%s\n", s, strerror(err));
+}
+
+static void perror_msg_and_die(const char *s, ...)
+{
+ va_list p;
+
+ va_start(p, s);
+ vperror_msg(s, p);
+ va_end(p);
+ exit(EXIT_FAILURE);
+}
+
+static FILE *xfopen(const char *path, const char *mode)
+{
+ FILE *fp;
+
+ if ((fp = fopen(path, mode)) == NULL)
+ perror_msg_and_die("%s", path);
+ return fp;
+}
+
+static char *xstrdup(const char *s)
+{
+ char *t;
+
+ if (s == NULL)
+ return NULL;
+
+ t = strdup(s);
+
+ if (t == NULL)
+ error_msg_and_die(memory_exhausted);
+
+ return t;
+}
+
+static struct name_id* alloc_node(void)
+{
+ struct name_id *node;
+ node = (struct name_id*)malloc(sizeof(struct name_id));
+ if (node == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+ memset((void *)node->name, 0, MAX_NAME_LEN+1);
+ node->id = 0xffffffff;
+ node->next = NULL;
+ return node;
+}
+
+static struct name_id* parse_line(char *line)
+{
+ char *p;
+ int i;
+ char id_buf[MAX_ID_LEN+1];
+ struct name_id *node;
+ node = alloc_node();
+ p = line;
+ i = 0;
+ // Get name field
+ while (*p != ':') {
+ if (i > MAX_NAME_LEN)
+ error_msg_and_die("Name field too long");
+ node->name[i++] = *p++;
+ }
+ node->name[i] = '\0';
+ p++;
+ // Skip the second field
+ while (*p != ':')
+ p++;
+ p++;
+ // Get id field
+ i = 0;
+ while (*p != ':') {
+ if (i > MAX_ID_LEN)
+ error_msg_and_die("ID filed too long");
+ id_buf[i++] = *p++;
+ }
+ id_buf[i] = '\0';
+ node->id = atol(id_buf);
+ return node;
+}
+
+static void get_list_from_file(FILE *file, struct name_id **plist)
+{
+ char *line;
+ int len = 0;
+ size_t length = 256;
+ struct name_id *node, *cur;
+
+ if((line = (char *)malloc(length)) == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+
+ while ((len = getline(&line, &length, file)) != -1) {
+ node = parse_line(line);
+ if (*plist == NULL) {
+ *plist = node;
+ cur = *plist;
+ } else {
+ cur->next = node;
+ cur = cur->next;
+ }
+ }
+
+ if (line)
+ free(line);
+}
+
+static unsigned long convert2guid(char *id_buf, struct name_id *search_list)
+{
+ char *p;
+ int isnum;
+ struct name_id *node;
+ p = id_buf;
+ isnum = 1;
+ while (*p != '\0') {
+ if (!isdigit(*p)) {
+ isnum = 0;
+ break;
+ }
+ p++;
+ }
+ if (isnum) {
+ // Check for bad user/group name
+ node = search_list;
+ while (node != NULL) {
+ if (!strncmp(node->name, id_buf, strlen(id_buf))) {
+ fprintf(stderr, "WARNING: Bad user/group name %s detected\n", id_buf);
+ break;
+ }
+ node = node->next;
+ }
+ return (unsigned long)atol(id_buf);
+ } else {
+ node = search_list;
+ while (node != NULL) {
+ if (!strncmp(node->name, id_buf, strlen(id_buf)))
+ return node->id;
+ node = node->next;
+ }
+ error_msg_and_die("No entry for %s in search list", id_buf);
+ }
+}
+
+static void free_list(struct name_id *list)
+{
+ struct name_id *cur;
+ cur = list;
+ while (cur != NULL) {
+ list = cur;
+ cur = cur->next;
+ free(list);
+ }
+}
+
+static void add_new_directory(char *name, char *path,
+ unsigned long uid, unsigned long gid, unsigned long mode)
+{
+ if (trace)
+ fprintf(stderr, "Directory: %s %s UID: %ld GID %ld MODE: %04lo", path, name, uid, gid, mode);
+
+ if (mkdir(path, mode) < 0) {
+ if (EEXIST == errno) {
+ /* Unconditionally apply the mode setting to the existing directory.
+ * XXX should output something when trace */
+ chmod(path, mode & ~S_IFMT);
+ }
+ }
+ if (trace)
+ putc('\n', stderr);
+ chown(path, uid, gid);
+}
+
+static void add_new_device(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode, dev_t rdev)
+{
+ int status;
+ struct stat sb;
+
+ if (trace) {
+ fprintf(stderr, "Device: %s %s UID: %ld GID: %ld MODE: %04lo MAJOR: %d MINOR: %d",
+ path, name, uid, gid, mode, (short)(rdev >> 8), (short)(rdev & 0xff));
+ }
+
+ memset(&sb, 0, sizeof(struct stat));
+ status = lstat(path, &sb);
+ if (status >= 0) {
+ /* It is ok for some types of files to not exit on disk (such as
+ * device nodes), but if they _do_ exist, the file type bits had
+ * better match those of the actual file or strange things will happen... */
+ if ((mode & S_IFMT) != (sb.st_mode & S_IFMT)) {
+ if (trace)
+ putc('\n', stderr);
+ error_msg_and_die("%s: existing file (04%o) type does not match specified file type (04%lo)!",
+ path, (sb.st_mode & S_IFMT), (mode & S_IFMT));
+ }
+ if (mode != sb.st_mode) {
+ if (trace)
+ fprintf(stderr, " -- applying new mode 04%lo (old was 04%o)\n", mode & ~S_IFMT, sb.st_mode & ~S_IFMT);
+ /* Apply the mode setting to the existing device node */
+ chmod(path, mode & ~S_IFMT);
+ }
+ else {
+ if (trace)
+ fprintf(stderr, " -- extraneous entry in table\n", path);
+ }
+ }
+ else {
+ mknod(path, mode, rdev);
+ if (trace)
+ putc('\n', stderr);
+
+ }
+
+ chown(path, uid, gid);
+}
+
+static void add_new_file(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode)
+{
+ if (trace) {
+ fprintf(stderr, "File: %s %s UID: %ld GID: %ld MODE: %04lo\n",
+ path, name, gid, uid, mode);
+ }
+
+ int fd = open(path,O_CREAT | O_WRONLY, mode);
+ if (fd < 0) {
+ error_msg_and_die("%s: file can not be created!", path);
+ } else {
+ close(fd);
+ }
+ chmod(path, mode);
+ chown(path, uid, gid);
+}
+
+
+static void add_new_fifo(char *name, char *path, unsigned long uid,
+ unsigned long gid, unsigned long mode)
+{
+ if (trace) {
+ printf("Fifo: %s %s UID: %ld GID: %ld MODE: %04lo\n",
+ path, name, gid, uid, mode);
+ }
+
+ int status;
+ struct stat sb;
+
+ memset(&sb, 0, sizeof(struct stat));
+ status = stat(path, &sb);
+
+
+ /* Update the mode if we exist and are a fifo already */
+ if (status >= 0 && S_ISFIFO(sb.st_mode)) {
+ chmod(path, mode);
+ } else {
+ if (mknod(path, mode, 0))
+ error_msg_and_die("%s: file can not be created with mknod!", path);
+ }
+ chown(path, uid, gid);
+}
+
+
+/* device table entries take the form of:
+ <path> <type> <mode> <usr> <grp> <major> <minor> <start> <inc> <count>
+ /dev/mem c 640 0 0 1 1 0 0 -
+ /dev/zero c 644 root root 1 5 - - -
+
+ type can be one of:
+ f A regular file
+ d Directory
+ c Character special device file
+ b Block special device file
+ p Fifo (named pipe)
+
+ I don't bother with symlinks (permissions are irrelevant), hard
+ links (special cases of regular files), or sockets (why bother).
+
+ Regular files must exist in the target root directory. If a char,
+ block, fifo, or directory does not exist, it will be created.
+*/
+static int interpret_table_entry(char *line)
+{
+ char *name;
+ char usr_buf[MAX_ID_LEN];
+ char grp_buf[MAX_ID_LEN];
+ char path[4096], type;
+ unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
+ unsigned long start = 0, increment = 1, count = 0;
+
+ if (0 > sscanf(line, "%4095s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
+ &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
+ &increment, &count))
+ {
+ fprintf(stderr, "%s: sscanf returned < 0 for line '%s'\n", app_name, line);
+ return 1;
+ }
+
+ uid = convert2guid(usr_buf, usr_list);
+ gid = convert2guid(grp_buf, grp_list);
+
+ if (strncmp(path, "/", 1)) {
+ error_msg_and_die("Device table entries require absolute paths");
+ }
+ name = xstrdup(path + 1);
+ /* prefix path with rootdir */
+ sprintf(path, "%s/%s", rootdir, name);
+
+ /* XXX Why is name passed into all of the add_new_*() routines? */
+ switch (type) {
+ case 'd':
+ mode |= S_IFDIR;
+ add_new_directory(name, path, uid, gid, mode);
+ break;
+ case 'f':
+ mode |= S_IFREG;
+ add_new_file(name, path, uid, gid, mode);
+ break;
+ case 'p':
+ mode |= S_IFIFO;
+ add_new_fifo(name, path, uid, gid, mode);
+ break;
+ case 'c':
+ case 'b':
+ mode |= (type == 'c') ? S_IFCHR : S_IFBLK;
+ if (count > 0) {
+ int i;
+ dev_t rdev;
+ char buf[80];
+
+ for (i = start; i < start + count; i++) {
+ sprintf(buf, "%s%d", name, i);
+ sprintf(path, "%s/%s%d", rootdir, name, i);
+ /* FIXME: MKDEV uses illicit insider knowledge of kernel
+ * major/minor representation... */
+ rdev = MKDEV(major, minor + (i - start) * increment);
+ sprintf(path, "%s/%s\0", rootdir, buf);
+ add_new_device(buf, path, uid, gid, mode, rdev);
+ }
+ } else {
+ /* FIXME: MKDEV uses illicit insider knowledge of kernel
+ * major/minor representation... */
+ dev_t rdev = MKDEV(major, minor);
+ add_new_device(name, path, uid, gid, mode, rdev);
+ }
+ break;
+ default:
+ error_msg_and_die("Unsupported file type");
+ }
+ if (name) free(name);
+ return 0;
+}
+
+
+static void parse_device_table(FILE * file)
+{
+ char *line;
+ size_t length = 256;
+ int len = 0;
+
+ if((line = (char *)malloc(length)) == NULL) {
+ error_msg_and_die(memory_exhausted);
+ }
+ /* Looks ok so far. The general plan now is to read in one
+ * line at a time, trim off leading and trailing whitespace,
+ * check for leading comment delimiters ('#') or a blank line,
+ * then try and parse the line as a device table entry. If we fail
+ * to parse things, try and help the poor fool to fix their
+ * device table with a useful error msg... */
+
+ while ((len = getline(&line, &length, file)) != -1) {
+ /* First trim off any whitespace */
+
+ /* trim trailing whitespace */
+ while (len > 0 && isspace(line[len - 1]))
+ line[--len] = '\0';
+
+ /* trim leading whitespace */
+ memmove(line, &line[strspn(line, " \n\r\t\v")], len + 1);
+
+ /* If this is NOT a comment or an empty line, try to interpret it */
+ if (*line != '#' && *line != '\0') interpret_table_entry(line);
+ }
+
+ if (line)
+ free(line);
+}
+
+static int parse_devtable(FILE * devtable)
+{
+ struct stat sb;
+
+ if (lstat(rootdir, &sb)) {
+ perror_msg_and_die("%s", rootdir);
+ }
+ if (chdir(rootdir))
+ perror_msg_and_die("%s", rootdir);
+
+ if (devtable)
+ parse_device_table(devtable);
+
+ return 0;
+}
+
+
+static struct option long_options[] = {
+ {"root", 1, NULL, 'r'},
+ {"help", 0, NULL, 'h'},
+ {"trace", 0, NULL, 't'},
+ {"version", 0, NULL, 'v'},
+ {"devtable", 1, NULL, 'D'},
+ {NULL, 0, NULL, 0}
+};
+
+static char *helptext =
+ "Usage: makedevs [OPTIONS]\n"
+ "Build entries based upon device_table.txt\n\n"
+ "Options:\n"
+ " -r, -d, --root=DIR Build filesystem from directory DIR (default: cwd)\n"
+ " -D, --devtable=FILE Use the named FILE as a device table file\n"
+ " -h, --help Display this help text\n"
+ " -t, --trace Be verbose\n"
+ " -v, --version Display version information\n\n";
+
+
+int main(int argc, char **argv)
+{
+ int c, opt;
+ extern char *optarg;
+ struct stat statbuf;
+ char passwd_path[PATH_MAX];
+ char group_path[PATH_MAX];
+ FILE *passwd_file = NULL;
+ FILE *group_file = NULL;
+ FILE *devtable = NULL;
+ DIR *dir = NULL;
+
+ umask (0);
+
+ if (argc==1) {
+ fputs( helptext , stderr );
+ exit(1);
+ }
+
+ while ((opt = getopt_long(argc, argv, "D:d:r:htv",
+ long_options, &c)) >= 0) {
+ switch (opt) {
+ case 'D':
+ devtable = xfopen(optarg, "r");
+ if (fstat(fileno(devtable), &statbuf) < 0)
+ perror_msg_and_die(optarg);
+ if (statbuf.st_size < 10)
+ error_msg_and_die("%s: not a proper device table file", optarg);
+ break;
+ case 'h':
+ puts(helptext);
+ exit(0);
+ case 'r':
+ case 'd': /* for compatibility with mkfs.jffs, genext2fs, etc... */
+ if (rootdir != default_rootdir) {
+ error_msg_and_die("root directory specified more than once");
+ }
+ if ((dir = opendir(optarg)) == NULL) {
+ perror_msg_and_die(optarg);
+ } else {
+ closedir(dir);
+ }
+ /* If "/" is specified, use "" because rootdir is always prepended to a
+ * string that starts with "/" */
+ if (0 == strcmp(optarg, "/"))
+ rootdir = xstrdup("");
+ else
+ rootdir = xstrdup(optarg);
+ break;
+
+ case 't':
+ trace = 1;
+ break;
+
+ case 'v':
+ printf("%s: %s\n", app_name, VERSION);
+ exit(0);
+ default:
+ fputs(helptext,stderr);
+ exit(1);
+ }
+ }
+
+ if (argv[optind] != NULL) {
+ fputs(helptext,stderr);
+ exit(1);
+ }
+
+ // Get name-id mapping
+ sprintf(passwd_path, "%s/etc/passwd", rootdir);
+ sprintf(group_path, "%s/etc/group", rootdir);
+ if ((passwd_file = fopen(passwd_path, "r")) != NULL) {
+ get_list_from_file(passwd_file, &usr_list);
+ fclose(passwd_file);
+ }
+ if ((group_file = fopen(group_path, "r")) != NULL) {
+ get_list_from_file(group_file, &grp_list);
+ fclose(group_file);
+ }
+
+ // Parse devtable
+ if(devtable) {
+ parse_devtable(devtable);
+ fclose(devtable);
+ }
+
+ // Free list
+ free_list(usr_list);
+ free_list(grp_list);
+
+ return 0;
+}
diff --git a/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb b/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
new file mode 100644
index 000000000..92d5870f4
--- /dev/null
+++ b/poky/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Tool for creating device nodes"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+SECTION = "base"
+SRC_URI = "file://makedevs.c \
+ file://COPYING.patch"
+
+S = "${WORKDIR}"
+
+FILES_${PN}_append_class-nativesdk = " ${datadir}"
+
+do_compile() {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${S}/makedevs ${S}/makedevs.c
+}
+
+do_install() {
+ install -d ${D}${base_sbindir}
+ install -m 0755 ${S}/makedevs ${D}${base_sbindir}/makedevs
+}
+
+do_install_append_class-nativesdk() {
+ install -d ${D}${datadir}
+ install -m 644 ${COREBASE}/meta/files/device_table-minimal.txt ${D}${datadir}/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch b/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch
new file mode 100644
index 000000000..97778c32e
--- /dev/null
+++ b/poky/meta/recipes-devtools/meson/meson/0001-Linker-rules-move-cross_args-in-front-of-output_args.patch
@@ -0,0 +1,30 @@
+From 4676224dbdff0f7107e8cbdbe0eab19c855f1454 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 17 Nov 2017 13:18:28 +0200
+Subject: [PATCH] Linker rules: move {cross_args} in front of {output_args}
+
+The previous order was found to break linking in some cases
+(e.g. when -no-pic -fno-PIC was present in {cross_args}.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ mesonbuild/backend/ninjabackend.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
+index bb281e1..969b70e 100644
+--- a/mesonbuild/backend/ninjabackend.py
++++ b/mesonbuild/backend/ninjabackend.py
+@@ -1501,7 +1501,7 @@ int dummy;
+ rspfile_content = $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing
+ '''
+ else:
+- command_template = ' command = {executable} $ARGS {output_args} $in $LINK_ARGS {cross_args} $aliasing\n'
++ command_template = ' command = {executable} $ARGS {cross_args} {output_args} $in $LINK_ARGS $aliasing\n'
+ command = command_template.format(
+ executable=' '.join(compiler.get_linker_exelist()),
+ cross_args=' '.join(cross_args),
+--
+2.15.0
+
diff --git a/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch b/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
new file mode 100644
index 000000000..1912e9435
--- /dev/null
+++ b/poky/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
@@ -0,0 +1,113 @@
+From c5692cac9c555664281377a82bf8b1e46934f437 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 4 Aug 2017 16:16:41 +0300
+Subject: [PATCH 1/3] gtkdoc: fix issues that arise when cross-compiling
+
+Specifically:
+1) Make it possible to specify a wrapper for executing binaries
+(usually, some kind of target hardware emulator, such as qemu)
+2) Explicitly provide CC and LD via command line, as otherwise gtk-doc will
+try to guess them, incorrectly.
+3) If things break down, print the full command with arguments,
+not just the binary name.
+4) Correctly determine the compiler/linker executables and cross-options when cross-compiling
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ mesonbuild/modules/gnome.py | 18 +++++++++++++++---
+ mesonbuild/scripts/gtkdochelper.py | 9 +++++++--
+ 2 files changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index 56765a5..4f7fe30 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -769,6 +769,10 @@ This will become a hard error in the future.''')
+ '--mode=' + mode]
+ if namespace:
+ args.append('--namespace=' + namespace)
++ gtkdoc_exe_wrapper = state.environment.cross_info.config["properties"].get('gtkdoc_exe_wrapper', None)
++ if gtkdoc_exe_wrapper is not None:
++ args.append('--gtkdoc-exe-wrapper=' + gtkdoc_exe_wrapper)
++
+ args += self._unpack_args('--htmlargs=', 'html_args', kwargs)
+ args += self._unpack_args('--scanargs=', 'scan_args', kwargs)
+ args += self._unpack_args('--scanobjsargs=', 'scanobjs_args', kwargs)
+@@ -796,14 +800,22 @@ This will become a hard error in the future.''')
+ raise MesonException(
+ 'Gir include dirs should be include_directories().')
+ cflags.update(get_include_args(inc_dirs))
++
++ cross_c_args = " ".join(state.environment.cross_info.config["properties"].get('c_args', ""))
++ cross_link_args = " ".join(state.environment.cross_info.config["properties"].get('c_link_args', ""))
++
+ if cflags:
+- args += ['--cflags=%s' % ' '.join(cflags)]
++ args += ['--cflags=%s %s' % (cross_c_args,' '.join(cflags))]
+ if ldflags:
+- args += ['--ldflags=%s' % ' '.join(ldflags)]
++ args += ['--ldflags=%s %s' % (cross_link_args, ' '.join(ldflags))]
+ compiler = state.environment.coredata.compilers.get('c')
+- if compiler:
++ cross_compiler = state.environment.coredata.cross_compilers.get('c')
++ if compiler and not state.environment.is_cross_build():
+ args += ['--cc=%s' % ' '.join(compiler.get_exelist())]
+ args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())]
++ elif cross_compiler and state.environment.is_cross_build():
++ args += ['--cc=%s' % ' '.join(cross_compiler.get_exelist())]
++ args += ['--ld=%s' % ' '.join(cross_compiler.get_linker_exelist())]
+
+ return args
+
+diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
+index 4406b28..b846827 100644
+--- a/mesonbuild/scripts/gtkdochelper.py
++++ b/mesonbuild/scripts/gtkdochelper.py
+@@ -44,13 +44,14 @@ parser.add_argument('--ignore-headers', dest='ignore_headers', default='')
+ parser.add_argument('--namespace', dest='namespace', default='')
+ parser.add_argument('--mode', dest='mode', default='')
+ parser.add_argument('--installdir', dest='install_dir')
++parser.add_argument('--gtkdoc-exe-wrapper', dest='gtkdoc_exe_wrapper')
+
+ def gtkdoc_run_check(cmd, cwd):
+ # Put stderr into stdout since we want to print it out anyway.
+ # This preserves the order of messages.
+ p, out = Popen_safe(cmd, cwd=cwd, stderr=subprocess.STDOUT)[0:2]
+ if p.returncode != 0:
+- err_msg = ["{!r} failed with status {:d}".format(cmd[0], p.returncode)]
++ err_msg = ["{!r} failed with status {:d}".format(cmd, p.returncode)]
+ if out:
+ err_msg.append(out)
+ raise MesonException('\n'.join(err_msg))
+@@ -58,7 +59,7 @@ def gtkdoc_run_check(cmd, cwd):
+ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
+ main_file, module,
+ html_args, scan_args, fixxref_args, mkdb_args,
+- gobject_typesfile, scanobjs_args, ld, cc, ldflags, cflags,
++ gobject_typesfile, scanobjs_args, gtkdoc_exe_wrapper, ld, cc, ldflags, cflags,
+ html_assets, content_files, ignore_headers, namespace,
+ expand_content_files, mode):
+ print("Building documentation for %s" % module)
+@@ -111,6 +112,9 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
+ if gobject_typesfile:
+ scanobjs_cmd = ['gtkdoc-scangobj'] + scanobjs_args + ['--types=' + gobject_typesfile,
+ '--module=' + module,
++ '--run=' + gtkdoc_exe_wrapper,
++ '--cc=' + cc,
++ '--ld=' + ld,
+ '--cflags=' + cflags,
+ '--ldflags=' + ldflags,
+ '--ld=' + ld]
+@@ -207,6 +211,7 @@ def run(args):
+ mkdbargs,
+ options.gobject_typesfile,
+ scanobjsargs,
++ options.gtkdoc_exe_wrapper,
+ options.ld,
+ options.cc,
+ options.ldflags,
+--
+2.15.0
+
diff --git a/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch b/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch
new file mode 100644
index 000000000..ded42d14f
--- /dev/null
+++ b/poky/meta/recipes-devtools/meson/meson/0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch
@@ -0,0 +1,42 @@
+From 972667e0d789a6969a5d79249404f3539f891810 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 4 Aug 2017 16:18:47 +0300
+Subject: [PATCH 1/2] gobject-introspection: determine g-ir-scanner and
+ g-ir-compiler paths from pkgconfig
+
+Do not hardcode the name of those binaries; gobject-introspection
+provides them via pkgconfig, and they can be set to something else
+(for example when cross-compiling).
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ mesonbuild/modules/gnome.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
+index 4f7fe30..9610cf6 100644
+--- a/mesonbuild/modules/gnome.py
++++ b/mesonbuild/modules/gnome.py
+@@ -390,8 +390,6 @@ class GnomeModule(ExtensionModule):
+ raise MesonException('Gir takes one argument')
+ if kwargs.get('install_dir'):
+ raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
+- giscanner = find_program('g-ir-scanner', 'Gir')
+- gicompiler = find_program('g-ir-compiler', 'Gir')
+ girtarget = args[0]
+ while hasattr(girtarget, 'held_object'):
+ girtarget = girtarget.held_object
+@@ -402,6 +400,8 @@ class GnomeModule(ExtensionModule):
+ self.gir_dep = PkgConfigDependency('gobject-introspection-1.0',
+ state.environment,
+ {'native': True})
++ giscanner = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
++ gicompiler = os.environ['PKG_CONFIG_SYSROOT_DIR'] + self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
+ pkgargs = self.gir_dep.get_compile_args()
+ except Exception:
+ raise MesonException('gobject-introspection dependency was not found, gir cannot be generated.')
+--
+2.15.0
+
diff --git a/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch b/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch
new file mode 100644
index 000000000..af5e6a190
--- /dev/null
+++ b/poky/meta/recipes-devtools/meson/meson/0003-native_bindir.patch
@@ -0,0 +1,114 @@
+From ffa72eac56558aa4171dd70ac1e9c27a07338fa2 Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Date: Wed, 15 Nov 2017 15:05:01 +0100
+Subject: [PATCH 4/4] native_bindir
+
+Some libraries, like QT, have pre-processors that convert their input
+files into something that the cross-compiler can process. We find the
+path of those pre-processors via pkg-config-native instead of
+pkg-config.
+
+This path forces the use of pkg-config-native for host_bins arguments.
+
+There are some discussions upstream to merge this patch, but I presonaly believe
+that is is OE only. https://github.com/mesonbuild/meson/issues/1849#issuecomment-303730323
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+
+---
+ mesonbuild/dependencies/base.py | 16 ++++++++++------
+ mesonbuild/dependencies/ui.py | 6 +++---
+ 2 files changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
+index bf79bc5..c9fd08c 100644
+--- a/mesonbuild/dependencies/base.py
++++ b/mesonbuild/dependencies/base.py
+@@ -131,7 +131,7 @@ class Dependency:
+ def need_threads(self):
+ return False
+
+- def get_pkgconfig_variable(self, variable_name, kwargs):
++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
+ raise DependencyException('{!r} is not a pkgconfig dependency'.format(self.name))
+
+ def get_configtool_variable(self, variable_name):
+@@ -150,7 +150,7 @@ class InternalDependency(Dependency):
+ self.sources = sources
+ self.ext_deps = ext_deps
+
+- def get_pkgconfig_variable(self, variable_name, kwargs):
++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
+ raise DependencyException('Method "get_pkgconfig_variable()" is '
+ 'invalid for an internal dependency')
+
+@@ -425,10 +425,14 @@ class PkgConfigDependency(ExternalDependency):
+ return s.format(self.__class__.__name__, self.name, self.is_found,
+ self.version_reqs)
+
+- def _call_pkgbin(self, args, env=None):
++ def _call_pkgbin(self, args, env=None, use_native=False):
+ if not env:
+ env = os.environ
+- p, out = Popen_safe([self.pkgbin] + args, env=env)[0:2]
++ if use_native:
++ pkgbin = [self.pkgbin + "-native"]
++ else:
++ pkgbin = [self.pkgbin]
++ p, out = Popen_safe(pkgbin + args, env=env)[0:2]
+ return p.returncode, out.strip()
+
+ def _convert_mingw_paths(self, args):
+@@ -522,7 +526,7 @@ class PkgConfigDependency(ExternalDependency):
+ # linkers such as MSVC, so prepend them.
+ self.link_args = ['-L' + lp for lp in libpaths] + self.link_args
+
+- def get_pkgconfig_variable(self, variable_name, kwargs):
++ def get_pkgconfig_variable(self, variable_name, kwargs, use_native=False):
+ options = ['--variable=' + variable_name, self.name]
+
+ if 'define_variable' in kwargs:
+@@ -535,7 +539,7 @@ class PkgConfigDependency(ExternalDependency):
+
+ options = ['--define-variable=' + '='.join(definition)] + options
+
+- ret, out = self._call_pkgbin(options)
++ ret, out = self._call_pkgbin(options, use_native=use_native)
+ variable = ''
+ if ret != 0:
+ if self.required:
+diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
+index 1db518c..4ed1d04 100644
+--- a/mesonbuild/dependencies/ui.py
++++ b/mesonbuild/dependencies/ui.py
+@@ -239,7 +239,7 @@ class QtBaseDependency(ExternalDependency):
+ self.bindir = self.get_pkgconfig_host_bins(core)
+ if not self.bindir:
+ # If exec_prefix is not defined, the pkg-config file is broken
+- prefix = core.get_pkgconfig_variable('exec_prefix', {})
++ prefix = core.get_pkgconfig_variable('exec_prefix', {}, use_native=True)
+ if prefix:
+ self.bindir = os.path.join(prefix, 'bin')
+
+@@ -359,7 +359,7 @@ class Qt4Dependency(QtBaseDependency):
+ applications = ['moc', 'uic', 'rcc', 'lupdate', 'lrelease']
+ for application in applications:
+ try:
+- return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}))
++ return os.path.dirname(core.get_pkgconfig_variable('%s_location' % application, {}, use_native=True))
+ except MesonException:
+ pass
+
+@@ -369,7 +369,7 @@ class Qt5Dependency(QtBaseDependency):
+ QtBaseDependency.__init__(self, 'qt5', env, kwargs)
+
+ def get_pkgconfig_host_bins(self, core):
+- return core.get_pkgconfig_variable('host_bins', {})
++ return core.get_pkgconfig_variable('host_bins', {}, use_native=True)
+
+
+ # There are three different ways of depending on SDL2:
+--
+2.15.1
+
diff --git a/poky/meta/recipes-devtools/meson/meson_0.44.1.bb b/poky/meta/recipes-devtools/meson/meson_0.44.1.bb
new file mode 100644
index 000000000..6a81dab26
--- /dev/null
+++ b/poky/meta/recipes-devtools/meson/meson_0.44.1.bb
@@ -0,0 +1,21 @@
+HOMEPAGE = "http://mesonbuild.com"
+SUMMARY = "A high performance build system"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/${BP}.tar.gz \
+ file://0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch \
+ file://0002-gobject-introspection-determine-g-ir-scanner-and-g-i.patch \
+ file://0001-Linker-rules-move-cross_args-in-front-of-output_args.patch \
+ file://0003-native_bindir.patch \
+ "
+SRC_URI[md5sum] = "82b1198bf714b5a4da84bfe8376c79cc"
+SRC_URI[sha256sum] = "2ea1a721574adb23160b6481191bcc1173f374e02b0ff3bb0ae85d988d97e4fa"
+UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
+
+inherit setuptools3
+
+RDEPENDS_${PN} = "ninja python3-core python3-modules"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch b/poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
new file mode 100644
index 000000000..422af1042
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
@@ -0,0 +1,19 @@
+Get the version of mklibs by simpler means. The MKLIBS_VERSION string in the
+configure.ac file is replaced with real version string by the
+do_configure_prepend() function from the recipe .bb file.
+
+Upstream-Status: Inappropriate [configuration]
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/24
+
+Index: mklibs/configure.ac
+===================================================================
+--- mklibs.orig/configure.ac 2010-02-21 17:34:56.000000000 -0800
++++ mklibs/configure.ac 2011-01-24 18:52:19.943242079 -0800
+@@ -1,4 +1,4 @@
+-AC_INIT([mklibs],m4_esyscmd(dpkg-parsechangelog | perl -ne 'print $1 if m/^Version: (.*)$/;'))
++AC_INIT([mklibs], MKLIBS_VERSION)
+ AM_INIT_AUTOMAKE([foreign no-define])
+ AC_CONFIG_HEADERS([config.h])
+ AM_MAINTAINER_MODE
diff --git a/poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch b/poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
new file mode 100644
index 000000000..17d9af4de
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
@@ -0,0 +1,103 @@
+From dcb45256970b15b672d0004533826c94083356e5 Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 17 Apr 2015 14:48:20 +0800
+Subject: [PATCH 4/6] avoid failure on symbol provided by application
+
+Upstream-Status: Pending
+
+Undefined symbols in a library can be provided by the application
+that links to the library, such as `logsink' in libmultipath.so.0.
+This fix checks the type of object in which the symbol is needed
+and the existence of the symbol in application, when a symbol
+cannot be provided by libraries. It prevents false alarm on absence
+of symbols.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+
+---
+ src/mklibs | 28 ++++++++++++++++++++++++----
+ 1 file changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index a3533c0..66b7a09 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -133,9 +133,9 @@ class Symbol(object):
+ return '@'.join(ret)
+
+ class UndefinedSymbol(Symbol):
+- def __init__(self, name, weak, version, library):
++ def __init__(self, name, weak, version, library, object):
+ super(UndefinedSymbol, self).__init__(name, version, library)
+- self.weak, self.library = weak, library
++ self.weak, self.library, self.object = weak, library, object
+
+ def symbol_is_blacklisted(name):
+ # The ARM Embedded ABI spec states symbols under this namespace as
+@@ -152,6 +152,11 @@ def undefined_symbols(obj):
+
+ output = command("mklibs-readelf", "--print-symbols-undefined", obj)
+
++ if len(obj) > len(dest_path) and obj[:len(dest_path)] == dest_path:
++ object = obj[len(dest_path) + 1:-len('-so-stripped')]
++ else:
++ object = obj
++
+ result = []
+ for line in output:
+ name, weak_string, version_string, library_string = line.split()[:4]
+@@ -171,7 +176,7 @@ def undefined_symbols(obj):
+ if library_string.lower() != 'none':
+ library = library_string
+
+- result.append(UndefinedSymbol(name, weak, version, library))
++ result.append(UndefinedSymbol(name, weak, version, library, object))
+
+ return result
+
+@@ -498,12 +503,13 @@ while 1:
+ and re.search("^ps_", str(symbol)))
+ and not (re.search("ld-linux.so.3$", str(symbol)))
+ and not (re.search("^__gnu_local_gp", str(symbol)))):
+- debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s" % (symbol, symbol.weak))
++ debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s, for %s" % (symbol, symbol.weak, obj))
+ needed_symbols[str(symbol)] = symbol
+ libraries.update(library_depends(obj))
+
+ # calculate what symbols are present in small_libs and available_libs
+ present_symbols = {}
++ present_symbol_progs = {}
+ checked_libs = small_libs
+ checked_libs.extend(available_libs)
+ checked_libs.append(sysroot + ldlib)
+@@ -513,6 +519,12 @@ while 1:
+ names = symbol.base_names()
+ for name in names:
+ present_symbols[name] = symbol
++ if not so_pattern.match(lib):
++ debug(DEBUG_SPAM, "present_symbol_progs adding %s, from executable %s" % (' '.join(names), lib))
++ for name in names:
++ progs = present_symbol_progs.get(name, set())
++ progs.add(lib)
++ present_symbol_progs[name] = progs
+
+ # are we finished?
+ num_unresolved = 0
+@@ -568,6 +580,14 @@ while 1:
+ for name in needed_symbols:
+ if not name in symbol_provider:
+ if not needed_symbols[name].weak:
++ # WORKAROUND: Undefined symbols in a library can be provided by the application
++ # that links to the library. So if the object which requires the symbol is a library
++ # and some application can provide the symbol, the undefined symbol is skipped.
++ symbol = needed_symbols[name]
++ if so_pattern.match(symbol.object) and present_symbol_progs.get(name, None):
++ debug(DEBUG_SPAM, "symbol %s in library %s is provided by executable %s" \
++ % (name, symbol.object, ' '.join(present_symbol_progs[name])))
++ continue
+ raise Exception("No library provides non-weak %s" % name)
+ else:
+ lib = symbol_provider[name]
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch b/poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
new file mode 100644
index 000000000..d27a48916
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
@@ -0,0 +1,26 @@
+The libc6-dev in Ubuntu 9.04 is so old that the elf.h doesn't
+define STT_GNU_IFUNC, so we have to define it ourselves.
+
+Upstream-Status: Inappropriate [other] - old release specific, maybe removable
+
+-- Dexuan Cui (dexuan.cui@intel.com) Feb 16, 2011.
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 2444c39..56d93f8 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -6,6 +6,14 @@
+ #include <vector>
+
+ #include <elf.h>
++/*
++ * The /usr/include/elf.h in some distributions(like Ubuntu 9.04) doesn't
++ * define the macro. We need to define it here.
++ */
++#ifndef STT_GNU_IFUNC
++#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */
++#endif
++
+ #include <getopt.h>
+
+ #include "elf.hpp"
diff --git a/poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
new file mode 100644
index 000000000..13e4606b8
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
@@ -0,0 +1,81 @@
+Remove dependency on dpkg
+
+Upstream-Status: Submitted
+
+Asking the host OS whether it supports multiarch is not useful
+in a cross-compilation environment, or if the user has specified
+a libdir explicitly. So this patch, based on the work of Mentor
+Graphics, removes mklibs's dependency on dpkg package.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+ src/mklibs | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index d9b784b..c5614ea 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -261,6 +261,11 @@ def extract_soname(so_file):
+ return ""
+
+ def multiarch(paths):
++ # Asking the host OS whether it supports multiarch is not useful
++ # in a cross-compilation environment, or if the user has specified
++ # a libdir explicitly.
++ if sysroot != "" or libdir != "":
++ return paths
+ devnull = open('/dev/null', 'w')
+ dpkg_architecture = subprocess.Popen(
+ ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
+@@ -340,7 +345,7 @@ lib_path = []
+ dest_path = "DEST"
+ ldlib = "LDLIB"
+ include_default_lib_path = "yes"
+-default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
++default_lib_path = ["/lib/", "/usr/lib/", "/usr/X11R6/lib/"]
+ libc_extras_dir = "/usr/lib/libc_pic"
+ libc_extras_dir_default = True
+ libdir = "lib"
+@@ -386,7 +391,7 @@ for opt, arg in optlist:
+ elif opt == "--libdir":
+ libdir = arg
+ elif opt in ("--help", "-h"):
+- usage(0)
++ usage(0)
+ sys.exit(0)
+ elif opt in ("--version", "-V"):
+ version(vers)
+@@ -395,6 +400,7 @@ for opt, arg in optlist:
+ print "WARNING: unknown option: " + opt + "\targ: " + arg
+
+ if include_default_lib_path == "yes":
++ default_lib_path = multiarch(default_lib_path)
+ lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path])
+
+ if libc_extras_dir_default:
+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)
+ ld_full_path = "../" + ldlib
+ ld_file = find_lib(ld_file_name)
+
+-if ld_path_name != "/lib":
+- if os.access(dest_path + "/" + ld_file_name, os.F_OK):
+- os.remove(dest_path + "/" + ld_file_name)
++#if ld_path_name != "/lib":
++# if os.access(dest_path + "/" + ld_file_name, os.F_OK):
++# os.remove(dest_path + "/" + ld_file_name)
+
+-if not os.path.exists(dest_path + "/../" + ld_path_name):
+- os.mkdir(dest_path + "/../" + ld_path_name)
++#if not os.path.exists(dest_path + "/../" + ld_path_name):
++# os.mkdir(dest_path + "/../" + ld_path_name)
+
+-if not os.access(dest_path + "/" + ld_full_path, os.F_OK):
+- debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path)
++if not os.access(dest_path + "/" + ld_file_name, os.F_OK):
++ debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name)
+ command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
+- ld_file, dest_path + "/" + ld_full_path)
++ ld_file, dest_path + "/" + ld_file_name)
+
+-os.chmod(dest_path + "/" + ld_full_path, 0755)
++os.chmod(dest_path + "/" + ld_file_name, 0755)
diff --git a/poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
new file mode 100644
index 000000000..bc56593e6
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
@@ -0,0 +1,34 @@
+From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Wed, 15 Apr 2015 14:00:06 +0800
+Subject: [PATCH] Show GNU unique symbols as provided symbols
+
+Upstream-Status: Submitted
+
+GNU Unique symbol is a GNU extension employed by new version of GCC
+by default. Even Standard C++ library in GCC 4.9 provides some symbols,
+such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead
+of ELF standard weak binding.
+This patch adds support of this new binding type to mklibs-readelf.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ src/mklibs-readelf/main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 56d93f8..0134530 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -88,7 +88,7 @@ static void process_symbols_provided (const Elf::section_type<Elf::section_type_
+ uint8_t type = symbol->get_type ();
+ const std::string &name = symbol->get_name_string ();
+
+- if (bind != STB_GLOBAL && bind != STB_WEAK)
++ if (bind != STB_GLOBAL && bind != STB_WEAK && bind != STB_GNU_UNIQUE)
+ continue;
+ if (shndx == SHN_UNDEF || shndx == SHN_ABS)
+ continue;
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch b/poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
new file mode 100644
index 000000000..75500a029
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
@@ -0,0 +1,18 @@
+In cross builds we will have to respect sysroot
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mklibs-0.1.39/src/mklibs
+===================================================================
+--- mklibs-0.1.39.orig/src/mklibs 2014-03-01 18:25:36.000000000 +0000
++++ mklibs-0.1.39/src/mklibs 2014-10-19 00:51:46.813534596 +0000
+@@ -495,7 +495,7 @@
+ present_symbols = {}
+ checked_libs = small_libs
+ checked_libs.extend(available_libs)
+- checked_libs.append(ldlib)
++ checked_libs.append(sysroot + ldlib)
+ for lib in checked_libs:
+ for symbol in provided_symbols(lib):
+ debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
diff --git a/poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb b/poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb
new file mode 100644
index 000000000..a16147657
--- /dev/null
+++ b/poky/meta/recipes-devtools/mklibs/mklibs-native_0.1.43.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Shared library optimisation tool"
+DESCRIPTION = "mklibs produces cut-down shared libraries that contain only the routines required by a particular set of executables."
+HOMEPAGE = "https://launchpad.net/mklibs"
+SECTION = "devel"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20161123T152011Z/pool/main/m/mklibs/mklibs_${PV}.tar.xz \
+ file://ac_init_fix.patch\
+ file://fix_STT_GNU_IFUNC.patch\
+ file://sysrooted-ldso.patch \
+ file://avoid-failure-on-symbol-provided-by-application.patch \
+ file://show-GNU-unique-symbols-as-provided-symbols.patch \
+ file://fix_cross_compile.patch \
+"
+
+SRC_URI[md5sum] = "39b08a173454e5210ab3f598e94179bf"
+SRC_URI[sha256sum] = "6f0cf24ade13fff76e943c003413d85c3e497c984c95c1ecea1c9731ca86f13c"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/m/mklibs/"
+
+inherit autotools gettext native
+
+S = "${WORKDIR}/mklibs"
diff --git a/poky/meta/recipes-devtools/mmc/mmc-utils/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch b/poky/meta/recipes-devtools/mmc/mmc-utils/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch
new file mode 100644
index 000000000..62e25fde9
--- /dev/null
+++ b/poky/meta/recipes-devtools/mmc/mmc-utils/0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch
@@ -0,0 +1,36 @@
+From 175ac0f362bf6121c3537e2f1760ad41c8f81367 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 29 Mar 2018 01:04:57 -0700
+Subject: [PATCH] lsmmc: replace strncpy with memmove on overlapping memory
+ copy
+
+here source and destination addresses are overlapping so using memmove is
+going to be more efficient.
+
+Additionally, the bounded size for copy is overflowing for first copy
+
+In function 'strncpy',
+ inlined from 'read_file' at lsmmc.c:356:3:
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/mmc-utils/0.1-r0/recipe-sysroot/usr/include/bits/string_fortified.h:106:10: error: '__builtin_strncpy' accessing 4096 bytes at offsets 0 and 1 overlaps 4095 bytes at offset 1 [-Werror=restrict]
+ return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://patchwork.kernel.org/patch/10314723/]
+ lsmmc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lsmmc.c b/lsmmc.c
+index c4faa00..bcb854d 100644
+--- a/lsmmc.c
++++ b/lsmmc.c
+@@ -353,7 +353,7 @@ char *read_file(char *name)
+ line[strlen(line) - 1] = '\0';
+
+ while (isspace(line[0]))
+- strncpy(&line[0], &line[1], sizeof(line));
++ memmove(&line[0], &line[1], sizeof(line)-1);
+
+ return strdup(line);
+ }
diff --git a/poky/meta/recipes-devtools/mmc/mmc-utils_git.bb b/poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
new file mode 100644
index 000000000..37a475523
--- /dev/null
+++ b/poky/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Userspace tools for MMC/SD devices"
+HOMEPAGE = "http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mmc.c;beginline=1;endline=20;md5=fae32792e20f4d27ade1c5a762d16b7d"
+
+SRCBRANCH ?= "master"
+SRCREV = "b4fe0c8c0e57a74c01755fa9362703b60d7ee49d"
+
+PV = "0.1"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${SRCBRANCH} \
+ file://0001-lsmmc-replace-strncpy-with-memmove-on-overlapping-me.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn32 = " -D__SANE_USERSPACE_TYPES__"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 mmc ${D}${bindir}
+}
diff --git a/poky/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch b/poky/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
new file mode 100644
index 000000000..4ece56b9c
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtd/mtd-utils/0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch
@@ -0,0 +1,92 @@
+From 0f833ac73ad631248826386e2918d8571ecf0347 Mon Sep 17 00:00:00 2001
+From: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Date: Sat, 9 Jun 2018 16:45:22 +0200
+Subject: [PATCH] Revert "Return correct error number in ubi_get_vol_info1"
+
+This reverts commit dede98ffb706676309488d7cc660f569548d5930.
+
+The original commit tried to fix a descrepancy between the implementation
+and the documentation by making the implementation comply.
+
+When making the change, it was overlooked, that ubinfo and ubirename were
+written against the implementation instead of the behaviour specified by
+the documentation. So were further internal functions like
+ubi_get_vol_info1_nm which further breaks ubirmvol.
+
+A report with an outline of a resulting problem can be read on
+the mailing list:
+
+http://lists.infradead.org/pipermail/linux-mtd/2018-June/081562.html
+
+From the report:
+
+steps to reproduce: have mtd-utils 2.0.1 or 2.0.2
+
+0. make a bunch of ubi volumes in sequential order
+
+ubimkvol /dev/ubi0 -s 64KiB -N test1
+ubimkvol /dev/ubi0 -s 64KiB -N test2
+ubimkvol /dev/ubi0 -s 64KiB -N test3
+ubimkvol /dev/ubi0 -s 64KiB -N test4
+..
+
+1. delete the test1 volume, making a hole in the volume table
+
+ubirmvol /dev/ubi0 -N test1
+
+2. try an affected tool (i.e. "ubirmvol /dev/ubi0 -N test4" )
+
+ |root at mr24:/# ubirmvol /dev/ubi0 -N test4
+ |ubirmvol: error!: cannot find UBI volume "test4"
+ | error 19 (No such device)
+
+or "ubinfo -a"
+
+ | root at mr24:/# ubinfo -a
+ | UBI version: 1
+ | Count of UBI devices: 1
+ | UBI control device major/minor: 10:59
+ | Present UBI devices: ubi0
+ |
+ | ubi0
+ | Volumes count: 11
+ | Logical eraseblock size: 15872 bytes, 15.5 KiB
+ | Total amount of logical eraseblocks: 1952 (30982144 bytes, 29.5 MiB)
+ | Amount of available logical eraseblocks: 75 (1190400 bytes, 1.1 MiB)
+ | Maximum count of volumes 92
+ | Count of bad physical eraseblocks: 0
+ | Count of reserved physical eraseblocks: 40
+ | Current maximum erase counter value: 984
+ | Minimum input/output unit size: 512 bytes
+ | Character device major/minor: 251:0
+ | ubinfo: error!: libubi failed to probe volume 5 on ubi0
+ | error 19 (No such device)
+ | Present volumes: 0, 1, 2, 3, 4root at mr24:/#
+
+Reported-by: Christian Lamparter <chunkeey@gmail.com>
+Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
+Upstream-Status: Accepted [http://git.infradead.org/mtd-utils.git/commit/0f833ac73ad631248826386e2918d8571ecf0347]
+---
+ lib/libubi.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/lib/libubi.c b/lib/libubi.c
+index b50e68a..978b433 100644
+--- a/lib/libubi.c
++++ b/lib/libubi.c
+@@ -1240,11 +1240,8 @@ int ubi_get_vol_info1(libubi_t desc, int dev_num, int vol_id,
+ info->dev_num = dev_num;
+ info->vol_id = vol_id;
+
+- if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor)) {
+- if (errno == ENOENT)
+- errno = ENODEV;
++ if (vol_get_major(lib, dev_num, vol_id, &info->major, &info->minor))
+ return -1;
+- }
+
+ ret = vol_read_data(lib->vol_type, dev_num, vol_id, buf, 50);
+ if (ret < 0)
+--
+2.14.4
+
diff --git a/poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
new file mode 100644
index 000000000..5d874d981
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -0,0 +1,105 @@
+Upstream-Status: Pending
+
+Index: git/jffsX-utils/mkfs.jffs2.c
+===================================================================
+--- git.orig/jffsX-utils/mkfs.jffs2.c
++++ git/jffsX-utils/mkfs.jffs2.c
+@@ -100,6 +100,11 @@ struct filesystem_entry {
+ struct rb_node hardlink_rb;
+ };
+
++struct ignorepath_entry {
++ struct ignorepath_entry* next; /* Points to the next ignorepath element */
++ char name[PATH_MAX]; /* Name of the entry */
++};
++static struct ignorepath_entry* ignorepath = 0;
+ struct rb_root hardlinks;
+ static int out_fd = -1;
+ static int in_fd = -1;
+@@ -309,7 +314,7 @@ static struct filesystem_entry *recursiv
+ char *hpath, *tpath;
+ struct dirent *dp, **namelist;
+ struct filesystem_entry *entry;
+-
++ struct ignorepath_entry* element = ignorepath;
+
+ if (lstat(hostpath, &sb)) {
+ sys_errmsg_die("%s", hostpath);
+@@ -318,6 +323,15 @@ static struct filesystem_entry *recursiv
+ entry = add_host_filesystem_entry(targetpath, hostpath,
+ sb.st_uid, sb.st_gid, sb.st_mode, 0, parent);
+
++ while ( element ) {
++ if ( strcmp( element->name, targetpath ) == 0 ) {
++ printf( "Note: ignoring directories below '%s'\n", targetpath );
++ return entry;
++ break;
++ }
++ element = element->next;
++ }
++
+ n = scandir(hostpath, &namelist, 0, alphasort);
+ if (n < 0) {
+ sys_errmsg_die("opening directory %s", hostpath);
+@@ -1359,6 +1373,7 @@ static struct option long_options[] = {
+ {"root", 1, NULL, 'r'},
+ {"pagesize", 1, NULL, 's'},
+ {"eraseblock", 1, NULL, 'e'},
++ {"ignore", 1, NULL, 'I'},
+ {"output", 1, NULL, 'o'},
+ {"help", 0, NULL, 'h'},
+ {"verbose", 0, NULL, 'v'},
+@@ -1409,6 +1424,7 @@ static const char helptext[] =
+ " -L, --list-compressors Show the list of the available compressors\n"
+ " -t, --test-compression Call decompress and compare with the original (for test)\n"
+ " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n"
++" -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n"
+ " -o, --output=FILE Output to FILE (default: stdout)\n"
+ " -l, --little-endian Create a little-endian filesystem\n"
+ " -b, --big-endian Create a big-endian filesystem\n"
+@@ -1566,6 +1582,7 @@ int main(int argc, char **argv)
+ char *compr_name = NULL;
+ int compr_prior = -1;
+ int warn_page_size = 0;
++ struct ignorepath_entry* element = ignorepath;
+
+ page_size = sysconf(_SC_PAGESIZE);
+ if (page_size < 0) /* System doesn't know so ... */
+@@ -1576,7 +1593,7 @@ int main(int argc, char **argv)
+ jffs2_compressors_init();
+
+ while ((opt = getopt_long(argc, argv,
+- "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
++ "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
+ {
+ switch (opt) {
+ case 'D':
+@@ -1600,6 +1617,28 @@ int main(int argc, char **argv)
+ warn_page_size = 0; /* set by user, so don't need to warn */
+ break;
+
++ case 'I':
++ printf( "Note: Adding '%s' to ignore Path\n", optarg );
++ element = ignorepath;
++ if ( !ignorepath ) {
++ ignorepath = xmalloc( sizeof( struct ignorepath_entry ) );
++ ignorepath->next = 0;
++ strcpy( &ignorepath->name[0], optarg );
++ } else {
++ while ( element->next ) element = element->next;
++ element->next = xmalloc( sizeof( struct ignorepath_entry ) );
++ element->next->next = 0;
++ strcpy( &element->next->name[0], optarg );
++ }
++ printf( "--------- Dumping ignore path list ----------------\n" );
++ element = ignorepath;
++ while ( element ) {
++ printf( " * '%s'\n", &element->name[0] );
++ element = element->next;
++ }
++ printf( "---------------------------------------------------\n" );
++ break;
++
+ case 'o':
+ if (out_fd != -1) {
+ errmsg_die("output filename specified more than once");
diff --git a/poky/meta/recipes-devtools/mtd/mtd-utils_git.bb b/poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
new file mode 100644
index 000000000..69f2eba1f
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Tools for managing memory technology devices"
+HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+
+inherit autotools pkgconfig update-alternatives
+
+DEPENDS = "zlib lzo e2fsprogs util-linux"
+RDEPENDS_mtd-utils-tests += "bash"
+
+PV = "2.0.1+${SRCPV}"
+
+SRCREV = "9c6173559f95e939e66efb2ec3193d6f3618cf69"
+SRC_URI = "git://git.infradead.org/mtd-utils.git \
+ file://add-exclusion-to-mkfs-jffs2-git-2.patch \
+ file://0001-Revert-Return-correct-error-number-in-ubi_get_vol_in.patch \
+"
+
+S = "${WORKDIR}/git/"
+
+EXTRA_OECONF += "--enable-install-tests"
+
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+CPPFLAGS_append_riscv64 = " -pthread -D_REENTRANT"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
+
+# Use higher priority than corresponding BusyBox-provided applets
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "flashcp flash_eraseall flash_lock flash_unlock nanddump nandwrite"
+ALTERNATIVE_${PN}-ubifs = "ubiattach ubidetach ubimkvol ubirename ubirmvol ubirsvol ubiupdatevol"
+
+ALTERNATIVE_LINK_NAME[flash_eraseall] = "${sbindir}/flash_eraseall"
+ALTERNATIVE_LINK_NAME[nandwrite] = "${sbindir}/nandwrite"
+ALTERNATIVE_LINK_NAME[nanddump] = "${sbindir}/nanddump"
+ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
+ALTERNATIVE_LINK_NAME[ubiattach] = "${sbindir}/ubiattach"
+ALTERNATIVE_LINK_NAME[ubidetach] = "${sbindir}/ubidetach"
+ALTERNATIVE_LINK_NAME[ubimkvol] = "${sbindir}/ubimkvol"
+ALTERNATIVE_LINK_NAME[ubirename] = "${sbindir}/ubirename"
+ALTERNATIVE_LINK_NAME[ubirmvol] = "${sbindir}/ubirmvol"
+ALTERNATIVE_LINK_NAME[ubirsvol] = "${sbindir}/ubirsvol"
+ALTERNATIVE_LINK_NAME[ubiupdatevol] = "${sbindir}/ubiupdatevol"
+ALTERNATIVE_LINK_NAME[flash_eraseall] = "${sbindir}/flash_eraseall"
+ALTERNATIVE_LINK_NAME[flash_lock] = "${sbindir}/flash_lock"
+ALTERNATIVE_LINK_NAME[flash_unlock] = "${sbindir}/flash_unlock"
+ALTERNATIVE_LINK_NAME[flashcp] = "${sbindir}/flashcp"
+
+do_install () {
+ oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
+}
+
+PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc mtd-utils-tests"
+
+FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
+FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+FILES_mtd-utils-tests = "${libexecdir}/mtd-utils/*"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# git/.compr.c.dep:46: warning: NUL character seen; rest of line ignored
+# git/.compr.c.dep:47: *** missing separator. Stop.
+PARALLEL_MAKE = ""
diff --git a/poky/meta/recipes-devtools/mtools/mtools/0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch b/poky/meta/recipes-devtools/mtools/mtools/0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch
new file mode 100644
index 000000000..1f8f8351c
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtools/mtools/0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch
@@ -0,0 +1,34 @@
+From 5cc8d1f96ab6d3459e13631d8356f87381562352 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 2 Jun 2016 09:49:44 +0300
+Subject: [PATCH] Continue even if fs size is not divisible by
+ sectors-per-track
+
+Filesystem with a size that is not divisible by sectors-per-track is
+not broken or invalid: it might be unoptimized on media where
+heads and cylinders actually matter but that should be it.
+
+Preserve the warning but make mtools continue even if fs size is not
+divisible by sectors-per-track.
+
+Upstream-Status: Submitted [info-mtools@gnu.org]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ init.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/init.c b/init.c
+index c9152e0..4e16a01 100644
+--- a/init.c
++++ b/init.c
+@@ -338,7 +338,6 @@ Stream_t *fs_init(char drive, int mode, int *isRop)
+ fprintf(stderr,
+ "Add mtools_skip_check=1 to your .mtoolsrc file "
+ "to skip this test\n");
+- exit(1);
+ }
+
+ /* full cylinder buffering */
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/mtools/mtools/disable-hardcoded-configs.patch b/poky/meta/recipes-devtools/mtools/mtools/disable-hardcoded-configs.patch
new file mode 100644
index 000000000..01455f101
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtools/mtools/disable-hardcoded-configs.patch
@@ -0,0 +1,23 @@
+Disabled reading host configs.
+
+Upstream-Status: Inappropriate [native]
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+--- mtools-4.0.18/config.c.orig 2017-06-13 12:27:38.644000000 +0300
++++ mtools-4.0.18/config.c 2017-06-13 12:28:47.576000000 +0300
+@@ -701,14 +701,6 @@
+ memcpy(devices, const_devices,
+ nr_const_devices*sizeof(struct device));
+
+- (void) ((parse(CONF_FILE,1) |
+- parse(LOCAL_CONF_FILE,1) |
+- parse(SYS_CONF_FILE,1)) ||
+- (parse(OLD_CONF_FILE,1) |
+- parse(OLD_LOCAL_CONF_FILE,1)));
+- /* the old-name configuration files only get executed if none of the
+- * new-name config files were used */
+-
+ homedir = get_homedir();
+ if ( homedir ){
+ strncpy(conf_file, homedir, MAXPATHLEN );
diff --git a/poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch b/poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
new file mode 100644
index 000000000..8ceb0af13
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Inappropriate [licensing]
+
+Index: mtools-4.0.18/configure.in
+===================================================================
+--- mtools-4.0.18.orig/configure.in
++++ mtools-4.0.18/configure.in
+@@ -35,6 +35,33 @@ AC_CANONICAL_SYSTEM
+ AC_C_CONST
+ AC_C_INLINE
+
++AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
++if test "x$MAKEINFO" = "x"; then
++ MAKEINFO="@echo makeinfo missing; true"
++fi
++AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, )
++if test "x$TEXI2DVI" = "x"; then
++ TEXI2DVI="@echo texi2dvi missing; true"
++fi
++AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, )
++if test "x$TEXI2PDF" = "x"; then
++ TEXI2PDF="@echo texi2pdf missing; true"
++fi
++AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, )
++if test "x$TEXI2HTML" = "x"; then
++ TEXI2HTML="@echo texi2html missing; true"
++fi
++AC_CHECK_PROG(DVI2PS, dvi2ps, dvi2ps, )
++if test "x$DVI2PS" = "x"; then
++ DVI2PS="@echo dvi2ps missing; true"
++fi
++
++AC_SUBST(MAKEINFO)
++AC_SUBST(TEXI2DVI)
++AC_SUBST(TEXI2PDF)
++AC_SUBST(TEXI2HTML)
++AC_SUBST(DVI2PS)
++
+
+ dnl Check for configuration options
+ dnl Enable OS/2 extended density format disks
+Index: mtools-4.0.18/Makefile.in
+===================================================================
+--- mtools-4.0.18.orig/Makefile.in
++++ mtools-4.0.18/Makefile.in
+@@ -26,10 +26,11 @@ USERCFLAGS =
+ USERLDFLAGS =
+ USERLDLIBS =
+
+-MAKEINFO = makeinfo
+-TEXI2DVI = texi2dvi
+-TEXI2PDF = texi2pdf
+-TEXI2HTML = texi2html
++MAKEINFO = @MAKEINFO@
++TEXI2DVI = @TEXI2DVI@
++TEXI2PDF = @TEXI2PDF@
++TEXI2HTML = @TEXI2HTML@
++DVI2PS = @DVI2PS@
+
+
+ # do not edit below this line
+@@ -198,7 +199,7 @@ dvi: mtools.dvi
+
+ ps: mtools.ps
+ %.ps: %.dvi
+- dvips -f < $< > $@
++ $(DVI2PS) -f < $< > $@
+
+ pdf: mtools.pdf
+ %.pdf: %.texi sysconfdir.texi
diff --git a/poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch b/poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
new file mode 100644
index 000000000..9cb3e39f5
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
@@ -0,0 +1,18 @@
+Disable building with X11 support.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN mtools-4.0.15.orig//Makefile.in mtools-4.0.15//Makefile.in
+--- mtools-4.0.15.orig//Makefile.in 2010-10-17 08:41:09.000000000 -0700
++++ mtools-4.0.15//Makefile.in 2010-11-23 13:59:49.258258374 -0800
+@@ -146,7 +146,7 @@
+ CXXFLAGS = $(CPPFLAGS) $(DEFS) $(MYCXXFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS)
+ LINK = $(CC) $(LDFLAGS) $(USERLDFLAGS) @extralibdir@
+ ALLLIBS = $(USERLDLIBS) $(MACHDEPLIBS) $(SHLIB) $(LIBS)
+-X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) -lXau -lX11 $(LIBS)
++X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(LIBS)
+ X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
+
+ all: mtools $(LINKS) mkmanifest @FLOPPYD@ mtools.1 mtools.5
diff --git a/poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb b/poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
new file mode 100644
index 000000000..dcd32ed94
--- /dev/null
+++ b/poky/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Utilities to access MS-DOS disks without mounting them"
+DESCRIPTION = "Mtools is a collection of utilities to access MS-DOS disks from GNU and Unix without mounting them."
+HOMEPAGE = "http://www.gnu.org/software/mtools/"
+SECTION = "optional"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "virtual/libiconv"
+
+RDEPENDS_${PN}_libc-glibc = "glibc-gconv-ibm850"
+RRECOMMENDS_${PN}_libc-glibc = "\
+ glibc-gconv-ibm437 \
+ glibc-gconv-ibm737 \
+ glibc-gconv-ibm775 \
+ glibc-gconv-ibm851 \
+ glibc-gconv-ibm852 \
+ glibc-gconv-ibm855 \
+ glibc-gconv-ibm857 \
+ glibc-gconv-ibm860 \
+ glibc-gconv-ibm861 \
+ glibc-gconv-ibm862 \
+ glibc-gconv-ibm863 \
+ glibc-gconv-ibm865 \
+ glibc-gconv-ibm866 \
+ glibc-gconv-ibm869 \
+ "
+SRC_URI[md5sum] = "a23646617546bf6ad56f061d8b283c85"
+SRC_URI[sha256sum] = "59e9cf80885399c4f229e5d87e49c0c2bfeec044e1386d59fcd0b0aead6b2f85"
+
+SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
+ file://mtools-makeinfo.patch \
+ file://no-x11.gplv3.patch \
+ file://0001-Continue-even-if-fs-size-is-not-divisible-by-sectors.patch \
+ "
+
+SRC_URI_append_class-native = " file://disable-hardcoded-configs.patch"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libbsd] = "ac_cv_lib_bsd_main=yes,ac_cv_lib_bsd_main=no,libbsd"
+
+do_install_prepend () {
+ # Create bindir to fix parallel installation issues
+ mkdir -p ${D}/${bindir}
+ mkdir -p ${D}/${datadir}
+}
diff --git a/poky/meta/recipes-devtools/nasm/nasm/0001-asmlib-Drop-pure-function-attribute-from-seg_init.patch b/poky/meta/recipes-devtools/nasm/nasm/0001-asmlib-Drop-pure-function-attribute-from-seg_init.patch
new file mode 100644
index 000000000..12ae3a94d
--- /dev/null
+++ b/poky/meta/recipes-devtools/nasm/nasm/0001-asmlib-Drop-pure-function-attribute-from-seg_init.patch
@@ -0,0 +1,27 @@
+From 77c3a77210d8ca8b94e999c711156e984a8dc737 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 31 Mar 2018 11:05:33 -0700
+Subject: [PATCH] asmlib: Drop pure function attribute from seg_init
+
+seg_init returns void, so it is impure function
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ include/nasmlib.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/nasmlib.h b/include/nasmlib.h
+index 79e866b..b80b7e2 100644
+--- a/include/nasmlib.h
++++ b/include/nasmlib.h
+@@ -191,7 +191,7 @@ int64_t readstrnum(char *str, int length, bool *warn);
+ * seg_init: Initialise the segment-number allocator.
+ * seg_alloc: allocate a hitherto unused segment number.
+ */
+-void pure_func seg_init(void);
++void seg_init(void);
+ int32_t pure_func seg_alloc(void);
+
+ /*
diff --git a/poky/meta/recipes-devtools/nasm/nasm_2.13.03.bb b/poky/meta/recipes-devtools/nasm/nasm_2.13.03.bb
new file mode 100644
index 000000000..236d7e5e3
--- /dev/null
+++ b/poky/meta/recipes-devtools/nasm/nasm_2.13.03.bb
@@ -0,0 +1,30 @@
+SUMMARY = "General-purpose x86 assembler"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe"
+
+SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 \
+ file://0001-asmlib-Drop-pure-function-attribute-from-seg_init.patch \
+ "
+
+SRC_URI[md5sum] = "0c581d482f39d5111879ca9601938f74"
+SRC_URI[sha256sum] = "63ec86477ad3f0f6292325fd89e1d93aea2e2fd490070863f17d48f7cd387011"
+
+inherit autotools-brokensep
+
+do_configure_prepend () {
+ if [ -f ${S}/aclocal.m4 ] && [ ! -f ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man1
+
+ oe_runmake 'INSTALLROOT=${D}' install
+}
+
+BBCLASSEXTEND = "native"
+
+DEPENDS = "groff-native"
diff --git a/poky/meta/recipes-devtools/ninja/ninja_1.8.2.bb b/poky/meta/recipes-devtools/ninja/ninja_1.8.2.bb
new file mode 100644
index 000000000..c6fcfef3d
--- /dev/null
+++ b/poky/meta/recipes-devtools/ninja/ninja_1.8.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Ninja is a small build system with a focus on speed."
+HOMEPAGE = "http://martine.github.com/ninja/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a81586a64ad4e476c791cda7e2f2c52e"
+
+DEPENDS = "re2c-native ninja-native"
+
+SRCREV = "253e94c1fa511704baeb61cf69995bbf09ba435e"
+
+SRC_URI = "git://github.com/ninja-build/ninja.git;branch=release"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
+
+S = "${WORKDIR}/git"
+
+do_configure[noexec] = "1"
+
+do_compile_class-native() {
+ ./configure.py --bootstrap
+}
+
+do_compile() {
+ ./configure.py
+ ninja
+}
+
+do_install() {
+ install -D -m 0755 ${S}/ninja ${D}${bindir}/ninja
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
new file mode 100644
index 000000000..6b7ca7da3
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
@@ -0,0 +1,51 @@
+From ef5db062b7d25e6070acc6922ea48f50491313b5 Mon Sep 17 00:00:00 2001
+From: Michael Hansen <michael.j.hansen@hp.com>
+Date: Mon, 26 Feb 2018 09:42:56 -0800
+Subject: [PATCH 1/2] Only use --sort=name on versions of tar which support it.
+ This fixes compatibility with bsdtar and old versions of GNU tar (e.g.
+ RHEL6).
+
+Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Upstream-Status: Backport
+
+---
+ opkg-build | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+Index: opkg-utils-0.3.6/opkg-build
+===================================================================
+--- opkg-utils-0.3.6.orig/opkg-build
++++ opkg-utils-0.3.6/opkg-build
+@@ -232,6 +232,11 @@ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
+ fi
+
++tsortargs=
++if tar --help 2>&1 | grep -- "--sort=" > /dev/null; then
++ tsortargs="--sort=name"
++fi
++
+ shift $(($OPTIND - 1))
+
+ # continue on to process additional arguments
+@@ -280,8 +285,8 @@ mkdir $tmp_dir
+ build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs --sort=name --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs --sort=name --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
+@@ -296,7 +301,7 @@ rm -f $pkg_file
+ if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
+ else
+- ( cd $tmp_dir && tar -c --sort=name --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
++ ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
+ fi
+
+ rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
new file mode 100644
index 000000000..c36ae2ffd
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
@@ -0,0 +1,112 @@
+From d42b23f4fb5d6bd58e92e995fe5befc76efbae0c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 27 Apr 2017 15:47:58 +0300
+Subject: [PATCH] Switch all scripts to use Python 3.x
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ makePackage | 2 +-
+ opkg-compare-indexes | 2 +-
+ opkg-graph-deps | 2 +-
+ opkg-list-fields | 2 +-
+ opkg-make-index | 2 +-
+ opkg-show-deps | 2 +-
+ opkg-unbuild | 2 +-
+ opkg-update-index | 2 +-
+ opkg.py | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/makePackage b/makePackage
+index 4bdfc56..02124dd 100755
+--- a/makePackage
++++ b/makePackage
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+
+ # The general algorithm this program follows goes like this:
+ # Run tar to extract control from control.tar.gz from the package.
+diff --git a/opkg-compare-indexes b/opkg-compare-indexes
+index b60d20a..80c1263 100755
+--- a/opkg-compare-indexes
++++ b/opkg-compare-indexes
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-graph-deps b/opkg-graph-deps
+index 6653fd5..f1e376a 100755
+--- a/opkg-graph-deps
++++ b/opkg-graph-deps
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-list-fields b/opkg-list-fields
+index c14a90f..24f7955 100755
+--- a/opkg-list-fields
++++ b/opkg-list-fields
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-make-index b/opkg-make-index
+index 3f757f6..2988f9f 100755
+--- a/opkg-make-index
++++ b/opkg-make-index
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-show-deps b/opkg-show-deps
+index 153f21e..4e18b4f 100755
+--- a/opkg-show-deps
++++ b/opkg-show-deps
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-unbuild b/opkg-unbuild
+index 4f36bec..57642c9 100755
+--- a/opkg-unbuild
++++ b/opkg-unbuild
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-update-index b/opkg-update-index
+index 341c1c2..7bff8a1 100755
+--- a/opkg-update-index
++++ b/opkg-update-index
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+
+ import sys, os
+diff --git a/opkg.py b/opkg.py
+index 2ecac8a..7e64de4 100644
+--- a/opkg.py
++++ b/opkg.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (C) 2001 Alexander S. Guy <a7r@andern.org>
+ # Andern Research Labs
+ #
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
new file mode 100644
index 000000000..e338914b0
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
@@ -0,0 +1,44 @@
+From 5727826b51cf99feaff3483a9df8af2043e7efc1 Mon Sep 17 00:00:00 2001
+From: Michael Hansen <michael.j.hansen@hp.com>
+Date: Mon, 26 Feb 2018 10:17:01 -0800
+Subject: [PATCH 2/2] opkg-build: Use local time for build_date, since opkg
+ extracts files assuming local time rather than UTC. Also increase resolution
+ of build date down to the second, rather than clamping to midnight of the
+ current date.
+
+Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Upstream-Status: Backport
+
+---
+ opkg-build | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: opkg-utils-0.3.6/opkg-build
+===================================================================
+--- opkg-utils-0.3.6.orig/opkg-build
++++ opkg-utils-0.3.6/opkg-build
+@@ -282,11 +282,11 @@ fi
+ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ mkdir $tmp_dir
+
+-build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
++build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
+@@ -301,7 +301,7 @@ rm -f $pkg_file
+ if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
+ else
+- ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
++ ( cd $tmp_dir && tar -c $tsortargs --mtime="$build_date" $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
+ fi
+
+ rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 000000000..d8931b281
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,48 @@
+If a the number of hard links decreases or increases while creating
+the tar files used for an ipk package, tar fails with error code 1:
+
+| DEBUG: Executing python function do_package_ipk
+| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
+NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
+ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
+
+
+We detect if the error code produced by tar is 1 and in this case ignore it.
+
+This a similar behavior to the one on dpkg:
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: git/opkg-build
+
+===================================================================
+--- git.orig/opkg-build
++++ git/opkg-build
+@@ -285,8 +285,21 @@ mkdir $tmp_dir
+ build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++
++
++# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
++rc=0
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
new file mode 100644
index 000000000..13a49f917
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
@@ -0,0 +1,18 @@
+Pass --threads=0 to xz so that it will use as many threads as there are cores to compress the packages. This makes qemu's do_package_ipk run in 34s instead of 275s on my machine.
+
+Upstream-Status: Inappropriate (ugly but works, discussing with upstream now)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/opkg-build b/opkg-build
+index 0050c2b..93a7956 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -230,6 +230,8 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
+ fi
+ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
++elif [ $compressor = "xz" ] ; then
++ compressorargs="--threads 0"
+ fi
+
+ tsortargs=
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb
new file mode 100644
index 000000000..0487c5f30
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb
@@ -0,0 +1,67 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://opkg.py;beginline=2;endline=18;md5=63ce9e6bcc445181cd9e4baf4b4ccc35"
+PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
+
+SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
+ file://0001-Switch-all-scripts-to-use-Python-3.x.patch \
+ file://0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch \
+ file://0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch \
+ file://threaded-xz.patch \
+"
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
+
+
+SRC_URI[md5sum] = "391c1c80aca26961375dd22e1d2d0cbf"
+SRC_URI[sha256sum] = "26b3f4dd1c1ef65f519d4cddfb35ebea41ae8af989aea2699a39783598c33769"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+# For native builds we use the host Python
+PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold"
+PYTHONRDEPS_class-native = ""
+
+PACKAGECONFIG = "python update-alternatives"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+do_install() {
+ oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
+ rm -f "${D}${bindir}/update-alternatives"
+ fi
+
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+ grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
+ fi
+}
+
+do_install_append_class-target() {
+ if [ -e "${D}${bindir}/update-alternatives" ]; then
+ sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
+ fi
+}
+
+# These are empty and will pull python3-dev into images where it wouldn't
+# have been otherwise, so don't generate them.
+PACKAGES_remove = "${PN}-dev ${PN}-staticdev"
+
+PACKAGES =+ "update-alternatives-opkg"
+FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
+RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
+RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
+RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
+
+pkg_postrm_update-alternatives-opkg() {
+ rm -rf $D${nonarch_libdir}/opkg/alternatives
+ rmdir $D${nonarch_libdir}/opkg || true
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+CLEANBROKEN = "1"
diff --git a/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
new file mode 100644
index 000000000..0c2dbc9e3
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Architecture-dependent configuration for opkg"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+LICENSE = "MIT"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ mkdir -p ${S}/${sysconfdir}/opkg/
+
+ archconf=${S}/${sysconfdir}/opkg/arch.conf
+
+ rm -f $archconf
+ ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}"
+ priority=1
+ for arch in $ipkgarchs; do
+ echo "arch $arch $priority" >> $archconf
+ priority=$(expr $priority + 5)
+ done
+}
+
+
+do_install () {
+ install -d ${D}${sysconfdir}/opkg
+ install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
+}
+
+FILES_${PN} = "${sysconfdir}/opkg/ "
+
+CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf"
+
+RREPLACES_${PN} = "opkg-config-base"
+RCONFLICTS_${PN} = "opkg-config-base"
+RPROVIDES_${PN} = "opkg-config-base"
diff --git a/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
new file mode 100644
index 000000000..18d6abdde
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Keyrings for verifying opkg packages and feeds"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+# Distro-specific keys can be added to this package in two ways:
+#
+# 1) In a .bbappend, add .gpg and/or .asc files to SRC_URI and install them to
+# ${D}${datadir}/opkg/keyrings/ in a do_install_append function. These
+# files should not be named 'key-$name.gpg' to ensure they don't conflict
+# with keys exported as per (2).
+#
+# 2) In a .bbappend, distro config or local.conf, override the variable
+# OPKG_KEYRING_KEYS to contain a space-separated list of key names. For
+# each name, 'gpg --export $name' will be ran to export the public key to a
+# file named 'key-$name.gpg'. The public key must therefore be in the gpg
+# keyrings on the build machine.
+
+OPKG_KEYRING_KEYS ?= ""
+
+do_compile() {
+ for name in ${OPKG_KEYRING_KEYS}; do
+ gpg --export ${name} > ${B}/key-${name}.gpg
+ done
+}
+
+do_install () {
+ install -d ${D}${datadir}/opkg/keyrings/
+ for name in ${OPKG_KEYRING_KEYS}; do
+ install -m 0644 ${B}/key-${name}.gpg ${D}${datadir}/opkg/keyrings/
+ done
+}
+
+FILES_${PN} = "${datadir}/opkg/keyrings"
+
+# We need 'opkg-key' to run the postinst script
+RDEPENDS_${PN} = "opkg"
+
+pkg_postinst_${PN} () {
+#! /bin/sh
+set -e
+
+if [ x"$D" = "x" ]; then
+ # On target
+ opkg-key populate
+else
+ exit 1
+fi
+}
diff --git a/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch b/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
new file mode 100644
index 000000000..e94a4123d
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch
@@ -0,0 +1,34 @@
+From a4628a6171f393add9a2b287483ca39bb72b4dd6 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Mon, 21 Sep 2015 20:23:23 +1000
+Subject: [PATCH] opkg_conf: create opkg.lock in /run instead of /var/run
+
+This avoids a "Could not unlink" warning when extracting a /var/run
+symbolic link pointing to /run from a package as it is unable to
+unlink the /var/run directory when it contains opkg.lock.
+
+This also fixes an issue where /var/run is created as a directory
+instead of a symbolic link to /run.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ libopkg/opkg_conf.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
+index 7bca948..5a1bc44 100644
+--- a/libopkg/opkg_conf.h
++++ b/libopkg/opkg_conf.h
+@@ -40,7 +40,7 @@ extern "C" {
+ #define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
+ #define OPKG_CONF_DEFAULT_CACHE_DIR VARDIR "/cache/opkg"
+ #define OPKG_CONF_DEFAULT_CONF_FILE_DIR SYSCONFDIR "/opkg"
+-#define OPKG_CONF_DEFAULT_LOCK_FILE VARDIR "/run/opkg.lock"
++#define OPKG_CONF_DEFAULT_LOCK_FILE "/run/opkg.lock"
+
+ /* In case the config file defines no dest */
+ #define OPKG_CONF_DEFAULT_DEST_NAME "root"
+--
+2.5.0
+
diff --git a/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
new file mode 100644
index 000000000..432c3ddc2
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Opkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable opkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/poky/meta/recipes-devtools/opkg/opkg/opkg.conf b/poky/meta/recipes-devtools/opkg/opkg/opkg.conf
new file mode 100644
index 000000000..c2e9e92f9
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg/opkg.conf
@@ -0,0 +1,28 @@
+# Must have one or more source entries of the form:
+#
+# src <src-name> <source-url>
+#
+# and one or more destination entries of the form:
+#
+# dest <dest-name> <target-path>
+#
+# where <src-name> and <dest-names> are identifiers that
+# should match [a-zA-Z0-9._-]+, <source-url> should be a
+# URL that points to a directory containing a Familiar
+# Packages file, and <target-path> should be a directory
+# that exists on the target system.
+
+# Proxy Support
+#option http_proxy http://proxy.tld:3128
+#option ftp_proxy http://proxy.tld:3128
+#option proxy_username <username>
+#option proxy_password <password>
+
+# Enable GPGME signature
+# option check_signature 1
+
+# Offline mode (for use in constructing flash images offline)
+#option offline_root target
+
+# Default destination for installed packages
+dest root /
diff --git a/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb
new file mode 100644
index 000000000..70f20af73
--- /dev/null
+++ b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb
@@ -0,0 +1,75 @@
+SUMMARY = "Open Package Manager"
+SUMMARY_libopkg = "Open Package Manager library"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://src/opkg.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0"
+
+DEPENDS = "libarchive"
+
+PE = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
+ file://opkg-configure.service \
+ file://opkg.conf \
+ file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
+"
+
+SRC_URI[md5sum] = "79e04307f6f54db431c251772d7d987c"
+SRC_URI[sha256sum] = "f607f0e61be8cf8a3bbd0d2dccd9ec9e9b6c21dd4307b671c600d6eeaf84d30b"
+
+inherit autotools pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
+
+target_localstatedir := "${localstatedir}"
+OPKGLIBDIR = "${target_localstatedir}/lib"
+
+PACKAGECONFIG ??= "libsolv"
+
+PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
+PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
+PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
+PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
+
+EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/opkg
+ install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+ echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
+
+ # We need to create the lock directory
+ install -d ${D}${OPKGLIBDIR}/opkg
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+ ${D}${systemd_unitdir}/system/opkg-configure.service
+ fi
+}
+
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
+RCONFLICTS_${PN} = "opkg-collateral"
+RPROVIDES_${PN} = "opkg-collateral"
+
+PACKAGES =+ "libopkg"
+
+FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
+FILES_${PN} += "${systemd_unitdir}/system/"
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"
diff --git a/poky/meta/recipes-devtools/orc/orc_0.4.28.bb b/poky/meta/recipes-devtools/orc/orc_0.4.28.bb
new file mode 100644
index 000000000..415de64dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/orc/orc_0.4.28.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Optimised Inner Loop Runtime Compiler"
+HOMEPAGE = "http://gstreamer.freedesktop.org/modules/orc.html"
+LICENSE = "BSD-2-Clause & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1400bd9d09e8af56b9ec982b3d85797e"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/orc/orc-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "6b582ec4b3275c5efd51e3ae6406d445"
+SRC_URI[sha256sum] = "bfcd7c6563b05672386c4eedfc4c0d4a0a12b4b4775b74ec6deb88fc2bcd83ce"
+
+inherit autotools pkgconfig gtk-doc
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES =+ "orc-examples"
+PACKAGES_DYNAMIC += "^liborc-.*"
+FILES_orc-examples = "${libdir}/orc/*"
+FILES_${PN} = "${bindir}/*"
+
+python populate_packages_prepend () {
+ libdir = d.expand('${libdir}')
+ do_split_packages(d, libdir, '^lib(.*)\.so\.*', 'lib%s', 'ORC %s library', extra_depends='', allow_links=True)
+}
+
+do_compile_prepend_class-native () {
+ sed -i -e 's#/tmp#.#g' ${S}/orc/orccodemem.c
+}
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
new file mode 100644
index 000000000..ed67c501c
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
@@ -0,0 +1,119 @@
+From: Piotr Roszatycki <dexter@debian.org>
+Date: Wed, 27 Jan 2010 16:53:11 +0100
+Subject: [PATCH] Change library name
+
+The soname was changed to ossp-uuid to prevend the name clash with e2fsprogs's
+uuid library.
+---
+ Makefile.in | 6 +++---
+ perl/Makefile.PL | 12 ++++++------
+ php/config.m4 | 2 +-
+ uuid-config.in | 2 +-
+ uuid.pc.in | 4 ++--
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index d28f4be..c2ba99d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -62,13 +62,13 @@ PERL = @PERL@
+ PHP = @PHP@
+ PG_CONFIG = @PG_CONFIG@
+
+-LIB_NAME = libuuid.la
++LIB_NAME = libossp-uuid.la
+ LIB_OBJS = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo
+
+-DCE_NAME = libuuid_dce.la
++DCE_NAME = libossp-uuid_dce.la
+ DCE_OBJS = uuid_dce.lo $(LIB_OBJS)
+
+-CXX_NAME = libuuid++.la
++CXX_NAME = libossp-uuid++.la
+ CXX_OBJS = uuid++.lo $(LIB_OBJS)
+
+ PRG_NAME = uuid
+diff --git a/perl/Makefile.PL b/perl/Makefile.PL
+index 92f4494..9c6fee6 100644
+--- a/perl/Makefile.PL
++++ b/perl/Makefile.PL
+@@ -33,9 +33,9 @@ use Config;
+ use ExtUtils::MakeMaker;
+
+ # determine source directory
+-my ($srcdir) = map { my $d = $_; $d =~ s/\/libuuid\.la$//; $d }
+- grep { -f $_ } ("../libuuid.la", glob("../*/libuuid.la"))
+- or die "no source directory found (where libuuid.la is located)";
++my ($srcdir) = map { my $d = $_; $d =~ s/\/libossp-uuid\.la$//; $d }
++ grep { -f $_ } ("../libossp-uuid.la", glob("../*/libossp-uuid.la"))
++ or die "no source directory found (where libossp-uuid.la is located)";
+
+ # determine extra build options
+ my $compat = 0;
+@@ -47,15 +47,15 @@ WriteMakefile(
+ VERSION_FROM => 'uuid.pm',
+ ABSTRACT_FROM => 'uuid.pod',
+ PREREQ_PM => {},
+- LIBS => [ "-L$srcdir/.libs -L$srcdir -luuid" ],
++ LIBS => [ "-L$srcdir/.libs -L$srcdir -lossp-uuid" ],
+ DEFINE => '',
+ INC => "-I. -I$srcdir",
+ PM => { 'uuid.pm' => '$(INST_LIBDIR)/uuid.pm',
+ 'uuid.pod' => '$(INST_LIBDIR)/uuid.pod',
+ ($compat ? ('uuid_compat.pm' => '$(INST_LIBDIR)/../Data/UUID.pm') : ()),
+ ($compat ? ('uuid_compat.pod' => '$(INST_LIBDIR)/../Data/UUID.pod') : ()), },
+- MAN3PODS => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3',
+- ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3') : ()), },
++ MAN3PODS => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3pm',
++ ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3pm') : ()), },
+ TYPEMAPS => [ 'uuid.tm' ],
+ test => { TESTS => 'uuid.ts' . ($compat ? ' uuid_compat.ts' : '') },
+ NO_META => 1,
+diff --git a/php/config.m4 b/php/config.m4
+index 5091b96..969b457 100644
+--- a/php/config.m4
++++ b/php/config.m4
+@@ -34,7 +34,7 @@ if test "$PHP_UUID" != "no"; then
+ PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)
+ AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])
+ PHP_ADD_LIBPATH([..], )
+- PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)
++ PHP_ADD_LIBRARY([ossp-uuid],, UUID_SHARED_LIBADD)
+ PHP_ADD_INCLUDE([..])
+ PHP_SUBST(UUID_SHARED_LIBADD)
+
+diff --git a/uuid-config.in b/uuid-config.in
+index 8d2a063..5b58812 100644
+--- a/uuid-config.in
++++ b/uuid-config.in
+@@ -121,7 +121,7 @@ do
+ output_extra="$output_extra $uuid_ldflags"
+ ;;
+ --libs)
+- output="$output -luuid"
++ output="$output -lossp-uuid"
+ output_extra="$output_extra $uuid_libs"
+ ;;
+ * )
+diff --git a/uuid.pc.in b/uuid.pc.in
+index c76ad1e..de00c2f 100644
+--- a/uuid.pc.in
++++ b/uuid.pc.in
+@@ -36,7 +36,7 @@ Name: OSSP uuid
+ Description: Universally Unique Identifier (UUID) Library
+ Version: @UUID_VERSION_RAW@
+ URL: http://www.ossp.org/pkg/lib/uuid/
+-Cflags: -I${includedir}
+-Libs: -L${libdir} -luuid
++Cflags: -I${includedir}/ossp
++Libs: -L${libdir} -lossp-uuid
+ Libs.private: @LIBS@
+
+--
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
new file mode 100644
index 000000000..804a62731
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
@@ -0,0 +1,62 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Wed, 27 Jan 2010 19:46:21 +0100
+Subject: [PATCH] uuid: preserve -m option status in -v option handling
+
+Bug: 531396
+---
+ uuid_cli.c | 19 ++++++++++---------
+ 1 files changed, 10 insertions(+), 9 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid_cli.c b/uuid_cli.c
+index d1b0b11..14a67fe 100644
+--- a/uuid_cli.c
++++ b/uuid_cli.c
+@@ -140,11 +140,12 @@ int main(int argc, char *argv[])
+ i = strtol(optarg, &p, 10);
+ if (*p != '\0')
+ usage("invalid argument to option 'v'");
++ version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5);
+ switch (i) {
+- case 1: version = UUID_MAKE_V1; break;
+- case 3: version = UUID_MAKE_V3; break;
+- case 4: version = UUID_MAKE_V4; break;
+- case 5: version = UUID_MAKE_V5; break;
++ case 1: version |= UUID_MAKE_V1; break;
++ case 3: version |= UUID_MAKE_V3; break;
++ case 4: version |= UUID_MAKE_V4; break;
++ case 5: version |= UUID_MAKE_V5; break;
+ default:
+ usage("invalid version on option 'v'");
+ break;
+@@ -213,10 +214,10 @@ int main(int argc, char *argv[])
+ }
+ else {
+ /* encoding */
+- if ( (version == UUID_MAKE_V1 && argc != 0)
+- || (version == UUID_MAKE_V3 && argc != 2)
+- || (version == UUID_MAKE_V4 && argc != 0)
+- || (version == UUID_MAKE_V5 && argc != 2))
++ if ( (version & UUID_MAKE_V1 && argc != 0)
++ || (version & UUID_MAKE_V3 && argc != 2)
++ || (version & UUID_MAKE_V4 && argc != 0)
++ || (version & UUID_MAKE_V5 && argc != 2))
+ usage("invalid number of arguments");
+ if ((rc = uuid_create(&uuid)) != UUID_RC_OK)
+ error(1, "uuid_create: %s", uuid_error(rc));
+@@ -232,7 +233,7 @@ int main(int argc, char *argv[])
+ if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK)
+ error(1, "uuid_load: %s", uuid_error(rc));
+ }
+- if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
++ if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) {
+ if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK)
+ error(1, "uuid_create: %s", uuid_error(rc));
+ if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
+--
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
new file mode 100644
index 000000000..13cbb5989
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
@@ -0,0 +1,58 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Tue, 2 Feb 2010 12:16:49 +0100
+Subject: [PATCH] Fix whatis entries
+
+Fix whatis entry of uuid.1, uuid.3ossp and uuid++.3ossp manpages
+---
+ uuid++.pod | 2 +-
+ uuid.pod | 2 +-
+ uuid_cli.pod | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid++.pod b/uuid++.pod
+index 8b5a4b1..89c5efb 100644
+--- a/uuid++.pod
++++ b/uuid++.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier> (C++ API)
++B<uuid++> - B<Universally Unique Identifier> (C++ API)
+
+ =head1 VERSION
+
+diff --git a/uuid.pod b/uuid.pod
+index 4ad3742..0179a46 100644
+--- a/uuid.pod
++++ b/uuid.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier>
++B<uuid> - B<Universally Unique Identifier>
+
+ =head1 VERSION
+
+diff --git a/uuid_cli.pod b/uuid_cli.pod
+index ddec6bb..df9dc83 100644
+--- a/uuid_cli.pod
++++ b/uuid_cli.pod
+@@ -31,7 +31,7 @@
+
+ =head1 NAME
+
+-B<OSSP uuid> - B<Universally Unique Identifier Command-Line Tool>
++B<uuid> - B<Universally Unique Identifier Command-Line Tool>
+
+ =head1 VERSION
+
+--
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
new file mode 100644
index 000000000..bc5e111ee
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
@@ -0,0 +1,43 @@
+Description: Support dash-less args to from_string.
+Author: Tim Retout <diocles@debian.org>
+Bug-Debian: http://bugs.debian.org/635607
+
+The module Data::GUID depends on Data::UUID supporting this behaviour.
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- a/perl/uuid_compat.pm
++++ b/perl/uuid_compat.pm
+@@ -93,7 +93,9 @@
+ $uuid->import('str',
+ $str =~ /^0x/
+ ? join '-', unpack('x2 a8 a4 a4 a4 a12', $str)
+- : $str
++ : $str =~ /-/
++ ? $str
++ : join '-', unpack('A8 A4 A4 A4 A12', $str)
+ );
+ return $uuid->export('bin');
+ }
+--- a/perl/uuid_compat.ts
++++ b/perl/uuid_compat.ts
+@@ -28,7 +28,7 @@
+ ## uuid_compat.ts: Data::UUID Backward Compatibility Perl API (Perl test suite part)
+ ##
+
+-use Test::More tests => 14;
++use Test::More tests => 16;
+
+ BEGIN {
+ use_ok('Data::UUID');
+@@ -53,3 +53,5 @@
+ ok($uuid8 = $ug->from_string("6ba7b811-9dad-11d1-80b4-00c04fd430c8"));
+ ok($ug->compare($uuid7, $uuid8) == 0);
+
++ok($uuid9 = $ug->from_string("6ba7b8119dad11d180b400c04fd430c8"));
++ok($ug->compare($uuid7, $uuid9) == 0);
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
new file mode 100644
index 000000000..63b80f6a1
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
@@ -0,0 +1,19 @@
+uuid.pc is generated at build time so should be installed from the current
+directory, and not $S.
+
+Upstream-Status: Pending [should be submitted]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Index: uuid-1.6.2/Makefile.in
+===================================================================
+--- uuid-1.6.2.orig/Makefile.in 2012-11-13 16:58:28.624156000 +0000
++++ uuid-1.6.2/Makefile.in 2012-11-13 17:05:24.224158670 +0000
+@@ -232,7 +232,7 @@
+ $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+ $(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/
+ $(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/
+- $(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
++ $(SHTOOL) install -c -m 644 uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
+ $(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/
+ -@if [ ".$(WITH_DCE)" = .yes ]; then \
+ echo "$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/"; \
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
new file mode 100644
index 000000000..4dfc1370c
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
@@ -0,0 +1,26 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- uuid-1.6.2.orig/Makefile.in
++++ uuid-1.6.2/Makefile.in
+@@ -113,15 +113,15 @@ all: $(TARGETS)
+ @$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $<
+
+ $(LIB_NAME): $(LIB_OBJS)
+- @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(DCE_NAME): $(DCE_OBJS)
+- @$(LIBTOOL) --mode=link $(CC) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(CXX_NAME): $(CXX_OBJS)
+- @$(LIBTOOL) --mode=link $(CXX) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
++ @$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
+ -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(PRG_NAME): $(PRG_OBJS) $(LIB_NAME)
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch
new file mode 100644
index 000000000..7f601afab
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/libtool-tag.patch
@@ -0,0 +1,21 @@
+Repect LIBTOOLFLAGS
+
+This add a knob that can be controlled from env to set generic options
+for libtool
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: uuid-1.6.2/Makefile.in
+===================================================================
+--- uuid-1.6.2.orig/Makefile.in
++++ uuid-1.6.2/Makefile.in
+@@ -56,7 +56,7 @@ RM = rm -f
+ CP = cp
+ RMDIR = rmdir
+ SHTOOL = $(S)/shtool
+-LIBTOOL = @LIBTOOL@
++LIBTOOL = @LIBTOOL@ $(LIBTOOLFLAGS)
+ TRUE = true
+ POD2MAN = pod2man
+ PERL = @PERL@
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
new file mode 100644
index 000000000..4bc91b86e
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
@@ -0,0 +1,27 @@
+Remove hardcoded libtool name, fall back to generated name
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in 2012-05-14 14:37:19.579672930 -0500
++++ uuid-1.6.2/Makefile.in 2012-05-14 14:37:49.112733787 -0500
+@@ -32,6 +32,7 @@
+ VPATH = @srcdir@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
++top_builddir = @top_builddir@
+ S = $(srcdir)
+ C = .
+
+@@ -55,7 +56,7 @@
+ CP = cp
+ RMDIR = rmdir
+ SHTOOL = $(S)/shtool
+-LIBTOOL = $(C)/libtool
++LIBTOOL = @LIBTOOL@
+ TRUE = true
+ POD2MAN = pod2man
+ PERL = @PERL@
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
new file mode 100644
index 000000000..d806b5fb7
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
@@ -0,0 +1,19 @@
+We don't want anything stripped
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in 2012-05-14 14:42:42.225789456 -0500
++++ uuid-1.6.2/Makefile.in 2012-05-14 15:03:03.119733400 -0500
+@@ -254,7 +254,7 @@
+ -@if [ ".$(WITH_CXX)" = .yes ]; then \
+ $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \
+ fi
+- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/
++ @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 uuid $(DESTDIR)$(bindir)/
+ $(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/
+ -@if [ ".$(WITH_PERL)" = .yes ]; then \
+ (cd $(S)/perl && $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \
diff --git a/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
new file mode 100644
index 000000000..5d9ca790e
--- /dev/null
+++ b/poky/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
@@ -0,0 +1,66 @@
+SUMMARY = "Universally Unique Identifier (UUID) library"
+DESCRIPTION = "OSSP uuid is a ISO-C:1999 application programming interface \
+(API) and corresponding command line interface (CLI) for the generation of \
+DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique \
+Identifier (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time \
+and node based), version 3 (name based, MD5), version 4 (random number \
+based) and version 5 (name based, SHA-1)."
+DESCRIPTION_uuid = "This package contains a tool to create Universally \
+Unique Identifiers (UUID) from the command-line."
+
+HOMEPAGE = "http://www.ossp.org/pkg/lib/uuid/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=30;endline=55;md5=b394fadb039bbfca6ad9d9d769ee960e \
+ file://uuid_md5.c;beginline=1;endline=28;md5=9c1f4b2218546deae24c91be1dcf00dd"
+
+PR = "r2"
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/o/ossp-uuid/"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://0001-Change-library-name.patch \
+ file://0002-uuid-preserve-m-option-status-in-v-option-handling.patch \
+ file://0003-Fix-whatis-entries.patch \
+ file://0004-fix-data-uuid-from-string.patch \
+ file://uuid-libtool.patch \
+ file://uuid-nostrip.patch \
+ file://install-pc.patch \
+ file://ldflags.patch \
+ file://libtool-tag.patch \
+ "
+SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f"
+SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0"
+
+S = "${WORKDIR}/uuid-${PV}"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql"
+EXTRA_OECONF = "--includedir=${includedir}/ossp"
+EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'"
+
+do_configure_prepend() {
+ # This package has a completely custom aclocal.m4, which should be acinclude.m4.
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ mv ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+
+ rm -f ${S}/libtool.m4
+}
+
+do_install_append() {
+ mkdir -p ${D}${includedir}/ossp
+ mv ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/pkgconfig/ossp-uuid.pc
+}
+
+PACKAGES =+ "uuid"
+FILES_uuid = "${bindir}/uuid"
+FILES_${PN} = "${libdir}/libossp-uuid.so.16*"
+FILES_${PN}-dev += "${bindir}/uuid-config"
+
+BBCLASSEXTEND = "native nativesdk"
+
+ALTERNATIVE_${PN}-doc = "uuid.3"
+ALTERNATIVE_PRIORITY_${PN}-doc = "200"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
diff --git a/poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb b/poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
new file mode 100644
index 000000000..edee474ec
--- /dev/null
+++ b/poky/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Provides a small set of tools for development on the device"
+
+PR = "r1"
+
+inherit packagegroup
+
+RPROVIDES_${PN} = "qemu-config"
+RREPLACES_${PN} = "qemu-config"
+RCONFLICTS_${PN} = "qemu-config"
+
+RDEPENDS_${PN} = "\
+ distcc-config \
+ nfs-export-root \
+ bash \
+ binutils-symlinks \
+ "
diff --git a/poky/meta/recipes-devtools/patch/patch.inc b/poky/meta/recipes-devtools/patch/patch.inc
new file mode 100644
index 000000000..cbfb8cfcf
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Tool for applying a patch file"
+DESCRIPTION = "patch takes a patch file containing a difference listing \
+produced by the diff program and applies those differences to one or more \
+original files, producing patched versions."
+SECTION = "utils"
+HOMEPAGE = "http://savannah.gnu.org/projects/patch/"
+
+SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz"
+S = "${WORKDIR}/patch-${PV}"
+
+inherit autotools update-alternatives
+
+ALTERNATIVE_${PN} = "patch"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/patch/patch/0002-Fix-segfault-with-mangled-rename-patch.patch b/poky/meta/recipes-devtools/patch/patch/0002-Fix-segfault-with-mangled-rename-patch.patch
new file mode 100644
index 000000000..b0bd6fa83
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch/0002-Fix-segfault-with-mangled-rename-patch.patch
@@ -0,0 +1,35 @@
+From f290f48a621867084884bfff87f8093c15195e6a Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@gnu.org>
+Date: Mon, 12 Feb 2018 16:48:24 +0100
+Subject: [PATCH] Fix segfault with mangled rename patch
+
+http://savannah.gnu.org/bugs/?53132
+* src/pch.c (intuit_diff_type): Ensure that two filenames are specified
+for renames and copies (fix the existing check).
+
+Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/patch.git/commit/?id=f290f48a621867084884bfff87f8093c15195e6a]
+CVE: CVE-2018-6951
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ src/pch.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/pch.c b/src/pch.c
+index ff9ed2c..bc6278c 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -974,7 +974,8 @@ intuit_diff_type (bool need_header, mode_t *p_file_type)
+ if ((pch_rename () || pch_copy ())
+ && ! inname
+ && ! ((i == OLD || i == NEW) &&
+- p_name[! reverse] &&
++ p_name[reverse] && p_name[! reverse] &&
++ name_is_valid (p_name[reverse]) &&
+ name_is_valid (p_name[! reverse])))
+ {
+ say ("Cannot %s file without two valid file names\n", pch_rename () ? "rename" : "copy");
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/patch/patch/0003-Allow-input-files-to-be-missing-for-ed-style-patches.patch b/poky/meta/recipes-devtools/patch/patch/0003-Allow-input-files-to-be-missing-for-ed-style-patches.patch
new file mode 100644
index 000000000..2a09d0c03
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch/0003-Allow-input-files-to-be-missing-for-ed-style-patches.patch
@@ -0,0 +1,38 @@
+From b5a91a01e5d0897facdd0f49d64b76b0f02b43e1 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@gnu.org>
+Date: Fri, 6 Apr 2018 11:34:51 +0200
+Subject: [PATCH] Allow input files to be missing for ed-style patches
+
+* src/pch.c (do_ed_script): Allow input files to be missing so that new
+files will be created as with non-ed-style patches.
+
+Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/patch.git/commit/?id=b5a91a01e5d0897facdd0f49d64b76b0f02b43e1]
+CVE: CVE-2018-1000156
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/pch.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/pch.c b/src/pch.c
+index bc6278c..0c5cc26 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -2394,9 +2394,11 @@ do_ed_script (char const *inname, char const *outname,
+
+ if (! dry_run && ! skip_rest_of_patch) {
+ int exclusive = *outname_needs_removal ? 0 : O_EXCL;
+- assert (! inerrno);
+- *outname_needs_removal = true;
+- copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
++ if (inerrno != ENOENT)
++ {
++ *outname_needs_removal = true;
++ copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
++ }
+ sprintf (buf, "%s %s%s", editor_program,
+ verbosity == VERBOSE ? "" : "- ",
+ outname);
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/patch/patch/0004-Fix-arbitrary-command-execution-in-ed-style-patches-.patch b/poky/meta/recipes-devtools/patch/patch/0004-Fix-arbitrary-command-execution-in-ed-style-patches-.patch
new file mode 100644
index 000000000..d74c2f182
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch/0004-Fix-arbitrary-command-execution-in-ed-style-patches-.patch
@@ -0,0 +1,215 @@
+From 123eaff0d5d1aebe128295959435b9ca5909c26d Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@gnu.org>
+Date: Fri, 6 Apr 2018 12:14:49 +0200
+Subject: [PATCH] Fix arbitrary command execution in ed-style patches (CVE-2018-1000156)
+
+* src/pch.c (do_ed_script): Write ed script to a temporary file instead
+of piping it to ed: this will cause ed to abort on invalid commands
+instead of rejecting them and carrying on.
+* tests/ed-style: New test case.
+* tests/Makefile.am (TESTS): Add test case.
+
+Upstream-Status: Backport [http://git.savannah.gnu.org/cgit/patch.git/commit/?id=123eaff0d5d1aebe128295959435b9ca5909c26d]
+CVE: CVE-2018-1000156
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/pch.c | 91 ++++++++++++++++++++++++++++++++++++++++---------------
+ tests/Makefile.am | 1 +
+ tests/ed-style | 41 +++++++++++++++++++++++++
+ 3 files changed, 108 insertions(+), 25 deletions(-)
+ create mode 100644 tests/ed-style
+
+diff --git a/src/pch.c b/src/pch.c
+index 0c5cc26..4fd5a05 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -33,6 +33,7 @@
+ # include <io.h>
+ #endif
+ #include <safe.h>
++#include <sys/wait.h>
+
+ #define INITHUNKMAX 125 /* initial dynamic allocation size */
+
+@@ -2389,24 +2390,28 @@ do_ed_script (char const *inname, char const *outname,
+ static char const editor_program[] = EDITOR_PROGRAM;
+
+ file_offset beginning_of_this_line;
+- FILE *pipefp = 0;
+ size_t chars_read;
++ FILE *tmpfp = 0;
++ char const *tmpname;
++ int tmpfd;
++ pid_t pid;
++
++ if (! dry_run && ! skip_rest_of_patch)
++ {
++ /* Write ed script to a temporary file. This causes ed to abort on
++ invalid commands such as when line numbers or ranges exceed the
++ number of available lines. When ed reads from a pipe, it rejects
++ invalid commands and treats the next line as a new command, which
++ can lead to arbitrary command execution. */
++
++ tmpfd = make_tempfile (&tmpname, 'e', NULL, O_RDWR | O_BINARY, 0);
++ if (tmpfd == -1)
++ pfatal ("Can't create temporary file %s", quotearg (tmpname));
++ tmpfp = fdopen (tmpfd, "w+b");
++ if (! tmpfp)
++ pfatal ("Can't open stream for file %s", quotearg (tmpname));
++ }
+
+- if (! dry_run && ! skip_rest_of_patch) {
+- int exclusive = *outname_needs_removal ? 0 : O_EXCL;
+- if (inerrno != ENOENT)
+- {
+- *outname_needs_removal = true;
+- copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
+- }
+- sprintf (buf, "%s %s%s", editor_program,
+- verbosity == VERBOSE ? "" : "- ",
+- outname);
+- fflush (stdout);
+- pipefp = popen(buf, binary_transput ? "wb" : "w");
+- if (!pipefp)
+- pfatal ("Can't open pipe to %s", quotearg (buf));
+- }
+ for (;;) {
+ char ed_command_letter;
+ beginning_of_this_line = file_tell (pfp);
+@@ -2417,14 +2422,14 @@ do_ed_script (char const *inname, char const *outname,
+ }
+ ed_command_letter = get_ed_command_letter (buf);
+ if (ed_command_letter) {
+- if (pipefp)
+- if (! fwrite (buf, sizeof *buf, chars_read, pipefp))
++ if (tmpfp)
++ if (! fwrite (buf, sizeof *buf, chars_read, tmpfp))
+ write_fatal ();
+ if (ed_command_letter != 'd' && ed_command_letter != 's') {
+ p_pass_comments_through = true;
+ while ((chars_read = get_line ()) != 0) {
+- if (pipefp)
+- if (! fwrite (buf, sizeof *buf, chars_read, pipefp))
++ if (tmpfp)
++ if (! fwrite (buf, sizeof *buf, chars_read, tmpfp))
+ write_fatal ();
+ if (chars_read == 2 && strEQ (buf, ".\n"))
+ break;
+@@ -2437,13 +2442,49 @@ do_ed_script (char const *inname, char const *outname,
+ break;
+ }
+ }
+- if (!pipefp)
++ if (!tmpfp)
+ return;
+- if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0
+- || fflush (pipefp) != 0)
++ if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, tmpfp) == 0
++ || fflush (tmpfp) != 0)
+ write_fatal ();
+- if (pclose (pipefp) != 0)
+- fatal ("%s FAILED", editor_program);
++
++ if (lseek (tmpfd, 0, SEEK_SET) == -1)
++ pfatal ("Can't rewind to the beginning of file %s", quotearg (tmpname));
++
++ if (! dry_run && ! skip_rest_of_patch) {
++ int exclusive = *outname_needs_removal ? 0 : O_EXCL;
++ *outname_needs_removal = true;
++ if (inerrno != ENOENT)
++ {
++ *outname_needs_removal = true;
++ copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
++ }
++ sprintf (buf, "%s %s%s", editor_program,
++ verbosity == VERBOSE ? "" : "- ",
++ outname);
++ fflush (stdout);
++
++ pid = fork();
++ if (pid == -1)
++ pfatal ("Can't fork");
++ else if (pid == 0)
++ {
++ dup2 (tmpfd, 0);
++ execl ("/bin/sh", "sh", "-c", buf, (char *) 0);
++ _exit (2);
++ }
++ else
++ {
++ int wstatus;
++ if (waitpid (pid, &wstatus, 0) == -1
++ || ! WIFEXITED (wstatus)
++ || WEXITSTATUS (wstatus) != 0)
++ fatal ("%s FAILED", editor_program);
++ }
++ }
++
++ fclose (tmpfp);
++ safe_unlink (tmpname);
+
+ if (ofp)
+ {
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 6b6df63..16f8693 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -32,6 +32,7 @@ TESTS = \
+ crlf-handling \
+ dash-o-append \
+ deep-directories \
++ ed-style \
+ empty-files \
+ false-match \
+ fifo \
+diff --git a/tests/ed-style b/tests/ed-style
+new file mode 100644
+index 0000000..d8c0689
+--- /dev/null
++++ b/tests/ed-style
+@@ -0,0 +1,41 @@
++# Copyright (C) 2018 Free Software Foundation, Inc.
++#
++# Copying and distribution of this file, with or without modification,
++# in any medium, are permitted without royalty provided the copyright
++# notice and this notice are preserved.
++
++. $srcdir/test-lib.sh
++
++require cat
++use_local_patch
++use_tmpdir
++
++# ==============================================================
++
++cat > ed1.diff <<EOF
++0a
++foo
++.
++EOF
++
++check 'patch -e foo -i ed1.diff' <<EOF
++EOF
++
++check 'cat foo' <<EOF
++foo
++EOF
++
++cat > ed2.diff <<EOF
++1337a
++r !echo bar
++,p
++EOF
++
++check 'patch -e foo -i ed2.diff 2> /dev/null || echo "Status: $?"' <<EOF
++?
++Status: 2
++EOF
++
++check 'cat foo' <<EOF
++foo
++EOF
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/patch/patch_2.7.6.bb b/poky/meta/recipes-devtools/patch/patch_2.7.6.bb
new file mode 100644
index 000000000..823486dd0
--- /dev/null
+++ b/poky/meta/recipes-devtools/patch/patch_2.7.6.bb
@@ -0,0 +1,19 @@
+require patch.inc
+LICENSE = "GPLv3"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0002-Fix-segfault-with-mangled-rename-patch.patch \
+ file://0003-Allow-input-files-to-be-missing-for-ed-style-patches.patch \
+ file://0004-Fix-arbitrary-command-execution-in-ed-style-patches-.patch \
+"
+
+SRC_URI[md5sum] = "4c68cee989d83c87b00a3860bcd05600"
+SRC_URI[sha256sum] = "8cf86e00ad3aaa6d26aca30640e86b0e3e1f395ed99f189b06d4c9f74bc58a4e"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+acpaths = "-I ${S}/m4 "
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'xattr', d)}"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/Increase-maxSize-to-64MB.patch b/poky/meta/recipes-devtools/patchelf/patchelf/Increase-maxSize-to-64MB.patch
new file mode 100644
index 000000000..49050a18d
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/Increase-maxSize-to-64MB.patch
@@ -0,0 +1,46 @@
+From e3658740ec100e4c8cf83295460b032979e1a99a Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Fri, 9 Sep 2016 18:21:32 -0300
+Subject: [PATCH] Increase maxSize to 64MB
+Organization: O.S. Systems Software LTDA.
+
+Fix error:
+
+/
+|ERROR: qemu-native-2.5.0-r1 do_populate_sysroot_setscene: '('patchelf-uninative',
+|'--set-interpreter', '../build/tmp/sysroots-uninative/x86_64-linux/lib/
+|ld-linux-x86-64.so.2', '../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/
+|sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64')'
+|failed with exit code 1 and the following output:
+|warning: working around a Linux kernel bug by creating a hole of 36032512
+|bytes in ‘../build/tmp/work/x86_64-linux/qemu-native/2.5.0-r1/
+|sstate-install-populate_sysroot/x86_64-linux/usr/bin/qemu-mips64’
+|maximum file size exceeded
+\
+
+Similar issue is discussed here:
+https://github.com/NixOS/patchelf/issues/47
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/patchelf.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index a59c12d..0fd7355 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -279,7 +279,7 @@ static void readFile(string fileName)
+ struct stat st;
+ if (stat(fileName.c_str(), &st) != 0) error("stat");
+ fileSize = st.st_size;
+- maxSize = fileSize + 32 * 1024 * 1024;
++ maxSize = fileSize + 64 * 1024 * 1024;
+
+ contents = (unsigned char *) malloc(fileSize + maxSize);
+ if (!contents) abort();
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/Skip-empty-section-fixes-66.patch b/poky/meta/recipes-devtools/patchelf/patchelf/Skip-empty-section-fixes-66.patch
new file mode 100644
index 000000000..9ee8a554a
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/Skip-empty-section-fixes-66.patch
@@ -0,0 +1,30 @@
+From 73526cb546ae6b00ea6169e40b01fb7b5f0dbb50 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Thu, 28 Jul 2016 11:05:06 -0300
+Subject: [PATCH] Skip empty section (fixes #66)
+Organization: O.S. Systems Software LTDA.
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/patchelf.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index 136098f..2677a26 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -684,6 +684,9 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsExecutable()
+ for (unsigned int i = 1; i <= lastReplaced; ++i) {
+ Elf_Shdr & shdr(shdrs[i]);
+ string sectionName = getSectionName(shdr);
++ if (sectionName == "") {
++ continue;
++ }
+ debug("looking at section `%s'\n", sectionName.c_str());
+ /* !!! Why do we stop after a .dynstr section? I can't
+ remember! */
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch b/poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch
new file mode 100644
index 000000000..0b45c39bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/avoidholes.patch
@@ -0,0 +1,163 @@
+Different types of binaries create challenges for patchelf. In order to extend
+sections they need to be moved within the binary. The current approach to
+handling ET_DYN binaries is to move the INTERP section to the end of the file.
+This means changing PT_PHDR to add an extra PT_LOAD section so that the new section
+is mmaped into memory by the elf loader in the kernel. In order to extend PHDR,
+this means moving it to the end of the file.
+
+Its documented in patchelf there is a kernel 'bug' which means that if you have holes
+in memory between the base load address and the PT_LOAD segment that contains PHDR,
+it will pass an incorrect PHDR address to ld.so and fail to load the binary, segfaulting.
+
+To avoid this, the code currently inserts space into the binary to ensure that when
+loaded into memory there are no holes between the PT_LOAD sections. This inflates the
+binaries by many MBs in some cases. Whilst we could make them sparse, there is a second
+issue which is that strip can fail to process these binaries:
+
+$ strip fixincl
+Not enough room for program headers, try linking with -N
+[.note.ABI-tag]: Bad value
+
+This turns out to be due to libbfd not liking the relocated PHDR section either
+(https://github.com/NixOS/patchelf/issues/10).
+
+Instead this patch implements a different approach, leaving PHDR where it is but extending
+it in place to allow addition of a new PT_LOAD section. This overwrites sections in the
+binary but those get moved to the end of the file in the new PT_LOAD section.
+
+This is based on patches linked from the above github issue, however whilst the idea
+was good, the implementation wasn't correct and they've been rewritten here.
+
+RP
+2017/3/7
+
+Upstream-Status: Accepted
+
+Index: patchelf-0.9/src/patchelf.cc
+===================================================================
+--- patchelf-0.9.orig/src/patchelf.cc
++++ patchelf-0.9/src/patchelf.cc
+@@ -146,6 +146,8 @@ private:
+ string & replaceSection(const SectionName & sectionName,
+ unsigned int size);
+
++ bool haveReplacedSection(const SectionName & sectionName);
++
+ void writeReplacedSections(Elf_Off & curOff,
+ Elf_Addr startAddr, Elf_Off startOffset);
+
+@@ -497,6 +499,16 @@ unsigned int ElfFile<ElfFileParamNames>:
+ return 0;
+ }
+
++template<ElfFileParams>
++bool ElfFile<ElfFileParamNames>::haveReplacedSection(const SectionName & sectionName)
++{
++ ReplacedSections::iterator i = replacedSections.find(sectionName);
++
++ if (i != replacedSections.end())
++ return true;
++ return false;
++}
++
+
+ template<ElfFileParams>
+ string & ElfFile<ElfFileParamNames>::replaceSection(const SectionName & sectionName,
+@@ -595,52 +607,52 @@ void ElfFile<ElfFileParamNames>::rewrite
+
+ debug("last page is 0x%llx\n", (unsigned long long) startPage);
+
++ /* Because we're adding a new section header, we're necessarily increasing
++ the size of the program header table. This can cause the first section
++ to overlap the program header table in memory; we need to shift the first
++ few segments to someplace else. */
++ /* Some sections may already be replaced so account for that */
++ unsigned int i = 1;
++ Elf_Addr pht_size = sizeof(Elf_Ehdr) + (phdrs.size() + 1)*sizeof(Elf_Phdr);
++ while( shdrs[i].sh_addr <= pht_size && i < rdi(hdr->e_shnum) ) {
++ if (not haveReplacedSection(getSectionName(shdrs[i])))
++ replaceSection(getSectionName(shdrs[i]), shdrs[i].sh_size);
++ i++;
++ }
+
+- /* Compute the total space needed for the replaced sections and
+- the program headers. */
+- off_t neededSpace = (phdrs.size() + 1) * sizeof(Elf_Phdr);
++ /* Compute the total space needed for the replaced sections */
++ off_t neededSpace = 0;
+ for (ReplacedSections::iterator i = replacedSections.begin();
+ i != replacedSections.end(); ++i)
+ neededSpace += roundUp(i->second.size(), sectionAlignment);
+ debug("needed space is %d\n", neededSpace);
+
+-
+ size_t startOffset = roundUp(fileSize, getPageSize());
+
+ growFile(startOffset + neededSpace);
+
+-
+ /* Even though this file is of type ET_DYN, it could actually be
+ an executable. For instance, Gold produces executables marked
+- ET_DYN. In that case we can still hit the kernel bug that
+- necessitated rewriteSectionsExecutable(). However, such
+- executables also tend to start at virtual address 0, so
++ ET_DYN as does LD when linking with pie. If we move PT_PHDR, it
++ has to stay in the first PT_LOAD segment or any subsequent ones
++ if they're continuous in memory due to linux kernel constraints
++ (see BUGS). Since the end of the file would be after bss, we can't
++ move PHDR there, we therefore choose to leave PT_PHDR where it is but
++ move enough following sections such that we can add the extra PT_LOAD
++ section to it. This PT_LOAD segment ensures the sections at the end of
++ the file are mapped into memory for ld.so to process.
++ We can't use the approach in rewriteSectionsExecutable()
++ since DYN executables tend to start at virtual address 0, so
+ rewriteSectionsExecutable() won't work because it doesn't have
+- any virtual address space to grow downwards into. As a
+- workaround, make sure that the virtual address of our new
+- PT_LOAD segment relative to the first PT_LOAD segment is equal
+- to its offset; otherwise we hit the kernel bug. This may
+- require creating a hole in the executable. The bigger the size
+- of the uninitialised data segment, the bigger the hole. */
++ any virtual address space to grow downwards into. */
+ if (isExecutable) {
+ if (startOffset >= startPage) {
+ debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
+- } else {
+- size_t hole = startPage - startOffset;
+- /* Print a warning, because the hole could be very big. */
+- fprintf(stderr, "warning: working around a Linux kernel bug by creating a hole of %zu bytes in ‘%s’\n", hole, fileName.c_str());
+- assert(hole % getPageSize() == 0);
+- /* !!! We could create an actual hole in the file here,
+- but it's probably not worth the effort. */
+- growFile(fileSize + hole);
+- startOffset += hole;
+ }
+ startPage = startOffset;
+ }
+
+-
+- /* Add a segment that maps the replaced sections and program
+- headers into memory. */
++ /* Add a segment that maps the replaced sections into memory. */
+ phdrs.resize(rdi(hdr->e_phnum) + 1);
+ wri(hdr->e_phnum, rdi(hdr->e_phnum) + 1);
+ Elf_Phdr & phdr = phdrs[rdi(hdr->e_phnum) - 1];
+@@ -653,15 +665,12 @@ void ElfFile<ElfFileParamNames>::rewrite
+
+
+ /* Write out the replaced sections. */
+- Elf_Off curOff = startOffset + phdrs.size() * sizeof(Elf_Phdr);
++ Elf_Off curOff = startOffset;
+ writeReplacedSections(curOff, startPage, startOffset);
+ assert(curOff == startOffset + neededSpace);
+
+-
+- /* Move the program header to the start of the new area. */
+- wri(hdr->e_phoff, startOffset);
+-
+- rewriteHeaders(startPage);
++ /* Write out the updated program and section headers */
++ rewriteHeaders(hdr->e_phoff);
+ }
+
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch b/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch
new file mode 100644
index 000000000..f64cbed5c
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/fix-adjusting-startPage.patch
@@ -0,0 +1,38 @@
+commit 1cc234fea5600190d872329aca60e2365cefc39e
+Author: Ed Bartosh <ed.bartosh@linux.intel.com>
+Date: Fri Jul 21 12:33:53 2017 +0300
+
+fix adjusting startPage
+
+startPage is adjusted unconditionally for all executables.
+This results in incorrect addresses assigned to INTERP and LOAD
+program headers, which breaks patched executable.
+
+Adjusting startPage variable only when startOffset > startPage
+should fix this.
+
+This change is related to the issue NixOS#10
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+Github PR: https://github.com/NixOS/patchelf/pull/127
+
+Upstream-Status: Submitted
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index cbd36c0..e9d7ea5 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -720,10 +720,8 @@ void ElfFile<ElfFileParamNames>::rewriteSectionsLibrary()
+ since DYN executables tend to start at virtual address 0, so
+ rewriteSectionsExecutable() won't work because it doesn't have
+ any virtual address space to grow downwards into. */
+- if (isExecutable) {
+- if (startOffset >= startPage) {
+- debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
+- }
++ if (isExecutable && startOffset > startPage) {
++ debug("shifting new PT_LOAD segment by %d bytes to work around a Linux kernel bug\n", startOffset - startPage);
+ startPage = startOffset;
+ }
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
new file mode 100644
index 000000000..9fafec4b5
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf/handle-read-only-files.patch
@@ -0,0 +1,53 @@
+From 2a603acb65993698c21f1c6eb7664f93ad830d52 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Fri, 9 Sep 2016 16:00:42 -0300
+Subject: [PATCH] handle read-only files
+Organization: O.S. Systems Software LTDA.
+
+Patch from:
+https://github.com/darealshinji/patchelf/commit/40e66392bc4b96e9b4eda496827d26348a503509
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/patchelf.cc | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/src/patchelf.cc b/src/patchelf.cc
+index 136098f..aea360e 100644
+--- a/src/patchelf.cc
++++ b/src/patchelf.cc
+@@ -388,7 +388,17 @@ void ElfFile<ElfFileParamNames>::sortShdrs()
+
+ static void writeFile(string fileName)
+ {
+- int fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
++ struct stat st;
++ int fd;
++
++ if (stat(fileName.c_str(), &st) != 0)
++ error("stat");
++
++ if (chmod(fileName.c_str(), 0600) != 0)
++ error("chmod");
++
++ fd = open(fileName.c_str(), O_TRUNC | O_WRONLY);
++
+ if (fd == -1)
+ error("open");
+
+@@ -397,6 +407,10 @@ static void writeFile(string fileName)
+
+ if (close(fd) != 0)
+ error("close");
++
++ if (chmod(fileName.c_str(), st.st_mode) != 0)
++ error("chmod");
++
+ }
+
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb b/poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb
new file mode 100644
index 000000000..d70303963
--- /dev/null
+++ b/poky/meta/recipes-devtools/patchelf/patchelf_0.9.bb
@@ -0,0 +1,19 @@
+SRC_URI = "http://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2 \
+ file://Skip-empty-section-fixes-66.patch \
+ file://handle-read-only-files.patch \
+ file://Increase-maxSize-to-64MB.patch \
+ file://avoidholes.patch \
+ file://fix-adjusting-startPage.patch \
+"
+
+LICENSE = "GPLv3"
+SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries"
+
+SRC_URI[md5sum] = "d02687629c7e1698a486a93a0d607947"
+SRC_URI[sha256sum] = "a0f65c1ba148890e9f2f7823f4bedf7ecad5417772f64f994004f59a39014f83"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb b/poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb
new file mode 100644
index 000000000..9635a5e70
--- /dev/null
+++ b/poky/meta/recipes-devtools/pax-utils/pax-utils_1.2.2.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Security-focused ELF files checking tool"
+DESCRIPTION = "This is a small set of various PaX aware and related \
+utilities for ELF binaries. It can check ELF binary files and running \
+processes for issues that might be relevant when using ELF binaries \
+along with PaX, such as non-PIC code or executable stack and heap."
+HOMEPAGE = "http://www.gentoo.org/proj/en/hardened/pax-utils.xml"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "https://dev.gentoo.org/~vapier/dist/pax-utils-${PV}.tar.xz"
+SRC_URI[md5sum] = "a580468318f0ff42edf4a8cd314cc942"
+SRC_URI[sha256sum] = "7f4a7f8db6b4743adde7582fa48992ad01776796fcde030683732f56221337d9"
+
+RDEPENDS_${PN} += "bash"
+
+export GNULIB_OVERRIDES_WINT_T = "0"
+
+do_configure_prepend() {
+ touch ${S}/NEWS ${S}/AUTHORS ${S}/ChangeLog ${S}/README
+}
+
+do_install() {
+ oe_runmake PREFIX=${D}${prefix} DESTDIR=${D} install
+}
+
+BBCLASSEXTEND = "native"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[libcap] = "--with-caps, --without-caps, libcap"
+PACKAGECONFIG[libseccomp] = "--with-seccomp, --without-seccomp, libseccomp"
+PACKAGECONFIG[pyelftools] = "--with-python, --without-python,, pyelftools"
+
+EXTRA_OECONF += "--enable-largefile"
diff --git a/poky/meta/recipes-devtools/perl/liberror-perl_0.17025.bb b/poky/meta/recipes-devtools/perl/liberror-perl_0.17025.bb
new file mode 100644
index 000000000..f6dc30d07
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/liberror-perl_0.17025.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Error - Error/exception handling in an OO-ish way"
+DESCRIPTION = "The Error package provides two interfaces. Firstly \
+Error provides a procedural interface to exception handling. \
+Secondly Error is a base class for errors/exceptions that can \
+either be thrown, for subsequent catch, or can simply be recorded."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8f3499d09ee74a050c0319391ff9d100"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1a2ee7f0dc44f9ee76661a16bbbc0c48"
+SRC_URI[sha256sum] = "6c9f474ad3d4fe0cabff6b6be532cb1dd348245986d4a6b600ad921d5cfdefaf"
+
+S = "${WORKDIR}/Error-${PV}"
+
+inherit cpan ptest-perl
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+do_install_prepend() {
+ # test requires "-T" (taint) command line option
+ rm -rf ${B}/t/pod-coverage.t
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb b/poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb
new file mode 100644
index 000000000..e5ab7a33c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/libtest-needs-perl_0.002005.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Skip tests when modules not available"
+DESCRIPTION = "Skip test scripts if modules are not available. \
+The requested modules will be loaded, and optionally have their versions \
+checked. If the module is missing, the test script will be skipped. Modules \
+that are found but fail to compile will exit with an error rather than skip."
+
+HOMEPAGE = "https://metacpan.org/release/Test-Needs"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+CPAN_NAME = "Test-Needs"
+CPAN_AUTHOR = "HAARG"
+
+LIC_FILES_CHKSUM = "file://README;md5=3f3ccd21a0a48aa313db212cc3b1bc09;beginline=81;endline=82"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://www.cpan.org/authors/id/H/HA/${CPAN_AUTHOR}/${CPAN_NAME}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "356634a56c99282e8059f290f5d534c8"
+SRC_URI[sha256sum] = "5a4f33983586edacdbe00a3b429a9834190140190dab28d0f873c394eb7df399"
+
+S = "${WORKDIR}/${CPAN_NAME}-${PV}"
+
+inherit cpan ptest-perl
+
+RDEPENDS_${PN}-ptest += "perl-module-test-more"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/perl/liburi-perl_1.73.bb b/poky/meta/recipes-devtools/perl/liburi-perl_1.73.bb
new file mode 100644
index 000000000..49238f3df
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/liburi-perl_1.73.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Perl module to manipulate and access URI strings"
+DESCRIPTION = "This package contains the URI.pm module with friends. \
+The module implements the URI class. URI objects can be used to access \
+and manipulate the various components that make up these strings."
+
+HOMEPAGE = "http://search.cpan.org/dist/URI/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c453e94fae672800f83bc1bd7a38b53f"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://www.cpan.org/authors/id/E/ET/ETHER/URI-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "37d44a08e599aa945b32a9434ffe00a5"
+SRC_URI[sha256sum] = "cca7ab4a6f63f3ccaacae0f2e1337e8edf84137e73f18548ec7d659f23efe413"
+
+S = "${WORKDIR}/URI-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan ptest-perl
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+do_install_prepend() {
+ # these tests require "-T" (taint) command line option
+ rm -rf ${B}/t/cwd.t
+ rm -rf ${B}/t/file.t
+}
+
+RDEPENDS_${PN}-ptest += "libtest-needs-perl"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb b/poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
new file mode 100644
index 000000000..c5e0ae676
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
@@ -0,0 +1,46 @@
+SUMMARY = "XML::Parser - A perl module for parsing XML documents"
+HOMEPAGE = "https://libexpat.github.io/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=2;endline=6;md5=c8767d7516229f07b26e42d1cf8b51f1"
+
+DEPENDS += "expat"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Parser-${PV}.tar.gz"
+SRC_URI[md5sum] = "af4813fe3952362451201ced6fbce379"
+SRC_URI[sha256sum] = "1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216"
+
+S = "${WORKDIR}/XML-Parser-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR} CC='${CC}' LD='${CCLD}' FULL_AR='${AR}'"
+
+inherit cpan ptest-perl
+
+# fix up sub MakeMaker project as arguments don't get propagated though
+# see https://rt.cpan.org/Public/Bug/Display.html?id=28632
+do_configure_append() {
+ sed 's:--sysroot=.*\(\s\|$\):--sysroot=${STAGING_DIR_TARGET} :g' -i Makefile Expat/Makefile
+ sed 's:^FULL_AR = .*:FULL_AR = ${AR}:g' -i Expat/Makefile
+ # make sure these two do not build in parallel
+ sed 's!^$(INST_DYNAMIC):!$(INST_DYNAMIC): $(BOOTSTRAP)!' -i Expat/Makefile
+}
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
+do_compile_class-native() {
+ cpan_do_compile
+}
+
+do_install_ptest() {
+ sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:g" ${B}/samples/xmlstats
+ sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:g" ${B}/samples/xmlfilter
+ sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:g" ${B}/samples/xmlcomments
+ sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:g" ${B}/samples/canonical
+ cp -r ${B}/samples ${D}${PTEST_PATH}
+ chown -R root:root ${D}${PTEST_PATH}/samples
+}
+
+BBCLASSEXTEND="native nativesdk"
diff --git a/poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb b/poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
new file mode 100644
index 000000000..0f6099868
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/libxml-perl_0.08.bb
@@ -0,0 +1,28 @@
+DESCRIPTION = "libxml-perl is a collection of smaller Perl modules, scripts, and \
+documents for working with XML in Perl. libxml-perl software \
+works in combination with XML::Parser, PerlSAX, XML::DOM, \
+XML::Grove and others."
+HOMEPAGE = "http://search.cpan.org/dist/libxml-perl/"
+SUMMARY = "Collection of Perl modules for working with XML"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://README;beginline=33;endline=35;md5=1705549eef7577a3d6ba71123a1f0ce8"
+
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0ed5fbdda53d1301ddaed88db10503bb"
+SRC_URI[sha256sum] = "4571059b7b5d48b7ce52b01389e95d798bf5cf2020523c153ff27b498153c9cb"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan ptest-perl
+
+do_compile() {
+ export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+ cpan_do_compile
+}
+
diff --git a/poky/meta/recipes-devtools/perl/libxml-simple-perl_2.24.bb b/poky/meta/recipes-devtools/perl/libxml-simple-perl_2.24.bb
new file mode 100644
index 000000000..f9d00d2e2
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/libxml-simple-perl_2.24.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Perl module for reading and writing XML"
+DESCRIPTION = "The XML::Simple Perl module provides a simple API layer \
+on top of an underlying XML parsing module to maintain XML files \
+(especially configuration files). It is a blunt rewrite of XML::Simple \
+(by Grant McLean) to use the XML::LibXML parser for XML structures, \
+where the original uses plain Perl or SAX parsers."
+HOMEPAGE = "http://search.cpan.org/~markov/XML-LibXML-Simple-0.93/lib/XML/LibXML/Simple.pod"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=23477e18a0d04392cdf44ae70e49b495"
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Simple-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1cd2e8e3421160c42277523d5b2f4dd2"
+SRC_URI[sha256sum] = "9a14819fd17c75fbb90adcec0446ceab356cab0ccaff870f2e1659205dc2424f"
+
+S = "${WORKDIR}/XML-Simple-${PV}"
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+inherit cpan ptest-perl
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb b/poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb
new file mode 100644
index 000000000..71f45890b
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl-native_5.24.1.bb
@@ -0,0 +1,139 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "db-native grep-native gdbm-native zlib-native"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+SRC_URI += "\
+ file://Configure-multilib.patch \
+ file://perl-configpm-switch.patch \
+ file://native-nopacklist.patch \
+ file://native-perlinc.patch \
+ file://MM_Unix.pm.patch \
+ file://debian/errno_ver.diff \
+ file://dynaloaderhack.patch \
+ file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+ file://0001-Configure-Remove-fstack-protector-strong-for-native-.patch \
+ file://perl-5.26.1-guard_old_libcrypt_fix.patch \
+ "
+
+SRC_URI[md5sum] = "af6a84c7c3e2b8b269c105a5db2f6d53"
+SRC_URI[sha256sum] = "03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f"
+
+inherit native
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+export LD="${CCLD}"
+
+do_configure () {
+ ./Configure \
+ -Dcc="${CC}" \
+ -Dcflags="${CFLAGS}" \
+ -Dldflags="${LDFLAGS}" \
+ -Dlddlflags="${LDFLAGS} -shared" \
+ -Dcf_by="Open Embedded" \
+ -Dprefix=${prefix} \
+ -Dvendorprefix=${prefix} \
+ -Dsiteprefix=${prefix} \
+ \
+ -Dbin=${STAGING_BINDIR}/${PN} \
+ -Dprivlib=${STAGING_LIBDIR}/perl/${PV} \
+ -Darchlib=${STAGING_LIBDIR}/perl/${PV} \
+ -Dvendorlib=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
+ -Dvendorarch=${STAGING_LIBDIR}/perl/vendor_perl/${PV} \
+ -Dsitelib=${STAGING_LIBDIR}/perl/site_perl/${PV} \
+ -Dsitearch=${STAGING_LIBDIR}/perl/site_perl/${PV} \
+ \
+ -Duseshrplib \
+ -Dusethreads \
+ -Duseithreads \
+ -Duselargefiles \
+ -Dnoextensions=ODBM_File \
+ -Ud_dosuid \
+ -Ui_db \
+ -Ui_ndbm \
+ -Ui_gdbm \
+ -Ui_gdbm_ndbm \
+ -Ui_gdbmndbm \
+ -Di_shadow \
+ -Di_syslog \
+ -Duseperlio \
+ -Dman3ext=3pm \
+ -Dsed=/bin/sed \
+ -Uafs \
+ -Ud_csh \
+ -Uusesfio \
+ -Uusenm -des
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+
+ # We need a hostperl link for building perl
+ ln -sf perl${PV} ${D}${bindir}/hostperl
+
+ ln -sf perl ${D}${libdir}/perl5
+
+ install -d ${D}${libdir}/perl/${PV}/CORE \
+ ${D}${datadir}/perl/${PV}/ExtUtils
+
+ # Save native config
+ install config.sh ${D}${libdir}/perl
+ install lib/Config.pm ${D}${libdir}/perl/${PV}/
+ install lib/ExtUtils/typemap ${D}${libdir}/perl/${PV}/ExtUtils/
+
+ # perl shared library headers
+ # reference perl 5.20.0-1 in debian:
+ # https://packages.debian.org/experimental/i386/perl/filelist
+ for i in av.h bitcount.h charclass_invlists.h config.h cop.h cv.h dosish.h \
+ embed.h embedvar.h EXTERN.h fakesdio.h feature.h form.h git_version.h \
+ gv.h handy.h hv_func.h hv.h inline.h INTERN.h intrpvar.h iperlsys.h \
+ keywords.h l1_char_class_tab.h malloc_ctl.h metaconfig.h mg_data.h \
+ mg.h mg_raw.h mg_vtable.h mydtrace.h nostdio.h opcode.h op.h \
+ opnames.h op_reg_common.h overload.h pad.h parser.h patchlevel.h \
+ perlapi.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h \
+ pp.h pp_proto.h proto.h reentr.h regcharclass.h regcomp.h regexp.h \
+ regnodes.h scope.h sv.h thread.h time64_config.h time64.h uconfig.h \
+ unicode_constants.h unixish.h utf8.h utfebcdic.h util.h uudmap.h \
+ vutil.h warnings.h XSUB.h
+ do
+ install $i ${D}${libdir}/perl/${PV}/CORE
+ done
+
+ # Those wrappers mean that perl installed from sstate (which may change
+ # path location) works and that in the nativesdk case, the SDK can be
+ # installed to a different location from the one it was built for.
+ create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
+ create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}:${STAGING_LIBDIR}/perl/${PV}'
+
+ # Use /usr/bin/env nativeperl for the perl script.
+ for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
+ sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
+ done
+
+ # The packlist is large with hardcoded paths meaning it needs relocating
+ # so just remove it.
+ rm ${D}${libdir}/perl/${PV}/.packlist
+}
+
+SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
+
+perl_sysroot_create_wrapper () {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ # Create a wrapper that /usr/bin/env perl will use to get perl-native.
+ # This MUST live in the normal bindir.
+ cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF
+#!/bin/sh
+realpath=\`readlink -fn \$0\`
+exec \`dirname \$realpath\`/perl-native/perl "\$@"
+EOF
+ chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+ cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+}
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
+PACKAGES_DYNAMIC_class-native += "^perl-module-.*native$"
+
diff --git a/poky/meta/recipes-devtools/perl/perl-ptest.inc b/poky/meta/recipes-devtools/perl/perl-ptest.inc
new file mode 100644
index 000000000..6a7a2d7cb
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,57 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+ "
+do_install_ptest () {
+ mkdir -p ${D}${PTEST_PATH}
+ sed -e "s:\/usr\/local:${bindir}:g" -i cpan/version/t/*
+ sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
+ sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
+ tar -c --exclude='*.o' --exclude=libperl.so --exclude=Makefile --exclude=makefile --exclude=hostperl \
+ --exclude=cygwin --exclude=os2 --exclude=djgpp --exclude=qnx --exclude=symbian --exclude=haiku \
+ --exclude=vms --exclude=vos --exclude=NetWare --exclude=amigaos4 --exclude=buildcustomize.pl \
+ --exclude='win32/config.*' --exclude=plan9 --exclude=README.plan9 --exclude=perlplan9.pod --exclude=Configure \
+ --exclude=veryclean.sh --exclude=realclean.sh --exclude=getioctlsizes \
+ --exclude=dl_aix.xs --exclude=sdbm.3 --exclude='cflags.SH' --exclude=makefile.old \
+ --exclude=miniperl --exclude=generate_uudmap --exclude=patches * | ( cd ${D}${PTEST_PATH} && tar -x )
+
+ ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
+
+ # Remove build host references from various scattered files...
+ find "${D}${PTEST_PATH}" \
+ \( -name '*.PL' -o -name 'myconfig' -o -name 'cflags' -o -name '*.pl' -o -name '*.sh' -o -name '*.pm' \
+ -o -name 'h2xs' -o -name 'h2ph' \
+ -o -name '*.h' -o -name 'config.sh-*' -o -name 'pod2man' -o -name 'pod2text' \) \
+ -type f -exec sed -i \
+ -e "s,${D},,g" \
+ -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+ -e "s,-isystem${STAGING_INCDIR} ,,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+ -e "s,${STAGING_LIBDIR},${libdir},g" \
+ -e "s,${STAGING_BINDIR},${bindir},g" \
+ -e "s,${STAGING_INCDIR},${includedir},g" \
+ -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+ -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ {} +
+
+ # Remove a useless timestamp...
+ sed -i -e '/Autogenerated starting on/d' ${D}${PTEST_PATH}/lib/unicore/mktables.lst
+}
+
+python populate_packages_prepend() {
+ # Put all *.t files from the lib dir in the ptest package
+ # do_split_packages requires a pair of () in the regex, but we have nothing
+ # to match, so use an empty pair.
+ if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+ do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
+ '${PN}-ptest%s', '%s', recursive=True, match_path=True)
+}
+
+RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc ${PN}-misc sed libssp"
+
+# The perl-ptest package contains Perl internal modules and generating file
+# dependencies for it causes problems.
+SKIP_FILEDEPS_${PN}-ptest = '1'
diff --git a/poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc b/poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc
new file mode 100644
index 000000000..10e3c0429
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl-rdepends_5.24.1.inc
@@ -0,0 +1,2575 @@
+# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
+
+#jiahongxu:5.20.0-r1$ pwd
+#/home/jiahongxu/yocto/build-20140618-perl/tmp/work/i586-poky-linux/perl/5.20.0-r1
+
+#1 cp -r packages-split packages-split.new && cd packages-split.new
+#2 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
+#3 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm"
+#| sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;" | tr [:upper:] [:lower:]
+#| awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'
+#| grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix
+#| sort -u
+#| sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;'
+#| egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-text-unidecode|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' > /tmp/perl-rdepends
+
+RDEPENDS_perl-misc += "perl perl-modules"
+RDEPENDS_${PN}-pod += "perl"
+
+# Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
+RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
+
+# Depends list
+# copy contents of /tmp/perl-rdepends in this file
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-if"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-user-pwent"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-app-prove-state"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness-env"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-app-prove-state-result"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-writer"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-app-prove-state-result-test"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-constant"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-io-compress-bzip2"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-config"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-zlib"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-vars"
+RDEPENDS_${PN}-module-arybase += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-vars"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fatal"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-overload"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-b"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-lib"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-autodie-scope-guard"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-autodie-scope-guardstack"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-config"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autouse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b-op-private"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-feature"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-overloading"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-re"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-carp"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-constant"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigrat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-blib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-blib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-blib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-terse"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-bytes-heavy"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-carp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-carp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-bytes"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-carp"
+RDEPENDS_${PN}-module-charnames += "${PN}-module--charnames"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-strict"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-strict"
+RDEPENDS_${PN}-module--charnames += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-carp"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-strict"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-constant += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-version"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-b"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-lib"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-overload"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-posix"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-safe"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-term-readline"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-b-deparse"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-config"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-constant"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-overload"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-db += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-strict"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-vars"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-carp"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-config"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-strict"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-digest"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-digest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-integer"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-config"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode-cn-hz"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-overload"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode-mime-name"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode-unicode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-jp-h2z"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode-jp-jis7"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode-kr-2022-kr"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-config"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-configlocal-pm"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-encoding"
+RDEPENDS_${PN}-module-encode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-re"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-config"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-posix"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-english += "${PN}-module-carp "
+RDEPENDS_${PN}-module-english += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-env += "${PN}-module-config"
+RDEPENDS_${PN}-module-env += "${PN}-module-tie-array"
+RDEPENDS_${PN}-module-errno += "${PN}-module-carp"
+RDEPENDS_${PN}-module-errno += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-errno += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-carp"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-feature"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-version"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-exporter += "${PN}-module-exporter-heavy"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-extutils-mksymlists"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-bcc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-bcc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-gcc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-gcc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-msvc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows-msvc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-command"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-install"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-test-harness"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-proxysubs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-posix"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-base"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-compare"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-b"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-version"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-my"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-extutils-embed"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-macos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs-countlines += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-countlines"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-eval"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-utilities"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-lib"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-inputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-outputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-type"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-exception-system"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-hints"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-util"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-config"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-constant"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-posix"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-tie-refhash"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-feature += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-base"
+RDEPENDS_${PN}-module-fields += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-hash-util"
+RDEPENDS_${PN}-module-fields += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fields += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-re"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-parent"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-load"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-file-glob"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-amigaos += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-cwd "
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-overload "
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-errno"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-posix"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-text-balanced"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-carp "
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-carp"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-constant"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-overload"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-pod-usage"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-strict"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-vars"
+RDEPENDS_${PN}-module-getopt-std += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-hash-util-fieldhash"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-overload"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-posix"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-carp"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-encode"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-file-globmapper"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-adapter-bzip2"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-config"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-identity"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-bzip2"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-stat"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-base"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-inet"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-unix"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-zip-constants "
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-unzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-carp "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-file "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-adapter-bunzip2"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-identity"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-load"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-socket"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-io-pipe"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-config"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-vars"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-json-pp"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-b"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-base"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-subs"
+RDEPENDS_${PN}-module-less += "${PN}-module-strict"
+RDEPENDS_${PN}-module-less += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-lib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-lib += "${PN}-module-config"
+RDEPENDS_${PN}-module-lib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-carp"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-carp"
+RDEPENDS_${PN}-module-load += "${PN}-module-config"
+RDEPENDS_${PN}-module-load += "${PN}-module-constant"
+RDEPENDS_${PN}-module-load += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-load += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-load += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-load += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-load += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-load += "${PN}-module-load"
+RDEPENDS_${PN}-module-load += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-load += "${PN}-module-strict"
+RDEPENDS_${PN}-module-load += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-version"
+RDEPENDS_${PN}-module-load += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-retired"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-retired"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-retired"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-retired"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-retired"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-retired"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-retired"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-maketext-gutsloader += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext-guts += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags-detect"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-integer"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-base"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale += "${PN}-module-config"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-constant"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-integer"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-config"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize-anydbm-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-expirefile += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-expire += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-config"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-sdbm-file += "${PN}-module-sdbm-file"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-storable"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-strict"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mro += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mro += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mro += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-errno"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-errno"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-ftp-a"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-next += "${PN}-module-carp"
+RDEPENDS_${PN}-module-next += "${PN}-module-overload"
+RDEPENDS_${PN}-module-next += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-ok += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ok += "${PN}-module-test-more"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-subs"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-open += "${PN}-module-carp"
+RDEPENDS_${PN}-module-open += "${PN}-module-encode"
+RDEPENDS_${PN}-module-open += "${PN}-module-encoding"
+RDEPENDS_${PN}-module-open += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-o += "${PN}-module-b"
+RDEPENDS_${PN}-module-o += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ops += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-overload-numbers"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-overload += "${PN}-module-mro"
+RDEPENDS_${PN}-module-overload += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-overload += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-carp"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-strict"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-vars"
+RDEPENDS_${PN}-module-parent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-parent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-scalar += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-mime-quotedprint"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parseutils"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-subs"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-pod-inputobjects"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-pod-perldoc-getoptsoo"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-pod-text-color"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-pod-checker"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-perldoc-topod"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-pod-text-termcap"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-pod-select"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple-transcode"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-overload"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-escapes"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-linksection"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-tiedoutfh"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-progress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserendtoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserstarttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparsertexttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-pod-simple-pullparser"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-term-ansicolor"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-posix"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-vars"
+RDEPENDS_${PN}-module-posix += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-posix += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-posix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-posix += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-posix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-posix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-re += "${PN}-module-carp"
+RDEPENDS_${PN}-module-re += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-re += "${PN}-module-strict"
+RDEPENDS_${PN}-module-re += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-re += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-re += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-safe += "${PN}-module-b"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp-heavy"
+RDEPENDS_${PN}-module-safe += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-safe += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-safe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-safe += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-feature"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-carp"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-socket += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-socket += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-socket += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sort += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sort += "${PN}-module-strict"
+RDEPENDS_${PN}-module-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-storable += "${PN}-module-config"
+RDEPENDS_${PN}-module-storable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-storable += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-storable += "${PN}-module-vars"
+RDEPENDS_${PN}-module-storable += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-symbol += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-socket"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-tap-formatter-color"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-tap-formatter-file-session"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-tap-object"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-benchmark"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-grammar"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-result"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-executable"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-file"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-handle"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-rawtap"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-bailout"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-comment"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-plan"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-pragma"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-test"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-unknown"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-version"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-yaml"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-job"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-spinner"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iterator-array"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-perlio"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-test-builder-tester"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-constant"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-aggregator"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-test-tester-capture"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-capturerunner"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-delegate"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-abbrev += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-overload"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-re"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-thread += "${PN}-module-config"
+RDEPENDS_${PN}-module-thread += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-thread += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads += "${PN}-module-config"
+RDEPENDS_${PN}-module-threads += "${PN}-module-overload"
+RDEPENDS_${PN}-module-threads += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-tie-stdhandle"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-config"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-overload"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-config"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-overload"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-seconds"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-overload"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-constant"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-charnames"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-feature"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-if"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-integer"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicode-normalize"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicore"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicore += "${PN}-module-integer"
+RDEPENDS_${PN}-module-universal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-config"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version += "${PN}-module-version-regex"
+RDEPENDS_${PN}-module-version += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-dynaloader"
diff --git a/poky/meta/recipes-devtools/perl/perl.inc b/poky/meta/recipes-devtools/perl/perl.inc
new file mode 100644
index 000000000..3313a9436
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Perl scripting language"
+HOMEPAGE = "http://www.perl.org/"
+SECTION = "devel"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
+ file://Artistic;md5=2e6fd2475335af892494fe1f7327baf3"
+
+SRC_URI = "http://www.cpan.org/src/5.0/${BP}.tar.xz"
+
+inherit upstream-version-is-even
diff --git a/poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch b/poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch
new file mode 100644
index 000000000..14a05d291
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/0001-Configure-Remove-fstack-protector-strong-for-native-.patch
@@ -0,0 +1,103 @@
+Some distributions (like opensuse421) supported by the project
+comes with older gcc releases, -fstack-protector=strong is supported
+by GCC>=4.9.
+
+This causes a build failure when install perl-native from a sstate that
+comes from a machine supporting -fstack-protector=strong [1].
+
+So disable usage of this flag in perl-native builds, this patch could
+be removed when all supported distros comes with GCC>=4.9.
+
+[YOCTO #10338]
+
+Upstream-Status: Inappropriate [configuration]
+
+[1] http://errors.yoctoproject.org/Errors/Details/109589/
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ Configure | 54 ------------------------------------------------------
+ 1 file changed, 54 deletions(-)
+
+diff --git a/Configure b/Configure
+index efbdcfd..d5bd98c 100755
+--- a/Configure
++++ b/Configure
+@@ -5468,30 +5468,6 @@ default|recommended)
+ eval $checkccflag
+ ;;
+ esac
+-
+- # on x86_64 (at least) we require an extra library (libssp) in the
+- # link command line. This library is not named, so I infer that it is
+- # an implementation detail that may change. Hence the safest approach
+- # is to add the flag to the flags passed to the compiler at link time,
+- # as that way the compiler can do the right implementation dependant
+- # thing. (NWC)
+- case "$osname" in
+- amigaos) ;; # -fstack-protector builds but doesn't work
+- *) case "$gccversion" in
+- ?*) set stack-protector-strong -fstack-protector-strong
+- eval $checkccflag
+- case "$dflt" in
+- *-fstack-protector-strong*) ;; # It got added.
+- *) # Try the plain/older -fstack-protector.
+- set stack-protector -fstack-protector
+- eval $checkccflag
+- ;;
+- esac
+- ;;
+- esac
+- ;;
+- esac
+- ;;
+ esac
+
+ case "$mips_type" in
+@@ -5634,21 +5610,6 @@ case "$ldflags" in
+ ;;
+ *) dflt="$ldflags";;
+ esac
+-# See note above about -fstack-protector
+-case "$ccflags" in
+-*-fstack-protector-strong*)
+- case "$dflt" in
+- *-fstack-protector-strong*) ;; # Don't add it again
+- *) dflt="$dflt -fstack-protector-strong" ;;
+- esac
+- ;;
+-*-fstack-protector*)
+- case "$dflt" in
+- *-fstack-protector*) ;; # Don't add it again
+- *) dflt="$dflt -fstack-protector" ;;
+- esac
+- ;;
+-esac
+
+ : Try to guess additional flags to pick up local libraries.
+ for thislibdir in $libpth; do
+@@ -8571,21 +8532,6 @@ EOM
+ ''|' ') dflt='none' ;;
+ esac
+
+- case "$ldflags" in
+- *-fstack-protector-strong*)
+- case "$dflt" in
+- *-fstack-protector-strong*) ;; # Don't add it again
+- *) dflt="$dflt -fstack-protector-strong" ;;
+- esac
+- ;;
+- *-fstack-protector*)
+- case "$dflt" in
+- *-fstack-protector*) ;; # Don't add it again
+- *) dflt="$dflt -fstack-protector" ;;
+- esac
+- ;;
+- esac
+-
+ rp="Any special flags to pass to $ld to create a dynamically loaded library?"
+ . ./myread
+ case "$ans" in
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/perl/perl/CVE-2017-12837.patch b/poky/meta/recipes-devtools/perl/perl/CVE-2017-12837.patch
new file mode 100644
index 000000000..0b59fcda3
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/CVE-2017-12837.patch
@@ -0,0 +1,32 @@
+From 73d7247ecab863ef26b5687a37ccc75d6144ad0f Mon Sep 17 00:00:00 2001
+From: Karl Williamson <khw@cpan.org>
+Date: Tue, 17 Oct 2017 13:49:14 +0800
+Subject: [PATCH] fix CVE-2017-12837
+
+Signed-off-by: Karl Williamson <khw@cpan.org>
+Signed-off-by: Steve Hay <steve.m.hay@googlemail.com>
+
+CVE: CVE-2017-12837
+Upstream-Status: Backport
+https://perl5.git.perl.org/perl.git/commitdiff/96c83ed78aeea1a0496dd2b2d935869a822dc8a5
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ regcomp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/regcomp.c b/regcomp.c
+index 5498d14..31ec383 100644
+--- a/regcomp.c
++++ b/regcomp.c
+@@ -13021,6 +13021,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
+ goto loopdone;
+ }
+ p = RExC_parse;
++ RExC_parse = parse_start;
+ if (ender > 0xff) {
+ REQUIRE_UTF8(flagp);
+ }
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/perl/perl/CVE-2017-12883.patch b/poky/meta/recipes-devtools/perl/perl/CVE-2017-12883.patch
new file mode 100644
index 000000000..5c1805f9e
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/CVE-2017-12883.patch
@@ -0,0 +1,44 @@
+From 40b3cdad3649334585cee8f4630ec9a025e62be6 Mon Sep 17 00:00:00 2001
+From: Karl Williamson <khw@cpan.org>
+Date: Fri, 25 Aug 2017 11:33:58 -0600
+Subject: [PATCH] PATCH: [perl #131598]
+
+The cause of this is that the vFAIL macro uses RExC_parse, and that
+variable has just been changed in preparation for code after the vFAIL.
+The solution is to not change RExC_parse until after the vFAIL.
+
+This is a case where the macro hides stuff that can bite you.
+
+(cherry picked from commit 2be4edede4ae226e2eebd4eff28cedd2041f300f)
+
+Upstream-Status: Backport
+CVE: CVE-2017-12833
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ regcomp.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+Index: perl-5.24.1/regcomp.c
+===================================================================
+--- perl-5.24.1.orig/regcomp.c
++++ perl-5.24.1/regcomp.c
+@@ -11918,14 +11918,16 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pREx
+ }
+ sv_catpv(substitute_parse, ")");
+
+- RExC_parse = RExC_start = RExC_adjusted_start = SvPV(substitute_parse,
+- len);
++ len = SvCUR(substitute_parse);
+
+ /* Don't allow empty number */
+ if (len < (STRLEN) 8) {
+ RExC_parse = endbrace;
+ vFAIL("Invalid hexadecimal number in \\N{U+...}");
+ }
++
++ RExC_parse = RExC_start = RExC_adjusted_start
++ = SvPV_nolen(substitute_parse);
+ RExC_end = RExC_parse + len;
+
+ /* The values are Unicode, and therefore not subject to recoding, but
diff --git a/poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch b/poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch
new file mode 100644
index 000000000..9625b0b84
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/Configure-multilib.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Pending
+
+Index: perl-5.12.3/Configure
+===================================================================
+--- perl-5.12.3.orig/Configure
++++ perl-5.12.3/Configure
+@@ -1316,8 +1316,9 @@ loclibpth="/usr/local/lib /opt/local/lib
+ loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
+
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
++glibpth="/lib /usr/lib /lib64 /usr/lib64 $xlibpth"
+ glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
++test -f /usr/lib/*-linux-gnu/libc.so && glibpth="/usr/lib/*-linux-gnu $glibpth"
+ test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+ test -f /shlib/libc.so && glibpth="/shlib $glibpth"
+ test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
diff --git a/poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch b/poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
new file mode 100644
index 000000000..eb92ccb67
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
@@ -0,0 +1,22 @@
+Upstream-Status:Pending
+
+The perl-native should be relocatable while re-use sstate-cache from
+another build, especially the original build was renamed/removed.
+
+To get the MakeMaker.pm works in this case, we need perl wrapper here
+instead of real perl binary.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================================
+--- perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.orig 2011-08-12 16:07:30.000000000 +0800
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2011-08-12 16:08:56.000000000 +0800
+@@ -1019,6 +1019,9 @@
+ }
+
+ foreach my $name (@$names){
++ # Getting MakeMaker.pm use perl wrapper instead of 'perl.real' directly
++ $name =~ s/perl\.real/perl/ if ($name =~ /perl\.real/);
++
+ foreach my $dir (@$dirs){
+ next unless defined $dir; # $self->{PERL_SRC} may be undefined
+ my ($abs, $val);
diff --git a/poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch b/poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
new file mode 100644
index 000000000..c1db335e0
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/Makefile.SH.patch
@@ -0,0 +1,383 @@
+From 4dd9f3f81d8c81c96ff1ea0890ea55685f28b7e9 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 1 Jul 2014 15:51:53 +0800
+Subject: [PATCH 28/49] perl, perl-native, perl-ptest: upgrade from 5.14.3 to
+ 5.20.0
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+---
+ Makefile.SH | 147 ++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 68 insertions(+), 79 deletions(-)
+
+Index: perl-5.24.1/Makefile.SH
+===================================================================
+--- perl-5.24.1.orig/Makefile.SH
++++ perl-5.24.1/Makefile.SH
+@@ -48,10 +48,10 @@ case "$useshrplib" in
+ true)
+ # Prefix all runs of 'miniperl' and 'perl' with
+ # $ldlibpth so that ./perl finds *this* shared libperl.
+- case "$LD_LIBRARY_PATH" in
+- '') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+- *) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+- esac
++ #case "$LD_LIBRARY_PATH" in
++ #'') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
++ #*) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
++ #esac
+
+ pldlflags="$cccdlflags"
+ static_ldflags=''
+@@ -131,10 +131,11 @@ true)
+ *)
+ eval "ldlibpthval=\"\$$ldlibpthname\""
+
+- case "$ldlibpthval" in
+- '') ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
+- *) ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
+- esac
++# We compile in the library path in OE from cross-compile, so lets not do this
++# case "$ldlibpthval" in
++# '') ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
++# *) ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
++# esac
+
+ ;;
+ esac
+@@ -150,18 +151,7 @@ true)
+ # INSTALL file, under "Building a shared perl library".
+ # If there is no pre-existing $libperl, we don't need
+ # to do anything further.
+- if test -f $archlib/CORE/$libperl; then
+- rm -f preload
+- cat <<'EOT' > preload
+-#! /bin/sh
+-lib=$1
+-shift
+-test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
+-exec "$@"
+-EOT
+- chmod 755 preload
+- ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
+- fi
++ echo linux libraries overwritten by cross-compile patches
+ ;;
+ os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
+ ;;
+@@ -596,13 +586,23 @@ splintfiles = $(c1)
+ @echo `$(CCCMDSRC)` -S $*.c
+ @`$(CCCMDSRC)` -S $*.c
+
+-all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
+- @echo " ";
+- @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
+-
+-$(MANIFEST_SRT): MANIFEST $(PERL_EXE)
+- @$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
+- $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true)
++#all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
++# @echo " ";
++# @echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
++
++all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(unidatafiles)
++
++more: $(generated_pods) $(private) $(public)
++
++more2: $(dynamic_ext)
++
++more3: $(nonxs_ext)
++
++more4: extras.make $(MANIFEST_SRT)
++
++$(MANIFEST_SRT): MANIFEST
++ @$(MINIPERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
++ $(MINIPERL) Porting/manisort -q -o MANIFEST; sh -c true)
+ @touch $(MANIFEST_SRT)
+
+ .PHONY: all utilities
+@@ -611,7 +611,7 @@ $(MANIFEST_SRT): MANIFEST $(PERL_EXE)
+ # by make_patchnum.pl.
+ git_version.h: lib/Config_git.pl
+
+-lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
++lib/Config_git.pl: make_patchnum.pl
+ $(MINIPERL) make_patchnum.pl
+
+ # make sure that we recompile perl.c if the git version changes
+@@ -624,7 +624,7 @@ perl$(OBJ_EXT): git_version.h
+ # loading, we need to build perl first.
+ case "$usedl$static_cwd" in
+ defineundef)
+- util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
++ util_deps='$(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
+ ;;
+ definedefine)
+ util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
+@@ -634,7 +634,7 @@ definedefine)
+ esac
+
+ $spitshell >>$Makefile <<!GROK!THIS!
+-utils/Makefile: \$(MINIPERL_EXE) \$(CONFIGPM) utils/Makefile.PL
++utils/Makefile: \$(CONFIGPM) utils/Makefile.PL
+ \$(MINIPERL) -Ilib utils/Makefile.PL
+
+ utilities: utils/Makefile $util_deps
+@@ -743,7 +743,7 @@ ext.libs: $(static_ext)
+ ;;
+ *)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
++perlmain.c: ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
+ $(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
+
+ # The file ext.libs is a list of libraries that must be linked in
+@@ -806,7 +806,7 @@ PERLEXPORT = perl.exp
+ ;;
+ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
++perl.exp: makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
+ ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
+
+ !NO!SUBS!
+@@ -815,7 +815,7 @@ os2)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ MINIPERLEXP = miniperl
+
+-perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
++perl5.def: makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
+ ./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
+
+ !NO!SUBS!
+@@ -878,7 +878,7 @@ $(LIBPERL): $& $(perllib_objs) $(DYNALOA
+ true)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ rm -f $@
+- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
++ $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
+ !NO!SUBS!
+ case "$osname" in
+ aix)
+@@ -936,15 +936,19 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_objs)
+ $(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(miniperl_objs) $(libs)
+- $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
++ mv -f miniperl miniperl-target
++ ln -s hostperl miniperl
++ #$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ ;;
+ next4*)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(miniperl_objs) write ldcustomize.pl
+- $(CC) -o $(MINIPERL_EXE) $(miniperl_objs libs)
+- $(LDLIBPTH) ./miniperl$(HOST _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
++ $(CC) -o $(MINIPERL_EXE) $(miniperl_objs libs)
++ mv -f miniperl miniperl-target
++ ln -s hostperl miniperl
++ #$(LDLIBPTH) ./miniperl$(HOST _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ ;;
+@@ -966,7 +970,9 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+ $(miniperl_objs) $(libs)
+- $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
++ mv -f miniperl miniperl-target
++ ln -s hostperl miniperl
++ #$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ ;;
+@@ -977,7 +983,9 @@ lib/buildcustomize.pl: \$& \$(miniperl_o
+ -@rm -f miniperl.xok
+ -@rm \$(MINIPERL_EXE)
+ \$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+- \$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
++ mv -f miniperl miniperl-target
++ ln -s hostperl miniperl
++ #\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
+ \$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
+ !GROK!THIS!
+ else
+@@ -986,7 +994,9 @@ lib/buildcustomize.pl: $& $(miniperl_obj
+ -@rm -f miniperl.xok
+ $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(miniperl_objs) $(libs)
+- $(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
++ mv -f miniperl miniperl-target
++ ln -s hostperl miniperl
++ #$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
+ $(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ fi
+@@ -1036,7 +1046,7 @@ case "${osname}" in
+ catamount)
+ $spitshell >>$Makefile <<!GROK!THIS!
+ .PHONY: makeppport
+-makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
++makeppport: \$(CONFIGPM)
+ -@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
+ (cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \
+ done
+@@ -1046,7 +1056,7 @@ makeppport: \$(MINIPERL_EXE) \$(CONFIGPM
+ *)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ .PHONY: makeppport
+-makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext)
++makeppport: $(CONFIGPM) $(nonxs_ext)
+ $(MINIPERL) mkppport
+
+ !NO!SUBS!
+@@ -1056,16 +1066,16 @@ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+
+ .PHONY: preplibrary
+-preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
++preplibrary: $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
+
+ $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
+
+-$(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
++$(CONFIGPOD): config.sh configpm Porting/Glossary lib/Config_git.pl
+ $(MINIPERL) configpm
+
+ unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
+
+-uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
++uni.data: $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
+ $(MINIPERL) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p
+ # Commented out so always runs, mktables looks at far more files than we
+ # can in this makefile to decide if needs to run or not
+@@ -1074,12 +1084,12 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) li
+ # $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
+ # But also this ensures that all extensions are built before we try to scan
+ # them, which picks up Devel::PPPort's documentation.
+-pod/perltoc.pod: $(perltoc_pod_prereqs) $(PERL_EXE) $(ext) pod/buildtoc
+- $(RUN_PERL) -f pod/buildtoc -q
++pod/perltoc.pod: $(perltoc_pod_prereqs) $(ext) pod/buildtoc
++ $(MINIPERL) -f pod/buildtoc -q
+
+ pod/perlapi.pod: pod/perlintern.pod
+
+-pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
++pod/perlintern.pod: autodoc.pl embed.fnc
+ $(MINIPERL) autodoc.pl
+
+ pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
+@@ -1089,7 +1099,7 @@ pod/perl5241delta.pod: pod/perldelta.pod
+ $(RMS) pod/perl5241delta.pod
+ $(LNS) perldelta.pod pod/perl5241delta.pod
+
+-extra.pods: $(MINIPERL_EXE)
++extra.pods:
+ -@test ! -f extra.pods || rm -f `cat extra.pods`
+ -@rm -f extra.pods
+ -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
+@@ -1133,8 +1143,7 @@ EOT
+ $spitshell >>$Makefile <<EOT
+
+ install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
+- \$(RUN_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+- \$(RUN_PERL) installman --destdir=\$(DESTDIR) $flags
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+ EOT
+ fi
+
+@@ -1144,11 +1153,7 @@ done
+ if test "X$hostperl" != X; then
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl: $(INSTALL_DEPENDENCE) installperl
+- $(HOST_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+- -@test ! -s extras.lst || $(MAKE) extras.install
+-
+-install.man: all installman
+- $(HOST_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+
+ # XXX Experimental. Hardwired values, but useful for testing.
+ # Eventually Configure could ask for some of these values.
+@@ -1166,24 +1171,8 @@ install.html: all installhtml
+ else
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl: $(INSTALL_DEPENDENCE) installperl
+- $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+- -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
+-
+-install.man: all installman
+- $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
++ ./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+
+-# XXX Experimental. Hardwired values, but useful for testing.
+-# Eventually Configure could ask for some of these values.
+-install.html: all installhtml
+- -@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
+- $(RUN_PERL) installhtml \
+- --podroot=. --podpath=. --recurse \
+- --htmldir=$(privlib)/html \
+- --htmlroot=$(privlib)/html \
+- --splithead=pod/perlipc \
+- --splititem=pod/perlfunc \
+- --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \
+- --verbose
+ !NO!SUBS!
+ fi
+
+@@ -1275,13 +1264,13 @@ manicheck: FORCE
+ #
+ # DynaLoader may be needed for extensions that use Makefile.PL.
+
+-$(DYNALOADER): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
++$(DYNALOADER): lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
+ $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+
+-d_dummy $(dynamic_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
++d_dummy $(dynamic_ext): lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
+ $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+
+-s_dummy $(static_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
++s_dummy $(static_ext): lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
+ $(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+
+ n_dummy $(nonxs_ext): $(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE
+@@ -1479,14 +1468,14 @@ test_prep_pre: preplibrary utilities $(n
+
+ case "$targethost" in
+ '') $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
++test_prep test-prep: test_prep_pre $(unidatafiles) $(PERL_EXE) \
+ $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
+ cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+
+ !NO!SUBS!
+ ;;
+ *) $spitshell >>$Makefile <<!GROK!THIS!
+-test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \
++test_prep test-prep: test_prep_pre \$(unidatafiles) \$(PERL_EXE) \
+ \$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
+ \$(generated_pods)
+ $to libperl.*
+@@ -1539,7 +1528,7 @@ test_prep test-prep: test_prep_pre \$(MI
+ esac
+
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
++test_prep_reonly: $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
+ $(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+ cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ !NO!SUBS!
+@@ -1600,7 +1589,7 @@ minitest_prep:
+
+ MINITEST_TESTS = base/*.t comp/*.t cmd/*.t run/*.t io/*.t re/*.t opbasic/*.t op/*.t uni/*.t perf/*.t
+
+-minitest: $(MINIPERL_EXE) minitest_prep
++minitest: minitest_prep
+ - cd t && $(RUN_PERL) TEST $(MINITEST_TESTS) <$(devtty)
+
+ minitest-notty minitest_notty: $(MINIPERL_EXE) minitest_prep
diff --git a/poky/meta/recipes-devtools/perl/perl/Makefile.patch b/poky/meta/recipes-devtools/perl/perl/Makefile.patch
new file mode 100644
index 000000000..858e2e10f
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/Makefile.patch
@@ -0,0 +1,58 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Cross/Makefile
+===================================================================
+--- perl-5.14.2.orig/Cross/Makefile
++++ perl-5.14.2/Cross/Makefile
+@@ -1,6 +1,7 @@
+ ## Toplevel Makefile for cross-compilation of perl
+
+-export TOPDIR=${shell pwd}
++override TOPDIR=${shell pwd}
++export TOPDIR
+ include $(TOPDIR)/config
+ export CFLAGS
+ export SYS=$(ARCH)-$(OS)
+@@ -10,7 +11,7 @@ export OPTIMIZATION = -O2
+
+ export CC = $(CROSS)gcc
+ export CXX = $(CROSS)g++
+-export LD = $(CROSS)ld
++export LD = $(CC)
+ export STRIP = $(CROSS)strip
+ export AR = $(CROSS)ar
+ export RANLIB = $(CROSS)ranlib
+@@ -32,17 +33,6 @@ CFLAGS+=$(FULL_OPTIMIZATION)
+ all:
+ @echo Please read the README file before doing anything else.
+
+-gen_patch:
+- diff -Bbur ../Makefile.SH Makefile.SH > Makefile.SH.patch
+- diff -Bbur ../installperl installperl > installperl.patch
+-
+-patch:
+- cd .. ; if [ ! -e ./CROSS_PATCHED ] ; then \
+- patch -p1 < Cross/Makefile.SH.patch; \
+- patch -p1 < Cross/installperl.patch ; mv installperl installperl-patched; \
+- sed -e 's/XXSTRIPXX/$(SYS)/' installperl-patched > installperl; \
+- touch CROSS_PATCHED ; fi
+-
+ perl:
+ @echo Perl cross-build directory is $(TOPDIR)
+ @echo Target arch is $(SYS)
+@@ -52,11 +42,11 @@ perl:
+ $(TOPDIR)/generate_config_sh config.sh-$(SYS) > $(TOPDIR)/../config.sh
+ cd $(TOPDIR)/.. ; ./Configure -S ; make depend ; make ; make more
+ cd $(TOPDIR)/.. ; mkdir -p fake_config_library ; cp lib/Config.pm lib/Config_heavy.pl fake_config_library
+- cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+- cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+- cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++ cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
+ cd $(TOPDIR)/.. ; rm -rf install_me_here
+- cd $(TOPDIR)/.. ; make install-strip
++# cd $(TOPDIR)/.. ; make install-strip
+ cd $(TOPDIR)/.. ; sh -x Cross/warp
+
+
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh b/poky/meta/recipes-devtools/perl/perl/config.sh
new file mode 100644
index 000000000..ac0484ca6
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh
@@ -0,0 +1,1249 @@
+#!/bin/sh
+#
+# This file was produced by running the Configure script. It holds all the
+# definitions figured out by Configure. Should you modify one of these values,
+# do not forget to propagate your changes by running "Configure -der". You may
+# instead choose to run each of the .SH files by yourself, or "Configure -S".
+#
+
+# Package name : perl5
+# Source directory : .
+# Configuration time: Fri May 6 20:13:46 PDT 2016
+# Configured by : Open Embedded
+# Target system : linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux
+
+: Configure command line arguments.
+config_arg0='Configure'
+config_args='-des -Doptimize=-O2 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Open Embedded -Dinstallprefix=@EXECPREFIX@ -Dprefix=@EXECPREFIX@ -Dvendorprefix=@EXECPREFIX@ -Dsiteprefix=@EXECPREFIX@ -Dotherlibdirs=@LIBDIR@/perl/5.24.1 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Ud_dosuid -Dd_semctl_semun -Ui_db -Ui_ndbm -Ui_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=@USRBIN@/less -isr'
+config_argc=28
+config_arg1='-des'
+config_arg2='-Doptimize=-O2'
+config_arg3='-Dmyhostname=localhost'
+config_arg4='-Dperladmin=root@localhost'
+config_arg5='-Dcc=gcc'
+config_arg6='-Dcf_by=Open Embedded'
+config_arg7='-Dinstallprefix=@EXECPREFIX@'
+config_arg8='-Dprefix=@EXECPREFIX@'
+config_arg9='-Dvendorprefix=@EXECPREFIX@'
+config_arg10='-Dsiteprefix=@EXECPREFIX@'
+config_arg11='-Dotherlibdirs=@LIBDIR@/perl/5.24.1'
+config_arg12='-Duseshrplib'
+config_arg13='-Dusethreads'
+config_arg14='-Duseithreads'
+config_arg15='-Duselargefiles'
+config_arg16='-Ud_dosuid'
+config_arg17='-Dd_semctl_semun'
+config_arg18='-Ui_db'
+config_arg19='-Ui_ndbm'
+config_arg20='-Ui_gdbm'
+config_arg21='-Di_shadow'
+config_arg22='-Di_syslog'
+config_arg23='-Dman3ext=3pm'
+config_arg24='-Duseperlio'
+config_arg25='-Dinstallusrbinperl'
+config_arg26='-Ubincompat5005'
+config_arg27='-Uversiononly'
+config_arg28='-Dpager=@USRBIN@/less -isr'
+
+Author=''
+Date=''
+Header=''
+Id=''
+Locker=''
+Log=''
+RCSfile=''
+Revision=''
+Source=''
+State=''
+_a='.a'
+_exe=''
+_o='.o'
+afs='false'
+afsroot='/afs'
+alignbytes='8'
+ansi2knr=''
+aphostname=''
+api_revision='5'
+api_subversion='1'
+api_version='24'
+api_versionstring='5.24.1'
+ar='ar'
+archlib='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+archlib_exp='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+archname64=''
+archname='@ARCH@-thread-multi'
+archobjs=''
+asctime_r_proto='REENTRANT_PROTO_B_SB'
+awk='awk'
+baserev='5.0'
+bash=''
+bin='@USRBIN@'
+bin_ELF='define'
+binexp='@USRBIN@'
+bison='bison'
+byacc='byacc'
+c=''
+castflags='0'
+cat='cat'
+cc='gcc'
+cccdlflags='-fPIC'
+ccdlflags='-Wl,-E -Wl,-rpath,@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi/CORE'
+ccflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
+ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
+ccname='gcc'
+ccsymbols=''
+ccversion=''
+cf_by='Open Embedded'
+cf_email='Open Embedded@localhost.localdomain'
+cf_time='Fri May 6 20:13:46 PDT 2016'
+charbits='8'
+charsize='1'
+chgrp=''
+chmod='chmod'
+chown=''
+clocktype='clock_t'
+comm='comm'
+compress=''
+contains='grep'
+cp='cp'
+cpio=''
+cpp='cpp'
+cpp_stuff='42'
+cppccsymbols=''
+cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe'
+cpplast='-'
+cppminus='-'
+cpprun='gcc -E'
+cppstdin='gcc -E'
+crypt_r_proto='REENTRANT_PROTO_B_CCS'
+cryptlib=''
+csh='csh'
+ctermid_r_proto='0'
+ctime_r_proto='REENTRANT_PROTO_B_SB'
+d_Gconvert='gcvt((x),(n),(b))'
+d_PRIEUldbl='define'
+d_PRIFUldbl='define'
+d_PRIGUldbl='define'
+d_PRIXU64='define'
+d_PRId64='define'
+d_PRIeldbl='define'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='define'
+d_PRIo64='define'
+d_PRIu64='define'
+d_PRIx64='define'
+d_SCNfldbl='define'
+d__fwalk='undef'
+d_access='define'
+d_accessx='undef'
+d_acosh='define'
+d_aintl='undef'
+d_alarm='define'
+d_archlib='define'
+d_asctime64='undef'
+d_asctime_r='define'
+d_asinh='define'
+d_atanh='define'
+d_atolf='undef'
+d_atoll='define'
+d_attribute_deprecated='define'
+d_attribute_format='define'
+d_attribute_malloc='define'
+d_attribute_nonnull='define'
+d_attribute_noreturn='define'
+d_attribute_pure='define'
+d_attribute_unused='define'
+d_attribute_warn_unused_result='define'
+d_backtrace='define'
+d_bcmp='define'
+d_bcopy='define'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_builtin_choose_expr='define'
+d_builtin_expect='define'
+d_bzero='define'
+d_c99_variadic_macros='define'
+d_casti32='define'
+d_castneg='define'
+d_cbrt='define'
+d_charvspr='undef'
+d_chown='define'
+d_chroot='define'
+d_chsize='undef'
+d_class='undef'
+d_clearenv='define'
+d_closedir='define'
+d_cmsghdr_s='define'
+d_const='define'
+d_copysign='define'
+d_copysignl='define'
+d_cplusplus='undef'
+d_crypt='define'
+d_crypt_r='define'
+d_csh='undef'
+d_ctermid='define'
+d_ctermid_r='undef'
+d_ctime64='undef'
+d_ctime_r='define'
+d_cuserid='define'
+d_dbl_dig='define'
+d_dbminitproto='define'
+d_difftime64='undef'
+d_difftime='define'
+d_dir_dd_fd='undef'
+d_dirfd='define'
+d_dirnamlen='undef'
+d_dladdr='define'
+d_dlerror='define'
+d_dlopen='define'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48_r='define'
+d_drand48proto='define'
+d_dup2='define'
+d_eaccess='define'
+d_endgrent='define'
+d_endgrent_r='undef'
+d_endhent='define'
+d_endhostent_r='undef'
+d_endnent='define'
+d_endnetent_r='undef'
+d_endpent='define'
+d_endprotoent_r='undef'
+d_endpwent='define'
+d_endpwent_r='undef'
+d_endsent='define'
+d_endservent_r='undef'
+d_eofnblk='define'
+d_erf='define'
+d_erfc='define'
+d_eunice='undef'
+d_exp2='define'
+d_expm1='define'
+d_faststdio='undef'
+d_fchdir='define'
+d_fchmod='define'
+d_fchown='define'
+d_fcntl='define'
+d_fcntl_can_lock='define'
+d_fd_macros='define'
+d_fd_set='define'
+d_fdim='define'
+d_fds_bits='define'
+d_fegetround='define'
+d_fgetpos='define'
+d_finite='define'
+d_finitel='define'
+d_flexfnam='define'
+d_flock='define'
+d_flockproto='define'
+d_fma='define'
+d_fmax='define'
+d_fmin='define'
+d_fork='define'
+d_fp_class='undef'
+d_fp_classify='undef'
+d_fp_classl='undef'
+d_fpathconf='define'
+d_fpclass='undef'
+d_fpclassify='define'
+d_fpclassl='undef'
+d_fpgetround='undef'
+d_fpos64_t='undef'
+d_frexpl='define'
+d_fs_data_s='undef'
+d_fseeko='define'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='define'
+d_fsync='define'
+d_ftello='define'
+d_ftime='undef'
+d_futimes='define'
+d_gdbm_ndbm_h_uses_prototypes='undef'
+d_gdbmndbm_h_uses_prototypes='define'
+d_getaddrinfo='define'
+d_getcwd='define'
+d_getespwnam='undef'
+d_getfsstat='undef'
+d_getgrent='define'
+d_getgrent_r='define'
+d_getgrgid_r='define'
+d_getgrnam_r='define'
+d_getgrps='define'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='define'
+d_gethname='define'
+d_gethostbyaddr_r='define'
+d_gethostbyname_r='define'
+d_gethostent_r='define'
+d_gethostprotos='define'
+d_getitimer='define'
+d_getlogin='define'
+d_getlogin_r='define'
+d_getmnt='undef'
+d_getmntent='define'
+d_getnameinfo='define'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getnent='define'
+d_getnetbyaddr_r='define'
+d_getnetbyname_r='define'
+d_getnetent_r='define'
+d_getnetprotos='define'
+d_getpagsz='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='define'
+d_getpgid='define'
+d_getpgrp2='undef'
+d_getpgrp='define'
+d_getppid='define'
+d_getprior='define'
+d_getprotobyname_r='define'
+d_getprotobynumber_r='define'
+d_getprotoent_r='define'
+d_getprotoprotos='define'
+d_getprpwnam='undef'
+d_getpwent='define'
+d_getpwent_r='define'
+d_getpwnam_r='define'
+d_getpwuid_r='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='define'
+d_getservbyname_r='define'
+d_getservbyport_r='define'
+d_getservent_r='define'
+d_getservprotos='define'
+d_getspnam='define'
+d_getspnam_r='define'
+d_gettimeod='define'
+d_gmtime64='undef'
+d_gmtime_r='define'
+d_gnulibc='define'
+d_grpasswd='define'
+d_hasmntopt='define'
+d_htonl='define'
+d_hypot='define'
+d_ilogb='define'
+d_ilogbl='define'
+d_inc_version_list='undef'
+d_index='undef'
+d_inetaton='define'
+d_inetntop='define'
+d_inetpton='define'
+d_int64_t='define'
+d_ip_mreq='define'
+d_ip_mreq_source='define'
+d_ipv6_mreq='define'
+d_ipv6_mreq_source='undef'
+d_isascii='define'
+d_isblank='define'
+d_isfinite='define'
+d_isfinitel='undef'
+d_isinf='define'
+d_isinfl='define'
+d_isless='undef'
+d_isnan='define'
+d_isnanl='define'
+d_isnormal='define'
+d_j0='define'
+d_j0l='define'
+d_killpg='define'
+d_lc_monetary_2008='define'
+d_lchown='define'
+d_ldbl_dig='define'
+d_ldexpl='define'
+d_lgamma='define'
+d_lgamma_r='define'
+d_libm_lib_version='undef'
+d_libname_unique='undef'
+d_link='define'
+d_llrint='define'
+d_llrintl='define'
+d_llround='define'
+d_llroundl='define'
+d_localtime64='undef'
+d_localtime_r='define'
+d_localtime_r_needs_tzset='define'
+d_locconv='define'
+d_lockf='define'
+d_log1p='define'
+d_log2='define'
+d_logb='define'
+d_longdbl='define'
+d_longlong='define'
+d_lrint='define'
+d_lrintl='define'
+d_lround='define'
+d_lroundl='define'
+d_lseekproto='define'
+d_lstat='define'
+d_madvise='define'
+d_malloc_good_size='undef'
+d_malloc_size='undef'
+d_mblen='define'
+d_mbstowcs='define'
+d_mbtowc='define'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkdtemp='define'
+d_mkfifo='define'
+d_mkstemp='define'
+d_mkstemps='define'
+d_mktime64='undef'
+d_mktime='define'
+d_mmap='define'
+d_modfl='define'
+d_modfl_pow32_bug='undef'
+d_modflproto='define'
+d_mprotect='define'
+d_msg='define'
+d_msg_ctrunc='define'
+d_msg_dontroute='define'
+d_msg_oob='define'
+d_msg_peek='define'
+d_msg_proxy='define'
+d_msgctl='define'
+d_msgget='define'
+d_msghdr_s='define'
+d_msgrcv='define'
+d_msgsnd='define'
+d_msync='define'
+d_munmap='define'
+d_mymalloc='undef'
+d_nan='define'
+d_ndbm='define'
+d_ndbm_h_uses_prototypes='undef'
+d_nearbyint='define'
+d_nextafter='define'
+d_nexttoward='define'
+d_nice='define'
+d_nl_langinfo='define'
+d_nv_preserves_uv='undef'
+d_nv_zero_is_allbits_zero='define'
+d_off64_t='define'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='define'
+d_pause='define'
+d_perl_otherlibdirs='define'
+d_phostname='undef'
+d_pipe='define'
+d_poll='define'
+d_portable='define'
+d_prctl='define'
+d_prctl_set_name='define'
+d_printf_format_null='undef'
+d_procselfexe='define'
+d_pseudofork='undef'
+d_pthread_atfork='define'
+d_pthread_attr_setscope='define'
+d_pthread_yield='define'
+d_ptrdiff_t='define'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='define'
+d_pwpasswd='define'
+d_pwquota='undef'
+d_qgcvt='define'
+d_quad='define'
+d_random_r='define'
+d_re_comp='undef'
+d_readdir64_r='define'
+d_readdir='define'
+d_readdir_r='define'
+d_readlink='define'
+d_readv='define'
+d_recvmsg='define'
+d_regcmp='undef'
+d_regcomp='define'
+d_remainder='define'
+d_remquo='define'
+d_rename='define'
+d_rewinddir='define'
+d_rint='define'
+d_rmdir='define'
+d_round='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sbrkproto='define'
+d_scalbn='define'
+d_scalbnl='define'
+d_sched_yield='define'
+d_scm_rights='define'
+d_seekdir='define'
+d_select='define'
+d_sem='define'
+d_semctl='define'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
+d_semget='define'
+d_semop='define'
+d_sendmsg='define'
+d_setegid='define'
+d_seteuid='define'
+d_setgrent='define'
+d_setgrent_r='undef'
+d_setgrps='define'
+d_sethent='define'
+d_sethostent_r='undef'
+d_setitimer='define'
+d_setlinebuf='define'
+d_setlocale='define'
+d_setlocale_r='undef'
+d_setnent='define'
+d_setnetent_r='undef'
+d_setpent='define'
+d_setpgid='define'
+d_setpgrp2='undef'
+d_setpgrp='define'
+d_setprior='define'
+d_setproctitle='undef'
+d_setprotoent_r='undef'
+d_setpwent='define'
+d_setpwent_r='undef'
+d_setregid='define'
+d_setresgid='define'
+d_setresuid='define'
+d_setreuid='define'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='define'
+d_setservent_r='undef'
+d_setsid='define'
+d_setvbuf='define'
+d_shm='define'
+d_shmat='define'
+d_shmatprototype='define'
+d_shmctl='define'
+d_shmdt='define'
+d_shmget='define'
+d_sigaction='define'
+d_signbit='define'
+d_sigprocmask='define'
+d_sigsetjmp='define'
+d_sin6_scope_id='define'
+d_sitearch='define'
+d_snprintf='define'
+d_sockaddr_in6='define'
+d_sockaddr_sa_len='undef'
+d_sockatmark='define'
+d_sockatmarkproto='define'
+d_socket='define'
+d_socklen_t='define'
+d_sockpair='define'
+d_socks5_init='undef'
+d_sprintf_returns_strlen='define'
+d_sqrtl='define'
+d_srand48_r='define'
+d_srandom_r='define'
+d_sresgproto='define'
+d_sresuproto='define'
+d_stat='define'
+d_statblks='define'
+d_statfs_f_flags='define'
+d_statfs_s='define'
+d_static_inline='define'
+d_statvfs='define'
+d_stdio_cnt_lval='undef'
+d_stdio_ptr_lval='undef'
+d_stdio_ptr_lval_nochange_cnt='undef'
+d_stdio_ptr_lval_sets_cnt='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strerror_r='define'
+d_strftime='define'
+d_strlcat='undef'
+d_strlcpy='undef'
+d_strtod='define'
+d_strtol='define'
+d_strtold='define'
+d_strtoll='define'
+d_strtoq='define'
+d_strtoul='define'
+d_strtoull='define'
+d_strtouq='define'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='define'
+d_syscall='define'
+d_syscallproto='define'
+d_sysconf='define'
+d_sysernlst=''
+d_syserrlst='define'
+d_system='define'
+d_tcgetpgrp='define'
+d_tcsetpgrp='define'
+d_telldir='define'
+d_telldirproto='define'
+d_tgamma='define'
+d_time='define'
+d_timegm='define'
+d_times='define'
+d_tm_tm_gmtoff='define'
+d_tm_tm_zone='define'
+d_tmpnam_r='define'
+d_trunc='define'
+d_truncate='define'
+d_truncl='define'
+d_ttyname_r='define'
+d_tzname='define'
+d_u32align='define'
+d_ualarm='define'
+d_umask='define'
+d_uname='define'
+d_union_semun='undef'
+d_unordered='undef'
+d_unsetenv='define'
+d_usleep='define'
+d_usleepproto='define'
+d_ustat='define'
+d_vendorarch='define'
+d_vendorbin='define'
+d_vendorlib='define'
+d_vendorscript='define'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='define'
+d_voidtty=''
+d_volatile='define'
+d_vprintf='define'
+d_vsnprintf='define'
+d_wait4='define'
+d_waitpid='define'
+d_wcscmp='define'
+d_wcstombs='define'
+d_wcsxfrm='define'
+d_wctomb='define'
+d_writev='define'
+d_xenix='undef'
+date='date'
+db_hashtype='u_int32_t'
+db_prefixtype='size_t'
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
+direntrytype='struct dirent'
+dlext='so'
+dlsrc='dl_dlopen.xs'
+doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
+doublekind='3'
+doublemantbits='52'
+doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff'
+doublesize='8'
+drand01='Perl_drand48()'
+drand48_r_proto='REENTRANT_PROTO_I_ST'
+dtrace=''
+dtraceobject=''
+dynamic_ext='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared'
+eagain='EAGAIN'
+ebcdic='undef'
+echo='echo'
+egrep='egrep'
+emacs=''
+endgrent_r_proto='0'
+endhostent_r_proto='0'
+endnetent_r_proto='0'
+endprotoent_r_proto='0'
+endpwent_r_proto='0'
+endservent_r_proto='0'
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extensions='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+extern_C='extern'
+extras=''
+fflushNULL='define'
+fflushall='undef'
+find=''
+firstmakefile='makefile'
+flex=''
+fpossize='16'
+fpostype='fpos_t'
+freetype='void'
+from=':'
+full_ar='ar'
+full_csh='csh'
+full_sed='sed'
+gccansipedantic=''
+gccosandvers=''
+gccversion='4.9.2'
+getgrent_r_proto='REENTRANT_PROTO_I_SBWR'
+getgrgid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getgrnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gethostbyaddr_r_proto='REENTRANT_PROTO_I_TsISBWRE'
+gethostbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+gethostent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getlogin_r_proto='REENTRANT_PROTO_I_BW'
+getnetbyaddr_r_proto='REENTRANT_PROTO_I_uISBWRE'
+getnetbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+getnetent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getprotobyname_r_proto='REENTRANT_PROTO_I_CSBWR'
+getprotobynumber_r_proto='REENTRANT_PROTO_I_ISBWR'
+getprotoent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+getpwuid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getservbyname_r_proto='REENTRANT_PROTO_I_CCSBWR'
+getservbyport_r_proto='REENTRANT_PROTO_I_ICSBWR'
+getservent_r_proto='REENTRANT_PROTO_I_SBWR'
+getspnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gidformat='"u"'
+gidsign='1'
+gidsize='4'
+gidtype='gid_t'
+glibpth='@EXECPREFIX@/shlib @BASELIBDIR@ @LIBDIR@ @LIBDIR@/386 @BASELIBDIR@386 @EXECPREFIX@/ccs@BASELIBDIR@ @EXECPREFIX@/ucblib @EXECPREFIX@/local@BASELIBDIR@ @BASELIBDIR@ @LIBDIR@ @EXECPREFIX@/local@BASELIBDIR@ '
+gmake='gmake'
+gmtime_r_proto='REENTRANT_PROTO_S_TS'
+gnulibc_version='2.21'
+grep='grep'
+groupcat='cat /etc/group'
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl='false'
+h_sysfile='true'
+hint='recommended'
+hostcat='cat /etc/hosts'
+hostgenerate=''
+hostosname=''
+hostperl=''
+html1dir=' '
+html1direxp=''
+html3dir=' '
+html3direxp=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='int'
+i64size='8'
+i64type='long'
+i8size='1'
+i8type='signed char'
+i_arpainet='define'
+i_assert='define'
+i_bfd='define'
+i_bsdioctl=''
+i_crypt='define'
+i_db='undef'
+i_dbm='define'
+i_dirent='define'
+i_dlfcn='define'
+i_execinfo='define'
+i_fcntl='undef'
+i_fenv='define'
+i_float='define'
+i_fp='undef'
+i_fp_class='undef'
+i_gdbm='undef'
+i_gdbm_ndbm='undef'
+i_gdbmndbm='define'
+i_grp='define'
+i_ieeefp='undef'
+i_inttypes='define'
+i_langinfo='define'
+i_libutil='undef'
+i_limits='define'
+i_locale='define'
+i_machcthr='undef'
+i_malloc='define'
+i_mallocmalloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='define'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='define'
+i_prot='undef'
+i_pthread='define'
+i_pwd='define'
+i_quadmath='undef'
+i_rpcsvcdbm='undef'
+i_sgtty='undef'
+i_shadow='define'
+i_socks='undef'
+i_stdarg='define'
+i_stdbool='define'
+i_stddef='define'
+i_stdint='define'
+i_stdlib='define'
+i_string='define'
+i_sunmath='undef'
+i_sysaccess='undef'
+i_sysdir='define'
+i_sysfile='define'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_syslog='define'
+i_sysmman='define'
+i_sysmode='undef'
+i_sysmount='define'
+i_sysndir='undef'
+i_sysparam='define'
+i_syspoll='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='define'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatfs='define'
+i_sysstatvfs='define'
+i_systime='define'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='define'
+i_sysun='define'
+i_sysutsname='define'
+i_sysvfs='define'
+i_syswait='define'
+i_termio='undef'
+i_termios='define'
+i_time='define'
+i_unistd='define'
+i_ustat='define'
+i_utime='define'
+i_values='define'
+i_varargs='undef'
+i_varhdr='stdarg.h'
+i_vfork='undef'
+ignore_versioned_solibs='y'
+inc_version_list=' '
+inc_version_list_init='0'
+incpath=''
+inews=''
+initialinstalllocation='@USRBIN@'
+installarchlib='@LIBDIR@/perl/5.24.1/@ARCH@-thread-multi'
+installbin='@USRBIN@'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir=''
+installman3dir=''
+installprefix='@EXECPREFIX@'
+installprefixexp='@EXECPREFIX@'
+installprivlib='@LIBDIR@/perl/5.24.1'
+installscript='@USRBIN@'
+installsitearch='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
+installsitebin='@USRBIN@'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsitelib='@LIBDIR@/perl/site_perl/5.24.1'
+installsiteman1dir=''
+installsiteman3dir=''
+installsitescript='@USRBIN@'
+installstyle='lib/perl'
+installusrbinperl='define'
+installvendorarch='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
+installvendorbin='@USRBIN@'
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib='@LIBDIR@/perl/vendor_perl/5.24.1'
+installvendorman1dir=''
+installvendorman3dir=''
+installvendorscript='@USRBIN@'
+intsize='4'
+issymlink='test -h'
+ivdformat='"ld"'
+ivsize='8'
+ivtype='long'
+known_extensions='Archive/Tar Attribute/Handlers AutoLoader B B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS Fcntl File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp FileCache Filter/Simple Filter/Util/Call GDBM_File Getopt/Long HTTP/Tiny Hash/Util Hash/Util/FieldHash I18N/Collate I18N/LangTags I18N/Langinfo IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP List/Util Locale/Codes Locale/Maketext Locale/Maketext/Simple MIME/Base64 Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NDBM_File NEXT Net/Ping ODBM_File Opcode POSIX Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage SDBM_File Safe Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XS/Typemap XSLoader arybase attributes autodie autouse base bignum constant encoding/warnings experimental if lib libnet mro parent perlfaq podlators re threads threads/shared version '
+ksh=''
+ld='gcc'
+ld_can_script='define'
+lddlflags='-shared -O2'
+ldflags=''
+ldflags_uselargefiles=''
+ldlibpthname='LD_LIBRARY_PATH'
+less='less'
+lib_ext='.a'
+libc='libc-2.21.so'
+libperl='libperl.so'
+libpth='@LIBDIR@ @BASELIBDIR@'
+libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat'
+libsdirs=' @LIBDIR@'
+libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so'
+libsfound=' @LIBDIR@/libpthread.so @LIBDIR@/libnsl.so @LIBDIR@/libgdbm.so @LIBDIR@/libdb.so @LIBDIR@/libdl.so @LIBDIR@/libm.so @LIBDIR@/libcrypt.so @LIBDIR@/libutil.so @LIBDIR@/libc.so @LIBDIR@/libgdbm_compat.so'
+libspath=' @LIBDIR@ @BASELIBDIR@'
+libswanted='cl pthread socket inet nsl nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat'
+libswanted_uselargefiles=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+localtime_r_proto='REENTRANT_PROTO_S_TS'
+locincpth='@EXECPREFIX@/local/include /opt/local/include @EXECPREFIX@/gnu/include /opt/gnu/include @EXECPREFIX@/GNU/include /opt/GNU/include'
+loclibpth='@EXECPREFIX@/local@BASELIBDIR@ /opt/local@BASELIBDIR@ @EXECPREFIX@/gnu@BASELIBDIR@ /opt/gnu@BASELIBDIR@ @EXECPREFIX@/GNU@BASELIBDIR@ /opt/GNU@BASELIBDIR@'
+longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
+longdblkind='3'
+longdblmantbits='64'
+longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x32, 0xf7'
+longdblsize='16'
+longlongsize='8'
+longsize='8'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir=' '
+man1direxp=''
+man1ext='0'
+man3dir=' '
+man3direxp=''
+man3ext='0'
+mips_type=''
+mistrustnm=''
+mkdir='mkdir'
+mmaptype='void *'
+modetype='mode_t'
+more='more'
+multiarch='undef'
+mv=''
+myarchname='@ARCH@'
+mydomain='.localdomain'
+myhostname='localhost'
+myuname='linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux '
+n='-n'
+need_va_copy='define'
+netdb_hlen_type='size_t'
+netdb_host_type='char *'
+netdb_name_type='const char *'
+netdb_net_type='in_addr_t'
+nm='nm'
+nm_opt=''
+nm_so_opt='--dynamic'
+nonxs_ext='Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+nroff='nroff'
+nvEUformat='"E"'
+nvFUformat='"F"'
+nvGUformat='"G"'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
+nv_preserves_uv_bits='53'
+nveformat='"e"'
+nvfformat='"f"'
+nvgformat='"g"'
+nvmantbits='52'
+nvsize='8'
+nvtype='double'
+o_nonblock='O_NONBLOCK'
+obj_ext='.o'
+old_pthread_create_joinable=''
+optimize='-O2'
+orderlib='false'
+osname='linux'
+osvers='3.19.5-yocto-standard'
+otherlibdirs='@LIBDIR@/perl/5.24.1'
+package='perl'
+pager='/usr/bin/less -isr'
+passcat='cat /etc/passwd'
+patchlevel='24'
+path_sep=':'
+perl5='@USRBIN@/perl'
+perl='perl'
+perl_patchlevel=''
+perl_static_inline='static __inline__'
+perladmin='root@localhost'
+perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc'
+perlpath='@USRBIN@/perl'
+pg='pg'
+phostname=''
+pidtype='pid_t'
+plibpth='@LIBDIR@ @BASELIBDIR@'
+pmake=''
+pr=''
+prefix='@EXECPREFIX@'
+prefixexp='@EXECPREFIX@'
+privlib='@LIBDIR@/perl/5.24.1'
+privlibexp='@LIBDIR@/perl/5.24.1'
+procselfexe='"/proc/self/exe"'
+prototype='define'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+randbits='48'
+randfunc='Perl_drand48'
+random_r_proto='REENTRANT_PROTO_I_St'
+randseedtype='U32'
+ranlib=':'
+rd_nodata='-1'
+readdir64_r_proto='REENTRANT_PROTO_I_TSR'
+readdir_r_proto='REENTRANT_PROTO_I_TSR'
+revision='5'
+rm='rm'
+rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*'
+rmail=''
+run=''
+runnm='false'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIEUldbl='"LE"'
+sPRIFUldbl='"LF"'
+sPRIGUldbl='"LG"'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"Le"'
+sPRIfldbl='"Lf"'
+sPRIgldbl='"Lg"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+sSCNfldbl='"Lf"'
+sched_yield='sched_yield()'
+scriptdir='@USRBIN@'
+scriptdirexp='@USRBIN@'
+sed='sed'
+seedfunc='Perl_drand48_init'
+selectminbits='64'
+selecttype='fd_set *'
+sendmail=''
+setgrent_r_proto='0'
+sethostent_r_proto='0'
+setlocale_r_proto='0'
+setnetent_r_proto='0'
+setprotoent_r_proto='0'
+setpwent_r_proto='0'
+setservent_r_proto='0'
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype='void *'
+shortsize='2'
+shrpenv=''
+shsharp='true'
+sig_count='65'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 6 17 29 31 '
+sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 6, 17, 29, 31, 0'
+sig_size='69'
+signal_t='void'
+sitearch='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
+sitearchexp='@LIBDIR@/perl/site_perl/5.24.1/@ARCH@-thread-multi'
+sitebin='@USRBIN@'
+sitebinexp='@USRBIN@'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib='@LIBDIR@/perl/site_perl/5.24.1'
+sitelib_stem='@LIBDIR@/perl/site_perl'
+sitelibexp='@LIBDIR@/perl/site_perl/5.24.1'
+siteman1dir=''
+siteman1direxp=''
+siteman3dir=''
+siteman3direxp=''
+siteprefix='@EXECPREFIX@'
+siteprefixexp='@EXECPREFIX@'
+sitescript='@USRBIN@'
+sitescriptexp='@USRBIN@'
+sizesize='8'
+sizetype='size_t'
+sleep=''
+smail=''
+so='so'
+sockethdr=''
+socketlib=''
+socksizetype='socklen_t'
+sort='sort'
+spackage='Perl5'
+spitshell='cat'
+srand48_r_proto='REENTRANT_PROTO_I_LS'
+srandom_r_proto='REENTRANT_PROTO_I_TS'
+src='.'
+ssizetype='ssize_t'
+st_ino_sign='1'
+st_ino_size='8'
+startperl='#!@USRBIN@/perl'
+startsh='#!/bin/sh'
+static_ext=' '
+stdchar='char'
+stdio_base='((fp)->_IO_read_base)'
+stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)'
+stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+stdio_filbuf=''
+stdio_ptr='((fp)->_IO_read_ptr)'
+stdio_stream_array=''
+strerror_r_proto='REENTRANT_PROTO_B_IBW'
+strings='@INCLUDEDIR@/string.h'
+submit=''
+subversion='1'
+sysman='@EXECPREFIX@/share/man/man1'
+sysroot=''
+tail=''
+tar=''
+targetarch=''
+targetdir=''
+targetenv=''
+targethost=''
+targetmkdir=''
+targetport=''
+targetsh='/bin/sh'
+tbl=''
+tee=''
+test='test'
+timeincl='@INCLUDEDIR@/sys/time.h @INCLUDEDIR@/time.h '
+timetype='time_t'
+tmpnam_r_proto='REENTRANT_PROTO_B_B'
+to=':'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+ttyname_r_proto='REENTRANT_PROTO_I_IBW'
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned int'
+u64size='8'
+u64type='unsigned long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"u"'
+uidsign='1'
+uidsize='4'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+uquadtype='unsigned long'
+use5005threads='undef'
+use64bitall='undef'
+use64bitint='undef'
+usecbacktrace='undef'
+usecrosscompile='define'
+usedevel='undef'
+usedl='define'
+usedtrace='undef'
+usefaststdio='undef'
+useithreads='define'
+usekernprocpathname='undef'
+uselargefiles='define'
+uselongdouble='undef'
+usemallocwrap='define'
+usemorebits='undef'
+usemultiplicity='define'
+usemymalloc='n'
+usenm='false'
+usensgetexecutablepath='undef'
+useopcode='true'
+useperlio='define'
+useposix='true'
+usequadmath='undef'
+usereentrant='undef'
+userelocatableinc='undef'
+useshrplib='true'
+usesitecustomize='undef'
+usesocks='undef'
+usethreads='define'
+usevendorprefix='define'
+useversionedarchname='undef'
+usevfork='false'
+usrinc='@INCLUDEDIR@'
+uuname=''
+uvXUformat='"lX"'
+uvoformat='"lo"'
+uvsize='8'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vaproto='define'
+vendorarch='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
+vendorarchexp='@LIBDIR@/perl/vendor_perl/5.24.1/@ARCH@-thread-multi'
+vendorbin='@USRBIN@'
+vendorbinexp='@USRBIN@'
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib='@LIBDIR@/perl/vendor_perl/5.24.1'
+vendorlib_stem='@LIBDIR@/perl/vendor_perl'
+vendorlibexp='@LIBDIR@/perl/vendor_perl/5.24.1'
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix='@EXECPREFIX@'
+vendorprefixexp='@EXECPREFIX@'
+vendorscript='@USRBIN@'
+vendorscriptexp='@USRBIN@'
+version='5.24.1'
+version_patchlevel_string='version 24 subversion 1'
+versiononly='undef'
+vi=''
+xlibpth='@LIBDIR@/386 @BASELIBDIR@386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+PERL_REVISION=5
+PERL_VERSION=24
+PERL_SUBVERSION=1
+PERL_API_REVISION=5
+PERL_API_VERSION=24
+PERL_API_SUBVERSION=1
+PERL_PATCHLEVEL=''
+PERL_CONFIG_SH=true
+: Variables propagated from previous config.sh file.
+libdb_needs_pthread='N'
+
+# for Time-HiRes
+d_clock_nanosleep='define'
+d_clock_gettime='define'
+d_clock_getres='define'
+d_clock='define'
+d_nanosleep='define'
+
+# for Signinfo
+d_siginfo_si_errno='define'
+d_siginfo_si_pid='define'
+d_siginfo_si_uid='define'
+d_siginfo_si_addr='define'
+d_siginfo_si_status='define'
+d_siginfo_si_band='define'
+d_siginfo_si_value='define'
+
+# don't support fdclose
+d_fdclose='undef'
+
+# support memmem
+d_memmem='define'
+
+# for locale
+d_newlocale='define'
+d_freelocale='define'
+d_uselocale='define'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-32 b/poky/meta/recipes-devtools/perl/perl/config.sh-32
new file mode 100644
index 000000000..7259a0c6a
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-32
@@ -0,0 +1,38 @@
+alignbytes='4'
+cf_time='Thu Dec 23 03:57:51 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=2 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cLL __INT64_MAX__=9223372036854775807LL __INT64_TYPE__=long\ long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cLL __INTMAX_MAX__=9223372036854775807LL __INTMAX_TYPE__=long\ long\ int __INTPTR_MAX__=2147483647 __INTPTR_TYPE__=int __INT_FAST16_MAX__=2147483647 __INT_FAST16_TYPE__=int __INT_FAST32_MAX__=2147483647 __INT_FAST32_TYPE__=int __INT_FAST64_MAX__=9223372036854775807LL __INT_FAST64_TYPE__=long\ long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807LL __INT_LEAST64_TYPE__=long\ long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=2147483647L __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=2147483647 __PTRDIFF_TYPE__=int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=12 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=4 __SIZEOF_POINTER__=4 __SIZEOF_PTRDIFF_T__=4 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=4 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=4294967295U __SIZE_TYPE__=unsigned\ int __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cULL __UINT64_MAX__=18446744073709551615ULL __UINT64_TYPE__=long\ long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cULL __UINTMAX_MAX__=18446744073709551615ULL __UINTMAX_TYPE__=long\ long\ unsigned\ int __UINTPTR_MAX__=4294967295U __UINTPTR_TYPE__=unsigned\ int __UINT_FAST16_MAX__=4294967295U __UINT_FAST16_TYPE__=unsigned\ int __UINT_FAST32_MAX__=4294967295U __UINT_FAST32_TYPE__=unsigned\ int __UINT_FAST64_MAX__=18446744073709551615ULL __UINT_FAST64_TYPE__=long\ long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615ULL __UINT_LEAST64_TYPE__=long\ long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647L __WCHAR_MIN__=(-2147483647L\ -\ 1) __WCHAR_TYPE__=long\ int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __gnu_linux__=1 __i386=1 __i386__=1 __i586=1 __i586__=1 __linux=1 __linux__=1 __pentium=1 __pentium__=1 __tune_i586__=1 __tune_pentium__=1 __unix=1 __unix__=1 i386=1 linux=1 unix=1'
+d_nv_preserves_uv='define'
+d_printf_format_null='define'
+d_u32align='undef'
+gidformat='"lu"'
+i32type='long'
+i64type='long long'
+ivsize='4'
+longdblsize='12'
+longsize='4'
+myuname='linux qemux86 2.6.37-rc5-yocto-standard+ #1 preempt mon dec 20 14:21:27 pst 2010 i686 gnulinux '
+need_va_copy='undef'
+netdb_host_type='const void *'
+nv_preserves_uv_bits='32'
+ptrsize='4'
+quadkind='3'
+quadtype='long long'
+sGMTIME_max='2147483647'
+sGMTIME_min='-2147483648'
+sLOCALTIME_max='2147483647'
+sLOCALTIME_min='-2147483648'
+sPRIXU64='"LX"'
+sPRId64='"Ld"'
+sPRIi64='"Li"'
+sPRIo64='"Lo"'
+sPRIu64='"Lu"'
+sPRIx64='"Lx"'
+selectminbits='32'
+sizesize='4'
+u32type='unsigned long'
+u64type='unsigned long long'
+uidformat='"lu"'
+uquadtype='unsigned long long'
+use64bitall='undef'
+use64bitint='undef'
+uvsize='4'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-32-be b/poky/meta/recipes-devtools/perl/perl/config.sh-32-be
new file mode 100644
index 000000000..a59a9abb5
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-32-be
@@ -0,0 +1 @@
+byteorder='4321'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-32-le b/poky/meta/recipes-devtools/perl/perl/config.sh-32-le
new file mode 100644
index 000000000..10e422656
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-32-le
@@ -0,0 +1 @@
+byteorder='1234'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-64 b/poky/meta/recipes-devtools/perl/perl/config.sh-64
new file mode 100644
index 000000000..6929d3a09
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-64
@@ -0,0 +1,38 @@
+alignbytes='8'
+cf_time='Thu Dec 23 02:06:42 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_DWARF2_CFI_ASM=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cL __INT64_MAX__=9223372036854775807L __INT64_TYPE__=long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cL __INTMAX_MAX__=9223372036854775807L __INTMAX_TYPE__=long\ int __INTPTR_MAX__=9223372036854775807L __INTPTR_TYPE__=long\ int __INT_FAST16_MAX__=9223372036854775807L __INT_FAST16_TYPE__=long\ int __INT_FAST32_MAX__=9223372036854775807L __INT_FAST32_TYPE__=long\ int __INT_FAST64_MAX__=9223372036854775807L __INT_FAST64_TYPE__=long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807L __INT_LEAST64_TYPE__=long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=9223372036854775807L __LP64__=1 __MMX__=1 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=9223372036854775807L __PTRDIFF_TYPE__=long\ int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=18446744073709551615UL __SIZE_TYPE__=long\ unsigned\ int __SSE2_MATH__=1 __SSE2__=1 __SSE_MATH__=1 __SSE__=1 __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cUL __UINT64_MAX__=18446744073709551615UL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cUL __UINTMAX_MAX__=18446744073709551615UL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=18446744073709551615UL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=18446744073709551615UL __UINT_FAST16_TYPE__=long\ unsigned\ int __UINT_FAST32_MAX__=18446744073709551615UL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=18446744073709551615UL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615UL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647 __WCHAR_MIN__=(-2147483647\ -\ 1) __WCHAR_TYPE__=int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __amd64=1 __amd64__=1 __gnu_linux__=1 __k8=1 __k8__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 __x86_64=1 __x86_64__=1 linux=1 unix=1'
+d_nv_preserves_uv='undef'
+d_printf_format_null='undef'
+d_u32align='define'
+gidformat='"u"'
+i32type='int'
+i64type='long'
+ivsize='8'
+longdblsize='16'
+longsize='8'
+myuname='linux qemux86-64 2.6.37-rc5-yocto-standard+ #1 smp preempt mon dec 20 17:19:50 pst 2010 x86_64 gnulinux '
+need_va_copy='define'
+netdb_host_type='char *'
+nv_preserves_uv_bits='53'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+selectminbits='64'
+sizesize='8'
+u32type='unsigned int'
+u64type='unsigned long'
+uidformat='"u"'
+uquadtype='unsigned long'
+use64bitall='define'
+use64bitint='define'
+uvsize='8'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-64-be b/poky/meta/recipes-devtools/perl/perl/config.sh-64-be
new file mode 100644
index 000000000..c08ce3c43
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-64-be
@@ -0,0 +1 @@
+byteorder='87654321'
diff --git a/poky/meta/recipes-devtools/perl/perl/config.sh-64-le b/poky/meta/recipes-devtools/perl/perl/config.sh-64-le
new file mode 100644
index 000000000..277d2a9be
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/config.sh-64-le
@@ -0,0 +1 @@
+byteorder='12345678'
diff --git a/poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch b/poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
new file mode 100644
index 000000000..33e222259
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.24.1/Makefile.SH
+===================================================================
+--- perl-5.24.1.orig/Makefile.SH
++++ perl-5.24.1/Makefile.SH
+@@ -710,7 +710,7 @@ bitcount.h: generate_uudmap\$(HOST_EXE_E
+
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
+- $(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
++ $(BUILD_CC) -o generate_uudmap$(EXE_EXT) generate_uudmap.c
+
+ !NO!SUBS!
+ ;;
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff b/poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
new file mode 100644
index 000000000..c597701ca
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
@@ -0,0 +1,63 @@
+From d33d46963035ef726144dc66be2ae9c00aec0333 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Tue, 16 Oct 2012 23:07:56 +0300
+Subject: Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent
+ is writable
+
+The site directories do not exist on a typical Debian system. The build
+systems will create them when necessary, so there's no need for a prompt
+suggesting local::lib if the first existing parent directory is writable.
+
+Also, writability of the core directories is not interesting as we
+explicitly tell CPAN not to touch those with INSTALLDIRS=site.
+
+Bug-Debian: http://bugs.debian.org/688842
+Patch-Name: debian/cpan-missing-site-dirs.diff
+Upstream-Status: Pending
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 33054cd..7b0becf 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -2057,11 +2057,34 @@ sub _print_urllist {
+ };
+ }
+
++# Debian modification: return true if this directory
++# or the first existing one upwards is writable
++sub _can_write_to_this_or_parent {
++ my ($dir) = @_;
++ my @parts = File::Spec->splitdir($dir);
++ while (@parts) {
++ my $cur = File::Spec->catdir(@parts);
++ return 1 if -w $cur;
++ return 0 if -e _;
++ pop @parts;
++ }
++ return 0;
++}
++
++# Debian specific modification: the site directories don't necessarily
++# exist on the system, but the build systems create them when necessary,
++# so return true if the first existing directory upwards is writable
++#
++# Furthermore, on Debian, only test the site directories
++# (installsite*, expanded to /usr/local/{share,lib}/perl),
++# not the core ones
++# (install*lib, expanded to /usr/{share,lib}/perl).
++# We pass INSTALLDIRS=site by default to keep CPAN from touching
++# the core directories.
++
+ sub _can_write_to_libdirs {
+- return -w $Config{installprivlib}
+- && -w $Config{installarchlib}
+- && -w $Config{installsitelib}
+- && -w $Config{installsitearch}
++ return _can_write_to_this_or_parent($Config{installsitelib})
++ && _can_write_to_this_or_parent($Config{installsitearch})
+ }
+
+ sub _using_installbase {
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff b/poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
new file mode 100644
index 000000000..572f14951
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
@@ -0,0 +1,38 @@
+From 5ff1f21484aab68efe321ff4ba5d35928f72af96 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Provide a sensible INSTALLDIRS default for modules installed from
+ CPAN.
+
+Some modules which are included in core set INSTALLDIRS => 'perl'
+explicitly in Makefile.PL or Build.PL. This makes sense for the normal @INC
+ordering, but not ours.
+
+Patch-Name: debian/cpan_definstalldirs.diff
+Upstream-Status: Pending
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 918e009..33054cd 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -1024,7 +1024,7 @@ sub init {
+ my_prompt_loop(prefer_installer => 'MB', $matcher, 'MB|EUMM|RAND');
+
+ if (!$matcher or 'makepl_arg make_arg' =~ /$matcher/) {
+- my_dflt_prompt(makepl_arg => "", $matcher);
++ my_dflt_prompt(makepl_arg => "INSTALLDIRS=site", $matcher);
+ my_dflt_prompt(make_arg => "", $matcher);
+ if ( $CPAN::Config->{makepl_arg} =~ /LIBS=|INC=/ ) {
+ $CPAN::Frontend->mywarn(
+@@ -1056,7 +1056,7 @@ sub init {
+ my_dflt_prompt(make_install_arg => $CPAN::Config->{make_arg} || "",
+ $matcher);
+
+- my_dflt_prompt(mbuildpl_arg => "", $matcher);
++ my_dflt_prompt(mbuildpl_arg => "--installdirs site", $matcher);
+ my_dflt_prompt(mbuild_arg => "", $matcher);
+
+ if (exists $CPAN::HandleConfig::keys{mbuild_install_build_command}
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff b/poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
new file mode 100644
index 000000000..0861650eb
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
@@ -0,0 +1,35 @@
+From 01421f8a80d5c623959695ba2b8167f30112d333 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 16 Dec 2005 01:32:14 +1100
+Subject: Remove overly restrictive DB_File version check.
+
+Bug-Debian: http://bugs.debian.org/340047
+
+Package dependencies ensure the correct library is linked at run-time.
+
+Patch-Name: debian/db_file_ver.diff
+Upstream-Status: Pending
+---
+ cpan/DB_File/version.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cpan/DB_File/version.c b/cpan/DB_File/version.c
+index e01f6f6..544e6ee 100644
+--- a/cpan/DB_File/version.c
++++ b/cpan/DB_File/version.c
+@@ -48,6 +48,7 @@ __getBerkeleyDBInfo()
+
+ (void)db_version(&Major, &Minor, &Patch) ;
+
++#ifndef DEBIAN
+ /* Check that the versions of db.h and libdb.a are the same */
+ if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR )
+ /* || Patch != DB_VERSION_PATCH) */
+@@ -55,6 +56,7 @@ __getBerkeleyDBInfo()
+ croak("\nDB_File was build with libdb version %d.%d.%d,\nbut you are attempting to run it with libdb version %d.%d.%d\n",
+ DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+ Major, Minor, Patch) ;
++#endif /* DEBIAN */
+
+ /* check that libdb is recent enough -- we need 2.3.4 or greater */
+ if (Major == 2 && (Minor < 3 || (Minor == 3 && Patch < 4)))
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff b/poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
new file mode 100644
index 000000000..c2ac4a3bd
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
@@ -0,0 +1,57 @@
+From def4aa3817f98aae625e601b791ef068276f05d5 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Mon, 17 May 2010 13:23:07 +0300
+Subject: Point users to Debian packages of deprecated core modules
+
+Bug-Debian: http://bugs.debian.org/747628
+
+Several modules are being deprecated with perl 5.20.
+To get a clean transition, perl/perl-modules is going to recommend the
+separate Debian packages of these for one release cycle so that they will be
+pulled in by default on upgrades. This is taking place for perl 5.20/jessie.
+
+However, on systems configured to ignore recommendations the deprecation
+warnings will still be useful, so modify them slightly to point to the
+separate packages instead.
+
+Patch-Name: debian/deprecate-with-apt.diff
+Upstream-Status: Pending
+---
+ lib/deprecate.pm | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/lib/deprecate.pm b/lib/deprecate.pm
+index 47bc112..b0c61df 100644
+--- a/lib/deprecate.pm
++++ b/lib/deprecate.pm
+@@ -7,6 +7,13 @@ our $VERSION = 0.03;
+ our %Config;
+ unless (%Config) { require Config; *Config = \%Config::Config; }
+
++# Debian-specific change: recommend the separate Debian packages of
++# deprecated modules where available
++
++our %DEBIAN_PACKAGES = (
++ # None for the perl 5.22 cycle
++);
++
+ # This isn't a public API. It's internal to code maintained by the perl-porters
+ # If you would like it to be a public API, please send a patch with
+ # documentation and tests. Until then, it may change without warning.
+@@ -58,9 +65,15 @@ EOM
+ if (defined $callers_bitmask
+ && (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
+ || vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
+- warn <<"EOM";
++ if (my $deb = $DEBIAN_PACKAGES{$package}) {
++ warn <<"EOM";
++$package will be removed from the Perl core distribution in the next major release. Please install the separate $deb package. It is being used at $call_file, line $call_line.
++EOM
++ } else {
++ warn <<"EOM";
+ $package will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at $call_file, line $call_line.
+ EOM
++ }
+ }
+ }
+ }
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff b/poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
new file mode 100644
index 000000000..4662ecdaa
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/doc_info.diff
@@ -0,0 +1,36 @@
+From e18f81e69c55d698abd293e71063d6b6b275cc07 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Replace generic man(1) instructions with Debian-specific information.
+
+Indicate that the user needs to install the perl-doc package.
+
+Patch-Name: debian/doc_info.diff
+Upstream-Status: Pending
+---
+ pod/perl.pod | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/pod/perl.pod b/pod/perl.pod
+index 364e957..f97e103 100644
+--- a/pod/perl.pod
++++ b/pod/perl.pod
+@@ -291,8 +291,16 @@ aux c2ph h2ph h2xs perlbug pl2pm pod2html pod2man splain xsubpp
+
+ =for buildtoc __END__
+
+-On a Unix-like system, these documentation files will usually also be
+-available as manpages for use with the F<man> program.
++On Debian systems, you need to install the B<perl-doc> package which
++contains the majority of the standard Perl documentation and the
++F<perldoc> program.
++
++Extensive additional documentation for Perl modules is available, both
++those distributed with Perl and third-party modules which are packaged
++or locally installed.
++
++You should be able to view Perl's documentation with your man(1)
++program or perldoc(1).
+
+ Some documentation is not available as man pages, so if a
+ cross-reference is not found by man, try it with L<perldoc>. Perldoc can
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff b/poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
new file mode 100644
index 000000000..b3bd58c1d
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
@@ -0,0 +1,71 @@
+From 7fe59a3d0601c6d8634eae4f99dae3024cd02a92 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Tweak enc2xs to follow symlinks and ignore missing @INC directories.
+
+Bug-Debian: http://bugs.debian.org/290336
+
+- ignore missing directories,
+- follow symlinks (/usr/share/perl/5.8 -> 5.8.4).
+- filter "." out when running "enc2xs -C", it's unnecessary and causes
+ issues with follow => 1 (see #603686 and [rt.cpan.org #64585])
+
+Patch-Name: debian/enc2xs_inc.diff
+Upstream-Status: Pending
+---
+ cpan/Encode/bin/enc2xs | 8 ++++----
+ t/porting/customized.t | 3 +++
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
+index 19f2b2b..4d64e38 100644
+--- a/cpan/Encode/bin/enc2xs
++++ b/cpan/Encode/bin/enc2xs
+@@ -944,11 +944,11 @@ use vars qw(
+ sub find_e2x{
+ eval { require File::Find; };
+ my (@inc, %e2x_dir);
+- for my $inc (@INC){
++ for my $inc (grep -d, @INC){
+ push @inc, $inc unless $inc eq '.'; #skip current dir
+ }
+ File::Find::find(
+- sub {
++ { wanted => sub {
+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+ $atime,$mtime,$ctime,$blksize,$blocks)
+ = lstat($_) or return;
+@@ -958,7 +958,7 @@ sub find_e2x{
+ $e2x_dir{$File::Find::dir} ||= $mtime;
+ }
+ return;
+- }, @inc);
++ }, follow => 1}, @inc);
+ warn join("\n", keys %e2x_dir), "\n";
+ for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){
+ $_E2X = $d;
+@@ -1025,7 +1025,7 @@ sub make_configlocal_pm {
+ $LocalMod{$enc} ||= $mod;
+ }
+ };
+- File::Find::find({wanted => $wanted}, @INC);
++ File::Find::find({wanted => $wanted, follow => 1}, grep -d && !/^\./, @INC);
+ $_ModLines = "";
+ for my $enc ( sort keys %LocalMod ) {
+ $_ModLines .=
+diff --git a/t/porting/customized.t b/t/porting/customized.t
+index 45fcafb..3bd6adb 100644
+--- a/t/porting/customized.t
++++ b/t/porting/customized.t
+@@ -101,8 +101,11 @@ foreach my $module ( sort keys %Modules ) {
+ print $data_fh join(' ', $module, $file, $id), "\n";
+ next;
+ }
++SKIP: {
++ skip("$file modified for Debian", 1) if $file eq 'cpan/Encode/bin/enc2xs';
+ my $should_be = $customised{ $module }->{ $file };
+ is( $id, $should_be, "SHA for $file matches stashed SHA" );
++}
+ }
+ }
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff b/poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
new file mode 100644
index 000000000..a965fbeee
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
@@ -0,0 +1,37 @@
+From 8e1efba7560d8d55524c7a0f1b0539ddce419b86 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 16 Dec 2005 01:32:14 +1100
+Subject: [PATCH 6/8] Remove Errno version check due to upgrade problems with
+ long-running processes.
+
+Bug-Debian: http://bugs.debian.org/343351
+
+Remove version check which can cause problems for long running
+processes embedding perl when upgrading to a newer version,
+compatible, but built on a different machine.
+
+Patch-Name: debian/errno_ver.diff
+Upstream-Status: Pending
+---
+ ext/Errno/Errno_pm.PL | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index 6251a3c..eeed445 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -294,11 +294,6 @@ EDQ
+ # they've already declared perl doesn't need to worry about this risk.
+ if(!$ENV{'PERL_BUILD_EXPAND_CONFIG_VARS'}) {
+ print <<"CONFIG_CHECK_END";
+-use Config;
+-"\$Config{'archname'}-\$Config{'osvers'}" eq
+-"$archname-$Config{'osvers'}" or
+- die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
+-
+ CONFIG_CHECK_END
+ }
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff b/poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
new file mode 100644
index 000000000..e023038f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
@@ -0,0 +1,38 @@
+From 431275078b0490d2e092442d9582be06bb95b354 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 10 May 2014 23:34:14 +0300
+Subject: EU:MM: set location of libperl.a under /usr/lib
+
+The Debian packaging moves libperl.a a couple of levels up from the
+CORE directory to match other static libraries.
+
+Patch-Name: debian/extutils_set_libperl_path.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ pp.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 5f1b87f..570a631 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2505,7 +2505,7 @@ MAP_PRELIBS = $Config{perllibs} $Config{cryptlib}
+ ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
+ }
+ unless ($libperl && -f $lperl) { # Ilya's code...
+- my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
++ my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/../..";
+ $dir = "$self->{PERL_ARCHLIB}/.." if $self->{UNINSTALLED_PERL};
+ $libperl ||= "libperl$self->{LIB_EXT}";
+ $libperl = "$dir/$libperl";
+diff --git a/pp.c b/pp.c
+index 42f156a..77c1279 100644
+--- a/pp.c
++++ b/pp.c
+@@ -1,4 +1,4 @@
+-/* pp.c
++ /* pp.c
+ *
+ * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ * 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Larry Wall and others
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff b/poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
new file mode 100644
index 000000000..bdf34d185
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
@@ -0,0 +1,43 @@
+From 27ae7b18078d801a2c943aa6de2f7e9808177251 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Postpone LD_LIBRARY_PATH evaluation to the binary targets.
+
+Modify the setting of LD_LIBRARY_PATH to append pre-existing values at the
+time the rule is evaluated rather than when the Makefile is created.
+
+This is required when building packages with dpkg-buildpackage and fakeroot,
+since fakeroot (which now sets LD_LIBRARY_PATH) is not used for the "build"
+rule where the Makefile is created, but is for the clean/binary* targets.
+
+Patch-Name: debian/fakeroot.diff
+Upstream-Status: Pending
+---
+ Makefile.SH | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index 034d812..04dd7d5 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -39,10 +39,7 @@ case "$useshrplib" in
+ true)
+ # Prefix all runs of 'miniperl' and 'perl' with
+ # $ldlibpth so that ./perl finds *this* shared libperl.
+- case "$LD_LIBRARY_PATH" in
+- '') ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+- *) ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+- esac
++ ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `"'$${LD_LIBRARY_PATH:+:}$$LD_LIBRARY_PATH'
+
+ pldlflags="$cccdlflags"
+ static_ldflags=''
+@@ -113,7 +110,7 @@ true)
+ ;;
+ esac
+ case "$ldlibpthname" in
+- '') ;;
++ ''|LD_LIBRARY_PATH) ;;
+ *)
+ case "$osname" in
+ os2)
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff b/poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
new file mode 100644
index 000000000..082709140
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
@@ -0,0 +1,36 @@
+From c81dbdedff9e9b4fb75ac028aa718838c0292d2f Mon Sep 17 00:00:00 2001
+From: Andreas Marschke <andreas.marschke@googlemail.com>
+Date: Sat, 17 Sep 2011 11:38:42 +0100
+Subject: Configure CPAN::Distribution with correct name of html2text
+
+Bug-Debian: http://bugs.debian.org/640479
+Patch-Name: debian/find_html2text.diff
+
+If you use cpan from Debian you usually wind up trying to read online
+documentation through it. Unfortunately cpan can't find the
+html2text.pl script even though it is installed using the Debian
+package 'html2text'.
+
+Please see the attached patch for a quick fix of this issue.
+
+[Maintainer's note: html2text in Debian is not the same implementation
+as the html2text.pl which is expected, but should provide similar
+functionality].
+Upstream-Status: Pending
+---
+ cpan/CPAN/lib/CPAN/Distribution.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/Distribution.pm b/cpan/CPAN/lib/CPAN/Distribution.pm
+index 092b781..5c2bae1 100644
+--- a/cpan/CPAN/lib/CPAN/Distribution.pm
++++ b/cpan/CPAN/lib/CPAN/Distribution.pm
+@@ -4099,7 +4099,7 @@ sub _display_url {
+ if $CPAN::DEBUG;
+
+ # should we define it in the config instead?
+- my $html_converter = "html2text.pl";
++ my $html_converter = "html2text";
+
+ my $web_browser = $CPAN::Config->{'lynx'} || undef;
+ my $web_browser_out = $web_browser
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
new file mode 100644
index 000000000..f3d92583e
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
@@ -0,0 +1,32 @@
+From 9faf6dcc3a5c4154484d812eb3cc3dd78b35563b Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Mon, 30 May 2011 22:54:24 +0300
+Subject: Document that CCFLAGS should include $Config{ccflags}
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68613
+Bug-Debian: http://bugs.debian.org/628522
+
+Compiling XS extensions without $Config{ccflags} can break the
+binary interface on some platforms.
+
+Patch-Name: fixes/document_makemaker_ccflags.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+index fe95b27..90403e8 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+@@ -1774,6 +1774,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
+ String that will be included in the compiler call command line between
+ the arguments INC and OPTIMIZE.
+
++The default value is taken from $Config{ccflags}. When overriding
++CCFLAGS, make sure to include the $Config{ccflags} settings to avoid
++binary incompatibilities.
++
+ =item CONFIG
+
+ Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
new file mode 100644
index 000000000..d9b36f6d2
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
@@ -0,0 +1,111 @@
+From 55d430eb02fc116581847304ca20321687978269 Mon Sep 17 00:00:00 2001
+From: Jonathan Nieder <jrnieder@gmail.com>
+Date: Fri, 27 Jul 2012 10:35:07 -0500
+Subject: Memoize::Storable: respect 'nstore' option not respected
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Memoize(3perl) says:
+
+ tie my %cache => 'Memoize::Storable', $filename, 'nstore';
+ memoize 'function', SCALAR_CACHE => [HASH => \%cache];
+
+ Include the ‘nstore’ option to have the "Storable" database
+ written in ‘network order’. (See Storable for more details
+ about this.)
+
+In fact the "nstore" option does no such thing. Option parsing looks
+like this:
+
+ @options{@_} = ();
+
+$self->{OPTIONS}{'nstore'} is accordingly set to undef. Later
+Memoize::Storable checks if the option is true, and since undef is
+not true, the "else" branch is always taken.
+
+ if ($self->{OPTIONS}{'nstore'}) {
+ Storable::nstore($self->{H}, $self->{FILENAME});
+ } else {
+ Storable::store($self->{H}, $self->{FILENAME});
+ }
+
+Correcting the condition to (exists $self->{OPTIONS}{'nstore'}) fixes
+it.
+
+Noticed because git-svn, which uses the 'nstore' option for its
+on-disk caches, was producing
+
+ Byte order is not compatible at ../../lib/Storable.pm
+
+when run using a perl with a different integer size (and hence
+byteorder).
+
+Reported by Tim Retout (RT#77790)
+
+Bug-Debian: http://bugs.debian.org/587650
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Patch-Name: fixes/memoize_storable_nstore.diff
+Upstream-Status: Pending
+---
+ cpan/Memoize/Memoize/Storable.pm | 2 +-
+ cpan/Memoize/t/tie_storable.t | 24 ++++++++++++++++++++----
+ 2 files changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/cpan/Memoize/Memoize/Storable.pm b/cpan/Memoize/Memoize/Storable.pm
+index 1314797..87876f2 100644
+--- a/cpan/Memoize/Memoize/Storable.pm
++++ b/cpan/Memoize/Memoize/Storable.pm
+@@ -55,7 +55,7 @@ sub DESTROY {
+ require Carp if $Verbose;
+ my $self= shift;
+ print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose;
+- if ($self->{OPTIONS}{'nstore'}) {
++ if (exists $self->{OPTIONS}{'nstore'}) {
+ Storable::nstore($self->{H}, $self->{FILENAME});
+ } else {
+ Storable::store($self->{H}, $self->{FILENAME});
+diff --git a/cpan/Memoize/t/tie_storable.t b/cpan/Memoize/t/tie_storable.t
+index de3b8dc..a624238 100644
+--- a/cpan/Memoize/t/tie_storable.t
++++ b/cpan/Memoize/t/tie_storable.t
+@@ -31,18 +31,34 @@ if ($@) {
+ exit 0;
+ }
+
+-print "1..4\n";
++print "1..9\n";
+
+ $file = "storable$$";
+ 1 while unlink $file;
+ tryout('Memoize::Storable', $file, 1); # Test 1..4
+ 1 while unlink $file;
++tryout('Memoize::Storable', $file, 5, 'nstore'); # Test 5..8
++assert_netorder($file, 9); # Test 9
++1 while unlink $file;
++
++
++sub assert_netorder {
++ my ($file, $testno) = @_;
++
++ my $netorder = Storable::file_magic($file)->{'netorder'};
++ print ($netorder ? "ok $testno\n" : "not ok $testno\n");
++}
+
+ sub tryout {
+- my ($tiepack, $file, $testno) = @_;
++ my ($tiepack, $file, $testno, $option) = @_;
+
+- tie my %cache => $tiepack, $file
+- or die $!;
++ if (defined $option) {
++ tie my %cache => $tiepack, $file, $option
++ or die $!;
++ } else {
++ tie my %cache => $tiepack, $file
++ or die $!;
++ }
+
+ memoize 'c5',
+ SCALAR_CACHE => [HASH => \%cache],
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
new file mode 100644
index 000000000..afcf7fb01
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
@@ -0,0 +1,26 @@
+From fa085fedd9c406edcd4a1a256c025d5ff7f6c6de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Thu, 20 Sep 2007 19:47:14 +1000
+Subject: Document the Net::SMTP 'Port' option
+
+Bug-Debian: http://bugs.debian.org/100195
+Bug: http://rt.cpan.org/Public/Bug/Display.html?id=36038
+
+Patch-Name: fixes/net_smtp_docs.diff
+Upstream-Status: Pending
+---
+ cpan/libnet/lib/Net/SMTP.pm | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cpan/libnet/lib/Net/SMTP.pm b/cpan/libnet/lib/Net/SMTP.pm
+index afd017a..6ae7d9e 100644
+--- a/cpan/libnet/lib/Net/SMTP.pm
++++ b/cpan/libnet/lib/Net/SMTP.pm
+@@ -738,6 +738,7 @@ Net::SMTP will attempt to extract the address from the value passed.
+
+ B<Debug> - Enable debugging information
+
++B<Port> - Select a port on the remote host to connect to (default is 25)
+
+ Example:
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
new file mode 100644
index 000000000..9bdf41b47
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
@@ -0,0 +1,74 @@
+From 0ecf83f259db09cb38cb37c9b22e72be185afa8f Mon Sep 17 00:00:00 2001
+From: Hugo van der Sanden <hv@crypt.org>
+Date: Thu, 11 Jun 2015 12:25:40 +0100
+Subject: fix -Cnn parsing
+
+Commit 22ff313068 for [perl #123814] inadvertently changed the logic when
+parsing a numeric parameter to the -C option, such that the successfully
+parsed number was not saved as the option value if it parsed to the end
+of the argument.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=125381
+Bug-Debian: https://bugs.debian.org/788636
+Origin: upstream, http://perl5.git.perl.org/perl.git/commit/89d84ff965
+Patch-Name: fixes/perl-Cnn.diff
+Upstream-Status: Pending
+---
+ t/run/switchC.t | 7 ++++++-
+ util.c | 17 ++++++++---------
+ 2 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/t/run/switchC.t b/t/run/switchC.t
+index f6aa868..4f63c3b 100644
+--- a/t/run/switchC.t
++++ b/t/run/switchC.t
+@@ -11,7 +11,7 @@ BEGIN {
+ skip_all_if_miniperl('-C and $ENV{PERL_UNICODE} are disabled on miniperl');
+ }
+
+-plan(tests => 13);
++plan(tests => 14);
+
+ my $r;
+
+@@ -25,6 +25,11 @@ $r = runperl( switches => [ '-CO', '-w' ],
+ stderr => 1 );
+ like( $r, qr/^$b(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' );
+
++$r = runperl( switches => [ '-C2', '-w' ],
++ prog => 'print chr(256)',
++ stderr => 1 );
++like( $r, qr/^$b(?:\r?\n)?$/s, '-C2: no warning on UTF-8 output' );
++
+ SKIP: {
+ if (exists $ENV{PERL_UNICODE} &&
+ ($ENV{PERL_UNICODE} eq "" || $ENV{PERL_UNICODE} =~ /[SO]/)) {
+diff --git a/util.c b/util.c
+index 8cf62f5..ee23314 100644
+--- a/util.c
++++ b/util.c
+@@ -4420,16 +4420,15 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
+ if (isDIGIT(*p)) {
+ const char* endptr;
+ UV uv;
+- if (grok_atoUV(p, &uv, &endptr)
+- && uv <= U32_MAX
+- && (p = endptr)
+- && *p && *p != '\n' && *p != '\r'
+- ) {
++ if (grok_atoUV(p, &uv, &endptr) && uv <= U32_MAX) {
+ opt = (U32)uv;
+- if (isSPACE(*p))
+- goto the_end_of_the_opts_parser;
+- else
+- Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++ p = endptr;
++ if (p && *p && *p != '\n' && *p != '\r') {
++ if (isSPACE(*p))
++ goto the_end_of_the_opts_parser;
++ else
++ Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++ }
+ }
+ }
+ else {
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
new file mode 100644
index 000000000..d23573f18
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
@@ -0,0 +1,171 @@
+From 9057adc106d6bbef53c9e706523cd94f1a7a08d4 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@debian.org>
+Date: Sat, 30 Aug 2014 15:10:41 -0700
+Subject: Support POD_MAN_DATE in Pod::Man for the left-hand footer
+
+Honor the environment variable POD_MAN_DATE and use its contents, if
+set, as the value of the left-hand footer if the date option is not
+set, overriding the timestamp of the input file. This is primarily
+useful to ensure reproducible builds of the same output file given the
+same souce and Pod::Man version, even when file timestamps may not be
+consistent. Thanks, Niko Tyni.
+
+Bug-Debian: http://bugs.debian.org/759405
+Origin: upstream
+Patch-Name: fixes/pod_man_reproducible_date.diff
+Upstream-Status: Pending
+---
+ cpan/podlators/lib/Pod/Man.pm | 69 +++++++++++++++++++++++++++++++-----------
+ cpan/podlators/t/devise-date.t | 29 +++++++++++++-----
+ 2 files changed, 72 insertions(+), 26 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 72ca9ff..0536662 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -876,25 +876,42 @@ sub devise_title {
+ }
+
+ # Determine the modification date and return that, properly formatted in ISO
+-# format. If we can't get the modification date of the input, instead use the
+-# current time. Pod::Simple returns a completely unuseful stringified file
+-# handle as the source_filename for input from a file handle, so we have to
+-# deal with that as well.
++# format.
++#
++# If POD_MAN_DATE is set, that overrides anything else. This can be used for
++# reproducible generation of the same file even if the input file timestamps
++# are unpredictable or the POD coms from standard input.
++#
++# Otherwise, use the modification date of the input if we can stat it. Be
++# aware that Pod::Simple returns the stringification of the file handle as
++# source_filename for input from a file handle, so we'll stat some random ref
++# string in that case. If that fails, instead use the current time.
++#
++# $self - Pod::Man object, used to get the source file
++#
++# Returns: YYYY-MM-DD date suitable for the left-hand footer
+ sub devise_date {
+ my ($self) = @_;
++
++ # If POD_MAN_DATE is set, always use it.
++ if ($ENV{POD_MAN_DATE}) {
++ return $ENV{POD_MAN_DATE};
++ }
++
++ # Otherwise, get the input filename and try to stat it. If that fails,
++ # use the current time.
+ my $input = $self->source_filename;
+ my $time;
+ if ($input) {
+- $time = (stat $input)[9] || time;
++ $time = (stat($input))[9] || time();
+ } else {
+- $time = time;
++ $time = time();
+ }
+
+- # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker
+- # uses this and it has to work in the core which can't load dynamic
+- # libraries.
+- my ($year, $month, $day) = (localtime $time)[5,4,3];
+- return sprintf ("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
++ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
++ # this and it has to work in the core which can't load dynamic libraries.
++ my ($year, $month, $day) = (localtime($time))[5,4,3];
++ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+
+ # Print out the preamble and the title. The meaning of the arguments to .TH
+@@ -1632,6 +1649,15 @@ argument.
+ Sets the centered page header to use instead of "User Contributed Perl
+ Documentation".
+
++=item date
++
++Sets the left-hand footer. If this option is not set, the contents of the
++environment variable POD_MAN_DATE, if set, will be used. Failing that,
++the modification date of the input file will be used, or the current time
++if stat() can't find that file (which will be the case if the input is
++from C<STDIN>). If obtained from the file modification date or the
++current time, he date will be formatted as C<YYYY-MM-DD>.
++
+ =item errors
+
+ How to report errors. C<die> says to throw an exception on any POD
+@@ -1642,13 +1668,6 @@ POD errors entirely, as much as possible.
+
+ The default is C<pod>.
+
+-=item date
+-
+-Sets the left-hand footer. By default, the modification date of the input
+-file will be used, or the current date if stat() can't find that file (the
+-case if the input is from C<STDIN>), and the date will be formatted as
+-C<YYYY-MM-DD>.
+-
+ =item fixed
+
+ The fixed-width font to use for verbatim text and code. Defaults to
+@@ -1810,6 +1829,20 @@ option was set to C<die>.
+
+ =back
+
++=head1 ENVIRONMENT
++
++=over 4
++
++=item POD_MAN_DATE
++
++If set, this will be used as the value of the left-hand footer unless the
++C<date> option is explicitly set, overriding the timestamp of the input
++file or the current time. This is primarily useful to ensure reproducible
++builds of the same output file given the same souce and Pod::Man version,
++even when file timestamps may not be consistent.
++
++=back
++
+ =head1 BUGS
+
+ Encoding handling assumes that PerlIO is available and does not work
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 3cce9f5..c610dd9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -1,15 +1,28 @@
+-#!/usr/bin/perl -w
+-
+-# In order for MakeMaker to build in the core, nothing can use
+-# Fcntl which includes POSIX. devise_date()'s use of strftime()
+-# was replaced. This tests that it's identical.
++#!/usr/bin/perl
++#
++# In order for MakeMaker to build in the core, nothing can use Fcntl which
++# includes POSIX. devise_date()'s use of strftime() was replaced. This tests
++# that it's identical. It also tests special handling of the POD_MAN_DATE
++# environment variable.
+
++use 5.006;
+ use strict;
+-
+-use Test::More tests => 1;
++use warnings;
+
+ use Pod::Man;
+ use POSIX qw(strftime);
+
++use Test::More tests => 2;
++
++# Check that the results of device_date matches strftime. There is no input
++# file name, so this will use the current time.
+ my $parser = Pod::Man->new;
+-is $parser->devise_date, strftime("%Y-%m-%d", localtime);
++is(
++ $parser->devise_date,
++ strftime('%Y-%m-%d', localtime()),
++ 'devise_date matches strftime'
++);
++
++# Set the override environment variable and ensure that it's honored.
++local $ENV{POD_MAN_DATE} = '2014-01-01';
++is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
new file mode 100644
index 000000000..9de29b865
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
@@ -0,0 +1,52 @@
+From 183bb4af7ad862a2cf31d0dcb3dd45c100f76776 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 22:21:25 -0700
+Subject: Support an empty POD_MAN_DATE environment variable
+
+One may want to set this to an empty string. Handle that correctly.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=e0e9fcb53e8fc954b2b1955385eea18c27f869af
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-empty-date.diff
+Upstream-Status: Pending
+---
+ cpan/podlators/lib/Pod/Man.pm | 2 +-
+ cpan/podlators/t/devise-date.t | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 365892e..8997a15 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -894,7 +894,7 @@ sub devise_date {
+ my ($self) = @_;
+
+ # If POD_MAN_DATE is set, always use it.
+- if ($ENV{POD_MAN_DATE}) {
++ if (defined($ENV{POD_MAN_DATE})) {
+ return $ENV{POD_MAN_DATE};
+ }
+
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 9da9d1b..27271d9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -12,7 +12,7 @@ use warnings;
+ use Pod::Man;
+ use POSIX qw(strftime);
+
+-use Test::More tests => 2;
++use Test::More tests => 3;
+
+ # Check that the results of device_date matches strftime. There is no input
+ # file name, so this will use the current time.
+@@ -26,3 +26,7 @@ is(
+ # Set the override environment variable and ensure that it's honored.
+ local $ENV{POD_MAN_DATE} = '2014-01-01';
+ is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
++
++# Check that an empty environment variable is honored.
++local $ENV{POD_MAN_DATE} = q{};
++is($parser->devise_date, q{}, 'devise_date honors empty POD_MAN_DATE');
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
new file mode 100644
index 000000000..d8858d8a6
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
@@ -0,0 +1,110 @@
+From 7671d101baa75d7a79bfbd8c75c1595fbb3f53ba Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Sat, 7 Feb 2015 19:03:34 -0800
+Subject: Better errors for man pages from standard input
+
+[Pod::Man] Attempt to detect if the input came from a pipe and
+therefore has a completely unhelpful (and nonreproducible) source file
+name, and diagnose this as an error. Document that the name option
+(--name to pod2man) is required when processing POD source from
+standard input. (Debian Bug#777405)
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=d98872e46c93861b7aba14949e1258712087dc55
+Bug-Debian: https://bugs.debian.org/777405
+Patch-Name: fixes/podman-pipe.diff
+Upstream-Status: Pending
+---
+ cpan/podlators/lib/Pod/Man.pm | 15 +++++++++++++++
+ cpan/podlators/scripts/pod2man.PL | 4 ++++
+ cpan/podlators/t/devise-title.t | 32 ++++++++++++++++++++++++++++++++
+ 3 files changed, 51 insertions(+)
+ create mode 100755 cpan/podlators/t/devise-title.t
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 8997a15..969eaff 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -828,6 +828,17 @@ sub devise_title {
+ $section = 3 if (!$$self{section} && $name =~ /\.pm\z/i);
+ $name =~ s/\.p(od|[lm])\z//i;
+
++ # If Pod::Parser gave us an IO::File reference as the source file name,
++ # convert that to the empty string as well. Then, if we don't have a
++ # valid name, emit a warning and convert it to STDIN.
++ if ($name =~ /^IO::File(?:=\w+)\(0x[\da-f]+\)$/i) {
++ $name = '';
++ }
++ if ($name eq '') {
++ $self->whine (1, 'No name given for document');
++ $name = 'STDIN';
++ }
++
+ # If the section isn't 3, then the name defaults to just the basename of
+ # the file. Otherwise, assume we're dealing with a module. We want to
+ # figure out the full module name from the path to the file, but we don't
+@@ -1705,6 +1716,10 @@ module path. If it is, a path like C<.../lib/Pod/Man.pm> is converted into
+ a name like C<Pod::Man>. This option, if given, overrides any automatic
+ determination of the name.
+
++If generating a manual page from standard input, this option is required,
++since there's otherwise no way for Pod::Man to know what to use for the
++manual page name.
++
+ =item nourls
+
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 38695f8..43e35df 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -236,6 +236,10 @@ Note that this option is probably not useful when converting multiple POD
+ files at once. The convention for Unix man pages for commands is for the
+ man page title to be in all-uppercase even if the command isn't.
+
++When converting POD source from standard input, this option is required,
++since there's otherwise no way to know what to use as the name of the
++manual page.
++
+ =item B<--nourls>
+
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/t/devise-title.t b/cpan/podlators/t/devise-title.t
+new file mode 100755
+index 0000000..8639441
+--- /dev/null
++++ b/cpan/podlators/t/devise-title.t
+@@ -0,0 +1,32 @@
++#!/usr/bin/perl
++#
++# Tests for the automatic determination of the manual page title if not
++# specified via options to pod2man or the Pod::Man constructor.
++
++use 5.006;
++use strict;
++use warnings;
++
++use File::Spec;
++use IO::File;
++use Test::More tests => 3;
++
++BEGIN {
++ use_ok('Pod::Man');
++}
++
++# Create a parser and set it up with an input source. There isn't a way to do
++# this in Pod::Simple without actually parsing the document, so send the
++# output to a string that we'll ignore.
++my $path = File::Spec->catdir('t', 'data', 'basic.pod');
++my $handle = IO::File->new($path, 'r');
++my $parser = Pod::Man->new(errors => 'pod');
++my $output;
++$parser->output_string(\$output);
++$parser->parse_file($handle);
++
++# Check the results of devise_title for this. We should get back STDIN, and
++# we should have reported an error.
++my ($name, $section) = $parser->devise_title;
++is($name, 'STDIN', 'devise_title uses STDIN for file handle input');
++ok($parser->errors_seen, '...and errors were seen');
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
new file mode 100644
index 000000000..b6ae409ac
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
@@ -0,0 +1,87 @@
+From 6198856b5323d6204094293f01b890472618f182 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 20:49:07 -0700
+Subject: Documentation and test suite updates for UTC fix
+
+Update the Pod::Man and pod2man documentation and the test suite
+for the new UTC-based default page footer, and add a Changes
+entry.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=52db93bf80e4a06f8497e4ebade0506b6ee0e70d
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc-docs.diff
+Upstream-Status: Pending
+---
+ cpan/podlators/lib/Pod/Man.pm | 6 +++++-
+ cpan/podlators/scripts/pod2man.PL | 11 ++++++-----
+ cpan/podlators/t/devise-date.t | 2 +-
+ 3 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index c3ba201..365892e 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,6 +910,8 @@ sub devise_date {
+
+ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+ # this and it has to work in the core which can't load dynamic libraries.
++ # Use gmtime instead of localtime so that the generated man page does not
++ # depend on the local time zone setting and is more reproducible
+ my ($year, $month, $day) = (gmtime($time))[5,4,3];
+ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+@@ -1656,7 +1658,9 @@ environment variable POD_MAN_DATE, if set, will be used. Failing that,
+ the modification date of the input file will be used, or the current time
+ if stat() can't find that file (which will be the case if the input is
+ from C<STDIN>). If obtained from the file modification date or the
+-current time, he date will be formatted as C<YYYY-MM-DD>.
++current time, the date will be formatted as C<YYYY-MM-DD> and will be based
++on UTC (so that the output will be reproducible regardless of local time
++zone).
+
+ =item errors
+
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 6af3474..38695f8 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -174,9 +174,10 @@ Contributed Perl Documentation", but also see B<--official> below.
+
+ =item B<-d> I<string>, B<--date>=I<string>
+
+-Set the left-hand footer string to this value. By default, the modification
+-date of the input file will be used, or the current date if input comes from
+-C<STDIN>.
++Set the left-hand footer string to this value. By default, the
++modification date of the input file will be used, or the current date if
++input comes from C<STDIN>, and will be based on UTC (so that the output
++will be reproducible regardless of local time zone).
+
+ =item B<-errors>=I<style>
+
+@@ -383,8 +384,8 @@ B<pod2man> by Larry Wall and Tom Christiansen.
+
+ =head1 COPYRIGHT AND LICENSE
+
+-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ
+-Allbery <rra@stanford.edu>.
++Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014,
++2015 Russ Allbery <rra@cpan.org>.
+
+ This program is free software; you may redistribute it and/or modify it
+ under the same terms as Perl itself.
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index c610dd9..9da9d1b 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -19,7 +19,7 @@ use Test::More tests => 2;
+ my $parser = Pod::Man->new;
+ is(
+ $parser->devise_date,
+- strftime('%Y-%m-%d', localtime()),
++ strftime('%Y-%m-%d', gmtime()),
+ 'devise_date matches strftime'
+ );
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
new file mode 100644
index 000000000..3fb7c20dd
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
@@ -0,0 +1,34 @@
+From c796775cdbd2cce06acbb7ac355187d4063017a2 Mon Sep 17 00:00:00 2001
+From: Chris Lamb <lamby@debian.org>
+Date: Wed, 15 Apr 2015 20:42:53 -0700
+Subject: Make the embedded date from Pod::Man reproducible
+
+While working on the "reproducible builds" effort, we have noticed
+that Pod::Man generates output that varies depending on the current
+timezone.
+
+The attached patch fixes this by using GMT (~UTC) dates instead.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=913fbb2bd2ce071e20128629302ae2852554cad4
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc.diff
+Upstream-Status: Pending
+---
+ cpan/podlators/lib/Pod/Man.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 0536662..c3ba201 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,7 +910,7 @@ sub devise_date {
+
+ # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+ # this and it has to work in the core which can't load dynamic libraries.
+- my ($year, $month, $day) = (localtime($time))[5,4,3];
++ my ($year, $month, $day) = (gmtime($time))[5,4,3];
+ return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff b/poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
new file mode 100644
index 000000000..c8663f535
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
@@ -0,0 +1,154 @@
+From d9d535ef97f57af6e9728075944c33f3b0b5372f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Respect umask during installation
+
+This is needed to satisfy Debian policy regarding group-writable
+site directories.
+
+Patch-Name: fixes/respect_umask.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-Install/lib/ExtUtils/Install.pm | 18 +++++++++---------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++---------
+ 2 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+index 1e8ac4c..3e79121 100644
+--- a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
++++ b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+@@ -451,7 +451,7 @@ sub _can_write_dir {
+
+ =pod
+
+-=item _mkpath($dir,$show,$mode,$verbose,$dry_run)
++=item _mkpath($dir,$show,$verbose,$dry_run)
+
+ Wrapper around File::Path::mkpath() to handle errors.
+
+@@ -468,13 +468,13 @@ writable.
+ =cut
+
+ sub _mkpath {
+- my ($dir,$show,$mode,$verbose,$dry_run)=@_;
++ my ($dir,$show,$verbose,$dry_run)=@_;
+ if ( $verbose && $verbose > 1 && ! -d $dir) {
+ $show= 1;
+- printf "mkpath(%s,%d,%#o)\n", $dir, $show, $mode;
++ printf "mkpath(%s,%d)\n", $dir, $show;
+ }
+ if (!$dry_run) {
+- if ( ! eval { File::Path::mkpath($dir,$show,$mode); 1 } ) {
++ if ( ! eval { File::Path::mkpath($dir,$show); 1 } ) {
+ _choke("Can't create '$dir'","$@");
+ }
+
+@@ -783,7 +783,7 @@ sub install { #XXX OS-SPECIFIC
+ _chdir($cwd);
+ }
+ foreach my $targetdir (sort keys %check_dirs) {
+- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $targetdir, 0, $verbose, $dry_run );
+ }
+ foreach my $found (@found_files) {
+ my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime,
+@@ -797,7 +797,7 @@ sub install { #XXX OS-SPECIFIC
+ $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
+ unless $dry_run;
+ } elsif ( ! -d $targetdir ) {
+- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $targetdir, 0, $verbose, $dry_run );
+ }
+ print "Installing $targetfile\n";
+
+@@ -837,7 +837,7 @@ sub install { #XXX OS-SPECIFIC
+
+ if ($pack{'write'}) {
+ $dir = install_rooted_dir(dirname($pack{'write'}));
+- _mkpath( $dir, 0, 0755, $verbose, $dry_run );
++ _mkpath( $dir, 0, $verbose, $dry_run );
+ print "Writing $pack{'write'}\n" if $verbose;
+ $packlist->write(install_rooted_file($pack{'write'})) unless $dry_run;
+ }
+@@ -1180,7 +1180,7 @@ environment variable will silence this output.
+ sub pm_to_blib {
+ my($fromto,$autodir,$pm_filter) = @_;
+
+- _mkpath($autodir,0,0755);
++ _mkpath($autodir,0);
+ while(my($from, $to) = each %$fromto) {
+ if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
+ print "Skip $to (unchanged)\n" unless $INSTALL_QUIET;
+@@ -1203,7 +1203,7 @@ sub pm_to_blib {
+ # we wont try hard here. its too likely to mess things up.
+ forceunlink($to);
+ } else {
+- _mkpath(dirname($to),0,0755);
++ _mkpath(dirname($to),0);
+ }
+ if ($need_filtering) {
+ run_filter($pm_filter, $from, $to);
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..197f102 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2118,7 +2118,7 @@ doc__install : doc_site_install
+ $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
+
+ pure_perl_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+
+ push @m,
+@@ -2138,7 +2138,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+
+
+ pure_site_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2156,7 +2156,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ "}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{"
+
+ pure_vendor_install :: all
+- $(NOECHO) $(MOD_INSTALL) \
++ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2188,8 +2188,8 @@ doc_vendor_install :: all
+ push @m, q{
+ doc_perl_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLPRIVLIB) \
+ LINKTYPE "$(LINKTYPE)" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+
+ doc_site_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+@@ -2210,8 +2210,8 @@ doc_site_install :: all
+
+ doc_vendor_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
++ -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 022; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLVENDORLIB) \
+ LINKTYPE "$(LINKTYPE)" \
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff b/poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
new file mode 100644
index 000000000..7e1fd697c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
@@ -0,0 +1,28 @@
+From 26209b55201a1b2d25252ac3b425bc49081299de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Debian policy doesn't install .packlist files for core or vendor.
+
+Patch-Name: debian/instmodsh_doc.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/bin/instmodsh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+index 8b9aa95..e551434 100644
+--- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
++++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+@@ -18,9 +18,11 @@ instmodsh - A shell to examine installed modules
+
+ =head1 DESCRIPTION
+
+-A little interface to ExtUtils::Installed to examine installed modules,
++A little interface to ExtUtils::Installed to examine locally* installed modules,
+ validate your packlists and even create a tarball from an installed module.
+
++*On Debian system, B<core> and B<vendor> modules are managed by C<dpkg>.
++
+ =head1 SEE ALSO
+
+ ExtUtils::Installed
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff b/poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
new file mode 100644
index 000000000..ff0b2871f
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
@@ -0,0 +1,25 @@
+From 53ce69085918232a1b7e26e7762c1b2f70b1eb4a Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Remove standard libs from LD_RUN_PATH as per Debian policy.
+
+Patch-Name: debian/ld_run_path.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+index 37bcfd4..bd66e65 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -56,6 +56,9 @@ sub _unix_os2_ext {
+ my ( $pwd ) = cwd(); # from Cwd.pm
+ my ( $found ) = 0;
+
++ # Debian-specific: don't use LD_RUN_PATH for standard dirs
++ $ld_run_path_seen{$_}++ for @libpath;
++
+ foreach my $thislib ( split ' ', $potential_libs ) {
+ my ( $custom_name ) = '';
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff b/poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
new file mode 100644
index 000000000..d5347422d
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
@@ -0,0 +1,38 @@
+From a7f6d453e60256d329469a75b642cca854cebea1 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set location of libnet.cfg to /etc/perl/Net as /usr may not be
+ writable.
+
+Patch-Name: debian/libnet_config_path.diff
+Upstream-Status: Pending
+---
+ cpan/libnet/lib/Net/Config.pm | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/libnet/lib/Net/Config.pm b/cpan/libnet/lib/Net/Config.pm
+index 953a826..61ba12a 100644
+--- a/cpan/libnet/lib/Net/Config.pm
++++ b/cpan/libnet/lib/Net/Config.pm
+@@ -68,9 +68,8 @@ my %nc = (
+ TRY_INTERNET_CONFIG
+ }
+
+-my $file = __FILE__;
++my $file = '/etc/perl/Net/libnet.cfg';
+ my $ref;
+-$file =~ s/Config.pm/libnet.cfg/;
+ if (-f $file) {
+ $ref = eval { local $SIG{__DIE__}; do $file };
+ if (ref($ref) eq 'HASH') {
+@@ -142,8 +141,8 @@ Net::Config - Local configuration data for libnet
+ C<Net::Config> holds configuration data for the modules in the libnet
+ distribution. During installation you will be asked for these values.
+
+-The configuration data is held globally in a file in the perl installation
+-tree, but a user may override any of these values by providing their own. This
++The configuration data is held globally in C</etc/perl/Net/libnet.cfg>,
++but a user may override any of these values by providing their own. This
+ can be done by having a C<.libnetrc> file in their home directory. This file
+ should return a reference to a HASH containing the keys described below.
+ For example
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff b/poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
new file mode 100644
index 000000000..0cdc0d3e3
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
@@ -0,0 +1,27 @@
+From fb8bdbb4bf56382de099e62c2564286b9dfda46d Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Note that libperl-dev package is required for embedded linking
+
+Bug-Debian: http://bugs.debian.org/186778
+
+Patch-Name: debian/libperl_embed_doc.diff
+Upstream-Status: Pending
+---
+ lib/ExtUtils/Embed.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm
+index 3f983c1..0ec8a67 100644
+--- a/lib/ExtUtils/Embed.pm
++++ b/lib/ExtUtils/Embed.pm
+@@ -296,6 +296,9 @@ and extensions in your C/C++ applications.
+ Typically, an application F<Makefile> will invoke C<ExtUtils::Embed>
+ functions while building your application.
+
++Note that on Debian systems the B<libperl-dev> package is required for
++compiling applications which embed an interpreter.
++
+ =head1 @EXPORT
+
+ C<ExtUtils::Embed> exports the following functions:
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff b/poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
new file mode 100644
index 000000000..7cf1242c0
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
@@ -0,0 +1,53 @@
+From 289eaf87f8de4d9ebfd661d4e4299c2952435243 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 10 Apr 2015 10:19:51 +0300
+Subject: Make t/run/locale.t survive missing locales masked by LC_ALL
+
+If LC_ALL is set to a valid locale but another LC_* setting like LC_CTYPE
+isn't, t/run/locale.t would fail because it explicitly unsets LC_ALL,
+unmasking the problem underneath. All the other tests survive such
+a scenario.
+
+While this is clearly an error in the build environment, it's easy to make
+the test more robust by first clearing all the locale relevant variables.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=124310
+Bug-Debian: https://bugs.debian.org/782068
+Patch-Name: debian/locale-robustness.diff
+Upstream-Status: Pending
+---
+ t/run/locale.t | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/t/run/locale.t b/t/run/locale.t
+index bd1a034..2105339 100644
+--- a/t/run/locale.t
++++ b/t/run/locale.t
+@@ -27,6 +27,9 @@ my @locales = eval { find_locales( [ &LC_ALL, &LC_CTYPE, &LC_NUMERIC ],
+ ) };
+ skip_all("no locales available") unless @locales;
+
++# reset the locale environment
++local @ENV{'LANG', (grep /^LC_/, keys %ENV)};
++
+ plan tests => &last;
+
+ my $non_C_locale;
+@@ -58,9 +61,6 @@ EOF
+ SKIP: {
+ skip("Windows stores locale defaults in the registry", 1 )
+ if $^O eq 'MSWin32';
+- local $ENV{LC_NUMERIC}; # So not taken as a default
+- local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+- local $ENV{LANG}; # So not taken as a default
+ fresh_perl_is("for (qw(@locales)) {\n" . <<'EOF',
+ use POSIX qw(locale_h);
+ use locale;
+@@ -348,7 +348,6 @@ EOF
+
+ {
+ local $ENV{LC_NUMERIC} = $different;
+- local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+ fresh_perl_is(<<"EOF",
+ use POSIX qw(locale_h);
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff b/poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
new file mode 100644
index 000000000..5f0718089
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
@@ -0,0 +1,31 @@
+From 593dd52f535b1f439dfd0afe52211ae8960e980a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 24 Aug 2014 12:56:11 -0700
+Subject: Pass LD settings through to subdirectories
+
+[rt.cpan.org #28632] fixed most issues with passing LD down to
+subdirectory Makefile.PL files. However, there are some distributions
+(including Wx, Par::Packer, and Verilog-Perl) that explicitly set
+LD. Those still can't be overridden from the command line. Adding LD to
+the PASTHRU list fixes this.
+
+Bug-Debian: https://bugs.debian.org/758471
+Patch-Name: debian/makemaker-pasthru.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 4a8e14c..548d98e 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2793,7 +2793,7 @@ sub pasthru {
+ my($sep) = $Is{VMS} ? ',' : '';
+ $sep .= "\\\n\t";
+
+- foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
++ foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE LD
+ PREFIX INSTALL_BASE)
+ )
+ {
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff b/poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
new file mode 100644
index 000000000..d870b608c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
@@ -0,0 +1,43 @@
+From 634449066a9c810e81506425d2ca925b2fd72ab2 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 23 May 2015 21:15:06 +0200
+Subject: Update t/porting/customized.dat for files patched in Debian
+
+Patch-Name: debian/makemaker_customized.diff
+Upstream-Status: Pending
+---
+ t/porting/customized.dat | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 7df398d..f857bd2 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -1,7 +1,7 @@
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm 7f4dfd0fe884bd42412bcf04ca80ef97b39c1d54
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm bef099988b15fb0b2a1f5ac48c01af1f7f36d329
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8168e18f0e3ce3ece4bb7e7c72d57ec07c67c402
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 7115e97a53559cb3ec061dd6f7f344e522724c4a
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 3493ae6f93264e967f58dedaa3dbf3dbcb249853
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 3d7abd674b15ed323f743594ef0bd09db76b1aee
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm f8db8d4245bf0684b8210c811f50d7cfb1a27d78
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 757bffb47857521311f8f3bde43ebe165f8d5191
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Locale.pm 82be06851deb84c6419ad003ce9b6d1957f395f3
+@@ -13,7 +13,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm 58872d66
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm ab80029ab16d38d4f2e41dc88d2ceb9f3790e477
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm 453e0abbc4bb38db4c0820ad5c4846f313b66291
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm c1b1babda8f43ae7a2caba1cb4f70f92af5a0e34
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 6f90d94ad3e7aa0045a3b1a10a1bb18391f89f57
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 21bde53290bf1a4da4457290b65bd1b0ca6f1d16
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm cab2b3ce08b71a4ce89aa630f236eb08b852439d
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm 61fced0faf518bf87c265fcb51ed330ba354623f
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm ae0ef51a7b6dd0b05aa61c779df7167dda5f5119
+@@ -22,7 +22,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm 0544301f712
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm 433135eecb85b4b1d90d3027432f329436c78447
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm 1fbb5605bfb47feee4083feba8aa85e659628f70
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm 5b66d1f485a6034d96fc24ba1665b1bad9e447f1
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 8cef99a9bd370ecfd07ddb0efbdcbb4101255e45
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm c455c915fb7dc3eeb1200ed1cd19048e6f21e6b1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm 939572fde3d59ba77c2e677fe2df2bed4bed5898
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm 09c2049bfd25b735e2a5bcf56a6cff7b4827f9c8
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm d65d63f8217a55c36f62e249814988974f593c79
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff b/poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
new file mode 100644
index 000000000..7e2248403
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
@@ -0,0 +1,100 @@
+From 6c6cf14e204f3c031372bfd9604ad524d5691186 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Tweak @INC ordering for Debian
+
+Our order is:
+
+ etc (for config files)
+ site (5.8.1)
+ vendor (all)
+ core (5.8.1)
+ site (version-indep)
+ site (pre-5.8.1)
+
+The rationale being that an admin (via site), or module packager
+(vendor) can chose to shadow core modules when there is a newer
+version than is included in core.
+
+Patch-Name: debian/mod_paths.diff
+Upstream-Status: Pending
+---
+ perl.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 58 insertions(+)
+
+diff --git a/perl.c b/perl.c
+index 086645b..e64f1f4 100644
+--- a/perl.c
++++ b/perl.c
+@@ -4373,6 +4373,11 @@ S_init_perllib(pTHX)
+ INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ #endif
+
++#ifdef DEBIAN
++ /* for configuration where /usr is mounted ro (CPAN::Config, Net::Config) */
++ S_incpush_use_sep(aTHX_ STR_WITH_LEN("/etc/perl"), 0x0);
++#endif
++
+ #ifdef SITEARCH_EXP
+ /* sitearch is always relative to sitelib on Windows for
+ * DLL-based path intuition to work correctly */
+@@ -4490,6 +4495,59 @@ S_init_perllib(pTHX)
+ INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE);
+ #endif
+
++#ifdef DEBIAN
++ /* Non-versioned site directory for local modules and for
++ compatability with the previous packages' site dirs */
++ S_incpush_use_sep(aTHX_ STR_WITH_LEN("/usr/local/lib/site_perl"),
++ INCPUSH_ADD_SUB_DIRS);
++
++#ifdef PERL_INC_VERSION_LIST
++ {
++ struct stat s;
++
++ /* add small buffer in case old versions are longer than the
++ current version */
++ char sitearch[sizeof(SITEARCH_EXP)+16] = SITEARCH_EXP;
++ char sitelib[sizeof(SITELIB_EXP)+16] = SITELIB_EXP;
++ char const *vers[] = { PERL_INC_VERSION_LIST };
++ char const **p;
++
++ char *arch_vers = strrchr(sitearch, '/');
++ char *lib_vers = strrchr(sitelib, '/');
++
++ if (arch_vers && isdigit(*++arch_vers))
++ *arch_vers = 0;
++ else
++ arch_vers = 0;
++
++ if (lib_vers && isdigit(*++lib_vers))
++ *lib_vers = 0;
++ else
++ lib_vers = 0;
++
++ /* there is some duplication here as incpush does something
++ similar internally, but required as sitearch is not a
++ subdirectory of sitelib */
++ for (p = vers; *p; p++)
++ {
++ if (arch_vers)
++ {
++ strcpy(arch_vers, *p);
++ if (PerlLIO_stat(sitearch, &s) >= 0 && S_ISDIR(s.st_mode))
++ S_incpush_use_sep(aTHX_ sitearch, strlen(sitearch), 0x0);
++ }
++
++ if (lib_vers)
++ {
++ strcpy(lib_vers, *p);
++ if (PerlLIO_stat(sitelib, &s) >= 0 && S_ISDIR(s.st_mode))
++ S_incpush_use_sep(aTHX_ sitelib, strlen(sitelib), 0x0);
++ }
++ }
++ }
++#endif
++#endif
++
+ #ifdef PERL_OTHERLIBDIRS
+ S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_OTHERLIBDIRS),
+ INCPUSH_ADD_OLD_VERS|INCPUSH_ADD_ARCHONLY_SUB_DIRS
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff b/poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
new file mode 100644
index 000000000..7484bec41
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
@@ -0,0 +1,93 @@
+From 240f2f4aeb3850bc0c5370b9fbc3909573bed9b3 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Don't install .packlist or perllocal.pod for perl or vendor
+
+Patch-Name: debian/no_packlist_perllocal.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 +++----------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 570a631..391dc22 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+
+ push @m,
+-q{ read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+- push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ "$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ $(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+- push @m,
+-q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+
+ push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+
+ push @m, q{
+ doc_perl_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLPRIVLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ doc_site_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++ -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ -$(NOECHO) umask 02; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++ >> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+
+ doc_vendor_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLVENDORLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ } unless $self->{NO_PERLLOCAL};
+
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ $(NOECHO) $(NOOP)
+
+ uninstall_from_perldirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_sitedirs ::
+ $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_vendordirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+
+ join("",@m);
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff b/poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
new file mode 100644
index 000000000..2d05ae548
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
@@ -0,0 +1,31 @@
+From b517c5e15d0871e36d0f1187661fe1dd28ddf820 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 15 May 2011 19:35:58 +0300
+Subject: List packaged patches in patchlevel.h
+
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/567489
+
+The list of packaged patches is in patchlevel-debian.h, which is generated
+from the debian/patches/ directory when building the package.
+
+Patch-Name: debian/patchlevel.diff
+Upstream-Status: Pending
+---
+ patchlevel.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/patchlevel.h b/patchlevel.h
+index a0ad78b..01367b7 100644
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -137,6 +137,9 @@ static const char * const local_patches[] = {
+ ,"uncommitted-changes"
+ #endif
+ PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */
++#ifdef DEBIAN
++#include "patchlevel-debian.h"
++#endif
+ ,NULL
+ };
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch b/poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
new file mode 100644
index 000000000..6f1625bb1
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
@@ -0,0 +1,30 @@
+From c99c61e8f863a508a0793168011c98dc74abbd05 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 14 Apr 2012 11:34:05 +0100
+Subject: Invoke x-terminal-emulator rather than xterm in perl5db.pl
+
+In Debian systems, xterm might not exist or might not be the preferred
+terminal emulator. Use x-terminal-emulator instead
+
+Bug-Debian: http://bugs.debian.org/668490
+Forwarded: not-needed
+
+Patch-Name: debian/perl5db-x-terminal-emulator.patch
+Upstream-Status: Pending
+---
+ lib/perl5db.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/perl5db.pl b/lib/perl5db.pl
+index 7e7194e..c466bf3 100644
+--- a/lib/perl5db.pl
++++ b/lib/perl5db.pl
+@@ -6960,7 +6960,7 @@ properly set up.
+ sub xterm_get_fork_TTY {
+ ( my $name = $0 ) =~ s,^.*[/\\],,s;
+ open XT,
+-qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
++qq[3>&1 x-terminal-emulator -T "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
+ sleep 10000000' |];
+
+ # Get the output from 'tty' and clean it up a little.
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff b/poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
new file mode 100644
index 000000000..5c7413b96
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/perlivp.diff
@@ -0,0 +1,40 @@
+From fbfbeb7a690d703a3cdc56f923e89eb7b7997d31 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 9 Jan 2009 18:54:47 +0200
+Subject: Make perlivp skip include directories in /usr/local
+
+Bug-Debian: http://bugs.debian.org/510895
+
+On Sat, Jan 10, 2009 at 12:37:18AM +1100, Brendan O'Dea wrote:
+> On Wed, Jan 7, 2009 at 12:21 AM, Niko Tyni <ntyni@debian.org> wrote:
+
+> > We could create the directories in a postinst script, but I'm not sure
+> > I see the point. They will be created automatically when installing
+> > CPAN modules.
+>
+> The directories are intentionally not created, as this way they are
+> excluded from the search path at start-up, saving a bunch of wasted
+> stats at use/require time in the common case that the user has not
+> installed any local packages. As Niko points out, they will be
+> created as required.
+
+Signed-off-by: Niko Tyni <ntyni@debian.org>
+
+Patch-Name: debian/perlivp.diff
+Upstream-Status: Pending
+---
+ utils/perlivp.PL | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/perlivp.PL b/utils/perlivp.PL
+index c2f0a11..cc49f96 100644
+--- a/utils/perlivp.PL
++++ b/utils/perlivp.PL
+@@ -153,6 +153,7 @@ my $INC_total = 0;
+ my $INC_there = 0;
+ foreach (@INC) {
+ next if $_ eq '.'; # skip -d test here
++ next if m|/usr/local|; # not shipped on Debian
+ if (-d $_) {
+ print "## Perl \@INC directory '$_' exists.\n" if $opt{'v'};
+ $INC_there++;
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff b/poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
new file mode 100644
index 000000000..47075625c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
@@ -0,0 +1,24 @@
+From 27a4952c2e531947dc9f2f02e2063d117e2e699a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 18 Apr 2015 17:39:32 +0300
+Subject: Update porting/customized.dat for pod2man modifications
+
+Patch-Name: debian/pod2man-customized.diff
+Upstream-Status: Pending
+---
+ t/porting/customized.dat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 0eed9f7..7df398d 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -42,7 +42,7 @@ Win32API::File cpan/Win32API-File/Makefile.PL 605d0aee31aebe84a99408f9ab5f644db5
+ Win32API::File cpan/Win32API-File/t/file.t 124e64aa77e755235eb297644a87fac5388d3d78
+ Win32API::File cpan/Win32API-File/t/tie.t 712ea7edd0cc805ce1c0b8172c01b03dd19b583d
+ Win32API::File cpan/Win32API-File/typemap 24bff088babeadac0873e8df390d1666d9d9db4a
+-podlators cpan/podlators/scripts/pod2man.PL f81acf53f3ff46cdcc5ebdd661c5d13eb35d20d6
++podlators cpan/podlators/scripts/pod2man.PL 761f35d3fcf91c1bc2f9e024a9fa5c62fd3fc338
+ podlators cpan/podlators/scripts/pod2text.PL b4693fcfe4a0a1b38a215cfb8985a65d5d025d69
+ version cpan/version/lib/version.pm d0923b895d57f1d669ae36fcf85c87b16db341d1
+ version vutil.c 668f17ca43e2527645674d29ba772b86330d5663
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff b/poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
new file mode 100644
index 000000000..b681c3e89
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
@@ -0,0 +1,119 @@
+From 914948f026efce02cf0abff8b0312aaad96592ed Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Fiddle with *PREFIX and variables written to the makefile
+
+Fiddle with *PREFIX and variables written to the makefile so that
+install directories may be changed when make is run by passing
+PREFIX= to the "make install" command (used when packaging
+modules).
+
+Patch-Name: debian/prefix_changes.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm | 12 ++++++------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 3 +--
+ cpan/ExtUtils-MakeMaker/t/INST.t | 4 +---
+ cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t | 10 +++++-----
+ 4 files changed, 13 insertions(+), 16 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+index 4c00129..1ea2035 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+@@ -902,8 +902,6 @@ all POD files in MAN1PODS and MAN3PODS.
+ sub manifypods_target {
+ my($self) = shift;
+
+- my $man1pods = '';
+- my $man3pods = '';
+ my $dependencies = '';
+
+ # populate manXpods & dependencies:
+@@ -919,7 +917,7 @@ END
+ foreach my $section (qw(1 3)) {
+ my $pods = $self->{"MAN${section}PODS"};
+ my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : "";
+- \$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s
++ \$(NOECHO) \$(POD2MAN) --section=\$(MAN${section}EXT) --perm_rw=\$(PERM_RW)%s
+ CMD
+ push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
+ }
+@@ -1875,9 +1873,11 @@ sub init_INSTALL_from_PREFIX {
+ $self->{SITEPREFIX} ||= $sprefix;
+ $self->{VENDORPREFIX} ||= $vprefix;
+
+- # Lots of MM extension authors like to use $(PREFIX) so we
+- # put something sensible in there no matter what.
+- $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
++ my $p = $self->{PREFIX} = $self->{PERLPREFIX};
++ for my $t (qw/PERL SITE VENDOR/)
++ {
++ $self->{"${t}PREFIX"} =~ s!^\Q$p\E(?=/|$)!\$(PREFIX)!;
++ }
+ }
+
+ my $arch = $Config{archname};
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 391dc22..4a8e14c 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -3077,8 +3077,7 @@ sub prefixify {
+ warn " prefixify $var => $path\n" if $Verbose >= 2;
+ warn " from $sprefix to $rprefix\n" if $Verbose >= 2;
+
+- if( $self->{ARGS}{PREFIX} &&
+- $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
++ if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} )
+ {
+
+ warn " cannot prefix, using default.\n" if $Verbose >= 2;
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST.t b/cpan/ExtUtils-MakeMaker/t/INST.t
+index 91058bb..e399ced 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST.t
+@@ -65,9 +65,7 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+ is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
+ is( $mm->{VERSION}, 0.01, 'VERSION' );
+
+-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
+- $Config{prefixexp} || $Config{prefix};
+-is( $mm->{PERLPREFIX}, $config_prefix, 'PERLPREFIX' );
++is( $mm->{PERLPREFIX}, '$(PREFIX)', 'PERLPREFIX' );
+
+ is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+index e8de7c6..3fb3f12 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+@@ -10,7 +10,7 @@ BEGIN {
+ }
+
+ use strict;
+-use Test::More tests => 52;
++use Test::More tests => 47;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+ use ExtUtils::MakeMaker;
+@@ -62,16 +62,16 @@ like( $stdout->read, qr{
+ (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)?
+ }x );
+
+-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
++#is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
+
+ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+
+ is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
+ is( $mm->{VERSION}, 0.01, 'VERSION' );
+
+-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
+- unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
+-}
++#foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
++# unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
++#}
+
+
+ my $PREFIX = File::Spec->catdir('foo', 'bar');
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff b/poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
new file mode 100644
index 000000000..a2ed52ab2
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
@@ -0,0 +1,43 @@
+From c4538f966c49e356599358def7d1febf61bca21f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: [PATCH 15/49] Prune the list of libraries wanted to what we actually
+ need.
+
+Bug-Debian: http://bugs.debian.org/128355
+
+We want to keep the dependencies on perl-base as small as possible,
+and some of the original list may be present on buildds (see Bug#128355).
+
+Patch-Name: debian/prune_libs.diff
+Upstream-Status: Pending
+---
+ Configure | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Configure b/Configure
+index 5a353d6..a00df64 100755
+--- a/Configure
++++ b/Configure
+@@ -1479,8 +1479,7 @@ archname=''
+ usereentrant='undef'
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
+-libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
++libswanted='gdbm gdbm_compat db dl m c crypt'
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+@@ -24007,7 +24006,7 @@ sunos*X4*)
+ ;;
+ *) case "$usedl" in
+ $define|true|[yY]*)
+- set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
++ set X `echo " $libs " | sed -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldb @ @'`
+ shift
+ perllibs="$*"
+ ;;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff b/poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
new file mode 100644
index 000000000..5d9a7c4b4
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
@@ -0,0 +1,28 @@
+From cb3e98e17a666896150b109694e9eb9278620845 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 17 May 2014 14:57:01 +0300
+Subject: Skip a regeneration check in unrelated git repositories
+
+If the test is run in a git repository without lib/.gitignore,
+for instance because the repository only imported the Perl tarball,
+the regeneration check is broken because lib/.gitignore is missing.
+
+Patch-Name: debian/regen-skip.diff
+Upstream-Status: Pending
+---
+ regen/lib_cleanup.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl
+index c9d6e43..fece1ed 100644
+--- a/regen/lib_cleanup.pl
++++ b/regen/lib_cleanup.pl
+@@ -159,7 +159,7 @@ foreach ('win32/Makefile', 'win32/makefile.mk') {
+ }
+
+ # This must come last as it can exit early:
+-if ($TAP && !-d '.git' && !-f 'lib/.gitignore') {
++if ($TAP && !-d '.git' || !-f 'lib/.gitignore') {
+ print "ok # skip not being run from a git checkout, hence no lib/.gitignore\n";
+ exit 0;
+ }
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff b/poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
new file mode 100644
index 000000000..3b3745238
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
@@ -0,0 +1,41 @@
+From 42853af65a28066b119d23d96e964e94b55a8541 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 5 Aug 2011 10:50:18 +0300
+Subject: Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
+
+Bug: http://rt.perl.org/rt3/Ticket/Display.html?id=96272
+Bug-Debian: http://bugs.debian.org/628493
+
+The crash is not a regression in 5.14, it just gets triggered there by
+a new unrelated test case.
+
+Skip the test until the culprit is found.
+
+Patch-Name: debian/skip-kfreebsd-crash.diff
+Upstream-Status: Pending
+---
+ t/op/threads.t | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/t/op/threads.t b/t/op/threads.t
+index e76c956..bec210b 100644
+--- a/t/op/threads.t
++++ b/t/op/threads.t
+@@ -376,6 +376,9 @@ EOF
+ }
+
+
++SKIP: {
++ skip "[perl #96272] avoid crash on GNU/kFreeBSD", 1
++ if $^O eq 'gnukfreebsd';
+ # [perl #78494] Pipes shared between threads block when closed
+ {
+ my $perl = which_perl;
+@@ -384,6 +387,7 @@ EOF
+ threads->create(sub { })->join;
+ ok(1, "Pipes shared between threads do not block when closed");
+ }
++}
+
+ # [perl #105208] Typeglob clones should not be cloned again during a join
+ {
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff b/poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
new file mode 100644
index 000000000..279f4ab76
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
@@ -0,0 +1,29 @@
+From ae9b645d6da2990fd055368eca2c67c449474e38 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 22 Apr 2011 11:15:32 +0300
+Subject: Skip tests specific to the upstream Git repository
+
+These tests fail if run from a different git repository than
+upstream. This complicates things needlessly for downstream packagers.
+
+Skip the tests altogether even if the .git directory exists.
+
+Patch-Name: debian/skip-upstream-git-tests.diff
+Upstream-Status: Pending
+---
+ t/test.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/test.pl b/t/test.pl
+index cda3840..af579a2 100644
+--- a/t/test.pl
++++ b/t/test.pl
+@@ -174,7 +174,7 @@ sub skip_all_without_unicode_tables { # (but only under miniperl)
+
+ sub find_git_or_skip {
+ my ($source_dir, $reason);
+- if (-d '.git') {
++ if (-d '.git' && ! -d 'debian') {
+ $source_dir = '.';
+ } elsif (-l 'MANIFEST' && -l 'AUTHORS') {
+ my $where = readlink 'MANIFEST';
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff b/poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
new file mode 100644
index 000000000..4964e480c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
@@ -0,0 +1,57 @@
+From 487a6d6ada0b08e6a7276520ebc61cd851005e7c Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 3 Oct 2010 21:36:17 +0300
+Subject: Squelch locale warnings in Debian package maintainer scripts
+
+Bug-Debian: http://bugs.debian.org/508764
+
+The system locales are rather frequently out of sync with the C library
+during package upgrades, causing a huge amount of useless Perl locale
+warnings. Squelch them when running package maintainer scripts, detected
+by the DPKG_RUNNING_VERSION environment variable.
+
+Any real locale problem will show up after the system upgrade too, and
+the warning will be triggered normally again at that point.
+
+Patch-Name: debian/squelch-locale-warnings.diff
+Upstream-Status: Pending
+---
+ locale.c | 5 ++++-
+ pod/perllocale.pod | 8 ++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/locale.c b/locale.c
+index 7a4a418..fdf911d 100644
+--- a/locale.c
++++ b/locale.c
+@@ -674,7 +674,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
+
+ const bool locwarn = (printwarn > 1
+ || (printwarn
+- && (! bad_lang_use_once
++ &&
++ /* Debian specific change - see http://bugs.debian.org/508764 */
++ (!PerlEnv_getenv("DPKG_RUNNING_VERSION")) &&
++ (! bad_lang_use_once
+ || (
+ /* disallow with "" or "0" */
+ *bad_lang_use_once
+diff --git a/pod/perllocale.pod b/pod/perllocale.pod
+index 701b422..58cabaf 100644
+--- a/pod/perllocale.pod
++++ b/pod/perllocale.pod
+@@ -1217,6 +1217,14 @@ B<NOTE>: C<PERL_BADLANG> only gives you a way to hide the warning message.
+ The message tells about some problem in your system's locale support,
+ and you should investigate what the problem is.
+
++=item DPKG_RUNNING_VERSION
++
++On Debian systems, if the DPKG_RUNNING_VERSION environment variable is
++set (to any value), the locale failure warnings will be suppressed just
++like with a zero PERL_BADLANG setting. This is done to avoid floods
++of spurious warnings during system upgrades.
++See L<http://bugs.debian.org/508764>.
++
+ =back
+
+ The following environment variables are not specific to Perl: They are
diff --git a/poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff b/poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
new file mode 100644
index 000000000..ab373b333
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
@@ -0,0 +1,37 @@
+From 591c1f9b7d4755bfc59d9665bab1f2ca410de765 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set umask approproately for site install directories
+
+Policy requires group writable site directories
+
+Patch-Name: debian/writable_site_dirs.diff
+Upstream-Status: Pending
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 197f102..5f1b87f 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2138,7 +2138,7 @@ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+
+
+ pure_site_install :: all
+- $(NOECHO) umask 022; $(MOD_INSTALL) \
++ $(NOECHO) umask 02; $(MOD_INSTALL) \
+ };
+ push @m,
+ q{ read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+
+ doc_site_install :: all
+ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) umask 022; $(DOC_INSTALL) \
++ -$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ -$(NOECHO) umask 02; $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
diff --git a/poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch b/poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
new file mode 100644
index 000000000..719f07c9c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
@@ -0,0 +1,35 @@
+From 2e0ce5d27e70defd66ace0661af7c24daae34f8b Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Sat, 19 Jan 2013 23:49:24 +0000
+Subject: [PATCH 7/8] perl: Add dyanloader build hack
+
+Hack the dynamic module loader so that we use native modules since we can't load
+the target ones.
+
+Upstream-Status: Inappropriate
+
+RP
+2013/01/13
+
+---
+ ext/DynaLoader/DynaLoader_pm.PL | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
+index e828f35..4021559 100644
+--- a/ext/DynaLoader/DynaLoader_pm.PL
++++ b/ext/DynaLoader/DynaLoader_pm.PL
+@@ -343,6 +343,10 @@ sub bootstrap {
+ foreach (@INC) {
+ <<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
+ $dir = "$_/auto/$modpname";
++
++ if (defined $ENV{PERL_LIB} and defined $ENV{PERLHOSTLIB}) {
++ $dir =~ s/$ENV{PERL_LIB}/$ENV{PERLHOSTLIB}/g;
++ }
+
+ next unless -d $dir; # skip over uninteresting directories
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch b/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
new file mode 100644
index 000000000..994ef7013
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
@@ -0,0 +1,35 @@
+From ba4ed0b5b7baad5353c1e65b655f41d45e01c990 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:00:11 -0700
+Subject: [PATCH] ext/ODBM_File/hints/linux.pl: link libgdbm_compat
+
+Fixed for test case ../ext/ODBM_File/t/odbm.t:
+ok 1 - use ODBM_File;
+ok 2 - use Fcntl;
+./perl: symbol lookup error: /usr/lib/perl/5.22.0/auto/ODBM_File/ODBM_File.so: undefined symbol: dbminit
+
+The checking "if -e $_.'/libgdbm_compat.so'" doesn't work when cross
+build, so always link libgdbm_compat, since perl depends on gdbm and we
+always have libgdbm_compat.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ext/ODBM_File/hints/linux.pl | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/ext/ODBM_File/hints/linux.pl b/ext/ODBM_File/hints/linux.pl
+index 204bba0..9271b45 100644
+--- a/ext/ODBM_File/hints/linux.pl
++++ b/ext/ODBM_File/hints/linux.pl
+@@ -1,8 +1,2 @@
+ # uses GDBM dbm compatibility feature - at least on SuSE 8.0
+-$self->{LIBS} = ['-lgdbm'];
+-
+-# Debian/Ubuntu have libgdbm_compat.so but not this file,
+-# so linking may fail
+-foreach (split / /, $Config{libpth}) {
+- $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so';
+-}
++$self->{LIBS} = ['-lgdbm -lgdbm_compat'];
diff --git a/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch b/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
new file mode 100644
index 000000000..b85b50cea
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
@@ -0,0 +1,33 @@
+From b842e1de7798a1f7df770bb3f185ad3356e490e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:06:56 -0700
+Subject: [PATCH] ext/ODBM_File/t/odbm.t: fix the path of dbmt_common.pl
+
+It should be lib/dbmt_common.pl when run by run-ptest.
+
+Fixed:
+Can't locate ../../t/lib/dbmt_common.pl in @INC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ ext/ODBM_File/t/odbm.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/ODBM_File/t/odbm.t b/ext/ODBM_File/t/odbm.t
+index 079b9f1..250b991 100644
+--- a/ext/ODBM_File/t/odbm.t
++++ b/ext/ODBM_File/t/odbm.t
+@@ -2,7 +2,7 @@
+
+ our $DBM_Class = 'ODBM_File';
+
+-require '../../t/lib/dbmt_common.pl';
++require 'lib/dbmt_common.pl';
+
+ if ($^O eq 'hpux') {
+ print <<EOM;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch b/poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
new file mode 100644
index 000000000..49efcbeef
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
@@ -0,0 +1,24 @@
+Upstream-Status:Inappropriate [embedded specific]
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/07/01
+
+Fix these Package QA warnings before they are converted into fetal errors:
+
+WARNING: QA Issue: package perl-module-compress contains bad RPATH /build_disk/poky_build/build0/tmp/sysroots/qemux86/usr/lib in file /build_disk/poky_build/build0/tmp/work/i586-poky-linux/perl-5.12.3-r1/packages-split/perl-module-compress/usr/lib/perl/5.12.3/auto/Compress/Raw/Zlib/Zlib.so
+
+This fixes this warning for perl recipe as well as libxml-parser-perl recipe.
+It is a fix to MakeMaker within perl, so all such perl recipes will get
+fixed with this perl fix.
+
+Index: perl-5.24.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+===================================================================
+--- perl-5.24.1.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ perl-5.24.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -57,6 +57,7 @@ sub _unix_os2_ext {
+ my ( $found ) = 0;
+
+ # Debian-specific: don't use LD_RUN_PATH for standard dirs
++ push(@libpath, "SYSROOTLIB");
+ $ld_run_path_seen{$_}++ for @libpath;
+
+ foreach my $thislib ( split ' ', $potential_libs ) {
diff --git a/poky/meta/recipes-devtools/perl/perl/generate-sh.patch b/poky/meta/recipes-devtools/perl/perl/generate-sh.patch
new file mode 100644
index 000000000..27f6e691c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/generate-sh.patch
@@ -0,0 +1,56 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Use the ld flags from the supplied configuration file. For sh we need the
+flags that specify to build PIC code so that the shared libraries work.
+
+Index: perl-5.14.2/Cross/generate_config_sh
+===================================================================
+--- perl-5.14.2.orig/Cross/generate_config_sh 2010-12-30 04:07:14.000000000 +0200
++++ perl-5.14.2/Cross/generate_config_sh 2012-11-22 15:58:49.852852805 +0200
+@@ -19,10 +19,10 @@
+ $callbacks->{'ar'} = [\&simple_process, ["AR", "arm-linux-ar"]];
+ $callbacks->{'archname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+ $callbacks->{'cc'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+-$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccflags'} = [\&simple_process, ["CFLAGS", "-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+-$callbacks->{'ccflags_uselargefiles'} = [\&simple_process, ["CFLAGS", "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++#$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++#$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++$callbacks->{'ccflags'} = [\&simple_process_insert, ["CFLAGS", "-fno-strict-aliasing -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++$callbacks->{'ccflags_uselargefiles'} = [\&simple_process_insert, ["CFLAGS", "-D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+ $callbacks->{'ccname'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+ $callbacks->{'cpp'} = [\&simple_process, ["CCP", "arm-linux-cpp"]];
+ $callbacks->{'cppflags'} = [\&simple_process, ["CCPFLAGS", "-fno-strict-aliasing"]];
+@@ -30,6 +30,7 @@
+ $callbacks->{'cppstdin'} = [\&simple_process_append, ["CC", "arm-linux-gcc -E", "-E"]];
+ $callbacks->{'full_ar'} = [\&backtick, ["AR", "which $ENV{AR}", "/usr/local/arm/2.95.3/bin/arm-linux-ar"]];
+ $callbacks->{'ld'} = [\&simple_process, ["LD", "arm-linux-ld"]];
++$callbacks->{'lddlflags'} = [\&simple_process, ["LDDLFLAGS", ""]];
+ $callbacks->{'ldflags'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'ldflags_uselargefiles'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'myarchname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+@@ -105,6 +106,23 @@
+
+ }
+
++# Insert env var into the variables value
++sub simple_process_insert {
++ my $key = shift;
++ my $value = shift;
++ my $envvar = $callbacks->{$key}->[1][0];
++
++ if ($ENV{$envvar}) {
++ # Strip quotes from value
++ $value =~ s/^\'//;
++ $value =~ s/\'$//;
++ # Remove -I/usr/local/... from the value
++ $value =~ s#\W-I/usr/local/\w+\W# #g;
++ # Prepend env var (OE setting) to value
++ print("$key=\'$ENV{$envvar} $value\'\n");
++ }
++}
++
+ sub library_munge {
+ my $key = shift;
+ my $value = shift;
diff --git a/poky/meta/recipes-devtools/perl/perl/installperl.patch b/poky/meta/recipes-devtools/perl/perl/installperl.patch
new file mode 100644
index 000000000..7fd1f5014
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/installperl.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.24.1/installperl
+===================================================================
+--- perl-5.24.1.orig/installperl
++++ perl-5.24.1/installperl
+@@ -2,8 +2,8 @@
+
+ BEGIN {
+ chdir '..' if !-d 'lib' and -d '../lib';
+- @INC = 'lib';
+- $ENV{PERL5LIB} = 'lib';
++# @INC = 'lib';
++# $ENV{PERL5LIB} = 'lib';
+
+ # This needs to be at BEGIN time, before any use of Config
+ # install_lib itself loads and imports Config into main::
diff --git a/poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch b/poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
new file mode 100644
index 000000000..5161e4c8b
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
@@ -0,0 +1,46 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+This removes all the logic that perl uses to locate an appropriate
+errno.h for the target. Instead we simple create a file that does
+
+ #include "errno.h"
+
+and use that as the file to parse. This is needed when using an
+external toolchain since perl will search in ${STAGING_INCDIR} for
+errno.h (when using gcc) and that isn't where it's located - its
+wherever the external toolchain keeps it's headers.
+
+Index: perl-5.12.3/ext/Errno/Errno_pm.PL
+===================================================================
+--- perl-5.12.3.orig/ext/Errno/Errno_pm.PL
++++ perl-5.12.3/ext/Errno/Errno_pm.PL
+@@ -17,8 +17,18 @@ unlink "Errno.tmp" if -f "Errno.tmp";
+ open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!";
+ select OUT;
+ my $file;
+-my @files = get_files();
+-if ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
++#my @files = get_files();
++my @files = ("errno.h");
++
++if (1) {
++ open INCS, '>includes.c' or
++ die "Cannot open includes.c";
++ print INCS qq[#include "errno.h"\n];
++ close INCS;
++ process_file('includes.c');
++ unlink 'includes.c';
++}
++elsif ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
+ # MinGW complains "warning: #pragma system_header ignored outside include
+ # file" if the header files are processed individually, so include them
+ # all in .c file and process that instead.
+@@ -53,7 +63,7 @@ sub process_file {
+ chomp($file = `cygpath -w "$file"`);
+ }
+
+- return unless defined $file and -f $file;
++# return unless defined $file and -f $file;
+ # warn "Processing $file\n";
+
+ local *FH;
diff --git a/poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch b/poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
new file mode 100644
index 000000000..b2c597974
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
@@ -0,0 +1,27 @@
+make_ext.pl: fix regenerate makefile failed while $cc changed
+
+While $cc changed, the existance of 'xdefine' caused makefile
+regeneration failed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ make_ext.pl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: perl-5.24.1/make_ext.pl
+===================================================================
+--- perl-5.24.1.orig/make_ext.pl
++++ perl-5.24.1/make_ext.pl
+@@ -335,6 +335,10 @@ sub build_extension {
+ print "Deleting non-Cross makefile\n";
+ close $mfh or die "close $makefile: $!";
+ _unlink($makefile);
++ if(-e 'xdefine') {
++ print "Deleting xdefine for regenerate makefile\n";
++ _unlink('xdefine');
++ }
+ }
+ }
+ } else {
diff --git a/poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch b/poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch
new file mode 100644
index 000000000..5482dcb79
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/native-nopacklist.patch
@@ -0,0 +1,91 @@
+Upstream-Status:Inappropriate [debian patch]
+
+Part of 52_debian_extutils_hacks.patch just to exclude the installation of .packlist files
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 ++---------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..a589710 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+
+ push @m,
+-q{ read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+- push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ "$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ "$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{ "$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ $(NOECHO) $(MOD_INSTALL) \
+ };
+- push @m,
+-q{ read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+- write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+
+ push @m,
+ q{ "$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+
+ push @m, q{
+ doc_perl_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLPRIVLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ doc_site_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
++ $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++ -$(NOECHO) $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ -$(NOECHO) $(DOC_INSTALL) \
+ "Module" "$(NAME)" \
+ "installed into" $(INSTALLSITELIB) \
+ LINKTYPE "$(LINKTYPE)" \
+ VERSION "$(VERSION)" \
+ EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++ >> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+
+ doc_vendor_install :: all
+- $(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+- -$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+- -$(NOECHO) $(DOC_INSTALL) \
+- "Module" "$(NAME)" \
+- "installed into" $(INSTALLVENDORLIB) \
+- LINKTYPE "$(LINKTYPE)" \
+- VERSION "$(VERSION)" \
+- EXE_FILES "$(EXE_FILES)" \
+- >> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+
+ } unless $self->{NO_PERLLOCAL};
+
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ $(NOECHO) $(NOOP)
+
+ uninstall_from_perldirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_sitedirs ::
+ $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+
+ uninstall_from_vendordirs ::
+- $(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+
+ join("",@m);
diff --git a/poky/meta/recipes-devtools/perl/perl/native-perlinc.patch b/poky/meta/recipes-devtools/perl/perl/native-perlinc.patch
new file mode 100644
index 000000000..f0bb1f659
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/native-perlinc.patch
@@ -0,0 +1,26 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/lib/ExtUtils/MM_Unix.pm
+===================================================================
+--- perl-5.12.3.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2008-10-31 22:01:35.000000000 +0000
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 2008-10-31 22:01:35.000000000 +0000
+@@ -1597,6 +1597,19 @@
+ $self->{PERL_LIB} ||= $Config{privlibexp};
+ $self->{PERL_ARCHLIB} ||= $Config{archlibexp};
+ $self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
++ # Check for environment override so we'll find the headers in the correct place
++ if (defined $ENV{PERL_LIB})
++ {
++ $self->{PERL_LIB} = $ENV{PERL_LIB};
++ }
++ if (defined $ENV{PERL_ARCHLIB})
++ {
++ $self->{PERL_ARCHLIB} = $ENV{PERL_ARCHLIB};
++ }
++ if (defined $ENV{PERL_INC})
++ {
++ $self->{PERL_INC} = $ENV{PERL_INC};
++ }
+ my $perl_h;
+
+ if (not -f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-5.26.1-guard_old_libcrypt_fix.patch b/poky/meta/recipes-devtools/perl/perl/perl-5.26.1-guard_old_libcrypt_fix.patch
new file mode 100644
index 000000000..ff3d6dc09
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-5.26.1-guard_old_libcrypt_fix.patch
@@ -0,0 +1,28 @@
+commit 13e70b397dcb0d1bf4a869b670f041c1d7b730d0
+Author: Bjรถrn Esser <besser82@fedoraproject.org>
+Date: Sat Jan 20 20:22:53 2018 +0100
+
+ pp: Guard fix for really old bug in glibc libcrypt
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+diff --git a/pp.c b/pp.c
+index d50ad7ddbf..6510c7b15c 100644
+--- a/pp.c
++++ b/pp.c
+@@ -3650,8 +3650,12 @@ PP(pp_crypt)
+ #if defined(__GLIBC__) || defined(__EMX__)
+ if (PL_reentrant_buffer->_crypt_struct_buffer) {
+ PL_reentrant_buffer->_crypt_struct_buffer->initialized = 0;
+- /* work around glibc-2.2.5 bug */
++#if (defined(__GLIBC__) && __GLIBC__ == 2) && \
++ (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4)
++ /* work around glibc-2.2.5 bug, has been fixed at some
++ * time in glibc-2.3.X */
+ PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0;
++#endif
+ }
+ #endif
+ }
+
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch b/poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
new file mode 100644
index 000000000..7dd904140
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
@@ -0,0 +1,33 @@
+From 90c252cecc38aed5d5faedb30485dd6eee2e54eb Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Wed, 11 Feb 2015 15:14:40 +0800
+Subject: [PATCH] perl / PathTools: don't filter out blib from @INC
+
+If $TOPDIR includes the string "blib", filter it out from @INC may empty
+the @INC and cause build errors like:
+
+ Can't locate ExtUtils/MakeMaker.pm in @INC \
+ (you may need to install the ExtUtils::MakeMaker module) \
+ (@INC contains: .) at Makefile.PL
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ dist/PathTools/Makefile.PL | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/dist/PathTools/Makefile.PL b/dist/PathTools/Makefile.PL
+index 1b21de4..f562cb2 100644
+--- a/dist/PathTools/Makefile.PL
++++ b/dist/PathTools/Makefile.PL
+@@ -1,6 +1,3 @@
+-
+-BEGIN { @INC = grep {!/blib/} @INC }
+-
+ require 5.005;
+ use ExtUtils::MakeMaker;
+ WriteMakefile
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch b/poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
new file mode 100644
index 000000000..37bf52335
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
@@ -0,0 +1,40 @@
+perl: add archlib_exp variable used to generate ARCHLIB_EXP in config.h
+
+perl.c uses an ARCHLIB_EXP define to generate compile-time code that
+adds the archlibexp path to @INC during run-time initialization of a
+new perl interpreter.
+
+Because we've changed this value in a temporary way to make it
+possible to use ExtUtils::Embed in the target build (the temporary
+value in config.sh gets re-stripped out during packaging), the
+ARCHLIB_EXP value that gets generated still uses the temporary version
+instead of the original expected version (i.e. becauses it's in the
+generated config.h, it doesn't get stripped out during packaging like
+the others in config.sh).
+
+This creates an unmodified version called archlib_exp that gets used
+by a modified config_h.SH to get the correct value into config.h
+
+This patch uses an unmodified version of archlibexp called
+archlib_exp, introduced to config.sh, which is used to generate the
+correct value of ARCHLIB_EXP into config.h
+
+See YOCTO #3099 for more info.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: perl-5.24.1/config_h.SH
+===================================================================
+--- perl-5.24.1.orig/config_h.SH
++++ perl-5.24.1/config_h.SH
+@@ -1434,7 +1434,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+ * in programs that are not prepared to deal with ~ expansion at run-time.
+ */
+ #$d_archlib ARCHLIB "$archlib" /**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp" /**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp" /**/
+
+ /* BIN:
+ * This symbol holds the path of the bin directory where the package will
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch b/poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
new file mode 100644
index 000000000..c6cc15c93
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
@@ -0,0 +1,47 @@
+Upstream-Status:Inappropriate [native]
+
+This patch is used for perl-native only. It enables the switching of
+configuration files between Config_heavy.pl and
+Config_heavy-target.pl by setting the environment variables
+PERLCONFIGTARGET - the later containing settings for the target while
+the former contains those for the host. This will allow cpan.bbclass
+to use the settings appropriate for the native and/or target builds
+as required. This also disables the use of the cache since the cached
+values would be valid for the host only.
+
+Index: perl-5.14.2/configpm
+===================================================================
+--- perl-5.14.2.orig/configpm
++++ perl-5.14.2/configpm
+@@ -658,7 +658,7 @@ sub FETCH {
+ my($self, $key) = @_;
+
+ # check for cached value (which may be undef so we use exists not defined)
+- return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
++ return $self->fetch_string($key);
+ }
+
+ ENDOFEND
+@@ -816,7 +816,21 @@ $config_txt .= sprintf <<'ENDOFTIE', $fa
+ sub DESTROY { }
+
+ sub AUTOLOAD {
+- require 'Config_heavy.pl';
++ my $cfgfile = 'Config_heavy.pl';
++ if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++ {
++ $cfgfile = 'Config_heavy-target.pl';
++ }
++ if (defined $ENV{PERL_ARCHLIB})
++ {
++ push @INC, $ENV{PERL_ARCHLIB};
++ require $cfgfile;
++ pop @INC;
++ }
++ else
++ {
++ require $cfgfile;
++ }
+ goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
+ die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
+ }
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-configure.sh b/poky/meta/recipes-devtools/perl/perl/perl-configure.sh
new file mode 100755
index 000000000..25e7f8b96
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-configure.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+#
+# Generate the common perl configuration
+# Needs to be run on a host that matches the bitsize of the target platform
+#
+
+echo sh Configure -des \
+ -Doptimize=-O2 \
+ -Dmyhostname=localhost \
+ -Dperladmin=root@localhost \
+ -Dcc=gcc \
+ -Dcf_by='Open Embedded' \
+ -Dinstallprefix=@DESTDIR@ \
+ -Dprefix=/usr \
+ -Dvendorprefix=/usr \
+ -Dsiteprefix=/usr \
+ -Dotherlibdirs=/usr/lib/perl5/5.22.1 \
+ -Duseshrplib \
+ -Dusethreads \
+ -Duseithreads \
+ -Duselargefiles \
+ -Ud_dosuid \
+ -Dd_semctl_semun \
+ -Ui_db \
+ -Ui_ndbm \
+ -Ui_gdbm \
+ -Di_shadow \
+ -Di_syslog \
+ -Dman3ext=3pm \
+ -Duseperlio \
+ -Dinstallusrbinperl \
+ -Ubincompat5005 \
+ -Uversiononly \
+ -Dpager='/usr/bin/less -isr'
+
+cp -f config.sh config.sh.COMMON
+
+TARGETOS=$(grep myarchname config.sh.COMMON | sed "s#.*'\(.*\)'.*#\1#")
+
+sed -r -i config.sh.COMMON \
+ -e "s#(install.*=')(/usr)/local(.*')#\1@DESTDIR@\2\3#g" \
+ -e 's#'$TARGETOS'#@ARCH@#g'
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch b/poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch
new file mode 100644
index 000000000..2572067a6
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-dynloader.patch
@@ -0,0 +1,34 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Allow the location that .so files are searched for for dynamic
+loading to be changed via an environment variable. This is to allow
+us to load .so's from the host system while building for the target
+system.
+
+Update by Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/21
+
+Index: perl-5.24.1/dist/XSLoader/XSLoader_pm.PL
+===================================================================
+--- perl-5.24.1.orig/dist/XSLoader/XSLoader_pm.PL
++++ perl-5.24.1/dist/XSLoader/XSLoader_pm.PL
+@@ -52,6 +52,20 @@ sub load {
+ my ($caller, $modlibname) = caller();
+ my $module = $caller;
+
++ # OE: Allow env to form dynamic loader to look in a different place
++ # This is so it finds the host .so files, not the targets
++ if (defined $ENV{PERLHOSTLIB})
++ {
++ my $hostlib = $ENV{PERLHOSTLIB};
++ print STDERR "*** Module name IN: $modlibname\n";
++ ($p1, $p2, $p3, $p4, $p5) = $modlibname =~ m/(^(.*lib\w*\/)?)((perl\/[0-9\.]*\/)?)(.*)$/;
++ print STDERR "*** p1: $p1 p3: $p3 p5: $p5\n";
++ if ( $p1 ne "" ) {
++ $modlibname = $hostlib.$p5;
++ }
++ print STDERR "*** Module name OUT: $modlibname\n";
++ }
++
+ if (@_) {
+ $module = $_[0];
+ } else {
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch b/poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch
new file mode 100644
index 000000000..7379d8b81
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-errno-generation-gcc5.patch
@@ -0,0 +1,37 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+The upstream code assumes that the compiler version used to compiler miniperl/perl-native
+is the same as the one being used to build the perl binary. Since most people are not running
+systems with gcc 5, it is unlikely that it will work on any supported host. Switch out gccversion
+for the version extracted from $CC --version.
+
+Jeremy Puhlman <jpuhlman@mvista.com>
+
+Fix spaces in brackets while running $CC --version
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ext/Errno/Errno_pm.PL | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index 1fd29d0..7976ea2 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -224,9 +224,13 @@ sub write_errno_pm {
+
+ { # BeOS (support now removed) did not enter this block
+ # invoke CPP and read the output
++ my $compiler = $ENV{'CC'};
++ my $compiler_out = `$compiler --version`;
++ $compiler_out =~ s/\(.*\)/;/;
++ my @compiler_version = split / /,$compiler_out;
+
+ my $inhibit_linemarkers = '';
+- if ($Config{gccversion} =~ /\A(\d+)\./ and $1 >= 5) {
++ if (@compiler_version[2] =~ /\A(\d+)\./ and $1 >= 5) {
+ # GCC 5.0 interleaves expanded macros with line numbers breaking
+ # each line into multiple lines. RT#123784
+ $inhibit_linemarkers = ' -P';
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-fix-conflict-between-skip_all-and-END.patch b/poky/meta/recipes-devtools/perl/perl/perl-fix-conflict-between-skip_all-and-END.patch
new file mode 100644
index 000000000..de946dbec
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-fix-conflict-between-skip_all-and-END.patch
@@ -0,0 +1,181 @@
+Some Perl tests fail when run on a cross-compiled target machine. Apply
+a slightly tweaked upstream patch to fix the problems. Notes:
+ 1. as of 2 Jun 2016, the original patch has been applied to the current
+ EUMM releases, but has not made it into perl core yet.
+ 2. when the base perl package is upgraded in Yocto, this patch may need
+ to be replaced by the original upstream version to correctly apply
+ to the current version of ExtUtils-MakeMaker at that time.
+
+[YOCTO #8656]
+
+Upstream-Status: Backport
+
+Signed-off-by: Bill Randle <william.c.randle@intel.com>
+
+From 4a07a3bd18363986112cf2b39dec3c2985353ffb Mon Sep 17 00:00:00 2001
+From: Francois Perrad <francois.perrad@gadz.org>
+Date: Mon, 22 Dec 2014 19:04:34 +0100
+Subject: [PATCH] fix conflict between skip_all and END section
+
+since the commit 430de781809a6be3bcd25a349dc40ce54405ab53
+the test suite fails in cross-compil environment (perl-5.21.6 & perl-5.21.7)
+like this :
+
+ $ ./perl harness -v ../cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t
+ ../cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t ..
+ 1..0 # SKIP cross-compiling and make not available
+ ok 1 - chdir updir
+ ok 2 - teardown
+ # Looks like you planned 0 tests but ran 2.
+ skipped: cross-compiling and make not available
+
+this commit restores the implicit call of plan() at import time of Test::More
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+---
+ cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t | 7 ++++---
+ cpan/ExtUtils-MakeMaker/t/PL_FILES.t | 4 ++--
+ cpan/ExtUtils-MakeMaker/t/basic.t | 4 ++--
+ cpan/ExtUtils-MakeMaker/t/echo.t | 6 +++---
+ cpan/ExtUtils-MakeMaker/t/min_perl_version.t | 4 ++--
+ cpan/ExtUtils-MakeMaker/t/pm_to_blib.t | 4 ++--
+ cpan/ExtUtils-MakeMaker/t/recurs.t | 4 ++--
+ cpan/ExtUtils-MakeMaker/t/several_authors.t | 4 ++--
+ 8 files changed, 19 insertions(+), 18 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t b/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t
+index f27b62c..3bbb3a6 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t
++++ b/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t
+@@ -15,12 +15,13 @@ $CLEANUP &&= 1; # so always 1 or numerically 0
+
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+-use Test::More;
+ use Config;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+- : (tests => 3 + $CLEANUP + @INSTDIRS * (15 + $CLEANUP));
++ : ();
++plan tests => 3 + $CLEANUP + @INSTDIRS * (15 + $CLEANUP);
+
+ my $Is_VMS = $^O eq 'VMS';
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t
+index 0779dbb..85d53a5 100644
+--- a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t
++++ b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t
+@@ -11,9 +11,9 @@ use File::Temp qw[tempdir];
+ use MakeMaker::Test::Setup::PL_FILES;
+ use MakeMaker::Test::Utils;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : (tests => 9);
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/basic.t b/cpan/ExtUtils-MakeMaker/t/basic.t
+index 3dd66ad..eddf2e9 100644
+--- a/cpan/ExtUtils-MakeMaker/t/basic.t
++++ b/cpan/ExtUtils-MakeMaker/t/basic.t
+@@ -20,9 +20,9 @@ use utf8;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : (tests => 171);
+ use File::Find;
+diff --git a/cpan/ExtUtils-MakeMaker/t/echo.t b/cpan/ExtUtils-MakeMaker/t/echo.t
+index 789b85f..c43bc47 100644
+--- a/cpan/ExtUtils-MakeMaker/t/echo.t
++++ b/cpan/ExtUtils-MakeMaker/t/echo.t
+@@ -14,11 +14,11 @@ use MakeMaker::Test::Utils;
+ use File::Temp;
+ use Cwd 'abs_path';
+
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+- : ();
++ : (tests => 18);
+
+ #--------------------- Setup
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/min_perl_version.t b/cpan/ExtUtils-MakeMaker/t/min_perl_version.t
+index c5d78d6..2ef118d 100644
+--- a/cpan/ExtUtils-MakeMaker/t/min_perl_version.t
++++ b/cpan/ExtUtils-MakeMaker/t/min_perl_version.t
+@@ -13,9 +13,9 @@ use TieOut;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::MPV;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : (tests => 36);
+ use File::Path;
+diff --git a/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t b/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t
+index f1e348e..ebfa26c 100644
+--- a/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t
++++ b/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t
+@@ -12,9 +12,9 @@ use ExtUtils::MakeMaker;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : 'no_plan';
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/recurs.t b/cpan/ExtUtils-MakeMaker/t/recurs.t
+index 84c09a2..661e0db 100644
+--- a/cpan/ExtUtils-MakeMaker/t/recurs.t
++++ b/cpan/ExtUtils-MakeMaker/t/recurs.t
+@@ -14,9 +14,9 @@ use File::Temp qw[tempdir];
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::Recurs;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : (tests => 26);
+
+diff --git a/cpan/ExtUtils-MakeMaker/t/several_authors.t b/cpan/ExtUtils-MakeMaker/t/several_authors.t
+index 1a75a3e..869e9f0 100644
+--- a/cpan/ExtUtils-MakeMaker/t/several_authors.t
++++ b/cpan/ExtUtils-MakeMaker/t/several_authors.t
+@@ -13,9 +13,9 @@ use TieOut;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::SAS;
+ use Config;
+-use Test::More;
+ use ExtUtils::MM;
+-plan !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
++use Test::More
++ !MM->can_run(make()) && $ENV{PERL_CORE} && $Config{'usecrosscompile'}
+ ? (skip_all => "cross-compiling and make not available")
+ : (tests => 20);
+ use File::Path;
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch b/poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
new file mode 100644
index 000000000..59ce85a7a
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
@@ -0,0 +1,18 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+We need ld in the fake config library, but it's not included by default. So
+expand the number of items included. While this works it indicates that the
+rest of the config items are not being picked up and/or are being picked up
+from the host. More investigation needed.
+
+--- perl-5.8.8/configpm 2007/04/20 09:48:05 1.1
++++ perl-5.8.8/configpm 2007/04/20 09:57:12
+@@ -2,7 +2,7 @@
+ use strict;
+ use vars qw(%Config $Config_SH_expanded);
+
+-my $how_many_common = 22;
++my $how_many_common = 50;
+
+ # commonly used names to precache (and hence lookup fastest)
+ my %Common;
diff --git a/poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch b/poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
new file mode 100644
index 000000000..1d9a56d4c
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/perl-test-customized.patch
@@ -0,0 +1,86 @@
+From 64df09205b6ccb5a434a4e53e8e0a32377ab634f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 24 Nov 2016 10:49:55 -0600
+Subject: [PATCH] The OE core recipies customize some ExtUtils-MakeMaker
+ modules, which causes their MD5 sum to mismatch the provided table and the
+ corresponding tests to fail. Also, we patch several test files with a
+ backported patch. Update list of hashes to reflect the patched files.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Bill Randle <william.c.randle@intel.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ t/porting/customized.dat | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index defeae1..b5d3c46 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -18,12 +18,12 @@ Encode cpan/Encode/bin/unidump 715f47c2fcc661268f3c6cd3de0d27c72b745cd2
+ Encode cpan/Encode/Encode.pm e146861ff2e6aaa62defa4887eade68dd7b17c8e
+ Encode cpan/Encode/encoding.pm 51c19efc9bfe8467d6ae12a4654f6e7f980715bf
+ ExtUtils::Constant cpan/ExtUtils-Constant/t/Constant.t a0369c919e216fb02767a637666bb4577ad79b02
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/bin/instmodsh 5bc04a0173b8b787f465271b6186220326ae8eef
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/bin/instmodsh 2070fe968fa344d89aea1bdc6a8dbb0c467d0612
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command.pm e3a372e07392179711ea9972087c1105a2780fad
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm b72721bd6aa9bf7ec328bda99a8fdb63cac6114d
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm 0e1e4c25eddb999fec6c4dc66593f76db34cfd16
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm bfd2aa00ca4ed251f342e1d1ad704abbaf5a615e
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 5529ae3064365eafd99536621305d52f4ab31b45
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm f1ca5ec247eb69ba13a269f34dc205da37b61244
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm bc88b275af73b8faac6abd59a9aad3f625925810
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 062e5d14a803fbbec8d61803086a3d7997e8a473
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod a8a9cab7d67922ed3d6883c864e1fe29aaa6ad89
+@@ -33,7 +33,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm 412e95c3
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm 8559ef191b4371d0c381472464856a8a73825b2a
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm 09d579ed9daea95c3bf47de2e0b8fe3aa0ff6447
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm f720c13748293b792f7073aa96e7daecb590b183
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 243649a399d293ae7ad0f26b7eab2668aa864ce8
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm ec39f68802a6fee8daaa914fc7131f40533cfc23
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm b63c90129303b2c17d084fb828aa2c02a2ad85b8
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm cabd1c97eaa427067811d92807e34c17940c7350
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm 6a185d897a600c34615a6073f4de0ac2f54fef3e
+@@ -42,7 +42,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm 1f5eb772eed
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm de777d7809c0d73e5d4622a29921731c7e5dff48
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm 01e8f08a82b5304009574e3ac0892b4066ff7639
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm 5340052b58557a6764f5ac9f8b807fefec404a06
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 3c3b93f431b0a51b9592b3d69624dbf5409f6f74
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 0d6ed5e4bdcdcd28e968e8629a592fdd0cc84818
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm 40397f4cd2d49700b80b4ef490da98add24c5b37
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm 147e97fbabb74841f0733dbd5d1b9f3fa51f87c1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm 3f13ed7045ff3443bcb4dd6c95c98b9bd705820f
+@@ -51,7 +51,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm 48e8a2fe176
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm 6fefe99045b64459905d4721f3a494d8d50f7ab9
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm 172778ad21c065a89cd270668eb9f99a7364b41c
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/cd.t 0a71fbd646a7be8358b07b6f64f838243cc0aef4
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/echo.t 37aec8f794c52e037540757eb5b2556f79419ff7
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/echo.t 1a93dd8834e4bb0e5facf08204e782807567b2eb
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/NoXS.pm 371cdff1b2375017907cfbc9c8f4a31f5ad10582
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/prereq.t 53bda2c549fd13a6b6c13a070ca6bc79883081c0
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/t/vstrings.t 90035a2bdbf45f15b9c3196d072d7cba7e662871
+@@ -165,7 +165,7 @@ bignum cpan/bignum/lib/bigrat.pm 7fccc9df30e43dbbae6e5ea91b26c8046545c9a9
+ bignum cpan/bignum/lib/Math/BigFloat/Trace.pm a6b4b995e18f4083252e6dc72e9bef69671893dd
+ bignum cpan/bignum/lib/Math/BigInt/Trace.pm d9596963673760cae3eeeb752c1eeeec50bb2290
+ libnet cpan/libnet/lib/Net/Cmd.pm a44a10c939a4c35f923c4638054178c32f1d283a
+-libnet cpan/libnet/lib/Net/Config.pm 9bd49bf4de0dc438bceee0ef4baf8ba7a6633327
++libnet cpan/libnet/lib/Net/Config.pm 2873da5efbffed67934dd297ef6f360b3558cb0b
+ libnet cpan/libnet/lib/Net/Domain.pm 1bbed50f70fd1ff3e1cdf087b19a9349cddfaced
+ libnet cpan/libnet/lib/Net/FTP.pm 40dba553c8d44e1530daec2d07a6e50910401f2e
+ libnet cpan/libnet/lib/Net/FTP/A.pm c570b10730b168990034dcf9cb00e305a100f336
+@@ -176,6 +176,6 @@ libnet cpan/libnet/lib/Net/FTP/L.pm ac1599c775faee0474710e4f75051c8949f13df2
+ libnet cpan/libnet/lib/Net/Netrc.pm 009cfc08f8a5bf247257acb64a21e1b6ad8b2c9c
+ libnet cpan/libnet/lib/Net/NNTP.pm 6325fc05fd9ef81dc8d461a77b2a3f56ad1ae114
+ libnet cpan/libnet/lib/Net/POP3.pm 2d8065646df80061dae5a9e3465a36a6557165fd
+-libnet cpan/libnet/lib/Net/SMTP.pm f3ed7a177b49ee0ba65ac1c414de797cdbbe6886
++libnet cpan/libnet/lib/Net/SMTP.pm f1beb42bfbef4333ed24ad63d5dd1aa5c67b20c7
+ libnet cpan/libnet/lib/Net/Time.pm b3df8bbaa3bc253fbf77e8386c59a1b2aae13627
+ version cpan/version/lib/version.pm ff75e2076be10bd4c05133cd979fda0b38ca8653
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/perl/perl/run-ptest b/poky/meta/recipes-devtools/perl/perl/run-ptest
new file mode 100644
index 000000000..1e2dd1b66
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+cd t && ./TEST | sed -u -e 's|\(.*\) .* ok$|PASS: \1|' -e 's|\(.*\) .* skipped|SKIP: \1|' -e 's|\(.*\) \.\(.*\)|FAIL: \1|'
diff --git a/poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch b/poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
new file mode 100644
index 000000000..03fdf4ab9
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
@@ -0,0 +1,30 @@
+From 1561549ea36e37cc25706f094a195de4928f4211 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 19 Jun 2015 01:23:46 -0700
+Subject: [PATCH] t/run/switches.t: perl5 -> perl
+
+We call it perl rather than perl5 in oe.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ t/run/switches.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/run/switches.t b/t/run/switches.t
+index 78915e0..e9e4b45 100644
+--- a/t/run/switches.t
++++ b/t/run/switches.t
+@@ -269,7 +269,7 @@ is runperl(stderr => 1, prog => '#!perl -M'),
+ '-V generates 20+ lines' );
+
+ like( runperl( switches => ['-V'] ),
+- qr/\ASummary of my perl5 .*configuration:/,
++ qr/\ASummary of my perl .*configuration:/,
+ '-V looks okay' );
+
+ # lookup a known config var
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch b/poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
new file mode 100644
index 000000000..c8293c3d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
@@ -0,0 +1,38 @@
+dist/threads/t/join.t: adjust ps option
+
+The ps's option '-f' is not supported by busybox in oe.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ dist/threads/t/join.t | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dist/threads/t/join.t b/dist/threads/t/join.t
+--- a/dist/threads/t/join.t
++++ b/dist/threads/t/join.t
+@@ -118,7 +118,7 @@ if ($^O eq 'linux') {
+ })->join;
+ #print "# mainthread: \$0 = $0\n";
+ #print "# pid = $$\n";
+- if (open PS, "ps -f |") { # Note: must work in (all) systems.
++ if (open PS, "ps |") { # Note: must work in (all) systems.
+ my ($sawpid, $sawexe);
+ while (<PS>) {
+ chomp;
+@@ -135,10 +135,10 @@ if ($^O eq 'linux') {
+ if ($sawpid) {
+ ok($sawpid && $sawexe, 'altering $0 is effective');
+ } else {
+- skip("\$0 check: did not see pid $$ in 'ps -f |'");
++ skip("\$0 check: did not see pid $$ in 'ps |'");
+ }
+ } else {
+- skip("\$0 check: opening 'ps -f |' failed: $!");
++ skip("\$0 check: opening 'ps |' failed: $!");
+ }
+ } else {
+ skip("\$0 check: only on Linux");
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch b/poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
new file mode 100644
index 000000000..ce577fe5f
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
@@ -0,0 +1,26 @@
+ext/DynaLoader/t/DynaLoader.t: fix calling dl_findfile() failed
+
+Use '$Config{libc}' as the libc file name
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ext/DynaLoader/t/DynaLoader.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
+index ade1f8e..3567afe 100644
+--- a/ext/DynaLoader/t/DynaLoader.t
++++ b/ext/DynaLoader/t/DynaLoader.t
+@@ -106,7 +106,7 @@ ok( defined $dlerr, "dl_error() returning an error message: '$dlerr'" );
+ # ... dl_findfile()
+ SKIP: {
+ my @files = ();
+- eval { @files = DynaLoader::dl_findfile("c") };
++ eval { @files = DynaLoader::dl_findfile($Config{libc}) };
+ is( $@, '', "calling dl_findfile()" );
+ # Some platforms are known to not have a "libc"
+ # (not at least by that name) that the dl_findfile()
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/perl/perl_5.24.1.bb b/poky/meta/recipes-devtools/perl/perl_5.24.1.bb
new file mode 100644
index 000000000..91f310d42
--- /dev/null
+++ b/poky/meta/recipes-devtools/perl/perl_5.24.1.bb
@@ -0,0 +1,353 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "db grep-native gdbm zlib virtual/crypt"
+
+# Pick up patches from debian
+# http://ftp.de.debian.org/debian/pool/main/p/perl/perl_5.22.0-1.debian.tar.xz
+SRC_URI += " \
+ file://debian/cpan_definstalldirs.diff \
+ file://debian/db_file_ver.diff \
+ file://debian/doc_info.diff \
+ file://debian/enc2xs_inc.diff \
+ file://debian/errno_ver.diff \
+ file://debian/libperl_embed_doc.diff \
+ file://debian/fixes/respect_umask.diff \
+ file://debian/writable_site_dirs.diff \
+ file://debian/extutils_set_libperl_path.diff \
+ file://debian/no_packlist_perllocal.diff \
+ file://debian/prefix_changes.diff \
+ file://debian/instmodsh_doc.diff \
+ file://debian/ld_run_path.diff \
+ file://debian/libnet_config_path.diff \
+ file://debian/mod_paths.diff \
+ file://debian/prune_libs.diff \
+ file://debian/fixes/net_smtp_docs.diff \
+ file://debian/perlivp.diff \
+ file://debian/squelch-locale-warnings.diff \
+ file://debian/skip-upstream-git-tests.diff \
+ file://debian/skip-kfreebsd-crash.diff \
+ file://debian/fixes/document_makemaker_ccflags.diff \
+ file://debian/find_html2text.diff \
+ file://debian/perl5db-x-terminal-emulator.patch \
+ file://debian/cpan-missing-site-dirs.diff \
+ file://debian/fixes/memoize_storable_nstore.diff \
+ file://debian/regen-skip.diff \
+"
+
+SRC_URI += " \
+ file://Makefile.patch \
+ file://Makefile.SH.patch \
+ file://installperl.patch \
+ file://perl-archlib-exp.patch \
+ file://perl-dynloader.patch \
+ file://perl-moreconfig.patch \
+ file://letgcc-find-errno.patch \
+ file://generate-sh.patch \
+ file://native-perlinc.patch \
+ file://cross-generate_uudmap.patch \
+ file://fix_bad_rpath.patch \
+ file://dynaloaderhack.patch \
+ file://config.sh \
+ file://config.sh-32 \
+ file://config.sh-32-le \
+ file://config.sh-32-be \
+ file://config.sh-64 \
+ file://config.sh-64-le \
+ file://config.sh-64-be \
+ file://make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch \
+ file://t-run-switches.t-perl5-perl.patch \
+ file://ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch \
+ file://ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch \
+ file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+ file://perl-errno-generation-gcc5.patch \
+ file://perl-fix-conflict-between-skip_all-and-END.patch \
+ file://perl-test-customized.patch \
+ file://perl-5.26.1-guard_old_libcrypt_fix.patch \
+ file://CVE-2017-12883.patch \
+ file://CVE-2017-12837.patch \
+"
+
+# Fix test case issues
+SRC_URI_append_class-target = " \
+ file://test/dist-threads-t-join.t-adjust-ps-option.patch \
+ file://test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch \
+ "
+
+SRC_URI[md5sum] = "af6a84c7c3e2b8b269c105a5db2f6d53"
+SRC_URI[sha256sum] = "03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f"
+
+inherit perlnative siteinfo
+
+# Where to find the native perl
+HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+
+# Where to find .so files - use the -native versions not those from the target build
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+# Where to find perl @INC/#include files
+# - use the -native versions not those from the target build
+export PERL_LIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+export PERL_ARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+# LDFLAGS for shared libraries
+export LDDLFLAGS = "${LDFLAGS} -shared"
+
+LDFLAGS_append = " -fstack-protector"
+
+# We're almost Debian, aren't we?
+CFLAGS += "-DDEBIAN"
+
+do_configure() {
+ # Make hostperl in build directory be the native perl
+ ln -sf ${HOSTPERL} hostperl
+
+ if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+ if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a -e Makefile ]; then
+ ${MAKE} clean
+ fi
+ find ${S} -name *.so -delete
+ fi
+ if [ -n "${CONFIGURESTAMPFILE}" ]; then
+ echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+ fi
+
+ # Do our work in the cross subdir
+ cd Cross
+
+ # Generate configuration
+ rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
+ for i in ${WORKDIR}/config.sh \
+ ${WORKDIR}/config.sh-${SITEINFO_BITS} \
+ ${WORKDIR}/config.sh-${SITEINFO_BITS}-${SITEINFO_ENDIANNESS}; do
+ cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
+ done
+
+ # Fixups for musl
+ if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" -o "${TARGET_OS}" = "linux-muslx32" ]; then
+ sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
+ -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
+ -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
+ -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
+ -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
+ -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+ -e "s,\(d_finitel=\)'define',\1'undef',g" \
+ -e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
+ -e "s,\(getpwent_r=\)'define',\1'undef',g" \
+ -e "s,\(getservent_r=\)'define',\1'undef',g" \
+ -e "s,\(gethostent_r=\)'define',\1'undef',g" \
+ -e "s,\(getnetent_r=\)'define',\1'undef',g" \
+ -e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
+ -e "s,\(getprotoent_r=\)'define',\1'undef',g" \
+ -e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
+ -e "s,\(getgrent_r=\)'define',\1'undef',g" \
+ -e "s,\(i_fcntl=\)'undef',\1'define',g" \
+ -e "s,\(h_fcntl=\)'false',\1'true',g" \
+ -e "s,-fstack-protector,-fno-stack-protector,g" \
+ -e "s,-lnsl,,g" \
+ config.sh-${TARGET_ARCH}-${TARGET_OS}
+ fi
+
+ # Update some paths in the configuration
+ sed -i -e 's,@ARCH@-thread-multi,,g' \
+ -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
+ -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \
+ -e "s,@INCLUDEDIR@,${STAGING_INCDIR},g" \
+ -e "s,@LIBDIR@,${libdir},g" \
+ -e "s,@BASELIBDIR@,${base_libdir},g" \
+ -e "s,@EXECPREFIX@,${exec_prefix},g" \
+ -e 's,@USRBIN@,${bindir},g' \
+ config.sh-${TARGET_ARCH}-${TARGET_OS}
+
+ case "${TARGET_ARCH}" in
+ x86_64 | powerpc | s390)
+ sed -i -e "s,\(need_va_copy=\)'undef',\1'define',g" \
+ config.sh-${TARGET_ARCH}-${TARGET_OS}
+ ;;
+ arm)
+ sed -i -e "s,\(d_u32align=\)'undef',\1'define',g" \
+ config.sh-${TARGET_ARCH}-${TARGET_OS}
+ ;;
+ esac
+ # These are strewn all over the source tree
+ for foo in `grep -I --exclude="*.patch" --exclude="*.diff" --exclude="*.pod" --exclude="README*" --exclude="Glossary" -m1 "/usr/include/.*\.h" ${S}/* -r -l` ${S}/utils/h2xs.PL ; do
+ echo Fixing: $foo
+ sed -e 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i $foo
+ done
+
+ rm -f config
+ echo "ARCH = ${TARGET_ARCH}" > config
+ echo "OS = ${TARGET_OS}" >> config
+}
+
+do_compile() {
+ # Fix to avoid recursive substitution of path
+ sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+
+ cd Cross
+ oe_runmake perl LD="${CCLD}"
+}
+
+do_compile_append_class-target() {
+ # Remove build host references from numerous comments...
+ find "${S}/cpan/Encode" -type f \
+ \( -name '*.exh' -o -name '*.c' -o -name '*.h' \)\
+ -exec sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' {} +
+ sed -i -e 's:${RECIPE_SYSROOT}::g' ${S}/perl.h ${S}/pp.h
+ sed -i -e 's:${RECIPE_SYSROOT_NATIVE}/usr/bin/perl-native/perl${PV}.real:/usr/bin/perl${PV}:g' \
+ ${S}/cpan/Compress-Raw-Bzip2/constants.h \
+ ${S}/cpan/Compress-Raw-Zlib/constants.h \
+ ${S}/cpan/IPC-SysV/const-c.inc \
+ ${S}/dist/Time-HiRes/const-c.inc
+}
+
+do_install() {
+ #export hostperl="${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+ oe_runmake install DESTDIR=${D}
+ # Add perl pointing at current version
+ ln -sf perl${PV} ${D}${bindir}/perl
+
+ ln -sf perl ${D}/${libdir}/perl5
+
+ # Remove unwanted file and empty directories
+ rm -f ${D}/${libdir}/perl/${PV}/.packlist
+ rmdir ${D}/${libdir}/perl/site_perl/${PV}
+ rmdir ${D}/${libdir}/perl/site_perl
+
+ # Fix up shared library
+ mv ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
+ ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
+ ln -sf ../../../libperl.so.${PV} ${D}/${libdir}/perl/${PV}/CORE/libperl.so
+
+ # target config, used by cpan.bbclass to extract version information
+ install config.sh ${D}${libdir}/perl
+
+ ln -s Config_heavy.pl ${D}${libdir}/perl/${PV}/Config_heavy-target.pl
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/perl \
+ PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/vendor_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}'
+}
+
+PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
+
+perl_package_preprocess () {
+ # Fix up installed configuration
+ sed -i -e "s,${D},,g" \
+ -e "s,${DEBUG_PREFIX_MAP},,g" \
+ -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+ -e "s,-isystem${STAGING_INCDIR} ,,g" \
+ -e "s,${STAGING_LIBDIR},${libdir},g" \
+ -e "s,${STAGING_BINDIR},${bindir},g" \
+ -e "s,${STAGING_INCDIR},${includedir},g" \
+ -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+ -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+ -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ ${PKGD}${bindir}/h2xs \
+ ${PKGD}${bindir}/h2ph \
+ ${PKGD}${bindir}/pod2man \
+ ${PKGD}${bindir}/pod2text \
+ ${PKGD}${bindir}/pod2usage \
+ ${PKGD}${bindir}/podchecker \
+ ${PKGD}${bindir}/podselect \
+ ${PKGD}${libdir}/perl/${PV}/CORE/config.h \
+ ${PKGD}${libdir}/perl/${PV}/CORE/perl.h \
+ ${PKGD}${libdir}/perl/${PV}/CORE/pp.h \
+ ${PKGD}${libdir}/perl/${PV}/Config.pm \
+ ${PKGD}${libdir}/perl/${PV}/Config.pod \
+ ${PKGD}${libdir}/perl/${PV}/Config_heavy.pl \
+ ${PKGD}${libdir}/perl/${PV}/ExtUtils/Liblist/Kid.pm \
+ ${PKGD}${libdir}/perl/${PV}/FileCache.pm \
+ ${PKGD}${libdir}/perl/${PV}/pod/*.pod \
+ ${PKGD}${libdir}/perl/config.sh
+}
+
+PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
+ perl-module-cpan perl-module-cpanplus perl-module-unicore"
+FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
+ ${libdir}/perl/${PV}/Config.pm \
+ ${libdir}/perl/${PV}/strict.pm \
+ ${libdir}/perl/${PV}/warnings.pm \
+ ${libdir}/perl/${PV}/warnings \
+ ${libdir}/perl/${PV}/vars.pm \
+ "
+FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
+RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
+ perl-module-warnings-register"
+FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
+FILES_${PN}-lib = "${libdir}/libperl.so* \
+ ${libdir}/perl5 \
+ ${libdir}/perl/config.sh \
+ ${libdir}/perl/${PV}/Config_git.pl \
+ ${libdir}/perl/${PV}/Config_heavy.pl \
+ ${libdir}/perl/${PV}/Config_heavy-target.pl"
+FILES_${PN}-pod = "${libdir}/perl/${PV}/pod \
+ ${libdir}/perl/${PV}/*.pod \
+ ${libdir}/perl/${PV}/*/*.pod \
+ ${libdir}/perl/${PV}/*/*/*.pod "
+FILES_perl-misc = "${bindir}/*"
+FILES_${PN}-doc = "${libdir}/perl/${PV}/*/*.txt \
+ ${libdir}/perl/${PV}/*/*/*.txt \
+ ${libdir}/perl/${PV}/auto/XS/Typemap \
+ ${libdir}/perl/${PV}/B/assemble \
+ ${libdir}/perl/${PV}/B/cc_harness \
+ ${libdir}/perl/${PV}/B/disassemble \
+ ${libdir}/perl/${PV}/B/makeliblinks \
+ ${libdir}/perl/${PV}/CGI/eg \
+ ${libdir}/perl/${PV}/CPAN/PAUSE2003.pub \
+ ${libdir}/perl/${PV}/CPAN/SIGNATURE \
+ ${libdir}/perl/${PV}/CPANPLUS/Shell/Default/Plugins/HOWTO.pod \
+ ${libdir}/perl/${PV}/Encode/encode.h \
+ ${libdir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
+ ${libdir}/perl/${PV}/ExtUtils/NOTES \
+ ${libdir}/perl/${PV}/ExtUtils/PATCHING \
+ ${libdir}/perl/${PV}/ExtUtils/typemap \
+ ${libdir}/perl/${PV}/ExtUtils/xsubpp \
+ ${libdir}/perl/${PV}/ExtUtils/Changes_EU-Install \
+ ${libdir}/perl/${PV}/Net/*.eg \
+ ${libdir}/perl/${PV}/unicore/mktables \
+ ${libdir}/perl/${PV}/unicore/mktables.lst \
+ ${libdir}/perl/${PV}/unicore/version "
+
+FILES_perl-module-cpan += "${libdir}/perl/${PV}/CPAN \
+ ${libdir}/perl/${PV}/CPAN.pm"
+FILES_perl-module-cpanplus += "${libdir}/perl/${PV}/CPANPLUS \
+ ${libdir}/perl/${PV}/CPANPLUS.pm"
+FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
+
+# Create a perl-modules package recommending all the other perl
+# packages (actually the non modules packages and not created too)
+ALLOW_EMPTY_perl-modules = "1"
+PACKAGES_append = " perl-modules "
+
+PACKAGESPLITFUNCS_prepend = "split_perl_packages "
+
+python split_perl_packages () {
+ libdir = d.expand('${libdir}/perl/${PV}')
+ do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
+ do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+ do_split_packages(d, libdir, 'Module/([^\/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+ do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+
+ # perl-modules should recommend every perl module, and only the
+ # modules. Don't attempt to use the result of do_split_packages() as some
+ # modules are manually split (eg. perl-module-unicore).
+ packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
+ d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
+}
+
+PACKAGES_DYNAMIC += "^perl-module-.*(?<!\-native)$"
+PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"
+
+RPROVIDES_perl-lib = "perl-lib"
+
+require perl-rdepends_${PV}.inc
+require perl-ptest.inc
+
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-esdk.in b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-esdk.in
new file mode 100644
index 000000000..4fc9b0a4a
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-esdk.in
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# Orignal pkg-config-native action when called as pkg-config-native
+# NO Change here
+if [ "pkg-config-native" = "`basename $0`" ] ; then
+ PKG_CONFIG_PATH="@PATH_NATIVE@"
+ PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+ unset PKG_CONFIG_SYSROOT_DIR
+else
+ # in this case check if we are in the esdk
+ if [ "$OE_SKIP_SDK_CHECK" = "1" ] ; then
+ parentpid=`ps -o ppid= -p $$`
+ parentpid_info=`ps -wo comm= -o args= -p $parentpid`
+
+ # check if we are being called from the kernel's make menuconfig
+ if ( echo $parentpid_info | grep -q check-lxdialog ) ; then
+ PKG_CONFIG_PATH="@PATH_NATIVE@"
+ PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+ unset PKG_CONFIG_SYSROOT_DIR
+ fi
+ fi
+fi
+
+pkg-config.real "$@"
diff --git a/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-native.in b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-native.in
new file mode 100644
index 000000000..9ed30a0d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-native.in
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+PKG_CONFIG_PATH="@PATH_NATIVE@"
+unset PKG_CONFIG_SYSROOT_DIR
+
+pkg-config "$@"
diff --git a/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-wrapper b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-wrapper
new file mode 100755
index 000000000..695f34956
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconf/pkgconf/pkg-config-wrapper
@@ -0,0 +1,16 @@
+#!/bin/sh
+# pkgconf wrapper to deal with pkg-config/pkgconf compatibility issues
+#
+# Copyright (C) 2015 Christopher Larson <chris_larson@mentor.com>
+# License: MIT (see COPYING.MIT at the root of the repository for terms)
+
+for arg; do
+ case "$arg" in
+ --variable|--variable=*)
+ # pkg-config doesn't sysroot-prefix user variables
+ unset PKG_CONFIG_SYSROOT_DIR
+ ;;
+ esac
+done
+
+exec pkgconf "$@"
diff --git a/poky/meta/recipes-devtools/pkgconf/pkgconf_1.4.2.bb b/poky/meta/recipes-devtools/pkgconf/pkgconf_1.4.2.bb
new file mode 100644
index 000000000..ea7b66602
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconf/pkgconf_1.4.2.bb
@@ -0,0 +1,71 @@
+SUMMARY = "pkgconf provides compiler and linker configuration for development frameworks."
+DESCRIPTION = "pkgconf is a program which helps to configure compiler and linker \
+flags for development frameworks. It is similar to pkg-config from \
+freedesktop.org, providing additional functionality while also maintaining \
+compatibility."
+HOMEPAGE = "http://pkgconf.org"
+BUGTRACKER = "https://github.com/pkgconf/pkgconf/issues"
+SECTION = "devel"
+PROVIDES += "pkgconfig"
+RPROVIDES_${PN} += "pkgconfig"
+DEFAULT_PREFERENCE = "-1"
+
+# The pkgconf license seems to be functionally equivalent to BSD-2-Clause or
+# ISC, but has different wording, so needs its own name.
+LICENSE = "pkgconf"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2214222ec1a820bd6cc75167a56925e0"
+
+SRC_URI = "\
+ https://distfiles.dereferenced.org/pkgconf/pkgconf-${PV}.tar.xz \
+ file://pkg-config-wrapper \
+ file://pkg-config-native.in \
+ file://pkg-config-esdk.in \
+"
+SRC_URI[md5sum] = "678d242b4eef1754bba6a58642af10bb"
+SRC_URI[sha256sum] = "bab39371d4ab972be1d539a8b10b6cc21f8eafc97f617102e667e82bd32eb234"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF += "--with-pkg-config-dir='${libdir}/pkgconfig:${datadir}/pkgconfig'"
+
+do_install_append () {
+ # Install a wrapper which deals, as much as possible with pkgconf vs
+ # pkg-config compatibility issues.
+ install -m 0755 "${WORKDIR}/pkg-config-wrapper" "${D}${bindir}/pkg-config"
+}
+
+do_install_append_class-native () {
+ # Install a pkg-config-native wrapper that will use the native sysroot instead
+ # of the MACHINE sysroot, for using pkg-config when building native tools.
+ sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+ < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+ install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+ sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+ -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+ < ${WORKDIR}/pkg-config-esdk.in > ${B}/pkg-config-esdk
+ install -m755 ${B}/pkg-config-esdk ${D}${bindir}/pkg-config-esdk
+}
+
+ALTERNATIVE_${PN} = "pkg-config"
+
+# When using the RPM generated automatic package dependencies, some packages
+# will end up requiring 'pkgconfig(pkg-config)'. Allow this behavior by
+# specifying an appropriate provide.
+RPROVIDES_${PN} += "pkgconfig(pkg-config)"
+
+# Include pkg.m4 in the main package, leaving libpkgconf dev files in -dev
+FILES_${PN}-dev_remove = "${datadir}/aclocal"
+FILES_${PN} += "${datadir}/aclocal"
+
+BBCLASSEXTEND += "native nativesdk"
+
+pkgconf_sstate_fixup_esdk () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
+ pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
+ mv $pkgconfdir/pkg-config $pkgconfdir/pkg-config.real
+ lnr $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
+ sed -i -e "s|^pkg-config|pkg-config.real|" $pkgconfdir/pkg-config-native
+ fi
+}
+
+SSTATEPOSTUNPACKFUNCS_append_class-native = " pkgconf_sstate_fixup_esdk"
diff --git a/poky/meta/recipes-devtools/pkgconfig/pkgconfig/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch
new file mode 100644
index 000000000..80310cd37
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch
@@ -0,0 +1,41 @@
+From e404e27de77d8b993c4cc87013d707200b3a5547 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 17 May 2016 13:26:27 +0300
+Subject: [PATCH] glib-gettext.m4: Update AM_GLIB_GNU_GETTEXT to match glib
+
+This avoids
+ error: m4_copy: won't overwrite defined macro: glib_DEFUN
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Pending
+
+---
+ glib/m4macros/glib-gettext.m4 | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/glib/m4macros/glib-gettext.m4 b/glib/m4macros/glib-gettext.m4
+index 5217fd8..155b1d8 100644
+--- a/glib/m4macros/glib-gettext.m4
++++ b/glib/m4macros/glib-gettext.m4
+@@ -313,7 +313,7 @@ msgstr ""
+ # on various variables needed by the Makefile.in.in installed by
+ # glib-gettextize.
+ dnl
+-glib_DEFUN([GLIB_GNU_GETTEXT],
++AU_DEFUN([GLIB_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_CC])dnl
+
+ GLIB_LC_MESSAGES
+@@ -383,7 +383,8 @@ glib_DEFUN([GLIB_GNU_GETTEXT],
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+- ])
++ ],
++ [[$0: This macro is deprecated. You should use upstream gettext instead.]])
+
+ # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
+ # -------------------------------
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
new file mode 100644
index 000000000..01c62472c
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
@@ -0,0 +1,45 @@
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: pkg-config-0.28/glib/configure.ac
+===================================================================
+--- pkg-config-0.28.orig/glib/configure.ac
++++ pkg-config-0.28/glib/configure.ac
+@@ -1438,7 +1438,7 @@ if test x"$glib_native_win32" = xyes; th
+ G_MODULE_LDFLAGS=
+ else
+ export SED
+- G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++ G_MODULE_LDFLAGS=`(./${host_alias}-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1503,13 +1503,13 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ echo "void glib_plugin_test(void) { }" > plugin.c
+- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./${host_alias}-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./${host_alias}-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ ${LDFLAGS} -module -o plugin.la -export-dynamic \
+ -shrext ".o" -avoid-version plugin.lo \
+ -rpath /dont/care >/dev/null 2>&1
+- eval `./libtool --config | grep ^objdir`
++ eval `./${host_alias}-libtool --config | grep ^objdir`
+ AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
+ glib_cv_rtldglobal_broken,[
+ AC_TRY_RUN([
+@@ -1582,7 +1582,7 @@ fi
+
+ AC_MSG_CHECKING(for the suffix of module shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`./${host_alias}-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
diff --git a/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-esdk.in b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-esdk.in
new file mode 100644
index 000000000..4fc9b0a4a
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-esdk.in
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# Orignal pkg-config-native action when called as pkg-config-native
+# NO Change here
+if [ "pkg-config-native" = "`basename $0`" ] ; then
+ PKG_CONFIG_PATH="@PATH_NATIVE@"
+ PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+ unset PKG_CONFIG_SYSROOT_DIR
+else
+ # in this case check if we are in the esdk
+ if [ "$OE_SKIP_SDK_CHECK" = "1" ] ; then
+ parentpid=`ps -o ppid= -p $$`
+ parentpid_info=`ps -wo comm= -o args= -p $parentpid`
+
+ # check if we are being called from the kernel's make menuconfig
+ if ( echo $parentpid_info | grep -q check-lxdialog ) ; then
+ PKG_CONFIG_PATH="@PATH_NATIVE@"
+ PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+ unset PKG_CONFIG_SYSROOT_DIR
+ fi
+ fi
+fi
+
+pkg-config.real "$@"
diff --git a/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
new file mode 100644
index 000000000..5e44bb435
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+PKG_CONFIG_PATH="@PATH_NATIVE@"
+PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+unset PKG_CONFIG_SYSROOT_DIR
+
+pkg-config "$@"
diff --git a/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
new file mode 100644
index 000000000..52ef2a977
--- /dev/null
+++ b/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -0,0 +1,73 @@
+SUMMARY = "Helper tool used when compiling"
+DESCRIPTION = "pkg-config is a helper tool used when compiling applications and libraries. It helps determined \
+the correct compiler/link options. It is also language-agnostic."
+HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
+BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=pkg-config"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRCREV = "edf8e6f0ea77ede073f07bff0d2ae1fc7a38103b"
+PV = "0.29.2+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/pkg-config \
+ file://pkg-config-esdk.in \
+ file://pkg-config-native.in \
+ file://fix-glib-configure-libtool-usage.patch \
+ file://0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+# Because of a faulty test, the current auto mode always evaluates to no,
+# so just continue that behaviour.
+#
+EXTRA_OECONF += "--disable-indirect-deps"
+
+PACKAGECONFIG ??= "glib"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[glib] = "--without-internal-glib,--with-internal-glib,glib-2.0 pkgconfig-native"
+
+acpaths = "-I ."
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Set an empty dev package to ensure the base PN package gets
+# the pkg.m4 macros, pkgconfig does not deliver any other -dev
+# files.
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal/pkg.m4"
+
+# When using the RPM generated automatic package dependencies, some packages
+# will end up requiring 'pkgconfig(pkg-config)'. Allow this behavior by
+# specifying an appropriate provide.
+RPROVIDES_${PN} += "pkgconfig(pkg-config)"
+
+# Install a pkg-config-native wrapper that will use the native sysroot instead
+# of the MACHINE sysroot, for using pkg-config when building native tools.
+do_install_append_class-native () {
+ sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+ -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+ < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+ install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+ sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+ -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+ < ${WORKDIR}/pkg-config-esdk.in > ${B}/pkg-config-esdk
+ install -m755 ${B}/pkg-config-esdk ${D}${bindir}/pkg-config-esdk
+}
+
+pkgconfig_sstate_fixup_esdk () {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" -a "${WITHIN_EXT_SDK}" = "1" ] ; then
+ pkgconfdir="${SSTATE_INSTDIR}/recipe-sysroot-native/${bindir_native}"
+ mv $pkgconfdir/pkg-config $pkgconfdir/pkg-config.real
+ lnr $pkgconfdir/pkg-config-esdk $pkgconfdir/pkg-config
+ sed -i -e "s|^pkg-config|pkg-config.real|" $pkgconfdir/pkg-config-native
+ fi
+}
+
+SSTATEPOSTUNPACKFUNCS_append_class-native = " pkgconfig_sstate_fixup_esdk"
diff --git a/poky/meta/recipes-devtools/prelink/prelink/macros.prelink b/poky/meta/recipes-devtools/prelink/prelink/macros.prelink
new file mode 100644
index 000000000..cb1669588
--- /dev/null
+++ b/poky/meta/recipes-devtools/prelink/prelink/macros.prelink
@@ -0,0 +1,5 @@
+# rpm-4.1 verifies prelinked libraries using a prelink undo helper.
+# Note: The 2nd token is used as argv[0] and "library" is a
+# placeholder that will be deleted and replaced with the appropriate
+# library file path.
+%__prelink_undo_cmd /usr/sbin/prelink prelink -y library
diff --git a/poky/meta/recipes-devtools/prelink/prelink/prelink.conf b/poky/meta/recipes-devtools/prelink/prelink/prelink.conf
new file mode 100644
index 000000000..562f23c59
--- /dev/null
+++ b/poky/meta/recipes-devtools/prelink/prelink/prelink.conf
@@ -0,0 +1,18 @@
+# This config file contains a list of directories both with binaries
+# and libraries prelink should consider by default.
+# If a directory name is prefixed with `-l ', the directory hierarchy
+# will be walked as long as filesystem boundaries are not crossed.
+# If a directory name is prefixed with `-h ', symbolic links in a
+# directory hierarchy are followed.
+-l /usr/local/sbin
+-l /sbin
+-l /usr/sbin
+-l /usr/local/bin
+-l /bin
+-l /usr/bin
+-l /usr/X11R6/bin
+-l /usr/games
+-l /usr/local/lib{,32,64,x32}
+-l /lib{,32,64,x32}
+-l /usr/lib{,32,64,x32}
+-l /usr/X11R6/lib{,32,64,x32}
diff --git a/poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily b/poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
new file mode 100644
index 000000000..0b3c07322
--- /dev/null
+++ b/poky/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+. /etc/default/prelink
+
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > /var/log/prelink.log
+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log
+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
diff --git a/poky/meta/recipes-devtools/prelink/prelink/prelink.default b/poky/meta/recipes-devtools/prelink/prelink/prelink.default
new file mode 100644
index 000000000..d8802f820
--- /dev/null
+++ b/poky/meta/recipes-devtools/prelink/prelink/prelink.default
@@ -0,0 +1,22 @@
+# Set this to no to disable prelinking altogether
+# or to yes to enable it.
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=yes
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment this line out if prelink
+# should be run in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
diff --git a/poky/meta/recipes-devtools/prelink/prelink_git.bb b/poky/meta/recipes-devtools/prelink/prelink_git.bb
new file mode 100644
index 000000000..0f6d16e00
--- /dev/null
+++ b/poky/meta/recipes-devtools/prelink/prelink_git.bb
@@ -0,0 +1,178 @@
+SECTION = "devel"
+# Need binutils for libiberty.a
+# Would need transfig-native for documentation if it wasn't disabled
+DEPENDS = "elfutils binutils"
+SUMMARY = "An ELF prelinking utility"
+HOMEPAGE = "http://git.yoctoproject.org/cgit.cgi/prelink-cross/about/"
+DESCRIPTION = "The prelink package contains a utility which modifies ELF shared libraries \
+and executables, so that far fewer relocations need to be resolved at \
+runtime and thus programs come up faster."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+SRCREV = "05aeafd053e56356ec8c62f4bb8f7b95bae192f3"
+PV = "1.0+git${SRCPV}"
+
+#
+# The cron script attempts to re-prelink the system daily -- on
+# systems where users are adding applications, this might be reasonable
+# but for embedded, we should be re-running prelink -a after an update.
+#
+# Default is prelinking is enabled.
+#
+SUMMARY_${PN}-cron = "Cron scripts to control automatic prelinking"
+DESCRIPTION_${PN}-cron = "Cron scripts to control automatic prelinking. \
+See: ${sysconfdir}/cron.daily/prelink for configuration information."
+
+FILES_${PN}-cron = "${sysconfdir}/cron.daily ${sysconfdir}/default"
+
+PACKAGES =+ "${PN}-cron"
+
+SRC_URI = "git://git.yoctoproject.org/prelink-cross.git;branch=cross_prelink \
+ file://prelink.conf \
+ file://prelink.cron.daily \
+ file://prelink.default \
+ file://macros.prelink"
+UPSTREAM_CHECK_COMMITS = "1"
+
+TARGET_OS_ORIG := "${TARGET_OS}"
+OVERRIDES_append = ":${TARGET_OS_ORIG}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-selinux --with-pkgversion=${PV}-${PR} \
+ --with-bugurl=http://bugzilla.yoctoproject.org/"
+
+
+#
+# For target prelink we need to ensure paths match the lib path layout
+# including for any configured multilibs
+#
+python do_linkerpaths () {
+ values = all_multilib_tune_list(["TUNE_ARCH", "baselib", "ABIEXTENSION"], d)
+
+ arches = values["TUNE_ARCH"]
+ baselibs = values["baselib"]
+ abis = values["ABIEXTENSION"]
+
+ def replace_lines(f, search, replacement, d, firstonly = False, secondonly = False):
+ f = d.expand(f)
+ if search == replacement:
+ return
+ bb.debug(2, "Replacing %s with %s in %s" % (search, replacement, f))
+ with open(f, "r") as data:
+ lines = data.readlines()
+ with open(f, "w") as data:
+ for line in lines:
+ if not secondonly and not firstonly:
+ line = line.replace(search, replacement)
+ elif secondonly and search in line:
+ secondonly = False
+ elif firstonly and search and search in line:
+ line = line.replace(search, replacement)
+ search = None
+ data.write(line)
+
+ def replace_lines_rtld(f, search, replacement, section, d):
+ f = d.expand(f)
+ bb.debug(2, "Replacing %s with %s in %s" % (search, replacement, f))
+ with open(f, "r") as data:
+ lines = data.readlines()
+ found = False
+ found2 = False
+ with open(f, "w") as data:
+ for line in lines:
+ if section in line:
+ if section == "else" and "if" in line:
+ found = False
+ else:
+ found = True
+ if found and "dst_LIB =" in line:
+ found2 = True
+ elif "}" in line:
+ found = False
+ found2 = False
+ if found2:
+ line = line.replace(search, replacement)
+ data.write(line)
+
+ for i, arch in enumerate(arches):
+ tune_baselib = baselibs[i]
+ abi = abis[i]
+
+ bits = 32
+ if arch == "powerpc":
+ replace_lines("${S}/src/arch-ppc.c", "/lib/ld.so.1", "/" + tune_baselib + "/ld.so.1", d)
+ elif arch == "powerpc64":
+ replace_lines("${S}/src/arch-ppc64.c", "/lib64/ld64.so.1", "/" + tune_baselib + "/ld64.so.1", d)
+ bits = 64
+ elif arch == "x86_64":
+ if abi == "x32":
+ replace_lines("${S}/src/arch-x86_64.c", "/libx32/ld-linux-x32.so.2", "/" + tune_baselib + "/ld-linux-x32.so.2", d)
+ else:
+ replace_lines("${S}/src/arch-x86_64.c", "/lib64/ld-linux-x86-64.so.2", "/" + tune_baselib + "/ld-linux-x86-64.so.2", d)
+ bits = 64
+ elif arch == "arm":
+ replace_lines("${S}/src/arch-arm.c", "/lib/ld-linux.so.3", "/" + tune_baselib + "/ld-linux.so.3", d)
+ replace_lines("${S}/src/arch-arm.c", "/lib/ld-linux-armhf.so.3", "/" + tune_baselib + "/ld-linux-armhf.so.3", d)
+ elif arch == "mips" or arch == "mipsel":
+ replace_lines("${S}/src/arch-mips.c", "/lib/ld.so.1", "/" + tune_baselib + "/ld.so.1", d, firstonly=True)
+ replace_lines("${S}/src/arch-mips.c", "/lib32/ld.so.1", "/" + tune_baselib + "/ld.so.1", d)
+ elif arch == "mips64" or arch == "mips64el":
+ replace_lines("${S}/src/arch-mips.c", "/lib/ld.so.1", "/" + tune_baselib + "/ld.so.1", d, secondonly=True)
+ replace_lines("${S}/src/arch-mips.c", "/lib64/ld.so.1", "/" + tune_baselib + "/ld.so.1", d)
+ bits = 64
+ elif arch.endswith("86"):
+ replace_lines("${S}/src/arch-i386.c", "/lib/ld-linux.so.2", "/" + tune_baselib + "/ld-linux.so.2", d)
+ if bits == 32 and tune_baselib != "lib":
+ replace_lines_rtld("${S}/src/rtld/rtld.c", "lib", tune_baselib, "else", d)
+ if bits == 64 and tune_baselib != "lib64":
+ replace_lines_rtld("${S}/src/rtld/rtld.c", "lib64", tune_baselib, "use_64bit", d)
+}
+
+python () {
+ overrides = d.getVar("OVERRIDES").split(":")
+ if "class-target" in overrides:
+ bb.build.addtask('do_linkerpaths', 'do_configure', 'do_patch', d)
+}
+
+do_configure_prepend () {
+ # Disable documentation!
+ echo "all:" > ${S}/doc/Makefile.am
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/cron.daily ${D}${sysconfdir}/default ${D}${sysconfdir}/rpm
+ install -m 0644 ${WORKDIR}/prelink.conf ${D}${sysconfdir}/prelink.conf
+ install -m 0644 ${WORKDIR}/prelink.cron.daily ${D}${sysconfdir}/cron.daily/prelink
+ install -m 0644 ${WORKDIR}/prelink.default ${D}${sysconfdir}/default/prelink
+ install -m 0644 ${WORKDIR}/macros.prelink ${D}${sysconfdir}/rpm/macros.prelink
+}
+
+# If we ae doing a cross install, we want to avoid prelinking.
+# Prelinking during a cross install should be handled by the image-prelink
+# bbclass. If the user desires this to run on the target at first boot
+# they will need to create a custom boot script.
+pkg_postinst_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 0
+fi
+
+prelink -a
+}
+
+pkg_prerm_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+ exit 1
+fi
+
+prelink -au
+}
+
diff --git a/poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch b/poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
new file mode 100644
index 000000000..43504eaab
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/files/0001-configure-Prune-PIE-flags.patch
@@ -0,0 +1,44 @@
+From b5545c08e6c674c49aef14b47a56a3e92df4d2a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 Feb 2016 07:36:34 +0000
+Subject: [pseudo][PATCH] configure: Prune PIE flags
+
+LDFLAGS are not taken from environment and CFLAGS is used for LDFLAGS
+however when using security options -fpie and -pie options are coming
+as part of ARCH_FLAGS and they get into LDFLAGS of shared objects as
+well so we end up with conflicting options -shared -pie, which gold
+rejects outright and bfd linker lets the one appearning last in cmdline
+take effect. This create quite a unpleasant situation in OE when
+security flags are enabled and gold or not-gold options are used
+it errors out but errors are not same.
+
+Anyway, with this patch we filter pie options from ARCH_FLAGS
+ouright and take control of generating PIC objects
+
+Helps with errors like
+
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: pseudo_client.o: relocation R_X86_64_PC32 against symbol `pseudo_util_debug_flags' can not be used when making a shared object; recompile with -fPIC
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
+| collect2: error: ld returned 1 exit status
+| make: *** [lib/pseudo/lib64/libpseudo.so] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index e5ef9ce..83b0890 100755
+--- a/configure
++++ b/configure
+@@ -339,3 +339,5 @@ sed -e '
+ s,@ARCH@,'"$opt_arch"',g
+ s,@BITS@,'"$opt_bits"',g
+ ' < Makefile.in > Makefile
++
++sed -i -e 's/\-[f]*pie//g' Makefile
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/pseudo/files/fallback-group b/poky/meta/recipes-devtools/pseudo/files/fallback-group
new file mode 100644
index 000000000..bb3dbca60
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/files/fallback-group
@@ -0,0 +1,3 @@
+root:*:0:
+mail:*:8:
+nobody:*:99:
diff --git a/poky/meta/recipes-devtools/pseudo/files/fallback-passwd b/poky/meta/recipes-devtools/pseudo/files/fallback-passwd
new file mode 100644
index 000000000..08611baaf
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/files/fallback-passwd
@@ -0,0 +1,3 @@
+root::0:0:root:/home/root:/bin/sh
+pseudopasswd:*:1:1:this-is-the-pseudo-passwd:/nonexistent:/bin/sh
+nobody:*:65534:65534:nobody:/nonexistent:/bin/sh
diff --git a/poky/meta/recipes-devtools/pseudo/files/moreretries.patch b/poky/meta/recipes-devtools/pseudo/files/moreretries.patch
new file mode 100644
index 000000000..adea2665b
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/files/moreretries.patch
@@ -0,0 +1,19 @@
+Increase the number of retries in pseudo due to occasional slow
+server shutdowns.
+
+Upstream-Status: Pending
+RP 2016/2/28
+
+Index: git/pseudo_client.c
+===================================================================
+--- git.orig/pseudo_client.c
++++ git/pseudo_client.c
+@@ -1282,7 +1282,7 @@ pseudo_client_setup(void) {
+ }
+ }
+
+-#define PSEUDO_RETRIES 20
++#define PSEUDO_RETRIES 250
+ static pseudo_msg_t *
+ pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) {
+ pseudo_msg_t *response = 0;
diff --git a/poky/meta/recipes-devtools/pseudo/files/toomanyfiles.patch b/poky/meta/recipes-devtools/pseudo/files/toomanyfiles.patch
new file mode 100644
index 000000000..bda7e4b20
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/files/toomanyfiles.patch
@@ -0,0 +1,71 @@
+From b0b25fbc041a148d1de09f5a6503cd95973ec77c Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Tue, 25 Apr 2017 15:25:54 +0100
+Subject: [PATCH 3/3] pseudo: Handle too many files deadlock
+
+Currently if we max out the maximum number of files, pseudo can deadlock, unable to
+accept new connections yet unable to move forward and unblock the other processes
+waiting either.
+
+Rather than hang, when this happens, close out inactive connections, allowing us
+to accept the new ones. The disconnected clients will simply reconnect. There is
+a small risk of data loss here sadly but its better than hanging.
+
+RP
+2017/4/25
+
+Upstream-Status: Submitted [Peter is aware of the issue]
+
+---
+ pseudo_server.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/pseudo_server.c b/pseudo_server.c
+index dac3258..15a3e8f 100644
+--- a/pseudo_server.c
++++ b/pseudo_server.c
+@@ -802,6 +802,7 @@ pseudo_server_loop(void) {
+ struct sigaction eat_usr2 = {
+ .sa_handler = set_do_list_clients
+ };
++ int hitmaxfiles;
+
+ clients = malloc(16 * sizeof(*clients));
+
+@@ -820,6 +821,7 @@ pseudo_server_loop(void) {
+ active_clients = 1;
+ max_clients = 16;
+ highest_client = 0;
++ hitmaxfiles = 0;
+
+ pseudo_debug(PDBGF_SERVER, "server loop started.\n");
+ if (listen_fd < 0) {
+@@ -878,10 +880,15 @@ pseudo_server_loop(void) {
+ } else {
+ serve_client(i);
+ }
++ } else if (hitmaxfiles) {
++ /* Only close one per loop iteration in the interests of caution */
++ close_client(i);
++ hitmaxfiles = 0;
+ }
+ if (die_forcefully)
+ break;
+ }
++ hitmaxfiles = 0;
+ if (!die_forcefully &&
+ (FD_ISSET(clients[0].fd, &events) ||
+ FD_ISSET(clients[0].fd, &reads))) {
+@@ -903,6 +910,9 @@ pseudo_server_loop(void) {
+ */
+ pseudo_server_timeout = DEFAULT_PSEUDO_SERVER_TIMEOUT;
+ die_peacefully = 0;
++ } else if (errno == EMFILE) {
++ hitmaxfiles = 1;
++ pseudo_debug(PDBGF_SERVER, "Hit max open files, dropping a client.\n");
+ }
+ }
+ pseudo_debug(PDBGF_SERVER, "server loop complete [%d clients left]\n", active_clients);
+--
+2.15.1
+
diff --git a/poky/meta/recipes-devtools/pseudo/pseudo.inc b/poky/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 000000000..cdc2a5823
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,142 @@
+# Note: Due to the bitbake wrapper script, making changes to pseudo can be
+# difficult. To work around the current version of the wrapper use:
+# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD]
+
+SUMMARY = "Pseudo gives fake root capabilities to a normal user"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/pseudo"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+SECTION = "base"
+LICENSE = "LGPL2.1"
+DEPENDS = "sqlite3 attr"
+
+FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo"
+INSANE_SKIP_${PN} += "libdir"
+INSANE_SKIP_${PN}-dbg += "libdir"
+
+PROVIDES += "virtual/fakeroot"
+
+MAKEOPTS = ""
+
+inherit siteinfo
+
+do_configure () {
+ :
+}
+
+NO32LIBS ??= "1"
+NO32LIBS_class-nativesdk = "1"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback --enable-epoll --enable-xattr"
+
+# Compile for the local machine arch...
+do_compile () {
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ else
+ ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+ fi
+ oe_runmake ${MAKEOPTS}
+}
+do_compile[vardepsexclude] = "SITEINFO_BITS"
+
+maybe_make32() {
+ # We probably don't need to build 32-bit binaries.
+ make32=false
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ case "${NO32LIBS}" in
+ 0) make32=true
+ ;;
+ 1) make32=false
+ ;;
+ *) # If unset, build 32-bit if we think we can.
+ if [ -e "/usr/include/gnu/stubs-32.h" ]; then
+ make32=true
+ fi
+ ;;
+ esac
+ fi
+ if $make32; then
+ if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
+ warn_32bit_missing
+ else
+ bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
+ fi
+ else
+ bbnote "Building/installing only 64-bit libpseudo.so for ${PN}."
+ bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
+ fi
+}
+maybe_make32[vardepsexclude] = "SITEINFO_BITS"
+
+warn_32bit_missing() {
+ bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
+ bbwarn "If the build fails, install 32-bit developer packages."
+ bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+}
+
+# Two below are the same
+# If necessary compile for the alternative machine arch. This is only
+# necessary in a native build.
+do_compile_prepend_class-native () {
+ maybe_make32
+ if $make32; then
+ # We need the 32-bit libpseudo on a 64-bit machine...
+ # Note that this is not well-tested outside of x86/x86_64.
+
+ # if we're being rebuilt due to a dependency change, we need to make sure
+ # everything is clean before we configure and build -- if we haven't previously
+ # built this will fail and be ignored.
+ make ${MAKEOPTS} distclean || :
+
+ ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ save_traps=$(trap)
+ trap 'warn_32bit_missing' 0
+ oe_runmake ${MAKEOPTS} libpseudo
+ eval "$save_traps"
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_compile_prepend_class-nativesdk () {
+ maybe_make32
+ if $make32; then
+ # We need the 32-bit libpseudo on a 64-bit machine.
+ # Note that this is not well-tested outside of x86/x86_64.
+ ./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+ oe_runmake ${MAKEOPTS} libpseudo
+ # prevent it from removing the lib, but remove everything else
+ make 'LIB=foo' ${MAKEOPTS} distclean
+ fi
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
+}
+
+do_install_append_class-native () {
+ install -d ${D}${sysconfdir}
+ # The fallback files should never be modified
+ install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
+ install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+
+ # Two native/nativesdk entries below are the same
+ # If necessary install for the alternative machine arch. This is only
+ # necessary in a native build.
+ maybe_make32
+ if $make32; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+}
+
+do_install_append_class-nativesdk () {
+ maybe_make32
+ if $make32; then
+ mkdir -p ${D}${prefix}/lib/pseudo/lib
+ cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+ fi
+ chrpath -d ${D}${prefix}/lib/pseudo/lib*/libpseudo.so
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/poky/meta/recipes-devtools/pseudo/pseudo_git.bb
new file mode 100644
index 000000000..9103d4911
--- /dev/null
+++ b/poky/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -0,0 +1,14 @@
+require pseudo.inc
+
+SRC_URI = "git://git.yoctoproject.org/pseudo \
+ file://0001-configure-Prune-PIE-flags.patch \
+ file://fallback-passwd \
+ file://fallback-group \
+ file://moreretries.patch \
+ file://toomanyfiles.patch \
+ "
+
+SRCREV = "fddbe854c9db058d5a05830d3bcdd4233d95ee2e"
+S = "${WORKDIR}/git"
+PV = "1.9.0+git${SRCPV}"
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch b/poky/meta/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
new file mode 100644
index 000000000..516ccd7b9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch
@@ -0,0 +1,79 @@
+From c8c6649b29a08f82e1d6761a6d62ce5f632313c5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 10 Dec 2015 13:20:30 +0200
+Subject: [PATCH 1/3] Don't search /usr and so on for libraries by default to
+ avoid host contamination.
+
+Upstream-Status: Inappropriate (As the code stands, this is a hack)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ numpy/distutils/system_info.py | 50 +++++-------------------------------------
+ 1 file changed, 6 insertions(+), 44 deletions(-)
+
+diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
+index bea120c..544e056 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -262,51 +262,13 @@ if sys.platform == 'win32':
+ add_system_root(os.path.join(conda_dir, 'Library'))
+
+ else:
+- default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
+- '/opt/local/lib', '/sw/lib'], platform_bits)
+ default_runtime_dirs = []
+- default_include_dirs = ['/usr/local/include',
+- '/opt/include', '/usr/include',
+- # path of umfpack under macports
+- '/opt/local/include/ufsparse',
+- '/opt/local/include', '/sw/include',
+- '/usr/include/suitesparse']
+- default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
+-
+- default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
+- '/usr/lib'], platform_bits)
+- default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
+- '/usr/include']
+-
+- if os.path.exists('/usr/lib/X11'):
+- globbed_x11_dir = glob('/usr/lib/*/libX11.so')
+- if globbed_x11_dir:
+- x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
+- default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
+- default_x11_include_dirs.extend(['/usr/lib/X11/include',
+- '/usr/include/X11'])
+-
+- import subprocess as sp
+- tmp = None
+- try:
+- # Explicitly open/close file to avoid ResourceWarning when
+- # tests are run in debug mode Python 3.
+- tmp = open(os.devnull, 'w')
+- p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
+- stderr=tmp)
+- except (OSError, DistutilsError):
+- # OSError if gcc is not installed, or SandboxViolation (DistutilsError
+- # subclass) if an old setuptools bug is triggered (see gh-3160).
+- pass
+- else:
+- triplet = str(p.communicate()[0].decode().strip())
+- if p.returncode == 0:
+- # gcc supports the "-print-multiarch" option
+- default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+- default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+- finally:
+- if tmp is not None:
+- tmp.close()
++ default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
++ default_include_dirs = ['/deaddir/include']
++ default_src_dirs = ['.', '/deaddir/src']
++
++ default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
++ default_x11_include_dirs = ['/deaddir/include']
+
+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
+ default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))
+--
+2.16.1
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/0001-npy_cpu-Add-riscv-support.patch b/poky/meta/recipes-devtools/python-numpy/files/0001-npy_cpu-Add-riscv-support.patch
new file mode 100644
index 000000000..4f5c4f5f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/0001-npy_cpu-Add-riscv-support.patch
@@ -0,0 +1,28 @@
+From 30fb1bf9244bb0789c02ec7c98a923acc7200206 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Mar 2018 19:55:21 -0700
+Subject: [PATCH] npy_cpu: Add riscv support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://github.com/numpy/numpy/pull/10761]
+
+ numpy/core/include/numpy/npy_cpu.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
+index 84653ea18..9e88db873 100644
+--- a/numpy/core/include/numpy/npy_cpu.h
++++ b/numpy/core/include/numpy/npy_cpu.h
+@@ -78,6 +78,8 @@
+ #define NPY_CPU_AARCH64
+ #elif defined(__mc68000__)
+ #define NPY_CPU_M68K
++#elif defined(__riscv)
++ #define NPY_CPU_RISCV
+ #elif defined(__arc__) && defined(__LITTLE_ENDIAN__)
+ #define NPY_CPU_ARCEL
+ #elif defined(__arc__) && defined(__BIG_ENDIAN__)
+--
+2.16.2
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h
new file mode 100644
index 000000000..109deb043
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/aarch64/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/aarch64/config.h b/poky/meta/recipes-devtools/python-numpy/files/aarch64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/aarch64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/arm/config.h b/poky/meta/recipes-devtools/python-numpy/files/arm/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/arm/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/arm/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/armeb/config.h b/poky/meta/recipes-devtools/python-numpy/files/armeb/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/armeb/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h
new file mode 100644
index 000000000..c4bf6547f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/armeb/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/fix_shebang_f2py.patch b/poky/meta/recipes-devtools/python-numpy/files/fix_shebang_f2py.patch
new file mode 100644
index 000000000..8be6e4d21
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/fix_shebang_f2py.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Avoids using python from the HOSTs native sysroot for f2py,
+uses TARGET env python instead.
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: numpy-1.11.0/numpy/f2py/setup.py
+===================================================================
+--- numpy-1.11.0.orig/numpy/f2py/setup.py
++++ numpy-1.11.0/numpy/f2py/setup.py
+@@ -37,10 +37,13 @@ def _get_f2py_shebang():
+ should be ``#!python`` rather than ``#!`` followed by the contents of
+ ``sys.executable``.
+ """
+- if set(('bdist_wheel', 'bdist_egg', 'bdist_wininst',
+- 'bdist_rpm')).intersection(sys.argv):
+- return '#!python'
+- return '#!' + sys.executable
++ #if set(('bdist_wheel', 'bdist_egg', 'bdist_wininst',
++ # 'bdist_rpm')).intersection(sys.argv):
++ # return '#!python'
++ #return '#!' + sys.executable
++
++ # On OE, we need to avoid using the HOSTs python-native, we return env python instead
++ return '#!/usr/bin/env python'
+
+
+ def configuration(parent_package='', top_path=None):
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32eb/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h
new file mode 100644
index 000000000..8e2b5d094
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/_numpyconfig.h
@@ -0,0 +1,31 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h
new file mode 100644
index 000000000..48727039a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn32el/config.h
@@ -0,0 +1,138 @@
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h
new file mode 100644
index 000000000..debb39009
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64eb/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h
new file mode 100644
index 000000000..debb39009
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h
new file mode 100644
index 000000000..48727039a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarchn64el/config.h
@@ -0,0 +1,138 @@
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h
new file mode 100644
index 000000000..4c465c216
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 8
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h
new file mode 100644
index 000000000..2f6135adc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32eb/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h
new file mode 100644
index 000000000..17ef186d5
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h
new file mode 100644
index 000000000..0b7cd51af
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/mipsarcho32el/numpyconfig.h
@@ -0,0 +1,18 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ * * This file is generated by numpy/core/setup.pyc. DO NOT EDIT
+ * */
+#define NPY_SIZEOF_SHORT 2
+#define NPY_SIZEOF_INT 4
+#define NPY_SIZEOF_LONG 4
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_LONGDOUBLE 12
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_OFF_T 8
+/* #define CHAR_BIT 8 */
+
diff --git a/poky/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h
new file mode 100644
index 000000000..6e7262ad9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/powerpc/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/powerpc/config.h b/poky/meta/recipes-devtools/python-numpy/files/powerpc/config.h
new file mode 100644
index 000000000..f65d39d5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/powerpc/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h
new file mode 100644
index 000000000..debb39009
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/powerpc64/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/powerpc64/config.h b/poky/meta/recipes-devtools/python-numpy/files/powerpc64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/powerpc64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h
new file mode 100644
index 000000000..109deb043
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/riscv64/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/riscv64/config.h b/poky/meta/recipes-devtools/python-numpy/files/riscv64/config.h
new file mode 100644
index 000000000..c30b868f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/riscv64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h
new file mode 100644
index 000000000..b33036164
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/x86-64/_numpyconfig.h
@@ -0,0 +1,32 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_OFF_T 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_ENABLE_SEPARATE_COMPILATION 1
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x0000000A
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/x86-64/config.h b/poky/meta/recipes-devtools/python-numpy/files/x86-64/config.h
new file mode 100644
index 000000000..0ce63b7d2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/x86-64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/x86/config.h b/poky/meta/recipes-devtools/python-numpy/files/x86/config.h
new file mode 100644
index 000000000..08e41e3d9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/x86/config.h
@@ -0,0 +1,108 @@
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN
+#define HAVE_COS
+#define HAVE_TAN
+#define HAVE_SINH
+#define HAVE_COSH
+#define HAVE_TANH
+#define HAVE_FABS
+#define HAVE_FLOOR
+#define HAVE_CEIL
+#define HAVE_SQRT
+#define HAVE_LOG10
+#define HAVE_LOG
+#define HAVE_EXP
+#define HAVE_ASIN
+#define HAVE_ACOS
+#define HAVE_ATAN
+#define HAVE_FMOD
+#define HAVE_MODF
+#define HAVE_FREXP
+#define HAVE_LDEXP
+#define HAVE_RINT
+#define HAVE_TRUNC
+#define HAVE_EXP2
+#define HAVE_LOG2
+#define HAVE_ATAN2
+#define HAVE_POW
+#define HAVE_NEXTAFTER
+#define HAVE_SINF
+#define HAVE_COSF
+#define HAVE_TANF
+#define HAVE_SINHF
+#define HAVE_COSHF
+#define HAVE_TANHF
+#define HAVE_FABSF
+#define HAVE_FLOORF
+#define HAVE_CEILF
+#define HAVE_RINTF
+#define HAVE_TRUNCF
+#define HAVE_SQRTF
+#define HAVE_LOG10F
+#define HAVE_LOGF
+#define HAVE_LOG1PF
+#define HAVE_EXPF
+#define HAVE_EXPM1F
+#define HAVE_ASINF
+#define HAVE_ACOSF
+#define HAVE_ATANF
+#define HAVE_ASINHF
+#define HAVE_ACOSHF
+#define HAVE_ATANHF
+#define HAVE_HYPOTF
+#define HAVE_ATAN2F
+#define HAVE_POWF
+#define HAVE_FMODF
+#define HAVE_MODFF
+#define HAVE_FREXPF
+#define HAVE_LDEXPF
+#define HAVE_EXP2F
+#define HAVE_LOG2F
+#define HAVE_COPYSIGNF
+#define HAVE_NEXTAFTERF
+#define HAVE_SINL
+#define HAVE_COSL
+#define HAVE_TANL
+#define HAVE_SINHL
+#define HAVE_COSHL
+#define HAVE_TANHL
+#define HAVE_FABSL
+#define HAVE_FLOORL
+#define HAVE_CEILL
+#define HAVE_RINTL
+#define HAVE_TRUNCL
+#define HAVE_SQRTL
+#define HAVE_LOG10L
+#define HAVE_LOGL
+#define HAVE_LOG1PL
+#define HAVE_EXPL
+#define HAVE_EXPM1L
+#define HAVE_ASINL
+#define HAVE_ACOSL
+#define HAVE_ATANL
+#define HAVE_ASINHL
+#define HAVE_ACOSHL
+#define HAVE_ATANHL
+#define HAVE_HYPOTL
+#define HAVE_ATAN2L
+#define HAVE_POWL
+#define HAVE_FMODL
+#define HAVE_MODFL
+#define HAVE_FREXPL
+#define HAVE_LDEXPL
+#define HAVE_EXP2L
+#define HAVE_LOG2L
+#define HAVE_COPYSIGNL
+#define HAVE_NEXTAFTERL
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H
+#define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h b/poky/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h
new file mode 100644
index 000000000..ff7938cd9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/files/x86/numpyconfig.h
@@ -0,0 +1,24 @@
+#ifndef _NPY_NUMPYCONFIG_H_
+#define _NPY_NUMPYCONFIG_H_
+
+#include "_numpyconfig.h"
+
+/*
+ * On Mac OS X, because there is only one configuration stage for all the archs
+ * in universal builds, any macro which depends on the arch needs to be
+ * harcoded
+ */
+#ifdef __APPLE__
+ #undef NPY_SIZEOF_LONG
+ #undef NPY_SIZEOF_PY_INTPTR_T
+
+ #ifdef __LP64__
+ #define NPY_SIZEOF_LONG 8
+ #define NPY_SIZEOF_PY_INTPTR_T 8
+ #else
+ #define NPY_SIZEOF_LONG 4
+ #define NPY_SIZEOF_PY_INTPTR_T 4
+ #endif
+#endif
+
+#endif
diff --git a/poky/meta/recipes-devtools/python-numpy/python-numpy.inc b/poky/meta/recipes-devtools/python-numpy/python-numpy.inc
new file mode 100644
index 000000000..284f21368
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/python-numpy.inc
@@ -0,0 +1,114 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause & BSD-2-Clause & PSF & Apache-2.0 & BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=fc53b33304171d132128ebe82ea4a645"
+
+SRCNAME = "numpy"
+
+SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/v${PV}/${SRCNAME}-${PV}.tar.gz \
+ file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+ file://fix_shebang_f2py.patch \
+ file://0001-npy_cpu-Add-riscv-support.patch \
+ ${CONFIGFILESURI} "
+SRC_URI[md5sum] = "e39878fafb11828983aeec583dda4a06"
+SRC_URI[sha256sum] = "ddbcda194f49e0cf0663fa8131cb9d7a3b876d14dea0047d3c5fdfaf20adbb40"
+
+UPSTREAM_CHECK_URI = "https://github.com/numpy/numpy/releases"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+CONFIGFILESURI ?= ""
+
+CONFIGFILESURI_aarch64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_arm = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_armeb = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32el = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_x86 = " \
+ file://config.h \
+ file://numpyconfig.h \
+"
+CONFIGFILESURI_x86-64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarcho32eb = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64eb = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn64el = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32eb = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_mipsarchn32el = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+CONFIGFILESURI_riscv64 = " \
+ file://config.h \
+ file://_numpyconfig.h \
+"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
+ true
+ cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
+}
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "${PYTHON_PN}-unittest \
+ ${PYTHON_PN}-difflib \
+ ${PYTHON_PN}-pprint \
+ ${PYTHON_PN}-pickle \
+ ${PYTHON_PN}-shell \
+ ${PYTHON_PN}-nose \
+ ${PYTHON_PN}-doctest \
+ ${PYTHON_PN}-datetime \
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-misc \
+ ${PYTHON_PN}-mmap \
+ ${PYTHON_PN}-netclient \
+ ${PYTHON_PN}-numbers \
+ ${PYTHON_PN}-pydoc \
+ ${PYTHON_PN}-pkgutil \
+ ${PYTHON_PN}-email \
+ ${PYTHON_PN}-compression \
+ ${PYTHON_PN}-ctypes \
+ ${PYTHON_PN}-threading \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python-numpy/python-numpy_1.14.2.bb b/poky/meta/recipes-devtools/python-numpy/python-numpy_1.14.2.bb
new file mode 100644
index 000000000..50137895c
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/python-numpy_1.14.2.bb
@@ -0,0 +1,6 @@
+inherit setuptools
+require python-numpy.inc
+
+RDEPENDS_${PN}_class-target_append = " \
+ ${PYTHON_PN}-subprocess \
+"
diff --git a/poky/meta/recipes-devtools/python-numpy/python3-numpy_1.14.2.bb b/poky/meta/recipes-devtools/python-numpy/python3-numpy_1.14.2.bb
new file mode 100644
index 000000000..915e6f8c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python-numpy/python3-numpy_1.14.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-numpy.inc
diff --git a/poky/meta/recipes-devtools/python/python-async.inc b/poky/meta/recipes-devtools/python/python-async.inc
new file mode 100644
index 000000000..6664ab013
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-async.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
+HOMEPAGE = "http://github.com/gitpython-developers/async"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
+
+inherit pypi
+
+SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b"
+SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-threading"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-git.inc b/poky/meta/recipes-devtools/python/python-git.inc
new file mode 100644
index 000000000..8d3769396
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-git.inc
@@ -0,0 +1,32 @@
+SUMMARY = "Python library used to interact with Git repositories"
+DESCRIPTION = "GitPython provides object model read and write access to \
+a git repository. Access repository information conveniently, alter the \
+index directly, handle remotes, or go down to low-level object database \
+access with big-files support."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
+
+PYPI_PACKAGE = "GitPython"
+
+inherit pypi
+
+SRC_URI[md5sum] = "7a94ee1b923fb772a2a0c6649430a17c"
+SRC_URI[sha256sum] = "ad61bc25deadb535b047684d06f3654c001d9415e1971e51c9c20f5b510076e9"
+
+DEPENDS = "${PYTHON_PN}-gitdb"
+
+RDEPENDS_${PN} += " \
+ ${PYTHON_PN}-datetime \
+ ${PYTHON_PN}-gitdb \
+ ${PYTHON_PN}-io \
+ ${PYTHON_PN}-logging \
+ ${PYTHON_PN}-math \
+ ${PYTHON_PN}-netclient \
+ ${PYTHON_PN}-stringold \
+ ${PYTHON_PN}-unittest \
+ ${PYTHON_PN}-unixadmin \
+ git \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-gitdb.inc b/poky/meta/recipes-devtools/python/python-gitdb.inc
new file mode 100644
index 000000000..2d5292e5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-gitdb.inc
@@ -0,0 +1,24 @@
+SUMMARY = "A pure-Python git object database"
+HOMEPAGE = "http://github.com/gitpython-developers/gitdb"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528"
+
+inherit pypi
+
+PYPI_PACKAGE = "gitdb2"
+
+SRC_URI[md5sum] = "d5217eb94ebd36fcec62b929d1f72b00"
+SRC_URI[sha256sum] = "b60e29d4533e5e25bb50b7678bbc187c8f6bcff1344b4f293b2ba55c85795f09"
+
+DEPENDS = "${PYTHON_PN}-async ${PYTHON_PN}-setuptools-native ${PYTHON_PN}-smmap"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-async \
+ ${PYTHON_PN}-compression \
+ ${PYTHON_PN}-crypt \
+ ${PYTHON_PN}-io \
+ ${PYTHON_PN}-mmap \
+ ${PYTHON_PN}-shell \
+ ${PYTHON_PN}-smmap \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-mako.inc b/poky/meta/recipes-devtools/python/python-mako.inc
new file mode 100644
index 000000000..e265bde85
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-mako.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Templating library for Python"
+HOMEPAGE = "http://www.makotemplates.org/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1bb21fa2d2f7a534c884b990430a6863"
+
+PYPI_PACKAGE = "Mako"
+
+inherit pypi
+
+SRC_URI[md5sum] = "5836cc997b1b773ef389bf6629c30e65"
+SRC_URI[sha256sum] = "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae"
+
+RDEPENDS_${PN} = "${PYTHON_PN}-html \
+ ${PYTHON_PN}-netclient \
+ ${PYTHON_PN}-threading \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 000000000..a39247ce7
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+ target_lang=language)
+
+
+- def swig_sources (self, sources, extension):
++ def swig_sources (self, sources, extension=None):
+
+ """Walk the list of source files in 'sources', looking for SWIG
+ interface (.i) files. Run SWIG on all that are found, and
diff --git a/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 000000000..c92469b9b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+ continue
+
+ match = first_line_re.match(first_line)
+- if match:
++ if False: #match:
+ adjust = 1
+ post_interp = match.group(1) or ''
+
diff --git a/poky/meta/recipes-devtools/python/python-native/debug.patch b/poky/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 000000000..361788264
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+Index: Python-2.7.12/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.12.orig/Lib/distutils/unixccompiler.py
++++ Python-2.7.12/Lib/distutils/unixccompiler.py
+@@ -278,6 +278,8 @@ class UnixCCompiler(CCompiler):
+
+
+
++ print "Looking in %s for %s" % (lib, dirs)
++
+ for dir in dirs:
+ shared = os.path.join(dir, shared_f)
+ dylib = os.path.join(dir, dylib_f)
+@@ -298,12 +300,16 @@ class UnixCCompiler(CCompiler):
+ # assuming that *all* Unix C compilers do. And of course I'm
+ # ignoring even GCC's "-static" option. So sue me.
+ if os.path.exists(dylib):
++ print "Found %s" % (dylib)
+ return dylib
+ elif os.path.exists(xcode_stub):
++ print "Found %s" % (xcode_stub)
+ return xcode_stub
+ elif os.path.exists(shared):
++ print "Found %s" % (shared)
+ return shared
+ elif os.path.exists(static):
++ print "Found %s" % (static)
+ return static
+
+ # Oops, didn't find it in *any* of 'dirs'
diff --git a/poky/meta/recipes-devtools/python/python-native/multilib.patch b/poky/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 000000000..af0f173c6
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,235 @@
+Rebased for Python 2.7.9
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+2011/09/29
+The python recipe building was failing because python-native
+could not handle sys.lib var. sys.lib var is defined in the
+multilib patch hence added this multilib.patch for python-native
+recipe.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: Python-2.7.14/Include/pythonrun.h
+===================================================================
+--- Python-2.7.14.orig/Include/pythonrun.h
++++ Python-2.7.14/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.14/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/command/install.py
++++ Python-2.7.14/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.14/Lib/pydoc.py
+===================================================================
+--- Python-2.7.14.orig/Lib/pydoc.py
++++ Python-2.7.14/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.exec_prefix, "lib",
++ basedir=os.path.join(sys.exec_prefix, "sys.lib",
+ "python"+sys.version[0:3])):
+ """Return the location of module docs or None"""
+
+Index: Python-2.7.14/Lib/site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/site.py
++++ Python-2.7.14/Lib/site.py
+@@ -288,13 +288,19 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ return sitepackages
+
+ def addsitepackages(known_paths):
+Index: Python-2.7.14/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_dl.py
++++ Python-2.7.14/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.14/Lib/trace.py
+===================================================================
+--- Python-2.7.14.orig/Lib/trace.py
++++ Python-2.7.14/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -91,6 +91,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -110,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -644,6 +645,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -692,7 +694,7 @@ regen-ast:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.14/Modules/getpath.c
+===================================================================
+--- Python-2.7.14.orig/Modules/getpath.c
++++ Python-2.7.14/Modules/getpath.c
+@@ -100,6 +100,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK "os.py"
+ #endif
+@@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.14/Python/getplatform.c
+===================================================================
+--- Python-2.7.14.orig/Python/getplatform.c
++++ Python-2.7.14/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.14/Python/sysmodule.c
+===================================================================
+--- Python-2.7.14.orig/Python/sysmodule.c
++++ Python-2.7.14/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -758,6 +758,11 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
++
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
diff --git a/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch b/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 000000000..078060b49
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+2014/12/15
+Rebased for python-2.7.9
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -439,9 +439,9 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ # if not cross_compiling:
++ # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+ self.add_multiarch_paths()
+@@ -480,15 +480,15 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++ #if os.path.normpath(sys.prefix) != '/usr' \
++ #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
++ add_dir_to_list(self.compiler.library_dirs,
+ sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
++ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+@@ -761,8 +761,7 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
diff --git a/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
new file mode 100644
index 000000000..202aaf106
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
@@ -0,0 +1,86 @@
+On older versions of Python, sysconfig read the data from both the Makefile and
+the Python.h file generated at build time, created dictionaries with their variables
+and used those when using get_config_var(), now it uses _sysconfigdata.build_time_vars[]
+which contains information from the HOST, erroneous in our case, this patch reverts this
+behavior and uses Python.h and Makefile to get information.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -401,12 +401,66 @@ _config_vars = None
+
+ def _init_posix():
+ """Initialize the module as appropriate for POSIX systems."""
+- # _sysconfigdata is generated at build time, see the sysconfig module
+- from _sysconfigdata import build_time_vars
+- global _config_vars
+- _config_vars = {}
+- _config_vars.update(build_time_vars)
++ g = {}
++ # load the installed Makefile:
++ try:
++ filename = get_makefile_filename()
++ parse_makefile(filename, g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # load the installed pyconfig.h:
++ try:
++ filename = get_config_h_filename()
++ parse_config_h(file(filename), g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # On AIX, there are wrong paths to the linker scripts in the Makefile
++ # -- these paths are relative to the Python source, but when installed
++ # the scripts are in another directory.
++ if python_build:
++ g['LDSHARED'] = g['BLDSHARED']
+
++ elif get_python_version() < '2.1':
++ # The following two branches are for 1.5.2 compatibility.
++ if sys.platform == 'aix4': # what about AIX 3.x ?
++ # Linker script is in the config directory, not in Modules as the
++ # Makefile says.
++ python_lib = get_python_lib(standard_lib=1)
++ ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
++ python_exp = os.path.join(python_lib, 'config', 'python.exp')
++
++ g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
++
++ elif sys.platform == 'beos':
++ # Linker script is in the config directory. In the Makefile it is
++ # relative to the srcdir, which after installation no longer makes
++ # sense.
++ python_lib = get_python_lib(standard_lib=1)
++ linkerscript_path = string.split(g['LDSHARED'])[0]
++ linkerscript_name = os.path.basename(linkerscript_path)
++ linkerscript = os.path.join(python_lib, 'config',
++ linkerscript_name)
++
++ # XXX this isn't the right place to do this: adding the Python
++ # library to the link, if needed, should be in the "build_ext"
++ # command. (It's also needed for non-MS compilers on Windows, and
++ # it's taken care of for them by the 'build_ext.get_libraries()'
++ # method.)
++ g['LDSHARED'] = ("%s -L%s/lib -lpython%s" %
++ (linkerscript, PREFIX, get_python_version()))
++
++ global _config_vars
++ _config_vars = g
+
+ def _init_nt():
+ """Initialize the module as appropriate for NT"""
diff --git a/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch b/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
new file mode 100644
index 000000000..450282912
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/poky/meta/recipes-devtools/python/python-native_2.7.14.bb b/poky/meta/recipes-devtools/python/python-native_2.7.14.bb
new file mode 100644
index 000000000..b822583c5
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native_2.7.14.bb
@@ -0,0 +1,86 @@
+require python.inc
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native gdbm-native db-native"
+PR = "${INC_PR}.1"
+
+SRC_URI += "\
+ file://05-enable-ctypes-cross-build.patch \
+ file://10-distutils-fix-swig-parameter.patch \
+ file://11-distutils-never-modify-shebang-line.patch \
+ file://0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch \
+ file://debug.patch \
+ file://unixccompiler.patch \
+ file://nohostlibs.patch \
+ file://multilib.patch \
+ file://add-md5module-support.patch \
+ file://builddir.patch \
+ file://parallel-makeinst-create-bindir.patch \
+ file://revert_use_of_sysconfigdata.patch \
+ file://fix-gc-alignment.patch \
+ "
+
+S = "${WORKDIR}/Python-${PV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
+
+inherit native
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
+
+EXTRA_OEMAKE = '\
+ LIBC="" \
+ STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+ STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+'
+
+do_configure_append() {
+ autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+# Regenerate all of the generated files
+# This ensures that pgen and friends get created during the compile phase
+do_compile_prepend() {
+ oe_runmake regen-all
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ install -d ${D}${bindir}/${PN}
+ install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+ # Make sure we use /usr/bin/env python
+ for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+ done
+
+ # Add a symlink to the native Python so that scripts can just invoke
+ # "nativepython" and get the right one without needing absolute paths
+ # (these often end up too long for the #! parser in the kernel as the
+ # buffer is 128 bytes long).
+ ln -s python-native/python ${D}${bindir}/nativepython
+
+ # We don't want modules in ~/.local being used in preference to those
+ # installed in the native sysroot, so disable user site support.
+ sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
+}
+
+python(){
+
+ # Read JSON manifest
+ import json
+ pythondir = d.getVar('THISDIR',True)
+ with open(pythondir+'/python/python2-manifest.json') as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ rprovides = d.getVar('RPROVIDES').split()
+
+ # Hardcoded since it cant be python-native-foo, should be python-foo-native
+ pn = 'python'
+
+ for key in python_manifest:
+ pypackage = pn + '-' + key + '-native'
+ if pypackage not in rprovides:
+ rprovides.append(pypackage)
+
+ d.setVar('RPROVIDES', ' '.join(rprovides))
+}
diff --git a/poky/meta/recipes-devtools/python/python-nose.inc b/poky/meta/recipes-devtools/python/python-nose.inc
new file mode 100644
index 000000000..ccec68a0e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-nose.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Extends Python unittest to make testing easier"
+HOMEPAGE = "http://readthedocs.org/docs/nose/"
+DESCRIPTION = "nose extends the test loading and running features of unittest, \
+making it easier to write, find and run tests."
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI[md5sum] = "4d3ad0ff07b61373d2cefc89c5d0b20b"
+SRC_URI[sha256sum] = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"
+
+inherit pypi
+
+RDEPENDS_${PN} = "\
+ ${PYTHON_PN}-unittest \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb b/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
new file mode 100644
index 000000000..6d69d2d62
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-nose.inc
diff --git a/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb b/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb
new file mode 100644
index 000000000..dae89ab5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb
@@ -0,0 +1,8 @@
+require python-scons_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+
+do_install_append() {
+ create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
+}
diff --git a/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb b/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
new file mode 100644
index 000000000..d5084b2d1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=46ddf66004e5be5566367cb525a66fc6"
+
+SRC_URI[md5sum] = "b6a292e251b34b82c203b56cfa3968b3"
+SRC_URI[sha256sum] = "24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173"
+
+UPSTREAM_CHECK_URI = "http://scons.org/pages/download.html"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} = "\
+ python-fcntl \
+ python-io \
+ python-json \
+ python-subprocess \
+ python-shell \
+ python-pprint \
+ "
diff --git a/poky/meta/recipes-devtools/python/python-setuptools.inc b/poky/meta/recipes-devtools/python/python-setuptools.inc
new file mode 100644
index 000000000..74706bf04
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -0,0 +1,48 @@
+SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/setuptools"
+SECTION = "devel/python"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=19;md5=9a33897f1bca1160d7aad3835152e158"
+
+PYPI_PACKAGE_EXT = "zip"
+
+inherit pypi
+
+SRC_URI[md5sum] = "379642a4f17214071fdc1894255d8d11"
+SRC_URI[sha256sum] = "94dc566247f35009ed42c0f4422f2b4f0a032fab1372c8308b864c8f26d93388"
+
+DEPENDS += "${PYTHON_PN}"
+DEPENDS_class-native += "${PYTHON_PN}-native"
+DEPENDS_class-nativesdk += "nativesdk-${PYTHON_PN}"
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR} \
+ --script-dir=${bindir}"
+
+RDEPENDS_${PN}_class-native = "\
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-compression \
+"
+RDEPENDS_${PN} = "\
+ ${PYTHON_PN}-compile \
+ ${PYTHON_PN}-compression \
+ ${PYTHON_PN}-ctypes \
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-email \
+ ${PYTHON_PN}-html \
+ ${PYTHON_PN}-netserver \
+ ${PYTHON_PN}-numbers \
+ ${PYTHON_PN}-pkgutil \
+ ${PYTHON_PN}-plistlib \
+ ${PYTHON_PN}-shell \
+ ${PYTHON_PN}-stringold \
+ ${PYTHON_PN}-threading \
+ ${PYTHON_PN}-unittest \
+ ${PYTHON_PN}-xml \
+"
+
+do_install_prepend() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb b/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb
new file mode 100644
index 000000000..cf9440495
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb
@@ -0,0 +1,9 @@
+require python-setuptools.inc
+
+PROVIDES = "python-distribute"
+
+inherit setuptools
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
diff --git a/poky/meta/recipes-devtools/python/python-six.inc b/poky/meta/recipes-devtools/python/python-six.inc
new file mode 100644
index 000000000..c77498457
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-six.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Python 2 and 3 compatibility library"
+HOMEPAGE = "https://pypi.python.org/pypi/six/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=35cec5bf04dd0820d0a18533ea7c774a"
+
+SRC_URI[md5sum] = "d12789f9baf7e9fb2524c0c64f1773f8"
+SRC_URI[sha256sum] = "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
+
+inherit pypi
+
+RDEPENDS_${PN} = "${PYTHON_PN}-io"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-smmap.inc b/poky/meta/recipes-devtools/python/python-smmap.inc
new file mode 100644
index 000000000..55aa516e0
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-smmap.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Python implementation of a sliding window memory map manager"
+DESCRIPTION = "A pure Python implementation of a sliding memory map to \
+help unifying memory mapped access on 32 and 64 bit systems and to help \
+managing resources more efficiently."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
+
+inherit pypi
+
+SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
+SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-codecs \
+ ${PYTHON_PN}-mmap \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python.inc b/poky/meta/recipes-devtools/python/python.inc
new file mode 100644
index 000000000..979b601bf
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,40 @@
+SUMMARY = "The Python Programming Language"
+HOMEPAGE = "http://www.python.org"
+LICENSE = "PSFv2"
+SECTION = "devel/python"
+# bump this on every change in contrib/python/generate-manifest-2.7.py
+INC_PR = "r1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f741e51de91d4eeea5930b9c3c7fa69d"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "1f6db41ad91d9eb0a6f0c769b8613c5b"
+SRC_URI[sha256sum] = "71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66"
+
+# python recipe is actually python 2.x
+# also, exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>2(\.\d+)+).tar"
+
+CVE_PRODUCT = "python"
+
+PYTHON_MAJMIN = "2.7"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "\
+ --with-threads \
+ --with-pymalloc \
+ --without-cxx-main \
+ --with-signal-module \
+ --enable-shared \
+ --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
+ ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
+ ${PYTHONLSBOPTS} \
+"
+
+do_install_append () {
+ sed -i -e 's:${HOSTTOOLS_DIR}/install:install:g' \
+ -e 's:${HOSTTOOLS_DIR}/mkdir:mkdir:g' \
+ ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
diff --git a/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch b/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
new file mode 100644
index 000000000..502f84980
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
@@ -0,0 +1,51 @@
+From 4cdf2e9df13c6327fcc94d53e4953005543aef3d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 6 Apr 2016 17:43:02 +0300
+Subject: [PATCH 01/10] distutils: set the prefix to be inside staging
+ directory
+
+The proper prefix is inside our staging area.
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Phil Blundell <philb@gnu.org>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Lib/distutils/sysconfig.py | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index de7da1d..f3aacf7 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -75,7 +75,7 @@ def get_python_inc(plat_specific=0, prefix=None):
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
+
+ if os.name == "posix":
+ if python_build:
+@@ -115,12 +115,16 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.prefix or
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ if plat_specific:
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++ else:
++ prefix = PREFIX
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
new file mode 100644
index 000000000..e795a74b9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,100 @@
+We need to ensure our host tools get run during build, not the freshly
+built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Rebased for python-2.7.14
+Signed-off-by: Derek Straka <derek@asterius.io>
+
+Index: Python-2.7.13/Makefile.pre.in
+===================================================================
+--- Python-2.7.13.orig/Makefile.pre.in
++++ Python-2.7.13/Makefile.pre.in
+@@ -245,6 +245,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -512,7 +513,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -663,7 +663,7 @@
+ # Regenerate Include/graminit.h and Python/graminit.c
+ # from Grammar/Grammar using pgen
+ @$(MKDIR_P) Include
+- $(PGEN) $(srcdir)/Grammar/Grammar \
++ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \
+ $(srcdir)/Include/graminit.h \
+ $(srcdir)/Python/graminit.c
+
+@@ -1121,27 +1122,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -350,6 +350,7 @@ class PyBuildExt(build_ext):
+ self.failed.append(ext.name)
+ self.announce('*** WARNING: renaming "%s" since importing it'
+ ' failed: %s' % (ext.name, why), level=3)
++ return
+ assert not self.inplace
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+@@ -574,6 +575,9 @@ class PyBuildExt(build_ext):
+
+ # XXX Omitted modules: gl, pure, dl, SGI-specific modules
+
++ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ]
++ inc_dirs = [ os.getenv("STAGING_INCDIR") ]
++
+ #
+ # The following modules are all pretty straightforward, and compile
+ # on pretty much any POSIXish platform.
diff --git a/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..650ceb595
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We need to supply STAGING_INCDIR here, otherwise the Tk headers
+will not be found.
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+
+diff --git a/setup.py b/setup.py
+index 8fe1fb8..67eda74 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1892,7 +1892,7 @@ class PyBuildExt(build_ext):
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1911,22 +1911,6 @@ class PyBuildExt(build_ext):
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
new file mode 100644
index 000000000..5cc874246
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,27 @@
+Rebased for python 2.7.9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt@emdete.de>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -2028,12 +2028,12 @@ class PyBuildExt(build_ext):
+
+ # Pass empty CFLAGS because we'll just append the resulting
+ # CFLAGS to Python's; -g or -O2 is to be avoided.
+- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+
+ res = os.system(cmd)
+ if res or not os.path.exists(ffi_configfile):
+- print "Failed to configure _ctypes module"
++ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+ return False
+
+ fficonfig = {}
diff --git a/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
new file mode 100644
index 000000000..435b31901
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The poison directories patch has detected library path issue while
+compiling the python in cross environment, as seen bellow.
+
+warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
+
+This Patch fixes this issue in the python build environment.
+11 Oct 2010
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+2011/09/29
+Rebased for python 2.7.2
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/setup.py b/setup.py
+index 67eda74..59c537e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -761,12 +761,10 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
diff --git a/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..329734064
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
+
+When building x86->x86 the system will try to execute .so and related items
+from the default PYTHONPATH. This will fail if the target CPU contains
+instructions that the host CPU does not have, add CROSSPYTHONPATH
+into PYTHONPATH so we can prepend the list to find correct libs.
+
+Upstream-Status: Inappropriate [OE-Core integration specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -36,7 +36,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/poky/meta/recipes-devtools/python/python/add-md5module-support.patch b/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
new file mode 100644
index 000000000..33fea7755
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: Python-2.7.2/Modules/Setup.dist
+===================================================================
+--- Python-2.7.2.orig/Modules/Setup.dist 2011-06-11 08:46:26.000000000 -0700
++++ Python-2.7.2/Modules/Setup.dist 2011-12-27 15:51:41.244623219 -0800
+@@ -248,7 +248,7 @@
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
diff --git a/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..287095f61
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,29 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1783,10 +1783,12 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ ## # Uncomment these lines if you want to play with xxmodule.c
+ ## ext = Extension('xx', ['xxmodule.c'])
diff --git a/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
new file mode 100644
index 000000000..8ba582301
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
@@ -0,0 +1,23 @@
+sunaudiodev module is sunos specific so we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1671,8 +1671,9 @@ class PyBuildExt(build_ext):
+ if host_platform == 'sunos5':
+ # SunOS specific modules
+ exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
+- else:
+- missing.append('sunaudiodev')
++ # If platform is not sunos warning is useless
++ #else:
++ # missing.append('sunaudiodev')
+
+ if host_platform == 'darwin':
+ # _scproxy
diff --git a/poky/meta/recipes-devtools/python/python/builddir.patch b/poky/meta/recipes-devtools/python/python/builddir.patch
new file mode 100644
index 000000000..ad629a022
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/builddir.patch
@@ -0,0 +1,46 @@
+When cross compiling python, we used to need to install the Makefile, pyconfig.h
+and the python library to their final location before being able to compile the
+rest of python. This change allows us to point python at its own source when
+building, avoiding a variety of sysroot staging issues and simplifying the main
+python recipe.
+
+Upstream-Status: Inappropriate
+RP 2012/11/13
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -93,6 +93,7 @@ _PREFIX = os.path.normpath(sys.prefix)
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
+
+ def _safe_realpath(path):
+ try:
+@@ -100,7 +101,9 @@ def _safe_realpath(path):
+ except OSError:
+ return path
+
+-if sys.executable:
++if _PYTHONBUILDDIR:
++ _PROJECT_BASE = _PYTHONBUILDDIR
++elif sys.executable:
+ _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
+ else:
+ # sys.executable can be empty if argv[0] has been changed and Python is
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -26,6 +26,9 @@ EXEC_PREFIX = os.path.normpath(sys.exec_
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+ # it'll live in project/PCbuild/amd64.
+ project_base = os.path.dirname(os.path.abspath(sys.executable))
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
++if _PYTHONBUILDDIR:
++ project_base = _PYTHONBUILDDIR
+ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
+ project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
+ # PC/VS7.1
diff --git a/poky/meta/recipes-devtools/python/python/cgi_py.patch b/poky/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 000000000..e6d6c65bb
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
@@ -0,0 +1,57 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date: Sun Mar 25 02:02:27 2012 +0200
+
+This patch was added for 64bit host machines. In the compile process python
+is checking if platform is a 64bit platform using sys.maxint which is the host's
+value. The patch fixes this issue so that python would check if TARGET machine
+is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules
+built if HOST machine is 64bit but the target machine is 32bit.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Upstream-Status: Pending
+
+Index: Python-2.7.11/setup.py
+===================================================================
+--- Python-2.7.11.orig/setup.py
++++ Python-2.7.11/setup.py
+@@ -35,6 +35,21 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+
++def target_is_64bit_platform ():
++ """
++ In case of cross-compile, some modules are not build as setup checks if HOST
++ is 64bit and not TARGET.
++ As python was built for TARGET we can check this in pyconfig.h in this way:
++ Sizeof LONG on a 32 bit platform is 4 bytes
++ Sizeof LONG on a 64 bit platform is 8 bytes
++ """
++ pyconf = open("pyconfig.h").read()
++ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf)
++ if aux is not None:
++ return True
++ else:
++ return False
++
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+ 1) 'dir' is not already in 'dirlist'
+@@ -716,7 +731,7 @@ class PyBuildExt(build_ext):
+ exts.append( Extension('audioop', ['audioop.c']) )
+
+ # Disabled on 64-bit platforms
+- if sys.maxsize != 9223372036854775807L:
++ if not target_is_64bit_platform():
+ # Operations on images
+ exts.append( Extension('imageop', ['imageop.c']) )
+ else:
+@@ -1545,7 +1560,7 @@ class PyBuildExt(build_ext):
+ missing.append('_codecs_%s' % loc)
+
+ # Dynamic loading module
+- if sys.maxint == 0x7fffffff:
++ if not target_is_64bit_platform():
+ # This requires sizeof(int) == sizeof(long) == sizeof(char*)
+ dl_inc = find_file('dlfcn.h', [], inc_dirs)
+ if (dl_inc is not None) and (host_platform not in ['atheos']):
diff --git a/poky/meta/recipes-devtools/python/python/create_manifest2.py b/poky/meta/recipes-devtools/python/python/create_manifest2.py
new file mode 100644
index 000000000..e7450452b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/create_manifest2.py
@@ -0,0 +1,277 @@
+# This script is used as a bitbake task to create a new python manifest
+# $ bitbake python -c create_manifest
+#
+# Our goal is to keep python-core as small as posible and add other python
+# packages only when the user needs them, hence why we split upstream python
+# into several packages.
+#
+# In a very simplistic way what this does is:
+# Launch python and see specifically what is required for it to run at a minimum
+#
+# Go through the python-manifest file and launch a separate task for every single
+# one of the files on each package, this task will check what was required for that
+# specific module to run, these modules will be called dependencies.
+# The output of such task will be a list of the modules or dependencies that were
+# found for that file.
+#
+# Such output will be parsed by this script, we will look for each dependency on the
+# manifest and if we find that another package already includes it, then we will add
+# that package as an RDEPENDS to the package we are currently checking; in case we dont
+# find the current dependency on any other package we will add it to the current package
+# as part of FILES.
+#
+#
+# This way we will create a new manifest from the data structure that was built during
+# this process, ont this new manifest each package will contain specifically only
+# what it needs to run.
+#
+# There are some caveats which we try to deal with, such as repeated files on different
+# packages, packages that include folders, wildcards, and special packages.
+# Its also important to note that this method only works for python files, and shared
+# libraries. Static libraries, header files and binaries need to be dealt with manually.
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+import sys
+import subprocess
+import json
+import os
+
+# Hack to get native python search path (for folders), not fond of it but it works for now
+pivot='recipe-sysroot-native'
+for p in sys.path:
+ if pivot in p:
+ nativelibfolder=p[:p.find(pivot)+len(pivot)]
+
+# Empty dict to hold the whole manifest
+new_manifest = {}
+
+# Check for repeated files, folders and wildcards
+allfiles=[]
+repeated=[]
+wildcards=[]
+
+hasfolders=[]
+allfolders=[]
+
+def isFolder(value):
+ if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')):
+ return True
+ else:
+ return False
+
+# Read existing JSON manifest
+with open('python2-manifest.json') as manifest:
+ old_manifest=json.load(manifest)
+
+
+# First pass to get core-package functionality, because we base everything on the fact that core is actually working
+# Not exactly the same so it should not be a function
+print ("Getting dependencies for core package:")
+
+# Special call to check for core package
+output = subprocess.check_output([sys.executable, 'get_module_deps2.py', 'python-core-package'])
+for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+for value in old_manifest['core']['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ # Ignore binaries, since we don't import those, assume it was added correctly (manually)
+ if '${bindir}' in value:
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps2.py', '%s' % value])
+ for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if item not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(item)
+
+# We check which packages include folders
+for key in old_manifest:
+ for value in old_manifest[key]['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ print ('%s is a folder' % value)
+ if key not in hasfolders:
+ hasfolders.append(key)
+ if value not in allfolders:
+ allfolders.append(value)
+
+for key in old_manifest:
+ # Use an empty dict as data structure to hold data for each package and fill it up
+ new_manifest[key]={}
+ new_manifest[key]['files']=[]
+ new_manifest[key]['rdepends']=[]
+ # All packages should depend on core
+ if key != 'core':
+ new_manifest[key]['rdepends'].append('core')
+ new_manifest[key]['summary']=old_manifest[key]['summary']
+
+ # Handle special cases, we assume that when they were manually added
+ # to the manifest we knew what we were doing.
+ print ('Handling package %s' % key)
+ special_packages=['misc', 'modules', 'dev']
+ if key in special_packages or 'staticdev' in key:
+ print('Passing %s package directly' % key)
+ new_manifest[key]=old_manifest[key]
+ continue
+
+ for value in old_manifest[key]['files']:
+ # We already handled core on the first pass
+ if key == 'core':
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass folders directly
+ new_manifest[key]['files'].append(value)
+ # Ignore binaries, since we don't import those
+ if '${bindir}' in value:
+ # Pass it directly to the new manifest data structure
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps2.py', '%s' % value])
+
+ # We can print dependencies for debugging purposes
+ #print (output)
+ # Output will have all dependencies
+ for item in output.split():
+
+ # Warning: This first part is ugly
+ # One of the dependencies that was found, could be inside of one of the folders included by another package
+ # We need to check if this happens so we can add the package containing the folder as an RDEPENDS
+ # e.g. Folder encodings contained in codecs
+ # This would be solved if no packages included any folders
+
+ # This can be done in two ways:
+ # 1 - We assume that if we take out the filename from the path we would get
+ # the folder string, then we would check if folder string is in the list of folders
+ # This would not work if a package contains a folder which contains another folder
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # folder_string would not match any value contained in the list of folders
+ #
+ # 2 - We do it the other way around, checking if the folder is contained in the path
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # is folder_string inside path/folder1/folder2/filename?,
+ # Yes, it works, but we waste a couple of milliseconds.
+
+ inFolders=False
+ for folder in allfolders:
+ if folder in item:
+ inFolders = True # Did we find a folder?
+ folderFound = False # Second flag to break inner for
+ # Loop only through packages which contain folders
+ for keyfolder in hasfolders:
+ if (folderFound == False):
+ #print("Checking folder %s on package %s" % (item,keyfolder))
+ for file_folder in old_manifest[keyfolder]['files']:
+ if file_folder==folder:
+ print ('%s found in %s' % (folder, keyfolder))
+ folderFound = True
+ if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
+ new_manifest[key]['rdepends'].append(keyfolder)
+ else:
+ break
+
+ # A folder was found so we're done with this item, we can go on
+ if inFolders:
+ continue
+
+ # We might already have it on the dictionary since it could depend on a (previously checked) module
+ if item not in new_manifest[key]['files']:
+ # Handle core as a special package, we already did it so we pass it to NEW data structure directly
+ if key=='core':
+ print('Adding %s to %s FILES' % (item, key))
+ if item.endswith('*'):
+ wildcards.append(item)
+ new_manifest[key]['files'].append(item)
+
+ # Check for repeated files
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ else:
+
+ # Check if this dependency is already contained on another package, so we add it
+ # as an RDEPENDS, or if its not, it means it should be contained on the current
+ # package, so we should add it to FILES
+ for newkey in old_manifest:
+ # Debug
+ #print("Checking %s " % item + " in %s" % newkey)
+ if item in old_manifest[newkey]['files']:
+ # Since were nesting, we need to check its not the same key
+ if(newkey!=key):
+ if newkey not in new_manifest[key]['rdepends']:
+ # Add it to the new manifest data struct
+ # Debug
+ print('Adding %s to %s RDEPENDS, because it contains %s' % (newkey, key, item))
+ new_manifest[key]['rdepends'].append(newkey)
+ break
+ else:
+ # Debug
+ print('Adding %s to %s FILES' % (item, key))
+ # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package
+ new_manifest[key]['files'].append(item)
+ if item.endswith('*'):
+ wildcards.append(item)
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+print ('The following files are repeated (contained in more than one package), please check which package should get it:')
+print (repeated)
+print('The following files contain wildcards, please check they are necessary')
+print(wildcards)
+print('The following files contain folders, please check they are necessary')
+print(hasfolders)
+
+# Sort it just so it looks nice
+for key in new_manifest:
+ new_manifest[key]['files'].sort()
+ new_manifest[key]['rdepends'].sort()
+
+# Create the manifest from the data structure that was built
+with open('python2-manifest.json.new','w') as outfile:
+ json.dump(new_manifest,outfile,sort_keys=True, indent=4, separators=(',', ': '))
diff --git a/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch b/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch
new file mode 100644
index 000000000..b63cd0874
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Fix for over-aligned GC info
+Patch by Florian Weimer
+
+See: https://bugzilla.redhat.com/show_bug.cgi?id=1540316
+Upstream discussion: https://mail.python.org/pipermail/python-dev/2018-January/152000.html
+
+diff --git a/Include/objimpl.h b/Include/objimpl.h
+index 55e83eced6..aa906144dc 100644
+--- a/Include/objimpl.h
++++ b/Include/objimpl.h
+@@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
+ /* for source compatibility with 2.2 */
+ #define _PyObject_GC_Del PyObject_GC_Del
+
++/* Former over-aligned definition of PyGC_Head, used to compute the
++ size of the padding for the new version below. */
++union _gc_head;
++union _gc_head_old {
++ struct {
++ union _gc_head *gc_next;
++ union _gc_head *gc_prev;
++ Py_ssize_t gc_refs;
++ } gc;
++ long double dummy;
++};
++
+ /* GC information is stored BEFORE the object structure. */
+ typedef union _gc_head {
+ struct {
+@@ -255,7 +267,8 @@ typedef union _gc_head {
+ union _gc_head *gc_prev;
+ Py_ssize_t gc_refs;
+ } gc;
+- long double dummy; /* force worst-case alignment */
++ double dummy; /* force worst-case alignment */
++ char dummy_padding[sizeof(union _gc_head_old)];
+ } PyGC_Head;
+
+ extern PyGC_Head *_PyGC_generation0;
+ \ No newline at end of file
diff --git a/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
new file mode 100644
index 000000000..60d782cd2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
@@ -0,0 +1,34 @@
+Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -846,14 +846,19 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
+
+ .PHONY: test testall testuniversal buildbottest pythoninfo
+
+-TESTOPTS= -l $(EXTRATESTOPTS)
++TESTOPTS= -l -v $(EXTRATESTOPTS)
+ TESTPROG= $(srcdir)/Lib/test/regrtest.py
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test: @DEF_MAKE_RULE@ platform
+- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
++TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
++test: build-test
++ $(MAKE) runtest-TESTS
++
++runtest-TESTS:
++ -find $(srcdir) -name '*.py[co]' -print | xargs rm -f
+ -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+
++build-test: @DEF_MAKE_RULE@ platform
++
+ testall: @DEF_MAKE_RULE@ platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) $(srcdir)/Lib/compileall.py
diff --git a/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..5f7309367
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -9,7 +9,7 @@ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+@@ -67,7 +67,7 @@ _INSTALL_SCHEMES = {
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -1046,27 +1046,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH}$(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/poky/meta/recipes-devtools/python/python/get_module_deps2.py b/poky/meta/recipes-devtools/python/python/get_module_deps2.py
new file mode 100644
index 000000000..73e7c6f6d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/get_module_deps2.py
@@ -0,0 +1,112 @@
+# This script is launched on separate task for each python module
+# It checks for dependencies for that specific module and prints
+# them out, the output of this execution will have all dependencies
+# for a specific module, which will be parsed an dealt on create_manifest.py
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+# We can get a log per module, for all the dependencies that were found, but its messy.
+debug=False
+
+import sys
+
+# We can get a list of the modules which are currently required to run python
+# so we run python-core and get its modules, we then import what we need
+# and check what modules are currently running, if we substract them from the
+# modules we had initially, we get the dependencies for the module we imported.
+
+# We use importlib to achieve this, so we also need to know what modules importlib needs
+import importlib
+
+core_deps=set(sys.modules)
+
+def fix_path(dep_path):
+ import os
+ # We DONT want the path on our HOST system
+ pivot='recipe-sysroot-native'
+ dep_path=dep_path[dep_path.find(pivot)+len(pivot):]
+
+ if '/usr/bin' in dep_path:
+ dep_path = dep_path.replace('/usr/bin''${bindir}')
+
+ # Handle multilib, is there a better way?
+ if '/usr/lib32' in dep_path:
+ dep_path = dep_path.replace('/usr/lib32','${libdir}')
+ if '/usr/lib64' in dep_path:
+ dep_path = dep_path.replace('/usr/lib64','${libdir}')
+ if '/usr/lib' in dep_path:
+ dep_path = dep_path.replace('/usr/lib','${libdir}')
+ if '/usr/include' in dep_path:
+ dep_path = dep_path.replace('/usr/include','${includedir}')
+ if '__init__.' in dep_path:
+ dep_path = os.path.split(dep_path)[0]
+
+ # If a *.pyc file was imported, we replace it with *.py (since we deal with PYCs on create_manifest)
+ if '.pyc' in dep_path:
+ dep_path = dep_path.replace('.pyc','.py')
+
+ return dep_path
+
+# Module to import was passed as an argument
+current_module = str(sys.argv[1]).rstrip()
+if(debug==True):
+ log = open('log_%s' % current_module,'w')
+ log.write('Module %s generated the following dependencies:\n' % current_module)
+try:
+ importlib.import_module('%s' % current_module)
+except ImportError as e:
+ if (debug==True):
+ log.write('Module was not found')
+ pass
+
+
+# Get current module dependencies, dif will contain a list of specific deps for this module
+module_deps=set(sys.modules)
+
+# We handle the core package (1st pass on create_manifest.py) as a special case
+if current_module == 'python-core-package':
+ dif = core_deps
+else:
+ dif = module_deps-core_deps
+
+
+# Check where each dependency came from
+for item in dif:
+ dep_path=''
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n')
+ dep_path = sys.modules['%s' % item].__file__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __file__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'dep_path' is not defined
+ # because module is not found (wasn't compiled?), e.g. bddsm
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+
+ # Site-customize is a special case since we (OpenEmbedded) put it there manually
+ if 'sitecustomize' in dep_path:
+ dep_path = '${libdir}/python2.7/sitecustomize.py'
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+ continue
+
+ dep_path = fix_path(dep_path)
+
+ if (debug==True):
+ log.write(dep_path+'\n')
+
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+
+if debug==True:
+ log.close()
diff --git a/poky/meta/recipes-devtools/python/python/host_include_contamination.patch b/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
new file mode 100644
index 000000000..e0aafb218
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+diff --git a/setup.py b/setup.py
+index ba2d242..bf859be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -393,6 +393,8 @@ class PyBuildExt(build_ext):
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if os.environ.get('CROSS_COMPILE') is not None:
++ return
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/poky/meta/recipes-devtools/python/python/multilib.patch b/poky/meta/recipes-devtools/python/python/multilib.patch
new file mode 100644
index 000000000..1116dd518
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,298 @@
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+Upstream-Status: Pending
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -758,6 +758,10 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+Index: Python-2.7.14/Include/pythonrun.h
+===================================================================
+--- Python-2.7.14.orig/Include/pythonrun.h
++++ Python-2.7.14/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.14/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/command/install.py
++++ Python-2.7.14/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -41,8 +43,8 @@ else:
+
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+- 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.14/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.14/Lib/distutils/sysconfig.py
+@@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
+- libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ if plat_specific or standard_lib:
++ lib = sys.lib
++ else:
++ lib = "lib"
++ libpython = os.path.join(prefix, lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+Index: Python-2.7.14/Lib/pydoc.py
+===================================================================
+--- Python-2.7.14.orig/Lib/pydoc.py
++++ Python-2.7.14/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.exec_prefix, "lib",
++ basedir=os.path.join(sys.exec_prefix, "sys.lib",
+ "python"+sys.version[0:3])):
+ """Return the location of module docs or None"""
+
+Index: Python-2.7.14/Lib/site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/site.py
++++ Python-2.7.14/Lib/site.py
+@@ -288,13 +288,18 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ return sitepackages
+
+ def addsitepackages(known_paths):
+Index: Python-2.7.14/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.14.orig/Lib/sysconfig.py
++++ Python-2.7.14/Lib/sysconfig.py
+@@ -7,10 +7,10 @@ from os.path import pardir, realpath
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+ 'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+Index: Python-2.7.14/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_dl.py
++++ Python-2.7.14/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.14/Lib/test/test_site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_site.py
++++ Python-2.7.14/Lib/test/test_site.py
+@@ -252,12 +252,16 @@ class HelperFunctionsTests(unittest.Test
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+ # OS X, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ 'site-packages')
+- self.assertEqual(dirs[0], wanted)
++ self.assertTrue(wanted in dirs)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+- self.assertEqual(dirs[1], wanted)
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
++ 'site-packages')
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'site-python')
++ self.assertTrue(wanted in dirs)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+Index: Python-2.7.14/Lib/trace.py
+===================================================================
+--- Python-2.7.14.orig/Lib/trace.py
++++ Python-2.7.14/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -91,6 +91,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -110,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -645,6 +646,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -693,7 +695,7 @@ regen-ast:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.14/Modules/getpath.c
+===================================================================
+--- Python-2.7.14.orig/Modules/getpath.c
++++ Python-2.7.14/Modules/getpath.c
+@@ -100,6 +100,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK "os.py"
+ #endif
+@@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.14/Python/getplatform.c
+===================================================================
+--- Python-2.7.14.orig/Python/getplatform.c
++++ Python-2.7.14/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.14/Python/sysmodule.c
+===================================================================
+--- Python-2.7.14.orig/Python/sysmodule.c
++++ Python-2.7.14/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
diff --git a/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
new file mode 100644
index 000000000..abab41e95
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
@@ -0,0 +1,19 @@
+When using make -j with the 'install' target, it's possible for altbininstall
+(which normally creates BINDIR) and libainstall (which doesn't, though it
+installs python-config there) to race, resulting in a failure due to
+attempting to install python-config into a nonexistent BINDIR. Ensure it also
+exists in the libainstall target.
+
+Upstream-Status: Pending
+
+--- Python-2.7.3.orig/Makefile.pre.in
++++ Python-2.7.3/Makefile.pre.in
+@@ -1187,7 +1187,7 @@
+ LIBPC= $(LIBDIR)/pkgconfig
+
+ libainstall: @DEF_MAKE_RULE@ python-config
+- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
++ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
diff --git a/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch b/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
new file mode 100644
index 000000000..44fcaacf3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
@@ -0,0 +1,82 @@
+From 71447f04979b267f8866573b67a4340b2719d799 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 4 Aug 2017 14:10:43 +0800
+Subject: [PATCH] setup.py: pass missing libraries to Extension for multiprocessing module
+
+In the following commit:
+...
+commit e711cafab13efc9c1fe6c5cd75826401445eb585
+Author: Benjamin Peterson <benjamin@python.org>
+Date: Wed Jun 11 16:44:04 2008 +0000
+
+ Merged revisions 64104,64117 via svnmerge from
+ svn+ssh://pythondev@svn.python.org/python/trunk
+...
+(see diff in setup.py)
+It assigned libraries for multiprocessing module according
+the host_platform, but not pass it to Extension.
+
+In glibc, the following commit caused two definition of
+sem_getvalue are different.
+https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524
+(see diff in nptl/sem_getvalue.c for detail)
+`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1
+and `__old_sem_getvalue' is to compat the old version
+sem_getvalue@GLIBC_2.0.
+
+To build python for embedded Linux systems:
+http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html
+If not explicitly link to library pthread (-lpthread), it will
+load glibc's sem_getvalue randomly at runtime.
+
+Such as build python on linux x86_64 host and run the python
+on linux x86_32 target. If not link library pthread, it caused
+multiprocessing bounded semaphore could not work correctly.
+...
+>>> import multiprocessing
+>>> pool_sema = multiprocessing.BoundedSemaphore(value=1)
+>>> pool_sema.acquire()
+True
+>>> pool_sema.release()
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ValueError: semaphore or lock released too many times
+...
+
+And the semaphore issue also caused multiprocessing.Queue().put() hung.
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/2999]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ setup.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 54054c2..9646bfc 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1586,8 +1586,10 @@ class PyBuildExt(build_ext):
+ elif host_platform.startswith('netbsd'):
+ macros = dict()
+ libraries = []
+-
+- else: # Linux and other unices
++ elif host_platform.startswith(('linux')):
++ macros = dict()
++ libraries = ['pthread']
++ else: # Other unices
+ macros = dict()
+ libraries = ['rt']
+
+@@ -1610,6 +1612,7 @@ class PyBuildExt(build_ext):
+ if sysconfig.get_config_var('WITH_THREAD'):
+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+ define_macros=macros.items(),
++ libraries=libraries,
+ include_dirs=["Modules/_multiprocessing"]))
+ else:
+ missing.append('_multiprocessing')
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
new file mode 100644
index 000000000..216be0a44
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Remove the RPATH to avoid QA issue warning.
+
+RP: Added secondary unnecessary rpath to the list 2012/8/7
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+
+Index: Python-2.7.3/setup.py
+===================================================================
+--- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000
++++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000
+@@ -1042,7 +1042,6 @@
+ exts.append(Extension('_bsddb', ['_bsddb.c'],
+ depends = ['bsddb.h'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ libraries=dblibs))
+ else:
+@@ -1252,7 +1251,6 @@
+ print "building dbm using bdb"
+ dbmext = Extension('dbm', ['dbmmodule.c'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ define_macros=[
+ ('HAVE_BERKDB_H', None),
diff --git a/poky/meta/recipes-devtools/python/python/python2-manifest.json b/poky/meta/recipes-devtools/python/python/python2-manifest.json
new file mode 100644
index 000000000..723e5138e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/python2-manifest.json
@@ -0,0 +1,1047 @@
+{
+ "2to3": {
+ "files": [
+ "${bindir}/2to3",
+ "${libdir}/python2.7/lib2to3"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python automated Python 2 to 3 code translator"
+ },
+ "argparse": {
+ "files": [
+ "${libdir}/python2.7/argparse.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "textutils"
+ ],
+ "summary": "Python command line argument parser"
+ },
+ "audio": {
+ "files": [
+ "${libdir}/python2.7/audiodev.py",
+ "${libdir}/python2.7/chunk.py",
+ "${libdir}/python2.7/lib-dynload/audioop.so",
+ "${libdir}/python2.7/lib-dynload/ossaudiodev.so",
+ "${libdir}/python2.7/sndhdr.py",
+ "${libdir}/python2.7/sunau.py",
+ "${libdir}/python2.7/sunaudio.py",
+ "${libdir}/python2.7/toaiff.py",
+ "${libdir}/python2.7/wave.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "math"
+ ],
+ "summary": "Python Audio Handling"
+ },
+ "bsddb": {
+ "files": [
+ "${libdir}/python2.7/bsddb",
+ "${libdir}/python2.7/lib-dynload/_bsddb.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python bindings for the Berkeley Database"
+ },
+ "codecs": {
+ "files": [
+ "${libdir}/python2.7/gettext.py",
+ "${libdir}/python2.7/lib-dynload/_codecs_cn.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_hk.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_iso2022.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_jp.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_kr.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_tw.so",
+ "${libdir}/python2.7/lib-dynload/_multibytecodec.so",
+ "${libdir}/python2.7/lib-dynload/unicodedata.so",
+ "${libdir}/python2.7/locale.py",
+ "${libdir}/python2.7/stringprep.py",
+ "${libdir}/python2.7/xdrlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python codec"
+ },
+ "compile": {
+ "files": [
+ "${libdir}/python2.7/compileall.py",
+ "${libdir}/python2.7/py_compile.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python bytecode compilation support"
+ },
+ "compiler": {
+ "files": [
+ "${libdir}/python2.7/compiler"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python compiler support"
+ },
+ "compression": {
+ "files": [
+ "${libdir}/python2.7/gzip.py",
+ "${libdir}/python2.7/lib-dynload/bz2.so",
+ "${libdir}/python2.7/tarfile.py",
+ "${libdir}/python2.7/zipfile.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "shell",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python high-level compression support"
+ },
+ "contextlib": {
+ "files": [
+ "${libdir}/python2.7/contextlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "lang"
+ ],
+ "summary": "Python utilities for with-statementcontexts."
+ },
+ "core": {
+ "files": [
+ "${bindir}/python*",
+ "${includedir}/python2.7/pyconfig*.h",
+ "${libdir}/python2.7/ConfigParser.py",
+ "${libdir}/python2.7/UserDict.py",
+ "${libdir}/python2.7/UserList.py",
+ "${libdir}/python2.7/UserString.py",
+ "${libdir}/python2.7/__future__.py",
+ "${libdir}/python2.7/_abcoll.py",
+ "${libdir}/python2.7/_sysconfigdata.py",
+ "${libdir}/python2.7/_weakrefset.py",
+ "${libdir}/python2.7/abc.py",
+ "${libdir}/python2.7/ast.py",
+ "${libdir}/python2.7/atexit.py",
+ "${libdir}/python2.7/codecs.py",
+ "${libdir}/python2.7/collections.py",
+ "${libdir}/python2.7/copy.py",
+ "${libdir}/python2.7/copy_reg.py",
+ "${libdir}/python2.7/encodings",
+ "${libdir}/python2.7/encodings/aliases.py",
+ "${libdir}/python2.7/encodings/utf_8.py",
+ "${libdir}/python2.7/genericpath.py",
+ "${libdir}/python2.7/getopt.py",
+ "${libdir}/python2.7/heapq.py",
+ "${libdir}/python2.7/importlib",
+ "${libdir}/python2.7/keyword.py",
+ "${libdir}/python2.7/lib-dynload/_collections.so",
+ "${libdir}/python2.7/lib-dynload/_heapq.so",
+ "${libdir}/python2.7/lib-dynload/_locale.so",
+ "${libdir}/python2.7/lib-dynload/_struct.so",
+ "${libdir}/python2.7/lib-dynload/binascii.so",
+ "${libdir}/python2.7/lib-dynload/itertools.so",
+ "${libdir}/python2.7/lib-dynload/operator.so",
+ "${libdir}/python2.7/lib-dynload/readline.so",
+ "${libdir}/python2.7/lib-dynload/strop.so",
+ "${libdir}/python2.7/lib-dynload/time.so",
+ "${libdir}/python2.7/lib-dynload/xreadlines.so",
+ "${libdir}/python2.7/linecache.py",
+ "${libdir}/python2.7/new.py",
+ "${libdir}/python2.7/os.py",
+ "${libdir}/python2.7/platform.py",
+ "${libdir}/python2.7/posixpath.py",
+ "${libdir}/python2.7/re.py",
+ "${libdir}/python2.7/rlcompleter.py",
+ "${libdir}/python2.7/site.py",
+ "${libdir}/python2.7/sitecustomize.py",
+ "${libdir}/python2.7/sre_compile.py",
+ "${libdir}/python2.7/sre_constants.py",
+ "${libdir}/python2.7/sre_parse.py",
+ "${libdir}/python2.7/stat.py",
+ "${libdir}/python2.7/string.py",
+ "${libdir}/python2.7/struct.py",
+ "${libdir}/python2.7/sysconfig.py",
+ "${libdir}/python2.7/traceback.py",
+ "${libdir}/python2.7/types.py",
+ "${libdir}/python2.7/warnings.py",
+ "${libdir}/python2.7/weakref.py"
+ ],
+ "rdepends": [],
+ "summary": "Python interpreter and core modules"
+ },
+ "crypt": {
+ "files": [
+ "${libdir}/python2.7/hashlib.py",
+ "${libdir}/python2.7/lib-dynload/_hashlib.so",
+ "${libdir}/python2.7/lib-dynload/crypt.so",
+ "${libdir}/python2.7/md5.py",
+ "${libdir}/python2.7/sha.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic cryptographic and hashing support"
+ },
+ "ctypes": {
+ "files": [
+ "${libdir}/python2.7/ctypes",
+ "${libdir}/python2.7/lib-dynload/_ctypes.so",
+ "${libdir}/python2.7/lib-dynload/_ctypes_test.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python C types support"
+ },
+ "curses": {
+ "files": [
+ "${libdir}/python2.7/curses",
+ "${libdir}/python2.7/lib-dynload/_curses.so",
+ "${libdir}/python2.7/lib-dynload/_curses_panel.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python curses support"
+ },
+ "datetime": {
+ "files": [
+ "${libdir}/python2.7/_strptime.py",
+ "${libdir}/python2.7/calendar.py",
+ "${libdir}/python2.7/lib-dynload/datetime.so"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang"
+ ],
+ "summary": "Python calendar and time support"
+ },
+ "db": {
+ "files": [
+ "${libdir}/python2.7/anydbm.py",
+ "${libdir}/python2.7/dbhash.py",
+ "${libdir}/python2.7/dumbdbm.py",
+ "${libdir}/python2.7/lib-dynload/dbm.so",
+ "${libdir}/python2.7/whichdb.py"
+ ],
+ "rdepends": [
+ "bsddb",
+ "core",
+ "gdbm"
+ ],
+ "summary": "Python file-based database support"
+ },
+ "debugger": {
+ "files": [
+ "${libdir}/python2.7/bdb.py",
+ "${libdir}/python2.7/pdb.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang",
+ "pprint",
+ "shell"
+ ],
+ "summary": "Python debugger"
+ },
+ "dev": {
+ "files": [
+ "${base_libdir}/*.a",
+ "${base_libdir}/*.o",
+ "${datadir}/aclocal",
+ "${datadir}/pkgconfig",
+ "${includedir}",
+ "${libdir}/*.a",
+ "${libdir}/*.la",
+ "${libdir}/*.o",
+ "${libdir}/lib*${SOLIBSDEV}",
+ "${libdir}/pkgconfig",
+ "${libdir}/python2.7/config/Makefile"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python development package"
+ },
+ "difflib": {
+ "files": [
+ "${libdir}/python2.7/difflib.py"
+ ],
+ "rdepends": [
+ "core",
+ "lang"
+ ],
+ "summary": "Python helpers for computing deltas between objects"
+ },
+ "distutils": {
+ "files": [
+ "${libdir}/python2.7/config",
+ "${libdir}/python2.7/distutils"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Distribution Utilities"
+ },
+ "distutils-staticdev": {
+ "files": [
+ "${libdir}/python2.7/config/lib*.a"
+ ],
+ "rdepends": [
+ "distutils"
+ ],
+ "summary": "Python distribution utilities (static libraries)"
+ },
+ "doctest": {
+ "files": [
+ "${libdir}/python2.7/doctest.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "debugger",
+ "difflib",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "pprint",
+ "shell",
+ "unittest"
+ ],
+ "summary": "Python framework for running examples in docstrings"
+ },
+ "email": {
+ "files": [
+ "${libdir}/python2.7/email",
+ "${libdir}/python2.7/imaplib.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "netclient",
+ "pickle",
+ "subprocess",
+ "textutils"
+ ],
+ "summary": "Python email support"
+ },
+ "fcntl": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/fcntl.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python's fcntl interface"
+ },
+ "gdbm": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/gdbm.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python GNU database support"
+ },
+ "hotshot": {
+ "files": [
+ "${libdir}/python2.7/hotshot",
+ "${libdir}/python2.7/lib-dynload/_hotshot.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python hotshot performance profiler"
+ },
+ "html": {
+ "files": [
+ "${libdir}/python2.7/HTMLParser.py",
+ "${libdir}/python2.7/formatter.py",
+ "${libdir}/python2.7/htmlentitydefs.py",
+ "${libdir}/python2.7/htmllib.py",
+ "${libdir}/python2.7/markupbase.py",
+ "${libdir}/python2.7/sgmllib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python HTML processing support"
+ },
+ "idle": {
+ "files": [
+ "${bindir}/idle",
+ "${libdir}/python2.7/idlelib"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Integrated Development Environment"
+ },
+ "image": {
+ "files": [
+ "${libdir}/python2.7/colorsys.py",
+ "${libdir}/python2.7/imghdr.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python graphical image handling"
+ },
+ "io": {
+ "files": [
+ "${libdir}/python2.7/StringIO.py",
+ "${libdir}/python2.7/_pyio.py",
+ "${libdir}/python2.7/io.py",
+ "${libdir}/python2.7/lib-dynload/_io.so",
+ "${libdir}/python2.7/lib-dynload/_socket.so",
+ "${libdir}/python2.7/lib-dynload/_ssl.so",
+ "${libdir}/python2.7/lib-dynload/cStringIO.so",
+ "${libdir}/python2.7/lib-dynload/select.so",
+ "${libdir}/python2.7/lib-dynload/termios.so",
+ "${libdir}/python2.7/pipes.py",
+ "${libdir}/python2.7/socket.py",
+ "${libdir}/python2.7/ssl.py",
+ "${libdir}/python2.7/tempfile.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "lang",
+ "math",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python low-level I/O"
+ },
+ "json": {
+ "files": [
+ "${libdir}/python2.7/json",
+ "${libdir}/python2.7/lib-dynload/_json.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python JSON support"
+ },
+ "lang": {
+ "files": [
+ "${libdir}/python2.7/bisect.py",
+ "${libdir}/python2.7/code.py",
+ "${libdir}/python2.7/codeop.py",
+ "${libdir}/python2.7/dis.py",
+ "${libdir}/python2.7/functools.py",
+ "${libdir}/python2.7/inspect.py",
+ "${libdir}/python2.7/lib-dynload/_bisect.so",
+ "${libdir}/python2.7/lib-dynload/_functools.so",
+ "${libdir}/python2.7/lib-dynload/array.so",
+ "${libdir}/python2.7/lib-dynload/parser.so",
+ "${libdir}/python2.7/opcode.py",
+ "${libdir}/python2.7/repr.py",
+ "${libdir}/python2.7/symbol.py",
+ "${libdir}/python2.7/token.py",
+ "${libdir}/python2.7/tokenize.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python low-level language support"
+ },
+ "logging": {
+ "files": [
+ "${libdir}/python2.7/logging"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "threading"
+ ],
+ "summary": "Python logging support"
+ },
+ "mailbox": {
+ "files": [
+ "${libdir}/python2.7/mailbox.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "contextlib",
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python mailbox format support"
+ },
+ "math": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_random.so",
+ "${libdir}/python2.7/lib-dynload/cmath.so",
+ "${libdir}/python2.7/lib-dynload/math.so",
+ "${libdir}/python2.7/random.py",
+ "${libdir}/python2.7/sets.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt"
+ ],
+ "summary": "Python math support"
+ },
+ "mime": {
+ "files": [
+ "${libdir}/python2.7/MimeWriter.py",
+ "${libdir}/python2.7/mimetools.py",
+ "${libdir}/python2.7/mimetypes.py",
+ "${libdir}/python2.7/quopri.py",
+ "${libdir}/python2.7/rfc822.py",
+ "${libdir}/python2.7/uu.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python MIME handling APIs"
+ },
+ "mmap": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/mmap.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python memory-mapped file support"
+ },
+ "modules": {
+ "files": [],
+ "rdepends": [
+ "2to3",
+ "argparse",
+ "audio",
+ "bsddb",
+ "codecs",
+ "compile",
+ "compiler",
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "ctypes",
+ "curses",
+ "datetime",
+ "db",
+ "debugger",
+ "difflib",
+ "distutils",
+ "doctest",
+ "email",
+ "fcntl",
+ "gdbm",
+ "hotshot",
+ "html",
+ "idle",
+ "image",
+ "io",
+ "json",
+ "lang",
+ "logging",
+ "mailbox",
+ "math",
+ "mime",
+ "mmap",
+ "multiprocessing",
+ "netclient",
+ "netserver",
+ "numbers",
+ "pickle",
+ "pkgutil",
+ "plistlib",
+ "pprint",
+ "profile",
+ "pydoc",
+ "re",
+ "resource",
+ "robotparser",
+ "runpy",
+ "shell",
+ "smtpd",
+ "sqlite3",
+ "sqlite3",
+ "stringold",
+ "subprocess",
+ "syslog",
+ "terminal",
+ "textutils",
+ "threading",
+ "tkinter",
+ "unittest",
+ "unixadmin",
+ "xml",
+ "xmlrpc",
+ "zlib"
+ ],
+ "summary": "All Python modules"
+ },
+ "multiprocessing": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_multiprocessing.so",
+ "${libdir}/python2.7/multiprocessing"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "pickle",
+ "subprocess",
+ "threading"
+ ],
+ "summary": "Python multiprocessing support"
+ },
+ "netclient": {
+ "files": [
+ "${libdir}/python2.7/Cookie.py",
+ "${libdir}/python2.7/_LWPCookieJar.py",
+ "${libdir}/python2.7/_MozillaCookieJar.py",
+ "${libdir}/python2.7/base64.py",
+ "${libdir}/python2.7/cookielib.py",
+ "${libdir}/python2.7/ftplib.py",
+ "${libdir}/python2.7/hmac.py",
+ "${libdir}/python2.7/httplib.py",
+ "${libdir}/python2.7/nntplib.py",
+ "${libdir}/python2.7/poplib.py",
+ "${libdir}/python2.7/smtplib.py",
+ "${libdir}/python2.7/telnetlib.py",
+ "${libdir}/python2.7/urllib.py",
+ "${libdir}/python2.7/urllib2.py",
+ "${libdir}/python2.7/urlparse.py",
+ "${libdir}/python2.7/uuid.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "contextlib",
+ "core",
+ "crypt",
+ "ctypes",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "pickle",
+ "subprocess",
+ "textutils",
+ "threading"
+ ],
+ "summary": "Python Internet Protocol clients"
+ },
+ "netserver": {
+ "files": [
+ "${libdir}/python2.7/BaseHTTPServer.py",
+ "${libdir}/python2.7/CGIHTTPServer.py",
+ "${libdir}/python2.7/SimpleHTTPServer.py",
+ "${libdir}/python2.7/SocketServer.py",
+ "${libdir}/python2.7/cgi.py"
+ ],
+ "rdepends": [
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "shell",
+ "textutils",
+ "threading",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python Internet Protocol servers"
+ },
+ "numbers": {
+ "files": [
+ "${libdir}/python2.7/decimal.py",
+ "${libdir}/python2.7/fractions.py",
+ "${libdir}/python2.7/numbers.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "math",
+ "threading"
+ ],
+ "summary": "Python number APIs"
+ },
+ "pickle": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/cPickle.so",
+ "${libdir}/python2.7/pickle.py",
+ "${libdir}/python2.7/pickletools.py",
+ "${libdir}/python2.7/shelve.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python serialisation/persistence support"
+ },
+ "pkgutil": {
+ "files": [
+ "${libdir}/python2.7/pkgutil.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python package extension utility support"
+ },
+ "plistlib": {
+ "files": [
+ "${libdir}/python2.7/plistlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime",
+ "io"
+ ],
+ "summary": "Generate and parse Mac OS X .plist files"
+ },
+ "pprint": {
+ "files": [
+ "${libdir}/python2.7/pprint.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python pretty-print support"
+ },
+ "profile": {
+ "files": [
+ "${libdir}/python2.7/cProfile.py",
+ "${libdir}/python2.7/lib-dynload/_lsprof.so",
+ "${libdir}/python2.7/profile.py",
+ "${libdir}/python2.7/pstats.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "resource",
+ "textutils"
+ ],
+ "summary": "Python basic performance profiling support"
+ },
+ "pydoc": {
+ "files": [
+ "${bindir}/pydoc",
+ "${libdir}/python2.7/pydoc.py",
+ "${libdir}/python2.7/pydoc_data"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "pkgutil"
+ ],
+ "summary": "Python interactive help support"
+ },
+ "re": {
+ "files": [
+ "${libdir}/python2.7/sre.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Regular Expression APIs"
+ },
+ "resource": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/resource.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python resource control interface"
+ },
+ "robotparser": {
+ "files": [
+ "${libdir}/python2.7/robotparser.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "io",
+ "lang",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python robots.txt parser"
+ },
+ "runpy": {
+ "files": [
+ "${libdir}/python2.7/runpy.py"
+ ],
+ "rdepends": [
+ "core",
+ "pkgutil"
+ ],
+ "summary": "Python helper for locating/executing scripts in module namespace"
+ },
+ "shell": {
+ "files": [
+ "${libdir}/python2.7/cmd.py",
+ "${libdir}/python2.7/commands.py",
+ "${libdir}/python2.7/dircache.py",
+ "${libdir}/python2.7/fnmatch.py",
+ "${libdir}/python2.7/glob.py",
+ "${libdir}/python2.7/popen2.py",
+ "${libdir}/python2.7/shlex.py",
+ "${libdir}/python2.7/shutil.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "io",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python shell-like functionality"
+ },
+ "smtpd": {
+ "files": [
+ "${bindir}/smtpd.py",
+ "${libdir}/python2.7/asynchat.py",
+ "${libdir}/python2.7/asyncore.py",
+ "${libdir}/python2.7/smtpd.py"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "lang"
+ ],
+ "summary": "Python Simple Mail Transport Daemon"
+ },
+ "sqlite3": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_sqlite3.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Sqlite3 database support"
+ },
+ "sqlite3-tests": {
+ "files": [
+ "${libdir}/python2.7/sqlite3/test"
+ ],
+ "rdepends": [
+ "core",
+ "tests"
+ ],
+ "summary": "Python Sqlite3 database support tests"
+ },
+ "stringold": {
+ "files": [
+ "${libdir}/python2.7/stringold.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python string APIs [deprecated]"
+ },
+ "subprocess": {
+ "files": [
+ "${libdir}/python2.7/subprocess.py"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "pickle"
+ ],
+ "summary": "Python subprocess support"
+ },
+ "syslog": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/syslog.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python syslog interface"
+ },
+ "terminal": {
+ "files": [
+ "${libdir}/python2.7/pty.py",
+ "${libdir}/python2.7/tty.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python terminal controlling support"
+ },
+ "tests": {
+ "files": [
+ "${libdir}/python2.7/test"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python tests"
+ },
+ "textutils": {
+ "files": [
+ "${libdir}/python2.7/csv.py",
+ "${libdir}/python2.7/lib-dynload/_csv.so",
+ "${libdir}/python2.7/optparse.py",
+ "${libdir}/python2.7/textwrap.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python option parsin"
+ },
+ "threading": {
+ "files": [
+ "${libdir}/python2.7/Queue.py",
+ "${libdir}/python2.7/_threading_local.py",
+ "${libdir}/python2.7/dummy_thread.py",
+ "${libdir}/python2.7/dummy_threading.py",
+ "${libdir}/python2.7/mutex.py",
+ "${libdir}/python2.7/threading.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python threading & synchronization support"
+ },
+ "tkinter": {
+ "files": [
+ "${libdir}/python2.7/lib-tk"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Tcl/Tk bindings"
+ },
+ "unittest": {
+ "files": [
+ "${libdir}/python2.7/unittest"
+ ],
+ "rdepends": [
+ "core",
+ "difflib",
+ "io",
+ "lang",
+ "pprint",
+ "shell"
+ ],
+ "summary": "Python unit testing framework"
+ },
+ "unixadmin": {
+ "files": [
+ "${libdir}/python2.7/getpass.py",
+ "${libdir}/python2.7/lib-dynload/grp.so",
+ "${libdir}/python2.7/lib-dynload/nis.so"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python Unix administration support"
+ },
+ "xml": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_elementtree.so",
+ "${libdir}/python2.7/lib-dynload/pyexpat.so",
+ "${libdir}/python2.7/xml"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic XML support"
+ },
+ "xmlrpc": {
+ "files": [
+ "${libdir}/python2.7/DocXMLRPCServer.py",
+ "${libdir}/python2.7/SimpleXMLRPCServer.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "datetime",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "netserver",
+ "pkgutil",
+ "pydoc",
+ "textutils",
+ "threading",
+ "xml",
+ "zlib"
+ ],
+ "summary": "Python XML-RPC support"
+ },
+ "zlib": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/zlib.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python zlib compression support"
+ }
+}
diff --git a/poky/meta/recipes-devtools/python/python/run-ptest b/poky/meta/recipes-devtools/python/python/run-ptest
new file mode 100644
index 000000000..a2f9eed44
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+#This script is used to run python test suites
+
+make -f LIBDIR/python/ptest/Makefile -k runtest-TESTS srcdir=LIBDIR/python2.7 TESTPROG=LIBDIR/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
diff --git a/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
new file mode 100644
index 000000000..dacb552ec
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
@@ -0,0 +1,35 @@
+python should search for db.h in inc_dirs and not in a hardcoded path.
+If db.h is found but HASHVERSION is not 2 we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+
+diff --git a/setup.py b/setup.py
+index b887808..ae51607 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1237,6 +1237,8 @@ class PyBuildExt(build_ext):
+ # the more recent berkeleydb's db.h file first in the include path
+ # when attempting to compile and it will fail.
+ f = "/usr/include/db.h"
++ if len(inc_dirs) != 0:
++ f = os.path.join(inc_dirs[0], "db.h")
+
+ if host_platform == 'darwin':
+ if is_macosx_sdk_path(f):
+@@ -1257,8 +1259,10 @@ class PyBuildExt(build_ext):
+ libraries=libraries))
+ else:
+ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+- else:
+- missing.append('bsddb185')
++ # If a newer version is detected don't report an useless
++ # warning
++ #else:
++ # missing.append('bsddb185')
+ else:
+ missing.append('bsddb185')
+
diff --git a/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 000000000..6ccdb948b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
@@ -0,0 +1,27 @@
+This patch skips over the 'import check' setup.py does when building
+extensions. This generally won't work when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500
++++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500
+@@ -287,6 +287,15 @@
+ (ext.name, sys.exc_info()[1]))
+ self.failed.append(ext.name)
+ return
++
++ # If we're cross-compiling, we want to skip the import check
++ # i.e. we shouldn't be dynamically loading target shared libs
++ if os.environ.get('CROSS_COMPILE') is not None:
++ self.announce(
++ 'WARNING: skipping import check for cross-compiled "%s"' %
++ ext.name)
++ return
++
+ # Workaround for Mac OS X: The Carbon-based modules cannot be
+ # reliably imported into a command-line Python
+ if 'Carbon' in ext.extra_link_args:
diff --git a/poky/meta/recipes-devtools/python/python/setuptweaks.patch b/poky/meta/recipes-devtools/python/python/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/poky/meta/recipes-devtools/python/python/sitecustomize.py b/poky/meta/recipes-devtools/python/python/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch b/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
new file mode 100644
index 000000000..12651798e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
@@ -0,0 +1,34 @@
+The compiled .pyc files contain time stamp corresponding to the compile time.
+This prevents binary reproducibility. This patch allows to achieve binary
+reproducibility by overriding the build time stamp by the value
+exported via SOURCE_DATE_EPOCH.
+
+Patch by Bernhard M. Wiedemann
+
+Upstream-Status: Backport
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Fri Feb 24 17:08:25 UTC 2017 - bwiedemann@suse.com
+
+- Add reproducible.patch to allow reproducible builds of various
+ python packages like python-amqp
+ Upstream: https://github.com/python/cpython/pull/296
+
+
+@@ -0,0 +1,15 @@
+Index: Python-2.7.13/Lib/py_compile.py
+===================================================================
+--- Python-2.7.13.orig/Lib/py_compile.py
++++ Python-2.7.13/Lib/py_compile.py
+@@ -108,6 +108,10 @@ def compile(file, cfile=None, dfile=None
+ timestamp = long(os.fstat(f.fileno()).st_mtime)
+ except AttributeError:
+ timestamp = long(os.stat(file).st_mtime)
++ sde = os.environ.get('SOURCE_DATE_EPOCH')
++ if sde and timestamp > int(sde):
++ timestamp = int(sde)
++ os.utime(file, (timestamp, timestamp))
+ codestring = f.read()
+ try:
+ codeobject = __builtin__.compile(codestring, dfile or file,'exec')
diff --git a/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
new file mode 100644
index 000000000..fb4a3bcf9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
@@ -0,0 +1,21 @@
+Python tries to use ncursesw from the host,
+if it is not found causes an error on configure,
+we should use ncursesw from sysroot instead
+
+Upstream-Status: Pending
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -4311,7 +4311,7 @@ fi
+
+ # first curses configure check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb b/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb
new file mode 100644
index 000000000..0da5fdecd
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-async.inc
diff --git a/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb b/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb
new file mode 100644
index 000000000..19cbae91a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Python bindings for the DBus inter-process communication system"
+SECTION = "devel/python"
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b03240518994df6d8c974675675e5ca4"
+DEPENDS = "expat dbus dbus-glib virtual/libintl"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
+"
+
+RSRC_URI[md5sum] = "1ce1ddf2582060f8f971652ea54cc17e"
+SRC_URI[sha256sum] = "32f29c17172cdb9cb61c68b1f1a71dfe7351506fc830869029c47449bd04faeb"
+S = "${WORKDIR}/dbus-python-${PV}"
+
+inherit distutils3-base autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python3-docutils-native"
+PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python3-docutils-native python3-epydoc-native"
+
+RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml"
+
+FILES_${PN}-dev += "${libdir}/pkgconfig"
diff --git a/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb b/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
new file mode 100644
index 000000000..81a449d64
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Text processing system for documentation"
+HOMEPAGE = "http://docutils.sourceforge.net"
+SECTION = "devel/python"
+LICENSE = "PSF & BSD-2-Clause & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=35a23d42b615470583563132872c97d6"
+
+DEPENDS = "python3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "c53768d63db3873b7d452833553469de"
+SRC_URI[sha256sum] = "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils3
+
+BBCLASSEXTEND = "native"
+
diff --git a/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb b/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb
new file mode 100644
index 000000000..ac320fa56
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb
@@ -0,0 +1,2 @@
+require python-git.inc
+inherit setuptools3
diff --git a/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb b/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb
new file mode 100644
index 000000000..fe158327c
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-gitdb.inc
diff --git a/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch b/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
new file mode 100644
index 000000000..44090a20d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
@@ -0,0 +1,552 @@
+From 8a98e4d44a5e59439a4b6bd95368cc362412c995 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 24 Mar 2017 18:06:08 +0200
+Subject: [PATCH] Add python 3 compatibility.
+
+Taken from
+http://pkgs.fedoraproject.org/cgit/rpms/python-iniparse.git/tree/python-iniparse-python3-compat.patch
+
+Upstream-Status: Inappropriate [upstream is defunct]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ iniparse/__init__.py | 20 ++++++++++----------
+ iniparse/compat.py | 30 ++++++++++++++++--------------
+ iniparse/config.py | 16 ++++++++--------
+ iniparse/configparser.py | 7 +++++++
+ iniparse/ini.py | 20 ++++++++++++--------
+ iniparse/utils.py | 4 ++--
+ tests/__init__.py | 14 +++++++-------
+ tests/test_compat.py | 23 +++++++++++++++--------
+ tests/test_fuzz.py | 18 +++++++++---------
+ tests/test_ini.py | 8 ++++----
+ tests/test_misc.py | 4 ++--
+ tests/test_tidy.py | 2 +-
+ tests/test_unicode.py | 10 +++++-----
+ 13 files changed, 98 insertions(+), 78 deletions(-)
+ create mode 100644 iniparse/configparser.py
+
+diff --git a/iniparse/__init__.py b/iniparse/__init__.py
+index 8de756f..7193f92 100644
+--- a/iniparse/__init__.py
++++ b/iniparse/__init__.py
+@@ -3,17 +3,17 @@
+ # Copyright (c) 2007 Tim Lauridsen <tla@rasmil.dk>
+ # All Rights Reserved. See LICENSE-PSF & LICENSE for details.
+
+-from ini import INIConfig, change_comment_syntax
+-from config import BasicConfig, ConfigNamespace
+-from compat import RawConfigParser, ConfigParser, SafeConfigParser
+-from utils import tidy
++from .ini import INIConfig, change_comment_syntax
++from .config import BasicConfig, ConfigNamespace
++from .compat import RawConfigParser, ConfigParser, SafeConfigParser
++from .utils import tidy
+
+-from ConfigParser import DuplicateSectionError, \
+- NoSectionError, NoOptionError, \
+- InterpolationMissingOptionError, \
+- InterpolationDepthError, \
+- InterpolationSyntaxError, \
+- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError, \
++ NoSectionError, NoOptionError, \
++ InterpolationMissingOptionError, \
++ InterpolationDepthError, \
++ InterpolationSyntaxError, \
++ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+
+ __all__ = [
+ 'BasicConfig', 'ConfigNamespace',
+diff --git a/iniparse/compat.py b/iniparse/compat.py
+index db89ed8..f95c25c 100644
+--- a/iniparse/compat.py
++++ b/iniparse/compat.py
+@@ -12,19 +12,21 @@ The underlying INIConfig object can be accessed as cfg.data
+ """
+
+ import re
+-from ConfigParser import DuplicateSectionError, \
+- NoSectionError, NoOptionError, \
+- InterpolationMissingOptionError, \
+- InterpolationDepthError, \
+- InterpolationSyntaxError, \
+- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError, \
++ NoSectionError, NoOptionError, \
++ InterpolationMissingOptionError, \
++ InterpolationDepthError, \
++ InterpolationSyntaxError, \
++ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+
+ # These are imported only for compatiability.
+ # The code below does not reference them directly.
+-from ConfigParser import Error, InterpolationError, \
+- MissingSectionHeaderError, ParsingError
++from .configparser import Error, InterpolationError, \
++ MissingSectionHeaderError, ParsingError
+
+-import ini
++import six
++
++from . import ini
+
+ class RawConfigParser(object):
+ def __init__(self, defaults=None, dict_type=dict):
+@@ -56,7 +58,7 @@ class RawConfigParser(object):
+ # The default section is the only one that gets the case-insensitive
+ # treatment - so it is special-cased here.
+ if section.lower() == "default":
+- raise ValueError, 'Invalid section name: %s' % section
++ raise ValueError('Invalid section name: %s' % section)
+
+ if self.has_section(section):
+ raise DuplicateSectionError(section)
+@@ -88,7 +90,7 @@ class RawConfigParser(object):
+ filename may also be given.
+ """
+ files_read = []
+- if isinstance(filenames, basestring):
++ if isinstance(filenames, six.string_types):
+ filenames = [filenames]
+ for filename in filenames:
+ try:
+@@ -143,7 +145,7 @@ class RawConfigParser(object):
+ def getboolean(self, section, option):
+ v = self.get(section, option)
+ if v.lower() not in self._boolean_states:
+- raise ValueError, 'Not a boolean: %s' % v
++ raise ValueError('Not a boolean: %s' % v)
+ return self._boolean_states[v.lower()]
+
+ def has_option(self, section, option):
+@@ -234,7 +236,7 @@ class ConfigParser(RawConfigParser):
+ if "%(" in value:
+ try:
+ value = value % vars
+- except KeyError, e:
++ except KeyError as e:
+ raise InterpolationMissingOptionError(
+ option, section, rawval, e.args[0])
+ else:
+@@ -283,7 +285,7 @@ class SafeConfigParser(ConfigParser):
+ _badpercent_re = re.compile(r"%[^%]|%$")
+
+ def set(self, section, option, value):
+- if not isinstance(value, basestring):
++ if not isinstance(value, six.string_types):
+ raise TypeError("option values must be strings")
+ # check for bad percent signs:
+ # first, replace all "good" interpolations
+diff --git a/iniparse/config.py b/iniparse/config.py
+index 5cfa2ea..3b28549 100644
+--- a/iniparse/config.py
++++ b/iniparse/config.py
+@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
+
+ >>> n.aaa = 42
+ >>> del n.x
+- >>> print n
++ >>> print(n)
+ aaa = 42
+ name.first = paramjit
+ name.last = oberoi
+@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
+
+ >>> isinstance(n.name, ConfigNamespace)
+ True
+- >>> print n.name
++ >>> print(n.name)
+ first = paramjit
+ last = oberoi
+ >>> sorted(list(n.name))
+@@ -160,7 +160,7 @@ class BasicConfig(ConfigNamespace):
+
+ Finally, values can be read from a file as follows:
+
+- >>> from StringIO import StringIO
++ >>> from six import StringIO
+ >>> sio = StringIO('''
+ ... # comment
+ ... ui.height = 100
+@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
+ ... ''')
+ >>> n = BasicConfig()
+ >>> n._readfp(sio)
+- >>> print n
++ >>> print(n)
+ complexity = medium
+ data.secret.password = goodness=gracious me
+ have_python
+@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
+
+ def __str__(self, prefix=''):
+ lines = []
+- keys = self._data.keys()
++ keys = list(self._data.keys())
+ keys.sort()
+ for name in keys:
+ value = self._data[name]
+@@ -258,7 +258,7 @@ def update_config(target, source):
+ >>> n.ui.display_clock = True
+ >>> n.ui.display_qlength = True
+ >>> n.ui.width = 150
+- >>> print n
++ >>> print(n)
+ playlist.expand_playlist = True
+ ui.display_clock = True
+ ui.display_qlength = True
+@@ -267,7 +267,7 @@ def update_config(target, source):
+ >>> from iniparse import ini
+ >>> i = ini.INIConfig()
+ >>> update_config(i, n)
+- >>> print i
++ >>> print(i)
+ [playlist]
+ expand_playlist = True
+ <BLANKLINE>
+@@ -277,7 +277,7 @@ def update_config(target, source):
+ width = 150
+
+ """
+- for name in source:
++ for name in sorted(source):
+ value = source[name]
+ if isinstance(value, ConfigNamespace):
+ if name in target:
+diff --git a/iniparse/configparser.py b/iniparse/configparser.py
+new file mode 100644
+index 0000000..c543d50
+--- /dev/null
++++ b/iniparse/configparser.py
+@@ -0,0 +1,7 @@
++try:
++ from ConfigParser import *
++ # not all objects get imported with __all__
++ from ConfigParser import Error, InterpolationMissingOptionError
++except ImportError:
++ from configparser import *
++ from configparser import Error, InterpolationMissingOptionError
+diff --git a/iniparse/ini.py b/iniparse/ini.py
+index 408354d..052d9e9 100644
+--- a/iniparse/ini.py
++++ b/iniparse/ini.py
+@@ -7,7 +7,7 @@
+
+ Example:
+
+- >>> from StringIO import StringIO
++ >>> from six import StringIO
+ >>> sio = StringIO('''# configure foo-application
+ ... [foo]
+ ... bar1 = qualia
+@@ -16,14 +16,14 @@ Example:
+ ... special = 1''')
+
+ >>> cfg = INIConfig(sio)
+- >>> print cfg.foo.bar1
++ >>> print(cfg.foo.bar1)
+ qualia
+- >>> print cfg['foo-ext'].special
++ >>> print(cfg['foo-ext'].special)
+ 1
+ >>> cfg.foo.newopt = 'hi!'
+ >>> cfg.baz.enabled = 0
+
+- >>> print cfg
++ >>> print(cfg)
+ # configure foo-application
+ [foo]
+ bar1 = qualia
+@@ -42,9 +42,11 @@ Example:
+ # Backward-compatiable with ConfigParser
+
+ import re
+-from ConfigParser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
++from .configparser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
+
+-import config
++import six
++
++from . import config
+
+ class LineType(object):
+ line = None
+@@ -278,6 +280,8 @@ class LineContainer(object):
+ value = property(get_value, set_value)
+
+ def __str__(self):
++ for c in self.contents:
++ pass#print(c.__str__())
+ s = [x.__str__() for x in self.contents]
+ return '\n'.join(s)
+
+@@ -465,7 +469,7 @@ class INIConfig(config.ConfigNamespace):
+ self._sections = {}
+ if defaults is None: defaults = {}
+ self._defaults = INISection(LineContainer(), optionxformsource=self)
+- for name, value in defaults.iteritems():
++ for name, value in defaults.items():
+ self._defaults[name] = value
+ if fp is not None:
+ self._readfp(fp)
+@@ -551,7 +555,7 @@ class INIConfig(config.ConfigNamespace):
+
+ for line in readline_iterator(fp):
+ # Check for BOM on first line
+- if linecount == 0 and isinstance(line, unicode):
++ if linecount == 0 and isinstance(line, six.text_type):
+ if line[0] == u'\ufeff':
+ line = line[1:]
+ self._bom = True
+diff --git a/iniparse/utils.py b/iniparse/utils.py
+index 829fc28..f8b773a 100644
+--- a/iniparse/utils.py
++++ b/iniparse/utils.py
+@@ -1,5 +1,5 @@
+-import compat
+-from ini import LineContainer, EmptyLine
++from . import compat
++from .ini import LineContainer, EmptyLine
+
+ def tidy(cfg):
+ """Clean up blank lines.
+diff --git a/tests/__init__.py b/tests/__init__.py
+index f1fa321..88689fb 100644
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -1,12 +1,12 @@
+ import unittest, doctest
+
+-import test_ini
+-import test_misc
+-import test_fuzz
+-import test_compat
+-import test_unicode
+-import test_tidy
+-import test_multiprocessing
++from . import test_ini
++from . import test_misc
++from . import test_fuzz
++from . import test_compat
++from . import test_unicode
++from . import test_tidy
++from . import test_multiprocessing
+ from iniparse import config
+ from iniparse import ini
+
+diff --git a/tests/test_compat.py b/tests/test_compat.py
+index b8da3d5..b6dfb5c 100644
+--- a/tests/test_compat.py
++++ b/tests/test_compat.py
+@@ -1,9 +1,16 @@
+ from iniparse import compat as ConfigParser
+-import StringIO
++from six import StringIO
++try:
++ import UserDict
++except ImportError:
++ import collections as UserDict
+ import unittest
+-import UserDict
+
+-from test import test_support
++import sys
++if sys.version_info[0] < 3:
++ from test import test_support
++else:
++ from test import support as test_support
+
+ class SortedDict(UserDict.UserDict):
+ def items(self):
+@@ -35,7 +42,7 @@ class TestCaseBase(unittest.TestCase):
+
+ def fromstring(self, string, defaults=None):
+ cf = self.newconfig(defaults)
+- sio = StringIO.StringIO(string)
++ sio = StringIO(string)
+ cf.readfp(sio)
+ return cf
+
+@@ -161,7 +168,7 @@ class TestCaseBase(unittest.TestCase):
+ "No Section!\n")
+
+ def parse_error(self, exc, src):
+- sio = StringIO.StringIO(src)
++ sio = StringIO(src)
+ self.assertRaises(exc, self.cf.readfp, sio)
+
+ def test_query_errors(self):
+@@ -181,7 +188,7 @@ class TestCaseBase(unittest.TestCase):
+ def get_error(self, exc, section, option):
+ try:
+ self.cf.get(section, option)
+- except exc, e:
++ except exc as e:
+ return e
+ else:
+ self.fail("expected exception type %s.%s"
+@@ -227,7 +234,7 @@ class TestCaseBase(unittest.TestCase):
+ "foo: another very\n"
+ " long line"
+ )
+- output = StringIO.StringIO()
++ output = StringIO()
+ cf.write(output)
+ self.assertEqual(
+ output.getvalue(),
+@@ -465,7 +472,7 @@ class SortedTestCase(RawConfigParserTestCase):
+ "o1=4\n"
+ "[a]\n"
+ "k=v\n")
+- output = StringIO.StringIO()
++ output = StringIO()
+ self.cf.write(output)
+ self.assertEquals(output.getvalue(),
+ "[a]\n"
+diff --git a/tests/test_fuzz.py b/tests/test_fuzz.py
+index 5420dcc..b219500 100644
+--- a/tests/test_fuzz.py
++++ b/tests/test_fuzz.py
+@@ -1,9 +1,10 @@
+ import re
+ import os
+ import random
++import sys
+ import unittest
+-import ConfigParser
+-from StringIO import StringIO
++from six import StringIO
++from six.moves import configparser
+ from iniparse import compat, ini, tidy
+
+ # TODO:
+@@ -96,24 +97,25 @@ class test_fuzz(unittest.TestCase):
+ s = '\n'.join(good_lines)
+ cc = compat.RawConfigParser()
+ cc.readfp(StringIO(s))
+- cc_py = ConfigParser.RawConfigParser()
++ cc_py = configparser.RawConfigParser()
+ cc_py.readfp(StringIO(s))
+ # compare the two configparsers
+ self.assertEqualConfig(cc_py, cc)
+ # check that tidy does not change semantics
+ tidy(cc)
+- cc_tidy = ConfigParser.RawConfigParser()
++ cc_tidy = configparser.RawConfigParser()
+ cc_tidy.readfp(StringIO(str(cc.data)))
+ self.assertEqualConfig(cc_py, cc_tidy)
+ except AssertionError:
+ fname = 'fuzz-test-iter-%d.ini' % fuzz_iter
+- print 'Fuzz test failed at iteration', fuzz_iter
+- print 'Writing out failing INI file as', fname
++ print('Fuzz test failed at iteration', fuzz_iter)
++ print('Writing out failing INI file as', fname)
+ f = open(fname, 'w')
+ f.write(s)
+ f.close()
+ raise
+
++ @unittest.skipIf(sys.version_info[0] > 2, 'http://code.google.com/p/iniparse/issues/detail?id=22#c9')
+ def assertEqualConfig(self, c1, c2):
+ self.assertEqualSorted(c1.sections(), c2.sections())
+ self.assertEqualSorted(c1.defaults().items(), c2.defaults().items())
+@@ -123,9 +125,7 @@ class test_fuzz(unittest.TestCase):
+ self.assertEqual(c1.get(sec, opt), c2.get(sec, opt))
+
+ def assertEqualSorted(self, l1, l2):
+- l1.sort()
+- l2.sort()
+- self.assertEqual(l1, l2)
++ self.assertEqual(sorted(l1), sorted(l2))
+
+ class suite(unittest.TestSuite):
+ def __init__(self):
+diff --git a/tests/test_ini.py b/tests/test_ini.py
+index 6a76edb..07d4f4e 100644
+--- a/tests/test_ini.py
++++ b/tests/test_ini.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++from six import StringIO
+
+ from iniparse import ini
+ from iniparse import compat
+@@ -196,13 +196,13 @@ but = also me
+ self.assertEqual(p._data.find('section2').find('just').value, 'kidding')
+
+ itr = p._data.finditer('section1')
+- v = itr.next()
++ v = next(itr)
+ self.assertEqual(v.find('help').value, 'yourself')
+ self.assertEqual(v.find('but').value, 'also me')
+- v = itr.next()
++ v = next(itr)
+ self.assertEqual(v.find('help').value, 'me')
+ self.assertEqual(v.find('I\'m').value, 'desperate')
+- self.assertRaises(StopIteration, itr.next)
++ self.assertRaises(StopIteration, next, itr)
+
+ self.assertRaises(KeyError, p._data.find, 'section')
+ self.assertRaises(KeyError, p._data.find('section2').find, 'ahem')
+diff --git a/tests/test_misc.py b/tests/test_misc.py
+index 31cf4da..96ef035 100644
+--- a/tests/test_misc.py
++++ b/tests/test_misc.py
+@@ -1,9 +1,9 @@
+ import re
+ import unittest
+ import pickle
+-import ConfigParser
++from six.moves import configparser
++from six import StringIO
+ from textwrap import dedent
+-from StringIO import StringIO
+ from iniparse import compat, ini
+
+ class CaseSensitiveConfigParser(compat.ConfigParser):
+diff --git a/tests/test_tidy.py b/tests/test_tidy.py
+index 7304747..26b6cde 100644
+--- a/tests/test_tidy.py
++++ b/tests/test_tidy.py
+@@ -1,6 +1,6 @@
+ import unittest
+ from textwrap import dedent
+-from StringIO import StringIO
++from six import StringIO
+
+ from iniparse import tidy,INIConfig
+ from iniparse.ini import EmptyLine
+diff --git a/tests/test_unicode.py b/tests/test_unicode.py
+index a56fcab..14d4fbd 100644
+--- a/tests/test_unicode.py
++++ b/tests/test_unicode.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++import six
+ from iniparse import compat, ini
+
+ class test_unicode(unittest.TestCase):
+@@ -17,14 +17,14 @@ baz = Marc-Andr\202
+ """
+
+ def basic_tests(self, s, strable):
+- f = StringIO(s)
++ f = six.StringIO(s)
+ i = ini.INIConfig(f)
+- self.assertEqual(unicode(i), s)
+- self.assertEqual(type(i.foo.bar), unicode)
++ self.assertEqual(six.text_type(i), s)
++ self.assertEqual(type(i.foo.bar), six.text_type)
+ if strable:
+ self.assertEqual(str(i), str(s))
+ else:
+- self.assertRaises(UnicodeEncodeError, lambda: str(i))
++ self.assertRaises(UnicodeEncodeError, lambda: six.text_type(i).encode('ascii'))
+ return i
+
+ def test_ascii(self):
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb b/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
new file mode 100644
index 000000000..4eba9ecd3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Accessing and Modifying INI files"
+HOMEPAGE = "https://pypi.python.org/pypi/iniparse/"
+LICENSE = "MIT & PSF"
+LIC_FILES_CHKSUM = "file://LICENSE-PSF;md5=1c78a5bb3584b353496d5f6f34edb4b2 \
+ file://LICENSE;md5=52f28065af11d69382693b45b5a8eb54"
+
+SRC_URI = "file://0001-Add-python-3-compatibility.patch "
+
+SRC_URI[md5sum] = "5e573e9e9733d97623881ce9bbe5eca6"
+SRC_URI[sha256sum] = "abc1ee12d2cfb2506109072d6c21e40b6c75a3fe90a9c924327d80bc0d99c054"
+
+inherit pypi distutils3
+
+RDEPENDS_${PN} += "python3-core python3-six"
+DEPENDS += "python3-six"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb b/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
new file mode 100644
index 000000000..22ceeeb39
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-mako.inc
diff --git a/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb b/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb
new file mode 100644
index 000000000..3098027d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb
@@ -0,0 +1,112 @@
+require recipes-devtools/python/python.inc
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://12-distutils-prefix-is-inside-staging-area.patch \
+file://python-config.patch \
+file://0001-cross-compile-support.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://python-3.3-multilib.patch \
+file://03-fix-tkinter-detection.patch \
+file://avoid_warning_about_tkinter.patch \
+file://shutil-follow-symlink-fix.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://sysroot-include-headers.patch \
+file://unixccompiler.patch \
+${DISTRO_SRC_URI} \
+file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
+file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \
+file://regen-all.patch \
+"
+
+SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0"
+SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b6ec515b22618f55fa07276b897bacea"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+S = "${WORKDIR}/Python-${PV}"
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native gdbm-native"
+
+inherit native
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+
+EXTRA_OEMAKE = '\
+ LIBC="" \
+ STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+ STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+'
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+do_configure_append() {
+ autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+ sed -i -e 's,#define HAVE_GETRANDOM 1,/\* #undef HAVE_GETRANDOM \*/,' ${B}/pyconfig.h
+}
+
+# Regenerate all of the generated files
+# This ensures that pgen and friends get created during the compile phase
+#
+do_compile_prepend() {
+ # Assuming https://bugs.python.org/issue33080 has been addressed in Makefile.
+ oe_runmake regen-all
+}
+
+do_install() {
+ install -d ${D}${libdir}/pkgconfig
+ oe_runmake 'DESTDIR=${D}' install
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+ install -d ${D}${bindir}/${PN}
+ install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+ # Make sure we use /usr/bin/env python
+ for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+ done
+
+ # Add a symlink to the native Python so that scripts can just invoke
+ # "nativepython" and get the right one without needing absolute paths
+ # (these often end up too long for the #! parser in the kernel as the
+ # buffer is 128 bytes long).
+ ln -s python3-native/python3 ${D}${bindir}/nativepython3
+}
+
+python(){
+
+ # Read JSON manifest
+ import json
+ pythondir = d.getVar('THISDIR',True)
+ with open(pythondir+'/python3/python3-manifest.json') as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ rprovides = d.getVar('RPROVIDES').split()
+
+ # Hardcoded since it cant be python3-native-foo, should be python3-foo-native
+ pn = 'python3'
+
+ for key in python_manifest:
+ pypackage = pn + '-' + key + '-native'
+ if pypackage not in rprovides:
+ rprovides.append(pypackage)
+
+ d.setVar('RPROVIDES', ' '.join(rprovides))
+}
diff --git a/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb b/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
new file mode 100644
index 000000000..8bc1f4983
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
@@ -0,0 +1,6 @@
+inherit setuptools3
+require python-nose.inc
+
+do_install_append() {
+ mv ${D}${bindir}/nosetests ${D}${bindir}/nosetests3
+}
diff --git a/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb b/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb
new file mode 100644
index 000000000..53fd6dcf2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "The PyPA recommended tool for installing Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/pip"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
+
+DEPENDS += "python3 python3-setuptools-native"
+
+SRC_URI[md5sum] = "2fddd680422326b9d1fbf56112cf341d"
+SRC_URI[sha256sum] = "88110a224e9d30e5d76592a0b2130ef10e7e67a6426e8617bb918fffbfe91fe5"
+
+inherit pypi distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
+
+do_install_prepend() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
+
+ # Install as pip3 and leave pip2 as default
+ rm ${D}/${bindir}/pip
+
+ # Installed eggs need to be passed directly to the interpreter via a pth file
+ echo "./${PYPI_PACKAGE}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${PYPI_PACKAGE}-${PV}.pth
+
+ # Make sure we use /usr/bin/env python3
+ for PYTHSCRIPT in `grep -rIl ${bindir} ${D}${bindir}/pip3*`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+ done
+}
+
+RDEPENDS_${PN} = "\
+ python3-compile \
+ python3-io \
+ python3-html \
+ python3-json \
+ python3-netserver \
+ python3-setuptools \
+ python3-unixadmin \
+ python3-xmlrpc \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb b/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb
new file mode 100644
index 000000000..5c3e1e6f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Python bindings for the Cairo canvas library"
+HOMEPAGE = "http://cairographics.org/pycairo"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "python-devel"
+LICENSE = "LGPLv2.1 & MPLv1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
+ file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
+ file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
+
+# cairo >= 1.14
+DEPENDS = "cairo"
+
+SRC_URI = "https://github.com/pygobject/pycairo/releases/download/v${PV}/pycairo-${PV}.tar.gz"
+UPSTREAM_CHECK_URI = "https://github.com/pygobject/pycairo/releases/"
+
+SRC_URI[md5sum] = "3ff210c34e7b052590e15fd0fb147766"
+SRC_URI[sha256sum] = "ad150ea637860836b66705e0513b8e59494538f0b80497ad3462051368755016"
+
+S = "${WORKDIR}/pycairo-${PV}"
+
+inherit setuptools3 pkgconfig
+
+CFLAGS += "-fPIC"
+
+BBCLASSEXTEND = "native"
+
+do_install_append() {
+ install -d ${D}${includedir}/pycairo/
+ install -m 0644 ${D}${datadir}/include/pycairo/py3cairo.h ${D}${includedir}/pycairo/
+}
+FILES_${PN} += "${datadir}/include/pycairo/py3cairo.h"
diff --git a/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb b/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb
new file mode 100644
index 000000000..97286f4e8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+inherit gnomebase distutils3-base gobject-introspection upstream-version-is-even
+
+DEPENDS += "python3 glib-2.0"
+
+SRCNAME="pygobject"
+SRC_URI = " \
+ http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
+"
+
+SRC_URI[md5sum] = "612e9e2863d117d810e78672f7bc3ad6"
+SRC_URI[sha256sum] = "42312b4a5015571fa0a4f2d201005da46b71c251ea2625bc95702d071c4ff895"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+
+# python3-pycairo is checked on configuration -> DEPENDS
+# we don't link against python3-pycairo -> RDEPENDS
+PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo python3-pycairo, python3-pycairo"
+
+RDEPENDS_${PN} += "python3-setuptools"
+
+BBCLASSEXTEND = "native"
+PACKAGECONFIG_class-native = ""
diff --git a/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb b/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb
new file mode 100644
index 000000000..0dc1ed862
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb
@@ -0,0 +1,6 @@
+require python-setuptools.inc
+inherit setuptools3
+
+do_install_append() {
+ mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
+}
diff --git a/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb b/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
new file mode 100644
index 000000000..8795313be
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-six.inc
diff --git a/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb b/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb
new file mode 100644
index 000000000..e87b8df8c
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-smmap.inc
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
new file mode 100644
index 000000000..8ea3f03fe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -0,0 +1,38 @@
+From 04df959365e2b54d7503edf0e5534ff094284f2d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 12:25:09 +0300
+Subject: [PATCH] Do not use the shell version of python-config that was
+ introduced in 3.4
+
+Revert instead to the original python version: it has our tweaks and
+outputs directories correctly.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.pre.in | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 236f005..5c4337f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1348,12 +1348,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
+- # On Darwin, always use the python version of the script, the shell
+- # version doesn't use the compiler customizations that are provided
+- # in python (_osx_support.py).
+- if test `uname -s` = Darwin; then \
+- cp python-config.py python-config; \
+- fi
++ # In OpenEmbedded, always use the python version of the script, the shell
++ # version is broken in multiple ways, and doesn't return correct directories
++ cp python-config.py python-config
+
+
+ # Install the include files
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
new file mode 100644
index 000000000..d1c92e9ee
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
@@ -0,0 +1,66 @@
+From bcddbf40c7f1b80336268cdddacc17369fb0ccea Mon Sep 17 00:00:00 2001
+From: Libin Dang <libin.dang@windriver.com>
+Date: Tue, 11 Apr 2017 14:12:15 +0800
+Subject: [PATCH] Issue #21272: Use _sysconfigdata.py to initialize
+ distutils.sysconfig
+
+Backport upstream commit
+https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159
+
+Upstream-Status: Backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ Lib/distutils/sysconfig.py | 35 ++++-------------------------------
+ 1 file changed, 4 insertions(+), 31 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 6d5cfd0..9925d24 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -424,38 +424,11 @@ _config_vars = None
+
+ def _init_posix():
+ """Initialize the module as appropriate for POSIX systems."""
+- g = {}
+- # load the installed Makefile:
+- try:
+- filename = get_makefile_filename()
+- parse_makefile(filename, g)
+- except OSError as msg:
+- my_msg = "invalid Python installation: unable to open %s" % filename
+- if hasattr(msg, "strerror"):
+- my_msg = my_msg + " (%s)" % msg.strerror
+-
+- raise DistutilsPlatformError(my_msg)
+-
+- # load the installed pyconfig.h:
+- try:
+- filename = get_config_h_filename()
+- with open(filename) as file:
+- parse_config_h(file, g)
+- except OSError as msg:
+- my_msg = "invalid Python installation: unable to open %s" % filename
+- if hasattr(msg, "strerror"):
+- my_msg = my_msg + " (%s)" % msg.strerror
+-
+- raise DistutilsPlatformError(my_msg)
+-
+- # On AIX, there are wrong paths to the linker scripts in the Makefile
+- # -- these paths are relative to the Python source, but when installed
+- # the scripts are in another directory.
+- if python_build:
+- g['LDSHARED'] = g['BLDSHARED']
+-
++ # _sysconfigdata is generated at build time, see the sysconfig module
++ from _sysconfigdata import build_time_vars
+ global _config_vars
+- _config_vars = g
++ _config_vars = {}
++ _config_vars.update(build_time_vars)
+
+
+ def _init_nt():
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch
new file mode 100644
index 000000000..7cd7e3b49
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch
@@ -0,0 +1,96 @@
+From ecde3ea170999a9ef734e8af4d7c25be5ba81697 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 31 Mar 2017 15:42:46 +0300
+Subject: [PATCH] cross-compile support
+
+We cross compile python. This patch uses tools from host/native
+python instead of in-tree tools
+
+-Khem
+
+Rebased on 3.5.4
+
+Upstream-Status: Inappropriate[Configuration Specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Derek Straka <derek@asterius.io>
+---
+ Makefile.pre.in | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 144c1f8629..f252ac2417 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -223,6 +223,7 @@ LIBOBJS= @LIBOBJS@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= $(BUILDPYTHON)
+
+ PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+@@ -277,6 +278,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -478,7 +480,7 @@ build_all_generate_profile:
+
+ run_profile_task:
+ : # FIXME: can't run for a cross build
+- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
++ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
+
+ build_all_merge_profile:
+ $(LLVM_PROF_MERGER)
+@@ -772,7 +774,7 @@ regen-grammar: $(PGEN)
+ # Regenerate Include/graminit.h and Python/graminit.c
+ # from Grammar/Grammar using pgen
+ @$(MKDIR_P) Include
+- $(PGEN) $(srcdir)/Grammar/Grammar \
++ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \
+ $(srcdir)/Include/graminit.h \
+ $(srcdir)/Python/graminit.c
+
+@@ -978,7 +980,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
+ ######################################################################
+
+ TESTOPTS= $(EXTRATESTOPTS)
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
+ TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+ TESTTIMEOUT= 3600
+
+@@ -1470,7 +1472,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+ fi; \
+ done
+ $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
+- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
++ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
+ $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
+ $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
+ $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
+@@ -1543,7 +1545,7 @@ Python/dtoa.o: Python/dtoa.c
+
+ # Run reindent on the library
+ reindent:
+- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
+
+ # Rerun configure with the same options as it was run last time,
+ # provided the config.status script exists
+@@ -1678,7 +1680,7 @@ funny:
+
+ # Perform some verification checks on any modified files.
+ patchcheck: @DEF_MAKE_RULE@
+- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
++ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+
+ # Dependencies
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
new file mode 100644
index 000000000..dd6b24fe9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
@@ -0,0 +1,37 @@
+From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2013 21:03:16 -0700
+Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
+
+use utf-8 to open the files
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ Tools/scripts/h2py.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
+index 4f871d9..a53fbe0 100755
+--- a/Tools/scripts/h2py.py
++++ b/Tools/scripts/h2py.py
+@@ -69,13 +69,13 @@ def main():
+ sys.stdout.write('# Generated by h2py from stdin\n')
+ process(sys.stdin, sys.stdout)
+ else:
+- fp = open(filename, 'r')
++ fp = open(filename, 'r', encoding='utf-8')
+ outfile = os.path.basename(filename)
+ i = outfile.rfind('.')
+ if i > 0: outfile = outfile[:i]
+ modname = outfile.upper()
+ outfile = modname + '.py'
+- outfp = open(outfile, 'w')
++ outfp = open(outfile, 'w', encoding='utf-8')
+ outfp.write('# Generated by h2py from %s\n' % filename)
+ filedict = {}
+ for dir in searchdirs:
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..fddfd2b2f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# We need to supply STAGING_INCDIR here, otherwise the Tk headers
+# will not be found.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700
+@@ -1620,7 +1620,7 @@
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1639,22 +1639,6 @@
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 000000000..6beac7b80
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
@@ -0,0 +1,33 @@
+Do not hardcode /usr into include paths when cross compiling
+
+-Khem
+
+Upstream-Status: Pending
+
+---
+ setup.py | 15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py
++++ Python-3.3.2/setup.py
+@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
+ # only change this for cross builds for 3.3, issues on Mageia
+ if cross_compiling:
+ self.add_gcc_paths()
+- self.add_multiarch_paths()
++ if not cross_compiling:
++ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.base_prefix) != '/usr' \
++ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
+ and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
diff --git a/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 000000000..f9971c6ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,38 @@
+consider opkg directories when cleaning up
+
+-Khem
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.pre.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: Python-3.5.3/Makefile.pre.in
+===================================================================
+--- Python-3.5.3.orig/Makefile.pre.in
++++ Python-3.5.3/Makefile.pre.in
+@@ -1574,8 +1574,8 @@ touch:
+ # Sanitation targets -- clean leaves libraries, executables and tags
+ # files, which clobber removes as well
+ pycremoval:
+- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
+- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
+
+ rmtestturds:
+ -rm -f *BAD *GOOD *SKIPPED
+@@ -1589,9 +1589,9 @@ docclean:
+ -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
+
+ clean: pycremoval
+- find . -name '*.[oa]' -exec rm -f {} ';'
+- find . -name '*.s[ol]' -exec rm -f {} ';'
+- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+ find build -name '*.py' -exec rm -f {} ';' || true
+ find build -name '*.py[co]' -exec rm -f {} ';' || true
diff --git a/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 000000000..b96419a63
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
@@ -0,0 +1,92 @@
+do not "adjust" python files before copying
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded-Specific]
+
+---
+ Lib/distutils/command/build_scripts.py | 43 +++------------------------------
+ 1 file changed, 4 insertions(+), 39 deletions(-)
+
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -51,10 +51,7 @@ class build_scripts(Command):
+
+
+ def copy_scripts(self):
+- """Copy each script listed in 'self.scripts'; if it's marked as a
+- Python script in the Unix way (first line matches 'first_line_re',
+- ie. starts with "\#!" and contains "python"), then adjust the first
+- line to refer to the current Python interpreter as we copy.
++ """Copy each script listed in 'self.scripts'
+ """
+ self.mkpath(self.build_dir)
+ outfiles = []
+@@ -78,64 +75,10 @@ class build_scripts(Command):
+ if not self.dry_run:
+ raise
+ f = None
+- else:
+- encoding, lines = tokenize.detect_encoding(f.readline)
+- f.seek(0)
+- first_line = f.readline()
+- if not first_line:
+- self.warn("%s is an empty file (skipping)" % script)
+- continue
+-
+- match = first_line_re.match(first_line)
+- if match:
+- adjust = True
+- post_interp = match.group(1) or b''
+-
+- if adjust:
+- log.info("copying and adjusting %s -> %s", script,
+- self.build_dir)
+- updated_files.append(outfile)
+- if not self.dry_run:
+- if not sysconfig.python_build:
+- executable = self.executable
+- else:
+- executable = os.path.join(
+- sysconfig.get_config_var("BINDIR"),
+- "python%s%s" % (sysconfig.get_config_var("VERSION"),
+- sysconfig.get_config_var("EXE")))
+- executable = os.fsencode(executable)
+- shebang = b"#!" + executable + post_interp + b"\n"
+- # Python parser starts to read a script using UTF-8 until
+- # it gets a #coding:xxx cookie. The shebang has to be the
+- # first line of a file, the #coding:xxx cookie cannot be
+- # written before. So the shebang has to be decodable from
+- # UTF-8.
+- try:
+- shebang.decode('utf-8')
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from utf-8".format(shebang))
+- # If the script is encoded to a custom encoding (use a
+- # #coding:xxx cookie), the shebang has to be decodable from
+- # the script encoding too.
+- try:
+- shebang.decode(encoding)
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from the script encoding ({})"
+- .format(shebang, encoding))
+- with open(outfile, "wb") as outf:
+- outf.write(shebang)
+- outf.writelines(f.readlines())
+- if f:
+- f.close()
+- else:
+- if f:
++ if f:
+ f.close()
+- updated_files.append(outfile)
+- self.copy_file(script, outfile)
++ updated_files.append(outfile)
++ self.copy_file(script, outfile)
+
+ if os.name == 'posix':
+ for file in outfiles:
diff --git a/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..c53ec0cfc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,57 @@
+From 7630ab22578746d3d790d0598c0d279cf7afed97 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 May 2013 15:00:26 -0700
+Subject: [PATCH 01/20] python3: Add target and native recipes
+
+Upstream-Status: Inappropriate [embedded specific]
+
+02/2015 Rebased for Python 3.4.2
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+---
+ Lib/distutils/sysconfig.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 573724d..390c485 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+- if prefix is None:
++ if prefix is None and os.environ['STAGING_INCDIR'] != "":
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
++ elif prefix is None:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+ if os.name == "posix":
+ if python_build:
+@@ -125,6 +127,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++
+ if prefix is None:
+ if standard_lib:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+@@ -133,7 +139,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 000000000..c805652d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
@@ -0,0 +1,55 @@
+package python-readline
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+--- a/setup.py
++++ b/setup.py
+@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
+ # readline
+ do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
+ readline_termcap_library = ""
+- curses_library = ""
+- # Cannot use os.popen here in py3k.
+- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
+- if not os.path.exists(self.build_temp):
+- os.makedirs(self.build_temp)
+- # Determine if readline is already linked against curses or tinfo.
+- if do_readline:
+- if cross_compiling:
+- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
+- % (sysconfig.get_config_var('READELF'),
+- do_readline, tmpfile))
+- elif find_executable('ldd'):
+- ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
+- else:
+- ret = 256
+- if ret >> 8 == 0:
+- with open(tmpfile) as fp:
+- for ln in fp:
+- if 'curses' in ln:
+- readline_termcap_library = re.sub(
+- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
+- ).rstrip()
+- break
+- # termcap interface split out from ncurses
+- if 'tinfo' in ln:
+- readline_termcap_library = 'tinfo'
+- break
+- if os.path.exists(tmpfile):
+- os.unlink(tmpfile)
+- # Issue 7384: If readline is already linked against curses,
+- # use the same library for the readline and curses modules.
+- if 'curses' in readline_termcap_library:
+- curses_library = readline_termcap_library
+- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+- curses_library = 'ncursesw'
+- elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+- curses_library = 'ncurses'
+- elif self.compiler.find_library_file(lib_dirs, 'curses'):
+- curses_library = 'curses'
++ curses_library = "ncurses"
+
+ if host_platform == 'darwin':
+ os_release = int(os.uname()[2].split('.')[0])
diff --git a/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 000000000..78d7c7867
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
@@ -0,0 +1,17 @@
+Fix warning with newer compiler
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
+ #defines many common symbols (such as "lines") which breaks the
+ curses module in other ways. So the code will just specify
+ explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
++//extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
diff --git a/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 000000000..f29ae5337
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+We should make sure that sysroot is used by gcc instead of assuming
+hardcoded locations for include paths
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Python-3.4.2/configure.ac
+===================================================================
+--- Python-3.4.2.orig/configure.ac
++++ Python-3.4.2/configure.ac
+@@ -4434,7 +4434,7 @@ fi
+
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..a3cc48c9a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,29 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-3.5.3/setup.py
+===================================================================
+--- Python-3.5.3.orig/setup.py
++++ Python-3.5.3/setup.py
+@@ -1558,10 +1558,12 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ ## # Uncomment these lines if you want to play with xxmodule.c
+ ## ext = Extension('xx', ['xxmodule.c'])
diff --git a/poky/meta/recipes-devtools/python/python3/cgi_py.patch b/poky/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
new file mode 100644
index 000000000..97214f9aa
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
@@ -0,0 +1,30 @@
+From 7c4f8d87473d6238c120ec6031b58f83a17a39a5 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 28 Dec 2015 22:52:06 -0800
+Subject: [PATCH] configure.ac: fix LIBPL
+
+Use LIBDIR rather than prefix/lib, so that it would work when lib64.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 63aef8e..aefb27f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4366,7 +4366,7 @@ AC_MSG_RESULT($LDVERSION)
+
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
++LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
+ AC_SUBST(LIBPL)
+
+ # Check whether right shifting a negative integer extends the sign bit
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/python/python3/create_manifest3.py b/poky/meta/recipes-devtools/python/python3/create_manifest3.py
new file mode 100644
index 000000000..2f944f9b1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -0,0 +1,354 @@
+# This script is used as a bitbake task to create a new python manifest
+# $ bitbake python -c create_manifest
+#
+# Our goal is to keep python-core as small as posible and add other python
+# packages only when the user needs them, hence why we split upstream python
+# into several packages.
+#
+# In a very simplistic way what this does is:
+# Launch python and see specifically what is required for it to run at a minimum
+#
+# Go through the python-manifest file and launch a separate task for every single
+# one of the files on each package, this task will check what was required for that
+# specific module to run, these modules will be called dependencies.
+# The output of such task will be a list of the modules or dependencies that were
+# found for that file.
+#
+# Such output will be parsed by this script, we will look for each dependency on the
+# manifest and if we find that another package already includes it, then we will add
+# that package as an RDEPENDS to the package we are currently checking; in case we dont
+# find the current dependency on any other package we will add it to the current package
+# as part of FILES.
+#
+#
+# This way we will create a new manifest from the data structure that was built during
+# this process, ont this new manifest each package will contain specifically only
+# what it needs to run.
+#
+# There are some caveats which we try to deal with, such as repeated files on different
+# packages, packages that include folders, wildcards, and special packages.
+# Its also important to note that this method only works for python files, and shared
+# libraries. Static libraries, header files and binaries need to be dealt with manually.
+#
+# This script differs from its python2 version mostly on how shared libraries are handled
+# The manifest file for python3 has an extra field which contains the cached files for
+# each package.
+# Tha method to handle cached files does not work when a module includes a folder which
+# itself contains the pycache folder, gladly this is almost never the case.
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+import sys
+import subprocess
+import json
+import os
+
+# Hack to get native python search path (for folders), not fond of it but it works for now
+pivot='recipe-sysroot-native'
+for p in sys.path:
+ if pivot in p:
+ nativelibfolder=p[:p.find(pivot)+len(pivot)]
+
+# Empty dict to hold the whole manifest
+new_manifest = {}
+
+# Check for repeated files, folders and wildcards
+allfiles=[]
+repeated=[]
+wildcards=[]
+
+hasfolders=[]
+allfolders=[]
+
+def isFolder(value):
+ if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')):
+ return True
+ else:
+ return False
+
+def isCached(item):
+ if '__pycache__' in item:
+ return True
+ else:
+ return False
+
+# Read existing JSON manifest
+with open('python3-manifest.json') as manifest:
+ old_manifest=json.load(manifest)
+
+
+# First pass to get core-package functionality, because we base everything on the fact that core is actually working
+# Not exactly the same so it should not be a function
+print ('Getting dependencies for package: core')
+
+# Special call to check for core package
+output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package']).decode('utf8')
+for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if isCached(item):
+ if item not in old_manifest['core']['cached']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['cached'].append(item)
+ else:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+for value in old_manifest['core']['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass it directly
+ if isCached(value):
+ if value not in old_manifest['core']['cached']:
+ old_manifest['core']['cached'].append(value)
+ else:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore binaries, since we don't import those, assume it was added correctly (manually)
+ if '${bindir}' in value:
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
+ print ('The following dependencies were found for module %s:\n' % value)
+ print (output)
+ for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if isCached(item):
+ if item not in old_manifest['core']['cached']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['cached'].append(item)
+ else:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+
+# We check which packages include folders
+for key in old_manifest:
+ for value in old_manifest[key]['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ print ('%s is a folder' % value)
+ if key not in hasfolders:
+ hasfolders.append(key)
+ if value not in allfolders:
+ allfolders.append(value)
+
+for key in old_manifest:
+ # Use an empty dict as data structure to hold data for each package and fill it up
+ new_manifest[key]={}
+ new_manifest[key]['files']=[]
+
+ new_manifest[key]['rdepends']=[]
+ # All packages should depend on core
+ if key != 'core':
+ new_manifest[key]['rdepends'].append('core')
+ new_manifest[key]['cached']=[]
+ else:
+ new_manifest[key]['cached']=old_manifest[key]['cached']
+ new_manifest[key]['summary']=old_manifest[key]['summary']
+
+ # Handle special cases, we assume that when they were manually added
+ # to the manifest we knew what we were doing.
+ print('\n')
+ print('--------------------------')
+ print ('Handling package %s' % key)
+ print('--------------------------')
+ special_packages=['misc', 'modules', 'dev']
+ if key in special_packages or 'staticdev' in key:
+ print('Passing %s package directly' % key)
+ new_manifest[key]=old_manifest[key]
+ continue
+
+ for value in old_manifest[key]['files']:
+ # We already handled core on the first pass
+ if key == 'core':
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass folders directly
+ new_manifest[key]['files'].append(value)
+ # Ignore binaries, since we don't import those
+ if '${bindir}' in value:
+ # Pass it directly to the new manifest data structure
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+
+ # Get module name , shouldnt be affected by libdir/bindir
+ # We need to check if the imported module comes from another (e.g. sqlite3.dump)
+ path,value = os.path.split(value)
+ path = os.path.basename(path)
+ value = os.path.splitext(os.path.basename(value))[0]
+
+ # If this condition is met, it means we need to import it from another module
+ # or its the folder itself (e.g. unittest)
+ if path == key:
+ if value:
+ value = path + '.' + value
+ else:
+ value = path
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('\nGetting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
+ # We can print dependencies for debugging purposes
+ print ('The following dependencies were found for module %s:\n' % value)
+ print (output)
+ # Output will have all dependencies
+
+ reportFILES = []
+ reportRDEPS = []
+
+ for item in output.split():
+
+ # Warning: This first part is ugly
+ # One of the dependencies that was found, could be inside of one of the folders included by another package
+ # We need to check if this happens so we can add the package containing the folder as an rdependency
+ # e.g. Folder encodings contained in codecs
+ # This would be solved if no packages included any folders
+
+ # This can be done in two ways:
+ # 1 - We assume that if we take out the filename from the path we would get
+ # the folder string, then we would check if folder string is in the list of folders
+ # This would not work if a package contains a folder which contains another folder
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # folder_string would not match any value contained in the list of folders
+ #
+ # 2 - We do it the other way around, checking if the folder is contained in the path
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # is folder_string inside path/folder1/folder2/filename?,
+ # Yes, it works, but we waste a couple of milliseconds.
+
+ inFolders=False
+ for folder in allfolders:
+ if folder in item:
+ inFolders = True # Did we find a folder?
+ folderFound = False # Second flag to break inner for
+ # Loop only through packages which contain folders
+ for keyfolder in hasfolders:
+ if (folderFound == False):
+ #print('Checking folder %s on package %s' % (item,keyfolder))
+ for file_folder in old_manifest[keyfolder]['files'] or file_folder in old_manifest[keyfolder]['cached']:
+ if file_folder==folder:
+ print ('%s folder found in %s' % (folder, keyfolder))
+ folderFound = True
+ if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
+ new_manifest[key]['rdepends'].append(keyfolder)
+
+ else:
+ break
+
+ # A folder was found so we're done with this item, we can go on
+ if inFolders:
+ continue
+
+
+ # We might already have it on the dictionary since it could depend on a (previously checked) module
+ if item not in new_manifest[key]['files'] and item not in new_manifest[key]['cached']:
+ # Handle core as a special package, we already did it so we pass it to NEW data structure directly
+ if key=='core':
+ print('Adding %s to %s FILES' % (item, key))
+ if item.endswith('*'):
+ wildcards.append(item)
+ if isCached(item):
+ new_manifest[key]['cached'].append(item)
+ else:
+ new_manifest[key]['files'].append(item)
+
+ # Check for repeated files
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ else:
+
+
+ # Check if this dependency is already contained on another package, so we add it
+ # as an RDEPENDS, or if its not, it means it should be contained on the current
+ # package, so we should add it to FILES
+ for newkey in old_manifest:
+ # Debug
+ #print('Checking %s ' % item + ' in %s' % newkey)
+ if item in old_manifest[newkey]['files'] or item in old_manifest[newkey]['cached']:
+ # Since were nesting, we need to check its not the same key
+ if(newkey!=key):
+ if newkey not in new_manifest[key]['rdepends']:
+ # Add it to the new manifest data struct
+ reportRDEPS.append('Adding %s to %s RDEPENDS, because it contains %s\n' % (newkey, key, item))
+ new_manifest[key]['rdepends'].append(newkey)
+ break
+ else:
+ # A module shouldn't contain itself (${libdir}/python3/sqlite3 shouldnt be on sqlite3 files)
+ if os.path.basename(item) != key:
+ reportFILES.append(('Adding %s to %s FILES\n' % (item, key)))
+ # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package
+ if isCached(item):
+ new_manifest[key]['cached'].append(item)
+ else:
+ new_manifest[key]['files'].append(item)
+
+ if item.endswith('*'):
+ wildcards.append(item)
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ print('\n')
+ print('#################################')
+ print('Summary for module %s' % value)
+ print('FILES found for module %s:' % value)
+ print(''.join(reportFILES))
+ print('RDEPENDS found for module %s:' % value)
+ print(''.join(reportRDEPS))
+ print('#################################')
+
+print ('The following files are repeated (contained in more than one package), please check which package should get it:')
+print (repeated)
+print('The following files contain wildcards, please check they are necessary')
+print(wildcards)
+print('The following files contain folders, please check they are necessary')
+print(hasfolders)
+
+# Sort it just so it looks nicer
+for key in new_manifest:
+ new_manifest[key]['files'].sort()
+ new_manifest[key]['cached'].sort()
+ new_manifest[key]['rdepends'].sort()
+
+# Create the manifest from the data structure that was built
+with open('python3-manifest.json.new','w') as outfile:
+ json.dump(new_manifest,outfile,sort_keys=True, indent=4)
+ outfile.write('\n')
diff --git a/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..0610565d3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Index: Python-3.3.0rc2/Lib/sysconfig.py
+===================================================================
+--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700
+@@ -21,9 +21,9 @@
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+@@ -83,7 +83,7 @@
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-3.3.0rc2/Makefile.pre.in
+===================================================================
+--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700
+@@ -1080,9 +1080,9 @@
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/poky/meta/recipes-devtools/python/python3/get_module_deps3.py b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py
new file mode 100644
index 000000000..fd12baad8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py
@@ -0,0 +1,146 @@
+# This script is launched on separate task for each python module
+# It checks for dependencies for that specific module and prints
+# them out, the output of this execution will have all dependencies
+# for a specific module, which will be parsed an dealt on create_manifest.py
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+# We can get a log per module, for all the dependencies that were found, but its messy.
+debug=False
+
+import sys
+
+# We can get a list of the modules which are currently required to run python
+# so we run python-core and get its modules, we then import what we need
+# and check what modules are currently running, if we substract them from the
+# modules we had initially, we get the dependencies for the module we imported.
+
+# We use importlib to achieve this, so we also need to know what modules importlib needs
+import importlib
+
+core_deps=set(sys.modules)
+
+def fix_path(dep_path):
+ import os
+ # We DONT want the path on our HOST system
+ pivot='recipe-sysroot-native'
+ dep_path=dep_path[dep_path.find(pivot)+len(pivot):]
+
+ if '/usr/bin' in dep_path:
+ dep_path = dep_path.replace('/usr/bin''${bindir}')
+
+ # Handle multilib, is there a better way?
+ if '/usr/lib32' in dep_path:
+ dep_path = dep_path.replace('/usr/lib32','${libdir}')
+ if '/usr/lib64' in dep_path:
+ dep_path = dep_path.replace('/usr/lib64','${libdir}')
+ if '/usr/lib' in dep_path:
+ dep_path = dep_path.replace('/usr/lib','${libdir}')
+ if '/usr/include' in dep_path:
+ dep_path = dep_path.replace('/usr/include','${includedir}')
+ if '__init__.' in dep_path:
+ dep_path = os.path.split(dep_path)[0]
+ return dep_path
+
+
+# Module to import was passed as an argument
+current_module = str(sys.argv[1]).rstrip()
+if(debug==True):
+ log = open('log_%s' % current_module,'w')
+ log.write('Module %s generated the following dependencies:\n' % current_module)
+try:
+ importlib.import_module('%s' % current_module)
+except ImportError as e:
+ if (debug==True):
+ log.write('Module was not found')
+ pass
+
+
+# Get current module dependencies, dif will contain a list of specific deps for this module
+module_deps=set(sys.modules)
+
+# We handle the core package (1st pass on create_manifest.py) as a special case
+if current_module == 'python-core-package':
+ dif = core_deps
+else:
+ # We know this is not the core package, so there must be a difference.
+ dif = module_deps-core_deps
+
+
+# Check where each dependency came from
+for item in dif:
+ dep_path=''
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n')
+ dep_path = sys.modules['%s' % item].__file__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __file__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'dep_path' is not defined
+ # because module is not found (wasn't compiled?), e.g. bddsm
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+
+ # Site-customize is a special case since we (OpenEmbedded) put it there manually
+ if 'sitecustomize' in dep_path:
+ dep_path = '${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py'
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+ continue
+
+ dep_path = fix_path(dep_path)
+
+ import sysconfig
+ soabi=sysconfig.get_config_var('SOABI')
+ # Check if its a shared library and deconstruct it
+ if soabi in dep_path:
+ if (debug==True):
+ log.write('Shared library found in %s' % dep_path)
+ dep_path = dep_path.replace(soabi,'*')
+ print (dep_path)
+ continue
+
+ if (debug==True):
+ log.write(dep_path+'\n')
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+
+
+ import imp
+ cpython_tag = imp.get_tag()
+ cached=''
+ # Theres no naive way to find *.pyc files on python3
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__cached__\n')
+ cached = sys.modules['%s' % item].__cached__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __cached__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'cached' is not defined
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+ if cached is not None:
+ if (debug==True):
+ log.write(cached)
+ cached = fix_path(cached)
+ cached = cached.replace(cpython_tag,'*')
+ print (cached)
+
+if debug==True:
+ log.close()
diff --git a/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 000000000..ef2054d9a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700
+@@ -402,6 +402,9 @@
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if cross_compiling:
++ return
++
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
new file mode 100644
index 000000000..5c3af6b62
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
@@ -0,0 +1,82 @@
+From a784b70d47ba2104afbcfd805e2a66cdc2109ec5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 4 Aug 2017 11:16:14 +0800
+Subject: [PATCH] setup.py: pass missing libraries to Extension for multiprocessing module
+
+In the following commit:
+...
+commit e711cafab13efc9c1fe6c5cd75826401445eb585
+Author: Benjamin Peterson <benjamin@python.org>
+Date: Wed Jun 11 16:44:04 2008 +0000
+
+ Merged revisions 64104,64117 via svnmerge from
+ svn+ssh://pythondev@svn.python.org/python/trunk
+...
+(see diff in setup.py)
+It assigned libraries for multiprocessing module according
+the host_platform, but not pass it to Extension.
+
+In glibc, the following commit caused two definition of
+sem_getvalue are different.
+https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524
+(see diff in nptl/sem_getvalue.c for detail)
+`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1
+and `__old_sem_getvalue' is to compat the old version
+sem_getvalue@GLIBC_2.0.
+
+To build python for embedded Linux systems:
+http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html
+If not explicitly link to library pthread (-lpthread), it will
+load glibc's sem_getvalue randomly at runtime.
+
+Such as build python on linux x86_64 host and run the python
+on linux x86_32 target. If not link library pthread, it caused
+multiprocessing bounded semaphore could not work correctly.
+...
+>>> import multiprocessing
+>>> pool_sema = multiprocessing.BoundedSemaphore(value=1)
+>>> pool_sema.acquire()
+True
+>>> pool_sema.release()
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ValueError: semaphore or lock released too many times
+...
+
+And the semaphore issue also caused multiprocessing.Queue().put() hung.
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/2999]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ setup.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 4f0f522..d05707d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1606,8 +1606,10 @@ class PyBuildExt(build_ext):
+ elif host_platform.startswith('netbsd'):
+ macros = dict()
+ libraries = []
+-
+- else: # Linux and other unices
++ elif host_platform.startswith(('linux')):
++ macros = dict()
++ libraries = ['pthread']
++ else: # Other unices
+ macros = dict()
+ libraries = ['rt']
+
+@@ -1626,6 +1628,7 @@ class PyBuildExt(build_ext):
+ if sysconfig.get_config_var('WITH_THREAD'):
+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+ define_macros=list(macros.items()),
++ libraries=libraries,
+ include_dirs=["Modules/_multiprocessing"]))
+ else:
+ missing.append('_multiprocessing')
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
new file mode 100644
index 000000000..cc35dc161
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,363 @@
+From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 May 2013 15:00:26 -0700
+Subject: [PATCH 01/13] get the sys.lib from python itself and do not use
+ hardcoded value of 'lib'
+
+02/2015 Rebased for 3.4.2
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+---
+ Include/pythonrun.h | 3 +++
+ Lib/distutils/command/install.py | 4 +++-
+ Lib/pydoc.py | 2 +-
+ Lib/site.py | 4 ++--
+ Lib/sysconfig.py | 18 +++++++++---------
+ Lib/trace.py | 4 ++--
+ Makefile.pre.in | 7 +++++--
+ Modules/getpath.c | 10 +++++++++-
+ Python/getplatform.c | 20 ++++++++++++++++++++
+ Python/sysmodule.c | 4 ++++
+ configure.ac | 35 +++++++++++++++++++++++++++++++++++
+ setup.py | 9 ++++-----
+ 12 files changed, 97 insertions(+), 23 deletions(-)
+
+Index: Python-3.5.4/Include/pythonrun.h
+===================================================================
+--- Python-3.5.4.orig/Include/pythonrun.h
++++ Python-3.5.4/Include/pythonrun.h
+@@ -23,6 +23,9 @@ typedef struct {
+ } PyCompilerFlags;
+ #endif
+
++PyAPI_FUNC(const char *) Py_GetArch(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
++
+ #ifndef Py_LIMITED_API
+ PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
+ PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
+Index: Python-3.5.4/Lib/distutils/command/install.py
+===================================================================
+--- Python-3.5.4.orig/Lib/distutils/command/install.py
++++ Python-3.5.4/Lib/distutils/command/install.py
+@@ -19,6 +19,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ HAS_USER_SITE = True
+
++libname = sys.lib
++
+ WINDOWS_SCHEME = {
+ 'purelib': '$base/Lib/site-packages',
+ 'platlib': '$base/Lib/site-packages',
+@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
+
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+- 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-3.5.4/Lib/pydoc.py
+===================================================================
+--- Python-3.5.4.orig/Lib/pydoc.py
++++ Python-3.5.4/Lib/pydoc.py
+@@ -389,7 +389,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.base_exec_prefix, "lib",
++ basedir=os.path.join(sys.base_exec_prefix, sys.lib,
+ "python%d.%d" % sys.version_info[:2])):
+ """Return the location of module docs or None"""
+
+Index: Python-3.5.4/Lib/site.py
+===================================================================
+--- Python-3.5.4.orig/Lib/site.py
++++ Python-3.5.4/Lib/site.py
+@@ -303,12 +303,12 @@ def getsitepackages(prefixes=None):
+ seen.add(prefix)
+
+ if os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+ # locations.
+Index: Python-3.5.4/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.4.orig/Lib/sysconfig.py
++++ Python-3.5.4/Lib/sysconfig.py
+@@ -20,10 +20,10 @@ __all__ = [
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
++ 'purelib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
+@@ -32,10 +32,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{base}',
+ },
+ 'posix_home': {
+- 'stdlib': '{installed_base}/lib/python',
+- 'platstdlib': '{base}/lib/python',
+- 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/lib/python',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python',
++ 'platstdlib': '{base}/'+sys.lib+'/python',
++ 'purelib': '{base}/'+sys.lib+'/python',
++ 'platlib': '{base}/'+sys.lib+'/python',
+ 'include': '{installed_base}/include/python',
+ 'platinclude': '{installed_base}/include/python',
+ 'scripts': '{base}/bin',
+@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data': '{userbase}',
+Index: Python-3.5.4/Lib/trace.py
+===================================================================
+--- Python-3.5.4.orig/Lib/trace.py
++++ Python-3.5.4/Lib/trace.py
+@@ -749,10 +749,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.base_prefix, "lib",
++ os.path.join(sys.base_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.base_exec_prefix, "lib",
++ os.path.join(sys.base_exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-3.5.4/Makefile.pre.in
+===================================================================
+--- Python-3.5.4.orig/Makefile.pre.in
++++ Python-3.5.4/Makefile.pre.in
+@@ -109,6 +109,8 @@ CFLAGS_ALIASING=@CFLAGS_ALIASING@
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
++ARCH= @ARCH@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -128,7 +130,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= @libdir@
+ ABIFLAGS= @ABIFLAGS@
+
+ # Detailed destination directories
+@@ -731,6 +733,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Programs/python.o: $(srcdir)/Programs/python.c
+@@ -813,7 +816,7 @@ regen-opcode:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-3.5.4/Modules/getpath.c
+===================================================================
+--- Python-3.5.4.orig/Modules/getpath.c
++++ Python-3.5.4/Modules/getpath.c
+@@ -105,6 +105,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK L"os.py"
+ #endif
+@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
+ static wchar_t exec_prefix[MAXPATHLEN+1];
+ static wchar_t progpath[MAXPATHLEN+1];
+ static wchar_t *module_search_path = NULL;
++static wchar_t *lib_python = L"" LIB_PYTHON;
+
+ /* Get file status. Encode the path to the locale encoding. */
+
+@@ -494,7 +502,7 @@ calculate_path(void)
+ _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
+ _prefix = Py_DecodeLocale(PREFIX, NULL);
+ _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
+- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
++ lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
+
+ if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+ Py_FatalError(
+Index: Python-3.5.4/Python/getplatform.c
+===================================================================
+--- Python-3.5.4.orig/Python/getplatform.c
++++ Python-3.5.4/Python/getplatform.c
+@@ -10,3 +10,23 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef ARCH
++#define ARCH "unknown"
++#endif
++
++const char *
++Py_GetArch(void)
++{
++ return ARCH;
++}
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-3.5.4/Python/sysmodule.c
+===================================================================
+--- Python-3.5.4.orig/Python/sysmodule.c
++++ Python-3.5.4/Python/sysmodule.c
+@@ -1827,6 +1827,10 @@ _PySys_Init(void)
+ PyUnicode_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyUnicode_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("arch",
++ PyUnicode_FromString(Py_GetArch()));
++ SET_SYS_FROM_STRING("lib",
++ PyUnicode_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyUnicode_FromWideChar(
+ Py_GetProgramFullPath(), -1));
+Index: Python-3.5.4/configure.ac
+===================================================================
+--- Python-3.5.4.orig/configure.ac
++++ Python-3.5.4/configure.ac
+@@ -885,6 +885,41 @@ PLATDIR=plat-$MACHDEP
+ AC_SUBST(PLATDIR)
+ AC_SUBST(PLATFORM_TRIPLET)
+
++AC_SUBST(ARCH)
++AC_MSG_CHECKING(ARCH)
++ARCH=`uname -m`
++case $ARCH in
++i?86) ARCH=i386;;
++esac
++AC_MSG_RESULT($ARCH)
++
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++case $ac_sys_system in
++Linux*)
++ # Test if the compiler is 64bit
++ echo 'int i;' > conftest.$ac_ext
++ python_cv_cc_64bit_output=no
++ if AC_TRY_EVAL(ac_compile); then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *"ELF 64"*)
++ python_cv_cc_64bit_output=yes
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++esac
++
++case $ARCH:$python_cv_cc_64bit_output in
++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++ LIB="lib64"
++ ;;
++*:*)
++ LIB="lib"
++ ;;
++esac
++AC_MSG_RESULT($LIB)
+
+ AC_MSG_CHECKING([for -Wl,--no-as-needed])
+ save_LDFLAGS="$LDFLAGS"
+Index: Python-3.5.4/setup.py
+===================================================================
+--- Python-3.5.4.orig/setup.py
++++ Python-3.5.4/setup.py
+@@ -494,7 +494,7 @@ class PyBuildExt(build_ext):
+ # directories (i.e. '.' and 'Include') must be first. See issue
+ # 10520.
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ # only change this for cross builds for 3.3, issues on Mageia
+ if cross_compiling:
+@@ -552,8 +552,7 @@ class PyBuildExt(build_ext):
+ # be assumed that no additional -I,-L directives are needed.
+ if not cross_compiling:
+ lib_dirs = self.compiler.library_dirs + [
+- '/lib64', '/usr/lib64',
+- '/lib', '/usr/lib',
++ '/' + sys.lib, '/usr/' + sys.lib,
+ ]
+ inc_dirs = self.compiler.include_dirs + ['/usr/include']
+ else:
+@@ -745,11 +744,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/'+sys.lib+'/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/'+sys.lib+'/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
diff --git a/poky/meta/recipes-devtools/python/python3/python-config.patch b/poky/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 000000000..f23b8b7df
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python-config.patch
@@ -0,0 +1,46 @@
+python-config: Revert to using distutils.sysconfig
+
+The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
+
+12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
+
+affect the native runtime as well as cross building. Use the old, patched
+implementation which returns paths in the staging directory and for the target,
+as appropriate.
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
+:
+Index: Python-3.3.3/Misc/python-config.in
+===================================================================
+--- Python-3.3.3.orig/Misc/python-config.in
++++ Python-3.3.3/Misc/python-config.in
+@@ -4,7 +4,7 @@
+ import getopt
+ import os
+ import sys
+-import sysconfig
++from distutils import sysconfig
+
+ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
+@@ -32,14 +32,14 @@ if '--help' in opt_flags:
+
+ for opt in opt_flags:
+ if opt == '--prefix':
+- print(sysconfig.get_config_var('prefix'))
++ print(sysconfig.PREFIX)
+
+ elif opt == '--exec-prefix':
+- print(sysconfig.get_config_var('exec_prefix'))
++ print(sysconfig.EXEC_PREFIX)
+
+ elif opt in ('--includes', '--cflags'):
+- flags = ['-I' + sysconfig.get_path('include'),
+- '-I' + sysconfig.get_path('platinclude')]
++ flags = ['-I' + sysconfig.get_python_inc(),
++ '-I' + sysconfig.get_python_inc(plat_specific=True)]
+ if opt == '--cflags':
+ flags.extend(getvar('CFLAGS').split())
+ print(' '.join(flags))
diff --git a/poky/meta/recipes-devtools/python/python3/python3-manifest.json b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
new file mode 100644
index 000000000..2491f36db
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -0,0 +1,1149 @@
+{
+ "2to3": {
+ "cached": [],
+ "files": [
+ "${bindir}/2to3-*",
+ "${libdir}/python3.5/lib2to3"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python automated Python 2 to 3 code translator"
+ },
+ "asyncio": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/asyncio",
+ "${libdir}/python3.5/concurrent",
+ "${libdir}/python3.5/concurrent/futures"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "io",
+ "logging",
+ "math",
+ "multiprocessing",
+ "netclient",
+ "pickle",
+ "shell",
+ "stringold",
+ "threading",
+ "unixadmin"
+ ],
+ "summary": "Python Asynchronous I/"
+ },
+ "audio": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/chunk.*.pyc",
+ "${libdir}/python3.5/__pycache__/sndhdr.*.pyc",
+ "${libdir}/python3.5/__pycache__/sunau.*.pyc",
+ "${libdir}/python3.5/__pycache__/wave.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/chunk.py",
+ "${libdir}/python3.5/lib-dynload/audioop.*.so",
+ "${libdir}/python3.5/lib-dynload/ossaudiodev.*.so",
+ "${libdir}/python3.5/sndhdr.py",
+ "${libdir}/python3.5/sunau.py",
+ "${libdir}/python3.5/wave.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Audio Handling"
+ },
+ "codecs": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/xdrlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_multibytecodec.*.so",
+ "${libdir}/python3.5/xdrlib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python codec"
+ },
+ "compile": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/compileall.*.pyc",
+ "${libdir}/python3.5/__pycache__/py_compile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/compileall.py",
+ "${libdir}/python3.5/py_compile.py"
+ ],
+ "rdepends": [
+ "asyncio",
+ "compression",
+ "core",
+ "crypt",
+ "io",
+ "logging",
+ "math",
+ "multiprocessing",
+ "pickle",
+ "shell",
+ "stringold",
+ "threading",
+ "unixadmin"
+ ],
+ "summary": "Python bytecode compilation support"
+ },
+ "compression": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_compression.*.pyc",
+ "${libdir}/python3.5/__pycache__/bz2.*.pyc",
+ "${libdir}/python3.5/__pycache__/gzip.*.pyc",
+ "${libdir}/python3.5/__pycache__/lzma.*.pyc",
+ "${libdir}/python3.5/__pycache__/tarfile.*.pyc",
+ "${libdir}/python3.5/__pycache__/zipfile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_compression.py",
+ "${libdir}/python3.5/bz2.py",
+ "${libdir}/python3.5/gzip.py",
+ "${libdir}/python3.5/lib-dynload/_bz2.*.so",
+ "${libdir}/python3.5/lib-dynload/_lzma.*.so",
+ "${libdir}/python3.5/lib-dynload/zlib.*.so",
+ "${libdir}/python3.5/lzma.py",
+ "${libdir}/python3.5/tarfile.py",
+ "${libdir}/python3.5/zipfile.py"
+ ],
+ "rdepends": [
+ "core",
+ "shell",
+ "unixadmin"
+ ],
+ "summary": "Python high-level compression support"
+ },
+ "core": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/__future__.*.pyc",
+ "${libdir}/python3.5/__pycache__/_bootlocale.*.pyc",
+ "${libdir}/python3.5/__pycache__/_collections_abc.*.pyc",
+ "${libdir}/python3.5/__pycache__/_markupbase.*.pyc",
+ "${libdir}/python3.5/__pycache__/_sitebuiltins.*.pyc",
+ "${libdir}/python3.5/__pycache__/_sysconfigdata.*.pyc",
+ "${libdir}/python3.5/__pycache__/_weakrefset.*.pyc",
+ "${libdir}/python3.5/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/__pycache__/argparse.*.pyc",
+ "${libdir}/python3.5/__pycache__/ast.*.pyc",
+ "${libdir}/python3.5/__pycache__/bisect.*.pyc",
+ "${libdir}/python3.5/__pycache__/code.*.pyc",
+ "${libdir}/python3.5/__pycache__/codecs.*.pyc",
+ "${libdir}/python3.5/__pycache__/codeop.*.pyc",
+ "${libdir}/python3.5/__pycache__/configparser.*.pyc",
+ "${libdir}/python3.5/__pycache__/contextlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/copy.*.pyc",
+ "${libdir}/python3.5/__pycache__/copyreg.*.pyc",
+ "${libdir}/python3.5/__pycache__/csv.*.pyc",
+ "${libdir}/python3.5/__pycache__/dis.*.pyc",
+ "${libdir}/python3.5/__pycache__/enum.*.pyc",
+ "${libdir}/python3.5/__pycache__/functools.*.pyc",
+ "${libdir}/python3.5/__pycache__/genericpath.*.pyc",
+ "${libdir}/python3.5/__pycache__/getopt.*.pyc",
+ "${libdir}/python3.5/__pycache__/gettext.*.pyc",
+ "${libdir}/python3.5/__pycache__/heapq.*.pyc",
+ "${libdir}/python3.5/__pycache__/imp.*.pyc",
+ "${libdir}/python3.5/__pycache__/inspect.*.pyc",
+ "${libdir}/python3.5/__pycache__/io.*.pyc",
+ "${libdir}/python3.5/__pycache__/keyword.*.pyc",
+ "${libdir}/python3.5/__pycache__/linecache.*.pyc",
+ "${libdir}/python3.5/__pycache__/locale.*.pyc",
+ "${libdir}/python3.5/__pycache__/opcode.*.pyc",
+ "${libdir}/python3.5/__pycache__/operator.*.pyc",
+ "${libdir}/python3.5/__pycache__/optparse.*.pyc",
+ "${libdir}/python3.5/__pycache__/os.*.pyc",
+ "${libdir}/python3.5/__pycache__/platform.*.pyc",
+ "${libdir}/python3.5/__pycache__/posixpath.*.pyc",
+ "${libdir}/python3.5/__pycache__/re.*.pyc",
+ "${libdir}/python3.5/__pycache__/reprlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/rlcompleter.*.pyc",
+ "${libdir}/python3.5/__pycache__/selectors.*.pyc",
+ "${libdir}/python3.5/__pycache__/signal.*.pyc",
+ "${libdir}/python3.5/__pycache__/site.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_compile.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_constants.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_parse.*.pyc",
+ "${libdir}/python3.5/__pycache__/stat.*.pyc",
+ "${libdir}/python3.5/__pycache__/stringprep.*.pyc",
+ "${libdir}/python3.5/__pycache__/struct.*.pyc",
+ "${libdir}/python3.5/__pycache__/subprocess.*.pyc",
+ "${libdir}/python3.5/__pycache__/symbol.*.pyc",
+ "${libdir}/python3.5/__pycache__/sysconfig.*.pyc",
+ "${libdir}/python3.5/__pycache__/textwrap.*.pyc",
+ "${libdir}/python3.5/__pycache__/threading.*.pyc",
+ "${libdir}/python3.5/__pycache__/token.*.pyc",
+ "${libdir}/python3.5/__pycache__/tokenize.*.pyc",
+ "${libdir}/python3.5/__pycache__/traceback.*.pyc",
+ "${libdir}/python3.5/__pycache__/types.*.pyc",
+ "${libdir}/python3.5/__pycache__/warnings.*.pyc",
+ "${libdir}/python3.5/__pycache__/weakref.*.pyc",
+ "${libdir}/python3.5/collections/__pycache__",
+ "${libdir}/python3.5/collections/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__",
+ "${libdir}/python3.5/encodings/__pycache__/aliases.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__/latin_1.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__/utf_8.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__",
+ "${libdir}/python3.5/importlib/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__/machinery.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__/util.*.pyc"
+ ],
+ "files": [
+ "${bindir}/python*[!-config]",
+ "${includedir}/python${PYTHON_BINABI}/pyconfig*.h",
+ "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.py",
+ "${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.py",
+ "${libdir}/python${PYTHON_MAJMIN}/collections",
+ "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py",
+ "${libdir}/python3.5/UserDict.py",
+ "${libdir}/python3.5/UserList.py",
+ "${libdir}/python3.5/UserString.py",
+ "${libdir}/python3.5/__future__.py",
+ "${libdir}/python3.5/_abcoll.py",
+ "${libdir}/python3.5/_bootlocale.py",
+ "${libdir}/python3.5/_collections_abc.py",
+ "${libdir}/python3.5/_markupbase.py",
+ "${libdir}/python3.5/_sitebuiltins.py",
+ "${libdir}/python3.5/_sysconfigdata.py",
+ "${libdir}/python3.5/_weakrefset.py",
+ "${libdir}/python3.5/abc.py",
+ "${libdir}/python3.5/argparse.py",
+ "${libdir}/python3.5/ast.py",
+ "${libdir}/python3.5/bisect.py",
+ "${libdir}/python3.5/code.py",
+ "${libdir}/python3.5/codecs.py",
+ "${libdir}/python3.5/codeop.py",
+ "${libdir}/python3.5/collections",
+ "${libdir}/python3.5/collections/abc.py",
+ "${libdir}/python3.5/configparser.py",
+ "${libdir}/python3.5/contextlib.py",
+ "${libdir}/python3.5/copy.py",
+ "${libdir}/python3.5/copyreg.py",
+ "${libdir}/python3.5/csv.py",
+ "${libdir}/python3.5/dis.py",
+ "${libdir}/python3.5/encodings",
+ "${libdir}/python3.5/encodings/aliases.py",
+ "${libdir}/python3.5/encodings/latin_1.py",
+ "${libdir}/python3.5/encodings/utf_8.py",
+ "${libdir}/python3.5/enum.py",
+ "${libdir}/python3.5/functools.py",
+ "${libdir}/python3.5/genericpath.py",
+ "${libdir}/python3.5/getopt.py",
+ "${libdir}/python3.5/gettext.py",
+ "${libdir}/python3.5/heapq.py",
+ "${libdir}/python3.5/imp.py",
+ "${libdir}/python3.5/importlib",
+ "${libdir}/python3.5/importlib/_bootstrap.py",
+ "${libdir}/python3.5/importlib/_bootstrap_external.py",
+ "${libdir}/python3.5/importlib/abc.py",
+ "${libdir}/python3.5/importlib/machinery.py",
+ "${libdir}/python3.5/importlib/util.py",
+ "${libdir}/python3.5/inspect.py",
+ "${libdir}/python3.5/io.py",
+ "${libdir}/python3.5/keyword.py",
+ "${libdir}/python3.5/lib-dynload/__pycache__/_struct.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/binascii.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/time.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/xreadlines.*.so",
+ "${libdir}/python3.5/lib-dynload/_bisect.*.so",
+ "${libdir}/python3.5/lib-dynload/_csv.*.so",
+ "${libdir}/python3.5/lib-dynload/_heapq.*.so",
+ "${libdir}/python3.5/lib-dynload/_opcode.*.so",
+ "${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so",
+ "${libdir}/python3.5/lib-dynload/_struct.*.so",
+ "${libdir}/python3.5/lib-dynload/array.*.so",
+ "${libdir}/python3.5/lib-dynload/binascii.*.so",
+ "${libdir}/python3.5/lib-dynload/math.*.so",
+ "${libdir}/python3.5/lib-dynload/parser.*.so",
+ "${libdir}/python3.5/lib-dynload/readline.*.so",
+ "${libdir}/python3.5/lib-dynload/select.*.so",
+ "${libdir}/python3.5/lib-dynload/time.*.so",
+ "${libdir}/python3.5/lib-dynload/unicodedata.*.so",
+ "${libdir}/python3.5/lib-dynload/xreadlines.*.so",
+ "${libdir}/python3.5/linecache.py",
+ "${libdir}/python3.5/locale.py",
+ "${libdir}/python3.5/new.py",
+ "${libdir}/python3.5/opcode.py",
+ "${libdir}/python3.5/operator.py",
+ "${libdir}/python3.5/optparse.py",
+ "${libdir}/python3.5/os.py",
+ "${libdir}/python3.5/platform.py",
+ "${libdir}/python3.5/posixpath.py",
+ "${libdir}/python3.5/re.py",
+ "${libdir}/python3.5/reprlib.py",
+ "${libdir}/python3.5/rlcompleter.py",
+ "${libdir}/python3.5/selectors.py",
+ "${libdir}/python3.5/signal.py",
+ "${libdir}/python3.5/site.py",
+ "${libdir}/python3.5/sre_compile.py",
+ "${libdir}/python3.5/sre_constants.py",
+ "${libdir}/python3.5/sre_parse.py",
+ "${libdir}/python3.5/stat.py",
+ "${libdir}/python3.5/stringprep.py",
+ "${libdir}/python3.5/struct.py",
+ "${libdir}/python3.5/subprocess.py",
+ "${libdir}/python3.5/symbol.py",
+ "${libdir}/python3.5/sysconfig.py",
+ "${libdir}/python3.5/textwrap.py",
+ "${libdir}/python3.5/threading.py",
+ "${libdir}/python3.5/token.py",
+ "${libdir}/python3.5/tokenize.py",
+ "${libdir}/python3.5/traceback.py",
+ "${libdir}/python3.5/types.py",
+ "${libdir}/python3.5/warnings.py",
+ "${libdir}/python3.5/weakref.py"
+ ],
+ "rdepends": [],
+ "summary": "Python interpreter and core modules"
+ },
+ "crypt": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/crypt.*.pyc",
+ "${libdir}/python3.5/__pycache__/hashlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/crypt.py",
+ "${libdir}/python3.5/hashlib.py",
+ "${libdir}/python3.5/lib-dynload/_crypt.*.so",
+ "${libdir}/python3.5/lib-dynload/_hashlib.*.so",
+ "${libdir}/python3.5/lib-dynload/_sha256.*.so",
+ "${libdir}/python3.5/lib-dynload/_sha512.*.so"
+ ],
+ "rdepends": [
+ "core",
+ "math",
+ "stringold"
+ ],
+ "summary": "Python basic cryptographic and hashing support"
+ },
+ "ctypes": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/ctypes",
+ "${libdir}/python3.5/lib-dynload/_ctypes.*.so",
+ "${libdir}/python3.5/lib-dynload/_ctypes_test.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python C types support"
+ },
+ "curses": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/curses",
+ "${libdir}/python3.5/lib-dynload/_curses.*.so",
+ "${libdir}/python3.5/lib-dynload/_curses_panel.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python curses support"
+ },
+ "datetime": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_strptime.*.pyc",
+ "${libdir}/python3.5/__pycache__/calendar.*.pyc",
+ "${libdir}/python3.5/__pycache__/datetime.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_strptime.py",
+ "${libdir}/python3.5/calendar.py",
+ "${libdir}/python3.5/datetime.py",
+ "${libdir}/python3.5/lib-dynload/_datetime.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python calendar and time support"
+ },
+ "db": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/dbm",
+ "${libdir}/python3.5/lib-dynload/_dbm.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python file-based database support"
+ },
+ "debugger": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/bdb.*.pyc",
+ "${libdir}/python3.5/__pycache__/pdb.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/bdb.py",
+ "${libdir}/python3.5/pdb.py"
+ ],
+ "rdepends": [
+ "core",
+ "pprint",
+ "shell",
+ "stringold"
+ ],
+ "summary": "Python debugger"
+ },
+ "dev": {
+ "cached": [],
+ "files": [
+ "${base_libdir}/*.a",
+ "${base_libdir}/*.o",
+ "${bindir}/python*-config",
+ "${datadir}/aclocal",
+ "${datadir}/pkgconfig",
+ "${includedir}",
+ "${libdir}/*.a",
+ "${libdir}/*.la",
+ "${libdir}/*.o",
+ "${libdir}/lib*${SOLIBSDEV}",
+ "${libdir}/pkgconfig",
+ "${libdir}/python3.5/config*/Makefile",
+ "${libdir}/python3.5/config*/Makefile/__pycache__"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python development package"
+ },
+ "difflib": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/difflib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/difflib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python helpers for computing deltas between objects"
+ },
+ "distutils": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/distutils"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Distribution Utilities"
+ },
+ "distutils-staticdev": {
+ "cached": [
+ "${libdir}/python3.5/config/__pycache__/lib*.a"
+ ],
+ "files": [
+ "${libdir}/python3.5/config/lib*.a"
+ ],
+ "rdepends": [
+ "distutils"
+ ],
+ "summary": "Python distribution utilities (static libraries)"
+ },
+ "doctest": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/doctest.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/doctest.py"
+ ],
+ "rdepends": [
+ "core",
+ "debugger",
+ "difflib",
+ "logging",
+ "pprint",
+ "shell",
+ "stringold",
+ "unittest"
+ ],
+ "summary": "Python framework for running examples in docstrings"
+ },
+ "email": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/imaplib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/email",
+ "${libdir}/python3.5/imaplib.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "io",
+ "math",
+ "netclient"
+ ],
+ "summary": "Python email support"
+ },
+ "fcntl": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/fcntl.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python's fcntl interface"
+ },
+ "gdbm": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_gdbm.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python GNU database support"
+ },
+ "html": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/formatter.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/formatter.py",
+ "${libdir}/python3.5/html"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python HTML processing support"
+ },
+ "idle": {
+ "cached": [],
+ "files": [
+ "${bindir}/idle*",
+ "${libdir}/python3.5/idlelib"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Integrated Development Environment"
+ },
+ "image": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/colorsys.*.pyc",
+ "${libdir}/python3.5/__pycache__/imghdr.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/colorsys.py",
+ "${libdir}/python3.5/imghdr.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python graphical image handling"
+ },
+ "io": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_pyio.*.pyc",
+ "${libdir}/python3.5/__pycache__/ipaddress.*.pyc",
+ "${libdir}/python3.5/__pycache__/pipes.*.pyc",
+ "${libdir}/python3.5/__pycache__/socket.*.pyc",
+ "${libdir}/python3.5/__pycache__/ssl.*.pyc",
+ "${libdir}/python3.5/__pycache__/tempfile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_pyio.py",
+ "${libdir}/python3.5/ipaddress.py",
+ "${libdir}/python3.5/lib-dynload/_socket.*.so",
+ "${libdir}/python3.5/lib-dynload/_ssl.*.so",
+ "${libdir}/python3.5/lib-dynload/termios.*.so",
+ "${libdir}/python3.5/pipes.py",
+ "${libdir}/python3.5/socket.py",
+ "${libdir}/python3.5/ssl.py",
+ "${libdir}/python3.5/tempfile.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "math",
+ "netclient",
+ "shell",
+ "unixadmin"
+ ],
+ "summary": "Python low-level I/O"
+ },
+ "json": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/json",
+ "${libdir}/python3.5/lib-dynload/_json.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python JSON support"
+ },
+ "logging": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/logging"
+ ],
+ "rdepends": [
+ "core",
+ "stringold"
+ ],
+ "summary": "Python logging support"
+ },
+ "mailbox": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/mailbox.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/mailbox.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "stringold"
+ ],
+ "summary": "Python mailbox format support"
+ },
+ "math": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/random.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_random.*.so",
+ "${libdir}/python3.5/lib-dynload/cmath.*.so",
+ "${libdir}/python3.5/random.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt"
+ ],
+ "summary": "Python math support"
+ },
+ "mime": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/quopri.*.pyc",
+ "${libdir}/python3.5/__pycache__/uu.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/quopri.py",
+ "${libdir}/python3.5/uu.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python MIME handling APIs"
+ },
+ "mmap": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/mmap.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python memory-mapped file support"
+ },
+ "modules": {
+ "cached": [],
+ "files": [],
+ "rdepends": [
+ "2to3",
+ "asyncio",
+ "audio",
+ "codecs",
+ "compile",
+ "compression",
+ "core",
+ "crypt",
+ "ctypes",
+ "curses",
+ "datetime",
+ "db",
+ "debugger",
+ "difflib",
+ "distutils",
+ "doctest",
+ "email",
+ "fcntl",
+ "html",
+ "idle",
+ "image",
+ "io",
+ "json",
+ "logging",
+ "mailbox",
+ "math",
+ "mime",
+ "mmap",
+ "multiprocessing",
+ "netclient",
+ "netserver",
+ "numbers",
+ "pickle",
+ "pkgutil",
+ "plistlib",
+ "pprint",
+ "profile",
+ "pydoc",
+ "resource",
+ "runpy",
+ "shell",
+ "smtpd",
+ "sqlite3",
+ "stringold",
+ "syslog",
+ "terminal",
+ "threading",
+ "tkinter",
+ "typing",
+ "unittest",
+ "unixadmin",
+ "xml",
+ "xmlrpc"
+ ],
+ "summary": "All Python modules"
+ },
+ "multiprocessing": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_multiprocessing.*.so",
+ "${libdir}/python3.5/multiprocessing"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python multiprocessing support"
+ },
+ "netclient": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/base64.*.pyc",
+ "${libdir}/python3.5/__pycache__/ftplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/hmac.*.pyc",
+ "${libdir}/python3.5/__pycache__/mimetypes.*.pyc",
+ "${libdir}/python3.5/__pycache__/nntplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/poplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/smtplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/telnetlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/uuid.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/base64.py",
+ "${libdir}/python3.5/ftplib.py",
+ "${libdir}/python3.5/hmac.py",
+ "${libdir}/python3.5/http",
+ "${libdir}/python3.5/http/__pycache__",
+ "${libdir}/python3.5/mimetypes.py",
+ "${libdir}/python3.5/nntplib.py",
+ "${libdir}/python3.5/poplib.py",
+ "${libdir}/python3.5/smtplib.py",
+ "${libdir}/python3.5/telnetlib.py",
+ "${libdir}/python3.5/urllib",
+ "${libdir}/python3.5/urllib/__pycache__",
+ "${libdir}/python3.5/uuid.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "ctypes",
+ "datetime",
+ "email",
+ "io",
+ "math",
+ "mime",
+ "shell",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python Internet Protocol clients"
+ },
+ "netserver": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cgi.*.pyc",
+ "${libdir}/python3.5/__pycache__/socketserver.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cgi.py",
+ "${libdir}/python3.5/socketserver.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "html",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "shell",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python Internet Protocol servers"
+ },
+ "numbers": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_pydecimal.*.pyc",
+ "${libdir}/python3.5/__pycache__/decimal.*.pyc",
+ "${libdir}/python3.5/__pycache__/fractions.*.pyc",
+ "${libdir}/python3.5/__pycache__/numbers.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_pydecimal.py",
+ "${libdir}/python3.5/decimal.py",
+ "${libdir}/python3.5/fractions.py",
+ "${libdir}/python3.5/lib-dynload/_decimal.*.so",
+ "${libdir}/python3.5/numbers.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python number APIs"
+ },
+ "pickle": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_compat_pickle.*.pyc",
+ "${libdir}/python3.5/__pycache__/pickle.*.pyc",
+ "${libdir}/python3.5/__pycache__/pickletools.*.pyc",
+ "${libdir}/python3.5/__pycache__/shelve.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_compat_pickle.py",
+ "${libdir}/python3.5/lib-dynload/_pickle.*.so",
+ "${libdir}/python3.5/pickle.py",
+ "${libdir}/python3.5/pickletools.py",
+ "${libdir}/python3.5/shelve.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python serialisation/persistence support"
+ },
+ "pkgutil": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pkgutil.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pkgutil.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python package extension utility support"
+ },
+ "plistlib": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/plistlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/plistlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime",
+ "xml"
+ ],
+ "summary": "Generate and parse Mac OS X .plist files"
+ },
+ "pprint": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pprint.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pprint.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python pretty-print support"
+ },
+ "profile": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cProfile.*.pyc",
+ "${libdir}/python3.5/__pycache__/profile.*.pyc",
+ "${libdir}/python3.5/__pycache__/pstats.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cProfile.py",
+ "${libdir}/python3.5/lib-dynload/_lsprof.*.so",
+ "${libdir}/python3.5/profile.py",
+ "${libdir}/python3.5/pstats.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic performance profiling support"
+ },
+ "pydoc": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pydoc.*.pyc"
+ ],
+ "files": [
+ "${bindir}/pydoc*",
+ "${libdir}/python3.5/pydoc.py",
+ "${libdir}/python3.5/pydoc_data"
+ ],
+ "rdepends": [
+ "core",
+ "netclient",
+ "pkgutil"
+ ],
+ "summary": "Python interactive help support"
+ },
+ "resource": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/resource.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python resource control interface"
+ },
+ "runpy": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/runpy.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/runpy.py"
+ ],
+ "rdepends": [
+ "core",
+ "pkgutil"
+ ],
+ "summary": "Python helper for locating/executing scripts in module namespace"
+ },
+ "shell": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cmd.*.pyc",
+ "${libdir}/python3.5/__pycache__/fnmatch.*.pyc",
+ "${libdir}/python3.5/__pycache__/glob.*.pyc",
+ "${libdir}/python3.5/__pycache__/shlex.*.pyc",
+ "${libdir}/python3.5/__pycache__/shutil.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cmd.py",
+ "${libdir}/python3.5/fnmatch.py",
+ "${libdir}/python3.5/glob.py",
+ "${libdir}/python3.5/shlex.py",
+ "${libdir}/python3.5/shutil.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python shell-like functionality"
+ },
+ "smtpd": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/asynchat.*.pyc",
+ "${libdir}/python3.5/__pycache__/asyncore.*.pyc",
+ "${libdir}/python3.5/__pycache__/smtpd.*.pyc"
+ ],
+ "files": [
+ "${bindir}/smtpd.py",
+ "${libdir}/python3.5/asynchat.py",
+ "${libdir}/python3.5/asyncore.py",
+ "${libdir}/python3.5/smtpd.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "stringold"
+ ],
+ "summary": "Python Simple Mail Transport Daemon"
+ },
+ "sqlite3": {
+ "cached": [
+ "${libdir}/python3.5/sqlite3/__pycache__",
+ "${libdir}/python3.5/sqlite3/__pycache__/dbapi2.*.pyc",
+ "${libdir}/python3.5/sqlite3/__pycache__/dump.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_sqlite3.*.so",
+ "${libdir}/python3.5/sqlite3/dbapi2.py",
+ "${libdir}/python3.5/sqlite3/dump.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime"
+ ],
+ "summary": "Python Sqlite3 database support"
+ },
+ "sqlite3-tests": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/sqlite3/test"
+ ],
+ "rdepends": [
+ "core",
+ "tests"
+ ],
+ "summary": "Python Sqlite3 database support tests"
+ },
+ "stringold": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/string.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/string.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python string APIs [deprecated]"
+ },
+ "syslog": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/syslog.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python syslog interface"
+ },
+ "terminal": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pty.*.pyc",
+ "${libdir}/python3.5/__pycache__/tty.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pty.py",
+ "${libdir}/python3.5/tty.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python terminal controlling support"
+ },
+ "tests": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/test"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python tests"
+ },
+ "threading": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_dummy_thread.*.pyc",
+ "${libdir}/python3.5/__pycache__/_threading_local.*.pyc",
+ "${libdir}/python3.5/__pycache__/dummy_threading.*.pyc",
+ "${libdir}/python3.5/__pycache__/queue.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_dummy_thread.py",
+ "${libdir}/python3.5/_threading_local.py",
+ "${libdir}/python3.5/dummy_threading.py",
+ "${libdir}/python3.5/queue.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python threading & synchronization support"
+ },
+ "tkinter": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/tkinter"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Tcl/Tk bindings"
+ },
+ "typing": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/typing.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/typing.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python typing support"
+ },
+ "unittest": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/unittest",
+ "${libdir}/python3.5/unittest/",
+ "${libdir}/python3.5/unittest/__pycache__"
+ ],
+ "rdepends": [
+ "core",
+ "difflib",
+ "logging",
+ "pprint",
+ "shell",
+ "stringold"
+ ],
+ "summary": "Python unit testing framework"
+ },
+ "unixadmin": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/getpass.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/getpass.py",
+ "${libdir}/python3.5/lib-dynload/grp.*.so",
+ "${libdir}/python3.5/lib-dynload/nis.*.so"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python Unix administration support"
+ },
+ "xml": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_elementtree.*.so",
+ "${libdir}/python3.5/lib-dynload/pyexpat.*.so",
+ "${libdir}/python3.5/xml"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic XML support"
+ },
+ "xmlrpc": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/xmlrpc",
+ "${libdir}/python3.5/xmlrpc/__pycache__"
+ ],
+ "rdepends": [
+ "core",
+ "xml"
+ ],
+ "summary": "Python XML-RPC support"
+ }
+} \ No newline at end of file
diff --git a/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..a4f8bd471
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,25 @@
+From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 17 Nov 2014 06:44:47 +0000
+Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-3.5.4/configure.ac
+===================================================================
+--- Python-3.5.4.orig/configure.ac
++++ Python-3.5.4/configure.ac
+@@ -73,7 +73,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/poky/meta/recipes-devtools/python/python3/regen-all.patch b/poky/meta/recipes-devtools/python/python3/regen-all.patch
new file mode 100644
index 000000000..36b9d9d91
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/regen-all.patch
@@ -0,0 +1,25 @@
+python3-native: run regen-importlib target correctly
+
+regen-importlib depends on other regen- targets, so we must be sure to
+run it after (most of) the others. In reality, we do not need to run it
+at all since "make" will invoke it, if necessary. We do not want to
+rely on that, though.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -709,7 +709,8 @@ regen-importlib: Programs/_freeze_import
+ ############################################################################
+ # Regenerate all generated files
+
+-regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast regen-importlib
++regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast
++ $(MAKE) regen-importlib
+
+ ############################################################################
+ # Special rules for object files
diff --git a/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
new file mode 100644
index 000000000..fc2e12dfe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
@@ -0,0 +1,50 @@
+From 8dad810f3a3d073f09ad72e1a3ee0a895eab2ca1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 19:05:36 -0800
+Subject: [PATCH] setup.py:check cross_compiling when get FLAGS
+
+Fixed when compile target pythnon3:
+gcc -isystem/path/to/sysroots/x86_64-linux/usr/include \
+ -L=/path/to/sysroots/x86_64-linux/usr/lib
+
+This is incorrect, the native sysroot should not be used by target
+python3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ setup.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index e8339cd..83fd31f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -238,7 +238,10 @@ class PyBuildExt(build_ext):
+ # unfortunately, distutils doesn't let us provide separate C and C++
+ # compilers
+ if compiler is not None:
+- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
++ if cross_compiling:
++ (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '')
++ else:
++ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+ self.compiler.set_executables(**args)
+
+@@ -457,7 +460,10 @@ class PyBuildExt(build_ext):
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+ ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+- env_val = sysconfig.get_config_var(env_var)
++ if cross_compiling:
++ env_val = os.environ.get(env_var)
++ else:
++ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+ # To prevent optparse from raising an exception about any
+ # options in env_val that it doesn't know about we strip out
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 000000000..802b1c720
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
@@ -0,0 +1,17 @@
+shutils should consider symlinks
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800
++++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800
+@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
+ st = stat_func(src)
+ chmod_func(dst, stat.S_IMODE(st.st_mode))
+
+-if hasattr(os, 'listxattr'):
++if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
+ def _copyxattr(src, dst, *, follow_symlinks=True):
+ """Copy extended filesystem attributes from `src` to `dst`.
+
diff --git a/poky/meta/recipes-devtools/python/python3/sitecustomize.py b/poky/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
new file mode 100644
index 000000000..32ecab9fe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
@@ -0,0 +1,97 @@
+The compiled .pyc files contain time stamp corresponding to the compile time.
+This prevents binary reproducibility. This patch allows to achieve binary
+reproducibility by overriding the build time stamp by the value
+exported via SOURCE_DATE_EPOCH.
+
+Upstream-Status: Backport
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+
+From aeab488630fdb1b56a8d0b0c13fa88706b2afe9b Mon Sep 17 00:00:00 2001
+From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
+Date: Sat, 25 Feb 2017 06:42:28 +0100
+Subject: [PATCH] bpo-29708: support SOURCE_DATE_EPOCH env var in py_compile
+
+to allow for reproducible builds of python packages
+
+See https://reproducible-builds.org/ for why this is good
+and https://reproducible-builds.org/specs/source-date-epoch/
+for the definition of this variable.
+
+Background:
+In some distributions like openSUSE, binary rpms contain precompiled .pyc files.
+
+And packages like amqp or twisted dynamically generate .py files at build time
+so those have the current time and that timestamp gets embedded
+into the .pyc file header.
+When we then adapt file timestamps in rpms to be constant,
+the timestamp in the .pyc header will no more match
+the .py timestamp in the filesystem.
+The software will still work, but it will not use the .pyc file as it should.
+---
+ Doc/library/py_compile.rst | 4 ++++
+ Lib/py_compile.py | 4 ++++
+ Lib/test/test_py_compile.py | 19 +++++++++++++++++++
+ 3 files changed, 27 insertions(+)
+
+diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst
+index 0af8fb1..841f3e8 100644
+--- a/Doc/library/py_compile.rst
++++ b/Doc/library/py_compile.rst
+@@ -53,6 +53,10 @@ byte-code cache files in the directory containing the source code.
+ :func:`compile` function. The default of ``-1`` selects the optimization
+ level of the current interpreter.
+
++ If the SOURCE_DATE_EPOCH environment variable is set, the .py file mtime
++ and timestamp entry in .pyc file header, will be limited to this value.
++ See https://reproducible-builds.org/specs/source-date-epoch/ for more info.
++
+ .. versionchanged:: 3.2
+ Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous
+ default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
+diff --git a/Lib/py_compile.py b/Lib/py_compile.py
+index 11c5b50..62dcdc7 100644
+--- a/Lib/py_compile.py
++++ b/Lib/py_compile.py
+@@ -137,6 +137,10 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
+ except FileExistsError:
+ pass
+ source_stats = loader.path_stats(file)
++ sde = os.environ.get('SOURCE_DATE_EPOCH')
++ if sde and source_stats['mtime'] > int(sde):
++ source_stats['mtime'] = int(sde)
++ os.utime(file, (source_stats['mtime'], source_stats['mtime']))
+ bytecode = importlib._bootstrap_external._code_to_bytecode(
+ code, source_stats['mtime'], source_stats['size'])
+ mode = importlib._bootstrap_external._calc_mode(file)
+diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
+index 4a6caa5..3d09963 100644
+--- a/Lib/test/test_py_compile.py
++++ b/Lib/test/test_py_compile.py
+@@ -98,6 +98,25 @@ def test_bad_coding(self):
+ self.assertFalse(os.path.exists(
+ importlib.util.cache_from_source(bad_coding)))
+
++ def test_source_date_epoch(self):
++ testtime = 123456789
++ orig_sde = os.getenv("SOURCE_DATE_EPOCH")
++ os.environ["SOURCE_DATE_EPOCH"] = str(testtime)
++ py_compile.compile(self.source_path, self.pyc_path)
++ if orig_sde:
++ os.environ["SOURCE_DATE_EPOCH"] = orig_sde
++ else:
++ del os.environ["SOURCE_DATE_EPOCH"]
++ self.assertTrue(os.path.exists(self.pyc_path))
++ self.assertFalse(os.path.exists(self.cache_path))
++ statinfo = os.stat(self.source_path)
++ self.assertEqual(statinfo.st_mtime, testtime)
++ f = open(self.pyc_path, "rb")
++ f.read(4)
++ timebytes = f.read(4) # read timestamp from pyc header
++ f.close()
++ self.assertEqual(timebytes, (testtime).to_bytes(4, 'little'))
++
+ @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O')
+ def test_double_dot_no_clobber(self):
+ # http://bugs.python.org/issue22966
diff --git a/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
new file mode 100644
index 000000000..c89d9a3d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
@@ -0,0 +1,51 @@
+From fc93b3cc23b4f9698ae92a42986dbb02b6f19588 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 06:29:50 -0800
+Subject: [PATCH] sysconfig.py: add _PYTHON_PROJECT_SRC
+
+python3 has introduced _PYTHON_PROJECT_BASE which is used for separate B
+and S, but it doesn't work when compile Modules, the target python3 runs
+python3-native's sysconfig to get srcdir which is the native's, there
+would be errors when native's srcdir has been removed, add
+_PYTHON_PROJECT_SRC to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Lib/distutils/sysconfig.py | 5 ++++-
+ Lib/sysconfig.py | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+Index: Python-3.5.3/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-3.5.3.orig/Lib/distutils/sysconfig.py
++++ Python-3.5.3/Lib/distutils/sysconfig.py
+@@ -498,7 +498,10 @@ def get_config_vars(*args):
+ _config_vars['SO'] = SO
+
+ # Always convert srcdir to an absolute path
+- srcdir = _config_vars.get('srcdir', project_base)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _config_vars.get('srcdir', project_base)
+ if os.name == 'posix':
+ if python_build:
+ # If srcdir is a relative path (typically '.' or '..')
+Index: Python-3.5.3/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.3.orig/Lib/sysconfig.py
++++ Python-3.5.3/Lib/sysconfig.py
+@@ -544,7 +544,10 @@ def get_config_vars(*args):
+ _CONFIG_VARS['userbase'] = _getuserbase()
+
+ # Always convert srcdir to an absolute path
+- srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+ if os.name == 'posix':
+ if _PYTHON_BUILD:
+ # If srcdir is a relative path (typically '.' or '..')
diff --git a/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 000000000..785b5567f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
@@ -0,0 +1,35 @@
+Dont search hardcoded paths, we might be doing a cross-build
+Use '=' in-front to let compiler append sysroot, if it can
+
+Should fix things like
+
+configure:6972: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types -I/usr/include/ncursesw conftest.c >&5
+cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
+
+
+Signed-off-by: Khem Raj
+Upstream-Status: Pending
+
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700
++++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700
+@@ -1210,7 +1210,7 @@
+ panel_library = 'panel'
+ if curses_library == 'ncursesw':
+ curses_defines.append(('HAVE_NCURSESW', '1'))
+- curses_includes.append('/usr/include/ncursesw')
++ curses_includes.append('=/usr/include/ncursesw')
+ # Bug 1464056: If _curses.so links with ncursesw,
+ # _curses_panel.so must link with panelw.
+ panel_library = 'panelw'
+@@ -1819,7 +1819,7 @@
+ if host_platform == 'darwin':
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+- inc_dirs.append('/usr/include/ffi')
++ inc_dirs.append('=/usr/include/ffi')
+
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
+ if not ffi_inc or ffi_inc[0] == '':
diff --git a/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
new file mode 100644
index 000000000..8d037278b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
@@ -0,0 +1,52 @@
+From 5d6509313198ec9b686cad50b002212e4344004b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 11 Mar 2016 01:15:45 -0500
+Subject: [PATCH] configure.ac: tweak MULTIARCH for powerpc-linux-gnuspe
+
+For p1022ds bsp, the MULTIARCH is powerpc-linux-gnuspev1 and
+python3 did not recognize the extra 'v1' which caused python3
+configure error for the platform triplet.
+
+Q:Why Python3 check platform triplet?
+
+A:Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
+the architecture triplet in the extension name, to make it easy to
+test builds for different ABIs in the same working tree.
+
+Here is the generated C extensions which take platform triplet into account.
+...
+|image/usr/lib/python3.5/lib-dynload/_datetime.cpython-35m-powerpc-linux-gnuspe.so
+...
+
+https://bugs.python.org/issue22980
+https://www.python.org/dev/peps/pep-3149/
+https://bugs.python.org/review/22980/patch/14593/54808
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9eb3d22..c34a9a0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -724,6 +724,13 @@ fi
+
+
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
++
++# Tweak MULTIARCH
++if test x$MULTIARCH = xpowerpc-linux-gnuspev1
++then
++ MULTIARCH="powerpc-linux-gnuspe"
++fi
++
+ AC_SUBST(MULTIARCH)
+
+ AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 000000000..3e2b1d1c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
+use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
+ok on native systems too since sysroot for native compilers is /
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-3.3.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
+@@ -202,7 +202,9 @@
+ # ccompiler.py.
+
+ def library_dir_option(self, dir):
+- return "-L" + dir
++ if dir.startswith("/"):
++ return "-L=" + dir
++ return "-L" + dir
+
+ def _is_gcc(self, compiler_name):
+ return "gcc" in compiler_name or "g++" in compiler_name
+@@ -221,7 +221,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/poky/meta/recipes-devtools/python/python3_3.5.5.bb b/poky/meta/recipes-devtools/python/python3_3.5.5.bb
new file mode 100644
index 000000000..f893b846a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -0,0 +1,323 @@
+require recipes-devtools/python/python.inc
+
+DEPENDS = "python3-native libffi bzip2 gdbm openssl sqlite3 zlib virtual/libintl xz"
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+PYTHON_BINABI= "${PYTHON_MAJMIN}m"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://python-config.patch \
+file://0001-cross-compile-support.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch \
+file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \
+${DISTRO_SRC_URI} \
+"
+
+SRC_URI += "\
+ file://03-fix-tkinter-detection.patch \
+ file://avoid_warning_about_tkinter.patch \
+ file://cgi_py.patch \
+ file://host_include_contamination.patch \
+ file://python-3.3-multilib.patch \
+ file://shutil-follow-symlink-fix.patch \
+ file://sysroot-include-headers.patch \
+ file://unixccompiler.patch \
+ file://avoid-ncursesw-include-path.patch \
+ file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+ file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+ file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+ file://configure.ac-fix-LIBPL.patch \
+ file://0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch \
+ file://pass-missing-libraries-to-Extension-for-mul.patch \
+ "
+SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0"
+SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b6ec515b22618f55fa07276b897bacea"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python3native pkgconfig
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
+ ac_cv_have_lchflags=no \
+ ac_cv_have_long_long_format=yes \
+ ac_cv_buggy_getaddrinfo=no \
+ ac_cv_file__dev_ptmx=yes \
+ ac_cv_file__dev_ptc=no \
+"
+
+TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
+SDK_CC_ARCH += "-DNDEBUG -fno-inline"
+EXTRA_OEMAKE += "CROSS_COMPILE=yes"
+EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
+
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+export _PYTHON_PROJECT_BASE = "${B}"
+export _PYTHON_PROJECT_SRC = "${S}"
+export CCSHARED = "-fPIC"
+
+# Fix cross compilation of different modules
+export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/:${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+PACKAGECONFIG ??= "readline"
+PACKAGECONFIG[readline] = ",,readline"
+
+do_configure_append() {
+ rm -f ${S}/Makefile.orig
+ autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+ # regenerate platform specific files, because they depend on system headers
+ cd ${S}/Lib/plat-linux*
+ include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+ ${STAGING_INCDIR}/dlfcn.h \
+ ${STAGING_INCDIR}/linux/cdrom.h \
+ ${STAGING_INCDIR}/netinet/in.h \
+ ${STAGING_INCDIR}/sys/types.h
+ sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+ cd -
+
+
+ # remove any bogus LD_LIBRARY_PATH
+ sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+ if [ ! -f Makefile.orig ]; then
+ install -m 0644 Makefile Makefile.orig
+ fi
+ sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
+ -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+ -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+ -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+ -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+ -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+ -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+ Makefile
+ # save copy of it now, because if we do it in do_install and
+ # then call do_install twice we get Makefile.orig == Makefile.sysroot
+ install -m 0644 Makefile Makefile.sysroot
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}" libpython3.so
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}"
+}
+
+do_install() {
+ # make install needs the original Makefile, or otherwise the inclues would
+ # go to ${D}${STAGING...}/...
+ install -m 0644 Makefile.orig Makefile
+
+ install -d ${D}${libdir}/pkgconfig
+ install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
+
+ # rerun the build once again with original makefile this time
+ # run install in a separate step to avoid compile/install race
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir}
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir} install
+
+ # avoid conflict with 2to3 from Python 2
+ rm -f ${D}/${bindir}/2to3
+
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
+
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+
+ oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+ # copy back the old Makefile to fix target package
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
+ # Remove references to buildmachine paths in target Makefile and _sysconfigdata
+ sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+ ${PKGD}/${bindir}/python${PYTHON_BINABI}-config
+
+ # Recompile _sysconfigdata after modifying it
+ cd ${PKGD}
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py')"
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py', optimize=1)"
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py', optimize=2)"
+ cd -
+}
+
+# manual dependency additions
+RPROVIDES_${PN}-modules = "${PN}"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
+
+FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
+FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
+FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+
+PACKAGES =+ "${PN}-pyvenv"
+FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
+
+# package libpython3
+PACKAGES =+ "libpython3 libpython3-staticdev"
+FILES_libpython3 = "${libdir}/libpython*.so.*"
+FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+RDEPENDS_${PN}-misc += "${PN}-core ${PN}-email ${PN}-codecs"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
+
+RPROVIDES_${PN} += "${PN}-modules"
+
+# We want bytecode precompiled .py files (.pyc's) by default
+# but the user may set it on their own conf
+INCLUDE_PYCS ?= "1"
+
+python(){
+ import json
+
+ filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')
+ # This python changes the datastore based on the contents of a file, so mark
+ # that dependency.
+ bb.parse.mark_dependency(d, filename)
+
+ with open(filename) as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ include_pycs = d.getVar('INCLUDE_PYCS')
+
+ packages = d.getVar('PACKAGES').split()
+ pn = d.getVar('PN')
+
+ newpackages=[]
+ for key in python_manifest:
+ pypackage= pn + '-' + key
+
+ if pypackage not in packages:
+ # We need to prepend, otherwise python-misc gets everything
+ # so we use a new variable
+ newpackages.append(pypackage)
+
+ # "Build" python's manifest FILES, RDEPENDS and SUMMARY
+ d.setVar('FILES_' + pypackage, '')
+ for value in python_manifest[key]['files']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+
+ # Add cached files
+ if include_pycs == '1':
+ for value in python_manifest[key]['cached']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+
+ d.setVar('RDEPENDS_' + pypackage, '')
+ for value in python_manifest[key]['rdepends']:
+ # Make it work with or without $PN
+ if '${PN}' in value:
+ value=value.split('-')[1]
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+ d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
+
+ # We need to ensure staticdev packages match for files first so we sort in reverse
+ newpackages.sort(reverse=True)
+ # Prepending so to avoid python-misc getting everything
+ packages = newpackages + packages
+ d.setVar('PACKAGES', ' '.join(packages))
+ d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
+}
+
+# Files needed to create a new manifest
+SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json"
+
+do_create_manifest() {
+ # This task should be run with every new release of Python.
+ # We must ensure that PACKAGECONFIG enables everything when creating
+ # a new manifest, this is to base our new manifest on a complete
+ # native python build, containing all dependencies, otherwise the task
+ # wont be able to find the required files.
+ # e.g. BerkeleyDB is an optional build dependency so it may or may not
+ # be present, we must ensure it is.
+
+ cd ${WORKDIR}
+ # This needs to be executed by python-native and NOT by HOST's python
+ nativepython3 create_manifest3.py
+ cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
+}
+
+# bitbake python -c create_manifest
+addtask do_create_manifest
+
+# Make sure we have native python ready when we create a new manifest
+do_create_manifest[depends] += "python3:do_prepare_recipe_sysroot"
+do_create_manifest[depends] += "python3:do_patch"
diff --git a/poky/meta/recipes-devtools/python/python_2.7.14.bb b/poky/meta/recipes-devtools/python/python_2.7.14.bb
new file mode 100644
index 000000000..41a8609b1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python_2.7.14.bb
@@ -0,0 +1,282 @@
+require python.inc
+
+DEPENDS = "python-native libffi bzip2 gdbm openssl readline sqlite3 zlib"
+
+PR = "${INC_PR}"
+
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI += "\
+ file://01-use-proper-tools-for-cross-build.patch \
+ file://03-fix-tkinter-detection.patch \
+ file://06-avoid_usr_lib_termcap_path_in_linking.patch \
+ ${DISTRO_SRC_URI} \
+ file://multilib.patch \
+ file://cgi_py.patch \
+ file://setup_py_skip_cross_import_check.patch \
+ file://add-md5module-support.patch \
+ file://host_include_contamination.patch \
+ file://fix_for_using_different_libdir.patch \
+ file://setuptweaks.patch \
+ file://check-if-target-is-64b-not-host.patch \
+ file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
+ file://avoid_warning_about_tkinter.patch \
+ file://avoid_warning_for_sunos_specific_module.patch \
+ file://python-2.7.3-remove-bsdb-rpath.patch \
+ file://fix-makefile-for-ptest.patch \
+ file://run-ptest \
+ file://parallel-makeinst-create-bindir.patch \
+ file://use_sysroot_ncurses_instead_of_host.patch \
+ file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+ file://pass-missing-libraries-to-Extension-for-mul.patch \
+ file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \
+ file://fix-gc-alignment.patch \
+"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python-dir pythonnative
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
+
+PACKAGECONFIG ??= "bdb"
+PACKAGECONFIG[bdb] = ",,db"
+
+do_configure_append() {
+ rm -f ${S}/Makefile.orig
+ autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+ # regenerate platform specific files, because they depend on system headers
+ cd ${S}/Lib/plat-linux2
+ include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
+ ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+ ${STAGING_INCDIR}/dlfcn.h \
+ ${STAGING_INCDIR}/linux/cdrom.h \
+ ${STAGING_INCDIR}/netinet/in.h \
+ ${STAGING_INCDIR}/sys/types.h
+ sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+ cd -
+
+ # remove any bogus LD_LIBRARY_PATH
+ sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+ if [ ! -f Makefile.orig ]; then
+ install -m 0644 Makefile Makefile.orig
+ fi
+ sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
+ -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+ -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+ -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+ -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+ -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+ -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+ Makefile
+ # save copy of it now, because if we do it in do_install and
+ # then call do_install twice we get Makefile.orig == Makefile.sysroot
+ install -m 0644 Makefile Makefile.sysroot
+
+ export CROSS_COMPILE="${TARGET_PREFIX}"
+ export PYTHONBUILDDIR="${B}"
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ OPT="${CFLAGS}"
+}
+
+do_install() {
+ # make install needs the original Makefile, or otherwise the inclues would
+ # go to ${D}${STAGING...}/...
+ install -m 0644 Makefile.orig Makefile
+
+ export CROSS_COMPILE="${TARGET_PREFIX}"
+ export PYTHONBUILDDIR="${B}"
+
+ # After swizzling the makefile, we need to run the build again.
+ # install can race with the build so we have to run this first, then install
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ DESTDIR=${D} LIBDIR=${libdir}
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ DESTDIR=${D} LIBDIR=${libdir} install
+
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+
+ oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
+
+ if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
+ rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
+ fi
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+ # copy back the old Makefile to fix target package
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+ # Remove references to buildmachine paths in target Makefile and _sysconfigdata
+ sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+ (cd ${PKGD}; python -m py_compile ./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py)
+}
+
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+
+# package libpython2
+PACKAGES =+ "lib${BPN}2"
+FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+
+# ptest
+RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests"
+#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
+inherit ptest
+
+# This must come after inherit ptest for the override to take effect
+do_install_ptest() {
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
+ -e s:LIBDIR:${libdir}:g \
+ -i ${D}${PTEST_PATH}/run-ptest
+
+ #Remove build host references
+ sed -i \
+ -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${D}/${PTEST_PATH}/Makefile
+}
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+# Nasty but if bdb isn't enabled the package won't be generated
+RDEPENDS_${PN}-modules_remove = "${@bb.utils.contains('PACKAGECONFIG', 'bdb', '', '${PN}-bsddb', d)}"
+
+BBCLASSEXTEND = "nativesdk"
+
+RPROVIDES_${PN} += "${PN}-modules"
+
+# We want bytecode precompiled .py files (.pyc's) by default
+# but the user may set it on their own conf
+
+INCLUDE_PYCS ?= "1"
+
+python(){
+ import json
+
+ filename = os.path.join(d.getVar('THISDIR'), 'python', 'python2-manifest.json')
+ # This python changes the datastore based on the contents of a file, so mark
+ # that dependency.
+ bb.parse.mark_dependency(d, filename)
+
+ with open(filename) as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ include_pycs = d.getVar('INCLUDE_PYCS')
+
+ packages = d.getVar('PACKAGES').split()
+ pn = d.getVar('PN')
+
+ newpackages=[]
+
+ for key in python_manifest:
+ pypackage= pn + '-' + key
+
+ if pypackage not in packages:
+ # We need to prepend, otherwise python-misc gets everything
+ # so we use a new variable
+ newpackages.append(pypackage)
+
+ # "Build" python's manifest FILES, RDEPENDS and SUMMARY
+ d.setVar('FILES_' + pypackage, '')
+ for value in python_manifest[key]['files']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+ if include_pycs == '1':
+ if value.endswith('.py'):
+ d.appendVar('FILES_' + pypackage, ' ' + value + 'c')
+
+ d.setVar('RDEPENDS_' + pypackage, '')
+ for value in python_manifest[key]['rdepends']:
+ # Make it work with or without $PN
+ if '${PN}' in value:
+ value=value.split('-')[1]
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+ d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
+
+ # We need to ensure staticdev packages match for files first so we sort in reverse
+ newpackages.sort(reverse=True)
+ # Prepending so to avoid python-misc getting everything
+ packages = newpackages + packages
+ d.setVar('PACKAGES', ' '.join(packages))
+ d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
+}
+
+# Files needed to create a new manifest
+SRC_URI += "file://create_manifest2.py file://get_module_deps2.py file://python2-manifest.json"
+
+do_create_manifest() {
+ # This task should be run with every new release of Python.
+ # We must ensure that PACKAGECONFIG enables everything when creating
+ # a new manifest, this is to base our new manifest on a complete
+ # native python build, containing all dependencies, otherwise the task
+ # wont be able to find the required files.
+ # e.g. BerkeleyDB is an optional build dependency so it may or may not
+ # be present, we must ensure it is.
+
+ cd ${WORKDIR}
+ # This needs to be executed by python-native and NOT by HOST's python
+ nativepython create_manifest2.py
+ cp python2-manifest.json.new ${THISDIR}/python/python2-manifest.json
+}
+
+# bitbake python -c create_manifest
+addtask do_create_manifest
+
+# Make sure we have native python ready when we create a new manifest
+do_create_manifest[depends] += "python:do_prepare_recipe_sysroot"
+do_create_manifest[depends] += "python:do_patch"
diff --git a/poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb b/poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
new file mode 100644
index 000000000..cdc2f51c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Qemu helper scripts"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "nativesdk-qemu \
+ nativesdk-python3-shell nativesdk-python3-fcntl nativesdk-python3-logging \
+ "
+
+PR = "r9"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \
+ file://${COREBASE}/scripts/runqemu;endline=19;md5=a8ad1905c709a2deaa057608ebaf705a"
+
+
+SRC_URI = "file://${COREBASE}/scripts/runqemu \
+ file://${COREBASE}/scripts/runqemu-addptable2image \
+ file://${COREBASE}/scripts/runqemu-gen-tapdevs \
+ file://${COREBASE}/scripts/runqemu-ifup \
+ file://${COREBASE}/scripts/runqemu-ifdown \
+ file://${COREBASE}/scripts/oe-find-native-sysroot \
+ file://${COREBASE}/scripts/runqemu-extract-sdk \
+ file://${COREBASE}/scripts/runqemu-export-rootfs \
+ file://tunctl.c \
+ "
+
+S = "${WORKDIR}"
+
+inherit nativesdk
+
+do_compile() {
+ ${CC} tunctl.c -o tunctl
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}${COREBASE}/scripts/oe-* ${D}${bindir}/
+ install -m 0755 ${WORKDIR}${COREBASE}/scripts/runqemu* ${D}${bindir}/
+ install tunctl ${D}${bindir}/
+}
diff --git a/poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb b/poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
new file mode 100644
index 000000000..d86b15517
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Helper utilities needed by the runqemu script"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "qemu-native"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
+
+SRC_URI = "file://tunctl.c"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_compile() {
+ ${CC} tunctl.c -o tunctl
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install tunctl ${D}${bindir}/
+}
+
+DEPENDS += "qemu-native"
+addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
new file mode 100644
index 000000000..16e24a2ad
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
@@ -0,0 +1,156 @@
+/* Copyright 2002 Jeff Dike
+ * Licensed under the GPL
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <linux/if_tun.h>
+
+/* TUNSETGROUP appeared in 2.6.23 */
+#ifndef TUNSETGROUP
+#define TUNSETGROUP _IOW('T', 206, int)
+#endif
+
+static void Usage(char *name)
+{
+ fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
+ "[-f tun-clone-device]\n", name);
+ fprintf(stderr, "Delete: %s -d device-name [-f tun-clone-device]\n\n",
+ name);
+ fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
+ " use\n/dev/misc/net/tun instead\n\n");
+ fprintf(stderr, "-b will result in brief output (just the device name)\n");
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ struct ifreq ifr;
+ struct passwd *pw;
+ struct group *gr;
+ uid_t owner = -1;
+ gid_t group = -1;
+ int tap_fd, opt, delete = 0, brief = 0;
+ char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
+
+ while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
+ switch(opt) {
+ case 'b':
+ brief = 1;
+ break;
+ case 'd':
+ delete = 1;
+ tun = optarg;
+ break;
+ case 'f':
+ file = optarg;
+ break;
+ case 'u':
+ pw = getpwnam(optarg);
+ if(pw != NULL){
+ owner = pw->pw_uid;
+ break;
+ }
+ owner = strtol(optarg, &end, 0);
+ if(*end != '\0'){
+ fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
+ optarg);
+ Usage(name);
+ }
+ break;
+ case 'g':
+ gr = getgrnam(optarg);
+ if(gr != NULL){
+ group = gr->gr_gid;
+ break;
+ }
+ group = strtol(optarg, &end, 0);
+ if(*end != '\0'){
+ fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
+ optarg);
+ Usage(name);
+ }
+ break;
+
+ case 't':
+ tun = optarg;
+ break;
+ case 'h':
+ default:
+ Usage(name);
+ }
+ }
+
+ argv += optind;
+ argc -= optind;
+
+ if(argc > 0)
+ Usage(name);
+
+ if((tap_fd = open(file, O_RDWR)) < 0){
+ fprintf(stderr, "Failed to open '%s' : ", file);
+ perror("");
+ exit(1);
+ }
+
+ memset(&ifr, 0, sizeof(ifr));
+
+ ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+ strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
+ if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
+ perror("TUNSETIFF");
+ exit(1);
+ }
+
+ if(delete){
+ if(ioctl(tap_fd, TUNSETPERSIST, 0) < 0){
+ perror("disabling TUNSETPERSIST");
+ exit(1);
+ }
+ printf("Set '%s' nonpersistent\n", ifr.ifr_name);
+ }
+ else {
+ /* emulate behaviour prior to TUNSETGROUP */
+ if(owner == -1 && group == -1) {
+ owner = geteuid();
+ }
+
+ if(owner != -1) {
+ if(ioctl(tap_fd, TUNSETOWNER, owner) < 0){
+ perror("TUNSETOWNER");
+ exit(1);
+ }
+ }
+ if(group != -1) {
+ if(ioctl(tap_fd, TUNSETGROUP, group) < 0){
+ perror("TUNSETGROUP");
+ exit(1);
+ }
+ }
+
+ if(ioctl(tap_fd, TUNSETPERSIST, 1) < 0){
+ perror("enabling TUNSETPERSIST");
+ exit(1);
+ }
+
+ if(brief)
+ printf("%s\n", ifr.ifr_name);
+ else {
+ printf("Set '%s' persistent and owned by", ifr.ifr_name);
+ if(owner != -1)
+ printf(" uid %d", owner);
+ if(group != -1)
+ printf(" gid %d", group);
+ printf("\n");
+ }
+ }
+ return(0);
+}
diff --git a/poky/meta/recipes-devtools/qemu/qemu-targets.inc b/poky/meta/recipes-devtools/qemu/qemu-targets.inc
new file mode 100644
index 000000000..66dd675ed
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu-targets.inc
@@ -0,0 +1,22 @@
+# possible arch values are arm aarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64abi32
+# ppcemb armeb alpha sparc32plus i386 x86_64 cris m68k microblaze sparc sparc32
+# sparc32plus
+
+def get_qemu_target_list(d):
+ import bb
+ archs = d.getVar('QEMU_TARGETS').split()
+ tos = d.getVar('HOST_OS')
+ softmmuonly = ""
+ for arch in ['ppcemb']:
+ if arch in archs:
+ softmmuonly += arch + "-softmmu,"
+ archs.remove(arch)
+ linuxuseronly = ""
+ for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus']:
+ if arch in archs:
+ linuxuseronly += arch + "-linux-user,"
+ archs.remove(arch)
+ if 'linux' not in tos:
+ return softmmuonly + ''.join([arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+ return softmmuonly + linuxuseronly + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu.inc b/poky/meta/recipes-devtools/qemu/qemu.inc
new file mode 100644
index 000000000..dc73df813
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu.inc
@@ -0,0 +1,119 @@
+SUMMARY = "Fast open source processor emulator"
+HOMEPAGE = "http://qemu.org"
+LICENSE = "GPLv2 & LGPLv2.1"
+DEPENDS = "glib-2.0 zlib pixman"
+RDEPENDS_${PN}_class-target += "bash"
+
+require qemu-targets.inc
+inherit autotools pkgconfig bluetooth
+BBCLASSEXTEND = "native nativesdk"
+
+# QEMU_TARGETS is overridable variable
+QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
+
+EXTRA_OECONF = " \
+ --prefix=${prefix} \
+ --bindir=${bindir} \
+ --includedir=${includedir} \
+ --libdir=${libdir} \
+ --mandir=${mandir} \
+ --datadir=${datadir} \
+ --docdir=${docdir}/${BPN} \
+ --sysconfdir=${sysconfdir} \
+ --libexecdir=${libexecdir} \
+ --localstatedir=${localstatedir} \
+ --with-confsuffix=/${BPN} \
+ --disable-strip \
+ --disable-werror \
+ --target-list=${@get_qemu_target_list(d)} \
+ --extra-cflags='${CFLAGS}' \
+ "
+EXTRA_OECONF_append_class-native = " --python=python2.7"
+
+EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
+
+LDFLAGS_append_class-native = " -fuse-ld=bfd"
+
+export LIBTOOL="${HOST_SYS}-libtool"
+
+do_configure_prepend_class-native() {
+ # Append build host pkg-config paths for native target since the host may provide sdl
+ BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
+ if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
+ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
+ fi
+
+ # Alter target makefiles to accept CFLAGS set via env
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ "${S}"/Makefile "${S}"/Makefile.target
+}
+
+do_configure() {
+ ${S}/configure ${EXTRA_OECONF}
+ test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
+}
+
+do_install () {
+ export STRIP="true"
+ autotools_do_install
+}
+
+# The following fragment will create a wrapper for qemu-mips user emulation
+# binary in order to work around a segmentation fault issue. Basically, by
+# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
+# This will trigger a MMU access fault in the virtual CPU. With this change,
+# the qemu-mips works fine.
+# IMPORTANT: This piece needs to be removed once the root cause is fixed!
+do_install_append() {
+ if [ -e "${D}/${bindir}/qemu-mips" ]; then
+ create_wrapper ${D}/${bindir}/qemu-mips \
+ QEMU_RESERVED_VA=0x0
+ fi
+}
+# END of qemu-mips workaround
+
+PACKAGECONFIG ??= " \
+ fdt sdl \
+ fdt sdl kvm \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa xen', d)} \
+ "
+PACKAGECONFIG_class-native ??= "fdt alsa kvm"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl kvm"
+
+# Handle distros such as CentOS 5 32-bit that do not have kvm support
+PACKAGECONFIG_class-native_remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
+
+# Disable kvm on targets that do not support it
+PACKAGECONFIG_remove_darwin = "kvm"
+PACKAGECONFIG_remove_mingw32 = "kvm"
+
+PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl"
+PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
+PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
+PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
+PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
+PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
+PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
+PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
+PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
+PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
+PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte"
+PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
+PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
+PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
+PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
+PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
+PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
+PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
+PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
+PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
+PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
+PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
+PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
+PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
+PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
+
+INSANE_SKIP_${PN} = "arch"
diff --git a/poky/meta/recipes-devtools/qemu/qemu/0001-arm-translate-a64-treat-DISAS_UPDATE-as-variant-of-D.patch b/poky/meta/recipes-devtools/qemu/qemu/0001-arm-translate-a64-treat-DISAS_UPDATE-as-variant-of-D.patch
new file mode 100644
index 000000000..f90cae694
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/0001-arm-translate-a64-treat-DISAS_UPDATE-as-variant-of-D.patch
@@ -0,0 +1,67 @@
+From a75a52d62418dafe462be4fe30485501d1010bb9 Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Fri, 23 Mar 2018 18:26:45 +0000
+Subject: [PATCH] arm/translate-a64: treat DISAS_UPDATE as variant of
+ DISAS_EXIT
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In OE project 4.15 linux kernel boot hang was observed under
+single cpu aarch64 qemu. Kernel code was in a loop waiting for
+vtimer arrival, spinning in TC generated blocks, while interrupt
+was pending unprocessed. This happened because when qemu tried to
+handle vtimer interrupt target had interrupts disabled, as
+result flag indicating TCG exit, cpu->icount_decr.u16.high,
+was cleared but arm_cpu_exec_interrupt function did not call
+arm_cpu_do_interrupt to process interrupt. Later when target
+reenabled interrupts, it happened without exit into main loop, so
+following code that waited for result of interrupt execution
+run in infinite loop.
+
+To solve the problem instructions that operate on CPU sys state
+(i.e enable/disable interrupt), and marked as DISAS_UPDATE,
+should be considered as DISAS_EXIT variant, and should be
+forced to exit back to main loop so qemu will have a chance
+processing pending CPU state updates, including pending
+interrupts.
+
+This change brings consistency with how DISAS_UPDATE is treated
+in aarch32 case.
+
+CC: Peter Maydell <peter.maydell@linaro.org>
+CC: Alex Bennée <alex.bennee@linaro.org>
+CC: qemu-stable@nongnu.org
+Suggested-by: Peter Maydell <peter.maydell@linaro.org>
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
+Message-id: 1521526368-1996-1-git-send-email-kamensky@cisco.com
+Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
+Upstream-Status: Backport
+---
+ target/arm/translate-a64.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
+index 31ff047..327513e 100644
+--- a/target/arm/translate-a64.c
++++ b/target/arm/translate-a64.c
+@@ -13378,12 +13378,12 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
+ case DISAS_UPDATE:
+ gen_a64_set_pc_im(dc->pc);
+ /* fall through */
+- case DISAS_JUMP:
+- tcg_gen_lookup_and_goto_ptr();
+- break;
+ case DISAS_EXIT:
+ tcg_gen_exit_tb(0);
+ break;
++ case DISAS_JUMP:
++ tcg_gen_lookup_and_goto_ptr();
++ break;
+ case DISAS_NORETURN:
+ case DISAS_SWI:
+ break;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile-v10.patch b/poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile-v10.patch
new file mode 100644
index 000000000..e9639820b
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile-v10.patch
@@ -0,0 +1,28 @@
+From 4201a5791fc4798a45a9b9f881602d7bacb74ed1 Mon Sep 17 00:00:00 2001
+From: Juro Bystricky <juro.bystricky@intel.com>
+Date: Thu, 31 Aug 2017 11:06:56 -0700
+Subject: Add subpackage -ptest which runs all unit test cases for qemu.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+diff --git a/tests/Makefile.include b/tests/Makefile.include
+index f08b741..3d1b3e9 100644
+--- a/tests/Makefile.include
++++ b/tests/Makefile.include
+@@ -924,4 +924,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
+ -include $(wildcard tests/*.d)
+ -include $(wildcard tests/libqos/*.d)
+
++buildtest-TESTS: $(check-unit-y)
++
++runtest-TESTS:
++ for f in $(check-unit-y); do \
++ nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
++ $$nf; \
++ done
++
+ endif
diff --git a/poky/meta/recipes-devtools/qemu/qemu/apic-fixup-fallthrough-to-PIC.patch b/poky/meta/recipes-devtools/qemu/qemu/apic-fixup-fallthrough-to-PIC.patch
new file mode 100644
index 000000000..d6a3522ed
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/apic-fixup-fallthrough-to-PIC.patch
@@ -0,0 +1,43 @@
+From bef93bb81588b5323a52d2e1886f2a77b64a976b Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Tue, 26 Feb 2013 11:43:28 -0500
+Subject: [PATCH 03/18] apic: fixup fallthrough to PIC
+
+Commit 0e21e12bb311c4c1095d0269dc2ef81196ccb60a [Don't route PIC
+interrupts through the local APIC if the local APIC config says so.]
+missed a check to ensure the local APIC is enabled. Since if the local
+APIC is disabled it doesn't matter what the local APIC config says.
+
+If this check isn't done and the guest has disabled the local APIC the
+guest will receive a general protection fault, similar to what is seen
+here:
+
+https://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02304.html
+
+The GPF is caused by an attempt to service interrupt 0xffffffff. This
+comes about since cpu_get_pic_interrupt() calls apic_accept_pic_intr()
+(with the local APIC disabled apic_get_interrupt() returns -1).
+apic_accept_pic_intr() returns 0 and thus the interrupt number which
+is returned from cpu_get_pic_interrupt(), and which is attempted to be
+serviced, is -1.
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg00878.html]
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ hw/intc/apic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: qemu-2.11.1/hw/intc/apic.c
+===================================================================
+--- qemu-2.11.1.orig/hw/intc/apic.c
++++ qemu-2.11.1/hw/intc/apic.c
+@@ -591,7 +591,7 @@ int apic_accept_pic_intr(DeviceState *de
+ APICCommonState *s = APIC(dev);
+ uint32_t lvt0;
+
+- if (!s)
++ if (!s || !(s->spurious_vec & APIC_SV_ENABLE))
+ return -1;
+
+ lvt0 = s->lvt[APIC_LVT_LINT0];
diff --git a/poky/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch b/poky/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch
new file mode 100644
index 000000000..6e6bf95c1
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/chardev-connect-socket-to-a-spawned-command.patch
@@ -0,0 +1,242 @@
+From 3bb3100c22eb30146a69656480bdffeef8663575 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@xilinx.com>
+Date: Thu, 21 Dec 2017 11:35:16 -0800
+Subject: [PATCH] chardev: connect socket to a spawned command
+
+The command is started in a shell (sh -c) with stdin connect to QEMU
+via a Unix domain stream socket. QEMU then exchanges data via its own
+end of the socket, just like it normally does.
+
+"-chardev socket" supports some ways of connecting via protocols like
+telnet, but that is only a subset of the functionality supported by
+tools socat. To use socat instead, for example to connect via a socks
+proxy, use:
+
+ -chardev 'socket,id=socat,cmd=exec socat FD:0 SOCKS4A:socks-proxy.localdomain:example.com:9999,,socksuser=nobody' \
+ -device usb-serial,chardev=socat
+
+Beware that commas in the command must be escaped as double commas.
+
+Or interactively in the console:
+ (qemu) chardev-add socket,id=cat,cmd=cat
+ (qemu) device_add usb-serial,chardev=cat
+ ^ac
+ # cat >/dev/ttyUSB0
+ hello
+ hello
+
+Another usage is starting swtpm from inside QEMU. swtpm will
+automatically shut down once it looses the connection to the parent
+QEMU, so there is no risk of lingering processes:
+
+ -chardev 'socket,id=chrtpm0,cmd=exec swtpm socket --terminate --ctrl type=unixio,,clientfd=0 --tpmstate dir=... --log file=swtpm.log' \
+ -tpmdev emulator,id=tpm0,chardev=chrtpm0 \
+ -device tpm-tis,tpmdev=tpm0
+
+The patch was discussed upstream, but QEMU developers believe that the
+code calling QEMU should be responsible for managing additional
+processes. In OE-core, that would imply enhancing runqemu and
+oeqa. This patch is a simpler solution.
+
+Because it is not going upstream, the patch was written so that it is
+as simple as possible.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ chardev/char-socket.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ chardev/char.c | 3 ++
+ qapi/char.json | 5 +++
+ 3 files changed, 90 insertions(+), 4 deletions(-)
+
+diff --git a/chardev/char-socket.c b/chardev/char-socket.c
+index 53eda8ef00..f566107c35 100644
+--- a/chardev/char-socket.c
++++ b/chardev/char-socket.c
+@@ -852,6 +852,68 @@ static gboolean socket_reconnect_timeout(gpointer opaque)
+ return false;
+ }
+
++#ifndef _WIN32
++static void chardev_open_socket_cmd(Chardev *chr,
++ const char *cmd,
++ Error **errp)
++{
++ int fds[2] = { -1, -1 };
++ QIOChannelSocket *sioc = NULL;
++ pid_t pid = -1;
++ const char *argv[] = { "/bin/sh", "-c", cmd, NULL };
++
++ /*
++ * We need a Unix domain socket for commands like swtpm and a single
++ * connection, therefore we cannot use qio_channel_command_new_spawn()
++ * without patching it first. Duplicating the functionality is easier.
++ */
++ if (socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds)) {
++ error_setg_errno(errp, errno, "Error creating socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC)");
++ goto error;
++ }
++
++ pid = qemu_fork(errp);
++ if (pid < 0) {
++ goto error;
++ }
++
++ if (!pid) {
++ /* child */
++ dup2(fds[1], STDIN_FILENO);
++ execv(argv[0], (char * const *)argv);
++ _exit(1);
++ }
++
++ /*
++ * Hand over our end of the socket pair to the qio channel.
++ *
++ * We don't reap the child because it is expected to keep
++ * running. We also don't support the "reconnect" option for the
++ * same reason.
++ */
++ sioc = qio_channel_socket_new_fd(fds[0], errp);
++ if (!sioc) {
++ goto error;
++ }
++ fds[0] = -1;
++
++ g_free(chr->filename);
++ chr->filename = g_strdup_printf("cmd:%s", cmd);
++ tcp_chr_new_client(chr, sioc);
++
++ error:
++ if (fds[0] >= 0) {
++ close(fds[0]);
++ }
++ if (fds[1] >= 0) {
++ close(fds[1]);
++ }
++ if (sioc) {
++ object_unref(OBJECT(sioc));
++ }
++}
++#endif
++
+ static void qmp_chardev_open_socket(Chardev *chr,
+ ChardevBackend *backend,
+ bool *be_opened,
+@@ -859,6 +921,9 @@
+ {
+ SocketChardev *s = SOCKET_CHARDEV(chr);
+ ChardevSocket *sock = backend->u.socket.data;
++#ifndef _WIN32
++ const char *cmd = sock->cmd;
++#endif
+ bool do_nodelay = sock->has_nodelay ? sock->nodelay : false;
+ bool is_listen = sock->has_server ? sock->server : true;
+ bool is_telnet = sock->has_telnet ? sock->telnet : false;
+@@ -925,7 +990,14 @@
+ } else if (reconnect > 0) {
+ s->reconnect_time = reconnect;
+ }
+-
++#ifndef _WIN32
++ if (cmd) {
++ chardev_open_socket_cmd(chr, cmd, errp);
++
++ /* everything ready (or failed permanently) before we return */
++ *be_opened = true;
++ } else
++#endif
+ if (s->reconnect_time) {
+ sioc = qio_channel_socket_new();
+ tcp_chr_set_client_ioc_name(chr, sioc);
+@@ -985,10 +1057,26 @@
+ const char *host = qemu_opt_get(opts, "host");
+ const char *port = qemu_opt_get(opts, "port");
+ const char *tls_creds = qemu_opt_get(opts, "tls-creds");
++#ifndef _WIN32
++ const char *cmd = qemu_opt_get(opts, "cmd");
++#endif
+ SocketAddressLegacy *addr;
+ ChardevSocket *sock;
+
+ backend->type = CHARDEV_BACKEND_KIND_SOCKET;
++#ifndef _WIN32
++ if (cmd) {
++ /*
++ * Here we have to ensure that no options are set which are incompatible with
++ * spawning a command, otherwise unmodified code that doesn't know about
++ * command spawning (like socket_reconnect_timeout()) might get called.
++ */
++ if (path || is_listen || is_telnet || is_tn3270 || reconnect || host || port || tls_creds) {
++ error_setg(errp, "chardev: socket: cmd does not support any additional options");
++ return;
++ }
++ } else
++#endif
+ if (!path) {
+ if (!host) {
+ error_setg(errp, "chardev: socket: no host given");
+@@ -1021,13 +1109,24 @@
+ sock->has_reconnect = true;
+ sock->reconnect = reconnect;
+ sock->tls_creds = g_strdup(tls_creds);
++#ifndef _WIN32
++ sock->cmd = g_strdup(cmd);
++#endif
+
+ addr = g_new0(SocketAddressLegacy, 1);
++#ifndef _WIN32
++ if (path || cmd) {
++#else
+ if (path) {
++#endif
+ UnixSocketAddress *q_unix;
+ addr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX;
+ q_unix = addr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
++#ifndef _WIN32
++ q_unix->path = cmd ? g_strdup_printf("cmd:%s", cmd) : g_strdup(path);
++#else
+ q_unix->path = g_strdup(path);
++#endif
+ } else {
+ addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET;
+ addr->u.inet.data = g_new(InetSocketAddress, 1);
+diff --git a/chardev/char.c b/chardev/char.c
+index 2ae4f465ec..5d52cd5de5 100644
+--- a/chardev/char.c
++++ b/chardev/char.c
+@@ -792,6 +792,9 @@ QemuOptsList qemu_chardev_opts = {
+ },{
+ .name = "path",
+ .type = QEMU_OPT_STRING,
++ },{
++ .name = "cmd",
++ .type = QEMU_OPT_STRING,
+ },{
+ .name = "host",
+ .type = QEMU_OPT_STRING,
+diff --git a/qapi/char.json b/qapi/char.json
+index ae19dcd1ed..6de0f29bcd 100644
+--- a/qapi/char.json
++++ b/qapi/char.json
+@@ -241,6 +241,10 @@
+ #
+ # @addr: socket address to listen on (server=true)
+ # or connect to (server=false)
++# @cmd: command to run via "sh -c" with stdin as one end of
++# a AF_UNIX SOCK_DSTREAM socket pair. The other end
++# is used by the chardev. Either an addr or a cmd can
++# be specified, but not both.
+ # @tls-creds: the ID of the TLS credentials object (since 2.6)
+ # @server: create server socket (default: true)
+ # @wait: wait for incoming connection on server
+@@ -258,6 +262,7 @@
+ # Since: 1.4
+ ##
+ { 'struct': 'ChardevSocket', 'data': { 'addr' : 'SocketAddressLegacy',
++ '*cmd' : 'str',
+ '*tls-creds' : 'str',
+ '*server' : 'bool',
+ '*wait' : 'bool',
+--
+2.14.1
diff --git a/poky/meta/recipes-devtools/qemu/qemu/check-PS2Queue-pointers-in-post_load-routine.patch b/poky/meta/recipes-devtools/qemu/qemu/check-PS2Queue-pointers-in-post_load-routine.patch
new file mode 100644
index 000000000..f8d7f66ac
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/check-PS2Queue-pointers-in-post_load-routine.patch
@@ -0,0 +1,63 @@
+From ee9a17d0e12143971a9676227cce953c0dbe52fb Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Thu, 16 Nov 2017 13:21:55 +0530
+Subject: [PATCH] ps2: check PS2Queue pointers in post_load routine
+
+During Qemu guest migration, a destination process invokes ps2
+post_load function. In that, if 'rptr' and 'count' values were
+invalid, it could lead to OOB access or infinite loop issue.
+Add check to avoid it.
+
+Reported-by: Cyrille Chatras <cyrille.chatras@orange.com>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Message-id: 20171116075155.22378-1-ppandit@redhat.com
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+
+CVE: CVE-2017-16845
+Upstream-Status: Backport
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ hw/input/ps2.c | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+diff --git a/hw/input/ps2.c b/hw/input/ps2.c
+index f388a23..de171a2 100644
+--- a/hw/input/ps2.c
++++ b/hw/input/ps2.c
+@@ -1225,24 +1225,21 @@ static void ps2_common_reset(PS2State *s)
+ static void ps2_common_post_load(PS2State *s)
+ {
+ PS2Queue *q = &s->queue;
+- int size;
+- int i;
+- int tmp_data[PS2_QUEUE_SIZE];
++ uint8_t i, size;
++ uint8_t tmp_data[PS2_QUEUE_SIZE];
+
+ /* set the useful data buffer queue size, < PS2_QUEUE_SIZE */
+- size = q->count > PS2_QUEUE_SIZE ? 0 : q->count;
++ size = (q->count < 0 || q->count > PS2_QUEUE_SIZE) ? 0 : q->count;
+
+ /* move the queue elements to the start of data array */
+- if (size > 0) {
+- for (i = 0; i < size; i++) {
+- /* move the queue elements to the temporary buffer */
+- tmp_data[i] = q->data[q->rptr];
+- if (++q->rptr == 256) {
+- q->rptr = 0;
+- }
++ for (i = 0; i < size; i++) {
++ if (q->rptr < 0 || q->rptr >= sizeof(q->data)) {
++ q->rptr = 0;
+ }
+- memcpy(q->data, tmp_data, size);
++ tmp_data[i] = q->data[q->rptr++];
+ }
++ memcpy(q->data, tmp_data, size);
++
+ /* reset rptr/wptr/count */
+ q->rptr = 0;
+ q->wptr = size;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch b/poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
new file mode 100644
index 000000000..682213254
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
@@ -0,0 +1,76 @@
+From 697a834c35d19447b7dcdb9e1d9434bc6ce17c21 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Wed, 12 Aug 2015 15:11:30 -0500
+Subject: [PATCH] cpus.c: Add error messages when qemi_cpu_kick_thread fails.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add custom_debug.h with function for print backtrace information.
+When pthread_kill fails in qemu_cpu_kick_thread display backtrace and
+current cpu information.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ cpus.c | 5 +++++
+ custom_debug.h | 24 ++++++++++++++++++++++++
+ 2 files changed, 29 insertions(+)
+ create mode 100644 custom_debug.h
+
+diff --git a/cpus.c b/cpus.c
+index a822ce3..7e4786e 100644
+--- a/cpus.c
++++ b/cpus.c
+@@ -1080,6 +1080,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
+ return NULL;
+ }
+
++#include "custom_debug.h"
++
+ static void qemu_cpu_kick_thread(CPUState *cpu)
+ {
+ #ifndef _WIN32
+@@ -1088,6 +1090,9 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
+ err = pthread_kill(cpu->thread->thread, SIG_IPI);
+ if (err) {
+ fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
++ fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
++ cpu_dump_state(cpu, stderr, fprintf, 0);
++ backtrace_print();
+ exit(1);
+ }
+ #else /* _WIN32 */
+diff --git a/custom_debug.h b/custom_debug.h
+new file mode 100644
+index 0000000..f029e45
+--- /dev/null
++++ b/custom_debug.h
+@@ -0,0 +1,24 @@
++#include <execinfo.h>
++#include <stdio.h>
++#define BACKTRACE_MAX 128
++static void backtrace_print(void)
++{
++ int nfuncs = 0;
++ void *buf[BACKTRACE_MAX];
++ char **symbols;
++ int i;
++
++ nfuncs = backtrace(buf, BACKTRACE_MAX);
++
++ symbols = backtrace_symbols(buf, nfuncs);
++ if (symbols == NULL) {
++ fprintf(stderr, "backtrace_print failed to get symbols");
++ return;
++ }
++
++ fprintf(stderr, "Backtrace ...\n");
++ for (i = 0; i < nfuncs; i++)
++ fprintf(stderr, "%s\n", symbols[i]);
++
++ free(symbols);
++}
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch b/poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
new file mode 100644
index 000000000..77117890f
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
@@ -0,0 +1,69 @@
+When the pointer enters the Qemu window it calls SDL_WM_GrabInput, which calls
+XGrabPointer in a busyloop until it returns GrabSuccess. However if there's already
+a pointer grab (screen is locked, a menu is open) then qemu will hang until the
+grab can be taken. In the specific case of a headless X server on an autobuilder, once
+the screensaver has kicked in any qemu instance that appears underneath the
+pointer will hang.
+
+I'm not entirely sure why pointer grabs are required (the documentation
+explicitly says it doesn't do grabs when using a tablet, which we are) so wrap
+them in a conditional that can be set by the autobuilder environment, preserving
+the current grabbing behaviour for everyone else.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 4b1988ecb01a178269ec0513a75f2ec620c7ef6a Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 18 Sep 2013 14:04:54 +0100
+Subject: [PATCH] sdl.c: allow user to disable pointer grabs
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Eric Bénard <eric@eukrea.com>
+---
+ ui/sdl.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+Index: qemu-2.11.1/ui/sdl.c
+===================================================================
+--- qemu-2.11.1.orig/ui/sdl.c
++++ qemu-2.11.1/ui/sdl.c
+@@ -63,6 +63,10 @@ static SDL_PixelFormat host_format;
+ static int scaling_active = 0;
+ static Notifier mouse_mode_notifier;
+ static int idle_counter;
++#ifndef True
++#define True 1
++#endif
++static doing_grabs = True;
+
+ #define SDL_REFRESH_INTERVAL_BUSY 10
+ #define SDL_MAX_IDLE_COUNT (2 * GUI_REFRESH_INTERVAL_DEFAULT \
+@@ -431,14 +435,16 @@ static void sdl_grab_start(void)
+ }
+ } else
+ sdl_hide_cursor();
+- SDL_WM_GrabInput(SDL_GRAB_ON);
++ if (doing_grabs)
++ SDL_WM_GrabInput(SDL_GRAB_ON);
+ gui_grab = 1;
+ sdl_update_caption();
+ }
+
+ static void sdl_grab_end(void)
+ {
+- SDL_WM_GrabInput(SDL_GRAB_OFF);
++ if (doing_grabs)
++ SDL_WM_GrabInput(SDL_GRAB_OFF);
+ gui_grab = 0;
+ sdl_show_cursor();
+ sdl_update_caption();
+@@ -986,6 +992,8 @@ void sdl_display_init(DisplayState *ds,
+ * This requires SDL >= 1.2.14. */
+ setenv("SDL_DISABLE_LOCK_KEYS", "1", 1);
+
++ doing_grabs = (getenv("QEMU_DONT_GRAB") == NULL);
++
+ flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
+ if (SDL_Init (flags)) {
+ fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
diff --git a/poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
new file mode 100644
index 000000000..cee6a676a
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
@@ -0,0 +1,84 @@
+fix libcap header issue on some distro
+
+1, When build qemu-native on SLED 11.2, there is an error:
+...
+| In file included from /usr/include/bits/sigcontext.h:28,
+| from /usr/include/signal.h:339,
+| from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/
+qemu-1.4.0/include/qemu-common.h:42,
+| from fsdev/virtfs-proxy-helper.c:23:
+| /usr/include/asm/sigcontext.h:28: error: expected specifier-
+qualifier-list before '__u64'
+| /usr/include/asm/sigcontext.h:191: error: expected specifier-
+qualifier-list before '__u64'
+...
+
+2, The virtfs-proxy-helper.c includes <sys/capability.h> and
+qemu-common.h in sequence. The header include map is:
+(`-->' presents `include')
+...
+"virtfs-proxy-helper.c" --> <sys/capability.h>
+...
+"virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> -->
+<bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> -->
+<asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h>
+...
+
+3, The bug is found on SLED 11.2 x86. In libcap header file
+/usr/include/sys/capability.h, it does evil stuff like this:
+...
+ 25 /*
+ 26 * Make sure we can be included from userland by preventing
+ 27 * capability.h from including other kernel headers
+ 28 */
+ 29 #define _LINUX_TYPES_H
+ 30 #define _LINUX_FS_H
+ 31 #define __LINUX_COMPILER_H
+ 32 #define __user
+ 33
+ 34 typedef unsigned int __u32;
+ 35 typedef __u32 __le32;
+...
+This completely prevents including /usr/include/linux/types.h.
+The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented,
+and '__u64' is defined in <asm-generic/int-ll64.h>.
+
+4, Modify virtfs-proxy-helper.c to include <sys/capability.h>
+last to workaround the issue.
+
+http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
+http://patchwork.linuxtv.org/patch/12748/
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ fsdev/virtfs-proxy-helper.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
+--- a/fsdev/virtfs-proxy-helper.c
++++ b/fsdev/virtfs-proxy-helper.c
+@@ -12,7 +12,6 @@
+ #include <sys/resource.h>
+ #include <getopt.h>
+ #include <syslog.h>
+-#include <sys/capability.h>
+ #include <sys/fsuid.h>
+ #include <sys/vfs.h>
+ #include <sys/ioctl.h>
+@@ -26,7 +25,11 @@
+ #include "9p-iov-marshal.h"
+ #include "hw/9pfs/9p-proxy.h"
+ #include "fsdev/9p-iov-marshal.h"
+-
++/*
++ * Include this one last due to some versions of it being buggy:
++ * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
++ */
++#include <sys/capability.h>
+ #define PROGNAME "virtfs-proxy-helper"
+
+ #ifndef XFS_SUPER_MAGIC
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch b/poky/meta/recipes-devtools/qemu/qemu/linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch
new file mode 100644
index 000000000..d2c52252f
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch
@@ -0,0 +1,35 @@
+From 4fa4aae4176ef6d8f4d4b8323d061e2433918a26 Mon Sep 17 00:00:00 2001
+From: Alistair Francis <alistair.francis@xilinx.com>
+Date: Wed, 17 Jan 2018 10:51:49 -0800
+Subject: [PATCH] linux-user: Fix webkitgtk hangs on 32-bit x86 target
+
+Since commit "linux-user: Tidy and enforce reserved_va initialization"
+(18e80c55bb6ec17c05ec0ba717ec83933c2bfc07) the Yocto webkitgtk build
+hangs when cross compiling for 32-bit x86 on a 64-bit x86 machine using
+musl.
+
+To fix the issue reduce the MAX_RESERVED_VA macro to be a closer match
+to what it was before the problematic commit.
+
+Upstream-Status: Submitted http://lists.gnu.org/archive/html/qemu-devel/2018-01/msg04185.html
+Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
+---
+ linux-user/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/linux-user/main.c b/linux-user/main.c
+index 450eb3ce65..c7cc0a184e 100644
+--- a/linux-user/main.c
++++ b/linux-user/main.c
+@@ -77,7 +77,7 @@ do { \
+ (TARGET_LONG_BITS == 32 || defined(TARGET_ABI32))
+ /* There are a number of places where we assign reserved_va to a variable
+ of type abi_ulong and expect it to fit. Avoid the last page. */
+-# define MAX_RESERVED_VA (0xfffffffful & TARGET_PAGE_MASK)
++# define MAX_RESERVED_VA (0x7ffffffful & TARGET_PAGE_MASK)
+ # else
+ # define MAX_RESERVED_VA (1ul << TARGET_VIRT_ADDR_SPACE_BITS)
+ # endif
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/memfd.patch b/poky/meta/recipes-devtools/qemu/qemu/memfd.patch
new file mode 100644
index 000000000..62e8d3800
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/memfd.patch
@@ -0,0 +1,57 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 75e5b70e6b5dcc4f2219992d7cffa462aa406af0 Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Tue, 28 Nov 2017 11:51:27 +0100
+Subject: [PATCH] memfd: fix configure test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent glibc added memfd_create in sys/mman.h. This conflicts with
+the definition in util/memfd.c:
+
+ /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration
+
+Fix the configure test, and remove the sys/memfd.h inclusion since the
+file actually does not exist---it is a typo in the memfd_create(2) man
+page.
+
+Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+---
+ configure | 2 +-
+ util/memfd.c | 4 +---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 9c8aa5a98b..99ccc1725a 100755
+--- a/configure
++++ b/configure
+@@ -3923,7 +3923,7 @@ fi
+ # check if memfd is supported
+ memfd=no
+ cat > $TMPC << EOF
+-#include <sys/memfd.h>
++#include <sys/mman.h>
+
+ int main(void)
+ {
+diff --git a/util/memfd.c b/util/memfd.c
+index 4571d1aba8..412e94a405 100644
+--- a/util/memfd.c
++++ b/util/memfd.c
+@@ -31,9 +31,7 @@
+
+ #include "qemu/memfd.h"
+
+-#ifdef CONFIG_MEMFD
+-#include <sys/memfd.h>
+-#elif defined CONFIG_LINUX
++#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
+ #include <sys/syscall.h>
+ #include <asm/unistd.h>
+
+--
+2.11.0
diff --git a/poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch b/poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch
new file mode 100644
index 000000000..91f728042
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/no-valgrind.patch
@@ -0,0 +1,19 @@
+There isn't an option to enable or disable valgrind support, so disable it to avoid non-deterministic builds.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure b/configure
+index b3c4f51..4d3929e 100755
+--- a/configure
++++ b/configure
+@@ -4193,9 +4192,0 @@ valgrind_h=no
+-cat > $TMPC << EOF
+-#include <valgrind/valgrind.h>
+-int main(void) {
+- return 0;
+-}
+-EOF
+-if compile_prog "" "" ; then
+- valgrind_h=yes
+-fi
diff --git a/poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch b/poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch
new file mode 100644
index 000000000..57ab981c6
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/pathlimit.patch
@@ -0,0 +1,137 @@
+By default qemu builds a complete list of directories within the user
+emulation sysroot (-L option). The OE sysroot directory is large and
+this is confusing, for example it indexes all pkgdata. In particular this
+confuses strace of qemu binaries with tons of irrelevant paths.
+
+This patch stops the code indexing up front and instead only indexes
+things if/as/when it needs to. This drastically reduces the files it
+reads and reduces memory usage and cleans up strace.
+
+It would also avoid the infinite directory traversal bug in [YOCTO #6996]
+although the code could still be vulnerable if it parsed those specific
+paths.
+
+RP
+2016/3/9
+Upstream-Status: Pending
+
+Index: qemu-2.5.0/util/path.c
+===================================================================
+--- qemu-2.5.0.orig/util/path.c
++++ qemu-2.5.0/util/path.c
+@@ -19,6 +19,7 @@ struct pathelem
+ char *name;
+ /* Full path name, eg. /usr/gnemul/x86-linux/lib. */
+ char *pathname;
++ int populated_entries;
+ struct pathelem *parent;
+ /* Children */
+ unsigned int num_entries;
+@@ -49,6 +50,7 @@ static struct pathelem *new_entry(const
+ new->name = g_strdup(name);
+ new->pathname = g_strdup_printf("%s/%s", root, name);
+ new->num_entries = 0;
++ new->populated_entries = 0;
+ return new;
+ }
+
+@@ -57,15 +59,16 @@ static struct pathelem *new_entry(const
+ /* Not all systems provide this feature */
+ #if defined(DT_DIR) && defined(DT_UNKNOWN) && defined(DT_LNK)
+ # define dirent_type(dirent) ((dirent)->d_type)
+-# define is_dir_maybe(type) \
+- ((type) == DT_DIR || (type) == DT_UNKNOWN || (type) == DT_LNK)
++# define is_not_dir(type) \
++ ((type) != DT_DIR && (type) != DT_UNKNOWN && (type) != DT_LNK)
+ #else
+ # define dirent_type(dirent) (1)
+-# define is_dir_maybe(type) (type)
++# define is_not_dir(type) (0)
+ #endif
+
+ static struct pathelem *add_dir_maybe(struct pathelem *path)
+ {
++ unsigned int i;
+ DIR *dir;
+
+ if ((dir = opendir(path->pathname)) != NULL) {
+@@ -78,6 +81,11 @@ static struct pathelem *add_dir_maybe(st
+ }
+ closedir(dir);
+ }
++
++ for (i = 0; i < path->num_entries; i++)
++ (path->entries[i])->parent = path;
++
++ path->populated_entries = 1;
+ return path;
+ }
+
+@@ -93,26 +101,16 @@ static struct pathelem *add_entry(struct
+ e = &root->entries[root->num_entries-1];
+
+ *e = new_entry(root->pathname, root, name);
+- if (is_dir_maybe(type)) {
+- *e = add_dir_maybe(*e);
++ if (is_not_dir(type)) {
++ (*e)->populated_entries = 1;
+ }
+
+ return root;
+ }
+
+-/* This needs to be done after tree is stabilized (ie. no more reallocs!). */
+-static void set_parents(struct pathelem *child, struct pathelem *parent)
+-{
+- unsigned int i;
+-
+- child->parent = parent;
+- for (i = 0; i < child->num_entries; i++)
+- set_parents(child->entries[i], child);
+-}
+-
+ /* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */
+ static const char *
+-follow_path(const struct pathelem *cursor, const char *name)
++follow_path(struct pathelem *cursor, struct pathelem **source, const char *name)
+ {
+ unsigned int i, namelen;
+
+@@ -123,14 +121,18 @@ follow_path(const struct pathelem *curso
+ return cursor->pathname;
+
+ if (strneq(name, namelen, ".."))
+- return follow_path(cursor->parent, name + namelen);
++ return follow_path(cursor->parent, &cursor->parent, name + namelen);
+
+ if (strneq(name, namelen, "."))
+- return follow_path(cursor, name + namelen);
++ return follow_path(cursor, source, name + namelen);
++
++ if (!cursor->populated_entries)
++ *source = add_dir_maybe(cursor);
++ cursor = *source;
+
+ for (i = 0; i < cursor->num_entries; i++)
+ if (strneq(name, namelen, cursor->entries[i]->name))
+- return follow_path(cursor->entries[i], name + namelen);
++ return follow_path(cursor->entries[i], &cursor->entries[i], name + namelen);
+
+ /* Not found */
+ return NULL;
+@@ -164,8 +166,6 @@ void init_paths(const char *prefix)
+ g_free(base->name);
+ g_free(base);
+ base = NULL;
+- } else {
+- set_parents(base, base);
+ }
+ }
+
+@@ -177,5 +177,5 @@ const char *path(const char *name)
+ if (!base || !name || name[0] != '/')
+ return name;
+
+- return follow_path(base, name) ?: name;
++ return follow_path(base, &base, name) ?: name;
+ }
diff --git a/poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin b/poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
new file mode 100644
index 000000000..c4044296c
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
Binary files differ
diff --git a/poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
new file mode 100644
index 000000000..eb99d1463
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+--- a/configure
++++ b/configure
+@@ -4468,10 +4468,6 @@ fi
+ if test "$gcov" = "yes" ; then
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$fortify_source" = "yes" ; then
+- CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+-elif test "$debug" = "no"; then
+- CFLAGS="-O2 $CFLAGS"
+ fi
+
+ ##########################################
diff --git a/poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch b/poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
new file mode 100644
index 000000000..c7425ab8d
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
@@ -0,0 +1,31 @@
+qemu: Add addition environment space to boot loader qemu-system-mips
+
+Upstream-Status: Inappropriate - OE uses deep paths
+
+If you create a project with very long directory names like 128 characters
+deep and use NFS, the kernel arguments will be truncated. The kernel will
+accept longer strings such as 1024 bytes, but the qemu boot loader defaulted
+to only 256 bytes. This patch expands the limit.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ hw/mips/mips_malta.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
+index 9d521cc..17c0391 100644
+--- a/hw/mips/mips_malta.c
++++ b/hw/mips/mips_malta.c
+@@ -53,7 +53,7 @@
+
+ #define ENVP_ADDR 0x80002000l
+ #define ENVP_NB_ENTRIES 16
+-#define ENVP_ENTRY_SIZE 256
++#define ENVP_ENTRY_SIZE 1024
+
+ /* Hardware addresses */
+ #define FLASH_ADDRESS 0x1e000000ULL
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-devtools/qemu/qemu/run-ptest b/poky/meta/recipes-devtools/qemu/qemu/run-ptest
new file mode 100644
index 000000000..2206b3192
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+#This script is used to run qemu test suites
+#
+
+ptestdir=$(dirname "$(readlink -f "$0")")
+export SRC_PATH=$ptestdir
+
+cd $ptestdir/tests
+make -f Makefile.include -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
diff --git a/poky/meta/recipes-devtools/qemu/qemu/wacom.patch b/poky/meta/recipes-devtools/qemu/qemu/wacom.patch
new file mode 100644
index 000000000..cd06aa4ac
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu/wacom.patch
@@ -0,0 +1,130 @@
+The USB wacom device is missing a HID descriptor which causes it
+to fail to operate with recent kernels (e.g. 3.17).
+
+This patch adds a HID desriptor to the device, based upon one from
+real wcom device.
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Submitted
+2014/11/27
+
+Index: qemu-2.1.0/hw/usb/dev-wacom.c
+===================================================================
+--- qemu-2.1.0.orig/hw/usb/dev-wacom.c 2014-08-01 15:12:17.000000000 +0100
++++ qemu-2.1.0/hw/usb/dev-wacom.c 2014-10-12 12:13:30.540306042 +0100
+@@ -68,6 +68,89 @@
+ [STR_SERIALNUMBER] = "1",
+ };
+
++static const uint8_t qemu_tablet_hid_report_descriptor[] = {
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x02, /* Usage (Mouse) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x01, /* Report ID (1) */
++ 0x09, 0x01, /* Usage (Pointer) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x05, 0x09, /* Usage Page (Button) */
++ 0x19, 0x01, /* Usage Minimum (1) */
++ 0x29, 0x05, /* Usage Maximum (5) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x25, 0x01, /* Logical Maximum (1) */
++ 0x95, 0x05, /* Report Count (5) */
++ 0x75, 0x01, /* Report Size (1) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0x75, 0x03, /* Report Size (3) */
++ 0x81, 0x01, /* Input (Constant) */
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x30, /* Usage (X) */
++ 0x09, 0x31, /* Usage (Y) */
++ 0x15, 0x81, /* Logical Minimum (-127) */
++ 0x25, 0x7f, /* Logical Maximum (127) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x02, /* Report Count (2) */
++ 0x81, 0x06, /* Input (Data, Variable, Relative) */
++ 0xc0, /* End Collection */
++ 0xc0, /* End Collection */
++ 0x05, 0x0d, /* Usage Page (Digitizer) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xff, 0x00, /* Logical Maximum (255) */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x08, /* Report Count (8) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0xc0, /* End Collection */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0xb1, 0x02, /* FEATURE (2) */
++ 0xc0, /* End Collection */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0xa1, 0x01, /* Collection (Application) */
++ 0x85, 0x02, /* Report ID (2) */
++ 0x05, 0x0d, /* Usage Page (Digitizer) */
++ 0x09, 0x22, /* Usage (Finger) */
++ 0xa1, 0x00, /* Collection (Physical) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x15, 0x00, /* Logical Minimum (0) */
++ 0x26, 0xff, 0x00, /* Logical Maximum */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x02, /* Report Count (2) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x05, 0x01, /* Usage Page (Generic Desktop) */
++ 0x09, 0x30, /* Usage (X) */
++ 0x35, 0x00, /* Physical Minimum */
++ 0x46, 0xe0, 0x2e, /* Physical Maximum */
++ 0x26, 0xe0, 0x01, /* Logical Maximum */
++ 0x75, 0x10, /* Report Size (16) */
++ 0x95, 0x01, /* Report Count (1) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x09, 0x31, /* Usage (Y) */
++ 0x46, 0x40, 0x1f, /* Physical Maximum */
++ 0x26, 0x40, 0x01, /* Logical Maximum */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0x06, 0x00, 0xff, /* Usage Page (Vendor 0xff00) */
++ 0x09, 0x01, /* Usage (Digitizer) */
++ 0x26, 0xff, 0x00, /* Logical Maximum */
++ 0x75, 0x08, /* Report Size (8) */
++ 0x95, 0x0d, /* Report Count (13) */
++ 0x81, 0x02, /* Input (Data, Variable, Absolute) */
++ 0xc0, /* End Collection */
++ 0xc0, /* End Collection */
++};
++
++
+ static const USBDescIface desc_iface_wacom = {
+ .bInterfaceNumber = 0,
+ .bNumEndpoints = 1,
+@@ -85,7 +168,7 @@
+ 0x00, /* u8 country_code */
+ 0x01, /* u8 num_descriptors */
+ 0x22, /* u8 type: Report */
+- 0x6e, 0, /* u16 len */
++ sizeof(qemu_tablet_hid_report_descriptor), 0, /* u16 len */
+ },
+ },
+ },
+@@ -265,6 +350,15 @@
+ }
+
+ switch (request) {
++ case InterfaceRequest | USB_REQ_GET_DESCRIPTOR:
++ switch (value >> 8) {
++ case 0x22:
++ memcpy(data, qemu_tablet_hid_report_descriptor,
++ sizeof(qemu_tablet_hid_report_descriptor));
++ p->actual_length = sizeof(qemu_tablet_hid_report_descriptor);
++ break;
++ }
++ break;
+ case WACOM_SET_REPORT:
+ if (s->mouse_grabbed) {
+ qemu_remove_mouse_event_handler(s->eh_entry);
diff --git a/poky/meta/recipes-devtools/qemu/qemu_2.11.1.bb b/poky/meta/recipes-devtools/qemu/qemu_2.11.1.bb
new file mode 100644
index 000000000..ab82c5fe5
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemu_2.11.1.bb
@@ -0,0 +1,59 @@
+require qemu.inc
+
+inherit ptest
+
+RDEPENDS_${PN}-ptest = "bash make"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
+ file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
+
+SRC_URI = "http://wiki.qemu-project.org/download/${BP}.tar.bz2 \
+ file://powerpc_rom.bin \
+ file://disable-grabs.patch \
+ file://wacom.patch \
+ file://add-ptest-in-makefile-v10.patch \
+ file://run-ptest \
+ file://qemu-enlarge-env-entry-size.patch \
+ file://no-valgrind.patch \
+ file://pathlimit.patch \
+ file://qemu-2.5.0-cflags.patch \
+ file://chardev-connect-socket-to-a-spawned-command.patch \
+ file://apic-fixup-fallthrough-to-PIC.patch \
+ file://linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
+ file://memfd.patch \
+ file://0001-arm-translate-a64-treat-DISAS_UPDATE-as-variant-of-D.patch \
+ file://check-PS2Queue-pointers-in-post_load-routine.patch \
+ "
+UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+\..*)\.tar"
+
+
+SRC_URI_append_class-native = " \
+ file://fix-libcap-header-issue-on-some-distro.patch \
+ file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
+ "
+
+SRC_URI[md5sum] = "61cf862b6007eba4ac98247776af2e27"
+SRC_URI[sha256sum] = "d9df2213ceed32e91dab7bc9dd19c1af83f91ba72c7aeef7605dfaaf81732ccb"
+
+COMPATIBLE_HOST_mipsarchn32 = "null"
+COMPATIBLE_HOST_mipsarchn64 = "null"
+
+do_install_append() {
+ # Prevent QA warnings about installed ${localstatedir}/run
+ if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+ install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
+}
+
+do_compile_ptest() {
+ make buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -rL ${B}/tests ${D}${PTEST_PATH}
+ find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
+
+ cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
+ # Don't check the file genreated by configure
+ sed -i -e '/wildcard config-host.mak/d' \
+ -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
+}
diff --git a/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
new file mode 100644
index 000000000..c983fbae6
--- /dev/null
+++ b/poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "QEMU wrapper script"
+HOMEPAGE = "http://qemu.org"
+LICENSE = "MIT"
+
+S = "${WORKDIR}"
+
+DEPENDS += "qemu-native"
+
+inherit qemu
+
+do_populate_sysroot[depends] = ""
+
+do_install () {
+ install -d ${D}${bindir_crossscripts}/
+
+ echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
+ qemu_binary=${@qemu_target_binary(d)}
+ qemu_options='${QEMU_OPTIONS}'
+ echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
+ fallback_qemu_bin=
+ case $qemu_binary in
+ "qemu-i386")
+ fallback_qemu_bin=qemu-x86_64
+ ;;
+ "qemu-x86_64")
+ fallback_qemu_bin=qemu-i386
+ ;;
+ *)
+ ;;
+ esac
+
+ if [ -n "$fallback_qemu_bin" ]; then
+
+ cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+rc=\$?
+if [ \$rc = 255 ]; then
+ $fallback_qemu_bin "\$@"
+ rc=\$?
+fi
+exit \$rc
+EOF
+
+ fi
+
+ chmod +x ${D}${bindir_crossscripts}/qemuwrapper
+}
+
+SYSROOT_DIRS += "${bindir_crossscripts}"
+
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/poky/meta/recipes-devtools/quilt/quilt-native.inc b/poky/meta/recipes-devtools/quilt/quilt-native.inc
new file mode 100644
index 000000000..c7067042e
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt-native.inc
@@ -0,0 +1,18 @@
+RDEPENDS_${PN} = "diffstat-native patch-native bzip2-native util-linux-native"
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+inherit native
+
+PATCHTOOL = "patch"
+EXTRA_OECONF_append = " --disable-nls"
+
+do_configure () {
+ oe_runconf
+}
+
+do_install_append () {
+ # Dummy quiltrc file for patch.bbclass
+ install -d ${D}${sysconfdir}/
+ touch ${D}${sysconfdir}/quiltrc
+}
diff --git a/poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb b/poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb
new file mode 100644
index 000000000..6bc7dcdb7
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt-native_0.65.bb
@@ -0,0 +1,2 @@
+require quilt.inc
+require quilt-native.inc
diff --git a/poky/meta/recipes-devtools/quilt/quilt.inc b/poky/meta/recipes-devtools/quilt/quilt.inc
new file mode 100644
index 000000000..c7bb741b4
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt.inc
@@ -0,0 +1,77 @@
+SUMMARY = "Tool for working with series of patches"
+HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
+ file://run-ptest \
+ file://Makefile \
+ file://test.sh \
+ file://0001-tests-Allow-different-output-from-mv.patch \
+"
+
+SRC_URI[md5sum] = "c67ba0228f5b7b8bbe469474661f92d6"
+SRC_URI[sha256sum] = "f6cbc788e5cbbb381a3c6eab5b9efce67c776a8662a7795c7432fd27aa096819"
+
+inherit autotools-brokensep ptest
+
+EXTRA_OECONF_darwin += "--without-date \
+ --without-getopt \
+ "
+
+CLEANBROKEN = "1"
+
+PACKAGES += "guards guards-doc"
+FILES_${PN} = "${sysconfdir} ${datadir}/quilt \
+ ${bindir}/quilt ${libdir}/quilt"
+FILES_guards = "${bindir}/guards"
+FILES_${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
+FILES_guards-doc = "${mandir}/man1/guards.1"
+
+RDEPENDS_${PN} = "bash"
+
+EXTRA_OE_MAKE_ARGS_darwin ?= ""
+EXTRA_OE_MAKE_ARGS ?= "BUILD_ROOT=${D}"
+
+EXTRA_OECONF = "--with-perl='${USRBINPATH}/env perl' --with-patch=patch"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
+
+# Make sure we don't have "-w" in shebang lines: it breaks using
+# "/usr/bin/env perl" as parser
+do_configure_prepend () {
+ find ${S} -name "*.in" -exec sed -i -e "1s,^#\!.*@PERL@ -w$,#\! @PERL@\nuse warnings;," {} \;
+}
+
+# Don't setup symlinks to host utilities, we don't need them
+do_configure_append () {
+ sed -e 's,^COMPAT_SYMLINKS.*:=.*,COMPAT_SYMLINKS :=,' -i ${S}/Makefile
+}
+
+# quilt ignores DESTDIR
+do_install () {
+ oe_runmake ${EXTRA_OE_MAKE_ARGS} install
+ # cleanup unpackaged files
+ rm -rf ${D}/${datadir}/emacs
+}
+
+do_compile_ptest() {
+ oe_runmake bin/patch-wrapper test/.depend
+}
+
+do_install_ptest() {
+ tar -c --exclude=\*.in bin/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -c --exclude=\*.in compat/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -c --exclude=\*.in quilt/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ tar -c --exclude=mail.test --exclude=delete.test test/ | ( cd ${D}${PTEST_PATH} && tar -xf - && chmod 777 test)
+ cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
+ cp ${WORKDIR}/test.sh ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
+ perl-module-filehandle perl-module-getopt-std \
+ perl-module-posix perl-module-file-temp \
+ perl-module-text-parsewords perl-module-overloading \
+ bash util-linux-getopt \
+ "
diff --git a/poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch b/poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch
new file mode 100644
index 000000000..21219a0bb
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt/0001-tests-Allow-different-output-from-mv.patch
@@ -0,0 +1,29 @@
+From 1530138960cfafbeefb95f2a760954c00b4d0ef0 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 29 Mar 2017 15:11:59 +0300
+Subject: [PATCH] tests: Allow different output from mv
+
+busybox mv has different error messages: fix the test
+
+Upstream-Status: Inappropriate [embedded]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ test/failbackup.test | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/failbackup.test b/test/failbackup.test
+index 37046f7..fce6725 100644
+--- a/test/failbackup.test
++++ b/test/failbackup.test
+@@ -16,7 +16,7 @@ What happens when refresh fails because of a permission error?
+ $ cat > test.txt
+ < This is updated test.txt.
+ $ quilt refresh --backup
+- >~ mv: cannot move [`']?%{P}test.diff'? to [`']?%{P}test.diff~'?: Permission denied
++ >~ mv: .*: Permission denied
+ $ echo %{?}
+ > 1
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/quilt/quilt/Makefile b/poky/meta/recipes-devtools/quilt/quilt/Makefile
new file mode 100644
index 000000000..7b3ac8a49
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt/Makefile
@@ -0,0 +1,13 @@
+PATH := $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
+QUILT_DIR := $(CURDIR)/quilt
+QUILTRC := $(CURDIR)/test/test.quiltrc
+export QUILT_DIR QUILTRC
+CHECK_ENV := P=patches/; _P=../patches/; export P _P
+-include test/.depend
+
+check-% : test/%.test
+ @LANG=C; LC_ALL=C; \
+ export LANG LC_ALL; \
+ $(CHECK_ENV); \
+ cd $(<D); \
+ ./run -q $(<F)
diff --git a/poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch b/poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
new file mode 100644
index 000000000..672155bb6
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+the test should be skipped for cross compiling.
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 026a36c..8af591b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -245,6 +245,7 @@ fi
+ QUILT_COMPAT_PROG_PATH(DIFF, diff)
+ QUILT_COMPAT_PROG_PATH(PATCH, patch)
+
++if test "x$cross_compiling" != "xyes"; then
+ # Sun diff and others will not work because GNU patch options are used.
+ AC_MSG_CHECKING([the version of $DIFF])
+ if $DIFF --version 2>/dev/null | grep GNU >/dev/null; then
+@@ -293,6 +294,7 @@ current version of patch from ftp.gnu.org, or if you already have GNU patch
+ then you can supply its path with the '--with-patch=' option.
+ ])
+ fi
++fi
+
+ QUILT_COMPAT_PROG_PATH(FIND, find)
+
diff --git a/poky/meta/recipes-devtools/quilt/quilt/run-ptest b/poky/meta/recipes-devtools/quilt/quilt/run-ptest
new file mode 100755
index 000000000..4b808aee4
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+THIS_SH=/bin/sh
+ln -sf /bin/ed /usr/bin/ed
+/usr/sbin/adduser --disabled-password quilttest
+su -c "${THIS_SH} ./test.sh" quilttest
+/usr/sbin/deluser quilttest
+rm -f /usr/bin/ed
diff --git a/poky/meta/recipes-devtools/quilt/quilt/test.sh b/poky/meta/recipes-devtools/quilt/quilt/test.sh
new file mode 100755
index 000000000..6563e4a2f
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt/test.sh
@@ -0,0 +1 @@
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
diff --git a/poky/meta/recipes-devtools/quilt/quilt_0.65.bb b/poky/meta/recipes-devtools/quilt/quilt_0.65.bb
new file mode 100644
index 000000000..5bf818d0b
--- /dev/null
+++ b/poky/meta/recipes-devtools/quilt/quilt_0.65.bb
@@ -0,0 +1,8 @@
+require quilt.inc
+inherit gettext
+
+SRC_URI += "file://gnu_patch_test_fix_target.patch"
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch b/poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
new file mode 100644
index 000000000..ac6dcaf10
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch
@@ -0,0 +1,40 @@
+From e3eff024826550aec4a6a5baef7210a29faf299d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 9 Mar 2017 18:54:02 +0200
+Subject: [PATCH] Add a color setting for mips64_n32 binaries
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ build/rpmfc.c | 1 +
+ rpmrc.in | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index d38a10916..c8e2f876a 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -622,6 +622,7 @@ exit:
+ static const struct rpmfcTokens_s rpmfcTokens[] = {
+ { "directory", RPMFC_INCLUDE },
+
++ { "N32 MIPS64", RPMFC_ELFMIPSN32|RPMFC_INCLUDE },
+ { "ELF 32-bit", RPMFC_ELF32|RPMFC_INCLUDE },
+ { "ELF 64-bit", RPMFC_ELF64|RPMFC_INCLUDE },
+
+diff --git a/rpmrc.in b/rpmrc.in
+index abc08fc31..f5bc820d8 100644
+--- a/rpmrc.in
++++ b/rpmrc.in
+@@ -133,6 +133,8 @@ archcolor: mipsr6el 1
+ archcolor: mips64r6 2
+ archcolor: mips64r6el 2
+
++archcolor: mips64_n32 4
++
+ archcolor: m68k 1
+
+ archcolor: m68kmint 1
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
new file mode 100644
index 000000000..80e2f0fad
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch
@@ -0,0 +1,33 @@
+From 87cfc0db1ed6fe381a5ed5f0016d8c3344a31a11 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 9 Jan 2017 18:52:11 +0200
+Subject: [PATCH] Do not add an unsatisfiable dependency when building rpms in
+ a short-circuited way.
+
+Upstream permits short-circuiting only for local testing; Yocto on the other
+hand produces rpms that way by design.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ build/pack.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/build/pack.c b/build/pack.c
+index 1261cdbba..bb2d6f4f6 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -595,10 +595,6 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
+ headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+ }
+
+- if (cheating) {
+- (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
+- }
+-
+ { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
+ char *binRpm, *binDir;
+ binRpm = headerFormat(pkg->header, binFormat, &errorString);
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
new file mode 100644
index 000000000..5604cb903
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch
@@ -0,0 +1,61 @@
+From c82c19dc583843b1a975f2e3f2e151656a6f377c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 27 Feb 2017 09:43:30 +0200
+Subject: [PATCH 06/14] Do not hardcode "lib/rpm" as the installation path for
+ default configuration and macros.
+
+Upstream-Status: Denied [https://github.com/rpm-software-management/rpm/pull/263]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ configure.ac | 2 +-
+ macros.in | 2 +-
+ rpm.am | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7155d9f00..21b95ae5f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1047,7 +1047,7 @@ else
+ usrprefix=$prefix
+ fi
+
+-RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"
++RPMCONFIGDIR="`echo ${libdir}/rpm`"
+ AC_SUBST(RPMCONFIGDIR)
+
+ AC_SUBST(OBJDUMP)
+diff --git a/macros.in b/macros.in
+index d08624856..68a972f1e 100644
+--- a/macros.in
++++ b/macros.in
+@@ -954,7 +954,7 @@ package or when debugging this package.\
+ %_sharedstatedir %{_prefix}/com
+ %_localstatedir %{_prefix}/var
+ %_lib lib
+-%_libdir %{_exec_prefix}/%{_lib}
++%_libdir @libdir@
+ %_includedir %{_prefix}/include
+ %_infodir %{_datadir}/info
+ %_mandir %{_datadir}/man
+diff --git a/rpm.am b/rpm.am
+index 51225892d..e0c834d37 100644
+--- a/rpm.am
++++ b/rpm.am
+@@ -1,10 +1,10 @@
+ # Internal binaries
+ ## HACK: It probably should be $(libexecdir)/rpm or $(libdir)/rpm
+-rpmlibexecdir = $(prefix)/lib/rpm
++rpmlibexecdir = $(libdir)/rpm
+
+ # Host independent config files
+ ## HACK: it probably should be $(datadir)/rpm
+-rpmconfigdir = $(prefix)/lib/rpm
++rpmconfigdir = $(libdir)/rpm
+
+ # Libtool version (current-revision-age) for all our libraries
+ rpm_version_info = 8:1:0
+--
+2.15.1
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
new file mode 100644
index 000000000..96eb41895
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-read-config-files-from-HOME.patch
@@ -0,0 +1,38 @@
+From 35381b6cd6c1b571bf7e6b0640de0f54dbf94386 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 10 Jan 2017 14:11:30 +0200
+Subject: [PATCH] Do not read config files from $HOME
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmrc.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/rpmrc.c b/lib/rpmrc.c
+index 4ed991321..19fe80f98 100644
+--- a/lib/rpmrc.c
++++ b/lib/rpmrc.c
+@@ -458,8 +458,7 @@ static void setDefaults(void)
+ if (!defrcfiles) {
+ defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
+ confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
+- SYSCONFDIR "/rpmrc", ":",
+- "~/.rpmrc", NULL);
++ SYSCONFDIR "/rpmrc", ":");
+ }
+
+ #ifndef MACROFILES
+@@ -471,8 +470,7 @@ static void setDefaults(void)
+ confdir, "/" RPMCANONVENDOR "/macros", ":",
+ SYSCONFDIR "/rpm/macros.*", ":",
+ SYSCONFDIR "/rpm/macros", ":",
+- SYSCONFDIR "/rpm/%{_target}/macros", ":",
+- "~/.rpmmacros", NULL);
++ SYSCONFDIR "/rpm/%{_target}/macros", ":");
+ }
+ #else
+ macrofiles = MACROFILES;
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
new file mode 100644
index 000000000..bf24d43eb
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch
@@ -0,0 +1,40 @@
+From ffb5301a8594140ad7a58bc0f2053be8ca2b2946 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 20 Jan 2017 13:32:06 +0200
+Subject: [PATCH 1/2] Do not reset the PATH environment variable before running
+ scriptlets.
+
+We add lots of native stuff into it and scriptlets rely on that.
+
+Also need to remove the xx test later in the function since the
+value could now be used un-initialised.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmscript.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 92f949fa2..7c1aa75a8 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -201,7 +201,7 @@ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
+ if (ipath && ipath[5] != '%')
+ path = ipath;
+
+- xx = setenv("PATH", path, 1);
++ //xx = setenv("PATH", path, 1);
+ free(ipath);
+ }
+
+@@ -206,9 +206,7 @@ static void doScriptExec(ARGV_const_t ar
+ /* XXX Don't mtrace into children. */
+ unsetenv("MALLOC_CHECK_");
+
+- if (xx == 0) {
+ xx = execv(argv[0], argv);
+- }
+ }
+ _exit(127); /* exit 127 for compatibility with bash(1) */
+ }
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Factor-out-and-unify-setting-CLOEXEC.patch b/poky/meta/recipes-devtools/rpm/files/0001-Factor-out-and-unify-setting-CLOEXEC.patch
new file mode 100644
index 000000000..6f440c617
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Factor-out-and-unify-setting-CLOEXEC.patch
@@ -0,0 +1,148 @@
+From 9c3e5de3240554c8ea1b29d52eeadee4840fefac Mon Sep 17 00:00:00 2001
+From: Kir Kolyshkin <kolyshkin@gmail.com>
+Date: Tue, 29 May 2018 17:37:05 -0700
+Subject: [PATCH 1/3] Factor out and unify setting CLOEXEC
+
+Commit 7a7c31f5 ("Set FD_CLOEXEC on opened files before exec from
+lua script is called") copied the code that sets CLOEXEC flag on all
+possible file descriptors from lib/rpmscript.c to luaext/lposix.c,
+essentially creating two copies of the same code (modulo comments
+and the unused assignment).
+
+This commit moves the functionality into its own function, without
+any code modifications, using the version from luaext/lposix.c.
+
+Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
+Upstream-Status: Accepted [https://github.com/rpm-software-management/rpm/pull/444]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ lib/rpmscript.c | 18 ++----------------
+ luaext/lposix.c | 13 ++-----------
+ rpmio/rpmio.c | 16 ++++++++++++++++
+ rpmio/rpmio_internal.h | 6 ++++++
+ 4 files changed, 26 insertions(+), 27 deletions(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 747385a5b..b4ccd3246 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -3,7 +3,6 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <errno.h>
+-#include <unistd.h>
+
+ #include <rpm/rpmfileutil.h>
+ #include <rpm/rpmmacro.h>
+@@ -14,6 +13,7 @@
+
+ #include "rpmio/rpmlua.h"
+ #include "lib/rpmscript.h"
++#include "rpmio/rpmio_internal.h"
+
+ #include "lib/rpmplugins.h" /* rpm plugins hooks */
+
+@@ -170,26 +170,12 @@ static const char * const SCRIPT_PATH = "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr
+ static void doScriptExec(ARGV_const_t argv, ARGV_const_t prefixes,
+ FD_t scriptFd, FD_t out)
+ {
+- int flag;
+- int fdno;
+ int xx;
+- int open_max;
+
+ /* SIGPIPE is ignored in rpm, reset to default for the scriptlet */
+ (void) signal(SIGPIPE, SIG_DFL);
+
+- /* XXX Force FD_CLOEXEC on all inherited fdno's. */
+- open_max = sysconf(_SC_OPEN_MAX);
+- if (open_max == -1) {
+- open_max = 1024;
+- }
+- for (fdno = 3; fdno < open_max; fdno++) {
+- flag = fcntl(fdno, F_GETFD);
+- if (flag == -1 || (flag & FD_CLOEXEC))
+- continue;
+- xx = fcntl(fdno, F_SETFD, FD_CLOEXEC);
+- /* XXX W2DO? debug msg for inheirited fdno w/o FD_CLOEXEC */
+- }
++ rpmSetCloseOnExec();
+
+ if (scriptFd != NULL) {
+ int sfdno = Fileno(scriptFd);
+diff --git a/luaext/lposix.c b/luaext/lposix.c
+index 0a7c26c71..5d7ad3c87 100644
+--- a/luaext/lposix.c
++++ b/luaext/lposix.c
+@@ -27,6 +27,7 @@
+ #include <unistd.h>
+ #include <utime.h>
+ #include <rpm/rpmutil.h>
++#include "rpmio/rpmio_internal.h"
+
+ #define MYNAME "posix"
+ #define MYVERSION MYNAME " library for " LUA_VERSION " / Nov 2003"
+@@ -335,21 +336,11 @@ static int Pexec(lua_State *L) /** exec(path,[args]) */
+ const char *path = luaL_checkstring(L, 1);
+ int i,n=lua_gettop(L);
+ char **argv;
+- int flag, fdno, open_max;
+
+ if (!have_forked)
+ return luaL_error(L, "exec not permitted in this context");
+
+- open_max = sysconf(_SC_OPEN_MAX);
+- if (open_max == -1) {
+- open_max = 1024;
+- }
+- for (fdno = 3; fdno < open_max; fdno++) {
+- flag = fcntl(fdno, F_GETFD);
+- if (flag == -1 || (flag & FD_CLOEXEC))
+- continue;
+- fcntl(fdno, F_SETFD, FD_CLOEXEC);
+- }
++ rpmSetCloseOnExec();
+
+ argv = malloc((n+1)*sizeof(char*));
+ if (argv==NULL) return luaL_error(L,"not enough memory");
+diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
+index c7cbc32aa..ea111d2ec 100644
+--- a/rpmio/rpmio.c
++++ b/rpmio/rpmio.c
+@@ -1759,3 +1759,19 @@ DIGEST_CTX fdDupDigest(FD_t fd, int id)
+
+ return ctx;
+ }
++
++void rpmSetCloseOnExec(void)
++{
++ int flag, fdno, open_max;
++
++ open_max = sysconf(_SC_OPEN_MAX);
++ if (open_max == -1) {
++ open_max = 1024;
++ }
++ for (fdno = 3; fdno < open_max; fdno++) {
++ flag = fcntl(fdno, F_GETFD);
++ if (flag == -1 || (flag & FD_CLOEXEC))
++ continue;
++ fcntl(fdno, F_SETFD, FD_CLOEXEC);
++ }
++}
+diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
+index fbed183b0..370cbdc75 100644
+--- a/rpmio/rpmio_internal.h
++++ b/rpmio/rpmio_internal.h
+@@ -41,6 +41,12 @@ DIGEST_CTX fdDupDigest(FD_t fd, int id);
+ int rpmioSlurp(const char * fn,
+ uint8_t ** bp, ssize_t * blenp);
+
++/**
++ * Set close-on-exec flag for all opened file descriptors, except
++ * stdin/stdout/stderr.
++ */
++void rpmSetCloseOnExec(void);
++
+ #ifdef __cplusplus
+ }
+ #endif
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch b/poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
new file mode 100644
index 000000000..0b1d6298a
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Fix-build-with-musl-C-library.patch
@@ -0,0 +1,48 @@
+From d076de030deb9cafd9b2e82be5d506cebdefad0b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 27 Feb 2017 14:43:21 +0200
+Subject: [PATCH 1/9] Fix build with musl C library.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ configure.ac | 3 ++-
+ rpmio/digest_nss.c | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index c04a2e8d1..c9d9ac16d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -255,6 +255,7 @@ AC_SEARCH_LIBS(dlopen, [dl])
+ # Check for libelf library. Prefer external, otherwise none.
+ WITH_LIBELF_LIB=
+ AC_CHECK_HEADER([libelf.h])
++AC_CHECK_HEADERS([error.h], [WITH_ERROR_H=yes])
+ AC_CHECK_HEADERS([gelf.h], [
+ AC_CHECK_LIB(elf, gelf_getvernaux, [
+ AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
+@@ -263,7 +264,7 @@ AC_CHECK_HEADERS([gelf.h], [
+ ])
+ ])
+ AC_SUBST(WITH_LIBELF_LIB)
+-AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes])
++AM_CONDITIONAL(LIBELF,[test "$WITH_LIBELF" = yes && test "$WITH_ERROR_H" = yes])
+
+ AC_CHECK_HEADERS([dwarf.h], [
+ WITH_LIBDWARF=yes
+diff --git a/rpmio/digest_nss.c b/rpmio/digest_nss.c
+index 992d9acf6..e11920e3e 100644
+--- a/rpmio/digest_nss.c
++++ b/rpmio/digest_nss.c
+@@ -1,5 +1,6 @@
+ #include "system.h"
+
++#include <signal.h>
+ #include <pthread.h>
+ #include <nss.h>
+ #include <sechash.h>
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch b/poky/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch
new file mode 100644
index 000000000..6e44f0b7f
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-Split-binary-package-building-into-a-separate-functi.patch
@@ -0,0 +1,84 @@
+From 721a660a507d6d062e7aecafad886c643970a5d5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 25 May 2017 18:15:27 +0300
+Subject: [PATCH 1/4] Split binary package building into a separate function
+
+So that it can be run as a thread pool task.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ build/pack.c | 33 +++++++++++++++++++++------------
+ 1 file changed, 21 insertions(+), 12 deletions(-)
+
+diff --git a/build/pack.c b/build/pack.c
+index 518f4e92a..ccfd614cc 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -546,18 +546,13 @@ static rpmRC checkPackages(char *pkgcheck)
+ return RPMRC_OK;
+ }
+
+-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
++static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename)
+ {
+- rpmRC rc;
+- const char *errorString;
+- Package pkg;
+- char *pkglist = NULL;
+-
+- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+- char *fn;
++ const char *errorString;
++ rpmRC rc = RPMRC_OK;
+
+ if (pkg->fileList == NULL)
+- continue;
++ return rc;
+
+ if ((rc = processScriptFiles(spec, pkg)))
+ return rc;
+@@ -587,7 +582,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
+ headerGetString(pkg->header, RPMTAG_NAME), errorString);
+ return RPMRC_FAIL;
+ }
+- fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
++ *filename = rpmGetPath("%{_rpmdir}/", binRpm, NULL);
+ if ((binDir = strchr(binRpm, '/')) != NULL) {
+ struct stat st;
+ char *dn;
+@@ -609,14 +604,28 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
+ free(binRpm);
+ }
+
+- rc = writeRPM(pkg, NULL, fn, NULL);
++ rc = writeRPM(pkg, NULL, *filename, NULL);
+ if (rc == RPMRC_OK) {
+ /* Do check each written package if enabled */
+- char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", fn, NULL);
++ char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL);
+ if (pkgcheck[0] != ' ') {
+ rc = checkPackages(pkgcheck);
+ }
+ free(pkgcheck);
++ }
++ return rc;
++}
++
++rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
++{
++ rpmRC rc;
++ Package pkg;
++ char *pkglist = NULL;
++
++ for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
++ char *fn = NULL;
++ rc = packageBinary(spec, pkg, cookie, cheating, &fn);
++ if (rc == RPMRC_OK) {
+ rstrcat(&pkglist, fn);
+ rstrcat(&pkglist, " ");
+ }
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch b/poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
new file mode 100644
index 000000000..2be3cb5af
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-When-cross-installing-execute-package-scriptlets-wit.patch
@@ -0,0 +1,37 @@
+From a6f269f879221f2777169c5f7291322afe6b661b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 17 Jan 2017 14:07:17 +0200
+Subject: [PATCH] When cross-installing, execute package scriptlets without
+ chrooting into destination rootfs
+
+This is triggered only when RPM_NO_CHROOT_FOR_SCRIPTS environment variable is defined.
+Otherwise they will trigger an explosion of failures, obviously.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmscript.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/rpmscript.c b/lib/rpmscript.c
+index 98d3f420d..b95b5d606 100644
+--- a/lib/rpmscript.c
++++ b/lib/rpmscript.c
+@@ -467,7 +467,13 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
+
+ if (rc != RPMRC_FAIL) {
+ if (script_type & RPMSCRIPTLET_EXEC) {
+- rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++ if (getenv("RPM_NO_CHROOT_FOR_SCRIPTS") != NULL) {
++ rpmChrootOut();
++ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++ rpmChrootIn();
++ } else {
++ rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
++ }
+ } else {
+ rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);
+ }
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-configure.ac-add-option-for-dbus.patch b/poky/meta/recipes-devtools/rpm/files/0001-configure.ac-add-option-for-dbus.patch
new file mode 100644
index 000000000..dc71d9b18
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-configure.ac-add-option-for-dbus.patch
@@ -0,0 +1,42 @@
+From dfb422c744fdc1838afc40b8e1f161bb46093d92 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Sun, 8 Apr 2018 12:06:42 +0800
+Subject: [PATCH] configure.ac: add option for dbus
+
+Add option for dbus so that users could choose to build with dbus
+or with no dbus.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ configure.ac | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4db15c7909..493f393d31 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -976,12 +976,15 @@ AS_IF([test "$enable_plugins" = yes],[
+ ])
+ AM_CONDITIONAL(ENABLE_PLUGINS,[test "$enable_plugins" = yes])
+
+-with_dbus=no
+-AS_IF([test "$enable_plugins" != no],[
++AC_ARG_WITH([dbus], [AS_HELP_STRING([--with-dbus], [build with dbus support])],
++ [],
++ [with_dbus=yes])
++
++AS_IF([test "$with_dbus" != no],[
+ PKG_CHECK_MODULES([DBUS],
+ [dbus-1 >= 1.3],
+- [AC_DEFINE(DBUS, 1, [Build with dbus support?]) with_dbus=yes],
+- [with_dbus=no])
++ [AC_DEFINE(DBUS, 1, [Build with dbus support?])],
++ [AC_MSG_ERROR([dbus not present (--without-dbus to disable)])])
+ AC_SUBST(DBUS_CFLAGS)
+ AC_SUBST(DBUS_LIBS)
+ ])
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch b/poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
new file mode 100644
index 000000000..a6c58699d
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0001-perl-disable-auto-reqs.patch
@@ -0,0 +1,32 @@
+perl: disable auto requires
+
+When generating automatic requirements, it's possible for perl scripts to
+declare 'optional' dependencies. These seem to often be incorrect and will
+cause installation failures in OE. Instead of fixing the perl scripts, it
+was decided it is better to simply disable the automatic dependency
+generation. This matches the behavior from the previous RPM5 implementation.
+
+Upstream-Status: Inappropriate [OE specific configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: git/fileattrs/perl.attr
+===================================================================
+--- git.orig/fileattrs/perl.attr
++++ git/fileattrs/perl.attr
+@@ -1,3 +1,3 @@
+-%__perl_requires %{_rpmconfigdir}/perl.req
++#__perl_requires %{_rpmconfigdir}/perl.req
+ %__perl_magic ^.*[Pp]erl .*$
+ %__perl_flags exeonly
+Index: git/fileattrs/perllib.attr
+===================================================================
+--- git.orig/fileattrs/perllib.attr
++++ git/fileattrs/perllib.attr
+@@ -1,5 +1,5 @@
+ %__perllib_provides %{_rpmconfigdir}/perl.prov
+-%__perllib_requires %{_rpmconfigdir}/perl.req
++#__perllib_requires %{_rpmconfigdir}/perl.req
+ %__perllib_magic ^Perl[[:digit:]] module source.*
+ %__perllib_path \\.pm$
+ %__perllib_flags magic_and_path
diff --git a/poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch b/poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
new file mode 100644
index 000000000..b3dbc319b
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch
@@ -0,0 +1,72 @@
+From 383c0b097b7eba16801a9e3c4b8e36a4b6de74ab Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 20 Jan 2017 13:33:05 +0200
+Subject: [PATCH 2/2] Add support for prefixing /etc from RPM_ETCCONFIGDIR
+ environment variable
+
+This is needed so that rpm can pick up target-specific configuration
+from target rootfs instead of its own native sysroot.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ lib/rpmrc.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/lib/rpmrc.c b/lib/rpmrc.c
+index 19fe80f98..6b27b3941 100644
+--- a/lib/rpmrc.c
++++ b/lib/rpmrc.c
+@@ -455,10 +455,14 @@ const char * lookupInDefaultTable(const char * name,
+ static void setDefaults(void)
+ {
+ const char *confdir = rpmConfigDir();
++ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
++ if (etcconfdir == NULL)
++ etcconfdir = "";
++
+ if (!defrcfiles) {
+ defrcfiles = rstrscat(NULL, confdir, "/rpmrc", ":",
+ confdir, "/" RPMCANONVENDOR "/rpmrc", ":",
+- SYSCONFDIR "/rpmrc", ":");
++ etcconfdir, SYSCONFDIR "/rpmrc", ":", NULL);
+ }
+
+ #ifndef MACROFILES
+@@ -468,9 +472,9 @@ static void setDefaults(void)
+ confdir, "/platform/%{_target}/macros", ":",
+ confdir, "/fileattrs/*.attr", ":",
+ confdir, "/" RPMCANONVENDOR "/macros", ":",
+- SYSCONFDIR "/rpm/macros.*", ":",
+- SYSCONFDIR "/rpm/macros", ":",
+- SYSCONFDIR "/rpm/%{_target}/macros", ":");
++ etcconfdir, SYSCONFDIR "/rpm/macros.*", ":",
++ etcconfdir, SYSCONFDIR "/rpm/macros", ":",
++ etcconfdir, SYSCONFDIR "/rpm/%{_target}/macros", ":", NULL);
+ }
+ #else
+ macrofiles = MACROFILES;
+@@ -989,7 +993,11 @@ static void read_auxv(void)
+ */
+ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
+ {
+- const char * const platform_path = SYSCONFDIR "/rpm/platform";
++ const char *etcconfdir = getenv("RPM_ETCCONFIGDIR");
++ if (etcconfdir == NULL)
++ etcconfdir = "";
++
++ const char * const platform_path = rstrscat(NULL, etcconfdir, SYSCONFDIR "/rpm/platform", NULL);
+ static struct utsname un;
+ char * chptr;
+ canonEntry canon;
+@@ -1286,6 +1294,7 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os)
+
+ if (arch) *arch = un.machine;
+ if (os) *os = un.sysname;
++ free(platform_path);
+ }
+
+ static
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0002-Optimize-rpmSetCloseOnExec.patch b/poky/meta/recipes-devtools/rpm/files/0002-Optimize-rpmSetCloseOnExec.patch
new file mode 100644
index 000000000..a27f8e623
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0002-Optimize-rpmSetCloseOnExec.patch
@@ -0,0 +1,100 @@
+From 5e6f05cd8dad6c1ee6bd1e6e43f176976c9c3416 Mon Sep 17 00:00:00 2001
+From: Kir Kolyshkin <kolyshkin@gmail.com>
+Date: Tue, 29 May 2018 17:52:56 -0700
+Subject: [PATCH 2/3] Optimize rpmSetCloseOnExec
+
+In case maximum number of open files limit is set too high, both
+luaext/Pexec() and lib/doScriptExec() spend way too much time
+trying to set FD_CLOEXEC flag for all those file descriptors,
+resulting in severe increase of time it takes to execute say
+rpm or dnf.
+
+This becomes increasingly noticeable when running with e.g. under
+Docker, the reason being:
+
+> $ docker run fedora ulimit -n
+> 1048576
+
+One obvious fix is to use procfs to get the actual list of opened fds
+and iterate over it. My quick-n-dirty benchmark shows the /proc approach
+is about 10x faster than iterating through a list of just 1024 fds,
+so it's an improvement even for default ulimit values.
+
+Note that the old method is still used in case /proc is not available.
+
+While at it,
+
+ 1. fix the function by making sure we modify (rather than set)
+ the existing flags. As the only known flag is FD_CLOEXEC,
+ this change is currently purely aesthetical, but in case
+ other flags will appear it will become a real bug fix.
+
+ 2. get rid of magic number 3; use STDERR_FILENO
+
+Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
+
+Fixes #444
+
+Upstream-Status: Accepted [https://github.com/rpm-software-management/rpm/pull/444]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ rpmio/rpmio.c | 43 ++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 34 insertions(+), 9 deletions(-)
+
+diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
+index ea111d2ec..55351c221 100644
+--- a/rpmio/rpmio.c
++++ b/rpmio/rpmio.c
+@@ -1760,18 +1760,43 @@ DIGEST_CTX fdDupDigest(FD_t fd, int id)
+ return ctx;
+ }
+
++static void set_cloexec(int fd)
++{
++ int flags = fcntl(fd, F_GETFD);
++
++ if (flags == -1 || (flags & FD_CLOEXEC))
++ return;
++
++ fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
++}
++
+ void rpmSetCloseOnExec(void)
+ {
+- int flag, fdno, open_max;
++ const int min_fd = STDERR_FILENO; /* don't touch stdin/out/err */
++ int fd;
++
++ DIR *dir = opendir("/proc/self/fd");
++ if (dir == NULL) { /* /proc not available */
++ /* iterate over all possible fds, might be slow */
++ int open_max = sysconf(_SC_OPEN_MAX);
++ if (open_max == -1)
++ open_max = 1024;
+
+- open_max = sysconf(_SC_OPEN_MAX);
+- if (open_max == -1) {
+- open_max = 1024;
++ for (fd = min_fd + 1; fd < open_max; fd++)
++ set_cloexec(fd);
++
++ return;
+ }
+- for (fdno = 3; fdno < open_max; fdno++) {
+- flag = fcntl(fdno, F_GETFD);
+- if (flag == -1 || (flag & FD_CLOEXEC))
+- continue;
+- fcntl(fdno, F_SETFD, FD_CLOEXEC);
++
++ /* iterate over fds obtained from /proc */
++ struct dirent *entry;
++ while ((entry = readdir(dir)) != NULL) {
++ fd = atoi(entry->d_name);
++ if (fd > min_fd)
++ set_cloexec(fd);
+ }
++
++ closedir(dir);
++
++ return;
+ }
diff --git a/poky/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch b/poky/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch
new file mode 100644
index 000000000..d10041c2e
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0002-Run-binary-package-creation-via-thread-pools.patch
@@ -0,0 +1,127 @@
+From 513200cf76758de4668312c628d6362bdabfaf4b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 25 May 2017 19:30:20 +0300
+Subject: [PATCH 1/3] Run binary package creation via thread pools.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ build/pack.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
+ configure.ac | 3 +++
+ 2 files changed, 70 insertions(+), 14 deletions(-)
+
+diff --git a/build/pack.c b/build/pack.c
+index ccfd614cc..ed5b9ab4e 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -616,25 +616,78 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
+ return rc;
+ }
+
+-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
++struct binaryPackageTaskData
+ {
+- rpmRC rc;
+ Package pkg;
++ char *filename;
++ rpmRC result;
++ struct binaryPackageTaskData *next;
++};
++
++static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating)
++{
++ struct binaryPackageTaskData *tasks = NULL;
++ struct binaryPackageTaskData *task = NULL;
++ struct binaryPackageTaskData *prev = NULL;
++
++ for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
++ task = rcalloc(1, sizeof(*task));
++ task->pkg = pkg;
++ if (pkg == spec->packages) {
++ // the first package needs to be processed ahead of others, as they copy
++ // changelog data from it, and so otherwise data races would happen
++ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename));
++ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
++ tasks = task;
++ }
++ if (prev != NULL) {
++ prev->next = task;
++ }
++ prev = task;
++ }
++
++ #pragma omp parallel
++ #pragma omp single
++ // re-declaring task variable is necessary, or older gcc versions will produce code that segfaults
++ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
++ if (task != tasks)
++ #pragma omp task
++ {
++ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename));
++ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
++ }
++ }
++
++ return tasks;
++}
++
++static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks)
++{
++ while (tasks != NULL) {
++ struct binaryPackageTaskData* next = tasks->next;
++ rfree(tasks->filename);
++ rfree(tasks);
++ tasks = next;
++ }
++}
++
++rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
++{
+ char *pkglist = NULL;
+
+- for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+- char *fn = NULL;
+- rc = packageBinary(spec, pkg, cookie, cheating, &fn);
+- if (rc == RPMRC_OK) {
+- rstrcat(&pkglist, fn);
+- rstrcat(&pkglist, " ");
+- }
+- free(fn);
+- if (rc != RPMRC_OK) {
+- pkglist = _free(pkglist);
+- return rc;
+- }
++ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating);
++
++ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
++ if (task->result == RPMRC_OK) {
++ rstrcat(&pkglist, task->filename);
++ rstrcat(&pkglist, " ");
++ } else {
++ _free(pkglist);
++ freeBinaryPackageTasks(tasks);
++ return RPMRC_FAIL;
++ }
+ }
++ freeBinaryPackageTasks(tasks);
+
+ /* Now check the package set if enabled */
+ if (pkglist != NULL) {
+diff --git a/configure.ac b/configure.ac
+index a506ec819..59fa0acaf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,6 +17,9 @@ AC_DISABLE_STATIC
+
+ PKG_PROG_PKG_CONFIG
+
++AC_OPENMP
++RPMCFLAGS="$OPENMP_CFLAGS $RPMCFLAGS"
++
+ dnl Checks for programs.
+ AC_PROG_CXX
+ AC_PROG_AWK
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0003-rpmSetCloseOnExec-use-getrlimit.patch b/poky/meta/recipes-devtools/rpm/files/0003-rpmSetCloseOnExec-use-getrlimit.patch
new file mode 100644
index 000000000..389b41b42
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0003-rpmSetCloseOnExec-use-getrlimit.patch
@@ -0,0 +1,53 @@
+From 307e28b4cb08b05bc044482058eeebc9f59bb9a9 Mon Sep 17 00:00:00 2001
+From: Kir Kolyshkin <kolyshkin@gmail.com>
+Date: Tue, 29 May 2018 18:09:27 -0700
+Subject: [PATCH 3/3] rpmSetCloseOnExec: use getrlimit()
+
+In case /proc is not available to get the actual list of opened fds,
+we fall back to iterating through the list of all possible fds.
+
+It is possible that during the course of the program execution the limit
+on number of open file descriptors might be lowered, so using the
+current limit, as returned by sysconf(_SC_OPEN_MAX), might omit some
+fds. Therefore, it is better to use rlim_max from the structure
+filled in by gertlimit(RLIMIT_NOFILE) to make sure we're checking
+all fds.
+
+This slows down the function, but only in the case /proc is not
+available, which should be rare in practice.
+
+Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
+Upstream-Status: Accepted [https://github.com/rpm-software-management/rpm/pull/444]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ rpmio/rpmio.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
+index 55351c221..e051c9863 100644
+--- a/rpmio/rpmio.c
++++ b/rpmio/rpmio.c
+@@ -10,6 +10,7 @@
+ #include <sys/personality.h>
+ #endif
+ #include <sys/utsname.h>
++#include <sys/resource.h>
+
+ #include <rpm/rpmlog.h>
+ #include <rpm/rpmmacro.h>
+@@ -1778,7 +1779,14 @@ void rpmSetCloseOnExec(void)
+ DIR *dir = opendir("/proc/self/fd");
+ if (dir == NULL) { /* /proc not available */
+ /* iterate over all possible fds, might be slow */
+- int open_max = sysconf(_SC_OPEN_MAX);
++ struct rlimit rl;
++ int open_max;
++
++ if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && rl.rlim_max != RLIM_INFINITY)
++ open_max = rl.rlim_max;
++ else
++ open_max = sysconf(_SC_OPEN_MAX);
++
+ if (open_max == -1)
+ open_max = 1024;
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch b/poky/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch
new file mode 100644
index 000000000..c348ae533
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch
@@ -0,0 +1,207 @@
+From c80892f17e44331206c8318d53b63bb6a99554d0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 30 May 2017 13:58:30 +0300
+Subject: [PATCH 3/4] rpmstrpool.c: make operations over string pools
+ thread-safe
+
+Otherwise multithreaded rpm building explodes in various ways due
+to data races.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ rpmio/rpmstrpool.c | 56 +++++++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 47 insertions(+), 9 deletions(-)
+
+diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c
+index 30a57eb10..58ba95a02 100644
+--- a/rpmio/rpmstrpool.c
++++ b/rpmio/rpmstrpool.c
+@@ -113,6 +113,8 @@ static poolHash poolHashCreate(int numBuckets)
+ return ht;
+ }
+
++static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid);
++
+ static void poolHashResize(rpmstrPool pool, int numBuckets)
+ {
+ poolHash ht = pool->hash;
+@@ -120,7 +122,7 @@ static void poolHashResize(rpmstrPool pool, int numBuckets)
+
+ for (int i=0; i<ht->numBuckets; i++) {
+ if (!ht->buckets[i].keyid) continue;
+- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid));
++ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid));
+ for (unsigned int j=0;;j++) {
+ unsigned int hash = hashbucket(keyHash, j) % numBuckets;
+ if (!buckets[hash].keyid) {
+@@ -149,7 +151,7 @@ static void poolHashAddHEntry(rpmstrPool pool, const char * key, unsigned int ke
+ ht->buckets[hash].keyid = keyid;
+ ht->keyCount++;
+ break;
+- } else if (!strcmp(rpmstrPoolStr(pool, ht->buckets[hash].keyid), key)) {
++ } else if (!strcmp(rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid), key)) {
+ return;
+ }
+ }
+@@ -191,7 +193,7 @@ static void poolHashPrintStats(rpmstrPool pool)
+ int maxcollisions = 0;
+
+ for (i=0; i<ht->numBuckets; i++) {
+- unsigned int keyHash = rstrhash(rpmstrPoolStr(pool, ht->buckets[i].keyid));
++ unsigned int keyHash = rstrhash(rpmstrPoolStrNoLock(pool, ht->buckets[i].keyid));
+ for (unsigned int j=0;;j++) {
+ unsigned int hash = hashbucket(keyHash, i) % ht->numBuckets;
+ if (hash==i) {
+@@ -221,7 +223,7 @@ static void rpmstrPoolRehash(rpmstrPool pool)
+
+ pool->hash = poolHashCreate(sizehint);
+ for (int i = 1; i <= pool->offs_size; i++)
+- poolHashAddEntry(pool, rpmstrPoolStr(pool, i), i);
++ poolHashAddEntry(pool, rpmstrPoolStrNoLock(pool, i), i);
+ }
+
+ rpmstrPool rpmstrPoolCreate(void)
+@@ -245,6 +247,8 @@ rpmstrPool rpmstrPoolCreate(void)
+
+ rpmstrPool rpmstrPoolFree(rpmstrPool pool)
+ {
++ #pragma omp critical(rpmstrpool)
++ {
+ if (pool) {
+ if (pool->nrefs > 1) {
+ pool->nrefs--;
+@@ -260,18 +264,24 @@ rpmstrPool rpmstrPoolFree(rpmstrPool pool)
+ free(pool);
+ }
+ }
++ }
+ return NULL;
+ }
+
+ rpmstrPool rpmstrPoolLink(rpmstrPool pool)
+ {
++ #pragma omp critical(rpmstrpool)
++ {
+ if (pool)
+ pool->nrefs++;
++ }
+ return pool;
+ }
+
+ void rpmstrPoolFreeze(rpmstrPool pool, int keephash)
+ {
++ #pragma omp critical(rpmstrpool)
++ {
+ if (pool && !pool->frozen) {
+ if (!keephash) {
+ pool->hash = poolHashFree(pool->hash);
+@@ -281,16 +291,20 @@ void rpmstrPoolFreeze(rpmstrPool pool, int keephash)
+ pool->offs_alloced * sizeof(*pool->offs));
+ pool->frozen = 1;
+ }
++ }
+ }
+
+ void rpmstrPoolUnfreeze(rpmstrPool pool)
+ {
++ #pragma omp critical(rpmstrpool)
++ {
+ if (pool) {
+ if (pool->hash == NULL) {
+ rpmstrPoolRehash(pool);
+ }
+ pool->frozen = 0;
+ }
++ }
+ }
+
+ static rpmsid rpmstrPoolPut(rpmstrPool pool, const char *s, size_t slen, unsigned int hash)
+@@ -350,7 +364,7 @@ static rpmsid rpmstrPoolGet(rpmstrPool pool, const char * key, size_t keylen,
+ return 0;
+ }
+
+- s = rpmstrPoolStr(pool, ht->buckets[hash].keyid);
++ s = rpmstrPoolStrNoLock(pool, ht->buckets[hash].keyid);
+ /* pool string could be longer than keylen, require exact matche */
+ if (strncmp(s, key, keylen) == 0 && s[keylen] == '\0')
+ return ht->buckets[hash].keyid;
+@@ -373,27 +387,31 @@ static inline rpmsid strn2id(rpmstrPool pool, const char *s, size_t slen,
+ rpmsid rpmstrPoolIdn(rpmstrPool pool, const char *s, size_t slen, int create)
+ {
+ rpmsid sid = 0;
+-
++ #pragma omp critical(rpmstrpool)
++ {
+ if (s != NULL) {
+ unsigned int hash = rstrnhash(s, slen);
+ sid = strn2id(pool, s, slen, hash, create);
+ }
++ }
+ return sid;
+ }
+
+ rpmsid rpmstrPoolId(rpmstrPool pool, const char *s, int create)
+ {
+ rpmsid sid = 0;
+-
++ #pragma omp critical(rpmstrpool)
++ {
+ if (s != NULL) {
+ size_t slen;
+ unsigned int hash = rstrlenhash(s, &slen);
+ sid = strn2id(pool, s, slen, hash, create);
+ }
++ }
+ return sid;
+ }
+
+-const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
++static const char * rpmstrPoolStrNoLock(rpmstrPool pool, rpmsid sid)
+ {
+ const char *s = NULL;
+ if (pool && sid > 0 && sid <= pool->offs_size)
+@@ -401,12 +419,25 @@ const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
+ return s;
+ }
+
++const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
++{
++ const char *s = NULL;
++ #pragma omp critical(rpmstrpool)
++ {
++ s = rpmstrPoolStrNoLock(pool, sid);
++ }
++ return s;
++}
++
+ size_t rpmstrPoolStrlen(rpmstrPool pool, rpmsid sid)
+ {
+ size_t slen = 0;
++ #pragma omp critical(rpmstrpool)
++ {
+ if (pool && sid > 0 && sid <= pool->offs_size) {
+ slen = strlen(pool->offs[sid]);
+ }
++ }
+ return slen;
+ }
+
+@@ -421,5 +452,12 @@ int rpmstrPoolStreq(rpmstrPool poolA, rpmsid sidA,
+
+ rpmsid rpmstrPoolNumStr(rpmstrPool pool)
+ {
+- return (pool != NULL) ? pool->offs_size : 0;
++ rpmsid id = 0;
++ #pragma omp critical(rpmstrpool)
++ {
++ if (pool) {
++ id = pool->offs_size;
++ }
++ }
++ return id;
+ }
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch b/poky/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch
new file mode 100644
index 000000000..8989dcebd
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0004-build-pack.c-remove-static-local-variables-from-buil.patch
@@ -0,0 +1,339 @@
+From 8ce9fbab2990609bdace457e146160334e931c89 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 8 Jun 2017 17:08:09 +0300
+Subject: [PATCH 14/15] build/pack.c: remove static local variables from
+ buildHost() and getBuildTime()
+
+Their use is causing difficult to diagnoze data races when building multiple
+packages in parallel, and is a bad idea in general, as it also makes it more
+difficult to reason about code.
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/226]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ build/build.c | 54 ++++++++++++++++++++++++++++--
+ build/pack.c | 84 +++++++++--------------------------------------
+ build/rpmbuild_internal.h | 8 +++--
+ 3 files changed, 74 insertions(+), 72 deletions(-)
+
+diff --git a/build/build.c b/build/build.c
+index 81152e53e..6001f9e52 100644
+--- a/build/build.c
++++ b/build/build.c
+@@ -6,6 +6,8 @@
+ #include "system.h"
+
+ #include <errno.h>
++#include <netdb.h>
++#include <time.h>
+ #include <sys/wait.h>
+
+ #include <rpm/rpmlog.h>
+@@ -16,6 +18,50 @@
+
+ #include "debug.h"
+
++static rpm_time_t getBuildTime(void)
++{
++ rpm_time_t buildTime = 0;
++ char *srcdate;
++ time_t epoch;
++ char *endptr;
++
++ srcdate = getenv("SOURCE_DATE_EPOCH");
++ if (srcdate) {
++ errno = 0;
++ epoch = strtol(srcdate, &endptr, 10);
++ if (srcdate == endptr || *endptr || errno != 0)
++ rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
++ else
++ buildTime = (int32_t) epoch;
++ } else
++ buildTime = (int32_t) time(NULL);
++
++ return buildTime;
++}
++
++static char * buildHost(void)
++{
++ char* hostname;
++ struct hostent *hbn;
++ char *bhMacro;
++
++ bhMacro = rpmExpand("%{?_buildhost}", NULL);
++ if (strcmp(bhMacro, "") != 0) {
++ rasprintf(&hostname, "%s", bhMacro);
++ } else {
++ hostname = rcalloc(1024, sizeof(*hostname));
++ (void) gethostname(hostname, 1024);
++ hbn = gethostbyname(hostname);
++ if (hbn)
++ strcpy(hostname, hbn->h_name);
++ else
++ rpmlog(RPMLOG_WARNING,
++ _("Could not canonicalize hostname: %s\n"), hostname);
++ }
++ free(bhMacro);
++ return(hostname);
++}
++
+ /**
+ */
+ static rpmRC doRmSource(rpmSpec spec)
+@@ -201,6 +247,9 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
+ rpmRC rc = RPMRC_OK;
+ int test = (what & RPMBUILD_NOBUILD);
+ char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL;
++ const char* host = buildHost();
++ rpm_time_t buildTime = getBuildTime();
++
+
+ if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") &&
+ getenv("SOURCE_DATE_EPOCH") == NULL) {
+@@ -269,11 +318,11 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
+ goto exit;
+
+ if (((what & RPMBUILD_PACKAGESOURCE) && !test) &&
+- (rc = packageSources(spec, &cookie)))
++ (rc = packageSources(spec, &cookie, buildTime, host)))
+ return rc;
+
+ if (((what & RPMBUILD_PACKAGEBINARY) && !test) &&
+- (rc = packageBinaries(spec, cookie, (didBuild == 0))))
++ (rc = packageBinaries(spec, cookie, (didBuild == 0), buildTime, host)))
+ goto exit;
+
+ if ((what & RPMBUILD_CLEAN) &&
+@@ -293,6 +342,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what)
+ (void) unlink(spec->specFile);
+
+ exit:
++ free(host);
+ free(cookie);
+ spec->rootDir = NULL;
+ if (rc != RPMRC_OK && rpmlogGetNrecs() > 0) {
+diff --git a/build/pack.c b/build/pack.c
+index df15876ff..17a4b0905 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -6,8 +6,6 @@
+ #include "system.h"
+
+ #include <errno.h>
+-#include <netdb.h>
+-#include <time.h>
+ #include <sys/wait.h>
+
+ #include <rpm/rpmlib.h> /* RPMSIGTAG*, rpmReadPackageFile */
+@@ -152,57 +150,6 @@ exit:
+ return rc;
+ }
+
+-static rpm_time_t * getBuildTime(void)
+-{
+- static rpm_time_t buildTime[1];
+- char *srcdate;
+- time_t epoch;
+- char *endptr;
+-
+- if (buildTime[0] == 0) {
+- srcdate = getenv("SOURCE_DATE_EPOCH");
+- if (srcdate) {
+- errno = 0;
+- epoch = strtol(srcdate, &endptr, 10);
+- if (srcdate == endptr || *endptr || errno != 0)
+- rpmlog(RPMLOG_ERR, _("unable to parse SOURCE_DATE_EPOCH\n"));
+- else
+- buildTime[0] = (int32_t) epoch;
+- } else
+- buildTime[0] = (int32_t) time(NULL);
+- }
+-
+- return buildTime;
+-}
+-
+-static const char * buildHost(void)
+-{
+- static char hostname[1024];
+- static int oneshot = 0;
+- struct hostent *hbn;
+- char *bhMacro;
+-
+- if (! oneshot) {
+- bhMacro = rpmExpand("%{?_buildhost}", NULL);
+- if (strcmp(bhMacro, "") != 0 && strlen(bhMacro) < 1024) {
+- strcpy(hostname, bhMacro);
+- } else {
+- if (strcmp(bhMacro, "") != 0)
+- rpmlog(RPMLOG_WARNING, _("The _buildhost macro is too long\n"));
+- (void) gethostname(hostname, sizeof(hostname));
+- hbn = gethostbyname(hostname);
+- if (hbn)
+- strcpy(hostname, hbn->h_name);
+- else
+- rpmlog(RPMLOG_WARNING,
+- _("Could not canonicalize hostname: %s\n"), hostname);
+- }
+- free(bhMacro);
+- oneshot = 1;
+- }
+- return(hostname);
+-}
+-
+ static rpmRC processScriptFiles(rpmSpec spec, Package pkg)
+ {
+ struct TriggerFileEntry *p;
+@@ -476,7 +423,8 @@ exit:
+ * order to how the RPM format is laid on disk.
+ */
+ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
+- const char *fileName, char **cookie)
++ const char *fileName, char **cookie,
++ rpm_time_t buildTime, const char* buildHost)
+ {
+ FD_t fd = NULL;
+ char * rpmio_flags = NULL;
+@@ -500,7 +448,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
+
+ /* Create and add the cookie */
+ if (cookie) {
+- rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime()));
++ rasprintf(cookie, "%s %d", buildHost, buildTime);
+ headerPutString(pkg->header, RPMTAG_COOKIE, *cookie);
+ }
+
+@@ -641,7 +589,7 @@ static rpmRC checkPackages(char *pkgcheck)
+ return RPMRC_OK;
+ }
+
+-static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename)
++static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename, rpm_time_t buildTime, const char* buildHost)
+ {
+ const char *errorString;
+ rpmRC rc = RPMRC_OK;
+@@ -660,8 +608,8 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
+ headerCopyTags(spec->packages->header, pkg->header, copyTags);
+
+ headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION);
+- headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost());
+- headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
++ headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost);
++ headerPutUint32(pkg->header, RPMTAG_BUILDTIME, &buildTime, 1);
+
+ if (spec->sourcePkgId != NULL) {
+ headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+@@ -699,7 +647,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
+ free(binRpm);
+ }
+
+- rc = writeRPM(pkg, NULL, *filename, NULL);
++ rc = writeRPM(pkg, NULL, *filename, NULL, buildTime, buildHost);
+ if (rc == RPMRC_OK) {
+ /* Do check each written package if enabled */
+ char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL);
+@@ -719,7 +667,7 @@ struct binaryPackageTaskData
+ struct binaryPackageTaskData *next;
+ };
+
+-static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating)
++static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost)
+ {
+ struct binaryPackageTaskData *tasks = NULL;
+ struct binaryPackageTaskData *task = NULL;
+@@ -731,7 +679,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c
+ if (pkg == spec->packages) {
+ // the first package needs to be processed ahead of others, as they copy
+ // changelog data from it, and so otherwise data races would happen
+- task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename));
++ task->result = packageBinary(spec, pkg, cookie, cheating, &(task->filename), buildTime, buildHost);
+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
+ tasks = task;
+ }
+@@ -748,7 +696,7 @@ static struct binaryPackageTaskData* runBinaryPackageTasks(rpmSpec spec, const c
+ if (task != tasks)
+ #pragma omp task
+ {
+- task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename));
++ task->result = packageBinary(spec, task->pkg, cookie, cheating, &(task->filename), buildTime, buildHost);
+ rpmlog(RPMLOG_NOTICE, _("Finished binary package job, result %d, filename %s\n"), task->result, task->filename);
+ }
+ }
+@@ -766,11 +714,11 @@ static void freeBinaryPackageTasks(struct binaryPackageTaskData* tasks)
+ }
+ }
+
+-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
++rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost)
+ {
+ char *pkglist = NULL;
+
+- struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating);
++ struct binaryPackageTaskData *tasks = runBinaryPackageTasks(spec, cookie, cheating, buildTime, buildHost);
+
+ for (struct binaryPackageTaskData *task = tasks; task != NULL; task = task->next) {
+ if (task->result == RPMRC_OK) {
+@@ -797,7 +745,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
+ return RPMRC_OK;
+ }
+
+-rpmRC packageSources(rpmSpec spec, char **cookie)
++rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost)
+ {
+ Package sourcePkg = spec->sourcePackage;
+ rpmRC rc;
+@@ -805,8 +753,8 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
+
+ /* Add some cruft */
+ headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION);
+- headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost());
+- headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1);
++ headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, buildHost);
++ headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &buildTime, 1);
+ headerPutUint32(sourcePkg->header, RPMTAG_SOURCEPACKAGE, &one, 1);
+
+ /* XXX this should be %_srpmdir */
+@@ -814,7 +762,7 @@ rpmRC packageSources(rpmSpec spec, char **cookie)
+ char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL);
+
+ spec->sourcePkgId = NULL;
+- rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie);
++ rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie, buildTime, buildHost);
+
+ /* Do check SRPM package if enabled */
+ if (rc == RPMRC_OK && pkgcheck[0] != ' ') {
+diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
+index 439b7d3b5..07e8338ad 100644
+--- a/build/rpmbuild_internal.h
++++ b/build/rpmbuild_internal.h
+@@ -427,19 +427,23 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags);
+ * @param spec spec file control structure
+ * @param cookie build identifier "cookie" or NULL
+ * @param cheating was build shortcircuited?
++ * @param buildTime the build timestamp that goes into packages
++ * @param buildHost the hostname where the build is happening
+ * @return RPMRC_OK on success
+ */
+ RPM_GNUC_INTERNAL
+-rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating);
++rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating, rpm_time_t buildTime, char* buildHost);
+
+ /** \ingroup rpmbuild
+ * Generate source package.
+ * @param spec spec file control structure
+ * @retval cookie build identifier "cookie" or NULL
++ * @param buildTime the build timestamp that goes into packages
++ * @param buildHost the hostname where the build is happening
+ * @return RPMRC_OK on success
+ */
+ RPM_GNUC_INTERNAL
+-rpmRC packageSources(rpmSpec spec, char **cookie);
++rpmRC packageSources(rpmSpec spec, char **cookie, rpm_time_t buildTime, char* buildHost);
+
+ RPM_GNUC_INTERNAL
+ int addLangTag(rpmSpec spec, Header h, rpmTagVal tag,
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch b/poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
new file mode 100644
index 000000000..4ac5c38f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/files/0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch
@@ -0,0 +1,33 @@
+From 5141d50d7b3d3c209a22c53deedb4ceef014401d Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Mon, 15 May 2017 10:21:08 +0200
+Subject: [PATCH 09/15] Do not require that ELF binaries are executable to be
+ identifiable
+
+There is nothing that requires, e.g., a DSO to be executable, but it
+is still an ELF binary and should be identified as such.
+
+Upstream probably expects all ELF binaries to be marked as executable,
+but rather than imposing such a limitation for OE, allow any file to
+be identified as an ELF binary regardless of whether it is executable
+or not.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+
+---
+ fileattrs/elf.attr | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
+index 5805dd0ee..3516f309d 100644
+--- a/fileattrs/elf.attr
++++ b/fileattrs/elf.attr
+@@ -1,4 +1,3 @@
+ %__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+ %__elf_magic ^(setuid,? )?(setgid,? )?(sticky )?ELF (32|64)-bit.*$
+-%__elf_flags exeonly
+--
+2.14.2
+
diff --git a/poky/meta/recipes-devtools/rpm/rpm_4.14.1.bb b/poky/meta/recipes-devtools/rpm/rpm_4.14.1.bb
new file mode 100644
index 000000000..6012922ad
--- /dev/null
+++ b/poky/meta/recipes-devtools/rpm/rpm_4.14.1.bb
@@ -0,0 +1,138 @@
+SUMMARY = "The RPM package management system"
+DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
+package management system capable of installing, uninstalling, \
+verifying, querying, and updating software packages. Each software \
+package consists of an archive of files along with information about \
+the package like its version, a description, etc."
+
+SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
+DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
+development files will simplify the process of writing programs that \
+manipulate RPM packages and databases. These files are intended to \
+simplify the process of creating graphical package managers or any \
+other tools that need an intimate knowledge of RPM packages in order \
+to function."
+
+SUMMARY_python3-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python3-rpm = "The python3-rpm package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://www.rpm.org"
+
+# libraries are also LGPL - how to express this?
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c0bf017c0fd1920e6158a333acabfd4a"
+
+SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \
+ file://0001-Do-not-add-an-unsatisfiable-dependency-when-building.patch \
+ file://0001-Do-not-read-config-files-from-HOME.patch \
+ file://0001-When-cross-installing-execute-package-scriptlets-wit.patch \
+ file://0001-Do-not-reset-the-PATH-environment-variable-before-ru.patch \
+ file://0002-Add-support-for-prefixing-etc-from-RPM_ETCCONFIGDIR-.patch \
+ file://0001-Do-not-hardcode-lib-rpm-as-the-installation-path-for.patch \
+ file://0001-Fix-build-with-musl-C-library.patch \
+ file://0001-Add-a-color-setting-for-mips64_n32-binaries.patch \
+ file://0011-Do-not-require-that-ELF-binaries-are-executable-to-b.patch \
+ file://0001-Split-binary-package-building-into-a-separate-functi.patch \
+ file://0002-Run-binary-package-creation-via-thread-pools.patch \
+ file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \
+ file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \
+ file://0001-perl-disable-auto-reqs.patch \
+ file://0001-configure.ac-add-option-for-dbus.patch \
+ file://0001-Factor-out-and-unify-setting-CLOEXEC.patch \
+ file://0002-Optimize-rpmSetCloseOnExec.patch \
+ file://0003-rpmSetCloseOnExec-use-getrlimit.patch \
+ "
+
+PE = "1"
+SRCREV = "bfee1410af51c1cc9724791fb8d985260a62102b"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "nss libarchive db file popt xz bzip2 dbus elfutils python3"
+DEPENDS_append_class-native = " file-replacement-native bzip2-replacement-native"
+
+inherit autotools gettext pkgconfig python3native
+export PYTHON_ABI
+
+# OE-core patches autoreconf to additionally run gnu-configize, which fails with this recipe
+EXTRA_AUTORECONF_append = " --exclude=gnu-configize"
+
+EXTRA_OECONF_append = " --without-lua --enable-python"
+EXTRA_OECONF_append_libc-musl = " --disable-nls"
+
+# --sysconfdir prevents rpm from attempting to access machine-specific configuration in sysroot/etc; we need to have it in rootfs
+#
+# --localstatedir prevents rpm from writing its database to native sysroot when building images
+#
+# Disable dbus for native, so that rpm doesn't attempt to inhibit shutdown via session dbus even when plugins support is enabled.
+# Also disable plugins by default for native.
+EXTRA_OECONF_append_class-native = " --sysconfdir=/etc --localstatedir=/var --without-dbus --disable-plugins"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[imaevm] = "--with-imaevm,,ima-evm-utils"
+
+# Direct rpm-native to read configuration from our sysroot, not the one it was compiled in
+# libmagic also has sysroot path contamination, so override it
+do_install_append_class-native() {
+ tools="\
+ ${bindir}/rpm \
+ ${bindir}/rpm2archive \
+ ${bindir}/rpm2cpio \
+ ${bindir}/rpmbuild \
+ ${bindir}/rpmdb \
+ ${bindir}/rpmgraph \
+ ${bindir}/rpmkeys \
+ ${bindir}/rpmsign \
+ ${bindir}/rpmspec \
+ ${libdir}/rpm/rpmdeps \
+ "
+
+ for tool in $tools; do
+ create_wrapper ${D}$tool \
+ RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
+ RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
+ MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
+ RPM_NO_CHROOT_FOR_SCRIPTS=1
+ done
+}
+
+# Rpm's make install creates var/tmp which clashes with base-files packaging
+do_install_append_class-target() {
+ rm -rf ${D}/var
+}
+
+do_install_append () {
+ sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
+ ${D}/${libdir}/rpm/macros
+
+ sed -i -e 's|/usr/bin/python|${USRBINPATH}/env ${PYTHON_PN}|' \
+ ${D}${libdir}/rpm/pythondistdeps.py \
+ ${D}${libdir}/rpm/python-macro-helper
+}
+
+FILES_${PN} += "${libdir}/rpm-plugins/*.so \
+ "
+
+FILES_${PN}-dev += "${libdir}/rpm-plugins/*.la \
+ "
+
+PACKAGES += "python3-rpm"
+PROVIDES += "python3-rpm"
+FILES_python3-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm/*"
+
+# rpm 5.x was packaging the rpm build tools separately
+RPROVIDES_${PN} += "rpm-build"
+
+RDEPENDS_${PN} = "bash perl python3-core"
+
+PACKAGE_PREPROCESS_FUNCS += "rpm_package_preprocess"
+
+# Do not specify a sysroot when compiling on a target.
+rpm_package_preprocess () {
+ sed -i -e 's:--sysroot[^ ]*::g' \
+ ${PKGD}/${libdir}/rpm/macros
+}
diff --git a/poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch b/poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch
new file mode 100644
index 000000000..3d27fe72c
--- /dev/null
+++ b/poky/meta/recipes-devtools/rsync/files/makefile-no-rebuild.patch
@@ -0,0 +1,69 @@
+Remove the Makefile rules to reinvoke autoconf, they're not out-of-tree safe and
+generally overcomplicated, and we ensure that autoreconf is invoked if required.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index 151247d..8f3fdb6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -141,58 +141,6 @@ gen: conf proto.h man
+ gensend: gen
+ rsync -aivzc $(GENFILES) $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/
+
+-conf:
+- cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
+-
+-aclocal.m4: $(srcdir)/m4/*.m4
+- aclocal -I $(srcdir)/m4
+-
+-configure.sh config.h.in: configure.ac aclocal.m4
+- @if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
+- @if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
+- autoconf -o configure.sh
+- autoheader && touch config.h.in
+- @if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
+- echo "configure.sh is unchanged."; \
+- rm configure.sh.old; \
+- else \
+- echo "configure.sh has CHANGED."; \
+- fi
+- @if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
+- echo "config.h.in is unchanged."; \
+- rm config.h.in.old; \
+- else \
+- echo "config.h.in has CHANGED."; \
+- fi
+- @if test -f configure.sh.old -o -f config.h.in.old; then \
+- if test "$(MAKECMDGOALS)" = reconfigure; then \
+- echo 'Continuing with "make reconfigure".'; \
+- else \
+- echo 'You may need to run:'; \
+- echo ' make reconfigure'; \
+- exit 1; \
+- fi \
+- fi
+-
+-reconfigure: configure.sh
+- ./config.status --recheck
+- ./config.status
+-
+-Makefile: Makefile.in config.status configure.sh config.h.in
+- @if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
+- @./config.status
+- @if diff Makefile Makefile.old >/dev/null 2>&1; then \
+- echo "Makefile is unchanged."; \
+- rm Makefile.old; \
+- else \
+- if test "$(MAKECMDGOALS)" = reconfigure; then \
+- echo 'Continuing with "make reconfigure".'; \
+- else \
+- echo "Makefile updated -- rerun your make command."; \
+- exit 1; \
+- fi \
+- fi
+-
+ rsync-ssl: $(srcdir)/rsync-ssl.in Makefile
+ sed 's;\@bindir\@;$(bindir);g' <$(srcdir)/rsync-ssl.in >rsync-ssl
+ @chmod +x rsync-ssl
diff --git a/poky/meta/recipes-devtools/rsync/files/rsyncd.conf b/poky/meta/recipes-devtools/rsync/files/rsyncd.conf
new file mode 100644
index 000000000..845f5b33f
--- /dev/null
+++ b/poky/meta/recipes-devtools/rsync/files/rsyncd.conf
@@ -0,0 +1,15 @@
+# /etc/rsyncd.conf
+
+# Minimal configuration file for rsync daemon
+# See rsync(1) and rsyncd.conf(5) man pages for help
+
+# This file is required by rsync --daemon
+pid file = /var/run/rsyncd.pid
+use chroot = yes
+read only = yes
+
+# Simple example for enabling your own local rsync server
+#[everything]
+# path = /
+# comment = Everything except /etc exposed
+# exclude = /etc
diff --git a/poky/meta/recipes-devtools/rsync/rsync.inc b/poky/meta/recipes-devtools/rsync/rsync.inc
new file mode 100644
index 000000000..26c023af7
--- /dev/null
+++ b/poky/meta/recipes-devtools/rsync/rsync.inc
@@ -0,0 +1,20 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+DEPENDS = "popt"
+
+SRC_URI = "https://download.samba.org/pub/${BPN}/src/${BP}.tar.gz \
+ file://rsyncd.conf"
+
+inherit autotools
+
+do_install_append() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-devtools/rsync/rsync_3.1.3.bb b/poky/meta/recipes-devtools/rsync/rsync_3.1.3.bb
new file mode 100644
index 000000000..84a02586b
--- /dev/null
+++ b/poky/meta/recipes-devtools/rsync/rsync_3.1.3.bb
@@ -0,0 +1,32 @@
+require rsync.inc
+
+SRC_URI += "file://makefile-no-rebuild.patch"
+
+SRC_URI[md5sum] = "1581a588fde9d89f6bc6201e8129afaf"
+SRC_URI[sha256sum] = "55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0"
+
+# GPLv2+ (<< 3.0.0), GPLv3+ (>= 3.0.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PACKAGECONFIG ??= "acl attr \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[acl] = "--enable-acl-support,--disable-acl-support,acl,"
+PACKAGECONFIG[attr] = "--enable-xattr-support,--disable-xattr-support,attr,"
+
+# By default, if crosscompiling, rsync disables a number of
+# capabilities, hardlinking symlinks and special files (i.e. devices)
+CACHED_CONFIGUREVARS += "rsync_cv_can_hardlink_special=yes rsync_cv_can_hardlink_symlink=yes"
+
+# rsync 3.0 uses configure.sh instead of configure, and
+# makefile checks the existence of configure.sh
+do_configure_prepend () {
+ rm -f ${S}/configure ${S}/configure.sh
+}
+
+do_configure_append () {
+ cp -f ${S}/configure ${S}/configure.sh
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/ruby/ruby.inc b/poky/meta/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 000000000..fd3911ba7
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,40 @@
+SUMMARY = "An interpreter of object-oriented scripting language"
+DESCRIPTION = "Ruby is an interpreted scripting language for quick \
+and easy object-oriented programming. It has many features to process \
+text files and to do system management tasks (as in Perl). \
+It is simple, straight-forward, and extensible. \
+"
+HOMEPAGE = "http://www.ruby-lang.org/"
+SECTION = "devel/ruby"
+LICENSE = "Ruby | BSD | GPLv2"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=340948e1882e579731841bf49cdc22c1 \
+ file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
+ file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://LEGAL;md5=8f871f3f03732c018a5fa9b185958231 \
+"
+
+DEPENDS = "ruby-native zlib openssl tcl libyaml gdbm readline"
+DEPENDS_class-native = "openssl-native libyaml-native"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
+ file://extmk.patch \
+ file://0002-Obey-LDFLAGS-for-the-link-of-libruby.patch \
+ "
+UPSTREAM_CHECK_URI = "https://www.ruby-lang.org/en/downloads/"
+
+inherit autotools
+
+
+# This snippet lets compiled extensions which rely on external libraries,
+# such as zlib, compile properly. If we don't do this, then when extmk.rb
+# runs, it uses the native libraries instead of the target libraries, and so
+# none of the linking operations succeed -- which makes extconf.rb think
+# that the libraries aren't available and hence that the extension can't be
+# built.
+
+do_configure_prepend() {
+ sed -i "s#%%TARGET_CFLAGS%%#$TARGET_CFLAGS#; s#%%TARGET_LDFLAGS%%#$TARGET_LDFLAGS#" ${S}/common.mk
+ rm -rf ${S}/ruby/
+}
diff --git a/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch b/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch
new file mode 100644
index 000000000..4cf579f42
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/0002-Obey-LDFLAGS-for-the-link-of-libruby.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+From 306e95a9818d39d3349075aac9609e062b0f19ce Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Thu, 5 May 2016 10:59:07 -0700
+Subject: [PATCH 2/2] Obey LDFLAGS for the link of libruby
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ruby-2.5.0/Makefile.in
+===================================================================
+--- ruby-2.5.0.orig/Makefile.in
++++ ruby-2.5.0/Makefile.in
+@@ -77,7 +77,7 @@ LIBS = @LIBS@ $(EXTLIBS)
+ MISSING = @LIBOBJS@ @ALLOCA@
+ ENABLE_SHARED = @ENABLE_SHARED@
+ LDSHARED = @LIBRUBY_LDSHARED@
+-DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
++DLDFLAGS = @LIBRUBY_DLDFLAGS@ @LDFLAGS@ $(XLDFLAGS) $(ARCH_FLAG)
+ SOLIBS = @SOLIBS@
+ ENABLE_DEBUG_ENV = @ENABLE_DEBUG_ENV@
+ MAINLIBS = @MAINLIBS@
diff --git a/poky/meta/recipes-devtools/ruby/ruby/extmk.patch b/poky/meta/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 000000000..404b9af7a
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+diff -ru ruby-1.8.7-p248.orig/ext/extmk.rb ruby-1.8.7-p248/ext/extmk.rb
+--- ruby-1.8.7-p248.orig/ext/extmk.rb 2009-12-24 03:01:58.000000000 -0600
++++ ruby-1.8.7-p248/ext/extmk.rb 2010-02-12 15:55:27.370061558 -0600
+@@ -413,8 +413,8 @@ def $mflags.defined?(var)
+ end
+ $ruby = [$ruby]
+ $ruby << "-I'$(topdir)'"
++$ruby << "-I'$(top_srcdir)/lib'"
+ unless CROSS_COMPILING
+- $ruby << "-I'$(top_srcdir)/lib'"
+ $ruby << "-I'$(extout)/$(arch)'" << "-I'$(extout)/common'" if $extout
+ ENV["RUBYLIB"] = "-"
+ end
+--
+
diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
new file mode 100644
index 000000000..89437bba7
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9226.patch
@@ -0,0 +1,32 @@
+From b4bf968ad52afe14e60a2dc8a95d3555c543353a Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Thu, 18 May 2017 17:05:27 +0900
+Subject: [PATCH] fix #55 : check too big code point value for single byte
+ value in next_state_val()
+
+---
+ regparse.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9226
+
+Add check for octal number bigger than 255.
+
+Upstream-Status: Pending
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- ruby-2.4.1.orig/regparse.c
++++ ruby-2.4.1/regparse.c
+@@ -4450,6 +4450,9 @@ next_state_val(CClassNode* cc, CClassNod
+ switch (*state) {
+ case CCS_VALUE:
+ if (*type == CCV_SB) {
++ if (*from > 0xff)
++ return ONIGERR_INVALID_CODE_POINT_VALUE;
++
+ BITSET_SET_BIT_CHKDUP(cc->bs, (int )(*from));
+ if (IS_NOT_NULL(asc_cc))
+ BITSET_SET_BIT(asc_cc->bs, (int )(*from));
diff --git a/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
new file mode 100644
index 000000000..d8bfba486
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby/ruby-CVE-2017-9228.patch
@@ -0,0 +1,34 @@
+From 3b63d12038c8d8fc278e81c942fa9bec7c704c8b Mon Sep 17 00:00:00 2001
+From: "K.Kosako" <kosako@sofnec.co.jp>
+Date: Wed, 24 May 2017 13:43:25 +0900
+Subject: [PATCH] fix #60 : invalid state(CCS_VALUE) in parse_char_class()
+
+---
+ regparse.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9228
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/regparse.c b/regparse.c
+index 69875fa..1988747 100644
+--- a/regparse.c
++++ b/regparse.c
+@@ -4081,7 +4081,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
+ }
+ }
+
+- *state = CCS_VALUE;
++ if (*state != CCS_START)
++ *state = CCS_VALUE;
++
+ *type = CCV_CLASS;
+ return 0;
+ }
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb b/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb
new file mode 100644
index 000000000..1ac7f2aa5
--- /dev/null
+++ b/poky/meta/recipes-devtools/ruby/ruby_2.5.0.bb
@@ -0,0 +1,49 @@
+require ruby.inc
+
+SRC_URI += " \
+ file://ruby-CVE-2017-9226.patch \
+ file://ruby-CVE-2017-9228.patch \
+ "
+
+SRC_URI[md5sum] = "f4711f856fe14de222b9da3d3b8efa89"
+SRC_URI[sha256sum] = "46e6f3630f1888eb653b15fa811d77b5b1df6fd7a3af436b343cfe4f4503f2ab"
+
+# it's unknown to configure script, but then passed to extconf.rb
+# maybe it's not really needed as we're hardcoding the result with
+# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
+PACKAGECONFIG[gmp] = "--with-gmp=yes, --with-gmp=no, gmp"
+PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+EXTRA_OECONF = "\
+ --disable-versioned-paths \
+ --disable-rpath \
+ --disable-dtrace \
+ --enable-shared \
+ --enable-load-relative \
+"
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+}
+
+PACKAGES =+ "${PN}-ri-docs ${PN}-rdoc"
+
+SUMMARY_${PN}-ri-docs = "ri (Ruby Interactive) documentation for the Ruby standard library"
+RDEPENDS_${PN}-ri-docs = "${PN}"
+FILES_${PN}-ri-docs += "${datadir}/ri"
+
+SUMMARY_${PN}-rdoc = "RDoc documentation generator from Ruby source"
+RDEPENDS_${PN}-rdoc = "${PN}"
+FILES_${PN}-rdoc += "${libdir}/ruby/*/rdoc ${bindir}/rdoc"
+
+FILES_${PN} += "${datadir}/rubygems"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
new file mode 100755
index 000000000..307feb718
--- /dev/null
+++ b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -0,0 +1,97 @@
+#!/bin/sh
+#
+# Copyright 2007 Openedhand Ltd.
+#
+# Author: Richard Purdie <rpurdie@openedhand.com>
+#
+
+# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
+# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-postinsts.
+
+# the order of this list is important, do not change!
+backend_list="rpm deb ipk"
+
+pm_installed=false
+
+for pm in $backend_list; do
+ pi_dir="#SYSCONFDIR#/$pm-postinsts"
+
+ if [ ! -d $pi_dir ]; then
+ continue
+ fi
+
+ # found the package manager, it has postinsts
+ case $pm in
+ "deb")
+ if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
+ pm_installed=true
+ fi
+ ;;
+
+ "ipk")
+ if [ -s "#LOCALSTATEDIR#/lib/opkg/status" ]; then
+ pm_installed=true
+ fi
+ ;;
+ esac
+ break
+done
+
+remove_rcsd_link () {
+ if [ -n "`which update-rc.d`" ]; then
+ update-rc.d -f run-postinsts remove
+ fi
+}
+
+if ! [ -d $pi_dir ]; then
+ remove_rcsd_link
+ exit 0
+fi
+
+echo "Configuring packages on first boot...."
+echo " (This may take several minutes. Please do not power off the machine.)"
+
+[ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
+
+if [ "$POSTINST_LOGGING" = "1" ]; then
+ rm -f $LOGFILE
+ append_log=">>$LOGFILE 2>&1"
+fi
+
+exec_postinst_scriptlets() {
+ for i in `ls $pi_dir`; do
+ i=$pi_dir/$i
+ echo "Running postinst $i..."
+ [ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
+ if [ -x $i ]; then
+ eval sh -c $i $append_log
+ rm $i
+ else
+ echo "ERROR: postinst $i failed."
+ [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
+ remove_pi_dir=0
+ fi
+ done
+}
+
+remove_pi_dir=1
+if $pm_installed; then
+ case $pm in
+ "ipk")
+ eval opkg configure $append_log
+ ;;
+
+ "deb")
+ eval dpkg --configure -a $append_log
+ ;;
+ esac
+else
+ exec_postinst_scriptlets
+fi
+
+# since all postinstalls executed successfully, remove the postinstalls directory
+# and the rcS.d link
+if [ $remove_pi_dir = 1 ]; then
+ rm -rf $pi_dir
+ remove_rcsd_link
+fi
diff --git a/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
new file mode 100644
index 000000000..473a1f7f6
--- /dev/null
+++ b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run-postinsts
diff --git a/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
new file mode 100644
index 000000000..1b71a1f8b
--- /dev/null
+++ b/poky/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Run pending postinsts
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+ConditionPathExistsGlob=#SYSCONFDIR#/*-postinsts
+
+[Service]
+Type=oneshot
+ExecStart=#SBINDIR#/run-postinsts
+ExecStartPost=#BASE_BINDIR#/systemctl --no-reload disable run-postinsts.service
+RemainAfterExit=No
+TimeoutSec=0
+
+[Install]
+WantedBy=sysinit.target
diff --git a/poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb b/poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
new file mode 100644
index 000000000..85b3fc867
--- /dev/null
+++ b/poky/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Runs postinstall scripts on first boot of the target device"
+SECTION = "devel"
+PR = "r10"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://run-postinsts \
+ file://run-postinsts.init \
+ file://run-postinsts.service"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd update-rc.d
+
+INITSCRIPT_NAME = "run-postinsts"
+INITSCRIPT_PARAMS = "start 99 S ."
+
+SYSTEMD_SERVICE_${PN} = "run-postinsts.service"
+
+do_configure() {
+ :
+}
+
+do_compile () {
+ :
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/run-postinsts ${D}${sbindir}/
+
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/run-postinsts.init ${D}${sysconfdir}/init.d/run-postinsts
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system/
+
+ sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
+ -e 's:#SBINDIR#:${sbindir}:g' \
+ -e 's:#BASE_BINDIR#:${base_bindir}:g' \
+ -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
+ ${D}${sbindir}/run-postinsts \
+ ${D}${systemd_unitdir}/system/run-postinsts.service
+}
diff --git a/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
new file mode 100644
index 000000000..a5bab0544
--- /dev/null
+++ b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/0001-mksquashfs.c-get-inline-functions-work-with-C99.patch
@@ -0,0 +1,154 @@
+From ac6268e843c43286eebff2a1052182c2393cdb2e Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Mon, 14 Sep 2015 12:31:42 +0800
+Subject: [PATCH] mksquashfs.c: get inline functions work with both gnu11 and gnu89
+
+Upstream-Status: Pending
+
+After gcc upgraded to gcc5, and if the codes is compiled without optimization(-O0),
+and the below error will happen:
+
+| mksquashfs.o: In function `create_inode':
+| git/squashfs-tools/mksquashfs.c:897: undefined reference to `get_inode_no'
+| git/squashfs-tools/mksquashfs.c:960: undefined reference to `get_parent_no'
+| git/squashfs-tools/mksquashfs.c:983: undefined reference to `get_parent_no'
+| mksquashfs.o: In function `reader_read_process':
+| git/squashfs-tools/mksquashfs.c:2132: undefined reference to `is_fragment'
+| mksquashfs.o: In function `reader_read_file':
+| git/squashfs-tools/mksquashfs.c:2228: undefined reference to `is_fragment'
+| mksquashfs.o: In function `dir_scan':
+| git/squashfs-tools/mksquashfs.c:3101: undefined reference to `create_dir_entry'
+
+gcc5 defaults to -std=gnu11 instead of -std=gnu89, and it requires that exactly one C
+source file has the callable copy of the inline function. Consider the following
+program:
+
+ inline int
+ foo (void)
+ {
+ return 42;
+ }
+
+ int
+ main (void)
+ {
+ return foo ();
+ }
+
+The program above will not link with the C99 inline semantics, because no out-of-line
+function foo is generated. To fix this, either mark the function foo as static, or
+add the following declaration:
+ static inline int foo (void);
+
+more information refer to: https://gcc.gnu.org/gcc-5/porting_to.html;
+
+but the use of "extern inline" will lead to the compilation issue if gcc is not
+gcc5, as the commit in oe-core d0af30c92fde [alsa-lib: Change function type to
+"static __inline__"]
+ "extern __inline__ function()" is the inlined version that
+ can be used in this compilation unit, but there will be another
+ definition of this function somewhere, so compiler will not emit
+ any code for the function body. This causes problem in -O0,
+ where functions are never inlined, the function call is preserved,
+ but linker can't find the symbol, thus the error happens.
+
+so replace "inline" with "static inline" to make it work with both gnu11 and gnu89
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ squashfs-tools/mksquashfs.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index d221c35..6bba1d2 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -828,13 +828,13 @@ char *subpathname(struct dir_ent *dir_ent)
+ }
+
+
+-inline unsigned int get_inode_no(struct inode_info *inode)
++static inline unsigned int get_inode_no(struct inode_info *inode)
+ {
+ return inode->inode_number;
+ }
+
+
+-inline unsigned int get_parent_no(struct dir_info *dir)
++static inline unsigned int get_parent_no(struct dir_info *dir)
+ {
+ return dir->depth ? get_inode_no(dir->dir_ent->inode) : inode_no;
+ }
+@@ -2027,7 +2027,7 @@ struct file_info *duplicate(long long file_size, long long bytes,
+ }
+
+
+-inline int is_fragment(struct inode_info *inode)
++static inline int is_fragment(struct inode_info *inode)
+ {
+ off_t file_size = inode->buf.st_size;
+
+@@ -2996,13 +2996,13 @@ struct inode_info *lookup_inode2(struct stat *buf, int pseudo, int id)
+ }
+
+
+-inline struct inode_info *lookup_inode(struct stat *buf)
++static inline struct inode_info *lookup_inode(struct stat *buf)
+ {
+ return lookup_inode2(buf, 0, 0);
+ }
+
+
+-inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
++static inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
+ {
+ if (inode->inode_number == 0) {
+ inode->inode_number = use_this ? : inode_no ++;
+@@ -3013,7 +3013,7 @@ inline void alloc_inode_no(struct inode_info *inode, unsigned int use_this)
+ }
+
+
+-inline struct dir_ent *create_dir_entry(char *name, char *source_name,
++static inline struct dir_ent *create_dir_entry(char *name, char *source_name,
+ char *nonstandard_pathname, struct dir_info *dir)
+ {
+ struct dir_ent *dir_ent = malloc(sizeof(struct dir_ent));
+@@ -3031,7 +3031,7 @@ inline struct dir_ent *create_dir_entry(char *name, char *source_name,
+ }
+
+
+-inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
++static inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
+ struct inode_info *inode_info)
+ {
+ struct dir_info *dir = dir_ent->our_dir;
+@@ -3047,7 +3047,7 @@ inline void add_dir_entry(struct dir_ent *dir_ent, struct dir_info *sub_dir,
+ }
+
+
+-inline void add_dir_entry2(char *name, char *source_name,
++static inline void add_dir_entry2(char *name, char *source_name,
+ char *nonstandard_pathname, struct dir_info *sub_dir,
+ struct inode_info *inode_info, struct dir_info *dir)
+ {
+@@ -3059,7 +3059,7 @@ inline void add_dir_entry2(char *name, char *source_name,
+ }
+
+
+-inline void free_dir_entry(struct dir_ent *dir_ent)
++static inline void free_dir_entry(struct dir_ent *dir_ent)
+ {
+ if(dir_ent->name)
+ free(dir_ent->name);
+@@ -3080,7 +3080,7 @@ inline void free_dir_entry(struct dir_ent *dir_ent)
+ }
+
+
+-inline void add_excluded(struct dir_info *dir)
++static inline void add_excluded(struct dir_info *dir)
+ {
+ dir->excluded ++;
+ }
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
new file mode 100644
index 000000000..0ce7b4e8c
--- /dev/null
+++ b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/fix-compat.patch
@@ -0,0 +1,63 @@
+Define FNM_EXTMATCH if not defined its glibc specific define
+include missing sys/stat.h for stat* function declarations
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: squashfs-tools/action.c
+===================================================================
+--- squashfs-tools.orig/action.c
++++ squashfs-tools/action.c
+@@ -44,6 +44,10 @@
+ #include "action.h"
+ #include "error.h"
+
++#if !defined(FNM_EXTMATCH)
++#define FNM_EXTMATCH 0
++#endif
++
+ /*
+ * code to parse actions
+ */
+Index: squashfs-tools/mksquashfs.c
+===================================================================
+--- squashfs-tools.orig/mksquashfs.c
++++ squashfs-tools/mksquashfs.c
+@@ -1261,6 +1261,10 @@ void write_dir(squashfs_inode *inode, st
+ dir_size + 3, directory_block, directory_offset, NULL, NULL,
+ dir, 0);
+
++#if !defined(FNM_EXTMATCH)
++#define FNM_EXTMATCH 0
++#endif
++
+ #ifdef SQUASHFS_TRACE
+ {
+ unsigned char *dirp;
+Index: squashfs-tools/pseudo.c
+===================================================================
+--- squashfs-tools.orig/pseudo.c
++++ squashfs-tools/pseudo.c
+@@ -32,6 +32,7 @@
+ #include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+ #include <ctype.h>
+
+ #include "pseudo.h"
+Index: squashfs-tools/unsquashfs.c
+===================================================================
+--- squashfs-tools.orig/unsquashfs.c
++++ squashfs-tools/unsquashfs.c
+@@ -42,6 +42,10 @@
+ #include <sys/sysmacros.h>
+ #endif
+
++#ifndef FNM_EXTMATCH
++#define FNM_EXTMATCH 0
++#endif
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;
diff --git a/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch
new file mode 100644
index 000000000..39521a7d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools/squashfs-tools-4.3-sysmacros.patch
@@ -0,0 +1,32 @@
+From https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-fs/squashfs-tools/files/squashfs-tools-4.3-sysmacros.patch
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Pending
+
+
+sys/types.h might not always include sys/sysmacros.h for major/minor/makedev
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -59,6 +59,7 @@
+ #else
+ #include <endian.h>
+ #include <sys/sysinfo.h>
++#include <sys/sysmacros.h>
+ #endif
+
+ #include "squashfs_fs.h"
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <ctype.h>
+
++#ifdef linux
++#include <sys/sysmacros.h>
++#endif
++
+ struct cache *fragment_cache, *data_cache;
+ struct queue *to_reader, *to_inflate, *to_writer, *from_writer;
+ pthread_t *thread, *inflator_thread;
diff --git a/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
new file mode 100644
index 000000000..a8baca51e
--- /dev/null
+++ b/poky/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -0,0 +1,41 @@
+# Note, we can probably remove the lzma option as it has be replaced with xz,
+# and I don't think the kernel supports it any more.
+SUMMARY = "Tools for manipulating SquashFS filesystems"
+SECTION = "base"
+LICENSE = "GPL-2 & PD"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://../../7zC.txt;beginline=12;endline=16;md5=2056cd6d919ebc3807602143c7449a7c \
+"
+DEPENDS = "attr zlib xz lzo lz4"
+
+PV = "4.3+gitr${SRCPV}"
+SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d"
+SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
+ http://downloads.sourceforge.net/sevenzip/lzma465.tar.bz2;name=lzma \
+ file://0001-mksquashfs.c-get-inline-functions-work-with-C99.patch;striplevel=2 \
+ file://squashfs-tools-4.3-sysmacros.patch;striplevel=2 \
+ file://fix-compat.patch \
+"
+UPSTREAM_CHECK_COMMITS = "1"
+SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759"
+SRC_URI[lzma.sha256sum] = "c935fd04dd8e0e8c688a3078f3675d699679a90be81c12686837e0880aa0fa1e"
+
+S = "${WORKDIR}/git/squashfs-tools"
+
+# EXTRA_OEMAKE is typically: -e MAKEFLAGS=
+# the -e causes problems as CFLAGS is modified in the Makefile, so
+# we redefine EXTRA_OEMAKE here
+EXTRA_OEMAKE = "MAKEFLAGS= LZMA_SUPPORT=1 LZMA_DIR=../.. XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1"
+
+do_compile() {
+ oe_runmake mksquashfs unsquashfs
+}
+do_install () {
+ install -d ${D}${sbindir}
+ install -m 0755 mksquashfs ${D}${sbindir}/
+ install -m 0755 unsquashfs ${D}${sbindir}/
+}
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch b/poky/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch
new file mode 100644
index 000000000..7f59210ca
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch
@@ -0,0 +1,36 @@
+From 1f0c22b79045cfcdc976643f383c1d09589d3087 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 16:23:56 +0000
+Subject: [PATCH] Fix build when using non-glibc libc implementation on ppc
+
+glibc includes the kernel header into its own header for macros
+musl does not
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ptrace.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/ptrace.h b/ptrace.h
+index d8af976..4978a69 100644
+--- a/ptrace.h
++++ b/ptrace.h
+@@ -52,7 +52,13 @@ extern long ptrace(int, int, char *, long);
+ # define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
+ #endif
+
+-#include <linux/ptrace.h>
++#if defined(POWERPC) && !defined(__GLIBC__)
++#define pt_regs uapi_pt_regs
++#endif
++# include <linux/ptrace.h>
++#if defined(POWERPC) && !defined(__GLIBC__)
++# undef pt_regs
++#endif
+
+ #ifdef HAVE_STRUCT_IA64_FPREG
+ # undef ia64_fpreg
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch b/poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch
new file mode 100644
index 000000000..4f1370616
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/0001-caps-abbrev.awk-fix-gawk-s-path.patch
@@ -0,0 +1,49 @@
+From 83757523c50748ea845c1e220b1c3b2080d3cc49 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 9 Feb 2017 01:27:49 -0800
+Subject: [PATCH] caps-abbrev.awk: fix gawk's path
+
+It should be /usr/bin/gawk as other scripts use in this package.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ tests-m32/caps-abbrev.awk | 2 +-
+ tests-mx32/caps-abbrev.awk | 2 +-
+ tests/caps-abbrev.awk | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests-m32/caps-abbrev.awk b/tests-m32/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests-m32/caps-abbrev.awk
++++ b/tests-m32/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests-mx32/caps-abbrev.awk b/tests-mx32/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests-mx32/caps-abbrev.awk
++++ b/tests-mx32/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests/caps-abbrev.awk b/tests/caps-abbrev.awk
+index 86de7f2..0535cac 100644
+--- a/tests/caps-abbrev.awk
++++ b/tests/caps-abbrev.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+--
+2.10.2
+
diff --git a/poky/meta/recipes-devtools/strace/strace/0001-tests-sigaction-Check-for-mips-and-alpha-before-usin.patch b/poky/meta/recipes-devtools/strace/strace/0001-tests-sigaction-Check-for-mips-and-alpha-before-usin.patch
new file mode 100644
index 000000000..52096b28c
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/0001-tests-sigaction-Check-for-mips-and-alpha-before-usin.patch
@@ -0,0 +1,37 @@
+From 9f3fd388ae7c46420bccba405468690ed46d669a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 18 Sep 2017 22:51:32 -0700
+Subject: [PATCH] tests/sigaction: Check for mips and alpha before using
+ sa_restorer
+
+local structure does not define restorer member for mips and alpha
+in definition, we need to match that assumption here where they are
+being set
+
+Fixes
+| ../../strace-4.18/tests/sigaction.c:177:36: error: 'struct_set_sa {aka struct set_sa}' has no member named 'restorer'
+| # define SA_RESTORER_ARGS , new_act->restorer
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tests/sigaction.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/sigaction.c b/tests/sigaction.c
+index 7b46944..f46cda7 100644
+--- a/tests/sigaction.c
++++ b/tests/sigaction.c
+@@ -170,7 +170,7 @@ main(void)
+ sigdelset(mask.libc, SIGHUP);
+
+ memcpy(new_act->mask, mask.old, sizeof(mask.old));
+-#ifdef SA_RESTORER
++#if defined(SA_RESTORER) && !defined(MIPS) && !defined(ALPHA)
+ new_act->flags = SA_RESTORER;
+ new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL;
+ # define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx"
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
new file mode 100644
index 000000000..a12f4c3e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -0,0 +1,54 @@
+From 0574ae9926308dcbca78bd8cd0f0f143f19cbcb5 Mon Sep 17 00:00:00 2001
+From: Gabriel Barbu <gabriel.barbu@enea.com>
+Date: Thu, 25 Jul 2013 15:28:33 +0200
+Subject: [PATCH 4/8] strace: Add ptest
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Gabriel Barbu <gabriel.barbu@enea.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+
+---
+ configure.ac | 2 +-
+ tests/Makefile.am | 18 ++++++++++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5f0aec4..8eaacc6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.])
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13])
++AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules serial-tests 1.13])
+ AM_MAINTAINER_MODE
+ AC_CANONICAL_HOST
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index b4ba22a..5836438 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -408,3 +408,21 @@ BUILT_SOURCES = ksysent.h
+ CLEANFILES = ksysent.h
+
+ include ../scno.am
++
++buildtest-TESTS: $(check_PROGRAMS) $(TESTS)
++
++install-ptest:
++ install $(BUILDDIR)/strace $(DESTDIR)
++ install $(srcdir)/../strace-log-merge $(DESTDIR)
++ install -d $(DESTDIR)/$(TESTDIR)
++ cp $(BUILDDIR)/$(TESTDIR)/Makefile $(DESTDIR)/$(TESTDIR)
++ sed -i -e 's/^Makefile:/_Makefile:/' $(DESTDIR)/$(TESTDIR)/Makefile
++ sed -i -e 's/bash/sh/' $(DESTDIR)/$(TESTDIR)/Makefile
++ for file in $(check_PROGRAMS); do \
++ install $(BUILDDIR)/$(TESTDIR)/$$file $(DESTDIR)/$(TESTDIR); \
++ done
++ for file in $(EXTRA_DIST); do \
++ install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \
++ sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \
++ done
++ for i in net scm_rights-fd rt_sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
diff --git a/poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch b/poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
new file mode 100644
index 000000000..76daf3a3b
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/disable-git-version-gen.patch
@@ -0,0 +1,20 @@
+The git-version-gen script is not included in tarball releases,
+so we need to avoid attempts to call it when running autoreconf.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+diff --git a/configure.ac b/configure.ac
+index 7004bd3..b2b03c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,7 +31,7 @@
+
+ AC_PREREQ(2.57)
+ AC_INIT([strace],
+- m4_esyscmd([./git-version-gen .tarball-version]),
++ m4_esyscmd_s([cat .tarball-version]),
+ [strace-devel@lists.sourceforge.net],
+ [strace],
+ [https://strace.io])
diff --git a/poky/meta/recipes-devtools/strace/strace/mips-SIGEMT.patch b/poky/meta/recipes-devtools/strace/strace/mips-SIGEMT.patch
new file mode 100644
index 000000000..b24378bfe
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/mips-SIGEMT.patch
@@ -0,0 +1,24 @@
+SIGEMT is not defined everywhere e.g musl does
+not define it. Therefore check it being defined
+before using it.
+
+Fixes errors e.g.
+../../strace-4.13/tests/signal2name.c:45:7: error: 'SIGEMT' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: strace-4.13/tests/signal2name.c
+===================================================================
+--- strace-4.13.orig/tests/signal2name.c
++++ strace-4.13/tests/signal2name.c
+@@ -42,7 +42,9 @@ signal2name(int sig)
+ CASE(SIGEMT);
+ CASE(SIGLOST);
+ #elif defined MIPS
++#ifdef SIGEMT
+ CASE(SIGEMT);
++#endif
+ CASE(SIGIOT);
+ CASE(SIGPWR);
+ #else
diff --git a/poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch b/poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
new file mode 100644
index 000000000..756cd8bb8
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/more-robust-test-for-m32-mx32-compile-support.patch
@@ -0,0 +1,46 @@
+From 154af50ed7ed8b91838d713052ebf29b0b14f765 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:00:00 -0800
+Subject: [PATCH] mpers.m4: more robust test for -m32/-mx32 compile support
+
+When using the default OE toolchain for x86-64, the basic checks for
+-m32 and -mx32 compile support in mpers.m4 pass but later attempts to
+actually use the toolchain with -m32 fail, e.g.
+
+ | In file included from /home/andre/build/tmp/sysroots/qemux86-64/usr/include/sys/syscall.h:31:0,
+ | from ../strace-4.11/defs.h:55,
+ | from mpers-m32/kernel_dirent.c:32:
+ | /home/andre/build/tmp/sysroots/qemux86-64/usr/include/bits/syscall.h:41:29: fatal error: bits/syscall-32.h: No such file or directory
+
+Make the mpers.m4 tests more robust so that configure correctly
+detects the limitations of the OE toolchain.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ m4/mpers.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/mpers.m4 b/m4/mpers.m4
+index 1fe8a8e..d72c717 100644
+--- a/m4/mpers.m4
++++ b/m4/mpers.m4
+@@ -53,12 +53,14 @@ case "$arch" in
+ CFLAGS="$CFLAGS CFLAG $IFLAG"
+ AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_cc=yes],
+ [st_cv_cc=no])])
+ if test $st_cv_cc = yes; then
+ AC_CACHE_CHECK([for CFLAG runtime support], [st_cv_runtime],
+ [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdint.h>
++ #include <sys/syscall.h>
+ int main(){return 0;}]])],
+ [st_cv_runtime=yes],
+ [st_cv_runtime=no],
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/strace/strace/run-ptest b/poky/meta/recipes-devtools/strace/strace/run-ptest
new file mode 100755
index 000000000..133cf92d0
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch b/poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
new file mode 100644
index 000000000..f6ffa8e7a
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace/update-gawk-paths.patch
@@ -0,0 +1,126 @@
+From 3836518c46bd5bb3e71371b1b18274bf2d487133 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Mon, 18 Jan 2016 11:01:00 -0800
+Subject: [PATCH] update gawk paths, /bin/gawk -> /usr/bin/gawk
+
+The default path to gawk is /usr/bin/gawk, so update test scripts etc
+from #!/bin/gawk to #!/usr/bin/gawk. Fixes missing RDPENDS QA tests:
+
+ WARNING: QA Issue: /usr/lib/strace/ptest/tests/unix-yy-accept.awk_strace-ptest contained in package strace-ptest requires /bin/gawk, but no providers found in its RDEPENDS [file-rdeps]
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ mpers.awk | 2 +-
+ tests-m32/caps.awk | 2 +-
+ tests-m32/match.awk | 2 +-
+ tests-m32/rt_sigaction.awk | 2 +-
+ tests-mx32/caps.awk | 2 +-
+ tests-mx32/match.awk | 2 +-
+ tests-mx32/rt_sigaction.awk | 2 +-
+ tests/caps.awk | 2 +-
+ tests/match.awk | 2 +-
+ tests/rt_sigaction.awk | 2 +-
+ 10 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/mpers.awk b/mpers.awk
+index fe54763..b5238a8 100644
+--- a/mpers.awk
++++ b/mpers.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ # Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
+diff --git a/tests-m32/caps.awk b/tests-m32/caps.awk
+index c6e31ef..5efc6cc 100644
+--- a/tests-m32/caps.awk
++++ b/tests-m32/caps.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests-m32/match.awk b/tests-m32/match.awk
+index abfbae9..f2740bf 100644
+--- a/tests-m32/match.awk
++++ b/tests-m32/match.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests-m32/rt_sigaction.awk b/tests-m32/rt_sigaction.awk
+index 9c3a9ed..8414243 100644
+--- a/tests-m32/rt_sigaction.awk
++++ b/tests-m32/rt_sigaction.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # Copyright (c) 2016 Elvira Khabirova <lineprinter0@gmail.com>
+diff --git a/tests-mx32/caps.awk b/tests-mx32/caps.awk
+index c6e31ef..5efc6cc 100644
+--- a/tests-mx32/caps.awk
++++ b/tests-mx32/caps.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests-mx32/match.awk b/tests-mx32/match.awk
+index abfbae9..f2740bf 100644
+--- a/tests-mx32/match.awk
++++ b/tests-mx32/match.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests-mx32/rt_sigaction.awk b/tests-mx32/rt_sigaction.awk
+index 9c3a9ed..8414243 100644
+--- a/tests-mx32/rt_sigaction.awk
++++ b/tests-mx32/rt_sigaction.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # Copyright (c) 2016 Elvira Khabirova <lineprinter0@gmail.com>
+diff --git a/tests/caps.awk b/tests/caps.awk
+index c6e31ef..5efc6cc 100644
+--- a/tests/caps.awk
++++ b/tests/caps.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # This file is part of caps strace test.
+ #
+diff --git a/tests/match.awk b/tests/match.awk
+index abfbae9..f2740bf 100644
+--- a/tests/match.awk
++++ b/tests/match.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # All rights reserved.
+diff --git a/tests/rt_sigaction.awk b/tests/rt_sigaction.awk
+index 9c3a9ed..8414243 100644
+--- a/tests/rt_sigaction.awk
++++ b/tests/rt_sigaction.awk
+@@ -1,4 +1,4 @@
+-#!/bin/gawk
++#!/usr/bin/gawk
+ #
+ # Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ # Copyright (c) 2016 Elvira Khabirova <lineprinter0@gmail.com>
diff --git a/poky/meta/recipes-devtools/strace/strace_4.20.bb b/poky/meta/recipes-devtools/strace/strace_4.20.bb
new file mode 100644
index 000000000..869c12f65
--- /dev/null
+++ b/poky/meta/recipes-devtools/strace/strace_4.20.bb
@@ -0,0 +1,59 @@
+SUMMARY = "System call tracing tool"
+HOMEPAGE = "http://strace.io"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f132b4d2adfccc63da4139a609367711"
+
+SRC_URI = "https://strace.io/files/${PV}/strace-${PV}.tar.xz \
+ file://disable-git-version-gen.patch \
+ file://more-robust-test-for-m32-mx32-compile-support.patch \
+ file://update-gawk-paths.patch \
+ file://Makefile-ptest.patch \
+ file://run-ptest \
+ file://0001-Fix-build-when-using-non-glibc-libc-implementation-o.patch \
+ file://mips-SIGEMT.patch \
+ file://0001-caps-abbrev.awk-fix-gawk-s-path.patch \
+ file://0001-tests-sigaction-Check-for-mips-and-alpha-before-usin.patch \
+ "
+
+SRC_URI[md5sum] = "f2271ab0fac49ebee9cbd7f3469227cb"
+SRC_URI[sha256sum] = "5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523"
+
+inherit autotools ptest bluetooth
+
+RDEPENDS_${PN}-ptest += "make coreutils grep gawk sed"
+
+PACKAGECONFIG_class-target ??= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+"
+
+PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,${BLUEZ}"
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+
+TESTDIR = "tests"
+
+do_install_append() {
+ # We don't ship strace-graph here because it needs perl
+ rm ${D}${bindir}/strace-graph
+}
+
+do_compile_ptest() {
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+ sed -i -e '/^src/s/strace.*[1-9]/ptest/' \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ -e '/^DEB_CHANGELOGTIME/d' \
+ -e '/^RPM_CHANGELOGTIME/d' \
+ ${D}/${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+BBCLASSEXTEND = "native"
+TOOLCHAIN = "gcc"
diff --git a/poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch b/poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch
new file mode 100644
index 000000000..5a1b10b2e
--- /dev/null
+++ b/poky/meta/recipes-devtools/subversion/subversion/0001-Fix-libtool-name-in-configure.ac.patch
@@ -0,0 +1,29 @@
+From cbcfe0399347989e45a8fb695f55c855d6b3da72 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 7 Dec 2015 17:11:02 +0200
+Subject: [PATCH] Fix libtool name in configure.ac
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4ed66d4..ceb64f9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -221,8 +221,8 @@ if test "$experimental_libtool" = "yes"; then
+ LIBTOOL="$sh_libtool"
+ SVN_LIBTOOL="$sh_libtool"
+ else
+- sh_libtool="$abs_builddir/libtool"
+- SVN_LIBTOOL="\$(SHELL) \"$sh_libtool\""
++ sh_libtool="$abs_builddir/$host_alias-libtool"
++ SVN_LIBTOOL="\$(SHELL) \$(abs_builddir)/$host_alias-libtool"
+ fi
+ AC_SUBST(SVN_LIBTOOL)
+
+--
+2.6.2
+
diff --git a/poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch b/poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch
new file mode 100644
index 000000000..ec3be496f
--- /dev/null
+++ b/poky/meta/recipes-devtools/subversion/subversion/disable_macos.patch
@@ -0,0 +1,68 @@
+These tests don't work in cross compiling, just disable them for now, we don't
+build subversion on OS-X at this time.
+
+RP 1014/7/16
+
+Upstream-Status: Pending [needs a rewrite to support a cache value]
+
+Index: subversion-1.8.9/build/ac-macros/macosx.m4
+===================================================================
+--- subversion-1.8.9.orig/build/ac-macros/macosx.m4 2012-11-26 03:04:27.000000000 +0000
++++ subversion-1.8.9/build/ac-macros/macosx.m4 2014-07-16 12:28:58.357300403 +0000
+@@ -24,21 +24,7 @@
+ AC_DEFUN(SVN_LIB_MACHO_ITERATE,
+ [
+ AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
+- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+- #include <mach-o/dyld.h>
+- #include <mach-o/loader.h>
+- ]],[[
+- const struct mach_header *header = _dyld_get_image_header(0);
+- const char *name = _dyld_get_image_name(0);
+- if (name && header) return 0;
+- return 1;
+- ]])],[
+- AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
+- [Is Mach-O low-level _dyld API available?])
+- AC_MSG_RESULT([yes])
+- ],[
+ AC_MSG_RESULT([no])
+- ])
+ ])
+
+ dnl SVN_LIB_MACOS_PLIST
+@@ -46,34 +32,7 @@
+ AC_DEFUN(SVN_LIB_MACOS_PLIST,
+ [
+ AC_MSG_CHECKING([for Mac OS property list utilities])
+-
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+- #include <AvailabilityMacros.h>
+- #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
+- || !defined(MAC_OS_X_VERSION_10_0) \
+- || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_0)
+- #error ProperyList API unavailable.
+- #endif
+- ]],[[]])],[
+- dnl ### Hack. We should only need to pass the -framework options when
+- dnl linking libsvn_subr, since it is the only library that uses Keychain.
+- dnl
+- dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
+- dnl OS X frameworks like it does for normal libraries, so we need to
+- dnl explicitly pass the option to all the users of libsvn_subr to allow
+- dnl static builds to link successfully.
+- dnl
+- dnl This does mean that all executables we link will be linked directly
+- dnl to these frameworks - even when building shared libraries - but that
+- dnl shouldn't cause any problems.
+-
+- LIBS="$LIBS -framework CoreFoundation"
+- AC_DEFINE([SVN_HAVE_MACOS_PLIST], [1],
+- [Is Mac OS property list API available?])
+- AC_MSG_RESULT([yes])
+- ],[
+ AC_MSG_RESULT([no])
+- ])
+ ])
+
+ dnl SVN_LIB_MACOS_KEYCHAIN
diff --git a/poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch b/poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch
new file mode 100644
index 000000000..9fed3cf6c
--- /dev/null
+++ b/poky/meta/recipes-devtools/subversion/subversion/serf.m4-Regex-modified-to-allow-D-in-paths.patch
@@ -0,0 +1,32 @@
+From f1b6e49f12a18eabe88eb732b578a16281d09499 Mon Sep 17 00:00:00 2001
+From: Jose Lamego <jose.a.lamego@linux.intel.com>
+Date: Thu, 2 Jul 2015 11:37:43 +0000
+Subject: [PATCH] serf.m4: Regex modified to allow '-D' in paths
+
+Upstream-Status: Accepted
+
+The patch is merged by subversion upstream with replacing '[[:space:]]' with ' '.
+
+http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/serf.m4?r1=1594156&r2=1689824
+
+Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
+---
+ build/ac-macros/serf.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/ac-macros/serf.m4 b/build/ac-macros/serf.m4
+index ae11e75..ff8cbae 100644
+--- a/build/ac-macros/serf.m4
++++ b/build/ac-macros/serf.m4
+@@ -168,7 +168,7 @@
+ if $PKG_CONFIG $serf_pc_arg --atleast-version=$serf_check_version; then
+ AC_MSG_RESULT([yes])
+ serf_found=yes
+- SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/-D[^ ]*//g'`]
++ SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/ -D[^ ]*//g' -e 's/^-D[^ ]*//g'`]
+ SVN_SERF_LIBS=`$PKG_CONFIG $serf_pc_arg --libs-only-l`
+ dnl don't use --libs-only-L because then we might miss some options
+ LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/-l[^ ]*//g'`"]
+--
+1.8.4.5
+
diff --git a/poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch b/poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch
new file mode 100644
index 000000000..9a45cb9a0
--- /dev/null
+++ b/poky/meta/recipes-devtools/subversion/subversion/serfmacro.patch
@@ -0,0 +1,22 @@
+The existing sed expression can match expressions like
+--sysroot=/some/path/xxx-linux/ which clearly isn't intended and
+injects incorrect paths into LDFLAGS.
+
+Fix this in the same way we address the problem in CFLAGS.
+
+RP 2016/12/7
+Upstream-Status: Pending
+
+Index: subversion-1.9.4/build/ac-macros/serf.m4
+===================================================================
+--- subversion-1.9.4.orig/build/ac-macros/serf.m4
++++ subversion-1.9.4/build/ac-macros/serf.m4
+@@ -171,7 +171,7 @@ AC_DEFUN(SVN_SERF_PKG_CONFIG,
+ SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/ -D[^ ]*//g' -e 's/^-D[^ ]*//g'`]
+ SVN_SERF_LIBS=`$PKG_CONFIG $serf_pc_arg --libs-only-l`
+ dnl don't use --libs-only-L because then we might miss some options
+- LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/-l[^ ]*//g'`"]
++ LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/ -l[^ ]*//g' -e 's/^-l[^ ]*//g'`"]
+ break
+ else
+ AC_MSG_RESULT([no])
diff --git a/poky/meta/recipes-devtools/subversion/subversion_1.9.7.bb b/poky/meta/recipes-devtools/subversion/subversion_1.9.7.bb
new file mode 100644
index 000000000..57735f7f8
--- /dev/null
+++ b/poky/meta/recipes-devtools/subversion/subversion_1.9.7.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Subversion (svn) version control system client"
+SECTION = "console/network"
+DEPENDS = "apr-util serf sqlite3 file"
+DEPENDS_append_class-native = " file-replacement-native"
+RDEPENDS_${PN} = "serf"
+LICENSE = "Apache-2"
+HOMEPAGE = "http://subversion.tigris.org"
+
+BBCLASSEXTEND = "native"
+
+inherit gettext pkgconfig
+
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://disable_macos.patch \
+ file://serf.m4-Regex-modified-to-allow-D-in-paths.patch \
+ file://0001-Fix-libtool-name-in-configure.ac.patch \
+ file://serfmacro.patch \
+ "
+
+SRC_URI[md5sum] = "05b0c677681073920f938c1f322e0be2"
+SRC_URI[sha256sum] = "c3b118333ce12e501d509e66bb0a47bcc34d053990acab45559431ac3e491623"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=af81ae49ba359e70626c05e9bf313709"
+
+PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl"
+PACKAGECONFIG[gnome-keyring] = "--with-gnome-keyring,--without-gnome-keyring,glib-2.0 gnome-keyring"
+
+EXTRA_OECONF = " \
+ --without-berkeley-db --without-apxs \
+ --without-swig --with-apr=${STAGING_BINDIR_CROSS} \
+ --with-apr-util=${STAGING_BINDIR_CROSS} \
+ --disable-keychain \
+ ac_cv_path_RUBY=none"
+
+inherit autotools
+
+export LDFLAGS += " -L${STAGING_LIBDIR} "
+CPPFLAGS += "-P"
+BUILD_CPPFLAGS += "-P"
+
+acpaths = "-I build/ -I build/ac-macros/"
+
+do_configure_prepend () {
+ rm -f ${S}/libtool
+ rm -f ${S}/build/libtool.m4 ${S}/build/ltmain.sh ${S}/build/ltoptions.m4 ${S}/build/ltsugar.m4 ${S}/build/ltversion.m4 ${S}/build/lt~obsolete.m4
+ rm -f ${S}/aclocal.m4
+ sed -i -e 's:with_sasl="/usr/local":with_sasl="${STAGING_DIR}":' ${S}/build/ac-macros/sasl.m4
+}
+
+#| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_local/libsvn_ra_local-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| /usr/bin/ld: cannot find -lsvn_delta-1| collect2: ld returned 1 exit status| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_svn/libsvn_ra_svn-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_serf/libsvn_ra_serf-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| x86_64-linux-libtool: install: error: relink `libsvn_ra_serf-1.la' with the above command before installing it
+#| x86_64-linux-libtool: install: warning: `../../subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/subversion-1.8.9/build-outputs.mk:1090: recipe for target 'install-serf-lib' failed
+#| make: *** [install-serf-lib] Error 1
+PARALLEL_MAKEINST = ""
diff --git a/poky/meta/recipes-devtools/swig/swig.inc b/poky/meta/recipes-devtools/swig/swig.inc
new file mode 100644
index 000000000..bf61b02d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/swig/swig.inc
@@ -0,0 +1,62 @@
+SUMMARY = "SWIG - Simplified Wrapper and Interface Generator"
+HOMEPAGE = "http://swig.sourceforge.net/"
+LICENSE = "BSD & GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \
+ file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \
+ file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08"
+
+SECTION = "devel"
+
+DEPENDS = "libpcre python3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools python3native pkgconfig
+
+EXTRA_OECONF = " \
+ --with-python3=${PYTHON} \
+ --without-allegrocl \
+ --without-android \
+ --without-boost \
+ --without-chicken \
+ --without-clisp \
+ --without-csharp \
+ --without-d \
+ --without-gcj \
+ --without-go \
+ --without-guile \
+ --without-java \
+ --without-lua \
+ --without-mzscheme \
+ --without-ocaml \
+ --without-octave \
+ --without-perl5 \
+ --without-pike \
+ --without-php \
+ --without-r \
+ --without-ruby \
+ --without-tcl \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/Tools/config
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/Tools/config
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+}
+
+do_install_append_class-nativesdk() {
+ cd ${D}${bindir}
+ ln -s swig swig2.0
+}
+
+def swiglib_relpath(d):
+ swiglib = d.getVar('datadir') + "/" + d.getVar('BPN') + "/" + d.getVar('PV')
+ return os.path.relpath(swiglib, d.getVar('bindir'))
+
+do_install_append_class-native() {
+ create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
+}
diff --git a/poky/meta/recipes-devtools/swig/swig/0001-Add-Node-7.x-aka-V8-5.2-support.patch b/poky/meta/recipes-devtools/swig/swig/0001-Add-Node-7.x-aka-V8-5.2-support.patch
new file mode 100644
index 000000000..885c39561
--- /dev/null
+++ b/poky/meta/recipes-devtools/swig/swig/0001-Add-Node-7.x-aka-V8-5.2-support.patch
@@ -0,0 +1,330 @@
+From 1a5aadcd66e85c63d228bfd811a521d617c22a38 Mon Sep 17 00:00:00 2001
+From: Patrick Schneider <patrick.schneider@meetnow.eu>
+Date: Thu, 13 Apr 2017 15:02:53 +0200
+Subject: [PATCH] Add Node 7.x aka V8 5.2+ support
+
+* Use WeakCallbackInfo instead of WeakCallbackData
+* Use GetPrivate instead of GetHiddenValue
+* Adopted new signature for SetWeak to support destructor calling
+* SetAccessor deprecation fixed
+* Proper version checks where applicable
+
+Upstream-Status: Submitted [https://github.com/swig/swig/pull/968]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ Lib/javascript/v8/javascriptcode.swg | 27 +++++++++++++++++-----
+ Lib/javascript/v8/javascripthelpers.swg | 29 +++++++++++++++++++++---
+ Lib/javascript/v8/javascriptinit.swg | 16 +++++++++++--
+ Lib/javascript/v8/javascriptrun.swg | 40 ++++++++++++++++++++++++++++-----
+ 4 files changed, 95 insertions(+), 17 deletions(-)
+
+diff --git a/Lib/javascript/v8/javascriptcode.swg b/Lib/javascript/v8/javascriptcode.swg
+index fb7d55c..b8c5089 100644
+--- a/Lib/javascript/v8/javascriptcode.swg
++++ b/Lib/javascript/v8/javascriptcode.swg
+@@ -133,10 +133,13 @@ static void $jswrapper(v8::Isolate *isolate, v8::Persistent<v8::Value> object, v
+ SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ static void $jswrapper(v8::Isolate *isolate, v8::Persistent<v8::Object> *object, SWIGV8_Proxy *proxy) {
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
+ v8::Local<v8::Object> object = data.GetValue();
+ SWIGV8_Proxy *proxy = data.GetParameter();
++#else
++ static void $jswrapper(const v8::WeakCallbackInfo<SWIGV8_Proxy> &data) {
++ SWIGV8_Proxy *proxy = data.GetParameter();
+ #endif
+
+ if(proxy->swigCMemOwn && proxy->swigCObject) {
+@@ -147,7 +150,9 @@ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &dat
+ }
+ delete proxy;
+
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ object.Clear();
++#endif
+
+ #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710)
+ object.Dispose();
+@@ -155,7 +160,7 @@ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &dat
+ object.Dispose(isolate);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032100)
+ object->Dispose(isolate);
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ object->Dispose();
+ #endif
+ }
+@@ -177,10 +182,13 @@ static void $jswrapper(v8::Isolate *isolate, v8::Persistent<v8::Value> object, v
+ SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ static void $jswrapper(v8::Isolate *isolate, v8::Persistent< v8::Object> *object, SWIGV8_Proxy *proxy) {
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
+ v8::Local<v8::Object> object = data.GetValue();
+ SWIGV8_Proxy *proxy = data.GetParameter();
++#else
++static void $jswrapper(const v8::WeakCallbackInfo<SWIGV8_Proxy> &data) {
++ SWIGV8_Proxy *proxy = data.GetParameter();
+ #endif
+
+ if(proxy->swigCMemOwn && proxy->swigCObject) {
+@@ -197,7 +205,7 @@ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &dat
+ object->Dispose(isolate);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ object->Dispose();
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ object.Clear();
+ #endif
+ }
+@@ -211,7 +219,11 @@ static void $jswrapper(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &dat
+ * ----------------------------------------------------------------------------- */
+ %fragment("js_getter", "templates")
+ %{
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ static SwigV8ReturnValue $jswrapper(v8::Local<v8::String> property, const SwigV8PropertyCallbackInfo &info) {
++#else
++static SwigV8ReturnValue $jswrapper(v8::Local<v8::Name> property, const SwigV8PropertyCallbackInfo &info) {
++#endif
+ SWIGV8_HANDLESCOPE();
+
+ v8::Handle<v8::Value> jsresult;
+@@ -233,8 +245,11 @@ fail:
+ * ----------------------------------------------------------------------------- */
+ %fragment("js_setter", "templates")
+ %{
+-static void $jswrapper(v8::Local<v8::String> property, v8::Local<v8::Value> value,
+- const SwigV8PropertyCallbackInfoVoid &info) {
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
++static void $jswrapper(v8::Local<v8::String> property, v8::Local<v8::Value> value, const SwigV8PropertyCallbackInfoVoid &info) {
++#else
++static void $jswrapper(v8::Local<v8::Name> property, v8::Local<v8::Value> value, const SwigV8PropertyCallbackInfoVoid &info) {
++#endif
+ SWIGV8_HANDLESCOPE();
+
+ $jslocals
+diff --git a/Lib/javascript/v8/javascripthelpers.swg b/Lib/javascript/v8/javascripthelpers.swg
+index 091467d..7461079 100644
+--- a/Lib/javascript/v8/javascripthelpers.swg
++++ b/Lib/javascript/v8/javascripthelpers.swg
+@@ -6,11 +6,16 @@ typedef v8::InvocationCallback SwigV8FunctionCallback;
+ typedef v8::AccessorGetter SwigV8AccessorGetterCallback;
+ typedef v8::AccessorSetter SwigV8AccessorSetterCallback;
+ typedef v8::AccessorInfo SwigV8PropertyCallbackInfoVoid;
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ typedef v8::FunctionCallback SwigV8FunctionCallback;
+ typedef v8::AccessorGetterCallback SwigV8AccessorGetterCallback;
+ typedef v8::AccessorSetterCallback SwigV8AccessorSetterCallback;
+ typedef v8::PropertyCallbackInfo<void> SwigV8PropertyCallbackInfoVoid;
++#else
++typedef v8::FunctionCallback SwigV8FunctionCallback;
++typedef v8::AccessorNameGetterCallback SwigV8AccessorGetterCallback;
++typedef v8::AccessorNameSetterCallback SwigV8AccessorSetterCallback;
++typedef v8::PropertyCallbackInfo<void> SwigV8PropertyCallbackInfoVoid;
+ #endif
+
+ /**
+@@ -65,18 +70,36 @@ SWIGRUNTIME void SWIGV8_AddStaticFunction(v8::Handle<v8::Object> obj, const char
+ */
+ SWIGRUNTIME void SWIGV8_AddStaticVariable(v8::Handle<v8::Object> obj, const char* symbol,
+ SwigV8AccessorGetterCallback getter, SwigV8AccessorSetterCallback setter) {
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ obj->SetAccessor(SWIGV8_SYMBOL_NEW(symbol), getter, setter);
++#else
++ obj->SetAccessor(SWIGV8_CURRENT_CONTEXT(), SWIGV8_SYMBOL_NEW(symbol), getter, setter);
++#endif
+ }
+
+-SWIGRUNTIME void JS_veto_set_variable(v8::Local<v8::String> property, v8::Local<v8::Value> value,
+- const SwigV8PropertyCallbackInfoVoid& info)
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
++SWIGRUNTIME void JS_veto_set_variable(v8::Local<v8::String> property, v8::Local<v8::Value> value, const SwigV8PropertyCallbackInfoVoid& info)
++#else
++SWIGRUNTIME void JS_veto_set_variable(v8::Local<v8::Name> property, v8::Local<v8::Value> value, const SwigV8PropertyCallbackInfoVoid& info)
++#endif
+ {
+ char buffer[256];
+ char msg[512];
+ int res;
+
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ property->WriteUtf8(buffer, 256);
+ res = sprintf(msg, "Tried to write read-only variable: %s.", buffer);
++#else
++ v8::Local<v8::String> sproperty;
++ if (property->ToString(SWIGV8_CURRENT_CONTEXT()).ToLocal(&sproperty)) {
++ sproperty->WriteUtf8(buffer, 256);
++ res = sprintf(msg, "Tried to write read-only variable: %s.", buffer);
++ }
++ else {
++ res = -1;
++ }
++#endif
+
+ if(res<0) {
+ SWIG_exception(SWIG_ERROR, "Tried to write read-only variable.");
+diff --git a/Lib/javascript/v8/javascriptinit.swg b/Lib/javascript/v8/javascriptinit.swg
+index 34befa7..86008d9 100644
+--- a/Lib/javascript/v8/javascriptinit.swg
++++ b/Lib/javascript/v8/javascriptinit.swg
+@@ -7,15 +7,27 @@ SWIG_V8_SetModule(void *, swig_module_info *swig_module) {
+ v8::Local<v8::Object> global_obj = SWIGV8_CURRENT_CONTEXT()->Global();
+ v8::Local<v8::External> mod = SWIGV8_EXTERNAL_NEW(swig_module);
+ assert(!mod.IsEmpty());
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ global_obj->SetHiddenValue(SWIGV8_STRING_NEW("swig_module_info_data"), mod);
++#else
++ v8::Local<v8::Private> privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data"));
++ global_obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, mod);
++#endif
+ }
+
+ SWIGRUNTIME swig_module_info *
+ SWIG_V8_GetModule(void *) {
+ v8::Local<v8::Object> global_obj = SWIGV8_CURRENT_CONTEXT()->Global();
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ v8::Local<v8::Value> moduleinfo = global_obj->GetHiddenValue(SWIGV8_STRING_NEW("swig_module_info_data"));
++#else
++ v8::Local<v8::Private> privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("swig_module_info_data"));
++ v8::Local<v8::Value> moduleinfo;
++ if (!global_obj->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&moduleinfo))
++ return 0;
++#endif
+
+- if (moduleinfo.IsEmpty())
++ if (moduleinfo.IsEmpty() || moduleinfo->IsNull() || moduleinfo->IsUndefined())
+ {
+ // It's not yet loaded
+ return 0;
+@@ -23,7 +35,7 @@ SWIG_V8_GetModule(void *) {
+
+ v8::Local<v8::External> moduleinfo_extern = v8::Local<v8::External>::Cast(moduleinfo);
+
+- if (moduleinfo_extern.IsEmpty())
++ if (moduleinfo_extern.IsEmpty() || moduleinfo_extern->IsNull() || moduleinfo_extern->IsUndefined())
+ {
+ // Something's not right
+ return 0;
+diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg
+index 5ac52a5..30002c0 100644
+--- a/Lib/javascript/v8/javascriptrun.swg
++++ b/Lib/javascript/v8/javascriptrun.swg
+@@ -193,8 +193,10 @@ public:
+ void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Value> object, void *parameter);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ void (*dtor) (v8::Isolate *isolate, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy);
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ void (*dtor) (const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data);
++#else
++ void (*dtor) (const v8::WeakCallbackInfo<SWIGV8_Proxy> &data);
+ #endif
+ };
+
+@@ -241,9 +243,12 @@ SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Val
+ SWIGV8_Proxy *proxy = static_cast<SWIGV8_Proxy *>(parameter);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(v8::Isolate *, v8::Persistent< v8::Object > *object, SWIGV8_Proxy *proxy) {
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackData<v8::Object, SWIGV8_Proxy> &data) {
+ SWIGV8_Proxy *proxy = data.GetParameter();
++#else
++SWIGRUNTIME void SWIGV8_Proxy_DefaultDtor(const v8::WeakCallbackInfo<SWIGV8_Proxy> &data) {
++ SWIGV8_Proxy *proxy = data.GetParameter();
+ #endif
+
+ delete proxy;
+@@ -312,12 +317,18 @@ SWIGRUNTIME void SWIGV8_SetPrivateData(v8::Handle<v8::Object> obj, void *ptr, sw
+ } else {
+ cdata->handle.MakeWeak(cdata, SWIGV8_Proxy_DefaultDtor);
+ }
+-#else
++#elifif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) {
+ cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor);
+ } else {
+ cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor);
+ }
++#else
++ if(cdata->swigCMemOwn && (SWIGV8_ClientData*)info->clientdata) {
++ cdata->handle.SetWeak(cdata, ((SWIGV8_ClientData*)info->clientdata)->dtor, v8::WeakCallbackType::kParameter);
++ } else {
++ cdata->handle.SetWeak(cdata, SWIGV8_Proxy_DefaultDtor, v8::WeakCallbackType::kParameter);
++ }
+ #endif
+
+ #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710)
+@@ -470,7 +481,14 @@ int SwigV8Packed_Check(v8::Handle<v8::Value> valRef) {
+
+ v8::Handle<v8::Object> objRef = valRef->ToObject();
+ if(objRef->InternalFieldCount() < 1) return false;
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ v8::Handle<v8::Value> flag = objRef->GetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__"));
++#else
++ v8::Local<v8::Private> privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__"));
++ v8::Local<v8::Value> flag;
++ if (!objRef->GetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey).ToLocal(&flag))
++ return false;
++#endif
+ return (flag->IsBoolean() && flag->BooleanValue());
+ }
+
+@@ -519,10 +537,13 @@ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persist
+ SwigV8PackedData *cdata = static_cast<SwigV8PackedData *>(parameter);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(v8::Isolate *isolate, v8::Persistent<v8::Object> *object, SwigV8PackedData *cdata) {
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData<v8::Object, SwigV8PackedData> &data) {
+ v8::Local<v8::Object> object = data.GetValue();
+ SwigV8PackedData *cdata = data.GetParameter();
++#else
++SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackInfo<SwigV8PackedData> &data) {
++ SwigV8PackedData *cdata = data.GetParameter();
+ #endif
+
+ delete cdata;
+@@ -537,7 +558,7 @@ SWIGRUNTIME void _wrap_SwigV8PackedData_delete(const v8::WeakCallbackData<v8::Ob
+ object->Dispose(isolate);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ object->Dispose();
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ object.Clear();
+ #endif
+ }
+@@ -550,7 +571,12 @@ v8::Handle<v8::Value> SWIGV8_NewPackedObj(void *data, size_t size, swig_type_inf
+ // v8::Handle<v8::Object> obj = SWIGV8_OBJECT_NEW();
+ v8::Local<v8::Object> obj = SWIGV8_OBJECT_NEW();
+
++#if (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ obj->SetHiddenValue(SWIGV8_STRING_NEW("__swig__packed_data__"), SWIGV8_BOOLEAN_NEW(true));
++#else
++ v8::Local<v8::Private> privateKey = v8::Private::ForApi(v8::Isolate::GetCurrent(), SWIGV8_STRING_NEW("__swig__packed_data__"));
++ obj->SetPrivate(SWIGV8_CURRENT_CONTEXT(), privateKey, SWIGV8_BOOLEAN_NEW(true));
++#endif
+
+ #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031511)
+ obj->SetPointerInInternalField(0, cdata);
+@@ -573,9 +599,11 @@ v8::Handle<v8::Value> SWIGV8_NewPackedObj(void *data, size_t size, swig_type_inf
+ cdata->handle.MakeWeak(v8::Isolate::GetCurrent(), cdata, _wrap_SwigV8PackedData_delete);
+ #elif (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < SWIGV8_SETWEAK_VERSION)
+ cdata->handle.MakeWeak(cdata, _wrap_SwigV8PackedData_delete);
+-#else
++#elif (V8_MAJOR_VERSION-0) < 5 || (V8_MAJOR_VERSION == 5 && V8_MINOR_VERSION < 2)
+ cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete);
+ // v8::V8::SetWeak(&cdata->handle, cdata, _wrap_SwigV8PackedData_delete);
++#else
++ cdata->handle.SetWeak(cdata, _wrap_SwigV8PackedData_delete, v8::WeakCallbackType::kParameter);
+ #endif
+
+ #if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x031710)
+--
+2.9.5
+
diff --git a/poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
new file mode 100644
index 000000000..81df3e264
--- /dev/null
+++ b/poky/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
@@ -0,0 +1,69 @@
+From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001
+From: "NODA, Kai" <nodakai@gmail.com>
+Date: Sun, 22 Apr 2012 17:01:02 +0900
+Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32
+ platforms.
+
+If it wasn't found, then fall back to a fixed string just as before.
+
+Upstream-Status: Submitted
+http://sourceforge.net/mailarchive/message.php?msg_id=29179733
+
+---
+ Source/Modules/main.cxx | 24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
+index d2f5d3b..cbb0a12 100644
+--- a/Source/Modules/main.cxx
++++ b/Source/Modules/main.cxx
+@@ -26,6 +26,11 @@ char cvsroot_main_cxx[] = "$Id$";
+ #include "cparse.h"
+ #include <ctype.h>
+ #include <limits.h> // for INT_MAX
++#ifndef _WIN32
++#include <cstddef>
++#include <unistd.h> // for readlink
++#include <sys/stat.h> // for stat
++#endif
+
+ // Global variables
+
+@@ -902,9 +907,9 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+
+ // Check for SWIG_LIB environment variable
+ if ((c = getenv("SWIG_LIB")) == (char *) 0) {
++ char *p;
+ #if defined(_WIN32)
+ char buf[MAX_PATH];
+- char *p;
+ if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) {
+ *(p + 1) = '\0';
+ SwigLib = NewStringf("%sLib", buf); // Native windows installation path
+@@ -914,7 +919,22 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+ if (Len(SWIG_LIB_WIN_UNIX) > 0)
+ SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw)
+ #else
+- SwigLib = NewString(SWIG_LIB);
++ char buf[PATH_MAX];
++ if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) &&
++ (p = ::strstr(buf, "/bin/swig"))) {
++ int major, minor, patch;
++ const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
++ if (3 == ret) {
++ const ::ptrdiff_t dir_part_len = p - buf;
++ ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch);
++ struct ::stat stat_res;
++ if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) {
++ SwigLib = NewString(buf);
++ }
++ }
++ }
++ if (NULL == SwigLib)
++ SwigLib = NewString(SWIG_LIB);
+ #endif
+ } else {
+ SwigLib = NewString(c);
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
new file mode 100644
index 000000000..1b1128aca
--- /dev/null
+++ b/poky/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
@@ -0,0 +1,64 @@
+From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen.kooi@linaro.org>
+Date: Tue, 17 Jun 2014 08:18:17 +0200
+Subject: [PATCH] configure: use pkg-config for pcre detection
+
+Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
+Upstream-Status: pending
+---
+ configure.ac | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0c984b7..6edcec1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,38 +70,14 @@ AC_MSG_RESULT([$with_pcre])
+
+ dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
+ if test x"${with_pcre}" = xyes ; then
+- AC_MSG_CHECKING([whether to use local PCRE])
+- local_pcre_config=no
+- if test -z $PCRE_CONFIG; then
+- if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then
+- PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config
+- local_pcre_config=$PCRE_CONFIG
+- fi
+- fi
+- AC_MSG_RESULT([$local_pcre_config])
+-fi
+-AS_IF([test "x$with_pcre" != xno],
+- [AX_PATH_GENERIC([pcre],
+- [], dnl Minimal version of PCRE we need -- accept any
+- [], dnl custom sed script for version parsing is not needed
+- [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+- LIBS="$LIBS $PCRE_LIBS"
+- CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
+- ],
+- [AC_MSG_FAILURE([
+- Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
+- library package. This dependency is needed for configure to complete,
+- Either:
+- - Install the PCRE developer package on your system (preferred approach).
+- - Download the PCRE source tarball, build and install on your system
+- as you would for any package built from source distribution.
+- - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
+- link against. Run 'Tools/pcre-build.sh --help' for instructions.
+- (quite easy and does not require privileges to install PCRE on your system)
+- - Use configure --without-pcre to disable regular expressions support in SWIG
+- (not recommended).])
+- ])
++ PKG_CHECK_MODULES([PCRE], [libpcre], [
++ AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
++ LIBS="$LIBS $PCRE_LIBS"
++ CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
++ ], [
++ AC_MSG_WARN([$PCRE_PKG_ERRORS])
+ ])
++fi
+
+
+ dnl CCache
+--
+1.9.3
+
diff --git a/poky/meta/recipes-devtools/swig/swig_3.0.12.bb b/poky/meta/recipes-devtools/swig/swig_3.0.12.bb
new file mode 100644
index 000000000..15f734868
--- /dev/null
+++ b/poky/meta/recipes-devtools/swig/swig_3.0.12.bb
@@ -0,0 +1,9 @@
+require ${BPN}.inc
+
+SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \
+ file://0001-configure-use-pkg-config-for-pcre-detection.patch \
+ file://0001-Add-Node-7.x-aka-V8-5.2-support.patch \
+ "
+SRC_URI[md5sum] = "82133dfa7bba75ff9ad98a7046be687c"
+SRC_URI[sha256sum] = "7cf9f447ae7ed1c51722efc45e7f14418d15d7a1e143ac9f09a668999f4fc94d"
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
new file mode 100644
index 000000000..3ab787527
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
@@ -0,0 +1,84 @@
+From 60f3833ab2b5899771b4eab654e88f9888b99501 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:01:55 +0800
+Subject: [PATCH 1/9] linux/syslinux: support ext2/3/4 device
+
+* Support ext2/3/4 deivce.
+* The open_ext2_fs() checks whether it is an ext2/3/4 device,
+ do the ext2/3/4 installation (install_to_ext2()) if yes, otherwise go
+ on to the fat/ntfs.
+* The ext2/3/4 support doesn't require root privileges since it doesn't need
+ mount (but write permission is required).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 912de71..36fc202 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -256,6 +256,23 @@ int do_open_file(char *name)
+ return fd;
+ }
+
++/*
++ * Check whether the device contains an ext2, ext3 or ext4 fs and open it if
++ * true.
++ * return value:
++ * 0: Everything is OK
++ * 1: Not an ext2, ext3 or ext4
++ * -1: unexpected error
++ */
++static int open_ext2_fs(const char *device, const char *subdir)
++{
++}
++
++/* The install func for ext2, ext3 and ext4 */
++static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
++{
++}
++
+ int main(int argc, char *argv[])
+ {
+ static unsigned char sectbuf[SECTOR_SIZE];
+@@ -313,6 +330,24 @@ int main(int argc, char *argv[])
+ die("can't combine an offset with a block device");
+ }
+
++ /*
++ * Check if it is an ext2, ext3 or ext4
++ */
++ rv = open_ext2_fs(opt.device, subdir);
++ if (rv == 0) {
++ if (install_to_ext2(opt.device, dev_fd, subdir)) {
++ fprintf(stderr, "%s: installation failed\n", opt.device);
++ exit(1);
++ }
++ return 0;
++ /* Unexpected errors */
++ } else if (rv == -1) {
++ exit(1);
++ }
++
++ /* Reset rv */
++ rv = 0;
++
+ xpread(dev_fd, sectbuf, SECTOR_SIZE, opt.offset);
+ fsync(dev_fd);
+
+@@ -322,6 +357,7 @@ int main(int argc, char *argv[])
+ */
+ if ((errmsg = syslinux_check_bootsect(sectbuf, &fs_type))) {
+ fprintf(stderr, "%s: %s\n", opt.device, errmsg);
++ fprintf(stderr, "%s: supported fs: fat/ntfs/ext2/ex3/ext4\n", program);
+ exit(1);
+ }
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
new file mode 100644
index 000000000..77cf06045
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
@@ -0,0 +1,141 @@
+From 07fb737fb60c08eaaa41989d531fc23009523546 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:09:18 +0800
+Subject: [PATCH 2/9] linux/syslinux: implement open_ext2_fs()
+
+The open_ext2_fs() checks whether it is an ext2/ext3/ext4 device, and
+return:
+0: It is an ext2, ext3 or ext4.
+1: Not an ext2, ext3 or ext4.
+-1: unexpected error.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/Makefile | 2 +-
+ linux/syslinux.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 81 insertions(+), 1 deletion(-)
+
+diff --git a/linux/Makefile b/linux/Makefile
+index 11667e1..ac1ac58 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -51,7 +51,7 @@ spotless: clean
+ installer: syslinux syslinux-nomtools
+
+ syslinux: $(OBJS)
+- $(CC) $(LDFLAGS) -o $@ $^
++ $(CC) $(LDFLAGS) -o $@ $^ -lext2fs
+
+ syslinux-nomtools: syslinux
+ ln -f $< $@
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 36fc202..cc4e7da 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -72,6 +72,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include <ext2fs/ext2fs.h>
+
+ extern const char *program; /* Name of program */
+
+@@ -82,6 +83,9 @@ char *mntpath = NULL; /* Path on which to mount */
+ int loop_fd = -1; /* Loop device */
+ #endif
+
++ext2_filsys e2fs = NULL; /* Ext2/3/4 filesystem */
++ext2_ino_t root, cwd; /* The root and cwd of e2fs */
++
+ void __attribute__ ((noreturn)) die(const char *msg)
+ {
+ fprintf(stderr, "%s: %s\n", program, msg);
+@@ -266,6 +270,82 @@ int do_open_file(char *name)
+ */
+ static int open_ext2_fs(const char *device, const char *subdir)
+ {
++ int retval;
++ int open_flag = EXT2_FLAG_RW, mount_flags;
++ ext2_ino_t dirino;
++ char opt_string[40];
++
++ if (opt.offset) {
++ sprintf(opt_string, "offset=%llu", (unsigned long long)opt.offset);
++ retval = ext2fs_open2(device, opt_string, open_flag, 0, 0, unix_io_manager, &e2fs);
++ } else
++ retval = ext2fs_open(device, open_flag, 0, 0, unix_io_manager, &e2fs);
++ if (retval) {
++ /* It might not be an extN fs, so we need check magic firstly */
++ if (retval == EXT2_ET_BAD_MAGIC) {
++ /* Do nothing, return silently */
++ return 1;
++ } else {
++ fprintf(stderr, "%s: error while trying to open: %s\n",
++ program, device);
++ return -1;
++ }
++ }
++
++ /* Stop if it is mounted */
++ retval = ext2fs_check_if_mounted(device, &mount_flags);
++ if (retval) {
++ fprintf(stderr, "%s: ext2fs_check_if_mount() error on %s\n",
++ program, device);
++ goto fail;
++ }
++
++ if (mount_flags & EXT2_MF_MOUNTED) {
++ fprintf(stderr, "%s: %s is mounted\n", program, device);
++ goto fail;
++ }
++
++ e2fs->default_bitmap_type = EXT2FS_BMAP64_RBTREE;
++
++ /* Read the inode map */
++ retval = ext2fs_read_inode_bitmap(e2fs);
++ if (retval) {
++ fprintf(stderr, "%s: while reading inode bitmap: %s\n",
++ program, device);
++ goto fail;
++ }
++
++ /* Read the block map */
++ retval = ext2fs_read_block_bitmap(e2fs);
++ if (retval) {
++ fprintf(stderr, "%s: while reading block bitmap: %s\n",
++ program, device);
++ goto fail;
++ }
++
++ root = cwd = EXT2_ROOT_INO;
++ /* Check the subdir */
++ if (strcmp(subdir, "/")) {
++ retval = ext2fs_namei(e2fs, root, cwd, subdir, &dirino);
++ if (retval) {
++ fprintf(stderr, "%s: failed to find dir %s on %s\n",
++ program, subdir, device);
++ goto fail;
++ }
++
++ retval = ext2fs_check_directory(e2fs, dirino);
++ if (retval) {
++ fprintf(stderr, "%s: failed to cd to: %s\n", program, subdir);
++ goto fail;
++ }
++ cwd = dirino;
++ }
++
++ return 0;
++
++fail:
++ (void) ext2fs_close(e2fs);
++ return -1;
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
new file mode 100644
index 000000000..84ba10526
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
@@ -0,0 +1,116 @@
+From 64d856b243812907068776b204a003a3a8fa122a Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:17:42 +0800
+Subject: [PATCH 3/9] linux/syslinux: implement install_to_ext2()
+
+* The handle_adv_on_ext() checks whether we only need update adv.
+* The write_to_ext() installs files (ldlinux.sys or ldlinux.c32) to the
+ device.
+* The install_bootblock() installs the boot block.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index cc4e7da..45f080d 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -346,11 +346,90 @@ static int open_ext2_fs(const char *device, const char *subdir)
+ fail:
+ (void) ext2fs_close(e2fs);
+ return -1;
++
++}
++
++/*
++ * Install the boot block on the specified device.
++ * Must be run AFTER file installed.
++ */
++int install_bootblock(int fd, const char *device)
++{
++}
++
++static int handle_adv_on_ext(void)
++{
++}
++
++/* Write files, adv, boot sector */
++static int write_to_ext(const char *filename, const char *str, int length,
++ int i_flags, int dev_fd, const char *subdir)
++{
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+ static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
+ {
++ int retval;
++ ext2_ino_t oldino;
++
++ const char *file = "ldlinux.sys";
++ const char *oldfile = "extlinux.sys";
++ const char *c32file = "ldlinux.c32";
++
++ /* Handle the adv */
++ if (handle_adv_on_ext() < 0) {
++ fprintf(stderr, "%s: error while handling ADV on %s\n",
++ program, device);
++ retval = 1;
++ goto fail;
++ }
++
++ /* Return if only need update the adv */
++ if (opt.update_only == -1) {
++ return ext2fs_close(e2fs);
++ }
++
++ /* Write ldlinux.sys, adv, boot sector */
++ retval = write_to_ext(file, (const char _force *)boot_image,
++ boot_image_len, EXT2_IMMUTABLE_FL, dev_fd, subdir);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++ program, file);
++ goto fail;
++ }
++
++ /* Write ldlinux.c32 */
++ retval = write_to_ext(c32file,
++ (const char _force *)syslinux_ldlinuxc32,
++ syslinux_ldlinuxc32_len, 0, dev_fd, subdir);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++ program, c32file);
++ goto fail;
++ }
++
++ /* Look if we have the extlinux.sys and remove it*/
++ retval = ext2fs_namei(e2fs, root, cwd, oldfile, &oldino);
++ if (retval == 0) {
++ retval = ext2fs_unlink(e2fs, cwd, oldfile, oldino, 0);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to unlink: %s\n",
++ program, oldfile);
++ goto fail;
++ }
++ } else {
++ retval = 0;
++ }
++
++ sync();
++ retval = install_bootblock(dev_fd, device);
++ close(dev_fd);
++ sync();
++
++fail:
++ (void) ext2fs_close(e2fs);
++ return retval;
+ }
+
+ int main(int argc, char *argv[])
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
new file mode 100644
index 000000000..64b56d92e
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
@@ -0,0 +1,91 @@
+From 35d3842cc4b930c5102eed2921e0189b7f4fd069 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:43:37 +0800
+Subject: [PATCH 4/9] linux/syslinux: add ext_file_read() and ext_file_write()
+
+Will use them to read and write on the extX device.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 62 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 45f080d..247c86a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -349,6 +349,68 @@ fail:
+
+ }
+
++/* Read from an ext2_file */
++static int ext_file_read(ext2_file_t e2_file, void *buf, size_t count,
++ off_t offset, const char *msg)
++{
++ int retval;
++ char *ptr = (char *) buf;
++ unsigned int got = 0;
++ size_t done = 0;
++
++ /* Always lseek since e2_file is uncontrolled by this func */
++ if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++ fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++ program);
++ return -1;
++ }
++
++ while (1) {
++ retval = ext2fs_file_read(e2_file, ptr, count, &got);
++ if (retval) {
++ fprintf(stderr, "%s: error while reading %s\n",
++ program, msg);
++ return -1;
++ }
++ count -= got;
++ ptr += got;
++ done += got;
++ if (got == 0 || count == 0)
++ break;
++ }
++
++ return done;
++}
++
++/* Write to an ext2_file */
++static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
++ off_t offset)
++{
++ const char *ptr = (const char *) buf;
++ unsigned int written = 0;
++ size_t done = 0;
++
++ /* Always lseek since e2_file is uncontrolled by this func */
++ if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++ fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++ program);
++ return -1;
++ }
++
++ while (count > 0) {
++ if (ext2fs_file_write(e2_file, ptr, count, &written)) {
++ fprintf(stderr, "%s: failed to write syslinux adv.\n",
++ program);
++ return -1;
++ }
++ count -= written;
++ ptr += written;
++ done += written;
++ }
++
++ return done;
++}
++
+ /*
+ * Install the boot block on the specified device.
+ * Must be run AFTER file installed.
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
new file mode 100644
index 000000000..829e7c4ca
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
@@ -0,0 +1,127 @@
+From cdb980b37f40dc2c41891434c7736e49da53756e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:47:52 +0800
+Subject: [PATCH 5/9] linux/syslinux: implement handle_adv_on_ext()
+
+It reads adv if found on the device, or resets syslinux_adv, or update
+the adv if update adv only.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 97 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 247c86a..de5d272 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,6 +421,103 @@ int install_bootblock(int fd, const char *device)
+
+ static int handle_adv_on_ext(void)
+ {
++ int i, retval, found_file;
++ int need_close = 2; /* 2 means no need extra close */
++ char *filenames[2] = {"ldlinux.sys", "extlinux.sys"};
++ char *filename;
++ ext2_ino_t newino;
++ ext2_file_t e2_file;
++ struct ext2_inode inode;
++
++ for (i = 0; i < 2; i++) {
++ filename = filenames[i];
++ found_file = 0;
++ retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++ if (retval == 0) {
++ found_file = 1;
++ } else
++ continue;
++
++ need_close = i;
++
++ retval = ext2fs_file_open(e2fs, newino, EXT2_FLAG_RW, &e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: failed to open %s\n",
++ program, filename);
++ goto fail;
++ }
++
++ retval = ext2fs_read_inode(e2fs, newino, &inode);
++ if (retval) {
++ fprintf(stderr, "%s: error while reading inode: %u, file: %s\n",
++ program, newino, filename);
++ goto fail;
++ }
++
++ /* Check the size to see if too small to read */
++ if (inode.i_size < 2 * ADV_SIZE) {
++ if (opt.update_only == -1) {
++ fprintf(stderr, "%s: failed to write auxilliary data\n\
++ the size of %s is too small (need --update)?\n",
++ program, filename);
++ retval = -1;
++ goto fail;
++ }
++ syslinux_reset_adv(syslinux_adv);
++ found_file = 0;
++ break;
++ }
++
++ /* Read the adv */
++ retval = ext_file_read(e2_file, syslinux_adv, 2 * ADV_SIZE,
++ inode.i_size - 2 * ADV_SIZE, "ADV");
++ if (retval == -1)
++ goto fail;
++ if (retval == 2 * ADV_SIZE) {
++ retval = syslinux_validate_adv(syslinux_adv);
++ /* Read the adv successfully */
++ if (retval == 0)
++ break;
++ }
++
++ /* Close the file if reaches here, otherwise we leave the file
++ * open in case we need write it */
++ need_close = 2;
++ retval = ext2fs_file_close(e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: error while closing %s\n",
++ program, filename);
++ return retval;
++ }
++ }
++
++ if (!found_file) {
++ if (opt.update_only == -1) {
++ fprintf(stderr, "%s: no ldlinux.sys or extlinux.sys found on the device\n",
++ program);
++ return -1;
++ }
++ syslinux_reset_adv(syslinux_adv);
++ }
++
++ /* The modify_adv will reset the adv if opt.reset_adv */
++ if (modify_adv() < 0) {
++ fprintf(stderr, "%s: error while modifying adv\n", program);
++ retval = -1;
++ goto fail;
++ }
++
++ /* Write adv if update_only == -1 and found file */
++ if (opt.update_only == -1 && found_file) {
++ if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE ,
++ inode.i_size - 2 * ADV_SIZE) == -1)
++ goto fail;
++ }
++
++fail:
++ if (need_close != 2)
++ (void) ext2fs_file_close(e2_file);
++ return retval;
+ }
+
+ /* Write files, adv, boot sector */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
new file mode 100644
index 000000000..cba87252a
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
@@ -0,0 +1,215 @@
+From 922e56c10e36d876777580c84daef9a66bea6525 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 17:20:43 +0800
+Subject: [PATCH 6/9] linux/syslinux: implement write_to_ext() and add
+ syslinuxext.c
+
+* The write_to_ext() write file to the extX device, and handle the boot
+ sector.
+* The syslinuxext.c is used for placing the code which are used by
+ extlinux and syslinux (which is syslinux_patch_bootsect()).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ libinstaller/syslinuxext.c | 7 +++
+ libinstaller/syslinuxext.h | 5 ++
+ linux/Makefile | 3 +-
+ linux/syslinux.c | 118 +++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 132 insertions(+), 1 deletion(-)
+ create mode 100644 libinstaller/syslinuxext.c
+ create mode 100644 libinstaller/syslinuxext.h
+
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+new file mode 100644
+index 0000000..bb54cef
+--- /dev/null
++++ b/libinstaller/syslinuxext.c
+@@ -0,0 +1,7 @@
++#define _GNU_SOURCE
++
++/* Patch syslinux_bootsect */
++void syslinux_patch_bootsect(int dev_fd)
++{
++}
++
+diff --git a/libinstaller/syslinuxext.h b/libinstaller/syslinuxext.h
+new file mode 100644
+index 0000000..8abd8b9
+--- /dev/null
++++ b/libinstaller/syslinuxext.h
+@@ -0,0 +1,5 @@
++#ifndef EXT2_SUPER_OFFSET
++#define EXT2_SUPER_OFFSET 1024
++#endif
++
++void syslinux_patch_bootsect(int dev_fd);
+diff --git a/linux/Makefile b/linux/Makefile
+index ac1ac58..3b23867 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -30,7 +30,8 @@ SRCS = syslinux.c \
+ ../libinstaller/syslxmod.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinuxc32_bin.c \
+- ../libinstaller/ldlinux_bin.c
++ ../libinstaller/ldlinux_bin.c \
++ ../libinstaller/syslinuxext.c
+ OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index de5d272..f0c97a8 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -46,6 +46,7 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/mount.h>
++#include <time.h>
+
+ #include "linuxioctl.h"
+
+@@ -72,6 +73,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include "syslinuxext.h"
+ #include <ext2fs/ext2fs.h>
+
+ extern const char *program; /* Name of program */
+@@ -419,6 +421,12 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+
++/* Construct the boot file map */
++int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
++ sector_t *sectors, int nsect)
++{
++}
++
+ static int handle_adv_on_ext(void)
+ {
+ int i, retval, found_file;
+@@ -524,6 +532,116 @@ fail:
+ static int write_to_ext(const char *filename, const char *str, int length,
+ int i_flags, int dev_fd, const char *subdir)
+ {
++ ext2_ino_t newino;
++ struct ext2_inode inode;
++ int retval, i, modbytes, nsect;
++ ext2_file_t e2_file;
++ sector_t *sectors;
++
++ /* Remove it if it is already exists */
++ retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++ if (retval == 0) {
++ retval = ext2fs_unlink(e2fs, cwd, filename, newino, 0);
++ if (retval) {
++ fprintf(stderr, "%s: failed to unlink: %s\n", program, filename);
++ return retval;
++ }
++ }
++
++ /* Create new inode */
++ retval = ext2fs_new_inode(e2fs, cwd, 010755, 0, &newino);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to create inode for: %s\n",
++ program, filename);
++ return retval;
++ }
++
++ /* Link the inode and the filename */
++ retval = ext2fs_link(e2fs, cwd, filename, newino, EXT2_FT_REG_FILE);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to link inode for: %s.\n",
++ program, filename);
++ return retval;
++ }
++
++ if (ext2fs_test_inode_bitmap2(e2fs->inode_map, newino))
++ fprintf(stderr, "%s: warning: inode already set %s.\n",
++ program, filename);
++
++ ext2fs_inode_alloc_stats2(e2fs, newino, +1, 0);
++ memset(&inode, 0, sizeof(inode));
++ inode.i_mode = LINUX_S_IFREG | LINUX_S_IRUSR | LINUX_S_IRGRP
++ | LINUX_S_IROTH;
++ inode.i_flags |= i_flags;
++ inode.i_atime = inode.i_ctime = inode.i_mtime =
++ e2fs->now ? e2fs->now : time(0);
++ inode.i_links_count = 1;
++ if (e2fs->super->s_feature_incompat &
++ EXT3_FEATURE_INCOMPAT_EXTENTS) {
++ struct ext3_extent_header *eh;
++
++ eh = (struct ext3_extent_header *) &inode.i_block[0];
++ eh->eh_depth = 0;
++ eh->eh_entries = 0;
++ eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
++ i = (sizeof(inode.i_block) - sizeof(*eh)) /
++ sizeof(struct ext3_extent);
++ eh->eh_max = ext2fs_cpu_to_le16(i);
++ inode.i_flags |= EXT4_EXTENTS_FL;
++ }
++
++ retval = ext2fs_write_new_inode(e2fs, newino, &inode);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: while writting inode %d.\n",
++ program, newino);
++ return 1;
++ }
++
++ retval = ext2fs_file_open(e2fs, newino, EXT2_FILE_WRITE, &e2_file);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: failed to open %s.\n",
++ program, filename);
++ return 1;
++ }
++
++ /* Write to file */
++ if (ext_file_write(e2_file, str, length, 0) == -1)
++ goto fail;
++
++ if (strcmp(filename, "ldlinux.sys") == 0) {
++ /* Write ADV */
++ if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE,
++ boot_image_len) == -1)
++ goto fail;
++
++ /* Patch syslinux_bootsect */
++ syslinux_patch_bootsect(dev_fd);
++
++ /* Patch ldlinux.sys */
++ nsect = (boot_image_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
++ nsect += 2; /* Two sectors for the ADV */
++ sectors = alloca(sizeof(sector_t) * nsect);
++ memset(sectors, 0, nsect * sizeof *sectors);
++ /* The sectors will be modified and used by syslinux_patch() */
++ retval = ext_construct_sectmap_fs(e2fs, newino, sectors, nsect);
++ if (retval)
++ goto fail;
++
++ /* Create the modified image in memory */
++ modbytes = syslinux_patch(sectors, nsect, opt.stupid_mode,
++ opt.raid_mode, subdir, NULL);
++
++ /* Rewrite the first modbytes of ldlinux.sys */
++ if (ext_file_write(e2_file, str, modbytes, 0) == -1) {
++ fprintf(stderr, "%s: ERROR: failed to patch %s.\n", program,
++ filename);
++ goto fail;
++ }
++ }
++
++fail:
++ (void) ext2fs_file_close(e2_file);
++ return retval;
+ }
+
+ /* The install func for ext2, ext3 and ext4 */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
new file mode 100644
index 000000000..391381191
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
@@ -0,0 +1,84 @@
+From a95b831e18dd123f859bc5e6c4cecdcc0184ee37 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:18:02 +0800
+Subject: [PATCH 7/9] linux/syslinux: implement ext_construct_sectmap_fs()
+
+The ext_construct_sectmap_fs() constucts the sector according to the
+bmap.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index f0c97a8..c741750 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,10 +421,60 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+
++/* The file's block count */
++int block_count = 0;
++static int get_block_count(ext2_filsys fs EXT2FS_ATTR((unused)),
++ blk64_t *blocknr EXT2FS_ATTR((unused)),
++ e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
++ blk64_t ref_block EXT2FS_ATTR((unused)),
++ int ref_offset EXT2FS_ATTR((unused)),
++ void *private EXT2FS_ATTR((unused)))
++{
++ block_count++;
++ return 0;
++}
++
+ /* Construct the boot file map */
+ int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
+ sector_t *sectors, int nsect)
+ {
++ blk64_t pblk, blksize, blk = 0;
++ sector_t sec;
++ unsigned int i;
++ int retval;
++
++ blksize = fs->blocksize;
++ blksize >>= SECTOR_SHIFT;
++
++ /* Get the total blocks no. */
++ retval = ext2fs_block_iterate3(fs, newino, BLOCK_FLAG_READ_ONLY,
++ NULL, get_block_count, NULL);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: ext2fs_block_iterate3() failed.\n", program);
++ return -1;
++ }
++
++ while (nsect) {
++ if (block_count-- == 0)
++ break;
++
++ /* Get the physical block no. (bmap) */
++ retval = ext2fs_bmap2(fs, newino, 0, 0, 0, blk, 0, &pblk);
++ if (retval) {
++ fprintf(stderr, "%s: ERROR: ext2fs_bmap2() failed.\n", program);
++ return -1;
++ }
++
++ blk++;
++ sec = (sector_t)pblk * blksize;
++ for (i = 0; i < blksize; i++) {
++ *sectors++ = sec++;
++ if (! --nsect)
++ break;
++ }
++ }
++
++ return 0;
+ }
+
+ static int handle_adv_on_ext(void)
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
new file mode 100644
index 000000000..2400c98d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
@@ -0,0 +1,427 @@
+From 78d76b87a4b855e6b661ae457283a63f385c04c9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:26:46 +0800
+Subject: [PATCH 8/9] libinstaller/syslinuxext: implement
+ syslinux_patch_bootsect()
+
+Move the related from extlinux/main.c to libinstaller/syslinuxext.c, the
+syslinux_patch_bootsect() are used by both extlinux/main.c and
+linux/syslinux.c.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ extlinux/Makefile | 3 +-
+ extlinux/main.c | 167 +-------------------------------------------
+ libinstaller/syslinuxext.c | 170 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 175 insertions(+), 165 deletions(-)
+
+diff --git a/extlinux/Makefile b/extlinux/Makefile
+index 02d1db5..90dd92f 100644
+--- a/extlinux/Makefile
++++ b/extlinux/Makefile
+@@ -31,7 +31,8 @@ SRCS = main.c \
+ ../libinstaller/advio.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinuxc32_bin.c \
+- ../libinstaller/ldlinux_bin.c
++ ../libinstaller/ldlinux_bin.c \
++ ../libinstaller/syslinuxext.c
+ OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/extlinux/main.c b/extlinux/main.c
+index 09740bd..6fe026e 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -60,6 +60,7 @@
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
+ #include "mountinfo.h"
++#include "syslinuxext.h"
+
+ #ifdef DEBUG
+ # define dprintf printf
+@@ -67,10 +68,6 @@
+ # define dprintf(...) ((void)0)
+ #endif
+
+-#ifndef EXT2_SUPER_OFFSET
+-#define EXT2_SUPER_OFFSET 1024
+-#endif
+-
+ /* Since we have unused 2048 bytes in the primary AG of an XFS partition,
+ * we will use the first 0~512 bytes starting from 2048 for the Syslinux
+ * boot sector.
+@@ -92,136 +89,6 @@ static char subvol[BTRFS_SUBVOL_MAX];
+ - 2*ADV_SIZE)
+
+ /*
+- * Get the size of a block device
+- */
+-static uint64_t get_size(int devfd)
+-{
+- uint64_t bytes;
+- uint32_t sects;
+- struct stat st;
+-
+-#ifdef BLKGETSIZE64
+- if (!ioctl(devfd, BLKGETSIZE64, &bytes))
+- return bytes;
+-#endif
+- if (!ioctl(devfd, BLKGETSIZE, &sects))
+- return (uint64_t) sects << 9;
+- else if (!fstat(devfd, &st) && st.st_size)
+- return st.st_size;
+- else
+- return 0;
+-}
+-
+-/*
+- * Get device geometry and partition offset
+- */
+-struct geometry_table {
+- uint64_t bytes;
+- struct hd_geometry g;
+-};
+-
+-static int sysfs_get_offset(int devfd, unsigned long *start)
+-{
+- struct stat st;
+- char sysfs_name[128];
+- FILE *f;
+- int rv;
+-
+- if (fstat(devfd, &st))
+- return -1;
+-
+- if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
+- "/sys/dev/block/%u:%u/start",
+- major(st.st_rdev), minor(st.st_rdev))
+- >= sizeof sysfs_name)
+- return -1;
+-
+- f = fopen(sysfs_name, "r");
+- if (!f)
+- return -1;
+-
+- rv = fscanf(f, "%lu", start);
+- fclose(f);
+-
+- return (rv == 1) ? 0 : -1;
+-}
+-
+-/* Standard floppy disk geometries, plus LS-120. Zipdisk geometry
+- (x/64/32) is the final fallback. I don't know what LS-240 has
+- as its geometry, since I don't have one and don't know anyone that does,
+- and Google wasn't helpful... */
+-static const struct geometry_table standard_geometries[] = {
+- {360 * 1024, {2, 9, 40, 0}},
+- {720 * 1024, {2, 9, 80, 0}},
+- {1200 * 1024, {2, 15, 80, 0}},
+- {1440 * 1024, {2, 18, 80, 0}},
+- {1680 * 1024, {2, 21, 80, 0}},
+- {1722 * 1024, {2, 21, 80, 0}},
+- {2880 * 1024, {2, 36, 80, 0}},
+- {3840 * 1024, {2, 48, 80, 0}},
+- {123264 * 1024, {8, 32, 963, 0}}, /* LS120 */
+- {0, {0, 0, 0, 0}}
+-};
+-
+-int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
+-{
+- struct floppy_struct fd_str;
+- struct loop_info li;
+- struct loop_info64 li64;
+- const struct geometry_table *gp;
+- int rv = 0;
+-
+- memset(geo, 0, sizeof *geo);
+-
+- if (!ioctl(devfd, HDIO_GETGEO, geo)) {
+- goto ok;
+- } else if (!ioctl(devfd, FDGETPRM, &fd_str)) {
+- geo->heads = fd_str.head;
+- geo->sectors = fd_str.sect;
+- geo->cylinders = fd_str.track;
+- geo->start = 0;
+- goto ok;
+- }
+-
+- /* Didn't work. Let's see if this is one of the standard geometries */
+- for (gp = standard_geometries; gp->bytes; gp++) {
+- if (gp->bytes == totalbytes) {
+- memcpy(geo, &gp->g, sizeof *geo);
+- goto ok;
+- }
+- }
+-
+- /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
+- what zipdisks use, so this would help if someone has a USB key that
+- they're booting in USB-ZIP mode. */
+-
+- geo->heads = opt.heads ? : 64;
+- geo->sectors = opt.sectors ? : 32;
+- geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
+- geo->start = 0;
+-
+- if (!opt.sectors && !opt.heads) {
+- fprintf(stderr,
+- "Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
+- " (on hard disks, this is usually harmless.)\n",
+- geo->heads, geo->sectors);
+- rv = 1; /* Suboptimal result */
+- }
+-
+-ok:
+- /* If this is a loopback device, try to set the start */
+- if (!ioctl(devfd, LOOP_GET_STATUS64, &li64))
+- geo->start = li64.lo_offset >> SECTOR_SHIFT;
+- else if (!ioctl(devfd, LOOP_GET_STATUS, &li))
+- geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
+- else if (!sysfs_get_offset(devfd, &geo->start)) {
+- /* OK */
+- }
+-
+- return rv;
+-}
+-
+-/*
+ * Query the device geometry and put it into the boot sector.
+ * Map the file and put the map in the boot sector and file.
+ * Stick the "current directory" inode number into the file.
+@@ -231,11 +98,8 @@ ok:
+ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+ {
+ struct stat dirst, xdst;
+- struct hd_geometry geo;
+ sector_t *sectp;
+- uint64_t totalbytes, totalsectors;
+ int nsect;
+- struct fat_boot_sector *sbs;
+ char *dirpath, *subpath, *xdirpath;
+ int rv;
+
+@@ -279,33 +143,8 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+ /* Now subpath should contain the path relative to the fs base */
+ dprintf("subpath = %s\n", subpath);
+
+- totalbytes = get_size(devfd);
+- get_geometry(devfd, totalbytes, &geo);
+-
+- if (opt.heads)
+- geo.heads = opt.heads;
+- if (opt.sectors)
+- geo.sectors = opt.sectors;
+-
+- /* Patch this into a fake FAT superblock. This isn't because
+- FAT is a good format in any way, it's because it lets the
+- early bootstrap share code with the FAT version. */
+- dprintf("heads = %u, sect = %u\n", geo.heads, geo.sectors);
+-
+- sbs = (struct fat_boot_sector *)syslinux_bootsect;
+-
+- totalsectors = totalbytes >> SECTOR_SHIFT;
+- if (totalsectors >= 65536) {
+- set_16(&sbs->bsSectors, 0);
+- } else {
+- set_16(&sbs->bsSectors, totalsectors);
+- }
+- set_32(&sbs->bsHugeSectors, totalsectors);
+-
+- set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
+- set_16(&sbs->bsSecPerTrack, geo.sectors);
+- set_16(&sbs->bsHeads, geo.heads);
+- set_32(&sbs->bsHiddenSecs, geo.start);
++ /* Patch syslinux_bootsect */
++ syslinux_patch_bootsect(devfd);
+
+ /* Construct the boot file map */
+
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+index bb54cef..5a4423b 100644
+--- a/libinstaller/syslinuxext.c
++++ b/libinstaller/syslinuxext.c
+@@ -1,7 +1,177 @@
+ #define _GNU_SOURCE
+
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <getopt.h>
++#include <ext2fs/ext2fs.h>
++
++#include "linuxioctl.h"
++#include "syslinux.h"
++#include "syslxint.h"
++#include "syslxopt.h"
++
++/*
++ * Get the size of a block device
++ */
++static uint64_t get_size(int dev_fd)
++{
++ uint64_t bytes;
++ uint32_t sects;
++ struct stat st;
++
++#ifdef BLKGETSIZE64
++ if (!ioctl(dev_fd, BLKGETSIZE64, &bytes))
++ return bytes;
++#endif
++ if (!ioctl(dev_fd, BLKGETSIZE, &sects))
++ return (uint64_t) sects << 9;
++ else if (!fstat(dev_fd, &st) && st.st_size)
++ return st.st_size;
++ else
++ return 0;
++}
++
++/*
++ * Get device geometry and partition offset
++ */
++static struct geometry_table {
++ uint64_t bytes;
++ struct hd_geometry g;
++};
++
++static int sysfs_get_offset(int dev_fd, unsigned long *start)
++{
++ struct stat st;
++ char sysfs_name[128];
++ FILE *f;
++ int rv;
++
++ if (fstat(dev_fd, &st))
++ return -1;
++
++ if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
++ "/sys/dev/block/%u:%u/start",
++ major(st.st_rdev), minor(st.st_rdev))
++ >= sizeof sysfs_name)
++ return -1;
++
++ f = fopen(sysfs_name, "r");
++ if (!f)
++ return -1;
++
++ rv = fscanf(f, "%lu", start);
++ fclose(f);
++
++ return (rv == 1) ? 0 : -1;
++}
++
++/* Standard floppy disk geometries, plus LS-120. Zipdisk geometry
++ (x/64/32) is the final fallback. I don't know what LS-240 has
++ as its geometry, since I don't have one and don't know anyone that does,
++ and Google wasn't helpful... */
++static const struct geometry_table standard_geometries[] = {
++ {360 * 1024, {2, 9, 40, 0}},
++ {720 * 1024, {2, 9, 80, 0}},
++ {1200 * 1024, {2, 15, 80, 0}},
++ {1440 * 1024, {2, 18, 80, 0}},
++ {1680 * 1024, {2, 21, 80, 0}},
++ {1722 * 1024, {2, 21, 80, 0}},
++ {2880 * 1024, {2, 36, 80, 0}},
++ {3840 * 1024, {2, 48, 80, 0}},
++ {123264 * 1024, {8, 32, 963, 0}}, /* LS120 */
++ {0, {0, 0, 0, 0}}
++};
++
++static int get_geometry(int dev_fd, uint64_t totalbytes, struct hd_geometry *geo)
++{
++ struct floppy_struct fd_str;
++ struct loop_info li;
++ struct loop_info64 li64;
++ const struct geometry_table *gp;
++ int rv = 0;
++
++ memset(geo, 0, sizeof *geo);
++
++ if (!ioctl(dev_fd, HDIO_GETGEO, geo)) {
++ goto ok;
++ } else if (!ioctl(dev_fd, FDGETPRM, &fd_str)) {
++ geo->heads = fd_str.head;
++ geo->sectors = fd_str.sect;
++ geo->cylinders = fd_str.track;
++ geo->start = 0;
++ goto ok;
++ }
++
++ /* Didn't work. Let's see if this is one of the standard geometries */
++ for (gp = standard_geometries; gp->bytes; gp++) {
++ if (gp->bytes == totalbytes) {
++ memcpy(geo, &gp->g, sizeof *geo);
++ goto ok;
++ }
++ }
++
++ /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
++ what zipdisks use, so this would help if someone has a USB key that
++ they're booting in USB-ZIP mode. */
++
++ geo->heads = opt.heads ? : 64;
++ geo->sectors = opt.sectors ? : 32;
++ geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
++ geo->start = 0;
++
++ if (!opt.sectors && !opt.heads) {
++ fprintf(stderr,
++ "Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
++ " (on hard disks, this is usually harmless.)\n",
++ geo->heads, geo->sectors);
++ rv = 1; /* Suboptimal result */
++ }
++
++ok:
++ /* If this is a loopback device, try to set the start */
++ if (!ioctl(dev_fd, LOOP_GET_STATUS64, &li64))
++ geo->start = li64.lo_offset >> SECTOR_SHIFT;
++ else if (!ioctl(dev_fd, LOOP_GET_STATUS, &li))
++ geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
++ else if (!sysfs_get_offset(dev_fd, &geo->start)) {
++ /* OK */
++ }
++
++ return rv;
++}
++
++
+ /* Patch syslinux_bootsect */
+ void syslinux_patch_bootsect(int dev_fd)
+ {
++ uint64_t totalbytes, totalsectors;
++ struct hd_geometry geo;
++ struct fat_boot_sector *sbs;
++
++ totalbytes = get_size(dev_fd);
++ get_geometry(dev_fd, totalbytes, &geo);
++
++ if (opt.heads)
++ geo.heads = opt.heads;
++ if (opt.sectors)
++ geo.sectors = opt.sectors;
++
++ /* Patch this into a fake FAT superblock. This isn't because
++ FAT is a good format in any way, it's because it lets the
++ early bootstrap share code with the FAT version. */
++ sbs = (struct fat_boot_sector *)syslinux_bootsect;
++
++ totalsectors = totalbytes >> SECTOR_SHIFT;
++ if (totalsectors >= 65536) {
++ set_16(&sbs->bsSectors, 0);
++ } else {
++ set_16(&sbs->bsSectors, totalsectors);
++ }
++ set_32(&sbs->bsHugeSectors, totalsectors);
++
++ set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
++ set_16(&sbs->bsSecPerTrack, geo.sectors);
++ set_16(&sbs->bsHeads, geo.heads);
++ set_32(&sbs->bsHiddenSecs, geo.start);
+ }
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
new file mode 100644
index 000000000..cd89d9248
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
@@ -0,0 +1,50 @@
+From 76c465e87312dbc6cffd05427f1f4d2ebdee4f13 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:28:35 +0800
+Subject: [PATCH 9/9] linux/syslinux: implement install_bootblock()
+
+Refer to the install_bootblock() in extlinux/main.c to make
+linux/syslinux.c's install_bootblock() which only supports ext2/3/4.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index c741750..917f83a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -419,6 +419,26 @@ static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
+ */
+ int install_bootblock(int fd, const char *device)
+ {
++ struct ext2_super_block sb;
++
++ if (xpread(fd, &sb, sizeof sb, EXT2_SUPER_OFFSET + opt.offset) != sizeof sb) {
++ perror("reading superblock");
++ return 1;
++ }
++
++ if (sb.s_magic != EXT2_SUPER_MAGIC) {
++ fprintf(stderr,
++ "no ext2/3/4 superblock found on %s\n", device);
++ return 1;
++ }
++
++ if (xpwrite(fd, syslinux_bootsect, syslinux_bootsect_len, 0)
++ != (signed)syslinux_bootsect_len) {
++ perror("writing bootblock");
++ return 1;
++ }
++
++ return 0;
+ }
+
+ /* The file's block count */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch
new file mode 100644
index 000000000..6279258c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0010-gcc46-compatibility.patch
@@ -0,0 +1,37 @@
+don't break with old compilers and -DGNU_EFI_USE_MS_ABI
+It's entirely legitimate to request GNU_EFI_USE_MS_ABI even if the current
+compiler doesn't support it, and gnu-efi should transparently fall back to
+using legacy techniques to set the calling convention. We don't get type
+checking, but at least it will still compile.
+
+Adapted from gnu-efi
+
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Upstream-Status: Pending
+
+Index: syslinux-6.03/efi64/include/efi/x86_64/efibind.h
+===================================================================
+--- syslinux-6.03.orig/efi64/include/efi/x86_64/efibind.h
++++ syslinux-6.03/efi64/include/efi/x86_64/efibind.h
+@@ -25,8 +25,6 @@ Revision History
+ #if defined(GNU_EFI_USE_MS_ABI)
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+ #define HAVE_USE_MS_ABI 1
+- #else
+- #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+ #endif
+
+Index: syslinux-6.03/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
+===================================================================
+--- syslinux-6.03.orig/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
++++ syslinux-6.03/gnu-efi/gnu-efi-3.0/inc/x86_64/efibind.h
+@@ -25,8 +25,6 @@ Revision History
+ #if defined(GNU_EFI_USE_MS_ABI)
+ #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+ #define HAVE_USE_MS_ABI 1
+- #else
+- #error Compiler is too old for GNU_EFI_USE_MS_ABI
+ #endif
+ #endif
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch b/poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch
new file mode 100644
index 000000000..443c1ccc5
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/0011-mk-MMD-does-not-take-any-arguments.patch
@@ -0,0 +1,33 @@
+From 0f3d83c25491951f1fa84c7957358ef3d1bcd8a9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Sep 2015 17:39:22 +0000
+Subject: [PATCH] mk: -MMD does not take any arguments
+
+Specify -Wp for each option, clang seems to not accept
+-Wp,-x,y,-a,b
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mk/syslinux.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: syslinux-6.03/mk/syslinux.mk
+===================================================================
+--- syslinux-6.03.orig/mk/syslinux.mk
++++ syslinux-6.03/mk/syslinux.mk
+@@ -82,11 +82,11 @@ ARCH ?= $(strip $(SUBARCH))
+ GCCWARN = -W -Wall -Wstrict-prototypes $(DEBUGOPT)
+
+ # Common stanza to make gcc generate .*.d dependency files
+-MAKEDEPS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
++MAKEDEPS = -MT $@ -MD
+
+ # Dependencies that exclude system headers; use whenever we use
+ # header files from the platform.
+-UMAKEDEPS = -Wp,-MT,$@,-MMD,$(dir $@).$(notdir $@).d
++UMAKEDEPS = -MT $@ -MMD
+
+ # Items that are only appropriate during development; this file is
+ # removed when tarballs are generated.
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch
new file mode 100644
index 000000000..3ce46da10
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-6.03-sysmacros.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/579928
+
+From d84db34dbe39d55b4d7e868764c056689aa0793b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 19 Apr 2016 01:56:41 -0400
+Subject: [PATCH] extlinux: pull in sys/sysmacros.h for major/minor/makedev
+
+These functions are defined in sys/sysmacros.h, so add the include to
+main.c. This is already handled correctly in mountinfo.c. Otherwise
+we get build failures like:
+
+main.o: In function 'find_device_sysfs':
+extlinux/main.c:1131: undefined reference to 'minor'
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+The first part wasn't enough in OE build, I had to add the same for syslinuxext.c.
+---
+ extlinux/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/extlinux/main.c b/extlinux/main.c
+index a7ebd49..ebff7ea 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -38,6 +38,7 @@
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/vfs.h>
+--- a/libinstaller/syslinuxext.c 2017-02-22 20:17:05.336869181 +0100
++++ b/libinstaller/syslinuxext.c 2017-02-22 20:16:47.500868751 +0100
+@@ -2,6 +2,7 @@
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <getopt.h>
+ #include <ext2fs/ext2fs.h>
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
new file mode 100644
index 000000000..312b1e8ae
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
@@ -0,0 +1,35 @@
+syslinux-native: fix parallel building issue
+
+There might be an error when parallel build:
+
+[snip]
+cp: cannot create directory `tmp/sysroots/x86_64-linux/usr/share/
+syslinux/com32/include/gplinclude': No such file or directory
+make[4]: *** [install] Error 1
+make[3]: *** [gpllib] Error 2
+[snip]
+
+This is a potential issue. In ${S}/com32/gpllib/Makefile file,
+install target wants to copy $(SRC)/../gplinclude to
+$(INSTALLROOT)$(COM32DIR)/include/ directory, but in ${S}/com32/lib/Makefile
+file, the install target will remove $(INSTALLROOT)$(COM32DIR)/include
+directory. We need to do com32/lib first.
+
+The patch make com32/gpllib depends on com32/lib to fix this issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ com32/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: syslinux-6.03/com32/Makefile
+===================================================================
+--- syslinux-6.03.orig/com32/Makefile
++++ syslinux-6.03/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: lib libutil libupload gpllib
+ lua/src: cmenu modules
++gpllib: lib
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
new file mode 100644
index 000000000..6ba96aeb5
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
@@ -0,0 +1,31 @@
+From 490fc3bbd65c2c252c1fdf3da0fac9898aa9eea6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 15 Aug 2014 21:09:16 -0700
+Subject: [PATCH] com32/Makefile: fix parallel issue
+
+Fixed:
+cp -r syslinux-6.01/com32/libupload/*.h image/usr/share/syslinux/com32/include/
+[snip]
+rm -rf image/usr/share/syslinux/com32/include
+[snip]
+cp: cannot create regular file `image/usr/share/syslinux/com32/include/serial.h': No such file or directory
+
+The cp is happened in the "libupload" dir, while "rm -fr" is happend in
+"lib" dir, let "libupload" depend "lib" will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ com32/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: syslinux-6.03/com32/Makefile
+===================================================================
+--- syslinux-6.03.orig/com32/Makefile
++++ syslinux-6.03/com32/Makefile
+@@ -22,3 +22,4 @@ samples: libutil elflink/ldlinux
+ sysdump: lib libutil libupload gpllib
+ lua/src: cmenu modules
+ gpllib: lib
++libupload: lib
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
new file mode 100644
index 000000000..7c003e165
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
@@ -0,0 +1,17 @@
+This script try to call git submodule, since we are downloading
+the tarball it seems in-correct to do this.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: syslinux-6.03/efi/Makefile
+===================================================================
+--- syslinux-6.03.orig/efi/Makefile
++++ syslinux-6.03/efi/Makefile
+@@ -101,7 +101,6 @@ tidy dist:
+ rm -f *.so *.o wrapper
+ find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
+ xargs -0r rm -f
+- $(topdir)/efi/clean-gnu-efi.sh $(EFI_SUBARCH) $(objdir)
+
+ clean: tidy
+
diff --git a/poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb b/poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
new file mode 100644
index 000000000..f8b109409
--- /dev/null
+++ b/poky/meta/recipes-devtools/syslinux/syslinux_6.03.bb
@@ -0,0 +1,90 @@
+SUMMARY = "Multi-purpose linux bootloader"
+HOMEPAGE = "http://www.syslinux.org/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a"
+
+# If you really want to run syslinux, you need mtools. We just want the
+# ldlinux.* stuff for now, so skip mtools-native
+DEPENDS = "nasm-native util-linux e2fsprogs"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/syslinux-${PV}.tar.xz \
+ file://syslinux-fix-parallel-building-issue.patch \
+ file://syslinux-libupload-depend-lib.patch \
+ file://syslinux-remove-clean-script.patch \
+ file://0001-linux-syslinux-support-ext2-3-4-device.patch \
+ file://0002-linux-syslinux-implement-open_ext2_fs.patch \
+ file://0003-linux-syslinux-implement-install_to_ext2.patch \
+ file://0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch \
+ file://0005-linux-syslinux-implement-handle_adv_on_ext.patch \
+ file://0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch \
+ file://0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch \
+ file://0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch \
+ file://0009-linux-syslinux-implement-install_bootblock.patch \
+ file://0010-gcc46-compatibility.patch \
+ file://0011-mk-MMD-does-not-take-any-arguments.patch \
+ file://syslinux-6.03-sysmacros.patch \
+ "
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+# Don't let the sanity checker trip on the 32 bit real mode BIOS binaries
+INSANE_SKIP_${PN}-misc = "arch"
+INSANE_SKIP_${PN}-chain = "arch"
+
+EXTRA_OEMAKE = " \
+ BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
+ DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \
+"
+
+do_configure() {
+ # drop win32 targets or build fails
+ sed -e 's,win32/\S*,,g' -i Makefile
+
+ # clean installer executables included in source tarball
+ oe_runmake clean firmware="efi32" EFIINC="${includedir}"
+ # NOTE: There is a temporary work around above to specify
+ # the efi32 as the firmware else the pre-built bios
+ # files get erased contrary to the doc/distib.txt
+ # In the future this should be "bios" and not "efi32".
+}
+
+do_compile() {
+ # Make sure the recompile is OK.
+ # Though the ${B} should always exist, still check it before find and rm.
+ [ -d "${B}" ] && find ${B} -name '.*.d' -type f -exec rm -f {} \;
+
+ # Rebuild only the installer; keep precompiled bootloaders
+ # as per author's request (doc/distrib.txt)
+ oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" LDFLAGS="${LDFLAGS}" firmware="bios" installer
+}
+
+do_install() {
+ oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" install INSTALLROOT="${D}" firmware="bios"
+
+ install -d ${D}${datadir}/syslinux/
+ install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/
+ install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/
+ install -m 755 ${S}/bios/linux/syslinux-nomtools ${D}${bindir}/
+}
+
+PACKAGES += "${PN}-nomtools ${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
+
+RDEPENDS_${PN} += "mtools"
+RDEPENDS_${PN}-nomtools += "libext2fs"
+RDEPENDS_${PN}-misc += "perl"
+
+FILES_${PN} = "${bindir}/syslinux"
+FILES_${PN}-nomtools = "${bindir}/syslinux-nomtools"
+FILES_${PN}-extlinux = "${sbindir}/extlinux"
+FILES_${PN}-mbr = "${datadir}/${BPN}/mbr.bin"
+FILES_${PN}-chain = "${datadir}/${BPN}/chain.c32"
+FILES_${PN}-isolinux = "${datadir}/${BPN}/isolinux.bin"
+FILES_${PN}-pxelinux = "${datadir}/${BPN}/pxelinux.0"
+FILES_${PN}-dev += "${datadir}/${BPN}/com32/lib*${SOLIBS} ${datadir}/${BPN}/com32/include ${datadir}/${BPN}/com32/com32.ld"
+FILES_${PN}-staticdev += "${datadir}/${BPN}/com32/lib*.a ${libdir}/${BPN}/com32/lib*.a"
+FILES_${PN}-misc = "${datadir}/${BPN}/* ${libdir}/${BPN}/* ${bindir}/*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
new file mode 100644
index 000000000..f392ceafc
--- /dev/null
+++ b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
@@ -0,0 +1,36 @@
+From 45b401a947af944c20b3c451a35dfe53bca5ef3b Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Thu, 28 Dec 2017 21:24:57 -0800
+Subject: [PATCH 1/3] comparison_fn_t is glibc specific, use raw signature in
+ function pointer
+
+Make it work with musl where comparison_fn_t is not provided
+
+Reuse the approach from systemd:
+systemd/0013-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
+
+Based on work by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+---
+Upstream-Status: Pending
+
+ src/util.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util.h b/src/util.h
+index 561f9e7..e9cfd81 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -57,7 +57,7 @@ extern char **saved_argv;
+ * Normal qsort requires base to be nonnull. Here were require
+ * that only if nmemb > 0.
+ */
+-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
++static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+ if (nmemb <= 1)
+ return;
+
+--
+2.13.6
+
diff --git a/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch
new file mode 100644
index 000000000..196272f7a
--- /dev/null
+++ b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0002-musl-does-not-provide-printf-h.patch
@@ -0,0 +1,423 @@
+From 6f9454184a02310802b1ed3e40287958b524a495 Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Thu, 28 Dec 2017 21:39:51 -0800
+Subject: [PATCH 2/3] musl does not provide printf.h
+
+Reuse the approach from systemd:
+systemd/0001-add-fallback-parse_printf_format-implementation.patch
+
+Original patch author: Emil Renner Berthing <systemd@esmil.dk>
+Includes work by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+---
+Upstream-Status: Pending
+
+ Makefile.am | 4 +
+ configure.ac | 3 +
+ src/log.c | 1 +
+ src/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/parse-printf-format.h | 57 ++++++++++
+ src/stdio-util.h | 1 -
+ 6 files changed, 338 insertions(+), 1 deletion(-)
+ create mode 100644 src/parse-printf-format.c
+ create mode 100644 src/parse-printf-format.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 9bbc8fa..b887d16 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -169,6 +169,10 @@ libutils_la_SOURCES = \
+ src/util.c \
+ src/util.h
+
++if !HAVE_PRINTF_H
++libutils_la_SOURCES += src/parse-printf-format.c
++endif
++
+ libutils_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(LIBSYSTEMD_CFLAGS)
+diff --git a/configure.ac b/configure.ac
+index 7f74bac..062e310 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,9 @@ AS_IF([test "x$with_libsystemd" != xno],
+ )]
+ )
+
++AC_CHECK_HEADERS([printf.h], [], [])
++AM_CONDITIONAL(HAVE_PRINTF_H, [test "x$ac_cv_header_print_h" = xyes])
++
+ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+ -pipe \
+ -Wall \
+diff --git a/src/log.c b/src/log.c
+index 15dec83..aecf231 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -28,6 +28,7 @@
+ #include <sys/uio.h>
+ #include <unistd.h>
+
++#include "parse-printf-format.h"
+ #include "sd-messages.h"
+
+ #include "fd-util.h"
+diff --git a/src/parse-printf-format.c b/src/parse-printf-format.c
+new file mode 100644
+index 0000000..49437e5
+--- /dev/null
++++ b/src/parse-printf-format.c
+@@ -0,0 +1,273 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the musl C library
++ Copyright 2005-2014 Rich Felker, et al.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#include <stddef.h>
++#include <string.h>
++
++#include "parse-printf-format.h"
++
++static const char *consume_nonarg(const char *fmt)
++{
++ do {
++ if (*fmt == '\0')
++ return fmt;
++ } while (*fmt++ != '%');
++ return fmt;
++}
++
++static const char *consume_num(const char *fmt)
++{
++ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
++ /* do nothing */;
++ return fmt;
++}
++
++static const char *consume_argn(const char *fmt, size_t *arg)
++{
++ const char *p = fmt;
++ size_t val = 0;
++
++ if (*p < '1' || *p > '9')
++ return fmt;
++ do {
++ val = 10*val + (*p++ - '0');
++ } while (*p >= '0' && *p <= '9');
++
++ if (*p != '$')
++ return fmt;
++ *arg = val;
++ return p+1;
++}
++
++static const char *consume_flags(const char *fmt)
++{
++ while (1) {
++ switch (*fmt) {
++ case '#':
++ case '0':
++ case '-':
++ case ' ':
++ case '+':
++ case '\'':
++ case 'I':
++ fmt++;
++ continue;
++ }
++ return fmt;
++ }
++}
++
++enum state {
++ BARE,
++ LPRE,
++ LLPRE,
++ HPRE,
++ HHPRE,
++ BIGLPRE,
++ ZTPRE,
++ JPRE,
++ STOP
++};
++
++enum type {
++ NONE,
++ PTR,
++ INT,
++ UINT,
++ ULLONG,
++ LONG,
++ ULONG,
++ SHORT,
++ USHORT,
++ CHAR,
++ UCHAR,
++ LLONG,
++ SIZET,
++ IMAX,
++ UMAX,
++ PDIFF,
++ UIPTR,
++ DBL,
++ LDBL,
++ MAXTYPE
++};
++
++static const short pa_types[MAXTYPE] = {
++ [NONE] = PA_INT,
++ [PTR] = PA_POINTER,
++ [INT] = PA_INT,
++ [UINT] = PA_INT,
++ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [LONG] = PA_INT | PA_FLAG_LONG,
++ [ULONG] = PA_INT | PA_FLAG_LONG,
++ [SHORT] = PA_INT | PA_FLAG_SHORT,
++ [USHORT] = PA_INT | PA_FLAG_SHORT,
++ [CHAR] = PA_CHAR,
++ [UCHAR] = PA_CHAR,
++ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [SIZET] = PA_INT | PA_FLAG_LONG,
++ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
++ [UIPTR] = PA_INT | PA_FLAG_LONG,
++ [DBL] = PA_DOUBLE,
++ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
++};
++
++#define S(x) [(x)-'A']
++#define E(x) (STOP + (x))
++
++static const unsigned char states[]['z'-'A'+1] = {
++ { /* 0: bare types */
++ S('d') = E(INT), S('i') = E(INT),
++ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(CHAR),S('C') = E(INT),
++ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
++ S('m') = E(NONE),
++ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
++ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
++ }, { /* 1: l-prefixed */
++ S('d') = E(LONG), S('i') = E(LONG),
++ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
++ S('l') = LLPRE
++ }, { /* 2: ll-prefixed */
++ S('d') = E(LLONG), S('i') = E(LLONG),
++ S('o') = E(ULLONG),S('u') = E(ULLONG),
++ S('x') = E(ULLONG),S('X') = E(ULLONG),
++ S('n') = E(PTR)
++ }, { /* 3: h-prefixed */
++ S('d') = E(SHORT), S('i') = E(SHORT),
++ S('o') = E(USHORT),S('u') = E(USHORT),
++ S('x') = E(USHORT),S('X') = E(USHORT),
++ S('n') = E(PTR),
++ S('h') = HHPRE
++ }, { /* 4: hh-prefixed */
++ S('d') = E(CHAR), S('i') = E(CHAR),
++ S('o') = E(UCHAR),S('u') = E(UCHAR),
++ S('x') = E(UCHAR),S('X') = E(UCHAR),
++ S('n') = E(PTR)
++ }, { /* 5: L-prefixed */
++ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
++ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
++ S('n') = E(PTR)
++ }, { /* 6: z- or t-prefixed (assumed to be same size) */
++ S('d') = E(PDIFF),S('i') = E(PDIFF),
++ S('o') = E(SIZET),S('u') = E(SIZET),
++ S('x') = E(SIZET),S('X') = E(SIZET),
++ S('n') = E(PTR)
++ }, { /* 7: j-prefixed */
++ S('d') = E(IMAX), S('i') = E(IMAX),
++ S('o') = E(UMAX), S('u') = E(UMAX),
++ S('x') = E(UMAX), S('X') = E(UMAX),
++ S('n') = E(PTR)
++ }
++};
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types)
++{
++ size_t i = 0;
++ size_t last = 0;
++
++ memset(types, 0, n);
++
++ while (1) {
++ size_t arg;
++ unsigned int state;
++
++ fmt = consume_nonarg(fmt);
++ if (*fmt == '\0')
++ break;
++ if (*fmt == '%') {
++ fmt++;
++ continue;
++ }
++ arg = 0;
++ fmt = consume_argn(fmt, &arg);
++ /* flags */
++ fmt = consume_flags(fmt);
++ /* width */
++ if (*fmt == '*') {
++ size_t warg = 0;
++ fmt = consume_argn(fmt+1, &warg);
++ if (warg == 0)
++ warg = ++i;
++ if (warg > last)
++ last = warg;
++ if (warg <= n && types[warg-1] == NONE)
++ types[warg-1] = INT;
++ } else
++ fmt = consume_num(fmt);
++ /* precision */
++ if (*fmt == '.') {
++ fmt++;
++ if (*fmt == '*') {
++ size_t parg = 0;
++ fmt = consume_argn(fmt+1, &parg);
++ if (parg == 0)
++ parg = ++i;
++ if (parg > last)
++ last = parg;
++ if (parg <= n && types[parg-1] == NONE)
++ types[parg-1] = INT;
++ } else {
++ if (*fmt == '-')
++ fmt++;
++ fmt = consume_num(fmt);
++ }
++ }
++ /* length modifier and conversion specifier */
++ state = BARE;
++ do {
++ unsigned char c = *fmt++;
++
++ if (c < 'A' || c > 'z')
++ continue;
++ state = states[state]S(c);
++ if (state == 0)
++ continue;
++ } while (state < STOP);
++
++ if (state == E(NONE))
++ continue;
++
++ if (arg == 0)
++ arg = ++i;
++ if (arg > last)
++ last = arg;
++ if (arg <= n)
++ types[arg-1] = state - STOP;
++ }
++
++ if (last > n)
++ last = n;
++ for (i = 0; i < last; i++)
++ types[i] = pa_types[types[i]];
++
++ return last;
++}
+diff --git a/src/parse-printf-format.h b/src/parse-printf-format.h
+new file mode 100644
+index 0000000..4371177
+--- /dev/null
++++ b/src/parse-printf-format.h
+@@ -0,0 +1,57 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the GNU C Library
++ Copyright 1991-2014 Free Software Foundation, Inc.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#pragma once
++
++#include "config.h"
++
++#ifdef HAVE_PRINTF_H
++#include <printf.h>
++#else
++
++#include <stddef.h>
++
++enum { /* C type: */
++ PA_INT, /* int */
++ PA_CHAR, /* int, cast to char */
++ PA_WCHAR, /* wide char */
++ PA_STRING, /* const char *, a '\0'-terminated string */
++ PA_WSTRING, /* const wchar_t *, wide character string */
++ PA_POINTER, /* void * */
++ PA_FLOAT, /* float */
++ PA_DOUBLE, /* double */
++ PA_LAST
++};
++
++/* Flag bits that can be set in a type returned by `parse_printf_format'. */
++#define PA_FLAG_MASK 0xff00
++#define PA_FLAG_LONG_LONG (1 << 8)
++#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
++#define PA_FLAG_LONG (1 << 9)
++#define PA_FLAG_SHORT (1 << 10)
++#define PA_FLAG_PTR (1 << 11)
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types);
++
++#endif /* HAVE_PRINTF_H */
+diff --git a/src/stdio-util.h b/src/stdio-util.h
+index 0a67557..21cc515 100644
+--- a/src/stdio-util.h
++++ b/src/stdio-util.h
+@@ -19,7 +19,6 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#include <printf.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+--
+2.13.6
+
diff --git a/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch
new file mode 100644
index 000000000..7670d95f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0003-musl-does-not-provide-canonicalize_file_name.patch
@@ -0,0 +1,33 @@
+From 79396449d264bde58b4daa3ef6dd99f0f0652429 Mon Sep 17 00:00:00 2001
+From: Tim Orling <timothy.t.orling@linux.intel.com>
+Date: Thu, 28 Dec 2017 22:10:58 -0800
+Subject: [PATCH 3/3] musl does not provide canonicalize_file_name
+
+Reuse the approach from systemd:
+systemd/0007-check-for-missing-canonicalize_file_name.patch
+
+Based on work by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
+---
+Upstream-Status: Pending
+
+ src/path-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/path-util.c b/src/path-util.c
+index 2fb6366..12e2e17 100644
+--- a/src/path-util.c
++++ b/src/path-util.c
+@@ -63,7 +63,7 @@ char **path_strv_resolve(char **l, const char *prefix) {
+ t = *s;
+
+ errno = 0;
+- u = canonicalize_file_name(t);
++ u = realpath(t, NULL);
+ if (!u) {
+ if (errno == ENOENT) {
+ if (prefix) {
+--
+2.13.6
+
diff --git a/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb
new file mode 100644
index 000000000..1ae21b1fb
--- /dev/null
+++ b/poky/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_233.bb
@@ -0,0 +1,37 @@
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
+ file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https \
+"
+
+SRC_URI_append_libc-musl = " \
+ file://0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
+ file://0002-musl-does-not-provide-printf-h.patch \
+ file://0003-musl-does-not-provide-canonicalize_file_name.patch \
+ "
+
+
+# Modify these as desired
+PV = "233+git${SRCPV}"
+SRCREV = "fe1c5e41e6bdb78043dad8fa863fc2df66d1dadf"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "systemd libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native intltool"
+
+inherit pkgconfig autotools systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SYSTEMD_SERVICE_${PN} = "systemd-bootchart.service"
+
+do_configure_prepend() {
+ # intltool.m4 is a soft link to /usr/share/aclocal/m4, delete it and use the one in our sysroot
+ rm -f ${S}/m4/intltool.m4
+}
+
+FILES_${PN} += "${systemd_unitdir}/systemd-bootchart"
+
+EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
+ --with-rootlibdir=${base_libdir}"
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
new file mode 100644
index 000000000..5f93c46f2
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/0001-canonicalize_file_name-is-specific-to-glibc.patch
@@ -0,0 +1,46 @@
+From 23a3759b74d081b3b2849b0d37a0e5219f37813e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 22:37:48 +0000
+Subject: [PATCH] canonicalize_file_name is specific to glibc
+
+When on Linux and not using glibc then we need to define
+canonicalize_file_name() API, therefore add a check for finding out if
+its not glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ agent/tcf/framework/mdep.c | 2 +-
+ agent/tcf/framework/mdep.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/agent/tcf/framework/mdep.c b/agent/tcf/framework/mdep.c
+index 2b52ca8..7d09655 100644
+--- a/agent/tcf/framework/mdep.c
++++ b/agent/tcf/framework/mdep.c
+@@ -1042,7 +1042,7 @@ char * canonicalize_file_name(const char * path) {
+ return strdup(res);
+ }
+
+-#elif defined(__UCLIBC__)
++#elif defined(__UCLIBC__) || !defined(__GLIBC__)
+
+ char * canonicalize_file_name(const char * path) {
+ return realpath(path, NULL);
+diff --git a/agent/tcf/framework/mdep.h b/agent/tcf/framework/mdep.h
+index 1e718a2..187c399 100644
+--- a/agent/tcf/framework/mdep.h
++++ b/agent/tcf/framework/mdep.h
+@@ -276,7 +276,7 @@ extern int loc_clock_gettime(int, struct timespec *);
+
+ #define O_BINARY 0
+
+-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || !defined(__GLIBC__)
+ # define O_LARGEFILE 0
+ extern char ** environ;
+ extern char * canonicalize_file_name(const char * path);
+--
+2.7.0
+
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
new file mode 100644
index 000000000..b66f41ad2
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Inappropriate [poky-specific fix]
+
+Index: agent/Makefile.inc
+===================================================================
+--- agent.orig/Makefile.inc
++++ agent/Makefile.inc
+@@ -88,6 +88,9 @@ ifneq ($(OPSYS),Windows)
+ ifneq ($(CC),g++)
+ OPTS += -Wmissing-prototypes
+ endif
++ ifneq ($(RANLIB),)
++ RANLIB += $@
++ endif
+ endif
+
+ # Compiler flags definition
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch
new file mode 100644
index 000000000..c03c55d22
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/ldflags.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+From d92af0483c20365fd0af740d0baef8870b4aa374 Mon Sep 17 00:00:00 2001
+From: Abdur Rehman <abdur_rehman@mentor.com>
+Date: Wed, 26 Aug 2015 19:18:11 +0500
+Subject: [PATCH] tcf-agent: obey LDFLAGS
+
+Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
+---
+ Makefile.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.inc b/Makefile.inc
+index 959028f..3148942 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -96,7 +96,7 @@ NO_LINK_F ?= -c
+ # Linker definition and flags
+
+ LINK ?= $(CC)
+-LINK_FLAGS ?= $(CFLAGS)
++LINK_FLAGS ?= $(LDFLAGS) $(CFLAGS)
+ LINK_OUT_F ?= $(OUT_OBJ_F)
+
+ # Archiver definition and flags
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
new file mode 100755
index 000000000..f90208555
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -0,0 +1,65 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: tcf-agent
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Target Communication Framework agent
+### END INIT INFO
+
+DAEMON_PATH=/usr/sbin/tcf-agent
+DAEMON_NAME=`basename $DAEMON_PATH`
+
+. /etc/init.d/functions
+
+test -x $DAEMON_PATH || exit 0
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+
+RETVAL=0
+
+case "$1" in
+ start)
+ echo -n "Starting $DAEMON_NAME: "
+ $DAEMON_PATH -d -L- -l0
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ touch /var/lock/subsys/$DAEMON_NAME
+ else
+ echo "FAIL"
+ fi
+ ;;
+
+ stop)
+ echo -n "Stopping $DAEMON_NAME: "
+ start-stop-daemon -K -q -x $DAEMON_PATH -s USR2
+ rm -f /var/lock/subsys/$DAEMON_NAME
+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+ echo "FAIL"
+ else
+ echo "OK"
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ status $DAEMON_NAME
+ RETVAL=$?
+ ;;
+
+ condrestart)
+ [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | status | restart | condrestart | status }"
+ ;;
+esac
+
+exit $RETVAL
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
new file mode 100644
index 000000000..a486ac7ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Target Communication Framework agent
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+KillSignal=USR2
+SuccessExitStatus=USR2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
new file mode 100644
index 000000000..ba14c4269
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
@@ -0,0 +1,58 @@
+SUMMARY = "Target Communication Framework for the Eclipse IDE"
+HOMEPAGE = "http://wiki.eclipse.org/TCF"
+BUGTRACKER = "https://bugs.eclipse.org/bugs/"
+
+LICENSE = "EPL-1.0 | EDL-1.0"
+LIC_FILES_CHKSUM = "file://edl-v10.html;md5=522a390a83dc186513f0500543ad3679"
+
+SRCREV = "2dddd5f440a15d5406032fac20f206484513646f"
+PV = "1.4.0+git${SRCPV}"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent;branch=1.4_neon_bugfix \
+ file://fix_ranlib.patch \
+ file://ldflags.patch \
+ file://0001-canonicalize_file_name-is-specific-to-glibc.patch;striplevel=2 \
+ file://tcf-agent.init \
+ file://tcf-agent.service \
+ "
+
+DEPENDS = "util-linux openssl"
+RDEPENDS_${PN} = "bash"
+
+S = "${WORKDIR}/git/agent"
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "tcf-agent.service"
+
+INITSCRIPT_NAME = "tcf-agent"
+INITSCRIPT_PARAMS = "start 99 3 5 . stop 20 0 1 2 6 ."
+
+# mangling needed for make
+MAKE_ARCH = "`echo ${TARGET_ARCH} | sed s,i.86,i686, | sed s,aarch64.*,a64,`"
+MAKE_OS = "`echo ${TARGET_OS} | sed s,^linux.*,GNU/Linux,`"
+
+EXTRA_OEMAKE = "MACHINE=${MAKE_ARCH} OPSYS=${MAKE_OS} 'CC=${CC}' 'AR=${AR}'"
+
+LCL_STOP_SERVICES = "-DSERVICE_RunControl=0 -DSERVICE_Breakpoints=0 \
+ -DSERVICE_Memory=0 -DSERVICE_Registers=0 -DSERVICE_MemoryMap=0 \
+ -DSERVICE_StackTrace=0 -DSERVICE_Expressions=0"
+
+
+# These features don't compile for several cases.
+#
+CFLAGS_append_mips = " ${LCL_STOP_SERVICES}"
+CFLAGS_append_mips64 = " ${LCL_STOP_SERVICES}"
+CFLAGS_append_libc-musl = " ${LCL_STOP_SERVICES}"
+CFLAGS_append_powerpc64 = " ${LCL_STOP_SERVICES}"
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D}
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tcf-agent.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tcf-agent.service
+}
+
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch b/poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
new file mode 100644
index 000000000..c8530e1f5
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
@@ -0,0 +1,76 @@
+Lets install the include header and private header files into
+usr/include/tcl8.6 when version of tcl is 8.6.x
+
+Upstream-Status: Inappropriate [Configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmai.com>
+
+Fixed the TCL_INCLUDE_SPEC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in | 2 +-
+ configure | 4 ++--
+ configure.in | 4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 97b983b..dc2a4df 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -53,7 +53,7 @@ DLL_INSTALL_DIR = @DLL_INSTALL_DIR@
+ SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TCL_LIBRARY)
+
+ # Directory in which to install the include file tcl.h:
+-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)
++INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)/tcl$(VERSION)
+
+ # Path to the private tcl header dir:
+ PRIVATE_INCLUDE_DIR = @PRIVATE_INCLUDE_DIR@
+diff --git a/configure b/configure
+index 3e78b49..24b3f92 100755
+--- a/configure
++++ b/configure
+@@ -19134,7 +19134,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+
+ # Note: in the following variable, it's important to use the absolute
+@@ -19293,7 +19293,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+diff --git a/configure.in b/configure.in
+index 0e28b14..62d9b41 100755
+--- a/configure.in
++++ b/configure.in
+@@ -791,7 +791,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+
+ # Note: in the following variable, it's important to use the absolute
+@@ -912,7 +912,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch b/poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
new file mode 100644
index 000000000..72a0fa452
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fixes tcl target recipe build on old distros which have glibc older than 2.14
+
+| + echo 'NOTE: make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install'
+| NOTE: make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| + make DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/lib
+| Installing message catalogs
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/share/man
+| tclsh: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/tcl8.5.11/unix/libtcl8.5.so)
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/bin
+| make: *** [install-msgs] Error 1
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/26
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:38:01.787425628 -0800
++++ unix/Makefile.in 2013-11-10 23:37:59.807425578 -0800
+@@ -686,7 +686,7 @@
+ # tcltest executable gets the build directory burned into its ld search path.
+ # This keeps tcltest from picking up an already installed version of the Tcl
+ # library.
+-SHELL_ENV = @LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \
++SHELL_ENV = @LD_LIBRARY_PATH_VAR@=${@LD_LIBRARY_PATH_VAR@} \
+ TCLLIBPATH="@abs_builddir@/pkgs" \
+ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"
+
+@@ -712,7 +712,7 @@
+ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+
+ gdb-test: ${TCLTEST_EXE}
+- @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
++ @echo "set env @LD_LIBRARY_PATH_VAR@=$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+ $(GDB) ${TCLTEST_EXE} --command=gdb.run
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch b/poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
new file mode 100644
index 000000000..c60eb7537
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Pending
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-11-10 23:37:34.243424934 -0800
++++ unix/Makefile.in 2013-11-10 23:37:34.243424934 -0800
+@@ -709,23 +709,23 @@
+ test: test-tcl test-packages
+
+ test-tcl: ${TCLTEST_EXE}
+- $(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
++ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+
+ gdb-test: ${TCLTEST_EXE}
+ @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+- $(GDB) ./${TCLTEST_EXE} --command=gdb.run
++ $(GDB) ${TCLTEST_EXE} --command=gdb.run
+ rm gdb.run
+
+ # Useful target to launch a built tcltest with the proper path,...
+ runtest: ${TCLTEST_EXE}
+- $(SHELL_ENV) ./${TCLTEST_EXE}
++ $(SHELL_ENV) ${TCLTEST_EXE}
+
+ # Useful target for running the test suite with an unwritable current
+ # directory...
+ ro-test: ${TCLTEST_EXE}
+- echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
++ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ${TCLTEST_EXE}
+
+ # The following target generates the shared libraries in dltest/ that are used
+ # for testing; they are included as part of the "tcltest" target (via the
+@@ -743,23 +743,23 @@
+ # This target can be used to run tclsh from the build directory
+ # via `make shell SCRIPT=/tmp/foo.tcl`
+ shell: ${TCL_EXE}
+- $(SHELL_ENV) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) ${TCL_EXE} $(SCRIPT)
+
+ # This target can be used to run tclsh inside either gdb or insight
+ gdb: ${TCL_EXE}
+- $(SHELL_ENV) $(GDB) ./${TCL_EXE}
++ $(SHELL_ENV) $(GDB) ${TCL_EXE}
+
+ valgrind: ${TCL_EXE} ${TCLTEST_EXE}
+- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
+
+ valgrindshell: ${TCL_EXE}
+- $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCL_EXE} $(SCRIPT)
+
+ trace-shell: ${TCL_EXE}
+- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCL_EXE} $(SCRIPT)
+
+ trace-test: ${TCLTEST_EXE}
+- $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
++ $(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
+
+ #--------------------------------------------------------------------------
+ # Installation rules
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch b/poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch
new file mode 100644
index 000000000..5c622a236
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/no_packages.patch
@@ -0,0 +1,53 @@
+tcl 8.6.0 builds by default a number of packages that are not needed in Yocto.
+This patch changes the makefile so that these packages are not built by default.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index b729ffd..2c2e824 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -612,7 +612,7 @@ SRCS = $(GENERIC_SRCS) $(TOMMATH_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
+ # Start of rules
+ #--------------------------------------------------------------------------
+
+-all: binaries libraries doc packages
++all: binaries libraries doc
+
+ binaries: ${LIB_FILE} ${TCL_EXE}
+
+@@ -656,12 +656,12 @@ Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
+ #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
+ # $(SHELL) config.status
+
+-clean: clean-packages
++clean:
+ rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
+ errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@
+ cd dltest ; $(MAKE) clean
+
+-distclean: distclean-packages clean
++distclean: clean
+ rm -rf Makefile config.status config.cache config.log tclConfig.sh \
+ tclConfig.h *.plist Tcl.framework tcl.pc
+ cd dltest ; $(MAKE) distclean
+@@ -709,7 +709,7 @@ tcltest-real:
+ # tcltest, ie:
+ # % make test TESTFLAGS="-verbose bps -file fileName.test"
+
+-test: test-tcl test-packages
++test: test-tcl
+
+ test-tcl: ${TCLTEST_EXE}
+ $(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+@@ -774,7 +774,7 @@ INSTALL_PACKAGE_TARGETS = install-packages
+ INSTALL_DEV_TARGETS = install-headers
+ INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
+ INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
+- $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
++ $(INSTALL_EXTRA_TARGETS)
+
+ install: $(INSTALL_TARGETS)
+
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/run-ptest b/poky/meta/recipes-devtools/tcltk/tcl/run-ptest
new file mode 100644
index 000000000..dadba655f
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+for i in `ls tests/*.test |awk -F/ '{print $2}'`; \
+ do TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i >$i.tmp 2>&1; \
+ grep -q "^Files with failing tests:" $i.tmp; \
+ if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+ else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch b/poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
new file mode 100644
index 000000000..d1fc9b92e
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure 2013-09-19 13:17:13.000000000 -0700
++++ unix/configure 2013-11-11 00:20:51.519490342 -0800
+@@ -7599,6 +7599,9 @@
+ # get rid of the warnings.
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+
++ # following line added by CW for Debian GNU/Linux
++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+Index: unix/tcl.m4
+===================================================================
+--- unix.orig/tcl.m4 2013-09-19 13:17:13.000000000 -0700
++++ unix/tcl.m4 2013-11-11 00:17:24.263485123 -0800
+@@ -1415,6 +1415,9 @@
+ # get rid of the warnings.
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+
++ # following line added by CW for Debian GNU/Linux
++ TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS="-ldl"
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in 2013-09-19 13:17:13.000000000 -0700
++++ unix/Makefile.in 2013-11-11 00:20:32.423489861 -0800
+@@ -796,7 +796,10 @@
+ done;
+ @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
+ @@INSTALL_LIB@
+- @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
++ mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
++ ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
++ ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./
++ @chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
+ @echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ @$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ @echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
diff --git a/poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch b/poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
new file mode 100644
index 000000000..16f7c8051
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
@@ -0,0 +1,47 @@
+From 6efc98774681795712073c2b91e5e9d1763239b8 Mon Sep 17 00:00:00 2001
+From: "Song.Li" <Song.Li@windriver.com>
+Date: Wed, 1 Aug 2012 19:05:51 +0800
+Subject: [PATCH] tcl:install tcl to lib64 instead of lib on 64bit target
+
+Remove hardcoded library install path. Change $(prefix)/lib/ to ${libdir}.
+
+[YOCTO #2876]
+
+This is not a bug, but libraries should be installed into directory .../lib/.
+On 64bit target that should be lib64/.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure 2013-11-10 23:38:33.643426430 -0800
++++ unix/configure 2013-11-10 23:39:51.347428387 -0800
+@@ -19134,7 +19134,7 @@
+
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+
+Index: unix/configure.in
+===================================================================
+--- unix.orig/configure.in 2013-11-10 23:20:50.000000000 -0800
++++ unix/configure.in 2013-11-10 23:39:41.199428131 -0800
+@@ -790,7 +790,7 @@
+
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+
diff --git a/poky/meta/recipes-devtools/tcltk/tcl_8.6.8.bb b/poky/meta/recipes-devtools/tcltk/tcl_8.6.8.bb
new file mode 100644
index 000000000..4be2e8940
--- /dev/null
+++ b/poky/meta/recipes-devtools/tcltk/tcl_8.6.8.bb
@@ -0,0 +1,101 @@
+SUMMARY = "Tool Command Language"
+HOMEPAGE = "http://tcl.sourceforge.net"
+SECTION = "devel/tcltk"
+
+# http://www.tcl.tk/software/tcltk/license.html
+LICENSE = "tcl & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://../license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../compat/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../library/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../macosx/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../tests/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+ file://../win/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+"
+
+DEPENDS = "tcl-native zlib"
+
+BASE_SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \
+ file://tcl-add-soname.patch"
+SRC_URI = "${BASE_SRC_URI} \
+ file://fix_non_native_build_issue.patch \
+ file://fix_issue_with_old_distro_glibc.patch \
+ file://no_packages.patch \
+ file://tcl-remove-hardcoded-install-path.patch \
+ file://alter-includedir.patch \
+ file://run-ptest \
+"
+SRC_URI[md5sum] = "81656d3367af032e0ae6157eff134f89"
+SRC_URI[sha256sum] = "c43cb0c1518ce42b00e7c8f6eaddd5195c53a98f94adc717234a65cbcfd3f96a"
+
+SRC_URI_class-native = "${BASE_SRC_URI}"
+
+S = "${WORKDIR}/${BPN}${PV}/unix"
+
+VER = "${PV}"
+
+inherit autotools ptest binconfig
+
+EXTRA_OECONF = "--enable-threads --disable-rpath --libdir=${libdir}"
+
+do_compile_prepend() {
+ echo > ${S}/../compat/fixstrtod.c
+}
+
+do_install() {
+ autotools_do_install
+ oe_runmake 'DESTDIR=${D}' install-private-headers
+ ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
+ ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
+ sed -i "s;-L${B};-L${STAGING_LIBDIR};g" tclConfig.sh
+ sed -i "s;'${WORKDIR};'${STAGING_INCDIR};g" tclConfig.sh
+ install -d ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
+ install -m 0755 tclConfig.sh ${D}${libdir}
+ for dir in compat generic unix; do
+ install -d ${D}${includedir}/${BPN}${VER}/$dir
+ install -m 0644 ${S}/../$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
+ done
+}
+
+SYSROOT_DIRS += "${bindir_crossscripts}"
+
+PACKAGES =+ "tcl-lib"
+FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
+FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
+FILES_${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
+
+# isn't getting picked up by shlibs code
+RDEPENDS_${PN} += "tcl-lib"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}-ptest += "libgcc"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_compile_ptest() {
+ oe_runmake tcltest
+}
+
+do_install_ptest() {
+ cp ${B}/tcltest ${D}${PTEST_PATH}
+ cp -r ${S}/../library ${D}${PTEST_PATH}
+ cp -r ${S}/../tests ${D}${PTEST_PATH}
+}
+
+# Fix some paths that might be used by Tcl extensions
+BINCONFIG_GLOB = "*Config.sh"
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*Config.sh"
+
+# Cleanup host path from ${libdir}/tclConfig.sh and remove the
+# ${bindir_crossscripts}/tclConfig.sh from target
+PACKAGE_PREPROCESS_FUNCS += "tcl_package_preprocess"
+tcl_package_preprocess() {
+ sed -i -e "s;${DEBUG_PREFIX_MAP};;g" \
+ -e "s;-L${STAGING_LIBDIR};-L${libdir};g" \
+ -e "s;${STAGING_INCDIR};${includedir};g" \
+ -e "s;--sysroot=${RECIPE_SYSROOT};;g" \
+ ${PKGD}${libdir}/tclConfig.sh
+
+ rm -f ${PKGD}${bindir_crossscripts}/tclConfig.sh
+}
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch b/poky/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch
new file mode 100644
index 000000000..6eee6748f
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch
@@ -0,0 +1,37 @@
+From c7a2a65d6c2a433312540c207860740d6e4e7629 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 11 Mar 2018 17:32:54 -0700
+Subject: [PATCH] daemon.c: Libtirpc porting fixes
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ daemon.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/daemon.c b/daemon.c
+index 22f30f6..028a181 100644
+--- a/daemon.c
++++ b/daemon.c
+@@ -117,7 +117,7 @@ void logmsg(int prio, const char *fmt, ...)
+ */
+ struct in_addr get_remote(struct svc_req *rqstp)
+ {
+- return (svc_getcaller(rqstp->rq_xprt))->sin_addr;
++ return ((struct sockaddr_in*)svc_getcaller(rqstp->rq_xprt))->sin_addr;
+ }
+
+ /*
+@@ -125,7 +125,7 @@ struct in_addr get_remote(struct svc_req *rqstp)
+ */
+ short get_port(struct svc_req *rqstp)
+ {
+- return (svc_getcaller(rqstp->rq_xprt))->sin_port;
++ return ((struct sockaddr_in*)svc_getcaller(rqstp->rq_xprt))->sin_port;
+ }
+
+ /*
+--
+2.16.2
+
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
new file mode 100644
index 000000000..ff745d477
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
@@ -0,0 +1,158 @@
+Add ability to specify rcp port numbers
+
+In order to run more than one unfs server on a host system, you must
+be able to specify alternate rpc port numbers.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 44 +++++++++++++++++++++++++++++++-------------
+ mount.c | 4 ++--
+ 2 files changed, 33 insertions(+), 15 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -78,6 +78,8 @@ int opt_testconfig = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
++int nfs_prog = NFS3_PROGRAM;
++int mount_prog = MOUNTPROG;
+
+ /* Register with portmapper? */
+ int opt_portmapper = TRUE;
+@@ -206,7 +208,7 @@ static void parse_options(int argc, char
+ {
+
+ int opt = 0;
+- char *optstring = "bcC:de:hl:m:n:prstTuwi:";
++ char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
+
+ while (opt != -1) {
+ opt = getopt(argc, argv, optstring);
+@@ -261,8 +263,24 @@ static void parse_options(int argc, char
+ printf
+ ("\t-r report unreadable executables as readable\n");
+ printf("\t-T test exports file and exit\n");
++ printf("\t-x <port> alternate NFS RPC port\n");
++ printf("\t-y <port> alternate MOUNTD RPC port\n");
+ exit(0);
+ break;
++ case 'x':
++ nfs_prog = strtol(optarg, NULL, 10);
++ if (nfs_prog == 0) {
++ fprintf(stderr, "Invalid NFS RPC port\n");
++ exit(1);
++ }
++ break;
++ case 'y':
++ mount_prog = strtol(optarg, NULL, 10);
++ if (mount_prog == 0) {
++ fprintf(stderr, "Invalid MOUNTD RPC port\n");
++ exit(1);
++ }
++ break;
+ case 'l':
+ opt_bind_addr.s_addr = inet_addr(optarg);
+ if (opt_bind_addr.s_addr == (unsigned) -1) {
+@@ -347,12 +365,12 @@ void daemon_exit(int error)
+ #endif /* WIN32 */
+
+ if (opt_portmapper) {
+- svc_unregister(MOUNTPROG, MOUNTVERS1);
+- svc_unregister(MOUNTPROG, MOUNTVERS3);
++ svc_unregister(mount_prog, MOUNTVERS1);
++ svc_unregister(mount_prog, MOUNTVERS3);
+ }
+
+ if (opt_portmapper) {
+- svc_unregister(NFS3_PROGRAM, NFS_V3);
++ svc_unregister(nfs_prog, NFS_V3);
+ }
+
+ if (error == SIGSEGV)
+@@ -657,13 +675,13 @@ static void mountprog_3(struct svc_req *
+ static void register_nfs_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+ if (opt_portmapper) {
+- pmap_unset(NFS3_PROGRAM, NFS_V3);
++ pmap_unset(nfs_prog, NFS_V3);
+ }
+
+ if (udptransp != NULL) {
+ /* Register NFS service for UDP */
+ if (!svc_register
+- (udptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++ (udptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (NFS3_PROGRAM, NFS_V3, udp).");
+@@ -674,7 +692,7 @@ static void register_nfs_service(SVCXPRT
+ if (tcptransp != NULL) {
+ /* Register NFS service for TCP */
+ if (!svc_register
+- (tcptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++ (tcptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (NFS3_PROGRAM, NFS_V3, tcp).");
+@@ -686,14 +704,14 @@ static void register_nfs_service(SVCXPRT
+ static void register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+ if (opt_portmapper) {
+- pmap_unset(MOUNTPROG, MOUNTVERS1);
+- pmap_unset(MOUNTPROG, MOUNTVERS3);
++ pmap_unset(mount_prog, MOUNTVERS1);
++ pmap_unset(mount_prog, MOUNTVERS3);
+ }
+
+ if (udptransp != NULL) {
+ /* Register MOUNT service (v1) for UDP */
+ if (!svc_register
+- (udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++ (udptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS1, udp).");
+@@ -702,7 +720,7 @@ static void register_mount_service(SVCXP
+
+ /* Register MOUNT service (v3) for UDP */
+ if (!svc_register
+- (udptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++ (udptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ opt_portmapper ? IPPROTO_UDP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS3, udp).");
+@@ -713,7 +731,7 @@ static void register_mount_service(SVCXP
+ if (tcptransp != NULL) {
+ /* Register MOUNT service (v1) for TCP */
+ if (!svc_register
+- (tcptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++ (tcptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS1, tcp).");
+@@ -722,7 +740,7 @@ static void register_mount_service(SVCXP
+
+ /* Register MOUNT service (v3) for TCP */
+ if (!svc_register
+- (tcptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++ (tcptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ opt_portmapper ? IPPROTO_TCP : 0)) {
+ fprintf(stderr, "%s\n",
+ "unable to register (MOUNTPROG, MOUNTVERS3, tcp).");
+--- a/mount.c
++++ b/mount.c
+@@ -155,8 +155,8 @@ mountres3 *mountproc_mnt_3_svc(dirpath *
+ /* error out if not version 3 */
+ if (rqstp->rq_vers != 3) {
+ logmsg(LOG_INFO,
+- "%s attempted mount with unsupported protocol version",
+- inet_ntoa(get_remote(rqstp)));
++ "%s attempted mount with unsupported protocol version: %i",
++ inet_ntoa(get_remote(rqstp)), rqstp->rq_vers);
+ result.fhs_status = MNT3ERR_INVAL;
+ return &result;
+ }
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch b/poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
new file mode 100644
index 000000000..aada01411
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
@@ -0,0 +1,25 @@
+daemon.c: Check exit code of chdir()
+
+Stop the compile warning and fix the code to act on a chdir() failure.
+If this one does fail something is very, very wrong.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -964,7 +964,8 @@ int main(int argc, char **argv)
+ sigaction(SIGALRM, &act, NULL);
+
+ /* don't make directory we started in busy */
+- chdir("/");
++ if(chdir("/") < 0)
++ daemon_exit(0);
+
+ /* detach from terminal */
+ if (opt_detach) {
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch b/poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
new file mode 100644
index 000000000..46b187e5f
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
@@ -0,0 +1,61 @@
+daemon.c: Fix race window for writing of the pid file
+
+The parent process should write the pid file such that the pid file
+will can be checked immediately following exit of the fork from the
+parent.
+
+This allows external monitoring applications to watch the daemon
+without having to add sleep calls to wait for the pid file be written
+on a busy system.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -153,7 +153,7 @@ int get_socket_type(struct svc_req *rqst
+ /*
+ * write current pid to a file
+ */
+-static void create_pid_file(void)
++static void create_pid_file(int pid)
+ {
+ char buf[16];
+ int fd, res, len;
+@@ -175,7 +175,7 @@ static void create_pid_file(void)
+ }
+ #endif
+
+- sprintf(buf, "%i\n", backend_getpid());
++ sprintf(buf, "%i\n", pid);
+ len = strlen(buf);
+
+ res = backend_pwrite(fd, buf, len, 0);
+@@ -970,6 +970,10 @@ int main(int argc, char **argv)
+ fprintf(stderr, "could not fork into background\n");
+ daemon_exit(0);
+ }
++ if (pid)
++ create_pid_file(pid);
++ } else {
++ create_pid_file(backend_getpid());
+ }
+ #endif /* WIN32 */
+
+@@ -1006,8 +1010,10 @@ int main(int argc, char **argv)
+ /* no umask to not screw up create modes */
+ umask(0);
+
++#ifdef WIN32
+ /* create pid file if wanted */
+- create_pid_file();
++ create_pid_file(backend_getpid());
++#endif
+
+ /* initialize internal stuff */
+ fh_cache_init();
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch b/poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
new file mode 100644
index 000000000..219dd35ae
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
@@ -0,0 +1,74 @@
+nfs.c: Allow max sa.sun_path for a localdomain socket with the user nfs-server
+
+There is a hard limit for the kernel of 108 characters for a
+localdomain socket name. To avoid problems with the user nfs
+server it should maximize the number of characters by using
+a relative path on the server side.
+
+Previously the nfs-server used the absolute path name passed to
+the sa.sunpath arg for binding the socket and this has caused
+problems for both the X server and UST binaries which make
+heavy use of named sockets with long names.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ nfs.c | 29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+--- a/nfs.c
++++ b/nfs.c
+@@ -672,6 +672,7 @@ SYMLINK3res *nfsproc3_symlink_3_svc(SYML
+ }
+
+ #ifndef WIN32
++static char pathbuf_tmp[NFS_MAXPATHLEN + NFS_MAXNAMLEN + 1];
+
+ /*
+ * create Unix socket
+@@ -680,17 +681,41 @@ static int mksocket(const char *path, mo
+ {
+ int res, sock;
+ struct sockaddr_un addr;
++ unsigned int len = strlen(path);
+
+ sock = socket(PF_UNIX, SOCK_STREAM, 0);
+- addr.sun_family = AF_UNIX;
+- strcpy(addr.sun_path, path);
+ res = sock;
+ if (res != -1) {
++ addr.sun_family = AF_UNIX;
++ if (len < sizeof(addr.sun_path) -1) {
++ strcpy(addr.sun_path, path);
++ } else {
++ char *ptr;
++ res = -1;
++ if (len >= sizeof(path))
++ goto out;
++ strcpy(pathbuf_tmp, path);
++ ptr = strrchr(pathbuf_tmp,'/');
++ if (ptr) {
++ *ptr = '\0';
++ ptr++;
++ if (chdir(pathbuf_tmp))
++ goto out;
++ } else {
++ ptr = pathbuf_tmp;
++ }
++ if (strlen(ptr) >= sizeof(addr.sun_path))
++ goto out;
++ strcpy(addr.sun_path, ptr);
++ }
+ umask(~mode);
+ res =
+ bind(sock, (struct sockaddr *) &addr,
+ sizeof(addr.sun_family) + strlen(addr.sun_path));
+ umask(0);
++out:
++ if (chdir("/"))
++ fprintf(stderr, "Internal failure to chdir /\n");
+ close(sock);
+ }
+ return res;
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
new file mode 100644
index 000000000..e6d89530f
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
@@ -0,0 +1,64 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sat, 23 Feb 2013 08:49:08 -0600
+Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem
+
+The following test case fails with modern linunx kernels which cache
+the renamed inode.
+
+ % mkdir a;mkdir b;mv b a/;ls -l a
+ ls: a/b: Stale NFS file handle
+
+The issue is that nfserver was not updating the fh_cache with the new
+location of the inode, when it moves directories.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ fh_cache.c | 12 ++++++++++++
+ fh_cache.h | 1 +
+ nfs.c | 2 ++
+ 3 files changed, 15 insertions(+)
+
+--- a/fh_cache.c
++++ b/fh_cache.c
+@@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev,
+ }
+
+ /*
++ * update a fh inode cache for an operation like rename
++ */
++void fh_cache_update(nfs_fh3 fh, char *path)
++{
++ unfs3_fh_t *obj = (void *) fh.data.data_val;
++ backend_statstruct buf;
++
++ if (backend_lstat(path, &buf) != -1) {
++ fh_cache_add(obj->dev, buf.st_ino, path);
++ }
++}
++/*
+ * resolve a filename into a path
+ * cache-using wrapper for fh_decomp_raw
+ */
+--- a/fh_cache.h
++++ b/fh_cache.h
+@@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str
+ unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir);
+
+ char *fh_cache_add(uint32 dev, uint64 ino, const char *path);
++void fh_cache_update(nfs_fh3 fh, char *path);
+
+ #endif
+--- a/nfs.c
++++ b/nfs.c
+@@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME
+ res = backend_rename(from_obj, to_obj);
+ if (res == -1)
+ result.status = rename_err();
++ /* Update the fh_cache with moved inode value */
++ fh_cache_update(argp->to.dir, to_obj);
+ }
+ }
+
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
new file mode 100644
index 000000000..b3521c63e
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
@@ -0,0 +1,56 @@
+daemon.c: Add option for tcp no delay
+
+Allow the NFS tcp sockets to conditionally use TCP_NODELAY
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -17,6 +17,7 @@
+ #ifndef WIN32
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <syslog.h>
+ #else /* WIN32 */
+@@ -75,6 +76,7 @@ unsigned int opt_mount_port = NFS_PORT;
+ int opt_singleuser = FALSE;
+ int opt_brute_force = FALSE;
+ int opt_testconfig = FALSE;
++int opt_tcp_nodelay = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
+@@ -208,7 +210,7 @@ static void parse_options(int argc, char
+ {
+
+ int opt = 0;
+- char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
++ char *optstring = "bcC:de:hl:m:Nn:prstTuwi:x:y:";
+
+ while (opt != -1) {
+ opt = getopt(argc, argv, optstring);
+@@ -295,6 +297,9 @@ static void parse_options(int argc, char
+ exit(1);
+ }
+ break;
++ case 'N':
++ opt_tcp_nodelay = TRUE;
++ break;
+ case 'n':
+ opt_nfs_port = strtol(optarg, NULL, 10);
+ if (opt_nfs_port == 0) {
+@@ -802,6 +807,8 @@ static SVCXPRT *create_tcp_transport(uns
+ sin.sin_addr.s_addr = opt_bind_addr.s_addr;
+ sock = socket(PF_INET, SOCK_STREAM, 0);
+ setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
++ if (opt_tcp_nodelay)
++ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ if (bind(sock, (struct sockaddr *) &sin, sizeof(struct sockaddr))) {
+ perror("bind");
+ fprintf(stderr, "Couldn't bind to tcp port %d\n", port);
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch b/poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
new file mode 100644
index 000000000..6f64dd5b3
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
@@ -0,0 +1,37 @@
+Fix parallel build dependency issue
+
+If building with make -j2 the lib.a will not get built in time.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ Config/Makefile.in | 3 +++
+ Makefile.in | 3 ++-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -29,7 +29,8 @@ DESTDIR =
+
+ VPATH = $(srcdir)
+
+-all: subdirs unfsd$(EXEEXT)
++all: subdirs
++ $(MAKE) unfsd$(EXEEXT)
+
+ unfsd$(EXEEXT): $(OBJS) $(CONFOBJ) $(EXTRAOBJ)
+ $(CC) -o $@ $(OBJS) $(CONFOBJ) $(EXTRAOBJ) $(LDFLAGS)
+--- a/Config/Makefile.in
++++ b/Config/Makefile.in
+@@ -16,6 +16,9 @@ lib.a: $(OBJS)
+ $(AR) crs lib.a $(OBJS)
+
+ y.tab.h y.tab.c: $(srcdir)/exports.y
++y.tab.h: y.tab.c
++
++y.tab.c: $(srcdir)/exports.y
+ $(YACC) -d $(srcdir)/exports.y
+
+ y.tab.o: y.tab.c $(srcdir)/exports.h $(top_srcdir)/nfs.h $(top_srcdir)/mount.h $(top_srcdir)/daemon.h
diff --git a/poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb b/poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
new file mode 100644
index 000000000..8127e4a10
--- /dev/null
+++ b/poky/meta/recipes-devtools/unfs3/unfs3_0.9.22.r497.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Userspace NFS server v3 protocol"
+SECTION = "console/network"
+LICENSE = "unfs3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9475885294e17c0cc0067820d042792e"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "0.9.22.r497"
+RECIPE_UPSTREAM_DATE = "Oct 08, 2015"
+CHECK_DATE = "Dec 10, 2015"
+
+DEPENDS = "flex-native bison-native flex"
+DEPENDS += "libtirpc"
+DEPENDS_append_class-nativesdk = " flex-nativesdk"
+
+ASNEEDED = ""
+
+MOD_PV = "497"
+S = "${WORKDIR}/trunk"
+# Only subversion url left in OE-Core, use a mirror tarball instead since
+# this rarely changes.
+# svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV};protocol=http
+# rename the tarball in mirror to avoid clash with user local svn tarball
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/unfs3-0.9.22.r497.tar.gz \
+ file://unfs3_parallel_build.patch \
+ file://alternate_rpc_ports.patch \
+ file://fix_pid_race_parent_writes_child_pid.patch \
+ file://fix_compile_warning.patch \
+ file://rename_fh_cache.patch \
+ file://relative_max_socket_path_len.patch \
+ file://tcp_no_delay.patch \
+ file://0001-daemon.c-Libtirpc-porting-fixes.patch \
+ "
+SRC_URI[md5sum] = "2e43e471c77ade0331901c40b8f8e9a3"
+SRC_URI[sha256sum] = "21009468a9ba07b72ea93780d025a63ab4e55bf8fc3127803c296f0900fe1bac"
+
+BBCLASSEXTEND = "native nativesdk"
+
+inherit autotools
+EXTRA_OECONF_append_class-native = " --sbindir=${bindir}"
+CFLAGS_append = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append = " -ltirpc"
+
+# Turn off these header detects else the inode search
+# will walk entire file systems and this is a real problem
+# if you have 2 TB of files to walk in your file system
+CACHED_CONFIGUREVARS = "ac_cv_header_mntent_h=no ac_cv_header_sys_mnttab_h=no"
diff --git a/poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb b/poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
new file mode 100644
index 000000000..1ffc11e76
--- /dev/null
+++ b/poky/meta/recipes-devtools/unifdef/unifdef_2.11.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Selectively remove #ifdef statements from sources"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+HOMEPAGE = "http://dotat.at/prog/unifdef/"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=78fc6c2c1dc4f18c891ed5b7a469fe32 \
+ file://unifdef.c;endline=32;md5=aaec84d8b68d8b6dea71f45e9949ebfe"
+
+SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "337053fd8a7d9ab3adf5e50f88af95b7"
+SRC_URI[sha256sum] = "828ffc270ac262b88fe011136acef2780c05b0dc3c5435d005651740788d4537"
+
+UPSTREAM_CHECK_REGEX = "unifdef-(?P<pver>((\d+\.*)+)(?![a-f0-9]{6,})).tar"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} prefix=${prefix}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-devtools/vala/vala.inc b/poky/meta/recipes-devtools/vala/vala.inc
new file mode 100644
index 000000000..b22faad78
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala.inc
@@ -0,0 +1,57 @@
+SUMMARY = "C#-like programming language for easing GObject programming"
+DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
+Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
+SECTION = "devel"
+DEPENDS = "bison-native flex-native glib-2.0"
+
+# Appending libxslt-native to dependencies has an effect
+# of rebuilding the manual, which is very slow. Let's do this
+# only when api-documentation distro feature is enabled.
+DEPENDS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}"
+
+# vala-native contains a native version of vapigen, which we use instead of the target one
+DEPENDS_append_class-target = " vala-native"
+BBCLASSEXTEND = "native"
+HOMEPAGE = "http://vala-project.org"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
+inherit autotools pkgconfig upstream-version-is-even
+
+FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+do_configure_prepend_class-target() {
+ # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot
+ # The wrapper will call a native vapigen
+ cat > ${B}/vapigen-wrapper << EOF
+#!/bin/sh
+vapigen-${SHRT_VER} "\$@"
+EOF
+ chmod +x ${B}/vapigen-wrapper
+}
+
+EXTRA_OECONF += " --disable-graphviz"
+
+# Vapigen wrapper needs to be available system-wide, because it will be used
+# to build vapi files from all other packages with vala support
+do_install_append_class-target() {
+ install -d ${D}${bindir}/
+ install ${B}/vapigen-wrapper ${D}${bindir}/
+}
+
+# Put vapigen wrapper into target sysroot so that it can be used when building
+# vapi files.
+SYSROOT_DIRS_append_class-target = " ${bindir}"
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " vapigen_sysroot_preprocess"
+vapigen_sysroot_preprocess() {
+ # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks
+ # up our wrapper.
+ sed -i \
+ -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \
+ ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc
+}
diff --git a/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch b/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch
new file mode 100644
index 000000000..9b27b7fd1
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch
@@ -0,0 +1,32 @@
+From b6ca3876e233c724fd460c1579abc4ab63c8d01e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 4 Oct 2017 15:23:08 +0300
+Subject: [PATCH] Disable valadoc
+
+Valadoc is a documentation generator for Vala sources, which was
+recently merged into the main vala source tree. Unsurprisingly,
+it's broken in cross-compile environment in multiple ways,
+so let's fix it some other time.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.am | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index e5dc0cc..813b3fc 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -13,8 +13,6 @@ SUBDIRS = \
+ doc \
+ gobject-introspection \
+ vapigen \
+- libvaladoc \
+- valadoc \
+ $(NULL)
+
+ if ENABLE_UNVERSIONED
+--
+2.14.1
+
diff --git a/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
new file mode 100644
index 000000000..ac9dc8c83
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
@@ -0,0 +1,55 @@
+From 2460d7b79f7e90dcfeebde5e9c53d9b6798a1f3c Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 21 Feb 2012 17:12:50 +0100
+Subject: [PATCH] git-version-gen: don't append -dirty if we're not in git
+ repo
+
+* for example if we have some dirty directory and we unpack clean vala tarball in it, then it will append -dirty
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Inappropriate [OE-Specific]
+---
+ build-aux/git-version-gen | 25 ++++++++++++++-----------
+ 1 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
+index 0fa6faa..1d1f9d2 100755
+--- a/build-aux/git-version-gen
++++ b/build-aux/git-version-gen
+@@ -126,18 +126,21 @@ fi
+
+ v=`echo "$v" |sed 's/^v//'`
+
+-# Don't declare a version "dirty" merely because a time stamp has changed.
+-git status > /dev/null 2>&1
++if test -d .git
++then
++ # Don't declare a version "dirty" merely because a time stamp has changed.
++ git status > /dev/null 2>&1
+
+-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+-case "$dirty" in
+- '') ;;
+- *) # Append the suffix only if there isn't one already.
+- case $v in
+- *-dirty) ;;
+- *) v="$v-dirty" ;;
+- esac ;;
+-esac
++ dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
++ case "$dirty" in
++ '') ;;
++ *) # Append the suffix only if there isn't one already.
++ case $v in
++ *-dirty) ;;
++ *) v="$v-dirty" ;;
++ esac ;;
++ esac
++fi
+
+ # Omit the trailing newline, so that m4_esyscmd can use the result directly.
+ echo "$v" | tr -d '\012'
+--
+1.7.8.4
+
diff --git a/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch b/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch
new file mode 100644
index 000000000..ecab0fc1c
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch
@@ -0,0 +1,38 @@
+From dbb1c58e86f2af4613f3ac9571d9b163d4bca675 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 16:13:54 +0300
+Subject: [PATCH] vapigen.m4: use $PKG_CONFIG_SYSROOT_DIR
+
+This is necessary in cross-compiling environments, where directories
+returned by pkg-config should be prefixed with sysroot location.
+
+Upstream-Status: Pending [review in oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ vapigen/vapigen.m4 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/vapigen/vapigen.m4 b/vapigen/vapigen.m4
+index 2c435e7..6228991 100644
+--- a/vapigen/vapigen.m4
++++ b/vapigen/vapigen.m4
+@@ -82,12 +82,12 @@ AC_DEFUN([VAPIGEN_CHECK],
+
+ AS_CASE([$enable_vala],
+ [yes], [
+- VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
+- VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
++ VAPIGEN=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name`
++ VAPIGEN_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen
+ AS_IF([test "x$2" = "x"], [
+- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name`
+ ], [
+- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name`
+ ])
+ ])
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch b/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch
new file mode 100644
index 000000000..15d186de0
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch
@@ -0,0 +1,223 @@
+From eb716dc856c20b3da146a4e83e9800bd1f53c739 Mon Sep 17 00:00:00 2001
+From: Rico Tzschichholz <ricotz@ubuntu.com>
+Date: Wed, 6 Sep 2017 18:52:55 +0200
+Subject: [PATCH] libvaladoc: Allow disabling the graphviz dependency of
+ valadoc
+
+https://bugzilla.gnome.org/show_bug.cgi?id=787375
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Upstream-Status: Submitted [bugzilla link above]
+---
+ configure.ac | 60 +++++++++++++++++++----------------
+ libvaladoc/Makefile.am | 25 +++++++++++----
+ libvaladoc/html/basicdoclet.vala | 8 +++++
+ libvaladoc/html/htmlmarkupwriter.vala | 4 +++
+ 4 files changed, 63 insertions(+), 34 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c73d5d6b1..291e503d5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,34 +98,38 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
+ AC_SUBST(GMODULE_CFLAGS)
+ AC_SUBST(GMODULE_LIBS)
+
+-PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
+-AC_MSG_CHECKING([for CGRAPH])
+-cgraph_tmp_LIBADD="$LIBADD"
+-cgraph_tmp_CFLAGS="$CFLAGS"
+-LIBADD="$LIBADD $LIBGVC_LIBS"
+-CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
+-AC_RUN_IFELSE(
+- [AC_LANG_SOURCE([
+- #include <gvc.h>
+-
+- int main(void) {
+- #ifdef WITH_CGRAPH
+- return 0;
+- #else
+- return -1;
+- #endif
+- }
+- ])], [
+- AC_MSG_RESULT([yes])
+- VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
+- have_cgraph=yes
+- ], [
+- AC_MSG_RESULT([no])
+- have_cgraph=no
+- ]
+-)
+-LIBADD="$cgraph_tmp_LIBADD"
+-CFLAGS="$cgraph_tmp_CFLAGS"
++AC_ARG_ENABLE(graphviz, AS_HELP_STRING([--disable-graphviz], [Disable graphviz usage for valadoc]), enable_graphviz=$enableval, enable_graphviz=yes)
++if test x$enable_graphviz = xyes; then
++ PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
++ AC_MSG_CHECKING([for CGRAPH])
++ VALAFLAGS="$VALAFLAGS -D HAVE_GRAPHVIZ"
++ cgraph_tmp_LIBADD="$LIBADD"
++ cgraph_tmp_CFLAGS="$CFLAGS"
++ LIBADD="$LIBADD $LIBGVC_LIBS"
++ CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
++ AC_RUN_IFELSE(
++ [AC_LANG_SOURCE([
++ #include <gvc.h>
++ int main(void) {
++ #ifdef WITH_CGRAPH
++ return 0;
++ #else
++ return -1;
++ #endif
++ }
++ ])], [
++ AC_MSG_RESULT([yes])
++ VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
++ have_cgraph=yes
++ ], [
++ AC_MSG_RESULT([no])
++ have_cgraph=no
++ ]
++ )
++ LIBADD="$cgraph_tmp_LIBADD"
++ CFLAGS="$cgraph_tmp_CFLAGS"
++fi
++AM_CONDITIONAL(ENABLE_GRAPHVIZ, test x$enable_graphviz = xyes)
+ AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
+
+ AC_PATH_PROG([XSLTPROC], [xsltproc], :)
+diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
+index 89245d86b..7c07498b9 100644
+--- a/libvaladoc/Makefile.am
++++ b/libvaladoc/Makefile.am
+@@ -127,10 +127,6 @@ libvaladoc_la_VALASOURCES = \
+ content/tablerow.vala \
+ content/taglet.vala \
+ content/text.vala \
+- charts/chart.vala \
+- charts/chartfactory.vala \
+- charts/hierarchychart.vala \
+- charts/simplechartfactory.vala \
+ parser/manyrule.vala \
+ parser/oneofrule.vala \
+ parser/optionalrule.vala \
+@@ -158,13 +154,24 @@ libvaladoc_la_VALASOURCES = \
+ highlighter/codetoken.vala \
+ highlighter/highlighter.vala \
+ html/basicdoclet.vala \
+- html/htmlchartfactory.vala \
+ html/linkhelper.vala \
+ html/cssclassresolver.vala \
+ html/htmlmarkupwriter.vala \
+ html/htmlrenderer.vala \
+ $(NULL)
+
++if ENABLE_GRAPHVIZ
++libvaladoc_la_VALASOURCES += \
++ charts/chart.vala \
++ charts/chartfactory.vala \
++ charts/hierarchychart.vala \
++ charts/simplechartfactory.vala \
++ html/htmlchartfactory.vala \
++ $(NULL)
++
++LIBGVC_PKG = --vapidir $(top_srcdir)/vapi --pkg libgvc
++endif
++
+ libvaladoc@PACKAGE_SUFFIX@_la_SOURCES = \
+ libvaladoc.vala.stamp \
+ $(libvaladoc_la_VALASOURCES:.vala=.c) \
+@@ -182,8 +189,8 @@ libvaladoc.vala.stamp: $(libvaladoc_la_VALASOURCES)
+ --library valadoc \
+ --vapi valadoc@PACKAGE_SUFFIX@.vapi \
+ --vapidir $(top_srcdir)/vapi --pkg gmodule-2.0 \
+- --vapidir $(top_srcdir)/vapi --pkg libgvc \
+ --vapidir $(top_srcdir)/gee --pkg gee \
++ $(LIBGVC_PKG) \
+ --pkg config \
+ $(filter %.vala %.c,$^)
+ touch $@
+@@ -209,6 +216,9 @@ nodist_pkgconfig_DATA = valadoc@PACKAGE_SUFFIX@.pc
+
+ valadoc@PACKAGE_SUFFIX@.pc: valadoc.pc
+ cp $< $@
++if !ENABLE_GRAPHVIZ
++ sed -i "s/libgvc //g" $@
++endif
+
+ vapidir = $(datadir)/vala/vapi
+ dist_vapi_DATA = valadoc@PACKAGE_SUFFIX@.vapi
+@@ -216,6 +226,9 @@ nodist_vapi_DATA = valadoc@PACKAGE_SUFFIX@.deps
+
+ valadoc@PACKAGE_SUFFIX@.deps: valadoc.deps
+ cp $< $@
++if !ENABLE_GRAPHVIZ
++ sed -i "s/libgvc//g" $@
++endif
+
+ EXTRA_DIST = \
+ $(libvaladoc_la_VALASOURCES) \
+diff --git a/libvaladoc/html/basicdoclet.vala b/libvaladoc/html/basicdoclet.vala
+index cc9ea4ed7..432c3818f 100644
+--- a/libvaladoc/html/basicdoclet.vala
++++ b/libvaladoc/html/basicdoclet.vala
+@@ -46,7 +46,11 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
+ protected HtmlRenderer _renderer;
+ protected Html.MarkupWriter writer;
+ protected Html.CssClassResolver cssresolver;
++#if HAVE_GRAPHVIZ
+ protected Charts.Factory image_factory;
++#else
++ protected void* image_factory;
++#endif
+ protected ErrorReporter reporter;
+ protected string package_list_link = "../index.html";
+
+@@ -120,7 +124,9 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
+ this.linker = new LinkHelper ();
+
+ _renderer = new HtmlRenderer (settings, this.linker, this.cssresolver);
++#if HAVE_GRAPHVIZ
+ this.image_factory = new SimpleChartFactory (settings, linker);
++#endif
+ }
+
+
+@@ -1025,6 +1031,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
+ }
+
+ protected void write_image_block (Api.Node element) {
++#if HAVE_GRAPHVIZ
+ if (element is Class || element is Interface || element is Struct) {
+ unowned string format = (settings.use_svg_images ? "svg" : "png");
+ var chart = new Charts.Hierarchy (image_factory, element);
+@@ -1044,6 +1051,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
+ this.get_img_path_html (element, format)});
+ writer.add_usemap (chart);
+ }
++#endif
+ }
+
+ public void write_namespace_content (Namespace node, Api.Node? parent) {
+diff --git a/libvaladoc/html/htmlmarkupwriter.vala b/libvaladoc/html/htmlmarkupwriter.vala
+index 15ed9efd1..fe0d705d4 100644
+--- a/libvaladoc/html/htmlmarkupwriter.vala
++++ b/libvaladoc/html/htmlmarkupwriter.vala
+@@ -43,12 +43,16 @@ public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
+ }, xml_declaration);
+ }
+
++#if HAVE_GRAPHVIZ
+ public MarkupWriter add_usemap (Charts.Chart chart) {
+ string? buf = (string?) chart.write_buffer ("cmapx");
+ if (buf != null) {
+ raw_text ("\n");
+ raw_text ((!) buf);
+ }
++#else
++ public MarkupWriter add_usemap (void* chart) {
++#endif
+
+ return this;
+ }
+--
+2.14.1
diff --git a/poky/meta/recipes-devtools/vala/vala_0.38.8.bb b/poky/meta/recipes-devtools/vala/vala_0.38.8.bb
new file mode 100644
index 000000000..e2baf6555
--- /dev/null
+++ b/poky/meta/recipes-devtools/vala/vala_0.38.8.bb
@@ -0,0 +1,10 @@
+require ${BPN}.inc
+
+SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch \
+ file://0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch \
+ file://disable-graphviz.patch \
+ file://0001-Disable-valadoc.patch \
+"
+
+SRC_URI[md5sum] = "37edd0467d056fd9e3937d0bbceda80b"
+SRC_URI[sha256sum] = "2fa746b51cd66e43577d1da06a80b708c2875cadaafee77e9700ea35cf23882c"
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
new file mode 100644
index 000000000..a78e1953f
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch
@@ -0,0 +1,51 @@
+From 9762fd23e1f1db66d4b977c694a17d3bca3fe99a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 8 Jan 2016 16:36:29 +0200
+Subject: [PATCH] Remove tests that fail to build on some PPC32 configurations
+
+Failures are documented here:
+http://errors.yoctoproject.org/Errors/Search/?items=10&query=862d702fbb99e484631315aa44b9e46f8fc567da&filter=valgrind&type=recipe
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Upstream-Status: Pending
+---
+ memcheck/tests/ppc32/Makefile.am | 2 +-
+ none/tests/ppc32/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
+index 26b95a2..8f05743 100644
+--- a/memcheck/tests/ppc32/Makefile.am
++++ b/memcheck/tests/ppc32/Makefile.am
+@@ -10,7 +10,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
+ power_ISA2_07.stderr.exp power_ISA2_07.vgtest
+
+ check_PROGRAMS = \
+- power_ISA2_05 power_ISA2_07
++ power_ISA2_07
+
+ power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
+ -I$(top_srcdir)/include @FLAG_M32@
+diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am
+index 196239e..0fe3425 100644
+--- a/none/tests/ppc32/Makefile.am
++++ b/none/tests/ppc32/Makefile.am
+@@ -50,13 +50,13 @@ EXTRA_DIST = \
+
+ check_PROGRAMS = \
+ allexec \
+- lsw jm-insns round \
++ lsw \
+ test_isa_2_06_part1 test_isa_2_06_part2 test_isa_2_06_part3 \
+ test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
+ test_isa_2_07_part1 test_isa_2_07_part2 \
+ test_tm test_touch_tm ldst_multiple data-cache-instructions \
+ test_fx test_gx \
+- testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
++ twi tw xlc_dbl_u32 power6_bcmp \
+ bug129390-ppc32 bug139050-ppc32 \
+ ldstrev mftocrf mcrfs
+
+--
+2.6.4
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch
new file mode 100644
index 000000000..9f1da7bac
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch
@@ -0,0 +1,108 @@
+From 715cf122388f3527afa5649cebf9f1522c240693 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Apr 2017 10:11:16 -0700
+Subject: [PATCH] makefiles: Drop setting -mcpu to cortex-a8 on arm
+ architecture
+
+We can not assume that all arches armv7+ are cortex-a8 only
+it fails to build for rpi which is armv7ve based (cortex-a8) cpu
+implementation.
+Fixes
+| cc1: warning: switch -mcpu=cortex-a8 conflicts with -march=armv7ve switch
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.all.am | 6 +++---
+ helgrind/tests/Makefile.am | 6 +++---
+ none/tests/arm/Makefile.am | 18 +++++++++---------
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/Makefile.all.am b/Makefile.all.am
+index 02059a3..c7c4700 100644
+--- a/Makefile.all.am
++++ b/Makefile.all.am
+@@ -197,11 +197,11 @@ AM_CCASFLAGS_PPC64LE_LINUX = @FLAG_M64@ -g
+
+ AM_FLAG_M3264_ARM_LINUX = @FLAG_M32@
+ AM_CFLAGS_ARM_LINUX = @FLAG_M32@ \
+- $(AM_CFLAGS_BASE) -marm -mcpu=cortex-a8
++ $(AM_CFLAGS_BASE) -marm
+ AM_CFLAGS_PSO_ARM_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) \
+- -marm -mcpu=cortex-a8 $(AM_CFLAGS_PSO_BASE)
++ -marm $(AM_CFLAGS_PSO_BASE)
+ AM_CCASFLAGS_ARM_LINUX = @FLAG_M32@ \
+- -marm -mcpu=cortex-a8 -g
++ -marm -g
+
+ AM_FLAG_M3264_ARM64_LINUX = @FLAG_M64@
+ AM_CFLAGS_ARM64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
+diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am
+index df82169..07eb66a 100644
+--- a/helgrind/tests/Makefile.am
++++ b/helgrind/tests/Makefile.am
+@@ -189,9 +189,9 @@ if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
+ endif
+
+ if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX
+-annotate_hbefore_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
+-tc07_hbl1_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
+-tc08_hbl2_CFLAGS = $(AM_CFLAGS) -mcpu=cortex-a8
++annotate_hbefore_CFLAGS = $(AM_CFLAGS)
++tc07_hbl1_CFLAGS = $(AM_CFLAGS)
++tc08_hbl2_CFLAGS = $(AM_CFLAGS)
+ else
+ annotate_hbefore_CFLAGS = $(AM_CFLAGS)
+ tc07_hbl1_CFLAGS = $(AM_CFLAGS)
+diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
+index 024eb6d..ccecb90 100644
+--- a/none/tests/arm/Makefile.am
++++ b/none/tests/arm/Makefile.am
+@@ -52,10 +52,10 @@ allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
+ # need special helping w.r.t -mfpu and -mfloat-abi, though.
+ # Also force -O0 since -O takes hundreds of MB of memory
+ # for v6intThumb.c.
+-v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -marm
+-v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
++v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -marm
++v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
+
+-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
++v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mthumb
+
+ v8crypto_a_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -marm
+ v8crypto_t_CFLAGS = $(AM_CFLAGS) -g -O0 -mfpu=crypto-neon-fp-armv8 -mthumb
+@@ -65,23 +65,23 @@ v8memory_a_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ v8memory_t_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -march=armv8-a -mfpu=crypto-neon-fp-armv8 -mthumb
+
+-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++vfp_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+
+-neon128_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++neon128_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+-neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
++neon64_CFLAGS = $(AM_CFLAGS) -g -O0 \
+ -mfpu=neon \
+ -mthumb
+
+ intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
+-ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
+-ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
++ldrt_CFLAGS = $(AM_CFLAGS) -g -mthumb
++ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -marm
+
+-vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
++vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mfpu=vfpv3
+
+ vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+--
+2.12.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
new file mode 100644
index 000000000..a48d7db07
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch
@@ -0,0 +1,32 @@
+From 3409dc35c15bb14c8a525239806322648e079ab1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:12:43 -0700
+Subject: [PATCH 1/3] memcheck/arm64: Define __THROW if not already defined
+
+Helps compiling with musl where __THROW is not available
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ memcheck/tests/arm64-linux/scalar.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h
+index 9008816..8ef050f 100644
+--- a/memcheck/tests/arm64-linux/scalar.h
++++ b/memcheck/tests/arm64-linux/scalar.h
+@@ -12,6 +12,10 @@
+ #include <sys/types.h>
+ #include <sys/mman.h>
+
++#ifndef __THROW
++#define __THROW
++#endif
++
+ // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
+ // declare this ourselves.
+ extern long int syscall (long int __sysno, ...) __THROW;
+--
+2.13.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch
new file mode 100644
index 000000000..bf16a1adf
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch
@@ -0,0 +1,30 @@
+From 629ac492b1d9bc709d17337eb9b1c28603eca250 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 28 Jun 2017 11:01:25 -0700
+Subject: [PATCH] memcheck/tests: Use ucontext_t instead of struct ucontext
+
+glibc 2.26 does not expose struct ucontext anymore
+
+Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=381769]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/stack_changes.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
+index ffb49c6..acc4109 100644
+--- a/memcheck/tests/linux/stack_changes.c
++++ b/memcheck/tests/linux/stack_changes.c
+@@ -11,7 +11,7 @@
+ // checks that Valgrind notices their stack changes properly.
+
+ #ifdef __GLIBC__
+-typedef struct ucontext mycontext;
++typedef ucontext_t mycontext;
+
+ mycontext ctx1, ctx2, oldc;
+ int count;
+--
+2.13.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
new file mode 100644
index 000000000..27366153f
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch
@@ -0,0 +1,31 @@
+From 64ad2744acfb4fa40b1c114633a053f87125a203 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 00:46:39 -0700
+Subject: [PATCH 1/6] sigqueue: Rename _sifields to __si_fields on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/sigqueue.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c
+index d18bd72..acb7cba 100644
+--- a/memcheck/tests/linux/sigqueue.c
++++ b/memcheck/tests/linux/sigqueue.c
+@@ -8,6 +8,11 @@
+ #include <syscall.h>
+ #include <unistd.h>
+
++/* musl libc defines siginfo_t __si_fields instead of _sifields */
++#if defined(__linux__) && !defined(__GLIBC__)
++#define _sifields __si_fields
++#endif
++
+ int main(int argc, char **argv)
+ {
+ siginfo_t *si;
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch
new file mode 100644
index 000000000..185b8f9e6
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch
@@ -0,0 +1,39 @@
+From de692e359801a1f0488c76267e4f904dd2efe754 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 00:39:07 -0700
+Subject: [PATCH] str_tester.c: Limit rawmemchr() test to glibc
+
+rawmemchr() is a GNU extention therefore mark it so
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ memcheck/tests/str_tester.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/memcheck/tests/str_tester.c b/memcheck/tests/str_tester.c
+index 9f7790a..47e4b4a 100644
+--- a/memcheck/tests/str_tester.c
++++ b/memcheck/tests/str_tester.c
+@@ -504,7 +504,7 @@ test_strchrnul (void)
+ #endif
+
+ // DDD: better done by testing for the function.
+-#if !defined(__APPLE__) && !defined(__sun)
++#if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ static void
+ test_rawmemchr (void)
+ {
+@@ -1442,7 +1442,7 @@ main (void)
+ test_strchrnul ();
+ # endif
+
+-# if !defined(__APPLE__) && !defined(__sun)
++# if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ /* rawmemchr. */
+ test_rawmemchr ();
+ # endif
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch
new file mode 100644
index 000000000..3f9f33b48
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0002-context-APIs-are-not-available-on-musl.patch
@@ -0,0 +1,49 @@
+From 862b807076d57f2f58ed9d572ddac8bb402774a2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:01:10 -0700
+Subject: [PATCH 2/6] context APIs are not available on musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/stack_changes.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
+index a978fc2..ffb49c6 100644
+--- a/memcheck/tests/linux/stack_changes.c
++++ b/memcheck/tests/linux/stack_changes.c
+@@ -10,6 +10,7 @@
+ // This test is checking the libc context calls (setcontext, etc.) and
+ // checks that Valgrind notices their stack changes properly.
+
++#ifdef __GLIBC__
+ typedef struct ucontext mycontext;
+
+ mycontext ctx1, ctx2, oldc;
+@@ -51,9 +52,11 @@ int init_context(mycontext *uc)
+
+ return ret;
+ }
++#endif
+
+ int main(int argc, char **argv)
+ {
++#ifdef __GLIBC__
+ int c1 = init_context(&ctx1);
+ int c2 = init_context(&ctx2);
+
+@@ -66,6 +69,8 @@ int main(int argc, char **argv)
+ //free(ctx1.uc_stack.ss_sp);
+ VALGRIND_STACK_DEREGISTER(c2);
+ //free(ctx2.uc_stack.ss_sp);
+-
++#else
++ printf("libc context call APIs e.g. getcontext() are deprecated by posix\n");
++#endif
+ return 0;
+ }
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch
new file mode 100644
index 000000000..543347229
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0002-memcheck-x86-Define-__THROW-if-not-defined.patch
@@ -0,0 +1,32 @@
+From 67d199dbdcbb3feff5f8928f87725fc64c0307d7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:36:42 -0700
+Subject: [PATCH 2/3] memcheck/x86: Define __THROW if not defined
+
+musl does not have __THROW, therefore make it null
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ memcheck/tests/x86-linux/scalar.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h
+index ef28b03..52f742e 100644
+--- a/memcheck/tests/x86-linux/scalar.h
++++ b/memcheck/tests/x86-linux/scalar.h
+@@ -11,6 +11,10 @@
+ #include <sys/types.h>
+ #include <sys/mman.h>
+
++#ifndef __THROW
++#define __THROW
++#endif
++
+ // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
+ // declare this ourselves.
+ extern long int syscall (long int __sysno, ...) __THROW;
+--
+2.13.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
new file mode 100644
index 000000000..c2965c40d
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0003-correct-include-directive-path-for-config.h.patch
@@ -0,0 +1,45 @@
+From ecbdea7bd8b08205f1bc3f6b72d4b4a80f313fcb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:03:17 -0700
+Subject: [PATCH 3/6] correct include directive path for config.h
+
+when building out of source tree, it can not find
+the generated config.h otherwise
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ memcheck/tests/linux/syscalls-2007.c | 2 +-
+ memcheck/tests/linux/syslog-syscall.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/memcheck/tests/linux/syscalls-2007.c b/memcheck/tests/linux/syscalls-2007.c
+index b61c6d5..cc3fd62 100644
+--- a/memcheck/tests/linux/syscalls-2007.c
++++ b/memcheck/tests/linux/syscalls-2007.c
+@@ -10,7 +10,7 @@
+
+ #define _GNU_SOURCE
+
+-#include "../../config.h"
++#include "config.h"
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <stdint.h>
+diff --git a/memcheck/tests/linux/syslog-syscall.c b/memcheck/tests/linux/syslog-syscall.c
+index 1143722..21e758b 100644
+--- a/memcheck/tests/linux/syslog-syscall.c
++++ b/memcheck/tests/linux/syslog-syscall.c
+@@ -6,7 +6,7 @@
+ * klogctl().
+ */
+
+-#include "../../config.h"
++#include "config.h"
+ #include <stdio.h>
+ #if defined(HAVE_SYS_KLOG_H)
+ #include <sys/klog.h>
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
new file mode 100644
index 000000000..fa1344c85
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch
@@ -0,0 +1,68 @@
+From d103475875858ab8a2e6b53ce178bb2f63883d4c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 17:37:56 -0700
+Subject: [PATCH 3/3] tests/seg_override: Replace __modify_ldt() with syscall()
+
+__modify_ldt() is specific to glibc, replacing it with syscall()
+makes it more portable.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ none/tests/x86-linux/seg_override.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/none/tests/x86-linux/seg_override.c b/none/tests/x86-linux/seg_override.c
+index b7619c9..c89874b 100644
+--- a/none/tests/x86-linux/seg_override.c
++++ b/none/tests/x86-linux/seg_override.c
+@@ -2,6 +2,8 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
++#include <syscall.h>
+
+ /* Stuff from Wine. */
+
+@@ -52,14 +54,11 @@ inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent )
+ /* our copy of the ldt */
+ LDT_ENTRY ldt_copy[8192];
+
+-/* System call to set LDT entry. */
+-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
+-extern int __modify_ldt (int, void *, size_t);
+-
+ void print_ldt ( void )
+ {
+ int res;
+- res = __modify_ldt( 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
++ /* System call to set LDT entry. */
++ res = syscall(SYS_modify_ldt, 0, ldt_copy, 8192*sizeof(LDT_ENTRY) );
+ printf("got %d bytes\n", res );
+ perror("error is");
+ }
+@@ -83,9 +82,6 @@ struct modify_ldt_ldt_s
+ unsigned int empty:25;
+ };
+
+-/* System call to set LDT entry. */
+-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t);
+-
+ void set_ldt1 ( void* base )
+ {
+ int stat;
+@@ -102,7 +98,8 @@ void set_ldt1 ( void* base )
+ ldt_entry.read_exec_only = 0;
+ ldt_entry.limit_in_pages = 0;
+ ldt_entry.seg_not_present = 0;
+- stat = __modify_ldt (1, &ldt_entry, sizeof (ldt_entry));
++ /* System call to set LDT entry. */
++ stat = syscall(SYS_modify_ldt, 1, &ldt_entry, sizeof (ldt_entry));
+ printf("stat = %d\n", stat);
+ }
+
+--
+2.13.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
new file mode 100644
index 000000000..39022d04a
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0004-Fix-out-of-tree-builds.patch
@@ -0,0 +1,183 @@
+From 739421e253e6eba3eb6438651822f80fa9c0502a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:31:50 +0200
+Subject: [PATCH 1/2] Fix out of tree builds.
+
+The paths to these files need to be fully specified in
+the out of tree build case. glibc-2.X.supp is a generated file so the full path
+is deliberately not specified in that case.
+
+RP 2013/03/23
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ configure.ac | 68 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 34 insertions(+), 34 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3874296fde0b..7a5ba2c8557e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -373,50 +373,50 @@ case "${host_os}" in
+ 9.*)
+ AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 10.*)
+ AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 11.*)
+ AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 12.*)
+ AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 13.*)
+ AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin13.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 14.*)
+ AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin14.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 15.*)
+ AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin15.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 16.*)
+ AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra])
+ AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version])
+- DEFAULT_SUPP="darwin16.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ *)
+ AC_MSG_RESULT([unsupported (${kernel})])
+@@ -428,13 +428,13 @@ case "${host_os}" in
+ solaris2.11*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VGCONF_OS="solaris"
+- DEFAULT_SUPP="solaris11.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris11.supp ${DEFAULT_SUPP}"
+ ;;
+
+ solaris2.12*)
+ AC_MSG_RESULT([ok (${host_os})])
+ VGCONF_OS="solaris"
+- DEFAULT_SUPP="solaris12.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/solaris12.supp ${DEFAULT_SUPP}"
+ ;;
+
+ *)
+@@ -982,29 +982,29 @@ AC_MSG_CHECKING([the glibc version])
+ case "${GLIBC_VERSION}" in
+ 2.2)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[3-6]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+- DEFAULT_SUPP="glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-${GLIBC_VERSION}.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.[[7-9]])
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.10|2.11)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+ AC_DEFINE([GLIBC_MANDATORY_STRLEN_REDIRECT], 1,
+ [Define to 1 if strlen() has been optimized heavily (amd64 glibc >= 2.10)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ 2.*)
+ AC_MSG_RESULT(${GLIBC_VERSION} family)
+@@ -1013,8 +1013,8 @@ case "${GLIBC_VERSION}" in
+ AC_DEFINE([GLIBC_MANDATORY_INDEX_AND_STRLEN_REDIRECT], 1,
+ [Define to 1 if index() and strlen() have been optimized heavily (x86 glibc >= 2.12)])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
+ darwin)
+ AC_MSG_RESULT(Darwin)
+@@ -1024,7 +1024,7 @@ case "${GLIBC_VERSION}" in
+ bionic)
+ AC_MSG_RESULT(Bionic)
+ AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
+- DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
+ ;;
+ solaris)
+ AC_MSG_RESULT(Solaris)
+@@ -1051,11 +1051,11 @@ if test "$VGCONF_OS" != "solaris"; then
+ # attempt to detect whether such libraries are installed on the
+ # build machine (or even if any X facilities are present); just
+ # add the suppressions antidisirregardless.
+- DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
+- DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
+
+ # Add glibc and X11 suppressions for exp-sgcheck
+- DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
++ DEFAULT_SUPP="$srcdir/exp-sgcheck.supp ${DEFAULT_SUPP}"
+ fi
+
+
+--
+2.13.2.3.g44cd85c14
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch
new file mode 100644
index 000000000..1cb706254
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0004-pth_atfork1.c-Define-error-API-for-musl.patch
@@ -0,0 +1,37 @@
+From fb77fef4f866dac7bcc6d1ae025da60564869f84 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:06:11 -0700
+Subject: [PATCH 4/6] pth_atfork1.c: Define error() API for musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ none/tests/pth_atfork1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/none/tests/pth_atfork1.c b/none/tests/pth_atfork1.c
+index 34201ef..b7f5f2d 100644
+--- a/none/tests/pth_atfork1.c
++++ b/none/tests/pth_atfork1.c
+@@ -18,7 +18,7 @@
+ Boston, MA 02111-1307, USA. */
+
+ #include <errno.h>
+-#if !defined(__APPLE__) && !defined(__sun)
++#if !defined(__APPLE__) && !defined(__sun) && defined(__GLIBC__)
+ # include <error.h>
+ #endif
+ #include <stdlib.h>
+@@ -27,7 +27,7 @@
+ #include <sys/wait.h>
+ #include <stdio.h>
+
+-#if defined(__APPLE__) || defined(__sun)
++#if defined(__APPLE__) || defined(__sun) || (defined(__linux__) && !defined(__GLIBC__))
+ #include <string.h> /* strerror */
+ static void error (int status, int errnum, char* msg)
+ {
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
new file mode 100644
index 000000000..7985308e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch
@@ -0,0 +1,252 @@
+From f49f27f1bc67d07440b0ac9a7d767a8ea1589bfe Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 15 Dec 2015 15:50:44 +0200
+Subject: [PATCH 5/5] Modify vg_test wrapper to support PTEST formats
+
+Change the valgrind regression test script vg_regtest to
+support the yocto ptest stdout reporting format. The commit adds
+'--yocto-ptest' as an optional argument to vg_regtest, which alters
+the output to use the ptest infrastructure reporting format:
+ "[PASS|SKIP|FAIL]: testname"
+instead of valgrind's internal test reporting format. Without the added
+option, --yocto-ptest, the valgrind regression test output is unchanged.
+
+Enforce 30 seconds limit for the test.
+This resume execution of the remaining tests when valgrind hangs.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/vg_regtest.in | 75 +++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 55 insertions(+), 20 deletions(-)
+
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index a441f42..cb05b52 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -47,6 +47,7 @@
+ # --loop-till-fail: loops on the test(s) till one fail, then exit
+ # This is useful to obtain detailed trace or --keep-unfiltered
+ # output of a non deterministic test failure
++# --yocto-ptest: output in yocto ptest format
+ #
+ # The easiest way is to run all tests in valgrind/ with (assuming you installed
+ # in $PREFIX):
+@@ -139,7 +140,7 @@ my $usage="\n"
+ . "Usage:\n"
+ . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
+ . " --outer-valgrind, --outer-tool, --outer-args\n"
+- . " --loop-till-fail]\n"
++ . " --loop-till-fail, --yocto-ptest]\n"
+ . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
+ . "\n";
+
+@@ -186,6 +187,7 @@ my $outer_args;
+ my $valgrind_lib = "$tests_dir/.in_place";
+ my $keepunfiltered = 0;
+ my $looptillfail = 0;
++my $yoctoptest = 0;
+
+ # default filter is the one named "filter_stderr" in the test's directory
+ my $default_stderr_filter = "filter_stderr";
+@@ -244,6 +246,8 @@ sub process_command_line()
+ $keepunfiltered = 1;
+ } elsif ($arg =~ /^--loop-till-fail$/) {
+ $looptillfail = 1;
++ } elsif ($arg =~ /^--yocto-ptest$/) {
++ $yoctoptest = 1;
+ } else {
+ die $usage;
+ }
+@@ -365,13 +369,28 @@ sub read_vgtest_file($)
+ #----------------------------------------------------------------------------
+ # Since most of the program time is spent in system() calls, need this to
+ # propagate a Ctrl-C enabling us to quit.
+-sub mysystem($)
++# Enforce 30 seconds limit for the test.
++# This resume execution of the remaining tests if valgrind hangs.
++sub mysystem($)
+ {
+- my $exit_code = system($_[0]);
+- ($exit_code == 2) and exit 1; # 2 is SIGINT
+- return $exit_code;
++ my $exit_code=0;
++ eval {
++ local $SIG{'ALRM'} = sub { die "timed out\n" };
++ alarm(30);
++ $exit_code = system($_[0]);
++ alarm (0);
++ ($exit_code == 2) and die "SIGINT\n"; # 2 is SIGINT
++ };
++ if ($@) {
++ if ($@ eq "timed out\n") {
++ print "timed out\n";
++ return 1;
++ }
++ if ($@ eq "SIGINT\n") {
++ exit 1;
++ }
++ }
+ }
+-
+ # if $keepunfiltered, copies $1 to $1.unfiltered.out
+ # renames $0 tp $1
+ sub filtered_rename($$)
+@@ -419,23 +438,25 @@ sub do_diffs($$$$)
+ # A match; remove .out and any previously created .diff files.
+ unlink("$name.$mid.out");
+ unlink(<$name.$mid.diff*>);
+- return;
++ return 0;
+ }
+ }
+ }
+ # If we reach here, none of the .exp files matched.
+- print "*** $name failed ($mid) ***\n";
++ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
+ push(@failures, sprintf("%-40s ($mid)", "$fullname"));
+ $num_failures{$mid}++;
+ if ($looptillfail == 1) {
+ print "Failure encountered, stopping to loop\n";
+ exit 1
+ }
++ return 1;
+ }
+
+ sub do_one_test($$)
+ {
+ my ($dir, $vgtest) = @_;
++ my $diffStatus = 0;
+ $vgtest =~ /^(.*)\.vgtest/;
+ my $name = $1;
+ my $fullname = "$dir/$name";
+@@ -454,7 +475,11 @@ sub do_one_test($$)
+ } elsif (256 == $prereq_res) {
+ # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
+ # Prereq failed, skip.
+- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ if ($yoctoptest == 0) {
++ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++ } else {
++ printf("SKIP: $fullname\n");
++ }
+ return;
+ } else {
+ # Bad prereq; abort.
+@@ -472,7 +497,7 @@ sub do_one_test($$)
+ }
+ # If there is a progB, let's start it in background:
+ printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
+- "$name:");
++ "$name:") if ($yoctoptest == 0);
+ # progB.done used to detect child has finished. See below.
+ # Note: redirection of stdout and stderr is before $progB to allow argsB
+ # to e.g. redirect stdoutB to stderrB
+@@ -488,7 +513,8 @@ sub do_one_test($$)
+ . "touch progB.done) &");
+ }
+ } else {
+- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
++ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
++ if ($yoctoptest == 0);
+ }
+
+ # Collect environment variables, if any.
+@@ -529,7 +555,7 @@ sub do_one_test($$)
+ # Find all the .stdout.exp files. If none, use /dev/null.
+ my @stdout_exps = <$name.stdout.exp*>;
+ @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
+- do_diffs($fullname, $name, "stdout", \@stdout_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
+
+ # Filter stderr
+ $stderr_filter_args = $name if (! defined $stderr_filter_args);
+@@ -538,7 +564,7 @@ sub do_one_test($$)
+ # Find all the .stderr.exp files. At least one must exist.
+ my @stderr_exps = <$name.stderr.exp*>;
+ (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
+- do_diffs($fullname, $name, "stderr", \@stderr_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
+
+ if (defined $progB) {
+ # wait for the child to be finished
+@@ -562,7 +588,7 @@ sub do_one_test($$)
+ # Find all the .stdoutB.exp files. If none, use /dev/null.
+ my @stdoutB_exps = <$name.stdoutB.exp*>;
+ @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
+- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
+
+ # Filter stderr
+ $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
+@@ -571,7 +597,7 @@ sub do_one_test($$)
+ # Find all the .stderrB.exp files. At least one must exist.
+ my @stderrB_exps = <$name.stderrB.exp*>;
+ (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
+- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
++ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
+ }
+
+ # Maybe do post-test check
+@@ -583,7 +609,7 @@ sub do_one_test($$)
+ # Find all the .post.exp files. If none, use /dev/null.
+ my @post_exps = <$name.post.exp*>;
+ @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
+- do_diffs($fullname, $name, "post", \@post_exps);
++ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
+ }
+ }
+
+@@ -592,6 +618,13 @@ sub do_one_test($$)
+ print("(cleanup operation failed: $cleanup)\n");
+ }
+
++ if ($yoctoptest == 1) {
++ if ($diffStatus == 0) {
++ print("PASS: $fullname\n");
++ } else {
++ print("FAIL: $fullname\n");
++ }
++ }
+ $num_tests_done++;
+ }
+
+@@ -631,7 +664,7 @@ sub test_one_dir($$)
+ my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
+
+ if ($found_tests) {
+- print "-- Running tests in $full_dir $dashes\n";
++ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+ foreach my $f (@fs) {
+ if (-d $f) {
+@@ -641,7 +674,7 @@ sub test_one_dir($$)
+ }
+ }
+ if ($found_tests) {
+- print "-- Finished tests in $full_dir $dashes\n";
++ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+ }
+
+ chdir("..");
+@@ -667,10 +700,12 @@ sub summarise_results
+ $num_failures{"stdout"}, plural($num_failures{"stdout"}),
+ $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
+ $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
+- $num_failures{"post"}, plural($num_failures{"post"}));
++ $num_failures{"post"}, plural($num_failures{"post"}))
++ if ($yoctoptest == 0);
+
+ foreach my $failure (@failures) {
+- print "$failure\n";
++ print "$failure\n"
++ if ($yoctoptest == 0);
+ }
+ print "\n";
+ }
+--
+2.6.2
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch
new file mode 100644
index 000000000..6176640e4
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch
@@ -0,0 +1,30 @@
+From b4b9f072c22f96844e02cb9d68f7ff2408680817 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:07:59 -0700
+Subject: [PATCH 5/6] tc20_verifywrap.c: Fake __GLIBC_PREREQ with musl
+
+similar to sun
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ helgrind/tests/tc20_verifywrap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/helgrind/tests/tc20_verifywrap.c b/helgrind/tests/tc20_verifywrap.c
+index c110000..a311a49 100644
+--- a/helgrind/tests/tc20_verifywrap.c
++++ b/helgrind/tests/tc20_verifywrap.c
+@@ -20,7 +20,7 @@
+
+ #if !defined(__APPLE__)
+
+-#if defined(__sun__)
++#if defined(__sun__) || (defined(__linux__) && !defined(__GLIBC__))
+ /* Fake __GLIBC_PREREQ on Solaris. Pretend glibc >= 2.4. */
+ # define __GLIBC_PREREQ
+ #else
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch b/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch
new file mode 100644
index 000000000..05886c743
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch
@@ -0,0 +1,32 @@
+From a6547fc17c120dbd95b852f50b0c4bdee4fedb9a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 01:20:32 -0700
+Subject: [PATCH 6/6] pth_detached3.c: Dereference pthread_t before adding
+ offset to it
+
+Fixes
+error: invalid use of undefined type 'struct __pthread'
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ drd/tests/pth_detached3.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drd/tests/pth_detached3.c b/drd/tests/pth_detached3.c
+index c02eef1..35d43a6 100644
+--- a/drd/tests/pth_detached3.c
++++ b/drd/tests/pth_detached3.c
+@@ -21,7 +21,7 @@ int main(int argc, char** argv)
+ pthread_detach(thread);
+
+ /* Invoke pthread_detach() with an invalid thread ID. */
+- pthread_detach(thread + 8);
++ pthread_detach((pthread_t*)(&thread + 8));
+
+ fprintf(stderr, "Finished.\n");
+
+--
+2.13.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
new file mode 100644
index 000000000..07774f38a
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
@@ -0,0 +1,96 @@
+From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001
+From: Aneesh Bansal <aneesh.bansal@freescale.com>
+Date: Mon, 21 Nov 2011 17:31:39 +0530
+Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
+---
+Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind :
+dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
+disInstr(ppc): unhandled instruction: 0x7C0F82A6
+
+
+ VEX/priv/guest_ppc_defs.h | 2 ++
+ VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++
+ VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++
+ 3 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
+index dd3c62e..11a34aa 100644
+--- a/VEX/priv/guest_ppc_defs.h
++++ b/VEX/priv/guest_ppc_defs.h
+@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
+
+ extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
+
++extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt );
++
+ extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
+ UInt vD_idx, UInt sh,
+ UInt shift_right );
+diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
+index 11aa428..b49ea3f 100644
+--- a/VEX/priv/guest_ppc_helpers.c
++++ b/VEX/priv/guest_ppc_helpers.c
+@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
+ # endif
+ }
+
++/* CALLED FROM GENERATED CODE */
++/* DIRTY HELPER (non-referentially transparent) */
++UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 )
++{
++# if defined(__powerpc__) || defined(_AIX)
++ UInt spr;
++ if (r527) {
++ __asm__ __volatile__("mfspr %0,527" : "=b"(spr));
++ } else {
++ __asm__ __volatile__("mfspr %0,526" : "=b"(spr));
++ }
++ return spr;
++# else
++ return 0;
++# endif
++}
++
++
+
+ /* CALLED FROM GENERATED CODE */
+ /* DIRTY HELPER (reads guest state, writes guest mem) */
+diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
+index f8d220d..37c8974 100644
+--- a/VEX/priv/guest_ppc_toIR.c
++++ b/VEX/priv/guest_ppc_toIR.c
+@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr )
+ break;
+ }
+
++
++ case 526 /* 0x20E */:
++ case 527 /* 0x20F */: {
++ UInt arg = SPR==526 ? 0 : 1;
++ IRTemp val = newTemp(Ity_I32);
++ IRExpr** args = mkIRExprVec_1( mkU32(arg) );
++ IRDirty* d = unsafeIRDirty_1_N(
++ val,
++ 0/*regparms*/,
++ "ppc32g_dirtyhelper_MFSPR_526_527",
++ fnptr_to_fnentry
++ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527),
++ args
++ );
++ /* execute the dirty call, dumping the result in val. */
++ stmt( IRStmt_Dirty(d) );
++ putIReg( rD_addr,
++ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) );
++ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR);
++ break;
++ }
++
+ default:
+ vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
+ return False;
+--
+1.7.0.4
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch b/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
new file mode 100644
index 000000000..5fcfec001
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/avoid-neon-for-targets-which-don-t-support-it.patch
@@ -0,0 +1,33 @@
+From 8facc29c3c56e6cf9cfef70986cf73876044a3fb Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:42:36 -0800
+Subject: [PATCH] avoid neon for targets which don't support it
+
+The sh-mem-random.c test app tries to use neon loads and stores to
+test 64-bit float copies when building for ARM. Allow it to do so if
+possible, but fallback to C when building for ARM targets which don't
+support neon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ memcheck/tests/sh-mem-random.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/memcheck/tests/sh-mem-random.c b/memcheck/tests/sh-mem-random.c
+index ae82248..816e139 100644
+--- a/memcheck/tests/sh-mem-random.c
++++ b/memcheck/tests/sh-mem-random.c
+@@ -191,7 +191,7 @@ void do_test_at ( U1* arr )
+ "emms"
+ : : "r"(arr+dst), "r"(arr+src) : "memory"
+ );
+-#elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
++#elif defined(__linux__) && defined(__arm__) && defined(__ARM_NEON__) && !defined(__aarch64__)
+ /* On arm32, many compilers generate a 64-bit float move
+ using two 32 bit integer registers, which completely
+ defeats this test. Hence force a 64-bit NEON load and
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
new file mode 100644
index 000000000..b431d3356
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -0,0 +1,78 @@
+From 67e7a690107efb16d6d5aebfe420b64a552accdf Mon Sep 17 00:00:00 2001
+From: Qing He <qing.he@intel.com>
+Date: Tue, 31 Aug 2010 22:51:58 +0800
+Subject: [PATCH] valgrind: fix perl scripts
+
+this is a temporary patch to workaround cross compilation.
+otherwise @PERL@ will be replaced to perl-native binary,
+this creates unusable scripts and fails FILERDEPENDS mechanism
+(esp. rpm)
+
+a better fix would need:
+ 1. configure.ac should differentiate PERL and HOSTPERL
+ 2. optionally remove ${STAGING_DIR} in #! line before do_install
+
+8/31/2010 - created by Qing He <qing.he@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ cachegrind/cg_annotate.in | 2 +-
+ cachegrind/cg_diff.in | 2 +-
+ massif/ms_print.in | 2 +-
+ perf/vg_perf.in | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
+index 69365e8..978265d 100644
+--- a/cachegrind/cg_annotate.in
++++ b/cachegrind/cg_annotate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's annotator. cg_annotate.in ---##
+diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
+index 395460b..05873cc 100755
+--- a/cachegrind/cg_diff.in
++++ b/cachegrind/cg_diff.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's differencer. cg_diff.in ---##
+diff --git a/massif/ms_print.in b/massif/ms_print.in
+index e6fae89..3b85b40 100755
+--- a/massif/ms_print.in
++++ b/massif/ms_print.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+
+ ##--------------------------------------------------------------------##
+ ##--- Massif's results printer ms_print.in ---##
+diff --git a/perf/vg_perf.in b/perf/vg_perf.in
+index 7a80cb0..28f6156 100644
+--- a/perf/vg_perf.in
++++ b/perf/vg_perf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind performance testing script vg_perf ---##
+ ##--------------------------------------------------------------------##
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index cb05b52..032e947 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind regression testing script vg_regtest ---##
+ ##--------------------------------------------------------------------##
+---
+2.4.0
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/link-gz-tests.patch b/poky/meta/recipes-devtools/valgrind/valgrind/link-gz-tests.patch
new file mode 100644
index 000000000..db322398c
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/link-gz-tests.patch
@@ -0,0 +1,27 @@
+When checking if the compiler supports compressed debug sections we need to
+actually link instead of just compile. Otherwise the compiler thinks that
+they are supported, but gold does not support -gz=zlib.
+
+Upstream-Status: Backport (r16459)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- a/configure.ac~ 2017-07-11 11:53:16.000000000 +0100
++++ b/configure.ac 2017-07-11 18:16:13.674130483 +0100
+@@ -2119,7 +2119,7 @@
+ safe_CFLAGS=$CFLAGS
+ CFLAGS="-g -gz=zlib"
+
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
+ return 0;
+ ]])], [
+ ac_have_gz_zlib=yes
+@@ -2139,7 +2139,7 @@
+ safe_CFLAGS=$CFLAGS
+ CFLAGS="-g -gz=zlib-gnu"
+
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[
+ return 0;
+ ]])], [
+ ac_have_gz_zlib_gnu=yes
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/mask-CPUID-support-in-HWCAP-on-aarch64.patch b/poky/meta/recipes-devtools/valgrind/valgrind/mask-CPUID-support-in-HWCAP-on-aarch64.patch
new file mode 100644
index 000000000..89a95b82f
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/mask-CPUID-support-in-HWCAP-on-aarch64.patch
@@ -0,0 +1,36 @@
+Fix runtime Valgrind failure
+
+This patch is derived from
+https://bugzilla.redhat.com/show_bug.cgi?id=1464211
+
+At runtime it will fails like this:
+
+ARM64 front end: branch_etc
+disInstr(arm64): unhandled instruction 0xD5380001
+disInstr(arm64): 1101'0101 0011'1000 0000'0000 0000'0001 ==2082==
+valgrind: Unrecognised instruction at address 0x4014e64.
+
+This patch is a workaround by masking all HWCAP
+
+Upstream-Status: Pending
+
+Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
+
+Index: valgrind-3.13.0/coregrind/m_initimg/initimg-linux.c
+===================================================================
+
+--- valgrind-3.13.0.orig/coregrind/m_initimg/initimg-linux.c 2018-03-04 22:22:17.698572675 -0800
++++ valgrind-3.13.0/coregrind/m_initimg/initimg-linux.c 2018-03-04 22:23:25.727815624 -0800
+@@ -703,6 +703,12 @@
+ (and anything above) are not supported by Valgrind. */
+ auxv->u.a_val &= VKI_HWCAP_S390_TE - 1;
+ }
++# elif defined(VGP_arm64_linux)
++ {
++ /* Linux 4.11 started populating this for arm64, but we
++ currently don't support any. */
++ auxv->u.a_val = 0;
++ }
+ # endif
+ break;
+ # if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/ppc-headers.patch b/poky/meta/recipes-devtools/valgrind/valgrind/ppc-headers.patch
new file mode 100644
index 000000000..51259db00
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/ppc-headers.patch
@@ -0,0 +1,87 @@
+Backport a patch from upstream to fix test compilation for PPC where
+system headers don't get included.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+r16450 | mjw | 2017-06-16 10:33:35 +0100 (Fri, 16 Jun 2017) | 7 lines
+
+ppc64 doesn't compile test_isa_2_06_partx.c without VSX support
+
+The #ifdef HAS_VSX guard is wrongly placed. It makes the standard
+include headers not be used. Causing a build failure. Fix by moving
+the #ifdef HAS_VSX after the standard includes.
+
+Index: none/tests/ppc32/test_isa_2_06_part3.c
+===================================================================
+--- a/none/tests/ppc32/test_isa_2_06_part3.c (revision 16449)
++++ b/none/tests/ppc32/test_isa_2_06_part3.c (revision 16450)
+@@ -20,17 +20,18 @@
+ The GNU General Public License is contained in the file COPYING.
+ */
+
+-#ifdef HAS_VSX
+-
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <malloc.h>
+-#include <altivec.h>
+ #include <math.h>
+ #include <unistd.h> // getopt
+
++#ifdef HAS_VSX
++
++#include <altivec.h>
++
+ #ifndef __powerpc64__
+ typedef uint32_t HWord_t;
+ #else
+Index: none/tests/ppc32/test_isa_2_06_part1.c
+===================================================================
+--- a/none/tests/ppc32/test_isa_2_06_part1.c (revision 16449)
++++ b/none/tests/ppc32/test_isa_2_06_part1.c (revision 16450)
+@@ -20,13 +20,14 @@
+ The GNU General Public License is contained in the file COPYING.
+ */
+
+-#ifdef HAS_VSX
+-
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <malloc.h>
++
++#ifdef HAS_VSX
++
+ #include <altivec.h>
+
+ #ifndef __powerpc64__
+Index: none/tests/ppc32/test_isa_2_06_part2.c
+===================================================================
+--- a/none/tests/ppc32/test_isa_2_06_part2.c (revision 16449)
++++ b/none/tests/ppc32/test_isa_2_06_part2.c (revision 16450)
+@@ -20,17 +20,18 @@
+ The GNU General Public License is contained in the file COPYING.
+ */
+
+-#ifdef HAS_VSX
+-
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <malloc.h>
+-#include <altivec.h>
+ #include <math.h>
+ #include <unistd.h> // getopt
+
++#ifdef HAS_VSX
++
++#include <altivec.h>
++
+ #ifndef __powerpc64__
+ typedef uint32_t HWord_t;
+ #else
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest b/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 000000000..447d33c8c
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# run-ptest - 'ptest' test infrastructure shell script that
+# wraps the valgrind regression script vg_regtest.
+#
+# Dave Lerner <dave.lerner@windriver.com>
+###############################################################
+VALGRINDLIB=@libdir@/valgrind
+LOG="${VALGRINDLIB}/ptest/valgrind_ptest_$(date +%Y%m%d-%H%M%S).log"
+
+cd ${VALGRINDLIB}/ptest && ./tests/vg_regtest --all \
+ --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
+ --yocto-ptest 2>&1|tee ${LOG}
+
+passed=`grep PASS: ${LOG}|wc -l`
+failed=`grep FAIL: ${LOG}|wc -l`
+skipped=`grep SKIP: ${LOG}|wc -l`
+all=$((passed + failed + skipped))
+
+( echo "=== Test Summary ==="
+ echo "TOTAL: ${all}"
+ echo "PASSED: ${passed}"
+ echo "FAILED: ${failed}"
+ echo "SKIPPED: ${skipped}"
+) | tee -a /${LOG}
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch b/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
new file mode 100644
index 000000000..adea40521
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch
@@ -0,0 +1,44 @@
+From d134dafc2f11e0d247420a0ba360bcdef77b4093 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 19 Jan 2016 16:00:00 -0800
+Subject: [PATCH] use appropriate -march/-mcpu/-mfpu for ARM test apps
+
+Ensure that test apps in none/tests/arm are compiled with appropriate
+-march/-mcpu/-mfpu flags to support the instructions being tested.
+The aim is to build all tests, even ones which may not run correctly
+on all target CPUs.
+
+For tests requiring armv7ve instructions, ensure that we set both
+-march=armv7ve and -mcpu=cortex-a15 (since some TUNE_CCARGS may set
+-march=armv7-a and adding -mcpu=cortex-a15 alone is not enough to
+over-ride that).
+
+See similar cases in none/tests/arm/Makefile.am
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ none/tests/arm/Makefile.am | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
+index 4507a20..825290f 100644
+--- a/none/tests/arm/Makefile.am
++++ b/none/tests/arm/Makefile.am
+@@ -62,8 +62,10 @@ neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
+ -mfpu=neon \
+ -mthumb
+
+-intdiv_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a15 -mthumb
++intdiv_CFLAGS = $(AM_CFLAGS) -g -march=armv7ve -mcpu=cortex-a15 -mthumb
+ ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
+ ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
+
+-vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a15 -mfpu=vfpv4 -marm
++vcvt_fixed_float_VFP_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mfpu=vfpv3
++
++vfpv4_fma_CFLAGS = $(AM_CFLAGS) -g -O0 -march=armv7ve -mcpu=cortex-a15 -mfpu=vfpv4 -marm
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch b/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
new file mode 100644
index 000000000..d04297dca
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind/valgrind-make-ld-XXX.so-strlen-intercept-optional.patch
@@ -0,0 +1,45 @@
+From 005bd11809a1ce65e9f2c28e884354a4741650b9 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 13 Dec 2016 11:29:55 +0800
+Subject: [PATCH] make ld-XXX.so strlen intercept optional
+
+Hack: Depending on how glibc was compiled (e.g. optimised for size or
+built with _FORTIFY_SOURCE enabled) the strlen symbol might not be
+found in ld-XXX.so. Therefore although we should still try to
+intercept it, don't make it mandatory to do so.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ coregrind/m_redir.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
+index ff35009..d7d6816 100644
+--- a/coregrind/m_redir.c
++++ b/coregrind/m_redir.c
+@@ -1275,7 +1275,18 @@ static void add_hardwired_spec (const HChar* sopatt, const HChar* fnpatt,
+ spec->to_addr = to_addr;
+ spec->isWrap = False;
+ spec->isGlobal = False;
+- spec->mandatory = mandatory;
++
++ /* Hack: Depending on how glibc was compiled (e.g. optimised for size or
++ built with _FORTIFY_SOURCE enabled) the strlen symbol might not be found.
++ Therefore although we should still try to intercept it, don't make it
++ mandatory to do so. We over-ride "mandatory" here to avoid the need to
++ patch the many different architecture specific callers to
++ add_hardwired_spec(). */
++ if (0==VG_(strcmp)("strlen", fnpatt))
++ spec->mandatory = NULL;
++ else
++ spec->mandatory = mandatory;
++
+ /* VARIABLE PARTS */
+ spec->mark = False; /* not significant */
+ spec->done = False; /* not significant */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb b/poky/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb
new file mode 100644
index 000000000..d3af35e7f
--- /dev/null
+++ b/poky/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb
@@ -0,0 +1,156 @@
+SUMMARY = "Valgrind memory debugger and instrumentation framework"
+HOMEPAGE = "http://valgrind.org/"
+BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
+LICENSE = "GPLv2 & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://include/pub_tool_basics.h;beginline=6;endline=29;md5=d4de0407239381463cf01dd276d7c22e \
+ file://include/valgrind.h;beginline=1;endline=56;md5=ad3b317f3286b6b704575d9efe6ca5df \
+ file://COPYING.DOCS;md5=24ea4c7092233849b4394699333b5c56"
+
+X11DEPENDS = "virtual/libx11"
+DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
+ "
+
+SRC_URI = "ftp://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
+ file://fixed-perl-path.patch \
+ file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
+ file://run-ptest \
+ file://0004-Fix-out-of-tree-builds.patch \
+ file://0005-Modify-vg_test-wrapper-to-support-PTEST-formats.patch \
+ file://0001-Remove-tests-that-fail-to-build-on-some-PPC32-config.patch \
+ file://use-appropriate-march-mcpu-mfpu-for-ARM-test-apps.patch \
+ file://avoid-neon-for-targets-which-don-t-support-it.patch \
+ file://valgrind-make-ld-XXX.so-strlen-intercept-optional.patch \
+ file://0001-makefiles-Drop-setting-mcpu-to-cortex-a8-on-arm-arch.patch \
+ file://0001-str_tester.c-Limit-rawmemchr-test-to-glibc.patch \
+ file://0001-sigqueue-Rename-_sifields-to-__si_fields-on-musl.patch \
+ file://0002-context-APIs-are-not-available-on-musl.patch \
+ file://0003-correct-include-directive-path-for-config.h.patch \
+ file://0004-pth_atfork1.c-Define-error-API-for-musl.patch \
+ file://0005-tc20_verifywrap.c-Fake-__GLIBC_PREREQ-with-musl.patch \
+ file://0006-pth_detached3.c-Dereference-pthread_t-before-adding-.patch \
+ file://0001-memcheck-tests-Use-ucontext_t-instead-of-struct-ucon.patch \
+ file://0001-memcheck-arm64-Define-__THROW-if-not-already-defined.patch \
+ file://0002-memcheck-x86-Define-__THROW-if-not-defined.patch \
+ file://0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch \
+ file://link-gz-tests.patch \
+ file://ppc-headers.patch \
+ file://mask-CPUID-support-in-HWCAP-on-aarch64.patch \
+ "
+SRC_URI[md5sum] = "817dd08f1e8a66336b9ff206400a5369"
+SRC_URI[sha256sum] = "d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b"
+UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
+
+COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64|mips|powerpc|powerpc64).*-linux'
+
+# valgrind supports armv7 and above
+COMPATIBLE_HOST_armv4 = 'null'
+COMPATIBLE_HOST_armv5 = 'null'
+COMPATIBLE_HOST_armv6 = 'null'
+
+# X32 isn't supported by valgrind at this time
+COMPATIBLE_HOST_linux-gnux32 = 'null'
+COMPATIBLE_HOST_linux-muslx32 = 'null'
+
+# Disable for some MIPS variants
+COMPATIBLE_HOST_mipsarchn32 = 'null'
+COMPATIBLE_HOST_mipsarchr6 = 'null'
+
+inherit autotools ptest multilib_header
+
+EXTRA_OECONF = "--enable-tls --without-mpicc"
+EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}"
+
+# valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option
+EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}"
+TARGET_CC_ARCH_remove_arm = "${@get_mcpu(d)}"
+
+EXTRA_OEMAKE = "-w"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
+# valgrind likes to control its own optimisation flags. It generally defaults
+# to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
+# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
+# which fixes build path issue in DWARF.
+SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
+
+def get_mcpu(d):
+ for arg in (d.getVar('TUNE_CCARGS') or '').split():
+ if arg.startswith('-mcpu='):
+ return arg
+ else:
+ continue
+ return ""
+
+do_configure_prepend () {
+ rm -rf ${S}/config.h
+ sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am
+ sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am
+}
+
+do_install_append () {
+ install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
+ oe_multilib_header valgrind/config.h
+}
+
+TUNE = "${@strip_mcpu(d)}"
+
+RDEPENDS_${PN} += "perl"
+
+# valgrind needs debug information for ld.so at runtime in order to
+# redirect functions like strlen.
+RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
+
+RDEPENDS_${PN}-ptest += " sed perl perl-module-file-glob"
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
+
+# One of the tests contains a bogus interpreter path on purpose.
+# Skip file dependency check
+SKIP_FILEDEPS_${PN}-ptest = '1'
+
+do_compile_ptest() {
+ oe_runmake check
+}
+
+do_install_ptest() {
+ chmod +x ${B}/tests/vg_regtest
+
+ # The test application binaries are not automatically installed.
+ # Grab them from the build directory.
+ #
+ # The regression tests require scripts and data files that are not
+ # copied to the build directory. They must be copied from the
+ # source directory.
+ saved_dir=$PWD
+ for parent_dir in ${S} ${B} ; do
+ cd $parent_dir
+
+ # exclude shell or the package won't install
+ rm -rf none/tests/shell* 2>/dev/null
+
+ subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests"
+
+ # Get the vg test scripts, filters, and expected files
+ for dir in $subdirs ; do
+ find $dir | cpio -pvdu ${D}${PTEST_PATH}
+ done
+ cd $saved_dir
+ done
+
+ # clean out build artifacts before building the rpm
+ find ${D}${PTEST_PATH} \
+ \( -name "Makefile*" \
+ -o -name "*.o" \
+ -o -name "*.c" \
+ -o -name "*.S" \
+ -o -name "*.h" \) \
+ -exec rm {} \;
+
+ # needed by massif tests
+ cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
+
+ # handle multilib
+ sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
+}
diff --git a/poky/meta/recipes-devtools/xmlto/files/catalog.xml b/poky/meta/recipes-devtools/xmlto/files/catalog.xml
new file mode 100644
index 000000000..6b8833d87
--- /dev/null
+++ b/poky/meta/recipes-devtools/xmlto/files/catalog.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateSystem systemIdStartString="http://docbook.org/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430" catalog="./docbook-xml.xml"/>
+<delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model" catalog="./docbook-xml.xml"/>
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+</catalog>
diff --git a/poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch b/poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
new file mode 100644
index 000000000..6d547a6c9
--- /dev/null
+++ b/poky/meta/recipes-devtools/xmlto/xmlto-0.0.28/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
@@ -0,0 +1,30 @@
+configure.in: drop the test of xmllint and xsltproc
+
+The test is unnecessary, the xmllint and xsltproc were explicitly
+added to RDEPENDS.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -42,10 +42,10 @@ AC_ARG_VAR([LOCALE], [Name and path of the `locale' program.])
+ AC_PATH_PROG([LOCALE], [locale], [locale])
+
+ AC_ARG_VAR([XMLLINT], [Name and path of the `xmllint' program.])
+-AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
++dnl AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
+
+ AC_ARG_VAR([XSLTPROC], [Name and path of the `xsltproc' program.])
+-AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
++dnl AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
+
+ dnl
+ dnl toolchains
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb b/poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
new file mode 100644
index 000000000..6216d7782
--- /dev/null
+++ b/poky/meta/recipes-devtools/xmlto/xmlto_0.0.28.bb
@@ -0,0 +1,41 @@
+SUMMARY = "A shell-script tool for converting XML files to various formats"
+HOMEPAGE = "https://releases.pagure.org/xmlto/"
+SECTION = "docs/xmlto"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "https://releases.pagure.org/xmlto/xmlto-${PV}.tar.gz \
+ file://configure.in-drop-the-test-of-xmllint-and-xsltproc.patch \
+ file://catalog.xml \
+"
+SRC_URI[md5sum] = "a1fefad9d83499a15576768f60f847c6"
+SRC_URI[sha256sum] = "2f986b7c9a0e9ac6728147668e776d405465284e13c74d4146c9cbc51fd8aad3"
+
+inherit autotools
+RDEPENDS_class-native = "libxslt-native"
+
+# xmlto needs getopt/xmllint/xsltproc/bash/tail at runtime
+RDEPENDS_${PN} = "docbook-xml-dtd4 \
+ docbook-xsl-stylesheets \
+ util-linux \
+ libxml2 \
+ bash \
+"
+RDEPENDS_${PN}_append_class-target = " \
+ libxslt-bin \
+ coreutils \
+"
+CACHED_CONFIGUREVARS += "ac_cv_path_TAIL=tail"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF_append = " BASH=/bin/bash GCP=/bin/cp XMLLINT=xmllint XSLTPROC=xsltproc"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/xml/
+ install -m 755 ${WORKDIR}/catalog.xml ${D}${sysconfdir}/xml/catalog.xml
+ create_wrapper ${D}/${bindir}/xmlto XML_CATALOG_FILES=${sysconfdir}/xml/catalog.xml
+}
+
+do_populate_sysroot[rdeptask] = "do_populate_sysroot"
diff --git a/poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb b/poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
new file mode 100644
index 000000000..31af1e287
--- /dev/null
+++ b/poky/meta/recipes-devtools/yasm/yasm_1.3.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "x86 (SSE) assembler supporting NASM and GAS-syntaxes"
+LICENSE = "BSD"
+HOMEPAGE = "http://www.tortall.net/projects/yasm/"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a12d8903508fb6bfd49d8d82c6170dd9"
+
+SRC_URI = "http://www.tortall.net/projects/yasm/releases/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "fc9e586751ff789b34b1f21d572d96af"
+SRC_URI[sha256sum] = "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f"
+
+export CCLD_FOR_BUILD = "${CC_FOR_BUILD}"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/acpica/acpica_20170303.bb b/poky/meta/recipes-extended/acpica/acpica_20170303.bb
new file mode 100644
index 000000000..51ae77b78
--- /dev/null
+++ b/poky/meta/recipes-extended/acpica/acpica_20170303.bb
@@ -0,0 +1,53 @@
+SUMMARY = "ACPICA tools for the development and debug of ACPI tables"
+DESCRIPTION = "The ACPI Component Architecture (ACPICA) project provides an \
+OS-independent reference implementation of the Advanced Configuration and \
+Power Interface Specification (ACPI). ACPICA code contains those portions of \
+ACPI meant to be directly integrated into the host OS as a kernel-resident \
+subsystem, and a small set of tools to assist in developing and debugging \
+ACPI tables."
+
+HOMEPAGE = "http://www.acpica.org/"
+SECTION = "console/tools"
+
+LICENSE = "BSD | GPLv2"
+LIC_FILES_CHKSUM = "file://generate/unix/readme.txt;md5=204407e197c1a01154a48f6c6280c3aa"
+
+COMPATIBLE_HOST = "(i.86|x86_64|arm|aarch64).*-linux"
+
+DEPENDS = "bison flex"
+
+SRC_URI = "https://acpica.org/sites/acpica/files/acpica-unix2-${PV}.tar.gz \
+ file://rename-yy_scan_string-manually.patch \
+ file://manipulate-fds-instead-of-FILE.patch;striplevel=2 \
+ file://0001-Linux-add-support-for-X32-ABI-compilation.patch \
+ "
+SRC_URI[md5sum] = "48ef4314fb4ffdd0c96f14dcf20544e1"
+SRC_URI[sha256sum] = "b2d81e84107ac9a02be86ea43cbea7afa8fd4b4150270bc88c2d4c9fea0b8aad"
+UPSTREAM_CHECK_URI = "https://acpica.org/downloads"
+
+S = "${WORKDIR}/acpica-unix2-${PV}"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "acpixtract"
+
+EXTRA_OEMAKE = "CC='${CC}' 'OPT_CFLAGS=-Wall'"
+
+do_install() {
+ install -D -p -m0755 generate/unix/bin*/iasl ${D}${bindir}/iasl
+ install -D -p -m0755 generate/unix/bin*/acpibin ${D}${bindir}/acpibin
+ install -D -p -m0755 generate/unix/bin*/acpiexec ${D}${bindir}/acpiexec
+ install -D -p -m0755 generate/unix/bin*/acpihelp ${D}${bindir}/acpihelp
+ install -D -p -m0755 generate/unix/bin*/acpinames ${D}${bindir}/acpinames
+ install -D -p -m0755 generate/unix/bin*/acpisrc ${D}${bindir}/acpisrc
+ install -D -p -m0755 generate/unix/bin*/acpixtract ${D}${bindir}/acpixtract
+}
+
+# iasl*.bb is a subset of this recipe, so RREPLACE it
+PROVIDES = "iasl"
+RPROVIDES_${PN} += "iasl"
+RREPLACES_${PN} += "iasl"
+RCONFLICTS_${PN} += "iasl"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch b/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch
new file mode 100644
index 000000000..df7420006
--- /dev/null
+++ b/poky/meta/recipes-extended/acpica/files/0001-Linux-add-support-for-X32-ABI-compilation.patch
@@ -0,0 +1,31 @@
+From d22241efc0708c9799f17a20eabb52a48d6d6ea1 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <anuj.mittal@intel.com>
+Date: Tue, 2 Jan 2018 12:35:32 +0800
+Subject: [PATCH] Linux: add support for X32 ABI compilation
+
+X32 follows ILP32 model. Check for ILP32 as well when checking for
+x86_64 to ensure the defines are correct for X32 ABI.
+
+Upstream-Status: Submitted [https://github.com/acpica/acpica/pull/348]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ source/include/platform/aclinux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/include/platform/aclinux.h b/source/include/platform/aclinux.h
+index 75b1d82..6b8ff73 100644
+--- a/source/include/platform/aclinux.h
++++ b/source/include/platform/aclinux.h
+@@ -315,7 +315,7 @@
+ #define ACPI_FLUSH_CPU_CACHE()
+ #define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread))
+
+-#if defined(__ia64__) || defined(__x86_64__) ||\
++#if defined(__ia64__) || (defined(__x86_64__) && !defined(__ILP32__)) ||\
+ defined(__aarch64__) || defined(__PPC64__) ||\
+ defined(__s390x__)
+ #define ACPI_MACHINE_WIDTH 64
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch b/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
new file mode 100644
index 000000000..5610ed9be
--- /dev/null
+++ b/poky/meta/recipes-extended/acpica/files/manipulate-fds-instead-of-FILE.patch
@@ -0,0 +1,72 @@
+From 69171c22f3872ecb4c1ab27985e93ca44084595e Mon Sep 17 00:00:00 2001
+From: Fan Xin <fan.xin@jp.fujitsu.com>
+Date: Mon, 5 Jun 2017 13:26:38 +0900
+Subject: [PATCH] aslfiles.c: manipulate fds instead of FILE
+
+Copying what stdout/stderr point to is not portable and fails with
+musl because FILE is an undefined struct.
+
+Instead, use lower-level Unix functions to modify the file that stderr
+writes into. This works on the platforms that Yocto targets.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+Rebase on acpica 20170303
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ acpica-unix2-20170303/source/compiler/aslfiles.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/acpica-unix2-20170303/source/compiler/aslfiles.c b/acpica-unix2-20170303/source/compiler/aslfiles.c
+index 809090c..97898b1 100644
+--- a/acpica-unix2-20170303/source/compiler/aslfiles.c
++++ b/acpica-unix2-20170303/source/compiler/aslfiles.c
+@@ -44,6 +44,10 @@
+ #include "aslcompiler.h"
+ #include "acapps.h"
+ #include "dtcompiler.h"
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <unistd.h>
+
+ #define _COMPONENT ACPI_COMPILER
+ ACPI_MODULE_NAME ("aslfiles")
+@@ -607,6 +611,8 @@ FlOpenMiscOutputFiles (
+
+ if (Gbl_DebugFlag)
+ {
++ int fd;
++
+ Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
+ if (!Filename)
+ {
+@@ -618,10 +624,10 @@ FlOpenMiscOutputFiles (
+ /* Open the debug file as STDERR, text mode */
+
+ Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
+- Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
+- freopen (Filename, "w+t", stderr);
+
+- if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
++ fd = open(Filename, O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
++ if (fd < 0 ||
++ dup2(fd, fileno(stderr)))
+ {
+ /*
+ * A problem with freopen is that on error, we no longer
+@@ -635,6 +641,8 @@ FlOpenMiscOutputFiles (
+ exit (1);
+ }
+
++ Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle = stderr;
++
+ AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
+ AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
+ }
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch b/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch
new file mode 100644
index 000000000..b62ca25ba
--- /dev/null
+++ b/poky/meta/recipes-extended/acpica/files/rename-yy_scan_string-manually.patch
@@ -0,0 +1,64 @@
+From 2ab61e6ad5a9cfcde838379bc36babfaaa61afb8 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 20 Jan 2017 13:50:17 +0100
+Subject: [PATCH] rename yy_scan_string manually
+
+flex 2.6.0 used to generate code where yy_scan_string was mapped
+to <custom prefix>_scan_string directly in the generated .c code.
+
+For example, generate/unix/iasl/obj/prparserlex.c:
+
+int
+PrInitLexer (
+ char *String)
+{
+
+ LexBuffer = PrParser_scan_string (String);
+ return (LexBuffer == NULL);
+}
+
+flex 2.6.3 no longer does that, leading to a compiler warning
+and link error about yy_scan_string().
+
+Both versions generate a preamble in the beginning of prparserlex.c
+that maps several yy_* names, but yy_scan_string is not among those:
+
+...
+...
+
+Upstream-Status: Inappropriate [workaround for https://github.com/westes/flex/issues/164]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ source/compiler/dtparser.l | 2 +-
+ source/compiler/prparser.l | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/source/compiler/dtparser.l b/source/compiler/dtparser.l
+index 3f4c2f3..eaa43ff 100644
+--- a/source/compiler/dtparser.l
++++ b/source/compiler/dtparser.l
+@@ -120,7 +120,7 @@ DtInitLexer (
+ char *String)
+ {
+
+- LexBuffer = yy_scan_string (String);
++ LexBuffer = DtParser_scan_string (String);
+ return (LexBuffer == NULL);
+ }
+
+diff --git a/source/compiler/prparser.l b/source/compiler/prparser.l
+index 10bd130..9cb3573 100644
+--- a/source/compiler/prparser.l
++++ b/source/compiler/prparser.l
+@@ -127,7 +127,7 @@ PrInitLexer (
+ char *String)
+ {
+
+- LexBuffer = yy_scan_string (String);
++ LexBuffer = PrParser_scan_string (String);
+ return (LexBuffer == NULL);
+ }
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb b/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb
new file mode 100644
index 000000000..38164d557
--- /dev/null
+++ b/poky/meta/recipes-extended/asciidoc/asciidoc_8.6.9.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Tool for creating HTML, PDF, EPUB, man pages"
+DESCRIPTION = "AsciiDoc is a text document format for writing short documents, \
+articles, books and UNIX man pages."
+
+HOMEPAGE = "http://asciidoc.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://COPYRIGHT;md5=029ad5428ba5efa20176b396222d4069"
+
+SRC_URI = "http://downloads.sourceforge.net/project/${BPN}/${BPN}/${PV}/${BP}.tar.gz"
+SRC_URI[md5sum] = "c59018f105be8d022714b826b0be130a"
+SRC_URI[sha256sum] = "78db9d0567c8ab6570a6eff7ffdf84eadd91f2dfc0a92a2d0105d323cab4e1f0"
+
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/asciidoc/files/"
+
+inherit autotools-brokensep
+
+export DESTDIR = "${D}"
+DEPENDS_class-native = "docbook-xml-dtd4-native"
+RDEPENDS_${PN} += "python"
+BBCLASSEXTEND = "native"
+
+CLEANBROKEN = "1"
diff --git a/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch b/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
new file mode 100644
index 000000000..7fdecc7fd
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
@@ -0,0 +1,59 @@
+From f446686916e503dfb9fb928252d1b72a07573b29 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 18 Jul 2017 03:42:56 -0400
+Subject: [PATCH] remove glibc assumption
+
+glibc time.h header has an undocumented __isleap macro
+that we are using anf musl is missing it.
+Since it is undocumented & does not appear
+on any other libc, stop using it and just define the macro in
+locally instead.
+
+Upstream-Status: Submitted [ https://lists.debian.org/debian-accessibility/2017/07/msg00044.html ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ parsetime.y | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/parsetime.y b/parsetime.y
+index 7005e88..324e6d3 100644
+--- a/parsetime.y
++++ b/parsetime.y
+@@ -8,6 +8,9 @@
+
+ #define YYDEBUG 1
+
++#define is_leap_year(y) \
++ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
++
+ struct tm exectm;
+ static int isgmt;
+ static int yearspec;
+@@ -217,8 +220,8 @@ date : month_name day_number
+ mnum == 12) && dnum > 31)
+ || ((mnum == 4 || mnum == 6 || mnum == 9 ||
+ mnum == 11) && dnum > 30)
+- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
+- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
+ )
+ {
+ yyerror("Error in day of month");
+@@ -261,8 +264,8 @@ date : month_name day_number
+ mnum == 12) && dnum > 31)
+ || ((mnum == 4 || mnum == 6 || mnum == 9 ||
+ mnum == 11) && dnum > 30)
+- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
+- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
+ )
+ {
+ yyerror("Error in day of month");
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/at/at/atd.init b/poky/meta/recipes-extended/at/at/atd.init
new file mode 100644
index 000000000..eca379b3c
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/atd.init
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Starts at daemon
+#
+
+umask 077
+
+# Source function library.
+. /etc/init.d/functions
+
+start() {
+ echo -n "Starting atd: "
+ start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
+ echo "OK"
+}
+stop() {
+ echo -n "Stopping atd: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid
+ echo "OK"
+}
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ status)
+ status /usr/sbin/atd
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $?
+
diff --git a/poky/meta/recipes-extended/at/at/atd.service b/poky/meta/recipes-extended/at/at/atd.service
new file mode 100644
index 000000000..6dc844504
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/atd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Job spooling tools
+After=syslog.target
+
+[Service]
+ExecStart=@SBINDIR@/atd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch b/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch
new file mode 100644
index 000000000..1e5efef12
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+--- at-3.1.12/configure.ac 2011-06-23 14:51:03.653572945 +0800
++++ at-3.1.12/configure.ac.new 2011-06-27 16:12:14.903572945 +0800
+@@ -81,10 +81,18 @@
+ AC_FUNC_VPRINTF
+ AC_FUNC_GETLOADAVG
+ AC_CHECK_FUNCS(getcwd mktime strftime setreuid setresuid sigaction waitpid)
++
++AC_ARG_WITH([pam],
++ [AS_HELP_STRING([--without-pam], [without PAM support])])
++
++if test "x$with_pam" != xno; then
+ AC_CHECK_HEADERS(security/pam_appl.h, [
+ PAMLIB="-lpam"
+- AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])
+-])
++ AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])],
++ [if test "x$with_pam" = xyes; then
++ AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
++ fi])
++fi
+
+ dnl Checking for programs
+
diff --git a/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch b/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
new file mode 100644
index 000000000..d5ef0032b
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+posixtm.[ch] files are replaced with gplv2 version from these locations:
+
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.c;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.h;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
+
+update the Copyright file information to reflect the replaced files.
+
+Date: 2010/08/31
+Nitin A Kamble nitin.a.kamble@intel.com
+
+Index: at-3.1.12/Copyright
+===================================================================
+--- at-3.1.12.orig/Copyright
++++ at-3.1.12/Copyright
+@@ -31,10 +31,10 @@ The files posixtm.c and posixtm.h have t
+ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007 Free Software Foundation Inc.
+
+- This program is free software: you can redistribute it and/or modify
++ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+- the Free Software Foundation; either version 3 of the License, or
+- (at your option) any later version.
++ the Free Software Foundation; either version 2, or (at your option)
++ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch b/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch
new file mode 100644
index 000000000..100f8898e
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch
@@ -0,0 +1,35 @@
+make -j was failing sometimesa like this
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/home/nitin/build/build0/tmp/sysroots/i586-poky-linux -I. -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -o atd atd.o daemon.o -lfl -lpam -Wl,-O1 -Wl,--as-needed
+| parsetime.l:5:19: fatal error: y.tab.h: No such file or directory
+| compilation terminated.
+| make: *** [lex.yy.o] Error 1
+| make: *** Waiting for unfinished jobs....
+
+Fixed the issue by adding a dependency in the makefile.
+Nitin <nitin.a.kamble@intel.com>
+2010/09/02
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+---
+ Makefile.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index dd3c2f8..7897e45 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -82,6 +82,8 @@ y.tab.c y.tab.h: parsetime.y
+ lex.yy.c: parsetime.l
+ $(LEX) -i parsetime.l
+
++parsetime.l: y.tab.h
++
+ atd.service: atd.service.in
+ sed -e 's![@]sbindir[@]!$(sbindir)!g' < $< > $@
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch b/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
new file mode 100644
index 000000000..d6056dcef
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
@@ -0,0 +1,32 @@
+From 150b63a936af71b992a3a7b0fc2d2497e51fc800 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 23:52:00 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+y.tab.c:1001:0: error: unterminated #if
+
+Let "$(YACC) -d parsetime.y" only run once will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: at-3.1.20/Makefile.in
+===================================================================
+--- at-3.1.20.orig/Makefile.in
++++ at-3.1.20/Makefile.in
+@@ -76,7 +76,9 @@ at: $(ATOBJECTS)
+ atd: $(RUNOBJECTS)
+ $(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB) $(SELINUXLIB)
+
+-y.tab.c y.tab.h: parsetime.y
++y.tab.h: y.tab.c
++
++y.tab.c: parsetime.y
+ $(YACC) -d parsetime.y
+
+ lex.yy.c: parsetime.l
diff --git a/poky/meta/recipes-extended/at/at/pam.conf.patch b/poky/meta/recipes-extended/at/at/pam.conf.patch
new file mode 100644
index 000000000..b5ceb9ae8
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/pam.conf.patch
@@ -0,0 +1,27 @@
+oe doesn't support "@include", use the concrete directive instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+Index: at-3.1.15/pam.conf
+===================================================================
+--- at-3.1.15.orig/pam.conf
++++ at-3.1.15/pam.conf
+@@ -1,10 +1,11 @@
+ #
+ # The PAM configuration file for the at daemon
+ #
++
++auth required pam_env.so
++auth include common-auth
++account include common-account
++session include common-session-noninteractive
++session required pam_limits.so
++session required pam_loginuid.so
+
+-auth required pam_env.so
+-@include common-auth
+-@include common-account
+-session required pam_loginuid.so
+-@include common-session-noninteractive
+-session required pam_limits.so
diff --git a/poky/meta/recipes-extended/at/at/posixtm.c b/poky/meta/recipes-extended/at/at/posixtm.c
new file mode 100644
index 000000000..5514ba4fe
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/posixtm.c
@@ -0,0 +1,328 @@
+/* Parse dates for touch and date.
+
+ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007 Free Software Foundation Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+ Rewritten by Jim Meyering. */
+
+#include <config.h>
+
+#include "posixtm.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <string.h>
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char
+ or EOF.
+ - It's typically faster.
+ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
+ isdigit unless it's important to use the locale's definition
+ of `digit' even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+time_t mktime ();
+
+/*
+ POSIX requires:
+
+ touch -t [[CC]YY]mmddhhmm[.ss] FILE...
+ 8, 10, or 12 digits, followed by optional .ss
+ (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS)
+
+ touch mmddhhmm[YY] FILE... (obsoleted by POSIX 1003.1-2001)
+ 8 or 10 digits, YY (if present) must be in the range 69-99
+ (PDS_TRAILING_YEAR | PDS_PRE_2000)
+
+ date mmddhhmm[[CC]YY]
+ 8, 10, or 12 digits
+ (PDS_TRAILING_YEAR | PDS_CENTURY)
+
+*/
+
+static int
+year (struct tm *tm, const int *digit_pair, size_t n, unsigned int syntax_bits)
+{
+ switch (n)
+ {
+ case 1:
+ tm->tm_year = *digit_pair;
+ /* Deduce the century based on the year.
+ POSIX requires that 00-68 be interpreted as 2000-2068,
+ and that 69-99 be interpreted as 1969-1999. */
+ if (digit_pair[0] <= 68)
+ {
+ if (syntax_bits & PDS_PRE_2000)
+ return 1;
+ tm->tm_year += 100;
+ }
+ break;
+
+ case 2:
+ if (! (syntax_bits & PDS_CENTURY))
+ return 1;
+ tm->tm_year = digit_pair[0] * 100 + digit_pair[1] - 1900;
+ break;
+
+ case 0:
+ {
+ time_t now;
+ struct tm *tmp;
+
+ /* Use current year. */
+ time (&now);
+ tmp = localtime (&now);
+ if (! tmp)
+ return 1;
+ tm->tm_year = tmp->tm_year;
+ }
+ break;
+
+ default:
+ abort ();
+ }
+
+ return 0;
+}
+
+static int
+posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
+{
+ const char *dot = NULL;
+ int pair[6];
+ int *p;
+ size_t i;
+
+ size_t s_len = strlen (s);
+ size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
+ ? (size_t) (dot - s)
+ : s_len);
+
+ if (len != 8 && len != 10 && len != 12)
+ return 1;
+
+ if (dot)
+ {
+ if (!(syntax_bits & PDS_SECONDS))
+ return 1;
+
+ if (s_len - len != 3)
+ return 1;
+ }
+
+ for (i = 0; i < len; i++)
+ if (!ISDIGIT (s[i]))
+ return 1;
+
+ len /= 2;
+ for (i = 0; i < len; i++)
+ pair[i] = 10 * (s[2*i] - '0') + s[2*i + 1] - '0';
+
+ p = pair;
+ if (syntax_bits & PDS_LEADING_YEAR)
+ {
+ if (year (tm, p, len - 4, syntax_bits))
+ return 1;
+ p += len - 4;
+ len = 4;
+ }
+
+ /* Handle 8 digits worth of `MMDDhhmm'. */
+ tm->tm_mon = *p++ - 1;
+ tm->tm_mday = *p++;
+ tm->tm_hour = *p++;
+ tm->tm_min = *p++;
+ len -= 4;
+
+ /* Handle any trailing year. */
+ if (syntax_bits & PDS_TRAILING_YEAR)
+ {
+ if (year (tm, p, len, syntax_bits))
+ return 1;
+ }
+
+ /* Handle seconds. */
+ if (!dot)
+ {
+ tm->tm_sec = 0;
+ }
+ else
+ {
+ int seconds;
+
+ ++dot;
+ if (!ISDIGIT (dot[0]) || !ISDIGIT (dot[1]))
+ return 1;
+ seconds = 10 * (dot[0] - '0') + dot[1] - '0';
+
+ tm->tm_sec = seconds;
+ }
+
+ return 0;
+}
+
+/* Parse a POSIX-style date, returning true if successful. */
+
+bool
+posixtime (time_t *p, const char *s, unsigned int syntax_bits)
+{
+ struct tm tm0
+#ifdef lint
+ /* Placate gcc-4's -Wuninitialized.
+ posix_time_parse fails to set all of tm0 only when it returns
+ nonzero (due to year() returning nonzero), and in that case,
+ this code doesn't use the tm0 at all. */
+ = { 0, }
+#endif
+ ;
+ struct tm tm1;
+ struct tm const *tm;
+ time_t t;
+
+ if (posix_time_parse (&tm0, s, syntax_bits))
+ return false;
+
+ tm1 = tm0;
+ tm1.tm_isdst = -1;
+ t = mktime (&tm1);
+
+ if (t != (time_t) -1)
+ tm = &tm1;
+ else
+ {
+ /* mktime returns -1 for errors, but -1 is also a valid time_t
+ value. Check whether an error really occurred. */
+ tm = localtime (&t);
+ if (! tm)
+ return false;
+ }
+
+ /* Reject dates like "September 31" and times like "25:61". */
+ if ((tm0.tm_year ^ tm->tm_year)
+ | (tm0.tm_mon ^ tm->tm_mon)
+ | (tm0.tm_mday ^ tm->tm_mday)
+ | (tm0.tm_hour ^ tm->tm_hour)
+ | (tm0.tm_min ^ tm->tm_min)
+ | (tm0.tm_sec ^ tm->tm_sec))
+ return false;
+
+ *p = t;
+ return true;
+}
+
+#ifdef TEST_POSIXTIME
+/*
+ Test mainly with syntax_bits == 13
+ (aka: (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS))
+
+ This test data assumes Universal Time, e.g., TZ="UTC0".
+
+ This test data also assumes that time_t is signed and is at least
+ 39 bits wide, so that it can represent all years from 0000 through
+ 9999. A host with 32-bit signed time_t can represent only time
+ stamps in the range 1901-12-13 20:45:52 through 2038-01-18
+ 03:14:07 UTC, assuming POSIX time_t with no leap seconds, so test
+ cases outside this range will not work on such a host.
+
+ Also, the first two lines of test data assume that the current
+ year is 2002.
+
+BEGIN-DATA
+12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
+12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
+000001010000.00 13 -62167132800 Sun Jan 1 00:00:00 0000
+190112132045.52 13 -2147483648 Fri Dec 13 20:45:52 1901
+190112132045.53 13 -2147483647 Fri Dec 13 20:45:53 1901
+190112132046.52 13 -2147483588 Fri Dec 13 20:46:52 1901
+190112132145.52 13 -2147480048 Fri Dec 13 21:45:52 1901
+190112142045.52 13 -2147397248 Sat Dec 14 20:45:52 1901
+190201132045.52 13 -2144805248 Mon Jan 13 20:45:52 1902
+196912312359.59 13 -1 Wed Dec 31 23:59:59 1969
+197001010000.00 13 0 Thu Jan 1 00:00:00 1970
+197001010000.01 13 1 Thu Jan 1 00:00:01 1970
+197001010001.00 13 60 Thu Jan 1 00:01:00 1970
+197001010100.00 13 3600 Thu Jan 1 01:00:00 1970
+197001020000.00 13 86400 Fri Jan 2 00:00:00 1970
+197002010000.00 13 2678400 Sun Feb 1 00:00:00 1970
+197101010000.00 13 31536000 Fri Jan 1 00:00:00 1971
+197001000000.00 13 * *
+197000010000.00 13 * *
+197001010000.60 13 * *
+197001010060.00 13 * *
+197001012400.00 13 * *
+197001320000.00 13 * *
+197013010000.00 13 * *
+203801190314.06 13 2147483646 Tue Jan 19 03:14:06 2038
+203801190314.07 13 2147483647 Tue Jan 19 03:14:07 2038
+203801190314.08 13 2147483648 Tue Jan 19 03:14:08 2038
+999912312359.59 13 253402300799 Fri Dec 31 23:59:59 9999
+1112131415 13 1323785700 Tue Dec 13 14:15:00 2011
+1112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
+201112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
+191112131415.16 13 -1831974284 Wed Dec 13 14:15:16 1911
+203712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
+3712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
+6812131415.16 13 3122633716 Thu Dec 13 14:15:16 2068
+6912131415.16 13 -1590284 Sat Dec 13 14:15:16 1969
+7012131415.16 13 29945716 Sun Dec 13 14:15:16 1970
+1213141599 2 945094500 Mon Dec 13 14:15:00 1999
+1213141500 2 976716900 Wed Dec 13 14:15:00 2000
+END-DATA
+
+*/
+
+# define MAX_BUFF_LEN 1024
+
+int
+main (void)
+{
+ char buff[MAX_BUFF_LEN + 1];
+
+ buff[MAX_BUFF_LEN] = 0;
+ while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
+ {
+ char time_str[MAX_BUFF_LEN];
+ unsigned int syntax_bits;
+ time_t t;
+ if (sscanf (buff, "%s %u", time_str, &syntax_bits) != 2)
+ printf ("*\n");
+ else
+ {
+ printf ("%-15s %2u ", time_str, syntax_bits);
+ if (posixtime (&t, time_str, syntax_bits))
+ printf ("%12ld %s", (long int) t, ctime (&t));
+ else
+ printf ("%12s %s", "*", "*\n");
+ }
+ }
+ exit (0);
+
+}
+#endif
+
+/*
+Local Variables:
+compile-command: "gcc -DTEST_POSIXTIME -g -O -Wall -W posixtm.c"
+End:
+*/
diff --git a/poky/meta/recipes-extended/at/at/posixtm.h b/poky/meta/recipes-extended/at/at/posixtm.h
new file mode 100644
index 000000000..e91749d73
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at/posixtm.h
@@ -0,0 +1,37 @@
+/* Parse dates for touch and date.
+
+ Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+ Rewritten by Jim Meyering. */
+
+#ifndef POSIXTM_H_
+# define POSIXTM_H_
+
+# include <stdbool.h>
+# include <time.h>
+
+/* POSIX Date Syntax flags. */
+# define PDS_LEADING_YEAR 1
+# define PDS_TRAILING_YEAR 2
+# define PDS_CENTURY 4
+# define PDS_SECONDS 8
+# define PDS_PRE_2000 16
+
+bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
+
+#endif
diff --git a/poky/meta/recipes-extended/at/at_3.1.20.bb b/poky/meta/recipes-extended/at/at_3.1.20.bb
new file mode 100644
index 000000000..8fe3b437e
--- /dev/null
+++ b/poky/meta/recipes-extended/at/at_3.1.20.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Delayed job execution and batch processing"
+HOMEPAGE = "http://blog.calhariz.com/"
+DESCRIPTION = "At allows for commands to be run at a particular time. Batch will execute commands when \
+the system load levels drop to a particular level."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
+DEPENDS = "flex flex-native bison-native \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
+"
+
+PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
+
+RCONFLICTS_${PN} = "atd"
+RREPLACES_${PN} = "atd"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/a/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://fix_parallel_build_error.patch \
+ file://posixtm.c \
+ file://posixtm.h \
+ file://file_replacement_with_gplv2.patch \
+ file://atd.init \
+ file://atd.service \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://makefile-fix-parallel.patch \
+ file://0001-remove-glibc-assumption.patch \
+ "
+
+PAM_SRC_URI = "file://pam.conf.patch \
+ file://configure-add-enable-pam.patch"
+
+SRC_URI[md5sum] = "e7bd7b785b2cbb17e133d6bdc0fb099e"
+SRC_URI[sha256sum] = "0871923cab73050b98ace020664eb2ddc1e669e4166b5abb64d864d02fcefab9"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/a/at/"
+
+EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
+ --with-daemon_username=root \
+ --with-daemon_groupname=root \
+ --with-jobdir=/var/spool/at/jobs \
+ --with-atspool=/var/spool/at/spool \
+ ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
+
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "atd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "atd.service"
+
+copy_sources() {
+ cp -f ${WORKDIR}/posixtm.[ch] ${S}
+}
+do_patch[postfuncs] += "copy_sources"
+
+do_install () {
+ oe_runmake -e "IROOT=${D}" install
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd
+
+ # install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service
+
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
+ fi
+}
diff --git a/poky/meta/recipes-extended/bash/bash.inc b/poky/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 000000000..9c2b065f9
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,92 @@
+SUMMARY = "An sh-compatible command language interpreter"
+HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SECTION = "base/shell"
+
+DEPENDS = "ncurses bison-native virtual/libiconv"
+
+inherit autotools gettext texinfo update-alternatives ptest
+
+EXTRA_AUTORECONF += "--exclude=autoheader --exclude=aclocal"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
+
+# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
+# startup files, even if they are not interactive.
+# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
+CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
+
+ALTERNATIVE_${PN} = "bash sh"
+ALTERNATIVE_LINK_NAME[bash] = "${base_bindir}/bash"
+ALTERNATIVE_TARGET[bash] = "${base_bindir}/bash"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash.${BPN}"
+ALTERNATIVE_PRIORITY = "100"
+
+RDEPENDS_${PN} += "base-files"
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make"
+
+DEPENDS_append_libc-glibc = " virtual/libc-locale"
+RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-fr-fr locale-base-de-de"
+
+USERADD_PACKAGES = "${PN}-ptest"
+USERADD_PARAM_${PN}-ptest = "--create-home --user-group test"
+
+CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}"
+
+do_compile_ptest () {
+ oe_runmake buildtest
+}
+
+do_install_append () {
+ # Move /usr/bin/bash to /bin/bash, if need
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ mv ${D}${bindir}/bash ${D}${base_bindir}
+ fi
+}
+do_install_append_class-target () {
+ # Clean buildhost references in bashbug
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e "s,-I${WORKDIR}/\S* ,,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${bindir}/bashbug
+
+ # Clean buildhost references in bash.pc
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ ${D}${libdir}/pkgconfig/bash.pc
+
+ # Clean buildhost references in Makefile.inc
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${D}${libdir}/bash/Makefile.inc
+}
+
+do_install_ptest () {
+ make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ ${D}${PTEST_PATH}/Makefile
+}
+
+pkg_postinst_${PN} () {
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
+
+PACKAGES += "${PN}-bashbug"
+FILES_${PN} = "${bindir}/bash ${base_bindir}/bash.bash"
+FILES_${PN}-bashbug = "${bindir}/bashbug"
+
+PACKAGE_BEFORE_PN += "${PN}-loadable"
+RDEPENDS_${PN}-loadable += "${PN}"
+FILES_${PN}-loadable += "${libdir}/bash/*"
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh /bin/bash', '', d)}"
diff --git a/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch b/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch
new file mode 100644
index 000000000..5405c84c7
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/0001-help-fix-printf-format-security-warning.patch
@@ -0,0 +1,35 @@
+From e5837a42f8f48a6a721805ff8f7fcd32861d09ca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
+Date: Tue, 26 Jul 2016 13:09:47 +0100
+Subject: [PATCH] help: fix printf() format security warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../../bash-4.3.30/builtins/../../bash-4.3.30/builtins/help.def: In function 'help_builtin':
+| ../../bash-4.3.30/builtins/../../bash-4.3.30/builtins/help.def:130:7: error: format not a string literal and no format arguments [-Werror=format-security]
+| printf (ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1)));
+| ^~~~~~
+
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+Upstream-Status: Pending
+ builtins/help.def | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builtins/help.def b/builtins/help.def
+index 1894f17..cf624c6 100644
+--- a/builtins/help.def
++++ b/builtins/help.def
+@@ -127,7 +127,7 @@ help_builtin (list)
+
+ if (glob_pattern_p (list->word->word))
+ {
+- printf (ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1)));
++ printf ("%s", ngettext ("Shell commands matching keyword `", "Shell commands matching keywords `", (list->next ? 2 : 1)));
+ print_word_list (list, ", ");
+ printf ("'\n\n");
+ }
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch b/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
new file mode 100644
index 000000000..9fb6ba972
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/bash-memleak-bug-fix-for-builtin-command-read.patch
@@ -0,0 +1,35 @@
+From d3b6303a6853f612a56848ee4e59eaa0b0ab9489 Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang@windriver.com>
+Date: Tue, 21 Feb 2017 11:30:14 +0800
+Subject: [PATCH] bash: memleak bug fix for builtin command read
+
+Built in command "read" with "-e" use Readline to obtain the line
+in an interactive shell. In this process, a string "rlbuf" is
+just allocated without free operation thus cause memory leak. Fix it.
+
+Upstream-Status: Submitted [http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html]
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+ builtins/read.def | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/builtins/read.def b/builtins/read.def
+index 4397154..ee0c5a6 100644
+--- a/builtins/read.def
++++ b/builtins/read.def
+@@ -674,6 +674,11 @@ add_char:
+ input_string[i] = '\0';
+ CHECK_ALRM;
+
++#if defined (READLINE)
++ if (edit)
++ xfree (rlbuf);
++#endif
++
+ if (retval < 0)
+ {
+ t_errno = errno;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/bash/bash/build-tests.patch b/poky/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 000000000..73a81b60d
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/build-tests.patch
@@ -0,0 +1,55 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Upstream-Status: Pending
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -848,20 +848,34 @@ maybe-clean:
+ fi
+
+ recho$(EXEEXT): $(SUPPORT_SRC)recho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+-test tests check: force $(Program) $(TESTS_SUPPORT)
++test tests check:
++ @$(MAKE) install-test
++ @$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ @-test -d tests || mkdir tests
+ @cp $(TESTS_SUPPORT) tests
++else
++ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ @( cd $(srcdir)/tests && \
+ PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-extended/bash/bash/execute_cmd.patch b/poky/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 000000000..9970b4d8f
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: execute_cmd.c
+===================================================================
+--- execute_cmd.c.orig
++++ execute_cmd.c
+@@ -2459,7 +2459,11 @@ execute_pipeline (command, asynchronous,
+ /* If the `lastpipe' option is set with shopt, and job control is not
+ enabled, execute the last element of non-async pipelines in the
+ current shell environment. */
+- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
++ if (lastpipe_opt &&
++#if defined(JOB_CONTROL)
++ job_control == 0 &&
++#endif
++ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
+ {
+ lstdin = move_to_high_fd (0, 1, -1);
+ if (lstdin > 0)
diff --git a/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch b/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch
new file mode 100644
index 000000000..2fa388302
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/fix-run-builtins.patch
@@ -0,0 +1,33 @@
+From 0c4cab9594c96c2dc435a8d9724605824bcbf917 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 19 Apr 2016 02:57:45 -0400
+Subject: [PATCH] fix run-builtins failed
+
+FAIL: run-builtins
+1. redirect the stderr output of command exec with -l option in
+ builtins.tests to /dev/null
+2. ensure the system contain the locales "en_US.UTF-8"
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ tests/builtins.tests | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/builtins.tests b/tests/builtins.tests
+index 9d77520..63f3af8 100644
+--- a/tests/builtins.tests
++++ b/tests/builtins.tests
+@@ -109,7 +109,7 @@ esac
+
+ # test options to exec
+ (exec -a specialname ${THIS_SH} -c 'echo $0' )
+-(exec -l -a specialname ${THIS_SH} -c 'echo $0' )
++(exec -l -a specialname ${THIS_SH} -c 'echo $0' ) 2> /dev/null
+ # test `clean' environment. if /bin/sh is bash, and the script version of
+ # printenv is run, there will be variables in the environment that bash
+ # sets on startup. Also test code that prefixes argv[0] with a dash.
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
new file mode 100644
index 000000000..9ac2461ab
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
@@ -0,0 +1,45 @@
+From d1cd4c31ea0ed7406a3ad4bdaa211f581063f655 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 10:21:21 +0800
+Subject: [PATCH 2/2] fix run-execscript/run-test/ failed
+
+FAIL: run-execscript:
+the test suite should not be run as root
+
+FAIL: run-test
+the test suite should not be run as root
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/run-execscript | 3 ++-
+ tests/run-test | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tests/run-execscript b/tests/run-execscript
+index de78644..38397c1 100644
+--- a/tests/run-execscript
++++ b/tests/run-execscript
+@@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory"
+ echo "warning: produce diff output, please do not consider this a test failure" >&2
+ echo "warning: if diff output differing only in the location of the bash" >&2
+ echo "warning: binary appears, please do not consider this a test failure" >&2
+-${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1
++rm -f ${BASH_TSTOUT}
++su -c "${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1" test
+ diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT}
+diff --git a/tests/run-test b/tests/run-test
+index d68791c..d6317d2 100644
+--- a/tests/run-test
++++ b/tests/run-test
+@@ -1,4 +1,5 @@
+ unset GROUPS UID 2>/dev/null
+
+-${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1
++rm -f ${BASH_TSTOUT}
++su -c "${THIS_SH} ./test.tests > ${BASH_TSTOUT} 2>&1" test
+ diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT}
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..a9391d6ca
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
@@ -0,0 +1,26 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ # define HAVE_STDLIB_H
+
+ # define HAVE_RENAME
++# define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch b/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch
new file mode 100644
index 000000000..e05bbda31
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/pathexp-dep.patch
@@ -0,0 +1,13 @@
+pathexp includes libintl.h but doesn't depend on it, thus a build race can occur.
+
+Upstream-Status: Submitted (https://savannah.gnu.org/patch/index.php?9503)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index c7b62bc0..241cbf12 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1281,2 +1281,3 @@ nojobs.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
+ y.tab.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
++pathexp.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
+ pcomplete.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
diff --git a/poky/meta/recipes-extended/bash/bash/run-ptest b/poky/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 000000000..c61fabd02
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+en_US=`locale -a | grep en_US*`
+fr_FR=`locale -a | grep fr_FR*`
+de_DE=`locale -a | grep de_DE*`
+
+if [ -z "$en_US" ]
+then
+ echo "Warning: The en_US* locales is needed to run the intl.tests, please add it."
+fi
+
+if [ -z "$fr_FR" ]
+then
+ echo "Warning: The fr_FR* locales is needed to run the intl.tests, please add it."
+fi
+
+if [ -z "$de_DE" ]
+then
+ echo "Warning: The de_DE* locales is needed to run the intl.tests, please add it."
+fi
+
+make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest
diff --git a/poky/meta/recipes-extended/bash/bash/test-output.patch b/poky/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 000000000..0ffcc2458
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash/test-output.patch
@@ -0,0 +1,42 @@
+From 28eb06047ebd2deaa8c7cd2bf6655ef6a469dc14 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 15 Aug 2017 10:01:56 +0800
+Subject: [PATCH 1/2] Add FAIL/PASS output to test output.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+Rebase to 4.4
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/run-all | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/tests/run-all b/tests/run-all
+index 2882fe0..e21d026 100644
+--- a/tests/run-all
++++ b/tests/run-all
+@@ -33,7 +33,16 @@ do
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ rm -f ${BASH_TSTOUT}
++ ;;
+ esac
+ done
+
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/bash/bash_4.4.12.bb b/poky/meta/recipes-extended/bash/bash_4.4.12.bb
new file mode 100644
index 000000000..9382a77af
--- /dev/null
+++ b/poky/meta/recipes-extended/bash/bash_4.4.12.bb
@@ -0,0 +1,24 @@
+require bash.inc
+
+# GPLv2+ (< 4.0), GPLv3+ (>= 4.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
+ file://execute_cmd.patch;striplevel=0 \
+ file://mkbuiltins_have_stringize.patch \
+ file://build-tests.patch \
+ file://test-output.patch \
+ file://fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch \
+ file://run-ptest \
+ file://fix-run-builtins.patch \
+ file://0001-help-fix-printf-format-security-warning.patch \
+ file://bash-memleak-bug-fix-for-builtin-command-read.patch \
+ file://pathexp-dep.patch \
+ "
+
+SRC_URI[tarball.md5sum] = "7c112970cbdcadfc331e10eeb5f6aa41"
+SRC_URI[tarball.sha256sum] = "57d8432be54541531a496fd4904fdc08c12542f43605a9202594fa5d5f9f2331"
+
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-extended/bc/bc_1.06.bb b/poky/meta/recipes-extended/bc/bc_1.06.bb
new file mode 100644
index 000000000..d8c8a860f
--- /dev/null
+++ b/poky/meta/recipes-extended/bc/bc_1.06.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Arbitrary precision calculator language"
+HOMEPAGE = "http://www.gnu.org/software/bc/bc.html"
+
+LICENSE = "GPLv2+ & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+ file://bc/bcdefs.h;endline=31;md5=46dffdaf10a99728dd8ce358e45d46d8 \
+ file://dc/dc.h;endline=25;md5=2f9c558cdd80e31b4d904e48c2374328 \
+ file://lib/number.c;endline=31;md5=99434a0898abca7784acfd36b8191199"
+
+SECTION = "base"
+DEPENDS = "flex"
+PR = "r3"
+
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+ file://fix-segment-fault.patch "
+
+SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
+SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"
+
+inherit autotools texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "dc"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch b/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch
new file mode 100644
index 000000000..20c0da2eb
--- /dev/null
+++ b/poky/meta/recipes-extended/bc/files/fix-segment-fault.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04602.html.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- bc-1.06/lib/number.c.orig 2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c 2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig 2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c 2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+ long label_no;
+ long vaf_name; /* variable, array or function number. */
+ long func;
+- program_counter save_adr;
++ static program_counter save_adr;
+
+ /* Initialize. */
+ str = code;
diff --git a/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch b/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
new file mode 100644
index 000000000..fee368dac
--- /dev/null
+++ b/poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
@@ -0,0 +1,40 @@
+From 9cb1667f9d3a9bcfc3b83466cd8d3b79f0554ff0 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:37:09 +0300
+Subject: [PATCH 1/3] fix typos in manpage
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.8 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.8 b/blktool.8
+index a1f5c96..45b7724 100644
+--- a/blktool.8
++++ b/blktool.8
+@@ -191,7 +191,7 @@ Query or set device bus state (0 off, 1 on, 2 tristate)
+ Query the detected (or overridden, via -t) device class.
+ Typically this will result in 'ATA' or 'SCSI' for most devices.
+ Detection is based on device major; thus your SATA device may appear as
+-'SCSI'.
++\&'SCSI'.
+
+ .TP
+ .B cd-speed
+@@ -237,7 +237,7 @@ Omitting the on/off argument will print the current state.
+
+ .TP
+ .B media
+-Lock in (or unlock) a removeable device.
++Lock in (or unlock) a removable device.
+
+ .TP
+ .B multiple-count
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch b/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
new file mode 100644
index 000000000..d08aba5f0
--- /dev/null
+++ b/poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
@@ -0,0 +1,31 @@
+From ddb1071da2c78d8155aab62e9f0d46f69500200f Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:42:24 +0300
+Subject: [PATCH 2/3] fix string error
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 1f3a9ca..2ccf56a 100644
+--- a/util.c
++++ b/util.c
+@@ -28,7 +28,7 @@ void pdie(const char *msg, int perr)
+ if (perr)
+ perror(msg);
+ else
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ if (blkdev >= 0)
+ close(blkdev);
+ exit(1);
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch b/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
new file mode 100644
index 000000000..d7ed0b9f4
--- /dev/null
+++ b/poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
@@ -0,0 +1,78 @@
+From 68faa63aaad81f4a289e4a03173ab4cf798deb53 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Sat, 1 Nov 2014 22:24:32 +0300
+Subject: [PATCH 3/3] Fix 3-d argument for BLKROSET it must be 'const int *'
+
+Most of *SET ioctls have int type for 3-d argument, except BLKROSET.
+So add bc_arg_type enum, build it into bool_comand and install arg_type
+to bc_arg_int_ptr for BLKROSET only.
+
+Debian-bug-id: 641164
+Link: https://bugs.debian.org/641164
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.c | 11 +++++++++--
+ blktool.h | 7 +++++++
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.c b/blktool.c
+index fbefecd..221a195 100644
+--- a/blktool.c
++++ b/blktool.c
+@@ -85,7 +85,7 @@ static struct bool_command bool_cmd_tbl[] = {
+ { { DEF_BOOL("pio-data"), dc_ata, DEF_HDIO(32BIT) },
+ "16-bit", "32-bit" },
+ { { DEF_BOOL("readonly"), dc_any, IOCNAME(BLKROGET), IOCNAME(BLKROSET) },
+- DEF_BOOLSTR },
++ DEF_BOOLSTR, bc_arg_int_ptr },
+ { { DEF_BOOL("unmask-irq"), dc_ata, DEF_HDIO(UNMASKINTR) },
+ DEF_BOOLSTR },
+ { { "wcache", ct_bool, handle_wcache, dc_any,
+@@ -171,7 +171,14 @@ static void handle_bool(int argc, char **argv, struct command *cmd)
+
+ } else if ((argc == 4) && (cmd->write_ioctl_name != NULL)) {
+ do_32 = parse_bool(argc, argv, bcm);
+- if (ioctl(blkdev, cmd->write_ioctl, do_32))
++
++ int ret;
++ if (bcm->arg_type == bc_arg_int_ptr) {
++ ret = ioctl(blkdev, cmd->write_ioctl, &do_32);
++ } else {
++ ret = ioctl(blkdev, cmd->write_ioctl, do_32);
++ }
++ if (ret)
+ pdie(cmd->write_ioctl_name, 1);
+ }
+ else {
+diff --git a/blktool.h b/blktool.h
+index fce4387..85add83 100644
+--- a/blktool.h
++++ b/blktool.h
+@@ -85,11 +85,18 @@ struct command {
+ const char *write_ioctl_name;
+ };
+
++enum bc_arg_type {
++ bc_arg_int,
++ bc_arg_int_ptr,
++};
++
+ struct bool_command {
+ struct command cmd;
+
+ const char *str_false;
+ const char *str_true;
++
++ enum bc_arg_type arg_type;
+ };
+
+ struct class_operations {
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/blktool/blktool_4-7.bb b/poky/meta/recipes-extended/blktool/blktool_4-7.bb
new file mode 100644
index 000000000..4551c3233
--- /dev/null
+++ b/poky/meta/recipes-extended/blktool/blktool_4-7.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Tune low-level block device parameters"
+DESCRIPTION = "blktool is used for querying and/or changing settings \
+of a block device. It is like hdparm but a more general tool, as it \
+works on SCSI, IDE and SATA devices."
+HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/b/${BPN}/${BPN}_4.orig.tar.gz;name=tarball \
+ file://0001-fix-typos-in-manpage.patch \
+ file://0002-fix-string-error.patch \
+ file://0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch \
+ "
+
+SRC_URI[tarball.md5sum] = "62edc09c9908107e69391c87f4f3fd40"
+SRC_URI[tarball.sha256sum] = "b1e6d5912546d2a4b704ec65c2b9664aa3b4663e7d800e06803330335a2cb764"
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/b/blktool/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/${BPN}-4.orig"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch
new file mode 100644
index 000000000..1d0c3a6dd
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/CVE-2016-3189.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Backport
+https://bugzilla.suse.com/attachment.cgi?id=681334
+
+CVE: CVE-2016-3189
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: bzip2-1.0.6/bzip2recover.c
+===================================================================
+--- bzip2-1.0.6.orig/bzip2recover.c
++++ bzip2-1.0.6/bzip2recover.c
+@@ -457,6 +457,7 @@ Int32 main ( Int32 argc, Char** argv )
+ bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
+ bsPutUInt32 ( bsWr, blockCRC );
+ bsClose ( bsWr );
++ outFile = NULL;
+ }
+ if (wrBlock >= rbCtr) break;
+ wrBlock++;
diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
new file mode 100644
index 000000000..dcf64584d
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
@@ -0,0 +1,73 @@
+
+lib_LTLIBRARIES = libbz2.la
+libbz2_la_LDFLAGS = -version-info 1:6:0
+
+libbz2_la_SOURCES = blocksort.c \
+ huffman.c \
+ crctable.c \
+ randtable.c \
+ compress.c \
+ decompress.c \
+ bzlib.c
+
+bin_PROGRAMS = bzip2 bzip2recover
+
+bzip2_SOURCES = bzip2.c
+bzip2_LDADD = libbz2.la
+bzip2_DEPENDENCIES = libbz2.la
+
+include_HEADERS = bzlib.h
+
+bzip2recover_SOURCES = bzip2recover.c
+bzip2recover_LDADD = libbz2.la
+bzip2recover_DEPENDENCIES = libbz2.la
+
+bin_SCRIPTS = bzgrep bzmore bzdiff
+
+man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
+EXTRA_DIST = $(man_MANS)
+
+runtest:
+ ./bzip2 -1 < sample1.ref > sample1.rb2
+ ./bzip2 -2 < sample2.ref > sample2.rb2
+ ./bzip2 -3 < sample3.ref > sample3.rb2
+ ./bzip2 -d < sample1.bz2 > sample1.tst
+ ./bzip2 -d < sample2.bz2 > sample2.tst
+ ./bzip2 -ds < sample3.bz2 > sample3.tst
+ @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\
+ else echo "FAIL: sample1 compress"; fi
+ @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\
+ else echo "FAIL: sample2 compress"; fi
+ @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\
+ else echo "FAIL: sample3 compress"; fi
+ @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\
+ else echo "FAIL: sample1 decompress"; fi
+ @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\
+ else echo "FAIL: sample2 decompress"; fi
+ @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\
+ else echo "FAIL: sample3 decompress"; fi
+
+install-ptest:
+ sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \
+ $(srcdir)/Makefile.am > $(DESTDIR)/Makefile
+ cp $(srcdir)/sample1.ref $(DESTDIR)/
+ cp $(srcdir)/sample2.ref $(DESTDIR)/
+ cp $(srcdir)/sample3.ref $(DESTDIR)/
+ cp $(srcdir)/sample1.bz2 $(DESTDIR)/
+ cp $(srcdir)/sample2.bz2 $(DESTDIR)/
+ cp $(srcdir)/sample3.bz2 $(DESTDIR)/
+ ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2
+
+install-exec-hook:
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
+ ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
+ ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
+
+install-data-hook:
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1
diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
new file mode 100644
index 000000000..e2bf1bf11
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
@@ -0,0 +1,11 @@
+AC_PREREQ([2.57])
+
+AC_INIT(bzip2, 1.0.6)
+AM_INIT_AUTOMAKE(foreign)
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_OUTPUT([Makefile])
+
diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch
new file mode 100644
index 000000000..ece90d94e
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch
@@ -0,0 +1,55 @@
+From 8068659388127e8e63f2d2297ba2348c72b20705 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 12 Oct 2015 03:19:51 -0400
+Subject: [PATCH] bzip2: fix bunzip2 -qt returns 0 for corrupt archives
+
+"bzip2 -t FILE" returns 2 if FILE exists, but is not a valid bzip2 file.
+"bzip2 -qt FILE" returns 0 when this happens, although it does print out
+an error message as is does so.
+
+This has been fix by Debian, just port changes from Debian patch file
+"20-legacy.patch".
+
+Debian defect:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279025
+
+Fix item from changelog:
+http://archive.debian.net/changelogs/pool/main/b/bzip2/bzip2_1.0.2-7/changelog
+
+ * Fixed "bunzip2 -qt returns 0 for corrupt archives" (Closes: #279025).
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ bzip2.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/bzip2.c b/bzip2.c
+index 6de9d1d..f2ce668 100644
+--- a/bzip2.c
++++ b/bzip2.c
+@@ -2003,12 +2003,14 @@ IntNative main ( IntNative argc, Char *argv[] )
+ testf ( aa->name );
+ }
+ }
+- if (testFailsExist && noisy) {
+- fprintf ( stderr,
+- "\n"
+- "You can use the `bzip2recover' program to attempt to recover\n"
+- "data from undamaged sections of corrupted files.\n\n"
+- );
++ if (testFailsExist) {
++ if (noisy) {
++ fprintf ( stderr,
++ "\n"
++ "You can use the `bzip2recover' program to attempt to recover\n"
++ "data from undamaged sections of corrupted files.\n\n"
++ );
++ }
+ setExit(2);
+ exit(exitValue);
+ }
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
new file mode 100644
index 000000000..3b20fce1e
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
new file mode 100644
index 000000000..de668d6d2
--- /dev/null
+++ b/poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Very high-quality data compression program"
+DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \
+Huffman coding. Compression is generally considerably better than that achieved by more conventional \
+LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors."
+HOMEPAGE = "http://www.bzip.org/"
+SECTION = "console/utils"
+LICENSE = "bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2"
+PR = "r5"
+
+SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \
+ file://fix-bunzip2-qt-returns-0-for-corrupt-archives.patch \
+ file://configure.ac;subdir=${BP} \
+ file://Makefile.am;subdir=${BP} \
+ file://run-ptest \
+ file://CVE-2016-3189.patch \
+ "
+
+SRC_URI[md5sum] = "00b516f4704d4a7cb50a1d97e6e8e15b"
+SRC_URI[sha256sum] = "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd"
+
+UPSTREAM_CHECK_URI = "http://www.bzip.org/downloads.html"
+
+PACKAGES =+ "libbz2"
+
+CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
+
+inherit autotools update-alternatives ptest relative_symlinks
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "bunzip2 bzcat"
+
+#install binaries to bzip2-native under sysroot for replacement-native
+EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
+
+do_install_ptest () {
+ sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile
+}
+
+FILES_libbz2 = "${libdir}/lib*${SOLIBS}"
+
+PROVIDES_append_class-native = " bzip2-replacement-native"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
new file mode 100644
index 000000000..87fa8eb60
--- /dev/null
+++ b/poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
@@ -0,0 +1,44 @@
+require recipes-extended/chkconfig/chkconfig_1.3.58.bb
+
+SUMMARY = "${SUMMARY_chkconfig-alternatives}"
+DESCRIPTION = "${DESCRIPTION_chkconfig-alternatives}"
+DEPENDS = ""
+PROVIDES += "virtual/update-alternatives-native"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# The sysroot branch is 1.3.59 + some git commits from master + --sysroot
+# support for alternatives.
+SRC_URI = "git://github.com/kergoth/chkconfig;branch=sysroot"
+S = "${WORKDIR}/git"
+UPSTREAM_CHECK_GITTAGREGEX = "chkconfig-(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV = "cd437ecbd8986c894442f8fce1e0061e20f04dee"
+PV = "1.3.59+${SRCPV}"
+
+inherit native
+
+# We want our native recipes to build using the target paths rather than paths
+# into the sysroot, as we may use them to construct the rootfs. As such, we
+# only adjust the paths to match the metadata for the target, not native.
+obey_variables () {
+ sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' ${S}/alternatives.c
+}
+
+do_compile () {
+ oe_runmake alternatives
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/alternatives \
+ ${D}${localstatedir}/lib/alternatives
+
+ install -D -m 0755 alternatives ${D}${bindir}/alternatives
+ install -D -m 0644 alternatives.8 ${D}${mandir}/man8/alternatives.8
+
+ ln -s alternatives ${D}${bindir}/update-alternatives
+ ln -s alternatives.8 ${D}${mandir}/man8/update-alternatives.8
+}
+
+do_install_append_linuxstdbase() {
+ rm -rf ${D}${libdir}/lsb
+}
diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch b/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
new file mode 100644
index 000000000..96d193879
--- /dev/null
+++ b/poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
@@ -0,0 +1,33 @@
+caddr_t is a legacy BSD type which was rejected by the POSIX standard.
+Use void * instead.
+
+sys/unitstd.h is not needed and moreover its not available on all C library
+implementations e.g. musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: chkconfig-1.3.58/alternatives.c
+===================================================================
+--- chkconfig-1.3.58.orig/alternatives.c
++++ chkconfig-1.3.58/alternatives.c
+@@ -22,7 +22,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-#include <sys/unistd.h>
+ #include <unistd.h>
+
+ #define FLAGS_TEST (1 << 0)
+Index: chkconfig-1.3.58/leveldb.c
+===================================================================
+--- chkconfig-1.3.58.orig/leveldb.c
++++ chkconfig-1.3.58/leveldb.c
+@@ -442,7 +442,7 @@ int parseServiceInfo(int fd, char * name
+ fstat(fd, &sb);
+
+ bufstart = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
+- if (bufstart == ((caddr_t) -1)) {
++ if (bufstart == ((void*) -1)) {
+ close(fd);
+ return -1;
+ }
diff --git a/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb b/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
new file mode 100644
index 000000000..2f1f6c026
--- /dev/null
+++ b/poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
@@ -0,0 +1,71 @@
+SUMMARY = "A system tool for maintaining the /etc/rc*.d hierarchy"
+DESCRIPTION = "Chkconfig is a basic system utility. It updates and queries runlevel \
+information for system services. Chkconfig manipulates the numerous \
+symbolic links in /etc/rc.d, to relieve system administrators of some \
+of the drudgery of manually editing the symbolic links."
+
+RECIPE_NO_UPDATE_REASON = "Version 1.5 requires selinux"
+
+HOMEPAGE = "https://github.com/fedora-sysv"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+
+DEPENDS = "libnewt popt"
+PROVIDES += "virtual/update-alternatives"
+
+PR = "r7"
+
+S = "${WORKDIR}/${BPN}-${BPN}-${PV}"
+
+UPSTREAM_CHECK_URI = "https://github.com/fedora-sysv/${BPN}/releases"
+
+SRC_URI = "https://github.com/fedora-sysv/chkconfig/archive/chkconfig-${PV}.tar.gz \
+ file://replace_caddr_t.patch \
+ "
+
+SRC_URI[md5sum] = "3f51ac38a234be5278b3a2d9705eda5e"
+SRC_URI[sha256sum] = "bf1e81f0d7cc999b536c9fe7877abf584a4082fd03c9d2597b6f090966579b40"
+
+inherit gettext
+
+# Makefile uses RPM_OPT_FLAGS to construct CFLAGS
+#
+EXTRA_OEMAKE = "\
+ 'RPM_OPT_FLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+ 'BINDIR=${base_sbindir}' \
+ 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' \
+ 'ALTDIR=${localstatedir}/lib/alternatives' \
+ 'ALTDATADIR=${sysconfdir}/alternatives' \
+"
+
+do_unpack[postfuncs] += "obey_variables"
+do_unpack[vardeps] += "obey_variables"
+obey_variables () {
+ sed -i -e 's,/etc,${sysconfdir},; s,/lib/systemd,${base_libdir}/systemd,' ${S}/leveldb.h
+ sed -i -e 's,/etc/alternatives,${sysconfdir}/alternatives,' \
+ -e 's,/var/lib/alternatives,${localstatedir}/lib/alternatives,' \
+ -e 's,/usr/share/locale,${datadir}/locale,' ${S}/alternatives.c
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' 'INSTALLNLSDIR=${D}${datadir}/locale' \
+ 'BINDIR=${sbindir}' install
+ install -d ${D}${sysconfdir}/chkconfig.d
+}
+
+PACKAGES =+ "${PN}-alternatives ${PN}-alternatives-doc"
+SUMMARY_${PN}-alternatives = "Maintain symbolic links determining default commands"
+DESCRIPTION_${PN}-alternatives = "alternatives creates, removes, maintains and displays \
+information about the symbolic links comprising the alternatives system."
+SUMMARY_${PN}-alternatives-doc = "${SUMMARY_${PN}-alternatives} - Documentation files"
+DESCRIPTION_${PN}-alternatives-doc = "${DESCRIPTION_${PN}-alternatives} \
+This package contains documentation."
+RPROVIDES_${PN}-alternatives += "update-alternatives"
+RCONFLICTS_${PN}-alternatives = "update-alternatives-opkg update-alternatives-dpkg"
+FILES_${PN}-alternatives = "${sbindir}/alternatives ${sbindir}/update-alternatives \
+ ${sysconfdir}/alternatives ${localstatedir}/lib/alternatives"
+FILES_${PN}-alternatives-doc = "${mandir}/man8/alternatives.8 \
+ ${mandir}/man8/update-alternatives.8"
diff --git a/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch
new file mode 100644
index 000000000..5c999197f
--- /dev/null
+++ b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch
@@ -0,0 +1,178 @@
+From dcee489f821c1260a0136fcdfdb6ff4dd11086ac Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 9 Dec 2015 17:58:03 +0200
+Subject: [PATCH] Fix CVE-2015-1197
+
+Apply patch by Vitezslav Cizek of SuSE to fix CVE-2015-1197.
+Upstream is dormant or no longer existing. To restore the old
+behaviour use --extract-over-symlinks (Closes: #774669)
+This issue has been discovered by Alexander Cherepanov.
+Author: Vitezslav Cizek <vcizek@suse.cz>
+Bug-Debian: https://bugs.debian.org/774669
+
+Upstream-Status: Pending
+CVE: CVE-2015-1197
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ doc/cpio.1 | 1 +
+ src/copyin.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/extern.h | 1 +
+ src/global.c | 3 +++
+ src/main.c | 7 +++++++
+ 5 files changed, 74 insertions(+)
+
+diff --git a/doc/cpio.1 b/doc/cpio.1
+index 2a68241..dc4676c 100644
+--- a/doc/cpio.1
++++ b/doc/cpio.1
+@@ -49,6 +49,7 @@ cpio \- copy files to and from archives
+ [\fB\-\-no\-preserve\-owner\fR] [\fB\-\-message=\fIMESSAGE\fR]
+ [\fB\-\-force\-local\fR] [\fB\-\-no\-absolute\-filenames\fR] [\fB\-\-sparse\fR]
+ [\fB\-\-only\-verify\-crc\fR] [\fB\-\-to\-stdout\fR] [\fB\-\-quiet\fR]
++[\fB\-\-extract\-over\-symlinks\fR]
+ [\fB\-\-rsh\-command=\fICOMMAND\fR]
+ [\fIpattern\fR...] [\fB<\fR \fIarchive\fR]
+
+diff --git a/src/copyin.c b/src/copyin.c
+index cde911e..053afe7 100644
+--- a/src/copyin.c
++++ b/src/copyin.c
+@@ -695,6 +695,51 @@ copyin_link (struct cpio_file_stat *file_hdr, int in_file_des)
+ free (link_name);
+ }
+
++
++static int
++path_contains_symlink(char *path)
++{
++ struct stat st;
++ char *slash;
++ char *nextslash;
++
++ /* we got NULL pointer or empty string */
++ if (!path || !*path) {
++ return false;
++ }
++
++ slash = path;
++
++ while ((nextslash = strchr(slash + 1, '/')) != NULL) {
++ slash = nextslash;
++ *slash = '\0';
++
++ if (lstat(path, &st) != 0) {
++ if (errno == ELOOP) {
++ /* ELOOP - too many symlinks */
++ *slash = '/';
++ return true;
++ } else if (errno == ENOMEM) {
++ /* No memory for lstat - terminate */
++ xalloc_die();
++ } else {
++ /* cannot lstat path - give up */
++ *slash = '/';
++ return false;
++ }
++ }
++
++ if (S_ISLNK(st.st_mode)) {
++ *slash = '/';
++ return true;
++ }
++
++ *slash = '/';
++ }
++
++ return false;
++}
++
+ static void
+ copyin_file (struct cpio_file_stat *file_hdr, int in_file_des)
+ {
+@@ -1468,6 +1513,23 @@ process_copy_in ()
+ {
+ /* Copy the input file into the directory structure. */
+
++ /* Can we write files over symlinks? */
++ if (!extract_over_symlinks)
++ {
++ if (path_contains_symlink(file_hdr.c_name))
++ {
++ /* skip the file */
++ /*
++ fprintf(stderr, "Can't write over symlinks. Skipping %s\n", file_hdr.c_name);
++ tape_toss_input (in_file_des, file_hdr.c_filesize);
++ tape_skip_padding (in_file_des, file_hdr.c_filesize);
++ continue;
++ */
++ /* terminate */
++ error (1, 0, _("Can't write over symlinks: %s\n"), file_hdr.c_name);
++ }
++ }
++
+ /* Do we need to rename the file? */
+ if (rename_flag || rename_batch_file)
+ {
+diff --git a/src/extern.h b/src/extern.h
+index e27d662..d864bde 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -96,6 +96,7 @@ extern char input_is_special;
+ extern char output_is_special;
+ extern char input_is_seekable;
+ extern char output_is_seekable;
++extern bool extract_over_symlinks;
+ extern int (*xstat) ();
+ extern void (*copy_function) ();
+ extern char *change_directory_option;
+diff --git a/src/global.c b/src/global.c
+index 57e505a..336fce4 100644
+--- a/src/global.c
++++ b/src/global.c
+@@ -187,6 +187,9 @@ bool to_stdout_option = false;
+ /* The name this program was run with. */
+ char *program_name;
+
++/* Extract files over symbolic links */
++bool extract_over_symlinks;
++
+ /* A pointer to either lstat or stat, depending on whether
+ dereferencing of symlinks is done for input files. */
+ int (*xstat) ();
+diff --git a/src/main.c b/src/main.c
+index a13861f..87cb309 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -59,6 +59,7 @@ enum cpio_options {
+ DEBUG_OPTION,
+ BLOCK_SIZE_OPTION,
+ TO_STDOUT_OPTION,
++ EXTRACT_OVER_SYMLINKS,
+ RENUMBER_INODES_OPTION,
+ IGNORE_DEVNO_OPTION,
+ DEVICE_INDEPENDENT_OPTION
+@@ -243,6 +244,8 @@ static struct argp_option options[] = {
+ N_("Create leading directories where needed"), GRID+1 },
+ {"no-preserve-owner", NO_PRESERVE_OWNER_OPTION, 0, 0,
+ N_("Do not change the ownership of the files"), GRID+1 },
++ {"extract-over-symlinks", EXTRACT_OVER_SYMLINKS, 0, 0,
++ N_("Force writing over symbolic links"), GRID+1 },
+ {"unconditional", 'u', NULL, 0,
+ N_("Replace all files unconditionally"), GRID+1 },
+ {"sparse", SPARSE_OPTION, NULL, 0,
+@@ -432,6 +435,10 @@ crc newc odc bin ustar tar (all-caps also recognized)"), arg));
+ no_chown_flag = true;
+ break;
+
++ case EXTRACT_OVER_SYMLINKS: /* --extract-over-symlinks */
++ extract_over_symlinks = true;
++ break;
++
+ case 'o': /* Copy-out mode. */
+ if (copy_function != 0)
+ USAGE_ERROR ((0, 0, _("Mode already defined")));
+--
+2.6.2
+
diff --git a/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..6ae213942
--- /dev/null
+++ b/poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: cpio-2.11/gnu/Makefile.am
+===================================================================
+--- cpio-2.11.orig/gnu/Makefile.am
++++ cpio-2.11/gnu/Makefile.am
+@@ -734,7 +734,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-extended/cpio/cpio_2.12.bb b/poky/meta/recipes-extended/cpio/cpio_2.12.bb
new file mode 100644
index 000000000..405a90e03
--- /dev/null
+++ b/poky/meta/recipes-extended/cpio/cpio_2.12.bb
@@ -0,0 +1,12 @@
+require cpio_v2.inc
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-Fix-CVE-2015-1197.patch \
+ "
+
+SRC_URI[md5sum] = "fc207561a86b63862eea4b8300313e86"
+SRC_URI[sha256sum] = "08a35e92deb3c85d269a0059a27d4140a9667a6369459299d08c17f713a92e73"
diff --git a/poky/meta/recipes-extended/cpio/cpio_v2.inc b/poky/meta/recipes-extended/cpio/cpio_v2.inc
new file mode 100644
index 000000000..31adb717d
--- /dev/null
+++ b/poky/meta/recipes-extended/cpio/cpio_v2.inc
@@ -0,0 +1,43 @@
+SUMMARY = "GNU cpio is a program to manage archives of files"
+DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \
+another. It handles a number of cpio formats as well as reading and writing tar files."
+HOMEPAGE = "http://www.gnu.org/software/cpio/"
+SECTION = "base"
+
+DEPENDS = "texinfo-native"
+
+SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
+ "
+
+inherit autotools gettext texinfo
+
+S = "${WORKDIR}/cpio-${PV}"
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+do_install () {
+ autotools_do_install
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}/
+ mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
+ rmdir ${D}${bindir}/
+ fi
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "cpio"
+ALTERNATIVE_${PN}-rmt = "rmt"
+
+ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
+
+ALTERNATIVE_PRIORITY[rmt] = "50"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch b/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch
new file mode 100644
index 000000000..b251ac905
--- /dev/null
+++ b/poky/meta/recipes-extended/cracklib/cracklib/0001-Apply-patch-to-fix-CVE-2016-6318.patch
@@ -0,0 +1,105 @@
+From 47e5dec521ab6243c9b249dd65b93d232d90d6b1 Mon Sep 17 00:00:00 2001
+From: Jan Dittberner <jan@dittberner.info>
+Date: Thu, 25 Aug 2016 17:13:49 +0200
+Subject: [PATCH] Apply patch to fix CVE-2016-6318
+
+This patch fixes an issue with a stack-based buffer overflow when
+parsing large GECOS field. See
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6318 and
+https://security-tracker.debian.org/tracker/CVE-2016-6318 for more
+information.
+
+Upstream-Status: Backport [https://github.com/cracklib/cracklib/commit/47e5dec521ab6243c9b249dd65b93d232d90d6b1]
+CVE: CVE-2016-6318
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ lib/fascist.c | 57 ++++++++++++++++++++++++++++++++-----------------------
+ 1 file changed, 33 insertions(+), 24 deletions(-)
+
+diff --git a/lib/fascist.c b/lib/fascist.c
+index a996509..d4deb15 100644
+--- a/lib/fascist.c
++++ b/lib/fascist.c
+@@ -502,7 +502,7 @@ FascistGecosUser(char *password, const char *user, const char *gecos)
+ char gbuffer[STRINGSIZE];
+ char tbuffer[STRINGSIZE];
+ char *uwords[STRINGSIZE];
+- char longbuffer[STRINGSIZE * 2];
++ char longbuffer[STRINGSIZE];
+
+ if (gecos == NULL)
+ gecos = "";
+@@ -583,38 +583,47 @@ FascistGecosUser(char *password, const char *user, const char *gecos)
+ {
+ for (i = 0; i < j; i++)
+ {
+- strcpy(longbuffer, uwords[i]);
+- strcat(longbuffer, uwords[j]);
+-
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[i]) + strlen(uwords[j]) < STRINGSIZE)
+ {
+- return _("it is derived from your password entry");
+- }
++ strcpy(longbuffer, uwords[i]);
++ strcat(longbuffer, uwords[j]);
+
+- strcpy(longbuffer, uwords[j]);
+- strcat(longbuffer, uwords[i]);
++ if (GTry(longbuffer, password))
++ {
++ return _("it is derived from your password entry");
++ }
+
+- if (GTry(longbuffer, password))
+- {
+- return _("it's derived from your password entry");
+- }
++ strcpy(longbuffer, uwords[j]);
++ strcat(longbuffer, uwords[i]);
+
+- longbuffer[0] = uwords[i][0];
+- longbuffer[1] = '\0';
+- strcat(longbuffer, uwords[j]);
++ if (GTry(longbuffer, password))
++ {
++ return _("it's derived from your password entry");
++ }
++ }
+
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[j]) < STRINGSIZE - 1)
+ {
+- return _("it is derivable from your password entry");
++ longbuffer[0] = uwords[i][0];
++ longbuffer[1] = '\0';
++ strcat(longbuffer, uwords[j]);
++
++ if (GTry(longbuffer, password))
++ {
++ return _("it is derivable from your password entry");
++ }
+ }
+
+- longbuffer[0] = uwords[j][0];
+- longbuffer[1] = '\0';
+- strcat(longbuffer, uwords[i]);
+-
+- if (GTry(longbuffer, password))
++ if (strlen(uwords[i]) < STRINGSIZE - 1)
+ {
+- return _("it's derivable from your password entry");
++ longbuffer[0] = uwords[j][0];
++ longbuffer[1] = '\0';
++ strcat(longbuffer, uwords[i]);
++
++ if (GTry(longbuffer, password))
++ {
++ return _("it's derivable from your password entry");
++ }
+ }
+ }
+ }
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
new file mode 100644
index 000000000..adbe7dfff
--- /dev/null
+++ b/poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
@@ -0,0 +1,339 @@
+From 8a6e43726ad0ae41bd1cc2c248d91deb31459357 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Tue, 9 Jun 2015 11:11:48 +0900
+Subject: [PATCH] packlib.c: support dictionary byte order dependent
+
+The previous dict files are NOT byte-order independent, in fact they are
+probably ARCHITECTURE SPECIFIC.
+Create the dict files in big endian, and convert to host endian while
+load them. This could fix the endian issue on multiple platform.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+
+We can't use the endian.h, htobe* and be*toh functions because they are
+not available on older versions of glibc, such as that found in RHEL
+5.9.
+
+Change to checking endian and directly calling bswap_* as defined in
+byteswap.h.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
+---
+ lib/packlib.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 210 insertions(+), 4 deletions(-)
+
+diff --git a/lib/packlib.c b/lib/packlib.c
+index f851424..3aac805 100644
+--- a/lib/packlib.c
++++ b/lib/packlib.c
+@@ -16,6 +16,12 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#ifndef _BSD_SOURCE
++#define _BSD_SOURCE /* See feature_test_macros(7) */
++#endif
++#include <endian.h>
++#include <byteswap.h>
+ #include "packer.h"
+
+ static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
+@@ -45,6 +51,185 @@ typedef struct
+ char data_get[NUMWORDS][MAXWORDLEN];
+ } PWDICT64;
+
++enum{
++ en_is32,
++ en_is64
++};
++
++static int
++IheaderHostToBigEndian(char *pHeader, int nBitType)
++{
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader64->pih_magic, pHeader64->pih_numwords,
++ pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader32->pih_magic, pHeader32->pih_numwords,
++ pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++ return 0;
++}
++
++static int
++IheaderBigEndianToHost(char *pHeader, int nBitType)
++{
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader64->pih_magic, pHeader64->pih_numwords,
++ pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader32->pih_magic, pHeader32->pih_numwords,
++ pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++ return 0;
++}
++
++static int
++HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType)
++{
++ int i = 0;
++
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint64_t); i++)
++ {
++ *pHwms64 = bswap_64(*pHwms64);
++ *pHwms64++;
++ }
++
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint32_t); i++)
++ {
++ *pHwms32 = bswap_32(*pHwms32);
++ *pHwms32++;
++ }
++
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++#if DEBUG
++ for (i = 0; i < nLen; i+=8)
++ {
++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++ }
++#endif
++
++ return 0;
++}
++
++static int
++HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType)
++{
++ int i = 0;
++
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint64_t); i++)
++ {
++ *pHwms64++ = bswap_64(*pHwms64);
++ }
++
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint32_t); i++)
++ {
++ *pHwms32 = bswap_32(*pHwms32);
++ *pHwms32++;
++ }
++
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++#if DEBUG
++ for (i = 0; i < nLen; i+=8)
++ {
++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++ }
++#endif
++
++ return 0;
++}
+
+ static int
+ _PWIsBroken64(FILE *ifp)
+@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp)
+ return 0;
+ }
+
++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+ return (pdesc64.header.pih_magic == PIH_MAGIC);
+ }
+
+@@ -149,7 +335,11 @@ PWOpen(prefix, mode)
+ pdesc.header.pih_blocklen = NUMWORDS;
+ pdesc.header.pih_numwords = 0;
+
+- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp);
++ struct pi_header tmpheader32;
++
++ memcpy(&tmpheader32, &pdesc.header, sizeof(pdesc.header));
++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++ fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp);
+ } else
+ {
+ pdesc.flags &= ~PFOR_WRITE;
+@@ -173,6 +363,7 @@ PWOpen(prefix, mode)
+ return NULL;
+ }
+
++ IheaderBigEndianToHost((char *) &pdesc.header, en_is32);
+ if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0))
+ {
+ /* uh-oh. either a broken "64-bit" file or a garbage file. */
+@@ -195,6 +386,7 @@ PWOpen(prefix, mode)
+ }
+ return NULL;
+ }
++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+ if (pdesc64.header.pih_magic != PIH_MAGIC)
+ {
+ /* nope, not "64-bit" after all */
+@@ -290,6 +482,7 @@ PWOpen(prefix, mode)
+ {
+ pdesc.flags &= ~PFOR_USEHWMS;
+ }
++ HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64);
+ for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++)
+ {
+ pdesc.hwms[i] = pdesc64.hwms[i];
+@@ -299,6 +492,7 @@ PWOpen(prefix, mode)
+ {
+ pdesc.flags &= ~PFOR_USEHWMS;
+ }
++ HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32);
+ #if DEBUG
+ for (i=1; i<=0xff; i++)
+ {
+@@ -332,7 +526,11 @@ PWClose(pwp)
+ return (-1);
+ }
+
+- if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp))
++ struct pi_header tmpheader32;
++
++ memcpy(&tmpheader32, &pwp->header, sizeof(pwp->header));
++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++ if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp))
+ {
+ fprintf(stderr, "index magic fwrite failed\n");
+ return (-1);
+@@ -351,7 +549,12 @@ PWClose(pwp)
+ printf("hwm[%02x] = %d\n", i, pwp->hwms[i]);
+ #endif
+ }
+- fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp);
++
++ PWDICT tmp_pwp;
++
++ memcpy(&tmp_pwp, pwp, sizeof(PWDICT));
++ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32);
++ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp);
+ }
+ }
+
+@@ -405,7 +608,8 @@ PutPW(pwp, string)
+
+ datum = (uint32_t) ftell(pwp->dfp);
+
+- fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp);
++ uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
++ fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp);
+
+ fputs(pwp->data_put[0], pwp->dfp);
+ putc(0, pwp->dfp);
+@@ -464,6 +668,7 @@ GetPW(pwp, number)
+ perror("(index fread failed)");
+ return NULL;
+ }
++ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64;
+ datum = datum64;
+ } else {
+ if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0))
+@@ -477,6 +682,7 @@ GetPW(pwp, number)
+ perror("(index fread failed)");
+ return NULL;
+ }
++ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
+ }
+
+ int r = 1;
+--
+1.8.4.2
+
diff --git a/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch b/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
new file mode 100644
index 000000000..6210e8212
--- /dev/null
+++ b/poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
@@ -0,0 +1,53 @@
+From 06f9a88b5dd5597f9198ea0cb34f5e96f180e6e3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 27 Apr 2013 16:02:30 +0800
+Subject: [PATCH] craklib:fix testnum and teststr failed
+
+Error log:
+...
+$ ./testnum
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+
+$ ./util/teststr
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+...
+Set DEFAULT_CRACKLIB_DICT as the path of PWOpen
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ util/testnum.c | 2 +-
+ util/teststr.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/util/testnum.c b/util/testnum.c
+index ae2246d..ca210ff 100644
+--- a/util/testnum.c
++++ b/util/testnum.c
+@@ -20,7 +20,7 @@ main ()
+ PWDICT *pwp;
+ char buffer[STRINGSIZE];
+
+- if (!(pwp = PWOpen (NULL, "r")))
++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+ {
+ perror ("PWOpen");
+ return (-1);
+diff --git a/util/teststr.c b/util/teststr.c
+index 2a31fa4..9fb9cda 100644
+--- a/util/teststr.c
++++ b/util/teststr.c
+@@ -15,7 +15,7 @@ main ()
+ PWDICT *pwp;
+ char buffer[STRINGSIZE];
+
+- if (!(pwp = PWOpen (NULL, "r")))
++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+ {
+ perror ("PWOpen");
+ return (-1);
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb b/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
new file mode 100644
index 000000000..82995219d
--- /dev/null
+++ b/poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Password strength checker library"
+HOMEPAGE = "http://sourceforge.net/projects/cracklib"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+DEPENDS = "cracklib-native zlib"
+
+EXTRA_OECONF = "--without-python --libdir=${base_libdir}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/cracklib/cracklib-${PV}.tar.gz \
+ file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
+ file://0001-Apply-patch-to-fix-CVE-2016-6318.patch \
+ file://0002-craklib-fix-testnum-and-teststr-failed.patch"
+
+SRC_URI[md5sum] = "376790a95c1fb645e59e6e9803c78582"
+SRC_URI[sha256sum] = "59ab0138bc8cf90cccb8509b6969a024d5e58d2d02bcbdccbb9ba9b88be3fa33"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cracklib/files/cracklib/"
+UPSTREAM_CHECK_REGEX = "/cracklib/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit autotools gettext
+
+do_install_append_class-target() {
+ create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-extended/cronie/cronie/crond.init b/poky/meta/recipes-extended/cronie/cronie/crond.init
new file mode 100755
index 000000000..53b8514ca
--- /dev/null
+++ b/poky/meta/recipes-extended/cronie/cronie/crond.init
@@ -0,0 +1,58 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: crond crontab
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: run cron daemon
+# Description: cron is a standard UNIX program that runs user-specified
+# programs at periodic scheduled times. vixie cron adds a
+# number of features to the basic UNIX cron, including better
+# security and more powerful configuration options.
+### END INIT INFO
+
+CROND=/usr/sbin/crond
+CONFIG=/etc/sysconfig/crond
+
+[ -f $CONFIG ] || exit 1
+[ -x $CROND ] || exit 1
+
+. $CONFIG
+
+# Source function library.
+. /etc/init.d/functions
+
+case "$1" in
+ start)
+ echo -n "Starting crond: "
+ start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping crond: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ status)
+ status crond
+ exit $?
+ ;;
+ restart)
+ $0 stop && sleep 1 && $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/crond {start|stop|status|restart}"
+ exit 1
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-extended/cronie/cronie/crond.service b/poky/meta/recipes-extended/cronie/cronie/crond.service
new file mode 100644
index 000000000..d435a6eb3
--- /dev/null
+++ b/poky/meta/recipes-extended/cronie/cronie/crond.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Periodic Command Scheduler
+
+[Service]
+EnvironmentFile=/etc/sysconfig/crond
+ExecStart=@SBINDIR@/crond -n $CRONDARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
new file mode 100644
index 000000000..6c928165c
--- /dev/null
+++ b/poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
@@ -0,0 +1,22 @@
+password-auth is the Fedora's common pam configure file, use oe common pam
+configure files instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+Index: cronie-1.5.1/pam/crond
+===================================================================
+--- cronie-1.5.1.orig/pam/crond
++++ cronie-1.5.1/pam/crond
+@@ -4,8 +4,8 @@
+ #
+ # Although no PAM authentication is called, auth modules
+ # are used for credential setting
+-auth include password-auth
++auth include common-auth
+ account required pam_access.so
+-account include password-auth
++account include common-account
+ session required pam_loginuid.so
+-session include password-auth
++session include common-session-noninteractive
diff --git a/poky/meta/recipes-extended/cronie/cronie/crontab b/poky/meta/recipes-extended/cronie/cronie/crontab
new file mode 100644
index 000000000..22c4feb2d
--- /dev/null
+++ b/poky/meta/recipes-extended/cronie/cronie/crontab
@@ -0,0 +1,14 @@
+# /etc/crontab: system-wide crontab
+# Unlike any other crontab you don't have to run the `crontab'
+# command to install the new version when you edit this file
+# and files in /etc/cron.d. These files also have username fields,
+# that none of the other crontabs do.
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+# m h dom mon dow user command
+# 1 * * * * root cd / && run-parts /etc/cron.hourly
+# 30 7 * * * root cd / && run-parts /etc/cron.daily
+# 42 7 * * 7 root cd / && run-parts /etc/cron.weekly
+# 55 7 1 * * root cd / && run-parts /etc/cron.monthly
diff --git a/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb b/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb
new file mode 100644
index 000000000..cfb8c2105
--- /dev/null
+++ b/poky/meta/recipes-extended/cronie/cronie_1.5.1.bb
@@ -0,0 +1,83 @@
+SUMMARY = "Cron daemon for executing programs at set times"
+DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \
+specified programs at scheduled times and related tools. It is based on the \
+original cron and has security and configuration enhancements like the \
+ability to use pam and SELinux."
+HOMEPAGE = "https://github.com/cronie-crond/cronie/"
+BUGTRACKER = "https://bugzilla.redhat.com"
+
+# Internet Systems Consortium License
+LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \
+ file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \
+ file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9"
+
+SECTION = "utils"
+
+UPSTREAM_CHECK_URI = "https://github.com/cronie-crond/${BPN}/releases/"
+
+SRC_URI = "https://github.com/cronie-crond/cronie/releases/download/cronie-${PV}/cronie-${PV}.tar.gz \
+ file://crond.init \
+ file://crontab \
+ file://crond.service \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
+
+PAM_SRC_URI = "file://crond_pam_config.patch"
+PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
+
+SRC_URI[md5sum] = "910e6effcc032998b0a49fbd46322e18"
+SRC_URI[sha256sum] = "6c73666102a6b5d35e2eaf1bd06925f2d4b0cef8d3323c37286dda3089a85338"
+
+inherit autotools update-rc.d useradd systemd
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+
+PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
+
+INITSCRIPT_NAME = "crond"
+INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system crontab"
+
+SYSTEMD_SERVICE_${PN} = "crond.service"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/sysconfig/
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond
+ install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond
+
+ # install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/crond.service
+
+ # below are necessary for a complete cron environment
+ install -d ${D}${localstatedir}/spool/cron
+ install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/
+ mkdir -p ${D}${sysconfdir}/cron.d
+ mkdir -p ${D}${sysconfdir}/cron.hourly
+ mkdir -p ${D}${sysconfdir}/cron.daily
+ mkdir -p ${D}${sysconfdir}/cron.weekly
+ mkdir -p ${D}${sysconfdir}/cron.monthly
+ touch ${D}${sysconfdir}/cron.deny
+
+ # below setting is necessary to allow normal user using crontab
+
+ # setgid for crontab binary
+ chown root:crontab ${D}${bindir}/crontab
+ chmod 2755 ${D}${bindir}/crontab
+
+ # allow 'crontab' group write to /var/spool/cron
+ chown root:crontab ${D}${localstatedir}/spool/cron
+ chmod 770 ${D}${localstatedir}/spool/cron
+
+ chmod 600 ${D}${sysconfdir}/crontab
+}
+
+FILES_${PN} += "${sysconfdir}/cron*"
+CONFFILES_${PN} += "${sysconfdir}/crontab"
diff --git a/poky/meta/recipes-extended/cups/cups.inc b/poky/meta/recipes-extended/cups/cups.inc
new file mode 100644
index 000000000..ac4d225c1
--- /dev/null
+++ b/poky/meta/recipes-extended/cups/cups.inc
@@ -0,0 +1,110 @@
+SUMMARY = "An Internet printing system for Unix"
+HOMEPAGE = "https://www.cups.org/"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2"
+DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
+
+SRC_URI = "https://github.com/apple/cups/releases/download/v${PV}/${BP}-source.tar.gz \
+ file://use_echo_only_in_init.patch \
+ file://0001-don-t-try-to-run-generated-binaries.patch \
+ file://cups_serverbin.patch \
+ "
+
+UPSTREAM_CHECK_URI = "https://github.com/apple/cups/releases"
+UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
+
+LEAD_SONAME = "libcupsdriver.so"
+
+CLEANBROKEN = "1"
+
+inherit autotools-brokensep binconfig useradd systemd pkgconfig
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system lpadmin"
+
+SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket org.cups.cups-lpd@.service"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
+PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
+PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
+
+EXTRA_OECONF = " \
+ --enable-gnutls \
+ --enable-dbus \
+ --enable-browsing \
+ --disable-gssapi \
+ --enable-debug \
+ --disable-relro \
+ --enable-libusb \
+ --without-php \
+ --without-perl \
+ --without-python \
+ --without-java \
+ DSOFLAGS='${LDFLAGS}' \
+ "
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+do_compile () {
+ echo "all:" > man/Makefile
+ echo "libs:" >> man/Makefile
+ echo "install:" >> man/Makefile
+ echo "install-data:" >> man/Makefile
+ echo "install-exec:" >> man/Makefile
+ echo "install-headers:" >> man/Makefile
+ echo "install-libs:" >> man/Makefile
+
+ oe_runmake
+}
+
+do_install () {
+ oe_runmake "DSTROOT=${D}" install
+
+ # Remove /var/run from package as cupsd will populate it on startup
+ rm -fr ${D}/${localstatedir}/run
+ rmdir ${D}/${libdir}/${BPN}/driver
+
+ # Fix the pam configuration file permissions
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+ chmod 0644 ${D}${sysconfdir}/pam.d/cups
+ fi
+
+ # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
+ rm -rf ${D}${sysconfdir}/init.d/
+ rm -rf ${D}${sysconfdir}/rc*
+ fi
+}
+
+PACKAGES =+ "${PN}-lib ${PN}-libimage"
+
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
+FILES_${PN} += "${libdir}/cups/backend \
+ ${libdir}/cups/cgi-bin \
+ ${libdir}/cups/filter \
+ ${libdir}/cups/monitor \
+ ${libdir}/cups/notifier \
+ ${libdir}/cups/daemon \
+ "
+
+FILES_${PN}-lib = "${libdir}/libcups.so.*"
+
+FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
+
+#package the html for the webgui inside the main packages (~1MB uncompressed)
+
+FILES_${PN} += "${datadir}/doc/cups/images \
+ ${datadir}/doc/cups/*html \
+ ${datadir}/doc/cups/*.css \
+ ${datadir}/icons/ \
+ "
+CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
+
+SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
+cups_sysroot_preprocess () {
+ sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
+}
diff --git a/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch b/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
new file mode 100644
index 000000000..db013cf08
--- /dev/null
+++ b/poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+From 90069586167b930befce7303aea57078f04b4ed8 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sun, 30 Jan 2011 16:37:27 +0100
+Subject: [PATCH] don't try to run generated binaries
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ ppdc/Makefile | 30 +++++++++++++++---------------
+ 1 files changed, 15 insertions(+), 15 deletions(-)
+
+Index: cups-2.2.6/ppdc/Makefile
+===================================================================
+--- cups-2.2.6.orig/ppdc/Makefile
++++ cups-2.2.6/ppdc/Makefile
+@@ -228,8 +228,8 @@ genstrings: genstrings.o libcupsppdc.a
+ $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
+ libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
+ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+- echo Generating localization strings...
+- ./genstrings >sample.c
++# echo Generating localization strings...
++# ./genstrings >sample.c
+
+
+ #
+@@ -246,9 +246,9 @@ ppdc-static: ppdc.o libcupsppdc.a ../cu
+ $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
+ ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
+- echo Testing PPD compiler...
+- ./ppdc-static -l en,fr -I ../data foo.drv
+- ./ppdc-static -l en,fr -z -I ../data foo.drv
++# echo Testing PPD compiler...
++# ./ppdc-static -l en,fr -I ../data foo.drv
++# ./ppdc-static -l en,fr -z -I ../data foo.drv
+
+
+ #
+@@ -274,17 +274,17 @@ ppdi-static: ppdc-static ppdi.o libcups
+ $(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
+ ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
+- echo Testing PPD importer...
+- $(RM) -r ppd ppd2 sample-import.drv
+- ./ppdc-static -l en -I ../data sample.drv
+- ./ppdi-static -I ../data -o sample-import.drv ppd/*
+- ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
+- if diff -r ppd ppd2 >/dev/null; then \
+- echo PPD import OK; \
+- else \
+- echo PPD import FAILED; \
+- exit 1; \
+- fi
++# echo Testing PPD importer...
++# $(RM) -r ppd ppd2 sample-import.drv
++# ./ppdc-static -l en -I ../data sample.drv
++# ./ppdi-static -I ../data -o sample-import.drv ppd/*
++# ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
++# if diff -r ppd ppd2 >/dev/null; then \
++# echo PPD import OK; \
++# else \
++# echo PPD import FAILED; \
++# exit 1; \
++# fi
+
+
+ #
diff --git a/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch b/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch
new file mode 100644
index 000000000..f7b44a7bc
--- /dev/null
+++ b/poky/meta/recipes-extended/cups/cups/cups_serverbin.patch
@@ -0,0 +1,32 @@
+Make CUPS_SERVERBIN relative to libdir otherwise on 64bit arches
+e.g. ppc64 where base libdir is lib64 this does not go well
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [OE config specific]
+
+Index: cups-1.4.6/config-scripts/cups-directories.m4
+===================================================================
+--- cups-1.4.6.orig/config-scripts/cups-directories.m4 2009-04-12 16:04:51.000000000 -0700
++++ cups-1.4.6/config-scripts/cups-directories.m4 2012-07-21 12:12:05.896405923 -0700
+@@ -397,7 +397,7 @@
+ *)
+ # All others
+ INSTALL_SYSV="install-sysv"
+- CUPS_SERVERBIN="$exec_prefix/lib/cups"
++ CUPS_SERVERBIN="$libdir/cups"
+ ;;
+ esac
+
+Index: cups-1.4.6/configure
+===================================================================
+--- cups-1.4.6.orig/configure 2012-07-21 12:13:34.512405950 -0700
++++ cups-1.4.6/configure 2012-07-21 12:14:05.724406017 -0700
+@@ -11181,7 +11181,7 @@
+ *)
+ # All others
+ INSTALL_SYSV="install-sysv"
+- CUPS_SERVERBIN="$exec_prefix/lib/cups"
++ CUPS_SERVERBIN="$libdir/cups"
+ ;;
+ esac
+
diff --git a/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch b/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
new file mode 100644
index 000000000..696f1374d
--- /dev/null
+++ b/poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: cups-1.6.1/scheduler/cups.sh.in
+===================================================================
+--- cups-1.6.1.orig/scheduler/cups.sh.in
++++ cups-1.6.1/scheduler/cups.sh.in
+@@ -67,7 +67,7 @@ case "`uname`" in
+ ECHO_ERROR=:
+ ;;
+
+- Linux*)
++ DisableLinux*)
+ IS_ON=/bin/true
+ if test -f /etc/init.d/functions; then
+ . /etc/init.d/functions
diff --git a/poky/meta/recipes-extended/cups/cups_2.2.6.bb b/poky/meta/recipes-extended/cups/cups_2.2.6.bb
new file mode 100644
index 000000000..3aa934bc0
--- /dev/null
+++ b/poky/meta/recipes-extended/cups/cups_2.2.6.bb
@@ -0,0 +1,6 @@
+require cups.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f212b4338db0da8cb892e94bf2949460"
+
+SRC_URI[md5sum] = "e91c26d8d97b5a1630a962f530f02192"
+SRC_URI[sha256sum] = "40385778c2b3bdf55030d1c999734e22774c79e3425d91339ce677825620169b"
diff --git a/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb b/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
new file mode 100644
index 000000000..65a99fc28
--- /dev/null
+++ b/poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Collection of autoconf m4 macros"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}.berlios/${BP}.tar.bz2"
+SRC_URI[md5sum] = "074afcb50d0a8bff10786a2954b2b02d"
+SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121"
+
+do_configure() {
+ :
+}
+
+do_install() {
+ oe_runmake CWAUTOMACROSPREFIX=${D}${prefix} install
+
+ # cleanup buildpaths in autogen.sh
+ sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch
new file mode 100644
index 000000000..351f87cab
--- /dev/null
+++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/0001-explicitly-disable-replacing-getopt.patch
@@ -0,0 +1,30 @@
+Subject: explicitly disable replacing getopt
+
+Explicitly disable replacing getopt to avoid compilation error like below.
+
+ xstrtol-error.c:84:26: error: invalid use of undefined type 'struct rpl_option'
+
+Upstream-Status: Inappropriate [workaround]
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ m4/getopt.m4 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/m4/getopt.m4 b/m4/getopt.m4
+index 3ebc7b7..8934426 100644
+--- a/m4/getopt.m4
++++ b/m4/getopt.m4
+@@ -22,8 +22,8 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
+ fi
+ ])
+ if test $REPLACE_GETOPT = 1; then
+- dnl Arrange for getopt.h to be created.
+- gl_GETOPT_SUBSTITUTE_HEADER
++ dnl Explicitly disable replacing getopt
++ :
+ fi
+ ])
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest b/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/poky/meta/recipes-extended/diffutils/diffutils-3.6/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/poky/meta/recipes-extended/diffutils/diffutils.inc b/poky/meta/recipes-extended/diffutils/diffutils.inc
new file mode 100644
index 000000000..c9e313058
--- /dev/null
+++ b/poky/meta/recipes-extended/diffutils/diffutils.inc
@@ -0,0 +1,13 @@
+SUMMARY = "Diffutils contains tools used for finding differences between files"
+HOMEPAGE = "https://www.gnu.org/software/diffutils/diffutils.html"
+DESCRIPTION = "Diffutils contains the GNU diff, diff3, \
+sdiff, and cmp utilities. These programs are usually \
+used for creating patch files."
+SECTION = "base"
+
+inherit autotools texinfo update-alternatives gettext
+
+ALTERNATIVE_${PN} = "diff cmp"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb b/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb
new file mode 100644
index 000000000..deadd62c6
--- /dev/null
+++ b/poky/meta/recipes-extended/diffutils/diffutils_3.6.bb
@@ -0,0 +1,39 @@
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+require diffutils.inc
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+"
+SRC_URI_append_libc-glibc = " file://0001-explicitly-disable-replacing-getopt.patch"
+
+SRC_URI[md5sum] = "07cf286672ced26fba54cd0313bdc071"
+SRC_URI[sha256sum] = "d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6"
+
+EXTRA_OECONF += "ac_cv_path_PR_PROGRAM=${bindir}/pr --without-libsigsegv-prefix"
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+inherit ptest
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
+ cp -r ${S}/tests $t/
+ install ${B}/tests/Makefile $t/tests/
+ sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ -e 's|^Makefile:|_Makefile:|' \
+ -e 's|bash|sh|' \
+ -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
+ -e 's|^srcdir = \(.*\)|srcdir = .|' \
+ -e 's|"`$(built_programs)`"|diff|' \
+ -e 's|gawk|awk|g' \
+ -i $t/tests/Makefile
+}
diff --git a/poky/meta/recipes-extended/ed/ed_1.14.2.bb b/poky/meta/recipes-extended/ed/ed_1.14.2.bb
new file mode 100644
index 000000000..87d03b10b
--- /dev/null
+++ b/poky/meta/recipes-extended/ed/ed_1.14.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7 \
+ file://ed.h;endline=20;md5=4e36b7a40e137f42aee718165590d125 \
+ file://main.c;endline=17;md5=c5b8f78f115df187af76868a2aead16a"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+# Upstream regularly removes previous releases from https://ftp.gnu.org/gnu/ed/
+SRC_URI = "${GNU_MIRROR}/ed/${BP}.tar.lz"
+UPSTREAM_CHECK_URI = "${GNU_MIRROR}/ed/"
+
+SRC_URI[md5sum] = "273d04778b2a51f7c3cbfcd2001876bf"
+SRC_URI[sha256sum] = "f57962ba930d70d02fc71d6be5c5f2346b16992a455ab9c43be7061dec9810db"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit texinfo
+
+do_configure() {
+ ${S}/configure
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+}
diff --git a/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
new file mode 100644
index 000000000..de3810404
--- /dev/null
+++ b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
@@ -0,0 +1,20 @@
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate
+(default automake behavior incompatible with ptest)
+
+Index: ethtool-4.13/configure.ac
+===================================================================
+--- ethtool-4.13.orig/configure.ac
++++ ethtool-4.13/configure.ac
+@@ -2,7 +2,7 @@ dnl Process this file with autoconf to p
+ AC_INIT(ethtool, 4.13, netdev@vger.kernel.org)
+ AC_PREREQ(2.52)
+ AC_CONFIG_SRCDIR([ethtool.c])
+-AM_INIT_AUTOMAKE([gnu])
++AM_INIT_AUTOMAKE([gnu serial-tests])
+ AC_CONFIG_HEADERS([ethtool-config.h])
+
+ AM_MAINTAINER_MODE
diff --git a/poky/meta/recipes-extended/ethtool/ethtool/run-ptest b/poky/meta/recipes-extended/ethtool/ethtool/run-ptest
new file mode 100644
index 000000000..1e245da11
--- /dev/null
+++ b/poky/meta/recipes-extended/ethtool/ethtool/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest-TESTS
diff --git a/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb b/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb
new file mode 100644
index 000000000..c862a5795
--- /dev/null
+++ b/poky/meta/recipes-extended/ethtool/ethtool_4.13.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Display or change ethernet card settings"
+DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
+HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \
+ file://run-ptest \
+ file://avoid_parallel_tests.patch \
+ "
+
+SRC_URI[md5sum] = "2ba44eb0ca96752392e9bf8dc83ba302"
+SRC_URI[sha256sum] = "d311c4b557c44c5248ac5436b9e19c391a60d8e4830b6a7f41be16d89c0556de"
+
+inherit autotools ptest
+RDEPENDS_${PN}-ptest += "make"
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest () {
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ install ${B}/test-cmdline ${D}${PTEST_PATH}
+ install ${B}/test-features ${D}${PTEST_PATH}
+ install ${B}/ethtool ${D}${PTEST_PATH}/ethtool
+ sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
+}
diff --git a/poky/meta/recipes-extended/findutils/findutils.inc b/poky/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 000000000..ad3642923
--- /dev/null
+++ b/poky/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,16 @@
+SUMMARY = "find, locate, and xargs binaries"
+DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \
+These programs are typically used in conjunction with other programs to provide modular and powerful directory \
+search and file locating capabilities to other commands."
+HOMEPAGE = "http://www.gnu.org/software/findutils/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
+SECTION = "console/utils"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
+
+inherit autotools gettext texinfo update-alternatives upstream-version-is-even
+
+ALTERNATIVE_${PN} = "find xargs"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..8729e1b44
--- /dev/null
+++ b/poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: findutils-4.5.14/gl/lib/Makefile.am
+===================================================================
+--- findutils-4.5.14.orig/gl/lib/Makefile.am
++++ findutils-4.5.14/gl/lib/Makefile.am
+@@ -1220,7 +1220,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb b/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb
new file mode 100644
index 000000000..072d3b3c0
--- /dev/null
+++ b/poky/meta/recipes-extended/findutils/findutils_4.6.0.bb
@@ -0,0 +1,17 @@
+require findutils.inc
+
+# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+DEPENDS = "bison-native"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "9936aa8009438ce185bea2694a997fc1"
+SRC_URI[sha256sum] = "ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d"
+
+# http://savannah.gnu.org/bugs/?27299
+CACHED_CONFIGUREVARS += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', 'gl_cv_func_wcwidth_works=yes', '', d)}"
+
+EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch
new file mode 100644
index 000000000..aaedc88aa
--- /dev/null
+++ b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8327.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+
+http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/revision/7406
+
+Hand applied change to util.c. Fix was for cups-filters but also applied to foomatic-filters.
+
+CVE: CVE-2015-8327
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: util.c
+===================================================================
+--- a/util.c
++++ b/util.c
+@@ -31,7 +31,7 @@
+ #include <assert.h>
+
+
+-const char* shellescapes = "|;<>&!$\'\"#*?()[]{}";
++const char* shellescapes = "|;<>&!$\'\"`#*?()[]{}";
+
+ const char * temp_dir()
+ {
diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch
new file mode 100644
index 000000000..dc973c459
--- /dev/null
+++ b/poky/meta/recipes-extended/foomatic/foomatic-filters-4.0.17/CVE-2015-8560.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+
+http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/revision/7419
+
+Hand applied change to util.c. Fix was for cups-filters but also applied to foomatic-filters.
+
+CVE: CVE-2015-8560
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: util.c
+===================================================================
+--- a/util.c
++++ b/util.c
+@@ -31,7 +31,7 @@
+ #include <assert.h>
+
+
+-const char* shellescapes = "|<>&!$\'\"#*?()[]{}";
++const char* shellescapes = "|;<>&!$\'\"#*?()[]{}";
+
+ const char * temp_dir()
+ {
diff --git a/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb b/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
new file mode 100644
index 000000000..742c9a5cf
--- /dev/null
+++ b/poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
@@ -0,0 +1,44 @@
+SUMMARY = "OpenPrinting printer support - filters"
+HOMEPAGE = "https://wiki.linuxfoundation.org/openprinting/start"
+DESCRIPTION = "Foomatic is a printer database designed to make it easier to set up \
+common printers for use with UNIX-like operating systems.\
+It provides the "glue" between a print spooler (like CUPS or lpr) and \
+the printer, by processing files sent to the printer. \
+ \
+This package consists of filters used by the printer spoolers \
+to convert the incoming PostScript data into the printer's native \
+format using a printer-specific, but spooler-independent PPD file. \
+"
+
+DEPENDS += "cups perl libxml2"
+PR = "r1"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/foomatic-filters-${PV}/COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRC_URI = "http://www.openprinting.org/download/foomatic/foomatic-filters-${PV}.tar.gz"
+
+SRC_URI += "file://CVE-2015-8560.patch \
+ file://CVE-2015-8327.patch \
+ "
+
+SRC_URI[md5sum] = "b05f5dcbfe359f198eef3df5b283d896"
+SRC_URI[sha256sum] = "a2e2e53e502571e88eeb9010c45a0d54671f15707ee104f5c9c22b59ea7a33e3"
+
+UPSTREAM_CHECK_REGEX = "foomatic-filters-(?P<pver>((\d|\d\d)\.*)+)\.tar\.gz"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-file-converter-check --with-file-converter=texttops"
+
+do_configure_prepend() {
+ export PERL="${bindir}/env perl"
+ export CUPS_SERVERBIN=${exec_prefix}/lib/cups # /usr/lib NOT libdir
+}
+
+do_install_append_linuxstdbase() {
+ install -d ${D}${exec_prefix}/lib/cups/filter
+ ln -sf ${bindir}/foomatic-rip ${D}${exec_prefix}/lib/cups/filter
+}
+
+FILES_${PN} += "${exec_prefix}/lib/cups/ ${exec_prefix}/lib/ppr/"
diff --git a/poky/meta/recipes-extended/gawk/gawk/run-ptest b/poky/meta/recipes-extended/gawk/gawk/run-ptest
new file mode 100644
index 000000000..d23f0bf6d
--- /dev/null
+++ b/poky/meta/recipes-extended/gawk/gawk/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cd test
+for i in `grep -vE "@|^$|#|Gt-dummy" Maketests |awk -F: '{print $1}'`; \
+ do LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} srcdir=`pwd` AWK=gawk CMP=cmp \
+ make -f Maketests $i >$i.tmp 2>&1; \
+ grep -q "Error" $i.tmp; \
+ if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+ else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb b/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb
new file mode 100644
index 000000000..27f79a2be
--- /dev/null
+++ b/poky/meta/recipes-extended/gawk/gawk_4.2.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "https://www.gnu.org/software/gawk/"
+BUGTRACKER = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "readline"
+
+PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "0b598c31bc703d66082bd958d4189980"
+SRC_URI[sha256sum] = "c88046c6e8396ee548bcb941e16def809b7b55b60a1044b5dd254094f347c7d9"
+
+inherit autotools gettext texinfo update-alternatives
+
+FILES_${PN} += "${datadir}/awk"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install_append() {
+ # remove the link since we don't package it
+ rm ${D}${bindir}/awk
+}
+
+inherit ptest
+
+do_install_ptest() {
+ mkdir ${D}${PTEST_PATH}/test
+ for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests inclib.awk; \
+ do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
+ done
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch b/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
new file mode 100644
index 000000000..c3e44fe86
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
@@ -0,0 +1,38 @@
+From 5ef8b85bc98f3bd9a15d5f47e24d3e23ae27c265 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 18 Jan 2016 01:00:30 -0500
+Subject: [PATCH] configure.ac: do not check local png source
+
+In oe-core, it did not need to compile local libpng
+source in ghostscript, so do not check local png
+source, and directly check the existance of shared
+libpng library.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bf6d3f5..01df03f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -930,11 +930,11 @@ AC_SUBST(ZLIBDIR)
+ AC_SUBST(FT_SYS_ZLIB)
+
+ dnl png for the png output device; it also requires zlib
+-LIBPNGDIR=src
++LIBPNGDIR=$srcdir/libpng
+ PNGDEVS=''
+ PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
+ AC_MSG_CHECKING([for local png library source])
+-if test -f $srcdir/libpng/pngread.c; then
++if false; then
+ AC_MSG_RESULT([yes])
+ SHARE_LIBPNG=0
+ LIBPNGDIR=$srcdir/libpng
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch
new file mode 100644
index 000000000..84983c5ae
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-11714.patch
@@ -0,0 +1,61 @@
+From 671fd59eb657743aa86fbc1895cb15872a317caa Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 6 Jul 2017 14:54:02 +0100
+Subject: [PATCH] Bug 698158: prevent trying to reloc a freed object
+
+In the token reader, we pass the scanner state structure around as a
+t_struct ref on the Postscript operand stack.
+
+But we explicitly free the scanner state when we're done, which leaves a
+dangling reference on the operand stack and, unless that reference gets
+overwritten before the next garbager run, we can end up with the garbager
+trying to deal with an already freed object - that can cause a crash, or
+memory corruption.
+---
+ psi/ztoken.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-11714
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/psi/ztoken.c b/psi/ztoken.c
+index 4dba7c5..af1ceeb 100644
+--- a/psi/ztoken.c
++++ b/psi/ztoken.c
+@@ -107,6 +107,12 @@ token_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
+ int code;
+ ref token;
+
++ /* Since we might free pstate below, and we're dealing with
++ * gc memory referenced by the stack, we need to explicitly
++ * remove the reference to pstate from the stack, otherwise
++ * the garbager will fall over
++ */
++ make_null(osp);
+ /* Note that gs_scan_token may change osp! */
+ pop(1); /* remove the file or scanner state */
+ again:
+@@ -183,8 +189,14 @@ ztokenexec_continue(i_ctx_t *i_ctx_p)
+ static int
+ tokenexec_continue(i_ctx_t *i_ctx_p, scanner_state * pstate, bool save)
+ {
+- os_ptr op;
++ os_ptr op = osp;
+ int code;
++ /* Since we might free pstate below, and we're dealing with
++ * gc memory referenced by the stack, we need to explicitly
++ * remove the reference to pstate from the stack, otherwise
++ * the garbager will fall over
++ */
++ make_null(osp);
+ /* Note that gs_scan_token may change osp! */
+ pop(1);
+ again:
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch
new file mode 100644
index 000000000..62cc1342a
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-5951.patch
@@ -0,0 +1,44 @@
+From bfa6b2ecbe48edc69a7d9d22a12419aed25960b8 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 6 Apr 2017 16:44:54 +0100
+Subject: [PATCH] Bug 697548: use the correct param list enumerator
+
+When we encountered dictionary in a ref_param_list, we were using the enumerator
+for the "parent" param_list, rather than the enumerator for the param_list
+we just created for the dictionary. That parent was usually the stack
+list enumerator, and caused a segfault.
+
+Using the correct enumerator works better.
+
+Upstream-Status: Backport
+CVE: CVE-2017-5951
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ psi/iparam.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/psi/iparam.c b/psi/iparam.c
+index 4e63b6d..b2fa85f 100644
+--- a/psi/iparam.c
++++ b/psi/iparam.c
+@@ -770,12 +770,13 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey,
+ gs_param_enumerator_t enumr;
+ gs_param_key_t key;
+ ref_type keytype;
++ dict_param_list *dlist = (dict_param_list *) pvalue->value.d.list;
+
+ param_init_enumerator(&enumr);
+- if (!(*((iparam_list *) plist)->enumerate)
+- ((iparam_list *) pvalue->value.d.list, &enumr, &key, &keytype)
++ if (!(*(dlist->enumerate))
++ ((iparam_list *) dlist, &enumr, &key, &keytype)
+ && keytype == t_integer) {
+- ((dict_param_list *) pvalue->value.d.list)->int_keys = 1;
++ dlist->int_keys = 1;
+ pvalue->type = gs_param_type_dict_int_keys;
+ }
+ }
+--
+2.10.2
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch
new file mode 100644
index 000000000..a05dc02c6
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7207.patch
@@ -0,0 +1,39 @@
+From 0e88bee1304993668fede72498d656a2dd33a35e Mon Sep 17 00:00:00 2001
+From: Ken Sharp <ken.sharp@artifex.com>
+Date: Mon, 20 Mar 2017 09:34:11 +0000
+Subject: [PATCH] Ensure a device has raster memory, before trying to read it.
+
+Bug #697676 "Null pointer dereference in mem_get_bits_rectangle()"
+
+This is only possible by abusing/mis-using Ghostscript-specific
+language extensions, so cannot happen in a general PostScript program.
+
+Nevertheless, Ghostscript should not crash. So this commit checks the
+memory device to see if raster memory has been allocated, before trying
+to read from it.
+
+Upstream-Status: Backport
+CVE: CVE-2017-7207
+
+Author: Ken Sharp <ken.sharp@artifex.com>
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ base/gdevmem.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/base/gdevmem.c b/base/gdevmem.c
+index 41108ba..183f96d 100644
+--- a/base/gdevmem.c
++++ b/base/gdevmem.c
+@@ -605,6 +605,8 @@ mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect,
+ GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE;
+ return_error(gs_error_rangecheck);
+ }
++ if (mdev->line_ptrs == 0x00)
++ return_error(gs_error_rangecheck);
+ if ((w <= 0) | (h <= 0)) {
+ if ((w | h) < 0)
+ return_error(gs_error_rangecheck);
+--
+2.10.2
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch
new file mode 100644
index 000000000..e406086e8
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-7975.patch
@@ -0,0 +1,37 @@
+From b39be1019b4acc1aa50c6026463c543332e95a31 Mon Sep 17 00:00:00 2001
+From: Catalin Enache <catalin.enache@windriver.com>
+Date: Mon, 8 May 2017 16:18:14 +0300
+
+Subject: [PATCH] Bug 697693: Prevent SEGV due to integer overflow.
+
+While building a Huffman table, the start and end points were susceptible
+to integer overflow.
+
+Thank you to Jiaqi for finding this issue and suggesting a patch.
+
+Upstream-Status: Backport
+CVE: CVE-2017-7975
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+
+Contents of this patch were extracted from a larger patch which addressed
+two CVE's. The context (location of {) was also modified to apply to
+ghostscript 9.21.
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/jbig2dec/jbig2_huffman.c
++++ b/jbig2dec/jbig2_huffman.c
+@@ -421,8 +421,8 @@ jbig2_build_huffman_table(Jbig2Ctx *ctx,
+
+ if (PREFLEN == CURLEN) {
+ int RANGELEN = lines[CURTEMP].RANGELEN;
+- int start_j = CURCODE << shift;
+- int end_j = (CURCODE + 1) << shift;
++ uint32_t start_j = CURCODE << shift;
++ uint32_t end_j = (CURCODE + 1) << shift;
+ byte eflags = 0;
+
+ if (end_j > max_j) {
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch
new file mode 100644
index 000000000..1caeb3ef5
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9216.patch
@@ -0,0 +1,36 @@
+From 3ebffb1d96ba0cacec23016eccb4047dab365853 Mon Sep 17 00:00:00 2001
+From: Shailesh Mistry <shailesh.mistry@hotmail.co.uk>
+Date: Wed, 24 May 2017 19:29:57 +0100
+Subject: [PATCH] Bug 697934: Fix SEGV due to error code being ignored.
+
+The return code from jbig2_decode_text_region was being ignored so the
+code continued to try and parse the invalid file using incomplete/empty
+structures.
+
+Upstream-Status: Backport
+CVE: CVE-2017-9216
+
+Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
+---
+ jbig2dec/jbig2_symbol_dict.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/jbig2dec/jbig2_symbol_dict.c b/jbig2dec/jbig2_symbol_dict.c
+index 3cc1731..672425d 100644
+--- a/jbig2dec/jbig2_symbol_dict.c
++++ b/jbig2dec/jbig2_symbol_dict.c
+@@ -493,8 +493,10 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
+ }
+
+ /* multiple symbols are handled as a text region */
+- jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
++ code = jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,
+ n_refagg_dicts, image, data, size, GR_stats, as, ws);
++ if (code < 0)
++ goto cleanup4;
+
+ SDNEWSYMS->glyphs[NSYMSDECODED] = image;
+ refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]);
+--
+2.10.2
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch
new file mode 100644
index 000000000..58ef04d1f
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9611.patch
@@ -0,0 +1,34 @@
+From c7c55972758a93350882c32147801a3485b010fe Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 12 Jun 2017 13:08:40 +0100
+Subject: [PATCH] Bug 698024: bounds check zone pointer in Ins_MIRP()
+
+---
+ base/ttinterp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9611
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index e56aec6..f6a6d95 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -3858,7 +3858,8 @@ static int nInstrCount=0;
+ /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */
+
+ if ( BOUNDS( args[0], CUR.zp1.n_points ) ||
+- BOUNDS( args[1]+1, CUR.cvtSize+1 ) )
++ BOUNDS( args[1]+1, CUR.cvtSize+1 ) ||
++ BOUNDS(CUR.GS.rp0, CUR.zp0.n_points) )
+ {
+ CUR.error = TT_Err_Invalid_Reference;
+ return;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch
new file mode 100644
index 000000000..b737cc56b
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9612.patch
@@ -0,0 +1,35 @@
+From 98f6da60b9d463c617e631fc254cf6d66f2e8e3c Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Mon, 12 Jun 2017 13:15:17 +0100
+Subject: [PATCH] Bug 698026: bounds check zone pointers in Ins_IP()
+
+---
+ base/ttinterp.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9612
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index f6a6d95..e7c9d68 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -4129,7 +4129,9 @@ static int nInstrCount=0;
+ Int point;
+ (void)args;
+
+- if ( CUR.top < CUR.GS.loop )
++ if ( CUR.top < CUR.GS.loop ||
++ BOUNDS(CUR.GS.rp1, CUR.zp0.n_points) ||
++ BOUNDS(CUR.GS.rp2, CUR.zp1.n_points))
+ {
+ CUR.error = TT_Err_Invalid_Reference;
+ return;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch
new file mode 100644
index 000000000..3e6c65699
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9726.patch
@@ -0,0 +1,33 @@
+From 7755e67116e8973ee0e3b22d653df026a84fa01b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 15 Jun 2017 08:58:31 +0100
+Subject: [PATCH] Bug 698055: bounds check zone pointer in Ins_MDRP
+
+---
+ base/ttinterp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9726
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index e7c9d68..af457e8 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -3770,7 +3770,8 @@ static int nInstrCount=0;
+
+ point = (Int)args[0];
+
+- if ( BOUNDS( args[0], CUR.zp1.n_points ) )
++ if ( BOUNDS( args[0], CUR.zp1.n_points ) ||
++ BOUNDS( CUR.GS.rp0, CUR.zp0.n_points) )
+ {
+ /* Current version of FreeType silently ignores this out of bounds error
+ * and drops the instruction, see bug #691121
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch
new file mode 100644
index 000000000..a2f7bfa50
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9727.patch
@@ -0,0 +1,35 @@
+From 937ccd17ac65935633b2ebc06cb7089b91e17e6b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Thu, 15 Jun 2017 09:05:20 +0100
+Subject: [PATCH] Bug 698056: make bounds check in gx_ttfReader__Read more
+ robust
+
+---
+ base/gxttfb.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- end of original header
+
+CVE: CVE-2017-9727
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/gxttfb.c b/base/gxttfb.c
+index 0e9a444..e1561af 100644
+--- a/base/gxttfb.c
++++ b/base/gxttfb.c
+@@ -79,7 +79,8 @@ static void gx_ttfReader__Read(ttfReader *self, void *p, int n)
+ if (!r->error) {
+ if (r->extra_glyph_index != -1) {
+ q = r->glyph_data.bits.data + r->pos;
+- r->error = (r->glyph_data.bits.size - r->pos < n ?
++ r->error = ((r->pos >= r->glyph_data.bits.size ||
++ r->glyph_data.bits.size - r->pos < n) ?
+ gs_note_error(gs_error_invalidfont) : 0);
+ if (r->error == 0)
+ memcpy(p, q, n);
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch
new file mode 100644
index 000000000..69a94df7b
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9739.patch
@@ -0,0 +1,37 @@
+From c501a58f8d5650c8ba21d447c0d6f07eafcb0f15 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Fri, 16 Jun 2017 08:29:25 +0100
+Subject: [PATCH] Bug 698063: Bounds check Ins_JMPR
+
+---
+ base/ttinterp.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- end of original header
+
+CVE: CVE-2017-9739
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/ttinterp.c b/base/ttinterp.c
+index af457e8..adf3f0c 100644
+--- a/base/ttinterp.c
++++ b/base/ttinterp.c
+@@ -1794,6 +1794,12 @@ static int nInstrCount=0;
+
+ static void Ins_JMPR( INS_ARG )
+ {
++ if ( BOUNDS(CUR.IP + args[0], CUR.codeSize ) )
++ {
++ CUR.error = TT_Err_Invalid_Reference;
++ return;
++ }
++
+ CUR.IP += (Int)(args[0]);
+ CUR.step_ins = FALSE;
+
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch
new file mode 100644
index 000000000..7c65690c6
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2017-9835.patch
@@ -0,0 +1,125 @@
+From cfde94be1d4286bc47633c6e6eaf4e659bd78066 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 7 Jun 2017 14:55:12 +0100
+Subject: [PATCH] Bug 697985: bounds check the array allocations methods
+
+The clump allocator has four allocation functions that use 'number of elements'
+and 'size of elements' parameters (rather than a simple 'number of bytes').
+
+Those need specific bounds checking.
+---
+ base/gsalloc.c | 42 ++++++++++++++++++++++++++++--------------
+ 1 file changed, 28 insertions(+), 14 deletions(-)
+
+--- end of original header
+
+CVE: CVE-2017-9835
+
+Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/base/gsalloc.c b/base/gsalloc.c
+index 741ba00..10c04dd 100644
+--- a/base/gsalloc.c
++++ b/base/gsalloc.c
+@@ -1248,19 +1248,32 @@ i_alloc_struct_immovable(gs_memory_t * mem, gs_memory_type_ptr_t pstype,
+ alloc_trace("|+<.", imem, cname, pstype, size, obj);
+ return obj;
+ }
++
++static inline bool
++alloc_array_check_size(ulong num_elements, ulong elt_size, ulong *lsize)
++{
++ int64_t s = (int64_t)num_elements * elt_size;
++ if (s > max_uint) {
++ return false;
++ }
++ *lsize = (ulong)s;
++ return true;
++}
++
+ static byte *
+ i_alloc_byte_array(gs_memory_t * mem, uint num_elements, uint elt_size,
+ client_name_t cname)
+ {
+ gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+ obj_header_t *obj;
+-
++ ulong lsize;
+ #ifdef MEMENTO
+ if (Memento_failThisEvent())
+ return NULL;
+ #endif
+-
+- obj = alloc_obj(imem, (ulong) num_elements * elt_size,
++ if (alloc_array_check_size(num_elements, elt_size, &lsize) == false)
++ return NULL;
++ obj = alloc_obj(imem, lsize,
+ &st_bytes, ALLOC_DIRECT, cname);
+
+ if_debug6m('A', mem, "[a%d:+b.]%s -bytes-*(%lu=%u*%u) = 0x%lx\n",
+@@ -1275,13 +1288,14 @@ i_alloc_byte_array_immovable(gs_memory_t * mem, uint num_elements,
+ {
+ gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+ obj_header_t *obj;
+-
++ ulong lsize;
+ #ifdef MEMENTO
+ if (Memento_failThisEvent())
+ return NULL;
+ #endif
+-
+- obj = alloc_obj(imem, (ulong) num_elements * elt_size,
++ if (alloc_array_check_size(num_elements, elt_size, &lsize) == false)
++ return NULL;
++ obj = alloc_obj(imem, lsize,
+ &st_bytes, ALLOC_IMMOVABLE | ALLOC_DIRECT,
+ cname);
+
+@@ -1297,7 +1311,7 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements,
+ {
+ gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+ obj_header_t *obj;
+-
++ ulong lsize;
+ #ifdef MEMENTO
+ if (Memento_failThisEvent())
+ return NULL;
+@@ -1311,9 +1325,9 @@ i_alloc_struct_array(gs_memory_t * mem, uint num_elements,
+ return NULL; /* fail */
+ }
+ #endif
+- obj = alloc_obj(imem,
+- (ulong) num_elements * pstype->ssize,
+- pstype, ALLOC_DIRECT, cname);
++ if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false)
++ return NULL;
++ obj = alloc_obj(imem, lsize, pstype, ALLOC_DIRECT, cname);
+ if_debug7m('A', mem, "[a%d:+<.]%s %s*(%lu=%u*%u) = 0x%lx\n",
+ alloc_trace_space(imem), client_name_string(cname),
+ struct_type_name_string(pstype),
+@@ -1327,16 +1341,16 @@ i_alloc_struct_array_immovable(gs_memory_t * mem, uint num_elements,
+ {
+ gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
+ obj_header_t *obj;
+-
++ ulong lsize;
+ #ifdef MEMENTO
+ if (Memento_failThisEvent())
+ return NULL;
+ #endif
+
+ ALLOC_CHECK_SIZE(mem,pstype);
+- obj = alloc_obj(imem,
+- (ulong) num_elements * pstype->ssize,
+- pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname);
++ if (alloc_array_check_size(num_elements, pstype->ssize, &lsize) == false)
++ return NULL;
++ obj = alloc_obj(imem, lsize, pstype, ALLOC_IMMOVABLE | ALLOC_DIRECT, cname);
+ if_debug7m('A', mem, "[a%d|+<.]%s %s*(%lu=%u*%u) = 0x%lx\n",
+ alloc_trace_space(imem), client_name_string(cname),
+ struct_type_name_string(pstype),
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
new file mode 100644
index 000000000..e8772cd95
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch
new file mode 100644
index 000000000..c4794e7d8
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/avoid-host-contamination.patch
@@ -0,0 +1,19 @@
+Remove hardcode path refer to host to avoid host contamination.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/devices/devs.mak b/devices/devs.mak
+index 3070d2e..df663f0 100644
+--- a/devices/devs.mak
++++ b/devices/devs.mak
+@@ -546,7 +546,7 @@ $(DEVOBJ)gdevxalt.$(OBJ) : $(DEVSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\
+ ### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT
+
+ $(DEVOBJ)X11.so : $(x11alt_) $(x11_) $(DEVS_MAK) $(MAKEDIRS)
+- $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -L/usr/X11R6/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
++ $(CCLD) $(LDFLAGS) -shared -o $(DEVOBJ)X11.so $(x11alt_) $(x11_) -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS)
+
+ ###### --------------- Memory-buffered printer devices --------------- ######
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
new file mode 100644
index 000000000..d97d4ecd7
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
@@ -0,0 +1,36 @@
+base/genht.c: add a preprocessor define to allow fopen calling
+
+The commit in upstream:
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643
+
+Replace all fopen calls with gp_fopen and add a preprocessor define so
+that any unintential calls directly to fopen will cause an error.
+
+Only exceptions are those in the platform specific code, and mkromfs.c.
+This patch add a preprocessor define to allow fopen calling in base/genht.c.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/genht.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/base/genht.c b/base/genht.c
+index 4b04085..cc82fff 100644
+--- a/base/genht.c
++++ b/base/genht.c
+@@ -16,6 +16,10 @@
+
+ /* Generate C code for compiling halftones into ROM. */
+ #include "malloc_.h"
++
++/* prevent gp.h from defining fopen */
++#define fopen fopen
++
+ #include "stdio_.h"
+ #include "string_.h"
+ #include "gscdefs.h"
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
new file mode 100644
index 000000000..a1c9368cc
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
@@ -0,0 +1,31 @@
+Subject: [PATCH] Don't build-depend on libgcrypt, as nothing is used from it
+
+Backported from http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch
+
+This addresses the cryto dependency seen during build.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Rebase the patch to ghostscript-9.15
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cups/libs/cups/http-private.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cups/libs/cups/http-private.h b/cups/libs/cups/http-private.h
+index 99a85c3..a674852 100644
+--- a/cups/libs/cups/http-private.h
++++ b/cups/libs/cups/http-private.h
+@@ -80,7 +80,6 @@ typedef int socklen_t;
+ # elif defined HAVE_GNUTLS
+ # include <gnutls/gnutls.h>
+ # include <gnutls/x509.h>
+-# include <gcrypt.h>
+ # elif defined(HAVE_CDSASSL)
+ # include <CoreFoundation/CoreFoundation.h>
+ # include <Security/Security.h>
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
new file mode 100644
index 000000000..b4c14ea23
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
@@ -0,0 +1,29 @@
+Import patch from windriver linux for cross compilation, and split patches
+into oe way under different directories such as i586, powerpc etc according
+to Richard's opinion.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+# Author: Chi Xu <chi.xu@windriver.com>
+# Date: Feb 26 2010
+# Summary: Generate arch.h for ppc32
+#
+
+Index: ghostscript-9.21/base/lib.mak
+===================================================================
+--- ghostscript-9.21.orig/base/lib.mak
++++ ghostscript-9.21/base/lib.mak
+@@ -73,8 +73,8 @@ arch_h=$(GLGEN)arch.h
+ stdpre_h=$(GLSRC)stdpre.h
+ stdint__h=$(GLSRC)stdint_.h $(std_h)
+
+-$(GLGEN)arch.h : $(GENARCH_XE)
+- $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
++##$(GLGEN)arch.h : $(GENARCH_XE)
++## $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
+
+ # Platform interfaces
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
new file mode 100644
index 000000000..3ec395640
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
@@ -0,0 +1,40 @@
+From 14937d9247330065359ca0fb648c28dfa5c3b224 Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Tue, 13 Dec 2016 18:16:41 +0900
+Subject: [PATCH] ghostscript-9.15-parallel-make
+
+From 767bdf8a412b0cce2b734998e9b7e55abeaf932c Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Tue, 13 Dec 2016 17:55:54 +0900
+Subject: [PATCH] Robert Yang <liezhi.yang@windriver.com> Date: Fri, 30 Jan
+2015 00:40:22 -0800 Subject: [PATCH] contrib.mak: fix for parallel build
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Upstream-Status: Pending
+---
+ contrib/contrib.mak | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/contrib.mak b/contrib/contrib.mak
+index 55415b3..0b6b5ae 100644
+--- a/contrib/contrib.mak
++++ b/contrib/contrib.mak
+@@ -1099,6 +1099,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h \
+ $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
+
+ extra-dmprt-install: install-libdata
++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+@@ -1267,6 +1268,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH) \
+ ### ----------------- Additional .upp files ---------------- ###
+
+ extra-upp-install: install-libdata
++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \
+ done
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
new file mode 100644
index 000000000..d78648200
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
@@ -0,0 +1,30 @@
+From 5d5c83c89be0cff29dde2267fa168e6f7146be8c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 May 2015 22:31:48 -0700
+Subject: [PATCH] base/gendev.c: fix for -Werror=return-type
+
+Fixed:
+base/gendev.c:80:1: error: return type defaults to 'int' [-Werror=return-type]
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ base/gendev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/base/gendev.c b/base/gendev.c
+index 68a745f..8058b5a 100644
+--- a/base/gendev.c
++++ b/base/gendev.c
+@@ -77,6 +77,7 @@ static const char *indent_item = "";
+ /* Forward definitions */
+ void add_entry(config *, const char *, const char *, bool);
+
++int
+ main(int argc, char *argv[])
+ {
+ config conf;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch
new file mode 100644
index 000000000..bff3e6176
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-native-fix-disable-system-libtiff.patch
@@ -0,0 +1,37 @@
+ghostscript-native:fix disable-system-libtiff
+
+Modify configure to add the check to make sure
+ghostscrip could work while system-libtiff is
+disabled.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Updated to apply to ghostscript 9.21.
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+Upstream-Status: Pending
+
+
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1259,6 +1259,7 @@ case "x$with_system_libtiff" in
+ esac
+
+ if test x"$SHARE_LIBTIFF" = x"0" ; then
++ if test -e $LIBTIFFDIR/configure; then
+ echo "Running libtiff configure script..."
+ olddir=`pwd`
+ if ! test -d "$LIBTIFFCONFDIR" ; then
+@@ -1272,6 +1273,10 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then
+ cd "$olddir"
+ echo
+ echo "Continuing with Ghostscript configuration..."
++ else
++ AC_MSG_NOTICE([Could not find local copy of libtiff.
++Disabling tiff output devices.])
++ fi
+ fi
+
+ AC_SUBST(SHARE_LIBTIFF)
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch
new file mode 100644
index 000000000..f2c6d04e0
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.21-prevent_recompiling.patch
@@ -0,0 +1,96 @@
+Just use commands provided by ghostscript-native, preventing recompile them when
+compile ghostscript.
+Way to enable cross compile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+Rebase to 9.19
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Rebase to 9.21
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/base/unix-aux.mak
++++ b/base/unix-aux.mak
+@@ -66,45 +66,45 @@ $(GLOBJ)gp_sysv.$(OBJ): $(GLSRC)gp_sysv.
+
+ # -------------------------- Auxiliary programs --------------------------- #
+
+-$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
+-
++#$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
++#
+ # On the RS/6000 (at least), compiling genarch.c with gcc with -O
+ # produces a buggy executable.
+-$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
+-
+-$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
+-
+-$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
+-
+-$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
+-
++#$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
++#
++#$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
++#
++#$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
++#
++#$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
++#
+ # To get GS to use the system zlib, you remove/hide the gs/zlib directory
+ # which means that the mkromfs build can't find the zlib source it needs.
+ # So it's split into two targets, one using the zlib source directly.....
+-MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
+-
+-$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
+-
++#MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
++#
++#$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
++#
+ # .... and one using the zlib library linked via the command line
+-MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
+- $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
+-
+-$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
+-
+-$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS)
+- $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
+-
++#MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
++# $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
++#
++#$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPTAUX) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
++#
++#$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(UNIX_AUX_MAK) $(MAKEDIRS)
++# $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
++#
+ # Query the environment to construct gconfig_.h.
+ # These are all defined conditionally (except the JasPER one), so that
+ # they can be overridden by settings from the configure script.
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
new file mode 100644
index 000000000..5817b7a6d
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
@@ -0,0 +1,41 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/i686 b/poky/meta/recipes-extended/ghostscript/ghostscript/i686
new file mode 120000
index 000000000..87aaca590
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/i686
@@ -0,0 +1 @@
+i586 \ No newline at end of file
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
new file mode 100644
index 000000000..63232fdfa
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32eb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn32el/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64eb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarchn64el/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h
new file mode 100644
index 000000000..b8b637cca
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32eb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h
new file mode 100644
index 000000000..29f90ddf8
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mipsarcho32el/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch
new file mode 100644
index 000000000..5a7eab1c2
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/mkdir-p.patch
@@ -0,0 +1,36 @@
+ghostscript: allow directories to be created more than once
+
+When doing parallel builds, we might try to create directories
+more than once. This should not cause an error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/base/unix-end.mak
++++ b/base/unix-end.mak
+@@ -17,15 +17,14 @@
+ UNIX_END_MAK=$(GLSRC)unix-end.mak $(TOP_MAKEFILES)
+ # Define the rule for building standard configurations.
+ directories: $(UNIX_END_MAK)
+- @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir $(BINDIR); fi
+- @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir $(GLGENDIR); fi
+- @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir $(GLOBJDIR); fi
+- @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir $(DEVGENDIR); fi
+- @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir $(DEVOBJDIR); fi
+- @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir $(AUXDIR); fi
+- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR); then mkdir $(PSGENDIR); fi
+- @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir $(PSGENDIR)/cups; fi
+- @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir $(PSOBJDIR); fi
++ @if test "$(BINDIR)" != "" -a ! -d $(BINDIR); then mkdir -p $(BINDIR); fi
++ @if test "$(GLGENDIR)" != "" -a ! -d $(GLGENDIR); then mkdir -p $(GLGENDIR); fi
++ @if test "$(GLOBJDIR)" != "" -a ! -d $(GLOBJDIR); then mkdir -p $(GLOBJDIR); fi
++ @if test "$(DEVGENDIR)" != "" -a ! -d $(DEVGENDIR); then mkdir -p $(DEVGENDIR); fi
++ @if test "$(DEVOBJDIR)" != "" -a ! -d $(DEVOBJDIR); then mkdir -p $(DEVOBJDIR); fi
++ @if test "$(AUXDIR)" != "" -a ! -d $(AUXDIR); then mkdir -p $(AUXDIR); fi
++ @if test "$(PSGENDIR)" != "" -a ! -d $(PSGENDIR)/cups; then mkdir -p $(PSGENDIR)/cups; fi
++ @if test "$(PSOBJDIR)" != "" -a ! -d $(PSOBJDIR); then mkdir -p $(PSOBJDIR); fi
+
+
+ gs: .gssubtarget $(UNIX_END_MAK)
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h b/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb b/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb
new file mode 100644
index 000000000..50ec7e20c
--- /dev/null
+++ b/poky/meta/recipes-extended/ghostscript/ghostscript_9.21.bb
@@ -0,0 +1,136 @@
+SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
+DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
+a back-end to a program such as ghostview, it can display PostScript and PDF \
+documents in an X11 environment. \
+\
+Furthermore, it can render PostScript and PDF files as graphics to be printed \
+on non-PostScript printers. Supported printers include common \
+dot-matrix, inkjet and laser models. \
+"
+HOMEPAGE = "http://www.ghostscript.com"
+SECTION = "console/utils"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=70dc2bac4d0ce4448da873cd86b123fc"
+
+DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
+DEPENDS_class-native = "libpng-native"
+
+UPSTREAM_CHECK_URI = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs921/${BPN}-${PV}.tar.gz \
+ file://ghostscript-9.15-parallel-make.patch \
+ file://ghostscript-9.16-Werror-return-type.patch \
+ file://do-not-check-local-libpng-source.patch \
+ file://avoid-host-contamination.patch \
+ file://mkdir-p.patch \
+"
+
+SRC_URI = "${SRC_URI_BASE} \
+ file://ghostscript-9.21-prevent_recompiling.patch \
+ file://ghostscript-9.02-genarch.patch \
+ file://objarch.h \
+ file://cups-no-gcrypt.patch \
+ file://CVE-2017-7207.patch \
+ file://CVE-2017-5951.patch \
+ file://CVE-2017-7975.patch \
+ file://CVE-2017-9216.patch \
+ file://CVE-2017-9611.patch \
+ file://CVE-2017-9612.patch \
+ file://CVE-2017-9739.patch \
+ file://CVE-2017-9726.patch \
+ file://CVE-2017-9727.patch \
+ file://CVE-2017-9835.patch \
+ file://CVE-2017-11714.patch \
+ "
+
+SRC_URI_class-native = "${SRC_URI_BASE} \
+ file://ghostscript-9.21-native-fix-disable-system-libtiff.patch \
+ file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
+ "
+
+SRC_URI[md5sum] = "5f213281761d2750fcf27476c404d17f"
+SRC_URI[sha256sum] = "02bceadbc4dddeb6f2eec9c8b1623d945d355ca11b8b4df035332b217d58ce85"
+
+# Put something like
+#
+# PACKAGECONFIG_append_pn-ghostscript = " x11"
+#
+# in local.conf to enable building with X11. Be careful. The order
+# of the overrides matters!
+#
+#PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-native = ""
+
+PACKAGECONFIG[x11] = "--with-x --x-includes=${STAGING_INCDIR} --x-libraries=${STAGING_LIBDIR}, \
+ --without-x, virtual/libx11 libxext libxt gtk+3\
+ "
+
+EXTRA_OECONF = "--with-system-libtiff --without-jbig2dec \
+ --with-fontpath=${datadir}/fonts \
+ --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
+ --with-cups-datadir=${datadir}/cups \
+ CUPSCONFIG="${STAGING_BINDIR_CROSS}/cups-config" \
+ "
+
+EXTRA_OECONF_append_mipsarcho32 = " --with-large_color_index=0"
+
+# Explicity disable libtiff, fontconfig,
+# freetype, cups for ghostscript-native
+EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
+ --without-jbig2dec \
+ --with-fontpath=${datadir}/fonts \
+ --without-libidn --disable-fontconfig \
+ --disable-freetype --disable-cups"
+
+# This has been fixed upstream but for now we need to subvert the check for time.h
+# http://bugs.ghostscript.com/show_bug.cgi?id=692443
+# http://bugs.ghostscript.com/show_bug.cgi?id=692426
+CFLAGS += "-DHAVE_SYS_TIME_H=1"
+BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
+
+inherit autotools
+
+do_configure_prepend () {
+ mkdir -p obj
+ mkdir -p soobj
+ if [ -e ${WORKDIR}/objarch.h ]; then
+ cp ${WORKDIR}/objarch.h obj/arch.h
+ fi
+}
+
+do_configure_append () {
+ # copy tools from the native ghostscript build
+ if [ "${PN}" != "ghostscript-native" ]; then
+ mkdir -p obj/aux soobj
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
+ done
+ fi
+}
+
+do_install_append () {
+ mkdir -p ${D}${datadir}/ghostscript/${PV}/
+ cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
+ cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
+}
+
+do_compile_class-native () {
+ mkdir -p obj
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ oe_runmake obj/aux/$i
+ done
+}
+
+do_install_class-native () {
+ install -d ${D}${bindir}/ghostscript-${PV}
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
+ done
+}
+
+BBCLASSEXTEND = "native"
+
+# ghostscript does not supports "arc"
+COMPATIBLE_HOST = "^(?!arc).*"
diff --git a/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb b/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
new file mode 100644
index 000000000..ab70ea98a
--- /dev/null
+++ b/poky/meta/recipes-extended/go-examples/go-helloworld_0.1.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program."
+SECTION = "examples"
+HOMEPAGE = "https://golang.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+SRC_URI = "git://${GO_IMPORT}"
+SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe"
+UPSTREAM_CHECK_COMMITS = "1"
+
+GO_IMPORT = "github.com/golang/example"
+GO_INSTALL = "${GO_IMPORT}/hello"
+
+inherit go
+
+# This is just to make clear where this example is
+do_install_append() {
+ mv ${D}${bindir}/hello ${D}${bindir}/${BPN}
+}
diff --git a/poky/meta/recipes-extended/gperf/gperf_3.1.bb b/poky/meta/recipes-extended/gperf/gperf_3.1.bb
new file mode 100644
index 000000000..f61b2a329
--- /dev/null
+++ b/poky/meta/recipes-extended/gperf/gperf_3.1.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "GNU gperf is a perfect hash function generator"
+HOMEPAGE = "http://www.gnu.org/software/gperf"
+SUMMARY = "Generate a perfect hash function from a set of keywords"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
+SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
+SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"
+
+inherit autotools
+
+# The nested configures don't find the parent aclocal.m4 out of the box, so tell
+# it where to look explicitly (mirroring the behaviour of upstream's Makefile.devel).
+EXTRA_AUTORECONF += " -I ${S} --exclude=aclocal"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/grep/grep_3.1.bb b/poky/meta/recipes-extended/grep/grep_3.1.bb
new file mode 100644
index 000000000..71810dc65
--- /dev/null
+++ b/poky/meta/recipes-extended/grep/grep_3.1.bb
@@ -0,0 +1,47 @@
+SUMMARY = "GNU grep utility"
+HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
+SECTION = "console/utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+SRC_URI[md5sum] = "feca7b3e7c7f4aab2b42ecbfc513b070"
+SRC_URI[sha256sum] = "db625c7ab3bb3ee757b3926a5cfa8d9e1c3991ad24707a83dde8a5ef2bf7a07e"
+
+inherit autotools gettext texinfo pkgconfig
+
+# Fix "Argument list too long" error when len(TMPDIR) = 410
+acpaths = "-I ./m4"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/init.m4
+}
+
+do_install () {
+ autotools_do_install
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+ rmdir ${D}${bindir}/
+ fi
+}
+
+inherit update-alternatives
+
+PACKAGECONFIG ??= "pcre"
+PACKAGECONFIG[pcre] = "--enable-perl-regexp,--disable-perl-regexp,libpcre"
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..b61b43281
--- /dev/null
+++ b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+===================================================================
+--- groff-1.22.3.orig/src/libs/gnulib/lib/Makefile.am
++++ groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+@@ -113,7 +113,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch
new file mode 100644
index 000000000..f1db5b065
--- /dev/null
+++ b/poky/meta/recipes-extended/groff/groff-1.22.3/0001-replace-perl-w-with-use-warnings.patch
@@ -0,0 +1,102 @@
+From 5b574542070db286c89b3827e8f15ed4b3b39034 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 6 Apr 2017 01:46:00 -0700
+Subject: [PATCH] replace "perl -w" with "use warnings"
+
+The shebang's max length is usually 128 as defined in
+/usr/include/linux/binfmts.h:
+ #define BINPRM_BUF_SIZE 128
+
+There would be errors when @PERL@ is longer than 128, use
+'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
+doesn't work:
+
+/usr/bin/env: perl -w: No such file or directory
+
+So replace "perl -w" with "use warnings" to make it work.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ font/devpdf/util/BuildFoundries.pl | 3 ++-
+ src/devices/gropdf/gropdf.pl | 3 ++-
+ src/devices/gropdf/pdfmom.pl | 3 ++-
+ src/utils/afmtodit/afmtodit.pl | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl
+index 39f2f0d..a2bfd8e 100644
+--- a/font/devpdf/util/BuildFoundries.pl
++++ b/font/devpdf/util/BuildFoundries.pl
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl -w
++#!/usr/bin/perl
+ #
+ # BuildFoundries : Given a Foundry file generate groff and download files
+ # Deri James : Monday 07 Feb 2011
+@@ -22,6 +22,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ use strict;
++use warnings;
+
+ my $where=shift||'';
+ my $devps=shift||'../devps';
+diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
+index 035d123..b933b32 100644
+--- a/src/devices/gropdf/gropdf.pl
++++ b/src/devices/gropdf/gropdf.pl
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ #
+ # gropdf : PDF post processor for groff
+ #
+@@ -21,6 +21,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ use strict;
++use warnings;
+ use Getopt::Long qw(:config bundling);
+ use Compress::Zlib;
+
+diff --git a/src/devices/gropdf/pdfmom.pl b/src/devices/gropdf/pdfmom.pl
+index beec820..4b46ea4 100644
+--- a/src/devices/gropdf/pdfmom.pl
++++ b/src/devices/gropdf/pdfmom.pl
+@@ -1,4 +1,4 @@
+-#!@PERL@ -w
++#!@PERL@
+ #
+ # pdfmom : Frontend to run groff -mom to produce PDFs
+ # Deri James : Friday 16 Mar 2012
+@@ -24,6 +24,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ use strict;
++use warnings;
+ use File::Temp qw/tempfile/;
+ my @cmd;
+ my $dev='pdf';
+diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
+index 4f2ce83..5c078ff 100644
+--- a/src/utils/afmtodit/afmtodit.pl
++++ b/src/utils/afmtodit/afmtodit.pl
+@@ -1,4 +1,4 @@
+-#! /usr/bin/perl -w
++#! /usr/bin/perl
+ # -*- Perl -*-
+ # Copyright (C) 1989-2014 Free Software Foundation, Inc.
+ # Written by James Clark (jjc@jclark.com)
+@@ -19,6 +19,7 @@
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ use strict;
++use warnings;
+
+ @afmtodit.tables@
+
+--
+2.10.2
+
diff --git a/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch b/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
new file mode 100644
index 000000000..c73328a18
--- /dev/null
+++ b/poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
@@ -0,0 +1,34 @@
+Correct the install path of man.local to fix following error:
+ /yocto/build/tmp/sysroots/x86_64-linux/usr/share/groff/1.22.2/tmac/an-old.tmac:690: warning: can't find macro file `man.local'
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+Upstream-Status: Pending
+
+diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub
+index 1506232..f1468c5 100644
+--- a/tmac/Makefile.sub
++++ b/tmac/Makefile.sub
+@@ -121,9 +121,9 @@ install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
+ $(RM) $(DESTDIR)$(mdocdir)/$$f; \
+ $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \
+ done
+- -test -f $(DESTDIR)$(localtmacdir)/man.local \
++ -test -f $(DESTDIR)$(tmacdir)/man.local \
+ || $(INSTALL_DATA) $(srcdir)/man.local \
+- $(DESTDIR)$(localtmacdir)/man.local
++ $(DESTDIR)$(tmacdir)/man.local
+ -test -f $(DESTDIR)$(localtmacdir)/mdoc.local \
+ || $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local
+
+@@ -164,9 +164,9 @@ uninstall_sub:
+ $(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
+ $(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
+ $(RM) $(DESTDIR)$(tmacdir)/www.tmac
+- -if cmp -s $(DESTDIR)$(localtmacdir)/man.local \
++ -if cmp -s $(DESTDIR)$(tmacdir)/man.local \
+ $(srcdir)/man.local; then \
+- $(RM) $(DESTDIR)$(localtmacdir)/man.local; \
++ $(RM) $(DESTDIR)$(tmacdir)/man.local; \
+ fi
+ -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
+ $(srcdir)/mdoc.local; then \
diff --git a/poky/meta/recipes-extended/groff/groff_1.22.3.bb b/poky/meta/recipes-extended/groff/groff_1.22.3.bb
new file mode 100644
index 000000000..7472f5982
--- /dev/null
+++ b/poky/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -0,0 +1,84 @@
+SUMMARY = "GNU Troff software"
+DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
+formatting commands and produces formatted output."
+SECTION = "base"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
+ file://groff-1.22.2-correct-man.local-install-path.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-replace-perl-w-with-use-warnings.patch \
+"
+
+SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
+SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5"
+
+DEPENDS = "groff-native"
+DEPENDS_class-native = ""
+RDEPENDS_${PN} += "perl sed"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+PARALLEL_MAKE = ""
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
+do_configure_prepend() {
+ if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+ sed -i \
+ -e '/^GROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/groff:' \
+ -e '/^TROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/troff:' \
+ -e '/^GROFF_BIN_PATH=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+ -e '/^GROFF_BIN_DIR=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+ ${S}/contrib/*/Makefile.sub \
+ ${S}/doc/Makefile.in \
+ ${S}/doc/Makefile.sub
+ fi
+}
+
+do_configure_append() {
+ # generate gnulib configure script
+ olddir=`pwd`
+ cd ${S}/src/libs/gnulib/
+ ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
+ cd ${olddir}
+}
+
+do_install_append() {
+ # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+ # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+ for i in afmtodit mmroff gropdf pdfmom grog; do
+ if [ -f ${D}${bindir}/$i ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+ fi
+ done
+ if [ -e ${D}${libdir}/charset.alias ]; then
+ rm -rf ${D}${libdir}/charset.alias
+ fi
+
+ # awk is located at /usr/bin/, not /bin/
+ SPECIAL_AWK=`find ${D} -name special.awk`
+ if [ -f ${SPECIAL_AWK} ]; then
+ sed -i -e 's:#!.*awk:#! ${USRBINPATH}/awk:' ${SPECIAL_AWK}
+ fi
+
+ # not ship /usr/bin/glilypond and its releated files in embedded target system
+ rm -rf ${D}${bindir}/glilypond
+ rm -rf ${D}${libdir}/groff/glilypond
+ rm -rf ${D}${mandir}/man1/glilypond*
+}
+
+do_install_append_class-native() {
+ create_cmdline_wrapper ${D}/${bindir}/groff \
+ -F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
+ -M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
+}
+
+FILES_${PN} += "${libdir}/${BPN}/site-tmac \
+ ${libdir}/${BPN}/groffer/"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/gzip/files/run-ptest b/poky/meta/recipes-extended/gzip/files/run-ptest
new file mode 100644
index 000000000..cf7c64949
--- /dev/null
+++ b/poky/meta/recipes-extended/gzip/files/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd src/tests
+
+make check
+
diff --git a/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch b/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch
new file mode 100644
index 000000000..7c37bc8d2
--- /dev/null
+++ b/poky/meta/recipes-extended/gzip/gzip-1.9/wrong-path-fix.patch
@@ -0,0 +1,36 @@
+fix MakeMaker issues with using wrong SHELL/GREP
+
+A set of substitution is being processed to all target scripts with sed by
+replacing some key words with the detected values at configure time, this
+is exactly not compliant with cross compling, and will cause missing path
+errors at run time like:
+"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"
+
+Fixed by removing unneeded substitution and using real runtime paths
+instead.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+Upstream-Status: Pending
+
+---
+ Makefile.am | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index d4ecc3f..e4657d2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -82,8 +82,7 @@ SUFFIXES = .in
+ .in:
+ $(AM_V_GEN)rm -f $@-t $@ \
+ && sed \
+- -e 's|/bin/sh|$(SHELL)|g' \
+- -e 's|[@]GREP@|$(GREP)|g' \
++ -e 's|[@]GREP@|$(base_bindir)/grep|g' \
+ -e 's|[@]VERSION@|$(VERSION)|g' \
+ $(srcdir)/$@.in >$@-t \
+ && chmod a=rx $@-t \
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/gzip/gzip.inc b/poky/meta/recipes-extended/gzip/gzip.inc
new file mode 100644
index 000000000..04f8f95dd
--- /dev/null
+++ b/poky/meta/recipes-extended/gzip/gzip.inc
@@ -0,0 +1,33 @@
+SUMMARY = "Standard GNU compressor"
+DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \
+project. Mark Adler wrote the decompression part"
+HOMEPAGE = "http://www.gnu.org/software/gzip/"
+SECTION = "console/utils"
+# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12
+
+inherit autotools texinfo
+export DEFS="NO_ASM"
+
+EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep"
+EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes "
+
+do_install_append () {
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ # Rename and move files into /bin (FHS), which is typical place for gzip
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
+ mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
+ mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
+ mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress
+ fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/poky/meta/recipes-extended/gzip/gzip_1.9.bb b/poky/meta/recipes-extended/gzip/gzip_1.9.bb
new file mode 100644
index 000000000..a8eeba138
--- /dev/null
+++ b/poky/meta/recipes-extended/gzip/gzip_1.9.bb
@@ -0,0 +1,38 @@
+require gzip.inc
+
+LICENSE = "GPLv3+"
+
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz \
+ file://run-ptest"
+SRC_URI_append_class-target = " file://wrong-path-fix.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
+
+PROVIDES_append_class-native = " gzip-replacement-native"
+
+BBCLASSEXTEND = "native"
+
+inherit ptest
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/src/build-aux
+ cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/src/build-aux/
+ mkdir -p ${D}${PTEST_PATH}/src/tests
+ cp -r ${S}/tests/* ${D}${PTEST_PATH}/src/tests
+ sed -e 's/^abs_srcdir = ..*/abs_srcdir = \.\./' \
+ -e 's/^top_srcdir = ..*/top_srcdir = \.\./' \
+ -e 's/^GREP = ..*/GREP = grep/' \
+ -e 's/^AWK = ..*/AWK = awk/' \
+ -e 's/^srcdir = ..*/srcdir = \./' \
+ -e 's/^Makefile: ..*/Makefile: /' \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${B}/tests/Makefile > ${D}${PTEST_PATH}/src/tests/Makefile
+}
+
+SRC_URI[md5sum] = "929d6a6b832f75b28e3eeeafb30c1d9b"
+SRC_URI[sha256sum] = "5d2d3a3432ef32f24cdb060d278834507b481a75adeca18850c73592f778f6ad"
+
diff --git a/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch b/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch
new file mode 100644
index 000000000..4af1b617e
--- /dev/null
+++ b/poky/meta/recipes-extended/hdparm/hdparm/wiper.sh-fix-stat-path.patch
@@ -0,0 +1,38 @@
+From e233006ee212109d2a1401dac37a9a851cc493d8 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Thu, 14 Dec 2017 15:23:47 +0800
+Subject: [PATCH] wiper.sh: fix stat path
+
+Fix the stat path for OE.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ wiper/wiper.sh | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/wiper/wiper.sh b/wiper/wiper.sh
+index 79eddc8..9ef2840 100755
+--- a/wiper/wiper.sh
++++ b/wiper/wiper.sh
+@@ -97,7 +97,6 @@ function find_prog(){
+ hash -r ## Refresh bash's cached PATH entries
+ HDPARM=`find_prog /sbin/hdparm` || exit 1
+ FIND=`find_prog /usr/bin/find` || exit 1
+-STAT=`find_prog /usr/bin/stat` || exit 1
+ GAWK=`find_prog /usr/bin/gawk` || exit 1
+ BLKID=`find_prog /sbin/blkid` || exit 1
+ GREP=`find_prog /bin/grep` || exit 1
+@@ -105,7 +104,7 @@ ID=`find_prog /usr/bin/id` || exit 1
+ LS=`find_prog /bin/ls` || exit 1
+ DF=`find_prog /bin/df` || exit 1
+ RM=`find_prog /bin/rm` || exit 1
+-STAT=`find_prog /usr/bin/stat` || exit 1
++STAT=`find_prog /bin/stat` || exit 1
+
+ [ $verbose -gt 1 ] && HDPARM="$HDPARM --verbose"
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb b/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb
new file mode 100644
index 000000000..4c3ec5c48
--- /dev/null
+++ b/poky/meta/recipes-extended/hdparm/hdparm_9.53.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
+HOMEPAGE = "http://sourceforge.net/projects/hdparm/"
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+
+LICENSE = "BSD & GPLv2"
+LICENSE_${PN} = "BSD"
+LICENSE_${PN}-dbg = "BSD"
+LICENSE_wiper = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=495d03e50dc6c89d6a30107ab0df5b03 \
+ file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
+ file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
+ file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
+
+
+PACKAGES =+ "wiper"
+
+FILES_wiper = "${bindir}/wiper.sh"
+
+RDEPENDS_wiper = "bash gawk coreutils"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz \
+ file://wiper.sh-fix-stat-path.patch \
+ "
+
+SRC_URI[md5sum] = "1e54b52e0c8cb79389d4d47eacba411d"
+SRC_URI[sha256sum] = "2673f591df6916c6a1faec07069a7eb1cb8ee307615a615d808192fb0c0265e5"
+
+EXTRA_OEMAKE = 'STRIP="echo" LDFLAGS="${LDFLAGS}"'
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "hdparm"
+ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install () {
+ install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
+ oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
+ cp ${S}/wiper/wiper.sh ${D}/${bindir}
+}
diff --git a/poky/meta/recipes-extended/images/core-image-full-cmdline.bb b/poky/meta/recipes-extended/images/core-image-full-cmdline.bb
new file mode 100644
index 000000000..4d69073d9
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-full-cmdline.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "A console-only image with more full-featured Linux system \
+functionality installed."
+
+IMAGE_FEATURES += "splash ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+ packagegroup-core-boot \
+ packagegroup-core-full-cmdline \
+ ${CORE_IMAGE_EXTRA_INSTALL} \
+ "
+
+inherit core-image
diff --git a/poky/meta/recipes-extended/images/core-image-kernel-dev.bb b/poky/meta/recipes-extended/images/core-image-kernel-dev.bb
new file mode 100644
index 000000000..a40b3aa95
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-kernel-dev.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "A development image that builds the kernel and packages that are \
+sensitive to kernel updates and version changes"
+
+# Could also be core-image-basic, but we'll keep this small for now
+require recipes-core/images/core-image-minimal.bb
+
+KERNEL_DEV_UTILS ?= "dropbear connman"
+KERNEL_DEV_TOOLS ?= "packagegroup-core-tools-profile packagegroup-core-buildessential kernel-devsrc"
+KERNEL_DEV_MODULE ?= "kernel-modules"
+
+CORE_IMAGE_EXTRA_INSTALL += "${KERNEL_DEV_MODULE} \
+ ${KERNEL_DEV_UTILS} \
+ ${KERNEL_DEV_TOOLS} \
+ "
+
+# We need extra space for things like kernel builds, etc.
+IMAGE_ROOTFS_EXTRA_SPACE_append = " + 3000000"
+
+# Let's define our own subset to test, we can later add a on-target kernel build even!
+DEFAULT_TEST_SUITES = "ping ssh df connman syslog scp date parselogs"
diff --git a/poky/meta/recipes-extended/images/core-image-lsb-dev.bb b/poky/meta/recipes-extended/images/core-image-lsb-dev.bb
new file mode 100644
index 000000000..d2dc9e2b5
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-lsb-dev.bb
@@ -0,0 +1,7 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for development work. It \
+can be used for customization and implementations that conform to Linux \
+Standard Base (LSB)."
+
+IMAGE_FEATURES += "dev-pkgs"
diff --git a/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb b/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
new file mode 100644
index 000000000..a3d602edd
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
@@ -0,0 +1,12 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for Linux Standard Base \
+(LSB) implementations. It includes the full meta-toolchain, plus development \
+headers and libraries to form a standalone SDK."
+
+IMAGE_FEATURES += "tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
+
+IMAGE_INSTALL += "kernel-devsrc"
+
+# Reduce this to try and keep below the 4GB image size for now
+IMAGE_OVERHEAD_FACTOR = "1.2"
diff --git a/poky/meta/recipes-extended/images/core-image-lsb.bb b/poky/meta/recipes-extended/images/core-image-lsb.bb
new file mode 100644
index 000000000..ab61c6e6d
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-lsb.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "An image containing packages that are required to conform \
+to the Linux Standard Base (LSB) specification."
+
+IMAGE_FEATURES += "splash ssh-server-openssh hwcodecs package-management"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ packagegroup-core-full-cmdline \
+ packagegroup-core-lsb \
+ "
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "pam"
diff --git a/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
new file mode 100644
index 000000000..09a6d1604
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Small image capable of booting a device with custom install scripts, \
+adding a second rootfs, used for testing."
+
+# use -testfs live-install scripts
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-testmaster-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+BAD_RECOMMENDATIONS += "busybox-syslog"
+
+# Use the same restriction as initramfs-live-install-testfs
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/poky/meta/recipes-extended/images/core-image-testmaster.bb b/poky/meta/recipes-extended/images/core-image-testmaster.bb
new file mode 100644
index 000000000..78295c5f0
--- /dev/null
+++ b/poky/meta/recipes-extended/images/core-image-testmaster.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "A master image to be deployed on a target useful for testing other images"
+
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+
+inherit core-image
+
+# the deploy code requires bash and
+# normal linux utilities not busybox ones
+IMAGE_INSTALL += "\
+ bash coreutils util-linux tar gzip bzip2 kmod \
+ python-modules python-misc \
+ e2fsprogs e2fsprogs-mke2fs parted \
+ "
+# we need a particular initramfs for live images
+# that pulls custom install scripts which take
+# care of partitioning for us
+INITRD_IMAGE = "core-image-testmaster-initramfs"
+
diff --git a/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
new file mode 100644
index 000000000..03c36ccbc
--- /dev/null
+++ b/poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
@@ -0,0 +1,47 @@
+From c46db7c2e1f63ec525835553587e70c635565310 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 21 Feb 2017 11:16:31 +0200
+Subject: [PATCH] configure: Add option to enable/disable libnfnetlink
+
+This changes the configure behaviour from autodetecting
+for libnfnetlink to having an option to disable it explicitly
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure.ac | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index eda7871..03ddc50 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -63,6 +63,9 @@ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
+ AC_ARG_ENABLE([nftables],
+ AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
+ [enable_nftables="$enableval"], [enable_nftables="yes"])
++AC_ARG_ENABLE([libnfnetlink],
++ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
++ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
+ AC_ARG_ENABLE([connlabel],
+ AS_HELP_STRING([--disable-connlabel],
+ [Do not build libnetfilter_conntrack]),
+@@ -115,9 +118,10 @@ if test "x$enable_bpfc" = "xyes" || test "x$enable_nfsynproxy" = "xyes"; then
+ AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool))
+ fi
+
+-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
+- [nfnetlink=1], [nfnetlink=0])
+-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
++ ])
++AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
+
+ if test "x$enable_nftables" = "xyes"; then
+ PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
new file mode 100644
index 000000000..7842c6408
--- /dev/null
+++ b/poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
@@ -0,0 +1,51 @@
+From 26090b3dbcdf6a11e60535da949b726a6e86426d Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 21 Feb 2017 11:49:07 +0200
+Subject: [PATCH] configure.ac:
+ only-check-conntrack-when-libnfnetlink-enabled.patch
+
+Package libnetfilter-conntrack depends on package libnfnetlink. iptables
+checks package libnetfilter-conntrack whatever its package config
+libnfnetlink is enabled or not. When libnfnetlink is disabled but
+package libnetfilter-conntrack exists, it fails randomly with:
+
+In file included from
+.../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0:
+
+.../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42:
+fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
+
+compilation terminated.
+GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed
+Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 03ddc50..523caea 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -172,10 +172,12 @@ if test "$nftables" != 1; then
+ fi
+
+ if test "x$enable_connlabel" = "xyes"; then
+- PKG_CHECK_MODULES([libnetfilter_conntrack],
++ nfconntrack=0
++ AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++ PKG_CHECK_MODULES([libnetfilter_conntrack],
+ [libnetfilter_conntrack >= 1.0.6],
+ [nfconntrack=1], [nfconntrack=0])
+-
++ ])
+ if test "$nfconntrack" -ne 1; then
+ blacklist_modules="$blacklist_modules connlabel";
+ echo "WARNING: libnetfilter_conntrack not found, connlabel match will not be built";
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb b/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb
new file mode 100644
index 000000000..38a83d2b3
--- /dev/null
+++ b/poky/meta/recipes-extended/iptables/iptables_1.6.2.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Tools for managing kernel packet filtering capabilities"
+DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \
+filtering code in Linux."
+HOMEPAGE = "http://www.netfilter.org/"
+BUGTRACKER = "http://bugzilla.netfilter.org/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
+
+RRECOMMENDS_${PN} = "kernel-module-x-tables \
+ kernel-module-ip-tables \
+ kernel-module-iptable-filter \
+ kernel-module-iptable-nat \
+ kernel-module-nf-defrag-ipv4 \
+ kernel-module-nf-conntrack \
+ kernel-module-nf-conntrack-ipv4 \
+ kernel-module-nf-nat \
+ kernel-module-ipt-masquerade"
+FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables"
+
+SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
+ file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
+ file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
+"
+
+SRC_URI[md5sum] = "7d2b7847e4aa8832a18437b8a4c1873d"
+SRC_URI[sha256sum] = "55d02dfa46263343a401f297d44190f2a3e5113c8933946f094ed40237053733"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
+ "
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# libnfnetlink recipe is in meta-networking layer
+PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack"
+
+# libnftnl recipe is in meta-networking layer(previously known as libnftables)
+PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
+
+do_configure_prepend() {
+ # Remove some libtool m4 files
+ # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
+ rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+}
diff --git a/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch b/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch
new file mode 100644
index 000000000..ce8cfebbb
--- /dev/null
+++ b/poky/meta/recipes-extended/iputils/files/0001-Fix-build-on-MUSL.patch
@@ -0,0 +1,95 @@
+From c6c5966d9fae27bc2f0a34ab59b999555111bd2d Mon Sep 17 00:00:00 2001
+From: Aric Belsito <lluixhi@gmail.com>
+Date: Sun, 29 Oct 2017 23:17:03 +0100
+Subject: [PATCH] Fix build on MUSL
+
+Add missing AI_IDN and NI_IDN declarations.
+
+Bug: https://bugs.gentoo.org/503914
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ arping.c | 7 +++++++
+ ping.h | 11 +++++++++++
+ tracepath.c | 8 ++++++++
+ traceroute6.c | 4 ++++
+ 4 files changed, 30 insertions(+)
+
+diff --git a/arping.c b/arping.c
+index 1a3f40b..531d29d 100644
+--- a/arping.c
++++ b/arping.c
+@@ -45,6 +45,13 @@ struct sysfs_devattr_values;
+ #ifdef USE_IDN
+ #include <idna.h>
+ #include <locale.h>
++
++#ifndef AI_IDN
++#define AI_IDN 0x0040
++#endif
++#ifndef AI_CANONIDN
++#define AI_CANONIDN 0x0080
++#endif
+ #endif
+
+ #include "SNAPSHOT.h"
+diff --git a/ping.h b/ping.h
+index 749f3ff..227315f 100644
+--- a/ping.h
++++ b/ping.h
+@@ -38,6 +38,17 @@
+ #include <locale.h>
+ #include <idna.h>
+ #include <stringprep.h>
++
++#ifndef AI_IDN
++#define AI_IDN 0x0040
++#endif
++#ifndef AI_CANONIDN
++#define AI_CANONIDN 0x0080
++#endif
++#ifndef NI_IDN
++#define NI_IDN 32
++#endif
++
+ #define getaddrinfo_flags (AI_CANONNAME | AI_IDN | AI_CANONIDN)
+ #define getnameinfo_flags NI_IDN
+ #else
+diff --git a/tracepath.c b/tracepath.c
+index 74a829d..dcec5b9 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -30,6 +30,14 @@
+ #ifdef USE_IDN
+ #include <idna.h>
+ #include <locale.h>
++
++#ifndef AI_IDN
++#define AI_IDN 0x0040
++#endif
++#ifndef NI_IDN
++#define NI_IDN 32
++#endif
++
+ #define getnameinfo_flags NI_IDN
+ #else
+ #define getnameinfo_flags 0
+diff --git a/traceroute6.c b/traceroute6.c
+index 48fc5c5..8d1eebf 100644
+--- a/traceroute6.c
++++ b/traceroute6.c
+@@ -251,6 +251,10 @@
+ #include <idna.h>
+ #include <locale.h>
+
++#ifndef NI_IDN
++#define NI_IDN 32
++#endif
++
+ #define getnameinfo_flags NI_IDN
+ #else
+ #define getnameinfo_flags 0
+--
+2.15.1
+
diff --git a/poky/meta/recipes-extended/iputils/iputils_s20161105.bb b/poky/meta/recipes-extended/iputils/iputils_s20161105.bb
new file mode 100644
index 000000000..0125739b0
--- /dev/null
+++ b/poky/meta/recipes-extended/iputils/iputils_s20161105.bb
@@ -0,0 +1,62 @@
+SUMMARY = "Network monitoring tools"
+DESCRIPTION = "Utilities for the IP protocol, including traceroute6, \
+tracepath, tracepath6, ping, ping6 and arping."
+HOMEPAGE = "https://github.com/iputils/iputils"
+SECTION = "console/network"
+
+LICENSE = "BSD & GPLv2+"
+
+LIC_FILES_CHKSUM = "file://ping.c;beginline=1;endline=35;md5=f9ceb201733e9a6cf8f00766dd278d82 \
+ file://tracepath.c;beginline=1;endline=10;md5=0ecea2bf60bff2f3d840096d87647f3d \
+ file://arping.c;beginline=1;endline=11;md5=fe84301b5c2655c950f8b92a057fafa6 \
+ file://tftpd.c;beginline=1;endline=32;md5=28834bf8a91a5b8a92755dbee709ef96 "
+
+DEPENDS = "gnutls libcap libgcrypt"
+
+SRC_URI = "git://github.com/iputils/iputils \
+ file://0001-Fix-build-on-MUSL.patch \
+ "
+S = "${WORKDIR}/git"
+SRCREV = "bffc0e957b98d626ab4cea218c89251201425442"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>s\d+)"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[libidn] = "USE_IDN=yes,USE_IDN=no,libidn"
+
+do_compile () {
+ oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" ${PACKAGECONFIG_CONFARGS} all
+}
+
+do_install () {
+ install -m 0755 -d ${D}${base_bindir}
+ # SUID root programs
+ install -m 4555 ping ${D}${base_bindir}/ping
+ install -m 4555 traceroute6 ${D}${base_bindir}/
+ install -m 4555 clockdiff ${D}${base_bindir}/
+ # Other programgs
+ for i in arping tracepath; do
+ install -m 0755 $i ${D}${base_bindir}/
+ done
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-ping = "ping"
+ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
+
+PACKAGES += "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-traceroute6 ${PN}-clockdiff"
+
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN} += "${PN}-ping ${PN}-arping ${PN}-tracepath ${PN}-traceroute6 ${PN}-clockdiff"
+
+FILES_${PN} = ""
+FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
+FILES_${PN}-arping = "${base_bindir}/arping"
+FILES_${PN}-tracepath = "${base_bindir}/tracepath"
+FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6"
+FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
diff --git a/poky/meta/recipes-extended/less/less_529.bb b/poky/meta/recipes-extended/less/less_529.bb
new file mode 100644
index 000000000..c86f75483
--- /dev/null
+++ b/poky/meta/recipes-extended/less/less_529.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Text file viewer similar to more"
+DESCRIPTION = "Less is a program similar to more, i.e. a terminal \
+based program for viewing text files and the output from other \
+programs. Less offers many features beyond those that more does."
+HOMEPAGE = "http://www.greenwoodsoftware.com/"
+SECTION = "console/utils"
+
+# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less
+# Including email author giving permissing to use BSD
+#
+# From: Mark Nudelman <markn@greenwoodsoftware.com>
+# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com
+# Date: 12/19/11
+#
+# Hi Elizabeth,
+# Using a generic BSD license for less is fine with me.
+# Thanks,
+#
+# --Mark
+#
+
+LICENSE = "GPLv3+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://LICENSE;md5=2ef3e4b8dafc85612bc5254b8081e234"
+DEPENDS = "ncurses"
+
+SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+ "
+
+SRC_URI[md5sum] = "32018b53a1f7319ab54349baf80e6aa8"
+SRC_URI[sha256sum] = "dba42cd4c38174b7bd0d426d8a39df2be6bcc1ec18946a4642713290f6bf9a0b"
+
+UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html"
+
+inherit autotools update-alternatives
+
+do_install () {
+ oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
+}
+
+ALTERNATIVE_${PN} = "less"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/poky/meta/recipes-extended/libaio/libaio/00_arches.patch b/poky/meta/recipes-extended/libaio/libaio/00_arches.patch
new file mode 100644
index 000000000..9d6447d98
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/00_arches.patch
@@ -0,0 +1,607 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.110/src/syscall-m68k.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-m68k.h
+@@ -0,0 +1,78 @@
++#define __NR_io_setup 241
++#define __NR_io_destroy 242
++#define __NR_io_getevents 243
++#define __NR_io_submit 244
++#define __NR_io_cancel 245
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a) ); \
++return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a,btype b) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a,btype b,ctype c) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname (atype a, btype b, ctype c, dtype d) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++register long __e __asm__ ("%d5") = (long)(e); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d), "d" (__e) \
++ ); \
++return (type) __res; \
++}
++
+Index: libaio-0.3.110/src/syscall.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall.h
++++ libaio-0.3.110/src/syscall.h
+@@ -28,6 +28,12 @@
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+ #include "syscall-arm64.h"
++#elif defined(__m68k__)
++#include "syscall-m68k.h"
++#elif defined(__hppa__)
++#include "syscall-parisc.h"
++#elif defined(__mips__)
++#include "syscall-mips.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
+Index: libaio-0.3.110/src/syscall-mips.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-mips.h
+@@ -0,0 +1,223 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
++ *
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
++ */
++
++#ifndef _MIPS_SIM_ABI32
++#define _MIPS_SIM_ABI32 1
++#define _MIPS_SIM_NABI32 2
++#define _MIPS_SIM_ABI64 3
++#endif
++
++#if _MIPS_SIM == _MIPS_SIM_ABI32
++
++/*
++ * Linux o32 style syscalls are in the range from 4000 to 4999.
++ */
++#define __NR_Linux 4000
++#define __NR_io_setup (__NR_Linux + 241)
++#define __NR_io_destroy (__NR_Linux + 242)
++#define __NR_io_getevents (__NR_Linux + 243)
++#define __NR_io_submit (__NR_Linux + 244)
++#define __NR_io_cancel (__NR_Linux + 245)
++
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
++
++#if _MIPS_SIM == _MIPS_SIM_ABI64
++
++/*
++ * Linux 64-bit syscalls are in the range from 5000 to 5999.
++ */
++#define __NR_Linux 5000
++#define __NR_io_setup (__NR_Linux + 200)
++#define __NR_io_destroy (__NR_Linux + 201)
++#define __NR_io_getevents (__NR_Linux + 202)
++#define __NR_io_submit (__NR_Linux + 203)
++#define __NR_io_cancel (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
++
++#if _MIPS_SIM == _MIPS_SIM_NABI32
++
++/*
++ * Linux N32 syscalls are in the range from 6000 to 6999.
++ */
++#define __NR_Linux 6000
++#define __NR_io_setup (__NR_Linux + 200)
++#define __NR_io_destroy (__NR_Linux + 201)
++#define __NR_io_getevents (__NR_Linux + 202)
++#define __NR_io_submit (__NR_Linux + 203)
++#define __NR_io_cancel (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %3\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a, btype b) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %4\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a, btype b, ctype c) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname(atype a, btype b, ctype c, dtype d) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
++
++/*
++ * Using those means your brain needs more than an oil change ;-)
++ */
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "lw\t$2, %6\n\t" \
++ "subu\t$29, 32\n\t" \
++ "sw\t$2, 16($29)\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ "addiu\t$29, 32\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
++ "m" ((unsigned long)e) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
++
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ register unsigned long __a4 asm("$8") = (unsigned long) e; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %6\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
++ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
++
+Index: libaio-0.3.110/src/syscall-parisc.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-parisc.h
+@@ -0,0 +1,146 @@
++/*
++ * Linux system call numbers.
++ *
++ * Cary Coutant says that we should just use another syscall gateway
++ * page to avoid clashing with the HPUX space, and I think he's right:
++ * it will would keep a branch out of our syscall entry path, at the
++ * very least. If we decide to change it later, we can ``just'' tweak
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
++ * 1024 or something. Oh, and recompile libc. =)
++ *
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
++ * from the kernel at startup, which seems a sane strategy.
++ */
++
++#define __NR_Linux 0
++#define __NR_io_setup (__NR_Linux + 215)
++#define __NR_io_destroy (__NR_Linux + 216)
++#define __NR_io_getevents (__NR_Linux + 217)
++#define __NR_io_submit (__NR_Linux + 218)
++#define __NR_io_cancel (__NR_Linux + 219)
++
++#define SYS_ify(syscall_name) __NR_##syscall_name
++
++/* Assume all syscalls are done from PIC code just to be
++ * safe. The worst case scenario is that you lose a register
++ * and save/restore r19 across the syscall. */
++#define PIC
++
++/* Definition taken from glibc 2.3.3
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
++ */
++
++#ifdef PIC
++/* WARNING: CANNOT BE USED IN A NOP! */
++# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
++# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
++# define K_USING_GR4 "%r4",
++#else
++# define K_STW_ASM_PIC " \n"
++# define K_LDW_ASM_PIC " \n"
++# define K_USING_GR4
++#endif
++
++/* GCC has to be warned that a syscall may clobber all the ABI
++ registers listed as "caller-saves", see page 8, Table 2
++ in section 2.2.6 of the PA-RISC RUN-TIME architecture
++ document. However! r28 is the result and will conflict with
++ the clobber list so it is left out. Also the input arguments
++ registers r20 -> r26 will conflict with the list so they
++ are treated specially. Although r19 is clobbered by the syscall
++ we cannot say this because it would violate ABI, thus we say
++ r4 is clobbered and use that register to save/restore r19
++ across the syscall. */
++
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
++ "%r20", "%r29", "%r31"
++
++#undef K_INLINE_SYSCALL
++#define K_INLINE_SYSCALL(name, nr, args...) ({ \
++ long __sys_res; \
++ { \
++ register unsigned long __res __asm__("r28"); \
++ K_LOAD_ARGS_##nr(args) \
++ /* FIXME: HACK stw/ldw r19 around syscall */ \
++ __asm__ volatile( \
++ K_STW_ASM_PIC \
++ " ble 0x100(%%sr2, %%r0)\n" \
++ " ldi %1, %%r20\n" \
++ K_LDW_ASM_PIC \
++ : "=r" (__res) \
++ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
++ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
++ ); \
++ __sys_res = (long)__res; \
++ } \
++ __sys_res; \
++})
++
++#define K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_1(r26) \
++ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
++ K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_2(r26,r25) \
++ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
++ K_LOAD_ARGS_1(r26)
++#define K_LOAD_ARGS_3(r26,r25,r24) \
++ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
++ K_LOAD_ARGS_2(r26,r25)
++#define K_LOAD_ARGS_4(r26,r25,r24,r23) \
++ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
++ K_LOAD_ARGS_3(r26,r25,r24)
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \
++ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
++ K_LOAD_ARGS_4(r26,r25,r24,r23)
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
++ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
++ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
++
++/* Even with zero args we use r20 for the syscall number */
++#define K_ASM_ARGS_0
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
++
++/* The registers not listed as inputs but clobbered */
++#define K_CLOB_ARGS_6
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++ return K_INLINE_SYSCALL(sname, 1, arg1); \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1, type2 arg2) \
++{ \
++ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1, type2 arg2, type3 arg3) \
++{ \
++ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \
++}
++
+Index: libaio-0.3.110/src/syscall-arm.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall-arm.h
++++ libaio-0.3.110/src/syscall-arm.h
+@@ -114,3 +114,119 @@ type fname(type1 arg1, type2 arg2, type3
+ return (type) __res_r0; \
+ }
+
++/*
++ * linux/include/asm-arm/unistd.h
++ *
++ * Copyright (C) 2001-2005 Russell King
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
++ * no matter what the change is. Thanks!
++ */
++
++#define __NR_OABI_SYSCALL_BASE 0x900000
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __NR_SYSCALL_BASE 0
++#else
++#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
++#endif
++
++#define __NR_io_setup (__NR_SYSCALL_BASE+243)
++#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
++#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
++#define __NR_io_submit (__NR_SYSCALL_BASE+246)
++#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
++
++#define __sys2(x) #x
++#define __sys1(x) __sys2(x)
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name;
++#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs
++#define __syscall(name) "swi\t0"
++#else
++#define __SYS_REG(name)
++#define __SYS_REG_LIST(regs...) regs
++#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
++#endif
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1,type2 arg2) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1,type2 arg2,type3 arg3) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __r3 __asm__("r3") = (long)arg4; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {\
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __r3 __asm__("r3") = (long)arg4; \
++ register long __r4 __asm__("r4") = (long)arg5; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
++ "r" (__r3), "r" (__r4) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
diff --git a/poky/meta/recipes-extended/libaio/libaio/destdir.patch b/poky/meta/recipes-extended/libaio/libaio/destdir.patch
new file mode 100644
index 000000000..0f90406be
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/destdir.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.110/Makefile
+===================================================================
+--- libaio-0.3.110.orig/Makefile
++++ libaio-0.3.110/Makefile
+@@ -15,7 +15,7 @@ all:
+ @$(MAKE) -C src
+
+ install:
+- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
++ @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
+
+ check:
+ @$(MAKE) -C harness check
diff --git a/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch b/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
new file mode 100644
index 000000000..bba7e554a
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
@@ -0,0 +1,65 @@
+From: Nathan Rossi <nathan.rossi@xilinx.com>
+Date: Tue, 27 Jan 2015 14:59:35 +1000
+Subject: [PATCH] Generic arch dectection for padding defines
+
+When available use the GNU C defines for endian and bitwidth to
+determine the padding required. This reduces the need to define the
+padding selection for every architecture.
+
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
+Upstream-Status: Backport
+---
+ src/libaio.h | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/libaio.h b/src/libaio.h
+index 1223146..4a4e0f5 100644
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -52,14 +52,18 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+ defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
+- defined(__cris__)
++ defined(__cris__) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y) x; unsigned y
+ #define PADDEDptr(x, y) x; unsigned y
+ #define PADDEDul(x, y) unsigned long x; unsigned y
+
+ /* little endian, 64 bits */
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
+- (defined(__aarch64__) && defined(__AARCH64EL__))
++ (defined(__aarch64__) && defined(__AARCH64EL__)) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y) x, y
+ #define PADDEDptr(x, y) x
+ #define PADDEDul(x, y) unsigned long x
+@@ -67,7 +71,9 @@ typedef enum io_iocb_cmd {
+ /* big endian, 64 bits */
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
+ (defined(__sparc__) && defined(__arch64__)) || \
+- (defined(__aarch64__) && defined(__AARCH64EB__))
++ (defined(__aarch64__) && defined(__AARCH64EB__)) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y) unsigned y; x
+ #define PADDEDptr(x,y) x
+ #define PADDEDul(x, y) unsigned long x
+@@ -76,7 +82,9 @@ typedef enum io_iocb_cmd {
+ #elif defined(__PPC__) || defined(__s390__) || \
+ (defined(__arm__) && defined(__ARMEB__)) || \
+ defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
+- defined(__hppa__) || defined(__frv__) || defined(__avr32__)
++ defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y) unsigned y; x
+ #define PADDEDptr(x, y) unsigned y; x
+ #define PADDEDul(x, y) unsigned y; unsigned long x
+--
+2.1.1
+
diff --git a/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
new file mode 100644
index 000000000..9c6850c08
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Phil Staub <Phil.Staub@windriver.com>
+
+Index: libaio-0.3.109/src/syscall-mips.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-mips.h
++++ libaio-0.3.109/src/syscall-mips.h
+@@ -76,7 +76,7 @@ type fname(atype a) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
diff --git a/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 000000000..dc4ba505b
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Properly load arguments 5 an 6 for x86-64 syscall
+Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
+syscall so that it works with both x32 and x86-64.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/12/02
+
+--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800
+@@ -1,8 +1,18 @@
++#ifndef __NR_io_setup
+ #define __NR_io_setup 206
++#endif
++#ifndef __NR_io_destroy
+ #define __NR_io_destroy 207
++#endif
++#ifndef __NR_io_getevents
+ #define __NR_io_getevents 208
++#endif
++#ifndef __NR_io_submit
+ #define __NR_io_submit 209
++#endif
++#ifndef __NR_io_cancel
+ #define __NR_io_cancel 210
++#endif
+
+ #define __syscall_clobber "r11","rcx","memory"
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@ return __res; \
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++ "d" ((long)(arg3)),"r" (__a4)); \
+ return __res; \
+ }
+
+@@ -54,10 +65,11 @@ return __res; \
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++register long __a5 asm ("r8") = (long) arg5; \
++__asm__ volatile ( __syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
+- __syscall_clobber,"r8","r10" ); \
++ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
+ return __res; \
+ }
diff --git a/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch b/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch
new file mode 100644
index 000000000..0b1f47569
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio/system-linkage.patch
@@ -0,0 +1,37 @@
+From 94bba6880b1f10c6b3bf33a17ac40935d65a81ae Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 6 Nov 2015 15:19:46 +0000
+Subject: [PATCH] Don't remove the system libraries and startup files from
+ libaio, as in some build configurations these are required. For example,
+ including conf/include/security_flags.inc on PPC results in:
+
+io_queue_init.os: In function `io_queue_init':
+tmp/work/ppce300c3-poky-linux/libaio/0.3.110-r0/libaio-0.3.110/src/io_queue_init.c:33:
+undefined reference to `__stack_chk_fail_local'
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ src/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index eadb336..56ab701 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -3,10 +3,10 @@ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+
+ CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
++CFLAGS += -Wall -I. -fPIC
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=
++LINK_FLAGS=$(LDFLAGS)
+ LINK_FLAGS+=$(LDFLAGS)
+
+ soname=libaio.so.1
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb b/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
new file mode 100644
index 000000000..75975d4ab
--- /dev/null
+++ b/poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Asynchronous I/O library"
+DESCRIPTION = "Asynchronous input/output library that uses the kernels native interface"
+HOMEPAGE = "http://lse.sourceforge.net/io/aio.html"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20160728T043443Z/pool/main/liba/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://generic-arch-dectection-for-padding-defines.patch \
+ file://00_arches.patch \
+ file://destdir.patch \
+ file://libaio_fix_for_x32.patch \
+ file://libaio_fix_for_mips_syscalls.patch \
+ file://system-linkage.patch \
+ "
+
+SRC_URI[md5sum] = "2a35602e43778383e2f4907a4ca39ab8"
+SRC_URI[sha256sum] = "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/liba/libaio/"
+
+EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}"
+
+do_install () {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch
new file mode 100644
index 000000000..e85fec40a
--- /dev/null
+++ b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14166.patch
@@ -0,0 +1,37 @@
+libarchive-3.3.2: Fix CVE-2017-14166
+
+[No upstream tracking] -- https://github.com/libarchive/libarchive/pull/935
+
+archive_read_support_format_xar: heap-based buffer overflow in xml_data
+
+Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/fa7438a0ff4033e4741c807394a9af6207940d71]
+CVE: CVE-2017-14166
+Bug: 935
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c
+index 7a22beb..93eeacc 100644
+--- a/libarchive/archive_read_support_format_xar.c
++++ b/libarchive/archive_read_support_format_xar.c
+@@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt)
+ uint64_t l;
+ int digit;
+
++ if (char_cnt == 0)
++ return (0);
++
+ l = 0;
+ digit = *p - '0';
+ while (digit >= 0 && digit < 10 && char_cnt-- > 0) {
+@@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt)
+ {
+ int64_t l;
+ int digit;
+-
++
++ if (char_cnt == 0)
++ return (0);
++
+ l = 0;
+ while (char_cnt-- > 0) {
+ if (*p >= '0' && *p <= '7')
diff --git a/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
new file mode 100644
index 000000000..72e154643
--- /dev/null
+++ b/poky/meta/recipes-extended/libarchive/libarchive/CVE-2017-14502.patch
@@ -0,0 +1,37 @@
+From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
+From: Joerg Sonnenberger <joerg@bec.de>
+Date: Sat, 9 Sep 2017 17:47:32 +0200
+Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
+ archives.
+
+Reported-By: OSS-Fuzz issue 573
+
+CVE: CVE-2017-14502
+
+Upstream-Status: Backport
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+---
+ libarchive/archive_read_support_format_rar.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
+index cbb14c3..751de69 100644
+--- a/libarchive/archive_read_support_format_rar.c
++++ b/libarchive/archive_read_support_format_rar.c
+@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
+ return (ARCHIVE_FATAL);
+ }
+ filename[filename_size++] = '\0';
+- filename[filename_size++] = '\0';
++ /*
++ * Do not increment filename_size here as the computations below
++ * add the space for the terminating NUL explicitly.
++ */
++ filename[filename_size] = '\0';
+
+ /* Decoded unicode form is UTF-16BE, so we have to update a string
+ * conversion object for it. */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch b/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch
new file mode 100644
index 000000000..2f3254c8d
--- /dev/null
+++ b/poky/meta/recipes-extended/libarchive/libarchive/bug929.patch
@@ -0,0 +1,38 @@
+libarchive-3.3.2: Fix bug929
+
+[No upstream tracking] -- https://github.com/libarchive/libarchive/pull/929
+
+archive_read_support_format_cpio: header_newc(): Avoid overflow when reading corrupt
+cpio archive
+
+A cpio "newc" archive with a namelength of "FFFFFFFF", if read on a
+system with a 32-bit size_t, would result in namelength + name_pad
+overflowing 32 bits and libarchive attempting to copy 2^32-1 bytes
+from a 2-byte buffer, with appropriately hilarious results.
+
+Check for this overflow and fail; there's no legitimate reason for a
+cpio archive to contain a file with a name over 4 billion characters
+in length.
+
+Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/bac4659e0b970990e7e3f3a3d239294e96311630]
+Bug: 929
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c
+index ad9f782..1faa64d 100644
+--- a/libarchive/archive_read_support_format_cpio.c
++++ b/libarchive/archive_read_support_format_cpio.c
+@@ -633,6 +633,13 @@ header_newc(struct archive_read *a, struct cpio *cpio,
+ /* Pad name to 2 more than a multiple of 4. */
+ *name_pad = (2 - *namelength) & 3;
+
++ /* Make sure that the padded name length fits into size_t. */
++ if ((size_t)(*namelength + *name_pad) < *namelength) {
++ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
++ "cpio archive has invalid namelength");
++ return (ARCHIVE_FATAL);
++ }
++
+ /*
+ * Note: entry_bytes_remaining is at least 64 bits and
+ * therefore guaranteed to be big enough for a 33-bit file
diff --git a/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch b/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch
new file mode 100644
index 000000000..cd7be5127
--- /dev/null
+++ b/poky/meta/recipes-extended/libarchive/libarchive/non-recursive-extract-and-list.patch
@@ -0,0 +1,153 @@
+From 47f7566f6829c2b14e21bbbba699916de4998c72 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Mon, 24 Oct 2016 12:54:48 +0200
+Subject: [PATCH 1/1] non-recursive extract and list
+
+Sometimes it makes sense to extract or list a directory contained in
+an archive without also doing the same for the content of the
+directory, i.e. allowing -n (= --no-recursion) in combination with the
+x and t modes.
+
+bsdtar uses the match functionality in libarchive to track include
+matches. A new libarchive API call
+archive_match_include_directories_recursively() gets introduced to
+influence the matching behavior, with the default behavior as before.
+
+Non-recursive matching can be achieved by anchoring the path match at
+both start and end. Asking for a directory which itself isn't in the
+archive when in non-recursive mode is an error and handled by the
+existing mechanism for tracking unused inclusion entries.
+
+Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/812]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+
+---
+ libarchive/archive.h | 2 ++
+ libarchive/archive_match.c | 30 +++++++++++++++++++++++++++++-
+ tar/bsdtar.1 | 3 +--
+ tar/bsdtar.c | 12 ++++++++++--
+ 4 files changed, 42 insertions(+), 5 deletions(-)
+
+diff --git a/libarchive/archive.h b/libarchive/archive.h
+index 32710201..59fb4aa6 100644
+--- a/libarchive/archive.h
++++ b/libarchive/archive.h
+@@ -1093,6 +1093,8 @@ __LA_DECL int archive_match_excluded(struct archive *,
+ */
+ __LA_DECL int archive_match_path_excluded(struct archive *,
+ struct archive_entry *);
++/* Control recursive inclusion of directory content when directory is included. Default on. */
++__LA_DECL int archive_match_include_directories_recursively(struct archive *, int _enabled);
+ /* Add exclusion pathname pattern. */
+ __LA_DECL int archive_match_exclude_pattern(struct archive *, const char *);
+ __LA_DECL int archive_match_exclude_pattern_w(struct archive *,
+diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c
+index be72066e..bb6a3407 100644
+--- a/libarchive/archive_match.c
++++ b/libarchive/archive_match.c
+@@ -93,6 +93,9 @@ struct archive_match {
+ /* exclusion/inclusion set flag. */
+ int setflag;
+
++ /* Recursively include directory content? */
++ int recursive_include;
++
+ /*
+ * Matching filename patterns.
+ */
+@@ -223,6 +226,7 @@ archive_match_new(void)
+ return (NULL);
+ a->archive.magic = ARCHIVE_MATCH_MAGIC;
+ a->archive.state = ARCHIVE_STATE_NEW;
++ a->recursive_include = 1;
+ match_list_init(&(a->inclusions));
+ match_list_init(&(a->exclusions));
+ __archive_rb_tree_init(&(a->exclusion_tree), &rb_ops_mbs);
+@@ -471,6 +475,28 @@ archive_match_path_excluded(struct archive *_a,
+ }
+
+ /*
++ * When recursive inclusion of directory content is enabled,
++ * an inclusion pattern that matches a directory will also
++ * include everything beneath that directory. Enabled by default.
++ *
++ * For compatibility with GNU tar, exclusion patterns always
++ * match if a subset of the full patch matches (i.e., they are
++ * are not rooted at the beginning of the path) and thus there
++ * is no corresponding non-recursive exclusion mode.
++ */
++int
++archive_match_include_directories_recursively(struct archive *_a, int _enabled)
++{
++ struct archive_match *a;
++
++ archive_check_magic(_a, ARCHIVE_MATCH_MAGIC,
++ ARCHIVE_STATE_NEW, "archive_match_include_directories_recursively");
++ a = (struct archive_match *)_a;
++ a->recursive_include = _enabled;
++ return (ARCHIVE_OK);
++}
++
++/*
+ * Utility functions to get statistic information for inclusion patterns.
+ */
+ int
+@@ -781,7 +807,9 @@ static int
+ match_path_inclusion(struct archive_match *a, struct match *m,
+ int mbs, const void *pn)
+ {
+- int flag = PATHMATCH_NO_ANCHOR_END;
++ int flag = a->recursive_include ?
++ PATHMATCH_NO_ANCHOR_END : /* Prefix match is good enough. */
++ 0; /* Full match required. */
+ int r;
+
+ if (mbs) {
+diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
+index 132e1145..1dd2a847 100644
+--- a/tar/bsdtar.1
++++ b/tar/bsdtar.1
+@@ -386,8 +386,7 @@ and the default behavior in c, r, and u modes or if
+ .Nm
+ is run in x mode as root.
+ .It Fl n , Fl Fl norecurse , Fl Fl no-recursion
+-(c, r, u modes only)
+-Do not recursively archive the contents of directories.
++Do not recursively archive (c, r, u), extract (x) or list (t) the contents of directories.
+ .It Fl Fl newer Ar date
+ (c, r, u modes only)
+ Only include files and directories newer than the specified date.
+diff --git a/tar/bsdtar.c b/tar/bsdtar.c
+index 11dedbf9..d014cc3e 100644
+--- a/tar/bsdtar.c
++++ b/tar/bsdtar.c
+@@ -794,8 +794,6 @@ main(int argc, char **argv)
+ break;
+ }
+ }
+- if (bsdtar->flags & OPTFLAG_NO_SUBDIRS)
+- only_mode(bsdtar, "-n", "cru");
+ if (bsdtar->flags & OPTFLAG_STDOUT)
+ only_mode(bsdtar, "-O", "xt");
+ if (bsdtar->flags & OPTFLAG_UNLINK_FIRST)
+@@ -845,6 +843,16 @@ main(int argc, char **argv)
+ only_mode(bsdtar, buff, "cru");
+ }
+
++ /*
++ * When creating an archive from a directory tree, the directory
++ * walking code will already avoid entering directories when
++ * recursive inclusion of directory content is disabled, therefore
++ * changing the matching behavior has no effect for creation modes.
++ * It is relevant for extraction or listing.
++ */
++ archive_match_include_directories_recursively(bsdtar->matching,
++ !(bsdtar->flags & OPTFLAG_NO_SUBDIRS));
++
+ /* Filename "-" implies stdio. */
+ if (strcmp(bsdtar->filename, "-") == 0)
+ bsdtar->filename = NULL;
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
new file mode 100644
index 000000000..5daca2731
--- /dev/null
+++ b/poky/meta/recipes-extended/libarchive/libarchive_3.3.2.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Support for reading various archive formats"
+DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats"
+HOMEPAGE = "http://www.libarchive.org/"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ed99aca006bc346974bb745a35336425"
+
+DEPENDS = "e2fsprogs-native"
+
+PACKAGECONFIG ?= "zlib bz2 xz lzo"
+
+PACKAGECONFIG_append_class-target = "\
+ libxml2 \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
+"
+
+DEPENDS_BZIP2 = "bzip2-replacement-native"
+DEPENDS_BZIP2_class-target = "bzip2"
+
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,${DEPENDS_BZIP2},"
+PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz,"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
+PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2,"
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat,"
+PACKAGECONFIG[lzo] = "--with-lzo2,--without-lzo2,lzo,"
+PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle,"
+PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
+
+EXTRA_OECONF += "--enable-largefile"
+
+SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+ file://bug929.patch \
+ file://CVE-2017-14166.patch \
+ file://CVE-2017-14502.patch \
+ file://non-recursive-extract-and-list.patch \
+ "
+
+SRC_URI[md5sum] = "4583bd6b2ebf7e0e8963d90879eb1b27"
+SRC_URI[sha256sum] = "ed2dbd6954792b2c054ccf8ec4b330a54b85904a80cef477a1c74643ddafa0ce"
+
+inherit autotools update-alternatives pkgconfig
+
+CPPFLAGS += "-I${WORKDIR}/extra-includes"
+
+do_configure[cleandirs] += "${WORKDIR}/extra-includes"
+do_configure_prepend() {
+ # We just need the headers for some type constants, so no need to
+ # build all of e2fsprogs for the target
+ cp -R ${STAGING_INCDIR_NATIVE}/ext2fs ${WORKDIR}/extra-includes/
+}
+
+ALTERNATIVE_PRIORITY = "80"
+
+PACKAGES =+ "bsdtar"
+FILES_bsdtar = "${bindir}/bsdtar"
+
+ALTERNATIVE_bsdtar = "tar"
+ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
+ALTERNATIVE_TARGET[tar] = "${bindir}/bsdtar"
+
+PACKAGES =+ "bsdcpio"
+FILES_bsdcpio = "${bindir}/bsdcpio"
+
+ALTERNATIVE_bsdcpio = "cpio"
+ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
+ALTERNATIVE_TARGET[cpio] = "${bindir}/bsdcpio"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch b/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch
new file mode 100644
index 000000000..2d5faabb2
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch
@@ -0,0 +1,694 @@
+From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Wed, 1 Feb 2017 11:06:39 +0100
+Subject: [PATCH] Fix -Wformat warnings
+
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ examples/example.c | 6 +++---
+ examples/example3.c | 4 ++--
+ examples/example4.c | 4 ++--
+ examples/example5.c | 2 +-
+ src/idn.c | 2 +-
+ tests/tst_idna.c | 25 +++++++++++++------------
+ tests/tst_idna2.c | 8 ++++----
+ tests/tst_idna3.c | 8 ++++----
+ tests/tst_nfkc.c | 8 ++++----
+ tests/tst_pr29.c | 12 ++++++------
+ tests/tst_punycode.c | 13 +++++++------
+ tests/tst_strerror.c | 20 ++++++++++----------
+ tests/tst_stringprep.c | 12 ++++++------
+ tests/tst_tld.c | 20 ++++++++++----------
+ tests/utils.c | 6 +++---
+ 15 files changed, 76 insertions(+), 74 deletions(-)
+
+diff --git a/examples/example.c b/examples/example.c
+index 6e91783..24f64e0 100644
+--- a/examples/example.c
++++ b/examples/example.c
+@@ -55,7 +55,7 @@ main (void)
+
+ printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+
+ p = stringprep_locale_to_utf8 (buf);
+@@ -69,7 +69,7 @@ main (void)
+
+ printf ("Before stringprep (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+
+ rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep);
+@@ -79,7 +79,7 @@ main (void)
+ {
+ printf ("After stringprep (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+ }
+
+diff --git a/examples/example3.c b/examples/example3.c
+index fc11c1c..ffb9042 100644
+--- a/examples/example3.c
++++ b/examples/example3.c
+@@ -56,7 +56,7 @@ main (void)
+
+ printf ("Read string (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+
+ rc = idna_to_ascii_lz (buf, &p, 0);
+@@ -68,7 +68,7 @@ main (void)
+
+ printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
+ for (i = 0; i < strlen (p); i++)
+- printf ("%02x ", p[i] & 0xFF);
++ printf ("%02x ", (unsigned) p[i] & 0xFF);
+ printf ("\n");
+
+ free (p);
+diff --git a/examples/example4.c b/examples/example4.c
+index 1b319c9..a3315a1 100644
+--- a/examples/example4.c
++++ b/examples/example4.c
+@@ -56,7 +56,7 @@ main (void)
+
+ printf ("Read string (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+
+ rc = idna_to_unicode_lzlz (buf, &p, 0);
+@@ -68,7 +68,7 @@ main (void)
+
+ printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p);
+ for (i = 0; i < strlen (p); i++)
+- printf ("%02x ", p[i] & 0xFF);
++ printf ("%02x ", (unsigned) p[i] & 0xFF);
+ printf ("\n");
+
+ free (p);
+diff --git a/examples/example5.c b/examples/example5.c
+index df55798..29d40b9 100644
+--- a/examples/example5.c
++++ b/examples/example5.c
+@@ -68,7 +68,7 @@ main (void)
+
+ printf ("Read string (length %ld): ", (long int) strlen (buf));
+ for (i = 0; i < strlen (buf); i++)
+- printf ("%02x ", buf[i] & 0xFF);
++ printf ("%02x ", (unsigned) buf[i] & 0xFF);
+ printf ("\n");
+
+ p = stringprep_locale_to_utf8 (buf);
+diff --git a/src/idn.c b/src/idn.c
+index be1c7d1..13eb3c9 100644
+--- a/src/idn.c
++++ b/src/idn.c
+@@ -419,7 +419,7 @@ main (int argc, char *argv[])
+ size_t i;
+ for (i = 0; p[i]; i++)
+ fprintf (stderr, "output[%lu] = U+%04x\n",
+- (unsigned long) i, p[i]);
++ (unsigned long) i, (unsigned) p[i]);
+ }
+
+ fprintf (stdout, "%s\n", p);
+diff --git a/tests/tst_idna.c b/tests/tst_idna.c
+index 415764e..4ac046f 100644
+--- a/tests/tst_idna.c
++++ b/tests/tst_idna.c
+@@ -220,13 +220,14 @@ doit (void)
+ char label[100];
+ uint32_t *ucs4label = NULL;
+ uint32_t tmp[100];
+- size_t len, len2, i;
++ size_t len, len2;
+ int rc;
++ unsigned i;
+
+ for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
+ {
+ if (debug)
+- printf ("IDNA entry %ld: %s\n", i, idna[i].name);
++ printf ("IDNA entry %u: %s\n", i, idna[i].name);
+
+ if (debug)
+ {
+@@ -237,7 +238,7 @@ doit (void)
+ rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label, idna[i].flags);
+ if (rc != idna[i].toasciirc)
+ {
+- fail ("IDNA entry %ld failed: %d\n", i, rc);
++ fail ("IDNA entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -256,7 +257,7 @@ doit (void)
+ if (strlen (idna[i].out) != strlen (label) ||
+ strcasecmp (idna[i].out, label) != 0)
+ {
+- fail ("IDNA entry %ld failed\n", i);
++ fail ("IDNA entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+@@ -273,8 +274,8 @@ doit (void)
+
+ if (debug)
+ {
+- printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen (idna[i].out),
+- len);
++ printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen (idna[i].out),
++ (int) len);
+ ucs4print (ucs4label, len);
+ }
+
+@@ -282,20 +283,20 @@ doit (void)
+ rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2, idna[i].flags);
+ if (debug)
+ {
+- printf ("expected out (%ld):\n",
++ printf ("expected out (%lu):\n",
+ rc == IDNA_SUCCESS ? idna[i].inlen : len);
+ if (rc == IDNA_SUCCESS)
+ ucs4print (idna[i].in, idna[i].inlen);
+ else
+ ucs4print (ucs4label, len);
+
+- printf ("computed out (%ld):\n", len2);
++ printf ("computed out (%d):\n", (int) len2);
+ ucs4print (tmp, len2);
+ }
+
+ if (rc != idna[i].tounicoderc)
+ {
+- fail ("IDNA entry %ld failed: %d\n", i, rc);
++ fail ("IDNA entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -309,11 +310,11 @@ doit (void)
+ if (debug)
+ {
+ if (rc == IDNA_SUCCESS)
+- printf ("len=%ld len2=%ld\n", len2, idna[i].inlen);
++ printf ("len=%d len2=%d\n", (int) len2, (int) idna[i].inlen);
+ else
+- printf ("len=%ld len2=%ld\n", len, len2);
++ printf ("len=%d len2=%d\n", (int) len, (int) len2);
+ }
+- fail ("IDNA entry %ld failed\n", i);
++ fail ("IDNA entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c
+index 65b3a4d..38932ca 100644
+--- a/tests/tst_idna2.c
++++ b/tests/tst_idna2.c
+@@ -461,14 +461,14 @@ static const struct idna idna[] = {
+ void
+ doit (void)
+ {
+- size_t i;
++ unsigned i;
+ char *out;
+ int rc;
+
+ for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
+ {
+ if (debug)
+- printf ("IDNA2 entry %ld\n", i);
++ printf ("IDNA2 entry %u\n", i);
+
+ if (debug)
+ {
+@@ -487,7 +487,7 @@ doit (void)
+ IDNA_USE_STD3_ASCII_RULES);
+ if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0)
+ {
+- fail ("IDNA2 entry %ld failed: %d\n", i, rc);
++ fail ("IDNA2 entry %u failed: %d\n", i, rc);
+ continue;
+ }
+
+@@ -504,7 +504,7 @@ doit (void)
+ if (strlen (idna[i].out) != strlen (out) ||
+ strcasecmp (idna[i].out, out) != 0)
+ {
+- fail ("IDNA2 entry %ld failed\n", i);
++ fail ("IDNA2 entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c
+index a189378..f65628c 100644
+--- a/tests/tst_idna3.c
++++ b/tests/tst_idna3.c
+@@ -59,13 +59,13 @@ doit (void)
+ {
+ int rc;
+ char *out = NULL;
+- size_t i;
++ unsigned i;
+
+ for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++)
+ {
+ rc = idna_to_unicode_8z8z (idna[i].in, &out, 0);
+ if (rc != IDNA_SUCCESS)
+- fail ("IDNA3[%ld] failed %d\n", i, rc);
++ fail ("IDNA3[%u] failed %d\n", i, rc);
+
+ if (debug && rc == IDNA_SUCCESS)
+ {
+@@ -75,9 +75,9 @@ doit (void)
+ }
+
+ if (strcmp (out, idna[i].out) != 0)
+- fail ("IDNA3[%ld] failed\n", i);
++ fail ("IDNA3[%u] failed\n", i);
+ else if (debug)
+- printf ("IDNA3[%ld] success\n", i);
++ printf ("IDNA3[%u] success\n", i);
+
+ if (out)
+ idn_free (out);
+diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c
+index d150fec..f5af9c6 100644
+--- a/tests/tst_nfkc.c
++++ b/tests/tst_nfkc.c
+@@ -68,18 +68,18 @@ void
+ doit (void)
+ {
+ char *out;
+- size_t i;
++ unsigned i;
+
+ for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++)
+ {
+ if (debug)
+- printf ("NFKC entry %ld\n", i);
++ printf ("NFKC entry %u\n", i);
+
+ out = stringprep_utf8_nfkc_normalize (nfkc[i].in,
+ (ssize_t) strlen (nfkc[i].in));
+ if (out == NULL)
+ {
+- fail ("NFKC entry %ld failed fatally\n", i);
++ fail ("NFKC entry %u failed fatally\n", i);
+ continue;
+ }
+
+@@ -114,7 +114,7 @@ doit (void)
+ if (strlen (nfkc[i].out) != strlen (out) ||
+ memcmp (nfkc[i].out, out, strlen (out)) != 0)
+ {
+- fail ("NFKC entry %ld failed\n", i);
++ fail ("NFKC entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c
+index 3dc5466..11d0ede 100644
+--- a/tests/tst_pr29.c
++++ b/tests/tst_pr29.c
+@@ -91,7 +91,7 @@ static const struct tv tv[] = {
+ void
+ doit (void)
+ {
+- size_t i;
++ unsigned i;
+ int rc;
+
+ for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
+@@ -100,7 +100,7 @@ doit (void)
+ {
+ uint32_t *p, *q;
+
+- printf ("PR29 entry %ld: %s\n", i, tv[i].name);
++ printf ("PR29 entry %u: %s\n", i, tv[i].name);
+
+ printf ("in:\n");
+ ucs4print (tv[i].in, tv[i].inlen);
+@@ -120,7 +120,7 @@ doit (void)
+ rc = pr29_4 (tv[i].in, tv[i].inlen);
+ if (rc != tv[i].rc)
+ {
+- fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc);
++ fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -129,7 +129,7 @@ doit (void)
+ rc = pr29_4z (tv[i].in);
+ if (rc != tv[i].rc)
+ {
+- fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc);
++ fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -142,7 +142,7 @@ doit (void)
+ p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen,
+ &items_read, &items_written);
+ if (p == NULL)
+- fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i);
++ fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i);
+ if (debug)
+ hexprint (p, strlen (p));
+
+@@ -150,7 +150,7 @@ doit (void)
+ free (p);
+ if (rc != tv[i].rc)
+ {
+- fail ("PR29 entry %ld failed (expected %d): %d\n",
++ fail ("PR29 entry %u failed (expected %d): %d\n",
+ i, tv[i].rc, rc);
+ if (debug)
+ printf ("FATAL\n");
+diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c
+index 493b8a2..997744a 100644
+--- a/tests/tst_punycode.c
++++ b/tests/tst_punycode.c
+@@ -173,7 +173,8 @@ doit (void)
+ char *p;
+ uint32_t *q;
+ int rc;
+- size_t i, outlen;
++ size_t outlen;
++ unsigned i;
+
+ p = malloc (sizeof (*p) * BUFSIZ);
+ if (p == NULL)
+@@ -186,7 +187,7 @@ doit (void)
+ for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++)
+ {
+ if (debug)
+- printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name);
++ printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name);
+
+ if (debug)
+ {
+@@ -199,7 +200,7 @@ doit (void)
+ NULL, &outlen, p);
+ if (rc != punycode[i].rc)
+ {
+- fail ("punycode_encode() entry %ld failed: %d\n", i, rc);
++ fail ("punycode_encode() entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -221,7 +222,7 @@ doit (void)
+ if (strlen (punycode[i].out) != strlen (p) ||
+ memcmp (punycode[i].out, p, strlen (p)) != 0)
+ {
+- fail ("punycode() entry %ld failed\n", i);
++ fail ("punycode() entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+@@ -241,7 +242,7 @@ doit (void)
+ &outlen, q, NULL);
+ if (rc != punycode[i].rc)
+ {
+- fail ("punycode() entry %ld failed: %d\n", i, rc);
++ fail ("punycode() entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -262,7 +263,7 @@ doit (void)
+ if (punycode[i].inlen != outlen ||
+ memcmp (punycode[i].in, q, outlen) != 0)
+ {
+- fail ("punycode_decode() entry %ld failed\n", i);
++ fail ("punycode_decode() entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c
+index 71fff59..730f5e4 100644
+--- a/tests/tst_strerror.c
++++ b/tests/tst_strerror.c
+@@ -110,7 +110,7 @@ doit (void)
+ /* Iterate through all error codes. */
+
+ {
+- size_t i;
++ unsigned i;
+ const char *last_p = NULL;
+
+ for (i = 0;; i++)
+@@ -126,13 +126,13 @@ doit (void)
+ break;
+ }
+ if (debug)
+- printf ("idna %ld: %s\n", i, p);
++ printf ("idna %u: %s\n", i, p);
+ last_p = p;
+ }
+ }
+
+ {
+- size_t i;
++ unsigned i;
+ const char *last_p = NULL;
+
+ for (i = 0;; i++)
+@@ -141,13 +141,13 @@ doit (void)
+ if (p == last_p)
+ break;
+ if (debug)
+- printf ("pr29 %ld: %s\n", i, p);
++ printf ("pr29 %u: %s\n", i, p);
+ last_p = p;
+ }
+ }
+
+ {
+- size_t i;
++ unsigned i;
+ const char *last_p = NULL;
+
+ for (i = 0;; i++)
+@@ -156,13 +156,13 @@ doit (void)
+ if (p == last_p)
+ break;
+ if (debug)
+- printf ("punycode %ld: %s\n", i, p);
++ printf ("punycode %u: %s\n", i, p);
+ last_p = p;
+ }
+ }
+
+ {
+- size_t i;
++ unsigned i;
+ const char *last_p = NULL;
+
+ for (i = 0;; i++)
+@@ -183,13 +183,13 @@ doit (void)
+ break;
+ }
+ if (debug)
+- printf ("stringprep %ld: %s\n", i, p);
++ printf ("stringprep %u: %s\n", i, p);
+ last_p = p;
+ }
+ }
+
+ {
+- size_t i;
++ unsigned i;
+ const char *last_p = NULL;
+
+ for (i = 0;; i++)
+@@ -198,7 +198,7 @@ doit (void)
+ if (p == last_p)
+ break;
+ if (debug)
+- printf ("tld %ld: %s\n", i, p);
++ printf ("tld %u: %s\n", i, p);
+ last_p = p;
+ }
+ }
+diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c
+index 149ce6f..7c9ab06 100644
+--- a/tests/tst_stringprep.c
++++ b/tests/tst_stringprep.c
+@@ -205,7 +205,7 @@ doit (void)
+ {
+ char *p;
+ int rc;
+- size_t i;
++ unsigned i;
+
+ if (!stringprep_check_version (STRINGPREP_VERSION))
+ fail ("stringprep_check_version failed (header %s runtime %s)\n",
+@@ -224,7 +224,7 @@ doit (void)
+ for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++)
+ {
+ if (debug)
+- printf ("STRINGPREP entry %ld\n", i);
++ printf ("STRINGPREP entry %u\n", i);
+
+ if (debug)
+ {
+@@ -247,12 +247,12 @@ doit (void)
+ continue;
+ else if (l == NULL)
+ {
+- fail ("bad UTF-8 in entry %ld\n", i);
++ fail ("bad UTF-8 in entry %u\n", i);
+ continue;
+ }
+ else if (strcmp (strprep[i].in, x) != 0)
+ {
+- fail ("bad UTF-8 in entry %ld\n", i);
++ fail ("bad UTF-8 in entry %u\n", i);
+ if (debug)
+ {
+ puts ("expected:");
+@@ -274,7 +274,7 @@ doit (void)
+ "Nameprep", strprep[i].flags);
+ if (rc != strprep[i].rc)
+ {
+- fail ("stringprep() entry %ld failed: %d\n", i, rc);
++ fail ("stringprep() entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ if (rc == STRINGPREP_OK)
+@@ -302,7 +302,7 @@ doit (void)
+ if (strlen (strprep[i].out) != strlen (p) ||
+ memcmp (strprep[i].out, p, strlen (p)) != 0)
+ {
+- fail ("stringprep() entry %ld failed\n", i);
++ fail ("stringprep() entry %ld failed\n", (long) i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+diff --git a/tests/tst_tld.c b/tests/tst_tld.c
+index 2f8e12e..d038c79 100644
+--- a/tests/tst_tld.c
++++ b/tests/tst_tld.c
+@@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] =
+ void
+ doit (void)
+ {
+- size_t i;
++ unsigned i;
+ const Tld_table *tldtable;
+ char *out;
+ size_t errpos;
+@@ -206,7 +206,7 @@ doit (void)
+ for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++)
+ {
+ if (debug)
+- printf ("TLD entry %ld: %s\n", i, tld[i].name);
++ printf ("TLD entry %u: %s\n", i, tld[i].name);
+
+ if (debug)
+ {
+@@ -217,7 +217,7 @@ doit (void)
+ tldtable = tld_default_table (tld[i].tld, NULL);
+ if (tldtable == NULL)
+ {
+- fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld);
++ fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -226,7 +226,7 @@ doit (void)
+ rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable);
+ if (rc != tld[i].rc)
+ {
+- fail ("TLD entry %ld failed: %d\n", i, rc);
++ fail ("TLD entry %u failed: %d\n", i, rc);
+ if (debug)
+ printf ("FATAL\n");
+ continue;
+@@ -237,7 +237,7 @@ doit (void)
+
+ if (rc != tld[i].rc)
+ {
+- fail ("TLD entry %ld failed\n", i);
++ fail ("TLD entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+@@ -245,12 +245,12 @@ doit (void)
+ {
+ if (debug)
+ printf ("returned errpos %ld expected errpos %ld\n",
+- errpos, tld[i].errpos);
++ (long) errpos, (long) tld[i].errpos);
+
+ if (tld[i].errpos != errpos)
+ {
+- fail ("TLD entry %ld failed because errpos %ld != %ld\n", i,
+- tld[i].errpos, errpos);
++ fail ("TLD entry %u failed because errpos %ld != %ld\n", i,
++ (long) tld[i].errpos, (long) errpos);
+ if (debug)
+ printf ("ERROR\n");
+ }
+@@ -262,12 +262,12 @@ doit (void)
+ rc = tld_check_8z (tld[i].example, &errpos, NULL);
+ if (rc != tld[i].rc)
+ {
+- fail ("TLD entry %ld failed\n", i);
++ fail ("TLD entry %u failed\n", i);
+ if (debug)
+ printf ("ERROR\n");
+ }
+ if (debug)
+- printf ("TLD entry %ld tld_check_8z (%s)\n", i, tld[i].example);
++ printf ("TLD entry %u tld_check_8z (%s)\n", i, tld[i].example);
+ }
+ }
+ }
+diff --git a/tests/utils.c b/tests/utils.c
+index 717ee01..5577dc3 100644
+--- a/tests/utils.c
++++ b/tests/utils.c
+@@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len)
+ {
+ size_t i;
+
+- printf (" (length %ld bytes):\n\t", len);
++ printf (" (length %ld bytes):\n\t", (long) len);
+ for (i = 0; i < len; i++)
+ {
+ if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') ||
+@@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len)
+ || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.')
+ printf ("%c", (str[i] & 0xFF));
+ else
+- printf ("\\x%02X", (str[i] & 0xFF));
++ printf ("\\x%02X", (unsigned) (str[i] & 0xFF));
+ if ((i + 1) % 16 == 0 && (i + 1) < len)
+ printf ("'\n\t'");
+ }
+@@ -73,7 +73,7 @@ hexprint (const char *str, size_t len)
+ printf ("\t;; ");
+ for (i = 0; i < len; i++)
+ {
+- printf ("%02x ", (str[i] & 0xFF));
++ printf ("%02x ", (unsigned) (str[i] & 0xFF));
+ if ((i + 1) % 8 == 0)
+ printf (" ");
+ if ((i + 1) % 16 == 0 && i + 1 < len)
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch b/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch
new file mode 100644
index 000000000..5adc7d9fd
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch
@@ -0,0 +1,181 @@
+From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
+Date: Tue, 28 Jun 2016 12:43:31 +0100
+Subject: [PATCH] idn: fix printf() format security warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../../libidn-1.32/src/idn.c: In function 'main':
+| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal and no format arguments [-Werror=format-security]
+| error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
+| ^~~~~
+| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal and no format arguments [-Werror=format-security]
+| fprintf (stderr, _("Type each input string on a line by itself, "
+| ^~~~~~~
+| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal and no format arguments [-Werror=format-security]
+| error (EXIT_FAILURE, errno, _("input error"));
+| ^~~~~
+| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UCS-4 to UTF-8"));
+| ^
+| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UCS-4 to UTF-8"));
+| ^
+| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UCS-4 to UTF-8"));
+| ^
+| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal and no format arguments [-Werror=format-security]
+| error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
+| ^~~~~
+| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal and no format arguments [-Werror=format-security]
+| _("could not convert from UTF-8 to UCS-4"));
+| ^
+
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+---
+Upstream-Status: Pending
+
+ src/idn.c | 27 ++++++++++++++-------------
+ 1 file changed, 14 insertions(+), 13 deletions(-)
+
+diff --git a/src/idn.c b/src/idn.c
+index be1c7d1..68e4291 100644
+--- a/src/idn.c
++++ b/src/idn.c
+@@ -170,7 +170,7 @@ main (int argc, char *argv[])
+ (args_info.idna_to_unicode_given ? 1 : 0) +
+ (args_info.nfkc_given ? 1 : 0) != 1)
+ {
+- error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
++ error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified"));
+ usage (EXIT_FAILURE);
+ }
+
+@@ -185,7 +185,7 @@ main (int argc, char *argv[])
+ if (!args_info.quiet_given
+ && args_info.inputs_num == 0
+ && isatty (fileno (stdin)))
+- fprintf (stderr, _("Type each input string on a line by itself, "
++ fprintf (stderr, "%s", _("Type each input string on a line by itself, "
+ "terminated by a newline character.\n"));
+
+ do
+@@ -197,7 +197,7 @@ main (int argc, char *argv[])
+ if (feof (stdin))
+ break;
+
+- error (EXIT_FAILURE, errno, _("input error"));
++ error (EXIT_FAILURE, errno, "%s", _("input error"));
+ }
+
+ if (strlen (line) > 0)
+@@ -215,7 +215,7 @@ main (int argc, char *argv[])
+ if (!q)
+ {
+ free (p);
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+ }
+
+@@ -240,7 +240,7 @@ main (int argc, char *argv[])
+ if (!q)
+ {
+ free (r);
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+ }
+
+@@ -277,7 +277,7 @@ main (int argc, char *argv[])
+ q = stringprep_utf8_to_ucs4 (p, -1, &len);
+ free (p);
+ if (!q)
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+
+ if (args_info.debug_given)
+@@ -336,7 +336,7 @@ main (int argc, char *argv[])
+ r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
+ free (q);
+ if (!r)
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UCS-4 to UTF-8"));
+
+ p = stringprep_utf8_to_locale (r);
+@@ -360,7 +360,7 @@ main (int argc, char *argv[])
+ q = stringprep_utf8_to_ucs4 (p, -1, NULL);
+ free (p);
+ if (!q)
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UCS-4 to UTF-8"));
+
+ if (args_info.debug_given)
+@@ -438,7 +438,7 @@ main (int argc, char *argv[])
+ if (!q)
+ {
+ free (p);
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UCS-4 to UTF-8"));
+ }
+
+@@ -494,7 +494,7 @@ main (int argc, char *argv[])
+ r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
+ free (q);
+ if (!r)
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+
+ p = stringprep_utf8_to_locale (r);
+@@ -523,7 +523,7 @@ main (int argc, char *argv[])
+ if (!q)
+ {
+ free (p);
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+ }
+
+@@ -537,7 +537,8 @@ main (int argc, char *argv[])
+ r = stringprep_utf8_nfkc_normalize (p, -1);
+ free (p);
+ if (!r)
+- error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
++ error (EXIT_FAILURE, 0, "%s",
++ _("could not do NFKC normalization"));
+
+ if (args_info.debug_given)
+ {
+@@ -547,7 +548,7 @@ main (int argc, char *argv[])
+ if (!q)
+ {
+ free (r);
+- error (EXIT_FAILURE, 0,
++ error (EXIT_FAILURE, 0, "%s",
+ _("could not convert from UTF-8 to UCS-4"));
+ }
+
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch b/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
new file mode 100644
index 000000000..98ba4d6ff
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate
+
+automake 1.12.x has deprecated AM_PROG_MKDIR_P , and throws a warning for that,
+and the warnings are treated as errors because of the -Werror parameter.
+
+These AM_PROG_MKDIR_P are coming from gettext, and the latest gettext code has not
+eliminated these deprecated macros yet. So disable the treatment of warnings
+as errors until gettext is updated to remove the deprecated macros.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/10
+
+Index: libidn-1.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -23,7 +23,7 @@ AC_COPYRIGHT([Copyright (c) 2002-2011 Si
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_HEADERS(config.h)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
++AM_INIT_AUTOMAKE([1.10 -Wall -Wno-override])
+ AM_SILENT_RULES([yes])
+
+ # Library code modified: REVISION++
diff --git a/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch b/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..0863530f2
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurdd libidn-1.26/doc/Makefile.am libidn-1.26/doc/Makefile.am
+--- libidn-1.26/doc/Makefile.am 2012-09-18 11:25:45.000000000 +0300
++++ libidn-1.26/doc/Makefile.am 2013-02-08 07:41:24.591431462 +0200
+@@ -49,15 +49,9 @@
+
+ # Man pages.
+
+-dist_man_MANS = idn.1 $(gdoc_MANS)
++dist_man_MANS = $(gdoc_MANS)
+ MAINTAINERCLEANFILES = $(dist_man_MANS)
+
+-idn.1: $(top_srcdir)/src/idn.c $(top_srcdir)/src/idn.ggo \
+- $(top_srcdir)/configure.ac
+- $(HELP2MAN) \
+- --name="Internationalized Domain Names command line tool" \
+- --output=$@ $(top_builddir)/src/idn$(EXEEXT)
+-
+ # GDOC
+
+ GDOC_BIN = $(srcdir)/gdoc
diff --git a/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch b/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
new file mode 100644
index 000000000..546a6eaaf
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch
@@ -0,0 +1,334 @@
+From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
+Date: Wed, 1 Feb 2017 10:44:36 +0100
+Subject: [PATCH] Update intprops.h for gcc-7 compatibility
+
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ gl/intprops.h | 65 ++++++++++++++++++++++++++++++--------------------
+ lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++--------------------
+ 2 files changed, 78 insertions(+), 52 deletions(-)
+
+diff --git a/gl/intprops.h b/gl/intprops.h
+index e1fce5c..eb06b69 100644
+--- a/gl/intprops.h
++++ b/gl/intprops.h
+@@ -1,18 +1,18 @@
+ /* intprops.h -- properties of integer types
+
+- Copyright (C) 2001-2016 Free Software Foundation, Inc.
++ Copyright (C) 2001-2017 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+- under the terms of the GNU General Public License as published
+- by the Free Software Foundation; either version 3 of the License, or
++ under the terms of the GNU Lesser General Public License as published
++ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ GNU Lesser General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
++ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ /* Written by Paul Eggert. */
+@@ -47,12 +47,16 @@
+
+ /* Minimum and maximum values for integer types and expressions. */
+
++/* The width in bits of the integer type or expression T.
++ Padding bits are not supported; this is checked at compile-time below. */
++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
++
+ /* The maximum and minimum values for the integer type T. */
+ #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+ #define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+- : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
++ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+
+ /* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E should not have side effects. */
+@@ -65,7 +69,13 @@
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+ #define _GL_SIGNED_INT_MAXIMUM(e) \
+- (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
++ (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
++
++/* Work around OpenVMS incompatibility with C99. */
++#if !defined LLONG_MAX && defined __INT64_MAX
++# define LLONG_MAX __INT64_MAX
++# define LLONG_MIN __INT64_MIN
++#endif
+
+ /* This include file assumes that signed types are two's complement without
+ padding bits; the above macros have undefined behavior otherwise.
+@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+ verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #endif
++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */
++#ifdef UINT_WIDTH
++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
++#endif
+
+ /* Does the __typeof__ keyword work? This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
++#if (2 <= __GNUC__ \
++ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+ # define _GL_HAVE___TYPEOF__ 1
+ #else
+@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ signed, this macro may overestimate the true bound by one byte when
+ applied to unsigned types of size 2, 4, 16, ... bytes. */
+ #define INT_STRLEN_BOUND(t) \
+- (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \
+- - _GL_SIGNED_TYPE_OR_EXPR (t)) \
++ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ + _GL_SIGNED_TYPE_OR_EXPR (t))
+
+ /* Bound on buffer size needed to represent an integer type or expression T,
+@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+-/* True if __builtin_add_overflow (A, B, P) works when P is null. */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
++
++/* True if __builtin_add_overflow_p (A, B, C) works. */
++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max) \
++ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
++ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
++ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ the operation. BUILTIN is the builtin operation, and OVERFLOW the
+ overflow predicate. Return 1 if the result overflows. See above
+ for restrictions. */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ # else
+ # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+- long int, LONG_MIN, LONG_MAX))
++ long int, LONG_MIN, LONG_MAX)
+ # endif
+ #endif
+
+diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h
+index e1fce5c..eb06b69 100644
+--- a/lib/gltests/intprops.h
++++ b/lib/gltests/intprops.h
+@@ -1,18 +1,18 @@
+ /* intprops.h -- properties of integer types
+
+- Copyright (C) 2001-2016 Free Software Foundation, Inc.
++ Copyright (C) 2001-2017 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify it
+- under the terms of the GNU General Public License as published
+- by the Free Software Foundation; either version 3 of the License, or
++ under the terms of the GNU Lesser General Public License as published
++ by the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- GNU General Public License for more details.
++ GNU Lesser General Public License for more details.
+
+- You should have received a copy of the GNU General Public License
++ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+ /* Written by Paul Eggert. */
+@@ -47,12 +47,16 @@
+
+ /* Minimum and maximum values for integer types and expressions. */
+
++/* The width in bits of the integer type or expression T.
++ Padding bits are not supported; this is checked at compile-time below. */
++#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
++
+ /* The maximum and minimum values for the integer type T. */
+ #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+ #define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+- : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
++ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+
+ /* The maximum and minimum values for the type of the expression E,
+ after integer promotion. E should not have side effects. */
+@@ -65,7 +69,13 @@
+ ? _GL_SIGNED_INT_MAXIMUM (e) \
+ : _GL_INT_NEGATE_CONVERT (e, 1))
+ #define _GL_SIGNED_INT_MAXIMUM(e) \
+- (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
++ (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
++
++/* Work around OpenVMS incompatibility with C99. */
++#if !defined LLONG_MAX && defined __INT64_MAX
++# define LLONG_MAX __INT64_MAX
++# define LLONG_MIN __INT64_MIN
++#endif
+
+ /* This include file assumes that signed types are two's complement without
+ padding bits; the above macros have undefined behavior otherwise.
+@@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+ verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #endif
++/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */
++#ifdef UINT_WIDTH
++verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
++#endif
+
+ /* Does the __typeof__ keyword work? This could be done by
+ 'configure', but for now it's easier to do it by hand. */
+-#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
++#if (2 <= __GNUC__ \
++ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+ || (0x5110 <= __SUNPRO_C && !__STDC__))
+ # define _GL_HAVE___TYPEOF__ 1
+ #else
+@@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ signed, this macro may overestimate the true bound by one byte when
+ applied to unsigned types of size 2, 4, 16, ... bytes. */
+ #define INT_STRLEN_BOUND(t) \
+- (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \
+- - _GL_SIGNED_TYPE_OR_EXPR (t)) \
++ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ + _GL_SIGNED_TYPE_OR_EXPR (t))
+
+ /* Bound on buffer size needed to represent an integer type or expression T,
+@@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ ? (a) < (min) >> (b) \
+ : (max) >> (b) < (a))
+
+-/* True if __builtin_add_overflow (A, B, P) works when P is null. */
+-#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
++/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
++#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
++
++/* True if __builtin_add_overflow_p (A, B, C) works. */
++#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+
+ /* The _GL*_OVERFLOW macros have the same restrictions as the
+ *_RANGE_OVERFLOW macros, except that they do not assume that operands
+ (e.g., A and B) have the same type as MIN and MAX. Instead, they assume
+ that the result (e.g., A + B) has that type. */
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
+- __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
+- __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
+- __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
++#if _GL_HAS_BUILTIN_OVERFLOW_P
++# define _GL_ADD_OVERFLOW(a, b, min, max) \
++ __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
++ __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
++ __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max) \
+ ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
+@@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
+ #define INT_SUBTRACT_OVERFLOW(a, b) \
+ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
+-#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
++#if _GL_HAS_BUILTIN_OVERFLOW_P
+ # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
+ #else
+ # define INT_NEGATE_OVERFLOW(a) \
+@@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ #define INT_MULTIPLY_WRAPV(a, b, r) \
+ _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+
+-#ifndef __has_builtin
+-# define __has_builtin(x) 0
+-#endif
+-
+ /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
+ https://llvm.org/bugs/show_bug.cgi?id=25390
+@@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ the operation. BUILTIN is the builtin operation, and OVERFLOW the
+ overflow predicate. Return 1 if the result overflows. See above
+ for restrictions. */
+-#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
++#if _GL_HAS_BUILTIN_OVERFLOW
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
+ #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+ # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+@@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+ # else
+ # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
+ _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+- long int, LONG_MIN, LONG_MAX))
++ long int, LONG_MIN, LONG_MAX)
+ # endif
+ #endif
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch b/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..db91317ca
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| automake: warnings are treated as errors
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libidn.la': linking libtool libraries using a non-POSIX
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: libidn-1.33/configure.ac
+===================================================================
+--- libidn-1.33.orig/configure.ac
++++ libidn-1.33/configure.ac
+@@ -33,6 +33,10 @@ AC_SUBST(LT_CURRENT, 17)
+ AC_SUBST(LT_REVISION, 16)
+ AC_SUBST(LT_AGE, 6)
+
++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
++m4_pattern_allow([AM_PROG_AR])
++AM_PROG_AR
++
+ AC_PROG_CC
+ gl_EARLY
+ lgl_EARLY
diff --git a/poky/meta/recipes-extended/libidn/libidn_1.33.bb b/poky/meta/recipes-extended/libidn/libidn_1.33.bb
new file mode 100644
index 000000000..9e8bdbae1
--- /dev/null
+++ b/poky/meta/recipes-extended/libidn/libidn_1.33.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Internationalized Domain Name support library"
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "(LGPLv2.1+ | LGPLv3) & GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=df4be47940a91ee69556f5f71eed4aec \
+ file://COPYING.LESSERv2;md5=4fbd65380cdd255951079008b364516c \
+ file://COPYING.LESSERv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+ file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://lib/idna.h;endline=21;md5=37cffad24807f446a24de3e7371f20b9 \
+ file://src/idn.c;endline=20;md5=09e97034a8877b3451cb65065fc2c06e"
+DEPENDS = "virtual/libiconv"
+
+inherit pkgconfig autotools gettext texinfo gtk-doc
+
+SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
+ file://libidn_fix_for_automake-1.12.patch \
+ file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \
+ file://dont-depend-on-help2man.patch \
+ file://0001-idn-fix-printf-format-security-warnings.patch \
+ file://gcc7-compatibility.patch \
+ file://0001-idn-format-security-warnings.patch \
+"
+
+SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308"
+SRC_URI[sha256sum] = "44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19"
+
+# command tool is under GPLv3+, while libidn itself is under LGPLv2.1+ or LGPLv3
+# so package command into a separate package
+PACKAGES =+ "idn"
+FILES_idn = "${bindir}/*"
+
+LICENSE_${PN} = "LGPLv2.1+ | LGPLv3"
+LICENSE_idn = "GPLv3+"
+
+EXTRA_OECONF = "--disable-csharp"
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb b/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb
new file mode 100644
index 000000000..23262e8c6
--- /dev/null
+++ b/poky/meta/recipes-extended/libmnl/libmnl_1.0.4.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Minimalistic user-space Netlink utility library"
+DESCRIPTION = "Minimalistic user-space library oriented to Netlink developers, providing \
+ functions for common tasks in parsing, validating, and constructing both the Netlink header and TLVs."
+HOMEPAGE = "http://www.netfilter.org/projects/libmnl/index.html"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "http://www.netfilter.org/projects/libmnl/files/libmnl-${PV}.tar.bz2;name=tar"
+SRC_URI[tar.md5sum] = "be9b4b5328c6da1bda565ac5dffadb2d"
+SRC_URI[tar.sha256sum] = "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch
new file mode 100644
index 000000000..bd647ac55
--- /dev/null
+++ b/poky/meta/recipes-extended/libnsl/libnsl2/0001-include-sys-cdefs.h-explicitly.patch
@@ -0,0 +1,68 @@
+From 508a0ff690dfebc17c4f55a5f81824ed549bed66 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Apr 2017 09:13:33 -0700
+Subject: [PATCH 1/2] include sys/cdefs.h explicitly
+
+glibc includes this header indirectly but not musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/rpcsvc/nis.h | 1 +
+ src/rpcsvc/nislib.h | 1 +
+ src/rpcsvc/ypclnt.h | 1 +
+ src/rpcsvc/ypupd.h | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
+index 933c4d9..88cbca0 100644
+--- a/src/rpcsvc/nis.h
++++ b/src/rpcsvc/nis.h
+@@ -32,6 +32,7 @@
+ #ifndef _RPCSVC_NIS_H
+ #define _RPCSVC_NIS_H 1
+
++#include <sys/cdefs.h>
+ #include <features.h>
+ #include <rpc/rpc.h>
+ #include <rpcsvc/nis_tags.h>
+diff --git a/src/rpcsvc/nislib.h b/src/rpcsvc/nislib.h
+index a59c19b..a53fab3 100644
+--- a/src/rpcsvc/nislib.h
++++ b/src/rpcsvc/nislib.h
+@@ -19,6 +19,7 @@
+ #ifndef __RPCSVC_NISLIB_H__
+ #define __RPCSVC_NISLIB_H__
+
++#include <sys/cdefs.h>
+ #include <features.h>
+
+ __BEGIN_DECLS
+diff --git a/src/rpcsvc/ypclnt.h b/src/rpcsvc/ypclnt.h
+index fe43fd4..a686b61 100644
+--- a/src/rpcsvc/ypclnt.h
++++ b/src/rpcsvc/ypclnt.h
+@@ -20,6 +20,7 @@
+ #ifndef __RPCSVC_YPCLNT_H__
+ #define __RPCSVC_YPCLNT_H__
+
++#include <sys/cdefs.h>
+ #include <features.h>
+
+ /* Some defines */
+diff --git a/src/rpcsvc/ypupd.h b/src/rpcsvc/ypupd.h
+index d07fd4d..2c57301 100644
+--- a/src/rpcsvc/ypupd.h
++++ b/src/rpcsvc/ypupd.h
+@@ -33,6 +33,7 @@
+ #ifndef __RPCSVC_YPUPD_H__
+ #define __RPCSVC_YPUPD_H__
+
++#include <sys/cdefs.h>
+ #include <features.h>
+
+ #include <rpc/rpc.h>
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch
new file mode 100644
index 000000000..e9ae51710
--- /dev/null
+++ b/poky/meta/recipes-extended/libnsl/libnsl2/0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch
@@ -0,0 +1,27 @@
+From d71cbeb3b76e54778a4d5eec6d387cce653537ca Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 9 Jun 2017 09:49:35 -0700
+Subject: [PATCH] nis_call.c: Include stdint.h for uintptr_t definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/nisplus/nis_call.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/nisplus/nis_call.c b/src/nisplus/nis_call.c
+index 1a2b90c..1dc982d 100644
+--- a/src/nisplus/nis_call.c
++++ b/src/nisplus/nis_call.c
+@@ -23,6 +23,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <string.h>
++#include <stdint.h>
+ #include <libintl.h>
+ #include <rpc/rpc.h>
+ #include <rpc/auth.h>
+--
+2.13.1
+
diff --git a/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch b/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
new file mode 100644
index 000000000..75fda4b0f
--- /dev/null
+++ b/poky/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
@@ -0,0 +1,57 @@
+From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Apr 2017 09:16:12 -0700
+Subject: [PATCH 2/2] Define glibc specific macros
+
+Check and define
+rawmemchr, __asprintf, __mempcpy, __strtok_r
+__always_inline, TEMP_FAILURE_RETRY
+
+if not existing. Helps compiling with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
+index 88cbca0..23fc20c 100644
+--- a/src/rpcsvc/nis.h
++++ b/src/rpcsvc/nis.h
+@@ -57,6 +57,34 @@ __BEGIN_DECLS
+ * <kukuk@suse.de>
+ */
+
++#ifndef rawmemchr
++#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
++#endif
++
++#ifndef __asprintf
++#define __asprintf asprintf
++#endif
++
++#ifndef __mempcpy
++#define __mempcpy mempcpy
++#endif
++
++#ifndef __strtok_r
++#define __strtok_r strtok_r
++#endif
++
++#ifndef __always_inline
++#define __always_inline __attribute__((__always_inline__))
++#endif
++
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++typeof (exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; })
++#endif
+
+ #ifndef __nis_object_h
+ #define __nis_object_h
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/libnsl/libnsl2_git.bb b/poky/meta/recipes-extended/libnsl/libnsl2_git.bb
new file mode 100644
index 000000000..a539148ca
--- /dev/null
+++ b/poky/meta/recipes-extended/libnsl/libnsl2_git.bb
@@ -0,0 +1,37 @@
+# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Library containing NIS functions using TI-RPC (IPv6 enabled)"
+DESCRIPTION = "This library contains the public client interface for NIS(YP) and NIS+\
+ it was part of glibc and now is standalone packages. it also supports IPv6"
+HOMEPAGE = "https://github.com/thkukuk/libnsl"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+SECTION = "libs"
+DEPENDS = "libtirpc"
+DEPENDS_append_libc-musl = " bsd-headers"
+
+PV = "1.0.5+git${SRCPV}"
+
+SRCREV = "dfa2f313524aff9243c4d8ce1bace73786478356"
+
+SRC_URI = "git://github.com/thkukuk/libnsl \
+ file://0001-include-sys-cdefs.h-explicitly.patch \
+ file://0002-Define-glibc-specific-macros.patch \
+ file://0001-nis_call.c-Include-stdint.h-for-uintptr_t-definition.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF += "--libdir=${libdir}/nsl --includedir=${includedir}/nsl"
+
+do_install_append() {
+ install -d ${D}${libdir}
+ mv ${D}${libdir}/nsl/pkgconfig ${D}${libdir}
+}
+
+FILES_${PN} += "${libdir}/nsl/*.so.*"
+FILES_${PN}-dev += "${includedir}/nsl ${libdir}/nsl/*.so"
+FILES_${PN}-staticdev += "${libdir}/nsl/*.a"
diff --git a/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb b/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb
new file mode 100644
index 000000000..14cc9e519
--- /dev/null
+++ b/poky/meta/recipes-extended/libpipeline/libpipeline_1.5.0.bb
@@ -0,0 +1,14 @@
+SUMMARY = "pipeline manipulation library"
+DESCRIPTION = "This is a C library for setting up and running pipelines of processes, \
+without needing to involve shell command-line parsing which is often \
+error-prone and insecure."
+HOMEPAGE = "http://libpipeline.nongnu.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/libpipeline/libpipeline-${PV}.tar.gz"
+SRC_URI[md5sum] = "b7437a5020190cfa84f09c412db38902"
+SRC_URI[sha256sum] = "0d72e12e4f2afff67fd7b9df0a24d7ba42b5a7c9211ac5b3dcccc5cd8b286f2b"
+
+inherit pkgconfig autotools
+
diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch
new file mode 100644
index 000000000..e5cb60dd5
--- /dev/null
+++ b/poky/meta/recipes-extended/libsolv/libsolv/0001-Add-fallback-fopencookie-implementation.patch
@@ -0,0 +1,251 @@
+From 47c6f1b4332a9e4935c48cca826786a6b8fe6f59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?=
+ =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?=
+ <ngompa13@gmail.com>
+Date: Wed, 11 Nov 2015 20:32:17 -0500
+Subject: [PATCH 1/2] Add fallback fopencookie() implementation
+
+In environments where neither fopencookie() nor funopen()
+are implemented, we need to provide a suitable implementation
+of fopencookie() that we can use.
+
+Alex Kanavin: rebased CMakeLists.txt change to apply to latest upstream code.
+
+Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ ext/CMakeLists.txt | 7 ++
+ ext/solv_xfopen.c | 10 +--
+ ext/solv_xfopen_fallback_fopencookie.c | 123 +++++++++++++++++++++++++++++++++
+ ext/solv_xfopen_fallback_fopencookie.h | 28 ++++++++
+ 4 files changed, 164 insertions(+), 4 deletions(-)
+ create mode 100644 ext/solv_xfopen_fallback_fopencookie.c
+ create mode 100644 ext/solv_xfopen_fallback_fopencookie.h
+
+diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
+index b8917a2..fac6c32 100644
+--- a/ext/CMakeLists.txt
++++ b/ext/CMakeLists.txt
+@@ -4,6 +4,13 @@ SET (libsolvext_SRCS
+ SET (libsolvext_HEADERS
+ tools_util.h solv_xfopen.h testcase.h)
+
++IF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN)
++ SET (libsolvext_SRCS ${libsolvext_SRCS}
++ solv_xfopen_fallback_fopencookie.c)
++ SET (libsolvext_HEADERS ${libsolvext_HEADERS}
++ solv_xfopen_fallback_fopencookie.h)
++ENDIF (NOT HAVE_FOPENCOOKIE AND NOT HAVE_FUNOPEN)
++
+ IF (ENABLE_RPMDB OR ENABLE_RPMPKG)
+ SET (libsolvext_SRCS ${libsolvext_SRCS}
+ pool_fileconflicts.c repo_rpmdb.c)
+diff --git a/ext/solv_xfopen.c b/ext/solv_xfopen.c
+index 2c64bb6..eb3a3ad 100644
+--- a/ext/solv_xfopen.c
++++ b/ext/solv_xfopen.c
+@@ -12,6 +12,10 @@
+ #include <string.h>
+ #include <fcntl.h>
+
++#if !defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE)
++#include "solv_xfopen_fallback_fopencookie.h"
++#endif
++
+ #include "solv_xfopen.h"
+ #include "util.h"
+
+@@ -21,7 +25,7 @@ static FILE *cookieopen(void *cookie, const char *mode,
+ ssize_t (*cwrite)(void *, const char *, size_t),
+ int (*cclose)(void *))
+ {
+-#ifdef HAVE_FUNOPEN
++#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE)
+ if (!cookie)
+ return 0;
+ return funopen(cookie,
+@@ -30,7 +34,7 @@ static FILE *cookieopen(void *cookie, const char *mode,
+ (fpos_t (*)(void *, fpos_t, int))NULL, /* seekfn */
+ cclose
+ );
+-#elif defined(HAVE_FOPENCOOKIE)
++#else
+ cookie_io_functions_t cio;
+
+ if (!cookie)
+@@ -42,8 +46,6 @@ static FILE *cookieopen(void *cookie, const char *mode,
+ cio.write = cwrite;
+ cio.close = cclose;
+ return fopencookie(cookie, *mode == 'w' ? "w" : "r", cio);
+-#else
+-# error Need to implement custom I/O
+ #endif
+ }
+
+diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c
+new file mode 100644
+index 0000000..0ce2571
+--- /dev/null
++++ b/ext/solv_xfopen_fallback_fopencookie.c
+@@ -0,0 +1,123 @@
++/*
++ * Provides a very limited fopencookie() for environments with a libc
++ * that lacks it.
++ *
++ * Author: zhasha
++ * Modified for libsolv by Neal Gompa
++ *
++ * This program is licensed under the BSD license, read LICENSE.BSD
++ * for further information.
++ *
++ */
++
++#define _LARGEFILE64_SOURCE 1
++#include <pthread.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <sys/types.h>
++#include <errno.h>
++#include "solv_xfopen_fallback_fopencookie.h"
++
++extern int pipe2(int[2], int);
++
++struct ctx {
++ int fd;
++ void *cookie;
++ struct cookie_io_functions_t io;
++ char buf[1024];
++};
++
++static void *proxy(void *arg)
++{
++ struct ctx *ctx = arg;
++ ssize_t r;
++ size_t n;
++
++ pthread_detach(pthread_self());
++
++ while (1) {
++ r = ctx->io.read ?
++ (ctx->io.read)(ctx->cookie, ctx->buf, sizeof(ctx->buf)) :
++ read(ctx->fd, ctx->buf, sizeof(ctx->buf));
++ if (r < 0) {
++ if (errno != EINTR) { break; }
++ continue;
++ }
++ if (r == 0) { break; }
++
++ while (n > 0) {
++ r = ctx->io.write ?
++ (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) :
++ write(ctx->fd, ctx->buf + ((size_t)r - n), n);
++ if (r < 0) {
++ if (errno != EINTR) { break; }
++ continue;
++ }
++ if (r == 0) { break; }
++
++ n -= (size_t)r;
++ }
++ if (n > 0) { break; }
++ }
++
++ if (ctx->io.close) { (ctx->io.close)(ctx->cookie); }
++ close(ctx->fd);
++ return NULL;
++}
++
++FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io)
++{
++ struct ctx *ctx = NULL;
++ int rd = 0, wr = 0;
++ int p[2] = { -1, -1 };
++ FILE *f = NULL;
++ pthread_t dummy;
++
++ switch (mode[0]) {
++ case 'a':
++ case 'r': rd = 1; break;
++ case 'w': wr = 1; break;
++ default:
++ errno = EINVAL;
++ return NULL;
++ }
++ switch (mode[1]) {
++ case '\0': break;
++ case '+':
++ if (mode[2] == '\0') {
++ errno = ENOTSUP;
++ return NULL;
++ }
++ default:
++ errno = EINVAL;
++ return NULL;
++ }
++ if (io.seek) {
++ errno = ENOTSUP;
++ return NULL;
++ }
++
++ ctx = malloc(sizeof(*ctx));
++ if (!ctx) { return NULL; }
++ if (pipe2(p, O_CLOEXEC) != 0) { goto err; }
++ if ((f = fdopen(p[wr], mode)) == NULL) { goto err; }
++ p[wr] = -1;
++ ctx->fd = p[rd];
++ ctx->cookie = cookie;
++ ctx->io.read = rd ? io.read : NULL;
++ ctx->io.write = wr ? io.write : NULL;
++ ctx->io.seek = NULL;
++ ctx->io.close = io.close;
++ if (pthread_create(&dummy, NULL, proxy, ctx) != 0) { goto err; }
++
++ return f;
++
++err:
++ if (p[0] >= 0) { close(p[0]); }
++ if (p[1] >= 0) { close(p[1]); }
++ if (f) { fclose(f); }
++ free(ctx);
++ return NULL;
++}
+diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h
+new file mode 100644
+index 0000000..6a7bfee
+--- /dev/null
++++ b/ext/solv_xfopen_fallback_fopencookie.h
+@@ -0,0 +1,28 @@
++/*
++ * Provides a very limited fopencookie() for environments with a libc
++ * that lacks it.
++ *
++ * Author: zhasha
++ * Modified for libsolv by Neal Gompa
++ *
++ * This program is licensed under the BSD license, read LICENSE.BSD
++ * for further information.
++ *
++ */
++
++#ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H
++#define SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H
++
++#include <stdio.h>
++#include <stdint.h>
++
++typedef struct cookie_io_functions_t {
++ ssize_t (*read)(void *, char *, size_t);
++ ssize_t (*write)(void *, const char *, size_t);
++ int (*seek)(void *, off64_t, int);
++ int (*close)(void *);
++} cookie_io_functions_t;
++
++FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t io);
++
++#endif
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch b/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch
new file mode 100644
index 000000000..93b8cc9c1
--- /dev/null
+++ b/poky/meta/recipes-extended/libsolv/libsolv/0002-Fixes-to-internal-fopencookie-implementation.patch
@@ -0,0 +1,105 @@
+From 84e12bf7ece49073c559dfd58005132a6099a964 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?=
+ =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?=
+ <ngompa13@gmail.com>
+Date: Mon, 23 Nov 2015 18:19:41 -0500
+Subject: [PATCH 2/2] Fixes to internal fopencookie() implementation
+
+Credits to the fixes go to nsz on #musl on Freenode,
+who gloriously fixed the implementation such that
+the tests all pass.
+
+Upstream-Status: Denied [https://github.com/openSUSE/libsolv/pull/112]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ ext/solv_xfopen_fallback_fopencookie.c | 19 ++++++++++---------
+ ext/solv_xfopen_fallback_fopencookie.h | 10 +++++-----
+ 2 files changed, 15 insertions(+), 14 deletions(-)
+
+diff --git a/ext/solv_xfopen_fallback_fopencookie.c b/ext/solv_xfopen_fallback_fopencookie.c
+index 0ce2571..89426a9 100644
+--- a/ext/solv_xfopen_fallback_fopencookie.c
++++ b/ext/solv_xfopen_fallback_fopencookie.c
+@@ -1,10 +1,10 @@
+-/*
++/*
+ * Provides a very limited fopencookie() for environments with a libc
+ * that lacks it.
+- *
+- * Author: zhasha
++ *
++ * Authors: zhasha & nsz
+ * Modified for libsolv by Neal Gompa
+- *
++ *
+ * This program is licensed under the BSD license, read LICENSE.BSD
+ * for further information.
+ *
+@@ -33,7 +33,7 @@ static void *proxy(void *arg)
+ {
+ struct ctx *ctx = arg;
+ ssize_t r;
+- size_t n;
++ size_t n, k;
+
+ pthread_detach(pthread_self());
+
+@@ -47,17 +47,18 @@ static void *proxy(void *arg)
+ }
+ if (r == 0) { break; }
+
++ n = r, k = 0;
+ while (n > 0) {
+ r = ctx->io.write ?
+- (ctx->io.write)(ctx->cookie, ctx->buf + ((size_t)r - n), n) :
+- write(ctx->fd, ctx->buf + ((size_t)r - n), n);
++ (ctx->io.write)(ctx->cookie, ctx->buf + k, n) :
++ write(ctx->fd, ctx->buf + k, n);
+ if (r < 0) {
+ if (errno != EINTR) { break; }
+ continue;
+ }
+ if (r == 0) { break; }
+
+- n -= (size_t)r;
++ n -= r, k += r;
+ }
+ if (n > 0) { break; }
+ }
+@@ -77,8 +78,8 @@ FILE *fopencookie(void *cookie, const char *mode, struct cookie_io_functions_t i
+
+ switch (mode[0]) {
+ case 'a':
+- case 'r': rd = 1; break;
+ case 'w': wr = 1; break;
++ case 'r': rd = 1; break;
+ default:
+ errno = EINVAL;
+ return NULL;
+diff --git a/ext/solv_xfopen_fallback_fopencookie.h b/ext/solv_xfopen_fallback_fopencookie.h
+index 6a7bfee..7223e3f 100644
+--- a/ext/solv_xfopen_fallback_fopencookie.h
++++ b/ext/solv_xfopen_fallback_fopencookie.h
+@@ -1,13 +1,13 @@
+-/*
++/*
+ * Provides a very limited fopencookie() for environments with a libc
+ * that lacks it.
+- *
+- * Author: zhasha
++ *
++ * Authors: zhasha & nsz
+ * Modified for libsolv by Neal Gompa
+- *
++ *
+ * This program is licensed under the BSD license, read LICENSE.BSD
+ * for further information.
+- *
++ *
+ */
+
+ #ifndef SOLV_XFOPEN_FALLBACK_FOPENCOOKIE_H
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb b/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb
new file mode 100644
index 000000000..0401ced24
--- /dev/null
+++ b/poky/meta/recipes-extended/libsolv/libsolv_0.6.33.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Library for solving packages and reading repositories"
+HOMEPAGE = "https://github.com/openSUSE/libsolv"
+BUGTRACKER = "https://github.com/openSUSE/libsolv/issues"
+SECTION = "devel"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
+
+DEPENDS = "expat zlib rpm"
+
+SRC_URI = "git://github.com/openSUSE/libsolv.git \
+ "
+SRC_URI_append_libc-musl = " file://0001-Add-fallback-fopencookie-implementation.patch \
+ file://0002-Fixes-to-internal-fopencookie-implementation.patch \
+ "
+
+SRCREV = "69f1803978ba7a46a57928fa4be6430792419e4e"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB=${baselib} -DMULTI_SEMANTICS=ON -DENABLE_RPMMD=ON -DENABLE_RPMDB=ON -DENABLE_COMPLEX_DEPS=ON"
+
+PACKAGES =+ "${PN}-tools ${PN}ext"
+
+FILES_${PN}-tools = "${bindir}/*"
+FILES_${PN}ext = "${libdir}/${PN}ext.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch
new file mode 100644
index 000000000..7e3e2f86a
--- /dev/null
+++ b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-include-stdint.h-for-uintptr_t.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From acb9a37977cf0a9630eac74af9adebf35e38e719 Mon Sep 17 00:00:00 2001
+From: Thorsten Kukuk <kukuk@thkukuk.de>
+Date: Tue, 14 Nov 2017 10:39:08 -0500
+Subject: [PATCH] Include stdint.h from xdr_sizeof.c to avoid missing
+ declaration errors.
+
+Signed-off-by: Thorsten Kukuk <kukuk@suse.de>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ src/xdr_sizeof.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/xdr_sizeof.c b/src/xdr_sizeof.c
+index d23fbd1..79d6707 100644
+--- a/src/xdr_sizeof.c
++++ b/src/xdr_sizeof.c
+@@ -39,6 +39,7 @@
+ #include <rpc/xdr.h>
+ #include <sys/types.h>
+ #include <stdlib.h>
++#include <stdint.h>
+ #include "un-namespace.h"
+
+ /* ARGSUSED */
+--
+1.8.3.1
diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch
new file mode 100644
index 000000000..7ae19cb31
--- /dev/null
+++ b/poky/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 5356b63005e9d8169e0399cb76f26fbd29a78dee Mon Sep 17 00:00:00 2001
+From: Joshua Kinard <kumba@gentoo.org>
+Date: Wed, 23 Aug 2017 14:31:36 -0400
+Subject: [PATCH] Replace bzero() calls with equivalent memset() calls
+
+As annotated in the bzero(3) man page, bzero() was marked as LEGACY in
+POSIX.1-2001 and removed in POSIX.1-2008, and should be replaced with
+memset() calls to write zeros to a memory region. The attached patch
+replaces two bzero() calls and one __bzero() call in libtirpc with
+equivalent memset() calls. The latter replacement fixes a compile error
+under uclibc-ng, which lacks a definition for __bzero()
+
+Signed-off-by: Joshua Kinard <kumba@gentoo.org>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ src/auth_time.c | 2 +-
+ src/des_impl.c | 2 +-
+ src/svc_auth_des.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/auth_time.c b/src/auth_time.c
+index 7f83ab4..69400bc 100644
+--- a/src/auth_time.c
++++ b/src/auth_time.c
+@@ -317,7 +317,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
+ sprintf(ipuaddr, "%d.%d.%d.%d.0.111", a1, a2, a3, a4);
+ useua = &ipuaddr[0];
+
+- bzero((char *)&sin, sizeof(sin));
++ memset(&sin, 0, sizeof(sin));
+ if (uaddr_to_sockaddr(useua, &sin)) {
+ msg("unable to translate uaddr to sockaddr.");
+ if (needfree)
+diff --git a/src/des_impl.c b/src/des_impl.c
+index 9dbccaf..15bec2a 100644
+--- a/src/des_impl.c
++++ b/src/des_impl.c
+@@ -588,7 +588,7 @@ _des_crypt (char *buf, unsigned len, struct desparams *desp)
+ }
+ tin0 = tin1 = tout0 = tout1 = xor0 = xor1 = 0;
+ tbuf[0] = tbuf[1] = 0;
+- __bzero (schedule, sizeof (schedule));
++ memset (schedule, 0, sizeof (schedule));
+
+ return (1);
+ }
+diff --git a/src/svc_auth_des.c b/src/svc_auth_des.c
+index 2e90146..19a7c60 100644
+--- a/src/svc_auth_des.c
++++ b/src/svc_auth_des.c
+@@ -356,7 +356,7 @@ cache_init()
+
+ authdes_cache = (struct cache_entry *)
+ mem_alloc(sizeof(struct cache_entry) * AUTHDES_CACHESZ);
+- bzero((char *)authdes_cache,
++ memset(authdes_cache, 0,
+ sizeof(struct cache_entry) * AUTHDES_CACHESZ);
+
+ authdes_lru = (short *)mem_alloc(sizeof(short) * AUTHDES_CACHESZ);
+--
+1.8.3.1
diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
new file mode 100644
index 000000000..f93223feb
--- /dev/null
+++ b/poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
@@ -0,0 +1,878 @@
+musl does not provide sys/queue.h implementation. Borrow queue.h from
+the NetBSD project
+http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.68
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libtirpc-1.0.1-orig/src/clnt_bcast.c libtirpc-1.0.1/src/clnt_bcast.c
+--- libtirpc-1.0.1-orig/src/clnt_bcast.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/clnt_bcast.c 2015-12-21 17:03:52.066008311 +0200
+@@ -40,7 +40,6 @@
+ */
+ #include <sys/socket.h>
+ #include <sys/types.h>
+-#include <sys/queue.h>
+
+ #include <net/if.h>
+ #include <netinet/in.h>
+@@ -62,6 +61,7 @@
+ #include <err.h>
+ #include <string.h>
+
++#include "queue.h"
+ #include "rpc_com.h"
+ #include "debug.h"
+
+diff -Naur libtirpc-1.0.1-orig/tirpc/queue.h libtirpc-1.0.1/tirpc/queue.h
+--- libtirpc-1.0.1-orig/tirpc/queue.h 1970-01-01 02:00:00.000000000 +0200
++++ libtirpc-1.0.1/tirpc/queue.h 2015-12-21 17:02:44.427853905 +0200
+@@ -0,0 +1,846 @@
++/* $NetBSD: queue.h,v 1.68 2014/11/19 08:10:01 uebayasi Exp $ */
++
++/*
++ * Copyright (c) 1991, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)queue.h 8.5 (Berkeley) 8/20/94
++ */
++
++#ifndef _SYS_QUEUE_H_
++#define _SYS_QUEUE_H_
++
++/*
++ * This file defines five types of data structures: singly-linked lists,
++ * lists, simple queues, tail queues, and circular queues.
++ *
++ * A singly-linked list is headed by a single forward pointer. The
++ * elements are singly linked for minimum space and pointer manipulation
++ * overhead at the expense of O(n) removal for arbitrary elements. New
++ * elements can be added to the list after an existing element or at the
++ * head of the list. Elements being removed from the head of the list
++ * should use the explicit macro for this purpose for optimum
++ * efficiency. A singly-linked list may only be traversed in the forward
++ * direction. Singly-linked lists are ideal for applications with large
++ * datasets and few or no removals or for implementing a LIFO queue.
++ *
++ * A list is headed by a single forward pointer (or an array of forward
++ * pointers for a hash table header). The elements are doubly linked
++ * so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before
++ * or after an existing element or at the head of the list. A list
++ * may only be traversed in the forward direction.
++ *
++ * A simple queue is headed by a pair of pointers, one the head of the
++ * list and the other to the tail of the list. The elements are singly
++ * linked to save space, so elements can only be removed from the
++ * head of the list. New elements can be added to the list after
++ * an existing element, at the head of the list, or at the end of the
++ * list. A simple queue may only be traversed in the forward direction.
++ *
++ * A tail queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or
++ * after an existing element, at the head of the list, or at the end of
++ * the list. A tail queue may be traversed in either direction.
++ *
++ * A circle queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or after
++ * an existing element, at the head of the list, or at the end of the list.
++ * A circle queue may be traversed in either direction, but has a more
++ * complex end of list detection.
++ *
++ * For details on the use of these macros, see the queue(3) manual page.
++ */
++
++/*
++ * Include the definition of NULL only on NetBSD because sys/null.h
++ * is not available elsewhere. This conditional makes the header
++ * portable and it can simply be dropped verbatim into any system.
++ * The caveat is that on other systems some other header
++ * must provide NULL before the macros can be used.
++ */
++#ifdef __NetBSD__
++#include <sys/null.h>
++#endif
++
++#if defined(QUEUEDEBUG)
++# if defined(_KERNEL)
++# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__)
++# else
++# include <err.h>
++# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__)
++# endif
++#endif
++
++/*
++ * Singly-linked List definitions.
++ */
++#define SLIST_HEAD(name, type) \
++struct name { \
++ struct type *slh_first; /* first element */ \
++}
++
++#define SLIST_HEAD_INITIALIZER(head) \
++ { NULL }
++
++#define SLIST_ENTRY(type) \
++struct { \
++ struct type *sle_next; /* next element */ \
++}
++
++/*
++ * Singly-linked List access methods.
++ */
++#define SLIST_FIRST(head) ((head)->slh_first)
++#define SLIST_END(head) NULL
++#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
++#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
++
++#define SLIST_FOREACH(var, head, field) \
++ for((var) = (head)->slh_first; \
++ (var) != SLIST_END(head); \
++ (var) = (var)->field.sle_next)
++
++#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = SLIST_FIRST((head)); \
++ (var) != SLIST_END(head) && \
++ ((tvar) = SLIST_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++/*
++ * Singly-linked List functions.
++ */
++#define SLIST_INIT(head) do { \
++ (head)->slh_first = SLIST_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
++ (elm)->field.sle_next = (slistelm)->field.sle_next; \
++ (slistelm)->field.sle_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_INSERT_HEAD(head, elm, field) do { \
++ (elm)->field.sle_next = (head)->slh_first; \
++ (head)->slh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE_AFTER(slistelm, field) do { \
++ (slistelm)->field.sle_next = \
++ SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE_HEAD(head, field) do { \
++ (head)->slh_first = (head)->slh_first->field.sle_next; \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE(head, elm, type, field) do { \
++ if ((head)->slh_first == (elm)) { \
++ SLIST_REMOVE_HEAD((head), field); \
++ } \
++ else { \
++ struct type *curelm = (head)->slh_first; \
++ while(curelm->field.sle_next != (elm)) \
++ curelm = curelm->field.sle_next; \
++ curelm->field.sle_next = \
++ curelm->field.sle_next->field.sle_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++
++/*
++ * List definitions.
++ */
++#define LIST_HEAD(name, type) \
++struct name { \
++ struct type *lh_first; /* first element */ \
++}
++
++#define LIST_HEAD_INITIALIZER(head) \
++ { NULL }
++
++#define LIST_ENTRY(type) \
++struct { \
++ struct type *le_next; /* next element */ \
++ struct type **le_prev; /* address of previous next element */ \
++}
++
++/*
++ * List access methods.
++ */
++#define LIST_FIRST(head) ((head)->lh_first)
++#define LIST_END(head) NULL
++#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head))
++#define LIST_NEXT(elm, field) ((elm)->field.le_next)
++
++#define LIST_FOREACH(var, head, field) \
++ for ((var) = ((head)->lh_first); \
++ (var) != LIST_END(head); \
++ (var) = ((var)->field.le_next))
++
++#define LIST_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = LIST_FIRST((head)); \
++ (var) != LIST_END(head) && \
++ ((tvar) = LIST_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++#define LIST_MOVE(head1, head2) do { \
++ LIST_INIT((head2)); \
++ if (!LIST_EMPTY((head1))) { \
++ (head2)->lh_first = (head1)->lh_first; \
++ LIST_INIT((head1)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++/*
++ * List functions.
++ */
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \
++ if ((head)->lh_first && \
++ (head)->lh_first->field.le_prev != &(head)->lh_first) \
++ QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_LIST_OP(elm, field) \
++ if ((elm)->field.le_next && \
++ (elm)->field.le_next->field.le_prev != \
++ &(elm)->field.le_next) \
++ QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \
++ __FILE__, __LINE__); \
++ if (*(elm)->field.le_prev != (elm)) \
++ QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
++ (elm)->field.le_next = (void *)1L; \
++ (elm)->field.le_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
++#define QUEUEDEBUG_LIST_OP(elm, field)
++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
++#endif
++
++#define LIST_INIT(head) do { \
++ (head)->lh_first = LIST_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_AFTER(listelm, elm, field) do { \
++ QUEUEDEBUG_LIST_OP((listelm), field) \
++ if (((elm)->field.le_next = (listelm)->field.le_next) != \
++ LIST_END(head)) \
++ (listelm)->field.le_next->field.le_prev = \
++ &(elm)->field.le_next; \
++ (listelm)->field.le_next = (elm); \
++ (elm)->field.le_prev = &(listelm)->field.le_next; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
++ QUEUEDEBUG_LIST_OP((listelm), field) \
++ (elm)->field.le_prev = (listelm)->field.le_prev; \
++ (elm)->field.le_next = (listelm); \
++ *(listelm)->field.le_prev = (elm); \
++ (listelm)->field.le_prev = &(elm)->field.le_next; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
++ if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\
++ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
++ (head)->lh_first = (elm); \
++ (elm)->field.le_prev = &(head)->lh_first; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_REMOVE(elm, field) do { \
++ QUEUEDEBUG_LIST_OP((elm), field) \
++ if ((elm)->field.le_next != NULL) \
++ (elm)->field.le_next->field.le_prev = \
++ (elm)->field.le_prev; \
++ *(elm)->field.le_prev = (elm)->field.le_next; \
++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++#define LIST_REPLACE(elm, elm2, field) do { \
++ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
++ (elm2)->field.le_next->field.le_prev = \
++ &(elm2)->field.le_next; \
++ (elm2)->field.le_prev = (elm)->field.le_prev; \
++ *(elm2)->field.le_prev = (elm2); \
++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Simple queue definitions.
++ */
++#define SIMPLEQ_HEAD(name, type) \
++struct name { \
++ struct type *sqh_first; /* first element */ \
++ struct type **sqh_last; /* addr of last next element */ \
++}
++
++#define SIMPLEQ_HEAD_INITIALIZER(head) \
++ { NULL, &(head).sqh_first }
++
++#define SIMPLEQ_ENTRY(type) \
++struct { \
++ struct type *sqe_next; /* next element */ \
++}
++
++/*
++ * Simple queue access methods.
++ */
++#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
++#define SIMPLEQ_END(head) NULL
++#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head))
++#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
++
++#define SIMPLEQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->sqh_first); \
++ (var) != SIMPLEQ_END(head); \
++ (var) = ((var)->field.sqe_next))
++
++#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \
++ for ((var) = ((head)->sqh_first); \
++ (var) != SIMPLEQ_END(head) && \
++ ((next = ((var)->field.sqe_next)), 1); \
++ (var) = (next))
++
++/*
++ * Simple queue functions.
++ */
++#define SIMPLEQ_INIT(head) do { \
++ (head)->sqh_first = NULL; \
++ (head)->sqh_last = &(head)->sqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
++ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++ (head)->sqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
++ (elm)->field.sqe_next = NULL; \
++ *(head)->sqh_last = (elm); \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++ (listelm)->field.sqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
++ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
++ (head)->sqh_last = &(head)->sqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \
++ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
++ == NULL) \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
++ if ((head)->sqh_first == (elm)) { \
++ SIMPLEQ_REMOVE_HEAD((head), field); \
++ } else { \
++ struct type *curelm = (head)->sqh_first; \
++ while (curelm->field.sqe_next != (elm)) \
++ curelm = curelm->field.sqe_next; \
++ if ((curelm->field.sqe_next = \
++ curelm->field.sqe_next->field.sqe_next) == NULL) \
++ (head)->sqh_last = &(curelm)->field.sqe_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_CONCAT(head1, head2) do { \
++ if (!SIMPLEQ_EMPTY((head2))) { \
++ *(head1)->sqh_last = (head2)->sqh_first; \
++ (head1)->sqh_last = (head2)->sqh_last; \
++ SIMPLEQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_LAST(head, type, field) \
++ (SIMPLEQ_EMPTY((head)) ? \
++ NULL : \
++ ((struct type *)(void *) \
++ ((char *)((head)->sqh_last) - offsetof(struct type, field))))
++
++/*
++ * Tail queue definitions.
++ */
++#define _TAILQ_HEAD(name, type, qual) \
++struct name { \
++ qual type *tqh_first; /* first element */ \
++ qual type *qual *tqh_last; /* addr of last next element */ \
++}
++#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
++
++#define TAILQ_HEAD_INITIALIZER(head) \
++ { TAILQ_END(head), &(head).tqh_first }
++
++#define _TAILQ_ENTRY(type, qual) \
++struct { \
++ qual type *tqe_next; /* next element */ \
++ qual type *qual *tqe_prev; /* address of previous next element */\
++}
++#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
++
++/*
++ * Tail queue access methods.
++ */
++#define TAILQ_FIRST(head) ((head)->tqh_first)
++#define TAILQ_END(head) (NULL)
++#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
++#define TAILQ_LAST(head, headname) \
++ (*(((struct headname *)((head)->tqh_last))->tqh_last))
++#define TAILQ_PREV(elm, headname, field) \
++ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
++#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head))
++
++
++#define TAILQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->tqh_first); \
++ (var) != TAILQ_END(head); \
++ (var) = ((var)->field.tqe_next))
++
++#define TAILQ_FOREACH_SAFE(var, head, field, next) \
++ for ((var) = ((head)->tqh_first); \
++ (var) != TAILQ_END(head) && \
++ ((next) = TAILQ_NEXT(var, field), 1); (var) = (next))
++
++#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
++ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));\
++ (var) != TAILQ_END(head); \
++ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
++
++#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \
++ for ((var) = TAILQ_LAST((head), headname); \
++ (var) != TAILQ_END(head) && \
++ ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev))
++
++/*
++ * Tail queue functions.
++ */
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
++ if ((head)->tqh_first && \
++ (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
++ QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
++ if (*(head)->tqh_last != NULL) \
++ QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_OP(elm, field) \
++ if ((elm)->field.tqe_next && \
++ (elm)->field.tqe_next->field.tqe_prev != \
++ &(elm)->field.tqe_next) \
++ QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \
++ __FILE__, __LINE__); \
++ if (*(elm)->field.tqe_prev != (elm)) \
++ QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
++ if ((elm)->field.tqe_next == NULL && \
++ (head)->tqh_last != &(elm)->field.tqe_next) \
++ QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\
++ (head), (elm), __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
++ (elm)->field.tqe_next = (void *)1L; \
++ (elm)->field.tqe_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
++#define QUEUEDEBUG_TAILQ_OP(elm, field)
++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
++#endif
++
++#define TAILQ_INIT(head) do { \
++ (head)->tqh_first = TAILQ_END(head); \
++ (head)->tqh_last = &(head)->tqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
++ if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\
++ (head)->tqh_first->field.tqe_prev = \
++ &(elm)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++ (head)->tqh_first = (elm); \
++ (elm)->field.tqe_prev = &(head)->tqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_TAIL(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
++ (elm)->field.tqe_next = TAILQ_END(head); \
++ (elm)->field.tqe_prev = (head)->tqh_last; \
++ *(head)->tqh_last = (elm); \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ QUEUEDEBUG_TAILQ_OP((listelm), field) \
++ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \
++ TAILQ_END(head)) \
++ (elm)->field.tqe_next->field.tqe_prev = \
++ &(elm)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++ (listelm)->field.tqe_next = (elm); \
++ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
++ QUEUEDEBUG_TAILQ_OP((listelm), field) \
++ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
++ (elm)->field.tqe_next = (listelm); \
++ *(listelm)->field.tqe_prev = (elm); \
++ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_REMOVE(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
++ QUEUEDEBUG_TAILQ_OP((elm), field) \
++ if (((elm)->field.tqe_next) != TAILQ_END(head)) \
++ (elm)->field.tqe_next->field.tqe_prev = \
++ (elm)->field.tqe_prev; \
++ else \
++ (head)->tqh_last = (elm)->field.tqe_prev; \
++ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_REPLACE(head, elm, elm2, field) do { \
++ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \
++ TAILQ_END(head)) \
++ (elm2)->field.tqe_next->field.tqe_prev = \
++ &(elm2)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm2)->field.tqe_next; \
++ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
++ *(elm2)->field.tqe_prev = (elm2); \
++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_CONCAT(head1, head2, field) do { \
++ if (!TAILQ_EMPTY(head2)) { \
++ *(head1)->tqh_last = (head2)->tqh_first; \
++ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
++ (head1)->tqh_last = (head2)->tqh_last; \
++ TAILQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Singly-linked Tail queue declarations.
++ */
++#define STAILQ_HEAD(name, type) \
++struct name { \
++ struct type *stqh_first; /* first element */ \
++ struct type **stqh_last; /* addr of last next element */ \
++}
++
++#define STAILQ_HEAD_INITIALIZER(head) \
++ { NULL, &(head).stqh_first }
++
++#define STAILQ_ENTRY(type) \
++struct { \
++ struct type *stqe_next; /* next element */ \
++}
++
++/*
++ * Singly-linked Tail queue access methods.
++ */
++#define STAILQ_FIRST(head) ((head)->stqh_first)
++#define STAILQ_END(head) NULL
++#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
++#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head))
++
++/*
++ * Singly-linked Tail queue functions.
++ */
++#define STAILQ_INIT(head) do { \
++ (head)->stqh_first = NULL; \
++ (head)->stqh_last = &(head)->stqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_HEAD(head, elm, field) do { \
++ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++ (head)->stqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_TAIL(head, elm, field) do { \
++ (elm)->field.stqe_next = NULL; \
++ *(head)->stqh_last = (elm); \
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++ (listelm)->field.stqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE_HEAD(head, field) do { \
++ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
++ (head)->stqh_last = &(head)->stqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE(head, elm, type, field) do { \
++ if ((head)->stqh_first == (elm)) { \
++ STAILQ_REMOVE_HEAD((head), field); \
++ } else { \
++ struct type *curelm = (head)->stqh_first; \
++ while (curelm->field.stqe_next != (elm)) \
++ curelm = curelm->field.stqe_next; \
++ if ((curelm->field.stqe_next = \
++ curelm->field.stqe_next->field.stqe_next) == NULL) \
++ (head)->stqh_last = &(curelm)->field.stqe_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->stqh_first); \
++ (var); \
++ (var) = ((var)->field.stqe_next))
++
++#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = STAILQ_FIRST((head)); \
++ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++#define STAILQ_CONCAT(head1, head2) do { \
++ if (!STAILQ_EMPTY((head2))) { \
++ *(head1)->stqh_last = (head2)->stqh_first; \
++ (head1)->stqh_last = (head2)->stqh_last; \
++ STAILQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_LAST(head, type, field) \
++ (STAILQ_EMPTY((head)) ? \
++ NULL : \
++ ((struct type *)(void *) \
++ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
++
++
++#ifndef _KERNEL
++/*
++ * Circular queue definitions. Do not use. We still keep the macros
++ * for compatibility but because of pointer aliasing issues their use
++ * is discouraged!
++ */
++
++/*
++ * __launder_type(): We use this ugly hack to work around the the compiler
++ * noticing that two types may not alias each other and elide tests in code.
++ * We hit this in the CIRCLEQ macros when comparing 'struct name *' and
++ * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC
++ * 4.8) declare these comparisons as always false, causing the code to
++ * not run as designed.
++ *
++ * This hack is only to be used for comparisons and thus can be fully const.
++ * Do not use for assignment.
++ *
++ * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix
++ * this by changing the head/tail sentinal values, but see the note above
++ * this one.
++ */
++static __inline const void * __launder_type(const void *);
++static __inline const void *
++__launder_type(const void *__x)
++{
++ __asm __volatile("" : "+r" (__x));
++ return __x;
++}
++
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \
++ if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \
++ (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \
++ __FILE__, __LINE__); \
++ if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \
++ (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \
++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \
++ if ((head)->cqh_last != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } else { \
++ if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } \
++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \
++ if ((head)->cqh_first != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } else { \
++ if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ }
++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \
++ (elm)->field.cqe_next = (void *)1L; \
++ (elm)->field.cqe_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field)
++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field)
++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field)
++#endif
++
++#define CIRCLEQ_HEAD(name, type) \
++struct name { \
++ struct type *cqh_first; /* first element */ \
++ struct type *cqh_last; /* last element */ \
++}
++
++#define CIRCLEQ_HEAD_INITIALIZER(head) \
++ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
++
++#define CIRCLEQ_ENTRY(type) \
++struct { \
++ struct type *cqe_next; /* next element */ \
++ struct type *cqe_prev; /* previous element */ \
++}
++
++/*
++ * Circular queue functions.
++ */
++#define CIRCLEQ_INIT(head) do { \
++ (head)->cqh_first = CIRCLEQ_END(head); \
++ (head)->cqh_last = CIRCLEQ_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
++ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
++ (elm)->field.cqe_prev = (listelm); \
++ if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm); \
++ else \
++ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
++ (listelm)->field.cqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
++ (elm)->field.cqe_next = (listelm); \
++ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
++ if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm); \
++ else \
++ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
++ (listelm)->field.cqe_prev = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ (elm)->field.cqe_next = (head)->cqh_first; \
++ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
++ if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm); \
++ else \
++ (head)->cqh_first->field.cqe_prev = (elm); \
++ (head)->cqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ (elm)->field.cqe_next = CIRCLEQ_END(head); \
++ (elm)->field.cqe_prev = (head)->cqh_last; \
++ if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm); \
++ else \
++ (head)->cqh_last->field.cqe_next = (elm); \
++ (head)->cqh_last = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_REMOVE(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \
++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm)->field.cqe_prev; \
++ else \
++ (elm)->field.cqe_next->field.cqe_prev = \
++ (elm)->field.cqe_prev; \
++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm)->field.cqe_next; \
++ else \
++ (elm)->field.cqe_prev->field.cqe_next = \
++ (elm)->field.cqe_next; \
++ QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->cqh_first); \
++ (var) != CIRCLEQ_ENDC(head); \
++ (var) = ((var)->field.cqe_next))
++
++#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
++ for ((var) = ((head)->cqh_last); \
++ (var) != CIRCLEQ_ENDC(head); \
++ (var) = ((var)->field.cqe_prev))
++
++/*
++ * Circular queue access methods.
++ */
++#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
++#define CIRCLEQ_LAST(head) ((head)->cqh_last)
++/* For comparisons */
++#define CIRCLEQ_ENDC(head) (__launder_type(head))
++/* For assignments */
++#define CIRCLEQ_END(head) ((void *)(head))
++#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
++#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
++#define CIRCLEQ_EMPTY(head) \
++ (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head))
++
++#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
++ (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ ? ((head)->cqh_first) \
++ : (elm->field.cqe_next))
++#define CIRCLEQ_LOOP_PREV(head, elm, field) \
++ (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ ? ((head)->cqh_last) \
++ : (elm->field.cqe_prev))
++#endif /* !_KERNEL */
++
++#endif /* !_SYS_QUEUE_H_ */
diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch b/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch
new file mode 100644
index 000000000..d7f496866
--- /dev/null
+++ b/poky/meta/recipes-extended/libtirpc/libtirpc/export_key_secretkey_is_set.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From e51d67549b516b2dac6c71d92c8499f6e67125ad Mon Sep 17 00:00:00 2001
+From: Thorsten Kukuk <kukuk@thkukuk.de>
+Date: Tue, 14 Nov 2017 10:43:53 -0500
+Subject: [PATCH] Fix typo in src/libtirpc.map
+
+Which prevents that key_secretkey_is_set will be exported.
+
+Signed-off-by: Thorsten Kukuk <kukuk@suse.de>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ src/libtirpc.map | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libtirpc.map b/src/libtirpc.map
+index f385de5..21d6065 100644
+--- a/src/libtirpc.map
++++ b/src/libtirpc.map
+@@ -298,7 +298,7 @@ TIRPC_0.3.2 {
+ key_gendes;
+ key_get_conv;
+ key_setsecret;
+- key_secret_is_set;
++ key_secretkey_is_set;
+ key_setnet;
+ netname2host;
+ netname2user;
+--
+1.8.3.1
diff --git a/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb b/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb
new file mode 100644
index 000000000..99212600e
--- /dev/null
+++ b/poky/meta/recipes-extended/libtirpc/libtirpc_1.0.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Transport-Independent RPC library"
+DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux"
+SECTION = "libs/network"
+HOMEPAGE = "http://sourceforge.net/projects/libtirpc/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \
+ file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+PROVIDES = "virtual/librpc"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+ file://export_key_secretkey_is_set.patch \
+ file://0001-replace-__bzero-with-memset-API.patch \
+ file://0001-include-stdint.h-for-uintptr_t.patch \
+ "
+
+SRC_URI_append_libc-musl = " \
+ file://Use-netbsd-queue.h.patch \
+ "
+
+SRC_URI[md5sum] = "d5a37f1dccec484f9cabe2b97e54e9a6"
+SRC_URI[sha256sum] = "723c5ce92706cbb601a8db09110df1b4b69391643158f20ff587e20e7c5f90f5"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-gssapi"
+
+do_install_append() {
+ chown root:root ${D}${sysconfdir}/netconfig
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch b/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
new file mode 100644
index 000000000..79756b9a0
--- /dev/null
+++ b/poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
@@ -0,0 +1,62 @@
+From d0537cb7f2dc5877700ad78dfd191515379d4edc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 02:22:51 +0000
+Subject: [PATCH 1/2] Check for issetugid()
+
+If secure version of getenv is not there then we can use
+issetugid() as aid to call getenv()
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 1 +
+ lib/config.c | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1ded1a2..ee19e1f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -125,6 +125,7 @@ AC_TYPE_OFF_T
+ AC_TYPE_SIZE_T
+
+ AC_CHECK_FUNCS([__secure_getenv secure_getenv])
++AC_CHECK_FUNCS([issetugid])
+
+ # Modify CFLAGS after all tests are run (some of them could fail because
+ # of the -Werror).
+diff --git a/lib/config.c b/lib/config.c
+index 29e7120..30f9daf 100644
+--- a/lib/config.c
++++ b/lib/config.c
+@@ -44,8 +44,10 @@
+ # define safe_getenv(string) secure_getenv(string)
+ #elif defined(HAVE___SECURE_GETENV)
+ # define safe_getenv(string) __secure_getenv(string)
++#elif defined(HAVE_ISSETUGID)
++# define safe_getenv(string) safe_getenv_issetugid(string)
+ #else
+-# error Neither secure_getenv not __secure_getenv are available
++# error None of secure_getenv, __secure_getenv, or issetugid is available
+ #endif
+
+ struct config_config {
+@@ -59,6 +61,14 @@ struct config_key {
+ GList *values;
+ };
+
++static const char*
++safe_getenv_issetugid(const char* name)
++{
++ if (issetugid ())
++ return 0;
++ return getenv (name);
++}
++
+ /* Compare two section names */
+ static int
+ compare_section_names(gconstpointer a, gconstpointer b)
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch b/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch
new file mode 100644
index 000000000..7c47df22e
--- /dev/null
+++ b/poky/meta/recipes-extended/libuser/libuser/0001-modules-files.c-parse_field-fix-string-formating-in-.patch
@@ -0,0 +1,34 @@
+From a4857911ece5ebfcdef42aee4c070eb216f39597 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Fri, 13 May 2016 11:40:13 -0500
+Subject: [PATCH] modules/files.c: parse_field fix string formating in
+ g_warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[YOCTO #9547]
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ modules/files.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/files.c b/modules/files.c
+index 4ef0a57..35eafc9 100644
+--- a/modules/files.c
++++ b/modules/files.c
+@@ -534,7 +534,7 @@ parse_field(const struct format_specifier *format, GValue *value,
+ string, &err);
+ if (ret == FALSE) {
+ g_assert(err != NULL);
+- g_warning(lu_strerror(err));
++ g_warning(lu_strerror(err), NULL);
+ lu_error_free(&err);
+ }
+ return ret;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch b/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
new file mode 100644
index 000000000..4bc0219f1
--- /dev/null
+++ b/poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
@@ -0,0 +1,27 @@
+From 4b2f81f307ffeac12956e5c16e894e5ebb937ea5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 02:26:00 +0000
+Subject: [PATCH 2/2] remove unused execinfo.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ lib/error.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/lib/error.c b/lib/error.c
+index a5ec30a..443e601 100644
+--- a/lib/error.c
++++ b/lib/error.c
+@@ -18,7 +18,6 @@
+ #include <config.h>
+ #include <sys/types.h>
+ #include <errno.h>
+-#include <execinfo.h>
+ #include <libintl.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/libuser/libuser_0.62.bb b/poky/meta/recipes-extended/libuser/libuser_0.62.bb
new file mode 100644
index 000000000..7ec54eb16
--- /dev/null
+++ b/poky/meta/recipes-extended/libuser/libuser_0.62.bb
@@ -0,0 +1,35 @@
+SUMMARY = "user and group account administration library"
+DESCRIPTION = "The libuser library implements a standardized interface for manipulating and administering user \
+and group accounts"
+HOMEPAGE = "https://pagure.io/libuser"
+BUGTRACKER = "https://pagure.io/libuser/issues"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+ file://lib/user.h;endline=19;md5=76b301f63c39fa992062395efbdc9558 \
+ file://samples/testuser.c;endline=19;md5=3b87fa660fa3f4a6bb31d624afe30ba1"
+
+SECTION = "base"
+
+SRC_URI = "https://releases.pagure.org/libuser/libuser-${PV}.tar.xz \
+ file://0001-Check-for-issetugid.patch \
+ file://0002-remove-unused-execinfo.h.patch \
+ file://0001-modules-files.c-parse_field-fix-string-formating-in-.patch \
+ "
+
+SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
+SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
+
+DEPENDS = "popt libpam glib-2.0 python3"
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "pam"
+
+inherit autotools gettext python3native python3-dir pkgconfig gtk-doc
+
+EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
+
+PACKAGES += "${PN}-python "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch b/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch
new file mode 100644
index 000000000..f17bdce2c
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd/0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch
@@ -0,0 +1,42 @@
+From 22afc5d9aaa215c3c87ba21c77d47da44ab3b113 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 26 Aug 2016 18:20:32 +0300
+Subject: [PATCH] Use pkg-config for pcre dependency instead of -config script.
+
+RP 2014/5/22
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5383cec..c29a902 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -651,10 +651,18 @@ AC_ARG_WITH([pcre],
+ )
+ AC_MSG_RESULT([$WITH_PCRE])
+
+-if test "$WITH_PCRE" != no; then
+- if test "$WITH_PCRE" != yes; then
+- PCRE_LIB="-L$WITH_PCRE/lib -lpcre"
+- CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include"
++if test "$WITH_PCRE" != "no"; then
++ PKG_CHECK_MODULES(PCREPKG, [libpcre], [
++ PCRE_LIB=${PCREPKG_LIBS}
++ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
++ ], [
++ AC_MSG_ERROR([pcre pkgconfig not found, install the pcre-devel package or build with --without-pcre])
++ ])
++
++ if test x"$PCRE_LIB" != x; then
++ AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
++ AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
++ AC_SUBST(PCRE_LIB)
+ else
+ AC_PATH_PROG([PCRECONFIG], [pcre-config])
+ if test -n "$PCRECONFIG"; then
+--
+2.15.0
+
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd b/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
new file mode 100644
index 000000000..f5f1c377b
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
@@ -0,0 +1 @@
+<html><body><h1>It works!</h1></body></html>
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd
new file mode 100644
index 000000000..bf89a60b7
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/lighttpd
+NAME=lighttpd
+DESC="Lighttpd Web Server"
+OPTS="-f /etc/lighttpd.conf"
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ start-stop-daemon --start -x "$DAEMON" -- $OPTS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon --stop -x "$DAEMON"
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop -x "$DAEMON"
+ sleep 1
+ start-stop-daemon --start -x "$DAEMON" -- $OPTS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
new file mode 100644
index 000000000..6e8402d24
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
@@ -0,0 +1,331 @@
+# lighttpd configuration file
+#
+# use it as a base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+ "mod_access",
+# "mod_cml",
+# "mod_trigger_b4_dl",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_fastcgi",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_userdir",
+# "mod_cgi",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire",
+# "mod_secdownload",
+# "mod_rrdtool",
+# "mod_webdav",
+ "mod_accesslog" )
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/www/pages/"
+
+## where to send error-messages to
+server.errorlog = "/www/logs/lighttpd.error.log"
+
+# files to check for if .../ is requested
+index-file.names = ( "index.php", "index.html",
+ "index.htm", "default.htm" )
+
+## set the event-handler (read the performance section in the manual)
+# server.event-handler = "freebsd-kqueue" # needed on OS X
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".cpp" => "text/plain",
+ ".log" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+#mimetype.use-xattr = "enable"
+
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+# server.tag = "lighttpd"
+
+#### accesslog module
+accesslog.filename = "/www/logs/access.log"
+debug.log-request-handling = "enable"
+
+
+
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+## to help the rc.scripts
+#server.pid-file = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot
+## or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#dir-listing.activate = "enable"
+
+## enable debugging
+#debug.log-request-header = "enable"
+#debug.log-response-header = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "wwwrun"
+
+#### compress module
+#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+
+#### fastcgi module
+## read fastcgi.txt for more info
+## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
+#fastcgi.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "socket" => "/tmp/php-fastcgi.socket",
+# "bin-path" => "/usr/local/bin/php"
+# )
+# )
+# )
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl",
+# ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "server.pem"
+
+#### status module
+#status.status-url = "/server-status"
+#status.config-url = "/server-config"
+
+#### auth module
+## read authentication.txt for more info
+#auth.backend = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+
+#auth.backend.ldap.hostname = "localhost"
+#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+#auth.backend.ldap.filter = "(uid=$)"
+
+#auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "user=jan"
+# ),
+# "/server-config" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "valid-user"
+# )
+# )
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+#evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension = ( ".shtml" )
+
+#### rrdtool
+#rrdtool.binary = "/usr/bin/rrdtool"
+#rrdtool.db-name = "/var/www/lighttpd.rrd"
+
+#### setenv
+#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+## for mod_trigger_b4_dl
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+
+## for mod_cml
+## don't forget to add index.cml to server.indexfiles
+# cml.extension = ".cml"
+# cml.memcache-hosts = ( "127.0.0.1:11211" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /etc/lighttpd/lighttpd-inc.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
+
+# include other config file fragments from lighttpd.d subdir
+include_shell "find /etc/lighttpd.d -maxdepth 1 -name '*.conf' -exec cat {} \;"
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
new file mode 100644
index 000000000..66a907aa1
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lightning Fast Webserver With Light System Requirements
+After=network.target
+
+[Service]
+ExecStartPre=@SBINDIR@/lighttpd -t -f @SYSCONFDIR@/lighttpd.conf
+ExecStart=@SBINDIR@/lighttpd -D -f @SYSCONFDIR@/lighttpd.conf
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb b/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb
new file mode 100644
index 000000000..3c4444cf4
--- /dev/null
+++ b/poky/meta/recipes-extended/lighttpd/lighttpd_1.4.48.bb
@@ -0,0 +1,85 @@
+SUMMARY = "Lightweight high-performance web server"
+HOMEPAGE = "http://www.lighttpd.net/"
+BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
+
+SECTION = "net"
+RDEPENDS_${PN} = "lighttpd-module-dirlisting \
+ lighttpd-module-indexfile \
+ lighttpd-module-staticfile"
+RRECOMMENDS_${PN} = "lighttpd-module-access \
+ lighttpd-module-accesslog"
+
+SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
+ file://index.html.lighttpd \
+ file://lighttpd.conf \
+ file://lighttpd \
+ file://lighttpd.service \
+ file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \
+ "
+
+SRC_URI[md5sum] = "1e3a9eb5078f481e3a8a1d0aaac8c3c8"
+SRC_URI[sha256sum] = "0f8ad5aac7529d7b948b9d7e8cd0b4a9e177309d85d6bf6516e28e6e40d74f36"
+
+PACKAGECONFIG ??= "openssl pcre zlib \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
+PACKAGECONFIG[mmap] = "--enable-mmap,--disable-mmap"
+PACKAGECONFIG[libev] = "--with-libev,--without-libev,libev"
+PACKAGECONFIG[mysql] = "--with-mysql,--without-mysql,mariadb"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
+PACKAGECONFIG[krb5] = "--with-krb5,--without-krb5,krb5"
+PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2"
+PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
+PACKAGECONFIG[webdav-props] = "--with-webdav-props,--without-webdav-props,libxml2 sqlite3"
+PACKAGECONFIG[webdav-locks] = "--with-webdav-locks,--without-webdav-locks,util-linux"
+PACKAGECONFIG[gdbm] = "--with-gdbm,--without-gdbm,gdbm"
+PACKAGECONFIG[memcache] = "--with-memcached,--without-memcached,libmemcached"
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,lua5.1"
+
+EXTRA_OECONF += "--enable-lfs"
+
+inherit autotools pkgconfig update-rc.d gettext systemd
+
+INITSCRIPT_NAME = "lighttpd"
+INITSCRIPT_PARAMS = "defaults 70"
+
+SYSTEMD_SERVICE_${PN} = "lighttpd.service"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
+ install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ ${D}${systemd_unitdir}/system/lighttpd.service
+ #For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
+ ln -sf ${localstatedir}/log ${D}/www/logs
+ ln -sf ${localstatedir}/tmp ${D}/www/var
+}
+
+FILES_${PN} += "${sysconfdir} /www"
+
+CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
+
+PACKAGES_DYNAMIC += "^lighttpd-module-.*"
+
+python populate_packages_prepend () {
+ lighttpd_libdir = d.expand('${libdir}')
+ do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
+}
diff --git a/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
new file mode 100644
index 000000000..04cb588db
--- /dev/null
+++ b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -0,0 +1,151 @@
+From 517cbff66c8bdbf455bc3b7c1a85a4f990d0f9a6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:08:07 -0800
+Subject: [PATCH] Act as the "mv" command when rotate log
+
+Act as the "mv" command when rotate log, first rename, if failed, then
+read and write.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 60 insertions(+), 12 deletions(-)
+
+diff --git a/logrotate.c b/logrotate.c
+index 4ad58d4..ba05884 100644
+--- a/logrotate.c
++++ b/logrotate.c
+@@ -1315,6 +1315,54 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force)
+ return 0;
+ }
+
++/* Act as the "mv" command, if rename failed, then read the old file and
++ * write to new file. The function which invokes the mvFile will use
++ * the strerror(errorno) to handle the error message, so we don't have
++ * to print the error message here */
++
++int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
++{
++ struct stat sbprev;
++ int fd_old, fd_new, n;
++ char buf[BUFSIZ];
++
++ /* Do the rename first */
++ if (!rename(oldName, newName))
++ return 0;
++
++ /* If the errno is EXDEV, then read old file, write newfile and
++ * remove the oldfile */
++ if (errno == EXDEV) {
++ /* Open the old file to read */
++ if ((fd_old = open(oldName, O_RDONLY)) < 0)
++ return 1;
++
++ /* Create the file to write, keep the same attribute as the old file */
++ if (stat(oldName, &sbprev))
++ return 1;
++ else {
++ if ((fd_new = createOutputFile(newName,
++ O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
++ return 1;
++ }
++
++ /* Read and write */
++ while ((n = read(fd_old, buf, BUFSIZ)) > 0)
++ if (write(fd_new, buf, n) != n)
++ return 1;
++
++ if ((close(fd_old) < 0) ||
++ removeLogFile(oldName, log) ||
++ (close(fd_new) < 0))
++ return 1;
++
++ return 0;
++ }
++
++ return 1;
++}
++
++
+ static int prerotateSingleLog(struct logInfo *log, int logNum,
+ struct logState *state, struct logNames *rotNames)
+ {
+@@ -1674,15 +1722,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum,
+ }
+
+ message(MESS_DEBUG,
+- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
++ "moving %s to %s (rotatecount %d, logstart %d, i %d), \n",
+ oldName, newName, rotateCount, logStart, i);
+
+- if (!debug && rename(oldName, newName)) {
++ if (!debug && mvFile(oldName, newName, log, prev_acl)) {
+ if (errno == ENOENT) {
+ message(MESS_DEBUG, "old log %s does not exist\n",
+ oldName);
+ } else {
+- message(MESS_ERROR, "error renaming %s to %s: %s\n",
++ message(MESS_ERROR, "error moving %s to %s: %s\n",
+ oldName, newName, strerror(errno));
+ hasErrors = 1;
+ }
+@@ -1767,21 +1815,21 @@ static int rotateSingleLog(struct logInfo *log, int logNum,
+ return 1;
+ }
+
+- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ tmpFilename);
+- if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) {
+- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++ if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++ message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ log->files[logNum], tmpFilename,
+ strerror(errno));
+ hasErrors = 1;
+ }
+ }
+ else {
+- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ rotNames->finalName);
+ if (!debug && !hasErrors &&
+- rename(log->files[logNum], rotNames->finalName)) {
+- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++ message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ log->files[logNum], rotNames->finalName,
+ strerror(errno));
+ hasErrors = 1;
+@@ -2170,7 +2218,7 @@ static int rotateLogSet(struct logInfo *log, int force)
+ return hasErrors;
+ }
+
+-static int writeState(const char *stateFilename)
++static int writeState(struct logInfo *log, char *stateFilename)
+ {
+ struct logState *p;
+ FILE *f;
+@@ -2322,7 +2370,7 @@ static int writeState(const char *stateFilename)
+ fclose(f);
+
+ if (error == 0) {
+- if (rename(tmpFilename, stateFilename)) {
++ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
+ unlink(tmpFilename);
+ error = 1;
+ message(MESS_ERROR, "error renaming temp state file %s\n",
+@@ -2648,7 +2696,7 @@ int main(int argc, const char **argv)
+ rc |= rotateLogSet(log, force);
+
+ if (!debug)
+- rc |= writeState(stateFile);
++ rc |= writeState(log, stateFile);
+
+ return (rc != 0);
+ }
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
new file mode 100644
index 000000000..793d70259
--- /dev/null
+++ b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
@@ -0,0 +1,32 @@
+Disable the check for different filesystems
+
+The logrotate supports rotate log across different filesystems now, so
+disable the check for different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ config.c | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/config.c b/config.c
+index dbbf563..64e66f6 100644
+--- a/config.c
++++ b/config.c
+@@ -1493,15 +1493,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ goto error;
+ }
+ }
+-
+- if (sb.st_dev != sb2.st_dev
+- && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) {
+- message(MESS_ERROR,
+- "%s:%d olddir %s and log file %s "
+- "are on different devices\n", configFile,
+- lineNum, newlog->oldDir, newlog->files[i]);
+- goto error;
+- }
+ }
+ }
+
diff --git a/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
new file mode 100644
index 000000000..725567e0c
--- /dev/null
+++ b/poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -0,0 +1,38 @@
+From bf22e8805df69344f6f20cea390e829a22fa741b Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:14:37 -0800
+Subject: [PATCH] Update the manual
+
+Update the manual for rotating on different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.8.in | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/logrotate.8.in b/logrotate.8.in
+index 951e406..581bf48 100644
+--- a/logrotate.8.in
++++ b/logrotate.8.in
+@@ -445,12 +445,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option).
+
+ .TP
+ \fBolddir \fIdirectory\fR
+-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be
+-on the same physical device as the log file being rotated, unless \fBcopy\fR,
+-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR
+-is assumed to be relative to the directory holding the log file
+-unless an absolute path name is specified. When this option is used all
+-old versions of the log end up in \fIdirectory\fR. This option may be
++Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR
++is assumed to be relative to the directory holding the log file unless
++an absolute path name is specified. When this option is used all old
++versions of the log end up in \fIdirectory\fR. This option may be
+ overridden by the \fBnoolddir\fR option.
+
+ .TP
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb b/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb
new file mode 100644
index 000000000..990cf9178
--- /dev/null
+++ b/poky/meta/recipes-extended/logrotate/logrotate_3.13.0.bb
@@ -0,0 +1,85 @@
+SUMMARY = "Rotates, compresses, removes and mails system log files"
+SECTION = "console/utils"
+HOMEPAGE = "https://github.com/logrotate/logrotate/issues"
+LICENSE = "GPLv2"
+
+# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
+
+DEPENDS="coreutils popt"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# When updating logrotate to latest upstream, SRC_URI should point to
+# a proper release tarball from https://github.com/logrotate/logrotate/releases
+# and we have to take the snapshot for now because there is no such
+# tarball available for 3.9.1.
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
+UPSTREAM_CHECK_REGEX = "logrotate-(?P<pver>\d+(\.\d+)+).tar"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz \
+ file://act-as-mv-when-rotate.patch \
+ file://update-the-manual.patch \
+ file://disable-check-different-filesystems.patch \
+ "
+
+SRC_URI[md5sum] = "78ef24d6fddcc4df8e412dd75c551b4c"
+SRC_URI[sha256sum] = "3222ca032f99be8d7a4a8c6ad69f3dcc49b9511bfe384bd5a271ebcd9bd3e52c"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}"
+
+PACKAGECONFIG[acl] = ",,acl"
+PACKAGECONFIG[selinux] = ",,libselinux"
+
+CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
+ ${sysconfdir}/logrotate.conf"
+
+# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
+# optimization variables, so use it rather than EXTRA_CFLAGS.
+EXTRA_OEMAKE = "\
+ LFS= \
+ OS_NAME='${OS_NAME}' \
+ 'CC=${CC}' \
+ 'RPM_OPT_FLAGS=${CFLAGS}' \
+ 'EXTRA_LDFLAGS=${LDFLAGS}' \
+ ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
+"
+
+# OS_NAME in the makefile defaults to `uname -s`. The behavior for
+# freebsd/netbsd is questionable, so leave it as Linux, which only sets
+# INSTALL=install and BASEDIR=/usr.
+OS_NAME = "Linux"
+
+inherit autotools systemd
+
+SYSTEMD_SERVICE_${PN} = "\
+ ${BPN}.service \
+ ${BPN}.timer \
+"
+
+LOGROTATE_SYSTEMD_TIMER_BASIS ?= "daily"
+LOGROTATE_SYSTEMD_TIMER_ACCURACY ?= "12h"
+
+do_install(){
+ oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
+ mkdir -p ${D}${sysconfdir}/logrotate.d
+ mkdir -p ${D}${localstatedir}/lib
+ install -p -m 644 ${S}/examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
+ touch ${D}${localstatedir}/lib/logrotate.status
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${S}/examples/logrotate.service ${D}${systemd_system_unitdir}/logrotate.service
+ install -m 0644 ${S}/examples/logrotate.timer ${D}${systemd_system_unitdir}/logrotate.timer
+ sed -i -e 's,OnCalendar=.*$,OnCalendar=${LOGROTATE_SYSTEMD_TIMER_BASIS},g' ${D}${systemd_system_unitdir}/logrotate.timer
+ sed -i -e 's,AccuracySec=.*$,AccuracySec=${LOGROTATE_SYSTEMD_TIMER_ACCURACY},g' ${D}${systemd_system_unitdir}/logrotate.timer
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ mkdir -p ${D}${sysconfdir}/cron.daily
+ install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
+ fi
+}
diff --git a/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch b/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch
new file mode 100644
index 000000000..017575206
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch
@@ -0,0 +1,38 @@
+From cba901945c5a6da9586550498f8e3787c57c3098 Mon Sep 17 00:00:00 2001
+From: Athanasios Oikonomou <athoik@gmail.com>
+Date: Fri, 17 Feb 2017 21:04:04 +0200
+Subject: [PATCH] fix lsb_release to work with busybox head and find
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Athanasios Oikonomou <athoik@gmail.com>
+
+diff --git a/lsb_release b/lsb_release
+index e7d6024..233b8c1 100755
+--- a/lsb_release
++++ b/lsb_release
+@@ -209,7 +209,7 @@ EASE ($DISTRIB_CODENAME)"
+ || [ -n "$(echo $DISTRIB_DESCRIPTION | \
+ sed -e "s/.*$DESCSTR_DELI.*//")" ]
+ then
+- TMP_DISTRIB_DESC=$(head -1 $FILENAME 2>/dev/null)
++ TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null)
+ [ -z "$DISTRIB_DESCRIPTION" ] \
+ && DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC
+ else
+@@ -249,10 +249,10 @@ GetDistribInfo() {
+ then
+ CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1 \
+ -name \*$INFO_DISTRIB_SUFFIX \
+- -and ! -name $INFO_LSB_FILE \
+- -and -type f \
++ -type f \
+ 2>/dev/null \
+- | head -1 ) # keep one of the files found (if many)
++ | grep -v $INFO_LSB_FILE \
++ | head -n 1 ) # keep one of the files found (if many)
+ fi
+ InitDistribInfo $CHECKFIRST
+ fi
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/lsb/lsb/init-functions b/poky/meta/recipes-extended/lsb/lsb/init-functions
new file mode 100755
index 000000000..7c1dce24c
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/init-functions
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# LSB initscript functions, as defined in the LSB Spec 1.1.0
+#
+# Lawrence Lim <llim@core.com> - Tue, 26 June 2007
+# Updated to the latest LSB 3.1 spec
+# http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic_lines.txt
+
+start_daemon () {
+ /etc/core-lsb/lsb_start_daemon "$@"
+}
+
+killproc () {
+ /etc/core-lsb/lsb_killproc "$@"
+}
+
+pidofproc () {
+ /etc/core-lsb/lsb_pidofproc "$@"
+}
+
+log_success_msg () {
+ /etc/core-lsb/lsb_log_message success "$@"
+}
+
+log_failure_msg () {
+ /etc/core-lsb/lsb_log_message failure "$@"
+}
+
+log_warning_msg () {
+ /etc/core-lsb/lsb_log_message warning "$@"
+}
+
+# int log_begin_message (char *message)
+log_begin_msg () {
+ if [ -z "$1" ]; then
+ return 1
+ fi
+ echo " * $@"
+}
+
+
+log_end_msg () {
+ /etc/core-lsb/lsb_log_message end "$@"
+}
diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_killproc b/poky/meta/recipes-extended/lsb/lsb/lsb_killproc
new file mode 100755
index 000000000..866c1a9c6
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/lsb_killproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+LSB=LSB-1.1 killproc $*
+exit $?
diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_log_message b/poky/meta/recipes-extended/lsb/lsb/lsb_log_message
new file mode 100755
index 000000000..10343b081
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/lsb_log_message
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+ACTION=$1
+shift
+
+case "$ACTION" in
+ success)
+ echo -n $*
+ success "$*"
+ echo
+ ;;
+ failure)
+ echo -n $*
+ failure "$*"
+ echo
+ ;;
+ warning)
+ echo -n $*
+ warning "$*"
+ echo
+ ;;
+ *)
+ ;;
+esac
+exit 0
diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
new file mode 100755
index 000000000..6d1fd0f24
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+pidofproc $*
+exit $?
diff --git a/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon
new file mode 100755
index 000000000..de62c2344
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+nice=
+force=
+pidfile=
+user=
+check=
+RETVAL=
+while [ "$1" != "${1##[-+]}" ]; do
+ case $1 in
+ -f)
+ force="--force"
+ shift
+ ;;
+ -n)
+ nice=$2
+ shift 2
+ ;;
+ -p)
+ pidfile="--pidfile $2"
+ shift 2
+ ;;
+ -u)
+ user="--user $2"
+ shift 2
+ ;;
+ -c)
+ check="--check $2"
+ shift 2
+ ;;
+ *)
+ echo "Unknown Option $1"
+ echo "Options are:"
+ echo "-f"
+ echo "-p {pidfile}"
+ echo "-n [+/-nicelevel]"
+ echo "-u {user}"
+ echo "-c {base}"
+ exit 1;;
+ esac
+done
+LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $*
+exit $?
diff --git a/poky/meta/recipes-extended/lsb/lsb_5.0.bb b/poky/meta/recipes-extended/lsb/lsb_5.0.bb
new file mode 100644
index 000000000..df4812e4b
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsb_5.0.bb
@@ -0,0 +1,134 @@
+SUMMARY = "LSB support for OpenEmbedded"
+SECTION = "console/utils"
+HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
+LICENSE = "GPLv2+"
+
+LSB_CORE = "lsb-core-${TARGET_ARCH}"
+LSB_CORE_x86 = "lsb-core-ia32"
+LSB_CORE_x86-64 = "lsb-core-amd64"
+RPROVIDES_${PN} += "${LSB_CORE}"
+
+# lsb_release needs getopt, lsbinitscripts
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
+
+LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
+ file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \
+ file://init-functions \
+ file://lsb_killproc \
+ file://lsb_log_message \
+ file://lsb_pidofproc \
+ file://lsb_start_daemon \
+ "
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
+SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/"
+UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/lsb-release-1.4"
+
+CLEANBROKEN = "1"
+
+do_install() {
+ oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ DESTDIR=${D}
+
+ # these two dirs are needed by package lsb-dist-checker
+ mkdir -p ${D}${sysconfdir}/opt
+ mkdir -p ${D}${localstatedir}/opt
+
+ mkdir -p ${D}${base_libdir}
+ mkdir -p ${D}${sysconfdir}/lsb-release.d
+ printf "LSB_VERSION=\"core-5.0-noarch:" > ${D}${sysconfdir}/lsb-release
+
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
+ printf "core-5.0-ia32" >> ${D}${sysconfdir}/lsb-release
+ else
+ printf "core-5.0-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release
+ fi
+ echo "\"" >> ${D}${sysconfdir}/lsb-release
+ echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release
+ echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release
+ if [ -n "${DISTRO_CODENAME}" ]; then
+ echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release
+ fi
+ echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release
+
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
+ mkdir -p ${D}${sysconfdir}/lsb-release.d
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32
+ elif [ "${TARGET_ARCH}" = "x86_64" ]; then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ]; then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32
+ elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64
+ fi
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/core-lsb
+ for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
+ do
+ install -m 0755 ${WORKDIR}/$i ${D}${sysconfdir}/core-lsb
+ done
+
+ install -d ${D}${nonarch_base_libdir}/lsb
+ install -m 0755 ${WORKDIR}/init-functions ${D}${nonarch_base_libdir}/lsb
+
+ # create links for LSB test
+ if [ -e ${sbindir}/chkconfig ]; then
+ if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ] ; then
+ install -d ${D}${nonarch_libdir}/lsb
+ fi
+ ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/install_initd
+ ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/remove_initd
+ fi
+
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
+ lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
+ fi
+ cd ${D}${base_libdir}
+ ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
+ ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
+ fi
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
+ cd ${D}${base_libdir}
+ ln -sf ld-linux.so.2 ld-lsb.so.2
+ ln -sf ld-linux.so.2 ld-lsb.so.3
+ fi
+
+ if [ "${TARGET_ARCH}" = "powerpc64" ]; then
+ if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
+ lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
+ fi
+ cd ${D}${base_libdir}
+ ln -sf ld64.so.1 ld-lsb-ppc64.so.2
+ ln -sf ld64.so.1 ld-lsb-ppc64.so.3
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ]; then
+ cd ${D}${base_libdir}
+ ln -sf ld.so.1 ld-lsb-ppc32.so.2
+ ln -sf ld.so.1 ld-lsb-ppc32.so.3
+ fi
+}
+
+FILES_${PN} += "${@'${base_prefix}/lib64' if d.getVar('TARGET_ARCH') == ('x86_64' or 'powerpc64') and '${base_libdir}' != '${base_prefix}/lib64' else ''} \
+ ${base_libdir} \
+ ${nonarch_libdir}/lsb \
+ ${nonarch_base_libdir}/lsb/* \
+ "
diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch b/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
new file mode 100644
index 000000000..c0076453f
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+Subject: functions: avoid exit 1 which causes init scripts to fail
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ rc.d/init.d/functions | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: initscripts-9.72/rc.d/init.d/functions
+===================================================================
+--- initscripts-9.72.orig/rc.d/init.d/functions
++++ initscripts-9.72/rc.d/init.d/functions
+@@ -686,6 +686,6 @@ if [ "$_use_systemctl" = "1" ]; then
+ fi
+ fi
+
+-strstr "$(cat /proc/cmdline)" "rc.debug" && set -x
++strstr "$(cat /proc/cmdline)" "rc.debug" && set -x || true
+ return 0
+
diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch b/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
new file mode 100644
index 000000000..e912daa70
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
@@ -0,0 +1,33 @@
+From e46b056282c8420f096d5c34d78c00f816788784 Mon Sep 17 00:00:00 2001
+From: Fan Xin <fan.xin@jp.fujitsu.com>
+Date: Mon, 5 Jun 2017 16:26:47 +0900
+Subject: [PATCH 1/2] Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Rebase on 9.72
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+Upstream-Status: Pending
+
+---
+ rc.d/init.d/functions | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
+index 2e3da964..1a204dec 100644
+--- a/rc.d/init.d/functions
++++ b/rc.d/init.d/functions
+@@ -59,7 +59,7 @@ systemctl_redirect () {
+ [ -z "${COLUMNS:-}" ] && COLUMNS=80
+
+ if [ -z "${CONSOLETYPE:-}" ]; then
+- if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ]; then
++ if [ -c "/dev/stderr" ] && [ -r "/dev/stderr" ] && [ -e /sbin/consoletype ]; then
+ CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)"
+ else
+ CONSOLETYPE="serial"
+--
+2.15.1
+
diff --git a/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb b/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb
new file mode 100644
index 000000000..46edeed8a
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbinitscripts_9.79.bb
@@ -0,0 +1,32 @@
+SUMMARY = "SysV init scripts which are only used in an LSB image"
+HOMEPAGE = "https://wiki.debian.org/LSBInitScripts"
+SECTION = "base"
+LICENSE = "GPLv2"
+DEPENDS = "popt glib-2.0"
+
+RPROVIDES_${PN} += "initd-functions"
+RDEPENDS_${PN} += "util-linux"
+RCONFLICTS_${PN} = "initscripts-functions"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S = "${WORKDIR}/git"
+SRC_URI = "git://github.com/fedora-sysv/initscripts \
+ file://functions.patch \
+ file://0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch \
+ "
+SRCREV = "a51c1b4f7dcf55b568b2ee4c2b18078849943469"
+UPSTREAM_CHECK_GITTAGREGEX = "^(?P<pver>\d+(\.\d+)+)"
+
+SRC_URI[md5sum] = "d6c798f40dceb117e12126d94cb25a9a"
+SRC_URI[sha256sum] = "1793677bdd1f7ee4cb00878ce43346196374f848a4c8e4559e086040fc7487db"
+
+# Since we are only taking the patched version of functions, no need to
+# configure or compile anything so do not execute these
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install(){
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0644 ${S}/rc.d/init.d/functions ${D}${sysconfdir}/init.d/functions
+}
diff --git a/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
new file mode 100644
index 000000000..073e247a5
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
@@ -0,0 +1,525 @@
+#!/bin/sh
+
+# Copyright (C) 2012 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+WORK_DIR="/opt/lsb-test"
+
+if [ `id -u` -ne 0 ]
+then
+ cat << EOF
+ In order to install and run LSB testsuite, you need administrator privileges.
+ You are currently running this script as an unprivileged user.
+
+EOF
+ exit 1
+fi
+
+ARCH=`uname -m`
+if [ ${ARCH} != "i686" ] && [ ${ARCH} != "x86_64" ] && [ ${ARCH} != "ppc" ] && [ ${ARCH} != "ppc64" ]
+then
+ echo "Error: Unsupported architecture"
+ exit 1
+fi
+
+which rpm
+if [ $? -ne 0 ]
+then
+ echo "No rpm command found"
+ exit 1
+fi
+
+RET=0
+
+cd ${WORK_DIR} || exit 1
+# Step 1: Download the LSB Packages
+echo ""
+echo "Download LSB packages..."
+echo ""
+
+if [ ! -e ./packages_list ]
+then
+ echo "Error: Could not find packages list" >&2
+ exit 1
+fi
+
+. ./packages_list
+
+PACKAGES_DIR="/var/opt/lsb/test/manager/packages/ftp.linuxfoundation.org/pub/lsb"
+
+BASE_PACKAGES_DIR="${PACKAGES_DIR}/base/released-all/binary"
+RUNTIME_BASE_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/released-all/binary/runtime"
+RUNTIME_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/${LSB_RELEASE}/binary/runtime"
+APP_PACKAGES_DIR="${PACKAGES_DIR}/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+APP_TESTFILES_DIR="${PACKAGES_DIR}/app-battery/tests"
+SNAPSHOTS_TESTFILES_DIR="${PACKAGES_DIR}/snapshots/appbat/tests"
+
+if [ ! -d ${PACKAGES_DIR} ]
+then
+ mkdir -p ${PACKAGES_DIR}
+fi
+
+if [ ! -d ${BASE_PACKAGES_DIR} ]
+then
+ mkdir -p ${BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+ mkdir -p ${RUNTIME_BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_PACKAGES_DIR} ]
+then
+ mkdir -p ${RUNTIME_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_PACKAGES_DIR} ]
+then
+ mkdir -p ${APP_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_TESTFILES_DIR} ]
+then
+ mkdir -p ${APP_TESTFILES_DIR}
+fi
+
+# Official download server list. You can replace them with your own server.
+SERVER_IPADDR="140.211.169.28"
+SERVER_NAME="ftp.linuxfoundation.org"
+
+if ! `grep -F -q "${SERVER_NAME}" /etc/hosts`; then
+ echo "${SERVER_IPADDR} ${SERVER_NAME} ${SERVER_NAME}" >> /etc/hosts
+fi
+
+#ping -c 5 ${SERVER_NAME}
+#if [ $? -ne 0 ]
+#then
+# echo "The server: ${SERVER_NAME} is unreachable"
+# exit 1
+#fi
+
+SERVER1="\
+ http://${SERVER_NAME}/pub/lsb/base/released-all/binary"
+SERVER2="\
+ http://${SERVER_NAME}/pub/lsb/test_suites/released-all/binary/runtime"
+SERVER3="\
+ http://${SERVER_NAME}/pub/lsb/test_suites/${LSB_RELEASE}/binary/runtime"
+SERVER4="\
+ http://${SERVER_NAME}/pub/lsb/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+SERVER5="\
+ http://${SERVER_NAME}/pub/lsb/app-battery/tests"
+
+# We using "curl" as a download tool, "wget" is an alternative.
+CURL=`which curl`
+WGET=`which wget`
+if [ ! -z ${CURL} ]
+then
+ DOWNLOAD_CMD="${CURL} -R -L -f --retry 3 --retry-delay 4 --connect-timeout 180 --compressed -C - -o"
+elif [ ! -z ${WGET} ]
+then
+ DOWNLOAD_CMD="${WGET} -c -t 5 -O"
+else
+ echo "Can not find a download tool, please install curl or wget."
+ exit 1
+fi
+
+cd ${BASE_PACKAGES_DIR}
+for pkg in ${BASE_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${RUNTIME_BASE_PACKAGES_DIR}
+for pkg in ${RUNTIME_BASE_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${RUNTIME_PACKAGES_DIR}
+for pkg in ${RUNTIME_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${APP_PACKAGES_DIR}
+for pkg in ${APP_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${APP_TESTFILES_DIR}
+for pkg in ${APP_TESTFILES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+if [ ${RET} -ne 0 ]
+then
+ echo "Download some packages failed. Please download them again."
+ exit 1
+fi
+
+# Step 2: Install the LSB Packages
+echo ""
+echo "Install LSB packages..."
+echo ""
+
+# Kill lighttpd
+ps aux | grep "lighttpd" | grep -v -q "grep"
+if [ $? -eq 0 ]
+then
+ killall lighttpd >/dev/null 2>&1
+fi
+
+# Start avahi-daemon
+ps aux | grep "avahi-daemon" | grep -v -q "grep"
+if [ $? -ne 0 ]
+then
+ /etc/init.d/avahi-daemon start >/dev/null 2>&1
+fi
+
+LSB_START_CMD="/opt/lsb/test/manager/bin/dist-checker-start.pl"
+LSB_STOP_CMD="/opt/lsb/test/manager/bin/dist-checker-stop.pl"
+
+PLATFORM_FILE="/etc/rpm/platform"
+
+RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i --ignoreos"
+RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i --ignoreos"
+
+# If the lsb has been started, stop it first.
+if [ -x ${LSB_STOP_CMD} ]
+then
+ ${LSB_STOP_CMD}
+fi
+
+if [ ! -d /etc/rpm ]
+then
+ mkdir -p /etc/rpm
+fi
+
+if [ ! -f ${PLATFORM_FILE} ]
+then
+ touch ${PLATFORM_FILE}
+fi
+
+if ! `grep -F -q "noarch-suse" ${PLATFORM_FILE}`; then
+ if [ ${ARCH} = i686 ];then
+ echo "i486-suse" >> ${PLATFORM_FILE}
+ echo "i486-noarch" >> ${PLATFORM_FILE}
+ echo "i486-pc" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ elif [ ${ARCH} = x86_64 ]; then
+ echo "i486-suse" >> ${PLATFORM_FILE}
+ echo "i486-noarch" >> ${PLATFORM_FILE}
+ echo "i486-pc" >> ${PLATFORM_FILE}
+ echo "i486-.*-linux.*" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+ echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+ else
+ echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+ echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ fi
+fi
+
+if [ -d ${BASE_PACKAGES_DIR} ]
+then
+ cd ${BASE_PACKAGES_DIR}
+ for pkg in ${BASE_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+ cd ${RUNTIME_BASE_PACKAGES_DIR}
+ for pkg in ${RUNTIME_BASE_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${RUNTIME_PACKAGES_DIR} ]
+then
+ cd ${RUNTIME_PACKAGES_DIR}
+ for pkg in ${RUNTIME_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${APP_PACKAGES_DIR} ]
+then
+ cd ${APP_PACKAGES_DIR}
+ for pkg in ${APP_PACKAGES_LIST}
+ do
+ echo "${pkg}" | grep -q "apache\|xpdf"
+ if [ $? -eq 0 ]
+ then
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD_NOSCRIPTS ${pkg}
+ fi
+ else
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ fi
+ done
+fi
+
+if [ ! -d ${SNAPSHOTS_TESTFILES_DIR} ]
+then
+ mkdir -p ${SNAPSHOTS_TESTFILES_DIR}
+fi
+
+if [ -d ${APP_TESTFILES_DIR} ]
+then
+ cd ${APP_TESTFILES_DIR}
+ for pkg in ${APP_TESTFILES_LIST}
+ do
+ cp -f ${pkg} ${SNAPSHOTS_TESTFILES_DIR}
+ done
+fi
+
+cd ${WORK_DIR}
+
+# Step 3: Set environment
+echo ""
+echo "Set environment..."
+echo ""
+
+check ()
+{
+ if [ $? -eq 0 ]
+ then
+ echo "PASS"
+ else
+ echo "FAIL"
+ exit 1
+ fi
+}
+
+echo ""
+echo "---------------------------------"
+echo "Create the Dirnames on target"
+
+if [ ! -d /etc/rpm/sysinfo ]
+then
+ mkdir -p /etc/rpm/sysinfo
+fi
+
+cat > /etc/rpm/sysinfo/Dirnames << EOF
+/etc/opt/lsb
+/home/tet/LSB.tools
+/opt/lsb-tet3-lite/lib/ksh
+/opt/lsb-tet3-lite/lib/perl
+/opt/lsb-tet3-lite/lib/posix_sh
+/opt/lsb-tet3-lite/lib/tet3
+/opt/lsb-tet3-lite/lib/xpg3sh
+/opt/lsb/appbat/lib/python2.4/site-packages/qm
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external/DocumentTemplate
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/classes
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/web
+/opt/lsb/test/doc
+/opt/lsb/test/lib
+/opt/lsb/test/qm/diagnostics
+/opt/lsb/test/qm/doc
+/opt/lsb/test/qm/doc/test/html
+/opt/lsb/test/qm/doc/test/print
+/opt/lsb/test/qm/dtml
+/opt/lsb/test/qm/dtml/test
+/opt/lsb/test/qm/messages/test
+/opt/lsb/test/qm/tutorial/test/tdb
+/opt/lsb/test/qm/tutorial/test/tdb/QMTest
+/opt/lsb/test/qm/web
+/opt/lsb/test/qm/web/images
+/opt/lsb/test/qm/web/stylesheets
+/opt/lsb/test/qm/xml
+/opt/lsb/test/share
+/usr/share/doc/lsb-runtime-test
+/var/opt/lsb
+/opt/lsb/test/desktop
+/opt/lsb/test/desktop/fontconfig
+/opt/lsb/test/desktop/freetype
+/opt/lsb/test/desktop/gtkvts
+/opt/lsb/test/desktop/libpng
+/opt/lsb/test/desktop/xft
+/opt/lsb/test/desktop/xml
+/opt/lsb/test/desktop/xrender
+
+
+EOF
+
+if [ -f /etc/rpm/sysinfo/Dirnames ]
+then
+ echo "Success to creat Dirnames file"
+else
+ echo "Fail to creat Dirnames file"
+fi
+
+[ -x /sbin/ldconfig ] && {
+echo ""
+echo "---------------------------------"
+echo "Update cache"
+/sbin/ldconfig
+check;
+}
+
+# Check loop device
+if [ ! -b /dev/loop0 ]
+then
+ insmod /lib/modules/`uname -r`/kernel/drivers/block/loop.ko
+ if [ $? != 0 ];then
+ echo "Insmod loop.ko failed."
+ fi
+fi
+
+# Resolve localhost
+LOCALHOST=`hostname`
+if ! `grep -F -q "$LOCALHOST" /etc/hosts`; then
+ echo "127.0.0.1 $LOCALHOST" >> /etc/hosts
+fi
+
+# Workaround to add part of locales for LSB test
+localedef -i de_DE -f ISO-8859-1 de_DE
+localedef -i de_DE -f ISO-8859-15 de_DE.ISO-8859-15
+localedef -i de_DE -f UTF-8 de_DE.UTF-8
+localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
+localedef -i en_HK -f ISO-8859-1 en_HK
+localedef -i en_PH -f ISO-8859-1 en_PH
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1
+localedef -i en_US -f ISO-8859-1 en_US
+localedef -i en_US -f UTF-8 en_US.UTF-8
+localedef -i en_US -f ISO-8859-1 en_US.ISO8859-1
+localedef -i es_MX -f ISO-8859-1 es_MX
+localedef -i fr_FR -f ISO-8859-1 fr_FR
+localedef -i it_IT -f ISO-8859-1 it_IT
+localedef -i ja_JP -f EUC-JP ja_JP.eucjp
+localedef -i se_NO -f UTF-8 se_NO.UTF-8
+localedef -i ta_IN -f UTF-8 ta_IN
+localedef -i es_ES -f ISO-8859-1 es_ES
+localedef -i fr_FR@euro -f ISO-8859-1 fr_FR@euro
+localedef -i is_IS -f UTF-8 is_IS.UTF-8
+localedef -i zh_TW -f BIG5 zh_TW.BIG5
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+
+echo ""
+echo "Installation done!"
+echo ""
+
+# Step 4: Start LSB test
+if [ -x ${LSB_START_CMD} ]
+then
+ ${LSB_START_CMD}
+fi
+
+echo "---------------------------------"
+echo "Run all the certification version of LSB Tests"
+echo "---------------------------------"
+
+LSB_DIST_CHECKER="/opt/lsb/test/manager/utils/dist-checker.pl"
+SESSION="${WORK_DIR}/session"
+if [ ! -e ${SESSION} ]
+then
+ echo "Error: Could not find session file."
+ echo "You must run LSB test from webbrower."
+ exit 1
+fi
+
+if [ -x ${LSB_DIST_CHECKER} ]
+then
+ ${LSB_DIST_CHECKER} -v2 -f ${SESSION}
+ check
+fi
+
+echo ""
+echo "LSB test complete. Please check the log file in /var/opt/lsb/test/manager/results/"
+echo ""
+
diff --git a/poky/meta/recipes-extended/lsb/lsbtest/packages_list b/poky/meta/recipes-extended/lsb/lsbtest/packages_list
new file mode 100644
index 000000000..1a6c11699
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbtest/packages_list
@@ -0,0 +1,49 @@
+LSB_RELEASE="released-5.0"
+LSB_ARCH="lsbarch"
+
+BASE_PACKAGES_LIST="lsb-setup-5.0.0-2.noarch.rpm"
+
+RUNTIME_BASE_PACKAGES_LIST="lsb-dist-checker-5.0.0.1-1.targetarch.rpm \
+ lsb-tet3-lite-3.7-27.lsb5.targetarch.rpm \
+ lsb-tet3-lite-devel-3.7-27.lsb5.targetarch.rpm \
+ lsb-xvfb-1.2.0-22.targetarch.rpm \
+ "
+
+RUNTIME_PACKAGES_LIST="lsb-cmdchk-5.0.3-1.targetarch.rpm \
+ lsb-libchk-5.0.3-1.targetarch.rpm \
+ lsb-qm-2.2-1.lsb5.targetarch.rpm \
+ lsb-task-dist-testkit-5.0.0-2.noarch.rpm \
+ lsb-test-core-5.0.1-1.targetarch.rpm \
+ lsb-test-cpp-t2c-5.0.0-1.targetarch.rpm \
+ lsb-test-desktop-5.0.0-1.targetarch.rpm \
+ lsb-test-desktop-t2c-5.0.0-1.targetarch.rpm \
+ lsb-test-libstdcpp-4.1.0-22.lsb1.targetarch.rpm \
+ lsb-test-olver-core-5.0.0-1.targetarch.rpm \
+ lsb-test-perl-5.0.2-1.noarch.rpm \
+ lsb-test-printing-5.0.1-1.targetarch.rpm \
+ lsb-test-python-5.0.0-1.targetarch.rpm \
+ lsb-test-qt4-azov-5.0.0-1.targetarch.rpm \
+ lsb-test-xts5-5.1.5-47.lsb5.targetarch.rpm \
+ lsb-test-alsa-t2c-5.1.91-4.targetarch.rpm \
+ lsb-test-core-t2c-5.0.1-1.targetarch.rpm \
+ lsb-test-xml2-azov-5.0.0-1.targetarch.rpm \
+ "
+
+APP_PACKAGES_LIST="lsb-python-2.4.6-10.lsb5.targetarch.rpm \
+ lsb-apache-2.2.19-5.lsb5.targetarch.rpm \
+ lsb-tcl-8.5.9-21.lsb5.targetarch.rpm \
+ lsb-expect-5.43.0-21.lsb5.targetarch.rpm \
+ lsb-groff-1.20.1-9.lsb5.targetarch.rpm \
+ lsb-raptor-1.4.21-4.lsb5.targetarch.rpm \
+ lsb-xpdf-1.01-17.lsb5.targetarch.rpm \
+ lsb-samba-3.5.9-5.lsb5.targetarch.rpm \
+ lsb-rsync-3.0.8-3.lsb5.targetarch.rpm \
+ "
+
+APP_TESTFILES_LIST="expect-tests.tar \
+ tcl-tests.tar \
+ raptor-tests.tar \
+ test1.pdf \
+ test2.pdf \
+ "
+
diff --git a/poky/meta/recipes-extended/lsb/lsbtest/session b/poky/meta/recipes-extended/lsb/lsbtest/session
new file mode 100644
index 000000000..4d47e40f7
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbtest/session
@@ -0,0 +1,176 @@
+[GENERAL]
+VERBOSE_LEVEL: 1
+ARCHITECTURE: targetarch
+USE_INTERNET: 1
+STD_VERSION: LSB 5.0
+STD_PROFILE: no
+[cmdchk]
+RUN: 1
+VERSION: local|*
+
+[libchk]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/alsa-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/alsa-t2c/results
+
+[core]
+RUN: 1
+VERSION: local|*
+
+[core|local|*]
+AUTOREPLY_PROVIDES_BASH: n
+AUTOREPLY_TESTRUN_PATH: /home/tet/test_sets
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_KERNEL_NAME: vmlinuz
+AUTOREPLY_INSTALL_LSBPAM_CONF: y
+AUTOREPLY_PROVIDES_C_SHELL: n
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_SET_PASS_MIN_DAYS: y
+AUTOREPLY_PROVIDES_SYSV_INIT:
+AUTOREPLY_ISNTALL_DEVS: y
+AUTOREPLY_SUPPORTS_FILE_CMD: y
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core/tet/test_sets
+AUTOREPLY_SUPPORTS_NLS: n
+AUTOREPLY_SUPPORTS_PROCESS_ACCOUNTING: n
+AUTOREPLY_PATH_TO_RC.D:
+AUTOREPLY_ALLOWS_MAKEDEV: n
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core/tet/test_sets/results
+
+[core-t2c]
+RUN: 1
+VERSION: local|*
+
+[core-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core-t2c/results
+
+[cpp-t2c]
+RUN: 1
+VERSION: local|*
+
+[cpp-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/cpp-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/cpp-t2c/results
+
+[desktop]
+RUN: 1
+VERSION: local|*
+
+[desktop|local|*]
+AUTOREPLY_DESKTOP_ENVIRONMENT: [default]
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_X_CLIENT_HOSTNAME:
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_SHOW_SUMMARY_REPORT:
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_XVFB_DISPLAY: [default]
+
+[desktop-t2c]
+RUN: 1
+VERSION: local|*
+
+[desktop-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/desktop-t2c/results
+
+[libstdcpp]
+RUN: 1
+VERSION: local|*
+
+[libstdcpp|local|*]
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/libstdcpp_4.1.0
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_GNU_TRIPLET:
+
+[olver]
+RUN: 1
+VERSION: local|*
+
+[olver|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/olver-core
+AUTOREPLY_RESULTS_DIR: /var/opt/lsb/test/olver-core
+
+[perl]
+RUN: 1
+VERSION: local|*
+
+[perl|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/perl
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/perl/results
+
+[printing]
+RUN: 1
+VERSION: local|*
+
+[printing|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/printing
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/printing/results
+
+[python]
+RUN: 1
+VERSION: local|*
+
+[python|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/python
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/python/results
+
+[xml2-azov]
+RUN: 1
+VERSION: local|*
+
+[xts5]
+RUN: 1
+VERSION: local|*
+
+[xts5|local|*]
+AUTOREPLY_XT_FONTPATH_GOOD: [default]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/xts5
+AUTOREPLY_XVFB_DISPLAY: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/xts5/xts5/results
+AUTOREPLY_XT_FONTPATH: [default]
+AUTOREPLY_X_CLIENT_HOSTNAME:
+
+[apache]
+RUN: 1
+VERSION: local|*
+
+[expect]
+RUN: 1
+VERSION: local|*
+
+[groff]
+RUN: 1
+VERSION: local|*
+
+[raptor]
+RUN: 1
+VERSION: local|*
+
+[rsync]
+RUN: 1
+VERSION: local|*
+
+[samba]
+RUN: 1
+VERSION: local|*
+
+[tcl]
+RUN: 1
+VERSION: local|*
+
+[xpdf]
+RUN: 1
+VERSION: local|*
+
diff --git a/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb b/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
new file mode 100644
index 000000000..a90c023d5
--- /dev/null
+++ b/poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Automates Linux Standard Base (LSB) tests"
+HOMEPAGE = "https://wiki.debian.org/LSBInitScripts"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://LSB_Test.sh;beginline=3;endline=16;md5=7063bb54b04719df0716b513447f4fc0"
+
+SRC_URI = "file://LSB_Test.sh \
+ file://packages_list \
+ file://session \
+ "
+RDEPENDS_${PN} = "lsb rpm"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/opt/lsb-test
+ install -m 0755 ${S}/LSB_Test.sh ${D}/opt/lsb-test/LSB_Test.sh
+ install -m 0644 ${S}/packages_list ${D}/opt/lsb-test/packages_list
+ install -m 0644 ${S}/session ${D}/opt/lsb-test/session
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ sed -i -e 's/lsbarch/ia32/g' -e 's/targetarch/i486/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/x86/g' ${D}/opt/lsb-test/session
+ fi
+ if [ "${TARGET_ARCH}" = "x86_64" ];then
+ sed -i -e 's/lsbarch/amd64/g' -e 's/targetarch/x86_64/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/x86-64/g' ${D}/opt/lsb-test/session
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ];then
+ sed -i -e 's/lsbarch/ppc32/g' -e 's/targetarch/ppc/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/PPC32/g' ${D}/opt/lsb-test/session
+ fi
+
+ # For a ppc64 target. the default userspace is 32b.
+ # Therefore, only change the lsbarch and targetarch
+ # in the package_list when MLIB=lib64 is being used.
+ # Otherwise, by default, the ppc32 LSB packages
+ # will be downloaded by LSB_Test.sh
+ if [ "${TARGET_ARCH}" = "powerpc64" ];then
+ if [ "${PN}" != "${BPN}" ];then
+ sed -i -e 's/lsbarch/ppc64/g' -e 's/targetarch/ppc64/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/PPC64/g' ${D}/opt/lsb-test/session
+ fi
+ fi
+}
+
+FILES_${PN} += "/opt/lsb-test/* \
+ "
diff --git a/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch b/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch
new file mode 100644
index 000000000..b7d2323dc
--- /dev/null
+++ b/poky/meta/recipes-extended/lsof/files/lsof-remove-host-information.patch
@@ -0,0 +1,76 @@
+Remove host information from version.h
+
+make lsof not include host information
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ dialects/linux/Makefile | 50 +++++++++--------------------------------------
+ 1 file changed, 9 insertions(+), 41 deletions(-)
+
+diff --git a/dialects/linux/Makefile b/dialects/linux/Makefile
+index 2bea108..792142b 100644
+--- a/dialects/linux/Makefile
++++ b/dialects/linux/Makefile
+@@ -76,48 +76,16 @@ version.h: FRC
+ @echo Constructing version.h
+ @rm -f version.h
+ @echo '#define LSOF_BLDCMT "${LSOF_BLDCMT}"' > version.h;
+- @echo '#define LSOF_CC "${CC}"' >> version.h
+- @echo '#define LSOF_CCV "${CCV}"' >> version.h
+- @echo '#define LSOF_CCDATE "'`date`'"' >> version.h
+- @echo '#define LSOF_CCFLAGS "'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h
++ @echo '#define LSOF_CC ""' >> version.h
++ @echo '#define LSOF_CCV ""' >> version.h
++ @echo '#define LSOF_CCDATE ""' >> version.h
++ @echo '#define LSOF_CCFLAGS ""' >> version.h
+ @echo '#define LSOF_CINFO "${CINFO}"' >> version.h
+- @if [ "X${LSOF_HOST}" = "X" ]; then \
+- echo '#define LSOF_HOST "'`uname -n`'"' >> version.h; \
+- else \
+- if [ "${LSOF_HOST}" = "none" ]; then \
+- echo '#define LSOF_HOST ""' >> version.h; \
+- else \
+- echo '#define LSOF_HOST "${LSOF_HOST}"' >> version.h; \
+- fi \
+- fi
+- @echo '#define LSOF_LDFLAGS "${CFGL}"' >> version.h
+- @if [ "X${LSOF_LOGNAME}" = "X" ]; then \
+- echo '#define LSOF_LOGNAME "${LOGNAME}"' >> version.h; \
+- else \
+- if [ "${LSOF_LOGNAME}" = "none" ]; then \
+- echo '#define LSOF_LOGNAME ""' >> version.h; \
+- else \
+- echo '#define LSOF_LOGNAME "${LSOF_LOGNAME}"' >> version.h; \
+- fi; \
+- fi
+- @if [ "X${LSOF_SYSINFO}" = "X" ]; then \
+- echo '#define LSOF_SYSINFO "'`uname -a`'"' >> version.h; \
+- else \
+- if [ "${LSOF_SYSINFO}" = "none" ]; then \
+- echo '#define LSOF_SYSINFO ""' >> version.h; \
+- else \
+- echo '#define LSOF_SYSINFO "${LSOF_SYSINFO}"' >> version.h; \
+- fi \
+- fi
+- @if [ "X${LSOF_USER}" = "X" ]; then \
+- echo '#define LSOF_USER "${USER}"' >> version.h; \
+- else \
+- if [ "${LSOF_USER}" = "none" ]; then \
+- echo '#define LSOF_USER ""' >> version.h; \
+- else \
+- echo '#define LSOF_USER "${LSOF_USER}"' >> version.h; \
+- fi \
+- fi
++ @echo '#define LSOF_HOST ""' >> version.h;
++ @echo '#define LSOF_LDFLAGS ""' >> version.h
++ @echo '#define LSOF_LOGNAME ""' >> version.h;
++ @echo '#define LSOF_SYSINFO ""' >> version.h;
++ @echo '#define LSOF_USER ""' >> version.h;
+ @sed '/VN/s/.ds VN \(.*\)/#define LSOF_VERSION "\1"/' < version >> version.h
+
+ FRC:
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/lsof/lsof_4.89.bb b/poky/meta/recipes-extended/lsof/lsof_4.89.bb
new file mode 100644
index 000000000..14546db23
--- /dev/null
+++ b/poky/meta/recipes-extended/lsof/lsof_4.89.bb
@@ -0,0 +1,64 @@
+SUMMARY = "LiSt Open Files tool"
+DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
+Its name stands for LiSt Open Files, and it does just that."
+HOMEPAGE = "http://people.freebsd.org/~abe/"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
+
+# Upstream lsof releases are hosted on an ftp server which times out download
+# attempts from hosts for which it can not perform a DNS reverse-lookup (See:
+# https://people.freebsd.org/~abe/ ). http://www.mirrorservice.org seems to be
+# the most commonly used alternative.
+
+SRC_URI = "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2 \
+ file://lsof-remove-host-information.patch \
+ "
+
+SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
+SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
+
+LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
+
+S = "${WORKDIR}/lsof_${PV}_src"
+
+python do_unpack () {
+ # temporarily change S for unpack
+ # of lsof_${PV}
+ s = d.getVar('S', False)
+ d.setVar('S', '${WORKDIR}/lsof_${PV}')
+ bb.build.exec_func('base_do_unpack', d)
+ # temporarily change SRC_URI for unpack
+ # of lsof_${PV}_src
+ src_uri = d.getVar('SRC_URI', False)
+ d.setVar('SRC_URI', '${LOCALSRC}')
+ d.setVar('S', s)
+ bb.build.exec_func('base_do_unpack', d)
+ d.setVar('SRC_URI', src_uri)
+}
+
+export LSOF_INCLUDE = "${STAGING_INCDIR}"
+
+do_configure () {
+ export LSOF_AR="${AR} cr"
+ export LSOF_RANLIB="${RANLIB}"
+ if [ "x${GLIBCVERSION}" != "x" ]; then
+ LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
+ LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
+ export LINUX_CLIB
+ fi
+ yes | ./Configure linux
+}
+
+export I = "${STAGING_INCDIR}"
+export L = "${STAGING_INCDIR}"
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
+}
+
+do_install () {
+ install -d ${D}${sbindir} ${D}${mandir}/man8
+ install -m 0755 lsof ${D}${sbindir}/lsof
+ install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
+}
diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch b/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch
new file mode 100644
index 000000000..da62687d5
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0001-configure-Fix-default-value-of-without-numa-switch-i.patch
@@ -0,0 +1,31 @@
+From 4ace68a6ba501907a0741dba5f5f155e06a74c35 Mon Sep 17 00:00:00 2001
+From: Petr Vorel <pvorel@suse.cz>
+Date: Wed, 7 Feb 2018 11:09:49 +0100
+Subject: [PATCH] configure: Fix default value of --without-numa switch in help
+
+The default value is no.
+
+Fixes: 39a85a1f1 ("configure: add knob to control numa support")
+
+Signed-off-by: Petr Vorel <pvorel@suse.cz>
+Upstream-Status: Accepted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b39a31d..d66ea00 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,7 +86,7 @@ fi
+ # Numa
+ AC_ARG_WITH([numa],
+ AC_HELP_STRING([--without-numa],
+- [without numa support (default=yes)]),
++ [without numa support (default=no)]),
+ [with_numa=no],
+ [with_numa=yes]
+ )
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch b/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch
new file mode 100644
index 000000000..8aaa287b7
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0001-configure-add-knob-to-control-numa-support.patch
@@ -0,0 +1,50 @@
+From 39a85a1f1e6624f554215ba4b6843d3689a8415e Mon Sep 17 00:00:00 2001
+From: Anders Roxell <anders.roxell@linaro.org>
+Date: Mon, 5 Feb 2018 11:56:04 +0100
+Subject: [PATCH] configure: add knob to control numa support
+
+Allow to disable numa from the top level.
+
+Based on patch:
+http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/ltp?id=4c7873552e13dfdba96afca7562c398d2966ca71
+
+Reported-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
+Signed-off-by: Petr Vorel <pvorel@suse.cz>
+Upstream-Status: Accepted
+---
+ configure.ac | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 5c8d4ea..b39a31d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,6 +83,14 @@ else
+ AC_SUBST([WITH_EXPECT],["no"])
+ fi
+
++# Numa
++AC_ARG_WITH([numa],
++ AC_HELP_STRING([--without-numa],
++ [without numa support (default=yes)]),
++ [with_numa=no],
++ [with_numa=yes]
++)
++
+ # Perl
+ AC_ARG_WITH([perl],
+ [AC_HELP_STRING([--with-perl],
+@@ -157,7 +165,9 @@ LTP_CHECK_SELINUX
+ LTP_CHECK_SIGNAL
+ LTP_CHECK_SYSCALL_EVENTFD
+ LTP_CHECK_SYSCALL_MODIFY_LDT
++if test "x$with_numa" = xyes; then
+ LTP_CHECK_SYSCALL_NUMA
++fi
+ LTP_CHECK_SYSCALL_QUOTACTL
+ LTP_CHECK_SYSCALL_SIGNALFD
+ LTP_CHECK_SYSCALL_UNSHARE
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
new file mode 100644
index 000000000..5cf1e05f7
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
@@ -0,0 +1,46 @@
+From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001
+From: Fathi Boudra <fathi.boudra@linaro.org>
+Date: Thu, 7 Jan 2016 17:36:19 +0000
+Subject: [PATCH 03/32] Add knob to control tirpc support
+
+allow to disable tirpc. Helps to disable it at top level for eg. musl it
+does not yet work.
+
+Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ configure.ac | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index cc50397..9e2936b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then
+ else
+ AC_SUBST([WITH_PYTHON],["no"])
+ fi
++
++# TI RPC
++AC_ARG_WITH([tirpc],
++ AC_HELP_STRING([--without-tirpc],
++ [without libtirpc support]),
++ [],[with_tirpc=yes],
++)
+ # END tools knobs
+
+ # Testsuites knobs
+@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2
+ LTP_CHECK_FALLOCATE
+ LTP_CHECK_SYSCALL_FCNTL
+ LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
++if test "x$with_tirpc" = xyes; then
+ LTP_CHECK_TIRPC
++fi
+ LTP_CHECK_TEE
+ LTP_CHECK_SPLICE
+ LTP_CHECK_VMSPLICE
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
new file mode 100644
index 000000000..84ab37ea3
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
@@ -0,0 +1,146 @@
+From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:19:03 +0000
+Subject: [PATCH 04/32] build: Add option to select libc implementation
+
+There are more than glibc for C library implementation available on
+linux now a days, uclibc cloaked like glibc but musl e.g. is very
+different and does not implement all GNU extentions
+
+Disable tests specifically not building _yet_ on musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ Makefile | 5 +++++
+ testcases/kernel/Makefile | 5 ++++-
+ testcases/kernel/sched/Makefile | 4 +++-
+ testcases/kernel/syscalls/Makefile | 5 +++++
+ testcases/network/nfsv4/acl/Makefile | 4 ++++
+ testcases/network/rpc/basic_tests/Makefile | 5 +++++
+ testcases/realtime/func/pi-tests/Makefile | 4 ++++
+ testcases/realtime/stress/pi-tests/Makefile | 5 +++++
+ 8 files changed, 35 insertions(+), 2 deletions(-)
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0
+ UCLINUX ?= 0
+ export UCLINUX
+
++# System C library implementation (glibc,uclibc,musl etc.)
++# default to glibc if not set
++LIBC ?= glibc
++export LIBC
++
+ # CLEAN_TARGETS: Targets which exist solely in clean.
+ # COMMON_TARGETS: Targets which exist in all, clean, and install.
+ # INSTALL_TARGETS: Targets which exist in clean and install (contains
+Index: git/testcases/kernel/Makefile
+===================================================================
+--- git.orig/testcases/kernel/Makefile
++++ git/testcases/kernel/Makefile
+@@ -48,13 +48,16 @@ SUBDIRS += connectors \
+ logging \
+ mem \
+ numa \
+- pty \
+ sched \
+ security \
+ timers \
+ tracing \
+ module \
+
++ifneq ($(LIBC),musl)
++SUBDIRS += pty
++endif
++
+ ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
+ SUBDIRS += power_management
+ endif
+Index: git/testcases/kernel/sched/Makefile
+===================================================================
+--- git.orig/testcases/kernel/sched/Makefile
++++ git/testcases/kernel/sched/Makefile
+@@ -23,5 +23,7 @@
+ top_srcdir ?= ../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
+-
++ifeq ($(LIBC),musl)
++ FILTER_OUT_DIRS += process_stress
++endif
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+Index: git/testcases/kernel/syscalls/Makefile
+===================================================================
+--- git.orig/testcases/kernel/syscalls/Makefile
++++ git/testcases/kernel/syscalls/Makefile
+@@ -28,6 +28,11 @@ ifeq ($(UCLINUX),1)
+ FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
+ mincore mprotect nftw profil remap_file_pages sbrk
+ endif
++ifeq ($(LIBC),musl)
++FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
++ rt_sigsuspend setdomainname sethostname sigsuspend \
++ ustat
++endif
+
+ ifeq ($(UCLIBC),1)
+ FILTER_OUT_DIRS += profil
+Index: git/testcases/network/nfsv4/acl/Makefile
+===================================================================
+--- git.orig/testcases/network/nfsv4/acl/Makefile
++++ git/testcases/network/nfsv4/acl/Makefile
+@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre
+
+ LDLIBS += $(ACL_LIBS)
+
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := acl1
++endif
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+Index: git/testcases/network/rpc/basic_tests/Makefile
+===================================================================
+--- git.orig/testcases/network/rpc/basic_tests/Makefile
++++ git/testcases/network/rpc/basic_tests/Makefile
+@@ -23,4 +23,9 @@
+ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
++
++ifeq ($(LIBC),musl)
++FILTER_OUT_DIRS += rpc01
++endif
++
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+Index: git/testcases/realtime/func/pi-tests/Makefile
+===================================================================
+--- git.orig/testcases/realtime/func/pi-tests/Makefile
++++ git/testcases/realtime/func/pi-tests/Makefile
+@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre
+ include $(abs_srcdir)/../../config.mk
+
+ MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex
++endif
++
+
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+Index: git/testcases/realtime/stress/pi-tests/Makefile
+===================================================================
+--- git.orig/testcases/realtime/stress/pi-tests/Makefile
++++ git/testcases/realtime/stress/pi-tests/Makefile
+@@ -24,4 +24,9 @@ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
+ include $(abs_srcdir)/../../config.mk
++
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := testpi-3
++endif
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
new file mode 100644
index 000000000..b9390e2c8
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
@@ -0,0 +1,46 @@
+From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:22:38 +0000
+Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl
+
+musl does not implement fts like glibc and therefore it depends on
+external implementation for all fts APIs
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ testcases/kernel/controllers/Makefile.inc | 3 +++
+ testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
+index b106283..ef5fc0c 100644
+--- a/testcases/kernel/controllers/Makefile.inc
++++ b/testcases/kernel/controllers/Makefile.inc
+@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB)
+ CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR)
+
+ LDFLAGS += -L$(abs_builddir)/../$(LIBDIR)
++ifeq ($(LIBC),musl)
++LDLIBS += -lfts
++endif
+
+ INSTALL_TARGETS ?= *.sh
+
+diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
+index 9e002f4..e0fcb9c 100644
+--- a/testcases/kernel/controllers/cpuset/Makefile.inc
++++ b/testcases/kernel/controllers/cpuset/Makefile.inc
+@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET)
+ LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR)
+
+ LDLIBS += -lcpu_set -lcontrollers -lltp
++ifeq ($(LIBC),musl)
++LDLIBS += -lfts
++endif
+
+ INSTALL_TARGETS ?= *.sh
+
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch b/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
new file mode 100644
index 000000000..2f4ca6375
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch
@@ -0,0 +1,31 @@
+From d1a27570457fb6e1d6bafe81bfa0f3507b137e32 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 18:20:58 +0800
+Subject: [PATCH] fix __WORDSIZE undeclared when building with musl
+
+fix __WORDSIZE undeclared when building with musl.
+
+Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ include/old/test.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/old/test.h b/include/old/test.h
+index b36764d83..cc6f1b551 100644
+--- a/include/old/test.h
++++ b/include/old/test.h
+@@ -44,6 +44,9 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdint.h>
++#ifndef __GLIBC__
++#include <bits/reg.h>
++#endif
+
+ #include "usctest.h"
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
new file mode 100644
index 000000000..e325ce4e4
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
@@ -0,0 +1,283 @@
+From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:40:08 +0000
+Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it
+
+__GLIBC_PREREQ is specific to glibc so it should be checked if it is
+defined or not.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++-
+ testcases/kernel/syscalls/getcpu/getcpu01.c | 40 +++++++++++++++++++++-
+ .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++
+ 3 files changed, 73 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
+index 6072bfa..2b090cb 100644
+--- a/testcases/kernel/syscalls/accept4/accept4_01.c
++++ b/testcases/kernel/syscalls/accept4/accept4_01.c
+@@ -64,6 +64,7 @@ static void cleanup(void)
+ tst_rmdir();
+ }
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 10))
+ static int
+ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+ }
+ tst_resm(TINFO, "\n");
+ #endif
+-
+ #if USE_SOCKETCALL
+ long args[6];
+
+@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+ #endif
+ }
+ #endif
++#endif
+
+ static void
+ do_test(int lfd, struct sockaddr_in *conn_addr,
+@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr,
+ die("Connect Error");
+
+ addrlen = sizeof(struct sockaddr_in);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 10))
+ acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen,
+ closeonexec_flag | nonblock_flag);
++
++#else
++ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
++ closeonexec_flag | nonblock_flag);
++#endif
+ #else
+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
+ closeonexec_flag | nonblock_flag);
+diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
+index c927512..921b107 100644
+--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
++++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
+@@ -62,6 +62,7 @@
+ #include <dirent.h>
+
+ #if defined(__i386__) || defined(__x86_64__)
++#if defined(__GLIBC__)
+ #if __GLIBC_PREREQ(2,6)
+ #if defined(__x86_64__)
+ #include <utmpx.h>
+@@ -75,10 +76,17 @@ int sys_support = 0;
+ #else
+ int sys_support = 0;
+ #endif
++#else
++int sys_support = 0;
++#endif
+
++#if defined(__GLIBC__)
+ #if !(__GLIBC_PREREQ(2, 7))
+ #define CPU_FREE(ptr) free(ptr)
+ #endif
++#else
++#define CPU_FREE(ptr) free(ptr)
++#endif
+
+ void cleanup(void);
+ void setup(void);
+@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
+ {
+ #if defined(__i386__)
+ return syscall(318, cpu_id, node_id, cache_struct);
+-#elif __GLIBC_PREREQ(2,6)
++#elif defined(__GLIBC__)
++#if __GLIBC_PREREQ(2,6)
++ *cpu_id = sched_getcpu();
++#endif
++#else
+ *cpu_id = sched_getcpu();
+ #endif
+ return 0;
+@@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)
+ cpu_set_t *set;
+ size_t size;
+ int nrcpus = 1024;
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ realloc:
+ set = CPU_ALLOC(nrcpus);
+ #else
+ set = malloc(sizeof(cpu_set_t));
+ #endif
++#else
++ set = malloc(sizeof(cpu_set_t));
++#endif
+ if (set == NULL) {
+ tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno);
+ }
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ size = CPU_ALLOC_SIZE(nrcpus);
+ CPU_ZERO_S(size, set);
+@@ -207,8 +225,13 @@ realloc:
+ size = sizeof(cpu_set_t);
+ CPU_ZERO(set);
+ #endif
++#else
++ size = sizeof(cpu_set_t);
++ CPU_ZERO(set);
++#endif
+ if (sched_getaffinity(0, size, set) < 0) {
+ CPU_FREE(set);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (errno == EINVAL && nrcpus < (1024 << 8)) {
+ nrcpus = nrcpus << 2;
+@@ -220,10 +243,17 @@ realloc:
+ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
+ else
+ #endif
++#else
++ if (errno == EINVAL)
++ tst_resm(TFAIL,
++ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
++ else
++#endif
+ tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno);
+ tst_exit();
+ }
+ cpu_max = max_cpuid(size, set);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ CPU_ZERO_S(size, set);
+ CPU_SET_S(cpu_max, size, set);
+@@ -231,6 +261,10 @@ realloc:
+ CPU_ZERO(set);
+ CPU_SET(cpu_max, set);
+ #endif
++#else
++ CPU_ZERO(set);
++ CPU_SET(cpu_max, set);
++#endif
+ if (sched_setaffinity(0, size, set) < 0) {
+ CPU_FREE(set);
+ tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno);
+@@ -247,11 +281,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set)
+ {
+ unsigned int index, max = 0;
+ for (index = 0; index < size * BITS_PER_BYTE; index++)
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (CPU_ISSET_S(index, size, set))
+ #else
+ if (CPU_ISSET(index, set))
+ #endif
++#else
++ if (CPU_ISSET(index, set))
++#endif
+ max = index;
+ return max;
+ }
+diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+index 9d6a81a..4ed13b2 100644
+--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
++++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+@@ -66,9 +66,11 @@ do { \
+ tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \
+ } while (0)
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 7))
+ #define CPU_FREE(ptr) free(ptr)
+ #endif
++#endif
+
+ int main(int ac, char **av)
+ {
+@@ -95,14 +97,19 @@ static void do_test(void)
+ pid_t unused_pid;
+ unsigned len;
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ realloc:
+ mask = CPU_ALLOC(nrcpus);
+ #else
+ mask = malloc(sizeof(cpu_set_t));
+ #endif
++#else
++ mask = malloc(sizeof(cpu_set_t));
++#endif
+ if (mask == NULL)
+ tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory");
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ len = CPU_ALLOC_SIZE(nrcpus);
+ CPU_ZERO_S(len, mask);
+@@ -110,10 +117,15 @@ realloc:
+ len = sizeof(cpu_set_t);
+ CPU_ZERO(mask);
+ #endif
++#else
++ len = sizeof(cpu_set_t);
++ CPU_ZERO(mask);
++#endif
+ /* positive test */
+ TEST(sched_getaffinity(0, len, mask));
+ if (TEST_RETURN == -1) {
+ CPU_FREE(mask);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (errno == EINVAL && nrcpus < (1024 << 8)) {
+ nrcpus = nrcpus << 2;
+@@ -125,17 +137,27 @@ realloc:
+ "newer glibc(>= 2.7)");
+ else
+ #endif
++#else
++ if (errno == EINVAL)
++ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a "
++ "newer glibc(>= 2.7)");
++ else
++#endif
+ tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity");
+ cleanup();
+ } else {
+ tst_resm(TINFO, "cpusetsize is %d", len);
+ tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]);
+ for (i = 0; i < num; i++) {
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ TEST(CPU_ISSET_S(i, len, mask));
+ #else
+ TEST(CPU_ISSET(i, mask));
+ #endif
++#else
++ TEST(CPU_ISSET(i, mask));
++#endif
+ if (TEST_RETURN != -1)
+ tst_resm(TPASS, "sched_getaffinity() succeed, "
+ "this process %d is running "
+@@ -143,11 +165,15 @@ realloc:
+ }
+ }
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ CPU_ZERO_S(len, mask);
+ #else
+ CPU_ZERO(mask);
+ #endif
++#else
++ CPU_ZERO(mask);
++#endif
+ /* negative tests */
+ QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1));
+ QUICK_TEST(sched_getaffinity(0, 0, mask));
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch b/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
new file mode 100644
index 000000000..dd7d28319
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch
@@ -0,0 +1,36 @@
+From bf5dd2932200e0199a38f3028d3bef2253f32e38 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Thu, 9 Feb 2017 17:17:37 +0800
+Subject: [PATCH] fix redefinition of 'struct msgbuf' error building with musl
+
+When building with musl the file "sys/msg.h" already contain 'struct msgbuf'
+
+Upstream-Status: Submitted [https://github.com/linux-test-project/ltp/pull/177]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
+index a757c0d18..e023114d2 100644
+--- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
++++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv08.c
+@@ -47,11 +47,13 @@ const char *TCID = "msgrcv08";
+ const int TST_TOTAL = 1;
+
+ #if __WORDSIZE == 32
+-
++#ifdef __GLIBC__
+ struct msgbuf {
+ long mtype; /* message type, must be > 0 */
+ char mtext[16]; /* message data */
+ };
++#else
++#endif
+
+ static void msr(int msqid)
+ {
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
new file mode 100644
index 000000000..b9fce880f
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
@@ -0,0 +1,75 @@
+From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:48:14 +0000
+Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS
+
+They are not portable across libc implementations
+therefore replace them with expanded macros
+
+Include <asm-generic/types.h> to get __s32 definitions
+its not a generally available typedef
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++--
+ utils/sctp/include/netinet/sctp.h | 9 +++++++--
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h
+index be599c7..8cc5e7e 100644
+--- a/testcases/kernel/syscalls/epoll2/include/epoll.h
++++ b/testcases/kernel/syscalls/epoll2/include/epoll.h
+@@ -85,7 +85,9 @@ struct epoll_event
+ } EPOLL_PACKED;
+
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Creates an epoll instance. Returns an fd for the new instance.
+ The "size" parameter is a hint specifying the number of file
+@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
+ extern int epoll_wait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout) __THROW;
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* sys/epoll.h */
+diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h
+index 51f5bfb..c61aef3 100644
+--- a/utils/sctp/include/netinet/sctp.h
++++ b/utils/sctp/include/netinet/sctp.h
+@@ -35,9 +35,12 @@
+
+ #include <stdint.h>
+ #include <linux/types.h>
++#include <asm-generic/types.h>
+ #include <sys/socket.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ typedef __s32 sctp_assoc_t;
+
+@@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from,
+ /* Return the address length for an address family. */
+ int sctp_getaddrlen(sa_family_t family);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* __linux_sctp_h__ */
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
new file mode 100644
index 000000000..a79763d00
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
@@ -0,0 +1,33 @@
+From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:51:20 +0000
+Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__
+
+mallocopt is not available on non glibc implementations
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c
+index 5bb8eff..934d951 100644
+--- a/utils/benchmark/ebizzy-0.3/ebizzy.c
++++ b/utils/benchmark/ebizzy-0.3/ebizzy.c
+@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[])
+ "\"never mmap\" option specified\n");
+ usage();
+ }
+-
++#ifdef __GLIBC__
+ if (never_mmap)
+ mallopt(M_MMAP_MAX, 0);
+-
++#endif
+ if (chunk_size < record_size) {
+ fprintf(stderr, "Chunk size %u smaller than record size %u\n",
+ chunk_size, record_size);
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
new file mode 100644
index 000000000..7060a64b1
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
@@ -0,0 +1,50 @@
+From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:57:04 +0000
+Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc
+
+getdents/getdents64 are implemented in musl and when we define static
+functions with same name, it errors out.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/getdents/getdents.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h
+index abea655..db63d89 100644
+--- a/testcases/kernel/syscalls/getdents/getdents.h
++++ b/testcases/kernel/syscalls/getdents/getdents.h
+@@ -34,12 +34,13 @@ struct linux_dirent {
+ char d_name[];
+ };
+
++#ifdef __GLIBC__
+ static inline int
+ getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size)
+ {
+ return ltp_syscall(__NR_getdents, fd, dirp, size);
+ }
+-
++#endif
+ struct linux_dirent64 {
+ uint64_t d_ino;
+ int64_t d_off;
+@@ -48,10 +49,11 @@ struct linux_dirent64 {
+ char d_name[];
+ };
+
++#ifdef __GLIBC__
+ static inline int
+ getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size)
+ {
+ return ltp_syscall(__NR_getdents64, fd, dirp64, size);
+ }
+-
++#endif
+ #endif /* GETDENTS_H */
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
new file mode 100644
index 000000000..462976da4
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
@@ -0,0 +1,70 @@
+From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:01:02 +0000
+Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition
+
+musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses
+__USE_GNU
+
+Fixes errors like
+error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/mremap/mremap01.c | 4 +++-
+ testcases/kernel/syscalls/mremap/mremap02.c | 2 ++
+ testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
+ 3 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: git/testcases/kernel/syscalls/mremap/mremap01.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap01.c
++++ git/testcases/kernel/syscalls/mremap/mremap01.c
+@@ -76,10 +76,12 @@
+ */
+ #include <unistd.h>
+ #include <errno.h>
++#include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
+-#include <fcntl.h>
++#undef _GNU_SOURCE
+
+ #include "test.h"
+ #include "safe_macros.h"
+Index: git/testcases/kernel/syscalls/mremap/mremap02.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap02.c
++++ git/testcases/kernel/syscalls/mremap/mremap02.c
+@@ -75,9 +75,11 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
++#undef _GNU_SOURCE
+
+ #include "test.h"
+
+Index: git/testcases/kernel/syscalls/mremap/mremap03.c
+===================================================================
+--- git.orig/testcases/kernel/syscalls/mremap/mremap03.c
++++ git/testcases/kernel/syscalls/mremap/mremap03.c
+@@ -76,9 +76,11 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
++#undef _GNU_SOURCE
+
+ #include "test.h"
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
new file mode 100644
index 000000000..529f4ed30
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
@@ -0,0 +1,50 @@
+From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:08:25 +0000
+Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request
+
+__ptrace_request is only available with glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++
+ testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c
+index a4028fc..f1880cd 100644
+--- a/testcases/kernel/syscalls/ptrace/ptrace03.c
++++ b/testcases/kernel/syscalls/ptrace/ptrace03.c
+@@ -102,7 +102,11 @@ static pid_t unused_pid;
+ static pid_t zero_pid;
+
+ struct test_case_t {
++#ifdef __GLIBC__
+ enum __ptrace_request request;
++#else
++ int request;
++#endif
+ pid_t *pid;
+ int exp_errno;
+ } test_cases[] = {
+diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
+index ae538e9..85aa89d 100644
+--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
++++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
+@@ -130,7 +130,11 @@ static char *strings[] = {
+ SPT(KILL)
+ SPT(SINGLESTEP)
+ };
++#ifdef __GLIBC__
+ static inline char *strptrace(enum __ptrace_request request)
++#else
++static inline char *strptrace(int request)
++#endif
+ {
+ return strings[request];
+ }
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..03aa45df8
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
@@ -0,0 +1,70 @@
+From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:14:58 +0000
+Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE
+
+Fixes musl build failure e.g.
+error: 'SA_NOMASK' undeclared here (not in a function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 +
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +-
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 +
+ testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+index 5cf89cc..bdcb91a 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+@@ -28,6 +28,7 @@
+ /* sigset_t type. */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+index a1da743..8a27a0f 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+@@ -23,7 +23,7 @@
+ /* Description: This tests the rt_sigaction() syscall */
+ /* rt_sigaction Expected EFAULT error check */
+ /******************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+index 175d220..e7627cd 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+@@ -24,6 +24,7 @@
+ /* rt_sigaction Expected EINVAL error check */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+index 74e5a61..75c57fc 100644
+--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
++++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+@@ -39,6 +39,7 @@
+ /* sigsetsize should indicate the size of a sigset_t type. */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <signal.h>
+ #include <errno.h>
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..f65fad12d
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
@@ -0,0 +1,31 @@
+From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:21:05 +0000
+Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE
+
+Fixes musl build errors like
+error: 'SA_NOMASK' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ testcases/misc/crash/crash01.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c
+index 0574521..08a02e7 100644
+--- a/testcases/misc/crash/crash01.c
++++ b/testcases/misc/crash/crash01.c
+@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user
+ benchmark.
+
+ */
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+--
+2.7.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
new file mode 100644
index 000000000..c730d46e6
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
@@ -0,0 +1,48 @@
+From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:24:44 +0000
+Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of
+ __sighandler_t
+
+When _GNU_SOURCE is used then both typedefs are same and using
+sighandler_t makes it work on musl too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ include/lapi/rt_sigaction.h | 2 +-
+ testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+Index: git/include/lapi/rt_sigaction.h
+===================================================================
+--- git.orig/include/lapi/rt_sigaction.h
++++ git/include/lapi/rt_sigaction.h
+@@ -36,12 +36,12 @@
+ #if defined(__mips__)
+ struct kernel_sigaction {
+ unsigned int sa_flags;
+- __sighandler_t k_sa_handler;
++ sighandler_t k_sa_handler;
+ sigset_t sa_mask;
+ };
+ #else
+ struct kernel_sigaction {
+- __sighandler_t k_sa_handler;
++ sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+ sigset_t sa_mask;
+Index: git/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+===================================================================
+--- git.orig/testcases/kernel/syscalls/rt_sigsuspend/Makefile
++++ git/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+@@ -19,4 +19,7 @@
+ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/testcases.mk
++
++CFLAGS += -D_GNU_SOURCE
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
new file mode 100644
index 000000000..c2ef899cc
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
@@ -0,0 +1,55 @@
+From 5a77e2bdc083f4f842a8ba7c2db1a7ac6e5f0664 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 31 May 2017 21:26:05 -0400
+Subject: [PATCH] Add periodic output for long time test.
+
+This is needed in context of having scripts running ltp tests and
+waiting with a timeout for the output of the tests.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ .../kernel/controllers/memcg/stress/memcg_stress_test.sh | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+index af1a708..084e628 100755
+--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
++++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+@@ -37,7 +37,8 @@ if [ "x$(grep -w memory /proc/cgroups | cut -f4)" != "x1" ]; then
+ exit 0
+ fi
+
+-RUN_TIME=$(( 15 * 60 ))
++ONE_MINUTE=60
++RUN_TIME=15
+
+ cleanup()
+ {
+@@ -62,7 +63,7 @@ do_mount()
+ # $1 - Number of cgroups
+ # $2 - Allocated how much memory in one process? in MB
+ # $3 - The interval to touch memory in a process
+-# $4 - How long does this test run ? in second
++# $4 - How long does this test run ? in minutes
+ run_stress()
+ {
+ do_mount;
+@@ -81,7 +82,11 @@ run_stress()
+ eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null
+ done
+
+- sleep $4
++ for i in $(seq 0 $(($4-1)))
++ do
++ eval echo "Started $i min ago. Still alive... "
++ sleep $ONE_MINUTE
++ done
+
+ for i in $(seq 0 $(($1-1)))
+ do
+--
+2.8.1
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
new file mode 100644
index 000000000..71e32a5e5
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
@@ -0,0 +1,32 @@
+From f7c602b639db0d118e07d3fa7b6deead0be0c72b Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 8 Feb 2017 16:17:17 +0800
+Subject: [PATCH 3/5] Fix test_proc_kill hanging
+
+Sometimes the signal is delivered to memcg_process before the framework took
+into consideration its pid entered in the tasks. Fixed by delaying the signal
+send command.
+
+Signed-off-by: George Nita <george.nita@enea.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+Upstream-Status: Pending
+---
+ testcases/kernel/controllers/memcg/functional/memcg_lib.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+index b785fe3..2918cc5 100755
+--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+@@ -283,6 +283,7 @@ test_proc_kill()
+ pid=$!
+ TST_CHECKPOINT_WAIT 0
+ echo $pid > tasks
++ sleep 1
+
+ signal_memcg_process $pid $3
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch b/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
new file mode 100644
index 000000000..04532be79
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
@@ -0,0 +1,41 @@
+From 672a56be14426eae44864673c6c2afca0ab89d46 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Fri, 13 May 2016 11:11:28 -0500
+Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on string
+ printf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+acl1.c: In function 'test_acl_default':
+acl1.c:317:2: error: format not a string literal and no format arguments
+[-Werror=format-security]
+ printf(cmd);
+
+[YOCTO #9548]
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ testcases/network/nfsv4/acl/acl1.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c
+index b8b67b4..7c7c506 100644
+--- a/testcases/network/nfsv4/acl/acl1.c
++++ b/testcases/network/nfsv4/acl/acl1.c
+@@ -314,7 +314,7 @@ void test_acl_default(char *dir, acl_t acl)
+ char *cmd = malloc(256);
+
+ strcpy(cmd, "chmod 7777 ");
+- printf(cmd);
++ printf(cmd, NULL);
+ strcat(cmd, dir);
+ system(cmd);
+ acl2 = acl_get_file(path, ACL_TYPE_ACCESS);
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch b/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch
new file mode 100644
index 000000000..e7c927e11
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch
@@ -0,0 +1,252 @@
+From 04da9478887e705ea38e4f097492da20e651686c Mon Sep 17 00:00:00 2001
+From: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+Date: Wed, 13 Sep 2017 15:48:42 +0800
+Subject: [PATCH] commands/ar01: Fix for test in deterministic mode
+
+If binutils was configured with --enable-deterministic-archives,
+ar will run in deterministic mode by default, and use zero for
+timestamps and uids/gids, which makes the test case abnormal.
+
+Fix this by add the "U" modifier when deterministic mode is default.
+
+Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+Signed-off-by: Fei Jie <feij.fnst@cn.fujitsu.com>
+
+Upstream-Status: Backport
+[http://lists.linux.it/pipermail/ltp/2017-September/005668.html]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ testcases/commands/ar/ar01 | 92 ++++++++++++++++++++++++++--------------------
+ 1 file changed, 52 insertions(+), 40 deletions(-)
+
+diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01
+index ddab2e0..d688f76 100644
+--- a/testcases/commands/ar/ar01
++++ b/testcases/commands/ar/ar01
+@@ -23,14 +23,26 @@
+ # This is a basic ar command test.
+ #
+ TST_CNT=17
++TST_SETUP=setup
+ TST_TESTFUNC=test
+ TST_NEEDS_TMPDIR=1
+ . tst_test.sh
+
++setup()
++{
++ ar --help | grep "use zero for timestamps and uids/gids (default)" \
++ >/dev/null
++ if [ $? -eq 0 ]; then
++ MOD="U"
++ else
++ MOD=""
++ fi
++}
++
+ test1()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+- ROD ar -ra file1.in lib.a $TST_DATAROOT/file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++ ROD ar -ra"$MOD" file1.in lib.a $TST_DATAROOT/file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -47,9 +59,9 @@ test1()
+
+ test2()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
+- ROD ar -ma file1.in lib.a file4.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in $TST_DATAROOT/file4.in
++ ROD ar -ma"$MOD" file1.in lib.a file4.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile4.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -66,8 +78,8 @@ test2()
+
+ test3()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+- ROD ar -rb file3.in lib.a $TST_DATAROOT/file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++ ROD ar -rb"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -84,9 +96,9 @@ test3()
+
+ test4()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+- $TST_DATAROOT/file2.in
+- ROD ar -mb file3.in lib.a file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++ $TST_DATAROOT/file2.in
++ ROD ar -mb"$MOD" file3.in lib.a file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -103,7 +115,7 @@ test4()
+
+ test5()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in \> ar.out
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
+
+ if [ -s ar.out ]; then
+ tst_res TFAIL "ar produced output unexpectedly (-c)"
+@@ -117,7 +129,7 @@ test5()
+
+ test6()
+ {
+- ROD ar -qc lib.a $TST_DATAROOT/file1.in \> ar.out
++ ROD ar -qc"$MOD" lib.a $TST_DATAROOT/file1.in \> ar.out
+
+ if [ -s ar.out ]; then
+ tst_res TFAIL "ar produced output unexpectedly (-qc)"
+@@ -131,9 +143,9 @@ test6()
+
+ test7()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in
+- ROD ar -d lib.a file1.in file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in
++ ROD ar -d"$MOD" lib.a file1.in file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file3.in\n" > ar.exp
+@@ -150,9 +162,9 @@ test7()
+
+ test8()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in
+- ROD ar -d lib.a
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in
++ ROD ar -d"$MOD" lib.a
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -169,8 +181,8 @@ test8()
+
+ test9()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
+- ROD ar -ri file3.in lib.a $TST_DATAROOT/file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in
++ ROD ar -ri"$MOD" file3.in lib.a $TST_DATAROOT/file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -187,9 +199,9 @@ test9()
+
+ test10()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+- $TST_DATAROOT/file2.in
+- ROD ar -mi file3.in lib.a file2.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++ $TST_DATAROOT/file2.in
++ ROD ar -mi"$MOD" file3.in lib.a file2.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -206,9 +218,9 @@ test10()
+
+ test11()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
+- $TST_DATAROOT/file2.in
+- ROD ar -m lib.a file3.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file3.in \
++ $TST_DATAROOT/file2.in
++ ROD ar -m"$MOD" lib.a file3.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\n" > ar.exp
+@@ -225,9 +237,9 @@ test11()
+
+ test12()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in
+- ROD ar -p lib.a \> ar.out
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in
++ ROD ar -p"$MOD" lib.a \> ar.out
+
+ printf "This is file one\nThis is file two\nThis is file three\n" > ar.exp
+
+@@ -244,9 +256,9 @@ test12()
+ test13()
+ {
+
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in
+- ROD ar -q lib.a $TST_DATAROOT/file4.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in
++ ROD ar -q"$MOD" lib.a $TST_DATAROOT/file4.in
+ ROD ar -t lib.a \> ar.out
+
+ printf "file1.in\nfile2.in\nfile3.in\nfile4.in\n" > ar.exp
+@@ -264,14 +276,14 @@ test13()
+ test14()
+ {
+ ROD touch file0.in
+- ROD ar -cr lib.a file0.in $TST_DATAROOT/file1.in
++ ROD ar -cr"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
+
+ file0_mtime1=$(ar -tv lib.a | grep file0.in)
+ file1_mtime1=$(ar -tv lib.a | grep file1.in)
+
+ touch -c -t $(date --date='next day' +"%Y%m%d%H%M") file0.in
+
+- ROD ar -ru lib.a file0.in $TST_DATAROOT/file1.in
++ ROD ar -ru"$MOD" lib.a file0.in $TST_DATAROOT/file1.in
+
+ file0_mtime2=$(ar -tv lib.a | grep file0.in)
+ file1_mtime2=$(ar -tv lib.a | grep file1.in)
+@@ -293,7 +305,7 @@ test14()
+
+ test15()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in
+ ROD ar -tv lib.a \> ar.out
+
+ if grep -q '[rwx-]\{9\} [0-9].*/[0-9].*\s*[0-9].*.*file1.in' ar.out; then
+@@ -308,9 +320,9 @@ test15()
+
+ test16()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
+- $TST_DATAROOT/file3.in
+- ROD ar -xv lib.a \> ar.out
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in \
++ $TST_DATAROOT/file3.in
++ ROD ar -xv"$MOD" lib.a \> ar.out
+
+ printf "x - file1.in\nx - file2.in\nx - file3.in\n" > ar.exp
+
+@@ -332,8 +344,8 @@ test16()
+
+ test17()
+ {
+- ROD ar -cr lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
+- ROD ar -xv lib.a file2.in \> ar.out
++ ROD ar -cr"$MOD" lib.a $TST_DATAROOT/file1.in $TST_DATAROOT/file2.in
++ ROD ar -xv"$MOD" lib.a file2.in \> ar.out
+
+ printf "x - file2.in\n" > ar.exp
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch b/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
new file mode 100644
index 000000000..5096a85c1
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp/0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch
@@ -0,0 +1,40 @@
+From 67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d Mon Sep 17 00:00:00 2001
+From: Li Wang <liwang@redhat.com>
+Date: Tue, 23 Jan 2018 17:46:35 +0800
+Subject: [PATCH] safe_macros: make is_fuse() return zero if fs_type is NULL
+
+This commmit 28507e514c(safe_mount: Do not try mount() syscall for FUSE fs)
+involves FUSE fs check in safe_mount(), but we'd better guarantee the "fs_type"
+is legal to check in is_fuse() function otherwise system will kill the program.
+
+ cmdline="fanotify06"
+ contacts=""
+ analysis=exit
+ <<<test_output>>>
+ tst_test.c:980: INFO: Timeout per run is 0h 10m 00s
+ tst_test.c:1025: BROK: Test killed by SIGSEGV!
+
+Signed-off-by: Li Wang <liwang@redhat.com>
+Acked-by: Jan Stancek <jstancek@redhat.com>
+Upstream-Status: Accepted [https://github.com/linux-test-project/ltp/commit/67af7dbe8bdf29f9ed980d8d29feeae32a0a7a1d]
+---
+ lib/safe_macros.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/safe_macros.c b/lib/safe_macros.c
+index c48e436dc..abdeca013 100644
+--- a/lib/safe_macros.c
++++ b/lib/safe_macros.c
+@@ -708,6 +708,9 @@ static int is_fuse(const char *fs_type)
+ {
+ unsigned int i;
+
++ if (!fs_type)
++ return 0;
++
+ for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) {
+ if (!strcmp(fuse_fs_types[i], fs_type))
+ return 1;
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/ltp/ltp_20180118.bb b/poky/meta/recipes-extended/ltp/ltp_20180118.bb
new file mode 100644
index 000000000..14fb41b3b
--- /dev/null
+++ b/poky/meta/recipes-extended/ltp/ltp_20180118.bb
@@ -0,0 +1,116 @@
+SUMMARY = "Linux Test Project"
+DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features."
+HOMEPAGE = "http://ltp.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \
+ file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+ file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+ file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \
+ file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
+"
+
+DEPENDS = "attr libaio libcap acl openssl zip-native"
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
+SRCREV = "731cd34e682d297b207668be8b1d15320a9ac1b1"
+
+SRC_URI = "git://github.com/linux-test-project/ltp.git \
+ file://0001-configure-add-knob-to-control-numa-support.patch \
+ file://0001-configure-Fix-default-value-of-without-numa-switch-i.patch \
+ file://0003-Add-knob-to-control-tirpc-support.patch \
+ file://0004-build-Add-option-to-select-libc-implementation.patch \
+ file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
+ file://0007-fix-__WORDSIZE-undeclared-when-building-with-musl.patch \
+ file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
+ file://0009-fix-redefinition-of-struct-msgbuf-error-building-wit.patch \
+ file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
+ file://0018-guard-mallocopt-with-__GLIBC__.patch \
+ file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
+ file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
+ file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
+ file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
+ file://0026-crash01-Define-_GNU_SOURCE.patch \
+ file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
+ file://0034-periodic_output.patch \
+ file://0035-fix-test_proc_kill-hang.patch \
+ file://0036-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
+ file://0039-commands-ar01-Fix-for-test-in-deterministic-mode.patch \
+ file://0040-safe_macros-make-is_fuse-return-zero-if-fs_type-is-N.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+export prefix = "/opt/ltp"
+export exec_prefix = "/opt/ltp"
+
+PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
+EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
+EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite "
+# ltp network/rpc test cases ftbfs when libtirpc is found
+EXTRA_OECONF += " --without-tirpc "
+
+do_install(){
+ install -d ${D}/opt/ltp/
+ oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
+
+ # fixup not deploy STPfailure_report.pl to avoid confusing about it fails to run
+ # as it lacks dependency on some perl moudle such as LWP::Simple
+ # And this script previously works as a tool for analyzing failures from LTP
+ # runs on the OSDL's Scaleable Test Platform (STP) and it mainly accesses
+ # http://khack.osdl.org to retrieve ltp test results run on
+ # OSDL's Scaleable Test Platform, but now http://khack.osdl.org unaccessible
+ rm -rf ${D}/opt/ltp/bin/STPfailure_report.pl
+
+ # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
+ cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
+}
+
+RDEPENDS_${PN} = "\
+ acl \
+ at \
+ attr \
+ bash \
+ cpio \
+ cronie \
+ curl \
+ e2fsprogs-mke2fs \
+ expect \
+ gawk \
+ gzip \
+ iproute2 \
+ ldd \
+ libaio \
+ logrotate \
+ perl \
+ python-core \
+ procps \
+ unzip \
+ util-linux \
+ which \
+ tar \
+"
+
+FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/* /opt/ltp/testcases/data/nm01/lib.a /opt/ltp/lib/libmem.a"
+
+# Avoid stripping some generated binaries otherwise some of the ltp tests such as ldd01 & nm01 fail
+INHIBIT_PACKAGE_STRIP_FILES = "/opt/ltp/testcases/bin/nm01 /opt/ltp/testcases/bin/ldd01"
+INSANE_SKIP_${PN} += "already-stripped staticdev"
+
+# Avoid file dependency scans, as LTP checks for things that may or may not
+# exist on the running system. For instance it has specific checks for
+# csh and ksh which are not typically part of OpenEmbedded systems (but
+# can be added via additional layers.)
+SKIP_FILEDEPS_${PN} = '1'
diff --git a/poky/meta/recipes-extended/lzip/lzip_1.19.bb b/poky/meta/recipes-extended/lzip/lzip_1.19.bb
new file mode 100644
index 000000000..099b36470
--- /dev/null
+++ b/poky/meta/recipes-extended/lzip/lzip_1.19.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Lossless data compressor based on the LZMA algorithm"
+HOMEPAGE = "http://lzip.nongnu.org/lzip.html"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=76d6e300ffd8fb9d18bd9b136a9bba13 \
+ file://decoder.cc;beginline=3;endline=16;md5=db09fe3f9573f94d0076f7f07959e6e1"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/lzip/lzip-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4dd8790d7528440d034fc713a8680bd3"
+SRC_URI[sha256sum] = "ffadc4f56be1bc0d3ae155ec4527bd003133bdc703a753b2cc683f610e646ba9"
+
+CONFIGUREOPTS = "\
+ '--srcdir=${S}' \
+ '--prefix=${prefix}' \
+ '--exec-prefix=${exec_prefix}' \
+ '--bindir=${bindir}' \
+ '--datadir=${datadir}' \
+ '--infodir=${infodir}' \
+ '--sysconfdir=${sysconfdir}' \
+ 'CXX=${CXX}' \
+ 'CPPFLAGS=${CPPFLAGS}' \
+ 'CXXFLAGS=${CXXFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+"
+EXTRA_OEMAKE = ""
+
+B = "${S}/obj"
+do_configure () {
+ ${S}/configure ${CONFIGUREOPTS}
+}
+
+do_install () {
+ oe_runmake 'DESTDIR=${D}' install
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb b/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb
new file mode 100644
index 000000000..8328a671f
--- /dev/null
+++ b/poky/meta/recipes-extended/man-db/man-db_2.8.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "An implementation of the standard Unix documentation system accessed using the man command"
+HOMEPAGE = "http://man-db.nongnu.org/"
+LICENSE = "LGPLv2.1 & GPLv2"
+LIC_FILES_CHKSUM = "file://docs/COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://docs/COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/man-db/man-db-${PV}.tar.xz"
+SRC_URI[md5sum] = "51842978e06686286421f9498d1009b7"
+SRC_URI[sha256sum] = "a6aec641ca3d9942b054cc0e9c3f05cb46a3a992bc0006795755e2fed1357f3e"
+
+DEPENDS = "libpipeline gdbm groff-native"
+
+# | /usr/src/debug/man-db/2.8.0-r0/man-db-2.8.0/src/whatis.c:939: undefined reference to `_nl_msg_cat_cntr'
+USE_NLS_libc-musl = "no"
+
+inherit gettext pkgconfig autotools
+
+EXTRA_OECONF = "--with-pager=less --disable-cache-owner"
+
+do_install_append_libc-musl() {
+ rm -f ${D}${libdir}/charset.alias
+}
+
+FILES_${PN} += "${prefix}/lib/tmpfiles.d"
+
+FILES_${PN}-dev += "${libdir}/man-db/libman.so ${libdir}/${BPN}/libmandb.so"
+
+RDEPENDS_${PN} += "groff"
+RRECOMMENDS_${PN} += "less"
+RPROVIDES_${PN} += " man"
+
+def compress_pkg(d):
+ if bb.utils.contains("INHERIT", "compress_doc", True, False, d):
+ compress = d.getVar("DOC_COMPRESS")
+ if compress == "gz":
+ return "gzip"
+ elif compress == "bz2":
+ return "bzip2"
+ elif compress == "xz":
+ return "xz"
+ return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
diff --git a/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb b/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb
new file mode 100644
index 000000000..f8bd090d1
--- /dev/null
+++ b/poky/meta/recipes-extended/man-pages/man-pages_4.14.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Linux man-pages"
+DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs"
+SECTION = "console/utils"
+HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages"
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://README;md5=794f701617cc03fe50c53257660d8ec4"
+SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "82bd2d05c4d0dba5e7a90d39c9555197"
+SRC_URI[sha256sum] = "aeebc6b09a11e7f7bbc98f3984fe8b8b2bde9d2f5f9dcbd4348a9e0d93704238"
+
+RDEPENDS_${PN} = "man"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+# Only deliveres man-pages so FILES_${PN} gets everything
+FILES_${PN}-doc = ""
+FILES_${PN} = "${mandir}/*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch b/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
new file mode 100644
index 000000000..bf8037cd2
--- /dev/null
+++ b/poky/meta/recipes-extended/mc/files/0001-mc-replace-perl-w-with-use-warnings.patch
@@ -0,0 +1,129 @@
+From cdc7c278212ae836eecb4cc9d42c29443cc128a0 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 6 Apr 2017 02:24:28 -0700
+Subject: [PATCH] mc: replace "perl -w" with "use warnings"
+
+The shebang's max length is usually 128 as defined in
+/usr/include/linux/binfmts.h:
+ #define BINPRM_BUF_SIZE 128
+
+There would be errors when @PERL@ is longer than 128, use
+'/usr/bin/env perl' can fix the problem, but '/usr/bin/env perl -w'
+doesn't work:
+
+/usr/bin/env: perl -w: No such file or directory
+
+So replace "perl -w" with "use warnings" to make it work.
+
+The man2hlp.in already has "use warnings;", so just remove '-w' is OK.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/man2hlp/man2hlp.in | 2 +-
+ src/vfs/extfs/helpers/a+.in | 4 +++-
+ src/vfs/extfs/helpers/mailfs.in | 3 ++-
+ src/vfs/extfs/helpers/patchfs.in | 3 ++-
+ src/vfs/extfs/helpers/ulib.in | 4 +++-
+ src/vfs/extfs/helpers/uzip.in | 3 ++-
+ 6 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/src/man2hlp/man2hlp.in b/src/man2hlp/man2hlp.in
+index f095830..558a674 100644
+--- a/src/man2hlp/man2hlp.in
++++ b/src/man2hlp/man2hlp.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # Man page to help file converter
+ # Copyright (C) 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
+diff --git a/src/vfs/extfs/helpers/a+.in b/src/vfs/extfs/helpers/a+.in
+index 579441c..fe446f4 100644
+--- a/src/vfs/extfs/helpers/a+.in
++++ b/src/vfs/extfs/helpers/a+.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # External filesystem for mc, using mtools
+ # Written Ludek Brukner <lubr@barco.cz>, 1997
+@@ -9,6 +9,8 @@
+
+ # These mtools components must be in PATH for this to work
+
++use warnings;
++
+ sub quote {
+ $_ = shift(@_);
+ s/([^\w\/.+-])/\\$1/g;
+diff --git a/src/vfs/extfs/helpers/mailfs.in b/src/vfs/extfs/helpers/mailfs.in
+index e9455be..059f41f 100644
+--- a/src/vfs/extfs/helpers/mailfs.in
++++ b/src/vfs/extfs/helpers/mailfs.in
+@@ -1,6 +1,7 @@
+-#! @PERL@ -w
++#! @PERL@
+
+ use bytes;
++use warnings;
+
+ # MC extfs for (possibly compressed) Berkeley style mailbox files
+ # Peter Daum <gator@cs.tu-berlin.de> (Jan 1998, mc-4.1.24)
+diff --git a/src/vfs/extfs/helpers/patchfs.in b/src/vfs/extfs/helpers/patchfs.in
+index ef407de..3ad4b53 100644
+--- a/src/vfs/extfs/helpers/patchfs.in
++++ b/src/vfs/extfs/helpers/patchfs.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # Written by Adam Byrtek <alpha@debian.org>, 2002
+ # Rewritten by David Sterba <dave@jikos.cz>, 2009
+@@ -9,6 +9,7 @@
+
+ use bytes;
+ use strict;
++use warnings;
+ use POSIX;
+ use File::Temp 'tempfile';
+
+diff --git a/src/vfs/extfs/helpers/ulib.in b/src/vfs/extfs/helpers/ulib.in
+index 418611f..82c7ccf 100644
+--- a/src/vfs/extfs/helpers/ulib.in
++++ b/src/vfs/extfs/helpers/ulib.in
+@@ -1,9 +1,11 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # VFS to manage the gputils archives.
+ # Written by Molnár Károly (proton7@freemail.hu) 2012
+ #
+
++use warnings;
++
+ my %month = ('jan' => '01', 'feb' => '02', 'mar' => '03',
+ 'apr' => '04', 'may' => '05', 'jun' => '06',
+ 'jul' => '07', 'aug' => '08', 'sep' => '09',
+diff --git a/src/vfs/extfs/helpers/uzip.in b/src/vfs/extfs/helpers/uzip.in
+index b1c4f90..c8eb335 100644
+--- a/src/vfs/extfs/helpers/uzip.in
++++ b/src/vfs/extfs/helpers/uzip.in
+@@ -1,4 +1,4 @@
+-#! @PERL@ -w
++#! @PERL@
+ #
+ # zip file archive Virtual File System for Midnight Commander
+ # Version 1.4.0 (2001-08-07).
+@@ -9,6 +9,7 @@
+ use POSIX;
+ use File::Basename;
+ use strict;
++use warnings;
+
+ #
+ # Configuration options
+--
+2.10.2
+
diff --git a/poky/meta/recipes-extended/mc/mc_4.8.20.bb b/poky/meta/recipes-extended/mc/mc_4.8.20.bb
new file mode 100644
index 000000000..70d1b5e0a
--- /dev/null
+++ b/poky/meta/recipes-extended/mc/mc_4.8.20.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0 util-linux"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+ file://0001-mc-replace-perl-w-with-use-warnings.patch \
+ "
+SRC_URI[md5sum] = "dcfc7aa613c62291a0f71f6b698d8267"
+SRC_URI[sha256sum] = "2d85daaa6ab26e524946df4823ac2f69802bc16bc967781b5e28d5b86fc3b979"
+
+inherit autotools gettext pkgconfig
+
+#
+# Both Samba (smb) and sftp require package delivered from meta-openembedded
+#
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
+PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+
+ rm ${D}${libexecdir}/mc/extfs.d/s3+ ${D}${libexecdir}/mc/extfs.d/uc1541
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+ ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+ ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+ ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \
+ ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \
+ ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
diff --git a/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
new file mode 100644
index 000000000..a89161404
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -0,0 +1,44 @@
+From 1f5baf3ad95ae4c39efe4d8ad8b2e642b3a351da Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 9 Feb 2016 11:44:01 +0200
+Subject: [PATCH] Fix the path of corosync and dlm header files check
+
+Original Makefile will check headers on host instead of sysroot.
+Fix it.
+
+Upstream-Status: Inappropriate [Yocto specific]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+mdadm only works with corosync 2.x which provides header file corosync/cmap.h.
+If build mdadm with corosync 1.x, it fails with:
+
+| member.c:12:27: fatal error: corosync/cmap.h: No such file or directory
+| #include <corosync/cmap.h>
+| ^
+
+Build with corosync only header file corosync/cmap.h exists.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index fd79cfb..34150a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -80,8 +80,8 @@ MDMON_DIR = $(RUN_DIR)
+ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
+ SYSTEMD_DIR=/lib/systemd/system
+
+-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
+-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
++COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] || echo -DNO_COROSYNC)
++DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM)
+
+ DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
+ DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch b/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch
new file mode 100644
index 000000000..a4b7b8acd
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch
@@ -0,0 +1,31 @@
+From a129ee6d80f3b2cda0d827c35fa81a517cf6d505 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 13 Oct 2017 10:27:34 -0700
+Subject: [PATCH] Use CC to check for implicit-fallthrough warning support
+
+This warning it new in gcc7 and in cross compile case
+its possible that build host gcc is version 7+ but the
+cross compile used for compiling mdadm is < version 7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index d207ee4..971f255 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,7 +48,7 @@ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
+
+-FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
++FALLTHROUGH := $(shell ${CC} -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
+ ifneq "$(FALLTHROUGH)" "0"
+ CWFLAGS += -Wimplicit-fallthrough=0
+ endif
+--
+2.14.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch b/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
new file mode 100644
index 000000000..acd64ada2
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
@@ -0,0 +1,48 @@
+From 943616e5dffb79f307e4bd9b249d316212998750 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 18 Dec 2016 08:30:51 +0000
+Subject: [PATCH] include <sys/sysmacros.h> for major/minor defintions
+
+glibc 2.25 is warning about it if applications depend on
+sys/types.h for these macros, it expects to be included
+from <sys/sysmacros.h>
+
+Fixes
+| Grow.c:3534:13: error: In the GNU C Library, "minor" is defined
+| by <sys/sysmacros.h>. For historical compatibility, it is
+| currently defined by <sys/types.h> as well, but we plan to
+| remove this soon. To use "minor", include <sys/sysmacros.h>
+| directly. If you did not intend to use a system-defined macro
+| "minor", you should undefine it after including <sys/types.h>. [-Werror]
+| Query.c: In function 'Query':
+| Query.c:105:13: error: In the GNU C Library, "makedev" is defined
+| by <sys/sysmacros.h>. For historical compatibility, it is
+| currently defined by <sys/types.h> as well, but we plan to
+| remove this soon. To use "makedev", include <sys/sysmacros.h>
+| directly. If you did not intend to use a system-defined macro
+| "makedev", you should undefine it after including <sys/types.h>. [-Werror]
+| makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev)
+| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdadm.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index 8c8f4d1..3ce13b5 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -34,6 +34,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
+ #endif
+
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <sys/stat.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch b/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
new file mode 100644
index 000000000..ce15170c7
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
@@ -0,0 +1,37 @@
+From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Fri, 17 Mar 2017 19:55:42 +0800
+Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile
+
+There are many errors like 'error: this statement may fall through'.
+But the logic is right. So add the flag Wimplicit-fallthrough=0
+to disable the error messages. The method I use is from
+https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+#index-Wimplicit-fallthrough-375
+
+Signed-off-by: Xiao Ni <xni@redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
+---
+Upstream-Status: Backport
+ Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 0f307ec..e1a7058 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
+
++FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
++ifneq "$(FALLTHROUGH)" "0"
++CWFLAGS += -Wimplicit-fallthrough=0
++endif
++
+ ifdef DEBIAN
+ CPPFLAGS += -DDEBIAN
+ endif
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch b/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch
new file mode 100644
index 000000000..4cf809290
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch
@@ -0,0 +1,43 @@
+From 6d369e8f226594632ce4260129509daf7030de0a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 9 May 2016 22:03:57 +0000
+Subject: [PATCH] mdadm.h: Undefine dprintf before redefining
+
+dprintf is also defined in libc see
+usr/include/bits/stdio2.h, this comes into
+play especially when fortify sources is enabled
+and compilers like clang reports the override
+
+In file included from policy.c:25:
+./mdadm.h:1562:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined]
+ ^
+/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdadm.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index 230e60f..8c8f4d1 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -1554,11 +1554,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container)
+ }
+
+ #ifdef DEBUG
++#undef dprintf
+ #define dprintf(fmt, arg...) \
+ fprintf(stderr, "%s: %s: "fmt, Name, __func__, ##arg)
+ #define dprintf_cont(fmt, arg...) \
+ fprintf(stderr, fmt, ##arg)
+ #else
++#undef dprintf
+ #define dprintf(fmt, arg...) \
+ ({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
+ #define dprintf_cont(fmt, arg...) \
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch b/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
new file mode 100644
index 000000000..cbce053a3
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
@@ -0,0 +1,75 @@
+From bb4df273041ba206008bdb0ada75ccd97c29f623 Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Fri, 17 Mar 2017 19:55:43 +0800
+Subject: [PATCH 2/5] mdadm: Specify enough length when write to buffer
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In Detail.c the buffer path in function Detail is defined as path[200],
+in fact the max lenth of content which needs to write to the buffer is
+287. Because the length of dname of struct dirent is 255.
+During building it reports error:
+error: ‘%s’ directive writing up to 255 bytes into a region of size 189
+[-Werror=format-overflow=]
+
+In function examine_super0 there is a buffer nb with length 5.
+But it need to show a int type argument. The lenght of max
+number of int is 10. So the buffer length should be 11.
+
+In human_size function the length of buf is 30. During building
+there is a error:
+output between 20 and 47 bytes into a destination of size 30.
+Change the length to 47.
+
+Signed-off-by: Xiao Ni <xni@redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
+---
+Upstream-Status: Backport
+ Detail.c | 2 +-
+ super0.c | 2 +-
+ util.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Detail.c b/Detail.c
+index 509b0d4..cb33794 100644
+--- a/Detail.c
++++ b/Detail.c
+@@ -575,7 +575,7 @@ This is pretty boring
+ printf(" Member Arrays :");
+
+ while (dir && (de = readdir(dir)) != NULL) {
+- char path[200];
++ char path[287];
+ char vbuf[1024];
+ int nlen = strlen(sra->sys_name);
+ dev_t devid;
+diff --git a/super0.c b/super0.c
+index 938cfd9..f5b4507 100644
+--- a/super0.c
++++ b/super0.c
+@@ -231,7 +231,7 @@ static void examine_super0(struct supertype *st, char *homehost)
+ d++) {
+ mdp_disk_t *dp;
+ char *dv;
+- char nb[5];
++ char nb[11];
+ int wonly, failfast;
+ if (d>=0) dp = &sb->disks[d];
+ else dp = &sb->this_disk;
+diff --git a/util.c b/util.c
+index f100972..32bd909 100644
+--- a/util.c
++++ b/util.c
+@@ -811,7 +811,7 @@ unsigned long calc_csum(void *super, int bytes)
+ #ifndef MDASSEMBLE
+ char *human_size(long long bytes)
+ {
+- static char buf[30];
++ static char buf[47];
+
+ /* We convert bytes to either centi-M{ega,ibi}bytes or
+ * centi-G{igi,ibi}bytes, with appropriate rounding,
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch b/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
new file mode 100644
index 000000000..dcec84ffc
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
@@ -0,0 +1,59 @@
+From bc87af1314325b00c6ac002a60a2b0f0caa81e34 Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Sat, 18 Mar 2017 10:33:44 +0800
+Subject: [PATCH 3/5] Replace snprintf with strncpy at some places to avoid
+ truncation
+
+In gcc7 there are some building errors like:
+directive output may be truncated writing up to 31 bytes into a region of size 24
+snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
+
+It just need to copy one string to target. So use strncpy to replace it.
+
+For this line code: snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
+Because mpb->sig has the content of version after magic, so
+it's better to use strncpy to replace snprintf too.
+
+Signed-off-by: Xiao Ni <xni@redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
+---
+Upstream-Status: Backport
+ super-intel.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index 57c7e75..5499098 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -1811,7 +1811,8 @@ static void examine_super_imsm(struct supertype *st, char *homehost)
+ __u32 reserved = imsm_reserved_sectors(super, super->disks);
+ struct dl *dl;
+
+- snprintf(str, MPB_SIG_LEN, "%s", mpb->sig);
++ strncpy(str, (char *)mpb->sig, MPB_SIG_LEN);
++ str[MPB_SIG_LEN-1] = '\0';
+ printf(" Magic : %s\n", str);
+ snprintf(str, strlen(MPB_VERSION_RAID0), "%s", get_imsm_version(mpb));
+ printf(" Version : %s\n", get_imsm_version(mpb));
+@@ -7142,14 +7143,16 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
+
+ u->type = update_rename_array;
+ u->dev_idx = vol;
+- snprintf((char *) u->name, MAX_RAID_SERIAL_LEN, "%s", name);
++ strncpy((char *) u->name, name, MAX_RAID_SERIAL_LEN);
++ u->name[MAX_RAID_SERIAL_LEN-1] = '\0';
+ append_metadata_update(st, u, sizeof(*u));
+ } else {
+ struct imsm_dev *dev;
+ int i;
+
+ dev = get_imsm_dev(super, vol);
+- snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name);
++ strncpy((char *) dev->volume, name, MAX_RAID_SERIAL_LEN);
++ dev->volume[MAX_RAID_SERIAL_LEN-1] = '\0';
+ for (i = 0; i < mpb->num_raid_devs; i++) {
+ dev = get_imsm_dev(super, i);
+ handle_missing(super, dev);
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch b/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch
new file mode 100644
index 000000000..94fde42e9
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch
@@ -0,0 +1,33 @@
+From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Sat, 18 Mar 2017 10:33:45 +0800
+Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation
+
+Gcc reports it needs 19 bytes to right to disk->serial. Because the
+type of argument i is int. But the meaning of i is failed disk
+number. So it doesn't need to use 19 bytes. Just add a type
+conversion to avoid this building error
+
+Signed-off-by: Xiao Ni <xni@redhat.com>
+Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
+---
+Upstream-Status: Backport
+ super-intel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index 5499098..4e466ff 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
+ disk->status = CONFIGURED_DISK | FAILED_DISK;
+ disk->scsi_id = __cpu_to_le32(~(__u32)0);
+ snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN,
+- "missing:%d", i);
++ "missing:%d", (__u8)i);
+ }
+ find_missing(super);
+ } else {
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch b/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
new file mode 100644
index 000000000..3d9d3b904
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
@@ -0,0 +1,128 @@
+From 09014233bf10900f7bd8390b3b64ff82bca45222 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Apr 2017 12:04:15 -0700
+Subject: [PATCH 5/5] Add a comment to indicate valid fallthrough
+
+gcc7 warns about code with fallthroughs, this patch adds
+the comment to indicate a valid fallthrough, helps gcc7
+compiler warnings
+
+This works in cross and native compilation case
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ Grow.c | 4 ++++
+ bitmap.c | 8 ++++++++
+ mdadm.c | 2 ++
+ super-intel.c | 1 +
+ util.c | 1 +
+ 5 files changed, 16 insertions(+)
+
+diff --git a/Grow.c b/Grow.c
+index 455c5f9..27c73b1 100755
+--- a/Grow.c
++++ b/Grow.c
+@@ -1257,6 +1257,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+ switch (info->new_level) {
+ case 4:
+ delta_parity = 1;
++ /* fallthrough */
+ case 0:
+ re->level = 4;
+ re->before.layout = 0;
+@@ -1284,10 +1285,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+
+ case 4:
+ info->array.layout = ALGORITHM_PARITY_N;
++ /* fallthrough */
+ case 5:
+ switch (info->new_level) {
+ case 0:
+ delta_parity = -1;
++ /* fallthrough */
+ case 4:
+ re->level = info->array.level;
+ re->before.data_disks = info->array.raid_disks - 1;
+@@ -1343,6 +1346,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+ case 4:
+ case 5:
+ delta_parity = -1;
++ /* fallthrough */
+ case 6:
+ re->level = 6;
+ re->before.data_disks = info->array.raid_disks - 2;
+diff --git a/bitmap.c b/bitmap.c
+index ccedfd3..a6ff091 100644
+--- a/bitmap.c
++++ b/bitmap.c
+@@ -82,13 +82,21 @@ static inline int count_dirty_bits_byte(char byte, int num_bits)
+
+ switch (num_bits) { /* fall through... */
+ case 8: if (byte & 128) num++;
++ /* fallthrough */
+ case 7: if (byte & 64) num++;
++ /* fallthrough */
+ case 6: if (byte & 32) num++;
++ /* fallthrough */
+ case 5: if (byte & 16) num++;
++ /* fallthrough */
+ case 4: if (byte & 8) num++;
++ /* fallthrough */
+ case 3: if (byte & 4) num++;
++ /* fallthrough */
+ case 2: if (byte & 2) num++;
++ /* fallthrough */
+ case 1: if (byte & 1) num++;
++ /* fallthrough */
+ default: break;
+ }
+
+diff --git a/mdadm.c b/mdadm.c
+index c3a265b..2d06d3b 100644
+--- a/mdadm.c
++++ b/mdadm.c
+@@ -148,6 +148,7 @@ int main(int argc, char *argv[])
+ mode == CREATE || mode == GROW ||
+ mode == INCREMENTAL || mode == MANAGE)
+ break; /* b means bitmap */
++ /* fallthrough */
+ case Brief:
+ c.brief = 1;
+ continue;
+@@ -828,6 +829,7 @@ int main(int argc, char *argv[])
+
+ case O(INCREMENTAL,NoDegraded):
+ pr_err("--no-degraded is deprecated in Incremental mode\n");
++ /* fallthrough */
+ case O(ASSEMBLE,NoDegraded): /* --no-degraded */
+ c.runstop = -1; /* --stop isn't allowed for --assemble,
+ * so we overload slightly */
+diff --git a/super-intel.c b/super-intel.c
+index 4e466ff..00a2925 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -3271,6 +3271,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
+ << SECT_PER_MB_SHIFT;
+ }
+ }
++ /* fallthrough */
+ case MIGR_VERIFY:
+ /* we could emulate the checkpointing of
+ * 'sync_action=check' migrations, but for now
+diff --git a/util.c b/util.c
+index 32bd909..f2a4d19 100644
+--- a/util.c
++++ b/util.c
+@@ -335,6 +335,7 @@ unsigned long long parse_size(char *size)
+ switch (*c) {
+ case 'K':
+ c++;
++ /* fallthrough */
+ default:
+ s *= 2;
+ break;
+--
+2.12.2
+
diff --git a/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
new file mode 100644
index 000000000..df21399de
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
@@ -0,0 +1,22 @@
+super-intel.c:5063:2: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
+ snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+ ^
+cc1: all warnings being treated as errors
+make: *** [super-intel.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mdadm-4.0/super-intel.c
+===================================================================
+--- mdadm-4.0.orig/super-intel.c
++++ mdadm-4.0/super-intel.c
+@@ -5725,7 +5725,7 @@ static int write_super_imsm_spares(struc
+ spare->cache_size = mpb->cache_size;
+ spare->pwr_cycle_count = __cpu_to_le32(1);
+
+- snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
++ (void)snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+ MPB_SIGNATURE MPB_VERSION_RAID0);
+
+ for (d = super->disks; d; d = d->next) {
diff --git a/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
new file mode 100644
index 000000000..00e6657e0
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -0,0 +1,25 @@
+When try to print time_t values as a long int it causes an error because time_t
+data type in x32 ABI is long long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Index: mdadm-4.0/monitor.c
+===================================================================
+--- mdadm-4.0.orig/monitor.c
++++ mdadm-4.0/monitor.c
+@@ -445,9 +445,12 @@ static int read_and_act(struct active_ar
+ if (FD_ISSET(mdi->bb_fd, fds))
+ check_for_cleared_bb(a, mdi);
+ }
+-
+ gettimeofday(&tv, NULL);
++#if defined(__x86_64__) && defined(__ILP32__)
++ dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#else
+ dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#endif
+ a->info.container_member,
+ tv.tv_sec, tv.tv_usec,
+ array_states[a->curr_state],
diff --git a/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
new file mode 100644
index 000000000..267c007c2
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -0,0 +1,45 @@
+From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 10 Feb 2016 17:28:05 +0200
+Subject: [PATCH] mdadm-fix-ptest-build-errors
+
+builds fail with ptest enabled:
+
+| restripe.c: In function 'test_stripes':
+| restripe.c:845:4: error: ignoring return value of 'read', declared with
+| attribute warn_unused_result [-Werror=unused-result]
+| read(source[i], stripes[i], chunk_size);
+| ^
+| cc1: all warnings being treated as errors
+| Makefile:214: recipe for target 'test_stripe' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ restripe.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/restripe.c b/restripe.c
+index 56dca73..d24b2b4 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -842,10 +842,14 @@ int test_stripes(int *source, unsigned long long *offsets,
+
+ while (length > 0) {
+ int disk;
++ ssize_t ret;
+
+ for (i = 0 ; i < raid_disks ; i++) {
+ lseek64(source[i], offsets[i]+start, 0);
+- read(source[i], stripes[i], chunk_size);
++ ret = read(source[i], stripes[i], chunk_size);
++ if (ret == -1) {
++ printf("Read Failed\n");
++ }
+ }
+ for (i = 0 ; i < data_disks ; i++) {
+ int disk = geo_map(i, start/chunk_size, raid_disks,
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/mdadm/files/run-ptest b/poky/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644
index 000000000..5b276090f
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/files/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test &>./test.log
+if [ $? -eq 0 ]
+then
+ echo "PASS: mdadm"
+ rm test.log
+else
+ echo "FAIL: mdadm"
+fi
diff --git a/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb b/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb
new file mode 100644
index 000000000..dc098f19b
--- /dev/null
+++ b/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb
@@ -0,0 +1,78 @@
+SUMMARY = "Tool for managing software RAID under Linux"
+HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
+
+# Some files are GPLv2+ while others are GPLv2.
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
+ file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
+
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
+ file://gcc-4.9.patch \
+ file://mdadm-3.3.2_x32_abi_time_t.patch \
+ file://mdadm-fix-ptest-build-errors.patch \
+ file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
+ file://run-ptest \
+ file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \
+ file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \
+ file://0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch \
+ file://0002-mdadm-Specify-enough-length-when-write-to-buffer.patch \
+ file://0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch \
+ file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \
+ file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \
+ file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \
+ "
+SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d"
+SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9"
+
+CFLAGS += "-fno-strict-aliasing"
+inherit autotools-brokensep
+
+EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
+# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
+# prevents 64-bit userland from seeing this definition, instead defaulting
+# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
+# int-ll64.h included
+CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__'
+
+do_compile() {
+ # Point to right sbindir
+ sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" ${S}/Makefile
+ oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+}
+
+do_install() {
+ export STRIP=""
+ autotools_do_install
+}
+
+inherit ptest
+
+do_compile_ptest() {
+ oe_runmake test
+}
+
+do_install_ptest() {
+ cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests
+ cp ${S}/test ${D}${PTEST_PATH}
+ sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+ ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm
+ for prg in test_stripe swap_super raid6check
+ do
+ install -D -m 755 $prg ${D}${PTEST_PATH}/
+ done
+}
+RDEPENDS_${PN}-ptest += "bash"
+RRECOMMENDS_${PN}-ptest += " \
+ coreutils \
+ util-linux \
+ kernel-module-loop \
+ kernel-module-linear \
+ kernel-module-raid0 \
+ kernel-module-raid1 \
+ kernel-module-raid10 \
+ kernel-module-raid456 \
+"
diff --git a/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb b/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb
new file mode 100644
index 000000000..3c16228b0
--- /dev/null
+++ b/poky/meta/recipes-extended/mingetty/mingetty_1.08.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Compact getty terminal handler for virtual consoles only"
+SECTION = "console/utils"
+HOMEPAGE = "http://sourceforge.net/projects/mingetty/"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "2a75ad6487ff271424ffc00a64420990"
+SRC_URI[sha256sum] = "0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17"
+
+# substitute our CFLAGS for "-O2 -Wall -W -pipe"
+#
+EXTRA_OEMAKE = "CC='${CC}' \
+ CFLAGS='${CFLAGS} -D_GNU_SOURCE'"
+
+do_install(){
+ install -d ${D}${mandir}/man8 ${D}/${base_sbindir}
+ oe_runmake install DESTDIR=${D}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/mingetty"
+ALTERNATIVE_PRIORITY = "10"
diff --git a/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch b/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
new file mode 100644
index 000000000..fec67fdd3
--- /dev/null
+++ b/poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
@@ -0,0 +1,47 @@
+From d62a5862e26ed3fc58d789efe9c40ca6c911d36b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 22:35:31 +0000
+Subject: [PATCH] Fix build issus surfaced due to musl
+
+src/getsdir.h:28:14: error: 'MAXNAMLEN' undeclared here (not in a function)
+ char fname[MAXNAMLEN + 1]; /* filename + terminating null */
+
+src/dial.c:352:22: error: 'KIOCSOUND' undeclared (first use in this function)
+| ioctl(consolefd, KIOCSOUND, k);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/dial.c | 2 +-
+ src/getsdir.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/dial.c b/src/dial.c
+index a90c1d2..bf02574 100644
+--- a/src/dial.c
++++ b/src/dial.c
+@@ -39,7 +39,7 @@
+ #include "intl.h"
+
+ #ifdef VC_MUSIC
+-# if defined(__GLIBC__)
++# if defined(__GLIBC__) || defined(__linux__)
+ # include <sys/ioctl.h>
+ # include <sys/kd.h>
+ # include <sys/time.h>
+diff --git a/src/getsdir.c b/src/getsdir.c
+index 2195b27..b61a361 100644
+--- a/src/getsdir.c
++++ b/src/getsdir.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/param.h>
+ #include <errno.h>
+
+ #include "getsdir.h"
+--
+2.5.1
+
diff --git a/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch b/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
new file mode 100644
index 000000000..bd8261c97
--- /dev/null
+++ b/poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
@@ -0,0 +1,35 @@
+Subject: [PATCH] fix minicom -h/-v return value is not 0
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+
+---
+ src/minicom.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/minicom.c b/src/minicom.c
+index e1a557b..730da7c 100644
+--- a/src/minicom.c
++++ b/src/minicom.c
+@@ -1166,15 +1166,13 @@ int main(int argc, char **argv)
+ "modify it under the terms of the GNU General Public License\n"
+ "as published by the Free Software Foundation; either version\n"
+ "2 of the License, or (at your option) any later version.\n\n");
+- exit(1);
+- break;
++ exit(0);
+ case 's': /* setup mode */
+ dosetup = 1;
+ break;
+ case 'h':
+ helpthem();
+- exit(1);
+- break;
++ exit(0);
+ case 'p': /* Pseudo terminal to use. */
+ if (strncmp(optarg, "/dev/", 5) == 0)
+ optarg += 5;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch b/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
new file mode 100644
index 000000000..f5c08896f
--- /dev/null
+++ b/poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/configure.in 2013-02-06 18:18:13.000000000 +0100
++++ b/configure.in 2013-07-21 15:31:27.614828894 +0200
+@@ -40,7 +40,13 @@
+ fi
+
+ PKG_PROG_PKG_CONFIG
+-if test -n "$PKG_CONFIG"; then
++
++AC_ARG_ENABLE([lockdev],
++ AS_HELP_STRING([--enable-lockdev],
++ [Enable lockdev support (def: enabled)]),
++ [], [enable_lockdev="yes"])
++
++if test -n "$PKG_CONFIG" && test "x$enable_lockdev" = xyes; then
+ PKG_CHECK_MODULES([LOCKDEV], [lockdev], AC_DEFINE([HAVE_LOCKDEV],[1],[Define if you have lockdev]),[:])
+ fi
+
diff --git a/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb
new file mode 100644
index 000000000..e6afe2b65
--- /dev/null
+++ b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Text-based modem control and terminal emulation program"
+HOMEPAGE = "http://alioth.debian.org/projects/minicom/"
+DESCRIPTION = "Minicom is a text-based modem control and terminal emulation program for Unix-like operating systems"
+SECTION = "console/network"
+DEPENDS = "ncurses virtual/libiconv"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=420477abc567404debca0a2a1cb6b645 \
+ file://src/minicom.h;beginline=1;endline=12;md5=a58838cb709f0db517f4e42730c49e81"
+
+SRC_URI = "https://alioth.debian.org/frs/download.php/latestfile/3/${BP}.tar.gz \
+ file://allow.to.disable.lockdev.patch \
+ file://0001-fix-minicom-h-v-return-value-is-not-0.patch \
+ file://0001-Fix-build-issus-surfaced-due-to-musl.patch \
+ "
+
+SRC_URI[md5sum] = "9021cb8c5445f6e6e74b2acc39962d62"
+SRC_URI[sha256sum] = "532f836b7a677eb0cb1dca8d70302b73729c3d30df26d58368d712e5cca041f1"
+
+UPSTREAM_CHECK_URI = "https://alioth.debian.org/frs/?group_id=30018"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lockdev] = "--enable-lockdev,--disable-lockdev,lockdev"
+
+inherit autotools gettext pkgconfig
+
+do_install() {
+ for d in doc extras man lib src; do make -C $d DESTDIR=${D} install; done
+}
+
+RRECOMMENDS_${PN} += "lrzsz"
diff --git a/poky/meta/recipes-extended/mktemp/files/disable-strip.patch b/poky/meta/recipes-extended/mktemp/files/disable-strip.patch
new file mode 100644
index 000000000..e06869e3a
--- /dev/null
+++ b/poky/meta/recipes-extended/mktemp/files/disable-strip.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/Makefile.in b/Makefile.in
+index 37b3cc9..f1026f3 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -95,7 +95,7 @@ install-dirs:
+ $(DESTDIR)$(mandir)/man1
+
+ install-binaries: $(PROG)
+- $(INSTALL) -m 0555 -s $(PROG) $(DESTDIR)$(bindir)/$(PROG)
++ $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+
+ install-man:
+ $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
diff --git a/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch b/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
new file mode 100644
index 000000000..f3b6dcc34
--- /dev/null
+++ b/poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
@@ -0,0 +1,24 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Accepted
+http://www.gratisoft.us/bugzilla/show_bug.cgi?id=528
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: mktemp-1.7/Makefile.in
+===================================================================
+--- mktemp-1.7.orig/Makefile.in
++++ mktemp-1.7/Makefile.in
+@@ -94,10 +94,10 @@ install-dirs:
+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
+ $(DESTDIR)$(mandir)/man1
+
+-install-binaries: $(PROG)
++install-binaries: install-dirs $(PROG)
+ $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+
+-install-man:
++install-man: install-dirs
+ $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
+ $(DESTDIR)$(mandir)/man1/mktemp.1
+
diff --git a/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb b/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
new file mode 100644
index 000000000..e8ae5c6b7
--- /dev/null
+++ b/poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Enables safe temporary file creation from shell scripts"
+HOMEPAGE = "http://www.mktemp.org/"
+BUGTRACKER = "http://www.mktemp.org/bugs"
+SECTION = "console/utils"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=430680f6322a1eb87199b5e01a82c0d4"
+
+PR = "r3"
+
+SRC_URI = "ftp://ftp.mktemp.org/pub/mktemp/${BPN}-${PV}.tar.gz \
+ file://disable-strip.patch \
+ file://fix-parallel-make.patch \
+ "
+
+SRC_URI[md5sum] = "787bbed9fa2ee8e7645733c0e8e65172"
+SRC_URI[sha256sum] = "8e94b9e1edf866b2609545da65b627996ac5d158fda071e492bddb2f4a482675"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--with-libc"
+
+do_install_append () {
+ if [ "${base_bindir}" != "${bindir}" ] ; then
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+ rmdir ${D}${bindir}
+ fi
+}
+
+ALTERNATIVE_${PN} = "mktemp"
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_${PN}-doc = "mktemp.1"
+ALTERNATIVE_PRIORITY_${PN}-doc = "300"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
diff --git a/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb b/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb
new file mode 100644
index 000000000..e1721936c
--- /dev/null
+++ b/poky/meta/recipes-extended/msmtp/msmtp_1.6.6.bb
@@ -0,0 +1,30 @@
+SUMMARY = "msmtp is an SMTP client"
+DESCRIPTION = "A sendmail replacement for use in MTAs like mutt"
+HOMEPAGE = "http://msmtp.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "GPLv3"
+DEPENDS = "zlib gnutls"
+
+#COPYING or Licence
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \
+ "
+
+SRC_URI[md5sum] = "82b0520b57db4b2cf05333d11fb5974d"
+SRC_URI[sha256sum] = "da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e"
+
+inherit gettext autotools update-alternatives pkgconfig
+
+EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn"
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN}_linuxstdbase () {
+ # /usr/lib/sendmial is required by LSB core test
+ [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
new file mode 100644
index 000000000..8be45ccac
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch
@@ -0,0 +1,87 @@
+From 08abfcd923e9f37d1902db26771b1dc6731eb265 Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka@redhat.com>
+Date: Fri, 27 Sep 2013 18:40:06 +0200
+Subject: [PATCH 1/1] lib/inet6.c:INET6_rresolve() - various fixes
+
+1) Fall-back to numeric address if getnameinfo fails.
+ Reverse lookup is not mandatory, therefore its fail
+ is not an error. Just return numeric address in that case.
+ This makes netstat/route show IPv6 address instead of
+ [UNKNOWN] in case of DNS problems.
+
+2) Pass length of 'name' buffer into function.
+ 'name' is a pointer and therefore sizeof(name)
+ returns size of pointer and not size of the buffer.
+ see http://stackoverflow.com/questions/14298710/c-pointers-and-arrays-sizeof-operator
+ The sizeof() usage was added with commit 604785adc,
+ so I checked all the other changes in that commit
+ and they seem to be OK.
+
+3) remove unused 's' variable
+
+Upstream-Status: Pending
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ lib/inet6.c | 21 ++++++++++-----------
+ 1 file changed, 10 insertions(+), 11 deletions(-)
+
+diff --git a/lib/inet6.c b/lib/inet6.c
+index 9a484a0..2a9c459 100644
+--- a/lib/inet6.c
++++ b/lib/inet6.c
+@@ -84,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6)
+ #endif
+
+
+-static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
++static int INET6_rresolve(char *name, size_t namelen,
++ struct sockaddr_in6 *sin6, int numeric)
+ {
+- int s;
+-
+ /* Grmpf. -FvK */
+ if (sin6->sin6_family != AF_INET6) {
+ #ifdef DEBUG
+@@ -98,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric)
+ return (-1);
+ }
+ if (numeric & 0x7FFF) {
+- inet_ntop( AF_INET6, &sin6->sin6_addr, name, 80);
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
+ return (0);
+ }
+ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
+ if (numeric & 0x8000)
+- strcpy(name, "default");
++ safe_strncpy(name, "default", namelen);
+ else
+- strcpy(name, "[::]");
++ safe_strncpy(name, "[::]", namelen);
+ return (0);
+ }
+
+- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
+- name, 255 /* !! */ , NULL, 0, 0))) {
+- fputs("getnameinfo failed\n", stderr);
+- return -1;
++ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6),
++ name, namelen , NULL, 0, 0)) {
++ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen);
+ }
+ return (0);
+ }
+@@ -143,7 +141,8 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric)
+
+ if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff));
+- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0)
++ if (INET6_rresolve(buff, sizeof(buff),
++ (struct sockaddr_in6 *) sap, numeric) != 0)
+ return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff));
+ return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr));
+ }
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
new file mode 100644
index 000000000..06f81420e
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
@@ -0,0 +1,32 @@
+From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka@redhat.com>
+Date: Wed, 7 Dec 2011 19:14:09 +0100
+Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64
+
+Upstream-Status: Backport
+
+commit 81814dc2b14843009193efd307d814c26baa61f0 from
+git://git.code.sf.net/p/net-tools/code
+
+---
+ ifconfig.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/ifconfig.c b/ifconfig.c
+index bc405c6..dae8922 100644
+--- a/ifconfig.c
++++ b/ifconfig.c
+@@ -890,7 +890,9 @@ int main(int argc, char **argv)
+ continue;
+ }
+
+- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
++ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
++ ip = 0;
++ memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr));
+
+ if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
+ fprintf(stderr, _("Interface %s not initialized\n"),
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
new file mode 100644
index 000000000..f694d594b
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
@@ -0,0 +1,100 @@
+Adjust headers for non-glibc cases
+especially exposed by musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: net-tools-1.60/lib/inet6_gr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_gr.c
++++ net-tools-1.60/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc doesn't have this */
+ #endif
+ #include "version.h"
+Index: net-tools-1.60/lib/inet6_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_sr.c
++++ net-tools-1.60/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+Index: net-tools-1.60/lib/inet_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet_sr.c
++++ net-tools-1.60/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/lib/util-ank.c
+===================================================================
+--- net-tools-1.60.orig/lib/util-ank.c
++++ net-tools-1.60/lib/util-ank.c
+@@ -14,6 +14,7 @@
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ */
+
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+Index: net-tools-1.60/mii-tool.c
+===================================================================
+--- net-tools-1.60.orig/mii-tool.c
++++ net-tools-1.60/mii-tool.c
+@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c
+ #include <net/if.h>
+ #include <linux/sockios.h>
+
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include "mii.h"
+ #include "version.h"
+
+Index: net-tools-1.60/netstat.c
+===================================================================
+--- net-tools-1.60.orig/netstat.c
++++ net-tools-1.60/netstat.c
+@@ -87,6 +87,7 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <asm-generic/param.h>
+
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/slattach.c
+===================================================================
+--- net-tools-1.60.orig/slattach.c
++++ net-tools-1.60/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+
+ #if defined(__GLIBC__)
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
new file mode 100644
index 000000000..78daf6c3e
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
@@ -0,0 +1,635 @@
+From 23276afe270009420cfbc52bffafdd25ac0817fe Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:01:29 +0800
+Subject: [PATCH 1/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ statistics.c | 68 +++++++++-
+ 2 files changed, 465 insertions(+), 14 deletions(-)
+
+Index: net-tools-1.60/netstat.c
+===================================================================
+--- net-tools-1.60.orig/netstat.c
++++ net-tools-1.60/netstat.c
+@@ -58,6 +58,7 @@
+ *
+ *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one()
+ *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale
++ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -106,7 +107,7 @@
+ #endif
+
+ /* prototypes for statistics.c */
+-void parsesnmp(int, int, int);
++void parsesnmp(int, int, int, int);
+ void inittab(void);
+ void parsesnmp6(int, int, int);
+ void inittab6(void);
+@@ -119,6 +120,28 @@ typedef enum {
+ SS_DISCONNECTING /* in process of disconnecting */
+ } socket_state;
+
++#define SCTP_NSTATES 9 /* The number of states in array*/
++
++static const char *sctp_state[] = {
++ N_("EMPTY"),
++ N_("CLOSED"),
++ N_("COOKIE_WAIT"),
++ N_("COOKIE_ECHOED"),
++ N_("ESTABLISHED"),
++ N_("SHUTDOWN_PENDING"),
++ N_("SHUTDOWN_SENT"),
++ N_("SHUTDOWN_RECEIVED"),
++ N_("SHUTDOWN_ACK_SENT")
++};
++
++#define SCTP_NTYPES 3 /* The number of types in array */
++
++static const char *sctp_type[] = {
++ N_("udp"),
++ N_("udp-high-bw"),
++ N_("tcp")
++};
++
+ #define SO_ACCEPTCON (1<<16) /* performed a listen */
+ #define SO_WAITDATA (1<<17) /* wait data to read */
+ #define SO_NOSPACE (1<<18) /* no space to write */
+@@ -149,6 +172,7 @@ int flag_opt = 0;
+ int flag_raw = 0;
+ int flag_tcp = 0;
+ int flag_udp = 0;
++int flag_sctp= 0;
+ int flag_igmp= 0;
+ int flag_rom = 0;
+ int flag_exp = 1;
+@@ -995,6 +1019,365 @@ static int udp_info(void)
+ udp_do_one);
+ }
+
++static const char *sctp_socket_type_str(int type) {
++ if(type>=0 && type<SCTP_NTYPES)
++ return sctp_type[type];
++ else {
++ static char type_str_buf[64];
++ sprintf(type_str_buf,"UNKNOWN(%d)",type);
++ return type_str_buf;
++ }
++}
++
++static const char *sctp_state_str(int state)
++{
++ if(state>=0 && state<SCTP_NSTATES)
++ return sctp_state[state];
++ else {
++ static char state_str_buf[64];
++ sprintf(state_str_buf,"UNKNOWN(%d)",state);
++ return state_str_buf;
++ }
++}
++
++static const char *sctp_socket_state_str(int state)
++{
++ if(state>=0 && state<=10)
++ return tcp_state[state];
++ else {
++ static char state_str_buf[64];
++ sprintf(state_str_buf,"UNKNOWN(%d)",state);
++ return state_str_buf;
++ }
++}
++
++static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa)
++{
++ if (strchr(addr_str,':')) {
++#if HAVE_AFINET6
++ extern struct aftype inet6_aftype;
++ /* Demangle what the kernel gives us */
++ struct in6_addr in6;
++ char addr6_str[INET6_ADDRSTRLEN];
++ unsigned u0,u1,u2,u3,u4,u5,u6,u7;
++ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",
++ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7);
++ in6.s6_addr16[0] = htons(u0);
++ in6.s6_addr16[1] = htons(u1);
++ in6.s6_addr16[2] = htons(u2);
++ in6.s6_addr16[3] = htons(u3);
++ in6.s6_addr16[4] = htons(u4);
++ in6.s6_addr16[5] = htons(u5);
++ in6.s6_addr16[6] = htons(u6);
++ in6.s6_addr16[7] = htons(u7);
++
++ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str));
++ inet6_aftype.input(1, addr6_str, sa);
++ sa->sa_family = AF_INET6;
++#endif
++ } else {
++ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str);
++ sa->sa_family = AF_INET;
++ }
++ return get_afntype(sa->sa_family);
++}
++
++static void sctp_eps_do_one(int lnr, char *line)
++{
++ char buffer[1024];
++ int type, state, port;
++ int uid;
++ unsigned long inode;
++
++ struct aftype *ap;
++#if HAVE_AFINET6
++ struct sockaddr_in6 localaddr;
++#else
++ struct sockaddr_in localaddr;
++#endif
++ const char *sty_str;
++ const char *sst_str;
++ const char *lport_str;
++ const char *uid_str;
++ const char *inode_str;
++ const char *pladdr_str;
++ char *laddrs_str;
++
++ if(lnr == 0) {
++ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
++ return;
++ }
++
++ strtok(line," \t\n"); /*skip ptr*/
++ strtok(0," \t\n"); /*skip ptr*/
++ sty_str = strtok(0," \t\n");
++ sst_str = strtok(0," \t\n");
++ strtok(0," \t\n"); /*skip hash bucket*/
++ lport_str=strtok(0," \t\n");
++ uid_str = strtok(0," \t\n");
++ inode_str = strtok(0," \t\n");
++ pladdr_str = strtok(0," \t\n");
++ laddrs_str=strtok(0,"\t\n");
++
++ type = atoi(sty_str);
++ state = atoi(sst_str);
++ port = atoi(lport_str);
++ uid = atoi(uid_str);
++ inode = strtoul(inode_str,0,0);
++
++ if(flag_sctp<=1) {
++ /* only print the primary address */
++ char local_addr[64];
++ char local_port[16];
++
++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ printf("sctp ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-47s", buffer);
++ printf(" %-12s", sctp_socket_state_str(state));
++ } else {
++ /*print all addresses*/
++ const char *this_local_addr;
++ int first=1;
++ char local_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ for(this_local_addr=strtok(laddrs_str," \t\n");
++ this_local_addr;
++ this_local_addr=strtok(0," \t\n"))
++ {
++ char local_addr[64];
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp ");
++ else
++ printf(" ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-47s", buffer);
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++ first = 0;
++ }
++ }
++
++ finish_this_one(uid,inode,"");
++}
++
++static void sctp_assoc_do_one(int lnr, char *line)
++{
++ char buffer[1024];
++ int type, state, state2, lport,rport;
++ int uid;
++ unsigned rxqueue,txqueue;
++ unsigned long inode;
++
++ struct aftype *ap;
++#if HAVE_AFINET6
++ struct sockaddr_in6 localaddr,remoteaddr;
++#else
++ struct sockaddr_in localaddr,remoteaddr;
++#endif
++ const char *sty_str;
++ const char *sst_str;
++ const char *st_str;
++ const char *txqueue_str;
++ const char *rxqueue_str;
++ const char *lport_str,*rport_str;
++ const char *uid_str;
++ const char *inode_str;
++ const char *pladdr_str;
++ char *laddrs_str;
++ const char *praddr_str;
++ char *raddrs_str;
++
++ if(lnr == 0) {
++ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
++ return;
++ }
++
++ strtok(line," \t\n"); /*skip ptr*/
++ strtok(0," \t\n"); /*skip ptr*/
++ sty_str = strtok(0," \t\n");
++ sst_str = strtok(0," \t\n");
++ st_str = strtok(0," \t\n");
++ strtok(0," \t\n"); /*skip hash bucket*/
++ txqueue_str = strtok(0," \t\n");
++ rxqueue_str = strtok(0," \t\n");
++ uid_str = strtok(0," \t\n");
++ inode_str = strtok(0," \t\n");
++ lport_str=strtok(0," \t\n");
++ rport_str=strtok(0," \t\n");
++ pladdr_str = strtok(0," \t\n");
++ praddr_str = strtok(0," \t\n");
++ laddrs_str=strtok(0,"<->\t\n");
++ raddrs_str=strtok(0,"<->\t\n");
++
++ type = atoi(sty_str);
++ state = atoi(sst_str);
++ state2 = atoi(st_str);
++ txqueue = atoi(txqueue_str);
++ rxqueue = atoi(rxqueue_str);
++ uid = atoi(uid_str);
++ inode = strtoul(inode_str,0,0);
++ lport = atoi(lport_str);
++ rport = atoi(rport_str);
++
++ if(flag_sctp<=1) {
++ /* only print the primary addresses */
++ char local_addr[64];
++ char local_port[16];
++ char remote_addr[64];
++ char remote_port[16];
++
++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
++ sizeof(remote_addr));
++ else
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ printf("sctp");
++ printf(" %6u %6u ", rxqueue, txqueue);
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-23s", buffer);
++ printf(" ");
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ printf("%-23s", buffer);
++ printf(" %-12s", sctp_socket_state_str(state));
++ } else {
++ /*print all addresses*/
++ const char *this_local_addr;
++ const char *this_remote_addr;
++ char *ss1,*ss2;
++ int first=1;
++ char local_port[16];
++ char remote_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
++ while(this_local_addr || this_remote_addr) {
++ char local_addr[64];
++ char remote_addr[64];
++ if(this_local_addr) {
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++ }
++ if(this_remote_addr) {
++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
++ sizeof(remote_addr));
++ else
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++ }
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp %6u %6u ", rxqueue, txqueue);
++ else
++ printf(" ");
++ if(this_local_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ else
++ sprintf(buffer,"%s", local_addr);
++ printf("%-23s", buffer);
++ } else
++ printf("%-23s", "");
++ printf(" ");
++ if(this_remote_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ else
++ sprintf(buffer,"%s", remote_addr);
++ printf("%-23s", buffer);
++ } else
++ printf("%-23s", "");
++
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++
++ first = 0;
++ this_local_addr=strtok_r(0," \t\n",&ss1);
++ this_remote_addr=strtok_r(0," \t\n",&ss2);
++ }
++ }
++
++ finish_this_one(uid,inode,"");
++}
++
++static int sctp_info_eps(void)
++{
++#if !defined(_PATH_PROCNET_SCTP_EPS)
++#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps"
++#endif
++ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)",
++ sctp_eps_do_one);
++}
++
++static int sctp_info_assocs(void)
++{
++#if !defined(_PATH_PROCNET_SCTP_ASSOCS)
++#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs"
++#endif
++ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)",
++ sctp_assoc_do_one);
++}
++
++static int sctp_info(void)
++{
++ if(flag_all)
++ sctp_info_eps();
++ return sctp_info_assocs();
++}
++
+ static void raw_do_one(int lnr, const char *line)
+ {
+ char buffer[8192], local_addr[64], rem_addr[64];
+@@ -1558,7 +1941,7 @@ static void usage(void)
+ fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
+ fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
+
+- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
++ fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
+ fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
+ fprintf(stderr, _(" List of possible address families (which support routing):\n"));
+ print_aflist(1); /* 1 = routeable */
+@@ -1583,6 +1966,7 @@ int main
+ {"protocol", 1, 0, 'A'},
+ {"tcp", 0, 0, 't'},
+ {"udp", 0, 0, 'u'},
++ {"sctp", 0, 0, 'S' },
+ {"raw", 0, 0, 'w'},
+ {"unix", 0, 0, 'x'},
+ {"listening", 0, 0, 'l'},
+@@ -1613,7 +1997,7 @@ int main
+ getroute_init(); /* Set up AF routing support */
+
+ afname[0] = '\0';
+- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF)
++ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuSWVv?wxl64", longopts, &lop)) != EOF)
+ switch (i) {
+ case -1:
+ break;
+@@ -1705,10 +2089,12 @@ int main
+ case 't':
+ flag_tcp++;
+ break;
+-
+ case 'u':
+ flag_udp++;
+ break;
++ case 'S':
++ flag_sctp++;
++ break;
+ case 'w':
+ flag_raw++;
+ break;
+@@ -1726,13 +2112,13 @@ int main
+ if (flag_int + flag_rou + flag_mas + flag_sta > 1)
+ usage();
+
+- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw))
+- flag_tcp = flag_udp = flag_raw = 1;
++ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
++ flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
+
+- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
++ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
+ flag_inet = flag_inet6 = 1;
+
+- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
++ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx
+ + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
+
+ if (flag_mas) {
+@@ -1760,7 +2146,7 @@ int main
+ char buf[256];
+ if (!afname[0]) {
+ inittab();
+- parsesnmp(flag_raw, flag_tcp, flag_udp);
++ parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
+ } else {
+ safe_strncpy(buf, afname, sizeof(buf));
+ tmp1 = buf;
+@@ -1815,7 +2201,7 @@ int main
+ return (i);
+ }
+ for (;;) {
+- if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
++ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) {
+ #if HAVE_AFINET
+ prg_cache_load();
+ printf(_("Active Internet connections ")); /* xxx */
+@@ -1854,6 +2240,11 @@ int main
+ if (i)
+ return (i);
+ }
++ if (!flag_arg || flag_sctp) {
++ i = sctp_info();
++ if (i)
++ return (i);
++ }
+ if (!flag_arg || flag_raw) {
+ i = raw_info();
+ if (i)
+Index: net-tools-1.60/statistics.c
+===================================================================
+--- net-tools-1.60.orig/statistics.c
++++ net-tools-1.60/statistics.c
+@@ -21,7 +21,7 @@
+ #define UFWARN(x)
+ #endif
+
+-int print_static,f_raw,f_tcp,f_udp,f_unknown = 1;
++int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1;
+
+ enum State {
+ number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg,
+@@ -297,6 +297,27 @@ struct entry Tcpexttab[] =
+ { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number },
+ };
+
++struct entry Sctptab[] =
++{
++ {"SctpCurrEstab", N_("%u Current Associations"), number},
++ {"SctpActiveEstabs", N_("%u Active Associations"), number},
++ {"SctpPassiveEstabs", N_("%u Passive Associations"), number},
++ {"SctpAborteds", N_("%u Number of Aborteds "), number},
++ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number},
++ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number},
++ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number},
++ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number},
++ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number},
++ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number},
++ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number},
++ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number},
++ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number},
++ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number},
++ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number},
++ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number},
++ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number},
++};
++
+ struct tabtab {
+ char *title;
+ struct entry *tab;
+@@ -310,6 +331,7 @@ struct tabtab snmptabs[] =
+ {"Icmp", Icmptab, sizeof(Icmptab), &f_raw},
+ {"Tcp", Tcptab, sizeof(Tcptab), &f_tcp},
+ {"Udp", Udptab, sizeof(Udptab), &f_udp},
++ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp},
+ {"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp},
+ {NULL}
+ };
+@@ -499,12 +521,40 @@ void process6_fd(FILE *f)
+
+ }
+
+-void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
++/* Process a file with name-value lines (like /proc/net/sctp/snmp) */
++void process_fd2(FILE *f, const char *filename)
++{
++ char buf1[1024];
++ char *sp;
++ struct tabtab *tab;
++
++ tab = newtable(snmptabs, "Sctp");
++
++ while (fgets(buf1, sizeof buf1, f)) {
++ sp = buf1 + strcspn(buf1, " \t\n");
++ if (!sp)
++ goto formaterr;
++ *sp = '\0';
++ sp++;
++
++ sp += strspn(sp, " \t\n");
++
++ if (*sp != '\0' && *(tab->flag))
++ printval(tab, buf1, strtoul(sp, 0, 10));
++ }
++ return;
++
++formaterr:
++ fprintf(stderr,_("error parsing %s\n"), filename);
++ return;
++}
++
++void parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp)
+ {
+ FILE *f;
+
+- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
+-
++ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp;
++
+ f = proc_fopen("/proc/net/snmp");
+ if (!f) {
+ perror(_("cannot open /proc/net/snmp"));
+@@ -530,6 +580,16 @@ void parsesnmp(int flag_raw, int flag_tc
+
+ fclose(f);
+ }
++
++ f = fopen("/proc/net/sctp/snmp", "r");
++ if (f) {
++ process_fd2(f,"/proc/net/sctp/snmp");
++ if (ferror(f))
++ perror("/proc/net/sctp/snmp");
++
++ fclose(f);
++ }
++
+ return;
+ }
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
new file mode 100644
index 000000000..d34e65132
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
@@ -0,0 +1,28 @@
+From 14287b594e1f02b811f889fb515c1a51b72c08d4 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:07:48 +0800
+Subject: [PATCH 2/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/netstat.c b/netstat.c
+index 5d1a4a1..56a15c2 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -2104,7 +2104,7 @@ int main
+ usage();
+
+ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
+- flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
++ flag_tcp = flag_udp = flag_raw = 1;
+
+ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
+ flag_inet = flag_inet6 = 1;
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
new file mode 100644
index 000000000..8b2ecab70
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
@@ -0,0 +1,363 @@
+From 1d386279a449a1a6b96b88a71f35bf13b14b2c2c Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:11:24 +0800
+Subject: [PATCH 3/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 282 ++++++++++++++++++++++++--------------------------------------
+ 1 file changed, 108 insertions(+), 174 deletions(-)
+
+diff --git a/netstat.c b/netstat.c
+index 56a15c2..86adadb 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -1095,23 +1095,21 @@ static void sctp_eps_do_one(int lnr, char *line)
+ const char *lport_str;
+ const char *uid_str;
+ const char *inode_str;
+- const char *pladdr_str;
+ char *laddrs_str;
+
+ if(lnr == 0) {
+- /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
++ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */
+ return;
+ }
+
+- strtok(line," \t\n"); /*skip ptr*/
+- strtok(0," \t\n"); /*skip ptr*/
++ strtok(line," \t\n"); /*skip endpt*/
++ strtok(0," \t\n"); /*skip sock*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
+ lport_str=strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+- pladdr_str = strtok(0," \t\n");
+ laddrs_str=strtok(0,"\t\n");
+
+ type = atoi(sty_str);
+@@ -1119,61 +1117,35 @@ static void sctp_eps_do_one(int lnr, char *line)
+ port = atoi(lport_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+-
+- if(flag_sctp<=1) {
+- /* only print the primary address */
+- char local_addr[64];
+- char local_port[16];
+-
+- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+-
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(port), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- printf("sctp ");
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-47s", buffer);
+- printf(" %-12s", sctp_socket_state_str(state));
+- } else {
+- /*print all addresses*/
+- const char *this_local_addr;
+- int first=1;
+- char local_port[16];
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(port), "sctp",
+- flag_not & FLAG_NUM_PORT));
+- for(this_local_addr=strtok(laddrs_str," \t\n");
+- this_local_addr;
+- this_local_addr=strtok(0," \t\n"))
+- {
+- char local_addr[64];
+- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+
+- if(!first) printf("\n");
+- if(first)
+- printf("sctp ");
+- else
+- printf(" ");
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-47s", buffer);
+- printf(" %-12s", first?sctp_socket_state_str(state):"");
+- first = 0;
+- }
++ const char *this_local_addr;
++ int first=1;
++ char local_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp", flag_not & FLAG_NUM_PORT));
++ for(this_local_addr=strtok(laddrs_str," \t\n");
++ this_local_addr;
++ this_local_addr=strtok(0," \t\n"))
++ {
++ char local_addr[64];
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp ");
++ else
++ printf(" ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-55s", buffer);
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++ first = 0;
+ }
+-
+ finish_this_one(uid,inode,"");
+ }
+
+@@ -1199,32 +1171,29 @@ static void sctp_assoc_do_one(int lnr, char *line)
+ const char *lport_str,*rport_str;
+ const char *uid_str;
+ const char *inode_str;
+- const char *pladdr_str;
+ char *laddrs_str;
+- const char *praddr_str;
+ char *raddrs_str;
+-
++
+ if(lnr == 0) {
+- /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
++ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */
+ return;
+ }
+-
+- strtok(line," \t\n"); /*skip ptr*/
+- strtok(0," \t\n"); /*skip ptr*/
++
++ strtok(line," \t\n"); /*skip assoc*/
++ strtok(0," \t\n"); /*skip sock*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ st_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
++ strtok(0," \t\n"); /*skip hash assoc-id*/
+ txqueue_str = strtok(0," \t\n");
+ rxqueue_str = strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+ lport_str=strtok(0," \t\n");
+ rport_str=strtok(0," \t\n");
+- pladdr_str = strtok(0," \t\n");
+- praddr_str = strtok(0," \t\n");
+- laddrs_str=strtok(0,"<->\t\n");
+- raddrs_str=strtok(0,"<->\t\n");
++ laddrs_str = strtok(0,"<->\t\n");
++ raddrs_str = strtok(0,"<->\t\n");
+
+ type = atoi(sty_str);
+ state = atoi(sst_str);
+@@ -1235,116 +1204,81 @@ static void sctp_assoc_do_one(int lnr, char *line)
+ inode = strtoul(inode_str,0,0);
+ lport = atoi(lport_str);
+ rport = atoi(rport_str);
+-
+- if(flag_sctp<=1) {
+- /* only print the primary addresses */
+- char local_addr[64];
+- char local_port[16];
+- char remote_addr[64];
+- char remote_port[16];
+-
+- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+-
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(lport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
+- if(ap)
+- safe_strncpy(remote_addr,
+- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+- sizeof(remote_addr));
+- else
+- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+-
+- snprintf(remote_port, sizeof(remote_port), "%s",
+- get_sname(htons(rport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- printf("sctp");
+- printf(" %6u %6u ", rxqueue, txqueue);
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-23s", buffer);
+- printf(" ");
+- sprintf(buffer,"%s:%s", remote_addr, remote_port);
+- printf("%-23s", buffer);
+- printf(" %-12s", sctp_socket_state_str(state));
+- } else {
+- /*print all addresses*/
+- const char *this_local_addr;
+- const char *this_remote_addr;
+- char *ss1,*ss2;
+- int first=1;
+- char local_port[16];
+- char remote_port[16];
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(lport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+- snprintf(remote_port, sizeof(remote_port), "%s",
+- get_sname(htons(rport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
+- this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
+- while(this_local_addr || this_remote_addr) {
+- char local_addr[64];
+- char remote_addr[64];
+- if(this_local_addr) {
+- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+- }
+- if(this_remote_addr) {
+- ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
+- if(ap)
+- safe_strncpy(remote_addr,
+- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+- sizeof(remote_addr));
+- else
+- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+- }
+
+- if(!first) printf("\n");
+- if(first)
+- printf("sctp %6u %6u ", rxqueue, txqueue);
+- else
+- printf(" ");
+- if(this_local_addr) {
+- if(first)
+- sprintf(buffer,"%s:%s", local_addr, local_port);
++ /*print all addresses*/
++ const char *this_local_addr;
++ const char *this_remote_addr;
++ char *ss1,*ss2;
++ int first=1;
++ char local_port[16];
++ char remote_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
++ while(this_local_addr || this_remote_addr) {
++ char local_addr[64];
++ char remote_addr[64];
++
++ if(this_local_addr) {
++ if (this_local_addr[0] == '*') {
++ /* skip * */
++ this_local_addr++;
++ }
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not), sizeof(local_addr));
+ else
+- sprintf(buffer,"%s", local_addr);
+- printf("%-23s", buffer);
+- } else
+- printf("%-23s", "");
+- printf(" ");
+- if(this_remote_addr) {
+- if(first)
+- sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++ }
++ if(this_remote_addr) {
++ if (this_remote_addr[0] == '*') {
++ /* skip * */
++ this_remote_addr++;
++ }
++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), sizeof(remote_addr));
+ else
+- sprintf(buffer,"%s", remote_addr);
+- printf("%-23s", buffer);
+- } else
+- printf("%-23s", "");
+-
+- printf(" %-12s", first?sctp_socket_state_str(state):"");
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++ }
+
+- first = 0;
+- this_local_addr=strtok_r(0," \t\n",&ss1);
+- this_remote_addr=strtok_r(0," \t\n",&ss2);
+- }
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp %6u %6u ", rxqueue, txqueue);
++ else
++ printf(" ");
++ if(this_local_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ else
++ sprintf(buffer,"%s", local_addr);
++ printf("%-27s", buffer);
++ } else
++ printf("%-27s", "");
++ printf(" ");
++ if(this_remote_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ else
++ sprintf(buffer,"%s", remote_addr);
++ printf("%-27s", buffer);
++ } else
++ printf("%-27s", "");
++
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++
++ first = 0;
++ this_local_addr=strtok_r(0," \t\n",&ss1);
++ this_remote_addr=strtok_r(0," \t\n",&ss2);
+ }
+-
+ finish_this_one(uid,inode,"");
+ }
+
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
new file mode 100644
index 000000000..6d39c2a8c
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
@@ -0,0 +1,75 @@
+/*
+* config.h Automatically generated configuration includefile
+*
+* NET-TOOLS A collection of programs that form the base set of the
+* NET-3 Networking Distribution for the LINUX operating
+* system.
+*
+* DO NOT EDIT DIRECTLY
+*
+*/
+
+/*
+ *
+ * Internationalization
+ *
+ * The net-tools package has currently been translated to French,
+ * German and Brazilian Portugese. Other translations are, of
+ * course, welcome. Answer `n' here if you have no support for
+ * internationalization on your system.
+ *
+ */
+#define I18N 1
+
+/*
+ *
+ * Protocol Families.
+ *
+ */
+#define HAVE_AFUNIX 1
+#define HAVE_AFINET 1
+#define HAVE_AFINET6 1
+#define HAVE_AFIPX 0
+#define HAVE_AFATALK 0
+#define HAVE_AFAX25 0
+#define HAVE_AFNETROM 1
+#define HAVE_AFROSE 0
+#define HAVE_AFX25 0
+#define HAVE_AFECONET 0
+#define HAVE_AFDECnet 0
+#define HAVE_AFASH 0
+
+/*
+ *
+ * Device Hardware types.
+ *
+ */
+#define HAVE_HWETHER 1
+#define HAVE_HWARC 1
+#define HAVE_HWSLIP 1
+#define HAVE_HWPPP 1
+#define HAVE_HWTUNNEL 1
+#define HAVE_HWSTRIP 0
+#define HAVE_HWTR 0
+#define HAVE_HWAX25 0
+#define HAVE_HWROSE 0
+#define HAVE_HWNETROM 1
+#define HAVE_HWX25 0
+#define HAVE_HWFR 1
+#define HAVE_HWSIT 0
+#define HAVE_HWFDDI 0
+#define HAVE_HWHIPPI 0
+#define HAVE_HWASH 0
+#define HAVE_HWHDLCLAPB 0
+#define HAVE_HWIRDA 1
+#define HAVE_HWEC 0
+#define HAVE_HWIB 0
+
+/*
+ *
+ * Other Features.
+ *
+ */
+#define HAVE_FW_MASQUERADE 1
+#define HAVE_IP_TOOLS 1
+#define HAVE_MII 1
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
new file mode 100644
index 000000000..ec516f27e
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
@@ -0,0 +1,36 @@
+I18N=1
+HAVE_AFUNIX=1
+HAVE_AFINET=1
+HAVE_AFINET6=1
+# HAVE_AFIPX=0
+# HAVE_AFATALK=0
+# HAVE_AFAX25=0
+HAVE_AFNETROM=1
+# HAVE_AFROSE=0
+# HAVE_AFX25=0
+# HAVE_AFECONET=0
+# HAVE_AFDECnet=0
+# HAVE_AFASH=0
+HAVE_HWETHER=1
+HAVE_HWARC=1
+HAVE_HWSLIP=1
+HAVE_HWPPP=1
+HAVE_HWTUNNEL=1
+HAVE_HWSTRIP=1
+HAVE_HWTR=1
+# HAVE_HWAX25=0
+# HAVE_HWROSE=0
+HAVE_HWNETROM=1
+# HAVE_HWX25=0
+HAVE_HWFR=1
+# HAVE_HWSIT=0
+# HAVE_HWFDDI=0
+# HAVE_HWHIPPI=0
+# HAVE_HWASH=0
+# HAVE_HWHDLCLAPB=0
+HAVE_HWIRDA=1
+# HAVE_HWEC=0
+# HAVE_HWIB=0
+HAVE_FW_MASQUERADE=1
+HAVE_IP_TOOLS=1
+HAVE_MII=1
diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch
new file mode 100644
index 000000000..505eeb048
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch
@@ -0,0 +1,52 @@
+From 4d56645ea144a34f7cdd3e3ede6452d81fbae251 Mon Sep 17 00:00:00 2001
+From: Randy MacLeod <Randy.MacLeod@windriver.com>
+Date: Sat, 8 Oct 2016 14:42:54 +0800
+Subject: [PATCH] iptunnel.c: include linux/ip.h to fix building with linux-4.8
+
+Fix a build error when using the linux-4.8 headers that results in:
+
+In file included from
+.../sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0,
+ from iptunnel.c:39:
+.../qemuarm64/usr/include/linux/ip.h:85:8: error: redefinition of
+'struct iphdr'
+ struct iphdr {
+ ^~~~~
+In file included from iptunnel.c:29:0:
+.../qemuarm64/usr/include/netinet/ip.h:44:8: note: originally defined here
+ struct iphdr
+ ^~~~~
+
+Upstream-Status: Submitted [1]
+
+[1] https://sourceforge.net/p/net-tools/mailman/message/35413022/
+
+Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ iptunnel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iptunnel.c b/iptunnel.c
+index 4943d83..acfcbc7 100644
+--- a/iptunnel.c
++++ b/iptunnel.c
+@@ -26,7 +26,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+-#include <netinet/ip.h>
+ #include <arpa/inet.h>
+ #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
+ #include <net/if.h>
+@@ -36,6 +35,7 @@
+ #include <linux/if_arp.h>
+ #endif
+ #include <linux/types.h>
++#include <linux/ip.h>
+ #include <linux/if_tunnel.h>
+
+ #include "config.h"
+--
+2.8.3
+
diff --git a/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
new file mode 100644
index 000000000..5657fd8c5
--- /dev/null
+++ b/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -0,0 +1,122 @@
+SUMMARY = "Basic networking tools"
+DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
+HOMEPAGE = "http://net-tools.berlios.de/"
+BUGTRACKER = "http://bugs.debian.org/net-tools"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \
+ http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \
+ file://net-tools-config.h \
+ file://net-tools-config.make \
+ file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
+ file://musl-fixes.patch \
+ file://net-tools-1.60-sctp1.patch \
+ file://net-tools-1.60-sctp2-quiet.patch \
+ file://net-tools-1.60-sctp3-addrs.patch \
+ file://0001-lib-inet6.c-INET6_rresolve-various-fixes.patch \
+ file://net-tools-fix-building-with-linux-4.8.patch \
+ "
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/net-tools-1.60"
+
+SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
+SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
+
+SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9"
+SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c"
+
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/"
+
+inherit gettext
+
+do_patch[depends] += "quilt-native:do_populate_sysroot"
+
+# The Makefile is lame, no parallel build
+PARALLEL_MAKE = ""
+
+# Unlike other Debian packages, net-tools *.diff.gz contains another series of
+# patches maintained by quilt. So manually apply them before applying other local
+# patches. Also remove all temp files before leaving, because do_patch() will pop
+# up all previously applied patches in the start
+nettools_do_patch() {
+ cd ${S}
+ quilt pop -a || true
+ if [ -d ${S}/.pc-nettools ]; then
+ rm -rf ${S}/.pc
+ mv ${S}/.pc-nettools ${S}/.pc
+ QUILT_PATCHES=${S}/debian/patches quilt pop -a
+ rm -rf ${S}/.pc ${S}/debian
+ fi
+ patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff
+ QUILT_PATCHES=${S}/debian/patches quilt push -a
+ mv ${S}/.pc ${S}/.pc-nettools
+}
+
+do_unpack[cleandirs] += "${S}"
+
+# We invoke base do_patch at end, to incorporate any local patch
+python do_patch() {
+ bb.build.exec_func('nettools_do_patch', d)
+ bb.build.exec_func('patch_do_patch', d)
+}
+
+do_configure() {
+ # net-tools has its own config mechanism requiring "make config"
+ # we pre-generate desired options and copy to source directory instead
+ cp ${WORKDIR}/net-tools-config.h ${S}/config.h
+ cp ${WORKDIR}/net-tools-config.make ${S}/config.make
+
+ if [ "${USE_NLS}" = "no" ]; then
+ sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make
+ fi
+}
+
+do_compile() {
+ # net-tools use COPTS/LOPTS to allow adding custom options
+ oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS"
+}
+
+do_install() {
+ # We don't need COPTS or LOPTS, but let's be consistent.
+ oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" 'BASEDIR=${D}' install
+
+ if [ "${base_bindir}" != "/bin" ]; then
+ mkdir -p ${D}/${base_bindir}
+ mv ${D}/bin/* ${D}/${base_bindir}/
+ rmdir ${D}/bin
+ fi
+ if [ "${base_sbindir}" != "/sbin" ]; then
+ mkdir ${D}/${base_sbindir}
+ mv ${D}/sbin/* ${D}/${base_sbindir}/
+ rmdir ${D}/sbin
+ fi
+}
+
+inherit update-alternatives
+
+base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
+base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
+
+ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
+ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1"
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
+ALTERNATIVE_PRIORITY[hostname.1] = "10"
+
+python __anonymous() {
+ for prog in d.getVar('base_sbindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
+ for prog in d.getVar('base_bindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
+}
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch b/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch
new file mode 100644
index 000000000..a4b3afd95
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/files/0001-detect-gold-as-GNU-linker-too.patch
@@ -0,0 +1,31 @@
+From 58245b859ffbcb1780575bf1b0a018d55e74e434 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 21 Sep 2016 21:14:40 +0200
+Subject: [PATCH] detect gold as GNU linker too
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 03e8bda..c2fce51 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -28,7 +28,7 @@ AC_CHECK_SIZEOF([void *])
+ AC_MSG_CHECKING([for GNU ld])
+ LD=`$CC -print-prog-name=ld 2>&5`
+
+-if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU ld"` = 0; then
++if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU "` = 0; then
+ # Not
+ GNU_LD=""
+ AC_MSG_RESULT([no])
+--
+2.5.5
+
diff --git a/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch b/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch
new file mode 100644
index 000000000..bc55582fd
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch
@@ -0,0 +1,26 @@
+From fad40cfc18a42946a9a9e440c3434cd6b847ff9d Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Mon, 18 Jan 2016 17:05:19 +0000
+Subject: [PATCH] Makefile.in: Add tinfo library to the linking libraries
+Organization: O.S. Systems Software LTDA.
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a85d00f..98b85f9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1,4 +1,4 @@
+-LIBS = -lslang @LIBS@
++LIBS = -lslang -ltinfo @LIBS@
+ LIBTCL = @TCL_LIB_FLAG@
+
+ CC = @CC@
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/newt/files/cross_ar.patch b/poky/meta/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 000000000..86cc0be1d
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,56 @@
+Fix cross link using autoconf detected AR
+
+If building on 32bit host and creating 64bit libraries, the target
+package builds should not invoke the 32bit hosts's ar. Specifically
+you will get an error message like:
+
+x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang
+libnewt.a: could not read symbols: Archive has no index; run ranlib to add one
+collect2: error: ld returned 1 exit status
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 3 ++-
+ configure.ac | 4 ++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+Index: newt-0.52.20/Makefile.in
+===================================================================
+--- newt-0.52.20.orig/Makefile.in
++++ newt-0.52.20/Makefile.in
+@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+ CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
+ GNU_LD = @GNU_LD@
++AR = @AR@
+
+ VERSION = @VERSION@
+ TAG = r$(subst .,-,$(VERSION))
+@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNE
+ $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS)
+
+ $(LIBNEWT): $(LIBOBJS)
+- ar rv $@ $^
++ $(AR) rv $@ $^
+
+ newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
+
+Index: newt-0.52.20/configure.ac
+===================================================================
+--- newt-0.52.20.orig/configure.ac
++++ newt-0.52.20/configure.ac
+@@ -15,6 +15,10 @@ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_GREP
+ AC_SYS_LARGEFILE
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
+
+ AC_CHECK_SIZEOF([long])
+ AC_CHECK_SIZEOF([long long])
diff --git a/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
new file mode 100644
index 000000000..b0a1e8c10
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Author: dexuan.cui@intel.com
+Date: Fri Apr 15 16:17:39 CST 2011
+
+The patch fixes a parallel-make issue: when generating $(SHAREDDIR)/%.o, we should
+ensure the directory ${SHAREDDIR} exists.
+
+We need to push the patch to upstream.
+
+Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -128,12 +128,12 @@ $(SHAREDDIR):
+
+ sharedlib: $(LIBNEWTSH)
+
+-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
++$(LIBNEWTSH): $(SHAREDOBJS)
+ $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
+ ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT)
+ ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+
+-$(SHAREDDIR)/%.o : %.c
++$(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
+ $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+
+ install: $(LIBNEWT) install-sh whiptail
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-extended/newt/files/pie-flags.patch b/poky/meta/recipes-extended/newt/files/pie-flags.patch
new file mode 100644
index 000000000..8883e26ad
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/files/pie-flags.patch
@@ -0,0 +1,36 @@
+specify -fPIC after CFLAGS so it can override the CFLAGS containing -pie and -fpie
+this makes sure the objects that go into shared objects are compiled with -fPIC
+and not with -fpie. We can not use -fpie on objects which will go into .so files
+Fixes errors like
+
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: shared/newt.o: relocation R_X86_64_PC32 against undefined symbol `SLtt_Screen_Rows@@SLANG2' can not be used when making a shared object; recompile with -fPIC
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
+| collect2: error: ld returned 1 exit status
+| make: *** [libnewt.so.0.52.18] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: newt-0.52.18/Makefile.in
+===================================================================
+--- newt-0.52.18.orig/Makefile.in
++++ newt-0.52.18/Makefile.in
+@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH)
+ PIFLAGS=`$$pyconfig --includes`; \
+ PLDFLAGS=`$$pyconfig --ldflags`; \
+ PLFLAGS=`$$pyconfig --libs`; \
+- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
+- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
++ echo $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
++ $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
+ echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
+ $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
+ done || :
+@@ -135,7 +135,7 @@ $(LIBNEWTSH): $(SHAREDOBJS)
+ ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+
+ $(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
+- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SHCFLAGS) -o $@ $<
+
+ install: $(LIBNEWT) install-sh whiptail
+ [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
diff --git a/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb b/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb
new file mode 100644
index 000000000..20369effe
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/libnewt-python_0.52.20.bb
@@ -0,0 +1,28 @@
+require recipes-extended/newt/libnewt_${PV}.bb
+
+SUMMARY .= " - python"
+DEPENDS = "libnewt python3"
+RDEPENDS_${PN} += "python3-core"
+
+inherit python3native python3-dir
+
+EXTRA_OECONF += "--with-python"
+EXTRA_OEMAKE += "PYTHONVERS=${PYTHON_DIR}"
+
+
+do_compile () {
+ VERSION="$(sed -n 's/^VERSION = //p' Makefile)"
+ oe_runmake _snack.so
+}
+
+do_install () {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ install -m 0755 ${PYTHON_DIR}/_snack.so ${D}${PYTHON_SITEPACKAGES_DIR}/
+ install -m 0644 snack.py ${D}${PYTHON_SITEPACKAGES_DIR}/
+}
+
+PACKAGES_remove = "whiptail"
+
+FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb b/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb
new file mode 100644
index 000000000..65ce70c47
--- /dev/null
+++ b/poky/meta/recipes-extended/newt/libnewt_0.52.20.bb
@@ -0,0 +1,54 @@
+SUMMARY = "A library for text mode user interfaces"
+
+DESCRIPTION = "Newt is a programming library for color text mode, widget based user \
+interfaces. Newt can be used to add stacked windows, entry widgets, \
+checkboxes, radio buttons, labels, plain text fields, scrollbars, \
+etc., to text mode user interfaces. This package also contains the \
+shared library needed by programs built with newt, as well as a \
+/usr/bin/dialog replacement called whiptail. Newt is based on the \
+slang library."
+
+HOMEPAGE = "https://releases.pagure.org/newt/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+# slang needs to be >= 2.2
+DEPENDS = "slang popt"
+
+SRC_URI = "https://releases.pagure.org/newt/newt-${PV}.tar.gz \
+ file://fix_SHAREDDIR.patch \
+ file://cross_ar.patch \
+ file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \
+ file://pie-flags.patch \
+ file://0001-detect-gold-as-GNU-linker-too.patch \
+"
+
+SRC_URI[md5sum] = "70b288f821234593a8e7920e435b259b"
+SRC_URI[sha256sum] = "8d66ba6beffc3f786d4ccfee9d2b43d93484680ef8db9397a4fb70b5adbb6dbc"
+
+S = "${WORKDIR}/newt-${PV}"
+
+EXTRA_OECONF = "--without-tcl --without-python"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+export CPPFLAGS
+
+PACKAGES_prepend = "whiptail "
+
+do_configure_prepend() {
+ sh autogen.sh
+}
+
+do_compile_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.depend
+}
+
+FILES_whiptail = "${bindir}/whiptail"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
new file mode 100644
index 000000000..9002fbc37
--- /dev/null
+++ b/poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
@@ -0,0 +1,151 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Standard full-featured Linux system"
+DESCRIPTION = "Package group bringing in packages needed for a more traditional full-featured Linux system"
+PR = "r6"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-core-full-cmdline \
+ packagegroup-core-full-cmdline-libs \
+ packagegroup-core-full-cmdline-utils \
+ packagegroup-core-full-cmdline-extended \
+ packagegroup-core-full-cmdline-dev-utils \
+ packagegroup-core-full-cmdline-multiuser \
+ packagegroup-core-full-cmdline-initscripts \
+ packagegroup-core-full-cmdline-sys-services \
+ "
+
+python __anonymous () {
+ # For backwards compatibility after rename
+ namemap = {}
+ namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic"
+ namemap["packagegroup-core-full-cmdline-libs"] = "packagegroup-core-basic-libs"
+ namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils"
+ namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended"
+ namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils"
+ namemap["packagegroup-core-full-cmdline-multiuser"] = "packagegroup-core-multiuser"
+ namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts"
+ namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services"
+
+ packages = d.getVar("PACKAGES").split()
+ for pkg in packages:
+ if pkg.endswith('-dev'):
+ mapped = namemap.get(pkg[:-4], None)
+ if mapped:
+ mapped += '-dev'
+ elif pkg.endswith('-dbg'):
+ mapped = namemap.get(pkg[:-4], None)
+ if mapped:
+ mapped += '-dbg'
+ else:
+ mapped = namemap.get(pkg, None)
+
+ if mapped:
+ oldtaskname = mapped.replace("packagegroup-core", "task-core")
+ mapstr = " %s %s" % (mapped, oldtaskname)
+ d.appendVar("RPROVIDES_%s" % pkg, mapstr)
+ d.appendVar("RREPLACES_%s" % pkg, mapstr)
+ d.appendVar("RCONFLICTS_%s" % pkg, mapstr)
+}
+
+
+RDEPENDS_packagegroup-core-full-cmdline = "\
+ packagegroup-core-full-cmdline-libs \
+ packagegroup-core-full-cmdline-utils \
+ packagegroup-core-full-cmdline-extended \
+ packagegroup-core-full-cmdline-dev-utils \
+ packagegroup-core-full-cmdline-multiuser \
+ packagegroup-core-full-cmdline-initscripts \
+ packagegroup-core-full-cmdline-sys-services \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-libs = "\
+ glib-2.0 \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-utils = "\
+ bash \
+ acl \
+ attr \
+ bc \
+ coreutils \
+ cpio \
+ e2fsprogs \
+ ed \
+ file \
+ findutils \
+ gawk \
+ gmp \
+ grep \
+ makedevs \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ mktemp \
+ ncurses \
+ net-tools \
+ popt \
+ procps \
+ psmisc \
+ sed \
+ tar \
+ time \
+ util-linux \
+ zlib \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-extended = "\
+ iproute2 \
+ iputils \
+ iptables \
+ module-init-tools \
+ openssl \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-dev-utils = "\
+ diffutils \
+ m4 \
+ make \
+ patch \
+ "
+
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_syslog ?= "sysklogd"
+RDEPENDS_packagegroup-core-full-cmdline-initscripts = "\
+ ${VIRTUAL-RUNTIME_initscripts} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ethtool \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_syslog} \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-multiuser = "\
+ cracklib \
+ gzip \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libuser', '', d)} \
+ shadow \
+ sudo \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-sys-services = "\
+ at \
+ bzip2 \
+ cronie \
+ dbus \
+ elfutils \
+ gzip \
+ less \
+ logrotate \
+ nfs-utils \
+ pciutils \
+ rpcbind \
+ tcp-wrappers \
+ tzdata \
+ "
diff --git a/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
new file mode 100644
index 000000000..53d100ce7
--- /dev/null
+++ b/poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -0,0 +1,242 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Linux Standard Base (LSB)"
+DESCRIPTION = "Packages required to satisfy the Linux Standard Base (LSB) specification"
+PR = "r10"
+
+inherit packagegroup distro_features_check
+
+# The libxt, libxtst and others require x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# libglu needs virtual/libgl, which requires opengl in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+# libpam, pam-plugin-wheel requires pam in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES += "pam"
+
+#
+# We will skip parsing this packagegeoup for non-glibc systems
+#
+python __anonymous () {
+ if d.getVar('TCLIBC') != "glibc":
+ raise bb.parse.SkipRecipe("incompatible with %s C library" %
+ d.getVar('TCLIBC'))
+}
+
+PACKAGES = "\
+ packagegroup-core-lsb \
+ packagegroup-core-sys-extended \
+ packagegroup-core-db \
+ packagegroup-core-perl \
+ packagegroup-core-python \
+ packagegroup-core-tcl \
+ packagegroup-core-lsb-misc \
+ packagegroup-core-lsb-core \
+ packagegroup-core-lsb-perl \
+ packagegroup-core-lsb-python \
+ packagegroup-core-lsb-desktop \
+ packagegroup-core-lsb-runtime-add \
+ "
+
+
+RDEPENDS_packagegroup-core-lsb = "\
+ packagegroup-core-sys-extended \
+ packagegroup-core-db \
+ packagegroup-core-perl \
+ packagegroup-core-python \
+ packagegroup-core-tcl \
+ packagegroup-core-lsb-misc \
+ packagegroup-core-lsb-core \
+ packagegroup-core-lsb-perl \
+ packagegroup-core-lsb-python \
+ packagegroup-core-lsb-desktop \
+ packagegroup-core-lsb-runtime-add \
+ "
+
+
+RDEPENDS_packagegroup-core-sys-extended = "\
+ curl \
+ dhcp-client \
+ hdparm \
+ lighttpd \
+ libaio \
+ lrzsz \
+ lzo \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ mdadm \
+ minicom \
+ parted \
+ quota \
+ screen \
+ setserial \
+ sysstat \
+ udev-extraconf \
+ unzip \
+ watchdog \
+ wget \
+ which \
+ xinetd \
+ zip \
+ "
+
+RDEPENDS_packagegroup-core-db = "\
+ db \
+ sqlite3 \
+ "
+
+RDEPENDS_packagegroup-core-perl = "\
+ gdbm \
+ perl \
+ zlib \
+ "
+
+
+RDEPENDS_packagegroup-core-python = "\
+ expat \
+ gdbm \
+ gmp \
+ ncurses \
+ openssl \
+ python \
+ readline \
+ zip \
+ "
+
+RDEPENDS_packagegroup-core-tcl = "\
+ tcl \
+ "
+
+# Miscellaneous packages required by LSB (or LSB tests)
+RDEPENDS_packagegroup-core-lsb-misc = "\
+ chkconfig \
+ gettext \
+ gettext-runtime \
+ groff \
+ lsbinitscripts \
+ lsbtest \
+ lsof \
+ strace \
+ libusb1 \
+ usbutils \
+ rpm \
+ "
+
+SUMMARY_packagegroup-core-lsb-core = "LSB Core"
+DESCRIPTION_packagegroup-core-lsb-core = "Packages required to support commands/libraries \
+ specified in the LSB Core specification"
+RDEPENDS_packagegroup-core-lsb-core = "\
+ at \
+ bash \
+ bc \
+ binutils \
+ binutils-symlinks \
+ coreutils \
+ cpio \
+ cronie \
+ cups \
+ diffutils \
+ ed \
+ glibc-utils \
+ elfutils \
+ file \
+ findutils \
+ fontconfig-utils \
+ foomatic-filters \
+ gawk \
+ ghostscript \
+ grep \
+ gzip \
+ localedef \
+ lsb \
+ m4 \
+ make \
+ man \
+ man-pages \
+ mktemp \
+ msmtp \
+ patch \
+ procps \
+ psmisc \
+ sed \
+ shadow \
+ tar \
+ time \
+ util-linux \
+ xdg-utils \
+ \
+ glibc \
+ libgcc \
+ libpam \
+ libxml2 \
+ ncurses \
+ zlib \
+ nspr \
+ nss \
+"
+
+SUMMARY_packagegroup-core-lsb-perl = "LSB Runtime Languages (Perl)"
+DESCRIPTION_packagegroup-core-lsb-perl = "Packages required to support libraries \
+ specified in the LSB Runtime languages specification (Perl parts)"
+RDEPENDS_packagegroup-core-lsb-perl = "\
+ perl \
+ perl-modules \
+ perl-misc \
+ perl-pod \
+ perl-dev \
+ perl-doc \
+"
+
+SUMMARY_packagegroup-core-lsb-python = "LSB Runtime Languages (Python)"
+DESCRIPTION_packagegroup-core-lsb-python = "Packages required to support libraries \
+ specified in the LSB Runtime languages specification (Python parts)"
+RDEPENDS_packagegroup-core-lsb-python = "\
+ python \
+ python-modules \
+ python-misc \
+"
+
+SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop"
+DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \
+ specified in the LSB Desktop specification"
+RDEPENDS_packagegroup-core-lsb-desktop = "\
+ libxt \
+ libxxf86vm \
+ libdrm \
+ libglu \
+ libxi \
+ libxtst \
+ libx11-locale \
+ xorg-minimal-fonts \
+ gdk-pixbuf-loader-ico \
+ gdk-pixbuf-loader-bmp \
+ gdk-pixbuf-loader-ani \
+ gdk-pixbuf-xlib \
+ liberation-fonts \
+ gtk+ \
+ atk \
+ libasound \
+"
+
+RDEPENDS_packagegroup-core-lsb-runtime-add = "\
+ ldd \
+ pam-plugin-wheel \
+ e2fsprogs-mke2fs \
+ mkfontdir \
+ liburi-perl \
+ libxml-parser-perl \
+ libxml-perl \
+ libxml-sax-perl \
+ glibc-localedatas \
+ glibc-gconvs \
+ glibc-charmaps \
+ glibc-binaries \
+ glibc-localedata-posix \
+ glibc-extra-nss \
+ glibc-pcprofile \
+"
diff --git a/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch
new file mode 100644
index 000000000..c55b64813
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch
@@ -0,0 +1,68 @@
+From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Aug 2015 14:16:43 -0700
+Subject: [PATCH] Add support for defining missing funcitonality
+
+In order to support alternative libc on linux ( musl, bioninc ) etc we
+need to check for glibc-only features and provide alternatives, in this
+list strndupa is first one, when configure detects that its not included
+in system C library then the altrnative implementation from missing.h is
+used
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 3 +++
+ libpam/include/missing.h | 12 ++++++++++++
+ modules/pam_exec/pam_exec.c | 1 +
+ 3 files changed, 16 insertions(+)
+ create mode 100644 libpam/include/missing.h
+
+diff --git a/configure.ac b/configure.ac
+index 9e1257f..cbed979 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -599,6 +599,9 @@ dnl
+ AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>])
+ AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>])
+
++# musl and bionic don't have strndupa
++AC_CHECK_DECLS_ONCE([strndupa])
++
+ HAVE_KEY_MANAGEMENT=0
+ if test $have_key_syscalls$have_key_errors = 11
+ then
+diff --git a/libpam/include/missing.h b/libpam/include/missing.h
+new file mode 100644
+index 0000000..3cf011c
+--- /dev/null
++++ b/libpam/include/missing.h
+@@ -0,0 +1,12 @@
++#pragma once
++
++#if !HAVE_DECL_STRNDUPA
++#define strndupa(s, n) \
++ ({ \
++ const char *__old = (s); \
++ size_t __len = strnlen(__old, (n)); \
++ char *__new = alloca(__len + 1); \
++ __new[__len] = '\0'; \
++ memcpy(__new, __old, __len); \
++ })
++#endif
+diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c
+index 17ba6ca..3aa2694 100644
+--- a/modules/pam_exec/pam_exec.c
++++ b/modules/pam_exec/pam_exec.c
+@@ -59,6 +59,7 @@
+ #include <security/pam_modutil.h>
+ #include <security/pam_ext.h>
+ #include <security/_pam_macros.h>
++#include <missing.h>
+
+ #define ENV_ITEM(n) { (n), #n }
+ static struct {
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/pam/libpam/99_pam b/poky/meta/recipes-extended/pam/libpam/99_pam
new file mode 100644
index 000000000..97e990d10
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/99_pam
@@ -0,0 +1 @@
+d root root 0755 /var/run/sepermit none
diff --git a/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch b/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
new file mode 100644
index 000000000..917a8af64
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
@@ -0,0 +1,40 @@
+From b86575ab4a0df07da160283459da270e1c0372a0 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 24 May 2016 14:11:09 +0300
+Subject: [PATCH] crypt_configure
+
+This patch fixes a case where it find crypt defined in libc (musl) but
+not in specified libraries then it ends up assigning
+LIBCRYPT="-l" which then goes into makefile cause all sort of problems
+e.g.
+
+ld: cannot find -l-m32
+| collect2: error: ld returned 1 exit status
+The reason is that -l appears on commandline with
+out any library and compiler treats the next argument as library name
+whatever it is.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index df39d07..e68d856 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -401,7 +401,7 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"],
+ [crypt_libs="crypt"])
+
+ BACKUP_LIBS=$LIBS
+-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="${ac_lib:+-l$ac_lib}", LIBCRYPT="")
++AC_SEARCH_LIBS([crypt],[$crypt_libs], [test "$ac_cv_search_crypt" = "none required" || LIBCRYPT="$ac_cv_search_crypt"])
+ AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
+ LIBS=$BACKUP_LIBS
+ AC_SUBST(LIBCRYPT)
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch b/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch
new file mode 100644
index 000000000..8a9c3b2fa
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch
@@ -0,0 +1,24 @@
+Fix the build error when a separate build directory is used:
+
+Making install in xtestsmake[1]: Entering directory `/media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/build/xtests'/usr/bin/install -c -d /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtestsfor file in run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd tst-pam_dispatch5.pamd tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd tst-pam_unix4.pamd tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh tst-pam_unix4.sh access.conf tst-pam_access1.pamd tst-pam_access1.sh tst-pam_access2.pamd tst-pam_access2.sh tst-pam_access3.pamd tst-pam_access3.sh tst-pam_access4.pamd tst-pam_access4.sh limits.conf tst-pam_limits1.pamd tst-pam_limits1.sh tst-pam_succeed_if1.pamd tst-pam_succeed_if1.sh group.conf tst-pam_group1.pamd tst-pam_group1.sh tst-pam_authfail.pamd tst-pam_authsucceed.pamd tst-pam_substack1.pamd tst-pam_substack1a.pamd tst-pam_substack1.sh tst-pam_substack2.pamd tst-pam_substack2a.pamd tst-pam_substack2.sh tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh tst-pam_time1.pamd time.conf ; do \/usr/bin/install -c $file /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtests ; \ done
+/usr/bin/install: cannot stat `run-xtests.sh': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch1.pamd': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch2.pamd': No such file or directory
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: Linux-PAM-1.1.6/xtests/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.6.orig/xtests/Makefile.am 2013-03-08 12:26:30.360266000 +0000
++++ Linux-PAM-1.1.6/xtests/Makefile.am 2013-03-21 11:39:58.557166650 +0000
+@@ -59,7 +59,7 @@
+ install_xtests:
+ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
+ for file in $(EXTRA_DIST) ; do \
+- $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
+ done
+ for file in $(XTESTS); do \
+ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
diff --git a/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch
new file mode 100644
index 000000000..e4eb95669
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/include_paths_header.patch
@@ -0,0 +1,59 @@
+This patch adds missing include for paths.h which should provide
+_PATH_LASTLOG definition
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c
+===================================================================
+--- Linux-PAM-1.1.6.orig/modules/pam_lastlog/pam_lastlog.c
++++ Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c
+@@ -23,9 +23,11 @@
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <sys/file.h>
+ #include <sys/types.h>
+ #include <syslog.h>
+ #include <unistd.h>
++#include <paths.h>
+
+ #if defined(hpux) || defined(sunos) || defined(solaris)
+ # ifndef _PATH_LASTLOG
+@@ -332,6 +334,23 @@ last_login_read(pam_handle_t *pamh, int
+ return retval;
+ }
+
++#ifndef __GLIBC__
++static void logwtmp(const char * line, const char * name, const char * host)
++{
++ struct utmp u;
++ memset(&u, 0, sizeof(u));
++
++ u.ut_pid = getpid();
++ u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS;
++ strncpy(u.ut_line, line, sizeof(u.ut_line));
++ strncpy(u.ut_name, name, sizeof(u.ut_name));
++ strncpy(u.ut_host, host, sizeof(u.ut_host));
++ gettimeofday(&(u.ut_tv), NULL);
++
++ updwtmp(_PATH_WTMP, &u);
++}
++#endif /* __GLIBC__ */
++
+ static int
+ last_login_write(pam_handle_t *pamh, int announce, int last_fd,
+ uid_t uid, const char *user)
+Index: Linux-PAM-1.1.6/modules/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.6.orig/modules/Makefile.am
++++ Linux-PAM-1.1.6/modules/Makefile.am
+@@ -7,7 +7,7 @@ SUBDIRS = pam_access pam_cracklib pam_de
+ pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
+ pam_listfile pam_localuser pam_loginuid pam_mail \
+ pam_mkhomedir pam_motd pam_namespace pam_nologin \
+- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \
++ pam_permit pam_pwhistory pam_rootok pam_securetty \
+ pam_selinux pam_sepermit pam_shells pam_stress \
+ pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
+ pam_tty_audit pam_umask \
diff --git a/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch b/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
new file mode 100644
index 000000000..680029ae0
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
@@ -0,0 +1,226 @@
+From 555407ff6e2f742df64ae93859f14a0fc1397829 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 12 Sep 2014 05:35:05 -0400
+Subject: [PATCH] libpam/xtests: remove bash dependency
+
+There's not bash specific syntax in the xtest scripts:
+
+ # after below patches applied:
+ $ cd Linux-PAM-1.1.6/xtests
+ $ checkbashisms *.sh
+ No output
+
+Just remove the runtime dependency to bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ xtests/run-xtests.sh | 2 +-
+ xtests/tst-pam_access1.sh | 2 +-
+ xtests/tst-pam_access2.sh | 2 +-
+ xtests/tst-pam_access3.sh | 2 +-
+ xtests/tst-pam_access4.sh | 2 +-
+ xtests/tst-pam_assemble_line1.sh | 2 +-
+ xtests/tst-pam_group1.sh | 2 +-
+ xtests/tst-pam_limits1.sh | 2 +-
+ xtests/tst-pam_pwhistory1.sh | 2 +-
+ xtests/tst-pam_substack1.sh | 2 +-
+ xtests/tst-pam_substack2.sh | 2 +-
+ xtests/tst-pam_substack3.sh | 2 +-
+ xtests/tst-pam_substack4.sh | 2 +-
+ xtests/tst-pam_substack5.sh | 2 +-
+ xtests/tst-pam_succeed_if1.sh | 2 +-
+ xtests/tst-pam_unix1.sh | 2 +-
+ xtests/tst-pam_unix2.sh | 2 +-
+ xtests/tst-pam_unix3.sh | 2 +-
+ xtests/tst-pam_unix4.sh | 2 +-
+ 19 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
+index 3a89057..1cf8684 100755
+--- a/xtests/run-xtests.sh
++++ b/xtests/run-xtests.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ SRCDIR=$1
+ shift 1
+diff --git a/xtests/tst-pam_access1.sh b/xtests/tst-pam_access1.sh
+index 180d256..70521d2 100755
+--- a/xtests/tst-pam_access1.sh
++++ b/xtests/tst-pam_access1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -G tstpamaccess -p '!!' tstpamaccess1
+diff --git a/xtests/tst-pam_access2.sh b/xtests/tst-pam_access2.sh
+index 0a30275..7e3e60f 100755
+--- a/xtests/tst-pam_access2.sh
++++ b/xtests/tst-pam_access2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -p '!!' tstpamaccess2
+diff --git a/xtests/tst-pam_access3.sh b/xtests/tst-pam_access3.sh
+index 348e0c3..3630e2e 100755
+--- a/xtests/tst-pam_access3.sh
++++ b/xtests/tst-pam_access3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamaccess3
+ ./tst-pam_access3
+diff --git a/xtests/tst-pam_access4.sh b/xtests/tst-pam_access4.sh
+index 61e7b44..4538df4 100755
+--- a/xtests/tst-pam_access4.sh
++++ b/xtests/tst-pam_access4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamaccess4
+ ./tst-pam_access4
+diff --git a/xtests/tst-pam_assemble_line1.sh b/xtests/tst-pam_assemble_line1.sh
+index 248d47e..dc2a675 100755
+--- a/xtests/tst-pam_assemble_line1.sh
++++ b/xtests/tst-pam_assemble_line1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_assemble_line1
+diff --git a/xtests/tst-pam_group1.sh b/xtests/tst-pam_group1.sh
+index b76377f..44faca9 100755
+--- a/xtests/tst-pam_group1.sh
++++ b/xtests/tst-pam_group1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamgrpg
+ /usr/sbin/useradd -p '!!' tstpamgrp
+diff --git a/xtests/tst-pam_limits1.sh b/xtests/tst-pam_limits1.sh
+index 4faa822..32c021d 100755
+--- a/xtests/tst-pam_limits1.sh
++++ b/xtests/tst-pam_limits1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamlimits
+ ./tst-pam_limits1
+diff --git a/xtests/tst-pam_pwhistory1.sh b/xtests/tst-pam_pwhistory1.sh
+index ddb3b8b..0f212e2 100644
+--- a/xtests/tst-pam_pwhistory1.sh
++++ b/xtests/tst-pam_pwhistory1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd tstpampwhistory
+ ./tst-pam_pwhistory1
+diff --git a/xtests/tst-pam_substack1.sh b/xtests/tst-pam_substack1.sh
+index 5260175..f1b72a7 100755
+--- a/xtests/tst-pam_substack1.sh
++++ b/xtests/tst-pam_substack1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_substack1
+diff --git a/xtests/tst-pam_substack2.sh b/xtests/tst-pam_substack2.sh
+index c02f597..3804fa7 100755
+--- a/xtests/tst-pam_substack2.sh
++++ b/xtests/tst-pam_substack2.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack2
+diff --git a/xtests/tst-pam_substack3.sh b/xtests/tst-pam_substack3.sh
+index 0e572aa..aa48e8e 100755
+--- a/xtests/tst-pam_substack3.sh
++++ b/xtests/tst-pam_substack3.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack3
+diff --git a/xtests/tst-pam_substack4.sh b/xtests/tst-pam_substack4.sh
+index a3ef08a..958a07a 100755
+--- a/xtests/tst-pam_substack4.sh
++++ b/xtests/tst-pam_substack4.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack4
+diff --git a/xtests/tst-pam_substack5.sh b/xtests/tst-pam_substack5.sh
+index e2714fd..7e0da74 100755
+--- a/xtests/tst-pam_substack5.sh
++++ b/xtests/tst-pam_substack5.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_substack5
+diff --git a/xtests/tst-pam_succeed_if1.sh b/xtests/tst-pam_succeed_if1.sh
+index a643b2e..58e57b4 100755
+--- a/xtests/tst-pam_succeed_if1.sh
++++ b/xtests/tst-pam_succeed_if1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamtest
+ /usr/sbin/useradd -p '!!' pamtest
+diff --git a/xtests/tst-pam_unix1.sh b/xtests/tst-pam_unix1.sh
+index f75bd84..72deac0 100755
+--- a/xtests/tst-pam_unix1.sh
++++ b/xtests/tst-pam_unix1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamunix
+ ./tst-pam_unix1
+diff --git a/xtests/tst-pam_unix2.sh b/xtests/tst-pam_unix2.sh
+index 7093155..c04d6e6 100755
+--- a/xtests/tst-pam_unix2.sh
++++ b/xtests/tst-pam_unix2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix0 = 0aXKZztA.d1KY
+ /usr/sbin/useradd -p 0aXKZztA.d1KY tstpamunix
+diff --git a/xtests/tst-pam_unix3.sh b/xtests/tst-pam_unix3.sh
+index ef4a07c..b52db2b 100755
+--- a/xtests/tst-pam_unix3.sh
++++ b/xtests/tst-pam_unix3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+diff --git a/xtests/tst-pam_unix4.sh b/xtests/tst-pam_unix4.sh
+index 787c2f9..e7976fd 100755
+--- a/xtests/tst-pam_unix4.sh
++++ b/xtests/tst-pam_unix4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
new file mode 100644
index 000000000..7edf66f91
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
@@ -0,0 +1,37 @@
+This patch is used to create a new sub package libpam-xtests to do more checks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Index: Linux-PAM-1.3.0/xtests/Makefile.am
+===================================================================
+--- Linux-PAM-1.3.0.orig/xtests/Makefile.am
++++ Linux-PAM-1.3.0/xtests/Makefile.am
+@@ -7,7 +7,7 @@ AM_CFLAGS = -DLIBPAM_COMPILE -I$(top_src
+ LDADD = $(top_builddir)/libpam/libpam.la \
+ $(top_builddir)/libpam_misc/libpam_misc.la
+
+-CLEANFILES = *~ $(XTESTS)
++CLEANFILES = *~
+
+ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
+ tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \
+@@ -51,3 +51,18 @@ EXTRA_PROGRAMS = $(XTESTS)
+
+ xtests: $(XTESTS) run-xtests.sh
+ "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS}
++
++all: $(XTESTS)
++
++install: install_xtests
++
++install_xtests:
++ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
++ for file in $(EXTRA_DIST) ; do \
++ $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ done
++ for file in $(XTESTS); do \
++ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ done
++
++.PHONY: all install_xtests
diff --git a/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch b/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
new file mode 100644
index 000000000..9b8d4c297
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
@@ -0,0 +1,203 @@
+Description: extract the securetty logic for use with the "nullok_secure" option
+ introduced in the "055_pam_unix_nullok_secure" patch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+===================================================================
+Index: Linux-PAM-1.3.0/modules/pam_securetty/Makefile.am
+===================================================================
+--- Linux-PAM-1.3.0.orig/modules/pam_securetty/Makefile.am
++++ Linux-PAM-1.3.0/modules/pam_securetty/Makefile.am
+@@ -24,6 +24,10 @@ endif
+ securelib_LTLIBRARIES = pam_securetty.la
+ pam_securetty_la_LIBADD = $(top_builddir)/libpam/libpam.la
+
++pam_securetty_la_SOURCES = \
++ pam_securetty.c \
++ tty_secure.c
++
+ if ENABLE_REGENERATE_MAN
+ noinst_DATA = README
+ README: pam_securetty.8.xml
+Index: Linux-PAM-1.3.0/modules/pam_securetty/pam_securetty.c
+===================================================================
+--- Linux-PAM-1.3.0.orig/modules/pam_securetty/pam_securetty.c
++++ Linux-PAM-1.3.0/modules/pam_securetty/pam_securetty.c
+@@ -1,7 +1,5 @@
+ /* pam_securetty module */
+
+-#define SECURETTY_FILE "/etc/securetty"
+-#define TTY_PREFIX "/dev/"
+ #define CMDLINE_FILE "/proc/cmdline"
+ #define CONSOLEACTIVE_FILE "/sys/class/tty/console/active"
+
+@@ -40,6 +38,9 @@
+ #include <security/pam_modutil.h>
+ #include <security/pam_ext.h>
+
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++ const char *uttyname);
++
+ #define PAM_DEBUG_ARG 0x0001
+ #define PAM_NOCONSOLE_ARG 0x0002
+
+@@ -73,11 +74,7 @@ securetty_perform_check (pam_handle_t *p
+ const char *username;
+ const char *uttyname;
+ const void *void_uttyname;
+- char ttyfileline[256];
+- char ptname[256];
+- struct stat ttyfileinfo;
+ struct passwd *user_pwd;
+- FILE *ttyfile;
+
+ /* log a trail for debugging */
+ if (ctrl & PAM_DEBUG_ARG) {
+@@ -105,50 +102,7 @@ securetty_perform_check (pam_handle_t *p
+ return PAM_SERVICE_ERR;
+ }
+
+- /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
+- if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0) {
+- uttyname += sizeof(TTY_PREFIX)-1;
+- }
+-
+- if (stat(SECURETTY_FILE, &ttyfileinfo)) {
+- pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m", SECURETTY_FILE);
+- return PAM_SUCCESS; /* for compatibility with old securetty handling,
+- this needs to succeed. But we still log the
+- error. */
+- }
+-
+- if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
+- /* If the file is world writable or is not a
+- normal file, return error */
+- pam_syslog(pamh, LOG_ERR,
+- "%s is either world writable or not a normal file",
+- SECURETTY_FILE);
+- return PAM_AUTH_ERR;
+- }
+-
+- ttyfile = fopen(SECURETTY_FILE,"r");
+- if (ttyfile == NULL) { /* Check that we opened it successfully */
+- pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
+- return PAM_SERVICE_ERR;
+- }
+-
+- if (isdigit(uttyname[0])) {
+- snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
+- } else {
+- ptname[0] = '\0';
+- }
+-
+- retval = 1;
+-
+- while ((fgets(ttyfileline, sizeof(ttyfileline)-1, ttyfile) != NULL)
+- && retval) {
+- if (ttyfileline[strlen(ttyfileline) - 1] == '\n')
+- ttyfileline[strlen(ttyfileline) - 1] = '\0';
+-
+- retval = ( strcmp(ttyfileline, uttyname)
+- && (!ptname[0] || strcmp(ptname, uttyname)) );
+- }
+- fclose(ttyfile);
++ retval = _pammodutil_tty_secure(pamh, uttyname);
+
+ if (retval && !(ctrl & PAM_NOCONSOLE_ARG)) {
+ FILE *cmdlinefile;
+Index: Linux-PAM-1.3.0/modules/pam_securetty/tty_secure.c
+===================================================================
+--- /dev/null
++++ Linux-PAM-1.3.0/modules/pam_securetty/tty_secure.c
+@@ -0,0 +1,90 @@
++/*
++ * A function to determine if a particular line is in /etc/securetty
++ */
++
++
++#define SECURETTY_FILE "/etc/securetty"
++#define TTY_PREFIX "/dev/"
++
++/* This function taken out of pam_securetty by Sam Hartman
++ * <hartmans@debian.org>*/
++/*
++ * by Elliot Lee <sopwith@redhat.com>, Red Hat Software.
++ * July 25, 1996.
++ * Slight modifications AGM. 1996/12/3
++ */
++
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <security/pam_modules.h>
++#include <stdarg.h>
++#include <syslog.h>
++#include <sys/syslog.h>
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <security/pam_modutil.h>
++#include <security/pam_ext.h>
++
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++ const char *uttyname);
++
++int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname)
++{
++ int retval = PAM_AUTH_ERR;
++ char ttyfileline[256];
++ char ptname[256];
++ struct stat ttyfileinfo;
++ FILE *ttyfile;
++ /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
++ if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0)
++ uttyname += sizeof(TTY_PREFIX)-1;
++
++ if (stat(SECURETTY_FILE, &ttyfileinfo)) {
++ pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m",
++ SECURETTY_FILE);
++ return PAM_SUCCESS; /* for compatibility with old securetty handling,
++ this needs to succeed. But we still log the
++ error. */
++ }
++
++ if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
++ /* If the file is world writable or is not a
++ normal file, return error */
++ pam_syslog(pamh, LOG_ERR,
++ "%s is either world writable or not a normal file",
++ SECURETTY_FILE);
++ return PAM_AUTH_ERR;
++ }
++
++ ttyfile = fopen(SECURETTY_FILE,"r");
++ if(ttyfile == NULL) { /* Check that we opened it successfully */
++ pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
++ return PAM_SERVICE_ERR;
++ }
++
++ if (isdigit(uttyname[0])) {
++ snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
++ } else {
++ ptname[0] = '\0';
++ }
++
++ retval = 1;
++
++ while ((fgets(ttyfileline,sizeof(ttyfileline)-1, ttyfile) != NULL)
++ && retval) {
++ if(ttyfileline[strlen(ttyfileline) - 1] == '\n')
++ ttyfileline[strlen(ttyfileline) - 1] = '\0';
++ retval = ( strcmp(ttyfileline,uttyname)
++ && (!ptname[0] || strcmp(ptname, uttyname)) );
++ }
++ fclose(ttyfile);
++
++ if(retval) {
++ retval = PAM_AUTH_ERR;
++ }
++
++ return retval;
++}
diff --git a/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch b/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
new file mode 100644
index 000000000..d2cc66882
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
@@ -0,0 +1,195 @@
+From b6545b83f94c5fb7aec1478b8d458a1393f479c8 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 25 May 2016 14:12:25 +0300
+Subject: [PATCH] pam_unix: support 'nullok_secure' option
+
+Debian patch to add a new 'nullok_secure' option to pam_unix,
+which accepts users with null passwords only when the applicant is
+connected from a tty listed in /etc/securetty.
+
+Authors: Sam Hartman <hartmans@debian.org>,
+ Steve Langasek <vorlon@debian.org>
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ modules/pam_unix/Makefile.am | 3 ++-
+ modules/pam_unix/pam_unix.8.xml | 19 ++++++++++++++++++-
+ modules/pam_unix/support.c | 40 +++++++++++++++++++++++++++++++++++-----
+ modules/pam_unix/support.h | 8 ++++++--
+ 4 files changed, 61 insertions(+), 9 deletions(-)
+
+diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
+index 56df178..2bba460 100644
+--- a/modules/pam_unix/Makefile.am
++++ b/modules/pam_unix/Makefile.am
+@@ -30,7 +30,8 @@ if HAVE_VERSIONING
+ pam_unix_la_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map
+ endif
+ pam_unix_la_LIBADD = $(top_builddir)/libpam/libpam.la \
+- @LIBCRYPT@ @LIBSELINUX@ @TIRPC_LIBS@ @NSL_LIBS@
++ @LIBCRYPT@ @LIBSELINUX@ @TIRPC_LIBS@ @NSL_LIBS@ \
++ ../pam_securetty/tty_secure.lo
+
+ securelib_LTLIBRARIES = pam_unix.la
+
+diff --git a/modules/pam_unix/pam_unix.8.xml b/modules/pam_unix/pam_unix.8.xml
+index 1b318f1..be0330e 100644
+--- a/modules/pam_unix/pam_unix.8.xml
++++ b/modules/pam_unix/pam_unix.8.xml
+@@ -159,7 +159,24 @@
+ <para>
+ The default action of this module is to not permit the
+ user access to a service if their official password is blank.
+- The <option>nullok</option> argument overrides this default.
++ The <option>nullok</option> argument overrides this default
++ and allows any user with a blank password to access the
++ service.
++ </para>
++ </listitem>
++ </varlistentry>
++ <varlistentry>
++ <term>
++ <option>nullok_secure</option>
++ </term>
++ <listitem>
++ <para>
++ The default action of this module is to not permit the
++ user access to a service if their official password is blank.
++ The <option>nullok_secure</option> argument overrides this
++ default and allows any user with a blank password to access
++ the service as long as the value of PAM_TTY is set to one of
++ the values found in /etc/securetty.
+ </para>
+ </listitem>
+ </varlistentry>
+diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
+index fc8595e..29e3341 100644
+--- a/modules/pam_unix/support.c
++++ b/modules/pam_unix/support.c
+@@ -183,13 +183,22 @@ int _set_ctrl(pam_handle_t *pamh, int flags, int *remember, int *rounds,
+ /* now parse the arguments to this module */
+
+ for (; argc-- > 0; ++argv) {
++ int sl;
+
+ D(("pam_unix arg: %s", *argv));
+
+ for (j = 0; j < UNIX_CTRLS_; ++j) {
+- if (unix_args[j].token
+- && !strncmp(*argv, unix_args[j].token, strlen(unix_args[j].token))) {
+- break;
++ if (unix_args[j].token) {
++ sl = strlen(unix_args[j].token);
++ if (unix_args[j].token[sl-1] == '=') {
++ /* exclude argument from comparison */
++ if (!strncmp(*argv, unix_args[j].token, sl))
++ break;
++ } else {
++ /* compare full strings */
++ if (!strcmp(*argv, unix_args[j].token))
++ break;
++ }
+ }
+ }
+
+@@ -560,6 +569,7 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+ if (child == 0) {
+ static char *envp[] = { NULL };
+ const char *args[] = { NULL, NULL, NULL, NULL };
++ int nullok = off(UNIX__NONULL, ctrl);
+
+ /* XXX - should really tidy up PAM here too */
+
+@@ -587,7 +597,16 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+ /* exec binary helper */
+ args[0] = CHKPWD_HELPER;
+ args[1] = user;
+- if (off(UNIX__NONULL, ctrl)) { /* this means we've succeeded */
++ if (on(UNIX_NULLOK_SECURE, ctrl)) {
++ const void *uttyname;
++ retval = pam_get_item(pamh, PAM_TTY, &uttyname);
++ if (retval != PAM_SUCCESS || uttyname == NULL
++ || _pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS) {
++ nullok = 0;
++ }
++ }
++
++ if (nullok) {
+ args[2]="nullok";
+ } else {
+ args[2]="nonull";
+@@ -672,6 +691,17 @@ _unix_blankpasswd (pam_handle_t *pamh, unsigned int ctrl, const char *name)
+ if (on(UNIX__NONULL, ctrl))
+ return 0; /* will fail but don't let on yet */
+
++ if (on(UNIX_NULLOK_SECURE, ctrl)) {
++ int retval2;
++ const void *uttyname;
++ retval2 = pam_get_item(pamh, PAM_TTY, &uttyname);
++ if (retval2 != PAM_SUCCESS || uttyname == NULL)
++ return 0;
++
++ if (_pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS)
++ return 0;
++ }
++
+ /* UNIX passwords area */
+
+ retval = get_pwd_hash(pamh, name, &pwd, &salt);
+@@ -758,7 +788,7 @@ int _unix_verify_password(pam_handle_t * pamh, const char *name
+ }
+ }
+ } else {
+- retval = verify_pwd_hash(p, salt, off(UNIX__NONULL, ctrl));
++ retval = verify_pwd_hash(p, salt, _unix_blankpasswd(pamh, ctrl, name));
+ }
+
+ if (retval == PAM_SUCCESS) {
+diff --git a/modules/pam_unix/support.h b/modules/pam_unix/support.h
+index b4c279c..8da4a8e 100644
+--- a/modules/pam_unix/support.h
++++ b/modules/pam_unix/support.h
+@@ -98,8 +98,9 @@ typedef struct {
+ #define UNIX_QUIET 28 /* Don't print informational messages */
+ #define UNIX_NO_PASS_EXPIRY 29 /* Don't check for password expiration if not used for authentication */
+ #define UNIX_DES 30 /* DES, default */
++#define UNIX_NULLOK_SECURE 31 /* NULL passwords allowed only on secure ttys */
+ /* -------------- */
+-#define UNIX_CTRLS_ 31 /* number of ctrl arguments defined */
++#define UNIX_CTRLS_ 32 /* number of ctrl arguments defined */
+
+ #define UNIX_DES_CRYPT(ctrl) (off(UNIX_MD5_PASS,ctrl)&&off(UNIX_BIGCRYPT,ctrl)&&off(UNIX_SHA256_PASS,ctrl)&&off(UNIX_SHA512_PASS,ctrl)&&off(UNIX_BLOWFISH_PASS,ctrl))
+
+@@ -117,7 +118,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_AUTHTOK_TYPE */ {"authtok_type=", _ALL_ON_, 0100, 0},
+ /* UNIX__PRELIM */ {NULL, _ALL_ON_^(0600), 0200, 0},
+ /* UNIX__UPDATE */ {NULL, _ALL_ON_^(0600), 0400, 0},
+-/* UNIX__NONULL */ {NULL, _ALL_ON_, 01000, 0},
++/* UNIX__NONULL */ {NULL, _ALL_ON_^(02000000000), 01000, 0},
+ /* UNIX__QUIET */ {NULL, _ALL_ON_, 02000, 0},
+ /* UNIX_USE_AUTHTOK */ {"use_authtok", _ALL_ON_, 04000, 0},
+ /* UNIX_SHADOW */ {"shadow", _ALL_ON_, 010000, 0},
+@@ -139,6 +140,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_QUIET */ {"quiet", _ALL_ON_, 01000000000, 0},
+ /* UNIX_NO_PASS_EXPIRY */ {"no_pass_expiry", _ALL_ON_, 02000000000, 0},
+ /* UNIX_DES */ {"des", _ALL_ON_^(0260420000), 0, 1},
++/* UNIX_NULLOK_SECURE */ {"nullok_secure", _ALL_ON_^(01000), 02000000000, 0},
+ };
+
+ #define UNIX_DEFAULTS (unix_args[UNIX__NONULL].flag)
+@@ -172,6 +174,8 @@ extern int _unix_read_password(pam_handle_t * pamh
+ ,const char *data_name
+ ,const void **pass);
+
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname);
++
+ extern int _unix_run_verify_binary(pam_handle_t *pamh,
+ unsigned int ctrl, const char *user, int *daysleft);
+ #endif /* _PAM_UNIX_SUPPORT_H */
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-account b/poky/meta/recipes-extended/pam/libpam/pam.d/common-account
new file mode 100644
index 000000000..316b17337
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-account
@@ -0,0 +1,25 @@
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system. The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+#
+
+# here are the per-package modules (the "Primary" block)
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
+# here's the fallback if no module succeeds
+account requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+# end of pam-auth-update config
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth b/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth
new file mode 100644
index 000000000..460b69f19
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-auth
@@ -0,0 +1,18 @@
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
+# traditional Unix authentication mechanisms.
+
+# here are the per-package modules (the "Primary" block)
+auth [success=1 default=ignore] pam_unix.so nullok_secure
+# here's the fallback if no module succeeds
+auth requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-password b/poky/meta/recipes-extended/pam/libpam/pam.d/common-password
new file mode 100644
index 000000000..389605732
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-password
@@ -0,0 +1,26 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords. The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords. Without this option,
+# the default is Unix crypt. Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# here are the per-package modules (the "Primary" block)
+password [success=1 default=ignore] pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-session b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session
new file mode 100644
index 000000000..a4a551f71
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
new file mode 100644
index 000000000..b110bb2b4
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/poky/meta/recipes-extended/pam/libpam/pam.d/other b/poky/meta/recipes-extended/pam/libpam/pam.d/other
new file mode 100644
index 000000000..ec970ecbe
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam/pam.d/other
@@ -0,0 +1,24 @@
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used.
+
+# We use pam_warn.so to generate syslog notes that the 'other'
+#fallback rules are being used (as a hint to suggest you should setup
+#specific PAM rules for the service and aid to debugging). Then to be
+#secure, deny access to all services by default.
+
+auth required pam_warn.so
+auth required pam_deny.so
+
+account required pam_warn.so
+account required pam_deny.so
+
+password required pam_warn.so
+password required pam_deny.so
+
+session required pam_warn.so
+session required pam_deny.so
diff --git a/poky/meta/recipes-extended/pam/libpam_1.3.0.bb b/poky/meta/recipes-extended/pam/libpam_1.3.0.bb
new file mode 100644
index 000000000..92ab72a42
--- /dev/null
+++ b/poky/meta/recipes-extended/pam/libpam_1.3.0.bb
@@ -0,0 +1,164 @@
+SUMMARY = "Linux-PAM (Pluggable Authentication Modules)"
+DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users"
+HOMEPAGE = "https://fedorahosted.org/linux-pam/"
+BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket"
+SECTION = "base"
+# PAM is dual licensed under GPL and BSD.
+# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time
+# libpam-runtime-1.0.1 is GPLv2+), by openembedded
+LICENSE = "GPLv2+ | BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3"
+
+SRC_URI = "http://linux-pam.org/library/Linux-PAM-${PV}.tar.bz2 \
+ file://99_pam \
+ file://pam.d/common-account \
+ file://pam.d/common-auth \
+ file://pam.d/common-password \
+ file://pam.d/common-session \
+ file://pam.d/common-session-noninteractive \
+ file://pam.d/other \
+ file://libpam-xtests.patch \
+ file://fixsepbuild.patch \
+ file://pam-security-abstract-securetty-handling.patch \
+ file://pam-unix-nullok-secure.patch \
+ file://libpam-xtests-remove-bash-dependency.patch \
+ file://crypt_configure.patch \
+ "
+
+SRC_URI[md5sum] = "da4b2289b7cfb19583d54e9eaaef1c3a"
+SRC_URI[sha256sum] = "241aed1ef522f66ed672719ecf2205ec513fd0075ed80cda8e086a5b1a01d1bb"
+
+SRC_URI_append_libc-musl = " file://0001-Add-support-for-defining-missing-funcitonality.patch \
+ file://include_paths_header.patch \
+ "
+
+DEPENDS = "bison-native flex flex-native cracklib libxml2-native"
+
+EXTRA_OECONF = "--with-db-uniquename=_pam \
+ --includedir=${includedir}/security \
+ --libdir=${base_libdir} \
+ --disable-nis \
+ --disable-regenerate-docu \
+ --disable-prelude"
+
+CFLAGS_append = " -fPIC "
+
+PR = "r5"
+
+S = "${WORKDIR}/Linux-PAM-${PV}"
+
+inherit autotools gettext pkgconfig
+
+PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
+
+PACKAGES += "${PN}-runtime ${PN}-xtests"
+FILES_${PN} = "${base_libdir}/lib*${SOLIBS}"
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-runtime = "${sysconfdir}"
+FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests"
+
+PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
+
+def get_multilib_bit(d):
+ baselib = d.getVar('baselib') or ''
+ return baselib.replace('lib', '')
+
+libpam_suffix = "suffix${@get_multilib_bit(d)}"
+
+RPROVIDES_${PN} += "${PN}-${libpam_suffix}"
+RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}"
+
+RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \
+ "
+RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-access-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-time-${libpam_suffix} \
+ coreutils"
+
+# FIXME: Native suffix breaks here, disable it for now
+RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}"
+RRECOMMENDS_${PN}_class-native = ""
+
+python populate_packages_prepend () {
+ def pam_plugin_append_file(pn, dir, file):
+ nf = os.path.join(dir, file)
+ of = d.getVar('FILES_' + pn)
+ if of:
+ nf = of + " " + nf
+ d.setVar('FILES_' + pn, nf)
+
+ def pam_plugin_hook(file, pkg, pattern, format, basename):
+ pn = d.getVar('PN')
+ libpam_suffix = d.getVar('libpam_suffix')
+
+ rdeps = d.getVar('RDEPENDS_' + pkg)
+ if rdeps:
+ rdeps = rdeps + " " + pn + "-" + libpam_suffix
+ else:
+ rdeps = pn + "-" + libpam_suffix
+ d.setVar('RDEPENDS_' + pkg, rdeps)
+
+ provides = d.getVar('RPROVIDES_' + pkg)
+ if provides:
+ provides = provides + " " + pkg + "-" + libpam_suffix
+ else:
+ provides = pkg + "-" + libpam_suffix
+ d.setVar('RPROVIDES_' + pkg, provides)
+
+ mlprefix = d.getVar('MLPREFIX') or ''
+ dvar = d.expand('${WORKDIR}/package')
+ pam_libdir = d.expand('${base_libdir}/security')
+ pam_sbindir = d.expand('${sbindir}')
+ pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
+ pam_pkgname = mlprefix + 'pam-plugin%s'
+
+ do_split_packages(d, pam_libdir, '^pam(.*)\.so$', pam_pkgname,
+ 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='')
+ pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd')
+ pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update')
+ pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally')
+ pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2')
+ pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check')
+ pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper')
+ pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply')
+ do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
+}
+
+do_install() {
+ autotools_do_install
+
+ # don't install /var/run when populating rootfs. Do it through volatile
+ rm -rf ${D}${localstatedir}
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles
+
+ install -d ${D}${sysconfdir}/pam.d/
+ install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+
+ # The lsb requires unix_chkpwd has setuid permission
+ chmod 4755 ${D}${sbindir}/unix_chkpwd
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
+ fi
+}
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "pam"
+
+BBCLASSEXTEND = "nativesdk native"
+
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account"
+CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf"
diff --git a/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch b/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
new file mode 100644
index 000000000..b0376cefc
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
@@ -0,0 +1,29 @@
+From d78dd087c4ec4715aab5fe115668e726046ecd76 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:16:05 -0700
+Subject: [PATCH] Include fcntl.h in /platform_defs.h
+
+exposed when compiling using musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libparted/fs/xfs/platform_defs.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h
+index 2b55752..32bd3d3 100644
+--- a/libparted/fs/xfs/platform_defs.h
++++ b/libparted/fs/xfs/platform_defs.h
+@@ -42,6 +42,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch b/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch
new file mode 100644
index 000000000..428b14ed5
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch
@@ -0,0 +1,44 @@
+From 6e82af54714392dcdf74a8aedaae7de7d0af1080 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 27 Apr 2017 16:37:24 +0300
+Subject: [PATCH] Move python helper scripts (used only in tests) to Python 3
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tests/gpt-header-move | 2 +-
+ tests/msdos-overlap | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/gpt-header-move b/tests/gpt-header-move
+index 05cdc65..3cbcb7e 100755
+--- a/tests/gpt-header-move
++++ b/tests/gpt-header-move
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+
+ # open img file, subtract 33 from altlba address, and move the last 33 sectors
+ # back by 33 sectors
+diff --git a/tests/msdos-overlap b/tests/msdos-overlap
+index 5bddfb0..3de7d2e 100755
+--- a/tests/msdos-overlap
++++ b/tests/msdos-overlap
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+ """
+ Write an overlapping partition to a msdos disk
+
+@@ -14,7 +14,7 @@ BAD_ENTRY = (0x72, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ OFFSET = 0x1b8
+
+ if len(sys.argv) < 2:
+- print "%s: <image or device>"
++ print("%s: <image or device>")
+ sys.exit(1)
+
+ data = "".join(chr(c) for c in BAD_ENTRY)
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch b/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch
new file mode 100644
index 000000000..e522e1c6e
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch
@@ -0,0 +1,224 @@
+From d6e15a60e84c1511523aa81272b7db7a6ec441d0 Mon Sep 17 00:00:00 2001
+From: Ovidiu Panait <ovidiu.panait@windriver.com>
+Date: Tue, 26 Sep 2017 08:04:58 +0000
+Subject: [PATCH] libparted: Use read only when probing devices on linux
+ (#1245144)
+
+When a device is opened for RW closing it can trigger other actions,
+like udev scanning it for partition changes. Use read only for the
+init_* methods and RW for actual changes to the device.
+
+This adds _device_open which takes mode flags as an argument and turns
+linux_open into a wrapper for it with RW_MODE.
+
+_device_open_ro is added to open the device with RD_MODE and increment
+the open_counter. This is used in the init_* functions.
+
+_device_close is a wrapper around linux_close that decrements the
+open_counter and is used in the init_* functions.
+
+All of these changes are self-contained with no external API changes.
+The only visible change in behavior is that when a new PedDevice is
+created the device is opened in RO_MODE instead of RW_MODE.
+
+Resolves: rhbz#1245144
+
+Upstream-Status: Backport
+
+Author: Brian C. Lane <bcl@redhat.com>
+Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
+---
+ libparted/arch/linux.c | 62 +++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 44 insertions(+), 18 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index f612617..0a06a54 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -294,7 +294,9 @@ struct blkdev_ioctl_param {
+ static char* _device_get_part_path (PedDevice const *dev, int num);
+ static int _partition_is_mounted_by_path (const char* path);
+ static unsigned int _device_get_partition_range(PedDevice const* dev);
+-
++static int _device_open (PedDevice* dev, int flags);
++static int _device_open_ro (PedDevice* dev);
++static int _device_close (PedDevice* dev);
+
+ static int
+ _read_fd (int fd, char **buf)
+@@ -913,7 +915,7 @@ init_ide (PedDevice* dev)
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+- if (!ped_device_open (dev))
++ if (!_device_open_ro (dev))
+ goto error;
+
+ if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) {
+@@ -982,11 +984,11 @@ init_ide (PedDevice* dev)
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+
+- ped_device_close (dev);
++ _device_close (dev);
+ return 1;
+
+ error_close_dev:
+- ped_device_close (dev);
++ _device_close (dev);
+ error:
+ return 0;
+ }
+@@ -1119,7 +1121,7 @@ init_scsi (PedDevice* dev)
+ char* vendor;
+ char* product;
+
+- if (!ped_device_open (dev))
++ if (!_device_open_ro (dev))
+ goto error;
+
+ if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) {
+@@ -1133,7 +1135,7 @@ init_scsi (PedDevice* dev)
+ goto error_close_dev;
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+- ped_device_close (dev);
++ _device_close (dev);
+ return 1;
+ }
+
+@@ -1155,11 +1157,11 @@ init_scsi (PedDevice* dev)
+ if (!_device_probe_geometry (dev))
+ goto error_close_dev;
+
+- ped_device_close (dev);
++ _device_close (dev);
+ return 1;
+
+ error_close_dev:
+- ped_device_close (dev);
++ _device_close (dev);
+ error:
+ return 0;
+ }
+@@ -1171,7 +1173,7 @@ init_file (PedDevice* dev)
+
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+- if (!ped_device_open (dev))
++ if (!_device_open_ro (dev))
+ goto error;
+
+ dev->sector_size = PED_SECTOR_SIZE_DEFAULT;
+@@ -1198,7 +1200,7 @@ init_file (PedDevice* dev)
+ goto error_close_dev;
+ }
+
+- ped_device_close (dev);
++ _device_close (dev);
+
+ dev->bios_geom.cylinders = dev->length / 4 / 32;
+ dev->bios_geom.heads = 4;
+@@ -1209,7 +1211,7 @@ init_file (PedDevice* dev)
+ return 1;
+
+ error_close_dev:
+- ped_device_close (dev);
++ _device_close (dev);
+ error:
+ return 0;
+ }
+@@ -1225,7 +1227,7 @@ init_dasd (PedDevice* dev, const char* model_name)
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+- if (!ped_device_open (dev))
++ if (!_device_open_ro (dev))
+ goto error;
+
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+@@ -1265,11 +1267,11 @@ init_dasd (PedDevice* dev, const char* model_name)
+
+ dev->model = strdup (model_name);
+
+- ped_device_close (dev);
++ _device_close (dev);
+ return 1;
+
+ error_close_dev:
+- ped_device_close (dev);
++ _device_close (dev);
+ error:
+ return 0;
+ }
+@@ -1284,7 +1286,7 @@ init_generic (PedDevice* dev, const char* model_name)
+ if (!_device_stat (dev, &dev_stat))
+ goto error;
+
+- if (!ped_device_open (dev))
++ if (!_device_open_ro (dev))
+ goto error;
+
+ ped_exception_fetch_all ();
+@@ -1332,11 +1334,11 @@ init_generic (PedDevice* dev, const char* model_name)
+
+ dev->model = strdup (model_name);
+
+- ped_device_close (dev);
++ _device_close (dev);
+ return 1;
+
+ error_close_dev:
+- ped_device_close (dev);
++ _device_close (dev);
+ error:
+ return 0;
+ }
+@@ -1623,12 +1625,27 @@ retry:
+ }
+
+ static int
++_device_open_ro (PedDevice* dev)
++{
++ int rc = _device_open (dev, RD_MODE);
++ if (rc)
++ dev->open_count++;
++ return rc;
++}
++
++static int
+ linux_open (PedDevice* dev)
+ {
++ return _device_open (dev, RW_MODE);
++}
++
++static int
++_device_open (PedDevice* dev, int flags)
++{
+ LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
+
+ retry:
+- arch_specific->fd = open (dev->path, RW_MODE);
++ arch_specific->fd = open (dev->path, flags);
+
+ if (arch_specific->fd == -1) {
+ char* rw_error_msg = strerror (errno);
+@@ -1697,6 +1714,15 @@ linux_refresh_close (PedDevice* dev)
+ return 1;
+ }
+
++static int
++_device_close (PedDevice* dev)
++{
++ int rc = linux_close (dev);
++ if (dev->open_count > 0)
++ dev->open_count--;
++ return rc;
++}
++
+ #if SIZEOF_OFF_T < 8
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch b/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch
new file mode 100644
index 000000000..bd2b5c55b
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch
@@ -0,0 +1,34 @@
+From 5c99d7e4c2b5e7a957dc922aff03debfebbd6154 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 3 Mar 2017 21:49:15 +0100
+Subject: [PATCH] libparted_fs_resize: link against libuuid explicitly to
+ unbreak gold linking on test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../libparted/fs/.libs/libparted-fs-resize.so: error: undefined reference to 'uuid_generate'
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ libparted/fs/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am
+index d3cc8bc..c301b0b 100644
+--- a/libparted/fs/Makefile.am
++++ b/libparted/fs/Makefile.am
+@@ -113,6 +113,8 @@ libparted_fs_resize_la_SOURCES = \
+ r/hfs/reloc_plus.c \
+ r/hfs/reloc_plus.h
+
++libparted_fs_resize_la_LIBADD = $(UUID_LIBS)
++
+ AM_CPPFLAGS = \
+ -I$(top_srcdir)/libparted/labels \
+ $(partedincludedir) \
+--
+2.9.3
+
diff --git a/poky/meta/recipes-extended/parted/files/Makefile b/poky/meta/recipes-extended/parted/files/Makefile
new file mode 100644
index 000000000..ee90be081
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/Makefile
@@ -0,0 +1,285 @@
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+
+am__tty_colors = \
+$(am__tty_colors_dummy); \
+test "X$(AM_COLOR_TESTS)" != Xno \
+&& test "X$$TERM" != Xdumb \
+&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
+&& { \
+ am__color_tests=yes; \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+}
+
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__rst_section = { sed 'p;s/./=/g;' && echo; }
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \
+test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER)
+
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+
+MKDIR_P = /bin/mkdir -p
+SHELL = /bin/bash
+VERSION = 3.1
+PACKAGE_STRING = GNU parted 3.1
+PACKAGE_BUGREPORT = bug-parted@gnu.org
+abs_srcdir = $(PWD)
+abs_top_builddir = $(PWD)/..
+abs_top_srcdir = $(PWD)/..
+srcdir = .
+top_srcdir = ..
+subdir = tests
+SH_LOG_COMPILER = $(SHELL)
+
+TESTS = \
+ help-version.sh \
+ t0000-basic.sh \
+ t0001-tiny.sh \
+ t0010-script-no-ctrl-chars.sh \
+ t0100-print.sh \
+ t0101-print-empty.sh \
+ t0200-gpt.sh \
+ t0201-gpt.sh \
+ t0202-gpt-pmbr.sh \
+ t0203-gpt-tiny-device-abort.sh \
+ t0203-gpt-shortened-device-primary-valid.sh \
+ t0205-gpt-list-clobbers-pmbr.sh \
+ t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \
+ t0207-IEC-binary-notation.sh \
+ t0208-mkpart-end-in-IEC.sh \
+ t0209-gpt-pmbr_boot.sh \
+ t0210-gpt-resized-partition-entry-array.sh \
+ t0211-gpt-rewrite-header.sh \
+ t0212-gpt-many-partitions.sh \
+ t0220-gpt-msftres.sh \
+ t0250-gpt.sh \
+ t0280-gpt-corrupt.sh \
+ t0300-dos-on-gpt.sh \
+ t0400-loop-clobber-infloop.sh \
+ t0500-dup-clobber.sh \
+ t0501-duplicate.sh \
+ t1100-busy-label.sh \
+ t1101-busy-partition.sh \
+ t1700-probe-fs.sh \
+ t2200-dos-label-recog.sh \
+ t2201-pc98-label-recog.sh \
+ t2300-dos-label-extended-bootcode.sh \
+ t2310-dos-extended-2-sector-min-offset.sh \
+ t2400-dos-hfs-partition-type.sh \
+ t2500-probe-corrupt-hfs.sh \
+ t3000-resize-fs.sh \
+ t3200-type-change.sh \
+ t3300-palo-prep.sh \
+ t3310-flags.sh \
+ t3400-whole-disk-FAT-partition.sh \
+ t4000-sun-raid-type.sh \
+ t4001-sun-vtoc.sh \
+ t4100-msdos-partition-limits.sh \
+ t4100-dvh-partition-limits.sh \
+ t4100-msdos-starting-sector.sh \
+ t4200-partprobe.sh \
+ t4300-nilfs2-tiny.sh \
+ t5000-tags.sh \
+ t6000-dm.sh \
+ t6001-psep.sh \
+ t6100-mdraid-partitions.sh \
+ t7000-scripting.sh \
+ t8000-loop.sh \
+ t8001-loop-blkpg.sh \
+ t9010-big-sector.sh \
+ t9020-alignment.sh \
+ t9021-maxima.sh \
+ t9022-one-unit-snap.sh \
+ t9023-value-lt-one.sh \
+ t9030-align-check.sh \
+ t9040-many-partitions.sh \
+ t9041-undetected-in-use-16th-partition.sh \
+ t9042-dos-partition-limit.sh \
+ t9050-partition-table-types.sh
+
+TESTS_ENVIRONMENT = \
+ export \
+ abs_top_builddir='$(abs_top_builddir)' \
+ abs_top_srcdir='$(abs_top_srcdir)' \
+ abs_srcdir='$(abs_srcdir)' \
+ built_programs=parted \
+ srcdir='$(srcdir)' \
+ top_srcdir='$(top_srcdir)' \
+ VERSION=$(VERSION) \
+ ; 9>&2
+
+.SUFFIXES: .log
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for i in $$bases; do \
+ if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \
+ >/dev/null; then continue; \
+ fi; \
+ glob_res=`sed -n -e "s/$$ws*$$//" \
+ -e "s/^$$ws*:global-test-result:$$ws*//p" \
+ $$i.trs`; \
+ test -n "$$glob_res" || glob_res=RUN; \
+ echo "$$glob_res: $$i" | $(am__rst_section); \
+ if test ! -r $$i.log; then \
+ echo "fatal: making $@: $$i.log is unreadable" >&2; \
+ exit 1; \
+ fi; \
+ cat $$i.log; echo; \
+ done; \
+ } >$(TEST_SUITE_LOG).tmp; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @if test $@ != recheck; then \
+ list='$(RECHECK_LOGS)'; \
+ test -z "$$list" || rm -f $$list; \
+ fi
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @ws='[ ]'; \
+ log_list='' trs_list=''; $(am__set_TESTS_bases); \
+ for i in $$bases; do \
+ if test -z "$$log_list"; then \
+ log_list="$$i.log"; \
+ else \
+ log_list="$$log_list $$i.log"; \
+ fi; \
+ if test -z "$$trs_list"; then \
+ trs_list="$$i.trs"; \
+ else \
+ trs_list="$$trs_list $$i.trs"; \
+ fi; \
+ done; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"
+
+.sh.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) -- $(SH_LOG_COMPILE) "$$tst"
diff --git a/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
new file mode 100644
index 000000000..68ab715f3
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
@@ -0,0 +1,57 @@
+From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 13 Nov 2014 11:29:33 +0800
+Subject: [PATCH] libparted/arch/linux.c: fix compile failure while
+ --disable-device-mapper
+
+While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is
+undef, but it missed to scope some device mapper functions.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libparted/arch/linux.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 6fd73c5..2afa479 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...)
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
++#ifdef ENABLE_DEVICE_MAPPER
+ LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev);
+
+ /* Get map name from devicemapper */
+@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev)
+ dm_task_destroy (task);
+ return dev_name;
+ err:
++#endif
+ return NULL;
+ }
+
+@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk)
+ unsigned long long *start,
+ unsigned long long *length);
+
+-
++#ifdef ENABLE_DEVICE_MAPPER
+ if (disk->dev->type == PED_DEVICE_DM) {
+ add_partition = _dm_add_partition;
+ remove_partition = _dm_remove_partition;
+ resize_partition = _dm_resize_partition;
+ get_partition_start_and_length = _dm_get_partition_start_and_length;
+- } else {
++ } else
++#endif
++ {
+ add_partition = _blkpg_add_partition;
+ remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch b/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch
new file mode 100644
index 000000000..0711d4e29
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Submitted [bug-parted@gnu.org]
+
+| for po in `ls -1 ./*.pt_BR.po 2>/dev/null`; do \
+| make $(basename ${po%.pt_BR.po}); \
+| done
+| Makefile:904: *** Recursive variable `mandir' references itself (eventually). Stop.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+--- parted-3.1/doc/po4a.mk.orig 2012-03-15 14:09:11.555831872 +0100
++++ parted-3.1/doc/po4a.mk 2012-03-15 14:10:44.243830985 +0100
+@@ -23,7 +23,7 @@
+ # threshold is 80%), it won't be distributed, and the build won't fail.
+ #
+
+-mandir = $(mandir)/$(lang)
++mandir := $(mandir)/$(lang)
+
+ # Inform automake that we want to install some man pages in section 1, 5
+ # and 8.
diff --git a/poky/meta/recipes-extended/parted/files/no_check.patch b/poky/meta/recipes-extended/parted/files/no_check.patch
new file mode 100644
index 000000000..e6a26d11a
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/no_check.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+If check is detected, it makes the builds non-determinstic so just force
+it to be disabled.
+
+RP - 4/11/08
+
+Index: parted-3.2/configure.ac
+===================================================================
+--- parted-3.2.orig/configure.ac
++++ parted-3.2/configure.ac
+@@ -555,7 +555,7 @@ AC_CHECK_HEADER([execinfo.h], [
+ AM_CONDITIONAL([COMPILE_FOR_S390], [test "$host_cpu" = s390 || test "$host_cpu" = s390x])
+
+ dnl check for "check", unit testing library/header
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
++have_check=no
+ if test "$have_check" != "yes"; then
+ AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
+ fi
diff --git a/poky/meta/recipes-extended/parted/files/run-ptest b/poky/meta/recipes-extended/parted/files/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/poky/meta/recipes-extended/parted/files/syscalls.patch b/poky/meta/recipes-extended/parted/files/syscalls.patch
new file mode 100644
index 000000000..93205a0a8
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/files/syscalls.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Pending
+
+---
+ libparted/arch/linux.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+Index: parted-3.2/libparted/arch/linux.c
+===================================================================
+--- parted-3.2.orig/libparted/arch/linux.c
++++ parted-3.2/libparted/arch/linux.c
+@@ -17,6 +17,8 @@
+
+ #define PROC_DEVICES_BUFSIZ 16384
+
++#include <linux/version.h>
++
+ #include <config.h>
+ #include <arch/linux.h>
+ #include <linux/blkpg.h>
+@@ -1696,12 +1698,14 @@ linux_refresh_close (PedDevice* dev)
+
+ #if SIZEOF_OFF_T < 8
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ static _syscall5(int,_llseek,
+ unsigned int, fd,
+ unsigned long, offset_high,
+ unsigned long, offset_low,
+ loff_t*, result,
+ unsigned int, origin)
++#endif
+
+ loff_t
+ llseek (unsigned int fd, loff_t offset, unsigned int whence)
+@@ -1709,11 +1713,20 @@ llseek (unsigned int fd, loff_t offset,
+ loff_t result;
+ int retval;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ retval = _llseek(fd,
+ ((unsigned long long)offset) >> 32,
+ ((unsigned long long)offset) & 0xffffffff,
+ &result,
+ whence);
++#else
++ retval = syscall(__NR__llseek, fd,
++ ((unsigned long long)offset) >> 32,
++ ((unsigned long long)offset) & 0xffffffff,
++ &result,
++ whence);
++#endif
++
+ return (retval==-1 ? (loff_t) retval : result);
+ }
+
diff --git a/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch b/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch
new file mode 100644
index 000000000..211e6c734
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/parted/parted-3.2-sysmacros.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/580022
+
+From dec8995fe80508374beba6356f6ecbba8ef6b18b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 21 Jun 2016 15:01:08 -0400
+Subject: [PATCH] include sysmacros.h for major/minor/makedev
+
+Linux C libs are moving away from including this header implicitly via
+sys/types.h, so include it explicitly.
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ libparted/arch/linux.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 326b95619d31..e5c168be3c68 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -37,6 +37,7 @@
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <sys/utsname.h> /* for uname() */
+ #include <scsi/scsi.h>
+--
+2.8.2
+
diff --git a/poky/meta/recipes-extended/parted/parted_3.2.bb b/poky/meta/recipes-extended/parted/parted_3.2.bb
new file mode 100644
index 000000000..ab30108bf
--- /dev/null
+++ b/poky/meta/recipes-extended/parted/parted_3.2.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Disk partition editing/resizing utility"
+HOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
+SECTION = "console/tools"
+DEPENDS = "ncurses readline util-linux virtual/libiconv"
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
+ file://no_check.patch \
+ file://syscalls.patch \
+ file://fix-doc-mandir.patch \
+ file://fix-compile-failure-while-dis.patch \
+ file://0001-Include-fcntl.h-in-platform_defs.h.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch \
+ file://0001-Move-python-helper-scripts-used-only-in-tests-to-Pyt.patch \
+ file://parted-3.2-sysmacros.patch \
+ file://run-ptest \
+ file://Makefile \
+ file://0001-libparted-Use-read-only-when-probing-devices-on-linu.patch \
+"
+
+SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb"
+SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
+
+EXTRA_OECONF = "--disable-device-mapper"
+
+inherit autotools pkgconfig gettext texinfo ptest
+
+BBCLASSEXTEND = "native"
+
+do_compile_ptest() {
+ oe_runmake -C tests print-align print-max dup-clobber duplicate fs-resize
+}
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ mkdir $t/build-aux
+ cp ${S}/build-aux/test-driver $t/build-aux/
+ cp -r ${S}/tests $t
+ cp ${WORKDIR}/Makefile $t/tests/
+ sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile
+ for i in print-align print-max dup-clobber duplicate fs-resize; \
+ do cp ${B}/tests/.libs/$i $t/tests/; \
+ done
+ sed -e 's| ../parted||' -i $t/tests/*.sh
+}
+
+RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python3"
diff --git a/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb
new file mode 100644
index 000000000..06d37adc3
--- /dev/null
+++ b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb
@@ -0,0 +1,28 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=398b8832c6f840cfebd20ab2be6a3743"
+
+DEPENDS = "bzip2"
+DEPENDS_append_class-native = " bzip2-replacement-native"
+
+SRC_URI = "https://launchpad.net/${BPN}/1.1/${PV}/+download/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "4cb87da2dba05540afce162f34b3a9a6"
+SRC_URI[sha256sum] = "8fd13eaaa266f7ee91f85c1ea97c86d9c9cc985969db9059cdebcb1e1b7bdbe6"
+
+UPSTREAM_CHECK_URI = "http://compression.ca/pbzip2/"
+
+EXTRA_OEMAKE = "CXX='${CXX} ${CXXFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 pbzip2 ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
new file mode 100644
index 000000000..644d8208e
--- /dev/null
+++ b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Convert::ASN1 - Perl ASN.1 Encode/Decode library"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README.md;beginline=91;endline=97;md5=ceff7fd286eb6d8e8e0d3d23e096a63f"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Convert-ASN1-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "68723e96be0b258a9e20480276e8a62c"
+SRC_URI[sha256sum] = "74a4a78ae0c5e973100ac0a8f203a110f76fb047b79dae4fc1fd7d6814d3d58a"
+
+S = "${WORKDIR}/Convert-ASN1-${PV}"
+
+inherit cpan ptest-perl
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb b/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
new file mode 100644
index 000000000..8e1461ceb
--- /dev/null
+++ b/poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Perl modules useful for manipulating date and time information"
+HOMEPAGE = "https://metacpan.org/release/TimeDate"
+SECTION = "libs"
+# You can redistribute it and/or modify it under the same terms as Perl itself.
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=21;md5=576b7cb41e5e821501a01ed66f0f9d9e"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/TimeDate-${PV}.tar.gz"
+
+S = "${WORKDIR}/TimeDate-${PV}"
+
+inherit cpan ptest-perl
+
+BBCLASSEXTEND = "native"
+
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN} += "perl-module-carp perl-module-exporter perl-module-strict perl-module-time-local"
+
+SRC_URI[md5sum] = "b1d91153ac971347aee84292ed886c1c"
+SRC_URI[sha256sum] = "75bd254871cb5853a6aa0403ac0be270cdd75c9d1b6639f18ecba63c15298e86"
diff --git a/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb b/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb
new file mode 100644
index 000000000..fa9f9954b
--- /dev/null
+++ b/poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.12.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Perl module for supporting simple generic namespaces"
+HOMEPAGE = "http://veillard.com/XML/"
+DESCRIPTION = "XML::NamespaceSupport offers a simple way to process namespace-based XML names. \
+ It also helps maintain a prefix-to-namespace URI map, and provides a number of \
+ basic checks. "
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+SRCNAME = "XML-NamespaceSupport"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c9d8a117e7620b5adf8d69c29613ceab"
+
+SRC_URI = "${CPAN_MIRROR}/authors/id/P/PE/PERIGRIN/${SRCNAME}-${PV}.tar.gz"
+SRC_URI[md5sum] = "a8916c6d095bcf073e1108af02e78c97"
+SRC_URI[sha256sum] = "47e995859f8dd0413aa3f22d350c4a62da652e854267aa0586ae544ae2bae5ef"
+
+UPSTREAM_CHECK_REGEX = "XML\-NamespaceSupport\-(?P<pver>(\d+\.\d+))(?!_\d+).tar"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit cpan ptest-perl
+
+RDEPENDS_${PN}-ptest += "perl-module-test-more"
+
+BBCLASSEXTEND="native"
+
diff --git a/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb b/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb
new file mode 100644
index 000000000..b3e01e9ac
--- /dev/null
+++ b/poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.09.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Base class SAX Drivers and Filters"
+HOMEPAGE = "http://search.cpan.org/dist/XML-SAX-Base/"
+DESCRIPTION = "This module has a very simple task - to be a base class for \
+PerlSAX drivers and filters. It's default behaviour is to pass \
+the input directly to the output unchanged. It can be useful to \
+use this module as a base class so you don't have to, for example, \
+implement the characters() callback."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+RDEPENDS_${PN} += "perl-module-extutils-makemaker"
+
+LIC_FILES_CHKSUM = "file://dist.ini;endline=5;md5=8f9c9a55340aefaee6e9704c88466446"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-Base-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "ec347a14065dd7aec7d9fb181b2d7946"
+SRC_URI[sha256sum] = "66cb355ba4ef47c10ca738bd35999723644386ac853abbeb5132841f5e8a2ad0"
+
+S = "${WORKDIR}/XML-SAX-Base-${PV}"
+
+inherit cpan ptest-perl
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb b/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
new file mode 100644
index 000000000..cdcbebffc
--- /dev/null
+++ b/poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Perl module for using and building Perl SAX2 XML processors"
+HOMEPAGE = "http://search.cpan.org/dist/XML-SAX/"
+DESCRIPTION = "XML::SAX consists of several framework classes for using and \
+building Perl SAX2 XML parsers, filters, and drivers. It is designed \
+around the need to be able to "plug in" different SAX parsers to an \
+application without requiring programmer intervention. Those of you \
+familiar with the DBI will be right at home. Some of the designs \
+come from the Java JAXP specification (SAX part), only without the \
+javaness."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+DEPENDS += "libxml-namespacesupport-perl-native"
+RDEPENDS_${PN} += "libxml-namespacesupport-perl libxml-sax-base-perl perl-module-file-temp"
+PR = "r2"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=65c4cd8f39c24c7135ed70dacbcb09e3"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "290f5375ae87fdebfdb5bc3854019f24"
+SRC_URI[sha256sum] = "32b04b8e36b6cc4cfc486de2d859d87af5386dd930f2383c49347050d6f5ad84"
+
+S = "${WORKDIR}/XML-SAX-${PV}"
+
+inherit cpan ptest-perl
+
+do_install_ptest() {
+ cp -r ${B}/testfiles ${D}${PTEST_PATH}
+ chown -R root:root ${D}${PTEST_PATH}/testfiles
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/pigz/pigz_2.4.bb b/poky/meta/recipes-extended/pigz/pigz_2.4.bb
new file mode 100644
index 000000000..6e6da9c3c
--- /dev/null
+++ b/poky/meta/recipes-extended/pigz/pigz_2.4.bb
@@ -0,0 +1,30 @@
+SUMMARY = "A parallel implementation of gzip"
+DESCRIPTION = "pigz, which stands for parallel implementation of gzip, is a \
+fully functional replacement for gzip that exploits multiple processors and \
+multiple cores to the hilt when compressing data. pigz was written by Mark \
+Adler, and uses the zlib and pthread libraries."
+HOMEPAGE = "http://zlib.net/pigz/"
+SECTION = "console/utils"
+LICENSE = "Zlib & Apache-2.0"
+LIC_FILES_CHKSUM = "file://pigz.c;md5=9ae6dee8ceba9610596ed0ada493d142;beginline=7;endline=21"
+
+SRC_URI = "http://zlib.net/${BPN}/fossils/${BP}.tar.gz"
+SRC_URI[md5sum] = "def2f6e19d9d8231445adc1349d346df"
+SRC_URI[sha256sum] = "a4f816222a7b4269bd232680590b579ccc72591f1bb5adafcd7208ca77e14f73"
+# Point this at the homepage in case /fossils/ isn't updated
+UPSTREAM_CHECK_URI = "http://zlib.net/${BPN}/"
+UPSTREAM_CHECK_REGEX = "pigz-(?P<pver>.*)\.tar"
+
+DEPENDS = "zlib"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ # Install files into /bin (FHS), which is typical place for gzip
+ install -d ${D}${base_bindir}
+ install ${B}/pigz ${D}${base_bindir}/pigz
+ ln -nsf pigz ${D}${base_bindir}/unpigz
+ ln -nsf pigz ${D}${base_bindir}/pigzcat
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch b/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
new file mode 100644
index 000000000..12bae28dc
--- /dev/null
+++ b/poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
@@ -0,0 +1,51 @@
+From c84480be8df6966c538d1fb67ccae2f42cc46421 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 07:36:54 +0000
+Subject: [PATCH 1/2] configure: Detect headers before using them
+
+Current logic does not work when system does not have
+sys/endian.h, since it tried to reuse the cached results
+from first try of detecting htole64 in sys/endian.h which is
+'no' and hence the second try to look into endian.h also
+comes out negative.
+
+So we check for header and then run the test for symbols
+and these symbols are not standard and we need to define _GNU_SOURCE
+for it to work, this issue is exposed by systems using musl e.g.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure.ac | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4cb56bc..5e23c50 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,12 +69,17 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_FUNC_STRTOD
+ AC_CHECK_FUNCS([memchr memmove memset strerror strtol])
+-AC_CHECK_DECLS([htole64, le64toh],
+- [],
++AC_CHECK_HEADER([sys/endian.h],
+ [
+- AC_CHECK_DECLS([htole64, le64toh], [], [], [#include <endian.h>])
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <sys/endian.h>])
+ ],
+- [#include <sys/endian.h>])
++ [], [])
++
++AC_CHECK_HEADER([endian.h],
++ [
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <endian.h>])
++ ],
++ [], [])
+
+ AC_CONFIG_FILES([Makefile
+ src/Makefile
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch b/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch
new file mode 100644
index 000000000..6b615988d
--- /dev/null
+++ b/poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch
@@ -0,0 +1,47 @@
+From 5f3a535987bae4c3e3d9e9079c7526e399f7aecd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 07:42:39 +0000
+Subject: [PATCH 2/2] endian: Use macro bswap_64 instead of __bswap_64
+
+byteswap.h defines then as public APIs on all libc
+on linux including musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+ src/endian.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/endian.c b/src/endian.c
+index b7724f3..51aea58 100644
+--- a/src/endian.c
++++ b/src/endian.c
+@@ -15,6 +15,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ #include <stdint.h>
+ #ifdef __linux__
+ #include <endian.h>
++ #include <byteswap.h>
+ #else
+ #include <sys/endian.h>
+ #endif
+@@ -23,7 +24,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ # if __BYTE_ORDER == __LITTLE_ENDIAN
+ # define htole64(x) (x)
+ # else
+-# define htole64(x) __bswap_64 (x)
++# define htole64(x) bswap_64 (x)
+ # endif
+ #endif
+
+@@ -31,7 +32,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ # if __BYTE_ORDER == __LITTLE_ENDIAN
+ # define le64toh(x) (x)
+ # else
+-# define le64toh(x) __bswap_64 (x)
++# define le64toh(x) bswap_64 (x)
+ # endif
+ #endif
+
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch b/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch
new file mode 100644
index 000000000..e3489db5b
--- /dev/null
+++ b/poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch
@@ -0,0 +1,68 @@
+From 936d8068ae19d95260d3058f41dd6cf718101cd6 Mon Sep 17 00:00:00 2001
+From: Christian Krause <kizkizzbangbang@googlemail.com>
+Date: Sat, 26 Dec 2015 14:36:17 +0100
+Subject: [PATCH] option to not build man page
+
+fixes #56
+---
+ configure.ac | 23 +++++++++++++++++++----
+ src/Makefile.am | 2 ++
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+Upstream-Status: Backport
+RP 2016/01/22
+
+diff --git a/configure.ac b/configure.ac
+index b437e56..4cb56bc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,13 +20,28 @@ AC_CHECK_FILE(
+ [src/pixz.1],
+ [],
+ [
+- AC_CHECK_PROG(A2X, a2x, a2x, [])
+- if test "x$A2X" = x ; then
+- AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.])
+- fi
++ AC_ARG_WITH(
++ [manpage],
++ [ --without-manpage don't build man page],
++ [case ${withval} in
++ yes) manpage=true ;;
++ no) manpage=false ;;
++ *) AC_MSG_ERROR([bad value ${withval} for --with-manpage]) ;;
++ esac],
++ [manpage=true]
++ )
+ ]
+ )
+
++AM_CONDITIONAL([MANPAGE], [test x$manpage = xtrue])
++
++if test x$manpage = xtrue ; then
++ AC_CHECK_PROG(A2X, a2x, a2x, [])
++ if test "x$A2X" = x ; then
++ AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.])
++ fi
++fi
++
+ # Checks for libraries.
+ AC_CHECK_LIB([m], [ceil])
+ AX_PTHREAD
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 600ec90..b98f450 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -15,6 +15,7 @@ pixz_SOURCES = \
+ read.c \
+ write.c
+
++if MANPAGE
+ # TODO remove when possible: This is a hack because a2x is not able to output the man pages to a
+ # specific directory, only to where the source is.
+ pixz.1: pixz.1.asciidoc
+@@ -26,3 +27,4 @@ man_MANS = pixz.1
+ CLEANFILES = pixz.1
+
+ EXTRA_DIST = $(man_MANS) pixz.1.asciidoc
++endif
diff --git a/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb b/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
new file mode 100644
index 000000000..303258658
--- /dev/null
+++ b/poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Parallel, indexed xz compressor"
+
+DEPENDS = "xz libarchive"
+
+SRC_URI = "https://github.com/vasi/pixz/releases/download/v${PV}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "f6dc5909c9a31b192f69aa397ae8df48"
+SRC_URI[sha256sum] = "02c50746b134fa1b1aae41fcc314d7c6f1919b3d48bcdea01bf11769f83f72e8"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5cf6d164086105f1512ccb81bfff1926"
+
+SRC_URI += "file://936d8068ae19d95260d3058f41dd6cf718101cd6.patch \
+ file://0001-configure-Detect-headers-before-using-them.patch \
+ file://0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch \
+"
+UPSTREAM_CHECK_URI = "https://github.com/vasi/pixz/releases"
+
+PACKAGECONFIG[manpages] = "--with-manpage, --without-manpage, asciidoc-native"
+
+CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
+CACHED_CONFIGUREVARS += "ac_cv_file_src_pixz_1=no"
+
+inherit autotools pkgconfig manpages
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/procps/procps/sysctl.conf b/poky/meta/recipes-extended/procps/procps/sysctl.conf
new file mode 100644
index 000000000..34e7488bf
--- /dev/null
+++ b/poky/meta/recipes-extended/procps/procps/sysctl.conf
@@ -0,0 +1,64 @@
+# This configuration file is taken from Debian.
+#
+# /etc/sysctl.conf - Configuration file for setting system variables
+# See sysctl.conf (5) for information.
+#
+
+#kernel.domainname = example.com
+
+# Uncomment the following to stop low-level messages on console
+#kernel.printk = 4 4 1 7
+
+##############################################################3
+# Functions previously found in netbase
+#
+
+# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
+# Turn on Source Address Verification in all interfaces to
+# prevent some spoofing attacks
+net.ipv4.conf.default.rp_filter=1
+net.ipv4.conf.all.rp_filter=1
+
+# Uncomment the next line to enable TCP/IP SYN cookies
+#net.ipv4.tcp_syncookies=1
+
+# Uncomment the next line to enable packet forwarding for IPv4
+#net.ipv4.ip_forward=1
+
+# Uncomment the next line to enable packet forwarding for IPv6
+#net.ipv6.conf.all.forwarding=1
+
+
+###################################################################
+# Additional settings - these settings can improve the network
+# security of the host and prevent against some network attacks
+# including spoofing attacks and man in the middle attacks through
+# redirection. Some network environments, however, require that these
+# settings are disabled so review and enable them as needed.
+#
+# Ignore ICMP broadcasts
+#net.ipv4.icmp_echo_ignore_broadcasts = 1
+#
+# Ignore bogus ICMP errors
+#net.ipv4.icmp_ignore_bogus_error_responses = 1
+#
+# Do not accept ICMP redirects (prevent MITM attacks)
+#net.ipv4.conf.all.accept_redirects = 0
+#net.ipv6.conf.all.accept_redirects = 0
+# _or_
+# Accept ICMP redirects only for gateways listed in our default
+# gateway list (enabled by default)
+# net.ipv4.conf.all.secure_redirects = 1
+#
+# Do not send ICMP redirects (we are not a router)
+#net.ipv4.conf.all.send_redirects = 0
+#
+# Do not accept IP source route packets (we are not a router)
+#net.ipv4.conf.all.accept_source_route = 0
+#net.ipv6.conf.all.accept_source_route = 0
+#
+# Log Martian Packets
+#net.ipv4.conf.all.log_martians = 1
+#
+
+#kernel.shmmax = 141762560
diff --git a/poky/meta/recipes-extended/procps/procps_3.3.12.bb b/poky/meta/recipes-extended/procps/procps_3.3.12.bb
new file mode 100644
index 000000000..ecf215fec
--- /dev/null
+++ b/poky/meta/recipes-extended/procps/procps_3.3.12.bb
@@ -0,0 +1,65 @@
+SUMMARY = "System and process monitoring utilities"
+DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \
+the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill."
+HOMEPAGE = "https://gitlab.com/procps-ng/procps"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \
+ "
+
+DEPENDS = "ncurses"
+
+inherit autotools gettext pkgconfig update-alternatives
+
+SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \
+ file://sysctl.conf \
+ "
+
+SRC_URI[md5sum] = "957e42e8b193490b2111252e4a2b443c"
+SRC_URI[sha256sum] = "6ed65ab86318f37904e8f9014415a098bec5bc53653e5d9ab404f95ca5e1a7d4"
+
+S = "${WORKDIR}/procps-ng-${PV}"
+
+EXTRA_OECONF = "--enable-skill --disable-modern-top"
+
+do_install_append () {
+ install -d ${D}${base_bindir}
+ [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
+ install -d ${D}${base_sbindir}
+ [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ rmdir ${D}${sbindir}
+ fi
+
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${sysconfdir}/sysctl.d
+ ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
+ fi
+}
+
+CONFFILES_${PN} = "${sysconfdir}/sysctl.conf"
+
+bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime w"
+base_bindir_progs += "kill pidof ps watch"
+base_sbindir_progs += "sysctl"
+
+ALTERNATIVE_PRIORITY = "200"
+ALTERNATIVE_PRIORITY[pidof] = "150"
+
+ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
+
+ALTERNATIVE_${PN}-doc = "kill.1 uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+
+python __anonymous() {
+ for prog in d.getVar('base_bindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
+
+ for prog in d.getVar('base_sbindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog))
+}
+
diff --git a/poky/meta/recipes-extended/psmisc/psmisc.inc b/poky/meta/recipes-extended/psmisc/psmisc.inc
new file mode 100644
index 000000000..82ef94770
--- /dev/null
+++ b/poky/meta/recipes-extended/psmisc/psmisc.inc
@@ -0,0 +1,57 @@
+SUMMARY = "Utilities for managing processes on your system"
+HOMEPAGE = "http://psmisc.sf.net/"
+DESCRIPTION = "The psmisc package contains utilities for managing processes on your \
+system: pstree, killall and fuser. The pstree command displays a tree \
+structure of all of the running processes on your system. The killall \
+command sends a specified signal (SIGTERM if nothing is specified) to \
+processes identified by name. The fuser command identifies the PIDs \
+of processes that are using specified files or filesystems."
+SECTION = "base"
+DEPENDS = "ncurses virtual/libintl"
+LICENSE = "GPLv2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz"
+
+S = "${WORKDIR}/psmisc-${PV}"
+
+inherit autotools gettext
+
+# Upstream has a custom autogen.sh which invokes po/update-potfiles as they
+# don't ship a po/POTFILES.in (which is silly). Without that file gettext
+# doesn't believe po/ is a gettext directory and won't generate po/Makefile.
+EXTRA_AUTORECONF_remove = "--exclude=autopoint"
+do_configure_prepend() {
+ ( cd ${S} && po/update-potfiles )
+}
+
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc"
+PACKAGES += "psmisc-extras"
+
+FILES_${PN} = ""
+RDEPENDS_${PN} = "fuser killall pstree"
+
+FILES_fuser = "${bindir}/fuser.${BPN}"
+FILES_fuser-doc = "${mandir}/man1/fuser*"
+
+FILES_killall = "${bindir}/killall.${BPN}"
+FILES_killall-doc = "${mandir}/man1/killall*"
+
+FILES_pstree = "${bindir}/pstree"
+FILES_pstree-doc = "${mandir}/man1/pstree*"
+
+FILES_psmisc-extras = "${bindir}"
+FILES_psmisc-extras-doc = "${mandir}"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "90"
+
+ALTERNATIVE_killall = "killall"
+
+ALTERNATIVE_fuser = "fuser"
diff --git a/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch b/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch
new file mode 100644
index 000000000..4d44495fd
--- /dev/null
+++ b/poky/meta/recipes-extended/psmisc/psmisc/0001-Makefile.am-create-src-directory-before-attempting-t.patch
@@ -0,0 +1,30 @@
+From 285877b7761d74736aca2687ed9bef2f78b82c33 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 2 Nov 2017 16:21:22 +0200
+Subject: [PATCH] Makefile.am: create src directory before attempting to write
+ there
+
+Otherwise out of tree builds will fail.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 9f61ab4..b4ced7f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -79,7 +79,7 @@ EXTRA_DIST = src/signames.c README.md
+ CLEANFILES = src/signames.h
+
+ src/signames.h: src/signames.c Makefile
+- export LC_ALL=C ; \
++ export LC_ALL=C ; mkdir -p src ; \
+ @CPP@ -dM $< |\
+ tr -s '\t ' ' ' | sort -n -k 3 | sed \
+ 's:#define SIG\([A-Z][A-Z]*[0-9]*\) \([0-9][0-9]*\).*$\:{\ \2,"\1" },:p;d' | \
+--
+2.14.2
+
diff --git a/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
new file mode 100644
index 000000000..b57a006bc
--- /dev/null
+++ b/poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
@@ -0,0 +1,51 @@
+From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 24 Mar 2016 15:46:14 +0000
+Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE
+
+Do not include sys/user.h since it conflicts with
+pt_regs struct from kernel APIs in asm/ptrace.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/peekfd.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/peekfd.c b/src/peekfd.c
+index cba2130..0d39878 100644
+--- a/src/peekfd.c
++++ b/src/peekfd.c
+@@ -30,8 +30,11 @@
+ #include <asm/ptrace.h>
+ #include <byteswap.h>
+ #include <endian.h>
++#ifdef __GLIBC__
+ #include <sys/user.h>
++#endif
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <getopt.h>
+ #include <ctype.h>
+
+@@ -228,11 +231,11 @@ int main(int argc, char **argv)
+ if (WIFSTOPPED(status)) {
+ #ifdef PPC
+ struct pt_regs regs;
+- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
+- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
+- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
+- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
+- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0);
++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0);
++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0);
++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0);
++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0);
+ #elif defined(ARM)
+ struct pt_regs regs;
+ ptrace(PTRACE_GETREGS, pid, 0, &regs);
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb b/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb
new file mode 100644
index 000000000..2b07f4974
--- /dev/null
+++ b/poky/meta/recipes-extended/psmisc/psmisc_23.0.bb
@@ -0,0 +1,10 @@
+require psmisc.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI = "git://gitlab.com/psmisc/psmisc.git;protocol=https \
+ file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \
+ file://0001-Makefile.am-create-src-directory-before-attempting-t.patch \
+ "
+SRCREV = "67b1da268f4c0ce6859980e3dfcfaec5b2448e80"
+S = "${WORKDIR}/git"
diff --git a/poky/meta/recipes-extended/quota/quota/fcntl.patch b/poky/meta/recipes-extended/quota/quota/fcntl.patch
new file mode 100644
index 000000000..2d3797132
--- /dev/null
+++ b/poky/meta/recipes-extended/quota/quota/fcntl.patch
@@ -0,0 +1,85 @@
+Include fcntl.h to pacify compiler errors on musl
+like
+
+error: unknown type name 'loff_t'
+Cover rpc headers under proper conditional
+Dont use __P its undefined
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ndex: quota-tools/quota.h
+===================================================================
+Index: quota-tools/quota.h
+===================================================================
+--- quota-tools.orig/quota.h
++++ quota-tools/quota.h
+@@ -165,6 +165,6 @@ enum {
+ #endif
+ #endif
+
+-long quotactl __P((int, const char *, qid_t, caddr_t));
++long quotactl (int, const char *, qid_t, caddr_t);
+
+ #endif /* _QUOTA_ */
+Index: quota-tools/quotacheck.c
+===================================================================
+--- quota-tools.orig/quotacheck.c
++++ quota-tools/quotacheck.c
+@@ -19,6 +19,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <errno.h>
++#include <fcntl.h>
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
+Index: quota-tools/quotaio.c
+===================================================================
+--- quota-tools.orig/quotaio.c
++++ quota-tools/quotaio.c
+@@ -12,6 +12,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+Index: quota-tools/dqblk_v2.h
+===================================================================
+--- quota-tools.orig/dqblk_v2.h
++++ quota-tools/dqblk_v2.h
+@@ -7,6 +7,7 @@
+ #ifndef GUARD_DQBLK_V2_H
+ #define GUARD_DQBLK_V2_H
+
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include "quota_tree.h"
+
+Index: quota-tools/rquota_client.c
+===================================================================
+--- quota-tools.orig/rquota_client.c
++++ quota-tools/rquota_client.c
+@@ -19,7 +19,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -35,7 +37,9 @@
+ #include <stdint.h>
+
+ #include "mntopt.h"
++#if defined(RPC)
+ #include "rquota.h"
++#endif
+ #include "common.h"
+ #include "quotaio.h"
+ #include "quotasys.h"
diff --git a/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch b/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
new file mode 100644
index 000000000..06ff13cb9
--- /dev/null
+++ b/poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
@@ -0,0 +1,198 @@
+Use proper C99 integer types
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: quota-tools/bylabel.c
+===================================================================
+--- quota-tools.orig/bylabel.c
++++ quota-tools/bylabel.c
+@@ -20,6 +20,7 @@
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <stdint.h>
+
+ #include "bylabel.h"
+ #include "common.h"
+@@ -37,32 +38,32 @@ static struct uuidCache_s {
+
+ #define EXT2_SUPER_MAGIC 0xEF53
+ struct ext2_super_block {
+- u_char s_dummy1[56];
+- u_char s_magic[2];
+- u_char s_dummy2[46];
+- u_char s_uuid[16];
+- u_char s_volume_name[16];
++ uint8_t s_dummy1[56];
++ uint8_t s_magic[2];
++ uint8_t s_dummy2[46];
++ uint8_t s_uuid[16];
++ uint8_t s_volume_name[16];
+ };
+
+-#define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
++#define ext2magic(s) ((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8))
+
+ #define XFS_SUPER_MAGIC "XFSB"
+ #define XFS_SUPER_MAGIC2 "BSFX"
+ struct xfs_super_block {
+- u_char s_magic[4];
+- u_char s_dummy[28];
+- u_char s_uuid[16];
+- u_char s_dummy2[60];
+- u_char s_fsname[12];
++ uint8_t s_magic[4];
++ uint8_t s_dummy[28];
++ uint8_t s_uuid[16];
++ uint8_t s_dummy2[60];
++ uint8_t s_fsname[12];
+ };
+
+ #define REISER_SUPER_MAGIC "ReIsEr2Fs"
+ struct reiserfs_super_block {
+- u_char s_dummy1[52];
+- u_char s_magic[10];
+- u_char s_dummy2[22];
+- u_char s_uuid[16];
+- u_char s_volume_name[16];
++ uint8_t s_dummy1[52];
++ uint8_t s_magic[10];
++ uint8_t s_dummy2[22];
++ uint8_t s_uuid[16];
++ uint8_t s_volume_name[16];
+ };
+
+ static inline unsigned short swapped(unsigned short a)
+@@ -222,7 +223,7 @@ static char *get_spec_by_x(int n, const
+ return NULL;
+ }
+
+-static u_char fromhex(char c)
++static uint8_t fromhex(char c)
+ {
+ if (isdigit(c))
+ return (c - '0');
+@@ -234,7 +235,7 @@ static u_char fromhex(char c)
+
+ static char *get_spec_by_uuid(const char *s)
+ {
+- u_char uuid[16];
++ uint8_t uuid[16];
+ int i;
+
+ if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-')
+Index: quota-tools/quot.c
+===================================================================
+--- quota-tools.orig/quot.c
++++ quota-tools/quot.c
+@@ -47,6 +47,7 @@
+ #include <utmp.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <stdint.h>
+
+ #include "pot.h"
+ #include "quot.h"
+@@ -56,8 +57,8 @@
+ #include "quotasys.h"
+
+ #define TSIZE 500
+-static __uint64_t sizes[TSIZE];
+-static __uint64_t overflow;
++static uint64_t sizes[TSIZE];
++static uint64_t overflow;
+
+ static int aflag;
+ static int cflag;
+@@ -72,7 +73,7 @@ static time_t now;
+ char *progname;
+
+ static void mounttable(void);
+-static char *idname(__uint32_t, int);
++static char *idname(uint32_t, int);
+ static void report(const char *, const char *, int);
+ static void creport(const char *, const char *);
+
+@@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2)
+ static void creport(const char *file, const char *fsdir)
+ {
+ int i;
+- __uint64_t t = 0;
++ uint64_t t = 0;
+
+ printf(_("%s (%s):\n"), file, fsdir);
+ for (i = 0; i < TSIZE - 1; i++)
+@@ -219,7 +220,7 @@ static void report(const char *file, con
+ }
+ }
+
+-static idcache_t *getnextent(int type, __uint32_t id, int byid)
++static idcache_t *getnextent(int type, uint32_t id, int byid)
+ {
+ struct passwd *pw;
+ struct group *gr;
+@@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _
+ return &idc;
+ }
+
+-static char *idname(__uint32_t id, int type)
++static char *idname(uint32_t id, int type)
+ {
+ idcache_t *ncp, *idp;
+ static idcache_t nc[2][NID];
+@@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p)
+ {
+ register du_t *dp;
+ du_t **hp;
+- __uint64_t size;
+- __uint32_t i, id;
++ uint64_t size;
++ uint32_t i, id;
+
+ if ((p->bs_mode & S_IFMT) == 0)
+ return;
+Index: quota-tools/quot.h
+===================================================================
+--- quota-tools.orig/quot.h
++++ quota-tools/quot.h
+@@ -35,18 +35,18 @@
+ #define SEC24HR (60*60*24) /* seconds per day */
+
+ typedef struct {
+- __uint32_t id;
++ uint32_t id;
+ char name[UT_NAMESIZE + 1];
+ } idcache_t;
+
+ typedef struct du {
+ struct du *next;
+- __uint64_t blocks;
+- __uint64_t blocks30;
+- __uint64_t blocks60;
+- __uint64_t blocks90;
+- __uint64_t nfiles;
+- __uint32_t id;
++ uint64_t blocks;
++ uint64_t blocks30;
++ uint64_t blocks60;
++ uint64_t blocks90;
++ uint64_t nfiles;
++ uint32_t id;
+ } du_t;
+
+ #define NDU 60000
+Index: quota-tools/rquota_server.c
+===================================================================
+--- quota-tools.orig/rquota_server.c
++++ quota-tools/rquota_server.c
+@@ -60,7 +60,7 @@ extern char nfs_pseudoroot[PATH_MAX];
+ */
+ extern struct authunix_parms *unix_cred;
+
+-int in_group(gid_t * gids, u_int len, gid_t gid)
++int in_group(gid_t * gids, uint32_t len, gid_t gid)
+ {
+ gid_t *gidsp = gids + len;
+
diff --git a/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch b/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
new file mode 100644
index 000000000..4687ca06f
--- /dev/null
+++ b/poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
@@ -0,0 +1,32 @@
+From a3808fd165847298d025971eb3c7be7d11caba9d Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 8 Nov 2017 11:56:55 +0200
+Subject: [PATCH] Replace getrpcbynumber_r with getrpcbynumber
+
+musl and uclibc dont implement it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ svc_socket.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/svc_socket.c b/svc_socket.c
+index 8a44604..5bdaaa0 100644
+--- a/svc_socket.c
++++ b/svc_socket.c
+@@ -36,7 +36,8 @@ static int get_service_port(u_long number, const char *proto)
+ struct servent servbuf, *servp = NULL;
+ int ret;
+
+- ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp);
++ rpcp = getrpcbynumber(number);
++ ret = 0;
+ if (ret == 0 && rpcp != NULL) {
+ /* First try name */
+ ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/quota/quota_4.04.bb b/poky/meta/recipes-extended/quota/quota_4.04.bb
new file mode 100644
index 000000000..93f376286
--- /dev/null
+++ b/poky/meta/recipes-extended/quota/quota_4.04.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/linuxquota/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136"
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://quota.c;beginline=1;endline=33;md5=331c7d77744bfe0ad24027f0651028ec \
+ file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \
+ file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \
+ file://fcntl.patch \
+ file://remove_non_posix_types.patch \
+ "
+SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch"
+
+SRC_URI[md5sum] = "f46f3b0b5141f032f25684005dac49d3"
+SRC_URI[sha256sum] = "735be1887e7f51f54165e778ae43fc859c04e44d88834ecb2f470e91d4ef8edf"
+
+CVE_PRODUCT = "linux_diskquota"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linuxquota/files/quota-tools/"
+UPSTREAM_CHECK_REGEX = "/quota-tools/(?P<pver>(\d+[\.\-_]*)+)/"
+
+DEPENDS = "gettext-native e2fsprogs libnl dbus"
+
+inherit autotools-brokensep gettext pkgconfig
+
+CFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-I${STAGING_INCDIR}/tirpc', '', d)}"
+LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'rpc', '-ltirpc', '', d)}"
+ASNEEDED = ""
+
+PACKAGECONFIG ??= "tcp-wrappers rpc bsd"
+PACKAGECONFIG_libc-musl = "tcp-wrappers rpc"
+
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc"
+PACKAGECONFIG[bsd] = "--enable-bsd_behaviour=yes,--enable-bsd_behaviour=no,"
+PACKAGECONFIG[ldapmail] = "--enable-ldapmail,--disable-ldapmail,openldap"
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch
new file mode 100644
index 000000000..bf7aaef5a
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch
@@ -0,0 +1,221 @@
+From 7ea36eeece56b59f98e469934e4c20b4da043346 Mon Sep 17 00:00:00 2001
+From: Doran Moppert <dmoppert@redhat.com>
+Date: Thu, 11 May 2017 11:42:54 -0400
+Subject: [PATCH] rpcbind: pair all svc_getargs() calls with svc_freeargs() to
+ avoid memory leak
+
+This patch is to address CVE-2017-8779 "rpcbomb" in rpcbind, discussed
+at [1], [2], [3]. The last link suggests this issue is actually a bug
+in rpcbind, which led me here.
+
+The leak caused by the reproducer at [4] appears to come from
+rpcb_service_4(), in the case where svc_getargs() returns false and the
+function had an early return, rather than passing through the cleanup
+path at done:, as would otherwise occur.
+
+It also addresses a couple of other locations where the same fault seems
+to exist, though I haven't been able to exercise those. I hope someone
+more intimate with rpc(3) can confirm my understanding is correct, and
+that I haven't introduced any new bugs.
+
+Without this patch, using the reproducer (and variants) repeatedly
+against rpcbind with a numBytes argument of 1_000_000_000, /proc/$(pidof
+rpcbind)/status reports VmSize increase of 976564 kB each call, and
+VmRSS increase of around 260 kB every 33 calls - the specific numbers
+are probably an artifact of my rhel/glibc version. With the patch,
+there is a small (~50 kB) VmSize increase with the first message, but
+thereafter both VmSize and VmRSS remain steady.
+
+[1]: http://seclists.org/oss-sec/2017/q2/209
+[2]: https://bugzilla.redhat.com/show_bug.cgi?id=1448124
+[3]: https://sourceware.org/ml/libc-alpha/2017-05/msg00129.html
+[4]: https://github.com/guidovranken/rpcbomb/
+
+
+CVE: CVE-2017-8779
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ src/pmap_svc.c | 56 +++++++++++++++++++++++++++++++++++++++++++++---------
+ src/rpcb_svc.c | 2 +-
+ src/rpcb_svc_4.c | 2 +-
+ src/rpcb_svc_com.c | 8 ++++++++
+ 4 files changed, 57 insertions(+), 11 deletions(-)
+
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index 4c744fe..e926cdc 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -175,6 +175,7 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+ long ans;
+ uid_t uid;
+ char uidbuf[32];
++ int rc = TRUE;
+
+ /*
+ * Can't use getpwnam here. We might end up calling ourselves
+@@ -194,7 +195,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+
+ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ svcerr_decode(xprt);
+- return (FALSE);
++ rc = FALSE;
++ goto done;
+ }
+ #ifdef RPCBIND_DEBUG
+ if (debugging)
+@@ -205,7 +207,8 @@ pmapproc_change(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt, unsigned long
+
+ if (!check_access(xprt, op, reg.pm_prog, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+- return (FALSE);
++ rc = (FALSE);
++ goto done;
+ }
+
+ rpcbreg.r_prog = reg.pm_prog;
+@@ -258,7 +261,16 @@ done_change:
+ rpcbs_set(RPCBVERS_2_STAT, ans);
+ else
+ rpcbs_unset(RPCBVERS_2_STAT, ans);
+- return (TRUE);
++done:
++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
++ if (debugging) {
++ /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++ if (doabort) {
++ rpcbind_abort();
++ }
++ }
++ }
++ return (rc);
+ }
+
+ /* ARGSUSED */
+@@ -272,15 +284,18 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ #ifdef RPCBIND_DEBUG
+ char *uaddr;
+ #endif
++ int rc = TRUE;
+
+ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
+ svcerr_decode(xprt);
+- return (FALSE);
++ rc = FALSE;
++ goto done;
+ }
+
+ if (!check_access(xprt, PMAPPROC_GETPORT, reg.pm_prog, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+- return FALSE;
++ rc = FALSE;
++ goto done;
+ }
+
+ #ifdef RPCBIND_DEBUG
+@@ -330,21 +345,34 @@ pmapproc_getport(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ pmap_ipprot2netid(reg.pm_prot) ?: "<unknown>",
+ port ? udptrans : "");
+
+- return (TRUE);
++done:
++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg)) {
++ if (debugging) {
++ /* (void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++ if (doabort) {
++ rpcbind_abort();
++ }
++ }
++ }
++ return (rc);
+ }
+
+ /* ARGSUSED */
+ static bool_t
+ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ {
++ int rc = TRUE;
++
+ if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) {
+ svcerr_decode(xprt);
+- return (FALSE);
++ rc = FALSE;
++ goto done;
+ }
+
+ if (!check_access(xprt, PMAPPROC_DUMP, 0, PMAPVERS)) {
+ svcerr_weakauth(xprt);
+- return FALSE;
++ rc = FALSE;
++ goto done;
+ }
+
+ if ((!svc_sendreply(xprt, (xdrproc_t) xdr_pmaplist_ptr,
+@@ -354,7 +382,17 @@ pmapproc_dump(struct svc_req *rqstp /*__unused*/, SVCXPRT *xprt)
+ rpcbind_abort();
+ }
+ }
+- return (TRUE);
++
++done:
++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) {
++ if (debugging) {
++ /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
++ if (doabort) {
++ rpcbind_abort();
++ }
++ }
++ }
++ return (rc);
+ }
+
+ int pmap_netid2ipprot(const char *netid)
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index 709e3fb..091f530 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -166,7 +166,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+ svcerr_decode(transp);
+ if (debugging)
+ (void) xlog(LOG_DEBUG, "rpcbind: could not decode");
+- return;
++ goto done;
+ }
+
+ if (rqstp->rq_proc == RPCBPROC_SET
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index 5094879..eebbbbe 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -218,7 +218,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+ svcerr_decode(transp);
+ if (debugging)
+ (void) xlog(LOG_DEBUG, "rpcbind: could not decode\n");
+- return;
++ goto done;
+ }
+
+ if (rqstp->rq_proc == RPCBPROC_SET
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 5862c26..cb63afd 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -927,6 +927,14 @@ error:
+ if (call_msg.rm_xid != 0)
+ (void) free_slot_by_xid(call_msg.rm_xid);
+ out:
++ if (!svc_freeargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
++ if (debugging) {
++ (void) xlog(LOG_DEBUG, "unable to free arguments\n");
++ if (doabort) {
++ rpcbind_abort();
++ }
++ }
++ }
+ if (local_uaddr)
+ free(local_uaddr);
+ if (buf_alloc)
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/init.d b/poky/meta/recipes-extended/rpcbind/rpcbind/init.d
new file mode 100644
index 000000000..67499aa82
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# start/stop rpcbind daemon.
+
+### BEGIN INIT INFO
+# Provides: rpcbind
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: S 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: RPC portmapper replacement
+# Description: rpcbind is a server that converts RPC (Remote
+# Procedure Call) program numbers into DARPA
+# protocol port numbers. It must be running in
+# order to make RPC calls. Services that use
+# RPC include NFS and NIS.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+test -f /sbin/rpcbind || exit 0
+
+OPTIONS=""
+if [ -f /etc/default/rpcbind ]
+then
+ . /etc/default/rpcbind
+elif [ -f /etc/rpcbind.conf ]
+then
+ . /etc/rpcbind.conf
+fi
+
+start ()
+{
+ echo -n "Starting rpcbind daemon..."
+ if pidof /sbin/rpcbind >/dev/null; then
+ echo "already running."
+ exit 0
+ fi
+ start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@"
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+}
+
+stop ()
+{
+ echo "Stopping rpcbind daemon..."
+ if ! pidof /sbin/rpcbind >/dev/null; then
+ echo "not running."
+ return 0
+ fi
+ start-stop-daemon --stop --quiet --exec /sbin/rpcbind
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+}
+
+case "$1" in
+ start)
+ start $OPTIONS
+ ;;
+ stop)
+ stop
+ ;;
+ force-reload)
+ stop
+ start $OPTIONS
+ ;;
+ restart)
+ stop
+ start $OPTIONS
+ ;;
+ status)
+ status /sbin/rpcbind
+ ;;
+ *)
+ echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
+ exit 1
+ ;;
+esac
+
+exit $?
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch
new file mode 100644
index 000000000..4c23ee01c
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch
@@ -0,0 +1,30 @@
+From c49a7ea639eb700823e174fd605bbbe183e229aa Mon Sep 17 00:00:00 2001
+From: Steve Dickson <steved@redhat.com>
+Date: Wed, 17 May 2017 10:52:25 -0400
+Subject: [PATCH] pmapproc_dump: Fixed typo in memory leak patch
+
+commit 7ea36eee introduce a typo that caused
+NIS (aka ypbind) to fail.
+
+Signed-off-by: Steve Dickson <steved@redhat.com>
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/pmap_svc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: rpcbind-0.2.4/src/pmap_svc.c
+===================================================================
+--- rpcbind-0.2.4.orig/src/pmap_svc.c
++++ rpcbind-0.2.4/src/pmap_svc.c
+@@ -384,7 +384,7 @@ pmapproc_dump(struct svc_req *rqstp /*__
+ }
+
+ done:
+- if (!svc_freeargs(xprt, (xdrproc_t) xdr_pmap, (char *)NULL)) {
++ if (!svc_freeargs(xprt, (xdrproc_t) xdr_void, (char *)NULL)) {
+ if (debugging) {
+ /*(void) xlog(LOG_DEBUG, "unable to free arguments\n");*/
+ if (doabort) {
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
new file mode 100644
index 000000000..2a4dfbcfb
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
@@ -0,0 +1,3 @@
+# Optional arguments passed to rpcbind.
+#
+RPCBIND_OPTS=""
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
new file mode 100644
index 000000000..9cdade495
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC Bind Service
+Requires=rpcbind.socket
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
+ExecStart=@SBINDIR@/rpcbind $RPCBIND_OPTS
+SuccessExitStatus=2
+
+[Install]
+Also=rpcbind.socket
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
new file mode 100644
index 000000000..d63c1d972
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch
new file mode 100644
index 000000000..9a000d028
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind/rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch
@@ -0,0 +1,100 @@
+From 7c7590ad536c0e24bef790cb1e65702fc54db566 Mon Sep 17 00:00:00 2001
+From: Steve Dickson <steved@redhat.com>
+Date: Tue, 30 May 2017 11:27:22 -0400
+Subject: [PATCH] rpcbproc_callit_com: Stop freeing a static pointer
+
+commit 7ea36ee introduced a svc_freeargs() call
+that ended up freeing static pointer.
+
+It turns out the allocations for the rmt_args
+is not necessary . The xdr routines (xdr_bytes) will
+handle the memory management and the largest
+possible message size is UDPMSGSIZE (due to UDP only)
+which is smaller than RPC_BUF_MAX
+
+Signed-off-by: Steve Dickson <steved@redhat.com>
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/rpcb_svc_com.c | 39 ++++++---------------------------------
+ 1 file changed, 6 insertions(+), 33 deletions(-)
+
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index cb63afd..1fc2229 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -612,9 +612,9 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
+ struct netconfig *nconf;
+ struct netbuf *caller;
+ struct r_rmtcall_args a;
+- char *buf_alloc = NULL, *outbufp;
++ char *outbufp;
+ char *outbuf_alloc = NULL;
+- char buf[RPC_BUF_MAX], outbuf[RPC_BUF_MAX];
++ char outbuf[RPC_BUF_MAX];
+ struct netbuf *na = (struct netbuf *) NULL;
+ struct rpc_msg call_msg;
+ int outlen;
+@@ -635,36 +635,10 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
+ }
+ if (si.si_socktype != SOCK_DGRAM)
+ return; /* Only datagram type accepted */
+- sendsz = __rpc_get_t_size(si.si_af, si.si_proto, UDPMSGSIZE);
+- if (sendsz == 0) { /* data transfer not supported */
+- if (reply_type == RPCBPROC_INDIRECT)
+- svcerr_systemerr(transp);
+- return;
+- }
+- /*
+- * Should be multiple of 4 for XDR.
+- */
+- sendsz = ((sendsz + 3) / 4) * 4;
+- if (sendsz > RPC_BUF_MAX) {
+-#ifdef notyet
+- buf_alloc = alloca(sendsz); /* not in IDR2? */
+-#else
+- buf_alloc = malloc(sendsz);
+-#endif /* notyet */
+- if (buf_alloc == NULL) {
+- if (debugging)
+- xlog(LOG_DEBUG,
+- "rpcbproc_callit_com: No Memory!\n");
+- if (reply_type == RPCBPROC_INDIRECT)
+- svcerr_systemerr(transp);
+- return;
+- }
+- a.rmt_args.args = buf_alloc;
+- } else {
+- a.rmt_args.args = buf;
+- }
++ sendsz = UDPMSGSIZE;
+
+ call_msg.rm_xid = 0; /* For error checking purposes */
++ memset(&a, 0, sizeof(a)); /* Zero out the input buffer */
+ if (!svc_getargs(transp, (xdrproc_t) xdr_rmtcall_args, (char *) &a)) {
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_decode(transp);
+@@ -704,7 +678,8 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *transp,
+ if (rbl == (rpcblist_ptr)NULL) {
+ #ifdef RPCBIND_DEBUG
+ if (debugging)
+- xlog(LOG_DEBUG, "not found\n");
++ xlog(LOG_DEBUG, "prog %lu vers %lu: not found\n",
++ a.rmt_prog, a.rmt_vers);
+ #endif
+ if (reply_type == RPCBPROC_INDIRECT)
+ svcerr_noprog(transp);
+@@ -937,8 +912,6 @@ out:
+ }
+ if (local_uaddr)
+ free(local_uaddr);
+- if (buf_alloc)
+- free(buf_alloc);
+ if (outbuf_alloc)
+ free(outbuf_alloc);
+ if (na) {
+--
+2.7.4
+
diff --git a/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb b/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
new file mode 100644
index 000000000..dcdee6c46
--- /dev/null
+++ b/poky/meta/recipes-extended/rpcbind/rpcbind_0.2.4.bb
@@ -0,0 +1,65 @@
+SUMMARY = "Universal Addresses to RPC Program Number Mapper"
+DESCRIPTION = "The rpcbind utility is a server that converts RPC \
+ program numbers into universal addresses."
+SECTION = "console/network"
+HOMEPAGE = "http://sourceforge.net/projects/rpcbind/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751"
+DEPENDS = "libtirpc quota"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
+ file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
+ file://init.d \
+ file://rpcbind.conf \
+ file://rpcbind.socket \
+ file://rpcbind.service \
+ file://0001-rpcbind-pair-all-svc_getargs-calls-with-svc_freeargs.patch \
+ file://pmapproc_dump-Fixed-typo-in-memory-leak-patch.patch \
+ file://rpcbproc_callit_com-Stop-freeing-a-static-pointer.patch \
+ "
+SRC_URI[md5sum] = "cf10cd41ed8228fc54c316191c1f07fe"
+SRC_URI[sha256sum] = "074a9a530dc7c11e0d905aa59bcb0847c009313f02e98d3d798aa9568f414c66"
+
+inherit autotools update-rc.d systemd pkgconfig
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+INITSCRIPT_NAME = "rpcbind"
+INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "rpcbind.service"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \
+ --shell /bin/false --user-group rpc"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \
+ --without-systemdsystemunitdir, \
+ systemd \
+"
+
+EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc"
+
+do_install_append () {
+ mv ${D}${bindir} ${D}${sbindir}
+
+ install -d ${D}${sysconfdir}/init.d
+ sed -e 's,/etc/,${sysconfdir}/,g' \
+ -e 's,/sbin/,${sbindir}/,g' \
+ ${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
+ chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
+
+ install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/rpcbind.service
+}
diff --git a/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch b/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch
new file mode 100644
index 000000000..1274b2794
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch
@@ -0,0 +1,109 @@
+From 4b258c5a9078f8df60684ab7536ce3a8ff207e08 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 12 Oct 2017 10:03:57 +0000
+Subject: [PATCH] configure.ac: fix configure failed while build dir contains "yes"
+
+While the name of build dir contains "yes", the AC_EGREP_CPP
+test always return true.
+
+We rarely use "yes;" to name build dir, so s/yes/yes;/g
+could fix the issue
+
+Upstream-Status: Accepted
+https://git.savannah.gnu.org/cgit/screen.git/commit/?h=screen-v4&id=8c2b4061d16756ee2ed37f08db063b8215656943
+
+Signed-off-by: Jian Kang <jian.kang@windriver.com>
+---
+ configure.ac | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 12996cd..4765af6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -128,7 +128,7 @@ fi
+
+
+ AC_CHECKING(for Ultrix)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#if defined(ultrix) || defined(__ultrix)
+ yes;
+ #endif
+@@ -145,7 +145,7 @@ dnl ghazi@caip.rutgers.edu (Kaveh R. Ghazi):
+ dnl BBN butterfly is not POSIX, but a MACH BSD system.
+ dnl Do not define POSIX and TERMIO.
+ AC_CHECKING(for butterfly)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#if defined(butterfly)
+ yes;
+ #endif
+@@ -156,7 +156,7 @@ if test -n "$ULTRIX"; then
+ test -z "$GCC" && CC="$CC -YBSD"
+ fi
+ AC_CHECKING(for POSIX.1)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#include <sys/types.h>
+ #include <unistd.h>
+ main () {
+@@ -173,14 +173,14 @@ AC_TRY_COMPILE(
+ #include <fcntl.h>], [int x = SIGCHLD | FNDELAY;], , AC_DEFINE(SYSV))
+
+ AC_CHECKING(for sequent/ptx)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#ifdef _SEQUENT_
+ yes;
+ #endif
+ ], LIBS="$LIBS -lsocket -linet";seqptx=1)
+
+ AC_CHECKING(SVR4)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [main () {
+ #if defined(SVR4) || defined(__SVR4)
+ yes;
+@@ -200,9 +200,9 @@ fi
+ AC_CHECK_HEADERS([stropts.h string.h strings.h])
+
+ AC_CHECKING(for Solaris 2.x)
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#if defined(SVR4) && defined(sun)
+- yes
++ yes;
+ #endif
+ ], LIBS="$LIBS -lsocket -lnsl -lkstat")
+
+@@ -697,7 +697,7 @@ else
+ pdir='/dev'
+ fi
+ dnl SCO uses ptyp%d
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#ifdef M_UNIX
+ yes;
+ #endif
+@@ -880,7 +880,7 @@ fi
+ )
+
+ if test -z "$load" ; then
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#if defined(NeXT) || defined(apollo) || defined(linux)
+ yes;
+ #endif
+@@ -1112,7 +1112,7 @@ AC_CHECKING(syslog in libbsd.a)
+ AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs"
+ AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])])
+
+-AC_EGREP_CPP(yes,
++AC_EGREP_CPP(yes;,
+ [#ifdef M_UNIX
+ yes;
+ #endif
+--
+2.13.3
+
diff --git a/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch b/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
new file mode 100644
index 000000000..fbdb0eb47
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
@@ -0,0 +1,58 @@
+From 79ad2885e26631077dd6b8aebe17ae95b38133a6 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 26 Jul 2016 14:23:59 +0800
+Subject: [PATCH] fix for multijob build
+
+make sure that comm.sh script generates comm.h header before doing
+anything else
+
+Signed-off-by: Amadeusz Sawiski <amade@asmblr.net>
+
+Upstream-Status: Backport
+
+Backport patch to fix parallel build failure and update context to make patch
+coulde be applied.
+
+http://git.savannah.gnu.org/cgit/screen.git/commit?id=c0de6dd
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Makefile.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index aca7da3..3607711 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -298,7 +298,7 @@ search.o: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h a
+ comm.h layer.h term.h image.h display.h window.h mark.h extern.h
+ tty.o: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+ layer.h term.h image.h display.h window.h extern.h
+-term.o: layout.h viewport.h canvas.h term.c term.h
++term.o: layout.h viewport.h canvas.h term.c term.h comm.h
+ window.o: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
+ utmp.o: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -324,7 +324,7 @@ canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h a
+ comm.h layer.h term.h image.h display.h window.h extern.h \
+ braille.h
+ comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
+-kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h
++kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h comm.h
+ acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+ layer.h term.h image.h display.h window.h extern.h
+ braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a
+ viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h \
+ braille.h
+-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h
+-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h
++list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h
++list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h
+ list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch b/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
new file mode 100644
index 000000000..a01dc2475
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+
+Backport from:
+
+http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 39c5f1c76f1fcef4b5958bf828a63f53426b6984 Mon Sep 17 00:00:00 2001
+From: Mike Gerwitz <mike@mikegerwitz.com>
+Date: Tue, 24 Dec 2013 22:16:31 -0500
+Subject: [PATCH] comm.h now depends on term.h
+
+---
+ src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: screen-4.6.1/Makefile.in
+===================================================================
+--- screen-4.6.1.orig/Makefile.in
++++ screen-4.6.1/Makefile.in
+@@ -133,7 +133,7 @@ kmapdef.c: term.h
+ tty.c: tty.sh
+ sh $(srcdir)/tty.sh tty.c
+
+-comm.h: comm.c comm.sh config.h
++comm.h: comm.c comm.sh config.h term.h
+ AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
+
+ osdef.h: osdef.sh config.h osdef.h.in
diff --git a/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch b/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
new file mode 100644
index 000000000..e184aa1f3
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
@@ -0,0 +1,57 @@
+From 79afb676904653403145fda9e1a6a9d3ea1cb22a Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:10:32 +0300
+Subject: [PATCH 4/4] Avoid mis-identifying systems as SVR4
+
+Linux can be misdetected as SVR4 because it has
+libelf installed. This leads to linking with libelf, even though no
+symbols from that library were actually used, and to a workaround for
+a buggy getlogin() being enabled.
+
+It is not documented which exact SVR4 system had the bug that the
+workaround was added for, so all I could do is make an educated guess
+at the #defines its compiler would be likely to set.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc928ae..65439ce 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -179,14 +179,24 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], LIBS="$LIBS -lsocket -linet";seqptx=1)
+
++AC_CHECKING(SVR4)
++AC_EGREP_CPP(yes,
++[main () {
++#if defined(SVR4) || defined(__SVR4)
++ yes;
++#endif
++], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
++if test -n "$svr4" ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lelf"
+ AC_CHECKING(SVR4)
+ AC_TRY_LINK([#include <utmpx.h>
+ ],,
+-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
+-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
++[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
++[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
+ ,LIBS="$oldlibs")
++fi
++
+ AC_CHECK_HEADERS([stropts.h string.h strings.h])
+
+ AC_CHECKING(for Solaris 2.x)
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch b/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
new file mode 100644
index 000000000..248bf087e
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
@@ -0,0 +1,137 @@
+From cd0f7f10a3fffbc60fe55eb200474d13fe1da65b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:34:29 +0300
+Subject: [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 27690a6..ce89f56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,7 +348,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your fifos are usable) fifo=1,
+-AC_NOTE(- your fifos are not usable))
++AC_NOTE(- your fifos are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
+ rm -f /tmp/conftest*
+
+ if test -n "$fifo"; then
+@@ -396,7 +397,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your implementation is ok),
+-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
++AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
+ rm -f /tmp/conftest*
+ fi
+
+@@ -458,7 +460,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your sockets are usable) sock=1,
+-AC_NOTE(- your sockets are not usable))
++AC_NOTE(- your sockets are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
+ rm -f /tmp/conftest*
+
+ if test -n "$sock"; then
+@@ -497,7 +500,8 @@ main()
+ }
+ ],AC_NOTE(- you are normal),
+ AC_NOTE(- unix domain sockets are not kept in the filesystem)
+-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
++AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
+ rm -f /tmp/conftest*
+ fi
+
+@@ -624,7 +628,8 @@ main()
+ exit(0);
+ }
+ ],AC_NOTE(- select is ok),
+-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
++AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
++AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
+
+ dnl
+ dnl **** termcap or terminfo ****
+@@ -666,7 +671,8 @@ main()
+ {
+ exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
+ }], AC_NOTE(- you use the termcap database),
+-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
++AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
++AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
+ AC_CHECKING(ospeed)
+ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+
+@@ -801,7 +807,8 @@ main()
+ else
+ AC_NOTE(- can't determine - assume ptys are world accessable)
+ fi
+- ]
++ ],
++ AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable)
+ )
+ rm -f conftest_grp
+ fi
+@@ -885,7 +892,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], load=1)
+ fi
+-if test -z "$load" ; then
++if test -z "$load" && test "$cross_compiling" = no ; then
+ AC_CHECKING(for kernelfile)
+ for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
+ if test -f $core || test -c $core; then
+@@ -1078,7 +1085,7 @@ main()
+ #endif
+ exit(0);
+ }
+-],,AC_DEFINE(SYSVSIGS))
++],,AC_DEFINE(SYSVSIGS),:)
+
+ fi
+
+@@ -1158,7 +1165,7 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEBCOPY))
++}], AC_DEFINE(USEBCOPY),,:)
+
+ AC_TRY_RUN([
+ #define bcopy(s,d,l) memmove(d,s,l)
+@@ -1173,7 +1180,8 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEMEMMOVE))
++}], AC_DEFINE(USEMEMMOVE),,
++ AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
+
+
+ AC_TRY_RUN([
+@@ -1189,7 +1197,7 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEMEMCPY))
++}], AC_DEFINE(USEMEMCPY),,:)
+
+ AC_SYS_LONG_FILE_NAMES
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch b/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
new file mode 100644
index 000000000..cc62c12e0
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
@@ -0,0 +1,65 @@
+From 73b726c25f94c1b15514ed9249b927afdfbbfb94 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:30:40 +0300
+Subject: [PATCH 1/4] Remove redundant compiler sanity checks
+
+AC_PROG_CC already performs sanity checks. And unlike the removed
+checks, it does so in a way that supports cross compilation.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 27 ---------------------------
+ 1 file changed, 27 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ffe2e37..27690a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -48,31 +48,6 @@ AC_PROG_GCC_TRADITIONAL
+ AC_ISC_POSIX
+ AC_USE_SYSTEM_EXTENSIONS
+
+-AC_TRY_RUN(main(){exit(0);},,[
+-if test $CC != cc ; then
+-AC_NOTE(Your $CC failed - restarting with CC=cc)
+-AC_NOTE()
+-CC=cc
+-export CC
+-exec $0 $configure_args
+-fi
+-])
+-
+-AC_TRY_RUN(main(){exit(0);},,
+-exec 5>&2
+-eval $ac_link
+-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
+-AC_NOTE($ac_compile)
+-AC_MSG_ERROR(Can't run the compiler - sorry))
+-
+-AC_TRY_RUN([
+-main()
+-{
+- int __something_strange_();
+- __something_strange_(0);
+-}
+-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
+-
+ AC_PROG_AWK
+
+ AC_PROG_INSTALL
+@@ -1300,8 +1275,6 @@ fi
+ dnl Ptx bug workaround -- insert -lc after -ltermcap
+ test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
+
+-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
+-
+ ETCSCREENRC=
+ AC_MSG_CHECKING(for the global screenrc file)
+ AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path to the global screenrc file], [ ETCSCREENRC="${withval}" ])
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch b/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
new file mode 100644
index 000000000..d7e55a445
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
@@ -0,0 +1,135 @@
+From d0b20e4cacc60ad62a2150ce07388cb5a25c2040 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:09:01 +0300
+Subject: [PATCH 3/4] Skip host file system checks when cross-compiling
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ce89f56..dc928ae 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir,
+ dnl
+ dnl **** special unix variants ****
+ dnl
+-if test -n "$ISC"; then
++if test "$cross_compiling" = no && test -n "$ISC" ; then
+ AC_DEFINE(ISC) LIBS="$LIBS -linet"
+ fi
+
+@@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
+ dnl fi
+ dnl fi
+
+-if test -f /sysV68 ; then
++if test "$cross_compiling" = no && test -f /sysV68 ; then
+ AC_DEFINE(sysV68)
+ fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for MIPS)
+ if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
+ oldlibs="$LIBS"
+@@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
+ ))
+ fi
+ fi
++fi
+
+
+ AC_CHECKING(for Ultrix)
+@@ -132,7 +134,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], ULTRIX=1)
+
+-if test -f /usr/lib/libpyr.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lpyr"
+ AC_CHECKING(Pyramid OSX)
+@@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+ dnl
+ dnl **** PTY specific things ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for /dev/ptc)
+ if test -r /dev/ptc; then
+ AC_DEFINE(HAVE_DEV_PTC)
+ fi
++fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for SVR4 ptys)
+ sysvr4ptys=
+ if test -c /dev/ptmx ; then
+ AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
+ sysvr4ptys=1])
+ fi
++fi
+
+ AC_CHECK_FUNCS(getpt)
+
+@@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,,
+ [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
+ fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for ptyranges)
+ if test -d /dev/ptym ; then
+ pdir='/dev/ptym'
+@@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\
+ AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
+ AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
+ fi
++fi
+
+ dnl **** pty mode/group handling ****
+ dnl
+@@ -869,14 +877,16 @@ fi
+ dnl
+ dnl **** loadav ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for libutil(s))
+ test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
+ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
++fi
+
+ AC_CHECKING(getloadavg)
+ AC_TRY_LINK(,[getloadavg((double *)0, 0);],
+ AC_DEFINE(LOADAV_GETLOADAVG) load=1,
+-if test -f /usr/lib/libkvm.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
+ olibs="$LIBS"
+ LIBS="$LIBS -lkvm"
+ AC_CHECKING(getloadavg with -lkvm)
+@@ -1094,13 +1104,18 @@ dnl **** libraries ****
+ dnl
+
+ AC_CHECKING(for crypt and sec libraries)
++if test "$cross_compiling" = no ; then
+ test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
++fi
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lcrypt"
+ AC_CHECKING(crypt)
+ AC_TRY_LINK(,,,LIBS="$oldlibs")
++if test "$cross_compiling" = no ; then
+ test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
+ test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
++fi
++
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ AC_CHECKING(IRIX sun library)
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/screen/screen/screen.pam b/poky/meta/recipes-extended/screen/screen/screen.pam
new file mode 100644
index 000000000..ff657fa07
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen/screen.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+auth include common-auth
diff --git a/poky/meta/recipes-extended/screen/screen_4.6.2.bb b/poky/meta/recipes-extended/screen/screen_4.6.2.bb
new file mode 100644
index 000000000..7a33c31d8
--- /dev/null
+++ b/poky/meta/recipes-extended/screen/screen_4.6.2.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Multiplexing terminal manager"
+DESCRIPTION = "Screen is a full-screen window manager \
+that multiplexes a physical terminal between several \
+processes, typically interactive shells."
+HOMEPAGE = "http://www.gnu.org/software/screen/"
+BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
+
+SECTION = "console/utils"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf"
+
+DEPENDS = "ncurses \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "base-files"
+
+SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
+ file://Remove-redundant-compiler-sanity-checks.patch \
+ file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \
+ file://Skip-host-file-system-checks-when-cross-compiling.patch \
+ file://Avoid-mis-identifying-systems-as-SVR4.patch \
+ file://0002-comm.h-now-depends-on-term.h.patch \
+ file://0001-fix-for-multijob-build.patch \
+ file://0001-configure.ac-fix-configure-failed-while-build-dir-ha.patch \
+ "
+
+SRC_URI[md5sum] = "a0f529d3333b128dfaa324d978ba73a8"
+SRC_URI[sha256sum] = "1b6922520e6a0ce5e28768d620b0f640a6631397f95ccb043b70b91bb503fa3a"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
+
+EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+do_install_append () {
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
+ fi
+}
+
+pkg_postinst_${PN} () {
+ grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest
new file mode 100644
index 000000000..7c0f62770
--- /dev/null
+++ b/poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C testsuite -k runtest-TESTS
diff --git a/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
new file mode 100644
index 000000000..0293900fb
--- /dev/null
+++ b/poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
@@ -0,0 +1,66 @@
+sed: add ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+And fix following error after add serial-tests.
+
+[snip]
+help2man: can't get `--help' info from ../sed/sed
+make[2]: *** [sed.1] Error 2
+[snip]
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac | 2 +-
+ doc/Makefile.am | 2 +-
+ testsuite/Makefile.am | 6 ++++++
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d33ec9..4f0c532 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(build-aux)
+ AC_CONFIG_SRCDIR([sed/sed.c])
+ AM_CONFIG_HEADER(config.h:config_h.in)
+ AC_PREREQ(2.60)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([serial-tests])
+
+ SED_FEATURE_VERSION=4.2.2
+ AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION",
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index af6975c..6fd8c9a 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -25,7 +25,7 @@ $(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed
+ fi
+ echo stamp > $(srcdir)/s-texi
+
+-sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
++_sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
+ $(HELP2MAN) --name "stream editor for filtering and transforming text" \
+ -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED)
+
+diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
+index d80e72c..b05f01e 100644
+--- a/testsuite/Makefile.am
++++ b/testsuite/Makefile.am
+@@ -99,5 +99,11 @@ EXTRA_DIST = \
+ # automake makes `check' depend on $(TESTS). Declare
+ # dummy targets for $(TESTS) so that make does not complain.
+
++install-ptest:
++ cd $(BUILDDIR); tar -c --exclude=*.o $(TESTDIR) | ( cd $(DESTDIR) && tar -xf - )
++ for i in $(EXTRA_DIST) tst-regex2.c; do install $(srcdir)/$$i $(DESTDIR)/$(TESTDIR); done
++ sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i $(DESTDIR)/$(TESTDIR)/Makefile
++ for i in `grep -rl "../sed/sed" $(DESTDIR)/$(TESTDIR)`; do sed -e 's/..\/sed\/sed/sed/' -i $$i; done
++
+ .PHONY: $(SEDTESTS)
+ $(SEDTESTS):
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/sed/sed_4.2.2.bb b/poky/meta/recipes-extended/sed/sed_4.2.2.bb
new file mode 100644
index 000000000..f10e365ea
--- /dev/null
+++ b/poky/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f"
+SECTION = "console/utils"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+ file://sed-add-ptest.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056"
+SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
+
+inherit autotools texinfo update-alternatives gettext ptest
+RDEPENDS_${PN}-ptest += "make ${PN}"
+RRECOMMENDS_${PN}-ptest_append_libc-glibc = " locale-base-ru-ru"
+
+EXTRA_OECONF = "--disable-acl \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-regex-tests', '', d)}"
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+ mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+ rmdir ${D}${bindir}/
+ fi
+}
+
+ALTERNATIVE_${PN} = "sed"
+ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
+ALTERNATIVE_PRIORITY = "100"
+
+TESTDIR = "testsuite"
+
+do_compile_ptest() {
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+ sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sed', '', d)}"
diff --git a/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch b/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
new file mode 100644
index 000000000..a6f604b65
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
@@ -0,0 +1,124 @@
+From 8cf3454d567f77233023be49a39a33e9f0836f89 Mon Sep 17 00:00:00 2001
+From: Scott Garman <scott.a.garman@intel.com>
+Date: Thu, 14 Apr 2016 12:28:57 +0200
+Subject: [PATCH] Disable use of syslog for sysroot
+
+Disable use of syslog to prevent sysroot user and group additions from
+writing entries to the host's syslog. This patch should only be used
+with the shadow-native recipe.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ src/groupadd.c | 3 +++
+ src/groupdel.c | 3 +++
+ src/groupmems.c | 3 +++
+ src/groupmod.c | 3 +++
+ src/useradd.c | 3 +++
+ src/userdel.c | 3 +++
+ src/usermod.c | 3 +++
+ 7 files changed, 21 insertions(+)
+
+diff --git a/src/groupadd.c b/src/groupadd.c
+index 39b4ec0..f716f57 100644
+--- a/src/groupadd.c
++++ b/src/groupadd.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/groupdel.c b/src/groupdel.c
+index da99347..46a679c 100644
+--- a/src/groupdel.c
++++ b/src/groupdel.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <grp.h>
+diff --git a/src/groupmems.c b/src/groupmems.c
+index e4f107f..95cb073 100644
+--- a/src/groupmems.c
++++ b/src/groupmems.c
+@@ -32,6 +32,9 @@
+
+ #include <config.h>
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <fcntl.h>
+ #include <getopt.h>
+ #include <grp.h>
+diff --git a/src/groupmod.c b/src/groupmod.c
+index d9d3807..6229737 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/useradd.c b/src/useradd.c
+index e1ebf50..25679d8 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+diff --git a/src/userdel.c b/src/userdel.c
+index 19b12bc..a083929 100644
+--- a/src/userdel.c
++++ b/src/userdel.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/usermod.c b/src/usermod.c
+index 685b50a..28e5cfc 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--
+2.1.0
+
diff --git a/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch b/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
new file mode 100644
index 000000000..828b95a57
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
@@ -0,0 +1,46 @@
+From 170c25c8e0b5c3dc2615d1db94c8d24a13ff99bf Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Thu, 11 Sep 2014 15:11:23 +0200
+Subject: [PATCH] Do not read login.defs before doing chroot()
+
+If "useradd --root <root> ..." was used, the login.defs file would still
+be read from /etc/login.defs instead of <root>/etc/login.defs. This was
+due to getdef_ulong() being called before process_root_flag().
+
+Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2014-September/010446.html]
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ src/useradd.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index a8a1f76..e1ebf50 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1993,9 +1993,11 @@ int main (int argc, char **argv)
+ #endif /* USE_PAM */
+ #endif /* ACCT_TOOLS_SETUID */
+
++#ifdef ENABLE_SUBIDS
+ /* Needed for userns check */
+- uid_t uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
+- uid_t uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
++ uid_t uid_min;
++ uid_t uid_max;
++#endif
+
+ /*
+ * Get my name so that I can use it to report errors.
+@@ -2026,6 +2028,8 @@ int main (int argc, char **argv)
+ is_shadow_grp = sgr_file_present ();
+ #endif
+ #ifdef ENABLE_SUBIDS
++ uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
++ uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
+ is_sub_uid = sub_uid_file_present () && !rflg &&
+ (!user_id || (user_id <= uid_max && user_id >= uid_min));
+ is_sub_gid = sub_gid_file_present () && !rflg &&
+--
+1.9.0
+
diff --git a/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424 b/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424
new file mode 100644
index 000000000..4d3e1e016
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/0001-shadow-CVE-2017-12424
@@ -0,0 +1,46 @@
+From 954e3d2e7113e9ac06632aee3c69b8d818cc8952 Mon Sep 17 00:00:00 2001
+From: Tomas Mraz <tmraz@fedoraproject.org>
+Date: Fri, 31 Mar 2017 16:25:06 +0200
+Subject: [PATCH] Fix buffer overflow if NULL line is present in db.
+
+If ptr->line == NULL for an entry, the first cycle will exit,
+but the second one will happily write past entries buffer.
+We actually do not want to exit the first cycle prematurely
+on ptr->line == NULL.
+Signed-off-by: Tomas Mraz <tmraz@fedoraproject.org>
+
+CVE: CVE-2017-12424
+Upstream-Status: Backport
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/commonio.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/lib/commonio.c b/lib/commonio.c
+index b10da06..31edbaa 100644
+--- a/lib/commonio.c
++++ b/lib/commonio.c
+@@ -751,16 +751,16 @@ commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *))
+ for (ptr = db->head;
+ (NULL != ptr)
+ #if KEEP_NIS_AT_END
+- && (NULL != ptr->line)
+- && ( ('+' != ptr->line[0])
+- && ('-' != ptr->line[0]))
++ && ((NULL == ptr->line)
++ || (('+' != ptr->line[0])
++ && ('-' != ptr->line[0])))
+ #endif
+ ;
+ ptr = ptr->next) {
+ n++;
+ }
+ #if KEEP_NIS_AT_END
+- if ((NULL != ptr) && (NULL != ptr->line)) {
++ if (NULL != ptr) {
+ nis = ptr;
+ }
+ #endif
+--
+2.1.0
+
diff --git a/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch b/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
new file mode 100644
index 000000000..60a46e125
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/0001-useradd-copy-extended-attributes-of-home.patch
@@ -0,0 +1,47 @@
+From acec93540eba6899661c607408498ac72ab07a47 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
+Date: Tue, 7 Mar 2017 16:03:03 +0100
+Subject: [PATCH] useradd: copy extended attributes of home
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Home directory wasn't getting the extended attributes
+of /etc/skel. This patch fixes that issue and adds the copy
+of the extended attributes of the root of the home directory.
+
+Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-commits/2017-March/003804.html]
+
+Change-Id: Icd633f7c6c494efd2a30cb8f04c306f749ad0c3b
+Signed-off-by: José Bollo <jose.bollo@iot.bzh>
+---
+ src/useradd.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index a8a1f76..8aefb9c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -52,6 +52,9 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <time.h>
++#ifdef WITH_ATTR
++#include <attr/libattr.h>
++#endif
+ #include "chkname.h"
+ #include "defines.h"
+ #include "faillog.h"
+@@ -1915,6 +1918,9 @@ static void create_home (void)
+ chown (user_home, user_id, user_gid);
+ chmod (user_home,
+ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++#ifdef WITH_ATTR
++ attr_copy_file (def_template, user_home, NULL, NULL);
++#endif
+ home_added = true;
+ #ifdef WITH_AUDIT
+ audit_logger (AUDIT_ADD_USER, Prog,
+--
+2.9.3
+
diff --git a/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
new file mode 100644
index 000000000..2f084b4e9
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -0,0 +1,115 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: useradd.c: create parent directories when necessary
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/useradd.c | 72 +++++++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 49 insertions(+), 23 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index 4bd969d..cb5dd6c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1896,6 +1896,35 @@ static void usr_update (void)
+ }
+
+ /*
++ * mkdir_p - create directories, including parent directories when needed
++ *
++ * similar to `mkdir -p'
++ */
++void mkdir_p(const char *path) {
++ int len = strlen(path);
++ char newdir[len + 1];
++ mode_t mode = 0755;
++ int i = 0;
++
++ if (path[i] == '\0') {
++ return;
++ }
++
++ /* skip the leading '/' */
++ i++;
++
++ while(path[i] != '\0') {
++ if (path[i] == '/') {
++ strncpy(newdir, path, i);
++ newdir[i] = '\0';
++ mkdir(newdir, mode);
++ }
++ i++;
++ }
++ mkdir(path, mode);
++}
++
++/*
+ * create_home - create the user's home directory
+ *
+ * create_home() creates the user's home directory if it does not
+@@ -1910,39 +1939,36 @@ static void create_home (void)
+ fail_exit (E_HOMEDIR);
+ }
+ #endif
+- /* XXX - create missing parent directories. --marekm */
+- if (mkdir (user_home, 0) != 0) {
+- fprintf (stderr,
+- _("%s: cannot create directory %s\n"),
+- Prog, user_home);
+-#ifdef WITH_AUDIT
+- audit_logger (AUDIT_ADD_USER, Prog,
+- "adding home directory",
+- user_name, (unsigned int) user_id,
+- SHADOW_AUDIT_FAILURE);
+-#endif
+- fail_exit (E_HOMEDIR);
+- }
+- chown (user_home, user_id, user_gid);
+- chmod (user_home,
+- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+-#ifdef WITH_ATTR
+- attr_copy_file (def_template, user_home, NULL, NULL);
+-#endif
+- home_added = true;
++ mkdir_p(user_home);
++ }
++ if (access (user_home, F_OK) != 0) {
+ #ifdef WITH_AUDIT
+ audit_logger (AUDIT_ADD_USER, Prog,
+ "adding home directory",
+ user_name, (unsigned int) user_id,
+- SHADOW_AUDIT_SUCCESS);
++ SHADOW_AUDIT_FAILURE);
+ #endif
+-#ifdef WITH_SELINUX
+- /* Reset SELinux to create files with default contexts */
+- if (reset_selinux_file_context () != 0) {
+- fail_exit (E_HOMEDIR);
+- }
++ fail_exit (E_HOMEDIR);
++ }
++ chown (user_home, user_id, user_gid);
++ chmod (user_home,
++ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++#ifdef WITH_ATTR
++ attr_copy_file (def_template, user_home, NULL, NULL);
++#endif
++ home_added = true;
++#ifdef WITH_AUDIT
++ audit_logger (AUDIT_ADD_USER, Prog,
++ "adding home directory",
++ user_name, (unsigned int) user_id,
++ SHADOW_AUDIT_SUCCESS);
+ #endif
++#ifdef WITH_SELINUX
++ /* Reset SELinux to create files with default contexts */
++ if (reset_selinux_file_context () != 0) {
++ fail_exit (E_HOMEDIR);
+ }
++#endif
+ }
+
+ /*
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
new file mode 100644
index 000000000..615c6e002
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
@@ -0,0 +1,201 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Allow for setting password in clear text.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am | 8 ++++----
+ src/groupadd.c | 8 +++++++-
+ src/groupmod.c | 8 +++++++-
+ src/useradd.c | 9 +++++++--
+ src/usermod.c | 8 +++++++-
+ 5 files changed, 32 insertions(+), 9 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..856b087 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -88,10 +88,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
+ chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+ gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+-groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+ groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX)
+-groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ grpck_LDADD = $(LDADD) $(LIBSELINUX)
+ grpconv_LDADD = $(LDADD) $(LIBSELINUX)
+ grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
+@@ -111,9 +111,9 @@ su_SOURCES = \
+ suauth.c
+ su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ sulogin_LDADD = $(LDADD) $(LIBCRYPT)
+-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE)
+-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ vipw_LDADD = $(LDADD) $(LIBSELINUX)
+
+ install-am: all-am
+diff --git a/src/groupadd.c b/src/groupadd.c
+index f716f57..4e28c26 100644
+--- a/src/groupadd.c
++++ b/src/groupadd.c
+@@ -124,6 +124,7 @@ static /*@noreturn@*/void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n"
+ " (non-unique) GID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD use this clear password for the new group\n"), usageout);
+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs ("\n", usageout);
+@@ -387,12 +388,13 @@ static void process_flags (int argc, char **argv)
+ {"key", required_argument, NULL, 'K'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"system", no_argument, NULL, 'r'},
+ {"root", required_argument, NULL, 'R'},
+ {NULL, 0, NULL, '\0'}
+ };
+
+- while ((c = getopt_long (argc, argv, "fg:hK:op:rR:",
++ while ((c = getopt_long (argc, argv, "fg:hK:op:P:rR:",
+ long_options, NULL)) != -1) {
+ switch (c) {
+ case 'f':
+@@ -444,6 +446,10 @@ static void process_flags (int argc, char **argv)
+ pflg = true;
+ group_passwd = optarg;
+ break;
++ case 'P':
++ pflg = true;
++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ break;
+ case 'r':
+ rflg = true;
+ break;
+diff --git a/src/groupmod.c b/src/groupmod.c
+index d9d3807..68f49d1 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -127,6 +127,7 @@ static void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n"
+ " PASSWORD\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD change the password to this clear PASSWORD\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs ("\n", usageout);
+ exit (status);
+@@ -375,10 +376,11 @@ static void process_flags (int argc, char **argv)
+ {"new-name", required_argument, NULL, 'n'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"root", required_argument, NULL, 'R'},
+ {NULL, 0, NULL, '\0'}
+ };
+- while ((c = getopt_long (argc, argv, "g:hn:op:R:",
++ while ((c = getopt_long (argc, argv, "g:hn:op:P:R:",
+ long_options, NULL)) != -1) {
+ switch (c) {
+ case 'g':
+@@ -405,6 +407,10 @@ static void process_flags (int argc, char **argv)
+ group_passwd = optarg;
+ pflg = true;
+ break;
++ case 'P':
++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ pflg = true;
++ break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
+ default:
+diff --git a/src/useradd.c b/src/useradd.c
+index b3bd451..4416f90 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -776,6 +776,7 @@ static void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n"
+ " (non-unique) UID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD clear password of the new account\n"), usageout);
+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), usageout);
+@@ -1050,6 +1051,7 @@ static void process_flags (int argc, char **argv)
+ {"no-user-group", no_argument, NULL, 'N'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"system", no_argument, NULL, 'r'},
+ {"root", required_argument, NULL, 'R'},
+ {"shell", required_argument, NULL, 's'},
+@@ -1062,9 +1064,9 @@ static void process_flags (int argc, char **argv)
+ };
+ while ((c = getopt_long (argc, argv,
+ #ifdef WITH_SELINUX
+- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:",
++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:UZ:",
+ #else /* !WITH_SELINUX */
+- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U",
++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:U",
+ #endif /* !WITH_SELINUX */
+ long_options, NULL)) != -1) {
+ switch (c) {
+@@ -1230,6 +1232,9 @@ static void process_flags (int argc, char **argv)
+ }
+ user_pass = optarg;
+ break;
++ case 'P': /* set clear text password */
++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ break;
+ case 'r':
+ rflg = true;
+ break;
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..b79f7a3 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -419,6 +419,7 @@ static /*@noreturn@*/void usage (int status)
+ " new location (use only with -d)\n"), usageout);
+ (void) fputs (_(" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD use encrypted password for the new password\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD use clear password for the new password\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -s, --shell SHELL new login shell for the user account\n"), usageout);
+ (void) fputs (_(" -u, --uid UID new UID for the user account\n"), usageout);
+@@ -996,6 +997,7 @@ static void process_flags (int argc, char **argv)
+ {"move-home", no_argument, NULL, 'm'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"root", required_argument, NULL, 'R'},
+ {"shell", required_argument, NULL, 's'},
+ {"uid", required_argument, NULL, 'u'},
+@@ -1012,7 +1014,7 @@ static void process_flags (int argc, char **argv)
+ {NULL, 0, NULL, '\0'}
+ };
+ while ((c = getopt_long (argc, argv,
+- "ac:d:e:f:g:G:hl:Lmop:R:s:u:U"
++ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U"
+ #ifdef ENABLE_SUBIDS
+ "v:w:V:W:"
+ #endif /* ENABLE_SUBIDS */
+@@ -1112,6 +1114,10 @@ static void process_flags (int argc, char **argv)
+ user_pass = optarg;
+ pflg = true;
+ break;
++ case 'P':
++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ pflg = true;
++ break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
+ case 's':
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch b/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
new file mode 100644
index 000000000..185590cab
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
@@ -0,0 +1,41 @@
+From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@aura-online.co.uk>
+Date: Sat, 23 Aug 2014 09:46:39 +0100
+Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF
+
+This built-in check is simpler than the previous method and, most
+importantly, works when cross-compiling.
+
+Upstream-Status: Accepted
+[https://github.com/shadow-maint/shadow/commit/2cb54158b80cdbd97ca3b36df83f9255e923ae3f]
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ configure.in | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 1a3f841..4a4d6d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then
+ dnl
+ dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
+ dnl
+- AC_RUN_IFELSE([AC_LANG_SOURCE([
+-#include <sys/types.h>
+-int main(void) {
+- uid_t u;
+- gid_t g;
+- return (sizeof u < 4) || (sizeof g < 4);
+-}
+- ])], [id32bit="yes"], [id32bit="no"])
+-
+- if test "x$id32bit" = "xyes"; then
++ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
++ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
++
++ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
+ AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+ enable_subids="yes"
+ else
diff --git a/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
new file mode 100644
index 000000000..4fa3d184e
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [OE specific]
+
+commonio.c: fix unexpected open failure in chroot environment
+
+When using commands with '-R <newroot>' option in our pseudo environment,
+we would usually get the 'Pemission Denied' error. This patch serves as
+a workaround to this problem.
+
+Note that this patch doesn't change the logic in the code, it just expands
+the codes.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/commonio.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/commonio.c b/lib/commonio.c
+index cc536bf..51cafd9 100644
+--- a/lib/commonio.c
++++ b/lib/commonio.c
+@@ -613,10 +613,18 @@ int commonio_open (struct commonio_db *db, int mode)
+ db->cursor = NULL;
+ db->changed = false;
+
+- fd = open (db->filename,
+- (db->readonly ? O_RDONLY : O_RDWR)
+- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
+- saved_errno = errno;
++ if (db->readonly) {
++ fd = open (db->filename,
++ (true ? O_RDONLY : O_RDWR)
++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++ saved_errno = errno;
++ } else {
++ fd = open (db->filename,
++ (false ? O_RDONLY : O_RDWR)
++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++ saved_errno = errno;
++ }
++
+ db->fp = NULL;
+ if (fd >= 0) {
+ #ifdef WITH_TCB
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch b/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..02cb91aaf
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Subject: fix installation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..076f8ef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
+ noinst_PROGRAMS = id sulogin
+
+ suidbins = su
+-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
++suidubins = chage chfn chsh expiry gpasswd newgrp passwd
++if ENABLE_SUBIDS
++suidubins += newgidmap newuidmap
++endif
+ if ACCT_TOOLS_SETUID
+ suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+ endif
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot b/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
new file mode 100644
index 000000000..8a68dd341
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
@@ -0,0 +1,386 @@
+#
+# /etc/login.defs - Configuration control definitions for the shadow package.
+#
+# $Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $
+#
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+# Note: When PAM is used, some modules may enfore a minimal delay (e.g.
+# pam_unix enforces a 2s delay)
+#
+FAIL_DELAY 3
+
+#
+# Enable logging and display of /var/log/faillog login failure info.
+#
+#FAILLOG_ENAB yes
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS no
+
+#
+# Enable logging and display of /var/log/lastlog login time info.
+#
+#LASTLOG_ENAB yes
+
+#
+# Enable checking and display of mailbox status upon login.
+#
+# Disable if the shell startup files already check for mail
+# ("mailx -e" or equivalent).
+#
+##MAIL_CHECK_ENAB yes
+
+#
+# Enable additional checks upon password changes.
+#
+#OBSCURE_CHECKS_ENAB yes
+
+#
+# Enable checking of time restrictions specified in /etc/porttime.
+#
+#PORTTIME_CHECKS_ENAB yes
+
+#
+# Enable setting of ulimit, umask, and niceness from passwd gecos field.
+#
+#QUOTAS_ENAB yes
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB yes
+SYSLOG_SG_ENAB yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names. Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE /etc/securetty
+#CONSOLE console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE /var/log/sulog
+
+#
+# If defined, ":" delimited list of "message of the day" files to
+# be displayed upon login.
+#
+#MOTD_FILE /etc/motd
+#MOTD_FILE /etc/motd:/usr/lib/news/news-motd
+
+#
+# If defined, this file will be output before each login prompt.
+#
+#ISSUE_FILE /etc/issue
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100 tty01".
+#
+#TTYTYPE_FILE /etc/ttytype
+
+#
+# If defined, login failures will be logged here in a utmp format.
+# last, when invoked as lastb, will read /var/log/btmp, so...
+#
+#FTMP_FILE /var/log/btmp
+
+#
+# If defined, name of file whose presence which will inhibit non-root
+# logins. The contents of this file should be a message indicating
+# why logins are inhibited.
+#
+#NOLOGINS_FILE /etc/nologin
+
+#
+# If defined, the command name to display when running "su -". For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su". If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME su
+
+#
+# *REQUIRED*
+# Directory where mailboxes reside, _or_ name of file, relative to the
+# home directory. If you _do_ define both, #MAIL_DIR takes precedence.
+#
+#MAIL_DIR /var/spool/mail
+MAIL_FILE .mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence. If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file. If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE .hushlogin
+#HUSHLOGIN_FILE /etc/hushlogins
+
+#
+# If defined, either a TZ environment parameter spec or the
+# fully-rooted pathname of a file containing such a spec.
+#
+#ENV_TZ TZ=CST6CDT
+#ENV_TZ /etc/tzname
+
+#
+# If defined, an HZ environment parameter spec.
+#
+# for Linux/x86
+#ENV_HZ HZ=100
+# For Linux/Alpha...
+#ENV_HZ HZ=1024
+
+#
+# *REQUIRED* The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+# TTYGROUP Login tty will be assigned this group ownership.
+# TTYPERM Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP tty
+TTYPERM 0600
+
+#
+# Login configuration initializations:
+#
+# ERASECHAR Terminal ERASE character ('\010' = backspace).
+# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
+# ULIMIT Default "ulimit" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR 0177
+KILLCHAR 025
+#ULIMIT 2097152
+
+# Default initial "umask" value for non-PAM enabled systems.
+# UMASK is also used by useradd and newusers to set the mode of new home
+# directories.
+# 022 is the default value, but 027, or even 077, could be considered
+# better for privacy. There is no One True Answer here: each sysadmin
+# must make up her mind.
+UMASK 022
+
+#
+# Password aging controls:
+#
+# PASS_MAX_DAYS Maximum number of days a password may be used.
+# PASS_MIN_DAYS Minimum number of days allowed between password changes.
+# PASS_MIN_LEN Minimum acceptable password length.
+# PASS_WARN_AGE Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS 99999
+PASS_MIN_DAYS 0
+#PASS_MIN_LEN 5
+PASS_WARN_AGE 7
+
+#
+# If "yes", the user must be listed as a member of the first gid 0 group
+# in /etc/group (called "root" on most Linux systems) to be able to "su"
+# to uid 0 accounts. If the group doesn't exist or is empty, no one
+# will be able to "su" to uid 0.
+#
+#SU_WHEEL_ONLY no
+
+#
+# If compiled with cracklib support, where are the dictionaries
+#
+#CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN 1000
+UID_MAX 60000
+# System accounts
+SYS_UID_MIN 101
+SYS_UID_MAX 999
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN 1000
+GID_MAX 60000
+# System accounts
+SYS_GID_MIN 101
+SYS_GID_MAX 999
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES 5
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT 60
+
+#
+# Maximum number of attempts to change password if rejected (too easy)
+#
+#PASS_CHANGE_TRIES 5
+
+#
+# Warn about weak passwords (but still allow them) if you are root.
+#
+#PASS_ALWAYS_WARN yes
+
+#
+# Number of significant characters in the password for crypt().
+# Default is 8, don't change unless your crypt() is better.
+# Ignored if MD5_CRYPT_ENAB set to "yes".
+#
+#PASS_MAX_LEN 8
+
+#
+# Require password before chfn/chsh can make any changes.
+#
+#CHFN_AUTH yes
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone). If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+#
+CHFN_RESTRICT rwh
+
+#
+# Password prompt (%s will be replaced by user name).
+#
+# XXX - it doesn't work correctly yet, for now leave it commented out
+# to use the default which is just "Password: ".
+#LOGIN_STRING "%s's Password: "
+
+#
+# Only works if compiled with MD5_CRYPT defined:
+# If set to "yes", new passwords will be encrypted using the MD5-based
+# algorithm compatible with the one used by recent releases of FreeBSD.
+# It supports passwords of unlimited length and longer salt strings.
+# Set to "no" if you need to copy encrypted passwords to other systems
+# which don't understand the new algorithm. Default is "no".
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+# This variable is deprecated. You should use ENCRYPT_METHOD.
+#
+#MD5_CRYPT_ENAB no
+
+#
+# Only works if compiled with ENCRYPTMETHOD_SELECT defined:
+# If set to MD5 , MD5-based algorithm will be used for encrypting password
+# If set to SHA256, SHA256-based algorithm will be used for encrypting password
+# If set to SHA512, SHA512-based algorithm will be used for encrypting password
+# If set to DES, DES-based algorithm will be used for encrypting password (default)
+# Overrides the MD5_CRYPT_ENAB option
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+#ENCRYPT_METHOD DES
+
+#
+# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
+#
+# Define the number of SHA rounds.
+# With a lot of rounds, it is more difficult to brute forcing the password.
+# But note also that it more CPU resources will be needed to authenticate
+# users.
+#
+# If not specified, the libc will choose the default number of rounds (5000).
+# The values must be inside the 1000-999999999 range.
+# If only one of the MIN or MAX values is set, then this value will be used.
+# If MIN > MAX, the highest value will be used.
+#
+# SHA_CRYPT_MIN_ROUNDS 5000
+# SHA_CRYPT_MAX_ROUNDS 5000
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting). Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME yes
+
+#
+# If this file exists and is readable, login environment will be
+# read from it. Every line should be in the form name=value.
+#
+#ENVIRON_FILE /etc/environment
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD /usr/sbin/userdel_local
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
+#
+# If set to a non-nul number, the shadow utilities will make sure that
+# groups never have more than this number of users on one line.
+# This permit to support split groups (groups split into multiple lines,
+# with the same group ID, to avoid limitation of the line length in the
+# group file).
+#
+# 0 is the default value and disables this feature.
+#
+#MAX_MEMBERS_PER_GROUP 0
+
+#
+# If useradd should create home directories for users by default (non
+# system users only)
+# This option is overridden with the -M or -m flags on the useradd command
+# line.
+#
+CREATE_HOME yes
+
diff --git a/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed b/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed
new file mode 100644
index 000000000..0a1f3be4a
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/login_defs_pam.sed
@@ -0,0 +1,32 @@
+/^FAILLOG_ENAB/b comment
+/^LASTLOG_ENAB/b comment
+/^MAIL_CHECK_ENAB/b comment
+/^OBSCURE_CHECKS_ENAB/b comment
+/^PORTTIME_CHECKS_ENAB/b comment
+/^QUOTAS_ENAB/b comment
+/^MOTD_FILE/b comment
+/^FTMP_FILE/b comment
+/^NOLOGINS_FILE/b comment
+/^ENV_HZ/b comment
+/^ENV_TZ/b comment
+/^PASS_MIN_LEN/b comment
+/^SU_WHEEL_ONLY/b comment
+/^CRACKLIB_DICTPATH/b comment
+/^PASS_CHANGE_TRIES/b comment
+/^PASS_ALWAYS_WARN/b comment
+/^PASS_MAX_LEN/b comment
+/^PASS_MIN_LEN/b comment
+/^CHFN_AUTH/b comment
+/^CHSH_AUTH/b comment
+/^ISSUE_FILE/b comment
+/^LOGIN_STRING/b comment
+/^ULIMIT/b comment
+/^ENVIRON_FILE/b comment
+
+b exit
+
+: comment
+ s:^:#:
+
+: exit
+
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chfn b/poky/meta/recipes-extended/shadow/files/pam.d/chfn
new file mode 100644
index 000000000..baf7698bb
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/chfn
@@ -0,0 +1,14 @@
+#
+# The PAM configuration file for the Shadow `chfn' service
+#
+
+# This allows root to change user infomation without being
+# prompted for a password
+auth sufficient pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd b/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd
new file mode 100644
index 000000000..9e3efa68b
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/chpasswd
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'chpasswd' service
+#
+
+password include common-password
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/chsh b/poky/meta/recipes-extended/shadow/files/pam.d/chsh
new file mode 100644
index 000000000..8fb169f64
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/chsh
@@ -0,0 +1,19 @@
+#
+# The PAM configuration file for the Shadow `chsh' service
+#
+
+# This will not allow a user to change their shell unless
+# their current one is listed in /etc/shells. This keeps
+# accounts with special shells from changing them.
+auth required pam_shells.so
+
+# This allows root to change user shell without being
+# prompted for a password
+auth sufficient pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/login b/poky/meta/recipes-extended/shadow/files/pam.d/login
new file mode 100644
index 000000000..b34005853
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/login
@@ -0,0 +1,81 @@
+#
+# The PAM configuration file for the Shadow `login' service
+#
+
+# Enforce a minimal delay in case of failure (in microseconds).
+# (Replaces the `FAIL_DELAY' setting from login.defs)
+# Note that other modules may require another minimal delay. (for example,
+# to disable any delay, you should add the nodelay option to pam_unix)
+auth optional pam_faildelay.so delay=3000000
+
+# Outputs an issue file prior to each login prompt (Replaces the
+# ISSUE_FILE option from login.defs). Uncomment for use
+# auth required pam_issue.so issue=/etc/issue
+
+# Disallows root logins except on tty's listed in /etc/securetty
+# (Replaces the `CONSOLE' setting from login.defs)
+# Note that it is included as a "requisite" module. No password prompts will
+# be displayed if this module fails to avoid having the root password
+# transmitted on unsecure ttys.
+# You can change it to a "required" module if you think it permits to
+# guess valid user names of your system (invalid user names are considered
+# as possibly being root).
+auth [success=ok ignore=ignore user_unknown=ignore default=die] pam_securetty.so
+
+# Disallows other than root logins when /etc/nologin exists
+# (Replaces the `NOLOGINS_FILE' option from login.defs)
+auth requisite pam_nologin.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+#
+# parsing /etc/environment needs "readenv=1"
+session required pam_env.so readenv=1
+
+# Standard Un*x authentication.
+auth include common-auth
+
+# This allows certain extra groups to be granted to a user
+# based on things like time of day, tty, service, and user.
+# Please edit /etc/security/group.conf to fit your needs
+# (Replaces the `CONSOLE_GROUPS' option in login.defs)
+auth optional pam_group.so
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on logins.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account requisite pam_time.so
+
+# Uncomment and edit /etc/security/access.conf if you need to
+# set access limits.
+# (Replaces /etc/login.access file)
+# account required pam_access.so
+
+# Sets up user limits according to /etc/security/limits.conf
+# (Replaces the use of /etc/limits in old login)
+session required pam_limits.so
+
+# Prints the last login info upon succesful login
+# (Replaces the `LASTLOG_ENAB' option from login.defs)
+session optional pam_lastlog.so
+
+# Prints the motd upon succesful login
+# (Replaces the `MOTD_FILE' option in login.defs)
+session optional pam_motd.so
+
+# Prints the status of the user's mailbox upon succesful login
+# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).
+#
+# This also defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+session optional pam_mail.so standard
+
+# Standard Un*x account and session
+account include common-account
+password include common-password
+session include common-session
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/newusers b/poky/meta/recipes-extended/shadow/files/pam.d/newusers
new file mode 100644
index 000000000..4aa3dde48
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/newusers
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'newusers' service
+#
+
+password include common-password
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/passwd b/poky/meta/recipes-extended/shadow/files/pam.d/passwd
new file mode 100644
index 000000000..f53499243
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/passwd
@@ -0,0 +1,5 @@
+#
+# The PAM configuration file for the Shadow `passwd' service
+#
+
+password include common-password
diff --git a/poky/meta/recipes-extended/shadow/files/pam.d/su b/poky/meta/recipes-extended/shadow/files/pam.d/su
new file mode 100644
index 000000000..8d590a32e
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/pam.d/su
@@ -0,0 +1,57 @@
+#
+# The PAM configuration file for the Shadow `su' service
+#
+
+# This allows root to su without passwords (normal operation)
+auth sufficient pam_rootok.so
+
+# Uncomment this to force users to be a member of group root
+# before they can use `su'. You can also add "group=foo"
+# to the end of this line if you want to use a group other
+# than the default "root" (but this may have side effect of
+# denying "root" user, unless she's a member of "foo" or explicitly
+# permitted earlier by e.g. "sufficient pam_rootok.so").
+# (Replaces the `SU_WHEEL_ONLY' option from login.defs)
+# auth required pam_wheel.so
+
+# Uncomment this if you want wheel members to be able to
+# su without a password.
+# auth sufficient pam_wheel.so trust
+
+# Uncomment this if you want members of a specific group to not
+# be allowed to use su at all.
+# auth required pam_wheel.so deny group=nosu
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on su usage.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account requisite pam_time.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+#
+# parsing /etc/environment needs "readenv=1"
+session required pam_env.so readenv=1
+
+# Defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+#
+# "nopen" stands to avoid reporting new mail when su'ing to another user
+session optional pam_mail.so nopen
+
+# Sets up user limits, please uncomment and read /etc/security/limits.conf
+# to enable this functionality.
+# (Replaces the use of /etc/limits in old login)
+# session required pam_limits.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/poky/meta/recipes-extended/shadow/files/securetty b/poky/meta/recipes-extended/shadow/files/securetty
new file mode 100644
index 000000000..2be341a21
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/securetty
@@ -0,0 +1,238 @@
+# /etc/securetty: list of terminals on which root is allowed to login.
+# See securetty(5) and login(1).
+console
+
+# Standard serial ports
+ttyS0
+ttyS1
+ttyS2
+ttyS3
+
+# ARM AMBA SoCs
+ttyAM0
+ttyAM1
+ttyAM2
+ttyAM3
+ttyAMA0
+ttyAMA1
+ttyAMA2
+ttyAMA3
+
+# QCOM Socs
+ttyHSL0
+ttyHSL1
+ttyHSL2
+ttyHSL3
+ttyMSM0
+ttyMSM1
+ttyMSM2
+
+# Samsung ARM SoCs
+ttySAC0
+ttySAC1
+ttySAC2
+ttySAC3
+
+# STM SoCs
+ttyAS0
+ttyAS1
+ttyAS2
+ttyAS3
+
+# TI OMAP SoCs
+ttyO0
+ttyO1
+ttyO2
+ttyO3
+
+# Xilinx Zynq SoC
+ttyPS0
+ttyPS1
+
+# USB dongles
+ttyUSB0
+ttyUSB1
+ttyUSB2
+
+# USB serial gadget
+ttyGS0
+
+# PowerMac
+ttyPZ0
+ttyPZ1
+ttyPZ2
+ttyPZ3
+
+# Embedded MPC platforms
+ttyPSC0
+ttyPSC1
+ttyPSC2
+ttyPSC3
+ttyPSC4
+ttyPSC5
+
+# PA-RISC mux ports
+ttyB0
+ttyB1
+
+# Standard hypervisor virtual console
+hvc0
+
+# Oldstyle Xen console
+xvc0
+
+# Standard consoles
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+tty7
+tty8
+tty9
+tty10
+tty11
+tty12
+tty13
+tty14
+tty15
+tty16
+tty17
+tty18
+tty19
+tty20
+tty21
+tty22
+tty23
+tty24
+tty25
+tty26
+tty27
+tty28
+tty29
+tty30
+tty31
+tty32
+tty33
+tty34
+tty35
+tty36
+tty37
+tty38
+tty39
+tty40
+tty41
+tty42
+tty43
+tty44
+tty45
+tty46
+tty47
+tty48
+tty49
+tty50
+tty51
+tty52
+tty53
+tty54
+tty55
+tty56
+tty57
+tty58
+tty59
+tty60
+tty61
+tty62
+tty63
+
+# Local X displays (allows empty passwords with pam_unix's nullok_secure)
+pts/0
+pts/1
+pts/2
+pts/3
+
+# Embedded Freescale i.MX ports
+ttymxc0
+ttymxc1
+ttymxc2
+ttymxc3
+ttymxc4
+ttymxc5
+
+# Freescale lpuart ports
+ttyLP0
+ttyLP1
+ttyLP2
+ttyLP3
+ttyLP4
+ttyLP5
+
+# Standard serial ports, with devfs
+tts/0
+tts/1
+
+# Standard consoles, with devfs
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+vc/9
+vc/10
+vc/11
+vc/12
+vc/13
+vc/14
+vc/15
+vc/16
+vc/17
+vc/18
+vc/19
+vc/20
+vc/21
+vc/22
+vc/23
+vc/24
+vc/25
+vc/26
+vc/27
+vc/28
+vc/29
+vc/30
+vc/31
+vc/32
+vc/33
+vc/34
+vc/35
+vc/36
+vc/37
+vc/38
+vc/39
+vc/40
+vc/41
+vc/42
+vc/43
+vc/44
+vc/45
+vc/46
+vc/47
+vc/48
+vc/49
+vc/50
+vc/51
+vc/52
+vc/53
+vc/54
+vc/55
+vc/56
+vc/57
+vc/58
+vc/59
+vc/60
+vc/61
+vc/62
+vc/63
diff --git a/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
new file mode 100644
index 000000000..a7bb0a929
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
@@ -0,0 +1,27 @@
+# commit message copied from openembedded:
+# commit 246c80637b135f3a113d319b163422f98174ee6c
+# Author: Khem Raj <raj.khem@gmail.com>
+# Date: Wed Jun 9 13:37:03 2010 -0700
+#
+# shadow-4.1.4.2: Add patches to support dots in login id.
+#
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+#
+# comment added by Kevin Tian <kevin.tian@intel.com>, 2010-08-11
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: shadow-4.1.4.2/libmisc/chkname.c
+===================================================================
+--- shadow-4.1.4.2.orig/libmisc/chkname.c 2009-04-28 12:14:04.000000000 -0700
++++ shadow-4.1.4.2/libmisc/chkname.c 2010-06-03 17:43:20.638973857 -0700
+@@ -61,6 +61,7 @@ static bool is_valid_name (const char *n
+ ( ('0' <= *name) && ('9' >= *name) ) ||
+ ('_' == *name) ||
+ ('-' == *name) ||
++ ('.' == *name) ||
+ ( ('$' == *name) && ('\0' == *(name + 1)) )
+ )) {
+ return false;
diff --git a/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
new file mode 100644
index 000000000..1af04d5fe
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/shadow-relaxed-usernames.patch
@@ -0,0 +1,100 @@
+
+The groupadd from shadow does not allow upper case group names, the
+same is true for the upstream shadow. But distributions like
+Debian/Ubuntu/CentOS has their own way to cope with this problem,
+this patch is picked up from CentOS release 7.0 to relax the usernames
+restrictions to allow the upper case group names, and the relaxation is
+POSIX compliant because POSIX indicate that usernames are composed of
+characters from the portable filename character set [A-Za-z0-9._-].
+
+Upstream-Status: Pending
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+
+diff -urpN a/libmisc/chkname.c b/libmisc/chkname.c
+index 5089112..f40a0da 100644
+--- a/libmisc/chkname.c
++++ b/libmisc/chkname.c
+@@ -49,21 +49,28 @@
+ static bool is_valid_name (const char *name)
+ {
+ /*
+- * User/group names must match [a-z_][a-z0-9_-]*[$]
+- */
+- if (('\0' == *name) ||
+- !((('a' <= *name) && ('z' >= *name)) || ('_' == *name))) {
++ * User/group names must match gnu e-regex:
++ * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?
++ *
++ * as a non-POSIX, extension, allow "$" as the last char for
++ * sake of Samba 3.x "add machine script"
++ */
++ if ( ('\0' == *name) ||
++ !((*name >= 'a' && *name <= 'z') ||
++ (*name >= 'A' && *name <= 'Z') ||
++ (*name >= '0' && *name <= '9') ||
++ (*name == '_') || (*name == '.')
++ )) {
+ return false;
+ }
+
+ while ('\0' != *++name) {
+- if (!(( ('a' <= *name) && ('z' >= *name) ) ||
+- ( ('0' <= *name) && ('9' >= *name) ) ||
+- ('_' == *name) ||
+- ('-' == *name) ||
+- ('.' == *name) ||
+- ( ('$' == *name) && ('\0' == *(name + 1)) )
+- )) {
++ if (!( (*name >= 'a' && *name <= 'z') ||
++ (*name >= 'A' && *name <= 'Z') ||
++ (*name >= '0' && *name <= '9') ||
++ (*name == '_') || (*name == '.') || (*name == '-') ||
++ (*name == '$' && *(name + 1) == '\0')
++ )) {
+ return false;
+ }
+ }
+diff -urpN a/man/groupadd.8.xml b/man/groupadd.8.xml
+index 230fd0c..94f7807 100644
+--- a/man/groupadd.8.xml
++++ b/man/groupadd.8.xml
+@@ -222,12 +222,6 @@
+ <refsect1 id='caveats'>
+ <title>CAVEATS</title>
+ <para>
+- Groupnames must start with a lower case letter or an underscore,
+- followed by lower case letters, digits, underscores, or dashes.
+- They can end with a dollar sign.
+- In regular expression terms: [a-z_][a-z0-9_-]*[$]?
+- </para>
+- <para>
+ Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
+ </para>
+ <para>
+diff -urpN a/man/useradd.8.xml b/man/useradd.8.xml
+index 5dec989..fe623b9 100644
+--- a/man/useradd.8.xml
++++ b/man/useradd.8.xml
+@@ -336,7 +336,7 @@
+ </term>
+ <listitem>
+ <para>
+- Do no create the user's home directory, even if the system
++ Do not create the user's home directory, even if the system
+ wide setting from <filename>/etc/login.defs</filename>
+ (<option>CREATE_HOME</option>) is set to
+ <replaceable>yes</replaceable>.
+@@ -607,12 +607,6 @@
+ </para>
+
+ <para>
+- Usernames must start with a lower case letter or an underscore,
+- followed by lower case letters, digits, underscores, or dashes.
+- They can end with a dollar sign.
+- In regular expression terms: [a-z_][a-z0-9_-]*[$]?
+- </para>
+- <para>
+ Usernames may only be up to 32 characters long.
+ </para>
+ </refsect1>
diff --git a/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
new file mode 100644
index 000000000..15f8044fa
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
@@ -0,0 +1,91 @@
+The system-auth in the configure files is from Fedora which put all the 4 pam type rules
+in one file.
+In yocto it obey the way with Debian/Ubuntu, and the names are common-auth, common-account,
+common-password and common-session.
+So update them with oe way.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chage shadow-4.1.4.3/etc/pam.d/chage
+--- shadow-4.1.4.3/etc/pam.d.orig/chage 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chage 2011-07-20 19:03:08.964844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chgpasswd shadow-4.1.4.3/etc/pam.d/chgpasswd
+--- shadow-4.1.4.3/etc/pam.d.orig/chgpasswd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chgpasswd 2011-07-20 19:03:26.544844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupadd shadow-4.1.4.3/etc/pam.d/groupadd
+--- shadow-4.1.4.3/etc/pam.d.orig/groupadd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupadd 2011-07-20 19:04:08.124844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupdel shadow-4.1.4.3/etc/pam.d/groupdel
+--- shadow-4.1.4.3/etc/pam.d.orig/groupdel 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupdel 2011-07-20 19:04:26.114844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmems shadow-4.1.4.3/etc/pam.d/groupmems
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmems 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmems 2011-07-20 19:04:35.074844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmod shadow-4.1.4.3/etc/pam.d/groupmod
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmod 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmod 2011-07-20 19:04:44.864844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/useradd shadow-4.1.4.3/etc/pam.d/useradd
+--- shadow-4.1.4.3/etc/pam.d.orig/useradd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/useradd 2011-07-20 19:07:26.244844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/userdel shadow-4.1.4.3/etc/pam.d/userdel
+--- shadow-4.1.4.3/etc/pam.d.orig/userdel 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/userdel 2011-07-20 19:07:35.734844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/usermod shadow-4.1.4.3/etc/pam.d/usermod
+--- shadow-4.1.4.3/etc/pam.d.orig/usermod 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/usermod 2011-07-20 19:07:42.024844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
diff --git a/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch b/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..37dc153fc
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+usermod: fix compilation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/usermod.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..685b50a 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -1360,7 +1360,7 @@ static void process_flags (int argc, char **argv)
+ Prog, (unsigned long) user_newid);
+ exit (E_UID_IN_USE);
+ }
+-
++#ifdef ENABLE_SUBIDS
+ if ( (vflg || Vflg)
+ && !is_sub_uid) {
+ fprintf (stderr,
+@@ -1376,6 +1376,7 @@ static void process_flags (int argc, char **argv)
+ Prog, sub_gid_dbname (), "-w", "-W");
+ exit (E_USAGE);
+ }
++#endif
+ }
+
+ /*
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
new file mode 100644
index 000000000..c78f888cf
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Provider of the machine specific securetty file"
+SECTION = "base utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PR = "r3"
+
+SRC_URI = "file://securetty"
+
+S = "${WORKDIR}"
+
+# Since SERIAL_CONSOLES is likely to be set from the machine configuration
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install () {
+ # Ensure we add a suitable securetty file to the package that has
+ # most common embedded TTYs defined.
+ install -d ${D}${sysconfdir}
+ install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
+ if [ ! -z "${SERIAL_CONSOLES}" ]; then
+ # Our SERIAL_CONSOLES contains a baud rate and sometimes extra
+ # options as well. The following pearl :) takes that and converts
+ # it into newline-separated tty's and appends them into
+ # securetty. So if a machine has a weird looking console device
+ # node (e.g. ttyAMA0) that securetty does not know, it will get
+ # appended to securetty and root logins will be allowed on that
+ # console.
+ tmp="${SERIAL_CONSOLES}"
+ for entry in $tmp ; do
+ ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+ if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then
+ echo $ttydev >> ${D}${sysconfdir}/securetty
+ fi
+ done
+ fi
+}
diff --git a/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
new file mode 100644
index 000000000..ef014628f
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Shadow utils requirements for useradd.bbclass"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://login.defs_shadow-sysroot;md5=25e2f2de4dfc8f966ac5cdfce45cd7d5"
+
+DEPENDS = "base-passwd"
+
+PR = "r3"
+
+# The sole purpose of this recipe is to provide the /etc/login.defs
+# file for the target sysroot - needed so the shadow-native utilities
+# can add custom users/groups for recipes that use inherit useradd.
+SRC_URI = "file://login.defs_shadow-sysroot"
+
+SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
+SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -p -m 644 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
+}
+
+SYSROOT_DIRS += "${sysconfdir}"
+
+# don't create any packages
+# otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot
+# and this has another copy of /etc/login.defs already provided by shadow
+PACKAGES = ""
diff --git a/poky/meta/recipes-extended/shadow/shadow.inc b/poky/meta/recipes-extended/shadow/shadow.inc
new file mode 100644
index 000000000..673207fc9
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/shadow.inc
@@ -0,0 +1,201 @@
+SUMMARY = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base/utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \
+ file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
+
+DEPENDS = "virtual/crypt"
+
+SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.xz \
+ file://shadow-4.1.3-dots-in-usernames.patch \
+ file://usermod-fix-compilation-failure-with-subids-disabled.patch \
+ file://fix-installation-failure-with-subids-disabled.patch \
+ file://0001-Do-not-read-login.defs-before-doing-chroot.patch \
+ file://check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch \
+ file://0001-useradd-copy-extended-attributes-of-home.patch \
+ file://0001-shadow-CVE-2017-12424 \
+ ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
+ "
+
+SRC_URI_append_class-target = " \
+ file://login_defs_pam.sed \
+ file://shadow-update-pam-conf.patch \
+ file://shadow-relaxed-usernames.patch \
+ "
+
+SRC_URI_append_class-native = " \
+ file://0001-Disable-use-of-syslog-for-sysroot.patch \
+ file://allow-for-setting-password-in-clear-text.patch \
+ file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+ file://0001-useradd.c-create-parent-directories-when-necessary.patch \
+ "
+SRC_URI_append_class-nativesdk = " \
+ file://0001-Disable-use-of-syslog-for-sysroot.patch \
+ "
+
+SRC_URI[md5sum] = "2bfafe7d4962682d31b5eba65dba4fc8"
+SRC_URI[sha256sum] = "3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41"
+
+# Additional Policy files for PAM
+PAM_SRC_URI = "file://pam.d/chfn \
+ file://pam.d/chpasswd \
+ file://pam.d/chsh \
+ file://pam.d/login \
+ file://pam.d/newusers \
+ file://pam.d/passwd \
+ file://pam.d/su"
+
+inherit autotools gettext
+
+EXTRA_OECONF += "--without-audit \
+ --without-libcrack \
+ --without-selinux \
+ --with-group-name-max-length=24 \
+ --enable-subordinate-ids=yes \
+ ${NSCDOPT}"
+
+NSCDOPT = ""
+NSCDOPT_class-native = "--without-nscd"
+NSCDOPT_class-nativesdk = "--without-nscd"
+NSCDOPT_libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'libc-spawn', '--with-nscd', '--without-nscd', d)}"
+
+PAM_PLUGINS = "libpam-runtime \
+ pam-plugin-faildelay \
+ pam-plugin-securetty \
+ pam-plugin-nologin \
+ pam-plugin-env \
+ pam-plugin-group \
+ pam-plugin-limits \
+ pam-plugin-lastlog \
+ pam-plugin-motd \
+ pam-plugin-mail \
+ pam-plugin-shells \
+ pam-plugin-rootok"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG_class-native ??= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG_class-nativesdk = ""
+PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+
+RDEPENDS_${PN} = "shadow-securetty \
+ base-passwd \
+ util-linux-sulogin"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+do_install() {
+ oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
+
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ # Enable CREATE_HOME by default.
+ sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+ # As we are on an embedded system, ensure the users mailbox is in
+ # ~/ not /var/spool/mail by default, as who knows where or how big
+ # /var is. The system MDA will set this later anyway.
+ sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+ sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+ # Disable checking emails.
+ sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+ # Comment out SU_NAME to work correctly with busybox
+ # See Bug#5359 and Bug#7173
+ sed -i 's:^SU_NAME:#SU_NAME:g' ${D}${sysconfdir}/login.defs
+
+ # Use proper encryption for passwords
+ sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs
+
+ # Now we don't have a mail system. Disable mail creation for now.
+ sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+ sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+ # Use users group by default
+ sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
+}
+
+do_install_append() {
+ # Ensure that the image has as a /var/spool/mail dir so shadow can
+ # put mailboxes there if the user reconfigures shadow to its
+ # defaults (see sed below).
+ install -d ${D}${localstatedir}/spool/mail
+
+ if [ -e ${WORKDIR}/pam.d ]; then
+ install -d ${D}${sysconfdir}/pam.d/
+ install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+ # Remove defaults that are not used when supporting PAM.
+ sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
+ fi
+
+ install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir}
+
+ # Move binaries to the locations we want
+ rm ${D}${sbindir}/vigr
+ ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr
+ if [ "${sbindir}" != "${base_sbindir}" ]; then
+ mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw
+ fi
+ if [ "${bindir}" != "${base_bindir}" ]; then
+ mv ${D}${bindir}/login ${D}${base_bindir}/login
+ mv ${D}${bindir}/su ${D}${base_bindir}/su
+ fi
+
+ # Handle link properly after rename, otherwise missing files would
+ # lead rpm failed dependencies.
+ ln -sf newgrp.${BPN} ${D}${bindir}/sg
+}
+
+PACKAGES =+ "${PN}-base"
+FILES_${PN}-base = "\
+ ${base_bindir}/login.shadow \
+ ${base_bindir}/su.shadow \
+ ${bindir}/sg \
+ ${bindir}/newgrp.shadow \
+ ${bindir}/groups.shadow \
+ ${sysconfdir}/pam.d/login \
+ ${sysconfdir}/pam.d/su \
+ ${sysconfdir}/login.defs \
+"
+RDEPENDS_${PN} += "${PN}-base"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
+ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
+ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
+ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
+
+ALTERNATIVE_${PN}-base = "newgrp groups login su"
+ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
+ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+
+ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1 su.1 nologin.8"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
+ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
+
+PACKAGE_WRITE_DEPS += "shadow-native"
+pkg_postinst_${PN}_class-target () {
+ if [ "x$D" != "x" ]; then
+ rootarg="--root $D"
+ else
+ rootarg=""
+ fi
+
+ pwconv $rootarg || exit 1
+ grpconv $rootarg || exit 1
+}
diff --git a/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb b/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb
new file mode 100644
index 000000000..5675cb8cc
--- /dev/null
+++ b/poky/meta/recipes-extended/shadow/shadow_4.2.1.bb
@@ -0,0 +1,10 @@
+require shadow.inc
+
+# Build falsely assumes that if --enable-libpam is set, we don't need to link against
+# libcrypt. This breaks chsh.
+BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', bb.utils.contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+
+
diff --git a/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch b/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch
new file mode 100644
index 000000000..42dba0fae
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang/dont-link-to-host.patch
@@ -0,0 +1,16 @@
+SLANG_INST_LIB is the location of where slang will end up, but when building for
+packaging this doesn't have DESTDIR appended so can potentially link to the host
+for cross builds and will trigger QA errors.
+
+As this is obviously wrong, delete it.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/slsh/Makefile.in b/slsh/Makefile.in
+index cba9d81..4c1c370 100644
+--- a/slsh/Makefile.in
++++ b/slsh/Makefile.in
+@@ -80 +80 @@ SHELL = /bin/sh
+-INST_LIBS = $(DEST_LIB_DIR) $(RPATH) $(SLANG_INST_LIB) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
++INST_LIBS = $(DEST_LIB_DIR) $(RPATH) -lslang $(READLINE_LIB) $(DYNAMIC_LIBS)
diff --git a/poky/meta/recipes-extended/slang/slang/no-x.patch b/poky/meta/recipes-extended/slang/slang/no-x.patch
new file mode 100644
index 000000000..7dc1602fe
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang/no-x.patch
@@ -0,0 +1,18 @@
+There's no need to check for the X libraries as the socket module doesn't use
+anything from X.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/autoconf/configure.ac b/autoconf/configure.ac
+index b61e974..a3e5db2 100644
+--- a/autoconf/configure.ac
++++ b/autoconf/configure.ac
+@@ -72,3 +71,0 @@ AC_SUBST(LIB_READLINE)
+-# For the socket module
+-AC_PATH_XTRA
+-
+--- a/modules/Makefile.in
++++ b/modules/Makefile.in
+@@ -67 +66,0 @@ ZLIB_LIB = @Z_LIB@ -lz
+-SOCKET_LIBS = @X_EXTRA_LIBS@
diff --git a/poky/meta/recipes-extended/slang/slang/run-ptest b/poky/meta/recipes-extended/slang/slang/run-ptest
new file mode 100644
index 000000000..39f474af3
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C test runtests
diff --git a/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch b/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch
new file mode 100644
index 000000000..3e6d15aa7
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang/terminfo_fixes.patch
@@ -0,0 +1,148 @@
+Do not use the JD_TERMCAP macro since we cannot get the terminfo from
+ncurses pkg-config, but fix the macro to not reference host directories.
+Also add src/test/Makefile.in so that we can use -ltermcap if we want to.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/autoconf/aclocal.m4
++++ b/autoconf/aclocal.m4
+@@ -506,14 +506,10 @@ then
+ else
+ MISC_TERMINFO_DIRS=""
+ fi
+-JD_Terminfo_Dirs="$MISC_TERMINFO_DIRS \
+- /usr/lib/terminfo \
+- /usr/share/terminfo \
+- /usr/share/lib/terminfo \
+- /usr/local/lib/terminfo"
++
+ TERMCAP=-ltermcap
+
+-for terminfo_dir in $JD_Terminfo_Dirs
++for terminfo_dir in $MISC_TERMINFO_DIRS
+ do
+ if test -d $terminfo_dir
+ then
+--- a/autoconf/configure.ac
++++ b/autoconf/configure.ac
+@@ -249,7 +249,14 @@ AC_CHECK_SIZEOF(size_t)
+ JD_CHECK_LONG_LONG
+ JD_LARGE_FILE_SUPPORT
+
+-JD_TERMCAP
++dnl Do not use JD_TERMCAP, since we cannot get terminfo from ncurses*-config anymore.
++dnl Set TERMCAP=-ltermcap and AC_DEFINE(USE_TERMCAP,1,[Define to use termcap])
++dnl to use libtermcap.
++TERMCAP=""
++MISC_TERMINFO_DIRS=""
++AC_SUBST(TERMCAP)dnl
++AC_SUBST(MISC_TERMINFO_DIRS)dnl
++
+ JD_GCC_WARNINGS
+
+ JD_SET_OBJ_SRC_DIR(src)
+@@ -364,7 +371,7 @@ AC_CONFIG_HEADER(src/sysconf.h:src/confi
+ dnl AC_CONFIG_SUBDIRS(demo)
+
+ AC_OUTPUT(Makefile:autoconf/Makefile.in \
+- src/Makefile slsh/Makefile modules/Makefile demo/Makefile \
++ src/Makefile src/test/Makefile slsh/Makefile modules/Makefile demo/Makefile \
+ slang.pc:autoconf/slangpc.in \
+ )
+
+--- /dev/null
++++ b/src/test/Makefile.in
+@@ -0,0 +1,90 @@
++# -*- make -*-
++TEST_SCRIPTS_SLC = argv syntax scircuit eqs sscanf loops arith array strops \
++ bstring pack stdio assoc selfload struct nspace path ifeval anytype arrmult \
++ time utf8 except bugs list regexp method deref naninf overflow sort \
++ longlong signal dollar req docfun debug qualif compare break multline \
++ stack misc posixio posdir proc math
++
++TEST_SCRIPTS_NO_SLC = autoload nspace2 prep
++
++TEST_SCRIPTS = $(TEST_SCRIPTS_SLC) $(TEST_SCRIPTS_NO_SLC)
++
++TEST_PGM = sltest
++MEMCHECK = valgrind --tool=memcheck --leak-check=yes --leak-resolution=med --num-callers=20
++RUN_TEST_PGM = ./$(TEST_PGM)
++SLANGINC = ..
++SLANGLIB = ../$(ARCH)objs
++OTHER_LIBS = -lm @TERMCAP@
++OTHER_CFLAGS =
++
++runtests: $(TEST_PGM) cleantmp
++ @tests=""; \
++ for test in $(TEST_SCRIPTS); \
++ do \
++ tests="$$tests $$test.sl"; \
++ done; \
++ for test in $(TEST_SCRIPTS_SLC); \
++ do \
++ tests="$$tests $$test.slc"; \
++ done; \
++ MAKERUNNING=1 ./runtests.sh $$tests
++# @touch $(TEST_PGM).c
++
++update: $(TEST_PGM) cleantmp
++ @tests=""; \
++ for X in $(TEST_SCRIPTS); \
++ do \
++ if [ ! -e lastrun/$$X.sl ] || [ $$X.sl -nt lastrun/$$X.sl ] ; \
++ then \
++ tests="$$tests $$X.sl"; \
++ fi \
++ done; \
++ for X in $(TEST_SCRIPTS_SLC); \
++ do \
++ if [ ! -e lastrun/$$X.slc ] || [ $$X.sl -nt lastrun/$$X.slc ] ; \
++ then \
++ tests="$$tests $$X.slc"; \
++ fi \
++ done; \
++ if test -n "$$tests"; \
++ then \
++ MAKERUNNING=1 ./runtests.sh $$tests; \
++ fi
++# @touch $(TEST_PGM).c
++
++memcheck_runtests: $(TEST_PGM) cleantmp
++ @echo ""
++ @echo "Running tests:"
++ @echo ""
++ -@for X in $(TEST_SCRIPTS); \
++ do \
++ $(MEMCHECK) --log-file=log.$${X} $(RUN_TEST_PGM) $$X.sl; \
++ grep ERROR log.$${X}; grep 'lost: [^0]' log.$${X}; \
++ $(MEMCHECK) --log-file=log.$${X}_u $(RUN_TEST_PGM) -utf8 $$X.sl; \
++ grep ERROR log.$${X}_u; grep 'lost: [^0]' log.$${X}_u; \
++ done
++# touch $(TEST_PGM).c
++
++memcheck_runtests_slc: $(TEST_PGM) cleantmp
++ @echo ""
++ @echo "Running tests:"
++ @echo ""
++ -@for X in $(TEST_SCRIPTS_SLC); \
++ do \
++ $(MEMCHECK) --log-file=log.$${X}_c $(RUN_TEST_PGM) $$X.slc; \
++ $(MEMCHECK) --log-file=log.$${X}_uc $(RUN_TEST_PGM) -utf8 $$X.slc; \
++ done
++# touch $(TEST_PGM).c
++
++memcheck: memcheck_runtests memcheck_runtests_slc
++
++$(TEST_PGM): $(TEST_PGM).c assoc.c list.c $(SLANGLIB)/libslang.a
++ $(CC) $(CFLAGS) $(OTHER_CFLAGS) $(LDFLAGS) $(TEST_PGM).c -o $(TEST_PGM) -I$(SLANGINC) -L$(SLANGLIB) -lslang $(OTHER_LIBS)
++cleantmp:
++ -/bin/rm -rf tmpfile*.* tmpdir*.*
++clean: cleantmp
++ -/bin/rm -f *~ *.o *.log log.pid* *.slc log.* *.log-*
++distclean: clean
++ /bin/rm -f $(TEST_PGM) $(TEST_PGM).gcda $(TEST_PGM).gcno
++.PHONY: clean memcheck runtests memcheck_runtests_slc memcheck_runtests cleantmp
++
diff --git a/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch b/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch
new file mode 100644
index 000000000..27a9bb87e
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang/test-add-output-in-the-format-result-testname.patch
@@ -0,0 +1,30 @@
+From 38688ee2754415cf2a1935dafb8278861b7315e7 Mon Sep 17 00:00:00 2001
+From: Stefan Strogin <sstrogin@cisco.com>
+Date: Thu, 2 Mar 2017 00:26:31 +0200
+Subject: [PATCH] test: add output in the format "result: testname"
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
+---
+ src/test/runtests.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/test/runtests.sh b/src/test/runtests.sh
+index a3eaad0..64f0705 100755
+--- a/src/test/runtests.sh
++++ b/src/test/runtests.sh
+@@ -34,8 +34,10 @@ do
+ then
+ n_failed=`expr ${n_failed} + 1`
+ tests_failed="$tests_failed $testfile"
++ echo "FAIL: $testfile"
+ else
+ touch lastrun/$testfile
++ echo "PASS: $testfile"
+ fi
+ done
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-extended/slang/slang_2.3.2.bb b/poky/meta/recipes-extended/slang/slang_2.3.2.bb
new file mode 100644
index 000000000..87fd41af8
--- /dev/null
+++ b/poky/meta/recipes-extended/slang/slang_2.3.2.bb
@@ -0,0 +1,81 @@
+SUMMARY = "The shared library for the S-Lang extension language"
+
+DESCRIPTION = "S-Lang is an interpreted language and a programming library. The \
+S-Lang language was designed so that it can be easily embedded into \
+a program to provide the program with a powerful extension language. \
+The S-Lang library, provided in this package, provides the S-Lang \
+extension language. S-Lang's syntax resembles C, which makes it easy \
+to recode S-Lang procedures in C if you need to."
+
+HOMEPAGE = "http://www.jedsoft.org/slang/"
+SECTION = "libs"
+DEPENDS = "ncurses virtual/libiconv"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
+
+SRC_URI = "http://www.jedsoft.org/releases/${BPN}/${BP}.tar.bz2 \
+ file://no-x.patch \
+ file://dont-link-to-host.patch \
+ file://test-add-output-in-the-format-result-testname.patch \
+ file://terminfo_fixes.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "c2d5a7aa0246627da490be4e399c87cb"
+SRC_URI[sha256sum] = "fc9e3b0fc4f67c3c1f6d43c90c16a5c42d117b8e28457c5b46831b8b5d3ae31a"
+
+UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
+PREMIRRORS_append = "\n http://www.jedsoft.org/releases/slang/.* http://www.jedsoft.org/releases/slang/old/ \n"
+
+inherit autotools-brokensep ptest
+CLEANBROKEN = "1"
+
+EXTRA_OECONF = "--without-onig"
+# There's no way to turn off rpaths and slang will -rpath to the default search
+# path. Unset RPATH to stop this.
+EXTRA_OEMAKE = "RPATH=''"
+
+PACKAGECONFIG ??= "pcre"
+PACKAGECONFIG[pcre] = "--with-pcre=${STAGING_DIR_HOST}${prefix},--without-pcre,pcre"
+PACKAGECONFIG[png] = "--with-png=${STAGING_DIR_HOST}${prefix},--without-png,libpng"
+PACKAGECONFIG[zlib] = "--with-z=${STAGING_DIR_HOST}${prefix},--without-z,zlib"
+
+do_configure_prepend() {
+ cd ${S}/autoconf
+ # slang keeps configure.ac and rest of autoconf files in autoconf/ directory
+ # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac}
+ # to be present. Resulting files land in autoconf/autoconf/ so we need to move them.
+ gnu-configize --force && mv autoconf/config.* .
+ # For the same reason we also need to run autoconf manually.
+ autoconf && mv configure ..
+ cd ${B}
+}
+
+do_compile_ptest() {
+ oe_runmake -C src static
+ oe_runmake -C src/test sltest
+}
+
+do_install_ptest() {
+ mkdir ${D}${PTEST_PATH}/test
+ for f in Makefile sltest runtests.sh *.sl *.inc; do
+ cp ${S}/src/test/$f ${D}${PTEST_PATH}/test/
+ done
+ sed -e 's/\ \$(TEST_PGM)\.c\ assoc\.c\ list\.c\ \$(SLANGLIB)\/libslang\.a//' \
+ -e '/\$(CC).*(TEST_PGM)/d' \
+ -i ${D}${PTEST_PATH}/test/Makefile
+
+ cp ${S}/slsh/lib/require.sl ${D}${PTEST_PATH}/test/
+ sed -i 's/\.\.\/\.\.\/slsh\/lib\/require\.sl/require\.sl/' ${D}${PTEST_PATH}/test/req.sl
+
+ cp ${S}/doc/text/slangfun.txt ${D}${PTEST_PATH}/test/
+ sed -i 's/\.\.\/\.\.\/doc\/text\/slangfun\.txt/slangfun\.txt/' ${D}${PTEST_PATH}/test/docfun.sl
+}
+
+FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
+
+PARALLEL_MAKE = ""
+PARALLEL_MAKEINST = ""
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/stress/files/texinfo.patch b/poky/meta/recipes-extended/stress/files/texinfo.patch
new file mode 100644
index 000000000..f23a1f69c
--- /dev/null
+++ b/poky/meta/recipes-extended/stress/files/texinfo.patch
@@ -0,0 +1,80 @@
+Upstream-Status: Pending
+--- a/doc/stress.texi
++++ b/doc/stress.texi
+@@ -62,47 +62,47 @@
+
+ @table @samp
+ @item -?
+-@itemx --help
++@item --help
+ Show help information.
+
+-@itemx --version
++@item --version
+ Show version information.
+
+ @item -v
+-@itemx --verbose
++@item --verbose
+ Turn up verbosity.
+
+ @item -q
+-@itemx --quiet
++@item --quiet
+ Turn down verbosity.
+
+ @item -n
+-@itemx --dry-run
++@item --dry-run
+ Show what would have been done.
+
+ @item -t @var{secs}
+-@itemx --timeout @var{secs}
++@item --timeout @var{secs}
+ Time out after @var{secs} seconds.
+
+-@itemx --backoff @var{usecs}
++@item --backoff @var{usecs}
+ Wait for factor of @var{usecs} microseconds before starting work.
+
+ @item -c @var{forks}
+-@itemx --cpu @var{forks}
++@item --cpu @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sqrt()}.
+
+ @item -i @var{forks}
+-@itemx --io @var{forks}
++@item --io @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sync()}.
+
+ @item -m @var{forks}
+-@itemx --vm @var{forks}
++@item --vm @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{malloc()}.
+
+-@itemx --vm-bytes @var{bytes}
++@item --vm-bytes @var{bytes}
+ Allocate @var{bytes} number of bytes. The default is 1.
+
+-@itemx --vm-hang
++@item --vm-hang
+ Instruct each vm hog process to go to sleep after allocating memory. This
+ contrasts with their normal behavior, which is to free the memory and
+ reallocate @emph{ad infinitum}. This is useful for simulating low memory
+@@ -114,13 +114,13 @@
+ @end example
+
+ @item -d @var{forks}
+-@itemx --hdd @var{forks}
++@item --hdd @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{write()}.
+
+-@itemx --hdd-bytes @var{bytes}
++@item --hdd-bytes @var{bytes}
+ Write @var{bytes} number of bytes. The default is 1GB.
+
+-@itemx --hdd-noclean
++@item --hdd-noclean
+ Do not unlink file(s) to which random ASCII data is written.
+
+ @end table
diff --git a/poky/meta/recipes-extended/stress/stress_1.0.4.bb b/poky/meta/recipes-extended/stress/stress_1.0.4.bb
new file mode 100644
index 000000000..e9179d3e1
--- /dev/null
+++ b/poky/meta/recipes-extended/stress/stress_1.0.4.bb
@@ -0,0 +1,15 @@
+SUMMARY = "System load testing utility"
+DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \
+imposes a configurable amount of CPU, memory, I/O, and disk stress on the system."
+HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://people.seas.harvard.edu/~apw/${BPN}/${BP}.tar.gz \
+ file://texinfo.patch \
+ "
+
+SRC_URI[md5sum] = "890a4236dd1656792f3ef9a190cf99ef"
+SRC_URI[sha256sum] = "057e4fc2a7706411e1014bf172e4f94b63a12f18412378fca8684ca92408825b"
+
+inherit autotools
diff --git a/poky/meta/recipes-extended/sudo/files/sudo.pam b/poky/meta/recipes-extended/sudo/files/sudo.pam
new file mode 100644
index 000000000..515eab0c6
--- /dev/null
+++ b/poky/meta/recipes-extended/sudo/files/sudo.pam
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth include common-auth
+account include common-account
+password include common-password
+session optional pam_keyinit.so revoke
+session required pam_limits.so
diff --git a/poky/meta/recipes-extended/sudo/sudo.inc b/poky/meta/recipes-extended/sudo/sudo.inc
new file mode 100644
index 000000000..362bd3a2e
--- /dev/null
+++ b/poky/meta/recipes-extended/sudo/sudo.inc
@@ -0,0 +1,46 @@
+SUMMARY = "Provide limited super user privileges to specific users"
+DESCRIPTION = "Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments."
+HOMEPAGE = "http://www.sudo.ws"
+BUGTRACKER = "http://www.sudo.ws/bugs/"
+SECTION = "admin"
+LICENSE = "ISC & BSD & Zlib"
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=7765a3d787cb4fed3ccc3c9cee030af9 \
+ file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=805782a8466975716f8376b2be9aedde \
+ file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
+ file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
+ file://lib/util/getcwd.c;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+ file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \
+ file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \
+ file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+ file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
+
+CONFFILES_${PN} = "${sysconfdir}/sudoers"
+
+EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor"
+
+EXTRA_OECONF_append_libc-musl = " --disable-hardening "
+
+# mksigname/mksiglist are used on build host to generate source files
+do_compile_prepend () {
+ # Remove build host references from sudo_usage.h
+ sed -i \
+ -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's,--build=${BUILD_SYS},,g' \
+ -e 's,--host=${HOST_SYS},,g' \
+ ${B}/src/sudo_usage.h
+ oe_runmake SSP_CFLAGS="" SSP_LDFLAGS="" CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS -I${S}/include -I${S} -I${B}" -C lib/util mksigname mksiglist
+}
+
+# Explicitly create ${localstatedir}/lib before do_install to ensure
+# the directory is accessible by all users. Otherwise the mkinstalldirs
+# script (from sudo) will recursively create ${localstatedir}/lib/sudo
+# and then chmod each directory with 0700 permissions, which isn't what
+# we want (i.e, users would not be able to access /var/lib).
+do_install_prepend (){
+ mkdir -p ${D}/${localstatedir}/lib
+}
diff --git a/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch b/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
new file mode 100644
index 000000000..eb36cd49b
--- /dev/null
+++ b/poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
@@ -0,0 +1,34 @@
+From 386e2c2fa2ab2e02ef71c268a57205139be329ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 07:07:49 +0000
+Subject: [PATCH] Include sys/types.h for id_t definition
+
+/sudo_util.h:219:14: error: unknown type name 'id_t'
+ __dso_public id_t sudo_strtoid_v1(const char *str, const char *sep,
+ char **endp, const char **errstr);
+ ^
+ make[1]: *** [preserve_fds.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/sudo_util.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/sudo_util.h b/include/sudo_util.h
+index 89c9f89..ac0855a 100644
+--- a/include/sudo_util.h
++++ b/include/sudo_util.h
+@@ -17,6 +17,8 @@
+ #ifndef SUDO_UTIL_H
+ #define SUDO_UTIL_H
+
++#include <sys/types.h>
++
+ #ifdef HAVE_STDBOOL_H
+ # include <stdbool.h>
+ #else
+--
+2.5.1
+
diff --git a/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb b/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb
new file mode 100644
index 000000000..91501781b
--- /dev/null
+++ b/poky/meta/recipes-extended/sudo/sudo_1.8.22.bb
@@ -0,0 +1,36 @@
+require sudo.inc
+
+SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://0001-Include-sys-types.h-for-id_t-definition.patch \
+ "
+
+PAM_SRC_URI = "file://sudo.pam"
+
+SRC_URI[md5sum] = "24abdea48db4c5abcd410167c801cc8c"
+SRC_URI[sha256sum] = "7256cb27c20883b14360eddbd17f98922073d104b214cf65aeacf1d9c9b9fd02"
+
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
+
+EXTRA_OECONF += " \
+ ac_cv_type_rsize_t=no \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
+ "
+
+do_install_append () {
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
+ fi
+
+ chmod 4111 ${D}${bindir}/sudo
+ chmod 0440 ${D}${sysconfdir}/sudoers
+
+ # Explicitly remove the ${localstatedir}/run directory to avoid QA error
+ rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
+}
+
+FILES_${PN} += "${libdir}/tmpfiles.d"
+FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \
+ ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la"
diff --git a/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..9567946c0
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
@@ -0,0 +1,132 @@
+From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 05:11:53 +0000
+Subject: [PATCH] Fix build with musl
+
+Explicitly include fcntl.h since with glibc is comes in as indirect
+include but not with musl
+
+linux/time.h inclusion is not required on musl so using !__GLIBC__ is
+not right for musl here
+
+wait type is glibc specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ klogd.c | 10 +---------
+ ksym_mod.c | 5 +----
+ pidfile.c | 1 +
+ syslog.c | 3 ++-
+ syslogd.c | 4 +---
+ 5 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/klogd.c b/klogd.c
+index 6cc80ed..9219671 100644
+--- a/klogd.c
++++ b/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -277,13 +274,8 @@
+
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 68cd6b6..6e26da1 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+diff --git a/pidfile.c b/pidfile.c
+index e0959a0..6daa2e0 100644
+--- a/pidfile.c
++++ b/pidfile.c
+@@ -31,6 +31,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <fcntl.h>
+
+ /* read_pid
+ *
+diff --git a/syslog.c b/syslog.c
+index bdb3ff2..ef7b34e 100644
+--- a/syslog.c
++++ b/syslog.c
+@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
++//#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdio.h>
++#include <fcntl.h>
+
+ #define _PATH_LOGNAME "/dev/log"
+
+diff --git a/syslogd.c b/syslogd.c
+index ea73ea5..1ca0595 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -2094,7 +2092,7 @@ void reapchild()
+ (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
+ wait ((int *)0);
+ #else
+- union wait status;
++ int status;
+
+ while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ ;
+--
+2.5.1
+
diff --git a/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch b/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch
new file mode 100644
index 000000000..56431af84
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/0001-fix-problems-that-causes-a-segmentation-fault-under-.patch
@@ -0,0 +1,28 @@
+From cb72b3e172c238b4b5ae5935dc6be54f5034fcf1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 30 Jun 2017 18:20:06 -0700
+Subject: [PATCH 1/2] fix problems that causes a segmentation fault under some
+ conditions
+
+Upstream-Status: Inappropriate [ no upstream ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ksym_mod.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 6e26da1..a3daa7d 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -186,7 +186,6 @@ extern int InitMsyms()
+ else
+ Syslog(LOG_ERR, "Error loading kernel symbols " \
+ "- %s\n", strerror(errno));
+- fclose(ksyms);
+ return(0);
+ }
+
+--
+2.13.2
+
diff --git a/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch b/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch
new file mode 100644
index 000000000..ebbdef303
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/0002-Make-way-for-respecting-flags-from-environment.patch
@@ -0,0 +1,35 @@
+From b22f244732cd0f475af2f82fc7eecec49f90623b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 1 Jul 2017 00:01:50 -0700
+Subject: [PATCH 2/2] Make way for respecting flags from environment
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5af1689..af699d2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -17,14 +17,12 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+-CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS = $(CFLAGS) $(CPPFLAGS) -DSYSV -Wall -fno-strength-reduce
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
+-LDFLAGS= -s
+
+ # Look where your install program is.
+ INSTALL = /usr/bin/install
+--
+2.13.2
+
diff --git a/poky/meta/recipes-extended/sysklogd/files/klogd.service b/poky/meta/recipes-extended/sysklogd/files/klogd.service
new file mode 100644
index 000000000..0c888c497
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/klogd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Kernel Logging Service
+After=syslogd.service
+
+[Service]
+Type=forking
+ExecStart=/sbin/klogd
+PIDFile=/var/run/klogd.pid
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
new file mode 100644
index 000000000..d426c83bf
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: sysklogd-1.5.1/Makefile
+===================================================================
+--- sysklogd-1.5.1.orig/Makefile
++++ sysklogd-1.5.1/Makefile
+@@ -127,8 +127,8 @@ clobber: clean
+ rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
+
+ install_exec: syslogd klogd
+- ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
+- ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
++ ${INSTALL} -m 500 syslogd ${BINDIR}/syslogd
++ ${INSTALL} -m 500 klogd ${BINDIR}/klogd
+
+ install_man:
+ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
diff --git a/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
new file mode 100644
index 000000000..c1cc042c9
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate
+
+The compiler should not be generating vectorized instructions on this target.
+This is a work around until I can determine why this is occuring on this
+particular recipe
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile
++++ sysklogd-1.5/Makefile
+@@ -20,7 +20,8 @@
+ CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce \
++ -fno-tree-vectorize
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
diff --git a/poky/meta/recipes-extended/sysklogd/files/sysklogd b/poky/meta/recipes-extended/sysklogd/files/sysklogd
new file mode 100755
index 000000000..258f88280
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/sysklogd
@@ -0,0 +1,151 @@
+#! /bin/sh
+# /etc/init.d/sysklogd: start the system log daemon.
+
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Should-Start: $network
+# Should-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile_syslogd=/var/run/syslogd.pid
+pidfile_klogd=/var/run/klogd.pid
+binpath_syslogd=/sbin/syslogd
+binpath_klogd=/sbin/klogd
+
+test -x $binpath || exit 0
+
+test ! -r /etc/default/syslogd || . /etc/default/syslogd
+
+create_xconsole()
+{
+ # Only proceed if /dev/xconsole is used at all
+ if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
+ then
+ return
+ fi
+
+ if [ ! -e /dev/xconsole ]; then
+ mknod -m 640 /dev/xconsole p
+ else
+ chmod 0640 /dev/xconsole
+ fi
+ chown root:adm /dev/xconsole
+ test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
+}
+
+log_begin_msg () {
+ echo -n $1
+}
+
+log_end_msg () {
+ echo $1
+}
+
+log_success_msg () {
+ echo $1
+}
+
+running()
+{
+ # No pidfile, probably no daemon present
+ #
+ if [ ! -f $pidfile ]
+ then
+ return 1
+ fi
+
+ pid=`cat $pidfile_syslogd`
+
+ # No pid, probably no daemon present
+ #
+ if [ -z "$pid" ]
+ then
+ return 1
+ fi
+
+ if [ ! -d /proc/$pid ]
+ then
+ return 1
+ fi
+
+ cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+ # No syslogd?
+ #
+ if [ "$cmd" != "$binpath" ]
+ then
+ return 1
+ fi
+
+ return 0
+}
+
+case "$1" in
+ start)
+ log_begin_msg "Starting system log daemon..."
+ create_xconsole
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Starting kernel log daemon..."
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ stop)
+ log_begin_msg "Stopping system log daemon..."
+ start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Stopping kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ log_end_msg $?
+ ;;
+ reload|force-reload)
+ log_begin_msg "Reloading system log daemon..."
+ start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ restart)
+ log_begin_msg "Restarting system log daemon..."
+ start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ reload-or-restart)
+ if running
+ then
+ $0 reload
+ else
+ $0 start
+ fi
+ ;;
+ status)
+ status syslogd
+ RETVAL=$?
+ status klogd
+ rval=$?
+ [ $RETVAL -eq 0 ] && exit $rval
+ exit $RETVAL
+ ;;
+ *)
+ log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-extended/sysklogd/files/syslog.conf b/poky/meta/recipes-extended/sysklogd/files/syslog.conf
new file mode 100644
index 000000000..0849de126
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/syslog.conf
@@ -0,0 +1,71 @@
+# /etc/syslog.conf Configuration file for syslogd.
+#
+# Ported from debian by Yu Ke <ke.yu@intel.com>
+#
+
+#
+# First some standard logfiles. Log by facility.
+#
+
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+#cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+#
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info -/var/log/mail.info
+mail.warn -/var/log/mail.warn
+mail.err /var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit /var/log/news.crit
+news.err /var/log/news.err
+news.notice -/var/log/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+auth,authpriv.none;\
+news.none;mail.none -/var/log/debug
+
+*.=info;*.=notice;*.=warn;\
+auth,authpriv.none;\
+cron,daemon.none;\
+mail,news.none -/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg *
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+#news.=crit;news.=err;news.=notice;\
+#*.=debug;*.=info;\
+#*.=notice;*.=warn /dev/tty8
+
+# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
+# you must invoke `xconsole' with the `-file' option:
+#
+# $ xconsole -file /dev/xconsole [...]
+#
+# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
+# busy site..
+#
+daemon.*;mail.*;\
+news.err;\
+*.=debug;*.=info;\
+*.=notice;*.=warn |/dev/xconsole
+
diff --git a/poky/meta/recipes-extended/sysklogd/files/syslogd.service b/poky/meta/recipes-extended/sysklogd/files/syslogd.service
new file mode 100644
index 000000000..eeaff3d38
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/syslogd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=System Logging Service
+Requires=syslog.socket
+
+[Service]
+Type=forking
+ExecStart=/sbin/syslogd
+PIDFile=/var/run/syslogd.pid
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service
diff --git a/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf b/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf
new file mode 100644
index 000000000..f4aecd385
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/files/tmpfiles.sysklogd.conf
@@ -0,0 +1 @@
+p /dev/xconsole 0640 root adm
diff --git a/poky/meta/recipes-extended/sysklogd/sysklogd.inc b/poky/meta/recipes-extended/sysklogd/sysklogd.inc
new file mode 100644
index 000000000..1a537fabf
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -0,0 +1,72 @@
+SUMMARY = "System Log Daemons"
+DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd"
+HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/"
+SECTION = "base"
+
+LICENSE = "GPLv2+ & BSD"
+LICENSE_syslogd = "BSD"
+LICENSE_klogd = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \
+ file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
+ "
+
+inherit update-rc.d systemd
+
+SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
+ file://no-strip-install.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://0001-fix-problems-that-causes-a-segmentation-fault-under-.patch \
+ file://0002-Make-way-for-respecting-flags-from-environment.patch \
+ file://sysklogd \
+ file://syslog.conf \
+ file://syslogd.service \
+ file://klogd.service \
+ file://tmpfiles.sysklogd.conf \
+ "
+
+SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "syslogd.service klogd.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+INITSCRIPT_NAME = "syslog"
+CONFFILES_${PN} = "${sysconfdir}/syslog.conf"
+RCONFLICTS_${PN}-syslog = "rsyslog busybox-syslog syslog-ng"
+
+CFLAGS += "-DSYSV -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+
+do_install () {
+ install -d ${D}${mandir}/man8 \
+ ${D}${mandir}/man5 \
+ ${D}${base_sbindir}
+ oe_runmake 'BINDIR=${D}${base_sbindir}' \
+ 'MANDIR=${D}${mandir}' install
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/syslogd.service ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/klogd.service ${D}${systemd_unitdir}/system
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then
+ install -d ${D}${exec_prefix}/lib/tmpfiles.d
+ install -m 644 ${WORKDIR}/tmpfiles.sysklogd.conf ${D}${exec_prefix}/lib/tmpfiles.d/sysklogd.conf
+ fi
+}
+
+FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/sysklogd.conf', '', d)}"
+
+pkg_prerm_${PN} () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/syslog stop || :
+ fi
+ fi
+}
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
diff --git a/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
new file mode 100644
index 000000000..975ecc2b6
--- /dev/null
+++ b/poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
@@ -0,0 +1,4 @@
+require sysklogd.inc
+
+SRC_URI[md5sum] = "c70599ab0d037fde724f7210c2c8d7f8"
+SRC_URI[sha256sum] = "5166c185ae23c92e8b9feee66a6e3d0bc944bf673112f53e3ecf62e08ce7c201"
diff --git a/poky/meta/recipes-extended/sysstat/sysstat.inc b/poky/meta/recipes-extended/sysstat/sysstat.inc
new file mode 100644
index 000000000..0bc7e14d3
--- /dev/null
+++ b/poky/meta/recipes-extended/sysstat/sysstat.inc
@@ -0,0 +1,65 @@
+SUMMARY = "System performance tools"
+DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux."
+HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/"
+LICENSE = "GPLv2+"
+SECTION = "console/utils"
+
+SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
+ file://99_sysstat \
+ file://sysstat.service \
+ "
+
+UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+DEPENDS += "base-passwd"
+
+# autotools-brokensep as this package doesn't use automake
+inherit autotools-brokensep gettext systemd
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lm-sensors] = "--enable-sensors,--disable-sensors,lmsensors,lmsensors-libsensors"
+
+EXTRA_OECONF += "--disable-stripping"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "sysstat.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+do_configure_prepend() {
+ export sa_lib_dir=${libdir}/sa
+}
+
+do_install() {
+ autotools_do_install
+
+ # don't install /var/log/sa when populating rootfs. Do it through volatile
+ rm -rf ${D}/var
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/log/sa - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/sysstat.conf
+ fi
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
+}
+
+pkg_postinst_${PN} () {
+ if [ -n "$D" ]; then
+ exit 0
+ fi
+ if [ -e /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
+
+
+FILES_${PN} += "${libdir}/sa"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
diff --git a/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch b/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
new file mode 100644
index 000000000..1b63299aa
--- /dev/null
+++ b/poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
@@ -0,0 +1,59 @@
+From 42325faa88d64cce799977d611b2792beb154643 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Sep 2015 08:36:59 +0000
+Subject: [PATCH] Include needed headers explicitly
+
+on glibc these headers get pulled in indirectly via other .h files
+but right fix is to include them directly when used
+
+fixes
+
+error: use of undeclared identifier 'PATH_MAX'
+error: called object type 'unsigned int' is not a function or function pointer
+dm_major = major(aux.st_rdev);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ common.c | 1 +
+ ioconf.c | 1 +
+ sa_common.c | 1 +
+ 3 files changed, 3 insertions(+)
+
+Index: sysstat-11.7.1/common.c
+===================================================================
+--- sysstat-11.7.1.orig/common.c
++++ sysstat-11.7.1/common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
+Index: sysstat-11.7.1/ioconf.c
+===================================================================
+--- sysstat-11.7.1.orig/ioconf.c
++++ sysstat-11.7.1/ioconf.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
++#include <sys/types.h>
+
+ #include "ioconf.h"
+ #include "common.h"
+Index: sysstat-11.7.1/sa_common.c
+===================================================================
+--- sysstat-11.7.1.orig/sa_common.c
++++ sysstat-11.7.1/sa_common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdint.h>
diff --git a/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat b/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
new file mode 100644
index 000000000..0b0ec30de
--- /dev/null
+++ b/poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
@@ -0,0 +1 @@
+d root root 0755 /var/log/sa none
diff --git a/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service b/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service
new file mode 100644
index 000000000..aff07109f
--- /dev/null
+++ b/poky/meta/recipes-extended/sysstat/sysstat/sysstat.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Resets System Activity Logs
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+User=root
+ExecStart=@LIBDIR@/sa/sa1 --boot
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb b/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb
new file mode 100644
index 000000000..86738e7b7
--- /dev/null
+++ b/poky/meta/recipes-extended/sysstat/sysstat_11.7.1.bb
@@ -0,0 +1,8 @@
+require sysstat.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
+
+SRC_URI += "file://0001-Include-needed-headers-explicitly.patch"
+
+SRC_URI[md5sum] = "bdcda7c9048c7c22fb1f30f75285d13d"
+SRC_URI[sha256sum] = "303a595b1af0330b183a0f1febfccf89f183b9575ae0562b91fdb876f3ef1feb"
diff --git a/poky/meta/recipes-extended/tar/tar.inc b/poky/meta/recipes-extended/tar/tar.inc
new file mode 100644
index 000000000..93e4da114
--- /dev/null
+++ b/poky/meta/recipes-extended/tar/tar.inc
@@ -0,0 +1,52 @@
+SUMMARY = "GNU file archiving program"
+DESCRIPTION = "GNU tar saves many files together into a single tape \
+or disk archive, and can restore individual files from the archive."
+HOMEPAGE = "http://www.gnu.org/software/tar/"
+SECTION = "base"
+
+SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since tar has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+do_install () {
+ autotools_do_install
+ ln -s tar ${D}${bindir}/gtar
+}
+
+do_install_append_class-target() {
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/tar ${D}${base_bindir}/tar
+ mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar
+ rmdir ${D}${bindir}/
+ fi
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "tar"
+ALTERNATIVE_${PN}-rmt = "rmt"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_${PN}-rmt_class-nativesdk = ""
+
+ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
+
+PROVIDES_append_class-native = " tar-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/tar/tar/musl_dirent.patch b/poky/meta/recipes-extended/tar/tar/musl_dirent.patch
new file mode 100644
index 000000000..2d98ed131
--- /dev/null
+++ b/poky/meta/recipes-extended/tar/tar/musl_dirent.patch
@@ -0,0 +1,19 @@
+musl has valid d_ino implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: tar-1.28/m4/d-ino.m4
+===================================================================
+--- tar-1.28.orig/m4/d-ino.m4
++++ tar-1.28/m4/d-ino.m4
+@@ -40,7 +40,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_
+ [gl_cv_struct_dirent_d_ino=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems with Linux kernel.
+- linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
++ linux*-gnu*|linux*-musl*)
++ gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # Guess no on native Windows.
+ mingw*) gl_cv_struct_dirent_d_ino="guessing no" ;;
+ # If we don't know, assume the worst.
diff --git a/poky/meta/recipes-extended/tar/tar/remove-gets.patch b/poky/meta/recipes-extended/tar/tar/remove-gets.patch
new file mode 100644
index 000000000..f24de926a
--- /dev/null
+++ b/poky/meta/recipes-extended/tar/tar/remove-gets.patch
@@ -0,0 +1,29 @@
+ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gnu/stdio.in.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gnu/stdio.in.h b/gnu/stdio.in.h
+index ec43874..502e3ae 100644
+--- a/gnu/stdio.in.h
++++ b/gnu/stdio.in.h
+@@ -722,10 +722,12 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ /* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
++#if defined gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS && !defined __cplusplus
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
+ struct obstack;
+--
+2.8.3
+
diff --git a/poky/meta/recipes-extended/tar/tar_1.30.bb b/poky/meta/recipes-extended/tar/tar_1.30.bb
new file mode 100644
index 000000000..e743a6d0d
--- /dev/null
+++ b/poky/meta/recipes-extended/tar/tar_1.30.bb
@@ -0,0 +1,18 @@
+require tar.inc
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[acl] = "--with-posix-acls, --without-posix-acls, acl,"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI += "file://remove-gets.patch \
+ file://musl_dirent.patch \
+ "
+SRC_URI[md5sum] = "8404e4c1fc5a3000228ab2b8ad674a65"
+SRC_URI[sha256sum] = "87592b86cb037c554375f5868bdd3cc57748aef38d6cb741c81065f0beac63b7"
+
+do_install_append_libc-musl() {
+ rm -f ${D}${libdir}/charset.alias
+ rmdir ${D}${libdir}
+}
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch
new file mode 100644
index 000000000..9d1e05d7f
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Fix-build-with-clang.patch
@@ -0,0 +1,65 @@
+From 7f8878ac1aaf4a19992d39379797c151301bedb1 Mon Sep 17 00:00:00 2001
+From: Oleksiy Obitotskyy <oobitots@cisco.com>
+Date: Mon, 5 Feb 2018 08:29:10 -0800
+Subject: [PATCH] Fix build with clang
+
+Fix "error: non-void function 'fix_options' should return a value".
+Add function prototype to tcpd.c and miscd.c.
+
+Upstream-Status: Pending
+
+Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
+---
+ v2 - add function prototypes
+
+ fix_options.c | 2 +-
+ miscd.c | 4 ++++
+ tcpd.c | 4 ++++
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/fix_options.c b/fix_options.c
+index b5e81b8..9958ff4 100644
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -29,7 +29,7 @@ static char sccsid[] = "@(#) fix_options.c 1.6 97/04/08 02:29:19";
+
+ /* fix_options - get rid of IP-level socket options */
+
+-fix_options(request)
++void fix_options(request)
+ struct request_info *request;
+ {
+ #ifdef IP_OPTIONS
+diff --git a/miscd.c b/miscd.c
+index 1ab835c..723b83a 100644
+--- a/miscd.c
++++ b/miscd.c
+@@ -40,6 +40,10 @@ static char sccsid[] = "@(#) miscd.c 1.10 96/02/11 17:01:30";
+ #include "patchlevel.h"
+ #include "tcpd.h"
+
++#ifdef KILL_IP_OPTIONS
++void fix_options(struct request_info *);
++#endif
++
+ int allow_severity = SEVERITY; /* run-time adjustable */
+ int deny_severity = LOG_WARNING; /* ditto */
+
+diff --git a/tcpd.c b/tcpd.c
+index d865b9c..a179891 100644
+--- a/tcpd.c
++++ b/tcpd.c
+@@ -38,6 +38,10 @@ static char sccsid[] = "@(#) tcpd.c 1.10 96/02/11 17:01:32";
+ #include "patchlevel.h"
+ #include "tcpd.h"
+
++#ifdef KILL_IP_OPTIONS
++void fix_options(struct request_info *);
++#endif
++
+ int allow_severity = SEVERITY; /* run-time adjustable */
+ int deny_severity = LOG_WARNING; /* ditto */
+
+--
+2.10.3.dirty
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
new file mode 100644
index 000000000..16d6719cb
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
@@ -0,0 +1,77 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 1995-01-30 19:51:47.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-09 16:59:45.000000000 +0200
+@@ -173,7 +173,7 @@
+ Patterns like these can be used when the machine has different internet
+ addresses with different internet hostnames. Service providers can use
+ this facility to offer FTP, GOPHER or WWW archives with internet names
+-that may even belong to different organizations. See also the `twist'
++that may even belong to different organizations. See also the `twist\'
+ option in the hosts_options(5) document. Some systems (Solaris,
+ FreeBSD) can have more than one internet address on one physical
+ interface; with other systems you may have to resort to SLIP or PPP
+@@ -236,10 +236,10 @@
+ Before accepting a client request, the wrappers can use the IDENT
+ service to find out that the client did not send the request at all.
+ When the client host provides IDENT service, a negative IDENT lookup
+-result (the client matches `UNKNOWN@host') is strong evidence of a host
++result (the client matches `UNKNOWN@host\') is strong evidence of a host
+ spoofing attack.
+ .PP
+-A positive IDENT lookup result (the client matches `KNOWN@host') is
++A positive IDENT lookup result (the client matches `KNOWN@host\') is
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 1994-12-28 17:42:29.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2004-04-09 16:59:49.000000000 +0200
+@@ -124,7 +124,7 @@
+ value is taken.
+ .SH MISCELLANEOUS
+ .IP "banners /some/directory"
+-Look for a file in `/some/directory' with the same name as the daemon
++Look for a file in `/some/directory\' with the same name as the daemon
+ process (for example in.telnetd for the telnet service), and copy its
+ contents to the client. Newline characters are replaced by
+ carriage-return newline, and %<letter> sequences are expanded (see
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2004-04-09 17:00:49.000000000 +0200
+@@ -26,7 +26,7 @@
+ A daemon process name. Typically, the last component of a daemon
+ executable pathname.
+ .IP client
+-A host name or network address, or one of the `unknown' or `paranoid'
++A host name or network address, or one of the `unknown\' or `paranoid\'
+ wildcard patterns.
+ .sp
+ When a client host name is specified, \fItcpdmatch\fR gives a
+@@ -37,13 +37,13 @@
+ .PP
+ Optional information specified with the \fIdaemon@server\fR form:
+ .IP server
+-A host name or network address, or one of the `unknown' or `paranoid'
+-wildcard patterns. The default server name is `unknown'.
++A host name or network address, or one of the `unknown\' or `paranoid\'
++wildcard patterns. The default server name is `unknown\'.
+ .PP
+ Optional information specified with the \fIuser@client\fR form:
+ .IP user
+ A client user identifier. Typically, a login name or a numeric userid.
+-The default user name is `unknown'.
++The default user name is `unknown\'.
+ .SH OPTIONS
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+@@ -70,7 +70,7 @@
+ .ti +5
+ tcpdmatch in.telnetd paranoid
+ .PP
+-On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR
++On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR
+ may need some help to locate the inetd configuration file.
+ .SH FILES
+ .PP
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
new file mode 100644
index 000000000..9a735bff6
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
@@ -0,0 +1,250 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.3 2005-03-09 18:27:03.000000000 +0100
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+
+ extern int allow_severity;
+ extern int deny_severity;
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2005-03-09 18:30:18.000000000 +0100
+@@ -8,9 +8,9 @@ name, host name/address) patterns. Exam
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+- /usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++ /usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -383,6 +383,7 @@ that shouldn\'t. All problems are repor
+ .fi
+ .SH SEE ALSO
+ .nf
++hosts_options(5) extended syntax.
+ tcpd(8) tcp/ip daemon wrapper program.
+ tcpdchk(8), tcpdmatch(8), test programs.
+ .SH BUGS
+diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2005-03-09 18:27:03.000000000 +0100
+@@ -2,10 +2,8 @@
+ .SH NAME
+ hosts_options \- host access control language extensions
+ .SH DESCRIPTION
+-This document describes optional extensions to the language described
+-in the hosts_access(5) document. The extensions are enabled at program
+-build time. For example, by editing the Makefile and turning on the
+-PROCESS_OPTIONS compile-time option.
++This document describes extensions to the language described
++in the hosts_access(5) document.
+ .PP
+ The extensible language uses the following format:
+ .sp
+@@ -58,12 +56,12 @@ Notice the leading dot on the domain nam
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page. The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c
+--- tcp_wrappers_7.6.orig/inetcf.c 1997-02-12 02:13:24.000000000 +0100
++++ tcp_wrappers_7.6/inetcf.c 2005-03-09 18:27:03.000000000 +0100
+@@ -26,13 +26,17 @@ extern void exit();
+ * guesses. Shorter names follow longer ones.
+ */
+ char *inet_files[] = {
++#if 0
+ "/private/etc/inetd.conf", /* NEXT */
+ "/etc/inet/inetd.conf", /* SYSV4 */
+ "/usr/etc/inetd.conf", /* IRIX?? */
++#endif
+ "/etc/inetd.conf", /* BSD */
++#if 0
+ "/etc/net/tlid.conf", /* SYSV4?? */
+ "/etc/saf/tlid.conf", /* SYSV4?? */
+ "/etc/tlid.conf", /* SYSV4?? */
++#endif
+ 0,
+ };
+
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8
+--- tcp_wrappers_7.6.orig/tcpd.8 1996-02-21 16:39:16.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.8 2005-03-09 18:27:03.000000000 +0100
+@@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s
+ TLI. Functionality may be limited when the protocol underneath TLI is
+ not an internet protocol.
+ .PP
+-Operation is as follows: whenever a request for service arrives, the
++There are two possible modes of operation: execution of \fItcpd\fP
++before a service started by \fIinetd\fP, or linking a daemon with
++the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3)
++manual page. Operation when started by \fIinetd\fP
++is as follows: whenever a request for service arrives, the
+ \fIinetd\fP daemon is tricked into running the \fItcpd\fP program
+ instead of the desired server. \fItcpd\fP logs the request and does
+ some additional checks. When all is well, \fItcpd\fP runs the
+@@ -88,11 +92,11 @@ configuration files.
+ .sp
+ .in +5
+ # mkdir /other/place
+-# mv /usr/etc/in.fingerd /other/place
+-# cp tcpd /usr/etc/in.fingerd
++# mv /usr/sbin/in.fingerd /other/place
++# cp tcpd /usr/sbin/in.fingerd
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+ no `in.\' prefix to their name.
+ .SH EXAMPLE 2
+@@ -101,35 +105,34 @@ are left in their original place.
+ .PP
+ In order to monitor access to the \fIfinger\fR service, perform the
+ following edits on the \fIinetd\fR configuration file (usually
+-\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR):
++\fI/etc/inetd.conf\fR):
+ .nf
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd
+ .sp
+ becomes:
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /some/where/tcpd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd
+ .sp
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+ daemons have no `in.\' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+ covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8)
+-process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++process to make the changes effective.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd
++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/local/lib/ntalkd
+ .sp
+ .fi
+ .PP
+@@ -164,6 +167,7 @@ The default locations of the host access
+ .SH SEE ALSO
+ .na
+ .nf
++hosts_access(3), functions provided by the libwrap library.
+ hosts_access(5), format of the tcpd access control tables.
+ syslog.conf(5), format of the syslogd control file.
+ inetd.conf(5), format of the inetd control file.
+diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8
+--- tcp_wrappers_7.6.orig/tcpdchk.8 1995-01-08 17:00:31.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.8 2005-03-09 18:27:03.000000000 +0100
+@@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v]
+ potential and real problems it can find. The program examines the
+ \fItcpd\fR access control files (by default, these are
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the
+-entries in these files against entries in the \fIinetd\fR or \fItlid\fR
+-network configuration files.
++entries in these files against entries in the \fIinetd\fR
++network configuration file.
+ .PP
+ \fItcpdchk\fR reports problems such as non-existent pathnames; services
+ that appear in \fItcpd\fR access control rules, but are not controlled
+@@ -26,14 +26,13 @@ problem.
+ .SH OPTIONS
+ .IP -a
+ Report access control rules that permit access without an explicit
+-ALLOW keyword. This applies only when the extended access control
+-language is enabled (build with -DPROCESS_OPTIONS).
++ALLOW keyword.
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdchk\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .IP -v
+ Display the contents of each access control rule. Daemon lists, client
+@@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
+diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2005-03-09 18:27:03.000000000 +0100
+@@ -13,7 +13,7 @@ request for service. Examples are given
+ The program examines the \fItcpd\fR access control tables (default
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its
+ conclusion. For maximal accuracy, it extracts additional information
+-from your \fIinetd\fR or \fItlid\fR network configuration file.
++from your \fIinetd\fR network configuration file.
+ .PP
+ When \fItcpdmatch\fR finds a match in the access control tables, it
+ identifies the matched rule. In addition, it displays the optional
+@@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdmatch\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .SH EXAMPLES
+ To predict how \fItcpd\fR would handle a telnet request from the local
+@@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
new file mode 100644
index 000000000..9e188027f
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
@@ -0,0 +1,105 @@
+Upstream-Status: Backport
+
+See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 18:54:33.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 18:54:27.000000000 +0200
+@@ -89,6 +89,10 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++.IP \(bu
++Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
++method of matching cannot be used in conjunction with `net/mask\' matching,
++hostname matching beginning with `.\' or IP address matching ending with `.\'.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 1997-02-12 02:13:23.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 18:52:21.000000000 +0200
+@@ -289,6 +289,11 @@
+ {
+ int n;
+
++#ifndef DISABLE_WILDCARD_MATCHING
++ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
++ return (match_pattern_ylo(string,tok));
++ } else
++#endif
+ if (tok[0] == '.') { /* suffix */
+ n = strlen(string) - strlen(tok);
+ return (n > 0 && STR_EQ(tok, string + n));
+@@ -329,3 +334,71 @@
+ }
+ return ((addr & mask) == net);
+ }
++
++#ifndef DISABLE_WILDCARD_MATCHING
++/* Note: this feature has been adapted in a pretty straightforward way
++ from Tatu Ylonen's last SSH version under free license by
++ Pekka Savola <pekkas@netcore.fi>.
++
++ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++*/
++
++/* Returns true if the given string matches the pattern (which may contain
++ ? and * as wildcards), and zero if it does not match. */
++
++int match_pattern_ylo(const char *s, const char *pattern)
++{
++ while (1)
++ {
++ /* If at end of pattern, accept if also at end of string. */
++ if (!*pattern)
++ return !*s;
++
++ /* Process '*'. */
++ if (*pattern == '*')
++ {
++ /* Skip the asterisk. */
++ pattern++;
++
++ /* If at end of pattern, accept immediately. */
++ if (!*pattern)
++ return 1;
++
++ /* If next character in pattern is known, optimize. */
++ if (*pattern != '?' && *pattern != '*')
++ {
++ /* Look instances of the next character in pattern, and try
++ to match starting from those. */
++ for (; *s; s++)
++ if (*s == *pattern &&
++ match_pattern_ylo(s + 1, pattern + 1))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* Move ahead one character at a time and try to match at each
++ position. */
++ for (; *s; s++)
++ if (match_pattern_ylo(s, pattern))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* There must be at least one more character in the string. If we are
++ at the end, fail. */
++ if (!*s)
++ return 0;
++
++ /* Check if the next character of the string is acceptable. */
++ if (*pattern != '?' && *pattern != *s)
++ return 0;
++
++ /* Move to the next character, both in string and in pattern. */
++ s++;
++ pattern++;
++ }
++ /*NOTREACHED*/
++}
++#endif /* DISABLE_WILDCARD_MATCHING */
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 000000000..725f4b595
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+* Mon Feb 5 2001 Preston Brown <pbrown@redhat.com>
+- fix gethostbyname to work better with dot "." notation (#16949)
+
+--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
++++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
+@@ -52,7 +52,8 @@
+ char *name;
+ {
+ char dot_name[MAXHOSTNAMELEN + 1];
+-
++ struct hostent *hp;
++
+ /*
+ * Don't append dots to unqualified names. Such names are likely to come
+ * from local hosts files or from NIS.
+@@ -61,8 +62,12 @@
+ if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
+ return (gethostbyname(name));
+ } else {
+- sprintf(dot_name, "%s.", name);
+- return (gethostbyname(dot_name));
++ sprintf(dot_name, "%s.", name);
++ hp = gethostbyname(dot_name);
++ if (hp)
++ return hp;
++ else
++ return (gethostbyname(name));
+ }
+ }
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
new file mode 100644
index 000000000..96d47c39f
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
@@ -0,0 +1,1255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
+--- tcp_wrappers_7.6.orig/fix_options.c 1997-04-08 02:29:19.000000000 +0200
++++ tcp_wrappers_7.6/fix_options.c 2004-04-10 19:07:43.000000000 +0200
+@@ -11,6 +11,9 @@
+
+ #include <sys/types.h>
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+@@ -41,6 +44,22 @@
+ unsigned int opt;
+ int optlen;
+ struct in_addr dummy;
++#ifdef INET6
++ struct sockaddr_storage ss;
++ int sslen;
++
++ /*
++ * check if this is AF_INET socket
++ * XXX IPv6 support?
++ */
++ sslen = sizeof(ss);
++ if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {
++ syslog(LOG_ERR, "getpeername: %m");
++ clean_exit(request);
++ }
++ if (ss.ss_family != AF_INET)
++ return;
++#endif
+
+ if ((ip = getprotobyname("ip")) != 0)
+ ipproto = ip->p_proto;
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:07:43.000000000 +0200
+@@ -85,11 +85,18 @@
+ for daemon process names or for client user names.
+ .IP \(bu
+ An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
++`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
++`[net]/prefixlen\' pair. An IPv6 host address is matched if
++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
++address. For example, the [net]/prefixlen pattern
++`[3ffe:505:2:1::]/64\' matches every address in the range
++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,7 +24,13 @@
+ /* System libraries. */
+
+ #include <sys/types.h>
++#ifdef INT32_T
++ typedef uint32_t u_int32_t;
++#endif
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -33,6 +39,9 @@
+ #include <errno.h>
+ #include <setjmp.h>
+ #include <string.h>
++#ifdef INET6
++#include <netdb.h>
++#endif
+
+ extern char *fgets();
+ extern int errno;
+@@ -82,6 +91,10 @@
+ static int host_match();
+ static int string_match();
+ static int masked_match();
++#ifdef INET6
++static int masked_match4();
++static int masked_match6();
++#endif
+
+ /* Size of logical line buffer. */
+
+@@ -289,6 +302,13 @@
+ {
+ int n;
+
++#ifdef INET6
++ /* convert IPv4 mapped IPv6 address to IPv4 address */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE) {
++ string += 7;
++ }
++#endif
+ #ifndef DISABLE_WILDCARD_MATCHING
+ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
+ return (match_pattern_ylo(string,tok));
+@@ -304,20 +324,72 @@
+ } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
+ return (STRN_EQ(tok, string, n));
+ } else { /* exact match */
++#ifdef INET6
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 pat, addr;
++ int len, ret;
++ char ch;
++
++ len = strlen(tok);
++ if (*tok == '[' && tok[len - 1] == ']') {
++ ch = tok[len - 1];
++ tok[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) {
++ memcpy(&pat, res->ai_addr, sizeof(pat));
++ freeaddrinfo(res);
++ }
++ tok[len - 1] = ch;
++ if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++#ifdef NI_WITHSCOPEID
++ if (pat.sin6_scope_id != 0 &&
++ addr.sin6_scope_id != pat.sin6_scope_id)
++ return NO;
++#endif
++ return (!memcmp(&pat.sin6_addr, &addr.sin6_addr,
++ sizeof(struct in6_addr)));
++ return (ret);
++ }
++#endif
+ return (STR_EQ(tok, string));
+ }
+ }
+
+ /* masked_match - match address against netnumber/netmask */
+
++#ifdef INET6
+ static int masked_match(net_tok, mask_tok, string)
+ char *net_tok;
+ char *mask_tok;
+ char *string;
+ {
++ return (masked_match4(net_tok, mask_tok, string) ||
++ masked_match6(net_tok, mask_tok, string));
++}
++
++static int masked_match4(net_tok, mask_tok, string)
++#else
++static int masked_match(net_tok, mask_tok, string)
++#endif
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++#ifdef INET6
++ u_int32_t net;
++ u_int32_t mask;
++ u_int32_t addr;
++#else
+ unsigned long net;
+ unsigned long mask;
+ unsigned long addr;
++#endif
+
+ /*
+ * Disallow forms other than dotted quad: the treatment that inet_addr()
+@@ -329,12 +401,78 @@
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++#ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
++#endif
+ return (NO); /* not tcpd_jump() */
+ }
+ return ((addr & mask) == net);
+ }
+
++#ifdef INET6
++static int masked_match6(net_tok, mask_tok, string)
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 net, addr;
++ u_int32_t mask;
++ int len, mask_len, i = 0;
++ char ch;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++
++ if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
++ if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
++ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
++ return (NO);
++ return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
++ }
++
++ /* match IPv6 address against netnumber/prefixlen */
++ len = strlen(net_tok);
++ if (*net_tok != '[' || net_tok[len - 1] != ']')
++ return NO;
++ ch = net_tok[len - 1];
++ net_tok[len - 1] = '\0';
++ if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) {
++ net_tok[len - 1] = ch;
++ return NO;
++ }
++ memcpy(&net, res->ai_addr, sizeof(net));
++ freeaddrinfo(res);
++ net_tok[len - 1] = ch;
++ if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128)
++ return NO;
++
++#ifdef NI_WITHSCOPEID
++ if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id)
++ return NO;
++#endif
++ while (mask_len > 0) {
++ if (mask_len < 32) {
++ mask = htonl(~(0xffffffff >> mask_len));
++ if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
++ return NO;
++ break;
++ }
++ if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i])
++ return NO;
++ i += 4;
++ mask_len -= 32;
++ }
++ return YES;
++}
++#endif /* INET6 */
++
+ #ifndef DISABLE_WILDCARD_MATCHING
+ /* Note: this feature has been adapted in a pretty straightforward way
+ from Tatu Ylonen's last SSH version under free license by
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 1997-03-21 19:27:21.000000000 +0100
++++ tcp_wrappers_7.6/Makefile 2004-04-10 19:22:44.000000000 +0200
+@@ -21,7 +21,7 @@
+ @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+ @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+- @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
++ @echo " sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ @echo " uts215 uxp"
+ @echo
+ @echo "If none of these match your environment, edit the system"
+@@ -131,20 +131,34 @@
+ NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all
+
+ # Freebsd and linux by default have no NIS.
+-386bsd netbsd bsdos:
++386bsd bsdos:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+
+ freebsd:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-L/usr/local/v6/lib -linet6" \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+- EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \
++ VSYSLOG= all
++
++netbsd:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++
++gnu:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -196,6 +210,13 @@
+ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
+ BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all
+
++# SunOS 5.8 is another SYSV4 variant, but has IPv6 support
++solaris8:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \
++ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
++ EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all
++
+ # Generic SYSV40
+ esix sysv4:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 1996-02-11 17:01:30.000000000 +0100
++++ tcp_wrappers_7.6/misc.c 2004-04-10 19:07:43.000000000 +0200
+@@ -58,9 +58,31 @@
+ {
+ char *cp;
+
++#ifdef INET6
++ int bracket = 0;
++
++ for (cp = string; cp && *cp; cp++) {
++ switch (*cp) {
++ case '[':
++ bracket++;
++ break;
++ case ']':
++ bracket--;
++ break;
++ default:
++ if (bracket == 0 && *cp == delimiter) {
++ *cp++ = 0;
++ return cp;
++ }
++ break;
++ }
++ }
++ return (NULL);
++#else
+ if ((cp = strchr(string, delimiter)) != 0)
+ *cp++ = 0;
+ return (cp);
++#endif
+ }
+
+ /* dot_quad_addr - convert dotted quad to internal form */
+diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c
+--- tcp_wrappers_7.6.orig/refuse.c 1994-12-28 17:42:40.000000000 +0100
++++ tcp_wrappers_7.6/refuse.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,12 @@
+ void refuse(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ syslog(deny_severity, "refused connect from %s (%s)",
++ eval_client(request), eval_hostaddr(request->client));
++#else
+ syslog(deny_severity, "refused connect from %s", eval_client(request));
++#endif
+ clean_exit(request);
+ /* NOTREACHED */
+ }
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 1995-01-02 16:11:34.000000000 +0100
++++ tcp_wrappers_7.6/rfc931.c 2004-04-10 19:07:43.000000000 +0200
+@@ -68,20 +68,50 @@
+ /* rfc931 - return remote user name, given socket structures */
+
+ void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char *dest;
+ {
+ unsigned rmt_port;
+ unsigned our_port;
++#ifdef INET6
++ struct sockaddr_storage rmt_query_sin;
++ struct sockaddr_storage our_query_sin;
++ int alen;
++#else
+ struct sockaddr_in rmt_query_sin;
+ struct sockaddr_in our_query_sin;
++#endif
+ char user[256]; /* XXX */
+ char buffer[512]; /* XXX */
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
+
++#ifdef INET6
++ /* address family must be the same */
++ if (rmt_sin->sa_family != our_sin->sa_family) {
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ alen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ alen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++#endif
++
+ /*
+ * Use one unbuffered stdio stream for writing to and for reading from
+ * the RFC931 etc. server. This is done because of a bug in the SunOS
+@@ -92,7 +122,11 @@
+ * sockets.
+ */
+
++#ifdef INET6
++ if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) {
++#else
+ if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) {
++#endif
+ setbuf(fp, (char *) 0);
+
+ /*
+@@ -112,6 +146,25 @@
+ * addresses from the query socket.
+ */
+
++#ifdef INET6
++ memcpy(&our_query_sin, our_sin, alen);
++ memcpy(&rmt_query_sin, rmt_sin, alen);
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
++ ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
++ break;
++ case AF_INET6:
++ ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
++ ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
++ break;
++ }
++
++ if (bind(fileno(fp), (struct sockaddr *) & our_query_sin,
++ alen) >= 0 &&
++ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
++ alen) >= 0) {
++#else
+ our_query_sin = *our_sin;
+ our_query_sin.sin_port = htons(ANY_PORT);
+ rmt_query_sin = *rmt_sin;
+@@ -121,6 +174,7 @@
+ sizeof(our_query_sin)) >= 0 &&
+ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
+ sizeof(rmt_query_sin)) >= 0) {
++#endif
+
+ /*
+ * Send query to server. Neglect the risk that a 13-byte
+@@ -129,8 +183,13 @@
+ */
+
+ fprintf(fp, "%u,%u\r\n",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)rmt_sin)->sin_port),
++ ntohs(((struct sockaddr_in *)our_sin)->sin_port));
++#else
+ ntohs(rmt_sin->sin_port),
+ ntohs(our_sin->sin_port));
++#endif
+ fflush(fp);
+
+ /*
+@@ -144,8 +203,13 @@
+ && ferror(fp) == 0 && feof(fp) == 0
+ && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s",
+ &rmt_port, &our_port, user) == 3
++#ifdef INET6
++ && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port
++ && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) {
++#else
+ && ntohs(rmt_sin->sin_port) == rmt_port
+ && ntohs(our_sin->sin_port) == our_port) {
++#endif
+
+ /*
+ * Strip trailing carriage return. It is part of the
+diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 1997-03-21 19:27:24.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,9 @@
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+
++#ifndef INET6
+ extern char *malloc();
++#endif
+
+ /* Application-specific. */
+
+@@ -39,6 +41,7 @@
+ int deny_severity = LOG_WARNING;
+ int rfc931_timeout = RFC931_TIMEOUT;
+
++#ifndef INET6
+ /* dup_hostent - create hostent in one memory block */
+
+ static struct hostent *dup_hostent(hp)
+@@ -73,9 +76,46 @@
+ }
+ return (&hb->host);
+ }
++#endif
+
+ /* find_inet_addr - find all addresses for this host, result to free() */
+
++#ifdef INET6
++struct addrinfo *find_inet_addr(host)
++char *host;
++{
++ struct addrinfo hints, *res;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(host, NULL, &hints, &res) == 0)
++ return (res);
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host, NULL, &hints, &res) != 0) {
++ tcpd_warn("%s: host not found", host);
++ return (0);
++ }
++ if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) {
++ tcpd_warn("%d: not an internet host", res->ai_family);
++ freeaddrinfo(res);
++ return (0);
++ }
++ if (!res->ai_canonname) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(cannot obtain official name)", res->ai_canonname);
++ } else if (STR_NE(host, res->ai_canonname)) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname);
++ }
++ return (res);
++}
++#else
+ struct hostent *find_inet_addr(host)
+ char *host;
+ {
+@@ -118,6 +158,7 @@
+ }
+ return (dup_hostent(hp));
+ }
++#endif
+
+ /* check_dns - give each address thorough workout, return address count */
+
+@@ -125,8 +166,13 @@
+ char *host;
+ {
+ struct request_info request;
++#ifdef INET6
++ struct sockaddr_storage sin;
++ struct addrinfo *hp, *res;
++#else
+ struct sockaddr_in sin;
+ struct hostent *hp;
++#endif
+ int count;
+ char *addr;
+
+@@ -134,11 +180,18 @@
+ return (0);
+ request_init(&request, RQ_CLIENT_SIN, &sin, 0);
+ sock_methods(&request);
++#ifndef INET6
+ memset((char *) &sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
++#endif
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr));
++#endif
+
+ /*
+ * Force host name and address conversions. Use the request structure
+@@ -151,7 +204,11 @@
+ tcpd_warn("host address %s->name lookup failed",
+ eval_hostaddr(request.client));
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ return (count);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h
+--- tcp_wrappers_7.6.orig/scaffold.h 1994-12-31 18:19:20.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.h 2004-04-10 19:07:43.000000000 +0200
+@@ -4,6 +4,10 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifdef INET6
++extern struct addrinfo *find_inet_addr();
++#else
+ extern struct hostent *find_inet_addr();
++#endif
+ extern int check_dns();
+ extern int check_path();
+diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
+--- tcp_wrappers_7.6.orig/socket.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/socket.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,13 +24,22 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#ifdef INT32_T
++typedef uint32_t u_int32_t;
++#endif
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
++#ifdef INET6
++#ifndef NI_WITHSCOPEID
++#define NI_WITHSCOPEID 0
++#endif
++#else
+ extern char *inet_ntoa();
++#endif
+
+ /* Local stuff. */
+
+@@ -79,8 +88,13 @@
+ void sock_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+ int len;
+ char buf[BUFSIZ];
+ int fd = request->fd;
+@@ -109,7 +123,11 @@
+ memset(buf, 0 sizeof(buf));
+ #endif
+ }
++#ifdef INET6
++ request->client->sin = (struct sockaddr *)&client;
++#else
+ request->client->sin = &client;
++#endif
+
+ /*
+ * Determine the server binding. This is used for client username
+@@ -122,7 +140,11 @@
+ tcpd_warn("getsockname: %m");
+ return;
+ }
++#ifdef INET6
++ request->server->sin = (struct sockaddr *)&server;
++#else
+ request->server->sin = &server;
++#endif
+ }
+
+ /* sock_hostaddr - map endpoint address to printable form */
+@@ -130,10 +152,26 @@
+ void sock_hostaddr(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ int salen;
++
++ if (!sin)
++ return;
++#ifdef SIN6_LEN
++ salen = sin->sa_len;
++#else
++ salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in)
++ : sizeof(struct sockaddr_in6);
++#endif
++ getnameinfo(sin, salen, host->addr, sizeof(host->addr),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++#else
+ struct sockaddr_in *sin = host->sin;
+
+ if (sin != 0)
+ STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr));
++#endif
+ }
+
+ /* sock_hostname - map endpoint address to host name */
+@@ -141,6 +179,160 @@
+ void sock_hostname(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ struct sockaddr_in sin4;
++ struct addrinfo hints, *res, *res0 = NULL;
++ int salen, alen, err = 1;
++ char *ap = NULL, *rap, hname[NI_MAXHOST];
++
++ if (sin != NULL) {
++ if (sin->sa_family == AF_INET6) {
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
++
++ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
++ memset(&sin4, 0, sizeof(sin4));
++#ifdef SIN6_LEN
++ sin4.sin_len = sizeof(sin4);
++#endif
++ sin4.sin_family = AF_INET;
++ sin4.sin_port = sin6->sin6_port;
++ sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
++ sin = (struct sockaddr *)&sin4;
++ }
++ }
++ switch (sin->sa_family) {
++ case AF_INET:
++ ap = (char *)&((struct sockaddr_in *)sin)->sin_addr;
++ alen = sizeof(struct in_addr);
++ salen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr;
++ alen = sizeof(struct in6_addr);
++ salen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ break;
++ }
++ if (ap)
++ err = getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD);
++ }
++ if (!err) {
++
++ STRN_CPY(host->name, hname, sizeof(host->name));
++
++ /* reject numeric addresses */
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ freeaddrinfo(res0);
++ res0 = NULL;
++ tcpd_warn("host name/name mismatch: "
++ "reverse lookup results in non-FQDN %s",
++ host->name);
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ }
++ err = !err;
++ }
++ if (!err) {
++ /* we are now sure that this is non-numeric */
++
++ /*
++ * Verify that the address is a member of the address list returned
++ * by gethostbyname(hostname).
++ *
++ * Verify also that gethostbyaddr() and gethostbyname() return the same
++ * hostname, or rshd and rlogind may still end up being spoofed.
++ *
++ * On some sites, gethostbyname("localhost") returns "localhost.domain".
++ * This is a DNS artefact. We treat it as a special case. When we
++ * can't believe the address list from gethostbyname("localhost")
++ * we're in big trouble anyway.
++ */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) {
++
++ /*
++ * Unable to verify that the host name matches the address. This
++ * may be a transient problem or a botched name server setup.
++ */
++
++ tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed",
++ host->name,
++ (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6");
++
++ } else if ((res0->ai_canonname == NULL
++ || STR_NE(host->name, res0->ai_canonname))
++ && STR_NE(host->name, "localhost")) {
++
++ /*
++ * The gethostbyaddr() and gethostbyname() calls did not return
++ * the same hostname. This could be a nameserver configuration
++ * problem. It could also be that someone is trying to spoof us.
++ */
++
++ tcpd_warn("host name/name mismatch: %s != %.*s",
++ host->name, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++
++ } else {
++
++ /*
++ * The address should be a member of the address list returned by
++ * gethostbyname(). We should first verify that the h_addrtype
++ * field is AF_INET, but this program has already caused too much
++ * grief on systems with broken library code.
++ */
++
++ for (res = res0; res; res = res->ai_next) {
++ if (res->ai_family != sin->sa_family)
++ continue;
++ switch (res->ai_family) {
++ case AF_INET:
++ rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr;
++ break;
++ case AF_INET6:
++ /* need to check scope_id */
++ if (((struct sockaddr_in6 *)sin)->sin6_scope_id !=
++ ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) {
++ continue;
++ }
++ rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
++ break;
++ default:
++ continue;
++ }
++ if (memcmp(rap, ap, alen) == 0) {
++ freeaddrinfo(res0);
++ return; /* name is good, keep it */
++ }
++ }
++
++ /*
++ * The host name does not map to the initial address. Perhaps
++ * someone has messed up. Perhaps someone compromised a name
++ * server.
++ */
++
++ getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++ tcpd_warn("host name/address mismatch: %s != %.*s",
++ hname, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++ }
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ if (res0)
++ freeaddrinfo(res0);
++ }
++#else /* INET6 */
+ struct sockaddr_in *sin = host->sin;
+ struct hostent *hp;
+ int i;
+@@ -220,6 +412,7 @@
+ }
+ strcpy(host->name, paranoid); /* name is bad, clobber it */
+ }
++#endif /* INET6 */
+ }
+
+ /* sock_sink - absorb unreceived IP datagram */
+@@ -228,7 +421,11 @@
+ int fd;
+ {
+ char buf[BUFSIZ];
++#ifdef INET6
++ struct sockaddr_storage sin;
++#else
+ struct sockaddr_in sin;
++#endif
+ int size = sizeof(sin);
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c
+--- tcp_wrappers_7.6.orig/tcpd.c 1996-02-11 17:01:33.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.c 2004-04-10 19:07:43.000000000 +0200
+@@ -120,7 +120,12 @@
+
+ /* Report request and invoke the real daemon program. */
+
++#ifdef INET6
++ syslog(allow_severity, "connect from %s (%s)",
++ eval_client(&request), eval_hostaddr(request.client));
++#else
+ syslog(allow_severity, "connect from %s", eval_client(&request));
++#endif
+ closelog();
+ (void) execv(path, argv);
+ syslog(LOG_ERR, "error: cannot execute %s: %m", path);
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 1997-02-12 02:13:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:07:43.000000000 +0200
+@@ -22,6 +22,9 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -397,6 +400,31 @@
+ }
+ }
+
++#ifdef INET6
++static int is_inet6_addr(pat)
++ char *pat;
++{
++ struct addrinfo hints, *res;
++ int len, ret;
++ char ch;
++
++ if (*pat != '[')
++ return (0);
++ len = strlen(pat);
++ if ((ch = pat[len - 1]) != ']')
++ return (0);
++ pat[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0)
++ freeaddrinfo(res);
++ pat[len - 1] = ch;
++ return (ret == 0);
++}
++#endif
++
+ /* check_host - criticize host pattern */
+
+ static int check_host(pat)
+@@ -423,14 +451,27 @@
+ #endif
+ #endif
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
++#ifdef INET6
++ int mask_len;
++
++ if ((dot_quad_addr(pat) == INADDR_NONE
++ || dot_quad_addr(mask) == INADDR_NONE)
++ && (!is_inet6_addr(pat)
++ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
++#else
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
++#endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
+ tcpd_warn("FAIL is no longer recognized");
+ tcpd_warn("(use EXCEPT or DENY instead)");
+ } else if (reserved_name(pat)) { /* other reserved */
+ /* void */ ;
++#ifdef INET6
++ } else if (is_inet6_addr(pat)) { /* IPv6 address */
++ addr_count = 1;
++#endif
+ } else if (NOT_INADDR(pat)) { /* internet name */
+ if (pat[strlen(pat) - 1] == '.') {
+ tcpd_warn("%s: domain or host name ends in dot", pat);
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-04-10 19:07:43.000000000 +0200
+@@ -11,7 +11,11 @@
+ struct host_info {
+ char name[STRING_LENGTH]; /* access via eval_hostname(host) */
+ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */
++#ifdef INET6
++ struct sockaddr *sin; /* socket address or 0 */
++#else
+ struct sockaddr_in *sin; /* socket address or 0 */
++#endif
+ struct t_unitdata *unit; /* TLI transport address or 0 */
+ struct request_info *request; /* for shared information */
+ };
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c
+--- tcp_wrappers_7.6.orig/tcpdmatch.c 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.c 2004-04-10 19:07:43.000000000 +0200
+@@ -57,7 +57,11 @@
+ int argc;
+ char **argv;
+ {
++#ifdef INET6
++ struct addrinfo hints, *hp, *res;
++#else
+ struct hostent *hp;
++#endif
+ char *myname = argv[0];
+ char *client;
+ char *server;
+@@ -68,8 +72,13 @@
+ int ch;
+ char *inetcf = 0;
+ int count;
++#ifdef INET6
++ struct sockaddr_storage server_sin;
++ struct sockaddr_storage client_sin;
++#else
+ struct sockaddr_in server_sin;
+ struct sockaddr_in client_sin;
++#endif
+ struct stat st;
+
+ /*
+@@ -172,13 +181,20 @@
+ if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
+ if ((hp = find_inet_addr(server)) == 0)
+ exit(1);
++#ifndef INET6
+ memset((char *) &server_sin, 0, sizeof(server_sin));
+ server_sin.sin_family = AF_INET;
++#endif
+ request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&server_sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &server_sin.sin_addr, addr,
+ sizeof(server_sin.sin_addr));
++#endif
+
+ /*
+ * Force evaluation of server host name and address. Host name
+@@ -194,7 +210,11 @@
+ fprintf(stderr, "Please specify an address instead\n");
+ exit(1);
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ } else {
+ request_set(&request, RQ_SERVER_NAME, server, 0);
+ }
+@@ -208,6 +228,18 @@
+ tcpdmatch(&request);
+ exit(0);
+ }
++#ifdef INET6
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(client, NULL, &hints, &res) == 0) {
++ freeaddrinfo(res);
++ request_set(&request, RQ_CLIENT_ADDR, client, 0);
++ tcpdmatch(&request);
++ exit(0);
++ }
++#endif
+
+ /*
+ * Perhaps they are testing special client hostname patterns that aren't
+@@ -229,6 +261,34 @@
+ */
+ if ((hp = find_inet_addr(client)) == 0)
+ exit(1);
++#ifdef INET6
++ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
++
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&client_sin, res->ai_addr, res->ai_addrlen);
++
++ /*
++ * getnameinfo() doesn't do reverse lookup against link-local
++ * address. So, we pass through host name evaluation against
++ * such addresses.
++ */
++ if (res->ai_family != AF_INET6 ||
++ !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) {
++ /*
++ * Force evaluation of client host name and address. Host name
++ * conflicts will be reported while eval_hostname() does its job.
++ */
++ request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
++ if (STR_EQ(eval_hostname(request.client), unknown))
++ tcpd_warn("host address %s->name lookup failed",
++ eval_hostaddr(request.client));
++ }
++ tcpdmatch(&request);
++ if (res->ai_next)
++ printf("\n");
++ }
++ freeaddrinfo(hp);
++#else
+ memset((char *) &client_sin, 0, sizeof(client_sin));
+ client_sin.sin_family = AF_INET;
+ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
+@@ -250,6 +310,7 @@
+ printf("\n");
+ }
+ free((char *) hp);
++#endif
+ exit(0);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c
+--- tcp_wrappers_7.6.orig/tli.c 1997-03-21 19:27:26.000000000 +0100
++++ tcp_wrappers_7.6/tli.c 2004-04-10 19:07:43.000000000 +0200
+@@ -65,8 +65,13 @@
+ void tli_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+
+ /*
+ * If we discover that we are using an IP transport, pretend we never
+@@ -76,14 +81,29 @@
+
+ tli_endpoints(request);
+ if ((request->config = tli_transport(request->fd)) != 0
++#ifdef INET6
++ && (STR_EQ(request->config->nc_protofmly, "inet") ||
++ STR_EQ(request->config->nc_protofmly, "inet6"))) {
++#else
+ && STR_EQ(request->config->nc_protofmly, "inet")) {
++#endif
+ if (request->client->unit != 0) {
++#ifdef INET6
++ client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
++ request->client->sin = (struct sockaddr *) &client;
++#else
+ client = *(struct sockaddr_in *) request->client->unit->addr.buf;
+ request->client->sin = &client;
++#endif
+ }
+ if (request->server->unit != 0) {
++#ifdef INET6
++ server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
++ request->server->sin = (struct sockaddr *) &server;
++#else
+ server = *(struct sockaddr_in *) request->server->unit->addr.buf;
+ request->server->sin = &server;
++#endif
+ }
+ tli_cleanup(request);
+ sock_methods(request);
+@@ -187,7 +207,15 @@
+ }
+ while (config = getnetconfig(handlep)) {
+ if (stat(config->nc_device, &from_config) == 0) {
++#ifdef NO_CLONE_DEVICE
++ /*
++ * If the network devices are not cloned (as is the case for
++ * Solaris 8 Beta), we must compare the major device numbers.
++ */
++ if (major(from_config.st_rdev) == major(from_client.st_rdev))
++#else
+ if (minor(from_config.st_rdev) == major(from_client.st_rdev))
++#endif
+ break;
+ }
+ }
+diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c
+--- tcp_wrappers_7.6.orig/update.c 1994-12-28 17:42:56.000000000 +0100
++++ tcp_wrappers_7.6/update.c 2004-04-10 19:07:43.000000000 +0200
+@@ -46,10 +46,18 @@
+ request->fd = va_arg(ap, int);
+ continue;
+ case RQ_CLIENT_SIN:
++#ifdef INET6
++ request->client->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->client->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+ case RQ_SERVER_SIN:
++#ifdef INET6
++ request->server->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->server->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c
+--- tcp_wrappers_7.6.orig/workarounds.c 1996-03-19 16:22:26.000000000 +0100
++++ tcp_wrappers_7.6/workarounds.c 2004-04-10 19:07:43.000000000 +0200
+@@ -166,11 +166,22 @@
+ int *len;
+ {
+ int ret;
++#ifdef INET6
++ struct sockaddr *sin = sa;
++#else
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
++#endif
+
+ if ((ret = getpeername(sock, sa, len)) >= 0
++#ifdef INET6
++ && ((sin->su_si.si_family == AF_INET6
++ && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr))
++ || (sin->su_si.si_family == AF_INET
++ && sin->su_sin.sin_addr.s_addr == 0))) {
++#else
+ && sa->sa_family == AF_INET
+ && sin->sin_addr.s_addr == 0) {
++#endif
+ errno = ENOTCONN;
+ return (-1);
+ } else {
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
new file mode 100644
index 000000000..226106f4f
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
@@ -0,0 +1,153 @@
+Upstream-Status: Backport
+
+Path: news.porcupine.org!news.porcupine.org!not-for-mail
+From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl>
+Newsgroups: comp.mail.sendmail,comp.security.unix
+Subject: TCP Wrapper Blacklist Extension
+Followup-To: poster
+Date: 8 Sep 1997 18:53:13 -0400
+Organization: Wietse's hangout while on sabattical in the USA
+Lines: 147
+Sender: wietse@spike.porcupine.org
+Message-ID: <5v1vkp$h4f$1@spike.porcupine.org>
+NNTP-Posting-Host: spike.porcupine.org
+Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158
+
+The patch below adds a new host pattern to the TCP Wrapper access
+control language. Instead of a host name or address pattern, you
+can specify an external /file/name with host name or address
+patterns. The feature can be used recursively.
+
+The /file/name extension makes it easy to blacklist bad sites, for
+example, to block unwanted electronic mail when libwrap is linked
+into sendmail. Adding hosts to a simple text file is much easier
+than having to edit a more complex hosts.allow/deny file.
+
+I developed this a year or so ago as a substitute for NIS netgroups.
+At that time, I did not consider it of sufficient interest for
+inclusion in the TCP Wrapper distribution. How times have changed.
+
+The patch is relative to TCP Wrappers version 7.6. The main archive
+site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz
+
+Thanks to the Debian LINUX folks for expressing their interest in
+this patch.
+
+ Wietse
+
+
+[diff updated by Md]
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:28:01.000000000 +0200
+@@ -97,6 +97,13 @@
+ `[3ffe:505:2:1::]/64\' matches every address in the range
+ `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
+ .IP \(bu
++A string that begins with a `/\' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace. A file name pattern can be used anywhere
++a host name or address pattern can be used.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:27:05.000000000 +0200
+@@ -253,6 +253,26 @@
+ }
+ }
+
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char *path;
++struct hosts_info *host;
++{
++ char tok[BUFSIZ];
++ int match = NO;
++ FILE *fp;
++
++ if ((fp = fopen(path, "r")) != 0) {
++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++ /* void */ ;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", path);
++ }
++ return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+
+ static int host_match(tok, host)
+@@ -280,6 +300,8 @@
+ tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
+ return (NO);
+ #endif
++ } else if (tok[0] == '/') { /* /file hack */
++ return (hostfile_match(tok, host));
+ } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
+ char *name = eval_hostname(host);
+ return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:27:05.000000000 +0200
+@@ -353,6 +353,8 @@
+ {
+ if (pat[0] == '@') {
+ tcpd_warn("%s: daemon name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: daemon name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: daemon name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -385,6 +387,8 @@
+ {
+ if (pat[0] == '@') { /* @netgroup */
+ tcpd_warn("%s: user name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: user name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: user name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -430,8 +434,13 @@
+ static int check_host(pat)
+ char *pat;
+ {
++ char buf[BUFSIZ];
+ char *mask;
+ int addr_count = 1;
++ FILE *fp;
++ struct tcpd_context saved_context;
++ char *cp;
++ char *wsp = " \t\r\n";
+
+ if (pat[0] == '@') { /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -450,6 +459,21 @@
+ tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++ } else if (pat[0] == '/') { /* /path/name */
++ if ((fp = fopen(pat, "r")) != 0) {
++ saved_context = tcpd_context;
++ tcpd_context.file = pat;
++ tcpd_context.line = 0;
++ while (fgets(buf, sizeof(buf), fp)) {
++ tcpd_context.line++;
++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++ check_host(cp);
++ }
++ tcpd_context = saved_context;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", pat);
++ }
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
+ #ifdef INET6
+ int mask_len;
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
new file mode 100644
index 000000000..260e8d313
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Backport
+
+diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c
+--- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002
++++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002
+@@ -448,6 +448,15 @@
+ int len, mask_len, i = 0;
+ char ch;
+
++ /*
++ * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
++ * different between KAME and Solaris8. While KAME returns
++ * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here.
++ */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE)
++ return (masked_match4(net_tok, mask_tok, string + 7));
++
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+@@ -457,13 +466,6 @@
+ memcpy(&addr, res->ai_addr, sizeof(addr));
+ freeaddrinfo(res);
+
+- if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
+- if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
+- return (NO);
+- return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
+- }
+-
+ /* match IPv6 address against netnumber/prefixlen */
+ len = strlen(net_tok);
+ if (*net_tok != '[' || net_tok[len - 1] != ']')
+diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c
+--- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002
++++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002
+@@ -228,7 +228,7 @@
+ hints.ai_family = sin->sa_family;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
+- if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
+ freeaddrinfo(res0);
+ res0 = NULL;
+ tcpd_warn("host name/name mismatch: "
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
new file mode 100644
index 000000000..d473fb634
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
@@ -0,0 +1,85 @@
+Upstream-Status: Backport
+
+Index: tcp_wrappers_7.6/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig/Makefile
++++ tcp_wrappers_7.6/Makefile
+@@ -45,7 +45,7 @@ what:
+ #
+ # SysV.4 Solaris 2.x OSF AIX
+ #REAL_DAEMON_DIR=/usr/sbin
+-#
++REAL_DAEMON_DIR=/usr/sbin
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+ #
+@@ -513,6 +513,7 @@ VSYSLOG = -Dvsyslog=myvsyslog
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+ #STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -536,6 +537,7 @@ VSYSLOG = -Dvsyslog=myvsyslog
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+
+ FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON
+
+ # The syslog priority at which successful connections are logged.
+
+@@ -632,6 +634,7 @@ TABLES = -DHOSTS_DENY=\"/etc/hosts.deny\
+ # lookups altogether, see the next section.
+
+ PARANOID= -DPARANOID
++PARANOID=
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -645,6 +648,7 @@ PARANOID= -DPARANOID
+ # mode (see previous section) and comment out the following definition.
+
+ HOSTNAME= -DALWAYS_HOSTNAME
++HOSTNAME=
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -671,6 +675,7 @@ HOSTNAME= -DALWAYS_HOSTNAME
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+ # KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+@@ -678,9 +683,10 @@ HOSTNAME= -DALWAYS_HOSTNAME
+ # Protection against weird shells or weird make programs.
+
+ SHELL = /bin/sh
+-.c.o:; $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
+
+-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++COPTS = -O2 -g
++CFLAGS = $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+@@ -713,11 +719,12 @@ all other: config-check tcpd tcpdmatch t
+
+ config-check:
+ @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+- if cmp cflags /tmp/cflags.$$$$ ; \
+- then rm /tmp/cflags.$$$$ ; \
+- else mv /tmp/cflags.$$$$ cflags ; \
++ @set +e; echo $(CFLAGS) >cflags.new ; \
++ if cmp cflags cflags.new ; \
++ then rm cflags.new ; \
++ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
++ @if [ ! -d shared ]; then mkdir shared; fi
+
+ $(LIB): $(LIB_OBJ)
+ rm -f $(LIB)
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
new file mode 100644
index 000000000..bd1396bc7
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
@@ -0,0 +1,255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2004-05-02 15:31:09.000000000 +0200
+@@ -150,15 +150,15 @@
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
+
+ gnu:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -713,7 +713,22 @@
+
+ LIB = libwrap.a
+
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++shared/%.o: %.c
++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ = shared/libwrap.so.$(SOMAJOR)
++SHLIBSO = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
++
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+@@ -731,27 +746,33 @@
+ $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ -$(RANLIB) $(LIB)
+
+-tcpd: tcpd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++ rm -f $(SHLIB)
++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+ $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+-safe_finger: safe_finger.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+-try-from: try-from.o fakelog.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
+@@ -767,7 +788,9 @@
+
+ clean:
+ rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
++ libwrap*.so* \
+ cflags
++ rm -rf shared/
+
+ tidy: clean
+ chmod -R a+r .
+@@ -913,5 +936,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/tcpd.h 2004-05-02 15:37:49.000000000 +0200
+@@ -4,6 +4,15 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -29,10 +38,10 @@
+ char pid[10]; /* access via eval_pid(request) */
+ struct host_info client[1]; /* client endpoint info */
+ struct host_info server[1]; /* server endpoint info */
+- void (*sink) (); /* datagram sink function or 0 */
+- void (*hostname) (); /* address to printable hostname */
+- void (*hostaddr) (); /* address to printable address */
+- void (*cleanup) (); /* cleanup function or 0 */
++ void (*sink) (int); /* datagram sink function or 0 */
++ void (*hostname) (struct host_info *); /* address to printable hostname */
++ void (*hostaddr) (struct host_info *); /* address to printable address */
++ void (*cleanup) (struct request_info *); /* cleanup function or 0 */
+ struct netconfig *config; /* netdir handle */
+ };
+
+@@ -70,20 +79,27 @@
+ #define fromhost sock_host /* no TLI support needed */
+ #endif
+
+-extern int hosts_access(); /* access control */
+-extern void shell_cmd(); /* execute shell command */
+-extern char *percent_x(); /* do %<char> expansion */
+-extern void rfc931(); /* client name from RFC 931 daemon */
+-extern void clean_exit(); /* clean up and exit */
+-extern void refuse(); /* clean up and exit */
+-extern char *xgets(); /* fgets() on steroids */
+-extern char *split_at(); /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern int hosts_access(struct request_info *request); /* access control */
++extern void shell_cmd(char *); /* execute shell command */
++extern char *percent_x(char *, int, char *, struct request_info *);
++ /* do %<char> expansion */
++extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++ /* client name from RFC 931 daemon */
++extern void clean_exit(struct request_info *); /* clean up and exit */
++extern void refuse(struct request_info *); /* clean up and exit */
++extern char *xgets(char *, int, FILE *); /* fgets() on steroids */
++extern char *split_at(char *, int); /* strchr() and split */
++extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */
+
+ /* Global variables. */
+
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity; /* for connection logging */
+ extern int deny_severity; /* for connection logging */
++#endif
+ extern char *hosts_allow_table; /* for verification mode redirection */
+ extern char *hosts_deny_table; /* for verification mode redirection */
+ extern int hosts_access_verbose; /* for verbose matching mode */
+@@ -98,6 +114,8 @@
+ #ifdef __STDC__
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++ char *client_user);
+ #else
+ extern struct request_info *request_init(); /* initialize request */
+ extern struct request_info *request_set(); /* update request structure */
+@@ -121,20 +139,23 @@
+ * host_info structures serve as caches for the lookup results.
+ */
+
+-extern char *eval_user(); /* client user */
+-extern char *eval_hostname(); /* printable hostname */
+-extern char *eval_hostaddr(); /* printable host address */
+-extern char *eval_hostinfo(); /* host name or address */
+-extern char *eval_client(); /* whatever is available */
+-extern char *eval_server(); /* whatever is available */
++extern char *eval_user(struct request_info *); /* client user */
++extern char *eval_hostname(struct host_info *); /* printable hostname */
++extern char *eval_hostaddr(struct host_info *); /* printable host address */
++extern char *eval_hostinfo(struct host_info *); /* host name or address */
++extern char *eval_client(struct request_info *);/* whatever is available */
++extern char *eval_server(struct request_info *);/* whatever is available */
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
+ /* Socket-specific methods, including DNS hostname lookups. */
+
+-extern void sock_host(); /* look up endpoint addresses */
+-extern void sock_hostname(); /* translate address to hostname */
+-extern void sock_hostaddr(); /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host(struct request_info *);
++/* translate address to hostname */
++extern void sock_hostname(struct host_info *);
++/* address to printable address */
++extern void sock_hostaddr(struct host_info *);
+ #define sock_methods(r) \
+ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+
+@@ -182,7 +203,7 @@
+ * behavior.
+ */
+
+-extern void process_options(); /* execute options */
++extern void process_options(char *, struct request_info *);/* execute options */
+ extern int dry_run; /* verification flag */
+
+ /* Bug workarounds. */
+@@ -221,3 +242,7 @@
+ #define strtok my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif
+diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
+--- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100
++++ tcp_wrappers_7.6/weak_symbols.c 2004-05-02 15:31:09.000000000 +0200
+@@ -0,0 +1,11 @@
++ /*
++ * @(#) weak_symbols.h 1.5 99/12/29 23:50
++ *
++ * Author: Anthony Towns <ajt@debian.org>
++ */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY;
++#endif
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
new file mode 100644
index 000000000..eb5685c57
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2003-08-21 03:15:31.000000000 +0200
+@@ -90,6 +90,10 @@
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `n.n.n.n/mm' is interpreted as a
++`net/masklength' pair, where `mm' is the number of consecutive `1'
++bits in the netmask applied to the `n.n.n.n' address.
++.IP \(bu
+ An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
+ `[net]/prefixlen\' pair. An IPv6 host address is matched if
+ `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2003-08-21 03:09:30.000000000 +0200
+@@ -417,7 +417,8 @@
+ if ((addr = dot_quad_addr(string)) == INADDR_NONE)
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++ || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE
++ && (mask = cidr_mask_addr(mask_tok)) == 0)) {
+ #ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
+ #endif
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/misc.c 2003-08-21 03:09:30.000000000 +0200
+@@ -107,3 +107,17 @@
+ }
+ return (runs == 4 ? inet_addr(str) : INADDR_NONE);
+ }
++
++/* cidr_mask_addr - convert cidr netmask length to internal form */
++
++unsigned long cidr_mask_addr(str)
++char *str;
++{
++ int maskbits;
++
++ maskbits = atoi(str);
++ if (maskbits < 1 || maskbits > 32)
++ return (0);
++ return htonl(0xFFFFFFFF << (32 - maskbits));
++}
++
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 03:09:30.000000000 +0200
+@@ -497,12 +497,12 @@
+ int mask_len;
+
+ if ((dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ && (!is_inet6_addr(pat)
+ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
+ #else
+ if (dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ #endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
new file mode 100644
index 000000000..3ca687411
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-25 12:17:59.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-25 12:17:53.000000000 +0200
+@@ -89,6 +89,8 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++`255.255.255.255\' is not a valid mask value, so a single host can be
++matched just by its IP.
+ .IP \(bu
+ An expression of the form `n.n.n.n/mm' is interpreted as a
+ `net/masklength' pair, where `mm' is the number of consecutive `1'
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
new file mode 100644
index 000000000..308737797
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c
+--- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100
++++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100
+@@ -98,6 +98,28 @@
+ }
+ }
+
++/* eval_port - return string with the port */
++char *eval_port(saddr)
++#ifdef INET6
++struct sockaddr *saddr;
++#else
++struct sockaddr_in *saddr;
++#endif
++{
++ static char port[16];
++ if (saddr != 0) {
++ sprintf(port, "%u",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)saddr)->sin_port));
++#else
++ ntohs(saddr->sin_port));
++#endif
++ } else {
++ strcpy(port, "0");
++ }
++ return (port);
++}
++
+ /* eval_client - return string with as much about the client as we know */
+
+ char *eval_client(request)
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100
+@@ -175,6 +175,8 @@
+ unavailable.
+ .IP "%n (%N)"
+ The client (server) host name (or "unknown" or "paranoid").
++.IP "%r (%R)"
++The clients (servers) port number (or "0").
+ .IP %p
+ The daemon process id.
+ .IP %s
+diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c
+--- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100
++++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100
+@@ -63,6 +63,8 @@
+ ch == 'n' ? eval_hostname(request->client) :
+ ch == 'N' ? eval_hostname(request->server) :
+ ch == 'p' ? eval_pid(request) :
++ ch == 'r' ? eval_port(request->client->sin) :
++ ch == 'R' ? eval_port(request->server->sin) :
+ ch == 's' ? eval_server(request) :
+ ch == 'u' ? eval_user(request) :
+ ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100
+@@ -145,6 +145,11 @@
+ extern char *eval_hostinfo(struct host_info *); /* host name or address */
+ extern char *eval_client(struct request_info *);/* whatever is available */
+ extern char *eval_server(struct request_info *);/* whatever is available */
++#ifdef INET6
++extern char *eval_port(struct sockaddr *);
++#else
++extern char *eval_port(struct sockaddr_in *);
++#endif
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
new file mode 100644
index 000000000..4cc554fc3
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
+--- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100
++++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
new file mode 100644
index 000000000..3ba214d24
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+
+Index: tcp_wrappers_7.6.orig/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig.orig/Makefile 2009-04-06 10:55:47.000000000 +0000
++++ tcp_wrappers_7.6.orig/Makefile 2009-04-06 10:57:04.000000000 +0000
+@@ -748,31 +748,31 @@
+
+ $(SHLIB): $(SHLIB_OBJ)
+ rm -f $(SHLIB)
+- $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ $(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
+ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
+ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
+
+ tcpd: tcpd.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+ safe_finger: safe_finger.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+ tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+ try-from: try-from.o fakelog.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+ tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
new file mode 100644
index 000000000..797352579
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
@@ -0,0 +1,54 @@
+From daf89d272e51b2153015ce7f54ab0b86182e64c1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 18:50:23 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+make: *** No rule to make target `cflags', needed by `tcpd.o'. Stop.
+
+Let "cflags" depend on config-check which generates cflgas will fix the
+problem.
+
+Also fixed:
+Fatal error: can't create shared/hosts_access.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fe5e732..f468751 100644
+--- a/Makefile
++++ b/Makefile
+@@ -714,6 +714,7 @@ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+ LIB = libwrap.a
+
+ shared/%.o: %.c
++ [ -d shared ] || mkdir -p shared
+ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
+
+ SOMAJOR = 0
+@@ -730,6 +731,8 @@ SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
+
+ all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
++cflags: config-check
++
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+ config-check:
+@@ -739,7 +742,7 @@ config-check:
+ then rm cflags.new ; \
+ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
+- @if [ ! -d shared ]; then mkdir shared; fi
++ @[ -d shared ] || mkdir -p shared
+
+ $(LIB): $(LIB_OBJ)
+ rm -f $(LIB)
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
new file mode 100644
index 000000000..19bd7d3c0
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2004-04-25 00:10:48.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.3 2004-04-25 00:09:36.000000000 +0200
+@@ -14,6 +14,9 @@
+ struct request_info *request_set(request, key, value, ..., 0)
+ struct request_info *request;
+
++void fromhost(request)
++struct request_info *request;
++
+ int hosts_access(request)
+ struct request_info *request;
+
+@@ -60,6 +63,7 @@
+ is available, host names and client user names are looked up on demand,
+ using the request structure as a cache. hosts_access() returns zero if
+ access should be denied.
++fromhost() must be called before hosts_access().
+ .PP
+ hosts_ctl() is a wrapper around the request_init() and hosts_access()
+ routines with a perhaps more convenient interface (though it does not
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
new file mode 100644
index 000000000..eee640e8a
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
@@ -0,0 +1,31 @@
+__BEGIN_DECLS/__END_DECLS are BSD specific and not defined in musl
+glibc and uclibc had sys/cdefs.h doing it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: tcp_wrappers_7.6/tcpd.h
+===================================================================
+--- tcp_wrappers_7.6.orig/tcpd.h
++++ tcp_wrappers_7.6/tcpd.h
+@@ -11,7 +11,9 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Structure to describe one communications endpoint. */
+
+@@ -252,6 +254,8 @@ extern char *fix_strtok();
+ extern char *my_strtok();
+ #endif
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
new file mode 100644
index 000000000..7650600ab
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
@@ -0,0 +1,35 @@
+STRINGS name conflicts with variable for strings tools (e.g. i586-oe-linux-strings)
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- tcp_wrappers_7.6/Makefile.orig 2013-04-18 23:41:58.277981740 +0200
++++ tcp_wrappers_7.6/Makefile 2013-04-18 23:42:42.513978966 +0200
+@@ -309,7 +309,7 @@
+ pyramid:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="environ.o vfprintf.o" \
+- STRINGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
++ STRINGS_FLAGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
+ NETGROUP="-DNETGROUP -DUSE_GETDOMAIN" TLI= all
+
+ # Untested.
+@@ -419,7 +419,7 @@
+ # Uncomment the following if your C library does not provide the
+ # strchr/strrchr/memcmp routines, but comes with index/rindex/bcmp.
+ #
+-#STRINGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
++#STRINGS_FLAGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
+
+ #################################################################
+ # System dependencies: selection of non-default object libraries.
+@@ -690,7 +690,7 @@
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+- $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
++ $(UCHAR) $(TABLES) $(STRINGS_FLAGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+ $(VSYSLOG) $(HOSTNAME)
+
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 000000000..5875b81b2
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
+@@ -92,6 +92,8 @@
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
++ unsigned saved_timeout;
++ struct sigaction nact, oact;
+
+ #ifdef INET6
+ /* address family must be the same */
+@@ -134,7 +136,12 @@
+ */
+
+ if (setjmp(timebuf) == 0) {
+- signal(SIGALRM, timeout);
++ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ saved_timeout = alarm(0);
++ nact.sa_handler = timeout;
++ nact.sa_flags = 0;
++ (void) sigemptyset(&nact.sa_mask);
++ (void) sigaction(SIGALRM, &nact, &oact);
+ alarm(rfc931_timeout);
+
+ /*
+@@ -223,6 +230,10 @@
+ }
+ alarm(0);
+ }
++ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ (void) sigaction(SIGALRM, &oact, NULL);
++ if (saved_timeout > 0)
++ alarm(saved_timeout);
+ fclose(fp);
+ }
+ STRN_CPY(dest, result, STRING_LENGTH);
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
new file mode 100644
index 000000000..723f4f136
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2005-03-09 18:20:47.000000000 +0100
+@@ -237,10 +237,17 @@ struct request_info *request;
+
+ /* ARGSUSED */
+
+-void rfc931(request)
+-struct request_info *request;
++void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++#endif
++char *dest;
+ {
+- strcpy(request->user, unknown);
++ strcpy(dest, unknown);
+ }
+
+ /* check_path - examine accessibility */
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2005-03-09 18:21:23.000000000 +0100
+@@ -83,7 +83,11 @@ extern int hosts_access(struct request_i
+ extern void shell_cmd(char *); /* execute shell command */
+ extern char *percent_x(char *, int, char *, struct request_info *);
+ /* do %<char> expansion */
++#ifdef INET6
+ extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++#else
++extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *);
++#endif
+ /* client name from RFC 931 daemon */
+ extern void clean_exit(struct request_info *); /* clean up and exit */
+ extern void refuse(struct request_info *); /* clean up and exit */
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
new file mode 100644
index 000000000..875616b9e
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
@@ -0,0 +1,34 @@
+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+safe_finger \- finger client wrapper that protects against nasty stuff
+from finger servers
+.SH SYNOPSIS
+.B safe_finger [finger_options]
+.SH DESCRIPTION
+The
+.B safe_finger
+command protects against nasty stuff from finger servers. Use this
+program for automatic reverse finger probes from the
+.B tcp_wrapper
+.B (tcpd)
+, not the raw finger command. The
+.B safe_finger
+command makes sure that the finger client is not run with root
+privileges. It also runs the finger client with a defined PATH
+environment.
+.B safe_finger
+will also protect you from problems caused by the output of some
+finger servers. The problem: some programs may react to stuff in
+the first column. Other programs may get upset by thrash anywhere
+on a line. File systems may fill up as the finger server keeps
+sending data. Text editors may bomb out on extremely long lines.
+The finger server may take forever because it is somehow wedged.
+.B safe_finger
+takes care of all this badness.
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
new file mode 100644
index 000000000..fc2afeef1
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Backport
+
+--- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c
++++ tcp-wrappers-7.6-ipv6.1/safe_finger.c
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+
+ extern void exit();
+
+ /* Local stuff */
+
+-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+
+ #define TIME_LIMIT 60 /* Do not keep listinging forever */
+ #define INPUT_LENGTH 100000 /* Do not keep listinging forever */
+ #define LINE_LENGTH 128 /* Editors can choke on long lines */
+ #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */
+ #define UNPRIV_NAME "nobody" /* Preferred privilege level */
+-#define UNPRIV_UGID 32767 /* Default uid and gid */
++#define UNPRIV_UGID 65534 /* Default uid and gid */
+
+ int finger_pid;
++int allow_severity = SEVERITY;
++int deny_severity = LOG_WARNING;
+
+ void cleanup(sig)
+ int sig;
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
new file mode 100644
index 000000000..9d7ea042b
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Backport
+
+* Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29
+- added security patch tcp_wrappers-7.6-sig.patch
+
+--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100
+@@ -66,6 +66,7 @@
+
+ #define YES 1
+ #define NO 0
++#define ERR -1
+
+ /*
+ * These variables are globally visible so that they can be redirected in
+@@ -129,9 +129,9 @@
+ return (verdict == AC_PERMIT);
+ if (table_match(hosts_allow_table, request))
+ return (YES);
+- if (table_match(hosts_deny_table, request))
+- return (NO);
+- return (YES);
++ if (table_match(hosts_deny_table, request) == NO)
++ return (YES);
++ return (NO);
+ }
+
+ /* table_match - match table entries with (daemon, client) pair */
+@@ -175,6 +175,7 @@
+ (void) fclose(fp);
+ } else if (errno != ENOENT) {
+ tcpd_warn("cannot open %s: %m", table);
++ match = ERR;
+ }
+ if (match) {
+ if (hosts_access_verbose > 1)
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
new file mode 100644
index 000000000..76dd6340b
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200
+@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
+
+ int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+
+ /* fsocket - open stdio stream on top of socket */
+
+@@ -62,7 +62,7 @@ int protocol;
+ static void timeout(sig)
+ int sig;
+ {
+- longjmp(timebuf, sig);
++ siglongjmp(timebuf, sig);
+ }
+
+ /* rfc931 - return remote user name, given socket structures */
+@@ -135,7 +135,7 @@ char *dest;
+ * Set up a timer so we won't get stuck while waiting for the server.
+ */
+
+- if (setjmp(timebuf) == 0) {
++ if (sigsetjmp(timebuf, 0) == 0) {
+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ saved_timeout = alarm(0);
+ nact.sa_handler = timeout;
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
new file mode 100644
index 000000000..8e46df8e1
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
@@ -0,0 +1,59 @@
+commit 88b6984ef0bf3b703c1c851092662b95e91db1ff
+Author: farrah rashid <farrah.rashid@windriver.com>
+Date: Tue Feb 12 09:53:50 2013 -0500
+
+ tcp-wrappers Support for building with glibc
+
+ Added support for socklen_t type to len argument passed to socket related
+ calls. This fixes a bug that causes tcp wrappers to fail when using sshd.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: farrah rashid <farrah.rashid@windriver.com>
+
+diff --git a/fix_options.c b/fix_options.c
+index 7473adf..fe2b442 100644
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -38,7 +38,12 @@ struct request_info *request;
+ #ifdef IP_OPTIONS
+ unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+ char lbuf[BUFFER_SIZE], *lp;
+- int optsize = sizeof(optbuf), ipproto;
++#ifdef __GLIBC__
++ socklen_t optsize = sizeof(optbuf);
++#else
++ int optsize = sizeof(optbuf);
++#endif
++ int ipproto;
+ struct protoent *ip;
+ int fd = request->fd;
+ unsigned int opt;
+diff --git a/socket.c b/socket.c
+index 4b2c575..a0d2987 100644
+--- a/socket.c
++++ b/socket.c
+@@ -95,7 +95,11 @@ struct request_info *request;
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
+ #endif
++#ifdef __GLIBC__
++ socklen_t len;
++#else
+ int len;
++#endif
+ char buf[BUFSIZ];
+ int fd = request->fd;
+
+@@ -426,7 +430,11 @@ int fd;
+ #else
+ struct sockaddr_in sin;
+ #endif
++#ifdef __GLIBC__
++ socklen_t size = sizeof(sin);
++#else
+ int size = sizeof(sin);
++#endif
+
+ /*
+ * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
new file mode 100644
index 000000000..be29bdcfa
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 02:50:37.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 02:50:33.000000000 +0200
+@@ -53,6 +53,24 @@
+ #include "inetcf.h"
+ #include "scaffold.h"
+
++/* list of programs which are known to be linked with libwrap in debian */
++static const char *const libwrap_programs[] = {
++ "portmap", "mountd", "statd", "ugidd",
++ "redir", "rlinetd",
++ "sshd",
++ "atftpd",
++ "diald",
++ "esound",
++ "gdm", "gnome-session",
++ "icecast", "icecast_admin", "icecast_client", "icecast_source",
++ "mysqld",
++ "ntop",
++ "pptpd",
++ "rquotad",
++ "sendmail", "smail",
++ NULL
++};
++
+ /*
+ * Stolen from hosts_access.c...
+ */
+@@ -147,8 +165,8 @@
+ /*
+ * These are not run from inetd but may have built-in access control.
+ */
+- inet_set("portmap", WR_NOT);
+- inet_set("rpcbind", WR_NOT);
++ for (c = 0; libwrap_programs[c]; c++)
++ inet_set(libwrap_programs[c], WR_YES);
+
+ /*
+ * Check accessibility of access control files.
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
new file mode 100644
index 000000000..9c8f30543
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
@@ -0,0 +1,28 @@
+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+try-from \- test program for the tcp_wrapper
+.SH SYNOPSIS
+.B try-from
+.SH DESCRIPTION
+The
+.B try-from
+command can be called via a remote shell command to find out
+if the hostname and address are properly recognized
+by the
+.B tcp_wrapper
+library, if username lookup works, and (SysV only) if the TLI
+on top of IP heuristics work. Diagnostics are reported through
+.BR syslog (3)
+and redirected to stderr.
+
+Example:
+
+rsh host /some/where/try-from
+
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
new file mode 100644
index 000000000..3ece8c301
--- /dev/null
+++ b/poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -0,0 +1,133 @@
+SUMMARY = "Security tool that is a wrapper for TCP daemons"
+HOMEPAGE = "http://www.softpanorama.org/Net/Network_security/TCP_wrappers/"
+DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \
+ services."
+SECTION = "console/network"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
+PR ="r10"
+
+
+PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
+FILES_libwrap = "${base_libdir}/lib*${SOLIBS}"
+FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5"
+FILES_libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libwrap-staticdev = "${libdir}/lib*.a"
+FILES_${PN} = "${sbindir}"
+FILES_${PN}-doc = "${mandir}/man8"
+
+SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
+ file://00_man_quoting.diff \
+ file://01_man_portability.patch \
+ file://05_wildcard_matching.patch \
+ file://06_fix_gethostbyname.patch \
+ file://10_usagi-ipv6.patch \
+ file://11_tcpd_blacklist.patch \
+ file://11_usagi_fix.patch \
+ file://12_makefile_config.patch \
+ file://13_shlib_weaksym.patch \
+ file://14_cidr_support.patch \
+ file://15_match_clarify.patch \
+ file://expand_remote_port.patch \
+ file://have_strerror.patch \
+ file://man_fromhost.patch \
+ file://restore_sigalarm.patch \
+ file://rfc931.diff \
+ file://safe_finger.patch \
+ file://sig_fix.patch \
+ file://siglongjmp.patch \
+ file://socklen_t.patch \
+ file://tcpdchk_libwrapped.patch \
+ file://ldflags.patch \
+ file://rename_strings_variable.patch \
+ file://try-from.8 \
+ file://safe_finger.8 \
+ file://makefile-fix-parallel.patch \
+ file://musl-decls.patch \
+ file://0001-Fix-build-with-clang.patch \
+ "
+
+SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
+SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d"
+
+S = "${WORKDIR}/tcp_wrappers_${PV}"
+
+EXTRA_OEMAKE = "'CC=${CC}' \
+ 'AR=${AR}' \
+ 'RANLIB=${RANLIB}' \
+ 'REAL_DAEMON_DIR=${sbindir}' \
+ 'STYLE=-DPROCESS_OPTIONS' \
+ 'FACILITY=LOG_DAEMON' \
+ 'SEVERITY=LOG_INFO' \
+ 'BUGS=' \
+ 'VSYSLOG=' \
+ 'RFC931_TIMEOUT=10' \
+ 'ACCESS=-DHOSTS_ACCESS' \
+ 'KILL_OPT=-DKILL_IP_OPTIONS' \
+ 'UMASK=-DDAEMON_UMASK=022' \
+ 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
+ 'LIBS=-lnsl' \
+ 'ARFLAGS=rv' \
+ 'AUX_OBJ=weak_symbols.o' \
+ 'TLI=' \
+ 'COPTS=' \
+ 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
+
+EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-musl = "-DUSE_GETDOMAIN"
+
+EXTRA_OEMAKE_append_libc-musl = " 'LIBS='"
+
+do_compile () {
+ oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
+ all
+}
+
+BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
+MANS3 = "hosts_access"
+MANS5 = "hosts_options"
+MANS8 = "tcpd tcpdchk tcpdmatch"
+do_install () {
+ oe_libinstall -a libwrap ${D}${libdir}
+ oe_libinstall -C shared -so libwrap ${D}${base_libdir}
+
+ if [ "${libdir}" != "${base_libdir}" ] ; then
+ rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+ libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
+ ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
+ rm -f ${D}${base_libdir}/libwrap.so
+ fi
+
+ install -d ${D}${sbindir}
+ for b in ${BINS}; do
+ install -m 0755 $b ${D}${sbindir}/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man3
+ for m in ${MANS3}; do
+ install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man5
+ for m in ${MANS5}; do
+ install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man8
+ for m in ${MANS8}; do
+ install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
+ done
+
+ install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
+ install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
+
+ install -d ${D}${includedir}
+ install -m 0644 tcpd.h ${D}${includedir}/
+
+ install -d ${D}${sysconfdir}
+ touch ${D}${sysconfdir}/hosts.allow
+ touch ${D}${sysconfdir}/hosts.deny
+}
+
+FILES_${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny"
diff --git a/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch b/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch
new file mode 100644
index 000000000..0cf025ff4
--- /dev/null
+++ b/poky/meta/recipes-extended/texi2html/files/0001-Allow-compiling-out-of-source.patch
@@ -0,0 +1,39 @@
+From: Olaf Mandel <o.mandel@menlosystems.com>
+Date: Fri, 21 Oct 2016 13:04:44 +0000
+Subject: [PATCH] Allow compiling out-of-source
+
+Upstream-Status: Backport of [svn://svn.sv.gnu.org/texinfo/trunk r3602]
+---
+ Makefile.am | 2 +-
+ Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3447463..c9b5b5c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -208,7 +208,7 @@ i18n/en.thl i18n/: $(po_document_dir)/po_document/$(PACKAGE)_document.pot
+ done; \
+ msgexec -i $< "$(srcdir)/gettext_to_separated.pl" | "$(srcdir)/separated_to_hash.pl" en > i18n/en.thl; \
+ else \
+- cp -p i18n_ref/*.thl i18n; \
++ cp -p "$(srcdir)/i18n_ref/"*.thl i18n; \
+ fi
+
+ i18n_ref:
+diff --git a/Makefile.in b/Makefile.in
+index 4264b37..a13f84d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1126,7 +1126,7 @@ i18n/en.thl i18n/: $(po_document_dir)/po_document/$(PACKAGE)_document.pot
+ done; \
+ msgexec -i $< "$(srcdir)/gettext_to_separated.pl" | "$(srcdir)/separated_to_hash.pl" en > i18n/en.thl; \
+ else \
+- cp -p i18n_ref/*.thl i18n; \
++ cp -p "$(srcdir)/i18n_ref/"*.thl i18n; \
+ fi
+
+ i18n_ref:
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb b/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
new file mode 100644
index 000000000..afd125b08
--- /dev/null
+++ b/poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Perl script that converts Texinfo to HTML"
+HOMEPAGE = "http://www.nongnu.org/texi2html/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r2"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/texi2html/${BPN}-${PV}.tar.bz2 \
+ file://0001-Allow-compiling-out-of-source.patch \
+ "
+
+SRC_URI[md5sum] = "f15ac876fcdc8be865b16535f480aa54"
+SRC_URI[sha256sum] = "e8a98b0ee20c495a6ab894398a065ef580272dbd5a15b1b19e8bd1bc89d9f9fa"
+
+inherit autotools gettext texinfo
+
+do_configure_prepend() {
+ # autotools_do_configure updates po/Makefile.in.in, we also need
+ # update po_document.
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_messages/
+}
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2html
+}
+
+FILES_${PN}-doc += "${datadir}/texinfo"
+
+RDEPENDS_${PN} = "perl"
diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
new file mode 100644
index 000000000..1254bc89b
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Fake version of the texinfo utility suite"
+SECTION = "console/utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d6bb62e73ca8b901d3f2e9d71542f4bb"
+DEPENDS = ""
+PV = "1.0"
+
+SRC_URI = "file://template.py file://COPYING"
+
+S = "${WORKDIR}"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+inherit native
+
+do_install_name() {
+ FILENAME="${D}${bindir}/$1"
+ # Using ln causes problems with rm_work
+ cp -T "${S}/template.py" "$FILENAME"
+ chmod +x $FILENAME
+}
+
+do_install() {
+ mkdir -p "${D}${bindir}"
+ for i in makeinfo pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+ txixml2texi texi2any install-info ginstall-info \
+ update-info-dir; do
+ do_install_name $i
+ done
+}
diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
new file mode 100644
index 000000000..531cbe723
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Intel Corp.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
new file mode 100644
index 000000000..e369f7445
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python3
+
+# template.py (and other filenames)
+# By Max Eliaser (max.eliaser@intel.com)
+
+# Copyright (c) 2014 Intel Corp.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# This program acts like a dummy version of the texinfo utilities, creating
+# the right output files but leaving them blank. It will parse out the name
+# of the executable from argv[0] and emulate the corresponding program, so
+# multiple copies of this script will exist under different names.
+
+import sys, os
+
+olong = "--output="
+Elong = "--macro-expand="
+
+
+this_binary = sys.argv[0].split ("/")[-1]
+
+# To be outputted if functionality that hasn't been stubbed yet is invoked.
+stub_msg = """
+This stand-in version of %s is not yet fully capable of emulating the real
+version from the GNU texinfo suite. If you see this message, file a bug report
+with details on the recipe that failed.
+""" % this_binary
+
+# Autotools setups query the version, so this is actually necessary. Some of
+# them (lookin' at you, glibc) actually look for the substring "GNU texinfo,"
+# so we put that substring in there without actually telling a lie.
+version_str = """ %s (fake texinfo, emulating GNU texinfo) 5.2
+
+Super amazing version which is totally not fake in any way whatsoever.
+Copyright (C) 2014 Intel Corp. Distributed under the terms of the MIT
+license.
+""" % this_binary
+
+simple_binaries = "pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+ txixml2texi install-info ginstall-info \
+ update-info-dir".split ()
+
+# These utilities use a slightly different set of options and flags.
+complex_binaries = "makeinfo texi2any".split ()
+
+valid_binaries = simple_binaries + complex_binaries
+
+# For generating blank output files.
+def touch_file (path):
+ f = open (path, "w")
+ f.close ()
+
+assert this_binary in valid_binaries, \
+ this_binary + " is not one of " + ', '.join (valid_binaries)
+
+if "--version" in sys.argv:
+ print(version_str)
+ sys.exit (0)
+
+# For debugging
+log_interceptions = False
+if log_interceptions:
+ f = open ("/tmp/intercepted_" + this_binary, "a")
+ f.write (' '.join ([this_binary] + sys.argv[1:]) + '\n')
+ f.close ()
+
+# Look through the options and flags, and if necessary, touch any output
+# files.
+arg_idx = 1
+while arg_idx < len (sys.argv):
+ arg = sys.argv [arg_idx]
+
+ if arg == "--":
+ break
+
+ # Something like -I . can result in a need for this (specifically the .)
+ elif len (arg) < 2:
+ pass
+
+ # Check if -o or --output is specified. These can be used at most once.
+ elif arg[0] == '-' and arg[1] != '-' and arg[len (arg) - 1] == 'o':
+ touch_file (sys.argv[arg_idx + 1])
+ sys.exit (0)
+ elif arg.startswith (olong):
+ touch_file (arg.split ("=")[1])
+ sys.exit (0)
+
+ # Check for functionality that isn't implemented yet.
+ else:
+ assert arg[0] != '-' or arg[1] == '-' or 'E' not in arg or \
+ this_binary in simple_binaries, \
+ "-E option not yet supported" + stub_msg
+
+ assert not arg.startswith (Elong), \
+ Elong[:-1] + " option not yet supported" + stub_msg
+
+ arg_idx += 1
+
+# The -o/--output option overrides the default. For makeinfo and texi2any,
+# that default is to look for a @setfilename command in the input file.
+# Otherwise, printing nothing to stdout and then exiting should suffice.
+assert this_binary in simple_binaries, \
+ "Don't know how to get default output file name from input file!" + \
+ stub_msg
+
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..c7338aa47
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: texinfo-5.2/gnulib/lib/Makefile.am
+===================================================================
+--- texinfo-5.2.orig/gnulib/lib/Makefile.am
++++ texinfo-5.2/gnulib/lib/Makefile.am
+@@ -378,7 +378,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch b/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
new file mode 100644
index 000000000..ab6f1658a
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
@@ -0,0 +1,43 @@
+We already DEPEND on the native texinfo being present before building so
+there isn't any need to try and build the required native texinfo binaries
+before cross-compiling. This simplifies the recipe somewhat!
+
+Upstream-Status: Inappropriate oe specific
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-4.13/configure.ac
+===================================================================
+--- texinfo-4.13.orig/configure.ac
++++ texinfo-4.13/configure.ac
+@@ -100,29 +100,7 @@ AC_CANONICAL_BUILD
+ # $native_tools is also added to SUBDIRS in the main Makefile.am,
+ # so that make compiles the native tools first.
+ #
+-if test "$cross_compiling" = no; then
+- native_tools=
+-else
+- native_tools=tools
+- test -d "$native_tools" || mkdir "$native_tools"
+- confdir=`(cd "$srcdir";pwd)`
+- # Make sure the secondary configure won't fail with
+- # "error: source directory already configured".
+- rm -f config.status
+- AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
+- cd "$native_tools" || exit 1
+- # Run secondary configure in alternate environment or
+- # it gets the wrong CC etc.
+- # env -i gives this build host configure a clean environment;
+- # consequently, we have to re-initialize $PATH.
+- env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \
+- PATH="$PATH" \
+- tools_only=1 \
+- ${confdir}/configure --build=${build} --host=${build} \
+- --disable-rpath --disable-nls
+- cd .. || exit 1
+- AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
+-fi
++native_tools=
+ AC_SUBST(native_tools)
+ AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
+
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..f4184399c
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
@@ -0,0 +1,65 @@
+From e89b1c57d76f5cf5acbb0d0187374f7a77bce1e2 Mon Sep 17 00:00:00 2001
+From: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+Date: Tue, 29 Nov 2016 13:43:24 -0600
+Subject: [PATCH] dont-depend-on-help2man
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+---
+ doc/Makefile.am | 2 +-
+ man/Makefile.am | 12 ++++++------
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 39db834..1bb2a4f
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -38,7 +38,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \
+ # Include our texinfo.tex, not Automake's.
+ EXTRA_DIST = epsf.tex texinfo.tex \
+ fdl.texi \
+- $(man_MANS) $(TXI_XLATE) \
++ $(TXI_XLATE) \
+ $(refcard_files) texinfo-tex-test.texi \
+ texinfo-ja.tex short-sample-ja.texi
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 6bfcb3d..a820c96
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -13,24 +13,24 @@
+ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ # These are generated using help2man.
+-man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
++#man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
+
+ # These require the build in info/, thus can't do if we failed to find a
+ # terminal library.
+ if HAVE_TERMLIBS
+-man_MANS += info.1
++#man_MANS += info.1
+ endif
+
+ # These are hand-written.
+-man_MANS += info.5 texinfo.5
++#man_MANS += info.5 texinfo.5
+
+ # This is generated by pod2man, but let's just run it by hand.
+-man_MANS += pod2texi.1
++#man_MANS += pod2texi.1
+
+ # These are just .so's to the common program.
+-man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
++#man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
+
+-EXTRA_DIST = $(man_MANS) ginfo.h2m
++EXTRA_DIST = ginfo.h2m
+
+ # Maintainers should be able to regenerate.
+ MAINTAINERCLEANFILES = $(man_MANS)
+--
+2.9.3
+
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch b/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch
new file mode 100644
index 000000000..0b6e9fd7e
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch
@@ -0,0 +1,16 @@
+install-info uses symbols from zlib so must link against it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-5.1/install-info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/install-info/Makefile.am
++++ texinfo-5.1/install-info/Makefile.am
+@@ -34,4 +34,4 @@ AM_CPPFLAGS = \
+ -I$(top_srcdir)/gnulib/lib \
+ -I$(top_builddir)/gnulib/lib \
+ -DLOCALEDIR=\"$(localedir)\"
+-LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL)
++LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) -lz
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
new file mode 100644
index 000000000..f25352c63
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -0,0 +1,256 @@
+From fe4f00459601efe0cfa75d92749a32237800a530 Mon Sep 17 00:00:00 2001
+From: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+Date: Tue, 29 Nov 2016 12:27:17 -0600
+Subject: [PATCH] texinfo-4.12-zlib
+
+Upstream-Status: Pending
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+---
+ install-info/Makefile.in | 12 ++-----
+ install-info/install-info.c | 79 +++++++++++++++++++++++++++------------------
+ 2 files changed, 49 insertions(+), 42 deletions(-)
+
+diff --git a/install-info/Makefile.in b/install-info/Makefile.in
+index 837d020..ba96579 100644
+--- a/install-info/Makefile.in
++++ b/install-info/Makefile.in
+@@ -216,7 +208,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+ PROGRAMS = $(bin_PROGRAMS)
+ am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
+ ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
+-ginstall_info_LDADD = $(LDADD)
++ginstall_info_LDADD = $(LDADD) -lz
+ am__DEPENDENCIES_1 =
+ ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
+ $(am__DEPENDENCIES_1)
+diff --git a/install-info/install-info.c b/install-info/install-info.c
+index e58189c..8617787 100644
+--- a/install-info/install-info.c
++++ b/install-info/install-info.c
+@@ -22,6 +22,7 @@
+ #include <getopt.h>
+ #include <regex.h>
+ #include <argz.h>
++#include <zlib.h>
+
+ #define TAB_WIDTH 8
+
+@@ -684,15 +685,15 @@ The first time you invoke Info you start off looking at this node.\n\
+
+ Return either stdin reading the file, or a non-stdin pipe reading
+ the output of the compression program. */
+-FILE *
++void *
+ open_possibly_compressed_file (char *filename,
+ void (*create_callback) (char *),
+- char **opened_filename, char **compression_program)
++ char **opened_filename, char **compression_program, int *is_pipe)
+ {
+ char *local_opened_filename, *local_compression_program;
+ int nread;
+ char data[13];
+- FILE *f;
++ gzFile *f;
+
+ /* We let them pass NULL if they don't want this info, but it's easier
+ to always determine it. */
+@@ -700,48 +701,48 @@ open_possibly_compressed_file (char *filename,
+ opened_filename = &local_opened_filename;
+
+ *opened_filename = filename;
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ {
+ *opened_filename = concat (filename, ".gz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".xz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".bz2", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".lz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".lzma", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ #ifdef __MSDOS__
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".igz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".inz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ #endif /* __MSDOS__ */
+ if (!f)
+@@ -757,7 +758,7 @@ open_possibly_compressed_file (char *filename,
+ (*create_callback) (filename);
+
+ /* And try opening it again. */
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ return 0;
+ }
+@@ -767,26 +768,26 @@ open_possibly_compressed_file (char *filename,
+
+ /* Read first few bytes of file rather than relying on the filename.
+ If the file is shorter than this it can't be usable anyway. */
+- nread = fread (data, sizeof (data), 1, f);
+- if (nread != 1)
++ nread = gzread (f, data, sizeof (data));
++ if (nread != sizeof (data))
+ {
+- if (nread == 0)
++ if (nread >= 0)
+ {
+ /* Try to create the file if its empty. */
+- if (feof (f) && create_callback)
++ if (gzeof(f) && create_callback)
+ {
+- if (fclose (f) != 0)
++ if (gzclose(f) != 0)
+ return 0; /* unknown error closing file */
+
+- if (remove (filename) != 0)
++ if (remove(filename) != 0)
+ return 0; /* unknown error deleting file */
+
+ (*create_callback) (filename);
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ return 0;
+- nread = fread (data, sizeof (data), 1, f);
+- if (nread == 0)
++ nread = gzread(f, data, sizeof (data));
++ if (nread >= 0)
+ return 0;
+ goto determine_file_type; /* success */
+ }
+@@ -857,35 +858,40 @@ determine_file_type:
+ *compression_program = NULL;
+
+ /* Seek back over the magic bytes. */
+- if (fseek (f, 0, 0) < 0)
++ if (gzseek (f, 0, SEEK_SET) == -1)
+ return 0;
+
+ if (*compression_program)
+ { /* It's compressed, so open a pipe. */
++ FILE *p;
+ char *command = concat (*compression_program, " -d", "");
+
+- if (fclose (f) < 0)
++ if (gzclose (f) < 0)
+ return 0;
+- f = freopen (*opened_filename, FOPEN_RBIN, stdin);
+- if (!f)
++ p = freopen (*opened_filename, FOPEN_RBIN, stdin);
++ if (!p)
+ return 0;
+- f = popen (command, "r");
+- if (!f)
++ p = popen (command, "r");
++ if (!p)
+ {
+ /* Used for error message in calling code. */
+ *opened_filename = command;
+ return 0;
+ }
++ else
++ *is_pipe = 1;
++ return p;
+ }
+ else
+ {
+-#if O_BINARY
++#if 0 && O_BINARY
+ /* Since this is a text file, and we opened it in binary mode,
+ switch back to text mode. */
+ f = freopen (*opened_filename, "r", f);
+ if (! f)
+ return 0;
+ #endif
++ *is_pipe = 0;
+ }
+
+ return f;
+@@ -904,7 +910,8 @@ readfile (char *filename, int *sizep,
+ void (*create_callback) (char *), char **opened_filename,
+ char **compression_program)
+ {
+- FILE *f;
++ void *f;
++ int pipe_p;
+ int filled = 0;
+ int data_size = 8192;
+ char *data = xmalloc (data_size);
+@@ -912,14 +919,20 @@ readfile (char *filename, int *sizep,
+ /* If they passed the space for the file name to return, use it. */
+ f = open_possibly_compressed_file (filename, create_callback,
+ opened_filename,
+- compression_program);
++ compression_program,
++ &pipe_p);
+
+ if (!f)
+ return 0;
+
+ for (;;)
+ {
+- int nread = fread (data + filled, 1, data_size - filled, f);
++ int nread;
++
++ if (pipe_p)
++ nread = fread (data + filled, 1, data_size - filled, f);
++ else
++ nread = gzread (f, data + filled, data_size - filled);
+ if (nread < 0)
+ return 0;
+ if (nread == 0)
+@@ -938,8 +951,10 @@ readfile (char *filename, int *sizep,
+ /* We need to close the stream, since on some systems the pipe created
+ by popen is simulated by a temporary file which only gets removed
+ inside pclose. */
+- if (f != stdin)
++ if (pipe_p)
+ pclose (f);
++ else
++ gzclose (f);
+
+ *sizep = filled;
+ return data;
+--
+2.9.3
+
diff --git a/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch b/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
new file mode 100644
index 000000000..5b7f32d9a
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [cross build specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: texinfo-5.1/info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/info/Makefile.am
++++ texinfo-5.1/info/Makefile.am
+@@ -76,7 +76,7 @@ cmd_sources = $(srcdir)/session.c $(srcd
+ # more than once.
+ funs.h: makedoc$(EXEEXT) $(cmd_sources)
+ rm -f $(generated_sources)
+- $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)
++ makedoc $(cmd_sources)
+
+ # The following hack is necessary to hint make before the automatic
+ # dependencies are built.
diff --git a/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb b/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb
new file mode 100644
index 000000000..f966457f8
--- /dev/null
+++ b/poky/meta/recipes-extended/texinfo/texinfo_6.5.bb
@@ -0,0 +1,90 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PROVIDES_append_class-native = " texinfo-replacement-native"
+
+def compress_pkg(d):
+ if bb.data.inherits_class('compress_doc', d):
+ compress = d.getVar("DOC_COMPRESS")
+ if compress == "gz":
+ return "gzip"
+ elif compress == "bz2":
+ return "bzip2"
+ elif compress == "xz":
+ return "xz"
+ return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
+DEPENDS = "zlib ncurses texinfo-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+ file://texinfo-4.12-zlib.patch \
+ file://disable-native-tools.patch \
+ file://link-zip.patch \
+ file://dont-depend-on-help2man.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ ${TARGET_PATCH} \
+ "
+
+SRC_URI[md5sum] = "94e8f7149876793030e5518dd8d6e956"
+SRC_URI[sha256sum] = "d34272e4042c46186ddcd66bd5d980c0ca14ff734444686ccf8131f6ec8b1427"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+EXTRA_AUTORECONF += "-I ${S}/gnulib/m4"
+
+do_configure_prepend () {
+ # autotools_do_configure updates po/Makefile.in.in, we also need
+ # update po_document.
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+}
+
+do_compile_prepend() {
+ if [ -d tools ];then
+ oe_runmake -C tools/gnulib/lib
+ fi
+}
+
+do_install_append() {
+ mkdir -p ${D}${datadir}/${tex_texinfo}
+ install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi
+}
+
+do_install_append_class-native() {
+ install -m 755 info/makedoc ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
+ ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+ ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+RDEPENDS_${PN} = "perl"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+ ${datadir}/${tex_texinfo} \
+ ${mandir}/man1 ${mandir}/man5"
+
+# Lie about providing the Locale::gettext_xs module. It is not actually built,
+# but the code will test for it and if not found use Locale::gettext_pp instead.
+# However, this causes a file dependency on perl(Locale::gettext_xs) to be
+# generated, which must be satisfied.
+RPROVIDES_${PN} += "perl(Locale::gettext_xs)"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-extended/time/time_1.8.bb b/poky/meta/recipes-extended/time/time_1.8.bb
new file mode 100644
index 000000000..fb3147a73
--- /dev/null
+++ b/poky/meta/recipes-extended/time/time_1.8.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool that measures CPU resources"
+DESCRIPTION = "time measures many of the CPU resources, such as time and \
+memory, that other programs use."
+HOMEPAGE = "http://www.gnu.org/software/time/"
+SECTION = "utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "time"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${GNU_MIRROR}/time/time-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4e00dcb8c3ab11c7cf5a0d698828ac96"
+SRC_URI[sha256sum] = "8a2f540155961a35ba9b84aec5e77e3ae36c74cecb4484db455960601b7a2e1b"
+
+inherit autotools
diff --git a/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb b/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb
new file mode 100644
index 000000000..7933a5df9
--- /dev/null
+++ b/poky/meta/recipes-extended/tzcode/tzcode-native_2018d.bb
@@ -0,0 +1,30 @@
+# note that we allow for us to use data later than our code version
+#
+SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+LICENSE = "PD & BSD & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
+
+SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
+ http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata \
+ "
+
+UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
+
+SRC_URI[tzcode.md5sum] = "96612b4f5d7e8804fd9a0981c021be90"
+SRC_URI[tzcode.sha256sum] = "7de44e85baad748d217e3fd60706f599f9aec68bce6356b163f52b0dbd40a8d9"
+SRC_URI[tzdata.md5sum] = "871a7ef808eb42ebc551acdb3d661554"
+SRC_URI[tzdata.sha256sum] = "5106eddceb5f1ae3a91dbd3960e1b8b11ba0dc08579a31cf0724a7691b10c054"
+
+S = "${WORKDIR}"
+
+inherit native
+
+EXTRA_OEMAKE += "cc='${CC}'"
+
+do_install () {
+ install -d ${D}${bindir}/
+ install -m 755 zic ${D}${bindir}/
+ install -m 755 zdump ${D}${bindir}/
+ install -m 755 tzselect ${D}${bindir}/
+}
diff --git a/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb b/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb
new file mode 100644
index 000000000..f7fce80b7
--- /dev/null
+++ b/poky/meta/recipes-extended/tzdata/tzdata_2018d.bb
@@ -0,0 +1,215 @@
+SUMMARY = "Timezone data"
+HOMEPAGE = "http://www.iana.org/time-zones"
+SECTION = "base"
+LICENSE = "PD & BSD & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c679c9d6b02bc2757b3eaf8f53c43fba"
+
+DEPENDS = "tzcode-native"
+
+SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+UPSTREAM_CHECK_URI = "http://www.iana.org/time-zones"
+
+SRC_URI[tzdata.md5sum] = "871a7ef808eb42ebc551acdb3d661554"
+SRC_URI[tzdata.sha256sum] = "5106eddceb5f1ae3a91dbd3960e1b8b11ba0dc08579a31cf0724a7691b10c054"
+
+inherit allarch
+
+RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
+ timezone-arctic timezone-asia timezone-atlantic \
+ timezone-australia timezone-europe timezone-indian \
+ timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+S = "${WORKDIR}"
+
+DEFAULT_TIMEZONE ?= "Universal"
+INSTALL_TIMEZONE_FILE ?= "1"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica \
+ factory etcetera backward systemv \
+ "
+# pacificnew
+
+do_compile () {
+ for zone in ${TZONES}; do \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ done
+}
+
+do_install () {
+ install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
+ cp -pPR ${S}/$exec_prefix ${D}/
+ # libc is removing zoneinfo files from package
+ cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
+ cp -pP "${S}/zone1970.tab" ${D}${datadir}/zoneinfo
+ cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
+
+ # Install default timezone
+ if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
+ install -d ${D}${sysconfdir}
+ if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then
+ echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+ fi
+ ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
+ else
+ bberror "DEFAULT_TIMEZONE is set to an invalid value."
+ exit 1
+ fi
+
+ chown -R root:root ${D}
+}
+
+pkg_postinst_${PN} () {
+ etc_lt="$D${sysconfdir}/localtime"
+ src="$D${sysconfdir}/timezone"
+
+ if [ -e ${src} ] ; then
+ tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+ fi
+
+ if [ -z "${tz}" ] ; then
+ exit 0
+ fi
+
+ if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
+ echo "You have an invalid TIMEZONE setting in ${src}"
+ echo "Your ${etc_lt} has been reset to Universal; enjoy!"
+ tz="Universal"
+ echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
+ if [ -L ${etc_lt} ] ; then
+ rm -f "${etc_lt}"
+ fi
+ ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
+ fi
+}
+
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+ tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+ tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \
+ ${datadir}/zoneinfo/US/* \
+ ${datadir}/zoneinfo/Brazil/* \
+ ${datadir}/zoneinfo/Canada/* \
+ ${datadir}/zoneinfo/Mexico/* \
+ ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \
+ ${datadir}/zoneinfo/Indian/* \
+ ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \
+ ${datadir}/zoneinfo/Egypt \
+ ${datadir}/zoneinfo/Eire \
+ ${datadir}/zoneinfo/Factory \
+ ${datadir}/zoneinfo/GB-Eire \
+ ${datadir}/zoneinfo/Hongkong \
+ ${datadir}/zoneinfo/Iceland \
+ ${datadir}/zoneinfo/Iran \
+ ${datadir}/zoneinfo/Israel \
+ ${datadir}/zoneinfo/Jamaica \
+ ${datadir}/zoneinfo/Japan \
+ ${datadir}/zoneinfo/Kwajalein \
+ ${datadir}/zoneinfo/Libya \
+ ${datadir}/zoneinfo/Navajo \
+ ${datadir}/zoneinfo/Poland \
+ ${datadir}/zoneinfo/Portugal \
+ ${datadir}/zoneinfo/Singapore \
+ ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \
+ ${datadir}/zoneinfo/America/Anchorage \
+ ${datadir}/zoneinfo/America/Los_Angeles \
+ ${datadir}/zoneinfo/America/Denver \
+ ${datadir}/zoneinfo/America/Chicago \
+ ${datadir}/zoneinfo/America/New_York \
+ ${datadir}/zoneinfo/America/Caracas \
+ ${datadir}/zoneinfo/America/Sao_Paulo \
+ ${datadir}/zoneinfo/Europe/London \
+ ${datadir}/zoneinfo/Europe/Paris \
+ ${datadir}/zoneinfo/Africa/Cairo \
+ ${datadir}/zoneinfo/Europe/Moscow \
+ ${datadir}/zoneinfo/Asia/Dubai \
+ ${datadir}/zoneinfo/Asia/Karachi \
+ ${datadir}/zoneinfo/Asia/Dhaka \
+ ${datadir}/zoneinfo/Asia/Bangkok \
+ ${datadir}/zoneinfo/Asia/Hong_Kong \
+ ${datadir}/zoneinfo/Asia/Tokyo \
+ ${datadir}/zoneinfo/Australia/Darwin \
+ ${datadir}/zoneinfo/Australia/Adelaide \
+ ${datadir}/zoneinfo/Australia/Brisbane \
+ ${datadir}/zoneinfo/Australia/Sydney \
+ ${datadir}/zoneinfo/Pacific/Noumea \
+ ${datadir}/zoneinfo/CET \
+ ${datadir}/zoneinfo/CST6CDT \
+ ${datadir}/zoneinfo/EET \
+ ${datadir}/zoneinfo/EST \
+ ${datadir}/zoneinfo/EST5EDT \
+ ${datadir}/zoneinfo/GB \
+ ${datadir}/zoneinfo/GMT \
+ ${datadir}/zoneinfo/GMT+0 \
+ ${datadir}/zoneinfo/GMT-0 \
+ ${datadir}/zoneinfo/GMT0 \
+ ${datadir}/zoneinfo/Greenwich \
+ ${datadir}/zoneinfo/HST \
+ ${datadir}/zoneinfo/MET \
+ ${datadir}/zoneinfo/MST \
+ ${datadir}/zoneinfo/MST7MDT \
+ ${datadir}/zoneinfo/NZ \
+ ${datadir}/zoneinfo/NZ-CHAT \
+ ${datadir}/zoneinfo/PRC \
+ ${datadir}/zoneinfo/PST8PDT \
+ ${datadir}/zoneinfo/ROC \
+ ${datadir}/zoneinfo/ROK \
+ ${datadir}/zoneinfo/UCT \
+ ${datadir}/zoneinfo/UTC \
+ ${datadir}/zoneinfo/Universal \
+ ${datadir}/zoneinfo/W-SU \
+ ${datadir}/zoneinfo/WET \
+ ${datadir}/zoneinfo/Zulu \
+ ${datadir}/zoneinfo/zone.tab \
+ ${datadir}/zoneinfo/zone1970.tab \
+ ${datadir}/zoneinfo/iso3166.tab \
+ ${datadir}/zoneinfo/Etc/*"
+
+CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE')) else "" }"
+CONFFILES_${PN} += "${sysconfdir}/localtime"
diff --git a/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch b/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
new file mode 100644
index 000000000..afc4c734a
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
@@ -0,0 +1,403 @@
+From: Giovanni Scafora <giovanni.archlinux.org>
+Subject: unzip files encoded with non-latin, non-unicode file names
+Last-Update: 2015-02-11
+
+Upstream-Status: Backport
+CVE: CVE-2015-1315
+
+Updated 2015-02-11 by Marc Deslauriers <marc.deslauriers@canonical.com>
+to fix buffer overflow in charset_to_intern()
+
+Signed-off-by: Marc Deslauriers <marc.deslauriers@canonical.com>
+
+Index: unzip-6.0/unix/unix.c
+===================================================================
+--- unzip-6.0.orig/unix/unix.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unix.c 2015-02-11 09:18:04.902081319 -0500
+@@ -30,6 +30,9 @@
+ #define UNZIP_INTERNAL
+ #include "unzip.h"
+
++#include <iconv.h>
++#include <langinfo.h>
++
+ #ifdef SCO_XENIX
+ # define SYSNDIR
+ #else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */
+@@ -1874,3 +1877,102 @@
+ }
+ }
+ #endif /* QLZIP */
++
++
++typedef struct {
++ char *local_charset;
++ char *archive_charset;
++} CHARSET_MAP;
++
++/* A mapping of local <-> archive charsets used by default to convert filenames
++ * of DOS/Windows Zip archives. Currently very basic. */
++static CHARSET_MAP dos_charset_map[] = {
++ { "ANSI_X3.4-1968", "CP850" },
++ { "ISO-8859-1", "CP850" },
++ { "CP1252", "CP850" },
++ { "UTF-8", "CP866" },
++ { "KOI8-R", "CP866" },
++ { "KOI8-U", "CP866" },
++ { "ISO-8859-5", "CP866" }
++};
++
++char OEM_CP[MAX_CP_NAME] = "";
++char ISO_CP[MAX_CP_NAME] = "";
++
++/* Try to guess the default value of OEM_CP based on the current locale.
++ * ISO_CP is left alone for now. */
++void init_conversion_charsets()
++{
++ const char *local_charset;
++ int i;
++
++ /* Make a guess only if OEM_CP not already set. */
++ if(*OEM_CP == '\0') {
++ local_charset = nl_langinfo(CODESET);
++ for(i = 0; i < sizeof(dos_charset_map)/sizeof(CHARSET_MAP); i++)
++ if(!strcasecmp(local_charset, dos_charset_map[i].local_charset)) {
++ strncpy(OEM_CP, dos_charset_map[i].archive_charset,
++ sizeof(OEM_CP));
++ break;
++ }
++ }
++}
++
++/* Convert a string from one encoding to the current locale using iconv().
++ * Be as non-intrusive as possible. If error is encountered during covertion
++ * just leave the string intact. */
++static void charset_to_intern(char *string, char *from_charset)
++{
++ iconv_t cd;
++ char *s,*d, *buf;
++ size_t slen, dlen, buflen;
++ const char *local_charset;
++
++ if(*from_charset == '\0')
++ return;
++
++ buf = NULL;
++ local_charset = nl_langinfo(CODESET);
++
++ if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1)
++ return;
++
++ slen = strlen(string);
++ s = string;
++
++ /* Make sure OUTBUFSIZ + 1 never ends up smaller than FILNAMSIZ
++ * as this function also gets called with G.outbuf in fileio.c
++ */
++ buflen = FILNAMSIZ;
++ if (OUTBUFSIZ + 1 < FILNAMSIZ)
++ {
++ buflen = OUTBUFSIZ + 1;
++ }
++
++ d = buf = malloc(buflen);
++ if(!d)
++ goto cleanup;
++
++ bzero(buf,buflen);
++ dlen = buflen - 1;
++
++ if(iconv(cd, &s, &slen, &d, &dlen) == (size_t)-1)
++ goto cleanup;
++ strncpy(string, buf, buflen);
++
++ cleanup:
++ free(buf);
++ iconv_close(cd);
++}
++
++/* Convert a string from OEM_CP to the current locale charset. */
++inline void oem_intern(char *string)
++{
++ charset_to_intern(string, OEM_CP);
++}
++
++/* Convert a string from ISO_CP to the current locale charset. */
++inline void iso_intern(char *string)
++{
++ charset_to_intern(string, ISO_CP);
++}
+Index: unzip-6.0/unix/unxcfg.h
+===================================================================
+--- unzip-6.0.orig/unix/unxcfg.h 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unxcfg.h 2015-02-11 08:46:43.671324260 -0500
+@@ -228,4 +228,30 @@
+ /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
+ /* and notfirstcall are used by do_wild(). */
+
++
++#define MAX_CP_NAME 25
++
++#ifdef SETLOCALE
++# undef SETLOCALE
++#endif
++#define SETLOCALE(category, locale) setlocale(category, locale)
++#include <locale.h>
++
++#ifdef _ISO_INTERN
++# undef _ISO_INTERN
++#endif
++#define _ISO_INTERN(str1) iso_intern(str1)
++
++#ifdef _OEM_INTERN
++# undef _OEM_INTERN
++#endif
++#ifndef IZ_OEM2ISO_ARRAY
++# define IZ_OEM2ISO_ARRAY
++#endif
++#define _OEM_INTERN(str1) oem_intern(str1)
++
++void iso_intern(char *);
++void oem_intern(char *);
++void init_conversion_charsets(void);
++
+ #endif /* !__unxcfg_h */
+Index: unzip-6.0/unzip.c
+===================================================================
+--- unzip-6.0.orig/unzip.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzip.c 2015-02-11 08:46:43.675324290 -0500
+@@ -327,11 +327,21 @@
+ -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\
+ -v verbose, multi-page format\n";
+
++#ifndef UNIX
+ static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
+ -h print header line -t print totals for listed files or for all\n\
+ -z print zipfile comment -T print file times in sortable decimal format\
+ \n -C be case-insensitive %s\
+ -x exclude filenames that follow from listing\n";
++#else /* UNIX */
++static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
++ -h print header line -t print totals for listed files or for all\n\
++ -z print zipfile comment %c-T%c print file times in sortable decimal format\
++\n %c-C%c be case-insensitive %s\
++ -x exclude filenames that follow from listing\n\
++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
++ -I CHARSET specify a character encoding for UNIX and other archives\n";
++#endif /* !UNIX */
+ #ifdef MORE
+ static ZCONST char Far ZipInfoUsageLine4[] =
+ " -M page output through built-in \"more\"\n";
+@@ -664,6 +674,17 @@
+ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\
+ -C match filenames case-insensitively -L make (some) names \
+ lowercase\n %-42s -V retain VMS version numbers\n%s";
++#elif (defined UNIX)
++static ZCONST char Far UnzipUsageLine4[] = "\
++modifiers:\n\
++ -n never overwrite existing files -q quiet mode (-qq => quieter)\n\
++ -o overwrite files WITHOUT prompting -a auto-convert any text files\n\
++ -j junk paths (do not make directories) -aa treat ALL files as text\n\
++ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\
++ -C match filenames case-insensitively -L make (some) names \
++lowercase\n %-42s -V retain VMS version numbers\n%s\
++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
++ -I CHARSET specify a character encoding for UNIX and other archives\n\n";
+ #else /* !VMS */
+ static ZCONST char Far UnzipUsageLine4[] = "\
+ modifiers:\n\
+@@ -802,6 +823,10 @@
+ #endif /* UNICODE_SUPPORT */
+
+
++#ifdef UNIX
++ init_conversion_charsets();
++#endif
++
+ #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
+ extern void DebugMalloc(void);
+
+@@ -1335,6 +1360,11 @@
+ argc = *pargc;
+ argv = *pargv;
+
++#ifdef UNIX
++ extern char OEM_CP[MAX_CP_NAME];
++ extern char ISO_CP[MAX_CP_NAME];
++#endif
++
+ while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) {
+ s = *argv + 1;
+ while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */
+@@ -1516,6 +1546,35 @@
+ }
+ break;
+ #endif /* MACOS */
++#ifdef UNIX
++ case ('I'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Icharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ } else { /* -I charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case ('j'): /* junk pathnames/directory structure */
+ if (negative)
+ uO.jflag = FALSE, negative = 0;
+@@ -1591,6 +1650,35 @@
+ } else
+ ++uO.overwrite_all;
+ break;
++#ifdef UNIX
++ case ('O'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Ocharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ } else { /* -O charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -O argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case ('p'): /* pipes: extract to stdout, no messages */
+ if (negative) {
+ uO.cflag = FALSE;
+Index: unzip-6.0/unzpriv.h
+===================================================================
+--- unzip-6.0.orig/unzpriv.h 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzpriv.h 2015-02-11 08:46:43.675324290 -0500
+@@ -3008,7 +3008,7 @@
+ !(((islochdr) || (isuxatt)) && \
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+- ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
++ ((hostnum) == FS_NTFS_ /* && (hostver) == 50 */ )) { \
+ _OEM_INTERN((string)); \
+ } else { \
+ _ISO_INTERN((string)); \
+Index: unzip-6.0/zipinfo.c
+===================================================================
+--- unzip-6.0.orig/zipinfo.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/zipinfo.c 2015-02-11 08:46:43.675324290 -0500
+@@ -457,6 +457,10 @@
+ int tflag_slm=TRUE, tflag_2v=FALSE;
+ int explicit_h=FALSE, explicit_t=FALSE;
+
++#ifdef UNIX
++ extern char OEM_CP[MAX_CP_NAME];
++ extern char ISO_CP[MAX_CP_NAME];
++#endif
+
+ #ifdef MACOS
+ uO.lflag = LFLAG; /* reset default on each call */
+@@ -501,6 +505,35 @@
+ uO.lflag = 0;
+ }
+ break;
++#ifdef UNIX
++ case ('I'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Icharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ } else { /* -I charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case 'l': /* longer form of "ls -l" type listing */
+ if (negative)
+ uO.lflag = -2, negative = 0;
+@@ -521,6 +554,35 @@
+ G.M_flag = TRUE;
+ break;
+ #endif
++#ifdef UNIX
++ case ('O'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Ocharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ } else { /* -O charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -O argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case 's': /* default: shorter "ls -l" type listing */
+ if (negative)
+ uO.lflag = -2, negative = 0;
diff --git a/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
new file mode 100644
index 000000000..0e497cc65
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
@@ -0,0 +1,53 @@
+From: sms
+Subject: Fix CVE-2014-8139: CRC32 verification heap-based overflow
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8139
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- a/extract.c
++++ b/extract.c
+@@ -298,6 +298,8 @@
+ #ifndef SFX
+ static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
+ EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
++ static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \
++ EF block length (%u bytes) invalid (< %d)\n";
+ static ZCONST char Far InvalidComprDataEAs[] =
+ " invalid compressed data for EAs\n";
+ # if (defined(WIN32) && defined(NTSD_EAS))
+@@ -2023,7 +2025,8 @@
+ ebID = makeword(ef);
+ ebLen = (unsigned)makeword(ef+EB_LEN);
+
+- if (ebLen > (ef_len - EB_HEADSIZE)) {
++ if (ebLen > (ef_len - EB_HEADSIZE))
++ {
+ /* Discovered some extra field inconsistency! */
+ if (uO.qflag)
+ Info(slide, 1, ((char *)slide, "%-22s ",
+@@ -2158,11 +2161,19 @@
+ }
+ break;
+ case EF_PKVMS:
+- if (makelong(ef+EB_HEADSIZE) !=
++ if (ebLen < 4)
++ {
++ Info(slide, 1,
++ ((char *)slide, LoadFarString(TooSmallEBlength),
++ ebLen, 4));
++ }
++ else if (makelong(ef+EB_HEADSIZE) !=
+ crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4),
+ (extent)(ebLen-4)))
++ {
+ Info(slide, 1, ((char *)slide,
+ LoadFarString(BadCRC_EAs)));
++ }
+ break;
+ case EF_PKW32:
+ case EF_PKUNIX:
diff --git a/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch b/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
new file mode 100644
index 000000000..ca4aaadff
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
@@ -0,0 +1,36 @@
+From: sms
+Subject: Fix CVE-2014-8140: out-of-bounds write issue in test_compr_eb()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8140
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+Index: unzip60/extract.c
+===================================================================
+--- unzip60.orig/extract.c
++++ unzip60/extract.c
+@@ -2233,10 +2233,17 @@ static int test_compr_eb(__G__ eb, eb_si
+ if (compr_offset < 4) /* field is not compressed: */
+ return PK_OK; /* do nothing and signal OK */
+
++ /* Return no/bad-data error status if any problem is found:
++ * 1. eb_size is too small to hold the uncompressed size
++ * (eb_ucsize). (Else extract eb_ucsize.)
++ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
++ * 3. eb_ucsize is positive, but eb_size is too small to hold
++ * the compressed data header.
++ */
+ if ((eb_size < (EB_UCSIZE_P + 4)) ||
+- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
+- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+- return IZ_EF_TRUNC; /* no compressed data! */
++ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
++ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
++ return IZ_EF_TRUNC; /* no/bad compressed data! */
+
+ method = makeword(eb + (EB_HEADSIZE + compr_offset));
+ if ((method == STORED) &&
diff --git a/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch b/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
new file mode 100644
index 000000000..c48c23f30
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
@@ -0,0 +1,145 @@
+From: sms
+Subject: Fix CVE-2014-8141: out-of-bounds read issues in getZip64Data()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8141
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+
+--- a/fileio.c
++++ b/fileio.c
+@@ -176,6 +176,8 @@
+ #endif
+ static ZCONST char Far ExtraFieldTooLong[] =
+ "warning: extra field too long (%d). Ignoring...\n";
++static ZCONST char Far ExtraFieldCorrupt[] =
++ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
+
+ #ifdef WINDLL
+ static ZCONST char Far DiskFullQuery[] =
+@@ -2295,7 +2297,12 @@
+ if (readbuf(__G__ (char *)G.extra_field, length) == 0)
+ return PK_EOF;
+ /* Looks like here is where extra fields are read */
+- getZip64Data(__G__ G.extra_field, length);
++ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
++ {
++ Info(slide, 0x401, ((char *)slide,
++ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
++ error = PK_WARN;
++ }
+ #ifdef UNICODE_SUPPORT
+ G.unipath_filename = NULL;
+ if (G.UzO.U_flag < 2) {
+--- a/process.c
++++ b/process.c
+@@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2009-Jan-02 or later
+ (the contents of which are also included in unzip.h) for terms of use.
+@@ -1901,48 +1901,82 @@
+ and a 4-byte version of disk start number.
+ Sets both local header and central header fields. Not terribly clever,
+ but it means that this procedure is only called in one place.
++
++ 2014-12-05 SMS.
++ Added checks to ensure that enough data are available before calling
++ makeint64() or makelong(). Replaced various sizeof() values with
++ simple ("4" or "8") constants. (The Zip64 structures do not depend
++ on our variable sizes.) Error handling is crude, but we should now
++ stay within the buffer.
+ ---------------------------------------------------------------------------*/
+
++#define Z64FLGS 0xffff
++#define Z64FLGL 0xffffffff
++
+ if (ef_len == 0 || ef_buf == NULL)
+ return PK_COOL;
+
+ Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
+ ef_len));
+
+- while (ef_len >= EB_HEADSIZE) {
++ while (ef_len >= EB_HEADSIZE)
++ {
+ eb_id = makeword(EB_ID + ef_buf);
+ eb_len = makeword(EB_LEN + ef_buf);
+
+- if (eb_len > (ef_len - EB_HEADSIZE)) {
+- /* discovered some extra field inconsistency! */
++ if (eb_len > (ef_len - EB_HEADSIZE))
++ {
++ /* Extra block length exceeds remaining extra field length. */
+ Trace((stderr,
+ "getZip64Data: block length %u > rest ef_size %u\n", eb_len,
+ ef_len - EB_HEADSIZE));
+ break;
+ }
+- if (eb_id == EF_PKSZ64) {
+-
++ if (eb_id == EF_PKSZ64)
++ {
+ int offset = EB_HEADSIZE;
+
+- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
+- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.ucsize);
++ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
++ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
++ offset += 8;
+ }
+- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
+- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.csize);
++
++ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
++ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
++ offset += 8;
+ }
+- if (G.crec.relative_offset_local_header == 0xffffffff){
++
++ if (G.crec.relative_offset_local_header == Z64FLGL)
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
+ G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.relative_offset_local_header);
++ offset += 8;
+ }
+- if (G.crec.disk_number_start == 0xffff){
++
++ if (G.crec.disk_number_start == Z64FLGS)
++ {
++ if (offset+ 4 > ef_len)
++ return PK_ERR;
++
+ G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
+- offset += sizeof(G.crec.disk_number_start);
++ offset += 4;
+ }
++#if 0
++ break; /* Expect only one EF_PKSZ64 block. */
++#endif /* 0 */
+ }
+
+- /* Skip this extra field block */
++ /* Skip this extra field block. */
+ ef_buf += (eb_len + EB_HEADSIZE);
+ ef_len -= (eb_len + EB_HEADSIZE);
+ }
diff --git a/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch
new file mode 100644
index 000000000..3c02d596c
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/18-cve-2014-9913-unzip-buffer-overflow.patch
@@ -0,0 +1,33 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2014-9913, buffer overflow in unzip
+Bug: https://sourceforge.net/p/infozip/bugs/27/
+Bug-Debian: https://bugs.debian.org/847485
+Bug-Ubuntu: https://launchpad.net/bugs/387350
+X-Debian-version: 6.0-21
+
+Upstream-Status: Backport
+CVE: CVE-2014-9913
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+--- a/list.c
++++ b/list.c
+@@ -339,7 +339,18 @@
+ G.crec.compression_method == ENHDEFLATED) {
+ methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
+ } else if (methnum >= NUM_METHODS) {
+- sprintf(&methbuf[4], "%03u", G.crec.compression_method);
++ /* 2013-02-26 SMS.
++ * http://sourceforge.net/p/infozip/bugs/27/ CVE-2014-9913.
++ * Unexpectedly large compression methods overflow
++ * &methbuf[]. Use the old, three-digit decimal format
++ * for values which fit. Otherwise, sacrifice the
++ * colon, and use four-digit hexadecimal.
++ */
++ if (G.crec.compression_method <= 999) {
++ sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
++ } else {
++ sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
++ }
+ }
+
+ #if 0 /* GRR/Euro: add this? */
diff --git a/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch b/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch
new file mode 100644
index 000000000..ffadbc2ef
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/19-cve-2016-9844-zipinfo-buffer-overflow.patch
@@ -0,0 +1,32 @@
+From: "Steven M. Schweda" <sms@antinode.info>
+Subject: Fix CVE-2016-9844, buffer overflow in zipinfo
+Bug-Debian: https://bugs.debian.org/847486
+Bug-Ubuntu: https://launchpad.net/bugs/1643750
+X-Debian-version: 6.0-21
+
+Upstream-Status: Backport
+CVE: CVE-2016-9844
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+
+--- a/zipinfo.c
++++ b/zipinfo.c
+@@ -1921,7 +1921,18 @@
+ ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3);
+ methbuf[3] = dtype[dnum];
+ } else if (methnum >= NUM_METHODS) { /* unknown */
+- sprintf(&methbuf[1], "%03u", G.crec.compression_method);
++ /* 2016-12-05 SMS.
++ * https://launchpad.net/bugs/1643750
++ * Unexpectedly large compression methods overflow
++ * &methbuf[]. Use the old, three-digit decimal format
++ * for values which fit. Otherwise, sacrifice the "u",
++ * and use four-digit hexadecimal.
++ */
++ if (G.crec.compression_method <= 999) {
++ sprintf( &methbuf[ 1], "%03u", G.crec.compression_method);
++ } else {
++ sprintf( &methbuf[ 0], "%04X", G.crec.compression_method);
++ }
+ }
+
+ for (k = 0; k < 15; ++k)
diff --git a/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch
new file mode 100644
index 000000000..87eed965d
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+CVE: CVE-2015-7696
+Signed-off-by: Tudor Florea <tudor.flore@enea.com>
+
+From 68efed87fabddd450c08f3112f62a73f61d493c9 Mon Sep 17 00:00:00 2001
+From: Petr Stodulka <pstodulk@redhat.com>
+Date: Mon, 14 Sep 2015 18:23:17 +0200
+Subject: [PATCH 1/2] upstream fix for heap overflow
+
+https://bugzilla.redhat.com/attachment.cgi?id=1073002
+---
+ crypt.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/crypt.c b/crypt.c
+index 784e411..a8975f2 100644
+--- a/crypt.c
++++ b/crypt.c
+@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
+ GLOBAL(pInfo->encrypted) = FALSE;
+ defer_leftover_input(__G);
+ for (n = 0; n < RAND_HEAD_LEN; n++) {
+- b = NEXTBYTE;
++ /* 2012-11-23 SMS. (OUSPG report.)
++ * Quit early if compressed size < HEAD_LEN. The resulting
++ * error message ("unable to get password") could be improved,
++ * but it's better than trying to read nonexistent data, and
++ * then continuing with a negative G.csize. (See
++ * fileio.c:readbyte()).
++ */
++ if ((b = NEXTBYTE) == (ush)EOF)
++ {
++ return PK_ERR;
++ }
+ h[n] = (uch)b;
+ Trace((stdout, " (%02x)", h[n]));
+ }
+--
+2.4.6
diff --git a/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch
new file mode 100644
index 000000000..a8f293674
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+CVE: CVE-2015-7697
+Signed-off-by: Tudor Florea <tudor.flore@enea.com>
+
+From bd8a743ee0a77e65ad07ef4196c4cd366add3f26 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Mon, 14 Sep 2015 18:24:56 +0200
+Subject: [PATCH 2/2] fix infinite loop when extracting empty bzip2 data
+
+---
+ extract.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/extract.c b/extract.c
+index 7134bfe..29db027 100644
+--- a/extract.c
++++ b/extract.c
+@@ -2733,6 +2733,12 @@ __GDEF
+ int repeated_buf_err;
+ bz_stream bstrm;
+
++ if (G.incnt <= 0 && G.csize <= 0L) {
++ /* avoid an infinite loop */
++ Trace((stderr, "UZbunzip2() got empty input\n"));
++ return 2;
++ }
++
+ #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
+ if (G.redirect_slide)
+ wsize = G.redirect_size, redirSlide = G.redirect_buffer;
+--
+2.4.6
diff --git a/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch b/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch
new file mode 100644
index 000000000..8f30e4267
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+unix/Makefile: remove hard coded strip commands
+
+Remove the hard coded strip commands, both LF2 (used in linking) and
+STRIP used alone.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur unzip60.orig/unix/configure unzip60/unix/configure
+--- unzip60.orig/unix/configure 2009-04-16 14:25:12.000000000 -0500
++++ unzip60/unix/configure 2011-06-21 11:23:36.822849960 -0500
+@@ -17,7 +17,7 @@
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+ LFLAGS1=""
+-LFLAGS2="-s"
++LFLAGS2=""
+ LN="ln -s"
+
+ CFLAGS_OPT=''
+diff -ur unzip60.orig/unix/Makefile unzip60/unix/Makefile
+--- unzip60.orig/unix/Makefile 2009-01-18 16:41:18.000000000 -0600
++++ unzip60/unix/Makefile 2011-06-21 11:12:22.900003388 -0500
+@@ -52,7 +52,7 @@
+ CF = $(CFLAGS) $(CF_NOOPT)
+ LFLAGS1 =
+ LF = -o unzip$E $(LFLAGS1)
+-LF2 = -s
++LF2 =
+
+ # UnZipSFX flags
+ SL = -o unzipsfx$E $(LFLAGS1)
+@@ -70,7 +70,7 @@
+ CHMOD = chmod
+ BINPERMS = 755
+ MANPERMS = 644
+-STRIP = strip
++STRIP =
+ E =
+ O = .o
+ M = unix
+@@ -776,7 +776,6 @@
+ #
+ gcc: unix_make
+ $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O3" LF2=""
+- $(STRIP) $(UNZIPS)
+
+ # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
+ hk68: unix_make
diff --git a/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch b/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch
new file mode 100644
index 000000000..5fcd318b2
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch
@@ -0,0 +1,46 @@
+From 190040ebfcf5395a6ccedede2cc9343d34f0a108 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1 AT zoho DOT com>
+Date: Wed, 11 Feb 2015
+Subject: Info-ZIP UnZip buffer overflow
+
+Upstream-Status: Backport
+CVE: CVE-2014-9636
+
+By carefully crafting a corrupt ZIP archive with "extra fields" that
+purport to have compressed blocks larger than the corresponding
+uncompressed blocks in STORED no-compression mode, an attacker can
+trigger a heap overflow that can result in application crash or
+possibly have other unspecified impact.
+
+This patch ensures that when extra fields use STORED mode, the
+"compressed" and uncompressed block sizes match.
+
+Signed-off-by: mancha <mancha1 AT zoho DOT com>
+---
+ extract.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/extract.c
++++ b/extract.c
+@@ -2217,6 +2217,7 @@ static int test_compr_eb(__G__ eb, eb_si
+ ulg eb_ucsize;
+ uch *eb_ucptr;
+ int r;
++ ush method;
+
+ if (compr_offset < 4) /* field is not compressed: */
+ return PK_OK; /* do nothing and signal OK */
+@@ -2226,6 +2227,13 @@ static int test_compr_eb(__G__ eb, eb_si
+ eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+ return IZ_EF_TRUNC; /* no compressed data! */
+
++ method = makeword(eb + (EB_HEADSIZE + compr_offset));
++ if ((method == STORED) &&
++ (eb_size - compr_offset - EB_CMPRHEADLEN != eb_ucsize))
++ return PK_ERR; /* compressed & uncompressed
++ * should match in STORED
++ * method */
++
+ if (
+ #ifdef INT_16BIT
+ (((ulg)(extent)eb_ucsize) != eb_ucsize) ||
diff --git a/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch b/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch
new file mode 100644
index 000000000..659c6e331
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch
@@ -0,0 +1,18 @@
+Pass LDFLAGS to the linker
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <Mikhail_Durnev@mentor.com>
+
+diff -Naur old/unix/configure new/unix/configure
+--- old/unix/configure 2014-01-13 21:59:27.000000000 +1100
++++ new/unix/configure 2014-01-14 16:36:02.000000000 +1100
+@@ -16,7 +16,7 @@
+ CFLAGSR=${CFLAGS}
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+-LFLAGS1=""
++LFLAGS1=${LDFLAGS}
+ LFLAGS2=""
+ LN="ln -s"
+
diff --git a/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch b/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch
new file mode 100644
index 000000000..8e9b06c42
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip/fix-security-format.patch
@@ -0,0 +1,97 @@
+unzip: Fixing security formatting issues
+
+Fix security formatting issues related to sprintf parameters expeted.
+
+[YOCTO #9551]
+[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9551]
+
+Upstream-Status: Pending
+
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+
+diff --git a/extract.c b/extract.c
+index 7cd9123..25c5a62 100644
+--- a/extract.c
++++ b/extract.c
+@@ -475,7 +475,7 @@ int extract_or_test_files(__G) /* return PK-type error code */
+ Info(slide, 0x401, ((char *)slide,
+ LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1));
+ Info(slide, 0x401, ((char *)slide,
+- LoadFarString(ReportMsg)));
++ "%s",LoadFarString(ReportMsg)));
+ error_in_archive = PK_BADERR;
+ }
+ reached_end = TRUE; /* ...so no more left to do */
+@@ -754,8 +754,8 @@ int extract_or_test_files(__G) /* return PK-type error code */
+
+ #ifndef SFX
+ if (no_endsig_found) { /* just to make sure */
+- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
+- Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg)));
++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg)));
++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(ReportMsg)));
+ if (!error_in_archive) /* don't overwrite stronger error */
+ error_in_archive = PK_WARN;
+ }
+diff --git a/list.c b/list.c
+index 15e0011..0b484f6 100644
+--- a/list.c
++++ b/list.c
+@@ -181,7 +181,7 @@ int list_files(__G) /* return PK-type error code */
+ Info(slide, 0x401,
+ ((char *)slide, LoadFarString(CentSigMsg), j));
+ Info(slide, 0x401,
+- ((char *)slide, LoadFarString(ReportMsg)));
++ ((char *)slide, "%s", LoadFarString(ReportMsg)));
+ return PK_BADERR; /* sig not found */
+ }
+ }
+@@ -507,7 +507,7 @@ int list_files(__G) /* return PK-type error code */
+ && (!G.ecrec.is_zip64_archive)
+ && (memcmp(G.sig, end_central_sig, 4) != 0)
+ ) { /* just to make sure again */
+- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg)));
+ error_in_archive = PK_WARN; /* didn't find sig */
+ }
+
+@@ -591,7 +591,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */
+ Info(slide, 0x401,
+ ((char *)slide, LoadFarString(CentSigMsg), j));
+ Info(slide, 0x401,
+- ((char *)slide, LoadFarString(ReportMsg)));
++ ((char *)slide, "%s", LoadFarString(ReportMsg)));
+ return PK_BADERR; /* sig not found */
+ }
+ }
+@@ -674,7 +674,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */
+ ---------------------------------------------------------------------------*/
+
+ if (memcmp(G.sig, end_central_sig, 4)) { /* just to make sure again */
+- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg)));
+ error_in_archive = PK_WARN;
+ }
+ if (*nmember == 0L && error_in_archive <= PK_WARN)
+diff --git a/zipinfo.c b/zipinfo.c
+index 0ac75b3..1e7fa82 100644
+--- a/zipinfo.c
++++ b/zipinfo.c
+@@ -833,7 +833,7 @@ int zipinfo(__G) /* return PK-type error code */
+ Info(slide, 0x401,
+ ((char *)slide, LoadFarString(CentSigMsg), j));
+ Info(slide, 0x401,
+- ((char *)slide, LoadFarString(ReportMsg)));
++ ((char *)slide, "%s", LoadFarString(ReportMsg)));
+ error_in_archive = PK_BADERR; /* sig not found */
+ break;
+ }
+@@ -1022,7 +1022,7 @@ int zipinfo(__G) /* return PK-type error code */
+ && (!G.ecrec.is_zip64_archive)
+ && (memcmp(G.sig, end_central_sig, 4) != 0)
+ ) { /* just to make sure again */
+- Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
++ Info(slide, 0x401, ((char *)slide, "%s", LoadFarString(EndSigMsg)));
+ error_in_archive = PK_WARN; /* didn't find sig */
+ }
+
diff --git a/poky/meta/recipes-extended/unzip/unzip_6.0.bb b/poky/meta/recipes-extended/unzip/unzip_6.0.bb
new file mode 100644
index 000000000..105d048f5
--- /dev/null
+++ b/poky/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -0,0 +1,61 @@
+SUMMARY = "Utilities for extracting and viewing files in .zip archives"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29"
+PE = "1"
+PR = "r5"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz \
+ file://avoid-strip.patch \
+ file://define-ldflags.patch \
+ file://06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch \
+ file://cve-2014-9636.patch \
+ file://09-cve-2014-8139-crc-overflow.patch \
+ file://10-cve-2014-8140-test-compr-eb.patch \
+ file://11-cve-2014-8141-getzip64data.patch \
+ file://CVE-2015-7696.patch \
+ file://CVE-2015-7697.patch \
+ file://fix-security-format.patch \
+ file://18-cve-2014-9913-unzip-buffer-overflow.patch \
+ file://19-cve-2016-9844-zipinfo-buffer-overflow.patch \
+"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+SRC_URI[md5sum] = "62b490407489521db863b523a7f86375"
+SRC_URI[sha256sum] = "036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37"
+
+# exclude version 5.5.2 which triggers a false positive
+UPSTREAM_CHECK_REGEX = "unzip(?P<pver>(?!552).+)\.tgz"
+
+S = "${WORKDIR}/unzip60"
+
+# Makefile uses CF_NOOPT instead of CFLAGS. We lifted the values from
+# Makefile and add CFLAGS. Optimization will be overriden by unzip
+# configure to be -O3.
+#
+EXTRA_OEMAKE = "-e MAKEFLAGS= STRIP=true LF2='' \
+ 'CF_NOOPT=-I. -Ibzip2 -DUNIX ${CFLAGS}'"
+
+export LD = "${CC}"
+LD_class-native = "${CC}"
+
+do_compile() {
+ oe_runmake -f unix/Makefile generic
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile install prefix=${D}${prefix}
+ install -d ${D}${mandir}
+ mv ${D}${prefix}/man/* ${D}${mandir}
+ rmdir ${D}${prefix}/man/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "unzip"
+ALTERNATIVE_LINK_NAME[unzip] = "${bindir}/unzip"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config.bb b/poky/meta/recipes-extended/watchdog/watchdog-config.bb
new file mode 100644
index 000000000..8bf40f0f0
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog-config.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Software watchdog"
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed it will reboot \
+the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+ file://watchdog.default \
+ file://watchdog.conf \
+"
+
+do_install() {
+ install -Dm 0644 ${WORKDIR}/watchdog.default ${D}${sysconfdir}/default/watchdog
+ install -Dm 0644 ${WORKDIR}/watchdog.conf ${D}${sysconfdir}/watchdog.conf
+}
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
new file mode 100644
index 000000000..c493d12d3
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.conf
@@ -0,0 +1,42 @@
+#ping = 172.31.14.1
+#ping = 172.26.1.255
+#interface = eth0
+#file = /var/log/messages
+#change = 1407
+
+# Uncomment to enable test. Setting one of these values to '0' disables it.
+# These values will hopefully never reboot your machine during normal use
+# (if your machine is really hung, the loadavg will go much higher than 25)
+#max-load-1 = 24
+#max-load-5 = 18
+#max-load-15 = 12
+
+# Note that this is the number of pages!
+# To get the real size, check how large the pagesize is on your machine.
+#min-memory = 1
+
+#repair-binary = /usr/sbin/repair
+#repair-timeout =
+#test-binary =
+#test-timeout =
+
+watchdog-device = /dev/watchdog
+
+# Defaults compiled into the binary
+#temperature-device =
+#max-temperature = 120
+
+# Defaults compiled into the binary
+#admin = root
+#interval = 1
+#logtick = 1
+#log-dir = /var/log/watchdog
+
+# This greatly decreases the chance that watchdog won't be scheduled before
+# your machine is really loaded
+realtime = yes
+priority = 1
+
+# Check if rsyslogd is still running by enabling the following line
+#pidfile = /var/run/rsyslogd.pid
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
new file mode 100644
index 000000000..647d5abca
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog-config/watchdog.default
@@ -0,0 +1,2 @@
+# Start watchdog at boot time? 0 or 1
+run_watchdog=1
diff --git a/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch b/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch
new file mode 100644
index 000000000..198f19861
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog/0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch
@@ -0,0 +1,32 @@
+From 8f91385dbd5e7c14b36ecbd8a01ca82c709f6d77 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 24 Jun 2016 18:19:29 +0000
+Subject: [PATCH] Include linux/param.h for EXEC_PAGESIZE definition
+
+Musl does not include linux/param.h whereas glibc
+does, so it fails to build on musl.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ src/watchdog.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/watchdog.c b/src/watchdog.c
+index acf6450..486384a 100644
+--- a/src/watchdog.c
++++ b/src/watchdog.c
+@@ -26,6 +26,9 @@
+ #include <sys/param.h> /* For EXEC_PAGESIZE */
+ #include <linux/oom.h>
+ #include <linux/watchdog.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+ #include <string.h>
+
+ #include <libgen.h>
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch b/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch
new file mode 100644
index 000000000..338e0cd14
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog/0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch
@@ -0,0 +1,68 @@
+From c1fe14fa5bd168292cc4670034bc48b954e9dac7 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 13 Mar 2018 14:49:55 +0200
+Subject: [PATCH] watchdog: remove interdependencies of watchdog and
+ wd_keepalive services
+
+Since watchdog and watchdog-keepalive packages can't be installed
+together, remove the inter-dependencies of watchdog and wd_keepalive
+services
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ debian/watchdog.service | 9 +++------
+ debian/wd_keepalive.service | 10 +++++-----
+ 2 files changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/debian/watchdog.service b/debian/watchdog.service
+index 7a2fc36..f31d1fe 100644
+--- a/debian/watchdog.service
++++ b/debian/watchdog.service
+@@ -1,16 +1,13 @@
+ [Unit]
+ Description=watchdog daemon
+-Conflicts=wd_keepalive.service
+ After=multi-user.target
+-OnFailure=wd_keepalive.service
+
+ [Service]
+ Type=forking
+ EnvironmentFile=/etc/default/watchdog
+ ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
+-ExecStart=/bin/sh -c '[ $run_watchdog != 1 ] || exec /usr/sbin/watchdog $watchdog_options'
+-ExecStopPost=/bin/sh -c '[ $run_wd_keepalive != 1 ] || false'
++ExecStart=/bin/sh -c '[ x$run_watchdog != x1 ] || exec /usr/sbin/watchdog $watchdog_options'
++PIDFile=/var/run/watchdog.pid
+
+ [Install]
+-WantedBy=default.target
+-
++WantedBy=multi-user.target
+diff --git a/debian/wd_keepalive.service b/debian/wd_keepalive.service
+index 45b018e..7f8b1dc 100644
+--- a/debian/wd_keepalive.service
++++ b/debian/wd_keepalive.service
+@@ -1,13 +1,13 @@
+ [Unit]
+ Description=watchdog keepalive daemon
+-Before=watchdog.service shutdown.target
+-Conflicts=watchdog.service shutdown.target
++After=multi-user.target
+
+ [Service]
+ Type=forking
+ EnvironmentFile=/etc/default/watchdog
+ ExecStartPre=/bin/sh -c '[ -z "${watchdog_module}" ] || [ "${watchdog_module}" = "none" ] || /sbin/modprobe $watchdog_module'
+-ExecStartPre=-/bin/systemctl reset-failed watchdog.service
+ ExecStart=/usr/sbin/wd_keepalive $watchdog_options
+-ExecStartPost=/bin/sh -c 'ln -s /var/run/wd_keepalive.pid /run/sendsigs.omit.d/wd_keepalive.pid'
+-ExecStopPost=/bin/sh -c 'rm -f /run/sendsigs.omit.d/wd_keepalive.pid'
++PIDFile=/var/run/wd_keepalive.pid
++
++[Install]
++WantedBy=multi-user.target
+--
+2.4.0
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
new file mode 100644
index 000000000..ec44c803b
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
@@ -0,0 +1,16 @@
+Signed-off-by: Diego Rondini <diego.ml@zoho.com>
+Upstream-Status: Inappropriate
+
+Index: watchdog-5.15/watchdog.conf
+===================================================================
+--- watchdog-5.15.orig/watchdog.conf
++++ watchdog-5.15/watchdog.conf
+@@ -28,7 +28,7 @@
+ #retry-timeout = 60
+ #repair-maximum = 1
+
+-#watchdog-device = /dev/watchdog
++watchdog-device = /dev/watchdog
+
+ # Defaults compiled into the binary
+ #temperature-sensor =
diff --git a/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
new file mode 100644
index 000000000..b2765f190
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
@@ -0,0 +1,56 @@
+Signed-off-by: Diego Rondini <diego.ml@zoho.com>
+Upstream-Status: Inappropriate
+
+--- watchdog-5.13.orig/redhat/watchdog.init 2014-11-12 17:18:39.125943000 +0100
++++ watchdog-5.13/redhat/watchdog.init 2014-11-12 18:27:36.189943000 +0100
+@@ -7,7 +7,7 @@
+ # Henning P. Schmiedehausen <hps@tanstaafl.de>
+
+ # Source function library.
+-. /etc/rc.d/init.d/functions
++. /etc/init.d/functions
+
+ [ -x /usr/sbin/watchdog -a -e /etc/watchdog.conf ] || exit 0
+
+@@ -23,22 +23,22 @@
+
+ start() {
+
+- echo -n $"Starting $prog: "
++ echo -n "Starting $prog: "
+ if [ -n "$(pidofproc $prog)" ]; then
+- echo -n $"$prog: already running"
+- echo_failure
++ echo -n "$prog: already running "
++ failure
+ echo
+ return 1
+ fi
+ if [ "$VERBOSE" = "yes" ]; then
+- daemon /usr/sbin/${prog} -v
++ /usr/sbin/${prog} -v
+ else
+- daemon /usr/sbin/${prog}
++ /usr/sbin/${prog}
+ fi
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch $lockfile
+- [ $RETVAL -eq 0 ] && echo_success
+- [ $RETVAL -ne 0 ] && echo_failure
++ [ $RETVAL -eq 0 ] && success
++ [ $RETVAL -ne 0 ] && failure
+ echo
+ return $RETVAL
+ }
+@@ -50,8 +50,10 @@
+ # and reboot the box.
+ killproc $prog -TERM
+ RETVAL=$?
+- echo
+ [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
++ [ $RETVAL -eq 0 ] && success
++ [ $RETVAL -ne 0 ] && failure
++ echo
+ return $RETVAL
+ }
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init b/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init
new file mode 100644
index 000000000..1d3e4c555
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog/wd_keepalive.init
@@ -0,0 +1,121 @@
+#!/bin/sh
+#/etc/init.d/wd_keepalive: start wd_keepalive daemon.
+
+### BEGIN INIT INFO
+# Provides: wd_keepalive
+# Short-Description: Start watchdog keepalive daemon
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# X-Start-Before: $all
+# Default-Start: 2 3 4 5
+# Default-Stop
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+test -x /usr/sbin/wd_keepalive || exit 0
+
+# For configuration of the init script use the file
+# /etc/default/watchdog, do not edit this init script.
+
+# Set run_watchdog to 1 to start watchdog or 0 to disable it.
+run_watchdog=0
+
+# Specify additional watchdog options here (see manpage).
+watchdog_options=""
+
+# Specify module to load
+watchdog_module="none"
+
+[ -e /etc/default/watchdog ] && . /etc/default/watchdog
+
+NAME=wd_keepalive
+DAEMON=/usr/sbin/wd_keepalive
+
+STOP_RETRY_SCHEDULE='TERM/10/forever/KILL/1'
+
+# . /lib/lsb/init-functions
+
+# Mock Debian stuff
+log_begin_msg() {
+ echo -n $*
+}
+
+log_end_msg() {
+ if [ "$1" = "0" ]; then
+ echo 'done'
+ else
+ echo 'error'
+ fi
+}
+
+log_daemon_msg() {
+ echo $*
+}
+
+log_progress_msg() {
+ echo $*
+}
+
+
+case "$1" in
+ start)
+ if [ $run_watchdog = 1 ]
+ then
+ [ ${watchdog_module:-none} != "none" ] && /sbin/modprobe $watchdog_module
+ echo -n "Starting watchdog keepalive daemon: "
+ if start-stop-daemon --start --quiet \
+ --exec $DAEMON -- $watchdog_options
+ then
+ echo wd_keepalive.
+ else
+ echo
+ fi
+ fi
+ ;;
+
+ stop)
+ if [ $run_watchdog = 1 ]
+ then
+ echo -n "Stopping watchdog keepalive daemon: "
+ if start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ $STOP_RETRY_SCHEDULE
+ then
+ echo wd_keepalive.
+ else
+ echo
+ fi
+ fi
+ ;;
+
+ status)
+ status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
+ ;;
+
+ restart)
+ $0 force-reload
+ ;;
+
+ force-reload)
+ if [ $run_watchdog = 0 ]; then exit 0; fi
+ echo -n "Restarting $NAME daemon."
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ $STOP_RETRY_SCHEDULE
+ echo -n "."
+ if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $watchdog_options
+ then
+ echo "done."
+ else
+ echo
+ fi
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/wd_keepalive {start|stop|status|restart|force-reload}"
+ exit 1
+
+esac
+
+exit 0
+
diff --git a/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb b/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb
new file mode 100644
index 000000000..37b37ae12
--- /dev/null
+++ b/poky/meta/recipes-extended/watchdog/watchdog_5.15.bb
@@ -0,0 +1,69 @@
+SUMMARY = "Software watchdog"
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed \
+it will reboot the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
+ file://0001-Include-linux-param.h-for-EXEC_PAGESIZE-definition.patch \
+ file://0001-watchdog-remove-interdependencies-of-watchdog-and-wd.patch \
+ file://watchdog-init.patch \
+ file://watchdog-conf.patch \
+ file://wd_keepalive.init \
+"
+
+SRC_URI[md5sum] = "678c32f6f35a0492c9c1b76b4aa88828"
+SRC_URI[sha256sum] = "ffdc865137ad5d8e53664bd22bad4de6ca136d1b4636720320cb52af0c18947c"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/"
+UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit autotools update-rc.d systemd
+
+DEPENDS_append_libc-musl = " libtirpc "
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+EXTRA_OECONF_append_libc-musl = " --disable-nfs "
+
+INITSCRIPT_PACKAGES = "${PN} ${PN}-keepalive"
+
+INITSCRIPT_NAME_${PN} = "watchdog.sh"
+INITSCRIPT_PARAMS_${PN} = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+INITSCRIPT_NAME_${PN}-keepalive = "wd_keepalive"
+INITSCRIPT_PARAMS_${PN}-keepalive = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+SYSTEMD_PACKAGES = "${PN} ${PN}-keepalive"
+SYSTEMD_SERVICE_${PN} = "watchdog.service"
+SYSTEMD_SERVICE_${PN}-keepalive = "wd_keepalive.service"
+
+do_install_append() {
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${S}/debian/watchdog.service ${D}${systemd_system_unitdir}
+ install -m 0644 ${S}/debian/wd_keepalive.service ${D}${systemd_system_unitdir}
+
+ install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
+ install -Dm 0755 ${WORKDIR}/wd_keepalive.init ${D}${sysconfdir}/init.d/wd_keepalive
+
+ # watchdog.conf is provided by the watchdog-config recipe
+ rm ${D}${sysconfdir}/watchdog.conf
+}
+
+PACKAGES =+ "${PN}-keepalive"
+
+FILES_${PN}-keepalive = " \
+ ${sysconfdir}/init.d/wd_keepalive \
+ ${systemd_system_unitdir}/wd_keepalive.service \
+ ${sbindir}/wd_keepalive \
+"
+
+RDEPENDS_${PN} += "${PN}-config"
+RRECOMMENDS_${PN} += "kernel-module-softdog"
+
+RDEPENDS_${PN}-keepalive += "${PN}-config"
+RCONFLICTS_${PN}-keepalive += "${PN}"
+RRECOMMENDS_${PN}-keepalive += "kernel-module-softdog"
diff --git a/poky/meta/recipes-extended/wget/wget.inc b/poky/meta/recipes-extended/wget/wget.inc
new file mode 100644
index 000000000..3cff656a6
--- /dev/null
+++ b/poky/meta/recipes-extended/wget/wget.inc
@@ -0,0 +1,31 @@
+SUMMARY = "Console URL download utility supporting HTTP, FTP, etc"
+HOMEPAGE = "https://www.gnu.org/software/wget/"
+SECTION = "console/network"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c678957b0c8e964aa6c70fd77641a71e"
+DEPENDS = "gnutls zlib libpcre"
+
+inherit autotools gettext texinfo update-alternatives pkgconfig
+
+EXTRA_OECONF = "--with-ssl=gnutls --disable-rpath --disable-iri \
+ --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
+
+EXTRA_OEMAKE += 'TOOLCHAIN_OPTIONS="${TOOLCHAIN_OPTIONS}" \
+ DEBUG_PREFIX_MAP="${DEBUG_PREFIX_MAP}"'
+
+ALTERNATIVE_${PN} = "wget"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_PRIORITY = "100"
+
+RRECOMMENDS_${PN} += "ca-certificates"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# Let aclocal use the relative path for the m4 file rather than
+# absolute, otherwise there might be an "Argument list too long" error
+# when it is built in a long/deep directory.
+acpaths = "-I ./m4"
diff --git a/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..0b3c6f555
--- /dev/null
+++ b/poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: wget-1.16.3/lib/Makefile.am
+===================================================================
+--- wget-1.16.3.orig/lib/Makefile.am
++++ wget-1.16.3/lib/Makefile.am
+@@ -846,7 +846,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch b/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch
new file mode 100644
index 000000000..8781df21c
--- /dev/null
+++ b/poky/meta/recipes-extended/wget/wget/0002-improve-reproducibility.patch
@@ -0,0 +1,61 @@
+From 7f1357529d23b356b45fbb0dd7388588162e4cb8 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 10 Jan 2018 14:43:20 +0800
+Subject: [PATCH] src/Makefile.am: improve reproducibility
+
+Remove build host references from the internally
+generated file version.c. The references get compiled into
+executables, which leads to non-reproducible builds.
+The removed references (--sysroot, -fdebug-prefix-map) were
+only used as part of the `wget --version' which do not have
+side effect.
+
+...
+$ wget --version
+GNU Wget 1.14 built on linux-gnu.
+
++digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl
+
+Wgetrc:
+ /etc/wgetrc (system)
+Locale: /usr/share/locale
+Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc"
+ -DLOCALEDIR="/usr/share/locale" -I. -I../lib -I../lib -O2 -g -pipe
+ -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
+ --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic
+Link: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
+ -fstack-protector-strong --param=ssp-buffer-size=4
+ -grecord-gcc-switches -m64 -mtune=generic -lssl -lcrypto
+ /usr/lib64/libssl.so /usr/lib64/libcrypto.so /usr/lib64/libz.so
+ -ldl -lz -lz -lidn -luuid -lpcre ftp-opie.o openssl.o http-ntlm.o
+ ../lib/libgnu.a
+...
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/Makefile.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 28c0be2..44084a3 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -87,9 +87,13 @@ version.c: $(wget_SOURCES) ../lib/libgnu.a
+ echo '#include "version.h"' >> $@
+ echo 'const char *version_string = "@VERSION@";' >> $@
+ echo 'const char *compilation_string = "'$(COMPILE)'";' \
++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
++ -e "s,$(DEBUG_PREFIX_MAP),,g" \
+ | $(ESCAPEQUOTE) >> $@
+ echo 'const char *link_string = "'$(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) $(LIBS) $(wget_LDADD)'";' \
++ | sed -e "s,$(TOOLCHAIN_OPTIONS),,g" \
++ -e "s,$(DEBUG_PREFIX_MAP),,g" \
+ | $(ESCAPEQUOTE) >> $@
+
+ css.c: $(srcdir)/css.l
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-extended/wget/wget_1.19.5.bb b/poky/meta/recipes-extended/wget/wget_1.19.5.bb
new file mode 100644
index 000000000..e37d8c784
--- /dev/null
+++ b/poky/meta/recipes-extended/wget/wget_1.19.5.bb
@@ -0,0 +1,9 @@
+SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0002-improve-reproducibility.patch \
+ "
+
+SRC_URI[md5sum] = "2db6f03d655041f82eb64b8c8a1fa7da"
+SRC_URI[sha256sum] = "b39212abe1a73f2b28f4c6cb223c738559caac91d6e416a6d91d4b9d55c9faee"
+
+require wget.inc
diff --git a/poky/meta/recipes-extended/which/which-2.21/automake.patch b/poky/meta/recipes-extended/which/which-2.21/automake.patch
new file mode 100644
index 000000000..4d0f2e4d7
--- /dev/null
+++ b/poky/meta/recipes-extended/which/which-2.21/automake.patch
@@ -0,0 +1,19 @@
+Update autoconf prologue to use "foreign" strictness.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index d974461..a20dfa8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT([which], [2.21])
+ AC_CONFIG_SRCDIR(which.c)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+
+
diff --git a/poky/meta/recipes-extended/which/which_2.21.bb b/poky/meta/recipes-extended/which/which_2.21.bb
new file mode 100644
index 000000000..fac0fd394
--- /dev/null
+++ b/poky/meta/recipes-extended/which/which_2.21.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Displays the full path of shell commands"
+DESCRIPTION = "Which is a utility that prints out the full path of the \
+executables that bash(1) would execute when the passed \
+program names would have been entered on the shell prompt. \
+It does this by using the exact same algorithm as bash."
+SECTION = "libs"
+HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2"
+DEPENDS = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+PR = "r3"
+
+EXTRA_OECONF = "--disable-iberty"
+
+SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
+ file://automake.patch \
+ "
+
+SRC_URI[md5sum] = "097ff1a324ae02e0a3b0369f07a7544a"
+SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad"
+
+do_configure_prepend() {
+ sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-doc = "which.1"
+ALTERNATIVE_LINK_NAME[which.1] = "${mandir}/man1/which.1"
diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch
new file mode 100644
index 000000000..14160bf8d
--- /dev/null
+++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch
@@ -0,0 +1,30 @@
+From 33f42aa8d190b40be18cd0541b5881d46978b572 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 17 Dec 2015 11:50:05 +0200
+Subject: [PATCH] Don't build the in-script manual
+
+Building the contents for "--manual" option requires a web browser
+or java (these are the two options for "xmlto txt" support).
+That's bonkers so don't do it: the man pages are still available
+and contain the same info.
+
+Upstream-Status: Inappropriate [disables in-script docs]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ scripts/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index 430032d..85359bc 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -112,5 +112,5 @@ html/%.html: desc/%.xml
+ (cd html;$(XMLTO) html-nochunks ../$<)
+
+ %.txt: desc/%.xml
+- $(XMLTO) txt $<
++ echo "Please see the man pages." > $@
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
new file mode 100644
index 000000000..e9defadea
--- /dev/null
+++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
@@ -0,0 +1,29 @@
+From 37e227ae1766568d8de55e268bb69bc15eee3529 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 26 Nov 2015 16:01:47 +0200
+Subject: [PATCH] Enable xdg-terminal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ scripts/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index d167393..430032d 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -20,7 +20,8 @@ SCRIPTS = \
+ xdg-open \
+ xdg-email \
+ xdg-screensaver \
+- xdg-settings
++ xdg-settings \
++ xdg-terminal
+ # xdg-su
+ # xdg-copy \
+ # xdg-file-dialog
+--
+2.1.4
+
diff --git a/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb b/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb
new file mode 100644
index 000000000..7339289de
--- /dev/null
+++ b/poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.2.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Basic desktop integration functions"
+HOMEPAGE = "https://www.freedesktop.org/wiki/Software/xdg-utils/"
+DESCRIPTION = "The xdg-utils package is a set of simple scripts that provide basic \
+desktop integration functions for any Free Desktop, such as Linux. \
+They are intended to provide a set of defacto standards. \
+The following scripts are provided at this time: \
+xdg-desktop-icon \
+xdg-desktop-menu \
+xdg-email \
+xdg-icon-resource \
+xdg-mime \
+xdg-open \
+xdg-screensaver \
+xdg-terminal \
+"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5367a90934098d6b05af3b746405014"
+
+SRC_URI = "http://portland.freedesktop.org/download/${BPN}-${PV}.tar.gz \
+ file://0001-Reinstate-xdg-terminal.patch \
+ file://0001-Don-t-build-the-in-script-manual.patch \
+ "
+
+SRC_URI[md5sum] = "361e75eb76c94d19f6f4f330d8ee626b"
+SRC_URI[sha256sum] = "951952e2c6bb21214e0bb54e0dffa057d30f5563300225c24c16fba846258bcc"
+
+UPSTREAM_CHECK_REGEX = "xdg-utils-(?P<pver>((\d+[\.\-_]*)+)((rc|alpha|beta)\d+)?)\.(tar\.gz|tgz)"
+
+# Needs brokensep as this doesn't use automake
+inherit autotools-brokensep distro_features_check
+
+# The xprop requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+DEPENDS = "xmlto-native libxslt-native"
+RDEPENDS_${PN} += "xprop"
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch b/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
new file mode 100644
index 000000000..3c1b2f6f0
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
@@ -0,0 +1,100 @@
+From e8b0ffc7ea04cc71dba97a38e1a134aaf2285c2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 07:14:50 +0000
+Subject: [PATCH] configure: Use HAVE_SYS_RESOURCE_H to guard sys/resource.h
+ inclusion
+
+HAVE_RLIM_T check will not let sys/resource.h to be checked and
+rlim_t is defined in sys/resource.h so the check would fail.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ aclocal.m4 | 2 +-
+ configure | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 6e6f32c..70e7076 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -11,7 +11,7 @@ AC_CACHE_VAL(xinetd_cv_type_$1,
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+diff --git a/configure b/configure
+index b507d38..bec56ea 100755
+--- a/configure
++++ b/configure
+@@ -7640,7 +7640,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7686,7 +7686,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7732,7 +7732,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7778,7 +7778,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7824,7 +7824,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7870,7 +7870,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7916,7 +7916,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+--
+2.6.4
+
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
new file mode 100644
index 000000000..cd6e6c107
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
@@ -0,0 +1,86 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From d588b6530e1382a624898b3f4307f636c72c80a9 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Wed, 28 Nov 2007 10:13:08 +0100
+Subject: [PATCH] Disable services from inetd.conf if a service with the same id exists.
+
+ This way, if a service is enabled in /etc/xinetd* _and_ in
+/etc/inetd.conf, the one (even if disabled) from /etc/xinetd* takes
+precedence.
+
+Signed-off-by: Pierre Habouzit <madcoder@debian.org>
+---
+ xinetd/inet.c | 22 +++++++++++++++++++---
+ 1 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 1cb2ba2..8caab45 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -23,6 +23,8 @@
+ #include "parsesup.h"
+ #include "nvlists.h"
+
++static psi_h iter ;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+ struct service_config *defaults);
+
+@@ -32,12 +34,15 @@ void parse_inet_conf_file( int fd, struct configuration *confp )
+ struct service_config *default_config = CNF_DEFAULTS( confp );
+
+ line_count = 0;
++ iter = psi_create (sconfs);
+
+ for( ;; )
+ {
+ if (get_next_inet_entry(fd, sconfs, default_config) == -2)
+ break;
+ }
++
++ psi_destroy(iter);
+ }
+
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+@@ -46,7 +51,7 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ char *p;
+ str_h strp;
+ char *line = next_line(fd);
+- struct service_config *scp;
++ struct service_config *scp, *tmp;
+ unsigned u, i;
+ const char *func = "get_next_inet_entry";
+ char *name = NULL, *rpcvers = NULL, *rpcproto = NULL;
+@@ -405,7 +410,16 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ SC_SPECIFY( scp, A_SOCKET_TYPE );
+ SC_SPECIFY( scp, A_WAIT );
+
+- if( ! pset_add(sconfs, scp) )
++ for ( tmp = SCP( psi_start( iter ) ) ; tmp ; tmp = SCP( psi_next(iter)) ){
++ if (EQ(SC_ID(scp), SC_ID(tmp))) {
++ parsemsg(LOG_DEBUG, func, "removing duplicate service %s", SC_NAME(scp));
++ sc_free(scp);
++ scp = NULL;
++ break;
++ }
++ }
++
++ if( scp && ! pset_add(sconfs, scp) )
+ {
+ out_of_memory( func );
+ pset_destroy(args);
+@@ -414,7 +428,9 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ }
+
+ pset_destroy(args);
+- parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++ if (scp) {
++ parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++ }
+ return 0;
+ }
+
+--
+1.5.3.6.2040.g15e6
+
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
new file mode 100644
index 000000000..8e59cdcaa
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
@@ -0,0 +1,79 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From a3410b0bc81ab03a889d9ffc14e351badf8372f1 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Mon, 26 Nov 2007 16:02:04 +0100
+Subject: [PATCH] Various fixes from the previous maintainer.
+
+---
+ xinetd/child.c | 20 +++++++++++++++++---
+ xinetd/service.c | 8 ++++----
+ 2 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/xinetd/child.c b/xinetd/child.c
+index 89ee54c..48e9615 100644
+--- a/xinetd/child.c
++++ b/xinetd/child.c
+@@ -284,6 +284,7 @@ void child_process( struct server *serp )
+ connection_s *cp = SERVER_CONNECTION( serp ) ;
+ struct service_config *scp = SVC_CONF( sp ) ;
+ const char *func = "child_process" ;
++ int fd, null_fd;
+
+ signal_default_state();
+
+@@ -296,9 +297,22 @@ void child_process( struct server *serp )
+ signals_pending[0] = -1;
+ signals_pending[1] = -1;
+
+- Sclose(0);
+- Sclose(1);
+- Sclose(2);
++ if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 )
++ {
++ msg( LOG_ERR, func, "open('/dev/null') failed: %m") ;
++ _exit( 1 ) ;
++ }
++
++ for ( fd = 0 ; fd <= MAX_PASS_FD ; fd++ )
++ {
++ if ( fd != null_fd && dup2( null_fd, fd ) == -1 )
++ {
++ msg( LOG_ERR, func, "dup2(%d, %d) failed: %m") ;
++ _exit( 1 ) ;
++ }
++ }
++ if ( null_fd > MAX_PASS_FD )
++ (void) Sclose( null_fd ) ;
+
+
+ #ifdef DEBUG_SERVER
+diff --git a/xinetd/service.c b/xinetd/service.c
+index 3d68d78..0132d6c 100644
+--- a/xinetd/service.c
++++ b/xinetd/service.c
+@@ -745,8 +745,8 @@ static status_e failed_service(struct service *sp,
+ return FAILED;
+
+ if ( last == NULL ) {
+- last = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
+- SVC_LAST_DGRAM_ADDR(sp) = (union xsockaddr *)last;
++ SVC_LAST_DGRAM_ADDR(sp) = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
++ last = SAIN( SVC_LAST_DGRAM_ADDR(sp) );
+ }
+
+ (void) time( &current_time ) ;
+@@ -772,8 +772,8 @@ static status_e failed_service(struct service *sp,
+ return FAILED;
+
+ if( last == NULL ) {
+- last = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
+- SVC_LAST_DGRAM_ADDR( sp ) = (union xsockaddr *)last;
++ SVC_LAST_DGRAM_ADDR(sp) = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
++ last = SAIN6(SVC_LAST_DGRAM_ADDR(sp));
+ }
+
+ (void) time( &current_time ) ;
+--
+1.5.3.6.2040.g15e6
+
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
new file mode 100644
index 000000000..852a43f2d
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
@@ -0,0 +1,34 @@
+xinetd: CVE-2013-4342
+
+xinetd does not enforce the user and group configuration directives
+for TCPMUX services, which causes these services to be run as root
+and makes it easier for remote attackers to gain privileges by
+leveraging another vulnerability in a service.
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4342
+
+the patch come from:
+https://bugzilla.redhat.com/attachment.cgi?id=799732&action=diff
+
+CVE: CVE-2013-4342
+Signed-off-by: Li Wang <li.wang@windriver.com>
+Upstream-Status: Backport
+---
+ xinetd/builtins.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xinetd/builtins.c b/xinetd/builtins.c
+index 3b85579..34a5bac 100644
+--- a/xinetd/builtins.c
++++ b/xinetd/builtins.c
+@@ -617,7 +617,7 @@ static void tcpmux_handler( const struct server *serp )
+ if( SC_IS_INTERNAL( scp ) ) {
+ SC_INTERNAL(scp, nserp);
+ } else {
+- exec_server(nserp);
++ child_process(nserp);
+ }
+ }
+
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
new file mode 100644
index 000000000..2365ca123
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From f44b218ccc779ab3f4aed072390ccf129d94b58d Mon Sep 17 00:00:00 2001
+From: David Madore <david@pleiades.stars>
+Date: Mon, 24 Mar 2008 12:45:36 +0100
+Subject: [PATCH] xinetd should be able to listen on IPv6 even in -inetd_compat mode
+
+xinetd does not bind to IPv6 addresses (and does not seem to have an
+option to do so) when used in -inetd_compat mode. As current inetd's
+are IPv6-aware, this is a problem: this means xinetd cannot be used as
+a drop-in inetd replacement.
+
+The attached patch is a suggestion: it adds a -inetd_ipv6 global
+option that, if used, causes inetd-compatibility lines to have an
+implicit "IPv6" option. Perhaps this is not the best solution, but
+there should definitely be a way to get inetd.conf to be read in
+IPv6-aware mode.
+---
+ xinetd/confparse.c | 1 +
+ xinetd/inet.c | 17 +++++++++++++++++
+ xinetd/options.c | 3 +++
+ xinetd/xinetd.man | 6 ++++++
+ 4 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/xinetd/confparse.c b/xinetd/confparse.c
+index db9f431..d7b0bcc 100644
+--- a/xinetd/confparse.c
++++ b/xinetd/confparse.c
+@@ -40,6 +40,7 @@
+ #include "inet.h"
+ #include "main.h"
+
++extern int inetd_ipv6;
+ extern int inetd_compat;
+
+ /*
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 8caab45..2e617ae 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -25,6 +25,8 @@
+
+ static psi_h iter ;
+
++extern int inetd_ipv6;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+ struct service_config *defaults);
+
+@@ -360,6 +362,21 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ }
+ SC_SERVER_ARGV(scp)[u] = p;
+ }
++
++ /* Set the IPv6 flag if we were passed the -inetd_ipv6 option */
++ if ( inetd_ipv6 )
++ {
++ nvp = nv_find_value( service_flags, "IPv6" );
++ if ( nvp == NULL )
++ {
++ parsemsg( LOG_WARNING, func, "inetd.conf - Bad foo %s", name ) ;
++ pset_destroy(args);
++ sc_free(scp);
++ return -1;
++ }
++ M_SET(SC_XFLAGS(scp), nvp->value);
++ }
++
+ /* Set the reuse flag, as this is the default for inetd */
+ nvp = nv_find_value( service_flags, "REUSE" );
+ if ( nvp == NULL )
+diff --git a/xinetd/options.c b/xinetd/options.c
+index b058b6a..dc2f3a0 100644
+--- a/xinetd/options.c
++++ b/xinetd/options.c
+@@ -30,6 +30,7 @@ int logprocs_option ;
+ unsigned logprocs_option_arg ;
+ int stayalive_option=0;
+ char *program_name ;
++int inetd_ipv6 = 0 ;
+ int inetd_compat = 0 ;
+ int dont_fork = 0;
+
+@@ -128,6 +129,8 @@ int opt_recognize( int argc, char *argv[] )
+ fprintf(stderr, "\n");
+ exit(0);
+ }
++ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_ipv6" ) == 0 )
++ inetd_ipv6 = 1;
+ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_compat" ) == 0 )
+ inetd_compat = 1;
+ }
+diff --git a/xinetd/xinetd.man b/xinetd/xinetd.man
+index c76c3c6..c9dd803 100644
+--- a/xinetd/xinetd.man
++++ b/xinetd/xinetd.man
+@@ -106,6 +106,12 @@ This option causes xinetd to read /etc/inetd.conf in addition to the
+ standard xinetd config files. /etc/inetd.conf is read after the
+ standard xinetd config files.
+ .TP
++.BI \-inetd_ipv6
++This option causes xinetd to bind to IPv6 (AF_INET6) addresses for
++inetd compatibility lines (see previous option). This only affects
++how /etc/inetd.conf is interpreted and thus only has any effect if
++the \-inetd_compat option is also used.
++.TP
+ .BI \-cc " interval"
+ This option instructs
+ .B xinetd
+--
+1.5.5.rc0.127.gb4337
+
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf
new file mode 100644
index 000000000..9e6ea2577
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf
@@ -0,0 +1,11 @@
+# Simple configuration file for xinetd
+#
+# Some defaults, and include /etc/xinetd.d/
+
+defaults
+{
+
+
+}
+
+includedir /etc/xinetd.d
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default
new file mode 100644
index 000000000..20a38e3f3
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.default
@@ -0,0 +1,12 @@
+# Default settings for xinetd. This file is sourced by /bin/sh from
+# /etc/init.d/xinetd
+
+# enable xinetd Inetd compat mode
+INETD_COMPAT=Yes
+
+# Options to pass to xinetd
+#
+# -stayalive comes by default : it can be removed if xinetd is expected
+# not to start when no service is configured
+#
+XINETD_OPTS="-stayalive"
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 000000000..777c2c8b4
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.init
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# /etc/init.d/xinetd -- script to start and stop xinetd.
+
+# Source function library.
+. /etc/init.d/functions
+
+if test -f /etc/default/xinetd; then
+ . /etc/default/xinetd
+fi
+
+
+test -x /usr/sbin/xinetd || exit 0
+
+checkportmap () {
+ if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
+ if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
+ echo
+ echo "WARNING: portmapper inactive - RPC services unavailable!"
+ echo " Commenting out or removing the RPC services from"
+ echo " the /etc/xinetd.conf file will remove this message."
+ echo
+ fi
+ fi
+}
+
+case "$1" in
+ start)
+ checkportmap
+ echo -n "Starting internet superserver: xinetd"
+ start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping internet superserver: xinetd"
+ start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ status)
+ status /usr/sbin/xinetd;
+ exit $?
+ ;;
+ reload)
+ echo -n "Reloading internet superserver configuration: xinetd"
+ start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ force-reload)
+ echo "$0 force-reload: Force Reload is deprecated"
+ echo -n "Forcefully reloading internet superserver configuration: xinetd"
+ start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/xinetd {start|stop|status|reload|force-reload|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service
new file mode 100644
index 000000000..d5fdc5bc2
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd/xinetd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xinetd A Powerful Replacement For Inetd
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/xinetd.pid
+EnvironmentFile=-/etc/sysconfig/xinetd
+ExecStart=@SBINDIR@/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS"
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
new file mode 100644
index 000000000..1beb5456e
--- /dev/null
+++ b/poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
@@ -0,0 +1,78 @@
+SUMMARY = "Socket-based service activation daemon"
+HOMEPAGE = "https://github.com/xinetd-org/xinetd"
+
+# xinetd is a BSD-like license
+# Apple and Gentoo say BSD here.
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8"
+
+DEPENDS = ""
+DEPENDS_append_libc-musl = " libtirpc "
+PR = "r2"
+
+# Blacklist a bogus tag in upstream check
+UPSTREAM_CHECK_GITTAGREGEX = "xinetd-(?P<pver>(?!20030122).+)"
+
+SRC_URI = "git://github.com/xinetd-org/xinetd.git;protocol=https \
+ file://xinetd.init \
+ file://xinetd.conf \
+ file://xinetd.default \
+ file://Various-fixes-from-the-previous-maintainer.patch \
+ file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
+ file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
+ file://xinetd-CVE-2013-4342.patch \
+ file://0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch \
+ file://xinetd.service \
+ "
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+SRCREV = "68bb9ab9e9f214ad8a2322f28ac1d6733e70bc24"
+
+S = "${WORKDIR}/git"
+
+inherit autotools update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "xinetd.service"
+
+INITSCRIPT_NAME = "xinetd"
+INITSCRIPT_PARAMS = "defaults"
+
+EXTRA_OECONF="--disable-nls"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers"
+
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+
+do_configure() {
+ # Looks like configure.in is broken, so we are skipping
+ # rebuilding configure and are just using the shipped one
+ ( cd ${S}; gnu-configize --force )
+ oe_runconf
+}
+
+do_install() {
+ # Same here, the Makefile does some really stupid things,
+ # but since we only want two files why not override
+ # do_install from autotools and doing it ourselfs?
+ install -d "${D}${sbindir}"
+ install -d "${D}${sysconfdir}/init.d"
+ install -d "${D}${sysconfdir}/xinetd.d"
+ install -d "${D}${sysconfdir}/default"
+ install -m 644 "${WORKDIR}/xinetd.conf" "${D}${sysconfdir}"
+ install -m 755 "${WORKDIR}/xinetd.init" "${D}${sysconfdir}/init.d/xinetd"
+ install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd"
+ install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}"
+ install -m 755 "${B}/xinetd/itox" "${D}${sbindir}"
+ install -m 664 ${S}/contrib/xinetd.d/* ${D}${sysconfdir}/xinetd.d
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/xinetd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/xinetd.service
+}
+
+CONFFILES_${PN} = "${sysconfdir}/xinetd.conf"
diff --git a/poky/meta/recipes-extended/xz/xz_5.2.3.bb b/poky/meta/recipes-extended/xz/xz_5.2.3.bb
new file mode 100644
index 000000000..c0f8b82f6
--- /dev/null
+++ b/poky/meta/recipes-extended/xz/xz_5.2.3.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing LZMA compressed files"
+HOMEPAGE = "http://tukaani.org/xz/"
+SECTION = "base"
+
+# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file
+# which is GPLv3 is an m4 macro which isn't shipped in any of our packages,
+# and the LGPL bits are under lib/, which appears to be used for libgnu, which
+# appears to be used for DOS builds. So we're left with GPLv2+ and PD.
+LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_${PN}-dev = "GPLv2+"
+LICENSE_${PN}-staticdev = "GPLv2+"
+LICENSE_${PN}-doc = "GPLv2+"
+LICENSE_${PN}-dbg = "GPLv2+"
+LICENSE_${PN}-locale = "GPLv2+"
+LICENSE_liblzma = "PD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \
+ file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+ file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 "
+
+SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz"
+SRC_URI[md5sum] = "ef68674fb47a8b8e741b34e429d86e9d"
+SRC_URI[sha256sum] = "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb"
+
+inherit autotools gettext
+
+PACKAGES =+ "liblzma"
+
+FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch b/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch
new file mode 100644
index 000000000..19d854827
--- /dev/null
+++ b/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch
@@ -0,0 +1,42 @@
+zip: Fixing security formatting issues
+
+Fix security formatting issues related to printing without NULL argument
+
+zip.c: In function 'help_extended':
+zip.c:1031:5: error: format not a string literal and no format arguments [-Werror=format-security]
+ printf(text[i]);
+ ^
+zip.c: In function 'version_info':
+zip.c:1228:5: error: format not a string literal and no format arguments [-Werror=format-security]
+ printf(cryptnote[i]);
+ ^
+
+[YOCTO #9552]
+[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9552]
+
+Upstream-Status: Pending
+
+Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
+
+diff --git a/zip.c b/zip.c
+index 439821f..d7da768 100644
+--- a/zip.c
++++ b/zip.c
+@@ -1028,7 +1028,7 @@ local void help_extended()
+
+ for (i = 0; i < sizeof(text)/sizeof(char *); i++)
+ {
+- printf(text[i]);
++ fputs(text[i],stdout);
+ putchar('\n');
+ }
+ #ifdef DOS
+@@ -1225,7 +1225,7 @@ local void version_info()
+ CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE);
+ for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++)
+ {
+- printf(cryptnote[i]);
++ fputs(cryptnote[i],stdout);
+ putchar('\n');
+ }
+ ++i; /* crypt support means there IS at least one compilation option */
diff --git a/poky/meta/recipes-extended/zip/zip_3.0.bb b/poky/meta/recipes-extended/zip/zip_3.0.bb
new file mode 100644
index 000000000..de779e94a
--- /dev/null
+++ b/poky/meta/recipes-extended/zip/zip_3.0.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Compressor/archiver for creating and modifying .zip files"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d"
+
+PR = "r2"
+
+S = "${WORKDIR}/zip30"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz \
+ file://fix-security-format.patch"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37"
+SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369"
+
+# zip.inc sets CFLAGS, but what Makefile actually uses is
+# CFLAGS_NOOPT. It will also force -O3 optimization, overriding
+# whatever we set.
+EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \
+ 'CFLAGS=-I. -DUNIX ${CFLAGS}' \
+ 'CFLAGS_NOOPT=-I. -DUNIX ${CFLAGS}' \
+ 'INSTALL=install' 'INSTALL_D=install -d' \
+ 'BINFLAGS=0755'"
+
+do_compile() {
+ oe_runmake -f unix/Makefile flags IZ_BZIP2=no_such_directory
+ sed -i 's#LFLAGS1=""#LFLAGS1="${LDFLAGS}"#' flags
+ oe_runmake -f unix/Makefile generic IZ_BZIP2=no_such_directory
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile prefix=${D}${prefix} \
+ BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \
+ install
+}
+
+BBCLASSEXTEND = "native"
+
+# exclude version 2.3.2 which triggers a false positive
+UPSTREAM_CHECK_REGEX = "^zip(?P<pver>(?!232).+)\.tgz"
diff --git a/poky/meta/recipes-gnome/epiphany/epiphany_3.26.6.bb b/poky/meta/recipes-gnome/epiphany/epiphany_3.26.6.bb
new file mode 100644
index 000000000..e250f76ed
--- /dev/null
+++ b/poky/meta/recipes-gnome/epiphany/epiphany_3.26.6.bb
@@ -0,0 +1,22 @@
+SUMMARY = "WebKit based web browser for GNOME"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes avahi libnotify gcr \
+ gsettings-desktop-schemas gnome-desktop3 libxml2-native \
+ glib-2.0 glib-2.0-native json-glib"
+
+GNOMEBASEBUILDCLASS = "meson"
+inherit gnomebase gsettings distro_features_check upstream-version-is-even gettext
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
+ file://0002-help-meson.build-disable-the-use-of-yelp.patch \
+ "
+SRC_URI[archive.md5sum] = "8449968366a6f9aaff3ac228ddfc7c66"
+SRC_URI[archive.sha256sum] = "01b16aa55d312ae0f17d3136f90d8c68ac748715f119412fb1917023c6f630a8"
+
+EXTRA_OEMESON += " -Ddistributor_name=${DISTRO}"
+
+FILES_${PN} += "${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
+RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
diff --git a/poky/meta/recipes-gnome/epiphany/files/0002-help-meson.build-disable-the-use-of-yelp.patch b/poky/meta/recipes-gnome/epiphany/files/0002-help-meson.build-disable-the-use-of-yelp.patch
new file mode 100644
index 000000000..249517d8f
--- /dev/null
+++ b/poky/meta/recipes-gnome/epiphany/files/0002-help-meson.build-disable-the-use-of-yelp.patch
@@ -0,0 +1,34 @@
+From fc314fc3a66c92fe73e1a0cea4f49d11b29e1f45 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 31 Jan 2018 15:50:38 +0200
+Subject: [PATCH 2/2] help/meson.build: disable the use of yelp
+
+In particular this avoids calling itstool which oe-core doesn't provide.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ help/meson.build | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/help/meson.build b/help/meson.build
+index f720add..cbfeb1e 100644
+--- a/help/meson.build
++++ b/help/meson.build
+@@ -46,8 +46,8 @@ help_linguas = [
+ 'sv'
+ ]
+
+-gnome.yelp(meson.project_name(),
+- sources: help_files,
+- media: help_media,
+- languages: help_linguas,
+-)
++#gnome.yelp(meson.project_name(),
++# sources: help_files,
++# media: help_media,
++# languages: help_linguas,
++#)
+--
+2.15.1
+
diff --git a/poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch b/poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch
new file mode 100644
index 000000000..a20542986
--- /dev/null
+++ b/poky/meta/recipes-gnome/gcr/files/gcr-add-missing-dependencies-for-vapi.patch
@@ -0,0 +1,51 @@
+From e7e0c56ca82031121f192f7f711b78418b154c9f Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 28 Nov 2016 10:17:34 +0800
+Subject: [PATCH] gcr: add missing dependencies for vapi
+
+According to the vapi_DEPS definition:
+gcr-3.vapi depends on gck-1.vapi,
+gcr-ui-3.vapi depends on gck-1.vapi and gcr-3.vapi
+
+But these dependencies are missing for the make targets,
+so it will fail when build in parallel:
+error: Package `gck-1' not found in specified Vala API directories or GObject-Introspection GIR directories
+error: Package `gcr-3' not found in specified Vala API directories or GObject-Introspection GIR directories
+
+Upstream-Status: Submitted [https://bug775966.bugzilla-attachments.gnome.org/attachment.cgi?id=341791]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcr/Makefile.am | 2 +-
+ ui/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcr/Makefile.am b/gcr/Makefile.am
+index eda302f..6e78dba 100644
+--- a/gcr/Makefile.am
++++ b/gcr/Makefile.am
+@@ -221,7 +221,7 @@ gir_DATA += Gcr-@GCR_MAJOR@.gir
+
+ if ENABLE_VAPIGEN
+
+-gcr-@GCR_MAJOR@.vapi: Gcr-@GCR_MAJOR@.gir gcr/Gcr-@GCR_MAJOR@.metadata gcr-@GCR_MAJOR@.deps
++gcr-@GCR_MAJOR@.vapi: Gcr-@GCR_MAJOR@.gir gcr/Gcr-@GCR_MAJOR@.metadata gcr-@GCR_MAJOR@.deps gck-@GCK_MAJOR@.vapi
+
+ VAPIGEN_VAPIS += gcr-@GCR_MAJOR@.vapi
+
+diff --git a/ui/Makefile.am b/ui/Makefile.am
+index aa52476..6612f0d 100644
+--- a/ui/Makefile.am
++++ b/ui/Makefile.am
+@@ -160,7 +160,7 @@ gir_DATA += GcrUi-@GCR_MAJOR@.gir
+
+ if ENABLE_VAPIGEN
+
+-gcr-ui-@GCR_MAJOR@.vapi: GcrUi-@GCR_MAJOR@.gir ui/GcrUi-@GCR_MAJOR@.metadata gcr-ui-@GCR_MAJOR@.deps
++gcr-ui-@GCR_MAJOR@.vapi: GcrUi-@GCR_MAJOR@.gir ui/GcrUi-@GCR_MAJOR@.metadata gcr-ui-@GCR_MAJOR@.deps gck-@GCK_MAJOR@.vapi gcr-@GCR_MAJOR@.vapi
+
+ VAPIGEN_VAPIS += gcr-ui-@GCR_MAJOR@.vapi
+
+--
+2.8.3
+
diff --git a/poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb b/poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb
new file mode 100644
index 000000000..a68e0f676
--- /dev/null
+++ b/poky/meta/recipes-gnome/gcr/gcr_3.20.0.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A library for bits of crypto UI and parsing etc"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
+
+DEPENDS = "intltool-native gtk+3 p11-kit glib-2.0 libgcrypt \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'libxslt-native', '', d)}"
+
+inherit gnomebase gtk-icon-cache gtk-doc distro_features_check upstream-version-is-even vala gobject-introspection
+# depends on gtk+3, but also x11 through gtk+-x11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI += "file://gcr-add-missing-dependencies-for-vapi.patch"
+
+SRC_URI[archive.md5sum] = "4314bf89eac293dd0a9d806593ff1b35"
+SRC_URI[archive.sha256sum] = "90572c626d8a708225560c42b4421f7941315247fa1679d4ef569bde7f4bb379"
+
+FILES_${PN} += " \
+ ${datadir}/dbus-1 \
+ ${datadir}/gcr-3 \
+"
+
+# http://errors.yoctoproject.org/Errors/Details/20229/
+ARM_INSTRUCTION_SET = "arm"
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Fix-without-libtiff-not-having-an-effect.patch b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Fix-without-libtiff-not-having-an-effect.patch
new file mode 100644
index 000000000..2a54d8ed7
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Fix-without-libtiff-not-having-an-effect.patch
@@ -0,0 +1,27 @@
+From 460befc992adb32434b0408b453be39a6866ccf8 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 10 Oct 2017 14:33:18 +0300
+Subject: [PATCH] Fix --without-libtiff not having an effect.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=788770]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 315e0cc..98e780c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -676,7 +676,7 @@ if test x$gio_can_sniff = x; then
+ AC_DEFINE(GDK_PIXBUF_USE_GIO_MIME, 1, [Define if gio can sniff image data])
+ fi
+
+-AM_CONDITIONAL(HAVE_TIFF, test "x$libtiff_found" != x)
++AM_CONDITIONAL(HAVE_TIFF, test "x$libtiff_found" != xno)
+ AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
+ AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
+ AM_CONDITIONAL(HAVE_JASPER, test "x$LIBJASPER" != x)
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch
new file mode 100644
index 000000000..31ed988f3
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Work-around-thumbnailer-cross-compile-failure.patch
@@ -0,0 +1,47 @@
+From 6646e8aadc4030d891ac27c25494e5793d59dc85 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 22 Feb 2017 11:24:39 +0200
+Subject: [PATCH] Work-around thumbnailer cross-compile failure
+
+Install gdk-pixbuf-print-mime-types that's needed for thumbnail
+metadata generation.
+
+Use native gdk-pixbuf-print-mime-types when generating the thumbnail
+metadata. This works but the mime types will come from native
+loader.cache (which will only contain in-tree loaders), not from the
+target loader.cache.
+
+The upstream issue is https://bugzilla.gnome.org/show_bug.cgi?id=779057
+
+Upstream-Status: Inappropriate [workaround]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ thumbnailer/Makefile.am | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/thumbnailer/Makefile.am b/thumbnailer/Makefile.am
+index c9fe123..b0c6c70 100644
+--- a/thumbnailer/Makefile.am
++++ b/thumbnailer/Makefile.am
+@@ -1,5 +1,4 @@
+-bin_PROGRAMS = gdk-pixbuf-thumbnailer
+-noinst_PROGRAMS = gdk-pixbuf-print-mime-types
++bin_PROGRAMS = gdk-pixbuf-thumbnailer gdk-pixbuf-print-mime-types
+
+ gdk_pixbuf_thumbnailer_SOURCES = gdk-pixbuf-thumbnailer.c gnome-thumbnailer-skeleton.c gnome-thumbnailer-skeleton.h
+ gdk_pixbuf_thumbnailer_CPPFLAGS = \
+@@ -25,9 +24,9 @@ gdk_pixbuf_print_mime_types_LDADD = \
+
+ thumbnailerdir = $(datadir)/thumbnailers/
+ thumbnailer_DATA = gdk-pixbuf-thumbnailer.thumbnailer
+-gdk-pixbuf-thumbnailer.thumbnailer: gdk-pixbuf-thumbnailer.thumbnailer.in Makefile gdk-pixbuf-print-mime-types$(EXEEXT) $(top_builddir)/gdk-pixbuf/loaders.cache
++gdk-pixbuf-thumbnailer.thumbnailer: gdk-pixbuf-thumbnailer.thumbnailer.in Makefile gdk-pixbuf-print-mime-types$(EXEEXT)
+ $(AM_V_GEN) $(SED) -e "s|\@bindir\@|$(bindir)|" \
+- -e "s|\@mimetypes\@|`GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/loaders.cache GDK_PIXBUF_PIXDATA=$(top_builddir)/gdk-pixbuf/gdk-pixbuf-pixdata $(builddir)/gdk-pixbuf-print-mime-types`|" \
++ -e "s|\@mimetypes\@|`gdk-pixbuf-print-mime-types`|" \
+ $< > $@
+
+ EXTRA_DIST = gdk-pixbuf-thumbnailer.thumbnailer.in
+--
+2.1.4
+
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch
new file mode 100644
index 000000000..edbdced43
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+This patch fixes parallel install issue that lib libpixbufloader-png.la
+depends on libgdk_pixbuf-2.0.la which will be regenerated during insta-
+llation, if libgdk_pixbuf-2.0.la is regenerating and at the same time
+libpixbufloader-png.la links it, the error will happen.
+
+Error message is:
+* usr/bin/ld: cannot find -lgdk_pixbuf-2.0
+* collect2: ld returned 1 exit status
+
+Make an explicit dependency to the libs install targets would fix this
+issue.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ gdk-pixbuf/Makefile.am | 1 +
+ libdeps.mk | 3 +++
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+ create mode 100644 libdeps.mk
+
+diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
+index 95a93a8..db44cae 100644
+--- a/gdk-pixbuf/Makefile.am
++++ b/gdk-pixbuf/Makefile.am
+@@ -783,3 +783,4 @@ loaders.cache:
+ endif
+
+ -include $(top_srcdir)/git.mk
++-include $(top_srcdir)/libdeps.mk
+diff --git a/libdeps.mk b/libdeps.mk
+new file mode 100644
+index 0000000..d7a10a8
+--- /dev/null
++++ b/libdeps.mk
+@@ -0,0 +1,3 @@
++# Extending dependencies of install-loaderLTLIBRARIES:
++# The $(lib-LTLIBRARIES) is needed by relinking $(loader_LTLIBRARIES)
++install-loaderLTLIBRARIES: install-libLTLIBRARIES
+--
+1.7.6.1
+
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
new file mode 100644
index 000000000..7d0d54baf
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
@@ -0,0 +1,92 @@
+From b6a7b30522455cab39a0b9ea8463313380146e70 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 1 Apr 2014 17:23:36 +0100
+Subject: [PATCH 3/4] gdk-pixbuf: add an option so that loader errors are fatal
+
+If an environment variable is specified set the return value from main() to
+non-zero if the loader had errors (missing libraries, generally).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ gdk-pixbuf/queryloaders.c | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
+index a81c804..350bec8 100644
+--- a/gdk-pixbuf/queryloaders.c
++++ b/gdk-pixbuf/queryloaders.c
+@@ -146,7 +146,7 @@ write_loader_info (GString *contents, const char *path, GdkPixbufFormat *info)
+ g_string_append_c (contents, '\n');
+ }
+
+-static void
++static gboolean
+ query_module (GString *contents, const char *dir, const char *file)
+ {
+ char *path;
+@@ -155,6 +155,7 @@ query_module (GString *contents, const char *dir, const char *file)
+ void (*fill_vtable) (GdkPixbufModule *module);
+ gpointer fill_info_ptr;
+ gpointer fill_vtable_ptr;
++ gboolean ret = TRUE;
+
+ if (g_path_is_absolute (file))
+ path = g_strdup (file);
+@@ -204,10 +205,13 @@ query_module (GString *contents, const char *dir, const char *file)
+ g_module_error());
+ else
+ g_fprintf (stderr, "Cannot load loader %s\n", path);
++ ret = FALSE;
+ }
+ if (module)
+ g_module_close (module);
+ g_free (path);
++
++ return ret;
+ }
+
+ #ifdef G_OS_WIN32
+@@ -257,6 +261,7 @@ int main (int argc, char **argv)
+ GString *contents;
+ gchar *cache_file = NULL;
+ gint first_file = 1;
++ gboolean success = TRUE;
+
+ #ifdef G_OS_WIN32
+ gchar *libdir;
+@@ -370,7 +375,9 @@ int main (int argc, char **argv)
+ }
+ modules = g_list_sort (modules, (GCompareFunc)strcmp);
+ for (l = modules; l != NULL; l = l->next)
+- query_module (contents, path, l->data);
++ if (!query_module (contents, path, l->data))
++ success = FALSE;
++
+ g_list_free_full (modules, g_free);
+ #else
+ g_string_append_printf (contents, "# dynamic loading of modules not supported\n");
+@@ -385,7 +392,8 @@ int main (int argc, char **argv)
+ infilename = g_locale_to_utf8 (infilename,
+ -1, NULL, NULL, NULL);
+ #endif
+- query_module (contents, cwd, infilename);
++ if (!query_module (contents, cwd, infilename))
++ success = FALSE;
+ }
+ g_free (cwd);
+ }
+@@ -401,5 +409,8 @@ int main (int argc, char **argv)
+ else
+ g_print ("%s\n", contents->str);
+
+- return 0;
++ if (g_getenv ("GDK_PIXBUF_FATAL_LOADER"))
++ return success ? 0 : 1;
++ else
++ return 0;
+ }
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch
new file mode 100644
index 000000000..ecca62a71
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: gdk-pixbuf-2.22.1/configure.ac
+===================================================================
+--- gdk-pixbuf-2.22.1.orig/configure.ac 2010-11-26 09:06:34.000000000 +0800
++++ gdk-pixbuf-2.22.1/configure.ac 2010-11-26 09:07:33.000000000 +0800
+@@ -287,7 +287,7 @@
+ case $enable_explicit_deps in
+ auto)
+ export SED
+- deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+ if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -484,7 +484,7 @@
+ dnl Now we check to see if our libtool supports shared lib deps
+ dnl (in a rather ugly way even)
+ if $dynworks; then
+- pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++ pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config"
+ pixbuf_deplibs_check=`$pixbuf_libtool_config | \
+ grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+ sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -957,7 +957,7 @@
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+ GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"`
+ fi
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest
new file mode 100644
index 000000000..8f9072386
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner gdk-pixbuf
diff --git a/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.11.bb b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.11.bb
new file mode 100644
index 000000000..99c84c6dd
--- /dev/null
+++ b/poky/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.36.11.bb
@@ -0,0 +1,102 @@
+SUMMARY = "Image loading library for GTK+"
+HOMEPAGE = "http://www.gtk.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b"
+
+SECTION = "libs"
+
+DEPENDS = "glib-2.0 gdk-pixbuf-native shared-mime-info"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+ file://hardcoded_libtool.patch \
+ file://extending-libinstall-dependencies.patch \
+ file://run-ptest \
+ file://fatal-loader.patch \
+ file://0001-Work-around-thumbnailer-cross-compile-failure.patch \
+ file://0001-Fix-without-libtiff-not-having-an-effect.patch \
+ "
+
+SRC_URI[md5sum] = "6e84e5485c17ce7c25df77fe76eb2d6a"
+SRC_URI[sha256sum] = "ae62ab87250413156ed72ef756347b10208c00e76b222d82d9ed361ed9dde2f3"
+
+inherit autotools pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
+
+LIBV = "2.10.0"
+
+GDK_PIXBUF_LOADERS ?= "png jpeg"
+
+PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_linuxstdbase = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
+
+PACKAGECONFIG[png] = "--with-libpng,--without-libpng,libpng"
+PACKAGECONFIG[jpeg] = "--with-libjpeg,--without-libjpeg,jpeg"
+PACKAGECONFIG[tiff] = "--with-libtiff,--without-libtiff,tiff"
+PACKAGECONFIG[jpeg2000] = "--with-libjasper,--without-libjasper,jasper"
+
+PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
+
+PACKAGES =+ "${PN}-xlib"
+
+# For GIO image type sniffing
+RDEPENDS_${PN} = "shared-mime-info"
+
+FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
+ALLOW_EMPTY_${PN}-xlib = "1"
+
+FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
+
+FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
+
+FILES_${PN}-dev += " \
+ ${bindir}/gdk-pixbuf-csource \
+ ${bindir}/gdk-pixbuf-pixdata \
+ ${bindir}/gdk-pixbuf-print-mime-types \
+ ${includedir}/* \
+ ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
+"
+
+PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
+PACKAGES_DYNAMIC_class-native = ""
+
+python populate_packages_prepend () {
+ postinst_pixbufloader = d.getVar("postinst_pixbufloader")
+
+ loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
+
+ packages = ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
+ d.setVar('PIXBUF_PACKAGES', packages)
+
+ # The test suite exercises all the loaders, so ensure they are all
+ # dependencies of the ptest package.
+ d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
+}
+
+do_install_append() {
+ # Move gdk-pixbuf-query-loaders into libdir so it is always available
+ # in multilib builds.
+ mv ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
+}
+
+do_install_append_class-native() {
+ find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
+
+ create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+ create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+ create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+ create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
+ GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
+}
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-Disable-libseccomp-sycall-filtering-mechanism.patch b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-Disable-libseccomp-sycall-filtering-mechanism.patch
new file mode 100644
index 000000000..10b07435c
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-Disable-libseccomp-sycall-filtering-mechanism.patch
@@ -0,0 +1,38 @@
+From 9dfada06f8d2e02d7a04f793ba6e1d4a2aa5ffb7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 5 Oct 2017 14:54:17 +0300
+Subject: [PATCH] Disable libseccomp (sycall filtering mechanism)
+
+Upstream forgot to make it optional, and it is not currently used in Yocto
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 86bcf1f..8911f19 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -157,17 +157,6 @@ else
+ fi
+
+ SECCOMP_PKG=""
+-dnl Check for bubblewrap compatible platform
+-case $host_os in
+- linux*)
+- PKG_CHECK_MODULES(LIBSECCOMP, [libseccomp])
+- SECCOMP_PKG="libseccomp"
+- AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define to include GNU extensions])
+- AC_DEFINE_UNQUOTED(HAVE_BWRAP, 1, [Define to 1 if Bubblewrap support is available])
+- AC_DEFINE([ENABLE_SECCOMP], [1], [Define if using seccomp])
+- AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "$prefix", [Path to library install prefix])
+- ;;
+-esac
+
+ dnl pkg-config dependency checks
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-configure.ac-Remove-gnome-common-macro-calls.patch b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-configure.ac-Remove-gnome-common-macro-calls.patch
new file mode 100644
index 000000000..e95393c6b
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/0001-configure.ac-Remove-gnome-common-macro-calls.patch
@@ -0,0 +1,33 @@
+From 834bc861921fe0361f2d6a5b5716fc97a9519478 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Jul 2017 13:13:45 +0300
+Subject: [PATCH] configure.ac: Remove gnome-common macro calls
+
+gnome-common is deprecated and these aren't doing much for us.
+
+Upstreamable fix would probably involve using autoconf-archive:
+Trying to avoid that dependency for now.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7adcf0e..bb7659d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,9 +71,6 @@ AC_SUBST(GNOME_DATE)
+ AC_SUBST(GNOME_DATE_COMMENT_START)
+ AC_SUBST(GNOME_DATE_COMMENT_END)
+
+-GNOME_COMPILE_WARNINGS([maximum])
+-GNOME_MAINTAINER_MODE_DEFINES
+-
+ AC_ARG_ENABLE(deprecation_flags,
+ [AC_HELP_STRING([--enable-deprecation-flags],
+ [use *_DISABLE_DEPRECATED flags @<:@default=no@:>@])],,
+--
+2.1.4
+
diff --git a/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-assume-time_t-is-long.patch b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-assume-time_t-is-long.patch
new file mode 100644
index 000000000..fcc152fde
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop/gnome-desktop-thumbnail-don-t-assume-time_t-is-long.patch
@@ -0,0 +1,61 @@
+From 9048939b76b3bd10783adb79ed0aaf6cd13895cc Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 20:39:51 -0700
+Subject: [PATCH 1/2] gnome-desktop-thumbnail: don't convert time_t to long
+
+Explicitly use strftime+strptime rather than snprintf+atol. This fixes the
+build for X32, where long's size doesn't match that of time_t.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+
+Modify patch described above to eliminate replacement of
+
+g_snprintf (mtime_str, 21, "%" G_GINT64_FORMAT, (gint64) mtime)
+
+which is not necessary. Retain replacement of atol().
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+---
+ libgnome-desktop/gnome-desktop-thumbnail.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/libgnome-desktop/gnome-desktop-thumbnail.c b/libgnome-desktop/gnome-desktop-thumbnail.c
+index e56c3d7..5d96bf3 100644
+--- a/libgnome-desktop/gnome-desktop-thumbnail.c
++++ b/libgnome-desktop/gnome-desktop-thumbnail.c
+@@ -120,6 +120,8 @@
+ * Since: 2.2
+ */
+
++#define _XOPEN_SOURCE
++
+ #include <config.h>
+
+ #include <glib.h>
+@@ -1319,6 +1326,7 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf,
+ {
+ const char *thumb_uri, *thumb_mtime_str;
+ time_t thumb_mtime;
++ struct tm tmp_mtime;
+
+ thumb_uri = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::URI");
+ if (g_strcmp0 (uri, thumb_uri) != 0)
+@@ -1327,7 +1335,11 @@ gnome_desktop_thumbnail_is_valid (GdkPixbuf *pixbuf,
+ thumb_mtime_str = gdk_pixbuf_get_option (pixbuf, "tEXt::Thumb::MTime");
+ if (!thumb_mtime_str)
+ return FALSE;
+- thumb_mtime = atol (thumb_mtime_str);
++ if (!strptime (thumb_mtime_str, "%s", &tmp_mtime))
++ return FALSE;
++ thumb_mtime = mktime (&tmp_mtime);
++ if (!thumb_mtime)
++ return FALSE;
+ if (mtime != thumb_mtime)
+ return FALSE;
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.26.2.bb b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.26.2.bb
new file mode 100644
index 000000000..879dc9a2f
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.26.2.bb
@@ -0,0 +1,29 @@
+SUMMARY = "GNOME library for reading .desktop files"
+SECTION = "x11/gnome"
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "gnome-desktop"
+
+inherit gnome pkgconfig upstream-version-is-even gobject-introspection
+SRC_URI[archive.md5sum] = "6cee2ecd677d87eaa0eb5ebfa7b45fb3"
+SRC_URI[archive.sha256sum] = "f7561a7a313fc474b2c390cd9696df1f5c1e1556080e43f4afe042b1060e5f2a"
+
+SRC_URI += " \
+ file://gnome-desktop-thumbnail-don-t-assume-time_t-is-long.patch \
+ file://0001-configure.ac-Remove-gnome-common-macro-calls.patch \
+ file://0001-Disable-libseccomp-sycall-filtering-mechanism.patch \
+ "
+
+DEPENDS += "intltool-native gsettings-desktop-schemas gconf virtual/libx11 gtk+3 glib-2.0 startup-notification xkeyboard-config iso-codes udev"
+
+inherit distro_features_check gtk-doc
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-desktop-docs"
+
+PACKAGES =+ "libgnome-desktop3"
+FILES_libgnome-desktop3 = "${libdir}/lib*${SOLIBS} ${datadir}/libgnome-desktop*/pnp.ids ${datadir}/gnome/*xml"
+
+RRECOMMENDS_libgnome-desktop3 += "gsettings-desktop-schemas"
diff --git a/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Don-t-use-AC_CANONICAL_HOST.patch b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Don-t-use-AC_CANONICAL_HOST.patch
new file mode 100644
index 000000000..96ec96bdb
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Don-t-use-AC_CANONICAL_HOST.patch
@@ -0,0 +1,27 @@
+From 88ed996cc9e2b296cacfdbeece4be28a90bab511 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 30 May 2017 14:55:49 +0300
+Subject: [PATCH 1/2] Don't use AC_CANONICAL_HOST
+
+This won't work when building allarch (and is only used to find out if
+target is windows).
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+Index: adwaita-icon-theme-3.26.1/configure.ac
+===================================================================
+--- adwaita-icon-theme-3.26.1.orig/configure.ac
++++ adwaita-icon-theme-3.26.1/configure.ac
+@@ -3,7 +3,6 @@ AC_PREREQ(2.53)
+
+ AC_INIT([adwaita-icon-theme], [3.26.1],
+ [http://bugzilla.gnome.org/enter_bug.cgi?product=adwaita-icon-theme])
+-AC_CANONICAL_HOST
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_SRCDIR([index.theme.in])
+
diff --git a/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Run-installation-commands-as-shell-jobs.patch b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Run-installation-commands-as-shell-jobs.patch
new file mode 100644
index 000000000..6c38e237f
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme/0001-Run-installation-commands-as-shell-jobs.patch
@@ -0,0 +1,82 @@
+From 8dcd73b45a660dbdc560676835ba46f495334f14 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 13 Jun 2017 18:10:06 +0300
+Subject: [PATCH] Run installation commands as shell jobs
+
+This greatly speeds up installation time on multi-core systems.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/fullcolor/Makefile.am | 3 ++-
+ src/spinner/Makefile.am | 5 +++--
+ src/symbolic/Makefile.am | 7 ++++---
+ 3 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/fullcolor/Makefile.am b/src/fullcolor/Makefile.am
+index 1c940a5..3998ee6 100644
+--- a/src/fullcolor/Makefile.am
++++ b/src/fullcolor/Makefile.am
+@@ -9,9 +9,10 @@ install-data-local:
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/$$size && find . -name "*.png"`; do \
+ context="`dirname $$file`"; \
+ $(mkdir_p) $(DESTDIR)$(themedir)/$$size/$$context; \
+- $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file; \
++ $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file & \
+ done; \
+ done;
++ wait
+
+ ## FIXME we should add a way to remove links generated by icon mapping
+ uninstall-local:
+diff --git a/src/spinner/Makefile.am b/src/spinner/Makefile.am
+index 86f4d7c..3fae8c1 100644
+--- a/src/spinner/Makefile.am
++++ b/src/spinner/Makefile.am
+@@ -24,13 +24,14 @@ install-data-local:
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/$$size; find . -name "*.png"`; do \
+ context="`dirname $$file`"; \
+ $(mkdir_p) $(DESTDIR)$(themedir)/$$size/$$context; \
+- $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file; \
++ $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file & \
+ done; \
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/scalable-up-to-32; find . -name "*.svg"`; do \
+ context="`dirname $$file`"; \
+ $(mkdir_p) $(DESTDIR)$(themedir)/scalable-up-to-32/$$context; \
+- $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/scalable-up-to-32/$$file $(DESTDIR)$(themedir)/scalable-up-to-32/$$file; \
++ $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/scalable-up-to-32/$$file $(DESTDIR)$(themedir)/scalable-up-to-32/$$file & \
+ done
++ wait
+
+ uninstall-local:
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/scalable-up-to-32; find . -name "*.svg"`; do \
+diff --git a/src/symbolic/Makefile.am b/src/symbolic/Makefile.am
+index 24aac9b..61ba071 100644
+--- a/src/symbolic/Makefile.am
++++ b/src/symbolic/Makefile.am
+@@ -25,18 +25,19 @@ install-data-local:
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/$$size; find . -name "*.png"`; do \
+ context="`dirname $$file`"; \
+ $(mkdir_p) $(DESTDIR)$(themedir)/$$size/$$context; \
+- $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file; \
++ $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/$$size/$$file $(DESTDIR)$(themedir)/$$size/$$file & \
+ done; \
+ done
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/scalable; find . -name "*.svg"`; do \
+ context="`dirname $$file`"; \
+ $(mkdir_p) $(DESTDIR)$(themedir)/scalable/$$context; \
+- $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/scalable/$$file $(DESTDIR)$(themedir)/scalable/$$file; \
++ $(install_sh_DATA) $(top_srcdir)/$(SVGOUTDIR)/scalable/$$file $(DESTDIR)$(themedir)/scalable/$$file & \
+ for size in $(symbolic_encode_sizes); do \
+ $(mkdir_p) $(DESTDIR)$(themedir)/$$size/$$context; \
+- $(GTK_ENCODE_SYMBOLIC_SVG) $(top_srcdir)/$(SVGOUTDIR)/scalable/$$file $$size -o $(DESTDIR)$(themedir)/$$size/$$context; \
++ $(GTK_ENCODE_SYMBOLIC_SVG) $(top_srcdir)/$(SVGOUTDIR)/scalable/$$file $$size -o $(DESTDIR)$(themedir)/$$size/$$context & \
+ done \
+ done
++ wait
+
+ uninstall-local:
+ for file in `cd $(top_srcdir)/$(SVGOUTDIR)/scalable; find . -name "*.svg"`; do \
+--
+2.11.0
+
diff --git a/poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.26.1.bb b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.26.1.bb
new file mode 100644
index 000000000..6437d5e2d
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/adwaita-icon-theme_3.26.1.bb
@@ -0,0 +1,44 @@
+SUMMARY = "GTK+ icon theme"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome"
+
+LICENSE = "LGPL-3.0 | CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c84cac88e46fc07647ea07e6c24eeb7c"
+
+inherit allarch autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even
+
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+ file://0001-Don-t-use-AC_CANONICAL_HOST.patch \
+ file://0001-Run-installation-commands-as-shell-jobs.patch \
+ "
+
+SRC_URI[md5sum] = "3ef87e789711e5130792d4b5366c005d"
+SRC_URI[sha256sum] = "28ba7392c7761996efd780779167ea6c940eedfb1bf37cfe9bccb7021f54d79d"
+
+do_install_append() {
+ # Build uses gtk-encode-symbolic-svg to create png versions:
+ # no need to store the svgs anymore.
+ rm -f ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic.svg \
+ ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic-rtl.svg
+}
+
+PACKAGES = "${PN}-cursors ${PN}-symbolic-hires ${PN}-symbolic ${PN}-hires ${PN}"
+
+RREPLACES_${PN} = "gnome-icon-theme"
+RCONFLICTS_${PN} = "gnome-icon-theme"
+RPROVIDES_${PN} = "gnome-icon-theme"
+
+FILES_${PN}-cursors = "${prefix}/share/icons/Adwaita/cursors/"
+FILES_${PN}-symbolic-hires = "${prefix}/share/icons/Adwaita/96x96/*/*.symbolic.png \
+ ${prefix}/share/icons/Adwaita/64x64/*/*.symbolic.png \
+ ${prefix}/share/icons/Adwaita/48x48/*/*.symbolic.png \
+ ${prefix}/share/icons/Adwaita/32x32/*/*.symbolic.png"
+FILES_${PN}-symbolic = "${prefix}/share/icons/Adwaita/16x16/*/*.symbolic.png \
+ ${prefix}/share/icons/Adwaita/24x24/*/*.symbolic.png"
+FILES_${PN}-hires = "${prefix}/share/icons/Adwaita/256x256/ \
+ ${prefix}/share/icons/Adwaita/512x512/"
+FILES_${PN} = "${prefix}/share/icons/Adwaita/ \
+ ${prefix}/share/pkgconfig/adwaita-icon-theme.pc"
diff --git a/poky/meta/recipes-gnome/gnome/gconf/create_config_directory.patch b/poky/meta/recipes-gnome/gnome/gconf/create_config_directory.patch
new file mode 100644
index 000000000..cd72e739b
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gconf/create_config_directory.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+In some circumstances, gconf isn't able to save configurations
+because ~/.config folder aka root_dir doesn't exist.
+This issue was not seen before because ~/.config directory is shared
+between several packages and one of those packages usually creates it
+by the time gconf wants to use it.
+
+This patch makes sure that gconf creates the .config directory if it
+doesn't exist, along with the gconf directory inside it.
+
+Signed-off-by: Jaewon Lee <jaewon.lee@xilinx.com>
+Signed-off-by: Alejandro Hernandez <alejandr@xilinx.com>
+
+
+Index: GConf-3.2.6/backends/markup-backend.c
+===================================================================
+--- GConf-3.2.6.orig/backends/markup-backend.c
++++ GConf-3.2.6/backends/markup-backend.c
+@@ -276,7 +276,7 @@ resolve_address (const char *address,
+ /* dir_mode without search bits */
+ file_mode = dir_mode & (~0111);
+ }
+- else if (g_mkdir (root_dir, dir_mode) < 0)
++ else if (g_mkdir_with_parents (root_dir, dir_mode) < 0)
+ {
+ /* Error out even on EEXIST - shouldn't happen anyway */
+ gconf_set_error (err, GCONF_ERROR_FAILED,
diff --git a/poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch b/poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch
new file mode 100644
index 000000000..59a7ca780
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Remove '+' from invalid characters list
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: GConf-3.2.5/gconf/gconf-backend.c
+===================================================================
+--- GConf-3.2.5.orig/gconf/gconf-backend.c
++++ GConf-3.2.5/gconf/gconf-backend.c
+@@ -37,7 +37,7 @@ static const char invalid_chars[] =
+ /* Space is common in user names (and thus home directories) on Windows */
+ " "
+ #endif
+- "\t\r\n\"$&<>,+=#!()'|{}[]?~`;%\\";
++ "\t\r\n\"$&<>,=#!()'|{}[]?~`;%\\";
+
+ static gboolean
+ gconf_address_valid (const char *address,
diff --git a/poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch b/poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch
new file mode 100644
index 000000000..f758a4bcc
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch
@@ -0,0 +1,95 @@
+Fixes errors such as this in the rootfs generation:
+
+(gconftool-2.real:10095): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
+Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From b0895e1998ebc83ab030ec0f17c0685439f5b404 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Mon, 15 Apr 2013 09:57:34 -0400
+Subject: [PATCH] dbus: Don't spew to console when unable to connect to dbus
+ daemon
+
+Instead pass the error up for the caller to decide what to do.
+
+This prevent untrappable warning messages from showing up at the
+console if gconftool --makefile-install-rule is called.
+---
+ gconf/gconf-dbus.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c
+index 5610fcf..048e3ea 100644
+--- a/gconf/gconf-dbus.c
++++ b/gconf/gconf-dbus.c
+@@ -105,7 +105,7 @@ static GHashTable *engines_by_db = NULL;
+ static GHashTable *engines_by_address = NULL;
+ static gboolean dbus_disconnected = FALSE;
+
+-static gboolean ensure_dbus_connection (void);
++static gboolean ensure_dbus_connection (GError **error);
+ static gboolean ensure_service (gboolean start_if_not_found,
+ GError **err);
+ static gboolean ensure_database (GConfEngine *conf,
+@@ -383,7 +383,7 @@ gconf_engine_detach (GConfEngine *conf)
+ }
+
+ static gboolean
+-ensure_dbus_connection (void)
++ensure_dbus_connection (GError **err)
+ {
+ DBusError error;
+
+@@ -392,7 +392,9 @@ ensure_dbus_connection (void)
+
+ if (dbus_disconnected)
+ {
+- g_warning ("The connection to DBus was broken. Can't reinitialize it.");
++ g_set_error (err, GCONF_ERROR,
++ GCONF_ERROR_NO_SERVER,
++ "The connection to DBus was broken. Can't reinitialize it.");
+ return FALSE;
+ }
+
+@@ -402,7 +404,10 @@ ensure_dbus_connection (void)
+
+ if (!global_conn)
+ {
+- g_warning ("Client failed to connect to the D-BUS daemon:\n%s", error.message);
++ g_set_error (err, GCONF_ERROR,
++ GCONF_ERROR_NO_SERVER,
++ "Client failed to connect to the D-BUS daemon:\n%s",
++ error.message);
+
+ dbus_error_free (&error);
+ return FALSE;
+@@ -431,13 +436,8 @@ ensure_service (gboolean start_if_not_found,
+
+ if (global_conn == NULL)
+ {
+- if (!ensure_dbus_connection ())
+- {
+- g_set_error (err, GCONF_ERROR,
+- GCONF_ERROR_NO_SERVER,
+- _("No D-BUS daemon running\n"));
+- return FALSE;
+- }
++ if (!ensure_dbus_connection (err))
++ return FALSE;
+
+ g_assert (global_conn != NULL);
+ }
+@@ -2512,7 +2512,7 @@ gconf_ping_daemon (void)
+ {
+ if (global_conn == NULL)
+ {
+- if (!ensure_dbus_connection ())
++ if (!ensure_dbus_connection (NULL))
+ {
+ return FALSE;
+ }
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb b/poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb
new file mode 100644
index 000000000..120ae3e02
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -0,0 +1,55 @@
+SUMMARY = "GNOME configuration system"
+SECTION = "x11/gnome"
+HOMEPAGE = "https://projects.gnome.org/gconf/"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
+
+DEPENDS = "glib-2.0 dbus dbus-glib libxml2 intltool-native"
+
+inherit gnomebase gtk-doc gettext gobject-introspection gio-module-cache
+
+SRC_URI = "${GNOME_MIRROR}/GConf/${@gnome_verdir("${PV}")}/GConf-${PV}.tar.xz;name=archive \
+ file://remove_plus_from_invalid_characters_list.patch \
+ file://unable-connect-dbus.patch \
+ file://create_config_directory.patch \
+"
+
+SRC_URI[archive.md5sum] = "2b16996d0e4b112856ee5c59130e822c"
+SRC_URI[archive.sha256sum] = "1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e0cfa51a04d784c"
+
+S = "${WORKDIR}/GConf-${PV}"
+
+EXTRA_OECONF = "--enable-shared --disable-static \
+ --disable-orbit --with-openldap=no --disable-gtk"
+
+# Disable PolicyKit by default
+PACKAGECONFIG ??= ""
+# We really don't want PolicyKit for native
+PACKAGECONFIG_class-native = ""
+
+PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
+PACKAGECONFIG[debug] = "--enable-debug=yes, --enable-debug=minimum"
+
+do_install_append() {
+ # this directory need to be created to avoid an Error 256 at gdm launch
+ install -d ${D}${sysconfdir}/gconf/gconf.xml.system
+
+ # this stuff is unusable
+ rm -f ${D}${libdir}/GConf/*/*.*a
+ rm -f ${D}${libdir}/gio/*/*.*a
+}
+
+do_install_append_class-native() {
+ create_wrapper ${D}/${bindir}/gconftool-2 \
+ GCONF_BACKEND_DIR=${STAGING_LIBDIR_NATIVE}/GConf/2
+}
+
+FILES_${PN} += "${libdir}/GConf/* \
+ ${libdir}/gio/*/*.so \
+ ${datadir}/polkit* \
+ ${datadir}/dbus-1/services/*.service \
+ ${datadir}/dbus-1/system-services/*.service \
+ "
+FILES_${PN}-dev += "${datadir}/sgml/gconf/gconf-1.0.dtd"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-gnome/gnome/gnome-doc-utils/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch b/poky/meta/recipes-gnome/gnome/gnome-doc-utils/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch
new file mode 100644
index 000000000..4cfcabd38
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gnome-doc-utils/0001-glib-gettext.m4-Update-AM_GLIB_GNU_GETTEXT-to-match-.patch
@@ -0,0 +1,40 @@
+From 426e38468463a4abb495cf6a269b9635b2107519 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 17 May 2016 13:51:24 +0300
+Subject: [PATCH] glib-gettext.m4: Update AM_GLIB_GNU_GETTEXT to match glib
+
+This avoids
+ error: m4_copy: won't overwrite defined macro: glib_DEFUN
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Inappropriate [No upstream]
+---
+ m4/glib-gettext.m4 | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/m4/glib-gettext.m4 b/m4/glib-gettext.m4
+index 81f8fd2..e2b142b 100644
+--- a/m4/glib-gettext.m4
++++ b/m4/glib-gettext.m4
+@@ -310,7 +310,7 @@ msgstr ""
+ # on various variables needed by the Makefile.in.in installed by
+ # glib-gettextize.
+ dnl
+-glib_DEFUN([GLIB_GNU_GETTEXT],
++AU_DEFUN([GLIB_GNU_GETTEXT],
+ [AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+
+@@ -381,7 +381,8 @@ glib_DEFUN([GLIB_GNU_GETTEXT],
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+- ])
++ ]
++ [[$0: This macro is deprecated. You should use upstream gettext instead.]])
+
+ # AX_GLIB_DEFINE_LOCALEDIR(VARIABLE)
+ # -------------------------------
+--
+2.1.4
+
diff --git a/poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.3.bb b/poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.3.bb
new file mode 100644
index 000000000..55ee27760
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/gnome-themes-standard_3.22.3.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GTK+2 standard themes"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-standard/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome"
+
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+inherit autotools pkgconfig gettext gtk-icon-cache upstream-version-is-even distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+DEPENDS += "intltool-native gtk+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+ "
+
+SRC_URI[md5sum] = "b51c362b157b6407303d44f93c31ee11"
+SRC_URI[sha256sum] = "61dc87c52261cfd5b94d65e8ffd923ddeb5d3944562f84942eeeb197ab8ab56a"
+
+EXTRA_OECONF = "--disable-gtk3-engine"
+
+do_install_append() {
+ # Only building Adwaita, remove highcontrast files
+ rm -rf ${D}${prefix}/share/themes/HighContrast \
+ ${D}${prefix}/share/icons
+
+ # The libtool archive file is unneeded with shared libs on modern Linux
+ rm -rf ${D}${libdir}/gtk-2.0/2.10.0/engines/libadwaita.la
+}
+
+# There could be gnome-theme-highcontrast as well but that requires
+# gtk+3 and includes lots of icons (is also broken with B != S).
+PACKAGES += "gnome-theme-adwaita \
+ gnome-theme-adwaita-dark \
+ "
+
+FILES_gnome-theme-adwaita = "${prefix}/share/themes/Adwaita \
+ ${libdir}/gtk-2.0/2.10.0/engines/libadwaita.so"
+
+FILES_gnome-theme-adwaita-dark = "${prefix}/share/themes/Adwaita-dark"
+RDEPENDS_gnome-theme-adwaita-dark = "gnome-theme-adwaita"
+
+# gnome-themes-standard is empty and doesn't exist
+RDEPENDS_${PN}-dev = ""
diff --git a/poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch b/poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch
new file mode 100644
index 000000000..0261f58c9
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch
@@ -0,0 +1,84 @@
+Taken from portage
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From e1443c945a4cf67096d8c27721aadd7368382b3f Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Tue, 6 Apr 2010 15:22:25 +0200
+Subject: [PATCH 2/2] gentoo: use ISO types for fixed type size
+
+---
+ Makefile.am | 11 ++---------
+ art_config.h | 5 +++++
+ configure.in | 10 ----------
+ 3 files changed, 7 insertions(+), 19 deletions(-)
+ create mode 100644 art_config.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 95952da..6aa2fe3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,13 +2,6 @@ check_PROGRAMS = testart testuta
+
+ bin_SCRIPTS = \
+ libart2-config
+-
+-noinst_SCRIPTS = gen_art_config.sh
+-
+-BUILT_SOURCES = art_config.h
+-
+-art_config.h:
+- ./gen_art_config.sh > art_config.h
+
+ EXTRA_DIST = \
+ libart.def \
+@@ -173,5 +166,5 @@ install-data-local: install-ms-lib install-libtool-import-lib
+
+ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
+
+-CLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS)
+-DISTCLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS)
++CLEANFILES = $(bin_SCRIPTS)
++DISTCLEANFILES = $(bin_SCRIPTS)
+diff --git a/art_config.h b/art_config.h
+new file mode 100644
+index 0000000..5985f1f
+--- a/art_config.h
++++ b/art_config.h
+@@ -0,0 +1,5 @@
++#include <stdint.h>
++
++typedef uint8_t art_u8;
++typedef uint16_t art_u16;
++typedef uint32_t art_u32;
+diff --git a/configure.in b/configure.in
+index e4804f7..ddcac4f 100644
+--- a/configure.in
++++ b/configure.in
+@@ -92,15 +92,6 @@ AC_FUNC_ALLOCA
+
+ AC_C_BIGENDIAN
+
+-AC_CHECK_SIZEOF(char)
+-AC_SUBST(ART_SIZEOF_CHAR, $ac_cv_sizeof_char)
+-AC_CHECK_SIZEOF(short)
+-AC_SUBST(ART_SIZEOF_SHORT, $ac_cv_sizeof_short)
+-AC_CHECK_SIZEOF(int)
+-AC_SUBST(ART_SIZEOF_INT, $ac_cv_sizeof_int)
+-AC_CHECK_SIZEOF(long)
+-AC_SUBST(ART_SIZEOF_LONG, $ac_cv_sizeof_long)
+-
+ AC_CONFIG_FILES([
+ libart-features.h
+ Makefile
+@@ -109,6 +100,5 @@ libart-2.0-uninstalled.pc
+ libart-zip])
+
+ AC_CONFIG_FILES([libart-config],[chmod +x libart-config])
+-AC_CONFIG_FILES([gen_art_config.sh],[chmod +x gen_art_config.sh])
+
+ AC_OUTPUT
+--
+1.7.0.4
+
diff --git a/poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb b/poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb
new file mode 100644
index 000000000..95581b297
--- /dev/null
+++ b/poky/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Library of functions for 2D graphics"
+SECTION = "x11/gnome"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+PR = "r2"
+
+# can't use gnome.oeclass due to _ in filename
+SRC_URI = "${GNOME_MIRROR}/libart_lgpl/2.3/libart_lgpl-${PV}.tar.bz2 \
+ file://libart_lgpl-2.3.21-crosscompile.patch \
+ "
+
+SRC_URI[md5sum] = "08559ff3c67fd95d57b0c5e91a6b4302"
+SRC_URI[sha256sum] = "fdc11e74c10fc9ffe4188537e2b370c0abacca7d89021d4d303afdf7fd7476fa"
+
+inherit autotools pkgconfig
+
+DEPENDS = ""
+
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_${PN}-dev += "${bindir}/libart2-config"
+
+S = "${WORKDIR}/libart_lgpl-${PV}"
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch
new file mode 100644
index 000000000..9abaea7e7
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch
@@ -0,0 +1,50 @@
+From 3a9d1e5ee0aae56fafec0beba2014c19e4ff310c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 23 Mar 2016 17:07:28 +0200
+Subject: [PATCH 1/5] Revert an incomplete upstream attempt at cross-compile
+ support
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ common.mk | 4 ----
+ giscanner/gdumpparser.py | 6 ------
+ 2 files changed, 10 deletions(-)
+
+diff --git a/common.mk b/common.mk
+index b778f7a..e26c637 100644
+--- a/common.mk
++++ b/common.mk
+@@ -24,12 +24,8 @@ INTROSPECTION_SCANNER_ARGS = \
+ --add-include-path=$(top_builddir) \
+ --add-include-path=$(top_builddir)/gir
+
+-# GI_CROSS_LAUNCHER is the command to use for executing g-ir-compiler.
+-# Normally will be undefined but can be set (e.g. to wine or qemu)
+-# when cross-compiling
+ INTROSPECTION_COMPILER = \
+ env PATH=".libs:$(PATH)" \
+- $(GI_CROSS_LAUNCHER) \
+ $(top_builddir)/g-ir-compiler$(EXEEXT)
+
+ INTROSPECTION_COMPILER_ARGS = \
+diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
+index 1134f33..9bdc2bc 100644
+--- a/giscanner/gdumpparser.py
++++ b/giscanner/gdumpparser.py
+@@ -162,12 +162,6 @@ blob containing data gleaned from GObject's primitive introspection."""
+ out_path = os.path.join(self._binary.tmpdir, 'dump.xml')
+
+ args = []
+-
+- # Prepend the launcher command and arguments, if defined
+- launcher = os.environ.get('GI_CROSS_LAUNCHER')
+- if launcher:
+- args.extend(launcher.split())
+-
+ args.extend(self._binary.args)
+ args.append('--introspect-dump=%s,%s' % (in_path, out_path))
+
+--
+2.7.0
+
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-lib-dirs-envvar-option.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-lib-dirs-envvar-option.patch
new file mode 100644
index 000000000..4ec527dcc
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-giscanner-add-a-lib-dirs-envvar-option.patch
@@ -0,0 +1,73 @@
+From e48f1e18f5ea41656f0ba10fe61d69d2604b0064 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 3 Jan 2018 17:02:01 +0200
+Subject: [PATCH] giscanner: add a --lib-dirs-envvar option
+
+By default LD_LIBRARY_PATH is set to the list of target library paths;
+this breaks down in cross-compilation environment, as we need to run a
+native emulation wrapper rather than the target binary itself. This patch
+allows exporting those paths to a different environment variable
+which can be picked up and used by the wrapper.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ giscanner/ccompiler.py | 4 ++--
+ giscanner/dumper.py | 3 ++-
+ giscanner/scannermain.py | 3 +++
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
+index 29de0ee..928eae8 100644
+--- a/giscanner/ccompiler.py
++++ b/giscanner/ccompiler.py
+@@ -109,7 +109,7 @@ class CCompiler(object):
+
+ self._cflags_no_deprecation_warnings = "-Wno-deprecated-declarations"
+
+- def get_internal_link_flags(self, args, libtool, libraries, extra_libraries, libpaths):
++ def get_internal_link_flags(self, args, libtool, libraries, extra_libraries, libpaths, lib_dirs_envvar):
+ # An "internal" link is where the library to be introspected
+ # is being built in the current directory.
+
+@@ -119,7 +119,7 @@ class CCompiler(object):
+ if self.check_is_msvc():
+ runtime_path_envvar = ['LIB', 'PATH']
+ else:
+- runtime_path_envvar = ['LD_LIBRARY_PATH']
++ runtime_path_envvar = ['LD_LIBRARY_PATH'] if not lib_dirs_envvar else [lib_dirs_envvar]
+ # Search the current directory first
+ # (This flag is not supported nor needed for Visual C++)
+ args.append('-L.')
+diff --git a/giscanner/dumper.py b/giscanner/dumper.py
+index 7f77bd2..db96df6 100644
+--- a/giscanner/dumper.py
++++ b/giscanner/dumper.py
+@@ -259,7 +259,8 @@ class DumpCompiler(object):
+ libtool,
+ self._options.libraries,
+ self._options.extra_libraries,
+- self._options.library_paths)
++ self._options.library_paths,
++ self._options.lib_dirs_envvar)
+ args.extend(pkg_config_libs)
+
+ else:
+diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
+index 38a45c1..b603850 100755
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -130,6 +130,9 @@ def _get_option_parser():
+ parser.add_option("", "--use-ldd-wrapper",
+ action="store", dest="ldd_wrapper", default=None,
+ help="wrapper to use instead of ldd (useful when cross-compiling)")
++ parser.add_option("", "--lib-dirs-envvar",
++ action="store", dest="lib_dirs_envvar", default=None,
++ help="environment variable to write a list of library directories to (for running the transient binary), instead of standard LD_LIBRARY_PATH")
+ parser.add_option("", "--program-arg",
+ action="append", dest="program_args", default=[],
+ help="extra arguments to program")
+--
+2.15.1
+
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch
new file mode 100644
index 000000000..c682b42af
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch
@@ -0,0 +1,200 @@
+From b1503fe2693d602b3e24e4b832dc0934960d5d22 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 19 Oct 2015 18:29:21 +0300
+Subject: [PATCH 2/5] configure.ac: add host-gi, gi-cross-wrapper,
+ gi-ldd-wrapper and introspection-data options
+
+With the first option, gobject-introspection tools (g-ir-doc-tool and g-ir-scanner)
+that are already installed in the host system will be used for building the source tree.
+
+With the second option, g-ir-scanner will be instructed to use an executable
+wrapper to run binaries it's producing, and g-ir-compiler will be run
+through the same wrapper (host system's g-ir-compiler cannot be used because
+it's producing architecture-specific output).
+
+With the third option, giscanner will be instructed to use a special ldd
+command instead of system's ldd (which does not work when the binary to inspect
+is compiled for a different architecture).
+
+With the fourth option, it is possible to disable building of introspection data
+(.gir and .typelib files), which may be difficult or impossible in cross-compilation
+environments, because of lack of emulation (or native hardware) for the target architecture
+on which the target binaries can be run.
+
+These options are useful when cross-compiling for a different target architecture.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.am | 2 ++
+ common.mk | 39 +++++++++++++++++++++++++++++++++++++++
+ configure.ac | 42 ++++++++++++++++++++++++++++++++++++++++++
+ tests/Makefile.am | 5 ++++-
+ 4 files changed, 87 insertions(+), 1 deletion(-)
+
+Index: gobject-introspection-1.52.1/Makefile.am
+===================================================================
+--- gobject-introspection-1.52.1.orig/Makefile.am
++++ gobject-introspection-1.52.1/Makefile.am
+@@ -21,7 +21,9 @@ include Makefile-cmph.am
+ include Makefile-girepository.am
+ include Makefile-giscanner.am
+ include Makefile-examples.am
++if BUILD_INTROSPECTION_DATA
+ include Makefile-gir.am
++endif
+ include Makefile-tools.am
+ include Makefile-msvcproj.am
+
+Index: gobject-introspection-1.52.1/common.mk
+===================================================================
+--- gobject-introspection-1.52.1.orig/common.mk
++++ gobject-introspection-1.52.1/common.mk
+@@ -6,6 +6,15 @@
+ # module itself.
+ #
+
++if USE_HOST_GI
++INTROSPECTION_SCANNER = \
++ env PATH="$(PATH)" \
++ LPATH=.libs \
++ CC="$(CC)" \
++ PYTHONPATH=$(top_builddir):$(top_srcdir) \
++ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
++ g-ir-scanner
++else
+ INTROSPECTION_SCANNER = \
+ env PATH=".libs:$(PATH)" \
+ LPATH=.libs \
+@@ -14,9 +23,24 @@ INTROSPECTION_SCANNER = \
+ UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
+ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
+ $(top_builddir)/g-ir-scanner
++endif
++
++if USE_CROSS_WRAPPER
++CROSS_WRAPPER_ARG = --use-binary-wrapper=$(GI_CROSS_WRAPPER)
++else
++CROSS_WRAPPER_ARG =
++endif
++
++if USE_LDD_WRAPPER
++LDD_WRAPPER_ARG = --use-ldd-wrapper=$(GI_LDD_WRAPPER)
++else
++LDD_WRAPPER_ARG =
++endif
+
+ INTROSPECTION_SCANNER_ARGS = \
+ --verbose \
++ $(CROSS_WRAPPER_ARG) \
++ $(LDD_WRAPPER_ARG) \
+ -I$(top_srcdir) \
+ --add-include-path=$(srcdir) \
+ --add-include-path=$(top_srcdir)/gir \
+@@ -24,9 +48,15 @@ INTROSPECTION_SCANNER_ARGS = \
+ --add-include-path=$(top_builddir) \
+ --add-include-path=$(top_builddir)/gir
+
++if USE_CROSS_WRAPPER
++INTROSPECTION_COMPILER = \
++ env PATH=".libs:$(PATH)" \
++ $(GI_CROSS_WRAPPER) $(top_builddir)/.libs/g-ir-compiler$(EXEEXT)
++else
+ INTROSPECTION_COMPILER = \
+ env PATH=".libs:$(PATH)" \
+ $(top_builddir)/g-ir-compiler$(EXEEXT)
++endif
+
+ INTROSPECTION_COMPILER_ARGS = \
+ --includedir=$(srcdir) \
+@@ -35,6 +65,14 @@ INTROSPECTION_COMPILER_ARGS = \
+ --includedir=$(top_builddir) \
+ --includedir=$(top_builddir)/gir
+
++if USE_HOST_GI
++INTROSPECTION_DOCTOOL = \
++ env PATH="$(PATH)" \
++ LPATH=.libs \
++ PYTHONPATH=$(top_builddir):$(top_srcdir) \
++ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
++ g-ir-doc-tool
++else
+ INTROSPECTION_DOCTOOL = \
+ env PATH=".libs:$(PATH)" \
+ LPATH=.libs \
+@@ -42,6 +80,7 @@ INTROSPECTION_DOCTOOL = \
+ UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \
+ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \
+ $(top_builddir)/g-ir-doc-tool
++endif
+
+ INTROSPECTION_DOCTOOL_ARGS = \
+ --add-include-path=$(srcdir) \
+Index: gobject-introspection-1.52.1/configure.ac
+===================================================================
+--- gobject-introspection-1.52.1.orig/configure.ac
++++ gobject-introspection-1.52.1/configure.ac
+@@ -366,6 +366,48 @@ dnl
+ AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
+ AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
+
++AC_ARG_ENABLE([host-gi],
++[AS_HELP_STRING([--enable-host-gi],[Use gobject introspection tools installed in the host system (useful when cross-compiling)])],
++[case "${enableval}" in
++ yes) host_gi=true ;;
++ no) host_gi=false ;;
++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-host-gi]) ;;
++esac],[host_gi=false])
++AM_CONDITIONAL([USE_HOST_GI], [test x$host_gi = xtrue])
++
++AC_ARG_ENABLE([gi-cross-wrapper],
++[AS_HELP_STRING([--enable-gi-cross-wrapper=path],[Use a wrapper to run gicompiler and binaries produced by giscanner (useful when cross-compiling)])],
++[
++GI_CROSS_WRAPPER="${enableval}"
++use_wrapper=true
++],[
++GI_CROSS_WRAPPER=""
++use_wrapper=false
++])
++AC_SUBST(GI_CROSS_WRAPPER)
++AM_CONDITIONAL([USE_CROSS_WRAPPER], [test x$use_wrapper = xtrue])
++
++AC_ARG_ENABLE([gi-ldd-wrapper],
++[AS_HELP_STRING([--enable-gi-ldd-wrapper=path],[Use a ldd wrapper instead of system's ldd command in giscanner (useful when cross-compiling)])],
++[
++GI_LDD_WRAPPER="${enableval}"
++use_ldd_wrapper=true
++],[
++GI_LDD_WRAPPER=""
++use_ldd_wrapper=false
++])
++AC_SUBST(GI_LDD_WRAPPER)
++AM_CONDITIONAL([USE_LDD_WRAPPER], [test x$use_ldd_wrapper = xtrue])
++
++AC_ARG_ENABLE([introspection-data],
++[AS_HELP_STRING([--enable-introspection-data],[Build introspection data (.gir and .typelib files) in addition to library and tools])],
++[case "${enableval}" in
++ yes) introspection_data=true ;;
++ no) introspection_data=false ;;
++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-introspection-data]) ;;
++esac],[introspection_data=true])
++AM_CONDITIONAL([BUILD_INTROSPECTION_DATA], [test x$introspection_data = xtrue])
++
+ AC_CONFIG_FILES([
+ Makefile
+ tests/Makefile
+Index: gobject-introspection-1.52.1/tests/Makefile.am
+===================================================================
+--- gobject-introspection-1.52.1.orig/tests/Makefile.am
++++ gobject-introspection-1.52.1/tests/Makefile.am
+@@ -1,6 +1,9 @@
+ include $(top_srcdir)/common.mk
+
+-SUBDIRS = . scanner repository offsets warn
++SUBDIRS = . scanner repository warn
++if BUILD_INTROSPECTION_DATA
++SUBDIRS += offsets
++endif
+
+ EXTRA_DIST=
+ BUILT_SOURCES=
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
new file mode 100644
index 000000000..f21eaca85
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
@@ -0,0 +1,51 @@
+From 704b888d0abfb01067352c40156f49f655691c7c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 19 Oct 2015 18:26:40 +0300
+Subject: [PATCH 3/5] giscanner: add --use-binary-wrapper option
+
+With this option, giscanner will use a wrapper executable to run
+binaries it's producing, instead of running them directly. This
+is useful when binaries are cross-compiled and cannot be run directly,
+but they can be run using for example QEMU emulation.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ giscanner/scannermain.py | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
+index 633496f..d684cd0 100755
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -124,6 +124,9 @@ def _get_option_parser():
+ parser.add_option("", "--program",
+ action="store", dest="program", default=None,
+ help="program to execute")
++ parser.add_option("", "--use-binary-wrapper",
++ action="store", dest="wrapper", default=None,
++ help="wrapper to use for running programs (useful when cross-compiling)")
+ parser.add_option("", "--program-arg",
+ action="append", dest="program_args", default=[],
+ help="extra arguments to program")
+@@ -419,6 +422,17 @@ def create_binary(transformer, options, args):
+ gdump_parser.get_error_quark_functions())
+
+ shlibs = resolve_shlibs(options, binary, options.libraries)
++ if options.wrapper:
++ # The wrapper needs the binary itself, not the libtool wrapper script,
++ # so we check if libtool has sneaked the binary into .libs subdirectory
++ # and adjust the path accordingly
++ import os.path
++ dir_name, binary_name = os.path.split(binary.args[0])
++ libtool_binary = os.path.join(dir_name, '.libs', binary_name)
++ if os.path.exists(libtool_binary):
++ binary.args[0] = libtool_binary
++ # Then prepend the wrapper to the command line to execute
++ binary.args = [options.wrapper] + binary.args
+ gdump_parser.set_introspection_binary(binary)
+ gdump_parser.parse()
+ return shlibs
+--
+2.7.0
+
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch
new file mode 100644
index 000000000..afb71e767
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch
@@ -0,0 +1,47 @@
+From d4ad57fd4a32c4f0d2f0522a3090ef940746431b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 30 Oct 2015 16:28:46 +0200
+Subject: [PATCH 4/5] giscanner: add a --use-ldd-wrapper option
+
+This is useful in cross-compile environments where system's ldd
+command does not work on binaries built for a different architecture
+
+Upstream-Status: Pending [review in oe-core]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ giscanner/scannermain.py | 3 +++
+ giscanner/shlibs.py | 4 +++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
+index d684cd0..1b3b369 100755
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -127,6 +127,9 @@ def _get_option_parser():
+ parser.add_option("", "--use-binary-wrapper",
+ action="store", dest="wrapper", default=None,
+ help="wrapper to use for running programs (useful when cross-compiling)")
++ parser.add_option("", "--use-ldd-wrapper",
++ action="store", dest="ldd_wrapper", default=None,
++ help="wrapper to use instead of ldd (useful when cross-compiling)")
+ parser.add_option("", "--program-arg",
+ action="append", dest="program_args", default=[],
+ help="extra arguments to program")
+diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
+index c93d20c..c5b5942 100644
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -105,7 +105,9 @@ def _resolve_non_libtool(options, binary, libraries):
+ args.extend(libtool)
+ args.append('--mode=execute')
+ platform_system = platform.system()
+- if platform_system == 'Darwin':
++ if options.ldd_wrapper:
++ args.extend([options.ldd_wrapper, binary.args[0]])
++ elif platform_system == 'Darwin':
+ args.extend(['otool', '-L', binary.args[0]])
+ else:
+ args.extend(['ldd', binary.args[0]])
+--
+2.7.0
+
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch
new file mode 100644
index 000000000..47a18ec84
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch
@@ -0,0 +1,96 @@
+From e08b3677dd04d6ec407ba8f74f601b2d51310eff Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 8 Oct 2015 18:30:35 +0300
+Subject: [PATCH 5/5] Prefix pkg-config paths with PKG_CONFIG_SYSROOT_DIR
+ environment variable
+
+This environment variable sets the location of sysroot directory in cross-compilation
+environments; if the variable is not set, the prefix will be empty.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile-gir.am | 18 +++++++++---------
+ m4/introspection.m4 | 8 ++++----
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile-gir.am b/Makefile-gir.am
+index a09260a..ba6e89e 100644
+--- a/Makefile-gir.am
++++ b/Makefile-gir.am
+@@ -55,8 +55,8 @@ else
+ endif
+
+ # glib
+-GLIB_INCLUDEDIR=$(shell "${PKG_CONFIG}" --variable=includedir glib-2.0)/glib-2.0
+-GLIB_LIBDIR=$(shell "${PKG_CONFIG}" --variable=libdir glib-2.0)
++GLIB_INCLUDEDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir glib-2.0)/glib-2.0
++GLIB_LIBDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=libdir glib-2.0)
+
+ GLIB_LIBRARY=glib-2.0
+
+@@ -92,8 +92,8 @@ GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT)
+ gir/DBusGLib-1.0.typelib: GObject-2.0.gir
+
+ # gobject
+-GOBJECT_INCLUDEDIR=$(shell "${PKG_CONFIG}" --variable=includedir gobject-2.0)/glib-2.0
+-GOBJECT_LIBDIR=$(shell "${PKG_CONFIG}" --variable=libdir gobject-2.0)
++GOBJECT_INCLUDEDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir gobject-2.0)/glib-2.0
++GOBJECT_LIBDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=libdir gobject-2.0)
+
+ GOBJECT_LIBRARY=gobject-2.0
+
+@@ -120,8 +120,8 @@ GObject_2_0_gir_FILES = \
+ BUILT_GIRSOURCES += GObject-2.0.gir
+
+ # gmodule
+-GMODULE_INCLUDEDIR=$(shell "${PKG_CONFIG}" --variable=includedir gmodule-2.0)/glib-2.0
+-GMODULE_LIBDIR=$(shell "${PKG_CONFIG}" --variable=libdir gmodule-2.0)
++GMODULE_INCLUDEDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir gmodule-2.0)/glib-2.0
++GMODULE_LIBDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=libdir gmodule-2.0)
+
+ GMODULE_LIBRARY=gmodule-2.0
+
+@@ -146,13 +146,13 @@ GModule_2_0_gir_FILES = $(GLIB_INCLUDEDIR)/gmodule.h \
+ BUILT_GIRSOURCES += GModule-2.0.gir
+
+ # gio
+-GIO_INCLUDEDIR=$(shell "${PKG_CONFIG}" --variable=includedir gio-2.0)/glib-2.0
+-GIO_LIBDIR=$(shell "${PKG_CONFIG}" --variable=libdir gio-2.0)
++GIO_INCLUDEDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir gio-2.0)/glib-2.0
++GIO_LIBDIR=$(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=libdir gio-2.0)
+
+ GIO_LIBRARY=gio-2.0
+
+ if HAVE_GIO_UNIX
+-GIO_UNIX_INCLUDEDIR = $(shell "${PKG_CONFIG}" --variable=includedir gio-unix-2.0)/gio-unix-2.0
++GIO_UNIX_INCLUDEDIR = $(PKG_CONFIG_SYSROOT_DIR)$(shell "${PKG_CONFIG}" --variable=includedir gio-unix-2.0)/gio-unix-2.0
+ GIO_UNIX_HDRS = $(GIO_UNIX_INCLUDEDIR)/gio/*.h
+ GIO_UNIX_PACKAGES = gio-unix-2.0
+ else
+diff --git a/m4/introspection.m4 b/m4/introspection.m4
+index d89c3d9..b562266 100644
+--- a/m4/introspection.m4
++++ b/m4/introspection.m4
+@@ -56,14 +56,14 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
++ INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
++ INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
++ INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
++ INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+ AC_SUBST(INTROSPECTION_COMPILER)
+--
+2.7.0
+
diff --git a/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.54.1.bb b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.54.1.bb
new file mode 100644
index 000000000..85c8001de
--- /dev/null
+++ b/poky/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.54.1.bb
@@ -0,0 +1,190 @@
+SUMMARY = "Middleware layer between GObject-using C libraries and language bindings"
+HOMEPAGE = "https://wiki.gnome.org/action/show/Projects/GObjectIntrospection"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "libs"
+LICENSE = "LGPLv2+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90d577535a3898e1ae5dbf0ae3509a8c \
+ file://tools/compiler.c;endline=20;md5=fc5007fc20022720e6c0b0cdde41fabd \
+ file://giscanner/sourcescanner.c;endline=22;md5=194d6e0c1d00662f32d030ce44de8d39 \
+ file://girepository/giregisteredtypeinfo.c;endline=21;md5=661847611ae6979465415f31a759ba27"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/1.54/${BPN}-${PV}.tar.xz \
+ file://0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch \
+ file://0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch \
+ file://0003-giscanner-add-use-binary-wrapper-option.patch \
+ file://0004-giscanner-add-a-use-ldd-wrapper-option.patch \
+ file://0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch \
+ file://0001-giscanner-add-a-lib-dirs-envvar-option.patch \
+ "
+SRC_URI[md5sum] = "126c29e4d54adbed2ed4e2b04483de41"
+SRC_URI[sha256sum] = "b88ded5e5f064ab58a93aadecd6d58db2ec9d970648534c63807d4f9a7bb877e"
+
+inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
+BBCLASSEXTEND = "native"
+
+# needed for writing out the qemu wrapper script
+export STAGING_DIR_HOST
+export B
+
+DEPENDS_append = " libffi zlib glib-2.0 python3 flex-native bison-native"
+
+# target build needs qemu to run temporary introspection binaries created
+# on the fly by g-ir-scanner and a native version of itself to run
+# native versions of its own tools during build.
+# Also prelink-rtld is used to find out library dependencies of introspection binaries
+# (standard ldd doesn't work when cross-compiling).
+DEPENDS_class-target_append = " gobject-introspection-native qemu-native prelink-native"
+
+SSTATE_SCAN_FILES += "g-ir-scanner-qemuwrapper g-ir-scanner-wrapper g-ir-compiler-wrapper g-ir-scanner-lddwrapper Gio-2.0.gir postinst-ldsoconf-${PN}"
+
+do_configure_prepend_class-native() {
+ # Tweak the native python scripts so that they don't refer to the
+ # full path of native python binary (the solution is taken from glib-2.0 recipe)
+ # This removes the risk of exceeding Linux kernel's shebang line limit (128 bytes)
+ sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
+}
+
+do_configure_prepend_class-target() {
+ # Write out a qemu wrapper that will be given to gi-scanner so that it
+ # can run target helper binaries through that.
+ qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['\$GIR_EXTRA_LIBS_PATH','.libs','$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
+ cat > ${B}/g-ir-scanner-qemuwrapper << EOF
+#!/bin/sh
+# Use a modules directory which doesn't exist so we don't load random things
+# which may then get deleted (or their dependencies) and potentially segfault
+export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
+
+$qemu_binary "\$@"
+if [ \$? -ne 0 ]; then
+ echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help."
+ echo "(typically like this: GIR_EXTRA_LIBS_PATH=\"$""{B}/something/.libs\" )"
+ exit 1
+fi
+EOF
+ chmod +x ${B}/g-ir-scanner-qemuwrapper
+
+ # Write out a wrapper for g-ir-scanner itself, which will be used when building introspection files
+ # for glib-based packages. This wrapper calls the native version of the scanner, and tells it to use
+ # a qemu wrapper for running transient target binaries produced by the scanner, and an include directory
+ # from the target sysroot.
+ cat > ${B}/g-ir-scanner-wrapper << EOF
+#!/bin/sh
+# This prevents g-ir-scanner from writing cache data to $HOME
+export GI_SCANNER_DISABLE_CACHE=1
+
+g-ir-scanner --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH --use-binary-wrapper=${STAGING_BINDIR}/g-ir-scanner-qemuwrapper --use-ldd-wrapper=${STAGING_BINDIR}/g-ir-scanner-lddwrapper --add-include-path=${STAGING_DATADIR}/gir-1.0 "\$@"
+EOF
+ chmod +x ${B}/g-ir-scanner-wrapper
+
+ # Write out a wrapper for g-ir-compiler, which runs the target version of it through qemu.
+ # g-ir-compiler writes out the raw content of a C struct to disk, and therefore is architecture dependent.
+ cat > ${B}/g-ir-compiler-wrapper << EOF
+#!/bin/sh
+${STAGING_BINDIR}/g-ir-scanner-qemuwrapper ${STAGING_BINDIR}/g-ir-compiler "\$@"
+EOF
+ chmod +x ${B}/g-ir-compiler-wrapper
+
+ # Write out a wrapper to use instead of ldd, which does not work when a binary is built
+ # for a different architecture
+ cat > ${B}/g-ir-scanner-lddwrapper << EOF
+#!/bin/sh
+prelink-rtld --root=$STAGING_DIR_HOST "\$@"
+EOF
+ chmod +x ${B}/g-ir-scanner-lddwrapper
+
+ # Also tweak the target python scripts so that they don't refer to the
+ # native version of python binary (the solution is taken from glib-2.0 recipe)
+ sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/tools/g-ir-tool-template.in
+}
+
+# Configure target build to use native tools of itself and to use a qemu wrapper
+# and optionally to generate introspection data
+EXTRA_OECONF_class-target += "--enable-host-gi \
+ --disable-static \
+ --enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \
+ --enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \
+ "
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[doctool] = "--enable-doctool,--disable-doctool,python3-mako,"
+
+do_compile_prepend() {
+ # This prevents g-ir-scanner from writing cache data to $HOME
+ export GI_SCANNER_DISABLE_CACHE=1
+
+ # Needed to run g-ir unit tests, which won't be able to find the built libraries otherwise
+ export GIR_EXTRA_LIBS_PATH=$B/.libs
+}
+
+# Our wrappers need to be available system-wide, because they will be used
+# to build introspection files for all other gobject-based packages
+do_install_append_class-target() {
+ install -d ${D}${bindir}/
+ install ${B}/g-ir-scanner-qemuwrapper ${D}${bindir}/
+ install ${B}/g-ir-scanner-wrapper ${D}${bindir}/
+ install ${B}/g-ir-compiler-wrapper ${D}${bindir}/
+ install ${B}/g-ir-scanner-lddwrapper ${D}${bindir}/
+}
+
+# .typelib files are needed at runtime and so they go to the main package
+FILES_${PN}_append = " ${libdir}/girepository-*/*.typelib"
+
+# .gir files go to dev package, as they're needed for developing (but not for running)
+# things that depends on introspection.
+FILES_${PN}-dev_append = " ${datadir}/gir-*/*.gir"
+FILES_${PN}-dev_append = " ${datadir}/gir-*/*.rnc"
+
+# These are used by gobject-based packages
+# to generate transient introspection binaries
+FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/gdump.c \
+ ${datadir}/gobject-introspection-1.0/Makefile.introspection"
+
+# These are used by dependent packages (e.g. pygobject) to build their
+# testsuites.
+FILES_${PN}-dev_append = " ${datadir}/gobject-introspection-1.0/tests/*.c \
+ ${datadir}/gobject-introspection-1.0/tests/*.h"
+
+FILES_${PN}-dbg += "${libdir}/gobject-introspection/giscanner/.debug/"
+FILES_${PN}-staticdev += "${libdir}/gobject-introspection/giscanner/*.a"
+
+# we need target versions of introspection tools in sysroot so that they can be run via qemu
+# when building introspection files in other packages
+SYSROOT_DIRS_append_class-target = " ${bindir}"
+
+SYSROOT_PREPROCESS_FUNCS_append_class-target = " gi_binaries_sysroot_preprocess"
+gi_binaries_sysroot_preprocess() {
+ # Tweak the binary names in the introspection pkgconfig file, so that it
+ # picks up our wrappers which do the cross-compile and qemu magic.
+ sed -i \
+ -e "s|g_ir_scanner=.*|g_ir_scanner=${bindir}/g-ir-scanner-wrapper|" \
+ -e "s|g_ir_compiler=.*|g_ir_compiler=${bindir}/g-ir-compiler-wrapper|" \
+ ${SYSROOT_DESTDIR}${libdir}/pkgconfig/gobject-introspection-1.0.pc
+}
+
+# Need to ensure ld.so.conf exists so prelink-native works
+# both before we build and if we install from sstate
+do_configure[prefuncs] += "gobject_introspection_preconfigure"
+python gobject_introspection_preconfigure () {
+ oe.utils.write_ld_so_conf(d)
+}
+
+SYSROOT_PREPROCESS_FUNCS_append = " gi_ldsoconf_sysroot_preprocess"
+gi_ldsoconf_sysroot_preprocess () {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ dest=${SYSROOT_DESTDIR}${bindir}/postinst-ldsoconf-${PN}
+ echo "#!/bin/sh" > $dest
+ echo "mkdir -p ${STAGING_DIR_TARGET}${sysconfdir}" >> $dest
+ echo "echo ${base_libdir} >> ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf" >> $dest
+ echo "echo ${libdir} >> ${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf" >> $dest
+ chmod 755 $dest
+}
+
+# Remove wrapper files from the package, only used for cross-compiling
+PACKAGE_PREPROCESS_FUNCS += "gi_package_preprocess"
+gi_package_preprocess() {
+ rm -f ${PKGD}${bindir}/g-ir-scanner-qemuwrapper
+ rm -f ${PKGD}${bindir}/g-ir-scanner-wrapper
+ rm -f ${PKGD}${bindir}/g-ir-compiler-wrapper
+ rm -f ${PKGD}${bindir}/g-ir-scanner-lddwrapper
+}
diff --git a/poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.24.1.bb b/poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.24.1.bb
new file mode 100644
index 000000000..b61fd2408
--- /dev/null
+++ b/poky/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.24.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "GNOME desktop-wide GSettings schemas"
+HOMEPAGE = "http://live.gnome.org/gsettings-desktop-schemas"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "glib-2.0 intltool-native"
+
+inherit gnomebase gsettings gettext gobject-introspection upstream-version-is-even
+
+SRC_URI[archive.md5sum] = "796b6ac1eff450261edd521b72e7fe6d"
+SRC_URI[archive.sha256sum] = "76a3fa309f9de6074d66848987214f0b128124ba7184c958c15ac78a8ac7eea7"
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+.inc b/poky/meta/recipes-gnome/gtk+/gtk+.inc
new file mode 100644
index 000000000..558bc485a
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+.inc
@@ -0,0 +1,103 @@
+SUMMARY = "Multi-platform toolkit for creating GUIs"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+SECTION = "libs"
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+# This picks stable releases in the 2.x series (but not 2.90 onwards,
+# which were GNOME 3 betas).
+UPSTREAM_CHECK_REGEX = "(?P<pver>2\.([0-8]*[02468])+(\.\d+)+)"
+
+X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
+DEPENDS = "glib-2.0 pango atk jpeg libpng gdk-pixbuf-native \
+ cairo gdk-pixbuf"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'directfb x11', d)}"
+
+PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"
+# without --with-gdktarget=directfb it will check for cairo-xlib which isn't available without X11 DISTRO_FEATURE
+PACKAGECONFIG[directfb] = "--with-gdktarget=directfb,,directfb"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
+
+inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache gobject-introspection manpages
+
+PACKAGES += "libgail gtk-demo"
+
+FILES_${PN} += "${bindir}/gtk-update-icon-cache-2.0 \
+ ${bindir}/gtk-query-immodules-2.0 \
+ ${datadir}/themes ${sysconfdir} \
+ ${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so"
+
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/include \
+ ${libdir}/gtk-2.0/modules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/printbackends/*.la \
+ ${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+ ${bindir}/gtk-builder-convert"
+
+FILES_gtk-demo = " \
+ ${datadir}/gtk-2.0/demo/* \
+ ${bindir}/gtk-demo \
+ "
+
+FILES_libgail = " \
+ ${libdir}/gtk-2.0/modules/libgail.so \
+ ${libdir}/gtk-2.0/modules/libferret.so \
+ "
+
+GTKBASE_RRECOMMENDS ?= "liberation-fonts \
+ gdk-pixbuf-loader-png \
+ gdk-pixbuf-loader-jpeg \
+ gdk-pixbuf-loader-gif \
+ gdk-pixbuf-loader-xpm \
+ shared-mime-info \
+ gnome-theme-adwaita \
+ "
+GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
+
+RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
+RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
+
+ALTERNATIVE_${PN} = "gtk-update-icon-cache"
+ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-2.0"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
+}
+
+do_install () {
+ autotools_do_install
+
+ install -d ${D}${sysconfdir}/gtk-2.0
+
+ mkdir -p ${D}${libdir}/gtk-2.0/include
+ install -m 0644 gdk/gdkconfig.h ${D}${libdir}/gtk-2.0/include/gdkconfig.h
+
+ install -m 0644 ${S}/gtk/gtkfilechooserprivate.h ${D}${includedir}/gtk-2.0/gtk/
+ install -m 0644 ${S}/gtk/gtkfilechooserutils.h ${D}${includedir}/gtk-2.0/gtk/
+ install -m 0644 ${S}/gtk/gtkfilesystemmodel.h ${D}${includedir}/gtk-2.0/gtk/
+
+ mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-2.0
+}
+
+SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess"
+
+gtk_sysroot_preprocess () {
+ if [ -e ${D}${bindir}/gtk-builder-convert ]; then
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${D}${bindir}/gtk-builder-convert ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ fi
+}
+
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch b/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch
new file mode 100644
index 000000000..74e479fd1
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch
@@ -0,0 +1,22 @@
+There are issues building the gtk+ tutorial and faq documentation.
+Since they were removed in gtk+ upstream and are superfluous in
+embedded applications, just don't build them.
+
+Thanks to Joshua Lock for suggesting this approach.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff -urN gtk+-2.22.1.orig/docs/Makefile.am gtk+-2.22.1/docs/Makefile.am
+--- gtk+-2.22.1.orig/docs/Makefile.am 2010-11-15 04:13:09.000000000 -0800
++++ gtk+-2.22.1/docs/Makefile.am 2011-02-23 19:25:16.914815097 -0800
+@@ -1,7 +1,7 @@
+ ## Process this file with automake to produce Makefile.in
+ include $(top_srcdir)/Makefile.decl
+
+-SUBDIRS = tutorial faq reference tools
++SUBDIRS = reference tools
+
+ EXTRA_DIST += \
+ defsformat.txt \
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch b/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
new file mode 100644
index 000000000..9eb7f6bf5
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Updated to apply to gtk+-2.24.15
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: gtk+-2.24.31/configure.ac
+===================================================================
+--- gtk+-2.24.31.orig/configure.ac
++++ gtk+-2.24.31/configure.ac
+@@ -415,7 +415,7 @@ AC_MSG_CHECKING([Whether to write depend
+ case $enable_explicit_deps in
+ auto)
+ export SED
+- deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+ if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -772,7 +772,7 @@ else
+ dnl Now we check to see if our libtool supports shared lib deps
+ dnl (in a rather ugly way even)
+ if $dynworks; then
+- module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++ module_libtool_config="${CONFIG_SHELL-/bin/sh} $host_alias-libtool --config"
+ module_deplibs_check=`$module_libtool_config | \
+ grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+ sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -1579,7 +1579,7 @@ fi
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`($host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+ GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
+ GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch b/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
new file mode 100644
index 000000000..96e1f5fea
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
@@ -0,0 +1,24 @@
+Fixes
+
+include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
+ typedef void (*GtkItemFactoryCallback) ();
+
+gcc5 has -Wstrict-prototypes on by default for -Werror so this becomes a build failure for consumers
+of this header e.g. matchbox-panel-2
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: gtk+-2.24.27/gtk/gtkitemfactory.h
+===================================================================
+--- gtk+-2.24.27.orig/gtk/gtkitemfactory.h
++++ gtk+-2.24.27/gtk/gtkitemfactory.h
+@@ -44,7 +44,7 @@ typedef void (*GtkPrintFunc) (gpoint
+ * (Note that if we are included from a C++ program () will mean
+ * (void) so an explicit cast will be needed.)
+ */
+-typedef void (*GtkItemFactoryCallback) ();
++typedef void (*GtkItemFactoryCallback) (void);
+ typedef void (*GtkItemFactoryCallback1) (gpointer callback_data,
+ guint callback_action,
+ GtkWidget *widget);
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff b/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff
new file mode 100644
index 000000000..340d12008
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff
@@ -0,0 +1,102 @@
+Upstream-Status: Pending
+
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c.orig 2010-06-22 18:11:33.000000000 +0800
++++ gtk/gtkcellrenderertoggle.c 2010-06-22 18:11:43.000000000 +0800
+@@ -71,6 +71,8 @@
+ PROP_INDICATOR_SIZE
+ };
+
++/* This is a hard-coded default which promptly gets overridden by a size
++ calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+- gint indicator_size;
+-
++ gint indicator_size; /* This is the real size */
++ gint override_size; /* This is the size set from the indicator-size property */
++ GtkWidget *cached_widget;
+ guint inconsistent : 1;
+ };
+
+@@ -104,6 +107,7 @@
+ GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+
+ priv->indicator_size = TOGGLE_WIDTH;
++ priv->override_size = 0;
+ priv->inconsistent = FALSE;
+ }
+
+@@ -210,7 +214,7 @@
+ g_value_set_boolean (value, celltoggle->radio);
+ break;
+ case PROP_INDICATOR_SIZE:
+- g_value_set_int (value, priv->indicator_size);
++ g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+ celltoggle->radio = g_value_get_boolean (value);
+ break;
+ case PROP_INDICATOR_SIZE:
+- priv->indicator_size = g_value_get_int (value);
++ priv->override_size = g_value_get_int (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++ GtkCellRendererTogglePrivate *priv = user_data;
++ PangoContext *context;
++ PangoFontMetrics *metrics;
++ int height;
++
++ context = gtk_widget_get_pango_context (widget);
++ metrics = pango_context_get_metrics (context,
++ widget->style->font_desc,
++ pango_context_get_language (context));
++
++ height = pango_font_metrics_get_ascent (metrics) +
++ pango_font_metrics_get_descent (metrics);
++
++ pango_font_metrics_unref (metrics);
++
++ priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ GtkWidget *widget,
+ GdkRectangle *cell_area,
+@@ -287,6 +312,20 @@
+
+ priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+
++ if (priv->override_size) {
++ priv->indicator_size = priv->override_size;
++ } else if (priv->cached_widget != widget) {
++ if (priv->cached_widget) {
++ g_object_remove_weak_pointer (widget, &priv->cached_widget);
++ g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++ }
++ priv->cached_widget = widget;
++ g_object_add_weak_pointer (widget, &priv->cached_widget);
++ g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++
++ on_widget_style_set (widget, NULL, priv);
++ }
++
+ calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+ calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch b/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch
new file mode 100644
index 000000000..d0a970ad4
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+/xsettings.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+Index: gtk+-2.21.2/gdk/x11/gdkevents-x11.c
+===================================================================
+--- gtk+-2.21.2.orig/gdk/x11/gdkevents-x11.c 2010-06-22 17:28:04.000000000 +0800
++++ gtk+-2.21.2/gdk/x11/gdkevents-x11.c 2010-06-22 17:28:06.000000000 +0800
+@@ -3062,10 +3062,9 @@
+ {
+ GdkScreenX11 *screen = data;
+
+- if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent))
+- return GDK_FILTER_REMOVE;
+- else
+- return GDK_FILTER_CONTINUE;
++ xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent);
++
++ return GDK_FILTER_CONTINUE;
+ }
+
+ static Bool
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3.inc b/poky/meta/recipes-gnome/gtk+/gtk+3.inc
new file mode 100644
index 000000000..420ead2ca
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -0,0 +1,130 @@
+SUMMARY = "Multi-platform toolkit for creating GUIs"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "libs"
+
+DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
+ gdk-pixbuf-native"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+inherit autotools gettext pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings distro_features_check gobject-introspection
+
+# versions >= 3.90 are development versions, otherwise like upstream-version-is-even
+UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar"
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+# This should be in autotools.bbclass, but until something elses uses it putting
+# it here avoids rebuilding everything.
+export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
+
+do_configure_prepend() {
+ # Do this because the configure script is running ./libtool directly
+ rm -f libtool
+ ln -s ${TARGET_PREFIX}libtool libtool
+ #delete a file that will get confused with generated one in ${B}
+ rm -f ${S}/gtk/gtktypefuncs.c
+}
+
+EXTRA_OECONF += " \
+ --disable-glibtest \
+ --disable-xinerama \
+ --enable-modules \
+ --disable-cups \
+ --disable-colord \
+ ${@bb.utils.contains("DISTRO_FEATURES", "x11", "", "--disable-gtk-doc", d)} \
+ "
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gdk/.libs"
+}
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl wayland x11', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'glx', '', d)}"
+
+PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
+# this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build
+PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl"
+PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland wayland-protocols libxkbcommon virtual/mesa wayland-native"
+
+do_install_append() {
+ mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
+}
+
+PACKAGES =+ "${PN}-demo"
+LIBV = "3.0.0"
+
+FILES_${PN}-demo = "${bindir}/gtk3-demo \
+ ${bindir}/gtk3-demo-application \
+ ${bindir}/gtk3-icon-browser \
+ ${bindir}/gtk3-widget-factory \
+ ${datadir}/gtk-3.0/demo \
+ ${datadir}/applications/gtk3-demo.desktop \
+ ${datadir}/applications/gtk3-icon-browser.desktop \
+ ${datadir}/applications/gtk3-widget-factory.desktop \
+ ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
+ ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
+
+FILES_${PN}_append = " ${bindir}/gtk-update-icon-cache-3.0 \
+ ${bindir}/gtk-query-immodules-3.0 \
+ ${bindir}/gtk-launch \
+ ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
+ ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
+ ${libdir}/gtk-3.0/modules/*.so"
+
+FILES_${PN}-dev += " \
+ ${datadir}/gtk-3.0/gtkbuilder.rng \
+ ${datadir}/gtk-3.0/include \
+ ${datadir}/gettext/its \
+ ${libdir}/gtk-3.0/include \
+ ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
+ ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
+ ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
+ ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
+ ${libdir}/gtk-3.0/modules/*.la \
+ ${bindir}/gtk-builder-convert \
+ ${bindir}/gtk-encode-symbolic-svg \
+ ${bindir}/gtk-builder-tool \
+ ${bindir}/gtk-query-settings \
+ "
+
+GTKBASE_RRECOMMENDS ?= "liberation-fonts \
+ gdk-pixbuf-loader-png \
+ gdk-pixbuf-loader-jpeg \
+ gdk-pixbuf-loader-gif \
+ gdk-pixbuf-loader-xpm \
+ shared-mime-info \
+ adwaita-icon-theme-symbolic \
+ "
+GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
+
+RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
+RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
+RDEPENDS_${PN}-dev += "${@bb.utils.contains("PACKAGECONFIG", "wayland", "wayland-protocols", "", d)}"
+
+PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
+
+ALTERNATIVE_${PN} = "gtk-update-icon-cache"
+ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
+ALTERNATIVE_PRIORITY = "30"
+
+python populate_packages_prepend () {
+ import os.path
+
+ gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s')
+ if immodules:
+ d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
+
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (d.getVar('DEBIAN_NAMES')):
+ d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-3.0')
+}
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch
new file mode 100644
index 000000000..c210bbc7d
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0001-Hardcoded-libtool.patch
@@ -0,0 +1,47 @@
+From 0ecaa5bab162abf0cb2057d77beeb7b89d5873b4 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 21 Jun 2016 14:53:56 +0300
+Subject: [PATCH 1/4] Hardcoded libtool
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6628e21..f43ac09 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -617,7 +617,7 @@ AC_MSG_CHECKING([whether to write dependencies into .pc files])
+ case $enable_explicit_deps in
+ auto)
+ export SED
+- deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++ deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+ if test "x$deplibs_check_method" != xpass_all || test "x$enable_static" = xyes ; then
+ enable_explicit_deps=yes
+ else
+@@ -895,7 +895,7 @@ else
+ dnl Now we check to see if our libtool supports shared lib deps
+ dnl (in a rather ugly way even)
+ if $dynworks; then
+- module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++ module_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config"
+ module_deplibs_check=`$module_libtool_config | \
+ grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+ sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -1649,7 +1649,7 @@ AC_SUBST(GTK_PRINT_BACKENDS)
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+ GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
+ GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
+--
+2.12.0
+
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch
new file mode 100644
index 000000000..cc7edf760
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0002-Do-not-try-to-initialize-GL-without-libGL.patch
@@ -0,0 +1,60 @@
+From 23a563155406980dfc8cf6f7c2da6cce0ac310f0 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 16 Oct 2015 16:35:16 +0300
+Subject: [PATCH 2/4] Do not try to initialize GL without libGL
+
+_gdk_x11_screen_update_visuals_for_gl() will end up calling epoxys
+GLX api which will exit() if libGL.so.1 is not present. We do not
+want that to happen and we don't want every app to have to set
+"GDK_GL=disabled" environment variable: so use #ifdef set based on
+opengl distro feature.
+
+Upstream is not interested in the fix as it is: Either epoxy should be
+fixed (to not exit) or GTK+ possibly could do some additional probing
+before calling epoxy APIs.
+
+Upstream-Status: Denied
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ configure.ac | 6 ++++++
+ gdk/x11/gdkvisual-x11.c | 5 +++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 757fd7c..0a48875 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -351,6 +351,12 @@ AC_ARG_ENABLE(cloudproviders,
+ [AS_HELP_STRING([--enable-cloudproviders],
+ [enable libcloudproviders integration])],
+ [cloudproviders_set=yes])
++AC_ARG_ENABLE(glx,
++ [AS_HELP_STRING([--enable-glx],
++ [When enabled Gdk will try to initialize GLX])])
++AS_IF([test "x$enable_glx" != "xno"], [
++ AC_DEFINE([HAVE_GLX], [], [GLX will be available at runtime])
++])
+
+ if test -z "$backend_set"; then
+ if test "$platform_win32" = yes; then
+diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
+index 81479d8..3c8c5c0 100644
+--- a/gdk/x11/gdkvisual-x11.c
++++ b/gdk/x11/gdkvisual-x11.c
+@@ -306,7 +306,12 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen)
+ /* If GL is available we want to pick better default/rgba visuals,
+ as we care about glx details such as alpha/depth/stencil depth,
+ stereo and double buffering */
++ /* update_visuals_for_gl() will end up calling epoxy GLX api which
++ will exit if libgl is not there: so only do this if we know GL
++ is available */
++#ifdef HAVE_GLX
+ _gdk_x11_screen_update_visuals_for_gl (screen);
++#endif
+ }
+
+ gint
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch b/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch
new file mode 100644
index 000000000..d2f12dc7f
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+3/0003-Add-disable-opengl-configure-option.patch
@@ -0,0 +1,847 @@
+From de36df70d87ba3453ed4f2b92e990021c67238f5 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 21 Jun 2016 15:11:39 +0300
+Subject: [PATCH 3/4] Add --disable-opengl configure option
+
+--disable-opengl will remove the dependency on libepoxy and on the
+OpenGL APIs. This is useful for those who want to keep using gtk+3
+without the "opengl" distro feature.
+
+GtkGLArea is still part of the API (it just doesn't work) even when
+OpenGL is disabled. GdkX11GLContext was removed from the Gtk API
+completely: that object exposes GL API elements so it had to be at
+the very least modified.
+
+The patch is _not_ great from a maintenance point of view and
+modifying the library API is also a fairly nasty thing to do.
+Next long term release (4.0) will require alternative solutions
+as it actually will depend on OpenGL.
+
+Upstream-Status: Inappropriate [Evil eye expected from upstream]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ configure.ac | 13 +++++--
+ demos/gtk-demo/glarea.c | 14 ++++++++
+ docs/tools/Makefile.am | 9 +++--
+ docs/tools/widgets.c | 4 ++-
+ gdk/gdkdisplay.c | 4 ++-
+ gdk/gdkgl.c | 10 ++++++
+ gdk/gdkglcontext.c | 6 ++++
+ gdk/gdkwindow.c | 13 +++++++
+ gdk/x11/Makefile.am | 30 +++++++++++++---
+ gdk/x11/gdkdisplay-x11.c | 6 +++-
+ gdk/x11/gdkscreen-x11.c | 5 +++
+ gdk/x11/gdkwindow-x11.c | 4 +++
+ gdk/x11/gdkx-autocleanups.h | 2 ++
+ gdk/x11/{gdkx.h => gdkx-with-gl-context.h} | 1 -
+ gdk/x11/gdkx-without-gl-context.h | 58 ++++++++++++++++++++++++++++++
+ gtk/Makefile.am | 3 +-
+ gtk/gtkglarea.c | 20 ++++++++++-
+ gtk/inspector/general.c | 6 ++++
+ tests/Makefile.am | 10 ++++--
+ testsuite/gtk/objects-finalize.c | 2 ++
+ 20 files changed, 202 insertions(+), 18 deletions(-)
+ rename gdk/x11/{gdkx.h => gdkx-with-gl-context.h} (98%)
+ create mode 100644 gdk/x11/gdkx-without-gl-context.h
+
+diff --git a/configure.ac b/configure.ac
+index 0a48875..6f0a3a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -351,6 +351,15 @@ AC_ARG_ENABLE(cloudproviders,
+ [AS_HELP_STRING([--enable-cloudproviders],
+ [enable libcloudproviders integration])],
+ [cloudproviders_set=yes])
++AC_ARG_ENABLE(opengl,
++ [AS_HELP_STRING([--enable-opengl],
++ [When enabled, Gtk+ will use libepoxy and exposes GtkGLArea widget ])])
++AS_IF([test "x$enable_opengl" != "xno"], [
++ AC_DEFINE([HAVE_OPENGL], [1], [libepoxy and opengl APIs are available at buildtime])
++ EPOXY_PACKAGES="epoxy >= epoxy_required_version"
++])
++AM_CONDITIONAL([HAVE_OPENGL],[test "x$enable_opengl" != "xno"])
++
+ AC_ARG_ENABLE(glx,
+ [AS_HELP_STRING([--enable-glx],
+ [When enabled Gdk will try to initialize GLX])])
+@@ -1372,7 +1381,7 @@ CFLAGS="$saved_cflags"
+ LDFLAGS="$saved_ldflags"
+
+ GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version"
+-GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version $CLOUDPROVIDER_PACKAGES"
++GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends $EPOXY_PACKAGES $CLOUDPROVIDER_PACKAGES"
+
+ PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES)
+ GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB"
+@@ -1406,7 +1415,7 @@ fi
+ PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
+
+ GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version"
+-GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version"
++GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $EPOXY_PACKAGES"
+ if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then
+ GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2"
+ fi
+diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c
+index b51e4ae..82409c7 100644
+--- a/demos/gtk-demo/glarea.c
++++ b/demos/gtk-demo/glarea.c
+@@ -3,9 +3,12 @@
+ * GtkGLArea is a widget that allows custom drawing using OpenGL calls.
+ */
+
++#include "config.h"
+ #include <math.h>
+ #include <gtk/gtk.h>
++#if HAVE_OPENGL
+ #include <epoxy/gl.h>
++#endif
+
+ static GtkWidget *demo_window = NULL;
+
+@@ -23,6 +26,8 @@ enum {
+ /* Rotation angles on each axis */
+ static float rotation_angles[N_AXIS] = { 0.0 };
+
++#ifdef HAVE_OPENGL
++
+ /* The object we are drawing */
+ static const GLfloat vertex_data[] = {
+ 0.f, 0.5f, 0.f, 1.f,
+@@ -215,6 +220,7 @@ compute_mvp (float *res,
+ static GLuint position_buffer;
+ static GLuint program;
+ static GLuint mvp_location;
++#endif
+
+ /* We need to set up our state when we realize the GtkGLArea widget */
+ static void
+@@ -241,8 +247,10 @@ realize (GtkWidget *widget)
+ fragment_path = "/glarea/glarea-gl.fs.glsl";
+ }
+
++#ifdef HAVE_OPENGL
+ init_buffers (&position_buffer, NULL);
+ init_shaders (vertex_path, fragment_path, &program, &mvp_location);
++#endif
+ }
+
+ /* We should tear down the state when unrealizing */
+@@ -254,10 +262,13 @@ unrealize (GtkWidget *widget)
+ if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
+ return;
+
++#ifdef HAVE_OPENGL
+ glDeleteBuffers (1, &position_buffer);
+ glDeleteProgram (program);
++#endif
+ }
+
++#ifdef HAVE_OPENGL
+ static void
+ draw_triangle (void)
+ {
+@@ -290,6 +301,7 @@ draw_triangle (void)
+ glBindBuffer (GL_ARRAY_BUFFER, 0);
+ glUseProgram (0);
+ }
++#endif
+
+ static gboolean
+ render (GtkGLArea *area,
+@@ -298,6 +310,7 @@ render (GtkGLArea *area,
+ if (gtk_gl_area_get_error (area) != NULL)
+ return FALSE;
+
++#ifdef HAVE_OPENGL
+ /* Clear the viewport */
+ glClearColor (0.5, 0.5, 0.5, 1.0);
+ glClear (GL_COLOR_BUFFER_BIT);
+@@ -307,6 +320,7 @@ render (GtkGLArea *area,
+
+ /* Flush the contents of the pipeline */
+ glFlush ();
++#endif
+
+ return TRUE;
+ }
+diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am
+index 6a6d70f..5cdf312 100644
+--- a/docs/tools/Makefile.am
++++ b/docs/tools/Makefile.am
+@@ -9,13 +9,18 @@ AM_CPPFLAGS = \
+ $(GTK_DEBUG_FLAGS) \
+ $(GTK_DEP_CFLAGS)
+
++if HAVE_OPENGL
++GEARS_LDADD = $(top_builddir)/tests/gtkgears.o
++endif
++
+ DEPS = \
+- $(top_builddir)/gtk/libgtk-3.la
++ $(top_builddir)/gtk/libgtk-3.la \
++ $(GEARS_LDADD)
+
+ LDADDS = \
+ $(top_builddir)/gtk/libgtk-3.la \
+ $(top_builddir)/gdk/libgdk-3.la \
+- $(top_builddir)/tests/gtkgears.o \
++ $(GEARS_LDADD) \
+ $(GTK_DEP_LIBS) \
+ $(GDK_DEP_LIBS) \
+ -lm
+diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
+index 932daf1..54239d6 100644
+--- a/docs/tools/widgets.c
++++ b/docs/tools/widgets.c
+@@ -1526,9 +1526,11 @@ create_gl_area (void)
+ widget = gtk_frame_new (NULL);
+ gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
+
++#ifdef HAVE_OPENGL
+ gears = gtk_gears_new ();
+ gtk_container_add (GTK_CONTAINER (widget), gears);
+-
++#endif
++
+ info = new_widget_info ("glarea", widget, MEDIUM);
+
+ return info;
+diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
+index 40225e9..c55e1de 100644
+--- a/gdk/gdkdisplay.c
++++ b/gdk/gdkdisplay.c
+@@ -2406,7 +2406,9 @@ gboolean
+ gdk_display_make_gl_context_current (GdkDisplay *display,
+ GdkGLContext *context)
+ {
+- return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context);
++ if (GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current)
++ return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context);
++ return FALSE;
+ }
+
+ GdkRenderingMode
+diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
+index 8e7b8c2..b579b22 100644
+--- a/gdk/gdkgl.c
++++ b/gdk/gdkgl.c
+@@ -22,7 +22,9 @@
+
+ #include "gdkinternals.h"
+
++#ifdef HAVE_OPENGL
+ #include <epoxy/gl.h>
++#endif
+ #include <math.h>
+ #include <string.h>
+
+@@ -36,6 +38,7 @@ gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
+ g_object_ref (window), g_object_unref);
+ }
+
++#ifdef HAVE_OPENGL
+ static const char *
+ get_vertex_type_name (int type)
+ {
+@@ -208,6 +211,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
+ glUseProgram (paint_data->current_program->program);
+ }
+ }
++#endif
+
+ void
+ gdk_gl_texture_quads (GdkGLContext *paint_context,
+@@ -216,6 +220,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
+ GdkTexturedQuad *quads,
+ gboolean flip_colors)
+ {
++#ifdef HAVE_OPENGL
+ GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context);
+ GdkGLContextProgram *program;
+ GdkWindow *window = gdk_gl_context_get_window (paint_context);
+@@ -289,6 +294,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
+
+ glDisableVertexAttribArray (program->position_location);
+ glDisableVertexAttribArray (program->uv_location);
++#endif
+ }
+
+ /* x,y,width,height describes a rectangle in the gl render buffer
+@@ -337,6 +343,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
+ int width,
+ int height)
+ {
++#ifdef HAVE_OPENGL
+ GdkGLContext *paint_context;
+ cairo_surface_t *image;
+ cairo_matrix_t matrix;
+@@ -707,6 +714,7 @@ out:
+ if (clip_region)
+ cairo_region_destroy (clip_region);
+
++#endif
+ }
+
+ /* This is always called with the paint context current */
+@@ -714,6 +722,7 @@ void
+ gdk_gl_texture_from_surface (cairo_surface_t *surface,
+ cairo_region_t *region)
+ {
++#ifdef HAVE_OPENGL
+ GdkGLContext *paint_context;
+ cairo_surface_t *image;
+ double device_x_offset, device_y_offset;
+@@ -814,4 +823,5 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
+
+ glDisable (GL_SCISSOR_TEST);
+ glDeleteTextures (1, &texture_id);
++#endif
+ }
+diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
+index c79dca0..8a7bec2 100644
+--- a/gdk/gdkglcontext.c
++++ b/gdk/gdkglcontext.c
+@@ -85,7 +85,9 @@
+ #include "gdkintl.h"
+ #include "gdk-private.h"
+
++#ifdef HAVE_OPENGL
+ #include <epoxy/gl.h>
++#endif
+
+ typedef struct {
+ GdkDisplay *display;
+@@ -243,6 +245,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
+ int height,
+ guint texture_target)
+ {
++#ifdef HAVE_OPENGL
+ GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+
+ g_return_if_fail (GDK_IS_GL_CONTEXT (context));
+@@ -286,6 +289,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
+ glTexSubImage2D (texture_target, 0, 0, i, width, 1, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, (unsigned char*) data + (i * stride));
+ }
+ }
++#endif
+ }
+
+ static gboolean
+@@ -774,6 +778,7 @@ gdk_gl_context_realize (GdkGLContext *context,
+ static void
+ gdk_gl_context_check_extensions (GdkGLContext *context)
+ {
++#ifdef HAVE_OPENGL
+ GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+ gboolean has_npot, has_texture_rectangle;
+
+@@ -847,6 +852,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
+ priv->use_texture_rectangle ? "yes" : "no"));
+
+ priv->extensions_checked = TRUE;
++#endif
+ }
+
+ /**
+diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
+index c0e0a7d..437ab03 100644
+--- a/gdk/gdkwindow.c
++++ b/gdk/gdkwindow.c
+@@ -45,7 +45,9 @@
+
+ #include <math.h>
+
++#ifdef HAVE_OPENGL
+ #include <epoxy/gl.h>
++#endif
+
+ /* for the use of round() */
+ #include "fallback-c89.c"
+@@ -2822,6 +2824,13 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
+ {
+ GError *internal_error = NULL;
+
++#ifndef HAVE_OPENGL
++ g_set_error_literal (error, GDK_GL_ERROR,
++ GDK_GL_ERROR_NOT_AVAILABLE,
++ _("GL support disabled with --disable-opengl"));
++ return NULL;
++#endif
++
+ if (_gdk_gl_flags & GDK_GL_DISABLE)
+ {
+ g_set_error_literal (error, GDK_GL_ERROR,
+@@ -2957,6 +2966,7 @@ gdk_window_begin_paint_internal (GdkWindow *window,
+ }
+ else
+ {
++#ifdef HAVE_OPENGL
+ gdk_gl_context_make_current (context);
+ /* With gl we always need a surface to combine the gl
+ drawing with the native drawing. */
+@@ -2971,6 +2981,7 @@ gdk_window_begin_paint_internal (GdkWindow *window,
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+
+ glViewport (0, 0, ww, wh);
++#endif
+ }
+ }
+
+@@ -3034,6 +3045,7 @@ gdk_window_end_paint_internal (GdkWindow *window)
+
+ gdk_gl_context_make_current (window->gl_paint_context);
+
++#ifdef HAVE_OPENGL
+ if (!cairo_region_is_empty (opaque_region))
+ gdk_gl_texture_from_surface (window->current_paint.surface,
+ opaque_region);
+@@ -3044,6 +3056,7 @@ gdk_window_end_paint_internal (GdkWindow *window)
+ window->current_paint.need_blend_region);
+ glDisable(GL_BLEND);
+ }
++#endif
+
+ cairo_region_destroy (opaque_region);
+
+diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
+index 6289f3a..cbbac79 100644
+--- a/gdk/x11/Makefile.am
++++ b/gdk/x11/Makefile.am
+@@ -40,8 +40,6 @@ libgdk_x11_la_SOURCES = \
+ gdkeventtranslator.c \
+ gdkeventtranslator.h \
+ gdkgeometry-x11.c \
+- gdkglcontext-x11.c \
+- gdkglcontext-x11.h \
+ gdkkeys-x11.c \
+ gdkmain-x11.c \
+ gdkmonitor-x11.c \
+@@ -56,14 +54,32 @@ libgdk_x11_la_SOURCES = \
+ gdkwindow-x11.h \
+ gdkxftdefaults.c \
+ gdkxid.c \
+- gdkx.h \
+ gdkprivate-x11.h \
+ xsettings-client.h \
+ xsettings-client.c
+
++if HAVE_OPENGL
++libgdk_x11_la_SOURCES += \
++ gdkglcontext-x11.c \
++ gdkglcontext-x11.h
++endif
++
+ libgdkinclude_HEADERS = \
+ gdkx.h
+
++if HAVE_OPENGL
++GDKX_HEADER = gdkx-with-gl-context.h
++else
++GDKX_HEADER = gdkx-without-gl-context.h
++endif
++
++BUILT_SOURCES = gdkx.h
++
++.PHONY: gdkx.h
++gdkx.h:
++ $(AM_V_GEN) cd $(srcdir) \
++ && (cmp -s $(GDKX_HEADER) gdkx.h || cp $(GDKX_HEADER) gdkx.h )
++
+ libgdkx11include_HEADERS = \
+ gdkx-autocleanups.h \
+ gdkx11applaunchcontext.h \
+@@ -77,7 +93,6 @@ libgdkx11include_HEADERS = \
+ gdkx11display.h \
+ gdkx11displaymanager.h \
+ gdkx11dnd.h \
+- gdkx11glcontext.h \
+ gdkx11keys.h \
+ gdkx11monitor.h \
+ gdkx11property.h \
+@@ -87,9 +102,16 @@ libgdkx11include_HEADERS = \
+ gdkx11visual.h \
+ gdkx11window.h
+
++if HAVE_OPENGL
++libgdkx11include_HEADERS += gdkx11glcontext.h
++endif
++
+ # We need to include all these C files here since the conditionals
+ # don't seem to be correctly expanded for the dist files.
+ EXTRA_DIST += \
++ gdkx.h \
+ gdksettings.c
+
++MAINTAINERCLEANFILES = gdkx.h
++
+ -include $(top_srcdir)/git.mk
+diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
+index e9a263f..2829a31 100644
+--- a/gdk/x11/gdkdisplay-x11.c
++++ b/gdk/x11/gdkdisplay-x11.c
+@@ -37,7 +37,9 @@
+ #include "gdkdisplay-x11.h"
+ #include "gdkprivate-x11.h"
+ #include "gdkscreen-x11.h"
++#ifdef HAVE_OPENGL
+ #include "gdkglcontext-x11.h"
++#endif
+ #include "gdk-private.h"
+
+ #include <glib.h>
+@@ -3169,7 +3171,9 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class)
+ display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list;
+ display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target;
+
+- display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current;
++#ifdef HAVE_OPENGL
++ display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current;
++#endif
+
+ display_class->get_default_seat = gdk_x11_display_get_default_seat;
+
+diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
+index 7bf9979..cd1cc9d 100644
+--- a/gdk/x11/gdkscreen-x11.c
++++ b/gdk/x11/gdkscreen-x11.c
+@@ -1643,3 +1643,8 @@ gdk_x11_screen_get_current_desktop (GdkScreen *screen)
+ {
+ return get_netwm_cardinal_property (screen, "_NET_CURRENT_DESKTOP");
+ }
++
++#ifndef HAVE_OPENGL
++/* Function from in gdk/x11/gdkglcontext-x11.c */
++void _gdk_x11_screen_update_visuals_for_gl (GdkScreen *screen) {}
++#endif
+diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
+index 3d6fd3b..2bd5c87 100644
+--- a/gdk/x11/gdkwindow-x11.c
++++ b/gdk/x11/gdkwindow-x11.c
+@@ -36,7 +36,9 @@
+ #include "gdkasync.h"
+ #include "gdkeventsource.h"
+ #include "gdkdisplay-x11.h"
++#ifdef HAVE_OPENGL
+ #include "gdkglcontext-x11.h"
++#endif
+ #include "gdkprivate-x11.h"
+ #include "gdk-private.h"
+
+@@ -5801,7 +5803,9 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
+ impl_class->set_opaque_region = gdk_x11_window_set_opaque_region;
+ impl_class->set_shadow_width = gdk_x11_window_set_shadow_width;
+ impl_class->show_window_menu = gdk_x11_window_show_window_menu;
++#ifdef HAVE_OPENGL
+ impl_class->create_gl_context = gdk_x11_window_create_gl_context;
+ impl_class->invalidate_for_new_frame = gdk_x11_window_invalidate_for_new_frame;
++#endif
+ impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size;
+ }
+diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h
+index edb0ea7..a317d61 100644
+--- a/gdk/x11/gdkx-autocleanups.h
++++ b/gdk/x11/gdkx-autocleanups.h
+@@ -30,7 +30,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DeviceXI2, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Display, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DisplayManager, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DragContext, g_object_unref)
++#ifdef HAVE_OPENGL
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11GLContext, g_object_unref)
++#endif
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Keymap, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Screen, g_object_unref)
+ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Visual, g_object_unref)
+diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx-with-gl-context.h
+similarity index 98%
+rename from gdk/x11/gdkx.h
+rename to gdk/x11/gdkx-with-gl-context.h
+index 1f64bcc..ae05fa6 100644
+--- a/gdk/x11/gdkx.h
++++ b/gdk/x11/gdkx-with-gl-context.h
+@@ -45,7 +45,6 @@
+ #include <gdk/x11/gdkx11dnd.h>
+ #include <gdk/x11/gdkx11glcontext.h>
+ #include <gdk/x11/gdkx11keys.h>
+-#include <gdk/x11/gdkx11monitor.h>
+ #include <gdk/x11/gdkx11property.h>
+ #include <gdk/x11/gdkx11screen.h>
+ #include <gdk/x11/gdkx11selection.h>
+diff --git a/gdk/x11/gdkx-without-gl-context.h b/gdk/x11/gdkx-without-gl-context.h
+new file mode 100644
+index 0000000..c9e2617
+--- /dev/null
++++ b/gdk/x11/gdkx-without-gl-context.h
+@@ -0,0 +1,58 @@
++/* GDK - The GIMP Drawing Kit
++ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
++ */
++
++/*
++ * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
++ * file for a list of people on the GTK+ Team. See the ChangeLog
++ * files for a list of changes. These files are distributed with
++ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
++ */
++
++#ifndef __GDK_X_H__
++#define __GDK_X_H__
++
++#include <gdk/gdk.h>
++
++#include <X11/Xlib.h>
++#include <X11/Xutil.h>
++
++#define __GDKX_H_INSIDE__
++
++#include <gdk/x11/gdkx11applaunchcontext.h>
++#include <gdk/x11/gdkx11cursor.h>
++#include <gdk/x11/gdkx11device.h>
++#include <gdk/x11/gdkx11device-core.h>
++#include <gdk/x11/gdkx11device-xi2.h>
++#include <gdk/x11/gdkx11devicemanager.h>
++#include <gdk/x11/gdkx11devicemanager-core.h>
++#include <gdk/x11/gdkx11devicemanager-xi2.h>
++#include <gdk/x11/gdkx11display.h>
++#include <gdk/x11/gdkx11displaymanager.h>
++#include <gdk/x11/gdkx11dnd.h>
++#include <gdk/x11/gdkx11keys.h>
++#include <gdk/x11/gdkx11property.h>
++#include <gdk/x11/gdkx11screen.h>
++#include <gdk/x11/gdkx11selection.h>
++#include <gdk/x11/gdkx11utils.h>
++#include <gdk/x11/gdkx11visual.h>
++#include <gdk/x11/gdkx11window.h>
++
++#include <gdk/x11/gdkx-autocleanups.h>
++
++#undef __GDKX_H_INSIDE__
++
++#endif /* __GDK_X_H__ */
+diff --git a/gtk/Makefile.am b/gtk/Makefile.am
+index 842c2f9..0921bc7 100644
+--- a/gtk/Makefile.am
++++ b/gtk/Makefile.am
+@@ -1416,14 +1416,13 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins.
+ && cp xgen-gptbc gtkprivatetypebuiltins.c \
+ && rm -f xgen-gptbc
+
+-
+ gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile
+ $(AM_V_GEN) (echo '#undef GTK_COMPILATION' && echo '#include <gtk/gtkx.h>') > xgen-gtfsrc.c && \
+ echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \
+ ${CPP} $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
+ $(GREP) -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \
+ sort | uniq | \
+- $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' >> xgen-gtf \
++ $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; s/^.*gdk_x11_gl.*$$/#ifdef HAVE_OPENGL\n&\n#endif/; }' >> xgen-gtf \
+ && cp xgen-gtf $@ && rm -f xgen-gtf
+ gtktestutils.c: gtktypefuncs.c
+
+diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
+index 094378e..f7c7f47 100644
+--- a/gtk/gtkglarea.c
++++ b/gtk/gtkglarea.c
+@@ -28,7 +28,9 @@
+ #include "gtkprivate.h"
+ #include "gtkrender.h"
+
++#ifdef HAVE_OPENGL
+ #include <epoxy/gl.h>
++#endif
+
+ /**
+ * SECTION:gtkglarea
+@@ -368,9 +370,12 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
+ static void
+ gtk_gl_area_resize (GtkGLArea *area, int width, int height)
+ {
++#ifdef HAVE_OPENGL
+ glViewport (0, 0, width, height);
++#endif
+ }
+
++#ifdef HAVE_OPENGL
+ /*
+ * Creates all the buffer objects needed for rendering the scene
+ */
+@@ -482,6 +487,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
+
+ priv->needs_render = TRUE;
+ }
++#endif
+
+ /**
+ * gtk_gl_area_attach_buffers:
+@@ -500,6 +506,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
+ void
+ gtk_gl_area_attach_buffers (GtkGLArea *area)
+ {
++#ifdef HAVE_OPENGL
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+
+ g_return_if_fail (GTK_IS_GL_AREA (area));
+@@ -532,11 +539,13 @@ gtk_gl_area_attach_buffers (GtkGLArea *area)
+ glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer);
+ }
++#endif
+ }
+
+ static void
+ gtk_gl_area_delete_buffers (GtkGLArea *area)
+ {
++#ifdef HAVE_OPENGL
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+
+ if (priv->context == NULL)
+@@ -568,6 +577,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area)
+ glDeleteFramebuffersEXT (1, &priv->frame_buffer);
+ priv->frame_buffer = 0;
+ }
++#endif
+ }
+
+ static void
+@@ -678,6 +688,7 @@ gtk_gl_area_draw (GtkWidget *widget,
+ GtkGLArea *area = GTK_GL_AREA (widget);
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+ gboolean unused;
++#ifdef HAVE_OPENGL
+ int w, h, scale;
+ GLenum status;
+
+@@ -689,7 +700,6 @@ gtk_gl_area_draw (GtkWidget *widget,
+ gtk_widget_get_allocated_height (widget));
+ return FALSE;
+ }
+-
+ if (priv->context == NULL)
+ return FALSE;
+
+@@ -735,6 +745,14 @@ gtk_gl_area_draw (GtkWidget *widget,
+ }
+
+ return TRUE;
++#else
++ if (priv->error != NULL)
++ gtk_gl_area_draw_error_screen (area,
++ cr,
++ gtk_widget_get_allocated_width (widget),
++ gtk_widget_get_allocated_height (widget));
++ return FALSE;
++#endif
+ }
+
+ static gboolean
+diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
+index c241ec8..24576dd 100644
+--- a/gtk/inspector/general.c
++++ b/gtk/inspector/general.c
+@@ -33,8 +33,10 @@
+
+ #ifdef GDK_WINDOWING_X11
+ #include "x11/gdkx.h"
++#ifdef HAVE_OPENGL
+ #include <epoxy/glx.h>
+ #endif
++#endif
+
+ #ifdef GDK_WINDOWING_WIN32
+ #include "win32/gdkwin32.h"
+@@ -196,6 +198,7 @@ add_label_row (GtkInspectorGeneral *gen,
+ gtk_size_group_add_widget (GTK_SIZE_GROUP (gen->priv->labels), label);
+ }
+
++#ifdef HAVE_OPENGL
+ #ifdef GDK_WINDOWING_X11
+ static void
+ append_glx_extension_row (GtkInspectorGeneral *gen,
+@@ -205,6 +208,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen,
+ add_check_row (gen, GTK_LIST_BOX (gen->priv->gl_box), ext, epoxy_has_glx_extension (dpy, 0, ext), 0);
+ }
+ #endif
++#endif
+
+ #ifdef GDK_WINDOWING_WAYLAND
+ static void
+@@ -254,6 +258,7 @@ wayland_get_display (struct wl_display *wl_display)
+ static void
+ init_gl (GtkInspectorGeneral *gen)
+ {
++#ifdef HAVE_OPENGL
+ #ifdef GDK_WINDOWING_X11
+ if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
+ {
+@@ -280,6 +285,7 @@ init_gl (GtkInspectorGeneral *gen)
+ }
+ else
+ #endif
++#endif
+ #ifdef GDK_WINDOWING_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
+ {
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index e2db6e4..e51cf34 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -80,8 +80,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \
+ testfullscreen \
+ testgeometry \
+ testgiconpixbuf \
+- testglarea \
+- testglblending \
+ testgrid \
+ testgtk \
+ testheaderbar \
+@@ -170,12 +168,18 @@ noinst_PROGRAMS = $(TEST_PROGS) \
+ testactionbar \
+ testwindowsize \
+ testpopover \
+- gdkgears \
+ listmodel \
+ testpopup \
+ testpopupat \
+ $(NULL)
+
++if HAVE_OPENGL
++noinst_PROGRAMS +=
++ testglarea \
++ testglblending \
++ gdkgears
++endif
++
+ if USE_WAYLAND
+ noinst_PROGRAMS += testforeign
+ endif
+diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c
+index 0b3a519..07b096f 100644
+--- a/testsuite/gtk/objects-finalize.c
++++ b/testsuite/gtk/objects-finalize.c
+@@ -115,7 +115,9 @@ main (int argc, char **argv)
+ all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_CORE &&
+ all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_XI2 &&
+ all_types[i] != GDK_TYPE_X11_DISPLAY_MANAGER &&
++#ifdef HAVE_OPENGL
+ all_types[i] != GDK_TYPE_X11_GL_CONTEXT &&
++#endif
+ #endif
+ /* Not allowed to finalize a GdkPixbufLoader without calling gdk_pixbuf_loader_close() */
+ all_types[i] != GDK_TYPE_PIXBUF_LOADER &&
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb b/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb
new file mode 100644
index 000000000..864e8260c
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+3_3.22.28.bb
@@ -0,0 +1,18 @@
+require gtk+3.inc
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+ file://0001-Hardcoded-libtool.patch \
+ file://0002-Do-not-try-to-initialize-GL-without-libGL.patch \
+ file://0003-Add-disable-opengl-configure-option.patch \
+ "
+SRC_URI[md5sum] = "8c1f5ab987ddc7dab3e59660f89dcd9b"
+SRC_URI[sha256sum] = "d299612b018cfed7b2c689168ab52b668023708e17c335eb592260d186f15e1f"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+ file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+ file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+ file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
diff --git a/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb b/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb
new file mode 100644
index 000000000..20703588c
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk+_2.24.32.bb
@@ -0,0 +1,34 @@
+require gtk+.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \
+ file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \
+ file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c"
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
+ file://xsettings.patch \
+ file://hardcoded_libtool.patch \
+ file://toggle-font.diff;striplevel=0 \
+ file://doc-fixes.patch \
+ file://strict-prototypes.patch \
+ "
+
+SRC_URI[md5sum] = "d5742aa42275203a499b59b4c382a784"
+SRC_URI[sha256sum] = "b6c8a93ddda5eabe3bfee1eb39636c9a03d2a56c7b62828b359bf197943c582e"
+
+EXTRA_OECONF = "--enable-xkb --disable-glibtest --disable-cups --disable-xinerama"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC += "^gtk-immodule-.* ^gtk-printbackend-.*"
+
+python populate_packages_prepend () {
+ gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')
+ immodules_root = os.path.join(gtk_libdir, 'immodules')
+ printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+ d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s')))
+ do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+ if (d.getVar('DEBIAN_NAMES')):
+ d.setVar(d.expand('PKG_${PN}'), '${MLPREFIX}libgtk-2.0')
+}
diff --git a/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb
new file mode 100644
index 000000000..942c04717
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.22.28.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Native icon utils for GTK+"
+DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution."
+SECTION = "libs"
+
+DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+ file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch"
+SRC_URI[md5sum] = "8c1f5ab987ddc7dab3e59660f89dcd9b"
+SRC_URI[sha256sum] = "d299612b018cfed7b2c689168ab52b668023708e17c335eb592260d186f15e1f"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+ file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+ file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+ file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+inherit pkgconfig native
+
+# versions >= 3.90 are development versions, otherwise like upstream-version-is-even
+UPSTREAM_CHECK_REGEX = "[^\d\.](?P<pver>3\.([1-8]?[02468])+(\.\d+)+)\.tar"
+
+PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
+
+do_configure() {
+ # Quite ugly but defines enough to compile the tools.
+ if ! test -f gtk/config.h; then
+ echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
+ echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
+ echo "#define HAVE_FTW_H 1" >> gtk/config.h
+ fi
+ if ! test -f gdk/config.h; then
+ touch gdk/config.h
+ fi
+}
+
+do_compile() {
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+ ${S}/gtk/updateiconcache.c \
+ $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
+ -o gtk-update-icon-cache
+
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+ ${S}/gtk/encodesymbolic.c \
+ $(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \
+ -o gtk-encode-symbolic-svg
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
+ install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir}
+
+ create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+ create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
+ GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+}
diff --git a/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
new file mode 100644
index 000000000..237f80375
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
@@ -0,0 +1,102 @@
+From 4d09ff324419fe4e671233044e424378da53969b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 9 Jun 2015 14:20:30 +0300
+Subject: [PATCH] Remove Gdk-dependency from gtk-encode-symbolic-svg
+
+Building gtk-encode-symbolic-svg without building Gdk is useful
+as only the icon tools are needed on the native build: this makes
+native build much faster and requires much less dependencies.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gtk/encodesymbolic.c | 36 ++++++++++--------------------------
+ 1 file changed, 10 insertions(+), 26 deletions(-)
+
+diff --git a/gtk/encodesymbolic.c b/gtk/encodesymbolic.c
+index 9f7d015..1f07563 100644
+--- a/gtk/encodesymbolic.c
++++ b/gtk/encodesymbolic.c
+@@ -19,7 +19,6 @@
+
+ #include <glib.h>
+ #include <gdk-pixbuf/gdk-pixdata.h>
+-#include <gdk/gdk.h>
+ #include <glib/gi18n.h>
+
+ #ifdef HAVE_UNISTD_H
+@@ -43,30 +42,18 @@ static GdkPixbuf *
+ load_symbolic_svg (char *file_data, gsize file_len,
+ int width,
+ int height,
+- const GdkRGBA *fg,
+- const GdkRGBA *success_color,
+- const GdkRGBA *warning_color,
+- const GdkRGBA *error_color,
++ const char *css_fg,
++ const char *css_success,
++ const char *css_warning,
++ const char *css_error,
+ GError **error)
+ {
+ GInputStream *stream;
+ GdkPixbuf *pixbuf;
+- gchar *css_fg;
+- gchar *css_success;
+- gchar *css_warning;
+- gchar *css_error;
+ gchar *data;
+ gchar *svg_width, *svg_height;
+ gchar *escaped_file_data;
+
+- css_fg = gdk_rgba_to_string (fg);
+-
+- css_success = css_warning = css_error = NULL;
+-
+- css_warning = gdk_rgba_to_string (warning_color);
+- css_error = gdk_rgba_to_string (error_color);
+- css_success = gdk_rgba_to_string (success_color);
+-
+ /* Fetch size from the original icon */
+ stream = g_memory_input_stream_new_from_data (file_data, file_len, NULL);
+ pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
+@@ -105,10 +92,6 @@ load_symbolic_svg (char *file_data, gsize file_len,
+ "</svg>",
+ NULL);
+ g_free (escaped_file_data);
+- g_free (css_fg);
+- g_free (css_warning);
+- g_free (css_error);
+- g_free (css_success);
+ g_free (svg_width);
+ g_free (svg_height);
+
+@@ -167,7 +150,8 @@ make_symbolic_pixbuf (char *file,
+ GError **error)
+
+ {
+- GdkRGBA r = { 1,0,0,1}, g = {0,1,0,1};
++ const char r[] = "rgba(255,0,0,1)";
++ const char g[] = "rgba(0,255,0,1)";
+ GdkPixbuf *loaded;
+ GdkPixbuf *pixbuf;
+ int plane;
+@@ -196,10 +180,10 @@ make_symbolic_pixbuf (char *file,
+ * the "rest", as all color fractions should add up to 1.
+ */
+ loaded = load_symbolic_svg (file_data, file_len, width, height,
+- &g,
+- plane == 0 ? &r : &g,
+- plane == 1 ? &r : &g,
+- plane == 2 ? &r : &g,
++ g,
++ plane == 0 ? r : g,
++ plane == 1 ? r : g,
++ plane == 2 ? r : g,
+ error);
+ if (loaded == NULL)
+ return NULL;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-error-out-if-xsltproc-is-not-found.patch b/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-error-out-if-xsltproc-is-not-found.patch
new file mode 100644
index 000000000..99ae4d441
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-error-out-if-xsltproc-is-not-found.patch
@@ -0,0 +1,31 @@
+From 8b7fbbb405959f2868ad6eadd7dd00018758a8a5 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 7 Sep 2016 14:52:04 +0300
+Subject: [PATCH] Do not error out if xsltproc is not found.
+
+This allows us to drop the hard xsltproc dependency, if we're not
+going to actually run the gtkdoc scripts (when api documentation is
+disabled).
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b0c88d7..2a61d6e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,7 @@ dnl Check for xsltproc
+ dnl
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ if test -z "$XSLTPROC"; then
+- AC_MSG_ERROR([xsltproc not found])
++ AC_MSG_WARN([xsltproc not found])
+ fi
+
+ dnl
+--
+2.9.3
+
diff --git a/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch b/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch
new file mode 100644
index 000000000..2fe3ab922
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/files/0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch
@@ -0,0 +1,142 @@
+From 928102874bc2339a1d57c6b178877e0c6002cb3a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 31 Aug 2016 16:44:46 +0300
+Subject: [PATCH 1/3] Do not hardocode paths to perl/python in scripts.
+
+Doing so when the interpreters are somewhere deep in a sysroot directory
+can reach the shebang line limit, and resulting scripts wouldn't work
+on targets either.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ gtkdoc-check.in | 2 +-
+ gtkdoc-depscan.in | 2 +-
+ gtkdoc-fixxref.in | 2 +-
+ gtkdoc-mkdb.in | 2 +-
+ gtkdoc-mkhtml.in | 2 +-
+ gtkdoc-mkman.in | 2 +-
+ gtkdoc-mkpdf.in | 2 +-
+ gtkdoc-rebase.in | 2 +-
+ gtkdoc-scan.in | 2 +-
+ gtkdoc-scangobj.in | 2 +-
+ tests/tools.sh.in | 2 +-
+ 11 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/gtkdoc-check.in b/gtkdoc-check.in
+index 8c8e917..f6a25f6 100755
+--- a/gtkdoc-check.in
++++ b/gtkdoc-check.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python; coding: utf-8 -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-depscan.in b/gtkdoc-depscan.in
+index 9bfaf30..aadc952 100644
+--- a/gtkdoc-depscan.in
++++ b/gtkdoc-depscan.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+
+ from __future__ import print_function
+
+diff --git a/gtkdoc-fixxref.in b/gtkdoc-fixxref.in
+index 0ea02d4..bdd443a 100755
+--- a/gtkdoc-fixxref.in
++++ b/gtkdoc-fixxref.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
+index 42d5731..3a56d56 100755
+--- a/gtkdoc-mkdb.in
++++ b/gtkdoc-mkdb.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python; coding: utf-8 -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-mkhtml.in b/gtkdoc-mkhtml.in
+index 0d0a15d..914ff55 100644
+--- a/gtkdoc-mkhtml.in
++++ b/gtkdoc-mkhtml.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python; coding: utf-8 -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-mkman.in b/gtkdoc-mkman.in
+index c5445cd..65db71a 100644
+--- a/gtkdoc-mkman.in
++++ b/gtkdoc-mkman.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python; coding: utf-8 -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-mkpdf.in b/gtkdoc-mkpdf.in
+index e8c0c03..f807236 100755
+--- a/gtkdoc-mkpdf.in
++++ b/gtkdoc-mkpdf.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python; coding: utf-8 -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-rebase.in b/gtkdoc-rebase.in
+index 17a71c2..ec3fd28 100755
+--- a/gtkdoc-rebase.in
++++ b/gtkdoc-rebase.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
+index 954c811..f461504 100755
+--- a/gtkdoc-scan.in
++++ b/gtkdoc-scan.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/gtkdoc-scangobj.in b/gtkdoc-scangobj.in
+index 4cbe130..52c2c24 100644
+--- a/gtkdoc-scangobj.in
++++ b/gtkdoc-scangobj.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python3
+ # -*- python -*-
+ #
+ # gtk-doc - GTK DocBook documentation generator.
+diff --git a/tests/tools.sh.in b/tests/tools.sh.in
+index 4d301d0..565fc1e 100644
+--- a/tests/tools.sh.in
++++ b/tests/tools.sh.in
+@@ -31,7 +31,7 @@ done
+ # TODO: test python 2 and 3 (python3 -mcompileall gtkdoc/*.py)
+ for file in gtkdoc-check gtkdoc-depscan gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mkhtml gtkdoc-mkman gtkdoc-mkpdf gtkdoc-rebase gtkdoc-scangobj; do
+ fullfile=`which $file`
+- @PYTHON@ -m py_compile $fullfile
++ python3 -m py_compile $fullfile
+ if test $? != 0 ; then failed=`expr $failed + 1`; fi
+ tested=`expr $tested + 1`
+ done
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gtk-doc/files/conditionaltests.patch b/poky/meta/recipes-gnome/gtk-doc/files/conditionaltests.patch
new file mode 100644
index 000000000..21c2db782
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/files/conditionaltests.patch
@@ -0,0 +1,46 @@
+From 78bbf185934147a69ceb4b617d424e12e70997bf Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Tue, 27 Jun 2017 21:00:58 +0100
+Subject: [PATCH 3/3] gtk-doc: Handle floating gtk-doc dependency
+
+Allow the tests to be explicitly disabled to avoid floating dependnecy
+issues. This is not really an issue with RSS but is on previous releases.
+
+RP 2017/6/27
+Upstream-Status: Pending
+
+---
+ configure.ac | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 684e2d1..e5e3aab 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -146,6 +146,11 @@ if test "x$GCC" = "xyes"; then
+ fi
+ fi
+
++AC_ARG_ENABLE([tests],
++ AS_HELP_STRING([--enable-tests],
++ [enable tests (default=yes)]),,
++ [enable_tests="yes"])
++
+ dnl if glib is available we can enable the tests
+ PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
+ [ glib_prefix="`$PKG_CONFIG --variable=prefix glib-2.0`"
+@@ -156,6 +161,11 @@ PKG_CHECK_MODULES(TEST_DEPS, [glib-2.0 >= 2.6.0 gobject-2.0 >= 2.6.0],
+ build_tests="no"
+ ]
+ )
++if test "x$enable_tests" != "xyes"; then
++ gtk_doc_use_libtool="no"
++ build_tests="no"
++fi
++
+ AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL" -a x$gtk_doc_use_libtool = xyes )
+ dnl this enables the rule in test/Makefile.am
+ AM_CONDITIONAL(BUILD_TESTS, test x$build_tests = xyes)
+--
+2.14.1
+
diff --git a/poky/meta/recipes-gnome/gtk-doc/files/no-clobber.patch b/poky/meta/recipes-gnome/gtk-doc/files/no-clobber.patch
new file mode 100644
index 000000000..0fa22b209
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/files/no-clobber.patch
@@ -0,0 +1,27 @@
+In out-of-tree builds gtk-doc's setup-build target copies all the content from $srcdir to $builddir.
+
+However, if some of this content is regenerated at configure time this can happen:
+
+1) configure writes new build/version.xml
+2) make compile copies content, including the tarball's src/version.xml
+ to build/version.xml, and generates gtk-doc.
+3) make install notices build/version.xml is older than configure.status,
+ so regenerates gtk-doc.
+
+gtk-doc generation is a slow process at the best of times, so doing it twice isn't good.
+
+Solve this by changing cp --force to cp --no-clobber, so setup-build only copies
+files which don't already exist.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=794571]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/gtk-doc.make b/gtk-doc.make
+index f87eaab..246f3c0 100644
+--- a/gtk-doc.make
++++ b/gtk-doc.make
+@@ -113,3 +113,3 @@ setup-build.stamp:
+ test -f $(abs_srcdir)/$$file && \
+- cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
++ cp -pn $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
+ done; \
diff --git a/poky/meta/recipes-gnome/gtk-doc/files/pkg-config-native.patch b/poky/meta/recipes-gnome/gtk-doc/files/pkg-config-native.patch
new file mode 100644
index 000000000..bfbc777ff
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/files/pkg-config-native.patch
@@ -0,0 +1,42 @@
+From 5f145621b4780cfd6a5632fcc97c45f572938efc Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 5 Sep 2016 22:25:44 +0100
+Subject: [PATCH 5/5] Use native pkg-config when looking for gtk-doc.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ gtk-doc.m4 | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+Index: gtk-doc-1.27/gtk-doc.m4
+===================================================================
+--- gtk-doc-1.27.orig/gtk-doc.m4
++++ gtk-doc-1.27/gtk-doc.m4
+@@ -25,7 +25,7 @@
+ # Macro appear in them. The GNU General Public License (GPL) does govern
+ # all other use of the material that constitutes the Autoconf Macro.
+
+-# serial 2
++# serial 2.1
+
+ dnl Usage:
+ dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
+@@ -35,11 +35,16 @@ AC_DEFUN([GTK_DOC_CHECK],
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+
++ gtkdoc_pkgconfig_save=$PKG_CONFIG
++ PKG_CONFIG=pkg-config-native
++
+ ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
+ AC_MSG_CHECKING([for gtk-doc])
+ PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
+ AC_MSG_RESULT($have_gtk_doc)
+
++ PKG_CONFIG=$gtkdoc_pkgconfig_save
++
+ if test "$have_gtk_doc" = "no"; then
+ AC_MSG_WARN([
+ You will not be able to create source packages with 'make dist'
diff --git a/poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.27.bb b/poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.27.bb
new file mode 100644
index 000000000..45528111c
--- /dev/null
+++ b/poky/meta/recipes-gnome/gtk-doc/gtk-doc_1.27.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Documentation generator for glib-based software"
+DESCRIPTION = "Gtk-doc is a set of scripts that extract specially formatted comments \
+ from glib-based software and produce a set of html documentation files from them"
+HOMEPAGE = "http://www.gtk.org/gtk-doc/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+inherit gnomebase
+
+# Configure the scripts correctly (and build their dependencies) only if they are actually
+# going to be used; otheriwse we need only the m4/makefile includes from the gtk-doc tarball.
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "api-documentation", "working-scripts", "", d)}"
+
+# This will cause target gtk-doc to hardcode paths of native dependencies
+# into its scripts. This means that target gtk-doc package is broken;
+# hopefully no one minds because its scripts are not used for anything during build
+# and shouldn't be used on targets.
+PACKAGECONFIG[working-scripts] = "--with-highlight=source-highlight,--with-highlight=no,libxslt-native xmlto-native source-highlight-native python3-six"
+PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,glib-2.0"
+
+SRC_URI[archive.md5sum] = "b29949e0964762e474b706ce22171602"
+SRC_URI[archive.sha256sum] = "e26bd3f7080c749b1cb66c46c6bf8239e2f320a949964fb9c6d56e1b0c6d9a6f"
+SRC_URI += "file://0001-Do-not-hardocode-paths-to-perl-python-in-scripts.patch \
+ file://0001-Do-not-error-out-if-xsltproc-is-not-found.patch \
+ file://conditionaltests.patch \
+ file://no-clobber.patch \
+ "
+SRC_URI_append_class-native = " file://pkg-config-native.patch"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Do not check for XML catalogs when building because that
+# information is not used for anything during build. Recipe
+# dependencies make sure we have all the right bits.
+do_configure_prepend() {
+ sed -i -e 's,^JH_CHECK_XML_CATALOG.*,,' ${S}/configure.ac
+}
+
+FILES_${PN} += "${datadir}/sgml"
+FILES_${PN}-dev += "${libdir}/cmake"
+FILES_${PN}-doc = ""
+
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " gtkdoc_makefiles_sysroot_preprocess"
+gtkdoc_makefiles_sysroot_preprocess() {
+ # Patch the gtk-doc makefiles so that the qemu wrapper is used to run transient binaries
+ # instead of libtool wrapper or running them directly
+ sed -i \
+ -e "s|GTKDOC_RUN =.*|GTKDOC_RUN = \$(top_builddir)/gtkdoc-qemuwrapper|" \
+ ${SYSROOT_DESTDIR}${datadir}/gtk-doc/data/gtk-doc*make
+}
diff --git a/poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.17.bb b/poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.17.bb
new file mode 100644
index 000000000..7064b1942
--- /dev/null
+++ b/poky/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.17.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Default icon theme that all icon themes automatically inherit from"
+HOMEPAGE = "http://icon-theme.freedesktop.org/wiki/HicolorTheme"
+BUGTRACKER = "https://bugs.freedesktop.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f08a446809913fc9b3c718f0eaea0426"
+
+SRC_URI = "http://icon-theme.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "84eec8d6f810240a069c731f1870b474"
+SRC_URI[sha256sum] = "317484352271d18cbbcfac3868eab798d67fff1b8402e740baa6ff41d588a9d8"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/icons"
diff --git a/poky/meta/recipes-gnome/json-glib/json-glib_1.4.2.bb b/poky/meta/recipes-gnome/json-glib/json-glib_1.4.2.bb
new file mode 100644
index 000000000..19fe3cc44
--- /dev/null
+++ b/poky/meta/recipes-gnome/json-glib/json-glib_1.4.2.bb
@@ -0,0 +1,40 @@
+SUMMARY = "JSON-GLib implements a full JSON parser using GLib and GObject"
+DESCRIPTION = "Use JSON-GLib it is possible to parse and generate valid JSON\
+ data structures, using a DOM-like API. JSON-GLib also offers GObject \
+integration, providing the ability to serialize and deserialize GObject \
+instances to and from JSON data types."
+HOMEPAGE = "http://live.gnome.org/JsonGlib"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI[archive.md5sum] = "35107e23a7bbbc70f31c34f7b9adf1c3"
+SRC_URI[archive.sha256sum] = "2d7709a44749c7318599a6829322e081915bdc73f5be5045882ed120bb686dc8"
+
+GNOMEBASEBUILDCLASS = "meson"
+inherit gnomebase lib_package gobject-introspection gtk-doc gettext
+
+# This builds both API docs (via gtk-doc) and manpages
+GTKDOC_ENABLE_FLAG = "-Ddocs=true"
+GTKDOC_DISABLE_FLAG = "-Ddocs=false"
+
+GI_ENABLE_FLAG = "-Dintrospection=true"
+GI_DISABLE_FLAG = "-Dintrospection=false"
+
+EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GTKDOC_ENABLED', 'True', '${GTKDOC_ENABLE_FLAG}', \
+ '${GTKDOC_DISABLE_FLAG}', d)} "
+EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '${GI_ENABLE_FLAG}', \
+ '${GI_DISABLE_FLAG}', d)} "
+
+do_install_append() {
+ # FIXME: these need to be provided via ptest
+ rm -rf ${D}${datadir}/installed-tests ${D}${libexecdir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Currently it's not possible to disable gettext in Meson, so we need to force
+# this back on.
+USE_NLS_class-native = "yes"
diff --git a/poky/meta/recipes-gnome/libgudev/libgudev_232.bb b/poky/meta/recipes-gnome/libgudev/libgudev_232.bb
new file mode 100644
index 000000000..19fe962e4
--- /dev/null
+++ b/poky/meta/recipes-gnome/libgudev/libgudev_232.bb
@@ -0,0 +1,18 @@
+SUMMARY = "GObject wrapper for libudev"
+HOMEPAGE = "https://wiki.gnome.org/Projects/libgudev"
+SRC_URI[archive.sha256sum] = "ee4cb2b9c573cdf354f6ed744f01b111d4b5bed3503ffa956cefff50489c7860"
+SRC_URI[archive.md5sum] = "6914852377156665567abf8a38d89236"
+
+DEPENDS = "glib-2.0 udev"
+
+EXTRA_OECONF = "--disable-umockdev"
+
+RCONFLICTS_${PN} = "systemd (<= 220)"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit gnomebase gobject-introspection gtk-doc
+
+UPSTREAM_CHECK_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgudev/"
+UPSTREAM_CHECK_REGEX = "(?P<pver>(\d+))"
diff --git a/poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb b/poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb
new file mode 100644
index 000000000..6c299bc17
--- /dev/null
+++ b/poky/meta/recipes-gnome/libnotify/libnotify_0.7.7.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Library for sending desktop notifications to a notification daemon"
+HOMEPAGE = "http://www.gnome.org"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+DEPENDS = "dbus gtk+3 dbus-glib"
+
+inherit gnomebase gtk-doc distro_features_check gobject-introspection
+# depends on gtk+3
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+SRC_URI[archive.md5sum] = "e9d911f6a22435e0b922f2fe71212b59"
+SRC_URI[archive.sha256sum] = "9cb4ce315b2655860c524d46b56010874214ec27e854086c1a1d0260137efc04"
+
+# there were times, we had two versions of libnotify (oe-core libnotify:0.6.x /
+# meta-gnome libnotify3: 0.7.x)
+PROVIDES += "libnotify3"
+RPROVIDES_${PN} += "libnotify3"
+RCONFLICTS_${PN} += "libnotify3"
+RREPLACES_${PN} += "libnotify3"
diff --git a/poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch b/poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
new file mode 100644
index 000000000..6c23071cd
--- /dev/null
+++ b/poky/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
@@ -0,0 +1,60 @@
+From 4e0ce3f22d45033a108cbacca3e5ec6728bd44f3 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 11 Aug 2015 16:25:38 +0300
+Subject: [PATCH] configure: add option to enable/disable use of GTK+
+
+Distro packagers like predictability and automatically detected optional
+dependencies are not predicable. Add a --with-gtk3 option (default to "auto")
+for forcibly controlling whether GTK+ will be used or not.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=712693]
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e61a952..c3aae84 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -130,17 +130,22 @@ AC_CHECK_FUNCS(strtok_r)
+ # GTK
+ # ===========================================================================
+
+-PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
+-
+ GTK3_BINARY_VERSION=
+
+-if test "$have_gtk_3" = "yes"; then
+- GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
++AC_MSG_CHECKING([whether to use GTK+ 3])
++AC_ARG_WITH([gtk3],
++ [AS_HELP_STRING([--without-gtk3],[Don't build GTK+3 tools (default=auto)])],
++ [],[PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_REQUIRED],[with_gtk3=yes],[with_gtk3=no])])
++AC_MSG_RESULT([$with_gtk3])
++
++if test "$with_gtk3" = "yes"; then
++ PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= $GTK3_REQUIRED])
++ GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
+ fi
+
+ AC_SUBST([GTK3_BINARY_VERSION])
+
+-AM_CONDITIONAL([HAVE_GTK_3],[test "$have_gtk_3" = "yes"])
++AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk3" = "yes"])
+
+ dnl ===========================================================================
+ dnl GDK-Pixbuf SVG loader
+@@ -298,6 +303,6 @@ librsvg-$VERSION
+ Build introspectable bindings: ${found_introspection}
+ Build Vala bindings: ${enable_vala}
+ Build GdkPixbuf loader: ${enable_pixbuf_loader}
+- GTK+ $GTK3_REQUIRED or later: ${have_gtk_3}
++ GTK+ $GTK3_REQUIRED or later: ${with_gtk_3}
+ Build miscellaneous tools: ${build_misc_tools}
+ "
+--
+2.1.4
+
diff --git a/poky/meta/recipes-gnome/librsvg/librsvg_2.40.20.bb b/poky/meta/recipes-gnome/librsvg/librsvg_2.40.20.bb
new file mode 100644
index 000000000..e376d52ef
--- /dev/null
+++ b/poky/meta/recipes-gnome/librsvg/librsvg_2.40.20.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Library for rendering SVG files"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/librsvg/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+RECIPE_NO_UPDATE_REASON = "Versions from 2.41.0 requires Rust compiler to build it"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6"
+
+SECTION = "x11/utils"
+DEPENDS = "cairo gdk-pixbuf glib-2.0 libcroco libxml2 pango"
+BBCLASSEXTEND = "native"
+
+inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection
+
+SRC_URI += "file://gtk-option.patch"
+
+SRC_URI[archive.md5sum] = "4949d313b0c5d9161a5c259104af5568"
+SRC_URI[archive.sha256sum] = "cff4dd3c3b78bfe99d8fcfad3b8ba1eee3289a0823c0e118d78106be6b84c92b"
+
+CACHED_CONFIGUREVARS = "ac_cv_path_GDK_PIXBUF_QUERYLOADERS=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
+
+# The older ld (2.22) on the host (Centos 6.5) doesn't have the
+# -Bsymbolic-functions option, we can disable it for native.
+EXTRA_OECONF_append_class-native = " --enable-Bsymbolic=auto"
+
+PACKAGECONFIG ??= "gdkpixbuf"
+# The gdk-pixbuf loader
+PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader,gdk-pixbuf-native"
+# GTK+ test application (rsvg-view)
+PACKAGECONFIG[gtk] = "--with-gtk3,--without-gtk3,gtk+3"
+
+do_install_append() {
+ # Loadable modules don't need .a or .la on Linux
+ rm -f ${D}${libdir}/gdk-pixbuf-2.0/*/loaders/*.a ${D}${libdir}/gdk-pixbuf-2.0/*/loaders/*.la
+}
+
+PACKAGES =+ "librsvg-gtk rsvg"
+FILES_rsvg = "${bindir}/rsvg* \
+ ${datadir}/pixmaps/svg-viewer.svg \
+ ${datadir}/themes"
+FILES_librsvg-gtk = "${libdir}/gdk-pixbuf-2.0/*/*/*.so \
+ ${datadir}/thumbnailers/librsvg.thumbnailer"
+RRECOMMENDS_librsvg-gtk = "gdk-pixbuf-bin"
+
+PIXBUF_PACKAGES = "librsvg-gtk"
diff --git a/poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb b/poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb
new file mode 100644
index 000000000..2b917ec51
--- /dev/null
+++ b/poky/meta/recipes-gnome/libsecret/libsecret_0.18.5.bb
@@ -0,0 +1,20 @@
+SUMMARY = "libsecret is a library for storing and retrieving passwords and other secrets"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
+
+inherit gnomebase gtk-doc vala gobject-introspection manpages
+
+DEPENDS += "glib-2.0 libgcrypt gettext-native intltool-native"
+
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
+
+SRC_URI[archive.md5sum] = "2d688825921313da8731313b0a7f394c"
+SRC_URI[archive.sha256sum] = "9ce7bd8dd5831f2786c935d82638ac428fa085057cc6780aba0e39375887ccb3"
+
+# http://errors.yoctoproject.org/Errors/Details/20228/
+ARM_INSTRUCTION_SET = "arm"
+
+# vapigen.m4 bundled with the tarball does not yet have our cross-compilation fixes
+do_configure_prepend() {
+ rm -f ${S}/build/m4/vapigen.m4
+}
diff --git a/poky/meta/recipes-graphics/builder/builder_0.1.bb b/poky/meta/recipes-graphics/builder/builder_0.1.bb
new file mode 100644
index 000000000..0a64c31ab
--- /dev/null
+++ b/poky/meta/recipes-graphics/builder/builder_0.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "New user to do specific job"
+DESCRIPTION = "This recipe create a new user named ${PN}, who is used for specific jobs like building. The task can be auto started via mini X"
+SECTION = "x11"
+PR = "r6"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://builder_session.sh;endline=5;md5=84796c3c41785d86100fdabcbdade00e"
+
+SRC_URI = "file://builder_session.sh \
+ "
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "mini-x-session"
+
+inherit useradd
+
+# builder user password is "builder"
+BUILDER_PASSWORD ?= ".gLibiNXn0P12"
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --create-home \
+ --groups video,tty,audio \
+ --password ${BUILDER_PASSWORD} \
+ --user-group builder"
+
+do_install () {
+ install -d -m 755 ${D}${sysconfdir}/mini_x/session.d
+ install -p -m 755 builder_session.sh ${D}${sysconfdir}/mini_x/session.d/
+
+ chown builder.builder ${D}${sysconfdir}/mini_x/session.d/builder_session.sh
+}
+
diff --git a/poky/meta/recipes-graphics/builder/files/builder_session.sh b/poky/meta/recipes-graphics/builder/files/builder_session.sh
new file mode 100644
index 000000000..4e509a701
--- /dev/null
+++ b/poky/meta/recipes-graphics/builder/files/builder_session.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#This script will be called via mini X session on behalf of file owner, after
+#installed in /etc/mini_x/session.d/. Any auto start jobs including X apps can
+#be put here
+
+# start hob here
+export PSEUDO_PREFIX=/usr
+export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo
+export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64
+export GIT_PROXY_COMMAND=/home/builder/poky/scripts/oe-git-proxy
+
+#start pcmanfm in daemon mode to allow asynchronous launch
+pcmanfm -d&
+
+#register handlers for some file types
+if [ ! -d /home/builder/.local/share/applications ]; then
+ mkdir -p /home/builder/.local/share/applications/
+ #register folders to open with PCManFM filemanager
+ xdg-mime default pcmanfm.desktop inode/directory
+
+ #register html links and files with epiphany
+ xdg-mime default epiphany.desktop x-scheme-handler/http
+ xdg-mime default epiphany.desktop x-scheme-handler/https
+ xdg-mime default epiphany.desktop text/html
+
+ #register text files with l3afpad text editor
+ xdg-mime default l3afpad.desktop text/plain
+fi
+
+cd /home/builder/poky
+. ./oe-init-build-env
+
+matchbox-terminal&
diff --git a/poky/meta/recipes-graphics/cairo/cairo-fpu.inc b/poky/meta/recipes-graphics/cairo/cairo-fpu.inc
new file mode 100644
index 000000000..fe7c53337
--- /dev/null
+++ b/poky/meta/recipes-graphics/cairo/cairo-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_cairo_fpu_setting(bb, d):
+ if d.getVar('TARGET_FPU') in [ 'soft' ]:
+ return "--disable-some-floating-point"
+ return ""
+
diff --git a/poky/meta/recipes-graphics/cairo/cairo.inc b/poky/meta/recipes-graphics/cairo/cairo.inc
new file mode 100644
index 000000000..20e0d2c92
--- /dev/null
+++ b/poky/meta/recipes-graphics/cairo/cairo.inc
@@ -0,0 +1,48 @@
+SUMMARY = "The Cairo 2D vector graphics library"
+DESCRIPTION = "Cairo is a multi-platform library providing anti-aliased \
+vector-based rendering for multiple target backends. Paths consist \
+of line segments and cubic splines and can be rendered at any width \
+with various join and cap styles. All colors may be specified with \
+optional translucence (opacity/alpha) and combined using the \
+extended Porter/Duff compositing algebra as found in the X Render \
+Extension."
+HOMEPAGE = "http://cairographics.org"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "libs"
+
+LICENSE = "MPL-1 & LGPLv2.1 & GPLv3+"
+LICENSE_${PN} = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-dev = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-doc = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-gobject = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-script-interpreter = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-perf-utils = "GPLv3+"
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
+DEPENDS = "libpng fontconfig pixman glib-2.0 zlib"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'directfb', d)}"
+
+PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no --disable-xlib,${X11DEPENDS}"
+PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
+PACKAGECONFIG[directfb] = "--enable-directfb=yes,,directfb"
+PACKAGECONFIG[valgrind] = "--enable-valgrind=yes,--disable-valgrind,valgrind"
+PACKAGECONFIG[egl] = "--enable-egl=yes,--disable-egl,virtual/egl"
+PACKAGECONFIG[glesv2] = "--enable-glesv2,--disable-glesv2,virtual/libgles2"
+PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
+
+#check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points
+require cairo-fpu.inc
+EXTRA_OECONF += "${@get_cairo_fpu_setting(bb, d)} \
+ --enable-tee \
+ "
+
+inherit autotools pkgconfig upstream-version-is-even gtk-doc
+
+# We don't depend on binutils so we need to disable this
+export ac_cv_lib_bfd_bfd_openr="no"
+# Ensure we don't depend on LZO
+export ac_cv_lib_lzo2_lzo2a_decompress="no"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/cairo/cairo/0001-cairo-Fix-CVE-2017-9814.patch b/poky/meta/recipes-graphics/cairo/cairo/0001-cairo-Fix-CVE-2017-9814.patch
new file mode 100644
index 000000000..7d02ab947
--- /dev/null
+++ b/poky/meta/recipes-graphics/cairo/cairo/0001-cairo-Fix-CVE-2017-9814.patch
@@ -0,0 +1,45 @@
+From 042421e9e3d266ad0bb7805132041ef51ad3234d Mon Sep 17 00:00:00 2001
+From: Adrian Johnson <ajohnson@redneon.com>
+Date: Wed, 16 Aug 2017 22:52:35 -0400
+Subject: [PATCH] cairo: Fix CVE-2017-9814
+
+The bug happens because in some scenarios the variable size can
+have a value of 0 at line 1288. And malloc(0) is not returning
+NULL as some people could expect:
+
+ https://stackoverflow.com/questions/1073157/zero-size-malloc
+
+malloc(0) returns the smallest chunk possible. So the line 1290
+with the return is not execute. And the execution continues with
+an invalid map.
+
+Since the size is 0 the variable map is not initialized correctly
+at load_trutype_table. So, later when the variable map is accessed
+previous values from a freed chunk are used. This could allows an
+attacker to control the variable map.
+
+This patch have not merge in upstream now.
+
+Upstream-Status: Backport [https://bugs.freedesktop.org/show_bug.cgi?id=101547]
+CVE: CVE-2017-9814
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ src/cairo-truetype-subset.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
+index e3449a0..f77d11c 100644
+--- a/src/cairo-truetype-subset.c
++++ b/src/cairo-truetype-subset.c
+@@ -1285,7 +1285,7 @@ _cairo_truetype_reverse_cmap (cairo_scaled_font_t *scaled_font,
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+
+ size = be16_to_cpu (map->length);
+- map = malloc (size);
++ map = _cairo_malloc (size);
+ if (unlikely (map == NULL))
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+
+--
+2.8.1
+
diff --git a/poky/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff b/poky/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
new file mode 100644
index 000000000..7aaad2eed
--- /dev/null
+++ b/poky/meta/recipes-graphics/cairo/cairo/cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff
@@ -0,0 +1,22 @@
+Cairo: Fix Denial-of-Service Attack due to Logical Problem in Program
+
+https://bugs.freedesktop.org/show_bug.cgi?id=100763
+
+CVE: CVE-2017-7475
+Upstream-Status: Submitted
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+Index: cairo-1.15.4/src/cairo-ft-font.c
+===================================================================
+--- cairo-1.15.4.orig/src/cairo-ft-font.c
++++ cairo-1.15.4/src/cairo-ft-font.c
+@@ -1149,7 +1149,7 @@ _get_bitmap_surface (FT_Bitmap *bi
+ width = bitmap->width;
+ height = bitmap->rows;
+
+- if (width == 0 || height == 0) {
++ if (width == 0 || height == 0 || bitmap->buffer == NULL) {
+ *surface = (cairo_image_surface_t *)
+ cairo_image_surface_create_for_data (NULL, format, 0, 0, 0);
+ return (*surface)->base.status;
diff --git a/poky/meta/recipes-graphics/cairo/cairo_1.14.12.bb b/poky/meta/recipes-graphics/cairo/cairo_1.14.12.bb
new file mode 100644
index 000000000..075ca1ed3
--- /dev/null
+++ b/poky/meta/recipes-graphics/cairo/cairo_1.14.12.bb
@@ -0,0 +1,46 @@
+require cairo.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77"
+
+SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz \
+ file://cairo-get_bitmap_surface-bsc1036789-CVE-2017-7475.diff \
+ file://0001-cairo-Fix-CVE-2017-9814.patch \
+ "
+
+SRC_URI[md5sum] = "9f0db9dbfca0966be8acd682e636d165"
+SRC_URI[sha256sum] = "8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16"
+
+PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
+
+SUMMARY_${PN} = "The Cairo 2D vector graphics library"
+DESCRIPTION_${PN} = "Cairo is a multi-platform library providing anti-aliased \
+vector-based rendering for multiple target backends. Paths consist \
+of line segments and cubic splines and can be rendered at any width \
+with various join and cap styles. All colors may be specified with \
+optional translucence (opacity/alpha) and combined using the \
+extended Porter/Duff compositing algebra as found in the X Render \
+Extension."
+
+SUMMARY_cairo-gobject = "The Cairo library GObject wrapper library"
+DESCRIPTION_cairo-gobject = "A GObject wrapper library for the Cairo API."
+
+SUMMARY_cairo-script-interpreter = "The Cairo library script interpreter"
+DESCRIPTION_cairo-script-interpreter = "The Cairo script interpreter implements \
+CairoScript. CairoScript is used by tracing utilities to enable the ability \
+to replay rendering."
+
+DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities"
+
+FILES_${PN} = "${libdir}/libcairo.so.*"
+FILES_${PN}-dev += "${libdir}/cairo/*.so"
+FILES_${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
+FILES_${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
+FILES_${PN}-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
+
+do_install_append () {
+ rm -rf ${D}${bindir}/cairo-sphinx
+ rm -rf ${D}${libdir}/cairo/cairo-fdr*
+ rm -rf ${D}${libdir}/cairo/cairo-sphinx*
+ rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
+ rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
+}
diff --git a/poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb b/poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
new file mode 100644
index 000000000..c71ab1165
--- /dev/null
+++ b/poky/meta/recipes-graphics/cantarell-fonts/cantarell-fonts_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Cantarell, a Humanist sans-serif font family"
+
+DESCRIPTION = "The Cantarell font typeface is designed as a \
+ contemporary Humanist sans serif, and was developed for \
+ on-screen reading; in particular, reading web pages on an \
+ HTC Dream mobile phone."
+
+HOMEPAGE = "https://git.gnome.org/browse/cantarell-fonts/"
+SECTION = "fonts"
+LICENSE = "OFL-1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=df91e3ffcab8cfb972a66bf11255188d"
+
+PV = "0.0.24"
+
+SRCREV = "07b6ea2cbbebfc360aa4668612a376be5e214eaa"
+SRC_URI = "git://git.gnome.org/cantarell-fonts;protocol=git;branch=master"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(?!0\.13)(?!0\.10\.1)\d+\.\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit autotools allarch fontcache pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[fontforge] = "--enable-source-rebuild=yes,--enable-source-rebuild=no,fontforge-native"
+FILES_${PN} = "${datadir}/fonts ${datadir}/fontconfig"
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0.inc b/poky/meta/recipes-graphics/clutter/clutter-1.0.inc
new file mode 100644
index 000000000..6dbbf4d80
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0.inc
@@ -0,0 +1,46 @@
+SUMMARY = "Graphics library for creating hardware-accelerated user interfaces"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2.1+"
+
+inherit clutter ptest-gnome distro_features_check upstream-version-is-even gobject-introspection
+# depends on cogl-1.0 which needs opengl
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+DEPENDS = "pango glib-2.0 json-glib atk udev cogl-1.0"
+PACKAGE_BEFORE_PN += "${PN}-examples"
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+EDEPENDS_X11 = "virtual/libx11 libxi libxfixes"
+EDEPENDS_GLX = "virtual/libgl"
+EDEPENDS_EGL = "virtual/egl"
+EDEPENDS_WAYLAND = "wayland libxkbcommon gdk-pixbuf"
+
+EDEPENDS_EVDEV = "libxkbcommon"
+ERDEPENDS_EVDEV = "xkeyboard-config"
+
+# Disable pretty much everything, override in platform specific set up
+EXTRA_OECONF += "--disable-quartz-backend \
+ --disable-win32-backend \
+ --disable-gdk-backend \
+ --disable-cex100-backend \
+ --disable-tslib-input \
+ "
+
+PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,${EDEPENDS_X11}"
+PACKAGECONFIG[glx] = ",,${EDEPENDS_X11} ${EDEPENDS_GLX}"
+PACKAGECONFIG[egl] = "--enable-egl-backend,--disable-egl-backend,${EDEPENDS_EGL}"
+PACKAGECONFIG[evdev] = "--enable-evdev-input,--disable-evdev-input,${EDEPENDS_EVDEV},${ERDEPENDS_EVDEV}"
+PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,${EDEPENDS_WAYLAND}"
+PACKAGECONFIG[wayland-compositor] = "--enable-wayland-compositor,--disable-wayland-compositor,wayland"
+
+# Default configuration, distros might want to override
+PACKAGECONFIG ??= "egl \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx x11', '', d)}"
+
+FILES_${PN}-examples = "${libdir}/clutter/examples"
+
+do_configure_prepend() {
+ # see https://bugzilla.gnome.org/show_bug.cgi?id=661128 for this
+ touch -t 200001010000 ${S}/po/clutter-1.0.pot
+}
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0/0001-Remove-clutter.types-as-it-is-build-configuration-sp.patch b/poky/meta/recipes-graphics/clutter/clutter-1.0/0001-Remove-clutter.types-as-it-is-build-configuration-sp.patch
new file mode 100644
index 000000000..7b3c1980b
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0/0001-Remove-clutter.types-as-it-is-build-configuration-sp.patch
@@ -0,0 +1,143 @@
+From 3a0404dfbc65c6a864e01d1200a48074e19d5def Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 2 Sep 2016 14:28:38 +0300
+Subject: [PATCH] Remove clutter.types as it is build configuration-specific.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ doc/reference/clutter.types | 122 --------------------------------------------
+ 1 file changed, 122 deletions(-)
+ delete mode 100644 doc/reference/clutter.types
+
+diff --git a/doc/reference/clutter.types b/doc/reference/clutter.types
+deleted file mode 100644
+index 0037acc..0000000
+--- a/doc/reference/clutter.types
++++ /dev/null
+@@ -1,122 +0,0 @@
+-cally_actor_get_type
+-cally_clone_get_type
+-cally_group_get_type
+-cally_rectangle_get_type
+-cally_root_get_type
+-cally_stage_get_type
+-cally_text_get_type
+-cally_texture_get_type
+-cally_util_get_type
+-clutter_action_get_type
+-clutter_actor_box_get_type
+-clutter_actor_get_type
+-clutter_actor_meta_get_type
+-clutter_align_constraint_get_type
+-clutter_alpha_get_type
+-clutter_animatable_get_type
+-clutter_animation_get_type
+-clutter_animator_get_type
+-clutter_animator_key_get_type
+-clutter_backend_get_type
+-clutter_behaviour_depth_get_type
+-clutter_behaviour_ellipse_get_type
+-clutter_behaviour_get_type
+-clutter_behaviour_opacity_get_type
+-clutter_behaviour_path_get_type
+-clutter_behaviour_rotate_get_type
+-clutter_behaviour_scale_get_type
+-clutter_bin_layout_get_type
+-clutter_bind_constraint_get_type
+-clutter_binding_pool_get_type
+-clutter_blur_effect_get_type
+-clutter_box_get_type
+-clutter_box_layout_get_type
+-clutter_brightness_contrast_effect_get_type
+-clutter_cairo_texture_get_type
+-clutter_canvas_get_type
+-clutter_child_meta_get_type
+-clutter_click_action_get_type
+-clutter_clip_node_get_type
+-clutter_clone_get_type
+-clutter_color_get_type
+-clutter_color_node_get_type
+-clutter_colorize_effect_get_type
+-clutter_constraint_get_type
+-clutter_container_get_type
+-clutter_content_get_type
+-clutter_deform_effect_get_type
+-clutter_desaturate_effect_get_type
+-clutter_device_manager_get_type
+-clutter_drag_action_get_type
+-clutter_drop_action_get_type
+-clutter_effect_get_type
+-clutter_event_get_type
+-clutter_event_sequence_get_type
+-clutter_fixed_layout_get_type
+-clutter_flow_layout_get_type
+-clutter_fog_get_type
+-clutter_geometry_get_type
+-clutter_gesture_action_get_type
+-clutter_glx_texture_pixmap_get_type
+-clutter_grid_layout_get_type
+-clutter_group_get_type
+-clutter_image_get_type
+-clutter_input_device_get_type
+-clutter_interval_get_type
+-clutter_keyframe_transition_get_type
+-clutter_knot_get_type
+-clutter_layout_manager_get_type
+-clutter_layout_meta_get_type
+-clutter_list_model_get_type
+-clutter_margin_get_type
+-clutter_media_get_type
+-clutter_model_get_type
+-clutter_model_iter_get_type
+-clutter_offscreen_effect_get_type
+-clutter_page_turn_effect_get_type
+-clutter_paint_node_get_type
+-clutter_paint_volume_get_type
+-clutter_pan_action_get_type
+-clutter_param_color_get_type
+-clutter_param_fixed_get_type
+-clutter_param_units_get_type
+-clutter_path_constraint_get_type
+-clutter_path_get_type
+-clutter_path_node_get_type
+-clutter_perspective_get_type
+-clutter_pipeline_node_get_type
+-clutter_point_get_type
+-clutter_property_transition_get_type
+-clutter_rect_get_type
+-clutter_rectangle_get_type
+-clutter_rotate_action_get_type
+-clutter_score_get_type
+-clutter_script_get_type
+-clutter_scriptable_get_type
+-clutter_scroll_actor_get_type
+-clutter_settings_get_type
+-clutter_shader_effect_get_type
+-clutter_shader_float_get_type
+-clutter_shader_get_type
+-clutter_shader_int_get_type
+-clutter_shader_matrix_get_type
+-clutter_size_get_type
+-clutter_snap_constraint_get_type
+-clutter_stage_get_type
+-clutter_stage_manager_get_type
+-clutter_state_get_type
+-clutter_state_key_get_type
+-clutter_swipe_action_get_type
+-clutter_table_layout_get_type
+-clutter_tap_action_get_type
+-clutter_text_buffer_get_type
+-clutter_text_get_type
+-clutter_text_node_get_type
+-clutter_texture_get_type
+-clutter_texture_node_get_type
+-clutter_timeline_get_type
+-clutter_transition_get_type
+-clutter_transition_group_get_type
+-clutter_units_get_type
+-clutter_vertex_get_type
+-clutter_zoom_action_get_type
+--
+2.9.3
+
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch b/poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
new file mode 100644
index 000000000..ce9ab3a24
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
@@ -0,0 +1,19 @@
+Install the examples to $libdir/clutter/.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Inappropriate
+
+Index: clutter-1.26.2/examples/Makefile.am
+===================================================================
+--- clutter-1.26.2.orig/examples/Makefile.am
++++ clutter-1.26.2/examples/Makefile.am
+@@ -33,7 +33,8 @@ AM_CPPFLAGS = \
+ -I$(top_srcdir)/clutter \
+ -I$(top_builddir)/clutter
+
+-noinst_PROGRAMS = $(all_examples)
++exampledir = $(pkglibdir)/examples
++example_PROGRAMS = $(all_examples)
+
+ EXTRA_DIST = redhand.png
+
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch b/poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch
new file mode 100644
index 000000000..f5c18c582
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch
@@ -0,0 +1,32 @@
+From 668e1d14af13249384ab324c7d79ec4147f07e48 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 27 Apr 2015 20:12:33 +0300
+Subject: [PATCH] Run installed tests with tap output
+
+Configure output from installed-tests to be TAP compliant such that
+gnome-desktop-testing-runner properly interprets the results.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tim Orling <TicoTimo@gmail.com>
+---
+ build/autotools/glib-tap.mk | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build/autotools/glib-tap.mk b/build/autotools/glib-tap.mk
+index 7c5f82b..844e17e 100644
+--- a/build/autotools/glib-tap.mk
++++ b/build/autotools/glib-tap.mk
+@@ -127,7 +127,8 @@ installed_test_meta_DATA = $(installed_testcases:=.test)
+ %.test: %$(EXEEXT) Makefile
+ $(AM_V_GEN) (echo '[Test]' > $@.tmp; \
+ echo 'Type=session' >> $@.tmp; \
+- echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$<' >> $@.tmp; \
++ echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$< --tap' >> $@.tmp; \
++ echo 'Output=TAP' >> $@.tmp; \
+ mv $@.tmp $@)
+
+ CLEANFILES += $(installed_test_meta_DATA)
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest b/poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
new file mode 100644
index 000000000..98877e522
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner clutter
diff --git a/poky/meta/recipes-graphics/clutter/clutter-1.0_1.26.2.bb b/poky/meta/recipes-graphics/clutter/clutter-1.0_1.26.2.bb
new file mode 100644
index 000000000..48b050198
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-1.0_1.26.2.bb
@@ -0,0 +1,10 @@
+require clutter-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI[archive.md5sum] = "a03482cbacf735eca8c996f210a21ee5"
+SRC_URI[archive.sha256sum] = "e7233314983055e9018f94f56882e29e7fc34d8d35de030789fdcd9b2d0e2e56"
+SRC_URI += "file://install-examples.patch \
+ file://run-installed-tests-with-tap-output.patch \
+ file://0001-Remove-clutter.types-as-it-is-build-configuration-sp.patch \
+ file://run-ptest"
diff --git a/poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc
new file mode 100644
index 000000000..4c877982b
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0.inc
@@ -0,0 +1,17 @@
+SUMMARY = "GStreamer integration library for Clutter"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2+"
+
+inherit clutter distro_features_check upstream-version-is-even gobject-introspection
+# depends on clutter-1.0 which depends on cogl-1.0
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+SRC_URI += "file://0001-Install-example-binary-needed-for-core-image-clutter.patch"
+
+DEPENDS = "gstreamer1.0-plugins-base gstreamer1.0-plugins-bad clutter-1.0 libgudev"
+RDEPENDS_${PN} += "gstreamer1.0-meta-base"
+PACKAGES =+ "${PN}-examples"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/lib*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-examples = "${bindir}/video-player ${bindir}/video-sink"
diff --git a/poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch
new file mode 100644
index 000000000..0b26b990d
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch
@@ -0,0 +1,33 @@
+From d77c711277bf075ce0545c19b322f040c49c778a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 30 Apr 2015 12:19:13 +0300
+Subject: [PATCH] Install example binary needed for core-image-clutter
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Imported from clutter-gst-1.8 package, git://git.openembedded.org/openembedded,
+commit ae28ee3f7a060b9e0d13154a84f2444a98490b5b, updated for clutter-gst 3.0
+
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ examples/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index bfbc1b5..09655e3 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -1,6 +1,6 @@
+ NULL = #
+
+-noinst_PROGRAMS = camera-player video-player video-sink video-sink-navigation video-content
++bin_PROGRAMS = camera-player video-player video-sink video-sink-navigation video-content
+
+ AM_CPPFLAGS = -I$(top_srcdir) \
+ $(MAINTAINER_CFLAGS) \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.24.bb b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.24.bb
new file mode 100644
index 000000000..ca5e0ae41
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.24.bb
@@ -0,0 +1,7 @@
+require clutter-gst-3.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://clutter-gst/clutter-gst.h;beginline=1;endline=24;md5=95baacba194e814c110ea3bdf25ddbf4"
+
+SRC_URI[archive.md5sum] = "3e145e24bb3c340eeeddafd18efe547d"
+SRC_URI[archive.sha256sum] = "e9f1c87d8f4c47062e952fb8008704f8942cf2d6f290688f3f7d13e83578cc6c"
diff --git a/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc b/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc
new file mode 100644
index 000000000..05c4e5f5c
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc
@@ -0,0 +1,15 @@
+SUMMARY = "Library for embedding a Clutter canvas in a GTK+ application"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2+"
+
+inherit clutter distro_features_check upstream-version-is-even gobject-introspection
+# depends on clutter-1.0 which depends on cogl-1.0
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+# depends on gtk+3
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+DEPENDS = "clutter-1.0 gtk+3"
+PACKAGES =+ "${PN}-examples"
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+
diff --git a/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.4.bb b/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.4.bb
new file mode 100644
index 000000000..f0300c716
--- /dev/null
+++ b/poky/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.8.4.bb
@@ -0,0 +1,6 @@
+require clutter-gtk-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI[archive.md5sum] = "b363ac9878e2337be887b8ee9e1da00e"
+SRC_URI[archive.sha256sum] = "521493ec038973c77edcb8bc5eac23eed41645117894aaee7300b2487cb42b06"
diff --git a/poky/meta/recipes-graphics/cogl/cogl-1.0.inc b/poky/meta/recipes-graphics/cogl/cogl-1.0.inc
new file mode 100644
index 000000000..7a79aa789
--- /dev/null
+++ b/poky/meta/recipes-graphics/cogl/cogl-1.0.inc
@@ -0,0 +1,77 @@
+SUMMARY = "Modern 3D graphics API with associated utility APIs"
+HOMEPAGE = "http://wiki.clutter-project.org/wiki/Cogl"
+LICENSE = "MIT"
+
+inherit clutter distro_features_check upstream-version-is-even gobject-introspection
+# cogl-1.0 needs opengl to build
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+DEPENDS = "glib-2.0 gdk-pixbuf"
+PACKAGES =+ "${PN}-examples \
+ libcogl libcogl-gles2 libcogl-pango libcogl-path \
+ "
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+# Extra DEPENDS for PACKAGECONFIG
+EDEPENDS_GL = "virtual/libgl libdrm"
+EDEPENDS_GLES2 = "virtual/libgles2"
+EDEPENDS_KMS = "libdrm virtual/egl"
+EDEPENDS_EGL = "virtual/egl"
+EDEPENDS_X11 = "virtual/libx11 libxcomposite libxfixes libxi libxrandr"
+EDEPENDS_WAYLAND = "virtual/mesa wayland"
+
+# Extra RDEPENDS for PACKAGECONFIG
+# This has to be explictly listed, because cogl dlopens the backends
+ERDEPENDS_GL = "libgl"
+ERDEPENDS_GLES2 = "libgles2"
+
+# GLESv1 is rarely tested, so disable it
+EXTRA_OECONF += "--enable-examples-install \
+ --enable-debug \
+ --disable-gles1 \
+ --disable-cairo \
+ "
+
+# OpenGL/GLX
+PACKAGECONFIG[glx] = "--enable-gl --enable-glx,--disable-gl --disable-glx,${EDEPENDS_GL} ${EDEPENDS_X11},${ERDEPENDS_GL}"
+
+# GLESv2
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,${EDEPENDS_GLES2}, ${ERDEPENDS_GLES2}"
+
+# EGL backends
+PACKAGECONFIG[egl-kms] = "--enable-kms-egl-platform,--disable-kms-egl-platform,${EDEPENDS_KMS}"
+PACKAGECONFIG[egl-null] = "--enable-null-egl-platform,--disable-null-egl-platform"
+PACKAGECONFIG[egl-x11] = "--enable-xlib-egl-platform,--disable-xlib-egl-platform,${EDEPENDS_X11} ${EDEPENDS_EGL}"
+PACKAGECONFIG[egl-wayland] = "--enable-wayland-egl-platform,--disable-wayland-egl-platform,${EDEPENDS_WAYLAND}"
+
+# Wayland (server-side)
+PACKAGECONFIG[wayland-server] = "--enable-wayland-egl-server,--disable-wayland-egl-server,${EDEPENDS_WAYLAND}"
+
+# Support rendering text directly with Pango
+PACKAGECONFIG[cogl-pango] = "--enable-cogl-pango,--disable-cogl-pango,pango"
+
+# Respect the DISTRO_FEATURES to pull in GLX or Wayland as appropriate by
+# default.
+PACKAGECONFIG ??= "cogl-pango gles2 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'egl-wayland', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx egl-x11', '', d)} \
+ "
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/cogl/.libs"
+}
+
+FILES_${PN} = ""
+FILES_${PN}-examples = "${bindir}/* ${datadir}/cogl/examples-data/*"
+FILES_libcogl = "${libdir}/libcogl${SOLIBS} ${libdir}/girepository-1.0/Cogl-*.typelib"
+FILES_libcogl-gles2 = "${libdir}/libcogl-gles2${SOLIBS}"
+FILES_libcogl-pango = "${libdir}/libcogl-pango${SOLIBS} ${libdir}/girepository-1.0/CoglPango*.typelib"
+
+FILES_libcogl-path = "${libdir}/libcogl-path${SOLIBS}"
+
+# For backwards compatibility after Debian-renaming
+RPROVIDES_libcogl = "cogl-1.0"
+RCONFLICTS_libcogl = "cogl-1.0"
+RREPLACES_libcogl = "cogl-1.0"
+
+COMPATIBLE_HOST_armv4 = 'null'
diff --git a/poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch b/poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch
new file mode 100644
index 000000000..2a9d8f829
--- /dev/null
+++ b/poky/meta/recipes-graphics/cogl/cogl-1.0/0001-Fix-an-incorrect-preprocessor-conditional.patch
@@ -0,0 +1,32 @@
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Backport
+
+
+Original upstream commit follows:
+
+From b583e21d8698dbd58013320cfb47739102efdea7 Mon Sep 17 00:00:00 2001
+From: Kalev Lember <klember@redhat.com>
+Date: Wed, 19 Oct 2016 23:38:28 +0200
+Subject: [PATCH] Fix an incorrect preprocessor conditional
+
+This fixes the build with wayland wayland egl server support disabled.
+---
+ cogl/winsys/cogl-winsys-egl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
+index 39bfd884..4a9f3aa6 100644
+--- a/cogl/winsys/cogl-winsys-egl.c
++++ b/cogl/winsys/cogl-winsys-egl.c
+@@ -1029,7 +1029,7 @@ _cogl_egl_create_image (CoglContext *ctx,
+ egl_ctx = EGL_NO_CONTEXT;
+ else
+ #endif
+-#if COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
++#ifdef COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT
+ /* The WL_bind_wayland_display spec states that EGL_NO_CONTEXT is to be used
+ * in conjunction with the EGL_WAYLAND_BUFFER_WL target */
+ if (target == EGL_WAYLAND_BUFFER_WL)
+--
+2.11.0
+
diff --git a/poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch b/poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch
new file mode 100644
index 000000000..479a0ff4b
--- /dev/null
+++ b/poky/meta/recipes-graphics/cogl/cogl-1.0/test-backface-culling.c-fix-may-be-used-uninitialize.patch
@@ -0,0 +1,35 @@
+From a51f61d675a0e7d6649182c6a1325ceab8342df2 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 Jan 2016 22:47:29 -0800
+Subject: [PATCH] test-backface-culling.c: fix may be used uninitialized error
+
+Fixed when gcc -O:
+test-backface-culling.c:206:7: error: 'cull_front' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| validate_part (framebuffer,
+| ^
+| cc1: some warnings being treated as errors
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ tests/conform/test-backface-culling.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
+index e90c2f5..7c45592 100644
+--- a/tests/conform/test-backface-culling.c
++++ b/tests/conform/test-backface-culling.c
+@@ -164,7 +164,8 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
+
+ for (draw_num = 0; draw_num < 16; draw_num++)
+ {
+- CoglBool cull_front, cull_back;
++ CoglBool cull_front = FALSE;
++ CoglBool cull_back = FALSE;
+ CoglPipelineCullFaceMode cull_mode;
+
+ if (USE_LEGACY_STATE (draw_num))
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb b/poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
new file mode 100644
index 000000000..5901062a4
--- /dev/null
+++ b/poky/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
@@ -0,0 +1,8 @@
+require cogl-1.0.inc
+
+SRC_URI += "file://test-backface-culling.c-fix-may-be-used-uninitialize.patch \
+ file://0001-Fix-an-incorrect-preprocessor-conditional.patch"
+SRC_URI[archive.md5sum] = "d53b708ca7c4af03d7254e46945d6b33"
+SRC_URI[archive.sha256sum] = "39a718cdb64ea45225a7e94f88dddec1869ab37a21b339ad058a9d898782c00d"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"
diff --git a/poky/meta/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch b/poky/meta/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch
new file mode 100644
index 000000000..40bebc0f5
--- /dev/null
+++ b/poky/meta/recipes-graphics/drm/libdrm/0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch
@@ -0,0 +1,53 @@
+From e6bd4205b0b546afe991ae6f72256645f4404ad4 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 5 Sep 2016 14:41:37 +0300
+Subject: [PATCH libdrm] configure.ac: Allow explicit enabling of cunit tests
+
+Add --with-cunit to make it easier to do reproducible builds. Default
+is still to probe cunit and build opportunistically.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [mailing list]
+---
+ configure.ac | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+Index: libdrm-2.4.91/configure.ac
+===================================================================
+--- libdrm-2.4.91.orig/configure.ac
++++ libdrm-2.4.91/configure.ac
+@@ -163,6 +163,12 @@ AC_ARG_ENABLE(install-test-programs,
+ [Install test programs (default: no)]),
+ [INSTALL_TESTS=$enableval], [INSTALL_TESTS=no])
+
++AC_ARG_WITH([cunit],
++ [AS_HELP_STRING([--with-cunit],
++ [Build tests that use cunit (default: auto)])],
++ [],
++ [with_cunit=auto])
++
+ dnl ===========================================================================
+ dnl check compiler flags
+ AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
+@@ -411,7 +417,7 @@ else
+ AC_DEFINE(HAVE_RADEON, 0)
+ fi
+
+-if test "x$AMDGPU" != xno; then
++if test "x$with_cunit" != xno -a "x$AMDGPU" != xno; then
+ # Detect cunit library
+ PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
+ # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
+@@ -436,7 +442,11 @@ if test "x$AMDGPU" = xyes; then
+ AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support])
+
+ if test "x$have_cunit" = "xno"; then
+- AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
++ if test "x$with_cunit" = "xyes"; then
++ AC_MSG_ERROR([Could not find cunit library but --with-cunit was given])
++ elif test "x$with_cunit" = "xauto"; then
++ AC_MSG_WARN([Could not find cunit library. Disabling amdgpu tests])
++ fi
+ fi
+ else
+ AC_DEFINE(HAVE_AMDGPU, 0)
diff --git a/poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch b/poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
new file mode 100644
index 000000000..4708bf1eb
--- /dev/null
+++ b/poky/meta/recipes-graphics/drm/libdrm/fix_O_CLOEXEC_undeclared.patch
@@ -0,0 +1,24 @@
+drmdevice.c: define _GNU_SOURCE
+
+Include config.h to fix this build error with uclibc:
+
+libdrm-2.4.66/tests/drmdevice.c: In function 'main':
+libdrm-2.4.66/tests/drmdevice.c:96:60: error:
+'O_CLOEXEC' undeclared (first use in this function)
+fd = open(devices[i]->nodes[j],O_RDONLY | O_CLOEXEC, 0);
+
+Upstream-Status: Pending
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libdrm-2.4.66-orig/tests/drmdevice.c libdrm-2.4.66/tests/drmdevice.c
+--- libdrm-2.4.66-orig/tests/drmdevice.c 2016-02-23 11:34:02.054904502 +0200
++++ libdrm-2.4.66/tests/drmdevice.c 2016-02-23 11:35:34.371750383 +0200
+@@ -21,6 +21,7 @@
+ *
+ */
+
++#include <config.h>
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/poky/meta/recipes-graphics/drm/libdrm/installtests.patch b/poky/meta/recipes-graphics/drm/libdrm/installtests.patch
new file mode 100644
index 000000000..ec1fb0236
--- /dev/null
+++ b/poky/meta/recipes-graphics/drm/libdrm/installtests.patch
@@ -0,0 +1,25 @@
+From 5c6eb43c2f6e7f2ee7c25c92e42f4e4403fa0527 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 21 Feb 2017 14:37:52 +0200
+Subject: [PATCH] tests: also install test apps
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0355a92..b4882cd 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -45,3 +45,4 @@ TESTS = \
+ check_PROGRAMS = \
+ $(TESTS) \
+ drmdevice
++bin_PROGRAMS = $(check_PROGRAMS)
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/drm/libdrm_2.4.91.bb b/poky/meta/recipes-graphics/drm/libdrm_2.4.91.bb
new file mode 100644
index 000000000..c49028588
--- /dev/null
+++ b/poky/meta/recipes-graphics/drm/libdrm_2.4.91.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services. DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI). DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs libpciaccess"
+
+SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
+ file://installtests.patch \
+ file://fix_O_CLOEXEC_undeclared.patch \
+ file://0001-configure.ac-Allow-explicit-enabling-of-cunit-tests.patch \
+ "
+
+SRC_URI[md5sum] = "23d87cda92700b710a37d9b8edaa9f54"
+SRC_URI[sha256sum] = "634a0ed0cc1eff06f48674b1da81aafa661a9f001e7a4f43dde81076886dc800"
+
+inherit autotools pkgconfig manpages
+
+EXTRA_OECONF += "--disable-cairo-tests \
+ --without-cunit \
+ --enable-omap-experimental-api \
+ --enable-etnaviv-experimental-api \
+ --enable-install-test-programs \
+ --disable-valgrind \
+ "
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
+
+ALLOW_EMPTY_${PN}-drivers = "1"
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
+ ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno ${PN}-amdgpu \
+ ${PN}-etnaviv"
+
+RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
+ ${PN}-exynos ${PN}-freedreno ${PN}-amdgpu \
+ ${PN}-etnaviv"
+
+FILES_${PN}-tests = "${bindir}/*"
+FILES_${PN}-radeon = "${libdir}/libdrm_radeon.so.*"
+FILES_${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*"
+FILES_${PN}-omap = "${libdir}/libdrm_omap.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
+FILES_${PN}-amdgpu = "${libdir}/libdrm_amdgpu.so.*"
+FILES_${PN}-etnaviv = "${libdir}/libdrm_etnaviv.so.*"
diff --git a/poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb b/poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
new file mode 100644
index 000000000..cccdd2073
--- /dev/null
+++ b/poky/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
@@ -0,0 +1,7 @@
+EGLINFO_PLATFORM ?= "fb"
+EGLINFO_BINARY_NAME ?= "eglinfo-fb"
+
+require eglinfo.inc
+
+SUMMARY += "(Framebuffer version)"
+CXXFLAGS += "-DMESA_EGL_NO_X11_HEADERS=1"
diff --git a/poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb b/poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
new file mode 100644
index 000000000..48ab8805d
--- /dev/null
+++ b/poky/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
@@ -0,0 +1,13 @@
+EGLINFO_PLATFORM ?= "x11"
+EGLINFO_BINARY_NAME ?= "eglinfo-x11"
+
+require eglinfo.inc
+
+DEPENDS += "virtual/libx11"
+
+inherit distro_features_check
+
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES += "x11"
+
+SUMMARY += "(X11 version)"
diff --git a/poky/meta/recipes-graphics/eglinfo/eglinfo.inc b/poky/meta/recipes-graphics/eglinfo/eglinfo.inc
new file mode 100644
index 000000000..8e7d9bddd
--- /dev/null
+++ b/poky/meta/recipes-graphics/eglinfo/eglinfo.inc
@@ -0,0 +1,33 @@
+SUMMARY = "Utility for printing information EGL and its client APIs (OpenGL, OpenGL ES, OpenVG)"
+SECTION = "graphics"
+LICENSE = "Zlib"
+HOMEPAGE = "https://github.com/dv1/eglinfo"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8d4f33bc3add976f7dfae85dab66f03c"
+
+DEPENDS = "virtual/egl"
+
+SRC_URI = "git://github.com/dv1/eglinfo.git;branch=master \
+ file://0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch \
+ "
+SRCREV = "4b317648ec6cf39556a9e5d8078f605bc0edd5de"
+
+CVE_PRODUCT = "eglinfo"
+
+S = "${WORKDIR}/git"
+
+inherit waf distro_features_check
+# depends on virtual/egl
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+# BSP layers should add .bbappend files for the -x11 and -fb .bb recipes, which
+# append the respective EGL/OpenGLES/OpenVG libraries to DEPENDS and set
+# EGL_DEVICE as appropriate.
+EGLINFO_DEVICE ?= "generic"
+
+EXTRA_OECONF = "--platform=${EGLINFO_PLATFORM} \
+ --device=${EGLINFO_DEVICE} \
+ --sysroot ${STAGING_DIR_TARGET}"
+
+do_install_append() {
+ mv ${D}/${bindir}/eglinfo ${D}/${bindir}/${EGLINFO_BINARY_NAME}
+}
diff --git a/poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch b/poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch
new file mode 100644
index 000000000..ca9f55c18
--- /dev/null
+++ b/poky/meta/recipes-graphics/eglinfo/files/0001-Add-STAGING_INCDIR-to-searchpath-for-egl-headers.patch
@@ -0,0 +1,34 @@
+From 94b1e6daf7d70550b0e32fbb269fcf6887948d3f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 16:08:22 -0800
+Subject: [PATCH] Add STAGING_INCDIR to searchpath for egl headers
+
+bcm_host.h is in standard includedir in sysroot
+add that to header search paths.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ wscript | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/wscript b/wscript
+index fcbb55b..cece8bf 100644
+--- a/wscript
++++ b/wscript
+@@ -163,9 +163,10 @@ def configure_raspberrypi_device(conf, platform):
+ conf.check_cxx(mandatory = 1, lib = ['GLESv2', 'EGL', 'bcm_host'], uselib_store = 'EGL')
+ import os
+ sysroot = conf.options.sysroot + conf.options.prefix
++ std_include_path = os.path.join(sysroot, 'include')
+ vcos_pthread_path = os.path.join(sysroot, 'include/interface/vcos/pthreads')
+ vcms_host_path = os.path.join(sysroot, 'include/interface/vmcs_host/linux')
+- if not conf.check_cxx(mandatory = 0, header_name = ['vcos_platform_types.h', 'EGL/egl.h', 'bcm_host.h'], includes = [vcos_pthread_path, vcms_host_path], uselib_store = 'EGL'):
++ if not conf.check_cxx(mandatory = 0, header_name = ['vcos_platform_types.h', 'EGL/egl.h', 'bcm_host.h'], includes = [vcos_pthread_path, vcms_host_path, std_include_path], uselib_store = 'EGL'):
+ conf.fatal('Check if --prefix and --sysroot are set correctly.')
+ conf.env['WITH_APIS'] = []
+ if check_gles2(conf):
+--
+2.7.0
+
diff --git a/poky/meta/recipes-graphics/fontconfig/fontconfig/0001-src-fcxml.c-avoid-double-free-of-filename.patch b/poky/meta/recipes-graphics/fontconfig/fontconfig/0001-src-fcxml.c-avoid-double-free-of-filename.patch
new file mode 100644
index 000000000..3ca9fde96
--- /dev/null
+++ b/poky/meta/recipes-graphics/fontconfig/fontconfig/0001-src-fcxml.c-avoid-double-free-of-filename.patch
@@ -0,0 +1,28 @@
+From a163c81ac430cdc292add200f3e6a0c048be4d7e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 11 Oct 2017 17:40:09 +0300
+Subject: [PATCH] src/fcxml.c: avoid double free() of filename
+
+It's also freed after bail1, so no need to do it here.
+
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=103221]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/fcxml.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/fcxml.c b/src/fcxml.c
+index 19ce96a..edb6054 100644
+--- a/src/fcxml.c
++++ b/src/fcxml.c
+@@ -3398,7 +3398,6 @@ FcConfigParseAndLoad (FcConfig *config,
+
+ fd = FcOpen ((char *) filename, O_RDONLY);
+ if (fd == -1) {
+- FcStrFree (filename);
+ goto bail1;
+ }
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch b/poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
new file mode 100644
index 000000000..fca1e6594
--- /dev/null
+++ b/poky/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
@@ -0,0 +1,20 @@
+Revert part of http://cgit.freedesktop.org/fontconfig/commit/fontconfig.pc.in?id=338ffe6b886ad4ba86ff471cb59c4a5e5ffbe408
+We really dont do static linking so its not going to cause issues for us but as such this is harming us by adding absolute
+paths into -I options into fontconfig.pc which is them prepended with sysroot when read back by cross pkg-config and
+we end up with -I <sysroot>/<sysroot>/usr/include/fontconfig in CFLAGS of clients which depend on it. one such example
+is matchbox-panel-2 and it was working fine with gcc < 5 because it tolerated non-existing paths in -I flags but gcc-5
+gently refuses and rightly so.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: fontconfig-2.11.93/fontconfig.pc.in
+===================================================================
+--- fontconfig-2.11.93.orig/fontconfig.pc.in
++++ fontconfig-2.11.93/fontconfig.pc.in
+@@ -15,4 +15,4 @@ Requires: @PKGCONFIG_REQUIRES@
+ Requires.private: @PKGCONFIG_REQUIRES_PRIVATELY@
+ Libs: -L${libdir} -lfontconfig
+ Libs.private: @EXPAT_LIBS@ @FREETYPE_LIBS@ @ICONV_LIBS@ @LIBXML2_LIBS@
+-Cflags: -I${includedir} @EXPAT_CFLAGS@ @FREETYPE_CFLAGS@ @ICONV_CFLAGS@ @LIBXML2_CFLAGS@
++Cflags: -I${includedir}
diff --git a/poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb b/poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb
new file mode 100644
index 000000000..d4cbce80b
--- /dev/null
+++ b/poky/meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb
@@ -0,0 +1,58 @@
+SUMMARY = "Generic font configuration library"
+DESCRIPTION = "Fontconfig is a font configuration and customization library, which \
+does not depend on the X Window System. It is designed to locate \
+fonts within the system and select them according to requirements \
+specified by applications. \
+Fontconfig is not a rasterization library, nor does it impose a \
+particular rasterization library on the application. The X-specific \
+library 'Xft' uses fontconfig along with freetype to specify and \
+rasterize fonts."
+
+HOMEPAGE = "http://www.fontconfig.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig"
+
+LICENSE = "MIT-style & MIT & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7a0449e9bc5370402a94c00204beca3d \
+ file://src/fcfreetype.c;endline=45;md5=5d9513e3196a1fbfdfa94051c09dfc84 \
+ file://src/fccache.c;beginline=1367;endline=1382;md5=0326cfeb4a7333dd4dd25fbbc4b9f27f"
+
+SECTION = "libs"
+
+DEPENDS = "expat freetype zlib gperf-native"
+
+SRC_URI = "http://fontconfig.org/release/fontconfig-${PV}.tar.gz \
+ file://revert-static-pkgconfig.patch \
+ file://0001-src-fcxml.c-avoid-double-free-of-filename.patch \
+ "
+
+SRC_URI[md5sum] = "00e748c67fad11e7057a71ed385e8bdb"
+SRC_URI[sha256sum] = "064b9ebf060c9e77011733ac9dc0e2ce92870b574cca2405e11f5353a683c334"
+
+UPSTREAM_CHECK_REGEX = "fontconfig-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
+
+do_configure_prepend() {
+ # work around https://bugs.freedesktop.org/show_bug.cgi?id=101280
+ rm -f ${S}/src/fcobjshash.h ${S}/src/fcobjshash.gperf
+}
+
+PACKAGES =+ "fontconfig-utils"
+FILES_${PN} =+ "${datadir}/xml/*"
+FILES_fontconfig-utils = "${bindir}/*"
+
+# Work around past breakage in debian.bbclass
+RPROVIDES_fontconfig-utils = "libfontconfig-utils"
+RREPLACES_fontconfig-utils = "libfontconfig-utils"
+RCONFLICTS_fontconfig-utils = "libfontconfig-utils"
+DEBIAN_NOAUTONAME_fontconfig-utils = "1"
+
+inherit autotools pkgconfig relative_symlinks
+
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+# comma separated list of additional directories
+# /usr/share/fonts is already included by default (you can change it with --with-default-fonts)
+FONTCONFIG_FONT_DIRS ?= "no"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR} --with-add-fonts=${FONTCONFIG_FONT_DIRS}"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch b/poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch
new file mode 100644
index 000000000..20838813d
--- /dev/null
+++ b/poky/meta/recipes-graphics/freetype/freetype/use-right-libtool.patch
@@ -0,0 +1,14 @@
+Freetype think that it knows best about where libtool is, and explicitly the
+libtool autoconf macros telling it where to find the libtool script. Of course
+we prefix the script with the target triplet, so it's wrong. Fix this by
+removing the forced assignment, so the configure script's knowledge of where it
+put libtool is used.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- freetype-2.6/builds/unix/unix-cc.in.orig 2016-01-07 19:21:45.244943479 +0000
++++ freetype-2.6/builds/unix/unix-cc.in 2016-01-07 19:21:50.213112131 +0000
+@@ -19,1 +18,1 @@
+-LIBTOOL := $(FT_LIBTOOL_DIR)/libtool
++LIBTOOL := $(FT_LIBTOOL_DIR)/@LIBTOOL@
diff --git a/poky/meta/recipes-graphics/freetype/freetype_2.9.bb b/poky/meta/recipes-graphics/freetype/freetype_2.9.bb
new file mode 100644
index 000000000..da05916b3
--- /dev/null
+++ b/poky/meta/recipes-graphics/freetype/freetype_2.9.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Freetype font rendering library"
+DESCRIPTION = "FreeType is a software font engine that is designed to be small, efficient, \
+highly customizable, and portable while capable of producing high-quality output (glyph \
+images). It can be used in graphics libraries, display servers, font conversion tools, text \
+image generation tools, and many other products as well."
+HOMEPAGE = "http://www.freetype.org/"
+BUGTRACKER = "https://savannah.nongnu.org/bugs/?group=freetype"
+SECTION = "libs"
+
+LICENSE = "FreeType | GPLv2+"
+LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=4af6221506f202774ef74f64932878a1 \
+ file://docs/FTL.TXT;md5=9f37b4e6afa3fef9dba8932b16bd3f97 \
+ file://docs/GPLv2.TXT;md5=8ef380476f642c20ebf40fecb0add2ec"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2 \
+ file://use-right-libtool.patch"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/freetype/files/freetype2/"
+UPSTREAM_CHECK_REGEX = "freetype-(?P<pver>\d+(\.\d+)+)"
+
+SRC_URI[md5sum] = "513c403c110016fdc7e537216a642b1d"
+SRC_URI[sha256sum] = "e6ffba3c8cef93f557d1f767d7bc3dee860ac7a3aaff588a521e081bc36f4c8a"
+
+inherit autotools pkgconfig binconfig-disabled multilib_header
+
+# Adapt autotools to work with the minimal autoconf usage in freetype
+AUTOTOOLS_SCRIPT_PATH = "${S}/builds/unix"
+CONFIGURE_SCRIPT = "${S}/configure"
+EXTRA_AUTORECONF += "--exclude=autoheader --exclude=automake"
+
+PACKAGECONFIG ??= "zlib"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2"
+# harfbuzz results in a circular dependency so enabling is non-trivial
+PACKAGECONFIG[harfbuzz] = "--with-harfbuzz,--without-harfbuzz,harfbuzz"
+PACKAGECONFIG[pixmap] = "--with-png,--without-png,libpng"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
+
+EXTRA_OECONF = "CC_BUILD='${BUILD_CC}'"
+
+TARGET_CPPFLAGS += "-D_FILE_OFFSET_BITS=64"
+
+do_install_append() {
+ oe_multilib_header freetype2/freetype/config/ftconfig.h
+}
+
+BINCONFIG = "${bindir}/freetype-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/fstests/fstests_git.bb b/poky/meta/recipes-graphics/fstests/fstests_git.bb
new file mode 100644
index 000000000..69f217830
--- /dev/null
+++ b/poky/meta/recipes-graphics/fstests/fstests_git.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Various benchmarning tests for X"
+HOMEPAGE = "http://www.o-hand.com"
+SECTION = "devel"
+LICENSE = "Zlib"
+DEPENDS = "pango libxext libxft virtual/libx11 gtk+"
+
+SRCREV = "e5939ff608b95cdd4d0ab0e1935781ab9a276ac0"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+LIC_FILES_CHKSUM = "file://test-pango-gdk.c;endline=24;md5=1ee74ec851ecda57eb7ac6cc180f7655"
+
+S = "${WORKDIR}/git/tests"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-graphics/glew/glew/no-strip.patch b/poky/meta/recipes-graphics/glew/glew/no-strip.patch
new file mode 100644
index 000000000..e411f11cb
--- /dev/null
+++ b/poky/meta/recipes-graphics/glew/glew/no-strip.patch
@@ -0,0 +1,12 @@
+Don't forcibly strip the binaries.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Pending
+
+diff --git a/Makefile b/Makefile
+index 6a9803c..170c0ce 100644
+--- a/Makefile
++++ b/Makefile
+@@ -285 +285 @@ install.bin: glew.bin
+- $(INSTALL) -s -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
++ $(INSTALL) -m 0755 bin/$(GLEWINFO.BIN) bin/$(VISUALINFO.BIN) "$(DESTDIR)$(BINDIR)/"
diff --git a/poky/meta/recipes-graphics/glew/glew_2.1.0.bb b/poky/meta/recipes-graphics/glew/glew_2.1.0.bb
new file mode 100644
index 000000000..be725e053
--- /dev/null
+++ b/poky/meta/recipes-graphics/glew/glew_2.1.0.bb
@@ -0,0 +1,44 @@
+SUMMARY = "OpenGL extension loading library"
+DESCRIPTION = "The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library."
+HOMEPAGE = "http://glew.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=67586"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
+ file://no-strip.patch"
+
+SRC_URI[md5sum] = "b2ab12331033ddfaa50dc39345343980"
+SRC_URI[sha256sum] = "04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/glew/files/glew"
+UPSTREAM_CHECK_REGEX = "/glew/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit lib_package pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl', 'egl-gles2', d)}"
+
+# The opengl and egl-XXX options are exclusive, enable only one.
+PACKAGECONFIG[opengl] = "SYSTEM='linux',,virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
+PACKAGECONFIG[egl-gles2] = "SYSTEM='linux-egl' GLEW_NO_GLU='-DGLEW_NO_GLU' LDFLAGS.GL='-lEGL -lGLESv2',,virtual/egl virtual/libgles2"
+
+CFLAGS += "-D_GNU_SOURCE"
+# Override SYSTEM (via PACKAGECONFIG_CONFARGS) to avoid calling config.guess,
+# we're cross-compiling. Pass our CFLAGS via POPT as that's the optimisation
+# variable and safely overwritten.
+EXTRA_OEMAKE = "${PACKAGECONFIG_CONFARGS} \
+ CC='${CC}' LD='${CC}' STRIP='' \
+ LDFLAGS.EXTRA='${LDFLAGS}' \
+ POPT='${CFLAGS}' \
+ GLEW_PREFIX='${prefix}' BINDIR='${bindir}' \
+ LIBDIR='${libdir}' INCDIR='${includedir}/GL' PKGDIR='${libdir}/pkgconfig'"
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install.all
+}
diff --git a/poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.7.5.bb b/poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.7.5.bb
new file mode 100644
index 000000000..0a9b02946
--- /dev/null
+++ b/poky/meta/recipes-graphics/harfbuzz/harfbuzz_1.7.5.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Text shaping library"
+DESCRIPTION = "HarfBuzz is an OpenType text shaping engine."
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/HarfBuzz"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=HarfBuzz"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e021dd6dda6ff1e6b1044002fc662b9b \
+ file://src/hb-ucdn/COPYING;md5=994ba0f1295f15b4bda4999a5bbeddef \
+"
+
+DEPENDS = "glib-2.0 cairo fontconfig freetype"
+
+SRC_URI = "http://www.freedesktop.org/software/harfbuzz/release/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "1466ab51fc5aaa6af4065936939cec62"
+SRC_URI[sha256sum] = "84574e1b1f65ca694cb8fb6905309665c0368af18a312357f8ff886ee2f29563"
+
+inherit autotools pkgconfig lib_package gtk-doc
+
+PACKAGECONFIG ??= "icu"
+PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu"
+
+EXTRA_OECONF = " \
+ --with-cairo \
+ --with-fontconfig \
+ --with-freetype \
+ --with-glib \
+ --without-graphite2 \
+"
+
+PACKAGES =+ "${PN}-icu ${PN}-icu-dev"
+
+FILES_${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"
+FILES_${PN}-icu-dev = "${libdir}/libharfbuzz-icu.la \
+ ${libdir}/libharfbuzz-icu.so \
+ ${libdir}/pkgconfig/harfbuzz-icu.pc \
+"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/images/core-image-clutter.bb b/poky/meta/recipes-graphics/images/core-image-clutter.bb
new file mode 100644
index 000000000..b0f25cf1b
--- /dev/null
+++ b/poky/meta/recipes-graphics/images/core-image-clutter.bb
@@ -0,0 +1,13 @@
+DESCRIPTION = "An image with support for the Open GL-based toolkit Clutter, \
+which enables development of rich and animated graphical user interfaces."
+
+IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear"
+
+LICENSE = "MIT"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ packagegroup-core-clutter-core \
+ "
+
+inherit core-image
diff --git a/poky/meta/recipes-graphics/images/core-image-weston.bb b/poky/meta/recipes-graphics/images/core-image-weston.bb
new file mode 100644
index 000000000..e36655ffc
--- /dev/null
+++ b/poky/meta/recipes-graphics/images/core-image-weston.bb
@@ -0,0 +1,12 @@
+SUMMARY = "A very basic Wayland image with a terminal"
+
+IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs"
+
+LICENSE = "MIT"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "wayland"
+
+CORE_IMAGE_BASE_INSTALL += "weston weston-init weston-examples gtk+3-demo clutter-1.0-examples"
+CORE_IMAGE_BASE_INSTALL += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'weston-xwayland matchbox-terminal', '', d)}"
diff --git a/poky/meta/recipes-graphics/images/core-image-x11.bb b/poky/meta/recipes-graphics/images/core-image-x11.bb
new file mode 100644
index 000000000..8455bb8ca
--- /dev/null
+++ b/poky/meta/recipes-graphics/images/core-image-x11.bb
@@ -0,0 +1,9 @@
+SUMMARY = "A very basic X11 image with a terminal"
+
+IMAGE_FEATURES += "splash package-management x11-base"
+
+LICENSE = "MIT"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.3.bb b/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.3.bb
new file mode 100644
index 000000000..50a5ae085
--- /dev/null
+++ b/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_1.5.3.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Hardware accelerated JPEG compression/decompression library"
+DESCRIPTION = "libjpeg-turbo is a derivative of libjpeg that uses SIMD instructions (MMX, SSE2, NEON) to accelerate baseline JPEG compression and decompression"
+HOMEPAGE = "http://libjpeg-turbo.org/"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://cdjpeg.h;endline=13;md5=8184bcc7c4ac7b9edc6a7bc00f231d0b \
+ file://jpeglib.h;endline=16;md5=f67d70e547a2662c079781c72f877f72 \
+ file://djpeg.c;endline=11;md5=c59e19811c006cb38f82d6477134d314 \
+"
+DEPENDS_append_x86-64_class-target = " nasm-native"
+DEPENDS_append_x86_class-target = " nasm-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "7c82f0f6a3130ec06b8a4d0b321cbca3"
+SRC_URI[sha256sum] = "b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523"
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libjpeg-turbo/files/"
+UPSTREAM_CHECK_REGEX = "/libjpeg-turbo/files/(?P<pver>(\d+[\.\-_]*)+)/"
+
+PE= "1"
+
+# Drop-in replacement for jpeg
+PROVIDES = "jpeg"
+RPROVIDES_${PN} += "jpeg"
+RREPLACES_${PN} += "jpeg"
+RCONFLICTS_${PN} += "jpeg"
+
+inherit autotools pkgconfig
+
+# Add nasm-native dependency consistently for all build arches is hard
+EXTRA_OECONF_append_class-native = " --without-simd"
+
+# Work around missing x32 ABI support
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--without-simd", "", d)}"
+
+# Work around missing non-floating point ABI support in MIPS
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("MIPSPKGSFX_FPU", "-nf", "--without-simd", "", d)}"
+
+# Provide a workaround if Altivec unit is not present in PPC
+EXTRA_OECONF_append_class-target_powerpc = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
+EXTRA_OECONF_append_class-target_powerpc64 = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "--without-simd", d)}"
+
+def get_build_time(d):
+ if d.getVar('SOURCE_DATE_EPOCH') != None:
+ import datetime
+ return " --with-build-date="+ datetime.datetime.fromtimestamp(float(d.getVar('SOURCE_DATE_EPOCH'))).strftime("%Y%m%d")
+ return ""
+
+EXTRA_OECONF_append_class-target = "${@get_build_time(d)}"
+
+PACKAGES =+ "jpeg-tools libturbojpeg"
+
+DESCRIPTION_jpeg-tools = "The jpeg-tools package includes client programs to access libjpeg functionality. These tools allow for the compression, decompression, transformation and display of JPEG files and benchmarking of the libjpeg library."
+FILES_jpeg-tools = "${bindir}/*"
+
+DESCRIPTION_libturbojpeg = "A SIMD-accelerated JPEG codec which provides only TurboJPEG APIs"
+FILES_libturbojpeg = "${libdir}/libturbojpeg.so.*"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch b/poky/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch
new file mode 100644
index 000000000..3605446e4
--- /dev/null
+++ b/poky/meta/recipes-graphics/kmscube/kmscube/detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch
@@ -0,0 +1,116 @@
+From 761bf993ca55095f46380c0238583791c1797295 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
+Date: Tue, 11 Jul 2017 14:50:37 -0500
+Subject: [PATCH kmscube] Detect gst_bo_map/_unmap and use it (or avoid it)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Those functions are not available on libMali, thus breaking
+builds and creating havoc.
+
+Removing the specific parts of the code that deal with
+gbm_bo_map() and gbm_bo_unmap() renders the kmscube utility
+a little less useful, but still valuable.
+
+Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
+Cc: Rob Clark <robdclark@gmail.com>
+Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
+
+Upstream-Status: Submitted [https://lists.freedesktop.org/archives/mesa-dev/2017-July/163020.html]
+---
+ Makefile.am | 5 ++++-
+ configure.ac | 3 +++
+ gst-decoder.c | 7 ++++++-
+ kmscube.c | 4 ++++
+ 4 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a36087d..ab4adbf 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -43,7 +43,6 @@ kmscube_SOURCES = \
+ common.c \
+ common.h \
+ cube-smooth.c \
+- cube-tex.c \
+ drm-atomic.c \
+ drm-common.c \
+ drm-common.h \
+@@ -59,3 +58,7 @@ kmscube_LDADD += $(GST_LIBS)
+ kmscube_CFLAGS += $(GST_CFLAGS)
+ kmscube_SOURCES += cube-video.c gst-decoder.c
+ endif
++
++if ENABLE_GBM_MAP
++kmscube_SOURCES += cube-tex.c
++endif
+diff --git a/configure.ac b/configure.ac
+index 8397f7b..c7f1f4d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -65,5 +65,8 @@ if test "x$enable_gbm_modifiers" = xyes; then
+ AC_DEFINE(HAVE_GBM_MODIFIERS, 1, [Define if you can use GBM properties.])
+ fi
+
++AC_CHECK_LIB([gbm], [gbm_bo_map], [HAVE_GBM_BO_MAP=yes], [])
++AM_CONDITIONAL(ENABLE_GBM_MAP, [test "x$HAVE_GBM_BO_MAP" = "xyes"])
++
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
+diff --git a/gst-decoder.c b/gst-decoder.c
+index 2d6d581..b84980e 100644
+--- a/gst-decoder.c
++++ b/gst-decoder.c
+@@ -332,6 +332,7 @@ set_last_frame(struct decoder *dec, EGLImage frame, GstSample *samp)
+ dec->last_samp = samp;
+ }
+
++#if HAVE_GBM_BO_MAP
+ // TODO this could probably be a helper re-used by cube-tex:
+ static int
+ buf_to_fd(const struct gbm *gbm, int size, void *ptr)
+@@ -357,6 +358,7 @@ buf_to_fd(const struct gbm *gbm, int size, void *ptr)
+
+ return fd;
+ }
++#endif
+
+ static EGLImage
+ buffer_to_image(struct decoder *dec, GstBuffer *buf)
+@@ -410,12 +412,15 @@ buffer_to_image(struct decoder *dec, GstBuffer *buf)
+
+ if (is_dmabuf_mem) {
+ dmabuf_fd = dup(gst_dmabuf_memory_get_fd(mem));
+- } else {
++ }
++#if HAVE_GBM_BO_MAP
++ else {
+ GstMapInfo map_info;
+ gst_buffer_map(buf, &map_info, GST_MAP_READ);
+ dmabuf_fd = buf_to_fd(dec->gbm, map_info.size, map_info.data);
+ gst_buffer_unmap(buf, &map_info);
+ }
++#endif
+
+ if (dmabuf_fd < 0) {
+ GST_ERROR("could not obtain DMABUF FD");
+diff --git a/kmscube.c b/kmscube.c
+index 3a2c4dd..276dc55 100644
+--- a/kmscube.c
++++ b/kmscube.c
+@@ -142,7 +142,11 @@ int main(int argc, char *argv[])
+ else if (mode == VIDEO)
+ egl = init_cube_video(gbm, video);
+ else
++#if HAVE_GBM_BO_MAP
+ egl = init_cube_tex(gbm, mode);
++#else
++ printf("gbm_bo_map() support missing\n");
++#endif
+
+ if (!egl) {
+ printf("failed to initialize EGL\n");
+--
+2.7.4
+
diff --git a/poky/meta/recipes-graphics/kmscube/kmscube_git.bb b/poky/meta/recipes-graphics/kmscube/kmscube_git.bb
new file mode 100644
index 000000000..5b64ed643
--- /dev/null
+++ b/poky/meta/recipes-graphics/kmscube/kmscube_git.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "Demo application to showcase 3D graphics using kms and gbm"
+HOMEPAGE = "https://cgit.freedesktop.org/mesa/kmscube/"
+LICENSE = "MIT"
+SECTION = "graphics"
+DEPENDS = "virtual/libgles2 virtual/egl libdrm gstreamer1.0 gstreamer1.0-plugins-base"
+
+LIC_FILES_CHKSUM = "file://kmscube.c;beginline=1;endline=23;md5=8b309d4ee67b7315ff7381270dd631fb"
+
+SRCREV = "0d8de4ce3a03f36af1817f9b0586d132ad2c5d2e"
+SRC_URI = "git://anongit.freedesktop.org/mesa/kmscube;branch=master;protocol=git \
+ file://detect-gst_bo_map-_unmap-and-use-it-or-avoid-it.patch"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
diff --git a/poky/meta/recipes-graphics/libepoxy/libepoxy/no-tests.patch b/poky/meta/recipes-graphics/libepoxy/libepoxy/no-tests.patch
new file mode 100644
index 000000000..d2b6c1a25
--- /dev/null
+++ b/poky/meta/recipes-graphics/libepoxy/libepoxy/no-tests.patch
@@ -0,0 +1,33 @@
+Add option to disable tests.
+
+Upstream-Status: Submitted (https://github.com/anholt/libepoxy/pull/158)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/meson.build b/meson.build
+index b2ebaef..9632c7a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -242,7 +242,10 @@ libepoxy_inc = [
+
+ subdir('include/epoxy')
+ subdir('src')
+-subdir('test')
++
++if get_option('tests')
++ subdir('test')
++endif
+
+ if get_option('docs')
+ doxygen = find_program('doxygen', required: false)
+diff --git a/meson_options.txt b/meson_options.txt
+index b5d7c98..dc30e68 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -15,3 +15,7 @@ option('x11',
+ type: 'boolean',
+ value: true,
+ description: 'Enable X11 support (GLX or EGL-X11)')
++option('tests',
++ type: 'boolean',
++ value: true,
++ description: 'Build the test suite')
diff --git a/poky/meta/recipes-graphics/libepoxy/libepoxy_1.5.0.bb b/poky/meta/recipes-graphics/libepoxy/libepoxy_1.5.0.bb
new file mode 100644
index 000000000..5ca0868c2
--- /dev/null
+++ b/poky/meta/recipes-graphics/libepoxy/libepoxy_1.5.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenGL function pointer management library"
+HOMEPAGE = "https://github.com/anholt/libepoxy/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
+
+SRC_URI = "https://github.com/anholt/${BPN}/releases/download/${PV}/${BP}.tar.xz \
+ file://no-tests.patch \
+ "
+SRC_URI[md5sum] = "63fe3847789258254dcd7e3fdb9e7f5e"
+SRC_URI[sha256sum] = "4c94995398a6ebf691600dda2e9685a0cac261414175c2adf4645cdfab42a5d5"
+UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases"
+
+inherit meson pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGECONFIG[egl] = "-Degl=yes, -Degl=no, virtual/egl"
+PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11 virtual/libgl"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} egl"
+
+EXTRA_OEMESON += "-Dtests=false"
diff --git a/poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb b/poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb
new file mode 100644
index 000000000..4b803dbae
--- /dev/null
+++ b/poky/meta/recipes-graphics/libfakekey/libfakekey_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Library for converting characters to X key-presses"
+DESCRIPTION = "libfakekey is a simple library for converting UTF-8 characters into 'fake' X \
+key-presses."
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/libfakekey.c;endline=30;md5=602b5ccd48f64407510867f3373b448c"
+
+DEPENDS = "libxtst"
+SECTION = "x11/wm"
+
+SRCREV = "7ad885912efb2131e80914e964d5e635b0d07b40"
+PV = "0.3+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gettext distro_features_check
+
+# The libxtst requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.12.bb b/poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.12.bb
new file mode 100644
index 000000000..ce45e4814
--- /dev/null
+++ b/poky/meta/recipes-graphics/libmatchbox/libmatchbox_1.12.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Matchbox window manager core library"
+SECTION = "x11/libs"
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.com/"
+
+LICENSE = "LGPLv2+ & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+ file://COPYING.MIT;md5=f45ed9332b4f50a35adf2065adde4ca7 \
+ file://libmb/mbexp.c;endline=20;md5=28c0aef3b23e308464f5dae6a11b0d2f \
+ file://libmb/xsettings-client.c;endline=20;md5=4b106a387602db8d91a50d5cdfd65031"
+
+DEPENDS = "virtual/libx11 libxext"
+
+#SRCREV for 1.12
+SRCREV = "e846ee434f8e23d9db38af13c523f791495e0e87"
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "jpeg png xft"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
+PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
+PACKAGECONFIG[xft] = "--enable-xft,--disable-xft,libxft"
diff --git a/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/0001-build-Pass-tag-CC-explictly-when-using-libtool.patch b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/0001-build-Pass-tag-CC-explictly-when-using-libtool.patch
new file mode 100644
index 000000000..ec8c0fd4f
--- /dev/null
+++ b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/0001-build-Pass-tag-CC-explictly-when-using-libtool.patch
@@ -0,0 +1,73 @@
+From 44e4bb4cfb81024c8f5fd2e179e8a32c42756a2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Jul 2017 16:52:43 -0700
+Subject: [PATCH] build: Pass --tag=CC explictly when using libtool
+
+Do not depend solely on libtool heuristics which fail
+in OE case when building with external compiler and
+hardening flags
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 4 ++--
+ build-scripts/makedep.sh | 8 ++++----
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ab51035..743ce30 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -72,10 +72,10 @@ depend:
+ include $(depend)
+
+ $(objects)/$(TARGET): $(OBJECTS)
+- $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
++ $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+
+ $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
+- $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(SDLMAIN_LDFLAGS)
++ $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) $(SDLMAIN_LDFLAGS)
+
+
+ install: all install-bin install-hdrs install-lib install-data install-man
+diff --git a/build-scripts/makedep.sh b/build-scripts/makedep.sh
+index 3b3863b..dba28f2 100755
+--- a/build-scripts/makedep.sh
++++ b/build-scripts/makedep.sh
+@@ -51,19 +51,19 @@ do echo "Generating dependencies for $src"
+ case $ext in
+ c) cat >>${output}.new <<__EOF__
+
+- \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
++ \$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+ __EOF__
+ ;;
+ cc) cat >>${output}.new <<__EOF__
+
+- \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
++ \$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+ __EOF__
+ ;;
+ m) cat >>${output}.new <<__EOF__
+
+- \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
++ \$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+ __EOF__
+ ;;
+@@ -75,7 +75,7 @@ __EOF__
+ ;;
+ S) cat >>${output}.new <<__EOF__
+
+- \$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
++ \$(LIBTOOL) --tag=CC --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -c $src -o \$@
+
+ __EOF__
+ ;;
+--
+2.13.3
+
diff --git a/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch
new file mode 100644
index 000000000..f98b92752
--- /dev/null
+++ b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch
@@ -0,0 +1,19 @@
+libX11-1.5.99.901 has changed prototype of _XData32
+
+Upstream-Status: Backport
+<http://bugzilla.libsdl.org/show_bug.cgi?id=1769>
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+diff -r b6b2829cd7ef src/video/x11/SDL_x11sym.h
+--- a/src/video/x11/SDL_x11sym.h Wed Feb 27 15:20:31 2013 -0800
++++ b/src/video/x11/SDL_x11sym.h Wed Mar 27 16:07:23 2013 +0100
+@@ -165,7 +165,7 @@
+ */
+ #ifdef LONG64
+ SDL_X11_MODULE(IO_32BIT)
+-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
++SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
+ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
+ #endif
+
diff --git a/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch
new file mode 100644
index 000000000..913baa92a
--- /dev/null
+++ b/poky/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch
@@ -0,0 +1,187 @@
+Rather than code which doesn't even work properly when cross compiling,
+lets just use pkg-config instead. Its a little simpler.
+
+RP 2014/6/20
+
+Upstream-Status: Pending
+
+Index: SDL-1.2.15/sdl.m4
+===================================================================
+--- SDL-1.2.15.orig/sdl.m4
++++ SDL-1.2.15/sdl.m4
+@@ -12,174 +12,8 @@ dnl Test for SDL, and define SDL_CFLAGS
+ dnl
+ AC_DEFUN([AM_PATH_SDL],
+ [dnl
+-dnl Get the cflags and libraries from the sdl-config script
+-dnl
+-AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
+- sdl_prefix="$withval", sdl_prefix="")
+-AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+- sdl_exec_prefix="$withval", sdl_exec_prefix="")
+-AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
+- , enable_sdltest=yes)
+-
+- if test x$sdl_exec_prefix != x ; then
+- sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
+- if test x${SDL_CONFIG+set} != xset ; then
+- SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+- fi
+- fi
+- if test x$sdl_prefix != x ; then
+- sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
+- if test x${SDL_CONFIG+set} != xset ; then
+- SDL_CONFIG=$sdl_prefix/bin/sdl-config
+- fi
+- fi
+-
+- as_save_PATH="$PATH"
+- if test "x$prefix" != xNONE; then
+- PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+- fi
+- AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+- PATH="$as_save_PATH"
+ min_sdl_version=ifelse([$1], ,0.11.0,$1)
+- AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+- no_sdl=""
+- if test "$SDL_CONFIG" = "no" ; then
+- no_sdl=yes
+- else
+- SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
+- SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
+-
+- sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+- sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+- sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+- if test "x$enable_sdltest" = "xyes" ; then
+- ac_save_CFLAGS="$CFLAGS"
+- ac_save_CXXFLAGS="$CXXFLAGS"
+- ac_save_LIBS="$LIBS"
+- CFLAGS="$CFLAGS $SDL_CFLAGS"
+- CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+- LIBS="$LIBS $SDL_LIBS"
+-dnl
+-dnl Now check if the installed SDL is sufficiently new. (Also sanity
+-dnl checks the results of sdl-config to some extent
+-dnl
+- rm -f conf.sdltest
+- AC_TRY_RUN([
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include "SDL.h"
+-
+-char*
+-my_strdup (char *str)
+-{
+- char *new_str;
+-
+- if (str)
+- {
+- new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+- strcpy (new_str, str);
+- }
+- else
+- new_str = NULL;
+-
+- return new_str;
+-}
+-
+-int main (int argc, char *argv[])
+-{
+- int major, minor, micro;
+- char *tmp_version;
+-
+- /* This hangs on some systems (?)
+- system ("touch conf.sdltest");
+- */
+- { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+-
+- /* HP/UX 9 (%@#!) writes to sscanf strings */
+- tmp_version = my_strdup("$min_sdl_version");
+- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+- printf("%s, bad version string\n", "$min_sdl_version");
+- exit(1);
+- }
+-
+- if (($sdl_major_version > major) ||
+- (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+- (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+- {
+- return 0;
+- }
+- else
+- {
+- printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+- printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+- printf("*** best to upgrade to the required version.\n");
+- printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+- printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+- printf("*** config.cache before re-running configure\n");
+- return 1;
+- }
+-}
+-
+-],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+- CFLAGS="$ac_save_CFLAGS"
+- CXXFLAGS="$ac_save_CXXFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
+- if test "x$no_sdl" = x ; then
+- AC_MSG_RESULT(yes)
+- ifelse([$2], , :, [$2])
+- else
+- AC_MSG_RESULT(no)
+- if test "$SDL_CONFIG" = "no" ; then
+- echo "*** The sdl-config script installed by SDL could not be found"
+- echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+- echo "*** your path, or set the SDL_CONFIG environment variable to the"
+- echo "*** full path to sdl-config."
+- else
+- if test -f conf.sdltest ; then
+- :
+- else
+- echo "*** Could not run SDL test program, checking why..."
+- CFLAGS="$CFLAGS $SDL_CFLAGS"
+- CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+- LIBS="$LIBS $SDL_LIBS"
+- AC_TRY_LINK([
+-#include <stdio.h>
+-#include "SDL.h"
+-
+-int main(int argc, char *argv[])
+-{ return 0; }
+-#undef main
+-#define main K_and_R_C_main
+-], [ return 0; ],
+- [ echo "*** The test program compiled, but did not run. This usually means"
+- echo "*** that the run-time linker is not finding SDL or finding the wrong"
+- echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+- echo "*** to the installed location Also, make sure you have run ldconfig if that"
+- echo "*** is required on your system"
+- echo "***"
+- echo "*** If you have an old version installed, it is best to remove it, although"
+- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+- [ echo "*** The test program failed to compile or link. See the file config.log for the"
+- echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+- echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+- echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+- CFLAGS="$ac_save_CFLAGS"
+- CXXFLAGS="$ac_save_CXXFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
+- SDL_CFLAGS=""
+- SDL_LIBS=""
+- ifelse([$3], , :, [$3])
+- fi
++ PKG_CHECK_MODULES([SDL], [sdl >= $min_sdl_version])
+ AC_SUBST(SDL_CFLAGS)
+ AC_SUBST(SDL_LIBS)
+- rm -f conf.sdltest
+ ])
diff --git a/poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
new file mode 100644
index 000000000..3680ea9d8
--- /dev/null
+++ b/poky/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
+HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
+
+PROVIDES = "virtual/libsdl"
+
+PR = "r3"
+
+SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+ file://libsdl-1.2.15-xdata32.patch \
+ file://pkgconfig.patch \
+ file://0001-build-Pass-tag-CC-explictly-when-using-libtool.patch \
+ "
+
+UPSTREAM_CHECK_REGEX = "SDL-(?P<pver>\d+(\.\d+)+)\.tar"
+
+S = "${WORKDIR}/SDL-${PV}"
+
+SRC_URI[md5sum] = "9d96df8417572a2afb781a7c4c811a85"
+SRC_URI[sha256sum] = "d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00"
+
+BINCONFIG = "${bindir}/sdl-config"
+
+inherit autotools lib_package binconfig-disabled pkgconfig
+
+EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers \
+ --enable-file --disable-oss --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas \
+ --disable-mintaudio --disable-nasm --disable-video-dga \
+ --disable-video-fbcon --disable-video-ps2gs --disable-video-ps3 \
+ --disable-xbios --disable-gem --disable-video-dummy \
+ --enable-input-events --enable-pthreads \
+ --disable-video-svga \
+ --disable-video-picogui --disable-video-qtopia --enable-sdl-dlopen \
+ --disable-rpath"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'opengl', '', d)}"
+PACKAGECONFIG_class-native = "x11"
+PACKAGECONFIG_class-nativesdk = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+
+PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib] = "--enable-input-tslib, --disable-input-tslib, tslib"
+PACKAGECONFIG[directfb] = "--enable-video-directfb, --disable-video-directfb, directfb"
+PACKAGECONFIG[opengl] = "--enable-video-opengl, --disable-video-opengl, virtual/libgl libglu"
+PACKAGECONFIG[x11] = "--enable-video-x11 --disable-x11-shared, --disable-video-x11, virtual/libx11 libxext libxrandr libxrender"
+
+# The following two options should only enabled with mingw support
+PACKAGECONFIG[stdio-redirect] = "--enable-stdio-redirect,--disable-stdio-redirect"
+PACKAGECONFIG[directx] = "--enable-directx,--disable-directx"
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+
+do_configure_prepend() {
+ # Remove old libtool macros.
+ MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+ for i in ${MACROS}; do
+ rm -f ${S}/acinclude/$i
+ done
+ export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb b/poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
new file mode 100644
index 000000000..c0cf70d7f
--- /dev/null
+++ b/poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
@@ -0,0 +1,65 @@
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
+HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
+SECTION = "libs"
+
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=02ee26814dd044bd7838ae24e05b880f"
+
+PROVIDES = "virtual/libsdl2"
+
+DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
+
+SRC_URI = " \
+ http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
+"
+
+S = "${WORKDIR}/SDL2-${PV}"
+
+SRC_URI[md5sum] = "3800d705cef742c6a634f202c37f263f"
+SRC_URI[sha256sum] = "edc77c57308661d576e843344d8638e025a7818bff73f8fbfab09c3c5fd092ec"
+
+inherit autotools lib_package binconfig pkgconfig
+
+EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
+ --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+ --disable-video-dummy \
+ --enable-pthreads \
+ --enable-sdl-dlopen \
+ --disable-rpath \
+ "
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to pick either (desktop) opengl, gles2, or no GL
+PACKAGECONFIG_GL ?= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
+
+PACKAGECONFIG ??= " \
+ ${PACKAGECONFIG_GL} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa directfb pulseaudio x11', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland gles2', '', d)} \
+"
+PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+PACKAGECONFIG[directfb] = "--enable-video-directfb,--disable-video-directfb,directfb"
+PACKAGECONFIG[gles2] = "--enable-video-opengles,--disable-video-opengles,virtual/libgles2"
+PACKAGECONFIG[opengl] = "--enable-video-opengl,--disable-video-opengl,virtual/libgl"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib] = "--enable-input-tslib,--disable-input-tslib,tslib"
+PACKAGECONFIG[wayland] = "--enable-video-wayland,--disable-video-wayland,wayland-native wayland wayland-protocols libxkbcommon"
+PACKAGECONFIG[x11] = "--enable-video-x11,--disable-video-x11,virtual/libx11 libxext libxrandr libxrender"
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+
+do_configure_prepend() {
+ # Remove old libtool macros.
+ MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+ for i in ${MACROS}; do
+ rm -f ${S}/acinclude/$i
+ done
+ export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+FILES_${PN}-dev += "${libdir}/cmake"
diff --git a/poky/meta/recipes-graphics/libva/libva-utils_2.1.0.bb b/poky/meta/recipes-graphics/libva/libva-utils_2.1.0.bb
new file mode 100644
index 000000000..a8018ea72
--- /dev/null
+++ b/poky/meta/recipes-graphics/libva/libva-utils_2.1.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "libva-utils is a collection of utilities from libva project"
+
+DESCRIPTION = "libva-utils is a collection of utilities \
+and examples to exercise VA-API in accordance with the libva \
+project.VA-API is an open-source library and API specification, \
+which provides access to graphics hardware acceleration capabilities \
+for video processing. It consists of a main library and driver-specific \
+acceleration backends for each supported hardware vendor"
+
+HOMEPAGE = "https://01.org/linuxmedia/vaapi"
+BUGTRACKER = "https://github.com/intel/libva-utils/issues"
+
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b148fc8adf19dc9aec17cf9cd29a9a5e"
+
+SRC_URI = "https://github.com/intel/${BPN}/releases/download/${PV}/${BP}.tar.bz2"
+SRC_URI[md5sum] = "6649be70390606651cb636320bfd43c6"
+SRC_URI[sha256sum] = "f6a7790c3dcc56537372c90a83036a3136194a8b397e84e97bf9cc9254fa2c51"
+
+UPSTREAM_CHECK_URI = "https://github.com/intel/libva-utils/releases"
+
+DEPENDS = "libva"
+
+inherit autotools pkgconfig distro_features_check
+
+# depends on libva which requires opengl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxext libxfixes"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland-native wayland"
diff --git a/poky/meta/recipes-graphics/libva/libva_2.1.0.bb b/poky/meta/recipes-graphics/libva/libva_2.1.0.bb
new file mode 100644
index 000000000..d3cf6334c
--- /dev/null
+++ b/poky/meta/recipes-graphics/libva/libva_2.1.0.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Video Acceleration (VA) API for Linux"
+DESCRIPTION = "Video Acceleration API (VA API) is a library (libVA) \
+and API specification which enables and provides access to graphics \
+hardware (GPU) acceleration for video processing on Linux and UNIX \
+based operating systems. Accelerated processing includes video \
+decoding, video encoding, subpicture blending and rendering. The \
+specification was originally designed by Intel for its GMA (Graphics \
+Media Accelerator) series of GPU hardware, the API is however not \
+limited to GPUs or Intel specific hardware, as other hardware and \
+manufacturers can also freely use this API for hardware accelerated \
+video decoding."
+
+HOMEPAGE = "https://01.org/linuxmedia/vaapi"
+BUGTRACKER = "https://github.com/intel/libva/issues"
+
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e48940f94acb0af582e5ef03537800f"
+
+SRC_URI = "https://github.com/intel/${BPN}/releases/download/${PV}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "9d6e4f1d36c407566343e9dde5a972b8"
+SRC_URI[sha256sum] = "f3fa953a11d3210c3a4ee79031abdbe0863d5ce13d9b3f93f315f1eec60a4b0f"
+
+UPSTREAM_CHECK_URI = "https://github.com/intel/libva/releases"
+
+DEPENDS = "libdrm virtual/mesa"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+EXTRA_OECONF = "ac_cv_prog_WAYLAND_SCANNER=wayland-scanner"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxext libxfixes"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland-native wayland"
+
+PACKAGES =+ "${PN}-x11 ${PN}-glx ${PN}-wayland"
+
+RDEPENDS_${PN}-x11 =+ "${PN}"
+RDEPENDS_${PN}-glx =+ "${PN}-x11"
+
+FILES_${PN}-x11 =+ "${libdir}/libva-x11*${SOLIBS}"
+FILES_${PN}-glx =+ "${libdir}/libva-glx*${SOLIBS}"
+FILES_${PN}-wayland =+ "${libdir}/libva-wayland*${SOLIBS}"
diff --git a/poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session b/poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session
new file mode 100644
index 000000000..4d6caa0c5
--- /dev/null
+++ b/poky/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Very simple session manager for matchbox tools
+#
+
+# Uncomment below to enable parsing of debian menu entrys
+# export MB_USE_DEB_MENUS=1
+
+if [ -e $HOME/.matchbox/session ]
+then
+exec $HOME/.matchbox/session
+fi
+
+if [ -e /etc/matchbox/session ]
+then
+exec /etc/matchbox/session
+fi
+
+# Default files to run if $HOME/.matchbox/session or /etc/matchbox/session
+# dont exist.
+
+matchbox-desktop &
+matchbox-panel &
+exec matchbox-window-manager $@
diff --git a/poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb b/poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb
new file mode 100644
index 000000000..cbaf05436
--- /dev/null
+++ b/poky/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Custom Matchbox session files"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://matchbox-session;endline=20;md5=180f1c169a15d059a56c30094f6fb5ea"
+
+SECTION = "x11"
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRC_URI = "file://matchbox-session"
+S = "${WORKDIR}"
+
+PR = "r4"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "x-session-manager"
+ALTERNATIVE_TARGET[x-session-manager] = "${bindir}/matchbox-session"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${S}/matchbox-session ${D}/${bindir}
+}
diff --git a/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig b/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig
new file mode 100644
index 000000000..239da8f57
--- /dev/null
+++ b/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig
@@ -0,0 +1,42 @@
+#
+# This is an example keyboard config file for matchbox
+#
+# You can edit this file or change per user by copying to
+# ~/.matchbox/kbdconfig
+#
+# Se the matchbox manual for more info ( http://projects.o-hand.com/matchbox )
+
+### Window operation short cuts
+
+<Alt>n=next
+<Alt>p=prev
+<Alt>c=close
+<Alt>d=desktop
+<Alt>m=!matchbox-remote -mbmenu
+
+### App launching.
+
+<ctrl><alt>x=!xterm
+<ctrl><alt>r=!rxvt
+
+### poky additions
+
+XF86Calendar=!$contacts
+telephone=!$dates
+XF86Start=!matchbox-remote -desktop
+F2=!matchbox-remote -mbmenu
+
+#XF86Mail=!$tasks
+#Escape=close
+
+### windows style key shortcuts
+
+<alt>Tab=next
+<alt><shift>Tab=prev
+
+<alt>space=taskmenu
+<alt>escape=!matchbox-remote -mbmenu
+<alt>f4=close
+
+f11=fullscreen
+
diff --git a/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb b/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb
new file mode 100644
index 000000000..815a75f36
--- /dev/null
+++ b/poky/meta/recipes-graphics/matchbox-wm/matchbox-wm_1.2.2.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Matchbox lightweight window manager"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/wm.h;endline=21;md5=a7e844465edbcf79c282369f93caa835 \
+ file://src/main.c;endline=21;md5=3e5d9f832b527b0d72dbe8e3c4c60b95 \
+ file://src/wm.c;endline=21;md5=8dc9d24477d87ef5dfbc2e4927146aab"
+
+SECTION = "x11/wm"
+DEPENDS = "libmatchbox virtual/libx11 libxext libxrender startup-notification expat gconf libxcursor libxfixes"
+
+# SRCREV tagged 1.2.2
+SRCREV = "27da947e7fbdf9659f7e5bd1e92af92af6c03970"
+SRC_URI = "git://git.yoctoproject.org/matchbox-window-manager \
+ file://kbdconfig"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+FILES_${PN} = "${bindir}/* \
+ ${datadir}/matchbox \
+ ${sysconfdir}/matchbox \
+ ${datadir}/themes/blondie/matchbox \
+ ${datadir}/themes/Default/matchbox \
+ ${datadir}/themes/MBOpus/matchbox"
+
+EXTRA_OECONF = " --enable-startup-notification \
+ --disable-xrm \
+ --enable-expat \
+ --with-expat-lib=${STAGING_LIBDIR} \
+ --with-expat-includes=${STAGING_INCDIR}"
+
+do_install_prepend() {
+ install ${WORKDIR}/kbdconfig ${S}/data/kbdconfig
+}
diff --git a/poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb b/poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb
new file mode 100644
index 000000000..71540cf1d
--- /dev/null
+++ b/poky/meta/recipes-graphics/menu-cache/menu-cache_1.0.2.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Library for caching application menus"
+DESCRIPTION = "A library creating and utilizing caches to speed up freedesktop.org application menus"
+HOMEPAGE = "http://lxde.sourceforge.net/"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0964c689fcf4c21c6797ea87408416b6"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/menu-cache-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "8dde7a3f5bd9798d0129d1979a5d7640"
+SRC_URI[sha256sum] = "6f83edf2de34f83e701dcb52145d755250a5677580cd413476cc4d7f2d2012d5"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lxde/files/menu-cache/1.0/"
+
+inherit autotools gettext pkgconfig gtk-doc
diff --git a/poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch b/poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch
new file mode 100644
index 000000000..f908d4655
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch
@@ -0,0 +1,42 @@
+From 342311dbb190735b7b32ab20f81c1d8dbcfe717a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 11 Oct 2017 15:40:42 +0800
+Subject: [PATCH] Makefile.vulkan.am: explictly add lib expat to intel
+ libvulkan's lib depends
+
+While built with "-fvisibility=default"
+...
+|i586-oe-linux-gcc ... -fvisibility=default ... -o common/.libs/common_libintel_common_la-gen_decoder.o
+...
+
+It triggered the failure
+...
+|i586-oe-linux-g++ ... common/.libs/libintel_common.a ... -o vulkan/.libs/libvulkan_intel.so
+|common/.libs/libintel_common.a(common_libintel_common_la-gen_decoder.o):
+|In function `start_element':
+|/usr/src/debug/mesa/2_17.1.7-r0/mesa-17.1.7/src/intel/common/gen_decoder.c:371:
+undefined reference to `XML_GetCurrentLineNumber'
+...
+
+explictly add EXPAT_LIBS to intel's VULKAN_LIB_DEPS
+
+Upstream-Status: Accepted
+https://cgit.freedesktop.org/mesa/mesa/commit/?id=05fc62d89f59ce19a18bfd4e63a09624910d6caf
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ src/intel/Makefile.vulkan.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: mesa-17.3.6/src/intel/Makefile.vulkan.am
+===================================================================
+--- mesa-17.3.6.orig/src/intel/Makefile.vulkan.am
++++ mesa-17.3.6/src/intel/Makefile.vulkan.am
+@@ -144,6 +144,7 @@ VULKAN_LIB_DEPS = \
+ $(LIBDRM_LIBS) \
+ $(PTHREAD_LIBS) \
+ $(DLOPEN_LIBS) \
++ $(EXPAT_LIBS) \
+ -lm
+
+ if HAVE_PLATFORM_ANDROID
diff --git a/poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch b/poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
new file mode 100644
index 000000000..2444b2846
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/0001-Use-wayland-scanner-in-the-path.patch
@@ -0,0 +1,34 @@
+From c908f0c13ac81a3a52140f129a13b2bc997ff4ee Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 15 Nov 2016 15:20:49 +0200
+Subject: [PATCH] Simplify wayland-scanner lookup
+
+Don't use pkg-config to lookup the path of a binary that's in the path.
+
+Alternatively we'd have to prefix the path returned by pkg-config with
+PKG_CONFIG_SYSROOT_DIR.
+
+Upstream-Status: Pending
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+Index: mesa-17.3.6/configure.ac
+===================================================================
+--- mesa-17.3.6.orig/configure.ac
++++ mesa-17.3.6/configure.ac
+@@ -1694,12 +1694,7 @@ if test "x$with_platforms" = xauto; then
+ with_platforms=$with_egl_platforms
+ fi
+
+-PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
+- WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,
+- WAYLAND_SCANNER='')
+-if test "x$WAYLAND_SCANNER" = x; then
+- AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
+-fi
++AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
+
+ PKG_CHECK_EXISTS([wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED], [have_wayland_protocols=yes], [have_wayland_protocols=no])
+ if test "x$have_wayland_protocols" = xyes; then
diff --git a/poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch b/poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch
new file mode 100644
index 000000000..6aba7859e
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch
@@ -0,0 +1,43 @@
+From 4cbecb61682a0ee426faaa03d824fc8fd7aef826 Mon Sep 17 00:00:00 2001
+From: Daniel Stone <daniels@collabora.com>
+Date: Mon, 2 Apr 2018 13:20:34 +0100
+Subject: [PATCH] st/dri: Initialise modifier to INVALID for DRI2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When allocating a buffer for DRI2, set the modifier to INVALID to inform
+the backend that we have no supplied modifiers and it should do its own
+thing. The missed initialisation forced linear, even if the
+implementation had made other decisions.
+
+This resulted in VC4 DRI2 clients failing with:
+ Modifier 0x0 vs. tiling (0x700000000000001) mismatch
+
+Signed-off-by: Daniel Stone <daniels@collabora.com>
+Reported-by: Andreas Müller <schnitzeltony@gmail.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Fixes: 3f8513172ff6 ("gallium/winsys/drm: introduce modifier field to winsys_handle")
+
+Upstream-Status: Backport [1]
+
+[1] https://cgit.freedesktop.org/mesa/mesa/commit/?id=4cbecb61682a0ee426faaa03d824fc8fd7aef826
+---
+ src/gallium/state_trackers/dri/dri2.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
+index 31d17d46c2..58a6757f03 100644
+--- a/src/gallium/state_trackers/dri/dri2.c
++++ b/src/gallium/state_trackers/dri/dri2.c
+@@ -806,6 +806,7 @@ dri2_allocate_textures(struct dri_context *ctx,
+ whandle.handle = buf->name;
+ whandle.stride = buf->pitch;
+ whandle.offset = 0;
++ whandle.modifier = DRM_FORMAT_MOD_INVALID;
+ if (screen->can_share_buffer)
+ whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+ else
+--
+2.14.3
+
diff --git a/poky/meta/recipes-graphics/mesa/files/0001-winsys-svga-drm-Include-sys-types.h.patch b/poky/meta/recipes-graphics/mesa/files/0001-winsys-svga-drm-Include-sys-types.h.patch
new file mode 100644
index 000000000..549b8671a
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/0001-winsys-svga-drm-Include-sys-types.h.patch
@@ -0,0 +1,34 @@
+From d8750776404b1031d762966d0f551d13d2fe05a7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Aug 2017 18:58:20 -0700
+Subject: [PATCH] winsys/svga/drm: Include sys/types.h
+
+vmw_screen.h uses dev_t which is defines in sys/types.h
+this header is required to be included for getting dev_t
+definition. This issue happens on musl C library, it is hidden
+on glibc since sys/types.h is included through another
+system headers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+
+Upstream-Status: Submitted
+
+ src/gallium/winsys/svga/drm/vmw_screen.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
+index 0ef8e84..2eda97e 100644
+--- a/src/gallium/winsys/svga/drm/vmw_screen.h
++++ b/src/gallium/winsys/svga/drm/vmw_screen.h
+@@ -41,6 +41,7 @@
+ #include "svga_winsys.h"
+ #include "pipebuffer/pb_buffer_fenced.h"
+ #include <os/os_thread.h>
++#include <sys/types.h>
+
+ #define VMW_GMR_POOL_SIZE (16*1024*1024)
+ #define VMW_QUERY_POOL_SIZE (8192)
+--
+2.14.1
+
diff --git a/poky/meta/recipes-graphics/mesa/files/0002-hardware-gloat.patch b/poky/meta/recipes-graphics/mesa/files/0002-hardware-gloat.patch
new file mode 100644
index 000000000..0e014dcc8
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/0002-hardware-gloat.patch
@@ -0,0 +1,51 @@
+From 00bcd599310dc7fce4fe336ffd85902429051a0c Mon Sep 17 00:00:00 2001
+From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+Date: Sun, 20 Mar 2016 13:27:04 +0100
+Subject: [PATCH 2/4] hardware gloat
+
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
+---
+ src/gallium/drivers/llvmpipe/lp_screen.c | 7 +++++++
+ src/gallium/drivers/softpipe/sp_screen.c | 7 +++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
+index 4f61de8..3b0ec77 100644
+--- a/src/gallium/drivers/llvmpipe/lp_screen.c
++++ b/src/gallium/drivers/llvmpipe/lp_screen.c
+@@ -411,6 +411,13 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
+ if (!format_desc)
+ return FALSE;
+
++ if ((bind & PIPE_BIND_RENDER_TARGET) &&
++ format != PIPE_FORMAT_R9G9B9E5_FLOAT &&
++ format != PIPE_FORMAT_R11G11B10_FLOAT &&
++ util_format_is_float(format)) {
++ return FALSE;
++ }
++
+ assert(target == PIPE_BUFFER ||
+ target == PIPE_TEXTURE_1D ||
+ target == PIPE_TEXTURE_1D_ARRAY ||
+diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
+index 031602b..c279120 100644
+--- a/src/gallium/drivers/softpipe/sp_screen.c
++++ b/src/gallium/drivers/softpipe/sp_screen.c
+@@ -358,6 +358,13 @@ softpipe_is_format_supported( struct pipe_screen *screen,
+ if (!format_desc)
+ return FALSE;
+
++ if ((bind & PIPE_BIND_RENDER_TARGET) &&
++ format != PIPE_FORMAT_R9G9B9E5_FLOAT &&
++ format != PIPE_FORMAT_R11G11B10_FLOAT &&
++ util_format_is_float(format)) {
++ return FALSE;
++ }
++
+ if (sample_count > 1)
+ return FALSE;
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch b/poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch
new file mode 100644
index 000000000..0b4aabf97
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/Use-Python-3-to-execute-the-scripts.patch
@@ -0,0 +1,32 @@
+From 18c3e684a8259a0644214f88c7ead7fa31573fd9 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 29 Dec 2017 10:27:59 -0200
+Subject: [PATCH] Use Python 3 to execute the scripts
+Organization: O.S. Systems Software LTDA.
+
+The MESA build system uses Python 2 but as OE-Core has moved away from
+it, we change it to use Python 3 instead.
+
+Upstream-Status: Inappropriate [ configuration ]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b107f04c2e..055546142d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -114,7 +114,7 @@ AC_PROG_CXX
+ AM_PROG_CC_C_O
+ AM_PROG_AS
+ AX_CHECK_GNU_MAKE
+-AC_CHECK_PROGS([PYTHON2], [python2.7 python2 python])
++AC_CHECK_PROGS([PYTHON2], [python3.5 python3 python])
+ AC_PROG_SED
+ AC_PROG_MKDIR_P
+
+--
+2.15.1
+
diff --git a/poky/meta/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch b/poky/meta/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch
new file mode 100644
index 000000000..d2d67558b
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/disable-asm-on-non-gcc.patch
@@ -0,0 +1,29 @@
+Configure checks for compiler to be gcc and then it enables asm_offsets
+generation. see
+
+https://cgit.freedesktop.org/mesa/mesa/commit/?id=73c9b4b0e05fc66629ba250846948dc55c0e7a0d
+
+However, we missed the check when enabling this on cross compilation
+when architecture for both host and target is x86
+
+Fixes errors like
+./gen_matypes > matypes.h
+/bin/bash: ./gen_matypes: No such file or directory
+
+-Khem
+
+Upstream-Status: Submitted
+
+Index: mesa-12.0.1/configure.ac
+===================================================================
+--- mesa-12.0.1.orig/configure.ac
++++ mesa-12.0.1/configure.ac
+@@ -732,7 +732,7 @@ test "x$enable_asm" = xno && AC_MSG_RESU
+ if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then
+ case "$host_cpu" in
+ i?86 | x86_64 | amd64)
+- if test "x$host_cpu" != "x$target_cpu"; then
++ if test "x$host_cpu" != "x$target_cpu" -o "x$acv_mesa_CLANG" = xyes; then
+ enable_asm=no
+ AC_MSG_RESULT([no, cross compiling])
+ fi
diff --git a/poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch b/poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch
new file mode 100644
index 000000000..fd79991aa
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/files/llvm-config-version.patch
@@ -0,0 +1,41 @@
+From: Otavio Salvador <otavio@ossystems.com.br>
+Subject: [PATCH] Properly get LLVM version when using LLVM Git releases
+
+$ llvm-config-host --version
+5.0.0git-9a5c333388c
+
+We need to ignore everything after 5.0.0 which is what the cut cmd is
+doing
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a02173f244..b107f04c2e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -995,7 +995,7 @@ strip_unwanted_llvm_flags() {
+
+ llvm_set_environment_variables() {
+ if test "x$LLVM_CONFIG" != xno; then
+- LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
++ LLVM_VERSION=`$LLVM_CONFIG --version | cut -c1-5`
+ LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
+ LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
+ LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
+@@ -2644,7 +2644,7 @@ detect_old_buggy_llvm() {
+ dnl ourselves.
+ dnl (See https://llvm.org/bugs/show_bug.cgi?id=6823)
+ dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
+- LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
++ LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version | cut -c1-5`
+ AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.$IMP_LIB_EXT"], [llvm_have_one_so=yes])
+
+ if test "x$llvm_have_one_so" = xyes; then
+--
+2.15.1
+
diff --git a/poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
new file mode 100644
index 000000000..eeb898fd3
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/libglu_9.0.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "The OpenGL utility toolkit"
+DESCRIPTION = "GLU is a utility toolkit used with OpenGL implementations"
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b356456e7d44471d9 \
+ file://src/libtess/tess.c;endline=29;md5=6b79c570f644363b356456e7d44471d9"
+
+# Epoch as this used to be part of mesa
+PE = "2"
+PR = "0"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/glu/glu-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "be9249132ff49275461cf92039083030"
+SRC_URI[sha256sum] = "1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12"
+
+S = "${WORKDIR}/glu-${PV}"
+
+DEPENDS = "virtual/libgl"
+
+inherit autotools pkgconfig distro_features_check
+
+# Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11 opengl"
+
+# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
+RDEPENDS_${PN}-dev = ""
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
new file mode 100644
index 000000000..93ee9c286
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
@@ -0,0 +1,624 @@
+From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Mon, 12 May 2014 15:22:32 -0400
+Subject: [PATCH 1/9] mesa-demos: Add missing data files.
+
+Add some data files that are present in the git repository:
+ http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0
+but not in the release tarball
+ ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2
+
+Upstream-Status: Backport
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/depth-read.glsl | 4 +
+ src/fpglsl/infinite-loop.glsl | 7 +
+ src/glsl/CH11-bumpmaptex.frag | 47 +++++++
+ src/glsl/blinking-teapot.frag | 31 +++++
+ src/glsl/blinking-teapot.vert | 16 +++
+ src/glsl/convolution.frag | 21 +++
+ src/glsl/simplex-noise.glsl | 279 ++++++++++++++++++++++++++++++++++++++++
+ src/glsl/skinning.vert | 24 ++++
+ src/perf/glslstateschange1.frag | 19 +++
+ src/perf/glslstateschange1.vert | 14 ++
+ src/perf/glslstateschange2.frag | 17 +++
+ src/perf/glslstateschange2.vert | 14 ++
+ src/vpglsl/infinite-loop.glsl | 8 ++
+ 13 files changed, 501 insertions(+)
+ create mode 100644 src/fpglsl/depth-read.glsl
+ create mode 100644 src/fpglsl/infinite-loop.glsl
+ create mode 100644 src/glsl/CH11-bumpmaptex.frag
+ create mode 100644 src/glsl/blinking-teapot.frag
+ create mode 100644 src/glsl/blinking-teapot.vert
+ create mode 100644 src/glsl/convolution.frag
+ create mode 100644 src/glsl/simplex-noise.glsl
+ create mode 100644 src/glsl/skinning.vert
+ create mode 100644 src/perf/glslstateschange1.frag
+ create mode 100644 src/perf/glslstateschange1.vert
+ create mode 100644 src/perf/glslstateschange2.frag
+ create mode 100644 src/perf/glslstateschange2.vert
+ create mode 100644 src/vpglsl/infinite-loop.glsl
+
+diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl
+new file mode 100644
+index 0000000..86d298e
+--- /dev/null
++++ b/src/fpglsl/depth-read.glsl
+@@ -0,0 +1,4 @@
++void main()
++{
++ gl_FragColor = gl_FragCoord.zzzz;
++}
+diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..c6dc6ee
+--- /dev/null
++++ b/src/fpglsl/infinite-loop.glsl
+@@ -0,0 +1,7 @@
++void main() {
++ vec4 sum = vec4(0);
++ for (int i = 1; i != 2; i += 2) {
++ sum += vec4(0.1, 0.1, 0.1, 0.1);
++ }
++ gl_FragColor = sum;
++}
+diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag
+new file mode 100644
+index 0000000..b5dabb4
+--- /dev/null
++++ b/src/glsl/CH11-bumpmaptex.frag
+@@ -0,0 +1,47 @@
++//
++// Fragment shader for procedural bumps
++//
++// Authors: John Kessenich, Randi Rost
++//
++// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
++//
++// See 3Dlabs-License.txt for license information
++//
++// Texture mapping/modulation added by Brian Paul
++//
++
++varying vec3 LightDir;
++varying vec3 EyeDir;
++
++uniform float BumpDensity; // = 16.0
++uniform float BumpSize; // = 0.15
++uniform float SpecularFactor; // = 0.5
++
++uniform sampler2D Tex;
++
++void main()
++{
++ vec3 ambient = vec3(0.25);
++ vec3 litColor;
++ vec2 c = BumpDensity * gl_TexCoord[0].st;
++ vec2 p = fract(c) - vec2(0.5);
++
++ float d, f;
++ d = p.x * p.x + p.y * p.y;
++ f = inversesqrt(d + 1.0);
++
++ if (d >= BumpSize)
++ { p = vec2(0.0); f = 1.0; }
++
++ vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz;
++
++ vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
++ litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0));
++ vec3 reflectDir = reflect(LightDir, normDelta);
++
++ float spec = max(dot(EyeDir, reflectDir), 0.0);
++ spec *= SpecularFactor;
++ litColor = min(litColor + spec, vec3(1.0));
++
++ gl_FragColor = vec4(litColor, 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag
+new file mode 100644
+index 0000000..0db060b
+--- /dev/null
++++ b/src/glsl/blinking-teapot.frag
+@@ -0,0 +1,31 @@
++#extension GL_ARB_uniform_buffer_object : enable
++
++layout(std140) uniform colors0
++{
++ float DiffuseCool;
++ float DiffuseWarm;
++ vec3 SurfaceColor;
++ vec3 WarmColor;
++ vec3 CoolColor;
++ vec4 some[8];
++};
++
++varying float NdotL;
++varying vec3 ReflectVec;
++varying vec3 ViewVec;
++
++void main (void)
++{
++
++ vec3 kcool = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
++ vec3 kwarm = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
++ vec3 kfinal = mix(kcool, kwarm, NdotL);
++
++ vec3 nreflect = normalize(ReflectVec);
++ vec3 nview = normalize(ViewVec);
++
++ float spec = max(dot(nreflect, nview), 0.0);
++ spec = pow(spec, 32.0);
++
++ gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert
+new file mode 100644
+index 0000000..397d733
+--- /dev/null
++++ b/src/glsl/blinking-teapot.vert
+@@ -0,0 +1,16 @@
++vec3 LightPosition = vec3(0.0, 10.0, 4.0);
++
++varying float NdotL;
++varying vec3 ReflectVec;
++varying vec3 ViewVec;
++
++void main(void)
++{
++ vec3 ecPos = vec3 (gl_ModelViewMatrix * gl_Vertex);
++ vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
++ vec3 lightVec = normalize(LightPosition - ecPos);
++ ReflectVec = normalize(reflect(-lightVec, tnorm));
++ ViewVec = normalize(-ecPos);
++ NdotL = (dot(lightVec, tnorm) + 1.0) * 0.5;
++ gl_Position = ftransform();
++}
+diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag
+new file mode 100644
+index 0000000..e49b8ac
+--- /dev/null
++++ b/src/glsl/convolution.frag
+@@ -0,0 +1,21 @@
++
++const int KernelSize = 9;
++
++//texture offsets
++uniform vec2 Offset[KernelSize];
++//convolution kernel
++uniform vec4 KernelValue[KernelSize];
++uniform sampler2D srcTex;
++uniform vec4 ScaleFactor;
++uniform vec4 BaseColor;
++
++void main(void)
++{
++ int i;
++ vec4 sum = vec4(0.0);
++ for (i = 0; i < KernelSize; ++i) {
++ vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
++ sum += tmp * KernelValue[i];
++ }
++ gl_FragColor = sum * ScaleFactor + BaseColor;
++}
+diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl
+new file mode 100644
+index 0000000..b6833cb
+--- /dev/null
++++ b/src/glsl/simplex-noise.glsl
+@@ -0,0 +1,279 @@
++//
++// Description : Array and textureless GLSL 2D/3D/4D simplex
++// noise functions.
++// Author : Ian McEwan, Ashima Arts.
++// Maintainer : ijm
++// Lastmod : 20110223
++// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
++// Distributed under the Artistic License 2.0; See LICENCE file.
++//
++
++#define NORMALIZE_GRADIENTS
++#undef USE_CIRCLE
++#define COLLAPSE_SORTNET
++
++float permute(float x0,vec3 p) {
++ float x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec2 permute(vec2 x0,vec3 p) {
++ vec2 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec3 permute(vec3 x0,vec3 p) {
++ vec3 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++vec4 permute(vec4 x0,vec3 p) {
++ vec4 x1 = mod(x0 * p.y, p.x);
++ return floor( mod( (x1 + p.z) *x0, p.x ));
++ }
++
++uniform vec4 pParam;
++// Example
++// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.);
++
++float taylorInvSqrt(float r)
++ {
++ return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r );
++ }
++
++float simplexNoise2(vec2 v)
++ {
++ const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.;
++ 0.366025403784438597); // 0.5*(sqrt(3.0)-1.);
++ const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312;
++// First corner
++ vec2 i = floor(v + dot(v, C.yy) );
++ vec2 x0 = v - i + dot(i, C.xx);
++
++// Other corners
++ vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ;
++
++ // x0 = x0 - 0. + 0. * C
++ vec2 x1 = x0 - i1 + 1. * C.xx ;
++ vec2 x2 = x0 - 1. + 2. * C.xx ;
++
++// Permutations
++ i = mod(i, pParam.x);
++ vec3 p = permute( permute(
++ i.y + vec3(0., i1.y, 1. ), pParam.xyz)
++ + i.x + vec3(0., i1.x, 1. ), pParam.xyz);
++
++#ifndef USE_CIRCLE
++// ( N points uniformly over a line, mapped onto a diamond.)
++ vec3 x = fract(p / pParam.w) ;
++ vec3 h = 0.5 - abs(x) ;
++
++ vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.;
++ vec3 sh = vec3(lessThan(h,D.xxx));
++
++ vec3 a0 = x + sx*sh;
++ vec2 p0 = vec2(a0.x,h.x);
++ vec2 p1 = vec2(a0.y,h.y);
++ vec2 p2 = vec2(a0.z,h.z);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++#endif
++
++ vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) );
++#else
++// N points around a unit circle.
++ vec3 phi = D.z * mod(p,pParam.w) /pParam.w ;
++ vec4 a0 = sin(phi.xxyy+D.xyxy);
++ vec2 a1 = sin(phi.zz +D.xy);
++ vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) );
++#endif
++// mix
++ vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++ m = m*m ;
++ return 1.66666* 70.*dot(m*m, g);
++ }
++
++float simplexNoise3(vec3 v)
++ {
++ const vec2 C = vec2(1./6. , 1./3. ) ;
++ const vec4 D = vec4(0., 0.5, 1.0, 2.0);
++
++// First corner
++ vec3 i = floor(v + dot(v, C.yyy) );
++ vec3 x0 = v - i + dot(i, C.xxx) ;
++
++// Other corners
++#ifdef COLLAPSE_SORTNET
++ vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) );
++ vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) );
++
++ vec3 i1 = g.xyz * l.zxy;
++ vec3 i2 = max( g.xyz, l.zxy);
++#else
++// Keeping this clean - let the compiler optimize.
++ vec3 q1;
++ q1.x = max(x0.x, x0.y);
++ q1.y = min(x0.x, x0.y);
++ q1.z = x0.z;
++
++ vec3 q2;
++ q2.x = max(q1.x,q1.z);
++ q2.z = min(q1.x,q1.z);
++ q2.y = q1.y;
++
++ vec3 q3;
++ q3.y = max(q2.y, q2.z);
++ q3.z = min(q2.y, q2.z);
++ q3.x = q2.x;
++
++ vec3 i1 = vec3(equal(q3.xxx, x0));
++ vec3 i2 = i1 + vec3(equal(q3.yyy, x0));
++#endif
++
++ // x0 = x0 - 0. + 0. * C
++ vec3 x1 = x0 - i1 + 1. * C.xxx;
++ vec3 x2 = x0 - i2 + 2. * C.xxx;
++ vec3 x3 = x0 - 1. + 3. * C.xxx;
++
++// Permutations
++ i = mod(i, pParam.x );
++ vec4 p = permute( permute( permute(
++ i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz)
++ + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz)
++ + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz);
++
++// Gradients
++// ( N*N points uniformly over a square, mapped onto a octohedron.)
++ float n_ = 1.0/pParam.w ;
++ vec3 ns = n_ * D.wyz - D.xzx ;
++
++ vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N)
++
++ vec4 x_ = floor(j * ns.z) ;
++ vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N)
++
++ vec4 x = x_ *ns.x + ns.yyyy;
++ vec4 y = y_ *ns.x + ns.yyyy;
++ vec4 h = 1. - abs(x) - abs(y);
++
++ vec4 b0 = vec4( x.xy, y.xy );
++ vec4 b1 = vec4( x.zw, y.zw );
++
++ vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.;
++ vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.;
++ vec4 sh = vec4(lessThan(h, D.xxxx));
++
++ vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
++ vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
++
++ vec3 p0 = vec3(a0.xy,h.x);
++ vec3 p1 = vec3(a0.zw,h.y);
++ vec3 p2 = vec3(a1.xy,h.z);
++ vec3 p3 = vec3(a1.zw,h.w);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++ p3 *= taylorInvSqrt(dot(p3,p3));
++#endif
++
++// Mix
++ vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
++ m = m * m;
++//used to be 64.
++ return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
++ dot(p2,x2), dot(p3,x3) ) );
++ }
++
++vec4 grad4(float j, vec4 ip)
++ {
++ const vec4 ones = vec4(1.,1.,1.,-1.);
++ vec4 p,s;
++
++ p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0;
++ p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
++ s = vec4(lessThan(p,vec4(0.)));
++ p.xyz = p.xyz + (s.xyz*2.-1.) * s.www;
++
++ return p;
++ }
++
++float simplexNoise4(vec4 v)
++ {
++ const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
++ 0.309016994374947451); // (sqrt(5) - 1)/4 F4
++// First corner
++ vec4 i = floor(v + dot(v, C.yyyy) );
++ vec4 x0 = v - i + dot(i, C.xxxx);
++
++// Other corners
++
++// Force existance of strict total ordering in sort.
++ vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.);
++ vec4 q1;
++ q1.xy = max(q0.xy,q0.zw); // x:z y:w
++ q1.zw = min(q0.xy,q0.zw);
++
++ vec4 q2;
++ q2.xz = max(q1.xz,q1.yw); // x:y z:w
++ q2.yw = min(q1.xz,q1.yw);
++
++ vec4 q3;
++ q3.y = max(q2.y,q2.z); // y:z
++ q3.z = min(q2.y,q2.z);
++ q3.xw = q2.xw;
++
++ vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0));
++ vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0));
++ vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0));
++
++ // x0 = x0 - 0. + 0. * C
++ vec4 x1 = x0 - i1 + 1. * C.xxxx;
++ vec4 x2 = x0 - i2 + 2. * C.xxxx;
++ vec4 x3 = x0 - i3 + 3. * C.xxxx;
++ vec4 x4 = x0 - 1. + 4. * C.xxxx;
++
++// Permutations
++ i = mod(i, pParam.x );
++ float j0 = permute( permute( permute( permute (
++ i.w, pParam.xyz) + i.z, pParam.xyz)
++ + i.y, pParam.xyz) + i.x, pParam.xyz);
++ vec4 j1 = permute( permute( permute( permute (
++ i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz)
++ + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz)
++ + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz)
++ + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz);
++// Gradients
++// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.)
++ vec4 ip = pParam ;
++ ip.xy *= pParam.w ;
++ ip.x *= pParam.w ;
++ ip = vec4(1.,1.,1.,2.) / ip ;
++
++ vec4 p0 = grad4(j0, ip);
++ vec4 p1 = grad4(j1.x, ip);
++ vec4 p2 = grad4(j1.y, ip);
++ vec4 p3 = grad4(j1.z, ip);
++ vec4 p4 = grad4(j1.w, ip);
++
++#ifdef NORMALISE_GRADIENTS
++ p0 *= taylorInvSqrt(dot(p0,p0));
++ p1 *= taylorInvSqrt(dot(p1,p1));
++ p2 *= taylorInvSqrt(dot(p2,p2));
++ p3 *= taylorInvSqrt(dot(p3,p3));
++ p4 *= taylorInvSqrt(dot(p4,p4));
++#endif
++
++// Mix
++ vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++ vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.);
++ m0 = m0 * m0;
++ m1 = m1 * m1;
++ return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
++ + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
++
++ }
++
++
++
+diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert
+new file mode 100644
+index 0000000..28970ee
+--- /dev/null
++++ b/src/glsl/skinning.vert
+@@ -0,0 +1,24 @@
++// Vertex weighting/blendin shader
++// Brian Paul
++// 4 Nov 2008
++
++uniform mat4 mat0, mat1;
++attribute float weight;
++
++void main()
++{
++ // simple diffuse shading
++ // Note that we should really transform the normal vector along with
++ // the postion below... someday.
++ vec3 lightVec = vec3(0, 0, 1);
++ vec3 norm = gl_NormalMatrix * gl_Normal;
++ float dot = 0.2 + max(0.0, dot(norm, lightVec));
++ gl_FrontColor = vec4(dot);
++
++ // compute sum of weighted transformations
++ vec4 pos0 = mat0 * gl_Vertex;
++ vec4 pos1 = mat1 * gl_Vertex;
++ vec4 pos = mix(pos0, pos1, weight);
++
++ gl_Position = gl_ModelViewProjectionMatrix * pos;
++}
+diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag
+new file mode 100644
+index 0000000..0839436
+--- /dev/null
++++ b/src/perf/glslstateschange1.frag
+@@ -0,0 +1,19 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++ vec4 t3;
++ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++ t3 = mix(t1, t2, t2.w);
++ gl_FragColor = t3 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange1.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++ gl_TexCoord[0] = TexCoord0;
++ gl_TexCoord[1] = TexCoord1;
++ // note: may use gl_Vertex or VertCoord here for testing:
++ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag
+new file mode 100644
+index 0000000..0df0319
+--- /dev/null
++++ b/src/perf/glslstateschange2.frag
+@@ -0,0 +1,17 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++ vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++ vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++ gl_FragColor = t1 + t2 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange2.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++ gl_TexCoord[0] = TexCoord0;
++ gl_TexCoord[1] = TexCoord1;
++ // note: may use gl_Vertex or VertCoord here for testing:
++ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..bc7ae4b
+--- /dev/null
++++ b/src/vpglsl/infinite-loop.glsl
+@@ -0,0 +1,8 @@
++void main() {
++ gl_Position = gl_Vertex;
++ vec4 sum = vec4(0);
++ for (int i = 1; i != 2; i += 2) {
++ sum += vec4(0.1, 0.1, 0.1, 0.1);
++ }
++ gl_FrontColor = sum;
++}
+--
+2.0.0
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 000000000..f6b59a11f
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,377 @@
+From 779438770bedf3d53e6ad8f7cd6889b7f50daf3b Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Wed, 9 Jul 2014 14:23:41 +0200
+Subject: [PATCH] configure: Allow to disable demos which require GLEW or GLU
+
+* in some systems without X11 support we don't have GLEW, but
+ mesa-demos are still useful
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Port to 8.3.0
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 49 ++++++++++++++++++++---------
+ src/Makefile.am | 18 ++++++++---
+ src/demos/Makefile.am | 73 ++++++++++++++++++++++++-------------------
+ src/egl/Makefile.am | 8 +++--
+ src/egl/opengles1/Makefile.am | 10 ++++--
+ src/egl/opengles2/Makefile.am | 29 ++++++++---------
+ 6 files changed, 117 insertions(+), 70 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0525b09..28834cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
+ [AC_DEFINE(HAVE_FREEGLUT)],
+ [])
+
+-dnl Check for GLEW
+-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++AC_ARG_ENABLE([glew],
++ [AS_HELP_STRING([--enable-glew],
++ [build demos which require glew @<:@default=yes@:>@])],
++ [enable_glew="$enableval"],
++ [enable_glew=yes]
++)
++
++if test "x$enable_glew" = xyes; then
++ dnl Check for GLEW
++ PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
++ DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
++ DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++fi
+
+ # LIBS was set by AC_CHECK_LIB above
+ LIBS=""
+
+-PKG_CHECK_MODULES(GLU, [glu], [],
+- [AC_CHECK_HEADER([GL/glu.h],
+- [],
+- AC_MSG_ERROR([GLU not found]))
+- AC_CHECK_LIB([GLU],
+- [gluBeginCurve],
+- [GLU_LIBS=-lGLU],
+- AC_MSG_ERROR([GLU required])) ])
++AC_ARG_ENABLE([glu],
++ [AS_HELP_STRING([--enable-glu],
++ [build demos which require glu @<:@default=yes@:>@])],
++ [enable_glu="$enableval"],
++ [enable_glu=yes]
++)
+
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++if test "x$enable_glu" = xyes; then
++ PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
++ [AC_CHECK_HEADER([GL/glu.h],
++ [],
++ AC_MSG_ERROR([GLU not found]))
++ AC_CHECK_LIB([GLU],
++ [gluBeginCurve],
++ [GLU_LIBS=-lGLU
++ glu_enabled=yes],
++ AC_MSG_ERROR([GLU required])) ])
++
++ DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
++ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++fi
+
+ AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl],
+@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
+ AC_SUBST([WAYLAND_LIBS])
+
+
++AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1647d64..8b89dee 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,15 +22,19 @@
+ # Authors:
+ # Eric Anholt <eric@anholt.net>
+
++if HAVE_GLEW
++UTIL = util
++endif
++
+ SUBDIRS = \
+- util \
++ $(UTIL) \
+ data \
+ demos \
+ egl \
+ fp \
+ fpglsl \
+ glsl \
+- gs \
++ gs \
+ objviewer \
+ osdemos \
+ perf \
+@@ -40,8 +44,12 @@ SUBDIRS = \
+ slang \
+ tests \
+ tools \
+- trivial \
+- vp \
+- vpglsl \
+ wgl \
+ xdemos
++
++if HAVE_GLEW
++SUBDIRS += \
++ vp \
++ vpglsl \
++ trivial
++endif
+diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
+index 41603fa..ab1e3ab 100644
+--- a/src/demos/Makefile.am
++++ b/src/demos/Makefile.am
+@@ -30,91 +30,100 @@ AM_LDFLAGS = \
+ $(DEMO_LIBS) \
+ $(GLUT_LIBS)
+
++bin_PROGRAMS =
++
+ if HAVE_GLUT
+-bin_PROGRAMS = \
++if HAVE_GLEW
++bin_PROGRAMS += \
+ arbfplight \
+ arbfslight \
+ arbocclude \
+ arbocclude2 \
+- bounce \
+- clearspd \
+ copypix \
+ cubemap \
+ cuberender \
+ dinoshade \
+- dissolve \
+- drawpix \
+ engine \
+ fbo_firecube \
+ fbotexture \
+- fire \
+ fogcoord \
+ fplight \
+ fslight \
++ gloss \
++ isosurf \
++ multiarb \
++ paltex \
++ pointblast \
++ projtex \
++ shadowtex \
++ spriteblast \
++ stex3d \
++ textures \
++ vao_demo \
++ winpos
++
++copypix_LDADD = ../util/libutil.la
++cubemap_LDADD = ../util/libutil.la
++cuberender_LDADD = ../util/libutil.la
++engine_LDADD = ../util/libutil.la
++fbo_firecube_LDADD = ../util/libutil.la
++gloss_LDADD = ../util/libutil.la
++isosurf_LDADD = ../util/libutil.la
++multiarb_LDADD = ../util/libutil.la
++projtex_LDADD = ../util/libutil.la
++textures_LDADD = ../util/libutil.la
++winpos_LDADD = ../util/libutil.la
++endif
++
++if HAVE_GLU
++bin_PROGRAMS += \
++ bounce \
++ clearspd \
++ dissolve \
++ drawpix \
++ fire \
+ gamma \
+ gearbox \
+ gears \
+ geartrain \
+ glinfo \
+- gloss \
+ gltestperf \
+ ipers \
+- isosurf \
+ lodbias \
+ morph3d \
+- multiarb \
+- paltex \
+ pixeltest \
+- pointblast \
+- projtex \
+ ray \
+ readpix \
+ reflect \
+ renormal \
+- shadowtex \
+ singlebuffer \
+ spectex \
+- spriteblast \
+- stex3d \
+ teapot \
+ terrain \
+ tessdemo \
+ texcyl \
+ texenv \
+- textures \
+ trispd \
+ tunnel2 \
+- tunnel \
+- vao_demo \
+- winpos
+-endif
++ tunnel
+
+ tunnel_SOURCES = \
+ tunnel.c \
+ tunneldat.h
+
+-copypix_LDADD = ../util/libutil.la
+-cubemap_LDADD = ../util/libutil.la
+-cuberender_LDADD = ../util/libutil.la
+-drawpix_LDADD = ../util/libutil.la
+ dissolve_LDADD = ../util/libutil.la
+-engine_LDADD = ../util/libutil.la
+-fbo_firecube_LDADD = ../util/libutil.la
++drawpix_LDADD = ../util/libutil.la
+ fire_LDADD = ../util/libutil.la
+-gloss_LDADD = ../util/libutil.la
+ ipers_LDADD = ../util/libutil.la
+-isosurf_LDADD = ../util/libutil.la
+ lodbias_LDADD = ../util/libutil.la
+-multiarb_LDADD = ../util/libutil.la
+-projtex_LDADD = ../util/libutil.la
+ readpix_LDADD = ../util/libutil.la
+ reflect_LDADD = ../util/libutil.la
+ teapot_LDADD = ../util/libutil.la
+ texcyl_LDADD = ../util/libutil.la
+-textures_LDADD = ../util/libutil.la
+ tunnel_LDADD = ../util/libutil.la
+ tunnel2_LDADD = ../util/libutil.la
+-winpos_LDADD = ../util/libutil.la
++endif
++endif
+
+ EXTRA_DIST = \
+ README
+diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
+index d64a49e..4fe1ca8 100644
+--- a/src/egl/Makefile.am
++++ b/src/egl/Makefile.am
+@@ -24,8 +24,12 @@
+
+ SUBDIRS = \
+ eglut \
+- opengl \
+- openvg \
+ opengles1 \
+ opengles2 \
+ oes_vg
++
++if HAVE_GLU
++SUBDIRS += \
++ opengl \
++ openvg
++endif
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index fa397c2..21853e8 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,9 +36,12 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++noinst_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS = \
++if HAVE_X11
++bin_PROGRAMS = \
+ bindtex \
+ clear \
+ drawtex_x11 \
+@@ -52,8 +55,6 @@ noinst_PROGRAMS = \
+ torus_x11 \
+ tri_x11 \
+ two_win
+-endif
+-endif
+
+ bindtex_LDADD = $(X11_LIBS)
+ es1_info_LDADD = $(X11_LIBS)
+@@ -76,3 +77,6 @@ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
+ gears_x11_LDADD = ../eglut/libeglut_x11.la
+ torus_x11_LDADD = ../eglut/libeglut_x11.la
+ tri_x11_LDADD = ../eglut/libeglut_x11.la
++endif
++endif
++endif
+diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
+index b80ba50..17f8d49 100644
+--- a/src/egl/opengles2/Makefile.am
++++ b/src/egl/opengles2/Makefile.am
+@@ -33,27 +33,28 @@ AM_LDFLAGS = \
+ $(EGL_LIBS) \
+ -lm
+
++bin_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV2
+-bin_PROGRAMS =
+-if HAVE_X11
+-bin_PROGRAMS += \
+- es2_info \
+- es2gears_x11 \
+- es2tri
+-endif
+ if HAVE_WAYLAND
+ bin_PROGRAMS += es2gears_wayland
+-endif
+-endif
++
++es2gears_wayland_SOURCES = es2gears.c
++es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+ endif
+
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
++if HAVE_X11
++bin_PROGRAMS += \
++ es2tri \
++ es2_info \
++ es2gears_x11
+
++es2_info_LDADD = $(X11_LIBS)
+ es2gears_x11_SOURCES = es2gears.c
+-
+ es2gears_x11_LDADD = ../eglut/libeglut_x11.la
++es2tri_LDADD = $(X11_LIBS)
++endif
++endif
++endif
+
+-es2gears_wayland_SOURCES = es2gears.c
+-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
new file mode 100644
index 000000000..f77b97f3e
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
@@ -0,0 +1,234 @@
+From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Fri, 9 May 2014 11:50:24 -0400
+Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files
+
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+---
+ src/glsl/bezier.c | 2 +-
+ src/glsl/blinking-teapot.c | 4 ++--
+ src/glsl/brick.c | 4 ++--
+ src/glsl/bump.c | 6 +++---
+ src/glsl/convolutions.c | 2 +-
+ src/glsl/mandelbrot.c | 4 ++--
+ src/glsl/multitex.c | 4 ++--
+ src/glsl/simplex-noise.c | 2 +-
+ src/glsl/skinning.c | 4 ++--
+ src/glsl/texdemo1.c | 8 ++++----
+ src/glsl/toyball.c | 4 ++--
+ src/objviewer/objview.c | 12 ++++++------
+ src/perf/glslstateschange.c | 8 ++++----
+ 13 files changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
+index 0b56bc1..e01603d 100644
+--- a/src/glsl/bezier.c
++++ b/src/glsl/bezier.c
+@@ -13,7 +13,7 @@
+ #include "glut_wrap.h"
+ #include "shaderutil.h"
+
+-static const char *filename = "bezier.geom";
++static const char *filename = DEMOS_DATA_DIR "bezier.geom";
+
+ static GLuint fragShader;
+ static GLuint vertShader;
+diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
+index e3bf24d..7662b1f 100644
+--- a/src/glsl/blinking-teapot.c
++++ b/src/glsl/blinking-teapot.c
+@@ -63,8 +63,8 @@ init_opengl (void)
+ exit(1);
+ }
+
+- vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
+- fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
++ vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
++ fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
+ prog_id = LinkShaders (vshad_id, fshad_id);
+
+ UseProgram (prog_id);
+diff --git a/src/glsl/brick.c b/src/glsl/brick.c
+index 3021856..fe5f190 100644
+--- a/src/glsl/brick.c
++++ b/src/glsl/brick.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH06-brick.frag";
+-static char *VertProgFile = "CH06-brick.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/bump.c b/src/glsl/bump.c
+index 59f62cd..3a1b20a 100644
+--- a/src/glsl/bump.c
++++ b/src/glsl/bump.c
+@@ -15,9 +15,9 @@
+ #include "readtex.h"
+
+
+-static char *FragProgFile = "CH11-bumpmap.frag";
+-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
+-static char *VertProgFile = "CH11-bumpmap.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
++static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
+ static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
+
+ /* program/shader objects */
+diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
+index a120cfe..9312f00 100644
+--- a/src/glsl/convolutions.c
++++ b/src/glsl/convolutions.c
+@@ -340,7 +340,7 @@ static void init(void)
+
+ menuInit();
+ readTexture(textureLocation);
+- createProgram("convolution.vert", "convolution.frag");
++ createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
+
+ glEnable(GL_TEXTURE_2D);
+ glClearColor(1.0, 1.0, 1.0, 1.0);
+diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
+index 31ede1d..ab34a0f 100644
+--- a/src/glsl/mandelbrot.c
++++ b/src/glsl/mandelbrot.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH18-mandel.frag";
+-static char *VertProgFile = "CH18-mandel.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
+index 262ea50..546bd27 100644
+--- a/src/glsl/multitex.c
++++ b/src/glsl/multitex.c
+@@ -35,8 +35,8 @@
+
+ static const char *Demo = "multitex";
+
+-static const char *VertFile = "multitex.vert";
+-static const char *FragFile = "multitex.frag";
++static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
++static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
+
+ static const char *TexFiles[2] =
+ {
+diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
+index 13fdd5d..885f01e 100644
+--- a/src/glsl/simplex-noise.c
++++ b/src/glsl/simplex-noise.c
+@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
+ static void
+ Init(void)
+ {
+- const char *filename = "simplex-noise.glsl";
++ const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
+ char noiseText[10000];
+ FILE *f;
+ int len;
+diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
+index bf38d77..536d475 100644
+--- a/src/glsl/skinning.c
++++ b/src/glsl/skinning.c
+@@ -20,8 +20,8 @@
+ #define M_PI 3.1415926535
+ #endif
+
+-static char *FragProgFile = "skinning.frag";
+-static char *VertProgFile = "skinning.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
+index 6cde239..a082342 100644
+--- a/src/glsl/texdemo1.c
++++ b/src/glsl/texdemo1.c
+@@ -35,11 +35,11 @@
+
+ static const char *Demo = "texdemo1";
+
+-static const char *ReflectVertFile = "reflect.vert";
+-static const char *CubeFragFile = "cubemap.frag";
++static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
++static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
+
+-static const char *SimpleVertFile = "simple.vert";
+-static const char *SimpleTexFragFile = "shadowtex.frag";
++static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
++static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
+
+ static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
+
+diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
+index 5f27951..4e7e832 100644
+--- a/src/glsl/toyball.c
++++ b/src/glsl/toyball.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+
+
+-static char *FragProgFile = "CH11-toyball.frag";
+-static char *VertProgFile = "CH11-toyball.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
+
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
+index 6def726..78a6acf 100644
+--- a/src/objviewer/objview.c
++++ b/src/objviewer/objview.c
+@@ -162,12 +162,12 @@ init_model(void)
+ static void
+ init_skybox(void)
+ {
+- SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
+- "alpine_west.rgb",
+- "alpine_up.rgb",
+- "alpine_down.rgb",
+- "alpine_south.rgb",
+- "alpine_north.rgb");
++ SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
++ DEMOS_DATA_DIR "alpine_west.rgb",
++ DEMOS_DATA_DIR "alpine_up.rgb",
++ DEMOS_DATA_DIR "alpine_down.rgb",
++ DEMOS_DATA_DIR "alpine_south.rgb",
++ DEMOS_DATA_DIR "alpine_north.rgb");
+ glmSpecularTexture(Model, SkyboxTex);
+ }
+
+diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
+index 7422b78..dbf8332 100644
+--- a/src/perf/glslstateschange.c
++++ b/src/perf/glslstateschange.c
+@@ -33,10 +33,10 @@
+ #include "glmain.h"
+ #include "common.h"
+
+-static const char *VertFile1 = "glslstateschange1.vert";
+-static const char *FragFile1 = "glslstateschange1.frag";
+-static const char *VertFile2 = "glslstateschange2.vert";
+-static const char *FragFile2 = "glslstateschange2.frag";
++static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
++static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
++static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
++static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
+ static struct uniform_info Uniforms1[] = {
+ { "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
+ { "tex2", 1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
+--
+2.0.0
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 000000000..6b676cdd2
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,45 @@
+From c59e286fa4e818ca015dd40e4725636309970ea8 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:30:52 +0200
+Subject: [PATCH] Install few more test programs
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ src/egl/opengl/Makefile.am | 2 +-
+ src/egl/opengles1/Makefile.am | 10 ++++------
+ src/egl/openvg/Makefile.am | 2 +-
+ 3 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
+index fe7faa9..3e48141 100644
+--- a/src/egl/opengl/Makefile.am
++++ b/src/egl/opengl/Makefile.am
+@@ -50,7 +50,7 @@ endif
+ endif
+
+ if HAVE_EGL
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ eglinfo \
+ peglgears \
+ $(EGL_DRM_DEMOS) \
+diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
+index b0f1212..5fd1cf8 100644
+--- a/src/egl/openvg/Makefile.am
++++ b/src/egl/openvg/Makefile.am
+@@ -49,7 +49,7 @@ endif
+
+ if HAVE_EGL
+ if HAVE_VG
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ $(EGL_X11_DEMOS)
+ endif
+ endif
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
new file mode 100644
index 000000000..a6085754d
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
@@ -0,0 +1,101 @@
+From 0b6f95f9b8ece22e9856c150e4be29fd86eaf546 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:29:27 +0200
+Subject: [PATCH 8/9] glsl, perf: Add few missing .glsl, .vert, .frag files to
+ EXTRA_DATA
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/Makefile.am | 2 ++
+ src/glsl/Makefile.am | 10 ++++++++--
+ src/perf/Makefile.am | 6 ++++++
+ src/vpglsl/Makefile.am | 1 +
+ 4 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index 47c1039..fd43c91 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
+ endif
+
+ EXTRA_DIST = \
++ depth-read.glsl \
+ dowhile2.glsl \
+ dowhile.glsl \
+ forbreak.glsl \
+ for.glsl \
++ infinite-loop.glsl \
+ mov.glsl \
+ mov-imm.glsl \
+ simpleif.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 4faa8db..079a29d 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -37,7 +37,7 @@ AM_LDFLAGS = \
+ if HAVE_GLUT
+ bin_PROGRAMS = \
+ array \
+- bezier \
++ bezier \
+ bitmap \
+ brick \
+ bump \
+@@ -123,12 +123,16 @@ EXTRA_DIST = \
+ CH06-brick.vert \
+ CH11-bumpmap.frag \
+ CH11-bumpmap.vert \
++ CH11-bumpmaptex.frag \
+ CH11-toyball.frag \
+ CH11-toyball.vert \
+ CH18-mandel.frag \
+ CH18-mandel.vert \
+- bezier.geom \
++ bezier.geom \
+ brick.shtest \
++ blinking-teapot.frag \
++ blinking-teapot.vert \
++ convolution.frag \
+ convolution.vert \
+ cubemap.frag \
+ mandelbrot.shtest \
+@@ -138,5 +142,7 @@ EXTRA_DIST = \
+ reflect.vert \
+ shadowtex.frag \
+ simple.vert \
++ simplex-noise.glsl \
+ skinning.frag \
++ skinning.vert \
+ toyball.shtest
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index 5363c58..c5cca8d 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -57,3 +57,9 @@ bin_PROGRAMS = \
+ endif
+
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
++
++EXTRA_DIST = \
++ glslstateschange1.frag \
++ glslstateschange1.vert \
++ glslstateschange2.frag \
++ glslstateschange2.vert
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 4a85ed4..48b08f4 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -44,6 +44,7 @@ EXTRA_DIST = \
+ func2.glsl \
+ ifelse.glsl \
+ if.glsl \
++ infinite-loop.glsl \
+ mov.glsl \
+ nestedifs.glsl \
+ nestedswizzle.glsl \
+--
+2.0.0
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
new file mode 100644
index 000000000..1262dee23
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
@@ -0,0 +1,73 @@
+From c8c3de5417d6b6c7d7579c528c0cab718f4bfdb6 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:48:12 +0200
+Subject: [PATCH 9/9] glsl, perf: Install .glsl, .vert, .frag files
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/Makefile.am | 3 ++-
+ src/glsl/Makefile.am | 3 ++-
+ src/perf/Makefile.am | 3 ++-
+ src/vpglsl/Makefile.am | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index fd43c91..2bf51de 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ fp-tri
+ endif
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ depth-read.glsl \
+ dowhile2.glsl \
+ dowhile.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 079a29d..f66ec29 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
+ vert_tex_LDADD = ../util/libutil.la
+ vsraytrace_LDADD = ../util/libutil.la
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ CH06-brick.frag \
+ CH06-brick.vert \
+ CH11-bumpmap.frag \
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index c5cca8d..140256d 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -58,7 +58,8 @@ endif
+
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ glslstateschange1.frag \
+ glslstateschange1.vert \
+ glslstateschange2.frag \
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 48b08f4..5526867 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ vp-tris
+ endif
+
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ for.glsl \
+ func.glsl \
+ func2.glsl \
+--
+2.0.0
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
new file mode 100644
index 000000000..c68764740
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch
@@ -0,0 +1,44 @@
+From 3aa84c47e88a4c38446ce1323abf6f2c77389104 Mon Sep 17 00:00:00 2001
+From: Prabhu <prabhu.sundararaj@freescale.com>
+Date: Mon, 16 Nov 2015 17:09:32 -0600
+Subject: [PATCH] mesa-demos: OpenVG demos with single frame need eglSwapBuffer
+
+sp and text demos rendering single frame. to display the
+single frame rendered needed a eglSwapBuffer to diplay to window.
+Hence added eglutPostRedisplay to display the frame
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu <prabhu.sundararaj@freescale.com>
+---
+ src/egl/openvg/sp.c | 1 +
+ src/egl/openvg/text.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/egl/openvg/sp.c b/src/egl/openvg/sp.c
+index a20c0a3..468e91e 100644
+--- a/src/egl/openvg/sp.c
++++ b/src/egl/openvg/sp.c
+@@ -500,6 +500,7 @@ draw(void)
+ }
+
+ vgFlush();
++ eglutPostRedisplay();
+ }
+
+
+diff --git a/src/egl/openvg/text.c b/src/egl/openvg/text.c
+index f5c6de8..492581c 100644
+--- a/src/egl/openvg/text.c
++++ b/src/egl/openvg/text.c
+@@ -360,6 +360,7 @@ display(void)
+ {
+ vgClear(0, 0, width, height);
+ glyph_string_draw(10.0, 10.0);
++ eglutPostRedisplay();
+ }
+
+
+--
+2.5.1
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch b/poky/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
new file mode 100644
index 000000000..e7be4dfbe
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos/0013-only-build-GLX-demos-if-needed.patch
@@ -0,0 +1,62 @@
+From 322af294390a7f4e1524c5a79312be6cbebce988 Mon Sep 17 00:00:00 2001
+From: Awais Belal <awais_belal@mentor.com>
+Date: Wed, 11 Nov 2015 17:22:12 +0500
+Subject: [PATCH] only build GLX demos if needed
+
+There are platforms that default to EGL only configurations
+in which case the GLX applications are not required
+at all. Allow the user to control generation of these
+demos as needed through a configure switch.
+
+Signed-off-by: Awais Belal <awais_belal@mentor.com>
+Upstream-Status: Pending
+---
+ configure.ac | 9 +++++++++
+ src/Makefile.am | 6 +++++-
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index f8ec7e3..1a4d96d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -132,6 +132,11 @@ if test "x$enable_glu" = xyes; then
+ DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
+ fi
+
++AC_ARG_ENABLE([glx-demos],
++ [AS_HELP_STRING([--enable-glx-demos],
++ [enable GLX demos @<:@default=auto@:>@])],
++ [glx_demos_enabled="$enableval"],
++ [glx_demos_enabled=yes])
+ AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl],
+ [enable EGL library @<:@default=auto@:>@])],
+@@ -325,6 +333,7 @@ AC_SUBST([WAYLAND_LIBS])
+
+ AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLX, test "x$glx_demos_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8b89dee..a4d7e8f 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -44,8 +44,12 @@ SUBDIRS = \
+ slang \
+ tests \
+ tools \
+- wgl \
++ wgl
++
++if HAVE_GLX
++SUBDIRS += \
+ xdemos
++endif
+
+ if HAVE_GLEW
+ SUBDIRS += \
+--
+1.9.1
+
diff --git a/poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb b/poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb
new file mode 100644
index 000000000..bae3b18be
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-demos_8.3.0.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Mesa demo applications"
+DESCRIPTION = "This package includes the demonstration application, such as glxgears. \
+These applications can be used for Mesa validation and benchmarking."
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+
+LICENSE = "MIT & PD"
+LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
+ file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
+
+SRC_URI = "https://mesa.freedesktop.org/archive/demos/${PV}/${BPN}-${PV}.tar.bz2 \
+ file://0001-mesa-demos-Add-missing-data-files.patch \
+ file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
+ file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
+ file://0007-Install-few-more-test-programs.patch \
+ file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
+ file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
+ file://0012-mesa-demos-OpenVG-demos-with-single-frame-need-eglSw.patch \
+ file://0013-only-build-GLX-demos-if-needed.patch \
+ "
+SRC_URI[md5sum] = "628e75c23c17394f11a316c36f8e4164"
+SRC_URI[sha256sum] = "c173154bbd0d5fb53d732471984def42fb1b14ac85fcb834138fb9518b3e0bef"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/egl, virtual/libgl ...
+REQUIRED_DISTRO_FEATURES = "opengl x11"
+
+PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
+ x11 glew glu glx"
+
+# The Wayland code doesn't work with Wayland 1.0, so disable it for now
+#${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}"
+
+EXTRA_OECONF = "--with-system-data-files"
+
+PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
+PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
+PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
+PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,freeglut"
+PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
+PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
+PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
+PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
+PACKAGECONFIG[glx] = "--enable-glx-demos,--disable-glx-demos"
+
+do_install_append() {
+ # it can be completely empty when all PACKAGECONFIG options are disabled
+ rmdir --ignore-fail-on-non-empty ${D}${bindir}
+
+ if [ -f ${D}${bindir}/clear ]; then
+ mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos
+ fi
+}
diff --git a/poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb b/poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb
new file mode 100644
index 000000000..73267eb4f
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa-gl_17.3.8.bb
@@ -0,0 +1,9 @@
+require mesa_${PV}.bb
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+PACKAGECONFIG ??= "opengl dri ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
diff --git a/poky/meta/recipes-graphics/mesa/mesa.inc b/poky/meta/recipes-graphics/mesa/mesa.inc
new file mode 100644
index 000000000..b501b7e72
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,222 @@
+SUMMARY = "A free implementation of the OpenGL API"
+DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
+a system for rendering interactive 3D graphics. \
+A variety of device drivers allows Mesa to be used in many different environments \
+ranging from software emulation to complete hardware acceleration for modern GPUs. \
+Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
+environment."
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.html;md5=725f991a1cc322aa7a0cd3a2016621c4"
+
+PE = "2"
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native"
+EXTRANATIVEPATH += "chrpath-native"
+PROVIDES = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
+ virtual/mesa \
+ "
+
+inherit autotools pkgconfig python3native gettext distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "opengl vulkan"
+
+PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'drm', '', d)}"
+
+export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}"
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE}/llvm-config"
+EXTRA_OECONF = "--enable-shared-glapi \
+ --disable-opencl \
+ --with-llvm-prefix=${STAGING_LIBDIR}/llvm${MESA_LLVM_RELEASE} \
+ --with-platforms='${PLATFORMS}'"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland vulkan', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl egl gles gbm dri', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
+ "
+
+# "gbm" requires "dri", "opengl"
+PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm"
+
+X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
+# "x11" requires "opengl"
+PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
+PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
+
+DRIDRIVERS = "swrast"
+DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
+DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
+# "dri" requires "opengl"
+PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
+PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
+
+# Vulkan drivers need dri3 enabled
+# radeon could be enabled as well but requires gallium-llvm with llvm >= 3.9
+VULKAN_DRIVERS = ""
+VULKAN_DRIVERS_append_x86 = ",intel"
+VULKAN_DRIVERS_append_x86-64 = ",intel"
+PACKAGECONFIG[vulkan] = "--with-vulkan-drivers=${VULKAN_DRIVERS}, --without-vulkan-drivers, python3-mako-native"
+
+PACKAGECONFIG[opengl] = "--enable-opengl, --disable-opengl"
+
+# "gles" requires "opengl"
+PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
+
+# "egl" requires "dri", "opengl"
+PACKAGECONFIG[egl] = "--enable-egl, --disable-egl"
+
+PACKAGECONFIG[etnaviv] = ""
+PACKAGECONFIG[imx] = ""
+
+GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}"
+GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', '', d)}"
+GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
+PACKAGECONFIG[r600] = ""
+GALLIUMDRIVERS_LLVM33_ENABLED = "${@oe.utils.version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
+GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers
+PACKAGECONFIG[gallium] = "--enable-texture-float --with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
+MESA_LLVM_RELEASE ?= "6.0"
+PACKAGECONFIG[gallium-llvm] = "--enable-llvm --enable-llvm-shared-libs, --disable-llvm, llvm${MESA_LLVM_RELEASE} llvm-native \
+ ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+PACKAGECONFIG[xa] = "--enable-xa, --disable-xa"
+
+OSMESA = "${@bb.utils.contains('PACKAGECONFIG', 'gallium', 'gallium-osmesa', 'osmesa', d)}"
+PACKAGECONFIG[osmesa] = "--enable-${OSMESA},--disable-${OSMESA}"
+
+PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+
+# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
+FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
+
+CFLAGS_append_armv5 = " -DMISSING_64BIT_ATOMICS"
+
+# Remove the mesa dependency on mesa-dev, as mesa is empty
+RDEPENDS_${PN}-dev = ""
+
+# Add dependency so that GLES3 header don't need to be added manually
+RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev"
+
+PACKAGES =+ "libegl-mesa libegl-mesa-dev \
+ libosmesa libosmesa-dev \
+ libgl-mesa libgl-mesa-dev \
+ libglapi libglapi-dev \
+ libgbm libgbm-dev \
+ libgles1-mesa libgles1-mesa-dev \
+ libgles2-mesa libgles2-mesa-dev \
+ libgles3-mesa libgles3-mesa-dev \
+ libwayland-egl libwayland-egl-dev \
+ libxatracker libxatracker-dev \
+ mesa-megadriver mesa-vulkan-drivers \
+ "
+
+do_install_append () {
+ # Drivers never need libtool .la files
+ rm -f ${D}${libdir}/dri/*.la
+ rm -f ${D}${libdir}/egl/*.la
+ rm -f ${D}${libdir}/gallium-pipe/*.la
+ rm -f ${D}${libdir}/gbm/*.la
+
+ # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
+ rm -f ${D}${sysconfdir}/drirc
+ chrpath --delete ${D}${libdir}/dri/*_dri.so || true
+}
+
+# For the packages that make up the OpenGL interfaces, inject variables so that
+# they don't get Debian-renamed (which would remove the -mesa suffix), and
+# RPROVIDEs/RCONFLICTs on the generic libgl name.
+python __anonymous() {
+ pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
+ for p in (("egl", "libegl", "libegl1"),
+ ("dri", "libgl", "libgl1"),
+ ("gles", "libgles1", "libglesv1-cm1"),
+ ("gles", "libgles2", "libglesv2-2"),
+ ("gles", "libgles3",)):
+ if not p[0] in pkgconfig:
+ continue
+ fullp = p[1] + "-mesa"
+ pkgs = " ".join(p[1:])
+ d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+ d.appendVar("RREPLACES_" + fullp, pkgs)
+ d.appendVar("RPROVIDES_" + fullp, pkgs)
+ d.appendVar("RCONFLICTS_" + fullp, pkgs)
+
+ d.appendVar("RRECOMMENDS_" + fullp, " mesa-megadriver")
+
+ # For -dev, the first element is both the Debian and original name
+ fullp += "-dev"
+ pkgs = p[1] + "-dev"
+ d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+ d.appendVar("RREPLACES_" + fullp, pkgs)
+ d.appendVar("RPROVIDES_" + fullp, pkgs)
+ d.appendVar("RCONFLICTS_" + fullp, pkgs)
+}
+
+python mesa_populate_packages() {
+ pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
+ for pkg in pkgs:
+ d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+ d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+
+ import re
+ dri_drivers_root = oe.path.join(d.getVar('PKGD'), d.getVar('libdir'), "dri")
+ if os.path.isdir(dri_drivers_root):
+ dri_pkgs = os.listdir(dri_drivers_root)
+ lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+ for p in dri_pkgs:
+ m = re.match('^(.*)_dri\.so$', p)
+ if m:
+ pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+ d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
+ d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
+ d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
+
+ pipe_drivers_root = os.path.join(d.getVar('libdir'), "gallium-pipe")
+ do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
+}
+
+PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
+
+PACKAGES_DYNAMIC += "^mesa-driver-.*"
+
+FILES_${PN} += "${sysconfdir}/drirc"
+FILES_mesa-megadriver = "${libdir}/dri/*"
+FILES_mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
+FILES_libegl-mesa = "${libdir}/libEGL.so.*"
+FILES_libgbm = "${libdir}/libgbm.so.*"
+FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
+FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
+FILES_libgl-mesa = "${libdir}/libGL.so.*"
+FILES_libglapi = "${libdir}/libglapi.so.*"
+FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
+FILES_libxatracker = "${libdir}/libxatracker.so.*"
+
+FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan"
+FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
+FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES_libglapi-dev = "${libdir}/libglapi.*"
+FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
+FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
+FILES_libgles3-mesa-dev = "${includedir}/GLES3"
+FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/GL/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
+FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
+ ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
+ ${libdir}/pkgconfig/xatracker.pc"
diff --git a/poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb b/poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb
new file mode 100644
index 000000000..2d3fd3ca3
--- /dev/null
+++ b/poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb
@@ -0,0 +1,23 @@
+require ${BPN}.inc
+
+SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
+ file://disable-asm-on-non-gcc.patch \
+ file://Use-Python-3-to-execute-the-scripts.patch \
+ file://0001-Use-wayland-scanner-in-the-path.patch \
+ file://0002-hardware-gloat.patch \
+ file://llvm-config-version.patch \
+ file://0001-winsys-svga-drm-Include-sys-types.h.patch \
+ file://0001-Makefile.vulkan.am-explictly-add-lib-expat-to-intel-.patch \
+ file://0001-st-dri-Initialise-modifier-to-INVALID-for-DRI2.patch \
+ "
+
+SRC_URI[md5sum] = "203d1a79156ab6926f2d253b377e9d9d"
+SRC_URI[sha256sum] = "8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+ sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+ fi
+}
diff --git a/poky/meta/recipes-graphics/mini-x-session/files/mini-x-session b/poky/meta/recipes-graphics/mini-x-session/files/mini-x-session
new file mode 100644
index 000000000..dca655a91
--- /dev/null
+++ b/poky/meta/recipes-graphics/mini-x-session/files/mini-x-session
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Very simple session manager for Mini X
+#
+
+# Uncomment below to enable parsing of debian menu entrys
+# export MB_USE_DEB_MENUS=1
+
+if [ -e $HOME/.mini_x/session ]
+then
+exec $HOME/.mini_x/session
+fi
+
+if [ -e /etc/mini_x/session ]
+then
+exec /etc/mini_x/session
+fi
+
+MINI_X_SESSION_DIR=/etc/mini_x/session.d
+if [ -d "$MINI_X_SESSION_DIR" ]; then
+ # Execute session file on behalf of file owner
+ find $MINI_X_SESSION_DIR -type f | while read SESSIONFILE; do
+ set +e
+ USERNAME=`stat -c %U $SESSIONFILE`
+ # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
+# su -l -c '$SESSIONFILE&' $USERNAME
+ sudo -b -i -u $USERNAME $SESSIONFILE&
+ set -e
+ done
+fi
+
+# This resolution is big enough for hob2's max window size.
+xrandr -s 1024x768
+
+# Default files to run if $HOME/.mini_x/session or /etc/mini_x/session
+# dont exist.
+
+matchbox-terminal&
+exec matchbox-window-manager
diff --git a/poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb b/poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
new file mode 100644
index 000000000..4e89d631c
--- /dev/null
+++ b/poky/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Very simple session manager for X"
+HOMEPAGE = "http://www.yoctoproject.org"
+BUGTRACKER = "http://bugzilla.pokylinux.org"
+
+PR = "r4"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mini-x-session;endline=5;md5=b6430bffbcf05f9760e72938826b7487"
+
+SECTION = "x11"
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRC_URI = "file://mini-x-session"
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "sudo"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "x-session-manager"
+ALTERNATIVE_TARGET[x-session-manager] = "${bindir}/mini-x-session"
+ALTERNATIVE_PRIORITY = "50"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${S}/mini-x-session ${D}/${bindir}
+}
diff --git a/poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch b/poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch
new file mode 100644
index 000000000..82c93dd60
--- /dev/null
+++ b/poky/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch
@@ -0,0 +1,20 @@
+Fix missing include directory when building tests
+
+This patch is currently required for all versions of mx
+Upstream-Status: Submitted @ https://github.com/clutter-project/mx/issues/82
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+--
+Index: git/tests/Makefile.am
+===================================================================
+--- git.orig/tests/Makefile.am 2013-05-08 15:18:56.918596425 +0100
++++ git/tests/Makefile.am 2013-05-08 15:23:26.864781401 +0100
+@@ -10,7 +10,8 @@
+
+ INCLUDES = \
+ -I$(top_srcdir) \
+- -I$(top_builddir)
++ -I$(top_builddir)\
++ -I$(top_builddir)/mx
+
+ noinst_PROGRAMS = \
+ test-deform-texture \
diff --git a/poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb b/poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
new file mode 100644
index 000000000..58a6997ff
--- /dev/null
+++ b/poky/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
@@ -0,0 +1,16 @@
+require mx.inc
+
+# The 1.4.7 tag does not build against cogl 1.14, pull in a revision with a fix
+SRCREV = "9b1db6b8060bd00b121a692f942404a24ae2960f"
+PV = "1.4.7+git${SRCPV}"
+
+# Exclude x.99.x versions from upstream checks
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>^\d+(\.(?!99)\d+)+)"
+
+SRC_URI = "git://github.com/clutter-project/mx.git;branch=mx-1.4 \
+ file://fix-test-includes.patch \
+ "
+S = "${WORKDIR}/git"
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+ file://mx/mx-widget.c;beginline=8;endline=20;md5=13bba3c973a72414a701e1e87b5ee879"
diff --git a/poky/meta/recipes-graphics/mx/mx.inc b/poky/meta/recipes-graphics/mx/mx.inc
new file mode 100644
index 000000000..d30483748
--- /dev/null
+++ b/poky/meta/recipes-graphics/mx/mx.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Clutter based UI widget library"
+LICENSE = "LGPLv2.1"
+
+inherit clutter autotools distro_features_check gobject-introspection gtk-doc
+# depends on clutter-1.0 which depends on cogl-1.0
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "intltool-native clutter-1.0 dbus-glib gdk-pixbuf"
+
+SRC_URI = "http://source.clutter-project.org/sources/mx/${@get_verdir("${PV}")}/mx-${PV}.tar.xz"
+
+EXTRA_OECONF = "--disable-gtk-widgets \
+ --with-dbus \
+ --with-winsys=none \
+ --without-clutter-imcontext \
+ --without-clutter-gesture \
+ --without-startup-notification \
+ --without-glade \
+ "
+
+FILES_${PN} += "${datadir}"
diff --git a/poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
new file mode 100644
index 000000000..87c700e02
--- /dev/null
+++ b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Clutter package groups"
+
+PR = "r6"
+
+inherit packagegroup distro_features_check
+# rdepends on clutter-*
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+PACKAGES = "\
+ ${PN}-core \
+ "
+
+SUMMARY_${PN}-core = "Clutter graphics library"
+RDEPENDS_${PN}-core = "\
+ clutter-1.0 \
+ clutter-gst-3.0 \
+ clutter-gtk-1.0 \
+ "
diff --git a/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
new file mode 100644
index 000000000..7ea72d55a
--- /dev/null
+++ b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Basic X11 session"
+DESCRIPTION = "Packages required to set up a basic working X11 session"
+PR = "r1"
+
+inherit packagegroup distro_features_check
+# rdepends on matchbox-wm
+REQUIRED_DISTRO_FEATURES = "x11"
+
+RDEPENDS_${PN} = "\
+ packagegroup-core-x11-xserver \
+ packagegroup-core-x11-utils \
+ dbus \
+ matchbox-terminal \
+ matchbox-wm \
+ mini-x-session \
+ liberation-fonts \
+ "
diff --git a/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
new file mode 100644
index 000000000..97dcac5f7
--- /dev/null
+++ b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+SUMMARY = "X11 display server"
+PR = "r40"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup distro_features_check
+# rdepends on XSERVER
+REQUIRED_DISTRO_FEATURES = "x11"
+
+XSERVER ?= "xserver-xorg xf86-video-fbdev"
+XSERVERCODECS ?= ""
+
+RDEPENDS_${PN} = "\
+ ${XSERVER} \
+ ${XSERVERCODECS} \
+ "
diff --git a/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
new file mode 100644
index 000000000..001db9e5e
--- /dev/null
+++ b/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+PR = "r40"
+
+inherit packagegroup distro_features_check
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN} ${PN}-utils"
+
+# backwards compatibility for xserver-common
+VIRTUAL-RUNTIME_xserver_common ?= ""
+
+# elsa, xserver-nodm-init
+VIRTUAL-RUNTIME_graphical_init_manager ?= "xserver-nodm-init"
+
+SUMMARY = "X11 display server and basic utilities"
+RDEPENDS_${PN} = "\
+ ${PN}-xserver \
+ ${PN}-utils \
+ "
+
+SUMMARY_${PN}-utils = "X11 basic utilities and init"
+RDEPENDS_${PN}-utils = "\
+ ${VIRTUAL-RUNTIME_xserver_common} \
+ ${VIRTUAL-RUNTIME_graphical_init_manager} \
+ xauth \
+ xhost \
+ xset \
+ xrandr \
+ xmodmap \
+ xdpyinfo \
+ xinput-calibrator \
+ dbus-x11 \
+ "
diff --git a/poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch b/poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch
new file mode 100644
index 000000000..9e1626e9a
--- /dev/null
+++ b/poky/meta/recipes-graphics/pango/pango/0001-Drop-introspection-macros-from-acinclude.m4.patch
@@ -0,0 +1,120 @@
+From 867a512eddbeb1899d3e7096df3da1dd0ce3e7b7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 14:06:17 +0300
+Subject: [PATCH] Drop introspection macros from acinclude.m4
+
+They take precendence over our customized macros, and so
+introspection doesn't work correctly.
+
+Upstream-Status: Backport [upstream 5ccfe0]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ acinclude.m4 | 96 ------------------------------------------------------------
+ 1 file changed, 96 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 8899c7c..48fd5d8 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -55,99 +55,3 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
+ ])
+
+
+-dnl REMOVE THIS WHEN introspection.m4 is widely available
+-dnl
+-dnl -*- mode: autoconf -*-
+-dnl Copyright 2009 Johan Dahlin
+-dnl
+-dnl This file is free software; the author(s) gives unlimited
+-dnl permission to copy and/or distribute it, with or without
+-dnl modifications, as long as this notice is preserved.
+-dnl
+-
+-# serial 1
+-
+-m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+-[
+- AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+- AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+- AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+-
+- dnl enable/disable introspection
+- m4_if([$2], [require],
+- [dnl
+- enable_introspection=yes
+- ],[dnl
+- AC_ARG_ENABLE(introspection,
+- AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
+- [Enable introspection for this build]),,
+- [enable_introspection=auto])
+- ])dnl
+-
+- AC_MSG_CHECKING([for gobject-introspection])
+-
+- dnl presence/version checking
+- AS_CASE([$enable_introspection],
+- [no], [dnl
+- found_introspection="no (disabled, use --enable-introspection to enable)"
+- ],dnl
+- [yes],[dnl
+- PKG_CHECK_EXISTS([gobject-introspection-1.0],,
+- AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
+- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
+- found_introspection=yes,
+- AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
+- ],dnl
+- [auto],[dnl
+- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
+- ],dnl
+- [dnl
+- AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
+- ])dnl
+-
+- AC_MSG_RESULT([$found_introspection])
+-
+- INTROSPECTION_SCANNER=
+- INTROSPECTION_COMPILER=
+- INTROSPECTION_GENERATE=
+- INTROSPECTION_GIRDIR=
+- INTROSPECTION_TYPELIBDIR=
+- if test "x$found_introspection" = "xyes"; then
+- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+- fi
+- AC_SUBST(INTROSPECTION_SCANNER)
+- AC_SUBST(INTROSPECTION_COMPILER)
+- AC_SUBST(INTROSPECTION_GENERATE)
+- AC_SUBST(INTROSPECTION_GIRDIR)
+- AC_SUBST(INTROSPECTION_TYPELIBDIR)
+- AC_SUBST(INTROSPECTION_CFLAGS)
+- AC_SUBST(INTROSPECTION_LIBS)
+- AC_SUBST(INTROSPECTION_MAKEFILE)
+-
+- AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
+-])
+-
+-
+-dnl Usage:
+-dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
+-
+-AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
+-[
+- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
+-])
+-
+-dnl Usage:
+-dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
+-
+-
+-AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
+-[
+- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
+-])
+--
+2.1.4
diff --git a/poky/meta/recipes-graphics/pango/pango/0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch b/poky/meta/recipes-graphics/pango/pango/0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch
new file mode 100644
index 000000000..6784a105a
--- /dev/null
+++ b/poky/meta/recipes-graphics/pango/pango/0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch
@@ -0,0 +1,147 @@
+From 526a6a9fc9a1cfe75c521c8bb39b61754fe42fe8 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 2 Sep 2016 14:00:24 +0300
+Subject: [PATCH] Enforce recreation of docs/pango.types; it is build
+ configuration-specific.
+
+In particular, it needs to exclude references to PangoXft if Xft is not available.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ docs/Makefile.am | 17 ++++--------
+ docs/pango.types | 80 --------------------------------------------------------
+ 2 files changed, 5 insertions(+), 92 deletions(-)
+ delete mode 100644 docs/pango.types
+
+diff --git a/docs/Makefile.am b/docs/Makefile.am
+index f5f1317..8947a99 100644
+--- a/docs/Makefile.am
++++ b/docs/Makefile.am
+@@ -49,6 +49,10 @@ IGNORE_HFILES= \
+ pangocoretext-private.h \
+ pangoatsui-private.h
+
++if !HAVE_XFT
++IGNORE_HFILES += pangoxft pangoxft-render.h
++endif
++
+ # CFLAGS and LDFLAGS for compiling scan program. Only needed
+ # if $(DOC_MODULE).types is non-empty.
+ INCLUDES = \
+@@ -103,16 +107,6 @@ include $(top_srcdir)/gtk-doc.make
+ # This line really belongs in gtk-doc.mk
+ $(REPORT_FILES): sgml-build.stamp
+
+-pango.types:
+- @echo "Rebuilding $@"
+- @LANG=C; LIST=$$(grep 'pango_[_a-zA-Z0-9]*_get_type' $(HFILE_GLOB) | grep -v '\(private\|atsui\|core_text\|win32\)' | sed 's/\([^:]*:\).*\(pango[_a-zA-Z0-9]*_get_type\).*/\1\2/') && \
+- echo "$$LIST" | sed 's/.*\/\(pango\/.*\):.*/#include <\1>/' | sort -u > $@.tmp && \
+- echo >> $@.tmp && \
+- echo "$$LIST" | cut -d : -f 2 | sort -u >> $@.tmp && \
+- mv $@.tmp $@
+-
+-BUILT_SOURCES = pango.types
+-
+ ########################################################################
+
+ MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+@@ -120,8 +114,7 @@ EXTRA_DIST += \
+ layout.fig \
+ layout.eps \
+ version.xml.in \
+- check.docs \
+- pango.types
++ check.docs
+
+ # force doc rebulid after configure
+ dist-hook-local: dist-local-check-no-cross-references all-local
+diff --git a/docs/pango.types b/docs/pango.types
+deleted file mode 100644
+index 7d93cda..0000000
+--- a/docs/pango.types
++++ /dev/null
+@@ -1,80 +0,0 @@
+-#include <pango/pango-attributes.h>
+-#include <pango/pango-context.h>
+-#include <pango/pango-engine.h>
+-#include <pango/pango-enum-types.h>
+-#include <pango/pango-font.h>
+-#include <pango/pango-fontmap.h>
+-#include <pango/pango-fontset.h>
+-#include <pango/pango-glyph-item.h>
+-#include <pango/pango-glyph.h>
+-#include <pango/pango-item.h>
+-#include <pango/pango-language.h>
+-#include <pango/pango-layout.h>
+-#include <pango/pango-matrix.h>
+-#include <pango/pango-ot.h>
+-#include <pango/pango-renderer.h>
+-#include <pango/pango-tabs.h>
+-#include <pango/pangocairo-fc.h>
+-#include <pango/pangocairo.h>
+-#include <pango/pangofc-decoder.h>
+-#include <pango/pangofc-font.h>
+-#include <pango/pangofc-fontmap.h>
+-#include <pango/pangoft2.h>
+-#include <pango/pangoxft-render.h>
+-#include <pango/pangoxft.h>
+-
+-pango_alignment_get_type
+-pango_attr_list_get_type
+-pango_attr_type_get_type
+-pango_bidi_type_get_type
+-pango_cairo_fc_font_map_get_type
+-pango_cairo_font_get_type
+-pango_cairo_font_map_get_type
+-pango_color_get_type
+-pango_context_get_type
+-pango_coverage_level_get_type
+-pango_direction_get_type
+-pango_ellipsize_mode_get_type
+-pango_engine_get_type
+-pango_engine_lang_get_type
+-pango_engine_shape_get_type
+-pango_fc_decoder_get_type
+-pango_fc_font_get_type
+-pango_fc_font_map_get_type
+-pango_font_description_get_type
+-pango_font_face_get_type
+-pango_font_family_get_type
+-pango_font_get_type
+-pango_font_map_get_type
+-pango_font_mask_get_type
+-pango_font_metrics_get_type
+-pango_fontset_get_type
+-pango_fontset_simple_get_type
+-pango_ft2_font_map_get_type
+-pango_glyph_item_get_type
+-pango_glyph_item_iter_get_type
+-pango_glyph_string_get_type
+-pango_gravity_get_type
+-pango_gravity_hint_get_type
+-pango_item_get_type
+-pango_language_get_type
+-pango_layout_get_type
+-pango_layout_iter_get_type
+-pango_layout_line_get_type
+-pango_matrix_get_type
+-pango_ot_info_get_type
+-pango_ot_ruleset_get_type
+-pango_render_part_get_type
+-pango_renderer_get_type
+-pango_script_get_type
+-pango_stretch_get_type
+-pango_style_get_type
+-pango_tab_align_get_type
+-pango_tab_array_get_type
+-pango_underline_get_type
+-pango_variant_get_type
+-pango_weight_get_type
+-pango_wrap_mode_get_type
+-pango_xft_font_get_type
+-pango_xft_font_map_get_type
+-pango_xft_renderer_get_type
+--
+2.9.3
+
diff --git a/poky/meta/recipes-graphics/pango/pango/run-ptest b/poky/meta/recipes-graphics/pango/pango/run-ptest
new file mode 100644
index 000000000..fa87a7577
--- /dev/null
+++ b/poky/meta/recipes-graphics/pango/pango/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner pango
diff --git a/poky/meta/recipes-graphics/pango/pango_1.40.14.bb b/poky/meta/recipes-graphics/pango/pango_1.40.14.bb
new file mode 100644
index 000000000..3bd9c6471
--- /dev/null
+++ b/poky/meta/recipes-graphics/pango/pango_1.40.14.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Framework for layout and rendering of internationalized text"
+DESCRIPTION = "Pango is a library for laying out and rendering of text, \
+with an emphasis on internationalization. Pango can be used anywhere \
+that text layout is needed, though most of the work on Pango so far has \
+been done in the context of the GTK+ widget toolkit. Pango forms the \
+core of text and font handling for GTK+-2.x."
+HOMEPAGE = "http://www.pango.org/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+LICENSE = "LGPLv2.0+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+inherit gnomebase gtk-doc ptest-gnome upstream-version-is-even gobject-introspection
+
+SRC_URI += "file://run-ptest \
+ file://0001-Drop-introspection-macros-from-acinclude.m4.patch \
+ file://0001-Enforce-recreation-of-docs-pango.types-it-is-build-c.patch \
+"
+SRC_URI[archive.md5sum] = "18d7eb8d52e7e445e733c109ddaa7b78"
+SRC_URI[archive.sha256sum] = "90af1beaa7bf9e4c52db29ec251ec4fd0a8f2cc185d521ad1f88d01b3a6a17e3"
+
+DEPENDS = "glib-2.0 glib-2.0-native fontconfig freetype virtual/libiconv cairo harfbuzz"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG[x11] = "--with-xft,--without-xft,virtual/libx11 libxft"
+
+EXTRA_OECONF = " \
+ --disable-debug \
+ "
+
+LEAD_SONAME = "libpango-1.0*"
+LIBV = "1.8.0"
+
+# This binary needs to be compiled for the host architecture. This isn't pretty!
+do_compile_prepend_class-target () {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'true', 'false', d)}; then
+ make CC="${BUILD_CC}" CFLAGS="" LDFLAGS="${BUILD_LDFLAGS}" AM_CPPFLAGS="$(pkg-config-native --cflags glib-2.0)" gen_all_unicode_LDADD="$(pkg-config-native --libs glib-2.0)" -C ${B}/tests gen-all-unicode
+ fi
+}
+
+FILES_${PN} = "${bindir}/* ${libdir}/libpango*${SOLIBS}"
+FILES_${PN}-dev += "${libdir}/pango/${LIBV}/modules/*.la"
+
+RDEPENDS_${PN}-ptest += "liberation-fonts cantarell-fonts"
+
+RPROVIDES_${PN} += "pango-modules pango-module-indic-lang \
+ pango-module-basic-fc pango-module-arabic-lang"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch b/poky/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch
new file mode 100644
index 000000000..e07e810a7
--- /dev/null
+++ b/poky/meta/recipes-graphics/piglit/piglit/0001-cmake-install-bash-completions-in-the-right-place.patch
@@ -0,0 +1,35 @@
+From 26faa2c157a27a18a9f767976730fe0c115e3af4 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 13 Jul 2016 19:19:02 +0300
+Subject: [PATCH] cmake: install bash-completions in the right place
+
+The completionsdir variable is a full path and should not be
+prefixed.
+
+This does mean the files may be installed outside of
+CMAKE_INSTALL_PREFIX -- the alternative is more difficult and
+means that bash completion files may be installed where
+bash-completion can't find them.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [mailing list]
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8e2abba..784a8f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -532,7 +532,7 @@ install (
+ if (BASH_COMPLETION_FOUND)
+ install(
+ FILES completions/bash/piglit
+- DESTINATION ${CMAKE_INSTALL_PREFIX}/${BASH_COMPLETION_COMPLETIONSDIR}/
++ DESTINATION ${BASH_COMPLETION_COMPLETIONSDIR}/
+ )
+ endif (BASH_COMPLETION_FOUND)
+
+--
+2.8.1
+
diff --git a/poky/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch b/poky/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch
new file mode 100644
index 000000000..f851a92ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/piglit/piglit/0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch
@@ -0,0 +1,54 @@
+From 0fc2c2932699cfd68be96c820fddfdd79b48b788 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 9 Jul 2016 07:52:19 +0000
+Subject: [PATCH] tests: Use FE_UPWARD only if its defined in fenv.h
+
+On ARM, musl does not define FE_* when arch does not have
+VFP, (which is right interpretation), therefore check if
+its defined before using it
+
+Fixes errors like
+
+tests/general/roundmode-pixelstore.c:82:19: error: 'FE_UPWARD' undeclared (first use in this function)
+ ret = fesetround(FE_UPWARD);
+ ^~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tests/general/roundmode-getintegerv.c | 2 ++
+ tests/general/roundmode-pixelstore.c | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tests/general/roundmode-getintegerv.c b/tests/general/roundmode-getintegerv.c
+index 28ecfaf..5c27579 100644
+--- a/tests/general/roundmode-getintegerv.c
++++ b/tests/general/roundmode-getintegerv.c
+@@ -81,7 +81,9 @@ piglit_init(int argc, char **argv)
+ {
+ int ret;
+ bool pass = true;
++#ifdef FE_UPWARD
+ ret = fesetround(FE_UPWARD);
++#endif
+ if (ret != 0) {
+ printf("Couldn't set rounding mode\n");
+ piglit_report_result(PIGLIT_SKIP);
+diff --git a/tests/general/roundmode-pixelstore.c b/tests/general/roundmode-pixelstore.c
+index 9284f43..3fcb396 100644
+--- a/tests/general/roundmode-pixelstore.c
++++ b/tests/general/roundmode-pixelstore.c
+@@ -79,7 +79,9 @@ piglit_init(int argc, char **argv)
+ {
+ int ret;
+ bool pass = true;
++#ifdef FE_UPWARD
+ ret = fesetround(FE_UPWARD);
++#endif
+ if (ret != 0) {
+ printf("Couldn't set rounding mode\n");
+ piglit_report_result(PIGLIT_SKIP);
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-graphics/piglit/piglit_git.bb b/poky/meta/recipes-graphics/piglit/piglit_git.bb
new file mode 100644
index 000000000..b936ad8a7
--- /dev/null
+++ b/poky/meta/recipes-graphics/piglit/piglit_git.bb
@@ -0,0 +1,52 @@
+SUMMARY = "OpenGL driver testing framework"
+LICENSE = "MIT & LGPLv2+ & GPLv3 & GPLv2+ & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0"
+
+SRC_URI = "git://anongit.freedesktop.org/piglit \
+ file://0001-cmake-install-bash-completions-in-the-right-place.patch \
+ file://0001-tests-Use-FE_UPWARD-only-if-its-defined-in-fenv.h.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+
+# From 2018-02-26
+SRCREV = "4ce0887e2f7f848d2be2e435a2d0f3c80e44ea3b"
+# (when PV goes above 1.0 remove the trailing r)
+PV = "1.0+gitr${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "libpng virtual/libx11 libxkbcommon libxrender waffle virtual/libgl libglu python3-mako-native python3-numpy-native python3-six-native virtual/egl"
+
+inherit cmake python3native distro_features_check bash-completion
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# depends on virtual/libgl
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+# The built scripts go into the temporary directory according to tempfile
+# (typically /tmp) which can race if multiple builds happen on the same machine,
+# so tell it to use a directory in ${B} to avoid overwriting.
+export TEMP = "${B}/temp/"
+do_compile[dirs] =+ "${B}/temp/"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[freeglut] = "-DPIGLIT_USE_GLUT=1,-DPIGLIT_USE_GLUT=0,freeglut,"
+
+do_configure_prepend() {
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'freeglut', 'yes', 'no', d)}" = "no" ]; then
+ sed -i -e "/^#.*include <GL\/freeglut_ext.h>$/d" ${S}/src/piglit/glut_wrap.h
+ sed -i -e "/^#.*include.*<GL\/glut.h>$/d" ${S}/src/piglit/glut_wrap.h
+ fi
+}
+
+OECMAKE_TARGET_INSTALL = "install/strip"
+
+RDEPENDS_${PN} = "waffle python3 python3-mako python3-json \
+ python3-misc \
+ python3-unixadmin python3-xml python3-multiprocessing \
+ python3-six python3-shell python3-io \
+ python3-netserver mesa-demos bash \
+ "
+
+INSANE_SKIP_${PN} += "dev-so already-stripped"
diff --git a/poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c b/poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c
new file mode 100644
index 000000000..41cebc58a
--- /dev/null
+++ b/poky/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c
@@ -0,0 +1,410 @@
+/*
+ * Pong Clock - A clock that plays pong.
+ * See http://mocoloco.com/archives/001766.php for the inspiration.
+ *
+ * Copyright (C) 2005 Matthew Allum
+ *
+ * Author: Matthew Allum mallum@openedhand.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+
+/* Tweak values for different hw setups */
+
+#define FPS 50
+#define RESX 40
+#define RESY 40
+#define TO_MISS_SECS 55
+#define BALLDX 16
+#define BALLDY 4
+
+
+typedef struct PongClock
+{
+ Display *xdpy;
+ int xscreen;
+ Window xwin, xwin_root;
+ Pixmap backbuffer;
+ GC xgc;
+ int xwin_width, xwin_height;
+ int pixelw, pixelh;
+
+ int ball_x, ball_y, ball_dx, ball_dy;
+ int bata_y, batb_y;
+ Bool bata_to_miss, batb_to_miss;
+
+}
+PongClock;
+
+void
+get_time(int *hour, int *min, int *sec)
+{
+ struct timeval tv;
+ struct tm *localTime = NULL;
+ time_t actualTime;
+
+ gettimeofday(&tv, 0);
+ actualTime = tv.tv_sec;
+ localTime = localtime(&actualTime);
+
+ if (hour)
+ *hour = localTime->tm_hour;
+
+ if (min)
+ *min = localTime->tm_min;
+
+ if (sec)
+ *sec = localTime->tm_sec;
+}
+
+void
+draw_rect (PongClock *pong_clock,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ XFillRectangle (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ x * pong_clock->pixelw,
+ y * pong_clock->pixelh,
+ width * pong_clock->pixelw,
+ height * pong_clock->pixelh);
+}
+
+void
+draw_field (PongClock *pong_clock)
+{
+ int i;
+
+ draw_rect (pong_clock, 0, 0, RESX+1, 1);
+ draw_rect (pong_clock, 0, RESY-1, RESX+1, 1);
+
+ for (i=0; i < RESY/2; i++)
+ draw_rect (pong_clock, (RESX/2)-1, i*2, 2, 1);
+}
+
+void
+draw_digit (PongClock *pong_clock,
+ int x,
+ int y,
+ int digit)
+{
+ int digits[] = { 0x1f8c63f, 0x1f21086, 0x1f0fe1f, 0x1f87e1f, 0x1087e31,
+ 0x1f87c3f, 0x1f8fc3f, 0x84421f, 0x1f8fe3f, 0x1087e3f };
+
+ XRectangle rects[5*5];
+ int i,j,k;
+
+ i = 0;
+
+ for (k=0; k<5; k++)
+ for (j=0; j<5; j++)
+ if (digits[digit] & (1 << ((k*5)+j)))
+ {
+ rects[i].x = (x + j) * pong_clock->pixelw;
+ rects[i].y = (y + k) * pong_clock->pixelh;
+ rects[i].width = pong_clock->pixelw;
+ rects[i].height = pong_clock->pixelh;
+ i++;
+ }
+
+ XFillRectangles (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ rects, i);
+}
+
+void
+draw_time (PongClock *pong_clock)
+{
+ int hour, min;
+
+ get_time(&hour, &min, NULL);
+
+ draw_digit (pong_clock,
+ (RESX/2) - 14,
+ 5,
+ hour / 10 );
+
+ draw_digit (pong_clock,
+ (RESX/2) - 8,
+ 5,
+ hour % 10 );
+
+ draw_digit (pong_clock,
+ (RESX/2) + 3,
+ 5,
+ min / 10 );
+
+ draw_digit (pong_clock,
+ (RESX/2) + 9,
+ 5,
+ min % 10 );
+}
+
+void
+draw_bat_and_ball (PongClock *pong_clock)
+{
+ /* ball */
+
+ XFillRectangle (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ pong_clock->ball_x,
+ pong_clock->ball_y,
+ pong_clock->pixelw,
+ pong_clock->pixelh);
+
+ /* bat a */
+
+ XFillRectangle (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ 0,
+ pong_clock->bata_y - (2 * pong_clock->pixelh),
+ pong_clock->pixelw,
+ pong_clock->pixelh * 5);
+
+ /* bat b */
+
+ XFillRectangle (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ (pong_clock->xwin_width - pong_clock->pixelw),
+ pong_clock->batb_y - (2 * pong_clock->pixelh),
+ pong_clock->pixelw,
+ pong_clock->pixelh * 5);
+
+}
+
+void
+update_state (PongClock *pong_clock)
+{
+ int sec, min, hour;
+
+ get_time(&hour, &min, &sec);
+
+ /* Check ball is on field and no ones dues to miss a shot.
+ */
+ if ( (pong_clock->ball_x < 0 && !pong_clock->bata_to_miss)
+ || (pong_clock->ball_x > (pong_clock->xwin_width - pong_clock->pixelw)
+ && !pong_clock->batb_to_miss) )
+ pong_clock->ball_dx *= -1;
+
+ if ((pong_clock->ball_y < pong_clock->pixelh)
+ || pong_clock->ball_y > (pong_clock->xwin_height - (2*pong_clock->pixelh)))
+ pong_clock->ball_dy *= -1;
+
+ pong_clock->ball_x += pong_clock->ball_dx;
+ pong_clock->ball_y += pong_clock->ball_dy;
+
+ /* Set up someone to miss if we getting close to an hour or min.
+ */
+ if (sec > TO_MISS_SECS)
+ {
+ if (min == 59)
+ pong_clock->batb_to_miss = True;
+ else
+ pong_clock->bata_to_miss = True;
+ }
+ else
+ {
+ /* Reset the game */
+ if (pong_clock->bata_to_miss)
+ {
+ pong_clock->bata_to_miss = False;
+ pong_clock->ball_y = pong_clock->bata_y;
+ pong_clock->ball_x = pong_clock->pixelw;
+ pong_clock->ball_dx *= -1;
+ }
+
+ if (pong_clock->batb_to_miss)
+ {
+ pong_clock->batb_to_miss = False;
+ pong_clock->ball_y = pong_clock->batb_y;
+ pong_clock->ball_x = pong_clock->xwin_width - pong_clock->pixelw;
+ pong_clock->ball_dx *= -1;
+ }
+ }
+
+ /* Keep bats on field and only move in not setup to miss */
+ if (pong_clock->ball_y >= (3*pong_clock->pixelh)
+ && pong_clock->ball_y <= (pong_clock->xwin_height - (5*pong_clock->pixelh)))
+ {
+ if (!pong_clock->batb_to_miss)
+ pong_clock->batb_y = pong_clock->ball_y;
+
+ if (!pong_clock->bata_to_miss)
+ pong_clock->bata_y = pong_clock->ball_y;
+ }
+}
+
+void
+draw_frame (PongClock *pong_clock)
+{
+ update_state (pong_clock);
+
+ /* Clear playfield */
+ XSetForeground (pong_clock->xdpy,
+ pong_clock->xgc,
+ BlackPixel(pong_clock->xdpy,
+ pong_clock->xscreen));
+
+ XFillRectangle (pong_clock->xdpy,
+ pong_clock->backbuffer,
+ pong_clock->xgc,
+ 0, 0,
+ pong_clock->xwin_width,
+ pong_clock->xwin_height);
+
+ XSetForeground (pong_clock->xdpy,
+ pong_clock->xgc,
+ WhitePixel(pong_clock->xdpy,
+ pong_clock->xscreen));
+
+ draw_field (pong_clock);
+
+ draw_time (pong_clock);
+
+ draw_bat_and_ball (pong_clock);
+
+ /* flip 'backbuffer' */
+ XSetWindowBackgroundPixmap (pong_clock->xdpy,
+ pong_clock->xwin,
+ pong_clock->backbuffer);
+ XClearWindow(pong_clock->xdpy, pong_clock->xwin);
+
+ XSync(pong_clock->xdpy, False);
+}
+
+int
+main (int argc, char **argv)
+{
+ XGCValues gcv;
+ Atom atoms_WINDOW_STATE, atoms_WINDOW_STATE_FULLSCREEN;
+ PongClock *pong_clock;
+
+ pong_clock = malloc(sizeof(PongClock));
+ memset(pong_clock, 0, sizeof(PongClock));
+
+ if ((pong_clock->xdpy = XOpenDisplay(getenv("DISPLAY"))) == NULL) {
+ fprintf(stderr, "Cannot connect to X server on display %s.",
+ getenv("DISPLAY"));
+ exit(-1);
+ }
+
+ pong_clock->xscreen = DefaultScreen(pong_clock->xdpy);
+ pong_clock->xwin_root = DefaultRootWindow(pong_clock->xdpy);
+ pong_clock->xwin_width = DisplayWidth(pong_clock->xdpy,
+ pong_clock->xscreen);
+ pong_clock->xwin_height = DisplayHeight(pong_clock->xdpy,
+ pong_clock->xscreen);
+
+ pong_clock->pixelw = pong_clock->xwin_width / RESX;
+ pong_clock->pixelh = pong_clock->xwin_height / RESY;
+
+ pong_clock->ball_x = 0;
+ pong_clock->ball_y = pong_clock->xwin_height / 2;
+
+ pong_clock->ball_dx = BALLDX;
+ pong_clock->ball_dy = BALLDY;
+
+ pong_clock->batb_y = pong_clock->bata_y = pong_clock->ball_y;
+
+ gcv.background = BlackPixel(pong_clock->xdpy,
+ pong_clock->xscreen);
+ gcv.foreground = WhitePixel(pong_clock->xdpy,
+ pong_clock->xscreen);
+ gcv.graphics_exposures = False;
+
+ pong_clock->xgc = XCreateGC (pong_clock->xdpy, pong_clock->xwin_root,
+ GCForeground|GCBackground|GCGraphicsExposures,
+ &gcv);
+
+ atoms_WINDOW_STATE
+ = XInternAtom(pong_clock->xdpy, "_NET_WM_STATE",False);
+ atoms_WINDOW_STATE_FULLSCREEN
+ = XInternAtom(pong_clock->xdpy, "_NET_WM_STATE_FULLSCREEN",False);
+
+ pong_clock->xwin = XCreateSimpleWindow(pong_clock->xdpy,
+ pong_clock->xwin_root,
+ 0, 0,
+ pong_clock->xwin_width,
+ pong_clock->xwin_height,
+ 0,
+ WhitePixel(pong_clock->xdpy,
+ pong_clock->xscreen),
+ BlackPixel(pong_clock->xdpy,
+ pong_clock->xscreen));
+
+ pong_clock->backbuffer = XCreatePixmap(pong_clock->xdpy,
+ pong_clock->xwin_root,
+ pong_clock->xwin_width,
+ pong_clock->xwin_height,
+ DefaultDepth(pong_clock->xdpy,
+ pong_clock->xscreen));
+
+ XSelectInput(pong_clock->xdpy, pong_clock->xwin, KeyPressMask);
+
+
+ /* Set the hints for fullscreen */
+ XChangeProperty(pong_clock->xdpy,
+ pong_clock->xwin,
+ atoms_WINDOW_STATE,
+ XA_ATOM,
+ 32,
+ PropModeReplace,
+ (unsigned char *) &atoms_WINDOW_STATE_FULLSCREEN, 1);
+
+ XMapWindow(pong_clock->xdpy, pong_clock->xwin);
+
+ while (True)
+ {
+ struct timeval timeout;
+ XEvent xev;
+
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 1000000 / FPS;
+ select (0, NULL, NULL, NULL, &timeout);
+
+ draw_frame (pong_clock);
+
+ XFlush(pong_clock->xdpy);
+
+ if (XPending(pong_clock->xdpy))
+ {
+ if (XCheckMaskEvent(pong_clock->xdpy,
+ KeyPressMask,
+ &xev))
+ exit(-1);
+ }
+ }
+}
diff --git a/poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb b/poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
new file mode 100644
index 000000000..cdfe38a22
--- /dev/null
+++ b/poky/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A clock combined with a game of pong"
+LICENSE = "GPLv2+"
+DEPENDS = "virtual/libx11 xdmcp xau"
+
+inherit distro_features_check pkgconfig
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://pong-clock-no-flicker.c"
+
+LIC_FILES_CHKSUM = "file://pong-clock-no-flicker.c;beginline=1;endline=23;md5=dd248d50f73f746d1ee78586b0b2ebd3"
+
+S = "${WORKDIR}"
+
+do_compile () {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o pong-clock pong-clock-no-flicker.c `pkg-config --cflags --libs x11 xau xdmcp`
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 pong-clock ${D}${bindir}
+}
diff --git a/poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch b/poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch
new file mode 100644
index 000000000..9e86f2b2e
--- /dev/null
+++ b/poky/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=59097]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd startup-notification-0.12/configure.in startup-notification-0.12/configure.in
+--- startup-notification-0.12/configure.in 2011-05-16 17:29:20.000000000 +0300
++++ startup-notification-0.12/configure.in 2013-01-07 06:00:48.921905409 +0200
+@@ -3,7 +3,7 @@
+ AC_CONFIG_SRCDIR(libsn/sn-launchee.c)
+
+ AM_INIT_AUTOMAKE
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ # Honor aclocal flags
+ AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
diff --git a/poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb b/poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb
new file mode 100644
index 000000000..6c1b93cd0
--- /dev/null
+++ b/poky/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Enables monitoring and display of application startup"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/startup-notification/"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=Specifications"
+
+# most files are under MIT, but libsn/sn-util.c is under LGPL, the
+# effective license is LGPL
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a2ae2cd47d6d2f238410f5364dfbc0f2 \
+ file://libsn/sn-util.c;endline=18;md5=18a14dc1825d38e741d772311fea9ee1 \
+ file://libsn/sn-common.h;endline=23;md5=6d05bc0ebdcf5513a6e77cb26e8cd7e2 \
+ file://test/test-boilerplate.h;endline=23;md5=923e706b2a70586176eead261cc5bb98"
+
+PR = "r2"
+
+SECTION = "libs"
+
+
+DEPENDS = "virtual/libx11 libsm xcb-util"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "http://www.freedesktop.org/software/startup-notification/releases/${BPN}-${PV}.tar.gz \
+ file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "2cd77326d4dcaed9a5a23a1232fb38e9"
+SRC_URI[sha256sum] = "3c391f7e930c583095045cd2d10eb73a64f085c7fde9d260f2652c7cb3cfbe4a"
diff --git a/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf b/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf
new file mode 100644
index 000000000..06094503c
--- /dev/null
+++ b/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- conf.d/sub-pixel.conf -->
+<fontconfig>
+ <alias>
+ <family>sans-serif</family>
+ <accept><family>Liberation Sans</family></accept>
+ </alias>
+ <alias>
+ <family>serif</family>
+ <accept><family>Liberation Serif</family></accept>
+ </alias>
+ <alias>
+ <family>monospace</family>
+ <accept><family>Liberation Mono</family></accept>
+ </alias>
+</fontconfig>
diff --git a/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_2.00.1.bb b/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_2.00.1.bb
new file mode 100644
index 000000000..412da4872
--- /dev/null
+++ b/poky/meta/recipes-graphics/ttf-fonts/liberation-fonts_2.00.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Liberation(tm) Fonts"
+DESCRIPTION = "The Liberation(tm) Fonts is a font family originally \
+created by Ascender(c) which aims at metric compatibility with \
+Arial, Times New Roman, Courier New."
+HOMEPAGE = "https://releases.pagure.org/liberation-fonts/"
+BUGTRACKER = "https://bugzilla.redhat.com/"
+
+SECTION = "x11/fonts"
+LICENSE = "OFL-1.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f96db970a9a46c5369142b99f530366b"
+PE = "1"
+
+inherit allarch fontcache
+
+FONT_PACKAGES = "${PN}"
+
+SRC_URI = "https://releases.pagure.org/liberation-fonts/liberation-fonts-ttf-${PV}.tar.gz \
+ file://30-liberation-aliases.conf"
+
+S = "${WORKDIR}/liberation-fonts-ttf-${PV}"
+
+SRC_URI[md5sum] = "5c781723a0d9ed6188960defba8e91cf"
+SRC_URI[sha256sum] = "7890278a6cd17873c57d9cd785c2d230d9abdea837e96516019c5885dd271504"
+
+do_install () {
+ install -d ${D}${datadir}/fonts/ttf/
+ for i in *.ttf; do
+ install -m 0644 $i ${D}${prefix}/share/fonts/ttf/${i}
+ done
+
+ install -d ${D}${sysconfdir}/fonts/conf.d/
+ install -m 0644 ${WORKDIR}/30-liberation-aliases.conf ${D}${sysconfdir}/fonts/conf.d/
+
+ install -d ${D}${prefix}/share/doc/${BPN}/
+ install -m 0644 LICENSE ${D}${datadir}/doc/${BPN}/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${sysconfdir} ${datadir}"
diff --git a/poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb b/poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
new file mode 100644
index 000000000..70b32cf8f
--- /dev/null
+++ b/poky/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
@@ -0,0 +1,32 @@
+SUMMARY = "The Bitstream Vera fonts - TTF Edition"
+DESCRIPTION = "The Bitstream Vera fonts include four monospace and sans \
+faces (normal, oblique, bold, bold oblique) and two serif faces (normal \
+and bold). In addition Fontconfig/Xft2 can artificially oblique the \
+serif faces for you: this loses hinting and distorts the faces slightly, \
+but is visibly different than normal and bold, and reasonably pleasing."
+SECTION = "x11/fonts"
+LICENSE = "BitstreamVera"
+LIC_FILES_CHKSUM = "file://COPYRIGHT.TXT;md5=27d7484b1e18d0ee4ce538644a3f04be"
+PR = "r7"
+
+inherit fontcache
+
+FONT_PACKAGES = "${PN}"
+
+SRC_URI = "${GNOME_MIRROR}/ttf-bitstream-vera/1.10/ttf-bitstream-vera-${PV}.tar.bz2"
+SRC_URI[md5sum] = "bb22bd5b4675f5dbe17c6963d8c00ed6"
+SRC_URI[sha256sum] = "db5b27df7bbb318036ebdb75acd3e98f1bd6eb6608fb70a67d478cd243d178dc"
+
+do_install () {
+ install -d ${D}${datadir}/fonts/ttf
+ for i in *.ttf; do
+ install -m 644 $i ${D}${datadir}/fonts/ttf
+ done
+
+ install -d ${D}${docdir}/${BPN}
+ for i in *.TXT; do
+ install -m 644 $i ${D}${docdir}/${BPN}
+ done
+}
+
+FILES_${PN} = "${datadir}/fonts"
diff --git a/poky/meta/recipes-graphics/vulkan/assimp_4.1.0.bb b/poky/meta/recipes-graphics/vulkan/assimp_4.1.0.bb
new file mode 100644
index 000000000..194cbe33c
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/assimp_4.1.0.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "Open Asset Import Library is a portable Open Source library to import \
+ various well-known 3D model formats in a uniform manner."
+HOMEPAGE = "http://www.assimp.org/"
+SECTION = "devel"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2119edef0916b0bd511cb3c731076271"
+
+DEPENDS = "zlib"
+
+SRC_URI = "git://github.com/assimp/assimp.git"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV = "80799bdbf90ce626475635815ee18537718a05b1"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_TESTS=OFF -DASSIMP_LIB_INSTALL_DIR=${baselib}"
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Don-t-build-demos-with-questionably-licensed-data.patch b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Don-t-build-demos-with-questionably-licensed-data.patch
new file mode 100644
index 000000000..d32c8f280
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Don-t-build-demos-with-questionably-licensed-data.patch
@@ -0,0 +1,91 @@
+From 55770fb07c42fe410cf8d09f8f5976babc89b9ef Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 4 Jul 2017 17:13:45 +0300
+Subject: [PATCH] Don't build demos with questionably licensed data
+
+Some of the models don't have open source compatible licenses:
+don't build demos using those. Also don't build demos that need
+resources that are not included.
+
+ssao:
+scenerendering:
+ Sibenik model, no license found
+
+deferred:
+deferredmultisampling:
+deferredshadows:
+ armor model, CC-BY-3.0
+
+vulkanscene:
+imgui:
+shadowmapping:
+ vulkanscene model, no license found
+
+indirectdraw:
+ plant model, no license found
+
+hdr:
+pbribl:
+pbrtexture:
+ Require external Vulkan Asset Pack
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ CMakeLists.txt | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4958fff..0f9d3e4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -150,17 +150,11 @@ set(EXAMPLES
+ computeparticles
+ computeshader
+ debugmarker
+- deferred
+- deferredmultisampling
+- deferredshadows
+ displacement
+ distancefieldfonts
+ dynamicuniformbuffer
+ gears
+ geometryshader
+- hdr
+- imgui
+- indirectdraw
+ instancing
+ mesh
+ multisampling
+@@ -170,20 +164,14 @@ set(EXAMPLES
+ parallaxmapping
+ particlefire
+ pbrbasic
+- pbribl
+- pbrtexture
+ pipelines
+ pushconstants
+ radialblur
+ raytracing
+- scenerendering
+ screenshot
+- shadowmapping
+- shadowmappingomni
+ skeletalanimation
+ specializationconstants
+ sphericalenvmapping
+- ssao
+ subpasses
+ terraintessellation
+ tessellation
+@@ -196,7 +184,6 @@ set(EXAMPLES
+ texturesparseresidency
+ triangle
+ viewportarray
+- vulkanscene
+ )
+
+ buildExamples()
+--
+2.13.2
+
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Fix-build-on-x86.patch b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Fix-build-on-x86.patch
new file mode 100644
index 000000000..681b3422d
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Fix-build-on-x86.patch
@@ -0,0 +1,41 @@
+From b0495efb6c3ea3a530fcbaddac86da57ecce5a66 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 10 Jul 2017 13:11:12 +0300
+Subject: [PATCH] Fix build on x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| func_common.inl:193:51: error: wrong number of template arguments
+| (5, should be 6) struct compute_sign<T, P, vecType, false, Aligned>
+
+The fix is backported from the upstream glm project.
+
+Upstream-Status: Pending [https://github.com/SaschaWillems/Vulkan/issues/356]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ external/glm/glm/detail/func_common.inl | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/external/glm/glm/detail/func_common.inl b/external/glm/glm/detail/func_common.inl
+index cafaed5..2dd94e1 100644
+--- a/external/glm/glm/detail/func_common.inl
++++ b/external/glm/glm/detail/func_common.inl
+@@ -190,12 +190,12 @@ namespace detail
+
+ # if GLM_ARCH == GLM_ARCH_X86
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
+- struct compute_sign<T, P, vecType, false, Aligned>
++ struct compute_sign<L, T, P, vecType, false, Aligned>
+ {
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
+ {
+ T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
+- vecType<L, T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
++ vecType<L, T, P> const y(vecType<L, typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
+
+ return (x >> Shift) | y;
+ }
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Support-installing-demos-support-out-of-tree-builds.patch b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Support-installing-demos-support-out-of-tree-builds.patch
new file mode 100644
index 000000000..4addea3bf
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan-demos/0001-Support-installing-demos-support-out-of-tree-builds.patch
@@ -0,0 +1,85 @@
+From edca667684764cfcc0460e448e834fadf623a887 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 3 Jul 2017 14:49:18 +0300
+Subject: [PATCH] Support installing demos, support out-of-tree builds
+
+This is especially useful for cross-compile situation where testing
+happens on target.
+
+-DRESOURCE_INSTALL_DIR=<path> decides where data is installed (and
+where the binaries will load the data from): if it's left empty,
+then nothing will be installed and binaries will load the data from
+CMAKE_SOURCE_DIR.
+
+Binaries are now correctly built in CMAKE_BINARY_DIR.
+
+Upstream-Status: Submitted [https://github.com/SaschaWillems/Vulkan/pull/352]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ CMakeLists.txt | 15 ++++++++++++++-
+ base/vulkanexamplebase.cpp | 2 +-
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b9886bc..4958fff 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,6 +16,8 @@ include_directories(base)
+ OPTION(USE_D2D_WSI "Build the project using Direct to Display swapchain" OFF)
+ OPTION(USE_WAYLAND_WSI "Build the project using Wayland swapchain" OFF)
+
++set(RESOURCE_INSTALL_DIR "" CACHE PATH "Path to install resources to (leave empty for running uninstalled)")
++
+ # Use FindVulkan module added with CMAKE 3.7
+ if (NOT CMAKE_VERSION VERSION_LESS 3.7.0)
+ message(STATUS "Using module to find Vulkan")
+@@ -108,6 +110,10 @@ function(buildExample EXAMPLE_NAME)
+ add_executable(${EXAMPLE_NAME} ${MAIN_CPP} ${SOURCE} ${SHADERS})
+ target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ endif(WIN32)
++
++ if(RESOURCE_INSTALL_DIR)
++ install(TARGETS ${EXAMPLE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
++ endif()
+ endfunction(buildExample)
+
+ # Build all examples
+@@ -117,6 +123,13 @@ function(buildExamples)
+ endforeach(EXAMPLE)
+ endfunction(buildExamples)
+
++if(RESOURCE_INSTALL_DIR)
++ add_definitions(-DVK_EXAMPLE_DATA_DIR=\"${RESOURCE_INSTALL_DIR}/\")
++ install(DIRECTORY data/ DESTINATION ${RESOURCE_INSTALL_DIR}/)
++else()
++ add_definitions(-DVK_EXAMPLE_DATA_DIR=\"${CMAKE_SOURCE_DIR}/data/\")
++endif()
++
+ # Compiler specific stuff
+ IF(MSVC)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+@@ -128,7 +141,7 @@ ELSE(WIN32)
+ link_libraries(${XCB_LIBRARIES} ${Vulkan_LIBRARY})
+ ENDIF(WIN32)
+
+-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")
++set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
+
+ set(EXAMPLES
+ bloom
+diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp
+index 647368a..a0f28a5 100644
+--- a/base/vulkanexamplebase.cpp
++++ b/base/vulkanexamplebase.cpp
+@@ -84,7 +84,7 @@ const std::string VulkanExampleBase::getAssetPath()
+ #if defined(__ANDROID__)
+ return "";
+ #else
+- return "./../data/";
++ return VK_EXAMPLE_DATA_DIR;
+ #endif
+ }
+ #endif
+--
+2.13.2
+
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan-demos_git.bb b/poky/meta/recipes-graphics/vulkan/vulkan-demos_git.bb
new file mode 100644
index 000000000..5fc9c2dba
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan-demos_git.bb
@@ -0,0 +1,41 @@
+DESCRIPTION = "Collection of Vulkan examples"
+LICENSE = "MIT"
+DEPENDS = "zlib"
+
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=dcf473723faabf17baa9b5f2207599d0 \
+ file://triangle/triangle.cpp;endline=12;md5=bccd1bf9cadd9e10086cf7872157e4fa"
+
+SRC_URI = "git://github.com/SaschaWillems/Vulkan.git \
+ file://0001-Support-installing-demos-support-out-of-tree-builds.patch \
+ file://0001-Don-t-build-demos-with-questionably-licensed-data.patch \
+ file://0001-Fix-build-on-x86.patch \
+"
+UPSTREAM_CHECK_COMMITS = "1"
+SRCREV = "18df00c7b4677b0889486e16977857aa987947e2"
+UPSTREAM_CHECK_GITTAGREGEX = "These are not the releases you're looking for"
+S = "${WORKDIR}/git"
+
+REQUIRED_DISTRO_FEATURES = 'vulkan'
+
+inherit cmake distro_features_check
+DEPENDS = "vulkan assimp"
+
+do_install_append () {
+ # Remove assets that have uncertain licenses
+ rm ${D}${datadir}/vulkan-demos/models/armor/* \
+ ${D}${datadir}/vulkan-demos/models/sibenik/* \
+ ${D}${datadir}/vulkan-demos/models/vulkanscene* \
+ ${D}${datadir}/vulkan-demos/models/plants.dae \
+ ${D}${datadir}/vulkan-demos/textures/texturearray_plants*
+
+ mv ${D}${bindir}/screenshot ${D}${bindir}/vulkan-screenshot
+}
+
+EXTRA_OECMAKE = "-DRESOURCE_INSTALL_DIR=${datadir}/vulkan-demos"
+
+ANY_OF_DISTRO_FEATURES = "x11 wayland"
+
+# Can only pick one of [wayland,xcb]
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'xcb' ,d)}"
+PACKAGECONFIG[wayland] = "-DUSE_WAYLAND_WSI=ON, -DUSE_WAYLAND_WSI=OFF, wayland"
+PACKAGECONFIG[xcb] = ",,libxcb"
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch b/poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch
new file mode 100644
index 000000000..bcf84a5a3
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan/demos-Don-t-build-tri-or-cube.patch
@@ -0,0 +1,108 @@
+commit f63cbe944107b5cd8f150ceaaec43b26099d5688
+Author: Adam Jackson <ajax@redhat.com>
+Date: Tue Feb 16 10:05:25 2016 -0500
+
+ demos: Don't build tri or cube
+
+ There are more interesting demos, all we really want here is vulkaninfo.
+ This helps because we don't need to pre-build glslang/llvm/lunarglass
+ just to get the loader and layers.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+Index: git/demos/CMakeLists.txt
+===================================================================
+--- git.orig/demos/CMakeLists.txt
++++ git/demos/CMakeLists.txt
+@@ -63,46 +63,6 @@ elseif(UNIX)
+ else()
+ endif()
+
+-if(WIN32)
+- # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory.
+- # 32-bit target data goes in build32, and 64-bit target data goes into build. So, include/link the
+- # appropriate data at build time.
+- if (CMAKE_CL_64)
+- set (BUILDTGT_DIR build)
+- else ()
+- set (BUILDTGT_DIR build32)
+- endif()
+-
+- # Use static MSVCRT libraries
+- foreach(configuration in CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
+- CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+- if(${configuration} MATCHES "/MD")
+- string(REGEX REPLACE "/MD" "/MT" ${configuration} "${${configuration}}")
+- endif()
+- endforeach()
+-
+- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
+- COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
+- DEPENDS cube.vert ${GLSLANG_VALIDATOR}
+- )
+- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
+- COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
+- DEPENDS cube.frag ${GLSLANG_VALIDATOR}
+- )
+- file(COPY cube.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
+- file(COPY vulkaninfo.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos)
+-else()
+- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv
+- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert
+- DEPENDS cube.vert ${GLSLANG_VALIDATOR}
+- )
+- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv
+- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag
+- DEPENDS cube.frag ${GLSLANG_VALIDATOR}
+- )
+- endif()
+-endif()
+
+ if(WIN32)
+ include_directories (
+@@ -116,43 +76,6 @@ endif()
+ add_executable(${API_LOWERCASE}info vulkaninfo.c)
+ target_link_libraries(${API_LOWERCASE}info ${LIBRARIES})
+
+-if(NOT WIN32)
+- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+- add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+- target_link_libraries(cube ${LIBRARIES})
+- endif()
+-else()
+- if (CMAKE_CL_64)
+- set (LIB_DIR "Win64")
+- else()
+- set (LIB_DIR "Win32")
+- endif()
+-
+- add_executable(cube WIN32 cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+- target_link_libraries(cube ${LIBRARIES})
+-endif()
+-
+-if(NOT WIN32)
+- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
+- add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+- target_link_libraries(cubepp ${LIBRARIES})
+- endif()
+-else()
+- if (CMAKE_CL_64)
+- set (LIB_DIR "Win64")
+- else()
+- set (LIB_DIR "Win32")
+- endif()
+-
+- add_executable(cubepp WIN32 cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
+- target_link_libraries(cubepp ${LIBRARIES})
+-endif()
+-
+-if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}))
+- if ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android"))
+- add_subdirectory(smoke)
+- endif()
+-endif()
+
+ if(UNIX)
+ if(INSTALL_LVL_FILES)
diff --git a/poky/meta/recipes-graphics/vulkan/vulkan_1.0.65.2.bb b/poky/meta/recipes-graphics/vulkan/vulkan_1.0.65.2.bb
new file mode 100644
index 000000000..1c8a89550
--- /dev/null
+++ b/poky/meta/recipes-graphics/vulkan/vulkan_1.0.65.2.bb
@@ -0,0 +1,36 @@
+SUMMARY = "3D graphics and compute API common loader"
+DESCRIPTION = "Vulkan is a new generation graphics and compute API \
+that provides efficient access to modern GPUs. These packages \
+provide only the common vendor-agnostic library loader, headers and \
+the vulkaninfo utility."
+HOMEPAGE = "https://www.khronos.org/vulkan/"
+BUGTRACKER = "https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=99c647ca3d4f6a4b9d8628f757aad156 \
+ file://loader/loader.c;endline=25;md5=a87cd5442291c23d1fce4eece4cfde9d"
+SRC_URI = "git://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git;branch=sdk-1.0.65 \
+ file://demos-Don-t-build-tri-or-cube.patch \
+ "
+SRCREV = "73486a1a169d862d5210e2ad520d95319a2383fa"
+UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+REQUIRED_DISTRO_FEATURES = "vulkan"
+
+inherit cmake python3native lib_package distro_features_check
+ANY_OF_DISTRO_FEATURES = "x11 wayland"
+
+EXTRA_OECMAKE = "-DBUILD_WSI_MIR_SUPPORT=OFF \
+ -DBUILD_LAYERS=OFF \
+ -DBUILD_TESTS=OFF"
+
+# must choose x11 or wayland or both
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '' ,d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '' ,d)}"
+PACKAGECONFIG[x11] = "-DBUILD_WSI_XLIB_SUPPORT=ON -DBUILD_WSI_XCB_SUPPORT=ON -DDEMOS_WSI_SELECTION=XCB, -DBUILD_WSI_XLIB_SUPPORT=OFF -DBUILD_WSI_XCB_SUPPORT=OFF -DDEMOS_WSI_SELECTION=WAYLAND, libxcb libx11 libxrandr"
+PACKAGECONFIG[wayland] = "-DBUILD_WSI_WAYLAND_SUPPORT=ON, -DBUILD_WSI_WAYLAND_SUPPORT=OFF, wayland"
+
+RRECOMMENDS_${PN} = "mesa-vulkan-drivers"
diff --git a/poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch b/poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch
new file mode 100644
index 000000000..a0c826ed9
--- /dev/null
+++ b/poky/meta/recipes-graphics/waffle/waffle/0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch
@@ -0,0 +1,54 @@
+From 3b9b8f5f6d1b99af43e95ec0868404e552a85b73 Mon Sep 17 00:00:00 2001
+From: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Thu, 19 Mar 2015 22:26:11 +0000
+Subject: [PATCH] third_party/threads: Use PTHREAD_MUTEX_RECURSIVE by default
+
+PTHREAD_MUTEX_RECURSIVE_NP was used for compatibility with old glibc.
+Although due to the_GNU_SOURCES define the portable,
+PTHREAD_MUTEX_RECURSIVE will be available for Linuxes since at least
+1998. Simplify things giving us compatibility with musl which
+apparently does not provide the non-portable define.
+
+Inspired by almost identical commit in mesa aead7fe2e2b(c11/threads: Use
+PTHREAD_MUTEX_RECURSIVE by default) by Felix Janda.
+
+Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+Reviewed-by: Chad Versace <chad.versace@intel.com>
+---
+Upstream-Status: Backport
+
+ third_party/threads/threads_posix.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/third_party/threads/threads_posix.c b/third_party/threads/threads_posix.c
+index 5835e43..e122bf9 100644
+--- a/third_party/threads/threads_posix.c
++++ b/third_party/threads/threads_posix.c
+@@ -26,6 +26,9 @@
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
++
++#define _GNU_SOURCE
++
+ #include <stdlib.h>
+ #ifndef assert
+ #include <assert.h>
+@@ -150,13 +153,8 @@ int mtx_init(mtx_t *mtx, int type)
+ && type != (mtx_try|mtx_recursive))
+ return thrd_error;
+ pthread_mutexattr_init(&attr);
+- if ((type & mtx_recursive) != 0) {
+-#if defined(__linux__) || defined(__linux)
+- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+-#else
++ if ((type & mtx_recursive) != 0)
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+-#endif
+- }
+ pthread_mutex_init(mtx, &attr);
+ pthread_mutexattr_destroy(&attr);
+ return thrd_success;
+--
+2.5.2
+
diff --git a/poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb b/poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
new file mode 100644
index 000000000..43c3edc05
--- /dev/null
+++ b/poky/meta/recipes-graphics/waffle/waffle_1.5.2.bb
@@ -0,0 +1,37 @@
+SUMMARY = "cross-platform C library to defer selection of GL API and of window system"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4c5154407c2490750dd461c50ad94797 \
+ file://include/waffle/waffle.h;endline=24;md5=61dbf8697f61c78645e75a93c585b1bf"
+
+SRC_URI = "http://waffle-gl.org/files/release/${BPN}-${PV}/${BPN}-${PV}.tar.xz \
+ file://0001-third_party-threads-Use-PTHREAD_MUTEX_RECURSIVE-by-d.patch \
+ "
+SRC_URI[md5sum] = "c669c91bf2f7e13a5d781c3dbb30fd8c"
+SRC_URI[sha256sum] = "d2c096cf654bf0061323a4b9231a1ef5b749a1e5c7c5bfe067e964219c2a851c"
+
+UPSTREAM_CHECK_URI = "http://www.waffle-gl.org/releases.html"
+
+inherit cmake distro_features_check lib_package
+
+# This should be overridden per-machine to reflect the capabilities of the GL
+# stack.
+PACKAGECONFIG ??= "glx"
+
+# libx11 requires x11 in DISTRO_FEATURES.
+REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'glx', 'x11', '', d)}"
+
+# virtual/libgl requires opengl in DISTRO_FEATURES.
+REQUIRED_DISTRO_FEATURES += "${@bb.utils.contains('DEPENDS', 'virtual/${MLPREFIX}libgl', 'opengl', '', d)}"
+
+# I say virtual/libgl, actually wants gl.pc
+PACKAGECONFIG[glx] = "-Dwaffle_has_glx=1,-Dwaffle_has_glx=0,virtual/${MLPREFIX}libgl libx11"
+
+# I say virtual/libgl, actually wants wayland-egl.pc, egl.pc, and the wayland
+# DISTRO_FEATURE.
+PACKAGECONFIG[wayland] = "-Dwaffle_has_wayland=1,-Dwaffle_has_wayland=0,virtual/${MLPREFIX}libgl wayland"
+
+# I say virtual/libgl, actually wants gbm.pc egl.pc
+PACKAGECONFIG[gbm] = "-Dwaffle_has_gbm=1,-Dwaffle_has_gbm=0,virtual/${MLPREFIX}libgl udev"
+
+# I say virtual/libgl, actually wants egl.pc
+PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=1,-Dwaffle_has_x11_egl=0,virtual/${MLPREFIX}libgl libxcb"
diff --git a/poky/meta/recipes-graphics/wayland/libinput_1.9.4.bb b/poky/meta/recipes-graphics/wayland/libinput_1.9.4.bb
new file mode 100644
index 000000000..67a49dfe0
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/libinput_1.9.4.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Library to handle input devices in Wayland compositors"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2184aef38ff137ed33ce9a63b9d1eb8f"
+
+DEPENDS = "libevdev udev mtdev"
+
+SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
+ "
+SRC_URI[md5sum] = "8b43d07d1698fb207a0492fc67554d4f"
+SRC_URI[sha256sum] = "0bcdbd4c4e3c2a2db322fbdf2ef3284f2e6d6fb7be3af80e6d8de7783f675190"
+
+UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
+inherit meson pkgconfig lib_package
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libwacom] = "-Dlibwacom=true,-Dlibwacom=false,libwacom"
+PACKAGECONFIG[gui] = "-Ddebug-gui=true,-Ddebug-gui=false,cairo gtk+3"
+
+UDEVDIR = "`pkg-config --variable=udevdir udev`"
+
+EXTRA_OEMESON += "-Dudev-dir=${UDEVDIR} -Ddocumentation=false -Dtests=false"
+
+# package name changed in 1.8.1 upgrade: make sure package upgrades work
+RPROVIDES_${PN} = "libinput"
+RREPLACES_${PN} = "libinput"
+RCONFLICTS_${PN} = "libinput"
diff --git a/poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
new file mode 100644
index 000000000..ccd0ebbfc
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Multitouch Protocol Translation Library"
+
+DESCRIPTION = "mtdev is a library which transforms all variants of kernel \
+multitouch events to the slotted type B protocol. The events put into mtdev may \
+be from any MT device, specifically type A without contact tracking, type A with \
+contact tracking, or type B with contact tracking"
+
+HOMEPAGE = "http://bitmath.org/code/mtdev/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6"
+
+SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2"
+SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1"
+SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-graphics/wayland/wayland-protocols_1.13.bb b/poky/meta/recipes-graphics/wayland/wayland-protocols_1.13.bb
new file mode 100644
index 000000000..1ef1ee141
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/wayland-protocols_1.13.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Collection of additional Wayland protocols"
+DESCRIPTION = "Wayland protocols that add functionality not \
+available in the Wayland core protocol. Such protocols either add \
+completely new functionality, or extend the functionality of some other \
+protocol either in Wayland core, or some other protocol in \
+wayland-protocols."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \
+ file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ "
+SRC_URI[md5sum] = "29312149dafcd4a0e739ba94995a574d"
+SRC_URI[sha256sum] = "0758bc8008d5332f431b2a84fea7de64d971ce270ed208206a098ff2ebc68f38"
+
+inherit allarch autotools pkgconfig
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${datadir}/pkgconfig/wayland-protocols.pc"
diff --git a/poky/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch b/poky/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch
new file mode 100644
index 000000000..ad3526d98
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch
@@ -0,0 +1,32 @@
+Fix wayland-client and wayland-scanner pc files
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
+
+Index: wayland-1.14.0/src/wayland-client.pc.in
+===================================================================
+--- wayland-1.14.0.orig/src/wayland-client.pc.in
++++ wayland-1.14.0/src/wayland-client.pc.in
+@@ -1,7 +1,7 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ datarootdir=@datarootdir@
+-pkgdatadir=@datadir@/@PACKAGE@
++pkgdatadir=${pc_sysrootdir}@datadir@/@PACKAGE@
+ libdir=@libdir@
+ includedir=@includedir@
+
+Index: wayland-1.14.0/src/wayland-scanner.pc.in
+===================================================================
+--- wayland-1.14.0.orig/src/wayland-scanner.pc.in
++++ wayland-1.14.0/src/wayland-scanner.pc.in
+@@ -2,7 +2,7 @@ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ datarootdir=@datarootdir@
+ pkgdatadir=@datadir@/@PACKAGE@
+-wayland_scanner=@bindir@/wayland-scanner
++wayland_scanner=wayland-scanner
+
+ Name: Wayland Scanner
+ Description: Wayland scanner
diff --git a/poky/meta/recipes-graphics/wayland/wayland_1.14.0.bb b/poky/meta/recipes-graphics/wayland/wayland_1.14.0.bb
new file mode 100644
index 000000000..1a9ff9807
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/wayland_1.14.0.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Wayland, a protocol between a compositor and clients"
+DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
+as well as a C library implementation of that protocol. The compositor can be \
+a standalone display server running on Linux kernel modesetting and evdev \
+input devices, an X application, or a wayland client itself. The clients can \
+be traditional applications, X servers (rootless or fullscreen) or other \
+display servers."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
+ file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce"
+
+DEPENDS = "expat libxml2 libffi wayland-native"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ file://fixpathinpcfiles.patch \
+ "
+SRC_URI[md5sum] = "0235f6075c32c3be61cff94fa0b9f108"
+SRC_URI[sha256sum] = "ed80cabc0961a759a42092e2c39aabfc1ec9a13c86c98bbe2b812f008da27ab8"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-documentation --with-host-scanner"
+EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries"
+
+# Wayland installs a M4 macro for other projects to use, which uses the target
+# pkg-config to find files. Replace pkg-config with pkg-config-native.
+do_install_append_class-native() {
+ sed -e 's,PKG_CHECK_MODULES(.*),,g' \
+ -e 's,$PKG_CONFIG,pkg-config-native,g' \
+ -i ${D}/${datadir}/aclocal/wayland-scanner.m4
+}
+
+sysroot_stage_all_append_class-target () {
+ rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
+ cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
+}
+
+FILES_${PN} = "${libdir}/*${SOLIBS}"
+FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/wayland/weston-init.bb b/poky/meta/recipes-graphics/wayland/weston-init.bb
new file mode 100644
index 000000000..22ba5f3fb
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston-init.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://init \
+ file://weston.service \
+ file://weston-start"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+ install -Dm0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
+
+ # Install weston-start script
+ install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
+ sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
+ sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
+}
+
+inherit allarch update-rc.d distro_features_check systemd
+
+# rdepends on weston which depends on virtual/egl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+RDEPENDS_${PN} = "weston kbd"
+
+INITSCRIPT_NAME = "weston"
+INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "weston.service"
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/init b/poky/meta/recipes-graphics/wayland/weston-init/init
new file mode 100644
index 000000000..d3e87c6ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston-init/init
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: weston
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+### END INIT INFO
+
+if test -e /etc/default/weston ; then
+ . /etc/default/weston
+fi
+
+killproc() {
+ pid=`/bin/pidof $1`
+ [ "$pid" != "" ] && kill $pid
+}
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+ case $x in
+ weston=false)
+ echo "Weston disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+case "$1" in
+ start)
+ . /etc/profile
+
+ weston-start -- $OPTARGS
+ ;;
+
+ stop)
+ echo "Stopping Weston"
+ killproc weston
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston-start b/poky/meta/recipes-graphics/wayland/weston-init/weston-start
new file mode 100755
index 000000000..e72fbaaac
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -0,0 +1,69 @@
+#!/bin/sh
+# Copyright (C) 2016 O.S. Systems Software LTDA.
+# Copyright (C) 2016 Freescale Semiconductor
+
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+usage() {
+ cat <<EOF
+ $0 [<openvt arguments>] [-- <weston options>]
+EOF
+}
+
+## Module support
+modules_dir=@DATADIR@/weston-start
+
+# Add weston extra argument
+add_weston_argument() {
+ weston_args="$weston_args $1"
+}
+
+# Add openvt extra argument
+add_openvt_argument() {
+ openvt_args="$openvt_args $1"
+}
+
+if [ -n "$WAYLAND_DISPLAY" ]; then
+ echo "ERROR: A Wayland compositor is already running, nested Weston instance is not supported yet."
+ exit 1
+fi
+if [ -n "$DISPLAY" ]; then
+ launcher="weston"
+else
+ launcher="weston-launch --"
+fi
+
+openvt_args="-s"
+while [ -n "$1" ]; do
+ if [ "$1" = "--" ]; then
+ shift
+ break
+ fi
+ openvt_args="$openvt_args $1"
+ shift
+done
+
+weston_args=$*
+
+# Load and run modules
+if [ -d "$modules_dir" ]; then
+ for m in "$modules_dir"/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ # process module
+ . $m
+ done
+fi
+
+if test -z "$XDG_RUNTIME_DIR"; then
+ export XDG_RUNTIME_DIR=/run/user/`id -u`
+ if ! test -d "$XDG_RUNTIME_DIR"; then
+ mkdir --parents $XDG_RUNTIME_DIR
+ chmod 0700 $XDG_RUNTIME_DIR
+ fi
+fi
+
+exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log
diff --git a/poky/meta/recipes-graphics/wayland/weston-init/weston.service b/poky/meta/recipes-graphics/wayland/weston-init/weston.service
new file mode 100644
index 000000000..689ce4106
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Weston Wayland Compositor
+RequiresMountsFor=/run
+
+[Service]
+User=root
+EnvironmentFile=-/etc/default/weston
+ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 000000000..0671a4504
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,76 @@
+From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 May 2015 20:56:00 -0700
+Subject: [PATCH weston] make error() portable
+
+error() is not posix but gnu extension so may not be available on all
+kind of systemsi e.g. musl.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure.ac | 2 ++
+ libweston/weston-error.h | 20 ++++++++++++++++++++
+ libweston/weston-launch.c | 2 +-
+ 3 files changed, 23 insertions(+), 1 deletion(-)
+ create mode 100644 src/weston-error.h
+
+Index: weston-3.0.0/configure.ac
+===================================================================
+--- weston-3.0.0.orig/configure.ac
++++ weston-3.0.0/configure.ac
+@@ -103,6 +103,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+ [[#include <time.h>]])
+ AC_CHECK_HEADERS([execinfo.h])
+
++AC_CHECK_HEADERS([error.h])
++
+ AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
+
+ # check for libdrm as a build-time dependency only
+Index: weston-3.0.0/libweston/weston-error.h
+===================================================================
+--- /dev/null
++++ weston-3.0.0/libweston/weston-error.h
+@@ -0,0 +1,20 @@
++#ifndef _WESTON_ERROR_H
++#define _WESTON_ERROR_H
++
++#if defined(HAVE_ERROR_H)
++#include <error.h>
++#else
++#include <err.h>
++#include <string.h>
++#define _weston_error(S, E, F, ...) do { \
++ if (E) \
++ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
++ else \
++ err(S, F, ##__VA_ARGS__); \
++} while(0)
++
++#define error _weston_error
++#endif
++
++#endif
++
+Index: weston-3.0.0/libweston/weston-launch.c
+===================================================================
+--- weston-3.0.0.orig/libweston/weston-launch.c
++++ weston-3.0.0/libweston/weston-launch.c
+@@ -33,7 +33,6 @@
+ #include <poll.h>
+ #include <errno.h>
+
+-#include <error.h>
+ #include <getopt.h>
+
+ #include <sys/types.h>
+@@ -60,6 +59,7 @@
+ #endif
+
+ #include "weston-launch.h"
++#include "weston-error.h"
+
+ #define DRM_MAJOR 226
+
diff --git a/poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
new file mode 100644
index 000000000..70b988898
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -0,0 +1,174 @@
+From 8ff6ed03ec4079f32e9b34085414e57be4730e04 Mon Sep 17 00:00:00 2001
+From: Tom Hochstein <tom.hochstein@nxp.com>
+Date: Wed, 22 Feb 2017 15:53:30 +0200
+Subject: [PATCH] weston-launch: Provide a default version that doesn't require
+ PAM
+
+weston-launch requires PAM for starting weston as a non-root user.
+
+Since starting weston as root is a valid use case by itself, if
+PAM is not available, provide a default version of weston-launch
+without non-root-user support.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 9 +++++++--
+ libweston/weston-launch.c | 20 ++++++++++++++++++++
+ 2 files changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 46cb2c7..bb45f46 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -435,13 +435,17 @@ AC_ARG_ENABLE(resize-optimization,
+ AS_IF([test "x$enable_resize_optimization" = "xyes"],
+ [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
+
++AC_ARG_WITH(pam,
++ AS_HELP_STRING([--with-pam], [Use PAM]),
++ [use_pam=$withval], [use_pam=yes])
+ AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
+ AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
+-if test x$enable_weston_launch = xyes; then
++if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
+ WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
+ if test x$have_pam = xno; then
+- AC_ERROR([weston-launch requires pam])
++ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
+ fi
++ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
+ fi
+
+ AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
+@@ -701,6 +705,7 @@ AC_MSG_RESULT([
+ Enable developer documentation ${enable_devdocs}
+
+ weston-launch utility ${enable_weston_launch}
++ PAM support ${use_pam}
+ systemd-login support ${have_systemd_login}
+ systemd notify support ${enable_systemd_notify}
+
+diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
+index 0491896..07e7469 100644
+--- a/libweston/weston-launch.c
++++ b/libweston/weston-launch.c
+@@ -51,7 +51,9 @@
+
+ #include <pwd.h>
+ #include <grp.h>
++#ifdef HAVE_PAM
+ #include <security/pam_appl.h>
++#endif
+
+ #ifdef HAVE_SYSTEMD_LOGIN
+ #include <systemd/sd-login.h>
+@@ -93,8 +95,10 @@ drmSetMaster(int drm_fd)
+ #endif
+
+ struct weston_launch {
++#ifdef HAVE_PAM
+ struct pam_conv pc;
+ pam_handle_t *ph;
++#endif
+ int tty;
+ int ttynr;
+ int sock[2];
+@@ -181,6 +185,7 @@ weston_launch_allowed(struct weston_launch *wl)
+ return false;
+ }
+
++#ifdef HAVE_PAM
+ static int
+ pam_conversation_fn(int msg_count,
+ const struct pam_message **messages,
+@@ -221,6 +226,7 @@ setup_pam(struct weston_launch *wl)
+
+ return 0;
+ }
++#endif
+
+ static int
+ setup_launcher_socket(struct weston_launch *wl)
+@@ -414,6 +420,7 @@ quit(struct weston_launch *wl, int status)
+ close(wl->signalfd);
+ close(wl->sock[0]);
+
++#ifdef HAVE_PAM
+ if (wl->new_user) {
+ err = pam_close_session(wl->ph, 0);
+ if (err)
+@@ -421,6 +428,7 @@ quit(struct weston_launch *wl, int status)
+ err, pam_strerror(wl->ph, err));
+ pam_end(wl->ph, err);
+ }
++#endif
+
+ if (ioctl(wl->tty, KDSKBMUTE, 0) &&
+ ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
+@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+ setenv("HOME", wl->pw->pw_dir, 1);
+ setenv("SHELL", wl->pw->pw_shell, 1);
+
++#ifdef HAVE_PAM
+ env = pam_getenvlist(wl->ph);
+ if (env) {
+ for (i = 0; env[i]; ++i) {
+@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+ }
+ free(env);
+ }
++#endif
+
+ /*
+ * We open a new session, so it makes sense
+@@ -675,7 +685,9 @@ static void
+ help(const char *name)
+ {
+ fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
++#ifdef HAVE_PAM
+ fprintf(stderr, " -u, --user Start session as specified username\n");
++#endif
+ fprintf(stderr, " -t, --tty Start session on alternative tty\n");
+ fprintf(stderr, " -v, --verbose Be verbose\n");
+ fprintf(stderr, " -h, --help Display this help message\n");
+@@ -688,7 +700,9 @@ main(int argc, char *argv[])
+ int i, c;
+ char *tty = NULL;
+ struct option opts[] = {
++#ifdef HAVE_PAM
+ { "user", required_argument, NULL, 'u' },
++#endif
+ { "tty", required_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "help", no_argument, NULL, 'h' },
+@@ -700,9 +714,13 @@ main(int argc, char *argv[])
+ while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
+ switch (c) {
+ case 'u':
++#ifdef HAVE_PAM
+ wl.new_user = optarg;
+ if (getuid() != 0)
+ error(1, 0, "Permission denied. -u allowed for root only");
++#else
++ error(1, 0, "-u is unsupported in this weston-launch build");
++#endif
+ break;
+ case 't':
+ tty = optarg;
+@@ -740,8 +758,10 @@ main(int argc, char *argv[])
+ if (setup_tty(&wl, tty) < 0)
+ exit(EXIT_FAILURE);
+
++#ifdef HAVE_PAM
+ if (wl.new_user && setup_pam(&wl) < 0)
+ exit(EXIT_FAILURE);
++#endif
+
+ if (setup_launcher_socket(&wl) < 0)
+ exit(EXIT_FAILURE);
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/wayland/weston/fix-missing-header.patch b/poky/meta/recipes-graphics/wayland/weston/fix-missing-header.patch
new file mode 100644
index 000000000..55c0d4fd0
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/fix-missing-header.patch
@@ -0,0 +1,30 @@
+On the musl C library, tests/timespec-text.c does not build, with the
+following error:
+
+ In file included from tests/timespec-test.c:36:0:
+ ./shared/timespec-util.h:41:21: warning: ‘struct timespec’ declared
+ inside parameter list will not be visible outside of this definition
+ or declaration
+ timespec_sub(struct timespec *r,
+ ^~~~~~~~
+ [...]
+
+Indeed, struct timespec is defined in time.h, so we must include it.
+
+Upstream-Status: Backport [fa41bdfbc0b962fd73b89f01aab1a5370c9c28eb]
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
+Index: weston-3.0.0/shared/timespec-util.h
+===================================================================
+--- weston-3.0.0.orig/shared/timespec-util.h
++++ weston-3.0.0/shared/timespec-util.h
+@@ -28,6 +28,7 @@
+
+ #include <stdint.h>
+ #include <assert.h>
++#include <time.h>
+
+ #define NSEC_PER_SEC 1000000000
+
diff --git a/poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch b/poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch
new file mode 100644
index 000000000..b3e1d06f5
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch
@@ -0,0 +1,55 @@
+Multi-plane sub-sampled textures have partial width/height, e.g.
+YUV420/I420 has a full-size Y plane, followed by a half-width/height U
+plane, and a half-width/height V plane.
+
+zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each
+plane, but for wl_shm this must be inferred. gl-renderer was correctly
+accounting for the width and height when subsampling, but the pitch was
+being taken as the pitch for the first plane.
+
+This does not match the requirements for GStreamer's waylandsink, in
+particular, as well as other clients. Fix the SHM upload path to
+correctly set the pitch for each plane, according to subsampling.
+
+Tested with:
+ $ gst-launch-1.0 videotestsrc ! waylandsink
+
+Upstream-Status: Backport [https://patchwork.freedesktop.org/patch/180767/]
+
+Signed-off-by: Daniel Stone <daniels@collabora.com>
+Fixes: fdeefe42418 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420")
+Reported-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063
+
+---
+ libweston/gl-renderer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
+index 244ce309..40bf0bb6 100644
+--- a/libweston/gl-renderer.c
++++ b/libweston/gl-renderer.c
+@@ -1445,14 +1445,13 @@ gl_renderer_flush_damage(struct weston_surface *surface)
+ goto done;
+ }
+
+- glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch);
+-
+ if (gs->needs_full_upload) {
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
+ wl_shm_buffer_begin_access(buffer->shm_buffer);
+ for (j = 0; j < gs->num_textures; j++) {
+ glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]);
+ glTexImage2D(GL_TEXTURE_2D, 0,
+ gs->gl_format[j],
+ gs->pitch / gs->hsub[j],
+@@ -1477,6 +1476,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
+ glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1);
+ for (j = 0; j < gs->num_textures; j++) {
+ glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]);
+ glTexSubImage2D(GL_TEXTURE_2D, 0,
+ r.x1 / gs->hsub[j],
+ r.y1 / gs->vsub[j],
diff --git a/poky/meta/recipes-graphics/wayland/weston/weston.desktop b/poky/meta/recipes-graphics/wayland/weston/weston.desktop
new file mode 100644
index 000000000..1086ae8bf
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/weston.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Weston
+Comment=Wayland Compostitor
+Exec=weston
+Icon=weston
+Terminal=false
+Categories=Utility;
diff --git a/poky/meta/recipes-graphics/wayland/weston/weston.png b/poky/meta/recipes-graphics/wayland/weston/weston.png
new file mode 100644
index 000000000..ea8b7e0e2
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/weston.png
Binary files differ
diff --git a/poky/meta/recipes-graphics/wayland/weston/xwayland.weston-start b/poky/meta/recipes-graphics/wayland/weston/xwayland.weston-start
new file mode 100644
index 000000000..b483c97cf
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston/xwayland.weston-start
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if type Xwayland >/dev/null 2>/dev/null; then
+ mkdir -p /tmp/.X11-unix
+
+ add_weston_argument "--modules=xwayland.so"
+fi
diff --git a/poky/meta/recipes-graphics/wayland/weston_3.0.0.bb b/poky/meta/recipes-graphics/wayland/weston_3.0.0.bb
new file mode 100644
index 000000000..ad0cdc2b0
--- /dev/null
+++ b/poky/meta/recipes-graphics/wayland/weston_3.0.0.bb
@@ -0,0 +1,114 @@
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
+ file://libweston/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38"
+
+SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ file://weston.png \
+ file://weston.desktop \
+ file://0001-make-error-portable.patch \
+ file://xwayland.weston-start \
+ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
+ file://weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch \
+ file://fix-missing-header.patch \
+"
+SRC_URI[md5sum] = "9c42a4c51a1b9f35d040fa9d45ada36d"
+SRC_URI[sha256sum] = "cde1d55e8dd70c3cbb3d1ec72f60e60000041579caa1d6a262bd9c35e93723a5"
+
+inherit autotools pkgconfig useradd distro_features_check
+# depends on virtual/egl
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
+DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
+
+EXTRA_OECONF = "--enable-setuid-install \
+ --disable-rdp-compositor \
+ "
+EXTRA_OECONF_append_qemux86 = "\
+ WESTON_NATIVE_BACKEND=fbdev-backend.so \
+ "
+EXTRA_OECONF_append_qemux86-64 = "\
+ WESTON_NATIVE_BACKEND=fbdev-backend.so \
+ "
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
+ clients launch"
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
+# Weston on Wayland (nested Weston)
+PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
+# Weston on X11
+PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
+# Headless Weston
+PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
+# Weston on framebuffer
+PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
+# weston-launch
+PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
+# VA-API desktop recorder
+PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
+# Weston with EGL support
+PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
+# Weston with cairo glesv2 support
+PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
+# Weston with lcms support
+PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
+# Weston with webp support
+PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
+# Weston with unwinding support
+PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+# Weston with systemd-login support
+PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
+# Weston with Xwayland support (requires X11 and Wayland)
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
+# colord CMS support
+PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
+# Clients support
+PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
+# Weston with PAM support
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
+
+do_install_append() {
+ # Weston doesn't need the .la files to load modules, so wipe them
+ rm -f ${D}/${libdir}/libweston-3/*.la
+
+ # If X11, ship a desktop file to launch it
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+ install -d ${D}${datadir}/applications
+ install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
+
+ install -d ${D}${datadir}/icons/hicolor/48x48/apps
+ install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
+ install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
+ fi
+}
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
+ libweston-3 ${PN}-examples"
+
+FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
+
+FILES_libweston-3 = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-3/*.so"
+SUMMARY_libweston-3 = "Helper library for implementing 'wayland window managers'."
+
+FILES_${PN}-examples = "${bindir}/*"
+
+FILES_${PN}-xwayland = "${libdir}/libweston-3/xwayland.so"
+RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
+
+RDEPENDS_${PN} += "xkeyboard-config"
+RRECOMMENDS_${PN} = "liberation-fonts"
+RRECOMMENDS_${PN}-dev += "wayland-protocols"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
new file mode 100644
index 000000000..0b73127ae
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+if [ -x /usr/bin/dbus-launch ]; then
+ # As this is the X session script, always start a new DBus session.
+ eval `dbus-launch --sh-syntax --exit-with-session </dev/null`
+ echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
+fi
+
+. /etc/profile
+
+if [ -f $HOME/.profile ]; then
+ . $HOME/.profile
+fi
+
+SYSSESSIONDIR=/etc/X11/Xsession.d
+
+export CLUTTER_DISABLE_MIPMAPPED_TEXT=1
+
+for SESSIONFILE in $SYSSESSIONDIR/*; do
+ set +e
+ case "$SESSIONFILE" in
+ *.sh)
+ . "$SESSIONFILE"
+ ;;
+ *.shbg)
+ "$SESSIONFILE" &
+ ;;
+ *~)
+ # Ignore backup files
+ ;;
+ *)
+ "$SESSIONFILE"
+ ;;
+ esac
+ set -e
+done
+
+exit 0
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
new file mode 100644
index 000000000..6bd40b2fc
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/13xdgbasedirs.sh
@@ -0,0 +1,13 @@
+# Minimal/stub implementation of the XDG Base Directory specification.
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+#
+# Wayland needs XDG_RUNTIME_DIR, so set it to /tmp. This isn't compliant with
+# the specification (wrong mode, wrong owner) but it's mostly sufficient.
+#
+# In the ideal case where SystemD is booting and userspace is initiated by a
+# SystemD user session this will have been set already, so don't overwrite it.
+
+if [ -z "$XDG_RUNTIME_DIR" ]; then
+ XDG_RUNTIME_DIR="/tmp"
+ export XDG_RUNTIME_DIR
+fi
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
new file mode 100644
index 000000000..3d7008ca4
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/89xdgautostart.sh
@@ -0,0 +1,7 @@
+XDGAUTOSTART=/etc/xdg/autostart
+if [ -d $XDGAUTOSTART ]; then
+ for SCRIPT in $XDGAUTOSTART/*; do
+ CMD=`grep ^Exec= $SCRIPT | cut -d '=' -f 2`
+ $CMD &
+ done
+fi
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
new file mode 100644
index 000000000..b936dedf3
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/X11/Xsession.d/90XWindowManager.sh
@@ -0,0 +1,7 @@
+if [ -x $HOME/.Xsession ]; then
+ exec $HOME/.Xsession
+elif [ -x /usr/bin/x-session-manager ]; then
+ exec /usr/bin/x-session-manager
+else
+ exec /usr/bin/x-window-manager
+fi
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
new file mode 100644
index 000000000..0edbfbfc2
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# This script is only needed to make sure /etc/X11/xserver-common
+# can affect XSERVER, ARGS & DPI: otherwise systemd could just use
+# /etc/default/xserver-nodm as EnvironmentFile and sysvinit could just
+# source the same file
+
+. /etc/profile
+
+# load default values for XSERVER, ARGS, DISPLAY...
+. /etc/default/xserver-nodm
+
+# Allow xserver-common to override ARGS, XSERVER, DPI
+if [ -e /etc/X11/xserver-common ] ; then
+ . /etc/X11/xserver-common
+ if [ ! -e $XSERVER ] ; then
+ XSERVER=$(which $XSERVER)
+ fi
+fi
+
+if [ -n "$DPI" ] ; then
+ ARGS="$ARGS -dpi $DPI"
+fi
+
+exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch
new file mode 100644
index 000000000..eff975e34
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch
@@ -0,0 +1,355 @@
+COPYING: add GPLv2 license file
+
+this is a local file recipe and the license file is missing.In order
+to pass the license checksum checking, the license file is needed. So
+this patch add the GPLv2 license file.
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
new file mode 100755
index 000000000..6c548551b
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: xserver
+# Required-Start: $local_fs $remote_fs dbus
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 5
+# Default-Stop: 0 1 2 3 6
+### END INIT INFO
+
+killproc() { # kill the named process(es)
+ pid=`/bin/pidof $1`
+ [ "$pid" != "" ] && kill $pid
+}
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+ case $x in
+ x11=false)
+ echo "X Server disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+case "$1" in
+ start)
+ . /etc/profile
+
+ #default for USER
+ . /etc/default/xserver-nodm
+ echo "Starting Xserver"
+ if [ "$USER" != "root" ]; then
+ # setting for rootless X
+ chmod o+w /var/log
+ chmod g+r /dev/tty[0-3]
+ # hidraw device is probably needed
+ if [ -e /dev/hidraw0 ]; then
+ chmod o+rw /dev/hidraw*
+ fi
+ fi
+
+ # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
+ su -l -c '/etc/xserver-nodm/Xserver &' $USER
+ # Wait for the desktop to say its finished loading
+ # before loading the rest of the system
+ # dbus-wait org.matchbox_project.desktop Loaded
+ ;;
+
+ stop)
+ echo "Stopping XServer"
+ killproc xinit
+ sleep 1
+ chvt 1 &
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
new file mode 100644
index 000000000..4a9670d8d
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
@@ -0,0 +1,7 @@
+# common environment file for sysvinit and systemd
+
+XSERVER=/usr/bin/Xorg
+DISPLAY=:0
+ARGS=" -br -pn @BLANK_ARGS@ @NO_CURSOR_ARG@ "
+HOME=@HOME@
+USER=@USER@
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in
new file mode 100644
index 000000000..87dc4f8fc
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Xserver startup without a display manager
+
+[Service]
+EnvironmentFile=/etc/default/xserver-nodm
+User=@USER@
+ExecStart=/etc/xserver-nodm/Xserver
+Restart=always
+
+[Install]
+Alias=display-manager.service
diff --git a/poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
new file mode 100644
index 000000000..a77c56445
--- /dev/null
+++ b/poky/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
@@ -0,0 +1,69 @@
+SUMMARY = "Simple Xserver Init Script (no dm)"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "x11"
+PR = "r31"
+
+SRC_URI = "file://xserver-nodm \
+ file://Xserver \
+ file://X11 \
+ file://gplv2-license.patch \
+ file://xserver-nodm.service.in \
+ file://xserver-nodm.conf.in \
+"
+
+S = "${WORKDIR}"
+
+# Since we refer to ROOTLESS_X which is normally enabled per-machine
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "blank"
+# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
+PACKAGECONFIG[blank] = ""
+PACKAGECONFIG[nocursor] = ""
+
+do_install() {
+ install -d ${D}${sysconfdir}/default
+ install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
+ install -d ${D}${sysconfdir}/xserver-nodm
+ install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
+ install -d ${D}${sysconfdir}/X11/Xsession.d
+ install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
+ install X11/Xsession ${D}${sysconfdir}/X11/
+
+ BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
+ NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
+ if [ "${ROOTLESS_X}" = "1" ] ; then
+ XUSER_HOME="/home/xuser"
+ XUSER="xuser"
+ else
+ XUSER_HOME=${ROOT_HOME}
+ XUSER="root"
+ fi
+ sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
+ ${D}${sysconfdir}/default/xserver-nodm
+ sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
+ sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install xserver-nodm ${D}${sysconfdir}/init.d
+ fi
+}
+
+RDEPENDS_${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
+
+INITSCRIPT_NAME = "xserver-nodm"
+INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
+SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
+
+RCONFLICTS_${PN} = "xserver-common (< 1.34-r9) x11-common"
diff --git a/poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb b/poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb
new file mode 100644
index 000000000..a4ab7f6eb
--- /dev/null
+++ b/poky/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_git.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Transparent X11 cursor theme for touchscreens"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SECTION = "x11/base"
+
+SRCREV = "23c8af5ba4a1b7efbaf0bbca59a65ff7e10a1a06"
+PV = "0.1.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN};branch=master"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools allarch
+
+FILES_${PN} = "${datadir}/icons/xcursor-transparent/cursors/*"
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
new file mode 100644
index 000000000..9633fc5f3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
@@ -0,0 +1 @@
+# replace with valid machine specific pointercal.xinput
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/qemuall/pointercal.xinput b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/qemuall/pointercal.xinput
new file mode 100644
index 000000000..a816d6d10
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/qemuall/pointercal.xinput
@@ -0,0 +1,2 @@
+# Dummy pointercal.xinput file to prevent xinput_calibrator
+# from running on qemu startup
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
new file mode 100644
index 000000000..65348c376
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Touchscreen calibration data from xinput-calibrator"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r7"
+
+SRC_URI = "file://pointercal.xinput"
+S = "${WORKDIR}"
+
+do_install() {
+ # Only install file if it has a contents
+ if [ -s ${S}/pointercal.xinput ] &&\
+ [ ! -n "$(head -n1 ${S}/pointercal.xinput|grep "replace.*pointercal\.xinput")" ]; then
+ install -d ${D}${sysconfdir}/
+ install -m 0644 ${S}/pointercal.xinput ${D}${sysconfdir}/
+ fi
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh
new file mode 100644
index 000000000..529072678
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+ /usr/bin/xinput_calibrator_once.sh
+fi
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch
new file mode 100644
index 000000000..86982924a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch
@@ -0,0 +1,66 @@
+Upstream-Status: Pending
+
+From 14734a93bd3fc323325459e24b04795422e395e6 Mon Sep 17 00:00:00 2001
+From: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Date: Mon, 1 Jul 2013 15:38:02 +0300
+Subject: [PATCH] Allow xinput_calibrator_pointercal.sh to be run as normal
+ user
+
+Allow normal user to create their own pointercal.xinput files that
+override the system pointercal file in /etc.
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+---
+ scripts/xinput_calibrator_pointercal.sh | 33 +++++++++++++++++++++----------
+ 1 file changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh
+index fccb197..0ada7da 100755
+--- a/scripts/xinput_calibrator_pointercal.sh
++++ b/scripts/xinput_calibrator_pointercal.sh
+@@ -11,19 +11,32 @@
+ PATH="/usr/bin:$PATH"
+
+ BINARY="xinput_calibrator"
+-CALFILE="/etc/pointercal.xinput"
+-LOGFILE="/var/log/xinput_calibrator.pointercal.log"
++SYS_CALFILE="/etc/pointercal.xinput"
++USER_CALFILE="$HOME/.pointercal/pointercal.xinput"
+
+-if [ -e $CALFILE ] ; then
+- if grep replace $CALFILE ; then
+- echo "Empty calibration file found, removing it"
+- rm $CALFILE
+- else
+- echo "Using calibration data stored in $CALFILE"
+- . $CALFILE && exit 0
+- fi
++if [ "$USER" = "root" ]; then
++ LOGFILE="/var/log/xinput_calibrator.pointercal.log"
++ CALFILES="$SYS_CALFILE"
++else
++ LOGFILE="$HOME/.pointercal/xinput_calibrator.pointercal.log"
++ CALFILES="$USER_CALFILE $SYS_CALFILE"
++ mkdir -p "$HOME/.pointercal"
+ fi
+
++for CALFILE in $CALFILES; do
++ if [ -e $CALFILE ]; then
++ if grep replace $CALFILE ; then
++ echo "Empty calibration file found, removing it"
++ rm $CALFILE 2>/dev/null || true
++ else
++ echo "Using calibration data stored in $CALFILE"
++ . $CALFILE && exit 0
++ fi
++ fi
++done
++
++[ "$USER" != "root" ] && CALFILE=$USER_CALFILE
++
+ CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep ' xinput set' | sed 's/^ //g; s/$/;/g'`
+ if [ ! -z "$CALDATA" ] ; then
+ echo $CALDATA > $CALFILE
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
new file mode 100644
index 000000000..68e62ea6d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Touchscreen calibration program for X11"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=1bcba08f67cdb56f34021557898e4b5a"
+DEPENDS = "virtual/libx11 libxi libxrandr"
+
+PV = "0.7.5+git${SRCPV}"
+PR = "r6"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "03dadf55109bd43d3380f040debe9f82f66f2f35"
+SRC_URI = "git://github.com/tias/xinput_calibrator.git \
+ file://30xinput_calibrate.sh \
+ file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch"
+
+S = "${WORKDIR}/git"
+
+# force native X11 ui as we don't have gtk+ in DEPENDS
+EXTRA_OECONF += "--with-gui=x11"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
+
+ install -d ${D}${sysconfdir}/X11/Xsession.d/
+ install -m 0755 ${WORKDIR}/30xinput_calibrate.sh ${D}${sysconfdir}/X11/Xsession.d/
+
+ install -d ${D}${sysconfdir}/xdg/autostart
+ sed -e 's,^Exec=.*,Exec=${bindir}/xinput_calibrator_once.sh,' ${S}/scripts/xinput_calibrator.desktop > ${D}${sysconfdir}/xdg/autostart/xinput_calibrator.desktop
+}
+
+FILES_${PN} += "${sysconfdir}/xdg/autostart"
+RDEPENDS_${PN} = "xinput formfactor"
+RRECOMMENDS_${PN} = "pointercal-xinput"
diff --git a/poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb b/poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
new file mode 100644
index 000000000..a453e2487
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
@@ -0,0 +1,22 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to create an index of X font files in a directory"
+
+DESCRIPTION = "For each directory argument, mkfontdir reads all of the \
+font files in the directory. The font names and related data are written \
+out to the files \"fonts.dir\", \"fonts.scale\", and \"fonts.alias\". \
+The X server and font server use these files to find the available font \
+files."
+
+PE = "1"
+PR = "${INC_PR}.0"
+
+RDEPENDS_${PN} += "mkfontscale"
+RDEPENDS_${PN}_class-native += "mkfontscale-native"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b4fcf2b90cadbfc15009b9e124dc3a3f"
+
+SRC_URI[md5sum] = "18c429148c96c2079edda922a2b67632"
+SRC_URI[sha256sum] = "56d52a482df130484e51fd066d1b6eda7c2c02ddbc91fe6e2be1b9c4e7306530"
diff --git a/poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb b/poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
new file mode 100644
index 000000000..31cf18676
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to create an index of scalable font files for X"
+
+DESCRIPTION = "For each directory argument, mkfontscale reads all of the \
+scalable font files in the directory. For every font file found, an X11 \
+font name (XLFD) is generated, and is written together with the file \
+name to a file fonts.scale in the directory. The resulting fonts.scale \
+is used by the mkfontdir program."
+
+DEPENDS = "util-macros-native zlib libfontenc freetype xproto"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e0d129d05305176d1a790e0ac1acb7f"
+
+SRC_URI[md5sum] = "9bdd6ebfa62b1bbd474906ac86a40fd8"
+SRC_URI[sha256sum] = "8c6d5228af885477b9aec60ca6f172578e7d2de42234357af62fb00439453f20"
diff --git a/poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb b/poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
new file mode 100644
index 000000000..87268046e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
@@ -0,0 +1,16 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 color name database"
+DESCRIPTION = "This package includes both the list mapping X color names \
+to RGB values (rgb.txt) and, if configured to use a database for color \
+lookup, the rgb program to convert the text file into the binary database \
+format."
+
+DEPENDS += " xproto util-macros"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ef598adbe241bd0b0b9113831f6e249a"
+PE = "1"
+
+SRC_URI[md5sum] = "eab5bbd7642e5c784429307ec210d198"
+SRC_URI[sha256sum] = "bbca7c6aa59939b9f6a0fb9fff15dfd62176420ffd4ae30c8d92a6a125fbe6b0"
+
+FILES_${PN} += "${datadir}/X11"
diff --git a/poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb b/poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
new file mode 100644
index 000000000..a06aa269b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
@@ -0,0 +1,23 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 server performance test program"
+
+DESCRIPTION = "The x11perf program runs one or more performance tests \
+and reports how fast an X server can execute the tests."
+
+
+DEPENDS += "libxmu libxrender libxft libxext fontconfig"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=428ca4d67a41fcd4fc3283dce9bbda7e \
+ file://x11perf.h;endline=24;md5=29555066baf406a105ff917ac25b2d01"
+
+PE = "1"
+
+do_install_append_class-target () {
+ sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${bindir}/x11perfcomp
+}
+
+FILES_${PN} += "${libdir}/X11/x11perfcomp/*"
+
+SRC_URI[md5sum] = "f0b24e4d8beb622a419e8431e1c03cd7"
+SRC_URI[sha256sum] = "e87098dec1947572d70c62697a7b70bde1ab5668237d4660080eade6bc096751"
diff --git a/poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb b/poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb
new file mode 100644
index 000000000..0e90ffd67
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xauth_1.0.10.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+SUMMARY = "X authority utilities"
+DESCRIPTION = "X application to edit and display the authorization \
+information used in connecting to the X server."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5ec74dd7ea4d10c4715a7c44f159a40b"
+
+DEPENDS += "libxau libxext libxmu"
+PE = "1"
+
+SRC_URI[md5sum] = "f3f76cb10f69b571c43893ea6a634aa4"
+SRC_URI[sha256sum] = "5afe42ce3cdf4f60520d1658d2b17face45c74050f39af45dccdc95e73fafc4d"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch b/poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch
new file mode 100644
index 000000000..1e8199cc6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Index: xdpyinfo-1.3.0/configure.ac
+===================================================================
+--- xdpyinfo-1.3.0.orig/configure.ac 2011-10-21 21:34:21.000000000 -0700
++++ xdpyinfo-1.3.0/configure.ac 2011-11-28 20:06:56.554056935 -0800
+@@ -47,11 +47,15 @@
+ AC_CHECK_HEADERS([X11/extensions/multibuf.h X11/extensions/XShm.h],,,[#include <X11/Xlib.h>])
+ CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+
++AC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]),
++ XKB="$enableval", XKB="yes")
++if test "x$XKB" = "xyes" ; then
+ PKG_CHECK_MODULES(DPY_XKB, x11,
+ [SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $DPY_XKB_CFLAGS $DPY_X11_CFLAGS"
+ AC_CHECK_HEADERS([X11/extensions/XKB.h X11/XKBlib.h],,,[#include <X11/Xlib.h>])
+ CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
++fi
+
+ PKG_CHECK_MODULES(DPY_XF86VIDMODE, xxf86vm,
+ [SAVE_CPPFLAGS="$CPPFLAGS"
diff --git a/poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb b/poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb
new file mode 100644
index 000000000..af04bb6e3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb
@@ -0,0 +1,20 @@
+require xorg-app-common.inc
+
+SUMMARY = "Display information utility for X"
+
+DESCRIPTION = "Xdpyinfo is a utility for displaying information about an \
+X server. It is used to examine the capabilities of a server, the \
+predefined values for various parameters used in communicating between \
+clients and the server, and the different types of screens and visuals \
+that are available."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f3d09e6b9e203a1af489e16c708f4fb3"
+DEPENDS += "libxtst libxext libxxf86vm libxxf86dga libxxf86misc libxi libxrender libxinerama libdmx libxau libxcomposite"
+PE = "1"
+
+SRC_URI += "file://disable-xkb.patch"
+
+SRC_URI[md5sum] = "8809037bd48599af55dad81c508b6b39"
+SRC_URI[sha256sum] = "30238ed915619e06ceb41721e5f747d67320555cc38d459e954839c189ccaf51"
+
+EXTRA_OECONF = "--disable-xkb"
diff --git a/poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch b/poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch
new file mode 100644
index 000000000..6130959f8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xev/diet-x11.patch
@@ -0,0 +1,82 @@
+Upstream-Status: Inappropriate [disable feature]
+
+---
+ xev.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+Index: xev-1.2.0/xev.c
+===================================================================
+--- xev-1.2.0.orig/xev.c
++++ xev-1.2.0/xev.c
+@@ -116,7 +116,7 @@ do_KeyPress (XEvent *eventp)
+ nbytes = XLookupString (e, str, 256, &ks, NULL);
+
+ /* not supposed to call XmbLookupString on a key release event */
+- if (e->type == KeyPress && xic) {
++ /*if (e->type == KeyPress && xic) {
+ do {
+ nmbbytes = XmbLookupString (xic, e, buf, bsize - 1, &ks, &status);
+ buf[nmbbytes] = '\0';
+@@ -126,7 +126,7 @@ do_KeyPress (XEvent *eventp)
+ buf = realloc (buf, bsize);
+ }
+ } while (status == XBufferOverflow);
+- }
++ }*/
+
+ if (ks == NoSymbol)
+ ksname = "NoSymbol";
+@@ -156,7 +156,7 @@ do_KeyPress (XEvent *eventp)
+ }
+
+ /* not supposed to call XmbLookupString on a key release event */
+- if (e->type == KeyPress && xic) {
++ /*if (e->type == KeyPress && xic) {
+ printf (" XmbLookupString gives %d bytes: ", nmbbytes);
+ if (nmbbytes > 0) {
+ dump (buf, nmbbytes);
+@@ -164,7 +164,7 @@ do_KeyPress (XEvent *eventp)
+ } else {
+ printf ("\n");
+ }
+- }
++ } */
+
+ printf (" XFilterEvent returns: %s\n",
+ XFilterEvent (eventp, e->window) ? "True" : "False");
+@@ -1015,7 +1015,7 @@ main (int argc, char **argv)
+ fprintf (stderr, "%s: XSetLocaleModifiers failed\n", ProgramName);
+ }
+
+- xim = XOpenIM (dpy, NULL, NULL, NULL);
++ /*xim = XOpenIM (dpy, NULL, NULL, NULL);
+ if (xim == NULL) {
+ fprintf (stderr, "%s: XOpenIM failed\n", ProgramName);
+ }
+@@ -1042,7 +1042,7 @@ main (int argc, char **argv)
+ }
+ XFree (xim_styles);
+ }
+- }
++ }*/
+
+ screen = DefaultScreen (dpy);
+
+@@ -1109,7 +1109,7 @@ main (int argc, char **argv)
+ printf ("Outer window is 0x%lx, inner window is 0x%lx\n", w, subw);
+ }
+
+- if (xim && xim_style) {
++ /*if (xim && xim_style) {
+ xic = XCreateIC (xim,
+ XNInputStyle, xim_style,
+ XNClientWindow, w,
+@@ -1119,7 +1119,7 @@ main (int argc, char **argv)
+ if (xic == NULL) {
+ fprintf (stderr, "XCreateIC failed\n");
+ }
+- }
++ }*/
+
+ have_rr = XRRQueryExtension (dpy, &rr_event_base, &rr_error_base);
+ if (have_rr) {
diff --git a/poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb b/poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb
new file mode 100644
index 000000000..f151b579e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xev_1.2.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "X Event Viewer"
+DESCRIPTION = "Xev creates a window and then asks the X server to send it events \
+whenever anything happens to the window (such as it being moved, resized, \
+typed in, clicked in, etc.). You can also attach it to an existing window."
+
+LIC_FILES_CHKSUM = "file://xev.c;beginline=1;endline=33;md5=577c99421f1803b891d2c79097ae4682"
+LICENSE = "MIT"
+
+PE = "1"
+
+DEPENDS += "libxrandr xproto"
+
+SRC_URI += "file://diet-x11.patch"
+
+SRC_URI[md5sum] = "249bdde90f01c0d861af52dc8fec379e"
+SRC_URI[sha256sum] = "d94ae62a6c1af56c2961d71f5782076ac4116f0fa4e401420ac7e0db33dc314f"
diff --git a/poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb b/poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb
new file mode 100644
index 000000000..84d0cb804
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb
@@ -0,0 +1,14 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 eyes that follow the mouse cursor demo"
+DESCRIPTION = "Xeyes is a small X11 application that shows a pair of eyes that move to \
+follow the location of the mouse cursor around the screen."
+
+PE = "1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3ea51b365051ac32d1813a7dbaa4bfc6"
+
+SRC_URI[md5sum] = "a3035dcecdbdb89e864177c080924981"
+SRC_URI[sha256sum] = "975e98680cd59e1f9439016386609546ed08c284d0f05a95276f96aca6e8a521"
+
+DEPENDS += "libxau libxt libxext libxmu libxrender"
diff --git a/poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb b/poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
new file mode 100644
index 000000000..77490f548
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
@@ -0,0 +1,20 @@
+require xorg-app-common.inc
+
+SUMMARY = "Server access control program for X"
+
+DESCRIPTION = "The xhost program is used to add and delete host names or \
+user names to the list allowed to make connections to the X server. In \
+the case of hosts, this provides a rudimentary form of privacy control \
+and security. Environments which require more sophisticated measures \
+should implement the user-based mechanism or use the hooks in the \
+protocol for passing other authentication data to the server."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8fbed71dddf48541818cef8079124199"
+DEPENDS += "libxmu libxau"
+PE = "1"
+
+SRC_URI[md5sum] = "f5d490738b148cb7f2fe760f40f92516"
+SRC_URI[sha256sum] = "93e619ee15471f576cfb30c663e18f5bc70aca577a63d2c2c03f006a7837c29a"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb b/poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb
new file mode 100644
index 000000000..93185188e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb
@@ -0,0 +1,20 @@
+require xorg-app-common.inc
+
+SUMMARY = "X Window System initializer"
+
+DESCRIPTION = "The xinit program is used to start the X Window System \
+server and a first client program on systems that cannot start X \
+directly from /etc/init or in environments that use multiple window \
+systems. When this first client exits, xinit will kill the X server and \
+then terminate."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18f01e7b39807bebe2b8df101a039b68"
+
+PE = "1"
+
+SRC_URI[md5sum] = "4e928452dfaf73851413a2d8b8c76388"
+SRC_URI[sha256sum] = "75d88d7397a07e01db253163b7c7a00b249b3d30e99489f2734cac9a0c7902b3"
+
+EXTRA_OECONF = "ac_cv_path_MCOOKIE=${bindir}/mcookie"
+
+RDEPENDS_${PN} += "util-linux-mcookie"
diff --git a/poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb b/poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb
new file mode 100644
index 000000000..25cd047bc
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xinput_1.6.2.bb
@@ -0,0 +1,12 @@
+require xorg-app-common.inc
+
+SUMMARY = "Runtime configuration and test of XInput devices"
+
+DESCRIPTION = "Xinput is an utility for configuring and testing XInput devices"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=881525f89f99cad39c9832bcb72e6fa5"
+
+DEPENDS += " libxi libxrandr libxinerama"
+
+SRC_URI[md5sum] = "6a889412eff2e3c1c6bb19146f6fe84c"
+SRC_URI[sha256sum] = "3694d29b4180952fbf13c6d4e59541310cbb11eef5bf888ff3d8b7f4e3aee5c4"
diff --git a/poky/meta/recipes-graphics/xorg-app/xkbcomp_1.4.0.bb b/poky/meta/recipes-graphics/xorg-app/xkbcomp_1.4.0.bb
new file mode 100644
index 000000000..c9dc327c4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xkbcomp_1.4.0.bb
@@ -0,0 +1,19 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to compile XKB keyboard description"
+
+DESCRIPTION = "The xkbcomp keymap compiler converts a description of an \
+XKB keymap into one of several output formats. The most common use for \
+xkbcomp is to create a compiled keymap file (.xkm extension) which can \
+be read directly by XKB-capable X servers or utilities."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=08436e4f4476964e2e2dd7e7e41e076a"
+
+PR = "${INC_PR}.0"
+
+DEPENDS += "libxkbfile"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "cc22b232bc78a303371983e1b48794ab"
+SRC_URI[sha256sum] = "bc69c8748c03c5ad9afdc8dff9db11994dd871b614c65f8940516da6bf61ce6b"
diff --git a/poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb b/poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb
new file mode 100644
index 000000000..2deac6a05
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb
@@ -0,0 +1,17 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility for modifying keymaps and pointer button mappings in X"
+
+DESCRIPTION = "The xmodmap program is used to edit and display the \
+keyboard modifier map and keymap table that are used by client \
+applications to convert event keycodes into keysyms. It is usually run \
+from the user's session startup script to configure the keyboard \
+according to personal tastes."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=272c17e96370e1e74773fa22d9989621"
+
+PE = "1"
+
+SRC_URI[md5sum] = "723f02d3a5f98450554556205f0a9497"
+SRC_URI[sha256sum] = "b7b0e5cc5f10d0fb6d2d6ea4f00c77e8ac0e847cc5a73be94cd86139ac4ac478"
diff --git a/poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc b/poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc
new file mode 100644
index 000000000..3529cb26e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xorg-app-common.inc
@@ -0,0 +1,17 @@
+SUMMARY = "X application"
+HOMEPAGE = "http://www.x.org/"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11/apps"
+LICENSE = "MIT-X"
+DEPENDS = "util-macros-native virtual/libx11"
+
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+INC_PR = "r8"
+
+SRC_URI = "${XORG_MIRROR}/individual/app/${BPN}-${PV}.tar.bz2"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += " ${libdir}/X11/${BPN} ${datadir}/X11/app-defaults/"
diff --git a/poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb b/poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb
new file mode 100644
index 000000000..d78bf0451
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility to display window and font properties of an X server"
+
+DESCRIPTION = "The xprop utility is for displaying window and font \
+properties in an X server. One window or font is selected using the \
+command line arguments or possibly in the case of a window, by clicking \
+on the desired window. A list of properties is then given, possibly with \
+formatting information."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e226ab8db88ac0bc0391673be40c9f91"
+
+DEPENDS += "libxmu"
+
+PE = "1"
+
+SRC_URI[md5sum] = "fae3d2fda07684027a643ca783d595cc"
+SRC_URI[sha256sum] = "9bee88b1025865ad121f72d32576dd3027af1446774aa8300cce3c261d869bc6"
diff --git a/poky/meta/recipes-graphics/xorg-app/xrandr_1.5.0.bb b/poky/meta/recipes-graphics/xorg-app/xrandr_1.5.0.bb
new file mode 100644
index 000000000..ea6897948
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xrandr_1.5.0.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension command"
+
+DESCRIPTION = "Xrandr is used to set the size, orientation and/or \
+reflection of the outputs for a screen. It can also set the screen \
+size."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fe1608bdb33cf8c62a4438f7d34679b3"
+DEPENDS += "libxrandr libxrender"
+PE = "1"
+
+SRC_URI[md5sum] = "ebffac98021b8f1dc71da0c1918e9b57"
+SRC_URI[sha256sum] = "c1cfd4e1d4d708c031d60801e527abc9b6d34b85f2ffa2cadd21f75ff38151cd"
diff --git a/poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch b/poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch
new file mode 100644
index 000000000..a97c7b72f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch
@@ -0,0 +1,26 @@
+add "-disable-xkb" option
+
+Upstream-Status: Pending
+
+Rebase for 1.2.1 by: Yu Ke <ke.yu@intel.com>
+
+Index: xset-1.2.3/configure.ac
+===================================================================
+--- xset-1.2.3.orig/configure.ac
++++ xset-1.2.3/configure.ac
+@@ -53,11 +53,15 @@ PKG_CHECK_MODULES(SET_XEXT, xext,
+ AC_CHECK_HEADERS([X11/extensions/dpms.h X11/extensions/MITMisc.h],,,[#include <X11/Xlib.h>])
+ CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+
++AC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]),
++ XKB="$enableval", XKB="yes")
++if test "x$XKB" = "xyes" ; then
+ PKG_CHECK_MODULES(SET_XKB, x11,
+ [SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $SET_XKB_CFLAGS $SET_X11_CFLAGS"
+ AC_CHECK_HEADERS([X11/XKBlib.h],,,[#include <X11/Xlib.h>])
+ CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
++fi
+
+ AC_ARG_WITH(xf86misc, AS_HELP_STRING([--without-xf86misc],[Disable xf86misc support.]),
+ [USE_XF86MISC="$withval"], [USE_XF86MISC="yes"])
diff --git a/poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb b/poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb
new file mode 100644
index 000000000..f683b7603
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xset_1.2.3.bb
@@ -0,0 +1,19 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility for setting various user preference options of the display"
+
+DESCRIPTION = "xset is a utility that is used to set various user \
+preference options of the display."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bea81cc9827cdf1af0e12c2b8228cf8d"
+DEPENDS += "libxext libxxf86misc libxmu libxau"
+PE = "1"
+
+SRC_URI += "file://disable-xkb.patch"
+
+SRC_URI[md5sum] = "dcd227388b57487d543cab2fd7a602d7"
+SRC_URI[sha256sum] = "4382f4fb29b88647e13f3b4bc29263134270747fc159cfc5f7e3af23588c8063"
+
+CFLAGS += "-D_GNU_SOURCE"
+EXTRA_OECONF = "--disable-xkb --without-fontcache"
diff --git a/poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb b/poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb
new file mode 100644
index 000000000..2965ef7f8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb
@@ -0,0 +1,14 @@
+require xorg-app-common.inc
+
+SUMMARY = "Print out X-Video extension adaptor information"
+
+DESCRIPTION = "xvinfo prints out the capabilities of any video adaptors \
+associated with the display that are accessible through the X-Video \
+extension."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b664101ad7a1dc758a4c4109bf978e68"
+DEPENDS += " libxv"
+PE = "1"
+
+SRC_URI[md5sum] = "558360176b718dee3c39bc0648c0d10c"
+SRC_URI[sha256sum] = "9fba8b68daf53863e66d5004fa9c703fcecf69db4d151ea2d3d885d621e6e5eb"
diff --git a/poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb b/poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb
new file mode 100644
index 000000000..0c23d1943
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+
+SUMMARY = "Window information utility for X"
+
+DESCRIPTION = "Xwininfo is a utility for displaying information about \
+windows. Information may include window position, size, color depth, \
+and a number of other items."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=78976cd3115f6faf615accc4e094d90e"
+DEPENDS += "libxext libxmu gettext-native"
+
+PE = "0"
+
+SRC_URI[md5sum] = "b777bafb674555e48fd8437618270931"
+SRC_URI[sha256sum] = "218eb0ea95bd8de7903dfaa26423820c523ad1598be0751d2d8b6a2c23b23ff8"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb
new file mode 100644
index 000000000..96b220ccb
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.10.5.bb
@@ -0,0 +1,21 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- event devices (evdev) input driver"
+
+DESCRIPTION = "evdev is an Xorg input driver for Linux's generic event \
+devices. It therefore supports all input devices that the kernel knows \
+about, including most mice and keyboards. \
+\
+The evdev driver can serve as both a pointer and a keyboard input \
+device, and may be used as both the core keyboard and the core pointer. \
+Multiple input devices are supported by multiple instances of this \
+driver, with one Load directive for evdev in the Module section of your \
+xorg.conf for each input device that will use this driver. "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=fefe33b1cf0cacba0e72e3b0fa0f0e16"
+
+DEPENDS += "mtdev libevdev"
+
+SRC_URI[md5sum] = "94c2c8354c74ab1cfbbb0a222078b9c6"
+SRC_URI[sha256sum] = "9edaa6205baf6d2922cc4db3d8e54a7e7773b5f733b0ae90f6be7725f983b70d"
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb
new file mode 100644
index 000000000..1896fff9f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.9.0.bb
@@ -0,0 +1,13 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- keyboard input driver"
+
+DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
+driver supports the standard OS-provided keyboard interface. The driver \
+functions as a keyboard input device, and may be used as the X server's \
+core keyboard."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
+
+SRC_URI[md5sum] = "a3a3f0dd32361dcdbd406e894dafe090"
+SRC_URI[sha256sum] = "f7c900f21752683402992b288d5a2826de7a6c0c0abac2aadd7e8a409e170388"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.26.0.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.26.0.bb
new file mode 100644
index 000000000..54c33d790
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-libinput_0.26.0.bb
@@ -0,0 +1,11 @@
+require xorg-driver-input.inc
+
+SUMMARY = "Generic input driver for the X.Org server based on libinput"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5e6b20ea2ef94a998145f0ea3f788ee0"
+
+DEPENDS += "libinput"
+
+SRC_URI[md5sum] = "da47ef62eab1d0e922a8fa929ff81758"
+SRC_URI[sha256sum] = "abca558fc2226f295691f1cf3412d4c0edeaa439f677ca25b5c9fab310d2387b"
+
+FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb
new file mode 100644
index 000000000..0750476a2
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.2.bb
@@ -0,0 +1,14 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- mouse input driver"
+
+DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
+supports most available mouse types and interfaces. The mouse driver \
+functions as a pointer input device, and may be used as the X server's \
+core pointer. Multiple mice are supported by multiple instances of this \
+driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=90ea9f90d72b6d9327dede5ffdb2a510"
+
+SRC_URI[md5sum] = "ce2d679283a22c8e0dccdd9248594845"
+SRC_URI[sha256sum] = "f425d5b05c6ab412a27e0a1106bb83f9e2662b307210abbe48270892387f4b2f"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb
new file mode 100644
index 000000000..d327a3b42
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.9.0.bb
@@ -0,0 +1,16 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- synaptics touchpad input driver"
+
+DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
+Synaptics Incorporated. Even though these touchpads (by default, \
+operating in a compatibility mode emulating a standard mouse) can be \
+handled by the normal evdev or mouse drivers, this driver allows more \
+advanced features of the touchpad to become available."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=55aacd3535a741824955c5eb8f061398"
+
+SRC_URI[md5sum] = "58e5b7722a402114093bf193962d1e3a"
+SRC_URI[sha256sum] = "afba3289d7a40217a19d90db98ce181772f9ca6d77e1898727b0afcf02073b5a"
+
+DEPENDS += "libxi mtdev libxtst libevdev"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb
new file mode 100644
index 000000000..92a1b25eb
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb
@@ -0,0 +1,26 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- VMWare mouse input driver"
+DESCRIPTION = "The vmmouse driver enables support for the special VMMouse \
+protocol that is provided by VMware virtual machines to give absolute \
+pointer positioning. The vmmouse driver is capable of falling back to the \
+standard 'mouse' driver if a VMware virtual machine is not detected."
+
+SRC_URI[md5sum] = "85e2e464b7219c495ad3a16465c226ed"
+SRC_URI[sha256sum] = "0af558957ac1be1b2863712c2475de8f4d7f14921fd01ded2e2fde4921b19319"
+
+RDEPENDS_${PN} += "xf86-input-mouse"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=622841c068a9d7625fbfe7acffb1a8fc"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+do_install_append () {
+ # We don't care about hal
+ rm -rf ${D}${datadir}/hal/
+ rm -rf ${D}${libdir}/hal/
+}
+
+EXTRA_OECONF = "--with-udev-rules-dir=${nonarch_base_libdir}/udev/rules.d"
+
+FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb
new file mode 100644
index 000000000..c49847760
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb
@@ -0,0 +1,13 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- cirrus display driver"
+DESCRIPTION = "cirrus is an Xorg driver for Cirrus Logic VGA adapters. These \
+devices are not so common in the wild anymore, but QEMU can emulate one, so \
+the driver is still useful."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddc7ca860dc5fd014e7f160ea699295"
+
+SRC_URI[md5sum] = "7d7dfd4cdc42aa8b6e923510fa00ad2b"
+SRC_URI[sha256sum] = "edc87b20a55259126b5239b5c1ef913419eab7ded0ed12ae9ae989460d7351ab"
+
+DEPENDS += "libpciaccess"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb
new file mode 100644
index 000000000..52e9bd1df
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb
@@ -0,0 +1,9 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- fbdev display driver"
+DESCRIPTION = "fbdev is an Xorg driver for framebuffer devices. This is a non-accelerated driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
+
+SRC_URI[md5sum] = "3931c0e19d441cc576dc088f9eb9fd73"
+SRC_URI[sha256sum] = "9dd4b326498223abbfdf786089a46ea3db4fa6bbd341308eb48a9e00bc3fd51b"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-Add-Coffeelake-PCI-IDs-for-S-Skus.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-Add-Coffeelake-PCI-IDs-for-S-Skus.patch
new file mode 100644
index 000000000..06ef10501
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/0001-Add-Coffeelake-PCI-IDs-for-S-Skus.patch
@@ -0,0 +1,116 @@
+From 96d4e8e7b8a699f0ef77fa7b210d4de5f1c703d0 Mon Sep 17 00:00:00 2001
+From: Liwei Song <liwei.song@windriver.com>
+Date: Wed, 22 Nov 2017 08:59:03 +0000
+Subject: [PATCH] Add Coffeelake PCI IDs for S Skus
+
+Add the Coffeelake PCI IDs based on the following kernel patches:
+
+commit b056f8f3d6b900e8afd19f312719160346d263b4
+Author: Anusha Srivatsa <anusha.srivatsa@intel.com>
+Date: Thu Jun 8 16:41:05 2017 -0700
+
+ drm/i915/cfl: Add Coffee Lake PCI IDs for S Skus.
+
+Upstream-Status: Submitted [https://patchwork.kernel.org/patch/10139905]
+
+Signed-off-by: Liwei Song <liwei.song@windriver.com>
+---
+ src/i915_pciids.h | 7 +++++++
+ src/intel_module.c | 13 +++++++++++++
+ src/sna/gen9_render.c | 12 ++++++++++++
+ 3 files changed, 32 insertions(+)
+
+diff --git a/src/i915_pciids.h b/src/i915_pciids.h
+index 0370f830c541..11ccfa9c047a 100644
+--- a/src/i915_pciids.h
++++ b/src/i915_pciids.h
+@@ -340,4 +340,11 @@
+ INTEL_VGA_DEVICE(0x3184, info), \
+ INTEL_VGA_DEVICE(0x3185, info)
+
++#define INTEL_CFL_S_IDS(info) \
++ INTEL_VGA_DEVICE(0x3E90, info), /* SRV GT1 */ \
++ INTEL_VGA_DEVICE(0x3E93, info), /* SRV GT1 */ \
++ INTEL_VGA_DEVICE(0x3E91, info), /* SRV GT2 */ \
++ INTEL_VGA_DEVICE(0x3E92, info), /* SRV GT2 */ \
++ INTEL_VGA_DEVICE(0x3E96, info) /* SRV GT2 */
++
+ #endif /* _I915_PCIIDS_H */
+diff --git a/src/intel_module.c b/src/intel_module.c
+index 6b04857e2853..4827a67255f0 100644
+--- a/src/intel_module.c
++++ b/src/intel_module.c
+@@ -138,6 +138,10 @@ static const struct intel_device_info intel_geminilake_info = {
+ .gen = 0113,
+ };
+
++static const struct intel_device_info intel_coffeelake_info = {
++ .gen = 0114,
++};
++
+ static const SymTabRec intel_chipsets[] = {
+ {PCI_CHIP_I810, "i810"},
+ {PCI_CHIP_I810_DC100, "i810-dc100"},
+@@ -303,6 +307,13 @@ static const SymTabRec intel_chipsets[] = {
+ {0x5916, "HD Graphics 620"},
+ {0x591E, "HD Graphics 615"},
+
++ /*Coffeelake*/
++ {0x3E90, "HD Graphics"},
++ {0x3E93, "HD Graphics"},
++ {0x3E91, "HD Graphics"},
++ {0x3E92, "HD Graphics"},
++ {0x3E96, "HD Graphics"},
++
+ /* When adding new identifiers, also update:
+ * 1. intel_identify()
+ * 2. man/intel.man
+@@ -368,6 +379,8 @@ static const struct pci_id_match intel_device_match[] = {
+
+ INTEL_GLK_IDS(&intel_geminilake_info),
+
++ INTEL_CFL_S_IDS(&intel_coffeelake_info),
++
+ INTEL_VGA_DEVICE(PCI_MATCH_ANY, &intel_generic_info),
+ #endif
+
+diff --git a/src/sna/gen9_render.c b/src/sna/gen9_render.c
+index e5f12c723956..7f49052c5ec1 100644
+--- a/src/sna/gen9_render.c
++++ b/src/sna/gen9_render.c
+@@ -245,6 +245,11 @@ static const struct gt_info glk_gt_info = {
+ .urb = { .max_vs_entries = 320 },
+ };
+
++static const struct gt_info cfl_gt_info = {
++ .name = "Coffeelake (gen9)",
++ .urb = { .max_vs_entries = 960 },
++};
++
+ static bool is_skl(struct sna *sna)
+ {
+ return sna->kgem.gen == 0110;
+@@ -265,6 +270,11 @@ static bool is_glk(struct sna *sna)
+ return sna->kgem.gen == 0113;
+ }
+
++static bool is_cfl(struct sna *sna)
++{
++ return sna->kgem.gen == 0114;
++}
++
+
+ static inline bool too_large(int width, int height)
+ {
+@@ -4040,6 +4050,8 @@ static bool gen9_render_setup(struct sna *sna)
+ state->info = &kbl_gt_info;
+ if (is_glk(sna))
+ state->info = &glk_gt_info;
++ if (is_cfl(sna))
++ state->info = &cfl_gt_info;
+
+ sna_static_stream_init(&general);
+
+--
+2.13.3
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch
new file mode 100644
index 000000000..8a5dd39ae
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch
@@ -0,0 +1,24 @@
+Include xorg-server.h to fix build errors seen with glibc 2.20
+
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-intel/2_2.99.912-r0/xf86-video-intel-2.99.912/src/backlight.c:39:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: xf86-video-intel-2.99.912/src/backlight.c
+===================================================================
+--- xf86-video-intel-2.99.912.orig/src/backlight.c 2014-04-09 10:41:18.000000000 -0700
++++ xf86-video-intel-2.99.912/src/backlight.c 2014-08-28 18:52:25.524070587 -0700
+@@ -29,6 +29,7 @@
+ #include "config.h"
+ #endif
+
++#include <xorg-server.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch
new file mode 100644
index 000000000..3dddd334b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch
@@ -0,0 +1,17 @@
+These modules are only used for tests that don't get installed, and the
+automatic detection without explicit dependencies means that a build can find
+e.g. xshmfence at configure time but then it's been removed from the sysroot by
+the time compile happens.
+
+As the tests don't get installed, just disable the checks.
+
+Upstream-Status: Inappropriate [OE-specific]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index bd654f3..78a0e0d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -279 +279 @@ fi
+-PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-xfixes xcb-present x11-xcb xshmfence x11 xcomposite xdamage xrender xrandr xxf86vm xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
++#PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-xfixes xcb-present x11-xcb xshmfence x11 xcomposite xdamage xrender xrandr xxf86vm xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb
new file mode 100644
index 000000000..2623cb2f3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-intel_git.bb
@@ -0,0 +1,45 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Intel integrated graphics chipsets driver"
+
+DESCRIPTION = "intel is an Xorg driver for Intel integrated graphics \
+chipsets. The driver supports depths 8, 15, 16 and 24. On some chipsets, \
+the driver supports hardware accelerated 3D via the Direct Rendering \
+Infrastructure (DRI)."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8730ad58d11c7bbad9a7066d69f7808e"
+
+SRCREV = "e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1"
+PV = "2.99.917+git${SRCPV}"
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://anongit.freedesktop.org/xorg/driver/xf86-video-intel \
+ file://disable-x11-dri3.patch \
+ file://always_include_xorg_server.h.patch \
+ file://0001-Add-Coffeelake-PCI-IDs-for-S-Skus.patch \
+ "
+
+SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b"
+SRC_URI[sha256sum] = "00b781eea055582820a123c47b62411bdf6aabf4f03dc0568faec55faf9667c9"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+DEPENDS += "virtual/libx11 drm libpciaccess pixman"
+
+PACKAGECONFIG ??= "xvmc uxa udev ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri dri1 dri2', '', d)}"
+
+PACKAGECONFIG[dri] = "--enable-dri,--disable-dri"
+PACKAGECONFIG[dri1] = "--enable-dri1,--disable-dri1,xf86driproto"
+PACKAGECONFIG[dri2] = "--enable-dri2,--disable-dri2,dri2proto"
+PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto"
+PACKAGECONFIG[sna] = "--enable-sna,--disable-sna"
+PACKAGECONFIG[uxa] = "--enable-uxa,--disable-uxa"
+PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
+PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc xcb-util"
+PACKAGECONFIG[tools] = "--enable-tools,--disable-tools,libxinerama libxrandr libxdamage libxfixes libxcursor libxtst libxext libxrender"
+
+# --enable-kms-only option is required by ROOTLESS_X
+EXTRA_OECONF += '${@oe.utils.conditional( "ROOTLESS_X", "1", " --enable-kms-only", "", d )}'
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+FILES_${PN} += "${datadir}/polkit-1"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb
new file mode 100644
index 000000000..bef363609
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.5.bb
@@ -0,0 +1,41 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
+
+SUMMARY = "X.Org X server -- TI OMAP integrated graphics chipsets driver"
+
+DESCRIPTION = "Open-source X.org graphics driver for TI OMAP graphics \
+Currently relies on a closed-source submodule for EXA acceleration on \
+the following chipsets: \
+ + OMAP3430 \
+ + OMAP3630 \
+ + OMAP4430 \
+ + OMAP4460 \
+ + OMAP5430 \
+ + OMAP5432 \
+\
+NOTE: this driver is work in progress.. you probably don't want to try \
+and use it yet. The API/ABI between driver and kernel, and driver and \
+acceleration submodules is not stable yet. This driver requires the \
+omapdrm kernel driver w/ GEM support. \
+"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602"
+DEPENDS += "virtual/libx11 libdrm xf86driproto"
+
+SRC_URI[md5sum] = "3b8ea5e8fba63355c0dc6681c49d5fe5"
+SRC_URI[sha256sum] = "93e7d42107521e61f61980eaea64fb452e87b7b94272e48938ac8d904ccfab5a"
+
+CFLAGS += " -I${STAGING_INCDIR}/xorg "
+
+# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
+do_compile_prepend_armv7a () {
+ sed -i -e s:fb1:fb2:g ${S}/src/omap_xv.c
+}
+
+python () {
+ if not bb.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
+ raise bb.parse.SkipRecipe("'opengl' not in DISTRO_FEATURES")
+}
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch
new file mode 100644
index 000000000..ac1921928
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch
@@ -0,0 +1,37 @@
+From 28c006c94e57ea71df11ec4fff79d7ffcfc4860f Mon Sep 17 00:00:00 2001
+From: Far McKon <FarMcKon@buglabs.net>
+Date: Tue, 3 May 2011 20:59:04 +0300
+Subject: [PATCH] Prevents omapfb from from crashing when pixelclock of 0 is
+ sent to it.
+
+Due to a Linux design bug it is easy to get a pixelclock set to zero
+when changing displays at runtime.
+
+Upstream-Status: Pending
+---
+ src/omapfb-output.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/omapfb-output.c b/src/omapfb-output.c
+index f8b4db3..4d59265 100644
+--- a/src/omapfb-output.c
++++ b/src/omapfb-output.c
+@@ -125,8 +125,13 @@ OMAPFBOutputGetModes(xf86OutputPtr output)
+ /* Only populate the native (current) mode */
+ mode = calloc(1, sizeof(DisplayModeRec));
+ mode->type |= M_T_PREFERRED;
+- mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
+- mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
++ if (ofb->state_info.pixclock == 0) {
++ mode->Clock = 0;
++ mode->SynthClock = 0;
++ } else {
++ mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
++ mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
++ }
+ mode->HDisplay = ofb->state_info.xres;
+ mode->HSyncStart = mode->HDisplay
+ + ofb->state_info.right_margin;
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
new file mode 100644
index 000000000..9fb01d438
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
@@ -0,0 +1,41 @@
+From 8fb7d0f99d4afbb574b30cb4f1e66a8f89d94ad5 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 12:04:36 +0100
+Subject: [PATCH 1/6] Revert "Set a large CRTC upper limit to not prune larger
+ resolutions"
+
+Picture is garbled after switching resolutions, so revert it.
+Virtual size too big, revert the commit 9c4d7592dcb7dc20a48a6f941d9d94bd73d34153.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index 9aaa52f..cbeff35 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -190,13 +190,13 @@ OMAPFBCRTCInit(ScrnInfoPtr pScrn)
+ * In practise, this doesn't seem to be supported.
+ * (no way to setup the overlay offset/base address)
+ */
+- /* FIXME: figure out what makes sense here. A known max resolution?
+- * framebuffer size?
+- */
+ xf86CrtcSetSizeRange(pScrn,
+- 8, 8, 2048, 2048);
++ 8, 8,
++ ofb->state_info.xres_virtual,
++ ofb->state_info.yres_virtual);
+
+ ofb->crtc = xf86CrtcCreate(pScrn, &OMAPFBCrtcFuncs);
++
+ }
+
+
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
new file mode 100644
index 000000000..683a98983
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
@@ -0,0 +1,32 @@
+From 855c333ac0d16350f895f1d1b9391e9cbb0b6db4 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:27:20 +0100
+Subject: [PATCH 2/6] Revert "Set virtual size when configuring framebuffer"
+
+Virtual size too big, so revert it.
+
+This reverts commit 2653ef07883fbd1a5e7025f9300cf89b79ba429a.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index cbeff35..9655db2 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -98,8 +98,6 @@ OMAPFBCrtcCommitChangeMode (xf86CrtcPtr crtc)
+ v = ofb->state_info;
+ v.xres = mode->HDisplay;
+ v.yres = mode->VDisplay;
+- v.xres_virtual = crtc->scrn->virtualX;
+- v.yres_virtual = crtc->scrn->virtualY;
+ v.activate = FB_ACTIVATE_NOW;
+ v.pixclock = KHZ2PICOS(mode->Clock ? mode->Clock : 56000);
+ v.left_margin = mode->HTotal - mode->HSyncEnd;
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
new file mode 100644
index 000000000..67ea7c1a5
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
@@ -0,0 +1,31 @@
+From 252f44c072d3447a32127fc9afe5d0d40f3c510e Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:20:20 +0100
+Subject: [PATCH 3/6] force 'plain' mode
+
+The new DSS mode breaks XV, so force plain mode
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-driver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 018e040..48aa09c 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -326,7 +326,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ OMAPFBProbeController(ofb->ctrl_name);
+
+ /* Do we have the DSS kernel API? */
+- if (stat(SYSFS_DSS_DIR, &st) == 0) {
++ if (0) { //stat(SYSFS_DSS_DIR, &st) == 0) {
+ ofb->dss = TRUE;
+ } else {
+ ofb->dss = FALSE;
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
new file mode 100644
index 000000000..b0ac9a44c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
@@ -0,0 +1,33 @@
+From cfa46b67f59115f6d8ef9414af60380749ff3eb3 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:21:12 +0100
+Subject: [PATCH 4/6] blacklist tv out
+
+The tv-out gets added last and the driver tries to reconfigure dvi to TV resolutions, which fails. so blacklist it
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-output-dss.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/omapfb-output-dss.c b/src/omapfb-output-dss.c
+index 6cc52de..83cb711 100644
+--- a/src/omapfb-output-dss.c
++++ b/src/omapfb-output-dss.c
+@@ -205,6 +205,10 @@ OMAPFBDSSOutputDetect (xf86OutputPtr output)
+ if(ofb->timings[idx][0] == '\0')
+ return XF86OutputStatusDisconnected;
+
++ // Hack to disable the tv out
++ if (strncmp(output->name, "tv", 2) == 0)
++ return XF86OutputStatusDisconnected;
++
+ return XF86OutputStatusConnected;
+ }
+
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
new file mode 100644
index 000000000..67b284023
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
@@ -0,0 +1,325 @@
+From 8b1f697a60e35ab82fffdabfaefdb45e9a9df379 Mon Sep 17 00:00:00 2001
+From: Eino-Ville Talvala <talvala@stanford.edu>
+Date: Tue, 23 Aug 2011 18:37:01 +0200
+Subject: [PATCH 5/6] Attempt to fix VRFB
+
+Upstream-Status: Pending
+
+http://dominion.thruhere.net/git/cgit.cgi/xf86-video-omapfb/commit/?h=koen/fixups&id=6833fc9f795265e4943d248103fbaf3463b515d6
+
+Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/image-format-conversions.c | 4 +--
+ src/image-format-conversions.h | 2 +-
+ src/omapfb-driver.c | 28 +++++++++++++---
+ src/omapfb-xv-blizzard.c | 1 +
+ src/omapfb-xv-generic.c | 72 +++++++++++++++++++++++++++++++++---------
+ src/omapfb-xv.c | 3 ++
+ 6 files changed, 88 insertions(+), 22 deletions(-)
+
+diff --git a/src/image-format-conversions.c b/src/image-format-conversions.c
+index dcefa9b..d43427d 100644
+--- a/src/image-format-conversions.c
++++ b/src/image-format-conversions.c
+@@ -38,13 +38,13 @@
+ #include "image-format-conversions.h"
+
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest)
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest)
+ {
+ int i;
+ int len = w * 2;
+ for (i = 0; i < h; i++)
+ {
+- memcpy(dest + i * len, src + i * stride, len);
++ memcpy(dest + i * dst_stride, src + i * src_stride, len);
+ }
+ }
+
+diff --git a/src/image-format-conversions.h b/src/image-format-conversions.h
+index 584896a..ba7caf2 100644
+--- a/src/image-format-conversions.h
++++ b/src/image-format-conversions.h
+@@ -27,7 +27,7 @@
+ #include <stdint.h>
+
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest);
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest);
+
+ /* Basic C implementation of YV12/I420 to UYVY conversion */
+ void uv12_to_uyvy(int w, int h, int y_pitch, int uv_pitch, uint8_t *y_p, uint8_t *u_p, uint8_t *v_p, uint8_t *dest);
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 48aa09c..07989f5 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -66,6 +66,7 @@
+ #define OMAPFB_VERSION 1000
+ #define OMAPFB_DRIVER_NAME "OMAPFB"
+ #define OMAPFB_NAME "omapfb"
++#define ENFORCE_MODES
+
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+@@ -105,11 +106,13 @@ static SymTabRec OMAPFBChipsets[] = {
+ typedef enum {
+ OPTION_ACCELMETHOD,
+ OPTION_FB,
++ OPTION_ROTATE,
+ } FBDevOpts;
+
+ static const OptionInfoRec OMAPFBOptions[] = {
+ { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
+ { OPTION_FB, "fb", OPTV_STRING, {0}, FALSE },
++ { OPTION_ROTATE, "rotation", OPTV_STRING, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+ };
+
+@@ -286,6 +289,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ {
+ OMAPFBPtr ofb;
+ EntityInfoPtr pEnt;
++ char *rotate;
+ rgb zeros = { 0, 0, 0 };
+ struct stat st;
+
+@@ -379,6 +383,8 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ pScrn->progClock = TRUE;
+ pScrn->chipset = "omapfb";
+
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Rotate test version 0.02\n");
++
+ /* Start with configured virtual size */
+ pScrn->virtualX = pScrn->display->virtualX;
+ pScrn->virtualY = pScrn->display->virtualY;
+@@ -496,12 +502,21 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ ofb->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = OMAPFBCloseScreen;
+
++ /* Enforce the default mode (this is silly I guess) */
++#ifdef ENFORCE_MODES
++ //xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enforcing modes\n");
++ //set_mode(ofb, &ofb->default_mode);
++ //pScrn->displayWidth = ofb->fixed_info.line_length /
++ // (ofb->state_info.bits_per_pixel>>3); //ofb->state_info.xres;
++#endif
++
+ /* Map our framebuffer memory */
++ ofb->mem_info.size = ofb->fixed_info.line_length * ofb->state_info.yres;
+ ofb->fb = mmap (NULL, ofb->mem_info.size,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->fd, 0);
+- if (ofb->fb == NULL) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed\n");
++ if (ofb->fb == MAP_FAILED) {
++ xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ return FALSE;
+ }
+
+@@ -578,8 +593,13 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ } else if (!ofb->dss) {
+
+ ofb->plane_info.enabled = 1;
+- ofb->plane_info.out_width = ofb->state_info.xres;
+- ofb->plane_info.out_height = ofb->state_info.yres;
++ if (ofb->state_info.rotate == 0 || ofb->state_info.rotate == 2) {
++ ofb->plane_info.out_width = ofb->state_info.xres;
++ ofb->plane_info.out_height = ofb->state_info.yres;
++ } else {
++ ofb->plane_info.out_width = ofb->state_info.yres;
++ ofb->plane_info.out_height = ofb->state_info.xres;
++ }
+
+ if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+diff --git a/src/omapfb-xv-blizzard.c b/src/omapfb-xv-blizzard.c
+index 406ffc6..b71d2aa 100644
+--- a/src/omapfb-xv-blizzard.c
++++ b/src/omapfb-xv-blizzard.c
+@@ -220,6 +220,7 @@ int OMAPFBXVPutImageBlizzard (ScrnInfoPtr pScrn,
+ packed_line_copy(src_w & ~3,
+ src_h & ~3,
+ ((src_w + 1) & ~1) * 2,
++ ofb->port->fixed_info.line_length,
+ (uint8_t*)buf,
+ (uint8_t*)ofb->port->fb);
+ break;
+diff --git a/src/omapfb-xv-generic.c b/src/omapfb-xv-generic.c
+index e6f89fe..b33f344 100644
+--- a/src/omapfb-xv-generic.c
++++ b/src/omapfb-xv-generic.c
+@@ -62,7 +62,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+
+- /* The memory size is already set in OMAPFBXVQueryImageAttributes */
++ /* The memory size is already set before we get here */
+ if (ioctl(ofb->port->fd, OMAPFB_SETUP_MEM, &ofb->port->mem_info) != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to allocate video plane memory\n");
+@@ -73,19 +73,20 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ ofb->port->fb = mmap (NULL, ofb->port->mem_info.size,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->port->fd, 0);
+- if (ofb->port->fb == NULL) {
++ if (ofb->port->fb == MAP_FAILED) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Mapping video memory failed\n");
+ return XvBadAlloc;
+ }
+
+ /* Update the state info */
++ /* Let's not - it's bad
+ if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
+ {
+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ return XvBadAlloc;
+ }
+-
++ */
+ return Success;
+ }
+
+@@ -93,6 +94,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
++ int ret;
+
+ if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
+ {
+@@ -104,6 +106,31 @@ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ return XvBadAlloc;
+ }
++ /* Changing rotation/nonstd flags can change the fixed info! */
++ if (ioctl (ofb->port->fd, FBIOGET_FSCREENINFO, &ofb->port->fixed_info))
++ {
++ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
++ /* Correct fixed info requires recalculation of needed memory */
++ ofb->port->mem_info.size = ofb->port->fixed_info.line_length * ofb->port->state_info.yres;
++
++ /* Allocate buffer memory */
++ ret = OMAPXVAllocPlane(pScrn);
++ if (ret != Success)
++ return ret;
++
++ /* Workaround for reset of mode after memory allo */
++ if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
++ {
++ xf86Msg(X_ERROR, "%s: setting state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
++ if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
++ {
++ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
+
+ if(ioctl(ofb->port->fd, OMAPFB_SETUP_PLANE,
+ &ofb->port->plane_info) != 0) {
+@@ -124,6 +151,8 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ DrawablePtr pDraw)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
++ short drw_temp;
++ short rot_xres, rot_yres;
+
+ if (!ofb->port->plane_info.enabled
+ || ofb->port->update_window.x != src_x
+@@ -163,13 +192,6 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ return Success;
+ }
+
+- /* If we don't have the plane running, enable it */
+- if (!ofb->port->plane_info.enabled) {
+- ret = OMAPXVAllocPlane(pScrn);
+- if (ret != Success)
+- return ret;
+- }
+-
+ /* Set up the state info, xres and yres will be used for
+ * scaling to the values in the plane info struct
+ */
+@@ -179,12 +201,31 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ ofb->port->state_info.yres_virtual = 0;
+ ofb->port->state_info.xoffset = 0;
+ ofb->port->state_info.yoffset = 0;
+- ofb->port->state_info.rotate = 0;
++ //ofb->port->state_info.rotate = 0;
+ ofb->port->state_info.grayscale = 0;
+ ofb->port->state_info.activate = FB_ACTIVATE_NOW;
+ ofb->port->state_info.bits_per_pixel = 0;
+ ofb->port->state_info.nonstd = xv_to_omapfb_format(image);
+
++ /* Plane info does not rotate with state_info */
++ if (ofb->port->state_info.rotate == 1 ||
++ ofb->port->state_info.rotate == 3) {
++ drw_temp = drw_x;
++ drw_x = drw_y;
++ drw_y = drw_temp;
++
++ drw_temp = drw_w;
++ drw_w = drw_h;
++ drw_h = drw_temp;
++
++ rot_xres = ofb->port->state_info.yres;
++ rot_yres = ofb->port->state_info.xres;
++ } else {
++ rot_xres = ofb->port->state_info.xres;
++ rot_yres = ofb->port->state_info.yres;
++ }
++
++
+ /* Set up the video plane info */
+ ofb->port->plane_info.enabled = 1;
+ ofb->port->plane_info.pos_x = drw_x;
+@@ -193,13 +234,13 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ ofb->port->plane_info.out_height = drw_h & ~15;
+
+ /* Cap output to screen size */
+- if (ofb->port->plane_info.out_width > ofb->state_info.xres) {
++ if (ofb->port->plane_info.out_width > rot_xres) {
+ ofb->port->plane_info.pos_x = 0;
+- ofb->port->plane_info.out_width = ofb->state_info.xres;
++ ofb->port->plane_info.out_width = rot_xres;
+ }
+- if (ofb->port->plane_info.out_height > ofb->state_info.yres) {
++ if (ofb->port->plane_info.out_height > rot_yres) {
+ ofb->port->plane_info.pos_y = 0;
+- ofb->port->plane_info.out_height = ofb->state_info.yres;
++ ofb->port->plane_info.out_height = rot_yres;
+ }
+
+ ret = OMAPXVSetupVideoPlane(pScrn);
+@@ -223,6 +264,7 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ packed_line_copy(src_w & ~15,
+ src_h & ~15,
+ ((src_w + 1) & ~1) * 2,
++ ofb->port->fixed_info.line_length,
+ (uint8_t*)buf,
+ (uint8_t*)ofb->port->fb);
+ break;
+diff --git a/src/omapfb-xv.c b/src/omapfb-xv.c
+index 1df651e..0fee2c6 100644
+--- a/src/omapfb-xv.c
++++ b/src/omapfb-xv.c
+@@ -169,8 +169,11 @@ static int OMAPFBXVQueryImageAttributes (ScrnInfoPtr pScrn,
+ h = *height;
+
+ w = (w + 1) & ~1;
++
++ /* Can't calculate these here - don't know line length
+ ofb->port->mem_info.size = w << 1;
+ ofb->port->mem_info.size *= h;
++ */
+
+ return size;
+ }
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
new file mode 100644
index 000000000..d56729987
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
@@ -0,0 +1,272 @@
+From 803ecf2909949e6152f4a81b6cbb92a4430679ac Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 23 Nov 2012 00:31:06 +0100
+Subject: [PATCH 6/6] omapfb: port to new xserver video API
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/compat-api.h | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/omapfb-driver.c | 41 ++++++++++++-----------
+ 2 files changed, 118 insertions(+), 19 deletions(-)
+ create mode 100644 src/compat-api.h
+
+diff --git a/src/compat-api.h b/src/compat-api.h
+new file mode 100644
+index 0000000..b1591b1
+--- /dev/null
++++ b/src/compat-api.h
+@@ -0,0 +1,96 @@
++/*
++ * Copyright 2012 Red Hat, Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Author: Dave Airlie <airlied@redhat.com>
++ */
++
++/* this file provides API compat between server post 1.13 and pre it,
++ it should be reused inside as many drivers as possible */
++#ifndef COMPAT_API_H
++#define COMPAT_API_H
++
++#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
++#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
++#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
++#endif
++
++#ifndef XF86_HAS_SCRN_CONV
++#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
++#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
++#endif
++
++#ifndef XF86_SCRN_INTERFACE
++
++#define SCRN_ARG_TYPE int
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
++
++#define SCREEN_ARG_TYPE int
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
++
++#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
++
++#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
++
++#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
++
++#define FREE_SCREEN_ARGS_DECL int arg, int flags
++#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
++
++#define VT_FUNC_ARGS_DECL int arg, int flags
++#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
++
++#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
++#else
++#define SCRN_ARG_TYPE ScrnInfoPtr
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
++
++#define SCREEN_ARG_TYPE ScreenPtr
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
++
++#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS pScreen
++
++#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
++#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
++
++#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
++#define FREE_SCREEN_ARGS(x) (x)
++
++#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
++#define VT_FUNC_ARGS(flags) pScrn
++
++#define XF86_ENABLEDISABLEFB_ARG(x) (x)
++
++#endif
++
++#endif
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 07989f5..486ffa4 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -44,6 +44,8 @@
+
+ #include "exa.h"
+
++#include "compat-api.h"
++
+ #ifdef HAVE_XEXTPROTO_71
+ #include <X11/extensions/dpmsconst.h>
+ #else
+@@ -70,10 +72,10 @@
+
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+-static Bool OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
+-static Bool OMAPFBEnterVT(int scrnIndex, int flags);
+-static void OMAPFBLeaveVT(int scrnIndex, int flags);
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
++static Bool OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL);
++static Bool OMAPFBEnterVT(VT_FUNC_ARGS_DECL);
++static void OMAPFBLeaveVT(VT_FUNC_ARGS_DECL);
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL);
+
+ static Bool
+ OMAPFBEnsureRec(ScrnInfoPtr pScrn)
+@@ -481,7 +483,7 @@ OMAPFBXvScreenInit(ScreenPtr pScreen)
+ }
+
+ static Bool
+-OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
++OMAPFBCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+ {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -490,11 +492,11 @@ OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
+
+ pScreen->CloseScreen = ofb->CloseScreen;
+
+- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
++ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ }
+
+ static Bool
+-OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
++OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL)
+ {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -516,7 +518,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->fd, 0);
+ if (ofb->fb == MAP_FAILED) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ return FALSE;
+ }
+
+@@ -526,7 +528,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ /* Only support TrueColor for now */
+ if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+ pScrn->rgbBits, pScrn->defaultVisual)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "visual type setup failed"
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "visual type setup failed"
+ " for %d bits per pixel [1]\n",
+ pScrn->bitsPerPixel);
+ return FALSE;
+@@ -534,7 +536,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Set up pixmap depth information */
+ if (!miSetPixmapDepths()) {
+- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
++ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
+ return FALSE;
+ }
+
+@@ -546,7 +548,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ pScrn->virtualY, pScrn->xDpi,
+ pScrn->yDpi, pScrn->displayWidth,
+ pScrn->bitsPerPixel)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
+ return FALSE;
+ }
+
+@@ -567,7 +569,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Initialize XRender fallbacks */
+ if (!fbPictureInit(pScreen, NULL, 0)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
+ return FALSE;
+ }
+
+@@ -579,7 +581,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Initialize default colormap */
+ if (!miCreateDefColormap(pScreen)) {
+- xf86DrvMsg(scrnIndex, X_ERROR,
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "creating default colormap failed\n");
+ return FALSE;
+ }
+@@ -589,7 +591,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ /* This is non-fatal since we might be running against older
+ * kernel driver in which case we only do basic 2D stuff...
+ */
+- xf86DrvMsg(scrnIndex, X_ERROR, "Reading plane info failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reading plane info failed\n");
+ } else if (!ofb->dss) {
+
+ ofb->plane_info.enabled = 1;
+@@ -602,7 +604,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ }
+
+ if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+- xf86DrvMsg(scrnIndex, X_ERROR,
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: Plane setup failed: %s\n",
+ __FUNCTION__, strerror(errno));
+ return FALSE;
+@@ -645,9 +647,10 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ return TRUE;
+ }
+
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL)
+ {
+- return xf86SetSingleMode (xf86Screens[scrnIndex], mode, RR_Rotate_0);
++ SCRN_INFO_PTR(arg);
++ return xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
+ }
+
+ void
+@@ -699,14 +702,14 @@ OMAPFBPrintCapabilities(ScrnInfoPtr pScrn,
+ /*** Unimplemented: */
+
+ static Bool
+-OMAPFBEnterVT(int scrnIndex, int flags)
++OMAPFBEnterVT(VT_FUNC_ARGS_DECL)
+ {
+ xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ return TRUE;
+ }
+
+ static void
+-OMAPFBLeaveVT(int scrnIndex, int flags)
++OMAPFBLeaveVT(VT_FUNC_ARGS_DECL)
+ {
+ xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ }
+--
+1.8.0
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch
new file mode 100644
index 000000000..dc0b9b3f4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch
@@ -0,0 +1,48 @@
+Fix errors with glibc 2.20
+
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:53,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/misc.h:115,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86str.h:37,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86.h:44,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-omapfb/2_0.1.1+gitrAUTOINC+28c006c94e-r21.7/git/src/omapfb-xv-blizzard.c:33:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:53,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/misc.h:115,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86str.h:37,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86.h:44,
+ from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-omapfb/2_0.1.1+gitrAUTOINC+28c006c94e-r21.7/git/src/omapfb-xv-generic.c:28:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+
+Singed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: git/src/omapfb-xv-blizzard.c
+===================================================================
+--- git.orig/src/omapfb-xv-blizzard.c 2014-08-28 05:16:25.684070587 -0700
++++ git/src/omapfb-xv-blizzard.c 2014-08-28 19:05:39.440070587 -0700
+@@ -30,6 +30,7 @@
+ * -
+ */
+
++#include <xorg-server.h>
+ #include "xf86.h"
+ #include "xf86_OSlib.h"
+ #include "xf86xv.h"
+Index: git/src/omapfb-xv-generic.c
+===================================================================
+--- git.orig/src/omapfb-xv-generic.c 2014-08-28 05:16:25.684070587 -0700
++++ git/src/omapfb-xv-generic.c 2014-08-28 19:05:51.780070587 -0700
+@@ -25,6 +25,7 @@
+ * Generic functions for the XV driver
+ */
+
++#include <xorg-server.h>
+ #include "xf86.h"
+ #include "xf86_OSlib.h"
+ #include "xf86xv.h"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
new file mode 100644
index 000000000..7ebb960f1
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
@@ -0,0 +1,37 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
+
+DESCRIPTION = "omapfb driver supports the basic Texas Instruments OMAP \
+framebuffer."
+
+LICENSE = "MIT-X & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=63e2cbac53863f60e2f43343fb34367f"
+DEPENDS += "virtual/libx11"
+
+SRCREV = "33e36c12dde336edbdd34626dd8adfcaebc8fbb8"
+PR = "${INC_PR}.7"
+PV = "0.1.1+gitr${SRCPV}"
+
+# Blacklist debian-specific tags in upstream version check
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)(?!-)"
+
+SRC_URI = "git://anonscm.debian.org/collab-maint/xf86-video-omapfb.git \
+ file://0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch \
+ file://0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch \
+ file://0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch \
+ file://0003-force-plain-mode.patch \
+ file://0004-blacklist-tv-out.patch \
+ file://0005-Attempt-to-fix-VRFB.patch \
+ file://0006-omapfb-port-to-new-xserver-video-API.patch \
+ file://0007-always_include_xorg_server.h.patch \
+"
+
+S = "${WORKDIR}/git"
+
+CFLAGS += " -I${STAGING_INCDIR}/xorg "
+
+# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
+do_compile_prepend_armv7a () {
+ sed -i -e s:fb1:fb2:g ${S}/src/omapfb-xv.c
+}
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb
new file mode 100644
index 000000000..fa251b50e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb
@@ -0,0 +1,21 @@
+require xorg-driver-video.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a1f0610ebdc6f314a9fa5102a8c5c1b0"
+
+SUMMARY = "X.Org X server -- Generic Vesa video driver"
+
+DESCRIPTION = "vesa is an Xorg driver for generic VESA video cards. It \
+can drive most VESA-compatible video cards, but only makes use of the \
+basic standard VESA core that is common to these cards. The driver \
+supports depths 8, 15 16 and 24."
+
+PR = "${INC_PR}.0"
+
+DEPENDS += "virtual/libx11 randrproto libpciaccess"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+RRECOMMENDS_${PN} += "xserver-xorg-module-libint10"
+
+SRC_URI[md5sum] = "a893c37c589f7a31cea929a5d896a0e2"
+SRC_URI[sha256sum] = "7bddf4d879dd6f67088ecb203a31e12334aab980174bd0909930a21f32e251c1"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
new file mode 100644
index 000000000..5bda720ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
@@ -0,0 +1,103 @@
+From da6612659a279bcb02f70622b53a3894fbc11052 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 9 Dec 2016 14:35:45 +0200
+Subject: [PATCH] Add option for vmwgfx
+
+Upstream-Status:Submitted
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 51 +++++++++++++++++++++------------------------------
+ 1 file changed, 21 insertions(+), 30 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9f259ce..f3fec57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,13 @@ AC_ARG_ENABLE(vmwarectrl-client,
+ [VMWARECTRL=$enableval], [VMWARECTRL=no])
+ AM_CONDITIONAL(BUILD_VMWARECTRL, [test "x$VMWARECTRL" = xyes])
+
++# Define a configure option to build the vmwgfx driver
++AC_ARG_ENABLE(vmwgfx,
++ AS_HELP_STRING([--disable-vmwgfx],
++ [Disable vmwgfx driver (KMS/3D) (default: enabled)]),
++ [VMWGFX="$enableval"], [VMWGFX="yes"])
++AM_CONDITIONAL(BUILD_VMWGFX, test "x$VMWGFX" = xyes)
++
+ # Store the list of server defined optional extensions in REQUIRED_MODULES
+ XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+ XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
+@@ -85,11 +92,6 @@ PKG_CHECK_EXISTS([xorg-server >= 1.4.99],
+ [AC_DEFINE([HAVE_XORG_SERVER_1_5_0], 1,
+ [Has version 1.5.0 or greater of the Xserver])])
+
+-PKG_CHECK_EXISTS([xorg-server >= 1.7.0],
+- [AC_DEFINE([HAVE_XORG_SERVER_1_7_0], 1,
+- [Has version 1.7.0 or greater of the Xserver])
+- BUILD_VMWGFX=yes],[BUILD_VMWGFX=no])
+-
+ PKG_CHECK_EXISTS([xorg-server >= 1.12.0],
+ [AC_DEFINE([HAVE_XORG_SERVER_1_12_0], 1,
+ [Has version 1.12.0 or greater of the Xserver])])
+@@ -114,34 +116,22 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+
+ AC_SUBST([moduledir])
+
+-if test x$BUILD_VMWGFX = xyes; then
+- PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
+-fi
+-if test x$BUILD_VMWGFX = xyes; then
+-#
+-# Early versions of mesa 10 forgot to bump the XA major version number in
+-# the xa_tracker.h header
+-#
+- PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
+- [PKG_CHECK_EXISTS([xatracker = 2.0.0],
+- [AC_DEFINE([HAVE_XA_2], 1,
+- [Has version 2 of XA])])],
+- [BUILD_VMWGFX=no])
+-#
+-# Check for prime.
+-#
++AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
++if test x$VMWGFX = xyes; then
++ AC_MSG_RESULT([yes])
++ PKG_CHECK_MODULES([LIBDRM], [libdrm])
++ # Check for prime.
+ PKG_CHECK_EXISTS([libdrm >= 2.4.38],
+ [AC_DEFINE([HAVE_LIBDRM_2_4_38], 1,
+ [Has version 2.4.38 or greater of libdrm])])
+-fi
+
+-DRIVER_NAME=vmware
+-AC_SUBST([DRIVER_NAME])
+-
+-AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
+-if test x$BUILD_VMWGFX = xyes; then
+- AC_MSG_RESULT([yes])
+- AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
++ # Early versions of mesa 10 forgot to bump the XA major version number
++ # in the xa_tracker.h header
++ PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
++ [PKG_CHECK_EXISTS([xatracker = 2.0.0],
++ [AC_DEFINE([HAVE_XA_2], 1,
++ [Has version 2 of XA])])])
++ AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
+ libudev_check=yes
+ AC_ARG_WITH([libudev],
+ [AS_HELP_STRING([--without-libudev],
+@@ -158,7 +148,8 @@ else
+ AC_MSG_RESULT([no])
+ fi
+
+-AM_CONDITIONAL(BUILD_VMWGFX, test "x$BUILD_VMWGFX" = xyes)
++DRIVER_NAME=vmware
++AC_SUBST([DRIVER_NAME])
+
+ AC_CONFIG_FILES([
+ Makefile
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb
new file mode 100644
index 000000000..706d35d2f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.2.1.bb
@@ -0,0 +1,19 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- VMware SVGA display driver"
+
+DESCRIPTION = "vmware is an Xorg driver for VMware virtual video cards."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5fcd7d437a959a15fbee8707747c6b53"
+
+DEPENDS += "virtual/libx11 xineramaproto videoproto libpciaccess"
+
+SRC_URI += "file://0002-add-option-for-vmwgfx.patch"
+
+SRC_URI[md5sum] = "4c3912e4d8947f6c2fc1ee9e2f211d74"
+SRC_URI[sha256sum] = "e2f7f7101fba7f53b268e7a25908babbf155b3984fb5268b3d244eb6c11bf62b"
+
+COMPATIBLE_HOST = '(i.86.*-linux|x86_64.*-linux)'
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[vmwgfx] = "--enable-vmwgfx, --disable-vmwgfx, libdrm virtual/mesa"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
new file mode 100644
index 000000000..bca0aade6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -0,0 +1,42 @@
+SUMMARY = "X driver"
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11/drivers"
+LICENSE = "MIT-X"
+
+PE = "2"
+INC_PR = "r21"
+
+DEPENDS = "virtual/xserver xproto randrproto util-macros"
+
+SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}.tar.bz2"
+
+FILES_${PN} += " ${libdir}/xorg/modules/drivers/*.so"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/xserver
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# FIXME: We don't want to include the libtool archives (*.la) from modules
+# directory, as they serve no useful purpose. Upstream should fix Makefile.am
+do_install_append() {
+ find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f --
+}
+
+# Function to add the relevant ABI dependency to drivers, which should be called
+# from a PACKAGEFUNC.
+def _add_xorg_abi_depends(d, name):
+ # Map of ABI names exposed in the dependencies to pkg-config variables
+ abis = {
+ "video": "abi_videodrv",
+ "input": "abi_xinput"
+ }
+
+ output = os.popen("pkg-config xorg-server --variable=%s" % abis[name]).read()
+ mlprefix = d.getVar('MLPREFIX') or ''
+ abi = "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
+
+ pn = d.getVar("PN")
+ d.appendVar('RDEPENDS_' + pn, ' ' + abi)
+
+SECURITY_LDFLAGS = "${SECURITY_X_LDFLAGS}"
diff --git a/poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
new file mode 100644
index 000000000..342067d6c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
@@ -0,0 +1,12 @@
+require xorg-driver-common.inc
+
+DEPENDS += "inputproto kbproto "
+
+python add_xorg_abi_depends() {
+ _add_xorg_abi_depends(d, "input")
+}
+PACKAGEFUNCS =+ "add_xorg_abi_depends"
+
+FILES_${PN} += " ${libdir}/xorg/modules/input/*.so \
+ ${datadir}/X11/xorg.conf.d \
+ "
diff --git a/poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
new file mode 100644
index 000000000..b5862dae1
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
@@ -0,0 +1,8 @@
+require xorg-driver-common.inc
+
+DEPENDS =+ "renderproto videoproto xextproto fontsproto"
+
+python add_xorg_abi_depends() {
+ _add_xorg_abi_depends(d, "video")
+}
+PACKAGEFUNCS =+ "add_xorg_abi_depends"
diff --git a/poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch b/poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch
new file mode 100644
index 000000000..f330c185a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [configuration]
+
+XORG_DEFAULT_OPTIONS pulls in the following dependency chains:
+
+XORG_CWARNFLAGS -> AC_PROG_CC_C99
+XORG_STRICT_OPTION -> AC_PROG_CC_C99, XORG_CWARNFLAGS
+XORG_MANPAGE_SECTIONS -> AC_CANONICAL_HOST -> Checks host
+
+each of which triggers the use of the host compiler. As an "all"
+architecture package, it shouldn't need a compiler (and doesn't).
+
+RP 17/5/2011
+
+Index: encodings-1.0.4/configure.ac
+===================================================================
+--- encodings-1.0.4.orig/configure.ac 2011-05-17 23:36:19.505095876 +0100
++++ encodings-1.0.4/configure.ac 2011-05-17 23:54:14.935096128 +0100
+@@ -4,12 +4,12 @@
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ AM_MAINTAINER_MODE
+
+-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+ m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+ XORG_MACROS_VERSION(1.3)
+-XORG_DEFAULT_OPTIONS
+-
++XORG_RELEASE_VERSION
++XORG_CHANGELOG
++XORG_INSTALL
+ AC_PROG_INSTALL
+
+ # Require X.Org's font util macros 1.2 or later
diff --git a/poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb b/poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb
new file mode 100644
index 000000000..36766f2f4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb
@@ -0,0 +1,22 @@
+SUMMARY = "The Xorg font encoding files"
+
+DESCRIPTION = "The encodings that map to specific characters for a \
+number of Xorg and common fonts."
+
+require xorg-font-common.inc
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9da93f2daf2d5572faa2bfaf0dbd9e76"
+PE = "1"
+PR = "${INC_PR}.1"
+
+DEPENDS = "mkfontscale-native mkfontdir-native font-util-native"
+RDEPENDS_${PN} = ""
+
+SRC_URI += "file://nocompiler.patch"
+
+inherit allarch
+
+EXTRA_OECONF += "--with-encodingsdir=${datadir}/fonts/X11/encodings"
+
+SRC_URI[md5sum] = "0f2d6546d514c5cc4ecf78a60657a5c1"
+SRC_URI[sha256sum] = "ced6312988a45d23812c2ac708b4595f63fd7a49c4dcd9f66bdcd50d1057d539"
diff --git a/poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch b/poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch
new file mode 100644
index 000000000..0b9fb8ccc
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Inappropriate [configuration]
+
+XORG_DEFAULT_OPTIONS pulls in the following dependency chains:
+
+XORG_CWARNFLAGS -> AC_PROG_CC_C99
+XORG_STRICT_OPTION -> AC_PROG_CC_C99, XORG_CWARNFLAGS
+XORG_MANPAGE_SECTIONS -> AC_CANONICAL_HOST -> Checks host
+
+each of which triggers the use of the host compiler. As an "all"
+architecture package, it shouldn't need a compiler (and doesn't).
+
+RP 17/5/2011
+
+diff -uNr font-alias-1.0.3.orig//configure.ac font-alias-1.0.3/configure.ac
+--- font-alias-1.0.3.orig//configure.ac 2011-05-18 21:29:18.378258643 +0200
++++ font-alias-1.0.3/configure.ac 2011-05-18 21:32:06.865258593 +0200
+@@ -28,12 +28,12 @@
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ AM_MAINTAINER_MODE
+
+-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+ m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+ XORG_MACROS_VERSION(1.3)
+-XORG_DEFAULT_OPTIONS
+-
++XORG_RELEASE_VERSION
++XORG_CHANGELOG
++XORG_INSTALL
+ AC_PROG_INSTALL
+
+ XORG_FONTROOTDIR
diff --git a/poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb b/poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb
new file mode 100644
index 000000000..15e101596
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "X font aliases"
+
+require xorg-font-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bf0158b89be493d523d69d9f29265038 \
+ file://cyrillic/fonts.alias;md5=f40795b0640d6785826aecd3b16f6124 \
+ file://75dpi/fonts.alias;md5=6bc48023f2ae7f3bfc105db7b0ee6b49 \
+ file://misc/fonts.alias;md5=a8ec05d528431d4c9703b55a7efd67a8 \
+ file://100dpi/fonts.alias;md5=85bebd6ca213aa656c301a72eb4397cb"
+
+SRC_URI += "file://nocompiler.patch"
+
+DEPENDS = "util-macros-native font-util-native"
+RDEPENDS_${PN} = "encodings font-util"
+RDEPENDS_${PN}_class-native = "font-util-native"
+
+inherit allarch
+
+PE = "1"
+PR = "${INC_PR}.3"
+
+SRC_URI[md5sum] = "6d25f64796fef34b53b439c2e9efa562"
+SRC_URI[sha256sum] = "8b453b2aae1cfa8090009ca037037b8c5e333550651d5a158b7264ce1d472c9a"
diff --git a/poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb b/poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
new file mode 100644
index 000000000..34646ff99
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "X.Org font package creation/installation utilities"
+
+require xorg-font-common.inc
+
+#Unicode is MIT
+LICENSE = "BSD & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5df208ec65eb84ce5bb8d82d8f3b9675 \
+ file://ucs2any.c;endline=28;md5=8357dc567fc628bd12696f15b2a33bcb \
+ file://bdftruncate.c;endline=26;md5=4f82ffc101a1b165eae9c6998abff937 \
+ file://map-ISO8859-1;beginline=9;endline=23;md5=1cecb984063248f29ffe5c46f5c04f34"
+
+DEPENDS = "encodings util-macros"
+DEPENDS_class-native = "util-macros-native"
+RDEPENDS_${PN} = "mkfontdir mkfontscale encodings"
+RDEPENDS_${PN}_class-native = "mkfontdir-native mkfontscale-native"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "23756dab809f9ec5011bb27fb2c3c7d6"
+SRC_URI[sha256sum] = "aa7ebdb0715106dd255082f2310dbaa2cd7e225957c2a77d719720c7cc92b921"
+
+SYSROOT_DIRS_BLACKLIST_remove = "${datadir}/fonts"
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc b/poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
new file mode 100644
index 000000000..cdbebcf78
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-font-common.inc
@@ -0,0 +1,43 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/fonts"
+LICENSE = "MIT-X"
+
+DEPENDS = " encodings font-alias font-util-native"
+RDEPENDS_${PN} = "encodings font-util font-alias"
+
+XORG_PN = "${BPN}"
+INC_PR = "r2"
+
+
+SRC_URI = "${XORG_MIRROR}/individual/font/${XORG_PN}-${PV}.tar.bz2"
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig distro_features_check
+
+# The mkfontscale-native requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OEMAKE += "FCCACHE=/bin/true UTIL_DIR=${STAGING_DIR_TARGET}\$\(MAPFILES_PATH\)"
+
+do_install_append() {
+ find ${D}${libdir}/X11/fonts -type f -name fonts.dir | xargs rm -f
+ find ${D}${libdir}/X11/fonts -type f -name fonts.scale | xargs rm -f
+ find ${D}${datadir}/fonts/X11 -type f -name fonts.dir | xargs rm -f
+ find ${D}${datadir}/fonts/X11 -type f -name fonts.scale | xargs rm -f
+}
+
+FILES_${PN} += " ${libdir}/X11/fonts ${datadir}"
+
+PACKAGE_WRITE_DEPS += "mkfontdir-native mkfontscale-native"
+pkg_postinst_${PN} () {
+ for fontdir in `find $D/usr/lib/X11/fonts -type d`; do
+ mkfontdir $fontdir
+ mkfontscale $fontdir
+ done
+ for fontdir in `find $D/usr/share/fonts/X11 -type d`; do
+ mkfontdir $fontdir
+ mkfontscale $fontdir
+ done
+}
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
new file mode 100644
index 000000000..9bcd1b2fa
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Xorg minimal fonts data"
+DESCRIPTION = "Minimal fonts required by X.org."
+HOMEPAGE = "http://www.x.org"
+
+SECTION = "x11/fonts"
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://../misc/fonts.dir;md5=82a143d94d6a974aafe97132d2d519ab \
+ file://../misc/cursor.pcf.gz;md5=40bc81001fef4c21ca08df4305014a2a"
+
+SRC_URI = "file://misc"
+
+PE = "1"
+PR = "r2"
+
+inherit allarch distro_features_check
+
+# The font-alias requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+S = "${WORKDIR}/misc"
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${libdir}/X11/ ${datadir}/fonts/X11/"
+RDEPENDS_${PN} += "font-alias"
+
+do_install() {
+ install -d ${D}/${datadir}/fonts/X11/misc
+ install -m 0644 ${S}/* ${D}/${datadir}/fonts/X11/misc/
+ install -d ${D}/${libdir}/X11
+ ln -sf ${datadir}/fonts/X11/ ${D}/${libdir}/X11/fonts -s
+}
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz
new file mode 100644
index 000000000..8bc8570a4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz
new file mode 100644
index 000000000..8fa829015
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz
new file mode 100644
index 000000000..bb1c5e138
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz
new file mode 100644
index 000000000..842fa1b41
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz
new file mode 100644
index 000000000..cd119b66d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz
new file mode 100644
index 000000000..25fe84a0e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz
new file mode 100644
index 000000000..e362c70ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz
new file mode 100644
index 000000000..176a7591c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz
new file mode 100644
index 000000000..a4faf1a6c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz
new file mode 100644
index 000000000..96ddd1525
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz
new file mode 100644
index 000000000..541a2ad2c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz
new file mode 100644
index 000000000..a4986f406
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz
new file mode 100644
index 000000000..3f89abe77
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz
new file mode 100644
index 000000000..432b53622
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz
new file mode 100644
index 000000000..e7fcb898e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
new file mode 100644
index 000000000..2df635537
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz
new file mode 100644
index 000000000..a263c5dd3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz
new file mode 100644
index 000000000..a1a7d37e6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz
new file mode 100644
index 000000000..a148e99bc
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz
new file mode 100644
index 000000000..8791b8ca3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz
new file mode 100644
index 000000000..860450868
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz
new file mode 100644
index 000000000..f28b1f1c4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz
new file mode 100644
index 000000000..fd1e6cfe9
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz
new file mode 100644
index 000000000..672b75942
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz
new file mode 100644
index 000000000..d90a4330d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz
new file mode 100644
index 000000000..775e7c18b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz
new file mode 100644
index 000000000..ac12fd98a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz
new file mode 100644
index 000000000..42bbd5221
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz
new file mode 100644
index 000000000..690d31f86
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
new file mode 100644
index 000000000..d4c3184c7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz
new file mode 100644
index 000000000..884b5130c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz
new file mode 100644
index 000000000..cbb1a9d70
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz
new file mode 100644
index 000000000..78c8580cf
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz
new file mode 100644
index 000000000..0e90f3ee1
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz
new file mode 100644
index 000000000..bd1273e1f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz
new file mode 100644
index 000000000..5100b429a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz
new file mode 100644
index 000000000..ec5bbed29
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz
new file mode 100644
index 000000000..06c835ee6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz
new file mode 100644
index 000000000..478541c2a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz
new file mode 100644
index 000000000..1c593ce0c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz
new file mode 100644
index 000000000..335cf5fc3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz
new file mode 100644
index 000000000..099423e64
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
new file mode 100644
index 000000000..4a546ddb1
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
new file mode 100644
index 000000000..72eb72bbe
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
Binary files differ
diff --git a/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir
new file mode 100644
index 000000000..0a2718f7b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir
@@ -0,0 +1,410 @@
+409
+10x20-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
+10x20-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-10
+10x20-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-11
+10x20-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-13
+10x20-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-14
+10x20-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-15
+10x20-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16
+10x20-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-2
+10x20-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-3
+10x20-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-4
+10x20-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-5
+10x20-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-7
+10x20-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-8
+10x20-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-9
+10x20-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r
+10x20.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
+12x13ja.pcf.gz -misc-fixed-medium-r-normal-ja-13-120-75-75-c-120-iso10646-1
+12x24.pcf.gz -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
+12x24rk.pcf.gz -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
+18x18ja.pcf.gz -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1
+18x18ko.pcf.gz -misc-fixed-medium-r-normal-ko-18-120-100-100-c-180-iso10646-1
+4x6-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-1
+4x6-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-10
+4x6-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-13
+4x6-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-14
+4x6-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-15
+4x6-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-16
+4x6-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-2
+4x6-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-3
+4x6-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-4
+4x6-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-5
+4x6-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-7
+4x6-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-8
+4x6-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-9
+4x6-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-koi8-r
+4x6.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso10646-1
+5x7-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1
+5x7-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-10
+5x7-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-13
+5x7-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-14
+5x7-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-15
+5x7-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-16
+5x7-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-2
+5x7-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-3
+5x7-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-4
+5x7-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-5
+5x7-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-7
+5x7-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-8
+5x7-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-9
+5x7-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-koi8-r
+5x7.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1
+5x8-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-1
+5x8-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-10
+5x8-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-13
+5x8-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-14
+5x8-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-15
+5x8-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-16
+5x8-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-2
+5x8-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-3
+5x8-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-4
+5x8-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-5
+5x8-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-7
+5x8-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-8
+5x8-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-9
+5x8-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-koi8-r
+5x8.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
+6x10-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
+6x10-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-10
+6x10-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-13
+6x10-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-14
+6x10-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-15
+6x10-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-16
+6x10-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-2
+6x10-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-3
+6x10-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-4
+6x10-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-5
+6x10-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-7
+6x10-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-8
+6x10-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-9
+6x10-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-koi8-r
+6x10.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso10646-1
+6x12-ISO8859-1.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1
+6x12-ISO8859-10.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-10
+6x12-ISO8859-13.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-13
+6x12-ISO8859-14.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-14
+6x12-ISO8859-15.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-15
+6x12-ISO8859-16.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-16
+6x12-ISO8859-2.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-2
+6x12-ISO8859-3.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-3
+6x12-ISO8859-4.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-4
+6x12-ISO8859-5.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-5
+6x12-ISO8859-7.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-7
+6x12-ISO8859-8.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-8
+6x12-ISO8859-9.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-9
+6x12-KOI8-R.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-koi8-r
+6x12.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
+6x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13-ISO8859-11.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-11
+6x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-8
+6x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13-KOI8-R.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-r
+6x13.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
+6x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-8
+6x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13B.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso10646-1
+6x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13O.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso10646-1
+6x9-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1
+6x9-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-10
+6x9-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-13
+6x9-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-14
+6x9-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-15
+6x9-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-16
+6x9-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-2
+6x9-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-3
+6x9-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-4
+6x9-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-5
+6x9-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-7
+6x9-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-8
+6x9-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-9
+6x9-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-koi8-r
+6x9.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso10646-1
+7x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
+7x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-10
+7x13-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-11
+7x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-13
+7x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-14
+7x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-15
+7x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-16
+7x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-2
+7x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-3
+7x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-4
+7x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-5
+7x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-7
+7x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-8
+7x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-9
+7x13-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-koi8-r
+7x13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1
+7x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
+7x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-10
+7x13B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-11
+7x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-13
+7x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-14
+7x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-15
+7x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-16
+7x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-2
+7x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-3
+7x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-4
+7x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-5
+7x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-7
+7x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-8
+7x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-9
+7x13B.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso10646-1
+7x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-1
+7x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-10
+7x13O-ISO8859-11.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-11
+7x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-13
+7x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-14
+7x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-15
+7x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-16
+7x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-2
+7x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-3
+7x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-4
+7x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-5
+7x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-7
+7x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-9
+7x13O.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso10646-1
+7x14-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
+7x14-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-10
+7x14-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-11
+7x14-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-13
+7x14-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-14
+7x14-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-15
+7x14-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-16
+7x14-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-2
+7x14-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-3
+7x14-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-4
+7x14-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-5
+7x14-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-7
+7x14-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-8
+7x14-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-9
+7x14-JISX0201.1976-0.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
+7x14-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r
+7x14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
+7x14B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
+7x14B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-10
+7x14B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-11
+7x14B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-13
+7x14B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-14
+7x14B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-15
+7x14B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-16
+7x14B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-2
+7x14B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-3
+7x14B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-4
+7x14B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-5
+7x14B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-7
+7x14B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-8
+7x14B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-9
+7x14B.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1
+8x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
+8x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-10
+8x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-13
+8x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-14
+8x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-15
+8x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-16
+8x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-2
+8x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-3
+8x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-4
+8x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-5
+8x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-7
+8x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-8
+8x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-9
+8x13-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-koi8-r
+8x13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
+8x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
+8x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-10
+8x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-13
+8x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-14
+8x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-15
+8x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-16
+8x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-2
+8x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-3
+8x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-4
+8x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-5
+8x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-7
+8x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-8
+8x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-9
+8x13B.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso10646-1
+8x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-1
+8x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-10
+8x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-13
+8x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-14
+8x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-15
+8x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-16
+8x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-2
+8x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-3
+8x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-4
+8x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-5
+8x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-7
+8x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-9
+8x13O.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso10646-1
+8x16.pcf.gz -sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1
+8x16rk.pcf.gz -sony-fixed-medium-r-normal--16-120-100-100-c-80-jisx0201.1976-0
+9x15-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
+9x15-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-10
+9x15-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-11
+9x15-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-13
+9x15-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-14
+9x15-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-15
+9x15-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-16
+9x15-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-2
+9x15-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-3
+9x15-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-4
+9x15-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-5
+9x15-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-7
+9x15-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-8
+9x15-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-9
+9x15-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-koi8-r
+9x15.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
+9x15B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
+9x15B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-10
+9x15B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-11
+9x15B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-13
+9x15B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-14
+9x15B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-15
+9x15B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-16
+9x15B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-2
+9x15B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-3
+9x15B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-4
+9x15B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-5
+9x15B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-7
+9x15B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-8
+9x15B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-9
+9x15B.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso10646-1
+9x18-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-1
+9x18-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-10
+9x18-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-11
+9x18-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-13
+9x18-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-14
+9x18-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-15
+9x18-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-16
+9x18-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-2
+9x18-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-3
+9x18-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-4
+9x18-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-5
+9x18-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-7
+9x18-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-8
+9x18-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-9
+9x18-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-koi8-r
+9x18.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
+9x18B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-1
+9x18B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-10
+9x18B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-13
+9x18B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-14
+9x18B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-15
+9x18B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-16
+9x18B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-2
+9x18B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-3
+9x18B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-4
+9x18B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-5
+9x18B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-7
+9x18B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-8
+9x18B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-9
+9x18B.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso10646-1
+arabic24.pcf.gz -arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1
+clB6x10.pcf.gz -schumacher-clean-bold-r-normal--10-100-75-75-c-60-iso646.1991-irv
+clB6x12.pcf.gz -schumacher-clean-bold-r-normal--12-120-75-75-c-60-iso646.1991-irv
+clB8x10.pcf.gz -schumacher-clean-bold-r-normal--10-100-75-75-c-80-iso646.1991-irv
+clB8x12.pcf.gz -schumacher-clean-bold-r-normal--12-120-75-75-c-80-iso646.1991-irv
+clB8x13.pcf.gz -schumacher-clean-bold-r-normal--13-130-75-75-c-80-iso646.1991-irv
+clB8x14.pcf.gz -schumacher-clean-bold-r-normal--14-140-75-75-c-80-iso646.1991-irv
+clB8x16.pcf.gz -schumacher-clean-bold-r-normal--16-160-75-75-c-80-iso646.1991-irv
+clB8x8.pcf.gz -schumacher-clean-bold-r-normal--8-80-75-75-c-80-iso646.1991-irv
+clB9x15.pcf.gz -schumacher-clean-bold-r-normal--15-150-75-75-c-90-iso646.1991-irv
+clI6x12.pcf.gz -schumacher-clean-medium-i-normal--12-120-75-75-c-60-iso646.1991-irv
+clI8x8.pcf.gz -schumacher-clean-medium-i-normal--8-80-75-75-c-80-iso646.1991-irv
+clR4x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-40-iso646.1991-irv
+clR5x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-50-iso646.1991-irv
+clR5x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-50-iso646.1991-irv
+clR5x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-50-iso646.1991-irv
+clR6x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-60-iso646.1991-irv
+clR6x12-ISO8859-1.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-1
+clR6x12-ISO8859-10.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-10
+clR6x12-ISO8859-13.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-13
+clR6x12-ISO8859-14.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-14
+clR6x12-ISO8859-15.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-15
+clR6x12-ISO8859-16.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-16
+clR6x12-ISO8859-2.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-2
+clR6x12-ISO8859-3.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-3
+clR6x12-ISO8859-4.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-4
+clR6x12-ISO8859-5.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-5
+clR6x12-ISO8859-7.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-7
+clR6x12-ISO8859-8.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-8
+clR6x12-ISO8859-9.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-9
+clR6x12-KOI8-R.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-koi8-r
+clR6x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso10646-1
+clR6x13.pcf.gz -schumacher-clean-medium-r-normal--13-130-75-75-c-60-iso646.1991-irv
+clR6x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-60-iso646.1991-irv
+clR6x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-60-iso646.1991-irv
+clR7x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-70-iso646.1991-irv
+clR7x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-70-iso646.1991-irv
+clR7x14.pcf.gz -schumacher-clean-medium-r-normal--14-140-75-75-c-70-iso646.1991-irv
+clR7x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-70-iso646.1991-irv
+clR8x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-80-iso646.1991-irv
+clR8x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-80-iso646.1991-irv
+clR8x13.pcf.gz -schumacher-clean-medium-r-normal--13-130-75-75-c-80-iso646.1991-irv
+clR8x14.pcf.gz -schumacher-clean-medium-r-normal--14-140-75-75-c-80-iso646.1991-irv
+clR8x16.pcf.gz -schumacher-clean-medium-r-normal--16-160-75-75-c-80-iso646.1991-irv
+clR8x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-80-iso646.1991-irv
+clR9x15.pcf.gz -schumacher-clean-medium-r-normal--15-150-75-75-c-90-iso646.1991-irv
+cu-alt12.pcf.gz -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-122-iso10646-1
+cu-arabic12.pcf.gz -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-101-fontspecific-0
+cu-devnag12.pcf.gz -mutt-clearlyu devangari extra-medium-r-normal--17-120-100-100-p-105-fontspecific-0
+cu-lig12.pcf.gz -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
+cu-pua12.pcf.gz -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-110-iso10646-1
+cu12.pcf.gz -mutt-clearlyu-medium-r-normal--17-120-100-100-p-123-iso10646-1
+cuarabic12.pcf.gz -mutt-clearlyu arabic-medium-r-normal--17-120-100-100-p-93-iso10646-1
+cudevnag12.pcf.gz -mutt-clearlyu devanagari-medium-r-normal--15-120-90-90-p-104-fontspecific-0
+cursor.pcf.gz cursor
+deccurs.pcf.gz decw$cursor
+decsess.pcf.gz decw$session
+gb16fs.pcf.gz -isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0
+gb16st.pcf.gz -isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0
+gb24st.pcf.gz -isas-song ti-medium-r-normal--24-240-72-72-c-240-gb2312.1980-0
+hanglg16.pcf.gz -daewoo-gothic-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
+hanglm16.pcf.gz -daewoo-mincho-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
+hanglm24.pcf.gz -daewoo-mincho-medium-r-normal--24-170-100-100-c-240-ksc5601.1987-0
+jiskan16.pcf.gz -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0
+jiskan24.pcf.gz -jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0
+k14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
+micro.pcf.gz micro
+nil2.pcf.gz -misc-nil-medium-r-normal--2-20-75-75-c-10-misc-fontspecific
+olcursor.pcf.gz -sun-open look cursor-----12-120-75-75-p-160-sunolcursor-1
+olgl10.pcf.gz -sun-open look glyph-----10-100-75-75-p-101-sunolglyph-1
+olgl12.pcf.gz -sun-open look glyph-----12-120-75-75-p-113-sunolglyph-1
+olgl14.pcf.gz -sun-open look glyph-----14-140-75-75-p-128-sunolglyph-1
+olgl19.pcf.gz -sun-open look glyph-----19-190-75-75-p-154-sunolglyph-1
diff --git a/poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb b/poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb
new file mode 100644
index 000000000..e623cee42
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb
@@ -0,0 +1,20 @@
+require xorg-lib-common.inc
+
+SUMMARY = "DMX: Distributed Multihead X extension library"
+
+DESCRIPTION = "The DMX extension provides support for communication with \
+and control of Xdmx(1) server. Attributes of the Xdmx(1) server and of \
+the back-end screens attached to the server can be queried and modified \
+via this protocol."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a3c3499231a8035efd0e004cfbd3b72a \
+ file://src/dmx.c;endline=33;md5=c43f19af03c7c8619cadc9724ed9afe1"
+
+DEPENDS += "libxext dmxproto"
+
+PE = "1"
+
+SRC_URI[md5sum] = "ba983eba5a9f05d152a0725b8e863151"
+SRC_URI[sha256sum] = "c97da36d2e56a2d7b6e4f896241785acc95e97eb9557465fd66ba2a155a7b201"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb b/poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb
new file mode 100644
index 000000000..a181f05c2
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb
@@ -0,0 +1,17 @@
+SUMMARY = "X font encoding library"
+
+DESCRIPTION = "libfontenc is a library which helps font libraries \
+portably determine and deal with different encodings of fonts."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=96254c20ab81c63e65b26f0dbcd4a1c1"
+
+DEPENDS += "zlib xproto font-util"
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "0920924c3a9ebc1265517bdd2f9fde50"
+SRC_URI[sha256sum] = "70588930e6fc9542ff38e0884778fbc6e6febf21adbab92fd8f524fe60aefd21"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb b/poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
new file mode 100644
index 000000000..f069749ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "ICE: Inter-Client Exchange library"
+
+DESCRIPTION = "The Inter-Client Exchange (ICE) protocol provides a \
+generic framework for building protocols on top of reliable, byte-stream \
+transport connections. It provides basic mechanisms for setting up and \
+shutting down connections, for performing authentication, for \
+negotiating versions, and for reporting errors. "
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d162b1b3c6fa812da9d804dcf8584a93"
+
+DEPENDS += "xproto xtrans"
+PROVIDES = "ice"
+
+PE = "1"
+
+XORG_PN = "libICE"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "addfb1e897ca8079531669c7c7711726"
+SRC_URI[sha256sum] = "8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch b/poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch
new file mode 100644
index 000000000..f53285824
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch
@@ -0,0 +1,28 @@
+From b6df5202306bd71158b482f25ca2e6919645d4dd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 4 Jun 2015 20:55:06 -0700
+Subject: [PATCH 4/4] Don't include sys/io.h on arm
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/linux_sysfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
+index 3f95e53..1e3aad3 100644
+--- a/src/linux_sysfs.c
++++ b/src/linux_sysfs.c
+@@ -50,7 +50,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+
+-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
++#if defined(__i386__) || defined(__x86_64__)
+ #include <sys/io.h>
+ #else
+ #define inb(x) -1
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.14.bb b/poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.14.bb
new file mode 100644
index 000000000..a44a5c892
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libpciaccess_0.14.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Generic PCI access library for X"
+
+DESCRIPTION = "libpciaccess provides functionality for X to access the \
+PCI bus and devices in a platform-independent way."
+
+require xorg-lib-common.inc
+
+SRC_URI += "\
+ file://0004-Don-t-include-sys-io.h-on-arm.patch \
+"
+
+SRC_URI[md5sum] = "8f436e151d5106a9cfaa71857a066d33"
+SRC_URI[sha256sum] = "3df543e12afd41fea8eac817e48cbfde5aed8817b81670a4e9e493bb2f5bf2a4"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=277aada5222b9a22fbf3471ff3687068"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb b/poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb
new file mode 100644
index 000000000..ffa1c859d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.4.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Library that provides weak aliases for pthread functions"
+DESCRIPTION = "This library provides weak aliases for pthread functions \
+not provided in libc or otherwise available by default."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=XCB"
+SECTION = "x11/libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6edc1fea03d959f0c2d743fe5ca746ad"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.bz2"
+SRC_URI[md5sum] = "48c1544854a94db0e51499cc3afd797f"
+SRC_URI[sha256sum] = "e4d05911a3165d3b18321cc067fdd2f023f06436e391c6a28dff618a78d2e733"
+
+inherit autotools
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb b/poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
new file mode 100644
index 000000000..48922cb99
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
@@ -0,0 +1,31 @@
+SUMMARY = "SM: Session Management library"
+
+DESCRIPTION = "The Session Management Library (SMlib) is a low-level \"C\" \
+language interface to XSMP. The purpose of the X Session Management \
+Protocol (XSMP) is to provide a uniform mechanism for users to save and \
+restore their sessions. A session is a group of clients, each of which \
+has a particular state."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c0fb37f44e02bdbde80546024400728d"
+
+DEPENDS += "libice xproto xtrans"
+
+# libSM can work without libuuid, we explicitly disable it to break the following circular dependency
+# when DISTRO_FEATURES contains 'systemd' and 'x11'.
+# systemd -> dbus -> libsm -> util-linux -> systemd
+EXTRA_OECONF += "--without-libuuid"
+
+PE = "1"
+
+XORG_PN = "libSM"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "499a7773c65aba513609fe651853c5f3"
+SRC_URI[sha256sum] = "0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.5.bb b/poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.5.bb
new file mode 100644
index 000000000..295f96a2e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.5.bb
@@ -0,0 +1,19 @@
+require libx11.inc
+
+DESCRIPTION += " Support for XCMS and XLOCALE is disabled in \
+this version."
+
+SRC_URI += "file://X18NCMSstubs.diff \
+ file://fix-disable-xlocale.diff \
+ file://fix-utf8-wrong-define.patch \
+ "
+
+RPROVIDES_${PN}-dev = "libx11-dev"
+RPROVIDES_${PN}-locale = "libx11-locale"
+
+SRC_URI[md5sum] = "0f618db70c4054ca67cee0cc156a4255"
+SRC_URI[sha256sum] = "4d3890db2ba225ba8c55ca63c6409c1ebb078a2806de59fb16342768ae63435d"
+
+EXTRA_OECONF += "--disable-xlocale"
+
+PACKAGECONFIG ??= ""
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11.inc b/poky/meta/recipes-graphics/xorg-lib/libx11.inc
new file mode 100644
index 000000000..4af40ab8a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11.inc
@@ -0,0 +1,37 @@
+SUMMARY = "Xlib: C Language X Interface library"
+
+DESCRIPTION = "This package provides a client interface to the X Window \
+System, otherwise known as 'Xlib'. It provides a complete API for the \
+basic functions of the window system."
+
+require xorg-lib-common.inc
+
+inherit siteinfo
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/libx11:"
+
+PE = "1"
+
+PROVIDES = "virtual/libx11"
+
+XORG_PN = "libX11"
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
+
+DEPENDS += "xproto xextproto xtrans libxcb kbproto inputproto"
+DEPENDS += "xproto-native"
+
+EXTRA_OECONF += "--with-keysymdefdir=${STAGING_INCDIR}/X11/ --disable-xf86bigfont"
+EXTRA_OEMAKE += 'CWARNFLAGS=""'
+
+PACKAGECONFIG ??= "xcms"
+PACKAGECONFIG[xcms] = "--enable-xcms,--disable-xcms"
+
+# src/util/makekeys is built natively but needs -D_GNU_SOURCE defined.
+CPPFLAGS_FOR_BUILD += "-D_GNU_SOURCE"
+
+PACKAGES =+ "${PN}-xcb"
+
+FILES_${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt"
+FILES_${PN}-xcb += "${libdir}/libX11-xcb.so.*"
+FILES_${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch b/poky/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch
new file mode 100644
index 000000000..897882b8d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11/Fix-hanging-issue-in-_XReply.patch
@@ -0,0 +1,60 @@
+From 5235a7f3692a4c3c90dd4ac1be3c670388904bbe Mon Sep 17 00:00:00 2001
+From: Tatu Frisk <tatu.frisk@ge.com>
+Date: Tue, 14 Mar 2017 14:41:27 +0200
+Subject: [PATCH] Fix hanging issue in _XReply
+
+Assume event queue is empty if another thread is blocking waiting for event.
+
+If one thread was blocking waiting for an event and another thread sent a
+reply to the X server, both threads got blocked until an event was
+received.
+
+Upstream-Status: Submitted [https://patchwork.freedesktop.org/patch/171458/]
+
+This patch needs to be removed once the corresponding patch has been merged upstream.
+
+https://patchwork.freedesktop.org/patch/171458/
+
+Signed-off-by: Tatu Frisk <tatu.frisk@ge.com>
+Signed-off-by: Jose Alarcon <jose.alarcon@ge.com>
+---
+ src/xcb_io.c | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/src/xcb_io.c b/src/xcb_io.c
+index 5987329..c64eb04 100644
+--- a/src/xcb_io.c
++++ b/src/xcb_io.c
+@@ -609,22 +609,17 @@ Status _XReply(Display *dpy, xReply *rep, int extra, Bool discard)
+ * letting anyone else process this sequence number, we
+ * need to process any events that should have come
+ * earlier. */
+-
+ if(dpy->xcb->event_owner == XlibOwnsEventQueue)
+ {
+ xcb_generic_reply_t *event;
+- /* If some thread is already waiting for events,
+- * it will get the first one. That thread must
+- * process that event before we can continue. */
+- /* FIXME: That event might be after this reply,
+- * and might never even come--or there might be
+- * multiple threads trying to get events. */
+- while(dpy->xcb->event_waiter)
+- { /* need braces around ConditionWait */
+- ConditionWait(dpy, dpy->xcb->event_notify);
++
++ /* Assume event queue is empty if another thread is blocking
++ * waiting for event. */
++ if(!dpy->xcb->event_waiter)
++ {
++ while((event = poll_for_response(dpy)))
++ handle_response(dpy, event, True);
+ }
+- while((event = poll_for_event(dpy)))
+- handle_response(dpy, event, True);
+ }
+
+ req->reply_waiter = 0;
+--
+2.10.1
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff b/poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff
new file mode 100644
index 000000000..744cedc77
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff
@@ -0,0 +1,520 @@
+Upstream-Status: Pending
+
+Upstream-Status: Inappropriate [configuration]
+Index: libX11-1.3/src/imConv.c
+===================================================================
+--- libX11-1.3.orig/src/imConv.c
++++ libX11-1.3/src/imConv.c
+@@ -83,6 +83,7 @@ static const struct SubstRec SubstTable[
+ * from UCS char to specified charset char.
+ * This converter is needed for _XimGetCharCode subroutine.
+ */
++#ifdef XLOCALE
+ XPointer
+ _XimGetLocaleCode (
+ _Xconst char* encoding_name)
+@@ -96,6 +97,7 @@ _XimGetLocaleCode (
+ }
+ return cvt;
+ }
++#endif
+
+ /*
+ * Returns the locale dependent representation of a keysym.
+@@ -106,6 +108,7 @@ _XimGetLocaleCode (
+ * terminating NUL byte. Return 0 if the keysym is not representable in the
+ * locale
+ */
++#ifdef XLOCALE
+ /*ARGSUSED*/
+ int
+ _XimGetCharCode (
+@@ -135,6 +138,7 @@ _XimGetCharCode (
+ buf[count]= '\0';
+ return count;
+ }
++#endif
+
+ #ifdef XKB
+ static int lookup_string(
+Index: libX11-1.3/src/X18NCMSstubs.c
+===================================================================
+--- /dev/null
++++ libX11-1.3/src/X18NCMSstubs.c
+@@ -0,0 +1,428 @@
++/*
++ * X18NCMSstubs.c
++ * - Provides stubs and dummy funcs needed when Xcms and XLocale stuff removed
++ *
++ * Copyright © 2003 Matthew Allum
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and its
++ * documentation for any purpose is hereby granted without fee, provided that
++ * the above copyright notice appear in all copies and that both that
++ * copyright notice and this permission notice appear in supporting
++ * documentation, and that the name of Matthew Allum not be used in
++ * advertising or publicity pertaining to distribution of the software without
++ * specific, written prior permission. Keith Packard and Compaq makes no
++ * representations about the suitability of this software for any purpose. It
++ * is provided "as is" without express or implied warranty.
++ *
++ * MATTHEW ALLUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
++ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
++ * IN NO EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++ * PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include "Xlibint.h"
++#include "Xlcint.h"
++#include <X11/Xlocale.h>
++#include <X11/Xos.h>
++#ifdef WIN32
++#undef close
++#endif
++#include <X11/Xutil.h>
++#include "XlcPubI.h"
++
++#include "Xcmsint.h" /* for XcmsCCC type */
++#include "XlcPubI.h" /* for XLCd type */
++#include "config.h"
++
++#if ! XLOCALE
++
++Bool
++XSupportsLocale()
++{
++ return False;
++}
++
++char *
++XSetLocaleModifiers(
++ const char *modifiers)
++{
++ return NULL;
++}
++
++XLCd
++_XOpenLC(
++ char *name)
++{
++ return NULL;
++}
++
++XLCd
++_XlcCurrentLC()
++{
++ return NULL;
++}
++
++void
++_XlcVaToArgList(
++ va_list var,
++ int count,
++ XlcArgList *args_ret)
++{
++ return;
++}
++
++void
++_XlcCountVaList(
++ va_list var,
++ int *count_ret)
++{
++ return;
++}
++
++void
++_XCloseLC(
++ XLCd lcd)
++{
++ return;
++}
++
++int
++_XlcConvert(
++ XlcConv conv,
++ XPointer *from,
++ int *from_left,
++ XPointer *to,
++ int *to_left,
++ XPointer *args,
++ int num_args)
++{
++ return 0;
++}
++
++/* XIM Stubs */
++
++XPointer
++_XimGetLocaleCode ( _Xconst char* encoding_name )
++{
++ return NULL;
++}
++
++int
++_XimGetCharCode (
++ XPointer ucs_conv,
++ KeySym keysym,
++ unsigned char* buf,
++ int nbytes)
++{
++ return 0;
++}
++
++/* Xrm Stubs */
++
++XrmMethods
++_XrmInitParseInfo(
++ XPointer *state)
++{
++ return (XrmMethods) NULL;
++}
++
++/* Xwc Stubs */
++
++int
++XwcTextExtents(
++ XFontSet font_set,
++ _Xconst wchar_t *text,
++ int text_len,
++ XRectangle *overall_ink_extents,
++ XRectangle *overall_logical_extents)
++{
++ return 0;
++}
++
++void
++XwcDrawString(Display *display,
++ Drawable d,
++ XFontSet font_set,
++ GC gc,
++ int x, int y,
++ _Xconst wchar_t *string,
++ int num_wchars)
++{
++ ;
++}
++
++void
++XwcDrawText(
++ Display *dpy,
++ Drawable d,
++ GC gc,
++ int x,
++ int y,
++ XwcTextItem *text_items,
++ int nitems)
++{
++ ;
++}
++
++void
++XwcDrawImageString(
++ Display *dpy,
++ Drawable d,
++ XFontSet font_set,
++ GC gc,
++ int x,
++ int y,
++ _Xconst wchar_t *text,
++ int text_len)
++{
++ ;
++}
++
++int
++XwcTextEscapement(
++ XFontSet font_set,
++ _Xconst wchar_t *text,
++ int text_len)
++{
++ return 0;
++}
++
++Status
++XwcTextPerCharExtents(
++ XFontSet font_set,
++ _Xconst wchar_t *text,
++ int text_len,
++ XRectangle *ink_extents_buffer,
++ XRectangle *logical_extents_buffer,
++ int buffer_size,
++ int *num_chars,
++ XRectangle *max_ink_extents,
++ XRectangle *max_logical_extents)
++{
++ return(XcmsFailure);
++}
++
++int
++XwcTextPropertyToTextList(
++ Display *dpy,
++ const XTextProperty *text_prop,
++ wchar_t ***list_ret,
++ int *count_ret)
++{
++ return 0;
++}
++
++int
++XwcTextListToTextProperty(
++ Display *dpy,
++ wchar_t **list,
++ int count,
++ XICCEncodingStyle style,
++ XTextProperty *text_prop)
++{
++ return 0;
++}
++
++void
++XwcFreeStringList(wchar_t **list)
++{
++ return;
++}
++
++
++void XmbSetWMProperties ( /* Actually from mbWMProps.c */
++ Display *dpy,
++ Window w,
++ _Xconst char *windowName,
++ _Xconst char *iconName,
++ char **argv,
++ int argc,
++ XSizeHints *sizeHints,
++ XWMHints *wmHints,
++ XClassHint *classHints)
++{
++ return;
++}
++
++int
++XmbTextPropertyToTextList(
++ Display *dpy,
++ const XTextProperty *text_prop,
++ char ***list_ret,
++ int *count_ret)
++{
++ return XLocaleNotSupported;
++}
++
++int
++XmbTextListToTextProperty(
++ Display *dpy,
++ char **list,
++ int count,
++ XICCEncodingStyle style,
++ XTextProperty *text_prop)
++{
++ return XLocaleNotSupported;
++}
++
++int
++XmbTextExtents(
++ XFontSet font_set,
++ _Xconst char *text,
++ int text_len,
++ XRectangle *overall_ink_extents,
++ XRectangle *overall_logical_extents)
++{
++ return 0;
++}
++
++void
++XmbDrawText(
++ Display *dpy,
++ Drawable d,
++ GC gc,
++ int x,
++ int y,
++ XmbTextItem *text_items,
++ int nitems)
++{
++ ;
++}
++
++void
++XmbDrawString(
++ Display *dpy,
++ Drawable d,
++ XFontSet font_set,
++ GC gc,
++ int x,
++ int y,
++ _Xconst char *text,
++ int text_len)
++{
++ ;
++}
++
++void
++XmbDrawImageString(
++ Display *dpy,
++ Drawable d,
++ XFontSet font_set,
++ GC gc,
++ int x,
++ int y,
++ _Xconst char *text,
++ int text_len)
++{
++ ;
++}
++
++int
++XmbTextEscapement(
++ XFontSet font_set,
++ _Xconst char *text,
++ int text_len)
++{
++ return 0;
++}
++
++Status
++XmbTextPerCharExtents(
++ XFontSet font_set,
++ _Xconst char *text,
++ int text_len,
++ XRectangle *ink_extents_buffer,
++ XRectangle *logical_extents_buffer,
++ int buffer_size,
++ int *num_chars,
++ XRectangle *max_ink_extents,
++ XRectangle *max_logical_extents)
++{
++ return 0;
++}
++
++unsigned int
++KeySymToUcs4(KeySym keysym)
++{
++ return 0;
++}
++
++#endif
++
++#if ! XCMS
++
++XcmsCCC
++XcmsCCCOfColormap(dpy, cmap)
++ Display *dpy;
++ Colormap cmap;
++{
++ return NULL;
++}
++
++Status
++_XcmsResolveColorString (
++ XcmsCCC ccc,
++ const char **color_string,
++ XcmsColor *pColor_exact_return,
++ XcmsColorFormat result_format)
++{
++ return(XcmsFailure);
++}
++
++void
++_XcmsUnresolveColor(
++ XcmsCCC ccc,
++ XcmsColor *pColor)
++{
++ return;
++}
++
++void
++_XUnresolveColor(
++ XcmsCCC ccc,
++ XColor *pXColor)
++{
++ return;
++}
++
++XcmsCmapRec *
++_XcmsAddCmapRec(dpy, cmap, windowID, visual)
++ Display *dpy;
++ Colormap cmap;
++ Window windowID;
++ Visual *visual;
++{
++ return NULL;
++}
++
++void
++_XcmsRGB_to_XColor(
++ XcmsColor *pColors,
++ XColor *pXColors,
++ unsigned int nColors)
++{
++ return;
++}
++
++XcmsCmapRec *
++_XcmsCopyCmapRecAndFree(
++ Display *dpy,
++ Colormap src_cmap,
++ Colormap copy_cmap)
++{
++ return NULL;
++}
++
++void
++_XcmsDeleteCmapRec(
++ Display *dpy,
++ Colormap cmap)
++{
++ return;
++}
++
++#endif
+Index: libX11-1.3/src/Makefile.am
+===================================================================
+--- libX11-1.3.orig/src/Makefile.am
++++ libX11-1.3/src/Makefile.am
+@@ -335,6 +335,8 @@ if THRSTUBS
+ libX11_la_SOURCES+=UIThrStubs.c
+ endif
+
++libX11_la_SOURCES+=X18NCMSstubs.c
++
+ x11datadir = @X11_DATADIR@
+ x11data_DATA = XKeysymDB XErrorDB
+
+@@ -342,6 +344,7 @@ EXTRA_DIST = \
+ $(x11data_DATA) \
+ os2Stubs.c \
+- UIThrStubs.c
++ UIThrStubs.c \
++ X18NCMSstubs.c
+
+ if XCB
+ libX11_la_SOURCES += \
+Index: libX11-1.3/src/locking.c
+===================================================================
+--- libX11-1.3.orig/src/locking.c
++++ libX11-1.3/src/locking.c
+@@ -66,7 +66,9 @@ in this Software without prior written a
+ #define NUM_FREE_CVLS 4
+
+ /* in lcWrap.c */
++#ifdef XLOCALE
+ extern LockInfoPtr _Xi18n_lock;
++#endif
+
+ #ifdef WIN32
+ static DWORD _X_TlsIndex = (DWORD)-1;
+@@ -594,9 +596,11 @@ Status XInitThreads(void)
+ _Xglobal_lock = &global_lock;
+ xmutex_init(_Xglobal_lock->lock);
+ xmutex_set_name(_Xglobal_lock->lock, "Xlib global");
++#ifdef XLOCALE
+ _Xi18n_lock = &i18n_lock;
+ xmutex_init(_Xi18n_lock->lock);
+ xmutex_set_name(_Xi18n_lock->lock, "Xlib i18n");
++#endif
+ _XLockMutex_fn = _XLockMutex;
+ _XUnlockMutex_fn = _XUnlockMutex;
+ _XCreateMutex_fn = _XCreateMutex;
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch b/poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch
new file mode 100644
index 000000000..c1b6cde53
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Update for 1.6.1
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff -Nurd libX11-1.5.0/nls/Makefile.am libX11-1.5.0/nls/Makefile.am
+--- libX11-1.5.0/nls/Makefile.am 2012-06-02 09:37:18.000000000 +0300
++++ libX11-1.5.0/nls/Makefile.am 2013-01-02 16:10:24.960156131 +0200
+@@ -36,11 +36,6 @@
+ < locale.dir.l1 > locale.dir.l2
+ cat locale.dir.l2 locale.dir.l1 > locale.dir
+
+-if HAVE_PERL
+-LOG_COMPILER = $(PERL)
+-TESTS = compose-check.pl
+-endif HAVE_PERL
+-
+
+ # Per-locale data files
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff b/poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff
new file mode 100644
index 000000000..a7c3984fd
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+--- libX11-X11R7.0-1.0.0/src/Font.c.orig 2006-03-12 18:35:42.000000000 +0100
++++ libX11-X11R7.0-1.0.0/src/Font.c 2006-03-12 18:40:27.000000000 +0100
+@@ -701,7 +701,11 @@
+ }
+ if (l - 2 - (p - charset) < 0)
+ return 0;
++#ifdef XLOCALE
+ if (_XlcNCompareISOLatin1(name + l - 2 - (p - charset), charset, p - charset))
++#else
++ if (strncasecmp(name + l - 2 - (p - charset), charset, p - charset))
++#endif
+ return 0;
+ if (strlen(p + 1) + l - 1 >= sizeof(buf) - 1)
+ return 0;
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch b/poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch
new file mode 100644
index 000000000..c6347f5be
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- libX11-X11R7.0-1.0.0/include/X11/Xlib.h~fix-utf8-wrong-define
++++ libX11-X11R7.0-1.0.0/include/X11/Xlib.h
+@@ -103,7 +103,7 @@
+
+ /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
+ November 2000. Its presence is indicated through the following macro. */
+-#define X_HAVE_UTF8_STRING 1
++#undef X_HAVE_UTF8_STRING
+
+ typedef char *XPointer;
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb b/poky/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb
new file mode 100644
index 000000000..427bf28ce
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libx11_1.6.5.bb
@@ -0,0 +1,14 @@
+require libx11.inc
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://disable_tests.patch \
+ file://Fix-hanging-issue-in-_XReply.patch \
+ "
+do_configure_append () {
+ sed -i -e "/X11_CFLAGS/d" ${B}/src/util/Makefile
+}
+
+SRC_URI[md5sum] = "0f618db70c4054ca67cee0cc156a4255"
+SRC_URI[sha256sum] = "4d3890db2ba225ba8c55ca63c6409c1ebb078a2806de59fb16342768ae63435d"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb b/poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb
new file mode 100644
index 000000000..2ef8bfa8b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Xau: X Authority Database library"
+
+DESCRIPTION = "libxau provides the main interfaces to the X11 \
+authorisation handling, which controls authorisation for X connections, \
+both client-side and server-side."
+
+require xorg-lib-common.inc
+
+inherit gettext
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7908e342491198401321cec1956807ec"
+
+DEPENDS += " xproto"
+PROVIDES = "xau"
+
+PE = "1"
+
+XORG_PN = "libXau"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "685f8abbffa6d145c0f930f00703b21b"
+SRC_URI[sha256sum] = "fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch b/poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch
new file mode 100644
index 000000000..d6148834a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+There is no extra reply data and if we say not to disgard it, xcb
+throws fatal asserts.
+
+RP - 26/11/09
+
+Index: git/xcalibrate.c
+===================================================================
+--- git.orig/xcalibrate.c 2009-11-26 08:11:48.000000000 +0000
++++ git/xcalibrate.c 2009-11-26 08:09:55.000000000 +0000
+@@ -216,7 +216,7 @@
+ req->reqType = info->codes->major_opcode;
+ req->xCalibrateReqType = X_XCalibrateRawMode;
+ req->on = enable;
+- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
++ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue))
+ {
+ UnlockDisplay (dpy);
+ SyncHandle ();
+@@ -240,7 +240,7 @@
+ req->xCalibrateReqType = X_XCalibrateScreenToCoord;
+ req->x = *x;
+ req->y = *y;
+- if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
++ if (!_XReply (dpy, (xReply *) &rep, 0, xTrue))
+ {
+ UnlockDisplay (dpy);
+ SyncHandle ();
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb b/poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
new file mode 100644
index 000000000..0fe65318b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XCalibrate: Touchscreen calibration library"
+
+DESCRIPTION = "libXCalibrate is a library for performing touchscreen \
+calibration with the kdrive tslib touchscreen driver."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xcalibrate.h;endline=21;md5=fa572df6439f0f235f2612f370f153d7 \
+ file://xcalibrate.c;endline=21;md5=fa572df6439f0f235f2612f370f153d7"
+
+DEPENDS = "virtual/libx11 calibrateproto libxext"
+
+SRCREV = "209d83af61ed38a002c8096377deac292b3e396c"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate \
+ file://fix-xcb.patch"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-locale += "${datadir}/X11/locale"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcb/Fix-inconsistent-use-of-tabs-vs.-space.patch b/poky/meta/recipes-graphics/xorg-lib/libxcb/Fix-inconsistent-use-of-tabs-vs.-space.patch
new file mode 100644
index 000000000..899238635
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcb/Fix-inconsistent-use-of-tabs-vs.-space.patch
@@ -0,0 +1,62 @@
+From 8740a288ca468433141341347aa115b9544891d3 Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <wiz@NetBSD.org>
+Date: Thu, 19 May 2016 17:31:18 +0200
+Subject: [PATCH] Fix inconsistent use of tabs vs. space.
+
+Needed for at least python-3.5.x.
+
+Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+Signed-off-by: Uli Schlachter <psychon@znc.in>
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/c_client.py | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/c_client.py b/src/c_client.py
+index 57de3fb..043338d 100644
+--- a/src/c_client.py
++++ b/src/c_client.py
+@@ -1364,7 +1364,7 @@ def _c_serialize(context, self):
+ _c(' unsigned int xcb_align_to = 0;')
+ if self.is_switch:
+ _c(' unsigned int xcb_padding_offset = %d;',
+- self.get_align_offset() )
++ self.get_align_offset() )
+ prefix = [('_aux', '->', self)]
+ aux_ptr = 'xcb_out'
+
+@@ -1390,7 +1390,7 @@ def _c_serialize(context, self):
+ _c(' unsigned int xcb_align_to = 0;')
+ if self.is_switch:
+ _c(' unsigned int xcb_padding_offset = %d;',
+- self.get_align_offset() )
++ self.get_align_offset() )
+
+ elif 'sizeof' == context:
+ param_names = [p[2] for p in params]
+@@ -1930,14 +1930,14 @@ def _c_accessors_list(self, field):
+ # from the request size and divide that by the member size
+ return '(((R->length * 4) - sizeof('+ self.c_type + '))/'+'sizeof('+field.type.member.c_wiretype+'))'
+ else:
+- # use the accessor to get the start of the list, then
+- # compute the length of it by subtracting it from
++ # use the accessor to get the start of the list, then
++ # compute the length of it by subtracting it from
+ # the adress of the first byte after the end of the
+ # request
+- after_end_of_request = '(((char*)R) + R->length * 4)'
+- start_of_list = '%s(R)' % (field.c_accessor_name)
++ after_end_of_request = '(((char*)R) + R->length * 4)'
++ start_of_list = '%s(R)' % (field.c_accessor_name)
+ bytesize_of_list = '%s - (char*)(%s)' % (after_end_of_request, start_of_list)
+- return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
++ return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
+ else:
+ raise Exception(
+ "lengthless lists with varsized members are not supported. Fieldname '%s'"
+--
+2.9.0
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch b/poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch
new file mode 100644
index 000000000..c0efbdc21
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch
@@ -0,0 +1,25 @@
+The "check" package is checked for without an explicit enable/disable option,
+which can lead to non-deterministic build issues with both check and libxslt.
+
+As the unit test suite is minimal at present, simply disable the test suite. In
+the future if the test suite is expanded this can be made conditional on the
+ptest DISTRO_FEATURE.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+Index: libxcb-1.12/configure.ac
+===================================================================
+--- libxcb-1.12.orig/configure.ac
++++ libxcb-1.12/configure.ac
+@@ -36,7 +36,8 @@ if test x"$HAVE_DOT" = xno; then
+ AC_MSG_WARN([dot not found - doxygen targets will be skipped])
+ fi
+
+-PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
++dnl PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
++HAVE_CHECK=no
+ AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes)
+
+ XSLTPROC=no
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch b/poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch
new file mode 100644
index 000000000..698d038f9
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcb/gcc-mips-pr68302-mips-workaround.patch
@@ -0,0 +1,22 @@
+Reduce debug info for xcb.c since on mips we run into a gcc5 bug
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68302
+
+This patch is a workaround to get past the gcc bug until its resolved.
+it should have minimal impact on libxcb while make it work.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libxcb-1.11.1/src/Makefile.am
+===================================================================
+--- libxcb-1.11.1.orig/src/Makefile.am
++++ libxcb-1.11.1/src/Makefile.am
+@@ -188,6 +188,7 @@ EXTSOURCES += xkb.c
+ if BUILD_XKB
+ lib_LTLIBRARIES += libxcb-xkb.la
+ libxcb_xkb_la_LDFLAGS = -version-info 1:0:0 -no-undefined
++CFLAGS += -g1
+ libxcb_xkb_la_LIBADD = $(XCB_LIBS)
+ nodist_libxcb_xkb_la_SOURCES = xkb.c xkb.h
+ endif
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch b/poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch
new file mode 100644
index 000000000..46297c33c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch
@@ -0,0 +1,28 @@
+As pkg-config --variable doesn't respect the sysroot, add the pkg-config sysroot
+to the beginning of variables that are used later on the host.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 94da4f7..d29cd6a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,7 +64,7 @@ AC_SUBST(NEEDED)
+
+ # Find the xcb-proto protocol descriptions
+ AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
+-XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
++XCBPROTO_XCBINCLUDEDIR=$PKG_CONFIG_SYSROOT_DIR/`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
+ AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
+ AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
+
+@@ -74,7 +74,7 @@ AC_SUBST(XCBPROTO_VERSION)
+
+ # Find the xcbgen Python package
+ AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
+-XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
++XCBPROTO_XCBPYTHONDIR=$PKG_CONFIG_SYSROOT_DIR/`$PKG_CONFIG --variable=pythondir xcb-proto`
+ AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
+ AC_SUBST(XCBPROTO_XCBPYTHONDIR)
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb b/poky/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
new file mode 100644
index 000000000..a38bdea5d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcb_1.12.bb
@@ -0,0 +1,39 @@
+SUMMARY = "XCB: The X protocol C binding library"
+DESCRIPTION = "The X protocol C-language Binding (XCB) is a replacement \
+for Xlib featuring a small footprint, latency hiding, direct access to \
+the protocol, improved threading support, and extensibility."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+SECTION = "x11/libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/libxcb-${PV}.tar.bz2 \
+ file://xcbincludedir.patch \
+ file://disable-check.patch \
+ file://gcc-mips-pr68302-mips-workaround.patch \
+ file://Fix-inconsistent-use-of-tabs-vs.-space.patch \
+ "
+SRC_URI[md5sum] = "28e552bd78bc1050b6b26ca1db0e5bb6"
+SRC_URI[sha256sum] = "4adfb1b7c67e99bc9c2ccb110b2f175686576d2f792c8a71b9c8b19014057b5b"
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "xcb-proto xproto libxau libpthread-stubs libxdmcp"
+
+PACKAGES_DYNAMIC = "^libxcb-.*"
+
+FILES_${PN} = "${libdir}/libxcb.so.*"
+
+inherit autotools pkgconfig distro_features_check
+
+# The libxau and others requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+REQUIRED_DISTRO_FEATURES_class-native = ""
+
+export PYTHON = "python3"
+
+python populate_packages_prepend () {
+ do_split_packages(d, '${libdir}', '^libxcb-(.*)\.so\..*$', 'libxcb-%s', 'XCB library module for %s', allow_links=True)
+}
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch b/poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch
new file mode 100644
index 000000000..60331f6e7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [configuration]
+
+This patch makes the build use its own Xcomposite.h over rather than an
+older Xcomposite.h that might already be installed in the staging dir.
+
+Index: libXcomposite-0.4.3/src/Makefile.am
+===================================================================
+--- libXcomposite-0.4.3.orig/src/Makefile.am 2010-06-30 22:42:53.000000000 -0700
++++ libXcomposite-0.4.3/src/Makefile.am 2010-11-23 23:09:34.544322930 -0800
+@@ -19,7 +19,7 @@
+ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ # PERFORMANCE OF THIS SOFTWARE.
+
+-AM_CFLAGS = $(CWARNFLAGS) $(XCOMPOSITE_CFLAGS) $(XFIXES_CFLAGS)
++AM_CFLAGS = -I$(top_srcdir)/include $(CWARNFLAGS) $(XCOMPOSITE_CFLAGS) $(XFIXES_CFLAGS)
+ AM_CPPFLAGS = -I$(top_srcdir)/include
+
+ lib_LTLIBRARIES = libXcomposite.la
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb b/poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb
new file mode 100644
index 000000000..70257194a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Xcomposite: X Composite extension library"
+
+DESCRIPTION = "The composite extension provides three related \
+mechanisms: per-hierarchy storage, automatic shadow update, and external \
+parent. In per-hierarchy storage, the rendering of an entire hierarchy \
+of windows is redirected to off-screen storage. In automatic shadow \
+update, when a hierarchy is rendered off-screen, the X server provides \
+an automatic mechanism for presenting those contents within the parent \
+window. In external parent, a mechanism for providing redirection of \
+compositing transformations through a client."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3f2907aad541f6f226fbc58cc1b3cdf1"
+
+DEPENDS += " compositeproto virtual/libx11 libxfixes libxext"
+PROVIDES = "xcomposite"
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+XORG_PN = "libXcomposite"
+
+SRC_URI += " file://change-include-order.patch"
+
+SRC_URI[md5sum] = "f7a218dcbf6f0848599c6c36fc65c51a"
+SRC_URI[sha256sum] = "ede250cd207d8bee4a338265c3007d7a68d5aca791b6ac41af18e9a2aeb34178"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.15.bb b/poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.15.bb
new file mode 100644
index 000000000..dc9af233e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxcursor_1.1.15.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Xcursor: X Cursor management library"
+
+DESCRIPTION = "Xcursor is a simple library designed to help locate and \
+load cursors. Cursors can be loaded from files or memory. A library of \
+common cursors exists which map to the standard X cursor names. Cursors \
+can exist in several sizes and the library automatically picks the best \
+size."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8902e6643f7bcd7793b23dcd5d8031a4"
+
+DEPENDS += "libxrender libxfixes"
+BBCLASSEXTEND = "native nativesdk"
+
+PE = "1"
+
+XORG_PN = "libXcursor"
+
+SRC_URI[md5sum] = "58fe3514e1e7135cf364101e714d1a14"
+SRC_URI[sha256sum] = "294e670dd37cd23995e69aae626629d4a2dfe5708851bbc13d032401b7a3df6b"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb b/poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb
new file mode 100644
index 000000000..c3d70043c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Xdamage: X Damage extension library"
+
+DESCRIPTION = "'Damage' is a term that describes changes make to pixel \
+contents of windows and pixmaps. Damage accumulates as drawing occurs \
+in the drawable. Each drawing operation 'damages' one or more \
+rectangular areas within the drawable. The rectangles are guaranteed to \
+include the set of pixels modified by each operation, but may include \
+significantly more than just those pixels. The DAMAGE extension allows \
+applications to either receive the raw rectangles as a stream of events, \
+or to have them partially processed within the X server to reduce the \
+amount of data transmitted as well as reduce the processing latency once \
+the repaint operation has started."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9fe101f30dd24134cf43146863241868"
+
+DEPENDS += "virtual/libx11 damageproto libxfixes"
+PROVIDES = "xdamage"
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+XORG_PN = "libXdamage"
+
+SRC_URI[md5sum] = "0cf292de2a9fa2e9a939aefde68fd34f"
+SRC_URI[sha256sum] = "7c3fe7c657e83547f4822bfde30a90d84524efb56365448768409b77f05355ad"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb b/poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb
new file mode 100644
index 000000000..f4e30d93d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb
@@ -0,0 +1,29 @@
+SUMMARY = "XDMCP: X Display Manager Control Protocol library"
+
+DESCRIPTION = "The purpose of the X Display Manager Control Protocol \
+(XDMCP) is to provide a uniform mechanism for an autonomous display to \
+request login service from a remote host. An X terminal (screen, \
+keyboard, mouse, processor, network interface) is a prime example of an \
+autonomous display."
+
+require xorg-lib-common.inc
+
+inherit gettext
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d559fb26e129626022e052a5e6e0e123"
+
+DEPENDS += "xproto"
+PROVIDES = "xdmcp"
+
+PE = "1"
+
+XORG_PN = "libXdmcp"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "18aa5c1279b01f9d18e3299969665b2e"
+SRC_URI[sha256sum] = "81fe09867918fff258296e1e1e159f0dc639cb30d201c53519f25ab73af4e4e2"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb
new file mode 100644
index 000000000..063e531c0
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb
@@ -0,0 +1,26 @@
+SUMMARY = "XExt: X Extension library"
+
+DESCRIPTION = "libXext provides an X Window System client interface to \
+several extensions to the X protocol. The supported protocol extensions \
+are DOUBLE-BUFFER, DPMS, Extended-Visual-Information, LBX, MIT_SHM, \
+MIT_SUNDRY-NONSTANDARD, Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, \
+XC-APPGROUP, XC-MISC, XTEST. libXext also provides a small set of \
+utility functions to aid authors of client APIs for X protocol \
+extensions."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=879ce266785414bd1cbc3bc2f4d9d7c8"
+
+DEPENDS += "xproto virtual/libx11 xextproto"
+PROVIDES = "xext"
+
+PE = "1"
+
+XORG_PN = "libXext"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "52df7c4c1f0badd9f82ab124fb32eb97"
+SRC_URI[sha256sum] = "b518d4d332231f313371fdefac59e3776f4f0823bcb23cf7c7305bfb57b16e35"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb
new file mode 100644
index 000000000..c80042d34
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxfixes_5.0.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XFixes: X Fixes extension library"
+
+DESCRIPTION = "X applications have often needed to work around various \
+shortcomings in the core X window system. This extension is designed to \
+provide the minimal server-side support necessary to eliminate problems \
+caused by these workarounds."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
+
+DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
+
+PE = "1"
+
+XORG_PN = "libXfixes"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "07e01e046a0215574f36a3aacb148be0"
+SRC_URI[sha256sum] = "de1cd33aff226e08cefd0e6759341c2c8e8c9faf8ce9ac6ec38d43e287b22ad6"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.3.bb
new file mode 100644
index 000000000..5f27a5582
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxfont2_2.0.3.bb
@@ -0,0 +1,22 @@
+SUMMARY = "XFont2: X Font rasterisation library"
+
+DESCRIPTION = "libXfont2 provides various services for X servers, most \
+notably font selection and rasterisation (through external libraries \
+such as freetype)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
+
+DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
+
+XORG_PN = "libXfont2"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "b7ca87dfafeb5205b28a1e91ac3efe85"
+SRC_URI[sha256sum] = "0e8ab7fd737ccdfe87e1f02b55f221f0bd4503a1c5f28be4ed6a54586bac9c4e"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb b/poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb
new file mode 100644
index 000000000..79f77fcea
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxfont_1.5.4.bb
@@ -0,0 +1,25 @@
+SUMMARY = "XFont: X Font rasterisation library"
+
+DESCRIPTION = "libXfont provides various services for X servers, most \
+notably font selection and rasterisation (through external libraries \
+such as freetype)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
+
+DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
+PROVIDES = "xfont"
+
+PE = "1"
+
+XORG_PN = "libXfont"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "16eaf156edd79b68038b6a7c44aa9e9b"
+SRC_URI[sha256sum] = "1a7f7490774c87f2052d146d1e0e64518d32e6848184a18654e8d0bb57883242"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb b/poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
new file mode 100644
index 000000000..b4547819f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "XFt: X FreeType libary"
+
+DESCRIPTION = "Xft was designed to provide good support for scalable \
+fonts, and to do so efficiently. Unlike the core fonts system, it \
+supports features such as anti-aliasing and sub-pixel rasterisation. \
+Perhaps more importantly, it gives applications full control over the \
+way glyphs are rendered, making fine typesetting and WYSIWIG display \
+possible. Finally, it allows applications to use fonts that are not \
+installed system-wide for displaying documents with embedded fonts. Xft \
+is not compatible with the core fonts system: usage of Xft requires \
+fairly extensive changes to toolkits (user-interface libraries)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90b90b60eb30f65fc9c2673d7cf59e24"
+
+DEPENDS += "virtual/libx11 libxrender freetype fontconfig"
+PROVIDES = "xft"
+
+PE = "1"
+
+SRC_URI[md5sum] = "331b3a2a3a1a78b5b44cfbd43f86fcfe"
+SRC_URI[sha256sum] = "f5a3c824761df351ca91827ac221090943ef28b248573486050de89f4bfcdc4c"
+
+XORG_PN = "libXft"
+
+BBCLASSEXTEND = "native"
+
+python () {
+ if d.getVar('DEBIAN_NAMES'):
+ d.setVar('PKG_${PN}', '${MLPREFIX}libxft2')
+}
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb b/poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb
new file mode 100644
index 000000000..74f0527b7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxi_1.7.9.bb
@@ -0,0 +1,22 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XI: X Input extension library"
+
+DESCRIPTION = "libxi is an extension to the X11 protocol to support \
+input devices other than the core X keyboard and pointer. It allows \
+client programs to select input from these devices independently from \
+each other and independently from the core devices."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
+ file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
+
+DEPENDS += "libxext inputproto libxfixes"
+
+PE = "1"
+
+XORG_PN = "libXi"
+
+SRC_URI[md5sum] = "1f0f2719c020655a60aee334ddd26d67"
+SRC_URI[sha256sum] = "c2e6b8ff84f9448386c1b5510a5cf5a16d788f76db018194dacdc200180faf45"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
new file mode 100644
index 000000000..bb03f44e2
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
@@ -0,0 +1,22 @@
+require xorg-lib-common.inc
+
+SUMMARY = "Xinerama: Xinerama extension library"
+
+DESCRIPTION = "Xinerama is a simple library designed to interface the \
+Xinerama Extension for retrieving information about physical output \
+devices which may be combined into a single logical X screen."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6f4f634d1643a2e638bba3fcd19c2536 \
+ file://src/Xinerama.c;beginline=2;endline=25;md5=fcef273bfb66339256411dd06ea79c02"
+
+DEPENDS += "libxext xineramaproto"
+PROVIDES = "xinerama"
+PE = "1"
+
+XORG_PN = "libXinerama"
+
+SRC_URI[md5sum] = "9336dc46ae3bf5f81c247f7131461efd"
+SRC_URI[sha256sum] = "7a45699f1773095a3f821e491cbd5e10c887c5a5fce5d8d3fced15c2ff7698e2"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.8.0.bb b/poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.8.0.bb
new file mode 100644
index 000000000..050d0b740
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxkbcommon_0.8.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Generic XKB keymap library"
+DESCRIPTION = "libxkbcommon is a keymap compiler and support library which \
+processes a reduced subset of keymaps as defined by the XKB specification."
+HOMEPAGE = "http://www.xkbcommon.org"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e525ed9809e1f8a07cf4bce8b09e8b87"
+LICENSE = "MIT & MIT-style"
+
+DEPENDS = "util-macros flex-native bison-native"
+
+SRC_URI = "http://xkbcommon.org/download/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "7d0e4c4a137d0ac45bf6b328c84c3a81"
+SRC_URI[sha256sum] = "e829265db04e0aebfb0591b6dc3377b64599558167846c3f5ee5c5e53641fe6d"
+
+UPSTREAM_CHECK_URI = "http://xkbcommon.org/"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-docs"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxcb xkeyboard-config,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb b/poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb
new file mode 100644
index 000000000..39a344cca
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb
@@ -0,0 +1,18 @@
+SUMMARY = "XKB: X Keyboard File manipulation library"
+
+DESCRIPTION = "libxkbfile provides an interface to read and manipulate \
+description files for XKB, the X11 keyboard configuration extension."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8be7367f7e5d605a426f76bb37d4d61f"
+
+DEPENDS += "virtual/libx11 kbproto"
+
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "4a4cfeaf24dab1b991903455d6d7d404"
+SRC_URI[sha256sum] = "51817e0530961975d9513b773960b4edd275f7d5c72293d5a151ed4f42aeb16a"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb b/poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
new file mode 100644
index 000000000..4740c1573
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Xmu and Xmuu: X Miscellaneous Utility libraries"
+
+DESCRIPTION = "The Xmu Library is a collection of miscellaneous (some \
+might say random) utility functions that have been useful in building \
+various applications and widgets. This library is required by the Athena \
+Widgets. A subset of the functions that do not rely on the Athena \
+Widgets (libXaw) or X Toolkit Instrinsics (libXt) are provided in a \
+second library, libXmuu."
+
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=def3d8e4e9c42004f1941fa22f01dc18"
+
+DEPENDS += "libxt libxext"
+PROVIDES = "xmu"
+
+PE = "1"
+
+XORG_PN = "libXmu"
+
+LEAD_SONAME = "libXmu"
+
+PACKAGES =+ "libxmuu"
+
+FILES_libxmuu = "${libdir}/libXmuu.so.*"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "41d92ab627dfa06568076043f3e089e4"
+SRC_URI[sha256sum] = "756edc7c383254eef8b4e1b733c3bf1dc061b523c9f9833ac7058378b8349d0b"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb b/poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
new file mode 100644
index 000000000..13a1b919e
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
@@ -0,0 +1,27 @@
+require xorg-lib-common.inc
+
+# libxpm requires xgettext to build
+inherit gettext
+
+SUMMARY = "Xpm: X Pixmap extension library"
+
+DESCRIPTION = "libXpm provides support and common operation for the XPM \
+pixmap format, which is commonly used in legacy X applications. XPM is \
+an extension of the monochrome XBM bitmap specificied in the X \
+protocol."
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
+DEPENDS += "libxext libsm libxt"
+PE = "1"
+
+XORG_PN = "libXpm"
+
+PACKAGES =+ "sxpm cxpm"
+FILES_cxpm = "${bindir}/cxpm"
+FILES_sxpm = "${bindir}/sxpm"
+
+SRC_URI[md5sum] = "20f4627672edb2bd06a749f11aa97302"
+SRC_URI[sha256sum] = "fd6a6de3da48de8d1bb738ab6be4ad67f7cb0986c39bd3f7d51dd24f7854bdec"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb b/poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb
new file mode 100644
index 000000000..48e88d20a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxrandr_1.5.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension library"
+
+DESCRIPTION = "The X Resize, Rotate and Reflect Extension, called RandR \
+for short, brings the ability to resize, rotate and reflect the root \
+window of a screen. It is based on the X Resize and Rotate Extension as \
+specified in the Proceedings of the 2001 Usenix Technical Conference \
+[RANDR]."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c9d1a2118a6cd5727521db8e7a2fee69"
+
+DEPENDS += "virtual/libx11 randrproto libxrender libxext"
+
+PE = "1"
+
+XORG_PN = "libXrandr"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "28e486f1d491b757173dd85ba34ee884"
+SRC_URI[sha256sum] = "1ff9e7fa0e4adea912b16a5f0cfa7c1d35b0dcda0e216831f7715c8a3abcf51a"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb b/poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb
new file mode 100644
index 000000000..92b310270
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxrender_0.9.10.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XRender: X Rendering Extension library"
+
+DESCRIPTION = "The X Rendering Extension (Render) introduces digital \
+image composition as the foundation of a new rendering model within the \
+X Window System. Rendering geometric figures is accomplished by \
+client-side tessellation into either triangles or trapezoids. Text is \
+drawn by loading glyphs into the server and rendering sets of them."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8bc71986d3b9b3639f6dfd6fac8f196"
+
+DEPENDS += "virtual/libx11 renderproto xproto"
+
+PE = "1"
+
+XORG_PN = "libXrender"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "802179a76bded0b658f4e9ec5e1830a4"
+SRC_URI[sha256sum] = "c06d5979f86e64cabbde57c223938db0b939dff49fdb5a793a1d3d0396650949"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxres_1.2.0.bb b/poky/meta/recipes-graphics/xorg-lib/libxres_1.2.0.bb
new file mode 100644
index 000000000..8c34e47b4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxres_1.2.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XRes: X Resource extension library"
+
+DESCRIPTION = "libXRes provides an X Window System client interface to \
+the Resource extension to the X protocol. The Resource extension allows \
+for X clients to see and monitor the X resource usage of various clients \
+(pixmaps, et al)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8c89441a8df261bdc56587465e13c7fa"
+
+DEPENDS += "libxext resourceproto"
+
+PE = "1"
+
+XORG_PN = "libXres"
+
+SRC_URI[md5sum] = "5d6d443d1abc8e1f6fc1c57fb27729bb"
+SRC_URI[sha256sum] = "ff75c1643488e64a7cfbced27486f0f944801319c84c18d3bd3da6bf28c812d4"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb b/poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb
new file mode 100644
index 000000000..354e5de7f
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb
@@ -0,0 +1,23 @@
+require xorg-lib-common.inc
+
+SUMMARY = "Xscrnsaver: X Screen Saver extension library"
+
+DESCRIPTION = "The X Window System provides support for changing the \
+image on a display screen after a user-settable period of inactivity to \
+avoid burning the cathode ray tube phosphors. However, no interfaces are \
+provided for the user to control the image that is drawn. This extension \
+allows an external \"screen saver\" client to detect when the alternate \
+image is to be displayed and to provide the graphics."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=21fd154ee757813632ada871a34113fb"
+
+DEPENDS += "libxext scrnsaverproto"
+PROVIDES = "libxss"
+RREPLACES_${PN} = "libxss"
+PE = "1"
+
+XORG_PN = "libXScrnSaver"
+
+SRC_URI[md5sum] = "7a773b16165e39e938650bcc9027c1d5"
+SRC_URI[sha256sum] = "8ff1efa7341c7f34bcf9b17c89648d6325ddaae22e3904e091794e0b4426ce1d"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxshmfence/extensions.patch b/poky/meta/recipes-graphics/xorg-lib/libxshmfence/extensions.patch
new file mode 100644
index 000000000..4cc9e05ab
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxshmfence/extensions.patch
@@ -0,0 +1,17 @@
+With glibc 2.27 memfd_create is behind a _GNU_SOURCE guard, so call
+AC_USE_SYSTEM_EXTENSIONS to get that defined.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 0c98875..ebf4dee 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -29,4 +29,6 @@ AC_CONFIG_SRCDIR([Makefile.am])
+ AC_CONFIG_HEADERS([config.h])
+
++AC_USE_SYSTEM_EXTENSIONS
++
+ # Initialize Automake
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb b/poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
new file mode 100644
index 000000000..1df068d1b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Shared memory 'SyncFence' synchronization primitive"
+
+DESCRIPTION = "This library offers a CPU-based synchronization primitive compatible \
+with the X SyncFence objects that can be shared between processes \
+using file descriptor passing."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
+
+DEPENDS += "virtual/libx11"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://extensions.patch"
+
+SRC_URI[md5sum] = "66662e76899112c0f99e22f2fc775a7e"
+SRC_URI[sha256sum] = "d21b2d1fd78c1efbe1f2c16dae1cb23f8fd231dcf891465b8debe636a9054b0c"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxt/0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch b/poky/meta/recipes-graphics/xorg-lib/libxt/0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch
new file mode 100644
index 000000000..1a691a3d5
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxt/0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch
@@ -0,0 +1,33 @@
+From b0c0e6d90bd99a699701c9542640adb218f5d536 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 10 Jul 2017 16:51:13 +0300
+Subject: [PATCH] libXt: util: don't link makestrs with target cflags
+
+The line: AM_CFLAGS = $(XT_CFLAGS)
+in util/Makefile.am is wrong because it adds target cflags to the
+compilation of makestrs, which is built for the build machine, which
+leads to build failures when cross-compiling.
+
+Upstream-Status: Pending
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ util/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/util/Makefile.am b/util/Makefile.am
+index 800b35b..f2dd1f9 100644
+--- a/util/Makefile.am
++++ b/util/Makefile.am
+@@ -11,7 +11,6 @@ EXTRA_DIST = \
+ StrDefs.ht \
+ string.list
+
+-AM_CFLAGS = $(XT_CFLAGS)
+ makestrs_SOURCES = makestrs.c
+
+
+--
+2.4.0
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch b/poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch
new file mode 100644
index 000000000..ffc2c15d7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+This fixes compilation with x32 toolchain.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/1
+
+
+--- libXt-1.1.1/include/X11/Xtos.h.x32 2011-02-08 07:56:40.000000000 -0800
++++ libXt-1.1.1/include/X11/Xtos.h 2011-11-30 17:19:27.473349770 -0800
+@@ -62,7 +62,7 @@ SOFTWARE.
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+ (defined(__hppa__) && defined(__LP64__)) || \
+- defined(__amd64__) || defined(amd64) || \
++ ((defined(__amd64__) || defined(amd64)) && defined(__LP64__)) || \
+ defined(__powerpc64__) || \
+ (defined(sgi) && (_MIPS_SZLONG == 64))
+ #define LONG64
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb b/poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
new file mode 100644
index 000000000..180d00d9b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Xt: X Toolkit Intrinsics library"
+
+DESCRIPTION = "The Intrinsics are a programming library tailored to the \
+special requirements of user interface construction within a network \
+window system, specifically the X Window System. The Intrinsics and a \
+widget set make up an X Toolkit. The Intrinsics provide the base \
+mechanism necessary to build a wide variety of interoperating widget \
+sets and application environments. The Intrinsics are a layer on top of \
+Xlib, the C Library X Interface. They extend the fundamental \
+abstractions provided by the X Window System while still remaining \
+independent of any particular user interface policy or style."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6565b1e0094ea1caae0971cc4035f343"
+
+
+DEPENDS += "util-linux libxcb libsm virtual/libx11 kbproto libxdmcp"
+PROVIDES = "xt"
+
+PE = "1"
+
+XORG_PN = "libXt"
+
+SRC_URI += "file://libxt_fix_for_x32.patch \
+ file://0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch \
+ "
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF += "--disable-xkb"
+
+SRC_URI[md5sum] = "8f5b5576fbabba29a05f3ca2226f74d3"
+SRC_URI[sha256sum] = "46eeb6be780211fdd98c5109286618f6707712235fdd19df4ce1e6954f349f1a"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb
new file mode 100644
index 000000000..5717fa5b7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxtst_1.2.3.bb
@@ -0,0 +1,21 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XTest: X Test extension library"
+
+DESCRIPTION = "This extension is a minimal set of client and server \
+extensions required to completely test the X11 server with no user \
+intervention."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bb4f89972c3869f617f61c1a79ad1952 \
+ file://src/XTest.c;beginline=2;endline=32;md5=b1c8c9dff842b4d5b89ca5fa32c40e99"
+
+DEPENDS += "libxext recordproto inputproto libxi"
+PROVIDES = "xtst"
+PE = "1"
+
+XORG_PN = "libXtst"
+
+SRC_URI[md5sum] = "ef8c2c1d16a00bd95b9fdcef63b8a2ca"
+SRC_URI[sha256sum] = "4655498a1b8e844e3d6f21f3b2c4e2b571effb5fd83199d428a6ba7ea4bf5204"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb b/poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb
new file mode 100644
index 000000000..a226c2753
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxv_1.0.11.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Xv: X Video extension library"
+
+DESCRIPTION = "libXv provides an X Window System client interface to the \
+X Video extension to the X protocol. The X Video extension allows for \
+accelerated drawing of videos. Hardware adaptors are exposed to \
+clients, which may draw in a number of colourspaces, including YUV."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
+
+DEPENDS += "libxext videoproto"
+
+XORG_PN = "libXv"
+
+SRC_URI[md5sum] = "210b6ef30dda2256d54763136faa37b9"
+SRC_URI[sha256sum] = "d26c13eac99ac4504c532e8e76a1c8e4bd526471eb8a0a4ff2a88db60cb0b088"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb b/poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb
new file mode 100644
index 000000000..6ed49b1f3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxvmc_1.0.10.bb
@@ -0,0 +1,19 @@
+SUMMARY = "XvMC: X Video Motion Compensation extension library"
+
+DESCRIPTION = "XvMC extends the X Video extension (Xv) and enables \
+hardware rendered motion compensation support."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0a207f08d4961489c55046c9a5e500da \
+ file://wrapper/XvMCWrapper.c;endline=26;md5=5151daa8172a3f1bb0cb0e0ff157d9de"
+
+DEPENDS += "libxext libxv videoproto"
+
+PE = "1"
+
+XORG_PN = "libXvMC"
+
+SRC_URI[md5sum] = "4cbe1c1def7a5e1b0ed5fce8e512f4c6"
+SRC_URI[sha256sum] = "e501a079b5dfaef0897c56152770c77e05e362065cec58910289aa567277ee2e"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb b/poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb
new file mode 100644
index 000000000..695a39637
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb
@@ -0,0 +1,19 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XFree86-DGA: XFree86 Direct Graphics Access extension library"
+
+DESCRIPTION = "libXxf86dga provides the XFree86-DGA extension, which \
+allows direct graphics access to a framebuffer-like region, and also \
+allows relative mouse reporting, et al. It is mainly used by games and \
+emulators for games."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=abb99ac125f84f424a4278153988e32f"
+
+DEPENDS += "libxext xf86dgaproto"
+
+PE = "1"
+
+SRC_URI[md5sum] = "d7dd9b9df336b7dd4028b6b56542ff2c"
+SRC_URI[sha256sum] = "8eecd4b6c1df9a3704c04733c2f4fa93ef469b55028af5510b25818e2456c77e"
+
+XORG_PN = "libXxf86dga"
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb b/poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb
new file mode 100644
index 000000000..af6f1f76a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XFree86-Misc: XFree86 miscellaneous extension library"
+
+DESCRIPTION = "The XFree86-Misc extension, provides a means to access \
+input device configuration settings specific to the XFree86/Xorg DDX."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=27c91ecc435bd3d2bfad868914c94b45"
+
+DEPENDS += "libxext xf86miscproto"
+PROVIDES = "xxf86misc"
+
+PE = "1"
+
+XORG_PN = "libXxf86misc"
+
+SRC_URI[md5sum] = "6bc0bf78909fd71021c466c793d4385c"
+SRC_URI[sha256sum] = "563f4200862efd3334c33a669e0a0aae5bab31f3998db75b87a99a697cc26b5b"
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb b/poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb
new file mode 100644
index 000000000..35f87d271
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XFree86-VM: XFree86 video mode extension library"
+
+DESCRIPTION = "libXxf86vm provides an interface to the \
+XFree86-VidModeExtension extension, which allows client applications to \
+get and set video mode timings in extensive detail. It is used by the \
+xvidtune program in particular."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fa0b9c462d8f2f13eba26492d42ea63d"
+
+DEPENDS += "libxext xf86vidmodeproto"
+
+PE = "1"
+
+XORG_PN = "libXxf86vm"
+
+SRC_URI[md5sum] = "298b8fff82df17304dfdb5fe4066fe3a"
+SRC_URI[sha256sum] = "afee27f93c5f31c0ad582852c0fb36d50e4de7cd585fcf655e278a633d85cd57"
diff --git a/poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch b/poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
new file mode 100644
index 000000000..4569dca01
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
@@ -0,0 +1,144 @@
+From a0f53e1dbb3851bb0f0efcfdbd565b05e4be9cac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Thu, 23 Aug 2012 18:10:57 +0200
+Subject: [PATCH 1/2] ARM: qemu related workarounds in cpu features detection
+ code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This was ported from meta-oe's patch [1]. The original pixman patch is found
+at [2].
+
+[1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
+[2] http://lists.freedesktop.org/archives/pixman/2011-January/000906.html
+
+Upstream-Status: Inappropriate [other] qemu fix
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ pixman/pixman-arm.c | 82 ++++++++++++++++++++++++++++++++++++++++----------
+ 1 files changed, 65 insertions(+), 17 deletions(-)
+
+diff --git a/pixman/pixman-arm.c b/pixman/pixman-arm.c
+index 23374e4..d98bda6 100644
+--- a/pixman/pixman-arm.c
++++ b/pixman/pixman-arm.c
+@@ -129,16 +129,35 @@ detect_cpu_features (void)
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
++#include <sys/utsname.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <elf.h>
+
++/*
++ * The whole CPU capabilities detection is a bit ugly: when running in
++ * userspace qemu, we see /proc/self/auxv from the host system. To make
++ * everything even worse, the size of each value is 64-bit when running
++ * on a 64-bit host system. So the data is totally bogus because we expect
++ * 32-bit values. As AT_PLATFORM value is used as a pointer, it may cause
++ * segfault (null pointer dereference on x86-64 host). So in order to be
++ * on a safe side, we require that AT_PLATFORM value is found only once,
++ * and it has non-zero value (this is still not totally reliable for a big
++ * endian 64-bit host system running qemu and may theoretically fail).
++ */
++#define ARM_HWCAP_VFP 64
++#define ARM_HWCAP_IWMMXT 512
++#define ARM_HWCAP_NEON 4096
++
+ static arm_cpu_features_t
+ detect_cpu_features (void)
+ {
+ arm_cpu_features_t features = 0;
+ Elf32_auxv_t aux;
+ int fd;
++ uint32_t hwcap = 0;
++ const char *plat = NULL;
++ int plat_cnt = 0;
+
+ fd = open ("/proc/self/auxv", O_RDONLY);
+ if (fd >= 0)
+@@ -147,32 +166,61 @@ detect_cpu_features (void)
+ {
+ if (aux.a_type == AT_HWCAP)
+ {
+- uint32_t hwcap = aux.a_un.a_val;
+-
+- /* hardcode these values to avoid depending on specific
+- * versions of the hwcap header, e.g. HWCAP_NEON
+- */
+- if ((hwcap & 64) != 0)
+- features |= ARM_VFP;
+- if ((hwcap & 512) != 0)
+- features |= ARM_IWMMXT;
+- /* this flag is only present on kernel 2.6.29 */
+- if ((hwcap & 4096) != 0)
+- features |= ARM_NEON;
++ hwcap = aux.a_un.a_val;
+ }
+ else if (aux.a_type == AT_PLATFORM)
+ {
+- const char *plat = (const char*) aux.a_un.a_val;
+-
+- if (strncmp (plat, "v7l", 3) == 0)
++ plat = (const char*) aux.a_un.a_val;
++ plat_cnt++;
++ }
++ }
++ close (fd);
++ if (plat == NULL || plat_cnt != 1 || *plat != 'v')
++ {
++ /*
++ * Something seems to be really wrong, most likely we are
++ * running under qemu. Let's use machine type from "uname" for
++ * CPU capabilities detection:
++ * http://www.mail-archive.com/qemu-devel at nongnu.org/msg22212.html
++ */
++ struct utsname u;
++ hwcap = 0; /* clear hwcap, because it is bogus */
++ if (uname (&u) == 0)
++ {
++ if (strcmp (u.machine, "armv7l") == 0)
++ {
+ features |= (ARM_V7 | ARM_V6);
+- else if (strncmp (plat, "v6l", 3) == 0)
++ hwcap |= ARM_HWCAP_VFP; /* qemu is supposed to emulate vfp */
++ hwcap |= ARM_HWCAP_NEON; /* qemu is supposed to emulate neon */
++ }
++ else if (strcmp (u.machine, "armv6l") == 0)
++ {
+ features |= ARM_V6;
++ hwcap |= ARM_HWCAP_VFP; /* qemu is supposed to emulate vfp */
++ }
+ }
+ }
+- close (fd);
++ else if (strncmp (plat, "v7l", 3) == 0)
++ {
++ features |= (ARM_V7 | ARM_V6);
++ }
++ else if (strncmp (plat, "v6l", 3) == 0)
++ {
++ features |= ARM_V6;
++ }
+ }
+
++ /* hardcode these values to avoid depending on specific
++ * versions of the hwcap header, e.g. HWCAP_NEON
++ */
++ if ((hwcap & ARM_HWCAP_VFP) != 0)
++ features |= ARM_VFP;
++ if ((hwcap & ARM_HWCAP_IWMMXT) != 0)
++ features |= ARM_IWMMXT;
++ /* this flag is only present on kernel 2.6.29 */
++ if ((hwcap & ARM_HWCAP_NEON) != 0)
++ features |= ARM_NEON;
++
+ return features;
+ }
+
+--
+1.7.6.5
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/pixman/0001-test-utils-Check-for-FE_INVALID-definition-before-us.patch b/poky/meta/recipes-graphics/xorg-lib/pixman/0001-test-utils-Check-for-FE_INVALID-definition-before-us.patch
new file mode 100644
index 000000000..782c1db02
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/pixman/0001-test-utils-Check-for-FE_INVALID-definition-before-us.patch
@@ -0,0 +1,33 @@
+From 0ccd906b904d21536d5ab41c6196760e3e5d72cb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 17 May 2016 17:30:00 -0700
+Subject: [PATCH] test/utils: Check for FE_INVALID definition before use
+
+Some architectures e.g. nios2 do not support all exceptions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ test/utils.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/test/utils.c b/test/utils.c
+index f8e42a5..fe32b1e 100644
+--- a/test/utils.c
++++ b/test/utils.c
+@@ -978,9 +978,11 @@ enable_invalid_exceptions (void)
+ {
+ #ifdef HAVE_FENV_H
+ #ifdef HAVE_FEENABLEEXCEPT
++#ifdef FE_INVALID
+ feenableexcept (FE_INVALID);
+ #endif
+ #endif
++#endif
+ }
+
+ void *
+--
+2.8.2
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch b/poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch
new file mode 100644
index 000000000..b52a5707d
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch
@@ -0,0 +1,29 @@
+Fixes errors like
+
+Assembler messages:
+Fatal error: can't create .libs/pixman-mips-dspr2-asm.o: No such file or directory
+
+it works with glibc because it uses gcc fixed-headers but thats not right.
+
+We move the include under C block
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: pixman-0.32.6/pixman/pixman-private.h
+===================================================================
+--- pixman-0.32.6.orig/pixman/pixman-private.h
++++ pixman-0.32.6/pixman/pixman-private.h
+@@ -1,4 +1,3 @@
+-#include <float.h>
+
+ #ifndef PIXMAN_PRIVATE_H
+ #define PIXMAN_PRIVATE_H
+@@ -17,6 +16,8 @@
+
+ #ifndef __ASSEMBLER__
+
++#include <float.h>
++
+ #ifndef PACKAGE
+ # error config.h must be included before pixman-private.h
+ #endif
diff --git a/poky/meta/recipes-graphics/xorg-lib/pixman_0.34.0.bb b/poky/meta/recipes-graphics/xorg-lib/pixman_0.34.0.bb
new file mode 100644
index 000000000..c4ca621a8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/pixman_0.34.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Pixman: Pixel Manipulation library"
+
+DESCRIPTION = "Pixman provides a library for manipulating pixel regions \
+-- a set of Y-X banded rectangles, image compositing using the \
+Porter/Duff model and implicit mask generation for geometric primitives \
+including trapezoids, triangles, and rectangles."
+
+require xorg-lib-common.inc
+
+# see http://cairographics.org/releases/ - only even minor versions are stable
+UPSTREAM_CHECK_REGEX = "pixman-(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)"
+
+LICENSE = "MIT & MIT-style & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3 \
+ file://pixman/pixman-matrix.c;endline=25;md5=ba6e8769bfaaee2c41698755af04c4be \
+ file://pixman/pixman-arm-neon-asm.h;endline=24;md5=9a9cc1e51abbf1da58f4d9528ec9d49b \
+ "
+DEPENDS += "zlib libpng"
+BBCLASSEXTEND = "native nativesdk"
+
+PE = "1"
+
+IWMMXT = "--disable-arm-iwmmxt"
+LOONGSON_MMI = "--disable-loongson-mmi"
+# If target supports neon then disable the 'simd' (ie VFPv2) fallback, otherwise disable neon.
+NEON = "${@bb.utils.contains("TUNE_FEATURES", "neon", "--disable-arm-simd", "--disable-arm-neon" ,d)}"
+
+EXTRA_OECONF = "--disable-gtk ${IWMMXT} ${LOONGSON_MMI} ${NEON}"
+EXTRA_OECONF_class-native = "--disable-gtk"
+EXTRA_OECONF_class-nativesdk = "--disable-gtk"
+
+SRC_URI += "\
+ file://0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch \
+ file://asm_include.patch \
+ file://0001-test-utils-Check-for-FE_INVALID-definition-before-us.patch \
+"
+
+SRC_URI[md5sum] = "002a4fcb644ddfcb4b0e4191576a0d59"
+SRC_URI[sha256sum] = "39ba3438f3d17c464b0cb8be006dacbca0ab5aee97ebde69fec7ecdbf85794a0"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch b/poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch
new file mode 100644
index 000000000..11e90940a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util-image/clang.patch
@@ -0,0 +1,24 @@
+Make clang happy since it squashes the control warning, ideally it will never reach that return value due to assert
+but there is a chance when NDEBUG is defined
+
+| In file included from ../../xcb-util-image-0.4.0/image/xcb_image.c:37:
+| ../../xcb-util-image-0.4.0/image/xcb_bitops.h:210:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
+| }
+| ^
+| 1 error generated.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: xcb-util-image-0.4.0/image/xcb_bitops.h
+===================================================================
+--- xcb-util-image-0.4.0.orig/image/xcb_bitops.h
++++ xcb-util-image-0.4.0/image/xcb_bitops.h
+@@ -207,6 +207,7 @@ xcb_host_byte_order(void) {
+ return XCB_IMAGE_ORDER_LSB_FIRST;
+ }
+ assert(0);
++ return -1;
+ }
+
+ #endif /* __XCB_BITOPS_H__ */
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb b/poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
new file mode 100644
index 000000000..c6bb5a61c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
@@ -0,0 +1,13 @@
+require xcb-util.inc
+
+DEPENDS += "xcb-util"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://image/xcb_image.c;endline=24;md5=eafdf965cfb89955fdedf75054223fb4 \
+ file://image/xcb_image.h;beginline=4;endline=27;md5=48cd25ae55e7de525fe1e1a3a7672e1c"
+
+SRC_URI += "file://clang.patch \
+"
+
+SRC_URI[md5sum] = "08fe8ffecc8d4e37c0ade7906b3f4c87"
+SRC_URI[sha256sum] = "2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc"
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb b/poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb
new file mode 100644
index 000000000..bca64ed61
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb
@@ -0,0 +1,9 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://keysyms/keysyms.c;endline=30;md5=2f8de023ed823bb92f0b47900574ea9e \
+ "
+SRC_URI[md5sum] = "1022293083eec9e62d5659261c29e367"
+SRC_URI[sha256sum] = "0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9"
+
+
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb b/poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb
new file mode 100644
index 000000000..25c22e5fa
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb
@@ -0,0 +1,10 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://renderutil/glyph.c;endline=24;md5=c517c483b8d726234ec94f9169236661 \
+ file://renderutil/util.c;endline=20;md5=6e0bfc44fb13298c0f4694eb70dc80d4 \
+ file://renderutil/xcb_renderutil.h;endline=24;md5=d0ddab3052dd4949c93cfcb0891c96df \
+ "
+
+SRC_URI[md5sum] = "468b119c94da910e1291f3ffab91019a"
+SRC_URI[sha256sum] = "c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b"
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb b/poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb
new file mode 100644
index 000000000..39f138329
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb
@@ -0,0 +1,11 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://ewmh/ewmh.c.m4;endline=27;md5=63fd80552d7dc886f4eb267610d5bb9d \
+ file://ewmh/xcb_ewmh.h.m4;beginline=4;endline=30;md5=73b589f90ef90b4a43998955daad5cd8 \
+ file://icccm/icccm.c;endline=28;md5=e2b3240a0c197e8977adde2a5cf18d50 \
+ file://icccm/xcb_icccm.h;beginline=4;endline=31;md5=393772b7b07b9868d479d538238c1d8a \
+ "
+
+SRC_URI[md5sum] = "87b19a1cd7bfcb65a24e36c300e03129"
+SRC_URI[sha256sum] = "28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f"
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util.inc b/poky/meta/recipes-graphics/xorg-lib/xcb-util.inc
new file mode 100644
index 000000000..99d04f9d4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util.inc
@@ -0,0 +1,23 @@
+SUMMARY = "XCB: The X protocol C binding utilities"
+DESCRIPTION = "The xcb-util module provides a number of libraries which \
+sit on top of libxcb, the core X protocol library, and some of the \
+extension libraries. These experimental libraries provide convenience \
+functions and interfaces which make the raw X protocol more usable. Some \
+of the libraries also provide client-side code which is not strictly \
+part of the X protocol but which have traditionally been provided by \
+Xlib."
+HOMEPAGE = "http://xcb.freedesktop.org/XcbUtil/"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+
+LICENSE = "MIT"
+
+SECTION = "x11/libs"
+
+DEPENDS = "libxcb"
+DEPENDS += "gperf-native"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/${BPN}-${PV}.tar.bz2"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb b/poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb
new file mode 100644
index 000000000..206f07a65
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb
@@ -0,0 +1,8 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://src/xcb_aux.c;endline=30;md5=ae305b9c2a38f9ba27060191046a6460 \
+ file://src/xcb_event.h;endline=27;md5=627be355aee59e1b8ade80d5bd90fad9"
+
+SRC_URI[md5sum] = "2e97feed81919465a04ccc71e4073313"
+SRC_URI[sha256sum] = "46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9"
diff --git a/poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.22.bb b/poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.22.bb
new file mode 100644
index 000000000..4fd894fd7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.22.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Keyboard configuration database for X Window"
+
+DESCRIPTION = "The non-arch keyboard configuration database for X \
+Window. The goal is to provide the consistent, well-structured, \
+frequently released open source of X keyboard configuration data for X \
+Window System implementations. The project is targeted to XKB-based \
+systems."
+
+HOMEPAGE = "http://freedesktop.org/wiki/Software/XKeyboardConfig"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xkeyboard-config"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0e7f21ca7db975c63467d2e7624a12f9"
+
+SRC_URI = "${XORG_MIRROR}/individual/data/xkeyboard-config/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "eb61fb3fd419e817df572b0c8d94a883"
+SRC_URI[sha256sum] = "deaec9989fbc443358b43864437b7b6d39caff07890a4a8055105ce9fcaa59bd"
+
+SECTION = "x11/libs"
+DEPENDS = "intltool-native util-macros libxslt-native"
+
+EXTRA_OECONF = "--with-xkb-rules-symlink=xorg --disable-runtime-deps"
+
+FILES_${PN} += "${datadir}/X11/xkb"
+
+inherit autotools pkgconfig gettext
+
+do_install_append () {
+ install -d ${D}${datadir}/X11/xkb/compiled
+ cd ${D}${datadir}/X11/xkb/rules && ln -sf base xorg
+}
diff --git a/poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
new file mode 100644
index 000000000..6f4e44454
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
@@ -0,0 +1,27 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+DEPENDS = "util-macros"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/lib/${XORG_PN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools distro_features_check pkgconfig
+
+EXTRA_OECONF = "--disable-specs --without-groff --without-ps2pdf --without-fop"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-malloc0returnsnull --disable-malloc0returnsnull \
+ --disable-specs --without-groff --without-ps2pdf --without-fop \
+ --without-xmlto --with-xmlto \
+"
+
+REQUIRED_DISTRO_FEATURES ?= "x11"
+REQUIRED_DISTRO_FEATURES_class-native = ""
diff --git a/poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb b/poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb
new file mode 100644
index 000000000..d5b7f1a2c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XTrans: X Transport library"
+
+DESCRIPTION = "The X Transport Interface is intended to combine all \
+system and transport specific code into a single place. This API should \
+be used by all libraries, clients and servers of the X Window System. \
+Use of this API should allow the addition of new types of transports and \
+support for new platforms without making any changes to the source \
+except in the X Transport Interface code."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=49347921d4d5268021a999f250edc9ca"
+
+PE = "1"
+
+RDEPENDS_${PN}-dev = ""
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "c5ba432dd1514d858053ffe9f4737dd8"
+SRC_URI[sha256sum] = "adbd3b36932ce4c062cd10f57d78a156ba98d618bdb6f50664da327502bc8301"
diff --git a/poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb b/poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb
new file mode 100644
index 000000000..f798a4353
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb
@@ -0,0 +1,16 @@
+require xorg-proto-common.inc
+
+PE = "1"
+
+SUMMARY = "BigReqs: X Big Requests extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+BIG-REQUESTS extension, used to send larger requests that usual in order \
+to avoid fragmentation."
+
+BBCLASSEXTEND = "native nativesdk"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b12715630da6f268d0d3712ee1a504f4"
+
+SRC_URI[md5sum] = "1a05fb01fa1d5198894c931cf925c025"
+SRC_URI[sha256sum] = "462116ab44e41d8121bfde947321950370b285a5316612b8fce8334d50751b1e"
diff --git a/poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch b/poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch
new file mode 100644
index 000000000..ff8cb25cd
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+Add missing length fields to the replies. Without these, sanity checking in recent X
+breaks things.
+
+RP 11/2/10
+
+
+Index: git/xcalibrateproto.h
+===================================================================
+--- git.orig/xcalibrateproto.h 2010-02-11 11:47:45.711985932 +0000
++++ git/xcalibrateproto.h 2010-02-11 11:40:21.000000000 +0000
+@@ -67,13 +67,13 @@
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
++ CARD32 length;
+ CARD32 status;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+- CARD32 pad7 B32;
+ } xXCalibrateRawModeReply;
+
+ #define sz_xXCalibrateRawModeReply 32
+@@ -92,13 +92,13 @@
+ BYTE type; /* X_Reply */
+ BYTE pad1;
+ CARD16 sequenceNumber B16;
++ CARD32 length;
+ CARD32 x;
+ CARD32 y;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+- CARD32 pad6 B32;
+ } xXCalibrateScreenToCoordReply;
+
+ #define sz_xXCalibrateScreenToCoordReply 32
diff --git a/poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb b/poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
new file mode 100644
index 000000000..eb4b4224c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
@@ -0,0 +1,21 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XCalibrate: Touchscreen calibration headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+Touchscreen calibration extension."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xcalibratewire.h;endline=23;md5=7f86ef7b03cce6c4c9ebd59d20ca485f \
+ file://xcalibrateproto.h;endline=23;md5=e4490491edcc171ca24f98569ee580db"
+
+SRCREV = "1da6fd1e2c7a49648245c98481fabea8b9690a8c"
+
+PV = "0.0+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/calibrateproto \
+ file://fix.patch;apply=yes"
+S = "${WORKDIR}/git"
+UPSTREAM_CHECK_COMMITS = "1"
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb b/poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb
new file mode 100644
index 000000000..adfee2630
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb
@@ -0,0 +1,21 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xcomposite: X composite extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+composite extension. The X composite extension provides three related \
+mechanisms for compositing and off-screen storage."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2c4bfe136f4a4418ea2f2a96b7c8f3c5 \
+ file://composite.h;endline=43;md5=cbd44d4079053aa75930ed2f02b92926"
+
+RCONFLICTS_${PN} = "compositeext"
+BBCLASSEXTEND = "native"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "98482f65ba1e74a08bf5b056a4031ef0"
+SRC_URI[sha256sum] = "049359f0be0b2b984a8149c966dd04e8c58e6eade2a4a309cf1126635ccd0cfc"
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb b/poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb
new file mode 100644
index 000000000..75d026810
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb
@@ -0,0 +1,20 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xdamage: X Damage extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the DAMAGE \
+extension. The DAMAGE extension allows applications to receive \
+information about changes made to pixel contents of windows and \
+pixmaps."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d5f5a2de65c3a84cbde769f07a769608 \
+ file://damagewire.h;endline=23;md5=4a4501a592dbc7de5ce89255e50d0296"
+
+RCONFLICTS_${PN} = "damageext"
+BBCLASSEXTEND = "native"
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "998e5904764b82642cc63d97b4ba9e95"
+SRC_URI[sha256sum] = "5c7c112e9b9ea8a9d5b019e5f17d481ae20f766cb7a4648360e7c1b46fc9fc5b"
diff --git a/poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb b/poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb
new file mode 100644
index 000000000..d960e5d4c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "DMX: Distributed Multihead extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the DMX \
+extension. The DMX extension provides support for communication with \
+and control of Xdmx server. Attributes of the Xdmx server and of the \
+back-end screens attached to the server can be queried and modified via \
+this protocol."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a3c3499231a8035efd0e004cfbd3b72a \
+ file://dmxproto.h;endline=32;md5=ab8509955c3dd4c65fac728e1b367bc4"
+
+PE = "1"
+
+SRC_URI[md5sum] = "4ee175bbd44d05c34d43bb129be5098a"
+SRC_URI[sha256sum] = "e72051e6a3e06b236d19eed56368117b745ca1e1a27bdc50fd51aa375bea6509"
diff --git a/poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb b/poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb
new file mode 100644
index 000000000..f4c40c571
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb
@@ -0,0 +1,15 @@
+require xorg-proto-common.inc
+
+SUMMARY = "DRI2: Direct Rendering Infrastructure 2 headers"
+
+DESCRIPTION = "This package provides the wire protocol for the Direct \
+Rendering Ifnrastructure 2. DIR is required for may hardware \
+accelerated OpenGL drivers."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e396fa91834f8786032cad2da5638f3 \
+ file://dri2proto.h;endline=31;md5=22f28bf68d01b533f26195e94b3ed8ca"
+
+
+SRC_URI[md5sum] = "b2721d5d24c04d9980a0c6540cb5396a"
+SRC_URI[sha256sum] = "f9b55476def44fc7c459b2537d17dbc731e36ed5d416af7ca0b1e2e676f8aa04"
diff --git a/poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb b/poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb
new file mode 100644
index 000000000..bed97b3f4
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb
@@ -0,0 +1,14 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Direct Rendering Infrastructure 3 Extension"
+
+DESCRIPTION = "The DRI3 extension provides mechanisms to translate between direct \
+rendered buffers and X pixmaps. When combined with the Present extension, \
+a complete direct rendering solution for OpenGL is provided."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://dri3proto.h;endline=21;md5=ac90d1d416be3cb13e1d3c88cd5166bf"
+
+
+SRC_URI[md5sum] = "a3d2cbe60a9ca1bf3aea6c93c817fee3"
+SRC_URI[sha256sum] = "01be49d70200518b9a6b297131f6cc71f4ea2de17436896af153226a774fc074"
diff --git a/poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb b/poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb
new file mode 100644
index 000000000..39fb88d84
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb
@@ -0,0 +1,22 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFixes: X Fixes extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Fixes \
+extension. This extension is designed to provide server-side support \
+for application work arounds to shortcomings in the core X window \
+system."
+
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=262a7a87da56e66dd639bf7334a110c6 \
+ file://xfixesproto.h;endline=43;md5=c3a9ee6db3532ed0d44dea266cfc97f4"
+
+RCONFLICTS_${PN} = "fixesext"
+PR = "r1"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "e7431ab84d37b2678af71e29355e101d"
+SRC_URI[sha256sum] = "ba2f3f31246bdd3f2a0acf8bd3b09ba99cab965c7fb2c2c92b7dc72870e424ce"
diff --git a/poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb b/poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb
new file mode 100644
index 000000000..27fc28174
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFont: X Font rasterisation headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Font \
+rasterisation extensions. These extensions are used to control \
+server-side font configurations."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c3e48aa9ce868c8e90f0401db41c11a2 \
+ file://FSproto.h;endline=44;md5=d2e58e27095e5ea7d4ad456ccb91986c"
+
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "36934d00b00555eaacde9f091f392f97"
+SRC_URI[sha256sum] = "259046b0dd9130825c4a4c479ba3591d6d0f17a33f54e294b56478729a6e5ab8"
diff --git a/poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb b/poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb
new file mode 100644
index 000000000..eb03d33c2
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "OpenGL: X OpenGL extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+OpenGL-related extensions, used to enable the rendering of applications \
+using OpenGL."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d44ed0146997856304dfbb512a59a8de \
+ file://glxproto.h;beginline=4;endline=32;md5=6b79c570f644363b356456e7d44471d9"
+
+PE = "1"
+
+BBCLASSEXTEND = "nativesdk"
+
+SRC_URI[md5sum] = "5565f1b0facf4a59c2778229c1f70d10"
+SRC_URI[sha256sum] = "adaa94bded310a2bfcbb9deb4d751d965fcfe6fb3a2f6d242e2df2d6589dbe40"
diff --git a/poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.2.bb b/poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.2.bb
new file mode 100644
index 000000000..eb5e66bd6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/inputproto_2.3.2.bb
@@ -0,0 +1,22 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XI: X Input extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Input \
+extension. The extension supports input devices other then the core X \
+keyboard and pointer."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e562cc0f6587b961f032211d8160f31e \
+ file://XI2proto.h;endline=48;md5=1ac1581e61188da2885cc14ff49b20be"
+
+PE = "1"
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "b290a463af7def483e6e190de460f31a"
+SRC_URI[sha256sum] = "893a6af55733262058a27b38eeb1edc733669f01d404e8581b167f03c03ef31d"
+
+EXTRA_OECONF += "--without-asciidoc"
diff --git a/poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb b/poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb
new file mode 100644
index 000000000..46f5c92b6
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XKB: X Keyboard extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Keyboard extension. This extension is used to control options related \
+to keyboard handling and layout."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7dd6ea99e2a83a552c02c80963623c38 \
+ file://XKBproto.h;beginline=1;endline=25;md5=5744eeff407aeb6e7a1346eebab486a2"
+
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "94afc90c1f7bef4a27fdd59ece39c878"
+SRC_URI[sha256sum] = "f882210b76376e3fa006b11dbd890e56ec0942bc56e65d1249ff4af86f90b857"
diff --git a/poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb b/poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
new file mode 100644
index 000000000..e6d32f95a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/presentproto_git.bb
@@ -0,0 +1,22 @@
+require xorg-proto-common.inc
+
+SUMMARY = "This package provides the basic headers for the X Window System"
+DESCRIPTION = "The Present extension provides a way for applications to update their \
+ window contents from a pixmap in a well defined fashion, synchronizing \
+ with the display refresh and potentially using a more efficient \
+ mechanism than copying the contents of the source pixmap.\
+ "
+
+LICENSE = "GPLv2"
+
+SRCREV = "bfdc7e052302c79c5803ad95a73c9b63b350c40c"
+PV = "1.1+git${SRCPV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/presentproto"
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb b/poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb
new file mode 100644
index 000000000..b59e52513
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Resize, \
+Rotate and Reflect extension. This extension provides the ability to \
+resize, rotate and reflect the root window of a screen."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=00426d41bd3d9267cf9bbb2df9323a5e \
+ file://randrproto.h;endline=30;md5=3885957c6048fdf3310ac8ba54ca2c3f"
+
+RCONFLICTS_${PN} = "randrext"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "a46765c8dcacb7114c821baf0df1e797"
+SRC_URI[sha256sum] = "4c675533e79cd730997d232c8894b6692174dce58d3e207021b8f860be498468"
diff --git a/poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb b/poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb
new file mode 100644
index 000000000..ad2317c26
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRecord: X Record extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Record \
+extension. This extension is used to record and play back event \
+sequences."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=575827a0f554bbed332542976d5f3d40 \
+ file://recordproto.h;endline=19;md5=1cbb0dd45a0b060ff833901620a3e738"
+
+RCONFLICTS_${PN} = "recordext"
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "1b4e5dede5ea51906f1530ca1e21d216"
+SRC_URI[sha256sum] = "a777548d2e92aa259f1528de3c4a36d15e07a4650d0976573a8e2ff5437e7370"
diff --git a/poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb b/poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb
new file mode 100644
index 000000000..ff800ec83
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb
@@ -0,0 +1,21 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRender: X rendering Extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Rendering extension. This is the basis the image composition within the \
+X window system."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f826d99765196352e6122a406cf0d024 \
+ file://renderproto.h;beginline=4;endline=24;md5=3e5e2851dad240b0a3a27c4776b4fd1f"
+
+RCONFLICTS_${PN} = "renderext"
+PR = "r1"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "a914ccc1de66ddeb4b611c6b0686e274"
+SRC_URI[sha256sum] = "06735a5b92b20759204e4751ecd6064a2ad8a6246bb65b3078b862a00def2537"
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb b/poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb
new file mode 100644
index 000000000..08b610aea
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRes: X Resource extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Resource extension. XRes provides an interface that allows X clients to \
+see and monitor X resource usage of various clients."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=604859305e662503077240fee8c77d97"
+
+RCONFLICTS_${PN} = "resourceext"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "cfdb57dae221b71b2703f8e2980eaaf4"
+SRC_URI[sha256sum] = "3c66003a6bdeb0f70932a9ed3cf57cc554234154378d301e0c5cfa189d8f6818"
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb b/poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb
new file mode 100644
index 000000000..ab07f518c
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xscrnsaver: X Screen Saver extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Screen \
+Saver extension. This extension allows an external \"screen saver\" \
+client to detect when the alternative image is to be displayed and to \
+provide the graphics."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eed49b78b15b436c933b6b8b054e3901 \
+ file://saverproto.h;endline=26;md5=a84c0637305159f3c0ab173aaeede48d"
+
+PE = "1"
+
+EXTRA_OECONF_append = " --enable-specs=no"
+
+SRC_URI[md5sum] = "edd8a73775e8ece1d69515dd17767bfb"
+SRC_URI[sha256sum] = "8bb70a8da164930cceaeb4c74180291660533ad3cc45377b30a795d1b85bcd65"
diff --git a/poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.3.bb b/poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.3.bb
new file mode 100644
index 000000000..6f97a2653
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/videoproto_2.3.3.bb
@@ -0,0 +1,14 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xv: X Video extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Video \
+extension. This extension alows for accerlated drawing of videos."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ce3472a119a864085fa4155cb0979a7b"
+
+PE = "1"
+
+SRC_URI[md5sum] = "fe86de8ea3eb53b5a8f52956c5cd3174"
+SRC_URI[sha256sum] = "c7803889fd08e6fcaf7b68cc394fb038b2325d1f315e571a6954577e07cca702"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch b/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch
new file mode 100644
index 000000000..89ec66618
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch
@@ -0,0 +1,215 @@
+From ea7a3ac6c658164690e0febb55f4467cb9e0bcac Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <wiz@NetBSD.org>
+Date: Thu, 19 May 2016 17:30:04 +0200
+Subject: [PATCH 1/2] Make whitespace use consistent.
+
+At least python-3.5.x complains about this forcefully.
+
+Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+Signed-off-by: Uli Schlachter <psychon@znc.in>
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ xcbgen/align.py | 96 ++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 48 insertions(+), 48 deletions(-)
+
+diff --git a/xcbgen/align.py b/xcbgen/align.py
+index 5e31838..d4c12ee 100644
+--- a/xcbgen/align.py
++++ b/xcbgen/align.py
+@@ -16,12 +16,12 @@ class Alignment(object):
+ return self.align == other.align and self.offset == other.offset
+
+ def __str__(self):
+- return "(align=%d, offset=%d)" % (self.align, self.offset)
++ return "(align=%d, offset=%d)" % (self.align, self.offset)
+
+ @staticmethod
+ def for_primitive_type(size):
+- # compute the required start_alignment based on the size of the type
+- if size % 8 == 0:
++ # compute the required start_alignment based on the size of the type
++ if size % 8 == 0:
+ # do 8-byte primitives require 8-byte alignment in X11?
+ return Alignment(8,0)
+ elif size % 4 == 0:
+@@ -33,7 +33,7 @@ class Alignment(object):
+
+
+ def align_after_fixed_size(self, size):
+- new_offset = (self.offset + size) % self.align
++ new_offset = (self.offset + size) % self.align
+ return Alignment(self.align, new_offset)
+
+
+@@ -41,7 +41,7 @@ class Alignment(object):
+ '''
+ Assuming the given external_align, checks whether
+ self is fulfilled for all cases.
+- Returns True if yes, False otherwise.
++ Returns True if yes, False otherwise.
+ '''
+ if self.align == 1 and self.offset == 0:
+ # alignment 1 with offset 0 is always fulfilled
+@@ -55,9 +55,9 @@ class Alignment(object):
+ # the external align guarantees less alignment -> not guaranteed
+ return False
+
+- if external_align.align % self.align != 0:
++ if external_align.align % self.align != 0:
+ # the external align cannot be divided by our align
+- # -> not guaranteed
++ # -> not guaranteed
+ # (this can only happen if there are alignments that are not
+ # a power of 2, which is highly discouraged. But better be
+ # safe and check for it)
+@@ -72,7 +72,7 @@ class Alignment(object):
+
+ def combine_with(self, other):
+ # returns the alignment that is guaranteed when
+- # both, self or other, can happen
++ # both, self or other, can happen
+ new_align = gcd(self.align, other.align)
+ new_offset_candidate1 = self.offset % new_align
+ new_offset_candidate2 = other.offset % new_align
+@@ -83,8 +83,8 @@ class Alignment(object):
+ new_align = gcd(new_align, offset_diff)
+ new_offset_candidate1 = self.offset % new_align
+ new_offset_candidate2 = other.offset % new_align
+- assert new_offset_candidate1 == new_offset_candidate2
+- new_offset = new_offset_candidate1
++ assert new_offset_candidate1 == new_offset_candidate2
++ new_offset = new_offset_candidate1
+ # return the result
+ return Alignment(new_align, new_offset)
+
+@@ -92,44 +92,44 @@ class Alignment(object):
+ class AlignmentLog(object):
+
+ def __init__(self):
+- self.ok_list = []
+- self.fail_list = []
+- self.verbosity = 1
++ self.ok_list = []
++ self.fail_list = []
++ self.verbosity = 1
+
+ def __str__(self):
+- result = ""
++ result = ""
+
+- # output the OK-list
+- for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list:
+- stacksize = len(callstack)
++ # output the OK-list
++ for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list:
++ stacksize = len(callstack)
+ indent = ' ' * stacksize
+- if self.ok_callstack_is_relevant(callstack):
++ if self.ok_callstack_is_relevant(callstack):
+ if field_name is None or field_name == "":
+- result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n"
+- % (indent, str(type_obj), indent, str(align_before), str(align_after)))
+- else:
+- result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n"
+- % (indent, str(field_name), str(type_obj),
+- indent, str(align_before), str(align_after)))
++ result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n"
++ % (indent, str(type_obj), indent, str(align_before), str(align_after)))
++ else:
++ result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n"
++ % (indent, str(field_name), str(type_obj),
++ indent, str(align_before), str(align_after)))
+ if self.verbosity >= 1:
+- result += self.callstack_to_str(indent, callstack)
++ result += self.callstack_to_str(indent, callstack)
+
+- # output the fail-list
+- for (align_before, field_name, type_obj, callstack, reason) in self.fail_list:
+- stacksize = len(callstack)
++ # output the fail-list
++ for (align_before, field_name, type_obj, callstack, reason) in self.fail_list:
++ stacksize = len(callstack)
+ indent = ' ' * stacksize
+- if field_name is None or field_name == "":
+- result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n"
+- % (indent, str(align_before), indent, str(type_obj), indent, reason))
+- else:
+- result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n"
+- % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason))
++ if field_name is None or field_name == "":
++ result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n"
++ % (indent, str(align_before), indent, str(type_obj), indent, reason))
++ else:
++ result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n"
++ % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason))
+
+ if self.verbosity >= 1:
+- result += self.callstack_to_str(indent, callstack)
++ result += self.callstack_to_str(indent, callstack)
+
+
+- return result
++ return result
+
+
+ def callstack_to_str(self, indent, callstack):
+@@ -137,41 +137,41 @@ class AlignmentLog(object):
+ for stack_elem in callstack:
+ result += "\t %s%s\n" % (indent, str(stack_elem))
+ result += "\t%s]\n" % indent
+- return result
++ return result
+
+
+ def ok_callstack_is_relevant(self, ok_callstack):
+ # determine whether an ok callstack is relevant for logging
+- if self.verbosity >= 2:
+- return True
++ if self.verbosity >= 2:
++ return True
+
+ # empty callstacks are always relevant
+- if len(ok_callstack) == 0:
++ if len(ok_callstack) == 0:
+ return True
+
+- # check whether the ok_callstack is a subset or equal to a fail_callstack
++ # check whether the ok_callstack is a subset or equal to a fail_callstack
+ for (align_before, field_name, type_obj, fail_callstack, reason) in self.fail_list:
+ if len(ok_callstack) <= len(fail_callstack):
+ zipped = zip(ok_callstack, fail_callstack[:len(ok_callstack)])
+- is_subset = all([i == j for i, j in zipped])
+- if is_subset:
++ is_subset = all([i == j for i, j in zipped])
++ if is_subset:
+ return True
+
+ return False
+
+
+ def ok(self, align_before, field_name, type_obj, callstack, align_after):
+- self.ok_list.append((align_before, field_name, type_obj, callstack, align_after))
++ self.ok_list.append((align_before, field_name, type_obj, callstack, align_after))
+
+ def fail(self, align_before, field_name, type_obj, callstack, reason):
+- self.fail_list.append((align_before, field_name, type_obj, callstack, reason))
++ self.fail_list.append((align_before, field_name, type_obj, callstack, reason))
+
+ def append(self, other):
+- self.ok_list.extend(other.ok_list)
+- self.fail_list.extend(other.fail_list)
++ self.ok_list.extend(other.ok_list)
++ self.fail_list.extend(other.fail_list)
+
+ def ok_count(self):
+- return len(self.ok_list)
++ return len(self.ok_list)
+
+
+
+--
+2.9.0
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch b/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch
new file mode 100644
index 000000000..542acb82b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch
@@ -0,0 +1,75 @@
+From bea5e1c85bdc0950913790364e18228f20395a3d Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <wiz@NetBSD.org>
+Date: Thu, 19 May 2016 17:30:05 +0200
+Subject: [PATCH 2/2] print() is a function and needs parentheses.
+
+Fixes build with python-3.x.
+
+Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+Signed-off-by: Uli Schlachter <psychon@znc.in>
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ xcbgen/xtypes.py | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
+index c3b5758..b83b119 100644
+--- a/xcbgen/xtypes.py
++++ b/xcbgen/xtypes.py
+@@ -501,7 +501,7 @@ class ComplexType(Type):
+ int(required_start_align_element.get('align', "4"), 0),
+ int(required_start_align_element.get('offset', "0"), 0))
+ if verbose_align_log:
+- print "Explicit start-align for %s: %s\n" % (self, self.required_start_align)
++ print ("Explicit start-align for %s: %s\n" % (self, self.required_start_align))
+
+ def resolve(self, module):
+ if self.resolved:
+@@ -592,7 +592,7 @@ class ComplexType(Type):
+ if verbose_align_log:
+ print ("calc_required_start_align: %s has start-align %s"
+ % (str(self), str(self.required_start_align)))
+- print "Details:\n" + str(log)
++ print ("Details:\n" + str(log))
+ if self.required_start_align.offset != 0:
+ print (("WARNING: %s\n\thas start-align with non-zero offset: %s"
+ + "\n\tsuggest to add explicit definition with:"
+@@ -619,12 +619,12 @@ class ComplexType(Type):
+ for offset in range(0,align):
+ align_candidate = Alignment(align, offset)
+ if verbose_align_log:
+- print "trying %s for %s" % (str(align_candidate), str(self))
++ print ("trying %s for %s" % (str(align_candidate), str(self)))
+ my_log = AlignmentLog()
+ if self.is_possible_start_align(align_candidate, callstack, my_log):
+ log.append(my_log)
+ if verbose_align_log:
+- print "found start-align %s for %s" % (str(align_candidate), str(self))
++ print ("found start-align %s for %s" % (str(align_candidate), str(self)))
+ return align_candidate
+ else:
+ my_ok_count = my_log.ok_count()
+@@ -641,7 +641,7 @@ class ComplexType(Type):
+ # none of the candidates applies
+ # this type has illegal internal aligns for all possible start_aligns
+ if verbose_align_log:
+- print "didn't find start-align for %s" % str(self)
++ print ("didn't find start-align for %s" % str(self))
+ log.append(best_log)
+ return None
+
+@@ -900,7 +900,7 @@ class SwitchType(ComplexType):
+ # aux function for unchecked_get_alignment_after
+ def get_align_for_selected_case_field(self, case_field, start_align, callstack, log):
+ if verbose_align_log:
+- print "get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field))
++ print ("get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field)))
+ total_align = start_align
+ for field in self.bitcases:
+ my_callstack = callstack[:]
+--
+2.9.0
+
diff --git a/poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
new file mode 100644
index 000000000..25a8373e0
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb
@@ -0,0 +1,53 @@
+SUMMARY = "XCB: The X protocol C binding headers"
+DESCRIPTION = "Function prototypes for the X protocol C-language Binding \
+(XCB). XCB is a replacement for Xlib featuring a small footprint, \
+latency hiding, direct access to the protocol, improved threading \
+support, and extensibility."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+
+SECTION = "x11/libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \
+ file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.bz2 \
+ file://0001-Make-whitespace-use-consistent.patch \
+ file://0002-print-is-a-function-and-needs-parentheses.patch \
+ "
+SRC_URI[md5sum] = "14e60919f859560f28426a685a555962"
+SRC_URI[sha256sum] = "5922aba4c664ab7899a29d92ea91a87aa4c1fc7eb5ee550325c3216c480a4906"
+
+inherit autotools pkgconfig
+
+# Force the use of Python 3 and a specific library path so we don't need to
+# depend on python3-native
+CACHED_CONFIGUREVARS += "PYTHON=python3 am_cv_python_pythondir=${libdir}/xcb-proto"
+
+PACKAGES += "python-xcbgen"
+
+FILES_${PN} = ""
+FILES_${PN}-dev += "${datadir}/xcb/*.xml ${datadir}/xcb/*.xsd"
+FILES_python-xcbgen = "${libdir}/xcb-proto"
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Need to do this dance because we're forcing the use of host Python above and
+# if xcb-proto is built with Py3.5 and then re-used from sstate on a host with
+# Py3.6 the second build will write new cache files into the sysroot which won't
+# be listed in the manifest so won't be deleted, resulting in an error on
+# rebuilds. Solve this by deleting the entire cache directory when this package
+# is removed from the sysroot.
+SSTATEPOSTINSTFUNCS += "xcb_sstate_postinst"
+xcb_sstate_postinst() {
+ if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+ then
+ cat <<EOF >${SSTATE_INST_POSTRM}
+#!/bin/sh
+rm -rf ${libdir}/xcb-proto/xcbgen/__pycache__
+EOF
+ fi
+}
diff --git a/poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb b/poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb
new file mode 100644
index 000000000..0751b94c9
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XC-MISC: X XC-Miscellaneous extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XC-MISC \
+extension, which is used to get details of XID allocations within the \
+server."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=09d83047c15994e05db29b423ed6662e"
+
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "5f4847c78e41b801982c8a5e06365b24"
+SRC_URI[sha256sum] = "b13236869372256c36db79ae39d54214172677fb79e9cdc555dceec80bd9d2df"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb b/poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb
new file mode 100644
index 000000000..dd0bd951b
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb
@@ -0,0 +1,24 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XExt: X Extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for several X \
+extensions. These protocol extensions include DOUBLE-BUFFER, DPMS, \
+Extended-Visual-Information, LBX, MIT_SHM, MIT_SUNDRY-NONSTANDARD, \
+Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, XC-APPGROUP, XC-MISC, \
+XTEST. In addition a small set of utility functions are also \
+available."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=86f273291759d0ba2a22585cd1c06c53"
+
+PE = "1"
+
+inherit gettext
+
+EXTRA_OECONF_append = " --enable-specs=no"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "70c90f313b4b0851758ef77b95019584"
+SRC_URI[sha256sum] = "f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb b/poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb
new file mode 100644
index 000000000..86f3ce328
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-DGA: XFree86 Direct Graphics Access extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+Direct Graphics Access extension. This extension allows direct graphics \
+access to a framebuffer-like region, as well as relative mouse \
+reporting."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e01e66e4b317088cf869bc98e6af4fb6"
+
+RCONFLICTS_${PN} = "xxf86dgaext"
+PR = "r2"
+PE = "1"
+
+SRC_URI[md5sum] = "a036dc2fcbf052ec10621fd48b68dbb1"
+SRC_URI[sha256sum] = "ac5ef65108e1f2146286e53080975683dae49fc94680042e04bd1e2010e99050"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb b/poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb
new file mode 100644
index 000000000..b3f9210cc
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-DRI: XFree86 Direct Rendering Infrastructure extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+Direct Rendering Infrastructure extension. The XFree86-DRI extension is \
+used to organize direct rendering support or 3D clients and help \
+arbitrate requests."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ef103b9d951e39ff7e23d386e2011fa3 \
+ file://xf86driproto.h;endline=35;md5=42be3d8e6d429ab79172572bb0cff544"
+
+PE = "1"
+
+SRC_URI[md5sum] = "1d716d0dac3b664e5ee20c69d34bc10e"
+SRC_URI[sha256sum] = "9c4b8d7221cb6dc4309269ccc008a22753698ae9245a398a59df35f1404d661f"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb b/poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb
new file mode 100644
index 000000000..d4663ea88
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-Misc: XFree86 miscellaneous extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree \
+miscellaneous extension. The XFree86-Misc extension provides a means to \
+access input device configuration settings specific to the XFree86/Xorg \
+DDX."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e01e66e4b317088cf869bc98e6af4fb6"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "ca63bbb31cf5b7f37b2237e923ff257a"
+SRC_URI[sha256sum] = "45b8ec6a4a8ca21066dce117e09dcc88539862e616e60fb391de05b36f63b095"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb b/poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb
new file mode 100644
index 000000000..0f31900a9
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-VM: XFree86 video mode extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+video mode extension. This extension allows client applications to get \
+and set video mode timings."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=499be2ff387a42f84628c35f311f1502"
+
+RCONFLICTS_${PN} = "xxf86vmext"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "e793ecefeaecfeabd1aed6a01095174e"
+SRC_URI[sha256sum] = "45d9499aa7b73203fd6b3505b0259624afed5c16b941bd04fcf123e5de698770"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb b/poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
new file mode 100644
index 000000000..dde7e9db7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xinerama: Xinerama extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the Xinerama \
+extension. This extension is used for retrieving information about \
+physical output devices which may be combined into a single logical X \
+screen."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3e397a5326c83d5d0ebf5b3f87163ac6 \
+ file://panoramiXproto.h;endline=24;md5=098e0bc089368a988092b3cbda617a57"
+
+PE = "1"
+
+SRC_URI[md5sum] = "9959fe0bfb22a0e7260433b8d199590a"
+SRC_URI[sha256sum] = "977574bb3dc192ecd9c55f59f991ec1dff340be3e31392c95deff423da52485b"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc b/poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
new file mode 100644
index 000000000..7a417c974
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
@@ -0,0 +1,26 @@
+SUMMARY = "X protocol headers: ${XORG_PN}"
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/proto/${XORG_PN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+DEPENDS = "util-macros"
+
+inherit autotools pkgconfig
+EXTRA_OECONF = "--without-fop"
+
+UNKNOWN_CONFIGURE_WHITELIST += "--without-fop --without-xmlto --with-xmlto"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch b/poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
new file mode 100644
index 000000000..4f9ed99c9
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Don't always define LONG64 for AMD64
+
+X32 defines __amd64__/amd64 with 32bit long. We should simply check
+__LP64__ before defining LONG64 without checking __amd64__/amd64.
+
+This fixes compilation with x32 toolchain.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/1
+
+Index: xproto-7.0.31/Xmd.h
+===================================================================
+--- xproto-7.0.31.orig/Xmd.h
++++ xproto-7.0.31/Xmd.h
+@@ -62,7 +62,6 @@ SOFTWARE.
+ defined(__ia64__) || defined(ia64) || \
+ defined(__sparc64__) || \
+ defined(__s390x__) || \
+- defined(__amd64__) || defined(amd64) || \
+ defined(__powerpc64__)
+ # if !defined(__ILP32__) /* amd64-x32 is 32bit */
+ # define LONG64 /* 32/64-bit architecture */
diff --git a/poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb b/poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb
new file mode 100644
index 000000000..febcc6792
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-proto/xproto_7.0.31.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xlib: C Language X interface headers"
+
+DESCRIPTION = "This package provides the basic headers for the X Window \
+System."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b9e051107d5628966739a0b2e9b32676"
+
+PE = "1"
+
+SRC_URI += "file://xproto_fix_for_x32.patch"
+
+EXTRA_OECONF_append = " --enable-specs=no"
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "16791f7ca8c51a20608af11702e51083"
+SRC_URI[sha256sum] = "c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747"
diff --git a/poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb b/poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb
new file mode 100644
index 000000000..be3a66744
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Program to create dependencies in makefiles"
+
+DESCRIPTION = "The gccmakedep program calls 'gcc -M' to output makefile \
+rules describing the dependencies of each sourcefile, so that make knows \
+which object files must be recompiled when a dependency has changed."
+
+require xorg-util-common.inc
+LIC_FILES_CHKSUM = "file://Makefile.am;endline=20;md5=23c277396d690413245ebb89b18c5d4d"
+DESCRIPTION = "create dependencies in makefiles using 'gcc -M'"
+DEPENDS = "util-macros"
+RDEPENDS_${PN} = "gcc"
+
+PR = "r3"
+PE = "1"
+
+SRC_URI[md5sum] = "127ddb6131eb4a56fdf6644a63ade788"
+SRC_URI[sha256sum] = "f9e2e7a590e27f84b6708ab7a81e546399b949bf652fb9b95193e0e543e6a548"
+
+do_install_append() {
+ sed -i "s,--sysroot=${STAGING_DIR_TARGET},," ${D}${bindir}/gccmakedep
+}
diff --git a/poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb b/poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb
new file mode 100644
index 000000000..84a967a81
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb
@@ -0,0 +1,21 @@
+require xorg-util-common.inc
+
+SUMMARY = "create dependencies in makefiles"
+
+DESCRIPTION = "The makedepend program reads each sourcefile in sequence \
+and parses it like a C-preprocessor, processing \
+all #include, #define, #undef, #ifdef, #ifndef, #endif, #if, #elif \
+and #else directives so that it can correctly tell which #include, \
+directives would be used in a compilation. Any #include, directives \
+can reference files having other #include directives, and parsing will \
+occur in these files as well."
+
+DEPENDS = "xproto util-macros"
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=43a6eda34b48ee821b3b66f4f753ce4f"
+
+SRC_URI[md5sum] = "efb2d7c7e22840947863efaedc175747"
+SRC_URI[sha256sum] = "503903d41fb5badb73cb70d7b3740c8b30fe1cc68c504d3b6a85e6644c4e5004"
diff --git a/poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb b/poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb
new file mode 100644
index 000000000..b39d78756
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-util/util-macros_1.19.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "X autotools macros"
+
+DESCRIPTION = "M4 autotools macros used by various X.org programs."
+
+require xorg-util-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1970511fddd439b07a6ba789d28ff662"
+
+PE = "1"
+
+SRC_URI[md5sum] = "3f8a8e6100556f7f28e469809805dee8"
+SRC_URI[sha256sum] = "472ad0e41d1e0abf5ecafd29460bf1b8d47e53d4b7d3abf1f66d02dc576547b8"
+
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc b/poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc
new file mode 100644
index 000000000..18d022c49
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-util/xorg-util-common.inc
@@ -0,0 +1,13 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/utils"
+LICENSE = "MIT-X"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/util/${XORG_PN}-${PV}.tar.gz"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
new file mode 100644
index 000000000..f4cd139e8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
@@ -0,0 +1,38 @@
+
+Section "Files"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "fbdev"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
new file mode 100644
index 000000000..1d3c64f62
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
@@ -0,0 +1,39 @@
+
+Section "Files"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "fbdev"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ DefaultDepth 16
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
new file mode 100644
index 000000000..f4cd139e8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
@@ -0,0 +1,38 @@
+
+Section "Files"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "fbdev"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
new file mode 100644
index 000000000..f4cd139e8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
@@ -0,0 +1,38 @@
+
+Section "Files"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "fbdev"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
new file mode 100644
index 000000000..f4cd139e8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
@@ -0,0 +1,38 @@
+
+Section "Files"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "fbdev"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
new file mode 100644
index 000000000..c12d92c20
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
@@ -0,0 +1,33 @@
+
+Section "Files"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
new file mode 100644
index 000000000..c12d92c20
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
@@ -0,0 +1,33 @@
+
+Section "Files"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
new file mode 100644
index 000000000..5420b7d23
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "X.Org X server configuration file"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PR = "r33"
+
+SRC_URI = "file://xorg.conf"
+
+S = "${WORKDIR}"
+
+CONFFILES_${PN} = "${sysconfdir}/X11/xorg.conf"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+ALLOW_EMPTY_${PN} = "1"
+
+do_install () {
+ if test -s ${WORKDIR}/xorg.conf; then
+ install -d ${D}/${sysconfdir}/X11
+ install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
+ fi
+}
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
new file mode 100644
index 000000000..cf2286c65
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -0,0 +1,180 @@
+SUMMARY = "The X.Org X server"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
+
+# xf86-*-* packages depend on an X server built with the xfree86 DDX
+# so we have a virtual to represent that:
+# deprecated, we should use virtual/xserver instead
+PROVIDES = "virtual/xserver-xf86"
+
+# Other packages tend to just care that there is *an* X server:
+PROVIDES += "virtual/xserver"
+
+PE = "2"
+INC_PR = "r8"
+
+XORG_PN = "xorg-server"
+SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.bz2"
+SRC_URI += "file://macro_tweak.patch"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PROTO_DEPS = "randrproto renderproto fixesproto damageproto xextproto xproto xf86dgaproto xf86miscproto xf86vidmodeproto compositeproto recordproto resourceproto videoproto scrnsaverproto xineramaproto fontsproto kbproto inputproto bigreqsproto xcmiscproto presentproto"
+LIB_DEPS = "pixman libxfont2 xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess"
+DEPENDS = "${PROTO_DEPS} ${LIB_DEPS} font-util"
+
+# Split out some modules and extensions from the main package
+# These aren't needed for basic operations and only take up space:
+# 32.0k libdri.so
+# 91.0k libexa.so
+# 336.0k libglx.so
+# 1360k libint10.so
+# 180.0k libwfb.so
+# 320.0k libxaa.so
+# 124.0k libxf1bpp.so
+# 84.0k libxf4bpp.so
+# librecord.so
+# libextmod.so
+# libdbe.so
+
+PACKAGES =+ "${PN}-sdl \
+ ${PN}-fbdev \
+ ${PN}-xvfb \
+ ${PN}-utils \
+ ${PN}-xephyr \
+ ${PN}-xwayland \
+ ${PN}-multimedia-modules \
+ ${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-glx \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ ${PN}-module-libint10 \
+ ${PN}-module-libafb \
+ ${PN}-module-libwfb \
+ ${PN}-module-libmfb \
+ ${PN}-module-libcfb \
+ ${PN}-module-exa \
+ ${PN}-module-xaa \
+ ${PN}-module-libxf1bpp \
+ ${PN}-module-libxf4bpp \
+ xf86-video-modesetting"
+
+SUMMARY_xf86-video-modesetting = "X.Org X server -- modesetting display driver"
+INSANE_SKIP_${MLPREFIX}xf86-video-modesetting = "xorg-driver-abi"
+
+XSERVER_RRECOMMENDS = "xkeyboard-config rgb xserver-xf86-config xkbcomp xf86-input-libinput"
+RRECOMMENDS_${PN} += "${XSERVER_RRECOMMENDS}"
+RRECOMMENDS_${PN}-xwayland += "${XSERVER_RRECOMMENDS}"
+RDEPENDS_${PN}-xvfb += "xkeyboard-config"
+RDEPENDS_${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
+
+FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d"
+FILES_${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la"
+FILES_${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled"
+FILES_${PN}-sdl = "${bindir}/Xsdl"
+FILES_${PN}-fbdev = "${bindir}/Xfbdev"
+FILES_${PN}-xvfb = "${bindir}/Xvfb"
+FILES_${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
+FILES_${PN}-xephyr = "${bindir}/Xephyr"
+FILES_${PN}-xwayland = "${bindir}/Xwayland"
+FILES_${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
+FILES_${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
+FILES_${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
+FILES_${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
+FILES_${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so"
+FILES_${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so"
+FILES_${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so"
+FILES_${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
+FILES_${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
+FILES_${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
+FILES_${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
+FILES_${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
+FILES_${PN}-module-exa = "${libdir}/xorg/modules/libexa.so"
+FILES_${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
+FILES_${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
+FILES_${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
+FILES_xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so"
+
+EXTRA_OECONF += "--with-fop=no \
+ --with-pic \
+ --disable-static \
+ --disable-record \
+ --disable-dmx \
+ --disable-xnest \
+ --enable-xvfb \
+ --enable-composite \
+ --without-dtrace \
+ --with-int10=x86emu \
+ --sysconfdir=/etc/X11 \
+ --localstatedir=/var \
+ --with-xkb-output=/var/lib/xkb \
+"
+
+OPENGL_PKGCONFIGS = "dri glx glamor dri3 xshmfence"
+PACKAGECONFIG ??= "dri2 udev ${XORG_CRYPTO} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl wayland', 'xwayland', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+"
+
+PACKAGECONFIG[udev] = "--enable-config-udev,--disable-config-udev,udev"
+PACKAGECONFIG[dri] = "--enable-dri,--disable-dri,glproto virtual/mesa xf86driproto"
+PACKAGECONFIG[dri2] = "--enable-dri2,--disable-dri2,dri2proto"
+# DRI3 requires xshmfence to also be enabled
+PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,glproto virtual/libgl virtual/libx11"
+PACKAGECONFIG[glamor] = "--enable-glamor,--disable-glamor,libepoxy virtual/libgbm,libegl"
+PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+PACKAGECONFIG[xshmfence] = "--enable-xshmfence,--disable-xshmfence,libxshmfence"
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[systemd-logind] = "--enable-systemd-logind=yes,--enable-systemd-logind=no,dbus,"
+PACKAGECONFIG[systemd] = "--with-systemd-daemon,--without-systemd-daemon,systemd"
+PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,xineramaproto"
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,wayland wayland-native wayland-protocols libepoxy"
+
+# Xorg requires a SHA1 implementation, pick one
+XORG_CRYPTO ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-sha1=libcrypto,,openssl"
+PACKAGECONFIG[nettle] = "--with-sha1=libnettle,,nettle"
+PACKAGECONFIG[gcrypt] = "--with-sha1=libgcrypt,,libgcrypt"
+
+do_install_append () {
+ # Its assumed base-files creates this for us
+ rmdir ${D}${localstatedir}/log/
+}
+
+# Add runtime provides for the ABI versions of the video and input subsystems,
+# so that drivers can depend on the relevant version.
+python populate_packages_prepend() {
+ import subprocess
+
+ # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
+ # into the new package, not the staged ones.
+ newenv = dict(os.environ)
+ newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
+
+ def get_abi(name):
+ abis = {
+ "video": "abi_videodrv",
+ "input": "abi_xinput"
+ }
+ p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
+ shell=True, env=newenv, stdout=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ output = stdout.decode("utf-8").split(".")[0]
+ mlprefix = d.getVar('MLPREFIX') or ''
+ return "%sxorg-abi-%s-%s" % (mlprefix, name, output)
+
+ pn = d.getVar("PN")
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
+ d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
+}
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
new file mode 100644
index 000000000..16ec3edb3
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch
@@ -0,0 +1,61 @@
+Discover monotonic clock using compile-time check
+
+monotonic clock check does not work when cross-compiling.
+
+Upstream-Status: Denied [Does not work on OpenBSD]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+Original patch follows:
+
+When xorg-xserver is being cross-compiled, there is currently no way
+for us to detect whether the monotonic clock is available on the
+target system, because we aren't able to run a test program on the host
+system. Currently, in this situation, we default to not use the
+monotonic clock. One problem with this situation is that the user will
+be treated as idle when the date is updated.
+
+To fix this situation, we now use a compile-time check to detect whether the
+monotonic clock is available. This check can run just fine when we are
+cross-compiling.
+
+Signed-off-by: David James <davidjames at google.com>
+---
+ configure.ac | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index f7ab48c..26e85cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1048,19 +1048,16 @@ if ! test "x$have_clock_gettime" = xno; then
+ CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
+ fi
+
+- AC_RUN_IFELSE([AC_LANG_SOURCE([
++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #include <time.h>
+-
+-int main(int argc, char *argv[[]]) {
+- struct timespec tp;
+-
+- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
++#include <unistd.h>
++int main() {
++#if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
++ #error No monotonic clock
++#endif
+ return 0;
+- else
+- return 1;
+ }
+- ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+- [MONOTONIC_CLOCK="cross compiling"])
++]])],[MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no])
+
+ LIBS="$LIBS_SAVE"
+ CPPFLAGS="$CPPFLAGS_SAVE"
+--
+2.1.4
+
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
new file mode 100644
index 000000000..d05eec5bb
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch
@@ -0,0 +1,53 @@
+From d77cdc5e1eee26821ab98c947abea53fb7b18fe5 Mon Sep 17 00:00:00 2001
+From: California Sullivan <california.l.sullivan@intel.com>
+Date: Fri, 16 Mar 2018 17:23:11 -0700
+Subject: [PATCH] xf86pciBus.c: use Intel ddx only for pre-gen4 hardware
+
+Use intel ddx only on pre-gen4 hw, newer ones will fall back to modesetting
+Author: Timo Aaltonen <tjaalton@debian.org>
+
+Instead of defaulting to the Intel driver for all Intel hardware, only
+default it for older hardware for which it has shown to be better for.
+
+Others fall through to the -modesetting default.
+
+Upstream-Status: Pending [Debian/Fedora patch
+https://src.fedoraproject.org/rpms/xorg-x11-server/c/ee515e44b07e37689abf48cf2fffb41578f3bc1d]
+
+Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
+---
+ hw/xfree86/common/xf86pciBus.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
+index e61ae0cd4..d70c99197 100644
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -1173,7 +1173,23 @@ xf86VideoPtrToDriverList(struct pci_device *dev,
+ case 0x0bef:
+ /* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */
+ break;
+- default:
++ /* Default to intel only on pre-gen4 chips */
++ case 0x3577:
++ case 0x2562:
++ case 0x3582:
++ case 0x358e:
++ case 0x2572:
++ case 0x2582:
++ case 0x258a:
++ case 0x2592:
++ case 0x2772:
++ case 0x27a2:
++ case 0x27ae:
++ case 0x29b2:
++ case 0x29c2:
++ case 0x29d2:
++ case 0xa001:
++ case 0xa011:
+ driverList[0] = "intel";
+ break;
+ }
+--
+2.14.3
+
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
new file mode 100644
index 000000000..beed6cb4a
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch
@@ -0,0 +1,47 @@
+From cf407b16cd65ad6e26a9c8e5984e163409a5c0f7 Mon Sep 17 00:00:00 2001
+From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+Date: Mon, 30 Jan 2017 16:32:06 -0600
+Subject: [PATCH] Remove check for useSIGIO option
+
+Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removes the configure of useSIGIO
+option.
+
+As the xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO
+and OsReleaseSIGIO.
+
+No longer the check for useSIGIO is needed
+
+Upstream-Status: Pending
+
+Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com>
+---
+ hw/xfree86/os-support/shared/sigio.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
+index 884a71c..be76498 100644
+--- a/hw/xfree86/os-support/shared/sigio.c
++++ b/hw/xfree86/os-support/shared/sigio.c
+@@ -185,9 +185,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
+ int i;
+ int installed = FALSE;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ for (i = 0; i < MAX_FUNCS; i++) {
+ if (!xf86SigIOFuncs[i].f) {
+ if (xf86IsPipe(fd))
+@@ -256,9 +253,6 @@ xf86RemoveSIGIOHandler(int fd)
+ int max;
+ int ret;
+
+- if (!xf86Info.useSIGIO)
+- return 0;
+-
+ max = 0;
+ ret = 0;
+ for (i = 0; i < MAX_FUNCS; i++) {
+--
+2.7.4
+
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
new file mode 100644
index 000000000..5243761f1
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/0003-modesetting-Fix-16-bit-depth-bpp-mode.patch
@@ -0,0 +1,46 @@
+From 5028ef46ff4ab0930224b71024a7349b05610d42 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan@agner.ch>
+Date: Thu, 22 Dec 2016 15:41:06 +0100
+Subject: [PATCH] modesetting: Fix 16 bit depth/bpp mode
+
+When setting DefaultDepth to 16 in the Screen section, the current
+code requests a 32 bpp framebuffer, however the X-Server seems to
+assumes 16 bpp.
+
+Fixes commit 21217d02168d ("modesetting: Implement 32->24 bpp
+conversion in shadow update")
+
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+
+Upstream-Status: Submitted [1]
+
+[1] https://lists.x.org/archives/xorg-devel/2016-December/052113.html
+---
+ hw/xfree86/drivers/modesetting/driver.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
+index d7030e5..647ad83 100644
+--- a/hw/xfree86/drivers/modesetting/driver.c
++++ b/hw/xfree86/drivers/modesetting/driver.c
+@@ -930,7 +930,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+ "Using 24bpp hw front buffer with 32bpp shadow\n");
+ defaultbpp = 32;
+ } else {
+- ms->drmmode.kbpp = defaultbpp;
++ ms->drmmode.kbpp = 0;
+ }
+ bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb;
+
+@@ -950,6 +950,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+ return FALSE;
+ }
+ xf86PrintDepthBpp(pScrn);
++ if (!ms->drmmode.kbpp)
++ ms->drmmode.kbpp = pScrn->bitsPerPixel;
+
+ /* Process the options */
+ xf86CollectOptions(pScrn, NULL);
+--
+2.7.4
+
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
new file mode 100644
index 000000000..c36e4e730
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
@@ -0,0 +1,25 @@
+This is the revised version of files/macro_tweak.patch for
+xorg-server 1.8.99.904 and newer.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+Index: xorg-server-1.19.6/xorg-server.m4
+===================================================================
+--- xorg-server-1.19.6.orig/xorg-server.m4
++++ xorg-server-1.19.6/xorg-server.m4
+@@ -28,10 +28,12 @@ dnl
+ # Checks for the MACRO define in xorg-server.h (from the sdk). If it
+ # is defined, then add the given PROTO to $REQUIRED_MODULES.
+
++m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
++
+ AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ SAVE_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
++ CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include "xorg-server.h"
+ #if !defined $1
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
new file mode 100644
index 000000000..4be441fb7
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg/musl-arm-inb-outb.patch
@@ -0,0 +1,18 @@
+inb/outb family for arm is only implemented on glibc
+so assumption across linux is wrong
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: xorg-server-1.18.0/hw/xfree86/common/compiler.h
+===================================================================
+--- xorg-server-1.18.0.orig/hw/xfree86/common/compiler.h
++++ xorg-server-1.18.0/hw/xfree86/common/compiler.h
+@@ -758,7 +758,7 @@ inl(unsigned short port)
+ return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+
+-#elif defined(__arm__) && defined(__linux__)
++#elif defined(__arm__) && defined(__GLIBC__)
+
+ /* for Linux on ARM, we use the LIBC inx/outx routines */
+ /* note that the appropriate setup via "ioperm" needs to be done */
diff --git a/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb
new file mode 100644
index 000000000..c680cf9e8
--- /dev/null
+++ b/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.19.6.bb
@@ -0,0 +1,32 @@
+require xserver-xorg.inc
+
+SRC_URI += "file://musl-arm-inb-outb.patch \
+ file://0001-configure.ac-Fix-check-for-CLOCK_MONOTONIC.patch \
+ file://0003-modesetting-Fix-16-bit-depth-bpp-mode.patch \
+ file://0003-Remove-check-for-useSIGIO-option.patch \
+ file://0001-xf86pciBus.c-use-Intel-ddx-only-for-pre-gen4-hardwar.patch \
+ "
+SRC_URI[md5sum] = "3e47777ff034a331aed2322b078694a8"
+SRC_URI[sha256sum] = "a732502f1db000cf36a376cd0c010ffdbf32ecdd7f1fa08ba7f5bdf9601cc197"
+
+# These extensions are now integrated into the server, so declare the migration
+# path for in-place upgrades.
+
+RREPLACES_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "
+RPROVIDES_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "
+RCONFLICTS_${PN} = "${PN}-extension-dri \
+ ${PN}-extension-dri2 \
+ ${PN}-extension-record \
+ ${PN}-extension-extmod \
+ ${PN}-extension-dbe \
+ "
diff --git a/poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb b/poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb
new file mode 100644
index 000000000..ce5df0393
--- /dev/null
+++ b/poky/meta/recipes-graphics/xrestop/xrestop_0.4.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XRes: A top-like resource usage tool for X"
+
+DESCRIPTION = "top-like statistics of X11 server resource usage by clients"
+
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xrestop"
+BUGTRACKER = "https://bugs.freedesktop.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://xrestop.c;endline=18;md5=730876c30f0d8a928676bcd1242a3b35"
+
+SECTION = "x11/utils"
+PR = "r3"
+
+DEPENDS = "libxres libxext virtual/libx11 ncurses"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b"
+SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb b/poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
new file mode 100644
index 000000000..1d275a004
--- /dev/null
+++ b/poky/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Simple XVideo test application"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://src/test-xvideo.c;beginline=1;endline=20;md5=6ae3b4c3c2ff9e51dbbc35bb237afa00"
+DEPENDS = "libxv"
+
+SRCREV = "7d38b881e99eb74169d292b40f7164e461a65092"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/test-xvideo"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools distro_features_check
+
+# The libxv requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
new file mode 100644
index 000000000..ab905cf0d
--- /dev/null
+++ b/poky/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
@@ -0,0 +1,114 @@
+blktrace: obey LDFLAGS
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+the patch was imported from meta-mentor layer on yoctoproject git server
+http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor as of commit id
+aed463414e2e2bf8ca44ba54ee5973e7ed599e57
+
+Signed-off-by: Fahad Usman <fahad_usman@mentor.com>
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -1,5 +1,6 @@
+ CC = gcc
+ CFLAGS = -Wall -O2 -g -W
++LDFLAGS =
+ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PROGS = blkparse blktrace verify_blkparse blkrawverify blkiomon
+ LIBS = -lpthread
+@@ -26,19 +27,19 @@ btreplay/btreplay:
+ $(CC) -o $*.o -c $(ALL_CFLAGS) $<
+
+ blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+
+ blktrace: blktrace.o act_mask.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+
+ verify_blkparse: verify_blkparse.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+
+ blkrawverify: blkrawverify.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+
+ blkiomon: blkiomon.o rbtree.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt $(LDFLAGS)
+
+ $(PROGS): | depend
+
+Index: git/btreplay/Makefile
+===================================================================
+--- git.orig/btreplay/Makefile
++++ git/btreplay/Makefile
+@@ -7,6 +7,7 @@
+
+ CC = gcc
+ CFLAGS = -Wall -W -O2 -g
++LDFLAGS =
+ INCS = -I. -I.. -I../btt
+ OCFLAGS = -UCOUNT_IOS -UDEBUG -DNDEBUG
+ XCFLAGS = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+@@ -32,10 +33,10 @@ clean: docsclean
+ $(CC) $(CFLAGS) -c -o $*.o $<
+
+ btrecord: btrecord.o
+- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
++ $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+
+ btreplay: btreplay.o
+- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++ $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+
+ depend:
+ @$(CC) -MM $(CFLAGS) *.c 1> .depend
+Index: git/btt/Makefile
+===================================================================
+--- git.orig/btt/Makefile
++++ git/btt/Makefile
+@@ -7,6 +7,7 @@
+
+ CC = gcc
+ CFLAGS = -Wall -W -O2 -g
++LDFLAGS =
+ INCS = -I. -I..
+ XCFLAGS = -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ override CFLAGS += $(INCS) $(XCFLAGS)
+@@ -38,7 +39,7 @@ clean: docsclean
+ $(CC) $(CFLAGS) -c -o $*.o $<
+
+ btt: $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++ $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+
+ ifneq ($(wildcard .depend),)
+ include .depend
+Index: git/iowatcher/Makefile
+===================================================================
+--- git.orig/iowatcher/Makefile
++++ git/iowatcher/Makefile
+@@ -1,5 +1,6 @@
+ CC = gcc
+ CFLAGS = -Wall -O2 -g -W -Wunused-result
++LDFLAGS =
+ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+ PROGS = iowatcher
+@@ -19,7 +20,7 @@ all: $(ALL)
+ $(CC) -o $*.o -c $(ALL_CFLAGS) $<
+
+ iowatcher: blkparse.o plot.o main.o tracers.o mpstat.o fio.o
+- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm -lrt
++ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm $(LDFLAGS) -lrt
+
+ depend:
+ @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
diff --git a/poky/meta/recipes-kernel/blktrace/blktrace_git.bb b/poky/meta/recipes-kernel/blktrace/blktrace_git.bb
new file mode 100644
index 000000000..663de2ed5
--- /dev/null
+++ b/poky/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Generates traces of I/O traffic on block devices"
+HOMEPAGE = "http://brick.kernel.dk/snaps/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "libaio"
+
+SRCREV = "cca113f2fe0759b91fd6a0e10fdcda2c28f18a7e"
+
+PV = "1.2.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.dk/blktrace.git \
+ file://ldflags.patch \
+"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "\
+ 'CC=${CC}' \
+ 'CFLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+"
+
+# There are a few parallel issues:
+# 1) ../rbtree.o: error adding symbols: Invalid operation
+# collect2: error: ld returned 1 exit status
+# Makefile:42: recipe for target 'btt' failed
+# 2) git/blkiomon.c:216: undefined reference to `rb_insert_color'
+# collect2: error: ld returned 1 exit status
+# Makefile:27: recipe for target 'blkparse' failed
+# 3) ld: rbtree.o: invalid string offset 128 >= 125 for section `.strtab'
+# 4) btreplay.o: file not recognized: File truncated
+# collect2: error: ld returned 1 exit status
+# btreplay/btreplay.c:47:18: fatal error: list.h: No such file or directory
+PARALLEL_MAKE = ""
+
+do_install() {
+ oe_runmake ARCH="${ARCH}" prefix=${prefix} \
+ mandir=${mandir} DESTDIR=${D} install
+}
+
diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb
new file mode 100644
index 000000000..c55577c66
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-linux_1.9.bb
@@ -0,0 +1,13 @@
+require cryptodev.inc
+
+SUMMARY = "A /dev/crypto device driver header file"
+
+do_compile[noexec] = "1"
+
+# Just install cryptodev.h which is the only header file needed to be exported
+do_install() {
+ install -D ${S}/crypto/cryptodev.h ${D}${includedir}/crypto/cryptodev.h
+}
+
+ALLOW_EMPTY_${PN} = "1"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb
new file mode 100644
index 000000000..ed6d0ecae
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-module_1.9.bb
@@ -0,0 +1,18 @@
+require cryptodev.inc
+
+SUMMARY = "A /dev/crypto device driver kernel module"
+
+inherit module
+
+# Header file provided by a separate package
+DEPENDS += "cryptodev-linux"
+
+SRC_URI += " \
+file://0001-Disable-installing-header-file-provided-by-another-p.patch \
+file://0001-ioctl.c-Fix-build-with-linux-4.13.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+RCONFLICTS_${PN} = "ocf-linux"
+RREPLACES_${PN} = "ocf-linux"
diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb b/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb
new file mode 100644
index 000000000..9afb3de21
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/cryptodev-tests_1.9.bb
@@ -0,0 +1,21 @@
+require cryptodev.inc
+
+SUMMARY = "A test suite for /dev/crypto device driver"
+
+DEPENDS += "openssl10"
+
+SRC_URI += " \
+file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_EXECPREFIXDIR}" PREFIX="${D}"'
+
+do_compile() {
+ oe_runmake testprogs
+}
+
+do_install() {
+ oe_runmake install_tests
+}
+
+FILES_${PN} = "${bindir}/*"
diff --git a/poky/meta/recipes-kernel/cryptodev/cryptodev.inc b/poky/meta/recipes-kernel/cryptodev/cryptodev.inc
new file mode 100644
index 000000000..ab15bc1d9
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/cryptodev.inc
@@ -0,0 +1,11 @@
+HOMEPAGE = "http://cryptodev-linux.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/cryptodev-linux/cryptodev-linux"
+SRCREV = "87d959d9a279c055b361de8e730fab6a7144edd7"
+
+S = "${WORKDIR}/git"
+
+CLEANBROKEN = "1"
diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
new file mode 100644
index 000000000..84fd27e68
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
@@ -0,0 +1,66 @@
+From 1980a8f4779a955e73285e7a0d86549b69bea5c8 Mon Sep 17 00:00:00 2001
+From: Yu Zongchun <b40527@freescale.com>
+Date: Sun, 28 Apr 2013 14:39:22 +0800
+Subject: [PATCH] Add the compile and install rules for cryptodev tests folder
+
+This is required to install the cryptodev tests folder to rootfs
+
+Signed-off-by: Yu Zongchun <b40527@freescale.com>
+
+Upstream-Status: Pending
+
+---
+ Makefile | 6 ++++++
+ tests/Makefile | 8 ++++++++
+ 2 files changed, 14 insertions(+), 0 deletions(-)
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -35,6 +35,9 @@ modules_install:
+ $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
+ install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
+
++install_tests:
++ make -C tests install DESTDIR=$(PREFIX)
++
+ clean:
+ $(MAKE) $(KERNEL_MAKE_OPTS) clean
+ rm -f $(hostprogs) *~
+@@ -43,6 +46,9 @@ clean:
+ check:
+ CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) $(MAKE) -C tests check
+
++testprogs:
++ KERNEL_DIR=$(KERNEL_DIR) make -C tests testprogs
++
+ CPOPTS =
+ ifneq ($(SHOW_TYPES),)
+ CPOPTS += --show-types
+Index: git/tests/Makefile
+===================================================================
+--- git.orig/tests/Makefile
++++ git/tests/Makefile
+@@ -23,6 +23,12 @@ bindir = $(execprefix)/bin
+
+ all: $(hostprogs)
+
++install:
++ install -d $(DESTDIR)/usr/bin/tests_cryptodev
++ for bin in $(hostprogs); do \
++ install -m 755 $${bin} $(DESTDIR)/usr/bin/tests_cryptodev/; \
++ done
++
+ check: $(hostprogs)
+ ./cipher
+ ./hmac
+@@ -38,6 +44,8 @@ install:
+ install -m 755 $$prog $(DESTDIR)/$(bindir); \
+ done
+
++testprogs: $(hostprogs)
++
+ clean:
+ rm -f *.o *~ $(hostprogs)
+
diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
new file mode 100644
index 000000000..885b5823e
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
@@ -0,0 +1,24 @@
+From 8a884f55bd1527baa82fab68c186ba546273860c Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 19:51:39 -0400
+Subject: [PATCH] Disable installing header file provided by another package
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Inappropriate [ OE specific ]
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 5a080e0..bf02396 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,7 +33,6 @@ install: modules_install
+
+ modules_install:
+ $(MAKE) $(KERNEL_MAKE_OPTS) modules_install
+- install -m 644 -D crypto/cryptodev.h $(DESTDIR)/$(includedir)/crypto/cryptodev.h
+
+ clean:
+ $(MAKE) $(KERNEL_MAKE_OPTS) clean
diff --git a/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch b/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch
new file mode 100644
index 000000000..a41efacdd
--- /dev/null
+++ b/poky/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-with-linux-4.13.patch
@@ -0,0 +1,49 @@
+From f0d69774afb27ffc62bf353465fba145e70cb85a Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Date: Mon, 4 Sep 2017 11:05:08 +0200
+Subject: [PATCH] ioctl.c: Fix build with linux 4.13
+
+git/ioctl.c:1127:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
+ {0, },
+ ^
+note: (near initialization for 'verbosity_ctl_dir[1]')
+git/ioctl.c:1136:3: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
+ {0, },
+ ^
+
+Linux kernel has added -Werror=designated-init around 4.11 (c834f0e8a8b)
+triggering build errors with gcc 5 and 6 (but not with gcc 4)
+
+Upstream-Status: Backport
+
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
+---
+ ioctl.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ioctl.c b/ioctl.c
+index 0385203..8d4a162 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -1124,7 +1124,7 @@ static struct ctl_table verbosity_ctl_dir[] = {
+ .mode = 0644,
+ .proc_handler = proc_dointvec,
+ },
+- {0, },
++ {},
+ };
+
+ static struct ctl_table verbosity_ctl_root[] = {
+@@ -1133,7 +1133,7 @@ static struct ctl_table verbosity_ctl_root[] = {
+ .mode = 0555,
+ .child = verbosity_ctl_dir,
+ },
+- {0, },
++ {},
+ };
+ static struct ctl_table_header *verbosity_sysctl_header;
+ static int __init init_cryptodev(void)
+--
+2.7.4
+
diff --git a/poky/meta/recipes-kernel/dtc/dtc.inc b/poky/meta/recipes-kernel/dtc/dtc.inc
new file mode 100644
index 000000000..9a90d4404
--- /dev/null
+++ b/poky/meta/recipes-kernel/dtc/dtc.inc
@@ -0,0 +1,25 @@
+SUMMARY = "Device Tree Compiler"
+HOMEPAGE = "https://devicetree.org/"
+DESCRIPTION = "The Device Tree Compiler is a tool used to manipulate the Open-Firmware-like device tree used by PowerPC kernels."
+SECTION = "bootloader"
+LICENSE = "GPLv2 | BSD"
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
+ file://make_install.patch \
+ file://0001-checks-Use-proper-format-modifier-for-size_t.patch \
+ "
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
+
+EXTRA_OEMAKE='NO_PYTHON=1 PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
+
+S = "${WORKDIR}/git"
+
+do_install () {
+ oe_runmake install
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
+
+RDEPENDS_${PN}-misc += "bash diffutils"
diff --git a/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch b/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch
new file mode 100644
index 000000000..cab384dd9
--- /dev/null
+++ b/poky/meta/recipes-kernel/dtc/dtc/0001-checks-Use-proper-format-modifier-for-size_t.patch
@@ -0,0 +1,43 @@
+From c7a4c3817796107bb824a1f173faf90fae45396b Mon Sep 17 00:00:00 2001
+From: Thierry Reding <treding@nvidia.com>
+Date: Wed, 27 Sep 2017 15:04:09 +0200
+Subject: [PATCH] checks: Use proper format modifier for size_t
+
+The size of size_t can vary between architectures, so using %ld isn't
+going to work on 32-bit builds. Use the %zu modifier to make sure it is
+always correct.
+
+Upstream-Status: Backport
+Signed-off-by: Thierry Reding <treding@nvidia.com>
+Acked-by: Rob Herring <robh@kernel.org>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ checks.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/checks.c b/checks.c
+index 902f2e3..08a3a29 100644
+--- a/checks.c
++++ b/checks.c
+@@ -972,7 +972,7 @@ static void check_property_phandle_args(struct check *c,
+ int cell, cellsize = 0;
+
+ if (prop->val.len % sizeof(cell_t)) {
+- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
++ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
+ prop->name, prop->val.len, sizeof(cell_t), node->fullpath);
+ return;
+ }
+@@ -1163,7 +1163,7 @@ static void check_interrupts_property(struct check *c,
+ return;
+
+ if (irq_prop->val.len % sizeof(cell_t))
+- FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %ld in node %s",
++ FAIL(c, dti, "property '%s' size (%d) is invalid, expected multiple of %zu in node %s",
+ irq_prop->name, irq_prop->val.len, sizeof(cell_t),
+ node->fullpath);
+
+--
+2.15.0
+
diff --git a/poky/meta/recipes-kernel/dtc/dtc/make_install.patch b/poky/meta/recipes-kernel/dtc/dtc/make_install.patch
new file mode 100644
index 000000000..ccf17b38f
--- /dev/null
+++ b/poky/meta/recipes-kernel/dtc/dtc/make_install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -168,8 +168,8 @@ install-bin: all $(SCRIPTS)
+ install-lib: all
+ @$(VECHO) INSTALL-LIB
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
+- $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
+- ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++ $(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++ ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/$(notdir $(LIBFDT_lib))
+ ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
+ $(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
+
diff --git a/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb b/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb
new file mode 100644
index 000000000..0e46cfbeb
--- /dev/null
+++ b/poky/meta/recipes-kernel/dtc/dtc_1.4.5.bb
@@ -0,0 +1,10 @@
+require dtc.inc
+
+LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
+
+SRCREV = "22a65c5331c22979d416738eb756b9541672e00d"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
new file mode 100644
index 000000000..8ccd8cee1
--- /dev/null
+++ b/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Tools for managing Yocto Project style branched kernels"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=a6c2fa8aef1bda400e2828845ba0d06c"
+
+DEPENDS = "git-native"
+
+SRCREV = "b46b1c4f0973bf1eb09cf1191f5f4e69bcd0475d"
+PR = "r12"
+PV = "0.2+git${SRCPV}"
+
+inherit native
+
+SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git"
+S = "${WORKDIR}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ cd ${S}/git
+ make DESTDIR=${D}${bindir} install
+}
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch
new file mode 100644
index 000000000..3f2f85e33
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch
@@ -0,0 +1,31 @@
+From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 10 Jun 2017 11:18:49 -0700
+Subject: [PATCH] Disable PIE during link
+
+We have explcitly disabled PIE during compile so we
+just need to match it with linker flags
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ purgatory/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/purgatory/Makefile b/purgatory/Makefile
+index 564bdb7..a08e41f 100644
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -Iinclude \
+ -I$(shell $(CC) -print-file-name=include)
+ $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+- -Wl,--no-undefined -nostartfiles -nostdlib \
++ -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \
+ -nodefaultlibs -e purgatory_start -Wl,-r \
+ -Wl,-Map=$(PURGATORY_MAP)
+
+--
+2.13.1
+
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
new file mode 100644
index 000000000..bfd077daf
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
@@ -0,0 +1,32 @@
+From a1135b3170963ba956f2364c1283864c35541295 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:59:45 +0000
+Subject: [PATCH] purgatory: Pass -r directly to linker
+
+This helps compiling with clang since -r is not a known option for clang
+where as gcc knows how to deal with it and passes it down to linker
+unfiltered
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ purgatory/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/purgatory/Makefile b/purgatory/Makefile
+index 2b5c061..b251353 100644
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -61,7 +61,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -I$(shell $(CC) -print-file-name=include)
+ $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+ -Wl,--no-undefined -nostartfiles -nostdlib \
+- -nodefaultlibs -e purgatory_start -r \
++ -nodefaultlibs -e purgatory_start -Wl,-r \
+ -Wl,-Map=$(PURGATORY_MAP)
+
+ $(PURGATORY): $(PURGATORY_OBJS)
+--
+2.5.1
+
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
new file mode 100644
index 000000000..dc97d930e
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
@@ -0,0 +1,35 @@
+From b19b68eab567aa534cf8dec79fe18e3dc0e14043 Mon Sep 17 00:00:00 2001
+From: Quanyang Wang <quanyang.wang@windriver.com>
+Date: Tue, 16 Jun 2015 12:59:57 +0800
+Subject: [PATCH] powerpc: change the memory size limit
+
+When run "kexec" in powerpc board, the kexec has a limit that
+the kernel text and bss size must be less than 24M. But now
+some kernel size exceed the limit. So we need to change the limit,
+else will get the error log as below:
+
+my_load:669: do
+Could not find a free area of memory of 0x12400 bytes...
+Could not find a free area of memory of 0x13000 bytes...
+locate_hole failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
+---
+ kexec/arch/ppc/kexec-ppc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/kexec-ppc.h
++++ kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+@@ -42,7 +42,7 @@ void dol_ppc_usage(void);
+ * During inital setup the kernel does not map the whole memory but a part of
+ * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible).
+ */
+-#define KERNEL_ACCESS_TOP (24 * 1024 * 1024)
++#define KERNEL_ACCESS_TOP (36 * 1024 * 1024)
+
+ /* boot block version 17 as defined by the linux kernel */
+ struct bootblock {
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
new file mode 100644
index 000000000..6c6c66d88
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch
@@ -0,0 +1,52 @@
+From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Mon, 9 Jan 2017 15:26:29 +0800
+Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue
+
+When "CONFIG_ARM_LPAE" is enabled,3 level page table
+is used by MMU, the "SECTION_SIZE" is defined with
+(1 << 21), but 'add_buffer_phys_virt()' hardcode this
+to (1 << 20).
+
+Upstream-Status: Pending
+
+Suggested-By:fredrik.markstrom@gmail.com
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ kexec/arch/arm/crashdump-arm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c
+index 245c21a..12139c3 100644
+--- a/kexec/arch/arm/crashdump-arm.c
++++ b/kexec/arch/arm/crashdump-arm.c
+@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ void *buf;
+ int err;
+ int last_ranges;
++ unsigned short align_bit_shift = 20;
+
+ /*
+ * First fetch all the memory (RAM) ranges that we are going to pass to
+@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+
+ /* for support LPAE enabled kernel*/
+ elf_info.class = ELFCLASS64;
++ align_bit_shift = 21;
+
+ err = crash_create_elf64_headers(info, &elf_info,
+ usablemem_rgns.ranges,
+@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
+ * 1MB) so that available memory passed in kernel command line will be
+ * aligned to 1MB. This is because kernel create_mapping() wants memory
+ * regions to be aligned to SECTION_SIZE.
++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h
+ */
+- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift,
+ crash_kernel_mem.start,
+ crash_kernel_mem.end, -1, 0);
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump
new file mode 100755
index 000000000..69e3cafe5
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump
@@ -0,0 +1,145 @@
+#! /bin/sh
+#
+# kdump
+#
+# Description: The kdump script provides the support:
+# 1. Load a kdump kernel image into memory;
+# 2. Copy away vmcore when system panic.
+#
+
+#default
+KEXEC=/usr/sbin/kexec
+KEXEC_ARGS="-p"
+
+MAKEDUMPFILE=/usr/bin/makedumpfile
+MAKEDUMPFILE_ARGS="-E -d 1"
+
+LOGGER="logger -p info -t kdump"
+
+if [ -f /etc/sysconfig/kdump.conf ]; then
+ . /etc/sysconfig/kdump.conf
+else
+ echo "no /etc/sysconfig/kdump.conf"
+ exit 1;
+fi
+
+do_check()
+{
+ #check makedumpfile
+ if [ ! -e ${MAKEDUMPFILE} -o ! -x ${MAKEDUMPFILE} ] ;then
+ echo "No makedumpfile found."
+ exit 0
+ fi
+
+ #check kexec
+ if [ ! -e ${KEXEC} -o ! -x ${KEXEC} ] ;then
+ echo "No kexec found."
+ exit 0
+ fi
+
+ #check whether kdump kernel image exists on the system
+ if [ -z "${KDUMP_KIMAGE}" -o ! -f "${KDUMP_KIMAGE}" ]; then
+ echo "No kdump kernel image found."
+ exit 0
+ fi
+
+ if [ "${KDUMP_CMDLINE}"x = "x" ] ; then
+ echo "KDUMP_CMDLINE is not configured"
+ exit 0
+ fi
+}
+
+do_save_vmcore()
+{
+ if [ ${KDUMP_VMCORE_PATH}x = x ]; then
+ KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
+ fi
+
+ mkdir -p ${KDUMP_VMCORE_PATH}
+ echo "Saving a vmcore to ${KDUMP_VMCORE_PATH}."
+
+ ${MAKEDUMPFILE} ${MAKEDUMPFILE_ARGS} /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`"
+# cp --sparse=always /proc/vmcore ${KDUMP_VMCORE_PATH}/vmcore-"`date +"%H:%M:%S"`"
+ rc=$?
+ if [ ${rc} == 0 ]; then
+ ${LOGGER} "Saved a vmcore to ${KDUMP_VMCORE_PATH}."
+ else
+ ${LOGGER} "Failed to save vmcore!"
+ fi
+ return ${rc}
+}
+
+do_start()
+{
+ #check file
+ do_check
+
+ #check whether the running kernel supports kdump.
+ if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
+ echo "Kdump isn't supported on the running kernel!!!"
+ ${LOGGER} "Kdump isn't supported on the running kernel!!!"
+ return 1
+ fi
+
+ #check whether kdump kernel image has been loaded
+ rc=`cat /sys/kernel/kexec_crash_loaded`
+ if [ ${rc} != 0 ]; then
+ echo "Kdump is already running.";
+ ${LOGGER} "Kdump is already running."
+ return 0
+ fi
+
+ #check the running kernel cmdline option,insure "crashkernel=" always set.
+ grep -q crashkernel= /proc/cmdline
+ if [ $? != 0 ]; then
+ echo "Kdump isn't supported on the running kernel,please check boot option!!!"
+ ${LOGGER} "Kdump isn't supported on the running kernel,please check boot option!!!"
+ return 1
+ fi
+
+ #Load the kdump kernel image
+ ${KEXEC} ${KEXEC_ARGS} "${KDUMP_KIMAGE}" --append="${KDUMP_CMDLINE}"
+ if [ $? != 0 ]; then
+ echo "Failed to load kdump kernel!"
+ ${LOGGER} "Failed to load kdump kernel!"
+ return 1
+ fi
+
+ echo "Kdump started up."
+ ${LOGGER} "Kdump started up."
+}
+
+do_stop()
+{
+ ${KEXEC} -p -u 2>/dev/null
+ if [ $? == 0 ]; then
+ echo "Kdump has been stopped."
+ ${LOGGER} "Kdump has been stopped."
+ else
+ echo "Failed to stop kdump!"
+ ${LOGGER} "Failed to stop kdump!"
+ fi
+}
+
+case "$1" in
+ start)
+ if [ -s /proc/vmcore ]; then
+ do_save_vmcore
+ reboot
+ else
+ do_start
+ fi
+ ;;
+ restart)
+ do_stop
+ do_start
+ ;;
+ stop)
+ do_stop
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
new file mode 100644
index 000000000..38190d207
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.conf
@@ -0,0 +1,14 @@
+#the kdump kernel version string.
+#KDUMP_KVER="`uname -r`"
+
+#this will be passed to the kdump kernel as kdump kernel command line
+#KDUMP_CMDLINE="`cat /proc/cmdline`"
+
+#the kernel image for kdump
+#KDUMP_KIMAGE="/boot/bzImage-${KDUMP_KVER}"
+
+#Where to save the vmcore
+#KDUMP_VMCORE_PATH="/var/crash/`date +"%Y-%m-%d"`"
+
+#the arguments to makedumpfile
+MAKEDUMPFILE_ARGS="--dump-dmesg -x /boot/vmlinux-`uname -r`"
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service
new file mode 100644
index 000000000..4e65a46ac
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kdump.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Reboot and dump vmcore via kexec
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/kdump-helper start
+ExecStop=@LIBEXECDIR@/kdump-helper stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
new file mode 100644
index 000000000..26d18eb6f
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
@@ -0,0 +1,88 @@
+x86_64: Add support to build kexec-tools with x32 ABI
+
+Summary of changes,
+
+configure.ac: Add test for detect x32 ABI.
+purgatory/arch/x86_64/Makefile: Not use mcmodel large when
+ x32 ABI is set.
+kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set
+ use ELFCLASS32 instead of ELFCLASS64.
+kexec/kexec-syscall.h: Add correct syscall number for x32 ABI.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
+
+---
+ configure.ac | 9 +++++++++
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++
+ kexec/kexec-syscall.h | 4 ++++
+ purgatory/arch/x86_64/Makefile | 4 +++-
+ 4 files changed, 20 insertions(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -56,6 +56,15 @@ case $target_cpu in
+ ;;
+ ia64|x86_64|alpha|m68k )
+ ARCH="$target_cpu"
++
++ dnl ---Test for x32 ABI in x86_64
++ if test "x$ARCH" = "xx86_64" ; then
++ AC_EGREP_CPP(x32_test,
++ [#if defined(__x86_64__) && defined (__ILP32__)
++ x32_test
++ #endif
++ ], SUBARCH='x32', SUBARCH='64')
++ fi
+ ;;
+ * )
+ AC_MSG_ERROR([unsupported architecture $target_cpu])
+Index: kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_eh
+ if (ehdr->ei_data != ELFDATA2LSB) {
+ return 0;
+ }
++#ifdef __ILP32__
++ if (ehdr->ei_class != ELFCLASS32) {
++#else
+ if (ehdr->ei_class != ELFCLASS64) {
++#endif
+ return 0;
+ }
+ if (ehdr->e_machine != EM_X86_64) {
+Index: kexec-tools-2.0.10/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h
++++ kexec-tools-2.0.10/kexec/kexec-syscall.h
+@@ -31,8 +31,12 @@
+ #define __NR_kexec_load 268
+ #endif
+ #ifdef __x86_64__
++#ifdef __ILP32__
++#define __NR_kexec_load 528
++#else
+ #define __NR_kexec_load 246
+ #endif
++#endif
+ #ifdef __s390x__
+ #define __NR_kexec_load 277
+ #endif
+Index: kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/purgatory/arch/x86_64/Makefile
++++ kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
+
+-x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++ifeq ($(SUBARCH),64)
++ x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++endif
diff --git a/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb b/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb
new file mode 100644
index 000000000..ebb483268
--- /dev/null
+++ b/poky/meta/recipes-kernel/kexec/kexec-tools_2.0.16.bb
@@ -0,0 +1,86 @@
+
+SUMMARY = "Kexec fast reboot tools"
+DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
+AUTHOR = "Eric Biederman"
+HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
+SECTION = "kernel/userland"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
+ file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
+DEPENDS = "zlib xz"
+
+PR = "r1"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \
+ file://kdump \
+ file://kdump.conf \
+ file://kdump.service \
+ file://0002-powerpc-change-the-memory-size-limit.patch \
+ file://0001-purgatory-Pass-r-directly-to-linker.patch \
+ file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \
+ file://kexec-x32.patch \
+ file://0001-Disable-PIE-during-link.patch \
+ "
+
+SRC_URI[md5sum] = "5198968de79b5ded96f97f3c2ea9637b"
+SRC_URI[sha256sum] = "cf17fc99bf77c9b39f06ee88ac0e86d0349c4a0c3f8214a3cc78eece872f6f3a"
+
+inherit autotools update-rc.d systemd
+
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+do_compile_prepend() {
+ # Remove the prepackaged config.h from the source tree as it overrides
+ # the same file generated by configure and placed in the build tree
+ rm -f ${S}/include/config.h
+
+ # Remove the '*.d' file to make sure the recompile is OK
+ for dep in `find ${B} -type f -name '*.d'`; do
+ dep_no_d="`echo $dep | sed 's#.d$##'`"
+ # Remove file.d when there is a file.o
+ if [ -f "$dep_no_d.o" ]; then
+ rm -f $dep
+ fi
+ done
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/sysconfig
+ install -m 0644 ${WORKDIR}/kdump.conf ${D}${sysconfdir}/sysconfig
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/kdump ${D}${sysconfdir}/init.d/kdump
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/kdump ${D}${libexecdir}/kdump-helper
+ install -D -m 0644 ${WORKDIR}/kdump.service ${D}${systemd_unitdir}/system/kdump.service
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' ${D}${systemd_unitdir}/system/kdump.service
+ fi
+}
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump \
+ ${sysconfdir}/sysconfig/kdump.conf \
+ ${sysconfdir}/init.d/kdump \
+ ${libexecdir}/kdump-helper \
+ ${systemd_unitdir}/system/kdump.service \
+"
+
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
+
+INITSCRIPT_PACKAGES = "kdump"
+INITSCRIPT_NAME_kdump = "kdump"
+INITSCRIPT_PARAMS_kdump = "start 56 2 3 4 5 . stop 56 0 1 6 ."
+
+SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
+
+INSANE_SKIP_${PN} = "arch"
diff --git a/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
new file mode 100644
index 000000000..9a172675a
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
+LICENSE = "MIT"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+# The kernel and the staging dir for it is machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# We need the following for the sstate code to process the wrapper
+SSTATE_SCAN_FILES += "depmodwrapper"
+EXTRA_STAGING_FIXMES += "PKGDATA_DIR"
+
+DEPENDS += "kmod-native"
+do_populate_sysroot[depends] = ""
+
+do_install() {
+ install -d ${D}${bindir_crossscripts}/
+
+ cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
+#!/bin/sh
+# Expected to be called as: depmodwrapper -a KERNEL_VERSION
+if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
+ echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
+ exit 1
+fi
+
+kernelabi=""
+if [ -r "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" ]; then
+ kernelabi=\$(cat "${PKGDATA_DIR}/kernel-depmod/kernel-abiversion")
+fi
+
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then
+ echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
+ exec env depmod "\$1" "\$2" "\$3" "\$4"
+else
+ exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+fi
+EOF
+ chmod +x ${D}${bindir_crossscripts}/depmodwrapper
+}
+
+SYSROOT_DIRS += "${bindir_crossscripts}"
+
+PACKAGES = ""
+inherit nopackages
diff --git a/poky/meta/recipes-kernel/kmod/kmod-native_git.bb b/poky/meta/recipes-kernel/kmod/kmod-native_git.bb
new file mode 100644
index 000000000..f0e274ed7
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -0,0 +1,18 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib-native"
+
+inherit native
+
+SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
+ "
+
+do_install_append (){
+ for tool in depmod insmod lsmod modinfo modprobe rmmod
+ do
+ ln -s kmod ${D}${bindir}/$tool
+ done
+}
diff --git a/poky/meta/recipes-kernel/kmod/kmod.inc b/poky/meta/recipes-kernel/kmod/kmod.inc
new file mode 100644
index 000000000..29885fbe7
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod.inc
@@ -0,0 +1,42 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Tools for managing Linux kernel modules"
+DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
+ insert, remove, list, check properties, resolve dependencies and aliases."
+HOMEPAGE = "http://packages.profusion.mobi/kmod/"
+LICENSE = "GPL-2.0+ & LGPL-2.1+"
+LICENSE_libkmod = "LGPL-2.1+"
+SECTION = "base"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ "
+inherit autotools gtk-doc pkgconfig manpages
+
+SRCREV = "aca4eca103d6699543f7ed663335c28c2e9908bb"
+# Lookout for PV bump too when SRCREV is changed
+PV = "25+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
+ file://depmod-search.conf \
+ file://avoid_parallel_tests.patch \
+ file://fix-O_CLOEXEC.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+EXTRA_AUTORECONF += "--install --symlink"
+EXTRA_OECONF +=" --enable-tools --with-zlib"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_DOLT_BASH='/usr/bin/env bash'"
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native"
+
+GTKDOC_DOCDIR = "${S}/libkmod/docs"
+
+do_configure_append () {
+ sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool
+}
diff --git a/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 000000000..b722183b6
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,39 @@
+Subject: Change to calling bswap_* instead of htobe* and be*toh
+
+We can't use htobe* and be*toh functions because they are not
+available on older versions of glibc, For example, shipped on Centos 5.5.
+
+Change to directly calling bswap_* as defined in+byteswap.h.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ libkmod/libkmod-signature.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
+index 6fc06fc..912185a 100644
+--- a/libkmod/libkmod-signature.c
++++ b/libkmod/libkmod-signature.c
+@@ -18,6 +18,7 @@
+ */
+
+ #include <endian.h>
++#include <byteswap.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -127,7 +128,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
+ modsig->hash >= PKEY_HASH__LAST ||
+ modsig->id_type >= PKEY_ID_TYPE__LAST)
+ return false;
+- sig_len = be32toh(get_unaligned(&modsig->sig_len));
++ sig_len = bswap_32(get_unaligned(&modsig->sig_len));
+ if (sig_len == 0 ||
+ size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
+ return false;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
new file mode 100644
index 000000000..5f45fce93
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -0,0 +1,26 @@
+Avoid parallel-tests as it remove
+buildtest-TESTS and runtest-TESTS targets required by ptest.
+In automake 1.13.4 parallel-tests is assumed by defauls.
+In order to have buildtest-TESTS and runtest-TESTS targets
+serial-tests is now required
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate (disable feature incompatible with ptest)
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ AC_PREFIX_DEFAULT([/usr])
+ AM_MAINTAINER_MODE([enable])
+-AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
++AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests])
+ AM_SILENT_RULES([yes])
+ LT_INIT([disable-static pic-only])
+ DOLT
diff --git a/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf
new file mode 100644
index 000000000..527c0bb6e
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/depmod-search.conf
@@ -0,0 +1,6 @@
+#
+# /etc/depmod.d/depmod.conf
+#
+
+search updates extramodules built-in
+
diff --git a/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
new file mode 100644
index 000000000..5d9d40c38
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
@@ -0,0 +1,35 @@
+From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 22 Jan 2014 01:06:40 -0500
+Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is
+ defined or not
+
+O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
+it, we need check before use.
+
+This patch is much more like a workaround, since it may need fcntl() use
+FD_CLOEXEC to replace.
+
+This problem was reported by "Ting Liu <b28495@freescale.com>"
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ libkmod/libkmod-internal.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+Index: git/libkmod/libkmod-internal.h
+===================================================================
+--- git.orig/libkmod/libkmod-internal.h
++++ git/libkmod/libkmod-internal.h
+@@ -10,6 +10,10 @@
+
+ #include "libkmod.h"
+
++#ifndef O_CLOEXEC
++#define O_CLOEXEC 0
++#endif
++
+ static _always_inline_ _printf_format_(2, 3) void
+ kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
+
diff --git a/poky/meta/recipes-kernel/kmod/kmod/ptest.patch b/poky/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644
index 000000000..831dbcb90
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/ptest.patch
@@ -0,0 +1,25 @@
+Add 'install-ptest' rule.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200
++++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200
+@@ -204,6 +204,16 @@
+
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+
++install-ptest:
++ @$(MKDIR_P) $(DESTDIR)/testsuite
++ @for file in $(TESTSUITE); do \
++ install $$file $(DESTDIR)/testsuite; \
++ done;
++ @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
++ @$(MKDIR_P) $(DESTDIR)/tools
++ @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools
++ @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite
++
+ # ------------------------------------------------------------------------------
+ # custom release helpers
+ # ------------------------------------------------------------------------------
diff --git a/poky/meta/recipes-kernel/kmod/kmod/run-ptest b/poky/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755
index 000000000..598dd2cb5
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+touch testsuite/stamp-rootfs
+tar xf testmodule.tar
+make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
+find testsuite -name *.ko -exec rm -f {} \;
diff --git a/poky/meta/recipes-kernel/kmod/kmod_git.bb b/poky/meta/recipes-kernel/kmod/kmod_git.bb
new file mode 100644
index 000000000..69185b245
--- /dev/null
+++ b/poky/meta/recipes-kernel/kmod/kmod_git.bb
@@ -0,0 +1,62 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib"
+PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# to force user to remove old module-init-tools and replace them with kmod variants
+RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# autotools set prefix to /usr, however we want them in /bin and /sbin
+bindir = "${base_bindir}"
+sbindir = "${base_sbindir}"
+# libdir = "${base_libdir}"
+
+do_install_append () {
+ install -dm755 ${D}${base_bindir}
+ install -dm755 ${D}${base_sbindir}
+ # add symlinks to kmod
+ lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
+ for tool in insmod rmmod depmod modinfo modprobe; do
+ lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
+ done
+ # configuration directories
+ install -dm755 ${D}${base_libdir}/depmod.d
+ install -dm755 ${D}${base_libdir}/modprobe.d
+ install -dm755 ${D}${sysconfdir}/depmod.d
+ install -dm755 ${D}${sysconfdir}/modprobe.d
+
+ # install depmod.d file for search/ dir
+ install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
+}
+
+do_compile_prepend() {
+ sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
+}
+
+inherit update-alternatives bash-completion
+
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
+
+ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
+ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
+ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
+ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
+ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
+
+ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
+ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
+
+ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
+
+PACKAGES =+ "libkmod"
+
+FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
+FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"
diff --git a/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
new file mode 100644
index 000000000..8d6f2f2db
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -0,0 +1,807 @@
+SUMMARY = "Firmware files for use with Linux kernel"
+SECTION = "kernel"
+
+LICENSE = "\
+ Firmware-Abilis \
+ & Firmware-adsp_sst \
+ & Firmware-agere \
+ & Firmware-amdgpu \
+ & Firmware-amd-ucode \
+ & Firmware-atheros_firmware \
+ & Firmware-atmel \
+ & Firmware-broadcom_bcm43xx \
+ & Firmware-ca0132 \
+ & Firmware-cavium \
+ & Firmware-chelsio_firmware \
+ & Firmware-cw1200 \
+ & Firmware-dib0700 \
+ & Firmware-e100 \
+ & Firmware-ene_firmware \
+ & Firmware-fw_sst_0f28 \
+ & Firmware-go7007 \
+ & Firmware-GPLv2 \
+ & Firmware-hfi1_firmware \
+ & Firmware-i2400m \
+ & Firmware-i915 \
+ & Firmware-ibt_firmware \
+ & Firmware-it913x \
+ & Firmware-iwlwifi_firmware \
+ & Firmware-IntcSST2 \
+ & Firmware-kaweth \
+ & Firmware-Marvell \
+ & Firmware-moxa \
+ & Firmware-myri10ge_firmware \
+ & Firmware-netronome \
+ & Firmware-nvidia \
+ & Firmware-OLPC \
+ & Firmware-ath9k-htc \
+ & Firmware-phanfw \
+ & Firmware-qat \
+ & Firmware-qcom \
+ & Firmware-qla1280 \
+ & Firmware-qla2xxx \
+ & Firmware-qualcommAthos_ar3k \
+ & Firmware-qualcommAthos_ath10k \
+ & Firmware-r8a779x_usb3 \
+ & Firmware-radeon \
+ & Firmware-ralink_a_mediatek_company_firmware \
+ & Firmware-ralink-firmware \
+ & Firmware-rtlwifi_firmware \
+ & Firmware-imx-sdma_firmware \
+ & Firmware-siano \
+ & Firmware-tda7706-firmware \
+ & Firmware-ti-connectivity \
+ & Firmware-ti-keystone \
+ & Firmware-ueagle-atm4-firmware \
+ & Firmware-via_vt6656 \
+ & Firmware-wl1251 \
+ & Firmware-xc4000 \
+ & Firmware-xc5000 \
+ & Firmware-xc5000c \
+ & WHENCE \
+"
+
+LIC_FILES_CHKSUM = "\
+ file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
+ file://LICENCE.adsp_sst;md5=615c45b91a5a4a9fe046d6ab9a2df728 \
+ file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
+ file://LICENSE.amdgpu;md5=0aa3c2f3e736af320a08a3aeeccecf29 \
+ file://LICENSE.amd-ucode;md5=3a0de451253cc1edbf30a3c621effee3 \
+ file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
+ file://LICENSE.atmel;md5=aa74ac0c60595dee4d4e239107ea77a3 \
+ file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
+ file://LICENCE.ca0132;md5=209b33e66ee5be0461f13d31da392198 \
+ file://LICENCE.cavium;md5=c37aaffb1ebe5939b2580d073a95daea \
+ file://LICENCE.chelsio_firmware;md5=819aa8c3fa453f1b258ed8d168a9d903 \
+ file://LICENCE.cw1200;md5=f0f770864e7a8444a5c5aa9d12a3a7ed \
+ file://LICENSE.dib0700;md5=f7411825c8a555a1a3e5eab9ca773431 \
+ file://LICENCE.e100;md5=ec0f84136766df159a3ae6d02acdf5a8 \
+ file://LICENCE.ene_firmware;md5=ed67f0f62f8f798130c296720b7d3921 \
+ file://LICENCE.fw_sst_0f28;md5=6353931c988ad52818ae733ac61cd293 \
+ file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \
+ file://GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://LICENSE.hfi1_firmware;md5=5e7b6e586ce7339d12689e49931ad444 \
+ file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
+ file://LICENSE.i915;md5=2b0b2e0d20984affd4490ba2cba02570 \
+ file://LICENCE.ibt_firmware;md5=fdbee1ddfe0fb7ab0b2fcd6b454a366b \
+ file://LICENCE.IntcSST2;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+ file://LICENCE.it913x;md5=1fbf727bfb6a949810c4dbfa7e6ce4f8 \
+ file://LICENCE.iwlwifi_firmware;md5=3fd842911ea93c29cd32679aa23e1c88 \
+ file://LICENCE.kaweth;md5=b1d876e562f4b3b8d391ad8395dfe03f \
+ file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
+ file://LICENCE.moxa;md5=1086614767d8ccf744a923289d3d4261 \
+ file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+ file://LICENCE.Netronome;md5=4add08f2577086d44447996503cddf5f \
+ file://LICENCE.nvidia;md5=4428a922ed3ba2ceec95f076a488ce07 \
+ file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \
+ file://LICENCE.open-ath9k-htc-firmware;md5=1b33c9f4d17bc4d457bdb23727046837 \
+ file://LICENCE.phanfw;md5=954dcec0e051f9409812b561ea743bfa \
+ file://LICENCE.qat_firmware;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+ file://LICENSE.qcom;md5=164e3362a538eb11d3ac51e8e134294b \
+ file://LICENCE.qla1280;md5=d6895732e622d950609093223a2c4f5d \
+ file://LICENCE.qla2xxx;md5=505855e921b75f1be4a437ad9b79dff0 \
+ file://LICENSE.QualcommAtheros_ar3k;md5=b5fe244fb2b532311de1472a3bc06da5 \
+ file://LICENSE.QualcommAtheros_ath10k;md5=cb42b686ee5f5cb890275e4321db60a8 \
+ file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \
+ file://LICENSE.radeon;md5=68ec28bacb3613200bca44f404c69b16 \
+ file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \
+ file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
+ file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
+ file://LICENSE.sdma_firmware;md5=51e8c19ecc2270f4b8ea30341ad63ce9 \
+ file://LICENCE.siano;md5=4556c1bf830067f12ca151ad953ec2a5 \
+ file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \
+ file://LICENCE.ti-connectivity;md5=c5e02be633f1499c109d1652514d85ec \
+ file://LICENCE.ti-keystone;md5=3a86335d32864b0bef996bee26cc0f2c \
+ file://LICENCE.ueagle-atm4-firmware;md5=4ed7ea6b507ccc583b9d594417714118 \
+ file://LICENCE.via_vt6656;md5=e4159694cba42d4377a912e78a6e850f \
+ file://LICENCE.wl1251;md5=ad3f81922bb9e197014bb187289d3b5b \
+ file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
+ file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
+ file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
+ file://WHENCE;md5=6f46986f4e913ef16b765c2319cc5141 \
+"
+
+# These are not common licenses, set NO_GENERIC_LICENSE for them
+# so that the license files will be copied from fetched source
+NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENCE.Abilis"
+NO_GENERIC_LICENSE[Firmware-adsp_sst] = "LICENCE.adsp_sst"
+NO_GENERIC_LICENSE[Firmware-agere] = "LICENCE.agere"
+NO_GENERIC_LICENSE[Firmware-amdgpu] = "LICENSE.amdgpu"
+NO_GENERIC_LICENSE[Firmware-amd-ucode] = "LICENSE.amd-ucode"
+NO_GENERIC_LICENSE[Firmware-atheros_firmware] = "LICENCE.atheros_firmware"
+NO_GENERIC_LICENSE[Firmware-atmel] = "LICENSE.atmel"
+NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx] = "LICENCE.broadcom_bcm43xx"
+NO_GENERIC_LICENSE[Firmware-ca0132] = "LICENCE.ca0132"
+NO_GENERIC_LICENSE[Firmware-cavium] = "LICENCE.cavium"
+NO_GENERIC_LICENSE[Firmware-chelsio_firmware] = "LICENCE.chelsio_firmware"
+NO_GENERIC_LICENSE[Firmware-cw1200] = "LICENCE.cw1200"
+NO_GENERIC_LICENSE[Firmware-dib0700] = "LICENSE.dib0700"
+NO_GENERIC_LICENSE[Firmware-e100] = "LICENCE.e100"
+NO_GENERIC_LICENSE[Firmware-ene_firmware] = "LICENCE.ene_firmware"
+NO_GENERIC_LICENSE[Firmware-fw_sst_0f28] = "LICENCE.fw_sst_0f28"
+NO_GENERIC_LICENSE[Firmware-go7007] = "LICENCE.go7007"
+NO_GENERIC_LICENSE[Firmware-GPLv2] = "GPL-2"
+NO_GENERIC_LICENSE[Firmware-hfi1_firmware] = "LICENSE.hfi1_firmware"
+NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m"
+NO_GENERIC_LICENSE[Firmware-i915] = "LICENSE.i915"
+NO_GENERIC_LICENSE[Firmware-ibt_firmware] = "LICENCE.ibt_firmware"
+NO_GENERIC_LICENSE[Firmware-IntcSST2] = "LICENCE.IntcSST2"
+NO_GENERIC_LICENSE[Firmware-it913x] = "LICENCE.it913x"
+NO_GENERIC_LICENSE[Firmware-iwlwifi_firmware] = "LICENCE.iwlwifi_firmware"
+NO_GENERIC_LICENSE[Firmware-kaweth] = "LICENCE.kaweth"
+NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell"
+NO_GENERIC_LICENSE[Firmware-moxa] = "LICENCE.moxa"
+NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+NO_GENERIC_LICENSE[Firmware-netronome] = "LICENCE.Netronome"
+NO_GENERIC_LICENSE[Firmware-nvidia] = "LICENCE.nvidia"
+NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC"
+NO_GENERIC_LICENSE[Firmware-ath9k-htc] = "LICENCE.open-ath9k-htc-firmware"
+NO_GENERIC_LICENSE[Firmware-phanfw] = "LICENCE.phanfw"
+NO_GENERIC_LICENSE[Firmware-qat] = "LICENCE.qat_firmware"
+NO_GENERIC_LICENSE[Firmware-qcom] = "LICENSE.qcom"
+NO_GENERIC_LICENSE[Firmware-qla1280] = "LICENCE.qla1280"
+NO_GENERIC_LICENSE[Firmware-qla2xxx] = "LICENCE.qla2xxx"
+NO_GENERIC_LICENSE[Firmware-qualcommAthos_ar3k] = "LICENSE.QualcommAtheros_ar3k"
+NO_GENERIC_LICENSE[Firmware-qualcommAthos_ath10k] = "LICENSE.QualcommAtheros_ath10k"
+NO_GENERIC_LICENSE[Firmware-r8a779x_usb3] = "LICENCE.r8a779x_usb3"
+NO_GENERIC_LICENSE[Firmware-radeon] = "LICENSE.radeon"
+NO_GENERIC_LICENSE[Firmware-ralink_a_mediatek_company_firmware] = "LICENCE.ralink_a_mediatek_company_firmware"
+NO_GENERIC_LICENSE[Firmware-ralink-firmware] = "LICENCE.ralink-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-rtlwifi_firmware] = "LICENCE.rtlwifi_firmware.txt"
+NO_GENERIC_LICENSE[Firmware-siano] = "LICENCE.siano"
+NO_GENERIC_LICENSE[Firmware-imx-sdma_firmware] = "LICENSE.sdma_firmware"
+NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity"
+NO_GENERIC_LICENSE[Firmware-ti-keystone] = "LICENCE.ti-keystone"
+NO_GENERIC_LICENSE[Firmware-ueagle-atm4-firmware] = "LICENCE.ueagle-atm4-firmware"
+NO_GENERIC_LICENSE[Firmware-via_vt6656] = "LICENCE.via_vt6656"
+NO_GENERIC_LICENSE[Firmware-wl1251] = "LICENCE.wl1251"
+NO_GENERIC_LICENSE[Firmware-xc4000] = "LICENCE.xc4000"
+NO_GENERIC_LICENSE[Firmware-xc5000] = "LICENCE.xc5000"
+NO_GENERIC_LICENSE[Firmware-xc5000c] = "LICENCE.xc5000c"
+NO_GENERIC_LICENSE[WHENCE] = "WHENCE"
+
+SRCREV = "8fc2d4e55685bf73b6f7752383da9067404a74bb"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+CLEANBROKEN = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${nonarch_base_libdir}/firmware/
+ cp -r * ${D}${nonarch_base_libdir}/firmware/
+
+ # Avoid Makefile to be deployed
+ rm ${D}${nonarch_base_libdir}/firmware/Makefile
+
+ # Remove unbuild firmware which needs cmake and bash
+ rm ${D}${nonarch_base_libdir}/firmware/carl9170fw -rf
+
+ # Remove pointless bash script
+ rm ${D}${nonarch_base_libdir}/firmware/configure
+
+ # Remove python script used to check the WHENCE file
+ rm ${D}${nonarch_base_libdir}/firmware/check_whence.py
+
+ # Libertas sd8686
+ ln -sf libertas/sd8686_v9.bin ${D}${nonarch_base_libdir}/firmware/sd8686.bin
+ ln -sf libertas/sd8686_v9_helper.bin ${D}${nonarch_base_libdir}/firmware/sd8686_helper.bin
+
+ # fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
+ ( cd ${D}${nonarch_base_libdir}/firmware ; ln -sf ti-connectivity/* . )
+}
+
+
+PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
+ ${PN}-mt7601u-license ${PN}-mt7601u \
+ ${PN}-radeon-license ${PN}-radeon \
+ ${PN}-marvell-license ${PN}-pcie8897 ${PN}-pcie8997 \
+ ${PN}-sd8686 ${PN}-sd8688 ${PN}-sd8787 ${PN}-sd8797 ${PN}-sd8801 ${PN}-sd8887 ${PN}-sd8897 \
+ ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \
+ ${PN}-vt6656-license ${PN}-vt6656 \
+ ${PN}-rtl-license ${PN}-rtl8188 ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su ${PN}-rtl8723 ${PN}-rtl8821 \
+ ${PN}-broadcom-license \
+ ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 ${PN}-bcm43340 \
+ ${PN}-bcm43362 ${PN}-bcm4339 ${PN}-bcm43430 ${PN}-bcm4354 \
+ ${PN}-atheros-license ${PN}-ar9170 ${PN}-ath6k ${PN}-ath9k \
+ ${PN}-gplv2-license ${PN}-carl9170 \
+ ${PN}-ar3k-license ${PN}-ar3k ${PN}-ath10k-license ${PN}-ath10k ${PN}-qca \
+ \
+ ${PN}-imx-sdma-license ${PN}-imx-sdma-imx6q ${PN}-imx-sdma-imx7d \
+ \
+ ${PN}-iwlwifi-license ${PN}-iwlwifi \
+ ${PN}-iwlwifi-135-6 \
+ ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \
+ ${PN}-iwlwifi-3160-10 ${PN}-iwlwifi-3160-12 ${PN}-iwlwifi-3160-13 \
+ ${PN}-iwlwifi-3160-16 ${PN}-iwlwifi-3160-17 \
+ ${PN}-iwlwifi-6000-4 ${PN}-iwlwifi-6000g2a-5 ${PN}-iwlwifi-6000g2a-6 \
+ ${PN}-iwlwifi-6000g2b-5 ${PN}-iwlwifi-6000g2b-6 \
+ ${PN}-iwlwifi-6050-4 ${PN}-iwlwifi-6050-5 \
+ ${PN}-iwlwifi-7260 \
+ ${PN}-iwlwifi-7265 \
+ ${PN}-iwlwifi-7265d ${PN}-iwlwifi-8000c ${PN}-iwlwifi-8265 \
+ ${PN}-iwlwifi-9000 \
+ ${PN}-iwlwifi-misc \
+ ${PN}-ibt-license ${PN}-ibt ${PN}-ibt-misc \
+ ${PN}-ibt-11-5 ${PN}-ibt-12-16 ${PN}-ibt-hw-37-7 ${PN}-ibt-hw-37-8 \
+ ${PN}-ibt-17 \
+ ${PN}-i915-license ${PN}-i915 \
+ ${PN}-adsp-sst-license ${PN}-adsp-sst \
+ ${PN}-bnx2-mips \
+ ${PN}-netronome-license ${PN}-netronome \
+ ${PN}-qat ${PN}-qat-license \
+ ${PN}-qcom-license \
+ ${PN}-qcom-venus-1.8 ${PN}-qcom-venus-4.2 \
+ ${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a530 \
+ ${PN}-whence-license \
+ ${PN}-license \
+ "
+
+# For atheros
+LICENSE_${PN}-ar9170 = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
+LICENSE_${PN}-atheros-license = "Firmware-atheros_firmware"
+
+FILES_${PN}-atheros-license = "${nonarch_base_libdir}/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-ar9170 = " \
+ ${nonarch_base_libdir}/firmware/ar9170*.fw \
+"
+FILES_${PN}-ath6k = " \
+ ${nonarch_base_libdir}/firmware/ath6k \
+"
+FILES_${PN}-ath9k = " \
+ ${nonarch_base_libdir}/firmware/ar9271.fw \
+ ${nonarch_base_libdir}/firmware/ar7010*.fw \
+ ${nonarch_base_libdir}/firmware/htc_9271.fw \
+ ${nonarch_base_libdir}/firmware/htc_7010.fw \
+ ${nonarch_base_libdir}/firmware/ath9k_htc/htc_7010-1.4.0.fw \
+ ${nonarch_base_libdir}/firmware/ath9k_htc/htc_9271-1.4.0.fw \
+"
+
+RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
+
+# For carl9170
+LICENSE_${PN}-carl9170 = "Firmware-GPLv2"
+LICENSE_${PN}-gplv2-license = "Firmware-GPLv2"
+
+FILES_${PN}-gplv2-license = "${nonarch_base_libdir}/firmware/GPL-2"
+FILES_${PN}-carl9170 = " \
+ ${nonarch_base_libdir}/firmware/carl9170*.fw \
+"
+
+RDEPENDS_${PN}-carl9170 += "${PN}-gplv2-license"
+
+# For QualCommAthos
+LICENSE_${PN}-ar3k = "Firmware-qualcommAthos_ar3k"
+LICENSE_${PN}-ar3k-license = "Firmware-qualcommAthos_ar3k"
+LICENSE_${PN}-ath10k = "Firmware-qualcommAthos_ath10k"
+LICENSE_${PN}-ath10k-license = "Firmware-qualcommAthos_ath10k"
+LICENSE_${PN}-qca = "Firmware-qualcommAthos_ath10k"
+
+FILES_${PN}-ar3k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ar3k"
+FILES_${PN}-ar3k = " \
+ ${nonarch_base_libdir}/firmware/ar3k \
+"
+
+FILES_${PN}-ath10k-license = "${nonarch_base_libdir}/firmware/LICENSE.QualcommAtheros_ath10k"
+FILES_${PN}-ath10k = " \
+ ${nonarch_base_libdir}/firmware/ath10k \
+"
+
+FILES_${PN}-qca = " \
+ ${nonarch_base_libdir}/firmware/qca \
+"
+
+RDEPENDS_${PN}-ar3k += "${PN}-ar3k-license"
+RDEPENDS_${PN}-ath10k += "${PN}-ath10k-license"
+RDEPENDS_${PN}-qca += "${PN}-ath10k-license"
+
+# For ralink
+LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
+LICENSE_${PN}-ralink-license = "Firmware-ralink-firmware"
+
+FILES_${PN}-ralink-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink = " \
+ ${nonarch_base_libdir}/firmware/rt*.bin \
+"
+
+RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
+
+# For mediatek MT7601U
+LICENSE_${PN}-mt7601u = "Firmware-ralink_a_mediatek_company_firmware"
+LICENSE_${PN}-mt7601u-license = "Firmware-ralink_a_mediatek_company_firmware"
+
+FILES_${PN}-mt7601u-license = "${nonarch_base_libdir}/firmware/LICENCE.ralink_a_mediatek_company_firmware"
+FILES_${PN}-mt7601u = " \
+ ${nonarch_base_libdir}/firmware/mt7601u.bin \
+"
+
+RDEPENDS_${PN}-mt7601u += "${PN}-mt7601u-license"
+
+# For radeon
+LICENSE_${PN}-radeon = "Firmware-radeon"
+LICENSE_${PN}-radeon-license = "Firmware-radeon"
+
+FILES_${PN}-radeon-license = "${nonarch_base_libdir}/firmware/LICENSE.radeon"
+FILES_${PN}-radeon = " \
+ ${nonarch_base_libdir}/firmware/radeon \
+"
+
+RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
+
+# For marvell
+LICENSE_${PN}-pcie8897 = "Firmware-Marvell"
+LICENSE_${PN}-pcie8997 = "Firmware-Marvell"
+LICENSE_${PN}-sd8686 = "Firmware-Marvell"
+LICENSE_${PN}-sd8688 = "Firmware-Marvell"
+LICENSE_${PN}-sd8787 = "Firmware-Marvell"
+LICENSE_${PN}-sd8797 = "Firmware-Marvell"
+LICENSE_${PN}-sd8801 = "Firmware-Marvell"
+LICENSE_${PN}-sd8887 = "Firmware-Marvell"
+LICENSE_${PN}-sd8897 = "Firmware-Marvell"
+LICENSE_${PN}-marvell-license = "Firmware-Marvell"
+
+FILES_${PN}-marvell-license = "${nonarch_base_libdir}/firmware/LICENCE.Marvell"
+FILES_${PN}-pcie8897 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/pcie8897_uapsta.bin \
+"
+FILES_${PN}-pcie8997 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/pcie8997_wlan_v4.bin \
+ ${nonarch_base_libdir}/firmware/mrvl/pcieuart8997_combo_v4.bin \
+ ${nonarch_base_libdir}/firmware/mrvl/pcieusb8997_combo_v4.bin \
+"
+FILES_${PN}-sd8686 = " \
+ ${nonarch_base_libdir}/firmware/libertas/sd8686_v9* \
+ ${nonarch_base_libdir}/firmware/sd8686* \
+"
+FILES_${PN}-sd8688 = " \
+ ${nonarch_base_libdir}/firmware/libertas/sd8688* \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8688* \
+"
+FILES_${PN}-sd8787 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8787_uapsta.bin \
+"
+FILES_${PN}-sd8797 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8797_uapsta.bin \
+"
+FILES_${PN}-sd8801 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8801_uapsta.bin \
+"
+FILES_${PN}-sd8887 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8887_uapsta.bin \
+"
+FILES_${PN}-sd8897 = " \
+ ${nonarch_base_libdir}/firmware/mrvl/sd8897_uapsta.bin \
+"
+
+RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8688 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8801 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8887 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8897 += "${PN}-marvell-license"
+
+# For netronome
+LICENSE_${PN}-netronome = "Firmware-netronome"
+
+FILES_${PN}-netronome-license = " \
+ ${nonarch_base_libdir}/firmware/LICENCE.Netronome \
+"
+FILES_${PN}-netronome = " \
+ ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0081*.nffw \
+ ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0096*.nffw \
+ ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0097*.nffw \
+ ${nonarch_base_libdir}/firmware/netronome/nic_AMDA0099*.nffw \
+"
+
+RDEPENDS_${PN}-netronome += "${PN}-netronome-license"
+
+# For rtl
+LICENSE_${PN}-rtl8188 = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8723 = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8821 = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl-license = "Firmware-rtlwifi_firmware"
+
+FILES_${PN}-rtl-license = " \
+ ${nonarch_base_libdir}/firmware/LICENCE.rtlwifi_firmware.txt \
+"
+FILES_${PN}-rtl8188 = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8188*.bin \
+"
+FILES_${PN}-rtl8192cu = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cufw*.bin \
+"
+FILES_${PN}-rtl8192ce = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8192cfw*.bin \
+"
+FILES_${PN}-rtl8192su = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8712u.bin \
+"
+FILES_${PN}-rtl8723 = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8723*.bin \
+"
+FILES_${PN}-rtl8821 = " \
+ ${nonarch_base_libdir}/firmware/rtlwifi/rtl8821*.bin \
+"
+
+RDEPENDS_${PN}-rtl8188 += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8723 += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8821 += "${PN}-rtl-license"
+
+# For ti-connectivity
+LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
+LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
+LICENSE_${PN}-ti-connectivity-license = "Firmware-ti-connectivity"
+
+FILES_${PN}-ti-connectivity-license = "${nonarch_base_libdir}/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-wl12xx = " \
+ ${nonarch_base_libdir}/firmware/wl12* \
+ ${nonarch_base_libdir}/firmware/TI* \
+ ${nonarch_base_libdir}/firmware/ti-connectivity \
+"
+FILES_${PN}-wl18xx = " \
+ ${nonarch_base_libdir}/firmware/wl18* \
+ ${nonarch_base_libdir}/firmware/TI* \
+ ${nonarch_base_libdir}/firmware/ti-connectivity \
+"
+
+RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
+RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
+
+# For vt6656
+LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
+LICENSE_${PN}-vt6656-license = "Firmware-via_vt6656"
+
+FILES_${PN}-vt6656-license = "${nonarch_base_libdir}/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656 = " \
+ ${nonarch_base_libdir}/firmware/vntwusb.fw \
+"
+
+RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
+
+# For broadcom
+
+LICENSE_${PN}-bcm4329 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4330 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm43340 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm43362 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4339 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm43430 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4354 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-broadcom-license = "Firmware-broadcom_bcm43xx"
+
+FILES_${PN}-broadcom-license = " \
+ ${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx \
+"
+FILES_${PN}-bcm4329 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac4329-sdio.bin \
+"
+FILES_${PN}-bcm4330 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac4330-sdio.bin \
+"
+FILES_${PN}-bcm4334 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac4334-sdio.bin \
+"
+FILES_${PN}-bcm43340 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac43340-sdio.bin \
+"
+FILES_${PN}-bcm43362 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac43362-sdio.bin \
+"
+FILES_${PN}-bcm4339 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac4339-sdio.bin \
+"
+FILES_${PN}-bcm43430 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.bin \
+"
+FILES_${PN}-bcm4354 = " \
+ ${nonarch_base_libdir}/firmware/brcm/brcmfmac4354-sdio.bin \
+"
+
+RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm43340 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm43362 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4339 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm43430 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4354 += "${PN}-broadcom-license"
+
+# For Broadcom bnx2-mips
+#
+# which is a separate case to the other Broadcom firmwares since its
+# license is contained in the shared WHENCE file.
+
+LICENSE_${PN}-bnx2-mips = "WHENCE"
+LICENSE_${PN}-whence-license = "WHENCE"
+
+FILES_${PN}-bnx2-mips = "${nonarch_base_libdir}/firmware/bnx2/bnx2-mips-09-6.2.1b.fw"
+FILES_${PN}-whence-license = "${nonarch_base_libdir}/firmware/WHENCE"
+
+RDEPENDS_${PN}-bnx2-mips += "${PN}-whence-license"
+
+# For imx-sdma
+LICENSE_${PN}-imx-sdma-imx6q = "Firmware-imx-sdma_firmware"
+LICENSE_${PN}-imx-sdma-imx7d = "Firmware-imx-sdma_firmware"
+LICENSE_${PN}-imx-sdma-license = "Firmware-imx-sdma_firmware"
+
+FILES_${PN}-imx-sdma-imx6q = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx6q.bin"
+
+RPROVIDES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+RREPLACES_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+RCONFLICTS_${PN}-imx-sdma-imx6q = "firmware-imx-sdma-imx6q"
+
+FILES_${PN}-imx-sdma-imx7d = "${nonarch_base_libdir}/firmware/imx/sdma/sdma-imx7d.bin"
+
+FILES_${PN}-imx-sdma-license = "${nonarch_base_libdir}/firmware/LICENSE.sdma_firmware"
+
+RDEPENDS_${PN}-imx-sdma-imx6q += "${PN}-imx-sdma-license"
+RDEPENDS_${PN}-imx-sdma-imx7d += "${PN}-imx-sdma-license"
+
+# For iwlwifi
+LICENSE_${PN}-iwlwifi = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-135-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-7 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-8 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-9 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-10 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-12 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-13 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-16 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-17 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000-4 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2b-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2b-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-4 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265d = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-8000c = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-8265 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-9000 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-misc = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-license = "Firmware-iwlwifi_firmware"
+
+
+FILES_${PN}-iwlwifi-license = "${nonarch_base_libdir}/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "${nonarch_base_libdir}/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-3160-10 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-10.ucode"
+FILES_${PN}-iwlwifi-3160-12 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-12.ucode"
+FILES_${PN}-iwlwifi-3160-13 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-13.ucode"
+FILES_${PN}-iwlwifi-3160-16 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-16.ucode"
+FILES_${PN}-iwlwifi-3160-17 = "${nonarch_base_libdir}/firmware/iwlwifi-3160-17.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "${nonarch_base_libdir}/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "${nonarch_base_libdir}/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260 = "${nonarch_base_libdir}/firmware/iwlwifi-7260-*.ucode"
+FILES_${PN}-iwlwifi-7265 = "${nonarch_base_libdir}/firmware/iwlwifi-7265-*.ucode"
+FILES_${PN}-iwlwifi-7265d = "${nonarch_base_libdir}/firmware/iwlwifi-7265D-*.ucode"
+FILES_${PN}-iwlwifi-8000c = "${nonarch_base_libdir}/firmware/iwlwifi-8000C-*.ucode"
+FILES_${PN}-iwlwifi-8265 = "${nonarch_base_libdir}/firmware/iwlwifi-8265-*.ucode"
+FILES_${PN}-iwlwifi-9000 = "${nonarch_base_libdir}/firmware/iwlwifi-9000-*.ucode"
+FILES_${PN}-iwlwifi-misc = "${nonarch_base_libdir}/firmware/iwlwifi-*.ucode"
+
+RDEPENDS_${PN}-iwlwifi-135-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-7 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-8 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-9 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-10 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-12 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-13 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-16 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-17 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000-4 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2b-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2b-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-4 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265d = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-8000c = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-8265 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-9000 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-misc = "${PN}-iwlwifi-license"
+
+# -iwlwifi-misc is a "catch all" package that includes all the iwlwifi
+# firmwares that are not already included in other -iwlwifi- packages.
+# -iwlwifi is a virtual package that depends upon all iwlwifi packages.
+# These are distinct in order to allow the -misc firmwares to be installed
+# without pulling in every other iwlwifi package.
+ALLOW_EMPTY_${PN}-iwlwifi = "1"
+ALLOW_EMPTY_${PN}-iwlwifi-misc = "1"
+
+# Handle package updating for the newly merged iwlwifi groupings
+RPROVIDES_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9"
+RREPLACES_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9"
+RCONFLICTS_${PN}-iwlwifi-7265 = "${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9"
+
+RPROVIDES_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9"
+RREPLACES_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9"
+RCONFLICTS_${PN}-iwlwifi-7260 = "${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9"
+
+# For ibt
+LICENSE_${PN}-ibt-license = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-hw-37-7 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-hw-37-8 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-11-5 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-12-16 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-17 = "Firmware-ibt_firmware"
+LICENSE_${PN}-ibt-misc = "Firmware-ibt_firmware"
+
+FILES_${PN}-ibt-license = "${nonarch_base_libdir}/firmware/LICENCE.ibt_firmware"
+FILES_${PN}-ibt-hw-37-7 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.7*.bseq"
+FILES_${PN}-ibt-hw-37-8 = "${nonarch_base_libdir}/firmware/intel/ibt-hw-37.8*.bseq"
+FILES_${PN}-ibt-11-5 = "${nonarch_base_libdir}/firmware/intel/ibt-11-5.sfi /lib/firmware/intel/ibt-11-5.ddc"
+FILES_${PN}-ibt-12-16 = "${nonarch_base_libdir}/firmware/intel/ibt-12-16.sfi /lib/firmware/intel/ibt-12-16.ddc"
+FILES_${PN}-ibt-17 = "${nonarch_base_libdir}/firmware/intel/ibt-17-*.sfi /lib/firmware/intel/ibt-17-*.ddc"
+FILES_${PN}-ibt-misc = "${nonarch_base_libdir}/firmware/ibt-*"
+
+RDEPENDS_${PN}-ibt-hw-37-7 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-hw-37.8 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-11-5 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-12-16 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-17 = "${PN}-ibt-license"
+RDEPENDS_${PN}-ibt-misc = "${PN}-ibt-license"
+
+ALLOW_EMPTY_${PN}-ibt= "1"
+ALLOW_EMPTY_${PN}-ibt-misc = "1"
+
+LICENSE_${PN}-i915 = "Firmware-i915"
+LICENSE_${PN}-i915-license = "Firmware-i915"
+FILES_${PN}-i915-license = "${nonarch_base_libdir}/firmware/LICENSE.i915"
+FILES_${PN}-i915 = "${nonarch_base_libdir}/firmware/i915"
+RDEPENDS_${PN}-i915 = "${PN}-i915-license"
+
+FILES_${PN}-adsp-sst-license = "${nonarch_base_libdir}/firmware/LICENCE.adsp_sst"
+LICENSE_${PN}-adsp-sst = "Firmware-adsp_sst"
+LICENSE_${PN}-adsp-sst-license = "Firmware-adsp_sst"
+FILES_${PN}-adsp-sst = "${nonarch_base_libdir}/firmware/intel/dsp_fw*"
+RDEPENDS_${PN}-adsp-sst = "${PN}-adsp-sst-license"
+
+# For QAT
+LICENSE_${PN}-qat = "Firmware-qat"
+LICENSE_${PN}-qat-license = "Firmware-qat"
+FILES_${PN}-qat-license = "${nonarch_base_libdir}/firmware/LICENCE.qat_firmware"
+FILES_${PN}-qat = "${nonarch_base_libdir}/firmware/qat*.bin"
+RDEPENDS_${PN}-qat = "${PN}-qat-license"
+
+# For QCOM VPU/GPU
+LICENSE_${PN}-qcom-license = "Firmware-qcom"
+FILES_${PN}-qcom-license = "${nonarch_base_libdir}/firmware/LICENSE.qcom ${nonarch_base_libdir}/firmware/qcom/NOTICE.txt"
+FILES_${PN}-qcom-venus-1.8 = "${nonarch_base_libdir}/firmware/qcom/venus-1.8/*"
+FILES_${PN}-qcom-venus-4.2 = "${nonarch_base_libdir}/firmware/qcom/venus-4.2/*"
+FILES_${PN}-qcom-adreno-a3xx = "${nonarch_base_libdir}/firmware/qcom/a300_*.fw ${nonarch_base_libdir}/firmware/a300_*.fw"
+FILES_${PN}-qcom-adreno-a530 = "${nonarch_base_libdir}/firmware/qcom/a530*.*"
+RDEPENDS_${PN}-qcom-venus-1.8 = "${PN}-qcom-license"
+RDEPENDS_${PN}-qcom-venus-4.2 = "${PN}-qcom-license"
+RDEPENDS_${PN}-qcom-adreno-a3xx = "${PN}-qcom-license"
+RDEPENDS_${PN}-qcom-adreno-a530 = "${PN}-qcom-license"
+
+# For other firmwares
+# Maybe split out to separate packages when needed.
+LICENSE_${PN} = "\
+ Firmware-Abilis \
+ & Firmware-agere \
+ & Firmware-amdgpu \
+ & Firmware-amd-ucode \
+ & Firmware-atmel \
+ & Firmware-ca0132 \
+ & Firmware-cavium \
+ & Firmware-chelsio_firmware \
+ & Firmware-cw1200 \
+ & Firmware-dib0700 \
+ & Firmware-e100 \
+ & Firmware-ene_firmware \
+ & Firmware-fw_sst_0f28 \
+ & Firmware-go7007 \
+ & Firmware-hfi1_firmware \
+ & Firmware-i2400m \
+ & Firmware-ibt_firmware \
+ & Firmware-it913x \
+ & Firmware-IntcSST2 \
+ & Firmware-kaweth \
+ & Firmware-moxa \
+ & Firmware-myri10ge_firmware \
+ & Firmware-nvidia \
+ & Firmware-OLPC \
+ & Firmware-ath9k-htc \
+ & Firmware-phanfw \
+ & Firmware-qat \
+ & Firmware-qcom \
+ & Firmware-qla1280 \
+ & Firmware-qla2xxx \
+ & Firmware-r8a779x_usb3 \
+ & Firmware-radeon \
+ & Firmware-ralink_a_mediatek_company_firmware \
+ & Firmware-ralink-firmware \
+ & Firmware-imx-sdma_firmware \
+ & Firmware-siano \
+ & Firmware-tda7706-firmware \
+ & Firmware-ti-connectivity \
+ & Firmware-ti-keystone \
+ & Firmware-ueagle-atm4-firmware \
+ & Firmware-wl1251 \
+ & Firmware-xc4000 \
+ & Firmware-xc5000 \
+ & Firmware-xc5000c \
+ & WHENCE \
+"
+
+FILES_${PN}-license += "${nonarch_base_libdir}/firmware/LICEN*"
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
+RDEPENDS_${PN} += "${PN}-license"
+RDEPENDS_${PN} += "${PN}-whence-license"
+
+# Make linux-firmware depend on all of the split-out packages.
+# Make linux-firmware-iwlwifi depend on all of the split-out iwlwifi packages.
+# Make linux-firmware-ibt depend on all of the split-out ibt packages.
+python populate_packages_prepend () {
+ firmware_pkgs = oe.utils.packages_filter_out_system(d)
+ d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
+
+ iwlwifi_pkgs = filter(lambda x: x.find('-iwlwifi-') != -1, firmware_pkgs)
+ d.appendVar('RDEPENDS_linux-firmware-iwlwifi', ' ' + ' '.join(iwlwifi_pkgs))
+
+ ibt_pkgs = filter(lambda x: x.find('-ibt-') != -1, firmware_pkgs)
+ d.appendVar('RDEPENDS_linux-firmware-ibt', ' ' + ' '.join(ibt_pkgs))
+}
+
+# Firmware files are generally not ran on the CPU, so they can be
+# allarch despite being architecture specific
+INSANE_SKIP = "arch"
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
new file mode 100644
index 000000000..9903c06c2
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -0,0 +1,91 @@
+SUMMARY = "Sanitized set of kernel headers for the C library's use"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+#########################################################################
+#### PLEASE READ
+#########################################################################
+#
+# You're probably looking here thinking you need to create some new copy
+# of linux-libc-headers since you have your own custom kernel. To put
+# this simply, you DO NOT.
+#
+# Why? These headers are used to build the libc. If you customise the
+# headers you are customising the libc and the libc becomes machine
+# specific. Most people do not add custom libc extensions to the kernel
+# and have a machine specific libc.
+#
+# But you have some kernel headers you need for some driver? That is fine
+# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
+# This will make the package using them machine specific but this is much
+# better than having a machine specific C library. This does mean your
+# recipe needs a
+# do_configure[depends] += "virtual/kernel:do_shared_workdir"
+# but again, that is fine and makes total sense.
+#
+# There can also be a case where your kernel extremely old and you want
+# an older libc ABI for that old kernel. The headers installed by this
+# recipe should still be a standard mainline kernel, not your own custom
+# one.
+#
+# -- RP
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+python __anonymous () {
+ major = d.getVar("PV").split('.')[0]
+ if major == "3":
+ d.setVar("HEADER_FETCH_VER", "3.0")
+ elif major == "4":
+ d.setVar("HEADER_FETCH_VER", "4.x")
+ else:
+ d.setVar("HEADER_FETCH_VER", "2.6")
+}
+
+inherit kernel-arch pkgconfig multilib_header
+
+KORG_ARCHIVE_COMPRESSION ?= "xz"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+UPSTREAM_CHECK_URI = "https://www.kernel.org/"
+
+S = "${WORKDIR}/linux-${PV}"
+
+EXTRA_OEMAKE = " HOSTCC="${BUILD_CC}" HOSTCPP="${BUILD_CPP}""
+
+do_configure() {
+ oe_runmake allnoconfig
+}
+
+do_compile () {
+}
+
+do_install() {
+ oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}
+ # Kernel should not be exporting this header
+ rm -f ${D}${exec_prefix}/include/scsi/scsi.h
+
+ # The ..install.cmd conflicts between various configure runs
+ find ${D}${includedir} -name ..install.cmd | xargs rm -f
+}
+
+do_install_append_aarch64 () {
+ do_install_armmultilib
+}
+
+do_install_append_arm () {
+ do_install_armmultilib
+}
+
+do_install_armmultilib () {
+ oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/kvm_para.h asm/mman.h asm/param.h asm/perf_regs.h asm/bpf_perf_event.h
+ oe_multilib_header asm/posix_types.h asm/ptrace.h asm/setup.h asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h asm/statfs.h asm/swab.h asm/types.h asm/unistd.h
+}
+
+BBCLASSEXTEND = "nativesdk"
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS += "unifdef-native"
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch
new file mode 100644
index 000000000..68b244698
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch
@@ -0,0 +1,31 @@
+From 897736166fd709906a5fdf16eb23f8fddff770b5 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Thu, 1 Mar 2018 18:31:01 -0500
+Subject: [PATCH] if_ether: move muslc ethhdr protection to uapi file
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+Upstream-Status: Pending
+---
+ include/uapi/linux/if_ether.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
+index 153c9c2..7b69b73 100644
+--- a/include/uapi/linux/if_ether.h
++++ b/include/uapi/linux/if_ether.h
+@@ -149,6 +149,12 @@
+ * This is an Ethernet frame header.
+ */
+
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
+ /* allow libcs like musl to deactivate this, glibc does not implement this. */
+ #ifndef __UAPI_DEF_ETHHDR
+ #define __UAPI_DEF_ETHHDR 1
+--
+2.7.4
+
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
new file mode 100644
index 000000000..064a39193
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch
@@ -0,0 +1,90 @@
+From 2872f5d8bcef84e62b15b37ba4ffeccfb6402dad Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:48:28 +0100
+Subject: [PATCH 1/3] libc-compat.h: fix some issues arising from in6.h
+
+namely redefinition of some structs provided by netinet/in.h.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/libc-compat.h | 25 ++++++++-----------------
+ 1 file changed, 8 insertions(+), 17 deletions(-)
+
+Index: linux-4.15/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.15.orig/include/uapi/linux/libc-compat.h 2018-02-05 17:37:44.724314379 -0500
++++ linux-4.15/include/uapi/linux/libc-compat.h 2018-02-05 17:38:02.148913820 -0500
+@@ -49,13 +49,12 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#ifndef __KERNEL__ /* we're used from userspace */
+
+-/* Coordinate with glibc net/if.h header. */
+-#if defined(_NET_IF_H) && defined(__USE_MISC)
++/* Coordinate with libc net/if.h header. */
++#if defined(_NET_IF_H)
+
+-/* GLIBC headers included first so don't define anything
++/* LIBC headers included first so don't define anything
+ * that would already be defined. */
+
+ #define __UAPI_DEF_IF_IFCONF 0
+@@ -99,15 +98,7 @@
+ #define __UAPI_DEF_IN_CLASS 0
+
+ #define __UAPI_DEF_IN6_ADDR 0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT 0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT 1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6 0
+ #define __UAPI_DEF_IPV6_MREQ 0
+ #define __UAPI_DEF_IPPROTO_V6 0
+@@ -115,10 +106,10 @@
+ #define __UAPI_DEF_IN6_PKTINFO 0
+ #define __UAPI_DEF_IP6_MTUINFO 0
+
+-#else
++#else /* defined(_NETINET_IN_H) */
+
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that libc will check the
+ * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN_ADDR 1
+ #define __UAPI_DEF_IN_IPPROTO 1
+@@ -128,7 +119,7 @@
+ #define __UAPI_DEF_IN_CLASS 1
+
+ #define __UAPI_DEF_IN6_ADDR 1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and libc must
+ * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT 1
+ #define __UAPI_DEF_SOCKADDR_IN6 1
+@@ -170,7 +161,7 @@
+ * or we are being included in the kernel, then define everything
+ * that we need. Check for previous __UAPI_* definitions to give
+ * unsupported C libraries a way to opt out of any kernel definition. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+
+ /* Definitions for if.h */
+ #ifndef __UAPI_DEF_IF_IFCONF
+@@ -262,6 +253,6 @@
+ #define __UAPI_DEF_XATTR 1
+ #endif
+
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch
new file mode 100644
index 000000000..bde2132eb
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch
@@ -0,0 +1,46 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/3] uapi glibc compat: fix build if libc defines IFF_ECHO
+From: Hauke Mehrtens <hauke@hauke-m.de>
+X-Patchwork-Id: 9686293
+Message-Id: <20170418210036.26039-3-hauke@hauke-m.de>
+To: davem@davemloft.net, netdev@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, jarod@redhat.com, jogo@openwrt.org,
+ david.heidelberger@ixit.cz, maillist-linux@barfooze.de,
+ mikko.rapeli@iki.fi, dwmw2@infradead.org, Hauke Mehrtens <hauke@hauke-m.de>
+Date: Tue, 18 Apr 2017 23:00:35 +0200
+
+musl 1.1.15 defines IFF_ECHO and the other net_device_flags options.
+When a user application includes linux/if.h and net/if.h the compile
+will fail.
+
+Activate __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO only when
+it is needed. This should also make this work in case glibc will add
+these defines.
+
+Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi>
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+Upstream-Status: Submitted [https://patchwork.kernel.org/patch/9686293/]
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+Acked-by: Stephane Ayotte <sayotte@tycoint.com>
+ include/uapi/linux/libc-compat.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
+index 43a81136ea6e..ce2fa8a4ced6 100644
+--- a/include/uapi/linux/libc-compat.h
++++ b/include/uapi/linux/libc-compat.h
+@@ -64,9 +64,11 @@
+ /* Everything up to IFF_DYNAMIC, matches net/if.h until glibc 2.23 */
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0
+ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */
++#ifndef IFF_ECHO
+ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1
+ #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
++#endif /* IFF_ECHO */
+
+ #else /* _NET_IF_H */
+
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 000000000..fb7e1de17
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,30 @@
+From 75ba4a547282f91d653872a4bba5f5eae234ea6c Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Wed, 22 Jan 2014 00:57:48 +0100
+Subject: [PATCH 2/3] libc-compat.h: prevent redefinition of struct ethhdr
+
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/if_ether.h | 4 +++-
+ include/uapi/linux/libc-compat.h | 6 ++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+Index: linux-4.15/include/uapi/linux/libc-compat.h
+===================================================================
+--- linux-4.15.orig/include/uapi/linux/libc-compat.h 2018-02-05 17:40:42.338370731 -0500
++++ linux-4.15/include/uapi/linux/libc-compat.h 2018-02-05 17:40:42.334370603 -0500
+@@ -51,6 +51,12 @@
+
+ #ifndef __KERNEL__ /* we're used from userspace */
+
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
+ /* Coordinate with libc net/if.h header. */
+ #if defined(_NET_IF_H)
+
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 000000000..b5c4e1750
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,29 @@
+From 8e69b663d6ddef132041a1186f081fdd74d4a31d Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Mon, 20 Jan 2014 21:31:34 +0100
+Subject: [PATCH 3/3] remove inclusion of sysinfo.h in kernel.h
+
+the declaration of struct sysinfo clashes with userspace.
+it's not quite clear why that header was included from kernel.h,
+as none of its functionality is needed.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Submitted
+
+ include/uapi/linux/kernel.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+Index: linux-4.8-rc4/include/uapi/linux/kernel.h
+===================================================================
+--- linux-4.8-rc4.orig/include/uapi/linux/kernel.h
++++ linux-4.8-rc4/include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+
+ /*
+ * 'kernel.h' contains some often-used function prototypes etc
diff --git a/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb
new file mode 100644
index 000000000..a7db4c9c0
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.15.7.bb
@@ -0,0 +1,13 @@
+require linux-libc-headers.inc
+
+SRC_URI_append_libc-musl = "\
+ file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
+ file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
+ file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
+ file://0001-libc-compat.h-musl-_does_-define-IFF_LOWER_UP-DORMAN.patch \
+ file://0001-if_ether-move-muslc-ethhdr-protection-to-uapi-file.patch \
+ "
+
+
+SRC_URI[md5sum] = "8186ce63c489199b58b6a58ad2a24a94"
+SRC_URI[sha256sum] = "cd44df4b23a3e0edc14be63df95d768b9600b31c35be05fb89f93226907fc8c6"
diff --git a/poky/meta/recipes-kernel/linux/kernel-devsrc.bb b/poky/meta/recipes-kernel/linux/kernel-devsrc.bb
new file mode 100644
index 000000000..8bbfa23e4
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -0,0 +1,86 @@
+SUMMARY = "Linux kernel Development Source"
+DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \
+source of the preferred virtual/kernel provider and makes it available for full kernel \
+development or external module builds"
+
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+
+inherit linux-kernel-base
+
+# Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
+inherit module-base
+
+# We need the kernel to be staged (unpacked, patched and configured) before
+# we can grab the source and make the source package. We also need the bits from
+# ${B} not to change while we install, so virtual/kernel must finish do_compile.
+do_install[depends] += "virtual/kernel:do_shared_workdir"
+# Need the source, not just the output of populate_sysroot
+do_install[depends] += "virtual/kernel:do_install"
+
+# There's nothing to do here, except install the source where we can package it
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+S = "${STAGING_KERNEL_DIR}"
+B = "${STAGING_KERNEL_BUILDDIR}"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+ kerneldir=${D}${KERNEL_SRC_PATH}
+ install -d $kerneldir
+
+ #
+ # Copy the staging dir source (and module build support) into the devsrc structure.
+ # We can keep this copy simple and take everything, since a we'll clean up any build
+ # artifacts afterwards, and the extra i/o is not significant
+ #
+ cd ${B}
+ find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+ cd ${S}
+ find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+
+ # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
+ # The main build artifacts. We clean the directory to avoid QA errors on mismatched
+ # architecture (since scripts and helpers are native format).
+ KBUILD_OUTPUT="$kerneldir"
+ oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
+ # make clean generates an absolute path symlink called "source"
+ # in $kerneldir points to $kerneldir, which doesn't make any
+ # sense, so remove it.
+ if [ -L $kerneldir/source ]; then
+ bbnote "Removing $kerneldir/source symlink"
+ rm -f $kerneldir/source
+ fi
+
+ # As of Linux kernel version 3.0.1, the clean target removes
+ # arch/powerpc/lib/crtsavres.o which is present in
+ # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+ if [ ${ARCH} = "powerpc" ]; then
+ mkdir -p $kerneldir/arch/powerpc/lib/
+ cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+ fi
+
+ # Remove fixdep/objtool as they won't be target binaries
+ for i in fixdep objtool; do
+ if [ -e $kerneldir/tools/objtool/$i ]; then
+ rm -rf $kerneldir/tools/objtool/$i
+ fi
+ done
+
+ chown -R root:root ${D}
+}
+# Ensure we don't race against "make scripts" during cpio
+do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
+
+PACKAGES = "kernel-devsrc"
+FILES_${PN} = "${KERNEL_SRC_PATH}"
+RDEPENDS_${PN} = "bc"
diff --git a/poky/meta/recipes-kernel/linux/linux-dtb.inc b/poky/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 000000000..f1912775c
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,3 @@
+python() {
+ bb.warn("You are using the linux-dtb.inc which is deprecated. You can safely remove it as the Device Tree support is automatically enabled when KERNEL_DEVICETREE is set.")
+}
diff --git a/poky/meta/recipes-kernel/linux/linux-dummy.bb b/poky/meta/recipes-kernel/linux/linux-dummy.bb
new file mode 100644
index 000000000..e1c7f7676
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-dummy.bb
@@ -0,0 +1,60 @@
+SUMMARY = "Dummy Linux kernel"
+DESCRIPTION = "Dummy Linux kernel, to be selected as the preferred \
+provider for virtual/kernel to satisfy dependencies for situations \
+where you wish to build the kernel externally from the build system."
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+PROVIDES += "virtual/kernel"
+
+PACKAGES_DYNAMIC += "^kernel-module-.*"
+PACKAGES_DYNAMIC += "^kernel-image-.*"
+PACKAGES_DYNAMIC += "^kernel-firmware-.*"
+
+PACKAGES += "kernel-modules kernel-vmlinux"
+FILES_kernel-modules = ""
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+FILES_kernel-vmlinux = ""
+ALLOW_EMPTY_kernel-vmlinux = "1"
+DESCRIPTION_kernel-vmlinux = "Kernel vmlinux meta package"
+
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+#COMPATIBLE_MACHINE = "your_machine"
+
+PR = "r1"
+
+SRC_URI = "file://COPYING.GPL"
+S = "${WORKDIR}"
+
+do_configure() {
+ :
+}
+
+do_compile () {
+ :
+}
+
+do_shared_workdir () {
+ :
+}
+
+do_install() {
+ :
+}
+
+do_bundle_initramfs() {
+ :
+}
+
+do_deploy() {
+ :
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+addtask deploy after do_install
+addtask shared_workdir after do_compile before do_install
diff --git a/poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb b/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
new file mode 100644
index 000000000..4201faf67
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -0,0 +1,50 @@
+# This recipe tracks the linux-yocto-dev repository as its upstream source.
+# Since this tree is frequently updated, and periodically rebuilt, AUTOREV is
+# used to track its contents.
+#
+# This recipe is just like other linux-yocto variants, with the only difference
+# being that to avoid network access during initial parsing, static SRCREVs are
+# provided and overridden if the preferred kernel provider is linux-yocto-dev.
+#
+# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+# provide this .inc to set specific revisions
+include recipes-kernel/linux/linux-yocto-dev-revisions.inc
+
+KBRANCH = "standard/base"
+KMETA = "kernel-meta"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-dev.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=master;destsuffix=${KMETA}"
+
+# Set default SRCREVs. Both the machine and meta SRCREVs are statically set
+# to the korg v3.7 tag, and hence prevent network access during parsing. If
+# linux-yocto-dev is the preferred provider, they will be overridden to
+# AUTOREV in following anonymous python routine and resolved when the
+# variables are finalized.
+SRCREV_machine ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+SRCREV_meta ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+
+LINUX_VERSION ?= "4.16-rc+"
+LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
+
+KERNEL_VERSION_SANITY_SKIP = "1"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb
new file mode 100644
index 000000000..5edc0fa40
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.12.bb
@@ -0,0 +1,38 @@
+KBRANCH ?= "standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers, e.g. as dependency of
+# core-image-rt-sdk, core-image-rt.
+python () {
+ if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+SRCREV_machine ?= "705d03507a0c10dcbf9cad3ff70f5d60b70f2d99"
+SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.12.24"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb
new file mode 100644
index 000000000..81306a984
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.14.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "v4.14/standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers, e.g. as dependency of
+# core-image-rt-sdk, core-image-rt.
+python () {
+ if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+SRCREV_machine ?= "7272e9132fdaaf0dd78bc94e9f297aaf73452982"
+SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.14.30"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb
new file mode 100644
index 000000000..c5d3ee03f
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-rt_4.15.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "v4.15/standard/preempt-rt/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers, e.g. as dependency of
+# core-image-rt-sdk, core-image-rt.
+python () {
+ if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.15.13"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb
new file mode 100644
index 000000000..31307a638
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.12.bb
@@ -0,0 +1,25 @@
+KBRANCH ?= "standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.12.24"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "qemux86|qemux86-64"
+
+# Functionality flags
+KERNEL_FEATURES = ""
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb
new file mode 100644
index 000000000..34bee0949
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.14.bb
@@ -0,0 +1,28 @@
+KBRANCH ?= "v4.14/standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.14.30"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "ad31896630f8bf6a459164263adc0a8faf984d9e"
+SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "qemux86|qemux86-64"
+
+# Functionality flags
+KERNEL_FEATURES = ""
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb
new file mode 100644
index 000000000..05b9ca38b
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto-tiny_4.15.bb
@@ -0,0 +1,25 @@
+KBRANCH ?= "v4.15/standard/tiny/common-pc"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.15.13"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;branch=${KBRANCH};name=machine \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "qemux86|qemux86-64"
+
+# Functionality flags
+KERNEL_FEATURES = ""
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto.inc b/poky/meta/recipes-kernel/linux/linux-yocto.inc
new file mode 100644
index 000000000..3bb872a32
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto.inc
@@ -0,0 +1,69 @@
+SUMMARY = "Linux kernel"
+SECTION = "kernel"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+INC_PR = "r4"
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids network access required
+# by the use of AUTOREV SRCREVs, which are the default for this recipe.
+python () {
+ if d.getVar("KERNEL_PACKAGE_NAME") == "kernel" and d.getVar("PREFERRED_PROVIDER_virtual/kernel") != d.getVar("PN"):
+ d.delVar("BB_DONT_CACHE")
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to %s to enable it" % (d.getVar("PN")))
+}
+
+DEPENDS += "xz-native bc-native"
+DEPENDS_append_aarch64 = " libgcc"
+KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+
+DEPENDS_append_nios2 = " libgcc"
+KERNEL_CC_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
+KERNEL_LD_append_nios2 = " ${TOOLCHAIN_OPTIONS}"
+
+KERNEL_FEATURES_append_qemuall=" features/debug/printk.scc"
+
+# A KMACHINE is the mapping of a yocto $MACHINE to what is built
+# by the kernel. This is typically the branch that should be built,
+# and it can be specific to the machine or shared
+# KMACHINE = "UNDEFINED"
+
+# The distro or local.conf should set this, but if nobody cares...
+LINUX_KERNEL_TYPE ??= "standard"
+
+# KMETA ?= ""
+KBRANCH ?= "master"
+KMACHINE ?= "${MACHINE}"
+SRCREV_FORMAT ?= "meta_machine"
+
+# LEVELS:
+# 0: no reporting
+# 1: report options that are specified, but not in the final config
+# 2: report options that are not hardware related, but set by a BSP
+KCONF_AUDIT_LEVEL ?= "1"
+KCONF_BSP_AUDIT_LEVEL ?= "0"
+KMETA_AUDIT ?= "yes"
+
+LINUX_VERSION_EXTENSION ??= "-yocto-${LINUX_KERNEL_TYPE}"
+
+# Pick up shared functions
+inherit kernel
+inherit kernel-yocto
+
+B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
+
+do_install_append(){
+ if [ -n "${KMETA}" ]; then
+ rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
+ fi
+}
+
+# extra tasks
+addtask kernel_version_sanity_check after do_kernel_metadata do_kernel_checkout before do_compile
+addtask validate_branches before do_patch after do_kernel_checkout
+addtask kernel_configcheck after do_configure before do_compile
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb
new file mode 100644
index 000000000..8d560127f
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.12.bb
@@ -0,0 +1,46 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc ?= "standard/qemuppc"
+KBRANCH_qemux86 ?= "standard/base"
+KBRANCH_qemux86-64 ?= "standard/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "45824c60ca37f414a5ac5783e970338db9a5a2af"
+SRCREV_machine_qemuarm64 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_machine_qemumips ?= "66f741b0b3d093e6b6df0f44120913ef3a259e23"
+SRCREV_machine_qemuppc ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_machine_qemux86 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_machine_qemux86-64 ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_machine_qemumips64 ?= "c5d838c9e26bd657b49dfe28b115e5bc4b580850"
+SRCREV_machine ?= "f9d67777b07ac97966186c1b56db78afe2a16f92"
+SRCREV_meta ?= "46171de19220c49d670544017cfbeffc1ec70e80"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.12.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.12;destsuffix=${KMETA}"
+
+DEPENDS += "openssl-native util-linux-native"
+
+LINUX_VERSION ?= "4.12.24"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb
new file mode 100644
index 000000000..16142f8ce
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.14.bb
@@ -0,0 +1,47 @@
+KBRANCH ?= "v4.14/standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm ?= "v4.14/standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "v4.14/standard/qemuarm64"
+KBRANCH_qemumips ?= "v4.14/standard/mti-malta32"
+KBRANCH_qemuppc ?= "v4.14/standard/qemuppc"
+KBRANCH_qemux86 ?= "v4.14/standard/base"
+KBRANCH_qemux86-64 ?= "v4.14/standard/base"
+KBRANCH_qemumips64 ?= "v4.14/standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "d6268fc3460d3904fd49087f7a822efbaab9bfe8"
+SRCREV_machine_qemuarm64 ?= "c94189843b8ad62cafe9a307e7f7d60741690505"
+SRCREV_machine_qemumips ?= "4afd92347b2b35dc8e0006712f8fa00ac57f2a36"
+SRCREV_machine_qemuppc ?= "e8af5c9b65c5187d148ecd11bd7979489460ca64"
+SRCREV_machine_qemux86 ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c"
+SRCREV_machine_qemux86-64 ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c"
+SRCREV_machine_qemumips64 ?= "9863b327e770b42b8c18da3e0cfaf06e8f99ae97"
+SRCREV_machine ?= "74f6cd2b6976e37491779fcb1bc4966d3a61492c"
+SRCREV_meta ?= "ea9330894eea727bd1655569b16f338976b72563"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.14.30"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb b/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb
new file mode 100644
index 000000000..70bd7118b
--- /dev/null
+++ b/poky/meta/recipes-kernel/linux/linux-yocto_4.15.bb
@@ -0,0 +1,47 @@
+KBRANCH ?= "v4.15/standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm ?= "v4.15/standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "v4.15/standard/qemuarm64"
+KBRANCH_qemumips ?= "v4.15/standard/mti-malta32"
+KBRANCH_qemuppc ?= "v4.15/standard/qemuppc"
+KBRANCH_qemux86 ?= "v4.15/standard/base"
+KBRANCH_qemux86-64 ?= "v4.15/standard/base"
+KBRANCH_qemumips64 ?= "v4.15/standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "4b6902b42f47593928117b2ff0900cd965cf6443"
+SRCREV_machine_qemuarm64 ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_machine_qemumips ?= "19ba2d843750ff65d8fe590acdfc99aea6153945"
+SRCREV_machine_qemuppc ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_machine_qemux86 ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_machine_qemux86-64 ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_machine_qemumips64 ?= "97000c3f4664643bac7828bbdc048f7ec216cc31"
+SRCREV_machine ?= "91084d030bc841c483c31e8664289c7940aa5506"
+SRCREV_meta ?= "939d935b0c992c6f1e51a7a1c9e4fbe6ef3c3174"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
+ git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.15;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.15.13"
+
+DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
+DEPENDS += "openssl-native util-linux-native"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+KERNEL_DEVICETREE_qemuarm = "versatile-pb.dtb"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemuall=" cfg/virtio.scc"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb b/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb
new file mode 100644
index 000000000..a29402adb
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/babeltrace_1.5.4.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Babeltrace - Trace Format Babel Tower"
+DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
+HOMEPAGE = "http://www.efficios.com/babeltrace/"
+BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
+
+LICENSE = "MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
+
+DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
+
+inherit autotools pkgconfig
+
+SRC_URI = "http://www.efficios.com/files/babeltrace/babeltrace-${PV}.tar.bz2 \
+"
+
+EXTRA_OECONF = "--disable-debug-info"
+
+SRC_URI[md5sum] = "3e8cdafec3ac0346a389870e87bf1344"
+SRC_URI[sha256sum] = "9643039923a0abc75a25b3d594cee0017423b57f10d2b625e96ed1e8d4891fc1"
diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch b/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch
new file mode 100644
index 000000000..76063607a
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-modules/BUILD_RUNTIME_BUG_ON-vs-gcc7.patch
@@ -0,0 +1,43 @@
+From ab07574ef90fa510f293c37897d577066a88fe0d Mon Sep 17 00:00:00 2001
+From: Nathan Lynch <nathan_lynch@mentor.com>
+Date: Tue, 25 Apr 2017 16:26:57 -0500
+Subject: [PATCH] BUILD_RUNTIME_BUG_ON vs gcc7
+
+Avoid using LTTng's BUILD_RUNTIME_BUG_ON macro, as it appears to run
+into a similar problem as Linux experienced with ilog2.
+
+See:
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=474c90156c8dcc2fa815e6716cc9394d7930cb9c
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
+
+Upstream-Status: Pending
+Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
+---
+ lib/align.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/align.h b/lib/align.h
+index 5b91ae87410b..5e134cd485fe 100644
+--- a/lib/align.h
++++ b/lib/align.h
+@@ -48,7 +48,7 @@
+ */
+ #define offset_align(align_drift, alignment) \
+ ({ \
+- BUILD_RUNTIME_BUG_ON((alignment) == 0 \
++ BUG_ON((alignment) == 0 \
+ || ((alignment) & ((alignment) - 1))); \
+ (((alignment) - (align_drift)) & ((alignment) - 1)); \
+ })
+@@ -63,7 +63,7 @@
+ */
+ #define offset_align_floor(align_drift, alignment) \
+ ({ \
+- BUILD_RUNTIME_BUG_ON((alignment) == 0 \
++ BUG_ON((alignment) == 0 \
+ || ((alignment) & ((alignment) - 1))); \
+ (((align_drift) - (alignment)) & ((alignment) - 1)); \
+ })
+--
+2.9.3
+
diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch b/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
new file mode 100644
index 000000000..e41124227
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-modules/Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch
@@ -0,0 +1,49 @@
+From 1b0e574d680101105a6c1e8931c78824f5a97a42 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Mon, 5 Sep 2016 17:08:56 +0000
+Subject: [PATCH] Makefile: Do not fail if CONFIG_TRACEPOINTS is not enabled
+Organization: O.S. Systems Software LTDA.
+
+The lttng-modules are being pulled by the tools-profile image feature,
+however, not every kernel has the CONFIG_TRACEPOINTS feature enabled.
+
+This change makes the build do not fail when CONFIG_TRACEPOINTS is not
+available, allowing it to be kept being pulled by default.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ Makefile | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8602649..75550cc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,10 +8,7 @@ ifneq ($(KERNELRELEASE),)
+ # and defines the modules to be built.
+
+ ifdef CONFIG_LOCALVERSION # Check if dot-config is included.
+- ifeq ($(CONFIG_TRACEPOINTS),)
+- $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
+- endif # CONFIG_TRACEPOINTS
+- endif # ifdef CONFIG_LOCALVERSION
++ ifneq ($(CONFIG_TRACEPOINTS),)
+
+ TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+
+@@ -94,6 +91,10 @@ ifneq ($(KERNELRELEASE),)
+ obj-$(CONFIG_LTTNG) += lib/
+ obj-$(CONFIG_LTTNG) += tests/
+
++ else
++ $(warning The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
++ endif # CONFIG_TRACEPOINTS
++ endif # ifdef CONFIG_LOCALVERSION
+ else # KERNELRELEASE
+
+ # This part of the Makefile is used when the 'make' command is runned in the
+--
+2.1.4
+
diff --git a/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb b/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb
new file mode 100644
index 000000000..370b78aae
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-modules_2.10.5.bb
@@ -0,0 +1,35 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
+DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
+LICENSE = "LGPLv2.1 & GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c4613d1f8a9587bd7b366191830364b3 \
+ file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
+ file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad \
+ "
+
+inherit module
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm).*-linux'
+
+SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \
+ file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \
+"
+
+SRC_URI[md5sum] = "4aaabaafd15d9455c83972e26ccfbca7"
+SRC_URI[sha256sum] = "b8dbbbee45a673c381f51b99c555e36655c3c2c7a5477aab927591cc7f003a1f"
+
+export INSTALL_MOD_DIR="kernel/lttng-modules"
+
+EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
+
+do_install_append() {
+ # Delete empty directories to avoid QA failures if no modules were built
+ find ${D}/${nonarch_base_libdir} -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+ if not os.path.exists(os.path.join(d.getVar('D'), d.getVar('nonarch_base_libdir')[1:], 'modules')):
+ bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN'))
+}
+
diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
new file mode 100755
index 000000000..705030ee5
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Without --ignore-exit, the tap harness causes any FAILs within a
+# test plan to raise ERRORs; this is just noise.
+makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=$PWD top_builddir=$PWD"
+make -k -t all >/dev/null 2>&1
+exec make -s $makeargs check 2>/dev/null
diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch b/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch
new file mode 100644
index 000000000..b1bb8e493
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-tools/x32.patch
@@ -0,0 +1,16 @@
+Fix build for x32
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+--- lttng-tools-2.6.0/src/bin/lttng/utils.c~ 2015-01-26 18:17:15.000000000 +0100
++++ lttng-tools-2.6.0/src/bin/lttng/utils.c 2015-07-30 19:45:25.632045712 +0200
+@@ -130,7 +130,7 @@
+ #define HAS_FLS_U32
+ #endif
+
+-#if defined(__x86_64)
++#if defined(__x86_64) && !defined(__ILP32__)
+ static inline
+ unsigned int fls_u64(uint64_t x)
+ {
diff --git a/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb b/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb
new file mode 100644
index 000000000..93626dd4b
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-tools_2.9.5.bb
@@ -0,0 +1,123 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit Control"
+DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
+to extract program execution details from the Linux operating system \
+and interpret them."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
+ file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
+
+DEPENDS = "liburcu popt libxml2 util-linux"
+RDEPENDS_${PN} = "libgcc"
+RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
+# babelstats.pl wants getopt-long
+RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
+
+PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
+ am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
+ PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
+"
+PACKAGECONFIG ??= "lttng-ust"
+PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
+PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
+PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
+PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
+PACKAGECONFIG_remove_libc-musl = "lttng-ust"
+PACKAGECONFIG_remove_riscv64 = "lttng-ust"
+
+SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
+ file://x32.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "051224eb991aee07f8721ff1877d0b96"
+SRC_URI[sha256sum] = "77839eb6fc6c652125f08acfd9369701c2516eb05cc2084160e7efc7a3fb731c"
+
+inherit autotools ptest pkgconfig useradd python3-dir manpages
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "tracing"
+
+FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
+ ${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
+
+# Since files are installed into ${libdir}/lttng/libexec we match
+# the libexec insane test so skip it.
+# Python module needs to keep _lttng.so
+INSANE_SKIP_${PN} = "libexec dev-so"
+INSANE_SKIP_${PN}-dbg = "libexec"
+
+do_install_ptest () {
+ for f in Makefile tests/Makefile tests/utils/utils.sh ; do
+ install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
+ done
+
+ for f in config/tap-driver.sh config/test-driver ; do
+ install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
+ done
+
+ # Prevent 'make check' from recursing into non-test subdirectories.
+ sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
+
+ # We don't need these
+ sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
+
+ # We shouldn't need to build anything in tests/utils
+ sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
+ "${D}${PTEST_PATH}/tests/Makefile"
+
+ # Copy the tests directory tree and the executables and
+ # Makefiles found within.
+ for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
+ install -d "${D}${PTEST_PATH}/tests/$d"
+ find "${B}/tests/$d" -maxdepth 1 -executable -type f \
+ -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
+ test -r "${B}/tests/$d/Makefile" && \
+ install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
+ done
+
+ # We shouldn't need to build anything in tests/regression/tools
+ sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
+ "${D}${PTEST_PATH}/tests/regression/Makefile"
+
+ # Prevent attempts to update Makefiles during test runs, and
+ # silence "Making check in $SUBDIR" messages.
+ find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+ sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+ -e '/echo "Making $$target in $$subdir"; \\/d' \
+ -e 's/^srcdir = \(.*\)/srcdir = ./' \
+ -e 's/^builddir = \(.*\)/builddir = ./' \
+ -e 's/^all-am:.*/all-am:/' \
+ {} +
+
+ # These objects trigger [rpaths] QA checks; the test harness
+ # skips the associated tests if they're missing, so delete
+ # them.
+ objs=""
+ objs="$objs regression/ust/ust-dl/libbar.so"
+ objs="$objs regression/ust/ust-dl/libfoo.so"
+ for obj in $objs ; do
+ rm -f "${D}${PTEST_PATH}/tests/${obj}"
+ done
+
+ find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+ touch -r "${B}/Makefile" {} +
+
+ # Substitute links to installed binaries.
+ for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
+ exedir="${D}${PTEST_PATH}/src/bin/${prog}"
+ install -d "$exedir"
+ case "$prog" in
+ lttng-consumerd)
+ ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
+ ;;
+ *)
+ ln -s "${bindir}/$prog" "$exedir"
+ ;;
+ esac
+ done
+}
diff --git a/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
new file mode 100644
index 000000000..bff852799
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Don't build the doc examples - we don't need them and in fact they
+never successfully built in previous iterations of the lttng-ust
+recipe anyway.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: lttng-ust-2.9.1/doc/Makefile.am
+===================================================================
+--- lttng-ust-2.9.1.orig/doc/Makefile.am
++++ lttng-ust-2.9.1/doc/Makefile.am
+@@ -1,3 +1,3 @@
+-SUBDIRS = . man examples
++SUBDIRS = . man
+
+ dist_doc_DATA = java-agent.txt
diff --git a/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb b/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb
new file mode 100644
index 000000000..d79a47931
--- /dev/null
+++ b/poky/meta/recipes-kernel/lttng/lttng-ust_2.10.1.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
+DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
+HOMEPAGE = "http://lttng.org/ust"
+BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
+
+LICENSE = "LGPLv2.1+ & MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
+ file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
+ file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
+
+inherit autotools lib_package manpages
+
+DEPENDS = "liburcu util-linux"
+RDEPENDS_${PN}-bin = "python3-core"
+
+# For backwards compatibility after rename
+RPROVIDES_${PN} = "lttng2-ust"
+RREPLACES_${PN} = "lttng2-ust"
+RCONFLICTS_${PN} = "lttng2-ust"
+
+PE = "2"
+
+SRC_URI = "https://lttng.org/files/lttng-ust/lttng-ust-${PV}.tar.bz2 \
+ file://lttng-ust-doc-examples-disable.patch \
+ "
+SRC_URI[md5sum] = "4863cc2f9f0a070b42438bb646bbba06"
+SRC_URI[sha256sum] = "07cc3c0b71e7b77f1913d5b7f340a78a9af414440e4662712aef2d635b88ee9d"
+
+CVE_PRODUCT = "ust"
+
+PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
+
+do_install_append() {
+ # Patch python tools to use Python 3; they should be source compatible, but
+ # still refer to Python 2 in the shebang
+ sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${bindir}/lttng-gen-tp
+}
diff --git a/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
new file mode 100644
index 000000000..97c58c523
--- /dev/null
+++ b/poky/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Build tools needed by external modules"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit kernel-arch
+inherit pkgconfig
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir openssl-native:do_populate_sysroot"
+do_compile[depends] += "virtual/kernel:do_compile_kernelmodules"
+
+DEPENDS += "bc-native"
+
+EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}""
+
+# Build some host tools under work-shared. CC, LD, and AR are probably
+# not used, but this is the historical way of invoking "make scripts".
+#
+do_configure() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
+ -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare
+
+}
diff --git a/poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch
new file mode 100644
index 000000000..21ac49cbd
--- /dev/null
+++ b/poky/meta/recipes-kernel/modutils-initscripts/files/PD.patch
@@ -0,0 +1,8 @@
+Upstream-Status: Inappropriate [licensing]
+
+Index: modutils-initscripts-1.0/LICENSE
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ modutils-initscripts-1.0/LICENSE 2010-12-06 14:26:03.570339002 -0800
+@@ -0,0 +1 @@
++Public Domain
diff --git a/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
new file mode 100755
index 000000000..a78adf572
--- /dev/null
+++ b/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: module-init-tools
+# Required-Start:
+# Required-Stop:
+# Should-Start: checkroot
+# Should-stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Process /etc/modules.
+# Description: Load the modules listed in /etc/modules.
+### END INIT INFO
+
+LOAD_MODULE=modprobe
+[ -f /proc/modules ] || exit 0
+[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
+[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
+
+if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
+ [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
+ depmod -Ae
+fi
+
+loaded_modules=" "
+
+process_file() {
+ file=$1
+
+ (cat $file; echo; ) |
+ while read module args
+ do
+ case "$module" in
+ \#*|"") continue ;;
+ esac
+ [ -n "$(echo $loaded_modules | grep " $module ")" ] && continue
+ [ "$VERBOSE" != no ] && echo -n "$module "
+ eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
+ loaded_modules="${loaded_modules}${module} "
+ done
+}
+
+[ "$VERBOSE" != no ] && echo -n "Loading modules: "
+[ -f /etc/modules ] && process_file /etc/modules
+
+[ -d /etc/modules-load.d ] || exit 0
+
+for f in /etc/modules-load.d/*.conf; do
+ process_file $f
+done
+[ "$VERBOSE" != no ] && echo
+
+exit 0
diff --git a/poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
new file mode 100644
index 000000000..0f3df5577
--- /dev/null
+++ b/poky/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Initscript for auto-loading kernel modules on boot"
+SECTION = "base"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7bf87fc37976e93ec66ad84fac58c098"
+SRC_URI = "file://modutils.sh \
+ file://PD.patch"
+
+PR = "r7"
+
+S = "${WORKDIR}"
+
+INITSCRIPT_NAME = "modutils.sh"
+INITSCRIPT_PARAMS = "start 05 S ."
+
+inherit update-rc.d
+
+do_compile () {
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
+}
+
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask modutils.service
+ fi
+}
diff --git a/poky/meta/recipes-kernel/perf/perf.bb b/poky/meta/recipes-kernel/perf/perf.bb
new file mode 100644
index 000000000..51f5597eb
--- /dev/null
+++ b/poky/meta/recipes-kernel/perf/perf.bb
@@ -0,0 +1,261 @@
+SUMMARY = "Performance analysis tools for Linux"
+DESCRIPTION = "Performance counters for Linux are a new kernel-based \
+subsystem that provide a framework for all things \
+performance analysis. It covers hardware level \
+(CPU/PMU, Performance Monitoring Unit) features \
+and software features (software counters, tracepoints) \
+as well."
+HOMEPAGE = "https://perf.wiki.kernel.org/index.php/Main_Page"
+
+LICENSE = "GPLv2"
+
+PR = "r9"
+
+PACKAGECONFIG ??= "scripting tui libunwind"
+PACKAGECONFIG[scripting] = ",NO_LIBPERL=1 NO_LIBPYTHON=1,perl python"
+# gui support was added with kernel 3.6.35
+# since 3.10 libnewt was replaced by slang
+# to cover a wide range of kernel we add both dependencies
+PACKAGECONFIG[tui] = ",NO_NEWT=1,libnewt slang"
+PACKAGECONFIG[libunwind] = ",NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1,libunwind"
+PACKAGECONFIG[libnuma] = ",NO_LIBNUMA=1"
+PACKAGECONFIG[systemtap] = ",NO_SDT=1,systemtap"
+PACKAGECONFIG[jvmti] = ",NO_JVMTI=1"
+
+# libaudit support would need scripting to be enabled
+PACKAGECONFIG[audit] = ",NO_LIBAUDIT=1,audit"
+
+DEPENDS = " \
+ virtual/${MLPREFIX}libc \
+ ${MLPREFIX}elfutils \
+ ${MLPREFIX}binutils \
+ bison-native flex-native xz \
+ xmlto-native \
+ asciidoc-native \
+"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+PROVIDES = "virtual/perf"
+
+inherit linux-kernel-base kernel-arch
+
+# needed for building the tools/perf Python bindings
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'pythonnative', '', d)}
+inherit python-dir
+export PYTHON_SITEPACKAGES_DIR
+
+#kernel 3.1+ supports WERROR to disable warnings as errors
+export WERROR = "0"
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+
+# needed for building the tools/perf Perl binding
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'perlnative', '', d)}
+inherit cpan-base
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+
+inherit kernelsrc
+
+S = "${WORKDIR}/${BP}"
+SPDX_S = "${S}/tools/perf"
+
+# The LDFLAGS is required or some old kernels fails due missing
+# symbols and this is preferred than requiring patches to every old
+# supported kernel.
+LDFLAGS="-ldl -lutil"
+
+EXTRA_OEMAKE = '\
+ -C ${S}/tools/perf \
+ O=${B} \
+ CROSS_COMPILE=${TARGET_PREFIX} \
+ ARCH=${ARCH} \
+ CC="${CC}" \
+ AR="${AR}" \
+ LD="${LD}" \
+ EXTRA_CFLAGS="-ldw" \
+ EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \
+ perfexecdir=${libexecdir} \
+ NO_GTK2=1 NO_DWARF=1 \
+ ${PACKAGECONFIG_CONFARGS} \
+'
+
+EXTRA_OEMAKE += "\
+ 'DESTDIR=${D}' \
+ 'prefix=${prefix}' \
+ 'bindir=${bindir}' \
+ 'sharedir=${datadir}' \
+ 'sysconfdir=${sysconfdir}' \
+ 'perfexecdir=${libexecdir}/perf-core' \
+ 'ETC_PERFCONFIG=${@os.path.relpath(sysconfdir, prefix)}' \
+ 'sharedir=${@os.path.relpath(datadir, prefix)}' \
+ 'mandir=${@os.path.relpath(mandir, prefix)}' \
+ 'infodir=${@os.path.relpath(infodir, prefix)}' \
+"
+
+PERF_SRC ?= "Makefile \
+ include \
+ tools/arch \
+ tools/build \
+ tools/include \
+ tools/lib \
+ tools/Makefile \
+ tools/perf \
+ tools/scripts \
+"
+
+PERF_EXTRA_LDFLAGS = ""
+
+# MIPS N32
+PERF_EXTRA_LDFLAGS_mipsarchn32eb = "-m elf32btsmipn32"
+PERF_EXTRA_LDFLAGS_mipsarchn32el = "-m elf32ltsmipn32"
+
+do_compile() {
+ # Linux kernel build system is expected to do the right thing
+ unset CFLAGS
+ oe_runmake all
+}
+
+do_install() {
+ # Linux kernel build system is expected to do the right thing
+ unset CFLAGS
+ oe_runmake install
+ # we are checking for this make target to be compatible with older perf versions
+ if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+ oe_runmake DESTDIR=${D} install-python_ext
+ fi
+}
+
+do_configure[prefuncs] += "copy_perf_source_from_kernel"
+python copy_perf_source_from_kernel() {
+ sources = (d.getVar("PERF_SRC") or "").split()
+ src_dir = d.getVar("STAGING_KERNEL_DIR")
+ dest_dir = d.getVar("S")
+ bb.utils.mkdirhier(dest_dir)
+ for s in sources:
+ src = oe.path.join(src_dir, s)
+ dest = oe.path.join(dest_dir, s)
+ if os.path.isdir(src):
+ oe.path.copyhardlinktree(src, dest)
+ else:
+ bb.utils.copyfile(src, dest)
+}
+
+do_configure_prepend () {
+ # If building a multlib based perf, the incorrect library path will be
+ # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
+ # build, with a 64 bit multilib, the arch won't match and the detection of a
+ # 64 bit build (and library) are not exected. To ensure that libraries are
+ # installed to the correct location, we can use the weak assignment in the
+ # config/Makefile.
+ #
+ # Also need to relocate .config-detected to $(OUTPUT)/config-detected
+ # for kernel sources that do not already do this
+ # as two builds (e.g. perf and lib32-perf from mutlilib can conflict
+ # with each other if its in the shared source directory
+ #
+ if [ -e "${S}/tools/perf/config/Makefile" ]; then
+ perfconfig="${S}/tools/perf/config/Makefile"
+ fi
+ if [ -e "${S}/tools/perf/Makefile.config" ]; then
+ perfconfig="${S}/tools/perf/Makefile.config"
+ fi
+ if [ -n "${perfconfig}" ]; then
+ # Match $(prefix)/$(lib) and $(prefix)/lib
+ sed -i -e 's,^libdir = \($(prefix)/.*lib\),libdir ?= \1,' \
+ -e 's,^perfexecdir = \(.*\),perfexecdir ?= \1,' \
+ -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+ ${perfconfig}
+ fi
+ # The man pages installation is "$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)"
+ # in ${S}/tools/perf/Documentation/Makefile, if the mandir set to '?=', it
+ # will use the relative path 'share/man', in the way it will resulting in
+ # incorrect installation for man pages.
+ if [ -e "${S}/tools/perf/Documentation/Makefile" ]; then
+ sed -i 's,^mandir?=,mandir:=,' ${S}/tools/perf/Documentation/Makefile
+ fi
+ if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+ sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+ ${S}/tools/perf/Makefile.perf
+ sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+ ${S}/tools/perf/Makefile.perf
+ fi
+ sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+ ${S}/tools/perf/Makefile*
+
+ if [ -e "${S}/tools/build/Makefile.build" ]; then
+ sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+ ${S}/tools/build/Makefile.build
+ fi
+
+ # We need to ensure the --sysroot option in CC is preserved
+ if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+ sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
+ sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
+ sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/perf/Makefile.perf
+ fi
+ if [ -e "${S}/tools/lib/api/Makefile" ]; then
+ sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
+ sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile
+ sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' ${S}/tools/lib/api/Makefile
+ fi
+ if [ -e "${S}/tools/lib/subcmd/Makefile" ]; then
+ sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/subcmd/Makefile
+ sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/subcmd/Makefile
+ fi
+ if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then
+ sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile
+ fi
+ if [ -e "${S}/tools/build/Makefile.feature" ]; then
+ sed -i 's,CFLAGS=,CC="\$(CC)" CFLAGS=,' ${S}/tools/build/Makefile.feature
+ fi
+
+ # 3.17-rc1+ has a include issue for arm/powerpc. Temporarily sed in the appropriate include
+ if [ -e "${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c" ]; then
+ sed -i 's,#include "util/callchain.h",#include "util/callchain.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c
+ fi
+ if [ -e "${S}/tools/perf/arch/arm/util/unwind-libunwind.c" ] && [ -e "${S}/tools/perf/arch/arm/tests/dwarf-unwind.c" ]; then
+ sed -i 's,#include "tests/tests.h",#include "tests/tests.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/tests/dwarf-unwind.c
+ sed -i 's,#include "perf_regs.h",#include "perf_regs.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/util/unwind-libunwind.c
+ fi
+
+ # use /usr/bin/env instead of version specific python
+ for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do
+ sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}"
+ done
+}
+
+python do_package_prepend() {
+ d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+
+PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
+
+RDEPENDS_${PN} += "elfutils bash"
+RDEPENDS_${PN}-doc += "man"
+RDEPENDS_${PN}-archive =+ "bash"
+RDEPENDS_${PN}-python =+ "bash python python-modules ${@bb.utils.contains('PACKAGECONFIG', 'audit', 'audit-python', '', d)}"
+RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
+RDEPENDS_${PN}-tests =+ "python"
+
+RSUGGESTS_SCRIPTING = "${@bb.utils.contains('PACKAGECONFIG', 'scripting', '${PN}-perl ${PN}-python', '',d)}"
+RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
+
+FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
+FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
+FILES_${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests"
+FILES_${PN}-python = " \
+ ${PYTHON_SITEPACKAGES_DIR} \
+ ${libexecdir}/perf-core/scripts/python \
+ "
+FILES_${PN}-perl = "${libexecdir}/perf-core/scripts/perl"
+
+
+INHIBIT_PACKAGE_DEBUG_SPLIT="1"
diff --git a/poky/meta/recipes-kernel/powertop/powertop_2.9.bb b/poky/meta/recipes-kernel/powertop/powertop_2.9.bb
new file mode 100644
index 000000000..4fe5447a0
--- /dev/null
+++ b/poky/meta/recipes-kernel/powertop/powertop_2.9.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Power usage tool"
+DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management."
+HOMEPAGE = "http://01.org/powertop/"
+BUGTRACKER = "http://bugzilla.lesswatts.org/"
+DEPENDS = "ncurses libnl pciutils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-v${PV}.tar.gz \
+"
+
+SRC_URI[md5sum] = "583518c5c4434c6e9b9c58c3920950b6"
+SRC_URI[sha256sum] = "aa7fb7d8e9a00f05e7d8a7a2866d85929741e0d03a5bf40cab22d2021c959250"
+
+UPSTREAM_CHECK_URI = "https://01.org/powertop/downloads"
+UPSTREAM_CHECK_REGEX = "powertop-[v]?(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools gettext pkgconfig
+
+S = "${WORKDIR}/${BPN}-v${PV}"
+
+# we do not want libncursesw if we can
+do_configure_prepend() {
+ # configure.ac checks for delwin() in "ncursesw ncurses" so let's drop first one
+ sed -i -e "s/ncursesw//g" ${S}/configure.ac
+ mkdir -p ${B}/src/tuning/
+}
+
+inherit update-alternatives
+ALTERNATIVE_${PN} = "powertop"
+ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch b/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch
new file mode 100644
index 000000000..e28fdcad9
--- /dev/null
+++ b/poky/meta/recipes-kernel/sysprof/files/0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch
@@ -0,0 +1,26 @@
+From c2495a4c042e6a675da69bab20cc3669391e8e2a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 23 Aug 2017 18:38:26 +0300
+Subject: [PATCH 1/2] Do not build anything in help/ as it requires itstool.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ meson.build | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 4ac3934..8c4369a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -116,7 +116,6 @@ subdir('tools')
+ subdir('tests')
+
+ subdir('data')
+-subdir('help')
+ subdir('po')
+
+ meson.add_install_script('build-aux/meson_post_install.sh')
+--
+2.14.1
+
diff --git a/poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
new file mode 100644
index 000000000..f75ddad43
--- /dev/null
+++ b/poky/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
@@ -0,0 +1,22 @@
+On uclibc elf.h does not have GNU extentions but we need this define
+so we define it locally if its not getting it from elf.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: git/elfparser.h
+===================================================================
+--- git.orig/lib/util/elfparser.h 2011-07-16 18:57:41.000000000 -0700
++++ git/lib/util/elfparser.h 2011-07-16 20:28:54.733829895 -0700
+@@ -17,6 +17,10 @@
+ */
+ #include <glib.h>
+
++#ifndef NT_GNU_BUILD_ID
++#define NT_GNU_BUILD_ID 3
++#endif
++
+ typedef struct ElfSym ElfSym;
+ typedef struct ElfParser ElfParser;
+
diff --git a/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb b/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb
new file mode 100644
index 000000000..1989b52a7
--- /dev/null
+++ b/poky/meta/recipes-kernel/sysprof/sysprof_3.26.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "System-wide Performance Profiler for Linux"
+HOMEPAGE = "http://www.sysprof.com"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://src/sp-application.c;endline=17;md5=40e55577ef122c88fe20052acda64875"
+
+GNOMEBASEBUILDCLASS = "meson"
+inherit gnomebase gettext systemd upstream-version-is-even
+
+DEPENDS = "glib-2.0 libxml2-native glib-2.0-native"
+
+SRC_URI[archive.md5sum] = "6f9f947960ba79bb1269d8ee49b7db78"
+SRC_URI[archive.sha256sum] = "d8b9d5c2246696e4a3776a312731dc7c014fbd33478bb14d5512c6f1f35a3b11"
+SRC_URI += " \
+ file://define-NT_GNU_BUILD_ID.patch \
+ file://0001-Do-not-build-anything-in-help-as-it-requires-itstool.patch \
+ "
+
+PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK3DISTROFEATURES}', 'gtk', '', d)}"
+PACKAGECONFIG[gtk] = "-Denable_gtk=true,-Denable_gtk=false,gtk+3"
+PACKAGECONFIG[sysprofd] = "-Dwith_sysprofd=bundled,-Dwith_sysprofd=none,polkit"
+
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'sysprofd', 'sysprof2.service', '', d)}"
+
+# We do not yet work for aarch64.
+COMPATIBLE_HOST = "^(?!aarch64).*"
+
+FILES_${PN} += " \
+ ${datadir}/dbus-1/system-services \
+ ${datadir}/dbus-1/system.d \
+ "
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb
new file mode 100644
index 000000000..19cc1cf0f
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap-native_git.bb
@@ -0,0 +1,6 @@
+
+require systemtap_git.bb
+
+inherit native
+
+addtask addto_recipe_sysroot after do_populate_sysroot before do_build
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
new file mode 100644
index 000000000..46820ef48
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "UProbes kernel module for SystemTap"
+
+require systemtap_git.inc
+
+DEPENDS = "systemtap virtual/kernel"
+
+# On systems without CONFIG_UTRACE, this package is empty.
+ALLOW_EMPTY_${PN} = "1"
+
+inherit module-base gettext
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
+
+FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
+
+# Compile and install the uprobes kernel module on machines with utrace
+# support. Note that staprun expects it in the systemtap/runtime directory,
+# not in /lib/modules.
+do_compile() {
+ if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
+ then
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
+ oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}" \
+ -C ${STAGING_KERNEL_DIR} scripts
+ oe_runmake KDIR=${STAGING_KERNEL_DIR} \
+ M="${S}/runtime/uprobes/" \
+ CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+ AR="${KERNEL_AR}" \
+ -C "${S}/runtime/uprobes/"
+ fi
+}
+
+do_install() {
+ if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
+ then
+ install -d ${D}${datadir}/systemtap/runtime/uprobes/
+ install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
+ fi
+}
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch
new file mode 100644
index 000000000..c0ceb5a41
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Added-a-couple-of-small-sysroot-fixes.patch
@@ -0,0 +1,42 @@
+From a714658727206d2a98a7194b7e6d29dbd3e27b8d Mon Sep 17 00:00:00 2001
+From: David Smith <dsmith@redhat.com>
+Date: Mon, 19 Mar 2018 16:50:05 -0500
+Subject: [PATCH] Added a couple of small sysroot fixes.
+
+* tapsets.cxx (dwarf_builder::build): Fix commit 4ffecddf5.
+ (path_remove_sysroot): Fix extra '/' present at start of paths.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ tapsets.cxx | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+Index: git/tapsets.cxx
+===================================================================
+--- git.orig/tapsets.cxx
++++ git/tapsets.cxx
+@@ -1395,7 +1395,8 @@ string path_remove_sysroot(const systemt
+ string retval = path;
+ if (!sess.sysroot.empty() &&
+ (pos = retval.find(sess.sysroot)) != string::npos)
+- retval.replace(pos, sess.sysroot.length(), "/");
++ retval.replace(pos, sess.sysroot.length(),
++ (sess.sysroot.back() == '/' ? "/": ""));
+ return retval;
+ }
+
+@@ -8412,8 +8413,11 @@ dwarf_builder::build(systemtap_session &
+
+ // PR13338: unquote glob results
+ module_name = unescape_glob_chars (module_name);
+- user_path = find_executable (module_name, "", sess.sysenv); // canonicalize it
+- if (!is_fully_resolved(user_path, sess.sysroot, sess.sysenv))
++ user_path = find_executable (module_name, sess.sysroot, sess.sysenv); // canonicalize it
++ // Note we don't need to pass the sysroot to
++ // is_fully_resolved(), since we just passed it to
++ // find_executable().
++ if (!is_fully_resolved(user_path, "", sess.sysenv))
+ throw SEMANTIC_ERROR(_F("cannot find executable '%s'",
+ user_path.to_string().c_str()));
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch
new file mode 100644
index 000000000..89951a2f1
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch
@@ -0,0 +1,61 @@
+From 4ffecddf5433d65a6f01241990c9d516586b1c79 Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Mon, 19 Mar 2018 08:53:51 -0500
+Subject: [PATCH] Delay adding sysroot path to module name in case of non
+ absolute executable
+
+Current stap code adds sysroot prematurely for probes that specify non
+absolute path name, i.e like "foo", so when find_executable called it
+receives full path as <sysroot>/foo and find_executable does not search
+PATH while applying sysroot.
+
+Fix delays adding sysroot till path inside of sysroot is searched first.
+
+Also fix missing sysroot addition in glob expansion case.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ tapsets.cxx | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: git/tapsets.cxx
+===================================================================
+--- git.orig/tapsets.cxx
++++ git/tapsets.cxx
+@@ -746,7 +746,7 @@ base_query::base_query(dwflpp & dw, lite
+ pid_val = 0;
+ get_string_param(params, TOK_PROCESS, module_val);
+ }
+- module_val = find_executable (module_val, "", sess.sysenv);
++ module_val = find_executable (module_val, sess.sysroot, sess.sysenv);
+ if (!is_fully_resolved(module_val, "", sess.sysenv))
+ throw SEMANTIC_ERROR(_F("cannot find executable '%s'",
+ module_val.to_string().c_str()));
+@@ -8287,7 +8287,6 @@ dwarf_builder::build(systemtap_session &
+ }
+ else
+ {
+- module_name = (string)sess.sysroot + (string)module_name;
+ filled_parameters[TOK_PROCESS] = new literal_string(module_name);
+ }
+ }
+@@ -8321,7 +8320,8 @@ dwarf_builder::build(systemtap_session &
+ assert (lit);
+
+ // Evaluate glob here, and call derive_probes recursively with each match.
+- const auto& globs = glob_executable (module_name);
++ const auto& globs = glob_executable (sess.sysroot
++ + string(module_name));
+ unsigned results_pre = finished_results.size();
+ for (auto it = globs.begin(); it != globs.end(); ++it)
+ {
+@@ -8413,7 +8413,7 @@ dwarf_builder::build(systemtap_session &
+ // PR13338: unquote glob results
+ module_name = unescape_glob_chars (module_name);
+ user_path = find_executable (module_name, "", sess.sysenv); // canonicalize it
+- if (!is_fully_resolved(user_path, "", sess.sysenv))
++ if (!is_fully_resolved(user_path, sess.sysroot, sess.sysenv))
+ throw SEMANTIC_ERROR(_F("cannot find executable '%s'",
+ user_path.to_string().c_str()));
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch
new file mode 100644
index 000000000..742b1187f
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Do-not-let-configure-write-a-python-location-into-th.patch
@@ -0,0 +1,25 @@
+From ab29615ed6c2e779b472903564dc683dc1015de7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 22 Feb 2017 13:37:33 +0200
+Subject: [PATCH] Do not let configure write a python location into the dtrace
+ binary
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ dtrace.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dtrace.in b/dtrace.in
+index 5e1cf8079..a24229cbc 100644
+--- a/dtrace.in
++++ b/dtrace.in
+@@ -1,4 +1,4 @@
+-#!@preferred_python@
++#!/usr/bin/python3
+ # vim: et sta sts=4 sw=4 ts=8
+
+ # This handles the systemtap equivalent of
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch
new file mode 100644
index 000000000..460c3b760
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch
@@ -0,0 +1,277 @@
+From fbb26e17a4c026f05a497fc5d584516bad3b6950 Mon Sep 17 00:00:00 2001
+From: David Smith <dsmith@redhat.com>
+Date: Wed, 6 Dec 2017 14:37:42 -0600
+Subject: [PATCH] Fix PR22551 by updating the use of timers for the 4.15
+ kernel.
+
+* runtime/linux/timer_compatibility.h: New file.
+* runtime/time.c: Update timer callback function parameter type. Update
+ timer initialization.
+* runtime/transport/relay_v2.c: Ditto.
+* runtime/transport/transport.c: Ditto.
+* tapset-timers.cxx (timer_derived_probe_group::emit_module_decls):
+ Ditto. Handle old and new timer callback interface.
+* runtime/linux/runtime.h: Include timer_compatibility.h instead of timer.h.
+* tapset/linux/scsi.stp: Ditto.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+
+---
+ runtime/linux/runtime.h | 2 +-
+ runtime/linux/timer_compatibility.h | 76 +++++++++++++++++++++++++++++++++++++
+ runtime/time.c | 7 ++--
+ runtime/transport/relay_v2.c | 8 ++--
+ runtime/transport/transport.c | 13 +++----
+ tapset-timers.cxx | 14 +++++--
+ tapset/linux/scsi.stp | 2 +-
+ 7 files changed, 100 insertions(+), 22 deletions(-)
+ create mode 100644 runtime/linux/timer_compatibility.h
+
+diff --git a/runtime/linux/runtime.h b/runtime/linux/runtime.h
+index 9c585a2..df9b74c 100644
+--- a/runtime/linux/runtime.h
++++ b/runtime/linux/runtime.h
+@@ -34,7 +34,7 @@
+ #include <linux/compat.h>
+ #include <linux/sched.h>
+ #include <linux/mm.h>
+-#include <linux/timer.h>
++#include "timer_compatibility.h"
+ #include <linux/delay.h>
+ #include <linux/profile.h>
+ #include <linux/rcupdate.h>
+diff --git a/runtime/linux/timer_compatibility.h b/runtime/linux/timer_compatibility.h
+new file mode 100644
+index 0000000..ac03de9
+--- /dev/null
++++ b/runtime/linux/timer_compatibility.h
+@@ -0,0 +1,76 @@
++/*
++ * linux/timer.h compatibility defines and inlines
++ * Copyright (C) 2017 Red Hat Inc.
++ *
++ * This file is part of systemtap, and is free software. You can
++ * redistribute it and/or modify it under the terms of the GNU General
++ * Public License (GPL); either version 2, or (at your option) any
++ * later version.
++ */
++
++#ifndef _TIMER_COMPATIBILITY_H_
++#define _TIMER_COMPATIBILITY_H_
++
++#include <linux/timer.h>
++
++/*
++ * Starting with the 4.15 kernel, the timer interface
++ * changed. Originally, you'd do something like:
++ *
++ * static void timer_func(unsigned long val);
++ *
++ * init_timer(&timer);
++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL;
++ * timer.function = timer_func;
++ * timer.data = 0;
++ * add_timer(&timer);
++ *
++ * The 'data' parameter would get passed to the callback
++ * function. Starting with 4.15, you'd do something like this:
++ *
++ * static void timer_func(struct timer_list *val);
++ *
++ * timer_setup(&timer, timer_func, 0);
++ * timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL;
++ * add_timer(&timer);
++ *
++ * With the new code, the timer that caused the callback gets passed
++ * to the timer callback function. The 'data' field has been removed.
++ *
++ * So, we're going to use the new interface. To hide the differences
++ * between the callback function parameter type, we'll define a new
++ * type, 'stp_timer_callback_parameter_t'.
++ *
++ * If code needs to figure out the difference between the old and new
++ * interface, it should test the TIMER_TRACE_FLAGMASK define (which
++ * only exists in the new interface).
++ */
++
++#if defined(TIMER_TRACE_FLAGMASK)
++/* This is the >= 4.15 kernel interface. */
++
++typedef struct timer_list * stp_timer_callback_parameter_t;
++
++#else
++/* This is the < 4.15 kernel interface. */
++
++typedef unsigned long stp_timer_callback_parameter_t;
++
++/**
++ * timer_setup - prepare a timer for first use
++ * @timer: the timer in question
++ * @callback: the function to call when timer expires
++ * @flags: any TIMER_* flags (note that anything other than 0 is an
++ * error, since this compatibility function can't support any
++ * of the TIMER_* flags)
++ */
++#define timer_setup(timer, callback, flags) \
++ { \
++ init_timer((timer)); \
++ (timer)->function = callback; \
++ (timer)->data = 0; \
++ BUILD_BUG_ON_ZERO((flags) != 0); \
++ }
++#endif
++
++#endif /* _TIMER_COMPATIBILITY_H_ */
+diff --git a/runtime/time.c b/runtime/time.c
+index 2e666d5..91ceafa 100644
+--- a/runtime/time.c
++++ b/runtime/time.c
+@@ -168,10 +168,10 @@ __stp_time_smp_callback(void *val)
+
+ /* The timer callback is in a softIRQ -- interrupts enabled. */
+ static void
+-__stp_time_timer_callback(unsigned long val)
++__stp_time_timer_callback(stp_timer_callback_parameter_t unused)
+ {
+ stp_time_t *time =__stp_time_local_update();
+- (void) val;
++ (void) unused;
+
+ /* PR6481: make sure IRQs are enabled before resetting the timer
+ (IRQs are disabled and then reenabled in
+@@ -200,9 +200,8 @@ __stp_init_time(void *info)
+ time->freq = __stp_get_freq();
+ __stp_time_local_update();
+
+- init_timer(&time->timer);
++ timer_setup(&time->timer, __stp_time_timer_callback, 0);
+ time->timer.expires = jiffies + STP_TIME_SYNC_INTERVAL;
+- time->timer.function = __stp_time_timer_callback;
+
+ #ifndef STAPCONF_ADD_TIMER_ON
+ add_timer(&time->timer);
+diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c
+index f81d75d..135951a 100644
+--- a/runtime/transport/relay_v2.c
++++ b/runtime/transport/relay_v2.c
+@@ -30,7 +30,7 @@
+ #include <linux/debugfs.h>
+ #include <linux/mm.h>
+ #include <linux/relay.h>
+-#include <linux/timer.h>
++#include "../linux/timer_compatibility.h"
+ #include "../uidgid_compatibility.h"
+ #include "relay_compat.h"
+
+@@ -120,7 +120,7 @@ static void __stp_relay_wakeup_readers(struct rchan_buf *buf)
+ wake_up_interruptible(&buf->read_wait);
+ }
+
+-static void __stp_relay_wakeup_timer(unsigned long val)
++static void __stp_relay_wakeup_timer(stp_timer_callback_parameter_t unused)
+ {
+ #ifdef STP_BULKMODE
+ int i;
+@@ -151,10 +151,8 @@ static void __stp_relay_wakeup_timer(unsigned long val)
+ static void __stp_relay_timer_init(void)
+ {
+ atomic_set(&_stp_relay_data.wakeup, 0);
+- init_timer(&_stp_relay_data.timer);
++ timer_setup(&_stp_relay_data.timer, __stp_relay_wakeup_timer, 0);
+ _stp_relay_data.timer.expires = jiffies + STP_RELAY_TIMER_INTERVAL;
+- _stp_relay_data.timer.function = __stp_relay_wakeup_timer;
+- _stp_relay_data.timer.data = 0;
+ add_timer(&_stp_relay_data.timer);
+ smp_mb();
+ }
+diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
+index 3400f22..320fd18 100644
+--- a/runtime/transport/transport.c
++++ b/runtime/transport/transport.c
+@@ -311,7 +311,7 @@ static void _stp_detach(void)
+ }
+
+
+-static void _stp_ctl_work_callback(unsigned long val);
++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused);
+
+ /*
+ * Called when stapio opens the control channel.
+@@ -320,13 +320,12 @@ static void _stp_attach(void)
+ {
+ dbug_trans(1, "attach\n");
+ _stp_pid = current->pid;
+- if (_stp_namespaces_pid < 1)
+- _stp_namespaces_pid = _stp_pid;
++ if (_stp_namespaces_pid < 1)
++ _stp_namespaces_pid = _stp_pid;
+ _stp_transport_data_fs_overwrite(0);
+- init_timer(&_stp_ctl_work_timer);
++
++ timer_setup(&_stp_ctl_work_timer, _stp_ctl_work_callback, 0);
+ _stp_ctl_work_timer.expires = jiffies + STP_CTL_TIMER_INTERVAL;
+- _stp_ctl_work_timer.function = _stp_ctl_work_callback;
+- _stp_ctl_work_timer.data= 0;
+ add_timer(&_stp_ctl_work_timer);
+ }
+
+@@ -341,7 +340,7 @@ static void _stp_attach(void)
+ * notified. Reschedules itself if someone is still attached
+ * to the cmd channel.
+ */
+-static void _stp_ctl_work_callback(unsigned long val)
++static void _stp_ctl_work_callback(stp_timer_callback_parameter_t unused)
+ {
+ int do_io = 0;
+ unsigned long flags;
+diff --git a/tapset-timers.cxx b/tapset-timers.cxx
+index 1a40bcd..0ab4d69 100644
+--- a/tapset-timers.cxx
++++ b/tapset-timers.cxx
+@@ -122,9 +122,13 @@ timer_derived_probe_group::emit_module_decls (systemtap_session& s)
+ s.op->newline(-1) << "};";
+ s.op->newline();
+
+- s.op->newline() << "static void enter_timer_probe (unsigned long val) {";
++ s.op->newline() << "static void enter_timer_probe (stp_timer_callback_parameter_t val) {";
++ s.op->newline() << "#if defined(TIMER_TRACE_FLAGMASK)";
++ s.op->newline(1) << "struct stap_timer_probe* stp = container_of(val, struct stap_timer_probe, timer_list);";
++ s.op->newline(-1) << "#else";
+ s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [val];";
+- s.op->newline() << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||";
++ s.op->newline(-1) << "#endif";
++ s.op->newline(1) << "if ((atomic_read (session_state()) == STAP_SESSION_STARTING) ||";
+ s.op->newline() << " (atomic_read (session_state()) == STAP_SESSION_RUNNING))";
+ s.op->newline(1) << "mod_timer (& stp->timer_list, jiffies + ";
+ emit_interval (s.op);
+@@ -148,9 +152,11 @@ timer_derived_probe_group::emit_module_init (systemtap_session& s)
+ s.op->newline() << "for (i=0; i<" << probes.size() << "; i++) {";
+ s.op->newline(1) << "struct stap_timer_probe* stp = & stap_timer_probes [i];";
+ s.op->newline() << "probe_point = stp->probe->pp;";
+- s.op->newline() << "init_timer (& stp->timer_list);";
+- s.op->newline() << "stp->timer_list.function = & enter_timer_probe;";
++
++ s.op->newline() << "timer_setup (& stp->timer_list, enter_timer_probe, 0);";
++ s.op->newline() << "#if !defined(TIMER_TRACE_FLAGMASK)";
+ s.op->newline() << "stp->timer_list.data = i;"; // NB: important!
++ s.op->newline() << "#endif";
+ // copy timer renew calculations from above :-(
+ s.op->newline() << "stp->timer_list.expires = jiffies + ";
+ emit_interval (s.op);
+diff --git a/tapset/linux/scsi.stp b/tapset/linux/scsi.stp
+index 44f686c..3577942 100644
+--- a/tapset/linux/scsi.stp
++++ b/tapset/linux/scsi.stp
+@@ -14,7 +14,7 @@
+ #include <scsi/scsi_cmnd.h>
+ #include <scsi/scsi_device.h>
+ #include <scsi/scsi_host.h>
+-#include <linux/timer.h>
++#include "linux/timer_compatibility.h"
+ #include <linux/blkdev.h>
+ %}
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch
new file mode 100644
index 000000000..a1b0bff02
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Fixes-for-gcc-8.patch
@@ -0,0 +1,215 @@
+From 4ffe00f1d9eac332d928f7dc01fe250dc32b1bb8 Mon Sep 17 00:00:00 2001
+From: Stan Cox <scox@redhat.com>
+Date: Tue, 13 Feb 2018 22:38:03 -0500
+Subject: [PATCH] Fixes for gcc 8
+
+* includes/sys/sdt.h (__SDT_COND_SIGNED): Add CT, cast type argument
+
+Author: Will Cohen <wcohen.redhat.com>
+
+* stap-serverd.cxx (generate_mok, handleRequest, handle_connection):
+ Catch format overflow
+
+* translate.cxx (translate_pass): Use ref in catch.
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ includes/sys/sdt.h | 20 ++++++++--------
+ stap-serverd.cxx | 67 +++++++++++++++++++++++++++++++++++++++++++++++-------
+ translate.cxx | 2 +-
+ 3 files changed, 70 insertions(+), 19 deletions(-)
+
+diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
+index 940f74483..c0c5a492c 100644
+--- a/includes/sys/sdt.h
++++ b/includes/sys/sdt.h
+@@ -119,8 +119,8 @@ struct __sdt_type
+
+ #define __SDT_ALWAYS_SIGNED(T) \
+ template<> struct __sdt_type<T> { static const bool __sdt_signed = true; };
+-#define __SDT_COND_SIGNED(T) \
+-template<> struct __sdt_type<T> { static const bool __sdt_signed = ((T)(-1) < 1); };
++#define __SDT_COND_SIGNED(T,CT) \
++template<> struct __sdt_type<T> { static const bool __sdt_signed = ((CT)(-1) < 1); };
+ __SDT_ALWAYS_SIGNED(signed char)
+ __SDT_ALWAYS_SIGNED(short)
+ __SDT_ALWAYS_SIGNED(int)
+@@ -141,14 +141,14 @@ __SDT_ALWAYS_SIGNED(const volatile short)
+ __SDT_ALWAYS_SIGNED(const volatile int)
+ __SDT_ALWAYS_SIGNED(const volatile long)
+ __SDT_ALWAYS_SIGNED(const volatile long long)
+-__SDT_COND_SIGNED(char)
+-__SDT_COND_SIGNED(wchar_t)
+-__SDT_COND_SIGNED(volatile char)
+-__SDT_COND_SIGNED(volatile wchar_t)
+-__SDT_COND_SIGNED(const char)
+-__SDT_COND_SIGNED(const wchar_t)
+-__SDT_COND_SIGNED(const volatile char)
+-__SDT_COND_SIGNED(const volatile wchar_t)
++__SDT_COND_SIGNED(char, char)
++__SDT_COND_SIGNED(wchar_t, wchar_t)
++__SDT_COND_SIGNED(volatile char, char)
++__SDT_COND_SIGNED(volatile wchar_t, wchar_t)
++__SDT_COND_SIGNED(const char, char)
++__SDT_COND_SIGNED(const wchar_t, wchar_t)
++__SDT_COND_SIGNED(const volatile char, char)
++__SDT_COND_SIGNED(const volatile wchar_t, wchar_t)
+ #if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+ /* __SDT_COND_SIGNED(char16_t) */
+ /* __SDT_COND_SIGNED(char32_t) */
+diff --git a/stap-serverd.cxx b/stap-serverd.cxx
+index 7cf76c617..41f77ee9e 100644
+--- a/stap-serverd.cxx
++++ b/stap-serverd.cxx
+@@ -1607,6 +1607,7 @@ generate_mok(string &mok_fingerprint)
+ char tmpdir[PATH_MAX] = { '\0' };
+ string public_cert_path, private_cert_path, destdir;
+ mode_t old_umask;
++ int retlen;
+
+ mok_fingerprint.clear ();
+
+@@ -1631,7 +1632,14 @@ generate_mok(string &mok_fingerprint)
+ }
+
+ // Make a temporary directory to store results in.
+- snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ());
++ retlen = snprintf (tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", mok_path.c_str ());
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Could not create %s name", "temporary directory"));
++ tmpdir[0] = '\0';
++ goto cleanup;
++ }
++
+ if (mkdtemp (tmpdir) == NULL)
+ {
+ server_error (_F("Could not create temporary directory %s: %s", tmpdir,
+@@ -1704,6 +1712,7 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
+ unsigned u;
+ unsigned i;
+ FILE* f;
++ int retlen;
+
+ // Save the server version. Do this early, so the client knows what version of the server
+ // it is dealing with, even if the request is not fully completed.
+@@ -1782,7 +1791,12 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
+ struct stat st;
+ char *arg;
+
+- snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i);
++ retlen = snprintf (stapargfile, PATH_MAX, "%s/argv%d", requestDirName.c_str (), i);
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "path"));
++ return;
++ }
+
+ rc = stat(stapargfile, & st);
+ if (rc) break;
+@@ -1888,7 +1902,15 @@ handleRequest (const string &requestDirName, const string &responseDirName, stri
+ {
+ glob_t globber;
+ char pattern[PATH_MAX];
+- snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str());
++ int retlen;
++
++ retlen = snprintf (pattern, PATH_MAX, "%s/*.ko", new_staptmpdir.c_str());
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "pattern"));
++ return;
++ }
++
+ rc = glob (pattern, GLOB_ERR, NULL, &globber);
+ if (rc)
+ server_error (_F("Unable to find a module in %s", new_staptmpdir.c_str()));
+@@ -2164,6 +2186,7 @@ handle_connection (void *arg)
+ copy for each connection.*/
+ vector<string> argv;
+ PRInt32 bytesRead;
++ int retlen;
+
+ /* Detatch to avoid a memory leak */
+ if(max_threads > 0)
+@@ -2213,7 +2236,13 @@ handle_connection (void *arg)
+ #endif
+
+ secStatus = SECFailure;
+- snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp");
++ retlen = snprintf(tmpdir, PATH_MAX, "%s/stap-server.XXXXXX", getenv("TMPDIR") ?: "/tmp");
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "temporary directory"));
++ tmpdir[0]=0; /* prevent /bin/rm */
++ goto cleanup;
++ }
+ rc1 = mkdtemp(tmpdir);
+ if (! rc1)
+ {
+@@ -2223,9 +2252,20 @@ handle_connection (void *arg)
+ }
+
+ /* Create a temporary files names and directories. */
+- snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir);
++ retlen = snprintf (requestFileName, PATH_MAX, "%s/request.zip", tmpdir);
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "request.zip path"));
++ goto cleanup;
++ }
++
++ retlen = snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir);
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "request directory path"));
++ goto cleanup;
++ }
+
+- snprintf (requestDirName, PATH_MAX, "%s/request", tmpdir);
+ rc = mkdir(requestDirName, 0700);
+ if (rc)
+ {
+@@ -2233,7 +2273,13 @@ handle_connection (void *arg)
+ goto cleanup;
+ }
+
+- snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir);
++ retlen = snprintf (responseDirName, PATH_MAX, "%s/response", tmpdir);
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "response directory path"));
++ goto cleanup;
++ }
++
+ rc = mkdir(responseDirName, 0700);
+ if (rc)
+ {
+@@ -2243,7 +2289,12 @@ handle_connection (void *arg)
+ // Set this early, since it gets used for errors to be returned to the client.
+ stapstderr = string(responseDirName) + "/stderr";
+
+- snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir);
++ retlen = snprintf (responseFileName, PATH_MAX, "%s/response.zip", tmpdir);
++ if (retlen < 0 || retlen >= PATH_MAX)
++ {
++ server_error (_F("Error creating %s name", "response.zip path"));
++ goto cleanup;
++ }
+
+ /* Read data from the socket.
+ * If the user is requesting/requiring authentication, authenticate
+diff --git a/translate.cxx b/translate.cxx
+index 1240a80ec..4ade06fdd 100644
+--- a/translate.cxx
++++ b/translate.cxx
+@@ -7860,7 +7860,7 @@ translate_pass (systemtap_session& s)
+ if (versions.size() >= 3 && s.verbose > 1)
+ clog << _F("ignoring extra parts of compat version: %s", s.compatible.c_str()) << endl;
+ }
+- catch (const runtime_error)
++ catch (const runtime_error&)
+ {
+ throw SEMANTIC_ERROR(_F("parse error in compatibility version: %s", s.compatible.c_str()));
+ }
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch
new file mode 100644
index 000000000..528864cc9
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Install-python-modules-to-correct-library-dir.patch
@@ -0,0 +1,36 @@
+From 2ada22f05460223924efe54080cb4419e2b4c276 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 24 Feb 2017 17:53:02 +0200
+Subject: [PATCH] Install python modules to correct library dir.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ python/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/python/Makefile.am b/python/Makefile.am
+index a254480f9..efe9f3c01 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -47,7 +47,7 @@ install-exec-local:
+ if HAVE_PYTHON2_PROBES
+ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON) setup.py build \
+ --build-base $(shell readlink -f $(builddir))/py2build \
+- install --prefix $(DESTDIR)$(prefix) \
++ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${pythondir} \
+ --single-version-externally-managed \
+ --record $(shell readlink -f $(builddir))/py2build/install_files.txt \
+ --verbose)
+@@ -55,7 +55,7 @@ endif
+ if HAVE_PYTHON3_PROBES
+ (cd $(srcdir); CFLAGS="$(AM_CPPFLAGS)" $(PYTHON3) setup.py build \
+ --build-base $(shell readlink -f $(builddir))/py3build \
+- install --prefix $(DESTDIR)$(prefix) \
++ install --prefix $(DESTDIR)$(prefix) --install-lib=$(DESTDIR)${python3dir} \
+ --single-version-externally-managed \
+ --record $(shell readlink -f $(builddir))/py3build/install_files.txt \
+ --verbose)
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch
new file mode 100644
index 000000000..7cd9030ea
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch
@@ -0,0 +1,128 @@
+From 41efad04730be89889d1483719f9a6c9396dc250 Mon Sep 17 00:00:00 2001
+From: David Smith <dsmith@redhat.com>
+Date: Wed, 14 Mar 2018 17:05:25 -0500
+Subject: [PATCH] Make sure sysroot paths don't end with a slash.
+
+* session.cxx (parse_cmdline): Make sure a sysroot path does not end with
+ a '/', since we build paths like: sysroot + "/lib/modules". If the
+ sysroot path ends with a '/', we end up with paths like
+ '/SYSROOT//lib/modules'.
+ (setup_kernel_release): Take a string parameter, not a character pointer.
+* session.h: Update setup_kernel_release() prototype.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ session.cxx | 34 ++++++++++++++++++++++++++--------
+ session.h | 2 +-
+ 2 files changed, 27 insertions(+), 9 deletions(-)
+
+Index: git/session.cxx
+===================================================================
+--- git.orig/session.cxx
++++ git/session.cxx
+@@ -722,6 +722,9 @@ systemtap_session::parse_cmdline (int ar
+ client_options_disallowed_for_unprivileged = "";
+ std::set<std::string> additional_unwindsym_modules;
+ struct rlimit our_rlimit;
++ bool sysroot_option_seen = false;
++ string kernel_release_value;
++
+ while (true)
+ {
+ char * num_endptr;
+@@ -887,7 +890,7 @@ systemtap_session::parse_cmdline (int ar
+ // Note that '-' must come last in a regex bracket expression.
+ assert_regexp_match("-r parameter from client", optarg, "^[a-z0-9_.+-]+$");
+ server_args.push_back (string ("-") + (char)grc + optarg);
+- setup_kernel_release(optarg);
++ kernel_release_value = optarg;
+ break;
+
+ case 'a':
+@@ -1473,7 +1476,7 @@ systemtap_session::parse_cmdline (int ar
+ if (client_options) {
+ cerr << _F("ERROR: %s invalid with %s", "--sysroot", "--client-options") << endl;
+ return 1;
+- } else if (!sysroot.empty()) {
++ } else if (sysroot_option_seen) {
+ cerr << "ERROR: multiple --sysroot options not supported" << endl;
+ return 1;
+ } else {
+@@ -1487,11 +1490,17 @@ systemtap_session::parse_cmdline (int ar
+
+ sysroot = string(spath);
+ free (spath);
+- if (sysroot[sysroot.size() - 1] != '/')
+- sysroot.append("/");
+
+- break;
++ // We do path creation like this:
++ // sysroot + "/lib/modules"
++ // So, we don't want the sysroot path to end with a '/',
++ // otherwise we'll end up with '/foo//lib/modules'.
++ if (sysroot.back() == '/') {
++ sysroot.pop_back();
++ }
+ }
++ sysroot_option_seen = true;
++ break;
+
+ case LONG_OPT_SYSENV:
+ if (client_options) {
+@@ -1501,7 +1510,7 @@ systemtap_session::parse_cmdline (int ar
+ string sysenv_str = optarg;
+ string value;
+ size_t pos;
+- if (sysroot.empty()) {
++ if (! sysroot_option_seen) {
+ cerr << "ERROR: --sysenv must follow --sysroot" << endl;
+ return 1;
+ }
+@@ -1646,6 +1655,15 @@ systemtap_session::parse_cmdline (int ar
+ }
+ }
+
++ if (! kernel_release_value.empty())
++ {
++ setup_kernel_release(kernel_release_value);
++ }
++ else if (! sysroot.empty())
++ {
++ kernel_build_tree = sysroot + "/lib/modules/" + kernel_release + "/build";
++ }
++
+ return 0;
+ }
+
+@@ -2152,7 +2170,7 @@ void systemtap_session::insert_loaded_mo
+ }
+
+ void
+-systemtap_session::setup_kernel_release (const char* kstr)
++systemtap_session::setup_kernel_release (const string& kstr)
+ {
+ // Sometimes we may get dupes here... e.g. a server may have a full
+ // -r /path/to/kernel followed by a client's -r kernel.
+@@ -2183,7 +2201,7 @@ systemtap_session::setup_kernel_release
+ else
+ {
+ update_release_sysroot = true;
+- kernel_release = string (kstr);
++ kernel_release = kstr;
+ if (!kernel_release.empty())
+ kernel_build_tree = "/lib/modules/" + kernel_release + "/build";
+
+Index: git/session.h
+===================================================================
+--- git.orig/session.h
++++ git/session.h
+@@ -144,7 +144,7 @@ public:
+
+ // NB: It is very important for all of the above (and below) fields
+ // to be cleared in the systemtap_session ctor (session.cxx).
+- void setup_kernel_release (const char* kstr);
++ void setup_kernel_release (const std::string& kstr);
+ void insert_loaded_modules ();
+
+ // command line parsing
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch
new file mode 100644
index 000000000..b2820b31e
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-Use-sysroot-when-looking-for-the-System.map-file.patch
@@ -0,0 +1,29 @@
+From 436063d5e4738a9b03535d330a2242be5118e745 Mon Sep 17 00:00:00 2001
+From: David Smith <dsmith@redhat.com>
+Date: Thu, 8 Mar 2018 16:01:58 -0600
+Subject: [PATCH] Use sysroot when looking for the System.map file.
+
+Add sysroot to system_map_path + "/boot/System.map" case. Otherwise
+stap tries to look symbols on host system and it produce error like this:
+
+> Kernel symbol table /boot/System.map-4.9.78-yocto-standard unavailable, (No such file or directory)
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ session.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: git/session.cxx
+===================================================================
+--- git.orig/session.cxx
++++ git/session.cxx
+@@ -2013,7 +2013,7 @@ systemtap_session::parse_kernel_function
+ clog << _F("Kernel symbol table %s unavailable, (%s)",
+ system_map_path.c_str(), strerror(errno)) << endl;
+
+- system_map_path = "/boot/System.map-" + kernel_release;
++ system_map_path = sysroot + "/boot/System.map-" + kernel_release;
+ system_map.clear();
+ system_map.open(system_map_path.c_str(), ifstream::in);
+ if (! system_map.is_open())
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch
new file mode 100644
index 000000000..98181a129
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch
@@ -0,0 +1,39 @@
+From 183c7a7a8167333c873525f7908913837b8dc3cb Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Tue, 20 Mar 2018 12:41:05 -0500
+Subject: [PATCH] _stp_umodule_relocate needs target file path, not host file
+ path
+
+Strip of sysroot from module name is required when _stp_umodule_relocate
+call is generated. Otherwise path won't match path on target and could
+will fail to calculated address within the file.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ loc2stap.cxx | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/loc2stap.cxx b/loc2stap.cxx
+index 4818ee0..e09954f 100644
+--- a/loc2stap.cxx
++++ b/loc2stap.cxx
+@@ -17,6 +17,7 @@
+
+ #include "loc2stap.h"
+ #include "dwflpp.h"
++#include "tapsets.h"
+
+ #if ! _ELFUTILS_PREREQ(0, 153)
+ #define DW_OP_GNU_entry_value 0xf3
+@@ -106,7 +107,9 @@ location_context::translate_address(Dwarf_Addr addr)
+ c = "/* pragma:vma */ "
+ "({ unsigned long addr = 0; "
+ "addr = _stp_umodule_relocate (\""
+- + resolve_path(dw->module_name.c_str()) + "\", "
++ + path_remove_sysroot(dw->sess,
++ resolve_path(dw->module_name.c_str()))
++ + "\", "
+ + lex_cast_hex (addr)
+ + ", current); addr; })";
+ }
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch
new file mode 100644
index 000000000..7996fdde7
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-buildrun-remove-quotes-around-I-include-line.patch
@@ -0,0 +1,38 @@
+From 75c4aec6de3a615909f3283eac585760de101b8c Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw@linux.intel.com>
+Date: Tue, 7 Mar 2017 10:46:12 -0800
+Subject: [PATCH] buildrun: remove quotes around -I include line
+
+By having the quotes, the kernel Makefile addtree macro adds the
+kernel $srctree directory as a prefix and causes compilation failures.
+Removing the quotes resolves the issue.
+
+This is trimmed from the verbose output of the GCC command line
+Before:
+ -I/srv/sdb/builds/4.9/tmp/work-shared/qemux86-64/kernel-source/"/srv/sdb/releases/jethro/builds/4.1/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime"
+
+After:
+ -I/srv/sdb/builds/4.9/tmp/sysroots/x86_64-linux/usr/share/systemtap/runtime
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ buildrun.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/buildrun.cxx b/buildrun.cxx
+index aaea64c..8a8ee9f 100644
+--- a/buildrun.cxx
++++ b/buildrun.cxx
+@@ -495,7 +495,7 @@ compile_pass (systemtap_session& s)
+ #if CHECK_POINTER_ARITH_PR5947
+ o << "EXTRA_CFLAGS += -Wpointer-arith" << endl;
+ #endif
+- o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
++ o << "EXTRA_CFLAGS += -I" << s.runtime_path << endl;
+ // XXX: this may help ppc toc overflow
+ // o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl;
+ o << "obj-m := " << s.module_name << ".o" << endl;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch
new file mode 100644
index 000000000..160642db0
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch
@@ -0,0 +1,42 @@
+From b29e448e12040ed8f4d83743a14db0f138a7cc67 Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Wed, 14 Mar 2018 16:54:08 -0500
+Subject: [PATCH] debuginfo lookup with sysroot case do not remove sysroot from
+ file_name
+
+If sysroot option is passed, and debug symbols reside in sysroot along
+with executable <foo> in <foo_dir>/.debug/<foo_file> directory,
+stap fails to find debuginfo because it strips out sysroot path
+from file_name so dwfl_standard_find_debuginfo ends up looking at
+host <foo_dir>/.debug/<foo_file> rather then checking
+<sysroot>/<foo_dir>/.debug/<foo_file>.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ setupdwfl.cxx | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/setupdwfl.cxx b/setupdwfl.cxx
+index 11e0bb2..2a87982 100644
+--- a/setupdwfl.cxx
++++ b/setupdwfl.cxx
+@@ -627,18 +627,6 @@ internal_find_debuginfo (Dwfl_Module *mod,
+
+ call_dwfl_standard_find_debuginfo:
+
+- if (current_session_for_find_debuginfo)
+- {
+- string sysroot = current_session_for_find_debuginfo->sysroot + "/*";
+- int found = fnmatch(sysroot.c_str(), file_name, 0);
+-
+- if (found)
+- {
+- file_name = file_name
+- + current_session_for_find_debuginfo->sysroot.length() - 1;
+- }
+- }
+-
+ /* Call the original dwfl_standard_find_debuginfo */
+ return dwfl_standard_find_debuginfo(mod, userdata, modname, base,
+ file_name, debuglink_file,
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch
new file mode 100644
index 000000000..9f11648fe
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch
@@ -0,0 +1,62 @@
+From 3e13a006fe3dff9489269274093bf868532036e2 Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw@linux.intel.com>
+Date: Tue, 5 Sep 2017 16:02:55 -0700
+Subject: [PATCH] staprun/stapbpf: don't support installing a non-root
+
+Since we are in a known environment and installing as root and
+expect to be running as root, don't create the group or chmod
+the binaries.
+
+Upstream-Status: Inappropriate [Embedded]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ stapbpf/Makefile.am | 14 +++++++-------
+ staprun/Makefile.am | 12 ++++++------
+ 2 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/stapbpf/Makefile.am b/stapbpf/Makefile.am
+index 421b044ef..f7daeb2b2 100644
+--- a/stapbpf/Makefile.am
++++ b/stapbpf/Makefile.am
+@@ -39,11 +39,11 @@ git_version.stamp ../git_version.h:
+
+ # Why the "id -u" condition? This way, an unprivileged user can run
+ # make install, and have "sudo stap ...." or "sudo stapbpf ...." work later.
+-install-exec-hook:
+- if [ `id -u` -eq 0 ]; then \
+- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
+- getent group stapusr >/dev/null \
+- && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
+- && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
+- fi
++#install-exec-hook:
++# if [ `id -u` -eq 0 ]; then \
++# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
++# getent group stapusr >/dev/null \
++# && chgrp stapusr "$(DESTDIR)$(bindir)/stapbpf" \
++# && chmod 04110 "$(DESTDIR)$(bindir)/stapbpf"; \
++# fi
+ endif
+diff --git a/staprun/Makefile.am b/staprun/Makefile.am
+index 4073aa01c..2925e34c3 100644
+--- a/staprun/Makefile.am
++++ b/staprun/Makefile.am
+@@ -72,9 +72,9 @@ git_version.stamp ../git_version.h:
+
+ # Why the "id -u" condition? This way, an unprivileged user can run
+ # make install, and have "sudo stap ...." or "sudo staprun ...." work later.
+-install-exec-hook:
+- if [ `id -u` -eq 0 ]; then \
+- getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
+- getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \
+- chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
+- fi
++#install-exec-hook:
++# if [ `id -u` -eq 0 ]; then \
++# getent group stapusr >/dev/null || groupadd -g 156 -r stapusr 2>/dev/null || groupadd -r stapusr; \
++# getent group stapusr >/dev/null && chgrp stapusr "$(DESTDIR)$(bindir)/staprun"; \
++# chmod 04110 "$(DESTDIR)$(bindir)/staprun"; \
++# fi
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch
new file mode 100644
index 000000000..6fe7d4d1c
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling-follow-u.patch
@@ -0,0 +1,40 @@
+From 7e11f129ff370ce5f39812ce2ae6ce40818a347f Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Thu, 22 Mar 2018 16:02:02 -0500
+Subject: [PATCH] sysroot: fix short release -r option handling follow up
+
+In case of sysroot set and short release -r option it does not make sense
+to pass short release name into dwfl_linux_kernel_report_offline
+function. This function is not aware about sysroot and it won't look for
+kernel modules under sysroot directory.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ setupdwfl.cxx | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/setupdwfl.cxx b/setupdwfl.cxx
+index c419afa..0cf5810 100644
+--- a/setupdwfl.cxx
++++ b/setupdwfl.cxx
+@@ -367,7 +367,15 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s)
+ // hard-code this magic here.
+ string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build";
+ if (s.kernel_build_tree == lib_path)
+- elfutils_kernel_path = s.kernel_release;
++ {
++ if (s.sysroot != "")
++ // If we have sysroot set does not make sense to pass
++ // short release to dwfl, it won't take a sysroot into
++ // account. Let's construct full path in such case.
++ elfutils_kernel_path = string(s.sysroot + "/lib/modules/" + s.kernel_release);
++ else
++ elfutils_kernel_path = s.kernel_release;
++ }
+ else
+ elfutils_kernel_path = s.kernel_build_tree;
+ offline_modules_found = 0;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch
new file mode 100644
index 000000000..b31d6274e
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-fix-short-release-r-option-handling.patch
@@ -0,0 +1,53 @@
+From a9ce89bcd2d78728faef59bda60e75510972cd56 Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Wed, 14 Mar 2018 17:09:44 -0500
+Subject: [PATCH] sysroot: fix short release -r option handling
+
+* setupdwfl.cxx (debuginfo_path_insert_sysroot): Add a '/' to the end of
+ the sysroot for path_insert_sysroot().
+ (setup_dwfl_kernel): Simplify logic when finding the kernel path to send
+ to elfutils.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ setupdwfl.cxx | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/setupdwfl.cxx b/setupdwfl.cxx
+index 2a87982..f6c3157 100644
+--- a/setupdwfl.cxx
++++ b/setupdwfl.cxx
+@@ -339,6 +339,13 @@ static char * path_insert_sysroot(string sysroot, string path)
+
+ void debuginfo_path_insert_sysroot(string sysroot)
+ {
++ // FIXME: This is a short-term fix, until we expect sysroot paths to
++ // always end with a '/' (and never be empty).
++ //
++ // The path_insert_sysroot() function assumes that sysroot has a '/'
++ // on the end. Make sure that is true.
++ if (sysroot.back() != '/')
++ sysroot.push_back('/');
+ debuginfo_path = path_insert_sysroot(sysroot, debuginfo_path);
+ debuginfo_usr_path = path_insert_sysroot(sysroot, debuginfo_usr_path);
+ }
+@@ -358,13 +365,11 @@ setup_dwfl_kernel (unsigned *modules_found, systemtap_session &s)
+ // no way to set the dwfl_callback.debuginfo_path and always
+ // passs the plain kernel_release here. So instead we have to
+ // hard-code this magic here.
+- string lib_path = "/lib/modules/" + s.kernel_release + "/build";
+- if (s.kernel_build_tree == string(s.sysroot + lib_path) ||
+- (s.kernel_build_tree == lib_path
+- && s.sysroot == "/"))
+- elfutils_kernel_path = s.kernel_release;
+- else
+- elfutils_kernel_path = s.kernel_build_tree;
++ string lib_path = s.sysroot + "/lib/modules/" + s.kernel_release + "/build";
++ if (s.kernel_build_tree == lib_path)
++ elfutils_kernel_path = s.kernel_release;
++ else
++ elfutils_kernel_path = s.kernel_build_tree;
+ offline_modules_found = 0;
+
+ // First try to report full path modules.
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch
new file mode 100644
index 000000000..8a3d39a5b
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch
@@ -0,0 +1,117 @@
+From 2041085d1a700201dc088991ca8136e7935bf42f Mon Sep 17 00:00:00 2001
+From: Victor Kamensky <kamensky@cisco.com>
+Date: Wed, 21 Mar 2018 11:35:26 -0500
+Subject: [PATCH] sysroot: handle symbolic links with absolute name relative to
+ sysroot
+
+In case of symbolic link found under sysroot point to absolute path,
+instead of trying to look for such absolute path in host system,
+apply sysroot prefix first.
+
+Upstream-Status: Backport
+Signed-off-by: Victor Kamensky <kamensky@cisco.com>
+---
+ util.cxx | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 76 insertions(+)
+
+Index: git/util.cxx
+===================================================================
+--- git.orig/util.cxx
++++ git/util.cxx
+@@ -441,6 +441,64 @@ split_lines(const char *buf, size_t n)
+ return lines;
+ }
+
++static string
++follow_link(const string& name, const string& sysroot)
++{
++ char *linkname;
++ ssize_t r;
++ string retpath;
++ struct stat st;
++
++ const char *f = name.c_str();
++
++ lstat(f, &st);
++
++ linkname = (char *) malloc(st.st_size + 1);
++
++ if (linkname)
++ {
++ r = readlink(f, linkname, st.st_size + 1);
++ linkname[st.st_size] = '\0';
++ /*
++ * If we have non-empty sysroot and we got link that
++ * points to absolute path name, we need to look at
++ * this path relative to sysroot itself. access and
++ * stat will follow symbolic links correctly only in
++ * case with empty sysroot.
++ */
++ while (r != -1 && linkname && linkname[0] == '/')
++ {
++ string fname1 = sysroot + linkname;
++ const char *f1 = fname1.c_str();
++ if (access(f1, X_OK) == 0
++ && stat(f1, &st) == 0
++ && S_ISREG(st.st_mode))
++ {
++ retpath = fname1;
++ break;
++ }
++ else if (lstat(f1, &st) == 0
++ && S_ISLNK(st.st_mode))
++ {
++ free(linkname);
++ linkname = (char *) malloc(st.st_size + 1);
++ if (linkname)
++ {
++ r = readlink(f1, linkname, st.st_size + 1);
++ linkname[st.st_size] = '\0';
++ }
++ }
++ else
++ {
++ break;
++ }
++ }
++ }
++ free(linkname);
++
++ return retpath;
++}
++
+ // Resolve an executable name to a canonical full path name, with the
+ // same policy as execvp(). A program name not containing a slash
+ // will be searched along the $PATH.
+@@ -465,6 +523,14 @@ string find_executable(const string& nam
+ if (name.find('/') != string::npos) // slash in the path already?
+ {
+ retpath = sysroot + name;
++
++ const char *f = retpath.c_str();
++ if (sysroot != ""
++ && lstat(f, &st) == 0
++ && S_ISLNK(st.st_mode))
++ {
++ retpath = follow_link(f, sysroot);
++ }
+ }
+ else // Nope, search $PATH.
+ {
+@@ -493,6 +559,16 @@ string find_executable(const string& nam
+ retpath = fname;
+ break;
+ }
++ else if (sysroot != ""
++ && lstat(f, &st) == 0
++ && S_ISLNK(st.st_mode))
++ {
++ retpath = follow_link(f, sysroot);
++ if (retpath != "")
++ {
++ break;
++ }
++ }
+ }
+ }
+ }
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
new file mode 100644
index 000000000..b4f2fbc06
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
@@ -0,0 +1,39 @@
+From 5eb10d90af9178edb65e6091ae939d1b5b19bb78 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Tue, 23 Sep 2014 04:47:10 -0400
+Subject: [PATCH] systemtap: allow to disable libvirt
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a631ae7..cb4885b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -525,10 +525,15 @@ dnl Check for the libvirt and libxml2 devel packages
+
+ dnl We require libvirt >= 1.0.2 because stapvirt relies on the
+ dnl virDomainOpenChannel function, which was implemented in 1.0.2.
+-PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
+- have_libvirt=yes
+- AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
+- ], [have_libvirt=no])
++AC_ARG_ENABLE([libvirt],
++ AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present]))
++
++if test "$enable_libvirt" != no; then
++ PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
++ have_libvirt=yes
++ AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
++ ], [have_libvirt=no])
++fi
+ AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
+ PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
+ have_libxml2=yes
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch b/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch
new file mode 100644
index 000000000..b7ee0701b
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/monitor-option.patch
@@ -0,0 +1,40 @@
+From 93fc4744fedf6fc593ee656968da97f7b1862ada Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 4 Oct 2016 16:37:53 +0100
+Subject: [PATCH 4/6] systemtap: rationalise dependencies
+
+Add an option to explicitly disable the monitor (and therefore the dependency on
+json-c and ncurses).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ configure.ac | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6bd0c5fc4..2ea9b3cbf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -752,13 +752,16 @@ dnl We want either (or both) python probe support.
+ AM_CONDITIONAL([HAVE_PYTHON_PROBES],
+ [test "x$have_python2_support" = "xyes" -o "x$have_python3_support" = "xyes"])
+
++AC_ARG_ENABLE([monitor], AS_HELP_STRING([--disable-monitor],[Disable monitor]))
++if test "$enable_monitor" != "no"; then
+ dnl Check for presence of json-c and ncurses for use in monitor mode
+ PKG_CHECK_MODULES([jsonc], [json-c >= 0.12], [have_jsonc=yes], [have_jsonc=no])
+ PKG_CHECK_MODULES([ncurses], [ncurses], [have_ncurses=yes], [have_ncurses=no])
+-AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes"])
+ if test "${have_jsonc}" == "yes" -a "${have_ncurses}" == yes; then
+ AC_DEFINE([HAVE_MONITOR_LIBS],[1],[Define to 1 if json-c and ncurses libraries are installed])
+ fi
++fi
++AM_CONDITIONAL([HAVE_MONITOR_LIBS], [test "${have_jsonc}" == "yes" -a "${have_ncurses}" == "yes" -a "$enable_monitor" != "no"])
+
+ AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
+ old_CFLAGS="$CFLAGS"
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch b/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch
new file mode 100644
index 000000000..2c860b19e
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/no-msgfmt-check.patch
@@ -0,0 +1,33 @@
+From 43f1b04449bb1cf7e0092263f1c2a25f3fca08ef Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 8 Nov 2016 23:07:41 +0000
+Subject: [PATCH 5/6] systemtap: remove explicit msgfmt check
+
+There is no need to explicitly check that msgfmt was found as the gettext macros
+handle this for us if NLS is enabled.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ configure.ac | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2ea9b3cbf..95417f59c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -36,10 +36,6 @@ AC_CHECK_FUNCS(openat)
+ AM_GNU_GETTEXT(external)
+ AM_GNU_GETTEXT_VERSION([0.19.4])
+
+-if test "x$GMSGFMT" = "x:"; then
+- AC_MSG_ERROR([missing gnu /usr/bin/msgfmt])
+-fi
+-
+ # We want the 'PYTHON' varible to be python version 2. We also want
+ # our custom 'PYTHON3' varible to be python version 3.
+ #
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
new file mode 100644
index 000000000..28a7eae40
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
@@ -0,0 +1,34 @@
+Fix time_t print because in x32 ABI is long long int instead of long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+diff --git a/cache.cxx b/cache.cxx
+index 3546b30..19c77ca 100644
+--- a/cache.cxx
++++ b/cache.cxx
+@@ -294,7 +294,11 @@ clean_cache(systemtap_session& s)
+ {
+ //interval not passed, don't continue
+ if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++ clog << _F("Cache cleaning skipped, interval not reached %lld s / %lu s.",
++#else
+ clog << _F("Cache cleaning skipped, interval not reached %lu s / %lu s.",
++#endif
+ (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl;
+ return;
+ }
+@@ -302,7 +306,11 @@ clean_cache(systemtap_session& s)
+ {
+ //interval reached, continue
+ if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++ clog << _F("Cleaning cache, interval reached %lld s > %lu s.",
++#else
+ clog << _F("Cleaning cache, interval reached %lu s > %lu s.",
++#endif
+ (current_time.tv_sec-sb.st_mtime), cache_clean_interval) << endl;
+ }
+
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap_git.bb b/poky/meta/recipes-kernel/systemtap/systemtap_git.bb
new file mode 100644
index 000000000..b280f583e
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
+HOMEPAGE = "https://sourceware.org/systemtap/"
+
+require systemtap_git.inc
+
+DEPENDS = "elfutils"
+
+EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
+ --without-nss --without-avahi --without-dyninst \
+ --disable-server --disable-grapher --enable-prologues \
+ --with-python3 --without-python2-probes \
+ ac_cv_prog_have_javac=no \
+ ac_cv_prog_have_jar=no "
+
+STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
+
+EXTRA_OECONF += "${STAP_DOCS} "
+
+PACKAGECONFIG ??= "translator sqlite monitor python3-probes"
+PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,python3-core bash perl"
+PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
+PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
+PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
+PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
+
+inherit autotools gettext pkgconfig distutils3-base
+
+do_install_append () {
+ if [ ! -f ${D}${bindir}/stap ]; then
+ # translator disabled case, need to leave only minimal runtime
+ rm -rf ${D}${datadir}/${PN}
+ rm ${D}${libexecdir}/${PN}/stap-env
+ fi
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-kernel/systemtap/systemtap_git.inc b/poky/meta/recipes-kernel/systemtap/systemtap_git.inc
new file mode 100644
index 000000000..e2f5204a0
--- /dev/null
+++ b/poky/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -0,0 +1,38 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SRCREV = "4051c70c9318c837981384cbb23f3e9eb1bd0892"
+PV = "3.2"
+
+SRC_URI = "git://sourceware.org/git/systemtap.git \
+ file://configure-allow-to-disable-libvirt.patch \
+ file://x32_abi_time.patch \
+ file://monitor-option.patch \
+ file://no-msgfmt-check.patch \
+ file://0001-Do-not-let-configure-write-a-python-location-into-th.patch \
+ file://0001-Install-python-modules-to-correct-library-dir.patch \
+ file://0001-buildrun-remove-quotes-around-I-include-line.patch \
+ file://0001-staprun-stapbpf-don-t-support-installing-a-non-root.patch \
+ file://0001-Fix-PR22551-by-updating-the-use-of-timers-for-the-4..patch \
+ file://0001-Fixes-for-gcc-8.patch \
+ file://0001-Use-sysroot-when-looking-for-the-System.map-file.patch \
+ file://0001-debuginfo-lookup-with-sysroot-case-do-not-remove-sys.patch \
+ file://0001-Make-sure-sysroot-paths-don-t-end-with-a-slash.patch \
+ file://0001-sysroot-fix-short-release-r-option-handling.patch \
+ file://0001-Delay-adding-sysroot-path-to-module-name-in-case-of-.patch \
+ file://0001-Added-a-couple-of-small-sysroot-fixes.patch \
+ file://0001-_stp_umodule_relocate-needs-target-file-path-not-hos.patch \
+ file://0001-sysroot-handle-symbolic-links-with-absolute-name-rel.patch \
+ file://0001-sysroot-fix-short-release-r-option-handling-follow-u.patch \
+ "
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux'
+COMPATIBLE_HOST_libc-musl = 'null'
+
+S = "${WORKDIR}/git"
+
+# systemtap can't be built without optimization, if someone tries to compile an
+# entire image as -O0, break with fatal.
+python () {
+ if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+ bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.")
+}
diff --git a/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb b/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
new file mode 100644
index 000000000..9a5e8006c
--- /dev/null
+++ b/poky/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Graphical trace viewer for Ftrace"
+LICENSE = "GPLv2"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://kernel-shark.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e"
+
+DEPENDS = "gtk+ libxml2"
+RDEPENDS_${PN} = "trace-cmd"
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+
+EXTRA_OEMAKE = "\
+ 'prefix=${prefix}' \
+ 'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+ 'libdir=${libdir}' \
+ NO_PYTHON=1 \
+ gui \
+"
+do_configure_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.*.d
+}
+
+do_install() {
+ oe_runmake DESTDIR="${D}" install_gui
+ rm ${D}${bindir}/trace-cmd
+ rm -rf ${D}${libdir}/trace-cmd
+ rm -rf ${D}${sysconfdir}/bash_completion.d/trace-cmd.bash
+ rmdir ${D}${libdir}
+}
diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc b/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc
new file mode 100644
index 000000000..0a1789c45
--- /dev/null
+++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd.inc
@@ -0,0 +1,13 @@
+SRCREV = "7d0147bbba3ed1d5ef6eea4eec3f0ad4c98f02b5"
+PV = "2.7"
+
+inherit pkgconfig
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/trace-cmd:"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git \
+ file://blktrace-api-compatibility.patch \
+ file://0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch \
+"
+
+S = "${WORKDIR}/git"
diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch
new file mode 100644
index 000000000..576308356
--- /dev/null
+++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/0001-Include-limits.h-so-that-PATH_MAX-is-defined-an-issu.patch
@@ -0,0 +1,27 @@
+From 9488f92c1d0c7931c3e17950d1f9eea2aeb3e2bd Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 14 Jun 2017 15:56:18 +0300
+Subject: [PATCH] Include limits.h so that PATH_MAX is defined (an issue on
+ musl).
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ trace-listen.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/trace-listen.c b/trace-listen.c
+index 17ff9d8..838d6bc 100644
+--- a/trace-listen.c
++++ b/trace-listen.c
+@@ -31,6 +31,7 @@
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <limits.h>
+
+ #include "trace-local.h"
+ #include "trace-msg.h"
+--
+2.11.0
+
diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
new file mode 100644
index 000000000..320db6a32
--- /dev/null
+++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
@@ -0,0 +1,29 @@
+trace-cmd: Add blktrace_api compatibility for TC_BARRIER
+
+Newer kernels replace TC_BARRIER with TC_FLUSH. Ensure trace-cmd
+can build regardless of the linux-kernel-headers version.
+
+Upstream-Status: Inappropriate [Stop gap]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+diff --git a/plugin_blk.c b/plugin_blk.c
+index 9327b17..c8e5e1c 100644
+--- a/plugin_blk.c
++++ b/plugin_blk.c
+@@ -44,6 +44,15 @@ struct blk_data {
+ unsigned short pdu_len;
+ };
+
++/*
++ * Newer kernels don't define BLK_TC_BARRIER and have replaced it with
++ * BLK_TC_FLUSH. In this case, define it here and report FLUSHES as BARRIERS as
++ * a workaround, as described in:
++ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=c09c47caedc9854d59378d6e34c989e51cfdd2b4
++ */
++#ifndef BLK_TC_BARRIER
++#define BLK_TC_BARRIER 1<<2
++#endif
+ static void fill_rwbs(char *rwbs, int action, unsigned int bytes)
+ {
+ int i = 0;
diff --git a/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb b/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
new file mode 100644
index 000000000..27c7c1975
--- /dev/null
+++ b/poky/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "User interface to Ftrace"
+HOMEPAGE = "http://git.kernel.org/"
+LICENSE = "GPLv2 & LGPLv2.1"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \
+ file://COPYING.LIB;md5=edb195fe538e4552c1f6ca0fd7bf4f0a \
+ file://trace-input.c;beginline=5;endline=8;md5=3ec82f43bbe0cfb5951ff414ef4d44d0 \
+"
+
+EXTRA_OEMAKE = "\
+ 'prefix=${prefix}' \
+ 'bindir=${bindir}' \
+ 'man_dir=${mandir}' \
+ 'html_install=${datadir}/kernelshark/html' \
+ 'img_install=${datadir}/kernelshark/html/images' \
+ \
+ 'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+ 'libdir=${libdir}' \
+ \
+ NO_PYTHON=1 \
+"
+
+do_compile_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.*.d
+}
+
+do_install() {
+ oe_runmake DESTDIR="${D}" install
+}
+
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-fpu.inc b/poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
new file mode 100644
index 000000000..355a9dfcd
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-fpu.inc
@@ -0,0 +1,4 @@
+def get_alsa_fpu_setting(bb, d):
+ if d.getVar('TARGET_FPU') in [ 'soft' ]:
+ return "--with-softfloat"
+ return ""
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.5.bb b/poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.5.bb
new file mode 100644
index 000000000..c5bf107e5
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-lib_1.1.5.bb
@@ -0,0 +1,40 @@
+SUMMARY = "ALSA sound library"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+ file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2"
+SRC_URI[md5sum] = "a2b465c3a5265d8a57f3ff39c6c4fc29"
+SRC_URI[sha256sum] = "f4f68ad3c6da36b0b5241ac3c798a7a71e0e97d51f972e9f723b3f20a9650ae6"
+
+inherit autotools pkgconfig
+
+require alsa-fpu.inc
+EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
+
+EXTRA_OECONF += "--disable-python"
+
+PACKAGES =+ "alsa-server libasound alsa-conf alsa-doc"
+FILES_libasound = "${libdir}/libasound.so.*"
+FILES_alsa-server = "${bindir}/*"
+FILES_alsa-conf = "${datadir}/alsa/"
+
+RDEPENDS_libasound = "alsa-conf"
+
+# alsa-lib gets automatically added to alsa-lib-dev dependencies, but the
+# alsa-lib package doesn't exist. libasound is the real library package.
+RDEPENDS_${PN}-dev = "libasound"
+
+# upgrade path
+RPROVIDES_${PN}-dev = "alsa-dev"
+RREPLACES_${PN}-dev = "alsa-dev"
+RCONFLICTS_${PN}-dev = "alsa-dev"
+
+RPROVIDES_alsa-conf = "alsa-conf-base"
+RREPLACES_alsa-conf = "alsa-conf-base"
+RCONFLICTS_alsa-conf = "alsa-conf-base"
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.5.bb b/poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.5.bb
new file mode 100644
index 000000000..4bd0acc54
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-plugins_1.1.5.bb
@@ -0,0 +1,103 @@
+SUMMARY = "ALSA Plugins"
+HOMEPAGE = "http://alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "multimedia"
+
+# The primary license of alsa-plugins is LGPLv2.1.
+#
+# m4/attributes.m4 is licensed under GPLv2+. m4/attributes.m4 is part of the
+# build system, and doesn't affect the licensing of the build result.
+#
+# The samplerate plugin source code is licensed under GPLv2+ to be consistent
+# with the libsamplerate license. However, if the licensee has a commercial
+# license for libsamplerate, the samplerate plugin may be used under the terms
+# of LGPLv2.1 like the rest of the plugins.
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+ file://COPYING.GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://m4/attributes.m4;endline=33;md5=b25958da44c02231e3641f1bccef53eb \
+ file://rate/rate_samplerate.c;endline=35;md5=fd77bce85f4a338c0e8ab18430b69fae \
+"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/plugins/${BP}.tar.bz2"
+SRC_URI[md5sum] = "f898b0e6e8acf3f6f82bc2a0f0c84a97"
+SRC_URI[sha256sum] = "797da5f8f53379fbea28817bc466de16affd2c07849e84f1af8d5e22f7bb7f1c"
+
+DEPENDS += "alsa-lib"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "\
+ samplerate \
+ speexdsp \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
+"
+PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec,libav"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
+PACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
+PACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
+
+PACKAGES_DYNAMIC = "^libasound-module-.*"
+
+# The alsa-plugins package doesn't itself contain anything, it just depends on
+# all built plugins.
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+ rm ${D}${libdir}/alsa-lib/*.la
+
+ # We use the example as is, so just drop the .example suffix.
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
+ mv ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
+ fi
+}
+
+python populate_packages_prepend() {
+ plugindir = d.expand('${libdir}/alsa-lib/')
+ packages = " ".join(do_split_packages(d, plugindir, '^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
+ d.setVar("RDEPENDS_alsa-plugins", packages)
+}
+
+# The rate plugins create some symlinks. For example, the samplerate plugin
+# creates these links to the main plugin file:
+#
+# libasound_module_rate_samplerate_best.so
+# libasound_module_rate_samplerate_linear.so
+# libasound_module_rate_samplerate_medium.so
+# libasound_module_rate_samplerate_order.so
+#
+# The other rate plugins create similar links. We have to add the links to
+# FILES manually, because do_split_packages() skips the links (which is good,
+# because we wouldn't want do_split_packages() to create separate packages for
+# the symlinks).
+#
+# The symlinks cause QA errors, because usually it's a bug if a non
+# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
+# the errors are false positives, so we disable the QA checks.
+FILES_${MLPREFIX}libasound-module-rate-lavcrate += "${libdir}/alsa-lib/*rate_lavcrate_*.so"
+FILES_${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
+FILES_${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-lavcrate = "dev-so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
+
+# 50-pulseaudio.conf defines a device named "pulse" that applications can use
+# if they explicitly want to use the PulseAudio plugin.
+# 99-pulseaudio-default.conf configures the "default" device to use the
+# PulseAudio plugin.
+FILES_${PN}-pulseaudio-conf += "\
+ ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
+ ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
+"
+
+RDEPENDS_${PN}-pulseaudio-conf += "\
+ libasound-module-conf-pulse \
+ libasound-module-ctl-pulse \
+ libasound-module-pcm-pulse \
+"
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch b/poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch
new file mode 100644
index 000000000..2e74963c8
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch
@@ -0,0 +1,32 @@
+Add parameters to autoreconf to support cross compile.
+Remove some sub-components which needs further recipe support.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN alsa-tools-1.0.24.1-orig//ld10k1/gitcompile alsa-tools-1.0.24.1/ld10k1/gitcompile
+--- alsa-tools-1.0.24.1-orig//ld10k1/gitcompile 2011-07-06 11:27:40.227665002 +0800
++++ alsa-tools-1.0.24.1/ld10k1/gitcompile 2011-07-14 13:26:18.017665004 +0800
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+
+-autoreconf -fi || exit 1
++autoreconf $ACLOCAL_FLAGS -fi || exit 1
+ export CFLAGS='-O2 -Wall -pipe -g'
+ echo "CFLAGS=$CFLAGS"
+ echo "./configure $@"
+diff -ruN alsa-tools-1.0.24.1-orig//Makefile alsa-tools-1.0.24.1/Makefile
+--- alsa-tools-1.0.24.1-orig//Makefile 2011-07-06 11:27:40.207665000 +0800
++++ alsa-tools-1.0.24.1/Makefile 2011-07-14 15:08:08.877665009 +0800
+@@ -1,8 +1,8 @@
+ VERSION = 1.1.5
+ TOP = .
+-SUBDIRS = as10k1 envy24control hdsploader hdspconf hdspmixer \
++SUBDIRS = as10k1 envy24control \
+ mixartloader pcxhrloader rmedigicontrol sb16_csp seq sscape_ctl \
+- us428control usx2yloader vxloader echomixer ld10k1 qlo10k1 \
++ us428control usx2yloader vxloader echomixer \
+ hwmixvolume hdajackretask hda-verb hdajacksensetest
+
+ all:
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest b/poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest
new file mode 100755
index 000000000..58328bd3a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+aclocal $ACLOCAL_FLAGS || exit 1
+automake --foreign --add-missing || exit 1
+autoconf || exit 1
+export CFLAGS='-O2 -Wall -pipe -g'
+echo "CFLAGS=$CFLAGS"
+echo "./configure $@"
+./configure $@ || exit 1
+unset CFLAGS
+if [ -z "$GITCOMPILE_NO_MAKE" ]; then
+ make || exit 1
+fi
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch b/poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch
new file mode 100644
index 000000000..54373d1a8
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch
@@ -0,0 +1,29 @@
+Remove some sub-components which need gtk+.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Rogerio Nunes <ronunes@gmail.com>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+Update patch for alsa-tools 1.0.29
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 2457a1c..72346d9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,9 @@
+ VERSION = 1.1.5
+ TOP = .
+-SUBDIRS = as10k1 envy24control \
+- mixartloader pcxhrloader rmedigicontrol sb16_csp seq sscape_ctl \
+- us428control usx2yloader vxloader echomixer \
+- hwmixvolume hdajackretask hda-verb hdajacksensetest
++SUBDIRS = as10k1 \
++ mixartloader pcxhrloader sb16_csp seq sscape_ctl \
++ us428control usx2yloader vxloader \
++ hwmixvolume hda-verb hdajacksensetest
+
+ all:
+ @for i in $(SUBDIRS); do \
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.5.bb b/poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.5.bb
new file mode 100644
index 000000000..1be43aa6e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-tools_1.1.5.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Advanced tools for certain ALSA sound card drivers"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2+"
+DEPENDS = "alsa-lib ncurses glib-2.0"
+
+LIC_FILES_CHKSUM = "file://hdsploader/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://ld10k1/COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/tools/${BP}.tar.bz2 \
+ file://autotools.patch \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'file://makefile_no_gtk.patch', d)} \
+ file://gitcompile_hdajacksensetest \
+ "
+
+SRC_URI[md5sum] = "3afb92eb1b4f2edc8691498e57c3ec78"
+SRC_URI[sha256sum] = "bc3c6567de835223ee7d69487b8c22fb395a2e8c613341b0c96e6a5f6a2bd534"
+
+inherit autotools-brokensep pkgconfig
+
+CLEANBROKEN = "1"
+
+EXTRA_OEMAKE += "GITCOMPILE_ARGS='--host=${HOST_SYS} --build=${BUILD_SYS} --target=${TARGET_SYS} --with-libtool-sysroot=${STAGING_DIR_HOST} --prefix=${prefix}'"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}"
+PACKAGECONFIG[gtk+] = ",,gtk+ gtk+3,"
+
+# configure.ac/.in doesn't exist so force copy
+AUTOTOOLS_COPYACLOCAL = "1"
+
+do_compile_prepend () {
+ #Automake dir is not correctly detected in cross compilation case
+ export AUTOMAKE_DIR="$(automake --print-libdir)"
+ export ACLOCAL_FLAGS="--system-acdir=${ACLOCALDIR}/ ${ACLOCALEXTRAPATH}"
+
+ cp ${WORKDIR}/gitcompile_hdajacksensetest ${S}/hdajacksensetest/gitcompile
+}
+
+FILES_${PN} += "${datadir}/ld10k1"
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.5.bb b/poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.5.bb
new file mode 100644
index 000000000..fef79d9c9
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.1.5.bb
@@ -0,0 +1,25 @@
+require alsa-utils_${PV}.bb
+
+SUMMARY = "Shell scripts that show help info and create ALSA configuration files"
+PROVIDES = "alsa-utils-alsaconf"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/alsa-utils:"
+
+PACKAGES = "${PN}"
+RDEPENDS_${PN} += "bash"
+
+FILES_${PN} = "${sbindir}/alsaconf \
+ ${sbindir}/alsa-info.sh \
+ ${sbindir}/alsabat-test.sh \
+ "
+
+S = "${WORKDIR}/alsa-utils-${PV}"
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${B}/alsaconf/alsaconf ${D}${sbindir}/
+ install -m 0755 ${S}/alsa-info/alsa-info.sh ${D}${sbindir}/
+ if ${@bb.utils.contains('PACKAGECONFIG', 'bat', 'true', 'false', d)}; then
+ install -m 0755 ${S}/bat/alsabat-test.sh ${D}${sbindir}/
+ fi
+}
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch b/poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
new file mode 100644
index 000000000..907ca5ce0
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
@@ -0,0 +1,56 @@
+From b9d41b784657152a4c5683a9458dffab557f0689 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Fri, 29 Aug 2014 18:58:56 +0300
+Subject: [PATCH] alsactl: don't let systemd unit restore the volume when
+ asound.state is missing
+
+This avoids an error on bootup
+
+Filed as https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5459
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+Rebased on 1.1.0.
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ alsactl/Makefile.am | 7 ++++---
+ alsactl/alsa-restore.service.in | 1 +
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
+index 90fab9d..190525a 100644
+--- a/alsactl/Makefile.am
++++ b/alsactl/Makefile.am
+@@ -38,9 +38,10 @@ install-data-hook:
+ endif
+
+ edit = \
+- $(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
+- -e 's,@mydatadir\@,$(mydatadir),g' \
+- -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
++ $(SED) -e 's,@localstatedir\@,$(localstatedir),g' \
++ -e 's,@sbindir\@,$(sbindir),g' \
++ -e 's,@mydatadir\@,$(mydatadir),g' \
++ -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+ < $< > $@ || rm $@
+
+ alsa-state.service: alsa-state.service.in
+diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
+index 80fd5fd..6beb36d 100644
+--- a/alsactl/alsa-restore.service.in
++++ b/alsactl/alsa-restore.service.in
+@@ -7,6 +7,7 @@
+ Description=Save/Restore Sound Card State
+ ConditionPathExists=!@daemonswitch@
+ ConditionPathExistsGlob=/dev/snd/control*
++ConditionPathExists=@localstatedir@/lib/alsa/asound.state
+
+ [Service]
+ Type=oneshot
+--
+2.14.2
+
diff --git a/poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb b/poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb
new file mode 100644
index 000000000..33215bf15
--- /dev/null
+++ b/poky/meta/recipes-multimedia/alsa/alsa-utils_1.1.5.bb
@@ -0,0 +1,108 @@
+SUMMARY = "ALSA sound utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://alsactl/utils.c;beginline=1;endline=20;md5=fe9526b055e246b5558809a5ae25c0b9"
+DEPENDS = "alsa-lib ncurses libsamplerate0"
+
+PACKAGECONFIG ??= "udev"
+
+# alsabat can be built also without fftw support (with reduced functionality).
+# It would be better to always enable alsabat, but provide an option for
+# enabling/disabling fftw. The configure script doesn't support that, however
+# (at least in any obvious way), so for now we only support alsabat with fftw
+# or no alsabat at all.
+PACKAGECONFIG[bat] = "--enable-bat,--disable-bat,fftwf"
+
+PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,--with-udev-rules-dir=/unwanted/rules.d,udev"
+PACKAGECONFIG[manpages] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
+ file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \
+ "
+
+SRC_URI[md5sum] = "dfe6ea147a5e07a056919591c2f5dac3"
+SRC_URI[sha256sum] = "320bd285e91db6e7fd7db3c9ec6f55b02f35449ff273c7844780ac6a5a3de2e8"
+
+# On build machines with python-docutils (not python3-docutils !!) installed
+# rst2man (not rst2man.py) is detected and compile fails with
+# | make[1]: *** No rule to make target 'alsaucm.1', needed by 'all-am'. Stop.
+# Avoid this by disabling expicitly
+EXTRA_OECONF = "--disable-rst2man"
+
+inherit autotools gettext pkgconfig manpages
+
+# This are all packages that we need to make. Also, the now empty alsa-utils
+# ipk depends on them.
+
+ALSA_UTILS_PKGS = "\
+ ${@bb.utils.contains('PACKAGECONFIG', 'bat', 'alsa-utils-alsabat', '', d)} \
+ alsa-utils-alsamixer \
+ alsa-utils-alsatplg \
+ alsa-utils-midi \
+ alsa-utils-aplay \
+ alsa-utils-amixer \
+ alsa-utils-aconnect \
+ alsa-utils-iecset \
+ alsa-utils-speakertest \
+ alsa-utils-aseqnet \
+ alsa-utils-aseqdump \
+ alsa-utils-alsactl \
+ alsa-utils-alsaloop \
+ alsa-utils-alsaucm \
+ "
+
+PACKAGES += "${ALSA_UTILS_PKGS}"
+RDEPENDS_${PN} += "${ALSA_UTILS_PKGS}"
+
+FILES_${PN} = ""
+FILES_alsa-utils-alsabat = "${bindir}/alsabat"
+FILES_alsa-utils-alsatplg = "${bindir}/alsatplg"
+FILES_alsa-utils-aplay = "${bindir}/aplay ${bindir}/arecord"
+FILES_alsa-utils-amixer = "${bindir}/amixer"
+FILES_alsa-utils-alsamixer = "${bindir}/alsamixer"
+FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/speaker-test/"
+FILES_alsa-utils-midi = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
+FILES_alsa-utils-aconnect = "${bindir}/aconnect"
+FILES_alsa-utils-aseqnet = "${bindir}/aseqnet"
+FILES_alsa-utils-iecset = "${bindir}/iecset"
+FILES_alsa-utils-alsactl = "${sbindir}/alsactl */udev/rules.d */*/udev/rules.d ${systemd_unitdir} ${localstatedir}/lib/alsa ${datadir}/alsa/init/"
+FILES_alsa-utils-aseqdump = "${bindir}/aseqdump"
+FILES_alsa-utils-alsaloop = "${bindir}/alsaloop"
+FILES_alsa-utils-alsaucm = "${bindir}/alsaucm"
+
+SUMMARY_alsa-utils-alsabat = "Command-line sound tester for ALSA sound card driver"
+SUMMARY_alsa-utils-alsatplg = "Converts topology text files into binary format for kernel"
+SUMMARY_alsa-utils-aplay = "Play (and record) sound files using ALSA"
+SUMMARY_alsa-utils-amixer = "Command-line control for ALSA mixer and settings"
+SUMMARY_alsa-utils-alsamixer = "ncurses-based control for ALSA mixer and settings"
+SUMMARY_alsa-utils-speakertest = "ALSA surround speaker test utility"
+SUMMARY_alsa-utils-midi = "Miscellaneous MIDI utilities for ALSA"
+SUMMARY_alsa-utils-aconnect = "ALSA sequencer connection manager"
+SUMMARY_alsa-utils-aseqnet = "Network client/server for ALSA sequencer"
+SUMMARY_alsa-utils-iecset = "ALSA utility for setting/showing IEC958 (S/PDIF) status bits"
+SUMMARY_alsa-utils-alsactl = "Saves/restores ALSA-settings in /etc/asound.state"
+SUMMARY_alsa-utils-aseqdump = "Shows the events received at an ALSA sequencer port"
+SUMMARY_alsa-utils-alsaloop = "ALSA PCM loopback utility"
+SUMMARY_alsa-utils-alsaucm = "ALSA Use Case Manager"
+
+RRECOMMENDS_alsa-utils-alsactl = "alsa-states"
+
+ALLOW_EMPTY_alsa-utils = "1"
+
+do_install() {
+ autotools_do_install
+
+ # We don't ship this here because it requires a dependency on bash.
+ # See alsa-utils-scripts_${PV}.bb
+ rm ${D}${sbindir}/alsaconf
+ rm ${D}${sbindir}/alsa-info.sh
+ rm -f ${D}${sbindir}/alsabat-test.sh
+
+ # If udev is disabled, we told configure to install the rules
+ # in /unwanted, so we can remove them now. If udev is enabled,
+ # then /unwanted won't exist and this will have no effect.
+ rm -rf ${D}/unwanted
+}
diff --git a/poky/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch b/poky/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch
new file mode 100644
index 000000000..69429af8f
--- /dev/null
+++ b/poky/meta/recipes-multimedia/ffmpeg/ffmpeg/mips64_cpu_detection.patch
@@ -0,0 +1,32 @@
+It will add -mips64r6 and -mips64r2 to cmdline which will
+cause conflicts
+
+in OE we user mips32r2 and mips64r2 for mips arch versions
+so there is no benefit of detecting it automatically by
+poking at tools especially in cross env
+
+Fixes errors like
+
+linking -mnan=2008 module with previous -mnan=legacy modules
+failed to merge target specific data of file
+
+-Khem
+Upstream-Status: Inappropriate [OE-Specific]
+
+Index: ffmpeg-3.1.1/configure
+===================================================================
+--- ffmpeg-3.1.1.orig/configure
++++ ffmpeg-3.1.1/configure
+@@ -5220,12 +5220,9 @@ elif enabled mips; then
+
+ # Enable minimum ISA based on selected options
+ if enabled mips64; then
+- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
+ enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
+ disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
+ else
+- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
+- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
+ enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
+ disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
+ fi
diff --git a/poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.4.2.bb b/poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.4.2.bb
new file mode 100644
index 000000000..879cf7ffb
--- /dev/null
+++ b/poky/meta/recipes-multimedia/ffmpeg/ffmpeg_3.4.2.bb
@@ -0,0 +1,151 @@
+SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video."
+DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, \
+ mux, demux, stream, filter and play pretty much anything that humans and machines \
+ have created. It supports the most obscure ancient formats up to the cutting edge."
+HOMEPAGE = "https://www.ffmpeg.org/"
+SECTION = "libs"
+
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libpostproc = "GPLv2+"
+LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_FLAGS = "commercial"
+
+LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+ file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
+ file://mips64_cpu_detection.patch \
+ "
+SRC_URI[md5sum] = "cbf4ead227fcedddf54c86013705a988"
+SRC_URI[sha256sum] = "2b92e9578ef8b3e49eeab229e69305f5f4cbc1fdaa22e927fc7fca18acccd740"
+
+# Build fails when thumb is enabled: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7717
+ARM_INSTRUCTION_SET = "arm"
+
+# Should be API compatible with libav (which was a fork of ffmpeg)
+# libpostproc was previously packaged from a separate recipe
+PROVIDES = "libav libpostproc"
+
+DEPENDS = "alsa-lib zlib libogg yasm-native"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "avdevice avfilter avcodec avformat swresample swscale postproc \
+ bzlib gpl lzma theora x264 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xv', '', d)}"
+
+# libraries to build in addition to avutil
+PACKAGECONFIG[avdevice] = "--enable-avdevice,--disable-avdevice"
+PACKAGECONFIG[avfilter] = "--enable-avfilter,--disable-avfilter"
+PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec"
+PACKAGECONFIG[avformat] = "--enable-avformat,--disable-avformat"
+PACKAGECONFIG[swresample] = "--enable-swresample,--disable-swresample"
+PACKAGECONFIG[swscale] = "--enable-swscale,--disable-swscale"
+PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc"
+PACKAGECONFIG[avresample] = "--enable-avresample,--disable-avresample"
+
+# features to support
+PACKAGECONFIG[bzlib] = "--enable-bzlib,--disable-bzlib,bzip2"
+PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
+PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
+PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz"
+PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[sdl2] = "--enable-sdl2,--disable-sdl2,virtual/libsdl2"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+PACKAGECONFIG[xv] = "--enable-outdev=xv,--disable-outdev=xv,libxv"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'openssl' ], 'yes', '', d)}"
+
+def cpu(d):
+ for arg in (d.getVar('TUNE_CCARGS') or '').split():
+ if arg.startswith('-mcpu='):
+ return arg[6:]
+ return 'generic'
+
+EXTRA_OECONF = " \
+ --disable-stripping \
+ --enable-pic \
+ --enable-shared \
+ --enable-pthreads \
+ --disable-libxcb \
+ --disable-libxcb-shm \
+ --disable-libxcb-xfixes \
+ --disable-libxcb-shape \
+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+ \
+ --cross-prefix=${TARGET_PREFIX} \
+ \
+ --ld="${CCLD}" \
+ --cc="${CC}" \
+ --cxx="${CXX}" \
+ --arch=${TARGET_ARCH} \
+ --target-os="linux" \
+ --enable-cross-compile \
+ --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+ --extra-ldflags="${TARGET_LDFLAGS}" \
+ --sysroot="${STAGING_DIR_TARGET}" \
+ --enable-hardcoded-tables \
+ ${EXTRA_FFCONF} \
+ --libdir=${libdir} \
+ --shlibdir=${libdir} \
+ --datadir=${datadir}/ffmpeg \
+ ${@bb.utils.contains('AVAILTUNES', 'mips32r2', '', '--disable-mipsdsp --disable-mipsdspr2', d)} \
+ --cpu=${@cpu(d)} \
+ --pkg-config=pkg-config \
+"
+
+EXTRA_OECONF_append_linux-gnux32 = " --disable-asm"
+
+do_configure() {
+ ${S}/configure ${EXTRA_OECONF}
+}
+
+PACKAGES =+ "libavcodec \
+ libavdevice \
+ libavfilter \
+ libavformat \
+ libavresample \
+ libavutil \
+ libpostproc \
+ libswresample \
+ libswscale"
+
+FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}"
+FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}"
+FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}"
+FILES_libavformat = "${libdir}/libavformat${SOLIBS}"
+FILES_libavresample = "${libdir}/libavresample${SOLIBS}"
+FILES_libavutil = "${libdir}/libavutil${SOLIBS}"
+FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}"
+FILES_libswresample = "${libdir}/libswresample${SOLIBS}"
+FILES_libswscale = "${libdir}/libswscale${SOLIBS}"
+
+# ffmpeg disables PIC on some platforms (e.g. x86-32)
+INSANE_SKIP_${MLPREFIX}libavcodec = "textrel"
+INSANE_SKIP_${MLPREFIX}libavdevice = "textrel"
+INSANE_SKIP_${MLPREFIX}libavfilter = "textrel"
+INSANE_SKIP_${MLPREFIX}libavformat = "textrel"
+INSANE_SKIP_${MLPREFIX}libavutil = "textrel"
+INSANE_SKIP_${MLPREFIX}libavresample = "textrel"
+INSANE_SKIP_${MLPREFIX}libswscale = "textrel"
+INSANE_SKIP_${MLPREFIX}libswresample = "textrel"
+INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"
diff --git a/poky/meta/recipes-multimedia/flac/flac_1.3.2.bb b/poky/meta/recipes-multimedia/flac/flac_1.3.2.bb
new file mode 100644
index 000000000..8315ab5a2
--- /dev/null
+++ b/poky/meta/recipes-multimedia/flac/flac_1.3.2.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Free Lossless Audio Codec"
+DESCRIPTION = "FLAC stands for Free Lossless Audio Codec, a lossless audio compression format."
+HOMEPAGE = "https://xiph.org/flac/"
+BUGTRACKER = "http://sourceforge.net/p/flac/bugs/"
+SECTION = "libs"
+LICENSE = "GFDL-1.2 & GPLv2+ & LGPLv2.1+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING.FDL;md5=ad1419ecc56e060eccf8184a87c4285f \
+ file://src/Makefile.am;beginline=1;endline=17;md5=09501c864f89dfc7ead65553129817ca \
+ file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://src/flac/main.c;beginline=1;endline=18;md5=09777e2934947a36f13568d0beb81199 \
+ file://COPYING.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+ file://src/plugin_common/all.h;beginline=1;endline=18;md5=f56cb4ba9a3bc9ec6102e8df03215271 \
+ file://COPYING.Xiph;md5=b59c1b6d7fc0fb7965f821a3d36505e3 \
+ file://include/FLAC/all.h;beginline=65;endline=70;md5=64474f2b22e9e77b28d8b8b25c983a48"
+DEPENDS = "libogg"
+
+SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "454f1bfa3f93cc708098d7890d0499bd"
+SRC_URI[sha256sum] = "91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f"
+
+CVE_PRODUCT = "libflac"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-oggtest \
+ --with-ogg-libraries=${STAGING_LIBDIR} \
+ --with-ogg-includes=${STAGING_INCDIR} \
+ --disable-xmms-plugin \
+ --without-libiconv-prefix \
+ ac_cv_prog_NASM="" \
+ "
+
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "altivec", " --enable-altivec", " --disable-altivec", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "core2", " --enable-sse", "", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "corei7", " --enable-sse", "", d)}"
+
+PACKAGES += "libflac libflac++ liboggflac liboggflac++"
+FILES_${PN} = "${bindir}/*"
+FILES_libflac = "${libdir}/libFLAC.so.*"
+FILES_libflac++ = "${libdir}/libFLAC++.so.*"
+FILES_liboggflac = "${libdir}/libOggFLAC.so.*"
+FILES_liboggflac++ = "${libdir}/libOggFLAC++.so.*"
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch b/poky/meta/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
new file mode 100644
index 000000000..67a872cdd
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/files/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
@@ -0,0 +1,35 @@
+From a1d7c582392c8bc87fa9411af77b20e011944357 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 25 Jan 2018 17:55:02 +0200
+Subject: [PATCH] gst/gstpluginloader.c: when env var is set do not fall
+ through to system plugin scanner
+
+If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that.
+
+Falling through to the one installed on the system is problamatic in cross-compilation
+environemnts, regardless of whether one pointed to by the env var succeeded or failed.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst/gstpluginloader.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
+index 430829d..3a75731 100644
+--- a/gst/gstpluginloader.c
++++ b/gst/gstpluginloader.c
+@@ -471,9 +471,7 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
+ helper_bin = g_strdup (env);
+ res = gst_plugin_loader_try_helper (loader, helper_bin);
+ g_free (helper_bin);
+- }
+-
+- if (!res) {
++ } else {
+ GST_LOG ("Trying installed plugin scanner");
+
+ #ifdef G_OS_WIN32
+--
+2.15.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch b/poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
new file mode 100644
index 000000000..2cab87f9e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/files/0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch
@@ -0,0 +1,42 @@
+From 90916f96262fa7b27a0a99788c69f9fd6df11000 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 24 Nov 2015 16:46:27 +0200
+Subject: [PATCH] introspection.m4: prefix pkgconfig paths with
+ PKG_CONFIG_SYSROOT_DIR
+
+We can't use our tweaked introspection.m4 from gobject-introspection tarball
+because gstreamer also defines INTROSPECTION_INIT in its introspection.m4, which
+is later supplied to g-ir-scanner.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ common/m4/introspection.m4 | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/common/m4/introspection.m4 b/common/m4/introspection.m4
+index 162be57..217a6ae 100644
+--- a/common/m4/introspection.m4
++++ b/common/m4/introspection.m4
+@@ -54,14 +54,14 @@ m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
+ INTROSPECTION_GIRDIR=
+ INTROSPECTION_TYPELIBDIR=
+ if test "x$found_introspection" = "xyes"; then
+- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
+- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
+- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
++ INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
++ INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
++ INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
+ INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
+ INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
+ INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
+ INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
+- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
++ INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
+ INTROSPECTION_INIT="extern void gst_init(gint*,gchar**); gst_init(NULL,NULL);"
+ fi
+ AC_SUBST(INTROSPECTION_SCANNER)
+--
+2.6.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch b/poky/meta/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch
new file mode 100644
index 000000000..d86c78d79
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/files/gtk-doc-tweaks.patch
@@ -0,0 +1,47 @@
+From 7018ca1c4bf26c8317e7fcd2e7e4e648195f42ca Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 20 Dec 2017 13:03:03 +0000
+Subject: [PATCH] gstreamer: use a patch instead of sed to fix gtk-doc
+
+Patch the gtk-doc makefiles so that the qemu wrapper is used to run transient
+binaries instead of libtool wrapper or running them directly.
+
+Also substitute a bogus plugin scanner, as trying to run the real one is causing
+issues during build on x86_64.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ common/gtk-doc.mak | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/common/gtk-doc.mak b/common/gtk-doc.mak
+index 3f83491..e5cb0d1 100644
+--- a/common/gtk-doc.mak
++++ b/common/gtk-doc.mak
+@@ -6,11 +6,11 @@
+ if GTK_DOC_USE_LIBTOOL
+ GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+-GTKDOC_RUN = $(LIBTOOL) --mode=execute
++GTKDOC_RUN = $(top_builddir)/gtkdoc-qemuwrapper
+ else
+ GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+-GTKDOC_RUN =
++GTKDOC_RUN = $(top_builddir)/gtkdoc-qemuwrapper
+ endif
+
+ # We set GPATH here; this gives us semantics for GNU make
+@@ -101,6 +101,7 @@ scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
+ GST_PLUGIN_PATH_1_0= \
+ GST_REGISTRY_1_0=doc-registry.xml \
+ $(GTKDOC_EXTRA_ENVIRONMENT) \
++ GST_PLUGIN_SCANNER_1_0="$(top_builddir)/libs/gst/helpers/gst-plugin-scanner-dummy" \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \
+ CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
+ LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+--
+2.15.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gst-examples/0001-Make-player-examples-installable.patch b/poky/meta/recipes-multimedia/gstreamer/gst-examples/0001-Make-player-examples-installable.patch
new file mode 100644
index 000000000..0338bad1c
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gst-examples/0001-Make-player-examples-installable.patch
@@ -0,0 +1,39 @@
+From 755f6dab07565aca7b6aefacad8be65de364ff75 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 17 Aug 2017 11:07:02 +0300
+Subject: [PATCH] Make player examples installable
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Denied [Upstream considers these code examples, for now a least]
+
+https://bugzilla.gnome.org/show_bug.cgi?id=777827
+---
+ playback/player/gst-play/meson.build | 1 +
+ playback/player/gtk/meson.build | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/playback/player/gst-play/meson.build b/playback/player/gst-play/meson.build
+index 719b55b..a56fe13 100644
+--- a/playback/player/gst-play/meson.build
++++ b/playback/player/gst-play/meson.build
+@@ -8,5 +8,6 @@ executable('gst-play',
+ ['gst-play.c',
+ 'gst-play-kb.c',
+ 'gst-play-kb.h'],
++ install: true,
+ dependencies : [gst_dep, gstplayer_dep, m_dep])
+
+diff --git a/playback/player/gtk/meson.build b/playback/player/gtk/meson.build
+index 08aae4f..671a65d 100644
+--- a/playback/player/gtk/meson.build
++++ b/playback/player/gtk/meson.build
+@@ -18,5 +18,6 @@ executable('gtk-play',
+ gtk_play_resources,
+ 'gtk-video-renderer.h',
+ 'gtk-video-renderer.c'],
++ install: true,
+ dependencies : [glib_dep, gobject_dep, gmodule_dep, gst_dep, gsttag_dep, gstplayer_dep, gtk_dep, x11_dep])
+
+--
+2.13.3
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gst-examples/gst-player.desktop b/poky/meta/recipes-multimedia/gstreamer/gst-examples/gst-player.desktop
new file mode 100644
index 000000000..7ddd456a1
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gst-examples/gst-player.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Media Player
+Comment=Basic media player
+Icon=multimedia-player
+TryExec=gtk-play
+Exec=gtk-play
+StartupNotify=true
+Terminal=false
+Type=Application
+Categories=GTK;AudioVideo;
diff --git a/poky/meta/recipes-multimedia/gstreamer/gst-examples_git.bb b/poky/meta/recipes-multimedia/gstreamer/gst-examples_git.bb
new file mode 100644
index 000000000..1d87f24fe
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gst-examples_git.bb
@@ -0,0 +1,32 @@
+SUMMARY = "GStreamer examples (including gtk-play, gst-play)"
+LICENSE = "LGPL-2.0+"
+LIC_FILES_CHKSUM = "file://playback/player/gtk/gtk-play.c;beginline=1;endline=20;md5=f8c72dae3d36823ec716a9ebcae593b9"
+
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gtk+3 glib-2.0-native"
+
+SRC_URI = "git://anongit.freedesktop.org/gstreamer/gst-examples \
+ file://0001-Make-player-examples-installable.patch \
+ file://gst-player.desktop"
+
+SRCREV = "48247c6ab6807d6ae179cf653cbdc64714d3313c"
+PV = "0.0.1+git${SRCPV}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit meson pkgconfig distro_features_check
+
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+do_install_append() {
+ install -m 0644 -D ${WORKDIR}/gst-player.desktop ${D}${datadir}/applications/gst-player.desktop
+}
+
+RDEPENDS_${PN} = "gstreamer1.0-plugins-base-playback"
+RRECOMMENDS_${PN} = "gstreamer1.0-plugins-base-meta \
+ gstreamer1.0-plugins-good-meta \
+ gstreamer1.0-plugins-bad-meta \
+ ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-libav", "", d)} \
+ ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-plugins-ugly-meta", "", d)}"
+RPROVIDES_${PN} += "gst-player gst-player-bin"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc b/poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
new file mode 100644
index 000000000..3fdb10e40
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
@@ -0,0 +1,56 @@
+PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
+PACKAGESPLITFUNCS_append = " set_metapkg_rdepends "
+
+python split_gstreamer10_packages () {
+ gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
+ postinst = d.getVar('plugin_postinst')
+ glibdir = d.getVar('libdir')
+
+ do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
+ do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
+ do_split_packages(d, glibdir+'/girepository-1.0', 'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer typelib file for %s', postinst=postinst, extra_depends='')
+ do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends='${PN}-dev')
+ do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends='${PN}-staticdev')
+}
+
+python set_metapkg_rdepends () {
+ import os
+
+ pn = d.getVar('PN')
+ metapkg = pn + '-meta'
+ d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+ d.setVar('FILES_' + metapkg, "")
+ blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ]
+ metapkg_rdepends = []
+ packages = d.getVar('PACKAGES').split()
+ pkgdest = d.getVar('PKGDEST')
+ for pkg in packages[1:]:
+ if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
+ # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
+ # If this subdirectory is empty, then the package is.
+ # Empty packages do not get added to the meta package's RDEPENDS
+ pkgdir = os.path.join(pkgdest, pkg)
+ if os.path.exists(pkgdir):
+ dir_contents = os.listdir(pkgdir) or []
+ else:
+ dir_contents = []
+ is_empty = len(dir_contents) == 0
+ if not is_empty:
+ metapkg_rdepends.append(pkg)
+ d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
+ d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
+}
+
+# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
+# so we need them even when empty (like in gst-plugins-good case)
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-dev = "1"
+ALLOW_EMPTY_${PN}-staticdev = "1"
+
+PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
+
+FILES_${PN} = ""
+FILES_${PN}-apps = "${bindir}"
+FILES_${PN}-glib = "${datadir}/glib-2.0"
+
+RRECOMMENDS_${PN} += "${PN}-meta"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gst-validate_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gst-validate_1.12.4.bb
new file mode 100644
index 000000000..0f2585a45
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gst-validate_1.12.4.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Gstreamer validation tool"
+DESCRIPTION = "A Tool to test GStreamer components"
+HOMEPAGE = "https://gstreamer.freedesktop.org/releases/gst-validate/1.12.3.html"
+SECTION = "multimedia"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI = "https://gstreamer.freedesktop.org/src/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "bc074d49677081f9c27de11a09165746"
+SRC_URI[sha256sum] = "f9da9dfe6e5d6f5ba3b38c5752b42d3f927715904942b405c2924d3cb77afba1"
+
+DEPENDS = "json-glib glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
+RRECOMMENDS_${PN} = "git"
+
+FILES_${PN} += "${datadir}/gstreamer-1.0/* ${libdir}/gst-validate-launcher/* ${libdir}/gstreamer-1.0/*"
+
+inherit pkgconfig gettext autotools gobject-introspection gtk-doc upstream-version-is-even
+
+# With gtk-doc enabled this recipe fails to build, so forcibly disable it:
+# WORKDIR/build/docs/validate/gst-validate-scan: line 117:
+# WORKDIR/build/docs/validate/.libs/lt-gst-validate-scan: No such file or directory
+GTKDOC_ENABLED = "False"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
new file mode 100644
index 000000000..c2283061c
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
@@ -0,0 +1,51 @@
+SUMMARY = "Libav-based GStreamer 1.x plugin"
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+SECTION = "multimedia"
+
+LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base zlib bzip2 xz"
+
+inherit autotools pkgconfig upstream-version-is-even gtk-doc
+
+# CAUTION: Using the system libav is not recommended. Since the libav API is changing all the time,
+# compilation errors (and other, more subtle bugs) can happen. It is usually better to rely on the
+# libav copy included in the gst-libav package.
+PACKAGECONFIG ??= "orc yasm"
+
+PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl,"
+PACKAGECONFIG[libav] = "--with-system-libav,,libav"
+PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
+PACKAGECONFIG[yasm] = "--enable-yasm,--disable-yasm,yasm-native"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
+
+GSTREAMER_1_0_DEBUG ?= "--disable-debug"
+
+LIBAV_EXTRA_CONFIGURE = "--with-libav-extra-configure"
+
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
+ --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
+ --ranlib='${RANLIB}' \
+ ${GSTREAMER_1_0_DEBUG} \
+ --cross-prefix='${HOST_PREFIX}'"
+
+# Disable assembly optimizations for X32, as this libav lacks the support
+PACKAGECONFIG_remove_linux-gnux32 = "yasm"
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG_append_linux-gnux32 = " --disable-asm"
+
+LIBAV_EXTRA_CONFIGURE_COMMON = \
+'${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"'
+
+EXTRA_OECONF = "${LIBAV_EXTRA_CONFIGURE_COMMON}"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+
+# http://errors.yoctoproject.org/Errors/Details/20493/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+# ffmpeg/libav disables PIC on some platforms (e.g. x86-32)
+INSANE_SKIP_${PN} = "textrel"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
new file mode 100644
index 000000000..1d99ad125
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
@@ -0,0 +1,33 @@
+From 54bba228ea52d01fd84941d97be23c03f9862b64 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 6 Apr 2013 01:22:22 +0200
+Subject: [PATCH] Disable yasm for libav when --disable-yasm
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 22ede88..ef3c050 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -305,6 +305,12 @@ else
+ emblibav_configure_args="$emblibav_configure_args --enable-gpl"
+ fi
+
++ AC_ARG_ENABLE(yasm,
++ [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])])
++ if test "x$enable_yasm" = "xno"; then
++ emblibav_configure_args="$emblibav_configure_args --disable-yasm"
++ fi
++
+ # if we are cross-compiling, tell libav so
+ case $host in
+ *android*)
+--
+1.8.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
new file mode 100644
index 000000000..b80d07394
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-configure-check-for-armv7ve-variant.patch
@@ -0,0 +1,35 @@
+From aac5902d3c9cb35c771e760d0e487622aa2e116a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Apr 2017 10:38:18 -0700
+Subject: [PATCH] configure: check for armv7ve variant
+
+OE passes -mcpu and -march via cmdline and if
+package tries to detect one of it own then it
+should be compatible otherwise, newer gcc7+ will
+error out
+
+Check for relevant preprocessor macro to determine
+armv7ve architecture
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gst-libs/ext/libav/configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gst-libs/ext/libav/configure b/gst-libs/ext/libav/configure
+index 4a5e477..727818e 100755
+--- a/gst-libs/ext/libav/configure
++++ b/gst-libs/ext/libav/configure
+@@ -4295,6 +4295,7 @@ elif enabled arm; then
+ elif check_arm_arch 6Z; then echo armv6z
+ elif check_arm_arch 6ZK; then echo armv6zk
+ elif check_arm_arch 6T2; then echo armv6t2
++ elif check_arm_arch EXT_IDIV; then echo armv7ve
+ elif check_arm_arch 7; then echo armv7
+ elif check_arm_arch 7A 7_A; then echo armv7-a
+ elif check_arm_arch 7S; then echo armv7-a
+--
+2.12.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch
new file mode 100644
index 000000000..afbfc84db
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch
@@ -0,0 +1,33 @@
+From b5226c096a0b7049874858e94a59d43e10ba3fd2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Sep 2017 10:22:56 -0700
+Subject: [PATCH] hevcpred_msa.c: Fix build by Including libavcodec/hevcdec.h
+
+src/libavcodec/mips/hevcpred_msa.c:1913:32: error: unknown type name 'HEVCContext'; did you mean 'HEVCPredContext'?
+ void ff_intra_pred_8_16x16_msa(HEVCContext *s, int x0, int y0, int c_idx)
+ ^~~~~~~~~~~
+ HEVCPredContext
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c b/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
+index 6a3b281..963c64c 100644
+--- a/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
++++ b/gst-libs/ext/libav/libavcodec/mips/hevcpred_msa.c
+@@ -18,7 +18,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#include "libavcodec/hevc.h"
++#include "libavcodec/hevcdec.h"
+ #include "libavutil/mips/generic_macros_msa.h"
+ #include "hevcpred_mips.h"
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
new file mode 100644
index 000000000..7a0b44888
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/mips64_cpu_detection.patch
@@ -0,0 +1,32 @@
+It will add -mips64r6 and -mips64r2 to cmdline which will
+cause conflicts
+
+in OE we user mips32r2 and mips64r2 for mips arch versions
+so there is no benefit of detecting it automatically by
+poking at tools especially in cross env
+
+Fixes errors like
+
+linking -mnan=2008 module with previous -mnan=legacy modules
+failed to merge target specific data of file
+
+-Khem
+Upstream-Status: Inappropriate [OE-Specific]
+
+Index: gst-libav-1.10.1/gst-libs/ext/libav/configure
+===================================================================
+--- gst-libav-1.10.1.orig/gst-libs/ext/libav/configure
++++ gst-libav-1.10.1/gst-libs/ext/libav/configure
+@@ -5269,12 +5269,9 @@ elif enabled mips; then
+
+ # Enable minimum ISA based on selected options
+ if enabled mips64; then
+- enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
+ enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
+ disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
+ else
+- enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
+- enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
+ enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
+ disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
+ fi
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
new file mode 100644
index 000000000..36abf8607
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
@@ -0,0 +1,26 @@
+Description: Workaround to build libav for i586 with gcc 4.9.2 by avoiding memset
+Author: Bernhard Übelacker <bernhardu@vr-web.de>
+
+---
+Bug-Debian: https://bugs.debian.org/783082
+Last-Update: 2015-04-28
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+--- gst-libav-1.4.5.orig/gst-libs/ext/libav/libavcodec/h264_cabac.c
++++ gst-libav-1.4.5/gst-libs/ext/libav/libavcodec/h264_cabac.c
+@@ -2020,7 +2020,11 @@ decode_intra_mb:
+ // In deblocking, the quantizer is 0
+ h->cur_pic.qscale_table[mb_xy] = 0;
+ // All coeffs are present
+- memset(h->non_zero_count[mb_xy], 16, 48);
++ /*memset(h->non_zero_count[mb_xy], 16, 48);*/
++ /* avoiding this memset because it leads at least with gcc4.9.2 to error: 'asm' operand has impossible constraints */
++ for (size_t i = 0; i < 48; i++) {
++ ( (unsigned char*)(h->non_zero_count[mb_xy]) ) [i] = 16;
++ }
+ h->cur_pic.mb_type[mb_xy] = mb_type;
+ sl->last_qscale_diff = 0;
+ return 0;
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.4.bb
new file mode 100644
index 000000000..af547ba60
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.4.bb
@@ -0,0 +1,21 @@
+require gstreamer1.0-libav.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+ file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+ file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+ file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
+ file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+ file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+ file://mips64_cpu_detection.patch \
+ file://0001-configure-check-for-armv7ve-variant.patch \
+ file://0001-hevcpred_msa.c-Fix-build-by-Including-libavcodec-hev.patch \
+ "
+SRC_URI[md5sum] = "8a851bf2e475e90a3fdac9506e3e4dbd"
+SRC_URI[sha256sum] = "2a56aa5d2d8cd912f2bce17f174713d2c417ca298f1f9c28ee66d4aa1e1d9e62"
+
+S = "${WORKDIR}/gst-libav-${PV}"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
new file mode 100644
index 000000000..016e17670
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Gstreamer1.0 package groups"
+LICENSE = "MIT"
+
+# Due to use of COMBINED_FEATURES
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+COMMERCIAL_PLUGINS = "${COMMERCIAL_AUDIO_PLUGINS} ${COMMERCIAL_VIDEO_PLUGINS}"
+DEPENDS_UGLY="${@'gstreamer1.0-plugins-ugly' if 'ugly' in COMMERCIAL_PLUGINS.split('-') else ''}"
+DEPENDS_BAD="${@'gstreamer1.0-plugins-bad' if 'bad' in COMMERCIAL_PLUGINS.split('-') else ''}"
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good ${DEPENDS_UGLY} ${DEPENDS_BAD}"
+
+PACKAGES = "\
+ gstreamer1.0-meta-base \
+ gstreamer1.0-meta-x11-base \
+ gstreamer1.0-meta-audio \
+ gstreamer1.0-meta-debug \
+ gstreamer1.0-meta-video"
+
+ALLOW_EMPTY_gstreamer1.0-meta-base = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-x11-base = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-audio = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-debug = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-video = "1"
+
+RDEPENDS_gstreamer1.0-meta-base = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gstreamer1.0-meta-x11-base', '', d)} \
+ gstreamer1.0 \
+ gstreamer1.0-plugins-base-playback \
+ gstreamer1.0-plugins-base-gio \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'gstreamer1.0-plugins-base-alsa', '',d)} \
+ gstreamer1.0-plugins-base-volume \
+ gstreamer1.0-plugins-base-audioconvert \
+ gstreamer1.0-plugins-base-audioresample \
+ gstreamer1.0-plugins-base-typefindfunctions \
+ gstreamer1.0-plugins-base-videoscale \
+ gstreamer1.0-plugins-base-videoconvert \
+ gstreamer1.0-plugins-good-autodetect \
+ gstreamer1.0-plugins-good-soup"
+
+RRECOMMENDS_gstreamer1.0-meta-x11-base = "\
+ gstreamer1.0-plugins-base-ximagesink \
+ gstreamer1.0-plugins-base-xvimagesink"
+
+RDEPENDS_gstreamer1.0-meta-audio = "\
+ gstreamer1.0-meta-base \
+ gstreamer1.0-plugins-base-vorbis \
+ gstreamer1.0-plugins-base-ogg \
+ gstreamer1.0-plugins-good-wavparse \
+ gstreamer1.0-plugins-good-flac \
+ ${COMMERCIAL_AUDIO_PLUGINS}"
+
+RDEPENDS_gstreamer1.0-meta-debug = "\
+ gstreamer1.0-meta-base \
+ gstreamer1.0-plugins-good-debug \
+ gstreamer1.0-plugins-base-audiotestsrc \
+ gstreamer1.0-plugins-base-videotestsrc"
+
+RDEPENDS_gstreamer1.0-meta-video = "\
+ gstreamer1.0-meta-base \
+ gstreamer1.0-plugins-good-avi \
+ gstreamer1.0-plugins-good-matroska \
+ gstreamer1.0-plugins-base-theora \
+ ${COMMERCIAL_VIDEO_PLUGINS}"
+
+RRECOMMENDS_gstreamer1.0-meta-video = "\
+ gstreamer1.0-meta-audio"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
new file mode 100644
index 000000000..5d9235104
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
@@ -0,0 +1,49 @@
+SUMMARY = "OpenMAX IL plugins for GStreamer"
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+SECTION = "multimedia"
+
+LICENSE = "LGPLv2.1"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
+
+inherit autotools pkgconfig gettext gtk-doc upstream-version-is-even
+
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+
+GSTREAMER_1_0_OMX_TARGET ?= "bellagio"
+GSTREAMER_1_0_OMX_CORE_NAME ?= "${libdir}/libomxil-bellagio.so.0"
+
+EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}"
+
+python __anonymous () {
+ omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET")
+ if omx_target in ['generic', 'bellagio']:
+ # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,#
+ # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros);
+ # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this
+ d.appendVar("CFLAGS", " -I${S}/omx/openmax")
+ elif omx_target == "rpi":
+ # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific
+ d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH"))
+}
+
+delete_pkg_m4_file() {
+ # Delete m4 files which we provide patched versions of but will be ignored
+ # if these exist
+ rm -f "${S}/common/m4/pkg.m4"
+ rm -f "${S}/common/m4/gtk-doc.m4"
+}
+do_configure[prefuncs] += "delete_pkg_m4_file"
+
+set_omx_core_name() {
+ sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf"
+}
+do_install[postfuncs] += " set_omx_core_name "
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+
+RDEPENDS_${PN} = "libomxil"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.4.bb
new file mode 100644
index 000000000..7f7eae370
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.4.bb
@@ -0,0 +1,11 @@
+include gstreamer1.0-omx.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "eb8d5ae3b69cfeed9dc77c592106247e"
+SRC_URI[sha256sum] = "a025fa24242ec868fe0ff1e66d806a1070bcbc7c14a987a89cdc3395d0d56d5f"
+
+S = "${WORKDIR}/gst-omx-${PV}"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
new file mode 100644
index 000000000..ca2ea9e96
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
@@ -0,0 +1,147 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+"
+
+DEPENDS += "gstreamer1.0-plugins-base libpng jpeg"
+
+inherit gettext bluetooth
+
+SRC_URI_append = " \
+ file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
+"
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to pick either (desktop) opengl, gles2, or no GL
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2 egl', '', d)}"
+
+# gtk is not in the PACKAGECONFIG variable by default until
+# the transition to gtk+3 is finished
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${PACKAGECONFIG_GL} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
+ bz2 curl dash dtls hls rsvg sbc smoothstreaming sndfile uvch264 webp \
+"
+
+PACKAGECONFIG[assrender] = "--enable-assrender,--disable-assrender,libass"
+PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,${BLUEZ}"
+PACKAGECONFIG[bz2] = "--enable-bz2,--disable-bz2,bzip2"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
+PACKAGECONFIG[dash] = "--enable-dash,--disable-dash,libxml2"
+PACKAGECONFIG[dc1394] = "--enable-dc1394,--disable-dc1394,libdc1394"
+PACKAGECONFIG[directfb] = "--enable-directfb,--disable-directfb,directfb"
+PACKAGECONFIG[dtls] = "--enable-dtls,--disable-dtls,openssl"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[faac] = "--enable-faac,--disable-faac,faac"
+PACKAGECONFIG[faad] = "--enable-faad,--disable-faad,faad2"
+PACKAGECONFIG[flite] = "--enable-flite,--disable-flite,flite-alsa"
+PACKAGECONFIG[fluidsynth] = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
+PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
+PACKAGECONFIG[hls] = "--enable-hls --with-hls-crypto=nettle,--disable-hls,nettle"
+PACKAGECONFIG[kms] = "--enable-kms,--disable-kms,libdrm"
+PACKAGECONFIG[libmms] = "--enable-libmms,--disable-libmms,libmms"
+PACKAGECONFIG[libssh2] = "--enable-libssh2,--disable-libssh2,libssh2"
+PACKAGECONFIG[modplug] = "--enable-modplug,--disable-modplug,libmodplug"
+PACKAGECONFIG[neon] = "--enable-neon,--disable-neon,neon"
+PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft"
+PACKAGECONFIG[opencv] = "--enable-opencv,--disable-opencv,opencv"
+PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,virtual/libgl libglu"
+PACKAGECONFIG[openjpeg] = "--enable-openjpeg,--disable-openjpeg,openjpeg"
+# the opus encoder/decoder elements are now in the -base package,
+# but the opus parser remains in -bad
+PACKAGECONFIG[opusparse] = "--enable-opus,--disable-opus,libopus"
+PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdread libdvdnav"
+PACKAGECONFIG[rsvg] = "--enable-rsvg,--disable-rsvg,librsvg"
+PACKAGECONFIG[rtmp] = "--enable-rtmp,--disable-rtmp,rtmpdump"
+PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc"
+PACKAGECONFIG[schroedinger] = "--enable-schro,--disable-schro,schroedinger"
+PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2"
+PACKAGECONFIG[sndfile] = "--enable-sndfile,--disable-sndfile,libsndfile1"
+PACKAGECONFIG[srtp] = "--enable-srtp,--disable-srtp,libsrtp"
+PACKAGECONFIG[uvch264] = "--enable-uvch264,--disable-uvch264,libusb1 libgudev"
+PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
+PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
+PACKAGECONFIG[vulkan] = "--enable-vulkan,--disable-vulkan,vulkan"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland-native wayland wayland-protocols libdrm"
+PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
+
+# these plugins have no corresponding library in OE-core or meta-openembedded:
+# openni2 winks direct3d directsound winscreencap acm apple_media iqa
+# android_media avc bs2b chromaprint daala dts fdkaac gme gsm kate ladspa libde265
+# lv2 mpeg2enc mplex msdk musepack nvenc ofa openh264 opensles soundtouch spandsp
+# spc teletextdec tinyalsa vdpau wasapi x265 zbar webrtcdsp
+
+# qt5 support is disabled, because it is not present in OE core, and requires more work than
+# just adding a packageconfig (it requires access to moc, uic, rcc, and qmake paths).
+# This is better done in a separate qt5 layer (which then should add a "qt5" packageconfig
+# in a gstreamer1.0-plugins-bad bbappend).
+
+EXTRA_OECONF += " \
+ --enable-decklink \
+ --enable-dvb \
+ --enable-fbdev \
+ --enable-netsim \
+ --enable-shm \
+ --enable-vcd \
+ --disable-acm \
+ --disable-android_media \
+ --disable-apple_media \
+ --disable-avc \
+ --disable-bs2b \
+ --disable-chromaprint \
+ --disable-cocoa \
+ --disable-daala \
+ --disable-direct3d \
+ --disable-directsound \
+ --disable-dts \
+ --disable-fdk_aac \
+ --disable-gme \
+ --disable-gsm \
+ --disable-iqa \
+ --disable-kate \
+ --disable-ladspa \
+ --disable-libde265 \
+ --disable-lv2 \
+ --disable-mpeg2enc \
+ --disable-mplex \
+ --disable-msdk \
+ --disable-musepack \
+ --disable-nvenc \
+ --disable-ofa \
+ --disable-openexr \
+ --disable-openh264 \
+ --disable-openni2 \
+ --disable-opensles \
+ --disable-qt \
+ --disable-soundtouch \
+ --disable-spandsp \
+ --disable-spc \
+ --disable-teletextdec \
+ --disable-tinyalsa \
+ --disable-vdpau \
+ --disable-wasapi \
+ --disable-webrtcdsp \
+ --disable-wildmidi \
+ --disable-winks \
+ --disable-winscreencap \
+ --disable-x265 \
+ --disable-zbar \
+ ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \
+"
+
+export OPENCV_PREFIX = "${STAGING_DIR_TARGET}${prefix}"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+FILES_${PN}-dev += "${libdir}/gstreamer-${LIBV}/include/gst/gl/gstglconfig.h"
+FILES_${PN}-freeverb += "${datadir}/gstreamer-${LIBV}/presets/GstFreeverb.prs"
+FILES_${PN}-opencv += "${datadir}/gst-plugins-bad/${LIBV}/opencv*"
+FILES_${PN}-voamrwbenc += "${datadir}/gstreamer-${LIBV}/presets/GstVoAmrwbEnc.prs"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/allocators/.libs"
+}
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
new file mode 100644
index 000000000..8d99dc6cc
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
@@ -0,0 +1,74 @@
+From 7592e793b3906355d76ca9a59f8fea2749ea2a4e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 27 Oct 2015 14:36:58 +0200
+Subject: [PATCH] Makefile.am: don't hardcode libtool name when running
+ introspection tools
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+%% original patch: 0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ gst-libs/gst/allocators/Makefile.am | 2 +-
+ gst-libs/gst/gl/Makefile.am | 2 +-
+ gst-libs/gst/insertbin/Makefile.am | 2 +-
+ gst-libs/gst/mpegts/Makefile.am | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
+index e50d077..623f092 100644
+--- a/gst-libs/gst/allocators/Makefile.am
++++ b/gst-libs/gst/allocators/Makefile.am
+@@ -37,7 +37,7 @@ GstBadAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstbadalloca
+ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstbadallocators-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg-export gstreamer-badallocators-@GST_API_VERSION@ \
+ --output $@ \
+diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
+index 2ae4773..dfa7a7d 100644
+--- a/gst-libs/gst/gl/Makefile.am
++++ b/gst-libs/gst/gl/Makefile.am
+@@ -178,7 +178,7 @@ GstGL-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstgl-@GST_API_VERSION@
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+ --include=GstVideo-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg gstreamer-video-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/insertbin/Makefile.am b/gst-libs/gst/insertbin/Makefile.am
+index 1f8ea30..4b98ef6 100644
+--- a/gst-libs/gst/insertbin/Makefile.am
++++ b/gst-libs/gst/insertbin/Makefile.am
+@@ -45,7 +45,7 @@ GstInsertBin-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstinsertbin-@GS
+ --library=libgstinsertbin-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-insertbin-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/mpegts/Makefile.am b/gst-libs/gst/mpegts/Makefile.am
+index aeea32e..929d9cc 100644
+--- a/gst-libs/gst/mpegts/Makefile.am
++++ b/gst-libs/gst/mpegts/Makefile.am
+@@ -79,7 +79,7 @@ GstMpegts-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstmpegts-@GST_API_
+ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-video-@GST_API_VERSION@` \
+ --library=libgstmpegts-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-video-@GST_API_VERSION@ \
+ --pkg-export gstreamer-mpegts-@GST_API_VERSION@ \
+--
+2.4.0
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
new file mode 100644
index 000000000..2235a57af
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch
@@ -0,0 +1,29 @@
+From 5622ca3b61603dc316a0f1fbede3f9aa353a5e48 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 12 May 2017 16:47:12 +0300
+Subject: [PATCH] gstreamer-gl.pc.in: don't append GL_CFLAGS to CFLAGS
+
+Dependencies' include directories should not be added in this way;
+it causes problems when cross-compiling in sysroot environments.
+
+Upstream-Status: Pending
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ pkgconfig/gstreamer-gl.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in
+index 8e7a303..d167be1 100644
+--- a/pkgconfig/gstreamer-gl.pc.in
++++ b/pkgconfig/gstreamer-gl.pc.in
+@@ -13,4 +13,4 @@ Version: @VERSION@
+ Requires: gstreamer-base-@GST_API_VERSION@ gstreamer-@GST_API_VERSION@
+
+ Libs: -L${libdir} -lgstgl-@GST_API_VERSION@
+-Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include @GL_CFLAGS@
++Cflags: -I${includedir} -I${libdir}/gstreamer-@GST_API_VERSION@/include
+--
+2.4.0
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch
new file mode 100644
index 000000000..caaa62d48
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch
@@ -0,0 +1,37 @@
+From 1523ab462c1bf19055960ced255f4872b6cf9f5c Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 5 Jul 2017 11:00:42 +0300
+Subject: [PATCH 1/2] vkdisplay: Use ifdef for platform specific defines
+
+VK_KHR_*_SURFACE_EXTENSION_NAME are only available when corresponding
+WSI is enabled.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=784539]
+---
+ ext/vulkan/vkdisplay.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ext/vulkan/vkdisplay.c b/ext/vulkan/vkdisplay.c
+index 550134cd8..ade5d4583 100644
+--- a/ext/vulkan/vkdisplay.c
++++ b/ext/vulkan/vkdisplay.c
+@@ -448,11 +448,15 @@ gst_vulkan_display_type_to_extension_string (GstVulkanDisplayType type)
+ if (type == GST_VULKAN_DISPLAY_TYPE_NONE)
+ return NULL;
+
++#if GST_VULKAN_HAVE_WINDOW_XCB
+ if (type & GST_VULKAN_DISPLAY_TYPE_XCB)
+ return VK_KHR_XCB_SURFACE_EXTENSION_NAME;
++#endif
+
++#if GST_VULKAN_HAVE_WINDOW_WAYLAND
+ if (type & GST_VULKAN_DISPLAY_TYPE_WAYLAND)
+ return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
++#endif
+
+ return NULL;
+ }
+--
+2.13.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch
new file mode 100644
index 000000000..0df145dd2
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch
@@ -0,0 +1,64 @@
+From c23e1dc22deb495561cffb877edb2746b740a1fa Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 5 Jul 2017 11:07:05 +0300
+Subject: [PATCH 2/2] vulkan: Use the generated version of vkconfig.h
+
+Build fails in ext/vulkan/xcb and ext/vulkan/wayland when:
+* building from tarball
+* building out-of-tree
+* Only one WSI integration (xcb or wayland) is enabled by configure.ac
+This is because vkconfig.h from source directory gets used instead
+of the generated one.
+
+Add the correct build directory to "-I". Use angle bracket
+include in vkapi.h so that it actually looks in the include search
+path instead of defaulting to the same (source tree) directory.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=784539]
+---
+ ext/vulkan/vkapi.h | 2 +-
+ ext/vulkan/wayland/Makefile.am | 1 +
+ ext/vulkan/xcb/Makefile.am | 1 +
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/ext/vulkan/vkapi.h b/ext/vulkan/vkapi.h
+index e9c23aa92..a37c29d0f 100644
+--- a/ext/vulkan/vkapi.h
++++ b/ext/vulkan/vkapi.h
+@@ -23,7 +23,7 @@
+
+ #define VK_PROTOTYPES
+
+-#include "vkconfig.h"
++#include <vkconfig.h>
+ #include "vk_fwd.h"
+ #include "vkmacros.h"
+
+diff --git a/ext/vulkan/wayland/Makefile.am b/ext/vulkan/wayland/Makefile.am
+index f92d85e2c..10cfb70e6 100644
+--- a/ext/vulkan/wayland/Makefile.am
++++ b/ext/vulkan/wayland/Makefile.am
+@@ -14,6 +14,7 @@ noinst_HEADERS = \
+
+ libgstvulkan_wayland_la_CFLAGS = \
+ -I$(top_srcdir)/gst-libs \
++ -I$(top_builddir)/ext/vulkan \
+ -I$(top_srcdir)/ext/vulkan \
+ -I$(top_builddir)/gst-libs \
+ $(GST_PLUGINS_BASE_CFLAGS) \
+diff --git a/ext/vulkan/xcb/Makefile.am b/ext/vulkan/xcb/Makefile.am
+index 7debcff9e..b5103551b 100644
+--- a/ext/vulkan/xcb/Makefile.am
++++ b/ext/vulkan/xcb/Makefile.am
+@@ -14,6 +14,7 @@ noinst_HEADERS = \
+
+ libgstvulkan_xcb_la_CFLAGS = \
+ -I$(top_srcdir)/gst-libs \
++ -I$(top_builddir)/ext/vulkan \
+ -I$(top_srcdir)/ext/vulkan \
+ -I$(top_builddir)/gst-libs \
+ $(GST_PLUGINS_BASE_CFLAGS) \
+--
+2.13.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-glimagesink-Downrank-to-marginal.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-glimagesink-Downrank-to-marginal.patch
new file mode 100644
index 000000000..c81fb0f6a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-glimagesink-Downrank-to-marginal.patch
@@ -0,0 +1,32 @@
+From c6b37a80806f9128de47f1ccc3f2354f8d436bb6 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 24 Sep 2015 19:47:32 +0300
+Subject: [PATCH] glimagesink: Downrank to marginal
+
+On desktop, where there is good OpenGL, xvimagesink will come up first,
+on other platforms, OpenGL can't be trusted because it's either software (like
+in a VM) or broken (like on embedded)., so let ximagesink come above.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=751684]
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ ext/gl/gstopengl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/gl/gstopengl.c b/ext/gl/gstopengl.c
+index a4b2540..0ccaacd 100644
+--- a/ext/gl/gstopengl.c
++++ b/ext/gl/gstopengl.c
+@@ -118,7 +118,7 @@ plugin_init (GstPlugin * plugin)
+ #endif
+
+ if (!gst_element_register (plugin, "glimagesink",
+- GST_RANK_SECONDARY, gst_gl_image_sink_bin_get_type ())) {
++ GST_RANK_MARGINAL, gst_gl_image_sink_bin_get_type ())) {
+ return FALSE;
+ }
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
new file mode 100644
index 000000000..357fd7800
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/avoid-including-sys-poll.h-directly.patch
@@ -0,0 +1,30 @@
+From 72561a0fca562d03567ace7b4cfc94992cd6525c Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 3 Feb 2016 18:05:41 -0800
+Subject: [PATCH] avoid including <sys/poll.h> directly
+
+musl libc generates warnings if <sys/poll.h> is included directly.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ sys/dvb/gstdvbsrc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sys/dvb/gstdvbsrc.c b/sys/dvb/gstdvbsrc.c
+index b93255f..49f145a 100644
+--- a/sys/dvb/gstdvbsrc.c
++++ b/sys/dvb/gstdvbsrc.c
+@@ -93,7 +93,7 @@
+ #include <gst/gst.h>
+ #include <gst/glib-compat-private.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <stdio.h>
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
new file mode 100644
index 000000000..ad8632989
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
@@ -0,0 +1,61 @@
+From f59c5269f92d59a5296cbfeeb682d42095cd88ad Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Thu, 18 Sep 2014 02:24:07 -0400
+Subject: [PATCH] gstreamer1.0-plugins-bad: allow to disable libssh2
+
+libssh2 is automatically linked to if present, this undetermined
+dependency may cause build errors like:
+
+ .../x86_64-poky-linux/4.9.0/ld: cannot find -lssh2
+
+libssh2 isn't an oe-core recipe, so allow to disable it from
+configure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+Index: gst-plugins-bad-1.12.3/configure.ac
+===================================================================
+--- gst-plugins-bad-1.12.3.orig/configure.ac
++++ gst-plugins-bad-1.12.3/configure.ac
+@@ -2139,6 +2139,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chrom
+ ])
+
+ dnl *** Curl ***
++AC_ARG_ENABLE([libssh2],
++ [ --enable-libssh2 enable LIBSSH2 support @<:@default=auto@:>@],
++ [case "${enableval}" in
++ yes) NEED_SSH2=yes ;;
++ no) NEED_SSH2=no ;;
++ auto) NEED_SSH2=auto ;;
++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-libssh2]) ;;
++ esac],[NEED_SSH2=auto])
++
+ translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
+ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
+ PKG_CHECK_MODULES(CURL, libcurl >= 7.35.0, [
+@@ -2161,12 +2170,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin]
+ ])
+ AC_SUBST(CURL_CFLAGS)
+ AC_SUBST(CURL_LIBS)
+- PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
+- HAVE_SSH2="yes"
+- AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
+- ], [
+- HAVE_SSH2="no"
+- ])
++ if test "x$NEED_SSH2" != "xno"; then
++ PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
++ HAVE_SSH2="yes"
++ AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
++ ], [
++ HAVE_SSH2="no"
++ ])
++ fi
+ AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
+ AC_SUBST(SSH2_CFLAGS)
+ AC_SUBST(SSH2_LIBS)
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
new file mode 100644
index 000000000..20c9ffcd8
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/ensure-valid-sentinels-for-gst_structure_get-etc.patch
@@ -0,0 +1,85 @@
+From 2262ba4b686d5cc0d3e894707fe1d31619a3a8f1 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 9 Feb 2016 14:00:00 -0800
+Subject: [PATCH] ensure valid sentinals for gst_structure_get() etc
+
+For GStreamer functions declared with G_GNUC_NULL_TERMINATED,
+ie __attribute__((__sentinel__)), gcc will generate a warning if the
+last parameter passed to the function is not NULL (where a valid NULL
+in this context is defined as zero with any pointer type).
+
+The C callers to such functions within gst-plugins-bad use the C NULL
+definition (ie ((void*)0)), which is a valid sentinel.
+
+However the C++ NULL definition (ie 0L), is not a valid sentinel
+without an explicit cast to a pointer type.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ sys/decklink/gstdecklink.cpp | 10 +++++-----
+ sys/decklink/gstdecklinkaudiosrc.cpp | 2 +-
+ sys/decklink/gstdecklinkvideosink.cpp | 2 +-
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklink.cpp
+@@ -476,7 +476,7 @@ gst_decklink_mode_get_structure (GstDeck
+ "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
+ "interlace-mode", G_TYPE_STRING,
+ mode->interlaced ? "interleaved" : "progressive",
+- "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, NULL);
++ "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d, (void*)NULL);
+
+ if (input && mode->interlaced) {
+ if (mode->tff)
+@@ -489,16 +489,16 @@ gst_decklink_mode_get_structure (GstDeck
+ case bmdFormat8BitYUV: /* '2vuy' */
+ gst_structure_set (s, "format", G_TYPE_STRING, "UYVY",
+ "colorimetry", G_TYPE_STRING, mode->colorimetry,
+- "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
++ "chroma-site", G_TYPE_STRING, "mpeg2", (void*)NULL);
+ break;
+ case bmdFormat10BitYUV: /* 'v210' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "v210", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "v210", (void*)NULL);
+ break;
+ case bmdFormat8BitARGB: /* 'ARGB' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "ARGB", (void*)NULL);
+ break;
+ case bmdFormat8BitBGRA: /* 'BGRA' */
+- gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", NULL);
++ gst_structure_set (s, "format", G_TYPE_STRING, "BGRA", (void*)NULL);
+ break;
+ case bmdFormat10BitRGB: /* 'r210' Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 */
+ case bmdFormat12BitRGB: /* 'R12B' Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component */
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkaudiosrc.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkaudiosrc.cpp
+@@ -322,7 +322,7 @@ gst_decklink_audio_src_set_caps (GstBase
+ g_mutex_unlock (&self->input->lock);
+
+ if (videosrc) {
+- g_object_get (videosrc, "connection", &vconn, NULL);
++ g_object_get (videosrc, "connection", &vconn, (void *) NULL);
+ gst_object_unref (videosrc);
+
+ switch (vconn) {
+Index: gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+===================================================================
+--- gst-plugins-bad-1.10.2.orig/sys/decklink/gstdecklinkvideosink.cpp
++++ gst-plugins-bad-1.10.2/sys/decklink/gstdecklinkvideosink.cpp
+@@ -163,7 +163,7 @@ reset_framerate (GstCapsFeatures * featu
+ gpointer user_data)
+ {
+ gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
+- G_MAXINT, 1, NULL);
++ G_MAXINT, 1, (void *) NULL);
+
+ return TRUE;
+ }
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
new file mode 100644
index 000000000..5ce57714e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch
@@ -0,0 +1,28 @@
+From a67781000e82bd9ae3813da29401e8c0c852328a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 26 Jan 2016 15:16:01 -0800
+Subject: [PATCH] fix maybe-uninitialized warnings when compiling with -Os
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ gst-libs/gst/codecparsers/gstvc1parser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c
+index fd16ee0..ddb890c 100644
+--- a/gst-libs/gst/codecparsers/gstvc1parser.c
++++ b/gst-libs/gst/codecparsers/gstvc1parser.c
+@@ -1729,7 +1729,7 @@ gst_vc1_parse_sequence_layer (const guint8 * data, gsize size,
+ GstVC1SeqLayer * seqlayer)
+ {
+ guint32 tmp;
+- guint8 tmp8;
++ guint8 tmp8 = 0;
+ guint8 structA[8] = { 0, };
+ guint8 structB[12] = { 0, };
+ GstBitReader br;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch
new file mode 100644
index 000000000..c382b1758
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/link-with-libvchostif.patch
@@ -0,0 +1,35 @@
+Add -lvchostif to link when using -lEGL on rpi
+
+This is required because libEGL from userland uses sybols
+from this library.
+
+lib/libEGL.so.1.0.0 121: 00000000 0 FUNC GLOBAL DEFAULT UND vc_dispmanx_element_add
+ 1552: 00000000 0 FUNC GLOBAL DEFAULT UND vc_dispmanx_element_add
+
+These symbols are provided by libvchostif as seen below
+
+lib/libvchostif.so
+ 252: 0000b161 192 FUNC GLOBAL DEFAULT 9 vc_dispmanx_element_add
+ 809: 0000b161 192 FUNC GLOBAL DEFAULT 9 vc_dispmanx_element_add
+
+With this explicit link, plugins fail during runtime
+
+(gst-plugin-scanner:571): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstomx.so': Error relocating /usr/lib/libgstgl-1.0.so.0: vc_dispmanx_element_add: symbol not found
+(gst-plugin-scanner:571): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-1.0/libgstopengl.so': Error relocating /usr/lib/libgstgl-1.0.so.0: vc_dispmanx_element_add: symbol not found
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: gst-plugins-bad-1.10.4/configure.ac
+===================================================================
+--- gst-plugins-bad-1.10.4.orig/configure.ac
++++ gst-plugins-bad-1.10.4/configure.ac
+@@ -785,7 +785,7 @@ case $host in
+ HAVE_EGL=yes
+ HAVE_GLES2=yes
+ HAVE_EGL_RPI=yes
+- EGL_LIBS="-lbcm_host -lvcos -lvchiq_arm"
++ EGL_LIBS="-lbcm_host -lvchostif -lvcos -lvchiq_arm"
+ EGL_CFLAGS=""
+ AC_DEFINE(USE_EGL_RPI, [1], [Use RPi platform])
+ ])
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.4.bb
new file mode 100644
index 000000000..82c7ffcb1
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.4.bb
@@ -0,0 +1,24 @@
+require gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+ file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 "
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-${PV}.tar.xz \
+ file://configure-allow-to-disable-libssh2.patch \
+ file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
+ file://avoid-including-sys-poll.h-directly.patch \
+ file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
+ file://0001-gstreamer-gl.pc.in-don-t-append-GL_CFLAGS-to-CFLAGS.patch \
+ file://0009-glimagesink-Downrank-to-marginal.patch \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+ file://link-with-libvchostif.patch \
+ file://0001-vkdisplay-Use-ifdef-for-platform-specific-defines.patch \
+ file://0002-vulkan-Use-the-generated-version-of-vkconfig.h.patch \
+"
+SRC_URI[md5sum] = "64bf16cf15edaab1c0e02c8dee7170d0"
+SRC_URI[sha256sum] = "0c7857be16686d5c1ba6e34bd338664d3d4599d32714a8eca5c8a41a101e2d08"
+
+S = "${WORKDIR}/gst-plugins-bad-${PV}"
+
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
new file mode 100644
index 000000000..08130c1da
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
@@ -0,0 +1,50 @@
+require gstreamer1.0-plugins.inc
+
+SRC_URI_append = "\
+ file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
+ file://0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch \
+ file://0003-riff-add-missing-include-directories-when-calling-in.patch \
+ file://0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch \
+"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+
+DEPENDS += "iso-codes util-linux zlib"
+
+inherit gettext
+
+PACKAGES_DYNAMIC =+ "^libgst.*"
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'alsa x11', d)} \
+ gio-unix-2.0 ogg pango theora vorbis \
+"
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxv"
+X11ENABLEOPTS = "--enable-x --enable-xvideo --enable-xshm"
+X11DISABLEOPTS = "--disable-x --disable-xvideo --disable-xshm"
+
+PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
+PACKAGECONFIG[cdparanoia] = "--enable-cdparanoia,--disable-cdparanoia,cdparanoia"
+PACKAGECONFIG[gio-unix-2.0] = "--enable-gio_unix_2_0,--disable-gio_unix_2_0,glib-2.0"
+PACKAGECONFIG[ivorbis] = "--enable-ivorbis,--disable-ivorbis,tremor"
+PACKAGECONFIG[ogg] = "--enable-ogg,--disable-ogg,libogg"
+PACKAGECONFIG[opus] = "--enable-opus,--disable-opus,libopus"
+PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
+PACKAGECONFIG[theora] = "--enable-theora,--disable-theora,libtheora"
+PACKAGECONFIG[visual] = "--enable-libvisual,--disable-libvisual,libvisual"
+PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis"
+PACKAGECONFIG[x11] = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
+
+EXTRA_OECONF += " \
+ --enable-zlib \
+"
+
+CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
+
+FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gst-libs/gst/tag/.libs:${B}/gst-libs/gst/video/.libs:${B}/gst-libs/gst/audio/.libs:${B}/gst-libs/gst/rtp/.libs"
+}
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
new file mode 100644
index 000000000..094bdac84
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch
@@ -0,0 +1,168 @@
+From f1d9652351e7754c63003104eceb526af424c7e0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 20 Nov 2015 16:53:04 +0200
+Subject: [PATCH 1/4] Makefile.am: don't hardcode libtool name when running
+ introspection tools
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst-libs/gst/allocators/Makefile.am | 2 +-
+ gst-libs/gst/app/Makefile.am | 2 +-
+ gst-libs/gst/audio/Makefile.am | 2 +-
+ gst-libs/gst/fft/Makefile.am | 2 +-
+ gst-libs/gst/pbutils/Makefile.am | 2 +-
+ gst-libs/gst/riff/Makefile.am | 2 +-
+ gst-libs/gst/rtp/Makefile.am | 2 +-
+ gst-libs/gst/rtsp/Makefile.am | 2 +-
+ gst-libs/gst/sdp/Makefile.am | 2 +-
+ gst-libs/gst/tag/Makefile.am | 2 +-
+ gst-libs/gst/video/Makefile.am | 2 +-
+ 11 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am
+index 9361bf9..bc7f53a 100644
+--- a/gst-libs/gst/allocators/Makefile.am
++++ b/gst-libs/gst/allocators/Makefile.am
+@@ -38,7 +38,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstallocators-@
+ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstallocators-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg-export gstreamer-allocators-@GST_API_VERSION@ \
+ --output $@ \
+diff --git a/gst-libs/gst/app/Makefile.am b/gst-libs/gst/app/Makefile.am
+index 6d6de8d..dcc2fe0 100644
+--- a/gst-libs/gst/app/Makefile.am
++++ b/gst-libs/gst/app/Makefile.am
+@@ -53,7 +53,7 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstapp-@GST_API_VERSIO
+ --library=libgstapp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-app-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am
+index 275d222..2374196 100644
+--- a/gst-libs/gst/audio/Makefile.am
++++ b/gst-libs/gst/audio/Makefile.am
+@@ -116,7 +116,7 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstaudio-@GST_API_VE
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+ --include=GstTag-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-audio-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/fft/Makefile.am b/gst-libs/gst/fft/Makefile.am
+index 09b3d68..f545354 100644
+--- a/gst-libs/gst/fft/Makefile.am
++++ b/gst-libs/gst/fft/Makefile.am
+@@ -65,7 +65,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstfft-@GST_API_VERSIO
+ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstfft-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg-export gstreamer-fft-@GST_API_VERSION@ \
+ --output $@ \
+diff --git a/gst-libs/gst/pbutils/Makefile.am b/gst-libs/gst/pbutils/Makefile.am
+index 64d5eb0..91dc214 100644
+--- a/gst-libs/gst/pbutils/Makefile.am
++++ b/gst-libs/gst/pbutils/Makefile.am
+@@ -99,7 +99,7 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstpbutils-@GST_AP
+ --include=GstTag-@GST_API_VERSION@ \
+ --include=GstVideo-@GST_API_VERSION@ \
+ --include=GstAudio-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-tag-@GST_API_VERSION@ \
+ --pkg gstreamer-video-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
+index 83d83cb..3bd8fc0 100644
+--- a/gst-libs/gst/riff/Makefile.am
++++ b/gst-libs/gst/riff/Makefile.am
+@@ -47,7 +47,7 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
+ # --include=GstAudio-@GST_API_VERSION@ \
+ # --include=GstTag-@GST_API_VERSION@ \
+ # --include=Gst-@GST_API_VERSION@ \
+-# --libtool="$(top_builddir)/libtool" \
++# --libtool="$(LIBTOOL)" \
+ # --pkg gstreamer-@GST_API_VERSION@ \
+ # --pkg gstreamer-tag-@GST_API_VERSION@ \
+ # --pkg gstreamer-audio-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/rtp/Makefile.am b/gst-libs/gst/rtp/Makefile.am
+index fdd01c1..f5445c1 100644
+--- a/gst-libs/gst/rtp/Makefile.am
++++ b/gst-libs/gst/rtp/Makefile.am
+@@ -65,7 +65,7 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtp-@GST_API_VERSIO
+ --library=libgstrtp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-rtp-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
+index ede5706..9b0b258 100644
+--- a/gst-libs/gst/rtsp/Makefile.am
++++ b/gst-libs/gst/rtsp/Makefile.am
+@@ -72,7 +72,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
+ --include=Gio-2.0 \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstSdp-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gio-2.0 \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-sdp-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/sdp/Makefile.am b/gst-libs/gst/sdp/Makefile.am
+index a90f30b..0e149b8 100644
+--- a/gst-libs/gst/sdp/Makefile.am
++++ b/gst-libs/gst/sdp/Makefile.am
+@@ -32,7 +32,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstsdp-@GST_API_VERSIO
+ --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstsdp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg-export gstreamer-sdp-@GST_API_VERSION@ \
+ --output $@ \
+diff --git a/gst-libs/gst/tag/Makefile.am b/gst-libs/gst/tag/Makefile.am
+index c534a4d..cafafd3 100644
+--- a/gst-libs/gst/tag/Makefile.am
++++ b/gst-libs/gst/tag/Makefile.am
+@@ -45,7 +45,7 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgsttag-@GST_API_VERSIO
+ --library=libgsttag-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-tag-@GST_API_VERSION@ \
+diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am
+index 5d31fa1..ac64eb3 100644
+--- a/gst-libs/gst/video/Makefile.am
++++ b/gst-libs/gst/video/Makefile.am
+@@ -116,7 +116,7 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstvideo-@GST_API_VE
+ --library=libgstvideo-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-base-@GST_API_VERSION@ \
+ --pkg-export gstreamer-video-@GST_API_VERSION@ \
+--
+2.6.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
new file mode 100644
index 000000000..6616e2cf0
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-Makefile.am-prefix-calls-to-pkg-config-with-PKG_CONF.patch
@@ -0,0 +1,295 @@
+From 990b653c7b6de1937ec759019982d6c5f15770f7 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 26 Oct 2015 16:38:18 +0200
+Subject: [PATCH 2/4] Makefile.am: prefix calls to pkg-config with
+ PKG_CONFIG_SYSROOT_DIR
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst-libs/gst/allocators/Makefile.am | 4 ++--
+ gst-libs/gst/app/Makefile.am | 4 ++--
+ gst-libs/gst/audio/Makefile.am | 12 ++++++------
+ gst-libs/gst/fft/Makefile.am | 4 ++--
+ gst-libs/gst/pbutils/Makefile.am | 12 ++++++------
+ gst-libs/gst/riff/Makefile.am | 8 ++++----
+ gst-libs/gst/rtp/Makefile.am | 8 ++++----
+ gst-libs/gst/rtsp/Makefile.am | 4 ++--
+ gst-libs/gst/sdp/Makefile.am | 4 ++--
+ gst-libs/gst/tag/Makefile.am | 8 ++++----
+ gst-libs/gst/video/Makefile.am | 8 ++++----
+ 11 files changed, 38 insertions(+), 38 deletions(-)
+
+Index: gst-plugins-base-1.12.3/gst-libs/gst/allocators/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/allocators/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/allocators/Makefile.am
+@@ -36,7 +36,7 @@ GstAllocators-@GST_API_VERSION@.gir: $(I
+ --c-include "gst/allocators/allocators.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstallocators-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --libtool="$(LIBTOOL)" \
+@@ -60,7 +60,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/app/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/app/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/app/Makefile.am
+@@ -48,8 +48,8 @@ GstApp-@GST_API_VERSION@.gir: $(INTROSPE
+ --c-include "gst/app/app.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --library=libgstapp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+Index: gst-plugins-base-1.12.3/gst-libs/gst/audio/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/audio/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/audio/Makefile.am
+@@ -167,12 +167,12 @@ GstAudio-@GST_API_VERSION@.gir: $(INTROS
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+ --c-include "gst/audio/audio.h" \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
+ --library=libgstaudio-@GST_API_VERSION@.la \
+- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
+- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
++ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
++ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
+ --library-path="$(top_builddir)/gst-libs/gst/tag/" \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+@@ -201,8 +201,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+ --includedir="$(top_builddir)/gst-libs/gst/tag/" \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/fft/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/fft/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/fft/Makefile.am
+@@ -63,7 +63,7 @@ GstFft-@GST_API_VERSION@.gir: $(INTROSPE
+ --c-include "gst/fft/fft.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstfft-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --libtool="$(LIBTOOL)" \
+@@ -87,7 +87,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/pbutils/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/pbutils/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/pbutils/Makefile.am
+@@ -85,14 +85,14 @@ GstPbutils-@GST_API_VERSION@.gir: $(INTR
+ --c-include "gst/pbutils/pbutils.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --add-include-path="$(top_builddir)/gst-libs/gst/tag/" \
+ --add-include-path="$(top_builddir)/gst-libs/gst/video/" \
+ --add-include-path="$(top_builddir)/gst-libs/gst/audio/" \
+ --library=libgstpbutils-@GST_API_VERSION@.la \
+- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
+- --library-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
++ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-@GST_API_VERSION@` \
++ --library-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=libdir gstreamer-base-@GST_API_VERSION@` \
+ --library-path="$(top_builddir)/gst-libs/gst/tag/" \
+ --library-path="$(top_builddir)/gst-libs/gst/video/" \
+ --library-path="$(top_builddir)/gst-libs/gst/audio/" \
+@@ -125,8 +125,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --includedir="$(top_builddir)/gst-libs/gst/tag/" \
+ --includedir="$(top_builddir)/gst-libs/gst/video/" \
+ --includedir="$(top_builddir)/gst-libs/gst/audio/" \
+Index: gst-plugins-base-1.12.3/gst-libs/gst/riff/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/riff/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/riff/Makefile.am
+@@ -42,8 +42,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS
+ # --c-include "gst/riff/riff.h" \
+ # --add-include-path=$(builddir)/../tag \
+ # --add-include-path=$(builddir)/../audio \
+-# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+-# --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++# --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ # --library=libgstriff-@GST_API_VERSION@.la \
+ # --include=GstAudio-@GST_API_VERSION@ \
+ # --include=GstTag-@GST_API_VERSION@ \
+@@ -74,8 +74,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS
+ # --includedir=$(builddir) \
+ # --includedir=$(builddir)/../tag \
+ # --includedir=$(builddir)/../audio \
+-# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+-# --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++# --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ # $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+ #
+ #CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/rtp/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/rtp/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/rtp/Makefile.am
+@@ -61,8 +61,8 @@ GstRtp-@GST_API_VERSION@.gir: $(INTROSPE
+ --c-include "gst/rtp/rtp.h" \
+ -I$(top_builddir)/gst-libs \
+ -I$(top_srcdir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --library=libgstrtp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+@@ -89,8 +89,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/rtsp/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/rtsp/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/rtsp/Makefile.am
+@@ -68,7 +68,7 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSP
+ -I$(top_builddir)/gst-libs \
+ -I$(top_srcdir)/gst-libs \
+ --add-include-path=$(builddir)/../sdp \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstrtsp-@GST_API_VERSION@.la \
+ --include=Gio-2.0 \
+ --include=Gst-@GST_API_VERSION@ \
+@@ -98,7 +98,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+ --includedir=$(builddir)/../sdp \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/sdp/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/sdp/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/sdp/Makefile.am
+@@ -30,7 +30,7 @@ GstSdp-@GST_API_VERSION@.gir: $(INTROSPE
+ --warn-all \
+ --c-include "gst/sdp/sdp.h" \
+ -I$(top_srcdir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ --library=libgstsdp-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --libtool="$(LIBTOOL)" \
+@@ -54,7 +54,7 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES = $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/tag/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/tag/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/tag/Makefile.am
+@@ -59,8 +59,8 @@ GstTag-@GST_API_VERSION@.gir: $(INTROSPE
+ --c-include "gst/tag/tag.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --library=libgsttag-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+@@ -87,8 +87,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+Index: gst-plugins-base-1.12.3/gst-libs/gst/video/Makefile.am
+===================================================================
+--- gst-plugins-base-1.12.3.orig/gst-libs/gst/video/Makefile.am
++++ gst-plugins-base-1.12.3/gst-libs/gst/video/Makefile.am
+@@ -116,8 +116,8 @@ GstVideo-@GST_API_VERSION@.gir: $(INTROS
+ --c-include "gst/video/video.h" \
+ -I$(top_srcdir)/gst-libs \
+ -I$(top_builddir)/gst-libs \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --add-include-path=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ --library=libgstvideo-@GST_API_VERSION@.la \
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstBase-@GST_API_VERSION@ \
+@@ -144,8 +144,8 @@ typelibs_DATA = $(BUILT_GIRSOURCES:.gir=
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=$(builddir) \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+- --includedir=`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
++ --includedir=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-base-@GST_API_VERSION@` \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+ CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch
new file mode 100644
index 000000000..9b66f7f49
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-riff-add-missing-include-directories-when-calling-in.patch
@@ -0,0 +1,28 @@
+From 3c2c2d5dd08aa30ed0e8acd8566ec99412bb8209 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 26 Oct 2015 17:29:37 +0200
+Subject: [PATCH 3/4] riff: add missing include directories when calling
+ introspection scanner
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst-libs/gst/riff/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gst-libs/gst/riff/Makefile.am b/gst-libs/gst/riff/Makefile.am
+index 0a115cc..5057a58 100644
+--- a/gst-libs/gst/riff/Makefile.am
++++ b/gst-libs/gst/riff/Makefile.am
+@@ -39,6 +39,8 @@ libgstriff_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS)
+ # --strip-prefix=Gst \
+ # --warn-all \
+ # --c-include "gst/riff/riff.h" \
++# -I$(top_srcdir)/gst-libs \
++# -I$(top_builddir)/gst-libs \
+ # --add-include-path=$(builddir)/../tag \
+ # --add-include-path=$(builddir)/../audio \
+ # --add-include-path=$(PKG_CONFIG_SYSROOT_DIR)`PKG_CONFIG_PATH="$(GST_PKG_CONFIG_PATH)" $(PKG_CONFIG) --variable=girdir gstreamer-@GST_API_VERSION@` \
+--
+2.6.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
new file mode 100644
index 000000000..9fbebd570
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
@@ -0,0 +1,225 @@
+From be6163cfa3a255493f9d75bad9541cbfe1723fee Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:17:10 +0800
+Subject: [PATCH 3/4] ssaparse: enhance SSA text lines parsing.
+
+some parser will pass in the original ssa text line which starts with "Dialog:"
+and there's are maybe multiple Dialog lines in one input buffer.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747496]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/gst/subparse/gstssaparse.c b/gst/subparse/gstssaparse.c
+old mode 100644
+new mode 100755
+index 06ecef9..0ab5dce
+--- a/gst/subparse/gstssaparse.c
++++ b/gst/subparse/gstssaparse.c
+@@ -260,6 +260,7 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
+ * gst_ssa_parse_push_line:
+ * @parse: caller element
+ * @txt: text to push
++ * @size: text size need to be parse
+ * @start: timestamp for the buffer
+ * @duration: duration for the buffer
+ *
+@@ -269,27 +270,133 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
+ * Returns: result of the push of the created buffer
+ */
+ static GstFlowReturn
+-gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
++gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, gint size,
+ GstClockTime start, GstClockTime duration)
+ {
+ GstFlowReturn ret;
+ GstBuffer *buf;
+- gchar *t, *escaped;
++ gchar *t, *text, *p, *escaped, *p_start, *p_end;
+ gint num, i, len;
++ GstClockTime start_time = G_MAXUINT64, end_time = 0;
+
+- num = atoi (txt);
+- GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
+- num, GST_TIME_ARGS (start));
+-
+- /* skip all non-text fields before the actual text */
++ p = text = g_malloc(size + 1);
++ *p = '\0';
+ t = txt;
+- for (i = 0; i < 8; ++i) {
+- t = strchr (t, ',');
++
++ /* there are may have multiple dialogue lines at a time */
++ while (*t) {
++ /* ignore leading white space characters */
++ while (isspace(*t))
++ t++;
++
++ /* ignore Format: and Style: lines */
++ if (strncmp(t, "Format:", 7) == 0 || strncmp(t, "Style:", 6) == 0) {
++ while (*t != '\0' && *t != '\n') {
++ t++;
++ }
++ }
++
++ if (*t == '\0')
++ break;
++
++ /* continue with next line */
++ if (*t == '\n') {
++ t++;
++ continue;
++ }
++
++ if(strncmp(t, "Dialogue:", 9) != 0) {
++ /* not started with "Dialogue:", it must be a line trimmed by demuxer */
++ num = atoi (t);
++ GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
++ num, GST_TIME_ARGS (start));
++
++ /* skip all non-text fields before the actual text */
++ for (i = 0; i < 8; ++i) {
++ t = strchr (t, ',');
++ if (t == NULL)
++ break;
++ ++t;
++ }
++ } else {
++ /* started with "Dialogue:", update timestamp and duration */
++ /* time format are like Dialog:Mark,0:00:01.02,0:00:03.04,xx,xxx,... */
++ guint hour, min, sec, msec, len;
++ GstClockTime tmp;
++ gchar t_str[12] = {0};
++
++ /* find the first ',' */
++ p_start = strchr (t, ',');
++ if (p_start)
++ p_end = strchr (++p_start, ',');
++
++ if (p_start && p_end) {
++ /* copy text between first ',' and second ',' */
++ strncpy(t_str, p_start, p_end - p_start);
++ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
++ tmp = ((hour*3600) + (min*60) + sec) * GST_SECOND + msec*GST_MSECOND;
++ GST_DEBUG_OBJECT (parse, "Get start time:%02d:%02d:%02d:%03d\n",
++ hour, min, sec, msec);
++ if (start_time > tmp)
++ start_time = tmp;
++ } else {
++ GST_WARNING_OBJECT (parse,
++ "failed to parse ssa start timestamp string :%s", t_str);
++ }
++
++ p_start = p_end;
++ p_end = strchr (++p_start, ',');
++ if (p_end) {
++ /* copy text between second ',' and third ',' */
++ strncpy(t_str, p_start, p_end - p_start);
++ if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
++ tmp = ((hour*3600) + (min*60) + sec)*GST_SECOND + msec*GST_MSECOND;
++ GST_DEBUG_OBJECT(parse, "Get end time:%02d:%02d:%02d:%03d\n",
++ hour, min, sec, msec);
++ if (end_time < tmp)
++ end_time = tmp;
++ } else {
++ GST_WARNING_OBJECT (parse,
++ "failed to parse ssa end timestamp string :%s", t_str);
++ }
++ }
++ }
++
++ /* now skip all non-text fields before the actual text */
++ for (i = 0; i <= 8; ++i) {
++ t = strchr (t, ',');
++ if (t == NULL)
++ break;
++ ++t;
++ }
++ }
++
++ /* line end before expected number of ',', not a Dialogue line */
+ if (t == NULL)
+- return GST_FLOW_ERROR;
+- ++t;
++ break;
++
++ /* if not the first line, and the last character of previous line is '\0',
++ * then replace it with '\N' */
++ if (p != text && *p == '\0') {
++ *p++ = '\\';
++ *p++ = 'N';
++ }
++
++ /* copy all actual text of this line */
++ while ((*t != '\0') && (*t != '\n'))
++ *p++ = *t++;
++
++ /* add a terminator at the end */
++ *p = '\0';
++ }
++
++ /* not valid text found in this buffer return OK to let caller unref buffer */
++ if (strlen(text) <= 0) {
++ GST_WARNING_OBJECT (parse, "Not valid text found in this buffer\n");
++ return GST_FLOW_ERROR;
+ }
+
++ t = text;
+ GST_LOG_OBJECT (parse, "Text : %s", t);
+
+ if (gst_ssa_parse_remove_override_codes (parse, t)) {
+@@ -307,13 +414,22 @@ gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
+ gst_buffer_fill (buf, 0, escaped, len + 1);
+ gst_buffer_set_size (buf, len);
+ g_free (escaped);
++ g_free(t);
++
++ if (start_time != G_MAXUINT64)
++ GST_BUFFER_TIMESTAMP (buf) = start_time;
++ else
++ GST_BUFFER_TIMESTAMP (buf) = start;
+
+- GST_BUFFER_TIMESTAMP (buf) = start;
+- GST_BUFFER_DURATION (buf) = duration;
++ if (end_time > start_time)
++ GST_BUFFER_DURATION (buf) = end_time - start_time;
++ else
++ GST_BUFFER_DURATION (buf) = duration;
+
+ GST_LOG_OBJECT (parse, "Pushing buffer with timestamp %" GST_TIME_FORMAT
+- " and duration %" GST_TIME_FORMAT, GST_TIME_ARGS (start),
+- GST_TIME_ARGS (duration));
++ " and duration %" GST_TIME_FORMAT,
++ GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
++ GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
+
+ ret = gst_pad_push (parse->srcpad, buf);
+
+@@ -333,6 +449,7 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
+ GstClockTime ts;
+ gchar *txt;
+ GstMapInfo map;
++ gint size;
+
+ if (G_UNLIKELY (!parse->framed))
+ goto not_framed;
+@@ -350,13 +467,14 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
+ /* make double-sure it's 0-terminated and all */
+ gst_buffer_map (buf, &map, GST_MAP_READ);
+ txt = g_strndup ((gchar *) map.data, map.size);
++ size = map.size;
+ gst_buffer_unmap (buf, &map);
+
+ if (txt == NULL)
+ goto empty_text;
+
+ ts = GST_BUFFER_TIMESTAMP (buf);
+- ret = gst_ssa_parse_push_line (parse, txt, ts, GST_BUFFER_DURATION (buf));
++ ret = gst_ssa_parse_push_line (parse, txt, size, ts, GST_BUFFER_DURATION (buf));
+
+ if (ret != GST_FLOW_OK && GST_CLOCK_TIME_IS_VALID (ts)) {
+ GstSegment segment;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
new file mode 100644
index 000000000..4adf60546
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-rtsp-drop-incorrect-reference-to-gstreamer-sdp-in-Ma.patch
@@ -0,0 +1,27 @@
+From 4330915d88dc4dd46eb4c28d756482b767c2747f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 26 Oct 2015 17:30:14 +0200
+Subject: [PATCH 4/4] rtsp: drop incorrect reference to gstreamer-sdp in
+ Makefile.am
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst-libs/gst/rtsp/Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gst-libs/gst/rtsp/Makefile.am b/gst-libs/gst/rtsp/Makefile.am
+index 4f6d9f8..0afa370 100644
+--- a/gst-libs/gst/rtsp/Makefile.am
++++ b/gst-libs/gst/rtsp/Makefile.am
+@@ -75,7 +75,6 @@ GstRtsp-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtsp-@GST_API_VERS
+ --libtool="$(LIBTOOL)" \
+ --pkg gio-2.0 \
+ --pkg gstreamer-@GST_API_VERSION@ \
+- --pkg gstreamer-sdp-@GST_API_VERSION@ \
+ --pkg-export gstreamer-rtsp-@GST_API_VERSION@ \
+ --add-init-section="$(INTROSPECTION_INIT)" \
+ --output $@ \
+--
+2.6.2
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
new file mode 100644
index 000000000..b924e3882
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
@@ -0,0 +1,69 @@
+From ed09c8fd2c9c2b5384b72cc70af3728be6694e64 Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:20:26 +0800
+Subject: [PATCH 4/4] subparse: set need_segment after sink pad received
+ GST_EVENT_SEGMENT
+
+subparse works in push mode, chain funciton will be called once
+up stream element finished the seeking and flushing.
+if set need_segment flag in src pad event handler, the segment
+event will be pushed earlier, result in the subtitle text will
+be send out to down stream from the beginning.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747498]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
+old mode 100644
+new mode 100755
+index b565e93..7741ccc
+--- a/gst/subparse/gstsubparse.c
++++ b/gst/subparse/gstsubparse.c
+@@ -266,22 +266,20 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
+ goto beach;
+ }
+
++ /* Apply the seek to our segment */
++ gst_segment_do_seek (&self->segment, rate, format, flags,
++ start_type, start, stop_type, stop, &update);
++
++ GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
++ &self->segment);
++
+ /* Convert that seek to a seeking in bytes at position 0,
+ FIXME: could use an index */
+ ret = gst_pad_push_event (self->sinkpad,
+ gst_event_new_seek (rate, GST_FORMAT_BYTES, flags,
+ GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0));
+
+- if (ret) {
+- /* Apply the seek to our segment */
+- gst_segment_do_seek (&self->segment, rate, format, flags,
+- start_type, start, stop_type, stop, &update);
+-
+- GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
+- &self->segment);
+-
+- self->need_segment = TRUE;
+- } else {
++ if (!ret) {
+ GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
+ }
+
+@@ -1641,8 +1639,10 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
+ gst_event_parse_segment (event, &s);
+ if (s->format == GST_FORMAT_TIME)
+ gst_event_copy_segment (event, &self->segment);
+- GST_DEBUG_OBJECT (self, "newsegment (%s)",
+- gst_format_get_name (self->segment.format));
++ GST_DEBUG_OBJECT (self, "newsegment (%s) %" GST_SEGMENT_FORMAT,
++ gst_format_get_name (self->segment.format), &self->segment);
++
++ self->need_segment = TRUE;
+
+ /* if not time format, we'll either start with a 0 timestamp anyway or
+ * it's following a seek in which case we'll have saved the requested
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
new file mode 100644
index 000000000..c8e6287a5
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
@@ -0,0 +1,44 @@
+From af0dac26f62aaceb4bf266720911953793e0fc5d Mon Sep 17 00:00:00 2001
+From: zhouming <b42586@freescale.com>
+Date: Wed, 14 May 2014 10:16:20 +0800
+Subject: [PATCH] ENGR00312515: get caps from src pad when query caps
+
+https://bugzilla.gnome.org/show_bug.cgi?id=728312
+
+Upstream-Status: Pending
+
+Signed-off-by: zhouming <b42586@freescale.com>
+---
+ gst-libs/gst/tag/gsttagdemux.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+ mode change 100644 => 100755 gst-libs/gst/tag/gsttagdemux.c
+
+diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c
+old mode 100644
+new mode 100755
+index 9b6c478..ae2294a
+--- a/gst-libs/gst/tag/gsttagdemux.c
++++ b/gst-libs/gst/tag/gsttagdemux.c
+@@ -1769,6 +1769,19 @@ gst_tag_demux_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
+ }
+ break;
+ }
++ case GST_QUERY_CAPS:
++ {
++
++ /* We can hijack caps query if we typefind already */
++ if (demux->priv->src_caps) {
++ gst_query_set_caps_result (query, demux->priv->src_caps);
++ res = TRUE;
++ } else {
++ res = gst_pad_query_default (pad, parent, query);
++ }
++ break;
++ }
++
+ default:
+ res = gst_pad_query_default (pad, parent, query);
+ break;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch
new file mode 100644
index 000000000..413eff069
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/make-gio_unix_2_0-dependency-configurable.patch
@@ -0,0 +1,47 @@
+From 10d2a977ee1d469f0bf9059bb2d0b55fd2eecbac Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 20 Jan 2016 13:00:00 -0800
+Subject: [PATCH] make gio_unix_2_0 dependency configurable
+
+Prior to 1.7.1, gst-plugins-base accepted a configure option to
+disable gio_unix_2_0, however it was implemented incorrectly using
+AG_GST_CHECK_FEATURE. That was fixed in 1.7.1 by making the
+dependency unconditional.
+
+ http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=aadefefba88afe4acbe64454650f24e7ce7c8d70
+
+To make builds deterministic, re-instate support for
+--disable-gio_unix_2_0, but implement it using the AC_ARG_ENABLE
+instead of AG_GST_CHECK_FEATURE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9c52aeb..26cacd6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -752,9 +752,16 @@ AC_SUBST(FT2_CFLAGS)
+ fi dnl of EXT plugins
+
+ dnl *** gio-unix-2.0 for tests/check/pipelines/tcp.c ***
++AC_ARG_ENABLE([gio_unix_2_0],
++ [AS_HELP_STRING([--disable-gio_unix_2_0],[disable use of gio_unix_2_0])],
++ [],
++ [enable_gio_unix_2_0=yes])
++
++if test "x${enable_gio_unix_2_0}" != "xno"; then
+ PKG_CHECK_MODULES(GIO_UNIX_2_0, gio-unix-2.0 >= 2.24,
+ HAVE_GIO_UNIX_2_0="yes",
+ HAVE_GIO_UNIX_2_0="no")
++fi
+ AM_CONDITIONAL(USE_GIO_UNIX_2_0, test "x$HAVE_GIO_UNIX_2_0" = "xyes")
+
+ dnl *** finalize CFLAGS, LDFLAGS, LIBS
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.4.bb
new file mode 100644
index 000000000..dd895bbcb
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.4.bb
@@ -0,0 +1,18 @@
+require gstreamer1.0-plugins-base.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
+ file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+ file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-${PV}.tar.xz \
+ file://get-caps-from-src-pad-when-query-caps.patch \
+ file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
+ file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
+ file://make-gio_unix_2_0-dependency-configurable.patch \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+"
+SRC_URI[md5sum] = "b35b04071f69b8ab69a7f3a497ff0131"
+SRC_URI[sha256sum] = "4c306b03df0212f1b8903784e29bb3493319ba19ebebf13b0c56a17870292282"
+
+S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
new file mode 100644
index 000000000..14c3d6184
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
@@ -0,0 +1,52 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+
+DEPENDS += "gstreamer1.0-plugins-base libcap zlib bzip2"
+
+inherit gettext
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
+ cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib v4l2 \
+"
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
+
+PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo"
+PACKAGECONFIG[dv1394] = "--enable-dv1394,--disable-dv1394,libiec61883 libavc1394 libraw1394"
+PACKAGECONFIG[flac] = "--enable-flac,--disable-flac,flac"
+PACKAGECONFIG[gdk-pixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf"
+PACKAGECONFIG[gudev] = "--with-gudev,--without-gudev,libgudev"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[libpng] = "--enable-libpng,--disable-libpng,libpng"
+PACKAGECONFIG[libv4l2] = "--with-libv4l2,--without-libv4l2,v4l-utils"
+PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4"
+PACKAGECONFIG[speex] = "--enable-speex,--disable-speex,speex"
+PACKAGECONFIG[taglib] = "--enable-taglib,--disable-taglib,taglib"
+PACKAGECONFIG[v4l2] = "--enable-gst_v4l2 --enable-v4l2-probe,--disable-gst_v4l2"
+PACKAGECONFIG[vpx] = "--enable-vpx,--disable-vpx,libvpx"
+PACKAGECONFIG[wavpack] = "--enable-wavpack,--disable-wavpack,wavpack"
+PACKAGECONFIG[x11] = "--enable-x,--disable-x,${X11DEPENDS}"
+
+EXTRA_OECONF += " \
+ --enable-bz2 \
+ --enable-oss \
+ --enable-zlib \
+ --disable-aalib \
+ --disable-aalibtest \
+ --disable-directsound \
+ --disable-libcaca \
+ --disable-libdv \
+ --disable-oss4 \
+ --disable-osx_audio \
+ --disable-osx_video \
+ --disable-shout2 \
+ --disable-sunaudio \
+ --disable-waveform \
+"
+
+FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
new file mode 100644
index 000000000..a2cbb70fe
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
@@ -0,0 +1,62 @@
+From c782a30482908a4b4dd9cd4abff9f9bc4016698f Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Tue, 5 Aug 2014 14:40:46 +0800
+Subject: [PATCH] gstrtpmp4gpay: set dafault value for MPEG4 without codec
+ data in caps.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=734263
+
+Upstream-Status: Submitted
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+---
+ gst/rtp/gstrtpmp4gpay.c | 19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
+index 7913d9a..1749d39 100644
+--- a/gst/rtp/gstrtpmp4gpay.c
++++ b/gst/rtp/gstrtpmp4gpay.c
+@@ -391,6 +391,7 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+ const GValue *codec_data;
+ const gchar *media_type = NULL;
+ gboolean res;
++ const gchar *name;
+
+ rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
+
+@@ -401,7 +402,6 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+ GST_LOG_OBJECT (rtpmp4gpay, "got codec_data");
+ if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
+ GstBuffer *buffer;
+- const gchar *name;
+
+ buffer = gst_value_get_buffer (codec_data);
+ GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data");
+@@ -427,6 +427,23 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+
+ rtpmp4gpay->config = gst_buffer_copy (buffer);
+ }
++ } else {
++ name = gst_structure_get_name (structure);
++
++ if (!strcmp (name, "video/mpeg")) {
++ rtpmp4gpay->profile = g_strdup ("1");
++
++ /* fixed rate */
++ rtpmp4gpay->rate = 90000;
++ /* video stream type */
++ rtpmp4gpay->streamtype = "4";
++ /* no params for video */
++ rtpmp4gpay->params = NULL;
++ /* mode */
++ rtpmp4gpay->mode = "generic";
++
++ media_type = "video";
++ }
+ }
+ if (media_type == NULL)
+ goto config_failed;
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch
new file mode 100644
index 000000000..c7f3630ec
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/avoid-including-sys-poll.h-directly.patch
@@ -0,0 +1,44 @@
+From 4bfe2c8570a4a7080ec662504882969054d8a072 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 3 Feb 2016 18:12:38 -0800
+Subject: [PATCH] avoid including <sys/poll.h> directly
+
+musl libc generates warnings if <sys/poll.h> is included directly.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ ext/raw1394/gstdv1394src.c | 2 +-
+ ext/raw1394/gsthdv1394src.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ext/raw1394/gstdv1394src.c b/ext/raw1394/gstdv1394src.c
+index dbc7607..3c42b41 100644
+--- a/ext/raw1394/gstdv1394src.c
++++ b/ext/raw1394/gstdv1394src.c
+@@ -37,7 +37,7 @@
+ #include "config.h"
+ #endif
+ #include <unistd.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/socket.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/ext/raw1394/gsthdv1394src.c b/ext/raw1394/gsthdv1394src.c
+index 0b07a37..9785a15 100644
+--- a/ext/raw1394/gsthdv1394src.c
++++ b/ext/raw1394/gsthdv1394src.c
+@@ -36,7 +36,7 @@
+ #include "config.h"
+ #endif
+ #include <unistd.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/socket.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch
new file mode 100644
index 000000000..bc7ac0b6a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/ensure-valid-sentinel-for-gst_structure_get.patch
@@ -0,0 +1,40 @@
+From 2169f2205c0205a220d826d7573e5a863bd36e0a Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 9 Feb 2016 14:00:00 -0800
+Subject: [PATCH] ensure valid sentinal for gst_structure_get()
+
+gst_structure_get() is declared with G_GNUC_NULL_TERMINATED, ie
+__attribute__((__sentinel__)), which means gcc will generate a
+warning if the last parameter passed to the function is not NULL
+(where a valid NULL in this context is defined as zero with any
+pointer type).
+
+The C code callers to gst_structure_get() within gst-plugins-good
+use the C NULL definition (ie ((void*)0)), which is a valid sentinel.
+
+However gstid3v2mux.cc uses the C++ NULL definition (ie 0L), which
+is not a valid sentinel without an explicit cast to a pointer type.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ ext/taglib/gstid3v2mux.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/taglib/gstid3v2mux.cc b/ext/taglib/gstid3v2mux.cc
+index 8651e77..a87234f 100644
+--- a/ext/taglib/gstid3v2mux.cc
++++ b/ext/taglib/gstid3v2mux.cc
+@@ -465,7 +465,7 @@ add_image_tag (ID3v2::Tag * id3v2tag, const GstTagList * list,
+
+ if (info_struct) {
+ if (gst_structure_get (info_struct, "image-type",
+- GST_TYPE_TAG_IMAGE_TYPE, &image_type, NULL)) {
++ GST_TYPE_TAG_IMAGE_TYPE, &image_type, (void *) NULL)) {
+ if (image_type > 0 && image_type <= 18) {
+ image_type += 2;
+ } else {
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.4.bb
new file mode 100644
index 000000000..a0609641d
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.4.bb
@@ -0,0 +1,20 @@
+require gstreamer1.0-plugins-good.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+ file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \
+ file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
+ file://avoid-including-sys-poll.h-directly.patch \
+ file://ensure-valid-sentinel-for-gst_structure_get.patch \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+"
+SRC_URI[md5sum] = "bdf4791a2b788ec6a149b81ff4032038"
+SRC_URI[sha256sum] = "649f49bec60892d47ee6731b92266974c723554da1c6649f21296097715eb957"
+
+S = "${WORKDIR}/gst-plugins-good-${PV}"
+
+RPROVIDES_${PN}-pulseaudio += "${PN}-pulse"
+RPROVIDES_${PN}-soup += "${PN}-souphttpsrc"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
new file mode 100644
index 000000000..60aa968c9
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
@@ -0,0 +1,31 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS += "gstreamer1.0-plugins-base libid3tag"
+
+inherit gettext
+
+PACKAGECONFIG ??= " \
+ ${GSTREAMER_ORC} \
+ a52dec lame mpg123 mpeg2dec \
+"
+
+PACKAGECONFIG[a52dec] = "--enable-a52dec,--disable-a52dec,liba52"
+PACKAGECONFIG[amrnb] = "--enable-amrnb,--disable-amrnb,opencore-amr"
+PACKAGECONFIG[amrwb] = "--enable-amrwb,--disable-amrwb,opencore-amr"
+PACKAGECONFIG[cdio] = "--enable-cdio,--disable-cdio,libcdio"
+PACKAGECONFIG[dvdread] = "--enable-dvdread,--disable-dvdread,libdvdread"
+PACKAGECONFIG[lame] = "--enable-lame,--disable-lame,lame"
+PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec"
+PACKAGECONFIG[mpg123] = "--enable-mpg123,--disable-mpg123,mpg123"
+PACKAGECONFIG[x264] = "--enable-x264,--disable-x264,x264"
+
+EXTRA_OECONF += " \
+ --disable-sidplay \
+ --disable-twolame \
+"
+
+FILES_${PN}-amrnb += "${datadir}/gstreamer-1.0/presets/GstAmrnbEnc.prs"
+FILES_${PN}-x264 += "${datadir}/gstreamer-1.0/presets/GstX264Enc.prs"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.4.bb
new file mode 100644
index 000000000..f8333519e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.12.4.bb
@@ -0,0 +1,13 @@
+require gstreamer1.0-plugins-ugly.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-${PV}.tar.xz \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+"
+SRC_URI[md5sum] = "e2b836fb2747f6ae3a1a6f33a9d8c952"
+SRC_URI[sha256sum] = "1c165b8d888ed350acd8e6ac9f6fe06508e6fcc0a3afc6ccc9fbeb30df9be522"
+
+S = "${WORKDIR}/gst-plugins-ugly-${PV}"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
new file mode 100644
index 000000000..5906e4ad3
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
@@ -0,0 +1,41 @@
+SUMMARY = "Plugins for the GStreamer multimedia framework 1.x"
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
+SECTION = "multimedia"
+
+DEPENDS = "gstreamer1.0 glib-2.0-native"
+
+SRC_URI_append = " file://gtk-doc-tweaks.patch"
+
+inherit autotools pkgconfig upstream-version-is-even gobject-introspection gtk-doc
+
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+LIBV = "1.0"
+require gst-plugins-package.inc
+
+# Orc enables runtime JIT compilation of data processing routines from Orc
+# bytecode to SIMD instructions for various architectures (currently SSE, MMX,
+# MIPS, Altivec and NEON are supported).
+
+GSTREAMER_ORC ?= "orc"
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc orc-native"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind"
+
+export ORCC = "${STAGING_DIR_NATIVE}${bindir}/orcc"
+
+EXTRA_OECONF = " \
+ --disable-examples \
+"
+
+delete_pkg_m4_file() {
+ # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
+ rm "${S}/common/m4/pkg.m4" || true
+ rm -f "${S}/common/m4/gtk-doc.m4"
+}
+
+do_configure[prefuncs] += " delete_pkg_m4_file"
+
+PACKAGES_DYNAMIC = "^${PN}-.*"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc
new file mode 100644
index 000000000..361f0bca4
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python.inc
@@ -0,0 +1,33 @@
+SUMMARY = "Python bindings for GStreamer 1.0"
+HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-python/"
+SECTION = "multimedia"
+LICENSE = "LGPLv2.1"
+
+DEPENDS = "gstreamer1.0 python3-pygobject"
+RDEPENDS_${PN} += "gstreamer1.0 python3-pygobject"
+
+PNREAL = "gst-python"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit autotools pkgconfig distutils3-base upstream-version-is-even gobject-introspection
+
+do_install_append() {
+ # gstpythonplugin hardcodes the location of the libpython from the build
+ # workspace and then fails at runtime. We can override it using
+ # --with-libpython-dir=${libdir}, but it still fails because it looks for a
+ # symlinked library ending in .so instead of the actually library with
+ # LIBNAME.so.MAJOR.MINOR. Although we could patch the code to use the path
+ # we want, it will break again if the library version ever changes. We need
+ # to think about the best way of handling this and possibly consult
+ # upstream.
+ #
+ # Note that this particular find line is taken from the Debian packaging for
+ # gst-python1.0.
+ find "${D}" \
+ -name '*.pyc' -o \
+ -name '*.pyo' -o \
+ -name '*.la' -o \
+ -name 'libgstpythonplugin*' \
+ -delete
+}
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.4.bb
new file mode 100644
index 000000000..faec3566c
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-python_1.12.4.bb
@@ -0,0 +1,7 @@
+require gstreamer1.0-python.inc
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz"
+SRC_URI[md5sum] = "f1fd046ea781736a794f9f552d77c50d"
+SRC_URI[sha256sum] = "20ce6af6615c9a440c1928c31259a78226516d06bf1a65f888c6d109826fa3ea"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c34deae4e395ca07e725ab0076a5f740"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
new file mode 100644
index 000000000..3776f9291
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
@@ -0,0 +1,31 @@
+SUMMARY = "A library on top of GStreamer for building an RTSP server"
+HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/"
+SECTION = "multimedia"
+LICENSE = "LGPLv2"
+
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base"
+
+PNREAL = "gst-rtsp-server"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz \
+ file://0001-Don-t-hardcode-libtool-name-when-using-introspection.patch \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+ file://gtk-doc-tweaks.patch"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit autotools pkgconfig upstream-version-is-even gobject-introspection gtk-doc
+
+EXTRA_OECONF = "--disable-examples --disable-tests"
+
+# Starting with 1.8.0 gst-rtsp-server includes dependency-less plugins as well
+LIBV = "1.0"
+require gst-plugins-package.inc
+
+delete_pkg_m4_file() {
+ # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
+ rm "${S}/common/m4/pkg.m4" || true
+}
+
+do_configure[prefuncs] += " delete_pkg_m4_file"
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch
new file mode 100644
index 000000000..89d6384ad
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server/0001-Don-t-hardcode-libtool-name-when-using-introspection.patch
@@ -0,0 +1,27 @@
+From 4a12569e5ae5be63cd92a9b178860026a99746b1 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 27 Oct 2015 16:55:45 +0200
+Subject: [PATCH] Don't hardcode libtool name when using introspection
+
+Upstream-Status: Pending [review on oe-core maillist]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gst/rtsp-server/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst/rtsp-server/Makefile.am b/gst/rtsp-server/Makefile.am
+index 4fcd366..c67f5ab 100644
+--- a/gst/rtsp-server/Makefile.am
++++ b/gst/rtsp-server/Makefile.am
+@@ -87,7 +87,7 @@ GstRtspServer-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstrtspserver-@
+ --include=Gst-@GST_API_VERSION@ \
+ --include=GstRtsp-@GST_API_VERSION@ \
+ --include=GstNet-@GST_API_VERSION@ \
+- --libtool="$(top_builddir)/libtool" \
++ --libtool="$(LIBTOOL)" \
+ --pkg gstreamer-@GST_API_VERSION@ \
+ --pkg gstreamer-rtsp-@GST_API_VERSION@ \
+ --pkg gstreamer-net-@GST_API_VERSION@ \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.4.bb
new file mode 100644
index 000000000..da68dcba2
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.12.4.bb
@@ -0,0 +1,6 @@
+require gstreamer1.0-rtsp-server.inc
+
+SRC_URI[md5sum] = "ad70a9735f58da21d0f5cedf48ccadd3"
+SRC_URI[sha256sum] = "7660112ebd59838f1054796b38109dcbe32f0a040e3a252a68a81055aeaa56a9"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
new file mode 100644
index 000000000..abfcc6539
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi.inc
@@ -0,0 +1,46 @@
+SUMMARY = "VA-API support to GStreamer"
+DESCRIPTION = "gstreamer-vaapi consists of a collection of VA-API \
+based plugins for GStreamer and helper libraries: `vaapidecode', \
+`vaapiconvert', and `vaapisink'."
+
+REALPN = "gstreamer-vaapi"
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${REALPN}", "${FILE_DIRNAME}/${REALPN}"], d)}"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "libva"
+
+SRC_URI = "https://gstreamer.freedesktop.org/src/${REALPN}/${REALPN}-${PV}.tar.xz \
+ "
+
+S = "${WORKDIR}/${REALPN}-${PV}"
+
+inherit autotools pkgconfig gtk-doc distro_features_check upstream-version-is-even
+
+REQUIRED_DISTRO_FEATURES ?= "opengl"
+
+PACKAGES =+ "${PN}-tests"
+
+# OpenGL packageconfig factored out to make it easy for distros
+# and BSP layers to pick either glx, egl, or no GL. By default,
+# try detecting X11 first, and if found (with OpenGL), use GLX,
+# otherwise try to check if EGL can be used.
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', \
+ bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl', \
+ '', d), d)}"
+
+PACKAGECONFIG ??= "drm \
+ ${PACKAGECONFIG_GL} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+
+PACKAGECONFIG[drm] = "--enable-drm,--disable-drm,udev libdrm"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,virtual/libgl"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,wayland"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxrandr libxrender"
+
+FILES_${PN} += "${libdir}/gstreamer-*/*.so"
+FILES_${PN}-dbg += "${libdir}/gstreamer-*/.debug"
+FILES_${PN}-dev += "${libdir}/gstreamer-*/*.la ${libdir}/gstreamer-*/*.a"
+FILES_${PN}-tests = "${bindir}/*"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.4.bb
new file mode 100644
index 000000000..1df230179
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.12.4.bb
@@ -0,0 +1,5 @@
+require gstreamer1.0-vaapi.inc
+SRC_URI[md5sum] = "2149982cdb348139bca946bb63766f4c"
+SRC_URI[sha256sum] = "1c2d77242e1f30c4d1394636cae9f6877228a017960fca96881e0080d8b6e9c9"
+
+DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
new file mode 100644
index 000000000..c2df1f325
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
@@ -0,0 +1,61 @@
+SUMMARY = "GStreamer 1.0 multimedia framework"
+DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
+It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
+SECTION = "multimedia"
+LICENSE = "LGPLv2+"
+
+DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native"
+
+inherit autotools pkgconfig gettext upstream-version-is-even gobject-introspection gtk-doc
+
+# This way common/m4/introspection.m4 will come first
+# (it has a custom INTROSPECTION_INIT macro, and so must be used instead of our common introspection.m4 file)
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+SRC_URI_append = " \
+ file://0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch \
+ file://gtk-doc-tweaks.patch \
+ file://0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch \
+"
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[tests] = "--enable-tests,--disable-tests"
+PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind,"
+PACKAGECONFIG[gst-tracer-hooks] = "--enable-gst-tracer-hooks,--disable-gst-tracer-hooks,"
+PACKAGECONFIG[unwind] = "--with-unwind,--without-unwind,libunwind"
+PACKAGECONFIG[dw] = "--with-dw,--without-dw,elfutils"
+
+EXTRA_OECONF = " \
+ --disable-dependency-tracking \
+ --disable-examples \
+"
+
+CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no"
+
+# musl libc generates warnings if <sys/poll.h> is included directly
+CACHED_CONFIGUREVARS += "ac_cv_header_sys_poll_h=no"
+
+PACKAGES += "${PN}-bash-completion"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la ${libdir}/gstreamer-1.0/*.a ${libdir}/gstreamer-1.0/include"
+FILES_${PN}-bash-completion += "${datadir}/bash-completion/completions/ ${datadir}/bash-completion/helpers/gst*"
+
+RRECOMMENDS_${PN}_qemux86 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
+RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
+
+delete_pkg_m4_file() {
+ # This m4 file is out of date and is missing PKG_CONFIG_SYSROOT_PATH tweaks which we need for introspection
+ rm "${S}/common/m4/pkg.m4" || true
+ rm -f "${S}/common/m4/gtk-doc.m4"
+}
+
+do_configure[prefuncs] += "delete_pkg_m4_file"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/gst/.libs:${B}/libs/gst/base/.libs"
+}
diff --git a/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.4.bb b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.4.bb
new file mode 100644
index 000000000..01b239651
--- /dev/null
+++ b/poky/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.12.4.bb
@@ -0,0 +1,14 @@
+require gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+ file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = " \
+ http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
+"
+SRC_URI[md5sum] = "9d268f2e891cce1ac0832f1cc467d4ea"
+SRC_URI[sha256sum] = "5a8704aa4c2eeb04da192c4a9942f94f860ac1a585de90d9f914bac26a970674"
+
+S = "${WORKDIR}/gstreamer-${PV}"
+
+CVE_PRODUCT = "gstreamer"
diff --git a/poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch b/poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch
new file mode 100644
index 000000000..e88d7f1bb
--- /dev/null
+++ b/poky/meta/recipes-multimedia/lame/lame/no-gtk1.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+# Acquired from OpenEmbedded
+
+--- lame-3.96.1/configure.in~no-gtk1.patch 2004-07-25 15:52:12.000000000 +0100
++++ lame-3.96.1/configure.in 2004-09-10 15:54:39.000000000 +0100
+@@ -363,7 +363,12 @@
+
+ dnl configure use of features
+
+-AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
++#AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
++HAVE_GTK="no"
++GTK_CFLAGS=""
++GTK_LIBS=""
++AC_SUBST(GTK_CFLAGS)
++AC_SUBST(GTK_LIBS)
+
+ dnl ElectricFence malloc debugging
+ AC_MSG_CHECKING(use of ElectricFence malloc debugging)
diff --git a/poky/meta/recipes-multimedia/lame/lame_3.100.bb b/poky/meta/recipes-multimedia/lame/lame_3.100.bb
new file mode 100644
index 000000000..ff6ac7efb
--- /dev/null
+++ b/poky/meta/recipes-multimedia/lame/lame_3.100.bb
@@ -0,0 +1,27 @@
+SUMMARY = "High quality MP3 audio encoder"
+HOMEPAGE = "http://lame.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=290&atid=100290"
+SECTION = "console/utils"
+LICENSE = "LGPLv2+"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS = "ncurses gettext-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c46bda00ffbb0ba1dac22f8d087f54d9 \
+ file://include/lame.h;beginline=1;endline=20;md5=a2258182c593c398d15a48262130a92b \
+"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lame/lame-${PV}.tar.gz \
+ file://no-gtk1.patch \
+ "
+
+SRC_URI[md5sum] = "83e260acbe4389b54fe08e0bdbf7cddb"
+SRC_URI[sha256sum] = "ddfe36cab873794038ae2c1210557ad34857a4b6bdc515785d1da9e175b1da1e"
+
+inherit autotools pkgconfig
+
+PACKAGES += "libmp3lame libmp3lame-dev"
+FILES_${PN} = "${bindir}/lame"
+FILES_libmp3lame = "${libdir}/libmp3lame.so.*"
+FILES_libmp3lame-dev = "${includedir} ${libdir}/*"
+FILES_${PN}-dev = ""
diff --git a/poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch b/poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch
new file mode 100644
index 000000000..5168100f3
--- /dev/null
+++ b/poky/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch
@@ -0,0 +1,89 @@
+It makes much more sense to control our own CFLAGS and avoiding fPIC breaks
+some arches too. Assume we know what we're doing and remove all the messing
+around.
+
+RP 23/2/10
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: a52dec-0.7.4/configure.in
+===================================================================
+--- a52dec-0.7.4.orig/configure.in 2010-02-23 14:51:50.000000000 +0000
++++ a52dec-0.7.4/configure.in 2010-02-23 14:52:36.000000000 +0000
+@@ -14,62 +14,6 @@
+ AC_PROG_CC
+ AC_PROG_GCC_TRADITIONAL
+
+-if test x"$GCC" = x"yes"; then
+-
+- dnl GCC-specific flags - try to optimize them sometime
+- dnl -Wall -Werror moved to the end to not disturb the configure script
+-
+- dnl -O3
+- changequote(<<,>>)
+- OPT_CFLAGS=`echo "$CFLAGS"|sed "s/-O[0-9]*//g"`
+- changequote([,])
+- OPT_CFLAGS="$OPT_CFLAGS -O3"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
+-
+- dnl -fomit-frame-pointer
+- OPT_CFLAGS="$CFLAGS -fomit-frame-pointer"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
+-
+- dnl arch-specific flags
+- case "$host" in
+- i?86-* | k?-*)
+- case "$host" in
+- i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
+- i486-*) OPT_CFLAGS="$CFLAGS -mcpu=i486";;
+- i586-*) OPT_CFLAGS="$CFLAGS -mcpu=pentium";;
+- i686-*) OPT_CFLAGS="$CFLAGS -mcpu=pentiumpro";;
+- k6-*) OPT_CFLAGS="$CFLAGS -mcpu=k6";;
+- esac
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+- sparc-* | sparc64-*)
+- OPT_CFLAGS="$CFLAGS -mtune=ultrasparc"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+- mips-sgi-irix6.*) dnl do we need to be that specific ?
+- OPT_CFLAGS="$CFLAGS -mabi=64"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+- esac
+-elif test x"$CC" = x"tcc" -a x"`$CC -version 2>&1 | grep TenDRA`" != x""; then
+- dnl TenDRA portability checking compiler
+- TENDRA=yes
+- CFLAGS="-Xp -Yansi -f`pwd`/include/tendra.h -DELIDE_CODE"
+- enable_mlib=no
+- enable_oss=no
+- enable_solaris_audio=no
+-elif test x"$CC" = x"icc" -a x"`$CC -V 2>&1 | grep Intel`" != x""; then
+- dnl Intel C++ compiler
+- CFLAGS="-g -O3 -unroll -ip"
+-else
+- dnl non-gcc flags - we probably need exact configuration triplets here.
+- case "$host" in
+- mips-sgi-irix6.*)
+- OPT_CFLAGS="$CFLAGS -64"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+- sparc-sun-solaris*)
+- OPT_CFLAGS="$CFLAGS -xCC -fast -xO5"
+- AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+- esac
+-fi
+-
+ dnl Checks for libtool - this must be done after we set cflags
+ AC_DISABLE_SHARED
+ AC_LIBTOOL_WIN32_DLL
+Index: a52dec-0.7.4/liba52/configure.incl
+===================================================================
+--- a52dec-0.7.4.orig/liba52/configure.incl 2010-02-23 14:51:44.000000000 +0000
++++ a52dec-0.7.4/liba52/configure.incl 2010-02-23 14:51:59.000000000 +0000
+@@ -1,9 +1,6 @@
+ AC_SUBST([LIBA52_CFLAGS])
+ AC_SUBST([LIBA52_LIBS])
+
+-dnl avoid -fPIC when possible
+-LIBA52_CFLAGS="$LIBA52_CFLAGS -prefer-non-pic"
+-
+ AC_ARG_ENABLE([double],
+ [ --enable-double use double-precision samples])
+ if test x"$enable_double" = x"yes"; then
diff --git a/poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb b/poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb
new file mode 100644
index 000000000..8ff8889b6
--- /dev/null
+++ b/poky/meta/recipes-multimedia/liba52/liba52_0.7.4.bb
@@ -0,0 +1,26 @@
+SUMMARY = "ATSC A/52 surround sound stream decoder"
+HOMEPAGE = "http://liba52.sourceforge.net/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://include/a52.h;beginline=1;endline=12;md5=81152ceb3562bf20a60d1b6018175dd1"
+SECTION = "libs"
+PR = "r4"
+
+inherit autotools
+
+SRC_URI = "http://liba52.sourceforge.net/files/a52dec-${PV}.tar.gz \
+ file://buildcleanup.patch"
+
+SRC_URI[md5sum] = "caa9f5bc44232dc8aeea773fea56be80"
+SRC_URI[sha256sum] = "a21d724ab3b3933330194353687df82c475b5dfb997513eef4c25de6c865ec33"
+
+UPSTREAM_CHECK_URI = "http://liba52.sourceforge.net/downloads.html"
+
+S = "${WORKDIR}/a52dec-${PV}"
+
+EXTRA_OECONF = " --enable-shared "
+
+PACKAGES =+ "a52dec a52dec-doc"
+
+FILES_a52dec = " ${bindir}/* "
+FILES_a52dec-doc = " ${mandir}/man1/* "
diff --git a/poky/meta/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch b/poky/meta/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch
new file mode 100644
index 000000000..54f49f6f2
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libid3tag/libid3tag/0001-Fix-gperf-3.1-incompatibility.patch
@@ -0,0 +1,40 @@
+From 91fcf66b9182c75cd2b96d88991d5a1c6307d4b4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 2 Aug 2017 16:27:52 +0300
+Subject: [PATCH] Fix gperf 3.1 incompatibility.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ compat.h | 2 +-
+ frametype.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/compat.h b/compat.h
+index 8af71ec..b3d80d9 100644
+--- a/compat.h
++++ b/compat.h
+@@ -34,7 +34,7 @@ struct id3_compat {
+ };
+
+ struct id3_compat const *id3_compat_lookup(register char const *,
+- register unsigned int);
++ register size_t);
+
+ int id3_compat_fixup(struct id3_tag *);
+
+diff --git a/frametype.h b/frametype.h
+index dd064b2..b5b7593 100644
+--- a/frametype.h
++++ b/frametype.h
+@@ -37,6 +37,6 @@ extern struct id3_frametype const id3_frametype_unknown;
+ extern struct id3_frametype const id3_frametype_obsolete;
+
+ struct id3_frametype const *id3_frametype_lookup(register char const *,
+- register unsigned int);
++ register size_t);
+
+ # endif
+--
+2.13.2
+
diff --git a/poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch b/poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
new file mode 100644
index 000000000..38d40c363
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libid3tag-0.15.1b/Makefile.am
+===================================================================
+--- libid3tag-0.15.1b.orig/Makefile.am 2009-07-29 09:29:20.000000000 +0100
++++ libid3tag-0.15.1b/Makefile.am 2009-07-29 09:29:47.000000000 +0100
+@@ -27,6 +27,9 @@
+ lib_LTLIBRARIES = libid3tag.la
+ include_HEADERS = id3tag.h
+
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = id3tag.pc
++
+ ## From the libtool documentation on library versioning:
+ ##
+ ## CURRENT
+Index: libid3tag-0.15.1b/configure.ac
+===================================================================
+--- libid3tag-0.15.1b.orig/configure.ac 2009-07-29 09:27:15.000000000 +0100
++++ libid3tag-0.15.1b/configure.ac 2009-07-29 09:27:45.000000000 +0100
+@@ -201,5 +201,5 @@
+ dnl AC_SUBST(LTLIBOBJS)
+
+ AC_CONFIG_FILES([Makefile msvc++/Makefile \
+- libid3tag.list])
++ libid3tag.list id3tag.pc])
+ AC_OUTPUT
+Index: libid3tag-0.15.1b/id3tag.pc.in
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ libid3tag-0.15.1b/id3tag.pc.in 2009-07-29 09:29:10.000000000 +0100
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: id3tag
++Description: ID3 tag reading library
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lid3tag -lz
++Cflags: -I${includedir}
diff --git a/poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch b/poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
new file mode 100644
index 000000000..2845fb1d3
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599280&group_id=12349&atid=112349]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libid3tag-0.15.1b/configure.ac libid3tag-0.15.1b/configure.ac
+--- libid3tag-0.15.1b/configure.ac 2004-01-24 01:22:46.000000000 +0200
++++ libid3tag-0.15.1b/configure.ac 2013-01-03 06:41:02.734835014 +0200
+@@ -28,7 +28,7 @@
+
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ dnl System type.
diff --git a/poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb b/poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
new file mode 100644
index 000000000..f6139d612
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library for interacting with ID3 tags in MP3 files"
+HOMEPAGE = "http://sourceforge.net/projects/mad/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYRIGHT;md5=5e6279efb87c26c6e5e7a68317a6a87a \
+ file://version.h;beginline=1;endline=8;md5=86ac68b67f054b7afde9e149bbc3fe63"
+SECTION = "libs"
+DEPENDS = "zlib gperf-native"
+PR = "r7"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/mad/libid3tag-${PV}.tar.gz \
+ file://addpkgconfig.patch \
+ file://obsolete_automake_macros.patch \
+ file://0001-Fix-gperf-3.1-incompatibility.patch \
+ "
+UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/mad/files/libid3tag/"
+UPSTREAM_CHECK_REGEX = "/projects/mad/files/libid3tag/(?P<pver>.*)/$"
+
+SRC_URI[md5sum] = "e5808ad997ba32c498803822078748c3"
+SRC_URI[sha256sum] = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
+
+S = "${WORKDIR}/libid3tag-${PV}"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-multimedia/libogg/libogg_1.3.3.bb b/poky/meta/recipes-multimedia/libogg/libogg_1.3.3.bb
new file mode 100644
index 000000000..8d88f1f9f
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libogg/libogg_1.3.3.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Ogg bitstream and framing libary"
+DESCRIPTION = "libogg is the bitstream and framing library \
+for the Ogg project. It provides functions which are \
+necessary to codec libraries like libvorbis."
+HOMEPAGE = "http://xiph.org/"
+BUGTRACKER = "https://trac.xiph.org/newticket"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=db1b7a668b2a6f47b2af88fb008ad555 \
+ file://include/ogg/ogg.h;beginline=1;endline=11;md5=eda812856f13a3b1326eb8f020cc3b0b"
+
+SRC_URI = "http://downloads.xiph.org/releases/ogg/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "87ed742047f065046eb6c36745d871b8"
+SRC_URI[sha256sum] = "4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch
new file mode 100644
index 000000000..876e80ef7
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch
@@ -0,0 +1,58 @@
+To enable --disable-Werror for libomxil to avoid some compilers which check code strictly.
+
+For example, at least the following errors happened to some compilers:
+
+1) OMX_INDEXTYPE in include/OMX_Index.h IS NOT OMX_INDEXVENDORTYPE in src/base/omx_base_component.h
+| i586-poky-linux-libtool: compile: i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_Climinate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c OMXComponentRMExt.c -fPIC -DPIC -o .libs/libomxbase_la-OMXComponentRMExt.o
+| omx_base_component.c: In function 'omx_base_component_GetParameter':
+| omx_base_component.c:991:3: error: case value '2130706435' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
+| omx_base_component.c:918:3: error: case value '2130706436' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
+
+2)
+| i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I.. -DOMXILCOMPOminate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c -o omxregister_bellagio-omxregister.o `test -f 'omxregister.c' || echo './'`o
+| omxregister.c: In function 'buildComponentsList':
+| omxregister.c:175:7: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
+| cc1: all warnings being treated as errors
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r 82d742d3ea90 configure.ac
+--- a/configure.ac Tue Dec 27 15:30:35 2011 +0800
++++ b/configure.ac Tue Dec 27 16:26:03 2011 +0800
+@@ -5,7 +5,7 @@
+ AC_PREREQ([2.59])
+
+ AC_CONFIG_HEADERS([config.h])
+-CFLAGS="${CFLAGS} -Wall -Werror"
++CFLAGS="${CFLAGS} -Wall"
+
+ ################################################################################
+ # Set the shared versioning info, according to section 6.3 of the libtool info #
+@@ -122,6 +122,14 @@
+ [with_android=$enableval],
+ [with_android=no])
+
++AC_ARG_ENABLE(
++ [Werror],
++ [AC_HELP_STRING(
++ [--disable-Werror],
++ [whether to diable treating gcc warnings as errors])],
++ [with_Werror=$enableval],
++ [with_Werror=yes])
++
+ ################################################################################
+ # Check for programs #
+ ################################################################################
+@@ -193,6 +201,10 @@
+ CFG_DEBUG_LEVEL=255
+ fi
+
++if test "x$with_Werror" = "xyes"; then
++ CFLAGS="${CFLAGS} -Werror"
++fi
++
+ AC_SUBST(CFG_DEBUG_LEVEL)
+ CFLAGS="${CFLAGS} -DCONFIG_DEBUG_LEVEL=$CFG_DEBUG_LEVEL"
+
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch
new file mode 100644
index 000000000..f408e4a62
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch
@@ -0,0 +1,36 @@
+Disable so versioning since they are really not a versioned shared lib.
+
+Upstream-Status: Submitted @ https://sourceforge.net/p/omxil/bugs/59/
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/audio_effects/Makefile.am libomxil-bellagio-0.9.3/src/components/audio_effects/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/audio_effects/Makefile.am 2014-07-20 15:22:00.858425234 -0400
++++ libomxil-bellagio-0.9.3/src/components/audio_effects/Makefile.am 2014-07-20 15:25:42.687525225 -0400
+@@ -10,4 +10,5 @@
+ libomxaudio_effects_la_CFLAGS = -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/base
++libomxaudio_effects_la_LDFLAGS = -avoid-version
+
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/clocksrc/Makefile.am libomxil-bellagio-0.9.3/src/components/clocksrc/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/clocksrc/Makefile.am 2014-07-20 15:22:00.858425234 -0400
++++ libomxil-bellagio-0.9.3/src/components/clocksrc/Makefile.am 2014-07-20 15:24:49.151259753 -0400
+@@ -10,4 +10,4 @@
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/base
+-
++libomxclocksrc_la_LDFLAGS = -avoid-version
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/videoscheduler/Makefile.am libomxil-bellagio-0.9.3/src/components/videoscheduler/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/videoscheduler/Makefile.am 2014-07-20 15:22:00.862425254 -0400
++++ libomxil-bellagio-0.9.3/src/components/videoscheduler/Makefile.am 2014-07-20 15:22:36.462601786 -0400
+@@ -6,7 +6,7 @@
+ library_entry_point.c
+
+ libomxvideosched_la_LIBADD = $(top_builddir)/src/libomxil-bellagio.la
+-libomxvideosched_la_LDFLAGS =
++libomxvideosched_la_LDFLAGS = -avoid-version
+ libomxvideosched_la_CFLAGS = -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/base
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch
new file mode 100644
index 000000000..787953a99
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch
@@ -0,0 +1,20 @@
+This patch fixes link issue when libomxdynamicloader.so is loaded :
+Missing symbol RM_Deinit.
+
+This patch comes from "http://pkgs.fedoraproject.org/cgit/libomxil-bellagio.git/commit/?h=f17&id=4996a95828943d345e51ded6876c3103653eecf8"
+
+Upstream-Status: Pending
+
+Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
+
+--- a/src/dynamic_loader/Makefile.am 2014-02-25 15:29:10.128549636 +0100
++++ b/src/dynamic_loader/Makefile.am 2014-02-25 15:30:15.756548808 +0100
+@@ -3,7 +3,7 @@
+ omxdynamicloader_LTLIBRARIES = libomxdynamicloader.la
+ libomxdynamicloader_la_SOURCES = ste_dynamic_component_loader.c ste_dynamic_component_loader.h
+
+-libomxdynamicloader_la_LDFLAGS =
++libomxdynamicloader_la_LDFLAGS = -lomxil-bellagio -L$(top_builddir)/src/.libs
+ libomxdynamicloader_la_CFLAGS = -I$(top_srcdir)/include \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/src/base \
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch
new file mode 100644
index 000000000..dbe8c41f7
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch
@@ -0,0 +1,19 @@
+This patch is to remove DESTDIR in docdir.
+Otherwise, when users install by running `make install DESTDIR=/alternate/directory' specified in the file INSTALL, the doc will go into /alternate/directory/alternate/directory, which is not expected.
+
+Upstream-Status: Pending
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r 30b597e4e70d Makefile.am
+--- a/Makefile.am Wed Dec 28 15:38:35 2011 +0800
++++ b/Makefile.am Wed Dec 28 15:39:25 2011 +0800
+@@ -7,7 +7,7 @@
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libomxil-bellagio.pc
+
+-docdir = $(DESTDIR)$(prefix)/share/doc/@PACKAGE@
++docdir = $(prefix)/share/doc/@PACKAGE@
+ doc_DATA = README \
+ ChangeLog \
+ TODO
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch
new file mode 100644
index 000000000..483ca1328
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch
@@ -0,0 +1,18 @@
+This patch is to make libomxil Makefile support "make -jN".
+The omxregister_bellagio stuffs depend on libomxil_bellagio library.
+
+Upstream-Status: Pending
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r f59d077d3dd5 Makefile.am
+--- a/src/Makefile.am Wed Dec 28 10:54:36 2011 +0800
++++ b/src/Makefile.am Wed Dec 28 10:55:46 2011 +0800
+@@ -7,6 +7,7 @@
+ omxregister_bellagio_SOURCES = omxregister.c common.c common.h
+ omxregister_bellagio_CFLAGS = -DOMXILCOMPONENTSPATH=\"$(plugindir)/\" \
+ -I$(top_srcdir)/include
++omxregister_bellagio_LDADD = $(lib_LTLIBRARIES)
+ omxregister_bellagio_LDFLAGS = -lomxil-bellagio -L$(builddir)
+
+ lib_LTLIBRARIES = libomxil-bellagio.la
diff --git a/poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb b/poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb
new file mode 100644
index 000000000..d83eb4570
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Bellagio OpenMAX Integration Layer (IL)"
+DESCRIPTION = "Bellagio is an opensource implementation of the Khronos OpenMAX \
+ Integration Layer API to access multimedia components."
+HOMEPAGE = "http://omxil.sourceforge.net/"
+
+LICENSE = "LGPLv2.1+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ae6f0f4dbc7ac193b50f323a6ae191cb \
+ file://src/omxcore.h;beginline=1;endline=27;md5=806b1e5566c06486fe8e42b461e03a90"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/omxil/libomxil-bellagio-${PV}.tar.gz \
+ file://configure-fix.patch \
+ file://parallel-make.patch \
+ file://makefile-docdir-fix.patch \
+ file://dynamicloader-linking.patch \
+ file://disable-so-versioning.patch"
+
+SRC_URI[md5sum] = "a1de827fdb75c02c84e55f740ca27cb8"
+SRC_URI[sha256sum] = "593c0729c8ef8c1467b3bfefcf355ec19a46dd92e31bfc280e17d96b0934d74c"
+
+S = "${WORKDIR}/${BPN}-bellagio-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF += "--disable-doc --disable-Werror"
+
+#
+# The .so files under ${libdir}/bellagio are not intended to be versioned and symlinked.
+# Make sure they get packaged in the main package.
+#
+FILES_${PN} += "${libdir}/bellagio/*.so \
+ ${libdir}/omxloaders/*${SOLIBS}"
+FILES_${PN}-staticdev += "${libdir}/bellagio/*.a \
+ ${libdir}/omxloaders/*.a"
+FILES_${PN}-dev += "${libdir}/bellagio/*.la \
+ ${libdir}/omxloaders/*.la \
+ ${libdir}/omxloaders/*${SOLIBSDEV}"
diff --git a/poky/meta/recipes-multimedia/libpng/libpng_1.6.34.bb b/poky/meta/recipes-multimedia/libpng/libpng_1.6.34.bb
new file mode 100644
index 000000000..e52d03228
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libpng/libpng_1.6.34.bb
@@ -0,0 +1,30 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2db717a05a20e36f2fa673265bd31568 \
+ file://png.h;endline=144;md5=3ac9fd250a8786ae581e34254bf79429"
+DEPENDS = "zlib"
+
+LIBV = "16"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/${PV}/${BP}.tar.xz"
+SRC_URI[md5sum] = "c05b6ca7190a5e387b78657dbe5536b2"
+SRC_URI[sha256sum] = "2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6"
+
+MIRRORS += "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/${PV}/ ${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}${LIBV}/older-releases/${PV}/"
+
+UPSTREAM_CHECK_URI = "http://libpng.org/pub/png/libpng.html"
+
+BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+# Work around missing symbols
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
+
+PACKAGES =+ "${PN}-tools"
+
+FILES_${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix ${bindir}/pngcp"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch b/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch
new file mode 100644
index 000000000..d19b514e6
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0/0001-configure.ac-improve-alsa-handling.patch
@@ -0,0 +1,62 @@
+From 957ebce3837588f71016e37ffaf9aad0a9d41cec Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Fri, 23 Sep 2016 12:02:06 +0300
+Subject: [PATCH] configure.ac: improve alsa handling
+
+Three improvements:
+
+1) "--enable-alsa" or "--disable-alsa" caused a warning about an
+unsupported configure option, because AC_ARG_ENABLE was not used.
+
+2) If alsa was disabled, the "Have ALSA" item in the summary would print
+an empty string instead of "no".
+
+3) If "--enable-alsa" was passed to configure, but the headers were not
+found, configure would still succeed (with alsa disabled). It's better
+to fail and abort configure if a feature that was explicitly requested
+can't be enabled.
+
+Upstream-Status: Submitted [sent to src@mega-nerd.com]
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 474c6ab..bad597e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -101,6 +101,9 @@ AC_ARG_ENABLE(cpu-clip,
+ AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
+ ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")
+
++AC_ARG_ENABLE(alsa,
++ AC_HELP_STRING([--disable-alsa], [disable ALSA support in the varispeed-play example program]))
++
+ #====================================================================================
+ # Check types and their sizes.
+
+@@ -194,6 +197,10 @@ if test x$enable_alsa != xno ; then
+ if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then
+ ALSA_LIBS="-lasound"
+ enable_alsa=yes
++ elif test x$enable_alsa = xyes ; then
++ AC_MSG_ERROR(["ALSA headers not found"])
++ else
++ enable_alsa=no
+ fi
+ fi
+
+@@ -340,7 +347,7 @@ AC_MSG_RESULT([
+ Have FFTW : ................... ${ac_cv_fftw3}])
+
+ AC_MSG_RESULT([ Have libsndfile : ............. ${ac_cv_sndfile}])
+-AC_MSG_RESULT([ Have ALSA : ................... ${ac_cv_header_alsa_asoundlib_h}
++AC_MSG_RESULT([ Have ALSA : ................... ${enable_alsa}
+ ])
+
+ AC_MSG_RESULT([ Installation directories :
+--
+2.9.3
+
diff --git a/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb b/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb
new file mode 100644
index 000000000..ae0818944
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Audio Sample Rate Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/SRC/"
+SECTION = "libs"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=336d6faf40fb600bafb0061f4052f1f4 \
+ file://src/samplerate.c;beginline=1;endline=7;md5=5b6982a8c2811c7312c13cccbf55f55e"
+DEPENDS = "libsndfile1"
+PR = "r1"
+
+SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz \
+ file://0001-configure.ac-improve-alsa-handling.patch \
+"
+
+SRC_URI[md5sum] = "2b78ae9fe63b36b9fbb6267fad93f259"
+SRC_URI[sha256sum] = "0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1"
+
+CVE_PRODUCT = "libsamplerate"
+
+UPSTREAM_CHECK_URI = "http://www.mega-nerd.com/SRC/download.html"
+
+S = "${WORKDIR}/libsamplerate-${PV}"
+
+inherit autotools pkgconfig
+
+# FFTW and ALSA are only used in tests and examples, so they don't affect
+# normal builds. It should be safe to ignore these, but explicitly disabling
+# them adds some extra certainty that builds are deterministic.
+EXTRA_OECONF = "--disable-fftw --disable-alsa"
diff --git a/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch
new file mode 100644
index 000000000..89552ac2d
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-6892.patch
@@ -0,0 +1,34 @@
+From f833c53cb596e9e1792949f762e0b33661822748 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Tue, 23 May 2017 20:15:24 +1000
+Subject: [PATCH] src/aiff.c: Fix a buffer read overflow
+
+Secunia Advisory SA76717.
+
+Found by: Laurent Delosieres, Secunia Research at Flexera Software
+
+CVE: CVE-2017-6892
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+---
+ src/aiff.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/aiff.c b/src/aiff.c
+index 5b5f9f5..45864b7 100644
+--- a/src/aiff.c
++++ b/src/aiff.c
+@@ -1759,7 +1759,7 @@ aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
+ psf_binheader_readf (psf, "j", dword - bytesread) ;
+
+ if (map_info->channel_map != NULL)
+- { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ;
++ { size_t chanmap_size = SF_MIN (psf->sf.channels, layout_tag & 0xffff) * sizeof (psf->channel_map [0]) ;
+
+ free (psf->channel_map) ;
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch
new file mode 100644
index 000000000..ac99516bb
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8361-8365.patch
@@ -0,0 +1,73 @@
+From fd0484aba8e51d16af1e3a880f9b8b857b385eb3 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Wed, 12 Apr 2017 19:45:30 +1000
+Subject: [PATCH] FLAC: Fix a buffer read overrun
+
+Buffer read overrun occurs when reading a FLAC file that switches
+from 2 channels to one channel mid-stream. Only option is to
+abort the read.
+
+Closes: https://github.com/erikd/libsndfile/issues/230
+
+CVE: CVE-2017-8361 CVE-2017-8365
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/common.h | 1 +
+ src/flac.c | 13 +++++++++++++
+ src/sndfile.c | 1 +
+ 3 files changed, 15 insertions(+)
+
+diff --git a/src/common.h b/src/common.h
+index 0bd810c..e2669b6 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -725,6 +725,7 @@ enum
+ SFE_FLAC_INIT_DECODER,
+ SFE_FLAC_LOST_SYNC,
+ SFE_FLAC_BAD_SAMPLE_RATE,
++ SFE_FLAC_CHANNEL_COUNT_CHANGED,
+ SFE_FLAC_UNKOWN_ERROR,
+
+ SFE_WVE_NOT_WVE,
+diff --git a/src/flac.c b/src/flac.c
+index 84de0e2..986a7b8 100644
+--- a/src/flac.c
++++ b/src/flac.c
+@@ -434,6 +434,19 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
+
+ switch (metadata->type)
+ { case FLAC__METADATA_TYPE_STREAMINFO :
++ if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
++ { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
++ "Nothing to be but to error out.\n" ,
++ psf->sf.channels, metadata->data.stream_info.channels) ;
++ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
++ return ;
++ } ;
++
++ if (psf->sf.channels > 0 && psf->sf.samplerate != (int) metadata->data.stream_info.sample_rate)
++ { psf_log_printf (psf, "Warning: FLAC stream changed sample rates from %d to %d.\n"
++ "Carrying on as if nothing happened.",
++ psf->sf.samplerate, metadata->data.stream_info.sample_rate) ;
++ } ;
+ psf->sf.channels = metadata->data.stream_info.channels ;
+ psf->sf.samplerate = metadata->data.stream_info.sample_rate ;
+ psf->sf.frames = metadata->data.stream_info.total_samples ;
+diff --git a/src/sndfile.c b/src/sndfile.c
+index 4187561..e2a87be 100644
+--- a/src/sndfile.c
++++ b/src/sndfile.c
+@@ -245,6 +245,7 @@ ErrorStruct SndfileErrors [] =
+ { SFE_FLAC_INIT_DECODER , "Error : problem with initialization of the flac decoder." },
+ { SFE_FLAC_LOST_SYNC , "Error : flac decoder lost sync." },
+ { SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." },
++ { SFE_FLAC_CHANNEL_COUNT_CHANGED, "Error : flac channel changed mid stream." },
+ { SFE_FLAC_UNKOWN_ERROR , "Error : unknown error in flac decoder." },
+
+ { SFE_WVE_NOT_WVE , "Error : not a WVE file." },
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
new file mode 100644
index 000000000..9ee7e46a6
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8362.patch
@@ -0,0 +1,59 @@
+From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Fri, 14 Apr 2017 15:19:16 +1000
+Subject: [PATCH] src/flac.c: Fix a buffer read overflow
+
+A file (generated by a fuzzer) which increased the number of channels
+from one frame to the next could cause a read beyond the end of the
+buffer provided by libFLAC. Only option is to abort the read.
+
+Closes: https://github.com/erikd/libsndfile/issues/231
+
+CVE: CVE-2017-8362
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/flac.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/flac.c b/src/flac.c
+index 5a4f8c2..e4f9aaa 100644
+--- a/src/flac.c
++++ b/src/flac.c
+@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf)
+ const int32_t* const *buffer = pflac->wbuffer ;
+ unsigned i = 0, j, offset, channels, len ;
+
++ if (psf->sf.channels != (int) frame->header.channels)
++ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n"
++ "Nothing to do but to error out.\n" ,
++ psf->sf.channels, frame->header.channels) ;
++ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
++ return 0 ;
++ } ;
++
+ /*
+ ** frame->header.blocksize is variable and we're using a constant blocksize
+ ** of FLAC__MAX_BLOCK_SIZE.
+@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf)
+ return 0 ;
+ } ;
+
+-
+ len = SF_MIN (pflac->len, frame->header.blocksize) ;
+
+ if (pflac->remain % channels != 0)
+@@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_
+ { case FLAC__METADATA_TYPE_STREAMINFO :
+ if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels)
+ { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n"
+- "Nothing to be but to error out.\n" ,
++ "Nothing to do but to error out.\n" ,
+ psf->sf.channels, metadata->data.stream_info.channels) ;
+ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ;
+ return ;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch
new file mode 100644
index 000000000..e526e5a34
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsndfile/libsndfile1/CVE-2017-8363.patch
@@ -0,0 +1,37 @@
+From cd7da8dbf6ee4310d21d9e44b385d6797160d9e8 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Wed, 12 Apr 2017 20:19:34 +1000
+Subject: [PATCH] src/flac.c: Fix another memory leak
+
+When the FLAC decoder was passed a malformed file, the associated
+`FLAC__StreamDecoder` object was not getting released.
+
+Closes: https://github.com/erikd/libsndfile/issues/233
+
+CVE: CVE-2017-8363
+
+Upstream-Status: Backport [https://github.com/erikd/libsndfile/commit/cd7da8dbf6ee4310d21d9e44b385d6797160d9e8]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ src/flac.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/flac.c b/src/flac.c
+index 986a7b8..5a4f8c2 100644
+--- a/src/flac.c
++++ b/src/flac.c
+@@ -841,7 +841,9 @@ flac_read_header (SF_PRIVATE *psf)
+
+ psf_log_printf (psf, "End\n") ;
+
+- if (psf->error == 0)
++ if (psf->error != 0)
++ FLAC__stream_decoder_delete (pflac->fsd) ;
++ else
+ { FLAC__uint64 position ;
+
+ FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb b/poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
new file mode 100644
index 000000000..281ac82e3
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.28.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Audio format Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/libsndfile"
+AUTHOR = "Erik de Castro Lopo"
+DEPENDS = "flac libogg libvorbis sqlite3"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1"
+
+SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
+ file://CVE-2017-6892.patch \
+ file://CVE-2017-8361-8365.patch \
+ file://CVE-2017-8362.patch \
+ file://CVE-2017-8363.patch \
+ "
+
+SRC_URI[md5sum] = "646b5f98ce89ac60cdb060fcd398247c"
+SRC_URI[sha256sum] = "1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e77fe93202736b47c07035910f47974a"
+
+CVE_PRODUCT = "libsndfile"
+
+S = "${WORKDIR}/libsndfile-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)}"
+PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
+
+inherit autotools lib_package pkgconfig
+
+do_configure_prepend_arm() {
+ export ac_cv_sys_largefile_source=1
+ export ac_cv_sys_file_offset_bits=64
+}
+
diff --git a/poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch b/poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch
new file mode 100644
index 000000000..359f3d1a7
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libtheora-1.1.1/Makefile.am
+===================================================================
+--- libtheora-1.1.1.orig/Makefile.am 2009-11-25 22:01:53.593775926 +0100
++++ libtheora-1.1.1/Makefile.am 2009-11-25 22:02:00.777524017 +0100
+@@ -8,7 +8,7 @@
+ EXAMPLES_DIR =
+ endif
+
+-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR)
++SUBDIRS = lib include tests m4 $(EXAMPLES_DIR)
+
+
+ # we include the whole debian/ dir in EXTRA_DIST because there's a problem
diff --git a/poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb b/poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb
new file mode 100644
index 000000000..664d8480a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Theora Video Codec"
+DESCRIPTION = "The libtheora reference implementation provides the standard encoder and decoder under a BSD license."
+HOMEPAGE = "http://xiph.org/"
+BUGTRACKER = "https://trac.xiph.org/newticket"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cf91718f59eb6a83d06dc7bcaf411132"
+DEPENDS = "libogg"
+
+PR = "r1"
+
+SRC_URI = "http://downloads.xiph.org/releases/theora/libtheora-${PV}.tar.bz2 \
+ file://no-docs.patch"
+
+SRC_URI[md5sum] = "292ab65cedd5021d6b7ddd117e07cd8e"
+SRC_URI[sha256sum] = "b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc"
+
+UPSTREAM_CHECK_REGEX = "libtheora-(?P<pver>\d+(\.\d)+)\.(tar\.gz|tgz)"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-examples"
diff --git a/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-18013.patch b/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-18013.patch
new file mode 100644
index 000000000..878e0de95
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-18013.patch
@@ -0,0 +1,42 @@
+From 293c8b0298e91d20ba51291e2351ab7d110671d0 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Sun, 31 Dec 2017 15:09:41 +0100
+Subject: [PATCH] libtiff/tif_print.c: TIFFPrintDirectory(): fix null pointer
+ dereference on corrupted file. Fixes
+ http://bugzilla.maptools.org/show_bug.cgi?id=2770
+
+Upstream-Status: Backport
+[https://gitlab.com/libtiff/libtiff/commit/c6f41df7b581402dfba3c19a1e3df4454c551a01]
+
+CVE: CVE-2017-18013
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ libtiff/tif_print.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
+index 24d4b98..f494cfb 100644
+--- a/libtiff/tif_print.c
++++ b/libtiff/tif_print.c
+@@ -667,13 +667,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
+ #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
+ fprintf(fd, " %3lu: [%8I64u, %8I64u]\n",
+ (unsigned long) s,
+- (unsigned __int64) td->td_stripoffset[s],
+- (unsigned __int64) td->td_stripbytecount[s]);
++ td->td_stripoffset ? (unsigned __int64) td->td_stripoffset[s] : 0,
++ td->td_stripbytecount ? (unsigned __int64) td->td_stripbytecount[s] : 0);
+ #else
+ fprintf(fd, " %3lu: [%8llu, %8llu]\n",
+ (unsigned long) s,
+- (unsigned long long) td->td_stripoffset[s],
+- (unsigned long long) td->td_stripbytecount[s]);
++ td->td_stripoffset ? (unsigned long long) td->td_stripoffset[s] : 0,
++ td->td_stripbytecount ? (unsigned long long) td->td_stripbytecount[s] : 0);
+ #endif
+ }
+ }
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9935.patch b/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9935.patch
new file mode 100644
index 000000000..60684dd2a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtiff/files/CVE-2017-9935.patch
@@ -0,0 +1,160 @@
+From abb0055d21c52a9925314d5b0628fb2b6307619c Mon Sep 17 00:00:00 2001
+From: Brian May <brian@linuxpenguins.xyz>
+Date: Thu, 7 Dec 2017 07:46:47 +1100
+Subject: [PATCH] tiff2pdf: Fix CVE-2017-9935
+
+Fix for http://bugzilla.maptools.org/show_bug.cgi?id=2704
+
+This vulnerability - at least for the supplied test case - is because we
+assume that a tiff will only have one transfer function that is the same
+for all pages. This is not required by the TIFF standards.
+
+We than read the transfer function for every page. Depending on the
+transfer function, we allocate either 2 or 4 bytes to the XREF buffer.
+We allocate this memory after we read in the transfer function for the
+page.
+
+For the first exploit - POC1, this file has 3 pages. For the first page
+we allocate 2 extra extra XREF entries. Then for the next page 2 more
+entries. Then for the last page the transfer function changes and we
+allocate 4 more entries.
+
+When we read the file into memory, we assume we have 4 bytes extra for
+each and every page (as per the last transfer function we read). Which
+is not correct, we only have 2 bytes extra for the first 2 pages. As a
+result, we end up writing past the end of the buffer.
+
+There are also some related issues that this also fixes. For example,
+TIFFGetField can return uninitalized pointer values, and the logic to
+detect a N=3 vs N=1 transfer function seemed rather strange.
+
+It is also strange that we declare the transfer functions to be of type
+float, when the standard says they are unsigned 16 bit values. This is
+fixed in another patch.
+
+This patch will check to ensure that the N value for every transfer
+function is the same for every page. If this changes, we abort with an
+error. In theory, we should perhaps check that the transfer function
+itself is identical for every page, however we don't do that due to the
+confusion of the type of the data in the transfer function.
+
+Upstream-Status: Backport
+[https://gitlab.com/libtiff/libtiff/commit/3dd8f6a357981a4090f126ab9025056c938b6940]
+
+CVE: CVE-2017-9935
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ libtiff/tif_dir.c | 3 +++
+ tools/tiff2pdf.c | 65 +++++++++++++++++++++++++++++++++++++------------------
+ 2 files changed, 47 insertions(+), 21 deletions(-)
+
+diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
+index f00f808..c36a5f3 100644
+--- a/libtiff/tif_dir.c
++++ b/libtiff/tif_dir.c
+@@ -1067,6 +1067,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
+ if (td->td_samplesperpixel - td->td_extrasamples > 1) {
+ *va_arg(ap, uint16**) = td->td_transferfunction[1];
+ *va_arg(ap, uint16**) = td->td_transferfunction[2];
++ } else {
++ *va_arg(ap, uint16**) = NULL;
++ *va_arg(ap, uint16**) = NULL;
+ }
+ break;
+ case TIFFTAG_REFERENCEBLACKWHITE:
+diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
+index 454befb..0b5973e 100644
+--- a/tools/tiff2pdf.c
++++ b/tools/tiff2pdf.c
+@@ -1047,6 +1047,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
+ uint16 pagen=0;
+ uint16 paged=0;
+ uint16 xuint16=0;
++ uint16 tiff_transferfunctioncount=0;
++ float* tiff_transferfunction[3];
+
+ directorycount=TIFFNumberOfDirectories(input);
+ t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE)));
+@@ -1147,26 +1149,48 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
+ }
+ #endif
+ if (TIFFGetField(input, TIFFTAG_TRANSFERFUNCTION,
+- &(t2p->tiff_transferfunction[0]),
+- &(t2p->tiff_transferfunction[1]),
+- &(t2p->tiff_transferfunction[2]))) {
+- if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
+- (t2p->tiff_transferfunction[2] != (float*) NULL) &&
+- (t2p->tiff_transferfunction[1] !=
+- t2p->tiff_transferfunction[0])) {
+- t2p->tiff_transferfunctioncount = 3;
+- t2p->tiff_pages[i].page_extra += 4;
+- t2p->pdf_xrefcount += 4;
+- } else {
+- t2p->tiff_transferfunctioncount = 1;
+- t2p->tiff_pages[i].page_extra += 2;
+- t2p->pdf_xrefcount += 2;
+- }
+- if(t2p->pdf_minorversion < 2)
+- t2p->pdf_minorversion = 2;
++ &(tiff_transferfunction[0]),
++ &(tiff_transferfunction[1]),
++ &(tiff_transferfunction[2]))) {
++
++ if((tiff_transferfunction[1] != (float*) NULL) &&
++ (tiff_transferfunction[2] != (float*) NULL)
++ ) {
++ tiff_transferfunctioncount=3;
++ } else {
++ tiff_transferfunctioncount=1;
++ }
+ } else {
+- t2p->tiff_transferfunctioncount=0;
++ tiff_transferfunctioncount=0;
+ }
++
++ if (i > 0){
++ if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){
++ TIFFError(
++ TIFF2PDF_MODULE,
++ "Different transfer function on page %d",
++ i);
++ t2p->t2p_error = T2P_ERR_ERROR;
++ return;
++ }
++ }
++
++ t2p->tiff_transferfunctioncount = tiff_transferfunctioncount;
++ t2p->tiff_transferfunction[0] = tiff_transferfunction[0];
++ t2p->tiff_transferfunction[1] = tiff_transferfunction[1];
++ t2p->tiff_transferfunction[2] = tiff_transferfunction[2];
++ if(tiff_transferfunctioncount == 3){
++ t2p->tiff_pages[i].page_extra += 4;
++ t2p->pdf_xrefcount += 4;
++ if(t2p->pdf_minorversion < 2)
++ t2p->pdf_minorversion = 2;
++ } else if (tiff_transferfunctioncount == 1){
++ t2p->tiff_pages[i].page_extra += 2;
++ t2p->pdf_xrefcount += 2;
++ if(t2p->pdf_minorversion < 2)
++ t2p->pdf_minorversion = 2;
++ }
++
+ if( TIFFGetField(
+ input,
+ TIFFTAG_ICCPROFILE,
+@@ -1828,9 +1852,8 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
+ &(t2p->tiff_transferfunction[1]),
+ &(t2p->tiff_transferfunction[2]))) {
+ if((t2p->tiff_transferfunction[1] != (float*) NULL) &&
+- (t2p->tiff_transferfunction[2] != (float*) NULL) &&
+- (t2p->tiff_transferfunction[1] !=
+- t2p->tiff_transferfunction[0])) {
++ (t2p->tiff_transferfunction[2] != (float*) NULL)
++ ) {
+ t2p->tiff_transferfunctioncount=3;
+ } else {
+ t2p->tiff_transferfunctioncount=1;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libtiff/files/CVE-2018-5784.patch b/poky/meta/recipes-multimedia/libtiff/files/CVE-2018-5784.patch
new file mode 100644
index 000000000..406001d57
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtiff/files/CVE-2018-5784.patch
@@ -0,0 +1,135 @@
+From 6cdea15213be6b67d9f8380c7bb40e325d3adace Mon Sep 17 00:00:00 2001
+From: Nathan Baker <nathanb@lenovo-chrome.com>
+Date: Tue, 6 Feb 2018 10:13:57 -0500
+Subject: [PATCH] Fix for bug 2772
+
+It is possible to craft a TIFF document where the IFD list is circular,
+leading to an infinite loop while traversing the chain. The libtiff
+directory reader has a failsafe that will break out of this loop after
+reading 65535 directory entries, but it will continue processing,
+consuming time and resources to process what is essentially a bogus TIFF
+document.
+
+This change fixes the above behavior by breaking out of processing when
+a TIFF document has >= 65535 directories and terminating with an error.
+
+Upstream-Status: Backport
+[https://gitlab.com/libtiff/libtiff/commit/473851d211cf8805a161820337ca74cc9615d6ef]
+
+CVE: CVE-2018-5784
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ contrib/addtiffo/tif_overview.c | 14 +++++++++++++-
+ tools/tiff2pdf.c | 10 ++++++++++
+ tools/tiffcrop.c | 13 +++++++++++--
+ 3 files changed, 34 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/addtiffo/tif_overview.c b/contrib/addtiffo/tif_overview.c
+index c61ffbb..03b3573 100644
+--- a/contrib/addtiffo/tif_overview.c
++++ b/contrib/addtiffo/tif_overview.c
+@@ -65,6 +65,8 @@
+ # define MAX(a,b) ((a>b) ? a : b)
+ #endif
+
++#define TIFF_DIR_MAX 65534
++
+ void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
+ int (*)(double,void*), void * );
+
+@@ -91,6 +93,7 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
+ {
+ toff_t nBaseDirOffset;
+ toff_t nOffset;
++ tdir_t iNumDir;
+
+ (void) bUseSubIFDs;
+
+@@ -147,7 +150,16 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
+ return 0;
+
+ TIFFWriteDirectory( hTIFF );
+- TIFFSetDirectory( hTIFF, (tdir_t) (TIFFNumberOfDirectories(hTIFF)-1) );
++ iNumDir = TIFFNumberOfDirectories(hTIFF);
++ if( iNumDir > TIFF_DIR_MAX )
++ {
++ TIFFErrorExt( TIFFClientdata(hTIFF),
++ "TIFF_WriteOverview",
++ "File `%s' has too many directories.\n",
++ TIFFFileName(hTIFF) );
++ exit(-1);
++ }
++ TIFFSetDirectory( hTIFF, (tdir_t) (iNumDir - 1) );
+
+ nOffset = TIFFCurrentDirOffset( hTIFF );
+
+diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
+index 0b5973e..ef5d6a0 100644
+--- a/tools/tiff2pdf.c
++++ b/tools/tiff2pdf.c
+@@ -68,6 +68,8 @@ extern int getopt(int, char**, char*);
+
+ #define PS_UNIT_SIZE 72.0F
+
++#define TIFF_DIR_MAX 65534
++
+ /* This type is of PDF color spaces. */
+ typedef enum {
+ T2P_CS_BILEVEL = 0x01, /* Bilevel, black and white */
+@@ -1051,6 +1053,14 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
+ float* tiff_transferfunction[3];
+
+ directorycount=TIFFNumberOfDirectories(input);
++ if(directorycount > TIFF_DIR_MAX) {
++ TIFFError(
++ TIFF2PDF_MODULE,
++ "TIFF contains too many directories, %s",
++ TIFFFileName(input));
++ t2p->t2p_error = T2P_ERR_ERROR;
++ return;
++ }
+ t2p->tiff_pages = (T2P_PAGE*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,directorycount,sizeof(T2P_PAGE)));
+ if(t2p->tiff_pages==NULL){
+ TIFFError(
+diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
+index c69177e..c60cb38 100644
+--- a/tools/tiffcrop.c
++++ b/tools/tiffcrop.c
+@@ -217,6 +217,8 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
+ #define DUMP_TEXT 1
+ #define DUMP_RAW 2
+
++#define TIFF_DIR_MAX 65534
++
+ /* Offsets into buffer for margins and fixed width and length segments */
+ struct offset {
+ uint32 tmargin;
+@@ -2233,7 +2235,7 @@ main(int argc, char* argv[])
+ pageNum = -1;
+ else
+ total_images = 0;
+- /* read multiple input files and write to output file(s) */
++ /* Read multiple input files and write to output file(s) */
+ while (optind < argc - 1)
+ {
+ in = TIFFOpen (argv[optind], "r");
+@@ -2241,7 +2243,14 @@ main(int argc, char* argv[])
+ return (-3);
+
+ /* If only one input file is specified, we can use directory count */
+- total_images = TIFFNumberOfDirectories(in);
++ total_images = TIFFNumberOfDirectories(in);
++ if (total_images > TIFF_DIR_MAX)
++ {
++ TIFFError (TIFFFileName(in), "File contains too many directories");
++ if (out != NULL)
++ (void) TIFFClose(out);
++ return (1);
++ }
+ if (image_count == 0)
+ {
+ dirnum = 0;
+--
+2.7.4
+
diff --git a/poky/meta/recipes-multimedia/libtiff/files/libtool2.patch b/poky/meta/recipes-multimedia/libtiff/files/libtool2.patch
new file mode 100644
index 000000000..a84c68896
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtiff/files/libtool2.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: tiff-4.0.9/configure.ac
+===================================================================
+--- tiff-4.0.9.orig/configure.ac
++++ tiff-4.0.9/configure.ac
+@@ -27,7 +27,7 @@ dnl Process this file with autoconf to p
+ AC_PREREQ(2.64)
+ AC_INIT([LibTIFF Software],[4.0.9],[tiff@lists.maptools.org],[tiff])
+ AC_CONFIG_AUX_DIR(config)
+-AC_CONFIG_MACRO_DIR(m4)
++dnl AC_CONFIG_MACRO_DIR(m4)
+ AC_LANG(C)
+
+ dnl Compute the canonical host (run-time) system type variable
diff --git a/poky/meta/recipes-multimedia/libtiff/tiff_4.0.9.bb b/poky/meta/recipes-multimedia/libtiff/tiff_4.0.9.bb
new file mode 100644
index 000000000..8c3bba5c6
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libtiff/tiff_4.0.9.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Provides support for the Tag Image File Format (TIFF)"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=34da3db46fab7501992f9615d7e158cf"
+
+CVE_PRODUCT = "libtiff"
+
+SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \
+ file://libtool2.patch \
+ file://CVE-2017-9935.patch \
+ file://CVE-2017-18013.patch \
+ file://CVE-2018-5784.patch \
+ "
+
+SRC_URI[md5sum] = "54bad211279cc93eb4fca31ba9bfdc79"
+SRC_URI[sha256sum] = "6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd"
+
+# exclude betas
+UPSTREAM_CHECK_REGEX = "tiff-(?P<pver>\d+(\.\d+)+).tar"
+
+inherit autotools multilib_header
+
+CACHED_CONFIGUREVARS = "ax_cv_check_gl_libgl=no"
+
+PACKAGECONFIG ?= "cxx jpeg zlib lzma \
+ strip-chopping extrasample-as-alpha check-ycbcr-subsampling"
+
+PACKAGECONFIG[cxx] = "--enable-cxx,--disable-cxx,,"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg,"
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib,"
+PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz,"
+
+# Convert single-strip uncompressed images to multiple strips of specified
+# size (default: 8192) to reduce memory usage
+PACKAGECONFIG[strip-chopping] = "--enable-strip-chopping,--disable-strip-chopping,,"
+
+# Treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA
+PACKAGECONFIG[extrasample-as-alpha] = "--enable-extrasample-as-alpha,--disable-extrasample-as-alpha,,"
+
+# Control picking up YCbCr subsample info. Disable to support files lacking
+# the tag
+PACKAGECONFIG[check-ycbcr-subsampling] = "--enable-check-ycbcr-subsampling,--disable-check-ycbcr-subsampling,,"
+
+# Support a mechanism allowing reading large strips (usually one strip files)
+# in chunks when using TIFFReadScanline. Experimental 4.0+ feature
+PACKAGECONFIG[chunky-strip-read] = "--enable-chunky-strip-read,--disable-chunky-strip-read,,"
+
+PACKAGES =+ "tiffxx tiff-utils"
+FILES_tiffxx = "${libdir}/libtiffxx.so.*"
+FILES_tiff-utils = "${bindir}/*"
+
+do_install_append() {
+ oe_multilib_header tiffconf.h
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch b/poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch
new file mode 100644
index 000000000..7dad0cd8a
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch
@@ -0,0 +1,56 @@
+From 44b4511784f9b51c514dff4ceb3cbeaf9c374d08 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 16:06:55 +0000
+Subject: [PATCH] configure: Check for clang
+
+Disable gcc specific options if using clang
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index eddd02d..00ecba5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,6 +93,16 @@ AC_ARG_ENABLE(examples,
+
+ AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = xyes])
+
++AC_MSG_CHECKING([whether C compiler is clang])
++$CC -x c /dev/null -dM -E > conftest.txt 2>&1
++if grep "__clang__" conftest.txt >/dev/null 2>&1; then
++ AC_SUBST([CC_CLANG], [1])
++ AC_MSG_RESULT([yes])
++ else
++ AC_SUBST([CC_CLANG], [0])
++ AC_MSG_RESULT([no])
++fi
++
+ dnl --------------------------------------------------
+ dnl Set build flags based on environment
+ dnl --------------------------------------------------
+@@ -127,10 +137,15 @@ else
+ AC_MSG_RESULT([$GCC_VERSION])
+ case $host in
+ *86-*-linux*)
++ if test "$CC_CLANG" = "1"; then
++ ieeefp=""
++ else
++ ieefp="-mno-ieee-fp"
++ fi
+ DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+- CFLAGS="-O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
++ CFLAGS="-O3 -ffast-math -D_REENTRANT -fsigned-char ${ieefp}"
+ # PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+- PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline"
++ PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math ${ieefp} -D_REENTRANT -fsigned-char -fno-inline"
+
+ # glibc < 2.1.3 has a serious FP bug in the math inline header
+ # that will cripple Vorbis. Look to see if the magic FP stack
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14632.patch b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14632.patch
new file mode 100644
index 000000000..4036b966f
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14632.patch
@@ -0,0 +1,62 @@
+From 39704ce16835e5c019bb03f6a94dc1f0677406c5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Wed, 15 Nov 2017 18:22:59 +0100
+Subject: [PATCH] CVE-2017-14632: vorbis_analysis_header_out: Don't clear opb
+ if not initialized
+
+If the number of channels is not within the allowed range
+we call oggback_writeclear altough it's not initialized yet.
+
+This fixes
+
+ =23371== Invalid free() / delete / delete[] / realloc()
+ ==23371== at 0x4C2CE1B: free (vg_replace_malloc.c:530)
+ ==23371== by 0x829CA31: oggpack_writeclear (in /usr/lib/x86_64-linux-gnu/libogg.so.0.8.2)
+ ==23371== by 0x84B96EE: vorbis_analysis_headerout (info.c:652)
+ ==23371== by 0x9FBCBCC: ??? (in /usr/lib/x86_64-linux-gnu/sox/libsox_fmt_vorbis.so)
+ ==23371== by 0x4E524F1: ??? (in /usr/lib/x86_64-linux-gnu/libsox.so.2.0.1)
+ ==23371== by 0x4E52CCA: sox_open_write (in /usr/lib/x86_64-linux-gnu/libsox.so.2.0.1)
+ ==23371== by 0x10D82A: open_output_file (sox.c:1556)
+ ==23371== by 0x10D82A: process (sox.c:1753)
+ ==23371== by 0x10D82A: main (sox.c:3012)
+ ==23371== Address 0x68768c8 is 488 bytes inside a block of size 880 alloc'd
+ ==23371== at 0x4C2BB1F: malloc (vg_replace_malloc.c:298)
+ ==23371== by 0x4C2DE9F: realloc (vg_replace_malloc.c:785)
+ ==23371== by 0x4E545C2: lsx_realloc (in /usr/lib/x86_64-linux-gnu/libsox.so.2.0.1)
+ ==23371== by 0x9FBC9A0: ??? (in /usr/lib/x86_64-linux-gnu/sox/libsox_fmt_vorbis.so)
+ ==23371== by 0x4E524F1: ??? (in /usr/lib/x86_64-linux-gnu/libsox.so.2.0.1)
+ ==23371== by 0x4E52CCA: sox_open_write (in /usr/lib/x86_64-linux-gnu/libsox.so.2.0.1)
+ ==23371== by 0x10D82A: open_output_file (sox.c:1556)
+ ==23371== by 0x10D82A: process (sox.c:1753)
+ ==23371== by 0x10D82A: main (sox.c:3012)
+
+as seen when using the testcase from CVE-2017-11333 with
+008d23b782be09c8d75ba8190b1794abd66c7121 applied. However the error was
+there before.
+
+Upstream-Status: Backport
+CVE: CVE-2017-14632
+
+Reference to upstream patch:
+https://git.xiph.org/?p=vorbis.git;a=commitdiff;h=c1c2831fc7306d5fbd7bc800324efd12b28d327f
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ lib/info.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/info.c b/lib/info.c
+index 81b7557..4d82568 100644
+--- a/lib/info.c
++++ b/lib/info.c
+@@ -584,6 +584,7 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
+ private_state *b=v->backend_state;
+
+ if(!b||vi->channels<=0||vi->channels>256){
++ b = NULL;
+ ret=OV_EFAULT;
+ goto err_out;
+ }
+--
+2.16.2
+
diff --git a/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14633.patch b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14633.patch
new file mode 100644
index 000000000..9c9e688d4
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2017-14633.patch
@@ -0,0 +1,42 @@
+From 07eda55f336e5c44dfc0e4a1e21628faed7255fa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Tue, 31 Oct 2017 18:32:46 +0100
+Subject: [PATCH] CVE-2017-14633: Don't allow for more than 256 channels
+
+Otherwise
+
+ for(i=0;i<vi->channels;i++){
+ /* the encoder setup assumes that all the modes used by any
+ specific bitrate tweaking use the same floor */
+ int submap=info->chmuxlist[i];
+
+overreads later in mapping0_forward since chmuxlist is a fixed array of
+256 elements max.
+
+Upstream-Status: Backport
+CVE: CVE-2017-14633
+
+Reference to upstream patch:
+https://git.xiph.org/?p=vorbis.git;a=commitdiff;h=667ceb4aab60c1f74060143bb24e5f427b3cce5f
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ lib/info.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/info.c b/lib/info.c
+index e447a0c..81b7557 100644
+--- a/lib/info.c
++++ b/lib/info.c
+@@ -583,7 +583,7 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v,
+ oggpack_buffer opb;
+ private_state *b=v->backend_state;
+
+- if(!b||vi->channels<=0){
++ if(!b||vi->channels<=0||vi->channels>256){
+ ret=OV_EFAULT;
+ goto err_out;
+ }
+--
+2.16.2
+
diff --git a/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2018-5146.patch b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2018-5146.patch
new file mode 100644
index 000000000..6d4052a87
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libvorbis/libvorbis/CVE-2018-5146.patch
@@ -0,0 +1,100 @@
+From 3a017f591457bf6e80231b563bf83ee583fdbca8 Mon Sep 17 00:00:00 2001
+From: Thomas Daede <daede003@umn.edu>
+Date: Thu, 15 Mar 2018 14:15:31 -0700
+Subject: [PATCH] CVE-2018-5146: Prevent out-of-bounds write in codebook
+ decoding.
+
+Codebooks that are not an exact divisor of the partition size are now
+truncated to fit within the partition.
+
+Upstream-Status: Backport
+CVE: CVE-2018-5146
+
+Reference to upstream patch:
+https://git.xiph.org/?p=vorbis.git;a=commitdiff;h=667ceb4aab60c1f74060143bb24e5f427b3cce5f
+
+Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
+---
+ lib/codebook.c | 48 ++++++++++--------------------------------------
+ 1 file changed, 10 insertions(+), 38 deletions(-)
+
+diff --git a/lib/codebook.c b/lib/codebook.c
+index 8b766e8..7022fd2 100644
+--- a/lib/codebook.c
++++ b/lib/codebook.c
+@@ -387,7 +387,7 @@ long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
+ t[i] = book->valuelist+entry[i]*book->dim;
+ }
+ for(i=0,o=0;i<book->dim;i++,o+=step)
+- for (j=0;j<step;j++)
++ for (j=0;o+j<n && j<step;j++)
+ a[o+j]+=t[j][i];
+ }
+ return(0);
+@@ -399,41 +399,12 @@ long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){
+ int i,j,entry;
+ float *t;
+
+- if(book->dim>8){
+- for(i=0;i<n;){
+- entry = decode_packed_entry_number(book,b);
+- if(entry==-1)return(-1);
+- t = book->valuelist+entry*book->dim;
+- for (j=0;j<book->dim;)
+- a[i++]+=t[j++];
+- }
+- }else{
+- for(i=0;i<n;){
+- entry = decode_packed_entry_number(book,b);
+- if(entry==-1)return(-1);
+- t = book->valuelist+entry*book->dim;
+- j=0;
+- switch((int)book->dim){
+- case 8:
+- a[i++]+=t[j++];
+- case 7:
+- a[i++]+=t[j++];
+- case 6:
+- a[i++]+=t[j++];
+- case 5:
+- a[i++]+=t[j++];
+- case 4:
+- a[i++]+=t[j++];
+- case 3:
+- a[i++]+=t[j++];
+- case 2:
+- a[i++]+=t[j++];
+- case 1:
+- a[i++]+=t[j++];
+- case 0:
+- break;
+- }
+- }
++ for(i=0;i<n;){
++ entry = decode_packed_entry_number(book,b);
++ if(entry==-1)return(-1);
++ t = book->valuelist+entry*book->dim;
++ for(j=0;i<n && j<book->dim;)
++ a[i++]+=t[j++];
+ }
+ }
+ return(0);
+@@ -471,12 +442,13 @@ long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch,
+ long i,j,entry;
+ int chptr=0;
+ if(book->used_entries>0){
+- for(i=offset/ch;i<(offset+n)/ch;){
++ int m=(offset+n)/ch;
++ for(i=offset/ch;i<m;){
+ entry = decode_packed_entry_number(book,b);
+ if(entry==-1)return(-1);
+ {
+ const float *t = book->valuelist+entry*book->dim;
+- for (j=0;j<book->dim;j++){
++ for (j=0;i<m && j<book->dim;j++){
+ a[chptr++][i]+=t[j];
+ if(chptr==ch){
+ chptr=0;
+--
+2.16.2
+
diff --git a/poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb b/poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
new file mode 100644
index 000000000..20f887c25
--- /dev/null
+++ b/poky/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Ogg Vorbis Audio Codec"
+DESCRIPTION = "Ogg Vorbis is a high-quality lossy audio codec \
+that is free of intellectual property restrictions. libvorbis \
+is the main vorbis codec library."
+HOMEPAGE = "http://www.vorbis.com/"
+BUGTRACKER = "https://trac.xiph.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7d2c487d2fc7dd3e3c7c465a5b7f6217 \
+ file://include/vorbis/vorbisenc.h;beginline=1;endline=11;md5=d1c1d138863d6315131193d4046d81cb"
+DEPENDS = "libogg"
+
+SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz \
+ file://0001-configure-Check-for-clang.patch \
+ file://CVE-2017-14633.patch \
+ file://CVE-2017-14632.patch \
+ file://CVE-2018-5146.patch \
+ "
+SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f"
+SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-multimedia/mpeg2dec/files/0001-check-for-available-arm-optimizations.patch b/poky/meta/recipes-multimedia/mpeg2dec/files/0001-check-for-available-arm-optimizations.patch
new file mode 100644
index 000000000..5bf68b39e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/mpeg2dec/files/0001-check-for-available-arm-optimizations.patch
@@ -0,0 +1,55 @@
+From cbcff58ed670c8edc0be1004384cbe0fd07d8d26 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 18:49:21 -0700
+Subject: [PATCH 1/2] check for available arm optimizations
+
+Taken From
+http://sources.debian.net/src/mpeg2dec/0.5.1-7/debian/patches/65_arm-test-with-compiler.patch/
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index acdcb1e..2c0a721 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -59,7 +59,7 @@ elif test x"$GCC" = x"yes"; then
+ AC_TRY_CFLAGS([$TRY_CFLAGS $CFLAGS],[OPT_CFLAGS="$TRY_CFLAGS"])
+
+ dnl arch-specific flags
+- arm_conditional=false
++ build_arm_opt=false
+ case "$host" in
+ i?86-* | k?-* | x86_64-* | amd64-*)
+ AC_DEFINE([ARCH_X86],,[x86 architecture])
+@@ -102,8 +102,12 @@ elif test x"$GCC" = x"yes"; then
+ alpha*)
+ AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
+ arm*)
+- arm_conditional=:
+- AC_DEFINE([ARCH_ARM],,[ARM architecture]);;
++ AC_LANG(C)
++ AC_COMPILE_IFELSE(
++ [AC_LANG_SOURCE([[
++ void foo(void) { __asm__ volatile("pld [r1]"); }]])],
++ build_arm_opt=true; AC_DEFINE([ARCH_ARM],,[ARM architecture]),
++ build_arm_opt=false);;
+ esac
+ elif test x"$CC" = x"tendracc"; then
+ dnl TenDRA portability checking compiler
+@@ -123,7 +127,7 @@ else
+ esac
+ fi
+
+-AM_CONDITIONAL(ARCH_ARM, ${arm_conditional})
++AM_CONDITIONAL(ARCH_ARM, test x$build_arm_opt = xtrue)
+
+ dnl Checks for libtool - this must be done after we set cflags
+ AC_LIBTOOL_WIN32_DLL
+--
+2.13.2
+
diff --git a/poky/meta/recipes-multimedia/mpeg2dec/files/0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch b/poky/meta/recipes-multimedia/mpeg2dec/files/0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch
new file mode 100644
index 000000000..830169236
--- /dev/null
+++ b/poky/meta/recipes-multimedia/mpeg2dec/files/0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch
@@ -0,0 +1,63 @@
+From f9d9dc92d75f8910e3cd5fdcbea72e505cdf3493 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 5 Jul 2017 19:03:36 -0700
+Subject: [PATCH 2/2] Set visibility of global symbols used in ARM specific
+ assembly file to internal
+
+Taken from
+http://sources.debian.net/src/mpeg2dec/0.5.1-7/debian/patches/60_arm-private-symbols.patch/
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libmpeg2/motion_comp_arm_s.S | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/libmpeg2/motion_comp_arm_s.S b/libmpeg2/motion_comp_arm_s.S
+index f6c3d7d..c921f7c 100644
+--- a/libmpeg2/motion_comp_arm_s.S
++++ b/libmpeg2/motion_comp_arm_s.S
+@@ -23,7 +23,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_16_arm
++ .global MC_put_o_16_arm
++ .internal MC_put_o_16_arm
+ MC_put_o_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -83,7 +84,8 @@ MC_put_o_16_arm_align_jt:
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_8_arm
++ .global MC_put_o_8_arm
++ .internal MC_put_o_8_arm
+ MC_put_o_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -152,7 +154,8 @@ MC_put_o_8_arm_align_jt:
+ .endm
+
+ .align
+- .global MC_put_x_16_arm
++ .global MC_put_x_16_arm
++ .internal MC_put_x_16_arm
+ MC_put_x_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+@@ -244,7 +247,8 @@ MC_put_x_16_arm_align_jt:
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_x_8_arm
++ .global MC_put_x_8_arm
++ .internal MC_put_x_8_arm
+ MC_put_x_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+--
+2.13.2
+
diff --git a/poky/meta/recipes-multimedia/mpeg2dec/files/altivec_h_needed.patch b/poky/meta/recipes-multimedia/mpeg2dec/files/altivec_h_needed.patch
new file mode 100644
index 000000000..5113ad44f
--- /dev/null
+++ b/poky/meta/recipes-multimedia/mpeg2dec/files/altivec_h_needed.patch
@@ -0,0 +1,43 @@
+Add new method to judge whether <altivec.h> is needed
+
+The original logic will use "typedef vector int t;" to judge
+whether <altivec.h> is needed. altivec.h contains the following
+statement:
+
+ #if !defined(__APPLE_ALTIVEC__)
+ #define vector __vector
+ #define pixel __pixel
+ #define bool
+ #endif
+
+In gcc-4.3.3, __APPLE_ALTIVEC__ is not defined by compiler, neither
+as vector, pixel, and bool. In order to make "typedef vector int t;"
+pass the compilation, we need to include altivec.h.
+
+However in gcc-4.5.0, __APPLE_ALTIVEC__ is defined by compiler,
+so as vector, pixel, and bool. We could not judge whether
+altivec.h is needed by "typedef vector int t;".
+Here we include another statement "int tmp = __CR6_EQ;", in
+which __CR6_EQ is defined in altivec.h.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN a/configure.in b/configure.in
+--- a/configure.ac 2010-09-14 20:55:42.399687663 +0800
++++ b/configure.ac 2010-09-14 20:56:43.403204648 +0800
+@@ -79,11 +79,11 @@
+ CFLAGS="$OPT_CFLAGS $TRY_CFLAGS $CFLAGS"
+ AC_MSG_CHECKING([if <altivec.h> is needed])
+ AC_TRY_COMPILE([],
+- [typedef vector int t;
++ [typedef vector int t; int tmp = __CR6_EQ;
+ vec_ld(0, (unsigned char *)0);],
+ [have_altivec=yes; AC_MSG_RESULT(no)],
+ [AC_TRY_COMPILE([#include <altivec.h>],
+- [typedef vector int t; vec_ld(0, (unsigned char *)0);],
++ [typedef vector int t; int tmp = __CR6_EQ; vec_ld(0, (unsigned char *)0);],
+ [AC_DEFINE([HAVE_ALTIVEC_H],,
+ [Define to 1 if you have the <altivec.h> header.])
+ have_altivec=yes; AC_MSG_RESULT(yes)],
diff --git a/poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb b/poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb
new file mode 100644
index 000000000..7711c2dc1
--- /dev/null
+++ b/poky/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.5.1.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Library and test program for decoding MPEG-2 and MPEG-1 video streams"
+HOMEPAGE = "http://libmpeg2.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://include/mpeg2.h;beginline=1;endline=22;md5=7766f4fcb58f0f8413c49a746f2ab89b"
+
+SRC_URI = "http://libmpeg2.sourceforge.net/files/libmpeg2-${PV}.tar.gz \
+ file://altivec_h_needed.patch \
+ file://0001-check-for-available-arm-optimizations.patch \
+ file://0002-Set-visibility-of-global-symbols-used-in-ARM-specifi.patch \
+ "
+
+S = "${WORKDIR}/libmpeg2-${PV}"
+
+SRC_URI[md5sum] = "0f92c7454e58379b4a5a378485bbd8ef"
+SRC_URI[sha256sum] = "dee22e893cb5fc2b2b6ebd60b88478ab8556cb3b93f9a0d7ce8f3b61851871d4"
+
+UPSTREAM_CHECK_URI = "http://libmpeg2.sourceforge.net/downloads.html"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --disable-sdl"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
+PACKAGECONFIG[x11] = "--with-x,--without-x,virtual/libx11 libxext libxv"
+
+PACKAGES = "mpeg2dec-dbg mpeg2dec mpeg2dec-doc libmpeg2 libmpeg2-dev libmpeg2convert libmpeg2convert-dev libmpeg2-staticdev libmpeg2convert-staticdev"
+
+FILES_${PN} = "${bindir}/*"
+FILES_libmpeg2 = "${libdir}/libmpeg2.so.*"
+FILES_libmpeg2convert = "${libdir}/libmpeg2convert.so.*"
+FILES_libmpeg2-dev = "${libdir}/libmpeg2.so \
+ ${libdir}/libmpeg2.la \
+ ${libdir}/libmpeg2arch.la \
+ ${libdir}/pkgconfig/libmpeg2.pc \
+ ${includedir}/mpeg2dec/mpeg2.h"
+FILES_libmpeg2-staticdev = "${libdir}/libmpeg2.a"
+FILES_libmpeg2convert-dev = "${libdir}/libmpeg2convert.so \
+ ${libdir}/libmpeg2convert.la \
+ ${libdir}/libmpeg2convertarch.la \
+ ${libdir}/pkgconfig/libmpeg2convert.pc \
+ ${includedir}/mpeg2dec/mpeg2convert.h"
+FILES_libmpeg2convert-staticdev = "${libdir}/libmpeg2convert.a"
diff --git a/poky/meta/recipes-multimedia/mpg123/mpg123_1.25.10.bb b/poky/meta/recipes-multimedia/mpg123/mpg123_1.25.10.bb
new file mode 100644
index 000000000..929069ab4
--- /dev/null
+++ b/poky/meta/recipes-multimedia/mpg123/mpg123_1.25.10.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Audio decoder for MPEG-1 Layer 1/2/3"
+DESCRIPTION = "The core of mpg123 is an MPEG-1 Layer 1/2/3 decoding library, which can be used by other programs. \
+mpg123 also comes with a command-line tool which can playback using ALSA, PulseAudio, OSS, and several other APIs, \
+and also can write the decoded audio to WAV."
+HOMEPAGE = "http://mpg123.de/"
+BUGTRACKER = "http://sourceforge.net/p/mpg123/bugs/"
+SECTION = "multimedia"
+
+LICENSE = "LGPLv2.1"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e86753638d3cf2512528b99079bc4f3"
+
+SRC_URI = "https://www.mpg123.de/download/${BP}.tar.bz2"
+SRC_URI[md5sum] = "ea32caa61d41d8be797f0b04a1b43ad9"
+SRC_URI[sha256sum] = "6c1337aee2e4bf993299851c70b7db11faec785303cfca3a5c3eb5f329ba7023"
+
+inherit autotools pkgconfig
+
+# The options should be mutually exclusive for configuration script.
+# If both alsa and pulseaudio are specified (as in the default distro features)
+# pulseaudio takes precedence.
+PACKAGECONFIG_ALSA = "${@bb.utils.filter('DISTRO_FEATURES', 'alsa', d)}"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '${PACKAGECONFIG_ALSA}', d)}"
+
+PACKAGECONFIG[alsa] = "--with-default-audio=alsa,,alsa-lib"
+PACKAGECONFIG[esd] = ",,esound"
+PACKAGECONFIG[jack] = ",,jack"
+PACKAGECONFIG[openal] = ",,openal-soft"
+PACKAGECONFIG[portaudio] = ",,portaudio-v19"
+PACKAGECONFIG[pulseaudio] = "--with-default-audio=pulse,,pulseaudio"
+PACKAGECONFIG[sdl] = ",,libsdl"
+
+# Following are possible sound output modules:
+# alsa arts coreaudio dummy esd jack nas openal os2 oss portaudio pulse sdl sndio sun tinyalsa win32 win32_wasapi
+AUDIOMODS += "${@bb.utils.filter('PACKAGECONFIG', 'alsa esd jack openal portaudio sdl', d)}"
+AUDIOMODS += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'pulse', '', d)}"
+
+EXTRA_OECONF = " \
+ --enable-shared \
+ --with-audio='${AUDIOMODS}' \
+ ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-cpu=neon', '', d)} \
+ ${@bb.utils.contains('TUNE_FEATURES', 'altivec', '--with-cpu=altivec', '', d)} \
+"
+# Fails to build with thumb-1 (qemuarm)
+#| {standard input}: Assembler messages:
+#| {standard input}:47: Error: selected processor does not support Thumb mode `smull r5,r6,r7,r4'
+#| {standard input}:48: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov r5,r5,lsr#24'
+#...
+#| make[3]: *** [equalizer.lo] Error 1
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
new file mode 100644
index 000000000..8189a569e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -0,0 +1,272 @@
+SUMMARY = "Sound server for Linux and Unix-like operating systems"
+HOMEPAGE = "http://www.pulseaudio.org"
+AUTHOR = "Lennart Poettering"
+SECTION = "libs/multimedia"
+
+# Most of PulseAudio code is under LGPLv2.1+. There are a few exceptions:
+#
+# The "adrian" echo canceller variant has code under a non-standard permissive
+# license. See src/modules/echo-cancel/adrian-license.txt for details. This
+# recipe disables the adrian echo canceller to avoid hassle with the unusual
+# license.
+#
+# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
+# license.
+#
+# The src/pulsecore/filter/ directory contains code under the 3-clause BSD
+# license.
+#
+# src/utils/qpaeq is licensed under AGPL. qpaeq is not installed by this
+# recipe, however, which is why AGPL is not mentioned in LICENSE.
+#
+# People who distribute PulseAudio binaries need to also consider that there
+# are some dependencies to GPL libraries. LGPL code that depends on GPL
+# libraries probably becomes effectively GPL-licensed (at compile-time? or at
+# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
+# implications. The GPL dependencies only affect the server, not the client
+# library, with the exception of libdbus that affects both. These are the GPL
+# library dependencies:
+#
+# One of the resampler implementations uses libsamplerate. This recipe doesn't
+# enable that resampler, however.
+#
+# One of the database implementations uses gdbm. This recipe doesn't enable
+# that database implementation, however.
+#
+# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
+#
+# module-equalizer-sink uses FFTW. This recipe disables that, however.
+#
+# The dependency with the most complicated licensing considerations is libdbus.
+# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
+# used by both the server and the client library (libpulse). Does this affect
+# applications that use libpulse? It should be also noted that libdbus is
+# dual-licensed: either GPLv2+ or AFL-2 terms apply. Whose decision is it which
+# of the licenses apply? What a mess. Some people hold the view that libdbus is
+# a system library that is covered by the "special exception" in GPLv2's
+# section 3, and therefore libdbus's GPL license doesn't affect PulseAudio.
+LICENSE = "LGPLv2.1+ & MIT & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a848e8d03f04976778eab2348b59ed2b \
+ file://GPL;md5=4325afd396febcb659c36b49533135d4 \
+ file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://AGPL;md5=73f1eb20517c55bf9493b7dd6e480788 \
+ file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
+ file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
+ file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
+ file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
+ file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
+ file://src/utils/qpaeq;beginline=2;endline=16;md5=7f62515a4762f0c3fc3d4201858bb964 \
+ file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
+ file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
+"
+
+DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native"
+# optional
+DEPENDS += "udev alsa-lib glib-2.0 gconf"
+DEPENDS += "speexdsp libxml-parser-perl-native libcap"
+
+inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd manpages
+
+# *.desktop rules wont be generated during configure and build will fail
+# if using --disable-nls
+USE_NLS = "yes"
+
+EXTRA_OECONF = "\
+ --disable-hal-compat \
+ --disable-orc \
+ --enable-tcpwrap=no \
+ --with-access-group=audio \
+ --disable-openssl \
+ --with-database=simple \
+ --without-zsh-completion-dir \
+ --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
+ ac_cv_header_valgrind_memcheck_h=no \
+ --disable-tests \
+"
+
+# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
+# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
+EXTRA_OECONF += "--without-soxr"
+
+# The FFTW dependency (for module-equalizer-sink) was removed in commit
+# ddbd713293 without explaining why it was not made a PACKAGECONFIG item
+# instead. Oh well, let's keep it disabled until someone expresses some
+# interest in having it enabled.
+#
+# One nice thing about disabling this is that it also prevents qpaeq from
+# being installed, so we avoid adding AGPL to the list of licenses (nothing
+# else in PulseAudio is licensed under AGPL).
+EXTRA_OECONF += "--without-fftw"
+
+# The "adrian" echo canceller implementation has a non-standard license
+# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
+# the licensing terms are probably not problematic, but it would be an extra
+# hassle to add the license to OE-Core's set of licenses. The canceller isn't
+# very good anyway, better alternatives exist (such as the webrtc canceller).
+EXTRA_OECONF += "--disable-adrian-aec"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
+ dbus \
+ "
+
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc"
+PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
+PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
+PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
+PACKAGECONFIG[systemd] = "--enable-systemd-daemon --enable-systemd-login --enable-systemd-journal --with-systemduserunitdir=${systemd_user_unitdir},--disable-systemd-daemon --disable-systemd-login --disable-systemd-journal,systemd"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+# Since many embedded systems don't have non-root users, it's useful to be
+# able to use pulseaudio autospawn for root as well.
+PACKAGECONFIG[autospawn-for-root] = ",,,"
+PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
+PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, "
+
+EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+
+
+export TARGET_PFPU = "${TARGET_FPU}"
+
+# TODO: Use more fine granular version
+#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
+OE_LT_RPATH_ALLOW = "any"
+OE_LT_RPATH_ALLOW[export]="1"
+
+set_cfg_value () {
+ sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
+ if ! grep -q "^$2 = $3\$" "$1"; then
+ die "Use of sed to set '$2' to '$3' in '$1' failed"
+ fi
+}
+
+do_compile_append () {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
+ set_cfg_value src/client.conf allow-autospawn-for-root yes
+ fi
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
+}
+
+USERADD_PACKAGES = "pulseaudio-server"
+GROUPADD_PARAM_pulseaudio-server = "--system pulse"
+USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
+ --no-create-home --shell /bin/false \
+ --groups audio,pulse --gid pulse pulse"
+
+# The console-kit module is included here explicitly so bitbake can map to the
+# RDEPENDS we define for it in this recipe, and thereby ensure that when
+# adding the console-kit module to an image, we also get the necessary
+# consolekit package produced.
+PACKAGES =+ "libpulsecore libpulsecommon libpulse libpulse-simple libpulse-mainloop-glib \
+ pulseaudio-server pulseaudio-misc ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
+
+#upgrade path:
+RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
+
+PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
+
+FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
+FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
+
+# client.conf configures the behaviour of libpulse, so it belongs in the same
+# package.
+FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
+
+FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
+FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
+
+FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"
+FILES_${PN}-conf = "${sysconfdir}"
+FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
+FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
+
+#SYSTEMD_PACKAGES = "${PN}-server"
+SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
+
+FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
+
+# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
+ALLOW_EMPTY_${PN} = "1"
+
+CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
+
+CONFFILES_pulseaudio-server = "\
+ ${sysconfdir}/pulse/default.pa \
+ ${sysconfdir}/pulse/daemon.conf \
+ ${sysconfdir}/pulse/system.pa \
+ "
+
+pkg_postinst_${PN}-server() {
+ if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+}
+
+python populate_packages_prepend() {
+ #d.setVar('PKG_pulseaudio', 'pulseaudio')
+
+ plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
+ do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
+ do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
+}
+
+RDEPENDS_pulseaudio-server = " \
+ pulseaudio-module-filter-apply \
+ pulseaudio-module-filter-heuristics \
+ pulseaudio-module-udev-detect \
+ pulseaudio-module-null-sink \
+ pulseaudio-module-device-restore \
+ pulseaudio-module-stream-restore \
+ pulseaudio-module-card-restore \
+ pulseaudio-module-augment-properties \
+ pulseaudio-module-detect \
+ pulseaudio-module-alsa-sink \
+ pulseaudio-module-alsa-source \
+ pulseaudio-module-alsa-card \
+ pulseaudio-module-native-protocol-unix \
+ pulseaudio-module-default-device-restore \
+ pulseaudio-module-intended-roles \
+ pulseaudio-module-rescue-streams \
+ pulseaudio-module-always-sink \
+ pulseaudio-module-suspend-on-idle \
+ pulseaudio-module-position-event-sounds \
+ pulseaudio-module-role-cork \
+ pulseaudio-module-switch-on-port-available"
+
+# If the server is installed, it's usually desirable to make ALSA applications
+# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
+# that makes the PulseAudio plugin the default ALSA device.
+RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
+
+# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
+# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
+RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
+RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
+
+FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper"
+FILES_pulseaudio-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
+
+# The console-kit module is good to have on X11 systems (it keeps PulseAudio
+# running for the duration of the user login session). The device-manager and
+# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
+# modules must be installed when X11 is enabled.
+RDEPENDS_pulseaudio-server += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
+ pulseaudio-module-console-kit \
+ pulseaudio-module-device-manager \
+ pulseaudio-module-x11-cork-request \
+ pulseaudio-module-x11-publish \
+ pulseaudio-module-x11-xsmp \
+ ', '', d)}"
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
new file mode 100644
index 000000000..33f7709ae
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -0,0 +1,97 @@
+From babec3a50dd710d26b72f6c6d43bd79b04e954a6 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Tue, 28 Apr 2015 14:32:43 +0300
+Subject: [PATCH] client-conf: Add allow-autospawn-for-root
+
+Usually autospawning for root is a bad idea, since it can easily
+interfere with other users' PulseAudio instances, but in embedded
+environments where only root exists, autospawning is fine.
+
+Upstream-Status: Denied [Upstream hasn't so far been convinced that
+this feature is needed. The view is that running the graphical session
+as root doesn't make sense even on embedded systems, or if it does,
+running PulseAudio in the system mode should be a good solution for
+that use case. If someone can prove otherwise, the patch would
+probably be accepted.]
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ man/pulse-client.conf.5.xml.in | 9 +++++++++
+ src/pulse/client-conf.c | 1 +
+ src/pulse/client-conf.h | 1 +
+ src/pulse/client.conf.in | 1 +
+ src/pulse/context.c | 2 +-
+ 5 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in
+index b88898c..e737c96 100644
+--- a/man/pulse-client.conf.5.xml.in
++++ b/man/pulse-client.conf.5.xml.in
+@@ -82,6 +82,15 @@ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+ </option>
+
+ <option>
++ <p><opt>allow-autospawn-for-root=</opt> Allow autospawning also for root.
++ Takes a boolean value, defaults to <opt>no</opt>. If the <opt>autospawn
++ </opt> option is disabled, this option has no effect. Autospawning for
++ root is disabled by default, because running PulseAudio as root will
++ interfere with regular users' PulseAudio instances. This option should be
++ enabled only in environments where there are no regular users at all.</p>
++ </option>
++
++ <option>
+ <p><opt>daemon-binary=</opt> Path to the PulseAudio daemon to
+ run when autospawning. Defaults to a path configured at compile
+ time.</p>
+diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
+index a3c9486..9f68ee5 100644
+--- a/src/pulse/client-conf.c
++++ b/src/pulse/client-conf.c
+@@ -138,6 +138,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
+ { "default-server", pa_config_parse_string, &c->default_server, NULL },
+ { "default-dbus-server", pa_config_parse_string, &c->default_dbus_server, NULL },
+ { "autospawn", pa_config_parse_bool, &c->autospawn, NULL },
++ { "allow-autospawn-for-root", pa_config_parse_bool, &c->allow_autospawn_for_root, NULL },
+ { "cookie-file", pa_config_parse_string, &c->cookie_file_from_client_conf, NULL },
+ { "disable-shm", pa_config_parse_bool, &c->disable_shm, NULL },
+ { "enable-shm", pa_config_parse_not_bool, &c->disable_shm, NULL },
+diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
+index 7691ec7..19db7ed 100644
+--- a/src/pulse/client-conf.h
++++ b/src/pulse/client-conf.h
+@@ -38,6 +38,7 @@ typedef struct pa_client_conf {
+ char *cookie_file_from_application;
+ char *cookie_file_from_client_conf;
+ bool autospawn, disable_shm, disable_memfd, auto_connect_localhost, auto_connect_display;
++ bool allow_autospawn_for_root;
+ size_t shm_size;
+ } pa_client_conf;
+
+diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in
+index 26b7790..69830ef 100644
+--- a/src/pulse/client.conf.in
++++ b/src/pulse/client.conf.in
+@@ -23,6 +23,7 @@
+ ; default-dbus-server =
+
+ ; autospawn = yes
++; allow-autospawn-for-root = no
+ ; daemon-binary = @PA_BINARY@
+ ; extra-arguments = --log-target=syslog
+
+diff --git a/src/pulse/context.c b/src/pulse/context.c
+index 69be5f4..d6e13e8 100644
+--- a/src/pulse/context.c
++++ b/src/pulse/context.c
+@@ -1027,7 +1027,7 @@ int pa_context_connect(
+ if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
+
+ #ifdef HAVE_GETUID
+- if (getuid() == 0)
++ if (!c->conf->allow_autospawn_for_root && getuid() == 0)
+ pa_log_debug("Not doing autospawn since we are root.");
+ else {
+ c->do_autospawn = true;
+--
+2.8.1
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch
new file mode 100644
index 000000000..0391f3785
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch
@@ -0,0 +1,66 @@
+From 0cb66c0c5aafd48b63a755860746e70afb332c8d Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Wed, 24 Jan 2018 03:51:49 +0200
+Subject: [PATCH] memfd-wrappers: only define memfd_create() if not already
+ defined
+
+glibc 2.27 is to be released soon, and it will provide memfd_create().
+If glibc provides the function, we must not define it ourselves,
+otherwise building fails due to conflict between the two implementations
+of the same function.
+
+BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104733
+---
+Upstream-Status: Submitted [https://bugs.freedesktop.org/attachment.cgi?id=136927]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ configure.ac | 3 +++
+ src/pulsecore/memfd-wrappers.h | 7 ++++---
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 77b5ff5..3a71fd8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -607,6 +607,9 @@ AS_IF([test "x$enable_memfd" = "xyes" && test "x$HAVE_MEMFD" = "x0"],
+ [AC_MSG_ERROR([*** Your Linux kernel does not support memfd shared memory.
+ *** Use linux v3.17 or higher for such a feature.])])
+
++AS_IF([test "x$HAVE_MEMFD" = "x1"],
++ AC_CHECK_FUNCS([memfd_create]))
++
+ AC_SUBST(HAVE_MEMFD)
+ AM_CONDITIONAL([HAVE_MEMFD], [test "x$HAVE_MEMFD" = x1])
+ AS_IF([test "x$HAVE_MEMFD" = "x1"], AC_DEFINE([HAVE_MEMFD], 1, [Have memfd shared memory.]))
+diff --git a/src/pulsecore/memfd-wrappers.h b/src/pulsecore/memfd-wrappers.h
+index 3bed9b2..c7aadfd 100644
+--- a/src/pulsecore/memfd-wrappers.h
++++ b/src/pulsecore/memfd-wrappers.h
+@@ -20,13 +20,14 @@
+ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#ifdef HAVE_MEMFD
++#if defined(HAVE_MEMFD) && !defined(HAVE_MEMFD_CREATE)
+
+ #include <sys/syscall.h>
+ #include <fcntl.h>
+
+ /*
+- * No glibc wrappers exist for memfd_create(2), so provide our own.
++ * Before glibc version 2.27 there was no wrapper for memfd_create(2),
++ * so we have to provide our own.
+ *
+ * Also define memfd fcntl sealing macros. While they are already
+ * defined in the kernel header file <linux/fcntl.h>, that file as
+@@ -63,6 +64,6 @@ static inline int memfd_create(const char *name, unsigned int flags) {
+ #define F_SEAL_WRITE 0x0008 /* prevent writes */
+ #endif
+
+-#endif /* HAVE_MEMFD */
++#endif /* HAVE_MEMFD && !HAVE_MEMFD_CREATE */
+
+ #endif
+--
+2.16.1
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
new file mode 100644
index 000000000..85559950e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
@@ -0,0 +1,70 @@
+From f6ab3c3aa7a1841c8add04828029356d2a8c88e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 21:56:31 -0700
+Subject: [PATCH] padsp: Make it compile on musl
+
+break assumptions on glibc and there is no stat64 on non
+glibc C libraries
+
+See pulseaudio bug
+
+https://bugs.freedesktop.org/show_bug.cgi?id=85319
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/utils/padsp.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/utils/padsp.c b/src/utils/padsp.c
+index e61373c..684721a 100644
+--- a/src/utils/padsp.c
++++ b/src/utils/padsp.c
+@@ -2368,7 +2368,7 @@ fail:
+ return ret;
+ }
+
+-#ifdef sun
++#ifndef __GLIBC__
+ int ioctl(int fd, int request, ...) {
+ #else
+ int ioctl(int fd, unsigned long request, ...) {
+@@ -2508,10 +2508,13 @@ int stat(const char *pathname, struct stat *buf) {
+
+ return 0;
+ }
+-
+ #ifdef HAVE_OPEN64
+-
++#undef stat64
++#ifdef __GLIBC__
+ int stat64(const char *pathname, struct stat64 *buf) {
++#else
++int stat64(const char *pathname, struct stat *buf) {
++#endif
+ struct stat oldbuf;
+ int ret;
+
+@@ -2544,7 +2547,7 @@ int stat64(const char *pathname, struct stat64 *buf) {
+
+ return 0;
+ }
+-
++#undef open64
+ int open64(const char *filename, int flags, ...) {
+ va_list args;
+ mode_t mode = 0;
+@@ -2670,8 +2673,8 @@ FILE* fopen(const char *filename, const char *mode) {
+ }
+
+ #ifdef HAVE_OPEN64
+-
+-FILE *fopen64(const char *filename, const char *mode) {
++#undef fopen64
++FILE *fopen64(const char *__restrict filename, const char *__restrict mode) {
+
+ debug(DEBUG_LEVEL_VERBOSE, __FILE__": fopen64(%s)\n", filename?filename:"NULL");
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
new file mode 100644
index 000000000..5b1998032
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d pulse pulse 0755 /var/run/pulse none
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb
new file mode 100644
index 000000000..245302d2b
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb
@@ -0,0 +1,15 @@
+require pulseaudio.inc
+
+SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
+ file://0001-padsp-Make-it-compile-on-musl.patch \
+ file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+ file://volatiles.04_pulse \
+ file://0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch \
+ "
+SRC_URI[md5sum] = "390de38231d5cdd6b43ada8939eb74f1"
+SRC_URI[sha256sum] = "f2521c525a77166189e3cb9169f75c2ee2b82fa3fcf9476024fbc2c3a6c9cd9e"
+
+do_compile_prepend() {
+ mkdir -p ${S}/libltdl
+ cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
+}
diff --git a/poky/meta/recipes-multimedia/sbc/sbc_1.3.bb b/poky/meta/recipes-multimedia/sbc/sbc_1.3.bb
new file mode 100644
index 000000000..2bb895de9
--- /dev/null
+++ b/poky/meta/recipes-multimedia/sbc/sbc_1.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "SBC Audio Codec"
+DESCRIPTION = "Bluetooth low-complexity, subband codec (SBC) library."
+HOMEPAGE = "https://www.bluez.org"
+SECTION = "libs"
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-examples = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
+ file://src/sbcenc.c;beginline=1;endline=24;md5=08e7a70b127f4100ff2cd7d629147d8d \
+ file://sbc/sbc.h;beginline=1;endline=26;md5=0f57d0df22b0d40746bdd29805a4361b"
+
+DEPENDS = "libsndfile1"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "2d8b7841f2c11ab287718d562f2b981c"
+SRC_URI[sha256sum] = "e61022cf576f14190241e7071753fdacdce5d1dea89ffd704110fc50be689309"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-examples"
+FILES_${PN}-examples += "${bindir}/*"
diff --git a/poky/meta/recipes-multimedia/speex/speex_1.2.0.bb b/poky/meta/recipes-multimedia/speex/speex_1.2.0.bb
new file mode 100644
index 000000000..19636bb20
--- /dev/null
+++ b/poky/meta/recipes-multimedia/speex/speex_1.2.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Speech Audio Codec"
+DESCRIPTION = "Speex is an Open Source/Free Software patent-free audio compression format designed for speech."
+HOMEPAGE = "http://www.speex.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=314649d8ba9dd7045dfb6683f298d0a8 \
+ file://include/speex/speex.h;beginline=1;endline=34;md5=ef8c8ea4f7198d71cf3509c6ed05ea50"
+DEPENDS = "libogg speexdsp"
+
+SRC_URI = "http://downloads.xiph.org/releases/speex/speex-${PV}.tar.gz"
+UPSTREAM_CHECK_REGEX = "speex-(?P<pver>\d+(\.\d+)+)\.tar"
+
+SRC_URI[md5sum] = "8ab7bb2589110dfaf0ed7fa7757dc49c"
+SRC_URI[sha256sum] = "eaae8af0ac742dc7d542c9439ac72f1f385ce838392dc849cae4536af9210094"
+
+inherit autotools pkgconfig lib_package
+
+EXTRA_OECONF = "\
+ ${@bb.utils.contains('TARGET_FPU', 'soft', '--enable-fixed-point --disable-float-api --disable-vbr', '', d)} \
+"
diff --git a/poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch b/poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch
new file mode 100644
index 000000000..c7067daaa
--- /dev/null
+++ b/poky/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch
@@ -0,0 +1,63 @@
+From c73370ceafd138becee8ca3c688ba75756830bfe Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Sun, 5 Jul 2015 17:48:16 +0300
+Subject: [PATCH] Don't rely on HAVE_STDINT_H et al. being defined
+
+Not everyone who includes speexdsp_config_types.h will have a test
+which defines those, and if we've chosen to use the stdint types at
+configure time then we know exactly which header(s) are available, so
+just choose the best one then and generate the header to use it.
+
+This patch, including the above text, is copied from a commit in the
+speex repository[1]. The original commit for speex was made by Ron
+<ron@debian.org>.
+
+[1] https://git.xiph.org/?p=speex.git;a=commitdiff;h=774c87d6cb7dd8dabdd17677fc6da753ecf4aa87
+
+Upstream-Status: Backport
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ configure.ac | 6 ++++++
+ include/speex/speexdsp_config_types.h.in | 8 +-------
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2cd2d1e..1de0c23 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -334,6 +334,12 @@ AC_SUBST([USIZE16])
+ AC_SUBST([SIZE32])
+ AC_SUBST([USIZE32])
+
++AS_IF([test "$ac_cv_header_stdint_h" = "yes"], [INCLUDE_STDINT="#include <stdint.h>"],
++ [test "$ac_cv_header_inttypes_h" = "yes"], [INCLUDE_STDINT="#include <inttypes.h>"],
++ [test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include <sys/types.h>"])
++
++AC_SUBST([INCLUDE_STDINT])
++
+ AC_CONFIG_FILES([
+ Makefile libspeexdsp/Makefile doc/Makefile SpeexDSP.spec
+ include/Makefile include/speex/Makefile speexdsp.pc
+diff --git a/include/speex/speexdsp_config_types.h.in b/include/speex/speexdsp_config_types.h.in
+index 02b82fd..5ea7b55 100644
+--- a/include/speex/speexdsp_config_types.h.in
++++ b/include/speex/speexdsp_config_types.h.in
+@@ -1,13 +1,7 @@
+ #ifndef __SPEEX_TYPES_H__
+ #define __SPEEX_TYPES_H__
+
+-#if defined HAVE_STDINT_H
+-# include <stdint.h>
+-#elif defined HAVE_INTTYPES_H
+-# include <inttypes.h>
+-#elif defined HAVE_SYS_TYPES_H
+-# include <sys/types.h>
+-#endif
++@INCLUDE_STDINT@
+
+ typedef @SIZE16@ spx_int16_t;
+ typedef @USIZE16@ spx_uint16_t;
+--
+1.9.3
+
diff --git a/poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb b/poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb
new file mode 100644
index 000000000..6b1acedbe
--- /dev/null
+++ b/poky/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb
@@ -0,0 +1,39 @@
+SUMMARY = "A patent-free DSP library"
+DESCRIPTION = "SpeexDSP is a patent-free, Open Source/Free Software DSP library."
+HOMEPAGE = "http://www.speex.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=314649d8ba9dd7045dfb6683f298d0a8"
+
+SRC_URI = "http://downloads.xiph.org/releases/speex/speexdsp-${PV}.tar.gz \
+ file://0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch"
+
+SRC_URI[md5sum] = "70d9d31184f7eb761192fd1ef0b73333"
+SRC_URI[sha256sum] = "4ae688600039f5d224bdf2e222d2fbde65608447e4c2f681585e4dca6df692f1"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "\
+ --disable-examples \
+ ${@bb.utils.contains('TARGET_FPU', 'soft', '--enable-fixed-point --disable-float-api', '', d)} \
+"
+
+# Workaround for a build failure when building with MACHINE=qemuarm64. I think
+# aarch64 is supposed to support NEON just fine, but building for qemuarm64
+# fails in NEON code:
+#
+# .../speexdsp-1.2rc3/libspeexdsp/resample_neon.h:148:5: error: impossible constraint in 'asm'
+# asm volatile (" cmp %[len], #0\n"
+# ^
+#
+# I sent an email about the issue to speex-dev. At the time of writing there
+# are no responses yet:
+# http://thread.gmane.org/gmane.comp.audio.compression.speex.devel/7360
+EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--disable-neon', '', d)}"
+
+# speexdsp was split off from speex in 1.2rc2. Older versions of speex can't
+# be installed together with speexdsp, since they contain overlapping files.
+RCONFLICTS_${PN} = "speex (< 1.2rc2)"
+RCONFLICTS_${PN}-dbg = "speex-dbg (< 1.2rc2)"
+RCONFLICTS_${PN}-dev = "speex-dev (< 1.2rc2)"
+RCONFLICTS_${PN}-staticdev = "speex-staticdev (< 1.2rc2)"
diff --git a/poky/meta/recipes-multimedia/webp/libwebp_0.6.1.bb b/poky/meta/recipes-multimedia/webp/libwebp_0.6.1.bb
new file mode 100644
index 000000000..e9d4d7830
--- /dev/null
+++ b/poky/meta/recipes-multimedia/webp/libwebp_0.6.1.bb
@@ -0,0 +1,54 @@
+SUMMARY = "WebP is an image format designed for the Web"
+DESCRIPTION = "WebP is a method of lossy and lossless compression that can be \
+ used on a large variety of photographic, translucent and \
+ graphical images found on the web. The degree of lossy \
+ compression is adjustable so a user can choose the trade-off \
+ between file size and image quality. WebP typically achieves \
+ an average of 30% more compression than JPEG and JPEG 2000, \
+ without loss of image quality."
+HOMEPAGE = "https://developers.google.com/speed/webp/"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e8dee932c26f2dab503abf70c96d8bb \
+ file://PATENTS;md5=c6926d0cb07d296f886ab6e0cc5a85b7"
+
+SRC_URI = "http://downloads.webmproject.org/releases/webp/${BP}.tar.gz"
+SRC_URI[md5sum] = "b49ce9c3e3e9acae4d91bca44bb85a72"
+SRC_URI[sha256sum] = "06503c782d9f151baa325591c3579c68ed700ffc62d4f5a32feead0ff017d8ab"
+
+UPSTREAM_CHECK_URI = "http://downloads.webmproject.org/releases/webp/index.html"
+
+EXTRA_OECONF = " \
+ --disable-experimental \
+ --disable-wic \
+ --enable-libwebpmux \
+ --enable-libwebpdemux \
+ --enable-threading \
+"
+# Do not trust configure to determine if neon is available.
+#
+EXTRA_OECONF_append_arm = " \
+ ${@bb.utils.contains("TUNE_FEATURES","neon","--enable-neon","--disable-neon",d)} \
+"
+
+inherit autotools lib_package
+
+PACKAGECONFIG ??= ""
+
+# libwebpdecoder is a subset of libwebp, don't build it unless requested
+PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder"
+
+# Apply for examples programs: cwebp and dwebp
+PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
+PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
+
+# Apply only for example program vwebp
+PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut"
+
+PACKAGES =+ "${PN}-gif2webp"
+
+DESCRIPTION_${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP"
+FILES_${PN}-gif2webp = "${bindir}/gif2webp"
diff --git a/poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch b/poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch
new file mode 100644
index 000000000..087a448ee
--- /dev/null
+++ b/poky/meta/recipes-multimedia/x264/x264/Fix-X32-build-by-disabling-asm.patch
@@ -0,0 +1,53 @@
+From 66b120079fb21ed38cab0900c63360b0a7853eaa Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 14:22:32 -0700
+Subject: [PATCH] Fix X32 build by disabling asm
+
+This applies gentoo's x32 patch, adjusted slightly, which disables asm support
+for x32 as well as correcting -m.
+
+Debian has a different patch which does the same, and there's a superior yet
+out of date patch series on the x264 list which keeps asm support enabled, but
+doesn't successfully build at this time, and my assembly is very rusty.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ configure | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 3109ec4..844aeae 100755
+--- a/configure
++++ b/configure
+@@ -703,7 +703,13 @@ case $host_cpu in
+ AS_EXT=".asm"
+ ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
+ stack_alignment=16
+- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++ if [ $compiler = GNU ]; then
++ if cpp_check "" "" "__ILP32__" ; then
++ CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
++ else
++ CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++ fi
++ fi
+ if [ "$SYS" = MACOSX ]; then
+ ASFLAGS="$ASFLAGS -f macho64 -DPIC -DPREFIX"
+ if cc_check '' "-arch x86_64"; then
+@@ -722,7 +728,11 @@ case $host_cpu in
+ RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+ fi
+ else
+- ASFLAGS="$ASFLAGS -f elf64"
++ if cpp_check "" "" "__ILP32__" ; then
++ asm=no
++ else
++ ASFLAGS="$ASFLAGS -f elf64"
++ fi
+ fi
+ ;;
+ powerpc*)
+--
+2.8.0
+
diff --git a/poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch b/poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
new file mode 100644
index 000000000..065e3b35b
--- /dev/null
+++ b/poky/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
@@ -0,0 +1,33 @@
+From a72bf499a0674fc75eedf15008b424e28f67e4bd Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei@gherzan.ro>
+Date: Fri, 2 Feb 2018 15:10:08 +0200
+Subject: [PATCH] dont default to cortex-a9 with neon
+
+-march flag is not in CFLAGS so this will always default to
+ -mcpu=cortex-a8 -mfpu=neon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/configure b/configure
+index 0e3ef23..955b993 100755
+--- a/configure
++++ b/configure
+@@ -911,9 +911,6 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+ fi
+
+ if [ $asm = auto -a $ARCH = ARM ] ; then
+- # set flags so neon is built by default
+- [ $compiler == CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
+-
+ cc_check '' '' '__asm__("add r0, r1, r2");' && define HAVE_ARM_INLINE_ASM
+ if [ $compiler = CL ] && cpp_check '' '' 'defined(_M_ARM) && _M_ARM >= 7' ; then
+ define HAVE_ARMV6
+--
+2.4.0
+
diff --git a/poky/meta/recipes-multimedia/x264/x264_git.bb b/poky/meta/recipes-multimedia/x264/x264_git.bb
new file mode 100644
index 000000000..c445d15e6
--- /dev/null
+++ b/poky/meta/recipes-multimedia/x264/x264_git.bb
@@ -0,0 +1,55 @@
+SUMMARY = "H.264/MPEG-4 AVC video encoder"
+DESCRIPTION = "A free software library and application for encoding video streams into the H.264/MPEG-4 AVC format."
+HOMEPAGE = "http://www.videolan.org/developers/x264.html"
+
+LICENSE = "GPLv2"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "nasm-native"
+
+SRC_URI = "git://github.com/mirror/x264;branch=stable \
+ file://don-t-default-to-cortex-a9-with-neon.patch \
+ file://Fix-X32-build-by-disabling-asm.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+
+SRCREV = "e9a5903edf8ca59ef20e6f4894c196f135af735e"
+
+PV = "r2854+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit lib_package pkgconfig perlnative
+
+X264_DISABLE_ASM = ""
+X264_DISABLE_ASM_armv4 = "--disable-asm"
+X264_DISABLE_ASM_armv5 = "--disable-asm"
+X264_DISABLE_ASM_powerpc = "${@bb.utils.contains("TUNE_FEATURES", "spe", "--disable-asm", "", d)}"
+X264_DISABLE_ASM_mipsarch = "${@bb.utils.contains("TUNE_FEATURES", "r6", "", "--disable-asm", d)}"
+
+EXTRA_OECONF = '--prefix=${prefix} \
+ --host=${HOST_SYS} \
+ --libdir=${libdir} \
+ --cross-prefix=${TARGET_PREFIX} \
+ --sysroot=${STAGING_DIR_TARGET} \
+ --enable-shared \
+ --enable-static \
+ --disable-lavf \
+ --disable-swscale \
+ --disable-opencl \
+ --enable-pic \
+ ${X264_DISABLE_ASM} \
+ '
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ ./configure ${EXTRA_OECONF}
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+AS[unexport] = "1"
diff --git a/poky/meta/recipes-rt/README b/poky/meta/recipes-rt/README
new file mode 100644
index 000000000..7d7558de4
--- /dev/null
+++ b/poky/meta/recipes-rt/README
@@ -0,0 +1,13 @@
+The recipes-rt recipes provide package and image recipes for using and testing
+the PREEMPT_RT kernel. The core-image-rt*.bb images are minimal images with
+a couple extra packages, including rt-tests. In order to build the image with
+the linux-yocto-rt kernel, be sure to include the following line in your
+local.conf, bblayers.conf, or your $MACHINE.conf.
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
+
+If you are creating a new BSP which should use linux-yocto-rt by default,
+use the line above in the $MACHINE.conf in your BSP layer, and specify the
+following in a linux-yocto-rt bbappend recipe:
+
+COMPATIBLE_MACHINE_$MACHINE = $MACHINE
diff --git a/poky/meta/recipes-rt/images/core-image-rt-sdk.bb b/poky/meta/recipes-rt/images/core-image-rt-sdk.bb
new file mode 100644
index 000000000..0f7f09168
--- /dev/null
+++ b/poky/meta/recipes-rt/images/core-image-rt-sdk.bb
@@ -0,0 +1,20 @@
+require recipes-core/images/core-image-minimal.bb
+
+# Skip processing of this recipe if linux-yocto-rt is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers.
+python () {
+ if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+DESCRIPTION = "Small image capable of booting a device with a test suite and \
+tools for real-time use. It includes the full meta-toolchain, development \
+headers and libraries to form a standalone SDK."
+DEPENDS = "linux-yocto-rt"
+
+IMAGE_FEATURES += "dev-pkgs tools-sdk tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
+
+IMAGE_INSTALL += "rt-tests hwlatdetect kernel-dev"
+
+LICENSE = "MIT"
diff --git a/poky/meta/recipes-rt/images/core-image-rt.bb b/poky/meta/recipes-rt/images/core-image-rt.bb
new file mode 100644
index 000000000..9cb93b3de
--- /dev/null
+++ b/poky/meta/recipes-rt/images/core-image-rt.bb
@@ -0,0 +1,17 @@
+require recipes-core/images/core-image-minimal.bb
+
+# Skip processing of this recipe if linux-yocto-rt is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
+# to build multiple virtual/kernel providers.
+python () {
+ if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-yocto-rt":
+ raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
+}
+
+DESCRIPTION = "A small image just capable of allowing a device to boot plus a \
+real-time test suite and tools appropriate for real-time use."
+DEPENDS = "linux-yocto-rt"
+
+IMAGE_INSTALL += "rt-tests hwlatdetect"
+
+LICENSE = "MIT"
diff --git a/poky/meta/recipes-rt/rt-tests/files/rt_bmark.py b/poky/meta/recipes-rt/rt-tests/files/rt_bmark.py
new file mode 100755
index 000000000..080a65589
--- /dev/null
+++ b/poky/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -0,0 +1,412 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (C) 2015 Enea Software AB
+# Author: Thomas Lundström <thomas.lundstrom@enea.com>
+
+# The script measures interrupt latency together with different types of
+# system load. This is done using the programs cyclictest and stress.
+#
+# The main output is:
+#
+# Best case (min) latency
+# This has very limited value, but is presented since it can be done
+# easily
+#
+# Average latency
+# This value is of interrest for throughput oriented systems. Limited
+# value for a real-time system. Also presented because it is easy to do.
+#
+# Worst case (max) latency
+# This is the interesting number for a real-time system. The number
+# presented is (of cource) the largest number observed. The challenge
+# is to know how the observed worst case relates to the actual worst case.
+#
+# To get an indication of the confidence, the following method is used:
+# 1) Instead of one long run, the measurement is made as a set of shorter
+# runs. The number of runs must be a power of 2 for reasons that will
+# shorlty be obvious
+#
+# 2) First, a list of the max values are created.
+#
+# 3) The smallest value in that list is recorded.
+#
+# 4) Then a new list is create by taking the max value of each pair of
+# values in the original list. In this list the smallest value is
+# recorded.
+#
+# 5) Step 3 is repeated until there is only one value in the list. See
+# example below:
+#
+# Samples:
+# | 44 | | | | |
+# | 77 | 77 | | | |
+# | 118 | | | | |
+# | 119 | 119 | 119 | | |
+# | 138 | | | | |
+# | 57 | 138 | | | |
+# | 175 | | | | |
+# | 130 | 175 | 175 | 175 | |
+# | 54 | | | | |
+# | 150 | 150 | | | |
+# | 47 | | | | |
+# | 59 | 59 | 150 | | |
+# | 199 | | | | |
+# | 115 | 199 | | | |
+# | 177 | | | | |
+# | 129 | 177 | 199 | 199 | 199 |
+#
+# Smallest value:
+# | 44 | 59 | 119 | 175 | 199 |
+#
+# 6) The generated list of smallest values is analyzed. In this case, it
+# can be observed that the values are increasing significantly through
+# the entire list, which leads to the conclusion that the number of
+# samples is too small.
+# If instead the list had been (167, 191, 196, 199, 199), there had
+# been a very small, or no, increase at the end of the list. We might
+# then suspect that the number of samples is probably large enough.
+# There is however no guarantee for that.
+#
+# Steps 1-2 are done in run_cyclictest_suite
+# Steps 3-5 are done in gen_minmax_list.
+# Step 6 needs to be done manually since there is (yet) no well defined
+# FAIL criterion and a theoretically solid PASS criterion may never be
+# available.
+
+import multiprocessing
+import os
+import re
+import signal
+import subprocess
+import time
+import traceback
+
+# See comment on the function set_hung_tmo
+has_hung_task_detection = True
+
+#-------------------------------------------------------------------------------
+
+class TestFail(Exception):
+ def __init__(self, msg):
+ self.msg = msg
+
+ def __str__(self):
+ return "Test failure: (" + self.msg + ")"
+
+#-------------------------------------------------------------------------------
+
+def tc_name(sub_name):
+ return "rt_bmark.intlat." + sub_name
+
+#-------------------------------------------------------------------------------
+# log() does the same job as print except that a '#' is added at the beginning
+# of each line. This causes TEFEL to ignore it
+
+def log(*msg):
+ tmp = "".join(map(str, msg)) # 'map(str, ...' allows numbers
+ for line in tmp.splitlines():
+ print("#", line)
+
+#-------------------------------------------------------------------------------
+# Like log(), but with a timestamp added
+
+def log_ts(*msg):
+ ts = time.localtime()
+ stamp = "%2d:%02d:%02d: " % (ts.tm_hour, ts.tm_min, ts.tm_sec)
+ log(stamp, *msg)
+
+#-------------------------------------------------------------------------------
+
+def log_test_header(seq_no, nr_of_tests, name):
+ log("=" * 78)
+ log()
+ log(" Test case (%d/%d): %s" % (seq_no, nr_of_tests, tc_name(name)))
+ log()
+ log("." * 78)
+ log()
+
+#-------------------------------------------------------------------------------
+
+def start_stress(*args):
+ stress_cmd = [ "stress" ]
+ added_stress_types = []
+ req_stress_types = set(args)
+ cpu_cnt = str(multiprocessing.cpu_count())
+
+ # The function cond_add_stress appends the options to the stress
+ # command if the stress type is in the set of requested stress types
+
+ def cond_add_stress(stress_type, options):
+ if stress_type in req_stress_types:
+ req_stress_types.remove(stress_type)
+ added_stress_types.append(stress_type)
+ stress_cmd.extend(options)
+
+ #----------
+
+ cond_add_stress("io", ["-i", cpu_cnt])
+ cond_add_stress("cpu", ["-c", cpu_cnt])
+ cond_add_stress("hdd", ["-d", cpu_cnt, "--hdd-bytes", "20M"])
+ cond_add_stress("vm", ["-m", cpu_cnt, "--vm-bytes", "10M"])
+
+ unknown = ", ".join(req_stress_types)
+ if unknown != "":
+ raise TestFail("Unknown stress type(s): %s" % unknown)
+
+ if not added_stress_types:
+ log("No stress requested")
+ return None
+
+ added = "+".join(added_stress_types)
+ stress_cmd_str = " ".join(stress_cmd)
+
+ log("Starting stress(", added, ")")
+ log(" Command: '", stress_cmd_str, "'")
+ log()
+
+ # preexec_fn=os.setsid causes stress to be executed in a separate
+ # session, => it gets a new process group (incl. children). It
+ # can then be terminated using os.killpg in end_stress without
+ # terminating this script.
+
+ p = subprocess.Popen(stress_cmd, preexec_fn=os.setsid)
+
+ return p
+
+#-------------------------------------------------------------------------------
+
+def end_stress(p):
+ if p is None:
+ # The value None indicates that no stress scenario was started
+ return
+
+ if p.poll() is not None:
+ raise TestFail("stress prematurely terminated.")
+
+ os.killpg(os.getpgid(p.pid), signal.SIGTERM)
+ log("Terminated stress")
+
+#-------------------------------------------------------------------------------
+
+def us2hms_str(us):
+ s = (us+500000) // 1000000 # Round microseconds to s
+ m = s//60
+ s -= 60*m;
+ h = m//60
+ m -= 60*h
+
+ return "%d:%02d:%02d" % (h, m, s)
+
+#-------------------------------------------------------------------------------
+# Sometime the hung task supervision is triggered during execution of
+# cyclictest (cyclictest starves stress). To avoid that, the supervision
+# is temporarily disabled
+
+def set_hung_tmo(new_tmo):
+ global has_hung_task_detection
+
+ tmo_file = "/proc/sys/kernel/hung_task_timeout_secs"
+
+ if not has_hung_task_detection:
+ return
+
+ if not os.access(tmo_file, os.W_OK):
+ log("Hung task detection not supported")
+ log(" (File ", tmo_file, " not found)")
+ has_hung_task_detection = False
+ return
+
+ orig_tmo = int(subprocess.check_output(["cat", tmo_file]).strip())
+ if new_tmo != orig_tmo:
+ cmd = ( "echo " + str(new_tmo) + " > " + tmo_file )
+ subprocess.check_output(cmd, shell=True)
+ log("Changed timeout for detection of hung tasks: ",
+ orig_tmo, " -> ", new_tmo)
+
+ return orig_tmo
+
+#-------------------------------------------------------------------------------
+
+def gen_minmax_list(max_list):
+ res = [min(max_list)]
+
+ while True:
+ tmp = max_list
+ max_list = []
+ while tmp:
+ max_list.append(max(tmp.pop(0), tmp.pop(0)))
+
+ res.append(min(max_list))
+
+ if len(max_list) < 2:
+ return res
+
+#-------------------------------------------------------------------------------
+# Parameters for cyclictest:
+#
+# On the -S option (from cyclictest.c):
+# -S implies options -a -t -n and same priority of all threads
+# -a: One thread per core
+# -n: use clock_nanosleep instead of posix interval timers
+# -t: (without argument) Set number of threads to the number
+# of cpus
+
+interval_core_0 = 100 # Timer interval on core 0 [us]
+interval_delta = 20 # Interval increment for each core [us]
+loop_count = 30000 # Number of loops (on core 0).
+
+cmd = ("cyclictest",
+ "-S", # Standard SMP testing. See below
+ "-p", "99", # RT priority 99
+ "-q", # Quiet mode, i.e. print only a summary
+ "-i", str(interval_core_0),
+ "-d", str(interval_delta),
+ "-l", str(loop_count)
+ )
+rex = re.compile(b"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)")
+
+def run_cyclictest_once():
+ res = subprocess.check_output(cmd)
+
+ # minlist and maxlist are lists with the extremes for each core
+ # avg_cnt is the sum of cycles for all cores
+ # avg_sum is the sum of (cycle count*average) for each core
+ # Since cyclictest runs different number of cycles on
+ # different cores, avg_sum/avg_cnt gives a more accurate
+ # value of the overall average than just taking the average
+ # of each core's averages
+
+ minlist = []
+ maxlist = []
+ avg_sum = 0
+ avg_cnt = 0
+
+ for line in res.splitlines():
+ m = rex.search(line)
+ if m is not None:
+ minlist.append(int(m.group(2)))
+ maxlist.append(int(m.group(4)))
+ n = int(m.group(1))
+ avg_sum += n * int(m.group(3))
+ avg_cnt += n
+
+ return min(minlist), [avg_sum, avg_cnt], max(maxlist)
+
+#-------------------------------------------------------------------------------
+# A precondition for the tracking of min-max values is that
+# the suite size os a power of 2.
+
+N = 5
+suite_size = 2**N
+
+est_exec_time_once = interval_core_0 * loop_count
+est_exec_time_suite = suite_size * est_exec_time_once
+
+def run_cyclictest_suite():
+ log("Starting cyclictest")
+ log(" Command : ", " ".join(cmd))
+ log(" Number of cycles : ", loop_count*suite_size,
+ " (", suite_size, " sets of ", loop_count, " cycles)")
+ log(" Exec. time (est) : ", us2hms_str(est_exec_time_suite))
+ log()
+
+ orig_tmo = set_hung_tmo(0) # 0 => Disable
+
+ # float('inf') emulates infinity. At least in the sense that it is
+ # guaranteed to be larger than any actual number.
+ ack_min = float('inf')
+ ack_avg = [0, 0]
+
+ log()
+ log_ts("Start of execution")
+ t = time.time()
+ max_list = []
+
+ for i in range(0, suite_size):
+ tmp_min, tmp_avg, tmp_max = run_cyclictest_once()
+
+ msg = "%2d/%2d:" % (i+1, suite_size)
+ msg += " min: %4d" % tmp_min
+ msg += " avg: %5.1f" % (float(tmp_avg[0])/tmp_avg[1])
+ msg += " max: %4d" % tmp_max
+ log_ts(msg)
+
+ # Track minimum value
+ if tmp_min < ack_min:
+ ack_min = tmp_min
+
+ # Track smallest max value
+ max_list.append(tmp_max)
+
+ ack_avg[0] += tmp_avg[0]
+ ack_avg[1] += tmp_avg[1]
+
+ t = time.time()-t
+ log_ts("Cyclictest completed. Actual execution time:",
+ us2hms_str(t*1000000))
+ log()
+ set_hung_tmo(orig_tmo)
+
+ return ack_min, float(ack_avg[0])/ack_avg[1], gen_minmax_list(max_list)
+
+#-------------------------------------------------------------------------------
+
+class cyclictest_runner:
+ def run_test(self, seq_no, nr_of_tests, name, stressparams):
+
+ try:
+ log_test_header(seq_no, nr_of_tests, name)
+
+ p = start_stress(*stressparams)
+
+ bm_min, bm_avg, bm_max_list = run_cyclictest_suite()
+
+ end_stress(p)
+
+ bm_max = bm_max_list[-1]
+
+ log()
+ log("Min: %d us" % bm_min)
+ log("Avg: %.1f us" % bm_avg)
+ log("Max: %d us" % bm_max)
+ log()
+ log("Max list: ", bm_max_list)
+ log()
+ log("PASS")
+
+ print()
+ print(tc_name(name), "[Min/us,Avg/us,Max/us]:",)
+ print("%d,%.1f,%d" % (bm_min,bm_avg, bm_max))
+ print("PASS:", tc_name(name))
+ print()
+
+ except Exception:
+ log()
+ log("Exception!")
+ log()
+ log("Traceback:", traceback.format_exc())
+ log()
+ log("WD: ", os.getcwd())
+ log()
+ log("FAIL")
+ print()
+ print("FAIL:", tc_name(name))
+ print()
+
+#-------------------------------------------------------------------------------
+
+runner = cyclictest_runner()
+
+tests = (("no_stress", []),
+ ("cpu", ["cpu"]),
+ ("hdd", ["hdd"]),
+ ("io", ["io"]),
+ ("vm", ["vm"]),
+ ("full", ["io", "cpu", "hdd", "vm"]),
+ )
+
+nr_of_tests = len(tests)
+for seq_no, params in enumerate(tests, start=1):
+ runner.run_test(seq_no, nr_of_tests, *params)
diff --git a/poky/meta/recipes-rt/rt-tests/files/run-ptest b/poky/meta/recipes-rt/rt-tests/files/run-ptest
new file mode 100644
index 000000000..b7c5e29f2
--- /dev/null
+++ b/poky/meta/recipes-rt/rt-tests/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+python3 ./rt_bmark.py
diff --git a/poky/meta/recipes-rt/rt-tests/hwlatdetect_1.1.bb b/poky/meta/recipes-rt/rt-tests/hwlatdetect_1.1.bb
new file mode 100644
index 000000000..5f61c4ecd
--- /dev/null
+++ b/poky/meta/recipes-rt/rt-tests/hwlatdetect_1.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Hardware latency detector"
+DESCRIPTION = "Python utility for controlling the kernel hardware latency detection module (hwlat_detector.ko)."
+HOMEPAGE = "https://rt.wiki.kernel.org/index.php/Cyclictest"
+SECTION = "tests"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+require rt-tests.inc
+inherit python3-dir
+
+EXTRA_OEMAKE += "PYLIB=${libdir}/python${PYTHON_BASEVERSION}/dist-packages"
+
+do_compile() {
+ oe_runmake hwlatdetect
+}
+
+do_install() {
+ oe_runmake install_hwlatdetect DESTDIR=${D} SBINDIR=${sbindir} \
+ MANDIR=${mandir} INCLUDEDIR=${includedir}
+
+ sed -i -e '1s,#!.*python.*,#!${bindir}/python3,' ${D}${libdir}/python${PYTHON_BASEVERSION}/dist-packages/hwlatdetect.py
+}
+
+FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/dist-packages/hwlatdetect.py"
+RDEPENDS_${PN} = "python3-core "
+RRECOMMENDS_${PN} = "kernel-module-hwlat-detector"
diff --git a/poky/meta/recipes-rt/rt-tests/rt-tests.inc b/poky/meta/recipes-rt/rt-tests/rt-tests.inc
new file mode 100644
index 000000000..5606d8e38
--- /dev/null
+++ b/poky/meta/recipes-rt/rt-tests/rt-tests.inc
@@ -0,0 +1,10 @@
+# Version 1.1
+SRCREV = "dff174f994f547a5785d32454865f140daacb0f5"
+PE = "1"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git"
+
+S = "${WORKDIR}/git"
+
+# calling 'uname -m' is broken on crossbuilds
+EXTRA_OEMAKE = "NUMA=0"
diff --git a/poky/meta/recipes-rt/rt-tests/rt-tests_1.1.bb b/poky/meta/recipes-rt/rt-tests/rt-tests_1.1.bb
new file mode 100644
index 000000000..496f04fdb
--- /dev/null
+++ b/poky/meta/recipes-rt/rt-tests/rt-tests_1.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Real-Time preemption testcases"
+HOMEPAGE = "https://rt.wiki.kernel.org/index.php/Cyclictest"
+SECTION = "tests"
+DEPENDS = "linux-libc-headers virtual/libc"
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://src/cyclictest/cyclictest.c;beginline=7;endline=9;md5=e768b8da44555fe63f65e5c497844cb5 \
+ file://src/pi_tests/pi_stress.c;beginline=6;endline=19;md5=bd426a634a43ec612e9fbf125dfcc949"
+
+require rt-tests.inc
+inherit ptest
+
+SRC_URI += " \
+ file://run-ptest \
+ file://rt_bmark.py \
+ "
+# Do not install hwlatdetect
+EXTRA_OEMAKE += "PYLIB=''"
+
+do_install() {
+ oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \
+ INCLUDEDIR=${includedir}
+}
+
+do_install_ptest() {
+ cp ${WORKDIR}/rt_bmark.py ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest += " stress python3 python3-multiprocessing python3-datetime python3-misc"
+
+FILES_${PN} += "${prefix}/src/backfire"
diff --git a/poky/meta/recipes-sato/images/core-image-sato-dev.bb b/poky/meta/recipes-sato/images/core-image-sato-dev.bb
new file mode 100644
index 000000000..7fa69d099
--- /dev/null
+++ b/poky/meta/recipes-sato/images/core-image-sato-dev.bb
@@ -0,0 +1,7 @@
+require core-image-sato.bb
+
+DESCRIPTION = "Image with Sato for development work. It includes everything \
+within core-image-sato plus a native toolchain, application development and \
+testing libraries, profiling and debug symbols."
+
+IMAGE_FEATURES += "dev-pkgs"
diff --git a/poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb b/poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb
new file mode 100644
index 000000000..531571ee8
--- /dev/null
+++ b/poky/meta/recipes-sato/images/core-image-sato-sdk-ptest.bb
@@ -0,0 +1,11 @@
+require core-image-sato-sdk.bb
+
+DESCRIPTION += "Also includes ptest packages."
+
+IMAGE_FEATURES += "ptest-pkgs"
+
+# This image is sufficiently large (~3GB) that it can't actually fit in a live
+# image (which has a 4GB limit), so nullify the overhead factor (1.3x out of the
+# box) and explicitly add just 500MB.
+IMAGE_OVERHEAD_FACTOR = "1.0"
+IMAGE_ROOTFS_EXTRA_SPACE = "524288"
diff --git a/poky/meta/recipes-sato/images/core-image-sato-sdk.bb b/poky/meta/recipes-sato/images/core-image-sato-sdk.bb
new file mode 100644
index 000000000..d7cc52b52
--- /dev/null
+++ b/poky/meta/recipes-sato/images/core-image-sato-sdk.bb
@@ -0,0 +1,11 @@
+require core-image-sato.bb
+
+DESCRIPTION = "Image with Sato support that includes everything within \
+core-image-sato plus meta-toolchain, development headers and libraries to \
+form a standalone SDK."
+
+IMAGE_FEATURES += "dev-pkgs tools-sdk \
+ tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks ssh-server-openssh"
+
+IMAGE_INSTALL += "kernel-devsrc"
+
diff --git a/poky/meta/recipes-sato/images/core-image-sato.bb b/poky/meta/recipes-sato/images/core-image-sato.bb
new file mode 100644
index 000000000..b89795028
--- /dev/null
+++ b/poky/meta/recipes-sato/images/core-image-sato.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "Image with Sato, a mobile environment and visual style for \
+mobile devices. The image supports X11 with a Sato theme, Pimlico \
+applications, and contains terminal, editor, and file manager."
+
+IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
+
+LICENSE = "MIT"
+
+inherit core-image
+
+TOOLCHAIN_HOST_TASK_append = " nativesdk-intltool nativesdk-glib-2.0"
+TOOLCHAIN_HOST_TASK_remove_task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0"
diff --git a/poky/meta/recipes-sato/l3afpad/l3afpad_git.bb b/poky/meta/recipes-sato/l3afpad/l3afpad_git.bb
new file mode 100644
index 000000000..ccfda2658
--- /dev/null
+++ b/poky/meta/recipes-sato/l3afpad/l3afpad_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Simple GTK+ Text Editor"
+HOMEPAGE = "https://github.com/stevenhoneyman/l3afpad"
+
+# Note that COPYING seems to mistakenly contain LGPLv2.1.
+# The source code is marked GPLv2+ and COPYING used to contain
+# that as well.
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://src/l3afpad.h;endline=20;md5=8848fd645cd45115d8cb47ca5c42a50e \
+ file://src/utils.c;endline=20;md5=ae4792f69d3bb7b7ba91d582ba9b1a05"
+
+DEPENDS = "gtk+3 intltool-native gettext-native"
+
+PV = "0.8.18.1.11+git${SRCPV}"
+SRC_URI = "git://github.com/stevenhoneyman/l3afpad.git"
+SRCREV ="3cdccdc9505643e50f8208171d9eee5de11a42ff"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+EXTRA_OECONF = "--disable-emacs --disable-print"
+FILES_${PN} += "${datadir}/icons"
diff --git a/poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch b/poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
new file mode 100644
index 000000000..1cb184fb4
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [configuration]
+---
+ appearance/mb-appearance.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/appearance/mb-appearance.c b/appearance/mb-appearance.c
+index 6af8376..71fd57b 100644
+--- a/appearance/mb-appearance.c
++++ b/appearance/mb-appearance.c
+@@ -317,11 +317,13 @@ on_gconf_value_changed (GConfClient* client, const gchar* key, GConfValue* value
+ gtk_font_button_set_font_name (GTK_FONT_BUTTON (font_button),
+ gconf_value_get_string (value));
+ } else if (strcmp (key, HANDED_KEY) == 0) {
++#if 0
+ GEnumValue *e;
+ e = g_enum_get_value_by_name (g_type_class_ref (GTK_TYPE_CORNER_TYPE),
+ gconf_value_get_string (value));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (handed_check),
+ e->value == GTK_CORNER_TOP_RIGHT);
++#endif
+ }
+ }
+
+@@ -408,10 +410,12 @@ main (int argc, char **argv) {
+
+ /* Left/Right Handed */
+
++#if 0
+ handed_check = gtk_check_button_new_with_mnemonic (_("_Left-handed"));
+ frame = new_frame (_("Orientation"),handed_check);
+ gtk_box_pack_start (GTK_BOX (box), frame, TRUE, TRUE, 0);
+ g_signal_connect (handed_check, "toggled", G_CALLBACK (on_handed_set), NULL);
++#endif
+
+ gconf_client_add_dir (gconf, INTERFACE_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ g_signal_connect (gconf, "value-changed", G_CALLBACK (on_gconf_value_changed), NULL);
+--
+2.8.1
+
diff --git a/poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_0.2.bb b/poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_0.2.bb
new file mode 100644
index 000000000..b993a9454
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_0.2.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Matchbox GTK+ theme configuration application"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://appearance/mb-appearance.c;endline=25;md5=ea92333cf8a6802639d62d874c114a28"
+
+DEPENDS = "gconf gtk+3"
+RDEPENDS_${PN} = "settings-daemon"
+
+# SRCREV tagged 0.2
+SRCREV = "ef2192ce98d9374ffdad5f78544c3f8f353c16aa"
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://no-handed.patch"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+# The settings-daemon requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/All.directory b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/All.directory
new file mode 100644
index 000000000..dfa41e3d3
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/All.directory
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=All
+Icon=mbfolder.png
+Type=Directory
+Match=meta-all
diff --git a/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Applications.directory b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Applications.directory
new file mode 100644
index 000000000..a7e350171
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Applications.directory
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=Applications
+Comment=Applications
+Icon=gnome-applications.png
+Type=Directory
+Match=AudioVideo;Audio;Video;Graphics;Network;Office;Utility;System;Development;meta-fallback;
diff --git a/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Games.directory b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Games.directory
new file mode 100644
index 000000000..1b0928c75
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Games.directory
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Games
+Name[de]=Spiele
+Comment=Games of all kind
+Comment[de]=Spiele aller Art
+Icon=mbfolder.png
+Type=Directory
+Match=Game
+
diff --git a/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Root.order b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Root.order
new file mode 100644
index 000000000..01a86d293
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Root.order
@@ -0,0 +1,4 @@
+Applications
+Games
+Settings
+All
diff --git a/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Settings.directory b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Settings.directory
new file mode 100644
index 000000000..5dde365f0
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/files/vfolders/Settings.directory
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Settings
+Name[de]=Einstellungen
+Comment=Settings for your handheld computer
+Comment[de]=Einstellungen für Ihren Handheld-Computer
+Icon=mbfolder.png
+Type=Directory
+Match=Settings
diff --git a/poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.2.bb b/poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.2.bb
new file mode 100644
index 000000000..b0cdfa2ae
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-desktop/matchbox-desktop_2.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Matchbox Window Manager Desktop"
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://src/desktop.c;endline=20;md5=36c9bf295e6007f3423095f405af5a2d \
+ file://src/main.c;endline=19;md5=2044244f97a195c25b7dc602ac7e9a00"
+
+DEPENDS = "gtk+3 startup-notification dbus"
+SECTION = "x11/wm"
+
+# SRCREV tagged 2.2
+SRCREV = "6bc67d09da4147e5552fe30011a05a2c59d2f777"
+SRC_URI = "git://git.yoctoproject.org/${BPN}-2 \
+ file://vfolders/* \
+ "
+
+EXTRA_OECONF = "--enable-startup-notification --with-dbus"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append() {
+ install -d ${D}${datadir}/matchbox/vfolders/
+ install -m 0644 ${WORKDIR}/vfolders/* ${D}${datadir}/matchbox/vfolders/
+}
+
+FILES_${PN} += "${datadir}/matchbox/vfolders/"
diff --git a/poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch b/poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch
new file mode 100644
index 000000000..6b7a5cfec
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-keyboard/files/0001-desktop-file-Hide-the-keyboard-from-app-list.patch
@@ -0,0 +1,33 @@
+From 38da4cd575edb7463cfff241afff64c2f66ea09a Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 12 Apr 2016 09:40:37 +0300
+Subject: [PATCH] desktop file: Hide the keyboard from app list
+
+matchbox-keyboard is not a normal app and there's no need to start
+it via the desktop app grid when using Sato desktop:
+* when there's no hardware keyboard, the panel applet can be used to
+ show/hide the daemonized matchbox-keyboard
+* when there is a hardware keyboard, matchbox-keyboard can still be
+ started for debug purposes from command line or the applet can be
+ enabled by editing /etc/formfactor/machconfig
+
+So hide the keyboard from the desktop app list.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ matchbox-keyboard.desktop | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/matchbox-keyboard.desktop b/matchbox-keyboard.desktop
+index c092bfe..613d349 100644
+--- a/matchbox-keyboard.desktop
++++ b/matchbox-keyboard.desktop
+@@ -6,3 +6,4 @@ Type=Application
+ Icon=matchbox-keyboard.png
+ Categories=Panel;Utility;MB
+ X-MB-INPUT-MECHANSIM=True
++NoDisplay=true
+--
+2.1.4
+
diff --git a/poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh b/poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh
new file mode 100644
index 000000000..6cf188b2d
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+CMD=""
+
+if [ "$HAVE_KEYBOARD" = "0" ]; then
+ CMD="matchbox-keyboard -d"
+elif [ "$DISPLAY_CAN_ROTATE" = "1" ]; then
+ if [ "$HAVE_KEYBOARD_PORTRAIT" = "1" -a "$HAVE_KEYBOARD_LANDSCAPE" = "0" ]; then
+ CMD="matchbox-keyboard -d -o landscape"
+ elif [ "$HAVE_KEYBOARD_LANDSCAPE" = "1" -a "$HAVE_KEYBOARD_PORTRAIT" = "0" ]; then
+ CMD="matchbox-keyboard -d -o portrait"
+ fi
+fi
+
+if [ "$CMD" ]; then
+ # Delay to make sure the window manager is active
+ # by waiting for the desktop to say its finished loading
+ dbus-wait org.matchbox_project.desktop Loaded && $CMD &
+fi
diff --git a/poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_0.1.1.bb b/poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_0.1.1.bb
new file mode 100644
index 000000000..465f1349a
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_0.1.1.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Matchbox virtual keyboard for X11"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+SECTION = "x11"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://src/matchbox-keyboard.h;endline=17;md5=9d6586c69e4a926f3cb0b4425f24ba3c \
+ file://applet/applet.c;endline=18;md5=4a0f721724746b14d95b51ddd42b95e7"
+
+DEPENDS = "libfakekey expat libxft"
+
+#SRCREV for 0.1.1
+SRCREV = "630d89068dc0a1e9199306d405cb32f892dfa4d3"
+SRC_URI = "git://git.yoctoproject.org/${BPN};branch=matchbox-keyboard-0-1 \
+ file://0001-desktop-file-Hide-the-keyboard-from-app-list.patch \
+ file://80matchboxkeyboard.sh"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gettext gtk-immodules-cache distro_features_check
+
+# The libxft, libfakekey and matchbox-panel-2 requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-cairo"
+
+PACKAGECONFIG ??= "gtk3-im applet"
+PACKAGECONFIG[applet] = "--enable-applet,--disable-applet,matchbox-panel-2"
+PACKAGECONFIG[gtk2-im] = "--enable-gtk-im,--disable-gtk-im,gtk+"
+PACKAGECONFIG[gtk3-im] = "--enable-gtk3-im,--disable-gtk3-im,gtk+3"
+
+PACKAGES += "${PN}-im ${PN}-applet"
+
+FILES_${PN} = "${bindir}/ \
+ ${sysconfdir} \
+ ${datadir}/applications \
+ ${datadir}/pixmaps \
+ ${datadir}/matchbox-keyboard"
+
+FILES_${PN}-im = "${libdir}/gtk-2.0/*/immodules/*.so \
+ ${libdir}/gtk-3.0/*/immodules/*.so"
+
+FILES_${PN}-applet = "${libdir}/matchbox-panel/*.so"
+
+
+do_install_append () {
+ install -d ${D}/${sysconfdir}/X11/Xsession.d/
+ install -m 755 ${WORKDIR}/80matchboxkeyboard.sh ${D}/${sysconfdir}/X11/Xsession.d/
+
+ rm -f ${D}${libdir}/gtk-2.0/*/immodules/*.la
+ rm -f ${D}${libdir}/gtk-3.0/*/immodules/*.la
+ rm -f ${D}${libdir}/matchbox-panel/*.la
+}
+
+GTKIMMODULES_PACKAGES = "${PN}-im"
+
+RDEPENDS_${PN} = "formfactor dbus-wait"
+RRECOMMENDS_${PN} = "${PN}-applet"
diff --git a/poky/meta/recipes-sato/matchbox-panel-2/files/0001-applets-systray-Allow-icons-to-be-smaller.patch b/poky/meta/recipes-sato/matchbox-panel-2/files/0001-applets-systray-Allow-icons-to-be-smaller.patch
new file mode 100644
index 000000000..d13dd3d5a
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-panel-2/files/0001-applets-systray-Allow-icons-to-be-smaller.patch
@@ -0,0 +1,34 @@
+From f83a9179696b2d060ee4860733dafbf38bbd4b87 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 28 Sep 2016 15:05:41 +0300
+Subject: [PATCH] applets/systray: Allow icons to be smaller
+
+Don't expand/fill the systray items, align them in the center of the
+systray panel. This makes sure the icons are drawn at the size they
+expect.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Submitted
+---
+ applets/systray/systray.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/applets/systray/systray.c b/applets/systray/systray.c
+index 39698a8..94a5753 100644
+--- a/applets/systray/systray.c
++++ b/applets/systray/systray.c
+@@ -29,8 +29,9 @@ on_realize (GtkWidget *widget, gpointer user_data)
+ tray = (GtkWidget *)na_tray_new_for_screen (screen, orientation);
+
+ gtk_widget_show (tray);
+-
+- gtk_container_add (GTK_CONTAINER (widget), tray);
++ gtk_widget_set_valign (tray, GTK_ALIGN_CENTER);
++ gtk_widget_set_halign (tray, GTK_ALIGN_CENTER);
++ gtk_box_pack_start (GTK_BOX (widget), tray, FALSE, FALSE, 0);
+ }
+
+ G_MODULE_EXPORT GtkWidget *
+--
+2.1.4
+
diff --git a/poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb b/poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb
new file mode 100644
index 000000000..421740f98
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_2.11.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Simple GTK+ based panel for handheld devices"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://matchbox-panel/mb-panel.h;endline=10;md5=0b7db28f4b6863fb853d0467e590019a \
+ file://applets/startup/startup.c;endline=22;md5=7cbcea60b667f609495222faf3e07917"
+
+DEPENDS = "gtk+3 startup-notification dbus dbus-glib dbus-glib-native"
+DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "libacpi", "",d)}"
+DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# SRCREV tagged 2.11 plus some autotools fixes
+SRCREV = "f82ca3f42510fb3ef10f598b393eb373a2c34ca7"
+
+RPROVIDES_${PN} = "matchbox-panel"
+RREPLACES_${PN} = "matchbox-panel"
+RCONFLICTS_${PN} = "matchbox-panel"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://0001-applets-systray-Allow-icons-to-be-smaller.patch \
+ "
+
+EXTRA_OECONF = "--enable-startup-notification --enable-dbus"
+EXTRA_OECONF += " ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "--with-battery=acpi", "",d)}"
+EXTRA_OECONF += " ${@bb.utils.contains("MACHINE_FEATURES", "apm", "--with-battery=apm", "",d)}"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN} += "${libdir}/matchbox-panel/*.so \
+ ${datadir}/matchbox-panel/brightness/*.png \
+ ${datadir}/matchbox-panel/startup/*.png \
+ ${datadir}/icons/"
+FILES_${PN}-dev += "${libdir}/matchbox-panel/*.la"
+
+inherit autotools pkgconfig distro_features_check gettext
diff --git a/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/index.theme b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/index.theme
new file mode 100644
index 000000000..c9260cfd8
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/index.theme
@@ -0,0 +1,7 @@
+[X-GNOME-Metatheme]
+Encoding=UTF-8
+Type=X-GNOME-Metatheme
+Name=Sato
+GtkTheme=Adwaita
+IconTheme=Sato
+MatchboxTheme=Sato
diff --git a/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
new file mode 100644
index 000000000..f6313bdeb
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+ SHOWCURSOR="no"
+else
+ SHOWCURSOR="yes"
+fi
+
+if [ "$HAVE_KEYBOARD" = "1" ]; then
+ KEYBOARD_APPLET=""
+else
+ KEYBOARD_APPLET="keyboard"
+fi
+
+matchbox-desktop &
+
+# Lines containing feature-[foo] are removed at build time if the machine
+# doesn't have the feature "foo".
+
+START_APPLETS=showdesktop,windowselector
+END_APPLETS=clock,battery,$KEYBOARD_APPLET,systray,startup-notify,notify
+END_APPLETS=openmoko-panel-gsm,$END_APPLETS # feature-phone
+
+matchbox-panel --start-applets $START_APPLETS --end-applets $END_APPLETS &
+
+exec matchbox-window-manager -theme Sato -use_cursor $SHOWCURSOR $@
diff --git a/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
new file mode 100644
index 000000000..d146e836d
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Custom Matchbox session files for the Sato environment"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2.0+"
+LIC_FILES_CHKSUM = "file://session;endline=3;md5=f8a5c5b9c279e52dc094d10e11c2be63"
+
+SECTION = "x11"
+RDEPENDS_${PN} = "formfactor matchbox-theme-sato matchbox-panel-2 matchbox-desktop matchbox-session gconf"
+PR = "r30"
+
+# This package is architecture specific because the session script is modified
+# based on the machine architecture.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit distro_features_check
+
+# The matchbox-theme-sato requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://session \
+ file://index.theme"
+S = "${WORKDIR}"
+
+FILES_${PN} += "${datadir}/themes/Sato/index.theme"
+
+do_install() {
+ # This is the set of machine features that the script has markers for
+ FEATURES="phone"
+ SCRIPT="${S}/sedder"
+ rm -f $SCRIPT
+ touch $SCRIPT
+ for FEAT in $FEATURES; do
+ if echo ${MACHINE_FEATURES} | awk "/$FEAT/ {exit 1}"; then
+ echo "/feature-$FEAT/d" >> $SCRIPT
+ fi
+ done
+
+ install -D ${S}/index.theme ${D}/${datadir}/themes/Sato/index.theme
+ install -d ${D}/${sysconfdir}/matchbox
+ sed -f "$SCRIPT" ${S}/session > ${D}/${sysconfdir}/matchbox/session
+ chmod +x ${D}/${sysconfdir}/matchbox/session
+}
+
+PACKAGE_WRITE_DEPS += "gconf-native"
+pkg_postinst_${PN} () {
+ set_value() {
+ #type, name, value
+ gconftool-2 --config-source=xml::$D${sysconfdir}/gconf/gconf.xml.defaults --direct --type $1 --set /desktop/poky/interface/$2 "$3"
+ }
+ set_value string theme Adwaita
+ set_value string matchbox_theme Sato
+ set_value string icon_theme Sato
+ set_value bool touchscreen true
+ set_value string font_name "Sans 9"
+}
diff --git a/poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_0.1.bb b/poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_0.1.bb
new file mode 100644
index 000000000..4488191b2
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-terminal/matchbox-terminal_0.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Lightweight GTK+ terminal application"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://main.c;endline=20;md5=96e39176d9e355639a0b8b1c7a840820"
+
+DEPENDS = "gtk+3 vte"
+SECTION = "x11/utils"
+
+#SRCREV tagged 0.1
+SRCREV = "3ad357db2302760b8a8817b5f4478dd87479442f"
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
diff --git a/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc b/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc
new file mode 100644
index 000000000..d947e1ab0
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Matchbox window manager Sato themes"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=aae86bb34b0a83716ca09f4e783d6ba4"
+
+DEPENDS = "matchbox-wm"
+SECTION = "x11/wm"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += "${datadir}/themes"
+
+# The matchbox-wm requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.2.bb b/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.2.bb
new file mode 100644
index 000000000..7a043d344
--- /dev/null
+++ b/poky/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.2.bb
@@ -0,0 +1,8 @@
+require matchbox-theme-sato.inc
+
+# SRCREV tagged 0.2
+SRCREV = "df085ba9cdaeaf2956890b0e29d7ea1779bf6c78"
+SRC_URI = "git://git.yoctoproject.org/matchbox-sato"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
diff --git a/poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb b/poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
new file mode 100644
index 000000000..224428ddd
--- /dev/null
+++ b/poky/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
@@ -0,0 +1,59 @@
+#
+# Copyright (C) 2007-2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Sato desktop"
+PR = "r33"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup distro_features_check
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN} ${PN}-base ${PN}-apps ${PN}-games"
+
+RDEPENDS_${PN} = "\
+ ${PN}-base \
+ ${PN}-apps \
+ ${PN}-games \
+ "
+
+NETWORK_MANAGER ?= "connman-gnome"
+
+SUMMARY_${PN}-base = "Sato desktop - base packages"
+RDEPENDS_${PN}-base = "\
+ matchbox-desktop \
+ matchbox-session-sato \
+ matchbox-keyboard \
+ matchbox-keyboard-applet \
+ matchbox-keyboard-im \
+ matchbox-config-gtk \
+ xcursor-transparent-theme \
+ adwaita-icon-theme \
+ settings-daemon \
+ shutdown-desktop \
+ libsdl \
+ ${NETWORK_MANAGER} \
+ udev-extraconf \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio-server pulseaudio-client-conf-sato pulseaudio-misc', '', d)} \
+ "
+
+FILEMANAGER ?= "pcmanfm"
+
+WEB ?= ""
+#WEB = "epiphany"
+
+SUMMARY_${PN}-apps = "Sato desktop - applications"
+RDEPENDS_${PN}-apps = "\
+ l3afpad \
+ gst-examples \
+ matchbox-terminal \
+ sato-screenshot \
+ ${FILEMANAGER} \
+ ${WEB} \
+ "
+
+SUMMARY_${PN}-games = "Sato desktop - games"
+RDEPENDS_${PN}-games = "\
+ puzzles \
+ "
diff --git a/poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png b/poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
new file mode 100644
index 000000000..b8e559456
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
Binary files differ
diff --git a/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png b/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
new file mode 100644
index 000000000..05921a668
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
Binary files differ
diff --git a/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png b/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
new file mode 100644
index 000000000..ce77a8e62
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
Binary files differ
diff --git a/poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png b/poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
new file mode 100644
index 000000000..bfe4bad56
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
Binary files differ
diff --git a/poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch b/poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch
new file mode 100644
index 000000000..ae54dbd56
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/files/no-desktop.patch
@@ -0,0 +1,15 @@
+Disable the desktop preferences launcher as we don't use the pcmanfm desktop in
+Sato.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/data/pcmanfm-desktop-pref.desktop b/data/pcmanfm-desktop-pref.desktop
+index ccf8abb..3f6fc1c 100644
+--- a/data/pcmanfm-desktop-pref.desktop.in
++++ b/data/pcmanfm-desktop-pref.desktop.in
+@@ -7,3 +7,4 @@ Exec=pcmanfm --desktop-pref
+ StartupNotify=true
+ Terminal=false
+ NotShowIn=GNOME;XFCE;KDE;MATE;
++NoDisplay=true
diff --git a/poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb b/poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb
new file mode 100644
index 000000000..4127a0704
--- /dev/null
+++ b/poky/meta/recipes-sato/pcmanfm/pcmanfm_1.2.5.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Fast lightweight tabbed filemanager"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://src/pcmanfm.h;endline=22;md5=417b3855771a3a87f8ad753d994491f0 \
+ file://src/gseal-gtk-compat.h;endline=21;md5=46922c8691f58d124f9420fe16149ce2"
+
+SECTION = "x11"
+DEPENDS = "gtk+3 startup-notification libfm intltool-native gettext-native glib-2.0-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/pcmanfm-${PV}.tar.xz \
+ file://gnome-fs-directory.png \
+ file://gnome-fs-regular.png \
+ file://gnome-mime-text-plain.png \
+ file://emblem-symbolic-link.png \
+ file://no-desktop.patch"
+
+SRC_URI[md5sum] = "b4d1f8ce08d87e4f27805a246fc51ac2"
+SRC_URI[sha256sum] = "0c86cac028b705ff314c7464d814c2cf7ff604c17491c20aa204b1ef1a80ad67"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/pcmanfm/files/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/"
+
+inherit autotools pkgconfig distro_features_check
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--with-gtk=3"
+
+do_install_append () {
+ install -d ${D}/${datadir}
+ install -d ${D}/${datadir}/pixmaps/
+
+ install -m 0644 ${WORKDIR}/*.png ${D}/${datadir}/pixmaps
+}
+
+FILES_${PN} += "${libdir}/pcmanfm"
+
+RRECOMMENDS_${PN} += "adwaita-icon-theme"
diff --git a/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf b/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf
new file mode 100644
index 000000000..97492e7a5
--- /dev/null
+++ b/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf
@@ -0,0 +1,7 @@
+# We rely on PulseAudio's autospawn feature to automatically start the daemon
+# in Sato. The graphical session in Sato runs under root, however, and
+# PulseAudio disables autospawning for root by default. In a normal setup it's
+# not desirable to autospawn for root, because it can easily interfere with
+# other users' PulseAudio instances, but in Sato there are no other users, so
+# it's OK to enable this in Sato.
+allow-autospawn-for-root = yes
diff --git a/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb b/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb
new file mode 100644
index 000000000..e27339fb4
--- /dev/null
+++ b/poky/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "/etc/pulse/client.conf tailored for Sato"
+SECTION = "multimedia"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://50-sato.conf"
+S = "${WORKDIR}"
+
+inherit allarch
+
+do_install() {
+ install -d ${D}${sysconfdir}/pulse/client.conf.d
+ install -m 0644 ${S}/50-sato.conf ${D}${sysconfdir}/pulse/client.conf.d/50-sato.conf
+}
+
+FILES_${PN} = "${sysconfdir}/pulse/client.conf.d/50-sato.conf"
+CONFFILES_${PN} = "${sysconfdir}/pulse/client.conf.d/50-sato.conf"
diff --git a/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch b/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch
new file mode 100644
index 000000000..d40a3b1ef
--- /dev/null
+++ b/poky/meta/recipes-sato/puzzles/files/0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch
@@ -0,0 +1,32 @@
+From 337799e40350b3db2441cc98f65ec36a74dfb356 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Apr 2017 12:18:08 -0700
+Subject: [PATCH] Use -Wno-error=format-overflow= if the compiler supports it
+
+we need this warning to be suppressed with gcc7+
+however older compilers dont support it so we need
+a way to disble it only if compiler supports it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3a38c95..bb9035e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ fi
+ if test "x$GCC" = "xyes"; then
+ AC_MSG_CHECKING([for usable gcc warning flags])
+ gccwarningflags=
+- for flag in -Wall -Werror -std=c89 -pedantic; do
++ for flag in -Wall -Werror -std=c89 -pedantic -Wno-error=format-overflow=; do
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS$gccwarningflags $flag $GTK_CFLAGS"
+--
+2.12.2
+
diff --git a/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch b/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
new file mode 100644
index 000000000..f43d1df6c
--- /dev/null
+++ b/poky/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
@@ -0,0 +1,46 @@
+From 9808dc09e08937c9bffd858d3ded428225a4312a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 09:02:38 +0000
+Subject: [PATCH] Use labs instead of abs
+
+cluevals is array of longs so we have to use labs() instead of abs()
+since abs() returns int
+
+Fixes
+
+keen.c:1458:17: error: absolute value function 'abs' given an argument
+of type 'long' but has parameter of type 'int' which may cause
+truncation of value
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ keen.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/keen.c b/keen.c
+index a6a7238..1631992 100644
+--- a/keen.c
++++ b/keen.c
+@@ -1043,7 +1043,7 @@ done
+ cluevals[j] *= grid[i];
+ break;
+ case C_SUB:
+- cluevals[j] = abs(cluevals[j] - grid[i]);
++ cluevals[j] = labs(cluevals[j] - grid[i]);
+ break;
+ case C_DIV:
+ {
+@@ -1455,7 +1455,7 @@ static int check_errors(const game_state *state, long *errors)
+ cluevals[j] *= state->grid[i];
+ break;
+ case C_SUB:
+- cluevals[j] = abs(cluevals[j] - state->grid[i]);
++ cluevals[j] = labs(cluevals[j] - state->grid[i]);
+ break;
+ case C_DIV:
+ {
+--
+2.5.1
+
diff --git a/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
new file mode 100644
index 000000000..5351f8eb4
--- /dev/null
+++ b/poky/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
@@ -0,0 +1,72 @@
+From 6d8326275802a2e6e61d3e99460af6891ae8362f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 23:10:19 -0800
+Subject: [puzzles][PATCH] palisade: Fix warnings with clang on arm
+
+ARM treats 'char' as unsigned char when 'char' is not qualified with
+'signed' or 'unsigned' explicitly.
+
+This results in warnings e.g.
+
+palisade.c:531:22: error: comparison of constant -1 with expression of
+type 'clue' (aka 'char') is always false
+[-Werror,-Wtautological-constant-out-of-range-compare]
+ if (clues[i] == EMPTY) continue;
+
+Therefore, typcast the contant to char in such places to be explicit
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ palisade.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/palisade.c b/palisade.c
+index 984e616..2b9c25c 100644
+--- a/palisade.c
++++ b/palisade.c
+@@ -295,11 +295,11 @@ static void solver_connected_clues_versus_region_size(solver_ctx *ctx)
+ * If p = q = 3 then the region has size exactly 2. */
+
+ for (i = 0; i < wh; ++i) {
+- if (ctx->clues[i] == EMPTY) continue;
++ if (ctx->clues[i] == (char)EMPTY) continue;
+ for (dir = 0; dir < 4; ++dir) {
+ int j = i + dx[dir] + w*dy[dir];
+ if (disconnected(ctx, i, j, dir)) continue;
+- if (ctx->clues[j] == EMPTY) continue;
++ if (ctx->clues[j] == (char)EMPTY) continue;
+ if ((8 - ctx->clues[i] - ctx->clues[j] > ctx->params->k) ||
+ (ctx->clues[i] == 3 && ctx->clues[j] == 3 &&
+ ctx->params->k != 2))
+@@ -317,7 +317,7 @@ static int solver_number_exhausted(solver_ctx *ctx)
+ int changed = FALSE;
+
+ for (i = 0; i < wh; ++i) {
+- if (ctx->clues[i] == EMPTY) continue;
++ if (ctx->clues[i] == (char)EMPTY) continue;
+
+ if (bitcount[(ctx->borders[i] & BORDER_MASK)] == ctx->clues[i]) {
+ for (dir = 0; dir < 4; ++dir) {
+@@ -528,7 +528,7 @@ static int is_solved(const game_params *params, clue *clues,
+ for (i = 0; i < wh; ++i) {
+ if (dsf[i] == UNVISITED) dfs_dsf(i, params->w, border, dsf, TRUE);
+ if (dsf_size(dsf, i) != k) goto error;
+- if (clues[i] == EMPTY) continue;
++ if (clues[i] == (char)EMPTY) continue;
+ if (clues[i] != bitcount[border[i] & BORDER_MASK]) goto error;
+ }
+
+@@ -674,7 +674,7 @@ static char *new_game_desc(const game_params *params, random_state *rs,
+ p = numbers;
+ r = 0;
+ for (i = 0; i < wh; ++i) {
+- if (numbers[i] != EMPTY) {
++ if (numbers[i] != (char)EMPTY) {
+ while (r) {
+ while (r > 26) {
+ *p++ = 'z';
+--
+2.7.0
+
diff --git a/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
new file mode 100644
index 000000000..c134acde2
--- /dev/null
+++ b/poky/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
@@ -0,0 +1,43 @@
+gtk.c: fix compiling failure with option -g -O
+
+There were compiling failure with option -g -O
+...
+././gtk.c: In function 'configure_area':
+././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ cairo_set_source_rgb(cr,
+ ^
+././gtk.c:384:14: note: 'cr' was declared here
+ cairo_t *cr;
+ ^
+././gtk.c: In function 'main':
+././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ fprintf(stderr, "%s: %s\n", pname, error);
+ ^
+cc1: all warnings being treated as errors
+...
+
+Initialized pointer 'cr' and 'error' with NULL
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gtk.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gtk.c b/gtk.c
+index a2eba2c..c54bf63 100644
+--- a/gtk.c
++++ b/gtk.c
+@@ -2481,7 +2481,7 @@ char *fgetline(FILE *fp)
+ int main(int argc, char **argv)
+ {
+ char *pname = argv[0];
+- char *error;
++ char *error = NULL;
+ int ngenerate = 0, print = FALSE, px = 1, py = 1;
+ int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE;
+ int soln = FALSE, colour = FALSE;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-sato/puzzles/puzzles_git.bb b/poky/meta/recipes-sato/puzzles/puzzles_git.bb
new file mode 100644
index 000000000..bfd817719
--- /dev/null
+++ b/poky/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Simon Tatham's Portable Puzzle Collection"
+HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
+
+DEPENDS = "libxt"
+
+# The libxt requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=da6110d4ed1225a287eab2bf0ac0193b"
+
+SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
+ file://fix-compiling-failure-with-option-g-O.patch \
+ file://0001-Use-labs-instead-of-abs.patch \
+ file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
+ file://0001-Use-Wno-error-format-overflow-if-the-compiler-suppor.patch \
+ "
+UPSTREAM_CHECK_COMMITS = "1"
+SRCREV = "2adf0052d66eae88c7a5e55e67fe16e13f7018b5"
+PE = "2"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools distro_features_check pkgconfig
+
+CFLAGS_append = " -Wno-deprecated-declarations"
+
+PACKAGECONFIG ??= "gtk3"
+PACKAGECONFIG[gtk2] = "--with-gtk=2,,gtk+,"
+PACKAGECONFIG[gtk3] = "--with-gtk=3,,gtk+3,"
+
+PACKAGES += "${PN}-extra"
+FILES_${PN} = ""
+FILES_${PN}-extra = "${prefix}/bin ${datadir}/applications"
+
+python __anonymous () {
+ var = d.expand("FILES_${PN}")
+ data = d.getVar(var, False)
+ for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
+ data = data + " ${bindir}/%s" % name
+ data = data + " ${datadir}/applications/%s.desktop" % name
+ d.setVar(var, data)
+}
+
+do_configure_prepend () {
+ cd ${S}
+ ./mkfiles.pl
+ cd ${B}
+}
+
+do_install_append () {
+ # net conflicts with Samba, so rename it
+ mv ${D}${bindir}/net ${D}${bindir}/puzzles-net
+
+ # Create desktop shortcuts
+ install -d ${D}/${datadir}/applications/
+ cd ${D}/${prefix}/bin
+ for prog in *; do
+ if [ -x $prog ]; then
+ # Convert prog to Title Case
+ title=$(echo $prog | sed 's/puzzles-//' | sed 's/\(^\| \)./\U&/g')
+ echo "making ${D}/${datadir}/applications/$prog.desktop"
+ cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
+[Desktop Entry]
+Name=$title
+Exec=${bindir}/$prog
+Icon=applications-games
+Terminal=false
+Type=Application
+Categories=Game;
+StartupNotify=true
+STOP
+ fi
+ done
+}
diff --git a/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc
new file mode 100644
index 000000000..b568f0458
--- /dev/null
+++ b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc
@@ -0,0 +1,58 @@
+SECTION = "x11/utils"
+SUMMARY = "rxvt terminal clone supporting unicode"
+DESCRIPTION = "rxvt-unicode is a clone of the well known \
+terminal emulator rxvt, modified to store text in Unicode \
+(either UCS-2 or UCS-4) and to use locale-correct input and \
+output. It also supports mixing multiple fonts at the \
+same time, including Xft fonts."
+DEPENDS = "virtual/libx11 libxt libxft gdk-pixbuf libxmu"
+
+SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2 \
+ file://xwc.patch \
+ file://rxvt.desktop \
+ file://rxvt.png"
+
+inherit autotools pkgconfig update-alternatives
+
+PROVIDES = "virtual/x-terminal-emulator"
+ALTERNATIVE_${PN} = "x-terminal-emulator"
+ALTERNATIVE_TARGET[x-terminal-emulator] = "${bindir}/rxvt"
+
+CFLAGS_append = " -fpermissive"
+
+EXTRA_OECONF = "--enable-xim \
+ --enable-utmp --enable-wtmp --enable-lastlog \
+ --with-term=rxvt --enable-keepscrolling \
+ --enable-xft --with-name=rxvt --enable-frills \
+ --enable-swapscreen --enable-transparency \
+ --with-codesets=eu --enable-pointer-blank \
+ --enable-text-blink --enable-rxvt-scroll \
+ --enable-combining --disable-perl \
+ --with-x=${STAGING_DIR_HOST}${prefix}"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[startup] = "--enable-startup-notification,--disable-startup-notification,startup-notification,"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cp ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+do_compile_prepend () {
+ echo '#define UTMP_FILE "${localstatedir}/run/utmp"' >> config.h
+ echo '#define WTMP_FILE "${localstatedir}/log/wtmp"' >> config.h
+ echo '#define LASTLOG_FILE "${localstatedir}/log/lastlog"' >> config.h
+ echo '#define HAVE_XLOCALE 1' >> config.h
+}
+
+do_install_append () {
+ install -d ${D}/${datadir}
+ install -d ${D}/${datadir}/applications
+ install -d ${D}/${datadir}/pixmaps/
+
+ install -m 0644 ${WORKDIR}/rxvt.png ${D}/${datadir}/pixmaps
+ install -m 0644 ${WORKDIR}/rxvt.desktop ${D}/${datadir}/applications
+}
+
+FILES_${PN} += "${datadir}/applications/rxvt.desktop ${datadir}/pixmaps/rxvt.png"
diff --git a/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop
new file mode 100644
index 000000000..882ea4113
--- /dev/null
+++ b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Name=Terminal
+Comment=A unicode capable rxvt clone
+Exec=rxvt
+Icon=terminal
+Terminal=false
+Type=Application
+Categories=Utility;TerminalEmulator;
diff --git a/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
new file mode 100644
index 000000000..e56fa2e9c
--- /dev/null
+++ b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
Binary files differ
diff --git a/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch
new file mode 100644
index 000000000..16efeef49
--- /dev/null
+++ b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+diff -ruN rxvt-unicode-9.10-orig//src/screen.C rxvt-unicode-9.10/src/screen.C
+--- rxvt-unicode-9.10-orig//src/screen.C 2011-04-19 13:34:01.327664984 +0800
++++ rxvt-unicode-9.10/src/screen.C 2011-04-19 13:34:47.037665001 +0800
+@@ -3152,7 +3152,7 @@
+ return false;
+ }
+
+-#if 0
++#if HAVE_XWC
+ XTextProperty ct;
+
+ if (XwcTextListToTextProperty (dpy, &selection.text, 1, XStringStyle, &ct) >= 0)
+@@ -3734,9 +3734,11 @@
+ }
+ else
+ #endif
++#ifdef HAVE_XWC
+ if (XwcTextListToTextProperty (dpy, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
+ freect = 1;
+ else
++#endif
+ {
+ /* if we failed to convert then send it raw */
+ ct.value = (unsigned char *)cl;
diff --git a/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb
new file mode 100644
index 000000000..bfa8a614d
--- /dev/null
+++ b/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb
@@ -0,0 +1,8 @@
+require rxvt-unicode.inc
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://src/main.C;beginline=1;endline=31;md5=d3600d7ee1062667fcd1193fbe6485f6"
+
+SRC_URI[md5sum] = "93782dec27494eb079467dacf6e48185"
+SRC_URI[sha256sum] = "e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd"
diff --git a/poky/meta/recipes-sato/sato-screenshot/sato-screenshot_0.3.bb b/poky/meta/recipes-sato/sato-screenshot/sato-screenshot_0.3.bb
new file mode 100644
index 000000000..f3305aef7
--- /dev/null
+++ b/poky/meta/recipes-sato/sato-screenshot/sato-screenshot_0.3.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Ultra-simple screen capture utility, aimed at handheld devices"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://main.c;endline=9;md5=023e14d6404d0a961eb97cbd011fc141 \
+ file://screenshot-ui.h;endline=9;md5=638d9ffa83e9325a36df224166ed6ad0"
+
+DEPENDS = "matchbox-panel-2 gtk+3"
+
+# SRCREV tagged 0.3
+SRCREV = "9250fa5a012d84ff45984e8c4345ee7635227756"
+SRC_URI = "git://git.yoctoproject.org/screenshot"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += "${libdir}/matchbox-panel/*.so"
+
+do_install_append () {
+ rm ${D}${libdir}/matchbox-panel/*.la
+}
+
+# The matchbox-panel-2 requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh b/poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
new file mode 100644
index 000000000..95374135f
--- /dev/null
+++ b/poky/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
@@ -0,0 +1 @@
+/usr/bin/settings-daemon &
diff --git a/poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch b/poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch
new file mode 100644
index 000000000..baf06d6b8
--- /dev/null
+++ b/poky/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+Index: settings-daemon/settings-daemon.c
+===================================================================
+--- settings-daemon.orig/settings-daemon.c 2009-05-22 14:57:05.000000000 +0100
++++ settings-daemon/settings-daemon.c 2009-05-22 14:58:22.000000000 +0100
+@@ -187,6 +187,10 @@
+ GCONF_VALUE_STRING, translate_string_string },
+ { "/desktop/poky/interface/gtk_color_scheme", "Gtk/ColorScheme",
+ GCONF_VALUE_STRING, translate_string_string },
++ { "/desktop/gnome/sound/theme_name", "Net/SoundThemeName",
++ GCONF_VALUE_STRING, translate_string_string },
++ { "/desktop/gnome/sound/event_sounds", "Net/EnableEventSounds" ,
++ GCONF_VALUE_BOOL, translate_bool_int },
+ };
+
+ static const TranslationEntry*
+Index: settings-daemon/settings-daemon.schemas
+===================================================================
+--- settings-daemon.orig/settings-daemon.schemas 2009-05-22 15:49:17.000000000 +0100
++++ settings-daemon/settings-daemon.schemas 2009-05-22 15:51:31.000000000 +0100
+@@ -196,6 +196,27 @@
+ </locale>
+ </schema>
+
++ <schema>
++ <key>/schemas/desktop/gnome/sound/theme_name</key>
++ <applyto>/desktop/gnome/sound/theme_name</applyto>
++ <owner>gnome</owner>
++ <type>string</type>
++ <default>freedesktop</default>
++ <locale name="C">
++ <short>Sound Theme Name</short>
++ </locale>
++ </schema>
++
++ <schema>
++ <key>/schemas/desktop/gnome/sound/event_sounds</key>
++ <applyto>/desktop/gnome/sound/event_sounds</applyto>
++ <owner>gnome</owner>
++ <type>bool</type>
++ <default>true</default>
++ <locale name="C">
++ <short>Enable Sound Events</short>
++ </locale>
++ </schema>
+
+ </schemalist>
+ </gconfschemafile>
diff --git a/poky/meta/recipes-sato/settings-daemon/settings-daemon_0.0.2.bb b/poky/meta/recipes-sato/settings-daemon/settings-daemon_0.0.2.bb
new file mode 100644
index 000000000..bb6b69b90
--- /dev/null
+++ b/poky/meta/recipes-sato/settings-daemon/settings-daemon_0.0.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Provides a bridge between gconf and xsettings"
+HOMEPAGE = "http://svn.o-hand.com/view/matchbox/trunk/settings-daemon/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xsettings-manager.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+ file://xsettings-common.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b"
+DEPENDS = "gconf glib-2.0 gtk+3"
+SECTION = "x11"
+
+# SRCREV tagged 0.0.2
+SRCREV = "b2e5da502f8c5ff75e9e6da771372ef8e40fd9a2"
+SRC_URI = "git://git.yoctoproject.org/xsettings-daemon \
+ file://addsoundkeys.patch \
+ file://70settings-daemon.sh \
+ "
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gconf distro_features_check
+
+FILES_${PN} = "${bindir}/* ${sysconfdir}"
+
+# Requires gdk-x11-2.0 which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append () {
+ install -d ${D}/${sysconfdir}/X11/Xsession.d
+ install -m 755 ${WORKDIR}/70settings-daemon.sh ${D}/${sysconfdir}/X11/Xsession.d/
+}
diff --git a/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb b/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
new file mode 100644
index 000000000..28d509602
--- /dev/null
+++ b/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Provides an icon to shut down the system cleanly"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://shutdown.desktop"
+
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${datadir}/applications
+ install -m 0644 shutdown.desktop ${D}${datadir}/applications/
+
+ sed -i ${D}${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)#Exec=${base_sbindir}/\1#'
+}
+
+pkg_postinst_${PN} () {
+ grep -q qemuarm $D${sysconfdir}/hostname && \
+ sed -i $D${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)/halt#Exec=\1/reboot#' \
+ || true
+}
+
+inherit allarch
diff --git a/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop b/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
new file mode 100644
index 000000000..662659afc
--- /dev/null
+++ b/poky/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Shutdown
+Comment=Close down the machine safely
+Exec=poweroff
+Icon=system-shutdown
+Terminal=false
+Categories=Utility;
+StartupNotify=true
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
new file mode 100644
index 000000000..fae3b0b2e
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch
@@ -0,0 +1,27 @@
+From 317a5ac120c44987219bc03486cd2f2d1842c9b9 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 27 Oct 2015 16:02:19 +0200
+Subject: [PATCH] FindGObjectIntrospection.cmake: prefix variables obtained
+ from pkg-config with PKG_CONFIG_SYSROOT_DIR
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Source/cmake/FindGObjectIntrospection.cmake | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Source/cmake/FindGObjectIntrospection.cmake b/Source/cmake/FindGObjectIntrospection.cmake
+index e1f49b4..03a4446 100644
+--- a/Source/cmake/FindGObjectIntrospection.cmake
++++ b/Source/cmake/FindGObjectIntrospection.cmake
+@@ -26,6 +26,7 @@ macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname _extra_args)
+ else ()
+ string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
+ string(REGEX REPLACE " +$" "" _result "${_result}")
++ string(CONCAT _result $ENV{PKG_CONFIG_SYSROOT_DIR} "${_result}")
+ separate_arguments(_result)
+ set(${_outvar} ${_result} CACHE INTERNAL "")
+ endif ()
+--
+2.1.4
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..7cc4514fc
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch
@@ -0,0 +1,77 @@
+From 415e31bd5444fa360af58b069f1b9db6607fca7d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 6 Oct 2017 17:00:08 +0300
+Subject: [PATCH] Fix build with musl
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Source/JavaScriptCore/runtime/MachineContext.h | 10 +++++-----
+ Source/WTF/wtf/Platform.h | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h
+index 95080b9..2bb689c 100644
+--- a/Source/JavaScriptCore/runtime/MachineContext.h
++++ b/Source/JavaScriptCore/runtime/MachineContext.h
+@@ -146,7 +146,7 @@ inline void*& stackPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ #if CPU(X86)
+ return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
+@@ -251,7 +251,7 @@ inline void*& framePointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -354,7 +354,7 @@ inline void*& instructionPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -466,7 +466,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -583,7 +583,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext)
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
+index 5a2863b..b36c3ff 100644
+--- a/Source/WTF/wtf/Platform.h
++++ b/Source/WTF/wtf/Platform.h
+@@ -680,7 +680,7 @@
+ #define HAVE_CFNETWORK_STORAGE_PARTITIONING 1
+ #endif
+
+-#if OS(DARWIN) || ((OS(FREEBSD) || defined(__GLIBC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
++#if OS(DARWIN) || ((OS(FREEBSD) || defined(__linux__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
+ #define HAVE_MACHINE_CONTEXT 1
+ #endif
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-gles3-header-when-gles2-is-enabled.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-gles3-header-when-gles2-is-enabled.patch
new file mode 100644
index 000000000..21574072f
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-gles3-header-when-gles2-is-enabled.patch
@@ -0,0 +1,38 @@
+From adf3d4c9d4133bd6995590d921c0ccaec5254da9 Mon Sep 17 00:00:00 2001
+From: Bhargava Sreekantappa Gayathri
+ <bhargava.sreekantappa-gayathri@xilinx.com>
+Date: Tue, 27 Feb 2018 16:09:31 -0800
+Subject: [PATCH] Fix gles3 header when gles2 is enabled
+
+A GLES 2 application should not use gl3.h.
+Fix the gles3 header failure while compiling webkitgtk.
+
+FAILED:
+Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/GLContext.cpp.o
+ ^~~~~~~~~~~~~
+compilation terminated.
+
+Upstream-Status: Backport
+Imported patch from: https://bugs.webkit.org/show_bug.cgi?id=183008
+
+Signed-off-by: Bhargava Sreekantappa Gayathri <bhargava.sreekantappa-gayathri@xilinx.com>
+Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
+---
+ Source/WebCore/platform/graphics/GLContext.cpp | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Source/WebCore/platform/graphics/GLContext.cpp b/Source/WebCore/platform/graphics/GLContext.cpp
+index 599dcc0..46d2fd4 100644
+--- a/Source/WebCore/platform/graphics/GLContext.cpp
++++ b/Source/WebCore/platform/graphics/GLContext.cpp
+@@ -31,7 +31,6 @@
+ #elif USE(OPENGL_ES_2)
+ #define GL_GLEXT_PROTOTYPES 1
+ #include <GLES2/gl2.h>
+-#include <GLES3/gl3.h>
+ #endif
+
+ #if USE(GLX)
+--
+2.7.4
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
new file mode 100644
index 000000000..896890b43
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch
@@ -0,0 +1,49 @@
+From b7f40eceef0f23bf88090789d4c5845c35f048ae Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 29 Aug 2016 16:38:11 +0300
+Subject: [PATCH 4/9] Fix racy parallel build of WebKit2-4.0.gir
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/WebKit/PlatformGTK.cmake | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index a33c6a86..d83a2e77 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1122,8 +1122,9 @@ endif ()
+ string(REGEX MATCHALL "-L[^ ]*"
+ INTROSPECTION_ADDITIONAL_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+
+-add_custom_command(
+- OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++# This is a target and not a command because it's used to build another .gir
++# and a .typelib, which would trigger two racy parallel builds when using command
++add_custom_target(WebKit2-${WEBKITGTK_API_VERSION}-gir
+ DEPENDS WebKit2
+ DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
+@@ -1168,7 +1169,7 @@ add_custom_command(
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
+ DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+- DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++ DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
+ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
+ LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
+ ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+@@ -1225,7 +1226,7 @@ add_custom_command(
+
+ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
+- DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
++ DEPENDS WebKit2-${WEBKITGTK_API_VERSION}-gir
+ COMMAND ${INTROSPECTION_COMPILER} --includedir=${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.typelib
+ )
+
+--
+2.14.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
new file mode 100644
index 000000000..0f6eeed1a
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch
@@ -0,0 +1,34 @@
+From 48648570e449cf7f84a26dc03c1e3f620fa69757 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 29 Feb 2016 18:13:39 +0200
+Subject: [PATCH] OptionsGTK.cmake: drop the hardcoded introspection/gtkdoc
+ disabling when cross-compiling
+
+This was not possible to override from the command line and in OpenEmbedded
+(one of the most prominent cross-compilation frameworks) introspection does work fine,
+through the use of qemu target emulation.
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+Upstream-Status: Pending
+---
+ Source/cmake/OptionsGTK.cmake | 6 ------
+ 1 file changed, 6 deletions(-)
+
+Index: webkitgtk-2.12.1/Source/cmake/OptionsGTK.cmake
+===================================================================
+--- webkitgtk-2.12.1.orig/Source/cmake/OptionsGTK.cmake
++++ webkitgtk-2.12.1/Source/cmake/OptionsGTK.cmake
+@@ -424,12 +424,6 @@ if (USE_LIBHYPHEN)
+ endif ()
+ endif ()
+
+-# Override the cached variables, gtk-doc and gobject-introspection do not really work when cross-building.
+-if (CMAKE_CROSSCOMPILING)
+- set(ENABLE_GTKDOC OFF)
+- set(ENABLE_INTROSPECTION OFF)
+-endif ()
+-
+ # Override the cached variable, gtk-doc does not really work when building on Mac.
+ if (APPLE)
+ set(ENABLE_GTKDOC OFF)
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
new file mode 100644
index 000000000..83fd5129a
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch
@@ -0,0 +1,50 @@
+From 9b09974003097c9a408bbeea568996768efe705b Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 11 Aug 2016 17:13:51 +0300
+Subject: [PATCH 05/10] Tweak gtkdoc settings so that gtkdoc generation works
+ under OpenEmbedded build system
+
+This requires setting a few environment variables so that the transient
+binary is build and linked correctly, and disabling the tweaks to RUN
+variable from gtkdoc.py script so that our qemu wrapper is taken into use.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/PlatformGTK.cmake | 2 +-
+ Tools/gtk/gtkdoc.py | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Source/PlatformGTK.cmake b/Source/PlatformGTK.cmake
+index 50b5393..7a31db5 100644
+--- a/Source/PlatformGTK.cmake
++++ b/Source/PlatformGTK.cmake
+@@ -24,7 +24,7 @@ macro(ADD_GTKDOC_GENERATOR _stamp_name _extra_args)
+ add_custom_command(
+ OUTPUT "${CMAKE_BINARY_DIR}/${_stamp_name}"
+ DEPENDS ${DocumentationDependencies}
+- COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc ${_extra_args}
++ COMMAND ${CMAKE_COMMAND} -E env "CC=${CMAKE_C_COMPILER}" "CFLAGS=${CMAKE_C_FLAGS} -Wno-unused-parameter" "LD=${CMAKE_C_COMPILER}" "LDFLAGS=${CMAKE_C_LINK_FLAGS}" "RUN=${CMAKE_BINARY_DIR}/gtkdoc-qemuwrapper" ${CMAKE_SOURCE_DIR}/Tools/gtk/generate-gtkdoc -v ${_extra_args}
+ COMMAND touch ${_stamp_name}
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ VERBATIM
+diff --git a/Tools/gtk/gtkdoc.py b/Tools/gtk/gtkdoc.py
+index 03c8e8e..34fbaff 100644
+--- a/Tools/gtk/gtkdoc.py
++++ b/Tools/gtk/gtkdoc.py
+@@ -318,9 +318,9 @@ class GTKDoc(object):
+ additional_ldflags = '%s %s' % (additional_ldflags, arg)
+ ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags
+ current_ld_library_path = env.get('LD_LIBRARY_PATH')
+- if current_ld_library_path:
++ if current_ld_library_path and 'RUN' not in env:
+ env['LD_LIBRARY_PATH'] = '%s:%s' % (self.library_path, current_ld_library_path)
+- else:
++ elif 'RUN' not in env:
+ env['LD_LIBRARY_PATH'] = self.library_path
+
+ if ldflags:
+--
+2.15.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
new file mode 100644
index 000000000..9fc1421fd
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch
@@ -0,0 +1,127 @@
+From ef832a115b40861c08df333339b1366da49e5393 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 17 Apr 2016 12:35:41 -0700
+Subject: [PATCH 9/9] WebKitMacros: Append to -I and not to -isystem
+
+gcc-6 has now introduced stdlib.h in libstdc++ for better
+compliance and its including the C library stdlib.h using
+include_next which is sensitive to order of system header
+include paths. Its infact better to not tinker with the
+system header include paths at all. Since adding /usr/include
+to -system is redundant and compiler knows about it moreover
+now with gcc6 it interferes with compiler's functioning
+and ends up with compile errors e.g.
+
+/usr/include/c++/6.0.0/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ Source/JavaScriptCore/shell/CMakeLists.txt | 2 +-
+ Source/WebCore/PlatformGTK.cmake | 6 +++---
+ Source/WebKit/PlatformGTK.cmake | 2 +-
+ Source/cmake/WebKitMacros.cmake | 2 +-
+ Tools/MiniBrowser/gtk/CMakeLists.txt | 2 +-
+ Tools/TestWebKitAPI/PlatformGTK.cmake | 2 +-
+ 6 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
+index bc37dd31..4e49871f 100644
+--- a/Source/JavaScriptCore/shell/CMakeLists.txt
++++ b/Source/JavaScriptCore/shell/CMakeLists.txt
+@@ -35,7 +35,7 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
+ WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
+ WEBKIT_WRAP_SOURCELIST(${TESTAPI_SOURCES})
+ include_directories(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
+-include_directories(SYSTEM ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
++include_directories(${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES})
+ add_executable(jsc ${JSC_SOURCES})
+ target_link_libraries(jsc ${JSC_LIBRARIES})
+
+diff --git a/Source/WebCore/PlatformGTK.cmake b/Source/WebCore/PlatformGTK.cmake
+index 73506c74..8eb8b415 100644
+--- a/Source/WebCore/PlatformGTK.cmake
++++ b/Source/WebCore/PlatformGTK.cmake
+@@ -281,7 +281,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
+ ${GTK2_INCLUDE_DIRS}
+ ${GDK2_INCLUDE_DIRS}
+ )
+- target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
++ target_include_directories(WebCorePlatformGTK2 PRIVATE
+ ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+ )
+ target_link_libraries(WebCorePlatformGTK2
+@@ -305,7 +305,7 @@ add_dependencies(WebCorePlatformGTK WebCore)
+ target_include_directories(WebCorePlatformGTK PRIVATE
+ ${WebCore_INCLUDE_DIRECTORIES}
+ )
+-target_include_directories(WebCorePlatformGTK SYSTEM PRIVATE
++target_include_directories(WebCorePlatformGTK PRIVATE
+ ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+ ${GTK_INCLUDE_DIRS}
+ ${GDK_INCLUDE_DIRS}
+@@ -321,7 +321,7 @@ include_directories(
+ "${WEBCORE_DIR}/bindings/gobject/"
+ )
+
+-include_directories(SYSTEM
++include_directories(
+ ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+ )
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index d83a2e77..401246f4 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1050,7 +1050,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
+ target_include_directories(WebKitPluginProcess2 PRIVATE
+ ${WebKit2CommonIncludeDirectories}
+ )
+- target_include_directories(WebKitPluginProcess2 SYSTEM PRIVATE
++ target_include_directories(WebKitPluginProcess2 PRIVATE
+ ${WebKit2CommonSystemIncludeDirectories}
+ ${GTK2_INCLUDE_DIRS}
+ ${GDK2_INCLUDE_DIRS}
+diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake
+index 7bc89543..d9818fa4 100644
+--- a/Source/cmake/WebKitMacros.cmake
++++ b/Source/cmake/WebKitMacros.cmake
+@@ -78,7 +78,7 @@ macro(WEBKIT_FRAMEWORK_DECLARE _target)
+ endmacro()
+
+ macro(WEBKIT_FRAMEWORK _target)
+- include_directories(SYSTEM ${${_target}_SYSTEM_INCLUDE_DIRECTORIES})
++ include_directories(${${_target}_SYSTEM_INCLUDE_DIRECTORIES})
+ target_sources(${_target} PRIVATE
+ ${${_target}_HEADERS}
+ ${${_target}_SOURCES}
+diff --git a/Tools/MiniBrowser/gtk/CMakeLists.txt b/Tools/MiniBrowser/gtk/CMakeLists.txt
+index e832a86d..ce92c864 100644
+--- a/Tools/MiniBrowser/gtk/CMakeLists.txt
++++ b/Tools/MiniBrowser/gtk/CMakeLists.txt
+@@ -57,7 +57,7 @@ endif ()
+ add_definitions(-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6)
+
+ include_directories(${MiniBrowser_INCLUDE_DIRECTORIES})
+-include_directories(SYSTEM ${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
++include_directories(${MiniBrowser_SYSTEM_INCLUDE_DIRECTORIES})
+ add_executable(MiniBrowser ${MiniBrowser_SOURCES})
+ target_link_libraries(MiniBrowser ${MiniBrowser_LIBRARIES})
+
+diff --git a/Tools/TestWebKitAPI/PlatformGTK.cmake b/Tools/TestWebKitAPI/PlatformGTK.cmake
+index 1be3dd52..7bdddf37 100644
+--- a/Tools/TestWebKitAPI/PlatformGTK.cmake
++++ b/Tools/TestWebKitAPI/PlatformGTK.cmake
+@@ -20,7 +20,7 @@ include_directories(
+ ${WEBKIT2_DIR}/UIProcess/API/gtk
+ )
+
+-include_directories(SYSTEM
++include_directories(
+ ${GDK3_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+ ${GTK3_INCLUDE_DIRS}
+--
+2.14.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
new file mode 100644
index 000000000..fb4c4dc93
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch
@@ -0,0 +1,41 @@
+From 98b1359a0cd87bbdb22cef98ba594440f4c57d92 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 28 Oct 2015 14:18:57 +0200
+Subject: [PATCH 2/9] When building introspection files, add CMAKE_C_FLAGS to
+ the compiler flags.
+
+g-ir-compiler is using a C compiler internally, so it needs to set
+the proper flags for it.
+
+Upstream-Status: Pending [review on oe-core list]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/WebKit/PlatformGTK.cmake | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WebKit/PlatformGTK.cmake b/Source/WebKit/PlatformGTK.cmake
+index 7f92ae72..a33c6a86 100644
+--- a/Source/WebKit/PlatformGTK.cmake
++++ b/Source/WebKit/PlatformGTK.cmake
+@@ -1126,7 +1126,7 @@ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
+ DEPENDS WebKit2
+ DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations LDFLAGS=
++ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS} LDFLAGS=
+ ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+ ${INTROSPECTION_SCANNER}
+ --quiet
+@@ -1169,7 +1169,7 @@ add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/WebKit2WebExtension-${WEBKITGTK_API_VERSION}.gir
+ DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+ DEPENDS ${CMAKE_BINARY_DIR}/WebKit2-${WEBKITGTK_API_VERSION}.gir
+- COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations
++ COMMAND CC=${CMAKE_C_COMPILER} CFLAGS=-Wno-deprecated-declarations\ ${CMAKE_C_FLAGS}
+ LDFLAGS="${INTROSPECTION_ADDITIONAL_LDFLAGS}"
+ ${LOADER_LIBRARY_PATH_VAR}="${INTROSPECTION_ADDITIONAL_LIBRARY_PATH}"
+ ${INTROSPECTION_SCANNER}
+--
+2.14.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch b/poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch
new file mode 100644
index 000000000..4d1de7285
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/cross-compile.patch
@@ -0,0 +1,23 @@
+Disable the tests meant to run when compiling natively
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: webkitgtk-2.14.5/Source/cmake/OptionsCommon.cmake
+===================================================================
+--- webkitgtk-2.14.5.orig/Source/cmake/OptionsCommon.cmake
++++ webkitgtk-2.14.5/Source/cmake/OptionsCommon.cmake
+@@ -67,8 +67,11 @@ endif ()
+ # Detect Cortex-A53 core if CPU is ARM64 and OS is Linux.
+ # Query /proc/cpuinfo for each available core and check reported CPU part number: 0xd03 signals Cortex-A53.
+ # (see Main ID Register in ARM Cortex-A53 MPCore Processor Technical Reference Manual)
+-set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE OFF)
+-if (WTF_CPU_ARM64 AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
++if( NOT WTF_CPU_ARM64_CORTEXA53_INITIALVALUE)
++ set(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE OFF)
++endif(WTF_CPU_ARM64_CORTEXA53_INITIALVALUE)
++
++if (WTF_CPU_ARM64 AND NOT CMAKE_CROSSCOMPILING AND (${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
+ execute_process(COMMAND nproc OUTPUT_VARIABLE PROC_COUNT)
+ math(EXPR PROC_MAX ${PROC_COUNT}-1)
+ foreach (PROC_ID RANGE ${PROC_MAX})
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch b/poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch
new file mode 100644
index 000000000..c6157e103
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/detect-atomics-during-configure.patch
@@ -0,0 +1,46 @@
+From 0b3811771ae6385503f2d949f9433d8f810d2ff9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 17 May 2017 22:34:24 -0700
+Subject: [PATCH 8/9] webkitgtk: Fix build for armv5
+
+Taken from
+https://bugs.webkit.org/show_bug.cgi?id=161900
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ Source/WTF/wtf/CMakeLists.txt | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt
+index 6b5e45b9..46ee3c22 100644
+--- a/Source/WTF/wtf/CMakeLists.txt
++++ b/Source/WTF/wtf/CMakeLists.txt
+@@ -205,7 +205,6 @@ set(WTF_HEADERS
+
+ set(WTF_SOURCES
+ Assertions.cpp
+- Atomics.cpp
+ AutomaticThread.cpp
+ BitVector.cpp
+ CPUTime.cpp
+@@ -336,6 +335,15 @@ if (NOT USE_SYSTEM_MALLOC)
+ list(APPEND WTF_LIBRARIES bmalloc)
+ endif ()
+
++file(WRITE ${CMAKE_BINARY_DIR}/test_atomics.cpp
++ "int main(void)\n"
++ "{ long long x = 1; return (int) __sync_add_and_fetch_8(&x, 1); }\n")
++try_compile(ATOMICS_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/test_atomics.cpp)
++if (NOT ATOMICS_BUILD_SUCCEEDED)
++ list(APPEND WTF_SOURCES Atomics.cpp)
++endif ()
++file(REMOVE ${CMAKE_BINARY_DIR}/test_atomics.cpp)
++
+ list(APPEND WTF_SOURCES
+ unicode/icu/CollatorICU.cpp
+ )
+--
+2.14.1
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/fix-configure-failure-aarch64.patch b/poky/meta/recipes-sato/webkit/webkitgtk/fix-configure-failure-aarch64.patch
new file mode 100644
index 000000000..4a6ab544b
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/fix-configure-failure-aarch64.patch
@@ -0,0 +1,29 @@
+Fix configure failure for aarch64
+
+| -- Performing Test CXX_COMPILER_SUPPORTS_-fcolor-diagnostics - Failed
+| -- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always
+| -- Performing Test CXX_COMPILER_SUPPORTS_-fdiagnostics-color=always - Success
+| CMake Error at Source/cmake/OptionsCommon.cmake:42 (WEBKIT_PREPEND_GLOBAL_COMPILER_FLAG):
+| Unknown CMake command "WEBKIT_PREPEND_GLOBAL_COMPILER_FLAG".
+| Call Stack (most recent call first):
+| Source/cmake/WebKitCommon.cmake:58 (include)
+| CMakeLists.txt:166 (include)
+|
+
+Upstream-Status: Pending
+
+Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
+
+Index: webkitgtk-2.14.6/Source/cmake/OptionsCommon.cmake
+===================================================================
+--- webkitgtk-2.14.6.orig/Source/cmake/OptionsCommon.cmake 2018-02-15 18:56:29.315238564 -0800
++++ webkitgtk-2.14.6/Source/cmake/OptionsCommon.cmake 2018-02-15 18:54:57.469518064 -0800
+@@ -39,7 +39,7 @@
+ if (NOT WTF_CPU_ARM64)
+ message(FATAL_ERROR "WTF_CPU_ARM64_CORTEXA53 set without WTF_CPU_ARM64")
+ endif ()
+- WEBKIT_PREPEND_GLOBAL_COMPILER_FLAG(-mfix-cortex-a53-835769)
++ WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-mfix-cortex-a53-835769)
+ endif ()
+
+ EXPOSE_VARIABLE_TO_BUILD(WTF_CPU_ARM64_CORTEXA53)
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch b/poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch
new file mode 100644
index 000000000..5f2383758
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk/x32_support.patch
@@ -0,0 +1,21 @@
+From: Daniel Schepler <dschepler@gmail.com>
+Subject: Fix FTBFS in x32
+Bug-Debian: https://bugs.debian.org/700795
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Index: webkitgtk-2.16.1/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk-2.16.1.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk-2.16.1/Source/WTF/wtf/Platform.h
+@@ -172,7 +172,11 @@
+ /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
+ #if defined(__x86_64__) \
+ || defined(_M_X64)
++#ifdef __ILP32__
++#define WTF_CPU_X86_64_32 1
++#else
+ #define WTF_CPU_X86_64 1
++#endif
+ #define WTF_CPU_X86_SSE2 1
+ #endif
+
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk_2.18.6.bb b/poky/meta/recipes-sato/webkit/webkitgtk_2.18.6.bb
new file mode 100644
index 000000000..c29fa7f4c
--- /dev/null
+++ b/poky/meta/recipes-sato/webkit/webkitgtk_2.18.6.bb
@@ -0,0 +1,123 @@
+SUMMARY = "WebKit web rendering engine for the GTK+ platform"
+HOMEPAGE = "http://www.webkitgtk.org/"
+BUGTRACKER = "http://bugs.webkit.org/"
+
+LICENSE = "BSD & LGPLv2+"
+LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d84286dda758da57bd691 \
+ file://Source/WebCore/LICENSE-APPLE;md5=4646f90082c40bcf298c285f8bab0b12 \
+ file://Source/WebCore/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
+ file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
+ "
+
+SRC_URI = "http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
+ file://0001-FindGObjectIntrospection.cmake-prefix-variables-obta.patch \
+ file://0001-When-building-introspection-files-add-CMAKE_C_FLAGS-.patch \
+ file://0001-OptionsGTK.cmake-drop-the-hardcoded-introspection-gt.patch \
+ file://0001-Fix-racy-parallel-build-of-WebKit2-4.0.gir.patch \
+ file://0001-Tweak-gtkdoc-settings-so-that-gtkdoc-generation-work.patch \
+ file://x32_support.patch \
+ file://cross-compile.patch \
+ file://detect-atomics-during-configure.patch \
+ file://0001-WebKitMacros-Append-to-I-and-not-to-isystem.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://fix-configure-failure-aarch64.patch \
+ file://0001-Fix-gles3-header-when-gles2-is-enabled.patch \
+ "
+
+SRC_URI[md5sum] = "c1a548595135ee75ad3bf2e18ac83112"
+SRC_URI[sha256sum] = "93912cc2f40f12e452be1ca4babdbdaac0ec4f828d441257a6b06c2963bbac3c"
+
+inherit cmake pkgconfig gobject-introspection perlnative distro_features_check upstream-version-is-even gtk-doc
+
+# depends on libxt
+REQUIRED_DISTRO_FEATURES = "x11"
+
+DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn libgcrypt \
+ gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native gperf-native sqlite3 \
+ pango icu bison-native gawk intltool-native libwebp \
+ atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \
+ ruby-native libnotify gstreamer1.0-plugins-bad \
+ gettext-native glib-2.0 glib-2.0-native libtasn1 \
+ "
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
+ enchant \
+ libsecret \
+ "
+
+PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND_TARGET=ON,-DENABLE_WAYLAND_TARGET=OFF,wayland"
+PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/libx11"
+PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
+PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
+PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
+PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
+PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
+PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
+PACKAGECONFIG[libsecret] = "-DUSE_LIBSECRET=ON,-DUSE_LIBSECRET=OFF,libsecret"
+PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen"
+
+EXTRA_OECMAKE = " \
+ -DPORT=GTK \
+ -DCMAKE_BUILD_TYPE=Release \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
+ ${@bb.utils.contains('GTKDOC_ENABLED', 'True', '-DENABLE_GTKDOC=ON', '-DENABLE_GTKDOC=OFF', d)} \
+ -DENABLE_MINIBROWSER=ON \
+ -DPYTHON_EXECUTABLE=`which python` \
+ "
+
+# GL/GLES header clash: both define the same thing, differently, on 32 bit x86
+EXTRA_OECMAKE_append_x86 = " -DUSE_GSTREAMER_GL=OFF "
+EXTRA_OECMAKE_append_x86-x32 = " -DUSE_GSTREAMER_GL=OFF "
+
+# Javascript JIT is not supported on powerpc
+EXTRA_OECMAKE_append_powerpc = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_powerpc64 = " -DENABLE_JIT=OFF "
+
+# ARM JIT code does not build on ARMv4/5/6 anymore
+EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_armv6 = " -DENABLE_JIT=OFF "
+EXTRA_OECMAKE_append_armv4 = " -DENABLE_JIT=OFF "
+
+# binutils 2.25.1 has a bug on aarch64:
+# https://sourceware.org/bugzilla/show_bug.cgi?id=18430
+EXTRA_OECMAKE_append_aarch64 = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_mipsarch = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_powerpc = " -DUSE_LD_GOLD=OFF "
+EXTRA_OECMAKE_append_toolchain-clang = " -DUSE_LD_GOLD=OFF "
+
+EXTRA_OECMAKE_append_aarch64 = " -DWTF_CPU_ARM64_CORTEXA53=ON"
+
+# JIT not supported on MIPS either
+EXTRA_OECMAKE_append_mipsarch = " -DENABLE_JIT=OFF "
+
+# JIT not supported on X32
+# An attempt was made to upstream JIT support for x32 in
+# https://bugs.webkit.org/show_bug.cgi?id=100450, but this was closed as
+# unresolved due to limited X32 adoption.
+EXTRA_OECMAKE_append_x86-x32 = " -DENABLE_JIT=OFF "
+
+SECURITY_CFLAGS_remove_aarch64 = "-fpie"
+SECURITY_CFLAGS_append_aarch64 = " -fPIE"
+
+FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
+
+RRECOMMENDS_${PN} += "ca-certificates shared-mime-info"
+
+# http://errors.yoctoproject.org/Errors/Details/20370/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv6 = "arm"
+
+# https://bugzilla.yoctoproject.org/show_bug.cgi?id=9474
+# https://bugs.webkit.org/show_bug.cgi?id=159880
+# JSC JIT can build on ARMv7 with -marm, but doesn't work on runtime.
+# Upstream only tests regularly the JSC JIT on ARMv7 with Thumb2 (-mthumb).
+ARM_INSTRUCTION_SET_armv7a = "thumb"
+ARM_INSTRUCTION_SET_armv7r = "thumb"
+ARM_INSTRUCTION_SET_armv7ve = "thumb"
+
+# qemu: uncaught target signal 11 (Segmentation fault) - core dumped
+# Segmentation fault
+GI_DATA_ENABLED_armv7a = "False"
+GI_DATA_ENABLED_armv7ve = "False"
diff --git a/poky/meta/recipes-support/apr/apr-util/configfix.patch b/poky/meta/recipes-support/apr/apr-util/configfix.patch
new file mode 100644
index 000000000..dbb114880
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr-util/configfix.patch
@@ -0,0 +1,51 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-util-1.3.4/apu-config.in
+===================================================================
+--- apr-util-1.3.4.orig/apu-config.in 2009-01-12 17:08:06.000000000 +0000
++++ apr-util-1.3.4/apu-config.in 2009-01-12 17:09:00.000000000 +0000
+@@ -134,14 +134,7 @@
+ exit 0
+ ;;
+ --includes)
+- if test "$location" = "installed"; then
+ flags="$flags -I$includedir $INCLUDES"
+- elif test "$location" = "source"; then
+- flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
+- else
+- # this is for VPATH builds
+- flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include $INCLUDES"
+- fi
+ ;;
+ --ldflags)
+ flags="$flags $LDFLAGS"
+@@ -155,28 +148,10 @@
+ exit 0
+ ;;
+ --link-ld)
+- if test "$location" = "installed"; then
+- ### avoid using -L if libdir is a "standard" location like /usr/lib
+ flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
+- else
+- flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
+- fi
+ ;;
+ --link-libtool)
+- # If the LA_FILE exists where we think it should be, use it. If we're
+- # installed and the LA_FILE does not exist, assume to use -L/-l
+- # (the LA_FILE may not have been installed). If we're building ourselves,
+- # we'll assume that at some point the .la file be created.
+- if test -f "$LA_FILE"; then
+- flags="$flags $LA_FILE"
+- elif test "$location" = "installed"; then
+- ### avoid using -L if libdir is a "standard" location like /usr/lib
+- # Since the user is specifying they are linking with libtool, we
+- # *know* that -R will be recognized by libtool.
+- flags="$flags -L$libdir -R$libdir -l$APRUTIL_LIBNAME"
+- else
+- flags="$flags $LA_FILE"
+- fi
++ flags="$flags -l$APRUTIL_LIBNAME"
+ ;;
+ --apu-la-file)
+ if test -f "$LA_FILE"; then
diff --git a/poky/meta/recipes-support/apr/apr-util/configure_fixes.patch b/poky/meta/recipes-support/apr/apr-util/configure_fixes.patch
new file mode 100644
index 000000000..91e244ce2
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr-util/configure_fixes.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-util-1.4.1/configure.in
+===================================================================
+--- apr-util-1.4.1.orig/configure.in 2009-12-18 03:15:19.000000000 +0800
++++ apr-util-1.4.1/configure.in 2011-12-30 13:32:07.000000000 +0800
+@@ -8,15 +8,15 @@
+ AC_CONFIG_HEADER(include/private/apu_config.h)
+ AC_CONFIG_AUX_DIR(build)
+
+-sinclude(build/apu-conf.m4)
+-sinclude(build/apu-iconv.m4)
+-sinclude(build/apu-hints.m4)
+-sinclude(build/apr_common.m4)
+-sinclude(build/find_apr.m4)
+-sinclude(build/crypto.m4)
+-sinclude(build/dbm.m4)
+-sinclude(build/dbd.m4)
+-sinclude(build/dso.m4)
++#sinclude(build/apu-conf.m4)
++#sinclude(build/apu-iconv.m4)
++#sinclude(build/apu-hints.m4)
++#sinclude(build/apr_common.m4)
++#sinclude(build/find_apr.m4)
++#sinclude(build/crypto.m4)
++#sinclude(build/dbm.m4)
++#sinclude(build/dbd.m4)
++#sinclude(build/dso.m4)
+
+ dnl Generate ./config.nice for reproducing runs of configure
+ dnl
diff --git a/poky/meta/recipes-support/apr/apr-util/run-ptest b/poky/meta/recipes-support/apr/apr-util/run-ptest
new file mode 100644
index 000000000..ae19a1d11
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr-util/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd test
+./testall |sed \
+ -e 's|\(.*\): SUCCESS|PASS: \1|' \
+ -e 's|\(.*\): FAILED|FAIL: \1|'
diff --git a/poky/meta/recipes-support/apr/apr-util_1.6.1.bb b/poky/meta/recipes-support/apr/apr-util_1.6.1.bb
new file mode 100644
index 000000000..88b4300f9
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr-util_1.6.1.bb
@@ -0,0 +1,93 @@
+SUMMARY = "Apache Portable Runtime (APR) companion library"
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+DEPENDS = "apr expat gdbm"
+
+BBCLASSEXTEND = "native nativesdk"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=158aa0b1efe0c12f23d4b007ddb9a5db \
+ file://include/apu_version.h;endline=17;md5=806685a84e71f10c80144c48eb35df42"
+
+SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.gz \
+ file://configfix.patch \
+ file://configure_fixes.patch \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "bd502b9a8670a8012c4d90c31a84955f"
+SRC_URI[sha256sum] = "b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459"
+
+EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
+ --without-odbc \
+ --without-pgsql \
+ --with-dbm=gdbm \
+ --with-gdbm=${STAGING_DIR_HOST}${prefix} \
+ --without-sqlite2 \
+ --with-expat=${STAGING_DIR_HOST}${prefix}"
+
+
+inherit autotools lib_package binconfig
+
+OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
+
+do_configure_append() {
+ if [ "${CLASSOVERRIDE}" = "class-target" ]; then
+ cp ${STAGING_DATADIR}/apr/apr_rules.mk ${B}/build/rules.mk
+ fi
+}
+do_configure_prepend_class-native() {
+ mkdir ${B}/build
+ cp ${STAGING_DATADIR_NATIVE}/apr/apr_rules.mk ${B}/build/rules.mk
+}
+do_configure_append_class-native() {
+ sed -i "s#LIBTOOL=\$(SHELL) \$(apr_builddir)#LIBTOOL=\$(SHELL) ${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
+ # sometimes there isn't SHELL
+ sed -i "s#LIBTOOL=\$(apr_builddir)#LIBTOOL=${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
+}
+
+do_configure_prepend_class-nativesdk() {
+ cp ${STAGING_DATADIR}/apr/apr_rules.mk ${S}/build/rules.mk
+}
+
+do_configure_append_class-nativesdk() {
+ sed -i "s#\(apr_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
+ sed -i "s#\(apr_builders\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
+ sed -i "s#\(top_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
+ sed -i "s#\(LIBTOOL=\$(apr_builddir)\).*#\1/libtool#" ${B}/build/rules.mk
+}
+
+do_install_append_class-target() {
+ sed -i -e 's,${STAGING_DIR_HOST},,g' \
+ -e 's,APU_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
+ -e 's,APU_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apu-1-config
+}
+
+PACKAGECONFIG ??= "crypto"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[crypto] = "--with-openssl=${STAGING_DIR_HOST}${prefix} --with-crypto,--without-crypto,openssl"
+PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_DIR_HOST}${prefix},--without-sqlite3,sqlite3"
+
+#files ${libdir}/apr-util-1/*.so are not symlinks but loadable modules thus they are packaged in ${PN}
+FILES_${PN} += "${libdir}/apr-util-1/apr*${SOLIBS} ${libdir}/apr-util-1/apr*${SOLIBSDEV}"
+FILES_${PN}-dev += "${libdir}/aprutil.exp ${libdir}/apr-util-1/*.la"
+FILES_${PN}-staticdev += "${libdir}/apr-util-1/*.a"
+
+INSANE_SKIP_${PN} += "dev-so"
+
+inherit ptest
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-iso8859-1 glibc-gconv-iso8859-2 glibc-gconv-utf-7"
+
+do_compile_ptest() {
+ cd ${B}/test
+ oe_runmake
+}
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}/test
+ mkdir $t
+ for i in testall data; do \
+ cp -r ${B}/test/$i $t; \
+ done
+}
diff --git a/poky/meta/recipes-support/apr/apr/0001-build-buildcheck.sh-improve-libtool-detection.patch b/poky/meta/recipes-support/apr/apr/0001-build-buildcheck.sh-improve-libtool-detection.patch
new file mode 100644
index 000000000..097c195a1
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0001-build-buildcheck.sh-improve-libtool-detection.patch
@@ -0,0 +1,32 @@
+From 4efdc06fb17b8a00a9eca923caa176be741d1e04 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Feb 2018 14:56:13 +0800
+Subject: [PATCH 1/7] build/buildcheck.sh: improve libtool detection
+
+Support customize libtool by variable assigning, it is helpful
+for cross compileing (such as libtool=aarch64-linux-libtool)
+
+Upstream-Status: Submitted [https://github.com/apache/apr/pull/8]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ build/buildcheck.sh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/build/buildcheck.sh b/build/buildcheck.sh
+index ab5df44..f191a41 100755
+--- a/build/buildcheck.sh
++++ b/build/buildcheck.sh
+@@ -40,7 +40,9 @@ fi
+ # output is multiline from 1.5 onwards
+
+ # Require libtool 1.4 or newer
+-libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
++if test -z "$libtool"; then
++ libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
++fi
+ lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
+ if test -z "$lt_pversion"; then
+ echo "buildconf: libtool not found."
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0002-apr-Remove-workdir-path-references-from-installed-ap.patch b/poky/meta/recipes-support/apr/apr/0002-apr-Remove-workdir-path-references-from-installed-ap.patch
new file mode 100644
index 000000000..72e706f96
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0002-apr-Remove-workdir-path-references-from-installed-ap.patch
@@ -0,0 +1,74 @@
+From 5925b20da8bbc34d9bf5a5dca123ef38864d43c6 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 30 Jan 2018 09:39:06 +0800
+Subject: [PATCH 2/7] apr: Remove workdir path references from installed apr
+ files
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+The generated `apr-1-config' is used by other recipes at build time or
+packages at target run time, the workdir path caused confusion.
+
+Rebase to 1.6.3
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ apr-config.in | 26 ++------------------------
+ 1 file changed, 2 insertions(+), 24 deletions(-)
+
+diff --git a/apr-config.in b/apr-config.in
+index 84b4073..bbbf651 100644
+--- a/apr-config.in
++++ b/apr-config.in
+@@ -152,14 +152,7 @@ while test $# -gt 0; do
+ flags="$flags $LDFLAGS"
+ ;;
+ --includes)
+- if test "$location" = "installed"; then
+ flags="$flags -I$includedir $EXTRA_INCLUDES"
+- elif test "$location" = "source"; then
+- flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
+- else
+- # this is for VPATH builds
+- flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
+- fi
+ ;;
+ --srcdir)
+ echo $APR_SOURCE_DIR
+@@ -181,29 +174,14 @@ while test $# -gt 0; do
+ exit 0
+ ;;
+ --link-ld)
+- if test "$location" = "installed"; then
+- ### avoid using -L if libdir is a "standard" location like /usr/lib
+- flags="$flags -L$libdir -l${APR_LIBNAME}"
+- else
+- ### this surely can't work since the library is in .libs?
+- flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
+- fi
++ flags="$flags -l${APR_LIBNAME}"
+ ;;
+ --link-libtool)
+ # If the LA_FILE exists where we think it should be, use it. If we're
+ # installed and the LA_FILE does not exist, assume to use -L/-l
+ # (the LA_FILE may not have been installed). If we're building ourselves,
+ # we'll assume that at some point the .la file be created.
+- if test -f "$LA_FILE"; then
+- flags="$flags $LA_FILE"
+- elif test "$location" = "installed"; then
+- ### avoid using -L if libdir is a "standard" location like /usr/lib
+- # Since the user is specifying they are linking with libtool, we
+- # *know* that -R will be recognized by libtool.
+- flags="$flags -L$libdir -R$libdir -l${APR_LIBNAME}"
+- else
+- flags="$flags $LA_FILE"
+- fi
++ flags="$flags -l${APR_LIBNAME}"
+ ;;
+ --shlib-path-var)
+ echo "$SHLIBPATH_VAR"
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0003-Makefile.in-configure.in-support-cross-compiling.patch b/poky/meta/recipes-support/apr/apr/0003-Makefile.in-configure.in-support-cross-compiling.patch
new file mode 100644
index 000000000..4dd53bd8e
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0003-Makefile.in-configure.in-support-cross-compiling.patch
@@ -0,0 +1,63 @@
+From d5028c10f156c224475b340cfb1ba025d6797243 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 2 Feb 2018 15:51:42 +0800
+Subject: [PATCH 3/7] Makefile.in/configure.in: support cross compiling
+
+While cross compiling, the tools/gen_test_char could not
+be executed at build time, use AX_PROG_CC_FOR_BUILD to
+build native tools/gen_test_char
+
+Upstream-Status: Submitted [https://github.com/apache/apr/pull/8]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 10 +++-------
+ configure.in | 3 +++
+ 2 files changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 5fb760e..8675f90 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -46,7 +46,7 @@ LT_VERSION = @LT_VERSION@
+
+ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
+ build/apr_rules.out tools/gen_test_char@EXEEXT@ \
+- tools/gen_test_char.o tools/gen_test_char.lo \
++ tools/gen_test_char.o \
+ include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+ include/apr.h include/arch/unix/apr_private.h \
+@@ -131,13 +131,9 @@ check: $(TARGET_LIB)
+ etags:
+ etags `find . -name '*.[ch]'`
+
+-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
+-tools/gen_test_char.lo: tools/gen_test_char.c
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
+ $(APR_MKDIR) tools
+- $(LT_COMPILE)
+-
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+- $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
+
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+ $(APR_MKDIR) include/private
+diff --git a/configure.in b/configure.in
+index 719f331..361120f 100644
+--- a/configure.in
++++ b/configure.in
+@@ -183,6 +183,9 @@ dnl can only be used once within a configure script, so this prevents a
+ dnl preload section from invoking the macro to get compiler info.
+ AC_PROG_CC
+
++dnl Check build CC for gen_test_char compiling which is executed at build time.
++AX_PROG_CC_FOR_BUILD
++
+ dnl AC_PROG_SED is only avaliable in recent autoconf versions.
+ dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present.
+ ifdef([AC_PROG_SED],
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0004-Fix-packet-discards-HTTP-redirect.patch b/poky/meta/recipes-support/apr/apr/0004-Fix-packet-discards-HTTP-redirect.patch
new file mode 100644
index 000000000..30fc07d4a
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0004-Fix-packet-discards-HTTP-redirect.patch
@@ -0,0 +1,39 @@
+From 7925eb1766a00ccee05c6e80b1d34f163a04b7b1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 30 Jan 2018 09:43:34 +0800
+Subject: [PATCH 4/7] Fix packet discards HTTP redirect.
+
+Disconnect the connection by poll() timeout.
+If timeout=0 and apr_wait_for_io_or_timeout()=APR_TIMEUP then
+apr_socket_recv() returns EAGAIN.
+
+Upstream-Status: Pending
+
+Signed-off-by: Noriaki Yoshitane <yoshitane.nrs@cnt.ncos.nec.co.jp>
+Signed-off-by: Li Wang <li.wang@windriver.com>
+
+Rebase to 1.6.3
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ network_io/unix/sendrecv.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
+index 4c0e0a6..1bdafba 100644
+--- a/network_io/unix/sendrecv.c
++++ b/network_io/unix/sendrecv.c
+@@ -85,6 +85,10 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
+ && (sock->timeout > 0)) {
+ do_select:
+ arv = apr_wait_for_io_or_timeout(NULL, sock, 1);
++ if ((arv == APR_TIMEUP) && (sock->timeout == 0)) {
++ *len = 0;
++ return EAGAIN;
++ }
+ if (arv != APR_SUCCESS) {
+ *len = 0;
+ return arv;
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch b/poky/meta/recipes-support/apr/apr/0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch
new file mode 100644
index 000000000..02634e6fd
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch
@@ -0,0 +1,36 @@
+From 2e66cece0c3adff92733332111204ddc1d730a07 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 19 Nov 2015 18:25:38 -0800
+Subject: [PATCH 5/7] configure.in: fix LTFLAGS to make it work with ccache
+
+When ccache is enabled, libtool requires --tag=CC when use ccache,
+otherwise when building apr-util with ccache enabled:
+
+| libtool: compile: unable to infer tagged configuration
+| libtool: error: specify a tag with '--tag'
+| libtool: compile: unable to infer tagged configuration
+| make[1]: *** [buckets/apr_buckets.lo] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 361120f..3b10422 100644
+--- a/configure.in
++++ b/configure.in
+@@ -249,7 +249,7 @@ case $host in
+ ;;
+ *)
+ if test "x$LTFLAGS" = "x"; then
+- LTFLAGS='--silent'
++ LTFLAGS='--silent --tag=CC'
+ fi
+ if test "$experimental_libtool" = "yes"; then
+ # Use a custom-made libtool replacement
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch b/poky/meta/recipes-support/apr/apr/0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
new file mode 100644
index 000000000..5f5e7eac3
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch
@@ -0,0 +1,78 @@
+From f4d6e45ed5d2ccffd1af4c2ccdf7099ba0dce137 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 14 Dec 2016 18:13:08 +0800
+Subject: [PATCH 6/7] apr: fix off_t size doesn't match in glibc when cross
+ compiling
+
+In configure.in, it contains the following:
+
+ APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
+
+the macro "APR_CHECK_SIZEOF_EXTENDED" was defined in build/apr_common.m4,
+it use the "AC_TRY_RUN" macro, this macro let the off_t to 8, when cross
+compiling enable.
+
+So it was hardcoded for cross compiling, we should detect it dynamic based on
+the sysroot's glibc. We change it to the following:
+
+ AC_CHECK_SIZEOF(off_t)
+
+The same for the following hardcoded types for cross compiling:
+
+ pid_t 8
+ ssize_t 8
+ size_t 8
+ off_t 8
+
+Change the above correspondingly.
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+
+Upstream-Status: Pending
+---
+ configure.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 3b10422..a227e72 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1769,7 +1769,7 @@ else
+ socklen_t_value="int"
+ fi
+
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], pid_t, 8)
++AC_CHECK_SIZEOF(pid_t)
+
+ if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_short"; then
+ pid_t_fmt='#define APR_PID_T_FMT "hd"'
+@@ -1838,7 +1838,7 @@ APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])
+ APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"])
+ APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"])
+
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
++AC_CHECK_SIZEOF(ssize_t)
+
+ AC_MSG_CHECKING([which format to use for apr_ssize_t])
+ if test -n "$ssize_t_fmt"; then
+@@ -1855,7 +1855,7 @@ fi
+
+ ssize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""
+
+-APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
++AC_CHECK_SIZEOF(size_t)
+
+ AC_MSG_CHECKING([which format to use for apr_size_t])
+ if test -n "$size_t_fmt"; then
+@@ -1872,7 +1872,7 @@ fi
+
+ size_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\""
+
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)
++AC_CHECK_SIZEOF(off_t)
+
+ if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then
+ # Enable LFS
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch b/poky/meta/recipes-support/apr/apr/0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch
new file mode 100644
index 000000000..8760b0140
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch
@@ -0,0 +1,50 @@
+From c6afc4a4a766478cb6aa6b43a50051881b6318d7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Fri, 3 Mar 2017 22:24:17 +0100
+Subject: [PATCH 7/7] explicitly link libapr against phtread to make gold happy
+ on test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_init'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_settype'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutexattr_destroy'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_mutex_trylock'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_attr_setstacksize'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_create'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_join'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_detach'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_sigmask'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_once'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_key_create'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_getspecific'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_key_delete'
+| ../.libs/libapr-1.so: error: undefined reference to 'pthread_setspecific'
+| collect2: error: ld returned 1 exit status
+| Makefile:114: recipe for target 'globalmutexchild' failed
+| make[1]: *** [globalmutexchild] Error 1
+| make[1]: Leaving directory '/home/superandy/tmp/oe-core-glibc/work/cortexa7t2hf-neon-vfpv4-angstrom-linux-gnueabi/apr/1.5.2-r0/apr-1.5.2/test'
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.in b/configure.in
+index a227e72..cbc0f90 100644
+--- a/configure.in
++++ b/configure.in
+@@ -784,6 +784,7 @@ else
+ APR_PTHREADS_CHECK_RESTORE ] )
+ fi
+ if test "$pthreadh" = "1"; then
++ APR_ADDTO(LIBS,[-lpthread])
+ APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
+ APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG
+ APR_CHECK_PTHREAD_RECURSIVE_MUTEX
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/apr/apr/run-ptest b/poky/meta/recipes-support/apr/apr/run-ptest
new file mode 100644
index 000000000..ae19a1d11
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd test
+./testall |sed \
+ -e 's|\(.*\): SUCCESS|PASS: \1|' \
+ -e 's|\(.*\): FAILED|FAIL: \1|'
diff --git a/poky/meta/recipes-support/apr/apr_1.6.3.bb b/poky/meta/recipes-support/apr/apr_1.6.3.bb
new file mode 100644
index 000000000..87b878723
--- /dev/null
+++ b/poky/meta/recipes-support/apr/apr_1.6.3.bb
@@ -0,0 +1,117 @@
+SUMMARY = "Apache Portable Runtime (APR) library"
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+DEPENDS = "util-linux"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4dfd4cd216828c8cae5de5a12f3844c8 \
+ file://include/apr_lib.h;endline=17;md5=ee42fa7575dc40580a9e01c1b75fae96"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
+ file://run-ptest \
+ file://0001-build-buildcheck.sh-improve-libtool-detection.patch \
+ file://0002-apr-Remove-workdir-path-references-from-installed-ap.patch \
+ file://0003-Makefile.in-configure.in-support-cross-compiling.patch \
+ file://0004-Fix-packet-discards-HTTP-redirect.patch \
+ file://0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
+ file://0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch \
+ file://0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch \
+"
+
+SRC_URI[md5sum] = "12f2a349483ad6f12db49ba01fbfdbfa"
+SRC_URI[sha256sum] = "131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172"
+
+inherit autotools-brokensep lib_package binconfig multilib_header ptest
+
+OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
+
+# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
+CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
+
+# Also suppress trying to use sctp.
+#
+CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
+
+CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
+CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
+
+# Otherwise libtool fails to compile apr-utils
+# x86_64-linux-libtool: compile: unable to infer tagged configuration
+# x86_64-linux-libtool: error: specify a tag with '--tag'
+CCACHE = ""
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+do_configure_prepend() {
+ # Avoid absolute paths for grep since it causes failures
+ # when using sstate between different hosts with different
+ # install paths for grep.
+ export GREP="grep"
+
+ cd ${S}
+ libtool='${HOST_SYS}-libtool' ./buildconf
+}
+
+FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
+RDEPENDS_${PN}-dev += "bash"
+
+#for some reason, build/libtool.m4 handled by buildconf still be overwritten
+#when autoconf, so handle it again.
+do_configure_append() {
+ sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
+ sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
+}
+
+do_install_append() {
+ oe_multilib_header apr.h
+ install -d ${D}${datadir}/apr
+}
+
+do_install_append_class-target() {
+ sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \
+ -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
+ sed -i -e 's,${STAGING_DIR_HOST},,g' \
+ -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
+ -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
+}
+
+SSTATE_SCAN_FILES += "apr_rules.mk libtool"
+
+SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
+
+apr_sysroot_preprocess () {
+ d=${SYSROOT_DESTDIR}${datadir}/apr
+ install -d $d/
+ cp ${S}/build/apr_rules.mk $d/
+ sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
+ sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
+ sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
+ sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
+ cp ${S}/build/mkdir.sh $d/
+ cp ${S}/build/make_exports.awk $d/
+ cp ${S}/build/make_var_export.awk $d/
+ cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
+}
+
+do_compile_ptest() {
+ cd ${S}/test
+ oe_runmake
+}
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}/test
+ mkdir -p $t/.libs
+ cp -r ${S}/test/data $t/
+ cp -r ${S}/test/.libs/*.so $t/.libs/
+ cp ${S}/test/proc_child $t/
+ cp ${S}/test/readchild $t/
+ cp ${S}/test/sockchild $t/
+ cp ${S}/test/sockperf $t/
+ cp ${S}/test/testall $t/
+ cp ${S}/test/tryread $t/
+}
+
+export CONFIG_SHELL="/bin/bash"
diff --git a/poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb b/poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
new file mode 100644
index 000000000..21bbcab3d
--- /dev/null
+++ b/poky/meta/recipes-support/argp-standalone/argp-standalone_1.3.bb
@@ -0,0 +1,32 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Glibc hierarchical argument parsing standalone library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/misc/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://argp.h;beginline=1;endline=20;md5=008b7e53dea6f9e1d9fdef0d9cf3184a"
+SECTION = "libs"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/misc/argp-standalone-${PV}.tar.gz \
+ file://0001-throw-in-funcdef.patch \
+ file://0002-isprint.patch \
+ file://out_of_tree_build.patch \
+ "
+SRC_URI[md5sum] = "720704bac078d067111b32444e24ba69"
+SRC_URI[sha256sum] = "dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be"
+
+inherit autotools
+
+CFLAGS += "-fPIC -U__OPTIMIZE__"
+
+RDEPENDS_${PN}-dev = ""
+RDEPENDS_${PN}-staticdev = ""
+
+do_install() {
+ install -D -m 0644 ${B}/libargp.a ${D}${libdir}/libargp.a
+ install -D -m 0644 ${S}/argp.h ${D}${includedir}/argp.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
diff --git a/poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch b/poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
new file mode 100644
index 000000000..a6e2759c5
--- /dev/null
+++ b/poky/meta/recipes-support/argp-standalone/files/0001-throw-in-funcdef.patch
@@ -0,0 +1,84 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+ --jsaw
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100
++++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100
+@@ -560,17 +560,17 @@
+ # endif
+
+ # ifndef ARGP_EI
+-# define ARGP_EI extern __inline__
++# define ARGP_EI extern inline
+ # endif
+
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -582,7 +582,7 @@
+ }
+
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100
++++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100
+@@ -1290,13 +1290,13 @@
+ /* Defined here, in case a user is not inlining the definitions in
+ * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -1310,7 +1310,7 @@
+ }
+
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
diff --git a/poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch b/poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch
new file mode 100644
index 000000000..1c07eea3c
--- /dev/null
+++ b/poky/meta/recipes-support/argp-standalone/files/0002-isprint.patch
@@ -0,0 +1,51 @@
+Subject: restrict value range passed to isprint function
+
+According to C standards isprint argument shall be representable as an
+unsigned char or be equal to EOF, otherwise the behaviour is undefined.
+
+Passing arbitrary ints leads to segfault in nm program from elfutils.
+
+Restrict isprint argument range to values representable by unsigned char.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+
+Taken from buildroot
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+Index: b/argp.h
+===================================================================
+--- a/argp.h
++++ b/argp.h
+@@ -23,6 +23,7 @@
+
+ #include <stdio.h>
+ #include <ctype.h>
++#include <limits.h>
+
+ #define __need_error_t
+ #include <errno.h>
+@@ -577,7 +578,7 @@
+ else
+ {
+ int __key = __opt->key;
+- return __key > 0 && isprint (__key);
++ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+ }
+
+Index: b/argp-parse.c
+===================================================================
+--- a/argp-parse.c
++++ b/argp-parse.c
+@@ -1292,7 +1292,7 @@
+ int __key = __opt->key;
+ /* FIXME: whether or not a particular key implies a short option
+ * ought not to be locale dependent. */
+- return __key > 0 && isprint (__key);
++ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+ }
+
diff --git a/poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch b/poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch
new file mode 100644
index 000000000..b7777cbd9
--- /dev/null
+++ b/poky/meta/recipes-support/argp-standalone/files/out_of_tree_build.patch
@@ -0,0 +1,19 @@
+Fix the testsuite to built out of tree
+in OE S != B
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: argp-standalone-1.3/testsuite/Makefile.am
+===================================================================
+--- argp-standalone-1.3.orig/testsuite/Makefile.am
++++ argp-standalone-1.3/testsuite/Makefile.am
+@@ -5,7 +5,8 @@ TS_ALL = $(TS_PROGS) $(TS_SH)
+
+ noinst_PROGRAMS = $(TS_PROGS) ex1 ex3 ex4
+
+-LDADD = ../libargp.a
++AM_CPPFLAGS = -I$(top_srcdir)
++LDADD = $(top_builddir)/libargp.a
+
+ EXTRA_DIST = $(TS_SH) run-tests
+ CLEANFILES = test.out
diff --git a/poky/meta/recipes-support/aspell/aspell/gcc7.patch b/poky/meta/recipes-support/aspell/aspell/gcc7.patch
new file mode 100644
index 000000000..6ffd0772f
--- /dev/null
+++ b/poky/meta/recipes-support/aspell/aspell/gcc7.patch
@@ -0,0 +1,40 @@
+From 8089fa02122fed0a6394eba14bbedcb1d18e2384 Mon Sep 17 00:00:00 2001
+From: Kevin Atkinson <kevina@gnu.org>
+Date: Thu, 29 Dec 2016 00:50:31 -0500
+Subject: [PATCH] Compile Fixes for GCC 7.
+
+Closes #519.
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ modules/filter/tex.cpp | 2 +-
+ prog/check_funs.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/filter/tex.cpp b/modules/filter/tex.cpp
+index a979539..19ab63c 100644
+--- a/modules/filter/tex.cpp
++++ b/modules/filter/tex.cpp
+@@ -174,7 +174,7 @@ namespace {
+
+ if (c == '{') {
+
+- if (top.in_what == Parm || top.in_what == Opt || top.do_check == '\0')
++ if (top.in_what == Parm || top.in_what == Opt || *top.do_check == '\0')
+ push_command(Parm);
+
+ top.in_what = Parm;
+diff --git a/prog/check_funs.cpp b/prog/check_funs.cpp
+index db54f3d..89ee09d 100644
+--- a/prog/check_funs.cpp
++++ b/prog/check_funs.cpp
+@@ -647,7 +647,7 @@ static void print_truncate(FILE * out, const char * word, int width) {
+ }
+ }
+ if (i == width-1) {
+- if (word == '\0')
++ if (*word == '\0')
+ put(out,' ');
+ else if (word[len] == '\0')
+ put(out, word, len);
diff --git a/poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb b/poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb
new file mode 100644
index 000000000..19a7155d6
--- /dev/null
+++ b/poky/meta/recipes-support/aspell/aspell_0.60.6.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "GNU Aspell spell-checker"
+SECTION = "console/utils"
+
+LICENSE = "LGPLv2 | LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz \
+ file://gcc7.patch \
+ "
+SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7"
+SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses"
+
+PACKAGES += "libaspell libpspell aspell-utils"
+
+RDEPENDS_${PN}-utils += "perl"
+
+FILES_libaspell = "${libdir}/libaspell.so.* ${libdir}/aspell*"
+FILES_aspell-utils = "${bindir}/word-list-compress ${bindir}/aspell-import ${bindir}/run-with-aspell ${bindir}/pre*"
+FILES_${PN} = "${bindir}/aspell"
+FILES_libpspell = "${libdir}/libpspell.so.*"
+FILES_${PN}-dev += "${bindir}/pspell-config"
+
+ARM_INSTRUCTION_SET = "arm"
+inherit autotools-brokensep gettext texinfo binconfig-disabled
+
+BINCONFIG = "${bindir}/pspell-config"
diff --git a/poky/meta/recipes-support/atk/at-spi2-atk_2.26.1.bb b/poky/meta/recipes-support/atk/at-spi2-atk_2.26.1.bb
new file mode 100644
index 000000000..8617bb871
--- /dev/null
+++ b/poky/meta/recipes-support/atk/at-spi2-atk_2.26.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "AT-SPI 2 Toolkit Bridge"
+HOMEPAGE = "https://wiki.linuxfoundation.org/accessibility/d-bus"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "eeec6cead3350dca48a235271c105b3e"
+SRC_URI[sha256sum] = "b4f0c27b61dbffba7a5b5ba2ff88c8cee10ff8dac774fa5b79ce906853623b75"
+
+DEPENDS = "dbus glib-2.0 glib-2.0-native atk at-spi2-core"
+
+inherit autotools pkgconfig distro_features_check upstream-version-is-even
+
+# The at-spi2-core requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES =+ "${PN}-gnome ${PN}-gtk2"
+
+FILES_${PN}-gnome = "${libdir}/gnome-settings-daemon-3.0/gtk-modules"
+FILES_${PN}-gtk2 = "${libdir}/gtk-2.0/modules/libatk-bridge.*"
diff --git a/poky/meta/recipes-support/atk/at-spi2-core/0001-build-Add-with-systemduserunitdir.patch b/poky/meta/recipes-support/atk/at-spi2-core/0001-build-Add-with-systemduserunitdir.patch
new file mode 100644
index 000000000..1f8c9f374
--- /dev/null
+++ b/poky/meta/recipes-support/atk/at-spi2-core/0001-build-Add-with-systemduserunitdir.patch
@@ -0,0 +1,52 @@
+From fa376762b92404b9e3c430054b8c3341ca0fdd8b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 21 Jun 2016 16:00:02 +0300
+Subject: [PATCH] build: Add --with-systemduserunitdir
+
+Default to "pkg-config --variable=systemduserunitdir systemd" but
+allow overriding the value.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=767911]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ bus/Makefile.am | 2 +-
+ configure.ac | 9 +++++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/bus/Makefile.am b/bus/Makefile.am
+index 688f82a..10cde62 100644
+--- a/bus/Makefile.am
++++ b/bus/Makefile.am
+@@ -29,7 +29,7 @@ org.a11y.Bus.service: org.a11y.Bus.service.in
+ EXTRA_DIST += org.a11y.Bus.service.in
+ CLEANFILES += org.a11y.Bus.service
+
+-systemd_userdir = $(prefix)/lib/systemd/user
++systemd_userdir = $(systemduserunitdir)
+ systemd_user_DATA = at-spi-dbus-bus.service
+ at-spi-dbus-bus.service: at-spi-dbus-bus.service.in Makefile
+ $(AM_V_GEN) $(SED) -e $(substitutions) $< > $@.tmp && mv $@.tmp $@
+diff --git a/configure.ac b/configure.ac
+index 8c4fca2..1415cca 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -146,6 +146,15 @@ else
+ fi
+ AC_SUBST(DBUS_SERVICES_DIR)
+
++AC_ARG_WITH([systemduserunitdir],
++ AS_HELP_STRING([--with-systemduserunitdir=DIR],
++ [Directory for systemd service files]),
++ [],
++ [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
++AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
++
++AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
++
+ GOBJECT_INTROSPECTION_CHECK([1.32.0])
+
+ AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
+--
+2.14.1
+
diff --git a/poky/meta/recipes-support/atk/at-spi2-core_2.26.2.bb b/poky/meta/recipes-support/atk/at-spi2-core_2.26.2.bb
new file mode 100644
index 000000000..521ee3b96
--- /dev/null
+++ b/poky/meta/recipes-support/atk/at-spi2-core_2.26.2.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Assistive Technology Service Provider Interface (dbus core)"
+HOMEPAGE = "https://wiki.linuxfoundation.org/accessibility/d-bus"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+ file://0001-build-Add-with-systemduserunitdir.patch \
+ "
+
+SRC_URI[md5sum] = "4a042e4c801fdb793788b749eab21485"
+SRC_URI[sha256sum] = "c80e0cdf5e3d713400315b63c7deffa561032a6c37289211d8afcfaa267c2615"
+
+DEPENDS = "dbus glib-2.0 virtual/libx11 libxi libxtst"
+
+inherit autotools gtk-doc gettext systemd pkgconfig distro_features_check upstream-version-is-even gobject-introspection
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = " \
+ --with-systemduserunitdir=${systemd_user_unitdir} \
+ --with-dbus-daemondir=${bindir}"
+
+FILES_${PN} += "${datadir}/dbus-1/services/*.service \
+ ${datadir}/dbus-1/accessibility-services/*.service \
+ ${datadir}/defaults/at-spi2 \
+ ${systemd_user_unitdir}/at-spi-dbus-bus.service \
+ "
diff --git a/poky/meta/recipes-support/atk/atk_2.26.1.bb b/poky/meta/recipes-support/atk/atk_2.26.1.bb
new file mode 100644
index 000000000..685b5991d
--- /dev/null
+++ b/poky/meta/recipes-support/atk/atk_2.26.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Accessibility toolkit for GNOME"
+HOMEPAGE = "http://live.gnome.org/GAP/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/libs"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://atk/atkutil.c;endline=18;md5=6fd31cd2fdc9b30f619ca8d819bc12d3 \
+ file://atk/atk.h;endline=18;md5=fcd7710187e0eae485e356c30d1b0c3b"
+
+DEPENDS = "glib-2.0"
+
+inherit gnomebase gtk-doc gettext upstream-version-is-even gobject-introspection
+
+SRC_URI[archive.md5sum] = "7cddcc313b9a3efd19b2ddf079ba68f5"
+SRC_URI[archive.sha256sum] = "ef00ff6b83851dddc8db38b4d9faeffb99572ba150b0664ee02e46f015ea97cb"
+
+BBCLASSEXTEND = "native"
+
diff --git a/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch b/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
new file mode 100644
index 000000000..4c7cba3b8
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
@@ -0,0 +1,51 @@
+From d82457ce5ca7455e336da5e244d95f90e52aaef8 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 18 Apr 2017 01:17:26 -0700
+Subject: [PATCH] Makefile: libacl should depend on include
+
+Fixed race issue:
+ In file included from acl_copy_entry.c:22:0:
+ libacl.h:19:21: fatal error: sys/acl.h: No such file or directory
+ #include <sys/acl.h>
+
+[snip]
+
+ compilation terminated.
+ acl_get_file.c:27:24: fatal error: acl/libacl.h: No such file or directory
+ #include <acl/libacl.h>
+ ^
+
+The acl.h is in "include" directory, and include/Makefile creates
+symlink "sys" and "acl" poinst to current dirctory:
+$ ls include/ -l
+acl -> .
+sys -> .
+
+So if "libacl" target runs before "include", the error would happen
+since no "acl" or "sys" directory.
+
+Let libacl depend on include can fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index dce32d3..8a79379 100644
+--- a/Makefile
++++ b/Makefile
+@@ -48,7 +48,7 @@ else
+ endif
+
+ # tool/lib dependencies
+-libacl: libmisc
++libacl: include libmisc
+ getfacl setfacl chacl: libacl
+
+ ifeq ($(HAVE_BUILDDEFS), yes)
+--
+2.10.2
+
diff --git a/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch b/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch
new file mode 100644
index 000000000..cf765fdbb
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch
@@ -0,0 +1,198 @@
+acl: fix the order of expected output of getfacl
+
+The result of getfacl is sorted by user id.
+In Centos or RHEL, bin user id is 1 and daemon user id is 2.
+But in our image, bin user id is 2 and daemon user id is 1.
+The patch fixes this issue to make ptest pass.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ test/misc.test | 38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/test/misc.test b/test/misc.test
+index 6e98053..53ae5b0 100644
+--- a/test/misc.test
++++ b/test/misc.test
+@@ -79,8 +79,8 @@ Multiple users
+
+ $ getfacl --omit-header f
+ > user::rw-
+- > user:bin:rw-
+ > user:daemon:r--
++ > user:bin:rw-
+ > group::r--
+ > mask::rw-
+ > other::r--
+@@ -94,8 +94,8 @@ Multiple groups
+
+ $ getfacl --omit-header f
+ > user::rw-
+- > user:bin:rw-
+ > user:daemon:r--
++ > user:bin:rw-
+ > group::r--
+ > group:daemon:r--
+ > group:users:rw-
+@@ -111,8 +111,8 @@ Remove one group
+
+ $ getfacl --omit-header f
+ > user::rw-
+- > user:bin:rw-
+ > user:daemon:r--
++ > user:bin:rw-
+ > group::r--
+ > group:daemon:r--
+ > mask::rw-
+@@ -146,8 +146,8 @@ Default ACL
+
+ $ getfacl --omit-header d
+ > user::rwx
+- > user:bin:rwx
+ > user:daemon:rw-
++ > user:bin:rwx
+ > group::r-x
+ > mask::rwx
+ > other::---
+@@ -236,16 +236,16 @@ Add some users and groups
+
+ $ getfacl --omit-header d/d
+ > user::rwx
+- > user:bin:rwx #effective:r-x
+ > user:daemon:r-x
++ > user:bin:rwx #effective:r-x
+ > group::r-x
+ > group:daemon:rwx #effective:r-x
+ > group:users:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:rwx #effective:r-x
+ > default:user:daemon:r-x
++ > default:user:bin:rwx #effective:r-x
+ > default:group::r-x
+ > default:mask::r-x
+ > default:other::---
+@@ -262,16 +262,16 @@ Symlink in directory with default ACL?
+
+ $ getfacl --omit-header d/l
+ > user::rwx
+- > user:bin:rwx #effective:r-x
+ > user:daemon:r-x
++ > user:bin:rwx #effective:r-x
+ > group::r-x
+ > group:daemon:rwx #effective:r-x
+ > group:users:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:rwx #effective:r-x
+ > default:user:daemon:r-x
++ > default:user:bin:rwx #effective:r-x
+ > default:group::r-x
+ > default:mask::r-x
+ > default:other::---
+@@ -287,16 +287,16 @@ Does mask manipulation work?
+
+ $ getfacl --omit-header d/d
+ > user::rwx
+- > user:bin:r-x
+ > user:daemon:r-x
++ > user:bin:r-x
+ > group::r-x
+ > group:daemon:r-x
+ > group:users:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:rwx #effective:r-x
+ > default:user:daemon:r-x
++ > default:user:bin:rwx #effective:r-x
+ > default:group::r-x
+ > default:mask::r-x
+ > default:other::---
+@@ -308,16 +308,16 @@ Does mask manipulation work?
+
+ $ getfacl --omit-header d/d
+ > user::rwx
+- > user:bin:r-x
+ > user:daemon:r-x
++ > user:bin:r-x
+ > group::r-x
+ > group:daemon:r-x
+ > group:users:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:rwx
+ > default:user:daemon:r-x
++ > default:user:bin:rwx
+ > default:group::r-x
+ > default:mask::rwx
+ > default:other::---
+@@ -333,8 +333,8 @@ Remove the default ACL
+
+ $ getfacl --omit-header d
+ > user::rwx
+- > user:bin:rwx
+ > user:daemon:rw-
++ > user:bin:rwx
+ > group::r-x
+ > mask::rwx
+ > other::---
+@@ -373,14 +373,14 @@ Now, chmod should change the group_obj entry
+
+ $ getfacl --omit-header d
+ > user::rwx
+- > user:bin:r-x
+ > user:daemon:rwx
++ > user:bin:r-x
+ > group::rwx
+ > mask::rwx
+ > other::r-x
+ > default:user::rwx
+- > default:user:bin:r-x
+ > default:user:daemon:rwx
++ > default:user:bin:r-x
+ > default:group::rwx
+ > default:mask::rwx
+ > default:other::r-x
+@@ -392,14 +392,14 @@ Now, chmod should change the group_obj entry
+
+ $ getfacl --omit-header d
+ > user::rwx
+- > user:bin:r-x
+ > user:daemon:rwx #effective:r-x
++ > user:bin:r-x
+ > group::rwx #effective:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:r-x
+ > default:user:daemon:rwx
++ > default:user:bin:r-x
+ > default:group::rwx
+ > default:mask::rwx
+ > default:other::r-x
+@@ -411,14 +411,14 @@ Now, chmod should change the group_obj entry
+
+ $ getfacl --omit-header d
+ > user::rwx
+- > user:bin:r-x
+ > user:daemon:rwx #effective:r-x
++ > user:bin:r-x
+ > group::rwx #effective:r-x
+ > mask::r-x
+ > other::---
+ > default:user::rwx
+- > default:user:bin:r-x
+ > default:user:daemon:rwx
++ > default:user:bin:r-x
+ > default:group::rwx
+ > default:mask::rwx
+ > default:other::r-x
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-support/attr/acl/configure.ac b/poky/meta/recipes-support/attr/acl/configure.ac
new file mode 100644
index 000000000..7af2e8d88
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/configure.ac
@@ -0,0 +1,49 @@
+# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+AC_INIT(include/acl.h)
+AC_CONFIG_AUX_DIR([.])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER(include/config.h)
+AC_PREFIX_DEFAULT(/usr)
+
+AC_PROG_LIBTOOL
+
+AC_ARG_ENABLE(shared,
+[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
+ enable_shared=yes)
+AC_SUBST(enable_shared)
+
+AC_ARG_ENABLE(gettext,
+[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ enable_gettext=yes)
+AC_SUBST(enable_gettext)
+
+AC_ARG_ENABLE(lib64,
+[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
+ enable_lib64=no)
+AC_SUBST(enable_lib64)
+
+AC_PACKAGE_GLOBALS(acl)
+AC_PACKAGE_UTILITIES(acl)
+AC_PACKAGE_NEED_ATTR_XATTR_H
+AC_PACKAGE_NEED_ATTR_ERROR_H
+AC_MULTILIB($enable_lib64)
+AC_PACKAGE_NEED_GETXATTR_LIBATTR
+AC_MANUAL_FORMAT
+
+AC_FUNC_GCC_VISIBILITY
+
+AC_OUTPUT(include/builddefs)
diff --git a/poky/meta/recipes-support/attr/acl/run-ptest b/poky/meta/recipes-support/attr/acl/run-ptest
new file mode 100644
index 000000000..a56946d8e
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/run-ptest
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+#This script is used to run acl test suites
+
+#umask 077
+
+EXT3_IMAGE=ext3.img
+EXT3_MOUNT_POINT=/mnt/ext3
+
+trap 'rm -f ${EXT3_IMAGE}' EXIT
+
+dd if=/dev/zero of=${EXT3_IMAGE} bs=1M count=1
+if [ "$?" -eq 0 ]; then
+ echo "PASS: dump ext3.img"
+else
+ echo "FAIL: dump ext3.img"
+ exit 1
+fi
+
+mkfs.ext3 -F ${EXT3_IMAGE}
+if [ "$?" -eq 0 ]; then
+ echo "PASS: mkfs.ext3 -F ext3.img"
+else
+ echo "FAIL: mkfs.ext3 -F ext3.img"
+ exit 1
+fi
+
+if [ -d $EXT3_MOUNT_POINT ]; then
+ echo "mount point exist"
+else
+ mkdir -p $EXT3_MOUNT_POINT
+fi
+
+
+mount -o loop,rw,acl ${EXT3_IMAGE} $EXT3_MOUNT_POINT
+if [ "$?" -eq 0 ]; then
+ echo "PASS: mount ext3.img"
+else
+ echo "FAIL: mount ext3.img"
+ exit 1
+fi
+
+cp -rf ./test/ $EXT3_MOUNT_POINT
+
+cd $EXT3_MOUNT_POINT/test/
+
+if sed -e 's!^bin:x:2:$!bin:x:2:daemon!' < /etc/group > gtmp
+then if cp /etc/group group.orig;
+ then cp gtmp /etc/group
+ make -k tests root-tests | sed \
+ -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \
+ -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|'
+ cp group.orig /etc/group
+ else echo "FAIL: couldn't save original group file."
+ exit 1
+ fi
+else echo "FAIL: couldn't create modified group file."
+ exit 1
+fi
+
+cd -
+umount $EXT3_MOUNT_POINT
+rm -rf $EXT3_MOUNT_POINT
+rm $EXT3_IMAGE
diff --git a/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch b/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch
new file mode 100644
index 000000000..e64990ad5
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch
@@ -0,0 +1,37 @@
+From 311589fedf196168382d8f0db303ab328bcf9d83 Mon Sep 17 00:00:00 2001
+From: Peter Seebach <peter.seebach@windriver.com>
+Date: Wed, 11 May 2016 15:16:06 -0500
+Subject: [PATCH] acl.inc, run-ptest: improve ptest functionality on limited
+
+commit c45bae84817a70fef6c2b661a07a492a0d23ae85
+
+ Fix permissions on temporary directory
+
+ The temporary directory's permissions have to allow other users to
+ view the directory. A default umask of 022 is common, but not mandatory,
+ and secure systems may have more restrictive defaults.
+
+ Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
+
+Upstream-Status: Backport [ http://git.savannah.gnu.org/cgit/acl.git/commit/?id=c6772a958800de064482634f77c20a0faafc5af6 ]
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ test/root/permissions.test | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/test/root/permissions.test b/test/root/permissions.test
+index 42615f5..098b52a 100644
+--- a/test/root/permissions.test
++++ b/test/root/permissions.test
+@@ -16,6 +16,7 @@ Cry immediately if we are not running as root.
+ First, set up a temporary directory and create a regular file with
+ defined permissions.
+
++ $ umask 022
+ $ mkdir d
+ $ cd d
+ $ umask 027
+--
+2.8.1
+
diff --git a/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch b/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
new file mode 100644
index 000000000..f392465b5
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
@@ -0,0 +1,100 @@
+From e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Mon, 20 May 2013 16:38:06 +0200
+Subject: [PATCH] test: fix insufficient quoting of '\'
+
+This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which
+caused sbits-restore.test to fail in the following way in case SELinux
+was disabled:
+
+*** sbits-restore.test ***
+[3] $ umask 022 -- ok
+[4] $ mkdir d -- ok
+[5] $ touch d/g -- ok
+[6] $ touch d/u -- ok
+[7] $ chmod u+s d/u -- ok
+[8] $ chmod g+s d/g -- ok
+[9] $ chmod +t d -- ok
+[10] $ getfacl -R d > d.acl -- ok
+[11] $ rm -R d -- ok
+[12] $ mkdir d -- ok
+[13] $ touch d/g -- ok
+[14] $ touch d/u -- ok
+[15] $ setfacl --restore d.acl -- ok
+[16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed
+drwxr-xr- != drwxr-xr-t
+[18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed
+-rwSr--r- != -rwSr--r--
+[20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed
+-rw-r-Sr- != -rw-r-Sr--
+[22] $ rm -Rf d -- ok
+17 commands (14 passed, 3 failed)
+
+Upstream-Status: Backport
+http://git.savannah.gnu.org/cgit/acl.git/commit/?id=e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d
+
+Signed-off-by: Kamil Dudka <kdudka@redhat.com>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+
+Index: acl-2.2.52/test/cp.test
+===================================================================
+--- acl-2.2.52.orig/test/cp.test
++++ acl-2.2.52/test/cp.test
+@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if
+ > -rw-rw-r--+
+
+ $ cp f g
+- $ ls -l g | awk -- '{ print $1 }' | sed 's/\.$//g'
++ $ ls -l g | awk -- '{ print $1 }' | sed 's/\\.$//g'
+ > -rw-r--r--
+
+ $ rm g
+Index: acl-2.2.52/test/misc.test
+===================================================================
+--- acl-2.2.52.orig/test/misc.test
++++ acl-2.2.52/test/misc.test
+@@ -254,7 +254,7 @@ Add some users and groups
+ Symlink in directory with default ACL?
+
+ $ ln -s d d/l
+- $ ls -dl d/l | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d/l | awk '{print $1}' | sed 's/\\.$//g'
+ > lrwxrwxrwx
+
+ $ ls -dl -L d/l | awk '{print $1}'
+@@ -343,7 +343,7 @@ Remove the default ACL
+ Reset to base entries
+
+ $ setfacl -b d
+- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
+ > drwxr-x---
+
+ $ getfacl --omit-header d
+@@ -355,7 +355,7 @@ Reset to base entries
+ Now, chmod should change the group_obj entry
+
+ $ chmod 775 d
+- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
+ > drwxrwxr-x
+
+ $ getfacl --omit-header d
+Index: acl-2.2.52/test/sbits-restore.test
+===================================================================
+--- acl-2.2.52.orig/test/sbits-restore.test
++++ acl-2.2.52/test/sbits-restore.test
+@@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via -
+ $ touch d/g
+ $ touch d/u
+ $ setfacl --restore d.acl
+- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
+ > drwxr-xr-t
+- $ ls -dl d/u | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d/u | awk '{print $1}' | sed 's/\\.$//g'
+ > -rwSr--r--
+- $ ls -dl d/g | awk '{print $1}' | sed 's/\.$//g'
++ $ ls -dl d/g | awk '{print $1}' | sed 's/\\.$//g'
+ > -rw-r-Sr--
+ $ rm -Rf d
diff --git a/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch b/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
new file mode 100644
index 000000000..8cc11a63e
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
@@ -0,0 +1,84 @@
+From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Wed, 2 Mar 2016 15:46:57 +0800
+Subject: [PATCH] test: fixups on SELinux machines for root testcases
+
+ls adds a '.' at the end of the permission field list on SELinux
+machines, filter this out so root tests work on SELinux machines.
+
+Upstream-Status: Accepted
+http://git.savannah.gnu.org/cgit/acl.git/commit/?id=26a87d36f80d5e98bccb5878834d9e69dadfe3e9
+
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+---
+ test/root/permissions.test | 8 ++++----
+ test/root/restore.test | 2 +-
+ test/root/setfacl.test | 2 +-
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/test/root/permissions.test b/test/root/permissions.test
+index 9b9e3de..665339a 100644
+--- a/test/root/permissions.test
++++ b/test/root/permissions.test
+@@ -19,7 +19,7 @@ defined permissions.
+ $ cd d
+ $ umask 027
+ $ touch f
+- $ ls -l f | awk -- '{ print $1, $3, $4 }'
++ $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
+ > -rw-r----- root root
+
+
+@@ -39,7 +39,7 @@ Now, change the ownership of the file to bin:bin and verify that this
+ gives user bin write access.
+
+ $ chown bin:bin f
+- $ ls -l f | awk -- '{ print $1, $3, $4 }'
++ $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
+ > -rw-r----- bin bin
+ $ su bin
+ $ echo bin >> f
+@@ -256,12 +256,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them.
+ $ mkdir -m 600 x
+ $ chown daemon:daemon x
+ $ echo j > x/j
+- $ ls -l x/j | awk -- '{ print $1, $3, $4 }'
++ $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
+ > -rw-r----- root root
+
+ $ setfacl -m u:daemon:r x
+
+- $ ls -l x/j | awk -- '{ print $1, $3, $4 }'
++ $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
+ > -rw-r----- root root
+ (With the bug this gives: `ls: x/j: Permission denied'.)
+
+diff --git a/test/root/restore.test b/test/root/restore.test
+index 63a9d01..c85097c 100644
+--- a/test/root/restore.test
++++ b/test/root/restore.test
+@@ -21,7 +21,7 @@ Cry immediately if we are not running as root.
+ $ chown bin passwd
+ $ chmod u+s passwd
+ $ setfacl --restore passwd.acl
+- $ ls -dl passwd | awk '{print $1 " " $3 " " $4}'
++ $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g'
+ > -rwsr-xr-x root root
+
+ $ rm passwd passwd.acl
+diff --git a/test/root/setfacl.test b/test/root/setfacl.test
+index a46a9f4..7efbad7 100644
+--- a/test/root/setfacl.test
++++ b/test/root/setfacl.test
+@@ -12,7 +12,7 @@ Cry immediately if we are not running as root.
+ $ sg bin
+ $ umask 027
+ $ touch g
+- $ ls -dl g | awk '{print $1}'
++ $ ls -dl g | awk '{print $1}' | sed 's/\\.//g'
+ > -rw-r-----
+
+ $ setfacl -m m:- g
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/attr/acl_2.2.52.bb b/poky/meta/recipes-support/attr/acl_2.2.52.bb
new file mode 100644
index 000000000..8f3dc45cf
--- /dev/null
+++ b/poky/meta/recipes-support/attr/acl_2.2.52.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Utilities for managing POSIX Access Control Lists"
+HOMEPAGE = "http://savannah.nongnu.org/projects/acl/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_lib${BPN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=c781d70ed2b4d48995b790403217a249 \
+ file://doc/COPYING.LGPL;md5=9e9a206917f8af112da634ce3ab41764"
+
+DEPENDS = "attr"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \
+ file://configure.ac;subdir=${S} \
+ file://run-ptest \
+ file://acl-fix-the-order-of-expected-output-of-getfacl.patch \
+ file://test-fix-insufficient-quoting-of.patch \
+ file://test-fixups-on-SELinux-machines-for-root-testcases.patch \
+ file://test-fix-directory-permissions.patch \
+ file://Makefile-libacl-should-depend-on-include.patch \
+"
+
+SRC_URI[md5sum] = "a61415312426e9c2212bd7dc7929abda"
+SRC_URI[sha256sum] = "179074bb0580c06c4b4137be4c5a92a701583277967acdb5546043c7874e0d23"
+
+require ea-acl.inc
+
+# avoid RPATH hardcode to staging dir
+do_configure_append() {
+ sed -i ${S}/config.status -e s,^\\\(hardcode_into_libs=\\\).*$,\\1\'no\',
+ ${S}/config.status
+}
+
+# libdir should point to .la
+do_install_append() {
+ sed -i ${D}${libdir}/libacl.la -e \
+ s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
+}
+
+inherit ptest
+
+do_install_ptest() {
+ tar -c --exclude=nfs test/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ mkdir ${D}${PTEST_PATH}/include
+ cp ${S}/include/builddefs ${S}/include/buildmacros ${S}/include/buildrules ${D}${PTEST_PATH}/include/
+ # Remove any build host references
+ sed -e "s:--sysroot=${STAGING_DIR_TARGET}::g" \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -i ${D}${PTEST_PATH}/include/builddefs
+}
+
+RDEPENDS_${PN}-ptest = "acl bash coreutils perl perl-module-filehandle perl-module-getopt-std perl-module-posix shadow"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/attr/attr.inc b/poky/meta/recipes-support/attr/attr.inc
new file mode 100644
index 000000000..24ef5adfd
--- /dev/null
+++ b/poky/meta/recipes-support/attr/attr.inc
@@ -0,0 +1,45 @@
+SUMMARY = "Utilities for manipulating filesystem extended attributes"
+HOMEPAGE = "http://savannah.nongnu.org/projects/attr/"
+SECTION = "libs"
+
+DEPENDS = "virtual/libintl"
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_lib${BPN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \
+ file://attr/attr.c;endline=17;md5=be0403261f0847e5f43ed5b08d19593c \
+ file://libattr/libattr.c;endline=17;md5=7970f77049f8fa1199fff62a7ab724fb"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.src.tar.gz \
+ file://run-ptest \
+"
+
+require ea-acl.inc
+
+# libdir should point to .la
+do_install_append() {
+ sed -i ${D}${libdir}/libattr.la -e \
+ s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
+}
+
+inherit ptest
+
+do_install_ptest() {
+ tar -c --exclude=ext test/ | ( cd ${D}${PTEST_PATH} && tar -xf - )
+ mkdir ${D}${PTEST_PATH}/include
+ for i in builddefs buildmacros buildrules; \
+ do cp ${S}/include/$i ${D}${PTEST_PATH}/include/; \
+ done
+ sed -e 's|; @echo|; echo|' -i ${D}${PTEST_PATH}/test/Makefile
+
+ # Remove any build host references
+ sed -e "s:--sysroot=${STAGING_DIR_TARGET}::g" \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -i ${D}${PTEST_PATH}/include/builddefs
+}
+
+RDEPENDS_${PN}-ptest = "attr coreutils perl-module-filehandle perl-module-getopt-std perl-module-posix"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/attr/attr/0001-Use-stdint-types-consistently.patch b/poky/meta/recipes-support/attr/attr/0001-Use-stdint-types-consistently.patch
new file mode 100644
index 000000000..dcd6507bc
--- /dev/null
+++ b/poky/meta/recipes-support/attr/attr/0001-Use-stdint-types-consistently.patch
@@ -0,0 +1,69 @@
+From 37a27b6fd09ecb37097b85e5db74e4f77b80fe0a Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Tue, 12 Jan 2016 22:20:33 +0100
+Subject: [PATCH] Use stdint types consistently
+
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ include/attributes.h | 6 ++++--
+ man/man3/attr_list.3 | 8 ++++----
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+Index: attr-2.4.47/include/attributes.h
+===================================================================
+--- attr-2.4.47.orig/include/attributes.h
++++ attr-2.4.47/include/attributes.h
+@@ -22,6 +22,7 @@
+ extern "C" {
+ #endif
+
++#include <stdint.h>
+ /*
+ * An almost-IRIX-compatible extended attributes API
+ * (the IRIX attribute "list" operation is missing, added ATTR_SECURE).
+@@ -69,7 +70,7 @@ typedef struct attrlist {
+ * al_offset[i] entry points to.
+ */
+ typedef struct attrlist_ent { /* data from attr_list() */
+- u_int32_t a_valuelen; /* number bytes in value of attr */
++ uint32_t a_valuelen; /* number bytes in value of attr */
+ char a_name[1]; /* attr name (NULL terminated) */
+ } attrlist_ent_t;
+
+@@ -90,7 +91,7 @@ typedef struct attrlist_ent { /* data fr
+ * operation on a cursor is to bzero() it.
+ */
+ typedef struct attrlist_cursor {
+- u_int32_t opaque[4]; /* an opaque cookie */
++ uint32_t opaque[4]; /* an opaque cookie */
+ } attrlist_cursor_t;
+
+ /*
+Index: attr-2.4.47/man/man3/attr_list.3
+===================================================================
+--- attr-2.4.47.orig/man/man3/attr_list.3
++++ attr-2.4.47/man/man3/attr_list.3
+@@ -72,9 +72,9 @@ The contents of an \f4attrlist_t\fP stru
+ .nf
+ .ft 4
+ .ta 9n 22n
+-__int32_t al_count; /\(** number of entries in attrlist \(**/
+-__int32_t al_more; /\(** T/F: more attrs (do syscall again) \(**/
+-__int32_t al_offset[1]; /\(** byte offsets of attrs [var-sized] \(**/
++int32_t al_count; /\(** number of entries in attrlist \(**/
++int32_t al_more; /\(** T/F: more attrs (do syscall again) \(**/
++int32_t al_offset[1]; /\(** byte offsets of attrs [var-sized] \(**/
+ .ft 1
+ .fi
+ .RE
+@@ -113,7 +113,7 @@ include the following members:
+ .nf
+ .ft 4
+ .ta 9n 22n
+-u_int32_t a_valuelen; /\(** number bytes in value of attr \(**/
++uint32_t a_valuelen; /\(** number bytes in value of attr \(**/
+ char a_name[]; /\(** attr name (NULL terminated) \(**/
+ .ft 1
+ .fi
diff --git a/poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch b/poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch
new file mode 100644
index 000000000..20fcc3cee
--- /dev/null
+++ b/poky/meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch
@@ -0,0 +1,63 @@
+Subject: [PATCH] attr: Missing configure.ac
+
+Upstream-Status: Backport [Upstream released tarball missing this file]
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+---
+ configure.ac | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+ create mode 100644 configure.ac
+
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..b966d0e
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,48 @@
++# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation, either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program. If not, see <http://www.gnu.org/licenses/>.
++#
++AC_INIT(include/attributes.h)
++AC_CONFIG_AUX_DIR([.])
++AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_HEADER(include/config.h)
++AC_PREFIX_DEFAULT(/usr)
++
++AC_PROG_LIBTOOL
++
++AC_ARG_ENABLE(shared,
++[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
++ enable_shared=yes)
++AC_SUBST(enable_shared)
++
++AC_ARG_ENABLE(gettext,
++[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
++ enable_gettext=yes)
++AC_SUBST(enable_gettext)
++
++AC_ARG_ENABLE(lib64,
++[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
++ enable_lib64=no)
++AC_SUBST(enable_lib64)
++
++AC_PACKAGE_GLOBALS(attr)
++AC_PACKAGE_UTILITIES(attr)
++AC_MANUAL_FORMAT
++AC_MULTILIB($enable_lib64)
++
++AC_C_CONST
++AC_TYPE_MODE_T
++AC_FUNC_ALLOCA
++
++AC_OUTPUT(include/builddefs)
diff --git a/poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch b/poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch
new file mode 100644
index 000000000..9d4b8929e
--- /dev/null
+++ b/poky/meta/recipes-support/attr/attr/dont-use-decl-macros.patch
@@ -0,0 +1,56 @@
+Use extern "C" instead of __BEGIN_DECL/__END_DECL macros
+these macros are defined in sys/cdefs.h for glibc and this header is not available on all libc
+
+anyway they defined like below
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
+#endif
+
+__THROW macro is also not available on musl, defined thusly
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: attr-2.4.47/include/xattr.h
+===================================================================
+--- attr-2.4.47.orig/include/xattr.h 2014-04-02 00:01:30.252091280 -0700
++++ attr-2.4.47/include/xattr.h 2014-04-02 00:12:57.985428099 -0700
+@@ -30,8 +30,20 @@
+ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+-
+-__BEGIN_DECLS
++#ifndef __THROW
++# ifndef __GNUC_PREREQ
++# define __GNUC_PREREQ(maj, min) (0)
++# endif
++# if defined __cplusplus && __GNUC_PREREQ (2,8)
++# define __THROW throw ()
++# else
++# define __THROW
++# endif
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ extern int setxattr (const char *__path, const char *__name,
+ const void *__value, size_t __size, int __flags) __THROW;
+@@ -58,6 +70,8 @@
+ extern int lremovexattr (const char *__path, const char *__name) __THROW;
+ extern int fremovexattr (int __filedes, const char *__name) __THROW;
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* __XATTR_H__ */
diff --git a/poky/meta/recipes-support/attr/attr_2.4.47.bb b/poky/meta/recipes-support/attr/attr_2.4.47.bb
new file mode 100644
index 000000000..fc88bef83
--- /dev/null
+++ b/poky/meta/recipes-support/attr/attr_2.4.47.bb
@@ -0,0 +1,15 @@
+require attr.inc
+
+# configure.ac was missing from the release tarball. This should be fixed in
+# future releases of attr, remove this when updating the recipe.
+SRC_URI += "file://attr-Missing-configure.ac.patch \
+ file://dont-use-decl-macros.patch \
+ file://Remove-the-section-2-man-pages.patch \
+ file://Remove-the-attr.5-man-page-moved-to-man-pages.patch \
+ file://0001-Use-stdint-types-consistently.patch \
+ "
+
+SRC_URI[md5sum] = "84f58dec00b60f2dc8fd1c9709291cc7"
+SRC_URI[sha256sum] = "25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/attr/ea-acl.inc b/poky/meta/recipes-support/attr/ea-acl.inc
new file mode 100644
index 000000000..1339eccdb
--- /dev/null
+++ b/poky/meta/recipes-support/attr/ea-acl.inc
@@ -0,0 +1,49 @@
+# this build system is mostly shared by attr and acl
+
+SRC_URI += "file://relative-libdir.patch;striplevel=0 \
+ "
+# This patch should be applied after '(attr\|acl)-Missing-configure.ac.patch'
+SRC_URI_append = " file://0001-Added-configure-option-to-enable-disable-static-libr.patch"
+
+inherit autotools-brokensep gettext
+
+# the package comes with a custom config.h.in, it cannot be
+# overwritten by autoheader
+EXTRA_AUTORECONF += "--exclude=autoheader"
+EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root"
+EXTRA_OECONF_append_class-native = " --enable-gettext=no"
+EXTRA_OECONF_append_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS') == 'no')]}"
+
+EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"
+
+do_install () {
+ oe_runmake install install-lib install-dev DIST_ROOT="${D}" ZIP="gzip -n"
+}
+
+do_install_append_class-native () {
+ if test "${libdir}" = "${base_libdir}" ; then
+ return
+ fi
+ librelpath=${@os.path.relpath(d.getVar('libdir'), d.getVar('base_libdir'))}
+ baselibrelpath=${@os.path.relpath(d.getVar('base_libdir'), d.getVar('libdir'))}
+
+ # Remove bad symlinks & create the correct symlinks
+ if test -L ${D}${libdir}/lib${BPN}.so ; then
+ rm -rf ${D}${libdir}/lib${BPN}.so
+ ln -sf $baselibrelpath/lib${BPN}.so ${D}${libdir}/lib${BPN}.so
+ fi
+ if test -L ${D}${base_libdir}/lib${BPN}.a ; then
+ rm -rf ${D}${base_libdir}/lib${BPN}.a
+ ln -sf $librelpath/lib${BPN}.a ${D}${base_libdir}/lib${BPN}.a
+ fi
+ if test -L ${D}${base_libdir}/lib${BPN}.la ; then
+ rm -rf ${D}${base_libdir}/lib${BPN}.la
+ ln -sf $librelpath/lib${BPN}.la ${D}${base_libdir}/lib${BPN}.la
+ fi
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch b/poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
new file mode 100644
index 000000000..1c1159f2c
--- /dev/null
+++ b/poky/meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
@@ -0,0 +1,70 @@
+From 01256c61ba126449c46dd4ab5d5e145488b981fa Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Mon, 23 Jan 2017 13:25:13 +0200
+Subject: [PATCH] Added configure option to enable/disable static library
+
+Create static library archive only in case of --enable-static.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ configure.ac | 6 ++++++
+ include/builddefs.in | 1 +
+ include/buildmacros | 3 +++
+ 3 files changed, 10 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index b966d0e..e48268b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,12 @@ AC_ARG_ENABLE(shared,
+ enable_shared=yes)
+ AC_SUBST(enable_shared)
+
++AC_ARG_ENABLE(static,
++[ --enable-static=[yes/no] Enable use of static libraries [default=yes]],,
++ enable_static=yes)
++AC_SUBST(enable_static)
++
++
+ AC_ARG_ENABLE(gettext,
+ [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
+ enable_gettext=yes)
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d9931db..3b3dbd2 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -71,6 +71,7 @@ RPMBUILD = @rpmbuild@
+ RPM_VERSION = @rpm_version@
+
+ ENABLE_SHARED = @enable_shared@
++ENABLE_STATIC = @enable_static@
+ ENABLE_GETTEXT = @enable_gettext@
+
+ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
+diff --git a/include/buildmacros b/include/buildmacros
+index 39fa7e2..b0f25c5 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -80,6 +80,7 @@ endif
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
++ set -x; \
+ cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ ../$(INSTALL) -m 755 -d $(PKG_DEVLIB_DIR); \
+ ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_DEVLIB_DIR); \
+@@ -88,7 +89,9 @@ INSTALL_LTLIB_DEV = \
+ ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+ rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++ if test "$(ENABLE_STATIC)" = "yes" ; then \
+ ../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++ fi ;\
+ ../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+ rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ ../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/attr/files/Remove-the-attr.5-man-page-moved-to-man-pages.patch b/poky/meta/recipes-support/attr/files/Remove-the-attr.5-man-page-moved-to-man-pages.patch
new file mode 100644
index 000000000..d5ab83d7c
--- /dev/null
+++ b/poky/meta/recipes-support/attr/files/Remove-the-attr.5-man-page-moved-to-man-pages.patch
@@ -0,0 +1,240 @@
+From 6047c8522b91235ad1e835f44f5e36472d9d49b2 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
+Date: Wed, 22 Apr 2015 11:46:59 +0200
+Subject: [PATCH 2/2] Remove the attr.5 man page (moved to man-pages)
+
+Commit dce9b4448c7f2b22bd206cd068fb05cb2f3255b9 from
+https://git.savannah.nongnu.org/git/attr.git
+
+The attr.5 page is part of the extended attribute system call documentation,
+which has been moved into the man-pages package. Move the attr.5 page there
+as well.
+
+Upstream-Status: Backport
+
+[MA: updated to apply directly to v2.4.47]
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ man/Makefile | 2 +-
+ man/man5/Makefile | 35 -------------
+ man/man5/attr.5 | 153 ------------------------------------------------------
+ 3 files changed, 1 insertion(+), 189 deletions(-)
+ delete mode 100644 man/man5/Makefile
+ delete mode 100644 man/man5/attr.5
+
+diff --git a/man/Makefile b/man/Makefile
+index 755daed..9301f09 100644
+--- a/man/Makefile
++++ b/man/Makefile
+@@ -19,7 +19,7 @@
+ TOPDIR = ..
+ include $(TOPDIR)/include/builddefs
+
+-SUBDIRS = man1 man3 man5
++SUBDIRS = man1 man3
+
+ default : $(SUBDIRS)
+
+diff --git a/man/man5/Makefile b/man/man5/Makefile
+deleted file mode 100644
+index 6b70d3d..0000000
+--- a/man/man5/Makefile
++++ /dev/null
+@@ -1,35 +0,0 @@
+-#
+-# Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved.
+-# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+-#
+-# This program is free software: you can redistribute it and/or modify it
+-# under the terms of the GNU General Public License as published by
+-# the Free Software Foundation, either version 2 of the License, or
+-# (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#
+-
+-TOPDIR = ../..
+-include $(TOPDIR)/include/builddefs
+-
+-MAN_SECTION = 5
+-
+-MAN_PAGES = $(shell echo *.$(MAN_SECTION))
+-MAN_DEST = $(PKG_MAN_DIR)/man$(MAN_SECTION)
+-LSRCFILES = $(MAN_PAGES)
+-
+-default : $(MAN_PAGES)
+-
+-include $(BUILDRULES)
+-
+-install : default
+- $(INSTALL) -m 755 -d $(MAN_DEST)
+- $(INSTALL_MAN)
+-install-dev install-lib:
+diff --git a/man/man5/attr.5 b/man/man5/attr.5
+deleted file mode 100644
+index a02757d..0000000
+--- a/man/man5/attr.5
++++ /dev/null
+@@ -1,153 +0,0 @@
+-.\" Extended attributes manual page
+-.\"
+-.\" Copyright (C) 2000, 2002, 2007 Andreas Gruenbacher <agruen@suse.de>
+-.\" Copyright (C) 2001, 2002, 2004, 2007 Silicon Graphics, Inc.
+-.\" All rights reserved.
+-.\"
+-.\" This is free documentation; you can redistribute it and/or
+-.\" modify it under the terms of the GNU General Public License as
+-.\" published by the Free Software Foundation; either version 2 of
+-.\" the License, or (at your option) any later version.
+-.\"
+-.\" The GNU General Public License's references to "object code"
+-.\" and "executables" are to be interpreted as the output of any
+-.\" document formatting or typesetting system, including
+-.\" intermediate and printed output.
+-.\"
+-.\" This manual is distributed in the hope that it will be useful,
+-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-.\" GNU General Public License for more details.
+-.\"
+-.\" You should have received a copy of the GNU General Public
+-.\" License along with this manual. If not, see
+-.\" <http://www.gnu.org/licenses/>.
+-.\"
+-.TH ATTR 5
+-.SH NAME
+-attr - Extended attributes
+-.SH DESCRIPTION
+-Extended attributes are name:value pairs associated permanently with
+-files and directories, similar to the environment strings associated
+-with a process.
+-An attribute may be defined or undefined.
+-If it is defined, its value may be empty or non-empty.
+-.PP
+-Extended attributes are extensions to the normal attributes which are
+-associated with all inodes in the system (i.e. the
+-.BR stat (2)
+-data).
+-They are often used to provide additional functionality
+-to a filesystem \- for example, additional security features such as
+-Access Control Lists (ACLs) may be implemented using extended attributes.
+-.PP
+-Users with search access to a file or directory may retrieve a list of
+-attribute names defined for that file or directory.
+-.PP
+-Extended attributes are accessed as atomic objects.
+-Reading retrieves the whole value of an attribute and stores it in a buffer.
+-Writing replaces any previous value with the new value.
+-.PP
+-Space consumed for extended attributes is counted towards the disk quotas
+-of the file owner and file group.
+-.PP
+-Currently, support for extended attributes is implemented on Linux by the
+-ext2, ext3, ext4, XFS, JFS and reiserfs filesystems.
+-.SH EXTENDED ATTRIBUTE NAMESPACES
+-Attribute names are zero-terminated strings.
+-The attribute name is always specified in the fully qualified
+-.IR namespace.attribute
+-form, eg.
+-.IR user.mime_type ,
+-.IR trusted.md5sum ,
+-.IR system.posix_acl_access ,
+-or
+-.IR security.selinux .
+-.PP
+-The namespace mechanism is used to define different classes of extended
+-attributes.
+-These different classes exist for several reasons, e.g. the permissions
+-and capabilities required for manipulating extended attributes of one
+-namespace may differ to another.
+-.PP
+-Currently the
+-.IR security ,
+-.IR system ,
+-.IR trusted ,
+-and
+-.IR user
+-extended attribute classes are defined as described below. Additional
+-classes may be added in the future.
+-.SS Extended security attributes
+-The security attribute namespace is used by kernel security modules,
+-such as Security Enhanced Linux.
+-Read and write access permissions to security attributes depend on the
+-policy implemented for each security attribute by the security module.
+-When no security module is loaded, all processes have read access to
+-extended security attributes, and write access is limited to processes
+-that have the CAP_SYS_ADMIN capability.
+-.SS Extended system attributes
+-Extended system attributes are used by the kernel to store system
+-objects such as Access Control Lists and Capabilities. Read and write
+-access permissions to system attributes depend on the policy implemented
+-for each system attribute implemented by filesystems in the kernel.
+-.SS Trusted extended attributes
+-Trusted extended attributes are visible and accessible only to processes that
+-have the CAP_SYS_ADMIN capability (the super user usually has this
+-capability).
+-Attributes in this class are used to implement mechanisms in user
+-space (i.e., outside the kernel) which keep information in extended attributes
+-to which ordinary processes should not have access.
+-.SS Extended user attributes
+-Extended user attributes may be assigned to files and directories for
+-storing arbitrary additional information such as the mime type,
+-character set or encoding of a file. The access permissions for user
+-attributes are defined by the file permission bits.
+-.PP
+-The file permission bits of regular files and directories are
+-interpreted differently from the file permission bits of special files
+-and symbolic links. For regular files and directories the file
+-permission bits define access to the file's contents, while for device special
+-files they define access to the device described by the special file.
+-The file permissions of symbolic links are not used in access
+-checks. These differences would allow users to consume filesystem resources in
+-a way not controllable by disk quotas for group or world writable special files and directories.
+-.PP
+-For this reason, extended user attributes are only allowed for regular files and directories, and access to extended user attributes is restricted to the
+-owner and to users with appropriate capabilities for directories with the
+-sticky bit set (see the
+-.BR chmod (1)
+-manual page for an explanation of Sticky Directories).
+-.SH FILESYSTEM DIFFERENCES
+-The kernel and the filesystem may place limits on the maximum number
+-and size of extended attributes that can be associated with a file.
+-Some file systems, such as ext2/3 and reiserfs, require the filesystem
+-to be mounted with the
+-.B user_xattr
+-mount option in order for extended user attributes to be used.
+-.PP
+-In the current ext2, ext3 and ext4 filesystem implementations, each
+-extended attribute must fit on a single filesystem block (1024, 2048
+-or 4096 bytes, depending on the block size specified when the
+-filesystem was created).
+-.PP
+-In the XFS and reiserfs filesystem implementations, there is no
+-practical limit on the number or size of extended attributes
+-associated with a file, and the algorithms used to store extended
+-attribute information on disk are scalable.
+-.PP
+-In the JFS filesystem implementation, names can be up to 255 bytes and
+-values up to 65,535 bytes.
+-.SH ADDITIONAL NOTES
+-Since the filesystems on which extended attributes are stored might also
+-be used on architectures with a different byte order and machine word
+-size, care should be taken to store attribute values in an architecture
+-independent format.
+-.SH AUTHORS
+-Andreas Gruenbacher,
+-.RI < a.gruenbacher@bestbits.at >
+-and the SGI XFS development team,
+-.RI < linux-xfs@oss.sgi.com >.
+-.SH SEE ALSO
+-getfattr(1),
+-setfattr(1).
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/attr/files/Remove-the-section-2-man-pages.patch b/poky/meta/recipes-support/attr/files/Remove-the-section-2-man-pages.patch
new file mode 100644
index 000000000..044c5a037
--- /dev/null
+++ b/poky/meta/recipes-support/attr/files/Remove-the-section-2-man-pages.patch
@@ -0,0 +1,666 @@
+From b972600a26f3a930e53e2fce2625266a5d29813e Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <andreas.gruenbacher@gmail.com>
+Date: Tue, 14 Apr 2015 23:53:11 +0200
+Subject: [PATCH 1/2] Remove the section 2 man pages
+
+Commit 8d1263bca95722d66a6f8e83450f49d0956ea534 from upstream
+https://git.savannah.nongnu.org/git/attr.git/
+
+The section 2 man pages have long since been added to the man-pages package
+which documents all system calls; they were disabled in attr by default since
+January 2014. Get rid of them here.
+
+Upstream-Status: Backport
+
+[MA: modified to apply directly to v2.4.47]
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ man/Makefile | 2 +-
+ man/man2/Makefile | 35 -----------
+ man/man2/getxattr.2 | 143 --------------------------------------------
+ man/man2/listxattr.2 | 158 -------------------------------------------------
+ man/man2/removexattr.2 | 111 ----------------------------------
+ man/man2/setxattr.2 | 143 --------------------------------------------
+ 6 files changed, 1 insertion(+), 591 deletions(-)
+ delete mode 100644 man/man2/Makefile
+ delete mode 100644 man/man2/getxattr.2
+ delete mode 100644 man/man2/listxattr.2
+ delete mode 100644 man/man2/removexattr.2
+ delete mode 100644 man/man2/setxattr.2
+
+diff --git a/man/Makefile b/man/Makefile
+index 9535426..755daed 100644
+--- a/man/Makefile
++++ b/man/Makefile
+@@ -19,7 +19,7 @@
+ TOPDIR = ..
+ include $(TOPDIR)/include/builddefs
+
+-SUBDIRS = man1 man2 man3 man5
++SUBDIRS = man1 man3 man5
+
+ default : $(SUBDIRS)
+
+diff --git a/man/man2/Makefile b/man/man2/Makefile
+deleted file mode 100644
+index d77309d..0000000
+--- a/man/man2/Makefile
++++ /dev/null
+@@ -1,35 +0,0 @@
+-#
+-# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
+-# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de>
+-#
+-# This program is free software: you can redistribute it and/or modify it
+-# under the terms of the GNU General Public License as published by
+-# the Free Software Foundation, either version 2 of the License, or
+-# (at your option) any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+-#
+-
+-TOPDIR = ../..
+-include $(TOPDIR)/include/builddefs
+-
+-MAN_SECTION = 2
+-
+-MAN_PAGES = $(shell echo *.$(MAN_SECTION))
+-MAN_DEST = $(PKG_MAN_DIR)/man$(MAN_SECTION)
+-LSRCFILES = $(MAN_PAGES)
+-
+-default install : $(MAN_PAGES)
+-
+-include $(BUILDRULES)
+-
+-install-dev : default
+- $(INSTALL) -m 755 -d $(MAN_DEST)
+- $(INSTALL_MAN)
+-install-lib:
+diff --git a/man/man2/getxattr.2 b/man/man2/getxattr.2
+deleted file mode 100644
+index 405ad89..0000000
+--- a/man/man2/getxattr.2
++++ /dev/null
+@@ -1,143 +0,0 @@
+-.\"
+-.\" Extended attributes system calls manual pages
+-.\"
+-.\" (C) Andreas Gruenbacher, February 2001
+-.\" (C) Silicon Graphics Inc, September 2001
+-.\"
+-.\" This is free documentation; you can redistribute it and/or
+-.\" modify it under the terms of the GNU General Public License as
+-.\" published by the Free Software Foundation; either version 2 of
+-.\" the License, or (at your option) any later version.
+-.\"
+-.\" The GNU General Public License's references to "object code"
+-.\" and "executables" are to be interpreted as the output of any
+-.\" document formatting or typesetting system, including
+-.\" intermediate and printed output.
+-.\"
+-.\" This manual is distributed in the hope that it will be useful,
+-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-.\" GNU General Public License for more details.
+-.\"
+-.\" You should have received a copy of the GNU General Public
+-.\" License along with this manual. If not, see
+-.\" <http://www.gnu.org/licenses/>.
+-.\"
+-.TH GETXATTR 2 "Extended Attributes" "Dec 2001" "System calls"
+-.SH NAME
+-getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value
+-.SH SYNOPSIS
+-.fam C
+-.nf
+-.B #include <sys/types.h>
+-.B #include <attr/xattr.h>
+-.sp
+-.BI "ssize_t getxattr (const char\ *" path ", const char\ *" name ",
+-.BI "\t\t\t\t void\ *" value ", size_t " size );
+-.BI "ssize_t lgetxattr (const char\ *" path ", const char\ *" name ",
+-.BI "\t\t\t\t void\ *" value ", size_t " size );
+-.BI "ssize_t fgetxattr (int " filedes ", const char\ *" name ",
+-.BI "\t\t\t\t void\ *" value ", size_t " size );
+-.fi
+-.fam T
+-.SH DESCRIPTION
+-Extended attributes are
+-.IR name :\c
+-.I value
+-pairs associated with inodes (files, directories, symlinks, etc).
+-They are extensions to the normal attributes which are associated
+-with all inodes in the system (i.e. the
+-.BR stat (2)
+-data).
+-A complete overview of extended attributes concepts can be found in
+-.BR attr (5).
+-.PP
+-.B getxattr
+-retrieves the
+-.I value
+-of the extended attribute identified by
+-.I name
+-and associated with the given
+-.I path
+-in the filesystem.
+-The length of the attribute
+-.I value
+-is returned.
+-.PP
+-.B lgetxattr
+-is identical to
+-.BR getxattr ,
+-except in the case of a symbolic link, where the link itself is
+-interrogated, not the file that it refers to.
+-.PP
+-.B fgetxattr
+-is identical to
+-.BR getxattr ,
+-only the open file pointed to by
+-.I filedes
+-(as returned by
+-.BR open (2))
+-is interrogated in place of
+-.IR path .
+-.PP
+-An extended attribute
+-.I name
+-is a simple NULL-terminated string.
+-The name includes a namespace prefix \- there may be several, disjoint
+-namespaces associated with an individual inode.
+-The value of an extended attribute is a chunk of arbitrary textual or
+-binary data of specified length.
+-.PP
+-An empty buffer of
+-.I size
+-zero can be passed into these calls to return the current size of the
+-named extended attribute, which can be used to estimate the size of a
+-buffer which is sufficiently large to hold the value associated with
+-the extended attribute.
+-.PP
+-The interface is designed to allow guessing of initial buffer
+-sizes, and to enlarge buffers when the return value indicates
+-that the buffer provided was too small.
+-.SH RETURN VALUE
+-On success, a positive number is returned indicating the size of the
+-extended attribute value.
+-On failure, \-1 is returned and
+-.I errno
+-is set appropriately.
+-.PP
+-If the named attribute does not exist, or the process has no access to
+-this attribute,
+-.I errno
+-is set to ENOATTR.
+-.PP
+-If the
+-.I size
+-of the
+-.I value
+-buffer is too small to hold the result,
+-.I errno
+-is set to ERANGE.
+-.PP
+-If extended attributes are not supported by the filesystem, or are disabled,
+-.I errno
+-is set to ENOTSUP.
+-.PP
+-The errors documented for the
+-.BR stat (2)
+-system call are also applicable here.
+-.SH AUTHORS
+-Andreas Gruenbacher,
+-.RI < a.gruenbacher@bestbits.at >
+-and the SGI XFS development team,
+-.RI < linux-xfs@oss.sgi.com >.
+-Please send any bug reports or comments to these addresses.
+-.SH SEE ALSO
+-.BR getfattr (1),
+-.BR setfattr (1),
+-.BR open (2),
+-.BR stat (2),
+-.BR setxattr (2),
+-.BR listxattr (2),
+-.BR removexattr (2),
+-and
+-.BR attr (5).
+diff --git a/man/man2/listxattr.2 b/man/man2/listxattr.2
+deleted file mode 100644
+index 8b4371c..0000000
+--- a/man/man2/listxattr.2
++++ /dev/null
+@@ -1,158 +0,0 @@
+-.\"
+-.\" Extended attributes system calls manual pages
+-.\"
+-.\" (C) Andreas Gruenbacher, February 2001
+-.\" (C) Silicon Graphics Inc, September 2001
+-.\"
+-.\" This is free documentation; you can redistribute it and/or
+-.\" modify it under the terms of the GNU General Public License as
+-.\" published by the Free Software Foundation; either version 2 of
+-.\" the License, or (at your option) any later version.
+-.\"
+-.\" The GNU General Public License's references to "object code"
+-.\" and "executables" are to be interpreted as the output of any
+-.\" document formatting or typesetting system, including
+-.\" intermediate and printed output.
+-.\"
+-.\" This manual is distributed in the hope that it will be useful,
+-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-.\" GNU General Public License for more details.
+-.\"
+-.\" You should have received a copy of the GNU General Public
+-.\" License along with this manual. If not, see
+-.\" <http://www.gnu.org/licenses/>.
+-.\"
+-.TH LISTXATTR 2 "Extended Attributes" "Dec 2001" "System calls"
+-.SH NAME
+-listxattr, llistxattr, flistxattr \- list extended attribute names
+-.SH SYNOPSIS
+-.fam C
+-.nf
+-.B #include <sys/types.h>
+-.B #include <attr/xattr.h>
+-.sp
+-.BI "ssize_t listxattr (const char\ *" path ",
+-.BI "\t\t\t\t char\ *" list ", size_t " size );
+-.BI "ssize_t llistxattr (const char\ *" path ",
+-.BI "\t\t\t\t char\ *" list ", size_t " size );
+-.BI "ssize_t flistxattr (int " filedes ",
+-.BI "\t\t\t\t char\ *" list ", size_t " size );
+-.fi
+-.fam T
+-.SH DESCRIPTION
+-Extended attributes are name:value
+-pairs associated with inodes (files, directories, symlinks, etc).
+-They are extensions to the normal attributes which are associated
+-with all inodes in the system (i.e. the
+-.BR stat (2)
+-data).
+-A complete overview of extended attributes concepts can be found in
+-.BR attr (5).
+-.PP
+-.B listxattr
+-retrieves the
+-.I list
+-of extended attribute names associated with the given
+-.I path
+-in the filesystem.
+-The list is the set of (NULL-terminated) names, one after the other.
+-Names of extended attributes to which the calling process does not
+-have access may be omitted from the list.
+-The length of the attribute name
+-.I list
+-is returned.
+-.PP
+-.B llistxattr
+-is identical to
+-.BR listxattr ,
+-except in the case of a symbolic link, where the list of names of
+-extended attributes associated with the link itself is retrieved,
+-not the file that it refers to.
+-.I list
+-is a caller-allocated buffer of size
+-.IR size .
+-.PP
+-.B flistxattr
+-is identical to
+-.BR listxattr ,
+-only the open file pointed to by
+-.I filedes
+-(as returned by
+-.BR open (2))
+-is interrogated in place of
+-.IR path .
+-.PP
+-A single extended attribute
+-.I name
+-is a simple NULL-terminated string.
+-The name includes a namespace prefix \- there may be several, disjoint
+-namespaces associated with an individual inode.
+-.PP
+-An empty buffer of
+-.I size
+-zero can be passed into these calls to return the current size of the
+-list of extended attribute names, which can be used to estimate the
+-size of a buffer which is sufficiently large to hold the list of names.
+-.SH EXAMPLES
+-The
+-.I list
+-of names is returned as an unordered array of NULL-terminated character
+-strings (attribute names are separated by NULL characters), like this:
+-.fam C
+-.RS
+-.nf
+-user.name1\\0system.name1\\0user.name2\\0
+-.fi
+-.RE
+-.fam T
+-.P
+-Filesystems like ext2, ext3 and XFS which implement POSIX ACLs using
+-extended attributes, might return a
+-.I list
+-like this:
+-.fam C
+-.RS
+-.nf
+-system.posix_acl_access\\0system.posix_acl_default\\0
+-.fi
+-.RE
+-.fam T
+-.SH RETURN VALUE
+-On success, a positive number is returned indicating the size of the
+-extended attribute name list.
+-On failure, \-1 is returned and
+-.I errno
+-is set appropriately.
+-.PP
+-If the
+-.I size
+-of the
+-.I list
+-buffer is too small to hold the result,
+-.I errno
+-is set to ERANGE.
+-.PP
+-If extended attributes are not supported by the filesystem, or are disabled,
+-.I errno
+-is set to ENOTSUP.
+-.PP
+-The errors documented for the
+-.BR stat (2)
+-system call are also applicable here.
+-.SH AUTHORS
+-Andreas Gruenbacher,
+-.RI < a.gruenbacher@bestbits.at >
+-and the SGI XFS development team,
+-.RI < linux-xfs@oss.sgi.com >.
+-Please send any bug reports or comments to these addresses.
+-.SH SEE ALSO
+-.BR getfattr (1),
+-.BR setfattr (1),
+-.BR open (2),
+-.BR stat (2),
+-.BR getxattr (2),
+-.BR setxattr (2),
+-.BR removexattr (2),
+-and
+-.BR attr (5).
+diff --git a/man/man2/removexattr.2 b/man/man2/removexattr.2
+deleted file mode 100644
+index 2c7d934..0000000
+--- a/man/man2/removexattr.2
++++ /dev/null
+@@ -1,111 +0,0 @@
+-.\"
+-.\" Extended attributes system calls manual pages
+-.\"
+-.\" (C) Andreas Gruenbacher, February 2001
+-.\" (C) Silicon Graphics Inc, September 2001
+-.\"
+-.\" This is free documentation; you can redistribute it and/or
+-.\" modify it under the terms of the GNU General Public License as
+-.\" published by the Free Software Foundation; either version 2 of
+-.\" the License, or (at your option) any later version.
+-.\"
+-.\" The GNU General Public License's references to "object code"
+-.\" and "executables" are to be interpreted as the output of any
+-.\" document formatting or typesetting system, including
+-.\" intermediate and printed output.
+-.\"
+-.\" This manual is distributed in the hope that it will be useful,
+-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-.\" GNU General Public License for more details.
+-.\"
+-.\" You should have received a copy of the GNU General Public
+-.\" License along with this manual. If not, see
+-.\" <http://www.gnu.org/licenses/>.
+-.\"
+-.TH REMOVEXATTR 2 "Extended Attributes" "Dec 2001" "System calls"
+-.SH NAME
+-removexattr, lremovexattr, fremovexattr \- remove an extended attribute
+-.SH SYNOPSIS
+-.fam C
+-.nf
+-.B #include <sys/types.h>
+-.B #include <attr/xattr.h>
+-.sp
+-.BI "int removexattr (const char\ *" path ", const char\ *" name );
+-.BI "int lremovexattr (const char\ *" path ", const char\ *" name );
+-.BI "int fremovexattr (int " filedes ", const char\ *" name );
+-.fi
+-.fam T
+-.SH DESCRIPTION
+-Extended attributes are
+-.IR name :\c
+-value pairs associated with inodes (files, directories, symlinks, etc).
+-They are extensions to the normal attributes which are associated
+-with all inodes in the system (i.e. the
+-.BR stat (2)
+-data).
+-A complete overview of extended attributes concepts can be found in
+-.BR attr (5).
+-.PP
+-.B removexattr
+-removes the extended attribute identified by
+-.I name
+-and associated with the given
+-.I path
+-in the filesystem.
+-.PP
+-.B lremovexattr
+-is identical to
+-.BR removexattr ,
+-except in the case of a symbolic link, where the extended attribute is
+-removed from the link itself, not the file that it refers to.
+-.PP
+-.B fremovexattr
+-is identical to
+-.BR removexattr ,
+-only the extended attribute is removed from the open file pointed to by
+-.I filedes
+-(as returned by
+-.BR open (2))
+-in place of
+-.IR path .
+-.PP
+-An extended attribute name is a simple NULL-terminated string.
+-The
+-.I name
+-includes a namespace prefix \- there may be several, disjoint
+-namespaces associated with an individual inode.
+-.SH RETURN VALUE
+-On success, zero is returned.
+-On failure, \-1 is returned and
+-.I errno
+-is set appropriately.
+-.PP
+-If the named attribute does not exist,
+-.I errno
+-is set to ENOATTR.
+-.PP
+-If extended attributes are not supported by the filesystem, or are disabled,
+-.I errno
+-is set to ENOTSUP.
+-.PP
+-The errors documented for the
+-.BR stat (2)
+-system call are also applicable here.
+-.SH AUTHORS
+-Andreas Gruenbacher,
+-.RI < a.gruenbacher@bestbits.at >
+-and the SGI XFS development team,
+-.RI < linux-xfs@oss.sgi.com >.
+-Please send any bug reports or comments to these addresses.
+-.SH SEE ALSO
+-.BR getfattr (1),
+-.BR setfattr (1),
+-.BR open (2),
+-.BR stat (2),
+-.BR setxattr (2),
+-.BR getxattr (2),
+-.BR listxattr (2),
+-and
+-.BR attr (5).
+diff --git a/man/man2/setxattr.2 b/man/man2/setxattr.2
+deleted file mode 100644
+index b20dc9f..0000000
+--- a/man/man2/setxattr.2
++++ /dev/null
+@@ -1,143 +0,0 @@
+-.\"
+-.\" Extended attributes system calls manual pages
+-.\"
+-.\" (C) Andreas Gruenbacher, February 2001
+-.\" (C) Silicon Graphics Inc, September 2001
+-.\"
+-.\" This is free documentation; you can redistribute it and/or
+-.\" modify it under the terms of the GNU General Public License as
+-.\" published by the Free Software Foundation; either version 2 of
+-.\" the License, or (at your option) any later version.
+-.\"
+-.\" The GNU General Public License's references to "object code"
+-.\" and "executables" are to be interpreted as the output of any
+-.\" document formatting or typesetting system, including
+-.\" intermediate and printed output.
+-.\"
+-.\" This manual is distributed in the hope that it will be useful,
+-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-.\" GNU General Public License for more details.
+-.\"
+-.\" You should have received a copy of the GNU General Public
+-.\" License along with this manual. If not, see
+-.\" <http://www.gnu.org/licenses/>.
+-.\"
+-.TH SETXATTR 2 "Extended Attributes" "Dec 2001" "System calls"
+-.SH NAME
+-setxattr, lsetxattr, fsetxattr \- set an extended attribute value
+-.SH SYNOPSIS
+-.fam C
+-.nf
+-.B #include <sys/types.h>
+-.B #include <attr/xattr.h>
+-.sp
+-.BI "int setxattr (const char\ *" path ", const char\ *" name ",
+-.BI "\t\t\t const void\ *" value ", size_t " size ", int " flags );
+-.BI "int lsetxattr (const char\ *" path ", const char\ *" name ",
+-.BI "\t\t\t const void\ *" value ", size_t " size ", int " flags );
+-.BI "int fsetxattr (int " filedes ", const char\ *" name ",
+-.BI "\t\t\t const void\ *" value ", size_t " size ", int " flags );
+-.fi
+-.fam T
+-.SH DESCRIPTION
+-Extended attributes are
+-.IR name :\c
+-.I value
+-pairs associated with inodes (files, directories, symlinks, etc).
+-They are extensions to the normal attributes which are associated
+-with all inodes in the system (i.e. the
+-.BR stat (2)
+-data).
+-A complete overview of extended attributes concepts can be found in
+-.BR attr (5).
+-.PP
+-.B setxattr
+-sets the
+-.I value
+-of the extended attribute identified by
+-.I name
+-and associated with the given
+-.I path
+-in the filesystem.
+-The
+-.I size
+-of the
+-.I value
+-must be specified.
+-.PP
+-.B lsetxattr
+-is identical to
+-.BR setxattr ,
+-except in the case of a symbolic link, where the extended attribute is
+-set on the link itself, not the file that it refers to.
+-.PP
+-.B fsetxattr
+-is identical to
+-.BR setxattr ,
+-only the extended attribute is set on the open file pointed to by
+-.I filedes
+-(as returned by
+-.BR open (2))
+-in place of
+-.IR path .
+-.PP
+-An extended attribute name is a simple NULL-terminated string.
+-The
+-.I name
+-includes a namespace prefix \- there may be several, disjoint
+-namespaces associated with an individual inode.
+-The
+-.I value
+-of an extended attribute is a chunk of arbitrary textual or
+-binary data of specified length.
+-.PP
+-The
+-.I flags
+-parameter can be used to refine the semantics of the operation.
+-XATTR_CREATE specifies a pure create, which fails if the named
+-attribute exists already.
+-XATTR_REPLACE specifies a pure replace operation, which fails if the
+-named attribute does not already exist.
+-By default (no flags), the extended attribute will be created if
+-need be, or will simply replace the value if the attribute exists.
+-.SH RETURN VALUE
+-On success, zero is returned.
+-On failure, \-1 is returned and
+-.I errno
+-is set appropriately.
+-.PP
+-If XATTR_CREATE is specified, and the attribute exists already,
+-.I errno
+-is set to EEXIST.
+-If XATTR_REPLACE is specified, and the attribute does not exist,
+-.I errno
+-is set to ENOATTR.
+-.PP
+-If there is insufficient space remaining to store the extended attribute,
+-.I errno
+-is set to either ENOSPC, or EDQUOT if quota enforcement was the cause.
+-.PP
+-If extended attributes are not supported by the filesystem, or are disabled,
+-.I errno
+-is set to ENOTSUP.
+-.PP
+-The errors documented for the
+-.BR stat (2)
+-system call are also applicable here.
+-.SH AUTHORS
+-Andreas Gruenbacher,
+-.RI < a.gruenbacher@bestbits.at >
+-and the SGI XFS development team,
+-.RI < linux-xfs@oss.sgi.com >.
+-Please send any bug reports or comments to these addresses.
+-.SH SEE ALSO
+-.BR getfattr (1),
+-.BR setfattr (1),
+-.BR open (2),
+-.BR stat (2),
+-.BR getxattr (2),
+-.BR listxattr (2),
+-.BR removexattr (2),
+-and
+-.BR attr (5).
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/attr/files/relative-libdir.patch b/poky/meta/recipes-support/attr/files/relative-libdir.patch
new file mode 100644
index 000000000..b72bf184d
--- /dev/null
+++ b/poky/meta/recipes-support/attr/files/relative-libdir.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+use relative path in symbolic links, or it fails in staging
+sed expression from udev
+
+7/29/2010 - created by Qing He <qing.he@intel.com>
+
+diff -u include.orig/buildmacros include/buildmacros
+--- include.orig/buildmacros 2010-07-29 17:39:48.000000000 +0800
++++ include/buildmacros 2010-07-29 18:20:34.000000000 +0800
+@@ -88,9 +88,11 @@
+ ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+ ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+- ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
++ rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++ ../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++ ../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
++ rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++ ../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+ fi
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
diff --git a/poky/meta/recipes-support/attr/files/run-ptest b/poky/meta/recipes-support/attr/files/run-ptest
new file mode 100644
index 000000000..a6c6867f2
--- /dev/null
+++ b/poky/meta/recipes-support/attr/files/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+make -C test -k tests root-tests |sed \
+ -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \
+ -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|'
diff --git a/poky/meta/recipes-support/bash-completion/bash-completion_2.7.bb b/poky/meta/recipes-support/bash-completion/bash-completion_2.7.bb
new file mode 100644
index 000000000..f519b3f3d
--- /dev/null
+++ b/poky/meta/recipes-support/bash-completion/bash-completion_2.7.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Programmable Completion for Bash 4"
+HOMEPAGE = "http://bash-completion.alioth.debian.org/"
+BUGTRACKER = "https://alioth.debian.org/projects/bash-completion/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SECTION = "console/utils"
+
+SRC_URI = "https://github.com/scop/bash-completion/releases/download/${PV}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "28117492bdc9408438e6041683a423ce"
+SRC_URI[sha256sum] = "41ba892d3f427d4a686de32673f35401bc947a7801f684127120cdb13641441e"
+UPSTREAM_CHECK_REGEX = "bash-completion-(?P<pver>(?!2008).+)\.tar"
+UPSTREAM_CHECK_URI = "https://github.com/scop/bash-completion/releases"
+
+PARALLEL_MAKE = ""
+
+inherit autotools
+
+do_install_append() {
+ # compatdir
+ install -d ${D}${sysconfdir}/bash_completion.d/
+ echo '. ${datadir}/${BPN}/bash_completion' >${D}${sysconfdir}/bash_completion
+
+ # Delete files already provided by util-linux
+ local i
+ for i in mount umount rfkill; do
+ rm ${D}${datadir}/${BPN}/completions/$i
+ done
+}
+
+RDEPENDS_${PN} = "bash"
+
+# Some recipes are providing ${PN}-bash-completion packages
+PACKAGES =+ "${PN}-extra"
+FILES_${PN}-extra = "${datadir}/${BPN}/completions/ \
+ ${datadir}/${BPN}/helpers/"
+
+FILES_${PN}-dev += "${datadir}/cmake"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch b/poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch
new file mode 100644
index 000000000..b3298ce2d
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch
@@ -0,0 +1,34 @@
+Add config option --with-dev-dsp.
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+--- a/configure.ac
++++ b/configure.ac
+@@ -106,6 +106,16 @@ AC_ARG_WITH(python,[ --with-python[[=AR
+ fi
+ ])
+
++AC_ARG_WITH(dev-dsp,[ --with-dev-dsp enables dev/dsp for entropy producing. auto for auto-detecting dev/dep on host. [[default=no]]],[
++ if test "$withval" = yes; then
++ AC_DEFINE([HAVE_DEV_DSP], 1)
++ else
++ if test "$withval" = auto; then
++ ac_detect_dev_dsp=yes
++ fi
++ fi
++ ],[ac_detect_dev_dsp=no])
++
+ # Check for expert mode
+ if test "$ac_enable_expert_mode" = yes; then
+ BEE_EXPERT_MODE
+@@ -464,7 +474,7 @@ linux*)
+ ac_cv_have_dev_dsp=no
+ fi
+ ])
+- if test "$ac_cv_have_dev_dsp" = yes; then
++ if test "$ac_cv_have_dev_dsp" = yes && test "$ac_detect_dev_dsp" = yes; then
+ AC_DEFINE([HAVE_DEV_DSP], 1)
+ fi
+ ;;
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch b/poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch
new file mode 100644
index 000000000..3e5513fce
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch
@@ -0,0 +1,37 @@
+beecrypt: enable ptest support
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Add install-ptest rules.
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ Makefile.am | 3 +++
+ tests/Makefile.am | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index b7e7869..5076f59 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -73,3 +73,6 @@ DISTCLEANFILES = mpopt.s blowfishopt.s sha1opt.s
+
+ bench:
+ (cd tests && $(MAKE) $(AM_MAKEFLAGS) bench)
++
++install-ptest:
++ (cd tests && $(MAKE) $(AM_MAKEFLAGS) check_PROGRAMS)
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 1604e5e..d8db8d8 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -101,3 +101,6 @@ bench: benchme benchrsa benchhf benchbc
+ ./benchbc AES 128
+ ./benchbc Blowfish 128
+ ./benchbc Blowfish 128
++
++check_PROGRAMS:
++ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch b/poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch
new file mode 100644
index 000000000..91b1fa6ef
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch
@@ -0,0 +1,43 @@
+We are unable to run code at configure time in a cross environemnt, but as we
+control the build we can be fairly certain this dependency is met.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+JL 05/07/10
+Index: beecrypt-4.2.1/configure.ac
+===================================================================
+--- beecrypt-4.2.1.orig/configure.ac 2010-11-26 17:12:25.000000000 +0800
++++ beecrypt-4.2.1/configure.ac 2010-11-26 17:12:30.000000000 +0800
+@@ -292,32 +292,6 @@
+ # Predefines and checks for C++ API support
+ AH_TEMPLATE([CPPGLUE],[Define to 1 if you want to include the C++ code])
+
+-if test "$ac_with_cplusplus" = yes; then
+- AC_MSG_CHECKING([for IBM's ICU library version >= 2.8])
+- AC_LANG_PUSH(C)
+- AC_RUN_IFELSE([
+- AC_LANG_PROGRAM([[#include <unicode/uversion.h>]],[[
+- #if U_ICU_VERSION_MAJOR_NUM < 2
+- exit(1);
+- #elif U_ICU_VERSION_MAJOR_NUM == 2
+- # if U_ICU_VERSION_MINOR_NUM < 8
+- exit(1);
+- # else
+- exit(0);
+- # endif
+- #else
+- exit(0);
+- #endif
+- ]])],[
+- AC_MSG_RESULT([yes])
+- ],[
+- AC_MSG_RESULT([no])
+- AC_MSG_WARN([disabling cplusplus])
+- ac_with_cplusplus=no
+- ])
+- AC_LANG_POP(C)
+-fi
+-
+ AM_CONDITIONAL([WITH_CPLUSPLUS],[test "$ac_with_cplusplus" = yes])
+
+ if test "$ac_with_cplusplus" = yes ; then
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch b/poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch
new file mode 100644
index 000000000..8144e39be
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch
@@ -0,0 +1,39 @@
+
+gcc-4.7 seems to be stricter about some things, so follow
+the suggestion from the error/note information.
+
+ ../../x86_64-linux-libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..
+ x86_64-linux-libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -isyst
+ In file included from ../../include/beecrypt/c++/util/Hashtable.h:42:0,
+ from ../../include/beecrypt/c++/util/Properties.h:36,
+ from Properties.cxx:25:
+ ../../include/beecrypt/c++/util/AbstractSet.h: In instantiation of 'bool beecrypt::uti
+ Properties.cxx:228:1: required from here
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: error: 'containsAll' was not decl
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: declarations in dependent b
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: use 'this->containsAll' ins
+ ../../include/beecrypt/c++/util/AbstractSet.h: In instantiation of 'bool beecrypt::uti
+ Properties.cxx:228:1: required from here
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: error: 'containsAll' was not decl
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: declarations in dependent b
+ ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: use 'this->containsAll' ins
+
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: beecrypt-4.2.1/include/beecrypt/c++/util/AbstractSet.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/util/AbstractSet.h
++++ beecrypt-4.2.1/include/beecrypt/c++/util/AbstractSet.h
+@@ -56,7 +56,7 @@ namespace beecrypt {
+ if (c->size() != size())
+ return false;
+
+- return containsAll(*c);
++ return this->containsAll(*c);
+ }
+ return false;
+ }
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch b/poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch
new file mode 100644
index 000000000..6cb0c0020
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/fix-security.patch
@@ -0,0 +1,47 @@
+Fix visibility of various C++ functions, inspired by a similar patch in the Fink
+project:
+http://www.mail-archive.com/fink-commits@lists.sourceforge.net/msg75742.html
+
+JL 05/07/10
+
+Upstream-Status: Pending
+
+Index: beecrypt-4.2.1/include/beecrypt/c++/beeyond/BeeCertificate.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/beeyond/BeeCertificate.h 2010-11-26 17:22:57.000000000 +0800
++++ beecrypt-4.2.1/include/beecrypt/c++/beeyond/BeeCertificate.h 2010-11-26 17:23:01.000000000 +0800
+@@ -147,13 +147,13 @@
+ mutable bytearray* enc;
+
+ BeeCertificate();
+- BeeCertificate(InputStream& in) throw (IOException);
+
+ void encodeTBS(DataOutputStream& out) const throw (IOException);
+
+ bytearray* encodeTBS() const throw (CertificateEncodingException);
+
+ public:
++ BeeCertificate(InputStream& in) throw (IOException);
+ BeeCertificate(const BeeCertificate&) throw (CloneNotSupportedException);
+ virtual ~BeeCertificate();
+
+Index: beecrypt-4.2.1/include/beecrypt/c++/security/Security.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/security/Security.h 2010-11-26 17:20:55.000000000 +0800
++++ beecrypt-4.2.1/include/beecrypt/c++/security/Security.h 2010-11-26 17:21:36.000000000 +0800
+@@ -61,7 +61,6 @@
+ friend class SecureRandom;
+ friend class Signature;
+
+- private:
+ struct spi
+ {
+ Object* cspi;
+@@ -76,6 +75,7 @@
+ static spi* getSpi(const String& algo, const String& type, const Provider&) throw (NoSuchAlgorithmException);
+ static spi* getFirstSpi(const String& type);
+
++ private:
+ static const String& getKeyStoreDefault();
+
+ static bool _init;
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt/run-ptest b/poky/meta/recipes-support/beecrypt/beecrypt/run-ptest
new file mode 100644
index 000000000..2ee294d99
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd tests
+for i in `ls`; do ./$i; if [ $? -eq 0 ]; then echo "PASS: $i"; \
+ else echo "FAIL: $i"; fi; done
diff --git a/poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb b/poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb
new file mode 100644
index 000000000..1e626f154
--- /dev/null
+++ b/poky/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb
@@ -0,0 +1,48 @@
+# Beecrypt OE build file
+# Copyright (C) 2004-2005, Advanced Micro Devices, Inc. All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "A general-purpose cryptography library"
+HOMEPAGE = "http://sourceforge.net/projects/beecrypt"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/beecrypt/beecrypt-${PV}.tar.gz \
+ file://disable-icu-check.patch \
+ file://fix-security.patch \
+ file://fix-for-gcc-4.7.patch \
+ file://run-ptest \
+ file://beecrypt-enable-ptest-support.patch \
+ file://add-option-dev-dsp.patch \
+ "
+
+SRC_URI[md5sum] = "8441c014170823f2dff97e33df55af1e"
+SRC_URI[sha256sum] = "286f1f56080d1a6b1d024003a5fa2158f4ff82cae0c6829d3c476a4b5898c55d"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9894370afd5dfe7d02b8d14319e729a1 \
+ file://COPYING.LIB;md5=dcf3c825659e82539645da41a7908589 \
+ file://include/beecrypt/beecrypt.h;endline=20;md5=47a93eef539aac237eef86297a4d71c1"
+
+PR = "r3"
+
+inherit autotools multilib_header ptest
+acpaths=""
+
+do_install_append() {
+ oe_multilib_header beecrypt/gnu.h
+}
+
+EXTRA_OECONF = "--without-python --enable-shared --enable-static --disable-openmp --with-java=no"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cplusplus] = "--with-cplusplus,--without-cplusplus,icu"
+
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/*.a"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest () {
+ mkdir ${D}${PTEST_PATH}/tests
+ cp -r ${B}/tests/.libs/test* ${D}${PTEST_PATH}/tests
+}
diff --git a/poky/meta/recipes-support/bmap-tools/bmap-tools_3.4.bb b/poky/meta/recipes-support/bmap-tools/bmap-tools_3.4.bb
new file mode 100644
index 000000000..9d8191f33
--- /dev/null
+++ b/poky/meta/recipes-support/bmap-tools/bmap-tools_3.4.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Tools to generate block map (AKA bmap) and flash images using bmap"
+DESCRIPTION = "Bmap-tools - tools to generate block map (AKA bmap) and flash images using \
+bmap. Bmaptool is a generic tool for creating the block map (bmap) for a file, \
+and copying files using the block map. The idea is that large file containing \
+unused blocks, like raw system image files, can be copied or flashed a lot \
+faster with bmaptool than with traditional tools like "dd" or "cp"."
+HOMEPAGE = "https://github.com/01org/bmap-tools"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "https://github.com/intel/${BPN}/releases/download/v${PV}/${BP}.tgz"
+
+SRC_URI[md5sum] = "883420183611aa137cbaf68a91ef0d7e"
+SRC_URI[sha256sum] = "0064891270c180c190f41925b0f6fb9cecac3056f1168d2592dbe90e5f226c0a"
+
+UPSTREAM_CHECK_URI = "https://github.com/intel/${BPN}/releases"
+
+RDEPENDS_${PN} = "python3-core python3-compression python3-mmap python3-setuptools"
+
+inherit python3native
+inherit setuptools3
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/boost/bjam-native_1.66.0.bb b/poky/meta/recipes-support/boost/bjam-native_1.66.0.bb
new file mode 100644
index 000000000..92c86a3ef
--- /dev/null
+++ b/poky/meta/recipes-support/boost/bjam-native_1.66.0.bb
@@ -0,0 +1,19 @@
+require boost-${PV}.inc
+
+SUMMARY = "Portable Boost.Jam build tool for boost"
+SECTION = "devel"
+
+inherit native
+
+SRC_URI += "file://bjam-native-build-bjam.debug.patch \
+ file://0001-Fix-a-strange-assert-typo-how-was-this-released-with.patch"
+
+do_compile() {
+ ./bootstrap.sh --with-toolset=gcc
+}
+
+do_install() {
+ install -d ${D}${bindir}/
+ # install unstripped version for bjam
+ install -c -m 755 bjam.debug ${D}${bindir}/bjam
+}
diff --git a/poky/meta/recipes-support/boost/boost-1.66.0.inc b/poky/meta/recipes-support/boost/boost-1.66.0.inc
new file mode 100644
index 000000000..fe2b8639f
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost-1.66.0.inc
@@ -0,0 +1,21 @@
+# The Boost web site provides free peer-reviewed portable
+# C++ source libraries. The emphasis is on libraries which
+# work well with the C++ Standard Library. The libraries are
+# intended to be widely useful, and are in regular use by
+# thousands of programmers across a broad spectrum of applications.
+HOMEPAGE = "http://www.boost.org/"
+LICENSE = "BSL-1.0 & MIT & Python-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+BOOST_VER = "${@"_".join(d.getVar("PV").split("."))}"
+BOOST_MAJ = "${@"_".join(d.getVar("PV").split(".")[0:2])}"
+BOOST_P = "boost_${BOOST_VER}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/boost/boost/${PV}/${BOOST_P}.tar.bz2"
+SRC_URI[md5sum] = "b2dfbd6c717be4a7bb2d88018eaccf75"
+SRC_URI[sha256sum] = "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9"
+
+UPSTREAM_CHECK_URI = "http://www.boost.org/users/download/"
+UPSTREAM_CHECK_REGEX = "boostorg/release/(?P<pver>.*)/source/"
+
+S = "${WORKDIR}/${BOOST_P}"
diff --git a/poky/meta/recipes-support/boost/boost.inc b/poky/meta/recipes-support/boost/boost.inc
new file mode 100644
index 000000000..0461ec6fc
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost.inc
@@ -0,0 +1,200 @@
+SUMMARY = "Free peer-reviewed portable C++ source libraries"
+SECTION = "libs"
+DEPENDS = "bjam-native zlib bzip2"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BOOST_LIBS = "\
+ atomic \
+ chrono \
+ container \
+ date_time \
+ exception \
+ filesystem \
+ graph \
+ iostreams \
+ log \
+ math \
+ program_options \
+ random \
+ regex \
+ serialization \
+ signals \
+ system \
+ timer \
+ test \
+ thread \
+ wave \
+ "
+
+# only supported by x86 and powerpc
+BOOST_LIBS_append_x86 = " context coroutine"
+BOOST_LIBS_append_x86-64 = " context coroutine"
+BOOST_LIBS_append_powerpc = " context coroutine"
+# need consistent settings for native builds (x86 override not applied for native)
+BOOST_LIBS_remove_class-native = " context coroutine"
+# does not compile
+BOOST_LIBS_remove_mips16e = "wave"
+
+# optional libraries
+PACKAGECONFIG ??= "locale python"
+PACKAGECONFIG[locale] = ",,icu"
+PACKAGECONFIG[graph_parallel] = ",,,boost-mpi mpich"
+PACKAGECONFIG[mpi] = ",,mpich"
+PACKAGECONFIG[python] = ",,python3"
+
+BOOST_LIBS += "\
+ ${@bb.utils.filter('PACKAGECONFIG', 'locale python', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'graph_parallel', 'graph_parallel mpi', \
+ bb.utils.filter('PACKAGECONFIG', 'mpi', d), d)} \
+"
+
+inherit python3-dir
+PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
+
+# Make a package for each library, plus -dev
+PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
+python __anonymous () {
+ packages = []
+ extras = []
+ for lib in d.getVar('BOOST_LIBS').split():
+ extras.append("--with-%s" % lib)
+ pkg = "boost-%s" % lib.replace("_", "-")
+ packages.append(pkg)
+ if not d.getVar("FILES_%s" % pkg):
+ d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
+ d.setVar("BOOST_PACKAGES", " ".join(packages))
+ d.setVar("BJAM_EXTRA", " ".join(extras))
+}
+
+# Override the contents of specific packages
+FILES_${PN}-graph_parallel = "${libdir}/libboost_graph_parallel.so.*"
+FILES_${PN}-locale = "${libdir}/libboost_locale.so.*"
+FILES_${PN}-mpi = "${libdir}/mpi.so ${libdir}/libboost_mpi*.so.*"
+FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
+ ${libdir}/libboost_wserialization*.so.*"
+FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
+ ${libdir}/libboost_unit_test_framework*.so.*"
+
+# -dev last to pick up the remaining stuff
+PACKAGES += "${PN}-dev ${PN}-staticdev"
+FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
+FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
+
+# "boost" is a metapackage which pulls in all boost librabries
+PACKAGES += "${PN}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_class-native = ""
+
+# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+# Oh yippee, a new build system, it's sooo cooool I could eat my own
+# foot. inlining=on lets the compiler choose, I think. At least this
+# stuff is documented...
+# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
+# objcopy will be invoked, and that won't work. Building debug apparently
+# requires hacking gcc-tools.jam
+#
+# Sometimes I wake up screaming. Famous figures are gathered in the nightmare,
+# Steve Bourne, Larry Wall, the whole of the ANSI C committee. They're just
+# standing there, waiting, but the truely terrifying thing is what they carry
+# in their hands. At first sight each seems to bear the same thing, but it is
+# not so for the forms in their grasp are ever so slightly different one from
+# the other. Each is twisted in some grotesque way from the other to make each
+# an unspeakable perversion impossible to perceive without the onset of madness.
+# True insanity awaits anyone who perceives all of these horrors together.
+#
+# Quotation marks, there might be an easier way to do this, but I can't find
+# it. The problem is that the user.hpp configuration file must receive a
+# pre-processor macro defined as the appropriate string - complete with "'s
+# around it. (<> is a possibility here but the danger to that is that the
+# failure case interprets the < and > as shell redirections, creating
+# random files in the source tree.)
+#
+#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
+#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
+SQD = '"'
+EQD = '\"'
+#boost.bb: "... '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
+BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
+
+BJAM_TOOLS = "--ignore-site-config \
+ '-sTOOLS=gcc' \
+ '-sGCC=${CC} '${BJAM_CONF} \
+ '-sGXX=${CXX} '${BJAM_CONF} \
+ '-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
+ '-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
+ '-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
+ '-sPYTHON_ROOT=${PYTHON_ROOT}' \
+ '--layout=system' \
+ "
+
+# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater parallelism causes bjam to segfault or to ignore -j
+# https://svn.boost.org/trac/boost/ticket/7634
+BOOST_PARALLEL_MAKE = "${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}"
+BJAM_OPTS = '${BOOST_PARALLEL_MAKE} -d+2 -q \
+ ${BJAM_TOOLS} \
+ -sBOOST_BUILD_USER_CONFIG=${WORKDIR}/user-config.jam \
+ --build-dir=${S}/${TARGET_SYS} \
+ --disable-icu \
+ ${BJAM_EXTRA}'
+
+# Native compilation of bzip2 isn't working
+BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
+
+# Adjust the build for x32
+BJAM_OPTS_append_x86-x32 = " abi=x32 address-model=64"
+
+do_configure() {
+ cp -f ${S}/boost/config/platform/linux.hpp ${S}/boost/config/platform/linux-gnueabi.hpp
+
+ # D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
+ rm -f ${WORKDIR}/user-config.jam
+ echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${WORKDIR}/user-config.jam
+
+ # If we want Python then we need to tell Boost *exactly* where to find it
+ if ${@bb.utils.contains('BOOST_LIBS', 'python', 'true', 'false', d)}; then
+ echo "using python : ${PYTHON_BASEVERSION} : ${STAGING_DIR_HOST}${bindir}/python3 : ${STAGING_DIR_HOST}${includedir}/${PYTHON_DIR}${PYTHON_ABI} : ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR} ;" >> ${WORKDIR}/user-config.jam
+ fi
+
+ if ${@bb.utils.contains('BOOST_LIBS', 'mpi', 'true', 'false', d)}; then
+ echo "using mpi : : <find-shared-library>mpi ;" >> ${WORKDIR}/user-config.jam
+ fi
+
+ CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc
+
+ # Boost can't be trusted to find Python on it's own, so remove any mention
+ # of it from the boost configuration
+ sed -i '/using python/d' ${S}/project-config.jam
+}
+
+do_compile() {
+ rm -rf ${S}/${TARGET_SYS}
+ bjam ${BJAM_OPTS} --prefix=${prefix} \
+ --exec-prefix=${exec_prefix} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --debug-configuration
+}
+
+do_install() {
+ bjam ${BJAM_OPTS} \
+ --libdir=${D}${libdir} \
+ --includedir=${D}${includedir} \
+ install
+ for lib in ${BOOST_LIBS}; do
+ if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
+ ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
+ fi
+ if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
+ ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
+ fi
+ done
+
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch b/poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch
new file mode 100644
index 000000000..169906344
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/0001-Apply-boost-1.62.0-no-forced-flags.patch.patch
@@ -0,0 +1,100 @@
+From 8845a786598f1d9e83aa1b7d2966b0d1eb765ba0 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:14:31 -0700
+Subject: [PATCH 1/3] Apply boost-1.62.0-no-forced-flags.patch
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ libs/log/build/Jamfile.v2 | 4 ++--
+ libs/log/config/x86-ext/Jamfile.jam | 16 ++++++++--------
+ libs/log/src/dump_avx2.cpp | 4 ++++
+ libs/log/src/dump_ssse3.cpp | 4 ++++
+ 4 files changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/libs/log/build/Jamfile.v2 b/libs/log/build/Jamfile.v2
+index 4abbdbc..b3016fc 100644
+--- a/libs/log/build/Jamfile.v2
++++ b/libs/log/build/Jamfile.v2
+@@ -373,7 +373,7 @@ rule avx2-targets-cond ( properties * )
+ }
+ else if <toolset>clang in $(properties)
+ {
+- result = <cxxflags>"-mavx -mavx2" ;
++ result = <cxxflags> ;
+ }
+ else if <toolset>intel in $(properties)
+ {
+@@ -383,7 +383,7 @@ rule avx2-targets-cond ( properties * )
+ }
+ else
+ {
+- result = <cxxflags>"-xCORE-AVX2 -fabi-version=0" ;
++ result = <cxxflags>"-fabi-version=0" ;
+ }
+ }
+ else if <toolset>msvc in $(properties)
+diff --git a/libs/log/config/x86-ext/Jamfile.jam b/libs/log/config/x86-ext/Jamfile.jam
+index 0e9695a..dcc394d 100644
+--- a/libs/log/config/x86-ext/Jamfile.jam
++++ b/libs/log/config/x86-ext/Jamfile.jam
+@@ -15,19 +15,19 @@ project /boost/log/x86-extensions
+
+ obj ssse3 : ssse3.cpp
+ :
+- <toolset>gcc:<cxxflags>"-msse -msse2 -msse3 -mssse3"
+- <toolset>clang:<cxxflags>"-msse -msse2 -msse3 -mssse3"
+- <toolset>intel-linux:<cxxflags>"-xSSSE3"
+- <toolset>intel-darwin:<cxxflags>"-xSSSE3"
++ <toolset>gcc:<cxxflags>
++ <toolset>clang:<cxxflags>
++ <toolset>intel-linux:<cxxflags>
++ <toolset>intel-darwin:<cxxflags>
+ <toolset>intel-win:<cxxflags>"/QxSSSE3"
+ ;
+
+ obj avx2 : avx2.cpp
+ :
+- <toolset>gcc:<cxxflags>"-mavx -mavx2 -fabi-version=0"
+- <toolset>clang:<cxxflags>"-mavx -mavx2"
+- <toolset>intel-linux:<cxxflags>"-xCORE-AVX2 -fabi-version=0"
+- <toolset>intel-darwin:<cxxflags>"-xCORE-AVX2 -fabi-version=0"
++ <toolset>gcc:<cxxflags>"-fabi-version=0"
++ <toolset>clang:<cxxflags>
++ <toolset>intel-linux:<cxxflags>"-fabi-version=0"
++ <toolset>intel-darwin:<cxxflags>"-fabi-version=0"
+ <toolset>intel-win:<cxxflags>"/arch:CORE-AVX2"
+ <toolset>msvc:<cxxflags>"/arch:AVX"
+ ;
+diff --git a/libs/log/src/dump_avx2.cpp b/libs/log/src/dump_avx2.cpp
+index 4ab1250..610fc6d 100644
+--- a/libs/log/src/dump_avx2.cpp
++++ b/libs/log/src/dump_avx2.cpp
+@@ -22,6 +22,10 @@
+ #include <boost/cstdint.hpp>
+ #include <boost/log/detail/header.hpp>
+
++#if !defined(__AVX2__)
++#error "AVX2 Unsupported!"
++#endif
++
+ #if defined(__x86_64) || defined(__x86_64__) || \
+ defined(__amd64__) || defined(__amd64) || \
+ defined(_M_X64)
+diff --git a/libs/log/src/dump_ssse3.cpp b/libs/log/src/dump_ssse3.cpp
+index 1325b49..60d4112 100644
+--- a/libs/log/src/dump_ssse3.cpp
++++ b/libs/log/src/dump_ssse3.cpp
+@@ -22,6 +22,10 @@
+ #include <boost/cstdint.hpp>
+ #include <boost/log/detail/header.hpp>
+
++#if !defined(__SSSE3__)
++#error "SSSE3 Unsupported!"
++#endif
++
+ #if defined(__x86_64) || defined(__x86_64__) || \
+ defined(__amd64__) || defined(__amd64) || \
+ defined(_M_X64)
+--
+2.8.0
diff --git a/poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch b/poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch
new file mode 100644
index 000000000..26f3cbb05
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch
@@ -0,0 +1,65 @@
+From e4d3a7470b307693660d0412732e7266d1738d8c Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:29:17 -0700
+Subject: [PATCH 6/6] Don't set up -m32/-m64, we do that ourselves
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+---
+ tools/build/src/tools/gcc.jam | 39 ---------------------------------------
+ 1 file changed, 39 deletions(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index e4fc6c32..37914fd0 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -337,45 +337,6 @@ rule set-address-model-options ( targets * : sources * : properties * )
+ {
+ local option ;
+ local target-os = [ feature.get-values target-os : $(properties) ] ;
+- if $(target-os) = aix
+- {
+- if $(model) = 32
+- {
+- option = -maix32 ;
+- }
+- else
+- {
+- option = -maix64 ;
+- }
+- }
+- else if $(target-os) = hpux
+- {
+- if $(model) = 32
+- {
+- option = -milp32 ;
+- }
+- else
+- {
+- option = -mlp64 ;
+- }
+- }
+- else
+- {
+- local arch = [ feature.get-values architecture : $(properties) ] ;
+- if $(arch) = power || $(arch) = sparc || $(arch) = x86
+- {
+- if $(model) = 32
+- {
+- option = -m32 ;
+- }
+- else if $(model) = 64
+- {
+- option = -m64 ;
+- }
+- }
+- # For darwin, the model can be 32_64. darwin.jam will handle that
+- # on its own.
+- }
+ OPTIONS on $(targets) += $(option) ;
+ }
+ }
+--
+2.15.1
+
diff --git a/poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch b/poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch
new file mode 100644
index 000000000..fb6d9711b
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch
@@ -0,0 +1,151 @@
+From 0868761e7d2d75d472090e3ef96f3d2f9ced27f3 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 10:29:32 -0700
+Subject: [PATCH 5/6] Don't set up arch/instruction-set flags, we do that
+ ourselves
+
+Upstream-Status: Inappropriate
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+---
+ tools/build/src/tools/gcc.jam | 127 ------------------------------------------
+ 1 file changed, 127 deletions(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index e3b1b952..e4fc6c32 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -1276,130 +1276,3 @@ local rule cpu-flags ( toolset variable : architecture : instruction-set + :
+ <architecture>$(architecture)/<instruction-set>$(instruction-set)
+ : $(values) ;
+ }
+-
+-
+-# Set architecture/instruction-set options.
+-#
+-# x86 and compatible
+-# The 'native' option appeared in gcc 4.2 so we cannot safely use it as default.
+-# Use i686 instead for 32-bit.
+-toolset.flags gcc OPTIONS <architecture>x86/<address-model>32/<instruction-set> : -march=i686 ;
+-cpu-flags gcc OPTIONS : x86 : native : -march=native ;
+-cpu-flags gcc OPTIONS : x86 : i486 : -march=i486 ;
+-cpu-flags gcc OPTIONS : x86 : i586 : -march=i586 ;
+-cpu-flags gcc OPTIONS : x86 : i686 : -march=i686 ;
+-cpu-flags gcc OPTIONS : x86 : pentium : -march=pentium ;
+-cpu-flags gcc OPTIONS : x86 : pentium-mmx : -march=pentium-mmx ;
+-cpu-flags gcc OPTIONS : x86 : pentiumpro : -march=pentiumpro ;
+-cpu-flags gcc OPTIONS : x86 : pentium2 : -march=pentium2 ;
+-cpu-flags gcc OPTIONS : x86 : pentium3 : -march=pentium3 ;
+-cpu-flags gcc OPTIONS : x86 : pentium3m : -march=pentium3m ;
+-cpu-flags gcc OPTIONS : x86 : pentium-m : -march=pentium-m ;
+-cpu-flags gcc OPTIONS : x86 : pentium4 : -march=pentium4 ;
+-cpu-flags gcc OPTIONS : x86 : pentium4m : -march=pentium4m ;
+-cpu-flags gcc OPTIONS : x86 : prescott : -march=prescott ;
+-cpu-flags gcc OPTIONS : x86 : nocona : -march=nocona ;
+-cpu-flags gcc OPTIONS : x86 : core2 : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : conroe-l : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : allendale : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : wolfdale : -march=core2 -msse4.1 ;
+-cpu-flags gcc OPTIONS : x86 : merom : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : merom-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : kentsfield : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : kentsfield-xe : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : yorksfield : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : penryn : -march=core2 ;
+-cpu-flags gcc OPTIONS : x86 : corei7 : -march=corei7 ;
+-cpu-flags gcc OPTIONS : x86 : nehalem : -march=corei7 ;
+-cpu-flags gcc OPTIONS : x86 : corei7-avx : -march=corei7-avx ;
+-cpu-flags gcc OPTIONS : x86 : sandy-bridge : -march=corei7-avx ;
+-cpu-flags gcc OPTIONS : x86 : core-avx-i : -march=core-avx-i ;
+-cpu-flags gcc OPTIONS : x86 : ivy-bridge : -march=core-avx-i ;
+-cpu-flags gcc OPTIONS : x86 : haswell : -march=core-avx-i -mavx2 -mfma -mbmi -mbmi2 -mlzcnt ;
+-cpu-flags gcc OPTIONS : x86 : broadwell : -march=broadwell ;
+-cpu-flags gcc OPTIONS : x86 : skylake : -march=skylake ;
+-cpu-flags gcc OPTIONS : x86 : skylake-avx512 : -march=skylake-avx512 ;
+-cpu-flags gcc OPTIONS : x86 : cannonlake : -march=skylake-avx512 -mavx512vbmi -mavx512ifma -msha ;
+-cpu-flags gcc OPTIONS : x86 : k6 : -march=k6 ;
+-cpu-flags gcc OPTIONS : x86 : k6-2 : -march=k6-2 ;
+-cpu-flags gcc OPTIONS : x86 : k6-3 : -march=k6-3 ;
+-cpu-flags gcc OPTIONS : x86 : athlon : -march=athlon ;
+-cpu-flags gcc OPTIONS : x86 : athlon-tbird : -march=athlon-tbird ;
+-cpu-flags gcc OPTIONS : x86 : athlon-4 : -march=athlon-4 ;
+-cpu-flags gcc OPTIONS : x86 : athlon-xp : -march=athlon-xp ;
+-cpu-flags gcc OPTIONS : x86 : athlon-mp : -march=athlon-mp ;
+-##
+-cpu-flags gcc OPTIONS : x86 : k8 : -march=k8 ;
+-cpu-flags gcc OPTIONS : x86 : opteron : -march=opteron ;
+-cpu-flags gcc OPTIONS : x86 : athlon64 : -march=athlon64 ;
+-cpu-flags gcc OPTIONS : x86 : athlon-fx : -march=athlon-fx ;
+-cpu-flags gcc OPTIONS : x86 : k8-sse3 : -march=k8-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : opteron-sse3 : -march=opteron-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : athlon64-sse3 : -march=athlon64-sse3 ;
+-cpu-flags gcc OPTIONS : x86 : amdfam10 : -march=amdfam10 ;
+-cpu-flags gcc OPTIONS : x86 : barcelona : -march=barcelona ;
+-cpu-flags gcc OPTIONS : x86 : bdver1 : -march=bdver1 ;
+-cpu-flags gcc OPTIONS : x86 : bdver2 : -march=bdver2 ;
+-cpu-flags gcc OPTIONS : x86 : bdver3 : -march=bdver3 ;
+-cpu-flags gcc OPTIONS : x86 : bdver4 : -march=bdver4 ;
+-cpu-flags gcc OPTIONS : x86 : btver1 : -march=btver1 ;
+-cpu-flags gcc OPTIONS : x86 : btver2 : -march=btver2 ;
+-cpu-flags gcc OPTIONS : x86 : znver1 : -march=znver1 ;
+-cpu-flags gcc OPTIONS : x86 : winchip-c6 : -march=winchip-c6 ;
+-cpu-flags gcc OPTIONS : x86 : winchip2 : -march=winchip2 ;
+-cpu-flags gcc OPTIONS : x86 : c3 : -march=c3 ;
+-cpu-flags gcc OPTIONS : x86 : c3-2 : -march=c3-2 ;
+-##
+-cpu-flags gcc OPTIONS : x86 : atom : -march=atom ;
+-# Sparc
+-cpu-flags gcc OPTIONS : sparc : v7 : -mcpu=v7 : default ;
+-cpu-flags gcc OPTIONS : sparc : cypress : -mcpu=cypress ;
+-cpu-flags gcc OPTIONS : sparc : v8 : -mcpu=v8 ;
+-cpu-flags gcc OPTIONS : sparc : supersparc : -mcpu=supersparc ;
+-cpu-flags gcc OPTIONS : sparc : sparclite : -mcpu=sparclite ;
+-cpu-flags gcc OPTIONS : sparc : hypersparc : -mcpu=hypersparc ;
+-cpu-flags gcc OPTIONS : sparc : sparclite86x : -mcpu=sparclite86x ;
+-cpu-flags gcc OPTIONS : sparc : f930 : -mcpu=f930 ;
+-cpu-flags gcc OPTIONS : sparc : f934 : -mcpu=f934 ;
+-cpu-flags gcc OPTIONS : sparc : sparclet : -mcpu=sparclet ;
+-cpu-flags gcc OPTIONS : sparc : tsc701 : -mcpu=tsc701 ;
+-cpu-flags gcc OPTIONS : sparc : v9 : -mcpu=v9 ;
+-cpu-flags gcc OPTIONS : sparc : ultrasparc : -mcpu=ultrasparc ;
+-cpu-flags gcc OPTIONS : sparc : ultrasparc3 : -mcpu=ultrasparc3 ;
+-# RS/6000 & PowerPC
+-cpu-flags gcc OPTIONS : power : 403 : -mcpu=403 ;
+-cpu-flags gcc OPTIONS : power : 505 : -mcpu=505 ;
+-cpu-flags gcc OPTIONS : power : 601 : -mcpu=601 ;
+-cpu-flags gcc OPTIONS : power : 602 : -mcpu=602 ;
+-cpu-flags gcc OPTIONS : power : 603 : -mcpu=603 ;
+-cpu-flags gcc OPTIONS : power : 603e : -mcpu=603e ;
+-cpu-flags gcc OPTIONS : power : 604 : -mcpu=604 ;
+-cpu-flags gcc OPTIONS : power : 604e : -mcpu=604e ;
+-cpu-flags gcc OPTIONS : power : 620 : -mcpu=620 ;
+-cpu-flags gcc OPTIONS : power : 630 : -mcpu=630 ;
+-cpu-flags gcc OPTIONS : power : 740 : -mcpu=740 ;
+-cpu-flags gcc OPTIONS : power : 7400 : -mcpu=7400 ;
+-cpu-flags gcc OPTIONS : power : 7450 : -mcpu=7450 ;
+-cpu-flags gcc OPTIONS : power : 750 : -mcpu=750 ;
+-cpu-flags gcc OPTIONS : power : 801 : -mcpu=801 ;
+-cpu-flags gcc OPTIONS : power : 821 : -mcpu=821 ;
+-cpu-flags gcc OPTIONS : power : 823 : -mcpu=823 ;
+-cpu-flags gcc OPTIONS : power : 860 : -mcpu=860 ;
+-cpu-flags gcc OPTIONS : power : 970 : -mcpu=970 ;
+-cpu-flags gcc OPTIONS : power : 8540 : -mcpu=8540 ;
+-cpu-flags gcc OPTIONS : power : power : -mcpu=power ;
+-cpu-flags gcc OPTIONS : power : power2 : -mcpu=power2 ;
+-cpu-flags gcc OPTIONS : power : power3 : -mcpu=power3 ;
+-cpu-flags gcc OPTIONS : power : power4 : -mcpu=power4 ;
+-cpu-flags gcc OPTIONS : power : power5 : -mcpu=power5 ;
+-cpu-flags gcc OPTIONS : power : powerpc : -mcpu=powerpc ;
+-cpu-flags gcc OPTIONS : power : powerpc64 : -mcpu=powerpc64 ;
+-cpu-flags gcc OPTIONS : power : rios : -mcpu=rios ;
+-cpu-flags gcc OPTIONS : power : rios1 : -mcpu=rios1 ;
+-cpu-flags gcc OPTIONS : power : rios2 : -mcpu=rios2 ;
+-cpu-flags gcc OPTIONS : power : rsc : -mcpu=rsc ;
+-cpu-flags gcc OPTIONS : power : rs64a : -mcpu=rs64 ;
+-# AIX variant of RS/6000 & PowerPC
+-toolset.flags gcc AROPTIONS <address-model>64/<target-os>aix : "-X64" ;
+--
+2.15.1
+
diff --git a/poky/meta/recipes-support/boost/boost/arm-intrinsics.patch b/poky/meta/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 000000000..fe85c69a8
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/arm-intrinsics.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Backport
+
+8/17/2010 - rebased to 1.44 by Qing He <qing.he@intel.com>
+
+diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp
+index b6359b5..78b1cc2 100644
+--- a/boost/smart_ptr/detail/atomic_count_sync.hpp
++++ b/boost/smart_ptr/detail/atomic_count_sync.hpp
+@@ -33,17 +33,46 @@ public:
+
+ long operator++()
+ {
++#ifdef __ARM_ARCH_7A__
++ int v1, tmp;
++ asm volatile ("1: \n\t"
++ "ldrex %0, %1 \n\t"
++ "add %0 ,%0, #1 \n\t"
++ "strex %2, %0, %1 \n\t"
++ "cmp %2, #0 \n\t"
++ "bne 1b \n\t"
++ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++ );
++#else
+ return __sync_add_and_fetch( &value_, 1 );
++#endif
+ }
+
+ long operator--()
+ {
++#ifdef __ARM_ARCH_7A__
++ int v1, tmp;
++ asm volatile ("1: \n\t"
++ "ldrex %0, %1 \n\t"
++ "sub %0 ,%0, #1 \n\t"
++ "strex %2, %0, %1 \n\t"
++ "cmp %2, #0 \n\t"
++ "bne 1b \n\t"
++ : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++ );
++ return value_;
++#else
+ return __sync_add_and_fetch( &value_, -1 );
++#endif
+ }
+
+ operator long() const
+ {
++#if __ARM_ARCH_7A__
++ return value_;
++#else
+ return __sync_fetch_and_add( &value_, 0 );
++#endif
+ }
+
+ private:
diff --git a/poky/meta/recipes-support/boost/boost/boost-CVE-2012-2677.patch b/poky/meta/recipes-support/boost/boost/boost-CVE-2012-2677.patch
new file mode 100644
index 000000000..917617a04
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/boost-CVE-2012-2677.patch
@@ -0,0 +1,112 @@
+Reference
+
+https://svn.boost.org/trac/boost/changeset/78326
+
+Upstream-Status: Backport
+CVE: CVE-2012-2677
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+
+diff --git a/boost/pool/pool.hpp.old b/boost/pool/pool.hpp
+index c47b11f..417a1e0 100644
+--- a/boost/pool/pool.hpp.old
++++ b/boost/pool/pool.hpp
+@@ -26,6 +26,8 @@
+
+ #include <boost/pool/poolfwd.hpp>
+
++// std::numeric_limits
++#include <boost/limits.hpp>
+ // boost::integer::static_lcm
+ #include <boost/integer/common_factor_ct.hpp>
+ // boost::simple_segregated_storage
+@@ -355,6 +357,15 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
+ return s;
+ }
+
++ size_type max_chunks() const
++ { //! Calculated maximum number of memory chunks that can be allocated in a single call by this Pool.
++ size_type partition_size = alloc_size();
++ size_type POD_size = integer::static_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
++ size_type max_chunks = (std::numeric_limits<size_type>::max() - POD_size) / alloc_size();
++
++ return max_chunks;
++ }
++
+ static void * & nextof(void * const ptr)
+ { //! \returns Pointer dereferenced.
+ //! (Provided and used for the sake of code readability :)
+@@ -375,6 +386,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
+ //! the first time that object needs to allocate system memory.
+ //! The default is 32. This parameter may not be 0.
+ //! \param nmax_size is the maximum number of chunks to allocate in one block.
++ set_next_size(nnext_size);
++ set_max_size(nmax_size);
+ }
+
+ ~pool()
+@@ -398,8 +411,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
+ }
+ void set_next_size(const size_type nnext_size)
+ { //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
+- //! \returns nnext_size.
+- next_size = start_size = nnext_size;
++ BOOST_USING_STD_MIN();
++ next_size = start_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nnext_size, max_chunks());
+ }
+ size_type get_max_size() const
+ { //! \returns max_size.
+@@ -407,7 +420,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
+ }
+ void set_max_size(const size_type nmax_size)
+ { //! Set max_size.
+- max_size = nmax_size;
++ BOOST_USING_STD_MIN();
++ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
+ }
+ size_type get_requested_size() const
+ { //! \returns the requested size passed into the constructor.
+@@ -708,9 +722,9 @@ void * pool<UserAllocator>::malloc_need_resize()
+
+ BOOST_USING_STD_MIN();
+ if(!max_size)
+- next_size <<= 1;
++ set_next_size(next_size << 1);
+ else if( next_size*partition_size/requested_size < max_size)
+- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
+
+ // initialize it,
+ store().add_block(node.begin(), node.element_size(), partition_size);
+@@ -748,9 +762,9 @@ void * pool<UserAllocator>::ordered_malloc_need_resize()
+
+ BOOST_USING_STD_MIN();
+ if(!max_size)
+- next_size <<= 1;
++ set_next_size(next_size << 1);
+ else if( next_size*partition_size/requested_size < max_size)
+- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
+
+ // initialize it,
+ // (we can use "add_block" here because we know that
+@@ -792,6 +806,8 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
+ { //! Gets address of a chunk n, allocating new memory if not already available.
+ //! \returns Address of chunk n if allocated ok.
+ //! \returns 0 if not enough memory for n chunks.
++ if (n > max_chunks())
++ return 0;
+
+ const size_type partition_size = alloc_size();
+ const size_type total_req_size = n * requested_size;
+@@ -840,9 +856,9 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
+
+ BOOST_USING_STD_MIN();
+ if(!max_size)
+- next_size <<= 1;
++ set_next_size(next_size << 1);
+ else if( next_size*partition_size/requested_size < max_size)
+- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
++ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
+
+ // insert it into the list,
+ // handle border case.
diff --git a/poky/meta/recipes-support/boost/boost/boost-math-disable-pch-for-gcc.patch b/poky/meta/recipes-support/boost/boost/boost-math-disable-pch-for-gcc.patch
new file mode 100644
index 000000000..595ba1786
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost/boost-math-disable-pch-for-gcc.patch
@@ -0,0 +1,31 @@
+From cabfcba1ff7511ffd6b91ca244288d44f585aad2 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Fri, 23 Sep 2016 01:04:50 -0700
+Subject: [PATCH] boost-math: disable pch for gcc
+
+Upstream-Status: Inappropriate [*]
+
+* It's a work around for a defect when build in parallel:
+https://svn.boost.org/trac/boost/ticket/12477
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ libs/math/build/Jamfile.v2 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libs/math/build/Jamfile.v2 b/libs/math/build/Jamfile.v2
+index e19fb2e..82472a7 100644
+--- a/libs/math/build/Jamfile.v2
++++ b/libs/math/build/Jamfile.v2
+@@ -13,7 +13,7 @@ project
+ #<toolset>intel-linux:<pch>off
+ <toolset>intel-darwin:<pch>off
+ <toolset>msvc-7.1:<pch>off
+- <toolset>gcc,<target-os>windows:<pch>off
++ <toolset>gcc:<pch>off
+ #<toolset>gcc:<cxxflags>-fvisibility=hidden
+ <toolset>intel-linux:<cxxflags>-fvisibility=hidden
+ #<toolset>sun:<cxxflags>-xldscope=hidden
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/boost/boost_1.66.0.bb b/poky/meta/recipes-support/boost/boost_1.66.0.bb
new file mode 100644
index 000000000..63b82a599
--- /dev/null
+++ b/poky/meta/recipes-support/boost/boost_1.66.0.bb
@@ -0,0 +1,11 @@
+require boost-${PV}.inc
+require boost.inc
+
+SRC_URI += "\
+ file://arm-intrinsics.patch \
+ file://boost-CVE-2012-2677.patch \
+ file://boost-math-disable-pch-for-gcc.patch \
+ file://0001-Apply-boost-1.62.0-no-forced-flags.patch.patch \
+ file://0003-Don-t-set-up-arch-instruction-set-flags-we-do-that-o.patch \
+ file://0002-Don-t-set-up-m32-m64-we-do-that-ourselves.patch \
+"
diff --git a/poky/meta/recipes-support/boost/files/0001-Fix-a-strange-assert-typo-how-was-this-released-with.patch b/poky/meta/recipes-support/boost/files/0001-Fix-a-strange-assert-typo-how-was-this-released-with.patch
new file mode 100644
index 000000000..a75133d2b
--- /dev/null
+++ b/poky/meta/recipes-support/boost/files/0001-Fix-a-strange-assert-typo-how-was-this-released-with.patch
@@ -0,0 +1,37 @@
+From 5685527364198597f25fc1c6236cb64cbc3de44f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 4 Oct 2017 18:16:08 +0300
+Subject: [PATCH] Fix a strange assert typo; how was this released without
+ noticing?
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ tools/build/src/engine/debugger.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/build/src/engine/debugger.c b/tools/build/src/engine/debugger.c
+index 802f262..152a7e6 100644
+--- a/tools/build/src/engine/debugger.c
++++ b/tools/build/src/engine/debugger.c
+@@ -1092,7 +1092,7 @@ static void debug_start_child( int argc, const char * * argv )
+ PROCESS_INFORMATION pi = { NULL, NULL, 0, 0 };
+ STARTUPINFO si = { sizeof( STARTUPINFO ), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0 };
+- assert( DEBUG_STATE == DEBUG_NO_CHILD );
++ assert( debug_state == DEBUG_NO_CHILD );
+ if ( ! CreatePipe( &pipe1[ 0 ], &pipe1[ 1 ], &sa, 0 ) )
+ {
+ printf("internal error\n");
+@@ -1176,7 +1176,7 @@ static void debug_start_child( int argc, const char * * argv )
+ int read_fd;
+ int pid;
+ int i;
+- assert( DEBUG_STATE == DEBUG_NO_CHILD );
++ assert( debug_state == DEBUG_NO_CHILD );
+ pipe(pipe1);
+ pipe(pipe2);
+ pid = fork();
+--
+2.14.1
+
diff --git a/poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch b/poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
new file mode 100644
index 000000000..9f8b7eac0
--- /dev/null
+++ b/poky/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
@@ -0,0 +1,50 @@
+From 619ada314ab26c0c9cbfe5702cd9c0caa8f6415a Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 3 Aug 2015 17:12:33 +0800
+Subject: [PATCH] bjam-native: build bjam.debug
+
+bjam is stripped by default, this causes QA warning while stripping it
+from do_populate_sysroot():
+
+ WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \
+ from bjam-native was already stripped, \
+ this will prevent future debugging!
+
+The JAM scripts allow to build unstripped version with '--debug'. Just
+build and install the bjam.debug to stop bjam from being stripped in
+compile step.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ bootstrap.sh | 1 +
+ tools/build/src/engine/build.sh | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bootstrap.sh b/bootstrap.sh
+index 98cf88b..54690aa 100755
+--- a/bootstrap.sh
++++ b/bootstrap.sh
+@@ -228,6 +228,7 @@ if test "x$BJAM" = x; then
+ echo "tools/build/src/engine/$arch/b2"
+ cp "$BJAM" .
+ cp "$my_dir/tools/build/src/engine/$arch/bjam" .
++ cp "$my_dir/tools/build/src/engine/${arch}.debug/bjam" bjam.debug
+
+ fi
+
+diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh
+index 6dbc706..c69fdc7 100755
+--- a/tools/build/src/engine/build.sh
++++ b/tools/build/src/engine/build.sh
+@@ -312,5 +312,5 @@ if test -x "./bootstrap/jam0" ; then
+ if test "${BJAM_UPDATE}" != "update" ; then
+ echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" clean
+ fi
+- echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@"
++ echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" --debug
+ fi
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch
new file mode 100644
index 000000000..4a8ae5f4b
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch
@@ -0,0 +1,34 @@
+ca-certificates is a package from Debian, but some host distros such as Fedora
+have a leaner run-parts provided by cron which doesn't support --verbose or the
+ -- separator between arguments and paths.
+
+This solves errors such as
+
+| Running hooks in [...]/rootfs/etc/ca-certificates/update.d...
+| [...]/usr/sbin/update-ca-certificates: line 194: Not: command not found
+| [...]/usr/sbin/update-ca-certificates: line 230: Not a directory: --: command not found
+| E: Not a directory: -- exited with code 127.
+
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
+---
+ sbin/update-ca-certificates | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -191,9 +191,7 @@ if [ -d "$HOOKSDIR" ]
+ then
+
+ echo "Running hooks in $HOOKSDIR..."
+- VERBOSE_ARG=
+- [ "$verbose" = 0 ] || VERBOSE_ARG="--verbose"
+- eval run-parts "$VERBOSE_ARG" --test -- "$HOOKSDIR" | while read hook
++ eval run-parts --test "$HOOKSDIR" | while read hook
+ do
+ ( cat "$ADDED"
+ cat "$REMOVED" ) | "$hook" || echo "E: $hook exited with code $?."
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch
new file mode 100644
index 000000000..792b4030b
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+From 724cb153ca0f607fb38b3a8db3ebb2742601cd81 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Tue, 19 Mar 2013 17:14:33 +0100
+Subject: [PATCH 2/2] update-ca-certificates: use $SYSROOT
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ sbin/update-ca-certificates | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -24,12 +24,12 @@
+ verbose=0
+ fresh=0
+ default=0
+-CERTSCONF=/etc/ca-certificates.conf
+-CERTSDIR=/usr/share/ca-certificates
+-LOCALCERTSDIR=/usr/local/share/ca-certificates
++CERTSCONF=$SYSROOT/etc/ca-certificates.conf
++CERTSDIR=$SYSROOT/usr/share/ca-certificates
++LOCALCERTSDIR=$SYSROOT/usr/local/share/ca-certificates
+ CERTBUNDLE=ca-certificates.crt
+-ETCCERTSDIR=/etc/ssl/certs
+-HOOKSDIR=/etc/ca-certificates/update.d
++ETCCERTSDIR=$SYSROOT/etc/ssl/certs
++HOOKSDIR=$SYSROOT/etc/ca-certificates/update.d
+
+ while [ $# -gt 0 ];
+ do
+@@ -92,9 +92,9 @@ add() {
+ PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
+ -e 's/[()]/=/g' \
+ -e 's/,/_/g').pem"
+- if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
++ if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "${CERT##$SYSROOT}" ]
+ then
+- ln -sf "$CERT" "$PEM"
++ ln -sf "${CERT##$SYSROOT}" "$PEM"
+ echo "+$PEM" >> "$ADDED"
+ fi
+ # Add trailing newline to certificate, if it is missing (#635570)
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/0003-update-ca-certificates-use-relative-symlinks-from-ET.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/0003-update-ca-certificates-use-relative-symlinks-from-ET.patch
new file mode 100644
index 000000000..4bd967f78
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/0003-update-ca-certificates-use-relative-symlinks-from-ET.patch
@@ -0,0 +1,71 @@
+From a9fc13b2aee55655d58fcb77a3180fa99f96438a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
+Date: Wed, 28 Mar 2018 16:45:05 +0100
+Subject: [PATCH] update-ca-certificates: use relative symlinks from
+ $ETCCERTSDIR
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+update-ca-certificates symlinks (trusted) certificates
+from $CERTSDIR or $LOCALCERTSDIR into $ETCCERTSDIR.
+update-ca-certificates can call hook scripts installed
+into /etc/ca-certificates/update.d. Those scripts are
+passed the pem file in /etc/ssl/certs/ that was added or
+removed in this run and those pem files are absolute
+symlinks into $CERTSDIR or $LOCALCERTSDIR at the moment.
+
+When running update-ca-certificates during image build
+time, they thusly all point into the host's file system,
+not into the $SYSROOT. This means:
+* the host's file system layout must match the one
+ produced by OE, and
+* it also means that the host must have installed the same
+ (or more) certificates as the target in $CERTSDIR and
+ $LOCALCERTSDIR
+
+This is a problem when wanting to execute hook scripts,
+because they all need to be taught about $SYSROOT, and
+behave differently depending on whether they're called
+at image build time, or on the target, as otherwise they
+will be trying to actually read the host's certificates
+from $CERTSDIR or $LOCALCERTSDIR.
+
+This also is a problem when running anything else during
+image build time that depends on the trusted CA
+certificates.
+
+Changing the symlink to be relative solves all of these
+problems. Do so.
+
+Upstream-Status: Inappropriate [OE-specific]
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+---
+ sbin/update-ca-certificates | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
+index 00f80c7..7e911a9 100755
+--- a/sbin/update-ca-certificates
++++ b/sbin/update-ca-certificates
+@@ -29,6 +29,7 @@ CERTSDIR=$SYSROOT/usr/share/ca-certificates
+ LOCALCERTSDIR=$SYSROOT/usr/local/share/ca-certificates
+ CERTBUNDLE=ca-certificates.crt
+ ETCCERTSDIR=$SYSROOT/etc/ssl/certs
++FSROOT=../../../ # to get from $ETCCERTSDIR to the root of the file system
+ HOOKSDIR=$SYSROOT/etc/ca-certificates/update.d
+
+ while [ $# -gt 0 ];
+@@ -125,9 +126,10 @@ add() {
+ PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
+ -e 's/[()]/=/g' \
+ -e 's/,/_/g').pem"
+- if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "${CERT##$SYSROOT}" ]
++ DST="$(echo ${CERT} | sed -e "s|^$SYSROOT||" -e "s|^/|$FSROOT|" )"
++ if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "${DST}" ]
+ then
+- ln -sf "${CERT##$SYSROOT}" "$PEM"
++ ln -sf "${DST}" "$PEM"
+ echo "+$PEM" >> "$ADDED"
+ fi
+ # Add trailing newline to certificate, if it is missing (#635570)
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch
new file mode 100644
index 000000000..f8b0791be
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+update-ca-certificates: find SYSROOT relative to its own location
+
+This makes the script relocatable.
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -66,6 +66,39 @@ do
+ shift
+ done
+
++if [ -z "$SYSROOT" ]; then
++ local_which () {
++ if [ $# -lt 1 ]; then
++ return 1
++ fi
++
++ (
++ IFS=:
++ for entry in $PATH; do
++ if [ -x "$entry/$1" ]; then
++ echo "$entry/$1"
++ exit 0
++ fi
++ done
++ exit 1
++ )
++ }
++
++ case "$0" in
++ */*)
++ sbindir=$(cd ${0%/*} && pwd)
++ ;;
++ *)
++ sbindir=$(cd $(dirname $(local_which $0)) && pwd)
++ ;;
++ esac
++ prefix=${sbindir%/*}
++ SYSROOT=${prefix%/*}
++ if [ ! -d "$SYSROOT/usr/share/ca-certificates" ]; then
++ SYSROOT=
++ fi
++fi
++
+ if [ ! -s "$CERTSCONF" ]
+ then
+ fresh=1
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch
new file mode 100644
index 000000000..a113fa8b1
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+Let us alter the install destination of the script via SBINDIR
+
+--- ca-certificates-20130119.orig/sbin/Makefile
++++ ca-certificates-20130119/sbin/Makefile
+@@ -3,9 +3,12 @@
+ #
+ #
+
++SBINDIR = /usr/sbin
++
+ all:
+
+ clean:
+
+ install:
+- install -m755 update-ca-certificates $(DESTDIR)/usr/sbin/
++ install -d $(DESTDIR)$(SBINDIR)
++ install -m755 update-ca-certificates $(DESTDIR)$(SBINDIR)/
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch b/poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch
new file mode 100644
index 000000000..6e2171f75
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates/update-ca-certificates-support-Toybox.patch
@@ -0,0 +1,34 @@
+From 30378026d136efa779732e3f6664e2ecf461e458 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Thu, 17 Mar 2016 12:38:09 +0100
+Subject: [PATCH] update-ca-certificates: support Toybox
+
+"mktemp -t" is deprecated and does not work when using Toybox. Replace
+with something that works also with Toybox.
+
+Upstream-Status: Pending
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ sbin/update-ca-certificates | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
+index 79c41bb..ae9e3f1 100755
+--- a/sbin/update-ca-certificates
++++ b/sbin/update-ca-certificates
+@@ -113,9 +113,9 @@ trap cleanup 0
+
+ # Helper files. (Some of them are not simple arrays because we spawn
+ # subshells later on.)
+-TEMPBUNDLE="$(mktemp -t "${CERTBUNDLE}.tmp.XXXXXX")"
+-ADDED="$(mktemp -t "ca-certificates.tmp.XXXXXX")"
+-REMOVED="$(mktemp -t "ca-certificates.tmp.XXXXXX")"
++TEMPBUNDLE="$(mktemp -p${TMPDIR:-/tmp} "${CERTBUNDLE}.tmp.XXXXXX")"
++ADDED="$(mktemp -p${TMPDIR:-/tmp} "ca-certificates.tmp.XXXXXX")"
++REMOVED="$(mktemp -p${TMPDIR:-/tmp} "ca-certificates.tmp.XXXXXX")"
+
+ # Adds a certificate to the list of trusted ones. This includes a symlink
+ # in /etc/ssl/certs to the certificate file and its inclusion into the
+--
+2.1.4
diff --git a/poky/meta/recipes-support/ca-certificates/ca-certificates_20170717.bb b/poky/meta/recipes-support/ca-certificates/ca-certificates_20170717.bb
new file mode 100644
index 000000000..350294858
--- /dev/null
+++ b/poky/meta/recipes-support/ca-certificates/ca-certificates_20170717.bb
@@ -0,0 +1,88 @@
+SUMMARY = "Common CA certificates"
+DESCRIPTION = "This package includes PEM files of CA certificates to allow \
+SSL-based applications to check for the authenticity of SSL connections. \
+This derived from Debian's CA Certificates."
+HOMEPAGE = "http://packages.debian.org/sid/ca-certificates"
+SECTION = "misc"
+LICENSE = "GPL-2.0+ & MPL-2.0"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=e7358b9541ccf3029e9705ed8de57968"
+
+# This is needed to ensure we can run the postinst at image creation time
+DEPENDS = ""
+DEPENDS_class-native = "openssl-native"
+DEPENDS_class-nativesdk = "openssl-native"
+# Need c_rehash from openssl and run-parts from debianutils
+PACKAGE_WRITE_DEPS += "openssl-native debianutils-native"
+
+SRCREV = "34b8e19e541b8af4076616b2e170c7a70cdaded0"
+
+SRC_URI = "git://salsa.debian.org/debian/ca-certificates.git;protocol=https \
+ file://0002-update-ca-certificates-use-SYSROOT.patch \
+ file://0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch \
+ file://update-ca-certificates-support-Toybox.patch \
+ file://default-sysroot.patch \
+ file://sbindir.patch \
+ file://0003-update-ca-certificates-use-relative-symlinks-from-ET.patch \
+ "
+
+S = "${WORKDIR}/git"
+SYSROOT_DIRS_class-native += "${sysconfdir} ${datadir}/ca-certificates"
+
+inherit allarch
+
+EXTRA_OEMAKE = "\
+ 'CERTSDIR=${datadir}/ca-certificates' \
+ 'SBINDIR=${sbindir}' \
+"
+
+do_compile_prepend() {
+ oe_runmake clean
+}
+
+do_install () {
+ install -d ${D}${datadir}/ca-certificates \
+ ${D}${sysconfdir}/ssl/certs \
+ ${D}${sysconfdir}/ca-certificates/update.d
+ oe_runmake 'DESTDIR=${D}' install
+
+ install -d ${D}${mandir}/man8
+ install -m 0644 sbin/update-ca-certificates.8 ${D}${mandir}/man8/
+
+ install -d ${D}${sysconfdir}
+ {
+ echo "# Lines starting with # will be ignored"
+ echo "# Lines starting with ! will remove certificate on next update"
+ echo "#"
+ find ${D}${datadir}/ca-certificates -type f -name '*.crt' | \
+ sed 's,^${D}${datadir}/ca-certificates/,,'
+ } >${D}${sysconfdir}/ca-certificates.conf
+}
+
+do_install_append_class-target () {
+ sed -i -e 's,/etc/,${sysconfdir}/,' \
+ -e 's,/usr/share/,${datadir}/,' \
+ -e 's,/usr/local,${prefix}/local,' \
+ ${D}${sbindir}/update-ca-certificates \
+ ${D}${mandir}/man8/update-ca-certificates.8
+}
+
+pkg_postinst_${PN}_class-target () {
+ SYSROOT="$D" $D${sbindir}/update-ca-certificates
+}
+
+CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
+
+# Rather than make a postinst script that works for both target and nativesdk,
+# we just run update-ca-certificate from do_install() for nativesdk.
+CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
+do_install_append_class-nativesdk () {
+ SYSROOT="${D}${SDKPATHNATIVE}" ${D}${sbindir}/update-ca-certificates
+}
+
+do_install_append_class-native () {
+ SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
+}
+
+RDEPENDS_${PN} += "openssl"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch b/poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch
new file mode 100644
index 000000000..ad879d466
--- /dev/null
+++ b/poky/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+--- ConsoleKit-0.4.6.orig/configure.ac
++++ ConsoleKit-0.4.6/configure.ac
+@@ -56,10 +56,24 @@ PKG_CHECK_MODULES(CONSOLE_KIT,
+ gthread-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+
+-PKG_CHECK_MODULES(POLKIT,
+- polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+- have_polkit=yes,
+- have_polkit=no)
++AC_ARG_WITH([polkit],
++ [AS_HELP_STRING([--with-polkit],
++ [support PolicyKit @<:@default=check@:>@])],
++ [],
++ [with_polkit=check])
++
++AS_IF([test "x$with_polkit" != xno],
++ [PKG_CHECK_MODULES(POLKIT,
++ polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
++ have_polkit=yes,
++ [if test "x$with_polkit" != xcheck; then
++ AC_MSG_FAILURE(
++ [--with-polkit was given, but test for polkit failed])
++ else
++ have_polkit=no
++ fi
++ ])])
++
+ if test "x$have_polkit" = "xyes" ; then
+ AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
+ fi
diff --git a/poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch b/poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch
new file mode 100644
index 000000000..f2f9b9c68
--- /dev/null
+++ b/poky/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch
@@ -0,0 +1,19 @@
+Fix builds in the case of seprate source from the build directory.
+
+RP 2013/4/17
+
+Upstream-Status: Pending
+
+Index: pam-ck-connector/Makefile.am
+===================================================================
+--- consolekit/pam-ck-connector.orig/Makefile.am 2010-09-03 13:54:31.000000000 +0000
++++ consolekit/pam-ck-connector/Makefile.am 2013-04-17 09:06:49.093524918 +0000
+@@ -4,7 +4,7 @@
+
+ INCLUDES = \
+ $(LIBDBUS_CFLAGS) \
+- -I$(top_builddir)/libck-connector \
++ -I$(top_srcdir)/libck-connector \
+ $(NULL)
+
+ pamlibdir = $(PAM_MODULE_DIR)
diff --git a/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb b/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
new file mode 100644
index 000000000..80d48bf84
--- /dev/null
+++ b/poky/meta/recipes-support/consolekit/consolekit_0.4.6.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Framework for defining and tracking users, login sessions, and seats"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/ConsoleKit"
+BUGTRACKER = "https://bugs.freedesktop.org/buglist.cgi?query_format=specific&product=ConsoleKit"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://src/main.c;endline=21;md5=0a994e09769780220163255d8f9071c3"
+
+DEPENDS = "glib-2.0 glib-2.0-native dbus dbus-glib virtual/libx11"
+RDEPENDS_${PN} += "base-files"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-${PV}.tar.xz \
+ file://sepbuildfix.patch \
+ file://add-polkit-configure-argument.patch \
+"
+
+SRC_URI[md5sum] = "611792b4d616253a5bdec9175f8b7678"
+SRC_URI[sha256sum] = "b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf975146475565c"
+
+S = "${WORKDIR}/ConsoleKit-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)}"
+
+PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam"
+PACKAGECONFIG[policykit] = "--with-polkit,--without-polkit,polkit"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--with-systemdsystemunitdir="
+
+FILES_${PN} += "${exec_prefix}/lib/ConsoleKit \
+ ${libdir}/ConsoleKit ${systemd_unitdir} ${base_libdir} \
+ ${datadir}/dbus-1 ${datadir}/PolicyKit ${datadir}/polkit*"
+
+PACKAGES =+ "pam-plugin-ck-connector"
+FILES_pam-plugin-ck-connector += "${base_libdir}/security/*.so"
+RDEPENDS_pam-plugin-ck-connector += "${PN}"
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/log/ConsoleKit - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/consolekit.conf
+ fi
+
+ # Remove /var/ directories as the daemon creates them as required
+ rm -rf ${D}${localstatedir}
+}
diff --git a/poky/meta/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch b/poky/meta/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch
new file mode 100644
index 000000000..a7db1b3c9
--- /dev/null
+++ b/poky/meta/recipes-support/curl/curl/0001-replace-krb5-config-with-pkg-config.patch
@@ -0,0 +1,44 @@
+From ed70f0623708b8a6c1f58a5d243d87c5ff45b24d Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 26 Apr 2016 13:13:01 +0800
+Subject: [PATCH] replace krb5-config with pkg-config
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5569a26..56b0380 100755
+--- a/configure.ac
++++ b/configure.ac
+@@ -1290,7 +1290,7 @@ AC_ARG_WITH(gssapi,
+ fi
+ ])
+
+-: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
++KRB5CONFIG=`which pkg-config`
+
+ save_CPPFLAGS="$CPPFLAGS"
+ AC_MSG_CHECKING([if GSS-API support is requested])
+@@ -1301,7 +1301,7 @@ if test x"$want_gss" = xyes; then
+ if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
+ GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
+ elif test -f "$KRB5CONFIG"; then
+- GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
++ GSSAPI_INCS=`$KRB5CONFIG --cflags mit-krb5-gssapi`
+ elif test "$GSSAPI_ROOT" != "yes"; then
+ GSSAPI_INCS="-I$GSSAPI_ROOT/include"
+ fi
+@@ -1394,7 +1394,7 @@ if test x"$want_gss" = xyes; then
+ elif test -f "$KRB5CONFIG"; then
+ dnl krb5-config doesn't have --libs-only-L or similar, put everything
+ dnl into LIBS
+- gss_libs=`$KRB5CONFIG --libs gssapi`
++ gss_libs=`$KRB5CONFIG --libs mit-krb5-gssapi`
+ LIBS="$gss_libs $LIBS"
+ else
+ case $host in
diff --git a/poky/meta/recipes-support/curl/curl_7.60.0.bb b/poky/meta/recipes-support/curl/curl_7.60.0.bb
new file mode 100644
index 000000000..fe04fa63c
--- /dev/null
+++ b/poky/meta/recipes-support/curl/curl_7.60.0.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Command line tool and library for client-side URL transfers"
+HOMEPAGE = "http://curl.haxx.se/"
+BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker"
+SECTION = "console/network"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=8;md5=3a34942f4ae3fbf1a303160714e664ac"
+
+SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
+ file://0001-replace-krb5-config-with-pkg-config.patch \
+"
+
+SRC_URI[md5sum] = "bd2aabf78ded6a9aec8a54532fd6b5d7"
+SRC_URI[sha256sum] = "897dfb2204bd99be328279f88f55b7c61592216b0542fcbe995c60aa92871e9b"
+
+CVE_PRODUCT = "libcurl"
+inherit autotools pkgconfig binconfig multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls proxy threaded-resolver zlib"
+PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver zlib"
+PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver zlib"
+
+# 'ares' and 'threaded-resolver' are mutually exclusive
+PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares"
+PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
+PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,"
+PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
+PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
+PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
+PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
+PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
+PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
+PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
+PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
+PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
+PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
+PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl"
+PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
+PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
+PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver"
+PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
+
+EXTRA_OECONF = " \
+ --enable-crypto-auth \
+ --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
+ --without-libmetalink \
+ --without-libpsl \
+"
+
+do_install_append_class-target() {
+ # cleanup buildpaths from curl-config
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ ${D}${bindir}/curl-config
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${libdir}/lib*.so.*"
+RRECOMMENDS_lib${BPN} += "ca-certificates"
+
+FILES_${PN} += "${datadir}/zsh"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch b/poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
new file mode 100644
index 000000000..571708e03
--- /dev/null
+++ b/poky/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
@@ -0,0 +1,45 @@
+From 29621d637e30982489693f2e207ce6a1790e3337 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 15:32:26 +0000
+Subject: [PATCH] atomic: Rename local __atomic_compare_exchange to avoid clash
+ with builtins
+
+Helps building with clang
+
+Fixes
+
+../db-5.3.28/src/dbinc/atomic.h:179:19: error: definition of builtin function '__atomic_compare_exchange'
+static inline int __atomic_compare_exchange(
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dbinc/atomic.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 6a858f7..1b49de5 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define atomic_inc(env, p) __atomic_inc(p)
+ #define atomic_dec(env, p) __atomic_dec(p)
+ #define atomic_compare_exchange(env, p, o, n) \
+- __atomic_compare_exchange((p), (o), (n))
++ __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ int temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+ * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+ * which configure could be changed to use.
+ */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+ db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ atomic_value_t was;
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch b/poky/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch
new file mode 100644
index 000000000..cb28db134
--- /dev/null
+++ b/poky/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch
@@ -0,0 +1,42 @@
+From 32e5943a3c4637d39e4d65b544dcb99e280210e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Jul 2017 10:54:26 -0700
+Subject: [PATCH] configure: Add explicit tag options to libtool invocation
+
+This helps cross compile when tag inference via heuristics
+fail because CC variable is having -fPIE -pie and libtool
+smartly removes it when building libraries
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dist/configure.ac | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/dist/configure.ac b/dist/configure.ac
+index 689f3b8..9c14bdb 100644
+--- a/dist/configure.ac
++++ b/dist/configure.ac
+@@ -366,12 +366,12 @@ LIBTOOL="./libtool"
+
+ INSTALLER="\$(LIBTOOL) --mode=install cp -p"
+
+-MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}"
+-MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version"
+-MAKEFILE_CCLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK}"
+-MAKEFILE_CXX="\$(LIBTOOL) --mode=compile ${MAKEFILE_CXX}"
+-MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -avoid-version"
+-MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}"
++MAKEFILE_CC="\$(LIBTOOL) --tag=CC --mode=compile ${MAKEFILE_CC}"
++MAKEFILE_SOLINK="\$(LIBTOOL) --tag=CC --mode=link ${MAKEFILE_CCLINK} -avoid-version"
++MAKEFILE_CCLINK="\$(LIBTOOL) --tag=CC --mode=link ${MAKEFILE_CCLINK}"
++MAKEFILE_CXX="\$(LIBTOOL) --tag=CXX --mode=compile ${MAKEFILE_CXX}"
++MAKEFILE_XSOLINK="\$(LIBTOOL) --tag=CXX --mode=link ${MAKEFILE_CXXLINK} -avoid-version"
++MAKEFILE_CXXLINK="\$(LIBTOOL) --tag=CXX --mode=link ${MAKEFILE_CXXLINK}"
+
+
+ case "$host_os" in
+--
+2.13.3
+
diff --git a/poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch b/poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
new file mode 100644
index 000000000..6a8eada60
--- /dev/null
+++ b/poky/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
@@ -0,0 +1,50 @@
+Original patch submitted by jbowler@nslu2-linux.org on 2005-11-17:
+
+db: fix thumb uclibc operation in 4.3.29
+ - uclibc thumb builds were using libpthread to implement mutexes, the
+ - uclibc version seems to be a stub (at least on thumb). This commit
+ - fixes the ARM/gcc-assembly mutex implementation so that it has thumb
+ - support and the resultant db4 works (tested on LE Thumb uclibc)
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Author: jbowler@nslu2-linux.org
+
+Index: db-6.0.30/src/dbinc/mutex_int.h
+===================================================================
+--- db-6.0.30.orig/src/dbinc/mutex_int.h
++++ db-6.0.30/src/dbinc/mutex_int.h
+@@ -474,6 +474,25 @@ typedef unsigned char tsl_t;
+
+ #ifdef LOAD_ACTUAL_MUTEX_CODE
+ /* gcc/arm: 0 is clear, 1 is set. */
++#if defined __thumb__
++#define MUTEX_SET(tsl) ({ \
++ int __r, __p; \
++ __asm__ volatile( \
++ ".align 2\n\t" \
++ "bx pc\n\t" \
++ "nop\n\t" \
++ ".arm\n\t" \
++ "swpb %0, %2, [%3]\n\t" \
++ "eor %0, %0, #1\n\t" \
++ "orr %1, pc, #1\n\t" \
++ "bx %1\n\t" \
++ ".force_thumb" \
++ : "=&r" (__r), "=r" (__p) \
++ : "r" (1), "r" (tsl) \
++ ); \
++ __r & 1; \
++})
++#else
+ #define MUTEX_SET(tsl) ({ \
+ int __r; \
+ __asm__ volatile( \
+@@ -484,6 +503,7 @@ typedef unsigned char tsl_t;
+ ); \
+ __r & 1; \
+ })
++#endif
+
+ #define MUTEX_UNSET(tsl) (*(volatile tsl_t *)(tsl) = 0)
+ #define MUTEX_INIT(tsl) (MUTEX_UNSET(tsl), 0)
diff --git a/poky/meta/recipes-support/db/db/fix-parallel-build.patch b/poky/meta/recipes-support/db/db/fix-parallel-build.patch
new file mode 100644
index 000000000..27632e1dd
--- /dev/null
+++ b/poky/meta/recipes-support/db/db/fix-parallel-build.patch
@@ -0,0 +1,21 @@
+With higher paralelism it sometimes fails with:
+libtool: link: `util_log.lo' is not a valid libtool object
+make: *** [db_replicate] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Index: db-6.0.30/dist/Makefile.in
+===================================================================
+--- db-6.0.30.orig/dist/Makefile.in
++++ db-6.0.30/dist/Makefile.in
+@@ -1041,7 +1041,7 @@ db_recover: db_recover@o@ util_sig@o@ $(
+ db_recover@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
+ $(POSTLINK) $@
+
+-db_replicate: db_replicate@o@ util_sig@o@ $(DEF_LIB)
++db_replicate: db_replicate@o@ util_log@o@ util_sig@o@ $(DEF_LIB)
+ $(CCLINK) -o $@ $(LDFLAGS) \
+ db_replicate@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
+ $(POSTLINK) $@
diff --git a/poky/meta/recipes-support/db/db/sequence-type.patch b/poky/meta/recipes-support/db/db/sequence-type.patch
new file mode 100644
index 000000000..a6fe3d62a
--- /dev/null
+++ b/poky/meta/recipes-support/db/db/sequence-type.patch
@@ -0,0 +1,59 @@
+configure wants to use host-specific types to get a 64-bit integer in db.h
+instead of using an alias such as int64_t. This means that the header differs
+in multilib environments for no good reason, so replace the type with the alias
+in stdint.h.
+
+This then breaks the overly complicated type check but as we know that int64_t
+exists and works, we can just delete that.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- a/dist/aclocal/sequence.m4~ 2013-09-09 16:35:02.000000000 +0100
++++ b/dist/aclocal/sequence.m4 2017-11-01 13:21:45.472295971 +0000
+@@ -24 +24 @@
+- db_cv_seq_type="long"
++ db_cv_seq_type="int64_t"
+@@ -31 +31 @@
+- db_cv_seq_type="long long"
++ db_cv_seq_type="int64_t"
+@@ -41,38 +41 @@
+- # Test to see if we can declare variables of the appropriate size
+- # and format them. If we're cross-compiling, all we get is a link
+- # test, which won't test for the appropriate printf format strings.
+- if test "$db_cv_build_sequence" = "yes"; then
+- AC_TRY_RUN([
+- main() {
+- $db_cv_seq_type l;
+- unsigned $db_cv_seq_type u;
+- char buf@<:@100@:>@;
+-
+- buf@<:@0@:>@ = 'a';
+- l = 9223372036854775807LL;
+- (void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
+- if (strcmp(buf, "9223372036854775807"))
+- return (1);
+- u = 18446744073709551615ULL;
+- (void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
+- if (strcmp(buf, "18446744073709551615"))
+- return (1);
+- return (0);
+- }],, [db_cv_build_sequence="no"],
+- AC_TRY_LINK(,[
+- $db_cv_seq_type l;
+- unsigned $db_cv_seq_type u;
+- char buf@<:@100@:>@;
+-
+- buf@<:@0@:>@ = 'a';
+- l = 9223372036854775807LL;
+- (void)snprintf(buf, sizeof(buf), $db_cv_seq_fmt, l);
+- if (strcmp(buf, "9223372036854775807"))
+- return (1);
+- u = 18446744073709551615ULL;
+- (void)snprintf(buf, sizeof(buf), $db_cv_seq_ufmt, u);
+- if (strcmp(buf, "18446744073709551615"))
+- return (1);
+- return (0);
+- ],, [db_cv_build_sequence="no"]))
+- fi
++ db_cv_build_sequence="yes"
diff --git a/poky/meta/recipes-support/db/db_5.3.28.bb b/poky/meta/recipes-support/db/db_5.3.28.bb
new file mode 100644
index 000000000..093ee4490
--- /dev/null
+++ b/poky/meta/recipes-support/db/db_5.3.28.bb
@@ -0,0 +1,123 @@
+# Version 5 of the Berkeley DB from Sleepycat
+#
+# At present this package only installs the DB code
+# itself (shared libraries, .a in the dev package),
+# documentation and headers.
+#
+# The headers have the same names as those as v3
+# of the DB, only one version can be used *for dev*
+# at once - DB3 and DB5 can both be installed on the
+# same system at the same time if really necessary.
+SECTION = "libs"
+SUMMARY = "Berkeley Database v5"
+HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html"
+LICENSE = "Sleepycat"
+RCONFLICTS_${PN} = "db3"
+
+CVE_PRODUCT = "oracle_berkeley_db"
+CVE_VERSION = "11.2.${PV}"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
+SRC_URI += "file://arm-thumb-mutex_db5.patch \
+ file://fix-parallel-build.patch \
+ file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \
+ file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \
+ file://sequence-type.patch \
+ "
+# We are not interested in official latest 6.x versions;
+# let's track what debian is using.
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/db5.3/"
+UPSTREAM_CHECK_REGEX = "db5\.3_(?P<pver>.+)\.orig"
+
+SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
+SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
+
+inherit autotools
+
+# The executables go in a separate package - typically there
+# is no need to install these unless doing real database
+# management on the system.
+inherit lib_package
+
+PACKAGES =+ "${PN}-cxx"
+FILES_${PN}-cxx = "${libdir}/*cxx*so"
+
+
+# The dev package has the .so link (as in db3) and the .a's -
+# it is therefore incompatible (cannot be installed at the
+# same time) as the db3 package
+# sort out the .so since they do version prior to the .so
+SOLIBS = "-5*.so"
+FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
+
+#configuration - set in local.conf to override
+# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
+DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
+
+EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot"
+
+# Override the MUTEX setting here, the POSIX library is
+# the default - "POSIX/pthreads/library".
+# Don't ignore the nice SWP instruction on the ARM:
+# These enable the ARM assembler mutex code, this won't
+# work with thumb compilation...
+ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
+MUTEX = ""
+MUTEX_arm = "${ARM_MUTEX}"
+MUTEX_armeb = "${ARM_MUTEX}"
+EXTRA_OECONF += "${MUTEX} STRIP=true"
+EXTRA_OEMAKE += "LIBTOOL='./${HOST_SYS}-libtool'"
+
+EXTRA_AUTORECONF += "--exclude=autoheader -I ${S}/dist/aclocal -I${S}/dist/aclocal_java"
+AUTOTOOLS_SCRIPT_PATH = "${S}/dist"
+
+# Cancel the site stuff - it's set for db3 and destroys the
+# configure.
+CONFIG_SITE = ""
+
+oe_runconf_prepend() {
+ . ${S}/dist/RELEASE
+ # Edit version information we couldn't pre-compute.
+ sed -i -e "s/__EDIT_DB_VERSION_FAMILY__/$DB_VERSION_FAMILY/g" \
+ -e "s/__EDIT_DB_VERSION_RELEASE__/$DB_VERSION_RELEASE/g" \
+ -e "s/__EDIT_DB_VERSION_MAJOR__/$DB_VERSION_MAJOR/g" \
+ -e "s/__EDIT_DB_VERSION_MINOR__/$DB_VERSION_MINOR/g" \
+ -e "s/__EDIT_DB_VERSION_PATCH__/$DB_VERSION_PATCH/g" \
+ -e "s/__EDIT_DB_VERSION_STRING__/$DB_VERSION_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_FULL_STRING__/$DB_VERSION_FULL_STRING/g" \
+ -e "s/__EDIT_DB_VERSION_UNIQUE_NAME__/$DB_VERSION_UNIQUE_NAME/g" \
+ -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" ${S}/dist/configure
+}
+
+do_compile_prepend() {
+ # Stop libtool adding RPATHs
+ sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/${HOST_SYS}-libtool
+}
+
+do_install_append() {
+ mkdir -p ${D}/${includedir}/db51
+ mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/.
+ mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/.
+ ln -s db51/db.h ${D}/${includedir}/db.h
+ ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h
+
+ # The docs end up in /usr/docs - not right.
+ if test -d "${D}/${prefix}/docs"
+ then
+ mkdir -p "${D}/${datadir}"
+ test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
+ mv "${D}/${prefix}/docs" "${D}/${docdir}"
+ fi
+
+ chown -R root:root ${D}
+}
+
+INSANE_SKIP_${PN} = "dev-so"
+INSANE_SKIP_${PN}-cxx = "dev-so"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/debianutils/debianutils_4.8.4.bb b/poky/meta/recipes-support/debianutils/debianutils_4.8.4.bb
new file mode 100644
index 000000000..300e6f131
--- /dev/null
+++ b/poky/meta/recipes-support/debianutils/debianutils_4.8.4.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Miscellaneous utilities specific to Debian"
+SECTION = "base"
+LICENSE = "GPLv2 & SMAIL_GPL"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=f01a5203d50512fc4830b4332b696a9f"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20180129T164727Z/pool/main/d/${BPN}/${BPN}_${PV}.tar.xz"
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/"
+
+SRC_URI[md5sum] = "a6dcd496b4f79b3c452c3a74c2d3f89c"
+SRC_URI[sha256sum] = "c061ab99aea61f892043b7624b021ab5b193e9c6bbfd474da0fbcdd506be1eb2"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit autotools update-alternatives
+
+do_configure_prepend() {
+ sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am
+}
+
+do_install_append() {
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ # Debian places some utils into ${base_bindir} as does busybox
+ install -d ${D}${base_bindir}
+ for app in run-parts tempfile; do
+ mv ${D}${bindir}/$app ${D}${base_bindir}/$app
+ done
+ fi
+}
+
+# Note that we package the update-alternatives name.
+#
+PACKAGES =+ "${PN}-run-parts"
+FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
+
+RDEPENDS_${PN} += "${PN}-run-parts"
+RDEPENDS_${PN}_class-native = ""
+
+ALTERNATIVE_PRIORITY="30"
+ALTERNATIVE_${PN} = "add-shell installkernel remove-shell savelog tempfile which"
+
+ALTERNATIVE_PRIORITY_${PN}-run-parts = "60"
+ALTERNATIVE_${PN}-run-parts = "run-parts"
+
+ALTERNATIVE_${PN}-doc = "which.1"
+ALTERNATIVE_LINK_NAME[which.1] = "${mandir}/man1/which.1"
+
+ALTERNATIVE_LINK_NAME[add-shell]="${sbindir}/add-shell"
+ALTERNATIVE_LINK_NAME[installkernel]="${sbindir}/installkernel"
+ALTERNATIVE_LINK_NAME[remove-shell]="${sbindir}/remove-shell"
+ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
+ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
+ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
+ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/enchant/enchant_1.6.0.bb b/poky/meta/recipes-support/enchant/enchant_1.6.0.bb
new file mode 100644
index 000000000..44eb2e3df
--- /dev/null
+++ b/poky/meta/recipes-support/enchant/enchant_1.6.0.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Enchant Spell checker API Library"
+SECTION = "libs"
+HOMEPAGE = "http://www.abisource.com/projects/enchant/"
+BUGTRACKER = "http://bugzilla.abisource.com/enter_bug.cgi?product=Enchant"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=dfcbabf9131dc9a95febef6753a2958b \
+ file://src/enchant.h;beginline=1;endline=29;md5=8d881caa1d37523567e1d8f726675a18"
+
+DEPENDS = "glib-2.0"
+
+inherit autotools pkgconfig
+
+PR = "r3"
+
+SRC_URI = "http://www.abisource.com/downloads/enchant/${PV}/enchant-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "de11011aff801dc61042828041fb59c7"
+SRC_URI[sha256sum] = "2fac9e7be7e9424b2c5570d8affe568db39f7572c10ed48d4e13cddf03f7097f"
+
+PACKAGECONFIG ??= "aspell"
+PACKAGECONFIG[aspell] = " --with-aspell-prefix=${STAGING_DIR_HOST}${prefix} --enable-aspell, --disable-aspell, aspell, aspell"
+PACKAGECONFIG[ispell] = " --with-ispell-prefix=${STAGING_DIR_HOST}${prefix} --enable-ispell, --disable-ispell, ispell, ispell"
+PACKAGECONFIG[uspell] = " --with-uspell-prefix=${STAGING_DIR_HOST}${prefix} --enable-uspell, --disable-uspell, uspell, uspell"
+PACKAGECONFIG[hspell] = " --with-hspell-prefix=${STAGING_DIR_HOST}${prefix} --enable-hspell, --disable-hspell, hspell, hspell"
+PACKAGECONFIG[myspell] = "--with-myspell-prefix=${STAGING_DIR_HOST}${prefix} --enable-myspell, --disable-myspell, myspell, myspell"
+
+EXTRA_OECONF = "br_cv_binreloc=no"
+
+export CXXFLAGS += " -L${STAGING_LIBDIR} -lstdc++ "
+
+FILES_${PN} = "${bindir} ${libdir}/*${SOLIBS} ${datadir}/${BPN} ${libdir}/${BPN}/*.so"
+FILES_${PN}-dev += "${libdir}/${BPN}/*{SOLIBSDEV} ${libdir}/${BPN}/*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/*.a"
diff --git a/poky/meta/recipes-support/gdbm/files/ptest.patch b/poky/meta/recipes-support/gdbm/files/ptest.patch
new file mode 100644
index 000000000..b9461bec6
--- /dev/null
+++ b/poky/meta/recipes-support/gdbm/files/ptest.patch
@@ -0,0 +1,50 @@
+From 4e4b70a4a3dcf1fdbee9e68bed3b62f42b197a3a Mon Sep 17 00:00:00 2001
+From: Josep Puigdemont <josep.puigdemont@enea.com>
+Date: Sun, 4 May 2014 16:02:07 +0200
+Subject: [PATCH] Add install-ptest rules.
+
+Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+
+---
+ Makefile.am | 5 +++++
+ tests/Makefile.am | 12 +++++++++++-
+ 2 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 4cdc734..24b99f0 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -45,3 +45,8 @@ ChangeLog:
+ awk -f $(top_srcdir)/git2chg.awk \
+ -v append=$(top_srcdir)/$(prev_change_log) > ChangeLog; \
+ fi
++
++install-ptest:
++ @for subdir in $(SUBDIRS); do \
++ $(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
++ done
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 3dbb580..22ffc44 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -130,4 +130,14 @@ dtfetch_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la
+ dtdel_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la
+ d_creat_ce_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la
+
+-
++buildtests: $(check_PROGRAMS) $(TESTSUITE)
++
++install-ptest: $(check_PROGRAMS) $(TESTSUITE)
++ @$(INSTALL) -d $(DESTDIR)
++ @for file in $^; do \
++ if [ -x .libs/$$file ]; then \
++ $(INSTALL_PROGRAM) .libs/$$file $(DESTDIR)/$$file; \
++ else \
++ $(INSTALL_PROGRAM) $$file $(DESTDIR) ; \
++ fi \
++ done
+--
+2.11.0
+
diff --git a/poky/meta/recipes-support/gdbm/files/run-ptest b/poky/meta/recipes-support/gdbm/files/run-ptest
new file mode 100755
index 000000000..615da8444
--- /dev/null
+++ b/poky/meta/recipes-support/gdbm/files/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# This script is used to run the gmdb test suite
+
+cd tests
+
+./testsuite AUTOTEST_PATH=$PWD abs_builddir=$PWD COMPAT=1 | sed 's/^[^0-9]*\([0-9]\+\): \(.*\)\(ok\|pass\|skipped\|fail\|FAILED\)\(.*\)$/\3: \2 \4/;s/ \+/ /g;s/^ok/PASS/;s/^skipped/SKIP/;s/^fail/FAIL/;s/^FAILED/FAIL/'
diff --git a/poky/meta/recipes-support/gdbm/gdbm_1.14.1.bb b/poky/meta/recipes-support/gdbm/gdbm_1.14.1.bb
new file mode 100644
index 000000000..54e5696e4
--- /dev/null
+++ b/poky/meta/recipes-support/gdbm/gdbm_1.14.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Key/value database library with extensible hashing"
+HOMEPAGE = "http://www.gnu.org/software/gdbm/"
+SECTION = "libs"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=241da1b9fe42e642cbb2c24d5e0c4d24"
+
+
+SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz \
+ file://run-ptest \
+ file://ptest.patch \
+ "
+
+SRC_URI[md5sum] = "c2ddcb3897efa0f57484af2bd4f4f848"
+SRC_URI[sha256sum] = "cdceff00ffe014495bed3aed71c7910aa88bf29379f795abc0f46d4ee5f8bc5f"
+
+inherit autotools gettext texinfo lib_package ptest
+
+# Needed for dbm python module
+EXTRA_OECONF = "-enable-libgdbm-compat"
+
+# Stop presence of dbm/nbdm on the host contaminating builds
+CACHED_CONFIGUREVARS += "ac_cv_lib_ndbm_main=no ac_cv_lib_dbm_main=no"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_append () {
+ # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find
+ # these headers
+ install -d ${D}${includedir}/gdbm
+ ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h
+ ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h
+}
+
+RDEPENDS_${PN}-ptest += "diffutils"
+
+do_compile_ptest() {
+ oe_runmake -C tests buildtests
+}
+
+PACKAGES =+ "${PN}-compat \
+ "
+FILES_${PN}-compat = "${libdir}/libgdbm_compat${SOLIBS} \
+ "
diff --git a/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch b/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
new file mode 100644
index 000000000..325ffe491
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-Append-the-user-provided-flags-to-the-auto-detected-.patch
@@ -0,0 +1,61 @@
+From d3b9fc523fc11260ced890c35bc5c9e6391c8656 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 14 Dec 2015 14:19:49 +0200
+Subject: [PATCH] Append the user provided flags to the auto-detected ones.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9cedfeb..87caee5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1921,8 +1921,12 @@ cclist=$cclist
+ EOF
+
+
+-test_CFLAGS=${CFLAGS+set}
+-test_CPPFLAGS=${CPPFLAGS+set}
++test_CFLAGS=
++test_CPPFLAGS=
++
++user_CFLAGS=$CFLAGS
++user_CPPFLAGS=$CPPFLAGS
++user_CXXFLAGS=$CXXFLAGS
+
+ for abi in $abilist; do
+ abi_last="$abi"
+@@ -2353,7 +2357,7 @@ AC_SUBST(CCAS)
+ # The C++ compiler, if desired.
+ want_cxx=no
+ if test $enable_cxx != no; then
+- test_CXXFLAGS=${CXXFLAGS+set}
++ test_CXXFLAGS=
+ AC_PROG_CXX
+
+ echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
+@@ -2381,7 +2385,7 @@ if test $enable_cxx != no; then
+ # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
+ #
+ for cxxflags_choice in $cxxflags_list; do
+- eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
++ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
+ GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+ [want_cxx=yes
+ break])
+@@ -2477,6 +2481,8 @@ if test "$enable_assembly" = "no"; then
+ # done
+ fi
+
++CFLAGS="$CFLAGS $user_CFLAGS"
++CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
+
+ cat >&AC_FD_CC <<EOF
+ Decided:
+--
+2.6.2
+
diff --git a/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch b/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch
new file mode 100644
index 000000000..1e47924cc
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp-6.1.2/0001-confiure.ac-Believe-the-cflags-from-environment.patch
@@ -0,0 +1,49 @@
+From ae1a4c37417a3bbbf8ea1cab198982b0cad47e29 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 12 Aug 2016 17:08:13 +0000
+Subject: [PATCH] confiure.ac: Believe the cflags from environment
+
+In some toolchains e.g. OpenEmbedded -march options
+are passed on compiler cmdline, it does not use
+the expected target triplets to make these decision
+during configure.
+
+Secondly, dont set armv4 for march when no selection
+is made, since it is passed from cmdline
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate[OE-Specific]
+
+ configure.ac | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+Index: gmp-6.1.2/configure.ac
+===================================================================
+--- gmp-6.1.2.orig/configure.ac
++++ gmp-6.1.2/configure.ac
+@@ -604,15 +604,6 @@ case $host in
+ any_32_testlist="sizeof-long-4"
+ any_64_testlist="sizeof-long-8"
+
+- # This is needed for clang, which is not content with flags like -mfpu=neon
+- # alone.
+- case $host in
+- *-*-*eabi)
+- gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
+- *-*-*eabihf)
+- gcc_cflags_fpmode="-mfloat-abi=hard" ;;
+- esac
+-
+ # FIXME: We make mandatory compiler options optional here. We should
+ # either enforce them, or organise to strip paths as the corresponding
+ # options fail.
+@@ -746,8 +737,6 @@ case $host in
+ ;;
+ *)
+ path="arm"
+- gcc_cflags_arch="-march=armv4"
+- GMP_DEFINE_RAW(["define(<NOTHUMB>,1)"])
+ ;;
+ esac
+ ;;
diff --git a/poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch b/poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch
new file mode 100644
index 000000000..3935589f8
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp-6.1.2/amd64.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Index: gmp-6.1.2/longlong.h
+===================================================================
+--- gmp-6.1.2.orig/longlong.h
++++ gmp-6.1.2/longlong.h
+@@ -1036,8 +1036,10 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype
+ count is only an int. */
+ #define count_trailing_zeros(count, x) \
+ do { \
++ UDItype __cbtmp; \
+ ASSERT ((x) != 0); \
+- __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x))); \
++ __asm__ ("bsfq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \
++ (count) = __cbtmp; \
+ } while (0)
+ #endif /* __amd64__ */
+
diff --git a/poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch b/poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch
new file mode 100644
index 000000000..6b089cf39
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp-6.1.2/use-includedir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: gmp-6.1.2/Makefile.am
+===================================================================
+--- gmp-6.1.2.orig/Makefile.am
++++ gmp-6.1.2/Makefile.am
+@@ -130,7 +130,7 @@ EXTRA_DIST += gmpxx.h
+ # but anyone knowledgeable enough to be playing with exec_prefix will be able
+ # to address that.
+ #
+-includeexecdir = $(exec_prefix)/include
++includeexecdir = $(includedir)
+ include_HEADERS = $(GMPXX_HEADERS_OPTION)
+ nodist_includeexec_HEADERS = gmp.h
+ lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION)
diff --git a/poky/meta/recipes-support/gmp/gmp.inc b/poky/meta/recipes-support/gmp/gmp.inc
new file mode 100644
index 000000000..abac8cf33
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp.inc
@@ -0,0 +1,12 @@
+SUMMARY = "GNU multiprecision arithmetic library"
+DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"
+HOMEPAGE = "http://gmplib.org/"
+SECTION = "devel"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[readline] = "--with-readline=yes,--with-readline=no,readline"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/poky/meta/recipes-support/gmp/gmp_6.1.2.bb b/poky/meta/recipes-support/gmp/gmp_6.1.2.bb
new file mode 100644
index 000000000..b008710d0
--- /dev/null
+++ b/poky/meta/recipes-support/gmp/gmp_6.1.2.bb
@@ -0,0 +1,41 @@
+require gmp.inc
+
+LICENSE = "GPLv2+ | LGPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+"
+
+REVISION = ""
+SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2 \
+ file://amd64.patch \
+ file://use-includedir.patch \
+ file://0001-Append-the-user-provided-flags-to-the-auto-detected-.patch \
+ file://0001-confiure.ac-Believe-the-cflags-from-environment.patch \
+ "
+SRC_URI[md5sum] = "8ddbb26dc3bd4e2302984debba1406a5"
+SRC_URI[sha256sum] = "5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2"
+
+acpaths = ""
+
+EXTRA_OECONF += " --enable-cxx=detect"
+EXTRA_OECONF_mipsarchr6_append = " --disable-assembly"
+
+PACKAGES =+ "libgmpxx"
+FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
+
+do_install_prepend_class-target() {
+ sed -i \
+ -e "s|--sysroot=${STAGING_DIR_HOST}||g" \
+ -e "s|${DEBUG_PREFIX_MAP}||g" \
+ ${B}/gmp.h
+}
+
+SSTATE_SCAN_FILES += "gmp.h"
+
+# Doesn't compile in MIPS16e mode due to use of hand-written
+# assembly
+MIPS_INSTRUCTION_SET = "mips"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch
new file mode 100644
index 000000000..840666f30
--- /dev/null
+++ b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch
@@ -0,0 +1,35 @@
+From b1de2c6290bc0651fe87a8c4fb52e7a0a5fe6322 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 5 Oct 2014 16:01:49 -0700
+Subject: [PATCH] gsystem-subprocess.c: Enable GNU extensions in system C
+ library
+
+This should export O_CLOEXEC where it is only
+available when _GNU_SOURCE is defined .e.g. uclibc based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+---
+ src/libgsystem/gsystem-subprocess.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/libgsystem/gsystem-subprocess.c b/src/libgsystem/gsystem-subprocess.c
+index a967896..a52a362 100644
+--- a/src/libgsystem/gsystem-subprocess.c
++++ b/src/libgsystem/gsystem-subprocess.c
+@@ -18,6 +18,10 @@
+
+ #include "config.h"
+
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
+ #define _GSYSTEM_NO_LOCAL_ALLOC
+ #include "libgsystem.h"
+
+--
+2.1.1
+
diff --git a/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch
new file mode 100644
index 000000000..5a178e2ef
--- /dev/null
+++ b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/update-output-syntax.patch
@@ -0,0 +1,27 @@
+
+The terms `FAIL` instead of `FAILED` and `SKIP` instead of `SKIPPED`
+match what Automake does
+
+Upstream-Status: Accepted
+[ https://git.gnome.org/browse/gnome-desktop-testing/commit/?id=048850731a640532ef55a61df7357fcc6d2ad501 ]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur gnome-desktop-testing-2014.1-orig/src/gnome-desktop-testing-runner.c gnome-desktop-testing-2014.1/src/gnome-desktop-testing-runner.c
+--- gnome-desktop-testing-2014.1-orig/src/gnome-desktop-testing-runner.c 2014-01-16 12:58:26.000000000 +0200
++++ gnome-desktop-testing-2014.1/src/gnome-desktop-testing-runner.c 2015-11-02 11:27:34.010594126 +0200
+@@ -280,12 +280,12 @@
+ else if (test->state == TEST_STATE_COMPLETE_FAILED)
+ {
+ msgid_value = ONE_TEST_FAILED_MSGID;
+- msg = g_strconcat ("FAILED: ", test->name, " (", reason, ")", NULL);
++ msg = g_strconcat ("FAIL: ", test->name, " (", reason, ")", NULL);
+ }
+ else if (test->state == TEST_STATE_COMPLETE_SKIPPED)
+ {
+ msgid_value = ONE_TEST_SKIPPED_MSGID;
+- msg = g_strconcat ("SKIPPED: ", test->name, NULL);
++ msg = g_strconcat ("SKIP: ", test->name, NULL);
+ }
+ else
+ g_assert_not_reached ();
diff --git a/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb
new file mode 100644
index 000000000..ccb3d3b7d
--- /dev/null
+++ b/poky/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Test runner for GNOME-style installed tests"
+HOMEPAGE = "https://wiki.gnome.org/GnomeGoals/InstalledTests"
+LICENSE = "LGPLv2+"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+ file://0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch \
+ file://update-output-syntax.patch \
+ "
+SRC_URI[md5sum] = "a608ad72a77e23a1aecdfd8d07a94baf"
+SRC_URI[sha256sum] = "1a3eed73678dd22d09d6a7ec4f899557df3e8b4a802affa76d0f163b31286539"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+ file://src/gnome-desktop-testing-runner.c;endline=19;md5=67311a600b83fd0068dfc7e5b84ffb3f"
+
+DEPENDS = "glib-2.0"
+
+inherit autotools pkgconfig
+
+PR = "r1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[journald] = "--with-systemd-journal,--without-systemd-journal,systemd,systemd"
diff --git a/poky/meta/recipes-support/gnupg/gnupg/0001-Use-pkg-config-to-find-pth-instead-of-pth-config.patch b/poky/meta/recipes-support/gnupg/gnupg/0001-Use-pkg-config-to-find-pth-instead-of-pth-config.patch
new file mode 100644
index 000000000..5c9c02222
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg/0001-Use-pkg-config-to-find-pth-instead-of-pth-config.patch
@@ -0,0 +1,105 @@
+From 59a3c76d4016ffc615f1c45184f4c6820061d69c Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Wed, 16 Aug 2017 11:14:12 +0800
+Subject: [PATCH 1/4] Use pkg-config to find pth instead of pth-config.
+
+Upstream-Status: Denied
+[not submitted but they've been clear they don't want a pkg-config
+dependency]
+
+RP 2014/5/22
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Rebase to 2.1.23
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/gnupg-pth.m4 | 53 ++++++++---------------------------------------------
+ 1 file changed, 8 insertions(+), 45 deletions(-)
+
+diff --git a/m4/gnupg-pth.m4 b/m4/gnupg-pth.m4
+index 6dc9e0e..5892531 100644
+--- a/m4/gnupg-pth.m4
++++ b/m4/gnupg-pth.m4
+@@ -17,33 +17,9 @@ dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ # Taken and modified from the m4 macros which come with Pth.
+ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+ [
+- _pth_version=`$PTH_CONFIG --version | awk 'NR==1 {print [$]3}'`
+ _req_version="ifelse([$1],,1.2.0,$1)"
++ PKG_CHECK_MODULES(PTH, [pth >= $_req_version], [have_pth=yes], [have_pth=no])
+
+- AC_MSG_CHECKING(for PTH - version >= $_req_version)
+- for _var in _pth_version _req_version; do
+- eval "_val=\"\$${_var}\""
+- _major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\1/'`
+- _minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\2/'`
+- _rtype=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\3/'`
+- _micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\4/'`
+- case $_rtype in
+- "a" ) _rtype=0 ;;
+- "b" ) _rtype=1 ;;
+- "." ) _rtype=2 ;;
+- esac
+- _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \
+- "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"`
+- eval "${_var}_hex=\"\$_hex\""
+- done
+- have_pth=no
+- if test ".$_pth_version_hex" != .; then
+- if test ".$_req_version_hex" != .; then
+- if test $_pth_version_hex -ge $_req_version_hex; then
+- have_pth=yes
+- fi
+- fi
+- fi
+ if test $have_pth = yes; then
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING([whether PTH installation is sane])
+@@ -51,9 +27,9 @@ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+ _gnupg_pth_save_cflags=$CFLAGS
+ _gnupg_pth_save_ldflags=$LDFLAGS
+ _gnupg_pth_save_libs=$LIBS
+- CFLAGS="$CFLAGS `$PTH_CONFIG --cflags`"
+- LDFLAGS="$LDFLAGS `$PTH_CONFIG --ldflags`"
+- LIBS="$LIBS `$PTH_CONFIG --libs --all`"
++ CFLAGS="$CFLAGS $PTH_CFLAGS"
++ LDFLAGS="$LDFLAGS $PTH_LDFLAGS"
++ LIBS="$LIBS $PTH_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pth.h>
+ ],
+ [[ pth_init ();]])],
+@@ -80,26 +56,13 @@ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+ # PTH_CLFAGS and PTH_LIBS are AS_SUBST.
+ #
+ AC_DEFUN([GNUPG_PATH_PTH],
+-[ AC_ARG_WITH(pth-prefix,
+- AC_HELP_STRING([--with-pth-prefix=PFX],
+- [prefix where GNU Pth is installed (optional)]),
+- pth_config_prefix="$withval", pth_config_prefix="")
+- if test x$pth_config_prefix != x ; then
+- PTH_CONFIG="$pth_config_prefix/bin/pth-config"
+- fi
+- AC_PATH_PROG(PTH_CONFIG, pth-config, no)
++[
+ tmp=ifelse([$1], ,1.3.7,$1)
+- if test "$PTH_CONFIG" != "no"; then
+- GNUPG_PTH_VERSION_CHECK($tmp)
+- if test $have_pth = yes; then
+- PTH_CFLAGS=`$PTH_CONFIG --cflags`
+- PTH_LIBS=`$PTH_CONFIG --ldflags`
+- PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
+- AC_DEFINE(HAVE_PTH, 1,
++ GNUPG_PTH_VERSION_CHECK($tmp)
++ if test $have_pth = yes; then
++ AC_DEFINE(HAVE_PTH, 1,
+ [Defined if the GNU Pth is available])
+- fi
+ fi
+ AC_SUBST(PTH_CFLAGS)
+ AC_SUBST(PTH_LIBS)
+ ])
+-
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gnupg/gnupg/0001-configure.ac-use-a-custom-value-for-the-location-of-.patch b/poky/meta/recipes-support/gnupg/gnupg/0001-configure.ac-use-a-custom-value-for-the-location-of-.patch
new file mode 100644
index 000000000..3e3a64df2
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg/0001-configure.ac-use-a-custom-value-for-the-location-of-.patch
@@ -0,0 +1,30 @@
+From 0b97148c3aad0993a9aeb088596fa63a2fec5328 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 22 Jan 2018 18:00:21 +0200
+Subject: [PATCH] configure.ac: use a custom value for the location of
+ gpg-agent socket in the filesystem
+
+This should avoid clashes with the host gpg-agent observed on autobuilders.
+
+Upstream-Status: Inappropriate [oe-core specific, and only for -native]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 382ef1d..0570d7c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1818,7 +1818,7 @@ AC_DEFINE_UNQUOTED(GPGCONF_DISP_NAME, "GPGConf",
+
+ AC_DEFINE_UNQUOTED(GPGTAR_NAME, "gpgtar", [The name of the gpgtar tool])
+
+-AC_DEFINE_UNQUOTED(GPG_AGENT_SOCK_NAME, "S.gpg-agent",
++AC_DEFINE_UNQUOTED(GPG_AGENT_SOCK_NAME, "S.gpg-agent.yocto-native",
+ [The name of the agent socket])
+ AC_DEFINE_UNQUOTED(GPG_AGENT_EXTRA_SOCK_NAME, "S.gpg-agent.extra",
+ [The name of the agent socket for remote access])
+--
+2.15.1
+
diff --git a/poky/meta/recipes-support/gnupg/gnupg/0002-use-pkgconfig-instead-of-npth-config.patch b/poky/meta/recipes-support/gnupg/gnupg/0002-use-pkgconfig-instead-of-npth-config.patch
new file mode 100644
index 000000000..6d86e5c99
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg/0002-use-pkgconfig-instead-of-npth-config.patch
@@ -0,0 +1,85 @@
+From 53c2aec2e13f4e2d09be7148869c862f07dfdd4d Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw@linux.intel.com>
+Date: Wed, 16 Aug 2017 11:16:30 +0800
+Subject: [PATCH 2/4] use pkgconfig instead of npth config
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Rebase to 2.1.23
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/npth.m4 | 34 ++++++++--------------------------
+ 1 file changed, 8 insertions(+), 26 deletions(-)
+
+diff --git a/m4/npth.m4 b/m4/npth.m4
+index 17c2644..15a931b 100644
+--- a/m4/npth.m4
++++ b/m4/npth.m4
+@@ -17,10 +17,10 @@ AC_DEFUN([_AM_PATH_NPTH_CONFIG],
+ if test "x$npth_config_prefix" != x ; then
+ NPTH_CONFIG="$npth_config_prefix/bin/npth-config"
+ fi
+- AC_PATH_PROG(NPTH_CONFIG, npth-config, no)
++ AC_PATH_PROG(PKGCONFIG, pkg-config, no)
+
+- if test "$NPTH_CONFIG" != "no" ; then
+- npth_version=`$NPTH_CONFIG --version`
++ if test "$PKGCONFIG" != "no" ; then
++ npth_version=`$PKGCONFIG --modversion npth`
+ fi
+ npth_version_major=`echo $npth_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+@@ -45,7 +45,7 @@ AC_DEFUN([AM_PATH_NPTH],
+
+ AC_MSG_CHECKING(for NPTH - version >= $min_npth_version)
+ ok=no
+- if test "$NPTH_CONFIG" != "no" ; then
++ if test "$PKGCONFIG" != "no" ; then
+ req_major=`echo $min_npth_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ req_minor=`echo $min_npth_version | \
+@@ -66,28 +66,9 @@ AC_DEFUN([AM_PATH_NPTH],
+ fi
+ if test $ok = yes; then
+ AC_MSG_RESULT([yes ($npth_version)])
+- else
+- AC_MSG_RESULT(no)
+- fi
+- if test $ok = yes; then
+- # If we have a recent NPTH, we should also check that the
+- # API is compatible.
+- if test "$req_npth_api" -gt 0 ; then
+- tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
+- if test "$tmp" -gt 0 ; then
+- AC_MSG_CHECKING([NPTH API version])
+- if test "$req_npth_api" -eq "$tmp" ; then
+- AC_MSG_RESULT([okay])
+- else
+- ok=no
+- AC_MSG_RESULT([does not match. want=$req_npth_api got=$tmp])
+- fi
+- fi
+- fi
+- fi
+- if test $ok = yes; then
+- NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
+- NPTH_LIBS=`$NPTH_CONFIG --libs`
++ NPTH_CFLAGS=`$PKGCONFIG --cflags npth`
++ NPTH_LIBS=`$PKGCONFIG --libs npth`
++ AC_MSG_WARN([[GOT HERE - $NPTH_LIBS ]])
+ ifelse([$2], , :, [$2])
+ npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
+ if test x"$npth_config_host" != xnone ; then
+@@ -103,6 +84,7 @@ AC_DEFUN([AM_PATH_NPTH],
+ fi
+ fi
+ else
++ AC_MSG_RESULT(no)
+ NPTH_CFLAGS=""
+ NPTH_LIBS=""
+ ifelse([$3], , :, [$3])
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gnupg/gnupg/0003-dirmngr-uses-libgpg-error.patch b/poky/meta/recipes-support/gnupg/gnupg/0003-dirmngr-uses-libgpg-error.patch
new file mode 100644
index 000000000..3e798efd0
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg/0003-dirmngr-uses-libgpg-error.patch
@@ -0,0 +1,32 @@
+From 9c3858ffda6246bf9e1e6aeeb920532a56b19408 Mon Sep 17 00:00:00 2001
+From: Saul Wold <sgw@linux.intel.com>
+Date: Wed, 16 Aug 2017 11:18:01 +0800
+Subject: [PATCH 3/4] dirmngr uses libgpg error
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Rebase to 2.1.23
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ dirmngr/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/dirmngr/Makefile.am b/dirmngr/Makefile.am
+index b404165..d3f916e 100644
+--- a/dirmngr/Makefile.am
++++ b/dirmngr/Makefile.am
+@@ -82,7 +82,8 @@ endif
+ dirmngr_LDADD = $(libcommonpth) \
+ $(DNSLIBS) $(LIBASSUAN_LIBS) \
+ $(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
+- $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
++ $(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV) \
++ $(GPG_ERROR_LIBS)
+ if USE_LDAP
+ dirmngr_LDADD += $(ldaplibs)
+ endif
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch b/poky/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
new file mode 100644
index 000000000..dcd8582ca
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg/0004-autogen.sh-fix-find-version-for-beta-checking.patch
@@ -0,0 +1,34 @@
+From 914ae4a3f7529fb069467bf0ded57dd24ee2e763 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Wed, 16 Aug 2017 11:23:22 +0800
+Subject: [PATCH 4/4] autogen.sh: fix find-version for beta checking
+
+find-version always assumes that gnupg is beta if autogen.sh is run
+out of git-repo. This doesn't work for users whom just take release
+tarball and re-run autoconf in their local build dir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+Rebase to 2.1.23
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ autogen.sh | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index e5ba5bf..05e0e11 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -245,7 +245,6 @@ if [ "$myhost" = "find-version" ]; then
+ rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
+ else
+ ingit=no
+- beta=yes
+ tmp="-unknown"
+ rev="0000000"
+ rvd="0"
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gnupg/gnupg_2.2.4.bb b/poky/meta/recipes-support/gnupg/gnupg_2.2.4.bb
new file mode 100644
index 000000000..d3f1a8f4c
--- /dev/null
+++ b/poky/meta/recipes-support/gnupg/gnupg_2.2.4.bb
@@ -0,0 +1,50 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
+HOMEPAGE = "http://www.gnupg.org/"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=189af8afca6d6075ba6c9e0aa8077626 \
+ file://COPYING.LGPL3;md5=a2b6bf2cb38ee52619e60f30a1fc7257"
+
+DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
+
+inherit autotools gettext texinfo pkgconfig
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://0001-Use-pkg-config-to-find-pth-instead-of-pth-config.patch \
+ file://0002-use-pkgconfig-instead-of-npth-config.patch \
+ file://0003-dirmngr-uses-libgpg-error.patch \
+ file://0004-autogen.sh-fix-find-version-for-beta-checking.patch \
+ "
+SRC_URI_append_class-native = " file://0001-configure.ac-use-a-custom-value-for-the-location-of-.patch"
+
+
+SRC_URI[md5sum] = "709e5af5bba84d251c520222e720972f"
+SRC_URI[sha256sum] = "401a3e64780fdfa6d7670de0880aa5c9d589b3db7a7098979d7606cec546f2ec"
+
+EXTRA_OECONF = "--disable-ldap \
+ --disable-ccid-driver \
+ --with-zlib=${STAGING_LIBDIR}/.. \
+ --with-bzip2=${STAGING_LIBDIR}/.. \
+ --with-readline=${STAGING_LIBDIR}/.. \
+ --enable-gpg-is-gpg2 \
+ "
+RRECOMMENDS_${PN} = "pinentry"
+
+do_configure_prepend () {
+ # Else these could be used in prefernce to those in aclocal-copy
+ rm -f ${S}/m4/gpg-error.m4
+ rm -f ${S}/m4/libassuan.m4
+ rm -f ${S}/m4/ksba.m4
+ rm -f ${S}/m4/libgcrypt.m4
+}
+
+do_install_append() {
+ ln -sf gpg2 ${D}${bindir}/gpg
+ ln -sf gpgv2 ${D}${bindir}/gpgv
+}
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[gnutls] = "--enable-gnutls, --disable-gnutls, gnutls"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite, --disable-sqlite, sqlite3"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/gnutls/gnutls.inc b/poky/meta/recipes-support/gnutls/gnutls.inc
new file mode 100644
index 000000000..7bcb9133a
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/gnutls.inc
@@ -0,0 +1,59 @@
+SUMMARY = "GNU Transport Layer Security Library"
+HOMEPAGE = "http://www.gnu.org/software/gnutls/"
+BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-xx = "LGPLv2.1+"
+LICENSE_${PN}-bin = "GPLv3+"
+LICENSE_${PN}-openssl = "GPLv3+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=71391c8e0c1cfe68077e7fce3b586283 \
+ file://doc/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://doc/COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+DEPENDS = "nettle gmp virtual/libiconv libunistring"
+DEPENDS_append_libc-musl = " argp-standalone"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = "ftp://ftp.gnutls.org/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz"
+
+inherit autotools texinfo binconfig pkgconfig gettext lib_package gtk-doc
+
+PACKAGECONFIG ??= "libidn"
+
+# You must also have CONFIG_SECCOMP enabled in the kernel for
+# seccomp to work.
+#
+PACKAGECONFIG[seccomp] = "ac_cv_libseccomp=yes,ac_cv_libseccomp=no,libseccomp"
+
+PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn"
+PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
+PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
+PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers"
+
+EXTRA_OECONF = " \
+ --enable-doc \
+ --disable-libdane \
+ --disable-guile \
+ --disable-rpath \
+ --enable-local-libopts \
+ --enable-openssl-compatibility \
+ --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
+ --without-libunistring-prefix \
+"
+
+LDFLAGS_append_libc-musl = " -largp"
+
+do_configure_prepend() {
+ for dir in . lib; do
+ rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4
+ done
+}
+
+PACKAGES =+ "${PN}-openssl ${PN}-xx"
+
+FILES_${PN}-dev += "${bindir}/gnutls-cli-debug"
+FILES_${PN}-openssl = "${libdir}/libgnutls-openssl.so.*"
+FILES_${PN}-xx = "${libdir}/libgnutlsxx.so.*"
diff --git a/poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch b/poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
new file mode 100644
index 000000000..b6e7bc965
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/gnutls/0001-configure.ac-fix-sed-command.patch
@@ -0,0 +1,29 @@
+From eaab55bb6d48643163eebbc9ca575a9ca2a8e03f Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 21 Feb 2017 17:10:07 +0200
+Subject: [PATCH] configure.ac: fix sed command
+
+The "sed 's/.bak//g'" matchs "bitbake", which would cause strange errors
+when the S contains "bitbake", fix to "sed 's/\.bak$//'`"
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gnutls-3.5.16/configure.ac
+===================================================================
+--- gnutls-3.5.16.orig/configure.ac
++++ gnutls-3.5.16/configure.ac
+@@ -955,7 +955,7 @@ YEAR=`date +%Y`
+ AC_SUBST([YEAR], $YEAR)
+
+ for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
+- nam=$(basename $i|sed 's/.bak//g')
++ nam=$(basename $i|sed 's/\.bak$//')
+ if test "$create_libopts_links" = "yes";then
+ rm -f "src/$nam.stamp"
+ rm -f "src/$nam"
diff --git a/poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch b/poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
new file mode 100644
index 000000000..34c8985c1
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/gnutls/arm_eabi.patch
@@ -0,0 +1,19 @@
+Certain syscall's are not availabe for arm-eabi, so we eliminate
+reference to them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/tests/seccomp.c
++++ b/tests/seccomp.c
+@@ -49,7 +49,9 @@ int disable_system_calls(void)
+ }
+
+ ADD_SYSCALL(nanosleep, 0);
++#if ! defined(__ARM_EABI__)
+ ADD_SYSCALL(time, 0);
++#endif
+ ADD_SYSCALL(getpid, 0);
+ ADD_SYSCALL(gettimeofday, 0);
+ #if defined(HAVE_CLOCK_GETTIME)
diff --git a/poky/meta/recipes-support/gnutls/gnutls_3.6.1.bb b/poky/meta/recipes-support/gnutls/gnutls_3.6.1.bb
new file mode 100644
index 000000000..7624a203d
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/gnutls_3.6.1.bb
@@ -0,0 +1,9 @@
+require gnutls.inc
+
+SRC_URI += "file://0001-configure.ac-fix-sed-command.patch \
+ file://arm_eabi.patch \
+ "
+SRC_URI[md5sum] = "4b65ae3ffef59f3eeed51a6166ff12b3"
+SRC_URI[sha256sum] = "20b10d2c9994bc032824314714d0e84c0f19bdb3d715d8ed55beb7364a8ebaed"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch b/poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch
new file mode 100644
index 000000000..1e52d6abf
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/libtasn1/0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch
@@ -0,0 +1,63 @@
+From b17dbb8d3c5605db3a1d82861fcaeef4636d1117 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Thu, 26 Jan 2017 18:54:48 +0200
+Subject: [PATCH] stdint.m4: reintroduce GNULIB_OVERRIDES_WINT_T check
+
+Partially revert the gnulib commit: 5a400b3f5a1f5483dbfd75d38bdb7080218a063b
+to fix the build error with musl library.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ gl/m4/stdint.m4 | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
+index 4ac854d..3dc3da1 100644
+--- a/gl/m4/stdint.m4
++++ b/gl/m4/stdint.m4
+@@ -355,6 +355,32 @@ int32_t i32 = INT32_C (0x7fffffff);
+ gl_STDINT_TYPE_PROPERTIES
+ fi
+
++ dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
++ dnl override 'wint_t'.
++ AC_CACHE_CHECK([whether wint_t is too small],
++ [gl_cv_type_wint_t_too_small],
++ [AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM([[
++ /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
++ <wchar.h>.
++ BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
++ included before <wchar.h>. */
++ #if !(defined __GLIBC__ && !defined __UCLIBC__)
++ # include <stddef.h>
++ # include <stdio.h>
++ # include <time.h>
++ #endif
++ #include <wchar.h>
++ int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
++ ]])],
++ [gl_cv_type_wint_t_too_small=no],
++ [gl_cv_type_wint_t_too_small=yes])])
++ if test $gl_cv_type_wint_t_too_small = yes; then
++ GNULIB_OVERRIDES_WINT_T=1
++ else
++ GNULIB_OVERRIDES_WINT_T=0
++ fi
++
+ dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
+ LIMITS_H=limits.h
+ AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+@@ -363,6 +389,7 @@ int32_t i32 = INT32_C (0x7fffffff);
+ AC_SUBST([HAVE_SYS_BITYPES_H])
+ AC_SUBST([HAVE_SYS_INTTYPES_H])
+ AC_SUBST([STDINT_H])
++ AC_SUBST([GNULIB_OVERRIDES_WINT_T])
+ AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
+ ])
+
+--
+2.4.0
+
diff --git a/poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch b/poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..2ac89f3b3
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libtasn1-2.14/doc/Makefile.am libtasn1-2.14/doc/Makefile.am
+--- libtasn1-2.14/doc/Makefile.am 2012-09-24 15:08:42.000000000 +0300
++++ libtasn1-2.14/doc/Makefile.am 2013-01-03 07:35:26.702763403 +0200
+@@ -31,7 +31,7 @@
+ AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \
+ --no-split --number-sections --css-include=texinfo.css
+
+-dist_man_MANS = $(gdoc_MANS) asn1Parser.1 asn1Coding.1 asn1Decoding.1
++dist_man_MANS = $(gdoc_MANS)
+
+ HELP2MAN_OPTS = --info-page libtasn1
diff --git a/poky/meta/recipes-support/gnutls/libtasn1_4.13.bb b/poky/meta/recipes-support/gnutls/libtasn1_4.13.bb
new file mode 100644
index 000000000..2d223861c
--- /dev/null
+++ b/poky/meta/recipes-support/gnutls/libtasn1_4.13.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Library for ASN.1 and DER manipulation"
+HOMEPAGE = "http://www.gnu.org/software/libtasn1/"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN}-bin = "GPLv3+"
+LICENSE_${PN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
+ file://README;endline=8;md5=c3803a3e8ca5ab5eb1e5912faa405351"
+
+SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
+ file://dont-depend-on-help2man.patch \
+ file://0001-stdint.m4-reintroduce-GNULIB_OVERRIDES_WINT_T-check.patch \
+ "
+
+DEPENDS = "bison-native"
+
+SRC_URI[md5sum] = "ce2ba4d3088119b48e7531a703669c52"
+SRC_URI[sha256sum] = "7e528e8c317ddd156230c4e31d082cd13e7ddeb7a54824be82632209550c8cca"
+
+inherit autotools texinfo binconfig lib_package gtk-doc
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0001-pkgconfig.patch b/poky/meta/recipes-support/gpgme/gpgme/0001-pkgconfig.patch
new file mode 100644
index 000000000..f1997e15a
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0001-pkgconfig.patch
@@ -0,0 +1,303 @@
+From 265faf8fe0acaca2043a248a4df02b0868ffa6de Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Wed, 16 Aug 2017 02:00:08 -0400
+Subject: [PATCH 1/4] pkgconfig
+
+Update gpgme to use pkgconfig instead of -config files since its
+simpler and less error prone when cross compiling.
+
+Upstream-Status: Denied [Upstream not interested in pkg-config support]
+RP 2015/4/17
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Rebase to 1.9.0
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 1 +
+ src/Makefile.am | 4 +-
+ src/gpgme-pthread.pc.in | 15 +++++++
+ src/gpgme.m4 | 114 ++++--------------------------------------------
+ src/gpgme.pc.in | 15 +++++++
+ 5 files changed, 42 insertions(+), 107 deletions(-)
+ create mode 100644 src/gpgme-pthread.pc.in
+ create mode 100644 src/gpgme.pc.in
+
+diff --git a/configure.ac b/configure.ac
+index 6ea4bcd..2a0d528 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -887,6 +887,7 @@ AC_CONFIG_FILES(Makefile src/Makefile
+ src/versioninfo.rc
+ src/gpgme.h)
+ AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
++AC_CONFIG_FILES(src/gpgme.pc src/gpgme-pthread.pc)
+ AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
+ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
+ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
+diff --git a/src/Makefile.am b/src/Makefile.am
+index ce6f1d4..5f38fee 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -19,12 +19,14 @@
+ ## Process this file with automake to produce Makefile.in
+
+ EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
+- gpgme.h.in versioninfo.rc.in gpgme.def
++ gpgme.h.in versioninfo.rc.in gpgme.def gpgme.pc.in gpgme-pthread.pc.in
+
+ bin_SCRIPTS = gpgme-config
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = gpgme.m4
+ nodist_include_HEADERS = gpgme.h
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = gpgme.pc gpgme-pthread.pc
+
+ bin_PROGRAMS = gpgme-tool
+
+diff --git a/src/gpgme-pthread.pc.in b/src/gpgme-pthread.pc.in
+new file mode 100644
+index 0000000..074bbf6
+--- /dev/null
++++ b/src/gpgme-pthread.pc.in
+@@ -0,0 +1,15 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@GPGME_CONFIG_API_VERSION@
++host=@GPGME_CONFIG_HOST@
++
++Name: gpgme
++Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program (deprecated)
++Version: @VERSION@
++Libs: -L${libdir} -lgpgme -lpthread
++Cflags: -I${includedir}
++Requires: libassuan gpg-error
+diff --git a/src/gpgme.m4 b/src/gpgme.m4
+index 6c2be44..d8a75cb 100644
+--- a/src/gpgme.m4
++++ b/src/gpgme.m4
+@@ -79,7 +79,7 @@ dnl config script does not match the host specification the script
+ dnl is added to the gpg_config_script_warn variable.
+ dnl
+ AC_DEFUN([AM_PATH_GPGME],
+-[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
++[
+ tmp=ifelse([$1], ,1:0.4.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -89,36 +89,12 @@ AC_DEFUN([AM_PATH_GPGME],
+ min_gpgme_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
+- ok=no
+- if test "$GPGME_CONFIG" != "no" ; then
+- req_major=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- if test "$gpgme_version_major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$gpgme_version_major" -eq "$req_major"; then
+- if test "$gpgme_version_minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$gpgme_version_minor" -eq "$req_minor"; then
+- if test "$gpgme_version_micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
++ PKG_CHECK_MODULES(GPGME, [gpgme >= $min_gpgme_version], [ok=yes], [ok=no])
+ if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+- tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version gpgme 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+@@ -127,19 +103,11 @@ AC_DEFUN([AM_PATH_GPGME],
+ fi
+ fi
+ if test $ok = yes; then
+- GPGME_CFLAGS=`$GPGME_CONFIG --cflags`
+- GPGME_LIBS=`$GPGME_CONFIG --libs`
+- AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ _AM_PATH_GPGME_CONFIG_HOST_CHECK
+ else
+- GPGME_CFLAGS=""
+- GPGME_LIBS=""
+- AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+- AC_SUBST(GPGME_CFLAGS)
+- AC_SUBST(GPGME_LIBS)
+ ])
+
+ dnl AM_PATH_GPGME_PTHREAD([MINIMUM-VERSION,
+@@ -148,7 +116,7 @@ dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS
+ dnl and GPGME_PTHREAD_LIBS.
+ dnl
+ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+-[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
++[
+ tmp=ifelse([$1], ,1:0.4.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -158,38 +126,12 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+ min_gpgme_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version)
+- ok=no
+- if test "$GPGME_CONFIG" != "no" ; then
+- if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then
+- req_major=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- if test "$gpgme_version_major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$gpgme_version_major" -eq "$req_major"; then
+- if test "$gpgme_version_minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$gpgme_version_minor" -eq "$req_minor"; then
+- if test "$gpgme_version_micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
++ PKG_CHECK_MODULES(GPGME_PTHREAD, [gpgme-pthread >= $min_gpgme_version], [ok=yes], [ok=no])
+ if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+- tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version gpgme-pthread 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+@@ -198,19 +140,11 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+ fi
+ fi
+ if test $ok = yes; then
+- GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags`
+- GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs`
+- AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ _AM_PATH_GPGME_CONFIG_HOST_CHECK
+ else
+- GPGME_PTHREAD_CFLAGS=""
+- GPGME_PTHREAD_LIBS=""
+- AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+- AC_SUBST(GPGME_PTHREAD_CFLAGS)
+- AC_SUBST(GPGME_PTHREAD_LIBS)
+ ])
+
+
+@@ -229,36 +163,12 @@ AC_DEFUN([AM_PATH_GPGME_GLIB],
+ min_gpgme_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
+- ok=no
+- if test "$GPGME_CONFIG" != "no" ; then
+- req_major=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_gpgme_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- if test "$gpgme_version_major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$gpgme_version_major" -eq "$req_major"; then
+- if test "$gpgme_version_minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$gpgme_version_minor" -eq "$req_minor"; then
+- if test "$gpgme_version_micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
++ PKG_CHECK_MODULES(GPGME_GLIB, [gpgme >= $min_gpgme_version glib-2.0], [ok=yes], [ok=no])
+ if test $ok = yes; then
+ # If we have a recent GPGME, we should also check that the
+ # API is compatible.
+ if test "$req_gpgme_api" -gt 0 ; then
+- tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version gpgme 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ if test "$req_gpgme_api" -ne "$tmp" ; then
+ ok=no
+@@ -267,17 +177,9 @@ AC_DEFUN([AM_PATH_GPGME_GLIB],
+ fi
+ fi
+ if test $ok = yes; then
+- GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags`
+- GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs`
+- AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ _AM_PATH_GPGME_CONFIG_HOST_CHECK
+ else
+- GPGME_GLIB_CFLAGS=""
+- GPGME_GLIB_LIBS=""
+- AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+- AC_SUBST(GPGME_GLIB_CFLAGS)
+- AC_SUBST(GPGME_GLIB_LIBS)
+ ])
+diff --git a/src/gpgme.pc.in b/src/gpgme.pc.in
+new file mode 100644
+index 0000000..b69539f
+--- /dev/null
++++ b/src/gpgme.pc.in
+@@ -0,0 +1,15 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@GPGME_CONFIG_API_VERSION@
++host=@GPGME_CONFIG_HOST@
++
++Name: gpgme
++Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program.
++Version: @VERSION@
++Libs: -L${libdir} -lgpgme
++Cflags: -I${includedir}
++Requires: libassuan gpg-error
+\ No newline at end of file
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0002-gpgme-lang-python-gpg-error-config-should-not-be-use.patch b/poky/meta/recipes-support/gpgme/gpgme/0002-gpgme-lang-python-gpg-error-config-should-not-be-use.patch
new file mode 100644
index 000000000..d20271e31
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0002-gpgme-lang-python-gpg-error-config-should-not-be-use.patch
@@ -0,0 +1,51 @@
+From 30f7a694cc4568ecb24f77c83a6123ed3f4075fa Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 31 Jan 2018 10:44:19 +0800
+Subject: [PATCH] gpgme/lang/python: gpg-error-config should not be used
+
+gpg-error-config was modified by OE to always return an error.
+So we want to find an alternative way to retrieve whatever it
+is we need.
+
+Upstream-Status: Inappropriate [changes are specific to OE]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Rework to 1.10.0
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ lang/python/setup.py.in | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
+index f9dda20..9f5d61f 100755
+--- a/lang/python/setup.py.in
++++ b/lang/python/setup.py.in
+@@ -26,7 +26,6 @@ import shutil
+ import subprocess
+
+ # Out-of-tree build of the gpg bindings.
+-gpg_error_config = ["gpg-error-config"]
+ gpgme_config_flags = ["--thread=pthread"]
+ gpgme_config = ["gpgme-config"] + gpgme_config_flags
+ gpgme_h = ""
+@@ -174,14 +173,7 @@ class BuildExtFirstHack(build):
+
+ def _generate_errors_i(self):
+
+- try:
+- subprocess.check_call(gpg_error_config + ['--version'],
+- stdout=devnull)
+- except:
+- sys.exit("Could not find gpg-error-config. " +
+- "Please install the libgpg-error development package.")
+-
+- gpg_error_content = self._read_header("gpg-error.h", getconfig("cflags", config=gpg_error_config))
++ gpg_error_content = self._read_header("gpg-error.h", os.environ.get('CFLAGS').split())
+
+ filter_re = re.compile(r'GPG_ERR_[^ ]* =')
+ rewrite_re = re.compile(r' *(.*) = .*')
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0003-Correctly-install-python-modules.patch b/poky/meta/recipes-support/gpgme/gpgme/0003-Correctly-install-python-modules.patch
new file mode 100644
index 000000000..7c9cccc0e
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0003-Correctly-install-python-modules.patch
@@ -0,0 +1,33 @@
+From 93aae34ee70b8d50b31a19a65d6ac8290cb148ae Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 30 Jan 2018 15:28:49 +0800
+Subject: [PATCH 2/4] Correctly install python modules
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+Rebase to 1.9.0
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
+Rebase to 1.10.0
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ lang/python/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
+index 8d74cbd..ce4f0a5 100644
+--- a/lang/python/Makefile.am
++++ b/lang/python/Makefile.am
+@@ -91,6 +91,7 @@ install-exec-local:
+ --build-base="$$(basename "$${PYTHON}")-gpg" \
+ install \
+ --prefix "$(DESTDIR)$(prefix)" \
++ --install-lib=$(DESTDIR)${pythondir} \
+ --verbose ; \
+ done
+
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0004-python-import.patch b/poky/meta/recipes-support/gpgme/gpgme/0004-python-import.patch
new file mode 100644
index 000000000..d2b039dac
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0004-python-import.patch
@@ -0,0 +1,34 @@
+From 32ecc3f058307060e40af86127cd226248a73c41 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 16 Aug 2017 02:06:45 -0400
+Subject: [PATCH 3/4] python import
+
+Don't check for output on stderr to know if an import worked, host inputrc and
+sysroot readline can cause warnings on stderr.
+
+Upstream-Status: Backport (from autoconf-archive 883a2abd)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Rebase to 1.9.0
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ m4/ax_python_devel.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
+index b990d5b..318b089 100644
+--- a/m4/ax_python_devel.m4
++++ b/m4/ax_python_devel.m4
+@@ -137,7 +137,7 @@ variable to configure. See ``configure --help'' for reference.
+ #
+ AC_MSG_CHECKING([for the distutils Python package])
+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
+- if test -z "$ac_distutils_result"; then
++ if test $? -eq 0; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0005-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch b/poky/meta/recipes-support/gpgme/gpgme/0005-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch
new file mode 100644
index 000000000..963ae874c
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0005-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch
@@ -0,0 +1,31 @@
+From 6dcedc4dd055af902719b1a1cb10daa935a27f58 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 13 Apr 2017 16:40:27 +0300
+Subject: [PATCH 4/4] gpgme-config: skip all /lib* or /usr/lib* directories in
+ output
+
+The logic was not working in multilib setups which use other
+directory names than plain /lib or /usr/lib.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/gpgme-config.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gpgme-config.in b/src/gpgme-config.in
+index a4d152e..8342865 100644
+--- a/src/gpgme-config.in
++++ b/src/gpgme-config.in
+@@ -154,7 +154,7 @@ while test $# -gt 0; do
+ for i in $libs $tmp_l $assuan_libs $gpg_error_libs $tmp_x; do
+ skip=no
+ case $i in
+- -L/usr/lib|-L/lib)
++ -L/usr/lib*|-L/lib*)
+ skip=yes
+ ;;
+ -L*|-l*)
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0006-fix-build-path-issue.patch b/poky/meta/recipes-support/gpgme/gpgme/0006-fix-build-path-issue.patch
new file mode 100644
index 000000000..8cc8983e2
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0006-fix-build-path-issue.patch
@@ -0,0 +1,37 @@
+From 180a5669e4a13a550b1b0dcef1689b6c0470fe54 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 31 Jan 2018 11:01:09 +0800
+Subject: [PATCH] fix build path issue
+
+Get the "--root" directory supplied to the "install" command,
+and use it as a prefix to strip off the purported filename
+encoded in bytecode files.
+
+Since --root added, we need to tweak --prefix and --install-lib
+to use relative path.
+
+Upstream-Status: Submitted [gnupg-devel@gnupg.org]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ lang/python/Makefile.am | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
+index ce4f0a5..5a468f1 100644
+--- a/lang/python/Makefile.am
++++ b/lang/python/Makefile.am
+@@ -90,8 +90,9 @@ install-exec-local:
+ build \
+ --build-base="$$(basename "$${PYTHON}")-gpg" \
+ install \
+- --prefix "$(DESTDIR)$(prefix)" \
+- --install-lib=$(DESTDIR)${pythondir} \
++ --root=${DESTDIR} \
++ --prefix "$(prefix)" \
++ --install-lib=${pythondir} \
+ --verbose ; \
+ done
+
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme/0007-qt-python-Add-variables-to-tests.patch b/poky/meta/recipes-support/gpgme/gpgme/0007-qt-python-Add-variables-to-tests.patch
new file mode 100644
index 000000000..ce3745cca
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme/0007-qt-python-Add-variables-to-tests.patch
@@ -0,0 +1,78 @@
+From f47e8c6f9e461803468a64581d3640d873352eaa Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 1 Feb 2018 10:14:30 +0800
+Subject: [PATCH] qt/python: Add variables to tests
+
+* configure.ac, lang/python/Makefile.am:
+ New variable to `lang/python', set to `lang/python' if RUN_LANG_PYTHON_TESTS
+
+* configure.ac, lang/qt/Makefile.am:
+ New variable to `lang/qt', set to `lang/qt' if RUN_LANG_QT_TESTS
+
+Upstream-Status: Submitted [gnupg-devel@gnupg.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 11 +++++++++++
+ lang/python/Makefile.am | 3 +++
+ lang/qt/Makefile.am | 8 +++++++-
+ 3 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 608c376..fad7467 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -536,6 +536,17 @@ AC_ARG_ENABLE(g13-test,
+ run_g13_test=$enableval)
+ AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
+
++run_lang_python_test="yes"
++AC_ARG_ENABLE(lang-python-test,
++ AC_HELP_STRING([--disable-lang-python-test], [disable Python regression test]),
++ run_lang_python_test=$enableval)
++AM_CONDITIONAL(RUN_LANG_PYTHON_TESTS, test "$run_lang_python_test" = "yes")
++
++run_lang_qt_test="yes"
++AC_ARG_ENABLE(lang-qt-test,
++ AC_HELP_STRING([--disable-lang-qt-test], [disable Qt regression test]),
++ run_lang_qt_test=$enableval)
++AM_CONDITIONAL(RUN_LANG_QT_TESTS, test "$run_lang_qt_test" = "yes")
+
+ # Checks for header files.
+ AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h
+diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am
+index 8d74cbd..43b5d1e 100644
+--- a/lang/python/Makefile.am
++++ b/lang/python/Makefile.am
+@@ -24,7 +24,10 @@ EXTRA_DIST = \
+ examples \
+ src
+
++if RUN_LANG_PYTHON_TESTS
+ SUBDIRS = . tests
++endif
++
+
+ .PHONY: prepare
+ prepare: copystamp
+diff --git a/lang/qt/Makefile.am b/lang/qt/Makefile.am
+index ab85960..a244ede 100644
+--- a/lang/qt/Makefile.am
++++ b/lang/qt/Makefile.am
+@@ -19,6 +19,12 @@
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ # 02111-1307, USA
+
+-SUBDIRS = src tests doc
++if RUN_LANG_QT_TESTS
++qttests = tests
++else
++qttests =
++endif
++
++SUBDIRS = src ${qttests} doc
+
+ EXTRA_DIST = README
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/gpgme/gpgme_1.10.0.bb b/poky/meta/recipes-support/gpgme/gpgme_1.10.0.bb
new file mode 100644
index 000000000..f015f3ad7
--- /dev/null
+++ b/poky/meta/recipes-support/gpgme/gpgme_1.10.0.bb
@@ -0,0 +1,86 @@
+SUMMARY = "High-level GnuPG encryption/signing API"
+DESCRIPTION = "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management"
+HOMEPAGE = "http://www.gnupg.org/gpgme.html"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LESSER;md5=bbb461211a33b134d42ed5ee802b37ff \
+ file://src/gpgme.h.in;endline=23;md5=9d157d08a69059344e6f82abd2d25781 \
+ file://src/engine.h;endline=22;md5=4b6d8ba313d9b564cc4d4cfb1640af9d"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/gpgme/${BP}.tar.bz2 \
+ file://0001-pkgconfig.patch \
+ file://0002-gpgme-lang-python-gpg-error-config-should-not-be-use.patch \
+ file://0003-Correctly-install-python-modules.patch \
+ file://0004-python-import.patch \
+ file://0005-gpgme-config-skip-all-lib-or-usr-lib-directories-in-.patch \
+ file://0006-fix-build-path-issue.patch \
+ file://0007-qt-python-Add-variables-to-tests.patch \
+ "
+
+SRC_URI[md5sum] = "78b1533c593478982ee2fc548260c563"
+SRC_URI[sha256sum] = "1a8fed1197c3b99c35f403066bb344a26224d292afc048cfdfc4ccd5690a0693"
+
+DEPENDS = "libgpg-error libassuan"
+RDEPENDS_${PN}-cpp += "libstdc++"
+
+RDEPENDS_python2-gpg += "python-unixadmin"
+RDEPENDS_python3-gpg += "python3-unixadmin"
+
+BINCONFIG = "${bindir}/gpgme-config"
+
+# Note select python2 or python3, but you can't select both at the same time
+PACKAGECONFIG ??= "python3"
+PACKAGECONFIG[python2] = ",,python swig-native,"
+PACKAGECONFIG[python3] = ",,python3 swig-native,"
+
+# Default in configure.ac: "cl cpp python qt"
+# Supported: "cl cpp python python2 python3 qt"
+# python says 'search and find python2 or python3'
+
+# Building the C++ bindings for native requires a C++ compiler with C++11
+# support. Since these bindings are currently not needed, we can disable them.
+DEFAULT_LANGUAGES = ""
+DEFAULT_LANGUAGES_class-target = "cpp"
+LANGUAGES ?= "${DEFAULT_LANGUAGES}"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python2', ' python2', '', d)}"
+LANGUAGES .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', ' python3', '', d)}"
+
+PYTHON_INHERIT = "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'pythonnative', '', d)}"
+PYTHON_INHERIT .= "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3native', '', d)}"
+
+EXTRA_OECONF += '--enable-languages="${LANGUAGES}" \
+ --disable-gpgconf-test \
+ --disable-gpg-test \
+ --disable-gpgsm-test \
+ --disable-g13-test \
+ --disable-lang-qt-test \
+ --disable-lang-python-test \
+'
+
+inherit autotools texinfo binconfig-disabled pkgconfig ${PYTHON_INHERIT}
+
+export PKG_CONFIG='pkg-config'
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES =+ "${PN}-cpp"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python2-gpg ', '', d)}"
+PACKAGES =. "${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-gpg ', '', d)}"
+
+FILES_${PN}-cpp = "${libdir}/libgpgmepp.so.*"
+FILES_python2-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_python3-gpg = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/* \
+ ${libdir}/cmake/* \
+"
+
+CFLAGS_append_libc-musl = " -D__error_t_defined "
+do_configure_prepend () {
+ # Else these could be used in preference to those in aclocal-copy
+ rm -f ${S}/m4/gpg-error.m4
+ rm -f ${S}/m4/libassuan.m4
+ rm -f ${S}/m4/python.m4
+}
diff --git a/poky/meta/recipes-support/icu/icu.inc b/poky/meta/recipes-support/icu/icu.inc
new file mode 100644
index 000000000..983118cd6
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu.inc
@@ -0,0 +1,87 @@
+SUMMARY = "International Component for Unicode libraries"
+DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \
+portable set of C/C++ and Java libraries for Unicode support, software \
+internationalization (I18N) and globalization (G11N), giving applications the \
+same results on all platforms."
+HOMEPAGE = "http://site.icu-project.org/"
+
+LICENSE = "ICU"
+DEPENDS = "icu-native"
+DEPENDS_class-native = ""
+
+CVE_PRODUCT = "international_components_for_unicode"
+
+S = "${WORKDIR}/icu/source"
+SPDX_S = "${WORKDIR}/icu"
+STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
+
+BINCONFIG = "${bindir}/icu-config"
+
+ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
+
+inherit autotools pkgconfig binconfig
+
+# ICU needs the native build directory as an argument to its --with-cross-build option when
+# cross-compiling. Taken the situation that different builds may share a common sstate-cache
+# into consideration, the native build directory needs to be staged.
+EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+EXTRA_OECONF_class-native = ""
+EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+
+EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}"
+TARGET_CXXFLAGS_append = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}"
+
+# strtod_l() is not supported by musl; also xlocale.h is missing
+# It is not possible to disable its use via configure switches or env vars
+# so monkey patching is needed.
+do_configure_prepend_libc-musl () {
+ sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' ${S}/configure.ac
+}
+
+do_compile_prepend_class-target () {
+ # Make sure certain build host references do not end up being compiled
+ # in the image. This only affects libicutu and icu-dbg
+ sed \
+ -e 's,DU_BUILD=,DU_BUILD_unused=,g' \
+ -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -i ${B}/tools/toolutil/Makefile
+}
+
+PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
+do_install_append_class-native() {
+ mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE}
+ cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE}
+ cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
+}
+
+do_install_append_class-target() {
+ # The native pkgdata can not generate the correct data file.
+ # Use icupkg to re-generate it.
+ if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then
+ rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+ icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+ fi
+
+ # Remove build host references...
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ ${D}/${bindir}/icu-config ${D}/${libdir}/${BPN}/${PV}/Makefile.inc \
+ ${D}/${libdir}/${BPN}/${PV}/pkgdata.inc
+}
+
+PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
+
+FILES_${PN}-dev += "${libdir}/${BPN}/"
+
+FILES_libicudata = "${libdir}/libicudata.so.*"
+FILES_libicuuc = "${libdir}/libicuuc.so.*"
+FILES_libicui18n = "${libdir}/libicui18n.so.*"
+FILES_libicutu = "${libdir}/libicutu.so.*"
+FILES_libicuio = "${libdir}/libicuio.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch b/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
new file mode 100644
index 000000000..2968d571b
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
@@ -0,0 +1,28 @@
+From 0c82d6aa02c08e41b13c83b14782bd7024e25d59 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Feb 2014 21:06:42 +0000
+Subject: [PATCH] Disable LDFLAGSICUDT for Linux
+
+Upstream-Status: Inappropriate [ OE Configuration ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ source/config/mh-linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mh-linux b/config/mh-linux
+index 366f0cc..2689aab 100644
+--- a/config/mh-linux
++++ b/config/mh-linux
+@@ -21,7 +21,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+ LD_RPATH_PRE = -Wl,-rpath,
+
+ ## These are the library specific LDFLAGS
+-LDFLAGSICUDT=-nodefaultlibs -nostdlib
++# LDFLAGSICUDT=-nodefaultlibs -nostdlib
+
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch b/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
new file mode 100644
index 000000000..f0c49e197
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
@@ -0,0 +1,34 @@
+From d6b57c1b4eb9a24d9d95342a961c93946539c93b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 24 Jun 2017 22:52:40 -0700
+Subject: [PATCH 3/4] i18n: Drop include <xlocale.h>
+
+glibc 2.26 drops this header
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ source/i18n/digitlst.cpp | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/source/i18n/digitlst.cpp b/source/i18n/digitlst.cpp
+index 8e86fa7..0bdbb2c 100644
+--- a/i18n/digitlst.cpp
++++ b/i18n/digitlst.cpp
+@@ -62,11 +62,7 @@
+ #endif
+
+ #if U_USE_STRTOD_L
+-# if U_HAVE_XLOCALE_H
+-# include <xlocale.h>
+-# else
+-# include <locale.h>
+-# endif
++# include <locale.h>
+ #endif
+
+ // ***************************************************************************
+--
+2.14.2
+
diff --git a/poky/meta/recipes-support/icu/icu/fix-install-manx.patch b/poky/meta/recipes-support/icu/icu/fix-install-manx.patch
new file mode 100644
index 000000000..8186fb412
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/fix-install-manx.patch
@@ -0,0 +1,57 @@
+From 3063a9211669bee673840ee81f81d30699b9b702 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 9 Oct 2015 17:50:41 +0100
+Subject: [PATCH 2/4] icu: fix install race
+
+The generic recursive target calls target-local so also adding it to the
+dependency list results in races due to install-local being executed twice in
+parallel. For example, install-manx can fail if the two install processes race
+and one process tries to chown a file that the other process has just deleted.
+
+Also install-manx should be a phony target, and for clarity use $^ instead of $?
+in the install command.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ source/Makefile.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/source/Makefile.in b/source/Makefile.in
+index c1db15b..4948deb 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -73,7 +73,7 @@ EXTRA_DATA =
+
+ ## List of phony targets
+ .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
+-install-recursive clean clean-local clean-recursive distclean \
++install-recursive install-manx clean clean-local clean-recursive distclean \
+ distclean-local distclean-recursive doc dist dist-local dist-recursive \
+ check check-local check-recursive clean-recursive-with-twist install-icu \
+ doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
+@@ -84,9 +84,9 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
+
+ ## List of standard targets
+ all: all-local all-recursive
+-install: install-recursive install-local
++install: install-recursive
+ clean: clean-recursive-with-twist clean-local
+-distclean : distclean-recursive distclean-local
++distclean : distclean-recursive
+ dist: dist-recursive
+ check: all check-recursive
+ check-recursive: all
+@@ -350,7 +350,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
+
+ install-manx: $(MANX_FILES)
+ $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
+- $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
++ $(INSTALL_DATA) $^ $(DESTDIR)$(mandir)/man$(SECTION)
+
+ config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
+ cd $(top_builddir) \
+--
+2.14.2
+
diff --git a/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch b/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
new file mode 100644
index 000000000..e758a623e
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
@@ -0,0 +1,49 @@
+pkgdata.cpp: use LARGE_BUFFER_MAX_SIZE for cmd
+
+Use LARGE_BUFFER_MAX_SIZE for cmd rather than SMALL_BUFFER_MAX_SIZE,
+otherwise there was a Segmentation fault error when the command line is
+long, this should be a misplay since other cmd uses
+LARGE_BUFFER_MAX_SIZE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ tools/pkgdata/pkgdata.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
+index 60167dd..506dd32 100644
+--- a/tools/pkgdata/pkgdata.cpp
++++ b/tools/pkgdata/pkgdata.cpp
+@@ -1084,7 +1084,7 @@ normal_symlink_mode:
+
+ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE];
++ char cmd[LARGE_BUFFER_MAX_SIZE];
+
+ sprintf(cmd, "cd %s && %s %s %s%s%s",
+ targetDir,
+@@ -1152,7 +1152,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
+
+ static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
++ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
+
+ if (!T_FileStream_file_exists(installDir)) {
+ UErrorCode status = U_ZERO_ERROR;
+@@ -1184,7 +1184,7 @@ static int32_t pkg_installCommonMode(const char *installDir, const char *fileNam
+ #endif
+ static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
++ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
+
+ if (!T_FileStream_file_exists(installDir)) {
+ UErrorCode status = U_ZERO_ERROR;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/icu/icu_60.2.bb b/poky/meta/recipes-support/icu/icu_60.2.bb
new file mode 100644
index 000000000..585a92bc4
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu_60.2.bb
@@ -0,0 +1,29 @@
+require icu.inc
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=675f2d069434d8a1e4e6b0dcf4379226"
+
+def icu_download_version(d):
+ pvsplit = d.getVar('PV').split('.')
+ return pvsplit[0] + "_" + pvsplit[1]
+
+ICU_PV = "${@icu_download_version(d)}"
+
+# http://errors.yoctoproject.org/Errors/Details/20486/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
+SRC_URI = "${BASE_SRC_URI} \
+ file://icu-pkgdata-large-cmd.patch \
+ file://fix-install-manx.patch \
+ file://0001-i18n-Drop-include-xlocale.h.patch \
+ "
+
+SRC_URI_append_class-target = "\
+ file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
+ "
+SRC_URI[md5sum] = "43861b127744b3c0b9d7f386f4b9fa40"
+SRC_URI[sha256sum] = "f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418"
+
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
+UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
diff --git a/poky/meta/recipes-support/iso-codes/iso-codes_3.77.bb b/poky/meta/recipes-support/iso-codes/iso-codes_3.77.bb
new file mode 100644
index 000000000..bd613ac57
--- /dev/null
+++ b/poky/meta/recipes-support/iso-codes/iso-codes_3.77.bb
@@ -0,0 +1,15 @@
+SUMMARY = "ISO language, territory, currency, script codes and their translations"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "https://pkg-isocodes.alioth.debian.org/downloads/iso-codes-${PV}.tar.xz"
+SRC_URI[md5sum] = "9d0d06cfb4634428b300845edcd7140a"
+SRC_URI[sha256sum] = "21cd73a4c6f95d9474ebfcffd4e065223857720f24858e564f4409b19f7f0d90"
+
+# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which
+# are inhibited by allarch
+DEPENDS = "gettext-native"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/xml/"
diff --git a/poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch b/poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
new file mode 100644
index 000000000..525b07620
--- /dev/null
+++ b/poky/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
@@ -0,0 +1,159 @@
+Add pkgconfig support to libassuan.
+This patch is rejected by upstream for the reason below:
+They think pkgconfig adds no portability and maintaining them is not worthwhile.
+
+Upstream-Status: Denied
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+forward ported to 2.4.4
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: libassuan-2.4.4/libassuan.pc.in
+===================================================================
+--- /dev/null
++++ libassuan-2.4.4/libassuan.pc.in
+@@ -0,0 +1,13 @@
++prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++api_version=@LIBASSUAN_CONFIG_API_VERSION@
++host=@LIBASSUAN_CONFIG_HOST@
++
++Name: libassuan
++Description: IPC library used by GnuPG and GPGME
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lassuan
++Libs.private: -lgpg-error
++Cflags: -I${includedir}
+Index: libassuan-2.4.4/Makefile.am
+===================================================================
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -25,10 +25,13 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-doc
+ # (A suitable gitlog-to-changelog script can be found in GnuPG master.)
+ GITLOG_TO_CHANGELOG=gitlog-to-changelog
+
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libassuan.pc
++
+ EXTRA_DIST = autogen.sh autogen.rc README.GIT VERSION \
+ ChangeLog-2011 doc/ChangeLog-2011 src/ChangeLog-2011 \
+ tests/ChangeLog-2011 contrib/ChangeLog-2011 \
+- build-aux/git-log-footer build-aux/git-log-fix
++ build-aux/git-log-footer build-aux/git-log-fix libassuan.pc.in
+
+ if BUILD_DOC
+ doc = doc
+Index: 2.4.4-r0/libassuan-2.4.4/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -485,6 +485,7 @@ AC_CONFIG_FILES([doc/Makefile])
+ AC_CONFIG_FILES([tests/Makefile])
+ AC_CONFIG_FILES([src/libassuan-config], [chmod +x src/libassuan-config])
+ AC_CONFIG_FILES([src/versioninfo.rc])
++AC_CONFIG_FILES([libassuan.pc])
+
+ AC_OUTPUT
+
+Index: libassuan-2.4.4/src/libassuan.m4
+===================================================================
+--- a/src/libassuan.m4
++++ b/src/libassuan.m4
+@@ -16,18 +16,6 @@ dnl Returns ok set to yes or no.
+ dnl
+ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_ARG_WITH(libassuan-prefix,
+- AC_HELP_STRING([--with-libassuan-prefix=PFX],
+- [prefix where LIBASSUAN is installed (optional)]),
+- libassuan_config_prefix="$withval", libassuan_config_prefix="")
+- if test x$libassuan_config_prefix != x ; then
+- libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
+- if test x${LIBASSUAN_CONFIG+set} != xset ; then
+- LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
+- fi
+- fi
+-
+- AC_PATH_TOOL(LIBASSUAN_CONFIG, libassuan-config, no)
+
+ tmp=ifelse([$1], ,1:0.9.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+@@ -38,51 +26,12 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ min_libassuan_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
+- ok=no
+- if test "$LIBASSUAN_CONFIG" != "no" \
+- && test -f "$LIBASSUAN_CONFIG" ; then
+- req_major=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-
+- libassuan_config_version=`$LIBASSUAN_CONFIG --version`
+- major=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- micro=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+-
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$minor" -eq "$req_minor"; then
+- if test "$micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
+-
+- if test $ok = yes; then
+- AC_MSG_RESULT([yes ($libassuan_config_version)])
+- else
+- AC_MSG_RESULT(no)
+- fi
++ PKG_CHECK_MODULES(LIBASSUAN, [libassuan >= $min_libassuan_version], [ok=yes], [ok=no])
+
+ if test $ok = yes; then
+ if test "$req_libassuan_api" -gt 0 ; then
+ tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version libassuan`
+ if test "$tmp" -gt 0 ; then
+ AC_MSG_CHECKING([LIBASSUAN API version])
+ if test "$req_libassuan_api" -eq "$tmp" ; then
+@@ -97,7 +46,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+
+ if test $ok = yes; then
+ if test x"$host" != x ; then
+- libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
++ libassuan_config_host=`$PKG_CONFIG --variable=host libassuan`
+ if test x"$libassuan_config_host" != xnone ; then
+ if test x"$libassuan_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -138,12 +87,8 @@ dnl
+ AC_DEFUN([AM_PATH_LIBASSUAN],
+ [ _AM_PATH_LIBASSUAN_COMMON($1)
+ if test $ok = yes; then
+- LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
+- LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
+ ifelse([$2], , :, [$2])
+ else
+- LIBASSUAN_CFLAGS=""
+- LIBASSUAN_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(LIBASSUAN_CFLAGS)
diff --git a/poky/meta/recipes-support/libassuan/libassuan_2.5.1.bb b/poky/meta/recipes-support/libassuan/libassuan_2.5.1.bb
new file mode 100644
index 000000000..34d5f1642
--- /dev/null
+++ b/poky/meta/recipes-support/libassuan/libassuan_2.5.1.bb
@@ -0,0 +1,32 @@
+SUMMARY = "IPC library used by GnuPG and GPGME"
+HOMEPAGE = "http://www.gnupg.org/related_software/libassuan/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-doc = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://src/assuan.c;endline=20;md5=ab92143a5a2adabd06d7994d1467ea5c\
+ file://src/assuan-defs.h;endline=20;md5=15d950c83e82978e35b35e790d7e4d39"
+
+DEPENDS = "libgpg-error"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/libassuan/libassuan-${PV}.tar.bz2 \
+ file://libassuan-add-pkgconfig-support.patch \
+ "
+
+SRC_URI[md5sum] = "4354b7ae296894f232ada226a062d7d7"
+SRC_URI[sha256sum] = "47f96c37b4f2aac289f0bc1bacfa8bd8b4b209a488d3d15e2229cb6cc9b26449"
+
+BINCONFIG = "${bindir}/libassuan-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+do_configure_prepend () {
+ # Else these could be used in preference to those in aclocal-copy
+ rm -f ${S}/m4/*.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.6.2.bb b/poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.6.2.bb
new file mode 100644
index 000000000..f7b416352
--- /dev/null
+++ b/poky/meta/recipes-support/libatomic-ops/libatomic-ops_7.6.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "A library for atomic integer operations"
+HOMEPAGE = "https://github.com/ivmai/libatomic_ops/"
+SECTION = "optional"
+PROVIDES += "libatomics-ops"
+LICENSE = "GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://doc/LICENSING.txt;md5=e00dd5c8ac03a14c5ae5225a4525fa2d \
+ "
+PV .= "+git${SRCPV}"
+SRCBRANCH ?= "release-7_6"
+
+SRCREV = "5ae4b4aeea2baf13752d07e3038c47f70f06dcac"
+SRC_URI = "git://github.com/ivmai/libatomic_ops;branch=${SRCBRANCH}"
+
+S = "${WORKDIR}/git"
+
+ALLOW_EMPTY_${PN} = "1"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch b/poky/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
new file mode 100644
index 000000000..54617b506
--- /dev/null
+++ b/poky/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
@@ -0,0 +1,376 @@
+From 88adbe1a855b7aa95bd925c80ed83c86f3fc42e3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 09:39:31 -0800
+Subject: [PATCH 1/3] Replace __BEGIN_DECLS and __END_DECLS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+Upstream-Status: Pending
+
+ include/bsd/err.h | 10 ++++++++--
+ include/bsd/libutil.h | 10 ++++++++--
+ include/bsd/md5.h | 10 ++++++++--
+ include/bsd/nlist.h | 10 ++++++++--
+ include/bsd/readpassphrase.h | 10 ++++++++--
+ include/bsd/stdio.h | 10 ++++++++--
+ include/bsd/stdlib.h | 12 +++++++++---
+ include/bsd/string.h | 12 +++++++++---
+ include/bsd/stringlist.h | 10 ++++++++--
+ include/bsd/unistd.h | 10 ++++++++--
+ include/bsd/vis.h | 10 ++++++++--
+ include/bsd/wchar.h | 10 ++++++++--
+ src/hash/sha512.h | 10 ++++++++--
+ 13 files changed, 106 insertions(+), 28 deletions(-)
+
+diff --git a/include/bsd/err.h b/include/bsd/err.h
+index 12fd051..43dfc32 100644
+--- a/include/bsd/err.h
++++ b/include/bsd/err.h
+@@ -42,7 +42,10 @@
+
+ #include <stdarg.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ void warnc(int code, const char *format, ...)
+ __printflike(2, 3);
+ void vwarnc(int code, const char *format, va_list ap)
+@@ -51,6 +54,9 @@ void errc(int status, int code, const char *format, ...)
+ __printflike(3, 4);
+ void verrc(int status, int code, const char *format, va_list ap)
+ __printflike(3, 0);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
+index 45b3b15..9c936e5 100644
+--- a/include/bsd/libutil.h
++++ b/include/bsd/libutil.h
+@@ -53,7 +53,10 @@ struct pidfh {
+ ino_t pf_ino;
+ };
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ int humanize_number(char *buf, size_t len, int64_t bytes,
+ const char *suffix, int scale, int flags);
+ int expand_number(const char *_buf, uint64_t *_num);
+@@ -66,7 +69,10 @@ int pidfile_close(struct pidfh *pfh);
+ int pidfile_remove(struct pidfh *pfh);
+
+ char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ /* humanize_number(3) */
+ #define HN_DECIMAL 0x01
+diff --git a/include/bsd/md5.h b/include/bsd/md5.h
+index 5f3ae46..5d80e5c 100644
+--- a/include/bsd/md5.h
++++ b/include/bsd/md5.h
+@@ -30,7 +30,10 @@ typedef struct MD5Context {
+ #include <sys/cdefs.h>
+ #include <sys/types.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ void MD5Init(MD5_CTX *);
+ void MD5Update(MD5_CTX *, const uint8_t *, size_t)
+ __attribute__((__bounded__(__string__,2,3)));
+@@ -49,6 +52,9 @@ char *MD5FileChunk(const char *, char *, off_t, off_t)
+ char *MD5Data(const uint8_t *, size_t, char *)
+ __attribute__((__bounded__(__string__,1,2)))
+ __attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif /* LIBBSD_MD5_H */
+diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
+index cb297e8..e63bbbd 100644
+--- a/include/bsd/nlist.h
++++ b/include/bsd/nlist.h
+@@ -88,8 +88,14 @@ struct nlist {
+
+ #define N_FORMAT "%08x" /* namelist value format; XXX */
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int nlist(const char *filename, struct nlist *list);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
+index 14744b8..fa73361 100644
+--- a/include/bsd/readpassphrase.h
++++ b/include/bsd/readpassphrase.h
+@@ -34,8 +34,14 @@
+ #include <sys/cdefs.h>
+ #include <sys/types.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ char * readpassphrase(const char *, char *, size_t, int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif /* !LIBBSD_READPASSPHRASE_H */
+diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
+index 4b69983..18645b7 100644
+--- a/include/bsd/stdio.h
++++ b/include/bsd/stdio.h
+@@ -45,7 +45,10 @@
+ #endif
+ #include <sys/types.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ const char *fmtcheck(const char *, const char *);
+
+ /* XXX: The function requires cooperation from the system libc to store the
+@@ -73,7 +76,10 @@ FILE *funopen(const void *cookie,
+ #define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
+
+ int fpurge(FILE *fp);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+ #endif
+diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
+index ebc9638..c4b54b6 100644
+--- a/include/bsd/stdlib.h
++++ b/include/bsd/stdlib.h
+@@ -46,7 +46,10 @@
+ #include <sys/stat.h>
+ #include <stdint.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ uint32_t arc4random(void);
+ void arc4random_stir(void);
+ void arc4random_addrandom(unsigned char *dat, int datlen);
+@@ -67,7 +70,7 @@ int sradixsort(const unsigned char **base, int nmemb,
+ const unsigned char *table, unsigned endbyte);
+
+ void *reallocf(void *ptr, size_t size);
+-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
++#if defined(_GNU_SOURCE) && defined(__GLIBC__)
+ void *reallocarray(void *ptr, size_t nmemb, size_t size);
+ #endif
+
+@@ -75,6 +78,9 @@ long long strtonum(const char *nptr, long long minval, long long maxval,
+ const char **errstr);
+
+ char *getbsize(int *headerlenp, long *blocksizep);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+diff --git a/include/bsd/string.h b/include/bsd/string.h
+index 6798bf6..fa1193f 100644
+--- a/include/bsd/string.h
++++ b/include/bsd/string.h
+@@ -36,15 +36,21 @@
+ #include <sys/cdefs.h>
+ #include <sys/types.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ size_t strlcpy(char *dst, const char *src, size_t siz);
+ size_t strlcat(char *dst, const char *src, size_t siz);
+ char *strnstr(const char *str, const char *find, size_t str_len);
+ void strmode(mode_t mode, char *str);
+
+-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
++#if defined(_GNU_SOURCE) && defined(__GLIBC__)
+ void explicit_bzero(void *buf, size_t len);
+ #endif
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
+index ff30cac..4600f6b 100644
+--- a/include/bsd/stringlist.h
++++ b/include/bsd/stringlist.h
+@@ -43,12 +43,18 @@ typedef struct _stringlist {
+ size_t sl_cur;
+ } StringList;
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ StringList *sl_init(void);
+ int sl_add(StringList *, char *);
+ void sl_free(StringList *, int);
+ char *sl_find(StringList *, const char *);
+ int sl_delete(StringList *, const char *, int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif /* LIBBSD_STRINGLIST_H */
+diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
+index 1f9c5f8..5b2f4c7 100644
+--- a/include/bsd/unistd.h
++++ b/include/bsd/unistd.h
+@@ -45,7 +45,10 @@
+ #define S_ISTXT S_ISVTX
+ #endif
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ extern int optreset;
+
+ #ifdef LIBBSD_OVERLAY
+@@ -68,6 +71,9 @@ void setproctitle(const char *fmt, ...)
+ __printflike(1, 2);
+
+ int getpeereid(int s, uid_t *euid, gid_t *egid);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+diff --git a/include/bsd/vis.h b/include/bsd/vis.h
+index 970dfdd..621d3c6 100644
+--- a/include/bsd/vis.h
++++ b/include/bsd/vis.h
+@@ -74,7 +74,10 @@
+
+ #include <sys/cdefs.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ char *vis(char *, int, int, int);
+ int strvis(char *, const char *, int);
+ int strvisx(char *, const char *, size_t, int);
+@@ -83,6 +86,9 @@ int strunvis(char *, const char *);
+ int strunvisx(char *, const char *, int);
+ ssize_t strnunvis(char *, const char *, size_t);
+ int unvis(char *, int, int *, int);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif /* !LIBBSD_VIS_H */
+diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
+index 33a500e..aa70742 100644
+--- a/include/bsd/wchar.h
++++ b/include/bsd/wchar.h
+@@ -43,12 +43,18 @@
+ #include <sys/cdefs.h>
+ #include <sys/types.h>
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+ wchar_t *fgetwln(FILE *stream, size_t *len);
+
+ size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
+ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif
+ #endif
+diff --git a/src/hash/sha512.h b/src/hash/sha512.h
+index 4f368a1..27ddc24 100644
+--- a/src/hash/sha512.h
++++ b/src/hash/sha512.h
+@@ -39,7 +39,10 @@ typedef struct SHA512Context {
+ unsigned char buf[128];
+ } SHA512_CTX;
+
+-__BEGIN_DECLS
++/* __BEGIN_DECLS */
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ void SHA512_Init(SHA512_CTX *);
+ void SHA512_Update(SHA512_CTX *, const void *, size_t);
+@@ -48,6 +51,9 @@ char *SHA512_End(SHA512_CTX *, char *);
+ char *SHA512_File(const char *, char *);
+ char *SHA512_FileChunk(const char *, char *, off_t, off_t);
+ char *SHA512_Data(const void *, unsigned int, char *);
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
++/* __END_DECLS */
+
+ #endif /* !_SHA512_H_ */
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch b/poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch
new file mode 100644
index 000000000..7e3a5b3be
--- /dev/null
+++ b/poky/meta/recipes-support/libbsd/libbsd/0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch
@@ -0,0 +1,33 @@
+From b6972f1c29ebf073cbe19a4a669ee093259792a0 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Mon, 30 Jan 2017 12:00:33 -0200
+Subject: [PATCH] src/libbsd-overlay.pc.in: Set Cflags to use -I instead of
+ -isystem
+Organization: O.S. Systems Software LTDA.
+
+pkg-config currently only handles -I and -L correctly, but misses
+-isystem, so we need to do this workaround to fix this issue.
+
+There's a open bug in:
+https://bugzilla.freedesktop.org/show_bug.cgi?id=99516
+
+Upstream-Status: Pending
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/libbsd-overlay.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libbsd-overlay.pc.in b/src/libbsd-overlay.pc.in
+index ac8bf89..65dc3ae 100644
+--- a/src/libbsd-overlay.pc.in
++++ b/src/libbsd-overlay.pc.in
+@@ -8,4 +8,4 @@ Description: Utility functions from BSD systems (overlay)
+ Version: @VERSION@
+ URL: https://libbsd.freedesktop.org/
+ Libs: -L${libdir} -lbsd
+-Cflags: -isystem ${includedir}/bsd -DLIBBSD_OVERLAY
++Cflags: -I${includedir}/bsd -DLIBBSD_OVERLAY
+--
+2.11.0
+
diff --git a/poky/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch b/poky/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
new file mode 100644
index 000000000..60da15eb8
--- /dev/null
+++ b/poky/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
@@ -0,0 +1,52 @@
+From 28fc66e8b848709a2e69dba7f07694248e0154e8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 09:40:43 -0800
+Subject: [PATCH 2/3] Remove funopen()
+
+Musl doesnt have prerequisites for it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [musl specific]
+
+ man/Makefile.am | 1 -
+ src/Makefile.am | 1 -
+ test/Makefile.am | 1 -
+ 3 files changed, 3 deletions(-)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 28192c0..a22787d 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -168,7 +168,6 @@ dist_man_MANS = \
+ fmtcheck.3bsd \
+ fparseln.3bsd \
+ fpurge.3bsd \
+- funopen.3bsd \
+ getbsize.3bsd \
+ getmode.3bsd \
+ getpeereid.3bsd \
+diff --git a/src/Makefile.am b/src/Makefile.am
+index ad83dbf..13225a3 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -76,7 +76,6 @@ libbsd_la_SOURCES = \
+ fmtcheck.c \
+ fparseln.c \
+ fpurge.c \
+- funopen.c \
+ getbsize.c \
+ getpeereid.c \
+ hash/md5.c \
+diff --git a/test/Makefile.am b/test/Makefile.am
+index d86539a..b32ed2e 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -36,7 +36,6 @@ check_PROGRAMS = \
+ endian \
+ humanize \
+ fgetln \
+- funopen \
+ fparseln \
+ fpurge \
+ md5 \
diff --git a/poky/meta/recipes-support/libbsd/libbsd_0.8.7.bb b/poky/meta/recipes-support/libbsd/libbsd_0.8.7.bb
new file mode 100644
index 000000000..552a85c4d
--- /dev/null
+++ b/poky/meta/recipes-support/libbsd/libbsd_0.8.7.bb
@@ -0,0 +1,50 @@
+# Copyright (C) 2013 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Library of utility functions from BSD systems"
+DESCRIPTION = "This library provides useful functions commonly found on BSD systems, \
+ and lacking on others like GNU systems, thus making it easier to port \
+ projects with strong BSD origins, without needing to embed the same \
+ code over and over again on each project."
+
+HOMEPAGE = "http://libbsd.freedesktop.org/wiki/"
+# There seems to be more licenses used in the code, I don't think we want to list them all here, complete list:
+# OE @ ~/projects/libbsd $ grep ^License: COPYING | sort
+# License: BSD-2-clause
+# License: BSD-2-clause
+# License: BSD-2-clause-NetBSD
+# License: BSD-2-clause-author
+# License: BSD-2-clause-verbatim
+# License: BSD-3-clause
+# License: BSD-3-clause
+# License: BSD-3-clause
+# License: BSD-3-clause-Peter-Wemm
+# License: BSD-3-clause-Regents
+# License: BSD-4-clause-Christopher-G-Demetriou
+# License: BSD-4-clause-Niels-Provos
+# License: BSD-5-clause-Peter-Wemm
+# License: Beerware
+# License: Expat
+# License: ISC
+# License: ISC-Original
+# License: public-domain
+# License: public-domain-Colin-Plumb
+LICENSE = "BSD-4-Clause & ISC & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=08fc4e66be4526715dab09c5fba5e9e8"
+SECTION = "libs"
+
+SRC_URI = " \
+ http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+ file://0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch \
+"
+SRC_URI_append_libc-musl = " \
+ file://0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch \
+ file://0002-Remove-funopen.patch \
+"
+
+SRC_URI[md5sum] = "d9e6980fbfe44f94fd92b89a33cce67d"
+SRC_URI[sha256sum] = "f548f10e5af5a08b1e22889ce84315b1ebe41505b015c9596bad03fd13a12b31"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch b/poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch
new file mode 100644
index 000000000..59591eb46
--- /dev/null
+++ b/poky/meta/recipes-support/libcap-ng/libcap-ng/python.patch
@@ -0,0 +1,58 @@
+From b01bb2694f66cd981e6d61523433dc3eb5ed32f2 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Sat, 18 Jul 2015 23:03:30 +0900
+Subject: [PATCH] configure.ac - Avoid an incorrect check for python.
+ Makefile.am - avoid hard coded host include paths.
+
+Upstream-Status: pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ bindings/python/Makefile.am | 3 ++-
+ configure.ac | 15 ++-------------
+ 2 files changed, 4 insertions(+), 14 deletions(-)
+
+diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
+index 82b9bb8..f9fe7a8 100644
+--- a/bindings/python/Makefile.am
++++ b/bindings/python/Makefile.am
+@@ -23,7 +23,8 @@ SUBDIRS = test
+ CONFIG_CLEAN_FILES = *.loT *.rej *.orig
+ AM_CFLAGS = -fPIC -DPIC
+ PYLIBVER ?= python$(PYTHON_VERSION)
+-AM_CPPFLAGS = -I. -I$(top_builddir) -I@PYINCLUDEDIR@
++PYINC ?= /usr/include/$(PYLIBVER)
++AM_CPPFLAGS = -I. -I$(top_builddir) -I$(PYINC)
+ LIBS = $(top_builddir)/src/libcap-ng.la
+ SWIG_FLAGS = -python
+ SWIG_INCLUDES = ${AM_CPPFLAGS}
+diff --git a/configure.ac b/configure.ac
+index 1d777d5..9d90f64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -123,19 +123,8 @@ if test x$use_python = xno ; then
+ else
+ AC_MSG_RESULT(testing)
+ AM_PATH_PYTHON
+-PYINCLUDEDIR=`python${am_cv_python_version} -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"`
+-if test -f ${PYINCLUDEDIR}/Python.h ; then
+- python_found="yes"
+- AC_SUBST(PYINCLUDEDIR)
+- AC_MSG_NOTICE(Python bindings will be built)
+-else
+- python_found="no"
+- if test x$use_python = xyes ; then
+- AC_MSG_ERROR([Python explicitly required and python headers found])
+- else
+- AC_MSG_WARN("Python headers not found - python bindings will not be made")
+- fi
+-fi
++python_found="yes"
++AC_MSG_NOTICE(Python bindings will be built)
+ fi
+ AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
+
+--
+1.8.4.2
+
diff --git a/poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.8.bb b/poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.8.bb
new file mode 100644
index 000000000..358319419
--- /dev/null
+++ b/poky/meta/recipes-support/libcap-ng/libcap-ng_0.7.8.bb
@@ -0,0 +1,37 @@
+SUMMARY = "An alternate posix capabilities library"
+DESCRIPTION = "The libcap-ng library is intended to make programming \
+with POSIX capabilities much easier than the traditional libcap library."
+HOMEPAGE = "http://freecode.com/projects/libcap-ng"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
+ file://python.patch"
+
+inherit lib_package autotools python3native
+
+SRC_URI[md5sum] = "0dece96644bd798020e170fbf7663802"
+SRC_URI[sha256sum] = "c21af997445cd4107a55d386f955c5ea6f6e96ead693e9151277c0ab5f97d05f"
+
+DEPENDS += "swig-native python3"
+
+EXTRA_OECONF += "--with-python --with-python3"
+EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'"
+
+PACKAGES += "${PN}-python"
+
+FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"
+
+BBCLASSEXTEND = "native"
+
+do_install_append() {
+ # Moving libcap-ng to base_libdir
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mkdir -p ${D}/${base_libdir}/
+ mv -f ${D}${libdir}/libcap-ng.so.* ${D}${base_libdir}/
+ relpath=${@os.path.relpath("${base_libdir}", "${libdir}")}
+ ln -sf ${relpath}/libcap-ng.so.0.0.0 ${D}${libdir}/libcap-ng.so
+ fi
+}
diff --git a/poky/meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch b/poky/meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch
new file mode 100644
index 000000000..110ef902d
--- /dev/null
+++ b/poky/meta/recipes-support/libcap/files/0001-Fix-build-with-gperf-3.1.patch
@@ -0,0 +1,41 @@
+From a05eba68c42222f02465d7ba376015926433c531 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Jul 2017 13:37:49 +0300
+Subject: [PATCH] Fix build with gperf 3.1
+
+The generated gperf file refers to size_t which needs to be
+provided by stddef.h include. Also, adjust the makefile
+to match the declaration in the gperf file.
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ libcap/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index d189777..1a57206 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -22,7 +22,7 @@ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
+
+ ifeq ($(BUILD_GPERF),yes)
+ USE_GPERF_OUTPUT = $(GPERF_OUTPUT)
+-INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
++INCLUDE_GPERF_OUTPUT = -include stddef.h -include $(GPERF_OUTPUT)
+ endif
+
+ libcap.pc: libcap.pc.in
+@@ -41,7 +41,7 @@ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, register size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+
+ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+ @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
+--
+2.13.2
+
diff --git a/poky/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch b/poky/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch
new file mode 100644
index 000000000..05c771ac1
--- /dev/null
+++ b/poky/meta/recipes-support/libcap/files/0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch
@@ -0,0 +1,32 @@
+Ensure the XATTR_NAME_CAPS is defined when it is used
+
+Upstream-Status: Pending
+
+VFS_CAP_U32 can not ensure that XATTR_NAME_CAPS is defined, and failed to build
+libcap-native in old release, like CentOS release 6.7 (Final), with the blow
+error:
+ cap_file.c: In function ‘cap_get_fd’:
+ cap_file.c:199: error: ‘XATTR_NAME_CAPS’ undeclared (first use in this function)
+ cap_file.c:199: error: (Each undeclared identifier is reported only once
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ libcap/cap_file.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/cap_file.c b/libcap/cap_file.c
+index 40756ea..e27ca80 100644
+--- a/libcap/cap_file.c
++++ b/libcap/cap_file.c
+@@ -25,7 +25,7 @@ extern int fremovexattr(int, const char *);
+
+ #include "libcap.h"
+
+-#ifdef VFS_CAP_U32
++#if defined (VFS_CAP_U32) && defined (XATTR_NAME_CAPS)
+
+ #if VFS_CAP_U32 != __CAP_BLKS
+ # error VFS representation of capabilities is not the same size as kernel
+--
+2.8.1
+
diff --git a/poky/meta/recipes-support/libcap/libcap_2.25.bb b/poky/meta/recipes-support/libcap/libcap_2.25.bb
new file mode 100644
index 000000000..d619a2eb4
--- /dev/null
+++ b/poky/meta/recipes-support/libcap/libcap_2.25.bb
@@ -0,0 +1,74 @@
+SUMMARY = "Library for getting/setting POSIX.1e capabilities"
+HOMEPAGE = "http://sites.google.com/site/fullycapable/"
+
+# no specific GPL version required
+LICENSE = "BSD | GPLv2"
+LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1"
+
+DEPENDS = "hostperl-runtime-native gperf-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
+ file://0001-ensure-the-XATTR_NAME_CAPS-is-defined-when-it-is-use.patch \
+ file://0001-Fix-build-with-gperf-3.1.patch \
+ "
+SRC_URI[md5sum] = "6666b839e5d46c2ad33fc8aa2ceb5f77"
+SRC_URI[sha256sum] = "693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162"
+
+inherit lib_package
+
+# do NOT pass target cflags to host compilations
+#
+do_configure() {
+ # libcap uses := for compilers, fortunately, it gives us a hint
+ # on what should be replaced with ?=
+ sed -e 's,:=,?=,g' -i Make.Rules
+ sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules
+}
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG_class-native ??= ""
+
+PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
+
+EXTRA_OEMAKE = " \
+ INDENT= \
+ lib=${@os.path.basename('${libdir}')} \
+ RAISE_SETFCAP=no \
+ DYNAMIC=yes \
+ BUILD_GPERF=yes \
+"
+
+EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
+
+# these are present in the libcap defaults, so include in our CFLAGS too
+CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+
+do_compile() {
+ oe_runmake ${PACKAGECONFIG_CONFARGS}
+}
+
+do_install() {
+ oe_runmake install \
+ ${PACKAGECONFIG_CONFARGS} \
+ DESTDIR="${D}" \
+ prefix="${prefix}" \
+ SBINDIR="${sbindir}"
+}
+
+do_install_append() {
+ # Move the library to base_libdir
+ install -d ${D}${base_libdir}
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mv ${D}${libdir}/libcap* ${D}${base_libdir}
+ if [ -d ${D}${libdir}/security ]; then
+ mv ${D}${libdir}/security ${D}${base_libdir}
+ fi
+ fi
+}
+
+FILES_${PN}-dev += "${base_libdir}/*.so"
+
+# pam files
+FILES_${PN} += "${base_libdir}/security/*.so"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libcheck/libcheck_0.12.0.bb b/poky/meta/recipes-support/libcheck/libcheck_0.12.0.bb
new file mode 100644
index 000000000..e646d4396
--- /dev/null
+++ b/poky/meta/recipes-support/libcheck/libcheck_0.12.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Check - unit testing framework for C code"
+HOMEPAGE = "http://check.sourceforge.net/"
+SECTION = "devel"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SRC_URI = "https://github.com/${BPN}/check/releases/download/${PV}/check-${PV}.tar.gz"
+SRC_URI[md5sum] = "31b17c6075820a434119592941186f70"
+SRC_URI[sha256sum] = "464201098bee00e90f5c4bdfa94a5d3ead8d641f9025b560a27755a83b824234"
+UPSTREAM_CHECK_URI = "https://github.com/libcheck/check/releases/"
+
+S = "${WORKDIR}/check-${PV}"
+
+inherit autotools pkgconfig texinfo
+
+CACHED_CONFIGUREVARS += "ac_cv_path_AWK_PATH=${bindir}/gawk"
+
+RREPLACES_${PN} = "check (<= 0.9.5)"
+RDEPENDS_${PN} += "gawk"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libcroco/libcroco_0.6.12.bb b/poky/meta/recipes-support/libcroco/libcroco_0.6.12.bb
new file mode 100644
index 000000000..d86ddd646
--- /dev/null
+++ b/poky/meta/recipes-support/libcroco/libcroco_0.6.12.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Cascading Style Sheet (CSS) parsing and manipulation toolkit"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
+ file://src/cr-rgb.c;endline=22;md5=31d5f0944d556c8589d04ea6055fcc66 \
+ file://tests/cr-test-utils.c;endline=21;md5=2382c27934cae1d3792fcb17a6142c4e"
+
+SECTION = "x11/utils"
+DEPENDS = "glib-2.0 libxml2 zlib"
+BBCLASSEXTEND = "native nativesdk"
+EXTRA_OECONF += "--enable-Bsymbolic=auto"
+
+BINCONFIG = "${bindir}/croco-0.6-config"
+
+inherit gnomebase gtk-doc binconfig-disabled
+
+SRC_URI[archive.md5sum] = "bc0984fce078ba2ce29f9500c6b9ddce"
+SRC_URI[archive.sha256sum] = "ddc4b5546c9fb4280a5017e2707fbd4839034ed1aba5b7d4372212f34f84f860"
diff --git a/poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch b/poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch
new file mode 100644
index 000000000..1027ae8e6
--- /dev/null
+++ b/poky/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch
@@ -0,0 +1,20 @@
+musl complains
+fatal error: sys/unistd.h: No such file or directory
+and rightly so
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+--- libdaemon-0.14.orig/examples/testd.c
++++ libdaemon-0.14/examples/testd.c
+@@ -21,9 +21,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <sys/select.h>
+
+ #include <libdaemon/dfork.h>
diff --git a/poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb b/poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb
new file mode 100644
index 000000000..070ee1890
--- /dev/null
+++ b/poky/meta/recipes-support/libdaemon/libdaemon_0.14.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Lightweight C library which eases the writing of UNIX daemons"
+SECTION = "libs"
+AUTHOR = "Lennart Poettering <lennart@poettering.net>"
+HOMEPAGE = "http://0pointer.de/lennart/projects/libdaemon/"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://libdaemon/daemon.h;beginline=9;endline=21;md5=bd9fbe57cd96d1a5848a8ba12d9a6bf4"
+
+SRC_URI = "http://0pointer.de/lennart/projects/libdaemon/libdaemon-${PV}.tar.gz \
+ file://fix-includes.patch \
+ "
+
+SRC_URI[md5sum] = "509dc27107c21bcd9fbf2f95f5669563"
+SRC_URI[sha256sum] = "fd23eb5f6f986dcc7e708307355ba3289abe03cc381fc47a80bca4a50aa6b834"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-lynx"
diff --git a/poky/meta/recipes-support/libevdev/libevdev_1.5.8.bb b/poky/meta/recipes-support/libevdev/libevdev_1.5.8.bb
new file mode 100644
index 000000000..c1380144b
--- /dev/null
+++ b/poky/meta/recipes-support/libevdev/libevdev_1.5.8.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Wrapper library for evdev devices"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libevdev/"
+SECTION = "libs"
+
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=75aae0d38feea6fda97ca381cb9132eb \
+ file://libevdev/libevdev.h;endline=21;md5=7ff4f0b5113252c2f1a828e0bbad98d1"
+
+SRC_URI = "http://www.freedesktop.org/software/libevdev/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "c25a8c3939e4ad59a5e9e5e1e354832d"
+SRC_URI[sha256sum] = "6083d81e46609da8ba80cb826c02d9080764a6dec33c8267ccb7e158833d4c6d"
+
+inherit autotools pkgconfig
diff --git a/poky/meta/recipes-support/libevent/libevent/0001-test-fix-32bit-linux-regress.patch b/poky/meta/recipes-support/libevent/libevent/0001-test-fix-32bit-linux-regress.patch
new file mode 100644
index 000000000..36d08204f
--- /dev/null
+++ b/poky/meta/recipes-support/libevent/libevent/0001-test-fix-32bit-linux-regress.patch
@@ -0,0 +1,48 @@
+From 69a3813c513c84e02212250c3d5b8a02ecefa698 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Mon, 15 Jan 2018 08:00:33 +0000
+Subject: [PATCH] test: fix 32bit linux regress
+
+This patch comes from https://github.com/libevent/libevent.git,
+the commit is 63c4bf78d6af3c6ff46d2e8e4b53dd9f577a9ca9
+
+Upstream-Status: Backport
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ configure.ac | 1 +
+ test/regress_util.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 7528d37..e64cb1f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -663,6 +663,7 @@ AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(size_t)
+ AC_CHECK_SIZEOF(void *)
+ AC_CHECK_SIZEOF(off_t)
++AC_CHECK_SIZEOF(time_t)
+
+ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , ,
+ [#define _GNU_SOURCE
+diff --git a/test/regress_util.c b/test/regress_util.c
+index ef6a148..0c7eafb 100644
+--- a/test/regress_util.c
++++ b/test/regress_util.c
+@@ -1412,10 +1412,12 @@ static struct date_rfc1123_case {
+ { 1289433600, "Thu, 11 Nov 2010 00:00:00 GMT"},
+ { 1323648000, "Mon, 12 Dec 2011 00:00:00 GMT"},
+ #ifndef _WIN32
++#if EVENT__SIZEOF_TIME_T > 4
+ /** In win32 case we have max "23:59:59 January 18, 2038, UTC" for time32 */
+ { 4294967296, "Sun, 07 Feb 2106 06:28:16 GMT"} /* 2^32 */,
+ /** In win32 case we have max "23:59:59, December 31, 3000, UTC" for time64 */
+ {253402300799, "Fri, 31 Dec 9999 23:59:59 GMT"} /* long long future no one can imagine */,
++#endif /* time_t != 32bit */
+ { 1456704000, "Mon, 29 Feb 2016 00:00:00 GMT"} /* leap year */,
+ #endif
+ { 1435708800, "Wed, 01 Jul 2015 00:00:00 GMT"} /* leap second */,
+--
+2.13.3
+
diff --git a/poky/meta/recipes-support/libevent/libevent/Makefile-missing-test-dir.patch b/poky/meta/recipes-support/libevent/libevent/Makefile-missing-test-dir.patch
new file mode 100644
index 000000000..8880bd040
--- /dev/null
+++ b/poky/meta/recipes-support/libevent/libevent/Makefile-missing-test-dir.patch
@@ -0,0 +1,27 @@
+Fix missing test directory creation.
+
+GCC used in OE-core has "dependency tracking" disabled and
+libevent has problem with this.
+Due to removed makefile.am/in files in test/sample/include
+directories, output directories are not created in
+configuration step. Compilation step will fails, when
+trying to write to non-existing directory.
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
+
+diff --git a/libevent-2.1.8-stable/test/include.am b/libevent-2.1.8-stable/test/include.am
+index eea249f..d323dff 100644
+--- a/test/include.am
++++ b/test/include.am
+@@ -161,6 +161,7 @@ test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
+ test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
+
+ test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
++ @$(MKDIR_P) test
+ $(AM_V_GEN)date -u > $@
+ $(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
+ true; \
diff --git a/poky/meta/recipes-support/libevent/libevent/run-ptest b/poky/meta/recipes-support/libevent/libevent/run-ptest
new file mode 100644
index 000000000..0241851c7
--- /dev/null
+++ b/poky/meta/recipes-support/libevent/libevent/run-ptest
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+fail=0
+for test in ./test/*
+do
+ $test
+ if [ $? -ne 0 ]
+ then
+ fail=1
+ fi
+done
+
+if [ $fail -eq 0 ]
+then
+ echo "PASS: libevent"
+else
+ echo "FAIL: libevent"
+fi
diff --git a/poky/meta/recipes-support/libevent/libevent_2.1.8.bb b/poky/meta/recipes-support/libevent/libevent_2.1.8.bb
new file mode 100644
index 000000000..83ce4644c
--- /dev/null
+++ b/poky/meta/recipes-support/libevent/libevent_2.1.8.bb
@@ -0,0 +1,43 @@
+SUMMARY = "An asynchronous event notification library"
+HOMEPAGE = "http://libevent.org/"
+BUGTRACKER = "https://github.com/libevent/libevent/issues"
+SECTION = "libs"
+
+LICENSE = "BSD & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=17f20574c0b154d12236d5fbe964f549"
+
+SRC_URI = " \
+ https://github.com/libevent/libevent/releases/download/release-${PV}-stable/${BP}-stable.tar.gz \
+ file://Makefile-missing-test-dir.patch \
+ file://0001-test-fix-32bit-linux-regress.patch \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "f3eeaed018542963b7d2416ef1135ecc"
+SRC_URI[sha256sum] = "965cc5a8bb46ce4199a47e9b2c9e1cae3b137e8356ffdad6d94d3b9069b71dc2"
+
+UPSTREAM_CHECK_URI = "http://libevent.org/"
+
+S = "${WORKDIR}/${BPN}-${PV}-stable"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+
+inherit autotools
+
+# Needed for Debian packaging
+LEAD_SONAME = "libevent-2.1.so"
+
+inherit ptest
+
+DEPENDS = "zlib"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/test
+ for file in ${B}/test/.libs/regress ${B}/test/.libs/test*
+ do
+ install -m 0755 $file ${D}${PTEST_PATH}/test
+ done
+}
diff --git a/poky/meta/recipes-support/libexif/libexif_0.6.21.bb b/poky/meta/recipes-support/libexif/libexif_0.6.21.bb
new file mode 100644
index 000000000..cff4caede
--- /dev/null
+++ b/poky/meta/recipes-support/libexif/libexif_0.6.21.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Library for reading extended image information (EXIF) from JPEG files"
+HOMEPAGE = "http://sourceforge.net/projects/libexif"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libexif/libexif-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "27339b89850f28c8f1c237f233e05b27"
+SRC_URI[sha256sum] = "16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a"
+
+inherit autotools gettext
+
+do_configure_append() {
+ sed -i s:doc\ binary:binary:g Makefile
+}
+
diff --git a/poky/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch b/poky/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch
new file mode 100644
index 000000000..6b167c842
--- /dev/null
+++ b/poky/meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch
@@ -0,0 +1,30 @@
+From 69c3906c85c791716bf650aa36d9361d22acf3fb Mon Sep 17 00:00:00 2001
+From: sweeaun <swee.aun.khor@intel.com>
+Date: Thu, 6 Jul 2017 16:32:46 -0700
+Subject: [PATCH] libffi: Support musl x32 build
+
+Support libffi build with target musl-x32.
+
+Upstream-Status: Pending
+
+Signed-off-by: sweeaun <swee.aun.khor@intel.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a7bf5ee..8ebe99c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -177,7 +177,7 @@ case "$host" in
+ TARGETDIR=x86
+ if test $ac_cv_sizeof_size_t = 4; then
+ case "$host" in
+- *-gnux32)
++ *-gnux32 | *-muslx32)
+ TARGET=X86_64
+ ;;
+ *)
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch b/poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch
new file mode 100644
index 000000000..db96e6354
--- /dev/null
+++ b/poky/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch
@@ -0,0 +1,32 @@
+From a5efaa96fd934eb245c234a5275fcf62698ef986 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Apr 2015 21:38:03 -0700
+Subject: [PATCH] mips: Use compiler internal define for linux
+
+__linux__ is defined by compiler when building for
+linux platforms, lets use it
+
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mips/ffitarget.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
+index 717d659..6faa358 100644
+--- a/src/mips/ffitarget.h
++++ b/src/mips/ffitarget.h
+@@ -32,7 +32,7 @@
+ #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
+ #endif
+
+-#ifdef linux
++#ifdef __linux__
+ # include <asm/sgidefs.h>
+ #elif defined(__rtems__)
+ /*
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch b/poky/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch
new file mode 100644
index 000000000..61c9eb31d
--- /dev/null
+++ b/poky/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch
@@ -0,0 +1,177 @@
+From 655e82c92d5c3875aee04322f1993d6b0774a7bf Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Mon, 15 Aug 2016 15:00:13 +0800
+Subject: [PATCH] mips: fix MIPS softfloat build issue
+
+The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi:
+fix MIPS softfloat build issue with current binutils"
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+Upstream-Status: Backport [https://github.com/libffi/libffi/commit/2ded2a4f494165c93293afc14ab0be1243cf8c49]
+ src/mips/n32.S | 17 +++++++++++++++++
+ src/mips/o32.S | 17 +++++++++++++++++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/src/mips/n32.S b/src/mips/n32.S
+index c6985d3..8f25994 100644
+--- a/src/mips/n32.S
++++ b/src/mips/n32.S
+@@ -107,6 +107,16 @@ loadregs:
+
+ REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
+
++#ifdef __mips_soft_float
++ REG_L a0, 0*FFI_SIZEOF_ARG(t9)
++ REG_L a1, 1*FFI_SIZEOF_ARG(t9)
++ REG_L a2, 2*FFI_SIZEOF_ARG(t9)
++ REG_L a3, 3*FFI_SIZEOF_ARG(t9)
++ REG_L a4, 4*FFI_SIZEOF_ARG(t9)
++ REG_L a5, 5*FFI_SIZEOF_ARG(t9)
++ REG_L a6, 6*FFI_SIZEOF_ARG(t9)
++ REG_L a7, 7*FFI_SIZEOF_ARG(t9)
++#else
+ and t4, t6, ((1<<FFI_FLAG_BITS)-1)
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9)
+ beqz t4, arg1_next
+@@ -193,6 +203,7 @@ arg7_next:
+ arg8_doublep:
+ l.d $f19, 7*FFI_SIZEOF_ARG(t9)
+ arg8_next:
++#endif
+
+ callit:
+ # Load the function pointer
+@@ -214,6 +225,7 @@ retint:
+ b epilogue
+
+ retfloat:
++#ifndef __mips_soft_float
+ bne t6, FFI_TYPE_FLOAT, retdouble
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+@@ -272,6 +284,7 @@ retstruct_f_d:
+ s.s $f0, 0(t4)
+ s.d $f2, 8(t4)
+ b epilogue
++#endif
+
+ retstruct_d_soft:
+ bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
+@@ -429,6 +442,7 @@ ffi_closure_N32:
+ REG_S a6, A6_OFF2($sp)
+ REG_S a7, A7_OFF2($sp)
+
++#ifndef __mips_soft_float
+ # Store all possible float/double registers.
+ s.d $f12, F12_OFF2($sp)
+ s.d $f13, F13_OFF2($sp)
+@@ -438,6 +452,7 @@ ffi_closure_N32:
+ s.d $f17, F17_OFF2($sp)
+ s.d $f18, F18_OFF2($sp)
+ s.d $f19, F19_OFF2($sp)
++#endif
+
+ # Call ffi_closure_mips_inner_N32 to do the real work.
+ LA t9, ffi_closure_mips_inner_N32
+@@ -458,6 +473,7 @@ cls_retint:
+ b cls_epilogue
+
+ cls_retfloat:
++#ifndef __mips_soft_float
+ bne v0, FFI_TYPE_FLOAT, cls_retdouble
+ l.s $f0, V0_OFF2($sp)
+ b cls_epilogue
+@@ -500,6 +516,7 @@ cls_retstruct_f_d:
+ l.s $f0, V0_OFF2($sp)
+ l.d $f2, V1_OFF2($sp)
+ b cls_epilogue
++#endif
+
+ cls_retstruct_small2:
+ REG_L v0, V0_OFF2($sp)
+diff --git a/src/mips/o32.S b/src/mips/o32.S
+index eb27981..429dd0a 100644
+--- a/src/mips/o32.S
++++ b/src/mips/o32.S
+@@ -82,13 +82,16 @@ sixteen:
+
+ ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
+
++#ifndef __mips_soft_float
+ bnez t0, pass_d # make it quick for int
++#endif
+ REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
+ REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
+ REG_L a2, 2*FFI_SIZEOF_ARG($sp)
+ REG_L a3, 3*FFI_SIZEOF_ARG($sp)
+ b call_it
+
++#ifndef __mips_soft_float
+ pass_d:
+ bne t0, FFI_ARGS_D, pass_f
+ l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
+@@ -130,6 +133,7 @@ pass_f_d:
+ # bne t0, FFI_ARGS_F_D, call_it
+ l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
+ l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
++#endif
+
+ call_it:
+ # Load the function pointer
+@@ -158,14 +162,23 @@ retfloat:
+ bne t2, FFI_TYPE_FLOAT, retdouble
+ jalr t9
+ REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
++#ifndef __mips_soft_float
+ s.s $f0, 0(t0)
++#else
++ REG_S v0, 0(t0)
++#endif
+ b epilogue
+
+ retdouble:
+ bne t2, FFI_TYPE_DOUBLE, noretval
+ jalr t9
+ REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
++#ifndef __mips_soft_float
+ s.d $f0, 0(t0)
++#else
++ REG_S v1, 4(t0)
++ REG_S v0, 0(t0)
++#endif
+ b epilogue
+
+ noretval:
+@@ -261,9 +274,11 @@ $LCFI7:
+ li $13, 1 # FFI_O32
+ bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
+
++#ifndef __mips_soft_float
+ # Store all possible float/double registers.
+ s.d $f12, FA_0_0_OFF2($fp)
+ s.d $f14, FA_1_0_OFF2($fp)
++#endif
+ 1:
+ # Call ffi_closure_mips_inner_O32 to do the work.
+ la t9, ffi_closure_mips_inner_O32
+@@ -281,6 +296,7 @@ $LCFI7:
+ li $13, 1 # FFI_O32
+ bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT
+
++#ifndef __mips_soft_float
+ li $9, FFI_TYPE_FLOAT
+ l.s $f0, V0_OFF2($fp)
+ beq $8, $9, closure_done
+@@ -288,6 +304,7 @@ $LCFI7:
+ li $9, FFI_TYPE_DOUBLE
+ l.d $f0, V0_OFF2($fp)
+ beq $8, $9, closure_done
++#endif
+ 1:
+ REG_L $3, V1_OFF2($fp)
+ REG_L $2, V0_OFF2($fp)
+--
+2.9.3
+
diff --git a/poky/meta/recipes-support/libffi/libffi/not-win32.patch b/poky/meta/recipes-support/libffi/libffi/not-win32.patch
new file mode 100644
index 000000000..80c40a474
--- /dev/null
+++ b/poky/meta/recipes-support/libffi/libffi/not-win32.patch
@@ -0,0 +1,26 @@
+libffi's configure assumes that cross-compiled builds are complicated and
+introduces convoluted path manipulation involving gcc search paths to the
+install paths, resulting in paths like -L/usr/lib/../lib/ appearing in
+libffi.pc. When pkg-config is then used to obtain the linker flags for libffi
+it can't tell that this path is on the default search path and returns
+$SYSROOT/usr/lib/../lib which then gets written all over the target sysroot.
+This then means the sstate can't be shared and triggers QA errors.
+
+As this block is generally pointless, disable it.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Index: libffi-3.2.1/configure.ac
+===================================================================
+--- libffi-3.2.1.orig/configure.ac
++++ libffi-3.2.1/configure.ac
+@@ -592,7 +592,7 @@ AC_ARG_ENABLE(purify-safety,
+
+ # These variables are only ever used when we cross-build to X86_WIN32.
+ # And we only support this with GCC, so...
+-if test "x$GCC" = "xyes"; then
++if false; then
+ if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ toolexecdir="${exec_prefix}"/'$(target_alias)'
diff --git a/poky/meta/recipes-support/libffi/libffi_3.2.1.bb b/poky/meta/recipes-support/libffi/libffi_3.2.1.bb
new file mode 100644
index 000000000..a0b1fcd16
--- /dev/null
+++ b/poky/meta/recipes-support/libffi/libffi_3.2.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "A portable foreign function interface library"
+HOMEPAGE = "http://sourceware.org/libffi/"
+DESCRIPTION = "The `libffi' library provides a portable, high level programming interface to various calling \
+conventions. This allows a programmer to call any function specified by a call interface description at run \
+time. FFI stands for Foreign Function Interface. A foreign function interface is the popular name for the \
+interface that allows code written in one language to call code written in another language. The `libffi' \
+library really only provides the lowest, machine dependent layer of a fully featured foreign function interface. \
+A layer must exist above `libffi' that handles type conversions for values passed between the two languages."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3610bb17683a0089ed64055416b2ae1b"
+
+SRC_URI = "ftp://sourceware.org/pub/libffi/${BP}.tar.gz \
+ file://not-win32.patch \
+ file://0001-mips-Use-compiler-internal-define-for-linux.patch \
+ file://0001-mips-fix-MIPS-softfloat-build-issue.patch \
+ file://0001-libffi-Support-musl-x32-build.patch \
+ "
+
+SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43"
+SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"
+
+EXTRA_OECONF += "--disable-builddir"
+EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'"
+inherit autotools texinfo
+
+FILES_${PN}-dev += "${libdir}/libffi-${PV}"
+
+# Doesn't compile in MIPS16e mode due to use of hand-written
+# assembly
+MIPS_INSTRUCTION_SET = "mips"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch b/poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch
new file mode 100644
index 000000000..69a51d566
--- /dev/null
+++ b/poky/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch
@@ -0,0 +1,54 @@
+From c320799c941d42a9b7e351805359694ea3b36d2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 5 Apr 2015 09:08:38 -0700
+Subject: [PATCH] nls.m4: Take it from gettext-0.15
+
+It otherwise expects gettext to provide it. Lets go independent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ m4/nls.m4 | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+ create mode 100644 m4/nls.m4
+
+diff --git a/m4/nls.m4 b/m4/nls.m4
+new file mode 100644
+index 0000000..2c8fe69
+--- /dev/null
++++ b/m4/nls.m4
+@@ -0,0 +1,30 @@
++dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are not in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper drepper@cygnus.com, 1995-2000.
++dnl Bruno Haible haible@clisp.cons.org, 2000-2003.
++
++AC_PREREQ(2.50)
++
++AC_DEFUN([AM_NLS],
++[
++AC_MSG_CHECKING([whether NLS is requested])
++dnl Default is enabled NLS
++AC_ARG_ENABLE(nls,
++[ --disable-nls do not use Native Language Support],
++USE_NLS=$enableval, USE_NLS=yes)
++AC_MSG_RESULT($USE_NLS)
++AC_SUBST(USE_NLS)
++])
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb b/poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb
new file mode 100644
index 000000000..c0fd83ef3
--- /dev/null
+++ b/poky/meta/recipes-support/libfm/libfm-extra_1.2.5.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/fm-extra.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0-native glib-2.0 intltool-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+ file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+ "
+
+SRC_URI[md5sum] = "a1ba9ae5e920f38b647dd511edd6c807"
+SRC_URI[sha256sum] = "c706bb1020cf5f2d6f5a9226f692ce1985947134dcf2bde64278bd0420779b5a"
+
+S = "${WORKDIR}/libfm-${PV}"
+
+EXTRA_OECONF = "--with-extra-only --with-gtk=no"
+
+inherit autotools pkgconfig gtk-doc gettext
+
+do_configure[dirs] =+ "${S}/m4"
diff --git a/poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch b/poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch
new file mode 100644
index 000000000..fb91d90cf
--- /dev/null
+++ b/poky/meta/recipes-support/libfm/libfm/0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch
@@ -0,0 +1,28 @@
+From 23c6e9df611c86a5e97079e1b88c7a18474bf0bc Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 16 Dec 2016 16:52:04 +0200
+Subject: [PATCH] Correctly check the stamp file that indicates if we need to
+ re-build vala code
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d043b3d..0e85590 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,7 +42,7 @@ AM_COND_IF(EXTRALIB_ONLY,
+ [enable_actions=no])
+ if test x"$enable_actions" = xyes; then
+ dnl no vala compiler required when sources are from dist tarball
+- if test -f src/actions/libfmactions_la_vala.stamp; then
++ if test -f $srcdir/src/actions/libfmactions_la_vala.stamp; then
+ AM_PROG_VALAC
+ else
+ AM_PROG_VALAC([0.13.0])
+--
+2.10.2
+
diff --git a/poky/meta/recipes-support/libfm/libfm/0001-Enclose-text-in-programlisting-into-CDATA.patch b/poky/meta/recipes-support/libfm/libfm/0001-Enclose-text-in-programlisting-into-CDATA.patch
new file mode 100644
index 000000000..40e53291e
--- /dev/null
+++ b/poky/meta/recipes-support/libfm/libfm/0001-Enclose-text-in-programlisting-into-CDATA.patch
@@ -0,0 +1,76 @@
+From ed4ca8c0b17ff5d3c768b92409c1787e3f3f1841 Mon Sep 17 00:00:00 2001
+From: Andriy Grytsenko <andrej@rep.kiev.ua>
+Date: Sun, 26 Nov 2017 22:30:15 +0200
+Subject: [PATCH 2/2] Enclose text in <programlisting> into <![CDATA[
+
+New gtk-doc fails on tag-like data in it.
+See https://bugs.freedesktop.org/show_bug.cgi?id=101585
+That is definitely bug of gtk-doc but let workaround it.
+
+Upstream-Status: Backport [https://git.lxde.org/gitweb/?p=lxde/libfm.git;a=commit;h=b072ee0400432d72fdf86ba9fed74a7e0ec11ec1]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ src/base/fm-module.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/base/fm-module.c b/src/base/fm-module.c
+index d364b2d..2e8c978 100644
+--- a/src/base/fm-module.c
++++ b/src/base/fm-module.c
+@@ -44,7 +44,7 @@
+ * of that type should include:
+ * <example id="example-fm-dummy-h">
+ * <title>Sample of fm-dummy.h</title>
+- * <programlisting>
++ * <programlisting><![CDATA[
+ * #include <libfm/fm.h>
+ *
+ * #define FM_MODULE_dummy_VERSION 1
+@@ -54,7 +54,7 @@
+ * } FmDummyInit;
+ *
+ * extern FmDummyInit fm_module_init_dummy;
+- * </programlisting>
++ * ]]></programlisting>
+ * </example>
+ * The FM_MODULE_dummy_VERSION is a number which should be increased each
+ * time something in FmDummyInit structure is changed. The FmDummyInit
+@@ -65,7 +65,7 @@
+ * module handling in your code:
+ * <example id="example-fm-dummy-widget-c">
+ * <title>Sample of fm-dummy-widget.c</title>
+- * <programlisting>
++ * <programlisting><![CDATA[
+ * #include "fm-dummy.h"
+ *
+ * FM_MODULE_DEFINE_TYPE(dummy, FmDummyInit, 1)
+@@ -87,7 +87,7 @@
+ * result = module->get_new("test sample");
+ * return result;
+ * }
+- * </programlisting>
++ * ]]></programlisting>
+ * </example>
+ *
+ * Third thing application should do is to register module type on the
+@@ -108,7 +108,7 @@
+ * interface (see the fm-dummy.h header example above):
+ * <example id="example-fm-dummy-test-c">
+ * <title>Sample of module dummy/test</title>
+- * <programlisting>
++ * <programlisting><![CDATA[
+ * #include "fm-dummy.h"
+ *
+ * FM_DEFINE_MODULE(dummy, test)
+@@ -121,7 +121,7 @@
+ * FmDummyInit fm_module_init_dummy = {
+ * fm_dummy_test_get_new;
+ * };
+- * </programlisting>
++ * ]]></programlisting>
+ * </example>
+ * The fm_module_init_dummy should be exactly the same structure that is
+ * defined in the header file above.
+--
+2.15.1
+
diff --git a/poky/meta/recipes-support/libfm/libfm_1.2.5.bb b/poky/meta/recipes-support/libfm/libfm_1.2.5.bb
new file mode 100644
index 000000000..596408353
--- /dev/null
+++ b/poky/meta/recipes-support/libfm/libfm_1.2.5.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4641e94ec96f98fabc56ff9cc48be14b \
+ file://src/fm.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007 \
+ file://src/base/fm-config.h;beginline=10;endline=23;md5=ef1f84da64b3c01cca447212f7ef6007 \
+ file://src/fm-gtk.h;beginline=6;endline=19;md5=646baa4955c04fe768f2ca27b92ac8dd"
+
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 glib-2.0-native pango gtk+3 menu-cache intltool-native libexif libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+ file://0001-Correctly-check-the-stamp-file-that-indicates-if-we-.patch \
+ file://0001-Enclose-text-in-programlisting-into-CDATA.patch \
+ "
+
+SRC_URI[md5sum] = "a1ba9ae5e920f38b647dd511edd6c807"
+SRC_URI[sha256sum] = "c706bb1020cf5f2d6f5a9226f692ce1985947134dcf2bde64278bd0420779b5a"
+
+inherit autotools pkgconfig gtk-doc gettext distro_features_check
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+EXTRA_OECONF = "--with-gtk=3"
+
+do_configure[dirs] =+ "${S}/m4"
+
+PACKAGES =+ "libfm-gtk"
+PACKAGES += "${PN}-mime"
+FILES_libfm-gtk = " \
+ ${libdir}/libfm-gtk*so.* \
+ ${libdir}/libfm/modules/gtk* \
+ ${bindir}/libfm-pref-apps \
+ ${bindir}/lxshortcut \
+ ${datadir}/applications/libfm-pref-apps.desktop \
+ ${datadir}/applications/lxshortcut.desktop \
+ ${datadir}/libfm/images/folder.png \
+ ${datadir}/libfm/images/unknown.png \
+ ${datadir}/libfm/ui/*.ui \
+"
+FILES_${PN}-mime = "${datadir}/mime/"
+
+do_install_append () {
+ # remove files which are part of libfm-extra
+ rm -f ${D}${includedir}/libfm-1.0/fm-xml-file.h
+ rm -f ${D}${includedir}/libfm-1.0/fm-version.h
+ rm -f ${D}${includedir}/libfm-1.0/fm-extra.h
+ rm -f ${D}${includedir}/libfm
+ rm -f ${D}${libdir}/pkgconfig/libfm-extra.pc
+ rm -f ${D}${libdir}/libfm-extra.so*
+ rm -f ${D}${libdir}/libfm-extra.a
+ rm -f ${D}${libdir}/libfm-extra.la
+}
diff --git a/poky/meta/recipes-support/libgcrypt/files/0001-Add-and-use-pkg-config-for-libgcrypt-instead-of-conf.patch b/poky/meta/recipes-support/libgcrypt/files/0001-Add-and-use-pkg-config-for-libgcrypt-instead-of-conf.patch
new file mode 100644
index 000000000..d41c3de3b
--- /dev/null
+++ b/poky/meta/recipes-support/libgcrypt/files/0001-Add-and-use-pkg-config-for-libgcrypt-instead-of-conf.patch
@@ -0,0 +1,183 @@
+From 72b9e9040d58c15f0302bd8abda28179f04e1c5f Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Wed, 16 Aug 2017 10:43:18 +0800
+Subject: [PATCH 1/4] Add and use pkg-config for libgcrypt instead of -config
+ scripts.
+
+Upstream-Status: Denied [upstream have indicated they don't want a
+pkg-config dependency]
+
+RP 2014/5/22
+
+Rebase to 1.8.0
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 1 +
+ src/libgcrypt.m4 | 71 +++--------------------------------------------------
+ src/libgcrypt.pc.in | 33 +++++++++++++++++++++++++
+ 3 files changed, 38 insertions(+), 67 deletions(-)
+ create mode 100644 src/libgcrypt.pc.in
+
+diff --git a/configure.ac b/configure.ac
+index bbe8104..3d2de73 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2607,6 +2607,7 @@ random/Makefile
+ doc/Makefile
+ src/Makefile
+ src/gcrypt.h
++src/libgcrypt.pc
+ src/libgcrypt-config
+ src/versioninfo.rc
+ tests/Makefile
+diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4
+index c67cfec..4ea5f2c 100644
+--- a/src/libgcrypt.m4
++++ b/src/libgcrypt.m4
+@@ -29,30 +29,6 @@ dnl is added to the gpg_config_script_warn variable.
+ dnl
+ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_ARG_WITH(libgcrypt-prefix,
+- AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
+- [prefix where LIBGCRYPT is installed (optional)]),
+- libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
+- if test x"${LIBGCRYPT_CONFIG}" = x ; then
+- if test x"${libgcrypt_config_prefix}" != x ; then
+- LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
+- else
+- case "${SYSROOT}" in
+- /*)
+- if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
+- LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
+- fi
+- ;;
+- '')
+- ;;
+- *)
+- AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+- ;;
+- esac
+- fi
+- fi
+-
+- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+ tmp=ifelse([$1], ,1:1.2.0,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -62,48 +38,13 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ min_libgcrypt_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
+- ok=no
+- if test "$LIBGCRYPT_CONFIG" != "no" ; then
+- req_major=`echo $min_libgcrypt_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_libgcrypt_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_libgcrypt_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+- major=`echo $libgcrypt_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $libgcrypt_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- micro=`echo $libgcrypt_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$minor" -eq "$req_minor"; then
+- if test "$micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
+- if test $ok = yes; then
+- AC_MSG_RESULT([yes ($libgcrypt_config_version)])
+- else
+- AC_MSG_RESULT(no)
+- fi
++ PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= $min_libgcrypt_version], [ok=yes], [ok=no])
++
+ if test $ok = yes; then
+ # If we have a recent libgcrypt, we should also check that the
+ # API is compatible
+ if test "$req_libgcrypt_api" -gt 0 ; then
+- tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version libgcrypt`
+ if test "$tmp" -gt 0 ; then
+ AC_MSG_CHECKING([LIBGCRYPT API version])
+ if test "$req_libgcrypt_api" -eq "$tmp" ; then
+@@ -116,10 +57,8 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ fi
+ fi
+ if test $ok = yes; then
+- LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+- LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+ ifelse([$2], , :, [$2])
+- libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
++ libgcrypt_config_host=`$PKG_CONFIG --variable=host libgcrypt`
+ if test x"$libgcrypt_config_host" != xnone ; then
+ if test x"$libgcrypt_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -134,8 +73,6 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ fi
+ fi
+ else
+- LIBGCRYPT_CFLAGS=""
+- LIBGCRYPT_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(LIBGCRYPT_CFLAGS)
+diff --git a/src/libgcrypt.pc.in b/src/libgcrypt.pc.in
+new file mode 100644
+index 0000000..2fc8f53
+--- /dev/null
++++ b/src/libgcrypt.pc.in
+@@ -0,0 +1,33 @@
++# Process this file with autoconf to produce a pkg-config metadata file.
++# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
++# Author: Simon Josefsson
++#
++# This file is free software; as a special exception the author gives
++# unlimited permission to copy and/or distribute it, with or without
++# modifications, as long as this notice is preserved.
++#
++# This file is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@LIBGCRYPT_CONFIG_API_VERSION@
++host=@LIBGCRYPT_CONFIG_HOST@
++
++# Misc information.
++symmetric_ciphers=@LIBGCRYPT_CIPHERS@
++asymmetric_ciphers=@LIBGCRYPT_PUBKEY_CIPHERS@
++digests=@LIBGCRYPT_DIGESTS@
++
++Name: libgcrypt
++Description: GNU crypto library
++URL: http://www.gnupg.org
++Version: @VERSION@
++Libs: -L${libdir} -lgcrypt
++Libs.private: -L${libdir} -lgpg-error
++Cflags: -I${includedir}
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch b/poky/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
new file mode 100644
index 000000000..d7554f38a
--- /dev/null
+++ b/poky/meta/recipes-support/libgcrypt/files/0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
@@ -0,0 +1,41 @@
+From 97570ef271ea1fb7b5ca903eec88f68407b0ec76 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 16 Aug 2017 10:44:41 +0800
+Subject: [PATCH 2/4] libgcrypt: fix building error with '-O2' in sysroot path
+
+Upstream-Status: Pending
+
+Characters like '-O2' or '-Ofast' will be replaced by '-O1' when
+compiling cipher.
+If we are cross compiling libgcrypt and sysroot contains such
+characters, we would
+get compile errors because the sysroot path has been modified.
+
+Fix this by adding blank spaces before and after the original matching
+pattern in the
+sed command.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Rebase to 1.8.0
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cipher/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cipher/Makefile.am b/cipher/Makefile.am
+index 95c4510..bd52ec7 100644
+--- a/cipher/Makefile.am
++++ b/cipher/Makefile.am
+@@ -116,7 +116,7 @@ gost-s-box: gost-s-box.c
+
+
+ if ENABLE_O_FLAG_MUNGING
+-o_flag_munging = sed -e 's/-O\([2-9s][2-9s]*\)/-O1/' -e 's/-Ofast/-O1/g'
++o_flag_munging = sed -e 's/ -O\([2-9s][2-9s]*\) / -O1 /' -e 's/ -Ofast / -O1 /g'
+ else
+ o_flag_munging = cat
+ endif
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libgcrypt/files/0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch b/poky/meta/recipes-support/libgcrypt/files/0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch
new file mode 100644
index 000000000..105df2957
--- /dev/null
+++ b/poky/meta/recipes-support/libgcrypt/files/0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch
@@ -0,0 +1,79 @@
+From 7cc702c7b5a1ccc2b0091f3effa1391b6c3030fd Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Aug 2017 10:46:28 +0800
+Subject: [PATCH 3/4] tests/bench-slope.c: workaround ICE failure on mips with
+ '-O -g'
+
+Hit a ICE and could reduce it to the following minimal example:
+
+1. Only the size of array assigned with 2 caused the issue:
+$ cat > mipgcc-test.c << END
+
+int main (int argc, char **argv)
+{
+ char *pStrArry[ARRAY_SIZE_MAX] = {"hello"};
+ int i = 0;
+
+ while(pStrArry[i] && i<ARRAY_SIZE_MAX)
+ {
+ printf("%s\n", pStrArry[i]);
+ i++;
+ }
+
+ return 0;
+}
+
+END
+
+2. Only -O1 and -g on mips caused the issue:
+$ mips-poky-linux-gcc -O1 -g -o mipgcc-test mipgcc-test.c
+mipgcc-test.c: In function 'main':
+mipgcc-test.c:18:1: internal compiler error: in dwarf2out_var_location,
+at dwarf2out.c:20810
+ }
+ ^
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <http://gcc.gnu.org/bugs.html> for instructions
+
+3. The quick workround is trying to enlarge the size of array with
+larger
+than 2.
+
+4. File a bug to GNU, but it could not be reproduced on there
+environment.
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643
+
+Upstream-Status: Inappropriate [oe specific]
+
+Rebase to 1.8.0
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/bench-slope.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/bench-slope.c b/tests/bench-slope.c
+index 75e6e43..4e70842 100644
+--- a/tests/bench-slope.c
++++ b/tests/bench-slope.c
+@@ -1463,7 +1463,7 @@ static struct bench_ops hash_ops = {
+ };
+
+
+-static struct bench_hash_mode hash_modes[] = {
++static struct bench_hash_mode hash_modes[3] = {
+ {"", &hash_ops},
+ {0},
+ };
+@@ -1629,7 +1629,7 @@ static struct bench_ops mac_ops = {
+ };
+
+
+-static struct bench_mac_mode mac_modes[] = {
++static struct bench_mac_mode mac_modes[3] = {
+ {"", &mac_ops},
+ {0},
+ };
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libgcrypt/files/0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch b/poky/meta/recipes-support/libgcrypt/files/0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch
new file mode 100644
index 000000000..8622df3ea
--- /dev/null
+++ b/poky/meta/recipes-support/libgcrypt/files/0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch
@@ -0,0 +1,28 @@
+From e20dbdb0b8f0af840ef90b299c4e2277c52ddf87 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sun, 12 Jun 2016 04:44:29 -0400
+Subject: [PATCH 4/4] tests/Makefile.am: fix undefined reference to
+ `pthread_create'
+
+Add missing '-lpthread' to CFLAGS
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 1744ea7..04cf425 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -64,4 +64,4 @@ EXTRA_DIST = README rsa-16k.key cavs_tests.sh cavs_driver.pl \
+
+ LDADD = $(standard_ldadd) $(GPG_ERROR_LIBS)
+ t_lock_LDADD = $(standard_ldadd) $(GPG_ERROR_MT_LIBS)
+-t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS)
++t_lock_CFLAGS = $(GPG_ERROR_MT_CFLAGS) -lpthread
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libgcrypt/libgcrypt_1.8.2.bb b/poky/meta/recipes-support/libgcrypt/libgcrypt_1.8.2.bb
new file mode 100644
index 000000000..b36e653a8
--- /dev/null
+++ b/poky/meta/recipes-support/libgcrypt/libgcrypt_1.8.2.bb
@@ -0,0 +1,53 @@
+SUMMARY = "General purpose cryptographic library based on the code from GnuPG"
+HOMEPAGE = "http://directory.fsf.org/project/libgcrypt/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+SECTION = "libs"
+
+# helper program gcryptrnd and getrandom are under GPL, rest LGPL
+LICENSE = "GPLv2+ & LGPLv2.1+ & GPLv3+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-dev = "GPLv2+ & LGPLv2.1+"
+LICENSE_dumpsexp-dev = "GPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff"
+
+DEPENDS = "libgpg-error"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
+ file://0001-Add-and-use-pkg-config-for-libgcrypt-instead-of-conf.patch \
+ file://0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch \
+ file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
+ file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
+"
+SRC_URI[md5sum] = "cfb0b5c79eab07686b6898160a407139"
+SRC_URI[sha256sum] = "c8064cae7558144b13ef0eb87093412380efa16c4ee30ad12ecb54886a524c07"
+
+BINCONFIG = "${bindir}/libgcrypt-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+EXTRA_OECONF = "--disable-asm"
+EXTRA_OEMAKE_class-target = "LIBTOOLFLAGS='--tag=CC'"
+
+PACKAGECONFIG ??= "capabilities"
+PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
+
+do_configure_prepend () {
+ # Else this could be used in preference to the one in aclocal-copy
+ rm -f ${S}/m4/gpg-error.m4
+}
+
+# libgcrypt.pc is added locally and thus installed here
+do_install_append() {
+ install -d ${D}/${libdir}/pkgconfig
+ install -m 0644 ${B}/src/libgcrypt.pc ${D}/${libdir}/pkgconfig/
+}
+
+PACKAGES =+ "dumpsexp-dev"
+
+FILES_${PN}-dev += "${bindir}/hmac256"
+FILES_dumpsexp-dev += "${bindir}/dumpsexp"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch b/poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch
new file mode 100644
index 000000000..9ffeedbe5
--- /dev/null
+++ b/poky/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch
@@ -0,0 +1,150 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Upstream-Status: Pending
+
+Index: libgpg-error-1.17/configure.ac
+===================================================================
+--- libgpg-error-1.17.orig/configure.ac
++++ libgpg-error-1.17/configure.ac
+@@ -529,6 +529,7 @@ AC_CONFIG_FILES([src/Makefile tests/Make
+ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
+ AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest])
+ AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
++AC_CONFIG_FILES([src/gpg-error.pc])
+
+ AC_OUTPUT
+
+Index: libgpg-error-1.17/src/Makefile.am
+===================================================================
+--- libgpg-error-1.17.orig/src/Makefile.am
++++ libgpg-error-1.17/src/Makefile.am
+@@ -75,6 +75,8 @@ nodist_include_HEADERS = gpg-error.h
+ bin_SCRIPTS = gpg-error-config
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = gpg-error.m4
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = gpg-error.pc
+
+ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
+ mkerrnos.awk errnos.in README \
+@@ -82,7 +84,7 @@ EXTRA_DIST = mkstrtable.awk err-sources.
+ mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \
+ err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
+ gpg-error.vers gpg-error.def.in \
+- versioninfo.rc.in gpg-error.w32-manifest.in \
++ versioninfo.rc.in gpg-error.w32-manifest.in gpg-error.pc \
+ $(lock_obj_pub)
+
+ BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+Index: libgpg-error-1.17/src/gpg-error.m4
+===================================================================
+--- libgpg-error-1.17.orig/src/gpg-error.m4
++++ libgpg-error-1.17/src/gpg-error.m4
+@@ -26,73 +26,13 @@ dnl is added to the gpg_config_script_wa
+ dnl
+ AC_DEFUN([AM_PATH_GPG_ERROR],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+- gpg_error_config_prefix=""
+- dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
+- dnl since that is consistent with how our three siblings use the directory/
+- dnl package name in --with-$dir_name-prefix=PFX.
+- AC_ARG_WITH(libgpg-error-prefix,
+- AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+- [prefix where GPG Error is installed (optional)]),
+- [gpg_error_config_prefix="$withval"])
+-
+- dnl Accept --with-gpg-error-prefix and make it work the same as
+- dnl --with-libgpg-error-prefix above, for backwards compatibility,
+- dnl but do not document this old, inconsistently-named option.
+- AC_ARG_WITH(gpg-error-prefix,,
+- [gpg_error_config_prefix="$withval"])
++ min_gpg_error_version=ifelse([$1], ,0.0,$1)
+
+- if test x"${GPG_ERROR_CONFIG}" = x ; then
+- if test x"${gpg_error_config_prefix}" != x ; then
+- GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+- else
+- case "${SYSROOT}" in
+- /*)
+- if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+- GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
+- fi
+- ;;
+- '')
+- ;;
+- *)
+- AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+- ;;
+- esac
+- fi
+- fi
++ PKG_CHECK_MODULES(GPG_ERROR, [gpg-error >= $min_gpg_error_version], [ok=yes], [ok=no])
+
+- AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
+- min_gpg_error_version=ifelse([$1], ,0.0,$1)
+- AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+- ok=no
+- if test "$GPG_ERROR_CONFIG" != "no" \
+- && test -f "$GPG_ERROR_CONFIG" ; then
+- req_major=`echo $min_gpg_error_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_gpg_error_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
+- major=`echo $gpg_error_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $gpg_error_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -ge "$req_minor"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+ if test $ok = yes; then
+- GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
+- GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
+- GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
+- GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+- AC_MSG_RESULT([yes ($gpg_error_config_version)])
+ ifelse([$2], , :, [$2])
+- gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
++ gpg_error_config_host=`$PKG_CONFIG --variable=host gpg-error`
+ if test x"$gpg_error_config_host" != xnone ; then
+ if test x"$gpg_error_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -107,11 +47,6 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
+ fi
+ fi
+ else
+- GPG_ERROR_CFLAGS=""
+- GPG_ERROR_LIBS=""
+- GPG_ERROR_MT_CFLAGS=""
+- GPG_ERROR_MT_LIBS=""
+- AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GPG_ERROR_CFLAGS)
+Index: libgpg-error-1.17/src/gpg-error.pc.in
+===================================================================
+--- /dev/null
++++ libgpg-error-1.17/src/gpg-error.pc.in
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++host=@GPG_ERROR_CONFIG_HOST@
++
++Name: gpg-error
++Description: a library that defines common error values for all GnuPG components
++Version: @VERSION@
++Libs: -L${libdir} -lgpg-error
++Cflags: -I${includedir}
diff --git a/poky/meta/recipes-support/libgpg-error/libgpg-error_1.27.bb b/poky/meta/recipes-support/libgpg-error/libgpg-error_1.27.bb
new file mode 100644
index 000000000..b74f079f5
--- /dev/null
+++ b/poky/meta/recipes-support/libgpg-error/libgpg-error_1.27.bb
@@ -0,0 +1,62 @@
+SUMMARY = "Small library that defines common error values for all GnuPG components"
+HOMEPAGE = "http://www.gnupg.org/related_software/libgpg-error/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://src/gpg-error.h.in;endline=23;md5=beae1e44d8d5c265d194760276033a7c \
+ file://src/init.c;endline=20;md5=872b2389fe9bae7ffb80d2b91225afbc"
+
+
+SECTION = "libs"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
+ file://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "5217ef3e76a7275a2a3b569a12ddc989"
+SRC_URI[sha256sum] = "4f93aac6fecb7da2b92871bb9ee33032be6a87b174f54abf8ddf0911a22d29d2"
+
+BINCONFIG = "${bindir}/gpg-error-config"
+
+inherit autotools binconfig-disabled pkgconfig gettext multilib_header
+CPPFLAGS += "-P"
+do_compile_prepend() {
+ TARGET_FILE=linux-gnu
+ if [ ${TARGET_OS} = "mingw32" ]; then
+ # There are no arch specific syscfg files for mingw32
+ TARGET_FILE=
+ elif [ ${TARGET_OS} != "linux" ]; then
+ TARGET_FILE=${TARGET_OS}
+ fi
+
+ case ${TARGET_ARCH} in
+ aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;;
+ arm) TUPLE=arm-unknown-linux-gnueabi ;;
+ armeb) TUPLE=arm-unknown-linux-gnueabi ;;
+ i586|i686) TUPLE=i686-pc-linux-gnu ;;
+ mips64*) TUPLE=mips64el-unknown-linux-gnuabi64 ;;
+ mips*el) TUPLE=mipsel-unknown-linux-gnu ;;
+ mips*) TUPLE=mips-unknown-linux-gnu ;;
+ x86_64) TUPLE=x86_64-pc-linux-gnu ;;
+ *) TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;;
+ esac
+
+ if [ -n "$TARGET_FILE" ]; then
+ cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
+ ${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+ fi
+}
+
+do_install_append() {
+ # we don't have common lisp in OE
+ rm -rf "${D}${datadir}/common-lisp/"
+ oe_multilib_header gpg-error.h gpgrt.h
+}
+
+FILES_${PN}-dev += "${bindir}/gpg-error"
+FILES_${PN}-doc += "${datadir}/libgpg-error/errorref.txt"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libical/libical/0001-CMakeLists.txt-libical.pc.in-fix-iculibs-remove-full.patch b/poky/meta/recipes-support/libical/libical/0001-CMakeLists.txt-libical.pc.in-fix-iculibs-remove-full.patch
new file mode 100644
index 000000000..6db75f508
--- /dev/null
+++ b/poky/meta/recipes-support/libical/libical/0001-CMakeLists.txt-libical.pc.in-fix-iculibs-remove-full.patch
@@ -0,0 +1,44 @@
+From 1a41069c0dc054e59cd76fc3d8cf7cc2a78b5e8d Mon Sep 17 00:00:00 2001
+From: Allen Winter <allen.winter@kdab.com>
+Date: Sat, 3 Sep 2016 16:56:29 -0400
+Subject: [PATCH] CMakeLists.txt, libical.pc.in - fix iculibs (remove full path) ISSUE: 227
+
+Upstream-Status: Backport
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+----
+diff -Naur libical-2.0.0-orig/CMakeLists.txt libical-2.0.0/CMakeLists.txt
+--- libical-2.0.0-orig/CMakeLists.txt 2016-09-08 18:05:06.166049345 +0300
++++ libical-2.0.0/CMakeLists.txt 2016-09-08 18:05:45.201561334 +0300
+@@ -128,6 +128,7 @@
+ # RSCALE info at http://tools.ietf.org/html/rfc7529
+ find_package(ICU)
+ if(ICU_FOUND)
++ set(ICUUC_LIBS "-licuuc") #for libical.pc
+ set(HAVE_LIBICU 1)
+ if(ICU_MAJOR_VERSION VERSION_GREATER 50)
+ set(HAVE_ICU_DANGI TRUE)
+@@ -137,6 +138,7 @@
+ endif()
+ if(ICU_I18N_FOUND)
+ set(HAVE_LIBICU_I18N 1)
++ set(ICUI18N_LIBS "-licui18n") #for libical.pc
+ endif()
+
+ # MSVC specific definitions
+diff -Naur libical-2.0.0-orig/libical.pc.in libical-2.0.0/libical.pc.in
+--- libical-2.0.0-orig/libical.pc.in 2015-12-28 23:44:53.000000000 +0200
++++ libical-2.0.0/libical.pc.in 2016-09-08 18:09:12.991963597 +0300
+@@ -3,10 +3,10 @@
+ libdir=@libdir@
+ includedir=@includedir@
+ threadslib=@PTHREAD_LIBS@
+-iculib=@ICU_LIBRARIES@ @ICU_I18N_LIBRARIES@
++iculibs=@ICUUC_LIBS@ @ICUI18N_LIBS@
+
+ Name: libical
+ Description: An implementation of basic iCAL protocols
+ Version: @VERSION@
+-Libs: -L${libdir} -lical -licalss -licalvcal ${threadslib} ${iculib}
++Libs: -L${libdir} -lical -licalss -licalvcal ${threadslib} ${iculibs}
+ Cflags: -I${includedir}
diff --git a/poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch b/poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch
new file mode 100644
index 000000000..b50f50e70
--- /dev/null
+++ b/poky/meta/recipes-support/libical/libical/Remove-cmake-check-for-Perl.patch
@@ -0,0 +1,30 @@
+From 918cd8764a845a9d25918a444fbaa5070d2be609 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 21 Aug 2015 16:38:05 +0300
+Subject: [PATCH] Remove cmake check for Perl
+
+We set "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY" in cmake bbclass to
+make sure cmake does not find host programs. In this case we actually
+are fine with host perl: remove the check.
+
+Upstream-Status: Inappropriate [workaround]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ CMakeLists.txt | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+Index: libical-2.0.0/CMakeLists.txt
+===================================================================
+--- libical-2.0.0.orig/CMakeLists.txt
++++ libical-2.0.0/CMakeLists.txt
+@@ -116,8 +116,7 @@ if(SHARED_ONLY)
+ set(LIBRARY_TYPE SHARED)
+ endif()
+
+-# must have Perl to create the derived stuff
+-find_package(Perl REQUIRED)
++set(PERL_EXECUTABLE perl)
+
+ # Ensure finding 64bit libs when using 64-bit compilers
+ if(CMAKE_CL_64)
diff --git a/poky/meta/recipes-support/libical/libical_2.0.0.bb b/poky/meta/recipes-support/libical/libical_2.0.0.bb
new file mode 100644
index 000000000..dcc21cc16
--- /dev/null
+++ b/poky/meta/recipes-support/libical/libical_2.0.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "iCal and scheduling (RFC 2445, 2446, 2447) library"
+HOMEPAGE = "https://github.com/libical/libical"
+BUGTRACKER = "https://github.com/libical/libical/issues"
+LICENSE = "LGPLv2.1 | MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d4fc58309d8ed46587ac63bb449d82f8 \
+ file://LICENSE;md5=d1a0891cd3e582b3e2ec8fe63badbbb6"
+SECTION = "libs"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
+ file://Remove-cmake-check-for-Perl.patch \
+ file://0001-CMakeLists.txt-libical.pc.in-fix-iculibs-remove-full.patch \
+ "
+DEPENDS = "icu"
+
+SRC_URI[md5sum] = "6bf8e5f5a3ba88baf390d0134e05d76e"
+SRC_URI[sha256sum] = "654c11f759c19237be39f6ad401d917e5a05f36f1736385ed958e60cf21456da"
+UPSTREAM_CHECK_URI = "https://github.com/libical/libical/releases"
+
+inherit cmake pkgconfig
diff --git a/poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch b/poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch
new file mode 100644
index 000000000..5afe6de92
--- /dev/null
+++ b/poky/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch
@@ -0,0 +1,152 @@
+Upstream-Status: Denied
+
+Add pkgconfig support to libksba.
+This patch is rejected by upstream for the reason below:
+They think pkgconfig adds no portability and maintaining them is not worthwhile.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Index: libksba-1.3.5/Makefile.am
+===================================================================
+--- libksba-1.3.5.orig/Makefile.am
++++ libksba-1.3.5/Makefile.am
+@@ -20,6 +20,9 @@
+
+ ACLOCAL_AMFLAGS = -I m4 -I gl/m4
+
++pkgconfigdir = ${libdir}/pkgconfig
++pkgconfig_DATA = ksba.pc
++
+ # (A suitable gitlog-to-changelog script can be found in GnuPG master.)
+ GITLOG_TO_CHANGELOG=gitlog-to-changelog
+
+Index: libksba-1.3.5/configure.ac
+===================================================================
+--- libksba-1.3.5.orig/configure.ac
++++ libksba-1.3.5/configure.ac
+@@ -414,6 +414,7 @@ gl/Makefile
+ src/Makefile
+ src/ksba-config
+ src/versioninfo.rc
++ksba.pc
+ tests/Makefile
+ doc/Makefile
+ ])
+Index: libksba-1.3.5/ksba.pc.in
+===================================================================
+--- /dev/null
++++ libksba-1.3.5/ksba.pc.in
+@@ -0,0 +1,17 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@KSBA_CONFIG_API_VERSION@
++host=@KSBA_CONFIG_HOST@
++
++Name: ksba
++Description: Libksba provides an easy API to create and parse X.509 and CMS related objects
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lksba
++Libs.private: -L${libdir} -lgpg-error
++Cflags: -I${includedir}
++
+Index: libksba-1.3.5/src/ksba.m4
+===================================================================
+--- libksba-1.3.5.orig/src/ksba.m4
++++ libksba-1.3.5/src/ksba.m4
+@@ -22,18 +22,7 @@ dnl with a changed API.
+ dnl
+ AC_DEFUN([AM_PATH_KSBA],
+ [AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_ARG_WITH(ksba-prefix,
+- AC_HELP_STRING([--with-ksba-prefix=PFX],
+- [prefix where KSBA is installed (optional)]),
+- ksba_config_prefix="$withval", ksba_config_prefix="")
+- if test x$ksba_config_prefix != x ; then
+- ksba_config_args="$ksba_config_args --prefix=$ksba_config_prefix"
+- if test x${KSBA_CONFIG+set} != xset ; then
+- KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
+- fi
+- fi
+
+- AC_PATH_PROG(KSBA_CONFIG, ksba-config, no)
+ tmp=ifelse([$1], ,1:1.0.0,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_ksba_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -43,48 +32,13 @@ AC_DEFUN([AM_PATH_KSBA],
+ min_ksba_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for KSBA - version >= $min_ksba_version)
+- ok=no
+- if test "$KSBA_CONFIG" != "no" ; then
+- req_major=`echo $min_ksba_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_ksba_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_ksba_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- ksba_config_version=`$KSBA_CONFIG $ksba_config_args --version`
+- major=`echo $ksba_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $ksba_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- micro=`echo $ksba_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$minor" -eq "$req_minor"; then
+- if test "$micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
+- if test $ok = yes; then
+- AC_MSG_RESULT([yes ($ksba_config_version)])
+- else
+- AC_MSG_RESULT(no)
+- fi
++ PKG_CHECK_MODULES(KSBA, [ksba >= $min_ksba_version], [ok=yes], [ok=no])
++
+ if test $ok = yes; then
+ # Even if we have a recent libksba, we should check that the
+ # API is compatible.
+ if test "$req_ksba_api" -gt 0 ; then
+- tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version ksba`
+ if test "$tmp" -gt 0 ; then
+ AC_MSG_CHECKING([KSBA API version])
+ if test "$req_ksba_api" -eq "$tmp" ; then
+@@ -97,10 +51,8 @@ AC_DEFUN([AM_PATH_KSBA],
+ fi
+ fi
+ if test $ok = yes; then
+- KSBA_CFLAGS=`$KSBA_CONFIG $ksba_config_args --cflags`
+- KSBA_LIBS=`$KSBA_CONFIG $ksba_config_args --libs`
+ ifelse([$2], , :, [$2])
+- libksba_config_host=`$LIBKSBA_CONFIG $ksba_config_args --host 2>/dev/null || echo none`
++ libksba_config_host=`$PKG_CONFIG --variable=host ksba`
+ if test x"$libksba_config_host" != xnone ; then
+ if test x"$libksba_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -114,8 +66,6 @@ AC_DEFUN([AM_PATH_KSBA],
+ fi
+ fi
+ else
+- KSBA_CFLAGS=""
+- KSBA_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(KSBA_CFLAGS)
diff --git a/poky/meta/recipes-support/libksba/libksba_1.3.5.bb b/poky/meta/recipes-support/libksba/libksba_1.3.5.bb
new file mode 100644
index 000000000..a7ea53fed
--- /dev/null
+++ b/poky/meta/recipes-support/libksba/libksba_1.3.5.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Easy API to create and parse X.509 and CMS related objects"
+HOMEPAGE = "http://www.gnupg.org/related_software/libksba/"
+LICENSE = "GPLv2+ | LGPLv3+ | GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd541d83f75d038c4e0617b672ed8bda \
+ file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.GPLv3;md5=2f31b266d3440dd7ee50f92cf67d8e6c \
+ file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+ "
+
+DEPENDS = "libgpg-error"
+
+BINCONFIG = "${bindir}/ksba-config"
+
+inherit autotools binconfig-disabled pkgconfig texinfo
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://ksba-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "8302a3e263a7c630aa7dea7d341f07a2"
+SRC_URI[sha256sum] = "41444fd7a6ff73a79ad9728f985e71c9ba8cd3e5e53358e70d5f066d35c1a340"
+
+do_configure_prepend () {
+ # Else these could be used in preference to those in aclocal-copy
+ rm -f ${S}/m4/gpg-error.m4
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/libmpc/libmpc.inc b/poky/meta/recipes-support/libmpc/libmpc.inc
new file mode 100644
index 000000000..b3742543d
--- /dev/null
+++ b/poky/meta/recipes-support/libmpc/libmpc.inc
@@ -0,0 +1,7 @@
+SUMMARY = "C library for complex number arithmetic with arbitrary precision and correct rounding"
+DESCRIPTION = "Mpc is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result. It is built upon and follows the same principles as Mpfr"
+HOMEPAGE = "http://www.multiprecision.org/"
+LICENSE = "LGPLv3"
+SECTION = "libs"
+
+inherit autotools texinfo
diff --git a/poky/meta/recipes-support/libmpc/libmpc_1.1.0.bb b/poky/meta/recipes-support/libmpc/libmpc_1.1.0.bb
new file mode 100644
index 000000000..2d25d388f
--- /dev/null
+++ b/poky/meta/recipes-support/libmpc/libmpc_1.1.0.bb
@@ -0,0 +1,15 @@
+require libmpc.inc
+
+DEPENDS = "gmp mpfr"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
+SRC_URI = "https://ftp.gnu.org/gnu/mpc/mpc-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4125404e41e482ec68282a2e687f6c73"
+SRC_URI[sha256sum] = "6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e"
+
+UPSTREAM_CHECK_URI = "http://www.multiprecision.org/mpc/download.html"
+
+S = "${WORKDIR}/mpc-${PV}"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-support/libnl/libnl/0001-PATCH-fix-libnl-3.4.0-musl-compile-problem.patch b/poky/meta/recipes-support/libnl/libnl/0001-PATCH-fix-libnl-3.4.0-musl-compile-problem.patch
new file mode 100644
index 000000000..b20a29962
--- /dev/null
+++ b/poky/meta/recipes-support/libnl/libnl/0001-PATCH-fix-libnl-3.4.0-musl-compile-problem.patch
@@ -0,0 +1,38 @@
+Subject: [PATCH] fix libnl-3.4.0 musl compile problem
+Avoid in6_addr redefinition
+
+Upstream-Status: Pending
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+---
+ include/linux-private/linux/if_bridge.h | 1 -
+ include/linux-private/linux/ipv6.h | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/include/linux-private/linux/if_bridge.h b/include/linux-private/linux/if_bridge.h
+index f24050b..8f7490c 100644
+--- a/include/linux-private/linux/if_bridge.h
++++ b/include/linux-private/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+
+ #define SYSFS_BRIDGE_ATTR "bridge"
+ #define SYSFS_BRIDGE_FDB "brforward"
+diff --git a/include/linux-private/linux/ipv6.h b/include/linux-private/linux/ipv6.h
+index e05e684..f16349d 100644
+--- a/include/linux-private/linux/ipv6.h
++++ b/include/linux-private/linux/ipv6.h
+@@ -2,7 +2,6 @@
+ #define _IPV6_H
+
+ #include <asm/byteorder.h>
+-#include <linux/in6.h>
+
+ /* The latest drafts declared increase in minimal mtu up to 1280. */
+
+--
+2.7.4
+
diff --git a/poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch b/poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch
new file mode 100644
index 000000000..fe8b833a1
--- /dev/null
+++ b/poky/meta/recipes-support/libnl/libnl/fix-pc-file.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Some packages are asking only for libnl-2.0, but expects to get also
+libnl-genl, libnl-nf libnl-route, easiest way to fix them is here.
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+Index: libnl-3.2.14/libnl-3.0.pc.in
+===================================================================
+--- libnl-3.2.14.orig/libnl-3.0.pc.in
++++ libnl-3.2.14/libnl-3.0.pc.in
+@@ -6,5 +6,5 @@ includedir=@includedir@
+ Name: libnl
+ Description: Convenience library for netlink sockets
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lnl-@MAJ_VERSION@
++Libs: -L${libdir} -lnl-@MAJ_VERSION@ -lnl-genl-@MAJ_VERSION@ -lnl-nf-@MAJ_VERSION@ -lnl-route-@MAJ_VERSION@
+ Cflags: -I${includedir}/libnl@MAJ_VERSION@
diff --git a/poky/meta/recipes-support/libnl/libnl_3.4.0.bb b/poky/meta/recipes-support/libnl/libnl_3.4.0.bb
new file mode 100644
index 000000000..90dc644be
--- /dev/null
+++ b/poky/meta/recipes-support/libnl/libnl_3.4.0.bb
@@ -0,0 +1,46 @@
+SUMMARY = "A library for applications dealing with netlink sockets"
+HOMEPAGE = "http://www.infradead.org/~tgr/libnl/"
+SECTION = "libs/network"
+
+PE = "1"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "https://github.com/thom311/${BPN}/releases/download/${BPN}${@d.getVar('PV').replace('.','_')}/${BP}.tar.gz \
+ file://fix-pc-file.patch \
+ file://0001-PATCH-fix-libnl-3.4.0-musl-compile-problem.patch \
+"
+
+UPSTREAM_CHECK_URI = "https://github.com/thom311/${BPN}/releases"
+
+SRC_URI[md5sum] = "8f71910c03db363b41e2ea62057a4311"
+SRC_URI[sha256sum] = "b7287637ae71c6db6f89e1422c995f0407ff2fe50cecd61a312b6a9b0921f5bf"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${libdir}/libnl-3.so.* \
+ ${libdir}/libnl.so.* \
+ ${sysconfdir}"
+RREPLACES_${PN} = "libnl2"
+RCONFLICTS_${PN} = "libnl2"
+FILES_${PN}-dev += "${libdir}/libnl/cli/*/*.la"
+FILES_${PN}-staticdev += "${libdir}/libnl/cli/*/*.a"
+
+PACKAGES += "${PN}-cli ${PN}-genl ${PN}-idiag ${PN}-nf ${PN}-route ${PN}-xfrm"
+FILES_${PN}-cli = "${libdir}/libnl-cli-3.so.* \
+ ${libdir}/libnl/cli/*/*.so \
+ ${bindir}/genl-ctrl-list \
+ ${bindir}/idiag-socket-details \
+ ${bindir}/nf-* \
+ ${bindir}/nl-*"
+FILES_${PN}-genl = "${libdir}/libnl-genl-3.so.* \
+ ${libdir}/libnl-genl.so.*"
+FILES_${PN}-idiag = "${libdir}/libnl-idiag-3.so.*"
+FILES_${PN}-nf = "${libdir}/libnl-nf-3.so.*"
+FILES_${PN}-route = "${libdir}/libnl-route-3.so.*"
+FILES_${PN}-xfrm = "${libdir}/libnl-xfrm-3.so.*"
+RREPLACES_${PN}-genl = "libnl-genl2"
+RCONFLICTS_${PN}-genl = "libnl-genl2"
diff --git a/poky/meta/recipes-support/libpcre/libpcre/Makefile b/poky/meta/recipes-support/libpcre/libpcre/Makefile
new file mode 100644
index 000000000..708d807d0
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre/Makefile
@@ -0,0 +1,183 @@
+TESTS = pcre_stringpiece_unittest RunTest RunGrepTest
+subdir = .
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi;
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+MKDIR_P = /bin/mkdir -p
+PACKAGE_STRING = PCRE 8.36
+SHELL = /bin/sh
+srcdir = .
+top_srcdir = .
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1;
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done; \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT)
+ @p='pcre_stringpiece_unittest$(EXEEXT)'; \
+ b='pcre_stringpiece_unittest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) -- "$$tst"
+RunTest.log: RunTest
+ @p='RunTest'; \
+ b='RunTest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) -- "$$tst"
+RunGrepTest.log: RunGrepTest
+ @p='RunGrepTest'; \
+ b='RunGrepTest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) -- "$$tst"
diff --git a/poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch b/poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
new file mode 100644
index 000000000..89b44f6aa
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [debian patch]
+
+This patch address a namespace collision with libc.
+
+Although there is no "#include <regex.h>" in the source file, at
+runtime, it's unintentionally linked to the libc version, the regcomp of
+libc is called instead the pcre one using pcre's data structure...
+that looks like a disaster.
+
+Can patch is from Debian (and Ubuntu 11.04alpha has it also).
+
+[sgw: added patch comment]
+Signed-off-by: Qing He <qing.he@intel.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+--- a/pcreposix.h 2010-05-17 00:17:23.000000000 +0800
++++ b/pcreposix.h 2009-01-15 04:32:17.000000000 +0800
+@@ -133,14 +130,19 @@
+
+ /* The functions */
+
+-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
+-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
++PCREPOSIX_EXP_DECL int pcreposix_regcomp(regex_t *, const char *, int);
++PCREPOSIX_EXP_DECL int pcreposix_regexec(const regex_t *, const char *, size_t,
+ regmatch_t *, int);
+-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
+-PCREPOSIX_EXP_DECL void regfree(regex_t *);
++PCREPOSIX_EXP_DECL size_t pcreposix_regerror(int, const regex_t *, char *, size_t);
++PCREPOSIX_EXP_DECL void pcreposix_regfree(regex_t *);
+
+ #ifdef __cplusplus
+ } /* extern "C" */
+ #endif
+
++#define regcomp pcreposix_regcomp
++#define regexec pcreposix_regexec
++#define regerror pcreposix_regerror
++#define regfree pcreposix_regfree
++
+ #endif /* End of pcreposix.h */
diff --git a/poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch b/poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
new file mode 100644
index 000000000..83880f709
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
@@ -0,0 +1,48 @@
+Upstream-Status: Pending
+
+--- pcre-8.32.orig/Makefile.am
++++ pcre-8.32/Makefile.am
+@@ -197,8 +197,18 @@ bin_SCRIPTS = pcre-config
+
++CC_FOR_BUILD = @CC_FOR_BUILD@
++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
++CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
++
+ if WITH_REBUILD_CHARTABLES
+
+ noinst_PROGRAMS += dftables
+ dftables_SOURCES = dftables.c
++dftables_LINK = $(CCLD_FOR_BUILD) -o $@
++dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
++
++dftables.o: $(srcdir)/dftables.c
++ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/dftables.c
+
+ pcre_chartables.c: dftables$(EXEEXT)
+ ./dftables$(EXEEXT) $@
+--- pcre-8.32.orig/configure.ac
++++ pcre-8.32/configure.ac
+@@ -72,6 +72,22 @@ then
+ fi
+ fi
+
++if test x"$cross_compiling" = xyes; then
++ CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
++ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
++ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
++ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
++else
++ CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
++ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
++ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
++ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
++fi
++AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
++AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
++AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
++AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
++
+ # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
+ # Check for that case, and just disable c++ code if g++ doesn't run.
+ AC_LANG_PUSH(C++)
diff --git a/poky/meta/recipes-support/libpcre/libpcre/run-ptest b/poky/meta/recipes-support/libpcre/libpcre/run-ptest
new file mode 100644
index 000000000..990d4a12a
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make check-TESTS
diff --git a/poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch b/poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch
new file mode 100644
index 000000000..871cdfcb7
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre2/pcre-cross.patch
@@ -0,0 +1,65 @@
+Fix for cross compiling
+
+Fixed:
+| ./dftables src/pcre2_chartables.c
+| make: ./dftables: Command not found
+| make: *** [src/pcre2_chartables.c] Error 127
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Index: pcre2-10.30/Makefile.am
+===================================================================
+--- pcre2-10.30.orig/Makefile.am
++++ pcre2-10.30/Makefile.am
+@@ -325,9 +325,21 @@ bin_SCRIPTS = pcre2-config
+ ## to copy a distributed set of tables that are defined for ASCII code. In this
+ ## case, dftables is not needed.
+
++CC_FOR_BUILD = @CC_FOR_BUILD@
++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
++CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
++
+ if WITH_REBUILD_CHARTABLES
+ noinst_PROGRAMS += dftables
+ dftables_SOURCES = src/dftables.c
++
++dftables_LINK = $(CCLD_FOR_BUILD) -o $@
++dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
++
++src/dftables.o: $(srcdir)/src/dftables.c
++ $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/src/dftables.c
++
+ src/pcre2_chartables.c: dftables$(EXEEXT)
+ rm -f $@
+ ./dftables$(EXEEXT) $@
+Index: pcre2-10.30/configure.ac
+===================================================================
+--- pcre2-10.30.orig/configure.ac
++++ pcre2-10.30/configure.ac
+@@ -60,6 +60,23 @@ fi
+ # This is a new thing required to stop a warning from automake 1.12
+ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
++if test x"$cross_compiling" = xyes; then
++ CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
++ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
++ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
++ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
++else
++ CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
++ CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
++ CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
++ LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
++fi
++AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
++AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
++AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
++AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
++
++
+ # Check for a 64-bit integer type
+ AC_TYPE_INT64_T
+
diff --git a/poky/meta/recipes-support/libpcre/libpcre2_10.30.bb b/poky/meta/recipes-support/libpcre/libpcre2_10.30.bb
new file mode 100644
index 000000000..46c2d630e
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre2_10.30.bb
@@ -0,0 +1,61 @@
+DESCRIPTION = "There are two major versions of the PCRE library. The \
+newest version is PCRE2, which is a re-working of the original PCRE \
+library to provide an entirely new API. The original, very widely \
+deployed PCRE library's API and feature are stable, future releases \
+ will be for bugfixes only. All new future features will be to PCRE2, \
+not the original PCRE 8.x series."
+SUMMARY = "Perl Compatible Regular Expressions version 2"
+HOMEPAGE = "http://www.pcre.org"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=12d55e15a0c6da5c645ba40382bd3293"
+
+SRC_URI = "https://ftp.pcre.org/pub/pcre/pcre2-${PV}.tar.bz2 \
+ file://pcre-cross.patch \
+"
+
+SRC_URI[md5sum] = "d3adf4b130eed854a530390f00020a65"
+SRC_URI[sha256sum] = "90bd41c605d30e3745771eb81928d779f158081a51b2f314bbcc1f73de5773db"
+
+CVE_PRODUCT = "pcre2"
+
+S = "${WORKDIR}/pcre2-${PV}"
+
+PROVIDES += "pcre2"
+DEPENDS += "bzip2 zlib"
+
+BINCONFIG = "${bindir}/pcre2-config"
+
+inherit autotools binconfig-disabled
+
+EXTRA_OECONF = "\
+ --enable-newline-is-lf \
+ --enable-rebuild-chartables \
+ --with-link-size=2 \
+ --with-match-limit=10000000 \
+ --enable-pcre2-16 \
+ --enable-pcre2-32 \
+"
+# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
+# set CFLAGS_FOR_BUILD, required for the libpcre build.
+BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}/src"
+CFLAGS += "-D_REENTRANT"
+CXXFLAGS_append_powerpc = " -lstdc++"
+
+export CCLD_FOR_BUILD ="${BUILD_CCLD}"
+
+PACKAGES =+ "libpcre2-16 libpcre2-32 pcre2grep pcre2grep-doc pcre2test pcre2test-doc"
+
+SUMMARY_pcre2grep = "grep utility that uses perl 5 compatible regexes"
+SUMMARY_pcre2grep-doc = "grep utility that uses perl 5 compatible regexes - docs"
+SUMMARY_pcre2test = "program for testing Perl-comatible regular expressions"
+SUMMARY_pcre2test-doc = "program for testing Perl-comatible regular expressions - docs"
+
+FILES_libpcre2-16 = "${libdir}/libpcre2-16.so.*"
+FILES_libpcre2-32 = "${libdir}/libpcre2-32.so.*"
+FILES_pcre2grep = "${bindir}/pcre2grep"
+FILES_pcre2grep-doc = "${mandir}/man1/pcre2grep.1"
+FILES_pcre2test = "${bindir}/pcre2test"
+FILES_pcre2test-doc = "${mandir}/man1/pcre2test.1"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libpcre/libpcre_8.41.bb b/poky/meta/recipes-support/libpcre/libpcre_8.41.bb
new file mode 100644
index 000000000..0187c08f5
--- /dev/null
+++ b/poky/meta/recipes-support/libpcre/libpcre_8.41.bb
@@ -0,0 +1,87 @@
+DESCRIPTION = "The PCRE library is a set of functions that implement regular \
+expression pattern matching using the same syntax and semantics as Perl 5. PCRE \
+has its own native API, as well as a set of wrapper functions that correspond \
+to the POSIX regular expression API."
+SUMMARY = "Perl Compatible Regular Expressions"
+HOMEPAGE = "http://www.pcre.org"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=60da32d84d067f53e22071c4ecb4384d"
+SRC_URI = "https://ftp.pcre.org/pub/pcre/pcre-${PV}.tar.bz2 \
+ file://pcre-cross.patch \
+ file://fix-pcre-name-collision.patch \
+ file://run-ptest \
+ file://Makefile \
+"
+
+SRC_URI[md5sum] = "c160d22723b1670447341b08c58981c1"
+SRC_URI[sha256sum] = "e62c7eac5ae7c0e7286db61ff82912e1c0b7a0c13706616e94a7dd729321b530"
+
+CVE_PRODUCT = "pcre"
+
+S = "${WORKDIR}/pcre-${PV}"
+
+PROVIDES += "pcre"
+DEPENDS += "bzip2 zlib"
+
+PACKAGECONFIG ??= "pcre8 unicode-properties"
+
+PACKAGECONFIG[pcre8] = "--enable-pcre8,--disable-pcre8"
+PACKAGECONFIG[pcre16] = "--enable-pcre16,--disable-pcre16"
+PACKAGECONFIG[pcre32] = "--enable-pcre32,--disable-pcre32"
+PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
+PACKAGECONFIG[unicode-properties] = "--enable-unicode-properties,--disable-unicode-properties"
+
+BINCONFIG = "${bindir}/pcre-config"
+
+inherit autotools binconfig-disabled ptest
+
+EXTRA_OECONF = "\
+ --enable-newline-is-lf \
+ --enable-rebuild-chartables \
+ --enable-utf \
+ --with-link-size=2 \
+ --with-match-limit=10000000 \
+"
+
+# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
+# set CFLAGS_FOR_BUILD, required for the libpcre build.
+BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
+CFLAGS += "-D_REENTRANT"
+CXXFLAGS_append_powerpc = " -lstdc++"
+
+export CCLD_FOR_BUILD ="${BUILD_CCLD}"
+
+PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
+
+SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions"
+SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API"
+SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes"
+SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
+SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
+SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
+
+FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
+FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
+FILES_pcregrep = "${bindir}/pcregrep"
+FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
+FILES_pcretest = "${bindir}/pcretest"
+FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ cp ${WORKDIR}/Makefile $t
+ cp -r ${S}/testdata $t
+ for i in pcre_stringpiece_unittest pcregrep pcretest; \
+ do cp ${B}/.libs/$i $t; \
+ done
+ for i in RunTest RunGrepTest test-driver; \
+ do cp ${S}/$i $t; \
+ done
+ # Skip the fr_FR locale test. If the locale fr_FR is found, it is tested.
+ # If not found, the test is skipped. The test program assumes fr_FR is non-UTF-8
+ # locale so the test fails if fr_FR is UTF-8 locale.
+ sed -i -e 's:do3=yes:do3=no:g' ${D}${PTEST_PATH}/RunTest
+}
diff --git a/poky/meta/recipes-support/libproxy/libproxy_0.4.15.bb b/poky/meta/recipes-support/libproxy/libproxy_0.4.15.bb
new file mode 100644
index 000000000..991c9d832
--- /dev/null
+++ b/poky/meta/recipes-support/libproxy/libproxy_0.4.15.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Library providing automatic proxy configuration management"
+HOMEPAGE = "https://github.com/libproxy/libproxy"
+BUGTRACKER = "https://github.com/libproxy/libproxy/issues"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://utils/proxy.c;beginline=1;endline=18;md5=55152a1006d7dafbef32baf9c30a99c0"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz"
+SRC_URI[md5sum] = "f6b1d2a1e17a99cd3debaae6d04ab152"
+SRC_URI[sha256sum] = "654db464120c9534654590b6683c7fa3887b3dad0ca1c4cd412af24fbfca6d4f"
+
+UPSTREAM_CHECK_URI = "https://github.com/libproxy/libproxy/releases"
+UPSTREAM_CHECK_REGEX = "libproxy-(?P<pver>.*)\.tar"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gnome', '', d)} gnome3"
+PACKAGECONFIG[gnome] = "-DWITH_GNOME=yes,-DWITH_GNOME=no,gconf"
+PACKAGECONFIG[gnome3] = "-DWITH_GNOME3=yes,-DWITH_GNOME3=no"
+
+EXTRA_OECMAKE += " \
+ -DWITH_KDE4=no \
+ -DWITH_MOZJS=no \
+ -DWITH_NM=no \
+ -DWITH_PERL=no \
+ -DWITH_PYTHON=no \
+ -DWITH_WEBKIT=no \
+ -DLIB_INSTALL_DIR=${libdir} \
+ -DLIBEXEC_INSTALL_DIR=${libexecdir} \
+"
+SECURITY_PIE_CFLAGS_remove = "-fPIE -pie"
+
+FILES_${PN} += "${libdir}/${BPN}/${PV}/modules"
diff --git a/poky/meta/recipes-support/libsoup/libsoup-2.4_2.60.3.bb b/poky/meta/recipes-support/libsoup/libsoup-2.4_2.60.3.bb
new file mode 100644
index 000000000..e2e7ff4aa
--- /dev/null
+++ b/poky/meta/recipes-support/libsoup/libsoup-2.4_2.60.3.bb
@@ -0,0 +1,35 @@
+SUMMARY = "An HTTP library implementation in C"
+HOMEPAGE = "https://wiki.gnome.org/Projects/libsoup"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome/libs"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 intltool-native"
+
+SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
+
+SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "4cf8937d161d3dd71a65f1684e317824"
+SRC_URI[sha256sum] = "1b0dc762f23abe4e0d29b77370e539fd35f31d8e8e0318d6ddccff395be68a22"
+
+S = "${WORKDIR}/libsoup-${PV}"
+
+inherit autotools gettext pkgconfig upstream-version-is-even gobject-introspection gtk-doc
+
+# libsoup-gnome is entirely deprecated and just stubs in 2.42 onwards. Disable by default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5"
+
+EXTRA_OECONF = "--disable-vala"
+
+# When built without gnome support, libsoup-2.4 will contain only one shared lib
+# and will therefore become subject to renaming by debian.bbclass. Prevent
+# renaming in order to keep the package name consistent regardless of whether
+# gnome support is enabled or disabled.
+DEBIAN_NOAUTONAME_${PN} = "1"
+
+# glib-networking is needed for SSL, proxies, etc.
+RRECOMMENDS_${PN} = "glib-networking"
diff --git a/poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch b/poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..2aeacb868
--- /dev/null
+++ b/poky/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: libunistring-0.9.4/lib/Makefile.gnulib
+===================================================================
+--- libunistring-0.9.4.orig/lib/Makefile.gnulib
++++ libunistring-0.9.4/lib/Makefile.gnulib
+@@ -380,7 +380,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch b/poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
new file mode 100644
index 000000000..9e8ce2270
--- /dev/null
+++ b/poky/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,56 @@
+From 30562065ba9e4c238e76100b5f9f0c5add0e635b Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 5 Dec 2017 09:30:36 +0200
+Subject: [PATCH] remove the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, libunistring will be built without
+iconv support and will cause guild-native configure fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+---
+ gnulib-m4/iconv.m4 | 23 -----------------------
+ 1 file changed, 23 deletions(-)
+
+diff --git a/gnulib-m4/iconv.m4 b/gnulib-m4/iconv.m4
+index b33ecd0..73b6aa1 100644
+--- a/gnulib-m4/iconv.m4
++++ b/gnulib-m4/iconv.m4
+@@ -165,29 +165,6 @@ AC_DEFUN([AM_ICONV_LINK],
+ }
+ }
+ #endif
+- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+- provided. */
+- {
+- /* Try standardized names. */
+- iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+- /* Try IRIX, OSF/1 names. */
+- iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+- /* Try AIX names. */
+- iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+- /* Try HP-UX names. */
+- iconv_t cd4 = iconv_open ("utf8", "eucJP");
+- if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+- && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+- result |= 16;
+- if (cd1 != (iconv_t)(-1))
+- iconv_close (cd1);
+- if (cd2 != (iconv_t)(-1))
+- iconv_close (cd2);
+- if (cd3 != (iconv_t)(-1))
+- iconv_close (cd3);
+- if (cd4 != (iconv_t)(-1))
+- iconv_close (cd4);
+- }
+ return result;
+ ]])],
+ [am_cv_func_iconv_works=yes], ,
+--
+2.4.0
+
diff --git a/poky/meta/recipes-support/libunistring/libunistring_0.9.9.bb b/poky/meta/recipes-support/libunistring/libunistring_0.9.9.bb
new file mode 100644
index 000000000..ab7cba522
--- /dev/null
+++ b/poky/meta/recipes-support/libunistring/libunistring_0.9.9.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Library for manipulating C and Unicode strings"
+
+DESCRIPTION = "Text files are nowadays usually encoded in Unicode, and may\
+ consist of very different scripts from Latin letters to Chinese Hanzi\
+ with many kinds of special characters accents, right-to-left writing\
+ marks, hyphens, Roman numbers, and much more. But the POSIX platform\
+ APIs for text do not contain adequate functions for dealing with\
+ particular properties of many Unicode characters. In fact, the POSIX\
+ APIs for text have several assumptions at their base which don't hold\
+ for Unicode text. This library provides functions for manipulating\
+ Unicode strings and for manipulating C strings according to the Unicode\
+ standard. This package contains documentation."
+
+HOMEPAGE = "http://www.gnu.org/software/libunistring/"
+SECTION = "devel"
+LICENSE = "LGPLv3+ | GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://README;beginline=45;endline=65;md5=08287d16ba8d839faed8d2dc14d7d6a5 \
+ file://doc/libunistring.texi;md5=efb80a3799a60f95feaf80661d4f204c \
+ "
+
+SRC_URI = "${GNU_MIRROR}/libunistring/libunistring-${PV}.tar.gz \
+ file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+"
+SRC_URI[md5sum] = "4f689e37e4c3bd67de5786aa51d98b13"
+SRC_URI[sha256sum] = "f5e90c08f9e5427ca3a2c0c53f19aa38b25c500913510ad25afef86448bea84a"
+
+inherit autotools texinfo
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libunwind/libunwind.inc b/poky/meta/recipes-support/libunwind/libunwind.inc
new file mode 100644
index 000000000..b9c532d3a
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind.inc
@@ -0,0 +1,23 @@
+SUMMARY = "Library for obtaining the call-chain of a program"
+DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
+HOMEPAGE = "http://www.nongnu.org/libunwind"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=3;md5=3fced11d6df719b47505837a51c16ae5"
+DEPENDS += "libatomic-ops"
+
+inherit autotools multilib_header
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
+PACKAGECONFIG[latexdocs] = "--enable-documentation, --disable-documentation, latex2man-native"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+EXTRA_OECONF_aarch64 = "--enable-debug-frame"
+
+SECURITY_LDFLAGS_append_libc-musl = " -lssp_nonshared -lssp"
+
+do_install_append () {
+ oe_multilib_header libunwind.h
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch b/poky/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch
new file mode 100644
index 000000000..8bcc252ba
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/0001-Fix-build-on-mips-musl.patch
@@ -0,0 +1,81 @@
+From e623c7703945a5eb6c9a30586ec5e23b2f7396f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 23 Mar 2016 06:08:59 +0000
+Subject: [PATCH] Fix build on mips/musl
+
+Do not include endian.h on musl it includes
+further headers which can not be compiled in __ASSEMBLER__
+ mode
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/coredump/_UCD_internal.h | 34 ++++++++++++++++++++++++++++++++++
+ src/mips/getcontext.S | 3 +--
+ 2 files changed, 35 insertions(+), 2 deletions(-)
+
+Index: git/src/coredump/_UCD_internal.h
+===================================================================
+--- git.orig/src/coredump/_UCD_internal.h
++++ git/src/coredump/_UCD_internal.h
+@@ -44,6 +44,41 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
+
+ #include "libunwind_i.h"
+
++#ifndef __GLIBC__
++#include <sys/reg.h>
++
++#define EF_REG0 6
++#define EF_REG1 7
++#define EF_REG2 8
++#define EF_REG3 9
++#define EF_REG4 10
++#define EF_REG5 11
++#define EF_REG6 12
++#define EF_REG7 13
++#define EF_REG8 14
++#define EF_REG9 15
++#define EF_REG10 16
++#define EF_REG11 17
++#define EF_REG12 18
++#define EF_REG13 19
++#define EF_REG14 20
++#define EF_REG15 21
++#define EF_REG16 22
++#define EF_REG17 23
++#define EF_REG18 24
++#define EF_REG19 25
++#define EF_REG20 26
++#define EF_REG21 27
++#define EF_REG22 28
++#define EF_REG23 29
++#define EF_REG24 30
++#define EF_REG25 31
++#define EF_REG28 34
++#define EF_REG29 35
++#define EF_REG30 36
++#define EF_REG31 37
++#endif
++
+
+ #if SIZEOF_OFF_T == 4
+ typedef uint32_t uoff_t;
+Index: git/src/mips/getcontext.S
+===================================================================
+--- git.orig/src/mips/getcontext.S
++++ git/src/mips/getcontext.S
+@@ -24,12 +24,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+ #include "offsets.h"
+-#include <endian.h>
+
+ .text
+
+ #if _MIPS_SIM == _ABIO32
+-# if __BYTE_ORDER == __BIG_ENDIAN
++# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+ # define OFFSET 4
+ # else
+ # define OFFSET 0
diff --git a/poky/meta/recipes-support/libunwind/libunwind/0001-add-knobs-to-disable-enable-tests.patch b/poky/meta/recipes-support/libunwind/libunwind/0001-add-knobs-to-disable-enable-tests.patch
new file mode 100644
index 000000000..673a5bb99
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/0001-add-knobs-to-disable-enable-tests.patch
@@ -0,0 +1,69 @@
+From 459e471fcc33d300f7bbcdaf3e0dc338d9dc15b9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Apr 2016 16:56:34 +0000
+Subject: [PATCH] add knobs to disable/enable tests
+
+Some tests do not compile on musl libc
+in general its good to have such a knob
+since not all builds may want to enable
+tests
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 6 +++++-
+ configure.ac | 12 ++++++++++--
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 6a3ed9e..0c29b3e 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -42,7 +42,11 @@ endif
+
+ nodist_include_HEADERS = include/libunwind-common.h
+
+-SUBDIRS = src tests
++SUBDIRS = src
++
++if CONFIG_TESTS
++SUBDIRS += tests
++endif
+
+ if CONFIG_DOCS
+ SUBDIRS += doc
+diff --git a/configure.ac b/configure.ac
+index 85d78f8..d362387 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -129,6 +129,10 @@ AC_ARG_ENABLE(documentation,
+ AS_HELP_STRING([--disable-documentation],[Disable generating the man pages]),,
+ [enable_documentation=yes])
+
++AC_ARG_ENABLE(tests,
++ AS_HELP_STRING([--disable-tests],[Disable building tests]),,
++ [enable_tests=yes])
++
+ AC_MSG_CHECKING([if we should build libunwind-setjmp])
+ AC_MSG_RESULT([$enable_setjmp])
+
+@@ -395,9 +399,13 @@ AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation = xyes])
+ if test "x$enable_documentation" = "xyes"; then
+ AC_CONFIG_FILES(doc/Makefile doc/common.tex)
+ fi
++AM_CONDITIONAL([CONFIG_TESTS], [test x$enable_tests = xyes])
++if test "x$enable_tests" = "xyes"; then
++ AC_CONFIG_FILES(tests/Makefile tests/check-namespace.sh)
++fi
++
+
+-AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh
+- include/libunwind-common.h
++AC_CONFIG_FILES(Makefile src/Makefile include/libunwind-common.h
+ include/libunwind.h include/tdep/libunwind_i.h)
+ AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc
+ src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch b/poky/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
new file mode 100644
index 000000000..9aed419a1
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/0001-backtrace-Use-only-with-glibc-and-uclibc.patch
@@ -0,0 +1,45 @@
+From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 06:44:07 +0000
+Subject: [PATCH] backtrace: Use only with glibc and uclibc
+
+backtrace API is glibc specific not linux specific
+so make it behave so.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tests/test-coredump-unwind.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+index 5254708..8767b42 100644
+--- a/tests/test-coredump-unwind.c
++++ b/tests/test-coredump-unwind.c
+@@ -57,7 +57,9 @@
+ #include <grp.h>
+
+ /* For SIGSEGV handler code */
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <sys/ucontext.h>
+
+ #include <libunwind-coredump.h>
+@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+ ip);
+
+ {
++#ifdef __GLIBC__
+ /* glibc extension */
+ void *array[50];
+ int size;
+ size = backtrace(array, 50);
+-#ifdef __linux__
+ backtrace_symbols_fd(array, size, 2);
+ #endif
+ }
+--
+2.6.4
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind/0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch b/poky/meta/recipes-support/libunwind/libunwind/0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch
new file mode 100644
index 000000000..ca0641f5a
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch
@@ -0,0 +1,248 @@
+From e0eea53c77fce8537c58a072b684043507987bcc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 9 Jul 2016 01:07:53 +0000
+Subject: [PATCH] ppc32: Consider ucontext mismatches between glibc and musl
+
+This helps in porting libunwind onto musl based systems
+ptrace.h change is required again an error that surfaces
+with musl
+
+/mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/asm/ptrace.h:31:8: error: redefinition of 'struct pt_regs'
+ struct pt_regs {
+ ^~~~~~~
+In file included from /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/sys/user.h:11:0,
+ from /mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/sys/procfs.h:9,
+ from ../../git/src/ptrace/_UPT_internal.h:40,
+ from ../../git/src/ptrace/_UPT_reg_offset.c:27:
+/mnt/oe/openembedded-core/build/tmp-musl/sysroots/qemuppc/usr/include/bits/user.h:1:8: note: originally defined here
+ struct pt_regs {
+ ^~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/ppc32/Ginit.c | 6 +-
+ src/ppc32/ucontext_i.h | 158 ++++++++++++++++++++++---------------------
+ src/ptrace/_UPT_reg_offset.c | 7 ++
+ 3 files changed, 92 insertions(+), 79 deletions(-)
+
+diff --git a/src/ppc32/Ginit.c b/src/ppc32/Ginit.c
+index f2e6e82..617aaa1 100644
+--- a/src/ppc32/Ginit.c
++++ b/src/ppc32/Ginit.c
+@@ -48,12 +48,12 @@ uc_addr (ucontext_t *uc, int reg)
+ void *addr;
+
+ if ((unsigned) (reg - UNW_PPC32_R0) < 32)
+- addr = &uc->uc_mcontext.uc_regs->gregs[reg - UNW_PPC32_R0];
++ addr = &uc->GET_UC_REGS->gregs[reg - UNW_PPC32_R0];
+
+ else
+ if ( ((unsigned) (reg - UNW_PPC32_F0) < 32) &&
+ ((unsigned) (reg - UNW_PPC32_F0) >= 0) )
+- addr = &uc->uc_mcontext.uc_regs->fpregs.fpregs[reg - UNW_PPC32_F0];
++ addr = &uc->GET_UC_REGS->fpregs.fpregs[reg - UNW_PPC32_F0];
+
+ else
+ {
+@@ -76,7 +76,7 @@ uc_addr (ucontext_t *uc, int reg)
+ default:
+ return NULL;
+ }
+- addr = &uc->uc_mcontext.uc_regs->gregs[gregs_idx];
++ addr = &uc->GET_UC_REGS->gregs[gregs_idx];
+ }
+ return addr;
+ }
+diff --git a/src/ppc32/ucontext_i.h b/src/ppc32/ucontext_i.h
+index c6ba806..b79f15c 100644
+--- a/src/ppc32/ucontext_i.h
++++ b/src/ppc32/ucontext_i.h
+@@ -46,83 +46,89 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ various structure members. */
+ static ucontext_t dmy_ctxt UNUSED;
+
+-#define UC_MCONTEXT_GREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[0] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[1] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[2] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[3] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[4] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[5] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[6] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[7] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[8] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[9] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[10] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[11] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[12] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[13] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[14] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[15] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[16] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[17] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[18] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[19] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[20] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[21] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[22] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[23] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[24] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[25] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[26] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[27] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[28] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[29] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[30] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[31] - (void *)&dmy_ctxt)
++#ifdef __GLIBC__
++#define GET_UC_REGS uc_mcontext.uc_regs
++#else
++#define GET_UC_REGS uc_regs
++#endif
++
++#define UC_MCONTEXT_GREGS_R0 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[0] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R1 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[1] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R2 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[2] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R3 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[3] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R4 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[4] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R5 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[5] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R6 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[6] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R7 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[7] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R8 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[8] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R9 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[9] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R10 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[10] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R11 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[11] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R12 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[12] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R13 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[13] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R14 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[14] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R15 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[15] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R16 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[16] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R17 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[17] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R18 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[18] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R19 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[19] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R20 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[20] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R21 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[21] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R22 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[22] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R23 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[23] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R24 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[24] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R25 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[25] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R26 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[26] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R27 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[27] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R28 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[28] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R29 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[29] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R30 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[30] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_R31 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[31] - (void *)&dmy_ctxt)
+
+-#define UC_MCONTEXT_GREGS_MSR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[MSR_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_ORIG_GPR3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[ORIG_GPR3_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_CTR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CTR_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_LINK ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[LINK_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_XER ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[XER_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_CCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[CCR_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_SOFTE ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[SOFTE_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_TRAP ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[TRAP_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_DAR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DAR_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[DSISR_IDX] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.uc_mcontext.uc_regs->gregs[RESULT_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_MSR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[MSR_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_ORIG_GPR3 ((void *)&dmy_ctxt.GET_UC_REGS->gregs[ORIG_GPR3_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_CTR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[CTR_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_LINK ((void *)&dmy_ctxt.GET_UC_REGS->gregs[LINK_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_XER ((void *)&dmy_ctxt.GET_UC_REGS->gregs[XER_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_CCR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[CCR_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_SOFTE ((void *)&dmy_ctxt.GET_UC_REGS->gregs[SOFTE_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_TRAP ((void *)&dmy_ctxt.GET_UC_REGS->gregs[TRAP_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_DAR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[DAR_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_DSISR ((void *)&dmy_ctxt.GET_UC_REGS->gregs[DSISR_IDX] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_GREGS_RESULT ((void *)&dmy_ctxt.GET_UC_REGS->gregs[RESULT_IDX] - (void *)&dmy_ctxt)
+
+-#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[0] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[1] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[2] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[3] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[4] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[5] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[6] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[7] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[8] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[9] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[10] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[11] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[12] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[13] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[14] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[15] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[16] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[17] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[18] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[19] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[20] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[21] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[22] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[23] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[24] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[25] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[26] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[27] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[28] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[29] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[30] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[31] - (void *)&dmy_ctxt)
+-#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.uc_mcontext.uc_regs->fpregs.fpregs[32] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R0 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[0] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R1 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[1] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R2 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[2] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R3 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[3] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R4 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[4] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R5 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[5] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R6 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[6] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R7 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[7] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R8 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[8] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R9 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[9] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R10 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[10] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R11 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[11] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R12 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[12] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R13 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[13] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R14 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[14] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R15 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[15] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R16 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[16] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R17 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[17] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R18 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[18] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R19 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[19] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R20 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[20] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R21 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[21] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R22 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[22] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R23 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[23] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R24 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[24] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R25 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[25] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R26 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[26] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R27 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[27] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R28 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[28] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R29 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[29] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R30 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[30] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_R31 ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[31] - (void *)&dmy_ctxt)
++#define UC_MCONTEXT_FREGS_FPSCR ((void *)&dmy_ctxt.GET_UC_REGS->fpregs.fpregs[32] - (void *)&dmy_ctxt)
+
+ #endif
+diff --git a/src/ptrace/_UPT_reg_offset.c b/src/ptrace/_UPT_reg_offset.c
+index 68461a2..fcc43f7 100644
+--- a/src/ptrace/_UPT_reg_offset.c
++++ b/src/ptrace/_UPT_reg_offset.c
+@@ -27,6 +27,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+ #include "_UPT_internal.h"
+
+ #include <stddef.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
++#include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+
+ #ifdef HAVE_ASM_PTRACE_OFFSETS_H
+ # include <asm/ptrace_offsets.h>
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch b/poky/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch
new file mode 100644
index 000000000..371013aaa
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/0001-x86-Stub-out-x86_local_resume.patch
@@ -0,0 +1,54 @@
+From f5df01655a4b76d4fe415747de581d94ac593e6a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 16:19:29 +0000
+Subject: [PATCH] x86: Stub out x86_local_resume()
+
+its purpose seems
+to be unwinding across signal handler boundaries, which cannot happen
+in correct programs anyway. Replacing the whole function with
+something like *(volatile char *)0=0; (i.e. crash), gets a working
+libunwind
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/x86/Gos-linux.c | 22 +---------------------
+ 1 file changed, 1 insertion(+), 21 deletions(-)
+
+diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c
+index 31f83ba..3aaa34e 100644
+--- a/src/x86/Gos-linux.c
++++ b/src/x86/Gos-linux.c
+@@ -281,27 +281,7 @@ x86_r_uc_addr (ucontext_t *uc, int reg)
+ HIDDEN int
+ x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
+ {
+- struct cursor *c = (struct cursor *) cursor;
+- ucontext_t *uc = c->uc;
+-
+- /* Ensure c->pi is up-to-date. On x86, it's relatively common to be
+- missing DWARF unwind info. We don't want to fail in that case,
+- because the frame-chain still would let us do a backtrace at
+- least. */
+- dwarf_make_proc_info (&c->dwarf);
+-
+- if (unlikely (c->sigcontext_format != X86_SCF_NONE))
+- {
+- struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
+-
+- Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc);
+- sigreturn (sc);
+- }
+- else
+- {
+- Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip);
+- setcontext (uc);
+- }
++ *(volatile char *)0=0;
+ return -UNW_EINVAL;
+ }
+ #endif
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch b/poky/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
new file mode 100644
index 000000000..c8faca472
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
@@ -0,0 +1,59 @@
+From 24484e80b3e329c9edee1995e102f8612eedb79c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Tue, 13 May 2014 23:32:27 +0200
+Subject: [PATCH] Add AO_REQUIRE_CAS to fix build on ARM < v6
+
+ARM earlier than ARMv6, such as ARMv4 and ARMv5 do not provide
+optimize atomic operations in libatomic_ops. Since libunwind is using
+such operations, it should define AO_REQUIRE_CAS before including
+<atomic_ops.h> so that libatomic_ops knows it should use emulated
+atomic operations instead (even though they are obviously a lot more
+expensive).
+
+Also, while real atomic operations are all inline functions and
+therefore linking against libatomic_ops was not required, the emulated
+atomic operations actually require linking against libatomic_ops, so
+the commented AC_CHECK_LIB test in acinclude.m4 is uncommented to make
+sure we link against libatomic_ops.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Pending
+Taken from:
+https://raw.githubusercontent.com/rdnetto/teapot-buildroot/master/package/libunwind/libunwind-02-Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch
+
+---
+ acinclude.m4 | 8 +-------
+ include/libunwind_i.h | 1 +
+ 2 files changed, 2 insertions(+), 7 deletions(-)
+
+Index: libunwind-1.2.1/acinclude.m4
+===================================================================
+--- libunwind-1.2.1.orig/acinclude.m4
++++ libunwind-1.2.1/acinclude.m4
+@@ -22,11 +22,5 @@ fi])
+ AC_DEFUN([CHECK_ATOMIC_OPS],
+ [dnl Check whether the system has the atomic_ops package installed.
+ AC_CHECK_HEADERS(atomic_ops.h)
+-#
+-# Don't link against libatomic_ops for now. We don't want libunwind
+-# to depend on libatomic_ops.so. Fortunately, none of the platforms
+-# we care about so far need libatomic_ops.a (everything is done via
+-# inline macros).
+-#
+-# AC_CHECK_LIB(atomic_ops, main)
++ AC_CHECK_LIB(atomic_ops, main)
+ ])
+Index: libunwind-1.2.1/include/libunwind_i.h
+===================================================================
+--- libunwind-1.2.1.orig/include/libunwind_i.h
++++ libunwind-1.2.1/include/libunwind_i.h
+@@ -116,6 +116,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
+ (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0)
+
+ #ifdef HAVE_ATOMIC_OPS_H
++# define AO_REQUIRE_CAS
+ # include <atomic_ops.h>
+ static inline int
+ cmpxchg_ptr (void *addr, void *old, void *new)
diff --git a/poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch b/poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch
new file mode 100644
index 000000000..32516464c
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/libunwind-1.1-x32.patch
@@ -0,0 +1,31 @@
+From 506bd37bd580d7382d7c58257dac4b1e502a887c Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 09:50:34 -0700
+Subject: [PATCH] Fix for X32
+
+Apply patch to fix the X32 build from https://github.com/sjnewbury/x32.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ src/x86_64/Gos-linux.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/x86_64/Gos-linux.c b/src/x86_64/Gos-linux.c
+index 9e1acfc..8169d5a 100644
+--- a/src/x86_64/Gos-linux.c
++++ b/src/x86_64/Gos-linux.c
+@@ -143,8 +143,8 @@ x86_64_sigreturn (unw_cursor_t *cursor)
+
+ Debug (8, "resuming at ip=%llx via sigreturn(%p)\n",
+ (unsigned long long) c->dwarf.ip, sc);
+- __asm__ __volatile__ ("mov %0, %%rsp;"
+- "mov %1, %%rax;"
++ __asm__ __volatile__ ("mov %q0, %%rsp;"
++ "mov %q1, %%rax;"
+ "syscall"
+ :: "r"(sc), "i"(SYS_rt_sigreturn)
+ : "memory");
+--
+2.8.0
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch b/poky/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch
new file mode 100644
index 000000000..79f63fd84
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind/musl-header-conflict.patch
@@ -0,0 +1,37 @@
+If you:
+
+TCLIBC=musl bitbake unwind
+TCLIBC=musl bitbake gcc-runtime -c cleansstate
+TCLIBC=musl bitbake gcc-runtime
+
+you will see libstdc++ fail to build due to finding libunwind's header file.
+
+Khem: "When we build any of gcc components they expect to use internal version
+and that works with glibc based gcc since the search headers first look into gcc
+headers, however with musl the gcc headers are searched after the standard
+headers ( which is by design the right thing )."
+
+This patch hacks around the issue by looking for a define used during gcc-runtime's
+build and skipping to the internal header in that case.
+
+[YOCTO #10129]
+
+RP 2016/8/18
+
+Upstream-Status: Inappropriate [really need to fix gcc]
+
+Index: git/include/unwind.h
+===================================================================
+--- git.orig/include/unwind.h
++++ git/include/unwind.h
+@@ -23,6 +23,10 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER L
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
++#ifdef _GLIBCXX_SHARED
++#include_next <unwind.h>
++#endif
++
+ #ifndef _UNWIND_H
+ #define _UNWIND_H
+
diff --git a/poky/meta/recipes-support/libunwind/libunwind_1.2.1.bb b/poky/meta/recipes-support/libunwind/libunwind_1.2.1.bb
new file mode 100644
index 000000000..37a762486
--- /dev/null
+++ b/poky/meta/recipes-support/libunwind/libunwind_1.2.1.bb
@@ -0,0 +1,23 @@
+require libunwind.inc
+
+SRC_URI[md5sum] = "06ba9e60d92fd6f55cd9dadb084df19e"
+SRC_URI[sha256sum] = "3f3ecb90e28cbe53fba7a4a27ccce7aad188d3210bb1964a923a731a27a75acb"
+
+SRC_URI = "http://download.savannah.nongnu.org/releases/libunwind/libunwind-${PV}.tar.gz \
+ file://Add-AO_REQUIRE_CAS-to-fix-build-on-ARM-v6.patch \
+ file://0001-backtrace-Use-only-with-glibc-and-uclibc.patch \
+ file://0001-x86-Stub-out-x86_local_resume.patch \
+ file://0001-Fix-build-on-mips-musl.patch \
+ file://0001-add-knobs-to-disable-enable-tests.patch \
+ file://0001-ppc32-Consider-ucontext-mismatches-between-glibc-and.patch \
+ file://libunwind-1.1-x32.patch \
+ "
+
+SRC_URI_append_libc-musl = " file://musl-header-conflict.patch"
+EXTRA_OECONF_append_libc-musl = " --disable-documentation --disable-tests "
+
+# http://errors.yoctoproject.org/Errors/Details/20487/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
diff --git a/poky/meta/recipes-support/liburcu/liburcu_0.10.1.bb b/poky/meta/recipes-support/liburcu/liburcu_0.10.1.bb
new file mode 100644
index 000000000..459c04a7a
--- /dev/null
+++ b/poky/meta/recipes-support/liburcu/liburcu_0.10.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Userspace RCU (read-copy-update) library"
+HOMEPAGE = "http://lttng.org/urcu"
+BUGTRACKER = "http://lttng.org/project/issues"
+
+LICENSE = "LGPLv2.1+ & MIT-style"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e548d28737289d75a8f1e01ba2fd7825 \
+ file://src/urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
+ file://include/urcu/uatomic/x86.h;beginline=4;endline=21;md5=58e50bbd8a2f073bb5500e6554af0d0b"
+
+SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+ "
+
+SRC_URI[md5sum] = "281a2f92fdc39c40ad6b76f6631fdbd7"
+SRC_URI[sha256sum] = "9c09220be4435dc27fcd22d291707b94b97f159e0c442fbcd60c168f8f79eb06"
+
+S = "${WORKDIR}/userspace-rcu-${PV}"
+inherit autotools
+
+CPPFLAGS_append_riscv64 = " -pthread -D_REENTRANT"
diff --git a/poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch b/poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch
new file mode 100644
index 000000000..b88440dec
--- /dev/null
+++ b/poky/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch
@@ -0,0 +1,30 @@
+From 340f911f9e3f4ff6b01682c5341c959060782af2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Apr 2015 19:18:45 -0700
+Subject: [PATCH] usb.h: Include sys/types.h
+
+We need the definitions for things like u_intX_t
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libusb/usb.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libusb/usb.h b/libusb/usb.h
+index 84e730f..caffae2 100644
+--- a/libusb/usb.h
++++ b/libusb/usb.h
+@@ -31,6 +31,8 @@
+
+ #include <dirent.h>
+
++#include <sys/types.h>
++
+ /*
+ * USB spec information
+ *
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb b/poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb
new file mode 100644
index 000000000..1ddbe238f
--- /dev/null
+++ b/poky/meta/recipes-support/libusb/libusb-compat_0.1.5.bb
@@ -0,0 +1,42 @@
+SUMMARY = "libusb-0.1 compatibility layer for libusb1"
+DESCRIPTION = "libusb-0.1 compatible layer for libusb1, a drop-in replacement \
+that aims to look, feel and behave exactly like libusb-0.1"
+HOMEPAGE = "http://www.libusb.org/"
+BUGTRACKER = "http://www.libusb.org/report"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f2ac5f3ac4835e8f91324a26a590a423"
+DEPENDS = "libusb1"
+
+# Few packages are known not to work with libusb-compat (e.g. libmtp-1.0.0),
+# so here libusb-0.1 is removed completely instead of adding virtual/libusb0.
+# Besides, libusb-0.1 uses a per 1ms polling that hurts a lot to power
+# consumption.
+PROVIDES = "libusb virtual/libusb0"
+BBCLASSEXTEND = "native nativesdk"
+
+PE = "1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-compat-${PV}.tar.bz2 \
+ file://0001-usb.h-Include-sys-types.h.patch \
+ "
+
+SRC_URI[md5sum] = "2780b6a758a1e2c2943bdbf7faf740e4"
+SRC_URI[sha256sum] = "404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/"
+UPSTREAM_CHECK_REGEX = "/libusb-compat-(?P<pver>(\d+[\.\-_]*)+)/$"
+
+BINCONFIG = "${bindir}/libusb-config"
+
+inherit autotools pkgconfig binconfig-disabled lib_package
+
+EXTRA_OECONF = "--libdir=${base_libdir}"
+
+do_install_append() {
+ install -d ${D}${libdir}
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+ fi
+}
diff --git a/poky/meta/recipes-support/libusb/libusb1/no-dll.patch b/poky/meta/recipes-support/libusb/libusb1/no-dll.patch
new file mode 100644
index 000000000..6e6bb83d1
--- /dev/null
+++ b/poky/meta/recipes-support/libusb/libusb1/no-dll.patch
@@ -0,0 +1,19 @@
+As all invokes all-recursive which uses sub-makes to invoke all-am, the
+resulting makefile wants to build libusb-1.0.la twice. In non-parallel builds
+the second attempt is skipped as the target already exists, but in highly
+parallel builds it's likely that two makes will be building libusb-1.0.la at the
+same time.
+
+Solve this by removing the explicit all target, which as libusb-1.0.dll isn't
+built under Linux is redundant anyway.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/libusb/Makefile.am b/libusb/Makefile.am
+index 0cab0a0..c880213 100644
+--- a/libusb/Makefile.am
++++ b/libusb/Makefile.am
+@@ -1,2 +0,0 @@
+-all: libusb-1.0.la libusb-1.0.dll
+-
diff --git a/poky/meta/recipes-support/libusb/libusb1_1.0.21.bb b/poky/meta/recipes-support/libusb/libusb1_1.0.21.bb
new file mode 100644
index 000000000..1fefd1475
--- /dev/null
+++ b/poky/meta/recipes-support/libusb/libusb1_1.0.21.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Userspace library to access USB (version 1.0)"
+HOMEPAGE = "http://libusb.sf.net"
+BUGTRACKER = "http://www.libusb.org/report"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
+ file://no-dll.patch \
+ "
+
+SRC_URI[md5sum] = "1da9ea3c27b3858fa85c5f4466003e44"
+SRC_URI[sha256sum] = "7dce9cce9a81194b7065ee912bcd55eeffebab694ea403ffb91b67db66b1824b"
+
+S = "${WORKDIR}/libusb-${PV}"
+
+inherit autotools pkgconfig
+
+# Don't configure udev by default since it will cause a circular
+# dependecy with udev package, which depends on libusb
+EXTRA_OECONF = "--libdir=${base_libdir} --disable-udev"
+
+do_install_append() {
+ install -d ${D}${libdir}
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+ fi
+}
+
+FILES_${PN} += "${base_libdir}/*.so.*"
+
+FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la"
diff --git a/poky/meta/recipes-support/libxslt/libxslt_1.1.32.bb b/poky/meta/recipes-support/libxslt/libxslt_1.1.32.bb
new file mode 100644
index 000000000..6a03f7769
--- /dev/null
+++ b/poky/meta/recipes-support/libxslt/libxslt_1.1.32.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GNOME XSLT library"
+HOMEPAGE = "http://xmlsoft.org/XSLT/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
+
+SECTION = "libs"
+DEPENDS = "libxml2"
+
+SRC_URI = "http://xmlsoft.org/sources/libxslt-${PV}.tar.gz"
+SRC_URI[md5sum] = "1fc72f98e98bf4443f1651165f3aa146"
+SRC_URI[sha256sum] = "526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460"
+
+UPSTREAM_CHECK_REGEX = "libxslt-(?P<pver>\d+(\.\d+)+)\.tar"
+
+S = "${WORKDIR}/libxslt-${PV}"
+
+BINCONFIG = "${bindir}/xslt-config"
+
+inherit autotools pkgconfig binconfig-disabled lib_package
+
+# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header
+do_configure_prepend () {
+ sed -i -e 's/ansidecl.h//' ${S}/configure.ac
+
+ # The timestamps in the 1.1.28 tarball are messed up causing this file to
+ # appear out of date. Touch it so that we don't try to regenerate it.
+ touch ${S}/doc/xsltproc.1
+}
+
+EXTRA_OECONF = "--without-python --without-debug --without-mem-debug --without-crypto"
+# older versions of this recipe had ${PN}-utils
+RPROVIDES_${PN}-bin += "${PN}-utils"
+RCONFLICTS_${PN}-bin += "${PN}-utils"
+RREPLACES_${PN}-bin += "${PN}-utils"
+
+
+do_install_append_class-native () {
+ create_wrapper ${D}/${bindir}/xsltproc XML_CATALOG_FILES=${sysconfdir}/xml/catalog.xml
+}
+
+FILES_${PN} += "${libdir}/libxslt-plugins"
+FILES_${PN}-dev += "${libdir}/xsltConf.sh"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb b/poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb
new file mode 100644
index 000000000..b167f031a
--- /dev/null
+++ b/poky/meta/recipes-support/libyaml/libyaml_0.1.7.bb
@@ -0,0 +1,20 @@
+SUMMARY = "LibYAML is a YAML 1.1 parser and emitter written in C."
+DESCRIPTION = "LibYAML is a C library for parsing and emitting data in YAML 1.1, \
+a human-readable data serialization format. "
+HOMEPAGE = "http://pyyaml.org/wiki/LibYAML"
+SECTION = "libs/devel"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=6015f088759b10e0bc2bf64898d4ae17"
+
+SRC_URI = "http://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz \
+ "
+
+SRC_URI[md5sum] = "1abf45bd3a96374fa55ca63b32f9f2f9"
+SRC_URI[sha256sum] = "8088e457264a98ba451a90b8661fcb4f9d6f478f7265d48322a196cec2480729"
+
+S = "${WORKDIR}/yaml-${PV}"
+
+inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/lz4/files/0001-tests-Makefile-don-t-use-LIBDIR-as-variable.patch b/poky/meta/recipes-support/lz4/files/0001-tests-Makefile-don-t-use-LIBDIR-as-variable.patch
new file mode 100644
index 000000000..00494e801
--- /dev/null
+++ b/poky/meta/recipes-support/lz4/files/0001-tests-Makefile-don-t-use-LIBDIR-as-variable.patch
@@ -0,0 +1,82 @@
+From d4768d9e29b805096a86aa13c0d30ee8215af4df Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 26 Jun 2017 12:07:09 +0300
+Subject: [PATCH] tests/Makefile: don't use LIBDIR as variable
+
+LIBDIR may be overriden with a environment variable: In this case make
+clean breaks. Use another variable name.
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Backport
+---
+ tests/Makefile | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index 97fa782..51dd038 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -32,7 +32,7 @@ DESTDIR ?=
+ PREFIX ?= /usr/local
+ BINDIR := $(PREFIX)/bin
+ MANDIR := $(PREFIX)/share/man/man1
+-LIBDIR := ../lib
++LZ4DIR := ../lib
+ PRGDIR := ../programs
+ VOID := /dev/null
+ TESTDIR := versionsTest
+@@ -43,7 +43,7 @@ CFLAGS += -g -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-e
+ -Wdeclaration-after-statement -Wstrict-prototypes \
+ -Wpointer-arith -Wstrict-aliasing=1
+ CFLAGS += $(MOREFLAGS)
+-CPPFLAGS:= -I$(LIBDIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
++CPPFLAGS:= -I$(LZ4DIR) -I$(PRGDIR) -DXXH_NAMESPACE=LZ4_
+ FLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
+
+
+@@ -79,31 +79,31 @@ lz4c32: # create a 32-bits version for 32/64 interop tests
+ $(MAKE) -C $(PRGDIR) clean $@ CFLAGS="-m32 $(CFLAGS)"
+ cp $(LZ4) $(LZ4)c32
+
+-fullbench : $(LIBDIR)/lz4.o $(LIBDIR)/lz4hc.o $(LIBDIR)/lz4frame.o $(LIBDIR)/xxhash.o fullbench.c
++fullbench : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/lz4frame.o $(LZ4DIR)/xxhash.o fullbench.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
+
+-fullbench-lib: fullbench.c $(LIBDIR)/xxhash.c
+- $(MAKE) -C $(LIBDIR) liblz4.a
+- $(CC) $(FLAGS) $^ -o $@$(EXT) $(LIBDIR)/liblz4.a
++fullbench-lib: fullbench.c $(LZ4DIR)/xxhash.c
++ $(MAKE) -C $(LZ4DIR) liblz4.a
++ $(CC) $(FLAGS) $^ -o $@$(EXT) $(LZ4DIR)/liblz4.a
+
+-fullbench-dll: fullbench.c $(LIBDIR)/xxhash.c
+- $(MAKE) -C $(LIBDIR) liblz4
+- $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LIBDIR)/dll/liblz4.dll
++fullbench-dll: fullbench.c $(LZ4DIR)/xxhash.c
++ $(MAKE) -C $(LZ4DIR) liblz4
++ $(CC) $(FLAGS) $^ -o $@$(EXT) -DLZ4_DLL_IMPORT=1 $(LZ4DIR)/dll/liblz4.dll
+
+-fuzzer : $(LIBDIR)/lz4.o $(LIBDIR)/lz4hc.o $(LIBDIR)/xxhash.o fuzzer.c
++fuzzer : $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o fuzzer.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
+
+-frametest: $(LIBDIR)/lz4frame.o $(LIBDIR)/lz4.o $(LIBDIR)/lz4hc.o $(LIBDIR)/xxhash.o frametest.c
++frametest: $(LZ4DIR)/lz4frame.o $(LZ4DIR)/lz4.o $(LZ4DIR)/lz4hc.o $(LZ4DIR)/xxhash.o frametest.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
+
+-fasttest: $(LIBDIR)/lz4.o fasttest.c
++fasttest: $(LZ4DIR)/lz4.o fasttest.c
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
+
+ datagen : $(PRGDIR)/datagen.c datagencli.c
+ $(CC) $(FLAGS) -I$(PRGDIR) $^ -o $@$(EXT)
+
+ clean:
+- @$(MAKE) -C $(LIBDIR) $@ > $(VOID)
++ @$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
+ @$(MAKE) -C $(PRGDIR) $@ > $(VOID)
+ @$(RM) core *.o *.test tmp* \
+ fullbench-dll$(EXT) fullbench-lib$(EXT) \
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/lz4/files/run-ptest b/poky/meta/recipes-support/lz4/files/run-ptest
new file mode 100644
index 000000000..d3bfc49f1
--- /dev/null
+++ b/poky/meta/recipes-support/lz4/files/run-ptest
@@ -0,0 +1,43 @@
+#!/bin/sh
+cd testsuite
+
+echo -n "---- test-lz4 ----"
+make -C tests test-lz4 > /dev/null 2>&1
+
+if [ $? -eq 0 ]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+echo -n "---- test-fasttest ----"
+make -C tests test-fasttest > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+echo -n "---- test-frametest ----"
+make -C tests test-frametest > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+echo -n "---- test-fullbench ----"
+make -C tests test-fullbench > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
+
+echo -n "---- test-fuzzer ----"
+make -C tests test-fuzzer > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo "PASS"
+else
+ echo "FAIL"
+fi
diff --git a/poky/meta/recipes-support/lz4/lz4_1.7.4.bb b/poky/meta/recipes-support/lz4/lz4_1.7.4.bb
new file mode 100644
index 000000000..86a1ab9ab
--- /dev/null
+++ b/poky/meta/recipes-support/lz4/lz4_1.7.4.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Extremely Fast Compression algorithm"
+DESCRIPTION = "LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems."
+
+LICENSE = "BSD | BSD-2-Clause | GPL-2.0"
+LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=ebc2ea4814a64de7708f1571904b32cc\
+ file://programs/COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://LICENSE;md5=7f2857d58beff6d04137bf9b09e5ffb6"
+
+PE = "1"
+
+SRCREV = "7bb64ff2b69a9f8367de9ab483cdadf42b4c1b65"
+
+SRC_URI = "git://github.com/lz4/lz4.git \
+ file://0001-tests-Makefile-don-t-use-LIBDIR-as-variable.patch \
+ file://run-ptest \
+"
+UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "PREFIX=${prefix} CC='${CC}' DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir}"
+
+do_install() {
+ oe_runmake install
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/lzo/lzo/0001-Add-pkgconfigdir-to-solve-the-undefine-error.patch b/poky/meta/recipes-support/lzo/lzo/0001-Add-pkgconfigdir-to-solve-the-undefine-error.patch
new file mode 100644
index 000000000..5235a15dc
--- /dev/null
+++ b/poky/meta/recipes-support/lzo/lzo/0001-Add-pkgconfigdir-to-solve-the-undefine-error.patch
@@ -0,0 +1,27 @@
+From e730bfd7c2d3a4b5f3605878599cb9b20d31b1fd Mon Sep 17 00:00:00 2001
+From: Fan Xin <fan.xin@jp.fujitsu.com>
+Date: Fri, 2 Jun 2017 11:52:25 +0900
+Subject: [PATCH] Add pkgconfigdir to solve the undefine error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index e4d383b..c75023d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -14,6 +14,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
+ LDADD = src/liblzo2.la
+ lib_LTLIBRARIES =
+ noinst_PROGRAMS =
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = lzo2.pc
+
+
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch b/poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
new file mode 100644
index 000000000..db3a70e80
--- /dev/null
+++ b/poky/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
@@ -0,0 +1,70 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Sun, 23 Nov 2014 22:50:33 +0000
+Subject: Use memcpy() instead of reinventing it
+
+gcc inlines memcpy() with results as fast as handwritten code (at
+least in my brief testing with lzop), and knows the alignment
+constraints for our architectures.
+
+Change suggested by Julian Taylor.
+
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ minilzo/minilzo.c | 14 ++++++++++++++
+ src/lzo_func.h | 14 ++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+
+diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c
+index ab2be5f..6913c2f 100644
+--- a/minilzo/minilzo.c
++++ b/minilzo/minilzo.c
+@@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+ lzo_uint16_t v;
+diff --git a/src/lzo_func.h b/src/lzo_func.h
+index dfaa676..1cc1b53 100644
+--- a/src/lzo_func.h
++++ b/src/lzo_func.h
+@@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+ if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+ LZO_BLOCK_END
+
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+ lzo_uint16_t v;
diff --git a/poky/meta/recipes-support/lzo/lzo/run-ptest b/poky/meta/recipes-support/lzo/lzo/run-ptest
new file mode 100644
index 000000000..6acb89fc1
--- /dev/null
+++ b/poky/meta/recipes-support/lzo/lzo/run-ptest
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+./lzotest -mavail -n10 -q /etc/services
+if [ $? -eq 0 ]; then
+ echo 'PASS: lzotest'
+else
+ echo 'FAIL: lzotest'
+fi
+LZOTEST=./lzotest /bin/sh -e "./check.sh" "/etc"
+./align
+if [ $? -eq 0 ]; then
+ echo 'PASS: align'
+else
+ echo 'FAIL: align'
+fi
+./chksum
+if [ $? -eq 0 ]; then
+ echo 'PASS: chksum'
+else
+ echo 'FAIL: chksum'
+fi
+./simple
+if [ $? -eq 0 ]; then
+ echo 'PASS: simple'
+else
+ echo 'FAIL: simple'
+fi
+./testmini
+if [ $? -eq 0 ]; then
+ echo 'PASS: testmini'
+else
+ echo 'FAIL: testmini'
+fi
diff --git a/poky/meta/recipes-support/lzo/lzo_2.10.bb b/poky/meta/recipes-support/lzo/lzo_2.10.bb
new file mode 100644
index 000000000..8eefec3cc
--- /dev/null
+++ b/poky/meta/recipes-support/lzo/lzo_2.10.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Lossless data compression library"
+HOMEPAGE = "http://www.oberhumer.com/opensource/lzo/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://src/lzo_init.c;beginline=5;endline=25;md5=9ae697ca01829b0a383c5d2d163e0108"
+
+SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
+ file://0001-Use-memcpy-instead-of-reinventing-it.patch \
+ file://0001-Add-pkgconfigdir-to-solve-the-undefine-error.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[md5sum] = "39d3f3f9c55c87b1e5d6888e1420f4b5"
+SRC_URI[sha256sum] = "c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072"
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-shared"
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ cp ${S}/util/check.sh $t
+ cp ${B}/minilzo/testmini $t
+ for i in tests/align tests/chksum lzotest/lzotest examples/simple
+ do cp ${B}/`dirname $i`/.libs/`basename $i` $t; \
+ done
+}
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch b/poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch
new file mode 100644
index 000000000..867b88b30
--- /dev/null
+++ b/poky/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch
@@ -0,0 +1,100 @@
+From ecccbcf66da53779d88e38e2af7f82eff8dde7f8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 10:35:47 -0700
+Subject: [PATCH] use static inlines as the external inline definition has
+ changed with gcc5
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/miniacc.h | 24 ++++++++----------------
+ 1 file changed, 8 insertions(+), 16 deletions(-)
+
+diff --git a/src/miniacc.h b/src/miniacc.h
+index 09e6f0c..cae98d1 100644
+--- a/src/miniacc.h
++++ b/src/miniacc.h
+@@ -2880,8 +2880,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE16)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -2890,8 +2889,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const
+ #define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE16)
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+ __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -2916,8 +2914,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE32)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -2926,8 +2923,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const
+ #define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE32)
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+ __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -3307,8 +3303,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE16)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -3317,8 +3312,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const
+ #define ACC_UA_GET_LE16(p) __ACC_UA_GET_LE16(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE16)
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+ __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -3343,8 +3337,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE32)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+ __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+ unsigned long v;
+ __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -3353,8 +3346,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const
+ #define ACC_UA_GET_LE32(p) __ACC_UA_GET_LE32(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE32)
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+ __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+ __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+--
+2.5.0
+
diff --git a/poky/meta/recipes-support/lzop/lzop/acinclude.m4 b/poky/meta/recipes-support/lzop/lzop/acinclude.m4
new file mode 100644
index 000000000..0029c19c7
--- /dev/null
+++ b/poky/meta/recipes-support/lzop/lzop/acinclude.m4
@@ -0,0 +1,390 @@
+
+AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
+AC_HEADER_TIME
+AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
+AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown ctime difftime fstat gettimeofday gmtime localtime longjmp lstat memcmp memcpy memmove memset mktime qsort raise setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
+])#
+
+
+AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int16)
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(__int64)
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ptrdiff_t)
+])#
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_ACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#include "acc/acc.h"
+#include "acc/acc_incd.h"
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+static void test_acc_compile_time_assert(void) {
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+}
+#undef NDEBUG
+#include <assert.h>
+static int test_acc_run_time_assert(int r) {
+#define ACCCHK_ASSERT(expr) assert(expr);
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])# mfx_ACC_ACCCHK
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_MINIACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#define ACC_WANT_ACC_INCD_H 1
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
+static void test_acc_compile_time_assert(void) {
+#include $2
+}
+
+#undef NDEBUG
+#include <assert.h>
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr) assert(expr);
+static int test_acc_run_time_assert(int r) {
+#include $2
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+ xpassed | xyes) ;;
+ *)
+ AC_MSG_NOTICE([])
+ AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+ AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+ AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+ AC_MSG_NOTICE([Thanks for your support.])
+ AC_MSG_NOTICE([])
+ AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl AS_EXIT
+ ;;
+esac
+])# mfx_MINIACC_ACCCHK
+
+
+
+# serial 1
+
+AC_DEFUN([mfx_PROG_CPPFLAGS], [
+AC_MSG_CHECKING([whether the C preprocessor needs special flags])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# include "your C preprocessor is broken 1"
+#elif (0xffffu == 0xfffffffful)
+# include "your C preprocessor is broken 2"
+#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
+# include "your C preprocessor is broken 3"
+#endif
+]], [[ ]]
+)])
+
+mfx_save_CPPFLAGS=$CPPFLAGS
+mfx_tmp=ERROR
+for mfx_arg in "" -no-cpp-precomp
+do
+ CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
+ _AC_COMPILE_IFELSE([],
+[mfx_tmp=$mfx_arg
+break])
+done
+CPPFLAGS=$mfx_save_CPPFLAGS
+rm -f conftest.$ac_ext conftest.$ac_objext
+case x$mfx_tmp in
+ x)
+ AC_MSG_RESULT([none needed]) ;;
+ xERROR)
+ AC_MSG_RESULT([ERROR])
+ AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
+ ;;
+ *)
+ AC_MSG_RESULT([$mfx_tmp])
+ CPPFLAGS="$mfx_tmp $CPPFLAGS"
+ ;;
+esac
+])# mfx_PROG_CPPFLAGS
+
+
+
+# serial 3
+
+AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
+AC_CACHE_CHECK([whether limits.h is sane],
+mfx_cv_header_sane_limits_h,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+# if defined(__APPLE__) && defined(__GNUC__)
+# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
+# else
+# include "your preprocessor is broken"
+# endif
+#endif
+#define MFX_0xffff 0xffff
+#define MFX_0xffffffffL 4294967295ul
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+# include "error CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX)
+# include "error UCHAR_MAX 1"
+#endif
+#if !defined(USHRT_MAX)
+# include "error USHRT_MAX 1"
+#endif
+#if !defined(UINT_MAX)
+# include "error UINT_MAX 1"
+#endif
+#if !defined(ULONG_MAX)
+# include "error ULONG_MAX 1"
+#endif
+#if !defined(SHRT_MAX)
+# include "error SHRT_MAX 1"
+#endif
+#if !defined(INT_MAX)
+# include "error INT_MAX 1"
+#endif
+#if !defined(LONG_MAX)
+# include "error LONG_MAX 1"
+#endif
+#if (UCHAR_MAX < 1)
+# include "error UCHAR_MAX 2"
+#endif
+#if (USHRT_MAX < 1)
+# include "error USHRT_MAX 2"
+#endif
+#if (UINT_MAX < 1)
+# include "error UINT_MAX 2"
+#endif
+#if (ULONG_MAX < 1)
+# include "error ULONG_MAX 2"
+#endif
+#if (UCHAR_MAX < 0xff)
+# include "error UCHAR_MAX 3"
+#endif
+#if (USHRT_MAX < MFX_0xffff)
+# include "error USHRT_MAX 3"
+#endif
+#if (UINT_MAX < MFX_0xffff)
+# include "error UINT_MAX 3"
+#endif
+#if (ULONG_MAX < MFX_0xffffffffL)
+# include "error ULONG_MAX 3"
+#endif
+#if (USHRT_MAX > UINT_MAX)
+# include "error USHRT_MAX vs UINT_MAX"
+#endif
+#if (UINT_MAX > ULONG_MAX)
+# include "error UINT_MAX vs ULONG_MAX"
+#endif
+]], [[
+#if (USHRT_MAX == MFX_0xffff)
+{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
+#elif (USHRT_MAX >= MFX_0xffff)
+{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
+#endif
+#if (UINT_MAX == MFX_0xffff)
+{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
+#elif (UINT_MAX >= MFX_0xffff)
+{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffff)
+{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
+#elif (ULONG_MAX >= MFX_0xffff)
+{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
+#endif
+#if (USHRT_MAX == MFX_0xffffffffL)
+{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
+#elif (USHRT_MAX >= MFX_0xffffffffL)
+{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
+#endif
+#if (UINT_MAX == MFX_0xffffffffL)
+{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
+#elif (UINT_MAX >= MFX_0xffffffffL)
+{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffffffffL)
+{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
+#elif (ULONG_MAX >= MFX_0xffffffffL)
+{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
+#endif
+]])],
+[mfx_cv_header_sane_limits_h=yes],
+[mfx_cv_header_sane_limits_h=no])])
+])
+
+# /***********************************************************************
+# // standard
+# ************************************************************************/
+
+AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+dnl more types which are not yet covered by ACC
+
+AC_DEFUN([mfx_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(intmax_t)
+AC_CHECK_SIZEOF(uintmax_t)
+AC_CHECK_SIZEOF(intptr_t)
+AC_CHECK_SIZEOF(uintptr_t)
+
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+
+AC_CHECK_SIZEOF(dev_t)
+AC_CHECK_SIZEOF(fpos_t)
+AC_CHECK_SIZEOF(mode_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(ssize_t)
+AC_CHECK_SIZEOF(time_t)
+])#
+
+
+
+AC_DEFUN([mfx_CHECK_LIB_WINMM], [
+if test "X$GCC" = Xyes; then
+case $host_os in
+cygwin* | mingw* | pw32*)
+ test "X$LIBS" != "X" && LIBS="$LIBS "
+ LIBS="${LIBS}-lwinmm" ;;
+*)
+ ;;
+esac
+fi
+])#
+
+#serial 6
+
+dnl From Paul Eggert.
+
+# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
+# if it exists.
+
+AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
+ [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
+ ac_cv_struct_st_mtim_nsec,
+ [ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_cv_struct_st_mtim_nsec=no
+ # tv_nsec -- the usual case
+ # _tv_nsec -- Solaris 2.6, if
+ # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
+ # && !defined __EXTENSIONS__)
+ # st__tim.tv_nsec -- UnixWare 2.1.2
+ for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
+ CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
+ [ac_cv_struct_st_mtim_nsec=$ac_val; break])
+ done
+ CPPFLAGS="$ac_save_CPPFLAGS"])
+
+ if test $ac_cv_struct_st_mtim_nsec != no; then
+ AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
+ [Define to be the nanoseconds member of struct stat's st_mtim,
+ if it exists.])
+ fi
+ ]
+)
diff --git a/poky/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch b/poky/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch
new file mode 100644
index 000000000..72b33970e
--- /dev/null
+++ b/poky/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch
@@ -0,0 +1,37 @@
+gcc-6 has additional errors e.g.
+
+./test.c:1:12: error: variably modified '__acc_cta' at file scope
+ extern int __acc_cta[1-2*!((1l << (8*8 -1)) < 0)];
+ ^~~~~~~~~
+
+This is rightly pointed out since that index is undefined
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+--- a/src/miniacc.h.orig 2016-02-10 16:09:23.247315866 +0100
++++ a/src/miniacc.h 2016-02-10 16:12:14.973297054 +0100
+@@ -4469,12 +4469,12 @@
+ #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+ #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #else
+- ACCCHK_ASSERT((1 << (8*SIZEOF_INT-1)) < 0)
++ ACCCHK_ASSERT((int)(1u << (8*SIZEOF_INT-1)) < 0)
+ #endif
+ ACCCHK_ASSERT((1u << (8*SIZEOF_INT-1)) > 0)
+ #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #else
+- ACCCHK_ASSERT((1l << (8*SIZEOF_LONG-1)) < 0)
++ ACCCHK_ASSERT((long)(1ul << (8*SIZEOF_LONG-1)) < 0)
+ #endif
+ ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
+ #if defined(acc_int16e_t)
+@@ -4703,7 +4703,7 @@
+ #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
+ #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+- ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
++ ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
+ #endif
+ #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
+ # pragma option pop
diff --git a/poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch b/poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch
new file mode 100644
index 000000000..739be8231
--- /dev/null
+++ b/poky/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch
@@ -0,0 +1,36 @@
+Fix get of FLAGS register in x32 ABI,
+
+x32 ABI requires to have 64-bit variable to store FLAGS register
+instead of size_t that is 32-bit variable, this fix operand
+type mismatch when try to pop previous pushf value.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Index: lzop-1.03/src/miniacc.h
+===================================================================
+--- lzop-1.03.orig/src/miniacc.h
++++ lzop-1.03/src/miniacc.h
+@@ -754,6 +754,9 @@
+ #elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+ # define ACC_ARCH_AMD64 1
+ # define ACC_INFO_ARCH "amd64"
++# if defined(__ILP32__)
++# define ACC_ARCH_AMD64_X32 1
++# endif
+ #elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+ # define ACC_ARCH_ARM 1
+ # define ACC_ARCH_ARM_THUMB 1
+@@ -6787,7 +6790,11 @@ ACCLIB_PUBLIC_NOINLINE(void, acc_debug_n
+ ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_query) (void)
+ {
+ #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
++# if defined(ACC_ARCH_AMD64_X32)
++ unsigned long long r;
++# else
+ size_t r;
++# endif
+ __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : : __ACC_ASM_CLOBBER);
+ return (int)(r >> 18) & 1;
+ #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
diff --git a/poky/meta/recipes-support/lzop/lzop_1.03.bb b/poky/meta/recipes-support/lzop/lzop_1.03.bb
new file mode 100644
index 000000000..6f09002f5
--- /dev/null
+++ b/poky/meta/recipes-support/lzop/lzop_1.03.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Real-time file compressor"
+DESCRIPTION = "lzop is a compression utility which is designed to be a companion to gzip. \n\
+It is based on the LZO data compression library and its main advantages over \n\
+gzip are much higher compression and decompression speed at the cost of some \n\
+compression ratio. The lzop compression utility was designed with the goals \n\
+of reliability, speed, portability and with reasonable drop-in compatibility \n\
+to gzip."
+DEPENDS += "lzo"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dfeaf3dc4beef4f5a7bdbc35b197f39e \
+ file://src/lzop.c;beginline=5;endline=21;md5=6797bd3ed0a1a49327b7ebf9366ebd86"
+
+SRC_URI = "http://www.lzop.org/download/${BP}.tar.gz \
+ file://acinclude.m4 \
+ file://x32_abi_miniacc_h.patch \
+ file://0001-use-static-inlines-as-the-external-inline-definition.patch \
+ file://lzop-1.03-gcc6.patch \
+ "
+SRC_URI[md5sum] = "006c5e27fb78cdd14a628fdfa5aa1905"
+SRC_URI[sha256sum] = "c1425b8c77d49f5a679d5a126c90ea6ad99585a55e335a613cae59e909dbb2c9"
+
+inherit autotools
+
+do_configure_prepend () {
+ install -Dm 0644 ${WORKDIR}/acinclude.m4 ${S}/acinclude.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/mpfr/mpfr/long-long-thumb.patch b/poky/meta/recipes-support/mpfr/mpfr/long-long-thumb.patch
new file mode 100644
index 000000000..ca7100eb2
--- /dev/null
+++ b/poky/meta/recipes-support/mpfr/mpfr/long-long-thumb.patch
@@ -0,0 +1,39 @@
+From 84021b1e236508169be65e802a9c0a25fc9a8827 Mon Sep 17 00:00:00 2001
+From: Phil Blundell <philb@gnu.org>
+Date: Mon, 27 Oct 2008 22:26:35 +0000
+Subject: [PATCH] mpfr: crusade against inline assembler
+
+Without this, build fails for thumb:
+| {standard input}: Assembler messages:
+| {standard input}:199: Error: selected processor does not support Thumb mode `umull sl,r0,r2,r1'
+| {standard input}:214: Error: selected processor does not support Thumb mode `umull sl,r2,r1,fp'
+| {standard input}:219: Error: instruction not supported in Thumb16 mode -- `adds fp,r0,sl'
+| {standard input}:220: Error: unshifted register required -- `adc r2,r2,#0'
+| {standard input}:235: Error: selected processor does not support Thumb mode `umull r0,sl,r1,r3'
+| {standard input}:244: Error: selected processor does not support Thumb mode `umull fp,ip,r1,r3'
+| {standard input}:253: Error: instruction not supported in Thumb16 mode -- `adds r3,sl,fp'
+| {standard input}:254: Error: unshifted register required -- `adc ip,ip,#0'
+| {standard input}:259: Error: instruction not supported in Thumb16 mode -- `adds sl,r1,r0'
+| {standard input}:642: Error: selected processor does not support Thumb mode `umull r0,r2,r3,r1'
+| ../arm-oe-linux-gnueabi-libtool --tag=CC --mode=compile arm-oe-linux-gnueabi-gcc -march=armv5te -mthumb -mthumb-interwork -mtune=xscale --sysroot=/OE/shr-core/tmp-eglibc/sysroots/spitz -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_LOCALE_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_STDINT_H=1 -DHAVE_VA_COPY=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LONG_LONG=1 -DHAVE_INTMAX_T=1 -DMPFR_HAVE_INTMAX_MAX=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_ROUND=1 -DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_NEARBYINT=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ATTRIBUTE_MODE=1 -DHAVE___GMPN_ROOTREM=1 -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1 -I. -O2 -pipe -g -feliminate-unused-debug-types -ffloat-store -c -o pow.lo pow.c
+| {standard input}:1154: Error: selected processor does not support Thumb mode `umull r0,r1,sl,ip'
+| {standard input}:1166: Error: selected processor does not support Thumb mode `umull r3,r2,ip,r0'
+| {standard input}:1171: Error: instruction not supported in Thumb16 mode -- `adds r0,r1,r3'
+| {standard input}:1172: Error: unshifted register required -- `adc r2,r2,#0'
+| make[2]: *** [mul.lo] Error 1
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Pending
+
+--- mpfr.old/src/mpfr-longlong.h 2008-01-01 03:29:09.000000000 +0000
++++ mpfr/src/mpfr-longlong.h 2008-10-27 21:46:44.000000000 +0000
+@@ -406,7 +406,7 @@
+ "rIJ" ((USItype) (bl)))
+ #endif
+
+-#if defined (__arm__) && W_TYPE_SIZE == 32
++#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined(__thumb__)
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3" \
+ : "=r" (sh), "=&r" (sl) \
diff --git a/poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb b/poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb
new file mode 100644
index 000000000..a78c0bd48
--- /dev/null
+++ b/poky/meta/recipes-support/mpfr/mpfr_3.1.5.bb
@@ -0,0 +1,20 @@
+SUMMARY = "C library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE = "http://www.mpfr.org/"
+LICENSE = "LGPLv3+"
+SECTION = "devel"
+
+inherit autotools texinfo
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6"
+DEPENDS = "gmp"
+
+SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz \
+ file://long-long-thumb.patch \
+ "
+SRC_URI[md5sum] = "c4ac246cf9795a4491e7766002cd528f"
+SRC_URI[sha256sum] = "015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc"
+
+UPSTREAM_CHECK_URI = "http://www.mpfr.org/mpfr-current/"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/nettle/nettle-3.4/Add-target-to-only-build-tests-not-run-them.patch b/poky/meta/recipes-support/nettle/nettle-3.4/Add-target-to-only-build-tests-not-run-them.patch
new file mode 100644
index 000000000..c007060ee
--- /dev/null
+++ b/poky/meta/recipes-support/nettle/nettle-3.4/Add-target-to-only-build-tests-not-run-them.patch
@@ -0,0 +1,38 @@
+Add target to only build tests (not run them)
+
+Not sending upstream as this is only a start of a solution to
+installable tests: It's useful for us already as is.
+
+Upstream-Status: Inappropriate [not a complete solution]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Refactored for 3.4
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: nettle-3.4/Makefile.in
+===================================================================
+--- nettle-3.4.orig/Makefile.in
++++ nettle-3.4/Makefile.in
+@@ -55,6 +55,9 @@ clean distclean mostlyclean maintainer-c
+ echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
+ $(MAKE) $@-here
+
++buildtest:
++ echo "Making $@ in testsuite" ; (cd testsuite && $(MAKE) $@)
++
+ check-here:
+ true
+
+Index: nettle-3.4/testsuite/Makefile.in
+===================================================================
+--- nettle-3.4.orig/testsuite/Makefile.in
++++ nettle-3.4/testsuite/Makefile.in
+@@ -131,6 +131,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$
+ # data.
+ VALGRIND = valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes @IF_ASM@ --partial-loads-ok=yes
+
++buildtest: $(TS_ALL)
++
+ # The PATH update is for windows dlls, DYLD_LIBRARY_PATH is for OSX.
+ check: $(TS_ALL)
+ LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" DYLD_LIBRARY_PATH=../.lib \
diff --git a/poky/meta/recipes-support/nettle/nettle-3.4/check-header-files-of-openssl-only-if-enable_.patch b/poky/meta/recipes-support/nettle/nettle-3.4/check-header-files-of-openssl-only-if-enable_.patch
new file mode 100644
index 000000000..d5f266681
--- /dev/null
+++ b/poky/meta/recipes-support/nettle/nettle-3.4/check-header-files-of-openssl-only-if-enable_.patch
@@ -0,0 +1,36 @@
+From ffee6b5f6204a0210f717968ec6ce514d70acca1 Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Fri, 9 Dec 2016 15:23:17 +0800
+Subject: [PATCH] nettle: check header files of openssl only if
+ 'enable_openssl=yes'.
+
+The original configure script checks openssl header files to generate
+config.h even if 'enable_openssl' is not set to yes, this made inconsistent
+building for nettle.
+
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+
+refactored for 3.4. pending not in as of 3.4
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: nettle-3.4/configure.ac
+===================================================================
+--- nettle-3.4.orig/configure.ac
++++ nettle-3.4/configure.ac
+@@ -185,9 +185,11 @@ AC_HEADER_TIME
+ AC_CHECK_SIZEOF(long)
+ AC_CHECK_SIZEOF(size_t)
+
+-AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],,
+-[enable_openssl=no
+- break])
++if test "x$enable_openssl" = "xyes"; then
++ AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],,
++ [enable_openssl=no
++ break])
++fi
+
+ # For use by the testsuite
+ AC_CHECK_HEADERS([valgrind/memcheck.h])
diff --git a/poky/meta/recipes-support/nettle/nettle-3.4/dlopen-test.patch b/poky/meta/recipes-support/nettle/nettle-3.4/dlopen-test.patch
new file mode 100644
index 000000000..c4f0b7ea1
--- /dev/null
+++ b/poky/meta/recipes-support/nettle/nettle-3.4/dlopen-test.patch
@@ -0,0 +1,20 @@
+Replace relative path of libnettle.so with absolute path so the test
+program can find it.
+Relative paths are not suitable, as the folder strucure for ptest
+is different from the one expected by the nettle testsuite.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+--- a/testsuite/dlopen-test.c 2016-10-01 00:28:38.000000000 -0700
++++ b/testsuite/dlopen-test.c 2017-10-13 11:08:57.227572860 -0700
+@@ -9,7 +9,7 @@
+ main (int argc UNUSED, char **argv UNUSED)
+ {
+ #if HAVE_LIBDL
+- void *handle = dlopen ("../libnettle.so", RTLD_NOW);
++ void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
+ int (*get_version)(void);
+ if (!handle)
+ {
diff --git a/poky/meta/recipes-support/nettle/nettle-3.4/run-ptest b/poky/meta/recipes-support/nettle/nettle-3.4/run-ptest
new file mode 100644
index 000000000..b90bed66d
--- /dev/null
+++ b/poky/meta/recipes-support/nettle/nettle-3.4/run-ptest
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+cd testsuite
+
+failed=0
+all=0
+
+for f in *-test; do
+ if [ "$f" = "sha1-huge-test" ] ; then
+ echo "SKIP: $f (skipped for ludicrous run time)"
+ continue
+ fi
+
+ "./$f"
+ case "$?" in
+ 0)
+ echo "PASS: $f"
+ all=$((all + 1))
+ ;;
+ 77)
+ echo "SKIP: $f"
+ ;;
+ *)
+ echo "FAIL: $f"
+ failed=$((failed + 1))
+ all=$((all + 1))
+ ;;
+ esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+ echo "All $all tests passed"
+else
+ echo "$failed of $all tests failed"
+fi
+
diff --git a/poky/meta/recipes-support/nettle/nettle_3.4.bb b/poky/meta/recipes-support/nettle/nettle_3.4.bb
new file mode 100644
index 000000000..7a3cc654c
--- /dev/null
+++ b/poky/meta/recipes-support/nettle/nettle_3.4.bb
@@ -0,0 +1,47 @@
+SUMMARY = "A low level cryptographic library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/"
+SECTION = "libs"
+LICENSE = "LGPLv3+ | GPLv2+"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \
+ file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e"
+
+DEPENDS += "gmp"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://Add-target-to-only-build-tests-not-run-them.patch \
+ file://run-ptest \
+ file://check-header-files-of-openssl-only-if-enable_.patch \
+ "
+
+SRC_URI_append_class-target = "\
+ file://dlopen-test.patch \
+ "
+
+SRC_URI[md5sum] = "dc0f13028264992f58e67b4e8915f53d"
+SRC_URI[sha256sum] = "ae7a42df026550b85daca8389b6a60ba6313b0567f374392e54918588a411e94"
+
+UPSTREAM_CHECK_REGEX = "nettle-(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit autotools ptest
+
+EXTRA_AUTORECONF += "--exclude=aclocal"
+
+EXTRA_OECONF = "--disable-openssl"
+
+do_compile_ptest() {
+ oe_runmake buildtest
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/testsuite/
+ install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/
+ install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
+ # tools can be found in PATH, not in ../tools/
+ sed -i -e 's|../tools/||' ${D}${PTEST_PATH}/testsuite/*-test
+ install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/npth/npth/pkgconfig.patch b/poky/meta/recipes-support/npth/npth/pkgconfig.patch
new file mode 100644
index 000000000..b6a12e730
--- /dev/null
+++ b/poky/meta/recipes-support/npth/npth/pkgconfig.patch
@@ -0,0 +1,49 @@
+Added npth pkgconfig file
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: npth-1.1/src/npth.pc.in
+===================================================================
+--- /dev/null
++++ npth-1.1/src/npth.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: npth
++Description: a new portable posix threading library
++Version: @VERSION@
++Libs: -L${libdir} -lnpth -lpthread
++Cflags: -I${includedir}
+Index: npth-1.1/src/Makefile.am
+===================================================================
+--- npth-1.1.orig/src/Makefile.am
++++ npth-1.1/src/Makefile.am
+@@ -27,8 +27,10 @@
+ # License along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+ ## Process this file with automake to produce Makefile.in
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = npth.pc
+
+-EXTRA_DIST = libnpth.vers
++EXTRA_DIST = libnpth.vers npth.pc
+ # versioninfo.rc.in
+ nodist_include_HEADERS = npth.h
+
+Index: npth-1.1/configure.ac
+===================================================================
+--- npth-1.1.orig/configure.ac
++++ npth-1.1/configure.ac
+@@ -337,6 +337,7 @@ src/Makefile
+ w32/Makefile
+ tests/Makefile])
+ AC_CONFIG_FILES(npth-config, chmod +x npth-config)
++AC_CONFIG_FILES([src/npth.pc])
+ AC_OUTPUT
+
+ echo "
diff --git a/poky/meta/recipes-support/npth/npth_1.5.bb b/poky/meta/recipes-support/npth/npth_1.5.bb
new file mode 100644
index 000000000..e7db6ae1b
--- /dev/null
+++ b/poky/meta/recipes-support/npth/npth_1.5.bb
@@ -0,0 +1,23 @@
+SUMMARY = "New GNU Portable Threads library"
+HOMEPAGE = "http://www.gnupg.org/software/pth/"
+SECTION = "libs"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "\
+ file://COPYING.LIB;md5=2caced0b25dfefd4c601d92bd15116de\
+ "
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/npth/npth-${PV}.tar.bz2 \
+ file://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "9ba2dc4302d2f32c66737c43ed191b1b"
+SRC_URI[sha256sum] = "294a690c1f537b92ed829d867bee537e46be93fbd60b16c04630fbbfcd9db3c2"
+
+BINCONFIG = "${bindir}/npth-config"
+
+inherit autotools binconfig-disabled
+
+FILES_${PN} = "${libdir}/libnpth.so.*"
+FILES_${PN}-dev += "${bindir}/npth-config"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch b/poky/meta/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch
new file mode 100644
index 000000000..f3cd67002
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch
@@ -0,0 +1,31 @@
+From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 18 Sep 2017 17:22:43 -0700
+Subject: [PATCH] md: Fix build with musl
+
+The MIPS specific header <sgidefs.h> is not provided by musl
+linux kernel headers provide <asm/sgidefs.h> which has same definitions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ pr/include/md/_linux.cfg | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
+index 640b19c..31296a8 100644
+--- a/pr/include/md/_linux.cfg
++++ b/pr/include/md/_linux.cfg
+@@ -499,7 +499,7 @@
+ #elif defined(__mips__)
+
+ /* For _ABI64 */
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+
+ #ifdef __MIPSEB__
+ #define IS_BIG_ENDIAN 1
+--
+2.14.1
+
diff --git a/poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch b/poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch
new file mode 100644
index 000000000..23228067e
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/0002-Add-nios2-support.patch
@@ -0,0 +1,105 @@
+From 95bda64fb4cf1825fea745e918cfe8202843f0ba Mon Sep 17 00:00:00 2001
+From: Marek Vasut <marex@denx.de>
+Date: Sat, 30 Jan 2016 07:18:02 +0100
+Subject: [PATCH] Add nios2 support
+
+Add support for the nios2 CPU.
+
+Signed-off-by: Marek Vasut <marex@denx.de>
+Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1244421 ]
+---
+ nspr/pr/include/md/_linux.cfg | 45 +++++++++++++++++++++++++++++++++++++++++++
+ nspr/pr/include/md/_linux.h | 14 ++++++++++++++
+ 2 files changed, 59 insertions(+)
+
+diff --git a/pr/include/md/_linux.cfg b/nspr/pr/include/md/_linux.cfg
+index 8cbf0cb..150676b 100644
+--- a/pr/include/md/_linux.cfg
++++ b/pr/include/md/_linux.cfg
+@@ -972,6 +972,51 @@
+ #define PR_BYTES_PER_WORD_LOG2 2
+ #define PR_BYTES_PER_DWORD_LOG2 3
+
++#elif defined(__nios2__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE 1
++#define PR_BYTES_PER_SHORT 2
++#define PR_BYTES_PER_INT 4
++#define PR_BYTES_PER_INT64 8
++#define PR_BYTES_PER_LONG 4
++#define PR_BYTES_PER_FLOAT 4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD 4
++#define PR_BYTES_PER_DWORD 8
++
++#define PR_BITS_PER_BYTE 8
++#define PR_BITS_PER_SHORT 16
++#define PR_BITS_PER_INT 32
++#define PR_BITS_PER_INT64 64
++#define PR_BITS_PER_LONG 32
++#define PR_BITS_PER_FLOAT 32
++#define PR_BITS_PER_DOUBLE 64
++#define PR_BITS_PER_WORD 32
++
++#define PR_BITS_PER_BYTE_LOG2 3
++#define PR_BITS_PER_SHORT_LOG2 4
++#define PR_BITS_PER_INT_LOG2 5
++#define PR_BITS_PER_INT64_LOG2 6
++#define PR_BITS_PER_LONG_LOG2 5
++#define PR_BITS_PER_FLOAT_LOG2 5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2 5
++
++#define PR_ALIGN_OF_SHORT 2
++#define PR_ALIGN_OF_INT 4
++#define PR_ALIGN_OF_LONG 4
++#define PR_ALIGN_OF_INT64 4
++#define PR_ALIGN_OF_FLOAT 4
++#define PR_ALIGN_OF_DOUBLE 4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD 4
++
++#define PR_BYTES_PER_WORD_LOG2 2
++#define PR_BYTES_PER_DWORD_LOG2 3
++
+ #elif defined(__or1k__)
+
+ #undef IS_LITTLE_ENDIAN
+diff --git a/pr/include/md/_linux.h b/nspr/pr/include/md/_linux.h
+index d378db5..18260be 100644
+--- a/pr/include/md/_linux.h
++++ b/pr/include/md/_linux.h
+@@ -55,6 +55,8 @@
+ #define _PR_SI_ARCHITECTURE "avr32"
+ #elif defined(__m32r__)
+ #define _PR_SI_ARCHITECTURE "m32r"
++#elif defined(__nios2__)
++#define _PR_SI_ARCHITECTURE "nios2"
+ #elif defined(__or1k__)
+ #define _PR_SI_ARCHITECTURE "or1k"
+ #else
+@@ -125,6 +127,18 @@ extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval);
+ #define _MD_ATOMIC_SET _PR_x86_64_AtomicSet
+ #endif
+
++#if defined(__nios2__)
++#if defined(__GNUC__)
++/* Use GCC built-in functions */
++#define _PR_HAVE_ATOMIC_OPS
++#define _MD_INIT_ATOMIC()
++#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
++#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
++#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)
++#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
++#endif
++#endif
++
+ #if defined(__or1k__)
+ #if defined(__GNUC__)
+ /* Use GCC built-in functions */
+--
+2.7.0.rc3
+
diff --git a/poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch b/poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch
new file mode 100644
index 000000000..f12acc854
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch
@@ -0,0 +1,52 @@
+Fix build failure on x86_64
+
+When the target_cpu is x86_64, we should assume that the pkg uses 64bit,
+only if USE_N32 is set, we can assume that the pkg uses 32bit. It used a
+opposite logic before.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ configure.in | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+Index: nspr/configure.in
+===================================================================
+--- nspr.orig/configure.in
++++ nspr/configure.in
+@@ -1875,28 +1875,24 @@ tools are selected during the Xcode/Deve
+ PR_MD_ASFILES=os_Linux_ia64.s
+ ;;
+ x86_64)
+- if test -n "$USE_64"; then
+- PR_MD_ASFILES=os_Linux_x86_64.s
+- elif test -n "$USE_X32"; then
++ if test -n "$USE_X32"; then
++ AC_DEFINE(i386)
+ PR_MD_ASFILES=os_Linux_x86_64.s
+ CC="$CC -mx32"
+ CXX="$CXX -mx32"
+ else
+- AC_DEFINE(i386)
+- PR_MD_ASFILES=os_Linux_x86.s
+- CC="$CC -m32"
+- CXX="$CXX -m32"
++ PR_MD_ASFILES=os_Linux_x86_64.s
+ fi
+ ;;
+ ppc|powerpc)
+ PR_MD_ASFILES=os_Linux_ppc.s
+ ;;
+ powerpc64)
+- if test -n "$USE_64"; then
++ if test -n "$USE_N32"; then
++ PR_MD_ASFILES=os_Linux_ppc.s
++ else
+ CC="$CC -m64"
+ CXX="$CXX -m64"
+- else
+- PR_MD_ASFILES=os_Linux_ppc.s
+ fi
+ ;;
+ esac
diff --git a/poky/meta/recipes-support/nspr/nspr/nspr.pc.in b/poky/meta/recipes-support/nspr/nspr/nspr.pc.in
new file mode 100644
index 000000000..d74caabe4
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/nspr.pc.in
@@ -0,0 +1,11 @@
+os_libs=-lpthread -ldl
+prefix=OEPREFIX
+exec_prefix=OEEXECPREFIX
+libdir=OELIBDIR
+includedir=OEINCDIR
+
+Name: NSPR
+Description: The Netscape Portable Runtime
+Version: NSPRVERSION
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
+Cflags:
diff --git a/poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch b/poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch
new file mode 100644
index 000000000..ecc6d3187
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch
@@ -0,0 +1,26 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date: Thu Feb 9 00:03:38 2012 +0200
+
+Avoid QA warnings by removing hardcoded rpath from binaries.
+
+[...]
+WARNING: QA Issue: package nspr contains bad RPATH {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/nspr-4.8.9/mozilla/nsprpub/pr/tests/../../dist/lib
+in file {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/packages-split/nspr/usr/lib/nspr/tests/multiwait
+[...]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: nspr/pr/tests/Makefile.in
+===================================================================
+--- nspr.orig/pr/tests/Makefile.in
++++ nspr/pr/tests/Makefile.in
+@@ -315,7 +315,7 @@ ifeq ($(OS_ARCH), SunOS)
+ endif # SunOS
+
+ ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
+- LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
++ LDOPTS += -Xlinker
+ ifeq ($(USE_PTHREADS),1)
+ EXTRA_LIBS = -lpthread
+ endif
diff --git a/poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch b/poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch
new file mode 100644
index 000000000..bde715c5d
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch
@@ -0,0 +1,19 @@
+the $srcdir is not defined at the time of gnu-configurize.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: nspr/configure.in
+===================================================================
+--- nspr.orig/configure.in
++++ nspr/configure.in
+@@ -8,7 +8,7 @@ AC_PREREQ(2.61)
+ AC_INIT
+ AC_CONFIG_SRCDIR([pr/include/nspr.h])
+
+-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
++AC_CONFIG_AUX_DIR(build/autoconf)
+ AC_CANONICAL_TARGET
+
+ dnl ========================================================
diff --git a/poky/meta/recipes-support/nspr/nspr_4.19.bb b/poky/meta/recipes-support/nspr/nspr_4.19.bb
new file mode 100644
index 000000000..de2c87131
--- /dev/null
+++ b/poky/meta/recipes-support/nspr/nspr_4.19.bb
@@ -0,0 +1,190 @@
+SUMMARY = "Netscape Portable Runtime Library"
+HOMEPAGE = "http://www.mozilla.org/projects/nspr/"
+LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1"
+LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \
+ file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99"
+SECTION = "libs/network"
+
+SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
+ file://remove-rpath-from-tests.patch \
+ file://fix-build-on-x86_64.patch \
+ file://remove-srcdir-from-configure-in.patch \
+ file://0002-Add-nios2-support.patch \
+ file://0001-md-Fix-build-with-musl.patch \
+ file://nspr.pc.in \
+"
+
+CACHED_CONFIGUREVARS_append_libc-musl = " CFLAGS='${CFLAGS} -D_PR_POLL_AVAILABLE \
+ -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP \
+ -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO \
+ -D_PR_INET6_PROBE -DNO_DLOPEN_NULL'"
+
+UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
+UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
+
+SRC_URI[md5sum] = "e1d27282ad6286b69d6b9fd07201d3dd"
+SRC_URI[sha256sum] = "2ed95917fa2277910d1d1cf36030607dccc0ba522bba08e2af13c113dcd8f729"
+
+CVE_PRODUCT = "netscape_portable_runtime"
+
+S = "${WORKDIR}/nspr-${PV}/nspr"
+
+RDEPENDS_${PN}-dev += "perl"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+TESTS = " \
+ accept \
+ acceptread \
+ acceptreademu \
+ affinity \
+ alarm \
+ anonfm \
+ atomic \
+ attach \
+ bigfile \
+ cleanup \
+ cltsrv \
+ concur \
+ cvar \
+ cvar2 \
+ dlltest \
+ dtoa \
+ errcodes \
+ exit \
+ fdcach \
+ fileio \
+ foreign \
+ formattm \
+ fsync \
+ gethost \
+ getproto \
+ i2l \
+ initclk \
+ inrval \
+ instrumt \
+ intrio \
+ intrupt \
+ io_timeout \
+ ioconthr \
+ join \
+ joinkk \
+ joinku \
+ joinuk \
+ joinuu \
+ layer \
+ lazyinit \
+ libfilename \
+ lltest \
+ lock \
+ lockfile \
+ logfile \
+ logger \
+ many_cv \
+ multiwait \
+ nameshm1 \
+ nblayer \
+ nonblock \
+ ntioto \
+ ntoh \
+ op_2long \
+ op_excl \
+ op_filnf \
+ op_filok \
+ op_nofil \
+ parent \
+ parsetm \
+ peek \
+ perf \
+ pipeping \
+ pipeping2 \
+ pipeself \
+ poll_nm \
+ poll_to \
+ pollable \
+ prftest \
+ primblok \
+ provider \
+ prpollml \
+ ranfile \
+ randseed \
+ reinit \
+ rwlocktest \
+ sel_spd \
+ selct_er \
+ selct_nm \
+ selct_to \
+ selintr \
+ sema \
+ semaerr \
+ semaping \
+ sendzlf \
+ server_test \
+ servr_kk \
+ servr_uk \
+ servr_ku \
+ servr_uu \
+ short_thread \
+ sigpipe \
+ socket \
+ sockopt \
+ sockping \
+ sprintf \
+ stack \
+ stdio \
+ str2addr \
+ strod \
+ switch \
+ system \
+ testbit \
+ testfile \
+ threads \
+ timemac \
+ timetest \
+ tpd \
+ udpsrv \
+ vercheck \
+ version \
+ writev \
+ xnotify \
+ zerolen"
+
+inherit autotools
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+do_compile_prepend() {
+ oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
+}
+
+do_compile_append() {
+ oe_runmake -C pr/tests
+}
+
+do_install_append() {
+ install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
+ sed -i \
+ -e 's:NSPRVERSION:${PV}:g' \
+ -e 's:OEPREFIX:${prefix}:g' \
+ -e 's:OELIBDIR:${libdir}:g' \
+ -e 's:OEINCDIR:${includedir}:g' \
+ -e 's:OEEXECPREFIX:${exec_prefix}:g' \
+ ${D}${libdir}/pkgconfig/nspr.pc
+
+ mkdir -p ${D}${libdir}/nspr/tests
+ install -m 0755 ${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests
+ install -m 0755 ${S}/pr/tests/runtests.sh ${D}${libdir}/nspr/tests
+ cd ${B}/pr/tests
+ install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests
+
+ # delete compile-et.pl and perr.properties from ${bindir} because these are
+ # only used to generate prerr.c and prerr.h files from prerr.et at compile
+ # time
+ rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties
+}
+
+FILES_${PN} = "${libdir}/lib*.so"
+FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \
+ ${includedir}/* ${datadir}/aclocal/* "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch b/poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
new file mode 100644
index 000000000..82f25743a
--- /dev/null
+++ b/poky/meta/recipes-support/nss-myhostname/nss-myhostname/0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch
@@ -0,0 +1,53 @@
+From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 30 Jan 2016 20:29:06 +0000
+Subject: [PATCH] nss-myhostname: Check for nss.h presense before use
+
+We do not have nss.h on musl e.g. and configury is already checking for
+nss.h presence, use this to define needed data structures if nss.h is
+missing on a given libc implementation on a platform
+
+include stdint.h for uint32_h definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ nss-myhostname.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/nss-myhostname.c b/nss-myhostname.c
+index 293166c..6f287f5 100644
+--- a/nss-myhostname.c
++++ b/nss-myhostname.c
+@@ -21,7 +21,27 @@
+ ***/
+
+ #include <limits.h>
++#include <stdint.h>
++#ifdef HAVE_NSS_H
+ #include <nss.h>
++#else
++enum nss_status {
++ NSS_STATUS_TRYAGAIN = -2,
++ NSS_STATUS_UNAVAIL,
++ NSS_STATUS_NOTFOUND,
++ NSS_STATUS_SUCCESS,
++ NSS_STATUS_RETURN
++};
++/* Data structure used for the 'gethostbyname4_r' function. */
++struct gaih_addrtuple
++ {
++ struct gaih_addrtuple *next;
++ char *name;
++ int family;
++ uint32_t addr[4];
++ uint32_t scopeid;
++ };
++#endif
+ #include <sys/types.h>
+ #include <netdb.h>
+ #include <errno.h>
+--
+2.7.0
+
diff --git a/poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb b/poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb
new file mode 100644
index 000000000..de5b7cf59
--- /dev/null
+++ b/poky/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Name Service Switch module for resolving the local hostname"
+DESCRIPTION = "plugin for the GNU Name Service Switch (NSS) functionality of \
+the GNU C Library (glibc) providing host name resolution for the locally \
+configured system hostname as returned by gethostname(2)."
+HOMEPAGE = "http://0pointer.de/lennart/projects/nss-myhostname/"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz \
+ file://0001-nss-myhostname-Check-for-nss.h-presense-before-use.patch \
+ "
+
+SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f"
+SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2"
+
+inherit autotools distro_features_check
+
+# The systemd has its own copy of nss-myhostname
+CONFLICT_DISTRO_FEATURES = "systemd"
+
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e '/^hosts:/s/\s*myhostname//' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
diff --git a/poky/meta/recipes-support/nss/nss/0001-Bug-1437734-Use-snprintf-in-sign.c-r-ttaubert.patch b/poky/meta/recipes-support/nss/nss/0001-Bug-1437734-Use-snprintf-in-sign.c-r-ttaubert.patch
new file mode 100644
index 000000000..bc10f3385
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/0001-Bug-1437734-Use-snprintf-in-sign.c-r-ttaubert.patch
@@ -0,0 +1,119 @@
+From 6f7d7be9997ba6727a5ad7c3800df9051160dc12 Mon Sep 17 00:00:00 2001
+From: Martin Thomson <martin.thomson@gmail.com>
+Date: Tue, 13 Feb 2018 12:30:58 +1100
+Subject: [PATCH] Bug 1437734 - Use snprintf in sign.c, r=ttaubert
+
+--HG--
+extra : rebase_source : 97921ece71ff86b18d32b891591608290eed4d83
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [https://github.com/nss-dev/nss/commit/0a9078b3cde97add7c825c9d13467a8401ad0c88#diff-b42512151dc137537091f823f7701804.patch]
+
+ nss/cmd/signtool/sign.c | 58 ++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 48 insertions(+), 10 deletions(-)
+
+diff --git a/nss/cmd/signtool/sign.c b/nss/cmd/signtool/sign.c
+index 6e776069a..6f8e43946 100644
+--- a/nss/cmd/signtool/sign.c
++++ b/nss/cmd/signtool/sign.c
+@@ -43,6 +43,7 @@ SignArchive(char *tree, char *keyName, char *zip_file, int javascript,
+ int status;
+ char tempfn[FNSIZE], fullfn[FNSIZE];
+ int keyType = rsaKey;
++ int count;
+
+ metafile = meta_file;
+ optimize = _optimize;
+@@ -81,9 +82,18 @@ SignArchive(char *tree, char *keyName, char *zip_file, int javascript,
+ }
+
+ /* rsa/dsa to zip */
+- sprintf(tempfn, "META-INF/%s.%s", base, (keyType == dsaKey ? "dsa"
+- : "rsa"));
+- sprintf(fullfn, "%s/%s", tree, tempfn);
++ count = snprintf(tempfn, sizeof(tempfn), "META-INF/%s.%s", base, (keyType == dsaKey ? "dsa" : "rsa"));
++ if (count >= sizeof(tempfn)) {
++ PR_fprintf(errorFD, "unable to write key metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
++ count = snprintf(fullfn, sizeof(fullfn), "%s/%s", tree, tempfn);
++ if (count >= sizeof(fullfn)) {
++ PR_fprintf(errorFD, "unable to write key metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
+ JzipAdd(fullfn, tempfn, zipfile, compression_level);
+
+ /* Loop through all files & subdirectories, add to archive */
+@@ -93,20 +103,44 @@ SignArchive(char *tree, char *keyName, char *zip_file, int javascript,
+ }
+ /* mf to zip */
+ strcpy(tempfn, "META-INF/manifest.mf");
+- sprintf(fullfn, "%s/%s", tree, tempfn);
++ count = snprintf(fullfn, sizeof(fullfn), "%s/%s", tree, tempfn);
++ if (count >= sizeof(fullfn)) {
++ PR_fprintf(errorFD, "unable to write manifest\n");
++ errorCount++;
++ exit(ERRX);
++ }
+ JzipAdd(fullfn, tempfn, zipfile, compression_level);
+
+ /* sf to zip */
+- sprintf(tempfn, "META-INF/%s.sf", base);
+- sprintf(fullfn, "%s/%s", tree, tempfn);
++ count = snprintf(tempfn, sizeof(tempfn), "META-INF/%s.sf", base);
++ if (count >= sizeof(tempfn)) {
++ PR_fprintf(errorFD, "unable to write sf metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
++ count = snprintf(fullfn, sizeof(fullfn), "%s/%s", tree, tempfn);
++ if (count >= sizeof(fullfn)) {
++ PR_fprintf(errorFD, "unable to write sf metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
+ JzipAdd(fullfn, tempfn, zipfile, compression_level);
+
+ /* Add the rsa/dsa file to the zip archive normally */
+ if (!xpi_arc) {
+ /* rsa/dsa to zip */
+- sprintf(tempfn, "META-INF/%s.%s", base, (keyType == dsaKey ? "dsa"
+- : "rsa"));
+- sprintf(fullfn, "%s/%s", tree, tempfn);
++ count = snprintf(tempfn, sizeof(tempfn), "META-INF/%s.%s", base, (keyType == dsaKey ? "dsa" : "rsa"));
++ if (count >= sizeof(tempfn)) {
++ PR_fprintf(errorFD, "unable to write key metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
++ count = snprintf(fullfn, sizeof(fullfn), "%s/%s", tree, tempfn);
++ if (count >= sizeof(fullfn)) {
++ PR_fprintf(errorFD, "unable to write key metadata\n");
++ errorCount++;
++ exit(ERRX);
++ }
+ JzipAdd(fullfn, tempfn, zipfile, compression_level);
+ }
+
+@@ -408,6 +442,7 @@ static int
+ manifesto_xpi_fn(char *relpath, char *basedir, char *reldir, char *filename, void *arg)
+ {
+ char fullname[FNSIZE];
++ int count;
+
+ if (verbosity >= 0) {
+ PR_fprintf(outputFD, "--> %s\n", relpath);
+@@ -421,7 +456,10 @@ manifesto_xpi_fn(char *relpath, char *basedir, char *reldir, char *filename, voi
+ if (!PL_HashTableLookup(extensions, ext))
+ return 0;
+ }
+- sprintf(fullname, "%s/%s", basedir, relpath);
++ count = snprintf(fullname, sizeof(fullname), "%s/%s", basedir, relpath);
++ if (count >= sizeof(fullname)) {
++ return 1;
++ }
+ JzipAdd(fullname, relpath, zipfile, compression_level);
+
+ return 0;
diff --git a/poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch b/poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch
new file mode 100644
index 000000000..d5403397e
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/0001-nss-fix-support-cross-compiling.patch
@@ -0,0 +1,48 @@
+From 0cf47ee432cc26a706864fcc09b2c3adc342a679 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 22 Feb 2017 11:36:11 +0200
+Subject: [PATCH] nss: fix support cross compiling
+
+Let some make variables be assigned from outside makefile.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ nss/coreconf/arch.mk | 2 +-
+ nss/lib/freebl/Makefile | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
+index 06c276f..9c1eb51 100644
+--- a/nss/coreconf/arch.mk
++++ b/nss/coreconf/arch.mk
+@@ -30,7 +30,7 @@ OS_TEST := $(shell uname -m)
+ ifeq ($(OS_TEST),i86pc)
+ OS_RELEASE := $(shell uname -r)_$(OS_TEST)
+ else
+- OS_RELEASE := $(shell uname -r)
++ OS_RELEASE ?= $(shell uname -r)
+ endif
+
+ #
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+index 0ce1425..ebeb411 100644
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -36,6 +36,12 @@ ifdef USE_64
+ DEFINES += -DNSS_USE_64
+ endif
+
++ifeq ($(OS_TEST),mips)
++ifndef USE_64
++ DEFINES += -DNS_PTR_LE_32
++endif
++endif
++
+ ifdef USE_ABI32_FPU
+ DEFINES += -DNSS_USE_ABI32_FPU
+ endif
+--
+2.11.0
+
diff --git a/poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch b/poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
new file mode 100644
index 000000000..80b86908e
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/Fix-compilation-for-X32.patch
@@ -0,0 +1,33 @@
+From c8eadfcdfbc1d5a4799e9a264b0f859cb5954c05 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Tue, 13 Dec 2016 11:40:47 -0700
+Subject: [PATCH 7/7] Fix compilation for X32
+
+X32 uses 32-bit pointers, not 64-bit.
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+Upstream-Status: Pending
+---
+ nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+index 2a3301e..d4ade41 100644
+--- a/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
++++ b/nss/lib/freebl/poly1305-donna-x64-sse2-incremental-source.c
+@@ -87,7 +87,11 @@ static poly1305_state_internal INLINE
+ *
+ poly1305_aligned_state(poly1305_state *state)
+ {
++#ifdef __ILP32__
++ return (poly1305_state_internal *)(((uint32_t)state + 63) & ~63);
++#else
+ return (poly1305_state_internal *)(((uint64_t)state + 63) & ~63);
++#endif
+ }
+
+ /* copy 0-63 bytes */
+--
+2.8.0
+
diff --git a/poky/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch b/poky/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
new file mode 100644
index 000000000..86b1b6055
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/disable-Wvarargs-with-clang.patch
@@ -0,0 +1,33 @@
+clang 3.9 add this warning to rightly flag undefined
+behavior, we relegate this to be just a warning instead
+of error and keep the behavior as it was. Right fix would
+be to not pass enum to the function with variadic arguments
+as last named argument
+
+Fixes errors like
+ocsp.c:2220:22: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]
+ va_start(ap, responseType0);
+ ^
+ocsp.c:2200:43: note: parameter of type 'SECOidTag' is declared here
+ SECOidTag responseType0, ...)
+
+see
+https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start
+for more details
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: nss-3.24/nss/coreconf/Werror.mk
+===================================================================
+--- nss-3.24.orig/nss/coreconf/Werror.mk
++++ nss-3.24/nss/coreconf/Werror.mk
+@@ -54,7 +54,7 @@ ifndef WARNING_CFLAGS
+ ifdef CC_IS_CLANG
+ # -Qunused-arguments : clang objects to arguments that it doesn't understand
+ # and fixing this would require rearchitecture
+- WARNING_CFLAGS += -Qunused-arguments
++ WARNING_CFLAGS += -Qunused-arguments -Wno-error=varargs
+ # -Wno-parentheses-equality : because clang warns about macro expansions
+ WARNING_CFLAGS += $(call disable_warning,parentheses-equality)
+ ifdef BUILD_OPT
diff --git a/poky/meta/recipes-support/nss/nss/nss-build-hacl-poly1305-aarch64.patch b/poky/meta/recipes-support/nss/nss/nss-build-hacl-poly1305-aarch64.patch
new file mode 100644
index 000000000..8276f89e8
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/nss-build-hacl-poly1305-aarch64.patch
@@ -0,0 +1,30 @@
+# HG changeset patch
+# User Daiki Ueno <dueno@redhat.com>
+# Date 1516710574 -3600
+# Tue Jan 23 13:29:34 2018 +0100
+# Node ID 27f27ce21c2c6ff5a47fa9e17c438b000366c9c9
+# Parent be1dca5ac80541d3b81a8da9d42854d8b1cceefb
+Build Hacl_Poly1305_64.o on aarch64 even with make
+
+Upstream-Status: Backport
+https://bug1432455.bmoattachments.org/attachment.cgi?id=8944691
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: nss-3.35/nss/lib/freebl/Makefile
+===================================================================
+--- nss-3.35.orig/nss/lib/freebl/Makefile
++++ nss-3.35/nss/lib/freebl/Makefile
+@@ -533,7 +533,12 @@ ifndef NSS_DISABLE_CHACHAPOLY
+ EXTRA_SRCS += chacha20_vec.c
+ endif
+ else
+- EXTRA_SRCS += poly1305.c
++ ifeq ($(CPU_ARCH),aarch64)
++ EXTRA_SRCS += Hacl_Poly1305_64.c
++ else
++ EXTRA_SRCS += poly1305.c
++ endif
++
+ EXTRA_SRCS += chacha20.c
+ VERIFIED_SRCS += Hacl_Chacha20.c
+ endif # x86_64
diff --git a/poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch b/poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch
new file mode 100644
index 000000000..547594d5b
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch
@@ -0,0 +1,110 @@
+nss: fix incorrect shebang of perl
+
+Replace incorrect shebang of perl with `#!/usr/bin/env perl'.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ nss/cmd/smimetools/smime | 2 +-
+ nss/coreconf/cpdist.pl | 2 +-
+ nss/coreconf/import.pl | 2 +-
+ nss/coreconf/jniregen.pl | 2 +-
+ nss/coreconf/outofdate.pl | 2 +-
+ nss/coreconf/release.pl | 2 +-
+ nss/coreconf/version.pl | 2 +-
+ nss/tests/clean_tbx | 2 +-
+ nss/tests/path_uniq | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/nss/cmd/smimetools/smime b/nss/cmd/smimetools/smime
+--- a/nss/cmd/smimetools/smime
++++ b/nss/cmd/smimetools/smime
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/cpdist.pl b/nss/coreconf/cpdist.pl
+index 800edfb..652187f 100755
+--- a/nss/coreconf/cpdist.pl
++++ b/nss/coreconf/cpdist.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/import.pl b/nss/coreconf/import.pl
+index dd2d177..428eaa5 100755
+--- a/nss/coreconf/import.pl
++++ b/nss/coreconf/import.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/jniregen.pl b/nss/coreconf/jniregen.pl
+index 2039180..5f4f69c 100755
+--- a/nss/coreconf/jniregen.pl
++++ b/nss/coreconf/jniregen.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/outofdate.pl b/nss/coreconf/outofdate.pl
+index 33d80bb..01fc097 100755
+--- a/nss/coreconf/outofdate.pl
++++ b/nss/coreconf/outofdate.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/release.pl b/nss/coreconf/release.pl
+index 7cde19d..b5df2f6 100755
+--- a/nss/coreconf/release.pl
++++ b/nss/coreconf/release.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/version.pl b/nss/coreconf/version.pl
+index d2a4942..79359fe 100644
+--- a/nss/coreconf/version.pl
++++ b/nss/coreconf/version.pl
+@@ -1,4 +1,4 @@
+-#!/usr/sbin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/tests/clean_tbx b/nss/tests/clean_tbx
+index 4de9555..a7def9f 100755
+--- a/nss/tests/clean_tbx
++++ b/nss/tests/clean_tbx
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+
+ #######################################################################
+ #
+diff --git a/nss/tests/path_uniq b/nss/tests/path_uniq
+index f29f60a..08fbffa 100755
+--- a/nss/tests/path_uniq
++++ b/nss/tests/path_uniq
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+
+ ########################################################################
+ #
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch b/poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
new file mode 100644
index 000000000..181c69adb
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
@@ -0,0 +1,36 @@
+Fix nss multilib build on openSUSE 11.x 32bit
+
+While building lib64-nss on openSUSE 11.x 32bit, the nsinstall will
+fail with error:
+
+* nsinstall.c:1:0: sorry, unimplemented: 64-bit mode not compiled
+
+It caused by the '-m64' option which passed to host gcc.
+
+The nsinstall was built first while nss starting to build, it only runs
+on host to install built files, it doesn't need any cross-compling or
+multilib build options. Just clean the ARCHFLAG and LDFLAGS to fix this
+error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================
+Index: nss-3.24/nss/coreconf/nsinstall/Makefile
+===================================================================
+--- nss-3.24.orig/nss/coreconf/nsinstall/Makefile
++++ nss-3.24/nss/coreconf/nsinstall/Makefile
+@@ -18,6 +18,13 @@ INTERNAL_TOOLS = 1
+
+ include $(DEPTH)/coreconf/config.mk
+
++# nsinstall is unfit for cross-compiling/multilib-build since it was
++# always run on local host to install built files. This change intends
++# to clean the '-m64' from ARCHFLAG and LDFLAGS.
++ARCHFLAG =
++LDFLAGS =
++CFLAGS =
++
+ ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET)))
+ PROGRAM =
+ else
diff --git a/poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch b/poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch
new file mode 100644
index 000000000..7661dc93a
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch
@@ -0,0 +1,26 @@
+nss:no rpath for cross compiling
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/cmd/platlibs.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
+--- a/nss/cmd/platlibs.mk
++++ b/nss/cmd/platlibs.mk
+@@ -18,9 +18,9 @@ endif
+
+ ifeq ($(OS_ARCH), Linux)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
+ else
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
+ endif
+ endif
+
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-support/nss/nss/nss.pc.in b/poky/meta/recipes-support/nss/nss/nss.pc.in
new file mode 100644
index 000000000..200f635c6
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/nss.pc.in
@@ -0,0 +1,11 @@
+prefix=OEPREFIX
+exec_prefix=OEEXECPREFIX
+libdir=OELIBDIR
+includedir=OEINCDIR
+
+Name: NSS
+Description: Network Security Services
+Version: %NSS_VERSION%
+Requires: nspr >= %NSPR_VERSION%
+Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
+Cflags: -IOEINCDIR
diff --git a/poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch b/poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch
new file mode 100644
index 000000000..9942bf192
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/pqg.c-ULL_addend.patch
@@ -0,0 +1,23 @@
+nss does not build on mips with clang because wrong types are used?
+
+pqg.c:339:16: error: comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
+ if (addend < MP_DIGIT_MAX) {
+ ~~~~~~ ^ ~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: nss-3.24/nss/lib/freebl/pqg.c
+===================================================================
+--- nss-3.24.orig/nss/lib/freebl/pqg.c
++++ nss-3.24/nss/lib/freebl/pqg.c
+@@ -322,8 +322,8 @@ generate_h_candidate(SECItem *hit, mp_in
+
+ static SECStatus
+ addToSeed(const SECItem *seed,
+- unsigned long addend,
+- int seedlen, /* g in 186-1 */
++ unsigned long long addend,
++ int seedlen, /* g in 186-1 */
+ SECItem *seedout)
+ {
+ mp_int s, sum, modulus, tmp;
diff --git a/poky/meta/recipes-support/nss/nss/signlibs.sh b/poky/meta/recipes-support/nss/nss/signlibs.sh
new file mode 100644
index 000000000..a74e499f8
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss/signlibs.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# signlibs.sh
+#
+# (c)2010 Wind River Systems, Inc.
+#
+# regenerates the .chk files for the NSS libraries that require it
+# since the ones that are built have incorrect checksums that were
+# calculated on the host where they really need to be done on the
+# target
+
+CHK_FILES=`ls /lib*/*.chk /usr/lib*/*.chk 2>/dev/null`
+SIGN_BINARY=`which shlibsign`
+for I in $CHK_FILES
+do
+ DN=`dirname $I`
+ BN=`basename $I .chk`
+ FN=$DN/$BN.so
+ $SIGN_BINARY -i $FN
+done
diff --git a/poky/meta/recipes-support/nss/nss_3.35.bb b/poky/meta/recipes-support/nss/nss_3.35.bb
new file mode 100644
index 000000000..84f1916f3
--- /dev/null
+++ b/poky/meta/recipes-support/nss/nss_3.35.bb
@@ -0,0 +1,255 @@
+SUMMARY = "Mozilla's SSL and TLS implementation"
+DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
+designed to support cross-platform development of \
+security-enabled client and server applications. \
+Applications built with NSS can support SSL v2 and v3, \
+TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
+v3 certificates, and other security standards."
+HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
+SECTION = "libs"
+
+LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
+
+LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
+ file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
+ file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
+
+VERSION_DIR = "${@d.getVar('BP').upper().replace('-', '_').replace('.', '_') + '_RTM'}"
+
+SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSION_DIR}/src/${BP}.tar.gz \
+ file://nss.pc.in \
+ file://signlibs.sh \
+ file://0001-nss-fix-support-cross-compiling.patch \
+ file://nss-no-rpath-for-cross-compiling.patch \
+ file://nss-fix-incorrect-shebang-of-perl.patch \
+ file://nss-fix-nsinstall-build.patch \
+ file://disable-Wvarargs-with-clang.patch \
+ file://pqg.c-ULL_addend.patch \
+ file://Fix-compilation-for-X32.patch \
+ file://nss-build-hacl-poly1305-aarch64.patch \
+ file://0001-Bug-1437734-Use-snprintf-in-sign.c-r-ttaubert.patch \
+ "
+
+SRC_URI[md5sum] = "9467ec9e65c5aeb3254a50250490f5f7"
+SRC_URI[sha256sum] = "f4127de09bede39f5fd0f789d33c3504c5d261e69ea03022d46b319b3e32f6fa"
+
+UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
+UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
+
+inherit siteinfo
+
+DEPENDS = "sqlite3 nspr zlib nss-native"
+DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
+RDEPENDS_${PN}-smime = "perl"
+
+TD = "${S}/tentative-dist"
+TDS = "${S}/tentative-dist-staging"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_configure_prepend_libc-musl () {
+ sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
+}
+
+do_compile_prepend_class-native() {
+ export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+ export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
+ export NSS_ENABLE_WERROR=0
+}
+
+do_compile_prepend_class-nativesdk() {
+ export LDFLAGS=""
+}
+
+do_compile_prepend_class-native() {
+ # Need to set RPATH so that chrpath will do its job correctly
+ RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
+}
+
+do_compile() {
+ export CROSS_COMPILE=1
+ export NATIVE_CC="${BUILD_CC}"
+ export NATIVE_FLAGS="${BUILD_CFLAGS}"
+ export BUILD_OPT=1
+
+ export FREEBL_NO_DEPEND=1
+ export FREEBL_LOWHASH=1
+
+ export LIBDIR=${libdir}
+ export MOZILLA_CLIENT=1
+ export NS_USE_GCC=1
+ export NSS_USE_SYSTEM_SQLITE=1
+ export NSS_ENABLE_ECC=1
+
+ export OS_RELEASE=3.4
+ export OS_TARGET=Linux
+ export OS_ARCH=Linux
+
+ if [ "${TARGET_ARCH}" = "powerpc" ]; then
+ OS_TEST=ppc
+ elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+ OS_TEST=ppc64
+ elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+ OS_TEST=mips
+ else
+ OS_TEST="${TARGET_ARCH}"
+ fi
+
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ export USE_64=1
+ elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+ export USE_X32=1
+ fi
+
+ export NSS_DISABLE_GTESTS=1
+
+ # We can modify CC in the environment, but if we set it via an
+ # argument to make, nsinstall, a host program, will also build with it!
+ #
+ # nss pretty much does its own thing with CFLAGS, so we put them into CC.
+ # Optimization will get clobbered, but most of the stuff will survive.
+ # The motivation for this is to point to the correct place for debug
+ # source files and CFLAGS does that. Nothing uses CCC.
+ #
+ export CC="${CC} ${CFLAGS}"
+ make -C ./nss CCC="${CXX} -g" \
+ OS_TEST=${OS_TEST} \
+ RPATH="${RPATH}"
+}
+do_compile[vardepsexclude] += "SITEINFO_BITS"
+
+
+do_install_prepend_class-nativesdk() {
+ export LDFLAGS=""
+}
+
+do_install() {
+ export CROSS_COMPILE=1
+ export NATIVE_CC="${BUILD_CC}"
+ export BUILD_OPT=1
+
+ export FREEBL_NO_DEPEND=1
+
+ export LIBDIR=${libdir}
+ export MOZILLA_CLIENT=1
+ export NS_USE_GCC=1
+ export NSS_USE_SYSTEM_SQLITE=1
+ export NSS_ENABLE_ECC=1
+
+ export OS_RELEASE=3.4
+ export OS_TARGET=Linux
+ export OS_ARCH=Linux
+
+ if [ "${TARGET_ARCH}" = "powerpc" ]; then
+ OS_TEST=ppc
+ elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+ OS_TEST=ppc64
+ elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+ OS_TEST=mips
+ else
+ OS_TEST="${TARGET_ARCH}"
+ fi
+ if [ "${SITEINFO_BITS}" = "64" ]; then
+ export USE_64=1
+ elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+ export USE_X32=1
+ fi
+
+ export NSS_DISABLE_GTESTS=1
+
+ make -C ./nss \
+ CCC="${CXX}" \
+ OS_TEST=${OS_TEST} \
+ SOURCE_LIB_DIR="${TD}/${libdir}" \
+ SOURCE_BIN_DIR="${TD}/${bindir}" \
+ install
+
+ install -d ${D}/${libdir}/
+ for file in ${S}/dist/*.OBJ/lib/*.so; do
+ echo "Installing `basename $file`..."
+ cp $file ${D}/${libdir}/
+ done
+
+ for shared_lib in ${TD}/${libdir}/*.so.*; do
+ if [ -f $shared_lib ]; then
+ cp $shared_lib ${D}/${libdir}
+ ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
+ fi
+ done
+ for shared_lib in ${TD}/${libdir}/*.so; do
+ if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
+ cp $shared_lib ${D}/${libdir}
+ fi
+ done
+
+ install -d ${D}/${includedir}/nss3
+ install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
+
+ install -d ${D}/${bindir}
+ for binary in ${TD}/${bindir}/*; do
+ install -m 755 -t ${D}/${bindir} $binary
+ done
+}
+do_install[vardepsexclude] += "SITEINFO_BITS"
+
+do_install_append() {
+ # Create empty .chk files for the NSS libraries at build time. They could
+ # be regenerated at target's boot time.
+ for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
+ touch ${D}/${libdir}/$file
+ chmod 755 ${D}/${libdir}/$file
+ done
+ install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
+
+ install -d ${D}${libdir}/pkgconfig/
+ sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
+ sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+ sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+ sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
+ sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
+}
+
+do_install_append_class-target() {
+ # Create a blank certificate
+ mkdir -p ${D}${sysconfdir}/pki/nssdb/
+ touch ./empty_password
+ certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
+ chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
+ rm ./empty_password
+}
+
+PACKAGE_WRITE_DEPS += "nss-native"
+pkg_postinst_${PN} () {
+ if [ -n "$D" ]; then
+ for I in $D${libdir}/lib*.chk; do
+ DN=`dirname $I`
+ BN=`basename $I .chk`
+ FN=$DN/$BN.so
+ shlibsign -i $FN
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ done
+ else
+ signlibs.sh
+ fi
+}
+
+PACKAGES =+ "${PN}-smime"
+FILES_${PN}-smime = "\
+ ${bindir}/smime \
+"
+FILES_${PN} = "\
+ ${sysconfdir} \
+ ${bindir} \
+ ${libdir}/lib*.chk \
+ ${libdir}/lib*.so \
+ "
+FILES_${PN}-dev = "\
+ ${libdir}/nss \
+ ${libdir}/pkgconfig/* \
+ ${includedir}/* \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/poky/meta/recipes-support/p11-kit/p11-kit/0001-LINGUAS-drop-the-languages-for-which-upstream-does-n.patch b/poky/meta/recipes-support/p11-kit/p11-kit/0001-LINGUAS-drop-the-languages-for-which-upstream-does-n.patch
new file mode 100644
index 000000000..2fda9dfbb
--- /dev/null
+++ b/poky/meta/recipes-support/p11-kit/p11-kit/0001-LINGUAS-drop-the-languages-for-which-upstream-does-n.patch
@@ -0,0 +1,32 @@
+From c3aa4aae5e9f4adafd9e10d9466f1bc481e0aae6 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 31 Jan 2018 16:47:44 +0200
+Subject: [PATCH] LINGUAS: drop the languages for which upstream does not
+ supply .po files
+
+Regenerating them proved to be too painful.
+Upstream has been notified: https://github.com/p11-glue/p11-kit/issues/127
+
+Upstream-Status: Inappropriate [missing upstream distribution files]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ po/LINGUAS | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/po/LINGUAS b/po/LINGUAS
+index 1fc4d53..e9cc5a7 100644
+--- a/po/LINGUAS
++++ b/po/LINGUAS
+@@ -11,9 +11,7 @@ cy
+ da
+ de
+ el
+-en@boldquot
+ en_GB
+-en@quot
+ eo
+ es
+ es_CL
+--
+2.15.1
+
diff --git a/poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb b/poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
new file mode 100644
index 000000000..57798f402
--- /dev/null
+++ b/poky/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Provides a way to load and enumerate PKCS#11 modules"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=02933887f609807fbb57aa4237d14a50"
+
+inherit autotools gettext pkgconfig gtk-doc
+
+DEPENDS = "libtasn1 libffi"
+
+SRC_URI = "git://github.com/p11-glue/p11-kit \
+ file://0001-LINGUAS-drop-the-languages-for-which-upstream-does-n.patch \
+ "
+SRCREV = "bfb3bd47aa48983f5349479bca598403097ff81c"
+S = "${WORKDIR}/git"
+# exclude odd minor versions, which are development releases
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)"
+
+AUTOTOOLS_AUXDIR = "${S}/build/litter"
+EXTRA_OECONF = "--without-trust-paths"
+
+# This recipe does not use the standard gtk-doc m4 macros, and so the ./configure flags
+# that control gtk-doc build are non-standard
+EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GTKDOC_ENABLED', 'True', '--enable-doc --enable-doc-html --disable-doc-pdf', \
+ '--disable-doc', d)} "
+
+# When building native recipes, disable gtkdoc, as it is not necessary,
+# pulls in additional dependencies, and makes build times longer
+EXTRA_OECONF_prepend_class-native = "--disable-doc "
+EXTRA_OECONF_prepend_class-nativesdk = "--disable-doc "
+
+UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-gtk-doc-html --disable-gtk-doc-pdf --enable-gtk-doc --disable-gtk-doc"
+
+# p11-kit relies on these two being copied from source tree
+# instead of being regenerated by gtkdoc-scan, but doesn't setup
+# dependencies correctly when there is a parallel build. Let's pre-copy
+# them instead.
+do_compile_prepend () {
+ cp ${S}/doc/manual/p11-kit-overrides.txt ${S}/doc/manual/p11-kit-sections.txt ${B}/doc/manual/
+}
+
+FILES_${PN} += " \
+ ${libdir}/p11-kit-proxy.so \
+ ${libdir}/pkcs11/*.so \
+ ${libdir}/pkcs11/*.la"
+
+# PN contains p11-kit-proxy.so, a symlink to a loadable module
+INSANE_SKIP_${PN} = "dev-so"
diff --git a/poky/meta/recipes-support/pinentry/pinentry-1.1.0/gpg-error_pkconf.patch b/poky/meta/recipes-support/pinentry/pinentry-1.1.0/gpg-error_pkconf.patch
new file mode 100644
index 000000000..431edb035
--- /dev/null
+++ b/poky/meta/recipes-support/pinentry/pinentry-1.1.0/gpg-error_pkconf.patch
@@ -0,0 +1,100 @@
+Convert to pkg-config support to match changes done to
+the gpg-error recipe for gpg-error.pc generation.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: pinentry-1.0.0/m4/gpg-error.m4
+===================================================================
+--- pinentry-1.0.0.orig/m4/gpg-error.m4
++++ pinentry-1.0.0/m4/gpg-error.m4
+@@ -25,74 +25,12 @@ dnl config script does not match the hos
+ dnl is added to the gpg_config_script_warn variable.
+ dnl
+ AC_DEFUN([AM_PATH_GPG_ERROR],
+-[ AC_REQUIRE([AC_CANONICAL_HOST])
+- gpg_error_config_prefix=""
+- dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
+- dnl since that is consistent with how our three siblings use the directory/
+- dnl package name in --with-$dir_name-prefix=PFX.
+- AC_ARG_WITH(libgpg-error-prefix,
+- AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+- [prefix where GPG Error is installed (optional)]),
+- [gpg_error_config_prefix="$withval"])
+-
+- dnl Accept --with-gpg-error-prefix and make it work the same as
+- dnl --with-libgpg-error-prefix above, for backwards compatibility,
+- dnl but do not document this old, inconsistently-named option.
+- AC_ARG_WITH(gpg-error-prefix,,
+- [gpg_error_config_prefix="$withval"])
+-
+- if test x"${GPG_ERROR_CONFIG}" = x ; then
+- if test x"${gpg_error_config_prefix}" != x ; then
+- GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+- else
+- case "${SYSROOT}" in
+- /*)
+- if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+- GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
+- fi
+- ;;
+- '')
+- ;;
+- *)
+- AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+- ;;
+- esac
+- fi
+- fi
+-
+- AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
++[
+ min_gpg_error_version=ifelse([$1], ,0.0,$1)
+- AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+- ok=no
+- if test "$GPG_ERROR_CONFIG" != "no" \
+- && test -f "$GPG_ERROR_CONFIG" ; then
+- req_major=`echo $min_gpg_error_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_gpg_error_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
+- major=`echo $gpg_error_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $gpg_error_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -ge "$req_minor"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
++ PKG_CHECK_MODULES(GPG_ERROR, [gpg-error >= $min_gpg_error_version gpg-error], [ok=yes], [ok=no])
+ if test $ok = yes; then
+- GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
+- GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
+- GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
+- GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+- AC_MSG_RESULT([yes ($gpg_error_config_version)])
+ ifelse([$2], , :, [$2])
+- gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
++ gpg_error_config_host=`$PKG_CONFIG --host gpg-error 2>/dev/null || echo none`
+ if test x"$gpg_error_config_host" != xnone ; then
+ if test x"$gpg_error_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -107,10 +45,6 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
+ fi
+ fi
+ else
+- GPG_ERROR_CFLAGS=""
+- GPG_ERROR_LIBS=""
+- GPG_ERROR_MT_CFLAGS=""
+- GPG_ERROR_MT_LIBS=""
+ AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
diff --git a/poky/meta/recipes-support/pinentry/pinentry-1.1.0/libassuan_pkgconf.patch b/poky/meta/recipes-support/pinentry/pinentry-1.1.0/libassuan_pkgconf.patch
new file mode 100644
index 000000000..11d564f35
--- /dev/null
+++ b/poky/meta/recipes-support/pinentry/pinentry-1.1.0/libassuan_pkgconf.patch
@@ -0,0 +1,153 @@
+Convert to pkg-config support to match changes done to
+the libassuan recipe for libassuan.pc generation.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: pinentry-1.0.0/m4/libassuan.m4
+===================================================================
+--- pinentry-1.0.0.orig/m4/libassuan.m4
++++ pinentry-1.0.0/m4/libassuan.m4
+@@ -13,34 +13,8 @@ dnl
+ dnl Common code used for libassuan detection [internal]
+ dnl Returns ok set to yes or no.
+ dnl
+-AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+-[ AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_ARG_WITH(libassuan-prefix,
+- AC_HELP_STRING([--with-libassuan-prefix=PFX],
+- [prefix where LIBASSUAN is installed (optional)]),
+- libassuan_config_prefix="$withval", libassuan_config_prefix="")
+- if test x$libassuan_config_prefix != x ; then
+- libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
+- if test x${LIBASSUAN_CONFIG+set} != xset ; then
+- LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
+- fi
+- else
+- case "${SYSROOT}" in
+- /*)
+- if test -x "${SYSROOT}/bin/libassuan-config" ; then
+- LIBASSUAN_CONFIG="${SYSROOT}/bin/libassuan-config"
+- fi
+- ;;
+- '')
+- ;;
+- *)
+- AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+- ;;
+- esac
+- fi
+-
+- AC_PATH_TOOL(LIBASSUAN_CONFIG, libassuan-config, no)
+-
++AC_DEFUN([AM_PATH_LIBASSUAN_COMMON],
++[
+ tmp=ifelse([$1], ,1:0.9.2,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_libassuan_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -50,51 +24,11 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ min_libassuan_version="$tmp"
+ fi
+
+- AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
+- ok=no
+- if test "$LIBASSUAN_CONFIG" != "no" \
+- && test -f "$LIBASSUAN_CONFIG" ; then
+- req_major=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+- req_minor=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+- req_micro=`echo $min_libassuan_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-
+- libassuan_config_version=`$LIBASSUAN_CONFIG --version`
+- major=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+- minor=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+- micro=`echo $libassuan_config_version | \
+- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+-
+- if test "$major" -gt "$req_major"; then
+- ok=yes
+- else
+- if test "$major" -eq "$req_major"; then
+- if test "$minor" -gt "$req_minor"; then
+- ok=yes
+- else
+- if test "$minor" -eq "$req_minor"; then
+- if test "$micro" -ge "$req_micro"; then
+- ok=yes
+- fi
+- fi
+- fi
+- fi
+- fi
+- fi
+-
+- if test $ok = yes; then
+- AC_MSG_RESULT([yes ($libassuan_config_version)])
+- else
+- AC_MSG_RESULT(no)
+- fi
++ PKG_CHECK_MODULES(LIBASSUAN_COMMON, [libassuan >= $min_libassuan_version libassuan], [ok=yes], [ok=no])
+
+ if test $ok = yes; then
+ if test "$req_libassuan_api" -gt 0 ; then
+- tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --variable=api_version libassuan 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ AC_MSG_CHECKING([LIBASSUAN API version])
+ if test "$req_libassuan_api" -eq "$tmp" ; then
+@@ -109,7 +43,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+
+ if test $ok = yes; then
+ if test x"$host" != x ; then
+- libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
++ libassuan_config_host=`$PKG_CONFIG --host libassuan 2>/dev/null || echo 0`
+ if test x"$libassuan_config_host" != xnone ; then
+ if test x"$libassuan_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+@@ -132,7 +66,7 @@ dnl Test whether libassuan has at least
+ dnl used to test for features only available in newer versions.
+ dnl
+ AC_DEFUN([AM_CHECK_LIBASSUAN],
+-[ _AM_PATH_LIBASSUAN_COMMON($1)
++[ AM_PATH_LIBASSUAN_COMMON($1)
+ if test $ok = yes; then
+ ifelse([$2], , :, [$2])
+ else
+@@ -148,16 +82,10 @@ dnl [ACTION-IF-FOUND [
+ dnl Test for libassuan and define LIBASSUAN_CFLAGS and LIBASSUAN_LIBS
+ dnl
+ AC_DEFUN([AM_PATH_LIBASSUAN],
+-[ _AM_PATH_LIBASSUAN_COMMON($1)
++[ AM_PATH_LIBASSUAN_COMMON($1)
+ if test $ok = yes; then
+- LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
+- LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
+ ifelse([$2], , :, [$2])
+ else
+- LIBASSUAN_CFLAGS=""
+- LIBASSUAN_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+- AC_SUBST(LIBASSUAN_CFLAGS)
+- AC_SUBST(LIBASSUAN_LIBS)
+ ])
+Index: pinentry-1.0.0/configure.ac
+===================================================================
+--- pinentry-1.0.0.orig/configure.ac
++++ pinentry-1.0.0/configure.ac
+@@ -266,8 +266,8 @@ if test "$have_libassuan" = "yes"; then
+ [version of the libassuan library])
+ fi
+
+-COMMON_CFLAGS="$LIBASSUAN_CFLAGS $COMMON_CFLAGS"
+-COMMON_LIBS="$LIBASSUAN_LIBS $COMMON_LIBS"
++COMMON_CFLAGS="$LIBASSUAN_COMMON_CFLAGS $COMMON_CFLAGS"
++COMMON_LIBS="$LIBASSUAN_COMMON_LIBS $COMMON_LIBS"
+
+
+ dnl Checks for libsecmem.
diff --git a/poky/meta/recipes-support/pinentry/pinentry_1.1.0.bb b/poky/meta/recipes-support/pinentry/pinentry_1.1.0.bb
new file mode 100644
index 000000000..1eaa261f7
--- /dev/null
+++ b/poky/meta/recipes-support/pinentry/pinentry_1.1.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Collection of simple PIN or passphrase entry dialogs"
+DESCRIPTION = "\
+ Pinentry is a collection of simple PIN or passphrase entry dialogs which \
+ utilize the Assuan protocol as described by the aegypten project; see \
+ http://www.gnupg.org/aegypten/ for details."
+
+HOMEPAGE = "http://www.gnupg.org/related_software/pinentry/index.en.html"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cbbd794e2a0a289b9dfcc9f513d1996e"
+
+inherit autotools pkgconfig
+
+DEPENDS = "gettext-native libassuan libgpg-error"
+
+UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
+SRC_URI = "${GNUPG_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://libassuan_pkgconf.patch \
+ file://gpg-error_pkconf.patch \
+"
+
+SRC_URI[md5sum] = "3829315cb0a1e9cedc05ffe6def7a2c6"
+SRC_URI[sha256sum] = "68076686fa724a290ea49cdf0d1c0c1500907d1b759a3bcbfbec0293e8f56570"
+
+EXTRA_OECONF = "--disable-rpath --disable-dependency-tracking \
+ --disable-pinentry-qt5 \
+"
+
+PACKAGECONFIG ??= "ncurses libcap"
+
+PACKAGECONFIG[ncurses] = "--enable-ncurses --with-ncurses-include-dir=${STAGING_INCDIR}, --disable-ncurses, ncurses"
+PACKAGECONFIG[libcap] = "--with-libcap, --without-libcap, libcap"
+PACKAGECONFIG[qt] = "--enable-pinentry-qt, --disable-pinentry-qt, qt4-x11"
+PACKAGECONFIG[gtk2] = "--enable-pinentry-gtk2, --disable-pinentry-gtk2, gtk+ glib-2.0"
+
+#To use libsecret, add meta-gnome
+PACKAGECONFIG[secret] = "--enable-libsecret, --disable-libsecret, libsecret"
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/popt/popt/disable_tests.patch b/poky/meta/recipes-support/popt/popt/disable_tests.patch
new file mode 100644
index 000000000..016cf66a2
--- /dev/null
+++ b/poky/meta/recipes-support/popt/popt/disable_tests.patch
@@ -0,0 +1,21 @@
+Use of $(top_srcdir) in TESTS is an error which causes
+automake-1.13 to abort. Just remove tests.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd popt-1.16/Makefile.am popt-1.16/Makefile.am
+--- popt-1.16/Makefile.am 2010-05-04 23:55:54.000000000 +0300
++++ popt-1.16/Makefile.am 2013-01-02 13:34:29.540361391 +0200
+@@ -34,11 +34,6 @@
+
+ noinst_SCRIPTS = testit.sh
+
+-TESTS_ENVIRONMENT = \
+-test1="$(top_builddir)/test1"
+-
+-TESTS = $(top_srcdir)/testit.sh
+-
+ include_HEADERS = popt.h
+
+ usrlibdir = $(libdir)
diff --git a/poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch b/poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch
new file mode 100644
index 000000000..0bddbf8c9
--- /dev/null
+++ b/poky/meta/recipes-support/popt/popt/pkgconfig_fix.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Install the pkgconfig file into libdir.
+
+--- popt-1.16.orig/Makefile.am 2012-04-26 13:42:54.021139813 +0800
++++ popt-1.16/Makefile.am 2012-04-26 13:36:03.552096912 +0800
+@@ -47,7 +47,7 @@
+ libpopt_la_SOURCES = popt.c poptparse.c poptconfig.c popthelp.c poptint.c
+ libpopt_la_LDFLAGS = -no-undefined @LTLIBINTL@ @LTLIBICONV@
+
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = popt.pc
+
+ if HAVE_LD_VERSION_SCRIPT
diff --git a/poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch b/poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..7d74aadff
--- /dev/null
+++ b/poky/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch
@@ -0,0 +1,21 @@
+Upstream-Status: pending
+
+This patch avoids this error with automake 1.12:
+
+| configure.ac:49: error: automatic de-ANSI-fication support has been removed
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/02
+
+Index: popt-1.16/configure.ac
+===================================================================
+--- popt-1.16.orig/configure.ac
++++ popt-1.16/configure.ac
+@@ -46,7 +46,6 @@ AC_GCC_TRADITIONAL
+ AC_SYS_LARGEFILE
+
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
+
+ AC_CHECK_HEADERS(float.h fnmatch.h glob.h langinfo.h libintl.h mcheck.h unistd.h)
+
diff --git a/poky/meta/recipes-support/popt/popt_1.16.bb b/poky/meta/recipes-support/popt/popt_1.16.bb
new file mode 100644
index 000000000..478288f9b
--- /dev/null
+++ b/poky/meta/recipes-support/popt/popt_1.16.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Library for parsing command line options"
+HOMEPAGE = "http://rpm5.org/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cb0613c30af2a8249b8dcc67d3edb06d"
+PR = "r3"
+
+DEPENDS = "virtual/libiconv"
+
+SRC_URI = "http://rpm5.org/files/popt/popt-${PV}.tar.gz \
+ file://pkgconfig_fix.patch \
+ file://popt_fix_for_automake-1.12.patch \
+ file://disable_tests.patch \
+ "
+
+SRC_URI[md5sum] = "3743beefa3dd6247a73f8f7a32c14c33"
+SRC_URI[sha256sum] = "e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/ptest-runner/ptest-runner_2.1.1.bb b/poky/meta/recipes-support/ptest-runner/ptest-runner_2.1.1.bb
new file mode 100644
index 000000000..e5b71c0f0
--- /dev/null
+++ b/poky/meta/recipes-support/ptest-runner/ptest-runner_2.1.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A C program to run all installed ptests"
+DESCRIPTION = "The ptest-runner2 package installs a ptest-runner \
+program which loops through all installed ptest test suites and \
+runs them in sequence."
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/ptest-runner2/about/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
+
+SRCREV = "16413d71cc06b02a6d859c35a017cc49b88283f7"
+PV = "2.1.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+S = "${WORKDIR}/git"
+
+FILES_${PN} = "${bindir}/ptest-runner"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile () {
+ oe_runmake
+}
+
+do_install () {
+ install -D -m 0755 ${S}/ptest-runner ${D}${bindir}/ptest-runner
+}
diff --git a/poky/meta/recipes-support/re2c/re2c/mkdir.patch b/poky/meta/recipes-support/re2c/re2c/mkdir.patch
new file mode 100644
index 000000000..d59f01b36
--- /dev/null
+++ b/poky/meta/recipes-support/re2c/re2c/mkdir.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Submitted (https://github.com/skvadrik/re2c/pull/191)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From bccc10c60523f88c8f81413151cdcd612eb16198 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 31 Jul 2017 15:43:41 +0100
+Subject: [PATCH] Makefile.am: create target directory before writing into it
+
+In some situations src/parse/ may not exist before a file is copied into the
+directory. Ensure that this doesn't happen by creating the directory first.
+---
+ re2c/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/re2c/Makefile.am b/re2c/Makefile.am
+index 3b3b2c5e..0707fc5a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -187,6 +187,7 @@ CLEANFILES = \
+ $(DOC)
+
+ $(AUTOGEN_PARSER): $(CUSTOM_PARSER)
++ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN) if test $(BISON) = "no"; \
+ then \
+ cp $(top_srcdir)/$(BOOTSTRAP_PARSER) $@ && \
+@@ -211,6 +212,7 @@ $(BOOTSTRAP_PARSER): $(CUSTOM_PARSER)
+ $(top_srcdir)/$(CUSTOM_PARSER);
+
+ .re.cc:
++ $(AM_V_at)$(MKDIR_P) $(dir $@)
+ $(AM_V_GEN) if test -x $(RE2C); \
+ then \
+ $(top_builddir)/$(RE2C) $(RE2CFLAGS) -o $@ $< && \
+--
+2.11.0
diff --git a/poky/meta/recipes-support/re2c/re2c_0.16.bb b/poky/meta/recipes-support/re2c/re2c_0.16.bb
new file mode 100644
index 000000000..50dd7b7d2
--- /dev/null
+++ b/poky/meta/recipes-support/re2c/re2c_0.16.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Tool for writing very fast and very flexible scanners"
+HOMEPAGE = "http://re2c.sourceforge.net/"
+AUTHOR = "Marcus Börger <helly@users.sourceforge.net>"
+SECTION = "devel"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://README;beginline=146;md5=881056c9add17f8019ccd8c382ba963a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+ file://mkdir.patch"
+SRC_URI[md5sum] = "3bf508fabd52ed7334647d0ccb956e8d"
+SRC_URI[sha256sum] = "48c12564297641cceb5ff05aead57f28118db6277f31e2262437feba89069e84"
+
+BBCLASSEXTEND = "native"
+
+inherit autotools
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch b/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
new file mode 100644
index 000000000..4bd9d31c0
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
@@ -0,0 +1,60 @@
+From 99679fda405e535a282f04a4decc2381154a749f Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Mon, 15 Feb 2016 15:59:58 -0700
+Subject: [PATCH 1/2] If the libc is lacking argp, use libargp
+
+Patch pulled from Gentoo:
+
+ On glibc systems, argp is provided by libc. However, on
+ uclibc and other systems which lack argp in their C library,
+ argp might be provided by a stand alone library, libargp.
+ This patch adds tests to the build system to find who provides
+ argp.
+
+ X-Gentoo-Bug: 292191
+ X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=292191
+ Reported-by: Ed Wildgoose <gentoo@wildgooses.com>
+ Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ configure.ac | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 27a2dba..04fcd25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -82,6 +82,28 @@ AS_IF(
+ ]
+ )
+
++dnl First check if we have argp available from libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <argp.h>],
++ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
++ )],
++ [libc_has_argp="true"],
++ [libc_has_argp="false"]
++)
++
++dnl If libc doesn't provide argp, then test for libargp
++if test "$libc_has_argp" = "false" ; then
++ AC_MSG_WARN("libc does not have argp")
++ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
++
++ if test "$have_argp" = "false"; then
++ AC_MSG_ERROR("no libargp found")
++ else
++ LIBS+=" -largp"
++ fi
++fi
++
+ dnl -----------------
+ dnl Configure options
+ dnl -----------------
+--
+2.2.1
+
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch b/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch
new file mode 100644
index 000000000..1c8a79ce0
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/0002-Add-argument-to-control-the-libargp-dependency.patch
@@ -0,0 +1,92 @@
+From afc8712a9e6c72fbd03c36f84ecf8703e5d22a8c Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Mon, 15 Feb 2016 16:11:32 -0700
+Subject: [PATCH 2/2] Add argument to control the libargp dependency
+
+This ensures that the builds are always deterministic. If the argument isn't
+passed, the default behavior is to use libargp if the libc doesn't have argp.
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ configure.ac | 55 ++++++++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 36 insertions(+), 19 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 04fcd25..11a5321 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -32,6 +32,13 @@ AC_ARG_WITH([libgcrypt],
+ [with_libgcrypt=check]
+ )
+
++AC_ARG_WITH([libargp],
++ AS_HELP_STRING([--without-libargp],
++ [Disable libargp support. Systems whose libc lacks argp can use libargp instead. (Default: check if libc lacks argp)]),
++ [with_libargp=$withval],
++ [with_libargp=check]
++)
++
+ dnl Make sure anyone changing configure.ac/Makefile.am has a clue
+ AM_MAINTAINER_MODE
+
+@@ -82,27 +89,37 @@ AS_IF(
+ ]
+ )
+
+-dnl First check if we have argp available from libc
+-AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM(
+- [#include <argp.h>],
+- [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
+- )],
+- [libc_has_argp="true"],
+- [libc_has_argp="false"]
++dnl Determine if we need libargp: either user requested, or libc has no argp
++AS_IF(
++ [test "x$with_libargp" != "xyes"],
++ [
++ AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <argp.h>],
++ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
++ )],
++ [need_libargp=no],
++ [need_libargp=yes
++ if test "x$with_libargp" = "xno"; then
++ AC_MSG_FAILURE([libargp disabled and libc does not have argp])
++ fi]
++ )
++ ],
++ [need_libargp=yes],
+ )
+
+-dnl If libc doesn't provide argp, then test for libargp
+-if test "$libc_has_argp" = "false" ; then
+- AC_MSG_WARN("libc does not have argp")
+- AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
+-
+- if test "$have_argp" = "false"; then
+- AC_MSG_ERROR("no libargp found")
+- else
+- LIBS+=" -largp"
+- fi
+-fi
++dnl Check for libargp
++AS_IF(
++ [test "x$need_libargp" = "xyes"],
++ [
++ AC_CHECK_LIB(
++ [argp],
++ [argp_parse],
++ [LIBS="$LIBS -largp"],
++ [AC_MSG_FAILURE([libargp not found])]
++ )
++ ]
++)
+
+ dnl -----------------
+ dnl Configure options
+--
+2.2.1
+
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/default b/poky/meta/recipes-support/rng-tools/rng-tools/default
new file mode 100644
index 000000000..ab7cd9327
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/default
@@ -0,0 +1,2 @@
+# Specify rng device
+RNG_DEVICE=/dev/hwrng
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/init b/poky/meta/recipes-support/rng-tools/rng-tools/init
new file mode 100644
index 000000000..7cf78393a
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/init
@@ -0,0 +1,49 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/rng-tools and type
+# > update-rc.d rng-tools defaults 60
+#
+
+rngd=/usr/sbin/rngd
+test -x "$rngd" || exit 1
+
+if [ -e /etc/default/rng-tools ]; then
+ . /etc/default/rng-tools
+fi
+
+if [ -n "$RNG_DEVICE" ]; then
+ EXTRA_ARGS="-- -r $RNG_DEVICE"
+fi
+
+
+case "$1" in
+ start)
+ echo -n "Starting random number generator daemon"
+ start-stop-daemon -S -q -x $rngd $EXTRA_ARGS
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping random number generator daemon"
+ start-stop-daemon -K -q -n rngd
+ echo "."
+ ;;
+ reload|force-reload)
+ echo -n "Signalling rng daemon restart"
+ start-stop-daemon -K -q -s 1 -x $rngd
+ start-stop-daemon -K -q -s 1 -x $rngd
+ ;;
+ restart)
+ echo -n "Stopping random number generator daemon"
+ start-stop-daemon -K -q -n rngd
+ echo "."
+ echo -n "Starting random number generator daemon"
+ start-stop-daemon -S -q -x $rngd $EXTRA_ARGS
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/rng-tools {start|stop|reload|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch b/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch
new file mode 100644
index 000000000..8aa13bf8b
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/read_error_msg.patch
@@ -0,0 +1,98 @@
+rng-tools: modify 'read error' message
+
+Make the 'read error' message more descriptive.
+
+Copied from https://bugzilla.redhat.com/attachment.cgi?id=1295857
+and modified in one place to apply successfully. Error message during
+bootstrap modified to show device name.
+
+Upstream-Status: pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/rngd.c
++++ b/rngd.c
+@@ -247,8 +247,11 @@ static void do_loop(int random_step)
+ continue; /* failed, no work */
+
+ retval = iter->xread(buf, sizeof buf, iter);
+- if (retval)
++ if (retval) {
++ message(LOG_DAEMON|LOG_ERR,
++ "Error reading from entropy source\n");
+ continue; /* failed, no work */
++ }
+
+ work_done = true;
+
+--- a/rngd_entsource.c
++++ b/rngd_entsource.c
+@@ -63,10 +63,8 @@ int xread(void *buf, size_t size, struct
+ size -= r;
+ }
+
+- if (size) {
+- message(LOG_DAEMON|LOG_ERR, "read error\n");
++ if (size)
+ return -1;
+- }
+ return 0;
+ }
+
+@@ -152,7 +150,7 @@ error_out:
+ }
+
+ /* Initialize entropy source */
+-static int discard_initial_data(struct rng *ent_src)
++static int discard_initial_data(struct rng *ent_src, int *buf)
+ {
+ /* Trash 32 bits of what is probably stale (non-random)
+ * initial state from the RNG. For Intel's, 8 bits would
+@@ -164,10 +162,12 @@ static int discard_initial_data(struct r
+ xread(tempbuf, sizeof(tempbuf), ent_src);
+
+ /* Return 32 bits of bootstrap data */
+- xread(tempbuf, sizeof(tempbuf), ent_src);
++ if (xread(tempbuf, sizeof(tempbuf), ent_src) != 0)
++ return -1;
+
+- return tempbuf[0] | (tempbuf[1] << 8) |
++ *buf = tempbuf[0] | (tempbuf[1] << 8) |
+ (tempbuf[2] << 16) | (tempbuf[3] << 24);
++ return 0;
+ }
+
+ /*
+@@ -175,6 +175,8 @@ static int discard_initial_data(struct r
+ */
+ int init_entropy_source(struct rng *ent_src)
+ {
++ int bootstrap;
++
+ ent_src->rng_fd = open(ent_src->rng_name, O_RDONLY);
+ if (ent_src->rng_fd == -1) {
+ return 1;
+@@ -182,7 +184,11 @@ int init_entropy_source(struct rng *ent_
+ src_list_add(ent_src);
+ /* Bootstrap FIPS tests */
+ ent_src->fipsctx = malloc(sizeof(fips_ctx_t));
+- fips_init(ent_src->fipsctx, discard_initial_data(ent_src));
++ if (discard_initial_data(ent_src, &bootstrap) != 0) {
++ message(LOG_ERR|LOG_INFO, "Read failure in %s during bootstrap\n",ent_src->rng_name);
++ return 1;
++ }
++ fips_init(ent_src->fipsctx, bootstrap);
+ return 0;
+ }
+
+--- a/rngtest.c
++++ b/rngtest.c
+@@ -335,6 +335,7 @@ static int discard_initial_data(void)
+
+ return tempbuf[0] | (tempbuf[1] << 8) |
+ (tempbuf[2] << 16) | (tempbuf[3] << 24);
++
+ }
+
+ static void do_rng_fips_test_loop( void )
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch b/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
new file mode 100644
index 000000000..93a5864a4
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/rng-tools-5-fix-textrels-on-PIC-x86.patch
@@ -0,0 +1,103 @@
+From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86
+
+This patch updates the fixes in the assembly in rdrand_asm.S in
+sys-apps/rng-tools-5 so it won't generate textrels on PIC systems.
+The main fixes are in the use of leal in SETPTR for such systems, the rest is
+the usual PIC support stuff.
+
+This should fix Gentoo bug #469962 and help fix #518210
+
+This patch is released under the GPLv2 or a higher version license as is the
+original file as long as the author and the tester are credited.
+
+Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962
+Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=518210
+Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Reported-by: cilly <cilly@cilly.mine.nu>
+Reported-by: Manuel Rüger <mrueg@gentoo.org>
+Tested-by: Anthony Basile <blueness@gentoo.org>
+
+Upstream-Status: Pending
+
+Index: rng-tools-5/rdrand_asm.S
+===================================================================
+--- rng-tools-5.orig/rdrand_asm.S
++++ rng-tools-5/rdrand_asm.S
+@@ -2,6 +2,7 @@
+ * Copyright (c) 2011-2014, Intel Corporation
+ * Authors: Fenghua Yu <fenghua.yu@intel.com>,
+ * H. Peter Anvin <hpa@linux.intel.com>
++ * PIC code by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+@@ -174,7 +175,19 @@ ENTRY(x86_rdseed_or_rdrand_bytes)
+ jmp 4b
+ ENDPROC(x86_rdseed_or_rdrand_bytes)
+
++#if defined(__PIC__)
++#define INIT_PIC() \
++ pushl %ebx ; \
++ call __x86.get_pc_thunk.bx ; \
++ addl $_GLOBAL_OFFSET_TABLE_, %ebx
++#define END_PIC() \
++ popl %ebx
++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr
++#else
++#define INIT_PIC()
++#define END_PIC()
+ #define SETPTR(var,ptr) movl $(var),ptr
++#endif
+ #define PTR0 %eax
+ #define PTR1 %edx
+ #define PTR2 %ecx
+@@ -190,6 +203,7 @@ ENTRY(x86_aes_mangle)
+ movl 8(%ebp), %eax
+ movl 12(%ebp), %edx
+ push %esi
++ INIT_PIC()
+ #endif
+ movl $512, CTR3 /* Number of rounds */
+
+@@ -280,6 +294,7 @@ offset = offset + 16
+ movdqa %xmm7, (7*16)(PTR1)
+
+ #ifdef __i386__
++ END_PIC()
+ pop %esi
+ pop %ebp
+ #endif
+@@ -294,6 +309,7 @@ ENTRY(x86_aes_expand_key)
+ push %ebp
+ mov %esp, %ebp
+ movl 8(%ebp), %eax
++ INIT_PIC()
+ #endif
+
+ SETPTR(aes_round_keys, PTR1)
+@@ -323,6 +339,7 @@ ENTRY(x86_aes_expand_key)
+ call 1f
+
+ #ifdef __i386__
++ END_PIC()
+ pop %ebp
+ #endif
+ ret
+@@ -343,6 +360,16 @@ ENTRY(x86_aes_expand_key)
+
+ ENDPROC(x86_aes_expand_key)
+
++#if defined(__i386__) && defined(__PIC__)
++ .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
++ .globl __x86.get_pc_thunk.bx
++ .hidden __x86.get_pc_thunk.bx
++ .type __x86.get_pc_thunk.bx, @function
++__x86.get_pc_thunk.bx:
++ movl (%esp), %ebx
++ ret
++#endif
++
+ .bss
+ .balign 64
+ aes_round_keys:
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service b/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service
new file mode 100644
index 000000000..b94ad5020
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/rngd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=@SBINDIR@/rngd -f -r /dev/urandom
+SuccessExitStatus=66
+
+[Install]
+WantedBy=multi-user.target
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch b/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
new file mode 100644
index 000000000..afd08d577
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools/underquote.patch
@@ -0,0 +1,33 @@
+Fix underquoted m4 entry. This causes a failure if gcrypt isn't present:
+
+| configure: libgcrypt support disabled
+| ../rng-tools-5/configure: line 4345: ac_fn_c_try_link: command not found
+| configure: error: in `/media/build1/poky/build/tmp/work/i586-poky-linux/rng-tools/5-r0/build':
+
+RP
+2016/2/16
+
+Upstream-Status: Pending
+
+Index: rng-tools-5/configure.ac
+===================================================================
+--- rng-tools-5.orig/configure.ac
++++ rng-tools-5/configure.ac
+@@ -71,7 +71,7 @@ AS_IF(
+ [test "x$with_libgcrypt" != "xno"],
+ [
+ AC_CHECK_HEADER([gcrypt.h],
+- AC_CHECK_LIB(
++ [AC_CHECK_LIB(
+ [gcrypt],
+ [gcry_check_version], ,
+ [
+@@ -80,7 +80,7 @@ AS_IF(
+ AC_MSG_NOTICE([libgcrypt support disabled])
+ fi
+ ]
+- ),
++ )],
+ [if test "x$with_libgcrypt" != "xcheck"; then
+ AC_MSG_FAILURE([libgcrypt headers not found]); else
+ AC_MSG_NOTICE([libgcrypt support disabled])
diff --git a/poky/meta/recipes-support/rng-tools/rng-tools_5.bb b/poky/meta/recipes-support/rng-tools/rng-tools_5.bb
new file mode 100644
index 000000000..b3c9fd974
--- /dev/null
+++ b/poky/meta/recipes-support/rng-tools/rng-tools_5.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Random number generator daemon"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
+ file://0001-If-the-libc-is-lacking-argp-use-libargp.patch \
+ file://0002-Add-argument-to-control-the-libargp-dependency.patch \
+ file://underquote.patch \
+ file://rng-tools-5-fix-textrels-on-PIC-x86.patch \
+ file://read_error_msg.patch \
+ file://init \
+ file://default \
+ file://rngd.service \
+"
+
+SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
+SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e"
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit autotools update-rc.d systemd
+
+PACKAGECONFIG = "libgcrypt"
+PACKAGECONFIG_libc-musl = "libargp"
+PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
+PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
+
+do_install_append() {
+ # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d "${D}${sysconfdir}/init.d"
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
+ sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \
+ ${D}${sysconfdir}/init.d/rng-tools
+
+ install -d "${D}${sysconfdir}/default"
+ install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service
+ fi
+}
+
+INITSCRIPT_NAME = "rng-tools"
+INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
+
+SYSTEMD_SERVICE_${PN} = "rngd.service"
diff --git a/poky/meta/recipes-support/serf/serf/env.patch b/poky/meta/recipes-support/serf/serf/env.patch
new file mode 100644
index 000000000..9d073e9ab
--- /dev/null
+++ b/poky/meta/recipes-support/serf/serf/env.patch
@@ -0,0 +1,28 @@
+'scons' cleans the environment which breaks ccache builds because
+CCACHEDIR can point to an unexpected location:
+
+| ccache arm-linux-gnueabi-gcc ... context.c
+| ccache: failed to create .../serf/1.3.6-r0/.home/.ccache (No such file or directory)
+
+Issue is described in
+
+ http://www.scons.org/wiki/ImportingEnvironmentSettings
+
+and because 'bitbake' cleans environment we can pass it completely
+instead of trying to enumerate needed env.
+
+Upstream-Status: Inappropriate
+
+
+Index: serf-1.3.6/SConstruct
+===================================================================
+--- serf-1.3.6.orig/SConstruct
++++ serf-1.3.6/SConstruct
+@@ -149,6 +149,7 @@ if sys.platform == 'win32':
+ env = Environment(variables=opts,
+ tools=('default', 'textfile',),
+ CPPPATH=['.', ],
++ ENV = os.environ,
+ )
+
+ env.Append(BUILDERS = {
diff --git a/poky/meta/recipes-support/serf/serf/norpath.patch b/poky/meta/recipes-support/serf/serf/norpath.patch
new file mode 100644
index 000000000..c392444f7
--- /dev/null
+++ b/poky/meta/recipes-support/serf/serf/norpath.patch
@@ -0,0 +1,42 @@
+The RPATH handling in serf is all wrong for us and we don't need it
+anyway so hack around it by removing this for now.
+
+Upstream-Status: Inappropriate
+
+RP 2014/7/17
+
+Index: serf-1.3.9/SConstruct
+===================================================================
+--- serf-1.3.9.orig/SConstruct
++++ serf-1.3.9/SConstruct
+@@ -224,8 +224,7 @@ if sys.platform != 'win32':
+ else:
+ LIBNAMESTATIC = 'serf-${MAJOR}'
+
+-env.Append(RPATH=libdir,
+- PDB='${TARGET.filebase}.pdb')
++env.Append(PDB='${TARGET.filebase}.pdb')
+
+ if sys.platform == 'darwin':
+ # linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,))
+@@ -385,12 +384,6 @@ if gssapi and CALLOUT_OKAY:
+ if sys.platform == 'win32':
+ env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
+
+-# On some systems, the -R values that APR describes never make it into actual
+-# RPATH flags. We'll manually map all directories in LIBPATH into new
+-# flags to set RPATH values.
+-for d in env['LIBPATH']:
+- env.Append(RPATH=':'+d)
+-
+ # Set up the construction of serf-*.pc
+ pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,),
+ env.File('build/serf.pc.in'),
+@@ -461,7 +454,6 @@ else:
+ TEST_EXES = [ os.path.join('test', '%s' % (prog)) for prog in TEST_PROGRAMS ]
+
+ # Find the (dynamic) library in this directory
+-tenv.Replace(RPATH=thisdir)
+ tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
+ LIBPATH=[thisdir, ])
+
diff --git a/poky/meta/recipes-support/serf/serf_1.3.9.bb b/poky/meta/recipes-support/serf/serf_1.3.9.bb
new file mode 100644
index 000000000..2be5a069c
--- /dev/null
+++ b/poky/meta/recipes-support/serf/serf_1.3.9.bb
@@ -0,0 +1,26 @@
+SUMMARY = "High-Performance Asynchronous HTTP Client Library"
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+ file://norpath.patch \
+ file://env.patch"
+
+SRC_URI[md5sum] = "370a6340ff20366ab088012cd13f2b57"
+SRC_URI[sha256sum] = "549c2d21c577a8a9c0450facb5cca809f26591f048e466552240947bdf7a87cc"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+
+DEPENDS = "python-scons-native openssl apr apr-util util-linux expat"
+
+do_compile() {
+ ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} \
+ CC="${CC}" \
+ APR=`which apr-1-config` APU=`which apu-1-config` \
+ CFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" \
+ OPENSSL="${STAGING_EXECPREFIXDIR}"
+}
+
+do_install() {
+ ${STAGING_BINDIR_NATIVE}/scons PREFIX=${D}${prefix} LIBDIR=${D}${libdir} install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc b/poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc
new file mode 100644
index 000000000..1f51225b0
--- /dev/null
+++ b/poky/meta/recipes-support/shared-mime-info/shared-mime-info.inc
@@ -0,0 +1,35 @@
+SUMMARY = "Shared MIME type database and specification"
+HOMEPAGE = "http://freedesktop.org/wiki/Software/shared-mime-info"
+SECTION = "base"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "libxml2 intltool-native glib-2.0 shared-mime-info-native"
+
+SRC_URI = "http://freedesktop.org/~hadess/shared-mime-info-${PV}.tar.xz"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF = "--disable-update-mimedb"
+
+FILES_${PN} += "${datadir}/mime"
+FILES_${PN}-dev += "${datadir}/pkgconfig/shared-mime-info.pc"
+
+# freedesktop.org.xml is only required when updating the mime database,
+# package it separately
+PACKAGES =+ "shared-mime-info-data"
+FILES_shared-mime-info-data = "${datadir}/mime/packages/freedesktop.org.xml"
+RDEPENDS_shared-mime-info-data = "shared-mime-info"
+
+do_install () {
+ autotools_do_install
+
+ update-mime-database ${D}${datadir}/mime
+}
+
+do_install_class-native () {
+ autotools_do_install
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch b/poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
new file mode 100644
index 000000000..262ff7562
--- /dev/null
+++ b/poky/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
@@ -0,0 +1,25 @@
+fix shared-mime-info build race condition
+
+The definition of install-data-hook in Makefile.am leads
+to multiple, overlapping, executions of install-binPROGRAMS
+target. We modify the definition to avoid that.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+Index: shared-mime-info-1.9/Makefile.am
+===================================================================
+--- shared-mime-info-1.9.orig/Makefile.am
++++ shared-mime-info-1.9/Makefile.am
+@@ -50,7 +50,9 @@ else
+ update_mime_database="$(top_builddir)/update-mime-database$(EXEEXT)"
+ endif
+
+-install-data-hook: install-binPROGRAMS
++# do NOT make this dependent on anything!
++#
++install-data-hook:
+ if ENABLE_UPDATE_MIMEDB
+ $(update_mime_database) -V "$(DESTDIR)$(datadir)/mime"
+ endif
diff --git a/poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch b/poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
new file mode 100644
index 000000000..fea34a55a
--- /dev/null
+++ b/poky/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
@@ -0,0 +1,33 @@
+The Makefile used by shared-mime-info is one big race with the SUBDIRS
+option and the dependency specifically calling make all combining to
+create multiple make instances all of which may try and build targets
+like update-mime-database.
+
+This patch removes those options meaning make can correctly identify
+dependencies and stop itself racing itself.
+
+RP 10/10/2011
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: shared-mime-info-1.9/Makefile.am
+===================================================================
+--- shared-mime-info-1.9.orig/Makefile.am
++++ shared-mime-info-1.9/Makefile.am
+@@ -1,5 +1,3 @@
+-SUBDIRS=. po
+-
+ AM_CPPFLAGS = $(ALL_CFLAGS)
+
+ packagesdir = $(datadir)/mime/packages
+@@ -81,8 +79,7 @@ endif
+
+ all: $(defaultmakedeps)
+
+-create-pot:
+- $(AM_V_GEN) $(MAKE) -C po shared-mime-info.pot
++create-pot: po
+
+ local-test: create-pot freedesktop.org.xml update-mime-database$(EXEEXT)
+ if CROSS_COMPILING
diff --git a/poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.9.bb b/poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.9.bb
new file mode 100644
index 000000000..f9b273edc
--- /dev/null
+++ b/poky/meta/recipes-support/shared-mime-info/shared-mime-info_1.9.bb
@@ -0,0 +1,7 @@
+require shared-mime-info.inc
+
+SRC_URI += "file://parallelmake.patch \
+ file://install-data-hook.patch"
+
+SRC_URI[md5sum] = "45103889b91242850aa47f09325e798b"
+SRC_URI[sha256sum] = "5c0133ec4e228e41bdf52f726d271a2d821499c2ab97afd3aa3d6cf43efcdc83"
diff --git a/poky/meta/recipes-support/source-highlight/files/0001-source-highlight.pc.in-do-not-add-Boost-s-libraries-.patch b/poky/meta/recipes-support/source-highlight/files/0001-source-highlight.pc.in-do-not-add-Boost-s-libraries-.patch
new file mode 100644
index 000000000..b0aa5d173
--- /dev/null
+++ b/poky/meta/recipes-support/source-highlight/files/0001-source-highlight.pc.in-do-not-add-Boost-s-libraries-.patch
@@ -0,0 +1,30 @@
+From 9aa01fd5f9d8b2b98c34684dc8f68115750ef41c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 12 Jul 2016 17:15:13 +0300
+Subject: [PATCH] source-highlight.pc.in: do not add Boost's libraries and
+ includes
+
+This breaks when compiling in sysroots; a proper way is to use Depends
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ source-highlight.pc.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/source-highlight.pc.in b/source-highlight.pc.in
+index 79ab63e..64114a7 100644
+--- a/source-highlight.pc.in
++++ b/source-highlight.pc.in
+@@ -7,6 +7,6 @@ Name: libsource-highlight
+ Description: GNU Source-highlight library.
+ URL: http://www.gnu.org/software/src-highlite/
+ Version: @VERSION@
+-Libs: -L${libdir} -lsource-highlight @BOOST_LDFLAGS@ @BOOST_REGEX_LIB@
+-Cflags: -I${includedir} @BOOST_CPPFLAGS@
++Libs: -L${libdir} -lsource-highlight
++Cflags: -I${includedir}
+
+--
+2.8.1
+
diff --git a/poky/meta/recipes-support/source-highlight/source-highlight_3.1.8.bb b/poky/meta/recipes-support/source-highlight/source-highlight_3.1.8.bb
new file mode 100644
index 000000000..85923e475
--- /dev/null
+++ b/poky/meta/recipes-support/source-highlight/source-highlight_3.1.8.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Syntax highlight utility"
+DESCRIPTION = "Source-highlight converts source code to formatted text with syntax highlighting."
+HOMEPAGE = "https://www.gnu.org/software/src-highlite/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ff95bfe019feaf92f524b73dd79e76eb"
+
+SRC_URI = "${GNU_MIRROR}/src-highlite/${BPN}-${PV}.tar.gz \
+ file://0001-source-highlight.pc.in-do-not-add-Boost-s-libraries-.patch"
+SRC_URI[md5sum] = "3243470706ef5fefdc3e43b5306a4e41"
+SRC_URI[sha256sum] = "01336a7ea1d1ccc374201f7b81ffa94d0aecb33afc7d6903ebf9fbf33a55ada3"
+
+inherit autotools
+
+DEPENDS_append = " boost"
+
+DEPENDS_append_class-target = " source-highlight-native"
+
+EXTRA_OECONF = "--with-boost=yes --with-boost-libdir=${STAGING_DIR_TARGET}${libdir}"
+
+BBCLASSEXTEND = "native"
+
+# source-highlight is using its own binary from the build tree to make documentation
+# let's substitute the native binary instead
+do_configure_prepend_class-target () {
+ sed -i -e 's,^SRCHILITEEXE = $(top_builddir).*,SRCHILITEEXE = source-highlight,' ${S}/doc/Makefile.am
+}
+
+RDEPENDS_source-highlight += "bash"
diff --git a/poky/meta/recipes-support/sqlite/sqlite3.inc b/poky/meta/recipes-support/sqlite/sqlite3.inc
new file mode 100644
index 000000000..95ec89cef
--- /dev/null
+++ b/poky/meta/recipes-support/sqlite/sqlite3.inc
@@ -0,0 +1,57 @@
+SUMMARY = "Embeddable SQL database engine"
+HOMEPAGE = "http://www.sqlite.org"
+SECTION = "libs"
+
+PE = "3"
+
+def sqlite_download_version(d):
+ pvsplit = d.getVar('PV').split('.')
+ if len(pvsplit) < 4:
+ pvsplit.append('0')
+ return pvsplit[0] + ''.join([part.rjust(2,'0') for part in pvsplit[1:]])
+
+SQLITE_PV = "${@sqlite_download_version(d)}"
+
+S = "${WORKDIR}/sqlite-autoconf-${SQLITE_PV}"
+
+UPSTREAM_CHECK_URI = "http://www.sqlite.org/"
+UPSTREAM_CHECK_REGEX = "releaselog/(?P<pver>(\d+[\.\-_]*)+)\.html"
+
+CVE_PRODUCT = "sqlite"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG_class-native = ""
+
+PACKAGECONFIG[editline] = "--enable-editline,--disable-editline,libedit"
+PACKAGECONFIG[readline] = "--enable-readline,--disable-readline,readline ncurses"
+
+EXTRA_OECONF = " \
+ --enable-shared \
+ --enable-threadsafe \
+ --disable-static-shell \
+"
+
+CFLAGS_append = " -fPIC"
+
+# pread() is in POSIX.1-2001 so any reasonable system must surely support it
+BUILD_CFLAGS += "-DUSE_PREAD"
+TARGET_CFLAGS += "-DUSE_PREAD"
+
+# Provide column meta-data API
+BUILD_CFLAGS += "-DSQLITE_ENABLE_COLUMN_METADATA"
+TARGET_CFLAGS += "-DSQLITE_ENABLE_COLUMN_METADATA"
+
+PACKAGES = "lib${BPN} lib${BPN}-dev lib${BPN}-doc ${PN}-dbg lib${BPN}-staticdev ${PN}"
+
+FILES_${PN} = "${bindir}/*"
+FILES_lib${BPN} = "${libdir}/*.so.*"
+FILES_lib${BPN}-dev = "${libdir}/*.la ${libdir}/*.so \
+ ${libdir}/pkgconfig ${includedir}"
+FILES_lib${BPN}-doc = "${docdir} ${mandir} ${infodir}"
+FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
+
+AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/sqlite/sqlite3_3.22.0.bb b/poky/meta/recipes-support/sqlite/sqlite3_3.22.0.bb
new file mode 100644
index 000000000..ef88659e9
--- /dev/null
+++ b/poky/meta/recipes-support/sqlite/sqlite3_3.22.0.bb
@@ -0,0 +1,10 @@
+require sqlite3.inc
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=786d3dc581eff03f4fd9e4a77ed00c66"
+
+SRC_URI = "\
+ http://www.sqlite.org/2018/sqlite-autoconf-${SQLITE_PV}.tar.gz \
+ "
+SRC_URI[md5sum] = "96b5648d542e8afa6ab7ffb8db8ddc3d"
+SRC_URI[sha256sum] = "2824ab1238b706bc66127320afbdffb096361130e23291f26928a027b885c612"
diff --git a/poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch b/poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch
new file mode 100644
index 000000000..4bd9f2be1
--- /dev/null
+++ b/poky/meta/recipes-support/taglib/taglib/CVE-2017-12678.patch
@@ -0,0 +1,40 @@
+From eb9ded1206f18f2c319157337edea2533a40bea6 Mon Sep 17 00:00:00 2001
+From: "Stephen F. Booth" <me@sbooth.org>
+Date: Sun, 23 Jul 2017 10:11:09 -0400
+Subject: [PATCH] Don't assume TDRC is an instance of TextIdentificationFrame
+
+If TDRC is encrypted, FrameFactory::createFrame() returns UnknownFrame
+which causes problems in rebuildAggregateFrames() when it is assumed
+that TDRC is a TextIdentificationFrame
+
+Upstream-Status: Backport
+[https://github.com/taglib/taglib/pull/831/commits/eb9ded1206f18f2c319157337edea2533a40bea6]
+
+CVE: CVE-2017-12678
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ taglib/mpeg/id3v2/id3v2framefactory.cpp | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp
+index 759a9b7b..9347ab86 100644
+--- a/taglib/mpeg/id3v2/id3v2framefactory.cpp
++++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp
+@@ -334,10 +334,11 @@ void FrameFactory::rebuildAggregateFrames(ID3v2::Tag *tag) const
+ tag->frameList("TDAT").size() == 1)
+ {
+ TextIdentificationFrame *tdrc =
+- static_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
++ dynamic_cast<TextIdentificationFrame *>(tag->frameList("TDRC").front());
+ UnknownFrame *tdat = static_cast<UnknownFrame *>(tag->frameList("TDAT").front());
+
+- if(tdrc->fieldList().size() == 1 &&
++ if(tdrc &&
++ tdrc->fieldList().size() == 1 &&
+ tdrc->fieldList().front().size() == 4 &&
+ tdat->data().size() >= 5)
+ {
+--
+2.13.5
+
diff --git a/poky/meta/recipes-support/taglib/taglib_1.11.1.bb b/poky/meta/recipes-support/taglib/taglib_1.11.1.bb
new file mode 100644
index 000000000..50439bc14
--- /dev/null
+++ b/poky/meta/recipes-support/taglib/taglib_1.11.1.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Library for reading and editing the meta-data of popular audio formats"
+SECTION = "libs/multimedia"
+HOMEPAGE = "http://taglib.github.io/"
+LICENSE = "LGPLv2.1 | MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
+ file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
+ file://taglib/audioproperties.h;beginline=1;endline=24;md5=9df2c7399519b7310568a7c55042ecee"
+
+DEPENDS = "zlib"
+
+SRC_URI = "http://taglib.github.io/releases/${BP}.tar.gz \
+ file://CVE-2017-12678.patch \
+ "
+
+SRC_URI[md5sum] = "cee7be0ccfc892fa433d6c837df9522a"
+SRC_URI[sha256sum] = "b6d1a5a610aae6ff39d93de5efd0fdc787aa9e9dc1e7026fa4c961b26563526b"
+
+UPSTREAM_CHECK_URI = "http://github.com/taglib/taglib/releases/"
+
+BINCONFIG = "${bindir}/taglib-config"
+
+inherit cmake pkgconfig binconfig-disabled
+
+PACKAGES =+ "${PN}-c"
+FILES_${PN}-c = "${libdir}/libtag_c.so.*"
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+ -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \
+ -DHAVE_BOOST_BYTESWAP=FALSE \
+ -DCMAKE_CXX_STANDARD=11 \
+ -DCMAKE_CXX_STANDARD_REQUIRED=OFF \
+ -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
+"
+CXXFLAGS += "-std=c++11"
+
+do_configure_prepend () {
+ rm -f ${S}/admin/ltmain.sh
+ rm -f ${S}/admin/libtool.m4.in
+}
+
+# without -fPIC depending packages failed with many error like:
+# | <...>/ld: error: <...>/usr/lib/libtag.a(modfilebase.cpp.o): requires unsupported dynamic reloc R_ARM_THM_MOVW_ABS_NC; recompile with -fPIC
+CXXFLAGS += "-fPIC"
diff --git a/poky/meta/recipes-support/user-creation/files/system-xuser.conf b/poky/meta/recipes-support/user-creation/files/system-xuser.conf
new file mode 100644
index 000000000..d42e3d1f5
--- /dev/null
+++ b/poky/meta/recipes-support/user-creation/files/system-xuser.conf
@@ -0,0 +1,11 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy user="xuser">
+ <allow send_destination="net.connman"/>
+ <allow send_destination="net.connman.vpn"/>
+ <allow send_destination="org.ofono"/>
+ <allow send_destination="org.bluez"/>
+ </policy>
+</busconfig>
+
diff --git a/poky/meta/recipes-support/user-creation/xuser-account_0.1.bb b/poky/meta/recipes-support/user-creation/xuser-account_0.1.bb
new file mode 100644
index 000000000..81817d1e2
--- /dev/null
+++ b/poky/meta/recipes-support/user-creation/xuser-account_0.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Creates an 'xuser' account used for running X11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://system-xuser.conf"
+
+inherit allarch useradd
+
+do_configure() {
+ :
+}
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -D -m 0644 ${WORKDIR}/system-xuser.conf ${D}${sysconfdir}/dbus-1/system.d/system-xuser.conf
+}
+
+FILES_${PN} = "${sysconfdir}/dbus-1/system.d/system-xuser.conf"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--create-home \
+ --groups video,tty,audio,input,shutdown,disk \
+ --user-group xuser"
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/poky/meta/recipes-support/vte/vte/0001-Add-m4-vapigen.m4.patch b/poky/meta/recipes-support/vte/vte/0001-Add-m4-vapigen.m4.patch
new file mode 100644
index 000000000..1c5630ed9
--- /dev/null
+++ b/poky/meta/recipes-support/vte/vte/0001-Add-m4-vapigen.m4.patch
@@ -0,0 +1,119 @@
+From 08ca1c48b25c332b75bba2a6b5d757da006e955b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Oct 2016 16:27:57 +0300
+Subject: [PATCH] Add m4/vapigen.m4
+
+Building without vala will fail if we don't have a vapigen.m4.
+
+Upstream-Status: Pending
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ m4/vapigen.m4 | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 96 insertions(+)
+ create mode 100644 m4/vapigen.m4
+
+diff --git a/m4/vapigen.m4 b/m4/vapigen.m4
+new file mode 100644
+index 0000000..f2df12f
+--- /dev/null
++++ b/m4/vapigen.m4
+@@ -0,0 +1,96 @@
++dnl vapigen.m4
++dnl
++dnl Copyright 2012 Evan Nemerson
++dnl
++dnl This library is free software; you can redistribute it and/or
++dnl modify it under the terms of the GNU Lesser General Public
++dnl License as published by the Free Software Foundation; either
++dnl version 2.1 of the License, or (at your option) any later version.
++dnl
++dnl This library is distributed in the hope that it will be useful,
++dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
++dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++dnl Lesser General Public License for more details.
++dnl
++dnl You should have received a copy of the GNU Lesser General Public
++dnl License along with this library; if not, write to the Free Software
++dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++
++# VAPIGEN_CHECK([VERSION], [API_VERSION], [FOUND-INTROSPECTION], [DEFAULT])
++# --------------------------------------
++# Check vapigen existence and version
++#
++# See http://live.gnome.org/Vala/UpstreamGuide for detailed documentation
++AC_DEFUN([VAPIGEN_CHECK],
++[
++ AC_BEFORE([GOBJECT_INTROSPECTION_CHECK],[$0])
++ AC_BEFORE([GOBJECT_INTROSPECTION_REQUIRE],[$0])
++
++ AC_ARG_ENABLE([vala],
++ [AS_HELP_STRING([--enable-vala[=@<:@no/auto/yes@:>@]],[build Vala bindings @<:@default=]ifelse($4,,auto,$4)[@:>@])],,[
++ AS_IF([test "x$4" = "x"], [
++ enable_vala=auto
++ ], [
++ enable_vala=$4
++ ])
++ ])
++
++ AS_CASE([$enable_vala], [no], [enable_vala=no],
++ [yes], [
++ AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
++ AC_MSG_ERROR([Vala bindings require GObject Introspection])
++ ])
++ ], [auto], [
++ AS_IF([test "x$3" != "xyes" -a "x$found_introspection" != "xyes"], [
++ enable_vala=no
++ ])
++ ], [
++ AC_MSG_ERROR([Invalid argument passed to --enable-vala, should be one of @<:@no/auto/yes@:>@])
++ ])
++
++ AS_IF([test "x$2" = "x"], [
++ vapigen_pkg_name=vapigen
++ ], [
++ vapigen_pkg_name=vapigen-$2
++ ])
++ AS_IF([test "x$1" = "x"], [
++ vapigen_pkg="$vapigen_pkg_name"
++ ], [
++ vapigen_pkg="$vapigen_pkg_name >= $1"
++ ])
++
++ PKG_PROG_PKG_CONFIG
++
++ PKG_CHECK_EXISTS([$vapigen_pkg], [
++ AS_IF([test "$enable_vala" = "auto"], [
++ enable_vala=yes
++ ])
++ ], [
++ AS_CASE([$enable_vala], [yes], [
++ AC_MSG_ERROR([$vapigen_pkg not found])
++ ], [auto], [
++ enable_vala=no
++ ])
++ ])
++
++ AC_MSG_CHECKING([for vala])
++
++ AS_CASE([$enable_vala],
++ [yes], [
++ VAPIGEN=`$PKG_CONFIG --variable=vapigen vapigen`
++ VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir vapigen`/vala/Makefile.vapigen
++ AS_IF([test "x$2" = "x"], [
++ VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir vapigen`
++ ], [
++ VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned vapigen`
++ ])
++ ])
++
++ AC_MSG_RESULT([$enable_vala])
++
++ AC_SUBST([VAPIGEN])
++ AC_SUBST([VAPIGEN_VAPIDIR])
++ AC_SUBST([VAPIGEN_MAKEFILE])
++
++ AM_CONDITIONAL(ENABLE_VAPIGEN, test "x$enable_vala" = "xyes")
++])
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/vte/vte/0001-Don-t-enable-stack-protection-by-default.patch b/poky/meta/recipes-support/vte/vte/0001-Don-t-enable-stack-protection-by-default.patch
new file mode 100644
index 000000000..fcfc55975
--- /dev/null
+++ b/poky/meta/recipes-support/vte/vte/0001-Don-t-enable-stack-protection-by-default.patch
@@ -0,0 +1,29 @@
+From b0a579d83e355545b64742c997fe8b1d58bf4207 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 13 Jun 2016 11:05:00 +0300
+Subject: [PATCH] Don't enable stack-protection by default
+
+These are set by security_flags.inc.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 068d072..d580f84 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -138,8 +138,6 @@ m4_define([compiler_flags_common],[ dnl
+ -fno-common dnl
+ -fdiagnostics-show-option dnl
+ -fno-strict-aliasing dnl
+- -fstack-protector dnl
+- -fstack-protector-strong dnl
+ -fno-semantic-interposition dnl
+ -Wno-deprecated-declarations dnl
+ ])
+--
+2.1.4
+
diff --git a/poky/meta/recipes-support/vte/vte_0.50.2.bb b/poky/meta/recipes-support/vte/vte_0.50.2.bb
new file mode 100644
index 000000000..8b9ee33ec
--- /dev/null
+++ b/poky/meta/recipes-support/vte/vte_0.50.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Virtual terminal emulator GTK+ widget library"
+BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
+LICENSE = "LGPLv2.1+"
+DEPENDS = "glib-2.0 gtk+3 libpcre2 intltool-native libxml2-native gperf-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+inherit gnomebase gtk-doc distro_features_check upstream-version-is-even gobject-introspection
+
+# vapigen.m4 is required when vala is not present (but the one from vala should be used normally)
+SRC_URI += "file://0001-Don-t-enable-stack-protection-by-default.patch \
+ ${@bb.utils.contains('PACKAGECONFIG', 'vala', '', 'file://0001-Add-m4-vapigen.m4.patch', d) } \
+ "
+SRC_URI[archive.md5sum] = "1912cfd1d9cdd30cebeb908507acadc5"
+SRC_URI[archive.sha256sum] = "79dd316bfaff48f2fb74d066baae0d830e1f44436796fe410a57297e5c5f09cf"
+
+ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+# Instead of "inherit vala" we do the relevant settings here so we can
+# set DEPENDS based on PACKAGECONFIG.
+
+# Our patched version of Vala looks in STAGING_DATADIR for .vapi files
+export STAGING_DATADIR
+# Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+# Help g-ir-scanner find the .so for linking
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/src/.libs"
+}
+
+# Package additional files
+FILES_${PN}-dev += "${datadir}/vala/vapi/*"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[vala] = "--enable-vala,--disable-vala,vala-native vala"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+
+CFLAGS += "-D_GNU_SOURCE"
+
+EXTRA_OECONF = "--disable-test-application"
+
+# libtool adds "-nostdlib" when g++ is used. This breaks PIE builds.
+# Use libtool-cross (which has a hack to prevent that) instead.
+EXTRA_OEMAKE_class-target = "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+PACKAGES =+ "libvte"
+FILES_libvte = "${libdir}/*.so.* ${libdir}/girepository-1.0/*"
diff --git a/poky/meta/recipes.txt b/poky/meta/recipes.txt
new file mode 100644
index 000000000..9e178d6ce
--- /dev/null
+++ b/poky/meta/recipes.txt
@@ -0,0 +1,14 @@
+recipes-bsp - Anything with links to specific hardware or hardware configuration information
+recipes-connectivity - Libraries and applications related to communication with other devices
+recipes-core - What's needed to build a basic working Linux image including commonly used dependencies
+recipes-devtools - Tools primarily used by the build system (but can also be used on targets)
+recipes-extended - Applications which whilst not essential add features compared to the alternatives in
+ core. May be needed for full tool functionality or LSB compliance.
+recipes-gnome - All things related to the GTK+ application framework
+recipes-graphics - X and other graphically related system libraries
+recipes-kernel - The kernel and generic applications/libraries with strong kernel dependencies
+recipes-lsb4 - Recipes added for the sole purpose of supporting the Linux Standard Base (LSB) 4.x
+recipes-multimedia - Codecs and support utilties for audio, images and video
+recipes-rt - Provides package and image recipes for using and testing the PREEMPT_RT kernel
+recipes-sato - The Sato demo/reference UI/UX, its associated apps and configuration
+recipes-support - Recipes used by other recipes but that are not directly included in images
diff --git a/poky/meta/site/arm-32 b/poky/meta/site/arm-32
new file mode 100644
index 000000000..81fd8d310
--- /dev/null
+++ b/poky/meta/site/arm-32
@@ -0,0 +1,47 @@
+# definitions assuming 32-bit arm architecture
+
+# apache
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+
+# glib-2.0
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# jikes
+ac_cv_sizeof_wchar_t=4
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/poky/meta/site/arm-64 b/poky/meta/site/arm-64
new file mode 100644
index 000000000..90c09b2d5
--- /dev/null
+++ b/poky/meta/site/arm-64
@@ -0,0 +1,46 @@
+# definitions assuming 64-bit arm architecture
+
+# general
+ac_cv_sizeof_wchar_t=4
+ac_cv_sizeof_size_t=8
+ac_cv_sizeof_ssize_t=8
+ac_cv_alignof_char=1
+ac_cv_alignof_double=8
+
+# glib
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+#glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+
+# glib-2.0
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+#glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+#glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+#glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+#glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# ORBit2 (should be in meta-gnome/site/arm-64)
+#ac_cv_alignof_CORBA_boolean=1
+#ac_cv_alignof_CORBA_char=1
+#ac_cv_alignof_CORBA_double=8
+#ac_cv_alignof_CORBA_float=4
+#ac_cv_alignof_CORBA_long=4
+#ac_cv_alignof_CORBA_long_double=8
+#ac_cv_alignof_CORBA_long_long=8
+#ac_cv_alignof_CORBA_octet=1
+#ac_cv_alignof_CORBA_pointer=4
+#ac_cv_alignof_CORBA_short=2
+#ac_cv_alignof_CORBA_struct=1
+#ac_cv_alignof_CORBA_wchar=2
+
+# at-spi2-core
+ac_cv_alignof_dbind_pointer=8
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+
diff --git a/poky/meta/site/arm-common b/poky/meta/site/arm-common
new file mode 100644
index 000000000..198c98c6a
--- /dev/null
+++ b/poky/meta/site/arm-common
@@ -0,0 +1,153 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# db (sleepycat)
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# fnmatch
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# glib-2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+#gstreamer
+as_cv_unaligned_access=${as_cv_unaligned_access=no}
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# libnet
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# xffm
+jm_cv_func_working_readdir=yes
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/poky/meta/site/arm-darwin b/poky/meta/site/arm-darwin
new file mode 100644
index 000000000..09ff097aa
--- /dev/null
+++ b/poky/meta/site/arm-darwin
@@ -0,0 +1,11 @@
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=no}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=no}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=no}
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=no}
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no}
+ac_cv_va_copy=${ac_cv_va_copy=yes}
diff --git a/poky/meta/site/arm-darwin8 b/poky/meta/site/arm-darwin8
new file mode 100644
index 000000000..09ff097aa
--- /dev/null
+++ b/poky/meta/site/arm-darwin8
@@ -0,0 +1,11 @@
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=no}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=no}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=no}
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=no}
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no}
+ac_cv_va_copy=${ac_cv_va_copy=yes}
diff --git a/poky/meta/site/arm-linux b/poky/meta/site/arm-linux
new file mode 100644
index 000000000..fb3c81d0e
--- /dev/null
+++ b/poky/meta/site/arm-linux
@@ -0,0 +1,157 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=${samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes}
+samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=${samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_LINUX_SENDFILE=${samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=yes}
+samba_cv_HAVE_BROKEN_READDIR_NAME=${samba_cv_HAVE_BROKEN_READDIR_NAME=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_DQB_FSOFTLIMIT=${samba_cv_HAVE_DQB_FSOFTLIMIT=no}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FAM_H=${samba_cv_HAVE_FAM_H=no}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_FUNCTION_MACRO=${samba_cv_HAVE_FUNCTION_MACRO=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_INT16_FROM_RPC_RPC_H=${samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_INT32_FROM_RPC_RPC_H=${samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_NATIVE_ICONV=${samba_cv_HAVE_NATIVE_ICONV=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=yes}
+samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=${samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SOCK_SIN_LEN=${samba_cv_HAVE_SOCK_SIN_LEN=no}
+samba_cv_HAVE_STAT_ST_BLKSIZE=${samba_cv_HAVE_STAT_ST_BLKSIZE=yes}
+samba_cv_HAVE_STAT_ST_BLOCKS=${samba_cv_HAVE_STAT_ST_BLOCKS=yes}
+samba_cv_HAVE_STRUCT_DIR64=${samba_cv_HAVE_STRUCT_DIR64=no}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_UTIMBUF=${samba_cv_HAVE_UTIMBUF=yes}
+samba_cv_HAVE_UT_UT_ADDR=${samba_cv_HAVE_UT_UT_ADDR=yes}
+samba_cv_HAVE_UT_UT_EXIT=${samba_cv_HAVE_UT_UT_EXIT=yes}
+samba_cv_HAVE_UT_UT_HOST=${samba_cv_HAVE_UT_UT_HOST=yes}
+samba_cv_HAVE_UT_UT_ID=${samba_cv_HAVE_UT_UT_ID=yes}
+samba_cv_HAVE_UT_UT_NAME=${samba_cv_HAVE_UT_UT_NAME=yes}
+samba_cv_HAVE_UT_UT_PID=${samba_cv_HAVE_UT_UT_PID=yes}
+samba_cv_HAVE_UT_UT_TIME=${samba_cv_HAVE_UT_UT_TIME=yes}
+samba_cv_HAVE_UT_UT_TV=${samba_cv_HAVE_UT_UT_TV=yes}
+samba_cv_HAVE_UT_UT_TYPE=${samba_cv_HAVE_UT_UT_TYPE=yes}
+samba_cv_HAVE_UT_UT_USER=${samba_cv_HAVE_UT_UT_USER=yes}
+samba_cv_HAVE_UX_UT_SYSLEN=${samba_cv_HAVE_UX_UT_SYSLEN=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=yes}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_PUTUTLINE_RETURNS_UTMP=${samba_cv_PUTUTLINE_RETURNS_UTMP=yes}
+samba_cv_QUOTA_WORKS=${samba_cv_QUOTA_WORKS=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=yes}
+samba_cv_REPLACE_GETPASS=${samba_cv_REPLACE_GETPASS=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_REPLACE_READDIR=${samba_cv_REPLACE_READDIR=no}
+samba_cv_RUN_QUOTA_TESTS=${samba_cv_RUN_QUOTA_TESTS=yes}
+samba_cv_SEEKDIR_RETURNS_VOID=${samba_cv_SEEKDIR_RETURNS_VOID=yes}
+samba_cv_SIZEOF_DEV_T=${samba_cv_SIZEOF_DEV_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=${samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=yes}
+samba_cv_SYSCONF_SC_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSCONF_SC_PAGESIZE=${samba_cv_SYSCONF_SC_PAGESIZE=yes}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_SYSQUOTA_WORKS_XFS=${samba_cv_SYSQUOTA_WORKS_XFS=yes}
+samba_cv_TRY_QUOTAS=${samba_cv_TRY_QUOTAS=no}
+samba_cv_TRY_SYS_QUOTAS=${samba_cv_TRY_SYS_QUOTAS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_WE_USE_SYS_QUOTAS=${samba_cv_WE_USE_SYS_QUOTAS=yes}
+samba_cv_WITH_AFS=${samba_cv_WITH_AFS=no}
+samba_cv_WITH_FAKE_KASERVER=${samba_cv_WITH_FAKE_KASERVER=no}
+samba_cv_WITH_QUOTAS=${samba_cv_WITH_QUOTAS=auto}
+samba_cv_WITH_SYS_QUOTAS=${samba_cv_WITH_SYS_QUOTAS=auto}
+samba_cv_WITH_VFS_AFSACL=${samba_cv_WITH_VFS_AFSACL=no}
+samba_cv_compiler_supports_ll=${samba_cv_compiler_supports_ll=yes}
+samba_cv_found_xfs_header=${samba_cv_found_xfs_header=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_immediate_structures=${samba_cv_immediate_structures=yes}
+samba_cv_optimize_out_funcation_calls=${samba_cv_optimize_out_funcation_calls=yes}
+samba_cv_sig_atomic_t=${samba_cv_sig_atomic_t=yes}
+samba_cv_socklen_t=${samba_cv_socklen_t=yes}
+samba_cv_struct_timespec=${samba_cv_struct_timespec=yes}
+samba_cv_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_linux.c}
+samba_cv_unixsocket=${samba_cv_unixsocket=yes}
+samba_cv_volatile=${samba_cv_volatile=yes}
+
+#older sambe defines
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+
+#dbus
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# lftp
+ac_cv_file___dev_ptc_=yes
+
+# guile
+ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
+
+# gnet
+ac_cv_member_struct_sockaddr_sa_len=${ac_cv_member_struct_sockaddr_sa_len=no}
+ac_cv_gnet_have_abstract_sockets=${ac_cv_gnet_have_abstract_sockets=no}
+gnet_sockaddr_family_field_name=${gnet_sockaddr_family_field_name=ss_family}
diff --git a/poky/meta/site/armeb-linux b/poky/meta/site/armeb-linux
new file mode 100644
index 000000000..6521ff584
--- /dev/null
+++ b/poky/meta/site/armeb-linux
@@ -0,0 +1,43 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
diff --git a/poky/meta/site/common b/poky/meta/site/common
new file mode 100644
index 000000000..ff552329b
--- /dev/null
+++ b/poky/meta/site/common
@@ -0,0 +1,21 @@
+# libelf
+mr_cv_target_elf=${mr_cv_target_elf=yes}
+
+# Normally kernels have /dev/random enabled
+ac_cv_file__dev_random=${ac_cv_file__dev_random=yes}
+
+# Avoid sudo to assume void for unsetenv in cross environment, or else it conflicts with
+# target stdlib.h prototype which follows POSIX compiliance. Mark for upstream.
+sudo_cv_func_unsetenv_void=no
+
+# shadow dir info, to avoid searching build system
+shadow_cv_maildir=${localstatedir}/spool/mail
+shadow_cv_mailfile=Mailbox
+shadow_cv_utmpdir=${localstatedir}/run
+shadow_cv_logdir=${localstatedir}/log
+shadow_cv_passwd_dir=${bindir}
+
+# python: deactivate a runtime check for ipv6-support in python >=2.7.1 that fails when cross-compiling
+ac_cv_buggy_getaddrinfo=no
+
+ac_cv_path_SED=${ac_cv_path_SED=sed}
diff --git a/poky/meta/site/common-darwin b/poky/meta/site/common-darwin
new file mode 100644
index 000000000..7d2d89874
--- /dev/null
+++ b/poky/meta/site/common-darwin
@@ -0,0 +1,2 @@
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
diff --git a/poky/meta/site/common-glibc b/poky/meta/site/common-glibc
new file mode 100644
index 000000000..1443f8e52
--- /dev/null
+++ b/poky/meta/site/common-glibc
@@ -0,0 +1,86 @@
+# general
+ac_cv_have_decl_sys_siglist=${ac_cv_have_decl_sys_siglist=yes}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_type_uid_t={ac_cv_type_uid_t=yes}
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+
+# bash
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=yes}
+bash_cv_sys_siglist=${bash_cv_sys_siglist=yes}
+bash_cv_getcwd_malloc=${bash_cv_getcwd_malloc=yes}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+# coreutils
+fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize=yes}
+
+# glib
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+ac_cv_func_printf_unix98=${ac_cv_func_printf_unix98=yes}
+ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
+ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
+glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+# glib-1.x requires this and pkgconfig-native / pkgconfig-nativesdk use
+# that to avoid a dependency loop.
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_va_copy=${glib_cv_va_copy=yes}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=yes}
+
+#dbus-glib
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# gnucash
+am_cv_scanf_lld=${am_cv_scanf_lld=yes}
+
+# guile
+ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
+
+#gcc-zlib
+ac_cv_func_getpagesize=${ac_cv_func_getpagesize=yes}
+ac_cv_func_memcpy=${ac_cv_func_memcpy=yes}
+ac_cv_func_strerror=${ac_cv_func_strerror=yes}
+
+# squid
+ac_cv_af_unix_large_dgram=${ac_cv_af_unix_large_dgram=yes}
+ac_cv_func_setresuid=${ac_cv_func_setresuid=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+ac_cv_epoll_works=${ac_cv_epoll_works=yes}
+
+ac_cv_check_sjlj=ssjlj
+
+# m4
+gt_cv_locale_fr=${gt_cv_locale_fr=fr_FR}
+gl_cv_func_btowc_eof=${gl_cv_func_btowc_eof=yes}
+gl_cv_func_wcrtomb_retval=${gl_cv_func_wcrtomb_retval=yes}
+gl_cv_func_wctob_works=${gl_cv_func_wctob_works=yes}
+gl_cv_func_mbrtowc_incomplete_state=${gl_cv_func_mbrtowc_incomplete_state=yes}
+gl_cv_func_mbrtowc_sanitycheck=${gl_cv_func_mbrtowc_sanitycheck=yes}
+gl_cv_func_mbrtowc_null_arg=${gl_cv_func_mbrtowc_null_arg=yes}
+gl_cv_func_mbrtowc_retval=${gl_cv_func_mbrtowc_retval=yes}
+gl_cv_func_mbrtowc_nul_retval=${gl_cv_func_mbrtowc_nul_retval=yes}
+
+# va_copy and _va_copy
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# Xorg
+xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
diff --git a/poky/meta/site/common-linux b/poky/meta/site/common-linux
new file mode 100644
index 000000000..71ec961b1
--- /dev/null
+++ b/poky/meta/site/common-linux
@@ -0,0 +1,67 @@
+# gettext - these add sleep delays otherwise
+gl_cv_func_sleep_works=${gl_cv_func_sleep_works=yes}
+gl_cv_header_working_fcntl_h=${gl_cv_header_working_fcntl_h=yes}
+
+# apr
+ac_cv_file__dev_zero=${ac_cv_file__dev_zero=yes}
+ac_cv_sizeof_pid_t=${ac_cv_sizeof_pid_t=4}
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+
+# samba
+samba_cv_HAVE_IFACE_AIX=${samba_cv_HAVE_IFACE_AIX=no}
+samba_cv_HAVE_IFACE_IFCONF=${samba_cv_HAVE_IFACE_IFCONF=yes}
+samba_cv_HAVE_IFACE_IFREQ=${samba_cv_HAVE_IFACE_IFREQ=yes}
+samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=${samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no}
+
+# db
+db_cv_path_ar=${db_cv_path_ar=/usr/bin/ar}
+db_cv_path_chmod=${db_cv_path_chmod=/bin/chmod}
+db_cv_path_cp=${db_cv_path_cp=/bin/cp}
+db_cv_path_ln=${db_cv_path_ln=/bin/ln}
+db_cv_path_mkdir=${db_cv_path_mkdir=/bin/mkdir}
+db_cv_path_ranlib=${db_cv_path_ranlib=/usr/bin/ranlib}
+db_cv_path_rm=${db_cv_path_rm=/bin/rm}
+db_cv_path_sh=${db_cv_path_sh=/bin/sh}
+db_cv_path_strip=${db_cv_path_strip=/usr/bin/strip}
+
+# bash
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers=no}
+bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken=no}
+bash_cv_dup2_broken=${bash_cv_dup2_broken=no}
+bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust=no}
+bash_cv_type_rlimit=${bash_cv_type_rlimit=rlim_t}
+bash_cv_getenv_redef=${bash_cv_getenv_redef=yes}
+bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds=yes}
+bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen=no}
+bash_cv_printf_a_format=${bash_cv_printf_a_format=yes}
+bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe=no}
+bash_cv_job_control_missing=${bash_cv_job_control_missing=present}
+bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=present}
+bash_cv_unusable_rtsigs=${bash_cv_unusable_rtsigs=no}
+
+# ccache
+hw_cv_func_snprintf_c99=${hw_cv_func_snprintf_c99=yes}
+hw_cv_func_vsnprintf_c99=${hw_cv_func_vsnprintf_c99=yes}
+
+# coreutils
+gl_cv_func_fstatat_zero_flag=${gl_cv_func_fstatat_zero_flag=yes}
+gl_cv_have_proc_uptime=${gl_cv_have_proc_uptime=yes}
+
+# mysql
+ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=yes}
+ac_cv_conv_longlong_to_float=${ac_cv_conv_longlong_to_float=yes}
+
+# TCL
+tcl_cv_api_serial=${tcl_cv_api_serial=termios}
+
+# python
+ac_cv_have_long_long_format=yes
+
+# apache
+ac_cv_o_nonblock_inherited=${ac_cv_o_nonblock_inherited=no}
+
+# rsync
+rsync_cv_HAVE_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=yes}
diff --git a/poky/meta/site/common-mingw b/poky/meta/site/common-mingw
new file mode 100644
index 000000000..f337c36e7
--- /dev/null
+++ b/poky/meta/site/common-mingw
@@ -0,0 +1,2 @@
+# expat
+ac_cv_func_mmap_fixed_mapped=no
diff --git a/poky/meta/site/common-musl b/poky/meta/site/common-musl
new file mode 100644
index 000000000..1b4fc3213
--- /dev/null
+++ b/poky/meta/site/common-musl
@@ -0,0 +1,53 @@
+# general
+ac_cv_have_decl_sys_siglist=${ac_cv_have_decl_sys_siglist=no}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+# glib
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+ac_cv_func_printf_unix98=${ac_cv_func_printf_unix98=yes}
+ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
+ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
+glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=no}
+
+#dbus-glib
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# bash
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=no}
+bash_cv_sys_siglist=${bash_cv_sys_siglist=no}
+
+# coreutils
+fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize=yes}
+gl_cv_func_gettimeofday_clobber=${gl_cv_func_gettimeofday_clobber=no}
+gl_cv_func_tzset_clobber=${gl_cv_func_tzset_clobber=no}
+gl_cv_func_gettimeofday_posix_signature=${gl_cv_func_gettimeofday_posix_signature=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=yes}
+ac_cv_func_posix_spawn_works=${ac_cv_func_posix_spawn_works=yes}
+
+# va_copy and _va_copy
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# posix_getpwuid_r posix_getgrgid_r posix_getpwnam_r
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# Xorg
+xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
diff --git a/poky/meta/site/endian-big b/poky/meta/site/endian-big
new file mode 100644
index 000000000..b99e96c20
--- /dev/null
+++ b/poky/meta/site/endian-big
@@ -0,0 +1,8 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
+
+# libnet
+ac_cv_libnet_endianess=${ac_cv_libnet_endianess=big}
+
+# libmemcached
+ac_cv_c_endian=big
diff --git a/poky/meta/site/endian-little b/poky/meta/site/endian-little
new file mode 100644
index 000000000..858db76b3
--- /dev/null
+++ b/poky/meta/site/endian-little
@@ -0,0 +1,8 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
+
+# libnet
+ac_cv_libnet_endianess=${ac_cv_libnet_endianess=lil}
+
+# libmemcached
+ac_cv_c_endian=little
diff --git a/poky/meta/site/ix86-common b/poky/meta/site/ix86-common
new file mode 100644
index 000000000..c5e354c07
--- /dev/null
+++ b/poky/meta/site/ix86-common
@@ -0,0 +1,224 @@
+# general
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_unsigned_char_p=${ac_cv_sizeof_unsigned_char_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_uid_t=${ac_cv_sizeof_uid_t=4}
+ac_cv_sizeof_gid_t=${ac_cv_sizeof_gid_t=4}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+ac_cv_path_ESD_CONFIG=no
+lf_cv_sane_realloc=yes
+jm_cv_func_gettimeofday_clobber=no
+samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
+bf_lsbf=1
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+# audacity
+ac_cv_file_lib_src_libmad_frame_h=${ac_cv_file_lib_src_libmad_frame_h=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# db
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=yes}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=4
+ac_cv_alignof_unsigned_long=4
+
+# guile
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# jikes-native
+ac_cv_sizeof_wchar_t=4
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# libnet
+ac_cv_lbl_unaligned_fail=${ac_cv_lbl_unaligned_fail=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=yes}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=yes}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_type_struct_timespec=${ac_cv_type_struct_timespec=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# xffm
+jm_cv_func_working_readdir=yes
+
+# xorg X11R7
+ac_cv_sys_linker_h=${ac_cv_sys_linker_h=no}
+ac_cv_file__usr_share_X11_sgml_defs_ent=${ac_cv_file__usr_share_X11_sgml_defs_ent=no}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
+#dbus
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+#libpciaccess
+have_mtrr_h=yes
+
+#mozilla
+moz_cv_size_of_JS_BYTES_PER_WORD=4
+moz_cv_align_of_JS_ALIGN_OF_POINTER=4
+moz_cv_size_of_JS_BYTES_PER_DOUBLE=8
+
+#ofono
+ac_cv_lib_c_signalfd=${ac_cv_lib_c_signalfd=yes}
+
+#unfs3
+nfsd_cv_broken_setfsuid=${nfsd_cv_broken_setfsuid=0}
+nfsd_cv_func_statfs=${nfsd_cv_func_statfs=statfs2_bsize}
+nfsd_cv_bsd_signals=${nfsd_cv_bsd_signals=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=4
+ac_cv_alignof_double=4
diff --git a/poky/meta/site/microblaze-linux b/poky/meta/site/microblaze-linux
new file mode 100644
index 000000000..c6a40c6be
--- /dev/null
+++ b/poky/meta/site/microblaze-linux
@@ -0,0 +1,54 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+# glib
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_copy=${glib_cv_va_copy=yes}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+
+# glib-2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
diff --git a/poky/meta/site/mips-common b/poky/meta/site/mips-common
new file mode 100644
index 000000000..5858dfb15
--- /dev/null
+++ b/poky/meta/site/mips-common
@@ -0,0 +1,53 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# ORBit2
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_wchar=2
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_struct=1
+
+# apache
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+# glib
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/poky/meta/site/mips-linux b/poky/meta/site/mips-linux
new file mode 100644
index 000000000..72a54f95e
--- /dev/null
+++ b/poky/meta/site/mips-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/poky/meta/site/mips64-linux b/poky/meta/site/mips64-linux
new file mode 100644
index 000000000..ed0fbbe65
--- /dev/null
+++ b/poky/meta/site/mips64-linux
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+ac_cv_sizeof_ssize_t=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/poky/meta/site/mips64el-linux b/poky/meta/site/mips64el-linux
new file mode 100644
index 000000000..680171d5e
--- /dev/null
+++ b/poky/meta/site/mips64el-linux
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+ac_cv_sizeof_ssize_t=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/poky/meta/site/mipsel-linux b/poky/meta/site/mipsel-linux
new file mode 100644
index 000000000..696b1beeb
--- /dev/null
+++ b/poky/meta/site/mipsel-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/poky/meta/site/mipsisa32r6-linux b/poky/meta/site/mipsisa32r6-linux
new file mode 100644
index 000000000..72a54f95e
--- /dev/null
+++ b/poky/meta/site/mipsisa32r6-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/poky/meta/site/mipsisa32r6el-linux b/poky/meta/site/mipsisa32r6el-linux
new file mode 100644
index 000000000..696b1beeb
--- /dev/null
+++ b/poky/meta/site/mipsisa32r6el-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/poky/meta/site/mipsisa64r6-linux b/poky/meta/site/mipsisa64r6-linux
new file mode 100644
index 000000000..ed0fbbe65
--- /dev/null
+++ b/poky/meta/site/mipsisa64r6-linux
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+ac_cv_sizeof_ssize_t=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/poky/meta/site/mipsisa64r6el-linux b/poky/meta/site/mipsisa64r6el-linux
new file mode 100644
index 000000000..680171d5e
--- /dev/null
+++ b/poky/meta/site/mipsisa64r6el-linux
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+ac_cv_sizeof_ssize_t=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/poky/meta/site/native b/poky/meta/site/native
new file mode 100644
index 000000000..7dfb1cbee
--- /dev/null
+++ b/poky/meta/site/native
@@ -0,0 +1 @@
+ac_cv_path_SED=sed
diff --git a/poky/meta/site/nios2-linux b/poky/meta/site/nios2-linux
new file mode 100644
index 000000000..67a3fc8a7
--- /dev/null
+++ b/poky/meta/site/nios2-linux
@@ -0,0 +1,387 @@
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# apache
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# db (sleepycat)
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_path_ar=${db_cv_path_ar=/usr/bin/ar}
+db_cv_path_chmod=${db_cv_path_chmod=/bin/chmod}
+db_cv_path_cp=${db_cv_path_cp=/bin/cp}
+db_cv_path_ln=${db_cv_path_ln=/bin/ln}
+db_cv_path_mkdir=${db_cv_path_mkdir=/bin/mkdir}
+db_cv_path_ranlib=${db_cv_path_ranlib=/usr/bin/ranlib}
+db_cv_path_rm=${db_cv_path_rm=/bin/rm}
+db_cv_path_sh=${db_cv_path_sh=/bin/sh}
+db_cv_path_strip=${db_cv_path_strip=/usr/bin/strip}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_posixmutexes=${db_cv_posixmutexes=no}
+db_cv_uimutexes=${db_cv_uimutexes=no}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# fnmatch
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# gio
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_copy=${glib_cv_va_copy=yes}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# glib-2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+#gstreamer
+as_cv_unaligned_access=${as_cv_unaligned_access=no}
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# ipsec-tools
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+racoon_cv_bug_getaddrinfo=${racoon_cv_bug_getaddrinfo=no}
+
+# jikes
+ac_cv_sizeof_wchar_t=4
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_copy=${lftp_cv_va_copy=yes}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+lftp_cv___va_copy=${lftp_cv___va_copy=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# libnet
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# mono
+cv_mono_sizeof_sunpath=108
+mono_cv_sizeof_sunpath=108
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+cv_php_mbstring_stdarg=${cv_php_mbstring_stdarg=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# slrn
+slrn_cv___va_copy=${slrn_cv___va_copy=yes}
+slrn_cv_va_copy=${slrn_cv_va_copy=yes}
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# sudo
+sudo_cv_uid_t_len=${sudo_cv_uid_t_len=10}
+
+# xffm
+jm_cv_func_working_readdir=yes
+
+# dpkg
+dpkg_cv_va_copy=${ac_cv_va_copy=yes}
+dpkg_cv___va_copy=${ac_cv___va_copy=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_malloc_works=yes
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=${samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes}
+samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=${samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_LINUX_SENDFILE=${samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=yes}
+samba_cv_HAVE_BROKEN_READDIR_NAME=${samba_cv_HAVE_BROKEN_READDIR_NAME=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_DQB_FSOFTLIMIT=${samba_cv_HAVE_DQB_FSOFTLIMIT=no}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FAM_H=${samba_cv_HAVE_FAM_H=no}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_FUNCTION_MACRO=${samba_cv_HAVE_FUNCTION_MACRO=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_INT16_FROM_RPC_RPC_H=${samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_INT32_FROM_RPC_RPC_H=${samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=${samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_NATIVE_ICONV=${samba_cv_HAVE_NATIVE_ICONV=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=yes}
+samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=${samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SOCK_SIN_LEN=${samba_cv_HAVE_SOCK_SIN_LEN=no}
+samba_cv_HAVE_STAT_ST_BLKSIZE=${samba_cv_HAVE_STAT_ST_BLKSIZE=yes}
+samba_cv_HAVE_STAT_ST_BLOCKS=${samba_cv_HAVE_STAT_ST_BLOCKS=yes}
+samba_cv_HAVE_STRUCT_DIR64=${samba_cv_HAVE_STRUCT_DIR64=no}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_UTIMBUF=${samba_cv_HAVE_UTIMBUF=yes}
+samba_cv_HAVE_UT_UT_ADDR=${samba_cv_HAVE_UT_UT_ADDR=yes}
+samba_cv_HAVE_UT_UT_EXIT=${samba_cv_HAVE_UT_UT_EXIT=yes}
+samba_cv_HAVE_UT_UT_HOST=${samba_cv_HAVE_UT_UT_HOST=yes}
+samba_cv_HAVE_UT_UT_ID=${samba_cv_HAVE_UT_UT_ID=yes}
+samba_cv_HAVE_UT_UT_NAME=${samba_cv_HAVE_UT_UT_NAME=yes}
+samba_cv_HAVE_UT_UT_PID=${samba_cv_HAVE_UT_UT_PID=yes}
+samba_cv_HAVE_UT_UT_TIME=${samba_cv_HAVE_UT_UT_TIME=yes}
+samba_cv_HAVE_UT_UT_TV=${samba_cv_HAVE_UT_UT_TV=yes}
+samba_cv_HAVE_UT_UT_TYPE=${samba_cv_HAVE_UT_UT_TYPE=yes}
+samba_cv_HAVE_UT_UT_USER=${samba_cv_HAVE_UT_UT_USER=yes}
+samba_cv_HAVE_UX_UT_SYSLEN=${samba_cv_HAVE_UX_UT_SYSLEN=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=yes}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_PUTUTLINE_RETURNS_UTMP=${samba_cv_PUTUTLINE_RETURNS_UTMP=yes}
+samba_cv_QUOTA_WORKS=${samba_cv_QUOTA_WORKS=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=yes}
+samba_cv_REPLACE_GETPASS=${samba_cv_REPLACE_GETPASS=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_REPLACE_READDIR=${samba_cv_REPLACE_READDIR=no}
+samba_cv_RUN_QUOTA_TESTS=${samba_cv_RUN_QUOTA_TESTS=yes}
+samba_cv_SEEKDIR_RETURNS_VOID=${samba_cv_SEEKDIR_RETURNS_VOID=yes}
+samba_cv_SIZEOF_DEV_T=${samba_cv_SIZEOF_DEV_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=${samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=yes}
+samba_cv_SYSCONF_SC_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSCONF_SC_PAGESIZE=${samba_cv_SYSCONF_SC_PAGESIZE=yes}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_SYSQUOTA_WORKS_XFS=${samba_cv_SYSQUOTA_WORKS_XFS=yes}
+samba_cv_TRY_QUOTAS=${samba_cv_TRY_QUOTAS=no}
+samba_cv_TRY_SYS_QUOTAS=${samba_cv_TRY_SYS_QUOTAS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_WE_USE_SYS_QUOTAS=${samba_cv_WE_USE_SYS_QUOTAS=yes}
+samba_cv_WITH_AFS=${samba_cv_WITH_AFS=no}
+samba_cv_WITH_FAKE_KASERVER=${samba_cv_WITH_FAKE_KASERVER=no}
+samba_cv_WITH_QUOTAS=${samba_cv_WITH_QUOTAS=auto}
+samba_cv_WITH_SYS_QUOTAS=${samba_cv_WITH_SYS_QUOTAS=auto}
+samba_cv_WITH_VFS_AFSACL=${samba_cv_WITH_VFS_AFSACL=no}
+samba_cv_compiler_supports_ll=${samba_cv_compiler_supports_ll=yes}
+samba_cv_found_xfs_header=${samba_cv_found_xfs_header=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_immediate_structures=${samba_cv_immediate_structures=yes}
+samba_cv_optimize_out_funcation_calls=${samba_cv_optimize_out_funcation_calls=yes}
+samba_cv_sig_atomic_t=${samba_cv_sig_atomic_t=yes}
+samba_cv_socklen_t=${samba_cv_socklen_t=yes}
+samba_cv_struct_timespec=${samba_cv_struct_timespec=yes}
+samba_cv_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_linux.c}
+samba_cv_unixsocket=${samba_cv_unixsocket=yes}
+samba_cv_volatile=${samba_cv_volatile=yes}
+
+#older sambe defines
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+
+#dbus
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# lftp
+ac_cv_file___dev_ptc_=yes
+
+# guile
+ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
+
+# gnet
+ac_cv_member_struct_sockaddr_sa_len=${ac_cv_member_struct_sockaddr_sa_len=no}
+ac_cv_gnet_have_abstract_sockets=${ac_cv_gnet_have_abstract_sockets=no}
+gnet_sockaddr_family_field_name=${gnet_sockaddr_family_field_name=ss_family}
diff --git a/poky/meta/site/powerpc-common b/poky/meta/site/powerpc-common
new file mode 100644
index 000000000..efa299c66
--- /dev/null
+++ b/poky/meta/site/powerpc-common
@@ -0,0 +1,14 @@
+# glib
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/poky/meta/site/powerpc-darwin b/poky/meta/site/powerpc-darwin
new file mode 100644
index 000000000..085f50b03
--- /dev/null
+++ b/poky/meta/site/powerpc-darwin
@@ -0,0 +1,7 @@
+# pkgconfig-native for OS X buid
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
diff --git a/poky/meta/site/powerpc-linux b/poky/meta/site/powerpc-linux
new file mode 100644
index 000000000..a9f89cb5d
--- /dev/null
+++ b/poky/meta/site/powerpc-linux
@@ -0,0 +1,16 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# glib
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+
+# lftp
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
diff --git a/poky/meta/site/powerpc32-linux b/poky/meta/site/powerpc32-linux
new file mode 100644
index 000000000..f37e915cb
--- /dev/null
+++ b/poky/meta/site/powerpc32-linux
@@ -0,0 +1,271 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_int=${ac_cv_sizeof_unsigned_long_int=4}
+ac_cv_sizeof_unsigned_long_long_int=${ac_cv_sizeof_unsigned_long_long_int=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_short_int=${ac_cv_sizeof_unsigned_short_int=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=4}
+ac_cv_type___int64=${ac_cv_type___int64=no}
+ac_cv_type_size_t=${ac_cv_type_size_t=yes}
+ac_cv_type_void_p=${ac_cv_type_void_p=yes}
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+cookie_io_functions_use_off64_t=${cookie_io_functions_use_off64_t=yes}
+
+
+# apache
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_type_struct_timespec=${ac_cv_type_struct_timespec=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+
+# libnet
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# db
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# glib 2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# openssh
+ac_cv_have_broken_dirname=${ac_cv_have_broken_dirname='yes'}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent='no'}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf='no'}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug='yes'}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr='no'}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr='yes'}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int='4'}
+
+#modphp
+ac_cv_c_bigendian_php=${ac_cv_c_bigendian_php=yes}
+ac_cv_sizeof_ptrdiff_t=${ac_cv_sizeof_ptrdiff_t=4}
+
+# apache2 (note other apache stanza in this file)
+ap_void_ptr_lt_long=${ap_void_ptr_lt_long=no}
+apr_cv_use_lfs64=${apr_cv_use_lfs64=yes}
+apr_cv_epoll=${apr_cv_epoll=yes}
+apr_cv_pthreads_cflags=${apr_cv_pthreads_cflags=-pthread}
+apr_cv_pthreads_lib=${apr_cv_pthreads_lib=-lpthread}
+ac_cv_func_mmap=${ac_cv_func_mmap=yes}
+ac_cv_file__dev_zero=${ac_cv_file__dev_zero=yes}
+ac_cv_sizeof_pid_t=${ac_cv_sizeof_pid_t=4}
+ac_cv_socklen_t=${ac_cv_socklen_t=yes}
+ac_cv_struct_rlimit=${ac_cv_struct_rlimit=yes}
+ac_cv_negative_eai=${ac_cv_negative_eai=yes}
+apr_cv_gai_addrconfig=${apr_cv_gai_addrconfig=no}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# binutils (libiberty)
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_type_int=${ac_cv_type_int=yes}
+ac_cv_type_uintptr_t=${ac_cv_type_uintptr_t=yes}
+liberty_cv_uint64=${liberty_cv_uint64=uint64_t}
+
+#samba
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=yes}
+samba_cv_HAVE_BROKEN_READDIR_NAME=${samba_cv_HAVE_BROKEN_READDIR_NAME=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_REPLACE_READDIR=${samba_cv_REPLACE_READDIR=no}
+samba_cv_SIZEOF_DEV_T=${samba_cv_SIZEOF_DEV_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+
+# libc
+libc_cv_ppc_machine=${libc_cv_ppc_machine=yes}
+libc_cv_mlong_double_128ibm=${libc_cv_mlong_double_128ibm=yes}
+libc_cv_mabi_ibmlongdouble=${libc_cv_mabi_ibmlongdouble=yes}
+libc_cv_mlong_double_128=${libc_cv_mlong_double_128=yes}
diff --git a/poky/meta/site/powerpc64-linux b/poky/meta/site/powerpc64-linux
new file mode 100644
index 000000000..d64e230af
--- /dev/null
+++ b/poky/meta/site/powerpc64-linux
@@ -0,0 +1,39 @@
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=8}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=8}
+ac_cv_sizeof_unsigned_long_int=${ac_cv_sizeof_unsigned_long_int=8}
+ac_cv_sizeof_unsigned_long_long_int=${ac_cv_sizeof_unsigned_long_long_int=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_short_int=${ac_cv_sizeof_unsigned_short_int=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# apr
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
diff --git a/poky/meta/site/riscv32-linux b/poky/meta/site/riscv32-linux
new file mode 100644
index 000000000..97de628e2
--- /dev/null
+++ b/poky/meta/site/riscv32-linux
@@ -0,0 +1,11 @@
+# general
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
diff --git a/poky/meta/site/riscv64-linux b/poky/meta/site/riscv64-linux
new file mode 100644
index 000000000..38bc5f044
--- /dev/null
+++ b/poky/meta/site/riscv64-linux
@@ -0,0 +1,11 @@
+# general
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
diff --git a/poky/meta/site/sh-common b/poky/meta/site/sh-common
new file mode 100644
index 000000000..97c96934d
--- /dev/null
+++ b/poky/meta/site/sh-common
@@ -0,0 +1,233 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+# lzo
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# apache
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+
+# db
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# glib 2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# jikes
+ac_cv_sizeof_wchar_t=4
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# fnmatch
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+
+# libnet
+ac_cv_lbl_unaligned_fail=${ac_cv_lbl_unaligned_fail=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
diff --git a/poky/meta/site/sparc-linux b/poky/meta/site/sparc-linux
new file mode 100644
index 000000000..49d0d9a3d
--- /dev/null
+++ b/poky/meta/site/sparc-linux
@@ -0,0 +1,48 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+libc_cv_mlong_double_128ibm=${libc_cv_mlong_double_128ibm=yes}
+libc_cv_mlong_double_128=${libc_cv_mlong_double_128=yes}
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+cookie_io_functions_use_off64_t=${cookie_io_functions_use_off64_t=yes}
+
+# minicom
+am_cv_sys_posix_termios=${am_cv_sys_posix_termios=yes}
+
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+#glib
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+
+#linux
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
diff --git a/poky/meta/site/x32-linux b/poky/meta/site/x32-linux
new file mode 100644
index 000000000..4b70422ed
--- /dev/null
+++ b/poky/meta/site/x32-linux
@@ -0,0 +1,8 @@
+# general
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_sys_file_offset_bits=${ac_cv_sys_file_offset_bits=64}
+ac_cv_alignof_double=8
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=32}
diff --git a/poky/meta/site/x86_64-linux b/poky/meta/site/x86_64-linux
new file mode 100644
index 000000000..778e2c53e
--- /dev/null
+++ b/poky/meta/site/x86_64-linux
@@ -0,0 +1,134 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=no}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+ac_cv_need_trio=${ac_cv_need_trio=no}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8}
+ac_cv_sizeof_uid_t=${ac_cv_sizeof_uid_t=4}
+ac_cv_sizeof_gid_t=${ac_cv_sizeof_gid_t=4}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long long'}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# glib
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=40}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=8}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=8}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=8}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=no}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+#gcc
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+
+#orbit
+libIDL_cv_long_long_format=ll
+
+# bash
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=8
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+
+lf_cv_sane_realloc=yes
+as_cv_unaligned_access=${as_cv_unaligned_access=yes}
+
+#unfs3
+nfsd_cv_broken_setfsuid=${nfsd_cv_broken_setfsuid=0}
+nfsd_cv_func_statfs=${nfsd_cv_func_statfs=statfs2_bsize}
+nfsd_cv_bsd_signals=${nfsd_cv_bsd_signals=yes}
+
+#apr
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# lftp
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=no}
+
+# grub
+ac_cv_func___ashldi3=no
+ac_cv_func___ashrdi3=no
+ac_cv_func___bswapdi2=no
+ac_cv_func___bswapsi2=no
+ac_cv_func___lshrdi3=no
+ac_cv_func___trampoline_setup=no
+ac_cv_func___ucmpdi2=no
+ac_cv_func__restgpr_14_x=no
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=8
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/poky/oe-init-build-env b/poky/oe-init-build-env
new file mode 100755
index 000000000..e813230a9
--- /dev/null
+++ b/poky/oe-init-build-env
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# OE Build Environment Setup Script
+#
+# Copyright (C) 2006-2011 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+#
+# Normally this is called as '. ./oe-init-build-env <builddir>'
+#
+# This works in most shells (not dash), but not all of them pass the arguments
+# when being sourced. To workaround the shell limitation use "set <builddir>"
+# prior to sourcing this script.
+#
+if [ -n "$BASH_SOURCE" ]; then
+ THIS_SCRIPT=$BASH_SOURCE
+elif [ -n "$ZSH_NAME" ]; then
+ THIS_SCRIPT=$0
+else
+ THIS_SCRIPT="$(pwd)/oe-init-build-env"
+fi
+if [ -n "$BBSERVER" ]; then
+ unset BBSERVER
+fi
+
+if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
+ echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
+ exit 1
+fi
+
+if [ -z "$OEROOT" ]; then
+ OEROOT=$(dirname "$THIS_SCRIPT")
+ OEROOT=$(readlink -f "$OEROOT")
+fi
+unset THIS_SCRIPT
+
+export OEROOT
+. $OEROOT/scripts/oe-buildenv-internal &&
+ TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir || {
+ unset OEROOT
+ return 1
+}
+unset OEROOT
+
+[ -z "$BUILDDIR" ] || cd "$BUILDDIR"
+
diff --git a/poky/scripts/README b/poky/scripts/README
new file mode 100644
index 000000000..1b8d12724
--- /dev/null
+++ b/poky/scripts/README
@@ -0,0 +1 @@
+This directory contains Various useful scripts for working with OE builds
diff --git a/poky/scripts/bitbake-prserv-tool b/poky/scripts/bitbake-prserv-tool
new file mode 100755
index 000000000..fa31b5258
--- /dev/null
+++ b/poky/scripts/bitbake-prserv-tool
@@ -0,0 +1,112 @@
+#!/usr/bin/env bash
+
+help ()
+{
+ base=`basename $0`
+ echo -e "Usage: $base command"
+ echo "Avaliable commands:"
+ echo -e "\texport <file.conf>: export and lock down the AUTOPR values from the PR service into a file for release."
+ echo -e "\timport <file.conf>: import the AUTOPR values from the exported file into the PR service."
+}
+
+clean_cache()
+{
+ s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"`
+ if [ "x${s}" != "x" ]; then
+ rm -rf ${s}
+ fi
+}
+
+do_export ()
+{
+ file=$1
+ [ "x${file}" == "x" ] && help && exit 1
+ rm -f ${file}
+
+ clean_cache
+ bitbake -R conf/prexport.conf -p
+ s=`bitbake -R conf/prexport.conf -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"`
+ if [ "x${s}" != "x" ];
+ then
+ [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!"
+ return 0
+ fi
+ echo "Exporting to file $file failed!"
+ return 1
+}
+
+do_import ()
+{
+ file=$1
+ [ "x${file}" == "x" ] && help && exit 1
+
+ clean_cache
+ bitbake -R conf/primport.conf -R $file -p
+ ret=$?
+ [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!"
+ return $ret
+}
+
+do_migrate_localcount ()
+{
+ df=`bitbake -R conf/migrate_localcount.conf -e | \
+ grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"`
+ if [ "x${df}" == "x" ];
+ then
+ echo "LOCALCOUNT_DUMPFILE is not defined!"
+ return 1
+ fi
+
+ rm -rf $df
+ clean_cache
+ echo "Exporting LOCALCOUNT to AUTOINCs..."
+ bitbake -R conf/migrate_localcount.conf -p
+ [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
+
+ if [ -e $df ];
+ then
+ echo "Exporting to file $df succeeded!"
+ else
+ echo "Exporting to file $df failed!"
+ exit 1
+ fi
+
+ echo "Importing generated AUTOINC entries..."
+ [ -e $df ] && do_import $df
+
+ if [ ! $? -eq 0 ]
+ then
+ echo "Migration from LOCALCOUNT to AUTOINCs failed!"
+ return 1
+ fi
+
+ echo "Migration from LOCALCOUNT to AUTOINCs succeeded!"
+ return 0
+}
+
+[ $# -eq 0 ] && help && exit 1
+
+case $2 in
+*.conf|*.inc)
+ ;;
+*)
+ echo ERROR: $2 must end with .conf or .inc!
+ exit 1
+ ;;
+esac
+
+case $1 in
+export)
+ do_export $2
+ ;;
+import)
+ do_import $2
+ ;;
+migrate_localcount)
+ do_migrate_localcount
+ ;;
+*)
+ help
+ exit 1
+ ;;
+esac
diff --git a/poky/scripts/bitbake-whatchanged b/poky/scripts/bitbake-whatchanged
new file mode 100755
index 000000000..0207777e6
--- /dev/null
+++ b/poky/scripts/bitbake-whatchanged
@@ -0,0 +1,330 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+# Copyright (c) 2013 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import os
+import sys
+import getopt
+import shutil
+import re
+import warnings
+import subprocess
+import argparse
+
+scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+
+import scriptpath
+
+# Figure out where is the bitbake/lib/bb since we need bb.siggen and bb.process
+bitbakepath = scriptpath.add_bitbake_lib_path()
+if not bitbakepath:
+ sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+ sys.exit(1)
+scriptpath.add_oe_lib_path()
+import argparse_oe
+
+import bb.siggen
+import bb.process
+
+# Match the stamp's filename
+# group(1): PE_PV (may no PE)
+# group(2): PR
+# group(3): TASK
+# group(4): HASH
+stamp_re = re.compile("(?P<pv>.*)-(?P<pr>r\d+)\.(?P<task>do_\w+)\.(?P<hash>[^\.]*)")
+sigdata_re = re.compile(".*\.sigdata\..*")
+
+def gen_dict(stamps):
+ """
+ Generate the dict from the stamps dir.
+ The output dict format is:
+ {fake_f: {pn: PN, pv: PV, pr: PR, task: TASK, path: PATH}}
+ Where:
+ fake_f: pv + task + hash
+ path: the path to the stamp file
+ """
+ # The member of the sub dict (A "path" will be appended below)
+ sub_mem = ("pv", "pr", "task")
+ d = {}
+ for dirpath, _, files in os.walk(stamps):
+ for f in files:
+ # The "bitbake -S" would generate ".sigdata", but no "_setscene".
+ fake_f = re.sub('_setscene.', '.', f)
+ fake_f = re.sub('.sigdata', '', fake_f)
+ subdict = {}
+ tmp = stamp_re.match(fake_f)
+ if tmp:
+ for i in sub_mem:
+ subdict[i] = tmp.group(i)
+ if len(subdict) != 0:
+ pn = os.path.basename(dirpath)
+ subdict['pn'] = pn
+ # The path will be used by os.stat() and bb.siggen
+ subdict['path'] = dirpath + "/" + f
+ fake_f = tmp.group('pv') + tmp.group('task') + tmp.group('hash')
+ d[fake_f] = subdict
+ return d
+
+# Re-construct the dict
+def recon_dict(dict_in):
+ """
+ The output dict format is:
+ {pn_task: {pv: PV, pr: PR, path: PATH}}
+ """
+ dict_out = {}
+ for k in dict_in.keys():
+ subdict = {}
+ # The key
+ pn_task = "%s_%s" % (dict_in.get(k).get('pn'), dict_in.get(k).get('task'))
+ # If more than one stamps are found, use the latest one.
+ if pn_task in dict_out:
+ full_path_pre = dict_out.get(pn_task).get('path')
+ full_path_cur = dict_in.get(k).get('path')
+ if os.stat(full_path_pre).st_mtime > os.stat(full_path_cur).st_mtime:
+ continue
+ subdict['pv'] = dict_in.get(k).get('pv')
+ subdict['pr'] = dict_in.get(k).get('pr')
+ subdict['path'] = dict_in.get(k).get('path')
+ dict_out[pn_task] = subdict
+
+ return dict_out
+
+def split_pntask(s):
+ """
+ Split the pn_task in to (pn, task) and return it
+ """
+ tmp = re.match("(.*)_(do_.*)", s)
+ return (tmp.group(1), tmp.group(2))
+
+
+def print_added(d_new = None, d_old = None):
+ """
+ Print the newly added tasks
+ """
+ added = {}
+ for k in list(d_new.keys()):
+ if k not in d_old:
+ # Add the new one to added dict, and remove it from
+ # d_new, so the remaining ones are the changed ones
+ added[k] = d_new.get(k)
+ del(d_new[k])
+
+ if not added:
+ return 0
+
+ # Format the output, the dict format is:
+ # {pn: task1, task2 ...}
+ added_format = {}
+ counter = 0
+ for k in added.keys():
+ pn, task = split_pntask(k)
+ if pn in added_format:
+ # Append the value
+ added_format[pn] = "%s %s" % (added_format.get(pn), task)
+ else:
+ added_format[pn] = task
+ counter += 1
+ print("=== Newly added tasks: (%s tasks)" % counter)
+ for k in added_format.keys():
+ print(" %s: %s" % (k, added_format.get(k)))
+
+ return counter
+
+def print_vrchanged(d_new = None, d_old = None, vr = None):
+ """
+ Print the pv or pr changed tasks.
+ The arg "vr" is "pv" or "pr"
+ """
+ pvchanged = {}
+ counter = 0
+ for k in list(d_new.keys()):
+ if d_new.get(k).get(vr) != d_old.get(k).get(vr):
+ counter += 1
+ pn, task = split_pntask(k)
+ if pn not in pvchanged:
+ # Format the output, we only print pn (no task) since
+ # all the tasks would be changed when pn or pr changed,
+ # the dict format is:
+ # {pn: pv/pr_old -> pv/pr_new}
+ pvchanged[pn] = "%s -> %s" % (d_old.get(k).get(vr), d_new.get(k).get(vr))
+ del(d_new[k])
+
+ if not pvchanged:
+ return 0
+
+ print("\n=== %s changed: (%s tasks)" % (vr.upper(), counter))
+ for k in pvchanged.keys():
+ print(" %s: %s" % (k, pvchanged.get(k)))
+
+ return counter
+
+def print_depchanged(d_new = None, d_old = None, verbose = False):
+ """
+ Print the dependency changes
+ """
+ depchanged = {}
+ counter = 0
+ for k in d_new.keys():
+ counter += 1
+ pn, task = split_pntask(k)
+ if (verbose):
+ full_path_old = d_old.get(k).get("path")
+ full_path_new = d_new.get(k).get("path")
+ # No counter since it is not ready here
+ if sigdata_re.match(full_path_old) and sigdata_re.match(full_path_new):
+ output = bb.siggen.compare_sigfiles(full_path_old, full_path_new)
+ if output:
+ print("\n=== The verbose changes of %s.%s:" % (pn, task))
+ print('\n'.join(output))
+ else:
+ # Format the output, the format is:
+ # {pn: task1, task2, ...}
+ if pn in depchanged:
+ depchanged[pn] = "%s %s" % (depchanged.get(pn), task)
+ else:
+ depchanged[pn] = task
+
+ if len(depchanged) > 0:
+ print("\n=== Dependencies changed: (%s tasks)" % counter)
+ for k in depchanged.keys():
+ print(" %s: %s" % (k, depchanged[k]))
+
+ return counter
+
+
+def main():
+ """
+ Print what will be done between the current and last builds:
+ 1) Run "STAMPS_DIR=<path> bitbake -S recipe" to re-generate the stamps
+ 2) Figure out what are newly added and changed, can't figure out
+ what are removed since we can't know the previous stamps
+ clearly, for example, if there are several builds, we can't know
+ which stamps the last build has used exactly.
+ 3) Use bb.siggen.compare_sigfiles to diff the old and new stamps
+ """
+
+ parser = argparse_oe.ArgumentParser(usage = """%(prog)s [options] [package ...]
+print what will be done between the current and last builds, for example:
+
+ $ bitbake core-image-sato
+ # Edit the recipes
+ $ bitbake-whatchanged core-image-sato
+
+The changes will be printed"
+
+Note:
+ The amount of tasks is not accurate when the task is "do_build" since
+ it usually depends on other tasks.
+ The "nostamp" task is not included.
+"""
+)
+ parser.add_argument("recipe", help="recipe to check")
+ parser.add_argument("-v", "--verbose", help = "print the verbose changes", action = "store_true")
+ args = parser.parse_args()
+
+ # Get the STAMPS_DIR
+ print("Figuring out the STAMPS_DIR ...")
+ cmdline = "bitbake -e | sed -ne 's/^STAMPS_DIR=\"\(.*\)\"/\\1/p'"
+ try:
+ stampsdir, err = bb.process.run(cmdline)
+ except:
+ raise
+ if not stampsdir:
+ print("ERROR: No STAMPS_DIR found for '%s'" % args.recipe, file=sys.stderr)
+ return 2
+ stampsdir = stampsdir.rstrip("\n")
+ if not os.path.isdir(stampsdir):
+ print("ERROR: stamps directory \"%s\" not found!" % stampsdir, file=sys.stderr)
+ return 2
+
+ # The new stamps dir
+ new_stampsdir = stampsdir + ".bbs"
+ if os.path.exists(new_stampsdir):
+ print("ERROR: %s already exists!" % new_stampsdir, file=sys.stderr)
+ return 2
+
+ try:
+ # Generate the new stamps dir
+ print("Generating the new stamps ... (need several minutes)")
+ cmdline = "STAMPS_DIR=%s bitbake -S none %s" % (new_stampsdir, args.recipe)
+ # FIXME
+ # The "bitbake -S" may fail, not fatal error, the stamps will still
+ # be generated, this might be a bug of "bitbake -S".
+ try:
+ bb.process.run(cmdline)
+ except Exception as exc:
+ print(exc)
+
+ # The dict for the new and old stamps.
+ old_dict = gen_dict(stampsdir)
+ new_dict = gen_dict(new_stampsdir)
+
+ # Remove the same one from both stamps.
+ cnt_unchanged = 0
+ for k in list(new_dict.keys()):
+ if k in old_dict:
+ cnt_unchanged += 1
+ del(new_dict[k])
+ del(old_dict[k])
+
+ # Re-construct the dict to easily find out what is added or changed.
+ # The dict format is:
+ # {pn_task: {pv: PV, pr: PR, path: PATH}}
+ new_recon = recon_dict(new_dict)
+ old_recon = recon_dict(old_dict)
+
+ del new_dict
+ del old_dict
+
+ # Figure out what are changed, the new_recon would be changed
+ # by the print_xxx function.
+ # Newly added
+ cnt_added = print_added(new_recon, old_recon)
+
+ # PV (including PE) and PR changed
+ # Let the bb.siggen handle them if verbose
+ cnt_rv = {}
+ if not args.verbose:
+ for i in ('pv', 'pr'):
+ cnt_rv[i] = print_vrchanged(new_recon, old_recon, i)
+
+ # Dependencies changed (use bitbake-diffsigs)
+ cnt_dep = print_depchanged(new_recon, old_recon, args.verbose)
+
+ total_changed = cnt_added + (cnt_rv.get('pv') or 0) + (cnt_rv.get('pr') or 0) + cnt_dep
+
+ print("\n=== Summary: (%s changed, %s unchanged)" % (total_changed, cnt_unchanged))
+ if args.verbose:
+ print("Newly added: %s\nDependencies changed: %s\n" % \
+ (cnt_added, cnt_dep))
+ else:
+ print("Newly added: %s\nPV changed: %s\nPR changed: %s\nDependencies changed: %s\n" % \
+ (cnt_added, cnt_rv.get('pv') or 0, cnt_rv.get('pr') or 0, cnt_dep))
+ except:
+ print("ERROR occurred!")
+ raise
+ finally:
+ # Remove the newly generated stamps dir
+ if os.path.exists(new_stampsdir):
+ print("Removing the newly generated stamps dir ...")
+ shutil.rmtree(new_stampsdir)
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/buildhistory-collect-srcrevs b/poky/scripts/buildhistory-collect-srcrevs
new file mode 100755
index 000000000..d375b045d
--- /dev/null
+++ b/poky/scripts/buildhistory-collect-srcrevs
@@ -0,0 +1,117 @@
+#!/usr/bin/env python3
+#
+# Collects the recorded SRCREV values from buildhistory and reports on them
+#
+# Copyright 2013 Intel Corporation
+# Authored-by: Paul Eggleton <paul.eggleton@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import collections
+import os
+import sys
+import optparse
+import logging
+
+def logger_create():
+ logger = logging.getLogger("buildhistory")
+ loggerhandler = logging.StreamHandler()
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(loggerhandler)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create()
+
+def main():
+ parser = optparse.OptionParser(
+ description = "Collects the recorded SRCREV values from buildhistory and reports on them.",
+ usage = """
+ %prog [options]""")
+
+ parser.add_option("-a", "--report-all",
+ help = "Report all SRCREV values, not just ones where AUTOREV has been used",
+ action="store_true", dest="reportall")
+ parser.add_option("-f", "--forcevariable",
+ help = "Use forcevariable override for all output lines",
+ action="store_true", dest="forcevariable")
+ parser.add_option("-p", "--buildhistory-dir",
+ help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)",
+ action="store", dest="buildhistory_dir", default='buildhistory/')
+
+ options, args = parser.parse_args(sys.argv)
+
+ if len(args) > 1:
+ sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args[1:]))
+ parser.print_help()
+ sys.exit(1)
+
+ if not os.path.exists(options.buildhistory_dir):
+ sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir)
+ parser.print_help()
+ sys.exit(1)
+
+ if options.forcevariable:
+ forcevariable = '_forcevariable'
+ else:
+ forcevariable = ''
+
+ all_srcrevs = collections.defaultdict(list)
+ for root, dirs, files in os.walk(options.buildhistory_dir):
+ if '.git' in dirs:
+ dirs.remove('.git')
+ for fn in files:
+ if fn == 'latest_srcrev':
+ curdir = os.path.basename(os.path.dirname(root))
+ fullpath = os.path.join(root, fn)
+ pn = os.path.basename(root)
+ srcrev = None
+ orig_srcrev = None
+ orig_srcrevs = {}
+ srcrevs = {}
+ with open(fullpath) as f:
+ for line in f:
+ if '=' in line:
+ splitval = line.split('=')
+ value = splitval[1].strip('" \t\n\r')
+ if line.startswith('# SRCREV = '):
+ orig_srcrev = value
+ elif line.startswith('# SRCREV_'):
+ splitval = line.split('=')
+ name = splitval[0].split('_')[1].strip()
+ orig_srcrevs[name] = value
+ elif line.startswith('SRCREV ='):
+ srcrev = value
+ elif line.startswith('SRCREV_'):
+ name = splitval[0].split('_')[1].strip()
+ srcrevs[name] = value
+ if srcrev and (options.reportall or srcrev != orig_srcrev):
+ all_srcrevs[curdir].append((pn, None, srcrev))
+ for name, value in srcrevs.items():
+ orig = orig_srcrevs.get(name, orig_srcrev)
+ if options.reportall or value != orig:
+ all_srcrevs[curdir].append((pn, name, value))
+
+ for curdir, srcrevs in sorted(all_srcrevs.items()):
+ if srcrevs:
+ print('# %s' % curdir)
+ for pn, name, srcrev in srcrevs:
+ if name:
+ print('SRCREV_%s_pn-%s%s = "%s"' % (name, pn, forcevariable, srcrev))
+ else:
+ print('SRCREV_pn-%s%s = "%s"' % (pn, forcevariable, srcrev))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/buildhistory-diff b/poky/scripts/buildhistory-diff
new file mode 100755
index 000000000..70805b067
--- /dev/null
+++ b/poky/scripts/buildhistory-diff
@@ -0,0 +1,139 @@
+#!/usr/bin/env python3
+
+# Report significant differences in the buildhistory repository since a specific revision
+#
+# Copyright (C) 2013 Intel Corporation
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+import sys
+import os
+import argparse
+from distutils.version import LooseVersion
+
+# Ensure PythonGit is installed (buildhistory_analysis needs it)
+try:
+ import git
+except ImportError:
+ print("Please install GitPython (python3-git) 0.3.4 or later in order to use this script")
+ sys.exit(1)
+
+def get_args_parser():
+ description = "Reports significant differences in the buildhistory repository."
+
+ parser = argparse.ArgumentParser(description=description,
+ usage="""
+ %(prog)s [options] [from-revision [to-revision]]
+ (if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)""")
+
+ parser.add_argument('-p', '--buildhistory-dir',
+ action='store',
+ dest='buildhistory_dir',
+ default='buildhistory/',
+ help="Specify path to buildhistory directory (defaults to buildhistory/ under cwd)")
+ parser.add_argument('-v', '--report-version',
+ action='store_true',
+ dest='report_ver',
+ default=False,
+ help="Report changes in PKGE/PKGV/PKGR even when the values are still the default (PE/PV/PR)")
+ parser.add_argument('-a', '--report-all',
+ action='store_true',
+ dest='report_all',
+ default=False,
+ help="Report all changes, not just the default significant ones")
+ parser.add_argument('-s', '---signatures',
+ action='store_true',
+ dest='sigs',
+ default=False,
+ help="Report list of signatures differing instead of output")
+ parser.add_argument('-S', '--signatures-with-diff',
+ action='store_true',
+ dest='sigsdiff',
+ default=False,
+ help="Report on actual signature differences instead of output (requires signature data to have been generated, either by running the actual tasks or using bitbake -S)")
+ parser.add_argument('-e', '--exclude-path',
+ action='append',
+ help="Exclude path from the output")
+ parser.add_argument('-c', '--colour',
+ choices=('yes', 'no', 'auto'),
+ default="auto",
+ help="Whether to colourise (defaults to auto)")
+ parser.add_argument('revisions',
+ default = ['build-minus-1', 'HEAD'],
+ nargs='*',
+ help=argparse.SUPPRESS)
+ return parser
+
+def main():
+
+ parser = get_args_parser()
+ args = parser.parse_args()
+
+ if LooseVersion(git.__version__) < '0.3.1':
+ sys.stderr.write("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script\n")
+ sys.exit(1)
+
+ if len(args.revisions) > 2:
+ sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args.revisions[2:]))
+ parser.print_help()
+
+ sys.exit(1)
+ if not os.path.exists(args.buildhistory_dir):
+ if args.buildhistory_dir == 'buildhistory/':
+ cwd = os.getcwd()
+ if os.path.basename(cwd) == 'buildhistory':
+ args.buildhistory_dir = cwd
+
+ if not os.path.exists(args.buildhistory_dir):
+ sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % args.buildhistory_dir)
+ parser.print_help()
+ sys.exit(1)
+
+ scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
+ lib_path = scripts_path + '/lib'
+ sys.path = sys.path + [lib_path]
+
+ import scriptpath
+
+ # Set path to OE lib dir so we can import the buildhistory_analysis module
+ scriptpath.add_oe_lib_path()
+ # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+
+ if not bitbakepath:
+ sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+ sys.exit(1)
+
+ if len(args.revisions) == 1:
+ if '..' in args.revisions[0]:
+ fromrev, torev = args.revisions[0].split('..')
+ else:
+ fromrev, torev = args.revisions[0], 'HEAD'
+ elif len(args.revisions) == 2:
+ fromrev, torev = args.revisions
+
+ from oe.buildhistory_analysis import init_colours, process_changes
+ import gitdb
+
+ init_colours({"yes": True, "no": False, "auto": sys.stdout.isatty()}[args.colour])
+
+ try:
+ changes = process_changes(args.buildhistory_dir, fromrev, torev,
+ args.report_all, args.report_ver, args.sigs,
+ args.sigsdiff, args.exclude_path)
+ except gitdb.exc.BadObject as e:
+ if not args.revisions:
+ sys.stderr.write("Unable to find previous build revision in buildhistory repository\n\n")
+ parser.print_help()
+ else:
+ sys.stderr.write('Specified git revision "%s" is not valid\n' % e.args[0])
+ sys.exit(1)
+
+ for chg in changes:
+ out = str(chg)
+ if out:
+ print(out)
+
+ sys.exit(0)
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/buildstats-diff b/poky/scripts/buildstats-diff
new file mode 100755
index 000000000..a128dd324
--- /dev/null
+++ b/poky/scripts/buildstats-diff
@@ -0,0 +1,306 @@
+#!/usr/bin/python3
+#
+# Script for comparing buildstats from two different builds
+#
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+import argparse
+import glob
+import logging
+import math
+import os
+import sys
+from operator import attrgetter
+
+# Import oe libs
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(scripts_path, 'lib'))
+from buildstats import BuildStats, diff_buildstats, taskdiff_fields, BSVerDiff
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger()
+
+
+class ScriptError(Exception):
+ """Exception for internal error handling of this script"""
+ pass
+
+
+def read_buildstats(path, multi):
+ """Read buildstats"""
+ if not os.path.exists(path):
+ raise ScriptError("No such file or directory: {}".format(path))
+
+ if os.path.isfile(path):
+ return BuildStats.from_file_json(path)
+
+ if os.path.isfile(os.path.join(path, 'build_stats')):
+ return BuildStats.from_dir(path)
+
+ # Handle a non-buildstat directory
+ subpaths = sorted(glob.glob(path + '/*'))
+ if len(subpaths) > 1:
+ if multi:
+ log.info("Averaging over {} buildstats from {}".format(
+ len(subpaths), path))
+ else:
+ raise ScriptError("Multiple buildstats found in '{}'. Please give "
+ "a single buildstat directory of use the --multi "
+ "option".format(path))
+ bs = None
+ for subpath in subpaths:
+ if os.path.isfile(subpath):
+ _bs = BuildStats.from_file_json(subpath)
+ else:
+ _bs = BuildStats.from_dir(subpath)
+ if bs is None:
+ bs = _bs
+ else:
+ bs.aggregate(_bs)
+ if not bs:
+ raise ScriptError("No buildstats found under {}".format(path))
+
+ return bs
+
+
+def print_ver_diff(bs1, bs2):
+ """Print package version differences"""
+
+ diff = BSVerDiff(bs1, bs2)
+
+ maxlen = max([len(r) for r in set(bs1.keys()).union(set(bs2.keys()))])
+ fmt_str = " {:{maxlen}} ({})"
+
+ if diff.new:
+ print("\nNEW RECIPES:")
+ print("------------")
+ for name, val in sorted(diff.new.items()):
+ print(fmt_str.format(name, val.nevr, maxlen=maxlen))
+
+ if diff.dropped:
+ print("\nDROPPED RECIPES:")
+ print("----------------")
+ for name, val in sorted(diff.dropped.items()):
+ print(fmt_str.format(name, val.nevr, maxlen=maxlen))
+
+ fmt_str = " {0:{maxlen}} {1:<20} ({2})"
+ if diff.rchanged:
+ print("\nREVISION CHANGED:")
+ print("-----------------")
+ for name, val in sorted(diff.rchanged.items()):
+ field1 = "{} -> {}".format(val.left.revision, val.right.revision)
+ field2 = "{} -> {}".format(val.left.nevr, val.right.nevr)
+ print(fmt_str.format(name, field1, field2, maxlen=maxlen))
+
+ if diff.vchanged:
+ print("\nVERSION CHANGED:")
+ print("----------------")
+ for name, val in sorted(diff.vchanged.items()):
+ field1 = "{} -> {}".format(val.left.version, val.right.version)
+ field2 = "{} -> {}".format(val.left.nevr, val.right.nevr)
+ print(fmt_str.format(name, field1, field2, maxlen=maxlen))
+
+ if diff.echanged:
+ print("\nEPOCH CHANGED:")
+ print("--------------")
+ for name, val in sorted(diff.echanged.items()):
+ field1 = "{} -> {}".format(val.left.epoch, val.right.epoch)
+ field2 = "{} -> {}".format(val.left.nevr, val.right.nevr)
+ print(fmt_str.format(name, field1, field2, maxlen=maxlen))
+
+
+def print_task_diff(bs1, bs2, val_type, min_val=0, min_absdiff=0, sort_by=('absdiff',)):
+ """Diff task execution times"""
+ def val_to_str(val, human_readable=False):
+ """Convert raw value to printable string"""
+ def hms_time(secs):
+ """Get time in human-readable HH:MM:SS format"""
+ h = int(secs / 3600)
+ m = int((secs % 3600) / 60)
+ s = secs % 60
+ if h == 0:
+ return "{:02d}:{:04.1f}".format(m, s)
+ else:
+ return "{:d}:{:02d}:{:04.1f}".format(h, m, s)
+
+ if 'time' in val_type:
+ if human_readable:
+ return hms_time(val)
+ else:
+ return "{:.1f}s".format(val)
+ elif 'bytes' in val_type and human_readable:
+ prefix = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi']
+ dec = int(math.log(val, 2) / 10)
+ prec = 1 if dec > 0 else 0
+ return "{:.{prec}f}{}B".format(val / (2 ** (10 * dec)),
+ prefix[dec], prec=prec)
+ elif 'ops' in val_type and human_readable:
+ prefix = ['', 'k', 'M', 'G', 'T', 'P']
+ dec = int(math.log(val, 1000))
+ prec = 1 if dec > 0 else 0
+ return "{:.{prec}f}{}ops".format(val / (1000 ** dec),
+ prefix[dec], prec=prec)
+ return str(int(val))
+
+ def sum_vals(buildstats):
+ """Get cumulative sum of all tasks"""
+ total = 0.0
+ for recipe_data in buildstats.values():
+ for bs_task in recipe_data.tasks.values():
+ total += getattr(bs_task, val_type)
+ return total
+
+ if min_val:
+ print("Ignoring tasks less than {} ({})".format(
+ val_to_str(min_val, True), val_to_str(min_val)))
+ if min_absdiff:
+ print("Ignoring differences less than {} ({})".format(
+ val_to_str(min_absdiff, True), val_to_str(min_absdiff)))
+
+ # Prepare the data
+ tasks_diff = diff_buildstats(bs1, bs2, val_type, min_val, min_absdiff)
+
+ # Sort our list
+ for field in reversed(sort_by):
+ if field.startswith('-'):
+ field = field[1:]
+ reverse = True
+ else:
+ reverse = False
+ tasks_diff = sorted(tasks_diff, key=attrgetter(field), reverse=reverse)
+
+ linedata = [(' ', 'PKG', ' ', 'TASK', 'ABSDIFF', 'RELDIFF',
+ val_type.upper() + '1', val_type.upper() + '2')]
+ field_lens = dict([('len_{}'.format(i), len(f)) for i, f in enumerate(linedata[0])])
+
+ # Prepare fields in string format and measure field lengths
+ for diff in tasks_diff:
+ task_prefix = diff.task_op if diff.pkg_op == ' ' else ' '
+ linedata.append((diff.pkg_op, diff.pkg, task_prefix, diff.task,
+ val_to_str(diff.absdiff),
+ '{:+.1f}%'.format(diff.reldiff),
+ val_to_str(diff.value1),
+ val_to_str(diff.value2)))
+ for i, field in enumerate(linedata[-1]):
+ key = 'len_{}'.format(i)
+ if len(field) > field_lens[key]:
+ field_lens[key] = len(field)
+
+ # Print data
+ print()
+ for fields in linedata:
+ print("{:{len_0}}{:{len_1}} {:{len_2}}{:{len_3}} {:>{len_4}} {:>{len_5}} {:>{len_6}} -> {:{len_7}}".format(
+ *fields, **field_lens))
+
+ # Print summary of the diffs
+ total1 = sum_vals(bs1)
+ total2 = sum_vals(bs2)
+ print("\nCumulative {}:".format(val_type))
+ print (" {} {:+.1f}% {} ({}) -> {} ({})".format(
+ val_to_str(total2 - total1), 100 * (total2-total1) / total1,
+ val_to_str(total1, True), val_to_str(total1),
+ val_to_str(total2, True), val_to_str(total2)))
+
+
+def parse_args(argv):
+ """Parse cmdline arguments"""
+ description="""
+Script for comparing buildstats of two separate builds."""
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=description)
+
+ min_val_defaults = {'cputime': 3.0,
+ 'read_bytes': 524288,
+ 'write_bytes': 524288,
+ 'read_ops': 500,
+ 'write_ops': 500,
+ 'walltime': 5}
+ min_absdiff_defaults = {'cputime': 1.0,
+ 'read_bytes': 131072,
+ 'write_bytes': 131072,
+ 'read_ops': 50,
+ 'write_ops': 50,
+ 'walltime': 2}
+
+ parser.add_argument('--debug', '-d', action='store_true',
+ help="Verbose logging")
+ parser.add_argument('--ver-diff', action='store_true',
+ help="Show package version differences and exit")
+ parser.add_argument('--diff-attr', default='cputime',
+ choices=min_val_defaults.keys(),
+ help="Buildstat attribute which to compare")
+ parser.add_argument('--min-val', default=min_val_defaults, type=float,
+ help="Filter out tasks less than MIN_VAL. "
+ "Default depends on --diff-attr.")
+ parser.add_argument('--min-absdiff', default=min_absdiff_defaults, type=float,
+ help="Filter out tasks whose difference is less than "
+ "MIN_ABSDIFF, Default depends on --diff-attr.")
+ parser.add_argument('--sort-by', default='absdiff',
+ help="Comma-separated list of field sort order. "
+ "Prepend the field name with '-' for reversed sort. "
+ "Available fields are: {}".format(', '.join(taskdiff_fields)))
+ parser.add_argument('--multi', action='store_true',
+ help="Read all buildstats from the given paths and "
+ "average over them")
+ parser.add_argument('buildstats1', metavar='BUILDSTATS1', help="'Left' buildstat")
+ parser.add_argument('buildstats2', metavar='BUILDSTATS2', help="'Right' buildstat")
+
+ args = parser.parse_args(argv)
+
+ # We do not nedd/want to read all buildstats if we just want to look at the
+ # package versions
+ if args.ver_diff:
+ args.multi = False
+
+ # Handle defaults for the filter arguments
+ if args.min_val is min_val_defaults:
+ args.min_val = min_val_defaults[args.diff_attr]
+ if args.min_absdiff is min_absdiff_defaults:
+ args.min_absdiff = min_absdiff_defaults[args.diff_attr]
+
+ return args
+
+
+def main(argv=None):
+ """Script entry point"""
+ args = parse_args(argv)
+ if args.debug:
+ log.setLevel(logging.DEBUG)
+
+ # Validate sort fields
+ sort_by = []
+ for field in args.sort_by.split(','):
+ if field.lstrip('-') not in taskdiff_fields:
+ log.error("Invalid sort field '%s' (must be one of: %s)" %
+ (field, ', '.join(taskdiff_fields)))
+ sys.exit(1)
+ sort_by.append(field)
+
+ try:
+ bs1 = read_buildstats(args.buildstats1, args.multi)
+ bs2 = read_buildstats(args.buildstats2, args.multi)
+
+ if args.ver_diff:
+ print_ver_diff(bs1, bs2)
+ else:
+ print_task_diff(bs1, bs2, args.diff_attr, args.min_val,
+ args.min_absdiff, sort_by)
+ except ScriptError as err:
+ log.error(str(err))
+ return 1
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/combo-layer b/poky/scripts/combo-layer
new file mode 100755
index 000000000..d04d88b07
--- /dev/null
+++ b/poky/scripts/combo-layer
@@ -0,0 +1,1376 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright 2011 Intel Corporation
+# Authored-by: Yu Ke <ke.yu@intel.com>
+# Paul Eggleton <paul.eggleton@intel.com>
+# Richard Purdie <richard.purdie@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import fnmatch
+import os, sys
+import optparse
+import logging
+import subprocess
+import tempfile
+import configparser
+import re
+import copy
+import pipes
+import shutil
+from collections import OrderedDict
+from string import Template
+from functools import reduce
+
+__version__ = "0.2.1"
+
+def logger_create():
+ logger = logging.getLogger("")
+ loggerhandler = logging.StreamHandler()
+ loggerhandler.setFormatter(logging.Formatter("[%(asctime)s] %(message)s","%H:%M:%S"))
+ logger.addHandler(loggerhandler)
+ logger.setLevel(logging.INFO)
+ return logger
+
+logger = logger_create()
+
+def get_current_branch(repodir=None):
+ try:
+ if not os.path.exists(os.path.join(repodir if repodir else '', ".git")):
+ # Repo not created yet (i.e. during init) so just assume master
+ return "master"
+ branchname = runcmd("git symbolic-ref HEAD 2>/dev/null", repodir).strip()
+ if branchname.startswith("refs/heads/"):
+ branchname = branchname[11:]
+ return branchname
+ except subprocess.CalledProcessError:
+ return ""
+
+class Configuration(object):
+ """
+ Manages the configuration
+
+ For an example config file, see combo-layer.conf.example
+
+ """
+ def __init__(self, options):
+ for key, val in options.__dict__.items():
+ setattr(self, key, val)
+
+ def readsection(parser, section, repo):
+ for (name, value) in parser.items(section):
+ if value.startswith("@"):
+ self.repos[repo][name] = eval(value.strip("@"))
+ else:
+ # Apply special type transformations for some properties.
+ # Type matches the RawConfigParser.get*() methods.
+ types = {'signoff': 'boolean', 'update': 'boolean', 'history': 'boolean'}
+ if name in types:
+ value = getattr(parser, 'get' + types[name])(section, name)
+ self.repos[repo][name] = value
+
+ def readglobalsection(parser, section):
+ for (name, value) in parser.items(section):
+ if name == "commit_msg":
+ self.commit_msg_template = value
+
+ logger.debug("Loading config file %s" % self.conffile)
+ self.parser = configparser.ConfigParser()
+ with open(self.conffile) as f:
+ self.parser.readfp(f)
+
+ # initialize default values
+ self.commit_msg_template = "Automatic commit to update last_revision"
+
+ self.repos = {}
+ for repo in self.parser.sections():
+ if repo == "combo-layer-settings":
+ # special handling for global settings
+ readglobalsection(self.parser, repo)
+ else:
+ self.repos[repo] = {}
+ readsection(self.parser, repo, repo)
+
+ # Load local configuration, if available
+ self.localconffile = None
+ self.localparser = None
+ self.combobranch = None
+ if self.conffile.endswith('.conf'):
+ lcfile = self.conffile.replace('.conf', '-local.conf')
+ if os.path.exists(lcfile):
+ # Read combo layer branch
+ self.combobranch = get_current_branch()
+ logger.debug("Combo layer branch is %s" % self.combobranch)
+
+ self.localconffile = lcfile
+ logger.debug("Loading local config file %s" % self.localconffile)
+ self.localparser = configparser.ConfigParser()
+ with open(self.localconffile) as f:
+ self.localparser.readfp(f)
+
+ for section in self.localparser.sections():
+ if '|' in section:
+ sectionvals = section.split('|')
+ repo = sectionvals[0]
+ if sectionvals[1] != self.combobranch:
+ continue
+ else:
+ repo = section
+ if repo in self.repos:
+ readsection(self.localparser, section, repo)
+
+ def update(self, repo, option, value, initmode=False):
+ # If the main config has the option already, that is what we
+ # are expected to modify.
+ if self.localparser and not self.parser.has_option(repo, option):
+ parser = self.localparser
+ section = "%s|%s" % (repo, self.combobranch)
+ conffile = self.localconffile
+ if initmode and not parser.has_section(section):
+ parser.add_section(section)
+ else:
+ parser = self.parser
+ section = repo
+ conffile = self.conffile
+ parser.set(section, option, value)
+ with open(conffile, "w") as f:
+ parser.write(f)
+ self.repos[repo][option] = value
+
+ def sanity_check(self, initmode=False):
+ required_options=["src_uri", "local_repo_dir", "dest_dir", "last_revision"]
+ if initmode:
+ required_options.remove("last_revision")
+ msg = ""
+ missing_options = []
+ for name in self.repos:
+ for option in required_options:
+ if option not in self.repos[name]:
+ msg = "%s\nOption %s is not defined for component %s" %(msg, option, name)
+ missing_options.append(option)
+ # Sanitize dest_dir so that we do not have to deal with edge cases
+ # (unset, empty string, double slashes) in the rest of the code.
+ # It not being set will still be flagged as error because it is
+ # listed as required option above; that could be changed now.
+ dest_dir = os.path.normpath(self.repos[name].get("dest_dir", "."))
+ self.repos[name]["dest_dir"] = "." if not dest_dir else dest_dir
+ if msg != "":
+ logger.error("configuration file %s has the following error: %s" % (self.conffile,msg))
+ if self.localconffile and 'last_revision' in missing_options:
+ logger.error("local configuration file %s may be missing configuration for combo branch %s" % (self.localconffile, self.combobranch))
+ sys.exit(1)
+
+ # filterdiff is required by action_splitpatch, so check its availability
+ if subprocess.call("which filterdiff > /dev/null 2>&1", shell=True) != 0:
+ logger.error("ERROR: patchutils package is missing, please install it (e.g. # apt-get install patchutils)")
+ sys.exit(1)
+
+def runcmd(cmd,destdir=None,printerr=True,out=None,env=None):
+ """
+ execute command, raise CalledProcessError if fail
+ return output if succeed
+ """
+ logger.debug("run cmd '%s' in %s" % (cmd, os.getcwd() if destdir is None else destdir))
+ if not out:
+ out = tempfile.TemporaryFile()
+ err = out
+ else:
+ err = tempfile.TemporaryFile()
+ try:
+ subprocess.check_call(cmd, stdout=out, stderr=err, cwd=destdir, shell=isinstance(cmd, str), env=env or os.environ)
+ except subprocess.CalledProcessError as e:
+ err.seek(0)
+ if printerr:
+ logger.error("%s" % err.read())
+ raise e
+
+ err.seek(0)
+ output = err.read().decode('utf-8')
+ logger.debug("output: %s" % output.replace(chr(0), '\\0'))
+ return output
+
+def action_init(conf, args):
+ """
+ Clone component repositories
+ Check git is initialised; if not, copy initial data from component repos
+ """
+ for name in conf.repos:
+ ldir = conf.repos[name]['local_repo_dir']
+ if not os.path.exists(ldir):
+ logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir))
+ subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True)
+ if not os.path.exists(".git"):
+ runcmd("git init")
+ if conf.history:
+ # Need a common ref for all trees.
+ runcmd('git commit -m "initial empty commit" --allow-empty')
+ startrev = runcmd('git rev-parse master').strip()
+
+ for name in conf.repos:
+ repo = conf.repos[name]
+ ldir = repo['local_repo_dir']
+ branch = repo.get('branch', "master")
+ lastrev = repo.get('last_revision', None)
+ if lastrev and lastrev != "HEAD":
+ initialrev = lastrev
+ if branch:
+ if not check_rev_branch(name, ldir, lastrev, branch):
+ sys.exit(1)
+ logger.info("Copying data from %s at specified revision %s..." % (name, lastrev))
+ else:
+ lastrev = None
+ initialrev = branch
+ logger.info("Copying data from %s..." % name)
+ # Sanity check initialrev and turn it into hash (required for copying history,
+ # because resolving a name ref only works in the component repo).
+ rev = runcmd('git rev-parse %s' % initialrev, ldir).strip()
+ if rev != initialrev:
+ try:
+ refs = runcmd('git show-ref -s %s' % initialrev, ldir).split('\n')
+ if len(set(refs)) > 1:
+ # Happens for example when configured to track
+ # "master" and there is a refs/heads/master. The
+ # traditional behavior from "git archive" (preserved
+ # here) it to choose the first one. This might not be
+ # intended, so at least warn about it.
+ logger.warn("%s: initial revision '%s' not unique, picking result of rev-parse = %s" %
+ (name, initialrev, refs[0]))
+ initialrev = rev
+ except:
+ # show-ref fails for hashes. Skip the sanity warning in that case.
+ pass
+ initialrev = rev
+ dest_dir = repo['dest_dir']
+ if dest_dir != ".":
+ extract_dir = os.path.join(os.getcwd(), dest_dir)
+ if not os.path.exists(extract_dir):
+ os.makedirs(extract_dir)
+ else:
+ extract_dir = os.getcwd()
+ file_filter = repo.get('file_filter', "")
+ exclude_patterns = repo.get('file_exclude', '').split()
+ def copy_selected_files(initialrev, extract_dir, file_filter, exclude_patterns, ldir,
+ subdir=""):
+ # When working inside a filtered branch which had the
+ # files already moved, we need to prepend the
+ # subdirectory to all filters, otherwise they would
+ # not match.
+ if subdir == '.':
+ subdir = ''
+ elif subdir:
+ subdir = os.path.normpath(subdir)
+ file_filter = ' '.join([subdir + '/' + x for x in file_filter.split()])
+ exclude_patterns = [subdir + '/' + x for x in exclude_patterns]
+ # To handle both cases, we cd into the target
+ # directory and optionally tell tar to strip the path
+ # prefix when the files were already moved.
+ subdir_components = len(subdir.split(os.path.sep)) if subdir else 0
+ strip=('--strip-components=%d' % subdir_components) if subdir else ''
+ # TODO: file_filter wild cards do not work (and haven't worked before either), because
+ # a) GNU tar requires a --wildcards parameter before turning on wild card matching.
+ # b) The semantic is not as intendend (src/*.c also matches src/foo/bar.c,
+ # in contrast to the other use of file_filter as parameter of "git archive"
+ # where it only matches .c files directly in src).
+ files = runcmd("git archive %s %s | tar -x -v %s -C %s %s" %
+ (initialrev, subdir,
+ strip, extract_dir, file_filter),
+ ldir)
+ if exclude_patterns:
+ # Implement file removal by letting tar create the
+ # file and then deleting it in the file system
+ # again. Uses the list of files created by tar (easier
+ # than walking the tree).
+ for file in files.split('\n'):
+ if file.endswith(os.path.sep):
+ continue
+ for pattern in exclude_patterns:
+ if fnmatch.fnmatch(file, pattern):
+ os.unlink(os.path.join(*([extract_dir] + ['..'] * subdir_components + [file])))
+ break
+
+ if not conf.history:
+ copy_selected_files(initialrev, extract_dir, file_filter, exclude_patterns, ldir)
+ else:
+ # First fetch remote history into local repository.
+ # We need a ref for that, so ensure that there is one.
+ refname = "combo-layer-init-%s" % name
+ runcmd("git branch -f %s %s" % (refname, initialrev), ldir)
+ runcmd("git fetch %s %s" % (ldir, refname))
+ runcmd("git branch -D %s" % refname, ldir)
+ # Make that the head revision.
+ runcmd("git checkout -b %s %s" % (name, initialrev))
+ # Optional: cut the history by replacing the given
+ # start point(s) with commits providing the same
+ # content (aka tree), but with commit information that
+ # makes it clear that this is an artifically created
+ # commit and nothing the original authors had anything
+ # to do with.
+ since_rev = repo.get('since_revision', '')
+ if since_rev:
+ committer = runcmd('git var GIT_AUTHOR_IDENT').strip()
+ # Same time stamp, no name.
+ author = re.sub('.* (\d+ [+-]\d+)', r'unknown <unknown> \1', committer)
+ logger.info('author %s' % author)
+ for rev in since_rev.split():
+ # Resolve in component repo...
+ rev = runcmd('git log --oneline --no-abbrev-commit -n1 %s' % rev, ldir).split()[0]
+ # ... and then get the tree in current
+ # one. The commit should be in both repos with
+ # the same tree, but better check here.
+ tree = runcmd('git show -s --pretty=format:%%T %s' % rev).strip()
+ with tempfile.NamedTemporaryFile(mode='wt') as editor:
+ editor.write('''cat >$1 <<EOF
+tree %s
+author %s
+committer %s
+
+%s: squashed import of component
+
+This commit copies the entire set of files as found in
+%s %s
+
+For more information about previous commits, see the
+upstream repository.
+
+Commit created by combo-layer.
+EOF
+''' % (tree, author, committer, name, name, since_rev))
+ editor.flush()
+ os.environ['GIT_EDITOR'] = 'sh %s' % editor.name
+ runcmd('git replace --edit %s' % rev)
+
+ # Optional: rewrite history to change commit messages or to move files.
+ if 'hook' in repo or dest_dir != ".":
+ filter_branch = ['git', 'filter-branch', '--force']
+ with tempfile.NamedTemporaryFile(mode='wt') as hookwrapper:
+ if 'hook' in repo:
+ # Create a shell script wrapper around the original hook that
+ # can be used by git filter-branch. Hook may or may not have
+ # an absolute path.
+ hook = repo['hook']
+ hook = os.path.join(os.path.dirname(conf.conffile), '..', hook)
+ # The wrappers turns the commit message
+ # from stdin into a fake patch header.
+ # This is good enough for changing Subject
+ # and commit msg body with normal
+ # combo-layer hooks.
+ hookwrapper.write('''set -e
+tmpname=$(mktemp)
+trap "rm $tmpname" EXIT
+echo -n 'Subject: [PATCH] ' >>$tmpname
+cat >>$tmpname
+if ! [ $(tail -c 1 $tmpname | od -A n -t x1) == '0a' ]; then
+ echo >>$tmpname
+fi
+echo '---' >>$tmpname
+%s $tmpname $GIT_COMMIT %s
+tail -c +18 $tmpname | head -c -4
+''' % (hook, name))
+ hookwrapper.flush()
+ filter_branch.extend(['--msg-filter', 'bash %s' % hookwrapper.name])
+ if dest_dir != ".":
+ parent = os.path.dirname(dest_dir)
+ if not parent:
+ parent = '.'
+ # May run outside of the current directory, so do not assume that .git exists.
+ filter_branch.extend(['--tree-filter', 'mkdir -p .git/tmptree && find . -mindepth 1 -maxdepth 1 ! -name .git -print0 | xargs -0 -I SOURCE mv SOURCE .git/tmptree && mkdir -p %s && mv .git/tmptree %s' % (parent, dest_dir)])
+ filter_branch.append('HEAD')
+ runcmd(filter_branch)
+ runcmd('git update-ref -d refs/original/refs/heads/%s' % name)
+ repo['rewritten_revision'] = runcmd('git rev-parse HEAD').strip()
+ repo['stripped_revision'] = repo['rewritten_revision']
+ # Optional filter files: remove everything and re-populate using the normal filtering code.
+ # Override any potential .gitignore.
+ if file_filter or exclude_patterns:
+ runcmd('git rm -rf .')
+ if not os.path.exists(extract_dir):
+ os.makedirs(extract_dir)
+ copy_selected_files('HEAD', extract_dir, file_filter, exclude_patterns, '.',
+ subdir=dest_dir)
+ runcmd('git add --all --force .')
+ if runcmd('git status --porcelain'):
+ # Something to commit.
+ runcmd(['git', 'commit', '-m',
+ '''%s: select file subset
+
+Files from the component repository were chosen based on
+the following filters:
+file_filter = %s
+file_exclude = %s''' % (name, file_filter or '<empty>', repo.get('file_exclude', '<empty>'))])
+ repo['stripped_revision'] = runcmd('git rev-parse HEAD').strip()
+
+ if not lastrev:
+ lastrev = runcmd('git rev-parse %s' % initialrev, ldir).strip()
+ conf.update(name, "last_revision", lastrev, initmode=True)
+
+ if not conf.history:
+ runcmd("git add .")
+ else:
+ # Create Octopus merge commit according to http://stackoverflow.com/questions/10874149/git-octopus-merge-with-unrelated-repositoies
+ runcmd('git checkout master')
+ merge = ['git', 'merge', '--no-commit']
+ for name in conf.repos:
+ repo = conf.repos[name]
+ # Use branch created earlier.
+ merge.append(name)
+ # Root all commits which have no parent in the common
+ # ancestor in the new repository.
+ for start in runcmd('git log --pretty=format:%%H --max-parents=0 %s --' % name).split('\n'):
+ runcmd('git replace --graft %s %s' % (start, startrev))
+ try:
+ runcmd(merge)
+ except Exception as error:
+ logger.info('''Merging component repository history failed, perhaps because of merge conflicts.
+It may be possible to commit anyway after resolving these conflicts.
+
+%s''' % error)
+ # Create MERGE_HEAD and MERGE_MSG. "git merge" itself
+ # does not create MERGE_HEAD in case of a (harmless) failure,
+ # and we want certain auto-generated information in the
+ # commit message for future reference and/or automation.
+ with open('.git/MERGE_HEAD', 'w') as head:
+ with open('.git/MERGE_MSG', 'w') as msg:
+ msg.write('repo: initial import of components\n\n')
+ # head.write('%s\n' % startrev)
+ for name in conf.repos:
+ repo = conf.repos[name]
+ # <upstream ref> <rewritten ref> <rewritten + files removed>
+ msg.write('combo-layer-%s: %s %s %s\n' % (name,
+ repo['last_revision'],
+ repo['rewritten_revision'],
+ repo['stripped_revision']))
+ rev = runcmd('git rev-parse %s' % name).strip()
+ head.write('%s\n' % rev)
+
+ if conf.localconffile:
+ localadded = True
+ try:
+ runcmd("git rm --cached %s" % conf.localconffile, printerr=False)
+ except subprocess.CalledProcessError:
+ localadded = False
+ if localadded:
+ localrelpath = os.path.relpath(conf.localconffile)
+ runcmd("grep -q %s .gitignore || echo %s >> .gitignore" % (localrelpath, localrelpath))
+ runcmd("git add .gitignore")
+ logger.info("Added local configuration file %s to .gitignore", localrelpath)
+ logger.info("Initial combo layer repository data has been created; please make any changes if desired and then use 'git commit' to make the initial commit.")
+ else:
+ logger.info("Repository already initialised, nothing to do.")
+
+
+def check_repo_clean(repodir):
+ """
+ check if the repo is clean
+ exit if repo is dirty
+ """
+ output=runcmd("git status --porcelain", repodir)
+ r = re.compile('\?\? patch-.*/')
+ dirtyout = [item for item in output.splitlines() if not r.match(item)]
+ if dirtyout:
+ logger.error("git repo %s is dirty, please fix it first", repodir)
+ sys.exit(1)
+
+def check_patch(patchfile):
+ f = open(patchfile, 'rb')
+ ln = f.readline()
+ of = None
+ in_patch = False
+ beyond_msg = False
+ pre_buf = b''
+ while ln:
+ if not beyond_msg:
+ if ln == b'---\n':
+ if not of:
+ break
+ in_patch = False
+ beyond_msg = True
+ elif ln.startswith(b'--- '):
+ # We have a diff in the commit message
+ in_patch = True
+ if not of:
+ print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile)
+ of = open(patchfile + '.tmp', 'wb')
+ of.write(pre_buf)
+ pre_buf = b''
+ elif in_patch and not ln[0] in b'+-@ \n\r':
+ in_patch = False
+ if of:
+ if in_patch:
+ of.write(b' ' + ln)
+ else:
+ of.write(ln)
+ else:
+ pre_buf += ln
+ ln = f.readline()
+ f.close()
+ if of:
+ of.close()
+ os.rename(patchfile + '.tmp', patchfile)
+
+def drop_to_shell(workdir=None):
+ if not sys.stdin.isatty():
+ print("Not a TTY so can't drop to shell for resolution, exiting.")
+ return False
+
+ shell = os.environ.get('SHELL', 'bash')
+ print('Dropping to shell "%s"\n' \
+ 'When you are finished, run the following to continue:\n' \
+ ' exit -- continue to apply the patches\n' \
+ ' exit 1 -- abort\n' % shell);
+ ret = subprocess.call([shell], cwd=workdir)
+ if ret != 0:
+ print("Aborting")
+ return False
+ else:
+ return True
+
+def check_rev_branch(component, repodir, rev, branch):
+ try:
+ actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False)
+ except subprocess.CalledProcessError as e:
+ if e.returncode == 129:
+ actualbranch = ""
+ else:
+ raise
+
+ if not actualbranch:
+ logger.error("%s: specified revision %s is invalid!" % (component, rev))
+ return False
+
+ branches = []
+ branchlist = actualbranch.split("\n")
+ for b in branchlist:
+ branches.append(b.strip().split(' ')[-1])
+
+ if branch not in branches:
+ logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch))
+ return False
+ return True
+
+def get_repos(conf, repo_names):
+ repos = []
+ for name in repo_names:
+ if name.startswith('-'):
+ break
+ else:
+ repos.append(name)
+ for repo in repos:
+ if not repo in conf.repos:
+ logger.error("Specified component '%s' not found in configuration" % repo)
+ sys.exit(1)
+
+ if not repos:
+ repos = [ repo for repo in conf.repos if conf.repos[repo].get("update", True) ]
+
+ return repos
+
+def action_pull(conf, args):
+ """
+ update the component repos only
+ """
+ repos = get_repos(conf, args[1:])
+
+ # make sure all repos are clean
+ for name in repos:
+ check_repo_clean(conf.repos[name]['local_repo_dir'])
+
+ for name in repos:
+ repo = conf.repos[name]
+ ldir = repo['local_repo_dir']
+ branch = repo.get('branch', "master")
+ logger.info("update branch %s of component repo %s in %s ..." % (branch, name, ldir))
+ if not conf.hard_reset:
+ # Try to pull only the configured branch. Beware that this may fail
+ # when the branch is currently unknown (for example, after reconfiguring
+ # combo-layer). In that case we need to fetch everything and try the check out
+ # and pull again.
+ try:
+ runcmd("git checkout %s" % branch, ldir, printerr=False)
+ except subprocess.CalledProcessError:
+ output=runcmd("git fetch", ldir)
+ logger.info(output)
+ runcmd("git checkout %s" % branch, ldir)
+ runcmd("git pull --ff-only", ldir)
+ else:
+ output=runcmd("git pull --ff-only", ldir)
+ logger.info(output)
+ else:
+ output=runcmd("git fetch", ldir)
+ logger.info(output)
+ runcmd("git checkout %s" % branch, ldir)
+ runcmd("git reset --hard FETCH_HEAD", ldir)
+
+def action_update(conf, args):
+ """
+ update the component repos
+ either:
+ generate the patch list
+ apply the generated patches
+ or:
+ re-creates the entire component history and merges them
+ into the current branch with a merge commit
+ """
+ components = [arg.split(':')[0] for arg in args[1:]]
+ revisions = {}
+ for arg in args[1:]:
+ if ':' in arg:
+ a = arg.split(':', 1)
+ revisions[a[0]] = a[1]
+ repos = get_repos(conf, components)
+
+ # make sure combo repo is clean
+ check_repo_clean(os.getcwd())
+
+ # Check whether we keep the component histories. Must be
+ # set either via --history command line parameter or consistently
+ # in combo-layer.conf. Mixing modes is (currently, and probably
+ # permanently because it would be complicated) not supported.
+ if conf.history:
+ history = True
+ else:
+ history = None
+ for name in repos:
+ repo = conf.repos[name]
+ repo_history = repo.get('history', False)
+ if history is None:
+ history = repo_history
+ elif history != repo_history:
+ logger.error("'history' property is set inconsistently")
+ sys.exit(1)
+
+ # Step 1: update the component repos
+ if conf.nopull:
+ logger.info("Skipping pull (-n)")
+ else:
+ action_pull(conf, ['arg0'] + components)
+
+ if history:
+ update_with_history(conf, components, revisions, repos)
+ else:
+ update_with_patches(conf, components, revisions, repos)
+
+def update_with_patches(conf, components, revisions, repos):
+ import uuid
+ patch_dir = "patch-%s" % uuid.uuid4()
+ if not os.path.exists(patch_dir):
+ os.mkdir(patch_dir)
+
+ for name in repos:
+ revision = revisions.get(name, None)
+ repo = conf.repos[name]
+ ldir = repo['local_repo_dir']
+ dest_dir = repo['dest_dir']
+ branch = repo.get('branch', "master")
+ repo_patch_dir = os.path.join(os.getcwd(), patch_dir, name)
+
+ # Step 2: generate the patch list and store to patch dir
+ logger.info("Generating patches from %s..." % name)
+ top_revision = revision or branch
+ if not check_rev_branch(name, ldir, top_revision, branch):
+ sys.exit(1)
+ if dest_dir != ".":
+ prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir)
+ else:
+ prefix = ""
+ if repo['last_revision'] == "":
+ logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name)
+ patch_cmd_range = "--root %s" % top_revision
+ rev_cmd_range = top_revision
+ else:
+ if not check_rev_branch(name, ldir, repo['last_revision'], branch):
+ sys.exit(1)
+ patch_cmd_range = "%s..%s" % (repo['last_revision'], top_revision)
+ rev_cmd_range = patch_cmd_range
+
+ file_filter = repo.get('file_filter',".")
+
+ # Filter out unwanted files
+ exclude = repo.get('file_exclude', '')
+ if exclude:
+ for path in exclude.split():
+ p = "%s/%s" % (dest_dir, path) if dest_dir != '.' else path
+ file_filter += " ':!%s'" % p
+
+ patch_cmd = "git format-patch -N %s --output-directory %s %s -- %s" % \
+ (prefix,repo_patch_dir, patch_cmd_range, file_filter)
+ output = runcmd(patch_cmd, ldir)
+ logger.debug("generated patch set:\n%s" % output)
+ patchlist = output.splitlines()
+
+ rev_cmd = "git rev-list --no-merges %s -- %s" % (rev_cmd_range, file_filter)
+ revlist = runcmd(rev_cmd, ldir).splitlines()
+
+ # Step 3: Call repo specific hook to adjust patch
+ if 'hook' in repo:
+ # hook parameter is: ./hook patchpath revision reponame
+ count=len(revlist)-1
+ for patch in patchlist:
+ runcmd("%s %s %s %s" % (repo['hook'], patch, revlist[count], name))
+ count=count-1
+
+ # Step 4: write patch list and revision list to file, for user to edit later
+ patchlist_file = os.path.join(os.getcwd(), patch_dir, "patchlist-%s" % name)
+ repo['patchlist'] = patchlist_file
+ f = open(patchlist_file, 'w')
+ count=len(revlist)-1
+ for patch in patchlist:
+ f.write("%s %s\n" % (patch, revlist[count]))
+ check_patch(os.path.join(patch_dir, patch))
+ count=count-1
+ f.close()
+
+ # Step 5: invoke bash for user to edit patch and patch list
+ if conf.interactive:
+ print('You may now edit the patch and patch list in %s\n' \
+ 'For example, you can remove unwanted patch entries from patchlist-*, so that they will be not applied later' % patch_dir);
+ if not drop_to_shell(patch_dir):
+ sys.exit(1)
+
+ # Step 6: apply the generated and revised patch
+ apply_patchlist(conf, repos)
+ runcmd("rm -rf %s" % patch_dir)
+
+ # Step 7: commit the updated config file if it's being tracked
+ commit_conf_file(conf, components)
+
+def conf_commit_msg(conf, components):
+ # create the "components" string
+ component_str = "all components"
+ if len(components) > 0:
+ # otherwise tell which components were actually changed
+ component_str = ", ".join(components)
+
+ # expand the template with known values
+ template = Template(conf.commit_msg_template)
+ msg = template.substitute(components = component_str)
+ return msg
+
+def commit_conf_file(conf, components, commit=True):
+ relpath = os.path.relpath(conf.conffile)
+ try:
+ output = runcmd("git status --porcelain %s" % relpath, printerr=False)
+ except:
+ # Outside the repository
+ output = None
+ if output:
+ if output.lstrip().startswith("M"):
+ logger.info("Committing updated configuration file")
+ if commit:
+ msg = conf_commit_msg(conf, components)
+ runcmd('git commit -m'.split() + [msg, relpath])
+ else:
+ runcmd('git add %s' % relpath)
+ return True
+ return False
+
+def apply_patchlist(conf, repos):
+ """
+ apply the generated patch list to combo repo
+ """
+ for name in repos:
+ repo = conf.repos[name]
+ lastrev = repo["last_revision"]
+ prevrev = lastrev
+
+ # Get non-blank lines from patch list file
+ patchlist = []
+ if os.path.exists(repo['patchlist']) or not conf.interactive:
+ # Note: we want this to fail here if the file doesn't exist and we're not in
+ # interactive mode since the file should exist in this case
+ with open(repo['patchlist']) as f:
+ for line in f:
+ line = line.rstrip()
+ if line:
+ patchlist.append(line)
+
+ ldir = conf.repos[name]['local_repo_dir']
+ branch = conf.repos[name].get('branch', "master")
+ branchrev = runcmd("git rev-parse %s" % branch, ldir).strip()
+
+ if patchlist:
+ logger.info("Applying patches from %s..." % name)
+ linecount = len(patchlist)
+ i = 1
+ for line in patchlist:
+ patchfile = line.split()[0]
+ lastrev = line.split()[1]
+ patchdisp = os.path.relpath(patchfile)
+ if os.path.getsize(patchfile) == 0:
+ logger.info("(skipping %d/%d %s - no changes)" % (i, linecount, patchdisp))
+ else:
+ cmd = "git am --keep-cr %s-p1 %s" % ('-s ' if repo.get('signoff', True) else '', patchfile)
+ logger.info("Applying %d/%d: %s" % (i, linecount, patchdisp))
+ try:
+ runcmd(cmd)
+ except subprocess.CalledProcessError:
+ logger.info('Running "git am --abort" to cleanup repo')
+ runcmd("git am --abort")
+ logger.error('"%s" failed' % cmd)
+ logger.info("Please manually apply patch %s" % patchdisp)
+ logger.info("Note: if you exit and continue applying without manually applying the patch, it will be skipped")
+ if not drop_to_shell():
+ if prevrev != repo['last_revision']:
+ conf.update(name, "last_revision", prevrev)
+ sys.exit(1)
+ prevrev = lastrev
+ i += 1
+ # Once all patches are applied, we should update
+ # last_revision to the branch head instead of the last
+ # applied patch. The two are not necessarily the same when
+ # the last commit is a merge commit or when the patches at
+ # the branch head were intentionally excluded.
+ #
+ # If we do not do that for a merge commit, the next
+ # combo-layer run will only exclude patches reachable from
+ # one of the merged branches and try to re-apply patches
+ # from other branches even though they were already
+ # copied.
+ #
+ # If patches were intentionally excluded, the next run will
+ # present them again instead of skipping over them. This
+ # may or may not be intended, so the code here is conservative
+ # and only addresses the "head is merge commit" case.
+ if lastrev != branchrev and \
+ len(runcmd("git show --pretty=format:%%P --no-patch %s" % branch, ldir).split()) > 1:
+ lastrev = branchrev
+ else:
+ logger.info("No patches to apply from %s" % name)
+ lastrev = branchrev
+
+ if lastrev != repo['last_revision']:
+ conf.update(name, "last_revision", lastrev)
+
+def action_splitpatch(conf, args):
+ """
+ generate the commit patch and
+ split the patch per repo
+ """
+ logger.debug("action_splitpatch")
+ if len(args) > 1:
+ commit = args[1]
+ else:
+ commit = "HEAD"
+ patchdir = "splitpatch-%s" % commit
+ if not os.path.exists(patchdir):
+ os.mkdir(patchdir)
+
+ # filerange_root is for the repo whose dest_dir is root "."
+ # and it should be specified by excluding all other repo dest dir
+ # like "-x repo1 -x repo2 -x repo3 ..."
+ filerange_root = ""
+ for name in conf.repos:
+ dest_dir = conf.repos[name]['dest_dir']
+ if dest_dir != ".":
+ filerange_root = '%s -x "%s/*"' % (filerange_root, dest_dir)
+
+ for name in conf.repos:
+ dest_dir = conf.repos[name]['dest_dir']
+ patch_filename = "%s/%s.patch" % (patchdir, name)
+ if dest_dir == ".":
+ cmd = "git format-patch -n1 --stdout %s^..%s | filterdiff -p1 %s > %s" % (commit, commit, filerange_root, patch_filename)
+ else:
+ cmd = "git format-patch --no-prefix -n1 --stdout %s^..%s -- %s > %s" % (commit, commit, dest_dir, patch_filename)
+ runcmd(cmd)
+ # Detect empty patches (including those produced by filterdiff above
+ # that contain only preamble text)
+ if os.path.getsize(patch_filename) == 0 or runcmd("filterdiff %s" % patch_filename) == "":
+ os.remove(patch_filename)
+ logger.info("(skipping %s - no changes)", name)
+ else:
+ logger.info(patch_filename)
+
+def update_with_history(conf, components, revisions, repos):
+ '''Update all components with full history.
+
+ Works by importing all commits reachable from a component's
+ current head revision. If those commits are rooted in an already
+ imported commit, their content gets mixed with the content of the
+ combined repo of that commit (new or modified files overwritten,
+ removed files removed).
+
+ The last commit is an artificial merge commit that merges all the
+ updated components into the combined repository.
+
+ The HEAD ref only gets updated at the very end. All intermediate work
+ happens in a worktree which will get garbage collected by git eventually
+ after a failure.
+ '''
+ # Remember current HEAD and what we need to add to it.
+ head = runcmd("git rev-parse HEAD").strip()
+ additional_heads = {}
+
+ # Track the mapping between original commit and commit in the
+ # combined repo. We do not have to distinguish between components,
+ # because commit hashes are different anyway. Often we can
+ # skip find_revs() entirely (for example, when all new commits
+ # are derived from the last imported revision).
+ #
+ # Using "head" (typically the merge commit) instead of the actual
+ # commit for the component leads to a nicer history in the combined
+ # repo.
+ old2new_revs = {}
+ for name in repos:
+ repo = conf.repos[name]
+ revision = repo['last_revision']
+ if revision:
+ old2new_revs[revision] = head
+
+ def add_p(parents):
+ '''Insert -p before each entry.'''
+ parameters = []
+ for p in parents:
+ parameters.append('-p')
+ parameters.append(p)
+ return parameters
+
+ # Do all intermediate work with a separate work dir and index,
+ # chosen via env variables (can't use "git worktree", it is too
+ # new). This is useful (no changes to current work tree unless the
+ # update succeeds) and required (otherwise we end up temporarily
+ # removing the combo-layer hooks that we currently use when
+ # importing a new component).
+ #
+ # Not cleaned up after a failure at the moment.
+ wdir = os.path.join(os.getcwd(), ".git", "combo-layer")
+ windex = wdir + ".index"
+ if os.path.isdir(wdir):
+ shutil.rmtree(wdir)
+ os.mkdir(wdir)
+ wenv = copy.deepcopy(os.environ)
+ wenv["GIT_WORK_TREE"] = wdir
+ wenv["GIT_INDEX_FILE"] = windex
+ # This one turned out to be needed in practice.
+ wenv["GIT_OBJECT_DIRECTORY"] = os.path.join(os.getcwd(), ".git", "objects")
+ wargs = {"destdir": wdir, "env": wenv}
+
+ for name in repos:
+ revision = revisions.get(name, None)
+ repo = conf.repos[name]
+ ldir = repo['local_repo_dir']
+ dest_dir = repo['dest_dir']
+ branch = repo.get('branch', "master")
+ hook = repo.get('hook', None)
+ largs = {"destdir": ldir, "env": None}
+ file_include = repo.get('file_filter', '').split()
+ file_include.sort() # make sure that short entries like '.' come first.
+ file_exclude = repo.get('file_exclude', '').split()
+
+ def include_file(file):
+ if not file_include:
+ # No explicit filter set, include file.
+ return True
+ for filter in file_include:
+ if filter == '.':
+ # Another special case: include current directory and thus all files.
+ return True
+ if os.path.commonprefix((filter, file)) == filter:
+ # Included in directory or direct file match.
+ return True
+ # Check for wildcard match *with* allowing * to match /, i.e.
+ # src/*.c does match src/foobar/*.c. That's not how it is done elsewhere
+ # when passing the filtering to "git archive", but it is unclear what
+ # the intended semantic is (the comment on file_exclude that "append a * wildcard
+ # at the end" to match the full content of a directories implies that
+ # slashes are indeed not special), so here we simply do what's easy to
+ # implement in Python.
+ logger.debug('fnmatch(%s, %s)' % (file, filter))
+ if fnmatch.fnmatchcase(file, filter):
+ return True
+ return False
+
+ def exclude_file(file):
+ for filter in file_exclude:
+ if fnmatch.fnmatchcase(file, filter):
+ return True
+ return False
+
+ def file_filter(files):
+ '''Clean up file list so that only included files remain.'''
+ index = 0
+ while index < len(files):
+ file = files[index]
+ if not include_file(file) or exclude_file(file):
+ del files[index]
+ else:
+ index += 1
+
+
+ # Generate the revision list.
+ logger.info("Analyzing commits from %s..." % name)
+ top_revision = revision or branch
+ if not check_rev_branch(name, ldir, top_revision, branch):
+ sys.exit(1)
+
+ last_revision = repo['last_revision']
+ rev_list_args = "--full-history --sparse --topo-order --reverse"
+ if not last_revision:
+ logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name)
+ rev_list_args = rev_list_args + ' ' + top_revision
+ else:
+ if not check_rev_branch(name, ldir, last_revision, branch):
+ sys.exit(1)
+ rev_list_args = "%s %s..%s" % (rev_list_args, last_revision, top_revision)
+
+ # By definition, the current HEAD contains the latest imported
+ # commit of each component. We use that as initial mapping even
+ # though the commits do not match exactly because
+ # a) it always works (in contrast to find_revs, which relies on special
+ # commit messages)
+ # b) it is faster than find_revs, which will only be called on demand
+ # and can be skipped entirely in most cases
+ # c) last but not least, the combined history looks nicer when all
+ # new commits are rooted in the same merge commit
+ old2new_revs[last_revision] = head
+
+ # We care about all commits (--full-history and --sparse) and
+ # we want reconstruct the topology and thus do not care
+ # about ordering by time (--topo-order). We ask for the ones
+ # we need to import first to be listed first (--reverse).
+ revs = runcmd("git rev-list %s" % rev_list_args, **largs).split()
+ logger.debug("To be imported: %s" % revs)
+ # Now 'revs' contains all revisions reachable from the top revision.
+ # All revisions derived from the 'last_revision' definitely are new,
+ # whereas the others may or may not have been imported before. For
+ # a linear history in the component, that second set will be empty.
+ # To distinguish between them, we also get the shorter list
+ # of revisions starting at the ancestor.
+ if last_revision:
+ ancestor_revs = runcmd("git rev-list --ancestry-path %s" % rev_list_args, **largs).split()
+ else:
+ ancestor_revs = []
+ logger.debug("Ancestors: %s" % ancestor_revs)
+
+ # Now import each revision.
+ logger.info("Importing commits from %s..." % name)
+ def import_rev(rev):
+ global scanned_revs
+
+ # If it is part of the new commits, we definitely need
+ # to import it. Otherwise we need to check, we might have
+ # imported it before. If it was imported and we merely
+ # fail to find it because commit messages did not track
+ # the mapping, then we end up importing it again. So
+ # combined repos using "updating with history" really should
+ # enable the "From ... rev:" commit header modifications.
+ if rev not in ancestor_revs and rev not in old2new_revs and not scanned_revs:
+ logger.debug("Revision %s triggers log analysis." % rev)
+ find_revs(old2new_revs, head)
+ scanned_revs = True
+ new_rev = old2new_revs.get(rev, None)
+ if new_rev:
+ return new_rev
+
+ # If the commit is not in the original list of revisions
+ # to be imported, then it must be a parent of one of those
+ # commits and it was skipped during earlier imports or not
+ # found. Importing such merge commits leads to very ugly
+ # history (long cascade of merge commits which all point
+ # to to older commits) when switching from "update via
+ # patches" to "update with history".
+ #
+ # We can avoid importing merge commits if all non-merge commits
+ # reachable from it were already imported. In that case we
+ # can root the new commits in the current head revision.
+ def is_imported(prev):
+ parents = runcmd("git show --no-patch --pretty=format:%P " + prev, **largs).split()
+ if len(parents) > 1:
+ for p in parents:
+ if not is_imported(p):
+ logger.debug("Must import %s because %s is not imported." % (rev, p))
+ return False
+ return True
+ elif prev in old2new_revs:
+ return True
+ else:
+ logger.debug("Must import %s because %s is not imported." % (rev, prev))
+ return False
+ if rev not in revs and is_imported(rev):
+ old2new_revs[rev] = head
+ return head
+
+ # Need to import rev. Collect some information about it.
+ logger.debug("Importing %s" % rev)
+ (parents, author_name, author_email, author_timestamp, body) = \
+ runcmd("git show --no-patch --pretty=format:%P%x00%an%x00%ae%x00%at%x00%B " + rev, **largs).split(chr(0))
+ parents = parents.split()
+ if parents:
+ # Arbitrarily pick the first parent as base. It may or may not have
+ # been imported before. For example, if the parent is a merge commit
+ # and previously the combined repository used patching as update
+ # method, then the actual merge commit parent never was imported.
+ # To cover this, We recursively import parents.
+ parent = parents[0]
+ new_parent = import_rev(parent)
+ # Clean index and working tree. TODO: can we combine this and the
+ # next into one command with less file IO?
+ # "git reset --hard" does not work, it changes HEAD of the parent
+ # repo, which we wanted to avoid. Probably need to keep
+ # track of the rev that corresponds to the index and use apply_commit().
+ runcmd("git rm -q --ignore-unmatch -rf .", **wargs)
+ # Update index and working tree to match the parent.
+ runcmd("git checkout -q -f %s ." % new_parent, **wargs)
+ else:
+ parent = None
+ # Clean index and working tree.
+ runcmd("git rm -q --ignore-unmatch -rf .", **wargs)
+
+ # Modify index and working tree such that it mirrors the commit.
+ apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=file_filter)
+
+ # Now commit.
+ new_tree = runcmd("git write-tree", **wargs).strip()
+ env = copy.deepcopy(wenv)
+ env['GIT_AUTHOR_NAME'] = author_name
+ env['GIT_AUTHOR_EMAIL'] = author_email
+ env['GIT_AUTHOR_DATE'] = author_timestamp
+ if hook:
+ # Need to turn the verbatim commit message into something resembling a patch header
+ # for the hook.
+ with tempfile.NamedTemporaryFile(mode='wt', delete=False) as patch:
+ patch.write('Subject: [PATCH] ')
+ patch.write(body)
+ patch.write('\n---\n')
+ patch.close()
+ runcmd([hook, patch.name, rev, name])
+ with open(patch.name) as f:
+ body = f.read()[len('Subject: [PATCH] '):][:-len('\n---\n')]
+
+ # We can skip non-merge commits that did not change any files. Those are typically
+ # the result of file filtering, although they could also have been introduced
+ # intentionally upstream, in which case we drop some information here.
+ if len(parents) == 1:
+ parent_rev = import_rev(parents[0])
+ old_tree = runcmd("git show -s --pretty=format:%T " + parent_rev, **wargs).strip()
+ commit = old_tree != new_tree
+ if not commit:
+ new_rev = parent_rev
+ else:
+ commit = True
+ if commit:
+ new_rev = runcmd("git commit-tree".split() + add_p([import_rev(p) for p in parents]) +
+ ["-m", body, new_tree],
+ env=env).strip()
+ old2new_revs[rev] = new_rev
+
+ return new_rev
+
+ if revs:
+ for rev in revs:
+ import_rev(rev)
+ # Remember how to update our current head. New components get added,
+ # updated components get the delta between current head and the updated component
+ # applied.
+ additional_heads[old2new_revs[revs[-1]]] = head if repo['last_revision'] else None
+ repo['last_revision'] = revs[-1]
+
+ # Now construct the final merge commit. We create the tree by
+ # starting with the head and applying the changes from each
+ # components imported head revision.
+ if additional_heads:
+ runcmd("git reset --hard", **wargs)
+ for rev, base in additional_heads.items():
+ apply_commit(base, rev, wargs, wargs, None)
+
+ # Commit with all component branches as parents as well as the previous head.
+ logger.info("Writing final merge commit...")
+ msg = conf_commit_msg(conf, components)
+ new_tree = runcmd("git write-tree", **wargs).strip()
+ new_rev = runcmd("git commit-tree".split() +
+ add_p([head] + list(additional_heads.keys())) +
+ ["-m", msg, new_tree],
+ **wargs).strip()
+ # And done! This is the first time we change the HEAD in the actual work tree.
+ runcmd("git reset --hard %s" % new_rev)
+
+ # Update and stage the (potentially modified)
+ # combo-layer.conf, but do not commit separately.
+ for name in repos:
+ repo = conf.repos[name]
+ rev = repo['last_revision']
+ conf.update(name, "last_revision", rev)
+ if commit_conf_file(conf, components, False):
+ # Must augment the previous commit.
+ runcmd("git commit --amend -C HEAD")
+
+
+scanned_revs = False
+def find_revs(old2new, head):
+ '''Construct mapping from original commit hash to commit hash in
+ combined repo by looking at the commit messages. Depends on the
+ "From ... rev: ..." convention.'''
+ logger.info("Analyzing log messages to find previously imported commits...")
+ num_known = len(old2new)
+ log = runcmd("git log --grep='From .* rev: [a-fA-F0-9][a-fA-F0-9]*' --pretty=format:%H%x00%B%x00 " + head).split(chr(0))
+ regex = re.compile(r'From .* rev: ([a-fA-F0-9]+)')
+ for new_rev, body in zip(*[iter(log)]* 2):
+ # Use the last one, in the unlikely case there are more than one.
+ rev = regex.findall(body)[-1]
+ if rev not in old2new:
+ old2new[rev] = new_rev.strip()
+ logger.info("Found %d additional commits, leading to: %s" % (len(old2new) - num_known, old2new))
+
+
+def apply_commit(parent, rev, largs, wargs, dest_dir, file_filter=None):
+ '''Compare revision against parent, remove files deleted in the
+ commit, re-write new or modified ones. Moves them into dest_dir.
+ Optionally filters files.
+ '''
+ if not dest_dir:
+ dest_dir = "."
+ # -r recurses into sub-directories, given is the full overview of
+ # what changed. We do not care about copy/edits or renames, so we
+ # can disable those with --no-renames (but we still parse them,
+ # because it was not clear from git documentation whether C and M
+ # lines can still occur).
+ logger.debug("Applying changes between %s and %s in %s" % (parent, rev, largs["destdir"]))
+ delete = []
+ update = []
+ if parent:
+ # Apply delta.
+ changes = runcmd("git diff-tree --no-commit-id --no-renames --name-status -r --raw -z %s %s" % (parent, rev), **largs).split(chr(0))
+ for status, name in zip(*[iter(changes)]*2):
+ if status[0] in "ACMRT":
+ update.append(name)
+ elif status[0] in "D":
+ delete.append(name)
+ else:
+ logger.error("Unknown status %s of file %s in revision %s" % (status, name, rev))
+ sys.exit(1)
+ else:
+ # Copy all files.
+ update.extend(runcmd("git ls-tree -r --name-only -z %s" % rev, **largs).split(chr(0)))
+
+ # Include/exclude files as define in the component config.
+ # Both updated and deleted file lists get filtered, because it might happen
+ # that a file gets excluded, pulled from a different component, and then the
+ # excluded file gets deleted. In that case we must keep the copy.
+ if file_filter:
+ file_filter(update)
+ file_filter(delete)
+
+ # We export into a tar archive here and extract with tar because it is simple (no
+ # need to implement file and symlink writing ourselves) and gives us some degree
+ # of parallel IO. The downside is that we have to pass the list of files via
+ # command line parameters - hopefully there will never be too many at once.
+ if update:
+ target = os.path.join(wargs["destdir"], dest_dir)
+ if not os.path.isdir(target):
+ os.makedirs(target)
+ quoted_target = pipes.quote(target)
+ # os.sysconf('SC_ARG_MAX') is lying: running a command with
+ # string length 629343 already failed with "Argument list too
+ # long" although SC_ARG_MAX = 2097152. "man execve" explains
+ # the limitations, but those are pretty complicated. So here
+ # we just hard-code a fixed value which is more likely to work.
+ max_cmdsize = 64 * 1024
+ while update:
+ quoted_args = []
+ unquoted_args = []
+ cmdsize = 100 + len(quoted_target)
+ while update:
+ quoted_next = pipes.quote(update[0])
+ size_next = len(quoted_next) + len(dest_dir) + 1
+ logger.debug('cmdline length %d + %d < %d?' % (cmdsize, size_next, os.sysconf('SC_ARG_MAX')))
+ if cmdsize + size_next < max_cmdsize:
+ quoted_args.append(quoted_next)
+ unquoted_args.append(update.pop(0))
+ cmdsize += size_next
+ else:
+ logger.debug('Breaking the cmdline at length %d' % cmdsize)
+ break
+ logger.debug('Final cmdline length %d / %d' % (cmdsize, os.sysconf('SC_ARG_MAX')))
+ cmd = "git archive %s %s | tar -C %s -xf -" % (rev, ' '.join(quoted_args), quoted_target)
+ logger.debug('First cmdline length %d' % len(cmd))
+ runcmd(cmd, **largs)
+ cmd = "git add -f".split() + [os.path.join(dest_dir, x) for x in unquoted_args]
+ logger.debug('Second cmdline length %d' % reduce(lambda x, y: x + len(y), cmd, 0))
+ runcmd(cmd, **wargs)
+ if delete:
+ for path in delete:
+ if dest_dir:
+ path = os.path.join(dest_dir, path)
+ runcmd("git rm -f --ignore-unmatch".split() + [os.path.join(dest_dir, x) for x in delete], **wargs)
+
+def action_error(conf, args):
+ logger.info("invalid action %s" % args[0])
+
+actions = {
+ "init": action_init,
+ "update": action_update,
+ "pull": action_pull,
+ "splitpatch": action_splitpatch,
+}
+
+def main():
+ parser = optparse.OptionParser(
+ version = "Combo Layer Repo Tool version %s" % __version__,
+ usage = """%prog [options] action
+
+Create and update a combination layer repository from multiple component repositories.
+
+Action:
+ init initialise the combo layer repo
+ update [components] get patches from component repos and apply them to the combo repo
+ pull [components] just pull component repos only
+ splitpatch [commit] generate commit patch and split per component, default commit is HEAD""")
+
+ parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).",
+ action = "store", dest = "conffile", default = "conf/combo-layer.conf")
+
+ parser.add_option("-i", "--interactive", help = "interactive mode, user can edit the patch list and patches",
+ action = "store_true", dest = "interactive", default = False)
+
+ parser.add_option("-D", "--debug", help = "output debug information",
+ action = "store_true", dest = "debug", default = False)
+
+ parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update",
+ action = "store_true", dest = "nopull", default = False)
+
+ parser.add_option("--hard-reset",
+ help = "instead of pull do fetch and hard-reset in component repos",
+ action = "store_true", dest = "hard_reset", default = False)
+
+ parser.add_option("-H", "--history", help = "import full history of components during init",
+ action = "store_true", default = False)
+
+ options, args = parser.parse_args(sys.argv)
+
+ # Dispatch to action handler
+ if len(args) == 1:
+ logger.error("No action specified, exiting")
+ parser.print_help()
+ elif args[1] not in actions:
+ logger.error("Unsupported action %s, exiting\n" % (args[1]))
+ parser.print_help()
+ elif not os.path.exists(options.conffile):
+ logger.error("No valid config file, exiting\n")
+ parser.print_help()
+ else:
+ if options.debug:
+ logger.setLevel(logging.DEBUG)
+ confdata = Configuration(options)
+ initmode = (args[1] == 'init')
+ confdata.sanity_check(initmode)
+ actions.get(args[1], action_error)(confdata, args[1:])
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/combo-layer-hook-default.sh b/poky/scripts/combo-layer-hook-default.sh
new file mode 100755
index 000000000..1e3a3b9bc
--- /dev/null
+++ b/poky/scripts/combo-layer-hook-default.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Hook to add source component/revision info to commit message
+# Parameter:
+# $1 patch-file
+# $2 revision
+# $3 reponame
+
+patchfile=$1
+rev=$2
+reponame=$3
+
+sed -i -e "0,/^Subject:/s#^Subject: \[PATCH\] \($reponame: \)*\(.*\)#Subject: \[PATCH\] $reponame: \2#" $patchfile
+if grep -q '^Signed-off-by:' $patchfile; then
+ # Insert before Signed-off-by.
+ sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\(From $reponame rev: $rev\)\n\n\1#" $patchfile
+else
+ # Insert before final --- separator, with extra blank lines removed.
+ perl -e "\$_ = join('', <>); s/^(.*\S[ \t]*)(\n|\n\s*\n)---\n/\$1\n\nFrom $reponame rev: $rev\n---\n/s; print;" $patchfile >$patchfile.tmp
+ mv $patchfile.tmp $patchfile
+fi
diff --git a/poky/scripts/combo-layer.conf.example b/poky/scripts/combo-layer.conf.example
new file mode 100644
index 000000000..90e2b5872
--- /dev/null
+++ b/poky/scripts/combo-layer.conf.example
@@ -0,0 +1,93 @@
+# combo-layer example configuration file
+
+# Default values for all sections.
+[DEFAULT]
+
+# Add 'Signed-off-by' to all commits that get imported automatically.
+signoff = True
+
+# component name
+[bitbake]
+
+# Override signedoff default above (not very useful, but possible).
+signoff = False
+
+# mandatory options
+# git upstream uri
+src_uri = git://git.openembedded.org/bitbake
+
+# the directory to clone the component repo
+local_repo_dir = /home/kyu3/src/test/bitbake
+
+# the relative dir within the combo repo to put the component files
+# use "." if the files should be in the root dir
+dest_dir = bitbake
+
+# the last update revision.
+# "init" will set this to the latest revision automatically, however if it
+# is empty when "update" is run, the tool will start from the first commit.
+# Note that this value will get updated by "update" if the component repo's
+# latest revision changed and the operation completes successfully.
+last_revision =
+
+# optional options:
+
+# branch: specify the branch in the component repo to pull from
+# (master if not specified)
+
+# file_filter: only include the specified file(s)
+# file_filter = [path] [path] ...
+# example:
+# file_filter = src/ : only include the subdir src
+# file_filter = src/*.c : only include the src *.c file
+# file_filter = src/main.c src/Makefile.am : only include these two files
+
+# file_exclude: filter out these file(s)
+# file_exclude = [path] [path] ...
+#
+# Each entry must match a file name. In contrast do file_filter, matching
+# a directory has no effect. To achieve that, use append a * wildcard
+# at the end.
+#
+# Wildcards are applied to the complete path and also match slashes.
+#
+# example:
+# file_exclude = src/foobar/* : exclude everything under src/foobar
+# file_exclude = src/main.c : filter out main.c after including it with file_filter = src/*.c
+# file_exclude = *~ : exclude backup files
+
+# hook: if provided, the tool will call the hook to process the generated
+# patch from upstream, and then apply the modified patch to the combo
+# repo.
+# the hook script is called as follows: ./hook patchpath revision reponame
+# example:
+# hook = combo-layer-hook-default.sh
+
+# since_revision:
+# since_revision = release-1-2
+# since_revision = 12345 abcdf
+#
+# If provided, truncate imported history during "combo-layer --history
+# init" at the specified revision(s). More than one can be specified
+# to cut off multiple component branches.
+#
+# The specified commits themselves do not get imported. Instead, an
+# artificial commit with "unknown" author is created with a content
+# that matches the original commit.
+
+[oe-core]
+src_uri = git://git.openembedded.org/openembedded-core
+local_repo_dir = /home/kyu3/src/test/oecore
+dest_dir = .
+last_revision =
+since_revision = some-tag-or-commit-on-master-branch
+
+# It is also possible to embed python code in the config values. Similar
+# to bitbake it considers every value starting with @ to be a python
+# script.
+# e.g. local_repo_dir could easily be configured using an environment
+# variable:
+#
+# [bitbake]
+# local_repo_dir = @os.getenv("LOCAL_REPO_DIR") + "/bitbake"
+#
diff --git a/poky/scripts/contrib/bb-perf/bb-matrix-plot.sh b/poky/scripts/contrib/bb-perf/bb-matrix-plot.sh
new file mode 100755
index 000000000..136a25570
--- /dev/null
+++ b/poky/scripts/contrib/bb-perf/bb-matrix-plot.sh
@@ -0,0 +1,137 @@
+#!/bin/bash
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+# This script operates on the .dat file generated by bb-matrix.sh. It tolerates
+# the header by skipping the first line, but error messages and bad data records
+# need to be removed first. It will generate three views of the plot, and leave
+# an interactive view open for further analysis.
+#
+# AUTHORS
+# Darren Hart <dvhart@linux.intel.com>
+#
+
+# Setup the defaults
+DATFILE="bb-matrix.dat"
+XLABEL="BB_NUMBER_THREADS"
+YLABEL="PARALLEL_MAKE"
+FIELD=3
+DEF_TITLE="Elapsed Time (seconds)"
+PM3D_FRAGMENT="unset surface; set pm3d at s hidden3d 100"
+SIZE="640,480"
+
+function usage {
+CMD=$(basename $0)
+cat <<EOM
+Usage: $CMD [-d datfile] [-f field] [-h] [-t title] [-w]
+ -d datfile The data file generated by bb-matrix.sh (default: $DATFILE)
+ -f field The field index to plot as the Z axis from the data file
+ (default: $FIELD, "$DEF_TITLE")
+ -h Display this help message
+ -s W,H PNG and window size in pixels (default: $SIZE)
+ -t title The title to display, should describe the field (-f) and units
+ (default: "$DEF_TITLE")
+ -w Render the plot as wireframe with a 2D colormap projected on the
+ XY plane rather than as the texture for the surface
+EOM
+}
+
+# Parse and validate arguments
+while getopts "d:f:hs:t:w" OPT; do
+ case $OPT in
+ d)
+ DATFILE="$OPTARG"
+ ;;
+ f)
+ FIELD="$OPTARG"
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ s)
+ SIZE="$OPTARG"
+ ;;
+ t)
+ TITLE="$OPTARG"
+ ;;
+ w)
+ PM3D_FRAGMENT="set pm3d at b"
+ W="-w"
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Ensure the data file exists
+if [ ! -f "$DATFILE" ]; then
+ echo "ERROR: $DATFILE does not exist"
+ usage
+ exit 1
+fi
+PLOT_BASENAME=${DATFILE%.*}-f$FIELD$W
+
+# Set a sane title
+# TODO: parse the header and define titles for each format parameter for TIME(1)
+if [ -z "$TITLE" ]; then
+ if [ ! "$FIELD" == "3" ]; then
+ TITLE="Field $FIELD"
+ else
+ TITLE="$DEF_TITLE"
+ fi
+fi
+
+# Determine the dgrid3d mesh dimensions size
+MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sed 's/^0*//' | sort -n | uniq | head -n1)
+MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 1 | sed 's/^0*//' | sort -n | uniq | tail -n1)
+BB_CNT=$[${MAX} - $MIN + 1]
+MIN=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sed 's/^0*//' | sort -n | uniq | head -n1)
+MAX=$(tail -n +2 "$DATFILE" | cut -d ' ' -f 2 | sed 's/^0*//' | sort -n | uniq | tail -n1)
+PM_CNT=$[${MAX} - $MIN + 1]
+
+
+(cat <<EOF
+set title "$TITLE"
+set xlabel "$XLABEL"
+set ylabel "$YLABEL"
+set style line 100 lt 5 lw 1.5
+$PM3D_FRAGMENT
+set dgrid3d $PM_CNT,$BB_CNT splines
+set ticslevel 0.2
+
+set term png size $SIZE
+set output "$PLOT_BASENAME.png"
+splot "$DATFILE" every ::1 using 1:2:$FIELD with lines ls 100
+
+set view 90,0
+set output "$PLOT_BASENAME-bb.png"
+replot
+
+set view 90,90
+set output "$PLOT_BASENAME-pm.png"
+replot
+
+set view 60,30
+set term wxt size $SIZE
+replot
+EOF
+) | gnuplot --persist
diff --git a/poky/scripts/contrib/bb-perf/bb-matrix.sh b/poky/scripts/contrib/bb-perf/bb-matrix.sh
new file mode 100755
index 000000000..106456584
--- /dev/null
+++ b/poky/scripts/contrib/bb-perf/bb-matrix.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+# This script runs BB_CMD (typically building core-image-sato) for all
+# combincations of BB_RANGE and PM_RANGE values. It saves off all the console
+# logs, the buildstats directories, and creates a bb-pm-runtime.dat file which
+# can be used to postprocess the results with a plotting tool, spreadsheet, etc.
+# Before running this script, it is recommended that you pre-download all the
+# necessary sources by performing the BB_CMD once manually. It is also a good
+# idea to disable cron to avoid runtime variations caused by things like the
+# locate process. Be sure to sanitize the dat file prior to post-processing as
+# it may contain error messages or bad runs that should be removed.
+#
+# AUTHORS
+# Darren Hart <dvhart@linux.intel.com>
+#
+
+# The following ranges are appropriate for a 4 core system with 8 logical units
+# Use leading 0s to ensure all digits are the same string length, this results
+# in nice log file names and columnar dat files.
+BB_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16"
+PM_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16"
+
+DATADIR="bb-matrix-$$"
+BB_CMD="bitbake core-image-minimal"
+RUNTIME_LOG="$DATADIR/bb-matrix.dat"
+
+# See TIME(1) for a description of the time format parameters
+# The following all report 0: W K r s t w
+TIME_STR="%e %S %U %P %c %w %R %F %M %x"
+
+# Prepare the DATADIR
+mkdir $DATADIR
+if [ $? -ne 0 ]; then
+ echo "Failed to create $DATADIR."
+ exit 1
+fi
+
+# Add a simple header
+echo "BB PM $TIME_STR" > $RUNTIME_LOG
+for BB in $BB_RANGE; do
+ for PM in $PM_RANGE; do
+ RUNDIR="$DATADIR/$BB-$PM-build"
+ mkdir $RUNDIR
+ BB_LOG=$RUNDIR/$BB-$PM-bitbake.log
+ date
+ echo "BB=$BB PM=$PM Logging to $BB_LOG"
+
+ echo -n " Preparing the work directory... "
+ rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null
+ echo "done"
+
+ # Export the variables under test and run the bitbake command
+ # Strip any leading zeroes before passing to bitbake
+ export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//')
+ export PARALLEL_MAKE="-j $(echo $PM | sed 's/^0*//')"
+ /usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG
+
+ echo " $(tail -n1 $RUNTIME_LOG)"
+ cp -a tmp/buildstats $RUNDIR/$BB-$PM-buildstats
+ done
+done
diff --git a/poky/scripts/contrib/bb-perf/buildstats-plot.sh b/poky/scripts/contrib/bb-perf/buildstats-plot.sh
new file mode 100755
index 000000000..7e8ae0410
--- /dev/null
+++ b/poky/scripts/contrib/bb-perf/buildstats-plot.sh
@@ -0,0 +1,157 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+#
+# Produces script data to be consumed by gnuplot. There are two possible plots
+# depending if either the -S parameter is present or not:
+#
+# * without -S: Produces a histogram listing top N recipes/tasks versus
+# stats. The first stat defined in the -s parameter is the one taken
+# into account for ranking
+# * -S: Produces a histogram listing tasks versus stats. In this case,
+# the value of each stat is the sum for that particular stat in all recipes found.
+# Stats values are in descending order defined by the first stat defined on -s
+#
+# EXAMPLES
+#
+# 1. Top recipes' tasks taking into account utime
+#
+# $ buildstats-plot.sh -s utime | gnuplot -p
+#
+# 2. Tasks versus utime:stime
+#
+# $ buildstats-plot.sh -s utime:stime -S | gnuplot -p
+#
+# 3. Tasks versus IO write_bytes:IO read_bytes
+#
+# $ buildstats-plot.sh -s 'IO write_bytes:IO read_bytes' -S | gnuplot -p
+#
+# AUTHORS
+# Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+#
+
+set -o nounset
+set -o errexit
+
+BS_DIR="tmp/buildstats"
+N=10
+STATS="utime"
+SUM=""
+OUTDATA_FILE="$PWD/buildstats-plot.out"
+
+function usage {
+ CMD=$(basename $0)
+ cat <<EOM
+Usage: $CMD [-b buildstats_dir] [-t do_task]
+ -b buildstats The path where the folder resides
+ (default: "$BS_DIR")
+ -n N Top N recipes to display. Ignored if -S is present
+ (default: "$N")
+ -s stats The stats to be matched. If more that one stat, units
+ should be the same because data is plot as histogram.
+ (see buildstats.sh -h for all options) or any other defined
+ (build)stat separated by colons, i.e. stime:utime
+ (default: "$STATS")
+ -S Sum values for a particular stat for found recipes
+ -o Output data file.
+ (default: "$OUTDATA_FILE")
+ -h Display this help message
+EOM
+}
+
+# Parse and validate arguments
+while getopts "b:n:s:o:Sh" OPT; do
+ case $OPT in
+ b)
+ BS_DIR="$OPTARG"
+ ;;
+ n)
+ N="$OPTARG"
+ ;;
+ s)
+ STATS="$OPTARG"
+ ;;
+ S)
+ SUM="y"
+ ;;
+ o)
+ OUTDATA_FILE="$OPTARG"
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Get number of stats
+IFS=':'; statsarray=(${STATS}); unset IFS
+nstats=${#statsarray[@]}
+
+# Get script folder, use to run buildstats.sh
+CD=$(dirname $0)
+
+# Parse buildstats recipes to produce a single table
+OUTBUILDSTATS="$PWD/buildstats.log"
+$CD/buildstats.sh -H -s "$STATS" -H > $OUTBUILDSTATS
+
+# Get headers
+HEADERS=$(cat $OUTBUILDSTATS | sed -n -e '1s/ /-/g' -e '1s/:/ /gp')
+
+echo -e "set boxwidth 0.9 relative"
+echo -e "set style data histograms"
+echo -e "set style fill solid 1.0 border lt -1"
+echo -e "set xtics rotate by 45 right"
+
+# Get output data
+if [ -z "$SUM" ]; then
+ cat $OUTBUILDSTATS | sed -e '1d' | sort -k3 -n -r | head -$N > $OUTDATA_FILE
+ # include task at recipe column
+ sed -i -e "1i\
+${HEADERS}" $OUTDATA_FILE
+ echo -e "set title \"Top task/recipes\""
+ echo -e "plot for [COL=3:`expr 3 + ${nstats} - 1`] '${OUTDATA_FILE}' using COL:xtic(stringcolumn(1).' '.stringcolumn(2)) title columnheader(COL)"
+else
+
+ # Construct datatamash sum argument (sum 3 sum 4 ...)
+ declare -a sumargs
+ j=0
+ for i in `seq $nstats`; do
+ sumargs[j]=sum; j=$(( $j + 1 ))
+ sumargs[j]=`expr 3 + $i - 1`; j=$(( $j + 1 ))
+ done
+
+ # Do the processing with datamash
+ cat $OUTBUILDSTATS | sed -e '1d' | datamash -t ' ' -g1 ${sumargs[*]} | sort -k2 -n -r > $OUTDATA_FILE
+
+ # Include headers into resulted file, so we can include gnuplot xtics
+ HEADERS=$(echo $HEADERS | sed -e 's/recipe//1')
+ sed -i -e "1i\
+${HEADERS}" $OUTDATA_FILE
+
+ # Plot
+ echo -e "set title \"Sum stats values per task for all recipes\""
+ echo -e "plot for [COL=2:`expr 2 + ${nstats} - 1`] '${OUTDATA_FILE}' using COL:xtic(1) title columnheader(COL)"
+fi
+
diff --git a/poky/scripts/contrib/bb-perf/buildstats.sh b/poky/scripts/contrib/bb-perf/buildstats.sh
new file mode 100755
index 000000000..8d7e2488f
--- /dev/null
+++ b/poky/scripts/contrib/bb-perf/buildstats.sh
@@ -0,0 +1,155 @@
+#!/bin/bash
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+# Given 'buildstats' data (generate by bitbake when setting
+# USER_CLASSES ?= "buildstats" on local.conf), task names and a stats values
+# (these are the ones preset on the buildstats files), outputs
+# '<task> <recipe> <value_1> <value_2> ... <value_n>'. The units are the ones
+# defined at buildstats, which in turn takes data from /proc/[pid] files
+#
+# Some useful pipelines
+#
+# 1. Tasks with largest stime (Amount of time that this process has been scheduled
+# in kernel mode) values
+# $ buildstats.sh -b <buildstats> -s stime | sort -k3 -n -r | head
+#
+# 2. Min, max, sum utime (Amount of time that this process has been scheduled
+# in user mode) per task (in needs GNU datamash)
+# $ buildstats.sh -b <buildstats> -s utime | datamash -t' ' -g1 min 3 max 3 sum 3 | sort -k4 -n -r
+#
+# AUTHORS
+# Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+#
+
+# Stats, by type
+TIME="utime:stime:cutime:cstime"
+IO="IO wchar:IO write_bytes:IO syscr:IO read_bytes:IO rchar:IO syscw:IO cancelled_write_bytes"
+RUSAGE="rusage ru_utime:rusage ru_stime:rusage ru_maxrss:rusage ru_minflt:rusage ru_majflt:\
+rusage ru_inblock:rusage ru_oublock:rusage ru_nvcsw:rusage ru_nivcsw"
+
+CHILD_RUSAGE="Child rusage ru_utime:Child rusage ru_stime:Child rusage ru_maxrss:Child rusage ru_minflt:\
+Child rusage ru_majflt:Child rusage ru_inblock:Child rusage ru_oublock:Child rusage ru_nvcsw:\
+Child rusage ru_nivcsw"
+
+BS_DIR="tmp/buildstats"
+TASKS="compile:configure:fetch:install:patch:populate_lic:populate_sysroot:unpack"
+STATS="$TIME"
+HEADER="" # No header by default
+
+function usage {
+CMD=$(basename $0)
+cat <<EOM
+Usage: $CMD [-b buildstats_dir] [-t do_task]
+ -b buildstats The path where the folder resides
+ (default: "$BS_DIR")
+ -t tasks The tasks to be computed
+ (default: "$TASKS")
+ -s stats The stats to be matched. Options: TIME, IO, RUSAGE, CHILD_RUSAGE
+ or any other defined buildstat separated by colons, i.e. stime:utime
+ (default: "$STATS")
+ Default stat sets:
+ TIME=$TIME
+ IO=$IO
+ RUSAGE=$RUSAGE
+ CHILD_RUSAGE=$CHILD_RUSAGE
+ -h Display this help message
+EOM
+}
+
+# Parse and validate arguments
+while getopts "b:t:s:Hh" OPT; do
+ case $OPT in
+ b)
+ BS_DIR="$OPTARG"
+ ;;
+ t)
+ TASKS="$OPTARG"
+ ;;
+ s)
+ STATS="$OPTARG"
+ ;;
+ H)
+ HEADER="y"
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Ensure the buildstats folder exists
+if [ ! -d "$BS_DIR" ]; then
+ echo "ERROR: $BS_DIR does not exist"
+ usage
+ exit 1
+fi
+
+stats=""
+IFS=":"
+for stat in ${STATS}; do
+ case $stat in
+ TIME)
+ stats="${stats}:${TIME}"
+ ;;
+ IO)
+ stats="${stats}:${IO}"
+ ;;
+ RUSAGE)
+ stats="${stats}:${RUSAGE}"
+ ;;
+ CHILD_RUSAGE)
+ stats="${stats}:${CHILD_RUSAGE}"
+ ;;
+ *)
+ stats="${STATS}"
+ esac
+done
+
+# remove possible colon at the beginning
+stats="$(echo "$stats" | sed -e 's/^://1')"
+
+# Provide a header if required by the user
+[ -n "$HEADER" ] && { echo "task:recipe:$stats"; }
+
+for task in ${TASKS}; do
+ task="do_${task}"
+ for file in $(find ${BS_DIR} -type f -name ${task} | awk 'BEGIN{ ORS=""; OFS=":" } { print $0,"" }'); do
+ recipe="$(basename $(dirname $file))"
+ times=""
+ for stat in ${stats}; do
+ [ -z "$stat" ] && { echo "empty stats"; }
+ time=$(sed -n -e "s/^\($stat\): \\(.*\\)/\\2/p" $file)
+ # in case the stat is not present, set the value as NA
+ [ -z "$time" ] && { time="NA"; }
+ # Append it to times
+ if [ -z "$times" ]; then
+ times="${time}"
+ else
+ times="${times} ${time}"
+ fi
+ done
+ echo "${task} ${recipe} ${times}"
+ done
+done
diff --git a/poky/scripts/contrib/bbvars.py b/poky/scripts/contrib/bbvars.py
new file mode 100755
index 000000000..286b5a940
--- /dev/null
+++ b/poky/scripts/contrib/bbvars.py
@@ -0,0 +1,180 @@
+#!/usr/bin/env python3
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Copyright (C) Darren Hart <dvhart@linux.intel.com>, 2010
+
+
+import sys
+import getopt
+import os
+import os.path
+import re
+
+# Set up sys.path to let us import tinfoil
+scripts_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+lib_path = scripts_path + '/lib'
+sys.path.insert(0, lib_path)
+import scriptpath
+scriptpath.add_bitbake_lib_path()
+import bb.tinfoil
+
+def usage():
+ print('Usage: %s -d FILENAME [-d FILENAME]*' % os.path.basename(sys.argv[0]))
+ print(' -d FILENAME documentation file to search')
+ print(' -h, --help display this help and exit')
+ print(' -t FILENAME documentation config file (for doc tags)')
+ print(' -T Only display variables with doc tags (requires -t)')
+
+def bbvar_is_documented(var, documented_vars):
+ ''' Check if variable (var) is in the list of documented variables(documented_vars) '''
+ if var in documented_vars:
+ return True
+ else:
+ return False
+
+def collect_documented_vars(docfiles):
+ ''' Walk the docfiles and collect the documented variables '''
+ documented_vars = []
+ prog = re.compile(".*($|[^A-Z_])<glossentry id=\'var-")
+ var_prog = re.compile('<glossentry id=\'var-(.*)\'>')
+ for d in docfiles:
+ with open(d) as f:
+ documented_vars += var_prog.findall(f.read())
+
+ return documented_vars
+
+def bbvar_doctag(var, docconf):
+ prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var))
+ if docconf == "":
+ return "?"
+
+ try:
+ f = open(docconf)
+ except IOError as err:
+ return err.args[1]
+
+ for line in f:
+ m = prog.search(line)
+ if m:
+ return m.group(1)
+
+ f.close()
+ return ""
+
+def main():
+ docfiles = []
+ bbvars = set()
+ undocumented = []
+ docconf = ""
+ onlydoctags = False
+
+ # Collect and validate input
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"])
+ except getopt.GetoptError as err:
+ print('%s' % str(err))
+ usage()
+ sys.exit(2)
+
+ for o, a in opts:
+ if o in ('-h', '--help'):
+ usage()
+ sys.exit(0)
+ elif o == '-d':
+ if os.path.isfile(a):
+ docfiles.append(a)
+ else:
+ print('ERROR: documentation file %s is not a regular file' % a)
+ sys.exit(3)
+ elif o == "-t":
+ if os.path.isfile(a):
+ docconf = a
+ elif o == "-T":
+ onlydoctags = True
+ else:
+ assert False, "unhandled option"
+
+ if len(docfiles) == 0:
+ print('ERROR: no docfile specified')
+ usage()
+ sys.exit(5)
+
+ if onlydoctags and docconf == "":
+ print('ERROR: no docconf specified')
+ usage()
+ sys.exit(7)
+
+ prog = re.compile("^[^a-z]*$")
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False)
+ parser = bb.codeparser.PythonParser('parser', None)
+ datastore = tinfoil.config_data
+
+ def bbvars_update(data):
+ if prog.match(data):
+ bbvars.add(data)
+ if tinfoil.config_data.getVarFlag(data, 'python'):
+ try:
+ parser.parse_python(tinfoil.config_data.getVar(data))
+ except bb.data_smart.ExpansionError:
+ pass
+ for var in parser.references:
+ if prog.match(var):
+ bbvars.add(var)
+ else:
+ try:
+ expandedVar = datastore.expandWithRefs(datastore.getVar(data, False), data)
+ for var in expandedVar.references:
+ if prog.match(var):
+ bbvars.add(var)
+ except bb.data_smart.ExpansionError:
+ pass
+
+ # Use tinfoil to collect all the variable names globally
+ for data in datastore:
+ bbvars_update(data)
+
+ # Collect variables from all recipes
+ for recipe in tinfoil.all_recipe_files(variants=False):
+ print("Checking %s" % recipe)
+ for data in tinfoil.parse_recipe_file(recipe):
+ bbvars_update(data)
+
+ documented_vars = collect_documented_vars(docfiles)
+
+ # Check each var for documentation
+ varlen = 0
+ for v in bbvars:
+ if len(v) > varlen:
+ varlen = len(v)
+ if not bbvar_is_documented(v, documented_vars):
+ undocumented.append(v)
+ undocumented.sort()
+ varlen = varlen + 1
+
+ # Report all undocumented variables
+ print('Found %d undocumented bb variables (out of %d):' % (len(undocumented), len(bbvars)))
+ header = '%s%s' % (str("VARIABLE").ljust(varlen), str("DOCTAG").ljust(7))
+ print(header)
+ print(str("").ljust(len(header), '='))
+ for v in undocumented:
+ doctag = bbvar_doctag(v, docconf)
+ if not onlydoctags or not doctag == "":
+ print('%s%s' % (v.ljust(varlen), doctag))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/contrib/build-perf-test-wrapper.sh b/poky/scripts/contrib/build-perf-test-wrapper.sh
new file mode 100755
index 000000000..19bee1dd0
--- /dev/null
+++ b/poky/scripts/contrib/build-perf-test-wrapper.sh
@@ -0,0 +1,239 @@
+#!/bin/bash
+#
+# Build performance test script wrapper
+#
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+#
+# This script is a simple wrapper around the actual build performance tester
+# script. This script initializes the build environment, runs
+# oe-build-perf-test and archives the results.
+
+script=`basename $0`
+script_dir=$(realpath $(dirname $0))
+archive_dir=~/perf-results/archives
+
+usage () {
+cat << EOF
+Usage: $script [-h] [-c COMMITISH] [-C GIT_REPO]
+
+Optional arguments:
+ -h show this help and exit.
+ -a ARCHIVE_DIR archive results tarball here, give an empty string to
+ disable tarball archiving (default: $archive_dir)
+ -c COMMITISH test (checkout) this commit, <branch>:<commit> can be
+ specified to test specific commit of certain branch
+ -C GIT_REPO commit results into Git
+ -E EMAIL_ADDR send email report
+ -P GIT_REMOTE push results to a remote Git repository
+ -R DEST rsync reports to a remote destination
+ -w WORK_DIR work dir for this script
+ (default: GIT_TOP_DIR/build-perf-test)
+ -x create xml report (instead of json)
+EOF
+}
+
+get_os_release_var () {
+ ( source /etc/os-release; eval echo '$'$1 )
+}
+
+
+# Parse command line arguments
+commitish=""
+oe_build_perf_test_extra_opts=()
+oe_git_archive_extra_opts=()
+while getopts "ha:c:C:E:P:R:w:x" opt; do
+ case $opt in
+ h) usage
+ exit 0
+ ;;
+ a) archive_dir=`realpath -s "$OPTARG"`
+ ;;
+ c) commitish=$OPTARG
+ ;;
+ C) results_repo=`realpath -s "$OPTARG"`
+ ;;
+ E) email_to="$OPTARG"
+ ;;
+ P) oe_git_archive_extra_opts+=("--push" "$OPTARG")
+ ;;
+ R) rsync_dst="$OPTARG"
+ ;;
+ w) base_dir=`realpath -s "$OPTARG"`
+ ;;
+ x) oe_build_perf_test_extra_opts+=("--xml")
+ ;;
+ *) usage
+ exit 1
+ ;;
+ esac
+done
+
+# Check positional args
+shift "$((OPTIND - 1))"
+if [ $# -ne 0 ]; then
+ echo "ERROR: No positional args are accepted."
+ usage
+ exit 1
+fi
+
+# Open a file descriptor for flock and acquire lock
+LOCK_FILE="/tmp/oe-build-perf-test-wrapper.lock"
+if ! exec 3> "$LOCK_FILE"; then
+ echo "ERROR: Unable to open lock file"
+ exit 1
+fi
+if ! flock -n 3; then
+ echo "ERROR: Another instance of this script is running"
+ exit 1
+fi
+
+echo "Running on `uname -n`"
+if ! git_topdir=$(git rev-parse --show-toplevel); then
+ echo "The current working dir doesn't seem to be a git clone. Please cd there before running `basename $0`"
+ exit 1
+fi
+
+cd "$git_topdir"
+
+if [ -n "$commitish" ]; then
+ echo "Running git fetch"
+ git fetch &> /dev/null
+ git checkout HEAD^0 &> /dev/null
+
+ # Handle <branch>:<commit> format
+ if echo "$commitish" | grep -q ":"; then
+ commit=`echo "$commitish" | cut -d":" -f2`
+ branch=`echo "$commitish" | cut -d":" -f1`
+ else
+ commit="$commitish"
+ branch="$commitish"
+ fi
+
+ echo "Checking out $commitish"
+ git branch -D $branch &> /dev/null
+ if ! git checkout -f $branch &> /dev/null; then
+ echo "ERROR: Git checkout failed"
+ exit 1
+ fi
+
+ # Check that the specified branch really contains the commit
+ commit_hash=`git rev-parse --revs-only $commit --`
+ if [ -z "$commit_hash" -o "`git merge-base $branch $commit`" != "$commit_hash" ]; then
+ echo "ERROR: branch $branch does not contain commit $commit"
+ exit 1
+ fi
+ git reset --hard $commit > /dev/null
+fi
+
+# Determine name of the current branch
+branch=`git symbolic-ref HEAD 2> /dev/null`
+# Strip refs/heads/
+branch=${branch:11}
+
+# Setup build environment
+if [ -z "$base_dir" ]; then
+ base_dir="$git_topdir/build-perf-test"
+fi
+echo "Using working dir $base_dir"
+
+timestamp=`date "+%Y%m%d%H%M%S"`
+git_rev=$(git rev-parse --short HEAD) || exit 1
+build_dir="$base_dir/build-$git_rev-$timestamp"
+results_dir="$base_dir/results-$git_rev-$timestamp"
+globalres_log="$base_dir/globalres.log"
+machine="qemux86"
+
+mkdir -p "$base_dir"
+source ./oe-init-build-env $build_dir >/dev/null || exit 1
+
+# Additional config
+auto_conf="$build_dir/conf/auto.conf"
+echo "MACHINE = \"$machine\"" > "$auto_conf"
+echo 'BB_NUMBER_THREADS = "8"' >> "$auto_conf"
+echo 'PARALLEL_MAKE = "-j 8"' >> "$auto_conf"
+echo "DL_DIR = \"$base_dir/downloads\"" >> "$auto_conf"
+# Disabling network sanity check slightly reduces the variance of timing results
+echo 'CONNECTIVITY_CHECK_URIS = ""' >> "$auto_conf"
+# Possibility to define extra settings
+if [ -f "$base_dir/auto.conf.extra" ]; then
+ cat "$base_dir/auto.conf.extra" >> "$auto_conf"
+fi
+
+# Run actual test script
+oe-build-perf-test --out-dir "$results_dir" \
+ --globalres-file "$globalres_log" \
+ "${oe_build_perf_test_extra_opts[@]}" \
+ --lock-file "$base_dir/oe-build-perf.lock"
+
+case $? in
+ 1) echo "ERROR: oe-build-perf-test script failed!"
+ exit 1
+ ;;
+ 2) echo "NOTE: some tests failed!"
+ ;;
+esac
+
+# Commit results to git
+if [ -n "$results_repo" ]; then
+ echo -e "\nArchiving results in $results_repo"
+ oe-git-archive \
+ --git-dir "$results_repo" \
+ --branch-name "{hostname}/{branch}/{machine}" \
+ --tag-name "{hostname}/{branch}/{machine}/{commit_count}-g{commit}/{tag_number}" \
+ --exclude "buildstats.json" \
+ --notes "buildstats/{branch_name}" "$results_dir/buildstats.json" \
+ "${oe_git_archive_extra_opts[@]}" \
+ "$results_dir"
+
+ # Generate test reports
+ sanitized_branch=`echo $branch | tr / _`
+ report_txt=`hostname`_${sanitized_branch}_${machine}.txt
+ report_html=`hostname`_${sanitized_branch}_${machine}.html
+ echo -e "\nGenerating test report"
+ oe-build-perf-report -r "$results_repo" > $report_txt
+ oe-build-perf-report -r "$results_repo" --html > $report_html
+
+ # Send email report
+ if [ -n "$email_to" ]; then
+ echo "Emailing test report"
+ os_name=`get_os_release_var PRETTY_NAME`
+ "$script_dir"/oe-build-perf-report-email.py --to "$email_to" --subject "Build Perf Test Report for $os_name" --text $report_txt --html $report_html "${OE_BUILD_PERF_REPORT_EMAIL_EXTRA_ARGS[@]}"
+ fi
+
+ # Upload report files, unless we're on detached head
+ if [ -n "$rsync_dst" -a -n "$branch" ]; then
+ echo "Uploading test report"
+ rsync $report_txt $report_html $rsync_dst
+ fi
+fi
+
+
+echo -ne "\n\n-----------------\n"
+echo "Global results file:"
+echo -ne "\n"
+
+cat "$globalres_log"
+
+if [ -n "$archive_dir" ]; then
+ echo -ne "\n\n-----------------\n"
+ echo "Archiving results in $archive_dir"
+ mkdir -p "$archive_dir"
+ results_basename=`basename "$results_dir"`
+ results_dirname=`dirname "$results_dir"`
+ tar -czf "$archive_dir/`uname -n`-${results_basename}.tar.gz" -C "$results_dirname" "$results_basename"
+fi
+
+rm -rf "$build_dir"
+rm -rf "$results_dir"
+
+echo "DONE"
diff --git a/poky/scripts/contrib/build-perf-test.sh b/poky/scripts/contrib/build-perf-test.sh
new file mode 100755
index 000000000..9a091edb0
--- /dev/null
+++ b/poky/scripts/contrib/build-perf-test.sh
@@ -0,0 +1,400 @@
+#!/bin/bash
+#
+# This script runs a series of tests (with and without sstate) and reports build time (and tmp/ size)
+#
+# Build performance test script
+#
+# Copyright 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# AUTHORS:
+# Stefan Stanacar <stefanx.stanacar@intel.com>
+
+
+ME=$(basename $0)
+
+#
+# usage and setup
+#
+
+usage () {
+cat << EOT
+Usage: $ME [-h]
+ $ME [-c <commit>] [-v] [-m <val>] [-j <val>] [-t <val>] [-i <image-name>] [-d <path>]
+Options:
+ -h
+ Display this help and exit.
+ -c <commit>
+ git checkout <commit> before anything else
+ -v
+ Show bitbake output, don't redirect it to a log.
+ -m <machine>
+ Value for MACHINE. Default is qemux86.
+ -j <val>
+ Value for PARALLEL_MAKE. Default is 8.
+ -t <val>
+ Value for BB_NUMBER_THREADS. Default is 8.
+ -i <image-name>
+ Instead of timing against core-image-sato, use <image-name>
+ -d <path>
+ Use <path> as DL_DIR
+ -p <githash>
+ Cherry pick githash onto the commit
+
+Note: current working directory must be inside a poky git clone.
+
+EOT
+}
+
+
+if clonedir=$(git rev-parse --show-toplevel); then
+ cd $clonedir
+else
+ echo "The current working dir doesn't seem to be a poky git clone. Please cd there before running $ME"
+ exit 1
+fi
+
+IMAGE="core-image-sato"
+verbose=0
+dldir=
+commit=
+pmake=
+cherrypicks=
+while getopts "hvc:m:j:t:i:d:p:" opt; do
+ case $opt in
+ h) usage
+ exit 0
+ ;;
+ v) verbose=1
+ ;;
+ c) commit=$OPTARG
+ ;;
+ m) export MACHINE=$OPTARG
+ ;;
+ j) pmake=$OPTARG
+ ;;
+ t) export BB_NUMBER_THREADS=$OPTARG
+ ;;
+ i) IMAGE=$OPTARG
+ ;;
+ d) dldir=$OPTARG
+ ;;
+ p) cherrypicks="$cherrypicks $OPTARG"
+ ;;
+ *) usage
+ exit 1
+ ;;
+ esac
+done
+
+
+#drop cached credentials and test for sudo access without a password
+sudo -k -n ls > /dev/null 2>&1
+reqpass=$?
+if [ $reqpass -ne 0 ]; then
+ echo "The script requires sudo access to drop caches between builds (echo 3 > /proc/sys/vm/drop_caches)"
+ read -s -p "Please enter your sudo password: " pass
+ echo
+fi
+
+if [ -n "$commit" ]; then
+ echo "git checkout -f $commit"
+ git pull > /dev/null 2>&1
+ git checkout -f $commit || exit 1
+ git pull > /dev/null 2>&1
+fi
+
+if [ -n "$cherrypicks" ]; then
+ for c in $cherrypicks; do
+ git cherry-pick $c
+ done
+fi
+
+rev=$(git rev-parse --short HEAD) || exit 1
+OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`"
+BUILDDIR="$OUTDIR/build"
+resultsfile="$OUTDIR/results.log"
+cmdoutput="$OUTDIR/commands.log"
+myoutput="$OUTDIR/output.log"
+globalres="$clonedir/build-perf-test/globalres.log"
+
+mkdir -p $OUTDIR || exit 1
+
+log () {
+ local msg="$1"
+ echo "`date`: $msg" | tee -a $myoutput
+}
+
+
+#
+# Config stuff
+#
+
+branch=`git branch 2>&1 | grep "^* " | tr -d "* "`
+gitcommit=$(git rev-parse HEAD) || exit 1
+log "Running on $branch:$gitcommit"
+
+source ./oe-init-build-env $OUTDIR/build >/dev/null || exit 1
+cd $OUTDIR/build
+
+[ -n "$MACHINE" ] || export MACHINE="qemux86"
+[ -n "$BB_NUMBER_THREADS" ] || export BB_NUMBER_THREADS="8"
+
+if [ -n "$pmake" ]; then
+ export PARALLEL_MAKE="-j $pmake"
+else
+ export PARALLEL_MAKE="-j 8"
+fi
+
+if [ -n "$dldir" ]; then
+ echo "DL_DIR = \"$dldir\"" >> conf/local.conf
+else
+ echo "DL_DIR = \"$clonedir/build-perf-test/downloads\"" >> conf/local.conf
+fi
+
+# Sometimes I've noticed big differences in timings for the same commit, on the same machine
+# Disabling the network sanity check helps a bit (because of my crappy network connection and/or proxy)
+echo "CONNECTIVITY_CHECK_URIS =\"\"" >> conf/local.conf
+
+
+#
+# Functions
+#
+
+declare -a TIMES
+time_count=0
+declare -a SIZES
+size_count=0
+
+time_cmd () {
+ log " Timing: $*"
+
+ if [ $verbose -eq 0 ]; then
+ /usr/bin/time -v -o $resultsfile "$@" >> $cmdoutput
+ else
+ /usr/bin/time -v -o $resultsfile "$@"
+ fi
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ t=`grep wall $resultsfile | sed 's/.*m:ss): //'`
+ log " TIME: $t"
+ TIMES[(( time_count++ ))]="$t"
+ else
+ log "ERROR: exit status was non-zero, will report time as 0."
+ TIMES[(( time_count++ ))]="0"
+ fi
+
+ #time by default overwrites the output file and we want to keep the results
+ #it has an append option but I don't want to clobber the results in the same file
+ i=`ls $OUTDIR/results.log* |wc -l`
+ mv $resultsfile "${resultsfile}.${i}"
+ log "More stats can be found in ${resultsfile}.${i}"
+}
+
+bbtime () {
+ time_cmd bitbake "$@"
+}
+
+#we don't time bitbake here
+bbnotime () {
+ local arg="$@"
+ log " Running: bitbake ${arg}"
+ if [ $verbose -eq 0 ]; then
+ bitbake ${arg} >> $cmdoutput
+ else
+ bitbake ${arg}
+ fi
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ log " Finished bitbake ${arg}"
+ else
+ log "ERROR: exit status was non-zero. Exit.."
+ exit $ret
+ fi
+
+}
+
+do_rmtmp() {
+ log " Removing tmp"
+ rm -rf bitbake.lock pseudodone conf/sanity_info cache tmp
+}
+do_rmsstate () {
+ log " Removing sstate-cache"
+ rm -rf sstate-cache
+}
+do_sync () {
+ log " Syncing and dropping caches"
+ sync; sync
+ if [ $reqpass -eq 0 ]; then
+ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
+ else
+ echo "$pass" | sudo -S sh -c "echo 3 > /proc/sys/vm/drop_caches"
+ echo
+ fi
+ sleep 3
+}
+
+write_results() {
+ echo -n "`uname -n`,$branch:$gitcommit,`git describe`," >> $globalres
+ for i in "${TIMES[@]}"; do
+ echo -n "$i," >> $globalres
+ done
+ for i in "${SIZES[@]}"; do
+ echo -n "$i," >> $globalres
+ done
+ echo >> $globalres
+ sed -i '$ s/,$//' $globalres
+}
+
+####
+
+#
+# Test 1
+# Measure: Wall clock of "bitbake core-image-sato" and size of tmp/dir (w/o rm_work and w/ rm_work)
+# Pre: Downloaded sources, no sstate
+# Steps:
+# Part1:
+# - fetchall
+# - clean build dir
+# - time bitbake core-image-sato
+# - collect data
+# Part2:
+# - bitbake virtual/kernel -c cleansstate
+# - time bitbake virtual/kernel
+# Part3:
+# - add INHERIT to local.conf
+# - clean build dir
+# - build
+# - report size, remove INHERIT
+
+test1_p1 () {
+ log "Running Test 1, part 1/3: Measure wall clock of bitbake $IMAGE and size of tmp/ dir"
+ bbnotime $IMAGE --runall=fetch
+ do_rmtmp
+ do_rmsstate
+ do_sync
+ bbtime $IMAGE
+ s=`du -s tmp | sed 's/tmp//' | sed 's/[ \t]*$//'`
+ SIZES[(( size_count++ ))]="$s"
+ log "SIZE of tmp dir is: $s"
+ log "Buildstats are saved in $OUTDIR/buildstats-test1"
+ mv tmp/buildstats $OUTDIR/buildstats-test1
+}
+
+
+test1_p2 () {
+ log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel"
+ bbnotime virtual/kernel -c cleansstate
+ do_sync
+ bbtime virtual/kernel
+}
+
+test1_p3 () {
+ log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled"
+ echo "INHERIT += \"rm_work\"" >> conf/local.conf
+ do_rmtmp
+ do_rmsstate
+ do_sync
+ bbtime $IMAGE
+ sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf
+ s=`du -s tmp | sed 's/tmp//' | sed 's/[ \t]*$//'`
+ SIZES[(( size_count++ ))]="$s"
+ log "SIZE of tmp dir is: $s"
+ log "Buildstats are saved in $OUTDIR/buildstats-test13"
+ mv tmp/buildstats $OUTDIR/buildstats-test13
+}
+
+
+#
+# Test 2
+# Measure: Wall clock of "bitbake core-image-sato" and size of tmp/dir
+# Pre: populated sstate cache
+
+test2 () {
+ # Assuming test 1 has run
+ log "Running Test 2: Measure wall clock of bitbake $IMAGE -c rootfs with sstate"
+ do_rmtmp
+ do_sync
+ bbtime $IMAGE -c rootfs
+}
+
+
+# Test 3
+# parsing time metrics
+#
+# Start with
+# i) "rm -rf tmp/cache; time bitbake -p"
+# ii) "rm -rf tmp/cache/default-glibc/; time bitbake -p"
+# iii) "time bitbake -p"
+
+
+test3 () {
+ log "Running Test 3: Parsing time metrics (bitbake -p)"
+ log " Removing tmp/cache && cache"
+ rm -rf tmp/cache cache
+ bbtime -p
+ log " Removing tmp/cache/default-glibc/"
+ rm -rf tmp/cache/default-glibc/
+ bbtime -p
+ bbtime -p
+}
+
+#
+# Test 4 - eSDK
+# Measure: eSDK size and installation time
+test4 () {
+ log "Running Test 4: eSDK size and installation time"
+ bbnotime $IMAGE -c do_populate_sdk_ext
+
+ esdk_installer=(tmp/deploy/sdk/*-toolchain-ext-*.sh)
+
+ if [ ${#esdk_installer[*]} -eq 1 ]; then
+ s=$((`stat -c %s "$esdk_installer"` / 1024))
+ SIZES[(( size_count++ ))]="$s"
+ log "Download SIZE of eSDK is: $s kB"
+
+ do_sync
+ time_cmd "$esdk_installer" -y -d "tmp/esdk-deploy"
+
+ s=$((`du -sb "tmp/esdk-deploy" | cut -f1` / 1024))
+ SIZES[(( size_count++ ))]="$s"
+ log "Install SIZE of eSDK is: $s kB"
+ else
+ log "ERROR: other than one sdk found (${esdk_installer[*]}), reporting size and time as 0."
+ SIZES[(( size_count++ ))]="0"
+ TIMES[(( time_count++ ))]="0"
+ fi
+
+}
+
+
+# RUN!
+
+test1_p1
+test1_p2
+test1_p3
+test2
+test3
+test4
+
+# if we got til here write to global results
+write_results
+
+log "All done, cleaning up..."
+
+do_rmtmp
+do_rmsstate
diff --git a/poky/scripts/contrib/ddimage b/poky/scripts/contrib/ddimage
new file mode 100755
index 000000000..ab929957a
--- /dev/null
+++ b/poky/scripts/contrib/ddimage
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# Default to avoiding the first two disks on typical Linux and Mac OS installs
+# Better safe than sorry :-)
+BLACKLIST_DEVICES="/dev/sda /dev/sdb /dev/disk1 /dev/disk2"
+
+# 1MB blocksize
+BLOCKSIZE=1048576
+
+usage() {
+ echo "Usage: $(basename $0) IMAGE DEVICE"
+}
+
+image_details() {
+ IMG=$1
+ echo "Image details"
+ echo "============="
+ echo " image: $(basename $IMG)"
+ # stat format is different on Mac OS and Linux
+ if [ "$(uname)" = "Darwin" ]; then
+ echo " size: $(stat -L -f '%z bytes' $IMG)"
+ echo " modified: $(stat -L -f '%Sm' $IMG)"
+ else
+ echo " size: $(stat -L -c '%s bytes' $IMG)"
+ echo " modified: $(stat -L -c '%y' $IMG)"
+ fi
+ echo " type: $(file -L -b $IMG)"
+ echo ""
+}
+
+device_details() {
+ DEV=$1
+ BLOCK_SIZE=512
+
+ echo "Device details"
+ echo "=============="
+
+ # Collect disk info using diskutil on Mac OS
+ if [ "$(uname)" = "Darwin" ]; then
+ diskutil info $DEVICE | egrep "(Device Node|Media Name|Total Size)"
+ return
+ fi
+
+ # Default / Linux information collection
+ echo " device: $DEVICE"
+ if [ -f "/sys/class/block/$DEV/device/vendor" ]; then
+ echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)"
+ else
+ echo " vendor: UNKOWN"
+ fi
+ if [ -f "/sys/class/block/$DEV/device/model" ]; then
+ echo " model: $(cat /sys/class/block/$DEV/device/model)"
+ else
+ echo " model: UNKNOWN"
+ fi
+ if [ -f "/sys/class/block/$DEV/size" ]; then
+ echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes"
+ else
+ echo " size: UNKNOWN"
+ fi
+ echo ""
+}
+
+if [ $# -ne 2 ]; then
+ usage
+ exit 1
+fi
+
+IMAGE=$1
+DEVICE=$2
+
+if [ ! -e "$IMAGE" ]; then
+ echo "ERROR: Image $IMAGE does not exist"
+ usage
+ exit 1
+fi
+
+
+for i in ${BLACKLIST_DEVICES}; do
+ if [ "$i" = "$DEVICE" ]; then
+ echo "ERROR: Device $DEVICE is blacklisted"
+ exit 1
+ fi
+done
+
+if [ ! -w "$DEVICE" ]; then
+ echo "ERROR: Device $DEVICE does not exist or is not writable"
+ usage
+ exit 1
+fi
+
+image_details $IMAGE
+device_details $(basename $DEVICE)
+
+printf "Write $IMAGE to $DEVICE [y/N]? "
+read RESPONSE
+if [ "$RESPONSE" != "y" ]; then
+ echo "Write aborted"
+ exit 0
+fi
+
+echo "Writing image..."
+if which pv >/dev/null 2>&1; then
+ pv "$IMAGE" | dd of="$DEVICE" bs="$BLOCKSIZE"
+else
+ dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE"
+fi
+sync
diff --git a/poky/scripts/contrib/devtool-stress.py b/poky/scripts/contrib/devtool-stress.py
new file mode 100755
index 000000000..d555c51a6
--- /dev/null
+++ b/poky/scripts/contrib/devtool-stress.py
@@ -0,0 +1,256 @@
+#!/usr/bin/env python3
+
+# devtool stress tester
+#
+# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import sys
+import os
+import os.path
+import subprocess
+import re
+import argparse
+import logging
+import tempfile
+import shutil
+import signal
+import fnmatch
+
+scripts_lib_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'lib'))
+sys.path.insert(0, scripts_lib_path)
+import scriptutils
+import argparse_oe
+logger = scriptutils.logger_create('devtool-stress')
+
+def select_recipes(args):
+ import bb.tinfoil
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare(False)
+
+ pkg_pn = tinfoil.cooker.recipecaches[''].pkg_pn
+ (latest_versions, preferred_versions) = bb.providers.findProviders(tinfoil.config_data, tinfoil.cooker.recipecaches[''], pkg_pn)
+
+ skip_classes = args.skip_classes.split(',')
+
+ recipelist = []
+ for pn in sorted(pkg_pn):
+ pref = preferred_versions[pn]
+ inherits = [os.path.splitext(os.path.basename(f))[0] for f in tinfoil.cooker.recipecaches[''].inherits[pref[1]]]
+ for cls in skip_classes:
+ if cls in inherits:
+ break
+ else:
+ recipelist.append(pn)
+
+ tinfoil.shutdown()
+
+ resume_from = args.resume_from
+ if resume_from:
+ if not resume_from in recipelist:
+ print('%s is not a testable recipe' % resume_from)
+ return 1
+ if args.only:
+ only = args.only.split(',')
+ for onlyitem in only:
+ for pn in recipelist:
+ if fnmatch.fnmatch(pn, onlyitem):
+ break
+ else:
+ print('%s does not match any testable recipe' % onlyitem)
+ return 1
+ else:
+ only = None
+ if args.skip:
+ skip = args.skip.split(',')
+ else:
+ skip = []
+
+ recipes = []
+ for pn in recipelist:
+ if resume_from:
+ if pn == resume_from:
+ resume_from = None
+ else:
+ continue
+
+ if args.only:
+ for item in only:
+ if fnmatch.fnmatch(pn, item):
+ break
+ else:
+ continue
+
+ skipit = False
+ for item in skip:
+ if fnmatch.fnmatch(pn, item):
+ skipit = True
+ if skipit:
+ continue
+
+ recipes.append(pn)
+
+ return recipes
+
+
+def stress_extract(args):
+ import bb.process
+
+ recipes = select_recipes(args)
+
+ failures = 0
+ tmpdir = tempfile.mkdtemp()
+ os.setpgrp()
+ try:
+ for pn in recipes:
+ sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.'))
+ sys.stdout.flush()
+ failed = False
+ skipped = None
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool extract %s %s' % (pn, srctree))
+ except bb.process.ExecutionError as exc:
+ if exc.exitcode == 4:
+ skipped = 'incompatible'
+ else:
+ failed = True
+ with open('stress_%s_extract.log' % pn, 'w') as f:
+ f.write(str(exc))
+
+ if os.path.exists(srctree):
+ shutil.rmtree(srctree)
+
+ if failed:
+ print('failed')
+ failures += 1
+ elif skipped:
+ print('skipped (%s)' % skipped)
+ else:
+ print('ok')
+ except KeyboardInterrupt:
+ # We want any child processes killed. This is crude, but effective.
+ os.killpg(0, signal.SIGTERM)
+
+ if failures:
+ return 1
+ else:
+ return 0
+
+
+def stress_modify(args):
+ import bb.process
+
+ recipes = select_recipes(args)
+
+ failures = 0
+ tmpdir = tempfile.mkdtemp()
+ os.setpgrp()
+ try:
+ for pn in recipes:
+ sys.stdout.write('Testing %s ' % (pn + ' ').ljust(40, '.'))
+ sys.stdout.flush()
+ failed = False
+ reset = True
+ skipped = None
+
+ srctree = os.path.join(tmpdir, pn)
+ try:
+ bb.process.run('devtool modify -x %s %s' % (pn, srctree))
+ except bb.process.ExecutionError as exc:
+ if exc.exitcode == 4:
+ skipped = 'incompatible'
+ else:
+ with open('stress_%s_modify.log' % pn, 'w') as f:
+ f.write(str(exc))
+ failed = 'modify'
+ reset = False
+
+ if not skipped:
+ if not failed:
+ try:
+ bb.process.run('bitbake -c install %s' % pn)
+ except bb.process.CmdError as exc:
+ with open('stress_%s_install.log' % pn, 'w') as f:
+ f.write(str(exc))
+ failed = 'build'
+ if reset:
+ try:
+ bb.process.run('devtool reset %s' % pn)
+ except bb.process.CmdError as exc:
+ print('devtool reset failed: %s' % str(exc))
+ break
+
+ if os.path.exists(srctree):
+ shutil.rmtree(srctree)
+
+ if failed:
+ print('failed (%s)' % failed)
+ failures += 1
+ elif skipped:
+ print('skipped (%s)' % skipped)
+ else:
+ print('ok')
+ except KeyboardInterrupt:
+ # We want any child processes killed. This is crude, but effective.
+ os.killpg(0, signal.SIGTERM)
+
+ if failures:
+ return 1
+ else:
+ return 0
+
+
+def main():
+ parser = argparse_oe.ArgumentParser(description="devtool stress tester",
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-r', '--resume-from', help='Resume from specified recipe', metavar='PN')
+ parser.add_argument('-o', '--only', help='Only test specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST')
+ parser.add_argument('-s', '--skip', help='Skip specified recipes (comma-separated without spaces, wildcards allowed)', metavar='PNLIST', default='gcc-source-*,kernel-devsrc,package-index,perf,meta-world-pkgdata,glibc-locale,glibc-mtrace,glibc-scripts,os-release')
+ parser.add_argument('-c', '--skip-classes', help='Skip recipes inheriting specified classes (comma-separated) - default %(default)s', metavar='CLASSLIST', default='native,nativesdk,cross,cross-canadian,image,populate_sdk,meta,packagegroup')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
+
+ parser_modify = subparsers.add_parser('modify',
+ help='Run "devtool modify" followed by a build with bitbake on matching recipes',
+ description='Runs "devtool modify" followed by a build with bitbake on matching recipes')
+ parser_modify.set_defaults(func=stress_modify)
+
+ parser_extract = subparsers.add_parser('extract',
+ help='Run "devtool extract" on matching recipes',
+ description='Runs "devtool extract" on matching recipes')
+ parser_extract.set_defaults(func=stress_extract)
+
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+
+ import scriptpath
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ return 1
+ logger.debug('Found bitbake path: %s' % bitbakepath)
+
+ ret = args.func(args)
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/contrib/dialog-power-control b/poky/scripts/contrib/dialog-power-control
new file mode 100755
index 000000000..7550ea53b
--- /dev/null
+++ b/poky/scripts/contrib/dialog-power-control
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Simple script to show a manual power prompt for when you want to use
+# automated hardware testing with testimage.bbclass but you don't have a
+# web-enabled power strip or similar to do the power on/off/cycle.
+#
+# You can enable it by enabling testimage (see the Yocto Project
+# Development manual "Performing Automated Runtime Testing" section)
+# and setting the following in your local.conf:
+#
+# TEST_POWERCONTROL_CMD = "${COREBASE}/scripts/contrib/dialog-power-control"
+#
+
+PROMPT=""
+while true; do
+ case $1 in
+ on)
+ PROMPT="Please turn device power on";;
+ off)
+ PROMPT="Please turn device power off";;
+ cycle)
+ PROMPT="Please click Done, then turn the device power off then on";;
+ "")
+ break;;
+ esac
+ shift
+done
+
+if [ "$PROMPT" = "" ] ; then
+ echo "ERROR: no power action specified on command line"
+ exit 2
+fi
+
+if [ "`which kdialog 2>/dev/null`" != "" ] ; then
+ DIALOGUTIL="kdialog"
+elif [ "`which zenity 2>/dev/null`" != "" ] ; then
+ DIALOGUTIL="zenity"
+else
+ echo "ERROR: couldn't find program to display a message, install kdialog or zenity"
+ exit 3
+fi
+
+if [ "$DIALOGUTIL" = "kdialog" ] ; then
+ kdialog --yesno "$PROMPT" --title "TestImage Power Control" --yes-label "Done" --no-label "Cancel test"
+elif [ "$DIALOGUTIL" = "zenity" ] ; then
+ zenity --question --text="$PROMPT" --title="TestImage Power Control" --ok-label="Done" --cancel-label="Cancel test"
+fi
+
+if [ "$?" != "0" ] ; then
+ echo "User cancelled test at power prompt"
+ exit 1
+fi
+
diff --git a/poky/scripts/contrib/documentation-audit.sh b/poky/scripts/contrib/documentation-audit.sh
new file mode 100755
index 000000000..2144aac93
--- /dev/null
+++ b/poky/scripts/contrib/documentation-audit.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+# Perform an audit of which packages provide documentation and which
+# are missing -doc packages.
+#
+# Setup requirements: be sure to be building for MACHINE=qemux86. Run
+# this script after source'ing the build environment script, so you're
+# running it from build/ directory.
+#
+# Maintainer: Scott Garman <scott.a.garman@intel.com>
+
+REPORT_DOC_SIMPLE="documentation_exists.txt"
+REPORT_DOC_DETAIL="documentation_exists_detail.txt"
+REPORT_MISSING_SIMPLE="documentation_missing.txt"
+REPORT_MISSING_DETAIL="documentation_missing_detail.txt"
+REPORT_BUILD_ERRORS="build_errors.txt"
+
+rm -rf $REPORT_DOC_SIMPLE $REPORT_DOC_DETAIL $REPORT_MISSING_SIMPLE $REPORT_MISSING_DETAIL
+
+BITBAKE=`which bitbake`
+if [ -z "$BITBAKE" ]; then
+ echo "Error: bitbake command not found."
+ echo "Did you forget to source the build environment script?"
+ exit 1
+fi
+
+echo "REMINDER: you need to build for MACHINE=qemux86 or you won't get useful results"
+echo "REMINDER: you need to set LICENSE_FLAGS_WHITELIST appropriately in local.conf or "
+echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"Commercial\""
+
+for pkg in `bitbake -s | awk '{ print \$1 }'`; do
+ if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" ||
+ "$pkg" == "Recipe" ||
+ "$pkg" == "Parsing" || "$pkg" == "Package" ||
+ "$pkg" == "NOTE:" || "$pkg" == "WARNING:" ||
+ "$pkg" == "done." || "$pkg" == "===========" ]]
+ then
+ # Skip initial bitbake output
+ continue
+ fi
+ if [[ "$pkg" =~ -native$ || "$pkg" =~ -nativesdk$ ||
+ "$pkg" =~ -cross-canadian ]]; then
+ # Skip native/nativesdk/cross-canadian recipes
+ continue
+ fi
+ if [[ "$pkg" =~ ^meta- || "$pkg" =~ ^packagegroup- || "$pkg" =~ -image ]]; then
+ # Skip meta, task and image recipes
+ continue
+ fi
+ if [[ "$pkg" =~ ^glibc- || "$pkg" =~ ^libiconv$ ||
+ "$pkg" =~ -toolchain$ || "$pkg" =~ ^package-index$ ||
+ "$pkg" =~ ^linux- || "$pkg" =~ ^adt-installer$ ||
+ "$pkg" =~ ^eds-tools$ || "$pkg" =~ ^external-python-tarball$ ||
+ "$pkg" =~ ^qt4-embedded$ || "$pkg" =~ ^qt-mobility ]]; then
+ # Skip glibc, libiconv, -toolchain, and other recipes known
+ # to cause build conflicts or trigger false positives.
+ continue
+ fi
+
+ echo "Building package $pkg..."
+ bitbake $pkg > /dev/null
+ if [ $? -ne 0 ]; then
+ echo "There was an error building package $pkg" >> "$REPORT_MISSING_DETAIL"
+ echo "$pkg" >> $REPORT_BUILD_ERRORS
+
+ # Do not skip the remaining tests, as sometimes the
+ # exit status is 1 due to QA errors, and we can still
+ # perform the -doc checks.
+ fi
+
+ echo "$pkg built successfully, checking for a documentation package..."
+ WORKDIR=`bitbake -e $pkg | grep ^WORKDIR | awk -F '=' '{ print \$2 }' | awk -F '"' '{ print \$2 }'`
+ FIND_DOC_PKG=`find $WORKDIR/packages-split/*-doc -maxdepth 0 -type d`
+ if [ -z "$FIND_DOC_PKG" ]; then
+ # No -doc package was generated:
+ echo "No -doc package: $pkg" >> "$REPORT_MISSING_DETAIL"
+ echo "$pkg" >> $REPORT_MISSING_SIMPLE
+ continue
+ fi
+
+ FIND_DOC_FILES=`find $FIND_DOC_PKG -type f`
+ if [ -z "$FIND_DOC_FILES" ]; then
+ # No files shipped with the -doc package:
+ echo "No files shipped with the -doc package: $pkg" >> "$REPORT_MISSING_DETAIL"
+ echo "$pkg" >> $REPORT_MISSING_SIMPLE
+ continue
+ fi
+
+ echo "Documentation shipped with $pkg:" >> "$REPORT_DOC_DETAIL"
+ echo "$FIND_DOC_FILES" >> "$REPORT_DOC_DETAIL"
+ echo "" >> "$REPORT_DOC_DETAIL"
+
+ echo "$pkg" >> "$REPORT_DOC_SIMPLE"
+done
diff --git a/poky/scripts/contrib/graph-tool b/poky/scripts/contrib/graph-tool
new file mode 100755
index 000000000..1df5b8c34
--- /dev/null
+++ b/poky/scripts/contrib/graph-tool
@@ -0,0 +1,91 @@
+#!/usr/bin/env python3
+
+# Simple graph query utility
+# useful for getting answers from .dot files produced by bitbake -g
+#
+# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright 2013 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import sys
+
+def get_path_networkx(dotfile, fromnode, tonode):
+ try:
+ import networkx
+ except ImportError:
+ print('ERROR: Please install the networkx python module')
+ sys.exit(1)
+
+ graph = networkx.DiGraph(networkx.nx_pydot.read_dot(dotfile))
+ def node_missing(node):
+ import difflib
+ close_matches = difflib.get_close_matches(node, graph.nodes(), cutoff=0.7)
+ if close_matches:
+ print('ERROR: no node "%s" in graph. Close matches:\n %s' % (node, '\n '.join(close_matches)))
+ sys.exit(1)
+
+ if not fromnode in graph:
+ node_missing(fromnode)
+ if not tonode in graph:
+ node_missing(tonode)
+ return networkx.all_simple_paths(graph, source=fromnode, target=tonode)
+
+
+def find_paths(args, usage):
+ if len(args) < 3:
+ usage()
+ sys.exit(1)
+
+ fromnode = args[1]
+ tonode = args[2]
+
+ path = None
+ for path in get_path_networkx(args[0], fromnode, tonode):
+ print(" -> ".join(map(str, path)))
+ if not path:
+ print("ERROR: no path from %s to %s in graph" % (fromnode, tonode))
+ sys.exit(1)
+
+def main():
+ import optparse
+ parser = optparse.OptionParser(
+ usage = '''%prog [options] <command> <arguments>
+
+Available commands:
+ find-paths <dotfile> <from> <to>
+ Find all of the paths between two nodes in a dot graph''')
+
+ #parser.add_option("-d", "--debug",
+ # help = "Report all SRCREV values, not just ones where AUTOREV has been used",
+ # action="store_true", dest="debug", default=False)
+
+ options, args = parser.parse_args(sys.argv)
+ args = args[1:]
+
+ if len(args) < 1:
+ parser.print_help()
+ sys.exit(1)
+
+ if args[0] == "find-paths":
+ find_paths(args[1:], parser.print_help)
+ else:
+ parser.print_help()
+ sys.exit(1)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/contrib/list-packageconfig-flags.py b/poky/scripts/contrib/list-packageconfig-flags.py
new file mode 100755
index 000000000..7ce718624
--- /dev/null
+++ b/poky/scripts/contrib/list-packageconfig-flags.py
@@ -0,0 +1,178 @@
+#!/usr/bin/env python3
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation.
+#
+# Copyright (C) 2013 Wind River Systems, Inc.
+# Copyright (C) 2014 Intel Corporation
+#
+# - list available recipes which have PACKAGECONFIG flags
+# - list available PACKAGECONFIG flags and all affected recipes
+# - list all recipes and PACKAGECONFIG information
+
+import sys
+import optparse
+import os
+
+
+scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
+lib_path = os.path.abspath(scripts_path + '/../lib')
+sys.path = sys.path + [lib_path]
+
+import scriptpath
+
+# For importing the following modules
+bitbakepath = scriptpath.add_bitbake_lib_path()
+if not bitbakepath:
+ sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+ sys.exit(1)
+
+import bb.cooker
+import bb.providers
+import bb.tinfoil
+
+def get_fnlist(bbhandler, pkg_pn, preferred):
+ ''' Get all recipe file names '''
+ if preferred:
+ (latest_versions, preferred_versions) = bb.providers.findProviders(bbhandler.config_data, bbhandler.cooker.recipecaches[''], pkg_pn)
+
+ fn_list = []
+ for pn in sorted(pkg_pn):
+ if preferred:
+ fn_list.append(preferred_versions[pn][1])
+ else:
+ fn_list.extend(pkg_pn[pn])
+
+ return fn_list
+
+def get_recipesdata(bbhandler, preferred):
+ ''' Get data of all available recipes which have PACKAGECONFIG flags '''
+ pkg_pn = bbhandler.cooker.recipecaches[''].pkg_pn
+
+ data_dict = {}
+ for fn in get_fnlist(bbhandler, pkg_pn, preferred):
+ data = bbhandler.parse_recipe_file(fn)
+ flags = data.getVarFlags("PACKAGECONFIG")
+ flags.pop('doc', None)
+ if flags:
+ data_dict[fn] = data
+
+ return data_dict
+
+def collect_pkgs(data_dict):
+ ''' Collect available pkgs in which have PACKAGECONFIG flags '''
+ # pkg_dict = {'pkg1': ['flag1', 'flag2',...]}
+ pkg_dict = {}
+ for fn in data_dict:
+ pkgconfigflags = data_dict[fn].getVarFlags("PACKAGECONFIG")
+ pkgconfigflags.pop('doc', None)
+ pkgname = data_dict[fn].getVar("P")
+ pkg_dict[pkgname] = sorted(pkgconfigflags.keys())
+
+ return pkg_dict
+
+def collect_flags(pkg_dict):
+ ''' Collect available PACKAGECONFIG flags and all affected pkgs '''
+ # flag_dict = {'flag': ['pkg1', 'pkg2',...]}
+ flag_dict = {}
+ for pkgname, flaglist in pkg_dict.items():
+ for flag in flaglist:
+ if flag in flag_dict:
+ flag_dict[flag].append(pkgname)
+ else:
+ flag_dict[flag] = [pkgname]
+
+ return flag_dict
+
+def display_pkgs(pkg_dict):
+ ''' Display available pkgs which have PACKAGECONFIG flags '''
+ pkgname_len = len("RECIPE NAME") + 1
+ for pkgname in pkg_dict:
+ if pkgname_len < len(pkgname):
+ pkgname_len = len(pkgname)
+ pkgname_len += 1
+
+ header = '%-*s%s' % (pkgname_len, str("RECIPE NAME"), str("PACKAGECONFIG FLAGS"))
+ print(header)
+ print(str("").ljust(len(header), '='))
+ for pkgname in sorted(pkg_dict):
+ print('%-*s%s' % (pkgname_len, pkgname, ' '.join(pkg_dict[pkgname])))
+
+
+def display_flags(flag_dict):
+ ''' Display available PACKAGECONFIG flags and all affected pkgs '''
+ flag_len = len("PACKAGECONFIG FLAG") + 5
+
+ header = '%-*s%s' % (flag_len, str("PACKAGECONFIG FLAG"), str("RECIPE NAMES"))
+ print(header)
+ print(str("").ljust(len(header), '='))
+
+ for flag in sorted(flag_dict):
+ print('%-*s%s' % (flag_len, flag, ' '.join(sorted(flag_dict[flag]))))
+
+def display_all(data_dict):
+ ''' Display all pkgs and PACKAGECONFIG information '''
+ print(str("").ljust(50, '='))
+ for fn in data_dict:
+ print('%s' % data_dict[fn].getVar("P"))
+ print(fn)
+ packageconfig = data_dict[fn].getVar("PACKAGECONFIG") or ''
+ if packageconfig.strip() == '':
+ packageconfig = 'None'
+ print('PACKAGECONFIG %s' % packageconfig)
+
+ for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").items():
+ if flag == "doc":
+ continue
+ print('PACKAGECONFIG[%s] %s' % (flag, flag_val))
+ print('')
+
+def main():
+ pkg_dict = {}
+ flag_dict = {}
+
+ # Collect and validate input
+ parser = optparse.OptionParser(
+ description = "Lists recipes and PACKAGECONFIG flags. Without -a or -f, recipes and their available PACKAGECONFIG flags are listed.",
+ usage = """
+ %prog [options]""")
+
+ parser.add_option("-f", "--flags",
+ help = "list available PACKAGECONFIG flags and affected recipes",
+ action="store_const", dest="listtype", const="flags", default="recipes")
+ parser.add_option("-a", "--all",
+ help = "list all recipes and PACKAGECONFIG information",
+ action="store_const", dest="listtype", const="all")
+ parser.add_option("-p", "--preferred-only",
+ help = "where multiple recipe versions are available, list only the preferred version",
+ action="store_true", dest="preferred", default=False)
+
+ options, args = parser.parse_args(sys.argv)
+
+ with bb.tinfoil.Tinfoil() as bbhandler:
+ bbhandler.prepare()
+ print("Gathering recipe data...")
+ data_dict = get_recipesdata(bbhandler, options.preferred)
+
+ if options.listtype == 'flags':
+ pkg_dict = collect_pkgs(data_dict)
+ flag_dict = collect_flags(pkg_dict)
+ display_flags(flag_dict)
+ elif options.listtype == 'recipes':
+ pkg_dict = collect_pkgs(data_dict)
+ display_pkgs(pkg_dict)
+ elif options.listtype == 'all':
+ display_all(data_dict)
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/contrib/mkefidisk.sh b/poky/scripts/contrib/mkefidisk.sh
new file mode 100755
index 000000000..ac4ec9c7f
--- /dev/null
+++ b/poky/scripts/contrib/mkefidisk.sh
@@ -0,0 +1,464 @@
+#!/bin/sh
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+LANG=C
+
+echo
+echo "WARNING: This script is deprecated and will be removed soon."
+echo "Please consider using wic EFI images instead."
+echo
+
+# Set to 1 to enable additional output
+DEBUG=0
+OUT="/dev/null"
+
+#
+# Defaults
+#
+# 20 Mb for the boot partition
+BOOT_SIZE=20
+# 5% for swap
+SWAP_RATIO=5
+
+# Cleanup after die()
+cleanup() {
+ debug "Syncing and unmounting devices"
+ # Unmount anything we mounted
+ unmount $ROOTFS_MNT || error "Failed to unmount $ROOTFS_MNT"
+ unmount $BOOTFS_MNT || error "Failed to unmount $BOOTFS_MNT"
+ unmount $HDDIMG_ROOTFS_MNT || error "Failed to unmount $HDDIMG_ROOTFS_MNT"
+ unmount $HDDIMG_MNT || error "Failed to unmount $HDDIMG_MNT"
+
+ # Remove the TMPDIR
+ debug "Removing temporary files"
+ if [ -d "$TMPDIR" ]; then
+ rm -rf $TMPDIR || error "Failed to remove $TMPDIR"
+ fi
+}
+
+trap 'die "Signal Received, Aborting..."' HUP INT TERM
+
+# Logging routines
+WARNINGS=0
+ERRORS=0
+CLEAR="$(tput sgr0)"
+INFO="$(tput bold)"
+RED="$(tput setaf 1)$(tput bold)"
+GREEN="$(tput setaf 2)$(tput bold)"
+YELLOW="$(tput setaf 3)$(tput bold)"
+info() {
+ echo "${INFO}$1${CLEAR}"
+}
+error() {
+ ERRORS=$((ERRORS+1))
+ echo "${RED}$1${CLEAR}"
+}
+warn() {
+ WARNINGS=$((WARNINGS+1))
+ echo "${YELLOW}$1${CLEAR}"
+}
+success() {
+ echo "${GREEN}$1${CLEAR}"
+}
+die() {
+ error "$1"
+ cleanup
+ exit 1
+}
+debug() {
+ if [ $DEBUG -eq 1 ]; then
+ echo "$1"
+ fi
+}
+
+usage() {
+ echo "Usage: $(basename $0) [-v] DEVICE HDDIMG TARGET_DEVICE"
+ echo " -v: Verbose debug"
+ echo " DEVICE: The device to write the image to, e.g. /dev/sdh"
+ echo " HDDIMG: The hddimg file to generate the efi disk from"
+ echo " TARGET_DEVICE: The device the target will boot from, e.g. /dev/mmcblk0"
+}
+
+image_details() {
+ IMG=$1
+ info "Image details"
+ echo " image: $(stat --printf '%N\n' $IMG)"
+ echo " size: $(stat -L --printf '%s bytes\n' $IMG)"
+ echo " modified: $(stat -L --printf '%y\n' $IMG)"
+ echo " type: $(file -L -b $IMG)"
+ echo ""
+}
+
+device_details() {
+ DEV=$1
+ BLOCK_SIZE=512
+
+ info "Device details"
+ echo " device: $DEVICE"
+ if [ -f "/sys/class/block/$DEV/device/vendor" ]; then
+ echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)"
+ else
+ echo " vendor: UNKOWN"
+ fi
+ if [ -f "/sys/class/block/$DEV/device/model" ]; then
+ echo " model: $(cat /sys/class/block/$DEV/device/model)"
+ else
+ echo " model: UNKNOWN"
+ fi
+ if [ -f "/sys/class/block/$DEV/size" ]; then
+ echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes"
+ else
+ echo " size: UNKNOWN"
+ fi
+ echo ""
+}
+
+unmount_device() {
+ grep -q $DEVICE /proc/mounts
+ if [ $? -eq 0 ]; then
+ warn "$DEVICE listed in /proc/mounts, attempting to unmount"
+ umount $DEVICE* 2>/dev/null
+ return $?
+ fi
+ return 0
+}
+
+unmount() {
+ if [ "$1" = "" ] ; then
+ return 0
+ fi
+ grep -q $1 /proc/mounts
+ if [ $? -eq 0 ]; then
+ debug "Unmounting $1"
+ umount $1
+ return $?
+ fi
+ return 0
+}
+
+#
+# Parse and validate arguments
+#
+if [ $# -lt 3 ] || [ $# -gt 4 ]; then
+ if [ $# -eq 1 ]; then
+ AVAILABLE_DISK=`lsblk | grep "disk" | cut -f 1 -d " "`
+ X=0
+ for disk in `echo $AVAILABLE_DISK`; do
+ mounted=`lsblk /dev/$disk | awk {'print $7'} | sed "s/MOUNTPOINT//"`
+ if [ -z "$mounted" ]; then
+ UNMOUNTED_AVAILABLES="$UNMOUNTED_AVAILABLES /dev/$disk"
+ info "$X - /dev/$disk"
+ X=`expr $X + 1`
+ fi
+ done
+ if [ $X -eq 0 ]; then
+ die "No unmounted device found."
+ fi
+ read -p "Choose unmounted device number: " DISK_NUMBER
+ X=0
+ for line in `echo $UNMOUNTED_AVAILABLES`; do
+ if [ $DISK_NUMBER -eq $X ]; then
+ DISK_TO_BE_FLASHED=$line
+ break
+ else
+ X=`expr $X + 1`
+ fi
+ done
+ if [ -z "$DISK_TO_BE_FLASHED" ]; then
+ die "Option \"$DISK_NUMBER\" is invalid. Choose a valid option"
+ else
+ if [ -z `echo $DISK_TO_BE_FLASHED | grep "mmc"` ]; then
+ TARGET_TO_BE_BOOT="/dev/sda"
+ else
+ TARGET_TO_BE_BOOT="/dev/mmcblk0"
+ fi
+ fi
+ echo ""
+ echo "Choose a name of the device that will be boot from"
+ echo -n "Recommended name is: "
+ info "$TARGET_TO_BE_BOOT"
+ read -p "Is target device okay? [y/N]: " RESPONSE
+ if [ "$RESPONSE" != "y" ]; then
+ read -p "Choose target device name: " TARGET_TO_BE_BOOT
+ fi
+ echo ""
+ if [ -z "$TARGET_TO_BE_BOOT" ]; then
+ die "Error: choose a valid target name"
+ fi
+ else
+ usage
+ exit 1
+ fi
+fi
+
+if [ "$1" = "-v" ]; then
+ DEBUG=1
+ OUT="1"
+ shift
+fi
+
+if [ -z "$AVAILABLE_DISK" ]; then
+ DEVICE=$1
+ HDDIMG=$2
+ TARGET_DEVICE=$3
+else
+ DEVICE=$DISK_TO_BE_FLASHED
+ HDDIMG=$1
+ TARGET_DEVICE=$TARGET_TO_BE_BOOT
+fi
+
+LINK=$(readlink $DEVICE)
+if [ $? -eq 0 ]; then
+ DEVICE="$LINK"
+fi
+
+if [ ! -w "$DEVICE" ]; then
+ usage
+ if [ ! -e "${DEVICE}" ] ; then
+ die "Device $DEVICE cannot be found"
+ else
+ die "Device $DEVICE is not writable (need to run under sudo?)"
+ fi
+fi
+
+if [ ! -e "$HDDIMG" ]; then
+ usage
+ die "HDDIMG $HDDIMG does not exist"
+fi
+
+#
+# Ensure the hddimg is not mounted
+#
+unmount "$HDDIMG" || die "Failed to unmount $HDDIMG"
+
+#
+# Check if any $DEVICE partitions are mounted
+#
+unmount_device || die "Failed to unmount $DEVICE"
+
+#
+# Confirm device with user
+#
+image_details $HDDIMG
+device_details $(basename $DEVICE)
+echo -n "${INFO}Prepare EFI image on $DEVICE [y/N]?${CLEAR} "
+read RESPONSE
+if [ "$RESPONSE" != "y" ]; then
+ echo "Image creation aborted"
+ exit 0
+fi
+
+
+#
+# Prepare the temporary working space
+#
+TMPDIR=$(mktemp -d mkefidisk-XXX) || die "Failed to create temporary mounting directory."
+HDDIMG_MNT=$TMPDIR/hddimg
+HDDIMG_ROOTFS_MNT=$TMPDIR/hddimg_rootfs
+ROOTFS_MNT=$TMPDIR/rootfs
+BOOTFS_MNT=$TMPDIR/bootfs
+mkdir $HDDIMG_MNT || die "Failed to create $HDDIMG_MNT"
+mkdir $HDDIMG_ROOTFS_MNT || die "Failed to create $HDDIMG_ROOTFS_MNT"
+mkdir $ROOTFS_MNT || die "Failed to create $ROOTFS_MNT"
+mkdir $BOOTFS_MNT || die "Failed to create $BOOTFS_MNT"
+
+
+#
+# Partition $DEVICE
+#
+DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//")
+# If the device size is not reported there may not be a valid label
+if [ "$DEVICE_SIZE" = "" ] ; then
+ parted -s $DEVICE mklabel msdos || die "Failed to create MSDOS partition table"
+ DEVICE_SIZE=$(parted -s $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//")
+fi
+SWAP_SIZE=$((DEVICE_SIZE*SWAP_RATIO/100))
+ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE-SWAP_SIZE))
+ROOTFS_START=$((BOOT_SIZE))
+ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE))
+SWAP_START=$((ROOTFS_END))
+
+# MMC devices use a partition prefix character 'p'
+PART_PREFIX=""
+if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then
+ PART_PREFIX="p"
+fi
+BOOTFS=$DEVICE${PART_PREFIX}1
+ROOTFS=$DEVICE${PART_PREFIX}2
+SWAP=$DEVICE${PART_PREFIX}3
+
+TARGET_PART_PREFIX=""
+if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then
+ TARGET_PART_PREFIX="p"
+fi
+TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2
+TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3
+
+echo ""
+info "Boot partition size: $BOOT_SIZE MB ($BOOTFS)"
+info "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)"
+info "Swap partition size: $SWAP_SIZE MB ($SWAP)"
+echo ""
+
+# Use MSDOS by default as GPT cannot be reliably distributed in disk image form
+# as it requires the backup table to be on the last block of the device, which
+# of course varies from device to device.
+
+info "Partitioning installation media ($DEVICE)"
+
+debug "Deleting partition table on $DEVICE"
+dd if=/dev/zero of=$DEVICE bs=512 count=2 >$OUT 2>&1 || die "Failed to zero beginning of $DEVICE"
+
+debug "Creating new partition table (MSDOS) on $DEVICE"
+parted -s $DEVICE mklabel msdos >$OUT 2>&1 || die "Failed to create MSDOS partition table"
+
+debug "Creating boot partition on $BOOTFS"
+parted -s $DEVICE mkpart primary 0% $BOOT_SIZE >$OUT 2>&1 || die "Failed to create BOOT partition"
+
+debug "Enabling boot flag on $BOOTFS"
+parted -s $DEVICE set 1 boot on >$OUT 2>&1 || die "Failed to enable boot flag"
+
+debug "Creating ROOTFS partition on $ROOTFS"
+parted -s $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END >$OUT 2>&1 || die "Failed to create ROOTFS partition"
+
+debug "Creating swap partition on $SWAP"
+parted -s $DEVICE mkpart primary $SWAP_START 100% >$OUT 2>&1 || die "Failed to create SWAP partition"
+
+if [ $DEBUG -eq 1 ]; then
+ parted -s $DEVICE print
+fi
+
+
+#
+# Check if any $DEVICE partitions are mounted after partitioning
+#
+unmount_device || die "Failed to unmount $DEVICE partitions"
+
+
+#
+# Format $DEVICE partitions
+#
+info "Formatting partitions"
+debug "Formatting $BOOTFS as vfat"
+if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then
+ mkfs.vfat -I $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS"
+else
+ mkfs.vfat $BOOTFS -n "EFI" >$OUT 2>&1 || die "Failed to format $BOOTFS"
+fi
+
+debug "Formatting $ROOTFS as ext3"
+mkfs.ext3 -F $ROOTFS -L "ROOT" >$OUT 2>&1 || die "Failed to format $ROOTFS"
+
+debug "Formatting swap partition ($SWAP)"
+mkswap $SWAP >$OUT 2>&1 || die "Failed to prepare swap"
+
+
+#
+# Installing to $DEVICE
+#
+debug "Mounting images and device in preparation for installation"
+mount -o ro,loop $HDDIMG $HDDIMG_MNT >$OUT 2>&1 || error "Failed to mount $HDDIMG"
+mount -o ro,loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT >$OUT 2>&1 || error "Failed to mount rootfs.img"
+mount $ROOTFS $ROOTFS_MNT >$OUT 2>&1 || error "Failed to mount $ROOTFS on $ROOTFS_MNT"
+mount $BOOTFS $BOOTFS_MNT >$OUT 2>&1 || error "Failed to mount $BOOTFS on $BOOTFS_MNT"
+
+info "Preparing boot partition"
+EFIDIR="$BOOTFS_MNT/EFI/BOOT"
+cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz"
+# Copy the efi loader and configs (booti*.efi and grub.cfg if it exists)
+cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir"
+# Silently ignore a missing systemd-boot loader dir (we might just be a GRUB image)
+cp -r $HDDIMG_MNT/loader $BOOTFS_MNT >$OUT 2>&1
+
+# Update the boot loaders configurations for an installed image
+# Remove any existing root= kernel parameters and:
+# o Add a root= parameter with the target rootfs
+# o Specify ro so fsck can be run during boot
+# o Specify rootwait in case the target media is an asyncronous block device
+# such as MMC or USB disks
+# o Specify "quiet" to minimize boot time when using slow serial consoles
+
+# Look for a GRUB installation
+GRUB_CFG="$EFIDIR/grub.cfg"
+if [ -e "$GRUB_CFG" ]; then
+ info "Configuring GRUB"
+ # Delete the install entry
+ sed -i "/menuentry 'install'/,/^}/d" $GRUB_CFG
+ # Delete the initrd lines
+ sed -i "/initrd /d" $GRUB_CFG
+ # Delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUB_CFG
+
+ sed -i "s@ root=[^ ]*@ @" $GRUB_CFG
+ sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG
+fi
+
+# Look for a systemd-boot installation
+SYSTEMD_BOOT_ENTRIES="$BOOTFS_MNT/loader/entries"
+SYSTEMD_BOOT_CFG="$SYSTEMD_BOOT_ENTRIES/boot.conf"
+if [ -d "$SYSTEMD_BOOT_ENTRIES" ]; then
+ info "Configuring SystemD-boot"
+ # remove the install target if it exists
+ rm $SYSTEMD_BOOT_ENTRIES/install.conf >$OUT 2>&1
+
+ if [ ! -e "$SYSTEMD_BOOT_CFG" ]; then
+ echo "ERROR: $SYSTEMD_BOOT_CFG not found"
+ fi
+
+ sed -i "/initrd /d" $SYSTEMD_BOOT_CFG
+ sed -i "s@ root=[^ ]*@ @" $SYSTEMD_BOOT_CFG
+ sed -i "s@options *LABEL=boot @options LABEL=Boot root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $SYSTEMD_BOOT_CFG
+fi
+
+# Ensure we have at least one EFI bootloader configured
+if [ ! -e $GRUB_CFG ] && [ ! -e $SYSTEMD_BOOT_CFG ]; then
+ die "No EFI bootloader configuration found"
+fi
+
+
+info "Copying ROOTFS files (this may take a while)"
+cp -a $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT >$OUT 2>&1 || die "Root FS copy failed"
+
+echo "$TARGET_SWAP swap swap defaults 0 0" >> $ROOTFS_MNT/etc/fstab
+
+# We dont want udev to mount our root device while we're booting...
+if [ -d $ROOTFS_MNT/etc/udev/ ] ; then
+ echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist
+fi
+
+# Add startup.nsh script for automated boot
+printf "fs0:\%s\BOOT\%s\n" "EFI" "bootx64.efi" > $BOOTFS_MNT/startup.nsh
+
+
+# Call cleanup to unmount devices and images and remove the TMPDIR
+cleanup
+
+echo ""
+if [ $WARNINGS -ne 0 ] && [ $ERRORS -eq 0 ]; then
+ echo "${YELLOW}Installation completed with warnings${CLEAR}"
+ echo "${YELLOW}Warnings: $WARNINGS${CLEAR}"
+elif [ $ERRORS -ne 0 ]; then
+ echo "${RED}Installation encountered errors${CLEAR}"
+ echo "${RED}Errors: $ERRORS${CLEAR}"
+ echo "${YELLOW}Warnings: $WARNINGS${CLEAR}"
+else
+ success "Installation completed successfully"
+fi
+echo ""
diff --git a/poky/scripts/contrib/oe-build-perf-report-email.py b/poky/scripts/contrib/oe-build-perf-report-email.py
new file mode 100755
index 000000000..913847bbe
--- /dev/null
+++ b/poky/scripts/contrib/oe-build-perf-report-email.py
@@ -0,0 +1,282 @@
+#!/usr/bin/python3
+#
+# Send build performance test report emails
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+import argparse
+import base64
+import logging
+import os
+import pwd
+import re
+import shutil
+import smtplib
+import socket
+import subprocess
+import sys
+import tempfile
+from email.mime.image import MIMEImage
+from email.mime.multipart import MIMEMultipart
+from email.mime.text import MIMEText
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger('oe-build-perf-report')
+
+
+# Find js scaper script
+SCRAPE_JS = os.path.join(os.path.dirname(__file__), '..', 'lib', 'build_perf',
+ 'scrape-html-report.js')
+if not os.path.isfile(SCRAPE_JS):
+ log.error("Unableto find oe-build-perf-report-scrape.js")
+ sys.exit(1)
+
+
+class ReportError(Exception):
+ """Local errors"""
+ pass
+
+
+def check_utils():
+ """Check that all needed utils are installed in the system"""
+ missing = []
+ for cmd in ('phantomjs', 'optipng'):
+ if not shutil.which(cmd):
+ missing.append(cmd)
+ if missing:
+ log.error("The following tools are missing: %s", ' '.join(missing))
+ sys.exit(1)
+
+
+def parse_args(argv):
+ """Parse command line arguments"""
+ description = """Email build perf test report"""
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=description)
+
+ parser.add_argument('--debug', '-d', action='store_true',
+ help="Verbose logging")
+ parser.add_argument('--quiet', '-q', action='store_true',
+ help="Only print errors")
+ parser.add_argument('--to', action='append',
+ help="Recipients of the email")
+ parser.add_argument('--cc', action='append',
+ help="Carbon copy recipients of the email")
+ parser.add_argument('--bcc', action='append',
+ help="Blind carbon copy recipients of the email")
+ parser.add_argument('--subject', default="Yocto build perf test report",
+ help="Email subject")
+ parser.add_argument('--outdir', '-o',
+ help="Store files in OUTDIR. Can be used to preserve "
+ "the email parts")
+ parser.add_argument('--text',
+ help="Plain text message")
+ parser.add_argument('--html',
+ help="HTML peport generated by oe-build-perf-report")
+ parser.add_argument('--phantomjs-args', action='append',
+ help="Extra command line arguments passed to PhantomJS")
+
+ args = parser.parse_args(argv)
+
+ if not args.html and not args.text:
+ parser.error("Please specify --html and/or --text")
+
+ return args
+
+
+def decode_png(infile, outfile):
+ """Parse/decode/optimize png data from a html element"""
+ with open(infile) as f:
+ raw_data = f.read()
+
+ # Grab raw base64 data
+ b64_data = re.sub('^.*href="data:image/png;base64,', '', raw_data, 1)
+ b64_data = re.sub('">.+$', '', b64_data, 1)
+
+ # Replace file with proper decoded png
+ with open(outfile, 'wb') as f:
+ f.write(base64.b64decode(b64_data))
+
+ subprocess.check_output(['optipng', outfile], stderr=subprocess.STDOUT)
+
+
+def mangle_html_report(infile, outfile, pngs):
+ """Mangle html file into a email compatible format"""
+ paste = True
+ png_dir = os.path.dirname(outfile)
+ with open(infile) as f_in:
+ with open(outfile, 'w') as f_out:
+ for line in f_in.readlines():
+ stripped = line.strip()
+ # Strip out scripts
+ if stripped == '<!--START-OF-SCRIPTS-->':
+ paste = False
+ elif stripped == '<!--END-OF-SCRIPTS-->':
+ paste = True
+ elif paste:
+ if re.match('^.+href="data:image/png;base64', stripped):
+ # Strip out encoded pngs (as they're huge in size)
+ continue
+ elif 'www.gstatic.com' in stripped:
+ # HACK: drop references to external static pages
+ continue
+
+ # Replace charts with <img> elements
+ match = re.match('<div id="(?P<id>\w+)"', stripped)
+ if match and match.group('id') in pngs:
+ f_out.write('<img src="cid:{}"\n'.format(match.group('id')))
+ else:
+ f_out.write(line)
+
+
+def scrape_html_report(report, outdir, phantomjs_extra_args=None):
+ """Scrape html report into a format sendable by email"""
+ tmpdir = tempfile.mkdtemp(dir='.')
+ log.debug("Using tmpdir %s for phantomjs output", tmpdir)
+
+ if not os.path.isdir(outdir):
+ os.mkdir(outdir)
+ if os.path.splitext(report)[1] not in ('.html', '.htm'):
+ raise ReportError("Invalid file extension for report, needs to be "
+ "'.html' or '.htm'")
+
+ try:
+ log.info("Scraping HTML report with PhangomJS")
+ extra_args = phantomjs_extra_args if phantomjs_extra_args else []
+ subprocess.check_output(['phantomjs', '--debug=true'] + extra_args +
+ [SCRAPE_JS, report, tmpdir],
+ stderr=subprocess.STDOUT)
+
+ pngs = []
+ images = []
+ for fname in os.listdir(tmpdir):
+ base, ext = os.path.splitext(fname)
+ if ext == '.png':
+ log.debug("Decoding %s", fname)
+ decode_png(os.path.join(tmpdir, fname),
+ os.path.join(outdir, fname))
+ pngs.append(base)
+ images.append(fname)
+ elif ext in ('.html', '.htm'):
+ report_file = fname
+ else:
+ log.warning("Unknown file extension: '%s'", ext)
+ #shutil.move(os.path.join(tmpdir, fname), outdir)
+
+ log.debug("Mangling html report file %s", report_file)
+ mangle_html_report(os.path.join(tmpdir, report_file),
+ os.path.join(outdir, report_file), pngs)
+ return (os.path.join(outdir, report_file),
+ [os.path.join(outdir, i) for i in images])
+ finally:
+ shutil.rmtree(tmpdir)
+
+def send_email(text_fn, html_fn, image_fns, subject, recipients, copy=[],
+ blind_copy=[]):
+ """Send email"""
+ # Generate email message
+ text_msg = html_msg = None
+ if text_fn:
+ with open(text_fn) as f:
+ text_msg = MIMEText("Yocto build performance test report.\n" +
+ f.read(), 'plain')
+ if html_fn:
+ html_msg = msg = MIMEMultipart('related')
+ with open(html_fn) as f:
+ html_msg.attach(MIMEText(f.read(), 'html'))
+ for img_fn in image_fns:
+ # Expect that content id is same as the filename
+ cid = os.path.splitext(os.path.basename(img_fn))[0]
+ with open(img_fn, 'rb') as f:
+ image_msg = MIMEImage(f.read())
+ image_msg['Content-ID'] = '<{}>'.format(cid)
+ html_msg.attach(image_msg)
+
+ if text_msg and html_msg:
+ msg = MIMEMultipart('alternative')
+ msg.attach(text_msg)
+ msg.attach(html_msg)
+ elif text_msg:
+ msg = text_msg
+ elif html_msg:
+ msg = html_msg
+ else:
+ raise ReportError("Neither plain text nor html body specified")
+
+ pw_data = pwd.getpwuid(os.getuid())
+ full_name = pw_data.pw_gecos.split(',')[0]
+ email = os.environ.get('EMAIL',
+ '{}@{}'.format(pw_data.pw_name, socket.getfqdn()))
+ msg['From'] = "{} <{}>".format(full_name, email)
+ msg['To'] = ', '.join(recipients)
+ if copy:
+ msg['Cc'] = ', '.join(copy)
+ if blind_copy:
+ msg['Bcc'] = ', '.join(blind_copy)
+ msg['Subject'] = subject
+
+ # Send email
+ with smtplib.SMTP('localhost') as smtp:
+ smtp.send_message(msg)
+
+
+def main(argv=None):
+ """Script entry point"""
+ args = parse_args(argv)
+ if args.quiet:
+ log.setLevel(logging.ERROR)
+ if args.debug:
+ log.setLevel(logging.DEBUG)
+
+ check_utils()
+
+ if args.outdir:
+ outdir = args.outdir
+ if not os.path.exists(outdir):
+ os.mkdir(outdir)
+ else:
+ outdir = tempfile.mkdtemp(dir='.')
+
+ try:
+ log.debug("Storing email parts in %s", outdir)
+ html_report = images = None
+ if args.html:
+ html_report, images = scrape_html_report(args.html, outdir,
+ args.phantomjs_args)
+
+ if args.to:
+ log.info("Sending email to %s", ', '.join(args.to))
+ if args.cc:
+ log.info("Copying to %s", ', '.join(args.cc))
+ if args.bcc:
+ log.info("Blind copying to %s", ', '.join(args.bcc))
+ send_email(args.text, html_report, images, args.subject,
+ args.to, args.cc, args.bcc)
+ except subprocess.CalledProcessError as err:
+ log.error("%s, with output:\n%s", str(err), err.output.decode())
+ return 1
+ except ReportError as err:
+ log.error(err)
+ return 1
+ finally:
+ if not args.outdir:
+ log.debug("Wiping %s", outdir)
+ shutil.rmtree(outdir)
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/contrib/patchreview.py b/poky/scripts/contrib/patchreview.py
new file mode 100755
index 000000000..4e3e73c7a
--- /dev/null
+++ b/poky/scripts/contrib/patchreview.py
@@ -0,0 +1,211 @@
+#! /usr/bin/env python3
+
+# TODO
+# - option to just list all broken files
+# - test suite
+# - validate signed-off-by
+
+
+class Result:
+ # Whether the patch has an Upstream-Status or not
+ missing_upstream_status = False
+ # If the Upstream-Status tag is malformed in some way (string for bad bit)
+ malformed_upstream_status = None
+ # If the Upstream-Status value is unknown (boolean)
+ unknown_upstream_status = False
+ # The upstream status value (Pending, etc)
+ upstream_status = None
+ # Whether the patch has a Signed-off-by or not
+ missing_sob = False
+ # Whether the Signed-off-by tag is malformed in some way
+ malformed_sob = False
+ # The Signed-off-by tag value
+ sob = None
+ # Whether a patch looks like a CVE but doesn't have a CVE tag
+ missing_cve = False
+
+def blame_patch(patch):
+ """
+ From a patch filename, return a list of "commit summary (author name <author
+ email>)" strings representing the history.
+ """
+ import subprocess
+ return subprocess.check_output(("git", "log",
+ "--follow", "--find-renames", "--diff-filter=A",
+ "--format=%s (%aN <%aE>)",
+ "--", patch)).decode("utf-8").splitlines()
+
+def patchreview(patches):
+ import re
+
+ # General pattern: start of line, optional whitespace, tag with optional
+ # hyphen or spaces, maybe a colon, some whitespace, then the value, all case
+ # insensitive.
+ sob_re = re.compile(r"^[\t ]*(Signed[-_ ]off[-_ ]by:?)[\t ]*(.+)", re.IGNORECASE | re.MULTILINE)
+ status_re = re.compile(r"^[\t ]*(Upstream[-_ ]Status:?)[\t ]*(\w*)", re.IGNORECASE | re.MULTILINE)
+ status_values = ("accepted", "pending", "inappropriate", "backport", "submitted", "denied")
+ cve_tag_re = re.compile(r"^[\t ]*(CVE:)[\t ]*(.*)", re.IGNORECASE | re.MULTILINE)
+ cve_re = re.compile(r"cve-[0-9]{4}-[0-9]{4,6}", re.IGNORECASE)
+
+ results = {}
+
+ for patch in patches:
+ result = Result()
+ results[patch] = result
+
+ content = open(patch, encoding='ascii', errors='ignore').read()
+
+ # Find the Signed-off-by tag
+ match = sob_re.search(content)
+ if match:
+ value = match.group(1)
+ if value != "Signed-off-by:":
+ result.malformed_sob = value
+ result.sob = match.group(2)
+ else:
+ result.missing_sob = True
+
+
+ # Find the Upstream-Status tag
+ match = status_re.search(content)
+ if match:
+ value = match.group(1)
+ if value != "Upstream-Status:":
+ result.malformed_upstream_status = value
+
+ value = match.group(2).lower()
+ # TODO: check case
+ if value not in status_values:
+ result.unknown_upstream_status = True
+ result.upstream_status = value
+ else:
+ result.missing_upstream_status = True
+
+ # Check that patches which looks like CVEs have CVE tags
+ if cve_re.search(patch) or cve_re.search(content):
+ if not cve_tag_re.search(content):
+ result.missing_cve = True
+ # TODO: extract CVE list
+
+ return results
+
+
+def analyse(results, want_blame=False, verbose=True):
+ """
+ want_blame: display blame data for each malformed patch
+ verbose: display per-file results instead of just summary
+ """
+
+ # want_blame requires verbose, so disable blame if we're not verbose
+ if want_blame and not verbose:
+ want_blame = False
+
+ total_patches = 0
+ missing_sob = 0
+ malformed_sob = 0
+ missing_status = 0
+ malformed_status = 0
+ missing_cve = 0
+ pending_patches = 0
+
+ for patch in sorted(results):
+ r = results[patch]
+ total_patches += 1
+ need_blame = False
+
+ # Build statistics
+ if r.missing_sob:
+ missing_sob += 1
+ if r.malformed_sob:
+ malformed_sob += 1
+ if r.missing_upstream_status:
+ missing_status += 1
+ if r.malformed_upstream_status or r.unknown_upstream_status:
+ malformed_status += 1
+ if r.missing_cve:
+ missing_cve += 1
+ if r.upstream_status == "pending":
+ pending_patches += 1
+
+ # Output warnings
+ if r.missing_sob:
+ need_blame = True
+ if verbose:
+ print("Missing Signed-off-by tag (%s)" % patch)
+ # TODO: disable this for now as too much fails
+ if False and r.malformed_sob:
+ need_blame = True
+ if verbose:
+ print("Malformed Signed-off-by '%s' (%s)" % (r.malformed_sob, patch))
+ if r.missing_cve:
+ need_blame = True
+ if verbose:
+ print("Missing CVE tag (%s)" % patch)
+ if r.missing_upstream_status:
+ need_blame = True
+ if verbose:
+ print("Missing Upstream-Status tag (%s)" % patch)
+ if r.malformed_upstream_status:
+ need_blame = True
+ if verbose:
+ print("Malformed Upstream-Status '%s' (%s)" % (r.malformed_upstream_status, patch))
+ if r.unknown_upstream_status:
+ need_blame = True
+ if verbose:
+ print("Unknown Upstream-Status value '%s' (%s)" % (r.upstream_status, patch))
+
+ if want_blame and need_blame:
+ print("\n".join(blame_patch(patch)) + "\n")
+
+ def percent(num):
+ try:
+ return "%d (%d%%)" % (num, round(num * 100.0 / total_patches))
+ except ZeroDivisionError:
+ return "N/A"
+
+ if verbose:
+ print()
+
+ print("""Total patches found: %d
+Patches missing Signed-off-by: %s
+Patches with malformed Signed-off-by: %s
+Patches missing CVE: %s
+Patches missing Upstream-Status: %s
+Patches with malformed Upstream-Status: %s
+Patches in Pending state: %s""" % (total_patches,
+ percent(missing_sob),
+ percent(malformed_sob),
+ percent(missing_cve),
+ percent(missing_status),
+ percent(malformed_status),
+ percent(pending_patches)))
+
+
+
+def histogram(results):
+ from toolz import recipes, dicttoolz
+ import math
+ counts = recipes.countby(lambda r: r.upstream_status, results.values())
+ bars = dicttoolz.valmap(lambda v: "#" * int(math.ceil(float(v) / len(results) * 100)), counts)
+ for k in bars:
+ print("%-20s %s (%d)" % (k.capitalize() if k else "No status", bars[k], counts[k]))
+
+
+if __name__ == "__main__":
+ import argparse, subprocess, os
+
+ args = argparse.ArgumentParser(description="Patch Review Tool")
+ args.add_argument("-b", "--blame", action="store_true", help="show blame for malformed patches")
+ args.add_argument("-v", "--verbose", action="store_true", help="show per-patch results")
+ args.add_argument("-g", "--histogram", action="store_true", help="show patch histogram")
+ args.add_argument("directory", nargs="?", help="directory to scan")
+ args = args.parse_args()
+
+ if args.directory:
+ os.chdir(args.directory)
+ patches = subprocess.check_output(("git", "ls-files", "*.patch", "*.diff")).decode("utf-8").split()
+ results = patchreview(patches)
+ analyse(results, want_blame=args.blame, verbose=args.verbose)
+ if args.histogram:
+ print()
+ histogram(results)
diff --git a/poky/scripts/contrib/patchtest.sh b/poky/scripts/contrib/patchtest.sh
new file mode 100755
index 000000000..7fe566666
--- /dev/null
+++ b/poky/scripts/contrib/patchtest.sh
@@ -0,0 +1,118 @@
+#!/bin/bash
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# patchtest: Run patchtest on commits starting at master
+#
+# Copyright (c) 2017, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+set -o errexit
+
+# Default values
+pokydir=''
+
+usage() {
+CMD=$(basename $0)
+cat <<EOM
+Usage: $CMD [-h] [-p pokydir]
+ -p pokydir Defaults to current directory
+EOM
+>&2
+ exit 1
+}
+
+function clone() {
+ local REPOREMOTE=$1
+ local REPODIR=$2
+ if [ ! -d $REPODIR ]; then
+ git clone $REPOREMOTE $REPODIR --quiet
+ else
+ ( cd $REPODIR; git pull --quiet )
+ fi
+}
+
+while getopts ":p:h" opt; do
+ case $opt in
+ p)
+ pokydir=$OPTARG
+ ;;
+ h)
+ usage
+ ;;
+ \?)
+ echo "Invalid option: -$OPTARG" >&2
+ usage
+ ;;
+ :)
+ echo "Option -$OPTARG requires an argument." >&2
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
+CDIR="$PWD"
+
+# default pokydir to current directory if user did not specify one
+if [ -z "$pokydir" ]; then
+ pokydir="$CDIR"
+fi
+
+PTENV="$PWD/patchtest"
+PT="$PTENV/patchtest"
+PTOE="$PTENV/patchtest-oe"
+
+if ! which virtualenv > /dev/null; then
+ echo "Install virtualenv before proceeding"
+ exit 1;
+fi
+
+# activate the virtual env
+virtualenv $PTENV --quiet
+source $PTENV/bin/activate
+
+cd $PTENV
+
+# clone or pull
+clone git://git.yoctoproject.org/patchtest $PT
+clone git://git.yoctoproject.org/patchtest-oe $PTOE
+
+# install requirements
+pip install -r $PT/requirements.txt --quiet
+pip install -r $PTOE/requirements.txt --quiet
+
+PATH="$PT:$PT/scripts:$PATH"
+
+# loop through parent to HEAD and execute patchtest on each commit
+for commit in $(git rev-list master..HEAD --reverse)
+do
+ shortlog="$(git log "$commit^1..$commit" --pretty='%h: %aN: %cd: %s')"
+ log="$(git format-patch "$commit^1..$commit" --stdout | patchtest - -r $pokydir -s $PTOE/tests --base-commit $commit^1 --json 2>/dev/null | create-summary --fail --only-results)"
+ if [ -z "$log" ]; then
+ shortlog="$shortlog: OK"
+ else
+ shortlog="$shortlog: FAIL"
+ fi
+ echo "$shortlog"
+ echo "$log" | sed -n -e '/Issue/p' -e '/Suggested fix/p'
+ echo ""
+done
+
+deactivate
+
+cd $CDIR
diff --git a/poky/scripts/contrib/serdevtry b/poky/scripts/contrib/serdevtry
new file mode 100755
index 000000000..74bd7b716
--- /dev/null
+++ b/poky/scripts/contrib/serdevtry
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+if [ "$1" = "" -o "$1" = "--help" ] ; then
+ echo "Usage: $0 <serial terminal command>"
+ echo
+ echo "Simple script to handle maintaining a terminal for serial devices that"
+ echo "disappear when a device is powered down or reset, such as the USB"
+ echo "serial console on the original BeagleBone (white version)."
+ echo
+ echo "e.g. $0 picocom -b 115200 /dev/ttyUSB0"
+ echo
+ exit
+fi
+
+args="$@"
+DEVICE=""
+while [ "$1" != "" ]; do
+ case "$1" in
+ /dev/*)
+ DEVICE=$1
+ break;;
+ esac
+ shift
+done
+
+if [ "$DEVICE" != "" ] ; then
+ while true; do
+ if [ ! -e $DEVICE ] ; then
+ echo "serdevtry: waiting for $DEVICE to exist..."
+ while [ ! -e $DEVICE ]; do
+ sleep 0.1
+ done
+ fi
+ if [ ! -w $DEVICE ] ; then
+ # Sometimes (presumably because of a race with udev) we get to
+ # the device before its permissions have been set up
+ RETRYNUM=0
+ while [ ! -w $DEVICE ]; do
+ if [ "$RETRYNUM" = "2" ] ; then
+ echo "Device $DEVICE exists but is not writable!"
+ exit 1
+ fi
+ RETRYNUM=$((RETRYNUM+1))
+ sleep 0.1
+ done
+ fi
+ $args
+ if [ -e $DEVICE ] ; then
+ break
+ fi
+ done
+else
+ echo "Unable to determine device node from command: $args"
+ exit 1
+fi
+
diff --git a/poky/scripts/contrib/test_build_time.sh b/poky/scripts/contrib/test_build_time.sh
new file mode 100755
index 000000000..9e5725ae5
--- /dev/null
+++ b/poky/scripts/contrib/test_build_time.sh
@@ -0,0 +1,237 @@
+#!/bin/bash
+
+# Build performance regression test script
+#
+# Copyright 2011 Intel Corporation
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#
+# DESCRIPTION
+# This script is intended to be used in conjunction with "git bisect run"
+# in order to find regressions in build time, however it can also be used
+# independently. It cleans out the build output directories, runs a
+# specified worker script (an example is test_build_time_worker.sh) under
+# TIME(1), logs the results to TEST_LOGDIR (default /tmp) and returns a
+# value telling "git bisect run" whether the build time is good (under
+# the specified threshold) or bad (over it). There is also a tolerance
+# option but it is not particularly useful as it only subtracts the
+# tolerance from the given threshold and uses it as the actual threshold.
+#
+# It is also capable of taking a file listing git revision hashes to be
+# test-applied to the repository in order to get past build failures that
+# would otherwise cause certain revisions to have to be skipped; if a
+# revision does not apply cleanly then the script assumes it does not
+# need to be applied and ignores it.
+#
+# Please see the help output (syntax below) for some important setup
+# instructions.
+#
+# AUTHORS
+# Paul Eggleton <paul.eggleton@linux.intel.com>
+
+
+syntax() {
+ echo "syntax: $0 <script> <time> <tolerance> [patchrevlist]"
+ echo ""
+ echo " script - worker script file (if in current dir, prefix with ./)"
+ echo " time - time threshold (in seconds, suffix m for minutes)"
+ echo " tolerance - tolerance (in seconds, suffix m for minutes or % for"
+ echo " percentage, can be 0)"
+ echo " patchrevlist - optional file listing revisions to apply as patches on top"
+ echo ""
+ echo "You must set TEST_BUILDDIR to point to a previously created build directory,"
+ echo "however please note that this script will wipe out the TMPDIR defined in"
+ echo "TEST_BUILDDIR/conf/local.conf as part of its initial setup (as well as your"
+ echo "~/.ccache)"
+ echo ""
+ echo "To get rid of the sudo prompt, please add the following line to /etc/sudoers"
+ echo "(use 'visudo' to edit this; also it is assumed that the user you are running"
+ echo "as is a member of the 'wheel' group):"
+ echo ""
+ echo "%wheel ALL=(ALL) NOPASSWD: /sbin/sysctl -w vm.drop_caches=[1-3]"
+ echo ""
+ echo "Note: it is recommended that you disable crond and any other process that"
+ echo "may cause significant CPU or I/O usage during build performance tests."
+}
+
+# Note - we exit with 250 here because that will tell git bisect run that
+# something bad happened and stop
+if [ "$1" = "" ] ; then
+ syntax
+ exit 250
+fi
+
+if [ "$2" = "" ] ; then
+ syntax
+ exit 250
+fi
+
+if [ "$3" = "" ] ; then
+ syntax
+ exit 250
+fi
+
+if ! [[ "$2" =~ ^[0-9][0-9m.]*$ ]] ; then
+ echo "'$2' is not a valid number for threshold"
+ exit 250
+fi
+
+if ! [[ "$3" =~ ^[0-9][0-9m.%]*$ ]] ; then
+ echo "'$3' is not a valid number for tolerance"
+ exit 250
+fi
+
+if [ "$TEST_BUILDDIR" = "" ] ; then
+ echo "Please set TEST_BUILDDIR to a previously created build directory"
+ exit 250
+fi
+
+if [ ! -d "$TEST_BUILDDIR" ] ; then
+ echo "TEST_BUILDDIR $TEST_BUILDDIR not found"
+ exit 250
+fi
+
+git diff --quiet
+if [ $? != 0 ] ; then
+ echo "Working tree is dirty, cannot proceed"
+ exit 251
+fi
+
+if [ "$BB_ENV_EXTRAWHITE" != "" ] ; then
+ echo "WARNING: you are running after sourcing the build environment script, this is not recommended"
+fi
+
+runscript=$1
+timethreshold=$2
+tolerance=$3
+
+if [ "$4" != "" ] ; then
+ patchrevlist=`cat $4`
+else
+ patchrevlist=""
+fi
+
+if [[ timethreshold == *m* ]] ; then
+ timethreshold=`echo $timethreshold | sed s/m/*60/ | bc`
+fi
+
+if [[ $tolerance == *m* ]] ; then
+ tolerance=`echo $tolerance | sed s/m/*60/ | bc`
+elif [[ $tolerance == *%* ]] ; then
+ tolerance=`echo $tolerance | sed s/%//`
+ tolerance=`echo "scale = 2; (($tolerance * $timethreshold) / 100)" | bc`
+fi
+
+tmpdir=`grep "^TMPDIR" $TEST_BUILDDIR/conf/local.conf | sed -e 's/TMPDIR[ \t]*=[ \t\?]*"//' -e 's/"//'`
+if [ "x$tmpdir" = "x" ]; then
+ echo "Unable to determine TMPDIR from $TEST_BUILDDIR/conf/local.conf, bailing out"
+ exit 250
+fi
+sstatedir=`grep "^SSTATE_DIR" $TEST_BUILDDIR/conf/local.conf | sed -e 's/SSTATE_DIR[ \t\?]*=[ \t]*"//' -e 's/"//'`
+if [ "x$sstatedir" = "x" ]; then
+ echo "Unable to determine SSTATE_DIR from $TEST_BUILDDIR/conf/local.conf, bailing out"
+ exit 250
+fi
+
+if [ `expr length $tmpdir` -lt 4 ] ; then
+ echo "TMPDIR $tmpdir is less than 4 characters, bailing out"
+ exit 250
+fi
+
+if [ `expr length $sstatedir` -lt 4 ] ; then
+ echo "SSTATE_DIR $sstatedir is less than 4 characters, bailing out"
+ exit 250
+fi
+
+echo -n "About to wipe out TMPDIR $tmpdir, press Ctrl+C to break out... "
+for i in 9 8 7 6 5 4 3 2 1
+do
+ echo -ne "\x08$i"
+ sleep 1
+done
+echo
+
+pushd . > /dev/null
+
+rm -f pseudodone
+echo "Removing TMPDIR $tmpdir..."
+rm -rf $tmpdir
+echo "Removing TMPDIR $tmpdir-*libc..."
+rm -rf $tmpdir-*libc
+echo "Removing SSTATE_DIR $sstatedir..."
+rm -rf $sstatedir
+echo "Removing ~/.ccache..."
+rm -rf ~/.ccache
+
+echo "Syncing..."
+sync
+sync
+echo "Dropping VM cache..."
+#echo 3 > /proc/sys/vm/drop_caches
+sudo /sbin/sysctl -w vm.drop_caches=3 > /dev/null
+
+if [ "$TEST_LOGDIR" = "" ] ; then
+ logdir="/tmp"
+else
+ logdir="$TEST_LOGDIR"
+fi
+rev=`git rev-parse HEAD`
+logfile="$logdir/timelog_$rev.log"
+echo -n > $logfile
+
+gitroot=`git rev-parse --show-toplevel`
+cd $gitroot
+for patchrev in $patchrevlist ; do
+ echo "Applying $patchrev"
+ patchfile=`mktemp`
+ git show $patchrev > $patchfile
+ git apply --check $patchfile &> /dev/null
+ if [ $? != 0 ] ; then
+ echo " ... patch does not apply without errors, ignoring"
+ else
+ echo "Applied $patchrev" >> $logfile
+ git apply $patchfile &> /dev/null
+ fi
+ rm $patchfile
+done
+
+sync
+echo "Quiescing for 5s..."
+sleep 5
+
+echo "Running $runscript at $rev..."
+timeoutfile=`mktemp`
+/usr/bin/time -o $timeoutfile -f "%e\nreal\t%E\nuser\t%Us\nsys\t%Ss\nmaxm\t%Mk" $runscript 2>&1 | tee -a $logfile
+exitstatus=$PIPESTATUS
+
+git reset --hard HEAD > /dev/null
+popd > /dev/null
+
+timeresult=`head -n1 $timeoutfile`
+cat $timeoutfile | tee -a $logfile
+rm $timeoutfile
+
+if [ $exitstatus != 0 ] ; then
+ # Build failed, exit with 125 to tell git bisect run to skip this rev
+ echo "*** Build failed (exit code $exitstatus), skipping..." | tee -a $logfile
+ exit 125
+fi
+
+ret=`echo "scale = 2; $timeresult > $timethreshold - $tolerance" | bc`
+echo "Returning $ret" | tee -a $logfile
+exit $ret
+
diff --git a/poky/scripts/contrib/test_build_time_worker.sh b/poky/scripts/contrib/test_build_time_worker.sh
new file mode 100755
index 000000000..8e20a9ea7
--- /dev/null
+++ b/poky/scripts/contrib/test_build_time_worker.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# This is an example script to be used in conjunction with test_build_time.sh
+
+if [ "$TEST_BUILDDIR" = "" ] ; then
+ echo "TEST_BUILDDIR is not set"
+ exit 1
+fi
+
+buildsubdir=`basename $TEST_BUILDDIR`
+if [ ! -d $buildsubdir ] ; then
+ echo "Unable to find build subdir $buildsubdir in current directory"
+ exit 1
+fi
+
+if [ -f oe-init-build-env ] ; then
+ . ./oe-init-build-env $buildsubdir
+elif [ -f poky-init-build-env ] ; then
+ . ./poky-init-build-env $buildsubdir
+else
+ echo "Unable to find build environment setup script"
+ exit 1
+fi
+
+if [ -f ../meta/recipes-sato/images/core-image-sato.bb ] ; then
+ target="core-image-sato"
+else
+ target="poky-image-sato"
+fi
+
+echo "Build started at `date "+%Y-%m-%d %H:%M:%S"`"
+echo "bitbake $target"
+bitbake $target
+ret=$?
+echo "Build finished at `date "+%Y-%m-%d %H:%M:%S"`"
+exit $ret
+
diff --git a/poky/scripts/contrib/uncovered b/poky/scripts/contrib/uncovered
new file mode 100755
index 000000000..a8399ad17
--- /dev/null
+++ b/poky/scripts/contrib/uncovered
@@ -0,0 +1,39 @@
+#!/bin/bash -eur
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Find python modules uncovered by oe-seltest
+#
+# Copyright (c) 2016, Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Author: Ed Bartosh <ed.bartosh@linux.intel.com>
+#
+
+if [ ! "$#" -eq 1 -o -t 0 ] ; then
+ echo 'Usage: coverage report | ./scripts/contrib/uncovered <dir>' 1>&2
+ exit 1
+fi
+
+path=$(readlink -ev $1)
+
+if [ ! -d "$path" ] ; then
+ echo "directory $1 doesn't exist" 1>&2
+ exit 1
+fi
+
+diff -u <(grep "$path" | grep -v '0%$' | cut -f1 -d: | sort) \
+ <(find $path | xargs file | grep 'Python script' | cut -f1 -d:| sort) | \
+ grep "^+$path" | cut -c2-
diff --git a/poky/scripts/contrib/verify-homepage.py b/poky/scripts/contrib/verify-homepage.py
new file mode 100755
index 000000000..76f1749cf
--- /dev/null
+++ b/poky/scripts/contrib/verify-homepage.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python3
+
+# This script can be used to verify HOMEPAGE values for all recipes in
+# the current configuration.
+# The result is influenced by network environment, since the timeout of connect url is 5 seconds as default.
+
+import sys
+import os
+import subprocess
+import urllib.request
+
+
+# Allow importing scripts/lib modules
+scripts_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/..')
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptpath
+import scriptutils
+
+# Allow importing bitbake modules
+bitbakepath = scriptpath.add_bitbake_lib_path()
+
+import bb.tinfoil
+
+logger = scriptutils.logger_create('verify_homepage')
+
+def wgetHomepage(pn, homepage):
+ result = subprocess.call('wget ' + '-q -T 5 -t 1 --spider ' + homepage, shell = True)
+ if result:
+ logger.warn("%s: failed to verify HOMEPAGE: %s " % (pn, homepage))
+ return 1
+ else:
+ return 0
+
+def verifyHomepage(bbhandler):
+ pkg_pn = bbhandler.cooker.recipecaches[''].pkg_pn
+ pnlist = sorted(pkg_pn)
+ count = 0
+ checked = []
+ for pn in pnlist:
+ for fn in pkg_pn[pn]:
+ # There's no point checking multiple BBCLASSEXTENDed variants of the same recipe
+ realfn, _, _ = bb.cache.virtualfn2realfn(fn)
+ if realfn in checked:
+ continue
+ data = bbhandler.parse_recipe_file(realfn)
+ homepage = data.getVar("HOMEPAGE")
+ if homepage:
+ try:
+ urllib.request.urlopen(homepage, timeout=5)
+ except Exception:
+ count = count + wgetHomepage(os.path.basename(realfn), homepage)
+ checked.append(realfn)
+ return count
+
+if __name__=='__main__':
+ with bb.tinfoil.Tinfoil() as bbhandler:
+ bbhandler.prepare()
+ logger.info("Start verifying HOMEPAGE:")
+ failcount = verifyHomepage(bbhandler)
+ logger.info("Finished verifying HOMEPAGE.")
+ logger.info("Summary: %s failed" % failcount)
diff --git a/poky/scripts/cp-noerror b/poky/scripts/cp-noerror
new file mode 100755
index 000000000..35eb211be
--- /dev/null
+++ b/poky/scripts/cp-noerror
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
+#
+# Allow copying of $1 to $2 but if files in $1 disappear during the copy operation,
+# don't error.
+# Also don't error if $1 disappears.
+#
+
+import sys
+import os
+import shutil
+
+def copytree(src, dst, symlinks=False, ignore=None):
+ """Based on shutil.copytree"""
+ names = os.listdir(src)
+ try:
+ os.makedirs(dst)
+ except OSError:
+ # Already exists
+ pass
+ errors = []
+ for name in names:
+ srcname = os.path.join(src, name)
+ dstname = os.path.join(dst, name)
+ try:
+ d = dstname
+ if os.path.isdir(dstname):
+ d = os.path.join(dstname, os.path.basename(srcname))
+ if os.path.exists(d):
+ continue
+ try:
+ os.link(srcname, dstname)
+ except OSError:
+ shutil.copy2(srcname, dstname)
+ # catch the Error from the recursive copytree so that we can
+ # continue with other files
+ except shutil.Error as err:
+ errors.extend(err.args[0])
+ except EnvironmentError as why:
+ errors.append((srcname, dstname, str(why)))
+ try:
+ shutil.copystat(src, dst)
+ except OSError as why:
+ errors.extend((src, dst, str(why)))
+ if errors:
+ raise shutil.Error(errors)
+
+try:
+ copytree(sys.argv[1], sys.argv[2])
+except shutil.Error:
+ pass
+except OSError:
+ pass
diff --git a/poky/scripts/create-pull-request b/poky/scripts/create-pull-request
new file mode 100755
index 000000000..280880b3f
--- /dev/null
+++ b/poky/scripts/create-pull-request
@@ -0,0 +1,303 @@
+#!/bin/sh
+#
+# Copyright (c) 2010-2013, Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+#
+# This script is intended to be used to prepare a series of patches
+# and a cover letter in an appropriate and consistent format for
+# submission to Open Embedded and The Yocto Project, as well as to
+# related projects and layers.
+#
+
+ODIR=pull-$$
+RELATIVE_TO="master"
+COMMIT_ID="HEAD"
+PREFIX="PATCH"
+RFC=0
+
+usage() {
+CMD=$(basename $0)
+cat <<EOM
+Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] [-d relative_dir] -u remote [-b branch] [-- <format-patch options>]
+ -b branch Branch name in the specified remote (default: current branch)
+ -l local branch Local branch name (default: HEAD)
+ -c Create an RFC (Request for Comment) patch series
+ -h Display this help message
+ -a Automatically push local branch (-l) to remote branch (-b),
+ or set CPR_CONTRIB_AUTO_PUSH in env
+ -i commit_id Ending commit (default: HEAD)
+ -m msg_body_file The file containing a blurb to be inserted into the summary email
+ -o output_dir Specify the output directory for the messages (default: pull-PID)
+ -p prefix Use [prefix N/M] instead of [PATCH N/M] as the subject prefix
+ -r relative_to Starting commit (default: master)
+ -s subject The subject to be inserted into the summary email
+ -u remote The git remote where the branch is located, or set CPR_CONTRIB_REMOTE in env
+ -d relative_dir Generate patches relative to directory
+
+ Examples:
+ $CMD -u contrib -b nitin/basic
+ $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro
+ $CMD -u contrib -r distro/master -i nitin/distro -b nitin/distro -l distro
+ $CMD -u contrib -r master -i misc -b nitin/misc -o pull-misc
+ $CMD -u contrib -p "RFC PATCH" -b nitin/experimental
+ $CMD -u contrib -i misc -b nitin/misc -d ./bitbake
+ $CMD -u contrib -r origin/master -o /tmp/out.v3 -- -v3 --in-reply-to=20170511120134.XX7799@site.com
+EOM
+}
+
+REMOTE="$CPR_CONTRIB_REMOTE"
+# Parse and validate arguments
+while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do
+ case $OPT in
+ b)
+ BRANCH="$OPTARG"
+ ;;
+ l)
+ L_BRANCH="$OPTARG"
+ ;;
+ c)
+ RFC=1
+ ;;
+ d)
+ RELDIR="$OPTARG"
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ i)
+ COMMIT_ID="$OPTARG"
+ ;;
+ m)
+ BODY="$OPTARG"
+ if [ ! -e "$BODY" ]; then
+ echo "ERROR: Body file does not exist"
+ exit 1
+ fi
+ ;;
+ o)
+ ODIR="$OPTARG"
+ ;;
+ p)
+ PREFIX="$OPTARG"
+ ;;
+ r)
+ RELATIVE_TO="$OPTARG"
+ ;;
+ s)
+ SUBJECT="$OPTARG"
+ ;;
+ u)
+ REMOTE="$OPTARG"
+ ;;
+ a)
+ CPR_CONTRIB_AUTO_PUSH="1"
+ ;;
+ --)
+ shift
+ break
+ ;;
+ esac
+done
+
+shift "$((OPTIND - 1))"
+extraopts="$@"
+
+if [ -z "$REMOTE" ]; then
+ echo "ERROR: Missing parameter -u or CPR_CONTRIB_REMOTE in env, no git remote!"
+ usage
+ exit 1
+fi
+
+REMOTE_URL=$(git config remote.$REMOTE.url)
+if [ $? -ne 0 ]; then
+ echo "ERROR: git config failed to find a url for '$REMOTE'"
+ echo
+ echo "To add a remote url for $REMOTE, use:"
+ echo " git config remote.$REMOTE.url <url>"
+ exit 1
+fi
+
+# Rewrite private URLs to public URLs
+# Determine the repository name for use in the WEB_URL later
+case "$REMOTE_URL" in
+*@*)
+ USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?"
+ PROTO_RE="[a-z][a-z+]*://"
+ GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)"
+ REMOTE_URL=${REMOTE_URL%.git}
+ REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#")
+ REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#")
+ ;;
+*)
+ echo "WARNING: Unrecognized remote URL: $REMOTE_URL"
+ echo " The pull and browse URLs will likely be incorrect"
+ ;;
+esac
+
+if [ -z "$BRANCH" ]; then
+ BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
+ echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
+fi
+
+if [ -z "$L_BRANCH" ]; then
+ L_BRANCH=HEAD
+ echo "NOTE: Assuming local branch HEAD, use -l to override."
+fi
+
+if [ $RFC -eq 1 ]; then
+ PREFIX="RFC $PREFIX"
+fi
+
+
+# Set WEB_URL from known remotes
+WEB_URL=""
+case "$REMOTE_URL" in
+ *git.yoctoproject.org*)
+ WEB_URL="http://git.yoctoproject.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH"
+ ;;
+ *git.pokylinux.org*)
+ WEB_URL="http://git.pokylinux.org/cgit.cgi/$REMOTE_REPO/log/?h=$BRANCH"
+ ;;
+ *git.openembedded.org*)
+ WEB_URL="http://cgit.openembedded.org/$REMOTE_REPO/log/?h=$BRANCH"
+ ;;
+ *github.com*)
+ WEB_URL="https://github.com/$REMOTE_REPO/tree/$BRANCH"
+ ;;
+esac
+
+# Perform a sanity test on the web URL. Issue a warning if it is not
+# accessible, but do not abort as users may want to run offline.
+if [ -n "$WEB_URL" ]; then
+ if [ "$CPR_CONTRIB_AUTO_PUSH" = "1" ]; then
+ echo "Pushing '$BRANCH' on '$REMOTE' as requested..."
+ git push $REMOTE $L_BRANCH:$BRANCH
+ echo ""
+ fi
+ wget --no-check-certificate -q $WEB_URL -O /dev/null
+ if [ $? -ne 0 ]; then
+ echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree."
+ echo " Please check your remote and branch parameter before sending."
+ echo ""
+ fi
+fi
+
+if [ -e $ODIR ]; then
+ echo "ERROR: output directory $ODIR exists."
+ exit 1
+fi
+mkdir $ODIR
+
+if [ -n "$RELDIR" ]; then
+ ODIR=$(realpath $ODIR)
+ pdir=$(pwd)
+ cd $RELDIR
+ extraopts="$extraopts --relative"
+fi
+
+# Generate the patches and cover letter
+git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
+
+if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then
+ echo "ERROR: $ODIR is empty, no cover letter and patches was generated!"
+ echo " This is most likely due to that \$RRELATIVE_TO..\$COMMIT_ID"
+ echo " ($RELATIVE_TO..$COMMIT_ID) don't contain any differences."
+ rmdir $ODIR
+ exit 1
+fi
+
+[ -n "$RELDIR" ] && cd $pdir
+
+# Customize the cover letter
+CL="$(echo $ODIR/*0000-cover-letter.patch)"
+PM="$ODIR/pull-msg"
+GIT_VERSION=$(`git --version` | tr -d '[:alpha:][:space:].' | sed 's/\(...\).*/\1/')
+NEWER_GIT_VERSION=210
+if [ $GIT_VERSION -lt $NEWER_GIT_VERSION ]; then
+ git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM"
+else
+ git request-pull $RELATIVE_TO $REMOTE_URL $L_BRANCH:$BRANCH >> "$PM"
+fi
+if [ $? -ne 0 ]; then
+ echo "ERROR: git request-pull reported an error"
+ rm -rf $ODIR
+ exit 1
+fi
+
+# The cover letter already has a diffstat, remove it from the pull-msg
+# before inserting it.
+sed -n "0,\#$REMOTE_URL# p" "$PM" | sed -i "/BLURB HERE/ r /dev/stdin" "$CL"
+rm "$PM"
+
+# If this is an RFC, make that clear in the cover letter
+if [ $RFC -eq 1 ]; then
+(cat <<EOM
+Please review the following changes for suitability for inclusion. If you have
+any objections or suggestions for improvement, please respond to the patches. If
+you agree with the changes, please provide your Acked-by.
+
+EOM
+) | sed -i "/BLURB HERE/ r /dev/stdin" "$CL"
+fi
+
+# Insert the WEB_URL if there is one
+if [ -n "$WEB_URL" ]; then
+ echo " $WEB_URL" | sed -i "\#$REMOTE_URL# r /dev/stdin" "$CL"
+fi
+
+
+# If the user specified a message body, insert it into the cover letter and
+# remove the BLURB token.
+if [ -n "$BODY" ]; then
+ sed -i "/BLURB HERE/ r $BODY" "$CL"
+ sed -i "/BLURB HERE/ d" "$CL"
+fi
+
+# Set subject automatically if there is only one patch
+patch_cnt=`git log --pretty=oneline ${RELATIVE_TO}..${L_BRANCH} | wc -l`
+if [ -z "$SUBJECT" -a $patch_cnt -eq 1 ]; then
+ SUBJECT="`git log --format=%s ${RELATIVE_TO}..${L_BRANCH}`"
+fi
+
+# Replace the SUBJECT token with it.
+if [ -n "$SUBJECT" ]; then
+ sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL"
+fi
+
+
+# Generate report for user
+cat <<EOM
+The following patches have been prepared:
+$(for PATCH in $(ls $ODIR/*); do echo " $PATCH"; done)
+
+Review their content, especially the summary mail:
+ $CL
+
+When you are satisfied, you can send them with:
+ send-pull-request -a -p $ODIR
+EOM
+
+# Check the patches for trailing white space
+egrep -q -e "^\+.*\s+$" $ODIR/*
+if [ $? -ne 1 ]; then
+ echo
+ echo "WARNING: Trailing white space detected at these locations"
+ egrep -nH --color -e "^\+.*\s+$" $ODIR/*
+fi
diff --git a/poky/scripts/crosstap b/poky/scripts/crosstap
new file mode 100755
index 000000000..e33fa4ad4
--- /dev/null
+++ b/poky/scripts/crosstap
@@ -0,0 +1,469 @@
+#!/usr/bin/env python3
+#
+# Build a systemtap script for a given image, kernel
+#
+# Effectively script extracts needed information from set of
+# 'bitbake -e' commands and contructs proper invocation of stap on
+# host to build systemtap script for a given target.
+#
+# By default script will compile scriptname.ko that could be copied
+# to taget and activated with 'staprun scriptname.ko' command. Or if
+# --remote user@hostname option is specified script will build, load
+# execute script on target.
+#
+# This script is very similar and inspired by crosstap shell script.
+# The major difference that this script supports user-land related
+# systemtap script, whereas crosstap could deal only with scripts
+# related to kernel.
+#
+# Copyright (c) 2018, Cisco Systems.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import sys
+import re
+import subprocess
+import os
+import optparse
+
+class Stap(object):
+ def __init__(self, script, module, remote):
+ self.script = script
+ self.module = module
+ self.remote = remote
+ self.stap = None
+ self.sysroot = None
+ self.runtime = None
+ self.tapset = None
+ self.arch = None
+ self.cross_compile = None
+ self.kernel_release = None
+ self.target_path = None
+ self.target_ld_library_path = None
+
+ if not self.remote:
+ if not self.module:
+ # derive module name from script
+ self.module = os.path.basename(self.script)
+ if self.module[-4:] == ".stp":
+ self.module = self.module[:-4]
+ # replace - if any with _
+ self.module = self.module.replace("-", "_")
+
+ def command(self, args):
+ ret = []
+ ret.append(self.stap)
+
+ if self.remote:
+ ret.append("--remote")
+ ret.append(self.remote)
+ else:
+ ret.append("-p4")
+ ret.append("-m")
+ ret.append(self.module)
+
+ ret.append("-a")
+ ret.append(self.arch)
+
+ ret.append("-B")
+ ret.append("CROSS_COMPILE=" + self.cross_compile)
+
+ ret.append("-r")
+ ret.append(self.kernel_release)
+
+ ret.append("-I")
+ ret.append(self.tapset)
+
+ ret.append("-R")
+ ret.append(self.runtime)
+
+ if self.sysroot:
+ ret.append("--sysroot")
+ ret.append(self.sysroot)
+
+ ret.append("--sysenv=PATH=" + self.target_path)
+ ret.append("--sysenv=LD_LIBRARY_PATH=" + self.target_ld_library_path)
+
+ ret = ret + args
+
+ ret.append(self.script)
+ return ret
+
+ def additional_environment(self):
+ ret = {}
+ ret["SYSTEMTAP_DEBUGINFO_PATH"] = "+:.debug:build"
+ return ret
+
+ def environment(self):
+ ret = os.environ.copy()
+ additional = self.additional_environment()
+ for e in additional:
+ ret[e] = additional[e]
+ return ret
+
+ def display_command(self, args):
+ additional_env = self.additional_environment()
+ command = self.command(args)
+
+ print("#!/bin/sh")
+ for e in additional_env:
+ print("export %s=\"%s\"" % (e, additional_env[e]))
+ print(" ".join(command))
+
+class BitbakeEnvInvocationException(Exception):
+ def __init__(self, message):
+ self.message = message
+
+class BitbakeEnv(object):
+ BITBAKE="bitbake"
+
+ def __init__(self, package):
+ self.package = package
+ self.cmd = BitbakeEnv.BITBAKE + " -e " + self.package
+ self.popen = subprocess.Popen(self.cmd, shell=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ self.__lines = self.popen.stdout.readlines()
+ self.popen.wait()
+
+ self.lines = []
+ for line in self.__lines:
+ self.lines.append(line.decode('utf-8'))
+
+ def get_vars(self, vars):
+ if self.popen.returncode:
+ raise BitbakeEnvInvocationException(
+ "\nFailed to execute '" + self.cmd +
+ "' with the following message:\n" +
+ ''.join(self.lines))
+
+ search_patterns = []
+ retdict = {}
+ for var in vars:
+ # regular not exported variable
+ rexpr = "^" + var + "=\"(.*)\""
+ re_compiled = re.compile(rexpr)
+ search_patterns.append((var, re_compiled))
+
+ # exported variable
+ rexpr = "^export " + var + "=\"(.*)\""
+ re_compiled = re.compile(rexpr)
+ search_patterns.append((var, re_compiled))
+
+ for line in self.lines:
+ for var, rexpr in search_patterns:
+ m = rexpr.match(line)
+ if m:
+ value = m.group(1)
+ retdict[var] = value
+
+ # fill variables values in order how they were requested
+ ret = []
+ for var in vars:
+ ret.append(retdict.get(var))
+
+ # if it is single value list return it as scalar, not the list
+ if len(ret) == 1:
+ ret = ret[0]
+
+ return ret
+
+class ParamDiscovery(object):
+ SYMBOLS_CHECK_MESSAGE = """
+WARNING: image '%s' does not have dbg-pkgs IMAGE_FEATURES enabled and no
+"image-combined-dbg" in inherited classes is specified. As result the image
+does not have symbols for user-land processes DWARF based probes. Consider
+adding 'dbg-pkgs' to EXTRA_IMAGE_FEATURES or adding "image-combined-dbg" to
+USER_CLASSES. I.e add this line 'USER_CLASSES += "image-combined-dbg"' to
+local.conf file.
+
+Or you may use IMAGE_GEN_DEBUGFS="1" option, and then after build you need
+recombine/unpack image and image-dbg tarballs and pass resulting dir location
+with --sysroot option.
+"""
+
+ def __init__(self, image):
+ self.image = image
+
+ self.image_rootfs = None
+ self.image_features = None
+ self.image_gen_debugfs = None
+ self.inherit = None
+ self.base_bindir = None
+ self.base_sbindir = None
+ self.base_libdir = None
+ self.bindir = None
+ self.sbindir = None
+ self.libdir = None
+
+ self.staging_bindir_toolchain = None
+ self.target_prefix = None
+ self.target_arch = None
+ self.target_kernel_builddir = None
+
+ self.staging_dir_native = None
+
+ self.image_combined_dbg = False
+
+ def discover(self):
+ if self.image:
+ benv_image = BitbakeEnv(self.image)
+ (self.image_rootfs,
+ self.image_features,
+ self.image_gen_debugfs,
+ self.inherit,
+ self.base_bindir,
+ self.base_sbindir,
+ self.base_libdir,
+ self.bindir,
+ self.sbindir,
+ self.libdir
+ ) = benv_image.get_vars(
+ ("IMAGE_ROOTFS",
+ "IMAGE_FEATURES",
+ "IMAGE_GEN_DEBUGFS",
+ "INHERIT",
+ "base_bindir",
+ "base_sbindir",
+ "base_libdir",
+ "bindir",
+ "sbindir",
+ "libdir"
+ ))
+
+ benv_kernel = BitbakeEnv("virtual/kernel")
+ (self.staging_bindir_toolchain,
+ self.target_prefix,
+ self.target_arch,
+ self.target_kernel_builddir
+ ) = benv_kernel.get_vars(
+ ("STAGING_BINDIR_TOOLCHAIN",
+ "TARGET_PREFIX",
+ "TRANSLATED_TARGET_ARCH",
+ "B"
+ ))
+
+ benv_systemtap = BitbakeEnv("systemtap-native")
+ (self.staging_dir_native
+ ) = benv_systemtap.get_vars(["STAGING_DIR_NATIVE"])
+
+ if self.inherit:
+ if "image-combined-dbg" in self.inherit.split():
+ self.image_combined_dbg = True
+
+ def check(self, sysroot_option):
+ ret = True
+ if self.image_rootfs:
+ sysroot = self.image_rootfs
+ if not os.path.isdir(self.image_rootfs):
+ print("ERROR: Cannot find '" + sysroot +
+ "' directory. Was '" + self.image + "' image built?")
+ ret = False
+
+ stap = self.staging_dir_native + "/usr/bin/stap"
+ if not os.path.isfile(stap):
+ print("ERROR: Cannot find '" + stap +
+ "'. Was 'systemtap-native' built?")
+ ret = False
+
+ if not os.path.isdir(self.target_kernel_builddir):
+ print("ERROR: Cannot find '" + self.target_kernel_builddir +
+ "' directory. Was 'kernel/virtual' built?")
+ ret = False
+
+ if not sysroot_option and self.image_rootfs:
+ dbg_pkgs_found = False
+
+ if self.image_features:
+ image_features = self.image_features.split()
+ if "dbg-pkgs" in image_features:
+ dbg_pkgs_found = True
+
+ if not dbg_pkgs_found \
+ and not self.image_combined_dbg:
+ print(ParamDiscovery.SYMBOLS_CHECK_MESSAGE % (self.image))
+
+ if not ret:
+ print("")
+
+ return ret
+
+ def __map_systemtap_arch(self):
+ a = self.target_arch
+ ret = a
+ if re.match('(athlon|x86.64)$', a):
+ ret = 'x86_64'
+ elif re.match('i.86$', a):
+ ret = 'i386'
+ elif re.match('arm$', a):
+ ret = 'arm'
+ elif re.match('aarch64$', a):
+ ret = 'arm64'
+ elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a):
+ ret = 'mips'
+ elif re.match('p(pc|owerpc)(|64)', a):
+ ret = 'powerpc'
+ return ret
+
+ def fill_stap(self, stap):
+ stap.stap = self.staging_dir_native + "/usr/bin/stap"
+ if not stap.sysroot:
+ if self.image_rootfs:
+ if self.image_combined_dbg:
+ stap.sysroot = self.image_rootfs + "-dbg"
+ else:
+ stap.sysroot = self.image_rootfs
+ stap.runtime = self.staging_dir_native + "/usr/share/systemtap/runtime"
+ stap.tapset = self.staging_dir_native + "/usr/share/systemtap/tapset"
+ stap.arch = self.__map_systemtap_arch()
+ stap.cross_compile = self.staging_bindir_toolchain + "/" + \
+ self.target_prefix
+ stap.kernel_release = self.target_kernel_builddir
+
+ # do we have standard that tells in which order these need to appear
+ target_path = []
+ if self.sbindir:
+ target_path.append(self.sbindir)
+ if self.bindir:
+ target_path.append(self.bindir)
+ if self.base_sbindir:
+ target_path.append(self.base_sbindir)
+ if self.base_bindir:
+ target_path.append(self.base_bindir)
+ stap.target_path = ":".join(target_path)
+
+ target_ld_library_path = []
+ if self.libdir:
+ target_ld_library_path.append(self.libdir)
+ if self.base_libdir:
+ target_ld_library_path.append(self.base_libdir)
+ stap.target_ld_library_path = ":".join(target_ld_library_path)
+
+
+def main():
+ usage = """usage: %prog -s <systemtap-script> [options] [-- [systemtap options]]
+
+%prog cross compile given SystemTap script against given image, kernel
+
+It needs to run in environtment set for bitbake - it uses bitbake -e
+invocations to retrieve information to construct proper stap cross build
+invocation arguments. It assumes that systemtap-native is built in given
+bitbake workspace.
+
+Anything after -- option is passed directly to stap.
+
+Legacy script invocation style supported but depreciated:
+ %prog <user@hostname> <sytemtap-script> [systemtap options]
+
+To enable most out of systemtap the following site.conf or local.conf
+configuration is recommended:
+
+# enables symbol + target binaries rootfs-dbg in workspace
+IMAGE_GEN_DEBUGFS = "1"
+IMAGE_FSTYPES_DEBUGFS = "tar.bz2"
+USER_CLASSES += "image-combined-dbg"
+
+# enables kernel debug symbols
+KERNEL_EXTRA_FEATURES_append = " features/debug/debug-kernel.scc"
+
+# minimal, just run-time systemtap configuration in target image
+PACKAGECONFIG_pn-systemtap = "monitor"
+
+# add systemtap run-time into target image if it is not there yet
+IMAGE_INSTALL_append = " systemtap"
+"""
+ option_parser = optparse.OptionParser(usage=usage)
+
+ option_parser.add_option("-s", "--script", dest="script",
+ help="specify input script FILE name",
+ metavar="FILE")
+
+ option_parser.add_option("-i", "--image", dest="image",
+ help="specify image name for which script should be compiled")
+
+ option_parser.add_option("-r", "--remote", dest="remote",
+ help="specify username@hostname of remote target to run script "
+ "optional, it assumes that remote target can be accessed through ssh")
+
+ option_parser.add_option("-m", "--module", dest="module",
+ help="specify module name, optional, has effect only if --remote is not used, "
+ "if not specified module name will be derived from passed script name")
+
+ option_parser.add_option("-y", "--sysroot", dest="sysroot",
+ help="explicitely specify image sysroot location. May need to use it in case "
+ "when IMAGE_GEN_DEBUGFS=\"1\" option is used and recombined with symbols "
+ "in different location",
+ metavar="DIR")
+
+ option_parser.add_option("-o", "--out", dest="out",
+ action="store_true",
+ help="output shell script that equvivalent invocation of this script with "
+ "given set of arguments, in given bitbake environment. It could be stored in "
+ "separate shell script and could be repeated without incuring bitbake -e "
+ "invocation overhead",
+ default=False)
+
+ option_parser.add_option("-d", "--debug", dest="debug",
+ action="store_true",
+ help="enable debug output. Use this option to see resulting stap invocation",
+ default=False)
+
+ # is invocation follow syntax from orignal crosstap shell script
+ legacy_args = False
+
+ # check if we called the legacy way
+ if len(sys.argv) >= 3:
+ if sys.argv[1].find("@") != -1 and os.path.exists(sys.argv[2]):
+ legacy_args = True
+
+ # fill options values for legacy invocation case
+ options = optparse.Values
+ options.script = sys.argv[2]
+ options.remote = sys.argv[1]
+ options.image = None
+ options.module = None
+ options.sysroot = None
+ options.out = None
+ options.debug = None
+ remaining_args = sys.argv[3:]
+
+ if not legacy_args:
+ (options, remaining_args) = option_parser.parse_args()
+
+ if not options.script or not os.path.exists(options.script):
+ print("'-s FILE' option is missing\n")
+ option_parser.print_help()
+ else:
+ stap = Stap(options.script, options.module, options.remote)
+ discovery = ParamDiscovery(options.image)
+ discovery.discover()
+ if not discovery.check(options.sysroot):
+ option_parser.print_help()
+ else:
+ stap.sysroot = options.sysroot
+ discovery.fill_stap(stap)
+
+ if options.out:
+ stap.display_command(remaining_args)
+ else:
+ cmd = stap.command(remaining_args)
+ env = stap.environment()
+
+ if options.debug:
+ print(" ".join(cmd))
+
+ os.execve(cmd[0], cmd, env)
+
+main()
diff --git a/poky/scripts/devtool b/poky/scripts/devtool
new file mode 100755
index 000000000..d681a1929
--- /dev/null
+++ b/poky/scripts/devtool
@@ -0,0 +1,349 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded Development tool
+#
+# Copyright (C) 2014-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import re
+import configparser
+import subprocess
+import logging
+
+basepath = ''
+workspace = {}
+config = None
+context = None
+
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+from devtool import DevtoolError, setup_tinfoil
+import scriptutils
+import argparse_oe
+logger = scriptutils.logger_create('devtool')
+
+plugins = []
+
+
+class ConfigHandler(object):
+ config_file = ''
+ config_obj = None
+ init_path = ''
+ workspace_path = ''
+
+ def __init__(self, filename):
+ self.config_file = filename
+ self.config_obj = configparser.SafeConfigParser()
+
+ def get(self, section, option, default=None):
+ try:
+ ret = self.config_obj.get(section, option)
+ except (configparser.NoOptionError, configparser.NoSectionError):
+ if default != None:
+ ret = default
+ else:
+ raise
+ return ret
+
+ def read(self):
+ if os.path.exists(self.config_file):
+ self.config_obj.read(self.config_file)
+
+ if self.config_obj.has_option('General', 'init_path'):
+ pth = self.get('General', 'init_path')
+ self.init_path = os.path.join(basepath, pth)
+ if not os.path.exists(self.init_path):
+ logger.error('init_path %s specified in config file cannot be found' % pth)
+ return False
+ else:
+ self.config_obj.add_section('General')
+
+ self.workspace_path = self.get('General', 'workspace_path', os.path.join(basepath, 'workspace'))
+ return True
+
+
+ def write(self):
+ logger.debug('writing to config file %s' % self.config_file)
+ self.config_obj.set('General', 'workspace_path', self.workspace_path)
+ with open(self.config_file, 'w') as f:
+ self.config_obj.write(f)
+
+ def set(self, section, option, value):
+ if not self.config_obj.has_section(section):
+ self.config_obj.add_section(section)
+ self.config_obj.set(section, option, value)
+
+class Context:
+ def __init__(self, **kwargs):
+ self.__dict__.update(kwargs)
+
+
+def read_workspace():
+ global workspace
+ workspace = {}
+ if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')):
+ if context.fixed_setup:
+ logger.error("workspace layer not set up")
+ sys.exit(1)
+ else:
+ logger.info('Creating workspace layer in %s' % config.workspace_path)
+ _create_workspace(config.workspace_path, config, basepath)
+ if not context.fixed_setup:
+ _enable_workspace_layer(config.workspace_path, config, basepath)
+
+ logger.debug('Reading workspace in %s' % config.workspace_path)
+ externalsrc_re = re.compile(r'^EXTERNALSRC(_pn-([^ =]+))? *= *"([^"]*)"$')
+ for fn in glob.glob(os.path.join(config.workspace_path, 'appends', '*.bbappend')):
+ with open(fn, 'r') as f:
+ pnvalues = {}
+ for line in f:
+ res = externalsrc_re.match(line.rstrip())
+ if res:
+ recipepn = os.path.splitext(os.path.basename(fn))[0].split('_')[0]
+ pn = res.group(2) or recipepn
+ # Find the recipe file within the workspace, if any
+ bbfile = os.path.basename(fn).replace('.bbappend', '.bb').replace('%', '*')
+ recipefile = glob.glob(os.path.join(config.workspace_path,
+ 'recipes',
+ recipepn,
+ bbfile))
+ if recipefile:
+ recipefile = recipefile[0]
+ pnvalues['srctree'] = res.group(3)
+ pnvalues['bbappend'] = fn
+ pnvalues['recipefile'] = recipefile
+ elif line.startswith('# srctreebase: '):
+ pnvalues['srctreebase'] = line.split(':', 1)[1].strip()
+ if pnvalues:
+ if not pnvalues.get('srctreebase', None):
+ pnvalues['srctreebase'] = pnvalues['srctree']
+ logger.debug('Found recipe %s' % pnvalues)
+ workspace[pn] = pnvalues
+
+def create_workspace(args, config, basepath, workspace):
+ if args.layerpath:
+ workspacedir = os.path.abspath(args.layerpath)
+ else:
+ workspacedir = os.path.abspath(os.path.join(basepath, 'workspace'))
+ _create_workspace(workspacedir, config, basepath)
+ if not args.create_only:
+ _enable_workspace_layer(workspacedir, config, basepath)
+
+def _create_workspace(workspacedir, config, basepath):
+ import bb
+
+ confdir = os.path.join(workspacedir, 'conf')
+ if os.path.exists(os.path.join(confdir, 'layer.conf')):
+ logger.info('Specified workspace already set up, leaving as-is')
+ else:
+ # Add a config file
+ bb.utils.mkdirhier(confdir)
+ with open(os.path.join(confdir, 'layer.conf'), 'w') as f:
+ f.write('# ### workspace layer auto-generated by devtool ###\n')
+ f.write('BBPATH =. "$' + '{LAYERDIR}:"\n')
+ f.write('BBFILES += "$' + '{LAYERDIR}/recipes/*/*.bb \\\n')
+ f.write(' $' + '{LAYERDIR}/appends/*.bbappend"\n')
+ f.write('BBFILE_COLLECTIONS += "workspacelayer"\n')
+ f.write('BBFILE_PATTERN_workspacelayer = "^$' + '{LAYERDIR}/"\n')
+ f.write('BBFILE_PATTERN_IGNORE_EMPTY_workspacelayer = "1"\n')
+ f.write('BBFILE_PRIORITY_workspacelayer = "99"\n')
+ f.write('LAYERSERIES_COMPAT_workspacelayer = "${LAYERSERIES_COMPAT_core}"\n')
+ # Add a README file
+ with open(os.path.join(workspacedir, 'README'), 'w') as f:
+ f.write('This layer was created by the OpenEmbedded devtool utility in order to\n')
+ f.write('contain recipes and bbappends that are currently being worked on. The idea\n')
+ f.write('is that the contents is temporary - once you have finished working on a\n')
+ f.write('recipe you use the appropriate method to move the files you have been\n')
+ f.write('working on to a proper layer. In most instances you should use the\n')
+ f.write('devtool utility to manage files within it rather than modifying files\n')
+ f.write('directly (although recipes added with "devtool add" will often need\n')
+ f.write('direct modification.)\n')
+ f.write('\nIf you no longer need to use devtool or the workspace layer\'s contents\n')
+ f.write('you can remove the path to this workspace layer from your conf/bblayers.conf\n')
+ f.write('file (and then delete the layer, if you wish).\n')
+ f.write('\nNote that by default, if devtool fetches and unpacks source code, it\n')
+ f.write('will place it in a subdirectory of a "sources" subdirectory of the\n')
+ f.write('layer. If you prefer it to be elsewhere you can specify the source\n')
+ f.write('tree path on the command line.\n')
+
+def _enable_workspace_layer(workspacedir, config, basepath):
+ """Ensure the workspace layer is in bblayers.conf"""
+ import bb
+ bblayers_conf = os.path.join(basepath, 'conf', 'bblayers.conf')
+ if not os.path.exists(bblayers_conf):
+ logger.error('Unable to find bblayers.conf')
+ return
+ if os.path.abspath(workspacedir) != os.path.abspath(config.workspace_path):
+ removedir = config.workspace_path
+ else:
+ removedir = None
+ _, added = bb.utils.edit_bblayers_conf(bblayers_conf, workspacedir, removedir)
+ if added:
+ logger.info('Enabling workspace layer in bblayers.conf')
+ if config.workspace_path != workspacedir:
+ # Update our config to point to the new location
+ config.workspace_path = workspacedir
+ config.write()
+
+
+def main():
+ global basepath
+ global config
+ global context
+
+ if sys.getfilesystemencoding() != "utf-8":
+ sys.exit("Please use a locale setting which supports utf-8.\nPython can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.")
+
+ context = Context(fixed_setup=False)
+
+ # Default basepath
+ basepath = os.path.dirname(os.path.abspath(__file__))
+
+ parser = argparse_oe.ArgumentParser(description="OpenEmbedded development tool",
+ add_help=False,
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('--basepath', help='Base directory of SDK / build directory')
+ parser.add_argument('--bbpath', help='Explicitly specify the BBPATH, rather than getting it from the metadata')
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+ parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
+
+ global_args, unparsed_args = parser.parse_known_args()
+
+ # Help is added here rather than via add_help=True, as we don't want it to
+ # be handled by parse_known_args()
+ parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
+ help='show this help message and exit')
+
+ if global_args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif global_args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ if global_args.basepath:
+ # Override
+ basepath = global_args.basepath
+ if os.path.exists(os.path.join(basepath, '.devtoolbase')):
+ context.fixed_setup = True
+ else:
+ pth = basepath
+ while pth != '' and pth != os.sep:
+ if os.path.exists(os.path.join(pth, '.devtoolbase')):
+ context.fixed_setup = True
+ basepath = pth
+ break
+ pth = os.path.dirname(pth)
+
+ if not context.fixed_setup:
+ basepath = os.environ.get('BUILDDIR')
+ if not basepath:
+ logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+ sys.exit(1)
+
+ logger.debug('Using basepath %s' % basepath)
+
+ config = ConfigHandler(os.path.join(basepath, 'conf', 'devtool.conf'))
+ if not config.read():
+ return -1
+ context.config = config
+
+ bitbake_subdir = config.get('General', 'bitbake_subdir', '')
+ if bitbake_subdir:
+ # Normally set for use within the SDK
+ logger.debug('Using bitbake subdir %s' % bitbake_subdir)
+ sys.path.insert(0, os.path.join(basepath, bitbake_subdir, 'lib'))
+ core_meta_subdir = config.get('General', 'core_meta_subdir')
+ sys.path.insert(0, os.path.join(basepath, core_meta_subdir, 'lib'))
+ else:
+ # Standard location
+ import scriptpath
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ sys.exit(1)
+ logger.debug('Using standard bitbake path %s' % bitbakepath)
+ scriptpath.add_oe_lib_path()
+
+ scriptutils.logger_setup_color(logger, global_args.color)
+
+ if global_args.bbpath is None:
+ try:
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ try:
+ global_args.bbpath = tinfoil.config_data.getVar('BBPATH')
+ finally:
+ tinfoil.shutdown()
+ except bb.BBHandledException:
+ return 2
+
+ # Search BBPATH first to allow layers to override plugins in scripts_path
+ for path in global_args.bbpath.split(':') + [scripts_path]:
+ pluginpath = os.path.join(path, 'lib', 'devtool')
+ scriptutils.load_plugins(logger, plugins, pluginpath)
+
+ subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
+
+ subparsers.add_subparser_group('sdk', 'SDK maintenance', -2)
+ subparsers.add_subparser_group('advanced', 'Advanced', -1)
+ subparsers.add_subparser_group('starting', 'Beginning work on a recipe', 100)
+ subparsers.add_subparser_group('info', 'Getting information')
+ subparsers.add_subparser_group('working', 'Working on a recipe in the workspace')
+ subparsers.add_subparser_group('testbuild', 'Testing changes on target')
+
+ if not context.fixed_setup:
+ parser_create_workspace = subparsers.add_parser('create-workspace',
+ help='Set up workspace in an alternative location',
+ description='Sets up a new workspace. NOTE: other devtool subcommands will create a workspace automatically as needed, so you only need to use %(prog)s if you want to specify where the workspace should be located.',
+ group='advanced')
+ parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created')
+ parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration')
+ parser_create_workspace.set_defaults(func=create_workspace, no_workspace=True)
+
+ for plugin in plugins:
+ if hasattr(plugin, 'register_commands'):
+ plugin.register_commands(subparsers, context)
+
+ args = parser.parse_args(unparsed_args, namespace=global_args)
+
+ if not getattr(args, 'no_workspace', False):
+ read_workspace()
+
+ try:
+ ret = args.func(args, config, basepath, workspace)
+ except DevtoolError as err:
+ if str(err):
+ logger.error(str(err))
+ ret = err.exitcode
+ except argparse_oe.ArgumentUsageError as ae:
+ parser.error_subcommand(ae.message, ae.subcommand)
+
+ return ret
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/distro/build-recipe-list.py b/poky/scripts/distro/build-recipe-list.py
new file mode 100755
index 000000000..216276485
--- /dev/null
+++ b/poky/scripts/distro/build-recipe-list.py
@@ -0,0 +1,129 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+
+import os
+import shutil
+import csv
+import sys
+import argparse
+
+__version__ = "0.1.0"
+
+# set of BPNs
+recipenames = set()
+# map of recipe -> data
+allrecipes = {}
+
+def make_bpn(recipe):
+ prefixes = ("nativesdk-",)
+ suffixes = ("-native", "-cross", "-initial", "-intermediate", "-crosssdk", "-cross-canadian")
+ for ix in prefixes + suffixes:
+ if ix in recipe:
+ recipe = recipe.replace(ix, "")
+ return recipe
+
+def gather_recipes(rows):
+ for row in rows:
+ recipe = row[0]
+ bpn = make_bpn(recipe)
+ if bpn not in recipenames:
+ recipenames.add(bpn)
+ if recipe not in allrecipes:
+ allrecipes[recipe] = row
+
+def generate_recipe_list():
+ # machine list
+ machine_list = ( "qemuarm64", "qemuarm", "qemumips64", "qemumips", "qemuppc", "qemux86-64", "qemux86" )
+ # set filename format
+ fnformat = 'distrodata.%s.csv'
+
+ # store all data files in distrodata
+ datadir = 'distrodata'
+
+ # create the directory if it does not exists
+ if not os.path.exists(datadir):
+ os.mkdir(datadir)
+
+ # doing bitbake distrodata
+ for machine in machine_list:
+ os.system('MACHINE='+ machine + ' bitbake -k universe -c distrodata')
+ shutil.copy('tmp/log/distrodata.csv', 'distrodata/' + fnformat % machine)
+
+ for machine in machine_list:
+ with open('distrodata/' + fnformat % machine) as f:
+ reader = csv.reader(f)
+ rows = reader.__iter__()
+ gather_recipes(rows)
+
+ with open('recipe-list.txt', 'w') as f:
+ for recipe in sorted(recipenames):
+ f.write("%s\n" % recipe)
+ print("file : recipe-list.txt is created with %d entries." % len(recipenames))
+
+ with open('all-recipe-list.txt', 'w') as f:
+ for recipe, row in sorted(allrecipes.items()):
+ f.write("%s\n" % ','.join(row))
+
+
+def diff_for_new_recipes(recipe1, recipe2):
+ prev_recipe_path = recipe1 + '/'
+ curr_recipe_path = recipe2 + '/'
+ if not os.path.isfile(prev_recipe_path + 'recipe-list.txt') or not os.path.isfile(curr_recipe_path + 'recipe-list.txt'):
+ print("recipe files do not exists. please verify that the file exists.")
+ exit(1)
+
+ import csv
+
+ prev = []
+ new = []
+
+ with open(prev_recipe_path + 'recipe-list.txt') as f:
+ prev = f.readlines()
+
+ with open(curr_recipe_path + 'recipe-list.txt') as f:
+ new = f.readlines()
+
+ updates = []
+ for pn in new:
+ if not pn in prev:
+ updates.append(pn.rstrip())
+
+ allrecipe = []
+ with open(recipe1 + '_' + recipe2 + '_new_recipe_list.txt','w') as dr:
+ with open(curr_recipe_path + 'all-recipe-list.txt') as f:
+ reader = csv.reader(f, delimiter=',')
+ for row in reader:
+ if row[0] in updates:
+ dr.write("%s,%s,%s" % (row[0], row[3], row[5]))
+ if len(row[9:]) > 0:
+ dr.write(",%s" % ','.join(row[9:]))
+ dr.write("\n")
+
+def main(argv):
+ if argv[0] == "generate_recipe_list":
+ generate_recipe_list()
+ elif argv[0] == "compare_recipe":
+ diff_for_new_recipes(argv[1], argv[2])
+ else:
+ print("no such option. choose either 'generate_recipe_list' or 'compare_recipe'")
+
+ exit(0)
+
+if __name__ == "__main__":
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except Exception as e:
+ print("Exception :", e)
+ sys.exit(1)
+
diff --git a/poky/scripts/distro/distrocompare.sh b/poky/scripts/distro/distrocompare.sh
new file mode 100755
index 000000000..908760c23
--- /dev/null
+++ b/poky/scripts/distro/distrocompare.sh
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2017, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# distrocompare.sh : provides capability to get a list of new packages
+# based on two distinct branches. This script takes
+# 2 parameters; either a commit-ish or a branch name
+#
+# To run : distrocompare.sh <older hash> <newer hash>
+# E.g. distrocompare.sh morty 92aa0e7
+# E.g. distrocompare.sh morty pyro
+#
+
+# get input as version
+previous_version=$1
+current_version=$2
+
+# set previous and current version
+if [ -z "$2" ]; then
+ previous_version=$1
+ current_version="current"
+fi
+
+# get script location. That's where the source supposedly located as well.
+scriptdir="$( realpath $(dirname "${BASH_SOURCE[0]}" ))"
+sourcedir="$( realpath $scriptdir/../.. )"
+
+# create working directory
+workdir=$(mktemp -d)
+
+# prepare to rollback to the branch if not similar
+branch=`cd $sourcedir; git branch | grep \* | cut -d ' ' -f2`
+
+# set current workdir to store final result
+currentworkdir=`pwd`
+
+# persists the file after local repo change
+cp $scriptdir/build-recipe-list.py $workdir
+
+#==================================================================
+
+function bake_distrodata {
+ # get to source directory of the git
+ cd $sourcedir
+
+ # change the branch / commit. Do not change if input is current
+ if [ "$1" != "current" ]; then
+ output=$(git checkout $1 2>&1)
+
+ # exit if git fails
+ if [[ $output == *"error"* ]]; then
+ echo "git error : $output"
+ echo "exiting ... "
+ rm -rf $workdir
+ exit
+ fi
+ fi
+
+ # make tmp as workdir
+ cd $workdir
+
+ # source oe-init to generate a new build folder
+ source $sourcedir/oe-init-build-env $1
+
+ # if file already exists with distrodata, do not append
+ if ! grep -q "distrodata" "conf/local.conf"; then
+ # add inherit distrodata to local.conf to enable distrodata feature
+ echo 'INHERIT += "distrodata"' >> conf/local.conf
+ fi
+
+ # use from tmp
+ $workdir/build-recipe-list.py generate_recipe_list
+}
+
+bake_distrodata $previous_version
+bake_distrodata $current_version
+
+#==================================================================
+
+cd $workdir
+
+# compare the 2 generated recipe-list.txt
+$workdir/build-recipe-list.py compare_recipe $previous_version $current_version
+
+# copy final result to current working directory
+cp $workdir/*_new_recipe_list.txt $currentworkdir
+
+if [ $? -ne 0 ]; then
+ rm -rf $workdir/$previous_version
+ rm -rf $workdir/$current_version
+ rm $workdir/build-recipe-list.py
+ # preserve the result in /tmp/distrodata if fail to copy the result over
+ exit
+fi
+
+# cleanup
+rm -rf $workdir
+
+# perform rollback branch
+cd $sourcedir
+currentbranch=`git branch | grep \* | cut -d ' ' -f2`
+if [ "$currentbranch" != "$branch" ]; then
+ git checkout $branch
+fi
+
+cd $currentworkdir
+
+#==================================================================
diff --git a/poky/scripts/gen-lockedsig-cache b/poky/scripts/gen-lockedsig-cache
new file mode 100755
index 000000000..6765891d1
--- /dev/null
+++ b/poky/scripts/gen-lockedsig-cache
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import glob
+import shutil
+import errno
+
+def mkdir(d):
+ try:
+ os.makedirs(d)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+
+if len(sys.argv) < 5:
+ print("Incorrect number of arguments specified")
+ print("syntax: gen-lockedsig-cache <locked-sigs.inc> <input-cachedir> <output-cachedir> <nativelsbstring> [filterfile]")
+ sys.exit(1)
+
+filterlist = []
+if len(sys.argv) > 5:
+ print('Reading filter file %s' % sys.argv[5])
+ with open(sys.argv[5]) as f:
+ for l in f.readlines():
+ if ":" in l:
+ filterlist.append(l.rstrip())
+
+print('Reading %s' % sys.argv[1])
+sigs = []
+with open(sys.argv[1]) as f:
+ for l in f.readlines():
+ if ":" in l:
+ task, sig = l.split()[0].rsplit(':', 1)
+ if filterlist and not task in filterlist:
+ print('Filtering out %s' % task)
+ else:
+ sigs.append(sig)
+
+print('Gathering file list')
+files = set()
+for s in sigs:
+ p = sys.argv[2] + "/" + s[:2] + "/*" + s + "*"
+ files |= set(glob.glob(p))
+ p = sys.argv[2] + "/%s/" % sys.argv[4] + s[:2] + "/*" + s + "*"
+ files |= set(glob.glob(p))
+
+print('Processing files')
+for f in files:
+ sys.stdout.write('Processing %s... ' % f)
+ _, ext = os.path.splitext(f)
+ if not ext in ['.tgz', '.siginfo', '.sig']:
+ # Most likely a temp file, skip it
+ print('skipping')
+ continue
+ dst = os.path.join(sys.argv[3], os.path.relpath(f, sys.argv[2]))
+ destdir = os.path.dirname(dst)
+ mkdir(destdir)
+
+ src = os.path.realpath(f)
+ if os.path.exists(dst):
+ os.remove(dst)
+ if (os.stat(src).st_dev == os.stat(destdir).st_dev):
+ print('linking')
+ try:
+ os.link(src, dst)
+ except OSError as e:
+ print('hard linking failed, copying')
+ shutil.copyfile(src, dst)
+ else:
+ print('copying')
+ shutil.copyfile(src, dst)
+
+print('Done!')
diff --git a/poky/scripts/gen-site-config b/poky/scripts/gen-site-config
new file mode 100755
index 000000000..7da7a0bd8
--- /dev/null
+++ b/poky/scripts/gen-site-config
@@ -0,0 +1,53 @@
+#! /bin/sh
+# Copyright (c) 2005-2008 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+cat << EOF
+AC_PREREQ(2.57)
+AC_INIT([site_wide],[1.0.0])
+
+EOF
+
+# Disable as endian is set in the default config
+#echo AC_C_BIGENDIAN
+#echo
+
+if [ -e $1/types ] ; then
+ while read type ; do
+ echo "AC_CHECK_SIZEOF([$type])"
+ done < $1/types
+
+ echo
+fi
+
+if [ -e $1/funcs ]; then
+ while read func ; do
+ echo "AC_CHECK_FUNCS([$func])"
+ done < $1/funcs
+
+ echo
+fi
+
+if [ -e $1/headers ]; then
+ while read header ; do
+ echo "AC_CHECK_HEADERS([$header])"
+ done < $1/headers
+
+ echo
+fi
+
+cat << EOF
+AC_OUTPUT
+EOF
diff --git a/poky/scripts/lib/argparse_oe.py b/poky/scripts/lib/argparse_oe.py
new file mode 100644
index 000000000..9bdfc1cec
--- /dev/null
+++ b/poky/scripts/lib/argparse_oe.py
@@ -0,0 +1,176 @@
+import sys
+import argparse
+from collections import defaultdict, OrderedDict
+
+class ArgumentUsageError(Exception):
+ """Exception class you can raise (and catch) in order to show the help"""
+ def __init__(self, message, subcommand=None):
+ self.message = message
+ self.subcommand = subcommand
+
+class ArgumentParser(argparse.ArgumentParser):
+ """Our own version of argparse's ArgumentParser"""
+ def __init__(self, *args, **kwargs):
+ kwargs.setdefault('formatter_class', OeHelpFormatter)
+ self._subparser_groups = OrderedDict()
+ super(ArgumentParser, self).__init__(*args, **kwargs)
+ self._positionals.title = 'arguments'
+ self._optionals.title = 'options'
+
+ def error(self, message):
+ """error(message: string)
+
+ Prints a help message incorporating the message to stderr and
+ exits.
+ """
+ self._print_message('%s: error: %s\n' % (self.prog, message), sys.stderr)
+ self.print_help(sys.stderr)
+ sys.exit(2)
+
+ def error_subcommand(self, message, subcommand):
+ if subcommand:
+ action = self._get_subparser_action()
+ try:
+ subparser = action._name_parser_map[subcommand]
+ except KeyError:
+ self.error('no subparser for name "%s"' % subcommand)
+ else:
+ subparser.error(message)
+
+ self.error(message)
+
+ def add_subparsers(self, *args, **kwargs):
+ if 'dest' not in kwargs:
+ kwargs['dest'] = '_subparser_name'
+
+ ret = super(ArgumentParser, self).add_subparsers(*args, **kwargs)
+ # Need a way of accessing the parent parser
+ ret._parent_parser = self
+ # Ensure our class gets instantiated
+ ret._parser_class = ArgumentSubParser
+ # Hacky way of adding a method to the subparsers object
+ ret.add_subparser_group = self.add_subparser_group
+ return ret
+
+ def add_subparser_group(self, groupname, groupdesc, order=0):
+ self._subparser_groups[groupname] = (groupdesc, order)
+
+ def parse_args(self, args=None, namespace=None):
+ """Parse arguments, using the correct subparser to show the error."""
+ args, argv = self.parse_known_args(args, namespace)
+ if argv:
+ message = 'unrecognized arguments: %s' % ' '.join(argv)
+ if self._subparsers:
+ subparser = self._get_subparser(args)
+ subparser.error(message)
+ else:
+ self.error(message)
+ sys.exit(2)
+ return args
+
+ def _get_subparser(self, args):
+ action = self._get_subparser_action()
+ if action.dest == argparse.SUPPRESS:
+ self.error('cannot get subparser, the subparser action dest is suppressed')
+
+ name = getattr(args, action.dest)
+ try:
+ return action._name_parser_map[name]
+ except KeyError:
+ self.error('no subparser for name "%s"' % name)
+
+ def _get_subparser_action(self):
+ if not self._subparsers:
+ self.error('cannot return the subparser action, no subparsers added')
+
+ for action in self._subparsers._group_actions:
+ if isinstance(action, argparse._SubParsersAction):
+ return action
+
+
+class ArgumentSubParser(ArgumentParser):
+ def __init__(self, *args, **kwargs):
+ if 'group' in kwargs:
+ self._group = kwargs.pop('group')
+ if 'order' in kwargs:
+ self._order = kwargs.pop('order')
+ super(ArgumentSubParser, self).__init__(*args, **kwargs)
+
+ def parse_known_args(self, args=None, namespace=None):
+ # This works around argparse not handling optional positional arguments being
+ # intermixed with other options. A pretty horrible hack, but we're not left
+ # with much choice given that the bug in argparse exists and it's difficult
+ # to subclass.
+ # Borrowed from http://stackoverflow.com/questions/20165843/argparse-how-to-handle-variable-number-of-arguments-nargs
+ # with an extra workaround (in format_help() below) for the positional
+ # arguments disappearing from the --help output, as well as structural tweaks.
+ # Originally simplified from http://bugs.python.org/file30204/test_intermixed.py
+ positionals = self._get_positional_actions()
+ for action in positionals:
+ # deactivate positionals
+ action.save_nargs = action.nargs
+ action.nargs = 0
+
+ namespace, remaining_args = super(ArgumentSubParser, self).parse_known_args(args, namespace)
+ for action in positionals:
+ # remove the empty positional values from namespace
+ if hasattr(namespace, action.dest):
+ delattr(namespace, action.dest)
+ for action in positionals:
+ action.nargs = action.save_nargs
+ # parse positionals
+ namespace, extras = super(ArgumentSubParser, self).parse_known_args(remaining_args, namespace)
+ return namespace, extras
+
+ def format_help(self):
+ # Quick, restore the positionals!
+ positionals = self._get_positional_actions()
+ for action in positionals:
+ if hasattr(action, 'save_nargs'):
+ action.nargs = action.save_nargs
+ return super(ArgumentParser, self).format_help()
+
+
+class OeHelpFormatter(argparse.HelpFormatter):
+ def _format_action(self, action):
+ if hasattr(action, '_get_subactions'):
+ # subcommands list
+ groupmap = defaultdict(list)
+ ordermap = {}
+ subparser_groups = action._parent_parser._subparser_groups
+ groups = sorted(subparser_groups.keys(), key=lambda item: subparser_groups[item][1], reverse=True)
+ for subaction in self._iter_indented_subactions(action):
+ parser = action._name_parser_map[subaction.dest]
+ group = getattr(parser, '_group', None)
+ groupmap[group].append(subaction)
+ if group not in groups:
+ groups.append(group)
+ order = getattr(parser, '_order', 0)
+ ordermap[subaction.dest] = order
+
+ lines = []
+ if len(groupmap) > 1:
+ groupindent = ' '
+ else:
+ groupindent = ''
+ for group in groups:
+ subactions = groupmap[group]
+ if not subactions:
+ continue
+ if groupindent:
+ if not group:
+ group = 'other'
+ groupdesc = subparser_groups.get(group, (group, 0))[0]
+ lines.append(' %s:' % groupdesc)
+ for subaction in sorted(subactions, key=lambda item: ordermap[item.dest], reverse=True):
+ lines.append('%s%s' % (groupindent, self._format_action(subaction).rstrip()))
+ return '\n'.join(lines)
+ else:
+ return super(OeHelpFormatter, self)._format_action(action)
+
+def int_positive(value):
+ ivalue = int(value)
+ if ivalue <= 0:
+ raise argparse.ArgumentTypeError(
+ "%s is not a positive int value" % value)
+ return ivalue
diff --git a/poky/scripts/lib/build_perf/__init__.py b/poky/scripts/lib/build_perf/__init__.py
new file mode 100644
index 000000000..1f8b72907
--- /dev/null
+++ b/poky/scripts/lib/build_perf/__init__.py
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Build performance test library functions"""
+
+def print_table(rows, row_fmt=None):
+ """Print data table"""
+ if not rows:
+ return
+ if not row_fmt:
+ row_fmt = ['{:{wid}} '] * len(rows[0])
+
+ # Go through the data to get maximum cell widths
+ num_cols = len(row_fmt)
+ col_widths = [0] * num_cols
+ for row in rows:
+ for i, val in enumerate(row):
+ col_widths[i] = max(col_widths[i], len(str(val)))
+
+ for row in rows:
+ print(*[row_fmt[i].format(col, wid=col_widths[i]) for i, col in enumerate(row)])
+
diff --git a/poky/scripts/lib/build_perf/html.py b/poky/scripts/lib/build_perf/html.py
new file mode 100644
index 000000000..578bb162e
--- /dev/null
+++ b/poky/scripts/lib/build_perf/html.py
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Helper module for HTML reporting"""
+from jinja2 import Environment, PackageLoader
+
+
+env = Environment(loader=PackageLoader('build_perf', 'html'))
+
+template = env.get_template('report.html')
diff --git a/poky/scripts/lib/build_perf/html/measurement_chart.html b/poky/scripts/lib/build_perf/html/measurement_chart.html
new file mode 100644
index 000000000..65f1a227a
--- /dev/null
+++ b/poky/scripts/lib/build_perf/html/measurement_chart.html
@@ -0,0 +1,50 @@
+<script type="text/javascript">
+ chartsDrawing += 1;
+ google.charts.setOnLoadCallback(drawChart_{{ chart_elem_id }});
+ function drawChart_{{ chart_elem_id }}() {
+ var data = new google.visualization.DataTable();
+
+ // Chart options
+ var options = {
+ theme : 'material',
+ legend: 'none',
+ hAxis: { format: '', title: 'Commit number',
+ minValue: {{ chart_opts.haxis.min }},
+ maxValue: {{ chart_opts.haxis.max }} },
+ {% if measurement.type == 'time' %}
+ vAxis: { format: 'h:mm:ss' },
+ {% else %}
+ vAxis: { format: '' },
+ {% endif %}
+ pointSize: 5,
+ chartArea: { left: 80, right: 15 },
+ };
+
+ // Define data columns
+ data.addColumn('number', 'Commit');
+ data.addColumn('{{ measurement.value_type.gv_data_type }}',
+ '{{ measurement.value_type.quantity }}');
+ // Add data rows
+ data.addRows([
+ {% for sample in measurement.samples %}
+ [{{ sample.commit_num }}, {{ sample.mean.gv_value() }}],
+ {% endfor %}
+ ]);
+
+ // Finally, draw the chart
+ chart_div = document.getElementById('{{ chart_elem_id }}');
+ var chart = new google.visualization.LineChart(chart_div);
+ google.visualization.events.addListener(chart, 'ready', function () {
+ //chart_div = document.getElementById('{{ chart_elem_id }}');
+ //chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
+ png_div = document.getElementById('{{ chart_elem_id }}_png');
+ png_div.outerHTML = '<a id="{{ chart_elem_id }}_png" href="' + chart.getImageURI() + '">PNG</a>';
+ console.log("CHART READY: {{ chart_elem_id }}");
+ chartsDrawing -= 1;
+ if (chartsDrawing == 0)
+ console.log("ALL CHARTS READY");
+ });
+ chart.draw(data, options);
+}
+</script>
+
diff --git a/poky/scripts/lib/build_perf/html/report.html b/poky/scripts/lib/build_perf/html/report.html
new file mode 100644
index 000000000..291ad9d72
--- /dev/null
+++ b/poky/scripts/lib/build_perf/html/report.html
@@ -0,0 +1,286 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+{# Scripts, for visualization#}
+<!--START-OF-SCRIPTS-->
+<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
+<script type="text/javascript">
+google.charts.load('current', {'packages':['corechart']});
+var chartsDrawing = 0;
+</script>
+
+{# Render measurement result charts #}
+{% for test in test_data %}
+ {% if test.status == 'SUCCESS' %}
+ {% for measurement in test.measurements %}
+ {% set chart_elem_id = test.name + '_' + measurement.name + '_chart' %}
+ {% include 'measurement_chart.html' %}
+ {% endfor %}
+ {% endif %}
+{% endfor %}
+
+<!--END-OF-SCRIPTS-->
+
+{# Styles #}
+<style>
+.meta-table {
+ font-size: 14px;
+ text-align: left;
+ border-collapse: collapse;
+}
+.meta-table tr:nth-child(even){background-color: #f2f2f2}
+meta-table th, .meta-table td {
+ padding: 4px;
+}
+.summary {
+ margin: 0;
+ font-size: 14px;
+ text-align: left;
+ border-collapse: collapse;
+}
+summary th, .meta-table td {
+ padding: 4px;
+}
+.measurement {
+ padding: 8px 0px 8px 8px;
+ border: 2px solid #f0f0f0;
+ margin-bottom: 10px;
+}
+.details {
+ margin: 0;
+ font-size: 12px;
+ text-align: left;
+ border-collapse: collapse;
+}
+.details th {
+ padding-right: 8px;
+}
+.details.plain th {
+ font-weight: normal;
+}
+.preformatted {
+ font-family: monospace;
+ white-space: pre-wrap;
+ background-color: #f0f0f0;
+ margin-left: 10px;
+}
+hr {
+ color: #f0f0f0;
+}
+h2 {
+ font-size: 20px;
+ margin-bottom: 0px;
+ color: #707070;
+}
+h3 {
+ font-size: 16px;
+ margin: 0px;
+ color: #707070;
+}
+</style>
+
+<title>{{ title }}</title>
+</head>
+
+{% macro poky_link(commit) -%}
+ <a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/?id={{ commit }}">{{ commit[0:11] }}</a>
+{%- endmacro %}
+
+<body><div style="width: 700px">
+ {# Test metadata #}
+ <h2>General</h2>
+ <hr>
+ <table class="meta-table" style="width: 100%">
+ <tr>
+ <th></th>
+ <th>Current commit</th>
+ <th>Comparing with</th>
+ </tr>
+ {% for key, item in metadata.items() %}
+ <tr>
+ <th>{{ item.title }}</th>
+ {%if key == 'commit' %}
+ <td>{{ poky_link(item.value) }}</td>
+ <td>{{ poky_link(item.value_old) }}</td>
+ {% else %}
+ <td>{{ item.value }}</td>
+ <td>{{ item.value_old }}</td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+
+ {# Test result summary #}
+ <h2>Test result summary</h2>
+ <hr>
+ <table class="summary" style="width: 100%">
+ {% for test in test_data %}
+ {% if loop.index is even %}
+ {% set row_style = 'style="background-color: #f2f2f2"' %}
+ {% else %}
+ {% set row_style = 'style="background-color: #ffffff"' %}
+ {% endif %}
+ {% if test.status == 'SUCCESS' %}
+ {% for measurement in test.measurements %}
+ <tr {{ row_style }}>
+ {% if loop.index == 1 %}
+ <td>{{ test.name }}: {{ test.description }}</td>
+ {% else %}
+ {# add empty cell in place of the test name#}
+ <td></td>
+ {% endif %}
+ {% if measurement.absdiff > 0 %}
+ {% set result_style = "color: red" %}
+ {% elif measurement.absdiff == measurement.absdiff %}
+ {% set result_style = "color: green" %}
+ {% else %}
+ {% set result_style = "color: orange" %}
+ {%endif %}
+ <td>{{ measurement.description }}</td>
+ <td style="font-weight: bold">{{ measurement.value.mean }}</td>
+ <td style="{{ result_style }}">{{ measurement.absdiff_str }}</td>
+ <td style="{{ result_style }}">{{ measurement.reldiff }}</td>
+ </tr>
+ {% endfor %}
+ {% else %}
+ <td style="font-weight: bold; color: red;">{{test.status }}</td>
+ <td></td> <td></td> <td></td> <td></td>
+ {% endif %}
+ {% endfor %}
+ </table>
+
+ {# Detailed test results #}
+ {% for test in test_data %}
+ <h2>{{ test.name }}: {{ test.description }}</h2>
+ <hr>
+ {% if test.status == 'SUCCESS' %}
+ {% for measurement in test.measurements %}
+ <div class="measurement">
+ <h3>{{ measurement.description }}</h3>
+ <div style="font-weight:bold;">
+ <span style="font-size: 23px;">{{ measurement.value.mean }}</span>
+ <span style="font-size: 20px; margin-left: 12px">
+ {% if measurement.absdiff > 0 %}
+ <span style="color: red">
+ {% elif measurement.absdiff == measurement.absdiff %}
+ <span style="color: green">
+ {% else %}
+ <span style="color: orange">
+ {% endif %}
+ {{ measurement.absdiff_str }} ({{measurement.reldiff}})
+ </span></span>
+ </div>
+ {# Table for trendchart and the statistics #}
+ <table style="width: 100%">
+ <tr>
+ <td style="width: 75%">
+ {# Linechart #}
+ <div id="{{ test.name }}_{{ measurement.name }}_chart"></div>
+ </td>
+ <td>
+ {# Measurement statistics #}
+ <table class="details plain">
+ <tr>
+ <th>Test runs</th><td>{{ measurement.value.sample_cnt }}</td>
+ </tr><tr>
+ <th>-/+</th><td>-{{ measurement.value.minus }} / +{{ measurement.value.plus }}</td>
+ </tr><tr>
+ <th>Min</th><td>{{ measurement.value.min }}</td>
+ </tr><tr>
+ <th>Max</th><td>{{ measurement.value.max }}</td>
+ </tr><tr>
+ <th>Stdev</th><td>{{ measurement.value.stdev }}</td>
+ </tr><tr>
+ <th><div id="{{ test.name }}_{{ measurement.name }}_chart_png"></div></th>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ {# Task and recipe summary from buildstats #}
+ {% if 'buildstats' in measurement %}
+ Task resource usage
+ <table class="details" style="width:100%">
+ <tr>
+ <th>Number of tasks</th>
+ <th>Top consumers of cputime</th>
+ </tr>
+ <tr>
+ <td style="vertical-align: top">{{ measurement.buildstats.tasks.count }} ({{ measurement.buildstats.tasks.change }})</td>
+ {# Table of most resource-hungry tasks #}
+ <td>
+ <table class="details plain">
+ {% for diff in measurement.buildstats.top_consumer|reverse %}
+ <tr>
+ <th>{{ diff.pkg }}.{{ diff.task }}</th>
+ <td>{{ '%0.0f' % diff.value2 }} s</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <th>Biggest increase in cputime</th>
+ <th>Biggest decrease in cputime</th>
+ </tr>
+ <tr>
+ {# Table biggest increase in resource usage #}
+ <td>
+ <table class="details plain">
+ {% for diff in measurement.buildstats.top_increase|reverse %}
+ <tr>
+ <th>{{ diff.pkg }}.{{ diff.task }}</th>
+ <td>{{ '%+0.0f' % diff.absdiff }} s</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </td>
+ {# Table biggest decrease in resource usage #}
+ <td>
+ <table class="details plain">
+ {% for diff in measurement.buildstats.top_decrease %}
+ <tr>
+ <th>{{ diff.pkg }}.{{ diff.task }}</th>
+ <td>{{ '%+0.0f' % diff.absdiff }} s</td>
+ </tr>
+ {% endfor %}
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ {# Recipe version differences #}
+ {% if measurement.buildstats.ver_diff %}
+ <div style="margin-top: 16px">Recipe version changes</div>
+ <table class="details">
+ {% for head, recipes in measurement.buildstats.ver_diff.items() %}
+ <tr>
+ <th colspan="2">{{ head }}</th>
+ </tr>
+ {% for name, info in recipes|sort %}
+ <tr>
+ <td>{{ name }}</td>
+ <td>{{ info }}</td>
+ </tr>
+ {% endfor %}
+ {% endfor %}
+ </table>
+ {% else %}
+ <div style="margin-top: 16px">No recipe version changes detected</div>
+ {% endif %}
+ {% endif %}
+ </div>
+ {% endfor %}
+ {# Unsuccessful test #}
+ {% else %}
+ <span style="font-size: 150%; font-weight: bold; color: red;">{{ test.status }}
+ {% if test.err_type %}<span style="font-size: 75%; font-weight: normal">({{ test.err_type }})</span>{% endif %}
+ </span>
+ <div class="preformatted">{{ test.message }}</div>
+ {% endif %}
+ {% endfor %}
+</div></body>
+</html>
+
diff --git a/poky/scripts/lib/build_perf/report.py b/poky/scripts/lib/build_perf/report.py
new file mode 100644
index 000000000..d99a36797
--- /dev/null
+++ b/poky/scripts/lib/build_perf/report.py
@@ -0,0 +1,345 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Handling of build perf test reports"""
+from collections import OrderedDict, Mapping, namedtuple
+from datetime import datetime, timezone
+from numbers import Number
+from statistics import mean, stdev, variance
+
+
+AggregateTestData = namedtuple('AggregateTestData', ['metadata', 'results'])
+
+
+def isofmt_to_timestamp(string):
+ """Convert timestamp string in ISO 8601 format into unix timestamp"""
+ if '.' in string:
+ dt = datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%f')
+ else:
+ dt = datetime.strptime(string, '%Y-%m-%dT%H:%M:%S')
+ return dt.replace(tzinfo=timezone.utc).timestamp()
+
+
+def metadata_xml_to_json(elem):
+ """Convert metadata xml into JSON format"""
+ assert elem.tag == 'metadata', "Invalid metadata file format"
+
+ def _xml_to_json(elem):
+ """Convert xml element to JSON object"""
+ out = OrderedDict()
+ for child in elem.getchildren():
+ key = child.attrib.get('name', child.tag)
+ if len(child):
+ out[key] = _xml_to_json(child)
+ else:
+ out[key] = child.text
+ return out
+ return _xml_to_json(elem)
+
+
+def results_xml_to_json(elem):
+ """Convert results xml into JSON format"""
+ rusage_fields = ('ru_utime', 'ru_stime', 'ru_maxrss', 'ru_minflt',
+ 'ru_majflt', 'ru_inblock', 'ru_oublock', 'ru_nvcsw',
+ 'ru_nivcsw')
+ iostat_fields = ('rchar', 'wchar', 'syscr', 'syscw', 'read_bytes',
+ 'write_bytes', 'cancelled_write_bytes')
+
+ def _read_measurement(elem):
+ """Convert measurement to JSON"""
+ data = OrderedDict()
+ data['type'] = elem.tag
+ data['name'] = elem.attrib['name']
+ data['legend'] = elem.attrib['legend']
+ values = OrderedDict()
+
+ # SYSRES measurement
+ if elem.tag == 'sysres':
+ for subel in elem:
+ if subel.tag == 'time':
+ values['start_time'] = isofmt_to_timestamp(subel.attrib['timestamp'])
+ values['elapsed_time'] = float(subel.text)
+ elif subel.tag == 'rusage':
+ rusage = OrderedDict()
+ for field in rusage_fields:
+ if 'time' in field:
+ rusage[field] = float(subel.attrib[field])
+ else:
+ rusage[field] = int(subel.attrib[field])
+ values['rusage'] = rusage
+ elif subel.tag == 'iostat':
+ values['iostat'] = OrderedDict([(f, int(subel.attrib[f]))
+ for f in iostat_fields])
+ elif subel.tag == 'buildstats_file':
+ values['buildstats_file'] = subel.text
+ else:
+ raise TypeError("Unknown sysres value element '{}'".format(subel.tag))
+ # DISKUSAGE measurement
+ elif elem.tag == 'diskusage':
+ values['size'] = int(elem.find('size').text)
+ else:
+ raise Exception("Unknown measurement tag '{}'".format(elem.tag))
+ data['values'] = values
+ return data
+
+ def _read_testcase(elem):
+ """Convert testcase into JSON"""
+ assert elem.tag == 'testcase', "Expecting 'testcase' element instead of {}".format(elem.tag)
+
+ data = OrderedDict()
+ data['name'] = elem.attrib['name']
+ data['description'] = elem.attrib['description']
+ data['status'] = 'SUCCESS'
+ data['start_time'] = isofmt_to_timestamp(elem.attrib['timestamp'])
+ data['elapsed_time'] = float(elem.attrib['time'])
+ measurements = OrderedDict()
+
+ for subel in elem.getchildren():
+ if subel.tag == 'error' or subel.tag == 'failure':
+ data['status'] = subel.tag.upper()
+ data['message'] = subel.attrib['message']
+ data['err_type'] = subel.attrib['type']
+ data['err_output'] = subel.text
+ elif subel.tag == 'skipped':
+ data['status'] = 'SKIPPED'
+ data['message'] = subel.text
+ else:
+ measurements[subel.attrib['name']] = _read_measurement(subel)
+ data['measurements'] = measurements
+ return data
+
+ def _read_testsuite(elem):
+ """Convert suite to JSON"""
+ assert elem.tag == 'testsuite', \
+ "Expecting 'testsuite' element instead of {}".format(elem.tag)
+
+ data = OrderedDict()
+ if 'hostname' in elem.attrib:
+ data['tester_host'] = elem.attrib['hostname']
+ data['start_time'] = isofmt_to_timestamp(elem.attrib['timestamp'])
+ data['elapsed_time'] = float(elem.attrib['time'])
+ tests = OrderedDict()
+
+ for case in elem.getchildren():
+ tests[case.attrib['name']] = _read_testcase(case)
+ data['tests'] = tests
+ return data
+
+ # Main function
+ assert elem.tag == 'testsuites', "Invalid test report format"
+ assert len(elem) == 1, "Too many testsuites"
+
+ return _read_testsuite(elem.getchildren()[0])
+
+
+def aggregate_metadata(metadata):
+ """Aggregate metadata into one, basically a sanity check"""
+ mutable_keys = ('pretty_name', 'version_id')
+
+ def aggregate_obj(aggregate, obj, assert_str=True):
+ """Aggregate objects together"""
+ assert type(aggregate) is type(obj), \
+ "Type mismatch: {} != {}".format(type(aggregate), type(obj))
+ if isinstance(obj, Mapping):
+ assert set(aggregate.keys()) == set(obj.keys())
+ for key, val in obj.items():
+ aggregate_obj(aggregate[key], val, key not in mutable_keys)
+ elif isinstance(obj, list):
+ assert len(aggregate) == len(obj)
+ for i, val in enumerate(obj):
+ aggregate_obj(aggregate[i], val)
+ elif not isinstance(obj, str) or (isinstance(obj, str) and assert_str):
+ assert aggregate == obj, "Data mismatch {} != {}".format(aggregate, obj)
+
+ if not metadata:
+ return {}
+
+ # Do the aggregation
+ aggregate = metadata[0].copy()
+ for testrun in metadata[1:]:
+ aggregate_obj(aggregate, testrun)
+ aggregate['testrun_count'] = len(metadata)
+ return aggregate
+
+
+def aggregate_data(data):
+ """Aggregate multiple test results JSON structures into one"""
+
+ mutable_keys = ('status', 'message', 'err_type', 'err_output')
+
+ class SampleList(list):
+ """Container for numerical samples"""
+ pass
+
+ def new_aggregate_obj(obj):
+ """Create new object for aggregate"""
+ if isinstance(obj, Number):
+ new_obj = SampleList()
+ new_obj.append(obj)
+ elif isinstance(obj, str):
+ new_obj = obj
+ else:
+ # Lists and and dicts are kept as is
+ new_obj = obj.__class__()
+ aggregate_obj(new_obj, obj)
+ return new_obj
+
+ def aggregate_obj(aggregate, obj, assert_str=True):
+ """Recursive "aggregation" of JSON objects"""
+ if isinstance(obj, Number):
+ assert isinstance(aggregate, SampleList)
+ aggregate.append(obj)
+ return
+
+ assert type(aggregate) == type(obj), \
+ "Type mismatch: {} != {}".format(type(aggregate), type(obj))
+ if isinstance(obj, Mapping):
+ for key, val in obj.items():
+ if not key in aggregate:
+ aggregate[key] = new_aggregate_obj(val)
+ else:
+ aggregate_obj(aggregate[key], val, key not in mutable_keys)
+ elif isinstance(obj, list):
+ for i, val in enumerate(obj):
+ if i >= len(aggregate):
+ aggregate[key] = new_aggregate_obj(val)
+ else:
+ aggregate_obj(aggregate[i], val)
+ elif isinstance(obj, str):
+ # Sanity check for data
+ if assert_str:
+ assert aggregate == obj, "Data mismatch {} != {}".format(aggregate, obj)
+ else:
+ raise Exception("BUG: unable to aggregate '{}' ({})".format(type(obj), str(obj)))
+
+ if not data:
+ return {}
+
+ # Do the aggregation
+ aggregate = data[0].__class__()
+ for testrun in data:
+ aggregate_obj(aggregate, testrun)
+ return aggregate
+
+
+class MeasurementVal(float):
+ """Base class representing measurement values"""
+ gv_data_type = 'number'
+
+ def gv_value(self):
+ """Value formatting for visualization"""
+ if self != self:
+ return "null"
+ else:
+ return self
+
+
+class TimeVal(MeasurementVal):
+ """Class representing time values"""
+ quantity = 'time'
+ gv_title = 'elapsed time'
+ gv_data_type = 'timeofday'
+
+ def hms(self):
+ """Split time into hours, minutes and seconeds"""
+ hhh = int(abs(self) / 3600)
+ mmm = int((abs(self) % 3600) / 60)
+ sss = abs(self) % 60
+ return hhh, mmm, sss
+
+ def __str__(self):
+ if self != self:
+ return "nan"
+ hh, mm, ss = self.hms()
+ sign = '-' if self < 0 else ''
+ if hh > 0:
+ return '{}{:d}:{:02d}:{:02.0f}'.format(sign, hh, mm, ss)
+ elif mm > 0:
+ return '{}{:d}:{:04.1f}'.format(sign, mm, ss)
+ elif ss > 1:
+ return '{}{:.1f} s'.format(sign, ss)
+ else:
+ return '{}{:.2f} s'.format(sign, ss)
+
+ def gv_value(self):
+ """Value formatting for visualization"""
+ if self != self:
+ return "null"
+ hh, mm, ss = self.hms()
+ return [hh, mm, int(ss), int(ss*1000) % 1000]
+
+
+class SizeVal(MeasurementVal):
+ """Class representing time values"""
+ quantity = 'size'
+ gv_title = 'size in MiB'
+ gv_data_type = 'number'
+
+ def __str__(self):
+ if self != self:
+ return "nan"
+ if abs(self) < 1024:
+ return '{:.1f} kiB'.format(self)
+ elif abs(self) < 1048576:
+ return '{:.2f} MiB'.format(self / 1024)
+ else:
+ return '{:.2f} GiB'.format(self / 1048576)
+
+ def gv_value(self):
+ """Value formatting for visualization"""
+ if self != self:
+ return "null"
+ return self / 1024
+
+def measurement_stats(meas, prefix=''):
+ """Get statistics of a measurement"""
+ if not meas:
+ return {prefix + 'sample_cnt': 0,
+ prefix + 'mean': MeasurementVal('nan'),
+ prefix + 'stdev': MeasurementVal('nan'),
+ prefix + 'variance': MeasurementVal('nan'),
+ prefix + 'min': MeasurementVal('nan'),
+ prefix + 'max': MeasurementVal('nan'),
+ prefix + 'minus': MeasurementVal('nan'),
+ prefix + 'plus': MeasurementVal('nan')}
+
+ stats = {'name': meas['name']}
+ if meas['type'] == 'sysres':
+ val_cls = TimeVal
+ values = meas['values']['elapsed_time']
+ elif meas['type'] == 'diskusage':
+ val_cls = SizeVal
+ values = meas['values']['size']
+ else:
+ raise Exception("Unknown measurement type '{}'".format(meas['type']))
+ stats['val_cls'] = val_cls
+ stats['quantity'] = val_cls.quantity
+ stats[prefix + 'sample_cnt'] = len(values)
+
+ mean_val = val_cls(mean(values))
+ min_val = val_cls(min(values))
+ max_val = val_cls(max(values))
+
+ stats[prefix + 'mean'] = mean_val
+ if len(values) > 1:
+ stats[prefix + 'stdev'] = val_cls(stdev(values))
+ stats[prefix + 'variance'] = val_cls(variance(values))
+ else:
+ stats[prefix + 'stdev'] = float('nan')
+ stats[prefix + 'variance'] = float('nan')
+ stats[prefix + 'min'] = min_val
+ stats[prefix + 'max'] = max_val
+ stats[prefix + 'minus'] = val_cls(mean_val - min_val)
+ stats[prefix + 'plus'] = val_cls(max_val - mean_val)
+
+ return stats
+
diff --git a/poky/scripts/lib/build_perf/scrape-html-report.js b/poky/scripts/lib/build_perf/scrape-html-report.js
new file mode 100644
index 000000000..05a1f5700
--- /dev/null
+++ b/poky/scripts/lib/build_perf/scrape-html-report.js
@@ -0,0 +1,56 @@
+var fs = require('fs');
+var system = require('system');
+var page = require('webpage').create();
+
+// Examine console log for message from chart drawing
+page.onConsoleMessage = function(msg) {
+ console.log(msg);
+ if (msg === "ALL CHARTS READY") {
+ window.charts_ready = true;
+ }
+ else if (msg.slice(0, 11) === "CHART READY") {
+ var chart_id = msg.split(" ")[2];
+ console.log('grabbing ' + chart_id);
+ var png_data = page.evaluate(function (chart_id) {
+ var chart_div = document.getElementById(chart_id + '_png');
+ return chart_div.outerHTML;
+ }, chart_id);
+ fs.write(args[2] + '/' + chart_id + '.png', png_data, 'w');
+ }
+};
+
+// Check command line arguments
+var args = system.args;
+if (args.length != 3) {
+ console.log("USAGE: " + args[0] + " REPORT_HTML OUT_DIR\n");
+ phantom.exit(1);
+}
+
+// Open the web page
+page.open(args[1], function(status) {
+ if (status == 'fail') {
+ console.log("Failed to open file '" + args[1] + "'");
+ phantom.exit(1);
+ }
+});
+
+// Check status every 100 ms
+interval = window.setInterval(function () {
+ //console.log('waiting');
+ if (window.charts_ready) {
+ clearTimeout(timer);
+ clearInterval(interval);
+
+ var fname = args[1].replace(/\/+$/, "").split("/").pop()
+ console.log("saving " + fname);
+ fs.write(args[2] + '/' + fname, page.content, 'w');
+ phantom.exit(0);
+ }
+}, 100);
+
+// Time-out after 10 seconds
+timer = window.setTimeout(function () {
+ clearInterval(interval);
+ console.log("ERROR: timeout");
+ phantom.exit(1);
+}, 10000);
diff --git a/poky/scripts/lib/buildstats.py b/poky/scripts/lib/buildstats.py
new file mode 100644
index 000000000..d9aadf3cb
--- /dev/null
+++ b/poky/scripts/lib/buildstats.py
@@ -0,0 +1,349 @@
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Functionality for analyzing buildstats"""
+import json
+import logging
+import os
+import re
+from collections import namedtuple,OrderedDict
+from statistics import mean
+
+
+log = logging.getLogger()
+
+
+taskdiff_fields = ('pkg', 'pkg_op', 'task', 'task_op', 'value1', 'value2',
+ 'absdiff', 'reldiff')
+TaskDiff = namedtuple('TaskDiff', ' '.join(taskdiff_fields))
+
+
+class BSError(Exception):
+ """Error handling of buildstats"""
+ pass
+
+
+class BSTask(dict):
+ def __init__(self, *args, **kwargs):
+ self['start_time'] = None
+ self['elapsed_time'] = None
+ self['status'] = None
+ self['iostat'] = {}
+ self['rusage'] = {}
+ self['child_rusage'] = {}
+ super(BSTask, self).__init__(*args, **kwargs)
+
+ @property
+ def cputime(self):
+ """Sum of user and system time taken by the task"""
+ rusage = self['rusage']['ru_stime'] + self['rusage']['ru_utime']
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return rusage + self['child_rusage']['ru_stime'] + self['child_rusage']['ru_utime']
+ else:
+ return rusage
+
+ @property
+ def walltime(self):
+ """Elapsed wall clock time"""
+ return self['elapsed_time']
+
+ @property
+ def read_bytes(self):
+ """Bytes read from the block layer"""
+ return self['iostat']['read_bytes']
+
+ @property
+ def write_bytes(self):
+ """Bytes written to the block layer"""
+ return self['iostat']['write_bytes']
+
+ @property
+ def read_ops(self):
+ """Number of read operations on the block layer"""
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return self['rusage']['ru_inblock'] + self['child_rusage']['ru_inblock']
+ else:
+ return self['rusage']['ru_inblock']
+
+ @property
+ def write_ops(self):
+ """Number of write operations on the block layer"""
+ if self['child_rusage']:
+ # Child rusage may have been optimized out
+ return self['rusage']['ru_oublock'] + self['child_rusage']['ru_oublock']
+ else:
+ return self['rusage']['ru_oublock']
+
+ @classmethod
+ def from_file(cls, buildstat_file):
+ """Read buildstat text file"""
+ bs_task = cls()
+ log.debug("Reading task buildstats from %s", buildstat_file)
+ end_time = None
+ with open(buildstat_file) as fobj:
+ for line in fobj.readlines():
+ key, val = line.split(':', 1)
+ val = val.strip()
+ if key == 'Started':
+ start_time = float(val)
+ bs_task['start_time'] = start_time
+ elif key == 'Ended':
+ end_time = float(val)
+ elif key.startswith('IO '):
+ split = key.split()
+ bs_task['iostat'][split[1]] = int(val)
+ elif key.find('rusage') >= 0:
+ split = key.split()
+ ru_key = split[-1]
+ if ru_key in ('ru_stime', 'ru_utime'):
+ val = float(val)
+ else:
+ val = int(val)
+ ru_type = 'rusage' if split[0] == 'rusage' else \
+ 'child_rusage'
+ bs_task[ru_type][ru_key] = val
+ elif key == 'Status':
+ bs_task['status'] = val
+ if end_time is not None and start_time is not None:
+ bs_task['elapsed_time'] = end_time - start_time
+ else:
+ raise BSError("{} looks like a invalid buildstats file".format(buildstat_file))
+ return bs_task
+
+
+class BSTaskAggregate(object):
+ """Class representing multiple runs of the same task"""
+ properties = ('cputime', 'walltime', 'read_bytes', 'write_bytes',
+ 'read_ops', 'write_ops')
+
+ def __init__(self, tasks=None):
+ self._tasks = tasks or []
+ self._properties = {}
+
+ def __getattr__(self, name):
+ if name in self.properties:
+ if name not in self._properties:
+ # Calculate properties on demand only. We only provide mean
+ # value, so far
+ self._properties[name] = mean([getattr(t, name) for t in self._tasks])
+ return self._properties[name]
+ else:
+ raise AttributeError("'BSTaskAggregate' has no attribute '{}'".format(name))
+
+ def append(self, task):
+ """Append new task"""
+ # Reset pre-calculated properties
+ assert isinstance(task, BSTask), "Type is '{}' instead of 'BSTask'".format(type(task))
+ self._properties = {}
+ self._tasks.append(task)
+
+
+class BSRecipe(object):
+ """Class representing buildstats of one recipe"""
+ def __init__(self, name, epoch, version, revision):
+ self.name = name
+ self.epoch = epoch
+ self.version = version
+ self.revision = revision
+ if epoch is None:
+ self.evr = "{}-{}".format(version, revision)
+ else:
+ self.evr = "{}_{}-{}".format(epoch, version, revision)
+ self.tasks = {}
+
+ def aggregate(self, bsrecipe):
+ """Aggregate data of another recipe buildstats"""
+ if self.nevr != bsrecipe.nevr:
+ raise ValueError("Refusing to aggregate buildstats, recipe version "
+ "differs: {} vs. {}".format(self.nevr, bsrecipe.nevr))
+ if set(self.tasks.keys()) != set(bsrecipe.tasks.keys()):
+ raise ValueError("Refusing to aggregate buildstats, set of tasks "
+ "in {} differ".format(self.name))
+
+ for taskname, taskdata in bsrecipe.tasks.items():
+ if not isinstance(self.tasks[taskname], BSTaskAggregate):
+ self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]])
+ self.tasks[taskname].append(taskdata)
+
+ @property
+ def nevr(self):
+ return self.name + '-' + self.evr
+
+
+class BuildStats(dict):
+ """Class representing buildstats of one build"""
+
+ @property
+ def num_tasks(self):
+ """Get number of tasks"""
+ num = 0
+ for recipe in self.values():
+ num += len(recipe.tasks)
+ return num
+
+ @classmethod
+ def from_json(cls, bs_json):
+ """Create new BuildStats object from JSON object"""
+ buildstats = cls()
+ for recipe in bs_json:
+ if recipe['name'] in buildstats:
+ raise BSError("Cannot handle multiple versions of the same "
+ "package ({})".format(recipe['name']))
+ bsrecipe = BSRecipe(recipe['name'], recipe['epoch'],
+ recipe['version'], recipe['revision'])
+ for task, data in recipe['tasks'].items():
+ bsrecipe.tasks[task] = BSTask(data)
+
+ buildstats[recipe['name']] = bsrecipe
+
+ return buildstats
+
+ @staticmethod
+ def from_file_json(path):
+ """Load buildstats from a JSON file"""
+ with open(path) as fobj:
+ bs_json = json.load(fobj)
+ return BuildStats.from_json(bs_json)
+
+
+ @staticmethod
+ def split_nevr(nevr):
+ """Split name and version information from recipe "nevr" string"""
+ n_e_v, revision = nevr.rsplit('-', 1)
+ match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[0-9]\S*)$',
+ n_e_v)
+ if not match:
+ # If we're not able to parse a version starting with a number, just
+ # take the part after last dash
+ match = re.match(r'^(?P<name>\S+)-((?P<epoch>[0-9]{1,5})_)?(?P<version>[^-]+)$',
+ n_e_v)
+ name = match.group('name')
+ version = match.group('version')
+ epoch = match.group('epoch')
+ return name, epoch, version, revision
+
+ @classmethod
+ def from_dir(cls, path):
+ """Load buildstats from a buildstats directory"""
+ if not os.path.isfile(os.path.join(path, 'build_stats')):
+ raise BSError("{} does not look like a buildstats directory".format(path))
+
+ log.debug("Reading buildstats directory %s", path)
+
+ buildstats = cls()
+ subdirs = os.listdir(path)
+ for dirname in subdirs:
+ recipe_dir = os.path.join(path, dirname)
+ if not os.path.isdir(recipe_dir):
+ continue
+ name, epoch, version, revision = cls.split_nevr(dirname)
+ bsrecipe = BSRecipe(name, epoch, version, revision)
+ for task in os.listdir(recipe_dir):
+ bsrecipe.tasks[task] = BSTask.from_file(
+ os.path.join(recipe_dir, task))
+ if name in buildstats:
+ raise BSError("Cannot handle multiple versions of the same "
+ "package ({})".format(name))
+ buildstats[name] = bsrecipe
+
+ return buildstats
+
+ def aggregate(self, buildstats):
+ """Aggregate other buildstats into this"""
+ if set(self.keys()) != set(buildstats.keys()):
+ raise ValueError("Refusing to aggregate buildstats, set of "
+ "recipes is different")
+ for pkg, data in buildstats.items():
+ self[pkg].aggregate(data)
+
+
+def diff_buildstats(bs1, bs2, stat_attr, min_val=None, min_absdiff=None):
+ """Compare the tasks of two buildstats"""
+ tasks_diff = []
+ pkgs = set(bs1.keys()).union(set(bs2.keys()))
+ for pkg in pkgs:
+ tasks1 = bs1[pkg].tasks if pkg in bs1 else {}
+ tasks2 = bs2[pkg].tasks if pkg in bs2 else {}
+ if not tasks1:
+ pkg_op = '+'
+ elif not tasks2:
+ pkg_op = '-'
+ else:
+ pkg_op = ' '
+
+ for task in set(tasks1.keys()).union(set(tasks2.keys())):
+ task_op = ' '
+ if task in tasks1:
+ val1 = getattr(bs1[pkg].tasks[task], stat_attr)
+ else:
+ task_op = '+'
+ val1 = 0
+ if task in tasks2:
+ val2 = getattr(bs2[pkg].tasks[task], stat_attr)
+ else:
+ val2 = 0
+ task_op = '-'
+
+ if val1 == 0:
+ reldiff = float('inf')
+ else:
+ reldiff = 100 * (val2 - val1) / val1
+
+ if min_val and max(val1, val2) < min_val:
+ log.debug("Filtering out %s:%s (%s)", pkg, task,
+ max(val1, val2))
+ continue
+ if min_absdiff and abs(val2 - val1) < min_absdiff:
+ log.debug("Filtering out %s:%s (difference of %s)", pkg, task,
+ val2-val1)
+ continue
+ tasks_diff.append(TaskDiff(pkg, pkg_op, task, task_op, val1, val2,
+ val2-val1, reldiff))
+ return tasks_diff
+
+
+class BSVerDiff(object):
+ """Class representing recipe version differences between two buildstats"""
+ def __init__(self, bs1, bs2):
+ RecipeVerDiff = namedtuple('RecipeVerDiff', 'left right')
+
+ recipes1 = set(bs1.keys())
+ recipes2 = set(bs2.keys())
+
+ self.new = dict([(r, bs2[r]) for r in sorted(recipes2 - recipes1)])
+ self.dropped = dict([(r, bs1[r]) for r in sorted(recipes1 - recipes2)])
+ self.echanged = {}
+ self.vchanged = {}
+ self.rchanged = {}
+ self.unchanged = {}
+ self.empty_diff = False
+
+ common = recipes2.intersection(recipes1)
+ if common:
+ for recipe in common:
+ rdiff = RecipeVerDiff(bs1[recipe], bs2[recipe])
+ if bs1[recipe].epoch != bs2[recipe].epoch:
+ self.echanged[recipe] = rdiff
+ elif bs1[recipe].version != bs2[recipe].version:
+ self.vchanged[recipe] = rdiff
+ elif bs1[recipe].revision != bs2[recipe].revision:
+ self.rchanged[recipe] = rdiff
+ else:
+ self.unchanged[recipe] = rdiff
+
+ if len(recipes1) == len(recipes2) == len(self.unchanged):
+ self.empty_diff = True
+
+ def __bool__(self):
+ return not self.empty_diff
diff --git a/poky/scripts/lib/checklayer/__init__.py b/poky/scripts/lib/checklayer/__init__.py
new file mode 100644
index 000000000..2618416fa
--- /dev/null
+++ b/poky/scripts/lib/checklayer/__init__.py
@@ -0,0 +1,394 @@
+# Yocto Project layer check tool
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import re
+import subprocess
+from enum import Enum
+
+import bb.tinfoil
+
+class LayerType(Enum):
+ BSP = 0
+ DISTRO = 1
+ SOFTWARE = 2
+ ERROR_NO_LAYER_CONF = 98
+ ERROR_BSP_DISTRO = 99
+
+def _get_configurations(path):
+ configs = []
+
+ for f in os.listdir(path):
+ file_path = os.path.join(path, f)
+ if os.path.isfile(file_path) and f.endswith('.conf'):
+ configs.append(f[:-5]) # strip .conf
+ return configs
+
+def _get_layer_collections(layer_path, lconf=None, data=None):
+ import bb.parse
+ import bb.data
+
+ if lconf is None:
+ lconf = os.path.join(layer_path, 'conf', 'layer.conf')
+
+ if data is None:
+ ldata = bb.data.init()
+ bb.parse.init_parser(ldata)
+ else:
+ ldata = data.createCopy()
+
+ ldata.setVar('LAYERDIR', layer_path)
+ try:
+ ldata = bb.parse.handle(lconf, ldata, include=True)
+ except:
+ raise RuntimeError("Parsing of layer.conf from layer: %s failed" % layer_path)
+ ldata.expandVarref('LAYERDIR')
+
+ collections = (ldata.getVar('BBFILE_COLLECTIONS') or '').split()
+ if not collections:
+ name = os.path.basename(layer_path)
+ collections = [name]
+
+ collections = {c: {} for c in collections}
+ for name in collections:
+ priority = ldata.getVar('BBFILE_PRIORITY_%s' % name)
+ pattern = ldata.getVar('BBFILE_PATTERN_%s' % name)
+ depends = ldata.getVar('LAYERDEPENDS_%s' % name)
+ compat = ldata.getVar('LAYERSERIES_COMPAT_%s' % name)
+ collections[name]['priority'] = priority
+ collections[name]['pattern'] = pattern
+ collections[name]['depends'] = depends
+ collections[name]['compat'] = compat
+
+ return collections
+
+def _detect_layer(layer_path):
+ """
+ Scans layer directory to detect what type of layer
+ is BSP, Distro or Software.
+
+ Returns a dictionary with layer name, type and path.
+ """
+
+ layer = {}
+ layer_name = os.path.basename(layer_path)
+
+ layer['name'] = layer_name
+ layer['path'] = layer_path
+ layer['conf'] = {}
+
+ if not os.path.isfile(os.path.join(layer_path, 'conf', 'layer.conf')):
+ layer['type'] = LayerType.ERROR_NO_LAYER_CONF
+ return layer
+
+ machine_conf = os.path.join(layer_path, 'conf', 'machine')
+ distro_conf = os.path.join(layer_path, 'conf', 'distro')
+
+ is_bsp = False
+ is_distro = False
+
+ if os.path.isdir(machine_conf):
+ machines = _get_configurations(machine_conf)
+ if machines:
+ is_bsp = True
+
+ if os.path.isdir(distro_conf):
+ distros = _get_configurations(distro_conf)
+ if distros:
+ is_distro = True
+
+ if is_bsp and is_distro:
+ layer['type'] = LayerType.ERROR_BSP_DISTRO
+ elif is_bsp:
+ layer['type'] = LayerType.BSP
+ layer['conf']['machines'] = machines
+ elif is_distro:
+ layer['type'] = LayerType.DISTRO
+ layer['conf']['distros'] = distros
+ else:
+ layer['type'] = LayerType.SOFTWARE
+
+ layer['collections'] = _get_layer_collections(layer['path'])
+
+ return layer
+
+def detect_layers(layer_directories, no_auto):
+ layers = []
+
+ for directory in layer_directories:
+ directory = os.path.realpath(directory)
+ if directory[-1] == '/':
+ directory = directory[0:-1]
+
+ if no_auto:
+ conf_dir = os.path.join(directory, 'conf')
+ if os.path.isdir(conf_dir):
+ layer = _detect_layer(directory)
+ if layer:
+ layers.append(layer)
+ else:
+ for root, dirs, files in os.walk(directory):
+ dir_name = os.path.basename(root)
+ conf_dir = os.path.join(root, 'conf')
+ if os.path.isdir(conf_dir):
+ layer = _detect_layer(root)
+ if layer:
+ layers.append(layer)
+
+ return layers
+
+def _find_layer_depends(depend, layers):
+ for layer in layers:
+ for collection in layer['collections']:
+ if depend == collection:
+ return layer
+ return None
+
+def add_layer_dependencies(bblayersconf, layer, layers, logger):
+ def recurse_dependencies(depends, layer, layers, logger, ret = []):
+ logger.debug('Processing dependencies %s for layer %s.' % \
+ (depends, layer['name']))
+
+ for depend in depends.split():
+ # core (oe-core) is suppose to be provided
+ if depend == 'core':
+ continue
+
+ layer_depend = _find_layer_depends(depend, layers)
+ if not layer_depend:
+ logger.error('Layer %s depends on %s and isn\'t found.' % \
+ (layer['name'], depend))
+ ret = None
+ continue
+
+ # We keep processing, even if ret is None, this allows us to report
+ # multiple errors at once
+ if ret is not None and layer_depend not in ret:
+ ret.append(layer_depend)
+
+ # Recursively process...
+ if 'collections' not in layer_depend:
+ continue
+
+ for collection in layer_depend['collections']:
+ collect_deps = layer_depend['collections'][collection]['depends']
+ if not collect_deps:
+ continue
+ ret = recurse_dependencies(collect_deps, layer_depend, layers, logger, ret)
+
+ return ret
+
+ layer_depends = []
+ for collection in layer['collections']:
+ depends = layer['collections'][collection]['depends']
+ if not depends:
+ continue
+
+ layer_depends = recurse_dependencies(depends, layer, layers, logger, layer_depends)
+
+ # Note: [] (empty) is allowed, None is not!
+ if layer_depends is None:
+ return False
+ else:
+ # Don't add a layer that is already present.
+ added = set()
+ output = check_command('Getting existing layers failed.', 'bitbake-layers show-layers').decode('utf-8')
+ for layer, path, pri in re.findall(r'^(\S+) +([^\n]*?) +(\d+)$', output, re.MULTILINE):
+ added.add(path)
+
+ for layer_depend in layer_depends:
+ name = layer_depend['name']
+ path = layer_depend['path']
+ if path in added:
+ continue
+ else:
+ added.add(path)
+ logger.info('Adding layer dependency %s' % name)
+ with open(bblayersconf, 'a+') as f:
+ f.write("\nBBLAYERS += \"%s\"\n" % path)
+ return True
+
+def add_layer(bblayersconf, layer, layers, logger):
+ logger.info('Adding layer %s' % layer['name'])
+ with open(bblayersconf, 'a+') as f:
+ f.write("\nBBLAYERS += \"%s\"\n" % layer['path'])
+
+ return True
+
+def check_command(error_msg, cmd):
+ '''
+ Run a command under a shell, capture stdout and stderr in a single stream,
+ throw an error when command returns non-zero exit code. Returns the output.
+ '''
+
+ p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ output, _ = p.communicate()
+ if p.returncode:
+ msg = "%s\nCommand: %s\nOutput:\n%s" % (error_msg, cmd, output.decode('utf-8'))
+ raise RuntimeError(msg)
+ return output
+
+def get_signatures(builddir, failsafe=False, machine=None):
+ import re
+
+ # some recipes needs to be excluded like meta-world-pkgdata
+ # because a layer can add recipes to a world build so signature
+ # will be change
+ exclude_recipes = ('meta-world-pkgdata',)
+
+ sigs = {}
+ tune2tasks = {}
+
+ cmd = ''
+ if machine:
+ cmd += 'MACHINE=%s ' % machine
+ cmd += 'bitbake '
+ if failsafe:
+ cmd += '-k '
+ cmd += '-S none world'
+ sigs_file = os.path.join(builddir, 'locked-sigs.inc')
+ if os.path.exists(sigs_file):
+ os.unlink(sigs_file)
+ try:
+ check_command('Generating signatures failed. This might be due to some parse error and/or general layer incompatibilities.',
+ cmd)
+ except RuntimeError as ex:
+ if failsafe and os.path.exists(sigs_file):
+ # Ignore the error here. Most likely some recipes active
+ # in a world build lack some dependencies. There is a
+ # separate test_machine_world_build which exposes the
+ # failure.
+ pass
+ else:
+ raise
+
+ sig_regex = re.compile("^(?P<task>.*:.*):(?P<hash>.*) .$")
+ tune_regex = re.compile("(^|\s)SIGGEN_LOCKEDSIGS_t-(?P<tune>\S*)\s*=\s*")
+ current_tune = None
+ with open(sigs_file, 'r') as f:
+ for line in f.readlines():
+ line = line.strip()
+ t = tune_regex.search(line)
+ if t:
+ current_tune = t.group('tune')
+ s = sig_regex.match(line)
+ if s:
+ exclude = False
+ for er in exclude_recipes:
+ (recipe, task) = s.group('task').split(':')
+ if er == recipe:
+ exclude = True
+ break
+ if exclude:
+ continue
+
+ sigs[s.group('task')] = s.group('hash')
+ tune2tasks.setdefault(current_tune, []).append(s.group('task'))
+
+ if not sigs:
+ raise RuntimeError('Can\'t load signatures from %s' % sigs_file)
+
+ return (sigs, tune2tasks)
+
+def get_depgraph(targets=['world'], failsafe=False):
+ '''
+ Returns the dependency graph for the given target(s).
+ The dependency graph is taken directly from DepTreeEvent.
+ '''
+ depgraph = None
+ with bb.tinfoil.Tinfoil() as tinfoil:
+ tinfoil.prepare(config_only=False)
+ tinfoil.set_event_mask(['bb.event.NoProvider', 'bb.event.DepTreeGenerated', 'bb.command.CommandCompleted'])
+ if not tinfoil.run_command('generateDepTreeEvent', targets, 'do_build'):
+ raise RuntimeError('starting generateDepTreeEvent failed')
+ while True:
+ event = tinfoil.wait_event(timeout=1000)
+ if event:
+ if isinstance(event, bb.command.CommandFailed):
+ raise RuntimeError('Generating dependency information failed: %s' % event.error)
+ elif isinstance(event, bb.command.CommandCompleted):
+ break
+ elif isinstance(event, bb.event.NoProvider):
+ if failsafe:
+ # The event is informational, we will get information about the
+ # remaining dependencies eventually and thus can ignore this
+ # here like we do in get_signatures(), if desired.
+ continue
+ if event._reasons:
+ raise RuntimeError('Nothing provides %s: %s' % (event._item, event._reasons))
+ else:
+ raise RuntimeError('Nothing provides %s.' % (event._item))
+ elif isinstance(event, bb.event.DepTreeGenerated):
+ depgraph = event._depgraph
+
+ if depgraph is None:
+ raise RuntimeError('Could not retrieve the depgraph.')
+ return depgraph
+
+def compare_signatures(old_sigs, curr_sigs):
+ '''
+ Compares the result of two get_signatures() calls. Returns None if no
+ problems found, otherwise a string that can be used as additional
+ explanation in self.fail().
+ '''
+ # task -> (old signature, new signature)
+ sig_diff = {}
+ for task in old_sigs:
+ if task in curr_sigs and \
+ old_sigs[task] != curr_sigs[task]:
+ sig_diff[task] = (old_sigs[task], curr_sigs[task])
+
+ if not sig_diff:
+ return None
+
+ # Beware, depgraph uses task=<pn>.<taskname> whereas get_signatures()
+ # uses <pn>:<taskname>. Need to convert sometimes. The output follows
+ # the convention from get_signatures() because that seems closer to
+ # normal bitbake output.
+ def sig2graph(task):
+ pn, taskname = task.rsplit(':', 1)
+ return pn + '.' + taskname
+ def graph2sig(task):
+ pn, taskname = task.rsplit('.', 1)
+ return pn + ':' + taskname
+ depgraph = get_depgraph(failsafe=True)
+ depends = depgraph['tdepends']
+
+ # If a task A has a changed signature, but none of its
+ # dependencies, then we need to report it because it is
+ # the one which introduces a change. Any task depending on
+ # A (directly or indirectly) will also have a changed
+ # signature, but we don't need to report it. It might have
+ # its own changes, which will become apparent once the
+ # issues that we do report are fixed and the test gets run
+ # again.
+ sig_diff_filtered = []
+ for task, (old_sig, new_sig) in sig_diff.items():
+ deps_tainted = False
+ for dep in depends.get(sig2graph(task), ()):
+ if graph2sig(dep) in sig_diff:
+ deps_tainted = True
+ break
+ if not deps_tainted:
+ sig_diff_filtered.append((task, old_sig, new_sig))
+
+ msg = []
+ msg.append('%d signatures changed, initial differences (first hash before, second after):' %
+ len(sig_diff))
+ for diff in sorted(sig_diff_filtered):
+ recipe, taskname = diff[0].rsplit(':', 1)
+ cmd = 'bitbake-diffsigs --task %s %s --signature %s %s' % \
+ (recipe, taskname, diff[1], diff[2])
+ msg.append(' %s: %s -> %s' % diff)
+ msg.append(' %s' % cmd)
+ try:
+ output = check_command('Determining signature difference failed.',
+ cmd).decode('utf-8')
+ except RuntimeError as error:
+ output = str(error)
+ if output:
+ msg.extend([' ' + line for line in output.splitlines()])
+ msg.append('')
+ return '\n'.join(msg)
diff --git a/poky/scripts/lib/checklayer/case.py b/poky/scripts/lib/checklayer/case.py
new file mode 100644
index 000000000..9dd00412e
--- /dev/null
+++ b/poky/scripts/lib/checklayer/case.py
@@ -0,0 +1,7 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+from oeqa.core.case import OETestCase
+
+class OECheckLayerTestCase(OETestCase):
+ pass
diff --git a/poky/scripts/lib/checklayer/cases/__init__.py b/poky/scripts/lib/checklayer/cases/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/scripts/lib/checklayer/cases/__init__.py
diff --git a/poky/scripts/lib/checklayer/cases/bsp.py b/poky/scripts/lib/checklayer/cases/bsp.py
new file mode 100644
index 000000000..b6b611be7
--- /dev/null
+++ b/poky/scripts/lib/checklayer/cases/bsp.py
@@ -0,0 +1,204 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from checklayer import LayerType, get_signatures, check_command, get_depgraph
+from checklayer.case import OECheckLayerTestCase
+
+class BSPCheckLayer(OECheckLayerTestCase):
+ @classmethod
+ def setUpClass(self):
+ if self.tc.layer['type'] != LayerType.BSP:
+ raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." %\
+ self.tc.layer['name'])
+
+ def test_bsp_defines_machines(self):
+ self.assertTrue(self.tc.layer['conf']['machines'],
+ "Layer is BSP but doesn't defines machines.")
+
+ def test_bsp_no_set_machine(self):
+ from oeqa.utils.commands import get_bb_var
+
+ machine = get_bb_var('MACHINE')
+ self.assertEqual(self.td['bbvars']['MACHINE'], machine,
+ msg="Layer %s modified machine %s -> %s" % \
+ (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine))
+
+
+ def test_machine_world(self):
+ '''
+ "bitbake world" is expected to work regardless which machine is selected.
+ BSP layers sometimes break that by enabling a recipe for a certain machine
+ without checking whether that recipe actually can be built in the current
+ distro configuration (for example, OpenGL might not enabled).
+
+ This test iterates over all machines. It would be nicer to instantiate
+ it once per machine. It merely checks for errors during parse
+ time. It does not actually attempt to build anything.
+ '''
+
+ if not self.td['machines']:
+ self.skipTest('No machines set with --machines.')
+ msg = []
+ for machine in self.td['machines']:
+ # In contrast to test_machine_signatures() below, errors are fatal here.
+ try:
+ get_signatures(self.td['builddir'], failsafe=False, machine=machine)
+ except RuntimeError as ex:
+ msg.append(str(ex))
+ if msg:
+ msg.insert(0, 'The following machines broke a world build:')
+ self.fail('\n'.join(msg))
+
+ def test_machine_signatures(self):
+ '''
+ Selecting a machine may only affect the signature of tasks that are specific
+ to that machine. In other words, when MACHINE=A and MACHINE=B share a recipe
+ foo and the output of foo, then both machine configurations must build foo
+ in exactly the same way. Otherwise it is not possible to use both machines
+ in the same distribution.
+
+ This criteria can only be tested by testing different machines in combination,
+ i.e. one main layer, potentially several additional BSP layers and an explicit
+ choice of machines:
+ yocto-check-layer --additional-layers .../meta-intel --machines intel-corei7-64 imx6slevk -- .../meta-freescale
+ '''
+
+ if not self.td['machines']:
+ self.skipTest('No machines set with --machines.')
+
+ # Collect signatures for all machines that we are testing
+ # and merge that into a hash:
+ # tune -> task -> signature -> list of machines with that combination
+ #
+ # It is an error if any tune/task pair has more than one signature,
+ # because that implies that the machines that caused those different
+ # signatures do not agree on how to execute the task.
+ tunes = {}
+ # Preserve ordering of machines as chosen by the user.
+ for machine in self.td['machines']:
+ curr_sigs, tune2tasks = get_signatures(self.td['builddir'], failsafe=True, machine=machine)
+ # Invert the tune -> [tasks] mapping.
+ tasks2tune = {}
+ for tune, tasks in tune2tasks.items():
+ for task in tasks:
+ tasks2tune[task] = tune
+ for task, sighash in curr_sigs.items():
+ tunes.setdefault(tasks2tune[task], {}).setdefault(task, {}).setdefault(sighash, []).append(machine)
+
+ msg = []
+ pruned = 0
+ last_line_key = None
+ # do_fetch, do_unpack, ..., do_build
+ taskname_list = []
+ if tunes:
+ # The output below is most useful when we start with tasks that are at
+ # the bottom of the dependency chain, i.e. those that run first. If
+ # those tasks differ, the rest also does.
+ #
+ # To get an ordering of tasks, we do a topological sort of the entire
+ # depgraph for the base configuration, then on-the-fly flatten that list by stripping
+ # out the recipe names and removing duplicates. The base configuration
+ # is not necessarily representative, but should be close enough. Tasks
+ # that were not encountered get a default priority.
+ depgraph = get_depgraph()
+ depends = depgraph['tdepends']
+ WHITE = 1
+ GRAY = 2
+ BLACK = 3
+ color = {}
+ found = set()
+ def visit(task):
+ color[task] = GRAY
+ for dep in depends.get(task, ()):
+ if color.setdefault(dep, WHITE) == WHITE:
+ visit(dep)
+ color[task] = BLACK
+ pn, taskname = task.rsplit('.', 1)
+ if taskname not in found:
+ taskname_list.append(taskname)
+ found.add(taskname)
+ for task in depends.keys():
+ if color.setdefault(task, WHITE) == WHITE:
+ visit(task)
+
+ taskname_order = dict([(task, index) for index, task in enumerate(taskname_list) ])
+ def task_key(task):
+ pn, taskname = task.rsplit(':', 1)
+ return (pn, taskname_order.get(taskname, len(taskname_list)), taskname)
+
+ for tune in sorted(tunes.keys()):
+ tasks = tunes[tune]
+ # As for test_signatures it would be nicer to sort tasks
+ # by dependencies here, but that is harder because we have
+ # to report on tasks from different machines, which might
+ # have different dependencies. We resort to pruning the
+ # output by reporting only one task per recipe if the set
+ # of machines matches.
+ #
+ # "bitbake-diffsigs -t -s" is intelligent enough to print
+ # diffs recursively, so often it does not matter that much
+ # if we don't pick the underlying difference
+ # here. However, sometimes recursion fails
+ # (https://bugzilla.yoctoproject.org/show_bug.cgi?id=6428).
+ #
+ # To mitigate that a bit, we use a hard-coded ordering of
+ # tasks that represents how they normally run and prefer
+ # to print the ones that run first.
+ for task in sorted(tasks.keys(), key=task_key):
+ signatures = tasks[task]
+ # do_build can be ignored: it is know to have
+ # different signatures in some cases, for example in
+ # the allarch ca-certificates due to RDEPENDS=openssl.
+ # That particular dependency is whitelisted via
+ # SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS, but still shows up
+ # in the sstate signature hash because filtering it
+ # out would be hard and running do_build multiple
+ # times doesn't really matter.
+ if len(signatures.keys()) > 1 and \
+ not task.endswith(':do_build'):
+ # Error!
+ #
+ # Sort signatures by machines, because the hex values don't mean anything.
+ # => all-arch adwaita-icon-theme:do_build: 1234... (beaglebone, qemux86) != abcdf... (qemux86-64)
+ #
+ # Skip the line if it is covered already by the predecessor (same pn, same sets of machines).
+ pn, taskname = task.rsplit(':', 1)
+ next_line_key = (pn, sorted(signatures.values()))
+ if next_line_key != last_line_key:
+ line = ' %s %s: ' % (tune, task)
+ line += ' != '.join(['%s (%s)' % (signature, ', '.join([m for m in signatures[signature]])) for
+ signature in sorted(signatures.keys(), key=lambda s: signatures[s])])
+ last_line_key = next_line_key
+ msg.append(line)
+ # Randomly pick two mismatched signatures and remember how to invoke
+ # bitbake-diffsigs for them.
+ iterator = iter(signatures.items())
+ a = next(iterator)
+ b = next(iterator)
+ diffsig_machines = '(%s) != (%s)' % (', '.join(a[1]), ', '.join(b[1]))
+ diffsig_params = '-t %s %s -s %s %s' % (pn, taskname, a[0], b[0])
+ else:
+ pruned += 1
+
+ if msg:
+ msg.insert(0, 'The machines have conflicting signatures for some shared tasks:')
+ if pruned > 0:
+ msg.append('')
+ msg.append('%d tasks where not listed because some other task of the recipe already differed.' % pruned)
+ msg.append('It is likely that differences from different recipes also have the same root cause.')
+ msg.append('')
+ # Explain how to investigate...
+ msg.append('To investigate, run bitbake-diffsigs -t recipename taskname -s fromsig tosig.')
+ cmd = 'bitbake-diffsigs %s' % diffsig_params
+ msg.append('Example: %s in the last line' % diffsig_machines)
+ msg.append('Command: %s' % cmd)
+ # ... and actually do it automatically for that example, but without aborting
+ # when that fails.
+ try:
+ output = check_command('Comparing signatures failed.', cmd).decode('utf-8')
+ except RuntimeError as ex:
+ output = str(ex)
+ msg.extend([' ' + line for line in output.splitlines()])
+ self.fail('\n'.join(msg))
diff --git a/poky/scripts/lib/checklayer/cases/common.py b/poky/scripts/lib/checklayer/cases/common.py
new file mode 100644
index 000000000..1bef61b04
--- /dev/null
+++ b/poky/scripts/lib/checklayer/cases/common.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import glob
+import os
+import unittest
+from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures
+from checklayer.case import OECheckLayerTestCase
+
+class CommonCheckLayer(OECheckLayerTestCase):
+ def test_readme(self):
+ # The top-level README file may have a suffix (like README.rst or README.txt).
+ readme_files = glob.glob(os.path.join(self.tc.layer['path'], 'README*'))
+ self.assertTrue(len(readme_files) > 0,
+ msg="Layer doesn't contains README file.")
+
+ # There might be more than one file matching the file pattern above
+ # (for example, README.rst and README-COPYING.rst). The one with the shortest
+ # name is considered the "main" one.
+ readme_file = sorted(readme_files)[0]
+ data = ''
+ with open(readme_file, 'r') as f:
+ data = f.read()
+ self.assertTrue(data,
+ msg="Layer contains a README file but it is empty.")
+
+ def test_parse(self):
+ check_command('Layer %s failed to parse.' % self.tc.layer['name'],
+ 'bitbake -p')
+
+ def test_show_environment(self):
+ check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
+ 'bitbake -e')
+
+ def test_world(self):
+ '''
+ "bitbake world" is expected to work. test_signatures does not cover that
+ because it is more lenient and ignores recipes in a world build that
+ are not actually buildable, so here we fail when "bitbake -S none world"
+ fails.
+ '''
+ get_signatures(self.td['builddir'], failsafe=False)
+
+ def test_signatures(self):
+ if self.tc.layer['type'] == LayerType.SOFTWARE and \
+ not self.tc.test_software_layer_signatures:
+ raise unittest.SkipTest("Not testing for signature changes in a software layer %s." \
+ % self.tc.layer['name'])
+
+ curr_sigs, _ = get_signatures(self.td['builddir'], failsafe=True)
+ msg = compare_signatures(self.td['sigs'], curr_sigs)
+ if msg is not None:
+ self.fail('Adding layer %s changed signatures.\n%s' % (self.tc.layer['name'], msg))
+
+ def test_layerseries_compat(self):
+ for collection_name, collection_data in self.tc.layer['collections'].items():
+ self.assertTrue(collection_data['compat'], "Collection %s from layer %s does not set compatible oe-core versions via LAYERSERIES_COMPAT_collection." \
+ % (collection_name, self.tc.layer['name']))
diff --git a/poky/scripts/lib/checklayer/cases/distro.py b/poky/scripts/lib/checklayer/cases/distro.py
new file mode 100644
index 000000000..df1b3035e
--- /dev/null
+++ b/poky/scripts/lib/checklayer/cases/distro.py
@@ -0,0 +1,26 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import unittest
+
+from checklayer import LayerType
+from checklayer.case import OECheckLayerTestCase
+
+class DistroCheckLayer(OECheckLayerTestCase):
+ @classmethod
+ def setUpClass(self):
+ if self.tc.layer['type'] != LayerType.DISTRO:
+ raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\
+ self.tc.layer['name'])
+
+ def test_distro_defines_distros(self):
+ self.assertTrue(self.tc.layer['conf']['distros'],
+ "Layer is BSP but doesn't defines machines.")
+
+ def test_distro_no_set_distros(self):
+ from oeqa.utils.commands import get_bb_var
+
+ distro = get_bb_var('DISTRO')
+ self.assertEqual(self.td['bbvars']['DISTRO'], distro,
+ msg="Layer %s modified distro %s -> %s" % \
+ (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))
diff --git a/poky/scripts/lib/checklayer/context.py b/poky/scripts/lib/checklayer/context.py
new file mode 100644
index 000000000..1bec2c410
--- /dev/null
+++ b/poky/scripts/lib/checklayer/context.py
@@ -0,0 +1,15 @@
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import glob
+import re
+
+from oeqa.core.context import OETestContext
+
+class CheckLayerTestContext(OETestContext):
+ def __init__(self, td=None, logger=None, layer=None, test_software_layer_signatures=True):
+ super(CheckLayerTestContext, self).__init__(td, logger)
+ self.layer = layer
+ self.test_software_layer_signatures = test_software_layer_signatures
diff --git a/poky/scripts/lib/devtool/__init__.py b/poky/scripts/lib/devtool/__init__.py
new file mode 100644
index 000000000..89f098a91
--- /dev/null
+++ b/poky/scripts/lib/devtool/__init__.py
@@ -0,0 +1,383 @@
+#!/usr/bin/env python3
+
+# Development tool - utility functions for plugins
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool plugins module"""
+
+import os
+import sys
+import subprocess
+import logging
+import re
+import codecs
+
+logger = logging.getLogger('devtool')
+
+class DevtoolError(Exception):
+ """Exception for handling devtool errors"""
+ def __init__(self, message, exitcode=1):
+ super(DevtoolError, self).__init__(message)
+ self.exitcode = exitcode
+
+
+def exec_build_env_command(init_path, builddir, cmd, watch=False, **options):
+ """Run a program in bitbake build context"""
+ import bb
+ if not 'cwd' in options:
+ options["cwd"] = builddir
+ if init_path:
+ # As the OE init script makes use of BASH_SOURCE to determine OEROOT,
+ # and can't determine it when running under dash, we need to set
+ # the executable to bash to correctly set things up
+ if not 'executable' in options:
+ options['executable'] = 'bash'
+ logger.debug('Executing command: "%s" using init path %s' % (cmd, init_path))
+ init_prefix = '. %s %s > /dev/null && ' % (init_path, builddir)
+ else:
+ logger.debug('Executing command "%s"' % cmd)
+ init_prefix = ''
+ if watch:
+ if sys.stdout.isatty():
+ # Fool bitbake into thinking it's outputting to a terminal (because it is, indirectly)
+ cmd = 'script -e -q -c "%s" /dev/null' % cmd
+ return exec_watch('%s%s' % (init_prefix, cmd), **options)
+ else:
+ return bb.process.run('%s%s' % (init_prefix, cmd), **options)
+
+def exec_watch(cmd, **options):
+ """Run program with stdout shown on sys.stdout"""
+ import bb
+ if isinstance(cmd, str) and not "shell" in options:
+ options["shell"] = True
+
+ process = subprocess.Popen(
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **options
+ )
+
+ reader = codecs.getreader('utf-8')(process.stdout)
+ buf = ''
+ while True:
+ out = reader.read(1, 1)
+ if out:
+ sys.stdout.write(out)
+ sys.stdout.flush()
+ buf += out
+ elif out == '' and process.poll() != None:
+ break
+
+ if process.returncode != 0:
+ raise bb.process.ExecutionError(cmd, process.returncode, buf, None)
+
+ return buf, None
+
+def exec_fakeroot(d, cmd, **kwargs):
+ """Run a command under fakeroot (pseudo, in fact) so that it picks up the appropriate file permissions"""
+ # Grab the command and check it actually exists
+ fakerootcmd = d.getVar('FAKEROOTCMD')
+ if not os.path.exists(fakerootcmd):
+ logger.error('pseudo executable %s could not be found - have you run a build yet? pseudo-native should install this and if you have run any build then that should have been built')
+ return 2
+ # Set up the appropriate environment
+ newenv = dict(os.environ)
+ fakerootenv = d.getVar('FAKEROOTENV')
+ for varvalue in fakerootenv.split():
+ if '=' in varvalue:
+ splitval = varvalue.split('=', 1)
+ newenv[splitval[0]] = splitval[1]
+ return subprocess.call("%s %s" % (fakerootcmd, cmd), env=newenv, **kwargs)
+
+def setup_tinfoil(config_only=False, basepath=None, tracking=False):
+ """Initialize tinfoil api from bitbake"""
+ import scriptpath
+ orig_cwd = os.path.abspath(os.curdir)
+ try:
+ if basepath:
+ os.chdir(basepath)
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ sys.exit(1)
+
+ import bb.tinfoil
+ tinfoil = bb.tinfoil.Tinfoil(tracking=tracking)
+ try:
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ tinfoil.prepare(config_only)
+ except bb.tinfoil.TinfoilUIException:
+ tinfoil.shutdown()
+ raise DevtoolError('Failed to start bitbake environment')
+ except:
+ tinfoil.shutdown()
+ raise
+ finally:
+ os.chdir(orig_cwd)
+ return tinfoil
+
+def parse_recipe(config, tinfoil, pn, appends, filter_workspace=True):
+ """Parse the specified recipe"""
+ try:
+ recipefile = tinfoil.get_recipe_file(pn)
+ except bb.providers.NoProvider as e:
+ logger.error(str(e))
+ return None
+ if appends:
+ append_files = tinfoil.get_file_appends(recipefile)
+ if filter_workspace:
+ # Filter out appends from the workspace
+ append_files = [path for path in append_files if
+ not path.startswith(config.workspace_path)]
+ else:
+ append_files = None
+ try:
+ rd = tinfoil.parse_recipe_file(recipefile, appends, append_files)
+ except Exception as e:
+ logger.error(str(e))
+ return None
+ return rd
+
+def check_workspace_recipe(workspace, pn, checksrc=True, bbclassextend=False):
+ """
+ Check that a recipe is in the workspace and (optionally) that source
+ is present.
+ """
+
+ workspacepn = pn
+
+ for recipe, value in workspace.items():
+ if recipe == pn:
+ break
+ if bbclassextend:
+ recipefile = value['recipefile']
+ if recipefile:
+ targets = get_bbclassextend_targets(recipefile, recipe)
+ if pn in targets:
+ workspacepn = recipe
+ break
+ else:
+ raise DevtoolError("No recipe named '%s' in your workspace" % pn)
+
+ if checksrc:
+ srctree = workspace[workspacepn]['srctree']
+ if not os.path.exists(srctree):
+ raise DevtoolError("Source tree %s for recipe %s does not exist" % (srctree, workspacepn))
+ if not os.listdir(srctree):
+ raise DevtoolError("Source tree %s for recipe %s is empty" % (srctree, workspacepn))
+
+ return workspacepn
+
+def use_external_build(same_dir, no_same_dir, d):
+ """
+ Determine if we should use B!=S (separate build and source directories) or not
+ """
+ b_is_s = True
+ if no_same_dir:
+ logger.info('Using separate build directory since --no-same-dir specified')
+ b_is_s = False
+ elif same_dir:
+ logger.info('Using source tree as build directory since --same-dir specified')
+ elif bb.data.inherits_class('autotools-brokensep', d):
+ logger.info('Using source tree as build directory since recipe inherits autotools-brokensep')
+ elif os.path.abspath(d.getVar('B')) == os.path.abspath(d.getVar('S')):
+ logger.info('Using source tree as build directory since that would be the default for this recipe')
+ else:
+ b_is_s = False
+ return b_is_s
+
+def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
+ """
+ Set up the git repository for the source tree
+ """
+ import bb.process
+ import oe.patch
+ if not os.path.exists(os.path.join(repodir, '.git')):
+ bb.process.run('git init', cwd=repodir)
+ bb.process.run('git add .', cwd=repodir)
+ commit_cmd = ['git']
+ oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d)
+ commit_cmd += ['commit', '-q']
+ stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
+ if not stdout:
+ commit_cmd.append('--allow-empty')
+ commitmsg = "Initial empty commit with no upstream sources"
+ elif version:
+ commitmsg = "Initial commit from upstream at version %s" % version
+ else:
+ commitmsg = "Initial commit from upstream"
+ commit_cmd += ['-m', commitmsg]
+ bb.process.run(commit_cmd, cwd=repodir)
+
+ # Ensure singletask.lock (as used by externalsrc.bbclass) is ignored by git
+ excludes = []
+ excludefile = os.path.join(repodir, '.git', 'info', 'exclude')
+ try:
+ with open(excludefile, 'r') as f:
+ excludes = f.readlines()
+ except FileNotFoundError:
+ pass
+ if 'singletask.lock\n' not in excludes:
+ excludes.append('singletask.lock\n')
+ with open(excludefile, 'w') as f:
+ for line in excludes:
+ f.write(line)
+
+ bb.process.run('git checkout -b %s' % devbranch, cwd=repodir)
+ bb.process.run('git tag -f %s' % basetag, cwd=repodir)
+
+def recipe_to_append(recipefile, config, wildcard=False):
+ """
+ Convert a recipe file to a bbappend file path within the workspace.
+ NOTE: if the bbappend already exists, you should be using
+ workspace[args.recipename]['bbappend'] instead of calling this
+ function.
+ """
+ appendname = os.path.splitext(os.path.basename(recipefile))[0]
+ if wildcard:
+ appendname = re.sub(r'_.*', '_%', appendname)
+ appendpath = os.path.join(config.workspace_path, 'appends')
+ appendfile = os.path.join(appendpath, appendname + '.bbappend')
+ return appendfile
+
+def get_bbclassextend_targets(recipefile, pn):
+ """
+ Cheap function to get BBCLASSEXTEND and then convert that to the
+ list of targets that would result.
+ """
+ import bb.utils
+
+ values = {}
+ def get_bbclassextend_varfunc(varname, origvalue, op, newlines):
+ values[varname] = origvalue
+ return origvalue, None, 0, True
+ with open(recipefile, 'r') as f:
+ bb.utils.edit_metadata(f, ['BBCLASSEXTEND'], get_bbclassextend_varfunc)
+
+ targets = []
+ bbclassextend = values.get('BBCLASSEXTEND', '').split()
+ if bbclassextend:
+ for variant in bbclassextend:
+ if variant == 'nativesdk':
+ targets.append('%s-%s' % (variant, pn))
+ elif variant in ['native', 'cross', 'crosssdk']:
+ targets.append('%s-%s' % (pn, variant))
+ return targets
+
+def replace_from_file(path, old, new):
+ """Replace strings on a file"""
+
+ def read_file(path):
+ data = None
+ with open(path) as f:
+ data = f.read()
+ return data
+
+ def write_file(path, data):
+ if data is None:
+ return
+ wdata = data.rstrip() + "\n"
+ with open(path, "w") as f:
+ f.write(wdata)
+
+ # In case old is None, return immediately
+ if old is None:
+ return
+ try:
+ rdata = read_file(path)
+ except IOError as e:
+ # if file does not exit, just quit, otherwise raise an exception
+ if e.errno == errno.ENOENT:
+ return
+ else:
+ raise
+
+ old_contents = rdata.splitlines()
+ new_contents = []
+ for old_content in old_contents:
+ try:
+ new_contents.append(old_content.replace(old, new))
+ except ValueError:
+ pass
+ write_file(path, "\n".join(new_contents))
+
+
+def update_unlockedsigs(basepath, workspace, fixed_setup, extra=None):
+ """ This function will make unlocked-sigs.inc match the recipes in the
+ workspace plus any extras we want unlocked. """
+
+ if not fixed_setup:
+ # Only need to write this out within the eSDK
+ return
+
+ if not extra:
+ extra = []
+
+ confdir = os.path.join(basepath, 'conf')
+ unlockedsigs = os.path.join(confdir, 'unlocked-sigs.inc')
+
+ # Get current unlocked list if any
+ values = {}
+ def get_unlockedsigs_varfunc(varname, origvalue, op, newlines):
+ values[varname] = origvalue
+ return origvalue, None, 0, True
+ if os.path.exists(unlockedsigs):
+ with open(unlockedsigs, 'r') as f:
+ bb.utils.edit_metadata(f, ['SIGGEN_UNLOCKED_RECIPES'], get_unlockedsigs_varfunc)
+ unlocked = sorted(values.get('SIGGEN_UNLOCKED_RECIPES', []))
+
+ # If the new list is different to the current list, write it out
+ newunlocked = sorted(list(workspace.keys()) + extra)
+ if unlocked != newunlocked:
+ bb.utils.mkdirhier(confdir)
+ with open(unlockedsigs, 'w') as f:
+ f.write("# DO NOT MODIFY! YOUR CHANGES WILL BE LOST.\n" +
+ "# This layer was created by the OpenEmbedded devtool" +
+ " utility in order to\n" +
+ "# contain recipes that are unlocked.\n")
+
+ f.write('SIGGEN_UNLOCKED_RECIPES += "\\\n')
+ for pn in newunlocked:
+ f.write(' ' + pn)
+ f.write('"')
+
+def check_prerelease_version(ver, operation):
+ if 'pre' in ver or 'rc' in ver:
+ logger.warning('Version "%s" looks like a pre-release version. '
+ 'If that is the case, in order to ensure that the '
+ 'version doesn\'t appear to go backwards when you '
+ 'later upgrade to the final release version, it is '
+ 'recommmended that instead you use '
+ '<current version>+<pre-release version> e.g. if '
+ 'upgrading from 1.9 to 2.0-rc2 use "1.9+2.0-rc2". '
+ 'If you prefer not to reset and re-try, you can change '
+ 'the version after %s succeeds using "devtool rename" '
+ 'with -V/--version.' % (ver, operation))
+
+def check_git_repo_dirty(repodir):
+ """Check if a git repository is clean or not"""
+ stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
+ return stdout
+
+def check_git_repo_op(srctree, ignoredirs=None):
+ """Check if a git repository is in the middle of a rebase"""
+ stdout, _ = bb.process.run('git rev-parse --show-toplevel', cwd=srctree)
+ topleveldir = stdout.strip()
+ if ignoredirs and topleveldir in ignoredirs:
+ return
+ gitdir = os.path.join(topleveldir, '.git')
+ if os.path.exists(os.path.join(gitdir, 'rebase-merge')):
+ raise DevtoolError("Source tree %s appears to be in the middle of a rebase - please resolve this first" % srctree)
+ if os.path.exists(os.path.join(gitdir, 'rebase-apply')):
+ raise DevtoolError("Source tree %s appears to be in the middle of 'git am' or 'git apply' - please resolve this first" % srctree)
diff --git a/poky/scripts/lib/devtool/build.py b/poky/scripts/lib/devtool/build.py
new file mode 100644
index 000000000..252379e9b
--- /dev/null
+++ b/poky/scripts/lib/devtool/build.py
@@ -0,0 +1,86 @@
+# Development tool - build command plugin
+#
+# Copyright (C) 2014-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool build plugin"""
+
+import os
+import bb
+import logging
+import argparse
+import tempfile
+from devtool import exec_build_env_command, check_workspace_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+
+def _set_file_values(fn, values):
+ remaining = list(values.keys())
+
+ def varfunc(varname, origvalue, op, newlines):
+ newvalue = values.get(varname, origvalue)
+ remaining.remove(varname)
+ return (newvalue, '=', 0, True)
+
+ with open(fn, 'r') as f:
+ (updated, newlines) = bb.utils.edit_metadata(f, values, varfunc)
+
+ for item in remaining:
+ updated = True
+ newlines.append('%s = "%s"' % (item, values[item]))
+
+ if updated:
+ with open(fn, 'w') as f:
+ f.writelines(newlines)
+ return updated
+
+def _get_build_tasks(config):
+ tasks = config.get('Build', 'build_task', 'populate_sysroot,packagedata').split(',')
+ return ['do_%s' % task.strip() for task in tasks]
+
+def build(args, config, basepath, workspace):
+ """Entry point for the devtool 'build' subcommand"""
+ workspacepn = check_workspace_recipe(workspace, args.recipename, bbclassextend=True)
+
+ build_tasks = _get_build_tasks(config)
+
+ bbappend = workspace[workspacepn]['bbappend']
+ if args.disable_parallel_make:
+ logger.info("Disabling 'make' parallelism")
+ _set_file_values(bbappend, {'PARALLEL_MAKE': ''})
+ try:
+ bbargs = []
+ for task in build_tasks:
+ if args.recipename.endswith('-native') and 'package' in task:
+ continue
+ bbargs.append('%s:%s' % (args.recipename, task))
+ exec_build_env_command(config.init_path, basepath, 'bitbake %s' % ' '.join(bbargs), watch=True)
+ except bb.process.ExecutionError as e:
+ # We've already seen the output since watch=True, so just ensure we return something to the user
+ return e.exitcode
+ finally:
+ if args.disable_parallel_make:
+ _set_file_values(bbappend, {'PARALLEL_MAKE': None})
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ parser_build = subparsers.add_parser('build', help='Build a recipe',
+ description='Builds the specified recipe using bitbake (up to and including %s)' % ', '.join(_get_build_tasks(context.config)),
+ group='working', order=50)
+ parser_build.add_argument('recipename', help='Recipe to build')
+ parser_build.add_argument('-s', '--disable-parallel-make', action="store_true", help='Disable make parallelism')
+ parser_build.set_defaults(func=build)
diff --git a/poky/scripts/lib/devtool/build_image.py b/poky/scripts/lib/devtool/build_image.py
new file mode 100644
index 000000000..e5810389b
--- /dev/null
+++ b/poky/scripts/lib/devtool/build_image.py
@@ -0,0 +1,174 @@
+# Development tool - build-image plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool plugin containing the build-image subcommand."""
+
+import os
+import errno
+import logging
+
+from bb.process import ExecutionError
+from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+class TargetNotImageError(Exception):
+ pass
+
+def _get_packages(tinfoil, workspace, config):
+ """Get list of packages from recipes in the workspace."""
+ result = []
+ for recipe in workspace:
+ data = parse_recipe(config, tinfoil, recipe, True)
+ if 'class-target' in data.getVar('OVERRIDES').split(':'):
+ if recipe in data.getVar('PACKAGES').split():
+ result.append(recipe)
+ else:
+ logger.warning("Skipping recipe %s as it doesn't produce a "
+ "package with the same name", recipe)
+ return result
+
+def build_image(args, config, basepath, workspace):
+ """Entry point for the devtool 'build-image' subcommand."""
+
+ image = args.imagename
+ auto_image = False
+ if not image:
+ sdk_targets = config.get('SDK', 'sdk_targets', '').split()
+ if sdk_targets:
+ image = sdk_targets[0]
+ auto_image = True
+ if not image:
+ raise DevtoolError('Unable to determine image to build, please specify one')
+
+ try:
+ if args.add_packages:
+ add_packages = args.add_packages.split(',')
+ else:
+ add_packages = None
+ result, outputdir = build_image_task(config, basepath, workspace, image, add_packages)
+ except TargetNotImageError:
+ if auto_image:
+ raise DevtoolError('Unable to determine image to build, please specify one')
+ else:
+ raise DevtoolError('Specified recipe %s is not an image recipe' % image)
+
+ if result == 0:
+ logger.info('Successfully built %s. You can find output files in %s'
+ % (image, outputdir))
+ return result
+
+def build_image_task(config, basepath, workspace, image, add_packages=None, task=None, extra_append=None):
+ # remove <image>.bbappend to make sure setup_tinfoil doesn't
+ # break because of it
+ target_basename = config.get('SDK', 'target_basename', '')
+ if target_basename:
+ appendfile = os.path.join(config.workspace_path, 'appends',
+ '%s.bbappend' % target_basename)
+ try:
+ os.unlink(appendfile)
+ except OSError as exc:
+ if exc.errno != errno.ENOENT:
+ raise
+
+ tinfoil = setup_tinfoil(basepath=basepath)
+ try:
+ rd = parse_recipe(config, tinfoil, image, True)
+ if not rd:
+ # Error already shown
+ return (1, None)
+ if not bb.data.inherits_class('image', rd):
+ raise TargetNotImageError()
+
+ # Get the actual filename used and strip the .bb and full path
+ target_basename = rd.getVar('FILE')
+ target_basename = os.path.splitext(os.path.basename(target_basename))[0]
+ config.set('SDK', 'target_basename', target_basename)
+ config.write()
+
+ appendfile = os.path.join(config.workspace_path, 'appends',
+ '%s.bbappend' % target_basename)
+
+ outputdir = None
+ try:
+ if workspace or add_packages:
+ if add_packages:
+ packages = add_packages
+ else:
+ packages = _get_packages(tinfoil, workspace, config)
+ else:
+ packages = None
+ if not task:
+ if not packages and not add_packages and workspace:
+ logger.warning('No recipes in workspace, building image %s unmodified', image)
+ elif not packages:
+ logger.warning('No packages to add, building image %s unmodified', image)
+
+ if packages or extra_append:
+ bb.utils.mkdirhier(os.path.dirname(appendfile))
+ with open(appendfile, 'w') as afile:
+ if packages:
+ # include packages from workspace recipes into the image
+ afile.write('IMAGE_INSTALL_append = " %s"\n' % ' '.join(packages))
+ if not task:
+ logger.info('Building image %s with the following '
+ 'additional packages: %s', image, ' '.join(packages))
+ if extra_append:
+ for line in extra_append:
+ afile.write('%s\n' % line)
+
+ if task in ['populate_sdk', 'populate_sdk_ext']:
+ outputdir = rd.getVar('SDK_DEPLOY')
+ else:
+ outputdir = rd.getVar('DEPLOY_DIR_IMAGE')
+
+ tmp_tinfoil = tinfoil
+ tinfoil = None
+ tmp_tinfoil.shutdown()
+
+ options = ''
+ if task:
+ options += '-c %s' % task
+
+ # run bitbake to build image (or specified task)
+ try:
+ exec_build_env_command(config.init_path, basepath,
+ 'bitbake %s %s' % (options, image), watch=True)
+ except ExecutionError as err:
+ return (err.exitcode, None)
+ finally:
+ if os.path.isfile(appendfile):
+ os.unlink(appendfile)
+ finally:
+ if tinfoil:
+ tinfoil.shutdown()
+ return (0, outputdir)
+
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from the build-image plugin"""
+ parser = subparsers.add_parser('build-image',
+ help='Build image including workspace recipe packages',
+ description='Builds an image, extending it to include '
+ 'packages from recipes in the workspace',
+ group='testbuild', order=-10)
+ parser.add_argument('imagename', help='Image recipe to build', nargs='?')
+ parser.add_argument('-p', '--add-packages', help='Instead of adding packages for the '
+ 'entire workspace, specify packages to be added to the image '
+ '(separate multiple packages by commas)',
+ metavar='PACKAGES')
+ parser.set_defaults(func=build_image)
diff --git a/poky/scripts/lib/devtool/build_sdk.py b/poky/scripts/lib/devtool/build_sdk.py
new file mode 100644
index 000000000..b89d65b0c
--- /dev/null
+++ b/poky/scripts/lib/devtool/build_sdk.py
@@ -0,0 +1,65 @@
+# Development tool - build-sdk command plugin
+#
+# Copyright (C) 2015-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import subprocess
+import logging
+import glob
+import shutil
+import errno
+import sys
+import tempfile
+from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError
+from devtool import build_image
+
+logger = logging.getLogger('devtool')
+
+
+def build_sdk(args, config, basepath, workspace):
+ """Entry point for the devtool build-sdk command"""
+
+ sdk_targets = config.get('SDK', 'sdk_targets', '').split()
+ if sdk_targets:
+ image = sdk_targets[0]
+ else:
+ raise DevtoolError('Unable to determine image to build SDK for')
+
+ extra_append = ['SDK_DERIVATIVE = "1"']
+ try:
+ result, outputdir = build_image.build_image_task(config,
+ basepath,
+ workspace,
+ image,
+ task='populate_sdk_ext',
+ extra_append=extra_append)
+ except build_image.TargetNotImageError:
+ raise DevtoolError('Unable to determine image to build SDK for')
+
+ if result == 0:
+ logger.info('Successfully built SDK. You can find output files in %s'
+ % outputdir)
+ return result
+
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands"""
+ if context.fixed_setup:
+ parser_build_sdk = subparsers.add_parser('build-sdk',
+ help='Build a derivative SDK of this one',
+ description='Builds an extensible SDK based upon this one and the items in your workspace',
+ group='advanced')
+ parser_build_sdk.set_defaults(func=build_sdk)
diff --git a/poky/scripts/lib/devtool/deploy.py b/poky/scripts/lib/devtool/deploy.py
new file mode 100644
index 000000000..52e261d56
--- /dev/null
+++ b/poky/scripts/lib/devtool/deploy.py
@@ -0,0 +1,350 @@
+# Development tool - deploy/undeploy command plugin
+#
+# Copyright (C) 2014-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool plugin containing the deploy subcommands"""
+
+import logging
+import os
+import shutil
+import subprocess
+import tempfile
+
+import bb.utils
+import argparse_oe
+import oe.types
+
+from devtool import exec_fakeroot, setup_tinfoil, check_workspace_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+deploylist_path = '/.devtool'
+
+def _prepare_remote_script(deploy, verbose=False, dryrun=False, undeployall=False, nopreserve=False, nocheckspace=False):
+ """
+ Prepare a shell script for running on the target to
+ deploy/undeploy files. We have to be careful what we put in this
+ script - only commands that are likely to be available on the
+ target are suitable (the target might be constrained, e.g. using
+ busybox rather than bash with coreutils).
+ """
+ lines = []
+ lines.append('#!/bin/sh')
+ lines.append('set -e')
+ if undeployall:
+ # Yes, I know this is crude - but it does work
+ lines.append('for entry in %s/*.list; do' % deploylist_path)
+ lines.append('[ ! -f $entry ] && exit')
+ lines.append('set `basename $entry | sed "s/.list//"`')
+ if dryrun:
+ if not deploy:
+ lines.append('echo "Previously deployed files for $1:"')
+ lines.append('manifest="%s/$1.list"' % deploylist_path)
+ lines.append('preservedir="%s/$1.preserve"' % deploylist_path)
+ lines.append('if [ -f $manifest ] ; then')
+ # Read manifest in reverse and delete files / remove empty dirs
+ lines.append(' sed \'1!G;h;$!d\' $manifest | while read file')
+ lines.append(' do')
+ if dryrun:
+ lines.append(' if [ ! -d $file ] ; then')
+ lines.append(' echo $file')
+ lines.append(' fi')
+ else:
+ lines.append(' if [ -d $file ] ; then')
+ # Avoid deleting a preserved directory in case it has special perms
+ lines.append(' if [ ! -d $preservedir/$file ] ; then')
+ lines.append(' rmdir $file > /dev/null 2>&1 || true')
+ lines.append(' fi')
+ lines.append(' else')
+ lines.append(' rm -f $file')
+ lines.append(' fi')
+ lines.append(' done')
+ if not dryrun:
+ lines.append(' rm $manifest')
+ if not deploy and not dryrun:
+ # May as well remove all traces
+ lines.append(' rmdir `dirname $manifest` > /dev/null 2>&1 || true')
+ lines.append('fi')
+
+ if deploy:
+ if not nocheckspace:
+ # Check for available space
+ # FIXME This doesn't take into account files spread across multiple
+ # partitions, but doing that is non-trivial
+ # Find the part of the destination path that exists
+ lines.append('checkpath="$2"')
+ lines.append('while [ "$checkpath" != "/" ] && [ ! -e $checkpath ]')
+ lines.append('do')
+ lines.append(' checkpath=`dirname "$checkpath"`')
+ lines.append('done')
+ lines.append(r'freespace=$(df -P $checkpath | sed -nre "s/^(\S+\s+){3}([0-9]+).*/\2/p")')
+ # First line of the file is the total space
+ lines.append('total=`head -n1 $3`')
+ lines.append('if [ $total -gt $freespace ] ; then')
+ lines.append(' echo "ERROR: insufficient space on target (available ${freespace}, needed ${total})"')
+ lines.append(' exit 1')
+ lines.append('fi')
+ if not nopreserve:
+ # Preserve any files that exist. Note that this will add to the
+ # preserved list with successive deployments if the list of files
+ # deployed changes, but because we've deleted any previously
+ # deployed files at this point it will never preserve anything
+ # that was deployed, only files that existed prior to any deploying
+ # (which makes the most sense)
+ lines.append('cat $3 | sed "1d" | while read file fsize')
+ lines.append('do')
+ lines.append(' if [ -e $file ] ; then')
+ lines.append(' dest="$preservedir/$file"')
+ lines.append(' mkdir -p `dirname $dest`')
+ lines.append(' mv $file $dest')
+ lines.append(' fi')
+ lines.append('done')
+ lines.append('rm $3')
+ lines.append('mkdir -p `dirname $manifest`')
+ lines.append('mkdir -p $2')
+ if verbose:
+ lines.append(' tar xv -C $2 -f - | tee $manifest')
+ else:
+ lines.append(' tar xv -C $2 -f - > $manifest')
+ lines.append('sed -i "s!^./!$2!" $manifest')
+ elif not dryrun:
+ # Put any preserved files back
+ lines.append('if [ -d $preservedir ] ; then')
+ lines.append(' cd $preservedir')
+ # find from busybox might not have -exec, so we don't use that
+ lines.append(' find . -type f | while read file')
+ lines.append(' do')
+ lines.append(' mv $file /$file')
+ lines.append(' done')
+ lines.append(' cd /')
+ lines.append(' rm -rf $preservedir')
+ lines.append('fi')
+
+ if undeployall:
+ if not dryrun:
+ lines.append('echo "NOTE: Successfully undeployed $1"')
+ lines.append('done')
+
+ # Delete the script itself
+ lines.append('rm $0')
+ lines.append('')
+
+ return '\n'.join(lines)
+
+
+
+def deploy(args, config, basepath, workspace):
+ """Entry point for the devtool 'deploy' subcommand"""
+ import math
+ import oe.recipeutils
+ import oe.package
+
+ check_workspace_recipe(workspace, args.recipename, checksrc=False)
+
+ try:
+ host, destdir = args.target.split(':')
+ except ValueError:
+ destdir = '/'
+ else:
+ args.target = host
+ if not destdir.endswith('/'):
+ destdir += '/'
+
+ tinfoil = setup_tinfoil(basepath=basepath)
+ try:
+ try:
+ rd = tinfoil.parse_recipe(args.recipename)
+ except Exception as e:
+ raise DevtoolError('Exception parsing recipe %s: %s' %
+ (args.recipename, e))
+ recipe_outdir = rd.getVar('D')
+ if not os.path.exists(recipe_outdir) or not os.listdir(recipe_outdir):
+ raise DevtoolError('No files to deploy - have you built the %s '
+ 'recipe? If so, the install step has not installed '
+ 'any files.' % args.recipename)
+
+ if args.strip and not args.dry_run:
+ # Fakeroot copy to new destination
+ srcdir = recipe_outdir
+ recipe_outdir = os.path.join(rd.getVar('WORKDIR'), 'deploy-target-stripped')
+ if os.path.isdir(recipe_outdir):
+ bb.utils.remove(recipe_outdir, True)
+ exec_fakeroot(rd, "cp -af %s %s" % (os.path.join(srcdir, '.'), recipe_outdir), shell=True)
+ os.environ['PATH'] = ':'.join([os.environ['PATH'], rd.getVar('PATH') or ''])
+ oe.package.strip_execs(args.recipename, recipe_outdir, rd.getVar('STRIP'), rd.getVar('libdir'),
+ rd.getVar('base_libdir'))
+
+ filelist = []
+ ftotalsize = 0
+ for root, _, files in os.walk(recipe_outdir):
+ for fn in files:
+ # Get the size in kiB (since we'll be comparing it to the output of du -k)
+ # MUST use lstat() here not stat() or getfilesize() since we don't want to
+ # dereference symlinks
+ fsize = int(math.ceil(float(os.lstat(os.path.join(root, fn)).st_size)/1024))
+ ftotalsize += fsize
+ # The path as it would appear on the target
+ fpath = os.path.join(destdir, os.path.relpath(root, recipe_outdir), fn)
+ filelist.append((fpath, fsize))
+
+ if args.dry_run:
+ print('Files to be deployed for %s on target %s:' % (args.recipename, args.target))
+ for item, _ in filelist:
+ print(' %s' % item)
+ return 0
+
+ extraoptions = ''
+ if args.no_host_check:
+ extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ if not args.show_status:
+ extraoptions += ' -q'
+
+ scp_port = ''
+ ssh_port = ''
+ if args.port:
+ scp_port = "-P %s" % args.port
+ ssh_port = "-p %s" % args.port
+
+ # In order to delete previously deployed files and have the manifest file on
+ # the target, we write out a shell script and then copy it to the target
+ # so we can then run it (piping tar output to it).
+ # (We cannot use scp here, because it doesn't preserve symlinks.)
+ tmpdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ tmpscript = '/tmp/devtool_deploy.sh'
+ tmpfilelist = os.path.join(os.path.dirname(tmpscript), 'devtool_deploy.list')
+ shellscript = _prepare_remote_script(deploy=True,
+ verbose=args.show_status,
+ nopreserve=args.no_preserve,
+ nocheckspace=args.no_check_space)
+ # Write out the script to a file
+ with open(os.path.join(tmpdir, os.path.basename(tmpscript)), 'w') as f:
+ f.write(shellscript)
+ # Write out the file list
+ with open(os.path.join(tmpdir, os.path.basename(tmpfilelist)), 'w') as f:
+ f.write('%d\n' % ftotalsize)
+ for fpath, fsize in filelist:
+ f.write('%s %d\n' % (fpath, fsize))
+ # Copy them to the target
+ ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+ if ret != 0:
+ raise DevtoolError('Failed to copy script to %s - rerun with -s to '
+ 'get a complete error message' % args.target)
+ finally:
+ shutil.rmtree(tmpdir)
+
+ # Now run the script
+ ret = exec_fakeroot(rd, 'tar cf - . | ssh %s %s %s \'sh %s %s %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename, destdir, tmpfilelist), cwd=recipe_outdir, shell=True)
+ if ret != 0:
+ raise DevtoolError('Deploy failed - rerun with -s to get a complete '
+ 'error message')
+
+ logger.info('Successfully deployed %s' % recipe_outdir)
+
+ files_list = []
+ for root, _, files in os.walk(recipe_outdir):
+ for filename in files:
+ filename = os.path.relpath(os.path.join(root, filename), recipe_outdir)
+ files_list.append(os.path.join(destdir, filename))
+ finally:
+ tinfoil.shutdown()
+
+ return 0
+
+def undeploy(args, config, basepath, workspace):
+ """Entry point for the devtool 'undeploy' subcommand"""
+ if args.all and args.recipename:
+ raise argparse_oe.ArgumentUsageError('Cannot specify -a/--all with a recipe name', 'undeploy-target')
+ elif not args.recipename and not args.all:
+ raise argparse_oe.ArgumentUsageError('If you don\'t specify a recipe, you must specify -a/--all', 'undeploy-target')
+
+ extraoptions = ''
+ if args.no_host_check:
+ extraoptions += '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+ if not args.show_status:
+ extraoptions += ' -q'
+
+ scp_port = ''
+ ssh_port = ''
+ if args.port:
+ scp_port = "-P %s" % args.port
+ ssh_port = "-p %s" % args.port
+
+ args.target = args.target.split(':')[0]
+
+ tmpdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ tmpscript = '/tmp/devtool_undeploy.sh'
+ shellscript = _prepare_remote_script(deploy=False, dryrun=args.dry_run, undeployall=args.all)
+ # Write out the script to a file
+ with open(os.path.join(tmpdir, os.path.basename(tmpscript)), 'w') as f:
+ f.write(shellscript)
+ # Copy it to the target
+ ret = subprocess.call("scp %s %s %s/* %s:%s" % (scp_port, extraoptions, tmpdir, args.target, os.path.dirname(tmpscript)), shell=True)
+ if ret != 0:
+ raise DevtoolError('Failed to copy script to %s - rerun with -s to '
+ 'get a complete error message' % args.target)
+ finally:
+ shutil.rmtree(tmpdir)
+
+ # Now run the script
+ ret = subprocess.call('ssh %s %s %s \'sh %s %s\'' % (ssh_port, extraoptions, args.target, tmpscript, args.recipename), shell=True)
+ if ret != 0:
+ raise DevtoolError('Undeploy failed - rerun with -s to get a complete '
+ 'error message')
+
+ if not args.all and not args.dry_run:
+ logger.info('Successfully undeployed %s' % args.recipename)
+ return 0
+
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from the deploy plugin"""
+
+ parser_deploy = subparsers.add_parser('deploy-target',
+ help='Deploy recipe output files to live target machine',
+ description='Deploys a recipe\'s build output (i.e. the output of the do_install task) to a live target machine over ssh. By default, any existing files will be preserved instead of being overwritten and will be restored if you run devtool undeploy-target. Note: this only deploys the recipe itself and not any runtime dependencies, so it is assumed that those have been installed on the target beforehand.',
+ group='testbuild')
+ parser_deploy.add_argument('recipename', help='Recipe to deploy')
+ parser_deploy.add_argument('target', help='Live target machine running an ssh server: user@hostname[:destdir]')
+ parser_deploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true')
+ parser_deploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true')
+ parser_deploy.add_argument('-n', '--dry-run', help='List files to be deployed only', action='store_true')
+ parser_deploy.add_argument('-p', '--no-preserve', help='Do not preserve existing files', action='store_true')
+ parser_deploy.add_argument('--no-check-space', help='Do not check for available space before deploying', action='store_true')
+ parser_deploy.add_argument('-P', '--port', help='Specify port to use for connection to the target')
+
+ strip_opts = parser_deploy.add_mutually_exclusive_group(required=False)
+ strip_opts.add_argument('-S', '--strip',
+ help='Strip executables prior to deploying (default: %(default)s). '
+ 'The default value of this option can be controlled by setting the strip option in the [Deploy] section to True or False.',
+ default=oe.types.boolean(context.config.get('Deploy', 'strip', default='0')),
+ action='store_true')
+ strip_opts.add_argument('--no-strip', help='Do not strip executables prior to deploy', dest='strip', action='store_false')
+
+ parser_deploy.set_defaults(func=deploy)
+
+ parser_undeploy = subparsers.add_parser('undeploy-target',
+ help='Undeploy recipe output files in live target machine',
+ description='Un-deploys recipe output files previously deployed to a live target machine by devtool deploy-target.',
+ group='testbuild')
+ parser_undeploy.add_argument('recipename', help='Recipe to undeploy (if not using -a/--all)', nargs='?')
+ parser_undeploy.add_argument('target', help='Live target machine running an ssh server: user@hostname')
+ parser_undeploy.add_argument('-c', '--no-host-check', help='Disable ssh host key checking', action='store_true')
+ parser_undeploy.add_argument('-s', '--show-status', help='Show progress/status output', action='store_true')
+ parser_undeploy.add_argument('-a', '--all', help='Undeploy all recipes deployed on the target', action='store_true')
+ parser_undeploy.add_argument('-n', '--dry-run', help='List files to be undeployed only', action='store_true')
+ parser_undeploy.add_argument('-P', '--port', help='Specify port to use for connection to the target')
+ parser_undeploy.set_defaults(func=undeploy)
diff --git a/poky/scripts/lib/devtool/export.py b/poky/scripts/lib/devtool/export.py
new file mode 100644
index 000000000..13ee258e7
--- /dev/null
+++ b/poky/scripts/lib/devtool/export.py
@@ -0,0 +1,119 @@
+# Development tool - export command plugin
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool export plugin"""
+
+import os
+import argparse
+import tarfile
+import logging
+import datetime
+import json
+
+logger = logging.getLogger('devtool')
+
+# output files
+default_arcname_prefix = "workspace-export"
+metadata = '.export_metadata'
+
+def export(args, config, basepath, workspace):
+ """Entry point for the devtool 'export' subcommand"""
+
+ def add_metadata(tar):
+ """Archive the workspace object"""
+ # finally store the workspace metadata
+ with open(metadata, 'w') as fd:
+ fd.write(json.dumps((config.workspace_path, workspace)))
+ tar.add(metadata)
+ os.unlink(metadata)
+
+ def add_recipe(tar, recipe, data):
+ """Archive recipe with proper arcname"""
+ # Create a map of name/arcnames
+ arcnames = []
+ for key, name in data.items():
+ if name:
+ if key == 'srctree':
+ # all sources, no matter where are located, goes into the sources directory
+ arcname = 'sources/%s' % recipe
+ else:
+ arcname = name.replace(config.workspace_path, '')
+ arcnames.append((name, arcname))
+
+ for name, arcname in arcnames:
+ tar.add(name, arcname=arcname)
+
+
+ # Make sure workspace is non-empty and possible listed include/excluded recipes are in workspace
+ if not workspace:
+ logger.info('Workspace contains no recipes, nothing to export')
+ return 0
+ else:
+ for param, recipes in {'include':args.include,'exclude':args.exclude}.items():
+ for recipe in recipes:
+ if recipe not in workspace:
+ logger.error('Recipe (%s) on %s argument not in the current workspace' % (recipe, param))
+ return 1
+
+ name = args.file
+
+ default_name = "%s-%s.tar.gz" % (default_arcname_prefix, datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+ if not name:
+ name = default_name
+ else:
+ # if name is a directory, append the default name
+ if os.path.isdir(name):
+ name = os.path.join(name, default_name)
+
+ if os.path.exists(name) and not args.overwrite:
+ logger.error('Tar archive %s exists. Use --overwrite/-o to overwrite it')
+ return 1
+
+ # if all workspace is excluded, quit
+ if not len(set(workspace.keys()).difference(set(args.exclude))):
+ logger.warn('All recipes in workspace excluded, nothing to export')
+ return 0
+
+ exported = []
+ with tarfile.open(name, 'w:gz') as tar:
+ if args.include:
+ for recipe in args.include:
+ add_recipe(tar, recipe, workspace[recipe])
+ exported.append(recipe)
+ else:
+ for recipe, data in workspace.items():
+ if recipe not in args.exclude:
+ add_recipe(tar, recipe, data)
+ exported.append(recipe)
+
+ add_metadata(tar)
+
+ logger.info('Tar archive created at %s with the following recipes: %s' % (name, ', '.join(exported)))
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool export subcommands"""
+ parser = subparsers.add_parser('export',
+ help='Export workspace into a tar archive',
+ description='Export one or more recipes from current workspace into a tar archive',
+ group='advanced')
+
+ parser.add_argument('--file', '-f', help='Output archive file name')
+ parser.add_argument('--overwrite', '-o', action="store_true", help='Overwrite previous export tar archive')
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('--include', '-i', nargs='+', default=[], help='Include recipes into the tar archive')
+ group.add_argument('--exclude', '-e', nargs='+', default=[], help='Exclude recipes into the tar archive')
+ parser.set_defaults(func=export)
diff --git a/poky/scripts/lib/devtool/import.py b/poky/scripts/lib/devtool/import.py
new file mode 100644
index 000000000..c13a180d1
--- /dev/null
+++ b/poky/scripts/lib/devtool/import.py
@@ -0,0 +1,144 @@
+# Development tool - import command plugin
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool import plugin"""
+
+import os
+import tarfile
+import logging
+import collections
+import json
+import fnmatch
+
+from devtool import standard, setup_tinfoil, replace_from_file, DevtoolError
+from devtool import export
+
+logger = logging.getLogger('devtool')
+
+def devimport(args, config, basepath, workspace):
+ """Entry point for the devtool 'import' subcommand"""
+
+ def get_pn(name):
+ """ Returns the filename of a workspace recipe/append"""
+ metadata = name.split('/')[-1]
+ fn, _ = os.path.splitext(metadata)
+ return fn
+
+ if not os.path.exists(args.file):
+ raise DevtoolError('Tar archive %s does not exist. Export your workspace using "devtool export"' % args.file)
+
+ with tarfile.open(args.file) as tar:
+ # Get exported metadata
+ export_workspace_path = export_workspace = None
+ try:
+ metadata = tar.getmember(export.metadata)
+ except KeyError as ke:
+ raise DevtoolError('The export metadata file created by "devtool export" was not found. "devtool import" can only be used to import tar archives created by "devtool export".')
+
+ tar.extract(metadata)
+ with open(metadata.name) as fdm:
+ export_workspace_path, export_workspace = json.load(fdm)
+ os.unlink(metadata.name)
+
+ members = tar.getmembers()
+
+ # Get appends and recipes from the exported archive, these
+ # will be needed to find out those appends without corresponding
+ # recipe pair
+ append_fns, recipe_fns = set(), set()
+ for member in members:
+ if member.name.startswith('appends'):
+ append_fns.add(get_pn(member.name))
+ elif member.name.startswith('recipes'):
+ recipe_fns.add(get_pn(member.name))
+
+ # Setup tinfoil, get required data and shutdown
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ current_fns = [os.path.basename(recipe[0]) for recipe in tinfoil.cooker.recipecaches[''].pkg_fn.items()]
+ finally:
+ tinfoil.shutdown()
+
+ # Find those appends that do not have recipes in current metadata
+ non_importables = []
+ for fn in append_fns - recipe_fns:
+ # Check on current metadata (covering those layers indicated in bblayers.conf)
+ for current_fn in current_fns:
+ if fnmatch.fnmatch(current_fn, '*' + fn.replace('%', '') + '*'):
+ break
+ else:
+ non_importables.append(fn)
+ logger.warn('No recipe to append %s.bbapppend, skipping' % fn)
+
+ # Extract
+ imported = []
+ for member in members:
+ if member.name == export.metadata:
+ continue
+
+ for nonimp in non_importables:
+ pn = nonimp.split('_')[0]
+ # do not extract data from non-importable recipes or metadata
+ if member.name.startswith('appends/%s' % nonimp) or \
+ member.name.startswith('recipes/%s' % nonimp) or \
+ member.name.startswith('sources/%s' % pn):
+ break
+ else:
+ path = os.path.join(config.workspace_path, member.name)
+ if os.path.exists(path):
+ # by default, no file overwrite is done unless -o is given by the user
+ if args.overwrite:
+ try:
+ tar.extract(member, path=config.workspace_path)
+ except PermissionError as pe:
+ logger.warn(pe)
+ else:
+ logger.warn('File already present. Use --overwrite/-o to overwrite it: %s' % member.name)
+ continue
+ else:
+ tar.extract(member, path=config.workspace_path)
+
+ # Update EXTERNALSRC and the devtool md5 file
+ if member.name.startswith('appends'):
+ if export_workspace_path:
+ # appends created by 'devtool modify' just need to update the workspace
+ replace_from_file(path, export_workspace_path, config.workspace_path)
+
+ # appends created by 'devtool add' need replacement of exported source tree
+ pn = get_pn(member.name).split('_')[0]
+ exported_srctree = export_workspace[pn]['srctree']
+ if exported_srctree:
+ replace_from_file(path, exported_srctree, os.path.join(config.workspace_path, 'sources', pn))
+
+ standard._add_md5(config, pn, path)
+ imported.append(pn)
+
+ if imported:
+ logger.info('Imported recipes into workspace %s: %s' % (config.workspace_path, ', '.join(imported)))
+ else:
+ logger.warn('No recipes imported into the workspace')
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool import subcommands"""
+ parser = subparsers.add_parser('import',
+ help='Import exported tar archive into workspace',
+ description='Import tar archive previously created by "devtool export" into workspace',
+ group='advanced')
+ parser.add_argument('file', metavar='FILE', help='Name of the tar archive to import')
+ parser.add_argument('--overwrite', '-o', action="store_true", help='Overwrite files when extracting')
+ parser.set_defaults(func=devimport)
diff --git a/poky/scripts/lib/devtool/package.py b/poky/scripts/lib/devtool/package.py
new file mode 100644
index 000000000..af9e8f15f
--- /dev/null
+++ b/poky/scripts/lib/devtool/package.py
@@ -0,0 +1,60 @@
+# Development tool - package command plugin
+#
+# Copyright (C) 2014-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool plugin containing the package subcommands"""
+
+import os
+import subprocess
+import logging
+from bb.process import ExecutionError
+from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def package(args, config, basepath, workspace):
+ """Entry point for the devtool 'package' subcommand"""
+ check_workspace_recipe(workspace, args.recipename)
+
+ tinfoil = setup_tinfoil(basepath=basepath, config_only=True)
+ try:
+ image_pkgtype = config.get('Package', 'image_pkgtype', '')
+ if not image_pkgtype:
+ image_pkgtype = tinfoil.config_data.getVar('IMAGE_PKGTYPE')
+
+ deploy_dir_pkg = tinfoil.config_data.getVar('DEPLOY_DIR_%s' % image_pkgtype.upper())
+ finally:
+ tinfoil.shutdown()
+
+ package_task = config.get('Package', 'package_task', 'package_write_%s' % image_pkgtype)
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake -c %s %s' % (package_task, args.recipename), watch=True)
+ except bb.process.ExecutionError as e:
+ # We've already seen the output since watch=True, so just ensure we return something to the user
+ return e.exitcode
+
+ logger.info('Your packages are in %s' % deploy_dir_pkg)
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from the package plugin"""
+ if context.fixed_setup:
+ parser_package = subparsers.add_parser('package',
+ help='Build packages for a recipe',
+ description='Builds packages for a recipe\'s output files',
+ group='testbuild', order=-5)
+ parser_package.add_argument('recipename', help='Recipe to package')
+ parser_package.set_defaults(func=package)
diff --git a/poky/scripts/lib/devtool/runqemu.py b/poky/scripts/lib/devtool/runqemu.py
new file mode 100644
index 000000000..e26cf28c2
--- /dev/null
+++ b/poky/scripts/lib/devtool/runqemu.py
@@ -0,0 +1,74 @@
+# Development tool - runqemu command plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool runqemu plugin"""
+
+import os
+import bb
+import logging
+import argparse
+import glob
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def runqemu(args, config, basepath, workspace):
+ """Entry point for the devtool 'runqemu' subcommand"""
+
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ try:
+ machine = tinfoil.config_data.getVar('MACHINE')
+ bindir_native = os.path.join(tinfoil.config_data.getVar('STAGING_DIR'),
+ tinfoil.config_data.getVar('BUILD_ARCH'),
+ tinfoil.config_data.getVar('bindir_native').lstrip(os.path.sep))
+ finally:
+ tinfoil.shutdown()
+
+ if not glob.glob(os.path.join(bindir_native, 'qemu-system-*')):
+ raise DevtoolError('QEMU is not available within this SDK')
+
+ imagename = args.imagename
+ if not imagename:
+ sdk_targets = config.get('SDK', 'sdk_targets', '').split()
+ if sdk_targets:
+ imagename = sdk_targets[0]
+ if not imagename:
+ raise DevtoolError('Unable to determine image name to run, please specify one')
+
+ try:
+ # FIXME runqemu assumes that if OECORE_NATIVE_SYSROOT is set then it shouldn't
+ # run bitbake to find out the values of various environment variables, which
+ # isn't the case for the extensible SDK. Work around it for now.
+ newenv = dict(os.environ)
+ newenv.pop('OECORE_NATIVE_SYSROOT', '')
+ exec_build_env_command(config.init_path, basepath, 'runqemu %s %s %s' % (machine, imagename, " ".join(args.args)), watch=True, env=newenv)
+ except bb.process.ExecutionError as e:
+ # We've already seen the output since watch=True, so just ensure we return something to the user
+ return e.exitcode
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ if context.fixed_setup:
+ parser_runqemu = subparsers.add_parser('runqemu', help='Run QEMU on the specified image',
+ description='Runs QEMU to boot the specified image',
+ group='testbuild', order=-20)
+ parser_runqemu.add_argument('imagename', help='Name of built image to boot within QEMU', nargs='?')
+ parser_runqemu.add_argument('args', help='Any remaining arguments are passed to the runqemu script (pass --help after imagename to see what these are)',
+ nargs=argparse.REMAINDER)
+ parser_runqemu.set_defaults(func=runqemu)
diff --git a/poky/scripts/lib/devtool/sdk.py b/poky/scripts/lib/devtool/sdk.py
new file mode 100644
index 000000000..f46577c2a
--- /dev/null
+++ b/poky/scripts/lib/devtool/sdk.py
@@ -0,0 +1,336 @@
+# Development tool - sdk-update command plugin
+#
+# Copyright (C) 2015-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import subprocess
+import logging
+import glob
+import shutil
+import errno
+import sys
+import tempfile
+import re
+from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def parse_locked_sigs(sigfile_path):
+ """Return <pn:task>:<hash> dictionary"""
+ sig_dict = {}
+ with open(sigfile_path) as f:
+ lines = f.readlines()
+ for line in lines:
+ if ':' in line:
+ taskkey, _, hashval = line.rpartition(':')
+ sig_dict[taskkey.strip()] = hashval.split()[0]
+ return sig_dict
+
+def generate_update_dict(sigfile_new, sigfile_old):
+ """Return a dict containing <pn:task>:<hash> which indicates what need to be updated"""
+ update_dict = {}
+ sigdict_new = parse_locked_sigs(sigfile_new)
+ sigdict_old = parse_locked_sigs(sigfile_old)
+ for k in sigdict_new:
+ if k not in sigdict_old:
+ update_dict[k] = sigdict_new[k]
+ continue
+ if sigdict_new[k] != sigdict_old[k]:
+ update_dict[k] = sigdict_new[k]
+ continue
+ return update_dict
+
+def get_sstate_objects(update_dict, sstate_dir):
+ """Return a list containing sstate objects which are to be installed"""
+ sstate_objects = []
+ for k in update_dict:
+ files = set()
+ hashval = update_dict[k]
+ p = sstate_dir + '/' + hashval[:2] + '/*' + hashval + '*.tgz'
+ files |= set(glob.glob(p))
+ p = sstate_dir + '/*/' + hashval[:2] + '/*' + hashval + '*.tgz'
+ files |= set(glob.glob(p))
+ files = list(files)
+ if len(files) == 1:
+ sstate_objects.extend(files)
+ elif len(files) > 1:
+ logger.error("More than one matching sstate object found for %s" % hashval)
+
+ return sstate_objects
+
+def mkdir(d):
+ try:
+ os.makedirs(d)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+
+def install_sstate_objects(sstate_objects, src_sdk, dest_sdk):
+ """Install sstate objects into destination SDK"""
+ sstate_dir = os.path.join(dest_sdk, 'sstate-cache')
+ if not os.path.exists(sstate_dir):
+ logger.error("Missing sstate-cache directory in %s, it might not be an extensible SDK." % dest_sdk)
+ raise
+ for sb in sstate_objects:
+ dst = sb.replace(src_sdk, dest_sdk)
+ destdir = os.path.dirname(dst)
+ mkdir(destdir)
+ logger.debug("Copying %s to %s" % (sb, dst))
+ shutil.copy(sb, dst)
+
+def check_manifest(fn, basepath):
+ import bb.utils
+ changedfiles = []
+ with open(fn, 'r') as f:
+ for line in f:
+ splitline = line.split()
+ if len(splitline) > 1:
+ chksum = splitline[0]
+ fpath = splitline[1]
+ curr_chksum = bb.utils.sha256_file(os.path.join(basepath, fpath))
+ if chksum != curr_chksum:
+ logger.debug('File %s changed: old csum = %s, new = %s' % (os.path.join(basepath, fpath), curr_chksum, chksum))
+ changedfiles.append(fpath)
+ return changedfiles
+
+def sdk_update(args, config, basepath, workspace):
+ """Entry point for devtool sdk-update command"""
+ updateserver = args.updateserver
+ if not updateserver:
+ updateserver = config.get('SDK', 'updateserver', '')
+ logger.debug("updateserver: %s" % updateserver)
+
+ # Make sure we are using sdk-update from within SDK
+ logger.debug("basepath = %s" % basepath)
+ old_locked_sig_file_path = os.path.join(basepath, 'conf/locked-sigs.inc')
+ if not os.path.exists(old_locked_sig_file_path):
+ logger.error("Not using devtool's sdk-update command from within an extensible SDK. Please specify correct basepath via --basepath option")
+ return -1
+ else:
+ logger.debug("Found conf/locked-sigs.inc in %s" % basepath)
+
+ if not '://' in updateserver:
+ logger.error("Update server must be a URL")
+ return -1
+
+ layers_dir = os.path.join(basepath, 'layers')
+ conf_dir = os.path.join(basepath, 'conf')
+
+ # Grab variable values
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ try:
+ stamps_dir = tinfoil.config_data.getVar('STAMPS_DIR')
+ sstate_mirrors = tinfoil.config_data.getVar('SSTATE_MIRRORS')
+ site_conf_version = tinfoil.config_data.getVar('SITE_CONF_VERSION')
+ finally:
+ tinfoil.shutdown()
+
+ tmpsdk_dir = tempfile.mkdtemp()
+ try:
+ os.makedirs(os.path.join(tmpsdk_dir, 'conf'))
+ new_locked_sig_file_path = os.path.join(tmpsdk_dir, 'conf', 'locked-sigs.inc')
+ # Fetch manifest from server
+ tmpmanifest = os.path.join(tmpsdk_dir, 'conf', 'sdk-conf-manifest')
+ ret = subprocess.call("wget -q -O %s %s/conf/sdk-conf-manifest" % (tmpmanifest, updateserver), shell=True)
+ changedfiles = check_manifest(tmpmanifest, basepath)
+ if not changedfiles:
+ logger.info("Already up-to-date")
+ return 0
+ # Update metadata
+ logger.debug("Updating metadata via git ...")
+ #Check for the status before doing a fetch and reset
+ if os.path.exists(os.path.join(basepath, 'layers/.git')):
+ out = subprocess.check_output("git status --porcelain", shell=True, cwd=layers_dir)
+ if not out:
+ ret = subprocess.call("git fetch --all; git reset --hard @{u}", shell=True, cwd=layers_dir)
+ else:
+ logger.error("Failed to update metadata as there have been changes made to it. Aborting.");
+ logger.error("Changed files:\n%s" % out);
+ return -1
+ else:
+ ret = -1
+ if ret != 0:
+ ret = subprocess.call("git clone %s/layers/.git" % updateserver, shell=True, cwd=tmpsdk_dir)
+ if ret != 0:
+ logger.error("Updating metadata via git failed")
+ return ret
+ logger.debug("Updating conf files ...")
+ for changedfile in changedfiles:
+ ret = subprocess.call("wget -q -O %s %s/%s" % (changedfile, updateserver, changedfile), shell=True, cwd=tmpsdk_dir)
+ if ret != 0:
+ logger.error("Updating %s failed" % changedfile)
+ return ret
+
+ # Check if UNINATIVE_CHECKSUM changed
+ uninative = False
+ if 'conf/local.conf' in changedfiles:
+ def read_uninative_checksums(fn):
+ chksumitems = []
+ with open(fn, 'r') as f:
+ for line in f:
+ if line.startswith('UNINATIVE_CHECKSUM'):
+ splitline = re.split(r'[\[\]"\']', line)
+ if len(splitline) > 3:
+ chksumitems.append((splitline[1], splitline[3]))
+ return chksumitems
+
+ oldsums = read_uninative_checksums(os.path.join(basepath, 'conf/local.conf'))
+ newsums = read_uninative_checksums(os.path.join(tmpsdk_dir, 'conf/local.conf'))
+ if oldsums != newsums:
+ uninative = True
+ for buildarch, chksum in newsums:
+ uninative_file = os.path.join('downloads', 'uninative', chksum, '%s-nativesdk-libc.tar.bz2' % buildarch)
+ mkdir(os.path.join(tmpsdk_dir, os.path.dirname(uninative_file)))
+ ret = subprocess.call("wget -q -O %s %s/%s" % (uninative_file, updateserver, uninative_file), shell=True, cwd=tmpsdk_dir)
+
+ # Ok, all is well at this point - move everything over
+ tmplayers_dir = os.path.join(tmpsdk_dir, 'layers')
+ if os.path.exists(tmplayers_dir):
+ shutil.rmtree(layers_dir)
+ shutil.move(tmplayers_dir, layers_dir)
+ for changedfile in changedfiles:
+ destfile = os.path.join(basepath, changedfile)
+ os.remove(destfile)
+ shutil.move(os.path.join(tmpsdk_dir, changedfile), destfile)
+ os.remove(os.path.join(conf_dir, 'sdk-conf-manifest'))
+ shutil.move(tmpmanifest, conf_dir)
+ if uninative:
+ shutil.rmtree(os.path.join(basepath, 'downloads', 'uninative'))
+ shutil.move(os.path.join(tmpsdk_dir, 'downloads', 'uninative'), os.path.join(basepath, 'downloads'))
+
+ if not sstate_mirrors:
+ with open(os.path.join(conf_dir, 'site.conf'), 'a') as f:
+ f.write('SCONF_VERSION = "%s"\n' % site_conf_version)
+ f.write('SSTATE_MIRRORS_append = " file://.* %s/sstate-cache/PATH \\n "\n' % updateserver)
+ finally:
+ shutil.rmtree(tmpsdk_dir)
+
+ if not args.skip_prepare:
+ # Find all potentially updateable tasks
+ sdk_update_targets = []
+ tasks = ['do_populate_sysroot', 'do_packagedata']
+ for root, _, files in os.walk(stamps_dir):
+ for fn in files:
+ if not '.sigdata.' in fn:
+ for task in tasks:
+ if '.%s.' % task in fn or '.%s_setscene.' % task in fn:
+ sdk_update_targets.append('%s:%s' % (os.path.basename(root), task))
+ # Run bitbake command for the whole SDK
+ logger.info("Preparing build system... (This may take some time.)")
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake --setscene-only %s' % ' '.join(sdk_update_targets), stderr=subprocess.STDOUT)
+ output, _ = exec_build_env_command(config.init_path, basepath, 'bitbake -n %s' % ' '.join(sdk_update_targets), stderr=subprocess.STDOUT)
+ runlines = []
+ for line in output.splitlines():
+ if 'Running task ' in line:
+ runlines.append(line)
+ if runlines:
+ logger.error('Unexecuted tasks found in preparation log:\n %s' % '\n '.join(runlines))
+ return -1
+ except bb.process.ExecutionError as e:
+ logger.error('Preparation failed:\n%s' % e.stdout)
+ return -1
+ return 0
+
+def sdk_install(args, config, basepath, workspace):
+ """Entry point for the devtool sdk-install command"""
+
+ import oe.recipeutils
+ import bb.process
+
+ for recipe in args.recipename:
+ if recipe in workspace:
+ raise DevtoolError('recipe %s is a recipe in your workspace' % recipe)
+
+ tasks = ['do_populate_sysroot', 'do_packagedata']
+ stampprefixes = {}
+ def checkstamp(recipe):
+ stampprefix = stampprefixes[recipe]
+ stamps = glob.glob(stampprefix + '*')
+ for stamp in stamps:
+ if '.sigdata.' not in stamp and stamp.startswith((stampprefix + '.', stampprefix + '_setscene.')):
+ return True
+ else:
+ return False
+
+ install_recipes = []
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ for recipe in args.recipename:
+ rd = parse_recipe(config, tinfoil, recipe, True)
+ if not rd:
+ return 1
+ stampprefixes[recipe] = '%s.%s' % (rd.getVar('STAMP'), tasks[0])
+ if checkstamp(recipe):
+ logger.info('%s is already installed' % recipe)
+ else:
+ install_recipes.append(recipe)
+ finally:
+ tinfoil.shutdown()
+
+ if install_recipes:
+ logger.info('Installing %s...' % ', '.join(install_recipes))
+ install_tasks = []
+ for recipe in install_recipes:
+ for task in tasks:
+ if recipe.endswith('-native') and 'package' in task:
+ continue
+ install_tasks.append('%s:%s' % (recipe, task))
+ options = ''
+ if not args.allow_build:
+ options += ' --setscene-only'
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake %s %s' % (options, ' '.join(install_tasks)), watch=True)
+ except bb.process.ExecutionError as e:
+ raise DevtoolError('Failed to install %s:\n%s' % (recipe, str(e)))
+ failed = False
+ for recipe in install_recipes:
+ if checkstamp(recipe):
+ logger.info('Successfully installed %s' % recipe)
+ else:
+ raise DevtoolError('Failed to install %s - unavailable' % recipe)
+ failed = True
+ if failed:
+ return 2
+
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake build-sysroots', watch=True)
+ except bb.process.ExecutionError as e:
+ raise DevtoolError('Failed to bitbake build-sysroots:\n%s' % (str(e)))
+
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from the sdk plugin"""
+ if context.fixed_setup:
+ parser_sdk = subparsers.add_parser('sdk-update',
+ help='Update SDK components',
+ description='Updates installed SDK components from a remote server',
+ group='sdk')
+ updateserver = context.config.get('SDK', 'updateserver', '')
+ if updateserver:
+ parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from (default %s)' % updateserver, nargs='?')
+ else:
+ parser_sdk.add_argument('updateserver', help='The update server to fetch latest SDK components from')
+ parser_sdk.add_argument('--skip-prepare', action="store_true", help='Skip re-preparing the build system after updating (for debugging only)')
+ parser_sdk.set_defaults(func=sdk_update)
+
+ parser_sdk_install = subparsers.add_parser('sdk-install',
+ help='Install additional SDK components',
+ description='Installs additional recipe development files into the SDK. (You can use "devtool search" to find available recipes.)',
+ group='sdk')
+ parser_sdk_install.add_argument('recipename', help='Name of the recipe to install the development artifacts for', nargs='+')
+ parser_sdk_install.add_argument('-s', '--allow-build', help='Allow building requested item(s) from source', action='store_true')
+ parser_sdk_install.set_defaults(func=sdk_install)
diff --git a/poky/scripts/lib/devtool/search.py b/poky/scripts/lib/devtool/search.py
new file mode 100644
index 000000000..b4f209b7e
--- /dev/null
+++ b/poky/scripts/lib/devtool/search.py
@@ -0,0 +1,118 @@
+# Development tool - search command plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool search plugin"""
+
+import os
+import bb
+import logging
+import argparse
+import re
+from devtool import setup_tinfoil, parse_recipe, DevtoolError
+
+logger = logging.getLogger('devtool')
+
+def search(args, config, basepath, workspace):
+ """Entry point for the devtool 'search' subcommand"""
+
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
+ defsummary = tinfoil.config_data.getVar('SUMMARY', False) or ''
+
+ keyword_rc = re.compile(args.keyword)
+
+ def print_match(pn):
+ rd = parse_recipe(config, tinfoil, pn, True)
+ if not rd:
+ return
+ summary = rd.getVar('SUMMARY')
+ if summary == rd.expand(defsummary):
+ summary = ''
+ print("%s %s" % (pn.ljust(20), summary))
+
+
+ matches = []
+ if os.path.exists(pkgdata_dir):
+ for fn in os.listdir(pkgdata_dir):
+ pfn = os.path.join(pkgdata_dir, fn)
+ if not os.path.isfile(pfn):
+ continue
+
+ packages = []
+ match = False
+ if keyword_rc.search(fn):
+ match = True
+
+ if not match:
+ with open(pfn, 'r') as f:
+ for line in f:
+ if line.startswith('PACKAGES:'):
+ packages = line.split(':', 1)[1].strip().split()
+
+ for pkg in packages:
+ if keyword_rc.search(pkg):
+ match = True
+ break
+ if os.path.exists(os.path.join(pkgdata_dir, 'runtime', pkg + '.packaged')):
+ with open(os.path.join(pkgdata_dir, 'runtime', pkg), 'r') as f:
+ for line in f:
+ if ': ' in line:
+ splitline = line.split(':', 1)
+ key = splitline[0]
+ value = splitline[1].strip()
+ if key in ['PKG_%s' % pkg, 'DESCRIPTION', 'FILES_INFO'] or key.startswith('FILERPROVIDES_'):
+ if keyword_rc.search(value):
+ match = True
+ break
+ if match:
+ print_match(fn)
+ matches.append(fn)
+ else:
+ logger.warning('Package data is not available, results may be limited')
+
+ for recipe in tinfoil.all_recipes():
+ if args.fixed_setup and 'nativesdk' in recipe.inherits():
+ continue
+
+ match = False
+ if keyword_rc.search(recipe.pn):
+ match = True
+ else:
+ for prov in recipe.provides:
+ if keyword_rc.search(prov):
+ match = True
+ break
+ if not match:
+ for rprov in recipe.rprovides:
+ if keyword_rc.search(rprov):
+ match = True
+ break
+ if match and not recipe.pn in matches:
+ print_match(recipe.pn)
+ finally:
+ tinfoil.shutdown()
+
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ parser_search = subparsers.add_parser('search', help='Search available recipes',
+ description='Searches for available recipes. Matches on recipe name, package name, description and installed files, and prints the recipe name and summary on match.',
+ group='info')
+ parser_search.add_argument('keyword', help='Keyword to search for (regular expression syntax allowed, use quotes to avoid shell expansion)')
+ parser_search.set_defaults(func=search, no_workspace=True, fixed_setup=context.fixed_setup)
diff --git a/poky/scripts/lib/devtool/standard.py b/poky/scripts/lib/devtool/standard.py
new file mode 100644
index 000000000..a1e8e1d32
--- /dev/null
+++ b/poky/scripts/lib/devtool/standard.py
@@ -0,0 +1,2164 @@
+# Development tool - standard commands plugin
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""Devtool standard plugins"""
+
+import os
+import sys
+import re
+import shutil
+import subprocess
+import tempfile
+import logging
+import argparse
+import argparse_oe
+import scriptutils
+import errno
+import glob
+import filecmp
+from collections import OrderedDict
+from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, get_bbclassextend_targets, update_unlockedsigs, check_prerelease_version, check_git_repo_dirty, check_git_repo_op, DevtoolError
+from devtool import parse_recipe
+
+logger = logging.getLogger('devtool')
+
+override_branch_prefix = 'devtool-override-'
+
+
+def add(args, config, basepath, workspace):
+ """Entry point for the devtool 'add' subcommand"""
+ import bb
+ import oe.recipeutils
+
+ if not args.recipename and not args.srctree and not args.fetch and not args.fetchuri:
+ raise argparse_oe.ArgumentUsageError('At least one of recipename, srctree, fetchuri or -f/--fetch must be specified', 'add')
+
+ # These are positional arguments, but because we're nice, allow
+ # specifying e.g. source tree without name, or fetch URI without name or
+ # source tree (if we can detect that that is what the user meant)
+ if scriptutils.is_src_url(args.recipename):
+ if not args.fetchuri:
+ if args.fetch:
+ raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
+ args.fetchuri = args.recipename
+ args.recipename = ''
+ elif scriptutils.is_src_url(args.srctree):
+ if not args.fetchuri:
+ if args.fetch:
+ raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
+ args.fetchuri = args.srctree
+ args.srctree = ''
+ elif args.recipename and not args.srctree:
+ if os.sep in args.recipename:
+ args.srctree = args.recipename
+ args.recipename = None
+ elif os.path.isdir(args.recipename):
+ logger.warn('Ambiguous argument "%s" - assuming you mean it to be the recipe name' % args.recipename)
+
+ if not args.fetchuri:
+ if args.srcrev:
+ raise DevtoolError('The -S/--srcrev option is only valid when fetching from an SCM repository')
+ if args.srcbranch:
+ raise DevtoolError('The -B/--srcbranch option is only valid when fetching from an SCM repository')
+
+ if args.srctree and os.path.isfile(args.srctree):
+ args.fetchuri = 'file://' + os.path.abspath(args.srctree)
+ args.srctree = ''
+
+ if args.fetch:
+ if args.fetchuri:
+ raise DevtoolError('URI specified as positional argument as well as -f/--fetch')
+ else:
+ logger.warn('-f/--fetch option is deprecated - you can now simply specify the URL to fetch as a positional argument instead')
+ args.fetchuri = args.fetch
+
+ if args.recipename:
+ if args.recipename in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" %
+ args.recipename)
+ reason = oe.recipeutils.validate_pn(args.recipename)
+ if reason:
+ raise DevtoolError(reason)
+
+ if args.srctree:
+ srctree = os.path.abspath(args.srctree)
+ srctreeparent = None
+ tmpsrcdir = None
+ else:
+ srctree = None
+ srctreeparent = get_default_srctree(config)
+ bb.utils.mkdirhier(srctreeparent)
+ tmpsrcdir = tempfile.mkdtemp(prefix='devtoolsrc', dir=srctreeparent)
+
+ if srctree and os.path.exists(srctree):
+ if args.fetchuri:
+ if not os.path.isdir(srctree):
+ raise DevtoolError("Cannot fetch into source tree path %s as "
+ "it exists and is not a directory" %
+ srctree)
+ elif os.listdir(srctree):
+ raise DevtoolError("Cannot fetch into source tree path %s as "
+ "it already exists and is non-empty" %
+ srctree)
+ elif not args.fetchuri:
+ if args.srctree:
+ raise DevtoolError("Specified source tree %s could not be found" %
+ args.srctree)
+ elif srctree:
+ raise DevtoolError("No source tree exists at default path %s - "
+ "either create and populate this directory, "
+ "or specify a path to a source tree, or a "
+ "URI to fetch source from" % srctree)
+ else:
+ raise DevtoolError("You must either specify a source tree "
+ "or a URI to fetch source from")
+
+ if args.version:
+ if '_' in args.version or ' ' in args.version:
+ raise DevtoolError('Invalid version string "%s"' % args.version)
+
+ if args.color == 'auto' and sys.stdout.isatty():
+ color = 'always'
+ else:
+ color = args.color
+ extracmdopts = ''
+ if args.fetchuri:
+ source = args.fetchuri
+ if srctree:
+ extracmdopts += ' -x %s' % srctree
+ else:
+ extracmdopts += ' -x %s' % tmpsrcdir
+ else:
+ source = srctree
+ if args.recipename:
+ extracmdopts += ' -N %s' % args.recipename
+ if args.version:
+ extracmdopts += ' -V %s' % args.version
+ if args.binary:
+ extracmdopts += ' -b'
+ if args.also_native:
+ extracmdopts += ' --also-native'
+ if args.src_subdir:
+ extracmdopts += ' --src-subdir "%s"' % args.src_subdir
+ if args.autorev:
+ extracmdopts += ' -a'
+ if args.fetch_dev:
+ extracmdopts += ' --fetch-dev'
+ if args.mirrors:
+ extracmdopts += ' --mirrors'
+ if args.srcrev:
+ extracmdopts += ' --srcrev %s' % args.srcrev
+ if args.srcbranch:
+ extracmdopts += ' --srcbranch %s' % args.srcbranch
+ if args.provides:
+ extracmdopts += ' --provides %s' % args.provides
+
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath, 'recipetool --color=%s create --devtool -o %s \'%s\' %s' % (color, tempdir, source, extracmdopts), watch=True)
+ except bb.process.ExecutionError as e:
+ if e.exitcode == 15:
+ raise DevtoolError('Could not auto-determine recipe name, please specify it on the command line')
+ else:
+ raise DevtoolError('Command \'%s\' failed' % e.command)
+
+ recipes = glob.glob(os.path.join(tempdir, '*.bb'))
+ if recipes:
+ recipename = os.path.splitext(os.path.basename(recipes[0]))[0].split('_')[0]
+ if recipename in workspace:
+ raise DevtoolError('A recipe with the same name as the one being created (%s) already exists in your workspace' % recipename)
+ recipedir = os.path.join(config.workspace_path, 'recipes', recipename)
+ bb.utils.mkdirhier(recipedir)
+ recipefile = os.path.join(recipedir, os.path.basename(recipes[0]))
+ appendfile = recipe_to_append(recipefile, config)
+ if os.path.exists(appendfile):
+ # This shouldn't be possible, but just in case
+ raise DevtoolError('A recipe with the same name as the one being created already exists in your workspace')
+ if os.path.exists(recipefile):
+ raise DevtoolError('A recipe file %s already exists in your workspace; this shouldn\'t be there - please delete it before continuing' % recipefile)
+ if tmpsrcdir:
+ srctree = os.path.join(srctreeparent, recipename)
+ if os.path.exists(tmpsrcdir):
+ if os.path.exists(srctree):
+ if os.path.isdir(srctree):
+ try:
+ os.rmdir(srctree)
+ except OSError as e:
+ if e.errno == errno.ENOTEMPTY:
+ raise DevtoolError('Source tree path %s already exists and is not empty' % srctree)
+ else:
+ raise
+ else:
+ raise DevtoolError('Source tree path %s already exists and is not a directory' % srctree)
+ logger.info('Using default source tree path %s' % srctree)
+ shutil.move(tmpsrcdir, srctree)
+ else:
+ raise DevtoolError('Couldn\'t find source tree created by recipetool')
+ bb.utils.mkdirhier(recipedir)
+ shutil.move(recipes[0], recipefile)
+ # Move any additional files created by recipetool
+ for fn in os.listdir(tempdir):
+ shutil.move(os.path.join(tempdir, fn), recipedir)
+ else:
+ raise DevtoolError('Command \'%s\' did not create any recipe file:\n%s' % (e.command, e.stdout))
+ attic_recipe = os.path.join(config.workspace_path, 'attic', recipename, os.path.basename(recipefile))
+ if os.path.exists(attic_recipe):
+ logger.warn('A modified recipe from a previous invocation exists in %s - you may wish to move this over the top of the new recipe if you had changes in it that you want to continue with' % attic_recipe)
+ finally:
+ if tmpsrcdir and os.path.exists(tmpsrcdir):
+ shutil.rmtree(tmpsrcdir)
+ shutil.rmtree(tempdir)
+
+ for fn in os.listdir(recipedir):
+ _add_md5(config, recipename, os.path.join(recipedir, fn))
+
+ tinfoil = setup_tinfoil(config_only=True, basepath=basepath)
+ try:
+ try:
+ rd = tinfoil.parse_recipe_file(recipefile, False)
+ except Exception as e:
+ logger.error(str(e))
+ rd = None
+ if not rd:
+ # Parsing failed. We just created this recipe and we shouldn't
+ # leave it in the workdir or it'll prevent bitbake from starting
+ movefn = '%s.parsefailed' % recipefile
+ logger.error('Parsing newly created recipe failed, moving recipe to %s for reference. If this looks to be caused by the recipe itself, please report this error.' % movefn)
+ shutil.move(recipefile, movefn)
+ return 1
+
+ if args.fetchuri and not args.no_git:
+ setup_git_repo(srctree, args.version, 'devtool', d=tinfoil.config_data)
+
+ initial_rev = None
+ if os.path.exists(os.path.join(srctree, '.git')):
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
+ initial_rev = stdout.rstrip()
+
+ if args.src_subdir:
+ srctree = os.path.join(srctree, args.src_subdir)
+
+ bb.utils.mkdirhier(os.path.dirname(appendfile))
+ with open(appendfile, 'w') as f:
+ f.write('inherit externalsrc\n')
+ f.write('EXTERNALSRC = "%s"\n' % srctree)
+
+ b_is_s = use_external_build(args.same_dir, args.no_same_dir, rd)
+ if b_is_s:
+ f.write('EXTERNALSRC_BUILD = "%s"\n' % srctree)
+ if initial_rev:
+ f.write('\n# initial_rev: %s\n' % initial_rev)
+
+ if args.binary:
+ f.write('do_install_append() {\n')
+ f.write(' rm -rf ${D}/.git\n')
+ f.write(' rm -f ${D}/singletask.lock\n')
+ f.write('}\n')
+
+ if bb.data.inherits_class('npm', rd):
+ f.write('do_install_append() {\n')
+ f.write(' # Remove files added to source dir by devtool/externalsrc\n')
+ f.write(' rm -f ${NPM_INSTALLDIR}/singletask.lock\n')
+ f.write(' rm -rf ${NPM_INSTALLDIR}/.git\n')
+ f.write(' rm -rf ${NPM_INSTALLDIR}/oe-local-files\n')
+ f.write(' for symlink in ${EXTERNALSRC_SYMLINKS} ; do\n')
+ f.write(' rm -f ${NPM_INSTALLDIR}/${symlink%%:*}\n')
+ f.write(' done\n')
+ f.write('}\n')
+
+ # Check if the new layer provides recipes whose priorities have been
+ # overriden by PREFERRED_PROVIDER.
+ recipe_name = rd.getVar('PN')
+ provides = rd.getVar('PROVIDES')
+ # Search every item defined in PROVIDES
+ for recipe_provided in provides.split():
+ preferred_provider = 'PREFERRED_PROVIDER_' + recipe_provided
+ current_pprovider = rd.getVar(preferred_provider)
+ if current_pprovider and current_pprovider != recipe_name:
+ if args.fixed_setup:
+ #if we are inside the eSDK add the new PREFERRED_PROVIDER in the workspace layer.conf
+ layerconf_file = os.path.join(config.workspace_path, "conf", "layer.conf")
+ with open(layerconf_file, 'a') as f:
+ f.write('%s = "%s"\n' % (preferred_provider, recipe_name))
+ else:
+ logger.warn('Set \'%s\' in order to use the recipe' % preferred_provider)
+ break
+
+ _add_md5(config, recipename, appendfile)
+
+ check_prerelease_version(rd.getVar('PV'), 'devtool add')
+
+ logger.info('Recipe %s has been automatically created; further editing may be required to make it fully functional' % recipefile)
+
+ finally:
+ tinfoil.shutdown()
+
+ return 0
+
+
+def _check_compatible_recipe(pn, d):
+ """Check if the recipe is supported by devtool"""
+ if pn == 'perf':
+ raise DevtoolError("The perf recipe does not actually check out "
+ "source and thus cannot be supported by this tool",
+ 4)
+
+ if pn in ['kernel-devsrc', 'package-index'] or pn.startswith('gcc-source'):
+ raise DevtoolError("The %s recipe is not supported by this tool" % pn, 4)
+
+ if bb.data.inherits_class('image', d):
+ raise DevtoolError("The %s recipe is an image, and therefore is not "
+ "supported by this tool" % pn, 4)
+
+ if bb.data.inherits_class('populate_sdk', d):
+ raise DevtoolError("The %s recipe is an SDK, and therefore is not "
+ "supported by this tool" % pn, 4)
+
+ if bb.data.inherits_class('packagegroup', d):
+ raise DevtoolError("The %s recipe is a packagegroup, and therefore is "
+ "not supported by this tool" % pn, 4)
+
+ if bb.data.inherits_class('meta', d):
+ raise DevtoolError("The %s recipe is a meta-recipe, and therefore is "
+ "not supported by this tool" % pn, 4)
+
+ if bb.data.inherits_class('externalsrc', d) and d.getVar('EXTERNALSRC'):
+ # Not an incompatibility error per se, so we don't pass the error code
+ raise DevtoolError("externalsrc is currently enabled for the %s "
+ "recipe. This prevents the normal do_patch task "
+ "from working. You will need to disable this "
+ "first." % pn)
+
+def _dry_run_copy(src, dst, dry_run_outdir, base_outdir):
+ """Common function for copying a file to the dry run output directory"""
+ relpath = os.path.relpath(dst, base_outdir)
+ if relpath.startswith('..'):
+ raise Exception('Incorrect base path %s for path %s' % (base_outdir, dst))
+ dst = os.path.join(dry_run_outdir, relpath)
+ dst_d = os.path.dirname(dst)
+ if dst_d:
+ bb.utils.mkdirhier(dst_d)
+ # Don't overwrite existing files, otherwise in the case of an upgrade
+ # the dry-run written out recipe will be overwritten with an unmodified
+ # version
+ if not os.path.exists(dst):
+ shutil.copy(src, dst)
+
+def _move_file(src, dst, dry_run_outdir=None, base_outdir=None):
+ """Move a file. Creates all the directory components of destination path."""
+ dry_run_suffix = ' (dry-run)' if dry_run_outdir else ''
+ logger.debug('Moving %s to %s%s' % (src, dst, dry_run_suffix))
+ if dry_run_outdir:
+ # We want to copy here, not move
+ _dry_run_copy(src, dst, dry_run_outdir, base_outdir)
+ else:
+ dst_d = os.path.dirname(dst)
+ if dst_d:
+ bb.utils.mkdirhier(dst_d)
+ shutil.move(src, dst)
+
+def _copy_file(src, dst, dry_run_outdir=None):
+ """Copy a file. Creates all the directory components of destination path."""
+ dry_run_suffix = ' (dry-run)' if dry_run_outdir else ''
+ logger.debug('Copying %s to %s%s' % (src, dst, dry_run_suffix))
+ if dry_run_outdir:
+ _dry_run_copy(src, dst, dry_run_outdir, base_outdir)
+ else:
+ dst_d = os.path.dirname(dst)
+ if dst_d:
+ bb.utils.mkdirhier(dst_d)
+ shutil.copy(src, dst)
+
+def _git_ls_tree(repodir, treeish='HEAD', recursive=False):
+ """List contents of a git treeish"""
+ import bb
+ cmd = ['git', 'ls-tree', '-z', treeish]
+ if recursive:
+ cmd.append('-r')
+ out, _ = bb.process.run(cmd, cwd=repodir)
+ ret = {}
+ if out:
+ for line in out.split('\0'):
+ if line:
+ split = line.split(None, 4)
+ ret[split[3]] = split[0:3]
+ return ret
+
+def _git_exclude_path(srctree, path):
+ """Return pathspec (list of paths) that excludes certain path"""
+ # NOTE: "Filtering out" files/paths in this way is not entirely reliable -
+ # we don't catch files that are deleted, for example. A more reliable way
+ # to implement this would be to use "negative pathspecs" which were
+ # introduced in Git v1.9.0. Revisit this when/if the required Git version
+ # becomes greater than that.
+ path = os.path.normpath(path)
+ recurse = True if len(path.split(os.path.sep)) > 1 else False
+ git_files = list(_git_ls_tree(srctree, 'HEAD', recurse).keys())
+ if path in git_files:
+ git_files.remove(path)
+ return git_files
+ else:
+ return ['.']
+
+def _ls_tree(directory):
+ """Recursive listing of files in a directory"""
+ ret = []
+ for root, dirs, files in os.walk(directory):
+ ret.extend([os.path.relpath(os.path.join(root, fname), directory) for
+ fname in files])
+ return ret
+
+
+def extract(args, config, basepath, workspace):
+ """Entry point for the devtool 'extract' subcommand"""
+ import bb
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ if not tinfoil:
+ # Error already shown
+ return 1
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ srctree = os.path.abspath(args.srctree)
+ initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
+ logger.info('Source tree extracted to %s' % srctree)
+
+ if initial_rev:
+ return 0
+ else:
+ return 1
+ finally:
+ tinfoil.shutdown()
+
+def sync(args, config, basepath, workspace):
+ """Entry point for the devtool 'sync' subcommand"""
+ import bb
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ if not tinfoil:
+ # Error already shown
+ return 1
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ srctree = os.path.abspath(args.srctree)
+ initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, True, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=True)
+ logger.info('Source tree %s synchronized' % srctree)
+
+ if initial_rev:
+ return 0
+ else:
+ return 1
+ finally:
+ tinfoil.shutdown()
+
+
+def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, workspace, fixed_setup, d, tinfoil, no_overrides=False):
+ """Extract sources of a recipe"""
+ import oe.recipeutils
+ import oe.patch
+
+ pn = d.getVar('PN')
+
+ _check_compatible_recipe(pn, d)
+
+ if sync:
+ if not os.path.exists(srctree):
+ raise DevtoolError("output path %s does not exist" % srctree)
+ else:
+ if os.path.exists(srctree):
+ if not os.path.isdir(srctree):
+ raise DevtoolError("output path %s exists and is not a directory" %
+ srctree)
+ elif os.listdir(srctree):
+ raise DevtoolError("output path %s already exists and is "
+ "non-empty" % srctree)
+
+ if 'noexec' in (d.getVarFlags('do_unpack', False) or []):
+ raise DevtoolError("The %s recipe has do_unpack disabled, unable to "
+ "extract source" % pn, 4)
+
+ if not sync:
+ # Prepare for shutil.move later on
+ bb.utils.mkdirhier(srctree)
+ os.rmdir(srctree)
+
+ extra_overrides = []
+ if not no_overrides:
+ history = d.varhistory.variable('SRC_URI')
+ for event in history:
+ if not 'flag' in event:
+ if event['op'].startswith(('_append[', '_prepend[')):
+ extra_overrides.append(event['op'].split('[')[1].split(']')[0])
+ if extra_overrides:
+ logger.info('SRC_URI contains some conditional appends/prepends - will create branches to represent these')
+
+ initial_rev = None
+
+ appendexisted = False
+ recipefile = d.getVar('FILE')
+ appendfile = recipe_to_append(recipefile, config)
+ is_kernel_yocto = bb.data.inherits_class('kernel-yocto', d)
+
+ # We need to redirect WORKDIR, STAMPS_DIR etc. under a temporary
+ # directory so that:
+ # (a) we pick up all files that get unpacked to the WORKDIR, and
+ # (b) we don't disturb the existing build
+ # However, with recipe-specific sysroots the sysroots for the recipe
+ # will be prepared under WORKDIR, and if we used the system temporary
+ # directory (i.e. usually /tmp) as used by mkdtemp by default, then
+ # our attempts to hardlink files into the recipe-specific sysroots
+ # will fail on systems where /tmp is a different filesystem, and it
+ # would have to fall back to copying the files which is a waste of
+ # time. Put the temp directory under the WORKDIR to prevent that from
+ # being a problem.
+ tempbasedir = d.getVar('WORKDIR')
+ bb.utils.mkdirhier(tempbasedir)
+ tempdir = tempfile.mkdtemp(prefix='devtooltmp-', dir=tempbasedir)
+ try:
+ tinfoil.logger.setLevel(logging.WARNING)
+
+ # FIXME this results in a cache reload under control of tinfoil, which is fine
+ # except we don't get the knotty progress bar
+
+ if os.path.exists(appendfile):
+ appendbackup = os.path.join(tempdir, os.path.basename(appendfile) + '.bak')
+ shutil.copyfile(appendfile, appendbackup)
+ else:
+ appendbackup = None
+ bb.utils.mkdirhier(os.path.dirname(appendfile))
+ logger.debug('writing append file %s' % appendfile)
+ with open(appendfile, 'a') as f:
+ f.write('###--- _extract_source\n')
+ f.write('DEVTOOL_TEMPDIR = "%s"\n' % tempdir)
+ f.write('DEVTOOL_DEVBRANCH = "%s"\n' % devbranch)
+ if not is_kernel_yocto:
+ f.write('PATCHTOOL = "git"\n')
+ f.write('PATCH_COMMIT_FUNCTIONS = "1"\n')
+ if extra_overrides:
+ f.write('DEVTOOL_EXTRA_OVERRIDES = "%s"\n' % ':'.join(extra_overrides))
+ f.write('inherit devtool-source\n')
+ f.write('###--- _extract_source\n')
+
+ update_unlockedsigs(basepath, workspace, fixed_setup, [pn])
+
+ sstate_manifests = d.getVar('SSTATE_MANIFESTS')
+ bb.utils.mkdirhier(sstate_manifests)
+ preservestampfile = os.path.join(sstate_manifests, 'preserve-stamps')
+ with open(preservestampfile, 'w') as f:
+ f.write(d.getVar('STAMP'))
+ try:
+ if bb.data.inherits_class('kernel-yocto', d):
+ # We need to generate the kernel config
+ task = 'do_configure'
+ else:
+ task = 'do_patch'
+
+ # Run the fetch + unpack tasks
+ res = tinfoil.build_targets(pn,
+ task,
+ handle_events=True)
+ finally:
+ if os.path.exists(preservestampfile):
+ os.remove(preservestampfile)
+
+ if not res:
+ raise DevtoolError('Extracting source for %s failed' % pn)
+
+ try:
+ with open(os.path.join(tempdir, 'initial_rev'), 'r') as f:
+ initial_rev = f.read()
+
+ with open(os.path.join(tempdir, 'srcsubdir'), 'r') as f:
+ srcsubdir = f.read()
+ except FileNotFoundError as e:
+ raise DevtoolError('Something went wrong with source extraction - the devtool-source class was not active or did not function correctly:\n%s' % str(e))
+ srcsubdir_rel = os.path.relpath(srcsubdir, os.path.join(tempdir, 'workdir'))
+
+ tempdir_localdir = os.path.join(tempdir, 'oe-local-files')
+ srctree_localdir = os.path.join(srctree, 'oe-local-files')
+
+ if sync:
+ bb.process.run('git fetch file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree)
+
+ # Move oe-local-files directory to srctree
+ # As the oe-local-files is not part of the constructed git tree,
+ # remove them directly during the synchrounizating might surprise
+ # the users. Instead, we move it to oe-local-files.bak and remind
+ # user in the log message.
+ if os.path.exists(srctree_localdir + '.bak'):
+ shutil.rmtree(srctree_localdir, srctree_localdir + '.bak')
+
+ if os.path.exists(srctree_localdir):
+ logger.info('Backing up current local file directory %s' % srctree_localdir)
+ shutil.move(srctree_localdir, srctree_localdir + '.bak')
+
+ if os.path.exists(tempdir_localdir):
+ logger.info('Syncing local source files to srctree...')
+ shutil.copytree(tempdir_localdir, srctree_localdir)
+ else:
+ # Move oe-local-files directory to srctree
+ if os.path.exists(tempdir_localdir):
+ logger.info('Adding local source files to srctree...')
+ shutil.move(tempdir_localdir, srcsubdir)
+
+ shutil.move(srcsubdir, srctree)
+
+ if os.path.abspath(d.getVar('S')) == os.path.abspath(d.getVar('WORKDIR')):
+ # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
+ # (otherwise the recipe won't build as expected)
+ local_files_dir = os.path.join(srctree, 'oe-local-files')
+ addfiles = []
+ for root, _, files in os.walk(local_files_dir):
+ relpth = os.path.relpath(root, local_files_dir)
+ if relpth != '.':
+ bb.utils.mkdirhier(os.path.join(srctree, relpth))
+ for fn in files:
+ if fn == '.gitignore':
+ continue
+ destpth = os.path.join(srctree, relpth, fn)
+ if os.path.exists(destpth):
+ os.unlink(destpth)
+ os.symlink('oe-local-files/%s' % fn, destpth)
+ addfiles.append(os.path.join(relpth, fn))
+ if addfiles:
+ bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
+ useroptions = []
+ oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
+ bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
+
+ if is_kernel_yocto:
+ logger.info('Copying kernel config to srctree')
+ shutil.copy2(os.path.join(tempdir, '.config'), srctree)
+
+ finally:
+ if appendbackup:
+ shutil.copyfile(appendbackup, appendfile)
+ elif os.path.exists(appendfile):
+ os.remove(appendfile)
+ if keep_temp:
+ logger.info('Preserving temporary directory %s' % tempdir)
+ else:
+ shutil.rmtree(tempdir)
+ return initial_rev, srcsubdir_rel
+
+def _add_md5(config, recipename, filename):
+ """Record checksum of a file (or recursively for a directory) to the md5-file of the workspace"""
+ import bb.utils
+
+ def addfile(fn):
+ md5 = bb.utils.md5_file(fn)
+ with open(os.path.join(config.workspace_path, '.devtool_md5'), 'a+') as f:
+ md5_str = '%s|%s|%s\n' % (recipename, os.path.relpath(fn, config.workspace_path), md5)
+ f.seek(0, os.SEEK_SET)
+ if not md5_str in f.read():
+ f.write(md5_str)
+
+ if os.path.isdir(filename):
+ for root, _, files in os.walk(filename):
+ for f in files:
+ addfile(os.path.join(root, f))
+ else:
+ addfile(filename)
+
+def _check_preserve(config, recipename):
+ """Check if a file was manually changed and needs to be saved in 'attic'
+ directory"""
+ import bb.utils
+ origfile = os.path.join(config.workspace_path, '.devtool_md5')
+ newfile = os.path.join(config.workspace_path, '.devtool_md5_new')
+ preservepath = os.path.join(config.workspace_path, 'attic', recipename)
+ with open(origfile, 'r') as f:
+ with open(newfile, 'w') as tf:
+ for line in f.readlines():
+ splitline = line.rstrip().split('|')
+ if splitline[0] == recipename:
+ removefile = os.path.join(config.workspace_path, splitline[1])
+ try:
+ md5 = bb.utils.md5_file(removefile)
+ except IOError as err:
+ if err.errno == 2:
+ # File no longer exists, skip it
+ continue
+ else:
+ raise
+ if splitline[2] != md5:
+ bb.utils.mkdirhier(preservepath)
+ preservefile = os.path.basename(removefile)
+ logger.warn('File %s modified since it was written, preserving in %s' % (preservefile, preservepath))
+ shutil.move(removefile, os.path.join(preservepath, preservefile))
+ else:
+ os.remove(removefile)
+ else:
+ tf.write(line)
+ os.rename(newfile, origfile)
+
+def modify(args, config, basepath, workspace):
+ """Entry point for the devtool 'modify' subcommand"""
+ import bb
+ import oe.recipeutils
+ import oe.patch
+
+ if args.recipename in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" %
+ args.recipename)
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ pn = rd.getVar('PN')
+ if pn != args.recipename:
+ logger.info('Mapping %s to %s' % (args.recipename, pn))
+ if pn in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" %
+ pn)
+
+ if args.srctree:
+ srctree = os.path.abspath(args.srctree)
+ else:
+ srctree = get_default_srctree(config, pn)
+
+ if args.no_extract and not os.path.isdir(srctree):
+ raise DevtoolError("--no-extract specified and source path %s does "
+ "not exist or is not a directory" %
+ srctree)
+
+ recipefile = rd.getVar('FILE')
+ appendfile = recipe_to_append(recipefile, config, args.wildcard)
+ if os.path.exists(appendfile):
+ raise DevtoolError("Another variant of recipe %s is already in your "
+ "workspace (only one variant of a recipe can "
+ "currently be worked on at once)"
+ % pn)
+
+ _check_compatible_recipe(pn, rd)
+
+ initial_rev = None
+ commits = []
+ check_commits = False
+ if not args.no_extract:
+ initial_rev, _ = _extract_source(srctree, args.keep_temp, args.branch, False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
+ if not initial_rev:
+ return 1
+ logger.info('Source tree extracted to %s' % srctree)
+ # Get list of commits since this revision
+ (stdout, _) = bb.process.run('git rev-list --reverse %s..HEAD' % initial_rev, cwd=srctree)
+ commits = stdout.split()
+ check_commits = True
+ else:
+ if os.path.exists(os.path.join(srctree, '.git')):
+ # Check if it's a tree previously extracted by us
+ try:
+ (stdout, _) = bb.process.run('git branch --contains devtool-base', cwd=srctree)
+ except bb.process.ExecutionError:
+ stdout = ''
+ if stdout:
+ check_commits = True
+ for line in stdout.splitlines():
+ if line.startswith('*'):
+ (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=srctree)
+ initial_rev = stdout.rstrip()
+ if not initial_rev:
+ # Otherwise, just grab the head revision
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
+ initial_rev = stdout.rstrip()
+
+ branch_patches = {}
+ if check_commits:
+ # Check if there are override branches
+ (stdout, _) = bb.process.run('git branch', cwd=srctree)
+ branches = []
+ for line in stdout.rstrip().splitlines():
+ branchname = line[2:].rstrip()
+ if branchname.startswith(override_branch_prefix):
+ branches.append(branchname)
+ if branches:
+ logger.warn('SRC_URI is conditionally overridden in this recipe, thus several %s* branches have been created, one for each override that makes changes to SRC_URI. It is recommended that you make changes to the %s branch first, then checkout and rebase each %s* branch and update any unique patches there (duplicates on those branches will be ignored by devtool finish/update-recipe)' % (override_branch_prefix, args.branch, override_branch_prefix))
+ branches.insert(0, args.branch)
+ seen_patches = []
+ for branch in branches:
+ branch_patches[branch] = []
+ (stdout, _) = bb.process.run('git log devtool-base..%s' % branch, cwd=srctree)
+ for line in stdout.splitlines():
+ line = line.strip()
+ if line.startswith(oe.patch.GitApplyTree.patch_line_prefix):
+ origpatch = line[len(oe.patch.GitApplyTree.patch_line_prefix):].split(':', 1)[-1].strip()
+ if not origpatch in seen_patches:
+ seen_patches.append(origpatch)
+ branch_patches[branch].append(origpatch)
+
+ # Need to grab this here in case the source is within a subdirectory
+ srctreebase = srctree
+
+ # Check that recipe isn't using a shared workdir
+ s = os.path.abspath(rd.getVar('S'))
+ workdir = os.path.abspath(rd.getVar('WORKDIR'))
+ if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
+ # Handle if S is set to a subdirectory of the source
+ srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
+ srctree = os.path.join(srctree, srcsubdir)
+
+ bb.utils.mkdirhier(os.path.dirname(appendfile))
+ with open(appendfile, 'w') as f:
+ f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n')
+ # Local files can be modified/tracked in separate subdir under srctree
+ # Mostly useful for packages with S != WORKDIR
+ f.write('FILESPATH_prepend := "%s:"\n' %
+ os.path.join(srctreebase, 'oe-local-files'))
+ f.write('# srctreebase: %s\n' % srctreebase)
+
+ f.write('\ninherit externalsrc\n')
+ f.write('# NOTE: We use pn- overrides here to avoid affecting multiple variants in the case where the recipe uses BBCLASSEXTEND\n')
+ f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
+
+ b_is_s = use_external_build(args.same_dir, args.no_same_dir, rd)
+ if b_is_s:
+ f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
+
+ if bb.data.inherits_class('kernel', rd):
+ f.write('SRCTREECOVEREDTASKS = "do_validate_branches do_kernel_checkout '
+ 'do_fetch do_unpack do_kernel_configme do_kernel_configcheck"\n')
+ f.write('\ndo_patch() {\n'
+ ' :\n'
+ '}\n')
+ f.write('\ndo_configure_append() {\n'
+ ' cp ${B}/.config ${S}/.config.baseline\n'
+ ' ln -sfT ${B}/.config ${S}/.config.new\n'
+ '}\n')
+ if initial_rev:
+ f.write('\n# initial_rev: %s\n' % initial_rev)
+ for commit in commits:
+ f.write('# commit: %s\n' % commit)
+ if branch_patches:
+ for branch in branch_patches:
+ if branch == args.branch:
+ continue
+ f.write('# patches_%s: %s\n' % (branch, ','.join(branch_patches[branch])))
+
+ update_unlockedsigs(basepath, workspace, args.fixed_setup, [pn])
+
+ _add_md5(config, pn, appendfile)
+
+ logger.info('Recipe %s now set up to build from %s' % (pn, srctree))
+
+ finally:
+ tinfoil.shutdown()
+
+ return 0
+
+
+def rename(args, config, basepath, workspace):
+ """Entry point for the devtool 'rename' subcommand"""
+ import bb
+ import oe.recipeutils
+
+ check_workspace_recipe(workspace, args.recipename)
+
+ if not (args.newname or args.version):
+ raise DevtoolError('You must specify a new name, a version with -V/--version, or both')
+
+ recipefile = workspace[args.recipename]['recipefile']
+ if not recipefile:
+ raise DevtoolError('devtool rename can only be used where the recipe file itself is in the workspace (e.g. after devtool add)')
+
+ if args.newname and args.newname != args.recipename:
+ reason = oe.recipeutils.validate_pn(args.newname)
+ if reason:
+ raise DevtoolError(reason)
+ newname = args.newname
+ else:
+ newname = args.recipename
+
+ append = workspace[args.recipename]['bbappend']
+ appendfn = os.path.splitext(os.path.basename(append))[0]
+ splitfn = appendfn.split('_')
+ if len(splitfn) > 1:
+ origfnver = appendfn.split('_')[1]
+ else:
+ origfnver = ''
+
+ recipefilemd5 = None
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ bp = rd.getVar('BP')
+ bpn = rd.getVar('BPN')
+ if newname != args.recipename:
+ localdata = rd.createCopy()
+ localdata.setVar('PN', newname)
+ newbpn = localdata.getVar('BPN')
+ else:
+ newbpn = bpn
+ s = rd.getVar('S', False)
+ src_uri = rd.getVar('SRC_URI', False)
+ pv = rd.getVar('PV')
+
+ # Correct variable values that refer to the upstream source - these
+ # values must stay the same, so if the name/version are changing then
+ # we need to fix them up
+ new_s = s
+ new_src_uri = src_uri
+ if newbpn != bpn:
+ # ${PN} here is technically almost always incorrect, but people do use it
+ new_s = new_s.replace('${BPN}', bpn)
+ new_s = new_s.replace('${PN}', bpn)
+ new_s = new_s.replace('${BP}', '%s-${PV}' % bpn)
+ new_src_uri = new_src_uri.replace('${BPN}', bpn)
+ new_src_uri = new_src_uri.replace('${PN}', bpn)
+ new_src_uri = new_src_uri.replace('${BP}', '%s-${PV}' % bpn)
+ if args.version and origfnver == pv:
+ new_s = new_s.replace('${PV}', pv)
+ new_s = new_s.replace('${BP}', '${BPN}-%s' % pv)
+ new_src_uri = new_src_uri.replace('${PV}', pv)
+ new_src_uri = new_src_uri.replace('${BP}', '${BPN}-%s' % pv)
+ patchfields = {}
+ if new_s != s:
+ patchfields['S'] = new_s
+ if new_src_uri != src_uri:
+ patchfields['SRC_URI'] = new_src_uri
+ if patchfields:
+ recipefilemd5 = bb.utils.md5_file(recipefile)
+ oe.recipeutils.patch_recipe(rd, recipefile, patchfields)
+ newrecipefilemd5 = bb.utils.md5_file(recipefile)
+ finally:
+ tinfoil.shutdown()
+
+ if args.version:
+ newver = args.version
+ else:
+ newver = origfnver
+
+ if newver:
+ newappend = '%s_%s.bbappend' % (newname, newver)
+ newfile = '%s_%s.bb' % (newname, newver)
+ else:
+ newappend = '%s.bbappend' % newname
+ newfile = '%s.bb' % newname
+
+ oldrecipedir = os.path.dirname(recipefile)
+ newrecipedir = os.path.join(config.workspace_path, 'recipes', newname)
+ if oldrecipedir != newrecipedir:
+ bb.utils.mkdirhier(newrecipedir)
+
+ newappend = os.path.join(os.path.dirname(append), newappend)
+ newfile = os.path.join(newrecipedir, newfile)
+
+ # Rename bbappend
+ logger.info('Renaming %s to %s' % (append, newappend))
+ os.rename(append, newappend)
+ # Rename recipe file
+ logger.info('Renaming %s to %s' % (recipefile, newfile))
+ os.rename(recipefile, newfile)
+
+ # Rename source tree if it's the default path
+ appendmd5 = None
+ if not args.no_srctree:
+ srctree = workspace[args.recipename]['srctree']
+ if os.path.abspath(srctree) == os.path.join(config.workspace_path, 'sources', args.recipename):
+ newsrctree = os.path.join(config.workspace_path, 'sources', newname)
+ logger.info('Renaming %s to %s' % (srctree, newsrctree))
+ shutil.move(srctree, newsrctree)
+ # Correct any references (basically EXTERNALSRC*) in the .bbappend
+ appendmd5 = bb.utils.md5_file(newappend)
+ appendlines = []
+ with open(newappend, 'r') as f:
+ for line in f:
+ appendlines.append(line)
+ with open(newappend, 'w') as f:
+ for line in appendlines:
+ if srctree in line:
+ line = line.replace(srctree, newsrctree)
+ f.write(line)
+ newappendmd5 = bb.utils.md5_file(newappend)
+
+ bpndir = None
+ newbpndir = None
+ if newbpn != bpn:
+ bpndir = os.path.join(oldrecipedir, bpn)
+ if os.path.exists(bpndir):
+ newbpndir = os.path.join(newrecipedir, newbpn)
+ logger.info('Renaming %s to %s' % (bpndir, newbpndir))
+ shutil.move(bpndir, newbpndir)
+
+ bpdir = None
+ newbpdir = None
+ if newver != origfnver or newbpn != bpn:
+ bpdir = os.path.join(oldrecipedir, bp)
+ if os.path.exists(bpdir):
+ newbpdir = os.path.join(newrecipedir, '%s-%s' % (newbpn, newver))
+ logger.info('Renaming %s to %s' % (bpdir, newbpdir))
+ shutil.move(bpdir, newbpdir)
+
+ if oldrecipedir != newrecipedir:
+ # Move any stray files and delete the old recipe directory
+ for entry in os.listdir(oldrecipedir):
+ oldpath = os.path.join(oldrecipedir, entry)
+ newpath = os.path.join(newrecipedir, entry)
+ logger.info('Renaming %s to %s' % (oldpath, newpath))
+ shutil.move(oldpath, newpath)
+ os.rmdir(oldrecipedir)
+
+ # Now take care of entries in .devtool_md5
+ md5entries = []
+ with open(os.path.join(config.workspace_path, '.devtool_md5'), 'r') as f:
+ for line in f:
+ md5entries.append(line)
+
+ if bpndir and newbpndir:
+ relbpndir = os.path.relpath(bpndir, config.workspace_path) + '/'
+ else:
+ relbpndir = None
+ if bpdir and newbpdir:
+ relbpdir = os.path.relpath(bpdir, config.workspace_path) + '/'
+ else:
+ relbpdir = None
+
+ with open(os.path.join(config.workspace_path, '.devtool_md5'), 'w') as f:
+ for entry in md5entries:
+ splitentry = entry.rstrip().split('|')
+ if len(splitentry) > 2:
+ if splitentry[0] == args.recipename:
+ splitentry[0] = newname
+ if splitentry[1] == os.path.relpath(append, config.workspace_path):
+ splitentry[1] = os.path.relpath(newappend, config.workspace_path)
+ if appendmd5 and splitentry[2] == appendmd5:
+ splitentry[2] = newappendmd5
+ elif splitentry[1] == os.path.relpath(recipefile, config.workspace_path):
+ splitentry[1] = os.path.relpath(newfile, config.workspace_path)
+ if recipefilemd5 and splitentry[2] == recipefilemd5:
+ splitentry[2] = newrecipefilemd5
+ elif relbpndir and splitentry[1].startswith(relbpndir):
+ splitentry[1] = os.path.relpath(os.path.join(newbpndir, splitentry[1][len(relbpndir):]), config.workspace_path)
+ elif relbpdir and splitentry[1].startswith(relbpdir):
+ splitentry[1] = os.path.relpath(os.path.join(newbpdir, splitentry[1][len(relbpdir):]), config.workspace_path)
+ entry = '|'.join(splitentry) + '\n'
+ f.write(entry)
+ return 0
+
+
+def _get_patchset_revs(srctree, recipe_path, initial_rev=None, force_patch_refresh=False):
+ """Get initial and update rev of a recipe. These are the start point of the
+ whole patchset and start point for the patches to be re-generated/updated.
+ """
+ import bb
+
+ # Get current branch
+ stdout, _ = bb.process.run('git rev-parse --abbrev-ref HEAD',
+ cwd=srctree)
+ branchname = stdout.rstrip()
+
+ # Parse initial rev from recipe if not specified
+ commits = []
+ patches = []
+ with open(recipe_path, 'r') as f:
+ for line in f:
+ if line.startswith('# initial_rev:'):
+ if not initial_rev:
+ initial_rev = line.split(':')[-1].strip()
+ elif line.startswith('# commit:') and not force_patch_refresh:
+ commits.append(line.split(':')[-1].strip())
+ elif line.startswith('# patches_%s:' % branchname):
+ patches = line.split(':')[-1].strip().split(',')
+
+ update_rev = initial_rev
+ changed_revs = None
+ if initial_rev:
+ # Find first actually changed revision
+ stdout, _ = bb.process.run('git rev-list --reverse %s..HEAD' %
+ initial_rev, cwd=srctree)
+ newcommits = stdout.split()
+ for i in range(min(len(commits), len(newcommits))):
+ if newcommits[i] == commits[i]:
+ update_rev = commits[i]
+
+ try:
+ stdout, _ = bb.process.run('git cherry devtool-patched',
+ cwd=srctree)
+ except bb.process.ExecutionError as err:
+ stdout = None
+
+ if stdout is not None and not force_patch_refresh:
+ changed_revs = []
+ for line in stdout.splitlines():
+ if line.startswith('+ '):
+ rev = line.split()[1]
+ if rev in newcommits:
+ changed_revs.append(rev)
+
+ return initial_rev, update_rev, changed_revs, patches
+
+def _remove_file_entries(srcuri, filelist):
+ """Remove file:// entries from SRC_URI"""
+ remaining = filelist[:]
+ entries = []
+ for fname in filelist:
+ basename = os.path.basename(fname)
+ for i in range(len(srcuri)):
+ if (srcuri[i].startswith('file://') and
+ os.path.basename(srcuri[i].split(';')[0]) == basename):
+ entries.append(srcuri[i])
+ remaining.remove(fname)
+ srcuri.pop(i)
+ break
+ return entries, remaining
+
+def _replace_srcuri_entry(srcuri, filename, newentry):
+ """Replace entry corresponding to specified file with a new entry"""
+ basename = os.path.basename(filename)
+ for i in range(len(srcuri)):
+ if os.path.basename(srcuri[i].split(';')[0]) == basename:
+ srcuri.pop(i)
+ srcuri.insert(i, newentry)
+ break
+
+def _remove_source_files(append, files, destpath, no_report_remove=False, dry_run=False):
+ """Unlink existing patch files"""
+
+ dry_run_suffix = ' (dry-run)' if dry_run else ''
+
+ for path in files:
+ if append:
+ if not destpath:
+ raise Exception('destpath should be set here')
+ path = os.path.join(destpath, os.path.basename(path))
+
+ if os.path.exists(path):
+ if not no_report_remove:
+ logger.info('Removing file %s%s' % (path, dry_run_suffix))
+ if not dry_run:
+ # FIXME "git rm" here would be nice if the file in question is
+ # tracked
+ # FIXME there's a chance that this file is referred to by
+ # another recipe, in which case deleting wouldn't be the
+ # right thing to do
+ os.remove(path)
+ # Remove directory if empty
+ try:
+ os.rmdir(os.path.dirname(path))
+ except OSError as ose:
+ if ose.errno != errno.ENOTEMPTY:
+ raise
+
+
+def _export_patches(srctree, rd, start_rev, destdir, changed_revs=None):
+ """Export patches from srctree to given location.
+ Returns three-tuple of dicts:
+ 1. updated - patches that already exist in SRCURI
+ 2. added - new patches that don't exist in SRCURI
+ 3 removed - patches that exist in SRCURI but not in exported patches
+ In each dict the key is the 'basepath' of the URI and value is the
+ absolute path to the existing file in recipe space (if any).
+ """
+ import oe.recipeutils
+ from oe.patch import GitApplyTree
+ updated = OrderedDict()
+ added = OrderedDict()
+ seqpatch_re = re.compile('^([0-9]{4}-)?(.+)')
+
+ existing_patches = dict((os.path.basename(path), path) for path in
+ oe.recipeutils.get_recipe_patches(rd))
+ logger.debug('Existing patches: %s' % existing_patches)
+
+ # Generate patches from Git, exclude local files directory
+ patch_pathspec = _git_exclude_path(srctree, 'oe-local-files')
+ GitApplyTree.extractPatches(srctree, start_rev, destdir, patch_pathspec)
+
+ new_patches = sorted(os.listdir(destdir))
+ for new_patch in new_patches:
+ # Strip numbering from patch names. If it's a git sequence named patch,
+ # the numbers might not match up since we are starting from a different
+ # revision This does assume that people are using unique shortlog
+ # values, but they ought to be anyway...
+ new_basename = seqpatch_re.match(new_patch).group(2)
+ match_name = None
+ for old_patch in existing_patches:
+ old_basename = seqpatch_re.match(old_patch).group(2)
+ old_basename_splitext = os.path.splitext(old_basename)
+ if old_basename.endswith(('.gz', '.bz2', '.Z')) and old_basename_splitext[0] == new_basename:
+ old_patch_noext = os.path.splitext(old_patch)[0]
+ match_name = old_patch_noext
+ break
+ elif new_basename == old_basename:
+ match_name = old_patch
+ break
+ if match_name:
+ # Rename patch files
+ if new_patch != match_name:
+ os.rename(os.path.join(destdir, new_patch),
+ os.path.join(destdir, match_name))
+ # Need to pop it off the list now before checking changed_revs
+ oldpath = existing_patches.pop(old_patch)
+ if changed_revs is not None:
+ # Avoid updating patches that have not actually changed
+ with open(os.path.join(destdir, match_name), 'r') as f:
+ firstlineitems = f.readline().split()
+ # Looking for "From <hash>" line
+ if len(firstlineitems) > 1 and len(firstlineitems[1]) == 40:
+ if not firstlineitems[1] in changed_revs:
+ continue
+ # Recompress if necessary
+ if oldpath.endswith(('.gz', '.Z')):
+ bb.process.run(['gzip', match_name], cwd=destdir)
+ if oldpath.endswith('.gz'):
+ match_name += '.gz'
+ else:
+ match_name += '.Z'
+ elif oldpath.endswith('.bz2'):
+ bb.process.run(['bzip2', match_name], cwd=destdir)
+ match_name += '.bz2'
+ updated[match_name] = oldpath
+ else:
+ added[new_patch] = None
+ return (updated, added, existing_patches)
+
+
+def _create_kconfig_diff(srctree, rd, outfile):
+ """Create a kconfig fragment"""
+ # Only update config fragment if both config files exist
+ orig_config = os.path.join(srctree, '.config.baseline')
+ new_config = os.path.join(srctree, '.config.new')
+ if os.path.exists(orig_config) and os.path.exists(new_config):
+ cmd = ['diff', '--new-line-format=%L', '--old-line-format=',
+ '--unchanged-line-format=', orig_config, new_config]
+ pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = pipe.communicate()
+ if pipe.returncode == 1:
+ logger.info("Updating config fragment %s" % outfile)
+ with open(outfile, 'wb') as fobj:
+ fobj.write(stdout)
+ elif pipe.returncode == 0:
+ logger.info("Would remove config fragment %s" % outfile)
+ if os.path.exists(outfile):
+ # Remove fragment file in case of empty diff
+ logger.info("Removing config fragment %s" % outfile)
+ os.unlink(outfile)
+ else:
+ raise bb.process.ExecutionError(cmd, pipe.returncode, stdout, stderr)
+ return True
+ return False
+
+
+def _export_local_files(srctree, rd, destdir, srctreebase):
+ """Copy local files from srctree to given location.
+ Returns three-tuple of dicts:
+ 1. updated - files that already exist in SRCURI
+ 2. added - new files files that don't exist in SRCURI
+ 3 removed - files that exist in SRCURI but not in exported files
+ In each dict the key is the 'basepath' of the URI and value is the
+ absolute path to the existing file in recipe space (if any).
+ """
+ import oe.recipeutils
+
+ # Find out local files (SRC_URI files that exist in the "recipe space").
+ # Local files that reside in srctree are not included in patch generation.
+ # Instead they are directly copied over the original source files (in
+ # recipe space).
+ existing_files = oe.recipeutils.get_recipe_local_files(rd)
+ new_set = None
+ updated = OrderedDict()
+ added = OrderedDict()
+ removed = OrderedDict()
+ local_files_dir = os.path.join(srctreebase, 'oe-local-files')
+ git_files = _git_ls_tree(srctree)
+ if 'oe-local-files' in git_files:
+ # If tracked by Git, take the files from srctree HEAD. First get
+ # the tree object of the directory
+ tmp_index = os.path.join(srctree, '.git', 'index.tmp.devtool')
+ tree = git_files['oe-local-files'][2]
+ bb.process.run(['git', 'checkout', tree, '--', '.'], cwd=srctree,
+ env=dict(os.environ, GIT_WORK_TREE=destdir,
+ GIT_INDEX_FILE=tmp_index))
+ new_set = list(_git_ls_tree(srctree, tree, True).keys())
+ elif os.path.isdir(local_files_dir):
+ # If not tracked by Git, just copy from working copy
+ new_set = _ls_tree(local_files_dir)
+ bb.process.run(['cp', '-ax',
+ os.path.join(local_files_dir, '.'), destdir])
+ else:
+ new_set = []
+
+ # Special handling for kernel config
+ if bb.data.inherits_class('kernel-yocto', rd):
+ fragment_fn = 'devtool-fragment.cfg'
+ fragment_path = os.path.join(destdir, fragment_fn)
+ if _create_kconfig_diff(srctree, rd, fragment_path):
+ if os.path.exists(fragment_path):
+ if fragment_fn not in new_set:
+ new_set.append(fragment_fn)
+ # Copy fragment to local-files
+ if os.path.isdir(local_files_dir):
+ shutil.copy2(fragment_path, local_files_dir)
+ else:
+ if fragment_fn in new_set:
+ new_set.remove(fragment_fn)
+ # Remove fragment from local-files
+ if os.path.exists(os.path.join(local_files_dir, fragment_fn)):
+ os.unlink(os.path.join(local_files_dir, fragment_fn))
+
+ if new_set is not None:
+ for fname in new_set:
+ if fname in existing_files:
+ origpath = existing_files.pop(fname)
+ workpath = os.path.join(local_files_dir, fname)
+ if not filecmp.cmp(origpath, workpath):
+ updated[fname] = origpath
+ elif fname != '.gitignore':
+ added[fname] = None
+
+ workdir = rd.getVar('WORKDIR')
+ s = rd.getVar('S')
+ if not s.endswith(os.sep):
+ s += os.sep
+
+ if workdir != s:
+ # Handle files where subdir= was specified
+ for fname in list(existing_files.keys()):
+ # FIXME handle both subdir starting with BP and not?
+ fworkpath = os.path.join(workdir, fname)
+ if fworkpath.startswith(s):
+ fpath = os.path.join(srctree, os.path.relpath(fworkpath, s))
+ if os.path.exists(fpath):
+ origpath = existing_files.pop(fname)
+ if not filecmp.cmp(origpath, fpath):
+ updated[fpath] = origpath
+
+ removed = existing_files
+ return (updated, added, removed)
+
+
+def _determine_files_dir(rd):
+ """Determine the appropriate files directory for a recipe"""
+ recipedir = rd.getVar('FILE_DIRNAME')
+ for entry in rd.getVar('FILESPATH').split(':'):
+ relpth = os.path.relpath(entry, recipedir)
+ if not os.sep in relpth:
+ # One (or zero) levels below only, so we don't put anything in machine-specific directories
+ if os.path.isdir(entry):
+ return entry
+ return os.path.join(recipedir, rd.getVar('BPN'))
+
+
+def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wildcard_version, no_remove, no_report_remove, dry_run_outdir=None):
+ """Implement the 'srcrev' mode of update-recipe"""
+ import bb
+ import oe.recipeutils
+
+ dry_run_suffix = ' (dry-run)' if dry_run_outdir else ''
+
+ recipefile = rd.getVar('FILE')
+ recipedir = os.path.basename(recipefile)
+ logger.info('Updating SRCREV in recipe %s%s' % (recipedir, dry_run_suffix))
+
+ # Get HEAD revision
+ try:
+ stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree)
+ except bb.process.ExecutionError as err:
+ raise DevtoolError('Failed to get HEAD revision in %s: %s' %
+ (srctree, err))
+ srcrev = stdout.strip()
+ if len(srcrev) != 40:
+ raise DevtoolError('Invalid hash returned by git: %s' % stdout)
+
+ destpath = None
+ remove_files = []
+ patchfields = {}
+ patchfields['SRCREV'] = srcrev
+ orig_src_uri = rd.getVar('SRC_URI', False) or ''
+ srcuri = orig_src_uri.split()
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ update_srcuri = False
+ appendfile = None
+ try:
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ srctreebase = workspace[recipename]['srctreebase']
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir, srctreebase)
+ if not no_remove:
+ # Find list of existing patches in recipe file
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ old_srcrev = rd.getVar('SRCREV') or ''
+ upd_p, new_p, del_p = _export_patches(srctree, rd, old_srcrev,
+ patches_dir)
+ logger.debug('Patches: update %s, new %s, delete %s' % (dict(upd_p), dict(new_p), dict(del_p)))
+
+ # Remove deleted local files and "overlapping" patches
+ remove_files = list(del_f.values()) + list(upd_p.values()) + list(del_p.values())
+ if remove_files:
+ removedentries = _remove_file_entries(srcuri, remove_files)[0]
+ update_srcuri = True
+
+ if appendlayerdir:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in list(upd_f.items()) + list(new_f.items()))
+ removevalues = {}
+ if update_srcuri:
+ removevalues = {'SRC_URI': removedentries}
+ patchfields['SRC_URI'] = '\\\n '.join(srcuri)
+ if dry_run_outdir:
+ logger.info('Creating bbappend (dry-run)')
+ else:
+ appendfile, destpath = oe.recipeutils.bbappend_recipe(
+ rd, appendlayerdir, files, wildcardver=wildcard_version,
+ extralines=patchfields, removevalues=removevalues,
+ redirect_output=dry_run_outdir)
+ else:
+ files_dir = _determine_files_dir(rd)
+ for basepath, path in upd_f.items():
+ logger.info('Updating file %s%s' % (basepath, dry_run_suffix))
+ if os.path.isabs(basepath):
+ # Original file (probably with subdir pointing inside source tree)
+ # so we do not want to move it, just copy
+ _copy_file(basepath, path, dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
+ else:
+ _move_file(os.path.join(local_files_dir, basepath), path,
+ dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
+ update_srcuri= True
+ for basepath, path in new_f.items():
+ logger.info('Adding new file %s%s' % (basepath, dry_run_suffix))
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath),
+ dry_run_outdir=dry_run_outdir,
+ base_outdir=recipedir)
+ srcuri.append('file://%s' % basepath)
+ update_srcuri = True
+ if update_srcuri:
+ patchfields['SRC_URI'] = ' '.join(srcuri)
+ ret = oe.recipeutils.patch_recipe(rd, recipefile, patchfields, redirect_output=dry_run_outdir)
+ finally:
+ shutil.rmtree(tempdir)
+ if not 'git://' in orig_src_uri:
+ logger.info('You will need to update SRC_URI within the recipe to '
+ 'point to a git repository where you have pushed your '
+ 'changes')
+
+ _remove_source_files(appendlayerdir, remove_files, destpath, no_report_remove, dry_run=dry_run_outdir)
+ return True, appendfile, remove_files
+
+def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir=None, force_patch_refresh=False):
+ """Implement the 'patch' mode of update-recipe"""
+ import bb
+ import oe.recipeutils
+
+ recipefile = rd.getVar('FILE')
+ recipedir = os.path.dirname(recipefile)
+ append = workspace[recipename]['bbappend']
+ if not os.path.exists(append):
+ raise DevtoolError('unable to find workspace bbappend for recipe %s' %
+ recipename)
+
+ initial_rev, update_rev, changed_revs, filter_patches = _get_patchset_revs(srctree, append, initial_rev, force_patch_refresh)
+ if not initial_rev:
+ raise DevtoolError('Unable to find initial revision - please specify '
+ 'it with --initial-rev')
+
+ appendfile = None
+ dl_dir = rd.getVar('DL_DIR')
+ if not dl_dir.endswith('/'):
+ dl_dir += '/'
+
+ dry_run_suffix = ' (dry-run)' if dry_run_outdir else ''
+
+ tempdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ local_files_dir = tempfile.mkdtemp(dir=tempdir)
+ if filter_patches:
+ upd_f = {}
+ new_f = {}
+ del_f = {}
+ else:
+ srctreebase = workspace[recipename]['srctreebase']
+ upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir, srctreebase)
+
+ remove_files = []
+ if not no_remove:
+ # Get all patches from source tree and check if any should be removed
+ all_patches_dir = tempfile.mkdtemp(dir=tempdir)
+ _, _, del_p = _export_patches(srctree, rd, initial_rev,
+ all_patches_dir)
+ # Remove deleted local files and patches
+ remove_files = list(del_f.values()) + list(del_p.values())
+
+ # Get updated patches from source tree
+ patches_dir = tempfile.mkdtemp(dir=tempdir)
+ upd_p, new_p, _ = _export_patches(srctree, rd, update_rev,
+ patches_dir, changed_revs)
+ logger.debug('Pre-filtering: update: %s, new: %s' % (dict(upd_p), dict(new_p)))
+ if filter_patches:
+ new_p = {}
+ upd_p = {k:v for k,v in upd_p.items() if k in filter_patches}
+ remove_files = [f for f in remove_files if f in filter_patches]
+ updatefiles = False
+ updaterecipe = False
+ destpath = None
+ srcuri = (rd.getVar('SRC_URI', False) or '').split()
+ if appendlayerdir:
+ files = dict((os.path.join(local_files_dir, key), val) for
+ key, val in list(upd_f.items()) + list(new_f.items()))
+ files.update(dict((os.path.join(patches_dir, key), val) for
+ key, val in list(upd_p.items()) + list(new_p.items())))
+ if files or remove_files:
+ removevalues = None
+ if remove_files:
+ removedentries, remaining = _remove_file_entries(
+ srcuri, remove_files)
+ if removedentries or remaining:
+ remaining = ['file://' + os.path.basename(item) for
+ item in remaining]
+ removevalues = {'SRC_URI': removedentries + remaining}
+ appendfile, destpath = oe.recipeutils.bbappend_recipe(
+ rd, appendlayerdir, files,
+ wildcardver=wildcard_version,
+ removevalues=removevalues,
+ redirect_output=dry_run_outdir)
+ else:
+ logger.info('No patches or local source files needed updating')
+ else:
+ # Update existing files
+ files_dir = _determine_files_dir(rd)
+ for basepath, path in upd_f.items():
+ logger.info('Updating file %s' % basepath)
+ if os.path.isabs(basepath):
+ # Original file (probably with subdir pointing inside source tree)
+ # so we do not want to move it, just copy
+ _copy_file(basepath, path,
+ dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
+ else:
+ _move_file(os.path.join(local_files_dir, basepath), path,
+ dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
+ updatefiles = True
+ for basepath, path in upd_p.items():
+ patchfn = os.path.join(patches_dir, basepath)
+ if os.path.dirname(path) + '/' == dl_dir:
+ # This is a a downloaded patch file - we now need to
+ # replace the entry in SRC_URI with our local version
+ logger.info('Replacing remote patch %s with updated local version' % basepath)
+ path = os.path.join(files_dir, basepath)
+ _replace_srcuri_entry(srcuri, basepath, 'file://%s' % basepath)
+ updaterecipe = True
+ else:
+ logger.info('Updating patch %s%s' % (basepath, dry_run_suffix))
+ _move_file(patchfn, path,
+ dry_run_outdir=dry_run_outdir, base_outdir=recipedir)
+ updatefiles = True
+ # Add any new files
+ for basepath, path in new_f.items():
+ logger.info('Adding new file %s%s' % (basepath, dry_run_suffix))
+ _move_file(os.path.join(local_files_dir, basepath),
+ os.path.join(files_dir, basepath),
+ dry_run_outdir=dry_run_outdir,
+ base_outdir=recipedir)
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ for basepath, path in new_p.items():
+ logger.info('Adding new patch %s%s' % (basepath, dry_run_suffix))
+ _move_file(os.path.join(patches_dir, basepath),
+ os.path.join(files_dir, basepath),
+ dry_run_outdir=dry_run_outdir,
+ base_outdir=recipedir)
+ srcuri.append('file://%s' % basepath)
+ updaterecipe = True
+ # Update recipe, if needed
+ if _remove_file_entries(srcuri, remove_files)[0]:
+ updaterecipe = True
+ if updaterecipe:
+ if not dry_run_outdir:
+ logger.info('Updating recipe %s' % os.path.basename(recipefile))
+ ret = oe.recipeutils.patch_recipe(rd, recipefile,
+ {'SRC_URI': ' '.join(srcuri)},
+ redirect_output=dry_run_outdir)
+ elif not updatefiles:
+ # Neither patches nor recipe were updated
+ logger.info('No patches or files need updating')
+ return False, None, []
+ finally:
+ shutil.rmtree(tempdir)
+
+ _remove_source_files(appendlayerdir, remove_files, destpath, no_report_remove, dry_run=dry_run_outdir)
+ return True, appendfile, remove_files
+
+def _guess_recipe_update_mode(srctree, rdata):
+ """Guess the recipe update mode to use"""
+ src_uri = (rdata.getVar('SRC_URI', False) or '').split()
+ git_uris = [uri for uri in src_uri if uri.startswith('git://')]
+ if not git_uris:
+ return 'patch'
+ # Just use the first URI for now
+ uri = git_uris[0]
+ # Check remote branch
+ params = bb.fetch.decodeurl(uri)[5]
+ upstr_branch = params['branch'] if 'branch' in params else 'master'
+ # Check if current branch HEAD is found in upstream branch
+ stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree)
+ head_rev = stdout.rstrip()
+ stdout, _ = bb.process.run('git branch -r --contains %s' % head_rev,
+ cwd=srctree)
+ remote_brs = [branch.strip() for branch in stdout.splitlines()]
+ if 'origin/' + upstr_branch in remote_brs:
+ return 'srcrev'
+
+ return 'patch'
+
+def _update_recipe(recipename, workspace, rd, mode, appendlayerdir, wildcard_version, no_remove, initial_rev, no_report_remove=False, dry_run_outdir=None, no_overrides=False, force_patch_refresh=False):
+ srctree = workspace[recipename]['srctree']
+ if mode == 'auto':
+ mode = _guess_recipe_update_mode(srctree, rd)
+
+ override_branches = []
+ mainbranch = None
+ startbranch = None
+ if not no_overrides:
+ stdout, _ = bb.process.run('git branch', cwd=srctree)
+ other_branches = []
+ for line in stdout.splitlines():
+ branchname = line[2:]
+ if line.startswith('* '):
+ startbranch = branchname
+ if branchname.startswith(override_branch_prefix):
+ override_branches.append(branchname)
+ else:
+ other_branches.append(branchname)
+
+ if override_branches:
+ logger.debug('_update_recipe: override branches: %s' % override_branches)
+ logger.debug('_update_recipe: other branches: %s' % other_branches)
+ if startbranch.startswith(override_branch_prefix):
+ if len(other_branches) == 1:
+ mainbranch = other_branches[1]
+ else:
+ raise DevtoolError('Unable to determine main branch - please check out the main branch in source tree first')
+ else:
+ mainbranch = startbranch
+
+ checkedout = None
+ anyupdated = False
+ appendfile = None
+ allremoved = []
+ if override_branches:
+ logger.info('Handling main branch (%s)...' % mainbranch)
+ if startbranch != mainbranch:
+ bb.process.run('git checkout %s' % mainbranch, cwd=srctree)
+ checkedout = mainbranch
+ try:
+ branchlist = [mainbranch] + override_branches
+ for branch in branchlist:
+ crd = bb.data.createCopy(rd)
+ if branch != mainbranch:
+ logger.info('Handling branch %s...' % branch)
+ override = branch[len(override_branch_prefix):]
+ crd.appendVar('OVERRIDES', ':%s' % override)
+ bb.process.run('git checkout %s' % branch, cwd=srctree)
+ checkedout = branch
+
+ if mode == 'srcrev':
+ updated, appendf, removed = _update_recipe_srcrev(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, dry_run_outdir)
+ elif mode == 'patch':
+ updated, appendf, removed = _update_recipe_patch(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir, force_patch_refresh)
+ else:
+ raise DevtoolError('update_recipe: invalid mode %s' % mode)
+ if updated:
+ anyupdated = True
+ if appendf:
+ appendfile = appendf
+ allremoved.extend(removed)
+ finally:
+ if startbranch and checkedout != startbranch:
+ bb.process.run('git checkout %s' % startbranch, cwd=srctree)
+
+ return anyupdated, appendfile, allremoved
+
+def update_recipe(args, config, basepath, workspace):
+ """Entry point for the devtool 'update-recipe' subcommand"""
+ check_workspace_recipe(workspace, args.recipename)
+
+ if args.append:
+ if not os.path.exists(args.append):
+ raise DevtoolError('bbappend destination layer directory "%s" '
+ 'does not exist' % args.append)
+ if not os.path.exists(os.path.join(args.append, 'conf', 'layer.conf')):
+ raise DevtoolError('conf/layer.conf not found in bbappend '
+ 'destination layer "%s"' % args.append)
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ dry_run_output = None
+ dry_run_outdir = None
+ if args.dry_run:
+ dry_run_output = tempfile.TemporaryDirectory(prefix='devtool')
+ dry_run_outdir = dry_run_output.name
+ updated, _, _ = _update_recipe(args.recipename, workspace, rd, args.mode, args.append, args.wildcard_version, args.no_remove, args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh)
+
+ if updated:
+ rf = rd.getVar('FILE')
+ if rf.startswith(config.workspace_path):
+ logger.warn('Recipe file %s has been updated but is inside the workspace - you will need to move it (and any associated files next to it) out to the desired layer before using "devtool reset" in order to keep any changes' % rf)
+ finally:
+ tinfoil.shutdown()
+
+ return 0
+
+
+def status(args, config, basepath, workspace):
+ """Entry point for the devtool 'status' subcommand"""
+ if workspace:
+ for recipe, value in sorted(workspace.items()):
+ recipefile = value['recipefile']
+ if recipefile:
+ recipestr = ' (%s)' % recipefile
+ else:
+ recipestr = ''
+ print("%s: %s%s" % (recipe, value['srctree'], recipestr))
+ else:
+ logger.info('No recipes currently in your workspace - you can use "devtool modify" to work on an existing recipe or "devtool add" to add a new one')
+ return 0
+
+
+def _reset(recipes, no_clean, config, basepath, workspace):
+ """Reset one or more recipes"""
+ import oe.path
+
+ def clean_preferred_provider(pn, layerconf_path):
+ """Remove PREFERRED_PROVIDER from layer.conf'"""
+ import re
+ layerconf_file = os.path.join(layerconf_path, 'conf', 'layer.conf')
+ new_layerconf_file = os.path.join(layerconf_path, 'conf', '.layer.conf')
+ pprovider_found = False
+ with open(layerconf_file, 'r') as f:
+ lines = f.readlines()
+ with open(new_layerconf_file, 'a') as nf:
+ for line in lines:
+ pprovider_exp = r'^PREFERRED_PROVIDER_.*? = "' + pn + r'"$'
+ if not re.match(pprovider_exp, line):
+ nf.write(line)
+ else:
+ pprovider_found = True
+ if pprovider_found:
+ shutil.move(new_layerconf_file, layerconf_file)
+ else:
+ os.remove(new_layerconf_file)
+
+ if recipes and not no_clean:
+ if len(recipes) == 1:
+ logger.info('Cleaning sysroot for recipe %s...' % recipes[0])
+ else:
+ logger.info('Cleaning sysroot for recipes %s...' % ', '.join(recipes))
+ # If the recipe file itself was created in the workspace, and
+ # it uses BBCLASSEXTEND, then we need to also clean the other
+ # variants
+ targets = []
+ for recipe in recipes:
+ targets.append(recipe)
+ recipefile = workspace[recipe]['recipefile']
+ if recipefile and os.path.exists(recipefile):
+ targets.extend(get_bbclassextend_targets(recipefile, recipe))
+ try:
+ exec_build_env_command(config.init_path, basepath, 'bitbake -c clean %s' % ' '.join(targets))
+ except bb.process.ExecutionError as e:
+ raise DevtoolError('Command \'%s\' failed, output:\n%s\nIf you '
+ 'wish, you may specify -n/--no-clean to '
+ 'skip running this command when resetting' %
+ (e.command, e.stdout))
+
+ for pn in recipes:
+ _check_preserve(config, pn)
+
+ appendfile = workspace[pn]['bbappend']
+ if os.path.exists(appendfile):
+ # This shouldn't happen, but is possible if devtool errored out prior to
+ # writing the md5 file. We need to delete this here or the recipe won't
+ # actually be reset
+ os.remove(appendfile)
+
+ preservepath = os.path.join(config.workspace_path, 'attic', pn, pn)
+ def preservedir(origdir):
+ if os.path.exists(origdir):
+ for root, dirs, files in os.walk(origdir):
+ for fn in files:
+ logger.warn('Preserving %s in %s' % (fn, preservepath))
+ _move_file(os.path.join(origdir, fn),
+ os.path.join(preservepath, fn))
+ for dn in dirs:
+ preservedir(os.path.join(root, dn))
+ os.rmdir(origdir)
+
+ recipefile = workspace[pn]['recipefile']
+ if recipefile and oe.path.is_path_parent(config.workspace_path, recipefile):
+ # This should always be true if recipefile is set, but just in case
+ preservedir(os.path.dirname(recipefile))
+ # We don't automatically create this dir next to appends, but the user can
+ preservedir(os.path.join(config.workspace_path, 'appends', pn))
+
+ srctreebase = workspace[pn]['srctreebase']
+ if os.path.isdir(srctreebase):
+ if os.listdir(srctreebase):
+ # We don't want to risk wiping out any work in progress
+ logger.info('Leaving source tree %s as-is; if you no '
+ 'longer need it then please delete it manually'
+ % srctreebase)
+ else:
+ # This is unlikely, but if it's empty we can just remove it
+ os.rmdir(srctreebase)
+
+ clean_preferred_provider(pn, config.workspace_path)
+
+def reset(args, config, basepath, workspace):
+ """Entry point for the devtool 'reset' subcommand"""
+ import bb
+ if args.recipename:
+ if args.all:
+ raise DevtoolError("Recipe cannot be specified if -a/--all is used")
+ else:
+ for recipe in args.recipename:
+ check_workspace_recipe(workspace, recipe, checksrc=False)
+ elif not args.all:
+ raise DevtoolError("Recipe must be specified, or specify -a/--all to "
+ "reset all recipes")
+ if args.all:
+ recipes = list(workspace.keys())
+ else:
+ recipes = args.recipename
+
+ _reset(recipes, args.no_clean, config, basepath, workspace)
+
+ return 0
+
+
+def _get_layer(layername, d):
+ """Determine the base layer path for the specified layer name/path"""
+ layerdirs = d.getVar('BBLAYERS').split()
+ layers = {os.path.basename(p): p for p in layerdirs}
+ # Provide some shortcuts
+ if layername.lower() in ['oe-core', 'openembedded-core']:
+ layerdir = layers.get('meta', None)
+ else:
+ layerdir = layers.get(layername, None)
+ return os.path.abspath(layerdir or layername)
+
+def finish(args, config, basepath, workspace):
+ """Entry point for the devtool 'finish' subcommand"""
+ import bb
+ import oe.recipeutils
+
+ check_workspace_recipe(workspace, args.recipename)
+
+ dry_run_suffix = ' (dry-run)' if args.dry_run else ''
+
+ # Grab the equivalent of COREBASE without having to initialise tinfoil
+ corebasedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
+
+ srctree = workspace[args.recipename]['srctree']
+ check_git_repo_op(srctree, [corebasedir])
+ dirty = check_git_repo_dirty(srctree)
+ if dirty:
+ if args.force:
+ logger.warning('Source tree is not clean, continuing as requested by -f/--force')
+ else:
+ raise DevtoolError('Source tree is not clean:\n\n%s\nEnsure you have committed your changes or use -f/--force if you are sure there\'s nothing that needs to be committed' % dirty)
+
+ no_clean = False
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ destlayerdir = _get_layer(args.destination, tinfoil.config_data)
+ recipefile = rd.getVar('FILE')
+ recipedir = os.path.dirname(recipefile)
+ origlayerdir = oe.recipeutils.find_layerdir(recipefile)
+
+ if not os.path.isdir(destlayerdir):
+ raise DevtoolError('Unable to find layer or directory matching "%s"' % args.destination)
+
+ if os.path.abspath(destlayerdir) == config.workspace_path:
+ raise DevtoolError('"%s" specifies the workspace layer - that is not a valid destination' % args.destination)
+
+ # If it's an upgrade, grab the original path
+ origpath = None
+ origfilelist = None
+ append = workspace[args.recipename]['bbappend']
+ with open(append, 'r') as f:
+ for line in f:
+ if line.startswith('# original_path:'):
+ origpath = line.split(':')[1].strip()
+ elif line.startswith('# original_files:'):
+ origfilelist = line.split(':')[1].split()
+
+ destlayerbasedir = oe.recipeutils.find_layerdir(destlayerdir)
+
+ if origlayerdir == config.workspace_path:
+ # Recipe file itself is in workspace, update it there first
+ appendlayerdir = None
+ origrelpath = None
+ if origpath:
+ origlayerpath = oe.recipeutils.find_layerdir(origpath)
+ if origlayerpath:
+ origrelpath = os.path.relpath(origpath, origlayerpath)
+ destpath = oe.recipeutils.get_bbfile_path(rd, destlayerdir, origrelpath)
+ if not destpath:
+ raise DevtoolError("Unable to determine destination layer path - check that %s specifies an actual layer and %s/conf/layer.conf specifies BBFILES. You may also need to specify a more complete path." % (args.destination, destlayerdir))
+ # Warn if the layer isn't in bblayers.conf (the code to create a bbappend will do this in other cases)
+ layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
+ if not os.path.abspath(destlayerbasedir) in layerdirs:
+ bb.warn('Specified destination layer is not currently enabled in bblayers.conf, so the %s recipe will now be unavailable in your current configuration until you add the layer there' % args.recipename)
+
+ elif destlayerdir == origlayerdir:
+ # Same layer, update the original recipe
+ appendlayerdir = None
+ destpath = None
+ else:
+ # Create/update a bbappend in the specified layer
+ appendlayerdir = destlayerdir
+ destpath = None
+
+ # Actually update the recipe / bbappend
+ removing_original = (origpath and origfilelist and oe.recipeutils.find_layerdir(origpath) == destlayerbasedir)
+ dry_run_output = None
+ dry_run_outdir = None
+ if args.dry_run:
+ dry_run_output = tempfile.TemporaryDirectory(prefix='devtool')
+ dry_run_outdir = dry_run_output.name
+ updated, appendfile, removed = _update_recipe(args.recipename, workspace, rd, args.mode, appendlayerdir, wildcard_version=True, no_remove=False, no_report_remove=removing_original, initial_rev=args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh)
+ removed = [os.path.relpath(pth, recipedir) for pth in removed]
+
+ # Remove any old files in the case of an upgrade
+ if removing_original:
+ for fn in origfilelist:
+ fnp = os.path.join(origpath, fn)
+ if fn in removed or not os.path.exists(os.path.join(recipedir, fn)):
+ logger.info('Removing file %s%s' % (fnp, dry_run_suffix))
+ if not args.dry_run:
+ try:
+ os.remove(fnp)
+ except FileNotFoundError:
+ pass
+
+ if origlayerdir == config.workspace_path and destpath:
+ # Recipe file itself is in the workspace - need to move it and any
+ # associated files to the specified layer
+ no_clean = True
+ logger.info('Moving recipe file to %s%s' % (destpath, dry_run_suffix))
+ for root, _, files in os.walk(recipedir):
+ for fn in files:
+ srcpath = os.path.join(root, fn)
+ relpth = os.path.relpath(os.path.dirname(srcpath), recipedir)
+ destdir = os.path.abspath(os.path.join(destpath, relpth))
+ destfp = os.path.join(destdir, fn)
+ _move_file(srcpath, destfp, dry_run_outdir=dry_run_outdir, base_outdir=destpath)
+
+ if dry_run_outdir:
+ import difflib
+ comparelist = []
+ for root, _, files in os.walk(dry_run_outdir):
+ for fn in files:
+ outf = os.path.join(root, fn)
+ relf = os.path.relpath(outf, dry_run_outdir)
+ logger.debug('dry-run: output file %s' % relf)
+ if fn.endswith('.bb'):
+ if origfilelist and origpath and destpath:
+ # Need to match this up with the pre-upgrade recipe file
+ for origf in origfilelist:
+ if origf.endswith('.bb'):
+ comparelist.append((os.path.abspath(os.path.join(origpath, origf)),
+ outf,
+ os.path.abspath(os.path.join(destpath, relf))))
+ break
+ else:
+ # Compare to the existing recipe
+ comparelist.append((recipefile, outf, recipefile))
+ elif fn.endswith('.bbappend'):
+ if appendfile:
+ if os.path.exists(appendfile):
+ comparelist.append((appendfile, outf, appendfile))
+ else:
+ comparelist.append((None, outf, appendfile))
+ else:
+ if destpath:
+ recipedest = destpath
+ elif appendfile:
+ recipedest = os.path.dirname(appendfile)
+ else:
+ recipedest = os.path.dirname(recipefile)
+ destfp = os.path.join(recipedest, relf)
+ if os.path.exists(destfp):
+ comparelist.append((destfp, outf, destfp))
+ output = ''
+ for oldfile, newfile, newfileshow in comparelist:
+ if oldfile:
+ with open(oldfile, 'r') as f:
+ oldlines = f.readlines()
+ else:
+ oldfile = '/dev/null'
+ oldlines = []
+ with open(newfile, 'r') as f:
+ newlines = f.readlines()
+ if not newfileshow:
+ newfileshow = newfile
+ diff = difflib.unified_diff(oldlines, newlines, oldfile, newfileshow)
+ difflines = list(diff)
+ if difflines:
+ output += ''.join(difflines)
+ if output:
+ logger.info('Diff of changed files:\n%s' % output)
+ finally:
+ tinfoil.shutdown()
+
+ # Everything else has succeeded, we can now reset
+ if args.dry_run:
+ logger.info('Resetting recipe (dry-run)')
+ else:
+ _reset([args.recipename], no_clean=no_clean, config=config, basepath=basepath, workspace=workspace)
+
+ return 0
+
+
+def get_default_srctree(config, recipename=''):
+ """Get the default srctree path"""
+ srctreeparent = config.get('General', 'default_source_parent_dir', config.workspace_path)
+ if recipename:
+ return os.path.join(srctreeparent, 'sources', recipename)
+ else:
+ return os.path.join(srctreeparent, 'sources')
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+
+ defsrctree = get_default_srctree(context.config)
+ parser_add = subparsers.add_parser('add', help='Add a new recipe',
+ description='Adds a new recipe to the workspace to build a specified source tree. Can optionally fetch a remote URI and unpack it to create the source tree.',
+ group='starting', order=100)
+ parser_add.add_argument('recipename', nargs='?', help='Name for new recipe to add (just name - no version, path or extension). If not specified, will attempt to auto-detect it.')
+ parser_add.add_argument('srctree', nargs='?', help='Path to external source tree. If not specified, a subdirectory of %s will be used.' % defsrctree)
+ parser_add.add_argument('fetchuri', nargs='?', help='Fetch the specified URI and extract it to create the source tree')
+ group = parser_add.add_mutually_exclusive_group()
+ group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
+ parser_add.add_argument('--fetch', '-f', help='Fetch the specified URI and extract it to create the source tree (deprecated - pass as positional argument instead)', metavar='URI')
+ parser_add.add_argument('--fetch-dev', help='For npm, also fetch devDependencies', action="store_true")
+ parser_add.add_argument('--version', '-V', help='Version to use within recipe (PV)')
+ parser_add.add_argument('--no-git', '-g', help='If fetching source, do not set up source tree as a git repository', action="store_true")
+ group = parser_add.add_mutually_exclusive_group()
+ group.add_argument('--srcrev', '-S', help='Source revision to fetch if fetching from an SCM such as git (default latest)')
+ group.add_argument('--autorev', '-a', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
+ parser_add.add_argument('--srcbranch', '-B', help='Branch in source repository if fetching from an SCM such as git (default master)')
+ parser_add.add_argument('--binary', '-b', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure). Useful with binary packages e.g. RPMs.', action='store_true')
+ parser_add.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true')
+ parser_add.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
+ parser_add.add_argument('--mirrors', help='Enable PREMIRRORS and MIRRORS for source tree fetching (disable by default).', action="store_true")
+ parser_add.add_argument('--provides', '-p', help='Specify an alias for the item provided by the recipe. E.g. virtual/libgl')
+ parser_add.set_defaults(func=add, fixed_setup=context.fixed_setup)
+
+ parser_modify = subparsers.add_parser('modify', help='Modify the source for an existing recipe',
+ description='Sets up the build environment to modify the source for an existing recipe. The default behaviour is to extract the source being fetched by the recipe into a git tree so you can work on it; alternatively if you already have your own pre-prepared source tree you can specify -n/--no-extract.',
+ group='starting', order=90)
+ parser_modify.add_argument('recipename', help='Name of existing recipe to edit (just name - no version, path or extension)')
+ parser_modify.add_argument('srctree', nargs='?', help='Path to external source tree. If not specified, a subdirectory of %s will be used.' % defsrctree)
+ parser_modify.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend')
+ group = parser_modify.add_mutually_exclusive_group()
+ group.add_argument('--extract', '-x', action="store_true", help='Extract source for recipe (default)')
+ group.add_argument('--no-extract', '-n', action="store_true", help='Do not extract source, expect it to exist')
+ group = parser_modify.add_mutually_exclusive_group()
+ group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
+ parser_modify.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (when not using -n/--no-extract) (default "%(default)s")')
+ parser_modify.add_argument('--no-overrides', '-O', action="store_true", help='Do not create branches for other override configurations')
+ parser_modify.add_argument('--keep-temp', help='Keep temporary directory (for debugging)', action="store_true")
+ parser_modify.set_defaults(func=modify, fixed_setup=context.fixed_setup)
+
+ parser_extract = subparsers.add_parser('extract', help='Extract the source for an existing recipe',
+ description='Extracts the source for an existing recipe',
+ group='advanced')
+ parser_extract.add_argument('recipename', help='Name of recipe to extract the source for')
+ parser_extract.add_argument('srctree', help='Path to where to extract the source tree')
+ parser_extract.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (default "%(default)s")')
+ parser_extract.add_argument('--no-overrides', '-O', action="store_true", help='Do not create branches for other override configurations')
+ parser_extract.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
+ parser_extract.set_defaults(func=extract, fixed_setup=context.fixed_setup)
+
+ parser_sync = subparsers.add_parser('sync', help='Synchronize the source tree for an existing recipe',
+ description='Synchronize the previously extracted source tree for an existing recipe',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ group='advanced')
+ parser_sync.add_argument('recipename', help='Name of recipe to sync the source for')
+ parser_sync.add_argument('srctree', help='Path to the source tree')
+ parser_sync.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout')
+ parser_sync.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
+ parser_sync.set_defaults(func=sync, fixed_setup=context.fixed_setup)
+
+ parser_rename = subparsers.add_parser('rename', help='Rename a recipe file in the workspace',
+ description='Renames the recipe file for a recipe in the workspace, changing the name or version part or both, ensuring that all references within the workspace are updated at the same time. Only works when the recipe file itself is in the workspace, e.g. after devtool add. Particularly useful when devtool add did not automatically determine the correct name.',
+ group='working', order=10)
+ parser_rename.add_argument('recipename', help='Current name of recipe to rename')
+ parser_rename.add_argument('newname', nargs='?', help='New name for recipe (optional, not needed if you only want to change the version)')
+ parser_rename.add_argument('--version', '-V', help='Change the version (NOTE: this does not change the version fetched by the recipe, just the version in the recipe file name)')
+ parser_rename.add_argument('--no-srctree', '-s', action='store_true', help='Do not rename the source tree directory (if the default source tree path has been used) - keeping the old name may be desirable if there are internal/other external references to this path')
+ parser_rename.set_defaults(func=rename)
+
+ parser_update_recipe = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe',
+ description='Applies changes from external source tree to a recipe (updating/adding/removing patches as necessary, or by updating SRCREV). Note that these changes need to have been committed to the git repository in order to be recognised.',
+ group='working', order=-90)
+ parser_update_recipe.add_argument('recipename', help='Name of recipe to update')
+ parser_update_recipe.add_argument('--mode', '-m', choices=['patch', 'srcrev', 'auto'], default='auto', help='Update mode (where %(metavar)s is %(choices)s; default is %(default)s)', metavar='MODE')
+ parser_update_recipe.add_argument('--initial-rev', help='Override starting revision for patches')
+ parser_update_recipe.add_argument('--append', '-a', help='Write changes to a bbappend in the specified layer instead of the recipe', metavar='LAYERDIR')
+ parser_update_recipe.add_argument('--wildcard-version', '-w', help='In conjunction with -a/--append, use a wildcard to make the bbappend apply to any recipe version', action='store_true')
+ parser_update_recipe.add_argument('--no-remove', '-n', action="store_true", help='Don\'t remove patches, only add or update')
+ parser_update_recipe.add_argument('--no-overrides', '-O', action="store_true", help='Do not handle other override branches (if they exist)')
+ parser_update_recipe.add_argument('--dry-run', '-N', action="store_true", help='Dry-run (just report changes instead of writing them)')
+ parser_update_recipe.add_argument('--force-patch-refresh', action="store_true", help='Update patches in the layer even if they have not been modified (useful for refreshing patch context)')
+ parser_update_recipe.set_defaults(func=update_recipe)
+
+ parser_status = subparsers.add_parser('status', help='Show workspace status',
+ description='Lists recipes currently in your workspace and the paths to their respective external source trees',
+ group='info', order=100)
+ parser_status.set_defaults(func=status)
+
+ parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace',
+ description='Removes the specified recipe(s) from your workspace (resetting its state back to that defined by the metadata).',
+ group='working', order=-100)
+ parser_reset.add_argument('recipename', nargs='*', help='Recipe to reset')
+ parser_reset.add_argument('--all', '-a', action="store_true", help='Reset all recipes (clear workspace)')
+ parser_reset.add_argument('--no-clean', '-n', action="store_true", help='Don\'t clean the sysroot to remove recipe output')
+ parser_reset.set_defaults(func=reset)
+
+ parser_finish = subparsers.add_parser('finish', help='Finish working on a recipe in your workspace',
+ description='Pushes any committed changes to the specified recipe to the specified layer and removes it from your workspace. Roughly equivalent to an update-recipe followed by reset, except the update-recipe step will do the "right thing" depending on the recipe and the destination layer specified. Note that your changes must have been committed to the git repository in order to be recognised.',
+ group='working', order=-100)
+ parser_finish.add_argument('recipename', help='Recipe to finish')
+ parser_finish.add_argument('destination', help='Layer/path to put recipe into. Can be the name of a layer configured in your bblayers.conf, the path to the base of a layer, or a partial path inside a layer. %(prog)s will attempt to complete the path based on the layer\'s structure.')
+ parser_finish.add_argument('--mode', '-m', choices=['patch', 'srcrev', 'auto'], default='auto', help='Update mode (where %(metavar)s is %(choices)s; default is %(default)s)', metavar='MODE')
+ parser_finish.add_argument('--initial-rev', help='Override starting revision for patches')
+ parser_finish.add_argument('--force', '-f', action="store_true", help='Force continuing even if there are uncommitted changes in the source tree repository')
+ parser_finish.add_argument('--no-overrides', '-O', action="store_true", help='Do not handle other override branches (if they exist)')
+ parser_finish.add_argument('--dry-run', '-N', action="store_true", help='Dry-run (just report changes instead of writing them)')
+ parser_finish.add_argument('--force-patch-refresh', action="store_true", help='Update patches in the layer even if they have not been modified (useful for refreshing patch context)')
+ parser_finish.set_defaults(func=finish)
diff --git a/poky/scripts/lib/devtool/upgrade.py b/poky/scripts/lib/devtool/upgrade.py
new file mode 100644
index 000000000..c3fd866ef
--- /dev/null
+++ b/poky/scripts/lib/devtool/upgrade.py
@@ -0,0 +1,626 @@
+# Development tool - upgrade command plugin
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+"""Devtool upgrade plugin"""
+
+import os
+import sys
+import re
+import shutil
+import tempfile
+import logging
+import argparse
+import scriptutils
+import errno
+import bb
+
+devtool_path = os.path.dirname(os.path.realpath(__file__)) + '/../../../meta/lib'
+sys.path = sys.path + [devtool_path]
+
+import oe.recipeutils
+from devtool import standard
+from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version
+
+logger = logging.getLogger('devtool')
+
+def _run(cmd, cwd=''):
+ logger.debug("Running command %s> %s" % (cwd,cmd))
+ return bb.process.run('%s' % cmd, cwd=cwd)
+
+def _get_srctree(tmpdir):
+ srctree = tmpdir
+ dirs = os.listdir(tmpdir)
+ if len(dirs) == 1:
+ srctree = os.path.join(tmpdir, dirs[0])
+ return srctree
+
+def _copy_source_code(orig, dest):
+ for path in standard._ls_tree(orig):
+ dest_dir = os.path.join(dest, os.path.dirname(path))
+ bb.utils.mkdirhier(dest_dir)
+ dest_path = os.path.join(dest, path)
+ shutil.move(os.path.join(orig, path), dest_path)
+
+def _remove_patch_dirs(recipefolder):
+ for root, dirs, files in os.walk(recipefolder):
+ for d in dirs:
+ shutil.rmtree(os.path.join(root,d))
+
+def _recipe_contains(rd, var):
+ rf = rd.getVar('FILE')
+ varfiles = oe.recipeutils.get_var_files(rf, [var], rd)
+ for var, fn in varfiles.items():
+ if fn and fn.startswith(os.path.dirname(rf) + os.sep):
+ return True
+ return False
+
+def _rename_recipe_dirs(oldpv, newpv, path):
+ for root, dirs, files in os.walk(path):
+ # Rename directories with the version in their name
+ for olddir in dirs:
+ if olddir.find(oldpv) != -1:
+ newdir = olddir.replace(oldpv, newpv)
+ if olddir != newdir:
+ shutil.move(os.path.join(path, olddir), os.path.join(path, newdir))
+ # Rename any inc files with the version in their name (unusual, but possible)
+ for oldfile in files:
+ if oldfile.endswith('.inc'):
+ if oldfile.find(oldpv) != -1:
+ newfile = oldfile.replace(oldpv, newpv)
+ if oldfile != newfile:
+ os.rename(os.path.join(path, oldfile), os.path.join(path, newfile))
+
+def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path):
+ oldrecipe = os.path.basename(oldrecipe)
+ if oldrecipe.endswith('_%s.bb' % oldpv):
+ newrecipe = '%s_%s.bb' % (bpn, newpv)
+ if oldrecipe != newrecipe:
+ shutil.move(os.path.join(path, oldrecipe), os.path.join(path, newrecipe))
+ else:
+ newrecipe = oldrecipe
+ return os.path.join(path, newrecipe)
+
+def _rename_recipe_files(oldrecipe, bpn, oldpv, newpv, path):
+ _rename_recipe_dirs(oldpv, newpv, path)
+ return _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path)
+
+def _write_append(rc, srctree, same_dir, no_same_dir, rev, copied, workspace, d):
+ """Writes an append file"""
+ if not os.path.exists(rc):
+ raise DevtoolError("bbappend not created because %s does not exist" % rc)
+
+ appendpath = os.path.join(workspace, 'appends')
+ if not os.path.exists(appendpath):
+ bb.utils.mkdirhier(appendpath)
+
+ brf = os.path.basename(os.path.splitext(rc)[0]) # rc basename
+
+ srctree = os.path.abspath(srctree)
+ pn = d.getVar('PN')
+ af = os.path.join(appendpath, '%s.bbappend' % brf)
+ with open(af, 'w') as f:
+ f.write('FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n\n')
+ f.write('inherit externalsrc\n')
+ f.write(('# NOTE: We use pn- overrides here to avoid affecting'
+ 'multiple variants in the case where the recipe uses BBCLASSEXTEND\n'))
+ f.write('EXTERNALSRC_pn-%s = "%s"\n' % (pn, srctree))
+ b_is_s = use_external_build(same_dir, no_same_dir, d)
+ if b_is_s:
+ f.write('EXTERNALSRC_BUILD_pn-%s = "%s"\n' % (pn, srctree))
+ f.write('\n')
+ if rev:
+ f.write('# initial_rev: %s\n' % rev)
+ if copied:
+ f.write('# original_path: %s\n' % os.path.dirname(d.getVar('FILE')))
+ f.write('# original_files: %s\n' % ' '.join(copied))
+ return af
+
+def _cleanup_on_error(rf, srctree):
+ rfp = os.path.split(rf)[0] # recipe folder
+ rfpp = os.path.split(rfp)[0] # recipes folder
+ if os.path.exists(rfp):
+ shutil.rmtree(b)
+ if not len(os.listdir(rfpp)):
+ os.rmdir(rfpp)
+ srctree = os.path.abspath(srctree)
+ if os.path.exists(srctree):
+ shutil.rmtree(srctree)
+
+def _upgrade_error(e, rf, srctree):
+ if rf:
+ cleanup_on_error(rf, srctree)
+ logger.error(e)
+ raise DevtoolError(e)
+
+def _get_uri(rd):
+ srcuris = rd.getVar('SRC_URI').split()
+ if not len(srcuris):
+ raise DevtoolError('SRC_URI not found on recipe')
+ # Get first non-local entry in SRC_URI - usually by convention it's
+ # the first entry, but not always!
+ srcuri = None
+ for entry in srcuris:
+ if not entry.startswith('file://'):
+ srcuri = entry
+ break
+ if not srcuri:
+ raise DevtoolError('Unable to find non-local entry in SRC_URI')
+ srcrev = '${AUTOREV}'
+ if '://' in srcuri:
+ # Fetch a URL
+ rev_re = re.compile(';rev=([^;]+)')
+ res = rev_re.search(srcuri)
+ if res:
+ srcrev = res.group(1)
+ srcuri = rev_re.sub('', srcuri)
+ return srcuri, srcrev
+
+def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, keep_temp, tinfoil, rd):
+ """Extract sources of a recipe with a new version"""
+
+ def __run(cmd):
+ """Simple wrapper which calls _run with srctree as cwd"""
+ return _run(cmd, srctree)
+
+ crd = rd.createCopy()
+
+ pv = crd.getVar('PV')
+ crd.setVar('PV', newpv)
+
+ tmpsrctree = None
+ uri, rev = _get_uri(crd)
+ if srcrev:
+ rev = srcrev
+ if uri.startswith('git://'):
+ __run('git fetch')
+ __run('git checkout %s' % rev)
+ __run('git tag -f devtool-base-new')
+ md5 = None
+ sha256 = None
+ _, _, _, _, _, params = bb.fetch2.decodeurl(uri)
+ srcsubdir_rel = params.get('destsuffix', 'git')
+ if not srcbranch:
+ check_branch, check_branch_err = __run('git branch -r --contains %s' % srcrev)
+ get_branch = [x.strip() for x in check_branch.splitlines()]
+ # Remove HEAD reference point and drop remote prefix
+ get_branch = [x.split('/', 1)[1] for x in get_branch if not x.startswith('origin/HEAD')]
+ if 'master' in get_branch:
+ # If it is master, we do not need to append 'branch=master' as this is default.
+ # Even with the case where get_branch has multiple objects, if 'master' is one
+ # of them, we should default take from 'master'
+ srcbranch = ''
+ elif len(get_branch) == 1:
+ # If 'master' isn't in get_branch and get_branch contains only ONE object, then store result into 'srcbranch'
+ srcbranch = get_branch[0]
+ else:
+ # If get_branch contains more than one objects, then display error and exit.
+ mbrch = '\n ' + '\n '.join(get_branch)
+ raise DevtoolError('Revision %s was found on multiple branches: %s\nPlease provide the correct branch in the devtool command with "--srcbranch" or "-B" option.' % (srcrev, mbrch))
+ else:
+ __run('git checkout devtool-base -b devtool-%s' % newpv)
+
+ tmpdir = tempfile.mkdtemp(prefix='devtool')
+ try:
+ checksums, ftmpdir = scriptutils.fetch_url(tinfoil, uri, rev, tmpdir, logger, preserve_tmp=keep_temp)
+ except scriptutils.FetchUrlFailure as e:
+ raise DevtoolError(e)
+
+ if ftmpdir and keep_temp:
+ logger.info('Fetch temp directory is %s' % ftmpdir)
+
+ md5 = checksums['md5sum']
+ sha256 = checksums['sha256sum']
+
+ tmpsrctree = _get_srctree(tmpdir)
+ srctree = os.path.abspath(srctree)
+ srcsubdir_rel = os.path.relpath(tmpsrctree, tmpdir)
+
+ # Delete all sources so we ensure no stray files are left over
+ for item in os.listdir(srctree):
+ if item in ['.git', 'oe-local-files']:
+ continue
+ itempath = os.path.join(srctree, item)
+ if os.path.isdir(itempath):
+ shutil.rmtree(itempath)
+ else:
+ os.remove(itempath)
+
+ # Copy in new ones
+ _copy_source_code(tmpsrctree, srctree)
+
+ (stdout,_) = __run('git ls-files --modified --others --exclude-standard')
+ filelist = stdout.splitlines()
+ pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist))
+ pbar.start()
+ batchsize = 100
+ for i in range(0, len(filelist), batchsize):
+ batch = filelist[i:i+batchsize]
+ __run('git add -A %s' % ' '.join(['"%s"' % item for item in batch]))
+ pbar.update(i)
+ pbar.finish()
+
+ useroptions = []
+ oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)
+ __run('git %s commit -q -m "Commit of upstream changes at version %s" --allow-empty' % (' '.join(useroptions), newpv))
+ __run('git tag -f devtool-base-%s' % newpv)
+
+ (stdout, _) = __run('git rev-parse HEAD')
+ rev = stdout.rstrip()
+
+ if no_patch:
+ patches = oe.recipeutils.get_recipe_patches(crd)
+ if patches:
+ logger.warn('By user choice, the following patches will NOT be applied to the new source tree:\n %s' % '\n '.join([os.path.basename(patch) for patch in patches]))
+ else:
+ __run('git checkout devtool-patched -b %s' % branch)
+ skiptag = False
+ try:
+ __run('git rebase %s' % rev)
+ except bb.process.ExecutionError as e:
+ skiptag = True
+ if 'conflict' in e.stdout:
+ logger.warn('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
+ else:
+ logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
+ if not skiptag:
+ if uri.startswith('git://'):
+ suffix = 'new'
+ else:
+ suffix = newpv
+ __run('git tag -f devtool-patched-%s' % suffix)
+
+ if tmpsrctree:
+ if keep_temp:
+ logger.info('Preserving temporary directory %s' % tmpsrctree)
+ else:
+ shutil.rmtree(tmpsrctree)
+
+ return (rev, md5, sha256, srcbranch, srcsubdir_rel)
+
+def _add_license_diff_to_recipe(path, diff):
+ notice_text = """# FIXME: the LIC_FILES_CHKSUM values have been updated by 'devtool upgrade'.
+# The following is the difference between the old and the new license text.
+# Please update the LICENSE value if needed, and summarize the changes in
+# the commit message via 'License-Update:' tag.
+# (example: 'License-Update: copyright years updated.')
+#
+# The changes:
+#
+"""
+ commented_diff = "\n".join(["# {}".format(l) for l in diff.split('\n')])
+ with open(path, 'rb') as f:
+ orig_content = f.read()
+ with open(path, 'wb') as f:
+ f.write(notice_text.encode())
+ f.write(commented_diff.encode())
+ f.write("\n#\n\n".encode())
+ f.write(orig_content)
+
+def _create_new_recipe(newpv, md5, sha256, srcrev, srcbranch, srcsubdir_old, srcsubdir_new, workspace, tinfoil, rd, license_diff, new_licenses):
+ """Creates the new recipe under workspace"""
+
+ bpn = rd.getVar('BPN')
+ path = os.path.join(workspace, 'recipes', bpn)
+ bb.utils.mkdirhier(path)
+ copied, _ = oe.recipeutils.copy_recipe_files(rd, path, all_variants=True)
+ if not copied:
+ raise DevtoolError('Internal error - no files were copied for recipe %s' % bpn)
+ logger.debug('Copied %s to %s' % (copied, path))
+
+ oldpv = rd.getVar('PV')
+ if not newpv:
+ newpv = oldpv
+ origpath = rd.getVar('FILE')
+ fullpath = _rename_recipe_files(origpath, bpn, oldpv, newpv, path)
+ logger.debug('Upgraded %s => %s' % (origpath, fullpath))
+
+ newvalues = {}
+ if _recipe_contains(rd, 'PV') and newpv != oldpv:
+ newvalues['PV'] = newpv
+
+ if srcrev:
+ newvalues['SRCREV'] = srcrev
+
+ if srcbranch:
+ src_uri = oe.recipeutils.split_var_value(rd.getVar('SRC_URI', False) or '')
+ changed = False
+ replacing = True
+ new_src_uri = []
+ for entry in src_uri:
+ scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(entry)
+ if replacing and scheme in ['git', 'gitsm']:
+ branch = params.get('branch', 'master')
+ if rd.expand(branch) != srcbranch:
+ # Handle case where branch is set through a variable
+ res = re.match(r'\$\{([^}@]+)\}', branch)
+ if res:
+ newvalues[res.group(1)] = srcbranch
+ # We know we won't change SRC_URI now, so break out
+ break
+ else:
+ params['branch'] = srcbranch
+ entry = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
+ changed = True
+ replacing = False
+ new_src_uri.append(entry)
+ if changed:
+ newvalues['SRC_URI'] = ' '.join(new_src_uri)
+
+ newvalues['PR'] = None
+
+ # Work out which SRC_URI entries have changed in case the entry uses a name
+ crd = rd.createCopy()
+ crd.setVar('PV', newpv)
+ for var, value in newvalues.items():
+ crd.setVar(var, value)
+ old_src_uri = (rd.getVar('SRC_URI') or '').split()
+ new_src_uri = (crd.getVar('SRC_URI') or '').split()
+ newnames = []
+ addnames = []
+ for newentry in new_src_uri:
+ _, _, _, _, _, params = bb.fetch2.decodeurl(newentry)
+ if 'name' in params:
+ newnames.append(params['name'])
+ if newentry not in old_src_uri:
+ addnames.append(params['name'])
+ # Find what's been set in the original recipe
+ oldnames = []
+ noname = False
+ for varflag in rd.getVarFlags('SRC_URI'):
+ if varflag.endswith(('.md5sum', '.sha256sum')):
+ name = varflag.rsplit('.', 1)[0]
+ if name not in oldnames:
+ oldnames.append(name)
+ elif varflag in ['md5sum', 'sha256sum']:
+ noname = True
+ # Even if SRC_URI has named entries it doesn't have to actually use the name
+ if noname and addnames and addnames[0] not in oldnames:
+ addnames = []
+ # Drop any old names (the name actually might include ${PV})
+ for name in oldnames:
+ if name not in newnames:
+ newvalues['SRC_URI[%s.md5sum]' % name] = None
+ newvalues['SRC_URI[%s.sha256sum]' % name] = None
+
+ if md5 and sha256:
+ if addnames:
+ nameprefix = '%s.' % addnames[0]
+ else:
+ nameprefix = ''
+ newvalues['SRC_URI[%smd5sum]' % nameprefix] = md5
+ newvalues['SRC_URI[%ssha256sum]' % nameprefix] = sha256
+
+ if srcsubdir_new != srcsubdir_old:
+ s_subdir_old = os.path.relpath(os.path.abspath(rd.getVar('S')), rd.getVar('WORKDIR'))
+ s_subdir_new = os.path.relpath(os.path.abspath(crd.getVar('S')), crd.getVar('WORKDIR'))
+ if srcsubdir_old == s_subdir_old and srcsubdir_new != s_subdir_new:
+ # Subdir for old extracted source matches what S points to (it should!)
+ # but subdir for new extracted source doesn't match what S will be
+ newvalues['S'] = '${WORKDIR}/%s' % srcsubdir_new.replace(newpv, '${PV}')
+ if crd.expand(newvalues['S']) == crd.expand('${WORKDIR}/${BP}'):
+ # It's the default, drop it
+ # FIXME what if S is being set in a .inc?
+ newvalues['S'] = None
+ logger.info('Source subdirectory has changed, dropping S value since it now matches the default ("${WORKDIR}/${BP}")')
+ else:
+ logger.info('Source subdirectory has changed, updating S value')
+
+ if license_diff:
+ newlicchksum = " ".join(["file://{};md5={}".format(l["path"], l["actual_md5"]) + (";beginline={}".format(l["beginline"]) if l["beginline"] else "") + (";endline={}".format(l["endline"]) if l["endline"] else "") for l in new_licenses])
+ newvalues["LIC_FILES_CHKSUM"] = newlicchksum
+ _add_license_diff_to_recipe(fullpath, license_diff)
+
+ rd = tinfoil.parse_recipe_file(fullpath, False)
+ oe.recipeutils.patch_recipe(rd, fullpath, newvalues)
+
+ return fullpath, copied
+
+
+def _check_git_config():
+ def getconfig(name):
+ try:
+ value = bb.process.run('git config --global %s' % name)[0].strip()
+ except bb.process.ExecutionError as e:
+ if e.exitcode == 1:
+ value = None
+ else:
+ raise
+ return value
+
+ username = getconfig('user.name')
+ useremail = getconfig('user.email')
+ configerr = []
+ if not username:
+ configerr.append('Please set your name using:\n git config --global user.name')
+ if not useremail:
+ configerr.append('Please set your email using:\n git config --global user.email')
+ if configerr:
+ raise DevtoolError('Your git configuration is incomplete which will prevent rebases from working:\n' + '\n'.join(configerr))
+
+def _extract_licenses(srcpath, recipe_licenses):
+ licenses = []
+ for url in recipe_licenses.split():
+ license = {}
+ (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+ license['path'] = path
+ license['md5'] = parm.get('md5', '')
+ license['beginline'], license['endline'] = 0, 0
+ if 'beginline' in parm:
+ license['beginline'] = int(parm['beginline'])
+ if 'endline' in parm:
+ license['endline'] = int(parm['endline'])
+ license['text'] = []
+ with open(os.path.join(srcpath, path), 'rb') as f:
+ import hashlib
+ actual_md5 = hashlib.md5()
+ lineno = 0
+ for line in f:
+ lineno += 1
+ if (lineno >= license['beginline']) and ((lineno <= license['endline']) or not license['endline']):
+ license['text'].append(line.decode(errors='ignore'))
+ actual_md5.update(line)
+ license['actual_md5'] = actual_md5.hexdigest()
+ licenses.append(license)
+ return licenses
+
+def _generate_license_diff(old_licenses, new_licenses):
+ need_diff = False
+ for l in new_licenses:
+ if l['md5'] != l['actual_md5']:
+ need_diff = True
+ break
+ if need_diff == False:
+ return None
+
+ import difflib
+ diff = ''
+ for old, new in zip(old_licenses, new_licenses):
+ for line in difflib.unified_diff(old['text'], new['text'], old['path'], new['path']):
+ diff = diff + line
+ return diff
+
+def upgrade(args, config, basepath, workspace):
+ """Entry point for the devtool 'upgrade' subcommand"""
+
+ if args.recipename in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" % args.recipename)
+ if args.srcbranch and not args.srcrev:
+ raise DevtoolError("If you specify --srcbranch/-B then you must use --srcrev/-S to specify the revision" % args.recipename)
+
+ _check_git_config()
+
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+
+ pn = rd.getVar('PN')
+ if pn != args.recipename:
+ logger.info('Mapping %s to %s' % (args.recipename, pn))
+ if pn in workspace:
+ raise DevtoolError("recipe %s is already in your workspace" % pn)
+
+ if args.srctree:
+ srctree = os.path.abspath(args.srctree)
+ else:
+ srctree = standard.get_default_srctree(config, pn)
+
+ # try to automatically discover latest version and revision if not provided on command line
+ if not args.version and not args.srcrev:
+ version_info = oe.recipeutils.get_recipe_upstream_version(rd)
+ if version_info['version'] and not version_info['version'].endswith("new-commits-available"):
+ args.version = version_info['version']
+ if version_info['revision']:
+ args.srcrev = version_info['revision']
+ if not args.version and not args.srcrev:
+ raise DevtoolError("Automatic discovery of latest version/revision failed - you must provide a version using the --version/-V option, or for recipes that fetch from an SCM such as git, the --srcrev/-S option.")
+
+ standard._check_compatible_recipe(pn, rd)
+ old_srcrev = rd.getVar('SRCREV')
+ if old_srcrev == 'INVALID':
+ old_srcrev = None
+ if old_srcrev and not args.srcrev:
+ raise DevtoolError("Recipe specifies a SRCREV value; you must specify a new one when upgrading")
+ old_ver = rd.getVar('PV')
+ if old_ver == args.version and old_srcrev == args.srcrev:
+ raise DevtoolError("Current and upgrade versions are the same version")
+ if args.version:
+ if bb.utils.vercmp_string(args.version, old_ver) < 0:
+ logger.warning('Upgrade version %s compares as less than the current version %s. If you are using a package feed for on-target upgrades or providing this recipe for general consumption, then you should increment PE in the recipe (or if there is no current PE value set, set it to "1")' % (args.version, old_ver))
+ check_prerelease_version(args.version, 'devtool upgrade')
+
+ rf = None
+ license_diff = None
+ try:
+ logger.info('Extracting current version source...')
+ rev1, srcsubdir1 = standard._extract_source(srctree, False, 'devtool-orig', False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
+ old_licenses = _extract_licenses(srctree, rd.getVar('LIC_FILES_CHKSUM'))
+ logger.info('Extracting upgraded version source...')
+ rev2, md5, sha256, srcbranch, srcsubdir2 = _extract_new_source(args.version, srctree, args.no_patch,
+ args.srcrev, args.srcbranch, args.branch, args.keep_temp,
+ tinfoil, rd)
+ new_licenses = _extract_licenses(srctree, rd.getVar('LIC_FILES_CHKSUM'))
+ license_diff = _generate_license_diff(old_licenses, new_licenses)
+ rf, copied = _create_new_recipe(args.version, md5, sha256, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses)
+ except bb.process.CmdError as e:
+ _upgrade_error(e, rf, srctree)
+ except DevtoolError as e:
+ _upgrade_error(e, rf, srctree)
+ standard._add_md5(config, pn, os.path.dirname(rf))
+
+ af = _write_append(rf, srctree, args.same_dir, args.no_same_dir, rev2,
+ copied, config.workspace_path, rd)
+ standard._add_md5(config, pn, af)
+
+ update_unlockedsigs(basepath, workspace, args.fixed_setup, [pn])
+
+ logger.info('Upgraded source extracted to %s' % srctree)
+ logger.info('New recipe is %s' % rf)
+ if license_diff:
+ logger.info('License checksums have been updated in the new recipe; please refer to it for the difference between the old and the new license texts.')
+ finally:
+ tinfoil.shutdown()
+ return 0
+
+def latest_version(args, config, basepath, workspace):
+ """Entry point for the devtool 'latest_version' subcommand"""
+ tinfoil = setup_tinfoil(basepath=basepath, tracking=True)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ return 1
+ version_info = oe.recipeutils.get_recipe_upstream_version(rd)
+ # "new-commits-available" is an indication that upstream never issues version tags
+ if not version_info['version'].endswith("new-commits-available"):
+ logger.info("Current version: {}".format(version_info['current_version']))
+ logger.info("Latest version: {}".format(version_info['version']))
+ if version_info['revision']:
+ logger.info("Latest version's commit: {}".format(version_info['revision']))
+ else:
+ logger.info("Latest commit: {}".format(version_info['revision']))
+ finally:
+ tinfoil.shutdown()
+ return 0
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+
+ defsrctree = standard.get_default_srctree(context.config)
+
+ parser_upgrade = subparsers.add_parser('upgrade', help='Upgrade an existing recipe',
+ description='Upgrades an existing recipe to a new upstream version. Puts the upgraded recipe file into the workspace along with any associated files, and extracts the source tree to a specified location (in case patches need rebasing or adding to as a result of the upgrade).',
+ group='starting')
+ parser_upgrade.add_argument('recipename', help='Name of recipe to upgrade (just name - no version, path or extension)')
+ parser_upgrade.add_argument('srctree', nargs='?', help='Path to where to extract the source tree. If not specified, a subdirectory of %s will be used.' % defsrctree)
+ parser_upgrade.add_argument('--version', '-V', help='Version to upgrade to (PV). If omitted, latest upstream version will be determined and used, if possible.')
+ parser_upgrade.add_argument('--srcrev', '-S', help='Source revision to upgrade to (useful when fetching from an SCM such as git)')
+ parser_upgrade.add_argument('--srcbranch', '-B', help='Branch in source repository containing the revision to use (if fetching from an SCM such as git)')
+ parser_upgrade.add_argument('--branch', '-b', default="devtool", help='Name for new development branch to checkout (default "%(default)s")')
+ parser_upgrade.add_argument('--no-patch', action="store_true", help='Do not apply patches from the recipe to the new source code')
+ parser_upgrade.add_argument('--no-overrides', '-O', action="store_true", help='Do not create branches for other override configurations')
+ group = parser_upgrade.add_mutually_exclusive_group()
+ group.add_argument('--same-dir', '-s', help='Build in same directory as source', action="store_true")
+ group.add_argument('--no-same-dir', help='Force build in a separate build directory', action="store_true")
+ parser_upgrade.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
+ parser_upgrade.set_defaults(func=upgrade, fixed_setup=context.fixed_setup)
+
+ parser_latest_version = subparsers.add_parser('latest-version', help='Report the latest version of an existing recipe',
+ description='Queries the upstream server for what the latest upstream release is (for git, tags are checked, for tarballs, a list of them is obtained, and one with the highest version number is reported)',
+ group='info')
+ parser_latest_version.add_argument('recipename', help='Name of recipe to query (just name - no version, path or extension)')
+ parser_latest_version.set_defaults(func=latest_version)
diff --git a/poky/scripts/lib/devtool/utilcmds.py b/poky/scripts/lib/devtool/utilcmds.py
new file mode 100644
index 000000000..7cd139fb8
--- /dev/null
+++ b/poky/scripts/lib/devtool/utilcmds.py
@@ -0,0 +1,252 @@
+# Development tool - utility commands plugin
+#
+# Copyright (C) 2015-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""Devtool utility plugins"""
+
+import os
+import sys
+import shutil
+import tempfile
+import logging
+import argparse
+import subprocess
+import scriptutils
+from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError
+from devtool import parse_recipe
+
+logger = logging.getLogger('devtool')
+
+def _find_recipe_path(args, config, basepath, workspace):
+ if args.any_recipe:
+ logger.warning('-a/--any-recipe option is now always active, and thus the option will be removed in a future release')
+ if args.recipename in workspace:
+ recipefile = workspace[args.recipename]['recipefile']
+ else:
+ recipefile = None
+ if not recipefile:
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, True)
+ if not rd:
+ raise DevtoolError("Failed to find specified recipe")
+ recipefile = rd.getVar('FILE')
+ finally:
+ tinfoil.shutdown()
+ return recipefile
+
+
+def find_recipe(args, config, basepath, workspace):
+ """Entry point for the devtool 'find-recipe' subcommand"""
+ recipefile = _find_recipe_path(args, config, basepath, workspace)
+ print(recipefile)
+ return 0
+
+
+def edit_recipe(args, config, basepath, workspace):
+ """Entry point for the devtool 'edit-recipe' subcommand"""
+ return scriptutils.run_editor(_find_recipe_path(args, config, basepath, workspace), logger)
+
+
+def configure_help(args, config, basepath, workspace):
+ """Entry point for the devtool 'configure-help' subcommand"""
+ import oe.utils
+
+ check_workspace_recipe(workspace, args.recipename)
+ tinfoil = setup_tinfoil(config_only=False, basepath=basepath)
+ try:
+ rd = parse_recipe(config, tinfoil, args.recipename, appends=True, filter_workspace=False)
+ if not rd:
+ return 1
+ b = rd.getVar('B')
+ s = rd.getVar('S')
+ configurescript = os.path.join(s, 'configure')
+ confdisabled = 'noexec' in rd.getVarFlags('do_configure') or 'do_configure' not in (rd.getVar('__BBTASKS', False) or [])
+ configureopts = oe.utils.squashspaces(rd.getVar('CONFIGUREOPTS') or '')
+ extra_oeconf = oe.utils.squashspaces(rd.getVar('EXTRA_OECONF') or '')
+ extra_oecmake = oe.utils.squashspaces(rd.getVar('EXTRA_OECMAKE') or '')
+ do_configure = rd.getVar('do_configure') or ''
+ do_configure_noexpand = rd.getVar('do_configure', False) or ''
+ packageconfig = rd.getVarFlags('PACKAGECONFIG') or []
+ autotools = bb.data.inherits_class('autotools', rd) and ('oe_runconf' in do_configure or 'autotools_do_configure' in do_configure)
+ cmake = bb.data.inherits_class('cmake', rd) and ('cmake_do_configure' in do_configure)
+ cmake_do_configure = rd.getVar('cmake_do_configure')
+ pn = rd.getVar('PN')
+ finally:
+ tinfoil.shutdown()
+
+ if 'doc' in packageconfig:
+ del packageconfig['doc']
+
+ if autotools and not os.path.exists(configurescript):
+ logger.info('Running do_configure to generate configure script')
+ try:
+ stdout, _ = exec_build_env_command(config.init_path, basepath,
+ 'bitbake -c configure %s' % args.recipename,
+ stderr=subprocess.STDOUT)
+ except bb.process.ExecutionError:
+ pass
+
+ if confdisabled or do_configure.strip() in ('', ':'):
+ raise DevtoolError("do_configure task has been disabled for this recipe")
+ elif args.no_pager and not os.path.exists(configurescript):
+ raise DevtoolError("No configure script found and no other information to display")
+ else:
+ configopttext = ''
+ if autotools and configureopts:
+ configopttext = '''
+Arguments currently passed to the configure script:
+
+%s
+
+Some of those are fixed.''' % (configureopts + ' ' + extra_oeconf)
+ if extra_oeconf:
+ configopttext += ''' The ones that are specified through EXTRA_OECONF (which you can change or add to easily):
+
+%s''' % extra_oeconf
+
+ elif cmake:
+ in_cmake = False
+ cmake_cmd = ''
+ for line in cmake_do_configure.splitlines():
+ if in_cmake:
+ cmake_cmd = cmake_cmd + ' ' + line.strip().rstrip('\\')
+ if not line.endswith('\\'):
+ break
+ if line.lstrip().startswith('cmake '):
+ cmake_cmd = line.strip().rstrip('\\')
+ if line.endswith('\\'):
+ in_cmake = True
+ else:
+ break
+ if cmake_cmd:
+ configopttext = '''
+The current cmake command line:
+
+%s
+
+Arguments specified through EXTRA_OECMAKE (which you can change or add to easily)
+
+%s''' % (oe.utils.squashspaces(cmake_cmd), extra_oecmake)
+ else:
+ configopttext = '''
+The current implementation of cmake_do_configure:
+
+cmake_do_configure() {
+%s
+}
+
+Arguments specified through EXTRA_OECMAKE (which you can change or add to easily)
+
+%s''' % (cmake_do_configure.rstrip(), extra_oecmake)
+
+ elif do_configure:
+ configopttext = '''
+The current implementation of do_configure:
+
+do_configure() {
+%s
+}''' % do_configure.rstrip()
+ if '${EXTRA_OECONF}' in do_configure_noexpand:
+ configopttext += '''
+
+Arguments specified through EXTRA_OECONF (which you can change or add to easily):
+
+%s''' % extra_oeconf
+
+ if packageconfig:
+ configopttext += '''
+
+Some of these options may be controlled through PACKAGECONFIG; for more details please see the recipe.'''
+
+ if args.arg:
+ helpargs = ' '.join(args.arg)
+ elif cmake:
+ helpargs = '-LH'
+ else:
+ helpargs = '--help'
+
+ msg = '''configure information for %s
+------------------------------------------
+%s''' % (pn, configopttext)
+
+ if cmake:
+ msg += '''
+
+The cmake %s output for %s follows. After "-- Cache values" you should see a list of variables you can add to EXTRA_OECMAKE (prefixed with -D and suffixed with = followed by the desired value, without any spaces).
+------------------------------------------''' % (helpargs, pn)
+ elif os.path.exists(configurescript):
+ msg += '''
+
+The ./configure %s output for %s follows.
+------------------------------------------''' % (helpargs, pn)
+
+ olddir = os.getcwd()
+ tmppath = tempfile.mkdtemp()
+ with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+ if not args.no_header:
+ tf.write(msg + '\n')
+ tf.close()
+ try:
+ try:
+ cmd = 'cat %s' % tf.name
+ if cmake:
+ cmd += '; cmake %s %s 2>&1' % (helpargs, s)
+ os.chdir(b)
+ elif os.path.exists(configurescript):
+ cmd += '; %s %s' % (configurescript, helpargs)
+ if sys.stdout.isatty() and not args.no_pager:
+ pager = os.environ.get('PAGER', 'less')
+ cmd = '(%s) | %s' % (cmd, pager)
+ subprocess.check_call(cmd, shell=True)
+ except subprocess.CalledProcessError as e:
+ return e.returncode
+ finally:
+ os.chdir(olddir)
+ shutil.rmtree(tmppath)
+ os.remove(tf.name)
+
+
+def register_commands(subparsers, context):
+ """Register devtool subcommands from this plugin"""
+ parser_edit_recipe = subparsers.add_parser('edit-recipe', help='Edit a recipe file',
+ description='Runs the default editor (as specified by the EDITOR variable) on the specified recipe. Note that this will be quicker for recipes in the workspace as the cache does not need to be loaded in that case.',
+ group='working')
+ parser_edit_recipe.add_argument('recipename', help='Recipe to edit')
+ # FIXME drop -a at some point in future
+ parser_edit_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Does nothing (exists for backwards-compatibility)')
+ parser_edit_recipe.set_defaults(func=edit_recipe)
+
+ # Find-recipe
+ parser_find_recipe = subparsers.add_parser('find-recipe', help='Find a recipe file',
+ description='Finds a recipe file. Note that this will be quicker for recipes in the workspace as the cache does not need to be loaded in that case.',
+ group='working')
+ parser_find_recipe.add_argument('recipename', help='Recipe to find')
+ # FIXME drop -a at some point in future
+ parser_find_recipe.add_argument('--any-recipe', '-a', action="store_true", help='Does nothing (exists for backwards-compatibility)')
+ parser_find_recipe.set_defaults(func=find_recipe)
+
+ # NOTE: Needed to override the usage string here since the default
+ # gets the order wrong - recipename must come before --arg
+ parser_configure_help = subparsers.add_parser('configure-help', help='Get help on configure script options',
+ usage='devtool configure-help [options] recipename [--arg ...]',
+ description='Displays the help for the configure script for the specified recipe (i.e. runs ./configure --help) prefaced by a header describing the current options being specified. Output is piped through less (or whatever PAGER is set to, if set) for easy browsing.',
+ group='working')
+ parser_configure_help.add_argument('recipename', help='Recipe to show configure help for')
+ parser_configure_help.add_argument('-p', '--no-pager', help='Disable paged output', action="store_true")
+ parser_configure_help.add_argument('-n', '--no-header', help='Disable explanatory header text', action="store_true")
+ parser_configure_help.add_argument('--arg', help='Pass remaining arguments to the configure script instead of --help (useful if the script has additional help options)', nargs=argparse.REMAINDER)
+ parser_configure_help.set_defaults(func=configure_help)
diff --git a/poky/scripts/lib/recipetool/__init__.py b/poky/scripts/lib/recipetool/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/scripts/lib/recipetool/__init__.py
diff --git a/poky/scripts/lib/recipetool/append.py b/poky/scripts/lib/recipetool/append.py
new file mode 100644
index 000000000..69c8bb77a
--- /dev/null
+++ b/poky/scripts/lib/recipetool/append.py
@@ -0,0 +1,457 @@
+# Recipe creation tool - append plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import fnmatch
+import re
+import subprocess
+import logging
+import stat
+import shutil
+import scriptutils
+import errno
+from collections import defaultdict
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+# FIXME guessing when we don't have pkgdata?
+# FIXME mode to create patch rather than directly substitute
+
+class InvalidTargetFileError(Exception):
+ pass
+
+def find_target_file(targetpath, d, pkglist=None):
+ """Find the recipe installing the specified target path, optionally limited to a select list of packages"""
+ import json
+
+ pkgdata_dir = d.getVar('PKGDATA_DIR')
+
+ # The mix between /etc and ${sysconfdir} here may look odd, but it is just
+ # being consistent with usage elsewhere
+ invalidtargets = {'${sysconfdir}/version': '${sysconfdir}/version is written out at image creation time',
+ '/etc/timestamp': '/etc/timestamp is written out at image creation time',
+ '/dev/*': '/dev is handled by udev (or equivalent) and the kernel (devtmpfs)',
+ '/etc/passwd': '/etc/passwd should be managed through the useradd and extrausers classes',
+ '/etc/group': '/etc/group should be managed through the useradd and extrausers classes',
+ '/etc/shadow': '/etc/shadow should be managed through the useradd and extrausers classes',
+ '/etc/gshadow': '/etc/gshadow should be managed through the useradd and extrausers classes',
+ '${sysconfdir}/hostname': '${sysconfdir}/hostname contents should be set by setting hostname_pn-base-files = "value" in configuration',}
+
+ for pthspec, message in invalidtargets.items():
+ if fnmatch.fnmatchcase(targetpath, d.expand(pthspec)):
+ raise InvalidTargetFileError(d.expand(message))
+
+ targetpath_re = re.compile(r'\s+(\$D)?%s(\s|$)' % targetpath)
+
+ recipes = defaultdict(list)
+ for root, dirs, files in os.walk(os.path.join(pkgdata_dir, 'runtime')):
+ if pkglist:
+ filelist = pkglist
+ else:
+ filelist = files
+ for fn in filelist:
+ pkgdatafile = os.path.join(root, fn)
+ if pkglist and not os.path.exists(pkgdatafile):
+ continue
+ with open(pkgdatafile, 'r') as f:
+ pn = ''
+ # This does assume that PN comes before other values, but that's a fairly safe assumption
+ for line in f:
+ if line.startswith('PN:'):
+ pn = line.split(':', 1)[1].strip()
+ elif line.startswith('FILES_INFO:'):
+ val = line.split(':', 1)[1].strip()
+ dictval = json.loads(val)
+ for fullpth in dictval.keys():
+ if fnmatch.fnmatchcase(fullpth, targetpath):
+ recipes[targetpath].append(pn)
+ elif line.startswith('pkg_preinst_') or line.startswith('pkg_postinst_'):
+ scriptval = line.split(':', 1)[1].strip().encode('utf-8').decode('unicode_escape')
+ if 'update-alternatives --install %s ' % targetpath in scriptval:
+ recipes[targetpath].append('?%s' % pn)
+ elif targetpath_re.search(scriptval):
+ recipes[targetpath].append('!%s' % pn)
+ return recipes
+
+def _parse_recipe(pn, tinfoil):
+ try:
+ rd = tinfoil.parse_recipe(pn)
+ except bb.providers.NoProvider as e:
+ logger.error(str(e))
+ return None
+ return rd
+
+def determine_file_source(targetpath, rd):
+ """Assuming we know a file came from a specific recipe, figure out exactly where it came from"""
+ import oe.recipeutils
+
+ # See if it's in do_install for the recipe
+ workdir = rd.getVar('WORKDIR')
+ src_uri = rd.getVar('SRC_URI')
+ srcfile = ''
+ modpatches = []
+ elements = check_do_install(rd, targetpath)
+ if elements:
+ logger.debug('do_install line:\n%s' % ' '.join(elements))
+ srcpath = get_source_path(elements)
+ logger.debug('source path: %s' % srcpath)
+ if not srcpath.startswith('/'):
+ # Handle non-absolute path
+ srcpath = os.path.abspath(os.path.join(rd.getVarFlag('do_install', 'dirs').split()[-1], srcpath))
+ if srcpath.startswith(workdir):
+ # OK, now we have the source file name, look for it in SRC_URI
+ workdirfile = os.path.relpath(srcpath, workdir)
+ # FIXME this is where we ought to have some code in the fetcher, because this is naive
+ for item in src_uri.split():
+ localpath = bb.fetch2.localpath(item, rd)
+ # Source path specified in do_install might be a glob
+ if fnmatch.fnmatch(os.path.basename(localpath), workdirfile):
+ srcfile = 'file://%s' % localpath
+ elif '/' in workdirfile:
+ if item == 'file://%s' % workdirfile:
+ srcfile = 'file://%s' % localpath
+
+ # Check patches
+ srcpatches = []
+ patchedfiles = oe.recipeutils.get_recipe_patched_files(rd)
+ for patch, filelist in patchedfiles.items():
+ for fileitem in filelist:
+ if fileitem[0] == srcpath:
+ srcpatches.append((patch, fileitem[1]))
+ if srcpatches:
+ addpatch = None
+ for patch in srcpatches:
+ if patch[1] == 'A':
+ addpatch = patch[0]
+ else:
+ modpatches.append(patch[0])
+ if addpatch:
+ srcfile = 'patch://%s' % addpatch
+
+ return (srcfile, elements, modpatches)
+
+def get_source_path(cmdelements):
+ """Find the source path specified within a command"""
+ command = cmdelements[0]
+ if command in ['install', 'cp']:
+ helptext = subprocess.check_output('LC_ALL=C %s --help' % command, shell=True).decode('utf-8')
+ argopts = ''
+ argopt_line_re = re.compile('^-([a-zA-Z0-9]), --[a-z-]+=')
+ for line in helptext.splitlines():
+ line = line.lstrip()
+ res = argopt_line_re.search(line)
+ if res:
+ argopts += res.group(1)
+ if not argopts:
+ # Fallback
+ if command == 'install':
+ argopts = 'gmoSt'
+ elif command == 'cp':
+ argopts = 't'
+ else:
+ raise Exception('No fallback arguments for command %s' % command)
+
+ skipnext = False
+ for elem in cmdelements[1:-1]:
+ if elem.startswith('-'):
+ if len(elem) > 1 and elem[1] in argopts:
+ skipnext = True
+ continue
+ if skipnext:
+ skipnext = False
+ continue
+ return elem
+ else:
+ raise Exception('get_source_path: no handling for command "%s"')
+
+def get_func_deps(func, d):
+ """Find the function dependencies of a shell function"""
+ deps = bb.codeparser.ShellParser(func, logger).parse_shell(d.getVar(func))
+ deps |= set((d.getVarFlag(func, "vardeps") or "").split())
+ funcdeps = []
+ for dep in deps:
+ if d.getVarFlag(dep, 'func'):
+ funcdeps.append(dep)
+ return funcdeps
+
+def check_do_install(rd, targetpath):
+ """Look at do_install for a command that installs/copies the specified target path"""
+ instpath = os.path.abspath(os.path.join(rd.getVar('D'), targetpath.lstrip('/')))
+ do_install = rd.getVar('do_install')
+ # Handle where do_install calls other functions (somewhat crudely, but good enough for this purpose)
+ deps = get_func_deps('do_install', rd)
+ for dep in deps:
+ do_install = do_install.replace(dep, rd.getVar(dep))
+
+ # Look backwards through do_install as we want to catch where a later line (perhaps
+ # from a bbappend) is writing over the top
+ for line in reversed(do_install.splitlines()):
+ line = line.strip()
+ if (line.startswith('install ') and ' -m' in line) or line.startswith('cp '):
+ elements = line.split()
+ destpath = os.path.abspath(elements[-1])
+ if destpath == instpath:
+ return elements
+ elif destpath.rstrip('/') == os.path.dirname(instpath):
+ # FIXME this doesn't take recursive copy into account; unsure if it's practical to do so
+ srcpath = get_source_path(elements)
+ if fnmatch.fnmatchcase(os.path.basename(instpath), os.path.basename(srcpath)):
+ return elements
+ return None
+
+
+def appendfile(args):
+ import oe.recipeutils
+
+ stdout = ''
+ try:
+ (stdout, _) = bb.process.run('LANG=C file -b %s' % args.newfile, shell=True)
+ if 'cannot open' in stdout:
+ raise bb.process.ExecutionError(stdout)
+ except bb.process.ExecutionError as err:
+ logger.debug('file command returned error: %s' % err)
+ stdout = ''
+ if stdout:
+ logger.debug('file command output: %s' % stdout.rstrip())
+ if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout:
+ logger.warn('This file looks like it is a binary or otherwise the output of compilation. If it is, you should consider building it properly instead of substituting a binary file directly.')
+
+ if args.recipe:
+ recipes = {args.targetpath: [args.recipe],}
+ else:
+ try:
+ recipes = find_target_file(args.targetpath, tinfoil.config_data)
+ except InvalidTargetFileError as e:
+ logger.error('%s cannot be handled by this tool: %s' % (args.targetpath, e))
+ return 1
+ if not recipes:
+ logger.error('Unable to find any package producing path %s - this may be because the recipe packaging it has not been built yet' % args.targetpath)
+ return 1
+
+ alternative_pns = []
+ postinst_pns = []
+
+ selectpn = None
+ for targetpath, pnlist in recipes.items():
+ for pn in pnlist:
+ if pn.startswith('?'):
+ alternative_pns.append(pn[1:])
+ elif pn.startswith('!'):
+ postinst_pns.append(pn[1:])
+ elif selectpn:
+ # hit here with multilibs
+ continue
+ else:
+ selectpn = pn
+
+ if not selectpn and len(alternative_pns) == 1:
+ selectpn = alternative_pns[0]
+ logger.error('File %s is an alternative possibly provided by recipe %s but seemingly no other, selecting it by default - you should double check other recipes' % (args.targetpath, selectpn))
+
+ if selectpn:
+ logger.debug('Selecting recipe %s for file %s' % (selectpn, args.targetpath))
+ if postinst_pns:
+ logger.warn('%s be modified by postinstall scripts for the following recipes:\n %s\nThis may or may not be an issue depending on what modifications these postinstall scripts make.' % (args.targetpath, '\n '.join(postinst_pns)))
+ rd = _parse_recipe(selectpn, tinfoil)
+ if not rd:
+ # Error message already shown
+ return 1
+ sourcefile, instelements, modpatches = determine_file_source(args.targetpath, rd)
+ sourcepath = None
+ if sourcefile:
+ sourcetype, sourcepath = sourcefile.split('://', 1)
+ logger.debug('Original source file is %s (%s)' % (sourcepath, sourcetype))
+ if sourcetype == 'patch':
+ logger.warn('File %s is added by the patch %s - you may need to remove or replace this patch in order to replace the file.' % (args.targetpath, sourcepath))
+ sourcepath = None
+ else:
+ logger.debug('Unable to determine source file, proceeding anyway')
+ if modpatches:
+ logger.warn('File %s is modified by the following patches:\n %s' % (args.targetpath, '\n '.join(modpatches)))
+
+ if instelements and sourcepath:
+ install = None
+ else:
+ # Auto-determine permissions
+ # Check destination
+ binpaths = '${bindir}:${sbindir}:${base_bindir}:${base_sbindir}:${libexecdir}:${sysconfdir}/init.d'
+ perms = '0644'
+ if os.path.abspath(os.path.dirname(args.targetpath)) in rd.expand(binpaths).split(':'):
+ # File is going into a directory normally reserved for executables, so it should be executable
+ perms = '0755'
+ else:
+ # Check source
+ st = os.stat(args.newfile)
+ if st.st_mode & stat.S_IXUSR:
+ perms = '0755'
+ install = {args.newfile: (args.targetpath, perms)}
+ oe.recipeutils.bbappend_recipe(rd, args.destlayer, {args.newfile: sourcepath}, install, wildcardver=args.wildcard_version, machine=args.machine)
+ return 0
+ else:
+ if alternative_pns:
+ logger.error('File %s is an alternative possibly provided by the following recipes:\n %s\nPlease select recipe with -r/--recipe' % (targetpath, '\n '.join(alternative_pns)))
+ elif postinst_pns:
+ logger.error('File %s may be written out in a pre/postinstall script of the following recipes:\n %s\nPlease select recipe with -r/--recipe' % (targetpath, '\n '.join(postinst_pns)))
+ return 3
+
+
+def appendsrc(args, files, rd, extralines=None):
+ import oe.recipeutils
+
+ srcdir = rd.getVar('S')
+ workdir = rd.getVar('WORKDIR')
+
+ import bb.fetch
+ simplified = {}
+ src_uri = rd.getVar('SRC_URI').split()
+ for uri in src_uri:
+ if uri.endswith(';'):
+ uri = uri[:-1]
+ simple_uri = bb.fetch.URI(uri)
+ simple_uri.params = {}
+ simplified[str(simple_uri)] = uri
+
+ copyfiles = {}
+ extralines = extralines or []
+ for newfile, srcfile in files.items():
+ src_destdir = os.path.dirname(srcfile)
+ if not args.use_workdir:
+ if rd.getVar('S') == rd.getVar('STAGING_KERNEL_DIR'):
+ srcdir = os.path.join(workdir, 'git')
+ if not bb.data.inherits_class('kernel-yocto', rd):
+ logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git')
+ src_destdir = os.path.join(os.path.relpath(srcdir, workdir), src_destdir)
+ src_destdir = os.path.normpath(src_destdir)
+
+ source_uri = 'file://{0}'.format(os.path.basename(srcfile))
+ if src_destdir and src_destdir != '.':
+ source_uri += ';subdir={0}'.format(src_destdir)
+
+ simple = bb.fetch.URI(source_uri)
+ simple.params = {}
+ simple_str = str(simple)
+ if simple_str in simplified:
+ existing = simplified[simple_str]
+ if source_uri != existing:
+ logger.warn('{0!r} is already in SRC_URI, with different parameters: {1!r}, not adding'.format(source_uri, existing))
+ else:
+ logger.warn('{0!r} is already in SRC_URI, not adding'.format(source_uri))
+ else:
+ extralines.append('SRC_URI += {0}'.format(source_uri))
+ copyfiles[newfile] = srcfile
+
+ oe.recipeutils.bbappend_recipe(rd, args.destlayer, copyfiles, None, wildcardver=args.wildcard_version, machine=args.machine, extralines=extralines)
+
+
+def appendsrcfiles(parser, args):
+ recipedata = _parse_recipe(args.recipe, tinfoil)
+ if not recipedata:
+ parser.error('RECIPE must be a valid recipe name')
+
+ files = dict((f, os.path.join(args.destdir, os.path.basename(f)))
+ for f in args.files)
+ return appendsrc(args, files, recipedata)
+
+
+def appendsrcfile(parser, args):
+ recipedata = _parse_recipe(args.recipe, tinfoil)
+ if not recipedata:
+ parser.error('RECIPE must be a valid recipe name')
+
+ if not args.destfile:
+ args.destfile = os.path.basename(args.file)
+ elif args.destfile.endswith('/'):
+ args.destfile = os.path.join(args.destfile, os.path.basename(args.file))
+
+ return appendsrc(args, {args.file: args.destfile}, recipedata)
+
+
+def layer(layerpath):
+ if not os.path.exists(os.path.join(layerpath, 'conf', 'layer.conf')):
+ raise argparse.ArgumentTypeError('{0!r} must be a path to a valid layer'.format(layerpath))
+ return layerpath
+
+
+def existing_path(filepath):
+ if not os.path.exists(filepath):
+ raise argparse.ArgumentTypeError('{0!r} must be an existing path'.format(filepath))
+ return filepath
+
+
+def existing_file(filepath):
+ filepath = existing_path(filepath)
+ if os.path.isdir(filepath):
+ raise argparse.ArgumentTypeError('{0!r} must be a file, not a directory'.format(filepath))
+ return filepath
+
+
+def destination_path(destpath):
+ if os.path.isabs(destpath):
+ raise argparse.ArgumentTypeError('{0!r} must be a relative path, not absolute'.format(destpath))
+ return destpath
+
+
+def target_path(targetpath):
+ if not os.path.isabs(targetpath):
+ raise argparse.ArgumentTypeError('{0!r} must be an absolute path, not relative'.format(targetpath))
+ return targetpath
+
+
+def register_commands(subparsers):
+ common = argparse.ArgumentParser(add_help=False)
+ common.add_argument('-m', '--machine', help='Make bbappend changes specific to a machine only', metavar='MACHINE')
+ common.add_argument('-w', '--wildcard-version', help='Use wildcard to make the bbappend apply to any recipe version', action='store_true')
+ common.add_argument('destlayer', metavar='DESTLAYER', help='Base directory of the destination layer to write the bbappend to', type=layer)
+
+ parser_appendfile = subparsers.add_parser('appendfile',
+ parents=[common],
+ help='Create/update a bbappend to replace a target file',
+ description='Creates a bbappend (or updates an existing one) to replace the specified file that appears in the target system, determining the recipe that packages the file and the required path and name for the bbappend automatically. Note that the ability to determine the recipe packaging a particular file depends upon the recipe\'s do_packagedata task having already run prior to running this command (which it will have when the recipe has been built successfully, which in turn will have happened if one or more of the recipe\'s packages is included in an image that has been built successfully).')
+ parser_appendfile.add_argument('targetpath', help='Path to the file to be replaced (as it would appear within the target image, e.g. /etc/motd)', type=target_path)
+ parser_appendfile.add_argument('newfile', help='Custom file to replace the target file with', type=existing_file)
+ parser_appendfile.add_argument('-r', '--recipe', help='Override recipe to apply to (default is to find which recipe already packages the file)')
+ parser_appendfile.set_defaults(func=appendfile, parserecipes=True)
+
+ common_src = argparse.ArgumentParser(add_help=False, parents=[common])
+ common_src.add_argument('-W', '--workdir', help='Unpack file into WORKDIR rather than S', dest='use_workdir', action='store_true')
+ common_src.add_argument('recipe', metavar='RECIPE', help='Override recipe to apply to')
+
+ parser = subparsers.add_parser('appendsrcfiles',
+ parents=[common_src],
+ help='Create/update a bbappend to add or replace source files',
+ description='Creates a bbappend (or updates an existing one) to add or replace the specified file in the recipe sources, either those in WORKDIR or those in the source tree. This command lets you specify multiple files with a destination directory, so cannot specify the destination filename. See the `appendsrcfile` command for the other behavior.')
+ parser.add_argument('-D', '--destdir', help='Destination directory (relative to S or WORKDIR, defaults to ".")', default='', type=destination_path)
+ parser.add_argument('files', nargs='+', metavar='FILE', help='File(s) to be added to the recipe sources (WORKDIR or S)', type=existing_path)
+ parser.set_defaults(func=lambda a: appendsrcfiles(parser, a), parserecipes=True)
+
+ parser = subparsers.add_parser('appendsrcfile',
+ parents=[common_src],
+ help='Create/update a bbappend to add or replace a source file',
+ description='Creates a bbappend (or updates an existing one) to add or replace the specified files in the recipe sources, either those in WORKDIR or those in the source tree. This command lets you specify the destination filename, not just destination directory, but only works for one file. See the `appendsrcfiles` command for the other behavior.')
+ parser.add_argument('file', metavar='FILE', help='File to be added to the recipe sources (WORKDIR or S)', type=existing_path)
+ parser.add_argument('destfile', metavar='DESTFILE', nargs='?', help='Destination path (relative to S or WORKDIR, optional)', type=destination_path)
+ parser.set_defaults(func=lambda a: appendsrcfile(parser, a), parserecipes=True)
diff --git a/poky/scripts/lib/recipetool/create.py b/poky/scripts/lib/recipetool/create.py
new file mode 100644
index 000000000..a3710285b
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create.py
@@ -0,0 +1,1329 @@
+# Recipe creation tool - create command plugin
+#
+# Copyright (C) 2014-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import fnmatch
+import re
+import json
+import logging
+import scriptutils
+from urllib.parse import urlparse, urldefrag, urlsplit
+import hashlib
+import bb.fetch2
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+plugins = None
+
+def log_error_cond(message, debugonly):
+ if debugonly:
+ logger.debug(message)
+ else:
+ logger.error(message)
+
+def log_info_cond(message, debugonly):
+ if debugonly:
+ logger.debug(message)
+ else:
+ logger.info(message)
+
+def plugin_init(pluginlist):
+ # Take a reference to the list so we can use it later
+ global plugins
+ plugins = pluginlist
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+class RecipeHandler(object):
+ recipelibmap = {}
+ recipeheadermap = {}
+ recipecmakefilemap = {}
+ recipebinmap = {}
+
+ def __init__(self):
+ self._devtool = False
+
+ @staticmethod
+ def load_libmap(d):
+ '''Load library->recipe mapping'''
+ import oe.package
+
+ if RecipeHandler.recipelibmap:
+ return
+ # First build up library->package mapping
+ shlib_providers = oe.package.read_shlib_providers(d)
+ libdir = d.getVar('libdir')
+ base_libdir = d.getVar('base_libdir')
+ libpaths = list(set([base_libdir, libdir]))
+ libname_re = re.compile('^lib(.+)\.so.*$')
+ pkglibmap = {}
+ for lib, item in shlib_providers.items():
+ for path, pkg in item.items():
+ if path in libpaths:
+ res = libname_re.match(lib)
+ if res:
+ libname = res.group(1)
+ if not libname in pkglibmap:
+ pkglibmap[libname] = pkg[0]
+ else:
+ logger.debug('unable to extract library name from %s' % lib)
+
+ # Now turn it into a library->recipe mapping
+ pkgdata_dir = d.getVar('PKGDATA_DIR')
+ for libname, pkg in pkglibmap.items():
+ try:
+ with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
+ for line in f:
+ if line.startswith('PN:'):
+ RecipeHandler.recipelibmap[libname] = line.split(':', 1)[-1].strip()
+ break
+ except IOError as ioe:
+ if ioe.errno == 2:
+ logger.warn('unable to find a pkgdata file for package %s' % pkg)
+ else:
+ raise
+
+ # Some overrides - these should be mapped to the virtual
+ RecipeHandler.recipelibmap['GL'] = 'virtual/libgl'
+ RecipeHandler.recipelibmap['EGL'] = 'virtual/egl'
+ RecipeHandler.recipelibmap['GLESv2'] = 'virtual/libgles2'
+
+ @staticmethod
+ def load_devel_filemap(d):
+ '''Build up development file->recipe mapping'''
+ if RecipeHandler.recipeheadermap:
+ return
+ pkgdata_dir = d.getVar('PKGDATA_DIR')
+ includedir = d.getVar('includedir')
+ cmakedir = os.path.join(d.getVar('libdir'), 'cmake')
+ for pkg in glob.glob(os.path.join(pkgdata_dir, 'runtime', '*-dev')):
+ with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
+ pn = None
+ headers = []
+ cmakefiles = []
+ for line in f:
+ if line.startswith('PN:'):
+ pn = line.split(':', 1)[-1].strip()
+ elif line.startswith('FILES_INFO:'):
+ val = line.split(':', 1)[1].strip()
+ dictval = json.loads(val)
+ for fullpth in sorted(dictval):
+ if fullpth.startswith(includedir) and fullpth.endswith('.h'):
+ headers.append(os.path.relpath(fullpth, includedir))
+ elif fullpth.startswith(cmakedir) and fullpth.endswith('.cmake'):
+ cmakefiles.append(os.path.relpath(fullpth, cmakedir))
+ if pn and headers:
+ for header in headers:
+ RecipeHandler.recipeheadermap[header] = pn
+ if pn and cmakefiles:
+ for fn in cmakefiles:
+ RecipeHandler.recipecmakefilemap[fn] = pn
+
+ @staticmethod
+ def load_binmap(d):
+ '''Build up native binary->recipe mapping'''
+ if RecipeHandler.recipebinmap:
+ return
+ sstate_manifests = d.getVar('SSTATE_MANIFESTS')
+ staging_bindir_native = d.getVar('STAGING_BINDIR_NATIVE')
+ build_arch = d.getVar('BUILD_ARCH')
+ fileprefix = 'manifest-%s-' % build_arch
+ for fn in glob.glob(os.path.join(sstate_manifests, '%s*-native.populate_sysroot' % fileprefix)):
+ with open(fn, 'r') as f:
+ pn = os.path.basename(fn).rsplit('.', 1)[0][len(fileprefix):]
+ for line in f:
+ if line.startswith(staging_bindir_native):
+ prog = os.path.basename(line.rstrip())
+ RecipeHandler.recipebinmap[prog] = pn
+
+ @staticmethod
+ def checkfiles(path, speclist, recursive=False, excludedirs=None):
+ results = []
+ if recursive:
+ for root, dirs, files in os.walk(path, topdown=True):
+ if excludedirs:
+ dirs[:] = [d for d in dirs if d not in excludedirs]
+ for fn in files:
+ for spec in speclist:
+ if fnmatch.fnmatch(fn, spec):
+ results.append(os.path.join(root, fn))
+ else:
+ for spec in speclist:
+ results.extend(glob.glob(os.path.join(path, spec)))
+ return results
+
+ @staticmethod
+ def handle_depends(libdeps, pcdeps, deps, outlines, values, d):
+ if pcdeps:
+ recipemap = read_pkgconfig_provides(d)
+ if libdeps:
+ RecipeHandler.load_libmap(d)
+
+ ignorelibs = ['socket']
+ ignoredeps = ['gcc-runtime', 'glibc', 'uclibc', 'musl', 'tar-native', 'binutils-native', 'coreutils-native']
+
+ unmappedpc = []
+ pcdeps = list(set(pcdeps))
+ for pcdep in pcdeps:
+ if isinstance(pcdep, str):
+ recipe = recipemap.get(pcdep, None)
+ if recipe:
+ deps.append(recipe)
+ else:
+ if not pcdep.startswith('$'):
+ unmappedpc.append(pcdep)
+ else:
+ for item in pcdep:
+ recipe = recipemap.get(pcdep, None)
+ if recipe:
+ deps.append(recipe)
+ break
+ else:
+ unmappedpc.append('(%s)' % ' or '.join(pcdep))
+
+ unmappedlibs = []
+ for libdep in libdeps:
+ if isinstance(libdep, tuple):
+ lib, header = libdep
+ else:
+ lib = libdep
+ header = None
+
+ if lib in ignorelibs:
+ logger.debug('Ignoring library dependency %s' % lib)
+ continue
+
+ recipe = RecipeHandler.recipelibmap.get(lib, None)
+ if recipe:
+ deps.append(recipe)
+ elif recipe is None:
+ if header:
+ RecipeHandler.load_devel_filemap(d)
+ recipe = RecipeHandler.recipeheadermap.get(header, None)
+ if recipe:
+ deps.append(recipe)
+ elif recipe is None:
+ unmappedlibs.append(lib)
+ else:
+ unmappedlibs.append(lib)
+
+ deps = set(deps).difference(set(ignoredeps))
+
+ if unmappedpc:
+ outlines.append('# NOTE: unable to map the following pkg-config dependencies: %s' % ' '.join(unmappedpc))
+ outlines.append('# (this is based on recipes that have previously been built and packaged)')
+
+ if unmappedlibs:
+ outlines.append('# NOTE: the following library dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmappedlibs))))
+ outlines.append('# (this is based on recipes that have previously been built and packaged)')
+
+ if deps:
+ values['DEPENDS'] = ' '.join(deps)
+
+ @staticmethod
+ def genfunction(outlines, funcname, content, python=False, forcespace=False):
+ if python:
+ prefix = 'python '
+ else:
+ prefix = ''
+ outlines.append('%s%s () {' % (prefix, funcname))
+ if python or forcespace:
+ indent = ' '
+ else:
+ indent = '\t'
+ addnoop = not python
+ for line in content:
+ outlines.append('%s%s' % (indent, line))
+ if addnoop:
+ strippedline = line.lstrip()
+ if strippedline and not strippedline.startswith('#'):
+ addnoop = False
+ if addnoop:
+ # Without this there'll be a syntax error
+ outlines.append('%s:' % indent)
+ outlines.append('}')
+ outlines.append('')
+
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ return False
+
+
+def validate_pv(pv):
+ if not pv or '_version' in pv.lower() or pv[0] not in '0123456789':
+ return False
+ return True
+
+def determine_from_filename(srcfile):
+ """Determine name and version from a filename"""
+ if is_package(srcfile):
+ # Force getting the value from the package metadata
+ return None, None
+
+ if '.tar.' in srcfile:
+ namepart = srcfile.split('.tar.')[0]
+ else:
+ namepart = os.path.splitext(srcfile)[0]
+ namepart = namepart.lower().replace('_', '-')
+ if namepart.endswith('.src'):
+ namepart = namepart[:-4]
+ if namepart.endswith('.orig'):
+ namepart = namepart[:-5]
+ splitval = namepart.split('-')
+ logger.debug('determine_from_filename: split name %s into: %s' % (srcfile, splitval))
+
+ ver_re = re.compile('^v?[0-9]')
+
+ pv = None
+ pn = None
+ if len(splitval) == 1:
+ # Try to split the version out if there is no separator (or a .)
+ res = re.match('^([^0-9]+)([0-9.]+.*)$', namepart)
+ if res:
+ if len(res.group(1)) > 1 and len(res.group(2)) > 1:
+ pn = res.group(1).rstrip('.')
+ pv = res.group(2)
+ else:
+ pn = namepart
+ else:
+ if splitval[-1] in ['source', 'src']:
+ splitval.pop()
+ if len(splitval) > 2 and re.match('^(alpha|beta|stable|release|rc[0-9]|pre[0-9]|p[0-9]|[0-9]{8})', splitval[-1]) and ver_re.match(splitval[-2]):
+ pv = '-'.join(splitval[-2:])
+ if pv.endswith('-release'):
+ pv = pv[:-8]
+ splitval = splitval[:-2]
+ elif ver_re.match(splitval[-1]):
+ pv = splitval.pop()
+ pn = '-'.join(splitval)
+ if pv and pv.startswith('v'):
+ pv = pv[1:]
+ logger.debug('determine_from_filename: name = "%s" version = "%s"' % (pn, pv))
+ return (pn, pv)
+
+def determine_from_url(srcuri):
+ """Determine name and version from a URL"""
+ pn = None
+ pv = None
+ parseres = urlparse(srcuri.lower().split(';', 1)[0])
+ if parseres.path:
+ if 'github.com' in parseres.netloc:
+ res = re.search(r'.*/(.*?)/archive/(.*)-final\.(tar|zip)', parseres.path)
+ if res:
+ pn = res.group(1).strip().replace('_', '-')
+ pv = res.group(2).strip().replace('_', '.')
+ else:
+ res = re.search(r'.*/(.*?)/archive/v?(.*)\.(tar|zip)', parseres.path)
+ if res:
+ pn = res.group(1).strip().replace('_', '-')
+ pv = res.group(2).strip().replace('_', '.')
+ elif 'bitbucket.org' in parseres.netloc:
+ res = re.search(r'.*/(.*?)/get/[a-zA-Z_-]*([0-9][0-9a-zA-Z_.]*)\.(tar|zip)', parseres.path)
+ if res:
+ pn = res.group(1).strip().replace('_', '-')
+ pv = res.group(2).strip().replace('_', '.')
+
+ if not pn and not pv:
+ if parseres.scheme not in ['git', 'gitsm', 'svn', 'hg']:
+ srcfile = os.path.basename(parseres.path.rstrip('/'))
+ pn, pv = determine_from_filename(srcfile)
+ elif parseres.scheme in ['git', 'gitsm']:
+ pn = os.path.basename(parseres.path.rstrip('/')).lower().replace('_', '-')
+ if pn.endswith('.git'):
+ pn = pn[:-4]
+
+ logger.debug('Determined from source URL: name = "%s", version = "%s"' % (pn, pv))
+ return (pn, pv)
+
+def supports_srcrev(uri):
+ localdata = bb.data.createCopy(tinfoil.config_data)
+ # This is a bit sad, but if you don't have this set there can be some
+ # odd interactions with the urldata cache which lead to errors
+ localdata.setVar('SRCREV', '${AUTOREV}')
+ try:
+ fetcher = bb.fetch2.Fetch([uri], localdata)
+ urldata = fetcher.ud
+ for u in urldata:
+ if urldata[u].method.supports_srcrev():
+ return True
+ except bb.fetch2.FetchError as e:
+ logger.debug('FetchError in supports_srcrev: %s' % str(e))
+ # Fall back to basic check
+ if uri.startswith(('git://', 'gitsm://')):
+ return True
+ return False
+
+def reformat_git_uri(uri):
+ '''Convert any http[s]://....git URI into git://...;protocol=http[s]'''
+ checkuri = uri.split(';', 1)[0]
+ if checkuri.endswith('.git') or '/git/' in checkuri or re.match('https?://github.com/[^/]+/[^/]+/?$', checkuri):
+ # Appends scheme if the scheme is missing
+ if not '://' in uri:
+ uri = 'git://' + uri
+ scheme, host, path, user, pswd, parms = bb.fetch2.decodeurl(uri)
+ # Detection mechanism, this is required due to certain URL are formatter with ":" rather than "/"
+ # which causes decodeurl to fail getting the right host and path
+ if len(host.split(':')) > 1:
+ splitslash = host.split(':')
+ # Port number should not be split from host
+ if not re.match('^[0-9]+$', splitslash[1]):
+ host = splitslash[0]
+ path = '/' + splitslash[1] + path
+ #Algorithm:
+ # if user is defined, append protocol=ssh or if a protocol is defined, then honor the user-defined protocol
+ # if no user & password is defined, check for scheme type and append the protocol with the scheme type
+ # finally if protocols or if the url is well-formed, do nothing and rejoin everything back to normal
+ # Need to repackage the arguments for encodeurl, the format is: (scheme, host, path, user, password, OrderedDict([('key', 'value')]))
+ if user:
+ if not 'protocol' in parms:
+ parms.update({('protocol', 'ssh')})
+ elif (scheme == "http" or scheme == 'https' or scheme == 'ssh') and not ('protocol' in parms):
+ parms.update({('protocol', scheme)})
+ # Always append 'git://'
+ fUrl = bb.fetch2.encodeurl(('git', host, path, user, pswd, parms))
+ return fUrl
+ else:
+ return uri
+
+def is_package(url):
+ '''Check if a URL points to a package'''
+ checkurl = url.split(';', 1)[0]
+ if checkurl.endswith(('.deb', '.ipk', '.rpm', '.srpm')):
+ return True
+ return False
+
+def create_recipe(args):
+ import bb.process
+ import tempfile
+ import shutil
+ import oe.recipeutils
+
+ pkgarch = ""
+ if args.machine:
+ pkgarch = "${MACHINE_ARCH}"
+
+ extravalues = {}
+ checksums = {}
+ tempsrc = ''
+ source = args.source
+ srcsubdir = ''
+ srcrev = '${AUTOREV}'
+ srcbranch = ''
+ scheme = ''
+ storeTagName = ''
+ pv_srcpv = False
+
+ if os.path.isfile(source):
+ source = 'file://%s' % os.path.abspath(source)
+
+ if scriptutils.is_src_url(source):
+ # Warn about github archive URLs
+ if re.match('https?://github.com/[^/]+/[^/]+/archive/.+(\.tar\..*|\.zip)$', source):
+ logger.warn('github archive files are not guaranteed to be stable and may be re-generated over time. If the latter occurs, the checksums will likely change and the recipe will fail at do_fetch. It is recommended that you point to an actual commit or tag in the repository instead (using the repository URL in conjunction with the -S/--srcrev option).')
+ # Fetch a URL
+ fetchuri = reformat_git_uri(urldefrag(source)[0])
+ if args.binary:
+ # Assume the archive contains the directory structure verbatim
+ # so we need to extract to a subdirectory
+ fetchuri += ';subdir=${BP}'
+ srcuri = fetchuri
+ rev_re = re.compile(';rev=([^;]+)')
+ res = rev_re.search(srcuri)
+ if res:
+ if args.srcrev:
+ logger.error('rev= parameter and -S/--srcrev option cannot both be specified - use one or the other')
+ sys.exit(1)
+ if args.autorev:
+ logger.error('rev= parameter and -a/--autorev option cannot both be specified - use one or the other')
+ sys.exit(1)
+ srcrev = res.group(1)
+ srcuri = rev_re.sub('', srcuri)
+ elif args.srcrev:
+ srcrev = args.srcrev
+
+ # Check whether users provides any branch info in fetchuri.
+ # If true, we will skip all branch checking process to honor all user's input.
+ scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(fetchuri)
+ srcbranch = params.get('branch')
+ if args.srcbranch:
+ if srcbranch:
+ logger.error('branch= parameter and -B/--srcbranch option cannot both be specified - use one or the other')
+ sys.exit(1)
+ srcbranch = args.srcbranch
+ nobranch = params.get('nobranch')
+ if nobranch and srcbranch:
+ logger.error('nobranch= cannot be used if you specify a branch')
+ sys.exit(1)
+ tag = params.get('tag')
+ if not srcbranch and not nobranch and srcrev != '${AUTOREV}':
+ # Append nobranch=1 in the following conditions:
+ # 1. User did not set 'branch=' in srcuri, and
+ # 2. User did not set 'nobranch=1' in srcuri, and
+ # 3. Source revision is not '${AUTOREV}'
+ params['nobranch'] = '1'
+ if tag:
+ # Keep a copy of tag and append nobranch=1 then remove tag from URL.
+ # Bitbake fetcher unable to fetch when {AUTOREV} and tag is set at the same time.
+ storeTagName = params['tag']
+ params['nobranch'] = '1'
+ del params['tag']
+ if scheme == 'npm':
+ params['noverify'] = '1'
+ fetchuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
+
+ tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR')
+ bb.utils.mkdirhier(tmpparent)
+ tempsrc = tempfile.mkdtemp(prefix='recipetool-', dir=tmpparent)
+ srctree = os.path.join(tempsrc, 'source')
+
+ try:
+ checksums, ftmpdir = scriptutils.fetch_url(tinfoil, fetchuri, srcrev, srctree, logger, preserve_tmp=args.keep_temp)
+ except scriptutils.FetchUrlFailure as e:
+ logger.error(str(e))
+ sys.exit(1)
+
+ if ftmpdir and args.keep_temp:
+ logger.info('Fetch temp directory is %s' % ftmpdir)
+
+ dirlist = os.listdir(srctree)
+ filterout = ['git.indirectionsymlink']
+ dirlist = [x for x in dirlist if x not in filterout]
+ logger.debug('Directory listing (excluding filtered out):\n %s' % '\n '.join(dirlist))
+ if len(dirlist) == 1:
+ singleitem = os.path.join(srctree, dirlist[0])
+ if os.path.isdir(singleitem):
+ # We unpacked a single directory, so we should use that
+ srcsubdir = dirlist[0]
+ srctree = os.path.join(srctree, srcsubdir)
+ else:
+ check_single_file(dirlist[0], fetchuri)
+ elif len(dirlist) == 0:
+ if '/' in fetchuri:
+ fn = os.path.join(tinfoil.config_data.getVar('DL_DIR'), fetchuri.split('/')[-1])
+ if os.path.isfile(fn):
+ check_single_file(fn, fetchuri)
+ # If we've got to here then there's no source so we might as well give up
+ logger.error('URL %s resulted in an empty source tree' % fetchuri)
+ sys.exit(1)
+
+ # We need this checking mechanism to improve the recipe created by recipetool and devtool
+ # is able to parse and build by bitbake.
+ # If there is no input for branch name, then check for branch name with SRCREV provided.
+ if not srcbranch and not nobranch and srcrev and (srcrev != '${AUTOREV}') and scheme in ['git', 'gitsm']:
+ try:
+ cmd = 'git branch -r --contains'
+ check_branch, check_branch_err = bb.process.run('%s %s' % (cmd, srcrev), cwd=srctree)
+ except bb.process.ExecutionError as err:
+ logger.error(str(err))
+ sys.exit(1)
+ get_branch = [x.strip() for x in check_branch.splitlines()]
+ # Remove HEAD reference point and drop remote prefix
+ get_branch = [x.split('/', 1)[1] for x in get_branch if not x.startswith('origin/HEAD')]
+ if 'master' in get_branch:
+ # If it is master, we do not need to append 'branch=master' as this is default.
+ # Even with the case where get_branch has multiple objects, if 'master' is one
+ # of them, we should default take from 'master'
+ srcbranch = ''
+ elif len(get_branch) == 1:
+ # If 'master' isn't in get_branch and get_branch contains only ONE object, then store result into 'srcbranch'
+ srcbranch = get_branch[0]
+ else:
+ # If get_branch contains more than one objects, then display error and exit.
+ mbrch = '\n ' + '\n '.join(get_branch)
+ logger.error('Revision %s was found on multiple branches: %s\nPlease provide the correct branch with -B/--srcbranch' % (srcrev, mbrch))
+ sys.exit(1)
+
+ # Since we might have a value in srcbranch, we need to
+ # recontruct the srcuri to include 'branch' in params.
+ scheme, network, path, user, passwd, params = bb.fetch2.decodeurl(srcuri)
+ if srcbranch:
+ params['branch'] = srcbranch
+
+ if storeTagName and scheme in ['git', 'gitsm']:
+ # Check srcrev using tag and check validity of the tag
+ cmd = ('git rev-parse --verify %s' % (storeTagName))
+ try:
+ check_tag, check_tag_err = bb.process.run('%s' % cmd, cwd=srctree)
+ srcrev = check_tag.split()[0]
+ except bb.process.ExecutionError as err:
+ logger.error(str(err))
+ logger.error("Possibly wrong tag name is provided")
+ sys.exit(1)
+ # Drop tag from srcuri as it will have conflicts with SRCREV during recipe parse.
+ del params['tag']
+ srcuri = bb.fetch2.encodeurl((scheme, network, path, user, passwd, params))
+
+ if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'):
+ srcuri = 'gitsm://' + srcuri[6:]
+ logger.info('Fetching submodules...')
+ bb.process.run('git submodule update --init --recursive', cwd=srctree)
+
+ if is_package(fetchuri):
+ localdata = bb.data.createCopy(tinfoil.config_data)
+ pkgfile = bb.fetch2.localpath(fetchuri, localdata)
+ if pkgfile:
+ tmpfdir = tempfile.mkdtemp(prefix='recipetool-')
+ try:
+ if pkgfile.endswith(('.deb', '.ipk')):
+ stdout, _ = bb.process.run('ar x %s' % pkgfile, cwd=tmpfdir)
+ stdout, _ = bb.process.run('tar xf control.tar.gz', cwd=tmpfdir)
+ values = convert_debian(tmpfdir)
+ extravalues.update(values)
+ elif pkgfile.endswith(('.rpm', '.srpm')):
+ stdout, _ = bb.process.run('rpm -qp --xml %s > pkginfo.xml' % pkgfile, cwd=tmpfdir)
+ values = convert_rpm_xml(os.path.join(tmpfdir, 'pkginfo.xml'))
+ extravalues.update(values)
+ finally:
+ shutil.rmtree(tmpfdir)
+ else:
+ # Assume we're pointing to an existing source tree
+ if args.extract_to:
+ logger.error('--extract-to cannot be specified if source is a directory')
+ sys.exit(1)
+ if not os.path.isdir(source):
+ logger.error('Invalid source directory %s' % source)
+ sys.exit(1)
+ srctree = source
+ srcuri = ''
+ if os.path.exists(os.path.join(srctree, '.git')):
+ # Try to get upstream repo location from origin remote
+ try:
+ stdout, _ = bb.process.run('git remote -v', cwd=srctree, shell=True)
+ except bb.process.ExecutionError as e:
+ stdout = None
+ if stdout:
+ for line in stdout.splitlines():
+ splitline = line.split()
+ if len(splitline) > 1:
+ if splitline[0] == 'origin' and scriptutils.is_src_url(splitline[1]):
+ srcuri = reformat_git_uri(splitline[1])
+ srcsubdir = 'git'
+ break
+
+ if args.src_subdir:
+ srcsubdir = os.path.join(srcsubdir, args.src_subdir)
+ srctree_use = os.path.abspath(os.path.join(srctree, args.src_subdir))
+ else:
+ srctree_use = os.path.abspath(srctree)
+
+ if args.outfile and os.path.isdir(args.outfile):
+ outfile = None
+ outdir = args.outfile
+ else:
+ outfile = args.outfile
+ outdir = None
+ if outfile and outfile != '-':
+ if os.path.exists(outfile):
+ logger.error('Output file %s already exists' % outfile)
+ sys.exit(1)
+
+ lines_before = []
+ lines_after = []
+
+ lines_before.append('# Recipe created by %s' % os.path.basename(sys.argv[0]))
+ lines_before.append('# This is the basis of a recipe and may need further editing in order to be fully functional.')
+ lines_before.append('# (Feel free to remove these comments when editing.)')
+ # We need a blank line here so that patch_recipe_lines can rewind before the LICENSE comments
+ lines_before.append('')
+
+ # We'll come back and replace this later in handle_license_vars()
+ lines_before.append('##LICENSE_PLACEHOLDER##')
+
+ handled = []
+ classes = []
+
+ # FIXME This is kind of a hack, we probably ought to be using bitbake to do this
+ pn = None
+ pv = None
+ if outfile:
+ recipefn = os.path.splitext(os.path.basename(outfile))[0]
+ fnsplit = recipefn.split('_')
+ if len(fnsplit) > 1:
+ pn = fnsplit[0]
+ pv = fnsplit[1]
+ else:
+ pn = recipefn
+
+ if args.version:
+ pv = args.version
+
+ if args.name:
+ pn = args.name
+ if args.name.endswith('-native'):
+ if args.also_native:
+ logger.error('--also-native cannot be specified for a recipe named *-native (*-native denotes a recipe that is already only for native) - either remove the -native suffix from the name or drop --also-native')
+ sys.exit(1)
+ classes.append('native')
+ elif args.name.startswith('nativesdk-'):
+ if args.also_native:
+ logger.error('--also-native cannot be specified for a recipe named nativesdk-* (nativesdk-* denotes a recipe that is already only for nativesdk)')
+ sys.exit(1)
+ classes.append('nativesdk')
+
+ if pv and pv not in 'git svn hg'.split():
+ realpv = pv
+ else:
+ realpv = None
+
+ if not srcuri:
+ lines_before.append('# No information for SRC_URI yet (only an external source tree was specified)')
+ lines_before.append('SRC_URI = "%s"' % srcuri)
+ for key, value in sorted(checksums.items()):
+ lines_before.append('SRC_URI[%s] = "%s"' % (key, value))
+ if srcuri and supports_srcrev(srcuri):
+ lines_before.append('')
+ lines_before.append('# Modify these as desired')
+ # Note: we have code to replace realpv further down if it gets set to some other value
+ scheme, _, _, _, _, _ = bb.fetch2.decodeurl(srcuri)
+ if scheme in ['git', 'gitsm']:
+ srcpvprefix = 'git'
+ elif scheme == 'svn':
+ srcpvprefix = 'svnr'
+ else:
+ srcpvprefix = scheme
+ lines_before.append('PV = "%s+%s${SRCPV}"' % (realpv or '1.0', srcpvprefix))
+ pv_srcpv = True
+ if not args.autorev and srcrev == '${AUTOREV}':
+ if os.path.exists(os.path.join(srctree, '.git')):
+ (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree)
+ srcrev = stdout.rstrip()
+ lines_before.append('SRCREV = "%s"' % srcrev)
+ if args.provides:
+ lines_before.append('PROVIDES = "%s"' % args.provides)
+ lines_before.append('')
+
+ if srcsubdir and not args.binary:
+ # (for binary packages we explicitly specify subdir= when fetching to
+ # match the default value of S, so we don't need to set it in that case)
+ lines_before.append('S = "${WORKDIR}/%s"' % srcsubdir)
+ lines_before.append('')
+
+ if pkgarch:
+ lines_after.append('PACKAGE_ARCH = "%s"' % pkgarch)
+ lines_after.append('')
+
+ if args.binary:
+ lines_after.append('INSANE_SKIP_${PN} += "already-stripped"')
+ lines_after.append('')
+
+ if args.fetch_dev:
+ extravalues['fetchdev'] = True
+ else:
+ extravalues['fetchdev'] = None
+
+ # Find all plugins that want to register handlers
+ logger.debug('Loading recipe handlers')
+ raw_handlers = []
+ for plugin in plugins:
+ if hasattr(plugin, 'register_recipe_handlers'):
+ plugin.register_recipe_handlers(raw_handlers)
+ # Sort handlers by priority
+ handlers = []
+ for i, handler in enumerate(raw_handlers):
+ if isinstance(handler, tuple):
+ handlers.append((handler[0], handler[1], i))
+ else:
+ handlers.append((handler, 0, i))
+ handlers.sort(key=lambda item: (item[1], -item[2]), reverse=True)
+ for handler, priority, _ in handlers:
+ logger.debug('Handler: %s (priority %d)' % (handler.__class__.__name__, priority))
+ setattr(handler, '_devtool', args.devtool)
+ handlers = [item[0] for item in handlers]
+
+ # Apply the handlers
+ if args.binary:
+ classes.append('bin_package')
+ handled.append('buildsystem')
+
+ for handler in handlers:
+ handler.process(srctree_use, classes, lines_before, lines_after, handled, extravalues)
+
+ extrafiles = extravalues.pop('extrafiles', {})
+ extra_pn = extravalues.pop('PN', None)
+ extra_pv = extravalues.pop('PV', None)
+
+ if extra_pv and not realpv:
+ realpv = extra_pv
+ if not validate_pv(realpv):
+ realpv = None
+ else:
+ realpv = realpv.lower().split()[0]
+ if '_' in realpv:
+ realpv = realpv.replace('_', '-')
+ if extra_pn and not pn:
+ pn = extra_pn
+ if pn.startswith('GNU '):
+ pn = pn[4:]
+ if ' ' in pn:
+ # Probably a descriptive identifier rather than a proper name
+ pn = None
+ else:
+ pn = pn.lower()
+ if '_' in pn:
+ pn = pn.replace('_', '-')
+
+ if srcuri and not realpv or not pn:
+ name_pn, name_pv = determine_from_url(srcuri)
+ if name_pn and not pn:
+ pn = name_pn
+ if name_pv and not realpv:
+ realpv = name_pv
+
+ licvalues = handle_license_vars(srctree_use, lines_before, handled, extravalues, tinfoil.config_data)
+
+ if not outfile:
+ if not pn:
+ log_error_cond('Unable to determine short program name from source tree - please specify name with -N/--name or output file name with -o/--outfile', args.devtool)
+ # devtool looks for this specific exit code, so don't change it
+ sys.exit(15)
+ else:
+ if srcuri and srcuri.startswith(('gitsm://', 'git://', 'hg://', 'svn://')):
+ suffix = srcuri.split(':', 1)[0]
+ if suffix == 'gitsm':
+ suffix = 'git'
+ outfile = '%s_%s.bb' % (pn, suffix)
+ elif realpv:
+ outfile = '%s_%s.bb' % (pn, realpv)
+ else:
+ outfile = '%s.bb' % pn
+ if outdir:
+ outfile = os.path.join(outdir, outfile)
+ # We need to check this again
+ if os.path.exists(outfile):
+ logger.error('Output file %s already exists' % outfile)
+ sys.exit(1)
+
+ # Move any extra files the plugins created to a directory next to the recipe
+ if extrafiles:
+ if outfile == '-':
+ extraoutdir = pn
+ else:
+ extraoutdir = os.path.join(os.path.dirname(outfile), pn)
+ bb.utils.mkdirhier(extraoutdir)
+ for destfn, extrafile in extrafiles.items():
+ shutil.move(extrafile, os.path.join(extraoutdir, destfn))
+
+ lines = lines_before
+ lines_before = []
+ skipblank = True
+ for line in lines:
+ if skipblank:
+ skipblank = False
+ if not line:
+ continue
+ if line.startswith('S = '):
+ if realpv and pv not in 'git svn hg'.split():
+ line = line.replace(realpv, '${PV}')
+ if pn:
+ line = line.replace(pn, '${BPN}')
+ if line == 'S = "${WORKDIR}/${BPN}-${PV}"':
+ skipblank = True
+ continue
+ elif line.startswith('SRC_URI = '):
+ if realpv and not pv_srcpv:
+ line = line.replace(realpv, '${PV}')
+ elif line.startswith('PV = '):
+ if realpv:
+ # Replace the first part of the PV value
+ line = re.sub('"[^+]*\+', '"%s+' % realpv, line)
+ lines_before.append(line)
+
+ if args.also_native:
+ lines = lines_after
+ lines_after = []
+ bbclassextend = None
+ for line in lines:
+ if line.startswith('BBCLASSEXTEND ='):
+ splitval = line.split('"')
+ if len(splitval) > 1:
+ bbclassextend = splitval[1].split()
+ if not 'native' in bbclassextend:
+ bbclassextend.insert(0, 'native')
+ line = 'BBCLASSEXTEND = "%s"' % ' '.join(bbclassextend)
+ lines_after.append(line)
+ if not bbclassextend:
+ lines_after.append('BBCLASSEXTEND = "native"')
+
+ postinst = ("postinst", extravalues.pop('postinst', None))
+ postrm = ("postrm", extravalues.pop('postrm', None))
+ preinst = ("preinst", extravalues.pop('preinst', None))
+ prerm = ("prerm", extravalues.pop('prerm', None))
+ funcs = [postinst, postrm, preinst, prerm]
+ for func in funcs:
+ if func[1]:
+ RecipeHandler.genfunction(lines_after, 'pkg_%s_${PN}' % func[0], func[1])
+
+ outlines = []
+ outlines.extend(lines_before)
+ if classes:
+ if outlines[-1] and not outlines[-1].startswith('#'):
+ outlines.append('')
+ outlines.append('inherit %s' % ' '.join(classes))
+ outlines.append('')
+ outlines.extend(lines_after)
+
+ if extravalues:
+ _, outlines = oe.recipeutils.patch_recipe_lines(outlines, extravalues, trailing_newline=False)
+
+ if args.extract_to:
+ scriptutils.git_convert_standalone_clone(srctree)
+ if os.path.isdir(args.extract_to):
+ # If the directory exists we'll move the temp dir into it instead of
+ # its contents - of course, we could try to always move its contents
+ # but that is a pain if there are symlinks; the simplest solution is
+ # to just remove it first
+ os.rmdir(args.extract_to)
+ shutil.move(srctree, args.extract_to)
+ if tempsrc == srctree:
+ tempsrc = None
+ log_info_cond('Source extracted to %s' % args.extract_to, args.devtool)
+
+ if outfile == '-':
+ sys.stdout.write('\n'.join(outlines) + '\n')
+ else:
+ with open(outfile, 'w') as f:
+ lastline = None
+ for line in outlines:
+ if not lastline and not line:
+ # Skip extra blank lines
+ continue
+ f.write('%s\n' % line)
+ lastline = line
+ log_info_cond('Recipe %s has been created; further editing may be required to make it fully functional' % outfile, args.devtool)
+
+ if tempsrc:
+ if args.keep_temp:
+ logger.info('Preserving temporary directory %s' % tempsrc)
+ else:
+ shutil.rmtree(tempsrc)
+
+ return 0
+
+def check_single_file(fn, fetchuri):
+ """Determine if a single downloaded file is something we can't handle"""
+ with open(fn, 'r', errors='surrogateescape') as f:
+ if '<html' in f.read(100).lower():
+ logger.error('Fetching "%s" returned a single HTML page - check the URL is correct and functional' % fetchuri)
+ sys.exit(1)
+
+def split_value(value):
+ if isinstance(value, str):
+ return value.split()
+ else:
+ return value
+
+def handle_license_vars(srctree, lines_before, handled, extravalues, d):
+ lichandled = [x for x in handled if x[0] == 'license']
+ if lichandled:
+ # Someone else has already handled the license vars, just return their value
+ return lichandled[0][1]
+
+ licvalues = guess_license(srctree, d)
+ licenses = []
+ lic_files_chksum = []
+ lic_unknown = []
+ lines = []
+ if licvalues:
+ for licvalue in licvalues:
+ if not licvalue[0] in licenses:
+ licenses.append(licvalue[0])
+ lic_files_chksum.append('file://%s;md5=%s' % (licvalue[1], licvalue[2]))
+ if licvalue[0] == 'Unknown':
+ lic_unknown.append(licvalue[1])
+ if lic_unknown:
+ lines.append('#')
+ lines.append('# The following license files were not able to be identified and are')
+ lines.append('# represented as "Unknown" below, you will need to check them yourself:')
+ for licfile in lic_unknown:
+ lines.append('# %s' % licfile)
+
+ extra_license = split_value(extravalues.pop('LICENSE', []))
+ if '&' in extra_license:
+ extra_license.remove('&')
+ if extra_license:
+ if licenses == ['Unknown']:
+ licenses = extra_license
+ else:
+ for item in extra_license:
+ if item not in licenses:
+ licenses.append(item)
+ extra_lic_files_chksum = split_value(extravalues.pop('LIC_FILES_CHKSUM', []))
+ for item in extra_lic_files_chksum:
+ if item not in lic_files_chksum:
+ lic_files_chksum.append(item)
+
+ if lic_files_chksum:
+ # We are going to set the vars, so prepend the standard disclaimer
+ lines.insert(0, '# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is')
+ lines.insert(1, '# your responsibility to verify that the values are complete and correct.')
+ else:
+ # Without LIC_FILES_CHKSUM we set LICENSE = "CLOSED" to allow the
+ # user to get started easily
+ lines.append('# Unable to find any files that looked like license statements. Check the accompanying')
+ lines.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.')
+ lines.append('#')
+ lines.append('# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if')
+ lines.append('# this is not accurate with respect to the licensing of the software being built (it')
+ lines.append('# will not be in most cases) you must specify the correct value before using this')
+ lines.append('# recipe for anything other than initial testing/development!')
+ licenses = ['CLOSED']
+
+ if extra_license and sorted(licenses) != sorted(extra_license):
+ lines.append('# NOTE: Original package / source metadata indicates license is: %s' % ' & '.join(extra_license))
+
+ if len(licenses) > 1:
+ lines.append('#')
+ lines.append('# NOTE: multiple licenses have been detected; they have been separated with &')
+ lines.append('# in the LICENSE value for now since it is a reasonable assumption that all')
+ lines.append('# of the licenses apply. If instead there is a choice between the multiple')
+ lines.append('# licenses then you should change the value to separate the licenses with |')
+ lines.append('# instead of &. If there is any doubt, check the accompanying documentation')
+ lines.append('# to determine which situation is applicable.')
+
+ lines.append('LICENSE = "%s"' % ' & '.join(licenses))
+ lines.append('LIC_FILES_CHKSUM = "%s"' % ' \\\n '.join(lic_files_chksum))
+ lines.append('')
+
+ # Replace the placeholder so we get the values in the right place in the recipe file
+ try:
+ pos = lines_before.index('##LICENSE_PLACEHOLDER##')
+ except ValueError:
+ pos = -1
+ if pos == -1:
+ lines_before.extend(lines)
+ else:
+ lines_before[pos:pos+1] = lines
+
+ handled.append(('license', licvalues))
+ return licvalues
+
+def get_license_md5sums(d, static_only=False):
+ import bb.utils
+ md5sums = {}
+ if not static_only:
+ # Gather md5sums of license files in common license dir
+ commonlicdir = d.getVar('COMMON_LICENSE_DIR')
+ for fn in os.listdir(commonlicdir):
+ md5value = bb.utils.md5_file(os.path.join(commonlicdir, fn))
+ md5sums[md5value] = fn
+ # The following were extracted from common values in various recipes
+ # (double checking the license against the license file itself, not just
+ # the LICENSE value in the recipe)
+ md5sums['94d55d512a9ba36caa9b7df079bae19f'] = 'GPLv2'
+ md5sums['b234ee4d69f5fce4486a80fdaf4a4263'] = 'GPLv2'
+ md5sums['59530bdf33659b29e73d4adb9f9f6552'] = 'GPLv2'
+ md5sums['0636e73ff0215e8d672dc4c32c317bb3'] = 'GPLv2'
+ md5sums['eb723b61539feef013de476e68b5c50a'] = 'GPLv2'
+ md5sums['751419260aa954499f7abaabaa882bbe'] = 'GPLv2'
+ md5sums['393a5ca445f6965873eca0259a17f833'] = 'GPLv2'
+ md5sums['12f884d2ae1ff87c09e5b7ccc2c4ca7e'] = 'GPLv2'
+ md5sums['8ca43cbc842c2336e835926c2166c28b'] = 'GPLv2'
+ md5sums['ebb5c50ab7cab4baeffba14977030c07'] = 'GPLv2'
+ md5sums['c93c0550bd3173f4504b2cbd8991e50b'] = 'GPLv2'
+ md5sums['9ac2e7cff1ddaf48b6eab6028f23ef88'] = 'GPLv2'
+ md5sums['4325afd396febcb659c36b49533135d4'] = 'GPLv2'
+ md5sums['18810669f13b87348459e611d31ab760'] = 'GPLv2'
+ md5sums['d7810fab7487fb0aad327b76f1be7cd7'] = 'GPLv2' # the Linux kernel's COPYING file
+ md5sums['bbb461211a33b134d42ed5ee802b37ff'] = 'LGPLv2.1'
+ md5sums['7fbc338309ac38fefcd64b04bb903e34'] = 'LGPLv2.1'
+ md5sums['4fbd65380cdd255951079008b364516c'] = 'LGPLv2.1'
+ md5sums['2d5025d4aa3495befef8f17206a5b0a1'] = 'LGPLv2.1'
+ md5sums['fbc093901857fcd118f065f900982c24'] = 'LGPLv2.1'
+ md5sums['a6f89e2100d9b6cdffcea4f398e37343'] = 'LGPLv2.1'
+ md5sums['d8045f3b8f929c1cb29a1e3fd737b499'] = 'LGPLv2.1'
+ md5sums['fad9b3332be894bab9bc501572864b29'] = 'LGPLv2.1'
+ md5sums['3bf50002aefd002f49e7bb854063f7e7'] = 'LGPLv2'
+ md5sums['9f604d8a4f8e74f4f5140845a21b6674'] = 'LGPLv2'
+ md5sums['5f30f0716dfdd0d91eb439ebec522ec2'] = 'LGPLv2'
+ md5sums['55ca817ccb7d5b5b66355690e9abc605'] = 'LGPLv2'
+ md5sums['252890d9eee26aab7b432e8b8a616475'] = 'LGPLv2'
+ md5sums['3214f080875748938ba060314b4f727d'] = 'LGPLv2'
+ md5sums['db979804f025cf55aabec7129cb671ed'] = 'LGPLv2'
+ md5sums['d32239bcb673463ab874e80d47fae504'] = 'GPLv3'
+ md5sums['f27defe1e96c2e1ecd4e0c9be8967949'] = 'GPLv3'
+ md5sums['6a6a8e020838b23406c81b19c1d46df6'] = 'LGPLv3'
+ md5sums['3b83ef96387f14655fc854ddc3c6bd57'] = 'Apache-2.0'
+ md5sums['385c55653886acac3821999a3ccd17b3'] = 'Artistic-1.0 | GPL-2.0' # some perl modules
+ md5sums['54c7042be62e169199200bc6477f04d1'] = 'BSD-3-Clause'
+ return md5sums
+
+def crunch_license(licfile):
+ '''
+ Remove non-material text from a license file and then check
+ its md5sum against a known list. This works well for licenses
+ which contain a copyright statement, but is also a useful way
+ to handle people's insistence upon reformatting the license text
+ slightly (with no material difference to the text of the
+ license).
+ '''
+
+ import oe.utils
+
+ # Note: these are carefully constructed!
+ license_title_re = re.compile('^\(?(#+ *)?(The )?.{1,10} [Ll]icen[sc]e( \(.{1,10}\))?\)?:?$')
+ license_statement_re = re.compile('^(This (project|software) is( free software)? (released|licen[sc]ed)|(Released|Licen[cs]ed)) under the .{1,10} [Ll]icen[sc]e:?$')
+ copyright_re = re.compile('^(#+)? *Copyright .*$')
+
+ crunched_md5sums = {}
+ # The following two were gleaned from the "forever" npm package
+ crunched_md5sums['0a97f8e4cbaf889d6fa51f84b89a79f6'] = 'ISC'
+ crunched_md5sums['eecf6429523cbc9693547cf2db790b5c'] = 'MIT'
+ # https://github.com/vasi/pixz/blob/master/LICENSE
+ crunched_md5sums['2f03392b40bbe663597b5bd3cc5ebdb9'] = 'BSD-2-Clause'
+ # https://github.com/waffle-gl/waffle/blob/master/LICENSE.txt
+ crunched_md5sums['e72e5dfef0b1a4ca8a3d26a60587db66'] = 'BSD-2-Clause'
+ # https://github.com/spigwitmer/fakeds1963s/blob/master/LICENSE
+ crunched_md5sums['8be76ac6d191671f347ee4916baa637e'] = 'GPLv2'
+ # https://github.com/datto/dattobd/blob/master/COPYING
+ # http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/GPLv2.TXT
+ crunched_md5sums['1d65c5ad4bf6489f85f4812bf08ae73d'] = 'GPLv2'
+ # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+ # http://git.neil.brown.name/?p=mdadm.git;a=blob;f=COPYING;h=d159169d1050894d3ea3b98e1c965c4058208fe1;hb=HEAD
+ crunched_md5sums['fb530f66a7a89ce920f0e912b5b66d4b'] = 'GPLv2'
+ # https://github.com/gkos/nrf24/blob/master/COPYING
+ crunched_md5sums['7b6aaa4daeafdfa6ed5443fd2684581b'] = 'GPLv2'
+ # https://github.com/josch09/resetusb/blob/master/COPYING
+ crunched_md5sums['8b8ac1d631a4d220342e83bcf1a1fbc3'] = 'GPLv3'
+ # https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv2.1
+ crunched_md5sums['2ea316ed973ae176e502e2297b574bb3'] = 'LGPLv2.1'
+ # unixODBC-2.3.4 COPYING
+ crunched_md5sums['1daebd9491d1e8426900b4fa5a422814'] = 'LGPLv2.1'
+ # https://github.com/FFmpeg/FFmpeg/blob/master/COPYING.LGPLv3
+ crunched_md5sums['2ebfb3bb49b9a48a075cc1425e7f4129'] = 'LGPLv3'
+ # https://raw.githubusercontent.com/eclipse/mosquitto/v1.4.14/epl-v10
+ crunched_md5sums['efe2cb9a35826992b9df68224e3c2628'] = 'EPL-1.0'
+ # https://raw.githubusercontent.com/eclipse/mosquitto/v1.4.14/edl-v10
+ crunched_md5sums['0a9c78c0a398d1bbce4a166757d60387'] = 'EDL-1.0'
+ lictext = []
+ with open(licfile, 'r', errors='surrogateescape') as f:
+ for line in f:
+ # Drop opening statements
+ if copyright_re.match(line):
+ continue
+ elif license_title_re.match(line):
+ continue
+ elif license_statement_re.match(line):
+ continue
+ # Squash spaces, and replace smart quotes, double quotes
+ # and backticks with single quotes
+ line = oe.utils.squashspaces(line.strip())
+ line = line.replace(u"\u2018", "'").replace(u"\u2019", "'").replace(u"\u201c","'").replace(u"\u201d", "'").replace('"', '\'').replace('`', '\'')
+ if line:
+ lictext.append(line)
+
+ m = hashlib.md5()
+ try:
+ m.update(' '.join(lictext).encode('utf-8'))
+ md5val = m.hexdigest()
+ except UnicodeEncodeError:
+ md5val = None
+ lictext = ''
+ license = crunched_md5sums.get(md5val, None)
+ return license, md5val, lictext
+
+def guess_license(srctree, d):
+ import bb
+ md5sums = get_license_md5sums(d)
+
+ licenses = []
+ licspecs = ['*LICEN[CS]E*', 'COPYING*', '*[Ll]icense*', 'LEGAL*', '[Ll]egal*', '*GPL*', 'README.lic*', 'COPYRIGHT*', '[Cc]opyright*', 'e[dp]l-v10']
+ licfiles = []
+ for root, dirs, files in os.walk(srctree):
+ for fn in files:
+ for spec in licspecs:
+ if fnmatch.fnmatch(fn, spec):
+ fullpath = os.path.join(root, fn)
+ if not fullpath in licfiles:
+ licfiles.append(fullpath)
+ for licfile in licfiles:
+ md5value = bb.utils.md5_file(licfile)
+ license = md5sums.get(md5value, None)
+ if not license:
+ license, crunched_md5, lictext = crunch_license(licfile)
+ if not license:
+ license = 'Unknown'
+ licenses.append((license, os.path.relpath(licfile, srctree), md5value))
+
+ # FIXME should we grab at least one source file with a license header and add that too?
+
+ return licenses
+
+def split_pkg_licenses(licvalues, packages, outlines, fallback_licenses=None, pn='${PN}'):
+ """
+ Given a list of (license, path, md5sum) as returned by guess_license(),
+ a dict of package name to path mappings, write out a set of
+ package-specific LICENSE values.
+ """
+ pkglicenses = {pn: []}
+ for license, licpath, _ in licvalues:
+ for pkgname, pkgpath in packages.items():
+ if licpath.startswith(pkgpath + '/'):
+ if pkgname in pkglicenses:
+ pkglicenses[pkgname].append(license)
+ else:
+ pkglicenses[pkgname] = [license]
+ break
+ else:
+ # Accumulate on the main package
+ pkglicenses[pn].append(license)
+ outlicenses = {}
+ for pkgname in packages:
+ license = ' '.join(list(set(pkglicenses.get(pkgname, ['Unknown'])))) or 'Unknown'
+ if license == 'Unknown' and pkgname in fallback_licenses:
+ license = fallback_licenses[pkgname]
+ outlines.append('LICENSE_%s = "%s"' % (pkgname, license))
+ outlicenses[pkgname] = license.split()
+ return outlicenses
+
+def read_pkgconfig_provides(d):
+ pkgdatadir = d.getVar('PKGDATA_DIR')
+ pkgmap = {}
+ for fn in glob.glob(os.path.join(pkgdatadir, 'shlibs2', '*.pclist')):
+ with open(fn, 'r') as f:
+ for line in f:
+ pkgmap[os.path.basename(line.rstrip())] = os.path.splitext(os.path.basename(fn))[0]
+ recipemap = {}
+ for pc, pkg in pkgmap.items():
+ pkgdatafile = os.path.join(pkgdatadir, 'runtime', pkg)
+ if os.path.exists(pkgdatafile):
+ with open(pkgdatafile, 'r') as f:
+ for line in f:
+ if line.startswith('PN: '):
+ recipemap[pc] = line.split(':', 1)[1].strip()
+ return recipemap
+
+def convert_debian(debpath):
+ value_map = {'Package': 'PN',
+ 'Version': 'PV',
+ 'Section': 'SECTION',
+ 'License': 'LICENSE',
+ 'Homepage': 'HOMEPAGE'}
+
+ # FIXME extend this mapping - perhaps use distro_alias.inc?
+ depmap = {'libz-dev': 'zlib'}
+
+ values = {}
+ depends = []
+ with open(os.path.join(debpath, 'control'), 'r', errors='surrogateescape') as f:
+ indesc = False
+ for line in f:
+ if indesc:
+ if line.startswith(' '):
+ if line.startswith(' This package contains'):
+ indesc = False
+ else:
+ if 'DESCRIPTION' in values:
+ values['DESCRIPTION'] += ' ' + line.strip()
+ else:
+ values['DESCRIPTION'] = line.strip()
+ else:
+ indesc = False
+ if not indesc:
+ splitline = line.split(':', 1)
+ if len(splitline) < 2:
+ continue
+ key = splitline[0]
+ value = splitline[1].strip()
+ if key == 'Build-Depends':
+ for dep in value.split(','):
+ dep = dep.split()[0]
+ mapped = depmap.get(dep, '')
+ if mapped:
+ depends.append(mapped)
+ elif key == 'Description':
+ values['SUMMARY'] = value
+ indesc = True
+ else:
+ varname = value_map.get(key, None)
+ if varname:
+ values[varname] = value
+ postinst = os.path.join(debpath, 'postinst')
+ postrm = os.path.join(debpath, 'postrm')
+ preinst = os.path.join(debpath, 'preinst')
+ prerm = os.path.join(debpath, 'prerm')
+ sfiles = [postinst, postrm, preinst, prerm]
+ for sfile in sfiles:
+ if os.path.isfile(sfile):
+ logger.info("Converting %s file to recipe function..." %
+ os.path.basename(sfile).upper())
+ content = []
+ with open(sfile) as f:
+ for line in f:
+ if "#!/" in line:
+ continue
+ line = line.rstrip("\n")
+ if line.strip():
+ content.append(line)
+ if content:
+ values[os.path.basename(f.name)] = content
+
+ #if depends:
+ # values['DEPENDS'] = ' '.join(depends)
+
+ return values
+
+def convert_rpm_xml(xmlfile):
+ '''Converts the output from rpm -qp --xml to a set of variable values'''
+ import xml.etree.ElementTree as ElementTree
+ rpmtag_map = {'Name': 'PN',
+ 'Version': 'PV',
+ 'Summary': 'SUMMARY',
+ 'Description': 'DESCRIPTION',
+ 'License': 'LICENSE',
+ 'Url': 'HOMEPAGE'}
+
+ values = {}
+ tree = ElementTree.parse(xmlfile)
+ root = tree.getroot()
+ for child in root:
+ if child.tag == 'rpmTag':
+ name = child.attrib.get('name', None)
+ if name:
+ varname = rpmtag_map.get(name, None)
+ if varname:
+ values[varname] = child[0].text
+ return values
+
+
+def register_commands(subparsers):
+ parser_create = subparsers.add_parser('create',
+ help='Create a new recipe',
+ description='Creates a new recipe from a source tree')
+ parser_create.add_argument('source', help='Path or URL to source')
+ parser_create.add_argument('-o', '--outfile', help='Specify filename for recipe to create')
+ parser_create.add_argument('-p', '--provides', help='Specify an alias for the item provided by the recipe')
+ parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true')
+ parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s')
+ parser_create.add_argument('-N', '--name', help='Name to use within recipe (PN)')
+ parser_create.add_argument('-V', '--version', help='Version to use within recipe (PV)')
+ parser_create.add_argument('-b', '--binary', help='Treat the source tree as something that should be installed verbatim (no compilation, same directory structure)', action='store_true')
+ parser_create.add_argument('--also-native', help='Also add native variant (i.e. support building recipe for the build host as well as the target machine)', action='store_true')
+ parser_create.add_argument('--src-subdir', help='Specify subdirectory within source tree to use', metavar='SUBDIR')
+ group = parser_create.add_mutually_exclusive_group()
+ group.add_argument('-a', '--autorev', help='When fetching from a git repository, set SRCREV in the recipe to a floating revision instead of fixed', action="store_true")
+ group.add_argument('-S', '--srcrev', help='Source revision to fetch if fetching from an SCM such as git (default latest)')
+ parser_create.add_argument('-B', '--srcbranch', help='Branch in source repository if fetching from an SCM such as git (default master)')
+ parser_create.add_argument('--keep-temp', action="store_true", help='Keep temporary directory (for debugging)')
+ parser_create.add_argument('--fetch-dev', action="store_true", help='For npm, also fetch devDependencies')
+ parser_create.add_argument('--devtool', action="store_true", help=argparse.SUPPRESS)
+ parser_create.add_argument('--mirrors', action="store_true", help='Enable PREMIRRORS and MIRRORS for source tree fetching (disabled by default).')
+ parser_create.set_defaults(func=create_recipe)
+
diff --git a/poky/scripts/lib/recipetool/create_buildsys.py b/poky/scripts/lib/recipetool/create_buildsys.py
new file mode 100644
index 000000000..4743c740c
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create_buildsys.py
@@ -0,0 +1,893 @@
+# Recipe creation tool - create command build system handlers
+#
+# Copyright (C) 2014-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+import logging
+import glob
+from recipetool.create import RecipeHandler, validate_pv
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+plugins = None
+
+def plugin_init(pluginlist):
+ # Take a reference to the list so we can use it later
+ global plugins
+ plugins = pluginlist
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class CmakeRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ if RecipeHandler.checkfiles(srctree, ['CMakeLists.txt']):
+ classes.append('cmake')
+ values = CmakeRecipeHandler.extract_cmake_deps(lines_before, srctree, extravalues)
+ classes.extend(values.pop('inherit', '').split())
+ for var, value in values.items():
+ lines_before.append('%s = "%s"' % (var, value))
+ lines_after.append('# Specify any options you want to pass to cmake using EXTRA_OECMAKE:')
+ lines_after.append('EXTRA_OECMAKE = ""')
+ lines_after.append('')
+ handled.append('buildsystem')
+ return True
+ return False
+
+ @staticmethod
+ def extract_cmake_deps(outlines, srctree, extravalues, cmakelistsfile=None):
+ # Find all plugins that want to register handlers
+ logger.debug('Loading cmake handlers')
+ handlers = []
+ for plugin in plugins:
+ if hasattr(plugin, 'register_cmake_handlers'):
+ plugin.register_cmake_handlers(handlers)
+
+ values = {}
+ inherits = []
+
+ if cmakelistsfile:
+ srcfiles = [cmakelistsfile]
+ else:
+ srcfiles = RecipeHandler.checkfiles(srctree, ['CMakeLists.txt'])
+
+ # Note that some of these are non-standard, but probably better to
+ # be able to map them anyway if we see them
+ cmake_pkgmap = {'alsa': 'alsa-lib',
+ 'aspell': 'aspell',
+ 'atk': 'atk',
+ 'bison': 'bison-native',
+ 'boost': 'boost',
+ 'bzip2': 'bzip2',
+ 'cairo': 'cairo',
+ 'cups': 'cups',
+ 'curl': 'curl',
+ 'curses': 'ncurses',
+ 'cvs': 'cvs',
+ 'drm': 'libdrm',
+ 'dbus': 'dbus',
+ 'dbusglib': 'dbus-glib',
+ 'egl': 'virtual/egl',
+ 'expat': 'expat',
+ 'flex': 'flex-native',
+ 'fontconfig': 'fontconfig',
+ 'freetype': 'freetype',
+ 'gettext': '',
+ 'git': '',
+ 'gio': 'glib-2.0',
+ 'giounix': 'glib-2.0',
+ 'glew': 'glew',
+ 'glib': 'glib-2.0',
+ 'glib2': 'glib-2.0',
+ 'glu': 'libglu',
+ 'glut': 'freeglut',
+ 'gobject': 'glib-2.0',
+ 'gperf': 'gperf-native',
+ 'gnutls': 'gnutls',
+ 'gtk2': 'gtk+',
+ 'gtk3': 'gtk+3',
+ 'gtk': 'gtk+3',
+ 'harfbuzz': 'harfbuzz',
+ 'icu': 'icu',
+ 'intl': 'virtual/libintl',
+ 'jpeg': 'jpeg',
+ 'libarchive': 'libarchive',
+ 'libiconv': 'virtual/libiconv',
+ 'liblzma': 'xz',
+ 'libxml2': 'libxml2',
+ 'libxslt': 'libxslt',
+ 'opengl': 'virtual/libgl',
+ 'openmp': '',
+ 'openssl': 'openssl',
+ 'pango': 'pango',
+ 'perl': '',
+ 'perllibs': '',
+ 'pkgconfig': '',
+ 'png': 'libpng',
+ 'pthread': '',
+ 'pythoninterp': '',
+ 'pythonlibs': '',
+ 'ruby': 'ruby-native',
+ 'sdl': 'libsdl',
+ 'sdl2': 'libsdl2',
+ 'subversion': 'subversion-native',
+ 'swig': 'swig-native',
+ 'tcl': 'tcl-native',
+ 'threads': '',
+ 'tiff': 'tiff',
+ 'wget': 'wget',
+ 'x11': 'libx11',
+ 'xcb': 'libxcb',
+ 'xext': 'libxext',
+ 'xfixes': 'libxfixes',
+ 'zlib': 'zlib',
+ }
+
+ pcdeps = []
+ libdeps = []
+ deps = []
+ unmappedpkgs = []
+
+ proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)
+ pkgcm_re = re.compile('pkg_check_modules\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?\s+([^)\s]+)\s*\)', re.IGNORECASE)
+ pkgsm_re = re.compile('pkg_search_module\s*\(\s*[a-zA-Z0-9-_]+\s*(REQUIRED)?((\s+[^)\s]+)+)\s*\)', re.IGNORECASE)
+ findpackage_re = re.compile('find_package\s*\(\s*([a-zA-Z0-9-_]+)\s*.*', re.IGNORECASE)
+ findlibrary_re = re.compile('find_library\s*\(\s*[a-zA-Z0-9-_]+\s*(NAMES\s+)?([a-zA-Z0-9-_ ]+)\s*.*')
+ checklib_re = re.compile('check_library_exists\s*\(\s*([^\s)]+)\s*.*', re.IGNORECASE)
+ include_re = re.compile('include\s*\(\s*([^)\s]*)\s*\)', re.IGNORECASE)
+ subdir_re = re.compile('add_subdirectory\s*\(\s*([^)\s]*)\s*([^)\s]*)\s*\)', re.IGNORECASE)
+ dep_re = re.compile('([^ ><=]+)( *[<>=]+ *[^ ><=]+)?')
+
+ def find_cmake_package(pkg):
+ RecipeHandler.load_devel_filemap(tinfoil.config_data)
+ for fn, pn in RecipeHandler.recipecmakefilemap.items():
+ splitname = fn.split('/')
+ if len(splitname) > 1:
+ if splitname[0].lower().startswith(pkg.lower()):
+ if splitname[1] == '%s-config.cmake' % pkg.lower() or splitname[1] == '%sConfig.cmake' % pkg or splitname[1] == 'Find%s.cmake' % pkg:
+ return pn
+ return None
+
+ def interpret_value(value):
+ return value.strip('"')
+
+ def parse_cmake_file(fn, paths=None):
+ searchpaths = (paths or []) + [os.path.dirname(fn)]
+ logger.debug('Parsing file %s' % fn)
+ with open(fn, 'r', errors='surrogateescape') as f:
+ for line in f:
+ line = line.strip()
+ for handler in handlers:
+ if handler.process_line(srctree, fn, line, libdeps, pcdeps, deps, outlines, inherits, values):
+ continue
+ res = include_re.match(line)
+ if res:
+ includefn = bb.utils.which(':'.join(searchpaths), res.group(1))
+ if includefn:
+ parse_cmake_file(includefn, searchpaths)
+ else:
+ logger.debug('Unable to recurse into include file %s' % res.group(1))
+ continue
+ res = subdir_re.match(line)
+ if res:
+ subdirfn = os.path.join(os.path.dirname(fn), res.group(1), 'CMakeLists.txt')
+ if os.path.exists(subdirfn):
+ parse_cmake_file(subdirfn, searchpaths)
+ else:
+ logger.debug('Unable to recurse into subdirectory file %s' % subdirfn)
+ continue
+ res = proj_re.match(line)
+ if res:
+ extravalues['PN'] = interpret_value(res.group(1).split()[0])
+ continue
+ res = pkgcm_re.match(line)
+ if res:
+ res = dep_re.findall(res.group(2))
+ if res:
+ pcdeps.extend([interpret_value(x[0]) for x in res])
+ inherits.append('pkgconfig')
+ continue
+ res = pkgsm_re.match(line)
+ if res:
+ res = dep_re.findall(res.group(2))
+ if res:
+ # Note: appending a tuple here!
+ item = tuple((interpret_value(x[0]) for x in res))
+ if len(item) == 1:
+ item = item[0]
+ pcdeps.append(item)
+ inherits.append('pkgconfig')
+ continue
+ res = findpackage_re.match(line)
+ if res:
+ origpkg = res.group(1)
+ pkg = interpret_value(origpkg)
+ found = False
+ for handler in handlers:
+ if handler.process_findpackage(srctree, fn, pkg, deps, outlines, inherits, values):
+ logger.debug('Mapped CMake package %s via handler %s' % (pkg, handler.__class__.__name__))
+ found = True
+ break
+ if found:
+ continue
+ elif pkg == 'Gettext':
+ inherits.append('gettext')
+ elif pkg == 'Perl':
+ inherits.append('perlnative')
+ elif pkg == 'PkgConfig':
+ inherits.append('pkgconfig')
+ elif pkg == 'PythonInterp':
+ inherits.append('pythonnative')
+ elif pkg == 'PythonLibs':
+ inherits.append('python-dir')
+ else:
+ # Try to map via looking at installed CMake packages in pkgdata
+ dep = find_cmake_package(pkg)
+ if dep:
+ logger.debug('Mapped CMake package %s to recipe %s via pkgdata' % (pkg, dep))
+ deps.append(dep)
+ else:
+ dep = cmake_pkgmap.get(pkg.lower(), None)
+ if dep:
+ logger.debug('Mapped CMake package %s to recipe %s via internal list' % (pkg, dep))
+ deps.append(dep)
+ elif dep is None:
+ unmappedpkgs.append(origpkg)
+ continue
+ res = checklib_re.match(line)
+ if res:
+ lib = interpret_value(res.group(1))
+ if not lib.startswith('$'):
+ libdeps.append(lib)
+ res = findlibrary_re.match(line)
+ if res:
+ libs = res.group(2).split()
+ for lib in libs:
+ if lib in ['HINTS', 'PATHS', 'PATH_SUFFIXES', 'DOC', 'NAMES_PER_DIR'] or lib.startswith(('NO_', 'CMAKE_', 'ONLY_CMAKE_')):
+ break
+ lib = interpret_value(lib)
+ if not lib.startswith('$'):
+ libdeps.append(lib)
+ if line.lower().startswith('useswig'):
+ deps.append('swig-native')
+ continue
+
+ parse_cmake_file(srcfiles[0])
+
+ if unmappedpkgs:
+ outlines.append('# NOTE: unable to map the following CMake package dependencies: %s' % ' '.join(list(set(unmappedpkgs))))
+
+ RecipeHandler.handle_depends(libdeps, pcdeps, deps, outlines, values, tinfoil.config_data)
+
+ for handler in handlers:
+ handler.post_process(srctree, libdeps, pcdeps, deps, outlines, inherits, values)
+
+ if inherits:
+ values['inherit'] = ' '.join(list(set(inherits)))
+
+ return values
+
+
+class CmakeExtensionHandler(object):
+ '''Base class for CMake extension handlers'''
+ def process_line(self, srctree, fn, line, libdeps, pcdeps, deps, outlines, inherits, values):
+ '''
+ Handle a line parsed out of an CMake file.
+ Return True if you've completely handled the passed in line, otherwise return False.
+ '''
+ return False
+
+ def process_findpackage(self, srctree, fn, pkg, deps, outlines, inherits, values):
+ '''
+ Handle a find_package package parsed out of a CMake file.
+ Return True if you've completely handled the passed in package, otherwise return False.
+ '''
+ return False
+
+ def post_process(self, srctree, fn, pkg, deps, outlines, inherits, values):
+ '''
+ Apply any desired post-processing on the output
+ '''
+ return
+
+
+
+class SconsRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ if RecipeHandler.checkfiles(srctree, ['SConstruct', 'Sconstruct', 'sconstruct']):
+ classes.append('scons')
+ lines_after.append('# Specify any options you want to pass to scons using EXTRA_OESCONS:')
+ lines_after.append('EXTRA_OESCONS = ""')
+ lines_after.append('')
+ handled.append('buildsystem')
+ return True
+ return False
+
+
+class QmakeRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ if RecipeHandler.checkfiles(srctree, ['*.pro']):
+ classes.append('qmake2')
+ handled.append('buildsystem')
+ return True
+ return False
+
+
+class AutotoolsRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ autoconf = False
+ if RecipeHandler.checkfiles(srctree, ['configure.ac', 'configure.in']):
+ autoconf = True
+ values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, extravalues)
+ classes.extend(values.pop('inherit', '').split())
+ for var, value in values.items():
+ lines_before.append('%s = "%s"' % (var, value))
+ else:
+ conffile = RecipeHandler.checkfiles(srctree, ['configure'])
+ if conffile:
+ # Check if this is just a pre-generated autoconf configure script
+ with open(conffile[0], 'r', errors='surrogateescape') as f:
+ for i in range(1, 10):
+ if 'Generated by GNU Autoconf' in f.readline():
+ autoconf = True
+ break
+
+ if autoconf and not ('PV' in extravalues and 'PN' in extravalues):
+ # Last resort
+ conffile = RecipeHandler.checkfiles(srctree, ['configure'])
+ if conffile:
+ with open(conffile[0], 'r', errors='surrogateescape') as f:
+ for line in f:
+ line = line.strip()
+ if line.startswith('VERSION=') or line.startswith('PACKAGE_VERSION='):
+ pv = line.split('=')[1].strip('"\'')
+ if pv and not 'PV' in extravalues and validate_pv(pv):
+ extravalues['PV'] = pv
+ elif line.startswith('PACKAGE_NAME=') or line.startswith('PACKAGE='):
+ pn = line.split('=')[1].strip('"\'')
+ if pn and not 'PN' in extravalues:
+ extravalues['PN'] = pn
+
+ if autoconf:
+ lines_before.append('')
+ lines_before.append('# NOTE: if this software is not capable of being built in a separate build directory')
+ lines_before.append('# from the source, you should replace autotools with autotools-brokensep in the')
+ lines_before.append('# inherit line')
+ classes.append('autotools')
+ lines_after.append('# Specify any options you want to pass to the configure script using EXTRA_OECONF:')
+ lines_after.append('EXTRA_OECONF = ""')
+ lines_after.append('')
+ handled.append('buildsystem')
+ return True
+
+ return False
+
+ @staticmethod
+ def extract_autotools_deps(outlines, srctree, extravalues=None, acfile=None):
+ import shlex
+
+ # Find all plugins that want to register handlers
+ logger.debug('Loading autotools handlers')
+ handlers = []
+ for plugin in plugins:
+ if hasattr(plugin, 'register_autotools_handlers'):
+ plugin.register_autotools_handlers(handlers)
+
+ values = {}
+ inherits = []
+
+ # Hardcoded map, we also use a dynamic one based on what's in the sysroot
+ progmap = {'flex': 'flex-native',
+ 'bison': 'bison-native',
+ 'm4': 'm4-native',
+ 'tar': 'tar-native',
+ 'ar': 'binutils-native',
+ 'ranlib': 'binutils-native',
+ 'ld': 'binutils-native',
+ 'strip': 'binutils-native',
+ 'libtool': '',
+ 'autoconf': '',
+ 'autoheader': '',
+ 'automake': '',
+ 'uname': '',
+ 'rm': '',
+ 'cp': '',
+ 'mv': '',
+ 'find': '',
+ 'awk': '',
+ 'sed': '',
+ }
+ progclassmap = {'gconftool-2': 'gconf',
+ 'pkg-config': 'pkgconfig',
+ 'python': 'pythonnative',
+ 'python3': 'python3native',
+ 'perl': 'perlnative',
+ 'makeinfo': 'texinfo',
+ }
+
+ pkg_re = re.compile('PKG_CHECK_MODULES\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*')
+ pkgce_re = re.compile('PKG_CHECK_EXISTS\(\s*\[?([^,\]]*)\]?[),].*')
+ lib_re = re.compile('AC_CHECK_LIB\(\s*\[?([^,\]]*)\]?,.*')
+ libx_re = re.compile('AX_CHECK_LIBRARY\(\s*\[?[^,\]]*\]?,\s*\[?([^,\]]*)\]?,\s*\[?([a-zA-Z0-9-]*)\]?,.*')
+ progs_re = re.compile('_PROGS?\(\s*\[?[a-zA-Z0-9_]*\]?,\s*\[?([^,\]]*)\]?[),].*')
+ dep_re = re.compile('([^ ><=]+)( [<>=]+ [^ ><=]+)?')
+ ac_init_re = re.compile('AC_INIT\(\s*([^,]+),\s*([^,]+)[,)].*')
+ am_init_re = re.compile('AM_INIT_AUTOMAKE\(\s*([^,]+),\s*([^,]+)[,)].*')
+ define_re = re.compile('\s*(m4_)?define\(\s*([^,]+),\s*([^,]+)\)')
+ version_re = re.compile('([0-9.]+)')
+
+ defines = {}
+ def subst_defines(value):
+ newvalue = value
+ for define, defval in defines.items():
+ newvalue = newvalue.replace(define, defval)
+ if newvalue != value:
+ return subst_defines(newvalue)
+ return value
+
+ def process_value(value):
+ value = value.replace('[', '').replace(']', '')
+ if value.startswith('m4_esyscmd(') or value.startswith('m4_esyscmd_s('):
+ cmd = subst_defines(value[value.index('(')+1:-1])
+ try:
+ if '|' in cmd:
+ cmd = 'set -o pipefail; ' + cmd
+ stdout, _ = bb.process.run(cmd, cwd=srctree, shell=True)
+ ret = stdout.rstrip()
+ except bb.process.ExecutionError as e:
+ ret = ''
+ elif value.startswith('m4_'):
+ return None
+ ret = subst_defines(value)
+ if ret:
+ ret = ret.strip('"\'')
+ return ret
+
+ # Since a configure.ac file is essentially a program, this is only ever going to be
+ # a hack unfortunately; but it ought to be enough of an approximation
+ if acfile:
+ srcfiles = [acfile]
+ else:
+ srcfiles = RecipeHandler.checkfiles(srctree, ['acinclude.m4', 'configure.ac', 'configure.in'])
+
+ pcdeps = []
+ libdeps = []
+ deps = []
+ unmapped = []
+
+ RecipeHandler.load_binmap(tinfoil.config_data)
+
+ def process_macro(keyword, value):
+ for handler in handlers:
+ if handler.process_macro(srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values):
+ return
+ logger.debug('Found keyword %s with value "%s"' % (keyword, value))
+ if keyword == 'PKG_CHECK_MODULES':
+ res = pkg_re.search(value)
+ if res:
+ res = dep_re.findall(res.group(1))
+ if res:
+ pcdeps.extend([x[0] for x in res])
+ inherits.append('pkgconfig')
+ elif keyword == 'PKG_CHECK_EXISTS':
+ res = pkgce_re.search(value)
+ if res:
+ res = dep_re.findall(res.group(1))
+ if res:
+ pcdeps.extend([x[0] for x in res])
+ inherits.append('pkgconfig')
+ elif keyword in ('AM_GNU_GETTEXT', 'AM_GLIB_GNU_GETTEXT', 'GETTEXT_PACKAGE'):
+ inherits.append('gettext')
+ elif keyword in ('AC_PROG_INTLTOOL', 'IT_PROG_INTLTOOL'):
+ deps.append('intltool-native')
+ elif keyword == 'AM_PATH_GLIB_2_0':
+ deps.append('glib-2.0')
+ elif keyword in ('AC_CHECK_PROG', 'AC_PATH_PROG', 'AX_WITH_PROG'):
+ res = progs_re.search(value)
+ if res:
+ for prog in shlex.split(res.group(1)):
+ prog = prog.split()[0]
+ for handler in handlers:
+ if handler.process_prog(srctree, keyword, value, prog, deps, outlines, inherits, values):
+ return
+ progclass = progclassmap.get(prog, None)
+ if progclass:
+ inherits.append(progclass)
+ else:
+ progdep = RecipeHandler.recipebinmap.get(prog, None)
+ if not progdep:
+ progdep = progmap.get(prog, None)
+ if progdep:
+ deps.append(progdep)
+ elif progdep is None:
+ if not prog.startswith('$'):
+ unmapped.append(prog)
+ elif keyword == 'AC_CHECK_LIB':
+ res = lib_re.search(value)
+ if res:
+ lib = res.group(1)
+ if not lib.startswith('$'):
+ libdeps.append(lib)
+ elif keyword == 'AX_CHECK_LIBRARY':
+ res = libx_re.search(value)
+ if res:
+ lib = res.group(2)
+ if not lib.startswith('$'):
+ header = res.group(1)
+ libdeps.append((lib, header))
+ elif keyword == 'AC_PATH_X':
+ deps.append('libx11')
+ elif keyword in ('AX_BOOST', 'BOOST_REQUIRE'):
+ deps.append('boost')
+ elif keyword in ('AC_PROG_LEX', 'AM_PROG_LEX', 'AX_PROG_FLEX'):
+ deps.append('flex-native')
+ elif keyword in ('AC_PROG_YACC', 'AX_PROG_BISON'):
+ deps.append('bison-native')
+ elif keyword == 'AX_CHECK_ZLIB':
+ deps.append('zlib')
+ elif keyword in ('AX_CHECK_OPENSSL', 'AX_LIB_CRYPTO'):
+ deps.append('openssl')
+ elif keyword == 'AX_LIB_CURL':
+ deps.append('curl')
+ elif keyword == 'AX_LIB_BEECRYPT':
+ deps.append('beecrypt')
+ elif keyword == 'AX_LIB_EXPAT':
+ deps.append('expat')
+ elif keyword == 'AX_LIB_GCRYPT':
+ deps.append('libgcrypt')
+ elif keyword == 'AX_LIB_NETTLE':
+ deps.append('nettle')
+ elif keyword == 'AX_LIB_READLINE':
+ deps.append('readline')
+ elif keyword == 'AX_LIB_SQLITE3':
+ deps.append('sqlite3')
+ elif keyword == 'AX_LIB_TAGLIB':
+ deps.append('taglib')
+ elif keyword in ['AX_PKG_SWIG', 'AC_PROG_SWIG']:
+ deps.append('swig-native')
+ elif keyword == 'AX_PROG_XSLTPROC':
+ deps.append('libxslt-native')
+ elif keyword in ['AC_PYTHON_DEVEL', 'AX_PYTHON_DEVEL', 'AM_PATH_PYTHON']:
+ pythonclass = 'pythonnative'
+ res = version_re.search(value)
+ if res:
+ if res.group(1).startswith('3'):
+ pythonclass = 'python3native'
+ # Avoid replacing python3native with pythonnative
+ if not pythonclass in inherits and not 'python3native' in inherits:
+ if 'pythonnative' in inherits:
+ inherits.remove('pythonnative')
+ inherits.append(pythonclass)
+ elif keyword == 'AX_WITH_CURSES':
+ deps.append('ncurses')
+ elif keyword == 'AX_PATH_BDB':
+ deps.append('db')
+ elif keyword == 'AX_PATH_LIB_PCRE':
+ deps.append('libpcre')
+ elif keyword == 'AC_INIT':
+ if extravalues is not None:
+ res = ac_init_re.match(value)
+ if res:
+ extravalues['PN'] = process_value(res.group(1))
+ pv = process_value(res.group(2))
+ if validate_pv(pv):
+ extravalues['PV'] = pv
+ elif keyword == 'AM_INIT_AUTOMAKE':
+ if extravalues is not None:
+ if 'PN' not in extravalues:
+ res = am_init_re.match(value)
+ if res:
+ if res.group(1) != 'AC_PACKAGE_NAME':
+ extravalues['PN'] = process_value(res.group(1))
+ pv = process_value(res.group(2))
+ if validate_pv(pv):
+ extravalues['PV'] = pv
+ elif keyword == 'define(':
+ res = define_re.match(value)
+ if res:
+ key = res.group(2).strip('[]')
+ value = process_value(res.group(3))
+ if value is not None:
+ defines[key] = value
+
+ keywords = ['PKG_CHECK_MODULES',
+ 'PKG_CHECK_EXISTS',
+ 'AM_GNU_GETTEXT',
+ 'AM_GLIB_GNU_GETTEXT',
+ 'GETTEXT_PACKAGE',
+ 'AC_PROG_INTLTOOL',
+ 'IT_PROG_INTLTOOL',
+ 'AM_PATH_GLIB_2_0',
+ 'AC_CHECK_PROG',
+ 'AC_PATH_PROG',
+ 'AX_WITH_PROG',
+ 'AC_CHECK_LIB',
+ 'AX_CHECK_LIBRARY',
+ 'AC_PATH_X',
+ 'AX_BOOST',
+ 'BOOST_REQUIRE',
+ 'AC_PROG_LEX',
+ 'AM_PROG_LEX',
+ 'AX_PROG_FLEX',
+ 'AC_PROG_YACC',
+ 'AX_PROG_BISON',
+ 'AX_CHECK_ZLIB',
+ 'AX_CHECK_OPENSSL',
+ 'AX_LIB_CRYPTO',
+ 'AX_LIB_CURL',
+ 'AX_LIB_BEECRYPT',
+ 'AX_LIB_EXPAT',
+ 'AX_LIB_GCRYPT',
+ 'AX_LIB_NETTLE',
+ 'AX_LIB_READLINE'
+ 'AX_LIB_SQLITE3',
+ 'AX_LIB_TAGLIB',
+ 'AX_PKG_SWIG',
+ 'AC_PROG_SWIG',
+ 'AX_PROG_XSLTPROC',
+ 'AC_PYTHON_DEVEL',
+ 'AX_PYTHON_DEVEL',
+ 'AM_PATH_PYTHON',
+ 'AX_WITH_CURSES',
+ 'AX_PATH_BDB',
+ 'AX_PATH_LIB_PCRE',
+ 'AC_INIT',
+ 'AM_INIT_AUTOMAKE',
+ 'define(',
+ ]
+
+ for handler in handlers:
+ handler.extend_keywords(keywords)
+
+ for srcfile in srcfiles:
+ nesting = 0
+ in_keyword = ''
+ partial = ''
+ with open(srcfile, 'r', errors='surrogateescape') as f:
+ for line in f:
+ if in_keyword:
+ partial += ' ' + line.strip()
+ if partial.endswith('\\'):
+ partial = partial[:-1]
+ nesting = nesting + line.count('(') - line.count(')')
+ if nesting == 0:
+ process_macro(in_keyword, partial)
+ partial = ''
+ in_keyword = ''
+ else:
+ for keyword in keywords:
+ if keyword in line:
+ nesting = line.count('(') - line.count(')')
+ if nesting > 0:
+ partial = line.strip()
+ if partial.endswith('\\'):
+ partial = partial[:-1]
+ in_keyword = keyword
+ else:
+ process_macro(keyword, line.strip())
+ break
+
+ if in_keyword:
+ process_macro(in_keyword, partial)
+
+ if extravalues:
+ for k,v in list(extravalues.items()):
+ if v:
+ if v.startswith('$') or v.startswith('@') or v.startswith('%'):
+ del extravalues[k]
+ else:
+ extravalues[k] = v.strip('"\'').rstrip('()')
+
+ if unmapped:
+ outlines.append('# NOTE: the following prog dependencies are unknown, ignoring: %s' % ' '.join(list(set(unmapped))))
+
+ RecipeHandler.handle_depends(libdeps, pcdeps, deps, outlines, values, tinfoil.config_data)
+
+ for handler in handlers:
+ handler.post_process(srctree, libdeps, pcdeps, deps, outlines, inherits, values)
+
+ if inherits:
+ values['inherit'] = ' '.join(list(set(inherits)))
+
+ return values
+
+
+class AutotoolsExtensionHandler(object):
+ '''Base class for Autotools extension handlers'''
+ def process_macro(self, srctree, keyword, value, process_value, libdeps, pcdeps, deps, outlines, inherits, values):
+ '''
+ Handle a macro parsed out of an autotools file. Note that if you want this to be called
+ for any macro other than the ones AutotoolsRecipeHandler already looks for, you'll need
+ to add it to the keywords list in extend_keywords().
+ Return True if you've completely handled the passed in macro, otherwise return False.
+ '''
+ return False
+
+ def extend_keywords(self, keywords):
+ '''Adds keywords to be recognised by the parser (so that you get a call to process_macro)'''
+ return
+
+ def process_prog(self, srctree, keyword, value, prog, deps, outlines, inherits, values):
+ '''
+ Handle an AC_PATH_PROG, AC_CHECK_PROG etc. line
+ Return True if you've completely handled the passed in macro, otherwise return False.
+ '''
+ return False
+
+ def post_process(self, srctree, fn, pkg, deps, outlines, inherits, values):
+ '''
+ Apply any desired post-processing on the output
+ '''
+ return
+
+
+class MakefileRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ makefile = RecipeHandler.checkfiles(srctree, ['Makefile', 'makefile', 'GNUmakefile'])
+ if makefile:
+ lines_after.append('# NOTE: this is a Makefile-only piece of software, so we cannot generate much of the')
+ lines_after.append('# recipe automatically - you will need to examine the Makefile yourself and ensure')
+ lines_after.append('# that the appropriate arguments are passed in.')
+ lines_after.append('')
+
+ scanfile = os.path.join(srctree, 'configure.scan')
+ skipscan = False
+ try:
+ stdout, stderr = bb.process.run('autoscan', cwd=srctree, shell=True)
+ except bb.process.ExecutionError as e:
+ skipscan = True
+ if scanfile and os.path.exists(scanfile):
+ values = AutotoolsRecipeHandler.extract_autotools_deps(lines_before, srctree, acfile=scanfile)
+ classes.extend(values.pop('inherit', '').split())
+ for var, value in values.items():
+ if var == 'DEPENDS':
+ lines_before.append('# NOTE: some of these dependencies may be optional, check the Makefile and/or upstream documentation')
+ lines_before.append('%s = "%s"' % (var, value))
+ lines_before.append('')
+ for f in ['configure.scan', 'autoscan.log']:
+ fp = os.path.join(srctree, f)
+ if os.path.exists(fp):
+ os.remove(fp)
+
+ self.genfunction(lines_after, 'do_configure', ['# Specify any needed configure commands here'])
+
+ func = []
+ func.append('# You will almost certainly need to add additional arguments here')
+ func.append('oe_runmake')
+ self.genfunction(lines_after, 'do_compile', func)
+
+ installtarget = True
+ try:
+ stdout, stderr = bb.process.run('make -n install', cwd=srctree, shell=True)
+ except bb.process.ExecutionError as e:
+ if e.exitcode != 1:
+ installtarget = False
+ func = []
+ if installtarget:
+ func.append('# This is a guess; additional arguments may be required')
+ makeargs = ''
+ with open(makefile[0], 'r', errors='surrogateescape') as f:
+ for i in range(1, 100):
+ if 'DESTDIR' in f.readline():
+ makeargs += " 'DESTDIR=${D}'"
+ break
+ func.append('oe_runmake install%s' % makeargs)
+ else:
+ func.append('# NOTE: unable to determine what to put here - there is a Makefile but no')
+ func.append('# target named "install", so you will need to define this yourself')
+ self.genfunction(lines_after, 'do_install', func)
+
+ handled.append('buildsystem')
+ else:
+ lines_after.append('# NOTE: no Makefile found, unable to determine what needs to be done')
+ lines_after.append('')
+ self.genfunction(lines_after, 'do_configure', ['# Specify any needed configure commands here'])
+ self.genfunction(lines_after, 'do_compile', ['# Specify compilation commands here'])
+ self.genfunction(lines_after, 'do_install', ['# Specify install commands here'])
+
+
+class VersionFileRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'PV' not in extravalues:
+ # Look for a VERSION or version file containing a single line consisting
+ # only of a version number
+ filelist = RecipeHandler.checkfiles(srctree, ['VERSION', 'version'])
+ version = None
+ for fileitem in filelist:
+ linecount = 0
+ with open(fileitem, 'r', errors='surrogateescape') as f:
+ for line in f:
+ line = line.rstrip().strip('"\'')
+ linecount += 1
+ if line:
+ if linecount > 1:
+ version = None
+ break
+ else:
+ if validate_pv(line):
+ version = line
+ if version:
+ extravalues['PV'] = version
+ break
+
+
+class SpecFileRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'PV' in extravalues and 'PN' in extravalues:
+ return
+ filelist = RecipeHandler.checkfiles(srctree, ['*.spec'], recursive=True)
+ valuemap = {'Name': 'PN',
+ 'Version': 'PV',
+ 'Summary': 'SUMMARY',
+ 'Url': 'HOMEPAGE',
+ 'License': 'LICENSE'}
+ foundvalues = {}
+ for fileitem in filelist:
+ linecount = 0
+ with open(fileitem, 'r', errors='surrogateescape') as f:
+ for line in f:
+ for value, varname in valuemap.items():
+ if line.startswith(value + ':') and not varname in foundvalues:
+ foundvalues[varname] = line.split(':', 1)[1].strip()
+ break
+ if len(foundvalues) == len(valuemap):
+ break
+ # Drop values containing unexpanded RPM macros
+ for k in list(foundvalues.keys()):
+ if '%' in foundvalues[k]:
+ del foundvalues[k]
+ if 'PV' in foundvalues:
+ if not validate_pv(foundvalues['PV']):
+ del foundvalues['PV']
+ license = foundvalues.pop('LICENSE', None)
+ if license:
+ liccomment = '# NOTE: spec file indicates the license may be "%s"' % license
+ for i, line in enumerate(lines_before):
+ if line.startswith('LICENSE ='):
+ lines_before.insert(i, liccomment)
+ break
+ else:
+ lines_before.append(liccomment)
+ extravalues.update(foundvalues)
+
+def register_recipe_handlers(handlers):
+ # Set priorities with some gaps so that other plugins can insert
+ # their own handlers (so avoid changing these numbers)
+ handlers.append((CmakeRecipeHandler(), 50))
+ handlers.append((AutotoolsRecipeHandler(), 40))
+ handlers.append((SconsRecipeHandler(), 30))
+ handlers.append((QmakeRecipeHandler(), 20))
+ handlers.append((MakefileRecipeHandler(), 10))
+ handlers.append((VersionFileRecipeHandler(), -1))
+ handlers.append((SpecFileRecipeHandler(), -1))
diff --git a/poky/scripts/lib/recipetool/create_buildsys_python.py b/poky/scripts/lib/recipetool/create_buildsys_python.py
new file mode 100644
index 000000000..5bd2aa337
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create_buildsys_python.py
@@ -0,0 +1,719 @@
+# Recipe creation tool - create build system handler for python
+#
+# Copyright (C) 2015 Mentor Graphics Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import ast
+import codecs
+import collections
+import distutils.command.build_py
+import email
+import imp
+import glob
+import itertools
+import logging
+import os
+import re
+import sys
+import subprocess
+from recipetool.create import RecipeHandler
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class PythonRecipeHandler(RecipeHandler):
+ base_pkgdeps = ['python-core']
+ excluded_pkgdeps = ['python-dbg']
+ # os.path is provided by python-core
+ assume_provided = ['builtins', 'os.path']
+ # Assumes that the host python builtin_module_names is sane for target too
+ assume_provided = assume_provided + list(sys.builtin_module_names)
+
+ bbvar_map = {
+ 'Name': 'PN',
+ 'Version': 'PV',
+ 'Home-page': 'HOMEPAGE',
+ 'Summary': 'SUMMARY',
+ 'Description': 'DESCRIPTION',
+ 'License': 'LICENSE',
+ 'Requires': 'RDEPENDS_${PN}',
+ 'Provides': 'RPROVIDES_${PN}',
+ 'Obsoletes': 'RREPLACES_${PN}',
+ }
+ # PN/PV are already set by recipetool core & desc can be extremely long
+ excluded_fields = [
+ 'Description',
+ ]
+ setup_parse_map = {
+ 'Url': 'Home-page',
+ 'Classifiers': 'Classifier',
+ 'Description': 'Summary',
+ }
+ setuparg_map = {
+ 'Home-page': 'url',
+ 'Classifier': 'classifiers',
+ 'Summary': 'description',
+ 'Description': 'long-description',
+ }
+ # Values which are lists, used by the setup.py argument based metadata
+ # extraction method, to determine how to process the setup.py output.
+ setuparg_list_fields = [
+ 'Classifier',
+ 'Requires',
+ 'Provides',
+ 'Obsoletes',
+ 'Platform',
+ 'Supported-Platform',
+ ]
+ setuparg_multi_line_values = ['Description']
+ replacements = [
+ ('License', r' +$', ''),
+ ('License', r'^ +', ''),
+ ('License', r' ', '-'),
+ ('License', r'^GNU-', ''),
+ ('License', r'-[Ll]icen[cs]e(,?-[Vv]ersion)?', ''),
+ ('License', r'^UNKNOWN$', ''),
+
+ # Remove currently unhandled version numbers from these variables
+ ('Requires', r' *\([^)]*\)', ''),
+ ('Provides', r' *\([^)]*\)', ''),
+ ('Obsoletes', r' *\([^)]*\)', ''),
+ ('Install-requires', r'^([^><= ]+).*', r'\1'),
+ ('Extras-require', r'^([^><= ]+).*', r'\1'),
+ ('Tests-require', r'^([^><= ]+).*', r'\1'),
+
+ # Remove unhandled dependency on particular features (e.g. foo[PDF])
+ ('Install-requires', r'\[[^\]]+\]$', ''),
+ ]
+
+ classifier_license_map = {
+ 'License :: OSI Approved :: Academic Free License (AFL)': 'AFL',
+ 'License :: OSI Approved :: Apache Software License': 'Apache',
+ 'License :: OSI Approved :: Apple Public Source License': 'APSL',
+ 'License :: OSI Approved :: Artistic License': 'Artistic',
+ 'License :: OSI Approved :: Attribution Assurance License': 'AAL',
+ 'License :: OSI Approved :: BSD License': 'BSD',
+ 'License :: OSI Approved :: Common Public License': 'CPL',
+ 'License :: OSI Approved :: Eiffel Forum License': 'EFL',
+ 'License :: OSI Approved :: European Union Public Licence 1.0 (EUPL 1.0)': 'EUPL-1.0',
+ 'License :: OSI Approved :: European Union Public Licence 1.1 (EUPL 1.1)': 'EUPL-1.1',
+ 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)': 'AGPL-3.0+',
+ 'License :: OSI Approved :: GNU Affero General Public License v3': 'AGPL-3.0',
+ 'License :: OSI Approved :: GNU Free Documentation License (FDL)': 'GFDL',
+ 'License :: OSI Approved :: GNU General Public License (GPL)': 'GPL',
+ 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)': 'GPL-2.0',
+ 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)': 'GPL-2.0+',
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)': 'GPL-3.0',
+ 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)': 'GPL-3.0+',
+ 'License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)': 'LGPL-2.0',
+ 'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)': 'LGPL-2.0+',
+ 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)': 'LGPL-3.0',
+ 'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)': 'LGPL-3.0+',
+ 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)': 'LGPL',
+ 'License :: OSI Approved :: IBM Public License': 'IPL',
+ 'License :: OSI Approved :: ISC License (ISCL)': 'ISC',
+ 'License :: OSI Approved :: Intel Open Source License': 'Intel',
+ 'License :: OSI Approved :: Jabber Open Source License': 'Jabber',
+ 'License :: OSI Approved :: MIT License': 'MIT',
+ 'License :: OSI Approved :: MITRE Collaborative Virtual Workspace License (CVW)': 'CVWL',
+ 'License :: OSI Approved :: Motosoto License': 'Motosoto',
+ 'License :: OSI Approved :: Mozilla Public License 1.0 (MPL)': 'MPL-1.0',
+ 'License :: OSI Approved :: Mozilla Public License 1.1 (MPL 1.1)': 'MPL-1.1',
+ 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)': 'MPL-2.0',
+ 'License :: OSI Approved :: Nethack General Public License': 'NGPL',
+ 'License :: OSI Approved :: Nokia Open Source License': 'Nokia',
+ 'License :: OSI Approved :: Open Group Test Suite License': 'OGTSL',
+ 'License :: OSI Approved :: Python License (CNRI Python License)': 'CNRI-Python',
+ 'License :: OSI Approved :: Python Software Foundation License': 'PSF',
+ 'License :: OSI Approved :: Qt Public License (QPL)': 'QPL',
+ 'License :: OSI Approved :: Ricoh Source Code Public License': 'RSCPL',
+ 'License :: OSI Approved :: Sleepycat License': 'Sleepycat',
+ 'License :: OSI Approved :: Sun Industry Standards Source License (SISSL)': '-- Sun Industry Standards Source License (SISSL)',
+ 'License :: OSI Approved :: Sun Public License': 'SPL',
+ 'License :: OSI Approved :: University of Illinois/NCSA Open Source License': 'NCSA',
+ 'License :: OSI Approved :: Vovida Software License 1.0': 'VSL-1.0',
+ 'License :: OSI Approved :: W3C License': 'W3C',
+ 'License :: OSI Approved :: X.Net License': 'Xnet',
+ 'License :: OSI Approved :: Zope Public License': 'ZPL',
+ 'License :: OSI Approved :: zlib/libpng License': 'Zlib',
+ }
+
+ def __init__(self):
+ pass
+
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ if 'buildsystem' in handled:
+ return False
+
+ if not RecipeHandler.checkfiles(srctree, ['setup.py']):
+ return
+
+ # setup.py is always parsed to get at certain required information, such as
+ # distutils vs setuptools
+ #
+ # If egg info is available, we use it for both its PKG-INFO metadata
+ # and for its requires.txt for install_requires.
+ # If PKG-INFO is available but no egg info is, we use that for metadata in preference to
+ # the parsed setup.py, but use the install_requires info from the
+ # parsed setup.py.
+
+ setupscript = os.path.join(srctree, 'setup.py')
+ try:
+ setup_info, uses_setuptools, setup_non_literals, extensions = self.parse_setup_py(setupscript)
+ except Exception:
+ logger.exception("Failed to parse setup.py")
+ setup_info, uses_setuptools, setup_non_literals, extensions = {}, True, [], []
+
+ egginfo = glob.glob(os.path.join(srctree, '*.egg-info'))
+ if egginfo:
+ info = self.get_pkginfo(os.path.join(egginfo[0], 'PKG-INFO'))
+ requires_txt = os.path.join(egginfo[0], 'requires.txt')
+ if os.path.exists(requires_txt):
+ with codecs.open(requires_txt) as f:
+ inst_req = []
+ extras_req = collections.defaultdict(list)
+ current_feature = None
+ for line in f.readlines():
+ line = line.rstrip()
+ if not line:
+ continue
+
+ if line.startswith('['):
+ current_feature = line[1:-1]
+ elif current_feature:
+ extras_req[current_feature].append(line)
+ else:
+ inst_req.append(line)
+ info['Install-requires'] = inst_req
+ info['Extras-require'] = extras_req
+ elif RecipeHandler.checkfiles(srctree, ['PKG-INFO']):
+ info = self.get_pkginfo(os.path.join(srctree, 'PKG-INFO'))
+
+ if setup_info:
+ if 'Install-requires' in setup_info:
+ info['Install-requires'] = setup_info['Install-requires']
+ if 'Extras-require' in setup_info:
+ info['Extras-require'] = setup_info['Extras-require']
+ else:
+ if setup_info:
+ info = setup_info
+ else:
+ info = self.get_setup_args_info(setupscript)
+
+ # Grab the license value before applying replacements
+ license_str = info.get('License', '').strip()
+
+ self.apply_info_replacements(info)
+
+ if uses_setuptools:
+ classes.append('setuptools')
+ else:
+ classes.append('distutils')
+
+ if license_str:
+ for i, line in enumerate(lines_before):
+ if line.startswith('LICENSE = '):
+ lines_before.insert(i, '# NOTE: License in setup.py/PKGINFO is: %s' % license_str)
+ break
+
+ if 'Classifier' in info:
+ existing_licenses = info.get('License', '')
+ licenses = []
+ for classifier in info['Classifier']:
+ if classifier in self.classifier_license_map:
+ license = self.classifier_license_map[classifier]
+ if license == 'Apache' and 'Apache-2.0' in existing_licenses:
+ license = 'Apache-2.0'
+ elif license == 'GPL':
+ if 'GPL-2.0' in existing_licenses or 'GPLv2' in existing_licenses:
+ license = 'GPL-2.0'
+ elif 'GPL-3.0' in existing_licenses or 'GPLv3' in existing_licenses:
+ license = 'GPL-3.0'
+ elif license == 'LGPL':
+ if 'LGPL-2.1' in existing_licenses or 'LGPLv2.1' in existing_licenses:
+ license = 'LGPL-2.1'
+ elif 'LGPL-2.0' in existing_licenses or 'LGPLv2' in existing_licenses:
+ license = 'LGPL-2.0'
+ elif 'LGPL-3.0' in existing_licenses or 'LGPLv3' in existing_licenses:
+ license = 'LGPL-3.0'
+ licenses.append(license)
+
+ if licenses:
+ info['License'] = ' & '.join(licenses)
+
+ # Map PKG-INFO & setup.py fields to bitbake variables
+ for field, values in info.items():
+ if field in self.excluded_fields:
+ continue
+
+ if field not in self.bbvar_map:
+ continue
+
+ if isinstance(values, str):
+ value = values
+ else:
+ value = ' '.join(str(v) for v in values if v)
+
+ bbvar = self.bbvar_map[field]
+ if bbvar not in extravalues and value:
+ extravalues[bbvar] = value
+
+ mapped_deps, unmapped_deps = self.scan_setup_python_deps(srctree, setup_info, setup_non_literals)
+
+ extras_req = set()
+ if 'Extras-require' in info:
+ extras_req = info['Extras-require']
+ if extras_req:
+ lines_after.append('# The following configs & dependencies are from setuptools extras_require.')
+ lines_after.append('# These dependencies are optional, hence can be controlled via PACKAGECONFIG.')
+ lines_after.append('# The upstream names may not correspond exactly to bitbake package names.')
+ lines_after.append('#')
+ lines_after.append('# Uncomment this line to enable all the optional features.')
+ lines_after.append('#PACKAGECONFIG ?= "{}"'.format(' '.join(k.lower() for k in extras_req)))
+ for feature, feature_reqs in extras_req.items():
+ unmapped_deps.difference_update(feature_reqs)
+
+ feature_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(feature_reqs))
+ lines_after.append('PACKAGECONFIG[{}] = ",,,{}"'.format(feature.lower(), ' '.join(feature_req_deps)))
+
+ inst_reqs = set()
+ if 'Install-requires' in info:
+ if extras_req:
+ lines_after.append('')
+ inst_reqs = info['Install-requires']
+ if inst_reqs:
+ unmapped_deps.difference_update(inst_reqs)
+
+ inst_req_deps = ('python-' + r.replace('.', '-').lower() for r in sorted(inst_reqs))
+ lines_after.append('# WARNING: the following rdepends are from setuptools install_requires. These')
+ lines_after.append('# upstream names may not correspond exactly to bitbake package names.')
+ lines_after.append('RDEPENDS_${{PN}} += "{}"'.format(' '.join(inst_req_deps)))
+
+ if mapped_deps:
+ name = info.get('Name')
+ if name and name[0] in mapped_deps:
+ # Attempt to avoid self-reference
+ mapped_deps.remove(name[0])
+ mapped_deps -= set(self.excluded_pkgdeps)
+ if inst_reqs or extras_req:
+ lines_after.append('')
+ lines_after.append('# WARNING: the following rdepends are determined through basic analysis of the')
+ lines_after.append('# python sources, and might not be 100% accurate.')
+ lines_after.append('RDEPENDS_${{PN}} += "{}"'.format(' '.join(sorted(mapped_deps))))
+
+ unmapped_deps -= set(extensions)
+ unmapped_deps -= set(self.assume_provided)
+ if unmapped_deps:
+ if mapped_deps:
+ lines_after.append('')
+ lines_after.append('# WARNING: We were unable to map the following python package/module')
+ lines_after.append('# dependencies to the bitbake packages which include them:')
+ lines_after.extend('# {}'.format(d) for d in sorted(unmapped_deps))
+
+ handled.append('buildsystem')
+
+ def get_pkginfo(self, pkginfo_fn):
+ msg = email.message_from_file(open(pkginfo_fn, 'r'))
+ msginfo = {}
+ for field in msg.keys():
+ values = msg.get_all(field)
+ if len(values) == 1:
+ msginfo[field] = values[0]
+ else:
+ msginfo[field] = values
+ return msginfo
+
+ def parse_setup_py(self, setupscript='./setup.py'):
+ with codecs.open(setupscript) as f:
+ info, imported_modules, non_literals, extensions = gather_setup_info(f)
+
+ def _map(key):
+ key = key.replace('_', '-')
+ key = key[0].upper() + key[1:]
+ if key in self.setup_parse_map:
+ key = self.setup_parse_map[key]
+ return key
+
+ # Naive mapping of setup() arguments to PKG-INFO field names
+ for d in [info, non_literals]:
+ for key, value in list(d.items()):
+ if key is None:
+ continue
+ new_key = _map(key)
+ if new_key != key:
+ del d[key]
+ d[new_key] = value
+
+ return info, 'setuptools' in imported_modules, non_literals, extensions
+
+ def get_setup_args_info(self, setupscript='./setup.py'):
+ cmd = ['python', setupscript]
+ info = {}
+ keys = set(self.bbvar_map.keys())
+ keys |= set(self.setuparg_list_fields)
+ keys |= set(self.setuparg_multi_line_values)
+ grouped_keys = itertools.groupby(keys, lambda k: (k in self.setuparg_list_fields, k in self.setuparg_multi_line_values))
+ for index, keys in grouped_keys:
+ if index == (True, False):
+ # Splitlines output for each arg as a list value
+ for key in keys:
+ arg = self.setuparg_map.get(key, key.lower())
+ try:
+ arg_info = self.run_command(cmd + ['--' + arg], cwd=os.path.dirname(setupscript))
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ info[key] = [l.rstrip() for l in arg_info.splitlines()]
+ elif index == (False, True):
+ # Entire output for each arg
+ for key in keys:
+ arg = self.setuparg_map.get(key, key.lower())
+ try:
+ arg_info = self.run_command(cmd + ['--' + arg], cwd=os.path.dirname(setupscript))
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ info[key] = arg_info
+ else:
+ info.update(self.get_setup_byline(list(keys), setupscript))
+ return info
+
+ def get_setup_byline(self, fields, setupscript='./setup.py'):
+ info = {}
+
+ cmd = ['python', setupscript]
+ cmd.extend('--' + self.setuparg_map.get(f, f.lower()) for f in fields)
+ try:
+ info_lines = self.run_command(cmd, cwd=os.path.dirname(setupscript)).splitlines()
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ if len(fields) != len(info_lines):
+ logger.error('Mismatch between setup.py output lines and number of fields')
+ sys.exit(1)
+
+ for lineno, line in enumerate(info_lines):
+ line = line.rstrip()
+ info[fields[lineno]] = line
+ return info
+
+ def apply_info_replacements(self, info):
+ for variable, search, replace in self.replacements:
+ if variable not in info:
+ continue
+
+ def replace_value(search, replace, value):
+ if replace is None:
+ if re.search(search, value):
+ return None
+ else:
+ new_value = re.sub(search, replace, value)
+ if value != new_value:
+ return new_value
+ return value
+
+ value = info[variable]
+ if isinstance(value, str):
+ new_value = replace_value(search, replace, value)
+ if new_value is None:
+ del info[variable]
+ elif new_value != value:
+ info[variable] = new_value
+ elif hasattr(value, 'items'):
+ for dkey, dvalue in list(value.items()):
+ new_list = []
+ for pos, a_value in enumerate(dvalue):
+ new_value = replace_value(search, replace, a_value)
+ if new_value is not None and new_value != value:
+ new_list.append(new_value)
+
+ if value != new_list:
+ value[dkey] = new_list
+ else:
+ new_list = []
+ for pos, a_value in enumerate(value):
+ new_value = replace_value(search, replace, a_value)
+ if new_value is not None and new_value != value:
+ new_list.append(new_value)
+
+ if value != new_list:
+ info[variable] = new_list
+
+ def scan_setup_python_deps(self, srctree, setup_info, setup_non_literals):
+ if 'Package-dir' in setup_info:
+ package_dir = setup_info['Package-dir']
+ else:
+ package_dir = {}
+
+ class PackageDir(distutils.command.build_py.build_py):
+ def __init__(self, package_dir):
+ self.package_dir = package_dir
+
+ pd = PackageDir(package_dir)
+ to_scan = []
+ if not any(v in setup_non_literals for v in ['Py-modules', 'Scripts', 'Packages']):
+ if 'Py-modules' in setup_info:
+ for module in setup_info['Py-modules']:
+ try:
+ package, module = module.rsplit('.', 1)
+ except ValueError:
+ package, module = '.', module
+ module_path = os.path.join(pd.get_package_dir(package), module + '.py')
+ to_scan.append(module_path)
+
+ if 'Packages' in setup_info:
+ for package in setup_info['Packages']:
+ to_scan.append(pd.get_package_dir(package))
+
+ if 'Scripts' in setup_info:
+ to_scan.extend(setup_info['Scripts'])
+ else:
+ logger.info("Scanning the entire source tree, as one or more of the following setup keywords are non-literal: py_modules, scripts, packages.")
+
+ if not to_scan:
+ to_scan = ['.']
+
+ logger.info("Scanning paths for packages & dependencies: %s", ', '.join(to_scan))
+
+ provided_packages = self.parse_pkgdata_for_python_packages()
+ scanned_deps = self.scan_python_dependencies([os.path.join(srctree, p) for p in to_scan])
+ mapped_deps, unmapped_deps = set(self.base_pkgdeps), set()
+ for dep in scanned_deps:
+ mapped = provided_packages.get(dep)
+ if mapped:
+ logger.debug('Mapped %s to %s' % (dep, mapped))
+ mapped_deps.add(mapped)
+ else:
+ logger.debug('Could not map %s' % dep)
+ unmapped_deps.add(dep)
+ return mapped_deps, unmapped_deps
+
+ def scan_python_dependencies(self, paths):
+ deps = set()
+ try:
+ dep_output = self.run_command(['pythondeps', '-d'] + paths)
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ for line in dep_output.splitlines():
+ line = line.rstrip()
+ dep, filename = line.split('\t', 1)
+ if filename.endswith('/setup.py'):
+ continue
+ deps.add(dep)
+
+ try:
+ provides_output = self.run_command(['pythondeps', '-p'] + paths)
+ except (OSError, subprocess.CalledProcessError):
+ pass
+ else:
+ provides_lines = (l.rstrip() for l in provides_output.splitlines())
+ provides = set(l for l in provides_lines if l and l != 'setup')
+ deps -= provides
+
+ return deps
+
+ def parse_pkgdata_for_python_packages(self):
+ suffixes = [t[0] for t in imp.get_suffixes()]
+ pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
+
+ ldata = tinfoil.config_data.createCopy()
+ bb.parse.handle('classes/python-dir.bbclass', ldata, True)
+ python_sitedir = ldata.getVar('PYTHON_SITEPACKAGES_DIR')
+
+ dynload_dir = os.path.join(os.path.dirname(python_sitedir), 'lib-dynload')
+ python_dirs = [python_sitedir + os.sep,
+ os.path.join(os.path.dirname(python_sitedir), 'dist-packages') + os.sep,
+ os.path.dirname(python_sitedir) + os.sep]
+ packages = {}
+ for pkgdatafile in glob.glob('{}/runtime/*'.format(pkgdata_dir)):
+ files_info = None
+ with open(pkgdatafile, 'r') as f:
+ for line in f.readlines():
+ field, value = line.split(': ', 1)
+ if field == 'FILES_INFO':
+ files_info = ast.literal_eval(value)
+ break
+ else:
+ continue
+
+ for fn in files_info:
+ for suffix in suffixes:
+ if fn.endswith(suffix):
+ break
+ else:
+ continue
+
+ if fn.startswith(dynload_dir + os.sep):
+ if '/.debug/' in fn:
+ continue
+ base = os.path.basename(fn)
+ provided = base.split('.', 1)[0]
+ packages[provided] = os.path.basename(pkgdatafile)
+ continue
+
+ for python_dir in python_dirs:
+ if fn.startswith(python_dir):
+ relpath = fn[len(python_dir):]
+ relstart, _, relremaining = relpath.partition(os.sep)
+ if relstart.endswith('.egg'):
+ relpath = relremaining
+ base, _ = os.path.splitext(relpath)
+
+ if '/.debug/' in base:
+ continue
+ if os.path.basename(base) == '__init__':
+ base = os.path.dirname(base)
+ base = base.replace(os.sep + os.sep, os.sep)
+ provided = base.replace(os.sep, '.')
+ packages[provided] = os.path.basename(pkgdatafile)
+ return packages
+
+ @classmethod
+ def run_command(cls, cmd, **popenargs):
+ if 'stderr' not in popenargs:
+ popenargs['stderr'] = subprocess.STDOUT
+ try:
+ return subprocess.check_output(cmd, **popenargs).decode('utf-8')
+ except OSError as exc:
+ logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc)
+ raise
+ except subprocess.CalledProcessError as exc:
+ logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc.output)
+ raise
+
+
+def gather_setup_info(fileobj):
+ parsed = ast.parse(fileobj.read(), fileobj.name)
+ visitor = SetupScriptVisitor()
+ visitor.visit(parsed)
+
+ non_literals, extensions = {}, []
+ for key, value in list(visitor.keywords.items()):
+ if key == 'ext_modules':
+ if isinstance(value, list):
+ for ext in value:
+ if (isinstance(ext, ast.Call) and
+ isinstance(ext.func, ast.Name) and
+ ext.func.id == 'Extension' and
+ not has_non_literals(ext.args)):
+ extensions.append(ext.args[0])
+ elif has_non_literals(value):
+ non_literals[key] = value
+ del visitor.keywords[key]
+
+ return visitor.keywords, visitor.imported_modules, non_literals, extensions
+
+
+class SetupScriptVisitor(ast.NodeVisitor):
+ def __init__(self):
+ ast.NodeVisitor.__init__(self)
+ self.keywords = {}
+ self.non_literals = []
+ self.imported_modules = set()
+
+ def visit_Expr(self, node):
+ if isinstance(node.value, ast.Call) and \
+ isinstance(node.value.func, ast.Name) and \
+ node.value.func.id == 'setup':
+ self.visit_setup(node.value)
+
+ def visit_setup(self, node):
+ call = LiteralAstTransform().visit(node)
+ self.keywords = call.keywords
+ for k, v in self.keywords.items():
+ if has_non_literals(v):
+ self.non_literals.append(k)
+
+ def visit_Import(self, node):
+ for alias in node.names:
+ self.imported_modules.add(alias.name)
+
+ def visit_ImportFrom(self, node):
+ self.imported_modules.add(node.module)
+
+
+class LiteralAstTransform(ast.NodeTransformer):
+ """Simplify the ast through evaluation of literals."""
+ excluded_fields = ['ctx']
+
+ def visit(self, node):
+ if not isinstance(node, ast.AST):
+ return node
+ else:
+ return ast.NodeTransformer.visit(self, node)
+
+ def generic_visit(self, node):
+ try:
+ return ast.literal_eval(node)
+ except ValueError:
+ for field, value in ast.iter_fields(node):
+ if field in self.excluded_fields:
+ delattr(node, field)
+ if value is None:
+ continue
+
+ if isinstance(value, list):
+ if field in ('keywords', 'kwargs'):
+ new_value = dict((kw.arg, self.visit(kw.value)) for kw in value)
+ else:
+ new_value = [self.visit(i) for i in value]
+ else:
+ new_value = self.visit(value)
+ setattr(node, field, new_value)
+ return node
+
+ def visit_Name(self, node):
+ if hasattr('__builtins__', node.id):
+ return getattr(__builtins__, node.id)
+ else:
+ return self.generic_visit(node)
+
+ def visit_Tuple(self, node):
+ return tuple(self.visit(v) for v in node.elts)
+
+ def visit_List(self, node):
+ return [self.visit(v) for v in node.elts]
+
+ def visit_Set(self, node):
+ return set(self.visit(v) for v in node.elts)
+
+ def visit_Dict(self, node):
+ keys = (self.visit(k) for k in node.keys)
+ values = (self.visit(v) for v in node.values)
+ return dict(zip(keys, values))
+
+
+def has_non_literals(value):
+ if isinstance(value, ast.AST):
+ return True
+ elif isinstance(value, str):
+ return False
+ elif hasattr(value, 'values'):
+ return any(has_non_literals(v) for v in value.values())
+ elif hasattr(value, '__iter__'):
+ return any(has_non_literals(v) for v in value)
+
+
+def register_recipe_handlers(handlers):
+ # We need to make sure this is ahead of the makefile fallback handler
+ handlers.append((PythonRecipeHandler(), 70))
diff --git a/poky/scripts/lib/recipetool/create_kernel.py b/poky/scripts/lib/recipetool/create_kernel.py
new file mode 100644
index 000000000..ca4996c7a
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create_kernel.py
@@ -0,0 +1,99 @@
+# Recipe creation tool - kernel support plugin
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+import logging
+from recipetool.create import RecipeHandler, read_pkgconfig_provides, validate_pv
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class KernelRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ import bb.process
+ if 'buildsystem' in handled:
+ return False
+
+ for tell in ['arch', 'firmware', 'Kbuild', 'Kconfig']:
+ if not os.path.exists(os.path.join(srctree, tell)):
+ return False
+
+ handled.append('buildsystem')
+ del lines_after[:]
+ del classes[:]
+ template = os.path.join(tinfoil.config_data.getVar('COREBASE'), 'meta-skeleton', 'recipes-kernel', 'linux', 'linux-yocto-custom.bb')
+ def handle_var(varname, origvalue, op, newlines):
+ if varname in ['SRCREV', 'SRCREV_machine']:
+ while newlines[-1].startswith('#'):
+ del newlines[-1]
+ try:
+ stdout, _ = bb.process.run('git rev-parse HEAD', cwd=srctree, shell=True)
+ except bb.process.ExecutionError as e:
+ stdout = None
+ if stdout:
+ return stdout.strip(), op, 0, True
+ elif varname == 'LINUX_VERSION':
+ makefile = os.path.join(srctree, 'Makefile')
+ if os.path.exists(makefile):
+ kversion = -1
+ kpatchlevel = -1
+ ksublevel = -1
+ kextraversion = ''
+ with open(makefile, 'r', errors='surrogateescape') as f:
+ for i, line in enumerate(f):
+ if i > 10:
+ break
+ if line.startswith('VERSION ='):
+ kversion = int(line.split('=')[1].strip())
+ elif line.startswith('PATCHLEVEL ='):
+ kpatchlevel = int(line.split('=')[1].strip())
+ elif line.startswith('SUBLEVEL ='):
+ ksublevel = int(line.split('=')[1].strip())
+ elif line.startswith('EXTRAVERSION ='):
+ kextraversion = line.split('=')[1].strip()
+ version = ''
+ if kversion > -1 and kpatchlevel > -1:
+ version = '%d.%d' % (kversion, kpatchlevel)
+ if ksublevel > -1:
+ version += '.%d' % ksublevel
+ version += kextraversion
+ if version:
+ return version, op, 0, True
+ elif varname == 'SRC_URI':
+ while newlines[-1].startswith('#'):
+ del newlines[-1]
+ elif varname == 'COMPATIBLE_MACHINE':
+ while newlines[-1].startswith('#'):
+ del newlines[-1]
+ machine = tinfoil.config_data.getVar('MACHINE')
+ return machine, op, 0, True
+ return origvalue, op, 0, True
+ with open(template, 'r') as f:
+ varlist = ['SRCREV', 'SRCREV_machine', 'SRC_URI', 'LINUX_VERSION', 'COMPATIBLE_MACHINE']
+ (_, newlines) = bb.utils.edit_metadata(f, varlist, handle_var)
+ lines_before[:] = [line.rstrip('\n') for line in newlines]
+
+ return True
+
+def register_recipe_handlers(handlers):
+ handlers.append((KernelRecipeHandler(), 100))
diff --git a/poky/scripts/lib/recipetool/create_kmod.py b/poky/scripts/lib/recipetool/create_kmod.py
new file mode 100644
index 000000000..4569b53c8
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create_kmod.py
@@ -0,0 +1,152 @@
+# Recipe creation tool - kernel module support plugin
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import re
+import logging
+from recipetool.create import RecipeHandler, read_pkgconfig_provides, validate_pv
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class KernelModuleRecipeHandler(RecipeHandler):
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ import bb.process
+ if 'buildsystem' in handled:
+ return False
+
+ module_inc_re = re.compile(r'^#include\s+<linux/module.h>$')
+ makefiles = []
+ is_module = False
+
+ makefiles = []
+
+ files = RecipeHandler.checkfiles(srctree, ['*.c', '*.h'], recursive=True, excludedirs=['contrib', 'test', 'examples'])
+ if files:
+ for cfile in files:
+ # Look in same dir or parent for Makefile
+ for makefile in [os.path.join(os.path.dirname(cfile), 'Makefile'), os.path.join(os.path.dirname(os.path.dirname(cfile)), 'Makefile')]:
+ if makefile in makefiles:
+ break
+ else:
+ if os.path.exists(makefile):
+ makefiles.append(makefile)
+ break
+ else:
+ continue
+ with open(cfile, 'r', errors='surrogateescape') as f:
+ for line in f:
+ if module_inc_re.match(line.strip()):
+ is_module = True
+ break
+ if is_module:
+ break
+
+ if is_module:
+ classes.append('module')
+ handled.append('buildsystem')
+ # module.bbclass and the classes it inherits do most of the hard
+ # work, but we need to tweak it slightly depending on what the
+ # Makefile does (and there is a range of those)
+ # Check the makefile for the appropriate install target
+ install_lines = []
+ compile_lines = []
+ in_install = False
+ in_compile = False
+ install_target = None
+ with open(makefile, 'r', errors='surrogateescape') as f:
+ for line in f:
+ if line.startswith('install:'):
+ if not install_lines:
+ in_install = True
+ install_target = 'install'
+ elif line.startswith('modules_install:'):
+ install_lines = []
+ in_install = True
+ install_target = 'modules_install'
+ elif line.startswith('modules:'):
+ compile_lines = []
+ in_compile = True
+ elif line.startswith(('all:', 'default:')):
+ if not compile_lines:
+ in_compile = True
+ elif line:
+ if line[0] == '\t':
+ if in_install:
+ install_lines.append(line)
+ elif in_compile:
+ compile_lines.append(line)
+ elif ':' in line:
+ in_install = False
+ in_compile = False
+
+ def check_target(lines, install):
+ kdirpath = ''
+ manual_install = False
+ for line in lines:
+ splitline = line.split()
+ if splitline[0] in ['make', 'gmake', '$(MAKE)']:
+ if '-C' in splitline:
+ idx = splitline.index('-C') + 1
+ if idx < len(splitline):
+ kdirpath = splitline[idx]
+ break
+ elif install and splitline[0] == 'install':
+ if '.ko' in line:
+ manual_install = True
+ return kdirpath, manual_install
+
+ kdirpath = None
+ manual_install = False
+ if install_lines:
+ kdirpath, manual_install = check_target(install_lines, install=True)
+ if compile_lines and not kdirpath:
+ kdirpath, _ = check_target(compile_lines, install=False)
+
+ if manual_install or not install_lines:
+ lines_after.append('EXTRA_OEMAKE_append_task-install = " -C ${STAGING_KERNEL_DIR} M=${S}"')
+ elif install_target and install_target != 'modules_install':
+ lines_after.append('MODULES_INSTALL_TARGET = "install"')
+
+ warnmsg = None
+ kdirvar = None
+ if kdirpath:
+ res = re.match(r'\$\(([^$)]+)\)', kdirpath)
+ if res:
+ kdirvar = res.group(1)
+ if kdirvar != 'KERNEL_SRC':
+ lines_after.append('EXTRA_OEMAKE += "%s=${STAGING_KERNEL_DIR}"' % kdirvar)
+ elif kdirpath.startswith('/lib/'):
+ warnmsg = 'Kernel path in install makefile is hardcoded - you will need to patch the makefile'
+ if not kdirvar and not warnmsg:
+ warnmsg = 'Unable to find means of passing kernel path into install makefile - if kernel path is hardcoded you will need to patch the makefile'
+ if warnmsg:
+ warnmsg += '. Note that the variable KERNEL_SRC will be passed in as the kernel source path.'
+ logger.warn(warnmsg)
+ lines_after.append('# %s' % warnmsg)
+
+ return True
+
+ return False
+
+def register_recipe_handlers(handlers):
+ handlers.append((KernelModuleRecipeHandler(), 15))
diff --git a/poky/scripts/lib/recipetool/create_npm.py b/poky/scripts/lib/recipetool/create_npm.py
new file mode 100644
index 000000000..bb42a5ca5
--- /dev/null
+++ b/poky/scripts/lib/recipetool/create_npm.py
@@ -0,0 +1,330 @@
+# Recipe creation tool - node.js NPM module support plugin
+#
+# Copyright (C) 2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import logging
+import subprocess
+import tempfile
+import shutil
+import json
+from recipetool.create import RecipeHandler, split_pkg_licenses, handle_license_vars
+
+logger = logging.getLogger('recipetool')
+
+
+tinfoil = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+class NpmRecipeHandler(RecipeHandler):
+ lockdownpath = None
+
+ def _ensure_npm(self, fixed_setup=False):
+ if not tinfoil.recipes_parsed:
+ tinfoil.parse_recipes()
+ try:
+ rd = tinfoil.parse_recipe('nodejs-native')
+ except bb.providers.NoProvider:
+ if fixed_setup:
+ msg = 'nodejs-native is required for npm but is not available within this SDK'
+ else:
+ msg = 'nodejs-native is required for npm but is not available - you will likely need to add a layer that provides nodejs'
+ logger.error(msg)
+ return None
+ bindir = rd.getVar('STAGING_BINDIR_NATIVE')
+ npmpath = os.path.join(bindir, 'npm')
+ if not os.path.exists(npmpath):
+ tinfoil.build_targets('nodejs-native', 'addto_recipe_sysroot')
+ if not os.path.exists(npmpath):
+ logger.error('npm required to process specified source, but nodejs-native did not seem to populate it')
+ return None
+ return bindir
+
+ def _handle_license(self, data):
+ '''
+ Handle the license value from an npm package.json file
+ '''
+ license = None
+ if 'license' in data:
+ license = data['license']
+ if isinstance(license, dict):
+ license = license.get('type', None)
+ if license:
+ if 'OR' in license:
+ license = license.replace('OR', '|')
+ license = license.replace('AND', '&')
+ license = license.replace(' ', '_')
+ if not license[0] == '(':
+ license = '(' + license + ')'
+ else:
+ license = license.replace('AND', '&')
+ if license[0] == '(':
+ license = license[1:]
+ if license[-1] == ')':
+ license = license[:-1]
+ license = license.replace('MIT/X11', 'MIT')
+ license = license.replace('Public Domain', 'PD')
+ license = license.replace('SEE LICENSE IN EULA',
+ 'SEE-LICENSE-IN-EULA')
+ return license
+
+ def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before, d):
+ try:
+ runenv = dict(os.environ, PATH=d.getVar('PATH'))
+ bb.process.run('npm shrinkwrap', cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
+ except bb.process.ExecutionError as e:
+ logger.warn('npm shrinkwrap failed:\n%s' % e.stdout)
+ return
+
+ tmpfile = os.path.join(localfilesdir, 'npm-shrinkwrap.json')
+ shutil.move(os.path.join(srctree, 'npm-shrinkwrap.json'), tmpfile)
+ extravalues.setdefault('extrafiles', {})
+ extravalues['extrafiles']['npm-shrinkwrap.json'] = tmpfile
+ lines_before.append('NPM_SHRINKWRAP := "${THISDIR}/${PN}/npm-shrinkwrap.json"')
+
+ def _lockdown(self, srctree, localfilesdir, extravalues, lines_before, d):
+ runenv = dict(os.environ, PATH=d.getVar('PATH'))
+ if not NpmRecipeHandler.lockdownpath:
+ NpmRecipeHandler.lockdownpath = tempfile.mkdtemp('recipetool-npm-lockdown')
+ bb.process.run('npm install lockdown --prefix %s' % NpmRecipeHandler.lockdownpath,
+ cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
+ relockbin = os.path.join(NpmRecipeHandler.lockdownpath, 'node_modules', 'lockdown', 'relock.js')
+ if not os.path.exists(relockbin):
+ logger.warn('Could not find relock.js within lockdown directory; skipping lockdown')
+ return
+ try:
+ bb.process.run('node %s' % relockbin, cwd=srctree, stderr=subprocess.STDOUT, env=runenv, shell=True)
+ except bb.process.ExecutionError as e:
+ logger.warn('lockdown-relock failed:\n%s' % e.stdout)
+ return
+
+ tmpfile = os.path.join(localfilesdir, 'lockdown.json')
+ shutil.move(os.path.join(srctree, 'lockdown.json'), tmpfile)
+ extravalues.setdefault('extrafiles', {})
+ extravalues['extrafiles']['lockdown.json'] = tmpfile
+ lines_before.append('NPM_LOCKDOWN := "${THISDIR}/${PN}/lockdown.json"')
+
+ def _handle_dependencies(self, d, deps, optdeps, devdeps, lines_before, srctree):
+ import scriptutils
+ # If this isn't a single module we need to get the dependencies
+ # and add them to SRC_URI
+ def varfunc(varname, origvalue, op, newlines):
+ if varname == 'SRC_URI':
+ if not origvalue.startswith('npm://'):
+ src_uri = origvalue.split()
+ deplist = {}
+ for dep, depver in optdeps.items():
+ depdata = self.get_npm_data(dep, depver, d)
+ if self.check_npm_optional_dependency(depdata):
+ deplist[dep] = depdata
+ for dep, depver in devdeps.items():
+ depdata = self.get_npm_data(dep, depver, d)
+ if self.check_npm_optional_dependency(depdata):
+ deplist[dep] = depdata
+ for dep, depver in deps.items():
+ depdata = self.get_npm_data(dep, depver, d)
+ deplist[dep] = depdata
+
+ extra_urls = []
+ for dep, depdata in deplist.items():
+ version = depdata.get('version', None)
+ if version:
+ url = 'npm://registry.npmjs.org;name=%s;version=%s;subdir=node_modules/%s' % (dep, version, dep)
+ extra_urls.append(url)
+ if extra_urls:
+ scriptutils.fetch_url(tinfoil, ' '.join(extra_urls), None, srctree, logger)
+ src_uri.extend(extra_urls)
+ return src_uri, None, -1, True
+ return origvalue, None, 0, True
+ updated, newlines = bb.utils.edit_metadata(lines_before, ['SRC_URI'], varfunc)
+ if updated:
+ del lines_before[:]
+ for line in newlines:
+ # Hack to avoid newlines that edit_metadata inserts
+ if line.endswith('\n'):
+ line = line[:-1]
+ lines_before.append(line)
+ return updated
+
+ def process(self, srctree, classes, lines_before, lines_after, handled, extravalues):
+ import bb.utils
+ import oe.package
+ from collections import OrderedDict
+
+ if 'buildsystem' in handled:
+ return False
+
+ def read_package_json(fn):
+ with open(fn, 'r', errors='surrogateescape') as f:
+ return json.loads(f.read())
+
+ files = RecipeHandler.checkfiles(srctree, ['package.json'])
+ if files:
+ d = bb.data.createCopy(tinfoil.config_data)
+ npm_bindir = self._ensure_npm()
+ if not npm_bindir:
+ sys.exit(14)
+ d.prependVar('PATH', '%s:' % npm_bindir)
+
+ data = read_package_json(files[0])
+ if 'name' in data and 'version' in data:
+ extravalues['PN'] = data['name']
+ extravalues['PV'] = data['version']
+ classes.append('npm')
+ handled.append('buildsystem')
+ if 'description' in data:
+ extravalues['SUMMARY'] = data['description']
+ if 'homepage' in data:
+ extravalues['HOMEPAGE'] = data['homepage']
+
+ fetchdev = extravalues['fetchdev'] or None
+ deps, optdeps, devdeps = self.get_npm_package_dependencies(data, fetchdev)
+ self._handle_dependencies(d, deps, optdeps, devdeps, lines_before, srctree)
+
+ # Shrinkwrap
+ localfilesdir = tempfile.mkdtemp(prefix='recipetool-npm')
+ self._shrinkwrap(srctree, localfilesdir, extravalues, lines_before, d)
+
+ # Lockdown
+ self._lockdown(srctree, localfilesdir, extravalues, lines_before, d)
+
+ # Split each npm module out to is own package
+ npmpackages = oe.package.npm_split_package_dirs(srctree)
+ licvalues = None
+ for item in handled:
+ if isinstance(item, tuple):
+ if item[0] == 'license':
+ licvalues = item[1]
+ break
+ if not licvalues:
+ licvalues = handle_license_vars(srctree, lines_before, handled, extravalues, d)
+ if licvalues:
+ # Augment the license list with information we have in the packages
+ licenses = {}
+ license = self._handle_license(data)
+ if license:
+ licenses['${PN}'] = license
+ for pkgname, pkgitem in npmpackages.items():
+ _, pdata = pkgitem
+ license = self._handle_license(pdata)
+ if license:
+ licenses[pkgname] = license
+ # Now write out the package-specific license values
+ # We need to strip out the json data dicts for this since split_pkg_licenses
+ # isn't expecting it
+ packages = OrderedDict((x,y[0]) for x,y in npmpackages.items())
+ packages['${PN}'] = ''
+ pkglicenses = split_pkg_licenses(licvalues, packages, lines_after, licenses)
+ all_licenses = list(set([item.replace('_', ' ') for pkglicense in pkglicenses.values() for item in pkglicense]))
+ if '&' in all_licenses:
+ all_licenses.remove('&')
+ extravalues['LICENSE'] = ' & '.join(all_licenses)
+
+ # Need to move S setting after inherit npm
+ for i, line in enumerate(lines_before):
+ if line.startswith('S ='):
+ lines_before.pop(i)
+ lines_after.insert(0, '# Must be set after inherit npm since that itself sets S')
+ lines_after.insert(1, line)
+ break
+
+ return True
+
+ return False
+
+ # FIXME this is duplicated from lib/bb/fetch2/npm.py
+ def _parse_view(self, output):
+ '''
+ Parse the output of npm view --json; the last JSON result
+ is assumed to be the one that we're interested in.
+ '''
+ pdata = None
+ outdeps = {}
+ datalines = []
+ bracelevel = 0
+ for line in output.splitlines():
+ if bracelevel:
+ datalines.append(line)
+ elif '{' in line:
+ datalines = []
+ datalines.append(line)
+ bracelevel = bracelevel + line.count('{') - line.count('}')
+ if datalines:
+ pdata = json.loads('\n'.join(datalines))
+ return pdata
+
+ # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
+ # (split out from _getdependencies())
+ def get_npm_data(self, pkg, version, d):
+ import bb.fetch2
+ pkgfullname = pkg
+ if version != '*' and not '/' in version:
+ pkgfullname += "@'%s'" % version
+ logger.debug(2, "Calling getdeps on %s" % pkg)
+ runenv = dict(os.environ, PATH=d.getVar('PATH'))
+ fetchcmd = "npm view %s --json" % pkgfullname
+ output, _ = bb.process.run(fetchcmd, stderr=subprocess.STDOUT, env=runenv, shell=True)
+ data = self._parse_view(output)
+ return data
+
+ # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
+ # (split out from _getdependencies())
+ def get_npm_package_dependencies(self, pdata, fetchdev):
+ dependencies = pdata.get('dependencies', {})
+ optionalDependencies = pdata.get('optionalDependencies', {})
+ dependencies.update(optionalDependencies)
+ if fetchdev:
+ devDependencies = pdata.get('devDependencies', {})
+ dependencies.update(devDependencies)
+ else:
+ devDependencies = {}
+ depsfound = {}
+ optdepsfound = {}
+ devdepsfound = {}
+ for dep in dependencies:
+ if dep in optionalDependencies:
+ optdepsfound[dep] = dependencies[dep]
+ elif dep in devDependencies:
+ devdepsfound[dep] = dependencies[dep]
+ else:
+ depsfound[dep] = dependencies[dep]
+ return depsfound, optdepsfound, devdepsfound
+
+ # FIXME this is effectively duplicated from lib/bb/fetch2/npm.py
+ # (split out from _getdependencies())
+ def check_npm_optional_dependency(self, pdata):
+ pkg_os = pdata.get('os', None)
+ if pkg_os:
+ if not isinstance(pkg_os, list):
+ pkg_os = [pkg_os]
+ blacklist = False
+ for item in pkg_os:
+ if item.startswith('!'):
+ blacklist = True
+ break
+ if (not blacklist and 'linux' not in pkg_os) or '!linux' in pkg_os:
+ pkg = pdata.get('name', 'Unnamed package')
+ logger.debug(2, "Skipping %s since it's incompatible with Linux" % pkg)
+ return False
+ return True
+
+
+def register_recipe_handlers(handlers):
+ handlers.append((NpmRecipeHandler(), 60))
diff --git a/poky/scripts/lib/recipetool/newappend.py b/poky/scripts/lib/recipetool/newappend.py
new file mode 100644
index 000000000..decce83fa
--- /dev/null
+++ b/poky/scripts/lib/recipetool/newappend.py
@@ -0,0 +1,89 @@
+# Recipe creation tool - newappend plugin
+#
+# This sub-command creates a bbappend for the specified target and prints the
+# path to the bbappend.
+#
+# Example: recipetool newappend meta-mylayer busybox
+#
+# Copyright (C) 2015 Christopher Larson <kergoth@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import argparse
+import errno
+import logging
+import os
+import re
+import subprocess
+import sys
+import scriptutils
+
+
+logger = logging.getLogger('recipetool')
+tinfoil = None
+
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+
+def layer(layerpath):
+ if not os.path.exists(os.path.join(layerpath, 'conf', 'layer.conf')):
+ raise argparse.ArgumentTypeError('{0!r} must be a path to a valid layer'.format(layerpath))
+ return layerpath
+
+
+def newappend(args):
+ import oe.recipeutils
+
+ recipe_path = tinfoil.get_recipe_file(args.target)
+
+ rd = tinfoil.config_data.createCopy()
+ rd.setVar('FILE', recipe_path)
+ append_path, path_ok = oe.recipeutils.get_bbappend_path(rd, args.destlayer, args.wildcard_version)
+ if not append_path:
+ logger.error('Unable to determine layer directory containing %s', recipe_path)
+ return 1
+
+ if not path_ok:
+ logger.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path))
+
+ layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()]
+ if not os.path.abspath(args.destlayer) in layerdirs:
+ logger.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
+
+ if not os.path.exists(append_path):
+ bb.utils.mkdirhier(os.path.dirname(append_path))
+
+ try:
+ open(append_path, 'a').close()
+ except (OSError, IOError) as exc:
+ logger.critical(str(exc))
+ return 1
+
+ if args.edit:
+ return scriptutils.run_editor([append_path, recipe_path], logger)
+ else:
+ print(append_path)
+
+
+def register_commands(subparsers):
+ parser = subparsers.add_parser('newappend',
+ help='Create a bbappend for the specified target in the specified layer')
+ parser.add_argument('-e', '--edit', help='Edit the new append. This obeys $VISUAL if set, otherwise $EDITOR, otherwise vi.', action='store_true')
+ parser.add_argument('-w', '--wildcard-version', help='Use wildcard to make the bbappend apply to any recipe version', action='store_true')
+ parser.add_argument('destlayer', help='Base directory of the destination layer to write the bbappend to', type=layer)
+ parser.add_argument('target', help='Target recipe/provide to append')
+ parser.set_defaults(func=newappend, parserecipes=True)
diff --git a/poky/scripts/lib/recipetool/setvar.py b/poky/scripts/lib/recipetool/setvar.py
new file mode 100644
index 000000000..9de315a0e
--- /dev/null
+++ b/poky/scripts/lib/recipetool/setvar.py
@@ -0,0 +1,75 @@
+# Recipe creation tool - set variable plugin
+#
+# Copyright (C) 2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import fnmatch
+import re
+import logging
+import scriptutils
+
+logger = logging.getLogger('recipetool')
+
+tinfoil = None
+plugins = None
+
+def tinfoil_init(instance):
+ global tinfoil
+ tinfoil = instance
+
+def setvar(args):
+ import oe.recipeutils
+
+ if args.delete:
+ if args.value:
+ logger.error('-D/--delete and specifying a value are mutually exclusive')
+ return 1
+ value = None
+ else:
+ if args.value is None:
+ logger.error('You must specify a value if not using -D/--delete')
+ return 1
+ value = args.value
+ varvalues = {args.varname: value}
+
+ if args.recipe_only:
+ patches = [oe.recipeutils.patch_recipe_file(args.recipefile, varvalues, patch=args.patch)]
+ else:
+ rd = tinfoil.parse_recipe_file(args.recipefile, False)
+ if not rd:
+ return 1
+ patches = oe.recipeutils.patch_recipe(rd, args.recipefile, varvalues, patch=args.patch)
+ if args.patch:
+ for patch in patches:
+ for line in patch:
+ sys.stdout.write(line)
+ return 0
+
+
+def register_commands(subparsers):
+ parser_setvar = subparsers.add_parser('setvar',
+ help='Set a variable within a recipe',
+ description='Adds/updates the value a variable is set to in a recipe')
+ parser_setvar.add_argument('recipefile', help='Recipe file to update')
+ parser_setvar.add_argument('varname', help='Variable name to set')
+ parser_setvar.add_argument('value', nargs='?', help='New value to set the variable to')
+ parser_setvar.add_argument('--recipe-only', '-r', help='Do not set variable in any include file if present', action='store_true')
+ parser_setvar.add_argument('--patch', '-p', help='Create a patch to make the change instead of modifying the recipe', action='store_true')
+ parser_setvar.add_argument('--delete', '-D', help='Delete the specified value instead of setting it', action='store_true')
+ parser_setvar.set_defaults(func=setvar)
diff --git a/poky/scripts/lib/scriptpath.py b/poky/scripts/lib/scriptpath.py
new file mode 100644
index 000000000..d00317e18
--- /dev/null
+++ b/poky/scripts/lib/scriptpath.py
@@ -0,0 +1,42 @@
+# Path utility functions for OE python scripts
+#
+# Copyright (C) 2012-2014 Intel Corporation
+# Copyright (C) 2011 Mentor Graphics Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import os.path
+
+def add_oe_lib_path():
+ basepath = os.path.abspath(os.path.dirname(__file__) + '/../..')
+ newpath = basepath + '/meta/lib'
+ sys.path.insert(0, newpath)
+
+def add_bitbake_lib_path():
+ basepath = os.path.abspath(os.path.dirname(__file__) + '/../..')
+ bitbakepath = None
+ if os.path.exists(basepath + '/bitbake/lib/bb'):
+ bitbakepath = basepath + '/bitbake'
+ else:
+ # look for bitbake/bin dir in PATH
+ for pth in os.environ['PATH'].split(':'):
+ if os.path.exists(os.path.join(pth, '../lib/bb')):
+ bitbakepath = os.path.abspath(os.path.join(pth, '..'))
+ break
+
+ if bitbakepath:
+ sys.path.insert(0, bitbakepath + '/lib')
+ return bitbakepath
diff --git a/poky/scripts/lib/scriptutils.py b/poky/scripts/lib/scriptutils.py
new file mode 100644
index 000000000..85b1c949b
--- /dev/null
+++ b/poky/scripts/lib/scriptutils.py
@@ -0,0 +1,241 @@
+# Script utility functions
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import logging
+import glob
+import argparse
+import subprocess
+import tempfile
+import shutil
+import random
+import string
+
+def logger_create(name, stream=None):
+ logger = logging.getLogger(name)
+ loggerhandler = logging.StreamHandler(stream=stream)
+ loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(loggerhandler)
+ logger.setLevel(logging.INFO)
+ return logger
+
+def logger_setup_color(logger, color='auto'):
+ from bb.msg import BBLogFormatter
+ console = logging.StreamHandler(sys.stdout)
+ formatter = BBLogFormatter("%(levelname)s: %(message)s")
+ console.setFormatter(formatter)
+ logger.handlers = [console]
+ if color == 'always' or (color=='auto' and console.stream.isatty()):
+ formatter.enable_color()
+
+
+def load_plugins(logger, plugins, pluginpath):
+ import imp
+
+ def load_plugin(name):
+ logger.debug('Loading plugin %s' % name)
+ fp, pathname, description = imp.find_module(name, [pluginpath])
+ try:
+ return imp.load_module(name, fp, pathname, description)
+ finally:
+ if fp:
+ fp.close()
+
+ def plugin_name(filename):
+ return os.path.splitext(os.path.basename(filename))[0]
+
+ known_plugins = [plugin_name(p.__name__) for p in plugins]
+ logger.debug('Loading plugins from %s...' % pluginpath)
+ for fn in glob.glob(os.path.join(pluginpath, '*.py')):
+ name = plugin_name(fn)
+ if name != '__init__' and name not in known_plugins:
+ plugin = load_plugin(name)
+ if hasattr(plugin, 'plugin_init'):
+ plugin.plugin_init(plugins)
+ plugins.append(plugin)
+
+def git_convert_standalone_clone(repodir):
+ """If specified directory is a git repository, ensure it's a standalone clone"""
+ import bb.process
+ if os.path.exists(os.path.join(repodir, '.git')):
+ alternatesfile = os.path.join(repodir, '.git', 'objects', 'info', 'alternates')
+ if os.path.exists(alternatesfile):
+ # This will have been cloned with -s, so we need to convert it so none
+ # of the contents is shared
+ bb.process.run('git repack -a', cwd=repodir)
+ os.remove(alternatesfile)
+
+def _get_temp_recipe_dir(d):
+ # This is a little bit hacky but we need to find a place where we can put
+ # the recipe so that bitbake can find it. We're going to delete it at the
+ # end so it doesn't really matter where we put it.
+ bbfiles = d.getVar('BBFILES').split()
+ fetchrecipedir = None
+ for pth in bbfiles:
+ if pth.endswith('.bb'):
+ pthdir = os.path.dirname(pth)
+ if os.access(os.path.dirname(os.path.dirname(pthdir)), os.W_OK):
+ fetchrecipedir = pthdir.replace('*', 'recipetool')
+ if pthdir.endswith('workspace/recipes/*'):
+ # Prefer the workspace
+ break
+ return fetchrecipedir
+
+class FetchUrlFailure(Exception):
+ def __init__(self, url):
+ self.url = url
+ def __str__(self):
+ return "Failed to fetch URL %s" % self.url
+
+def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirrors=False):
+ """
+ Fetch the specified URL using normal do_fetch and do_unpack tasks, i.e.
+ any dependencies that need to be satisfied in order to support the fetch
+ operation will be taken care of
+ """
+
+ import bb
+
+ checksums = {}
+ fetchrecipepn = None
+
+ # We need to put our temp directory under ${BASE_WORKDIR} otherwise
+ # we may have problems with the recipe-specific sysroot population
+ tmpparent = tinfoil.config_data.getVar('BASE_WORKDIR')
+ bb.utils.mkdirhier(tmpparent)
+ tmpdir = tempfile.mkdtemp(prefix='recipetool-', dir=tmpparent)
+ try:
+ tmpworkdir = os.path.join(tmpdir, 'work')
+ logger.debug('fetch_url: temp dir is %s' % tmpdir)
+
+ fetchrecipedir = _get_temp_recipe_dir(tinfoil.config_data)
+ if not fetchrecipedir:
+ logger.error('Searched BBFILES but unable to find a writeable place to put temporary recipe')
+ sys.exit(1)
+ fetchrecipe = None
+ bb.utils.mkdirhier(fetchrecipedir)
+ try:
+ # Generate a dummy recipe so we can follow more or less normal paths
+ # for do_fetch and do_unpack
+ # I'd use tempfile functions here but underscores can be produced by that and those
+ # aren't allowed in recipe file names except to separate the version
+ rndstring = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8))
+ fetchrecipe = os.path.join(fetchrecipedir, 'tmp-recipetool-%s.bb' % rndstring)
+ fetchrecipepn = os.path.splitext(os.path.basename(fetchrecipe))[0]
+ logger.debug('Generating initial recipe %s for fetching' % fetchrecipe)
+ with open(fetchrecipe, 'w') as f:
+ # We don't want to have to specify LIC_FILES_CHKSUM
+ f.write('LICENSE = "CLOSED"\n')
+ # We don't need the cross-compiler
+ f.write('INHIBIT_DEFAULT_DEPS = "1"\n')
+ # We don't have the checksums yet so we can't require them
+ f.write('BB_STRICT_CHECKSUM = "ignore"\n')
+ f.write('SRC_URI = "%s"\n' % srcuri)
+ f.write('SRCREV = "%s"\n' % srcrev)
+ f.write('WORKDIR = "%s"\n' % tmpworkdir)
+ # Set S out of the way so it doesn't get created under the workdir
+ f.write('S = "%s"\n' % os.path.join(tmpdir, 'emptysrc'))
+ if not mirrors:
+ # We do not need PREMIRRORS since we are almost certainly
+ # fetching new source rather than something that has already
+ # been fetched. Hence, we disable them by default.
+ # However, we provide an option for users to enable it.
+ f.write('PREMIRRORS = ""\n')
+ f.write('MIRRORS = ""\n')
+
+ logger.info('Fetching %s...' % srcuri)
+
+ # FIXME this is too noisy at the moment
+
+ # Parse recipes so our new recipe gets picked up
+ tinfoil.parse_recipes()
+
+ def eventhandler(event):
+ if isinstance(event, bb.fetch2.MissingChecksumEvent):
+ checksums.update(event.checksums)
+ return True
+ return False
+
+ # Run the fetch + unpack tasks
+ res = tinfoil.build_targets(fetchrecipepn,
+ 'do_unpack',
+ handle_events=True,
+ extra_events=['bb.fetch2.MissingChecksumEvent'],
+ event_callback=eventhandler)
+ if not res:
+ raise FetchUrlFailure(srcuri)
+
+ # Remove unneeded directories
+ rd = tinfoil.parse_recipe(fetchrecipepn)
+ if rd:
+ pathvars = ['T', 'RECIPE_SYSROOT', 'RECIPE_SYSROOT_NATIVE']
+ for pathvar in pathvars:
+ path = rd.getVar(pathvar)
+ shutil.rmtree(path)
+ finally:
+ if fetchrecipe:
+ try:
+ os.remove(fetchrecipe)
+ except FileNotFoundError:
+ pass
+ try:
+ os.rmdir(fetchrecipedir)
+ except OSError as e:
+ import errno
+ if e.errno != errno.ENOTEMPTY:
+ raise
+
+ bb.utils.mkdirhier(destdir)
+ for fn in os.listdir(tmpworkdir):
+ shutil.move(os.path.join(tmpworkdir, fn), destdir)
+
+ finally:
+ if not preserve_tmp:
+ shutil.rmtree(tmpdir)
+ tmpdir = None
+
+ return checksums, tmpdir
+
+
+def run_editor(fn, logger=None):
+ if isinstance(fn, str):
+ params = '"%s"' % fn
+ else:
+ params = ''
+ for fnitem in fn:
+ params += ' "%s"' % fnitem
+
+ editor = os.getenv('VISUAL', os.getenv('EDITOR', 'vi'))
+ try:
+ return subprocess.check_call('%s %s' % (editor, params), shell=True)
+ except subprocess.CalledProcessError as exc:
+ logger.error("Execution of '%s' failed: %s" % (editor, exc))
+ return 1
+
+def is_src_url(param):
+ """
+ Check if a parameter is a URL and return True if so
+ NOTE: be careful about changing this as it will influence how devtool/recipetool command line handling works
+ """
+ if not param:
+ return False
+ elif '://' in param:
+ return True
+ elif param.startswith('git@') or ('@' in param and param.endswith('.git')):
+ return True
+ return False
diff --git a/poky/scripts/lib/wic/__init__.py b/poky/scripts/lib/wic/__init__.py
new file mode 100644
index 000000000..85876b138
--- /dev/null
+++ b/poky/scripts/lib/wic/__init__.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2007 Red Hat, Inc.
+# Copyright (c) 2011 Intel, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; version 2 of the License
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+class WicError(Exception):
+ pass
diff --git a/poky/scripts/lib/wic/canned-wks/common.wks.inc b/poky/scripts/lib/wic/canned-wks/common.wks.inc
new file mode 100644
index 000000000..89880b417
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/common.wks.inc
@@ -0,0 +1,3 @@
+# This file is included into 3 canned wks files from this directory
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
diff --git a/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg b/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
new file mode 100644
index 000000000..c58e74a85
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
@@ -0,0 +1,27 @@
+# This is an example configuration file for syslinux.
+TIMEOUT 50
+ALLOWOPTIONS 1
+SERIAL 0 115200
+PROMPT 0
+
+UI vesamenu.c32
+menu title Select boot options
+menu tabmsg Press [Tab] to edit, [Return] to select
+
+DEFAULT Graphics console boot
+
+LABEL Graphics console boot
+KERNEL /vmlinuz
+APPEND label=boot rootwait
+
+LABEL Serial console boot
+KERNEL /vmlinuz
+APPEND label=boot rootwait console=ttyS0,115200
+
+LABEL Graphics console install
+KERNEL /vmlinuz
+APPEND label=install rootwait
+
+LABEL Serial console install
+KERNEL /vmlinuz
+APPEND label=install rootwait console=ttyS0,115200
diff --git a/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks b/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks
new file mode 100644
index 000000000..3529e05c8
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks
@@ -0,0 +1,8 @@
+# short-description: Create a 'pcbios' direct disk image with custom bootloader config
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media. The bootloader configuration source is a user file.
+
+include common.wks.inc
+
+bootloader --configfile="directdisk-bootloader-config.cfg"
+
diff --git a/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks b/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks
new file mode 100644
index 000000000..8d7d8de6e
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/directdisk-gpt.wks
@@ -0,0 +1,10 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+bootloader --ptable gpt --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
diff --git a/poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks b/poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks
new file mode 100644
index 000000000..f61d941d6
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks
@@ -0,0 +1,23 @@
+# short-description: Create multi rootfs image using rootfs plugin
+# long-description: Creates a partitioned disk image with two rootfs partitions
+# using rootfs plugin.
+#
+# Partitions can use either
+# - indirect rootfs references to image recipe(s):
+# wic create directdisk-multi-indirect-recipes -e core-image-minimal \
+# --rootfs-dir rootfs1=core-image-minimal
+# --rootfs-dir rootfs2=core-image-minimal-dev
+#
+# - or paths to rootfs directories:
+# wic create directdisk-multi-rootfs \
+# --rootfs-dir rootfs1=tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/
+# --rootfs-dir rootfs2=tmp/work/qemux86_64-poky-linux/core-image-minimal-dev/1.0-r0/rootfs/
+#
+# - or any combinations of -r and --rootfs command line options
+
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --rootfs-dir=rootfs1 --ondisk sda --fstype=ext4 --label platform --align 1024
+part /rescue --source rootfs --rootfs-dir=rootfs2 --ondisk sda --fstype=ext4 --label secondary --align 1024
+
+bootloader --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
diff --git a/poky/scripts/lib/wic/canned-wks/directdisk.wks b/poky/scripts/lib/wic/canned-wks/directdisk.wks
new file mode 100644
index 000000000..8c8e06b02
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/directdisk.wks
@@ -0,0 +1,8 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+include common.wks.inc
+
+bootloader --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
diff --git a/poky/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in b/poky/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in
new file mode 100644
index 000000000..7300e65e3
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/efi-bootdisk.wks.in
@@ -0,0 +1,3 @@
+bootloader --ptable gpt
+part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.0
+part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
diff --git a/poky/scripts/lib/wic/canned-wks/mkefidisk.wks b/poky/scripts/lib/wic/canned-wks/mkefidisk.wks
new file mode 100644
index 000000000..9f534fe18
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/mkefidisk.wks
@@ -0,0 +1,11 @@
+# short-description: Create an EFI disk image
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media.
+
+part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=ttyS0,115200 console=tty0"
diff --git a/poky/scripts/lib/wic/canned-wks/mkhybridiso.wks b/poky/scripts/lib/wic/canned-wks/mkhybridiso.wks
new file mode 100644
index 000000000..9d34e9b47
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/mkhybridiso.wks
@@ -0,0 +1,7 @@
+# short-description: Create a hybrid ISO image
+# long-description: Creates an EFI and legacy bootable hybrid ISO image
+# which can be used on optical media as well as USB media.
+
+part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi,image_name=HYBRID_ISO_IMG" --ondisk cd --label HYBRIDISO --fstype=ext4
+
+bootloader --timeout=15 --append=""
diff --git a/poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks b/poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
new file mode 100644
index 000000000..1f8466af2
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/qemux86-directdisk.wks
@@ -0,0 +1,8 @@
+# short-description: Create a qemu machine 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly use to boot a qemu machine.
+
+include common.wks.inc
+
+bootloader --timeout=0 --append="vga=0 uvesafb.mode_option=640x480-32 rw mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 oprofile.timer=1 rootfstype=ext4 "
+
diff --git a/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks b/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
new file mode 100644
index 000000000..7ffd632f4
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
@@ -0,0 +1,6 @@
+# short-description: Create SD card image with a boot partition
+# long-description: Creates a partitioned SD card image. Boot files
+# are located in the first vfat partition.
+
+part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
diff --git a/poky/scripts/lib/wic/canned-wks/systemd-bootdisk.wks b/poky/scripts/lib/wic/canned-wks/systemd-bootdisk.wks
new file mode 100644
index 000000000..95d7b97a6
--- /dev/null
+++ b/poky/scripts/lib/wic/canned-wks/systemd-bootdisk.wks
@@ -0,0 +1,11 @@
+# short-description: Create an EFI disk image with systemd-boot
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. The selected bootloader is systemd-boot.
+
+part /boot --source bootimg-efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024 --use-uuid
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap --use-uuid
+
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0"
diff --git a/poky/scripts/lib/wic/engine.py b/poky/scripts/lib/wic/engine.py
new file mode 100644
index 000000000..edcfab39e
--- /dev/null
+++ b/poky/scripts/lib/wic/engine.py
@@ -0,0 +1,565 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+
+# This module implements the image creation engine used by 'wic' to
+# create images. The engine parses through the OpenEmbedded kickstart
+# (wks) file specified and generates images that can then be directly
+# written onto media.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import logging
+import os
+import tempfile
+import json
+import subprocess
+
+from collections import namedtuple, OrderedDict
+from distutils.spawn import find_executable
+
+from wic import WicError
+from wic.filemap import sparse_copy
+from wic.pluginbase import PluginMgr
+from wic.misc import get_bitbake_var, exec_cmd
+
+logger = logging.getLogger('wic')
+
+def verify_build_env():
+ """
+ Verify that the build environment is sane.
+
+ Returns True if it is, false otherwise
+ """
+ if not os.environ.get("BUILDDIR"):
+ raise WicError("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
+
+ return True
+
+
+CANNED_IMAGE_DIR = "lib/wic/canned-wks" # relative to scripts
+SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR
+WIC_DIR = "wic"
+
+def build_canned_image_list(path):
+ layers_path = get_bitbake_var("BBLAYERS")
+ canned_wks_layer_dirs = []
+
+ if layers_path is not None:
+ for layer_path in layers_path.split():
+ for wks_path in (WIC_DIR, SCRIPTS_CANNED_IMAGE_DIR):
+ cpath = os.path.join(layer_path, wks_path)
+ if os.path.isdir(cpath):
+ canned_wks_layer_dirs.append(cpath)
+
+ cpath = os.path.join(path, CANNED_IMAGE_DIR)
+ canned_wks_layer_dirs.append(cpath)
+
+ return canned_wks_layer_dirs
+
+def find_canned_image(scripts_path, wks_file):
+ """
+ Find a .wks file with the given name in the canned files dir.
+
+ Return False if not found
+ """
+ layers_canned_wks_dir = build_canned_image_list(scripts_path)
+
+ for canned_wks_dir in layers_canned_wks_dir:
+ for root, dirs, files in os.walk(canned_wks_dir):
+ for fname in files:
+ if fname.endswith("~") or fname.endswith("#"):
+ continue
+ if fname.endswith(".wks") and wks_file + ".wks" == fname:
+ fullpath = os.path.join(canned_wks_dir, fname)
+ return fullpath
+ return None
+
+
+def list_canned_images(scripts_path):
+ """
+ List the .wks files in the canned image dir, minus the extension.
+ """
+ layers_canned_wks_dir = build_canned_image_list(scripts_path)
+
+ for canned_wks_dir in layers_canned_wks_dir:
+ for root, dirs, files in os.walk(canned_wks_dir):
+ for fname in files:
+ if fname.endswith("~") or fname.endswith("#"):
+ continue
+ if fname.endswith(".wks"):
+ fullpath = os.path.join(canned_wks_dir, fname)
+ with open(fullpath) as wks:
+ for line in wks:
+ desc = ""
+ idx = line.find("short-description:")
+ if idx != -1:
+ desc = line[idx + len("short-description:"):].strip()
+ break
+ basename = os.path.splitext(fname)[0]
+ print(" %s\t\t%s" % (basename.ljust(30), desc))
+
+
+def list_canned_image_help(scripts_path, fullpath):
+ """
+ List the help and params in the specified canned image.
+ """
+ found = False
+ with open(fullpath) as wks:
+ for line in wks:
+ if not found:
+ idx = line.find("long-description:")
+ if idx != -1:
+ print()
+ print(line[idx + len("long-description:"):].strip())
+ found = True
+ continue
+ if not line.strip():
+ break
+ idx = line.find("#")
+ if idx != -1:
+ print(line[idx + len("#:"):].rstrip())
+ else:
+ break
+
+
+def list_source_plugins():
+ """
+ List the available source plugins i.e. plugins available for --source.
+ """
+ plugins = PluginMgr.get_plugins('source')
+
+ for plugin in plugins:
+ print(" %s" % plugin)
+
+
+def wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, options):
+ """
+ Create image
+
+ wks_file - user-defined OE kickstart file
+ rootfs_dir - absolute path to the build's /rootfs dir
+ bootimg_dir - absolute path to the build's boot artifacts directory
+ kernel_dir - absolute path to the build's kernel directory
+ native_sysroot - absolute path to the build's native sysroots dir
+ image_output_dir - dirname to create for image
+ options - wic command line options (debug, bmap, etc)
+
+ Normally, the values for the build artifacts values are determined
+ by 'wic -e' from the output of the 'bitbake -e' command given an
+ image name e.g. 'core-image-minimal' and a given machine set in
+ local.conf. If that's the case, the variables get the following
+ values from the output of 'bitbake -e':
+
+ rootfs_dir: IMAGE_ROOTFS
+ kernel_dir: DEPLOY_DIR_IMAGE
+ native_sysroot: STAGING_DIR_NATIVE
+
+ In the above case, bootimg_dir remains unset and the
+ plugin-specific image creation code is responsible for finding the
+ bootimg artifacts.
+
+ In the case where the values are passed in explicitly i.e 'wic -e'
+ is not used but rather the individual 'wic' options are used to
+ explicitly specify these values.
+ """
+ try:
+ oe_builddir = os.environ["BUILDDIR"]
+ except KeyError:
+ raise WicError("BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)")
+
+ if not os.path.exists(options.outdir):
+ os.makedirs(options.outdir)
+
+ pname = 'direct'
+ plugin_class = PluginMgr.get_plugins('imager').get(pname)
+ if not plugin_class:
+ raise WicError('Unknown plugin: %s' % pname)
+
+ plugin = plugin_class(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, oe_builddir, options)
+
+ plugin.do_create()
+
+ logger.info("The image(s) were created using OE kickstart file:\n %s", wks_file)
+
+
+def wic_list(args, scripts_path):
+ """
+ Print the list of images or source plugins.
+ """
+ if args.list_type is None:
+ return False
+
+ if args.list_type == "images":
+
+ list_canned_images(scripts_path)
+ return True
+ elif args.list_type == "source-plugins":
+ list_source_plugins()
+ return True
+ elif len(args.help_for) == 1 and args.help_for[0] == 'help':
+ wks_file = args.list_type
+ fullpath = find_canned_image(scripts_path, wks_file)
+ if not fullpath:
+ raise WicError("No image named %s found, exiting. "
+ "(Use 'wic list images' to list available images, "
+ "or specify a fully-qualified OE kickstart (.wks) "
+ "filename)" % wks_file)
+
+ list_canned_image_help(scripts_path, fullpath)
+ return True
+
+ return False
+
+
+class Disk:
+ def __init__(self, imagepath, native_sysroot, fstypes=('fat', 'ext')):
+ self.imagepath = imagepath
+ self.native_sysroot = native_sysroot
+ self.fstypes = fstypes
+ self._partitions = None
+ self._partimages = {}
+ self._lsector_size = None
+ self._psector_size = None
+ self._ptable_format = None
+
+ # find parted
+ self.paths = "/bin:/usr/bin:/usr/sbin:/sbin/"
+ if native_sysroot:
+ for path in self.paths.split(':'):
+ self.paths = "%s%s:%s" % (native_sysroot, path, self.paths)
+
+ self.parted = find_executable("parted", self.paths)
+ if not self.parted:
+ raise WicError("Can't find executable parted")
+
+ self.partitions = self.get_partitions()
+
+ def __del__(self):
+ for path in self._partimages.values():
+ os.unlink(path)
+
+ def get_partitions(self):
+ if self._partitions is None:
+ self._partitions = OrderedDict()
+ out = exec_cmd("%s -sm %s unit B print" % (self.parted, self.imagepath))
+ parttype = namedtuple("Part", "pnum start end size fstype")
+ splitted = out.splitlines()
+ lsector_size, psector_size, self._ptable_format = splitted[1].split(":")[3:6]
+ self._lsector_size = int(lsector_size)
+ self._psector_size = int(psector_size)
+ for line in splitted[2:]:
+ pnum, start, end, size, fstype = line.split(':')[:5]
+ partition = parttype(int(pnum), int(start[:-1]), int(end[:-1]),
+ int(size[:-1]), fstype)
+ self._partitions[pnum] = partition
+
+ return self._partitions
+
+ def __getattr__(self, name):
+ """Get path to the executable in a lazy way."""
+ if name in ("mdir", "mcopy", "mdel", "mdeltree", "sfdisk", "e2fsck",
+ "resize2fs", "mkswap", "mkdosfs", "debugfs"):
+ aname = "_%s" % name
+ if aname not in self.__dict__:
+ setattr(self, aname, find_executable(name, self.paths))
+ if aname not in self.__dict__:
+ raise WicError("Can't find executable {}".format(name))
+ return self.__dict__[aname]
+ return self.__dict__[name]
+
+ def _get_part_image(self, pnum):
+ if pnum not in self.partitions:
+ raise WicError("Partition %s is not in the image")
+ part = self.partitions[pnum]
+ # check if fstype is supported
+ for fstype in self.fstypes:
+ if part.fstype.startswith(fstype):
+ break
+ else:
+ raise WicError("Not supported fstype: {}".format(part.fstype))
+ if pnum not in self._partimages:
+ tmpf = tempfile.NamedTemporaryFile(prefix="wic-part")
+ dst_fname = tmpf.name
+ tmpf.close()
+ sparse_copy(self.imagepath, dst_fname, skip=part.start, length=part.size)
+ self._partimages[pnum] = dst_fname
+
+ return self._partimages[pnum]
+
+ def _put_part_image(self, pnum):
+ """Put partition image into partitioned image."""
+ sparse_copy(self._partimages[pnum], self.imagepath,
+ seek=self.partitions[pnum].start)
+
+ def dir(self, pnum, path):
+ if self.partitions[pnum].fstype.startswith('ext'):
+ return exec_cmd("{} {} -R 'ls -l {}'".format(self.debugfs,
+ self._get_part_image(pnum),
+ path), as_shell=True)
+ else: # fat
+ return exec_cmd("{} -i {} ::{}".format(self.mdir,
+ self._get_part_image(pnum),
+ path))
+
+ def copy(self, src, pnum, path):
+ """Copy partition image into wic image."""
+ if self.partitions[pnum].fstype.startswith('ext'):
+ cmd = "echo -e 'cd {}\nwrite {} {}' | {} -w {}".\
+ format(path, src, os.path.basename(src),
+ self.debugfs, self._get_part_image(pnum))
+ else: # fat
+ cmd = "{} -i {} -snop {} ::{}".format(self.mcopy,
+ self._get_part_image(pnum),
+ src, path)
+ exec_cmd(cmd, as_shell=True)
+ self._put_part_image(pnum)
+
+ def remove(self, pnum, path):
+ """Remove files/dirs from the partition."""
+ partimg = self._get_part_image(pnum)
+ if self.partitions[pnum].fstype.startswith('ext'):
+ exec_cmd("{} {} -wR 'rm {}'".format(self.debugfs,
+ self._get_part_image(pnum),
+ path), as_shell=True)
+ else: # fat
+ cmd = "{} -i {} ::{}".format(self.mdel, partimg, path)
+ try:
+ exec_cmd(cmd)
+ except WicError as err:
+ if "not found" in str(err) or "non empty" in str(err):
+ # mdel outputs 'File ... not found' or 'directory .. non empty"
+ # try to use mdeltree as path could be a directory
+ cmd = "{} -i {} ::{}".format(self.mdeltree,
+ partimg, path)
+ exec_cmd(cmd)
+ else:
+ raise err
+ self._put_part_image(pnum)
+
+ def write(self, target, expand):
+ """Write disk image to the media or file."""
+ def write_sfdisk_script(outf, parts):
+ for key, val in parts['partitiontable'].items():
+ if key in ("partitions", "device", "firstlba", "lastlba"):
+ continue
+ if key == "id":
+ key = "label-id"
+ outf.write("{}: {}\n".format(key, val))
+ outf.write("\n")
+ for part in parts['partitiontable']['partitions']:
+ line = ''
+ for name in ('attrs', 'name', 'size', 'type', 'uuid'):
+ if name == 'size' and part['type'] == 'f':
+ # don't write size for extended partition
+ continue
+ val = part.get(name)
+ if val:
+ line += '{}={}, '.format(name, val)
+ if line:
+ line = line[:-2] # strip ', '
+ if part.get('bootable'):
+ line += ' ,bootable'
+ outf.write("{}\n".format(line))
+ outf.flush()
+
+ def read_ptable(path):
+ out = exec_cmd("{} -dJ {}".format(self.sfdisk, path))
+ return json.loads(out)
+
+ def write_ptable(parts, target):
+ with tempfile.NamedTemporaryFile(prefix="wic-sfdisk-", mode='w') as outf:
+ write_sfdisk_script(outf, parts)
+ cmd = "{} --no-reread {} < {} 2>/dev/null".format(self.sfdisk, target, outf.name)
+ try:
+ subprocess.check_output(cmd, shell=True)
+ except subprocess.CalledProcessError as err:
+ raise WicError("Can't run '{}' command: {}".format(cmd, err))
+
+ if expand is None:
+ sparse_copy(self.imagepath, target)
+ else:
+ # copy first sectors that may contain bootloader
+ sparse_copy(self.imagepath, target, length=2048 * self._lsector_size)
+
+ # copy source partition table to the target
+ parts = read_ptable(self.imagepath)
+ write_ptable(parts, target)
+
+ # get size of unpartitioned space
+ free = None
+ for line in exec_cmd("{} -F {}".format(self.sfdisk, target)).splitlines():
+ if line.startswith("Unpartitioned space ") and line.endswith("sectors"):
+ free = int(line.split()[-2])
+ if free is None:
+ raise WicError("Can't get size of unpartitioned space")
+
+ # calculate expanded partitions sizes
+ sizes = {}
+ for num, part in enumerate(parts['partitiontable']['partitions'], 1):
+ if num in expand:
+ if expand[num] != 0: # don't resize partition if size is set to 0
+ sectors = expand[num] // self._lsector_size
+ free -= sectors - part['size']
+ part['size'] = sectors
+ sizes[num] = sectors
+ elif part['type'] != 'f':
+ sizes[num] = -1
+
+ for num, part in enumerate(parts['partitiontable']['partitions'], 1):
+ if sizes.get(num) == -1:
+ part['size'] += free // len(sizes)
+
+ # write resized partition table to the target
+ write_ptable(parts, target)
+
+ # read resized partition table
+ parts = read_ptable(target)
+
+ # copy partitions content
+ for num, part in enumerate(parts['partitiontable']['partitions'], 1):
+ pnum = str(num)
+ fstype = self.partitions[pnum].fstype
+
+ # copy unchanged partition
+ if part['size'] == self.partitions[pnum].size // self._lsector_size:
+ logger.info("copying unchanged partition {}".format(pnum))
+ sparse_copy(self._get_part_image(pnum), target, seek=part['start'] * self._lsector_size)
+ continue
+
+ # resize or re-create partitions
+ if fstype.startswith('ext') or fstype.startswith('fat') or \
+ fstype.startswith('linux-swap'):
+
+ partfname = None
+ with tempfile.NamedTemporaryFile(prefix="wic-part{}-".format(pnum)) as partf:
+ partfname = partf.name
+
+ if fstype.startswith('ext'):
+ logger.info("resizing ext partition {}".format(pnum))
+ partimg = self._get_part_image(pnum)
+ sparse_copy(partimg, partfname)
+ exec_cmd("{} -pf {}".format(self.e2fsck, partfname))
+ exec_cmd("{} {} {}s".format(\
+ self.resize2fs, partfname, part['size']))
+ elif fstype.startswith('fat'):
+ logger.info("copying content of the fat partition {}".format(pnum))
+ with tempfile.TemporaryDirectory(prefix='wic-fatdir-') as tmpdir:
+ # copy content to the temporary directory
+ cmd = "{} -snompi {} :: {}".format(self.mcopy,
+ self._get_part_image(pnum),
+ tmpdir)
+ exec_cmd(cmd)
+ # create new msdos partition
+ label = part.get("name")
+ label_str = "-n {}".format(label) if label else ''
+
+ cmd = "{} {} -C {} {}".format(self.mkdosfs, label_str, partfname,
+ part['size'])
+ exec_cmd(cmd)
+ # copy content from the temporary directory to the new partition
+ cmd = "{} -snompi {} {}/* ::".format(self.mcopy, partfname, tmpdir)
+ exec_cmd(cmd, as_shell=True)
+ elif fstype.startswith('linux-swap'):
+ logger.info("creating swap partition {}".format(pnum))
+ label = part.get("name")
+ label_str = "-L {}".format(label) if label else ''
+ uuid = part.get("uuid")
+ uuid_str = "-U {}".format(uuid) if uuid else ''
+ with open(partfname, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), part['size'] * self._lsector_size)
+ exec_cmd("{} {} {} {}".format(self.mkswap, label_str, uuid_str, partfname))
+ sparse_copy(partfname, target, seek=part['start'] * self._lsector_size)
+ os.unlink(partfname)
+ elif part['type'] != 'f':
+ logger.warn("skipping partition {}: unsupported fstype {}".format(pnum, fstype))
+
+def wic_ls(args, native_sysroot):
+ """List contents of partitioned image or vfat partition."""
+ disk = Disk(args.path.image, native_sysroot)
+ if not args.path.part:
+ if disk.partitions:
+ print('Num Start End Size Fstype')
+ for part in disk.partitions.values():
+ print("{:2d} {:12d} {:12d} {:12d} {}".format(\
+ part.pnum, part.start, part.end,
+ part.size, part.fstype))
+ else:
+ path = args.path.path or '/'
+ print(disk.dir(args.path.part, path))
+
+def wic_cp(args, native_sysroot):
+ """
+ Copy local file or directory to the vfat partition of
+ partitioned image.
+ """
+ disk = Disk(args.dest.image, native_sysroot)
+ disk.copy(args.src, args.dest.part, args.dest.path)
+
+def wic_rm(args, native_sysroot):
+ """
+ Remove files or directories from the vfat partition of
+ partitioned image.
+ """
+ disk = Disk(args.path.image, native_sysroot)
+ disk.remove(args.path.part, args.path.path)
+
+def wic_write(args, native_sysroot):
+ """
+ Write image to a target device.
+ """
+ disk = Disk(args.image, native_sysroot, ('fat', 'ext', 'swap'))
+ disk.write(args.target, args.expand)
+
+def find_canned(scripts_path, file_name):
+ """
+ Find a file either by its path or by name in the canned files dir.
+
+ Return None if not found
+ """
+ if os.path.exists(file_name):
+ return file_name
+
+ layers_canned_wks_dir = build_canned_image_list(scripts_path)
+ for canned_wks_dir in layers_canned_wks_dir:
+ for root, dirs, files in os.walk(canned_wks_dir):
+ for fname in files:
+ if fname == file_name:
+ fullpath = os.path.join(canned_wks_dir, fname)
+ return fullpath
+
+def get_custom_config(boot_file):
+ """
+ Get the custom configuration to be used for the bootloader.
+
+ Return None if the file can't be found.
+ """
+ # Get the scripts path of poky
+ scripts_path = os.path.abspath("%s/../.." % os.path.dirname(__file__))
+
+ cfg_file = find_canned(scripts_path, boot_file)
+ if cfg_file:
+ with open(cfg_file, "r") as f:
+ config = f.read()
+ return config
diff --git a/poky/scripts/lib/wic/filemap.py b/poky/scripts/lib/wic/filemap.py
new file mode 100644
index 000000000..a72fa09ef
--- /dev/null
+++ b/poky/scripts/lib/wic/filemap.py
@@ -0,0 +1,600 @@
+# Copyright (c) 2012 Intel, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License, version 2,
+# as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+"""
+This module implements python implements a way to get file block. Two methods
+are supported - the FIEMAP ioctl and the 'SEEK_HOLE / SEEK_DATA' features of
+the file seek syscall. The former is implemented by the 'FilemapFiemap' class,
+the latter is implemented by the 'FilemapSeek' class. Both classes provide the
+same API. The 'filemap' function automatically selects which class can be used
+and returns an instance of the class.
+"""
+
+# Disable the following pylint recommendations:
+# * Too many instance attributes (R0902)
+# pylint: disable=R0902
+
+import os
+import struct
+import array
+import fcntl
+import tempfile
+import logging
+
+def get_block_size(file_obj):
+ """
+ Returns block size for file object 'file_obj'. Errors are indicated by the
+ 'IOError' exception.
+ """
+ # Get the block size of the host file-system for the image file by calling
+ # the FIGETBSZ ioctl (number 2).
+ binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
+ bsize = struct.unpack('I', binary_data)[0]
+ if not bsize:
+ import os
+ stat = os.fstat(file_obj.fileno())
+ if hasattr(stat, 'st_blksize'):
+ bsize = stat.st_blksize
+ else:
+ raise IOError("Unable to determine block size")
+ return bsize
+
+class ErrorNotSupp(Exception):
+ """
+ An exception of this type is raised when the 'FIEMAP' or 'SEEK_HOLE' feature
+ is not supported either by the kernel or the file-system.
+ """
+ pass
+
+class Error(Exception):
+ """A class for all the other exceptions raised by this module."""
+ pass
+
+
+class _FilemapBase(object):
+ """
+ This is a base class for a couple of other classes in this module. This
+ class simply performs the common parts of the initialization process: opens
+ the image file, gets its size, etc. The 'log' parameter is the logger object
+ to use for printing messages.
+ """
+
+ def __init__(self, image, log=None):
+ """
+ Initialize a class instance. The 'image' argument is full path to the
+ file or file object to operate on.
+ """
+
+ self._log = log
+ if self._log is None:
+ self._log = logging.getLogger(__name__)
+
+ self._f_image_needs_close = False
+
+ if hasattr(image, "fileno"):
+ self._f_image = image
+ self._image_path = image.name
+ else:
+ self._image_path = image
+ self._open_image_file()
+
+ try:
+ self.image_size = os.fstat(self._f_image.fileno()).st_size
+ except IOError as err:
+ raise Error("cannot get information about file '%s': %s"
+ % (self._f_image.name, err))
+
+ try:
+ self.block_size = get_block_size(self._f_image)
+ except IOError as err:
+ raise Error("cannot get block size for '%s': %s"
+ % (self._image_path, err))
+
+ self.blocks_cnt = self.image_size + self.block_size - 1
+ self.blocks_cnt //= self.block_size
+
+ try:
+ self._f_image.flush()
+ except IOError as err:
+ raise Error("cannot flush image file '%s': %s"
+ % (self._image_path, err))
+
+ try:
+ os.fsync(self._f_image.fileno()),
+ except OSError as err:
+ raise Error("cannot synchronize image file '%s': %s "
+ % (self._image_path, err.strerror))
+
+ self._log.debug("opened image \"%s\"" % self._image_path)
+ self._log.debug("block size %d, blocks count %d, image size %d"
+ % (self.block_size, self.blocks_cnt, self.image_size))
+
+ def __del__(self):
+ """The class destructor which just closes the image file."""
+ if self._f_image_needs_close:
+ self._f_image.close()
+
+ def _open_image_file(self):
+ """Open the image file."""
+ try:
+ self._f_image = open(self._image_path, 'rb')
+ except IOError as err:
+ raise Error("cannot open image file '%s': %s"
+ % (self._image_path, err))
+
+ self._f_image_needs_close = True
+
+ def block_is_mapped(self, block): # pylint: disable=W0613,R0201
+ """
+ This method has has to be implemented by child classes. It returns
+ 'True' if block number 'block' of the image file is mapped and 'False'
+ otherwise.
+ """
+
+ raise Error("the method is not implemented")
+
+ def block_is_unmapped(self, block): # pylint: disable=W0613,R0201
+ """
+ This method has has to be implemented by child classes. It returns
+ 'True' if block number 'block' of the image file is not mapped (hole)
+ and 'False' otherwise.
+ """
+
+ raise Error("the method is not implemented")
+
+ def get_mapped_ranges(self, start, count): # pylint: disable=W0613,R0201
+ """
+ This method has has to be implemented by child classes. This is a
+ generator which yields ranges of mapped blocks in the file. The ranges
+ are tuples of 2 elements: [first, last], where 'first' is the first
+ mapped block and 'last' is the last mapped block.
+
+ The ranges are yielded for the area of the file of size 'count' blocks,
+ starting from block 'start'.
+ """
+
+ raise Error("the method is not implemented")
+
+ def get_unmapped_ranges(self, start, count): # pylint: disable=W0613,R0201
+ """
+ This method has has to be implemented by child classes. Just like
+ 'get_mapped_ranges()', but yields unmapped block ranges instead
+ (holes).
+ """
+
+ raise Error("the method is not implemented")
+
+
+# The 'SEEK_HOLE' and 'SEEK_DATA' options of the file seek system call
+_SEEK_DATA = 3
+_SEEK_HOLE = 4
+
+def _lseek(file_obj, offset, whence):
+ """This is a helper function which invokes 'os.lseek' for file object
+ 'file_obj' and with specified 'offset' and 'whence'. The 'whence'
+ argument is supposed to be either '_SEEK_DATA' or '_SEEK_HOLE'. When
+ there is no more data or hole starting from 'offset', this function
+ returns '-1'. Otherwise the data or hole position is returned."""
+
+ try:
+ return os.lseek(file_obj.fileno(), offset, whence)
+ except OSError as err:
+ # The 'lseek' system call returns the ENXIO if there is no data or
+ # hole starting from the specified offset.
+ if err.errno == os.errno.ENXIO:
+ return -1
+ elif err.errno == os.errno.EINVAL:
+ raise ErrorNotSupp("the kernel or file-system does not support "
+ "\"SEEK_HOLE\" and \"SEEK_DATA\"")
+ else:
+ raise
+
+class FilemapSeek(_FilemapBase):
+ """
+ This class uses the 'SEEK_HOLE' and 'SEEK_DATA' to find file block mapping.
+ Unfortunately, the current implementation requires the caller to have write
+ access to the image file.
+ """
+
+ def __init__(self, image, log=None):
+ """Refer the '_FilemapBase' class for the documentation."""
+
+ # Call the base class constructor first
+ _FilemapBase.__init__(self, image, log)
+ self._log.debug("FilemapSeek: initializing")
+
+ self._probe_seek_hole()
+
+ def _probe_seek_hole(self):
+ """
+ Check whether the system implements 'SEEK_HOLE' and 'SEEK_DATA'.
+ Unfortunately, there seems to be no clean way for detecting this,
+ because often the system just fakes them by just assuming that all
+ files are fully mapped, so 'SEEK_HOLE' always returns EOF and
+ 'SEEK_DATA' always returns the requested offset.
+
+ I could not invent a better way of detecting the fake 'SEEK_HOLE'
+ implementation than just to create a temporary file in the same
+ directory where the image file resides. It would be nice to change this
+ to something better.
+ """
+
+ directory = os.path.dirname(self._image_path)
+
+ try:
+ tmp_obj = tempfile.TemporaryFile("w+", dir=directory)
+ except IOError as err:
+ raise ErrorNotSupp("cannot create a temporary in \"%s\": %s" \
+ % (directory, err))
+
+ try:
+ os.ftruncate(tmp_obj.fileno(), self.block_size)
+ except OSError as err:
+ raise ErrorNotSupp("cannot truncate temporary file in \"%s\": %s"
+ % (directory, err))
+
+ offs = _lseek(tmp_obj, 0, _SEEK_HOLE)
+ if offs != 0:
+ # We are dealing with the stub 'SEEK_HOLE' implementation which
+ # always returns EOF.
+ self._log.debug("lseek(0, SEEK_HOLE) returned %d" % offs)
+ raise ErrorNotSupp("the file-system does not support "
+ "\"SEEK_HOLE\" and \"SEEK_DATA\" but only "
+ "provides a stub implementation")
+
+ tmp_obj.close()
+
+ def block_is_mapped(self, block):
+ """Refer the '_FilemapBase' class for the documentation."""
+ offs = _lseek(self._f_image, block * self.block_size, _SEEK_DATA)
+ if offs == -1:
+ result = False
+ else:
+ result = (offs // self.block_size == block)
+
+ self._log.debug("FilemapSeek: block_is_mapped(%d) returns %s"
+ % (block, result))
+ return result
+
+ def block_is_unmapped(self, block):
+ """Refer the '_FilemapBase' class for the documentation."""
+ return not self.block_is_mapped(block)
+
+ def _get_ranges(self, start, count, whence1, whence2):
+ """
+ This function implements 'get_mapped_ranges()' and
+ 'get_unmapped_ranges()' depending on what is passed in the 'whence1'
+ and 'whence2' arguments.
+ """
+
+ assert whence1 != whence2
+ end = start * self.block_size
+ limit = end + count * self.block_size
+
+ while True:
+ start = _lseek(self._f_image, end, whence1)
+ if start == -1 or start >= limit or start == self.image_size:
+ break
+
+ end = _lseek(self._f_image, start, whence2)
+ if end == -1 or end == self.image_size:
+ end = self.blocks_cnt * self.block_size
+ if end > limit:
+ end = limit
+
+ start_blk = start // self.block_size
+ end_blk = end // self.block_size - 1
+ self._log.debug("FilemapSeek: yielding range (%d, %d)"
+ % (start_blk, end_blk))
+ yield (start_blk, end_blk)
+
+ def get_mapped_ranges(self, start, count):
+ """Refer the '_FilemapBase' class for the documentation."""
+ self._log.debug("FilemapSeek: get_mapped_ranges(%d, %d(%d))"
+ % (start, count, start + count - 1))
+ return self._get_ranges(start, count, _SEEK_DATA, _SEEK_HOLE)
+
+ def get_unmapped_ranges(self, start, count):
+ """Refer the '_FilemapBase' class for the documentation."""
+ self._log.debug("FilemapSeek: get_unmapped_ranges(%d, %d(%d))"
+ % (start, count, start + count - 1))
+ return self._get_ranges(start, count, _SEEK_HOLE, _SEEK_DATA)
+
+
+# Below goes the FIEMAP ioctl implementation, which is not very readable
+# because it deals with the rather complex FIEMAP ioctl. To understand the
+# code, you need to know the FIEMAP interface, which is documented in the
+# "Documentation/filesystems/fiemap.txt" file in the Linux kernel sources.
+
+# Format string for 'struct fiemap'
+_FIEMAP_FORMAT = "=QQLLLL"
+# sizeof(struct fiemap)
+_FIEMAP_SIZE = struct.calcsize(_FIEMAP_FORMAT)
+# Format string for 'struct fiemap_extent'
+_FIEMAP_EXTENT_FORMAT = "=QQQQQLLLL"
+# sizeof(struct fiemap_extent)
+_FIEMAP_EXTENT_SIZE = struct.calcsize(_FIEMAP_EXTENT_FORMAT)
+# The FIEMAP ioctl number
+_FIEMAP_IOCTL = 0xC020660B
+# This FIEMAP ioctl flag which instructs the kernel to sync the file before
+# reading the block map
+_FIEMAP_FLAG_SYNC = 0x00000001
+# Size of the buffer for 'struct fiemap_extent' elements which will be used
+# when invoking the FIEMAP ioctl. The larger is the buffer, the less times the
+# FIEMAP ioctl will be invoked.
+_FIEMAP_BUFFER_SIZE = 256 * 1024
+
+class FilemapFiemap(_FilemapBase):
+ """
+ This class provides API to the FIEMAP ioctl. Namely, it allows to iterate
+ over all mapped blocks and over all holes.
+
+ This class synchronizes the image file every time it invokes the FIEMAP
+ ioctl in order to work-around early FIEMAP implementation kernel bugs.
+ """
+
+ def __init__(self, image, log=None):
+ """
+ Initialize a class instance. The 'image' argument is full the file
+ object to operate on.
+ """
+
+ # Call the base class constructor first
+ _FilemapBase.__init__(self, image, log)
+ self._log.debug("FilemapFiemap: initializing")
+
+ self._buf_size = _FIEMAP_BUFFER_SIZE
+
+ # Calculate how many 'struct fiemap_extent' elements fit the buffer
+ self._buf_size -= _FIEMAP_SIZE
+ self._fiemap_extent_cnt = self._buf_size // _FIEMAP_EXTENT_SIZE
+ assert self._fiemap_extent_cnt > 0
+ self._buf_size = self._fiemap_extent_cnt * _FIEMAP_EXTENT_SIZE
+ self._buf_size += _FIEMAP_SIZE
+
+ # Allocate a mutable buffer for the FIEMAP ioctl
+ self._buf = array.array('B', [0] * self._buf_size)
+
+ # Check if the FIEMAP ioctl is supported
+ self.block_is_mapped(0)
+
+ def _invoke_fiemap(self, block, count):
+ """
+ Invoke the FIEMAP ioctl for 'count' blocks of the file starting from
+ block number 'block'.
+
+ The full result of the operation is stored in 'self._buf' on exit.
+ Returns the unpacked 'struct fiemap' data structure in form of a python
+ list (just like 'struct.upack()').
+ """
+
+ if self.blocks_cnt != 0 and (block < 0 or block >= self.blocks_cnt):
+ raise Error("bad block number %d, should be within [0, %d]"
+ % (block, self.blocks_cnt))
+
+ # Initialize the 'struct fiemap' part of the buffer. We use the
+ # '_FIEMAP_FLAG_SYNC' flag in order to make sure the file is
+ # synchronized. The reason for this is that early FIEMAP
+ # implementations had many bugs related to cached dirty data, and
+ # synchronizing the file is a necessary work-around.
+ struct.pack_into(_FIEMAP_FORMAT, self._buf, 0, block * self.block_size,
+ count * self.block_size, _FIEMAP_FLAG_SYNC, 0,
+ self._fiemap_extent_cnt, 0)
+
+ try:
+ fcntl.ioctl(self._f_image, _FIEMAP_IOCTL, self._buf, 1)
+ except IOError as err:
+ # Note, the FIEMAP ioctl is supported by the Linux kernel starting
+ # from version 2.6.28 (year 2008).
+ if err.errno == os.errno.EOPNOTSUPP:
+ errstr = "FilemapFiemap: the FIEMAP ioctl is not supported " \
+ "by the file-system"
+ self._log.debug(errstr)
+ raise ErrorNotSupp(errstr)
+ if err.errno == os.errno.ENOTTY:
+ errstr = "FilemapFiemap: the FIEMAP ioctl is not supported " \
+ "by the kernel"
+ self._log.debug(errstr)
+ raise ErrorNotSupp(errstr)
+ raise Error("the FIEMAP ioctl failed for '%s': %s"
+ % (self._image_path, err))
+
+ return struct.unpack(_FIEMAP_FORMAT, self._buf[:_FIEMAP_SIZE])
+
+ def block_is_mapped(self, block):
+ """Refer the '_FilemapBase' class for the documentation."""
+ struct_fiemap = self._invoke_fiemap(block, 1)
+
+ # The 3rd element of 'struct_fiemap' is the 'fm_mapped_extents' field.
+ # If it contains zero, the block is not mapped, otherwise it is
+ # mapped.
+ result = bool(struct_fiemap[3])
+ self._log.debug("FilemapFiemap: block_is_mapped(%d) returns %s"
+ % (block, result))
+ return result
+
+ def block_is_unmapped(self, block):
+ """Refer the '_FilemapBase' class for the documentation."""
+ return not self.block_is_mapped(block)
+
+ def _unpack_fiemap_extent(self, index):
+ """
+ Unpack a 'struct fiemap_extent' structure object number 'index' from
+ the internal 'self._buf' buffer.
+ """
+
+ offset = _FIEMAP_SIZE + _FIEMAP_EXTENT_SIZE * index
+ return struct.unpack(_FIEMAP_EXTENT_FORMAT,
+ self._buf[offset : offset + _FIEMAP_EXTENT_SIZE])
+
+ def _do_get_mapped_ranges(self, start, count):
+ """
+ Implements most the functionality for the 'get_mapped_ranges()'
+ generator: invokes the FIEMAP ioctl, walks through the mapped extents
+ and yields mapped block ranges. However, the ranges may be consecutive
+ (e.g., (1, 100), (100, 200)) and 'get_mapped_ranges()' simply merges
+ them.
+ """
+
+ block = start
+ while block < start + count:
+ struct_fiemap = self._invoke_fiemap(block, count)
+
+ mapped_extents = struct_fiemap[3]
+ if mapped_extents == 0:
+ # No more mapped blocks
+ return
+
+ extent = 0
+ while extent < mapped_extents:
+ fiemap_extent = self._unpack_fiemap_extent(extent)
+
+ # Start of the extent
+ extent_start = fiemap_extent[0]
+ # Starting block number of the extent
+ extent_block = extent_start // self.block_size
+ # Length of the extent
+ extent_len = fiemap_extent[2]
+ # Count of blocks in the extent
+ extent_count = extent_len // self.block_size
+
+ # Extent length and offset have to be block-aligned
+ assert extent_start % self.block_size == 0
+ assert extent_len % self.block_size == 0
+
+ if extent_block > start + count - 1:
+ return
+
+ first = max(extent_block, block)
+ last = min(extent_block + extent_count, start + count) - 1
+ yield (first, last)
+
+ extent += 1
+
+ block = extent_block + extent_count
+
+ def get_mapped_ranges(self, start, count):
+ """Refer the '_FilemapBase' class for the documentation."""
+ self._log.debug("FilemapFiemap: get_mapped_ranges(%d, %d(%d))"
+ % (start, count, start + count - 1))
+ iterator = self._do_get_mapped_ranges(start, count)
+ first_prev, last_prev = next(iterator)
+
+ for first, last in iterator:
+ if last_prev == first - 1:
+ last_prev = last
+ else:
+ self._log.debug("FilemapFiemap: yielding range (%d, %d)"
+ % (first_prev, last_prev))
+ yield (first_prev, last_prev)
+ first_prev, last_prev = first, last
+
+ self._log.debug("FilemapFiemap: yielding range (%d, %d)"
+ % (first_prev, last_prev))
+ yield (first_prev, last_prev)
+
+ def get_unmapped_ranges(self, start, count):
+ """Refer the '_FilemapBase' class for the documentation."""
+ self._log.debug("FilemapFiemap: get_unmapped_ranges(%d, %d(%d))"
+ % (start, count, start + count - 1))
+ hole_first = start
+ for first, last in self._do_get_mapped_ranges(start, count):
+ if first > hole_first:
+ self._log.debug("FilemapFiemap: yielding range (%d, %d)"
+ % (hole_first, first - 1))
+ yield (hole_first, first - 1)
+
+ hole_first = last + 1
+
+ if hole_first < start + count:
+ self._log.debug("FilemapFiemap: yielding range (%d, %d)"
+ % (hole_first, start + count - 1))
+ yield (hole_first, start + count - 1)
+
+def filemap(image, log=None):
+ """
+ Create and return an instance of a Filemap class - 'FilemapFiemap' or
+ 'FilemapSeek', depending on what the system we run on supports. If the
+ FIEMAP ioctl is supported, an instance of the 'FilemapFiemap' class is
+ returned. Otherwise, if 'SEEK_HOLE' is supported an instance of the
+ 'FilemapSeek' class is returned. If none of these are supported, the
+ function generates an 'Error' type exception.
+ """
+
+ try:
+ return FilemapFiemap(image, log)
+ except ErrorNotSupp:
+ return FilemapSeek(image, log)
+
+def sparse_copy(src_fname, dst_fname, skip=0, seek=0,
+ length=0, api=None):
+ """
+ Efficiently copy sparse file to or into another file.
+
+ src_fname: path to source file
+ dst_fname: path to destination file
+ skip: skip N bytes at thestart of src
+ seek: seek N bytes from the start of dst
+ length: read N bytes from src and write them to dst
+ api: FilemapFiemap or FilemapSeek object
+ """
+ if not api:
+ api = filemap
+ fmap = api(src_fname)
+ try:
+ dst_file = open(dst_fname, 'r+b')
+ except IOError:
+ dst_file = open(dst_fname, 'wb')
+ if length:
+ dst_size = length + seek
+ else:
+ dst_size = os.path.getsize(src_fname) + seek - skip
+ dst_file.truncate(dst_size)
+
+ written = 0
+ for first, last in fmap.get_mapped_ranges(0, fmap.blocks_cnt):
+ start = first * fmap.block_size
+ end = (last + 1) * fmap.block_size
+
+ if skip >= end:
+ continue
+
+ if start < skip < end:
+ start = skip
+
+ fmap._f_image.seek(start, os.SEEK_SET)
+
+ written += start - skip - written
+ if length and written >= length:
+ dst_file.seek(seek + length, os.SEEK_SET)
+ dst_file.close()
+ return
+
+ dst_file.seek(seek + start - skip, os.SEEK_SET)
+
+ chunk_size = 1024 * 1024
+ to_read = end - start
+ read = 0
+
+ while read < to_read:
+ if read + chunk_size > to_read:
+ chunk_size = to_read - read
+ size = chunk_size
+ if length and written + size > length:
+ size = length - written
+ chunk = fmap._f_image.read(size)
+ dst_file.write(chunk)
+ read += size
+ written += size
+ if written == length:
+ dst_file.close()
+ return
+ dst_file.close()
diff --git a/poky/scripts/lib/wic/help.py b/poky/scripts/lib/wic/help.py
new file mode 100644
index 000000000..842b868a5
--- /dev/null
+++ b/poky/scripts/lib/wic/help.py
@@ -0,0 +1,1055 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This module implements some basic help invocation functions along
+# with the bulk of the help topic text for the OE Core Image Tools.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import subprocess
+import logging
+
+from wic.pluginbase import PluginMgr, PLUGIN_TYPES
+
+logger = logging.getLogger('wic')
+
+def subcommand_error(args):
+ logger.info("invalid subcommand %s", args[0])
+
+
+def display_help(subcommand, subcommands):
+ """
+ Display help for subcommand.
+ """
+ if subcommand not in subcommands:
+ return False
+
+ hlp = subcommands.get(subcommand, subcommand_error)[2]
+ if callable(hlp):
+ hlp = hlp()
+ pager = subprocess.Popen('less', stdin=subprocess.PIPE)
+ pager.communicate(hlp.encode('utf-8'))
+
+ return True
+
+
+def wic_help(args, usage_str, subcommands):
+ """
+ Subcommand help dispatcher.
+ """
+ if args.help_topic == None or not display_help(args.help_topic, subcommands):
+ print(usage_str)
+
+
+def get_wic_plugins_help():
+ """
+ Combine wic_plugins_help with the help for every known
+ source plugin.
+ """
+ result = wic_plugins_help
+ for plugin_type in PLUGIN_TYPES:
+ result += '\n\n%s PLUGINS\n\n' % plugin_type.upper()
+ for name, plugin in PluginMgr.get_plugins(plugin_type).items():
+ result += "\n %s plugin:\n" % name
+ if plugin.__doc__:
+ result += plugin.__doc__
+ else:
+ result += "\n %s is missing docstring\n" % plugin
+ return result
+
+
+def invoke_subcommand(args, parser, main_command_usage, subcommands):
+ """
+ Dispatch to subcommand handler borrowed from combo-layer.
+ Should use argparse, but has to work in 2.6.
+ """
+ if not args.command:
+ logger.error("No subcommand specified, exiting")
+ parser.print_help()
+ return 1
+ elif args.command == "help":
+ wic_help(args, main_command_usage, subcommands)
+ elif args.command not in subcommands:
+ logger.error("Unsupported subcommand %s, exiting\n", args.command)
+ parser.print_help()
+ return 1
+ else:
+ subcmd = subcommands.get(args.command, subcommand_error)
+ usage = subcmd[1]
+ subcmd[0](args, usage)
+
+
+##
+# wic help and usage strings
+##
+
+wic_usage = """
+
+ Create a customized OpenEmbedded image
+
+ usage: wic [--version] | [--help] | [COMMAND [ARGS]]
+
+ Current 'wic' commands are:
+ help Show help for command or one of the topics (see below)
+ create Create a new OpenEmbedded image
+ list List available canned images and source plugins
+
+ Help topics:
+ overview wic overview - General overview of wic
+ plugins wic plugins - Overview and API
+ kickstart wic kickstart - wic kickstart reference
+"""
+
+wic_help_usage = """
+
+ usage: wic help <subcommand>
+
+ This command displays detailed help for the specified subcommand.
+"""
+
+wic_create_usage = """
+
+ Create a new OpenEmbedded image
+
+ usage: wic create <wks file or image name> [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+ [-r, --rootfs-dir] [-b, --bootimg-dir]
+ [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
+ [-c, --compress-with] [-m, --bmap]
+
+ This command creates an OpenEmbedded image based on the 'OE kickstart
+ commands' found in the <wks file>.
+
+ The -o option can be used to place the image in a directory with a
+ different name and location.
+
+ See 'wic help create' for more detailed instructions.
+"""
+
+wic_create_help = """
+
+NAME
+ wic create - Create a new OpenEmbedded image
+
+SYNOPSIS
+ wic create <wks file or image name> [-o <DIRNAME> | --outdir <DIRNAME>]
+ [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+ [-r, --rootfs-dir] [-b, --bootimg-dir]
+ [-k, --kernel-dir] [-n, --native-sysroot] [-f, --build-rootfs]
+ [-c, --compress-with] [-m, --bmap] [--no-fstab-update]
+
+DESCRIPTION
+ This command creates an OpenEmbedded image based on the 'OE
+ kickstart commands' found in the <wks file>.
+
+ In order to do this, wic needs to know the locations of the
+ various build artifacts required to build the image.
+
+ Users can explicitly specify the build artifact locations using
+ the -r, -b, -k, and -n options. See below for details on where
+ the corresponding artifacts are typically found in a normal
+ OpenEmbedded build.
+
+ Alternatively, users can use the -e option to have 'wic' determine
+ those locations for a given image. If the -e option is used, the
+ user needs to have set the appropriate MACHINE variable in
+ local.conf, and have sourced the build environment.
+
+ The -e option is used to specify the name of the image to use the
+ artifacts from e.g. core-image-sato.
+
+ The -r option is used to specify the path to the /rootfs dir to
+ use as the .wks rootfs source.
+
+ The -b option is used to specify the path to the dir containing
+ the boot artifacts (e.g. /EFI or /syslinux dirs) to use as the
+ .wks bootimg source.
+
+ The -k option is used to specify the path to the dir containing
+ the kernel to use in the .wks bootimg.
+
+ The -n option is used to specify the path to the native sysroot
+ containing the tools to use to build the image.
+
+ The -f option is used to build rootfs by running "bitbake <image>"
+
+ The -s option is used to skip the build check. The build check is
+ a simple sanity check used to determine whether the user has
+ sourced the build environment so that the -e option can operate
+ correctly. If the user has specified the build artifact locations
+ explicitly, 'wic' assumes the user knows what he or she is doing
+ and skips the build check.
+
+ The -D option is used to display debug information detailing
+ exactly what happens behind the scenes when a create request is
+ fulfilled (or not, as the case may be). It enumerates and
+ displays the command sequence used, and should be included in any
+ bug report describing unexpected results.
+
+ When 'wic -e' is used, the locations for the build artifacts
+ values are determined by 'wic -e' from the output of the 'bitbake
+ -e' command given an image name e.g. 'core-image-minimal' and a
+ given machine set in local.conf. In that case, the image is
+ created as if the following 'bitbake -e' variables were used:
+
+ -r: IMAGE_ROOTFS
+ -k: STAGING_KERNEL_DIR
+ -n: STAGING_DIR_NATIVE
+ -b: empty (plugin-specific handlers must determine this)
+
+ If 'wic -e' is not used, the user needs to select the appropriate
+ value for -b (as well as -r, -k, and -n).
+
+ The -o option can be used to place the image in a directory with a
+ different name and location.
+
+ The -c option is used to specify compressor utility to compress
+ an image. gzip, bzip2 and xz compressors are supported.
+
+ The -m option is used to produce .bmap file for the image. This file
+ can be used to flash image using bmaptool utility.
+
+ The --no-fstab-update option is used to doesn't change fstab file. When
+ using this option the final fstab file will be same that in rootfs and
+ wic doesn't update file, e.g adding a new mount point. User can control
+ the fstab file content in base-files recipe.
+"""
+
+wic_list_usage = """
+
+ List available OpenEmbedded images and source plugins
+
+ usage: wic list images
+ wic list <image> help
+ wic list source-plugins
+
+ This command enumerates the set of available canned images as well as
+ help for those images. It also can be used to list of available source
+ plugins.
+
+ The first form enumerates all the available 'canned' images.
+
+ The second form lists the detailed help information for a specific
+ 'canned' image.
+
+ The third form enumerates all the available --sources (source
+ plugins).
+
+ See 'wic help list' for more details.
+"""
+
+wic_list_help = """
+
+NAME
+ wic list - List available OpenEmbedded images and source plugins
+
+SYNOPSIS
+ wic list images
+ wic list <image> help
+ wic list source-plugins
+
+DESCRIPTION
+ This command enumerates the set of available canned images as well
+ as help for those images. It also can be used to list available
+ source plugins.
+
+ The first form enumerates all the available 'canned' images.
+ These are actually just the set of .wks files that have been moved
+ into the /scripts/lib/wic/canned-wks directory).
+
+ The second form lists the detailed help information for a specific
+ 'canned' image.
+
+ The third form enumerates all the available --sources (source
+ plugins). The contents of a given partition are driven by code
+ defined in 'source plugins'. Users specify a specific plugin via
+ the --source parameter of the partition .wks command. Normally
+ this is the 'rootfs' plugin but can be any of the more specialized
+ sources listed by the 'list source-plugins' command. Users can
+ also add their own source plugins - see 'wic help plugins' for
+ details.
+"""
+
+wic_ls_usage = """
+
+ List content of a partitioned image
+
+ usage: wic ls <image>[:<partition>[<path>]] [--native-sysroot <path>]
+
+ This command outputs either list of image partitions or directory contents
+ of vfat and ext* partitions.
+
+ See 'wic help ls' for more detailed instructions.
+
+"""
+
+wic_ls_help = """
+
+NAME
+ wic ls - List contents of partitioned image or partition
+
+SYNOPSIS
+ wic ls <image>
+ wic ls <image>:<vfat or ext* partition>
+ wic ls <image>:<vfat or ext* partition><path>
+ wic ls <image>:<vfat or ext* partition><path> --native-sysroot <path>
+
+DESCRIPTION
+ This command lists either partitions of the image or directory contents
+ of vfat or ext* partitions.
+
+ The first form it lists partitions of the image.
+ For example:
+ $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic
+ Num Start End Size Fstype
+ 1 1048576 24438783 23390208 fat16
+ 2 25165824 50315263 25149440 ext4
+
+ Second and third form list directory content of the partition:
+ $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is 2DF2-5F02
+ Directory for ::/
+
+ efi <DIR> 2017-05-11 10:54
+ startup nsh 26 2017-05-11 10:54
+ vmlinuz 6922288 2017-05-11 10:54
+ 3 files 6 922 314 bytes
+ 15 818 752 bytes free
+
+
+ $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/EFI/boot/
+ Volume in drive : is boot
+ Volume Serial Number is 2DF2-5F02
+ Directory for ::/EFI/boot
+
+ . <DIR> 2017-05-11 10:54
+ .. <DIR> 2017-05-11 10:54
+ grub cfg 679 2017-05-11 10:54
+ bootx64 efi 571392 2017-05-11 10:54
+ 4 files 572 071 bytes
+ 15 818 752 bytes free
+
+ The -n option is used to specify the path to the native sysroot
+ containing the tools(parted and mtools) to use.
+
+"""
+
+wic_cp_usage = """
+
+ Copy files and directories to the vfat or ext* partition
+
+ usage: wic cp <src> <image>:<partition>[<path>] [--native-sysroot <path>]
+
+ This command copies local files or directories to the vfat or ext* partitions
+of partitioned image.
+
+ See 'wic help cp' for more detailed instructions.
+
+"""
+
+wic_cp_help = """
+
+NAME
+ wic cp - copy files and directories to the vfat or ext* partitions
+
+SYNOPSIS
+ wic cp <src> <image>:<partition>
+ wic cp <src> <image>:<partition><path>
+ wic cp <src> <image>:<partition><path> --native-sysroot <path>
+
+DESCRIPTION
+ This command copies files and directories to the vfat or ext* partition of
+ the partitioned image.
+
+ The first form of it copies file or directory to the root directory of
+ the partition:
+ $ wic cp test.wks tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1
+ $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is DB4C-FD4C
+ Directory for ::/
+
+ efi <DIR> 2017-05-24 18:15
+ loader <DIR> 2017-05-24 18:15
+ startup nsh 26 2017-05-24 18:15
+ vmlinuz 6926384 2017-05-24 18:15
+ test wks 628 2017-05-24 21:22
+ 5 files 6 927 038 bytes
+ 15 677 440 bytes free
+
+ The second form of the command copies file or directory to the specified directory
+ on the partition:
+ $ wic cp test tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/efi/
+ $ wic ls tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/efi/
+ Volume in drive : is boot
+ Volume Serial Number is DB4C-FD4C
+ Directory for ::/efi
+
+ . <DIR> 2017-05-24 18:15
+ .. <DIR> 2017-05-24 18:15
+ boot <DIR> 2017-05-24 18:15
+ test <DIR> 2017-05-24 21:27
+ 4 files 0 bytes
+ 15 675 392 bytes free
+
+ The -n option is used to specify the path to the native sysroot
+ containing the tools(parted and mtools) to use.
+"""
+
+wic_rm_usage = """
+
+ Remove files or directories from the vfat or ext* partitions
+
+ usage: wic rm <image>:<partition><path> [--native-sysroot <path>]
+
+ This command removes files or directories from the vfat or ext* partitions of
+ the partitioned image.
+
+ See 'wic help rm' for more detailed instructions.
+
+"""
+
+wic_rm_help = """
+
+NAME
+ wic rm - remove files or directories from the vfat or ext* partitions
+
+SYNOPSIS
+ wic rm <src> <image>:<partition><path>
+ wic rm <src> <image>:<partition><path> --native-sysroot <path>
+
+DESCRIPTION
+ This command removes files or directories from the vfat or ext* partition of the
+ partitioned image:
+
+ $ wic ls ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is 11D0-DE21
+ Directory for ::/
+
+ libcom32 c32 186500 2017-06-02 15:15
+ libutil c32 24148 2017-06-02 15:15
+ syslinux cfg 209 2017-06-02 15:15
+ vesamenu c32 27104 2017-06-02 15:15
+ vmlinuz 6926384 2017-06-02 15:15
+ 5 files 7 164 345 bytes
+ 16 582 656 bytes free
+
+ $ wic rm ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1/libutil.c32
+
+ $ wic ls ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic:1
+ Volume in drive : is boot
+ Volume Serial Number is 11D0-DE21
+ Directory for ::/
+
+ libcom32 c32 186500 2017-06-02 15:15
+ syslinux cfg 209 2017-06-02 15:15
+ vesamenu c32 27104 2017-06-02 15:15
+ vmlinuz 6926384 2017-06-02 15:15
+ 4 files 7 140 197 bytes
+ 16 607 232 bytes free
+
+ The -n option is used to specify the path to the native sysroot
+ containing the tools(parted and mtools) to use.
+"""
+
+wic_write_usage = """
+
+ Write image to a device
+
+ usage: wic write <image> <target device> [--expand [rules]] [--native-sysroot <path>]
+
+ This command writes partitioned image to a target device (USB stick, SD card etc).
+
+ See 'wic help write' for more detailed instructions.
+
+"""
+
+wic_write_help = """
+
+NAME
+ wic write - write an image to a device
+
+SYNOPSIS
+ wic write <image> <target>
+ wic write <image> <target> --expand auto
+ wic write <image> <target> --expand 1:100M-2:300M
+ wic write <image> <target> --native-sysroot <path>
+
+DESCRIPTION
+ This command writes an image to a target device (USB stick, SD card etc)
+
+ $ wic write ./tmp/deploy/images/qemux86-64/core-image-minimal-qemux86-64.wic /dev/sdb
+
+ The --expand option is used to resize image partitions.
+ --expand auto expands partitions to occupy all free space available on the target device.
+ It's also possible to specify expansion rules in a format
+ <partition>:<size>[-<partition>:<size>...] for one or more partitions.
+ Specifying size 0 will keep partition unmodified.
+ Note: Resizing boot partition can result in non-bootable image for non-EFI images. It is
+ recommended to use size 0 for boot partition to keep image bootable.
+
+ The --native-sysroot option is used to specify the path to the native sysroot
+ containing the tools(parted, resize2fs) to use.
+"""
+
+wic_plugins_help = """
+
+NAME
+ wic plugins - Overview and API
+
+DESCRIPTION
+ plugins allow wic functionality to be extended and specialized by
+ users. This section documents the plugin interface, which is
+ currently restricted to 'source' plugins.
+
+ 'Source' plugins provide a mechanism to customize various aspects
+ of the image generation process in wic, mainly the contents of
+ partitions.
+
+ Source plugins provide a mechanism for mapping values specified in
+ .wks files using the --source keyword to a particular plugin
+ implementation that populates a corresponding partition.
+
+ A source plugin is created as a subclass of SourcePlugin (see
+ scripts/lib/wic/pluginbase.py) and the plugin file containing it
+ is added to scripts/lib/wic/plugins/source/ to make the plugin
+ implementation available to the wic implementation.
+
+ Source plugins can also be implemented and added by external
+ layers - any plugins found in a scripts/lib/wic/plugins/source/
+ directory in an external layer will also be made available.
+
+ When the wic implementation needs to invoke a partition-specific
+ implementation, it looks for the plugin that has the same name as
+ the --source param given to that partition. For example, if the
+ partition is set up like this:
+
+ part /boot --source bootimg-pcbios ...
+
+ then the methods defined as class members of the plugin having the
+ matching bootimg-pcbios .name class member would be used.
+
+ To be more concrete, here's the plugin definition that would match
+ a '--source bootimg-pcbios' usage, along with an example method
+ that would be called by the wic implementation when it needed to
+ invoke an implementation-specific partition-preparation function:
+
+ class BootimgPcbiosPlugin(SourcePlugin):
+ name = 'bootimg-pcbios'
+
+ @classmethod
+ def do_prepare_partition(self, part, ...)
+
+ If the subclass itself doesn't implement a function, a 'default'
+ version in a superclass will be located and used, which is why all
+ plugins must be derived from SourcePlugin.
+
+ The SourcePlugin class defines the following methods, which is the
+ current set of methods that can be implemented/overridden by
+ --source plugins. Any methods not implemented by a SourcePlugin
+ subclass inherit the implementations present in the SourcePlugin
+ class (see the SourcePlugin source for details):
+
+ do_prepare_partition()
+ Called to do the actual content population for a
+ partition. In other words, it 'prepares' the final partition
+ image which will be incorporated into the disk image.
+
+ do_post_partition()
+ Called after the partition is created. It is useful to add post
+ operations e.g. signing the partition.
+
+ do_configure_partition()
+ Called before do_prepare_partition(), typically used to
+ create custom configuration files for a partition, for
+ example syslinux or grub config files.
+
+ do_install_disk()
+ Called after all partitions have been prepared and assembled
+ into a disk image. This provides a hook to allow
+ finalization of a disk image, for example to write an MBR to
+ it.
+
+ do_stage_partition()
+ Special content-staging hook called before
+ do_prepare_partition(), normally empty.
+
+ Typically, a partition will just use the passed-in
+ parameters, for example the unmodified value of bootimg_dir.
+ In some cases however, things may need to be more tailored.
+ As an example, certain files may additionally need to be
+ take from bootimg_dir + /boot. This hook allows those files
+ to be staged in a customized fashion. Note that
+ get_bitbake_var() allows you to access non-standard
+ variables that you might want to use for these types of
+ situations.
+
+ This scheme is extensible - adding more hooks is a simple matter
+ of adding more plugin methods to SourcePlugin and derived classes.
+ Please see the implementation for details.
+"""
+
+wic_overview_help = """
+
+NAME
+ wic overview - General overview of wic
+
+DESCRIPTION
+ The 'wic' command generates partitioned images from existing
+ OpenEmbedded build artifacts. Image generation is driven by
+ partitioning commands contained in an 'Openembedded kickstart'
+ (.wks) file (see 'wic help kickstart') specified either directly
+ on the command-line or as one of a selection of canned .wks files
+ (see 'wic list images'). When applied to a given set of build
+ artifacts, the result is an image or set of images that can be
+ directly written onto media and used on a particular system.
+
+ The 'wic' command and the infrastructure it's based on is by
+ definition incomplete - its purpose is to allow the generation of
+ customized images, and as such was designed to be completely
+ extensible via a plugin interface (see 'wic help plugins').
+
+ Background and Motivation
+
+ wic is meant to be a completely independent standalone utility
+ that initially provides easier-to-use and more flexible
+ replacements for a couple bits of existing functionality in
+ oe-core: directdisk.bbclass and mkefidisk.sh. The difference
+ between wic and those examples is that with wic the functionality
+ of those scripts is implemented by a general-purpose partitioning
+ 'language' based on Redhat kickstart syntax).
+
+ The initial motivation and design considerations that lead to the
+ current tool are described exhaustively in Yocto Bug #3847
+ (https://bugzilla.yoctoproject.org/show_bug.cgi?id=3847).
+
+ Implementation and Examples
+
+ wic can be used in two different modes, depending on how much
+ control the user needs in specifying the Openembedded build
+ artifacts that will be used in creating the image: 'raw' and
+ 'cooked'.
+
+ If used in 'raw' mode, artifacts are explicitly specified via
+ command-line arguments (see example below).
+
+ The more easily usable 'cooked' mode uses the current MACHINE
+ setting and a specified image name to automatically locate the
+ artifacts used to create the image.
+
+ OE kickstart files (.wks) can of course be specified directly on
+ the command-line, but the user can also choose from a set of
+ 'canned' .wks files available via the 'wic list images' command
+ (example below).
+
+ In any case, the prerequisite for generating any image is to have
+ the build artifacts already available. The below examples assume
+ the user has already build a 'core-image-minimal' for a specific
+ machine (future versions won't require this redundant step, but
+ for now that's typically how build artifacts get generated).
+
+ The other prerequisite is to source the build environment:
+
+ $ source oe-init-build-env
+
+ To start out with, we'll generate an image from one of the canned
+ .wks files. The following generates a list of availailable
+ images:
+
+ $ wic list images
+ mkefidisk Create an EFI disk image
+ directdisk Create a 'pcbios' direct disk image
+
+ You can get more information about any of the available images by
+ typing 'wic list xxx help', where 'xxx' is one of the image names:
+
+ $ wic list mkefidisk help
+
+ Creates a partitioned EFI disk image that the user can directly dd
+ to boot media.
+
+ At any time, you can get help on the 'wic' command or any
+ subcommand (currently 'list' and 'create'). For instance, to get
+ the description of 'wic create' command and its parameters:
+
+ $ wic create
+
+ Usage:
+
+ Create a new OpenEmbedded image
+
+ usage: wic create <wks file or image name> [-o <DIRNAME> | ...]
+ [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
+ [-e | --image-name] [-s, --skip-build-check] [-D, --debug]
+ [-r, --rootfs-dir] [-b, --bootimg-dir] [-k, --kernel-dir]
+ [-n, --native-sysroot] [-f, --build-rootfs]
+
+ This command creates an OpenEmbedded image based on the 'OE
+ kickstart commands' found in the <wks file>.
+
+ The -o option can be used to place the image in a directory
+ with a different name and location.
+
+ See 'wic help create' for more detailed instructions.
+ ...
+
+ As mentioned in the command, you can get even more detailed
+ information by adding 'help' to the above:
+
+ $ wic help create
+
+ So, the easiest way to create an image is to use the -e option
+ with a canned .wks file. To use the -e option, you need to
+ specify the image used to generate the artifacts and you actually
+ need to have the MACHINE used to build them specified in your
+ local.conf (these requirements aren't necessary if you aren't
+ using the -e options.) Below, we generate a directdisk image,
+ pointing the process at the core-image-minimal artifacts for the
+ current MACHINE:
+
+ $ wic create directdisk -e core-image-minimal
+
+ Checking basic build environment...
+ Done.
+
+ Creating image(s)...
+
+ Info: The new image(s) can be found here:
+ /var/tmp/wic/build/directdisk-201309252350-sda.direct
+
+ The following build artifacts were used to create the image(s):
+
+ ROOTFS_DIR: ...
+ BOOTIMG_DIR: ...
+ KERNEL_DIR: ...
+ NATIVE_SYSROOT: ...
+
+ The image(s) were created using OE kickstart file:
+ .../scripts/lib/wic/canned-wks/directdisk.wks
+
+ The output shows the name and location of the image created, and
+ so that you know exactly what was used to generate the image, each
+ of the artifacts and the kickstart file used.
+
+ Similarly, you can create a 'mkefidisk' image in the same way
+ (notice that this example uses a different machine - because it's
+ using the -e option, you need to change the MACHINE in your
+ local.conf):
+
+ $ wic create mkefidisk -e core-image-minimal
+ Checking basic build environment...
+ Done.
+
+ Creating image(s)...
+
+ Info: The new image(s) can be found here:
+ /var/tmp/wic/build/mkefidisk-201309260027-sda.direct
+
+ ...
+
+ Here's an example that doesn't take the easy way out and manually
+ specifies each build artifact, along with a non-canned .wks file,
+ and also uses the -o option to have wic create the output
+ somewhere other than the default /var/tmp/wic:
+
+ $ wic create ./test.wks -o ./out --rootfs-dir
+ tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs
+ --bootimg-dir tmp/sysroots/qemux86-64/usr/share
+ --kernel-dir tmp/deploy/images/qemux86-64
+ --native-sysroot tmp/sysroots/x86_64-linux
+
+ Creating image(s)...
+
+ Info: The new image(s) can be found here:
+ out/build/test-201507211313-sda.direct
+
+ The following build artifacts were used to create the image(s):
+ ROOTFS_DIR: tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs
+ BOOTIMG_DIR: tmp/sysroots/qemux86-64/usr/share
+ KERNEL_DIR: tmp/deploy/images/qemux86-64
+ NATIVE_SYSROOT: tmp/sysroots/x86_64-linux
+
+ The image(s) were created using OE kickstart file:
+ ./test.wks
+
+ Here is a content of test.wks:
+
+ part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+ part / --source rootfs --ondisk sda --fstype=ext3 --label platform --align 1024
+
+ bootloader --timeout=0 --append="rootwait rootfstype=ext3 video=vesafb vga=0x318 console=tty0"
+
+
+ Finally, here's an example of the actual partition language
+ commands used to generate the mkefidisk image i.e. these are the
+ contents of the mkefidisk.wks OE kickstart file:
+
+ # short-description: Create an EFI disk image
+ # long-description: Creates a partitioned EFI disk image that the user
+ # can directly dd to boot media.
+
+ part /boot --source bootimg-efi --ondisk sda --fstype=efi --active
+
+ part / --source rootfs --ondisk sda --fstype=ext3 --label platform
+
+ part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+ bootloader --timeout=10 --append="rootwait console=ttyPCH0,115200"
+
+ You can get a complete listing and description of all the
+ kickstart commands available for use in .wks files from 'wic help
+ kickstart'.
+"""
+
+wic_kickstart_help = """
+
+NAME
+ wic kickstart - wic kickstart reference
+
+DESCRIPTION
+ This section provides the definitive reference to the wic
+ kickstart language. It also provides documentation on the list of
+ --source plugins available for use from the 'part' command (see
+ the 'Platform-specific Plugins' section below).
+
+ The current wic implementation supports only the basic kickstart
+ partitioning commands: partition (or part for short) and
+ bootloader.
+
+ The following is a listing of the commands, their syntax, and
+ meanings. The commands are based on the Fedora kickstart
+ documentation but with modifications to reflect wic capabilities.
+
+ http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition
+ http://fedoraproject.org/wiki/Anaconda/Kickstart#bootloader
+
+ Commands
+
+ * 'part' or 'partition'
+
+ This command creates a partition on the system and uses the
+ following syntax:
+
+ part [<mountpoint>]
+
+ The <mountpoint> is where the partition will be mounted and
+ must take of one of the following forms:
+
+ /<path>: For example: /, /usr, or /home
+
+ swap: The partition will be used as swap space.
+
+ If a <mountpoint> is not specified the partition will be created
+ but will not be mounted.
+
+ Partitions with a <mountpoint> specified will be automatically mounted.
+ This is achieved by wic adding entries to the fstab during image
+ generation. In order for a valid fstab to be generated one of the
+ --ondrive, --ondisk or --use-uuid partition options must be used for
+ each partition that specifies a mountpoint. Note that with --use-uuid
+ and non-root <mountpoint>, including swap, the mount program must
+ understand the PARTUUID syntax. This currently excludes the busybox
+ versions of these applications.
+
+
+ The following are supported 'part' options:
+
+ --size: The minimum partition size. Specify an integer value
+ such as 500. Multipliers k, M ang G can be used. If
+ not specified, the size is in MB.
+ You do not need this option if you use --source.
+
+ --fixed-size: Exact partition size. Value format is the same
+ as for --size option. This option cannot be
+ specified along with --size. If partition data
+ is larger than --fixed-size and error will be
+ raised when assembling disk image.
+
+ --source: This option is a wic-specific option that names the
+ source of the data that will populate the
+ partition. The most common value for this option
+ is 'rootfs', but can be any value which maps to a
+ valid 'source plugin' (see 'wic help plugins').
+
+ If '--source rootfs' is used, it tells the wic
+ command to create a partition as large as needed
+ and to fill it with the contents of the root
+ filesystem pointed to by the '-r' wic command-line
+ option (or the equivalent rootfs derived from the
+ '-e' command-line option). The filesystem type
+ that will be used to create the partition is driven
+ by the value of the --fstype option specified for
+ the partition (see --fstype below).
+
+ If --source <plugin-name>' is used, it tells the
+ wic command to create a partition as large as
+ needed and to fill with the contents of the
+ partition that will be generated by the specified
+ plugin name using the data pointed to by the '-r'
+ wic command-line option (or the equivalent rootfs
+ derived from the '-e' command-line option).
+ Exactly what those contents and filesystem type end
+ up being are dependent on the given plugin
+ implementation.
+
+ If --source option is not used, the wic command
+ will create empty partition. --size parameter has
+ to be used to specify size of empty partition.
+
+ --ondisk or --ondrive: Forces the partition to be created on
+ a particular disk.
+
+ --fstype: Sets the file system type for the partition. These
+ apply to partitions created using '--source rootfs' (see
+ --source above). Valid values are:
+
+ vfat
+ msdos
+ ext2
+ ext3
+ ext4
+ btrfs
+ squashfs
+ swap
+
+ --fsoptions: Specifies a free-form string of options to be
+ used when mounting the filesystem. This string
+ will be copied into the /etc/fstab file of the
+ installed system and should be enclosed in
+ quotes. If not specified, the default string is
+ "defaults".
+
+ --label label: Specifies the label to give to the filesystem
+ to be made on the partition. If the given
+ label is already in use by another filesystem,
+ a new label is created for the partition.
+
+ --active: Marks the partition as active.
+
+ --align (in KBytes): This option is specific to wic and says
+ to start a partition on an x KBytes
+ boundary.
+
+ --no-table: This option is specific to wic. Space will be
+ reserved for the partition and it will be
+ populated but it will not be added to the
+ partition table. It may be useful for
+ bootloaders.
+
+ --exclude-path: This option is specific to wic. It excludes the given
+ relative path from the resulting image. If the path
+ ends with a slash, only the content of the directory
+ is omitted, not the directory itself. This option only
+ has an effect with the rootfs source plugin.
+
+ --extra-space: This option is specific to wic. It adds extra
+ space after the space filled by the content
+ of the partition. The final size can go
+ beyond the size specified by --size.
+ By default, 10MB. This option cannot be used
+ with --fixed-size option.
+
+ --overhead-factor: This option is specific to wic. The
+ size of the partition is multiplied by
+ this factor. It has to be greater than or
+ equal to 1. The default value is 1.3.
+ This option cannot be used with --fixed-size
+ option.
+
+ --part-name: This option is specific to wic. It specifies name for GPT partitions.
+
+ --part-type: This option is specific to wic. It specifies partition
+ type GUID for GPT partitions.
+ List of partition type GUIDS can be found here:
+ http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
+
+ --use-uuid: This option is specific to wic. It makes wic to generate
+ random globally unique identifier (GUID) for the partition
+ and use it in bootloader configuration to specify root partition.
+
+ --uuid: This option is specific to wic. It specifies partition UUID.
+ It's useful if preconfigured partition UUID is added to kernel command line
+ in bootloader configuration before running wic. In this case .wks file can
+ be generated or modified to set preconfigured parition UUID using this option.
+
+ --fsuuid: This option is specific to wic. It specifies filesystem UUID.
+ It's useful if preconfigured filesystem UUID is added to kernel command line
+ in bootloader configuration before running wic. In this case .wks file can
+ be generated or modified to set preconfigured filesystem UUID using this option.
+
+ --system-id: This option is specific to wic. It specifies partition system id. It's useful
+ for the harware that requires non-default partition system ids. The parameter
+ in one byte long hex number either with 0x prefix or without it.
+
+ --mkfs-extraopts: This option specifies extra options to pass to mkfs utility.
+ NOTE, that wic uses default options for some filesystems, for example
+ '-S 512' for mkfs.fat or '-F -i 8192' for mkfs.ext. Those options will
+ not take effect when --mkfs-extraopts is used. This should be taken into
+ account when using --mkfs-extraopts.
+
+ * bootloader
+
+ This command allows the user to specify various bootloader
+ options. The following are supported 'bootloader' options:
+
+ --timeout: Specifies the number of seconds before the
+ bootloader times out and boots the default option.
+
+ --append: Specifies kernel parameters. These will be added to
+ bootloader command-line - for example, the syslinux
+ APPEND or grub kernel command line.
+
+ --configfile: Specifies a user defined configuration file for
+ the bootloader. This file must be located in the
+ canned-wks folder or could be the full path to the
+ file. Using this option will override any other
+ bootloader option.
+
+ Note that bootloader functionality and boot partitions are
+ implemented by the various --source plugins that implement
+ bootloader functionality; the bootloader command essentially
+ provides a means of modifying bootloader configuration.
+
+ * include
+
+ This command allows the user to include the content of .wks file
+ into original .wks file.
+
+ Command uses the following syntax:
+
+ include <file>
+
+ The <file> is either path to the file or its name. If name is
+ specified wic will try to find file in the directories with canned
+ .wks files.
+
+"""
+
+wic_help_help = """
+NAME
+ wic help - display a help topic
+
+DESCRIPTION
+ Specify a help topic to display it. Topics are shown above.
+"""
diff --git a/poky/scripts/lib/wic/ksparser.py b/poky/scripts/lib/wic/ksparser.py
new file mode 100644
index 000000000..e590b2fe3
--- /dev/null
+++ b/poky/scripts/lib/wic/ksparser.py
@@ -0,0 +1,235 @@
+#!/usr/bin/env python -tt
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2016 Intel, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; version 2 of the License
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# DESCRIPTION
+# This module provides parser for kickstart format
+#
+# AUTHORS
+# Ed Bartosh <ed.bartosh> (at] linux.intel.com>
+
+"""Kickstart parser module."""
+
+import os
+import shlex
+import logging
+
+from argparse import ArgumentParser, ArgumentError, ArgumentTypeError
+
+from wic.engine import find_canned
+from wic.partition import Partition
+
+logger = logging.getLogger('wic')
+
+class KickStartError(Exception):
+ """Custom exception."""
+ pass
+
+class KickStartParser(ArgumentParser):
+ """
+ This class overwrites error method to throw exception
+ instead of producing usage message(default argparse behavior).
+ """
+ def error(self, message):
+ raise ArgumentError(None, message)
+
+def sizetype(arg):
+ """
+ Custom type for ArgumentParser
+ Converts size string in <num>[K|k|M|G] format into the integer value
+ """
+ if arg.isdigit():
+ return int(arg) * 1024
+
+ if not arg[:-1].isdigit():
+ raise ArgumentTypeError("Invalid size: %r" % arg)
+
+ size = int(arg[:-1])
+ if arg.endswith("k") or arg.endswith("K"):
+ return size
+ if arg.endswith("M"):
+ return size * 1024
+ if arg.endswith("G"):
+ return size * 1024 * 1024
+
+ raise ArgumentTypeError("Invalid size: %r" % arg)
+
+def overheadtype(arg):
+ """
+ Custom type for ArgumentParser
+ Converts overhead string to float and checks if it's bigger than 1.0
+ """
+ try:
+ result = float(arg)
+ except ValueError:
+ raise ArgumentTypeError("Invalid value: %r" % arg)
+
+ if result < 1.0:
+ raise ArgumentTypeError("Overhead factor should be > 1.0" % arg)
+
+ return result
+
+def cannedpathtype(arg):
+ """
+ Custom type for ArgumentParser
+ Tries to find file in the list of canned wks paths
+ """
+ scripts_path = os.path.abspath(os.path.dirname(__file__) + '../../..')
+ result = find_canned(scripts_path, arg)
+ if not result:
+ raise ArgumentTypeError("file not found: %s" % arg)
+ return result
+
+def systemidtype(arg):
+ """
+ Custom type for ArgumentParser
+ Checks if the argument sutisfies system id requirements,
+ i.e. if it's one byte long integer > 0
+ """
+ error = "Invalid system type: %s. must be hex "\
+ "between 0x1 and 0xFF" % arg
+ try:
+ result = int(arg, 16)
+ except ValueError:
+ raise ArgumentTypeError(error)
+
+ if result <= 0 or result > 0xff:
+ raise ArgumentTypeError(error)
+
+ return arg
+
+class KickStart():
+ """Kickstart parser implementation."""
+
+ DEFAULT_EXTRA_SPACE = 10*1024
+ DEFAULT_OVERHEAD_FACTOR = 1.3
+
+ def __init__(self, confpath):
+
+ self.partitions = []
+ self.bootloader = None
+ self.lineno = 0
+ self.partnum = 0
+
+ parser = KickStartParser()
+ subparsers = parser.add_subparsers()
+
+ part = subparsers.add_parser('part')
+ part.add_argument('mountpoint', nargs='?')
+ part.add_argument('--active', action='store_true')
+ part.add_argument('--align', type=int)
+ part.add_argument('--exclude-path', nargs='+')
+ part.add_argument("--extra-space", type=sizetype)
+ part.add_argument('--fsoptions', dest='fsopts')
+ part.add_argument('--fstype', default='vfat',
+ choices=('ext2', 'ext3', 'ext4', 'btrfs',
+ 'squashfs', 'vfat', 'msdos', 'swap'))
+ part.add_argument('--mkfs-extraopts', default='')
+ part.add_argument('--label')
+ part.add_argument('--no-table', action='store_true')
+ part.add_argument('--ondisk', '--ondrive', dest='disk', default='sda')
+ part.add_argument("--overhead-factor", type=overheadtype)
+ part.add_argument('--part-name')
+ part.add_argument('--part-type')
+ part.add_argument('--rootfs-dir')
+
+ # --size and --fixed-size cannot be specified together; options
+ # ----extra-space and --overhead-factor should also raise a parser
+ # --error, but since nesting mutually exclusive groups does not work,
+ # ----extra-space/--overhead-factor are handled later
+ sizeexcl = part.add_mutually_exclusive_group()
+ sizeexcl.add_argument('--size', type=sizetype, default=0)
+ sizeexcl.add_argument('--fixed-size', type=sizetype, default=0)
+
+ part.add_argument('--source')
+ part.add_argument('--sourceparams')
+ part.add_argument('--system-id', type=systemidtype)
+ part.add_argument('--use-uuid', action='store_true')
+ part.add_argument('--uuid')
+ part.add_argument('--fsuuid')
+
+ bootloader = subparsers.add_parser('bootloader')
+ bootloader.add_argument('--append')
+ bootloader.add_argument('--configfile')
+ bootloader.add_argument('--ptable', choices=('msdos', 'gpt'),
+ default='msdos')
+ bootloader.add_argument('--timeout', type=int)
+ bootloader.add_argument('--source')
+
+ include = subparsers.add_parser('include')
+ include.add_argument('path', type=cannedpathtype)
+
+ self._parse(parser, confpath)
+ if not self.bootloader:
+ logger.warning('bootloader config not specified, using defaults\n')
+ self.bootloader = bootloader.parse_args([])
+
+ def _parse(self, parser, confpath):
+ """
+ Parse file in .wks format using provided parser.
+ """
+ with open(confpath) as conf:
+ lineno = 0
+ for line in conf:
+ line = line.strip()
+ lineno += 1
+ if line and line[0] != '#':
+ try:
+ line_args = shlex.split(line)
+ parsed = parser.parse_args(line_args)
+ except ArgumentError as err:
+ raise KickStartError('%s:%d: %s' % \
+ (confpath, lineno, err))
+ if line.startswith('part'):
+ # SquashFS does not support UUID
+ if parsed.fstype == 'squashfs' and parsed.use_uuid:
+ err = "%s:%d: SquashFS does not support UUID" \
+ % (confpath, lineno)
+ raise KickStartError(err)
+ # using ArgumentParser one cannot easily tell if option
+ # was passed as argument, if said option has a default
+ # value; --overhead-factor/--extra-space cannot be used
+ # with --fixed-size, so at least detect when these were
+ # passed with non-0 values ...
+ if parsed.fixed_size:
+ if parsed.overhead_factor or parsed.extra_space:
+ err = "%s:%d: arguments --overhead-factor and --extra-space not "\
+ "allowed with argument --fixed-size" \
+ % (confpath, lineno)
+ raise KickStartError(err)
+ else:
+ # ... and provide defaults if not using
+ # --fixed-size iff given option was not used
+ # (again, one cannot tell if option was passed but
+ # with value equal to 0)
+ if '--overhead-factor' not in line_args:
+ parsed.overhead_factor = self.DEFAULT_OVERHEAD_FACTOR
+ if '--extra-space' not in line_args:
+ parsed.extra_space = self.DEFAULT_EXTRA_SPACE
+
+ self.partnum += 1
+ self.partitions.append(Partition(parsed, self.partnum))
+ elif line.startswith('include'):
+ self._parse(parser, parsed.path)
+ elif line.startswith('bootloader'):
+ if not self.bootloader:
+ self.bootloader = parsed
+ else:
+ err = "%s:%d: more than one bootloader specified" \
+ % (confpath, lineno)
+ raise KickStartError(err)
diff --git a/poky/scripts/lib/wic/misc.py b/poky/scripts/lib/wic/misc.py
new file mode 100644
index 000000000..ee888b478
--- /dev/null
+++ b/poky/scripts/lib/wic/misc.py
@@ -0,0 +1,263 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This module provides a place to collect various wic-related utils
+# for the OpenEmbedded Image Tools.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+"""Miscellaneous functions."""
+
+import logging
+import os
+import re
+import subprocess
+
+from collections import defaultdict
+from distutils import spawn
+
+from wic import WicError
+
+logger = logging.getLogger('wic')
+
+# executable -> recipe pairs for exec_native_cmd
+NATIVE_RECIPES = {"bmaptool": "bmap-tools",
+ "grub-mkimage": "grub-efi",
+ "isohybrid": "syslinux",
+ "mcopy": "mtools",
+ "mdel" : "mtools",
+ "mdeltree" : "mtools",
+ "mdir" : "mtools",
+ "mkdosfs": "dosfstools",
+ "mkisofs": "cdrtools",
+ "mkfs.btrfs": "btrfs-tools",
+ "mkfs.ext2": "e2fsprogs",
+ "mkfs.ext3": "e2fsprogs",
+ "mkfs.ext4": "e2fsprogs",
+ "mkfs.vfat": "dosfstools",
+ "mksquashfs": "squashfs-tools",
+ "mkswap": "util-linux",
+ "mmd": "mtools",
+ "parted": "parted",
+ "sfdisk": "util-linux",
+ "sgdisk": "gptfdisk",
+ "syslinux": "syslinux"
+ }
+
+def runtool(cmdln_or_args):
+ """ wrapper for most of the subprocess calls
+ input:
+ cmdln_or_args: can be both args and cmdln str (shell=True)
+ return:
+ rc, output
+ """
+ if isinstance(cmdln_or_args, list):
+ cmd = cmdln_or_args[0]
+ shell = False
+ else:
+ import shlex
+ cmd = shlex.split(cmdln_or_args)[0]
+ shell = True
+
+ sout = subprocess.PIPE
+ serr = subprocess.STDOUT
+
+ try:
+ process = subprocess.Popen(cmdln_or_args, stdout=sout,
+ stderr=serr, shell=shell)
+ sout, serr = process.communicate()
+ # combine stdout and stderr, filter None out and decode
+ out = ''.join([out.decode('utf-8') for out in [sout, serr] if out])
+ except OSError as err:
+ if err.errno == 2:
+ # [Errno 2] No such file or directory
+ raise WicError('Cannot run command: %s, lost dependency?' % cmd)
+ else:
+ raise # relay
+
+ return process.returncode, out
+
+def _exec_cmd(cmd_and_args, as_shell=False):
+ """
+ Execute command, catching stderr, stdout
+
+ Need to execute as_shell if the command uses wildcards
+ """
+ logger.debug("_exec_cmd: %s", cmd_and_args)
+ args = cmd_and_args.split()
+ logger.debug(args)
+
+ if as_shell:
+ ret, out = runtool(cmd_and_args)
+ else:
+ ret, out = runtool(args)
+ out = out.strip()
+ if ret != 0:
+ raise WicError("_exec_cmd: %s returned '%s' instead of 0\noutput: %s" % \
+ (cmd_and_args, ret, out))
+
+ logger.debug("_exec_cmd: output for %s (rc = %d): %s",
+ cmd_and_args, ret, out)
+
+ return ret, out
+
+
+def exec_cmd(cmd_and_args, as_shell=False):
+ """
+ Execute command, return output
+ """
+ return _exec_cmd(cmd_and_args, as_shell)[1]
+
+
+def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""):
+ """
+ Execute native command, catching stderr, stdout
+
+ Need to execute as_shell if the command uses wildcards
+
+ Always need to execute native commands as_shell
+ """
+ # The reason -1 is used is because there may be "export" commands.
+ args = cmd_and_args.split(';')[-1].split()
+ logger.debug(args)
+
+ if pseudo:
+ cmd_and_args = pseudo + cmd_and_args
+
+ native_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \
+ (native_sysroot, native_sysroot, native_sysroot)
+
+ native_cmd_and_args = "export PATH=%s:$PATH;%s" % \
+ (native_paths, cmd_and_args)
+ logger.debug("exec_native_cmd: %s", native_cmd_and_args)
+
+ # If the command isn't in the native sysroot say we failed.
+ if spawn.find_executable(args[0], native_paths):
+ ret, out = _exec_cmd(native_cmd_and_args, True)
+ else:
+ ret = 127
+ out = "can't find native executable %s in %s" % (args[0], native_paths)
+
+ prog = args[0]
+ # shell command-not-found
+ if ret == 127 \
+ or (pseudo and ret == 1 and out == "Can't find '%s' in $PATH." % prog):
+ msg = "A native program %s required to build the image "\
+ "was not found (see details above).\n\n" % prog
+ recipe = NATIVE_RECIPES.get(prog)
+ if recipe:
+ msg += "Please make sure wic-tools have %s-native in its DEPENDS, "\
+ "build it with 'bitbake wic-tools' and try again.\n" % recipe
+ else:
+ msg += "Wic failed to find a recipe to build native %s. Please "\
+ "file a bug against wic.\n" % prog
+ raise WicError(msg)
+
+ return ret, out
+
+BOOTDD_EXTRA_SPACE = 16384
+
+class BitbakeVars(defaultdict):
+ """
+ Container for Bitbake variables.
+ """
+ def __init__(self):
+ defaultdict.__init__(self, dict)
+
+ # default_image and vars_dir attributes should be set from outside
+ self.default_image = None
+ self.vars_dir = None
+
+ def _parse_line(self, line, image, matcher=re.compile(r"^([a-zA-Z0-9\-_+./~]+)=(.*)")):
+ """
+ Parse one line from bitbake -e output or from .env file.
+ Put result key-value pair into the storage.
+ """
+ if "=" not in line:
+ return
+ match = matcher.match(line)
+ if not match:
+ return
+ key, val = match.groups()
+ self[image][key] = val.strip('"')
+
+ def get_var(self, var, image=None, cache=True):
+ """
+ Get bitbake variable from 'bitbake -e' output or from .env file.
+ This is a lazy method, i.e. it runs bitbake or parses file only when
+ only when variable is requested. It also caches results.
+ """
+ if not image:
+ image = self.default_image
+
+ if image not in self:
+ if image and self.vars_dir:
+ fname = os.path.join(self.vars_dir, image + '.env')
+ if os.path.isfile(fname):
+ # parse .env file
+ with open(fname) as varsfile:
+ for line in varsfile:
+ self._parse_line(line, image)
+ else:
+ print("Couldn't get bitbake variable from %s." % fname)
+ print("File %s doesn't exist." % fname)
+ return
+ else:
+ # Get bitbake -e output
+ cmd = "bitbake -e"
+ if image:
+ cmd += " %s" % image
+
+ log_level = logger.getEffectiveLevel()
+ logger.setLevel(logging.INFO)
+ ret, lines = _exec_cmd(cmd)
+ logger.setLevel(log_level)
+
+ if ret:
+ logger.error("Couldn't get '%s' output.", cmd)
+ logger.error("Bitbake failed with error:\n%s\n", lines)
+ return
+
+ # Parse bitbake -e output
+ for line in lines.split('\n'):
+ self._parse_line(line, image)
+
+ # Make first image a default set of variables
+ if cache:
+ images = [key for key in self if key]
+ if len(images) == 1:
+ self[None] = self[image]
+
+ result = self[image].get(var)
+ if not cache:
+ self.pop(image, None)
+
+ return result
+
+# Create BB_VARS singleton
+BB_VARS = BitbakeVars()
+
+def get_bitbake_var(var, image=None, cache=True):
+ """
+ Provide old get_bitbake_var API by wrapping
+ get_var method of BB_VARS singleton.
+ """
+ return BB_VARS.get_var(var, image, cache)
diff --git a/poky/scripts/lib/wic/partition.py b/poky/scripts/lib/wic/partition.py
new file mode 100644
index 000000000..3fe5c4e26
--- /dev/null
+++ b/poky/scripts/lib/wic/partition.py
@@ -0,0 +1,425 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013-2016 Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This module provides the OpenEmbedded partition object definitions.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+# Ed Bartosh <ed.bartosh> (at] linux.intel.com>
+
+import logging
+import os
+import uuid
+
+from wic import WicError
+from wic.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+from wic.pluginbase import PluginMgr
+
+logger = logging.getLogger('wic')
+
+class Partition():
+
+ def __init__(self, args, lineno):
+ self.args = args
+ self.active = args.active
+ self.align = args.align
+ self.disk = args.disk
+ self.device = None
+ self.extra_space = args.extra_space
+ self.exclude_path = args.exclude_path
+ self.fsopts = args.fsopts
+ self.fstype = args.fstype
+ self.label = args.label
+ self.mkfs_extraopts = args.mkfs_extraopts
+ self.mountpoint = args.mountpoint
+ self.no_table = args.no_table
+ self.num = None
+ self.overhead_factor = args.overhead_factor
+ self.part_name = args.part_name
+ self.part_type = args.part_type
+ self.rootfs_dir = args.rootfs_dir
+ self.size = args.size
+ self.fixed_size = args.fixed_size
+ self.source = args.source
+ self.sourceparams = args.sourceparams
+ self.system_id = args.system_id
+ self.use_uuid = args.use_uuid
+ self.uuid = args.uuid
+ self.fsuuid = args.fsuuid
+
+ self.lineno = lineno
+ self.source_file = ""
+ self.sourceparams_dict = {}
+
+ def get_extra_block_count(self, current_blocks):
+ """
+ The --size param is reflected in self.size (in kB), and we already
+ have current_blocks (1k) blocks, calculate and return the
+ number of (1k) blocks we need to add to get to --size, 0 if
+ we're already there or beyond.
+ """
+ logger.debug("Requested partition size for %s: %d",
+ self.mountpoint, self.size)
+
+ if not self.size:
+ return 0
+
+ requested_blocks = self.size
+
+ logger.debug("Requested blocks %d, current_blocks %d",
+ requested_blocks, current_blocks)
+
+ if requested_blocks > current_blocks:
+ return requested_blocks - current_blocks
+ else:
+ return 0
+
+ def get_rootfs_size(self, actual_rootfs_size=0):
+ """
+ Calculate the required size of rootfs taking into consideration
+ --size/--fixed-size flags as well as overhead and extra space, as
+ specified in kickstart file. Raises an error if the
+ `actual_rootfs_size` is larger than fixed-size rootfs.
+
+ """
+ if self.fixed_size:
+ rootfs_size = self.fixed_size
+ if actual_rootfs_size > rootfs_size:
+ raise WicError("Actual rootfs size (%d kB) is larger than "
+ "allowed size %d kB" %
+ (actual_rootfs_size, rootfs_size))
+ else:
+ extra_blocks = self.get_extra_block_count(actual_rootfs_size)
+ if extra_blocks < self.extra_space:
+ extra_blocks = self.extra_space
+
+ rootfs_size = actual_rootfs_size + extra_blocks
+ rootfs_size *= self.overhead_factor
+
+ logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+ extra_blocks, self.mountpoint, rootfs_size)
+
+ return rootfs_size
+
+ @property
+ def disk_size(self):
+ """
+ Obtain on-disk size of partition taking into consideration
+ --size/--fixed-size options.
+
+ """
+ return self.fixed_size if self.fixed_size else self.size
+
+ def prepare(self, creator, cr_workdir, oe_builddir, rootfs_dir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Prepare content for individual partitions, depending on
+ partition command parameters.
+ """
+ if not self.source:
+ if not self.size and not self.fixed_size:
+ raise WicError("The %s partition has a size of zero. Please "
+ "specify a non-zero --size/--fixed-size for that "
+ "partition." % self.mountpoint)
+
+ if self.fstype == "swap":
+ self.prepare_swap_partition(cr_workdir, oe_builddir,
+ native_sysroot)
+ self.source_file = "%s/fs.%s" % (cr_workdir, self.fstype)
+ else:
+ if self.fstype == 'squashfs':
+ raise WicError("It's not possible to create empty squashfs "
+ "partition '%s'" % (self.mountpoint))
+
+ rootfs = "%s/fs_%s.%s.%s" % (cr_workdir, self.label,
+ self.lineno, self.fstype)
+ if os.path.isfile(rootfs):
+ os.remove(rootfs)
+
+ prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+ method = getattr(self, "prepare_empty_partition_" + prefix)
+ method(rootfs, oe_builddir, native_sysroot)
+ self.source_file = rootfs
+ return
+
+ plugins = PluginMgr.get_plugins('source')
+
+ if self.source not in plugins:
+ raise WicError("The '%s' --source specified for %s doesn't exist.\n\t"
+ "See 'wic list source-plugins' for a list of available"
+ " --sources.\n\tSee 'wic help source-plugins' for "
+ "details on adding a new source plugin." %
+ (self.source, self.mountpoint))
+
+ srcparams_dict = {}
+ if self.sourceparams:
+ # Split sourceparams string of the form key1=val1[,key2=val2,...]
+ # into a dict. Also accepts valueless keys i.e. without =
+ splitted = self.sourceparams.split(',')
+ srcparams_dict = dict(par.split('=') for par in splitted if par)
+
+ plugin = PluginMgr.get_plugins('source')[self.source]
+ plugin.do_configure_partition(self, srcparams_dict, creator,
+ cr_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, native_sysroot)
+ plugin.do_stage_partition(self, srcparams_dict, creator,
+ cr_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, native_sysroot)
+ plugin.do_prepare_partition(self, srcparams_dict, creator,
+ cr_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, rootfs_dir, native_sysroot)
+ plugin.do_post_partition(self, srcparams_dict, creator,
+ cr_workdir, oe_builddir, bootimg_dir,
+ kernel_dir, rootfs_dir, native_sysroot)
+
+ # further processing required Partition.size to be an integer, make
+ # sure that it is one
+ if not isinstance(self.size, int):
+ raise WicError("Partition %s internal size is not an integer. "
+ "This a bug in source plugin %s and needs to be fixed." %
+ (self.mountpoint, self.source))
+
+ if self.fixed_size and self.size > self.fixed_size:
+ raise WicError("File system image of partition %s is "
+ "larger (%d kB) than its allowed size %d kB" %
+ (self.mountpoint, self.size, self.fixed_size))
+
+ def prepare_rootfs(self, cr_workdir, oe_builddir, rootfs_dir,
+ native_sysroot, real_rootfs = True):
+ """
+ Prepare content for a rootfs partition i.e. create a partition
+ and fill it from a /rootfs dir.
+
+ Currently handles ext2/3/4, btrfs, vfat and squashfs.
+ """
+ p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot)
+ p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR",
+ "%s/../pseudo" % get_bitbake_var("IMAGE_ROOTFS"))
+ p_passwd = os.environ.get("PSEUDO_PASSWD", rootfs_dir)
+ p_nosymlinkexp = os.environ.get("PSEUDO_NOSYMLINKEXP", "1")
+ pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix
+ pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % p_localstatedir
+ pseudo += "export PSEUDO_PASSWD=%s;" % p_passwd
+ pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp
+ pseudo += "%s " % get_bitbake_var("FAKEROOTCMD")
+
+ rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label,
+ self.lineno, self.fstype)
+ if os.path.isfile(rootfs):
+ os.remove(rootfs)
+
+ # Get rootfs size from bitbake variable if it's not set in .ks file
+ if not self.size and real_rootfs:
+ # Bitbake variable ROOTFS_SIZE is calculated in
+ # Image._get_rootfs_size method from meta/lib/oe/image.py
+ # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
+ # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
+ rsize_bb = get_bitbake_var('ROOTFS_SIZE')
+ if rsize_bb:
+ logger.warning('overhead-factor was specified, but size was not,'
+ ' so bitbake variables will be used for the size.'
+ ' In this case both IMAGE_OVERHEAD_FACTOR and '
+ '--overhead-factor will be applied')
+ self.size = int(round(float(rsize_bb)))
+
+ prefix = "ext" if self.fstype.startswith("ext") else self.fstype
+ method = getattr(self, "prepare_rootfs_" + prefix)
+ method(rootfs, oe_builddir, rootfs_dir, native_sysroot, pseudo)
+ self.source_file = rootfs
+
+ # get the rootfs size in the right units for kickstart (kB)
+ du_cmd = "du -Lbks %s" % rootfs
+ out = exec_cmd(du_cmd)
+ self.size = int(out.split()[0])
+
+ def prepare_rootfs_ext(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for an ext2/3/4 rootfs partition.
+ """
+ du_cmd = "du -ks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ actual_rootfs_size = int(out.split()[0])
+
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
+
+ with open(rootfs, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+
+ extraopts = self.mkfs_extraopts or "-F -i 8192"
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s %s %s %s -U %s -d %s" % \
+ (self.fstype, extraopts, rootfs, label_str, self.fsuuid, rootfs_dir)
+ exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
+
+ mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
+
+ def prepare_rootfs_btrfs(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for a btrfs rootfs partition.
+ """
+ du_cmd = "du -ks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ actual_rootfs_size = int(out.split()[0])
+
+ rootfs_size = self.get_rootfs_size(actual_rootfs_size)
+
+ with open(rootfs, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), rootfs_size * 1024)
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -b %d -r %s %s %s -U %s %s" % \
+ (self.fstype, rootfs_size * 1024, rootfs_dir, label_str,
+ self.mkfs_extraopts, self.fsuuid, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
+
+ def prepare_rootfs_msdos(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for a msdos/vfat rootfs partition.
+ """
+ du_cmd = "du -bks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ blocks = int(out.split()[0])
+
+ rootfs_size = self.get_rootfs_size(blocks)
+
+ label_str = "-n boot"
+ if self.label:
+ label_str = "-n %s" % self.label
+
+ size_str = ""
+ if self.fstype == 'msdos':
+ size_str = "-F 16" # FAT 16
+
+ extraopts = self.mkfs_extraopts or '-S 512'
+
+ dosfs_cmd = "mkdosfs %s -i %s %s %s -C %s %d" % \
+ (label_str, self.fsuuid, size_str, extraopts, rootfs,
+ max(8250, rootfs_size))
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir)
+ exec_native_cmd(mcopy_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % rootfs
+ exec_cmd(chmod_cmd)
+
+ prepare_rootfs_vfat = prepare_rootfs_msdos
+
+ def prepare_rootfs_squashfs(self, rootfs, oe_builddir, rootfs_dir,
+ native_sysroot, pseudo):
+ """
+ Prepare content for a squashfs rootfs partition.
+ """
+ extraopts = self.mkfs_extraopts or '-noappend'
+ squashfs_cmd = "mksquashfs %s %s %s" % \
+ (rootfs_dir, rootfs, extraopts)
+ exec_native_cmd(squashfs_cmd, native_sysroot, pseudo=pseudo)
+
+ def prepare_empty_partition_ext(self, rootfs, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty ext2/3/4 partition.
+ """
+ size = self.disk_size
+ with open(rootfs, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), size * 1024)
+
+ extraopts = self.mkfs_extraopts or "-i 8192"
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -F %s %s -U %s %s" % \
+ (self.fstype, extraopts, label_str, self.fsuuid, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot)
+
+ def prepare_empty_partition_btrfs(self, rootfs, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty btrfs partition.
+ """
+ size = self.disk_size
+ with open(rootfs, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), size * 1024)
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkfs_cmd = "mkfs.%s -b %d %s -U %s %s %s" % \
+ (self.fstype, self.size * 1024, label_str, self.fsuuid,
+ self.mkfs_extraopts, rootfs)
+ exec_native_cmd(mkfs_cmd, native_sysroot)
+
+ def prepare_empty_partition_msdos(self, rootfs, oe_builddir,
+ native_sysroot):
+ """
+ Prepare an empty vfat partition.
+ """
+ blocks = self.disk_size
+
+ label_str = "-n boot"
+ if self.label:
+ label_str = "-n %s" % self.label
+
+ size_str = ""
+ if self.fstype == 'msdos':
+ size_str = "-F 16" # FAT 16
+
+ extraopts = self.mkfs_extraopts or '-S 512'
+
+ dosfs_cmd = "mkdosfs %s -i %s %s %s -C %s %d" % \
+ (label_str, self.fsuuid, extraopts, size_str, rootfs,
+ blocks)
+
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % rootfs
+ exec_cmd(chmod_cmd)
+
+ prepare_empty_partition_vfat = prepare_empty_partition_msdos
+
+ def prepare_swap_partition(self, cr_workdir, oe_builddir, native_sysroot):
+ """
+ Prepare a swap partition.
+ """
+ path = "%s/fs.%s" % (cr_workdir, self.fstype)
+
+ with open(path, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), self.size * 1024)
+
+ label_str = ""
+ if self.label:
+ label_str = "-L %s" % self.label
+
+ mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path)
+ exec_native_cmd(mkswap_cmd, native_sysroot)
diff --git a/poky/scripts/lib/wic/pluginbase.py b/poky/scripts/lib/wic/pluginbase.py
new file mode 100644
index 000000000..686d2fee3
--- /dev/null
+++ b/poky/scripts/lib/wic/pluginbase.py
@@ -0,0 +1,149 @@
+#!/usr/bin/env python -tt
+#
+# Copyright (c) 2011 Intel, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; version 2 of the License
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+__all__ = ['ImagerPlugin', 'SourcePlugin']
+
+import os
+import logging
+
+from collections import defaultdict
+from importlib.machinery import SourceFileLoader
+
+from wic import WicError
+from wic.misc import get_bitbake_var
+
+PLUGIN_TYPES = ["imager", "source"]
+
+SCRIPTS_PLUGIN_DIR = "scripts/lib/wic/plugins"
+
+logger = logging.getLogger('wic')
+
+PLUGINS = defaultdict(dict)
+
+class PluginMgr:
+ _plugin_dirs = []
+
+ @classmethod
+ def get_plugins(cls, ptype):
+ """Get dictionary of <plugin_name>:<class> pairs."""
+ if ptype not in PLUGIN_TYPES:
+ raise WicError('%s is not valid plugin type' % ptype)
+
+ # collect plugin directories
+ if not cls._plugin_dirs:
+ cls._plugin_dirs = [os.path.join(os.path.dirname(__file__), 'plugins')]
+ layers = get_bitbake_var("BBLAYERS") or ''
+ for layer_path in layers.split():
+ path = os.path.join(layer_path, SCRIPTS_PLUGIN_DIR)
+ path = os.path.abspath(os.path.expanduser(path))
+ if path not in cls._plugin_dirs and os.path.isdir(path):
+ cls._plugin_dirs.insert(0, path)
+
+ if ptype not in PLUGINS:
+ # load all ptype plugins
+ for pdir in cls._plugin_dirs:
+ ppath = os.path.join(pdir, ptype)
+ if os.path.isdir(ppath):
+ for fname in os.listdir(ppath):
+ if fname.endswith('.py'):
+ mname = fname[:-3]
+ mpath = os.path.join(ppath, fname)
+ logger.debug("loading plugin module %s", mpath)
+ SourceFileLoader(mname, mpath).load_module()
+
+ return PLUGINS.get(ptype)
+
+class PluginMeta(type):
+ def __new__(cls, name, bases, attrs):
+ class_type = type.__new__(cls, name, bases, attrs)
+ if 'name' in attrs:
+ PLUGINS[class_type.wic_plugin_type][attrs['name']] = class_type
+
+ return class_type
+
+class ImagerPlugin(metaclass=PluginMeta):
+ wic_plugin_type = "imager"
+
+ def do_create(self):
+ raise WicError("Method %s.do_create is not implemented" %
+ self.__class__.__name__)
+
+class SourcePlugin(metaclass=PluginMeta):
+ wic_plugin_type = "source"
+ """
+ The methods that can be implemented by --source plugins.
+
+ Any methods not implemented in a subclass inherit these.
+ """
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. This provides a hook to allow finalization of a
+ disk image e.g. to write an MBR to it.
+ """
+ logger.debug("SourcePlugin: do_install_disk: disk: %s", disk_name)
+
+ @classmethod
+ def do_stage_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Special content staging hook called before do_prepare_partition(),
+ normally empty.
+
+ Typically, a partition will just use the passed-in parame e.g
+ straight bootimg_dir, etc, but in some cases, things need to
+ be more tailored e.g. to use a deploy dir + /boot, etc. This
+ hook allows those files to be staged in a customized fashion.
+ Not that get_bitbake_var() allows you to acces non-standard
+ variables that you might want to use for this.
+ """
+ logger.debug("SourcePlugin: do_stage_partition: part: %s", part)
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(), typically used to create
+ custom configuration files for a partition, for example
+ syslinux or grub config files.
+ """
+ logger.debug("SourcePlugin: do_configure_partition: part: %s", part)
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir, rootfs_dir,
+ native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ """
+ logger.debug("SourcePlugin: do_prepare_partition: part: %s", part)
+
+ @classmethod
+ def do_post_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir, rootfs_dir,
+ native_sysroot):
+ """
+ Called after the partition is created. It is useful to add post
+ operations e.g. security signing the partition.
+ """
+ logger.debug("SourcePlugin: do_post_partition: part: %s", part)
diff --git a/poky/scripts/lib/wic/plugins/imager/direct.py b/poky/scripts/lib/wic/plugins/imager/direct.py
new file mode 100644
index 000000000..1fa6b917e
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/imager/direct.py
@@ -0,0 +1,607 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'direct' imager plugin class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import logging
+import os
+import random
+import shutil
+import tempfile
+import uuid
+
+from time import strftime
+
+from oe.path import copyhardlinktree
+
+from wic import WicError
+from wic.filemap import sparse_copy
+from wic.ksparser import KickStart, KickStartError
+from wic.pluginbase import PluginMgr, ImagerPlugin
+from wic.misc import get_bitbake_var, exec_cmd, exec_native_cmd
+
+logger = logging.getLogger('wic')
+
+class DirectPlugin(ImagerPlugin):
+ """
+ Install a system into a file containing a partitioned disk image.
+
+ An image file is formatted with a partition table, each partition
+ created from a rootfs or other OpenEmbedded build artifact and dd'ed
+ into the virtual disk. The disk image can subsequently be dd'ed onto
+ media and used on actual hardware.
+ """
+ name = 'direct'
+
+ def __init__(self, wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, oe_builddir, options):
+ try:
+ self.ks = KickStart(wks_file)
+ except KickStartError as err:
+ raise WicError(str(err))
+
+ # parse possible 'rootfs=name' items
+ self.rootfs_dir = dict(rdir.split('=') for rdir in rootfs_dir.split(' '))
+ self.replaced_rootfs_paths = {}
+ self.bootimg_dir = bootimg_dir
+ self.kernel_dir = kernel_dir
+ self.native_sysroot = native_sysroot
+ self.oe_builddir = oe_builddir
+
+ self.outdir = options.outdir
+ self.compressor = options.compressor
+ self.bmap = options.bmap
+ self.no_fstab_update = options.no_fstab_update
+
+ self.name = "%s-%s" % (os.path.splitext(os.path.basename(wks_file))[0],
+ strftime("%Y%m%d%H%M"))
+ self.workdir = tempfile.mkdtemp(dir=self.outdir, prefix='tmp.wic.')
+ self._image = None
+ self.ptable_format = self.ks.bootloader.ptable
+ self.parts = self.ks.partitions
+
+ # as a convenience, set source to the boot partition source
+ # instead of forcing it to be set via bootloader --source
+ for part in self.parts:
+ if not self.ks.bootloader.source and part.mountpoint == "/boot":
+ self.ks.bootloader.source = part.source
+ break
+
+ image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
+ self._image = PartitionedImage(image_path, self.ptable_format,
+ self.parts, self.native_sysroot)
+
+ def do_create(self):
+ """
+ Plugin entry point.
+ """
+ try:
+ self.create()
+ self.assemble()
+ self.finalize()
+ self.print_info()
+ finally:
+ self.cleanup()
+
+ def _write_fstab(self, image_rootfs):
+ """overriden to generate fstab (temporarily) in rootfs. This is called
+ from _create, make sure it doesn't get called from
+ BaseImage.create()
+ """
+ if not image_rootfs:
+ return
+
+ fstab_path = image_rootfs + "/etc/fstab"
+ if not os.path.isfile(fstab_path):
+ return
+
+ with open(fstab_path) as fstab:
+ fstab_lines = fstab.readlines()
+
+ if self._update_fstab(fstab_lines, self.parts):
+ # copy rootfs dir to workdir to update fstab
+ # as rootfs can be used by other tasks and can't be modified
+ new_rootfs = os.path.realpath(os.path.join(self.workdir, "rootfs_copy"))
+ copyhardlinktree(image_rootfs, new_rootfs)
+ fstab_path = os.path.join(new_rootfs, 'etc/fstab')
+
+ os.unlink(fstab_path)
+
+ with open(fstab_path, "w") as fstab:
+ fstab.writelines(fstab_lines)
+
+ return new_rootfs
+
+ def _update_fstab(self, fstab_lines, parts):
+ """Assume partition order same as in wks"""
+ updated = False
+ for part in parts:
+ if not part.realnum or not part.mountpoint \
+ or part.mountpoint == "/":
+ continue
+
+ if part.use_uuid:
+ if part.fsuuid:
+ # FAT UUID is different from others
+ if len(part.fsuuid) == 10:
+ device_name = "UUID=%s-%s" % \
+ (part.fsuuid[2:6], part.fsuuid[6:])
+ else:
+ device_name = "UUID=%s" % part.fsuuid
+ else:
+ device_name = "PARTUUID=%s" % part.uuid
+ else:
+ # mmc device partitions are named mmcblk0p1, mmcblk0p2..
+ prefix = 'p' if part.disk.startswith('mmcblk') else ''
+ device_name = "/dev/%s%s%d" % (part.disk, prefix, part.realnum)
+
+ opts = part.fsopts if part.fsopts else "defaults"
+ line = "\t".join([device_name, part.mountpoint, part.fstype,
+ opts, "0", "0"]) + "\n"
+
+ fstab_lines.append(line)
+ updated = True
+
+ return updated
+
+ def _full_path(self, path, name, extention):
+ """ Construct full file path to a file we generate. """
+ return os.path.join(path, "%s-%s.%s" % (self.name, name, extention))
+
+ #
+ # Actual implemention
+ #
+ def create(self):
+ """
+ For 'wic', we already have our build artifacts - we just create
+ filesystems from the artifacts directly and combine them into
+ a partitioned image.
+ """
+ if self.no_fstab_update:
+ new_rootfs = None
+ else:
+ new_rootfs = self._write_fstab(self.rootfs_dir.get("ROOTFS_DIR"))
+ if new_rootfs:
+ # rootfs was copied to update fstab
+ self.replaced_rootfs_paths[new_rootfs] = self.rootfs_dir['ROOTFS_DIR']
+ self.rootfs_dir['ROOTFS_DIR'] = new_rootfs
+
+ for part in self.parts:
+ # get rootfs size from bitbake variable if it's not set in .ks file
+ if not part.size:
+ # and if rootfs name is specified for the partition
+ image_name = self.rootfs_dir.get(part.rootfs_dir)
+ if image_name and os.path.sep not in image_name:
+ # Bitbake variable ROOTFS_SIZE is calculated in
+ # Image._get_rootfs_size method from meta/lib/oe/image.py
+ # using IMAGE_ROOTFS_SIZE, IMAGE_ROOTFS_ALIGNMENT,
+ # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
+ rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
+ if rsize_bb:
+ part.size = int(round(float(rsize_bb)))
+
+ self._image.prepare(self)
+ self._image.layout_partitions()
+ self._image.create()
+
+ def assemble(self):
+ """
+ Assemble partitions into disk image
+ """
+ self._image.assemble()
+
+ def finalize(self):
+ """
+ Finalize the disk image.
+
+ For example, prepare the image to be bootable by e.g.
+ creating and installing a bootloader configuration.
+ """
+ source_plugin = self.ks.bootloader.source
+ disk_name = self.parts[0].disk
+ if source_plugin:
+ plugin = PluginMgr.get_plugins('source')[source_plugin]
+ plugin.do_install_disk(self._image, disk_name, self, self.workdir,
+ self.oe_builddir, self.bootimg_dir,
+ self.kernel_dir, self.native_sysroot)
+
+ full_path = self._image.path
+ # Generate .bmap
+ if self.bmap:
+ logger.debug("Generating bmap file for %s", disk_name)
+ python = os.path.join(self.native_sysroot, 'usr/bin/python3-native/python3')
+ bmaptool = os.path.join(self.native_sysroot, 'usr/bin/bmaptool')
+ exec_native_cmd("%s %s create %s -o %s.bmap" % \
+ (python, bmaptool, full_path, full_path), self.native_sysroot)
+ # Compress the image
+ if self.compressor:
+ logger.debug("Compressing disk %s with %s", disk_name, self.compressor)
+ exec_cmd("%s %s" % (self.compressor, full_path))
+
+ def print_info(self):
+ """
+ Print the image(s) and artifacts used, for the user.
+ """
+ msg = "The new image(s) can be found here:\n"
+
+ extension = "direct" + {"gzip": ".gz",
+ "bzip2": ".bz2",
+ "xz": ".xz",
+ None: ""}.get(self.compressor)
+ full_path = self._full_path(self.outdir, self.parts[0].disk, extension)
+ msg += ' %s\n\n' % full_path
+
+ msg += 'The following build artifacts were used to create the image(s):\n'
+ for part in self.parts:
+ if part.rootfs_dir is None:
+ continue
+ if part.mountpoint == '/':
+ suffix = ':'
+ else:
+ suffix = '["%s"]:' % (part.mountpoint or part.label)
+ rootdir = part.rootfs_dir
+ if rootdir in self.replaced_rootfs_paths:
+ rootdir = self.replaced_rootfs_paths[rootdir]
+ msg += ' ROOTFS_DIR%s%s\n' % (suffix.ljust(20), rootdir)
+
+ msg += ' BOOTIMG_DIR: %s\n' % self.bootimg_dir
+ msg += ' KERNEL_DIR: %s\n' % self.kernel_dir
+ msg += ' NATIVE_SYSROOT: %s\n' % self.native_sysroot
+
+ logger.info(msg)
+
+ @property
+ def rootdev(self):
+ """
+ Get root device name to use as a 'root' parameter
+ in kernel command line.
+
+ Assume partition order same as in wks
+ """
+ for part in self.parts:
+ if part.mountpoint == "/":
+ if part.uuid:
+ return "PARTUUID=%s" % part.uuid
+ else:
+ suffix = 'p' if part.disk.startswith('mmcblk') else ''
+ return "/dev/%s%s%-d" % (part.disk, suffix, part.realnum)
+
+ def cleanup(self):
+ if self._image:
+ self._image.cleanup()
+
+ # Move results to the output dir
+ if not os.path.exists(self.outdir):
+ os.makedirs(self.outdir)
+
+ for fname in os.listdir(self.workdir):
+ path = os.path.join(self.workdir, fname)
+ if os.path.isfile(path):
+ shutil.move(path, os.path.join(self.outdir, fname))
+
+ # remove work directory
+ shutil.rmtree(self.workdir, ignore_errors=True)
+
+# Overhead of the MBR partitioning scheme (just one sector)
+MBR_OVERHEAD = 1
+
+# Overhead of the GPT partitioning scheme
+GPT_OVERHEAD = 34
+
+# Size of a sector in bytes
+SECTOR_SIZE = 512
+
+class PartitionedImage():
+ """
+ Partitioned image in a file.
+ """
+
+ def __init__(self, path, ptable_format, partitions, native_sysroot=None):
+ self.path = path # Path to the image file
+ self.numpart = 0 # Number of allocated partitions
+ self.realpart = 0 # Number of partitions in the partition table
+ self.offset = 0 # Offset of next partition (in sectors)
+ self.min_size = 0 # Minimum required disk size to fit
+ # all partitions (in bytes)
+ self.ptable_format = ptable_format # Partition table format
+ # Disk system identifier
+ self.identifier = random.SystemRandom().randint(1, 0xffffffff)
+
+ self.partitions = partitions
+ self.partimages = []
+ # Size of a sector used in calculations
+ self.sector_size = SECTOR_SIZE
+ self.native_sysroot = native_sysroot
+
+ # calculate the real partition number, accounting for partitions not
+ # in the partition table and logical partitions
+ realnum = 0
+ for part in self.partitions:
+ if part.no_table:
+ part.realnum = 0
+ else:
+ realnum += 1
+ if self.ptable_format == 'msdos' and realnum > 3 and len(partitions) > 4:
+ part.realnum = realnum + 1
+ continue
+ part.realnum = realnum
+
+ # generate parition and filesystem UUIDs
+ for part in self.partitions:
+ if not part.uuid and part.use_uuid:
+ if self.ptable_format == 'gpt':
+ part.uuid = str(uuid.uuid4())
+ else: # msdos partition table
+ part.uuid = '%08x-%02d' % (self.identifier, part.realnum)
+ if not part.fsuuid:
+ if part.fstype == 'vfat' or part.fstype == 'msdos':
+ part.fsuuid = '0x' + str(uuid.uuid4())[:8].upper()
+ else:
+ part.fsuuid = str(uuid.uuid4())
+
+ def prepare(self, imager):
+ """Prepare an image. Call prepare method of all image partitions."""
+ for part in self.partitions:
+ # need to create the filesystems in order to get their
+ # sizes before we can add them and do the layout.
+ part.prepare(imager, imager.workdir, imager.oe_builddir,
+ imager.rootfs_dir, imager.bootimg_dir,
+ imager.kernel_dir, imager.native_sysroot)
+
+ # Converting kB to sectors for parted
+ part.size_sec = part.disk_size * 1024 // self.sector_size
+
+ def layout_partitions(self):
+ """ Layout the partitions, meaning calculate the position of every
+ partition on the disk. The 'ptable_format' parameter defines the
+ partition table format and may be "msdos". """
+
+ logger.debug("Assigning %s partitions to disks", self.ptable_format)
+
+ # The number of primary and logical partitions. Extended partition and
+ # partitions not listed in the table are not included.
+ num_real_partitions = len([p for p in self.partitions if not p.no_table])
+
+ # Go through partitions in the order they are added in .ks file
+ for num in range(len(self.partitions)):
+ part = self.partitions[num]
+
+ if self.ptable_format == 'msdos' and part.part_name:
+ raise WicError("setting custom partition name is not " \
+ "implemented for msdos partitions")
+
+ if self.ptable_format == 'msdos' and part.part_type:
+ # The --part-type can also be implemented for MBR partitions,
+ # in which case it would map to the 1-byte "partition type"
+ # filed at offset 3 of the partition entry.
+ raise WicError("setting custom partition type is not " \
+ "implemented for msdos partitions")
+
+ # Get the disk where the partition is located
+ self.numpart += 1
+ if not part.no_table:
+ self.realpart += 1
+
+ if self.numpart == 1:
+ if self.ptable_format == "msdos":
+ overhead = MBR_OVERHEAD
+ elif self.ptable_format == "gpt":
+ overhead = GPT_OVERHEAD
+
+ # Skip one sector required for the partitioning scheme overhead
+ self.offset += overhead
+
+ if self.realpart > 3 and num_real_partitions > 4:
+ # Reserve a sector for EBR for every logical partition
+ # before alignment is performed.
+ if self.ptable_format == "msdos":
+ self.offset += 1
+
+ if part.align:
+ # If not first partition and we do have alignment set we need
+ # to align the partition.
+ # FIXME: This leaves a empty spaces to the disk. To fill the
+ # gaps we could enlargea the previous partition?
+
+ # Calc how much the alignment is off.
+ align_sectors = self.offset % (part.align * 1024 // self.sector_size)
+
+ if align_sectors:
+ # If partition is not aligned as required, we need
+ # to move forward to the next alignment point
+ align_sectors = (part.align * 1024 // self.sector_size) - align_sectors
+
+ logger.debug("Realignment for %s%s with %s sectors, original"
+ " offset %s, target alignment is %sK.",
+ part.disk, self.numpart, align_sectors,
+ self.offset, part.align)
+
+ # increase the offset so we actually start the partition on right alignment
+ self.offset += align_sectors
+
+ part.start = self.offset
+ self.offset += part.size_sec
+
+ part.type = 'primary'
+ if not part.no_table:
+ part.num = self.realpart
+ else:
+ part.num = 0
+
+ if self.ptable_format == "msdos":
+ # only count the partitions that are in partition table
+ if num_real_partitions > 4:
+ if self.realpart > 3:
+ part.type = 'logical'
+ part.num = self.realpart + 1
+
+ logger.debug("Assigned %s to %s%d, sectors range %d-%d size %d "
+ "sectors (%d bytes).", part.mountpoint, part.disk,
+ part.num, part.start, self.offset - 1, part.size_sec,
+ part.size_sec * self.sector_size)
+
+ # Once all the partitions have been layed out, we can calculate the
+ # minumim disk size
+ self.min_size = self.offset
+ if self.ptable_format == "gpt":
+ self.min_size += GPT_OVERHEAD
+
+ self.min_size *= self.sector_size
+
+ def _create_partition(self, device, parttype, fstype, start, size):
+ """ Create a partition on an image described by the 'device' object. """
+
+ # Start is included to the size so we need to substract one from the end.
+ end = start + size - 1
+ logger.debug("Added '%s' partition, sectors %d-%d, size %d sectors",
+ parttype, start, end, size)
+
+ cmd = "parted -s %s unit s mkpart %s" % (device, parttype)
+ if fstype:
+ cmd += " %s" % fstype
+ cmd += " %d %d" % (start, end)
+
+ return exec_native_cmd(cmd, self.native_sysroot)
+
+ def create(self):
+ logger.debug("Creating sparse file %s", self.path)
+ with open(self.path, 'w') as sparse:
+ os.ftruncate(sparse.fileno(), self.min_size)
+
+ logger.debug("Initializing partition table for %s", self.path)
+ exec_native_cmd("parted -s %s mklabel %s" %
+ (self.path, self.ptable_format), self.native_sysroot)
+
+ logger.debug("Set disk identifier %x", self.identifier)
+ with open(self.path, 'r+b') as img:
+ img.seek(0x1B8)
+ img.write(self.identifier.to_bytes(4, 'little'))
+
+ logger.debug("Creating partitions")
+
+ for part in self.partitions:
+ if part.num == 0:
+ continue
+
+ if self.ptable_format == "msdos" and part.num == 5:
+ # Create an extended partition (note: extended
+ # partition is described in MBR and contains all
+ # logical partitions). The logical partitions save a
+ # sector for an EBR just before the start of a
+ # partition. The extended partition must start one
+ # sector before the start of the first logical
+ # partition. This way the first EBR is inside of the
+ # extended partition. Since the extended partitions
+ # starts a sector before the first logical partition,
+ # add a sector at the back, so that there is enough
+ # room for all logical partitions.
+ self._create_partition(self.path, "extended",
+ None, part.start - 1,
+ self.offset - part.start + 1)
+
+ if part.fstype == "swap":
+ parted_fs_type = "linux-swap"
+ elif part.fstype == "vfat":
+ parted_fs_type = "fat32"
+ elif part.fstype == "msdos":
+ parted_fs_type = "fat16"
+ if not part.system_id:
+ part.system_id = '0x6' # FAT16
+ else:
+ # Type for ext2/ext3/ext4/btrfs
+ parted_fs_type = "ext2"
+
+ # Boot ROM of OMAP boards require vfat boot partition to have an
+ # even number of sectors.
+ if part.mountpoint == "/boot" and part.fstype in ["vfat", "msdos"] \
+ and part.size_sec % 2:
+ logger.debug("Subtracting one sector from '%s' partition to "
+ "get even number of sectors for the partition",
+ part.mountpoint)
+ part.size_sec -= 1
+
+ self._create_partition(self.path, part.type,
+ parted_fs_type, part.start, part.size_sec)
+
+ if part.part_name:
+ logger.debug("partition %d: set name to %s",
+ part.num, part.part_name)
+ exec_native_cmd("sgdisk --change-name=%d:%s %s" % \
+ (part.num, part.part_name,
+ self.path), self.native_sysroot)
+
+ if part.part_type:
+ logger.debug("partition %d: set type UID to %s",
+ part.num, part.part_type)
+ exec_native_cmd("sgdisk --typecode=%d:%s %s" % \
+ (part.num, part.part_type,
+ self.path), self.native_sysroot)
+
+ if part.uuid and self.ptable_format == "gpt":
+ logger.debug("partition %d: set UUID to %s",
+ part.num, part.uuid)
+ exec_native_cmd("sgdisk --partition-guid=%d:%s %s" % \
+ (part.num, part.uuid, self.path),
+ self.native_sysroot)
+
+ if part.label and self.ptable_format == "gpt":
+ logger.debug("partition %d: set name to %s",
+ part.num, part.label)
+ exec_native_cmd("parted -s %s name %d %s" % \
+ (self.path, part.num, part.label),
+ self.native_sysroot)
+
+ if part.active:
+ flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot"
+ logger.debug("Set '%s' flag for partition '%s' on disk '%s'",
+ flag_name, part.num, self.path)
+ exec_native_cmd("parted -s %s set %d %s on" % \
+ (self.path, part.num, flag_name),
+ self.native_sysroot)
+ if part.system_id:
+ exec_native_cmd("sfdisk --part-type %s %s %s" % \
+ (self.path, part.num, part.system_id),
+ self.native_sysroot)
+
+ def cleanup(self):
+ # remove partition images
+ for image in set(self.partimages):
+ os.remove(image)
+
+ def assemble(self):
+ logger.debug("Installing partitions")
+
+ for part in self.partitions:
+ source = part.source_file
+ if source:
+ # install source_file contents into a partition
+ sparse_copy(source, self.path, seek=part.start * self.sector_size)
+
+ logger.debug("Installed %s in partition %d, sectors %d-%d, "
+ "size %d sectors", source, part.num, part.start,
+ part.start + part.size_sec - 1, part.size_sec)
+
+ partimage = self.path + '.p%d' % part.num
+ os.rename(source, partimage)
+ self.partimages.append(partimage)
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
new file mode 100644
index 000000000..beb74d7a7
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -0,0 +1,258 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2014, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'bootimg-efi' source plugin class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import logging
+import os
+import shutil
+
+from wic import WicError
+from wic.engine import get_custom_config
+from wic.pluginbase import SourcePlugin
+from wic.misc import (exec_cmd, exec_native_cmd,
+ get_bitbake_var, BOOTDD_EXTRA_SPACE)
+
+logger = logging.getLogger('wic')
+
+class BootimgEFIPlugin(SourcePlugin):
+ """
+ Create EFI boot partition.
+ This plugin supports GRUB 2 and systemd-boot bootloaders.
+ """
+
+ name = 'bootimg-efi'
+
+ @classmethod
+ def do_configure_grubefi(cls, creator, cr_workdir):
+ """
+ Create loader-specific (grub-efi) config
+ """
+ configfile = creator.ks.bootloader.configfile
+ custom_cfg = None
+ if configfile:
+ custom_cfg = get_custom_config(configfile)
+ if custom_cfg:
+ # Use a custom configuration for grub
+ grubefi_conf = custom_cfg
+ logger.debug("Using custom configuration file "
+ "%s for grub.cfg", configfile)
+ else:
+ raise WicError("configfile is specified but failed to "
+ "get it from %s." % configfile)
+
+ if not custom_cfg:
+ # Create grub configuration using parameters from wks file
+ bootloader = creator.ks.bootloader
+
+ grubefi_conf = ""
+ grubefi_conf += "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1\n"
+ grubefi_conf += "default=boot\n"
+ grubefi_conf += "timeout=%s\n" % bootloader.timeout
+ grubefi_conf += "menuentry 'boot'{\n"
+
+ kernel = "/bzImage"
+
+ grubefi_conf += "linux %s root=%s rootwait %s\n" \
+ % (kernel, creator.rootdev, bootloader.append)
+ grubefi_conf += "}\n"
+
+ logger.debug("Writing grubefi config %s/hdd/boot/EFI/BOOT/grub.cfg",
+ cr_workdir)
+ cfg = open("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir, "w")
+ cfg.write(grubefi_conf)
+ cfg.close()
+
+ @classmethod
+ def do_configure_systemdboot(cls, hdddir, creator, cr_workdir, source_params):
+ """
+ Create loader-specific systemd-boot/gummiboot config
+ """
+ install_cmd = "install -d %s/loader" % hdddir
+ exec_cmd(install_cmd)
+
+ install_cmd = "install -d %s/loader/entries" % hdddir
+ exec_cmd(install_cmd)
+
+ bootloader = creator.ks.bootloader
+
+ loader_conf = ""
+ loader_conf += "default boot\n"
+ loader_conf += "timeout %d\n" % bootloader.timeout
+
+ initrd = source_params.get('initrd')
+
+ if initrd:
+ # obviously we need to have a common common deploy var
+ bootimg_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not bootimg_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+
+ cp_cmd = "cp %s/%s %s" % (bootimg_dir, initrd, hdddir)
+ exec_cmd(cp_cmd, True)
+ else:
+ logger.debug("Ignoring missing initrd")
+
+ logger.debug("Writing systemd-boot config "
+ "%s/hdd/boot/loader/loader.conf", cr_workdir)
+ cfg = open("%s/hdd/boot/loader/loader.conf" % cr_workdir, "w")
+ cfg.write(loader_conf)
+ cfg.close()
+
+ configfile = creator.ks.bootloader.configfile
+ custom_cfg = None
+ if configfile:
+ custom_cfg = get_custom_config(configfile)
+ if custom_cfg:
+ # Use a custom configuration for systemd-boot
+ boot_conf = custom_cfg
+ logger.debug("Using custom configuration file "
+ "%s for systemd-boots's boot.conf", configfile)
+ else:
+ raise WicError("configfile is specified but failed to "
+ "get it from %s.", configfile)
+
+ if not custom_cfg:
+ # Create systemd-boot configuration using parameters from wks file
+ kernel = "/bzImage"
+
+ boot_conf = ""
+ boot_conf += "title boot\n"
+ boot_conf += "linux %s\n" % kernel
+ boot_conf += "options LABEL=Boot root=%s %s\n" % \
+ (creator.rootdev, bootloader.append)
+
+ if initrd:
+ boot_conf += "initrd /%s\n" % initrd
+
+ logger.debug("Writing systemd-boot config "
+ "%s/hdd/boot/loader/entries/boot.conf", cr_workdir)
+ cfg = open("%s/hdd/boot/loader/entries/boot.conf" % cr_workdir, "w")
+ cfg.write(boot_conf)
+ cfg.close()
+
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(), creates loader-specific config
+ """
+ hdddir = "%s/hdd/boot" % cr_workdir
+
+ install_cmd = "install -d %s/EFI/BOOT" % hdddir
+ exec_cmd(install_cmd)
+
+ try:
+ if source_params['loader'] == 'grub-efi':
+ cls.do_configure_grubefi(creator, cr_workdir)
+ elif source_params['loader'] == 'systemd-boot':
+ cls.do_configure_systemdboot(hdddir, creator, cr_workdir, source_params)
+ else:
+ raise WicError("unrecognized bootimg-efi loader: %s" % source_params['loader'])
+ except KeyError:
+ raise WicError("bootimg-efi requires a loader, none specified")
+
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, prepare content for an EFI (grub) boot partition.
+ """
+ if not kernel_dir:
+ kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not kernel_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+
+ staging_kernel_dir = kernel_dir
+
+ hdddir = "%s/hdd/boot" % cr_workdir
+
+ install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
+ (staging_kernel_dir, hdddir)
+ exec_cmd(install_cmd)
+
+
+ try:
+ if source_params['loader'] == 'grub-efi':
+ shutil.copyfile("%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir,
+ "%s/grub.cfg" % cr_workdir)
+ for mod in [x for x in os.listdir(kernel_dir) if x.startswith("grub-efi-")]:
+ cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[9:])
+ exec_cmd(cp_cmd, True)
+ shutil.move("%s/grub.cfg" % cr_workdir,
+ "%s/hdd/boot/EFI/BOOT/grub.cfg" % cr_workdir)
+ elif source_params['loader'] == 'systemd-boot':
+ for mod in [x for x in os.listdir(kernel_dir) if x.startswith("systemd-")]:
+ cp_cmd = "cp %s/%s %s/EFI/BOOT/%s" % (kernel_dir, mod, hdddir, mod[8:])
+ exec_cmd(cp_cmd, True)
+ else:
+ raise WicError("unrecognized bootimg-efi loader: %s" %
+ source_params['loader'])
+ except KeyError:
+ raise WicError("bootimg-efi requires a loader, none specified")
+
+ startup = os.path.join(kernel_dir, "startup.nsh")
+ if os.path.exists(startup):
+ cp_cmd = "cp %s %s/" % (startup, hdddir)
+ exec_cmd(cp_cmd, True)
+
+ du_cmd = "du -bks %s" % hdddir
+ out = exec_cmd(du_cmd)
+ blocks = int(out.split()[0])
+
+ extra_blocks = part.get_extra_block_count(blocks)
+
+ if extra_blocks < BOOTDD_EXTRA_SPACE:
+ extra_blocks = BOOTDD_EXTRA_SPACE
+
+ blocks += extra_blocks
+
+ logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+ extra_blocks, part.mountpoint, blocks)
+
+ # dosfs image, created by mkdosfs
+ bootimg = "%s/boot.img" % cr_workdir
+
+ dosfs_cmd = "mkdosfs -n efi -i %s -C %s %d" % \
+ (part.fsuuid, bootimg, blocks)
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir)
+ exec_native_cmd(mcopy_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % bootimg
+ exec_cmd(chmod_cmd)
+
+ du_cmd = "du -Lbks %s" % bootimg
+ out = exec_cmd(du_cmd)
+ bootimg_size = out.split()[0]
+
+ part.size = int(bootimg_size)
+ part.source_file = bootimg
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-partition.py b/poky/scripts/lib/wic/plugins/source/bootimg-partition.py
new file mode 100644
index 000000000..b239fc0b4
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-partition.py
@@ -0,0 +1,132 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'bootimg-partition' source plugin class for
+# 'wic'. The plugin creates an image of boot partition, copying over
+# files listed in IMAGE_BOOT_FILES bitbake variable.
+#
+# AUTHORS
+# Maciej Borzecki <maciej.borzecki (at] open-rnd.pl>
+#
+
+import logging
+import os
+import re
+
+from glob import glob
+
+from wic import WicError
+from wic.pluginbase import SourcePlugin
+from wic.misc import exec_cmd, get_bitbake_var
+
+logger = logging.getLogger('wic')
+
+class BootimgPartitionPlugin(SourcePlugin):
+ """
+ Create an image of boot partition, copying over files
+ listed in IMAGE_BOOT_FILES bitbake variable.
+ """
+
+ name = 'bootimg-partition'
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, does the following:
+ - sets up a vfat partition
+ - copies all files listed in IMAGE_BOOT_FILES variable
+ """
+ hdddir = "%s/boot.%d" % (cr_workdir, part.lineno)
+ install_cmd = "install -d %s" % hdddir
+ exec_cmd(install_cmd)
+
+ if not kernel_dir:
+ kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not kernel_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+
+ logger.debug('Kernel dir: %s', bootimg_dir)
+
+ boot_files = None
+ for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), (None, None)):
+ if fmt:
+ var = fmt % id
+ else:
+ var = ""
+
+ boot_files = get_bitbake_var("IMAGE_BOOT_FILES" + var)
+ if boot_files is not None:
+ break
+
+ if boot_files is None:
+ raise WicError('No boot files defined, IMAGE_BOOT_FILES unset for entry #%d' % part.lineno)
+
+ logger.debug('Boot files: %s', boot_files)
+
+ # list of tuples (src_name, dst_name)
+ deploy_files = []
+ for src_entry in re.findall(r'[\w;\-\./\*]+', boot_files):
+ if ';' in src_entry:
+ dst_entry = tuple(src_entry.split(';'))
+ if not dst_entry[0] or not dst_entry[1]:
+ raise WicError('Malformed boot file entry: %s' % src_entry)
+ else:
+ dst_entry = (src_entry, src_entry)
+
+ logger.debug('Destination entry: %r', dst_entry)
+ deploy_files.append(dst_entry)
+
+ for deploy_entry in deploy_files:
+ src, dst = deploy_entry
+ install_task = []
+ if '*' in src:
+ # by default install files under their basename
+ entry_name_fn = os.path.basename
+ if dst != src:
+ # unless a target name was given, then treat name
+ # as a directory and append a basename
+ entry_name_fn = lambda name: \
+ os.path.join(dst,
+ os.path.basename(name))
+
+ srcs = glob(os.path.join(kernel_dir, src))
+
+ logger.debug('Globbed sources: %s', ', '.join(srcs))
+ for entry in srcs:
+ entry_dst_name = entry_name_fn(entry)
+ install_task.append((entry,
+ os.path.join(hdddir,
+ entry_dst_name)))
+ else:
+ install_task = [(os.path.join(kernel_dir, src),
+ os.path.join(hdddir, dst))]
+
+ for task in install_task:
+ src_path, dst_path = task
+ logger.debug('Install %s as %s',
+ os.path.basename(src_path), dst_path)
+ install_cmd = "install -m 0644 -D %s %s" \
+ % (src_path, dst_path)
+ exec_cmd(install_cmd)
+
+ logger.debug('Prepare boot partition using rootfs in %s', hdddir)
+ part.prepare_rootfs(cr_workdir, oe_builddir, hdddir,
+ native_sysroot, False)
diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
new file mode 100644
index 000000000..d599112dd
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -0,0 +1,207 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2014, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'bootimg-pcbios' source plugin class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+import logging
+import os
+
+from wic import WicError
+from wic.engine import get_custom_config
+from wic.pluginbase import SourcePlugin
+from wic.misc import (exec_cmd, exec_native_cmd,
+ get_bitbake_var, BOOTDD_EXTRA_SPACE)
+
+logger = logging.getLogger('wic')
+
+class BootimgPcbiosPlugin(SourcePlugin):
+ """
+ Create MBR boot partition and install syslinux on it.
+ """
+
+ name = 'bootimg-pcbios'
+
+ @classmethod
+ def _get_bootimg_dir(cls, bootimg_dir, dirname):
+ """
+ Check if dirname exists in default bootimg_dir or in STAGING_DIR.
+ """
+ for result in (bootimg_dir, get_bitbake_var("STAGING_DATADIR")):
+ if os.path.exists("%s/%s" % (result, dirname)):
+ return result
+
+ raise WicError("Couldn't find correct bootimg_dir, exiting")
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. In this case, we install the MBR.
+ """
+ bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux')
+ mbrfile = "%s/syslinux/" % bootimg_dir
+ if creator.ptable_format == 'msdos':
+ mbrfile += "mbr.bin"
+ elif creator.ptable_format == 'gpt':
+ mbrfile += "gptmbr.bin"
+ else:
+ raise WicError("Unsupported partition table: %s" %
+ creator.ptable_format)
+
+ if not os.path.exists(mbrfile):
+ raise WicError("Couldn't find %s. If using the -e option, do you "
+ "have the right MACHINE set in local.conf? If not, "
+ "is the bootimg_dir path correct?" % mbrfile)
+
+ full_path = creator._full_path(workdir, disk_name, "direct")
+ logger.debug("Installing MBR on disk %s as %s with size %s bytes",
+ disk_name, full_path, disk.min_size)
+
+ dd_cmd = "dd if=%s of=%s conv=notrunc" % (mbrfile, full_path)
+ exec_cmd(dd_cmd, native_sysroot)
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(), creates syslinux config
+ """
+ hdddir = "%s/hdd/boot" % cr_workdir
+
+ install_cmd = "install -d %s" % hdddir
+ exec_cmd(install_cmd)
+
+ bootloader = creator.ks.bootloader
+
+ custom_cfg = None
+ if bootloader.configfile:
+ custom_cfg = get_custom_config(bootloader.configfile)
+ if custom_cfg:
+ # Use a custom configuration for grub
+ syslinux_conf = custom_cfg
+ logger.debug("Using custom configuration file %s "
+ "for syslinux.cfg", bootloader.configfile)
+ else:
+ raise WicError("configfile is specified but failed to "
+ "get it from %s." % bootloader.configfile)
+
+ if not custom_cfg:
+ # Create syslinux configuration using parameters from wks file
+ splash = os.path.join(cr_workdir, "/hdd/boot/splash.jpg")
+ if os.path.exists(splash):
+ splashline = "menu background splash.jpg"
+ else:
+ splashline = ""
+
+ syslinux_conf = ""
+ syslinux_conf += "PROMPT 0\n"
+ syslinux_conf += "TIMEOUT " + str(bootloader.timeout) + "\n"
+ syslinux_conf += "\n"
+ syslinux_conf += "ALLOWOPTIONS 1\n"
+ syslinux_conf += "SERIAL 0 115200\n"
+ syslinux_conf += "\n"
+ if splashline:
+ syslinux_conf += "%s\n" % splashline
+ syslinux_conf += "DEFAULT boot\n"
+ syslinux_conf += "LABEL boot\n"
+
+ kernel = "/vmlinuz"
+ syslinux_conf += "KERNEL " + kernel + "\n"
+
+ syslinux_conf += "APPEND label=boot root=%s %s\n" % \
+ (creator.rootdev, bootloader.append)
+
+ logger.debug("Writing syslinux config %s/hdd/boot/syslinux.cfg",
+ cr_workdir)
+ cfg = open("%s/hdd/boot/syslinux.cfg" % cr_workdir, "w")
+ cfg.write(syslinux_conf)
+ cfg.close()
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, prepare content for legacy bios boot partition.
+ """
+ bootimg_dir = cls._get_bootimg_dir(bootimg_dir, 'syslinux')
+
+ staging_kernel_dir = kernel_dir
+
+ hdddir = "%s/hdd/boot" % cr_workdir
+
+ cmds = ("install -m 0644 %s/bzImage %s/vmlinuz" %
+ (staging_kernel_dir, hdddir),
+ "install -m 444 %s/syslinux/ldlinux.sys %s/ldlinux.sys" %
+ (bootimg_dir, hdddir),
+ "install -m 0644 %s/syslinux/vesamenu.c32 %s/vesamenu.c32" %
+ (bootimg_dir, hdddir),
+ "install -m 444 %s/syslinux/libcom32.c32 %s/libcom32.c32" %
+ (bootimg_dir, hdddir),
+ "install -m 444 %s/syslinux/libutil.c32 %s/libutil.c32" %
+ (bootimg_dir, hdddir))
+
+ for install_cmd in cmds:
+ exec_cmd(install_cmd)
+
+ du_cmd = "du -bks %s" % hdddir
+ out = exec_cmd(du_cmd)
+ blocks = int(out.split()[0])
+
+ extra_blocks = part.get_extra_block_count(blocks)
+
+ if extra_blocks < BOOTDD_EXTRA_SPACE:
+ extra_blocks = BOOTDD_EXTRA_SPACE
+
+ blocks += extra_blocks
+
+ logger.debug("Added %d extra blocks to %s to get to %d total blocks",
+ extra_blocks, part.mountpoint, blocks)
+
+ # dosfs image, created by mkdosfs
+ bootimg = "%s/boot%s.img" % (cr_workdir, part.lineno)
+
+ dosfs_cmd = "mkdosfs -n boot -i %s -S 512 -C %s %d" % \
+ (part.fsuuid, bootimg, blocks)
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (bootimg, hdddir)
+ exec_native_cmd(mcopy_cmd, native_sysroot)
+
+ syslinux_cmd = "syslinux %s" % bootimg
+ exec_native_cmd(syslinux_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % bootimg
+ exec_cmd(chmod_cmd)
+
+ du_cmd = "du -Lbks %s" % bootimg
+ out = exec_cmd(du_cmd)
+ bootimg_size = out.split()[0]
+
+ part.size = int(bootimg_size)
+ part.source_file = bootimg
diff --git a/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
new file mode 100644
index 000000000..d6bd3bff7
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -0,0 +1,466 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'isoimage-isohybrid' source plugin class for 'wic'
+#
+# AUTHORS
+# Mihaly Varga <mihaly.varga (at] ni.com>
+
+import glob
+import logging
+import os
+import re
+import shutil
+
+from wic import WicError
+from wic.engine import get_custom_config
+from wic.pluginbase import SourcePlugin
+from wic.misc import exec_cmd, exec_native_cmd, get_bitbake_var
+
+logger = logging.getLogger('wic')
+
+class IsoImagePlugin(SourcePlugin):
+ """
+ Create a bootable ISO image
+
+ This plugin creates a hybrid, legacy and EFI bootable ISO image. The
+ generated image can be used on optical media as well as USB media.
+
+ Legacy boot uses syslinux and EFI boot uses grub or gummiboot (not
+ implemented yet) as bootloader. The plugin creates the directories required
+ by bootloaders and populates them by creating and configuring the
+ bootloader files.
+
+ Example kickstart file:
+ part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi, \\
+ image_name= IsoImage" --ondisk cd --label LIVECD --fstype=ext2
+ bootloader --timeout=10 --append=" "
+
+ In --sourceparams "loader" specifies the bootloader used for booting in EFI
+ mode, while "image_name" specifies the name of the generated image. In the
+ example above, wic creates an ISO image named IsoImage-cd.direct (default
+ extension added by direct imeger plugin) and a file named IsoImage-cd.iso
+ """
+
+ name = 'isoimage-isohybrid'
+
+ @classmethod
+ def do_configure_syslinux(cls, creator, cr_workdir):
+ """
+ Create loader-specific (syslinux) config
+ """
+ splash = os.path.join(cr_workdir, "ISO/boot/splash.jpg")
+ if os.path.exists(splash):
+ splashline = "menu background splash.jpg"
+ else:
+ splashline = ""
+
+ bootloader = creator.ks.bootloader
+
+ syslinux_conf = ""
+ syslinux_conf += "PROMPT 0\n"
+ syslinux_conf += "TIMEOUT %s \n" % (bootloader.timeout or 10)
+ syslinux_conf += "\n"
+ syslinux_conf += "ALLOWOPTIONS 1\n"
+ syslinux_conf += "SERIAL 0 115200\n"
+ syslinux_conf += "\n"
+ if splashline:
+ syslinux_conf += "%s\n" % splashline
+ syslinux_conf += "DEFAULT boot\n"
+ syslinux_conf += "LABEL boot\n"
+
+ kernel = "/bzImage"
+ syslinux_conf += "KERNEL " + kernel + "\n"
+ syslinux_conf += "APPEND initrd=/initrd LABEL=boot %s\n" \
+ % bootloader.append
+
+ logger.debug("Writing syslinux config %s/ISO/isolinux/isolinux.cfg",
+ cr_workdir)
+
+ with open("%s/ISO/isolinux/isolinux.cfg" % cr_workdir, "w") as cfg:
+ cfg.write(syslinux_conf)
+
+ @classmethod
+ def do_configure_grubefi(cls, part, creator, target_dir):
+ """
+ Create loader-specific (grub-efi) config
+ """
+ configfile = creator.ks.bootloader.configfile
+ if configfile:
+ grubefi_conf = get_custom_config(configfile)
+ if grubefi_conf:
+ logger.debug("Using custom configuration file %s for grub.cfg",
+ configfile)
+ else:
+ raise WicError("configfile is specified "
+ "but failed to get it from %s", configfile)
+ else:
+ splash = os.path.join(target_dir, "splash.jpg")
+ if os.path.exists(splash):
+ splashline = "menu background splash.jpg"
+ else:
+ splashline = ""
+
+ bootloader = creator.ks.bootloader
+
+ grubefi_conf = ""
+ grubefi_conf += "serial --unit=0 --speed=115200 --word=8 "
+ grubefi_conf += "--parity=no --stop=1\n"
+ grubefi_conf += "default=boot\n"
+ grubefi_conf += "timeout=%s\n" % (bootloader.timeout or 10)
+ grubefi_conf += "\n"
+ grubefi_conf += "search --set=root --label %s " % part.label
+ grubefi_conf += "\n"
+ grubefi_conf += "menuentry 'boot'{\n"
+
+ kernel = "/bzImage"
+
+ grubefi_conf += "linux %s rootwait %s\n" \
+ % (kernel, bootloader.append)
+ grubefi_conf += "initrd /initrd \n"
+ grubefi_conf += "}\n"
+
+ if splashline:
+ grubefi_conf += "%s\n" % splashline
+
+ cfg_path = os.path.join(target_dir, "grub.cfg")
+ logger.debug("Writing grubefi config %s", cfg_path)
+
+ with open(cfg_path, "w") as cfg:
+ cfg.write(grubefi_conf)
+
+ @staticmethod
+ def _build_initramfs_path(rootfs_dir, cr_workdir):
+ """
+ Create path for initramfs image
+ """
+
+ initrd = get_bitbake_var("INITRD_LIVE") or get_bitbake_var("INITRD")
+ if not initrd:
+ initrd_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not initrd_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting.")
+
+ image_name = get_bitbake_var("IMAGE_BASENAME")
+ if not image_name:
+ raise WicError("Couldn't find IMAGE_BASENAME, exiting.")
+
+ image_type = get_bitbake_var("INITRAMFS_FSTYPES")
+ if not image_type:
+ raise WicError("Couldn't find INITRAMFS_FSTYPES, exiting.")
+
+ machine = os.path.basename(initrd_dir)
+
+ pattern = '%s/%s*%s.%s' % (initrd_dir, image_name, machine, image_type)
+ files = glob.glob(pattern)
+ if files:
+ initrd = files[0]
+
+ if not initrd or not os.path.exists(initrd):
+ # Create initrd from rootfs directory
+ initrd = "%s/initrd.cpio.gz" % cr_workdir
+ initrd_dir = "%s/INITRD" % cr_workdir
+ shutil.copytree("%s" % rootfs_dir, \
+ "%s" % initrd_dir, symlinks=True)
+
+ if os.path.isfile("%s/init" % rootfs_dir):
+ shutil.copy2("%s/init" % rootfs_dir, "%s/init" % initrd_dir)
+ elif os.path.lexists("%s/init" % rootfs_dir):
+ os.symlink(os.readlink("%s/init" % rootfs_dir), \
+ "%s/init" % initrd_dir)
+ elif os.path.isfile("%s/sbin/init" % rootfs_dir):
+ shutil.copy2("%s/sbin/init" % rootfs_dir, \
+ "%s" % initrd_dir)
+ elif os.path.lexists("%s/sbin/init" % rootfs_dir):
+ os.symlink(os.readlink("%s/sbin/init" % rootfs_dir), \
+ "%s/init" % initrd_dir)
+ else:
+ raise WicError("Couldn't find or build initrd, exiting.")
+
+ exec_cmd("cd %s && find . | cpio -o -H newc -R +0:+0 >./initrd.cpio " \
+ % initrd_dir, as_shell=True)
+ exec_cmd("gzip -f -9 -c %s/initrd.cpio > %s" \
+ % (cr_workdir, initrd), as_shell=True)
+ shutil.rmtree(initrd_dir)
+
+ return initrd
+
+ @classmethod
+ def do_configure_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ native_sysroot):
+ """
+ Called before do_prepare_partition(), creates loader-specific config
+ """
+ isodir = "%s/ISO/" % cr_workdir
+
+ if os.path.exists(isodir):
+ shutil.rmtree(isodir)
+
+ install_cmd = "install -d %s " % isodir
+ exec_cmd(install_cmd)
+
+ # Overwrite the name of the created image
+ logger.debug(source_params)
+ if 'image_name' in source_params and \
+ source_params['image_name'].strip():
+ creator.name = source_params['image_name'].strip()
+ logger.debug("The name of the image is: %s", creator.name)
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, creator, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, prepare content for a bootable ISO image.
+ """
+
+ isodir = "%s/ISO" % cr_workdir
+
+ if part.rootfs_dir is None:
+ if not 'ROOTFS_DIR' in rootfs_dir:
+ raise WicError("Couldn't find --rootfs-dir, exiting.")
+ rootfs_dir = rootfs_dir['ROOTFS_DIR']
+ else:
+ if part.rootfs_dir in rootfs_dir:
+ rootfs_dir = rootfs_dir[part.rootfs_dir]
+ elif part.rootfs_dir:
+ rootfs_dir = part.rootfs_dir
+ else:
+ raise WicError("Couldn't find --rootfs-dir=%s connection "
+ "or it is not a valid path, exiting." %
+ part.rootfs_dir)
+
+ if not os.path.isdir(rootfs_dir):
+ rootfs_dir = get_bitbake_var("IMAGE_ROOTFS")
+ if not os.path.isdir(rootfs_dir):
+ raise WicError("Couldn't find IMAGE_ROOTFS, exiting.")
+
+ part.rootfs_dir = rootfs_dir
+
+ # Prepare rootfs.img
+ deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ img_iso_dir = get_bitbake_var("ISODIR")
+ rootfs_img = "%s/rootfs.img" % img_iso_dir
+ if not os.path.isfile(rootfs_img):
+ # check if rootfs.img is in deploydir
+ deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ image_name = get_bitbake_var("IMAGE_LINK_NAME")
+ rootfs_img = "%s/%s.%s" \
+ % (deploy_dir, image_name, part.fstype)
+
+ if not os.path.isfile(rootfs_img):
+ # create image file with type specified by --fstype
+ # which contains rootfs
+ du_cmd = "du -bks %s" % rootfs_dir
+ out = exec_cmd(du_cmd)
+ part.size = int(out.split()[0])
+ part.extra_space = 0
+ part.overhead_factor = 1.2
+ part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, \
+ native_sysroot)
+ rootfs_img = part.source_file
+
+ install_cmd = "install -m 0644 %s %s/rootfs.img" \
+ % (rootfs_img, isodir)
+ exec_cmd(install_cmd)
+
+ # Remove the temporary file created by part.prepare_rootfs()
+ if os.path.isfile(part.source_file):
+ os.remove(part.source_file)
+
+ # Support using a different initrd other than default
+ if source_params.get('initrd'):
+ initrd = source_params['initrd']
+ if not deploy_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+ cp_cmd = "cp %s/%s %s" % (deploy_dir, initrd, cr_workdir)
+ exec_cmd(cp_cmd)
+ else:
+ # Prepare initial ramdisk
+ initrd = "%s/initrd" % deploy_dir
+ if not os.path.isfile(initrd):
+ initrd = "%s/initrd" % img_iso_dir
+ if not os.path.isfile(initrd):
+ initrd = cls._build_initramfs_path(rootfs_dir, cr_workdir)
+
+ install_cmd = "install -m 0644 %s %s/initrd" % (initrd, isodir)
+ exec_cmd(install_cmd)
+
+ # Remove the temporary file created by _build_initramfs_path function
+ if os.path.isfile("%s/initrd.cpio.gz" % cr_workdir):
+ os.remove("%s/initrd.cpio.gz" % cr_workdir)
+
+ # Install bzImage
+ install_cmd = "install -m 0644 %s/bzImage %s/bzImage" % \
+ (kernel_dir, isodir)
+ exec_cmd(install_cmd)
+
+ #Create bootloader for efi boot
+ try:
+ target_dir = "%s/EFI/BOOT" % isodir
+ if os.path.exists(target_dir):
+ shutil.rmtree(target_dir)
+
+ os.makedirs(target_dir)
+
+ if source_params['loader'] == 'grub-efi':
+ # Builds bootx64.efi/bootia32.efi if ISODIR didn't exist or
+ # didn't contains it
+ target_arch = get_bitbake_var("TARGET_SYS")
+ if not target_arch:
+ raise WicError("Coludn't find target architecture")
+
+ if re.match("x86_64", target_arch):
+ grub_image = "grub-efi-bootx64.efi"
+ elif re.match('i.86', target_arch):
+ grub_image = "grub-efi-bootia32.efi"
+ else:
+ raise WicError("grub-efi is incompatible with target %s" %
+ target_arch)
+
+ grub_target = os.path.join(target_dir, grub_image)
+ if not os.path.isfile(grub_target):
+ grub_src = os.path.join(deploy_dir, grub_image)
+ if not os.path.exists(grub_src):
+ raise WicError("Grub loader %s is not found in %s. "
+ "Please build grub-efi first" % (grub_image, deploy_dir))
+ shutil.copy(grub_src, grub_target)
+
+ if not os.path.isfile(os.path.join(target_dir, "boot.cfg")):
+ cls.do_configure_grubefi(part, creator, target_dir)
+
+ else:
+ raise WicError("unrecognized bootimg-efi loader: %s" %
+ source_params['loader'])
+ except KeyError:
+ raise WicError("bootimg-efi requires a loader, none specified")
+
+ # Create efi.img that contains bootloader files for EFI booting
+ # if ISODIR didn't exist or didn't contains it
+ if os.path.isfile("%s/efi.img" % img_iso_dir):
+ install_cmd = "install -m 0644 %s/efi.img %s/efi.img" % \
+ (img_iso_dir, isodir)
+ exec_cmd(install_cmd)
+ else:
+ du_cmd = "du -bks %s/EFI" % isodir
+ out = exec_cmd(du_cmd)
+ blocks = int(out.split()[0])
+ # Add some extra space for file system overhead
+ blocks += 100
+ logger.debug("Added 100 extra blocks to %s to get to %d "
+ "total blocks", part.mountpoint, blocks)
+
+ # dosfs image for EFI boot
+ bootimg = "%s/efi.img" % isodir
+
+ dosfs_cmd = 'mkfs.vfat -n "EFIimg" -S 512 -C %s %d' \
+ % (bootimg, blocks)
+ exec_native_cmd(dosfs_cmd, native_sysroot)
+
+ mmd_cmd = "mmd -i %s ::/EFI" % bootimg
+ exec_native_cmd(mmd_cmd, native_sysroot)
+
+ mcopy_cmd = "mcopy -i %s -s %s/EFI/* ::/EFI/" \
+ % (bootimg, isodir)
+ exec_native_cmd(mcopy_cmd, native_sysroot)
+
+ chmod_cmd = "chmod 644 %s" % bootimg
+ exec_cmd(chmod_cmd)
+
+ # Prepare files for legacy boot
+ syslinux_dir = get_bitbake_var("STAGING_DATADIR")
+ if not syslinux_dir:
+ raise WicError("Couldn't find STAGING_DATADIR, exiting.")
+
+ if os.path.exists("%s/isolinux" % isodir):
+ shutil.rmtree("%s/isolinux" % isodir)
+
+ install_cmd = "install -d %s/isolinux" % isodir
+ exec_cmd(install_cmd)
+
+ cls.do_configure_syslinux(creator, cr_workdir)
+
+ install_cmd = "install -m 444 %s/syslinux/ldlinux.sys " % syslinux_dir
+ install_cmd += "%s/isolinux/ldlinux.sys" % isodir
+ exec_cmd(install_cmd)
+
+ install_cmd = "install -m 444 %s/syslinux/isohdpfx.bin " % syslinux_dir
+ install_cmd += "%s/isolinux/isohdpfx.bin" % isodir
+ exec_cmd(install_cmd)
+
+ install_cmd = "install -m 644 %s/syslinux/isolinux.bin " % syslinux_dir
+ install_cmd += "%s/isolinux/isolinux.bin" % isodir
+ exec_cmd(install_cmd)
+
+ install_cmd = "install -m 644 %s/syslinux/ldlinux.c32 " % syslinux_dir
+ install_cmd += "%s/isolinux/ldlinux.c32" % isodir
+ exec_cmd(install_cmd)
+
+ #create ISO image
+ iso_img = "%s/tempiso_img.iso" % cr_workdir
+ iso_bootimg = "isolinux/isolinux.bin"
+ iso_bootcat = "isolinux/boot.cat"
+ efi_img = "efi.img"
+
+ mkisofs_cmd = "mkisofs -V %s " % part.label
+ mkisofs_cmd += "-o %s -U " % iso_img
+ mkisofs_cmd += "-J -joliet-long -r -iso-level 2 -b %s " % iso_bootimg
+ mkisofs_cmd += "-c %s -no-emul-boot -boot-load-size 4 " % iso_bootcat
+ mkisofs_cmd += "-boot-info-table -eltorito-alt-boot "
+ mkisofs_cmd += "-eltorito-platform 0xEF -eltorito-boot %s " % efi_img
+ mkisofs_cmd += "-no-emul-boot %s " % isodir
+
+ logger.debug("running command: %s", mkisofs_cmd)
+ exec_native_cmd(mkisofs_cmd, native_sysroot)
+
+ shutil.rmtree(isodir)
+
+ du_cmd = "du -Lbks %s" % iso_img
+ out = exec_cmd(du_cmd)
+ isoimg_size = int(out.split()[0])
+
+ part.size = isoimg_size
+ part.source_file = iso_img
+
+ @classmethod
+ def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
+ bootimg_dir, kernel_dir, native_sysroot):
+ """
+ Called after all partitions have been prepared and assembled into a
+ disk image. In this case, we insert/modify the MBR using isohybrid
+ utility for booting via BIOS from disk storage devices.
+ """
+
+ iso_img = "%s.p1" % disk.path
+ full_path = creator._full_path(workdir, disk_name, "direct")
+ full_path_iso = creator._full_path(workdir, disk_name, "iso")
+
+ isohybrid_cmd = "isohybrid -u %s" % iso_img
+ logger.debug("running command: %s", isohybrid_cmd)
+ exec_native_cmd(isohybrid_cmd, native_sysroot)
+
+ # Replace the image created by direct plugin with the one created by
+ # mkisofs command. This is necessary because the iso image created by
+ # mkisofs has a very specific MBR is system area of the ISO image, and
+ # direct plugin adds and configures an another MBR.
+ logger.debug("Replaceing the image created by direct plugin\n")
+ os.remove(disk.path)
+ shutil.copy2(iso_img, full_path_iso)
+ shutil.copy2(full_path_iso, full_path)
diff --git a/poky/scripts/lib/wic/plugins/source/rawcopy.py b/poky/scripts/lib/wic/plugins/source/rawcopy.py
new file mode 100644
index 000000000..e86398ac8
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/rawcopy.py
@@ -0,0 +1,91 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import logging
+import os
+
+from wic import WicError
+from wic.pluginbase import SourcePlugin
+from wic.misc import exec_cmd, get_bitbake_var
+from wic.filemap import sparse_copy
+
+logger = logging.getLogger('wic')
+
+class RawCopyPlugin(SourcePlugin):
+ """
+ Populate partition content from raw image file.
+ """
+
+ name = 'rawcopy'
+
+ @staticmethod
+ def do_image_label(fstype, dst, label):
+ if fstype.startswith('ext'):
+ cmd = 'tune2fs -L %s %s' % (label, dst)
+ elif fstype in ('msdos', 'vfat'):
+ cmd = 'dosfslabel %s %s' % (dst, label)
+ elif fstype == 'btrfs':
+ cmd = 'btrfs filesystem label %s %s' % (dst, label)
+ elif fstype == 'swap':
+ cmd = 'mkswap -L %s %s' % (label, dst)
+ elif fstype == 'squashfs':
+ raise WicError("It's not possible to update a squashfs "
+ "filesystem label '%s'" % (label))
+ else:
+ raise WicError("Cannot update filesystem label: "
+ "Unknown fstype: '%s'" % (fstype))
+
+ exec_cmd(cmd)
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ rootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ """
+ if not kernel_dir:
+ kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
+ if not kernel_dir:
+ raise WicError("Couldn't find DEPLOY_DIR_IMAGE, exiting")
+
+ logger.debug('Kernel dir: %s', kernel_dir)
+
+ if 'file' not in source_params:
+ raise WicError("No file specified")
+
+ src = os.path.join(kernel_dir, source_params['file'])
+ dst = os.path.join(cr_workdir, "%s.%s" % (source_params['file'], part.lineno))
+
+ if 'skip' in source_params:
+ sparse_copy(src, dst, skip=int(source_params['skip']))
+ else:
+ sparse_copy(src, dst)
+
+ # get the size in the right units for kickstart (kB)
+ du_cmd = "du -Lbks %s" % dst
+ out = exec_cmd(du_cmd)
+ filesize = int(out.split()[0])
+
+ if filesize > part.size:
+ part.size = filesize
+
+ if part.label:
+ RawCopyPlugin.do_image_label(part.fstype, dst, part.label)
+
+ part.source_file = dst
diff --git a/poky/scripts/lib/wic/plugins/source/rootfs.py b/poky/scripts/lib/wic/plugins/source/rootfs.py
new file mode 100644
index 000000000..aec720fb2
--- /dev/null
+++ b/poky/scripts/lib/wic/plugins/source/rootfs.py
@@ -0,0 +1,126 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2014, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION
+# This implements the 'rootfs' source plugin class for 'wic'
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+# Joao Henrique Ferreira de Freitas <joaohf (at] gmail.com>
+#
+
+import logging
+import os
+import shutil
+import sys
+
+from oe.path import copyhardlinktree
+
+from wic import WicError
+from wic.pluginbase import SourcePlugin
+from wic.misc import get_bitbake_var
+
+logger = logging.getLogger('wic')
+
+class RootfsPlugin(SourcePlugin):
+ """
+ Populate partition content from a rootfs directory.
+ """
+
+ name = 'rootfs'
+
+ @staticmethod
+ def __get_rootfs_dir(rootfs_dir):
+ if os.path.isdir(rootfs_dir):
+ return os.path.realpath(rootfs_dir)
+
+ image_rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", rootfs_dir)
+ if not os.path.isdir(image_rootfs_dir):
+ raise WicError("No valid artifact IMAGE_ROOTFS from image "
+ "named %s has been found at %s, exiting." %
+ (rootfs_dir, image_rootfs_dir))
+
+ return os.path.realpath(image_rootfs_dir)
+
+ @classmethod
+ def do_prepare_partition(cls, part, source_params, cr, cr_workdir,
+ oe_builddir, bootimg_dir, kernel_dir,
+ krootfs_dir, native_sysroot):
+ """
+ Called to do the actual content population for a partition i.e. it
+ 'prepares' the partition to be incorporated into the image.
+ In this case, prepare content for legacy bios boot partition.
+ """
+ if part.rootfs_dir is None:
+ if not 'ROOTFS_DIR' in krootfs_dir:
+ raise WicError("Couldn't find --rootfs-dir, exiting")
+
+ rootfs_dir = krootfs_dir['ROOTFS_DIR']
+ else:
+ if part.rootfs_dir in krootfs_dir:
+ rootfs_dir = krootfs_dir[part.rootfs_dir]
+ elif part.rootfs_dir:
+ rootfs_dir = part.rootfs_dir
+ else:
+ raise WicError("Couldn't find --rootfs-dir=%s connection or "
+ "it is not a valid path, exiting" % part.rootfs_dir)
+
+ part.rootfs_dir = cls.__get_rootfs_dir(rootfs_dir)
+
+ new_rootfs = None
+ # Handle excluded paths.
+ if part.exclude_path is not None:
+ # We need a new rootfs directory we can delete files from. Copy to
+ # workdir.
+ new_rootfs = os.path.realpath(os.path.join(cr_workdir, "rootfs%d" % part.lineno))
+
+ if os.path.lexists(new_rootfs):
+ shutil.rmtree(os.path.join(new_rootfs))
+
+ copyhardlinktree(part.rootfs_dir, new_rootfs)
+
+ for orig_path in part.exclude_path:
+ path = orig_path
+ if os.path.isabs(path):
+ logger.error("Must be relative: --exclude-path=%s" % orig_path)
+ sys.exit(1)
+
+ full_path = os.path.realpath(os.path.join(new_rootfs, path))
+
+ # Disallow climbing outside of parent directory using '..',
+ # because doing so could be quite disastrous (we will delete the
+ # directory).
+ if not full_path.startswith(new_rootfs):
+ logger.error("'%s' points to a path outside the rootfs" % orig_path)
+ sys.exit(1)
+
+ if path.endswith(os.sep):
+ # Delete content only.
+ for entry in os.listdir(full_path):
+ full_entry = os.path.join(full_path, entry)
+ if os.path.isdir(full_entry) and not os.path.islink(full_entry):
+ shutil.rmtree(full_entry)
+ else:
+ os.remove(full_entry)
+ else:
+ # Delete whole directory.
+ shutil.rmtree(full_path)
+
+ part.prepare_rootfs(cr_workdir, oe_builddir,
+ new_rootfs or part.rootfs_dir, native_sysroot)
diff --git a/poky/scripts/lnr b/poky/scripts/lnr
new file mode 100755
index 000000000..5fed780eb
--- /dev/null
+++ b/poky/scripts/lnr
@@ -0,0 +1,21 @@
+#! /usr/bin/env python3
+
+# Create a *relative* symlink, just like ln --relative does but without needing
+# coreutils 8.16.
+
+import sys, os
+
+if len(sys.argv) != 3:
+ print("$ lnr TARGET LINK_NAME")
+ sys.exit(1)
+
+target = sys.argv[1]
+linkname = sys.argv[2]
+
+if os.path.isabs(target):
+ if not os.path.isabs(linkname):
+ linkname = os.path.abspath(linkname)
+ start = os.path.dirname(linkname)
+ target = os.path.relpath(target, start)
+
+os.symlink(target, linkname)
diff --git a/poky/scripts/multilib_header_wrapper.h b/poky/scripts/multilib_header_wrapper.h
new file mode 100644
index 000000000..f516673b6
--- /dev/null
+++ b/poky/scripts/multilib_header_wrapper.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2005-2011 by Wind River Systems, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+
+
+#if defined (__arm__)
+#define __MHWORDSIZE 32
+#elif defined (__aarch64__) && defined ( __LP64__)
+#define __MHWORDSIZE 64
+#elif defined (__aarch64__)
+#define __MHWORDSIZE 32
+#else
+#include <bits/wordsize.h>
+#if defined (__WORDSIZE)
+#define __MHWORDSIZE __WORDSIZE
+#else
+#error "__WORDSIZE is not defined"
+#endif
+#endif
+
+#if __MHWORDSIZE == 32
+
+#ifdef _MIPS_SIM
+
+#if _MIPS_SIM == _ABIO32
+#include <ENTER_HEADER_FILENAME_HERE-32.h>
+#elif _MIPS_SIM == _ABIN32
+#include <ENTER_HEADER_FILENAME_HERE-n32.h>
+#else
+#error "Unknown _MIPS_SIM"
+#endif
+
+#else /* _MIPS_SIM is not defined */
+#include <ENTER_HEADER_FILENAME_HERE-32.h>
+#endif
+
+#elif __MHWORDSIZE == 64
+#include <ENTER_HEADER_FILENAME_HERE-64.h>
+#else
+#error "Unknown __WORDSIZE detected"
+#endif /* matches #if __WORDSIZE == 32 */
+
diff --git a/poky/scripts/native-intercept/chown b/poky/scripts/native-intercept/chown
new file mode 100755
index 000000000..4f43271c2
--- /dev/null
+++ b/poky/scripts/native-intercept/chown
@@ -0,0 +1,2 @@
+#! /bin/sh
+echo "Intercept $0: $@ -- do nothing"
diff --git a/poky/scripts/oe-build-perf-report b/poky/scripts/oe-build-perf-report
new file mode 100755
index 000000000..dc999c45c
--- /dev/null
+++ b/poky/scripts/oe-build-perf-report
@@ -0,0 +1,661 @@
+#!/usr/bin/python3
+#
+# Examine build performance test results
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+import argparse
+import json
+import logging
+import os
+import re
+import sys
+from collections import namedtuple, OrderedDict
+from operator import attrgetter
+from xml.etree import ElementTree as ET
+
+# Import oe libs
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(scripts_path, 'lib'))
+import scriptpath
+from build_perf import print_table
+from build_perf.report import (metadata_xml_to_json, results_xml_to_json,
+ aggregate_data, aggregate_metadata, measurement_stats,
+ AggregateTestData)
+from build_perf import html
+from buildstats import BuildStats, diff_buildstats, BSVerDiff
+
+scriptpath.add_oe_lib_path()
+
+from oeqa.utils.git import GitRepo, GitError
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger('oe-build-perf-report')
+
+
+# Container class for tester revisions
+TestedRev = namedtuple('TestedRev', 'commit commit_number tags')
+
+
+def get_test_runs(repo, tag_name, **kwargs):
+ """Get a sorted list of test runs, matching given pattern"""
+ # First, get field names from the tag name pattern
+ field_names = [m.group(1) for m in re.finditer(r'{(\w+)}', tag_name)]
+ undef_fields = [f for f in field_names if f not in kwargs.keys()]
+
+ # Fields for formatting tag name pattern
+ str_fields = dict([(f, '*') for f in field_names])
+ str_fields.update(kwargs)
+
+ # Get a list of all matching tags
+ tag_pattern = tag_name.format(**str_fields)
+ tags = repo.run_cmd(['tag', '-l', tag_pattern]).splitlines()
+ log.debug("Found %d tags matching pattern '%s'", len(tags), tag_pattern)
+
+ # Parse undefined fields from tag names
+ str_fields = dict([(f, r'(?P<{}>[\w\-.()]+)'.format(f)) for f in field_names])
+ str_fields['branch'] = r'(?P<branch>[\w\-.()/]+)'
+ str_fields['commit'] = '(?P<commit>[0-9a-f]{7,40})'
+ str_fields['commit_number'] = '(?P<commit_number>[0-9]{1,7})'
+ str_fields['tag_number'] = '(?P<tag_number>[0-9]{1,5})'
+ # escape parenthesis in fields in order to not messa up the regexp
+ fixed_fields = dict([(k, v.replace('(', r'\(').replace(')', r'\)')) for k, v in kwargs.items()])
+ str_fields.update(fixed_fields)
+ tag_re = re.compile(tag_name.format(**str_fields))
+
+ # Parse fields from tags
+ revs = []
+ for tag in tags:
+ m = tag_re.match(tag)
+ groups = m.groupdict()
+ revs.append([groups[f] for f in undef_fields] + [tag])
+
+ # Return field names and a sorted list of revs
+ return undef_fields, sorted(revs)
+
+def list_test_revs(repo, tag_name, verbosity, **kwargs):
+ """Get list of all tested revisions"""
+ valid_kwargs = dict([(k, v) for k, v in kwargs.items() if v is not None])
+
+ fields, revs = get_test_runs(repo, tag_name, **valid_kwargs)
+ ignore_fields = ['tag_number']
+ if verbosity < 2:
+ extra_fields = ['COMMITS', 'TEST RUNS']
+ ignore_fields.extend(['commit_number', 'commit'])
+ else:
+ extra_fields = ['TEST RUNS']
+
+ print_fields = [i for i, f in enumerate(fields) if f not in ignore_fields]
+
+ # Sort revs
+ rows = [[fields[i].upper() for i in print_fields] + extra_fields]
+
+ prev = [''] * len(print_fields)
+ prev_commit = None
+ commit_cnt = 0
+ commit_field = fields.index('commit')
+ for rev in revs:
+ # Only use fields that we want to print
+ cols = [rev[i] for i in print_fields]
+
+
+ if cols != prev:
+ commit_cnt = 1
+ test_run_cnt = 1
+ new_row = [''] * (len(print_fields) + len(extra_fields))
+
+ for i in print_fields:
+ if cols[i] != prev[i]:
+ break
+ new_row[i:-len(extra_fields)] = cols[i:]
+ rows.append(new_row)
+ else:
+ if rev[commit_field] != prev_commit:
+ commit_cnt += 1
+ test_run_cnt += 1
+
+ if verbosity < 2:
+ new_row[-2] = commit_cnt
+ new_row[-1] = test_run_cnt
+ prev = cols
+ prev_commit = rev[commit_field]
+
+ print_table(rows)
+
+def get_test_revs(repo, tag_name, **kwargs):
+ """Get list of all tested revisions"""
+ fields, runs = get_test_runs(repo, tag_name, **kwargs)
+
+ revs = {}
+ commit_i = fields.index('commit')
+ commit_num_i = fields.index('commit_number')
+ for run in runs:
+ commit = run[commit_i]
+ commit_num = run[commit_num_i]
+ tag = run[-1]
+ if not commit in revs:
+ revs[commit] = TestedRev(commit, commit_num, [tag])
+ else:
+ assert commit_num == revs[commit].commit_number, "Commit numbers do not match"
+ revs[commit].tags.append(tag)
+
+ # Return in sorted table
+ revs = sorted(revs.values(), key=attrgetter('commit_number'))
+ log.debug("Found %d tested revisions:\n %s", len(revs),
+ "\n ".join(['{} ({})'.format(rev.commit_number, rev.commit) for rev in revs]))
+ return revs
+
+def rev_find(revs, attr, val):
+ """Search from a list of TestedRev"""
+ for i, rev in enumerate(revs):
+ if getattr(rev, attr) == val:
+ return i
+ raise ValueError("Unable to find '{}' value '{}'".format(attr, val))
+
+def is_xml_format(repo, commit):
+ """Check if the commit contains xml (or json) data"""
+ if repo.rev_parse(commit + ':results.xml'):
+ log.debug("Detected report in xml format in %s", commit)
+ return True
+ else:
+ log.debug("No xml report in %s, assuming json formatted results", commit)
+ return False
+
+def read_results(repo, tags, xml=True):
+ """Read result files from repo"""
+
+ def parse_xml_stream(data):
+ """Parse multiple concatenated XML objects"""
+ objs = []
+ xml_d = ""
+ for line in data.splitlines():
+ if xml_d and line.startswith('<?xml version='):
+ objs.append(ET.fromstring(xml_d))
+ xml_d = line
+ else:
+ xml_d += line
+ objs.append(ET.fromstring(xml_d))
+ return objs
+
+ def parse_json_stream(data):
+ """Parse multiple concatenated JSON objects"""
+ objs = []
+ json_d = ""
+ for line in data.splitlines():
+ if line == '}{':
+ json_d += '}'
+ objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
+ json_d = '{'
+ else:
+ json_d += line
+ objs.append(json.loads(json_d, object_pairs_hook=OrderedDict))
+ return objs
+
+ num_revs = len(tags)
+
+ # Optimize by reading all data with one git command
+ log.debug("Loading raw result data from %d tags, %s...", num_revs, tags[0])
+ if xml:
+ git_objs = [tag + ':metadata.xml' for tag in tags] + [tag + ':results.xml' for tag in tags]
+ data = parse_xml_stream(repo.run_cmd(['show'] + git_objs + ['--']))
+ return ([metadata_xml_to_json(e) for e in data[0:num_revs]],
+ [results_xml_to_json(e) for e in data[num_revs:]])
+ else:
+ git_objs = [tag + ':metadata.json' for tag in tags] + [tag + ':results.json' for tag in tags]
+ data = parse_json_stream(repo.run_cmd(['show'] + git_objs + ['--']))
+ return data[0:num_revs], data[num_revs:]
+
+
+def get_data_item(data, key):
+ """Nested getitem lookup"""
+ for k in key.split('.'):
+ data = data[k]
+ return data
+
+
+def metadata_diff(metadata_l, metadata_r):
+ """Prepare a metadata diff for printing"""
+ keys = [('Hostname', 'hostname', 'hostname'),
+ ('Branch', 'branch', 'layers.meta.branch'),
+ ('Commit number', 'commit_num', 'layers.meta.commit_count'),
+ ('Commit', 'commit', 'layers.meta.commit'),
+ ('Number of test runs', 'testrun_count', 'testrun_count')
+ ]
+
+ def _metadata_diff(key):
+ """Diff metadata from two test reports"""
+ try:
+ val1 = get_data_item(metadata_l, key)
+ except KeyError:
+ val1 = '(N/A)'
+ try:
+ val2 = get_data_item(metadata_r, key)
+ except KeyError:
+ val2 = '(N/A)'
+ return val1, val2
+
+ metadata = OrderedDict()
+ for title, key, key_json in keys:
+ value_l, value_r = _metadata_diff(key_json)
+ metadata[key] = {'title': title,
+ 'value_old': value_l,
+ 'value': value_r}
+ return metadata
+
+
+def print_diff_report(metadata_l, data_l, metadata_r, data_r):
+ """Print differences between two data sets"""
+
+ # First, print general metadata
+ print("\nTEST METADATA:\n==============")
+ meta_diff = metadata_diff(metadata_l, metadata_r)
+ rows = []
+ row_fmt = ['{:{wid}} ', '{:<{wid}} ', '{:<{wid}}']
+ rows = [['', 'CURRENT COMMIT', 'COMPARING WITH']]
+ for key, val in meta_diff.items():
+ # Shorten commit hashes
+ if key == 'commit':
+ rows.append([val['title'] + ':', val['value'][:20], val['value_old'][:20]])
+ else:
+ rows.append([val['title'] + ':', val['value'], val['value_old']])
+ print_table(rows, row_fmt)
+
+
+ # Print test results
+ print("\nTEST RESULTS:\n=============")
+
+ tests = list(data_l['tests'].keys())
+ # Append tests that are only present in 'right' set
+ tests += [t for t in list(data_r['tests'].keys()) if t not in tests]
+
+ # Prepare data to be printed
+ rows = []
+ row_fmt = ['{:8}', '{:{wid}}', '{:{wid}}', ' {:>{wid}}', ' {:{wid}} ', '{:{wid}}',
+ ' {:>{wid}}', ' {:>{wid}}']
+ num_cols = len(row_fmt)
+ for test in tests:
+ test_l = data_l['tests'][test] if test in data_l['tests'] else None
+ test_r = data_r['tests'][test] if test in data_r['tests'] else None
+ pref = ' '
+ if test_l is None:
+ pref = '+'
+ elif test_r is None:
+ pref = '-'
+ descr = test_l['description'] if test_l else test_r['description']
+ heading = "{} {}: {}".format(pref, test, descr)
+
+ rows.append([heading])
+
+ # Generate the list of measurements
+ meas_l = test_l['measurements'] if test_l else {}
+ meas_r = test_r['measurements'] if test_r else {}
+ measurements = list(meas_l.keys())
+ measurements += [m for m in list(meas_r.keys()) if m not in measurements]
+
+ for meas in measurements:
+ m_pref = ' '
+ if meas in meas_l:
+ stats_l = measurement_stats(meas_l[meas], 'l.')
+ else:
+ stats_l = measurement_stats(None, 'l.')
+ m_pref = '+'
+ if meas in meas_r:
+ stats_r = measurement_stats(meas_r[meas], 'r.')
+ else:
+ stats_r = measurement_stats(None, 'r.')
+ m_pref = '-'
+ stats = stats_l.copy()
+ stats.update(stats_r)
+
+ absdiff = stats['val_cls'](stats['r.mean'] - stats['l.mean'])
+ reldiff = "{:+.1f} %".format(absdiff * 100 / stats['l.mean'])
+ if stats['r.mean'] > stats['l.mean']:
+ absdiff = '+' + str(absdiff)
+ else:
+ absdiff = str(absdiff)
+ rows.append(['', m_pref, stats['name'] + ' ' + stats['quantity'],
+ str(stats['l.mean']), '->', str(stats['r.mean']),
+ absdiff, reldiff])
+ rows.append([''] * num_cols)
+
+ print_table(rows, row_fmt)
+
+ print()
+
+
+class BSSummary(object):
+ def __init__(self, bs1, bs2):
+ self.tasks = {'count': bs2.num_tasks,
+ 'change': '{:+d}'.format(bs2.num_tasks - bs1.num_tasks)}
+ self.top_consumer = None
+ self.top_decrease = None
+ self.top_increase = None
+ self.ver_diff = OrderedDict()
+
+ tasks_diff = diff_buildstats(bs1, bs2, 'cputime')
+
+ # Get top consumers of resources
+ tasks_diff = sorted(tasks_diff, key=attrgetter('value2'))
+ self.top_consumer = tasks_diff[-5:]
+
+ # Get biggest increase and decrease in resource usage
+ tasks_diff = sorted(tasks_diff, key=attrgetter('absdiff'))
+ self.top_decrease = tasks_diff[0:5]
+ self.top_increase = tasks_diff[-5:]
+
+ # Compare recipe versions and prepare data for display
+ ver_diff = BSVerDiff(bs1, bs2)
+ if ver_diff:
+ if ver_diff.new:
+ self.ver_diff['New recipes'] = [(n, r.evr) for n, r in ver_diff.new.items()]
+ if ver_diff.dropped:
+ self.ver_diff['Dropped recipes'] = [(n, r.evr) for n, r in ver_diff.dropped.items()]
+ if ver_diff.echanged:
+ self.ver_diff['Epoch changed'] = [(n, "{} &rarr; {}".format(r.left.evr, r.right.evr)) for n, r in ver_diff.echanged.items()]
+ if ver_diff.vchanged:
+ self.ver_diff['Version changed'] = [(n, "{} &rarr; {}".format(r.left.version, r.right.version)) for n, r in ver_diff.vchanged.items()]
+ if ver_diff.rchanged:
+ self.ver_diff['Revision changed'] = [(n, "{} &rarr; {}".format(r.left.evr, r.right.evr)) for n, r in ver_diff.rchanged.items()]
+
+
+def print_html_report(data, id_comp, buildstats):
+ """Print report in html format"""
+ # Handle metadata
+ metadata = metadata_diff(data[id_comp].metadata, data[-1].metadata)
+
+ # Generate list of tests
+ tests = []
+ for test in data[-1].results['tests'].keys():
+ test_r = data[-1].results['tests'][test]
+ new_test = {'name': test_r['name'],
+ 'description': test_r['description'],
+ 'status': test_r['status'],
+ 'measurements': [],
+ 'err_type': test_r.get('err_type'),
+ }
+ # Limit length of err output shown
+ if 'message' in test_r:
+ lines = test_r['message'].splitlines()
+ if len(lines) > 20:
+ new_test['message'] = '...\n' + '\n'.join(lines[-20:])
+ else:
+ new_test['message'] = test_r['message']
+
+
+ # Generate the list of measurements
+ for meas in test_r['measurements'].keys():
+ meas_r = test_r['measurements'][meas]
+ meas_type = 'time' if meas_r['type'] == 'sysres' else 'size'
+ new_meas = {'name': meas_r['name'],
+ 'legend': meas_r['legend'],
+ 'description': meas_r['name'] + ' ' + meas_type,
+ }
+ samples = []
+
+ # Run through all revisions in our data
+ for meta, test_data in data:
+ if (not test in test_data['tests'] or
+ not meas in test_data['tests'][test]['measurements']):
+ samples.append(measurement_stats(None))
+ continue
+ test_i = test_data['tests'][test]
+ meas_i = test_i['measurements'][meas]
+ commit_num = get_data_item(meta, 'layers.meta.commit_count')
+ samples.append(measurement_stats(meas_i))
+ samples[-1]['commit_num'] = commit_num
+
+ absdiff = samples[-1]['val_cls'](samples[-1]['mean'] - samples[id_comp]['mean'])
+ new_meas['absdiff'] = absdiff
+ new_meas['absdiff_str'] = str(absdiff) if absdiff < 0 else '+' + str(absdiff)
+ new_meas['reldiff'] = "{:+.1f} %".format(absdiff * 100 / samples[id_comp]['mean'])
+ new_meas['samples'] = samples
+ new_meas['value'] = samples[-1]
+ new_meas['value_type'] = samples[-1]['val_cls']
+
+ # Compare buildstats
+ bs_key = test + '.' + meas
+ rev = metadata['commit_num']['value']
+ comp_rev = metadata['commit_num']['value_old']
+ if (rev in buildstats and bs_key in buildstats[rev] and
+ comp_rev in buildstats and bs_key in buildstats[comp_rev]):
+ new_meas['buildstats'] = BSSummary(buildstats[comp_rev][bs_key],
+ buildstats[rev][bs_key])
+
+
+ new_test['measurements'].append(new_meas)
+ tests.append(new_test)
+
+ # Chart options
+ chart_opts = {'haxis': {'min': get_data_item(data[0][0], 'layers.meta.commit_count'),
+ 'max': get_data_item(data[-1][0], 'layers.meta.commit_count')}
+ }
+
+ print(html.template.render(title="Build Perf Test Report",
+ metadata=metadata, test_data=tests,
+ chart_opts=chart_opts))
+
+
+def get_buildstats(repo, notes_ref, revs, outdir=None):
+ """Get the buildstats from git notes"""
+ full_ref = 'refs/notes/' + notes_ref
+ if not repo.rev_parse(full_ref):
+ log.error("No buildstats found, please try running "
+ "'git fetch origin %s:%s' to fetch them from the remote",
+ full_ref, full_ref)
+ return
+
+ missing = False
+ buildstats = {}
+ log.info("Parsing buildstats from 'refs/notes/%s'", notes_ref)
+ for rev in revs:
+ buildstats[rev.commit_number] = {}
+ log.debug('Dumping buildstats for %s (%s)', rev.commit_number,
+ rev.commit)
+ for tag in rev.tags:
+ log.debug(' %s', tag)
+ try:
+ bs_all = json.loads(repo.run_cmd(['notes', '--ref', notes_ref,
+ 'show', tag + '^0']))
+ except GitError:
+ log.warning("Buildstats not found for %s", tag)
+ bs_all = {}
+ missing = True
+
+ for measurement, bs in bs_all.items():
+ # Write out onto disk
+ if outdir:
+ tag_base, run_id = tag.rsplit('/', 1)
+ tag_base = tag_base.replace('/', '_')
+ bs_dir = os.path.join(outdir, measurement, tag_base)
+ if not os.path.exists(bs_dir):
+ os.makedirs(bs_dir)
+ with open(os.path.join(bs_dir, run_id + '.json'), 'w') as f:
+ json.dump(bs, f, indent=2)
+
+ # Read buildstats into a dict
+ _bs = BuildStats.from_json(bs)
+ if measurement not in buildstats[rev.commit_number]:
+ buildstats[rev.commit_number][measurement] = _bs
+ else:
+ buildstats[rev.commit_number][measurement].aggregate(_bs)
+
+ if missing:
+ log.info("Buildstats were missing for some test runs, please "
+ "run 'git fetch origin %s:%s' and try again",
+ full_ref, full_ref)
+
+ return buildstats
+
+
+def auto_args(repo, args):
+ """Guess arguments, if not defined by the user"""
+ # Get the latest commit in the repo
+ log.debug("Guessing arguments from the latest commit")
+ msg = repo.run_cmd(['log', '-1', '--branches', '--remotes', '--format=%b'])
+ for line in msg.splitlines():
+ split = line.split(':', 1)
+ if len(split) != 2:
+ continue
+
+ key = split[0]
+ val = split[1].strip()
+ if key == 'hostname':
+ log.debug("Using hostname %s", val)
+ args.hostname = val
+ elif key == 'branch':
+ log.debug("Using branch %s", val)
+ args.branch = val
+
+
+def parse_args(argv):
+ """Parse command line arguments"""
+ description = """
+Examine build performance test results from a Git repository"""
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=description)
+
+ parser.add_argument('--debug', '-d', action='store_true',
+ help="Verbose logging")
+ parser.add_argument('--repo', '-r', required=True,
+ help="Results repository (local git clone)")
+ parser.add_argument('--list', '-l', action='count',
+ help="List available test runs")
+ parser.add_argument('--html', action='store_true',
+ help="Generate report in html format")
+ group = parser.add_argument_group('Tag and revision')
+ group.add_argument('--tag-name', '-t',
+ default='{hostname}/{branch}/{machine}/{commit_number}-g{commit}/{tag_number}',
+ help="Tag name (pattern) for finding results")
+ group.add_argument('--hostname', '-H')
+ group.add_argument('--branch', '-B', default='master')
+ group.add_argument('--machine', default='qemux86')
+ group.add_argument('--history-length', default=25, type=int,
+ help="Number of tested revisions to plot in html report")
+ group.add_argument('--commit',
+ help="Revision to search for")
+ group.add_argument('--commit-number',
+ help="Revision number to search for, redundant if "
+ "--commit is specified")
+ group.add_argument('--commit2',
+ help="Revision to compare with")
+ group.add_argument('--commit-number2',
+ help="Revision number to compare with, redundant if "
+ "--commit2 is specified")
+ parser.add_argument('--dump-buildstats', nargs='?', const='.',
+ help="Dump buildstats of the tests")
+
+ return parser.parse_args(argv)
+
+
+def main(argv=None):
+ """Script entry point"""
+ args = parse_args(argv)
+ if args.debug:
+ log.setLevel(logging.DEBUG)
+
+ repo = GitRepo(args.repo)
+
+ if args.list:
+ list_test_revs(repo, args.tag_name, args.list, hostname=args.hostname)
+ return 0
+
+ # Determine hostname which to use
+ if not args.hostname:
+ auto_args(repo, args)
+
+ revs = get_test_revs(repo, args.tag_name, hostname=args.hostname,
+ branch=args.branch, machine=args.machine)
+ if len(revs) < 2:
+ log.error("%d tester revisions found, unable to generate report",
+ len(revs))
+ return 1
+
+ # Pick revisions
+ if args.commit:
+ if args.commit_number:
+ log.warning("Ignoring --commit-number as --commit was specified")
+ index1 = rev_find(revs, 'commit', args.commit)
+ elif args.commit_number:
+ index1 = rev_find(revs, 'commit_number', args.commit_number)
+ else:
+ index1 = len(revs) - 1
+
+ if args.commit2:
+ if args.commit_number2:
+ log.warning("Ignoring --commit-number2 as --commit2 was specified")
+ index2 = rev_find(revs, 'commit', args.commit2)
+ elif args.commit_number2:
+ index2 = rev_find(revs, 'commit_number', args.commit_number2)
+ else:
+ if index1 > 0:
+ index2 = index1 - 1
+ else:
+ log.error("Unable to determine the other commit, use "
+ "--commit2 or --commit-number2 to specify it")
+ return 1
+
+ index_l = min(index1, index2)
+ index_r = max(index1, index2)
+
+ rev_l = revs[index_l]
+ rev_r = revs[index_r]
+ log.debug("Using 'left' revision %s (%s), %s test runs:\n %s",
+ rev_l.commit_number, rev_l.commit, len(rev_l.tags),
+ '\n '.join(rev_l.tags))
+ log.debug("Using 'right' revision %s (%s), %s test runs:\n %s",
+ rev_r.commit_number, rev_r.commit, len(rev_r.tags),
+ '\n '.join(rev_r.tags))
+
+ # Check report format used in the repo (assume all reports in the same fmt)
+ xml = is_xml_format(repo, revs[index_r].tags[-1])
+
+ if args.html:
+ index_0 = max(0, min(index_l, index_r - args.history_length))
+ rev_range = range(index_0, index_r + 1)
+ else:
+ # We do not need range of commits for text report (no graphs)
+ index_0 = index_l
+ rev_range = (index_l, index_r)
+
+ # Read raw data
+ log.debug("Reading %d revisions, starting from %s (%s)",
+ len(rev_range), revs[index_0].commit_number, revs[index_0].commit)
+ raw_data = [read_results(repo, revs[i].tags, xml) for i in rev_range]
+
+ data = []
+ for raw_m, raw_d in raw_data:
+ data.append(AggregateTestData(aggregate_metadata(raw_m),
+ aggregate_data(raw_d)))
+
+ # Read buildstats only when needed
+ buildstats = None
+ if args.dump_buildstats or args.html:
+ outdir = 'oe-build-perf-buildstats' if args.dump_buildstats else None
+ notes_ref = 'buildstats/{}/{}/{}'.format(args.hostname, args.branch,
+ args.machine)
+ buildstats = get_buildstats(repo, notes_ref, [rev_l, rev_r], outdir)
+
+ # Print report
+ if not args.html:
+ print_diff_report(data[0].metadata, data[0].results,
+ data[1].metadata, data[1].results)
+ else:
+ # Re-map 'left' list index to the data table where index_0 maps to 0
+ print_html_report(data, index_l - index_0, buildstats)
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/oe-build-perf-test b/poky/scripts/oe-build-perf-test
new file mode 100755
index 000000000..669470fa9
--- /dev/null
+++ b/poky/scripts/oe-build-perf-test
@@ -0,0 +1,223 @@
+#!/usr/bin/python3
+#
+# Build performance test script
+#
+# Copyright (c) 2016, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+"""Build performance test script"""
+import argparse
+import errno
+import fcntl
+import json
+import logging
+import os
+import re
+import shutil
+import sys
+from datetime import datetime
+
+sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
+import scriptpath
+scriptpath.add_oe_lib_path()
+scriptpath.add_bitbake_lib_path()
+import oeqa.buildperf
+from oeqa.buildperf import (BuildPerfTestLoader, BuildPerfTestResult,
+ BuildPerfTestRunner, KernelDropCaches)
+from oeqa.utils.commands import runCmd
+from oeqa.utils.metadata import metadata_from_bb, write_metadata_file
+
+
+# Set-up logging
+LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s'
+logging.basicConfig(level=logging.INFO, format=LOG_FORMAT,
+ datefmt='%Y-%m-%d %H:%M:%S')
+log = logging.getLogger()
+
+
+def acquire_lock(lock_f):
+ """Acquire flock on file"""
+ log.debug("Acquiring lock %s", os.path.abspath(lock_f.name))
+ try:
+ fcntl.flock(lock_f, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ except IOError as err:
+ if err.errno == errno.EAGAIN:
+ return False
+ raise
+ log.debug("Lock acquired")
+ return True
+
+
+def pre_run_sanity_check():
+ """Sanity check of build environment"""
+ build_dir = os.environ.get("BUILDDIR")
+ if not build_dir:
+ log.error("BUILDDIR not set. Please run the build environmnent setup "
+ "script.")
+ return False
+ if os.getcwd() != build_dir:
+ log.error("Please run this script under BUILDDIR (%s)", build_dir)
+ return False
+
+ ret = runCmd('which bitbake', ignore_status=True)
+ if ret.status:
+ log.error("bitbake command not found")
+ return False
+ return True
+
+def setup_file_logging(log_file):
+ """Setup loggin to file"""
+ log_dir = os.path.dirname(log_file)
+ if not os.path.exists(log_dir):
+ os.makedirs(log_dir)
+ formatter = logging.Formatter(LOG_FORMAT)
+ handler = logging.FileHandler(log_file)
+ handler.setFormatter(formatter)
+ log.addHandler(handler)
+
+
+def archive_build_conf(out_dir):
+ """Archive build/conf to test results"""
+ src_dir = os.path.join(os.environ['BUILDDIR'], 'conf')
+ tgt_dir = os.path.join(out_dir, 'build', 'conf')
+ os.makedirs(os.path.dirname(tgt_dir))
+ shutil.copytree(src_dir, tgt_dir)
+
+
+def update_globalres_file(result_obj, filename, metadata):
+ """Write results to globalres csv file"""
+ # Map test names to time and size columns in globalres
+ # The tuples represent index and length of times and sizes
+ # respectively
+ gr_map = {'test1': ((0, 1), (8, 1)),
+ 'test12': ((1, 1), (None, None)),
+ 'test13': ((2, 1), (9, 1)),
+ 'test2': ((3, 1), (None, None)),
+ 'test3': ((4, 3), (None, None)),
+ 'test4': ((7, 1), (10, 2))}
+
+ values = ['0'] * 12
+ for status, test, _ in result_obj.all_results():
+ if status in ['ERROR', 'SKIPPED']:
+ continue
+ (t_ind, t_len), (s_ind, s_len) = gr_map[test.name]
+ if t_ind is not None:
+ values[t_ind:t_ind + t_len] = test.times
+ if s_ind is not None:
+ values[s_ind:s_ind + s_len] = test.sizes
+
+ log.debug("Writing globalres log to %s", filename)
+ rev_info = metadata['layers']['meta']
+ with open(filename, 'a') as fobj:
+ fobj.write('{},{}:{},{},'.format(metadata['hostname'],
+ rev_info['branch'],
+ rev_info['commit'],
+ rev_info['commit']))
+ fobj.write(','.join(values) + '\n')
+
+
+def parse_args(argv):
+ """Parse command line arguments"""
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+
+ parser.add_argument('-D', '--debug', action='store_true',
+ help='Enable debug level logging')
+ parser.add_argument('--globalres-file',
+ type=os.path.abspath,
+ help="Append results to 'globalres' csv file")
+ parser.add_argument('--lock-file', default='./oe-build-perf.lock',
+ metavar='FILENAME', type=os.path.abspath,
+ help="Lock file to use")
+ parser.add_argument('-o', '--out-dir', default='results-{date}',
+ type=os.path.abspath,
+ help="Output directory for test results")
+ parser.add_argument('-x', '--xml', action='store_true',
+ help='Enable JUnit xml output')
+ parser.add_argument('--log-file',
+ default='{out_dir}/oe-build-perf-test.log',
+ help="Log file of this script")
+ parser.add_argument('--run-tests', nargs='+', metavar='TEST',
+ help="List of tests to run")
+
+ return parser.parse_args(argv)
+
+
+def main(argv=None):
+ """Script entry point"""
+ args = parse_args(argv)
+
+ # Set-up log file
+ out_dir = args.out_dir.format(date=datetime.now().strftime('%Y%m%d%H%M%S'))
+ setup_file_logging(args.log_file.format(out_dir=out_dir))
+
+ if args.debug:
+ log.setLevel(logging.DEBUG)
+
+ lock_f = open(args.lock_file, 'w')
+ if not acquire_lock(lock_f):
+ log.error("Another instance of this script is running, exiting...")
+ return 1
+
+ if not pre_run_sanity_check():
+ return 1
+
+ # Check our capability to drop caches and ask pass if needed
+ KernelDropCaches.check()
+
+ # Load build perf tests
+ loader = BuildPerfTestLoader()
+ if args.run_tests:
+ suite = loader.loadTestsFromNames(args.run_tests, oeqa.buildperf)
+ else:
+ suite = loader.loadTestsFromModule(oeqa.buildperf)
+
+ # Save test metadata
+ metadata = metadata_from_bb()
+ log.info("Testing Git revision branch:commit %s:%s (%s)",
+ metadata['layers']['meta']['branch'],
+ metadata['layers']['meta']['commit'],
+ metadata['layers']['meta']['commit_count'])
+ if args.xml:
+ write_metadata_file(os.path.join(out_dir, 'metadata.xml'), metadata)
+ else:
+ with open(os.path.join(out_dir, 'metadata.json'), 'w') as fobj:
+ json.dump(metadata, fobj, indent=2)
+ archive_build_conf(out_dir)
+
+ runner = BuildPerfTestRunner(out_dir, verbosity=2)
+
+ # Suppress logger output to stderr so that the output from unittest
+ # is not mixed with occasional logger output
+ log.handlers[0].setLevel(logging.CRITICAL)
+
+ # Run actual tests
+ result = runner.run(suite)
+
+ # Restore logger output to stderr
+ log.handlers[0].setLevel(log.level)
+
+ if args.xml:
+ result.write_results_xml()
+ else:
+ result.write_results_json()
+ result.write_buildstats_json()
+ if args.globalres_file:
+ update_globalres_file(result, args.globalres_file, metadata)
+ if result.wasSuccessful():
+ return 0
+
+ return 2
+
+
+if __name__ == '__main__':
+ sys.exit(main())
+
diff --git a/poky/scripts/oe-buildenv-internal b/poky/scripts/oe-buildenv-internal
new file mode 100755
index 000000000..677387232
--- /dev/null
+++ b/poky/scripts/oe-buildenv-internal
@@ -0,0 +1,140 @@
+#!/bin/sh
+
+# OE-Core Build Environment Setup Script
+#
+# Copyright (C) 2006-2011 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+if ! $(return >/dev/null 2>&1) ; then
+ echo 'oe-buildenv-internal: error: this script must be sourced'
+ echo ''
+ echo 'Usage: . $OEROOT/scripts/oe-buildenv-internal &&'
+ echo ''
+ echo 'OpenEmbedded oe-buildenv-internal - an internal script that is'
+ echo 'used in oe-init-build-env to initialize oe build environment'
+ echo ''
+ exit 2
+fi
+
+# It is assumed OEROOT is already defined when this is called
+if [ -z "$OEROOT" ]; then
+ echo >&2 "Error: OEROOT is not defined!"
+ return 1
+fi
+
+if [ -z "$OE_SKIP_SDK_CHECK" ] && [ -n "$OECORE_SDK_VERSION" ]; then
+ echo >&2 "Error: The OE SDK/ADT was detected as already being present in this shell environment. Please use a clean shell when sourcing this environment script."
+ return 1
+fi
+
+# Make sure we're not using python v3.x as 'python', we don't support it.
+py_v2_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
+if [ -n "$py_v2_check" ]; then
+ echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
+ echo >&2 "Please set up python v2 as your default 'python' interpreter."
+ return 1
+fi
+unset py_v2_check
+
+py_v27_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
+if [ "$py_v27_check" != "True" ]; then
+ echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3."
+ echo >&2 "Please upgrade your python v2."
+fi
+unset py_v27_check
+
+# We potentially have code that doesn't parse correctly with older versions
+# of Python, and rather than fixing that and being eternally vigilant for
+# any other new feature use, just check the version here.
+py_v34_check=$(python3 -c 'import sys; print(sys.version_info >= (3,4,0))')
+if [ "$py_v34_check" != "True" ]; then
+ echo >&2 "BitBake requires Python 3.4.0 or later as 'python3'"
+ return 1
+fi
+unset py_v34_check
+
+if [ -z "$BDIR" ]; then
+ if [ -z "$1" ]; then
+ BDIR="build"
+ else
+ BDIR="$1"
+ if [ "$BDIR" = "/" ]; then
+ echo >&2 "Error: / is not supported as a build directory."
+ return 1
+ fi
+
+ # Remove any possible trailing slashes. This is used to work around
+ # buggy readlink in Ubuntu 10.04 that doesn't ignore trailing slashes
+ # and hence "readlink -f new_dir_to_be_created/" returns empty.
+ BDIR=$(echo $BDIR | sed -re 's|/+$||')
+
+ BDIR=$(readlink -f "$BDIR")
+ if [ -z "$BDIR" ]; then
+ PARENTDIR=$(dirname "$1")
+ echo >&2 "Error: the directory $PARENTDIR does not exist?"
+ return 1
+ fi
+ fi
+ if [ -n "$2" ]; then
+ BITBAKEDIR="$2"
+ fi
+fi
+if [ "${BDIR#/}" != "$BDIR" ]; then
+ BUILDDIR="$BDIR"
+else
+ BUILDDIR="$(pwd)/$BDIR"
+fi
+unset BDIR
+
+if [ -z "$BITBAKEDIR" ]; then
+ BITBAKEDIR="$OEROOT/bitbake$BBEXTRA"
+ test -d "$BITBAKEDIR" || BITBAKEDIR="$OEROOT/../bitbake$BBEXTRA"
+fi
+
+BITBAKEDIR=$(readlink -f "$BITBAKEDIR")
+BUILDDIR=$(readlink -f "$BUILDDIR")
+BBPATH=$BUILDDIR
+
+export BBPATH
+
+if [ ! -d "$BITBAKEDIR" ]; then
+ echo >&2 "Error: The bitbake directory ($BITBAKEDIR) does not exist! Please ensure a copy of bitbake exists at this location or specify an alternative path on the command line"
+ return 1
+fi
+
+# Make sure our paths are at the beginning of $PATH
+for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
+ # Remove any existences of $newpath from $PATH
+ PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
+
+ # Add $newpath to $PATH
+ PATH="$newpath:$PATH"
+done
+unset BITBAKEDIR newpath
+
+# Used by the runqemu script
+export BUILDDIR
+export PATH
+
+BB_ENV_EXTRAWHITE_OE="MACHINE DISTRO TCMODE TCLIBC HTTP_PROXY http_proxy \
+HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY ftps_proxy ALL_PROXY \
+all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \
+SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \
+SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR BBPATH_EXTRA BB_SETSCENE_ENFORCE"
+
+BB_ENV_EXTRAWHITE="$(echo $BB_ENV_EXTRAWHITE $BB_ENV_EXTRAWHITE_OE | tr ' ' '\n' | LC_ALL=C sort --unique | tr '\n' ' ')"
+
+export BB_ENV_EXTRAWHITE
diff --git a/poky/scripts/oe-check-sstate b/poky/scripts/oe-check-sstate
new file mode 100755
index 000000000..d06efe436
--- /dev/null
+++ b/poky/scripts/oe-check-sstate
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+
+# Query which tasks will be restored from sstate
+#
+# Copyright 2016 Intel Corporation
+# Authored-by: Paul Eggleton <paul.eggleton@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import subprocess
+import tempfile
+import shutil
+import re
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import scriptpath
+scriptpath.add_bitbake_lib_path()
+import argparse_oe
+
+
+def translate_virtualfns(tasks):
+ import bb.tinfoil
+ tinfoil = bb.tinfoil.Tinfoil()
+ try:
+ tinfoil.prepare(False)
+
+ recipecaches = tinfoil.cooker.recipecaches
+ outtasks = []
+ for task in tasks:
+ (mc, fn, taskname) = bb.runqueue.split_tid(task)
+ if taskname.endswith('_setscene'):
+ taskname = taskname[:-9]
+ outtasks.append('%s:%s' % (recipecaches[mc].pkg_fn[fn], taskname))
+ finally:
+ tinfoil.shutdown()
+ return outtasks
+
+
+def check(args):
+ tmpdir = tempfile.mkdtemp(prefix='oe-check-sstate-')
+ try:
+ env = os.environ.copy()
+ if not args.same_tmpdir:
+ env['BB_ENV_EXTRAWHITE'] = env.get('BB_ENV_EXTRAWHITE', '') + ' TMPDIR_forcevariable'
+ env['TMPDIR_forcevariable'] = tmpdir
+
+ try:
+ output = subprocess.check_output(
+ 'bitbake -n %s' % ' '.join(args.target),
+ stderr=subprocess.STDOUT,
+ env=env,
+ shell=True)
+
+ task_re = re.compile('NOTE: Running setscene task [0-9]+ of [0-9]+ \(([^)]+)\)')
+ tasks = []
+ for line in output.decode('utf-8').splitlines():
+ res = task_re.match(line)
+ if res:
+ tasks.append(res.group(1))
+ outtasks = translate_virtualfns(tasks)
+ except subprocess.CalledProcessError as e:
+ print('ERROR: bitbake failed:\n%s' % e.output.decode('utf-8'))
+ return e.returncode
+ finally:
+ shutil.rmtree(tmpdir)
+
+ if args.log:
+ with open(args.log, 'wb') as f:
+ f.write(output)
+
+ if args.outfile:
+ with open(args.outfile, 'w') as f:
+ for task in outtasks:
+ f.write('%s\n' % task)
+ else:
+ for task in outtasks:
+ print(task)
+
+ return 0
+
+
+def main():
+ parser = argparse_oe.ArgumentParser(description='OpenEmbedded sstate check tool. Does a dry-run to check restoring the specified targets from shared state, and lists the tasks that would be restored. Set BB_SETSCENE_ENFORCE=1 in the environment if you wish to ensure real tasks are disallowed.')
+
+ parser.add_argument('target', nargs='+', help='Target to check')
+ parser.add_argument('-o', '--outfile', help='Write list to a file instead of stdout')
+ parser.add_argument('-l', '--log', help='Write full log to a file')
+ parser.add_argument('-s', '--same-tmpdir', action='store_true', help='Use same TMPDIR for check (list will then be dependent on what tasks have executed previously)')
+
+ parser.set_defaults(func=check)
+
+ args = parser.parse_args()
+
+ ret = args.func(args)
+ return ret
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/oe-depends-dot b/poky/scripts/oe-depends-dot
new file mode 100755
index 000000000..5cec23bf0
--- /dev/null
+++ b/poky/scripts/oe-depends-dot
@@ -0,0 +1,121 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2018 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import os
+import sys
+import argparse
+import logging
+import re
+
+class Dot(object):
+ def __init__(self):
+ parser = argparse.ArgumentParser(
+ description="Analyse recipe-depends.dot generated by bitbake -g",
+ epilog="Use %(prog)s --help to get help")
+ parser.add_argument("dotfile",
+ help = "Specify the dotfile", nargs = 1, action='store', default='')
+ parser.add_argument("-k", "--key",
+ help = "Specify the key, e.g., recipe name",
+ action="store", default='')
+ parser.add_argument("-d", "--depends",
+ help = "Print the key's dependencies",
+ action="store_true", default=False)
+ parser.add_argument("-w", "--why",
+ help = "Print why the key is built",
+ action="store_true", default=False)
+ parser.add_argument("-r", "--remove",
+ help = "Remove duplicated dependencies to reduce the size of the dot files."
+ " For example, A->B, B->C, A->C, then A->C can be removed.",
+ action="store_true", default=False)
+
+ self.args = parser.parse_args()
+
+ if len(sys.argv) != 3 and len(sys.argv) < 5:
+ print('ERROR: Not enough args, see --help for usage')
+
+ def main(self):
+ #print(self.args.dotfile[0])
+ # The format is {key: depends}
+ depends = {}
+ with open(self.args.dotfile[0], 'r') as f:
+ for line in f.readlines():
+ if ' -> ' not in line:
+ continue
+ line_no_quotes = line.replace('"', '')
+ m = re.match("(.*) -> (.*)", line_no_quotes)
+ if not m:
+ print('WARNING: Found unexpected line: %s' % line)
+ continue
+ key = m.group(1)
+ if key == "meta-world-pkgdata":
+ continue
+ dep = m.group(2)
+ if key in depends:
+ if not key in depends[key]:
+ depends[key].add(dep)
+ else:
+ print('WARNING: Fonud duplicated line: %s' % line)
+ else:
+ depends[key] = set()
+ depends[key].add(dep)
+
+ if self.args.remove:
+ reduced_depends = {}
+ for k, deps in depends.items():
+ child_deps = set()
+ added = set()
+ # Both direct and indirect depends are already in the dict, so
+ # we don't have to do this recursively.
+ for dep in deps:
+ if dep in depends:
+ child_deps |= depends[dep]
+
+ reduced_depends[k] = deps - child_deps
+ outfile= '%s-reduced%s' % (self.args.dotfile[0][:-4], self.args.dotfile[0][-4:])
+ with open(outfile, 'w') as f:
+ print('Saving reduced dot file to %s' % outfile)
+ f.write('digraph depends {\n')
+ for k, v in reduced_depends.items():
+ for dep in v:
+ f.write('"%s" -> "%s"\n' % (k, dep))
+ f.write('}\n')
+ sys.exit(0)
+
+ if self.args.key not in depends:
+ print("ERROR: Can't find key %s in %s" % (self.args.key, self.args.dotfile[0]))
+ sys.exit(1)
+
+ if self.args.depends:
+ if self.args.key in depends:
+ print('Depends: %s' % ' '.join(depends[self.args.key]))
+
+ reverse_deps = []
+ if self.args.why:
+ for k, v in depends.items():
+ if self.args.key in v and not k in reverse_deps:
+ reverse_deps.append(k)
+ print('Because: %s' % ' '.join(reverse_deps))
+
+if __name__ == "__main__":
+ try:
+ dot = Dot()
+ ret = dot.main()
+ except Exception as esc:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/oe-find-native-sysroot b/poky/scripts/oe-find-native-sysroot
new file mode 100755
index 000000000..350ea2137
--- /dev/null
+++ b/poky/scripts/oe-find-native-sysroot
@@ -0,0 +1,115 @@
+#!/bin/bash
+#
+# Find a native sysroot to use - either from an in-tree OE build or
+# from a toolchain installation. It then ensures the variable
+# $OECORE_NATIVE_SYSROOT is set to the sysroot's base directory, and sets
+# $PSEUDO to the path of the pseudo binary.
+#
+# This script is intended to be run within other scripts by source'ing
+# it, e.g:
+#
+# SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
+# . $SYSROOT_SETUP_SCRIPT <recipe>
+#
+# This script will terminate execution of your calling program unless
+# you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string
+# beforehand.
+#
+# Copyright (c) 2010 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then
+ echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]'
+ echo ''
+ echo 'OpenEmbedded find-native-sysroot - helper script to set'
+ echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO'
+ echo 'to the path of the native sysroot directory and pseudo'
+ echo 'executable binary'
+ echo ''
+ echo 'options:'
+ echo ' recipe its STAGING_DIR_NATIVE is used as native sysroot'
+ echo ' -h, --help show this help message and exit'
+ echo ''
+ exit 2
+fi
+
+# Global vars
+BITBAKE_E=""
+set_oe_native_sysroot(){
+ echo "Running bitbake -e $1"
+ BITBAKE_E="`bitbake -e $1`"
+ OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE= | cut -d '"' -f2`
+
+ if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
+ # This indicates that there was an error running bitbake -e that
+ # the user needs to be informed of
+ echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
+ echo "Here is the output from bitbake -e $1"
+ echo $BITBAKE_E
+ exit 1
+ fi
+}
+
+if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
+ BITBAKE=`which bitbake 2> /dev/null`
+ if [ "x$BITBAKE" != "x" ]; then
+ if [ "$UID" = "0" ]; then
+ # Root cannot run bitbake unless sanity checking is disabled
+ if [ ! -d "./conf" ]; then
+ echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking"
+ exit 1
+ fi
+ touch conf/sanity.conf
+ set_oe_native_sysroot $1
+ rm -f conf/sanity.conf
+ else
+ set_oe_native_sysroot $1
+ fi
+ else
+ echo "Error: Unable to locate bitbake command."
+ echo "Did you forget to source the build environment setup script?"
+
+ if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
+ exit 1
+ fi
+ fi
+fi
+
+if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then
+ echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist."
+
+ if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
+ if [[ $1 =~ .*native.* ]]; then
+ echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?"
+ else
+ echo "Have you run 'bitbake $1 '?"
+ fi
+ else
+ echo "This shouldn't happen - something is wrong with your toolchain installation"
+ fi
+
+ if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
+ exit 1
+ fi
+fi
+
+# Set up pseudo command
+pseudo="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
+if [ -e "$pseudo" ]; then
+ echo "PSEUDO=$pseudo"
+ PSEUDO="$pseudo"
+else
+ echo "PSEUDO $pseudo is not found."
+fi
diff --git a/poky/scripts/oe-git-archive b/poky/scripts/oe-git-archive
new file mode 100755
index 000000000..ab19cb9aa
--- /dev/null
+++ b/poky/scripts/oe-git-archive
@@ -0,0 +1,271 @@
+#!/usr/bin/python3
+#
+# Helper script for committing data to git and pushing upstream
+#
+# Copyright (c) 2017, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+import argparse
+import glob
+import json
+import logging
+import math
+import os
+import re
+import sys
+from collections import namedtuple, OrderedDict
+from datetime import datetime, timedelta, tzinfo
+from operator import attrgetter
+
+# Import oe and bitbake libs
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(scripts_path, 'lib'))
+import scriptpath
+scriptpath.add_bitbake_lib_path()
+scriptpath.add_oe_lib_path()
+
+from oeqa.utils.git import GitRepo, GitError
+from oeqa.utils.metadata import metadata_from_bb
+
+
+# Setup logging
+logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
+log = logging.getLogger()
+
+
+class ArchiveError(Exception):
+ """Internal error handling of this script"""
+
+
+def format_str(string, fields):
+ """Format string using the given fields (dict)"""
+ try:
+ return string.format(**fields)
+ except KeyError as err:
+ raise ArchiveError("Unable to expand string '{}': unknown field {} "
+ "(valid fields are: {})".format(
+ string, err, ', '.join(sorted(fields.keys()))))
+
+
+def init_git_repo(path, no_create, bare):
+ """Initialize local Git repository"""
+ path = os.path.abspath(path)
+ if os.path.isfile(path):
+ raise ArchiveError("Invalid Git repo at {}: path exists but is not a "
+ "directory".format(path))
+ if not os.path.isdir(path) or not os.listdir(path):
+ if no_create:
+ raise ArchiveError("No git repo at {}, refusing to create "
+ "one".format(path))
+ if not os.path.isdir(path):
+ try:
+ os.mkdir(path)
+ except (FileNotFoundError, PermissionError) as err:
+ raise ArchiveError("Failed to mkdir {}: {}".format(path, err))
+ if not os.listdir(path):
+ log.info("Initializing a new Git repo at %s", path)
+ repo = GitRepo.init(path, bare)
+ try:
+ repo = GitRepo(path, is_topdir=True)
+ except GitError:
+ raise ArchiveError("Non-empty directory that is not a Git repository "
+ "at {}\nPlease specify an existing Git repository, "
+ "an empty directory or a non-existing directory "
+ "path.".format(path))
+ return repo
+
+
+def git_commit_data(repo, data_dir, branch, message, exclude, notes):
+ """Commit data into a Git repository"""
+ log.info("Committing data into to branch %s", branch)
+ tmp_index = os.path.join(repo.git_dir, 'index.oe-git-archive')
+ try:
+ # Create new tree object from the data
+ env_update = {'GIT_INDEX_FILE': tmp_index,
+ 'GIT_WORK_TREE': os.path.abspath(data_dir)}
+ repo.run_cmd('add .', env_update)
+
+ # Remove files that are excluded
+ if exclude:
+ repo.run_cmd(['rm', '--cached'] + [f for f in exclude], env_update)
+
+ tree = repo.run_cmd('write-tree', env_update)
+
+ # Create new commit object from the tree
+ parent = repo.rev_parse(branch)
+ git_cmd = ['commit-tree', tree, '-m', message]
+ if parent:
+ git_cmd += ['-p', parent]
+ commit = repo.run_cmd(git_cmd, env_update)
+
+ # Create git notes
+ for ref, filename in notes:
+ ref = ref.format(branch_name=branch)
+ repo.run_cmd(['notes', '--ref', ref, 'add',
+ '-F', os.path.abspath(filename), commit])
+
+ # Update branch head
+ git_cmd = ['update-ref', 'refs/heads/' + branch, commit]
+ if parent:
+ git_cmd.append(parent)
+ repo.run_cmd(git_cmd)
+
+ # Update current HEAD, if we're on branch 'branch'
+ if not repo.bare and repo.get_current_branch() == branch:
+ log.info("Updating %s HEAD to latest commit", repo.top_dir)
+ repo.run_cmd('reset --hard')
+
+ return commit
+ finally:
+ if os.path.exists(tmp_index):
+ os.unlink(tmp_index)
+
+
+def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
+ keywords):
+ """Generate tag name and message, with support for running id number"""
+ keyws = keywords.copy()
+ # Tag number is handled specially: if not defined, we autoincrement it
+ if 'tag_number' not in keyws:
+ # Fill in all other fields than 'tag_number'
+ keyws['tag_number'] = '{tag_number}'
+ tag_re = format_str(name_pattern, keyws)
+ # Replace parentheses for proper regex matching
+ tag_re = tag_re.replace('(', '\(').replace(')', '\)') + '$'
+ # Inject regex group pattern for 'tag_number'
+ tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})')
+
+ keyws['tag_number'] = 0
+ for existing_tag in repo.run_cmd('tag').splitlines():
+ match = re.match(tag_re, existing_tag)
+
+ if match and int(match.group('tag_number')) >= keyws['tag_number']:
+ keyws['tag_number'] = int(match.group('tag_number')) + 1
+
+ tag_name = format_str(name_pattern, keyws)
+ msg_subj= format_str(msg_subj_pattern.strip(), keyws)
+ msg_body = format_str(msg_body_pattern, keyws)
+ return tag_name, msg_subj + '\n\n' + msg_body
+
+
+def parse_args(argv):
+ """Parse command line arguments"""
+ parser = argparse.ArgumentParser(
+ description="Commit data to git and push upstream",
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+
+ parser.add_argument('--debug', '-D', action='store_true',
+ help="Verbose logging")
+ parser.add_argument('--git-dir', '-g', required=True,
+ help="Local git directory to use")
+ parser.add_argument('--no-create', action='store_true',
+ help="If GIT_DIR is not a valid Git repository, do not "
+ "try to create one")
+ parser.add_argument('--bare', action='store_true',
+ help="Initialize a bare repository when creating a "
+ "new one")
+ parser.add_argument('--push', '-p', nargs='?', default=False, const=True,
+ help="Push to remote")
+ parser.add_argument('--branch-name', '-b',
+ default='{hostname}/{branch}/{machine}',
+ help="Git branch name (pattern) to use")
+ parser.add_argument('--no-tag', action='store_true',
+ help="Do not create Git tag")
+ parser.add_argument('--tag-name', '-t',
+ default='{hostname}/{branch}/{machine}/{commit_count}-g{commit}/{tag_number}',
+ help="Tag name (pattern) to use")
+ parser.add_argument('--commit-msg-subject',
+ default='Results of {branch}:{commit} on {hostname}',
+ help="Subject line (pattern) to use in the commit message")
+ parser.add_argument('--commit-msg-body',
+ default='branch: {branch}\ncommit: {commit}\nhostname: {hostname}',
+ help="Commit message body (pattern)")
+ parser.add_argument('--tag-msg-subject',
+ default='Test run #{tag_number} of {branch}:{commit} on {hostname}',
+ help="Subject line (pattern) of the tag message")
+ parser.add_argument('--tag-msg-body',
+ default='',
+ help="Tag message body (pattern)")
+ parser.add_argument('--exclude', action='append', default=[],
+ help="Glob to exclude files from the commit. Relative "
+ "to DATA_DIR. May be specified multiple times")
+ parser.add_argument('--notes', nargs=2, action='append', default=[],
+ metavar=('GIT_REF', 'FILE'),
+ help="Add a file as a note under refs/notes/GIT_REF. "
+ "{branch_name} in GIT_REF will be expanded to the "
+ "actual target branch name (specified by "
+ "--branch-name). This option may be specified "
+ "multiple times.")
+ parser.add_argument('data_dir', metavar='DATA_DIR',
+ help="Data to commit")
+ return parser.parse_args(argv)
+
+
+def main(argv=None):
+ """Script entry point"""
+ args = parse_args(argv)
+ if args.debug:
+ log.setLevel(logging.DEBUG)
+
+ try:
+ if not os.path.isdir(args.data_dir):
+ raise ArchiveError("Not a directory: {}".format(args.data_dir))
+
+ data_repo = init_git_repo(args.git_dir, args.no_create, args.bare)
+
+ # Get keywords to be used in tag and branch names and messages
+ metadata = metadata_from_bb()
+ keywords = {'hostname': metadata['hostname'],
+ 'branch': metadata['layers']['meta']['branch'],
+ 'commit': metadata['layers']['meta']['commit'],
+ 'commit_count': metadata['layers']['meta']['commit_count'],
+ 'machine': metadata['config']['MACHINE']}
+
+ # Expand strings early in order to avoid getting into inconsistent
+ # state (e.g. no tag even if data was committed)
+ commit_msg = format_str(args.commit_msg_subject.strip(), keywords)
+ commit_msg += '\n\n' + format_str(args.commit_msg_body, keywords)
+ branch_name = format_str(args.branch_name, keywords)
+ tag_name = None
+ if not args.no_tag and args.tag_name:
+ tag_name, tag_msg = expand_tag_strings(data_repo, args.tag_name,
+ args.tag_msg_subject,
+ args.tag_msg_body, keywords)
+
+ # Commit data
+ commit = git_commit_data(data_repo, args.data_dir, branch_name,
+ commit_msg, args.exclude, args.notes)
+
+ # Create tag
+ if tag_name:
+ log.info("Creating tag %s", tag_name)
+ data_repo.run_cmd(['tag', '-a', '-m', tag_msg, tag_name, commit])
+
+ # Push data to remote
+ if args.push:
+ cmd = ['push', '--tags']
+ # If no remote is given we push with the default settings from
+ # gitconfig
+ if args.push is not True:
+ notes_refs = ['refs/notes/' + ref.format(branch_name=branch_name)
+ for ref, _ in args.notes]
+ cmd.extend([args.push, branch_name] + notes_refs)
+ log.info("Pushing data to remote")
+ data_repo.run_cmd(cmd)
+
+ except ArchiveError as err:
+ log.error(str(err))
+ return 1
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/oe-git-proxy b/poky/scripts/oe-git-proxy
new file mode 100755
index 000000000..7a43fe6a6
--- /dev/null
+++ b/poky/scripts/oe-git-proxy
@@ -0,0 +1,181 @@
+#!/bin/bash
+
+# oe-git-proxy is a simple tool to be via GIT_PROXY_COMMAND. It uses socat
+# to make SOCKS5 or HTTPS proxy connections.
+# It uses ALL_PROXY or all_proxy or http_proxy to determine the proxy server,
+# protocol, and port.
+# It uses NO_PROXY to skip using the proxy for a comma delimited list of
+# hosts, host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24). It
+# is known to work with both bash and dash shells.
+#
+# Example ALL_PROXY values:
+# ALL_PROXY=socks://socks.example.com:1080
+# ALL_PROXY=https://proxy.example.com:8080
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# AUTHORS
+# Darren Hart <dvhart@linux.intel.com>
+
+if [ $# -lt 2 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+ echo 'oe-git-proxy: error: the following arguments are required: host port'
+ echo 'Usage: oe-git-proxy host port'
+ echo ''
+ echo 'OpenEmbedded git-proxy - a simple tool to be used via GIT_PROXY_COMMAND.'
+ echo 'It uses socat to make SOCKS or HTTPS proxy connections.'
+ echo 'It uses ALL_PROXY to determine the proxy server, protocol, and port.'
+ echo 'It uses NO_PROXY to skip using the proxy for a comma delimited list'
+ echo 'of hosts, host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24).'
+ echo 'It is known to work with both bash and dash shells.runs native tools'
+ echo ''
+ echo 'arguments:'
+ echo ' host proxy host to use'
+ echo ' port proxy port to use'
+ echo ''
+ echo 'options:'
+ echo ' -h, --help show this help message and exit'
+ echo ''
+ exit 2
+fi
+
+# Locate the netcat binary
+SOCAT=$(which socat 2>/dev/null)
+if [ $? -ne 0 ]; then
+ echo "ERROR: socat binary not in PATH" 1>&2
+ exit 1
+fi
+METHOD=""
+
+# Test for a valid IPV4 quad with optional bitmask
+valid_ipv4() {
+ echo $1 | egrep -q "^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}(/(3[0-2]|[1-2]?[0-9]))?$"
+ return $?
+}
+
+# Convert an IPV4 address into a 32bit integer
+ipv4_val() {
+ IP="$1"
+ SHIFT=24
+ VAL=0
+ for B in ${IP//./ }; do
+ VAL=$(($VAL+$(($B<<$SHIFT))))
+ SHIFT=$(($SHIFT-8))
+ done
+ echo "$VAL"
+}
+
+# Determine if two IPs are equivalent, or if the CIDR contains the IP
+match_ipv4() {
+ CIDR=$1
+ IP=$2
+
+ if [ -z "${IP%%$CIDR}" ]; then
+ return 0
+ fi
+
+ # Determine the mask bitlength
+ BITS=${CIDR##*/}
+ [ "$BITS" != "$CIDR" ] || BITS=32
+ if [ -z "$BITS" ]; then
+ return 1
+ fi
+
+ IPVAL=$(ipv4_val $IP)
+ IP2VAL=$(ipv4_val ${CIDR%%/*})
+
+ # OR in the unmasked bits
+ for i in $(seq 0 $((32-$BITS))); do
+ IP2VAL=$(($IP2VAL|$((1<<$i))))
+ IPVAL=$(($IPVAL|$((1<<$i))))
+ done
+
+ if [ $IPVAL -eq $IP2VAL ]; then
+ return 0
+ fi
+ return 1
+}
+
+# Test to see if GLOB matches HOST
+match_host() {
+ HOST=$1
+ GLOB=$2
+
+ if [ -z "${HOST%%$GLOB}" ]; then
+ return 0
+ fi
+
+ # Match by netmask
+ if valid_ipv4 $GLOB; then
+ for HOST_IP in $(getent ahostsv4 $HOST | grep ' STREAM ' | cut -d ' ' -f 1) ; do
+ if valid_ipv4 $HOST_IP; then
+ match_ipv4 $GLOB $HOST_IP
+ if [ $? -eq 0 ]; then
+ return 0
+ fi
+ fi
+ done
+ fi
+
+ return 1
+}
+
+# If no proxy is set or needed, just connect directly
+METHOD="TCP:$1:$2"
+
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$all_proxy
+[ -z "${ALL_PROXY}" ] && ALL_PROXY=$http_proxy
+
+if [ -z "$ALL_PROXY" ]; then
+ exec $SOCAT STDIO $METHOD
+fi
+
+# Connect directly to hosts in NO_PROXY
+for H in ${NO_PROXY//,/ }; do
+ if match_host $1 $H; then
+ exec $SOCAT STDIO $METHOD
+ fi
+done
+
+# Proxy is necessary, determine protocol, server, and port
+# extract protocol
+PROTO=${ALL_PROXY%://*}
+# strip protocol:// from string
+ALL_PROXY=${ALL_PROXY#*://}
+# extract host & port parts:
+# 1) drop username/password
+PROXY=${ALL_PROXY##*@}
+# 2) remove optional trailing /?
+PROXY=${PROXY%%/*}
+# 3) extract optional port
+PORT=${PROXY##*:}
+if [ "$PORT" = "$PROXY" ]; then
+ PORT=""
+fi
+# 4) remove port
+PROXY=${PROXY%%:*}
+
+# extract username & password
+PROXYAUTH="${ALL_PROXY%@*}"
+[ "$PROXYAUTH" = "$ALL_PROXY" ] && PROXYAUTH=
+[ -n "${PROXYAUTH}" ] && PROXYAUTH=",proxyauth=${PROXYAUTH}"
+
+if [ "$PROTO" = "socks" ] || [ "$PROTO" = "socks4a" ]; then
+ if [ -z "$PORT" ]; then
+ PORT="1080"
+ fi
+ METHOD="SOCKS4A:$PROXY:$1:$2,socksport=$PORT"
+elif [ "$PROTO" = "socks4" ]; then
+ if [ -z "$PORT" ]; then
+ PORT="1080"
+ fi
+ METHOD="SOCKS4:$PROXY:$1:$2,socksport=$PORT"
+else
+ # Assume PROXY (http, https, etc)
+ if [ -z "$PORT" ]; then
+ PORT="8080"
+ fi
+ METHOD="PROXY:$PROXY:$1:$2,proxyport=${PORT}${PROXYAUTH}"
+fi
+
+exec $SOCAT STDIO "$METHOD"
diff --git a/poky/scripts/oe-gnome-terminal-phonehome b/poky/scripts/oe-gnome-terminal-phonehome
new file mode 100755
index 000000000..e02354883
--- /dev/null
+++ b/poky/scripts/oe-gnome-terminal-phonehome
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# Gnome terminal won't tell us which PID a given command is run as
+# or allow a single instance so we can't tell when it completes.
+# This allows us to figure out the PID of the target so we can tell
+# when its done.
+#
+echo $$ > $1
+shift
+exec $@
diff --git a/poky/scripts/oe-pkgdata-util b/poky/scripts/oe-pkgdata-util
new file mode 100755
index 000000000..aea8a5751
--- /dev/null
+++ b/poky/scripts/oe-pkgdata-util
@@ -0,0 +1,630 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded pkgdata utility
+#
+# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright 2012-2015 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+import sys
+import os
+import os.path
+import fnmatch
+import re
+import argparse
+import logging
+from collections import defaultdict, OrderedDict
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import argparse_oe
+logger = scriptutils.logger_create('pkgdatautil')
+
+def tinfoil_init():
+ import bb.tinfoil
+ import logging
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.logger.setLevel(logging.WARNING)
+ tinfoil.prepare(True)
+ return tinfoil
+
+
+def glob(args):
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ globs = []
+ for globitem in args.glob:
+ globs.extend(globitem.split())
+
+ if not os.path.exists(args.pkglistfile):
+ logger.error('Unable to find package list file %s' % args.pkglistfile)
+ sys.exit(1)
+
+ skipval = "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-"
+ if args.exclude:
+ skipval += "|" + args.exclude
+ skipregex = re.compile(skipval)
+
+ skippedpkgs = set()
+ mappedpkgs = set()
+ with open(args.pkglistfile, 'r') as f:
+ for line in f:
+ fields = line.rstrip().split()
+ if not fields:
+ continue
+ pkg = fields[0]
+ # We don't care about other args (used to need the package architecture but the
+ # new pkgdata structure avoids the need for that)
+
+ # Skip packages for which there is no point applying globs
+ if skipregex.search(pkg):
+ logger.debug("%s -> !!" % pkg)
+ skippedpkgs.add(pkg)
+ continue
+
+ # Skip packages that already match the globs, so if e.g. a dev package
+ # is already installed and thus in the list, we don't process it any further
+ # Most of these will be caught by skipregex already, but just in case...
+ already = False
+ for g in globs:
+ if fnmatch.fnmatchcase(pkg, g):
+ already = True
+ break
+ if already:
+ skippedpkgs.add(pkg)
+ logger.debug("%s -> !" % pkg)
+ continue
+
+ # Define some functions
+ def revpkgdata(pkgn):
+ return os.path.join(args.pkgdata_dir, "runtime-reverse", pkgn)
+ def fwdpkgdata(pkgn):
+ return os.path.join(args.pkgdata_dir, "runtime", pkgn)
+ def readpn(pkgdata_file):
+ pn = ""
+ with open(pkgdata_file, 'r') as f:
+ for line in f:
+ if line.startswith("PN:"):
+ pn = line.split(': ')[1].rstrip()
+ return pn
+ def readrenamed(pkgdata_file):
+ renamed = ""
+ pn = os.path.basename(pkgdata_file)
+ with open(pkgdata_file, 'r') as f:
+ for line in f:
+ if line.startswith("PKG_%s:" % pn):
+ renamed = line.split(': ')[1].rstrip()
+ return renamed
+
+ # Main processing loop
+ for g in globs:
+ mappedpkg = ""
+ # First just try substitution (i.e. packagename -> packagename-dev)
+ newpkg = g.replace("*", pkg)
+ revlink = revpkgdata(newpkg)
+ if os.path.exists(revlink):
+ mappedpkg = os.path.basename(os.readlink(revlink))
+ fwdfile = fwdpkgdata(mappedpkg)
+ if os.path.exists(fwdfile):
+ mappedpkg = readrenamed(fwdfile)
+ if not os.path.exists(fwdfile + ".packaged"):
+ mappedpkg = ""
+ else:
+ revlink = revpkgdata(pkg)
+ if os.path.exists(revlink):
+ # Check if we can map after undoing the package renaming (by resolving the symlink)
+ origpkg = os.path.basename(os.readlink(revlink))
+ newpkg = g.replace("*", origpkg)
+ fwdfile = fwdpkgdata(newpkg)
+ if os.path.exists(fwdfile):
+ mappedpkg = readrenamed(fwdfile)
+ else:
+ # That didn't work, so now get the PN, substitute that, then map in the other direction
+ pn = readpn(revlink)
+ newpkg = g.replace("*", pn)
+ fwdfile = fwdpkgdata(newpkg)
+ if os.path.exists(fwdfile):
+ mappedpkg = readrenamed(fwdfile)
+ if not os.path.exists(fwdfile + ".packaged"):
+ mappedpkg = ""
+ else:
+ # Package doesn't even exist...
+ logger.debug("%s is not a valid package!" % (pkg))
+ break
+
+ if mappedpkg:
+ logger.debug("%s (%s) -> %s" % (pkg, g, mappedpkg))
+ mappedpkgs.add(mappedpkg)
+ else:
+ logger.debug("%s (%s) -> ?" % (pkg, g))
+
+ logger.debug("------")
+
+ print("\n".join(mappedpkgs - skippedpkgs))
+
+def read_value(args):
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ packages = []
+ if args.file:
+ with open(args.file, 'r') as f:
+ for line in f:
+ splitline = line.split()
+ if splitline:
+ packages.append(splitline[0])
+ else:
+ for pkgitem in args.pkg:
+ packages.extend(pkgitem.split())
+ if not packages:
+ logger.error("No packages specified")
+ sys.exit(1)
+
+ def readvar(pkgdata_file, valuename, mappedpkg):
+ val = ""
+ with open(pkgdata_file, 'r') as f:
+ for line in f:
+ if (line.startswith(valuename + ":") or
+ line.startswith(valuename + "_" + mappedpkg + ":")):
+ val = line.split(': ', 1)[1].rstrip()
+ return val
+
+ logger.debug("read-value('%s', '%s' '%s')" % (args.pkgdata_dir, args.valuename, packages))
+ for package in packages:
+ pkg_split = package.split('_')
+ pkg_name = pkg_split[0]
+ logger.debug("package: '%s'" % pkg_name)
+ revlink = os.path.join(args.pkgdata_dir, "runtime-reverse", pkg_name)
+ logger.debug(revlink)
+ if os.path.exists(revlink):
+ mappedpkg = os.path.basename(os.readlink(revlink))
+ qvar = args.valuename
+ value = readvar(revlink, qvar, mappedpkg)
+ if qvar == "PKGSIZE":
+ # PKGSIZE is now in bytes, but we we want it in KB
+ pkgsize = (int(value) + 1024 // 2) // 1024
+ value = "%d" % pkgsize
+ if args.unescape:
+ import codecs
+ # escape_decode() unescapes backslash encodings in byte streams
+ value = codecs.escape_decode(bytes(value, "utf-8"))[0].decode("utf-8")
+ if args.prefix_name:
+ print('%s %s' % (pkg_name, value))
+ else:
+ print(value)
+ else:
+ logger.debug("revlink %s does not exist", revlink)
+
+def lookup_pkglist(pkgs, pkgdata_dir, reverse):
+ if reverse:
+ mappings = OrderedDict()
+ for pkg in pkgs:
+ revlink = os.path.join(pkgdata_dir, "runtime-reverse", pkg)
+ logger.debug(revlink)
+ if os.path.exists(revlink):
+ mappings[pkg] = os.path.basename(os.readlink(revlink))
+ else:
+ mappings = defaultdict(list)
+ for pkg in pkgs:
+ pkgfile = os.path.join(pkgdata_dir, 'runtime', pkg)
+ if os.path.exists(pkgfile):
+ with open(pkgfile, 'r') as f:
+ for line in f:
+ fields = line.rstrip().split(': ')
+ if fields[0] == 'PKG_%s' % pkg:
+ mappings[pkg].append(fields[1])
+ break
+ return mappings
+
+def lookup_pkg(args):
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ pkgs = []
+ for pkgitem in args.pkg:
+ pkgs.extend(pkgitem.split())
+
+ mappings = lookup_pkglist(pkgs, args.pkgdata_dir, args.reverse)
+
+ if len(mappings) < len(pkgs):
+ missing = list(set(pkgs) - set(mappings.keys()))
+ logger.error("The following packages could not be found: %s" % ', '.join(missing))
+ sys.exit(1)
+
+ if args.reverse:
+ items = list(mappings.values())
+ else:
+ items = []
+ for pkg in pkgs:
+ items.extend(mappings.get(pkg, []))
+
+ print('\n'.join(items))
+
+def lookup_recipe(args):
+ def parse_pkgdatafile(pkgdatafile):
+ with open(pkgdatafile, 'r') as f:
+ found = False
+ for line in f:
+ if line.startswith('PN:'):
+ print("%s" % line.split(':', 1)[1].strip())
+ found = True
+ break
+ if not found:
+ logger.error("Unable to find PN entry in %s" % pkgdatafile)
+ sys.exit(1)
+
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ pkgs = []
+ for pkgitem in args.pkg:
+ pkgs.extend(pkgitem.split())
+
+ for pkg in pkgs:
+ providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
+ if os.path.exists(providepkgpath):
+ for f in os.listdir(providepkgpath):
+ if f != pkg:
+ print("%s is in the RPROVIDES of %s:" % (pkg, f))
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
+ parse_pkgdatafile(pkgdatafile)
+ break
+ pkgdatafile = os.path.join(args.pkgdata_dir, 'runtime-reverse', pkg)
+ if not os.path.exists(pkgdatafile):
+ logger.error("The following packages could not be found: %s" % pkg)
+ sys.exit(1)
+ parse_pkgdatafile(pkgdatafile)
+
+def package_info(args):
+ def parse_pkgdatafile(pkgdatafile):
+ with open(pkgdatafile, 'r') as f:
+ pkge = ''
+ pkgr = ''
+ pe = ''
+ pr = ''
+ for line in f:
+ if line.startswith('PKGV:'):
+ pkg_version = line.split(':', 1)[1].strip()
+ elif line.startswith('PKGE:'):
+ pkge = line.split(':', 1)[1].strip()
+ elif line.startswith('PKGR:'):
+ pkgr = line.split(':', 1)[1].strip()
+ elif line.startswith('PN:'):
+ recipe = line.split(':', 1)[1].strip()
+ elif line.startswith('PV:'):
+ recipe_version = line.split(':', 1)[1].strip()
+ elif line.startswith('PE:'):
+ pe = line.split(':', 1)[1].strip()
+ elif line.startswith('PR:'):
+ pr = line.split(':', 1)[1].strip()
+ elif line.startswith('PKGSIZE'):
+ pkg_size = line.split(':', 1)[1].strip()
+ if pkge:
+ pkg_version = pkge + ":" + pkg_version
+ if pkgr:
+ pkg_version = pkg_version + "-" + pkgr
+ if pe:
+ recipe_version = pe + ":" + recipe_version
+ if pr:
+ recipe_version = recipe_version + "-" + pr
+ print("%s %s %s %s %s" % (pkg, pkg_version, recipe, recipe_version, pkg_size))
+
+ # Handle both multiple arguments and multiple values within an arg (old syntax)
+ packages = []
+ if args.file:
+ with open(args.file, 'r') as f:
+ for line in f:
+ splitline = line.split()
+ if splitline:
+ packages.append(splitline[0])
+ else:
+ for pkgitem in args.pkg:
+ packages.extend(pkgitem.split())
+ if not packages:
+ logger.error("No packages specified")
+ sys.exit(1)
+
+ for pkg in packages:
+ providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
+ if os.path.exists(providepkgpath):
+ for f in os.listdir(providepkgpath):
+ if f != pkg:
+ print("%s is in the RPROVIDES of %s:" % (pkg, f))
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
+ parse_pkgdatafile(pkgdatafile)
+ break
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime-reverse", pkg)
+ if not os.path.exists(pkgdatafile):
+ logger.error("Unable to find any built runtime package named %s" % pkg)
+ sys.exit(1)
+ parse_pkgdatafile(pkgdatafile)
+
+def get_recipe_pkgs(pkgdata_dir, recipe, unpackaged):
+ recipedatafile = os.path.join(pkgdata_dir, recipe)
+ if not os.path.exists(recipedatafile):
+ logger.error("Unable to find packaged recipe with name %s" % recipe)
+ sys.exit(1)
+ packages = []
+ with open(recipedatafile, 'r') as f:
+ for line in f:
+ fields = line.rstrip().split(': ')
+ if fields[0] == 'PACKAGES':
+ packages = fields[1].split()
+ break
+
+ if not unpackaged:
+ pkglist = []
+ for pkg in packages:
+ if os.path.exists(os.path.join(pkgdata_dir, 'runtime', '%s.packaged' % pkg)):
+ pkglist.append(pkg)
+ return pkglist
+ else:
+ return packages
+
+def list_pkgs(args):
+ found = False
+
+ def matchpkg(pkg):
+ if args.pkgspec:
+ matched = False
+ for pkgspec in args.pkgspec:
+ if fnmatch.fnmatchcase(pkg, pkgspec):
+ matched = True
+ break
+ if not matched:
+ return False
+ if not args.unpackaged:
+ if args.runtime:
+ revlink = os.path.join(args.pkgdata_dir, "runtime-reverse", pkg)
+ if os.path.exists(revlink):
+ # We're unlikely to get here if the package was not packaged, but just in case
+ # we add the symlinks for unpackaged files in the future
+ mappedpkg = os.path.basename(os.readlink(revlink))
+ if not os.path.exists(os.path.join(args.pkgdata_dir, 'runtime', '%s.packaged' % mappedpkg)):
+ return False
+ else:
+ return False
+ else:
+ if not os.path.exists(os.path.join(args.pkgdata_dir, 'runtime', '%s.packaged' % pkg)):
+ return False
+ return True
+
+ if args.recipe:
+ packages = get_recipe_pkgs(args.pkgdata_dir, args.recipe, args.unpackaged)
+
+ if args.runtime:
+ pkglist = []
+ runtime_pkgs = lookup_pkglist(packages, args.pkgdata_dir, False)
+ for rtpkgs in runtime_pkgs.values():
+ pkglist.extend(rtpkgs)
+ else:
+ pkglist = packages
+
+ for pkg in pkglist:
+ if matchpkg(pkg):
+ found = True
+ print("%s" % pkg)
+ else:
+ if args.runtime:
+ searchdir = 'runtime-reverse'
+ else:
+ searchdir = 'runtime'
+
+ for root, dirs, files in os.walk(os.path.join(args.pkgdata_dir, searchdir)):
+ for fn in files:
+ if fn.endswith('.packaged'):
+ continue
+ if matchpkg(fn):
+ found = True
+ print("%s" % fn)
+ if not found:
+ if args.pkgspec:
+ logger.error("Unable to find any package matching %s" % args.pkgspec)
+ else:
+ logger.error("No packages found")
+ sys.exit(1)
+
+def list_pkg_files(args):
+ import json
+ def parse_pkgdatafile(pkgdatafile, long=False):
+ with open(pkgdatafile, 'r') as f:
+ found = False
+ for line in f:
+ if line.startswith('FILES_INFO:'):
+ found = True
+ val = line.split(':', 1)[1].strip()
+ dictval = json.loads(val)
+ if long:
+ width = max(map(len, dictval), default=0)
+ for fullpth in sorted(dictval):
+ print("\t{:{width}}\t{}".format(fullpth, dictval[fullpth], width=width))
+ else:
+ for fullpth in sorted(dictval):
+ print("\t%s" % fullpth)
+ break
+ if not found:
+ logger.error("Unable to find FILES_INFO entry in %s" % pkgdatafile)
+ sys.exit(1)
+
+
+ if args.recipe:
+ if args.pkg:
+ logger.error("list-pkg-files: If -p/--recipe is specified then a package name cannot be specified")
+ sys.exit(1)
+ recipepkglist = get_recipe_pkgs(args.pkgdata_dir, args.recipe, args.unpackaged)
+ if args.runtime:
+ pkglist = []
+ runtime_pkgs = lookup_pkglist(recipepkglist, args.pkgdata_dir, False)
+ for rtpkgs in runtime_pkgs.values():
+ pkglist.extend(rtpkgs)
+ else:
+ pkglist = recipepkglist
+ else:
+ if not args.pkg:
+ logger.error("list-pkg-files: If -p/--recipe is not specified then at least one package name must be specified")
+ sys.exit(1)
+ pkglist = args.pkg
+
+ for pkg in sorted(pkglist):
+ print("%s:" % pkg)
+ if args.runtime:
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime-reverse", pkg)
+ if not os.path.exists(pkgdatafile):
+ if args.recipe:
+ # This package was empty and thus never packaged, ignore
+ continue
+ logger.error("Unable to find any built runtime package named %s" % pkg)
+ sys.exit(1)
+ parse_pkgdatafile(pkgdatafile, args.long)
+
+ else:
+ providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
+ if os.path.exists(providepkgpath):
+ for f in os.listdir(providepkgpath):
+ if f != pkg:
+ print("%s is in the RPROVIDES of %s:" % (pkg, f))
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
+ parse_pkgdatafile(pkgdatafile, args.long)
+ continue
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", pkg)
+ if not os.path.exists(pkgdatafile):
+ logger.error("Unable to find any built recipe-space package named %s" % pkg)
+ sys.exit(1)
+ parse_pkgdatafile(pkgdatafile, args.long)
+
+def find_path(args):
+ import json
+
+ found = False
+ for root, dirs, files in os.walk(os.path.join(args.pkgdata_dir, 'runtime')):
+ for fn in files:
+ with open(os.path.join(root,fn)) as f:
+ for line in f:
+ if line.startswith('FILES_INFO:'):
+ val = line.split(':', 1)[1].strip()
+ dictval = json.loads(val)
+ for fullpth in dictval.keys():
+ if fnmatch.fnmatchcase(fullpth, args.targetpath):
+ found = True
+ print("%s: %s" % (fn, fullpth))
+ break
+ if not found:
+ logger.error("Unable to find any package producing path %s" % args.targetpath)
+ sys.exit(1)
+
+
+def main():
+ parser = argparse_oe.ArgumentParser(description="OpenEmbedded pkgdata tool - queries the pkgdata files written out during do_package",
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-p', '--pkgdata-dir', help='Path to pkgdata directory (determined automatically if not specified)')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
+
+ parser_lookup_pkg = subparsers.add_parser('lookup-pkg',
+ help='Translate between recipe-space package names and runtime package names',
+ description='Looks up the specified recipe-space package name(s) to see what the final runtime package name is (e.g. glibc becomes libc6), or with -r/--reverse looks up the other way.')
+ parser_lookup_pkg.add_argument('pkg', nargs='+', help='Package name to look up')
+ parser_lookup_pkg.add_argument('-r', '--reverse', help='Switch to looking up recipe-space package names from runtime package names', action='store_true')
+ parser_lookup_pkg.set_defaults(func=lookup_pkg)
+
+ parser_list_pkgs = subparsers.add_parser('list-pkgs',
+ help='List packages',
+ description='Lists packages that have been built')
+ parser_list_pkgs.add_argument('pkgspec', nargs='*', help='Package name to search for (wildcards * ? allowed, use quotes to avoid shell expansion)')
+ parser_list_pkgs.add_argument('-r', '--runtime', help='Show runtime package names instead of recipe-space package names', action='store_true')
+ parser_list_pkgs.add_argument('-p', '--recipe', help='Limit to packages produced by the specified recipe')
+ parser_list_pkgs.add_argument('-u', '--unpackaged', help='Include unpackaged (i.e. empty) packages', action='store_true')
+ parser_list_pkgs.set_defaults(func=list_pkgs)
+
+ parser_list_pkg_files = subparsers.add_parser('list-pkg-files',
+ help='List files within a package',
+ description='Lists files included in one or more packages')
+ parser_list_pkg_files.add_argument('pkg', nargs='*', help='Package name to report on (if -p/--recipe is not specified)')
+ parser_list_pkg_files.add_argument('-r', '--runtime', help='Specified package(s) are runtime package names instead of recipe-space package names', action='store_true')
+ parser_list_pkg_files.add_argument('-p', '--recipe', help='Report on all packages produced by the specified recipe')
+ parser_list_pkg_files.add_argument('-u', '--unpackaged', help='Include unpackaged (i.e. empty) packages (only useful with -p/--recipe)', action='store_true')
+ parser_list_pkg_files.add_argument('-l', '--long', help='Show more information per file', action='store_true')
+ parser_list_pkg_files.set_defaults(func=list_pkg_files)
+
+ parser_lookup_recipe = subparsers.add_parser('lookup-recipe',
+ help='Find recipe producing one or more packages',
+ description='Looks up the specified runtime package(s) to see which recipe they were produced by')
+ parser_lookup_recipe.add_argument('pkg', nargs='+', help='Runtime package name to look up')
+ parser_lookup_recipe.set_defaults(func=lookup_recipe)
+
+ parser_package_info = subparsers.add_parser('package-info',
+ help='Show version, recipe and size information for one or more packages',
+ description='Looks up the specified runtime package(s) and display information')
+ parser_package_info.add_argument('pkg', nargs='*', help='Runtime package name to look up')
+ parser_package_info.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)')
+ parser_package_info.add_argument('-e', '--extra', help='Extra variables to display, e.g., LICENSE (can be specified multiple times)', action='append')
+ parser_package_info.set_defaults(func=package_info)
+
+ parser_find_path = subparsers.add_parser('find-path',
+ help='Find package providing a target path',
+ description='Finds the recipe-space package providing the specified target path')
+ parser_find_path.add_argument('targetpath', help='Path to find (wildcards * ? allowed, use quotes to avoid shell expansion)')
+ parser_find_path.set_defaults(func=find_path)
+
+ parser_read_value = subparsers.add_parser('read-value',
+ help='Read any pkgdata value for one or more packages',
+ description='Reads the named value from the pkgdata files for the specified packages')
+ parser_read_value.add_argument('valuename', help='Name of the value to look up')
+ parser_read_value.add_argument('pkg', nargs='*', help='Runtime package name to look up')
+ parser_read_value.add_argument('-f', '--file', help='Read package names from the specified file (one per line, first field only)')
+ parser_read_value.add_argument('-n', '--prefix-name', help='Prefix output with package name', action='store_true')
+ parser_read_value.add_argument('-u', '--unescape', help='Expand escapes such as \\n', action='store_true')
+ parser_read_value.set_defaults(func=read_value)
+
+ parser_glob = subparsers.add_parser('glob',
+ help='Expand package name glob expression',
+ description='Expands one or more glob expressions over the packages listed in pkglistfile')
+ parser_glob.add_argument('pkglistfile', help='File listing packages (one package name per line)')
+ parser_glob.add_argument('glob', nargs="+", help='Glob expression for package names, e.g. *-dev')
+ parser_glob.add_argument('-x', '--exclude', help='Exclude packages matching specified regex from the glob operation')
+ parser_glob.set_defaults(func=glob)
+
+
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+
+ if not args.pkgdata_dir:
+ import scriptpath
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ sys.exit(1)
+ logger.debug('Found bitbake path: %s' % bitbakepath)
+ tinfoil = tinfoil_init()
+ try:
+ args.pkgdata_dir = tinfoil.config_data.getVar('PKGDATA_DIR')
+ finally:
+ tinfoil.shutdown()
+ logger.debug('Value of PKGDATA_DIR is "%s"' % args.pkgdata_dir)
+ if not args.pkgdata_dir:
+ logger.error('Unable to determine pkgdata directory from PKGDATA_DIR')
+ sys.exit(1)
+
+ if not os.path.exists(args.pkgdata_dir):
+ logger.error('Unable to find pkgdata directory %s' % args.pkgdata_dir)
+ sys.exit(1)
+
+ ret = args.func(args)
+
+ return ret
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/oe-publish-sdk b/poky/scripts/oe-publish-sdk
new file mode 100755
index 000000000..ee33acf90
--- /dev/null
+++ b/poky/scripts/oe-publish-sdk
@@ -0,0 +1,155 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded SDK publishing tool
+
+# Copyright (C) 2015-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import re
+import subprocess
+import logging
+import shutil
+import errno
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import argparse_oe
+logger = scriptutils.logger_create('sdktool')
+
+def mkdir(d):
+ try:
+ os.makedirs(d)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise e
+
+def publish(args):
+ logger.debug("In publish function")
+ target_sdk = args.sdk
+ destination = args.dest
+ logger.debug("target_sdk = %s, update_server = %s" % (target_sdk, destination))
+ sdk_basename = os.path.basename(target_sdk)
+
+ # Ensure the SDK exists
+ if not os.path.exists(target_sdk):
+ logger.error("Specified SDK %s doesn't exist" % target_sdk)
+ return -1
+ if os.path.isdir(target_sdk):
+ logger.error("%s is a directory - expected path to SDK installer file" % target_sdk)
+ return -1
+
+ if ':' in destination:
+ is_remote = True
+ host, destdir = destination.split(':')
+ dest_sdk = os.path.join(destdir, sdk_basename)
+ else:
+ is_remote = False
+ dest_sdk = os.path.join(destination, sdk_basename)
+ destdir = destination
+
+ # Making sure the directory exists
+ logger.debug("Making sure the destination directory exists")
+ if not is_remote:
+ mkdir(destination)
+ else:
+ cmd = "ssh %s 'mkdir -p %s'" % (host, destdir)
+ ret = subprocess.call(cmd, shell=True)
+ if ret != 0:
+ logger.error("Making directory %s on %s failed" % (destdir, host))
+ return ret
+
+ # Copying the SDK to the destination
+ logger.info("Copying the SDK to destination")
+ if not is_remote:
+ if os.path.exists(dest_sdk):
+ os.remove(dest_sdk)
+ if (os.stat(target_sdk).st_dev == os.stat(destination).st_dev):
+ os.link(target_sdk, dest_sdk)
+ else:
+ shutil.copy(target_sdk, dest_sdk)
+ else:
+ cmd = "scp %s %s" % (target_sdk, destination)
+ ret = subprocess.call(cmd, shell=True)
+ if ret != 0:
+ logger.error("scp %s %s failed" % (target_sdk, destination))
+ return ret
+
+ # Unpack the SDK
+ logger.info("Unpacking SDK")
+ if not is_remote:
+ cmd = "sh %s -p -y -d %s" % (dest_sdk, destination)
+ ret = subprocess.call(cmd, shell=True)
+ if ret == 0:
+ logger.info('Successfully unpacked %s to %s' % (dest_sdk, destination))
+ os.remove(dest_sdk)
+ else:
+ logger.error('Failed to unpack %s to %s' % (dest_sdk, destination))
+ return ret
+ else:
+ cmd = "ssh %s 'sh %s -p -y -d %s && rm -f %s'" % (host, dest_sdk, destdir, dest_sdk)
+ ret = subprocess.call(cmd, shell=True)
+ if ret == 0:
+ logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir))
+ else:
+ logger.error('Failed to unpack %s to %s' % (dest_sdk, destdir))
+ return ret
+
+ # Setting up the git repo
+ if not is_remote:
+ cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo "*.pyc\n*.pyo\npyshtables.py" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true' % (destination, destination)
+ else:
+ cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo '*.pyc\n*.pyo\npyshtables.py' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true'" % (host, destdir, destdir)
+ ret = subprocess.call(cmd, shell=True)
+ if ret == 0:
+ logger.info('SDK published successfully')
+ else:
+ logger.error('Failed to set up layer git repo')
+ return ret
+
+
+def main():
+ parser = argparse_oe.ArgumentParser(description="OpenEmbedded extensible SDK publishing tool - writes server-side data to support the extensible SDK update process to a specified location")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+
+ parser.add_argument('sdk', help='Extensible SDK to publish (path to .sh installer file)')
+ parser.add_argument('dest', help='Destination to publish SDK to; can be local path or remote in the form of user@host:/path (in the latter case ssh/scp will be used).')
+
+ parser.set_defaults(func=publish)
+
+ args = parser.parse_args()
+
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ ret = args.func(args)
+ return ret
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/oe-run-native b/poky/scripts/oe-run-native
new file mode 100755
index 000000000..1131122e6
--- /dev/null
+++ b/poky/scripts/oe-run-native
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# Copyright (c) 2016, Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>
+#
+
+#
+# This script is for running tools from native oe sysroot
+#
+
+if [ $# -lt 1 -o "$1" = '--help' -o "$1" = '-h' ] ; then
+ echo 'oe-run-native: the following arguments are required: <native recipe> <native tool>'
+ echo 'Usage: oe-run-native native-recipe tool [parameters]'
+ echo ''
+ echo 'OpenEmbedded run-native - runs native tools'
+ echo ''
+ echo 'arguments:'
+ echo ' native-recipe The recipe which provoides tool'
+ echo ' tool Native tool to run'
+ echo ''
+ exit 2
+fi
+
+native_recipe="$1"
+tool="$2"
+
+if [ "${native_recipe%-native}" = "$native_recipe" ]; then
+ echo Error: $native_recipe is not a native recipe
+ echo Error: Use \"oe-run-native -h\" for help
+ exit 1
+fi
+
+shift
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+ echo "Error: Unable to find oe-find-native-sysroot script"
+ exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT $native_recipe
+
+OLD_PATH=$PATH
+
+# look for a tool only in native sysroot
+PATH=$OECORE_NATIVE_SYSROOT/usr/bin:$OECORE_NATIVE_SYSROOT/bin:$OECORE_NATIVE_SYSROOT/usr/sbin:$OECORE_NATIVE_SYSROOT/sbin
+tool_find=`/usr/bin/which $tool 2>/dev/null`
+
+if [ -n "$tool_find" ] ; then
+ # add old path to allow usage of host tools
+ PATH=$PATH:$OLD_PATH $@
+else
+ echo "Error: Unable to find '$tool' in $PATH"
+ echo "Error: Have you run 'bitbake $native_recipe -caddto_recipe_sysroot'?"
+ exit 1
+fi
diff --git a/poky/scripts/oe-selftest b/poky/scripts/oe-selftest
new file mode 100755
index 000000000..1bf860a41
--- /dev/null
+++ b/poky/scripts/oe-selftest
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+# Copyright (c) 2013-2017 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# DESCRIPTION
+# This script runs tests defined in meta/lib/oeqa/selftest/
+# It's purpose is to automate the testing of different bitbake tools.
+# To use it you just need to source your build environment setup script and
+# add the meta-selftest layer to your BBLAYERS.
+# Call the script as: "oe-selftest -a" to run all the tests in meta/lib/oeqa/selftest/
+# Call the script as: "oe-selftest -r <module>.<Class>.<method>" to run just a single test
+# E.g: "oe-selftest -r bblayers.BitbakeLayers" will run just the BitbakeLayers class from meta/lib/oeqa/selftest/bblayers.py
+
+
+
+import os
+import sys
+import argparse
+import logging
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import argparse_oe
+import scriptutils
+import scriptpath
+scriptpath.add_oe_lib_path()
+scriptpath.add_bitbake_lib_path()
+
+from oeqa.utils import load_test_components
+from oeqa.core.exception import OEQAPreRun
+
+logger = scriptutils.logger_create('oe-selftest', stream=sys.stdout)
+
+def main():
+ description = "Script that runs unit tests against bitbake and other Yocto related tools. The goal is to validate tools functionality and metadata integrity. Refer to https://wiki.yoctoproject.org/wiki/Oe-selftest for more information."
+ parser = argparse_oe.ArgumentParser(description=description)
+
+ comp_name, comp = load_test_components(logger, 'oe-selftest').popitem()
+ comp.register_commands(logger, parser)
+
+ try:
+ args = parser.parse_args()
+ results = args.func(logger, args)
+ ret = 0 if results.wasSuccessful() else 1
+ except SystemExit as err:
+ if err.code != 0:
+ raise err
+ ret = err.code
+ except OEQAPreRun as pr:
+ ret = 1
+
+ return ret
+
+if __name__ == '__main__':
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/oe-setup-builddir b/poky/scripts/oe-setup-builddir
new file mode 100755
index 000000000..55d73ca1e
--- /dev/null
+++ b/poky/scripts/oe-setup-builddir
@@ -0,0 +1,140 @@
+#!/bin/sh
+
+# OE Build Environment Setup Script
+#
+# Copyright (C) 2006-2011 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+if [ -z "$BUILDDIR" ]; then
+ echo >&2 "Error: The build directory (BUILDDIR) must be set!"
+ exit 1
+fi
+
+if [ "$1" = '--help' -o "$1" = '-h' ]; then
+ echo 'Usage: oe-setup-builddir'
+ echo ''
+ echo "OpenEmbedded setup-builddir - setup build directory $BUILDDIR"
+ echo ''
+ exit 2
+fi
+
+mkdir -p "$BUILDDIR/conf"
+
+if [ ! -d "$BUILDDIR" ]; then
+ echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
+ exit 1
+fi
+
+if [ ! -w "$BUILDDIR" ]; then
+ echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build"
+ exit 1
+fi
+
+# Attempting removal of sticky,setuid bits from BUILDDIR, BUILDDIR/conf
+chmod -st "$BUILDDIR" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR"
+chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDDIR/conf"
+
+cd "$BUILDDIR"
+
+if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+ TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
+fi
+
+. $OEROOT/.templateconf
+
+if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+ echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+fi
+
+#
+# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
+#
+if [ -n "$TEMPLATECONF" ]; then
+ if [ ! -d "$TEMPLATECONF" ]; then
+ # Allow TEMPLATECONF=meta-xyz/conf as a shortcut
+ if [ -d "$OEROOT/$TEMPLATECONF" ]; then
+ TEMPLATECONF="$OEROOT/$TEMPLATECONF"
+ fi
+ if [ ! -d "$TEMPLATECONF" ]; then
+ echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
+ exit 1
+ fi
+ fi
+ OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
+ OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
+ OECORENOTESCONF="$TEMPLATECONF/conf-notes.txt"
+fi
+
+unset SHOWYPDOC
+if [ -z "$OECORELOCALCONF" ]; then
+ OECORELOCALCONF="$OEROOT/meta/conf/local.conf.sample"
+fi
+if [ ! -r "$BUILDDIR/conf/local.conf" ]; then
+ cat <<EOM
+You had no conf/local.conf file. This configuration file has therefore been
+created for you with some default values. You may wish to edit it to, for
+example, select a different MACHINE (target hardware). See conf/local.conf
+for more information as common configuration options are commented.
+
+EOM
+ cp -f $OECORELOCALCONF "$BUILDDIR/conf/local.conf"
+ SHOWYPDOC=yes
+fi
+
+if [ -z "$OECORELAYERCONF" ]; then
+ OECORELAYERCONF="$OEROOT/meta/conf/bblayers.conf.sample"
+fi
+if [ ! -r "$BUILDDIR/conf/bblayers.conf" ]; then
+ cat <<EOM
+You had no conf/bblayers.conf file. This configuration file has therefore been
+created for you with some default values. To add additional metadata layers
+into your configuration please add entries to conf/bblayers.conf.
+
+EOM
+
+ # Put the abosolute path to the layers in bblayers.conf so we can run
+ # bitbake without the init script after the first run
+ # ##COREBASE## is deprecated as it's meaning was inconsistent, but continue
+ # to replace it for compatibility.
+ sed -e "s|##OEROOT##|$OEROOT|g" \
+ -e "s|##COREBASE##|$OEROOT|g" \
+ $OECORELAYERCONF > "$BUILDDIR/conf/bblayers.conf"
+ SHOWYPDOC=yes
+fi
+
+# Prevent disturbing a new GIT clone in same console
+unset OECORELOCALCONF
+unset OECORELAYERCONF
+
+# Ending the first-time run message. Show the YP Documentation banner.
+if [ ! -z "$SHOWYPDOC" ]; then
+ cat <<EOM
+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/
+
+EOM
+# unset SHOWYPDOC
+fi
+
+if [ -z "$OECORENOTESCONF" ]; then
+ OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt"
+fi
+[ ! -r "$OECORENOTESCONF" ] || cat $OECORENOTESCONF
+unset OECORENOTESCONF
diff --git a/poky/scripts/oe-test b/poky/scripts/oe-test
new file mode 100755
index 000000000..34d9012d1
--- /dev/null
+++ b/poky/scripts/oe-test
@@ -0,0 +1,81 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded test tool
+#
+# Copyright (C) 2016 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import argparse
+import logging
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import argparse_oe
+import scriptutils
+
+# oe-test is used for testexport and it doesn't have oe lib
+# so we just skip adding these libraries (not used in testexport)
+try:
+ import scriptpath
+ scriptpath.add_oe_lib_path()
+except ImportError:
+ pass
+
+from oeqa.utils import load_test_components
+from oeqa.core.exception import OEQAPreRun
+
+logger = scriptutils.logger_create('oe-test', stream=sys.stdout)
+
+def main():
+ parser = argparse_oe.ArgumentParser(description="OpenEmbedded test tool",
+ add_help=False,
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+ global_args, unparsed_args = parser.parse_known_args()
+
+ # Help is added here rather than via add_help=True, as we don't want it to
+ # be handled by parse_known_args()
+ parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
+ help='show this help message and exit')
+
+ if global_args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif global_args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ components = load_test_components(logger, 'oe-test')
+
+ subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
+ subparsers.add_subparser_group('components', 'Test components')
+ subparsers.required = True
+ for comp_name in sorted(components.keys()):
+ comp = components[comp_name]
+ comp.register_commands(logger, subparsers)
+
+ try:
+ args = parser.parse_args(unparsed_args, namespace=global_args)
+ results = args.func(logger, args)
+ ret = 0 if results.wasSuccessful() else 1
+ except SystemExit as err:
+ if err.code != 0:
+ raise err
+ ret = err.code
+ except argparse_oe.ArgumentUsageError as ae:
+ parser.error_subcommand(ae.message, ae.subcommand)
+ except OEQAPreRun as pr:
+ ret = 1
+
+ return ret
+
+if __name__ == '__main__':
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/oe-trim-schemas b/poky/scripts/oe-trim-schemas
new file mode 100755
index 000000000..7c199ef1d
--- /dev/null
+++ b/poky/scripts/oe-trim-schemas
@@ -0,0 +1,58 @@
+#! /usr/bin/env python3
+
+import sys
+try:
+ import xml.etree.cElementTree as etree
+except:
+ import xml.etree.ElementTree as etree
+
+def child (elem, name):
+ for e in elem.getchildren():
+ if e.tag == name:
+ return e
+ return None
+
+def children (elem, name=None):
+ l = elem.getchildren()
+ if name:
+ l = [e for e in l if e.tag == name]
+ return l
+
+if len(sys.argv) < 2 or sys.argv[1] in ('-h', '--help'):
+ print('oe-trim-schemas: error: the following arguments are required: schema\n'
+ 'Usage: oe-trim-schemas schema\n\n'
+ 'OpenEmbedded trim schemas - remove unneeded schema locale translations\n'
+ ' from gconf schema files\n\n'
+ 'arguments:\n'
+ ' schema gconf schema file to trim\n')
+ sys.exit(2)
+
+xml = etree.parse(sys.argv[1])
+
+for schema in child(xml.getroot(), "schemalist").getchildren():
+ e = child(schema, "short")
+ if e is not None:
+ schema.remove(e)
+
+ e = child(schema, "long")
+ if e is not None:
+ schema.remove(e)
+
+ for locale in children(schema, "locale"):
+ # One locale must exist so leave C locale...
+ a = locale.attrib.get("name")
+ if a == 'C':
+ continue
+ e = child(locale, "default")
+ if e is None:
+ schema.remove(locale)
+ else:
+ e = child(locale, "short")
+ if e is not None:
+ locale.remove(e)
+ e = child(locale, "long")
+ if e is not None:
+ locale.remove(e)
+
+xml.write(sys.stdout, "UTF-8")
+
diff --git a/poky/scripts/oepydevshell-internal.py b/poky/scripts/oepydevshell-internal.py
new file mode 100755
index 000000000..04621ae8a
--- /dev/null
+++ b/poky/scripts/oepydevshell-internal.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+import time
+import select
+import fcntl
+import termios
+import readline
+import signal
+
+def nonblockingfd(fd):
+ fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
+
+def echonocbreak(fd):
+ old = termios.tcgetattr(fd)
+ old[3] = old[3] | termios.ECHO | termios.ICANON
+ termios.tcsetattr(fd, termios.TCSADRAIN, old)
+
+def cbreaknoecho(fd):
+ old = termios.tcgetattr(fd)
+ old[3] = old[3] &~ termios.ECHO &~ termios.ICANON
+ termios.tcsetattr(fd, termios.TCSADRAIN, old)
+
+if len(sys.argv) != 3 or sys.argv[1] in ('-h', '--help'):
+ print('oepydevshell-internal.py: error: the following arguments are required: pty, pid\n'
+ 'Usage: oepydevshell-internal.py pty pid\n\n'
+ 'OpenEmbedded oepydevshell-internal.py - internal script called from meta/classes/devshell.bbclass\n\n'
+ 'arguments:\n'
+ ' pty pty device name\n'
+ ' pid parent process id\n\n'
+ 'options:\n'
+ ' -h, --help show this help message and exit\n')
+ sys.exit(2)
+
+pty = open(sys.argv[1], "w+b", 0)
+parent = int(sys.argv[2])
+
+nonblockingfd(pty)
+nonblockingfd(sys.stdin)
+
+
+histfile = os.path.expanduser("~/.oedevpyshell-history")
+readline.parse_and_bind("tab: complete")
+try:
+ readline.read_history_file(histfile)
+except IOError:
+ pass
+
+try:
+
+ i = ""
+ o = ""
+ # Need cbreak/noecho whilst in select so we trigger on any keypress
+ cbreaknoecho(sys.stdin.fileno())
+ # Send our PID to the other end so they can kill us.
+ pty.write(str(os.getpid()).encode('utf-8') + b"\n")
+ while True:
+ try:
+ writers = []
+ if i:
+ writers.append(sys.stdout)
+ (ready, _, _) = select.select([pty, sys.stdin], writers , [], 0)
+ try:
+ if pty in ready:
+ i = i + pty.read().decode('utf-8')
+ if i:
+ # Write a page at a time to avoid overflowing output
+ # d.keys() is a good way to do that
+ sys.stdout.write(i[:4096])
+ sys.stdout.flush()
+ i = i[4096:]
+ if sys.stdin in ready:
+ echonocbreak(sys.stdin.fileno())
+ o = input().encode('utf-8')
+ cbreaknoecho(sys.stdin.fileno())
+ pty.write(o + b"\n")
+ except (IOError, OSError) as e:
+ if e.errno == 11:
+ continue
+ if e.errno == 5:
+ sys.exit(0)
+ raise
+ except EOFError:
+ sys.exit(0)
+ except KeyboardInterrupt:
+ os.kill(parent, signal.SIGINT)
+
+except SystemExit:
+ pass
+except Exception as e:
+ import traceback
+ print("Exception in oepydehshell-internal: " + str(e))
+ traceback.print_exc()
+ time.sleep(5)
+finally:
+ readline.write_history_file(histfile)
diff --git a/poky/scripts/opkg-query-helper.py b/poky/scripts/opkg-query-helper.py
new file mode 100755
index 000000000..ce89491f6
--- /dev/null
+++ b/poky/scripts/opkg-query-helper.py
@@ -0,0 +1,85 @@
+#!/usr/bin/env python3
+
+# OpenEmbedded opkg query helper utility
+#
+# Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Copyright 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+#
+
+
+import sys
+import fileinput
+import re
+
+archmode = False
+filemode = False
+vermode = False
+
+args = []
+for arg in sys.argv[1:]:
+ if arg == '-a':
+ archmode = True
+ elif arg == '-f':
+ filemode = True
+ elif arg == '-v':
+ vermode = True
+ else:
+ args.append(arg)
+
+# Regex for removing version specs after dependency items
+verregex = re.compile(' \([=<>]* [^ )]*\)')
+
+pkg = ""
+ver = ""
+for line in fileinput.input(args):
+ line = line.rstrip()
+ if ': ' in line:
+ if line.startswith("Package:"):
+ pkg = line.split(": ")[1]
+ ver = ""
+ else:
+ if archmode:
+ if line.startswith("Architecture:"):
+ arch = line.split(": ")[1]
+ print("%s %s" % (pkg,arch))
+ elif filemode:
+ if line.startswith("Version:"):
+ ver = line.split(": ")[1]
+ elif line.startswith("Architecture:"):
+ arch = line.split(": ")[1]
+ print("%s %s_%s_%s.ipk %s" % (pkg,pkg,ver,arch,arch))
+ elif vermode:
+ if line.startswith("Version:"):
+ ver = line.split(": ")[1]
+ elif line.startswith("Architecture:"):
+ arch = line.split(": ")[1]
+ print("%s %s %s" % (pkg,arch,ver))
+ else:
+ if line.startswith("Depends:"):
+ depval = line.split(": ")[1]
+ deps = depval.split(", ")
+ for dep in deps:
+ dep = verregex.sub('', dep)
+ print("%s|%s" % (pkg,dep))
+ elif line.startswith("Recommends:"):
+ recval = line.split(": ")[1]
+ recs = recval.split(", ")
+ for rec in recs:
+ rec = verregex.sub('', rec)
+ print("%s|%s [REC]" % (pkg, rec))
+
diff --git a/poky/scripts/postinst-intercepts/delay_to_first_boot b/poky/scripts/postinst-intercepts/delay_to_first_boot
new file mode 100644
index 000000000..ecdbef95d
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/delay_to_first_boot
@@ -0,0 +1,2 @@
+#!/bin/sh
+exit 1
diff --git a/poky/scripts/postinst-intercepts/postinst_intercept b/poky/scripts/postinst-intercepts/postinst_intercept
new file mode 100755
index 000000000..b18e806d4
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/postinst_intercept
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# This script is called from inside postinstall scriptlets at do_rootfs time. It
+# actually adds, at the end, the list of packages for which the intercept script
+# is valid. Also, if one wants to pass any variables to the intercept script from
+# the postinstall itself, they will be added immediately after the shebang line.
+#
+# Usage: postinst_intercept <intercept_script_name> <package_name> <mlprefix=...> <var1=...> ... <varN=...>
+# * intercept_script_name - the name of the intercept script we want to change;
+# * package_name - add the package_name to list of packages the intercept script
+# is used for;
+# * mlprefix=... - this one is needed in order to have separate hooks for multilib.
+# * var1=... - var1 will have the value we provide in the intercept script. This
+# is useful when we want to pass on variables like ${libdir} to
+# the intercept script;
+#
+[ $# -lt 3 ] && exit 1
+
+intercept_script=$INTERCEPT_DIR/$1 && shift
+package_name=$1 && shift
+mlprefix=$(echo $1 |sed -ne "s/^mlprefix=\(.*\)-/\1/p") && shift
+
+# if the hook we want to install does not exist, then there's nothing we can do
+[ -f "$intercept_script" ] || exit 1
+
+# if the postinstall wanting to install the hook belongs to a multilib package,
+# then we'd better have a separate hook for this because the default ${libdir} and
+# ${base_libdir} will point to the wrong locations
+if [ -n "$mlprefix" ]; then
+ ml_intercept_script=$intercept_script-$mlprefix
+ # if the multilib hook does not exist, create it from the default one
+ if [ ! -f "$ml_intercept_script" ]; then
+ cp $intercept_script $ml_intercept_script
+
+ # clear the ##PKGS: line and the already set variables
+ [ -x "$ml_intercept_script" ] && sed -i -e "2,$(($#+1)) {/.*/d}" -e "/^##PKGS: .*/d" $ml_intercept_script
+ fi
+
+ intercept_script=$ml_intercept_script
+fi
+
+chmod +x "$intercept_script"
+
+pkgs_line=$(grep "##PKGS:" $intercept_script)
+if [ -n "$pkgs_line" ]; then
+ # line exists, add this package to the list only if it's not already there
+ if [ -z "$(echo "$pkgs_line" | grep " $package_name ")" ]; then
+ sed -i -e "s/##PKGS:.*/\0${package_name} /" $intercept_script
+ fi
+else
+ for var in "$@"; do
+ sed -i -e "\%^#\!/bin/.*sh%a $var" $intercept_script
+ done
+ echo "##PKGS: ${package_name} " >> $intercept_script
+fi
+
diff --git a/poky/scripts/postinst-intercepts/update_font_cache b/poky/scripts/postinst-intercepts/update_font_cache
new file mode 100644
index 000000000..bf65e19a4
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/update_font_cache
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir} \
+ -E ${fontconfigcacheenv} $D${bindir}/fc-cache --sysroot=$D --system-only ${fontconfigcacheparams}
+chown -R root:root $D${fontconfigcachedir}
diff --git a/poky/scripts/postinst-intercepts/update_gio_module_cache b/poky/scripts/postinst-intercepts/update_gio_module_cache
new file mode 100644
index 000000000..fc3f9d0d6
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/update_gio_module_cache
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D${libdir}:$D${base_libdir} \
+ $D${libexecdir}/${binprefix}gio-querymodules $D${libdir}/gio/modules/
+
+[ ! -e $D${libdir}/gio/modules/giomodule.cache ] ||
+ chown root:root $D${libdir}/gio/modules/giomodule.cache
diff --git a/poky/scripts/postinst-intercepts/update_icon_cache b/poky/scripts/postinst-intercepts/update_icon_cache
new file mode 100644
index 000000000..9cf2a72a0
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/update_icon_cache
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+# update native pixbuf loaders
+$STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --update-cache
+
+for icondir in $D/usr/share/icons/*/ ; do
+ if [ -d $icondir ] ; then
+ gtk-update-icon-cache -fqt $icondir
+ fi
+done
+
diff --git a/poky/scripts/postinst-intercepts/update_pixbuf_cache b/poky/scripts/postinst-intercepts/update_pixbuf_cache
new file mode 100644
index 000000000..5d44075fb
--- /dev/null
+++ b/poky/scripts/postinst-intercepts/update_pixbuf_cache
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+export GDK_PIXBUF_MODULEDIR=$D${libdir}/gdk-pixbuf-2.0/2.10.0/loaders
+export GDK_PIXBUF_FATAL_LOADER=1
+
+PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
+ $D${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
+ >$GDK_PIXBUF_MODULEDIR/../loaders.cache && \
+ sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache
diff --git a/poky/scripts/pybootchartgui/AUTHORS b/poky/scripts/pybootchartgui/AUTHORS
new file mode 100644
index 000000000..672b7e952
--- /dev/null
+++ b/poky/scripts/pybootchartgui/AUTHORS
@@ -0,0 +1,11 @@
+Michael Meeks <michael.meeks@novell.com>
+Anders Norgaard <anders.norgaard@gmail.com>
+Scott James Remnant <scott@ubuntu.com>
+Henning Niss <henningniss@gmail.com>
+Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
+
+Contributors:
+ Brian Ewins
+
+Based on work by:
+ Ziga Mahkovec
diff --git a/poky/scripts/pybootchartgui/COPYING b/poky/scripts/pybootchartgui/COPYING
new file mode 100644
index 000000000..ed87acf94
--- /dev/null
+++ b/poky/scripts/pybootchartgui/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/poky/scripts/pybootchartgui/MAINTAINERS b/poky/scripts/pybootchartgui/MAINTAINERS
new file mode 100644
index 000000000..c65e1315f
--- /dev/null
+++ b/poky/scripts/pybootchartgui/MAINTAINERS
@@ -0,0 +1,3 @@
+Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
+Michael Meeks <michael.meeks@novell.com>
+Harald Hoyer <harald@redhat.com>
diff --git a/poky/scripts/pybootchartgui/NEWS b/poky/scripts/pybootchartgui/NEWS
new file mode 100644
index 000000000..7c5b2fc3a
--- /dev/null
+++ b/poky/scripts/pybootchartgui/NEWS
@@ -0,0 +1,204 @@
+bootchart2 0.14.5:
+ + pybootchartgui (Riccardo)
+ + Fix tests with python3
+ + Fix parsing of files with non-ascii bytes
+ + Robustness fixes to taskstats and meminfo parsing
+ + More python3 fixes
+
+bootchart2 0.14.4:
+ + bootchartd
+ + Add relevant EXIT_PROC for GNOME3, XFCE4, openbox
+ (Justin Lecher, Ben Eills)
+ + pybootchartgui (Riccardo)
+ + Fix some issues in --crop-after and --annotate
+ + Fix pybootchartgui process_tree tests
+ + More python3 fixes
+
+bootchart2 0.14.2:
+ + pybootchartgui
+ + Fix some crashes in parsing.py (Jakub Czaplicki, Riccardo)
+ + speedup a bit meminfo parsing (Riccardo)
+ + Fix indentation for python3.2 (Riccardo)
+
+bootchart2 0.14.1:
+ + bootchartd
+ + Expect dmesg only if started as init (Henry Yei)
+ + look for bootchart_init in the environment (Henry Gebhardt)
+ + pybootchartgui
+ + Fixup some tests (Riccardo)
+ + Support hp smart arrays block devices (Anders Norgaard,
+ Brian Murray)
+ + Fixes for -t, -o and -f options (Mladen Kuntner, Harald, Riccardo)
+
+bootchart2 0.14.0:
+ + bootchartd
+ + Add ability to define custom commands
+ (Lucian Muresan, Peter Hjalmarsson)
+ + collector
+ + fix tmpfs mount leakage (Peter Hjalmarsson)
+ + pybootchartgui
+ + render cumulative I/O time chart (Sankar P)
+ + python3 compatibility fixes (Riccardo)
+ + Misc (Michael)
+ + remove confusing, obsolete setup.py
+ + install docs to /usr/share/
+ + lot of fixes for easier packaging (Peter Hjalmarsson)
+ + add bootchart2, bootchartd and pybootchartgui manpages
+ (Francesca Ciceri, David Paleino)
+
+bootchart2 0.12.6:
+ + bootchartd
+ + better check for initrd (Riccardo Magliocchetti)
+ + code cleanup (Riccardo)
+ + make the list of processes we are waiting for editable
+ in config file by EXIT_PROC (Riccardo)
+ + fix parsing of cmdline for alternative init system (Riccardo)
+ + fixed calling init in initramfs (Harald)
+ + exit 0 for start, if the collector is already running (Harald)
+ + collector
+ + try harder with taskstats (Michael)
+ + plug some small leaks (Riccardo)
+ + fix missing PROC_EVENTS detection (Harald)
+ + pybootchartgui (Michael)
+ + add kernel bootchart tab to interactive gui
+ + report bootchart version in cli interface
+ + improve rendering performance
+ + GUI improvements
+ + lot of cleanups
+ + Makefile
+ + do not python compile if NO_PYTHON_COMPILE is set (Harald)
+ + systemd service files
+ + added them and install (Harald, Wulf C. Krueger)
+
+bootchart2 0.12.5:
+ + administrative snafu version; pull before pushing...
+
+bootchart2 0.12.4:
+ + bootchartd
+ + reduce overhead caused by pidof (Riccardo Magliocchetti)
+ + collector
+ + attempt to retry ptrace to avoid bogus ENOSYS (Michael)
+ + add meminfo polling (Dave Martin)
+ + pybootchartgui
+ + handle dmesg timestamps with big delta (Riccardo)
+ + avoid divide by zero when rendering I/O utilization (Riccardo)
+ + add process grouping in the cumulative chart (Riccardo)
+ + fix cpu time calculation in cumulative chart (Riccardo)
+ + get i/o statistics for flash based devices (Riccardo)
+ + prettier coloring for the cumulative graphs (Michael)
+ + fix interactive CPU rendering (Michael)
+ + render memory usage graph (Dave Martin)
+
+bootchart2 0.12.3
+ + collector
+ + pclose after popen (Riccardo Magliocchetti (xrmx))
+ + fix buffer overflow (xrmx)
+ + count 'processor:' in /proc/cpuinfo for ARM (Michael)
+ + get model name from that line too for ARM (xrmx)
+ + store /proc/cpuinfo in the boot-chart archive (xrmx)
+ + try harder to detect missing TASKSTATS (Michael)
+ + sanity-check invalid domain names (Michael)
+ + detect missing PROC_EVENTS more reliably (Michael)
+ + README fixes (xrmx, Michael)
+ + pybootchartgui
+ + make num_cpu parsing robust (Michael)
+
+bootchart2 0.12.2
+ + fix pthread compile / linking bug
+
+bootchart2 0.12.1
+ + pybootchartgui
+ + pylint cleanup
+ + handle empty traces more elegantly
+ + add '-t' / '--boot-time' argument (Matthew Bauer)
+ + collector
+ + now GPLv2
+ + add rdinit support for very early initrd tracing
+ + cleanup / re-factor code into separate modules
+ + re-factor arg parsing, and parse remote process args
+ + handle missing bootchartd.conf cleanly
+ + move much of bootchartd from shell -> C
+ + drop dmesg and uname usage
+ + avoid rpm/dpkg with native version reporting
+
+bootchart2 0.12.0 (Michael Meeks)
+ + collector
+ + use netlink PROC_EVENTS to generate parentage data
+ + finally kills any need for 'acct' et. al.
+ + also removes need to poll /proc => faster
+ + cleanup code to K&R, 8 stop tabs.
+ + pybootchartgui
+ + consume thread parentage data
+
+bootchart2 0.11.4 (Michael Meeks)
+ + collector
+ + if run inside an initrd detect when /dev is writable
+ and remount ourselves into that.
+ + overflow buffers more elegantly in extremis
+ + dump full process path and command-line args
+ + calm down debugging output
+ + pybootchartgui
+ + can render logs in a directory again
+ + has a 'show more' option to show command-lines
+
+bootchart2 0.11.3 (Michael Meeks)
+ + add $$ display to the bootchart header
+ + process command-line bits
+ + fix collection code, and rename stream to match
+ + enable parsing, add check button to UI, and --show-all
+ command-line option
+ + fix parsing of directories full of files.
+
+bootchart2 0.11.2 (Michael Meeks)
+ + fix initrd sanity check to use the right proc path
+ + don't return a bogus error value when dumping state
+ + add -c to aid manual console debugging
+
+bootchart2 0.11.1 (Michael Meeks)
+ + even simpler initrd setup
+ + create a single directory: /lib/bootchart/tmpfs
+
+bootchart2 0.11 (Michael Meeks)
+ + bootchartd
+ + far, far simpler, less shell, more robustness etc.
+ + bootchart-collector
+ + remove the -p argument - we always mount proc
+ + requires /lib/bootchart (make install-chroot) to
+ be present (also in the initrd) [ with a kmsg
+ node included ]
+ + add a --probe-running mode
+ + ptrace re-write
+ + gives -much- better early-boot-time resolution
+ + unconditional chroot /lib/bootchart/chroot
+ + we mount proc there ourselves
+ + log extraction requires no common file-system view
+
+
+bootchart2 0.10.1 (Kel Modderman)
+ + collector arg -m should mount /proc
+ + remove bogus vcsid code
+ + split collector install in Makefile
+ + remove bogus debug code
+ + accept process names containing spaces
+
+bootchart2 0.10.0
+ + rendering (Anders Norgaard)
+ + fix for unknown exceptions
+ + interactive UI (Michael)
+ + much faster rendering by manual clipping
+ + horizontal scaling
+ + remove annoying page-up/down bindings
+ + initrd portability & fixes (Federic Crozat)
+ + port to Mandriva
+ + improved process waiting
+ + inittab commenting fix
+ + improved initrd detection / jail tagging
+ + fix for un-detectable accton behaviour change
+ + implement a built-in usleep to help initrd deps (Michael)
+
+bootchart2 0.0.9
+ + fix initrd bug
+
+bootchart2 0.0.8
+ + add a filename string to the window title in interactive mode
+ + add a NEWS file
diff --git a/poky/scripts/pybootchartgui/README.pybootchart b/poky/scripts/pybootchartgui/README.pybootchart
new file mode 100644
index 000000000..8642e6467
--- /dev/null
+++ b/poky/scripts/pybootchartgui/README.pybootchart
@@ -0,0 +1,37 @@
+ PYBOOTCHARTGUI
+ ----------------
+
+pybootchartgui is a tool (now included as part of bootchart2) for
+visualization and analysis of the GNU/Linux boot process. It renders
+the output of the boot-logger tool bootchart (see
+http://www.bootchart.org/) to either the screen or files of various
+formats. Bootchart collects information about the processes, their
+dependencies, and resource consumption during boot of a GNU/Linux
+system. The pybootchartgui tools visualizes the process tree and
+overall resource utilization.
+
+pybootchartgui is a port of the visualization part of bootchart from
+Java to Python and Cairo.
+
+Adapted from the bootchart-documentation:
+
+ The CPU and disk statistics are used to render stacked area and line
+ charts. The process information is used to create a Gantt chart
+ showing process dependency, states and CPU usage.
+
+ A typical boot sequence consists of several hundred processes. Since
+ it is difficult to visualize such amount of data in a comprehensible
+ way, tree pruning is utilized. Idle background processes and
+ short-lived processes are removed. Similar processes running in
+ parallel are also merged together.
+
+ Finally, the performance and dependency charts are rendered as a
+ single image to either the screen or in PNG, PDF or SVG format.
+
+
+To get help for pybootchartgui, run
+
+$ pybootchartgui --help
+
+This code was originally hosted at:
+ http://code.google.com/p/pybootchartgui/
diff --git a/poky/scripts/pybootchartgui/pybootchartgui.py b/poky/scripts/pybootchartgui/pybootchartgui.py
new file mode 100755
index 000000000..7ce1a5be4
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+#
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+
+import sys
+from pybootchartgui.main import main
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/__init__.py b/poky/scripts/pybootchartgui/pybootchartgui/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/__init__.py
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/batch.py b/poky/scripts/pybootchartgui/pybootchartgui/batch.py
new file mode 100644
index 000000000..05c714e95
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/batch.py
@@ -0,0 +1,46 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+import cairo
+from . import draw
+from .draw import RenderOptions
+
+def render(writer, trace, app_options, filename):
+ handlers = {
+ "png": (lambda w, h: cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h), \
+ lambda sfc: sfc.write_to_png(filename)),
+ "pdf": (lambda w, h: cairo.PDFSurface(filename, w, h), lambda sfc: 0),
+ "svg": (lambda w, h: cairo.SVGSurface(filename, w, h), lambda sfc: 0)
+ }
+
+ if app_options.format is None:
+ fmt = filename.rsplit('.', 1)[1]
+ else:
+ fmt = app_options.format
+
+ if not (fmt in handlers):
+ writer.error ("Unknown format '%s'." % fmt)
+ return 10
+
+ make_surface, write_surface = handlers[fmt]
+ options = RenderOptions (app_options)
+ (w, h) = draw.extents (options, 1.0, trace)
+ w = max (w, draw.MIN_IMG_W)
+ surface = make_surface (w, h)
+ ctx = cairo.Context (surface)
+ draw.render (ctx, options, 1.0, trace)
+ write_surface (surface)
+ writer.status ("bootchart written to '%s'" % filename)
+
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/draw.py b/poky/scripts/pybootchartgui/pybootchartgui/draw.py
new file mode 100644
index 000000000..201ce4577
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/draw.py
@@ -0,0 +1,968 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+
+import cairo
+import math
+import re
+import random
+import colorsys
+from operator import itemgetter
+
+class RenderOptions:
+
+ def __init__(self, app_options):
+ # should we render a cumulative CPU time chart
+ self.cumulative = True
+ self.charts = True
+ self.kernel_only = False
+ self.app_options = app_options
+
+ def proc_tree (self, trace):
+ if self.kernel_only:
+ return trace.kernel_tree
+ else:
+ return trace.proc_tree
+
+# Process tree background color.
+BACK_COLOR = (1.0, 1.0, 1.0, 1.0)
+
+WHITE = (1.0, 1.0, 1.0, 1.0)
+# Process tree border color.
+BORDER_COLOR = (0.63, 0.63, 0.63, 1.0)
+# Second tick line color.
+TICK_COLOR = (0.92, 0.92, 0.92, 1.0)
+# 5-second tick line color.
+TICK_COLOR_BOLD = (0.86, 0.86, 0.86, 1.0)
+# Annotation colour
+ANNOTATION_COLOR = (0.63, 0.0, 0.0, 0.5)
+# Text color.
+TEXT_COLOR = (0.0, 0.0, 0.0, 1.0)
+
+# Font family
+FONT_NAME = "Bitstream Vera Sans"
+# Title text font.
+TITLE_FONT_SIZE = 18
+# Default text font.
+TEXT_FONT_SIZE = 12
+# Axis label font.
+AXIS_FONT_SIZE = 11
+# Legend font.
+LEGEND_FONT_SIZE = 12
+
+# CPU load chart color.
+CPU_COLOR = (0.40, 0.55, 0.70, 1.0)
+# IO wait chart color.
+IO_COLOR = (0.76, 0.48, 0.48, 0.5)
+# Disk throughput color.
+DISK_TPUT_COLOR = (0.20, 0.71, 0.20, 1.0)
+# CPU load chart color.
+FILE_OPEN_COLOR = (0.20, 0.71, 0.71, 1.0)
+# Mem cached color
+MEM_CACHED_COLOR = CPU_COLOR
+# Mem used color
+MEM_USED_COLOR = IO_COLOR
+# Buffers color
+MEM_BUFFERS_COLOR = (0.4, 0.4, 0.4, 0.3)
+# Swap color
+MEM_SWAP_COLOR = DISK_TPUT_COLOR
+
+# Process border color.
+PROC_BORDER_COLOR = (0.71, 0.71, 0.71, 1.0)
+# Waiting process color.
+PROC_COLOR_D = (0.76, 0.48, 0.48, 0.5)
+# Running process color.
+PROC_COLOR_R = CPU_COLOR
+# Sleeping process color.
+PROC_COLOR_S = (0.94, 0.94, 0.94, 1.0)
+# Stopped process color.
+PROC_COLOR_T = (0.94, 0.50, 0.50, 1.0)
+# Zombie process color.
+PROC_COLOR_Z = (0.71, 0.71, 0.71, 1.0)
+# Dead process color.
+PROC_COLOR_X = (0.71, 0.71, 0.71, 0.125)
+# Paging process color.
+PROC_COLOR_W = (0.71, 0.71, 0.71, 0.125)
+
+# Process label color.
+PROC_TEXT_COLOR = (0.19, 0.19, 0.19, 1.0)
+# Process label font.
+PROC_TEXT_FONT_SIZE = 12
+
+# Signature color.
+SIG_COLOR = (0.0, 0.0, 0.0, 0.3125)
+# Signature font.
+SIG_FONT_SIZE = 14
+# Signature text.
+SIGNATURE = "http://github.com/mmeeks/bootchart"
+
+# Process dependency line color.
+DEP_COLOR = (0.75, 0.75, 0.75, 1.0)
+# Process dependency line stroke.
+DEP_STROKE = 1.0
+
+# Process description date format.
+DESC_TIME_FORMAT = "mm:ss.SSS"
+
+# Cumulative coloring bits
+HSV_MAX_MOD = 31
+HSV_STEP = 7
+
+# Configure task color
+TASK_COLOR_CONFIGURE = (1.0, 1.0, 0.00, 1.0)
+# Compile task color.
+TASK_COLOR_COMPILE = (0.0, 1.00, 0.00, 1.0)
+# Install task color
+TASK_COLOR_INSTALL = (1.0, 0.00, 1.00, 1.0)
+# Sysroot task color
+TASK_COLOR_SYSROOT = (0.0, 0.00, 1.00, 1.0)
+# Package task color
+TASK_COLOR_PACKAGE = (0.0, 1.00, 1.00, 1.0)
+# Package Write RPM/DEB/IPK task color
+TASK_COLOR_PACKAGE_WRITE = (0.0, 0.50, 0.50, 1.0)
+
+# Distinct colors used for different disk volumnes.
+# If we have more volumns, colors get re-used.
+VOLUME_COLORS = [
+ (1.0, 1.0, 0.00, 1.0),
+ (0.0, 1.00, 0.00, 1.0),
+ (1.0, 0.00, 1.00, 1.0),
+ (0.0, 0.00, 1.00, 1.0),
+ (0.0, 1.00, 1.00, 1.0),
+]
+
+# Process states
+STATE_UNDEFINED = 0
+STATE_RUNNING = 1
+STATE_SLEEPING = 2
+STATE_WAITING = 3
+STATE_STOPPED = 4
+STATE_ZOMBIE = 5
+
+STATE_COLORS = [(0, 0, 0, 0), PROC_COLOR_R, PROC_COLOR_S, PROC_COLOR_D, \
+ PROC_COLOR_T, PROC_COLOR_Z, PROC_COLOR_X, PROC_COLOR_W]
+
+# CumulativeStats Types
+STAT_TYPE_CPU = 0
+STAT_TYPE_IO = 1
+
+# Convert ps process state to an int
+def get_proc_state(flag):
+ return "RSDTZXW".find(flag) + 1
+
+def draw_text(ctx, text, color, x, y):
+ ctx.set_source_rgba(*color)
+ ctx.move_to(x, y)
+ ctx.show_text(text)
+
+def draw_fill_rect(ctx, color, rect):
+ ctx.set_source_rgba(*color)
+ ctx.rectangle(*rect)
+ ctx.fill()
+
+def draw_rect(ctx, color, rect):
+ ctx.set_source_rgba(*color)
+ ctx.rectangle(*rect)
+ ctx.stroke()
+
+def draw_legend_box(ctx, label, fill_color, x, y, s):
+ draw_fill_rect(ctx, fill_color, (x, y - s, s, s))
+ draw_rect(ctx, PROC_BORDER_COLOR, (x, y - s, s, s))
+ draw_text(ctx, label, TEXT_COLOR, x + s + 5, y)
+
+def draw_legend_line(ctx, label, fill_color, x, y, s):
+ draw_fill_rect(ctx, fill_color, (x, y - s/2, s + 1, 3))
+ ctx.arc(x + (s + 1)/2.0, y - (s - 3)/2.0, 2.5, 0, 2.0 * math.pi)
+ ctx.fill()
+ draw_text(ctx, label, TEXT_COLOR, x + s + 5, y)
+
+def draw_label_in_box(ctx, color, label, x, y, w, maxx):
+ label_w = ctx.text_extents(label)[2]
+ label_x = x + w / 2 - label_w / 2
+ if label_w + 10 > w:
+ label_x = x + w + 5
+ if label_x + label_w > maxx:
+ label_x = x - label_w - 5
+ draw_text(ctx, label, color, label_x, y)
+
+def draw_sec_labels(ctx, options, rect, sec_w, nsecs):
+ ctx.set_font_size(AXIS_FONT_SIZE)
+ prev_x = 0
+ for i in range(0, rect[2] + 1, sec_w):
+ if ((i / sec_w) % nsecs == 0) :
+ if options.app_options.as_minutes :
+ label = "%.1f" % (i / sec_w / 60.0)
+ else :
+ label = "%d" % (i / sec_w)
+ label_w = ctx.text_extents(label)[2]
+ x = rect[0] + i - label_w/2
+ if x >= prev_x:
+ draw_text(ctx, label, TEXT_COLOR, x, rect[1] - 2)
+ prev_x = x + label_w
+
+def draw_box_ticks(ctx, rect, sec_w):
+ draw_rect(ctx, BORDER_COLOR, tuple(rect))
+
+ ctx.set_line_cap(cairo.LINE_CAP_SQUARE)
+
+ for i in range(sec_w, rect[2] + 1, sec_w):
+ if ((i / sec_w) % 10 == 0) :
+ ctx.set_line_width(1.5)
+ elif sec_w < 5 :
+ continue
+ else :
+ ctx.set_line_width(1.0)
+ if ((i / sec_w) % 30 == 0) :
+ ctx.set_source_rgba(*TICK_COLOR_BOLD)
+ else :
+ ctx.set_source_rgba(*TICK_COLOR)
+ ctx.move_to(rect[0] + i, rect[1] + 1)
+ ctx.line_to(rect[0] + i, rect[1] + rect[3] - 1)
+ ctx.stroke()
+ ctx.set_line_width(1.0)
+
+ ctx.set_line_cap(cairo.LINE_CAP_BUTT)
+
+def draw_annotations(ctx, proc_tree, times, rect):
+ ctx.set_line_cap(cairo.LINE_CAP_SQUARE)
+ ctx.set_source_rgba(*ANNOTATION_COLOR)
+ ctx.set_dash([4, 4])
+
+ for time in times:
+ if time is not None:
+ x = ((time - proc_tree.start_time) * rect[2] / proc_tree.duration)
+
+ ctx.move_to(rect[0] + x, rect[1] + 1)
+ ctx.line_to(rect[0] + x, rect[1] + rect[3] - 1)
+ ctx.stroke()
+
+ ctx.set_line_cap(cairo.LINE_CAP_BUTT)
+ ctx.set_dash([])
+
+def draw_chart(ctx, color, fill, chart_bounds, data, proc_tree, data_range):
+ ctx.set_line_width(0.5)
+ x_shift = proc_tree.start_time
+
+ def transform_point_coords(point, x_base, y_base, \
+ xscale, yscale, x_trans, y_trans):
+ x = (point[0] - x_base) * xscale + x_trans
+ y = (point[1] - y_base) * -yscale + y_trans + chart_bounds[3]
+ return x, y
+
+ max_x = max (x for (x, y) in data)
+ max_y = max (y for (x, y) in data)
+ # avoid divide by zero
+ if max_y == 0:
+ max_y = 1.0
+ xscale = float (chart_bounds[2]) / (max_x - x_shift)
+ # If data_range is given, scale the chart so that the value range in
+ # data_range matches the chart bounds exactly.
+ # Otherwise, scale so that the actual data matches the chart bounds.
+ if data_range:
+ yscale = float(chart_bounds[3]) / (data_range[1] - data_range[0])
+ ybase = data_range[0]
+ else:
+ yscale = float(chart_bounds[3]) / max_y
+ ybase = 0
+
+ first = transform_point_coords (data[0], x_shift, ybase, xscale, yscale, \
+ chart_bounds[0], chart_bounds[1])
+ last = transform_point_coords (data[-1], x_shift, ybase, xscale, yscale, \
+ chart_bounds[0], chart_bounds[1])
+
+ ctx.set_source_rgba(*color)
+ ctx.move_to(*first)
+ for point in data:
+ x, y = transform_point_coords (point, x_shift, ybase, xscale, yscale, \
+ chart_bounds[0], chart_bounds[1])
+ ctx.line_to(x, y)
+ if fill:
+ ctx.stroke_preserve()
+ ctx.line_to(last[0], chart_bounds[1]+chart_bounds[3])
+ ctx.line_to(first[0], chart_bounds[1]+chart_bounds[3])
+ ctx.line_to(first[0], first[1])
+ ctx.fill()
+ else:
+ ctx.stroke()
+ ctx.set_line_width(1.0)
+
+bar_h = 55
+meminfo_bar_h = 2 * bar_h
+header_h = 60
+# offsets
+off_x, off_y = 220, 10
+sec_w_base = 1 # the width of a second
+proc_h = 16 # the height of a process
+leg_s = 10
+MIN_IMG_W = 800
+CUML_HEIGHT = 2000 # Increased value to accomodate CPU and I/O Graphs
+OPTIONS = None
+
+def extents(options, xscale, trace):
+ start = min(trace.start.keys())
+ end = start
+
+ processes = 0
+ for proc in trace.processes:
+ if not options.app_options.show_all and \
+ trace.processes[proc][1] - trace.processes[proc][0] < options.app_options.mintime:
+ continue
+
+ if trace.processes[proc][1] > end:
+ end = trace.processes[proc][1]
+ processes += 1
+
+ if trace.min is not None and trace.max is not None:
+ start = trace.min
+ end = trace.max
+
+ w = int ((end - start) * sec_w_base * xscale) + 2 * off_x
+ h = proc_h * processes + header_h + 2 * off_y
+
+ if options.charts:
+ if trace.cpu_stats:
+ h += 30 + bar_h
+ if trace.disk_stats:
+ h += 30 + bar_h
+ if trace.monitor_disk:
+ h += 30 + bar_h
+ if trace.mem_stats:
+ h += meminfo_bar_h
+
+ return (w, h)
+
+def clip_visible(clip, rect):
+ xmax = max (clip[0], rect[0])
+ ymax = max (clip[1], rect[1])
+ xmin = min (clip[0] + clip[2], rect[0] + rect[2])
+ ymin = min (clip[1] + clip[3], rect[1] + rect[3])
+ return (xmin > xmax and ymin > ymax)
+
+def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w):
+ proc_tree = options.proc_tree(trace)
+
+ # render bar legend
+ if trace.cpu_stats:
+ ctx.set_font_size(LEGEND_FONT_SIZE)
+
+ draw_legend_box(ctx, "CPU (user+sys)", CPU_COLOR, off_x, curr_y+20, leg_s)
+ draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120, curr_y+20, leg_s)
+
+ # render I/O wait
+ chart_rect = (off_x, curr_y+30, w, bar_h)
+ if clip_visible (clip, chart_rect):
+ draw_box_ticks (ctx, chart_rect, sec_w)
+ draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+ draw_chart (ctx, IO_COLOR, True, chart_rect, \
+ [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], \
+ proc_tree, None)
+ # render CPU load
+ draw_chart (ctx, CPU_COLOR, True, chart_rect, \
+ [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], \
+ proc_tree, None)
+
+ curr_y = curr_y + 30 + bar_h
+
+ # render second chart
+ if trace.disk_stats:
+ draw_legend_line(ctx, "Disk throughput", DISK_TPUT_COLOR, off_x, curr_y+20, leg_s)
+ draw_legend_box(ctx, "Disk utilization", IO_COLOR, off_x + 120, curr_y+20, leg_s)
+
+ # render I/O utilization
+ chart_rect = (off_x, curr_y+30, w, bar_h)
+ if clip_visible (clip, chart_rect):
+ draw_box_ticks (ctx, chart_rect, sec_w)
+ draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+ draw_chart (ctx, IO_COLOR, True, chart_rect, \
+ [(sample.time, sample.util) for sample in trace.disk_stats], \
+ proc_tree, None)
+
+ # render disk throughput
+ max_sample = max (trace.disk_stats, key = lambda s: s.tput)
+ if clip_visible (clip, chart_rect):
+ draw_chart (ctx, DISK_TPUT_COLOR, False, chart_rect, \
+ [(sample.time, sample.tput) for sample in trace.disk_stats], \
+ proc_tree, None)
+
+ pos_x = off_x + ((max_sample.time - proc_tree.start_time) * w / proc_tree.duration)
+
+ shift_x, shift_y = -20, 20
+ if (pos_x < off_x + 245):
+ shift_x, shift_y = 5, 40
+
+ label = "%dMB/s" % round ((max_sample.tput) / 1024.0)
+ draw_text (ctx, label, DISK_TPUT_COLOR, pos_x + shift_x, curr_y + shift_y)
+
+ curr_y = curr_y + 30 + bar_h
+
+ # render disk space usage
+ #
+ # Draws the amount of disk space used on each volume relative to the
+ # lowest recorded amount. The graphs for each volume are stacked above
+ # each other so that total disk usage is visible.
+ if trace.monitor_disk:
+ ctx.set_font_size(LEGEND_FONT_SIZE)
+ # Determine set of volumes for which we have
+ # information and the minimal amount of used disk
+ # space for each. Currently samples are allowed to
+ # not have a values for all volumes; drawing could be
+ # made more efficient if that wasn't the case.
+ volumes = set()
+ min_used = {}
+ for sample in trace.monitor_disk:
+ for volume, used in sample.records.items():
+ volumes.add(volume)
+ if volume not in min_used or min_used[volume] > used:
+ min_used[volume] = used
+ volumes = sorted(list(volumes))
+ disk_scale = 0
+ for i, volume in enumerate(volumes):
+ volume_scale = max([sample.records[volume] - min_used[volume]
+ for sample in trace.monitor_disk
+ if volume in sample.records])
+ # Does not take length of volume name into account, but fixed offset
+ # works okay in practice.
+ draw_legend_box(ctx, '%s (max: %u MiB)' % (volume, volume_scale / 1024 / 1024),
+ VOLUME_COLORS[i % len(VOLUME_COLORS)],
+ off_x + i * 250, curr_y+20, leg_s)
+ disk_scale += volume_scale
+
+ # render used amount of disk space
+ chart_rect = (off_x, curr_y+30, w, bar_h)
+ if clip_visible (clip, chart_rect):
+ draw_box_ticks (ctx, chart_rect, sec_w)
+ draw_annotations (ctx, proc_tree, trace.times, chart_rect)
+ for i in range(len(volumes), 0, -1):
+ draw_chart (ctx, VOLUME_COLORS[(i - 1) % len(VOLUME_COLORS)], True, chart_rect, \
+ [(sample.time,
+ # Sum up used space of all volumes including the current one
+ # so that the graphs appear as stacked on top of each other.
+ reduce(lambda x,y: x+y,
+ [sample.records[volume] - min_used[volume]
+ for volume in volumes[0:i]
+ if volume in sample.records],
+ 0))
+ for sample in trace.monitor_disk], \
+ proc_tree, [0, disk_scale])
+
+ curr_y = curr_y + 30 + bar_h
+
+ # render mem usage
+ chart_rect = (off_x, curr_y+30, w, meminfo_bar_h)
+ mem_stats = trace.mem_stats
+ if mem_stats and clip_visible (clip, chart_rect):
+ mem_scale = max(sample.buffers for sample in mem_stats)
+ draw_legend_box(ctx, "Mem cached (scale: %u MiB)" % (float(mem_scale) / 1024), MEM_CACHED_COLOR, off_x, curr_y+20, leg_s)
+ draw_legend_box(ctx, "Used", MEM_USED_COLOR, off_x + 240, curr_y+20, leg_s)
+ draw_legend_box(ctx, "Buffers", MEM_BUFFERS_COLOR, off_x + 360, curr_y+20, leg_s)
+ draw_legend_line(ctx, "Swap (scale: %u MiB)" % max([(sample.swap)/1024 for sample in mem_stats]), \
+ MEM_SWAP_COLOR, off_x + 480, curr_y+20, leg_s)
+ draw_box_ticks(ctx, chart_rect, sec_w)
+ draw_annotations(ctx, proc_tree, trace.times, chart_rect)
+ draw_chart(ctx, MEM_BUFFERS_COLOR, True, chart_rect, \
+ [(sample.time, sample.buffers) for sample in trace.mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_USED_COLOR, True, chart_rect, \
+ [(sample.time, sample.used) for sample in mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_CACHED_COLOR, True, chart_rect, \
+ [(sample.time, sample.cached) for sample in mem_stats], \
+ proc_tree, [0, mem_scale])
+ draw_chart(ctx, MEM_SWAP_COLOR, False, chart_rect, \
+ [(sample.time, float(sample.swap)) for sample in mem_stats], \
+ proc_tree, None)
+
+ curr_y = curr_y + meminfo_bar_h
+
+ return curr_y
+
+def render_processes_chart(ctx, options, trace, curr_y, w, h, sec_w):
+ chart_rect = [off_x, curr_y+header_h, w, h - 2 * off_y - header_h - leg_s + proc_h]
+
+ draw_legend_box (ctx, "Configure", \
+ TASK_COLOR_CONFIGURE, off_x , curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Compile", \
+ TASK_COLOR_COMPILE, off_x+120, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Install", \
+ TASK_COLOR_INSTALL, off_x+240, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Populate Sysroot", \
+ TASK_COLOR_SYSROOT, off_x+360, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Package", \
+ TASK_COLOR_PACKAGE, off_x+480, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Package Write",
+ TASK_COLOR_PACKAGE_WRITE, off_x+600, curr_y + 45, leg_s)
+
+ ctx.set_font_size(PROC_TEXT_FONT_SIZE)
+
+ draw_box_ticks(ctx, chart_rect, sec_w)
+ draw_sec_labels(ctx, options, chart_rect, sec_w, 30)
+
+ y = curr_y+header_h
+
+ offset = trace.min or min(trace.start.keys())
+ for s in sorted(trace.start.keys()):
+ for val in sorted(trace.start[s]):
+ if not options.app_options.show_all and \
+ trace.processes[val][1] - s < options.app_options.mintime:
+ continue
+ task = val.split(":")[1]
+ #print val
+ #print trace.processes[val][1]
+ #print s
+ x = chart_rect[0] + (s - offset) * sec_w
+ w = ((trace.processes[val][1] - s) * sec_w)
+
+ #print "proc at %s %s %s %s" % (x, y, w, proc_h)
+ col = None
+ if task == "do_compile":
+ col = TASK_COLOR_COMPILE
+ elif task == "do_configure":
+ col = TASK_COLOR_CONFIGURE
+ elif task == "do_install":
+ col = TASK_COLOR_INSTALL
+ elif task == "do_populate_sysroot":
+ col = TASK_COLOR_SYSROOT
+ elif task == "do_package":
+ col = TASK_COLOR_PACKAGE
+ elif task == "do_package_write_rpm" or \
+ task == "do_package_write_deb" or \
+ task == "do_package_write_ipk":
+ col = TASK_COLOR_PACKAGE_WRITE
+ else:
+ col = WHITE
+
+ if col:
+ draw_fill_rect(ctx, col, (x, y, w, proc_h))
+ draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h))
+
+ draw_label_in_box(ctx, PROC_TEXT_COLOR, val, x, y + proc_h - 4, w, proc_h)
+ y = y + proc_h
+
+ return curr_y
+
+#
+# Render the chart.
+#
+def render(ctx, options, xscale, trace):
+ (w, h) = extents (options, xscale, trace)
+ global OPTIONS
+ OPTIONS = options.app_options
+
+ # x, y, w, h
+ clip = ctx.clip_extents()
+
+ sec_w = int (xscale * sec_w_base)
+ ctx.set_line_width(1.0)
+ ctx.select_font_face(FONT_NAME)
+ draw_fill_rect(ctx, WHITE, (0, 0, max(w, MIN_IMG_W), h))
+ w -= 2*off_x
+ curr_y = off_y;
+
+ if options.charts:
+ curr_y = render_charts (ctx, options, clip, trace, curr_y, w, h, sec_w)
+
+ curr_y = render_processes_chart (ctx, options, trace, curr_y, w, h, sec_w)
+
+ return
+
+ proc_tree = options.proc_tree (trace)
+
+ # draw the title and headers
+ if proc_tree.idle:
+ duration = proc_tree.idle
+ else:
+ duration = proc_tree.duration
+
+ if not options.kernel_only:
+ curr_y = draw_header (ctx, trace.headers, duration)
+ else:
+ curr_y = off_y;
+
+ # draw process boxes
+ proc_height = h
+ if proc_tree.taskstats and options.cumulative:
+ proc_height -= CUML_HEIGHT
+
+ draw_process_bar_chart(ctx, clip, options, proc_tree, trace.times,
+ curr_y, w, proc_height, sec_w)
+
+ curr_y = proc_height
+ ctx.set_font_size(SIG_FONT_SIZE)
+ draw_text(ctx, SIGNATURE, SIG_COLOR, off_x + 5, proc_height - 8)
+
+ # draw a cumulative CPU-time-per-process graph
+ if proc_tree.taskstats and options.cumulative:
+ cuml_rect = (off_x, curr_y + off_y, w, CUML_HEIGHT/2 - off_y * 2)
+ if clip_visible (clip, cuml_rect):
+ draw_cuml_graph(ctx, proc_tree, cuml_rect, duration, sec_w, STAT_TYPE_CPU)
+
+ # draw a cumulative I/O-time-per-process graph
+ if proc_tree.taskstats and options.cumulative:
+ cuml_rect = (off_x, curr_y + off_y * 100, w, CUML_HEIGHT/2 - off_y * 2)
+ if clip_visible (clip, cuml_rect):
+ draw_cuml_graph(ctx, proc_tree, cuml_rect, duration, sec_w, STAT_TYPE_IO)
+
+def draw_process_bar_chart(ctx, clip, options, proc_tree, times, curr_y, w, h, sec_w):
+ header_size = 0
+ if not options.kernel_only:
+ draw_legend_box (ctx, "Running (%cpu)",
+ PROC_COLOR_R, off_x , curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Unint.sleep (I/O)",
+ PROC_COLOR_D, off_x+120, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Sleeping",
+ PROC_COLOR_S, off_x+240, curr_y + 45, leg_s)
+ draw_legend_box (ctx, "Zombie",
+ PROC_COLOR_Z, off_x+360, curr_y + 45, leg_s)
+ header_size = 45
+
+ chart_rect = [off_x, curr_y + header_size + 15,
+ w, h - 2 * off_y - (curr_y + header_size + 15) + proc_h]
+ ctx.set_font_size (PROC_TEXT_FONT_SIZE)
+
+ draw_box_ticks (ctx, chart_rect, sec_w)
+ if sec_w > 100:
+ nsec = 1
+ else:
+ nsec = 5
+ draw_sec_labels (ctx, options, chart_rect, sec_w, nsec)
+ draw_annotations (ctx, proc_tree, times, chart_rect)
+
+ y = curr_y + 60
+ for root in proc_tree.process_tree:
+ draw_processes_recursively(ctx, root, proc_tree, y, proc_h, chart_rect, clip)
+ y = y + proc_h * proc_tree.num_nodes([root])
+
+
+def draw_header (ctx, headers, duration):
+ toshow = [
+ ('system.uname', 'uname', lambda s: s),
+ ('system.release', 'release', lambda s: s),
+ ('system.cpu', 'CPU', lambda s: re.sub('model name\s*:\s*', '', s, 1)),
+ ('system.kernel.options', 'kernel options', lambda s: s),
+ ]
+
+ header_y = ctx.font_extents()[2] + 10
+ ctx.set_font_size(TITLE_FONT_SIZE)
+ draw_text(ctx, headers['title'], TEXT_COLOR, off_x, header_y)
+ ctx.set_font_size(TEXT_FONT_SIZE)
+
+ for (headerkey, headertitle, mangle) in toshow:
+ header_y += ctx.font_extents()[2]
+ if headerkey in headers:
+ value = headers.get(headerkey)
+ else:
+ value = ""
+ txt = headertitle + ': ' + mangle(value)
+ draw_text(ctx, txt, TEXT_COLOR, off_x, header_y)
+
+ dur = duration / 100.0
+ txt = 'time : %02d:%05.2f' % (math.floor(dur/60), dur - 60 * math.floor(dur/60))
+ if headers.get('system.maxpid') is not None:
+ txt = txt + ' max pid: %s' % (headers.get('system.maxpid'))
+
+ header_y += ctx.font_extents()[2]
+ draw_text (ctx, txt, TEXT_COLOR, off_x, header_y)
+
+ return header_y
+
+def draw_processes_recursively(ctx, proc, proc_tree, y, proc_h, rect, clip) :
+ x = rect[0] + ((proc.start_time - proc_tree.start_time) * rect[2] / proc_tree.duration)
+ w = ((proc.duration) * rect[2] / proc_tree.duration)
+
+ draw_process_activity_colors(ctx, proc, proc_tree, x, y, w, proc_h, rect, clip)
+ draw_rect(ctx, PROC_BORDER_COLOR, (x, y, w, proc_h))
+ ipid = int(proc.pid)
+ if not OPTIONS.show_all:
+ cmdString = proc.cmd
+ else:
+ cmdString = ''
+ if (OPTIONS.show_pid or OPTIONS.show_all) and ipid is not 0:
+ cmdString = cmdString + " [" + str(ipid // 1000) + "]"
+ if OPTIONS.show_all:
+ if proc.args:
+ cmdString = cmdString + " '" + "' '".join(proc.args) + "'"
+ else:
+ cmdString = cmdString + " " + proc.exe
+
+ draw_label_in_box(ctx, PROC_TEXT_COLOR, cmdString, x, y + proc_h - 4, w, rect[0] + rect[2])
+
+ next_y = y + proc_h
+ for child in proc.child_list:
+ if next_y > clip[1] + clip[3]:
+ break
+ child_x, child_y = draw_processes_recursively(ctx, child, proc_tree, next_y, proc_h, rect, clip)
+ draw_process_connecting_lines(ctx, x, y, child_x, child_y, proc_h)
+ next_y = next_y + proc_h * proc_tree.num_nodes([child])
+
+ return x, y
+
+
+def draw_process_activity_colors(ctx, proc, proc_tree, x, y, w, proc_h, rect, clip):
+
+ if y > clip[1] + clip[3] or y + proc_h + 2 < clip[1]:
+ return
+
+ draw_fill_rect(ctx, PROC_COLOR_S, (x, y, w, proc_h))
+
+ last_tx = -1
+ for sample in proc.samples :
+ tx = rect[0] + round(((sample.time - proc_tree.start_time) * rect[2] / proc_tree.duration))
+
+ # samples are sorted chronologically
+ if tx < clip[0]:
+ continue
+ if tx > clip[0] + clip[2]:
+ break
+
+ tw = round(proc_tree.sample_period * rect[2] / float(proc_tree.duration))
+ if last_tx != -1 and abs(last_tx - tx) <= tw:
+ tw -= last_tx - tx
+ tx = last_tx
+ tw = max (tw, 1) # nice to see at least something
+
+ last_tx = tx + tw
+ state = get_proc_state( sample.state )
+
+ color = STATE_COLORS[state]
+ if state == STATE_RUNNING:
+ alpha = min (sample.cpu_sample.user + sample.cpu_sample.sys, 1.0)
+ color = tuple(list(PROC_COLOR_R[0:3]) + [alpha])
+# print "render time %d [ tx %d tw %d ], sample state %s color %s alpha %g" % (sample.time, tx, tw, state, color, alpha)
+ elif state == STATE_SLEEPING:
+ continue
+
+ draw_fill_rect(ctx, color, (tx, y, tw, proc_h))
+
+def draw_process_connecting_lines(ctx, px, py, x, y, proc_h):
+ ctx.set_source_rgba(*DEP_COLOR)
+ ctx.set_dash([2, 2])
+ if abs(px - x) < 3:
+ dep_off_x = 3
+ dep_off_y = proc_h / 4
+ ctx.move_to(x, y + proc_h / 2)
+ ctx.line_to(px - dep_off_x, y + proc_h / 2)
+ ctx.line_to(px - dep_off_x, py - dep_off_y)
+ ctx.line_to(px, py - dep_off_y)
+ else:
+ ctx.move_to(x, y + proc_h / 2)
+ ctx.line_to(px, y + proc_h / 2)
+ ctx.line_to(px, py)
+ ctx.stroke()
+ ctx.set_dash([])
+
+# elide the bootchart collector - it is quite distorting
+def elide_bootchart(proc):
+ return proc.cmd == 'bootchartd' or proc.cmd == 'bootchart-colle'
+
+class CumlSample:
+ def __init__(self, proc):
+ self.cmd = proc.cmd
+ self.samples = []
+ self.merge_samples (proc)
+ self.color = None
+
+ def merge_samples(self, proc):
+ self.samples.extend (proc.samples)
+ self.samples.sort (key = lambda p: p.time)
+
+ def next(self):
+ global palette_idx
+ palette_idx += HSV_STEP
+ return palette_idx
+
+ def get_color(self):
+ if self.color is None:
+ i = self.next() % HSV_MAX_MOD
+ h = 0.0
+ if i is not 0:
+ h = (1.0 * i) / HSV_MAX_MOD
+ s = 0.5
+ v = 1.0
+ c = colorsys.hsv_to_rgb (h, s, v)
+ self.color = (c[0], c[1], c[2], 1.0)
+ return self.color
+
+
+def draw_cuml_graph(ctx, proc_tree, chart_bounds, duration, sec_w, stat_type):
+ global palette_idx
+ palette_idx = 0
+
+ time_hash = {}
+ total_time = 0.0
+ m_proc_list = {}
+
+ if stat_type is STAT_TYPE_CPU:
+ sample_value = 'cpu'
+ else:
+ sample_value = 'io'
+ for proc in proc_tree.process_list:
+ if elide_bootchart(proc):
+ continue
+
+ for sample in proc.samples:
+ total_time += getattr(sample.cpu_sample, sample_value)
+ if not sample.time in time_hash:
+ time_hash[sample.time] = 1
+
+ # merge pids with the same cmd
+ if not proc.cmd in m_proc_list:
+ m_proc_list[proc.cmd] = CumlSample (proc)
+ continue
+ s = m_proc_list[proc.cmd]
+ s.merge_samples (proc)
+
+ # all the sample times
+ times = sorted(time_hash)
+ if len (times) < 2:
+ print("degenerate boot chart")
+ return
+
+ pix_per_ns = chart_bounds[3] / total_time
+# print "total time: %g pix-per-ns %g" % (total_time, pix_per_ns)
+
+ # FIXME: we have duplicates in the process list too [!] - why !?
+
+ # Render bottom up, left to right
+ below = {}
+ for time in times:
+ below[time] = chart_bounds[1] + chart_bounds[3]
+
+ # same colors each time we render
+ random.seed (0)
+
+ ctx.set_line_width(1)
+
+ legends = []
+ labels = []
+
+ # render each pid in order
+ for cs in m_proc_list.values():
+ row = {}
+ cuml = 0.0
+
+ # print "pid : %s -> %g samples %d" % (proc.cmd, cuml, len (cs.samples))
+ for sample in cs.samples:
+ cuml += getattr(sample.cpu_sample, sample_value)
+ row[sample.time] = cuml
+
+ process_total_time = cuml
+
+ # hide really tiny processes
+ if cuml * pix_per_ns <= 2:
+ continue
+
+ last_time = times[0]
+ y = last_below = below[last_time]
+ last_cuml = cuml = 0.0
+
+ ctx.set_source_rgba(*cs.get_color())
+ for time in times:
+ render_seg = False
+
+ # did the underlying trend increase ?
+ if below[time] != last_below:
+ last_below = below[last_time]
+ last_cuml = cuml
+ render_seg = True
+
+ # did we move up a pixel increase ?
+ if time in row:
+ nc = round (row[time] * pix_per_ns)
+ if nc != cuml:
+ last_cuml = cuml
+ cuml = nc
+ render_seg = True
+
+# if last_cuml > cuml:
+# assert fail ... - un-sorted process samples
+
+ # draw the trailing rectangle from the last time to
+ # before now, at the height of the last segment.
+ if render_seg:
+ w = math.ceil ((time - last_time) * chart_bounds[2] / proc_tree.duration) + 1
+ x = chart_bounds[0] + round((last_time - proc_tree.start_time) * chart_bounds[2] / proc_tree.duration)
+ ctx.rectangle (x, below[last_time] - last_cuml, w, last_cuml)
+ ctx.fill()
+# ctx.stroke()
+ last_time = time
+ y = below [time] - cuml
+
+ row[time] = y
+
+ # render the last segment
+ x = chart_bounds[0] + round((last_time - proc_tree.start_time) * chart_bounds[2] / proc_tree.duration)
+ y = below[last_time] - cuml
+ ctx.rectangle (x, y, chart_bounds[2] - x, cuml)
+ ctx.fill()
+# ctx.stroke()
+
+ # render legend if it will fit
+ if cuml > 8:
+ label = cs.cmd
+ extnts = ctx.text_extents(label)
+ label_w = extnts[2]
+ label_h = extnts[3]
+# print "Text extents %g by %g" % (label_w, label_h)
+ labels.append((label,
+ chart_bounds[0] + chart_bounds[2] - label_w - off_x * 2,
+ y + (cuml + label_h) / 2))
+ if cs in legends:
+ print("ARGH - duplicate process in list !")
+
+ legends.append ((cs, process_total_time))
+
+ below = row
+
+ # render grid-lines over the top
+ draw_box_ticks(ctx, chart_bounds, sec_w)
+
+ # render labels
+ for l in labels:
+ draw_text(ctx, l[0], TEXT_COLOR, l[1], l[2])
+
+ # Render legends
+ font_height = 20
+ label_width = 300
+ LEGENDS_PER_COL = 15
+ LEGENDS_TOTAL = 45
+ ctx.set_font_size (TITLE_FONT_SIZE)
+ dur_secs = duration / 100
+ cpu_secs = total_time / 1000000000
+
+ # misleading - with multiple CPUs ...
+# idle = ((dur_secs - cpu_secs) / dur_secs) * 100.0
+ if stat_type is STAT_TYPE_CPU:
+ label = "Cumulative CPU usage, by process; total CPU: " \
+ " %.5g(s) time: %.3g(s)" % (cpu_secs, dur_secs)
+ else:
+ label = "Cumulative I/O usage, by process; total I/O: " \
+ " %.5g(s) time: %.3g(s)" % (cpu_secs, dur_secs)
+
+ draw_text(ctx, label, TEXT_COLOR, chart_bounds[0] + off_x,
+ chart_bounds[1] + font_height)
+
+ i = 0
+ legends = sorted(legends, key=itemgetter(1), reverse=True)
+ ctx.set_font_size(TEXT_FONT_SIZE)
+ for t in legends:
+ cs = t[0]
+ time = t[1]
+ x = chart_bounds[0] + off_x + int (i/LEGENDS_PER_COL) * label_width
+ y = chart_bounds[1] + font_height * ((i % LEGENDS_PER_COL) + 2)
+ str = "%s - %.0f(ms) (%2.2f%%)" % (cs.cmd, time/1000000, (time/total_time) * 100.0)
+ draw_legend_box(ctx, str, cs.color, x, y, leg_s)
+ i = i + 1
+ if i >= LEGENDS_TOTAL:
+ break
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/gui.py b/poky/scripts/pybootchartgui/pybootchartgui/gui.py
new file mode 100644
index 000000000..7fedd232d
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/gui.py
@@ -0,0 +1,350 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+import gobject
+import gtk
+import gtk.gdk
+import gtk.keysyms
+from . import draw
+from .draw import RenderOptions
+
+class PyBootchartWidget(gtk.DrawingArea):
+ __gsignals__ = {
+ 'expose-event': 'override',
+ 'clicked' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_STRING, gtk.gdk.Event)),
+ 'position-changed' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gobject.TYPE_INT, gobject.TYPE_INT)),
+ 'set-scroll-adjustments' : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, (gtk.Adjustment, gtk.Adjustment))
+ }
+
+ def __init__(self, trace, options, xscale):
+ gtk.DrawingArea.__init__(self)
+
+ self.trace = trace
+ self.options = options
+
+ self.set_flags(gtk.CAN_FOCUS)
+
+ self.add_events(gtk.gdk.BUTTON_PRESS_MASK | gtk.gdk.BUTTON_RELEASE_MASK)
+ self.connect("button-press-event", self.on_area_button_press)
+ self.connect("button-release-event", self.on_area_button_release)
+ self.add_events(gtk.gdk.POINTER_MOTION_MASK | gtk.gdk.POINTER_MOTION_HINT_MASK | gtk.gdk.BUTTON_RELEASE_MASK)
+ self.connect("motion-notify-event", self.on_area_motion_notify)
+ self.connect("scroll-event", self.on_area_scroll_event)
+ self.connect('key-press-event', self.on_key_press_event)
+
+ self.connect('set-scroll-adjustments', self.on_set_scroll_adjustments)
+ self.connect("size-allocate", self.on_allocation_size_changed)
+ self.connect("position-changed", self.on_position_changed)
+
+ self.zoom_ratio = 1.0
+ self.xscale = xscale
+ self.x, self.y = 0.0, 0.0
+
+ self.chart_width, self.chart_height = draw.extents(self.options, self.xscale, self.trace)
+ self.hadj = None
+ self.vadj = None
+ self.hadj_changed_signal_id = None
+ self.vadj_changed_signal_id = None
+
+ def do_expose_event(self, event):
+ cr = self.window.cairo_create()
+
+ # set a clip region for the expose event
+ cr.rectangle(
+ event.area.x, event.area.y,
+ event.area.width, event.area.height
+ )
+ cr.clip()
+ self.draw(cr, self.get_allocation())
+ return False
+
+ def draw(self, cr, rect):
+ cr.set_source_rgba(1.0, 1.0, 1.0, 1.0)
+ cr.paint()
+ cr.scale(self.zoom_ratio, self.zoom_ratio)
+ cr.translate(-self.x, -self.y)
+ draw.render(cr, self.options, self.xscale, self.trace)
+
+ def position_changed(self):
+ self.emit("position-changed", self.x, self.y)
+
+ ZOOM_INCREMENT = 1.25
+
+ def zoom_image (self, zoom_ratio):
+ self.zoom_ratio = zoom_ratio
+ self._set_scroll_adjustments (self.hadj, self.vadj)
+ self.queue_draw()
+
+ def zoom_to_rect (self, rect):
+ zoom_ratio = float(rect.width)/float(self.chart_width)
+ self.zoom_image(zoom_ratio)
+ self.x = 0
+ self.position_changed()
+
+ def set_xscale(self, xscale):
+ old_mid_x = self.x + self.hadj.page_size / 2
+ self.xscale = xscale
+ self.chart_width, self.chart_height = draw.extents(self.options, self.xscale, self.trace)
+ new_x = old_mid_x
+ self.zoom_image (self.zoom_ratio)
+
+ def on_expand(self, action):
+ self.set_xscale (int(self.xscale * 1.5 + 0.5))
+
+ def on_contract(self, action):
+ self.set_xscale (max(int(self.xscale / 1.5), 1))
+
+ def on_zoom_in(self, action):
+ self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)
+
+ def on_zoom_out(self, action):
+ self.zoom_image(self.zoom_ratio / self.ZOOM_INCREMENT)
+
+ def on_zoom_fit(self, action):
+ self.zoom_to_rect(self.get_allocation())
+
+ def on_zoom_100(self, action):
+ self.zoom_image(1.0)
+ self.set_xscale(1.0)
+
+ def show_toggled(self, button):
+ self.options.app_options.show_all = button.get_property ('active')
+ self.chart_width, self.chart_height = draw.extents(self.options, self.xscale, self.trace)
+ self._set_scroll_adjustments(self.hadj, self.vadj)
+ self.queue_draw()
+
+ POS_INCREMENT = 100
+
+ def on_key_press_event(self, widget, event):
+ if event.keyval == gtk.keysyms.Left:
+ self.x -= self.POS_INCREMENT/self.zoom_ratio
+ elif event.keyval == gtk.keysyms.Right:
+ self.x += self.POS_INCREMENT/self.zoom_ratio
+ elif event.keyval == gtk.keysyms.Up:
+ self.y -= self.POS_INCREMENT/self.zoom_ratio
+ elif event.keyval == gtk.keysyms.Down:
+ self.y += self.POS_INCREMENT/self.zoom_ratio
+ else:
+ return False
+ self.queue_draw()
+ self.position_changed()
+ return True
+
+ def on_area_button_press(self, area, event):
+ if event.button == 2 or event.button == 1:
+ area.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.FLEUR))
+ self.prevmousex = event.x
+ self.prevmousey = event.y
+ if event.type not in (gtk.gdk.BUTTON_PRESS, gtk.gdk.BUTTON_RELEASE):
+ return False
+ return False
+
+ def on_area_button_release(self, area, event):
+ if event.button == 2 or event.button == 1:
+ area.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.ARROW))
+ self.prevmousex = None
+ self.prevmousey = None
+ return True
+ return False
+
+ def on_area_scroll_event(self, area, event):
+ if event.state & gtk.gdk.CONTROL_MASK:
+ if event.direction == gtk.gdk.SCROLL_UP:
+ self.zoom_image(self.zoom_ratio * self.ZOOM_INCREMENT)
+ return True
+ if event.direction == gtk.gdk.SCROLL_DOWN:
+ self.zoom_image(self.zoom_ratio / self.ZOOM_INCREMENT)
+ return True
+ return False
+
+ def on_area_motion_notify(self, area, event):
+ state = event.state
+ if state & gtk.gdk.BUTTON2_MASK or state & gtk.gdk.BUTTON1_MASK:
+ x, y = int(event.x), int(event.y)
+ # pan the image
+ self.x += (self.prevmousex - x)/self.zoom_ratio
+ self.y += (self.prevmousey - y)/self.zoom_ratio
+ self.queue_draw()
+ self.prevmousex = x
+ self.prevmousey = y
+ self.position_changed()
+ return True
+
+ def on_set_scroll_adjustments(self, area, hadj, vadj):
+ self._set_scroll_adjustments (hadj, vadj)
+
+ def on_allocation_size_changed(self, widget, allocation):
+ self.hadj.page_size = allocation.width
+ self.hadj.page_increment = allocation.width * 0.9
+ self.vadj.page_size = allocation.height
+ self.vadj.page_increment = allocation.height * 0.9
+
+ def _set_adj_upper(self, adj, upper):
+ changed = False
+ value_changed = False
+
+ if adj.upper != upper:
+ adj.upper = upper
+ changed = True
+
+ max_value = max(0.0, upper - adj.page_size)
+ if adj.value > max_value:
+ adj.value = max_value
+ value_changed = True
+
+ if changed:
+ adj.changed()
+ if value_changed:
+ adj.value_changed()
+
+ def _set_scroll_adjustments(self, hadj, vadj):
+ if hadj == None:
+ hadj = gtk.Adjustment(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
+ if vadj == None:
+ vadj = gtk.Adjustment(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
+
+ if self.hadj_changed_signal_id != None and \
+ self.hadj != None and hadj != self.hadj:
+ self.hadj.disconnect (self.hadj_changed_signal_id)
+ if self.vadj_changed_signal_id != None and \
+ self.vadj != None and vadj != self.vadj:
+ self.vadj.disconnect (self.vadj_changed_signal_id)
+
+ if hadj != None:
+ self.hadj = hadj
+ self._set_adj_upper (self.hadj, self.zoom_ratio * self.chart_width)
+ self.hadj_changed_signal_id = self.hadj.connect('value-changed', self.on_adjustments_changed)
+
+ if vadj != None:
+ self.vadj = vadj
+ self._set_adj_upper (self.vadj, self.zoom_ratio * self.chart_height)
+ self.vadj_changed_signal_id = self.vadj.connect('value-changed', self.on_adjustments_changed)
+
+ def on_adjustments_changed(self, adj):
+ self.x = self.hadj.value / self.zoom_ratio
+ self.y = self.vadj.value / self.zoom_ratio
+ self.queue_draw()
+
+ def on_position_changed(self, widget, x, y):
+ self.hadj.value = x * self.zoom_ratio
+ self.vadj.value = y * self.zoom_ratio
+
+PyBootchartWidget.set_set_scroll_adjustments_signal('set-scroll-adjustments')
+
+class PyBootchartShell(gtk.VBox):
+ ui = '''
+ <ui>
+ <toolbar name="ToolBar">
+ <toolitem action="Expand"/>
+ <toolitem action="Contract"/>
+ <separator/>
+ <toolitem action="ZoomIn"/>
+ <toolitem action="ZoomOut"/>
+ <toolitem action="ZoomFit"/>
+ <toolitem action="Zoom100"/>
+ </toolbar>
+ </ui>
+ '''
+ def __init__(self, window, trace, options, xscale):
+ gtk.VBox.__init__(self)
+
+ self.widget = PyBootchartWidget(trace, options, xscale)
+
+ # Create a UIManager instance
+ uimanager = self.uimanager = gtk.UIManager()
+
+ # Add the accelerator group to the toplevel window
+ accelgroup = uimanager.get_accel_group()
+ window.add_accel_group(accelgroup)
+
+ # Create an ActionGroup
+ actiongroup = gtk.ActionGroup('Actions')
+ self.actiongroup = actiongroup
+
+ # Create actions
+ actiongroup.add_actions((
+ ('Expand', gtk.STOCK_ADD, None, None, None, self.widget.on_expand),
+ ('Contract', gtk.STOCK_REMOVE, None, None, None, self.widget.on_contract),
+ ('ZoomIn', gtk.STOCK_ZOOM_IN, None, None, None, self.widget.on_zoom_in),
+ ('ZoomOut', gtk.STOCK_ZOOM_OUT, None, None, None, self.widget.on_zoom_out),
+ ('ZoomFit', gtk.STOCK_ZOOM_FIT, 'Fit Width', None, None, self.widget.on_zoom_fit),
+ ('Zoom100', gtk.STOCK_ZOOM_100, None, None, None, self.widget.on_zoom_100),
+ ))
+
+ # Add the actiongroup to the uimanager
+ uimanager.insert_action_group(actiongroup, 0)
+
+ # Add a UI description
+ uimanager.add_ui_from_string(self.ui)
+
+ # Scrolled window
+ scrolled = gtk.ScrolledWindow()
+ scrolled.add(self.widget)
+
+ # toolbar / h-box
+ hbox = gtk.HBox(False, 8)
+
+ # Create a Toolbar
+ toolbar = uimanager.get_widget('/ToolBar')
+ hbox.pack_start(toolbar, True, True)
+
+ if not options.kernel_only:
+ # Misc. options
+ button = gtk.CheckButton("Show more")
+ button.connect ('toggled', self.widget.show_toggled)
+ button.set_active(options.app_options.show_all)
+ hbox.pack_start (button, False, True)
+
+ self.pack_start(hbox, False)
+ self.pack_start(scrolled)
+ self.show_all()
+
+ def grab_focus(self, window):
+ window.set_focus(self.widget)
+
+
+class PyBootchartWindow(gtk.Window):
+
+ def __init__(self, trace, app_options):
+ gtk.Window.__init__(self)
+
+ window = self
+ window.set_title("Bootchart %s" % trace.filename)
+ window.set_default_size(750, 550)
+
+ tab_page = gtk.Notebook()
+ tab_page.show()
+ window.add(tab_page)
+
+ full_opts = RenderOptions(app_options)
+ full_tree = PyBootchartShell(window, trace, full_opts, 1.0)
+ tab_page.append_page (full_tree, gtk.Label("Full tree"))
+
+ if trace.kernel is not None and len (trace.kernel) > 2:
+ kernel_opts = RenderOptions(app_options)
+ kernel_opts.cumulative = False
+ kernel_opts.charts = False
+ kernel_opts.kernel_only = True
+ kernel_tree = PyBootchartShell(window, trace, kernel_opts, 5.0)
+ tab_page.append_page (kernel_tree, gtk.Label("Kernel boot"))
+
+ full_tree.grab_focus(self)
+ self.show()
+
+
+def show(trace, options):
+ win = PyBootchartWindow(trace, options)
+ win.connect('destroy', gtk.main_quit)
+ gtk.main()
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/main.py b/poky/scripts/pybootchartgui/pybootchartgui/main.py
new file mode 120000
index 000000000..b45ae0a3d
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/main.py
@@ -0,0 +1 @@
+main.py.in \ No newline at end of file
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/main.py.in b/poky/scripts/pybootchartgui/pybootchartgui/main.py.in
new file mode 100644
index 000000000..a954b125d
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/main.py.in
@@ -0,0 +1,183 @@
+#
+# ***********************************************************************
+# Warning: This file is auto-generated from main.py.in - edit it there.
+# ***********************************************************************
+#
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import os
+import optparse
+
+from . import parsing
+from . import batch
+
+def _mk_options_parser():
+ """Make an options parser."""
+ usage = "%prog [options] /path/to/tmp/buildstats/<recipe-machine>/<BUILDNAME>/"
+ version = "%prog v1.0.0"
+ parser = optparse.OptionParser(usage, version=version)
+ parser.add_option("-i", "--interactive", action="store_true", dest="interactive", default=False,
+ help="start in active mode")
+ parser.add_option("-f", "--format", dest="format", default="png", choices=["png", "svg", "pdf"],
+ help="image format (png, svg, pdf); default format png")
+ parser.add_option("-o", "--output", dest="output", metavar="PATH", default=None,
+ help="output path (file or directory) where charts are stored")
+ parser.add_option("-s", "--split", dest="num", type=int, default=1,
+ help="split the output chart into <NUM> charts, only works with \"-o PATH\"")
+ parser.add_option("-m", "--mintime", dest="mintime", type=int, default=8,
+ help="only tasks longer than this time will be displayed")
+ parser.add_option("-M", "--minutes", action="store_true", dest="as_minutes", default=False,
+ help="display time in minutes instead of seconds")
+# parser.add_option("-n", "--no-prune", action="store_false", dest="prune", default=True,
+# help="do not prune the process tree")
+ parser.add_option("-q", "--quiet", action="store_true", dest="quiet", default=False,
+ help="suppress informational messages")
+# parser.add_option("-t", "--boot-time", action="store_true", dest="boottime", default=False,
+# help="only display the boot time of the boot in text format (stdout)")
+ parser.add_option("--very-quiet", action="store_true", dest="veryquiet", default=False,
+ help="suppress all messages except errors")
+ parser.add_option("--verbose", action="store_true", dest="verbose", default=False,
+ help="print all messages")
+# parser.add_option("--profile", action="store_true", dest="profile", default=False,
+# help="profile rendering of chart (only useful when in batch mode indicated by -f)")
+# parser.add_option("--show-pid", action="store_true", dest="show_pid", default=False,
+# help="show process ids in the bootchart as 'processname [pid]'")
+ parser.add_option("--show-all", action="store_true", dest="show_all", default=False,
+ help="show all processes in the chart")
+# parser.add_option("--crop-after", dest="crop_after", metavar="PROCESS", default=None,
+# help="crop chart when idle after PROCESS is started")
+# parser.add_option("--annotate", action="append", dest="annotate", metavar="PROCESS", default=None,
+# help="annotate position where PROCESS is started; can be specified multiple times. " +
+# "To create a single annotation when any one of a set of processes is started, use commas to separate the names")
+# parser.add_option("--annotate-file", dest="annotate_file", metavar="FILENAME", default=None,
+# help="filename to write annotation points to")
+ parser.add_option("-T", "--full-time", action="store_true", dest="full_time", default=False,
+ help="display the full time regardless of which processes are currently shown")
+ return parser
+
+class Writer:
+ def __init__(self, write, options):
+ self.write = write
+ self.options = options
+
+ def error(self, msg):
+ self.write(msg)
+
+ def warn(self, msg):
+ if not self.options.quiet:
+ self.write(msg)
+
+ def info(self, msg):
+ if self.options.verbose:
+ self.write(msg)
+
+ def status(self, msg):
+ if not self.options.quiet:
+ self.write(msg)
+
+def _mk_writer(options):
+ def write(s):
+ print(s)
+ return Writer(write, options)
+
+def _get_filename(path):
+ """Construct a usable filename for outputs"""
+ dname = "."
+ fname = "bootchart"
+ if path != None:
+ if os.path.isdir(path):
+ dname = path
+ else:
+ fname = path
+ return os.path.join(dname, fname)
+
+def main(argv=None):
+ try:
+ if argv is None:
+ argv = sys.argv[1:]
+
+ parser = _mk_options_parser()
+ options, args = parser.parse_args(argv)
+
+ # Default values for disabled options
+ options.prune = True
+ options.boottime = False
+ options.profile = False
+ options.show_pid = False
+ options.crop_after = None
+ options.annotate = None
+ options.annotate_file = None
+
+ writer = _mk_writer(options)
+
+ if len(args) == 0:
+ print("No path given, trying /var/log/bootchart.tgz")
+ args = [ "/var/log/bootchart.tgz" ]
+
+ res = parsing.Trace(writer, args, options)
+
+ if options.interactive or options.output == None:
+ from . import gui
+ gui.show(res, options)
+ elif options.boottime:
+ import math
+ proc_tree = res.proc_tree
+ if proc_tree.idle:
+ duration = proc_tree.idle
+ else:
+ duration = proc_tree.duration
+ dur = duration / 100.0
+ print('%02d:%05.2f' % (math.floor(dur/60), dur - 60 * math.floor(dur/60)))
+ else:
+ if options.annotate_file:
+ f = open (options.annotate_file, "w")
+ try:
+ for time in res[4]:
+ if time is not None:
+ # output as ms
+ f.write(time * 10)
+ finally:
+ f.close()
+ filename = _get_filename(options.output)
+ res_list = parsing.split_res(res, options)
+ n = 1
+ width = len(str(len(res_list)))
+ s = "_%%0%dd." % width
+ for r in res_list:
+ if len(res_list) == 1:
+ f = filename + "." + options.format
+ else:
+ f = filename + s % n + options.format
+ n = n + 1
+ def render():
+ batch.render(writer, r, options, f)
+ if options.profile:
+ import cProfile
+ import pstats
+ profile = '%s.prof' % os.path.splitext(filename)[0]
+ cProfile.runctx('render()', globals(), locals(), profile)
+ p = pstats.Stats(profile)
+ p.strip_dirs().sort_stats('time').print_stats(20)
+ else:
+ render()
+
+ return 0
+ except parsing.ParseError as ex:
+ print(("Parse error: %s" % ex))
+ return 2
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/parsing.py b/poky/scripts/pybootchartgui/pybootchartgui/parsing.py
new file mode 100644
index 000000000..bcfb2da56
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -0,0 +1,821 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import string
+import re
+import sys
+import tarfile
+from time import clock
+from collections import defaultdict
+from functools import reduce
+
+from .samples import *
+from .process_tree import ProcessTree
+
+if sys.version_info >= (3, 0):
+ long = int
+
+# Parsing produces as its end result a 'Trace'
+
+class Trace:
+ def __init__(self, writer, paths, options):
+ self.processes = {}
+ self.start = {}
+ self.end = {}
+ self.min = None
+ self.max = None
+ self.headers = None
+ self.disk_stats = []
+ self.ps_stats = None
+ self.taskstats = None
+ self.cpu_stats = []
+ self.cmdline = None
+ self.kernel = None
+ self.kernel_tree = None
+ self.filename = None
+ self.parent_map = None
+ self.mem_stats = []
+ self.monitor_disk = None
+ self.times = [] # Always empty, but expected by draw.py when drawing system charts.
+
+ if len(paths):
+ parse_paths (writer, self, paths)
+ if not self.valid():
+ raise ParseError("empty state: '%s' does not contain a valid bootchart" % ", ".join(paths))
+
+ if options.full_time:
+ self.min = min(self.start.keys())
+ self.max = max(self.end.keys())
+
+
+ # Rendering system charts depends on start and end
+ # time. Provide them where the original drawing code expects
+ # them, i.e. in proc_tree.
+ class BitbakeProcessTree:
+ def __init__(self, start_time, end_time):
+ self.start_time = start_time
+ self.end_time = end_time
+ self.duration = self.end_time - self.start_time
+ self.proc_tree = BitbakeProcessTree(min(self.start.keys()),
+ max(self.end.keys()))
+
+
+ return
+
+ # Turn that parsed information into something more useful
+ # link processes into a tree of pointers, calculate statistics
+ self.compile(writer)
+
+ # Crop the chart to the end of the first idle period after the given
+ # process
+ if options.crop_after:
+ idle = self.crop (writer, options.crop_after)
+ else:
+ idle = None
+
+ # Annotate other times as the first start point of given process lists
+ self.times = [ idle ]
+ if options.annotate:
+ for procnames in options.annotate:
+ names = [x[:15] for x in procnames.split(",")]
+ for proc in self.ps_stats.process_map.values():
+ if proc.cmd in names:
+ self.times.append(proc.start_time)
+ break
+ else:
+ self.times.append(None)
+
+ self.proc_tree = ProcessTree(writer, self.kernel, self.ps_stats,
+ self.ps_stats.sample_period,
+ self.headers.get("profile.process"),
+ options.prune, idle, self.taskstats,
+ self.parent_map is not None)
+
+ if self.kernel is not None:
+ self.kernel_tree = ProcessTree(writer, self.kernel, None, 0,
+ self.headers.get("profile.process"),
+ False, None, None, True)
+
+ def valid(self):
+ return len(self.processes) != 0
+ return self.headers != None and self.disk_stats != None and \
+ self.ps_stats != None and self.cpu_stats != None
+
+ def add_process(self, process, start, end):
+ self.processes[process] = [start, end]
+ if start not in self.start:
+ self.start[start] = []
+ if process not in self.start[start]:
+ self.start[start].append(process)
+ if end not in self.end:
+ self.end[end] = []
+ if process not in self.end[end]:
+ self.end[end].append(process)
+
+ def compile(self, writer):
+
+ def find_parent_id_for(pid):
+ if pid is 0:
+ return 0
+ ppid = self.parent_map.get(pid)
+ if ppid:
+ # many of these double forks are so short lived
+ # that we have no samples, or process info for them
+ # so climb the parent hierarcy to find one
+ if int (ppid * 1000) not in self.ps_stats.process_map:
+# print "Pid '%d' short lived with no process" % ppid
+ ppid = find_parent_id_for (ppid)
+# else:
+# print "Pid '%d' has an entry" % ppid
+ else:
+# print "Pid '%d' missing from pid map" % pid
+ return 0
+ return ppid
+
+ # merge in the cmdline data
+ if self.cmdline is not None:
+ for proc in self.ps_stats.process_map.values():
+ rpid = int (proc.pid // 1000)
+ if rpid in self.cmdline:
+ cmd = self.cmdline[rpid]
+ proc.exe = cmd['exe']
+ proc.args = cmd['args']
+# else:
+# print "proc %d '%s' not in cmdline" % (rpid, proc.exe)
+
+ # re-parent any stray orphans if we can
+ if self.parent_map is not None:
+ for process in self.ps_stats.process_map.values():
+ ppid = find_parent_id_for (int(process.pid // 1000))
+ if ppid:
+ process.ppid = ppid * 1000
+
+ # stitch the tree together with pointers
+ for process in self.ps_stats.process_map.values():
+ process.set_parent (self.ps_stats.process_map)
+
+ # count on fingers variously
+ for process in self.ps_stats.process_map.values():
+ process.calc_stats (self.ps_stats.sample_period)
+
+ def crop(self, writer, crop_after):
+
+ def is_idle_at(util, start, j):
+ k = j + 1
+ while k < len(util) and util[k][0] < start + 300:
+ k += 1
+ k = min(k, len(util)-1)
+
+ if util[j][1] >= 0.25:
+ return False
+
+ avgload = sum(u[1] for u in util[j:k+1]) / (k-j+1)
+ if avgload < 0.25:
+ return True
+ else:
+ return False
+ def is_idle(util, start):
+ for j in range(0, len(util)):
+ if util[j][0] < start:
+ continue
+ return is_idle_at(util, start, j)
+ else:
+ return False
+
+ names = [x[:15] for x in crop_after.split(",")]
+ for proc in self.ps_stats.process_map.values():
+ if proc.cmd in names or proc.exe in names:
+ writer.info("selected proc '%s' from list (start %d)"
+ % (proc.cmd, proc.start_time))
+ break
+ if proc is None:
+ writer.warn("no selected crop proc '%s' in list" % crop_after)
+
+
+ cpu_util = [(sample.time, sample.user + sample.sys + sample.io) for sample in self.cpu_stats]
+ disk_util = [(sample.time, sample.util) for sample in self.disk_stats]
+
+ idle = None
+ for i in range(0, len(cpu_util)):
+ if cpu_util[i][0] < proc.start_time:
+ continue
+ if is_idle_at(cpu_util, cpu_util[i][0], i) \
+ and is_idle(disk_util, cpu_util[i][0]):
+ idle = cpu_util[i][0]
+ break
+
+ if idle is None:
+ writer.warn ("not idle after proc '%s'" % crop_after)
+ return None
+
+ crop_at = idle + 300
+ writer.info ("cropping at time %d" % crop_at)
+ while len (self.cpu_stats) \
+ and self.cpu_stats[-1].time > crop_at:
+ self.cpu_stats.pop()
+ while len (self.disk_stats) \
+ and self.disk_stats[-1].time > crop_at:
+ self.disk_stats.pop()
+
+ self.ps_stats.end_time = crop_at
+
+ cropped_map = {}
+ for key, value in self.ps_stats.process_map.items():
+ if (value.start_time <= crop_at):
+ cropped_map[key] = value
+
+ for proc in cropped_map.values():
+ proc.duration = min (proc.duration, crop_at - proc.start_time)
+ while len (proc.samples) \
+ and proc.samples[-1].time > crop_at:
+ proc.samples.pop()
+
+ self.ps_stats.process_map = cropped_map
+
+ return idle
+
+
+
+class ParseError(Exception):
+ """Represents errors during parse of the bootchart."""
+ def __init__(self, value):
+ self.value = value
+
+ def __str__(self):
+ return self.value
+
+def _parse_headers(file):
+ """Parses the headers of the bootchart."""
+ def parse(acc, line):
+ (headers, last) = acc
+ if '=' in line:
+ last, value = map (lambda x: x.strip(), line.split('=', 1))
+ else:
+ value = line.strip()
+ headers[last] += value
+ return headers, last
+ return reduce(parse, file.read().decode('utf-8').split('\n'), (defaultdict(str),''))[0]
+
+def _parse_timed_blocks(file):
+ """Parses (ie., splits) a file into so-called timed-blocks. A
+ timed-block consists of a timestamp on a line by itself followed
+ by zero or more lines of data for that point in time."""
+ def parse(block):
+ lines = block.split('\n')
+ if not lines:
+ raise ParseError('expected a timed-block consisting a timestamp followed by data lines')
+ try:
+ return (int(lines[0]), lines[1:])
+ except ValueError:
+ raise ParseError("expected a timed-block, but timestamp '%s' is not an integer" % lines[0])
+ blocks = file.read().decode('utf-8').split('\n\n')
+ return [parse(block) for block in blocks if block.strip() and not block.endswith(' not running\n')]
+
+def _parse_proc_ps_log(writer, file):
+ """
+ * See proc(5) for details.
+ *
+ * {pid, comm, state, ppid, pgrp, session, tty_nr, tpgid, flags, minflt, cminflt, majflt, cmajflt, utime, stime,
+ * cutime, cstime, priority, nice, 0, itrealvalue, starttime, vsize, rss, rlim, startcode, endcode, startstack,
+ * kstkesp, kstkeip}
+ """
+ processMap = {}
+ ltime = 0
+ timed_blocks = _parse_timed_blocks(file)
+ for time, lines in timed_blocks:
+ for line in lines:
+ if not line: continue
+ tokens = line.split(' ')
+ if len(tokens) < 21:
+ continue
+
+ offset = [index for index, token in enumerate(tokens[1:]) if token[-1] == ')'][0]
+ pid, cmd, state, ppid = int(tokens[0]), ' '.join(tokens[1:2+offset]), tokens[2+offset], int(tokens[3+offset])
+ userCpu, sysCpu, stime = int(tokens[13+offset]), int(tokens[14+offset]), int(tokens[21+offset])
+
+ # magic fixed point-ness ...
+ pid *= 1000
+ ppid *= 1000
+ if pid in processMap:
+ process = processMap[pid]
+ process.cmd = cmd.strip('()') # why rename after latest name??
+ else:
+ process = Process(writer, pid, cmd.strip('()'), ppid, min(time, stime))
+ processMap[pid] = process
+
+ if process.last_user_cpu_time is not None and process.last_sys_cpu_time is not None and ltime is not None:
+ userCpuLoad, sysCpuLoad = process.calc_load(userCpu, sysCpu, max(1, time - ltime))
+ cpuSample = CPUSample('null', userCpuLoad, sysCpuLoad, 0.0)
+ process.samples.append(ProcessSample(time, state, cpuSample))
+
+ process.last_user_cpu_time = userCpu
+ process.last_sys_cpu_time = sysCpu
+ ltime = time
+
+ if len (timed_blocks) < 2:
+ return None
+
+ startTime = timed_blocks[0][0]
+ avgSampleLength = (ltime - startTime)/(len (timed_blocks) - 1)
+
+ return ProcessStats (writer, processMap, len (timed_blocks), avgSampleLength, startTime, ltime)
+
+def _parse_taskstats_log(writer, file):
+ """
+ * See bootchart-collector.c for details.
+ *
+ * { pid, ppid, comm, cpu_run_real_total, blkio_delay_total, swapin_delay_total }
+ *
+ """
+ processMap = {}
+ pidRewrites = {}
+ ltime = None
+ timed_blocks = _parse_timed_blocks(file)
+ for time, lines in timed_blocks:
+ # we have no 'stime' from taskstats, so prep 'init'
+ if ltime is None:
+ process = Process(writer, 1, '[init]', 0, 0)
+ processMap[1000] = process
+ ltime = time
+# continue
+ for line in lines:
+ if not line: continue
+ tokens = line.split(' ')
+ if len(tokens) != 6:
+ continue
+
+ opid, ppid, cmd = int(tokens[0]), int(tokens[1]), tokens[2]
+ cpu_ns, blkio_delay_ns, swapin_delay_ns = long(tokens[-3]), long(tokens[-2]), long(tokens[-1]),
+
+ # make space for trees of pids
+ opid *= 1000
+ ppid *= 1000
+
+ # when the process name changes, we re-write the pid.
+ if opid in pidRewrites:
+ pid = pidRewrites[opid]
+ else:
+ pid = opid
+
+ cmd = cmd.strip('(').strip(')')
+ if pid in processMap:
+ process = processMap[pid]
+ if process.cmd != cmd:
+ pid += 1
+ pidRewrites[opid] = pid
+# print "process mutation ! '%s' vs '%s' pid %s -> pid %s\n" % (process.cmd, cmd, opid, pid)
+ process = process.split (writer, pid, cmd, ppid, time)
+ processMap[pid] = process
+ else:
+ process.cmd = cmd;
+ else:
+ process = Process(writer, pid, cmd, ppid, time)
+ processMap[pid] = process
+
+ delta_cpu_ns = (float) (cpu_ns - process.last_cpu_ns)
+ delta_blkio_delay_ns = (float) (blkio_delay_ns - process.last_blkio_delay_ns)
+ delta_swapin_delay_ns = (float) (swapin_delay_ns - process.last_swapin_delay_ns)
+
+ # make up some state data ...
+ if delta_cpu_ns > 0:
+ state = "R"
+ elif delta_blkio_delay_ns + delta_swapin_delay_ns > 0:
+ state = "D"
+ else:
+ state = "S"
+
+ # retain the ns timing information into a CPUSample - that tries
+ # with the old-style to be a %age of CPU used in this time-slice.
+ if delta_cpu_ns + delta_blkio_delay_ns + delta_swapin_delay_ns > 0:
+# print "proc %s cpu_ns %g delta_cpu %g" % (cmd, cpu_ns, delta_cpu_ns)
+ cpuSample = CPUSample('null', delta_cpu_ns, 0.0,
+ delta_blkio_delay_ns,
+ delta_swapin_delay_ns)
+ process.samples.append(ProcessSample(time, state, cpuSample))
+
+ process.last_cpu_ns = cpu_ns
+ process.last_blkio_delay_ns = blkio_delay_ns
+ process.last_swapin_delay_ns = swapin_delay_ns
+ ltime = time
+
+ if len (timed_blocks) < 2:
+ return None
+
+ startTime = timed_blocks[0][0]
+ avgSampleLength = (ltime - startTime)/(len(timed_blocks)-1)
+
+ return ProcessStats (writer, processMap, len (timed_blocks), avgSampleLength, startTime, ltime)
+
+def _parse_proc_stat_log(file):
+ samples = []
+ ltimes = None
+ for time, lines in _parse_timed_blocks(file):
+ # skip emtpy lines
+ if not lines:
+ continue
+ # CPU times {user, nice, system, idle, io_wait, irq, softirq}
+ tokens = lines[0].split()
+ times = [ int(token) for token in tokens[1:] ]
+ if ltimes:
+ user = float((times[0] + times[1]) - (ltimes[0] + ltimes[1]))
+ system = float((times[2] + times[5] + times[6]) - (ltimes[2] + ltimes[5] + ltimes[6]))
+ idle = float(times[3] - ltimes[3])
+ iowait = float(times[4] - ltimes[4])
+
+ aSum = max(user + system + idle + iowait, 1)
+ samples.append( CPUSample(time, user/aSum, system/aSum, iowait/aSum) )
+
+ ltimes = times
+ # skip the rest of statistics lines
+ return samples
+
+def _parse_reduced_log(file, sample_class):
+ samples = []
+ for time, lines in _parse_timed_blocks(file):
+ samples.append(sample_class(time, *[float(x) for x in lines[0].split()]))
+ return samples
+
+def _parse_proc_disk_stat_log(file):
+ """
+ Parse file for disk stats, but only look at the whole device, eg. sda,
+ not sda1, sda2 etc. The format of relevant lines should be:
+ {major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq}
+ """
+ disk_regex_re = re.compile ('^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$')
+
+ # this gets called an awful lot.
+ def is_relevant_line(linetokens):
+ if len(linetokens) != 14:
+ return False
+ disk = linetokens[2]
+ return disk_regex_re.match(disk)
+
+ disk_stat_samples = []
+
+ for time, lines in _parse_timed_blocks(file):
+ sample = DiskStatSample(time)
+ relevant_tokens = [linetokens for linetokens in map (lambda x: x.split(),lines) if is_relevant_line(linetokens)]
+
+ for tokens in relevant_tokens:
+ disk, rsect, wsect, use = tokens[2], int(tokens[5]), int(tokens[9]), int(tokens[12])
+ sample.add_diskdata([rsect, wsect, use])
+
+ disk_stat_samples.append(sample)
+
+ disk_stats = []
+ for sample1, sample2 in zip(disk_stat_samples[:-1], disk_stat_samples[1:]):
+ interval = sample1.time - sample2.time
+ if interval == 0:
+ interval = 1
+ sums = [ a - b for a, b in zip(sample1.diskdata, sample2.diskdata) ]
+ readTput = sums[0] / 2.0 * 100.0 / interval
+ writeTput = sums[1] / 2.0 * 100.0 / interval
+ util = float( sums[2] ) / 10 / interval
+ util = max(0.0, min(1.0, util))
+ disk_stats.append(DiskSample(sample2.time, readTput, writeTput, util))
+
+ return disk_stats
+
+def _parse_reduced_proc_meminfo_log(file):
+ """
+ Parse file for global memory statistics with
+ 'MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree' values
+ (in that order) directly stored on one line.
+ """
+ used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
+
+ mem_stats = []
+ for time, lines in _parse_timed_blocks(file):
+ sample = MemSample(time)
+ for name, value in zip(used_values, lines[0].split()):
+ sample.add_value(name, int(value))
+
+ if sample.valid():
+ mem_stats.append(DrawMemSample(sample))
+
+ return mem_stats
+
+def _parse_proc_meminfo_log(file):
+ """
+ Parse file for global memory statistics.
+ The format of relevant lines should be: ^key: value( unit)?
+ """
+ used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
+
+ mem_stats = []
+ meminfo_re = re.compile(r'([^ \t:]+):\s*(\d+).*')
+
+ for time, lines in _parse_timed_blocks(file):
+ sample = MemSample(time)
+
+ for line in lines:
+ match = meminfo_re.match(line)
+ if not match:
+ raise ParseError("Invalid meminfo line \"%s\"" % line)
+ sample.add_value(match.group(1), int(match.group(2)))
+
+ if sample.valid():
+ mem_stats.append(DrawMemSample(sample))
+
+ return mem_stats
+
+def _parse_monitor_disk_log(file):
+ """
+ Parse file with information about amount of diskspace used.
+ The format of relevant lines should be: ^volume path: number-of-bytes?
+ """
+ disk_stats = []
+ diskinfo_re = re.compile(r'^(.+):\s*(\d+)$')
+
+ for time, lines in _parse_timed_blocks(file):
+ sample = DiskSpaceSample(time)
+
+ for line in lines:
+ match = diskinfo_re.match(line)
+ if not match:
+ raise ParseError("Invalid monitor_disk line \"%s\"" % line)
+ sample.add_value(match.group(1), int(match.group(2)))
+
+ if sample.valid():
+ disk_stats.append(sample)
+
+ return disk_stats
+
+
+# if we boot the kernel with: initcall_debug printk.time=1 we can
+# get all manner of interesting data from the dmesg output
+# We turn this into a pseudo-process tree: each event is
+# characterised by a
+# we don't try to detect a "kernel finished" state - since the kernel
+# continues to do interesting things after init is called.
+#
+# sample input:
+# [ 0.000000] ACPI: FACP 3f4fc000 000F4 (v04 INTEL Napa 00000001 MSFT 01000013)
+# ...
+# [ 0.039993] calling migration_init+0x0/0x6b @ 1
+# [ 0.039993] initcall migration_init+0x0/0x6b returned 1 after 0 usecs
+def _parse_dmesg(writer, file):
+ timestamp_re = re.compile ("^\[\s*(\d+\.\d+)\s*]\s+(.*)$")
+ split_re = re.compile ("^(\S+)\s+([\S\+_-]+) (.*)$")
+ processMap = {}
+ idx = 0
+ inc = 1.0 / 1000000
+ kernel = Process(writer, idx, "k-boot", 0, 0.1)
+ processMap['k-boot'] = kernel
+ base_ts = False
+ max_ts = 0
+ for line in file.read().decode('utf-8').split('\n'):
+ t = timestamp_re.match (line)
+ if t is None:
+# print "duff timestamp " + line
+ continue
+
+ time_ms = float (t.group(1)) * 1000
+ # looks like we may have a huge diff after the clock
+ # has been set up. This could lead to huge graph:
+ # so huge we will be killed by the OOM.
+ # So instead of using the plain timestamp we will
+ # use a delta to first one and skip the first one
+ # for convenience
+ if max_ts == 0 and not base_ts and time_ms > 1000:
+ base_ts = time_ms
+ continue
+ max_ts = max(time_ms, max_ts)
+ if base_ts:
+# print "fscked clock: used %f instead of %f" % (time_ms - base_ts, time_ms)
+ time_ms -= base_ts
+ m = split_re.match (t.group(2))
+
+ if m is None:
+ continue
+# print "match: '%s'" % (m.group(1))
+ type = m.group(1)
+ func = m.group(2)
+ rest = m.group(3)
+
+ if t.group(2).startswith ('Write protecting the') or \
+ t.group(2).startswith ('Freeing unused kernel memory'):
+ kernel.duration = time_ms / 10
+ continue
+
+# print "foo: '%s' '%s' '%s'" % (type, func, rest)
+ if type == "calling":
+ ppid = kernel.pid
+ p = re.match ("\@ (\d+)", rest)
+ if p is not None:
+ ppid = float (p.group(1)) // 1000
+# print "match: '%s' ('%g') at '%s'" % (func, ppid, time_ms)
+ name = func.split ('+', 1) [0]
+ idx += inc
+ processMap[func] = Process(writer, ppid + idx, name, ppid, time_ms / 10)
+ elif type == "initcall":
+# print "finished: '%s' at '%s'" % (func, time_ms)
+ if func in processMap:
+ process = processMap[func]
+ process.duration = (time_ms / 10) - process.start_time
+ else:
+ print("corrupted init call for %s" % (func))
+
+ elif type == "async_waiting" or type == "async_continuing":
+ continue # ignore
+
+ return processMap.values()
+
+#
+# Parse binary pacct accounting file output if we have one
+# cf. /usr/include/linux/acct.h
+#
+def _parse_pacct(writer, file):
+ # read LE int32
+ def _read_le_int32(file):
+ byts = file.read(4)
+ return (ord(byts[0])) | (ord(byts[1]) << 8) | \
+ (ord(byts[2]) << 16) | (ord(byts[3]) << 24)
+
+ parent_map = {}
+ parent_map[0] = 0
+ while file.read(1) != "": # ignore flags
+ ver = file.read(1)
+ if ord(ver) < 3:
+ print("Invalid version 0x%x" % (ord(ver)))
+ return None
+
+ file.seek (14, 1) # user, group etc.
+ pid = _read_le_int32 (file)
+ ppid = _read_le_int32 (file)
+# print "Parent of %d is %d" % (pid, ppid)
+ parent_map[pid] = ppid
+ file.seek (4 + 4 + 16, 1) # timings
+ file.seek (16, 1) # acct_comm
+ return parent_map
+
+def _parse_paternity_log(writer, file):
+ parent_map = {}
+ parent_map[0] = 0
+ for line in file.read().decode('utf-8').split('\n'):
+ if not line:
+ continue
+ elems = line.split(' ') # <Child> <Parent>
+ if len (elems) >= 2:
+# print "paternity of %d is %d" % (int(elems[0]), int(elems[1]))
+ parent_map[int(elems[0])] = int(elems[1])
+ else:
+ print("Odd paternity line '%s'" % (line))
+ return parent_map
+
+def _parse_cmdline_log(writer, file):
+ cmdLines = {}
+ for block in file.read().decode('utf-8').split('\n\n'):
+ lines = block.split('\n')
+ if len (lines) >= 3:
+# print "Lines '%s'" % (lines[0])
+ pid = int (lines[0])
+ values = {}
+ values['exe'] = lines[1].lstrip(':')
+ args = lines[2].lstrip(':').split('\0')
+ args.pop()
+ values['args'] = args
+ cmdLines[pid] = values
+ return cmdLines
+
+def _parse_bitbake_buildstats(writer, state, filename, file):
+ paths = filename.split("/")
+ task = paths[-1]
+ pn = paths[-2]
+ start = None
+ end = None
+ for line in file:
+ if line.startswith("Started:"):
+ start = int(float(line.split()[-1]))
+ elif line.startswith("Ended:"):
+ end = int(float(line.split()[-1]))
+ if start and end:
+ state.add_process(pn + ":" + task, start, end)
+
+def get_num_cpus(headers):
+ """Get the number of CPUs from the system.cpu header property. As the
+ CPU utilization graphs are relative, the number of CPUs currently makes
+ no difference."""
+ if headers is None:
+ return 1
+ if headers.get("system.cpu.num"):
+ return max (int (headers.get("system.cpu.num")), 1)
+ cpu_model = headers.get("system.cpu")
+ if cpu_model is None:
+ return 1
+ mat = re.match(".*\\((\\d+)\\)", cpu_model)
+ if mat is None:
+ return 1
+ return max (int(mat.group(1)), 1)
+
+def _do_parse(writer, state, filename, file):
+ writer.info("parsing '%s'" % filename)
+ t1 = clock()
+ name = os.path.basename(filename)
+ if name == "proc_diskstats.log":
+ state.disk_stats = _parse_proc_disk_stat_log(file)
+ elif name == "reduced_proc_diskstats.log":
+ state.disk_stats = _parse_reduced_log(file, DiskSample)
+ elif name == "proc_stat.log":
+ state.cpu_stats = _parse_proc_stat_log(file)
+ elif name == "reduced_proc_stat.log":
+ state.cpu_stats = _parse_reduced_log(file, CPUSample)
+ elif name == "proc_meminfo.log":
+ state.mem_stats = _parse_proc_meminfo_log(file)
+ elif name == "reduced_proc_meminfo.log":
+ state.mem_stats = _parse_reduced_proc_meminfo_log(file)
+ elif name == "cmdline2.log":
+ state.cmdline = _parse_cmdline_log(writer, file)
+ elif name == "monitor_disk.log":
+ state.monitor_disk = _parse_monitor_disk_log(file)
+ elif not filename.endswith('.log'):
+ _parse_bitbake_buildstats(writer, state, filename, file)
+ t2 = clock()
+ writer.info(" %s seconds" % str(t2-t1))
+ return state
+
+def parse_file(writer, state, filename):
+ if state.filename is None:
+ state.filename = filename
+ basename = os.path.basename(filename)
+ with open(filename, "rb") as file:
+ return _do_parse(writer, state, filename, file)
+
+def parse_paths(writer, state, paths):
+ for path in paths:
+ if state.filename is None:
+ state.filename = path
+ root, extension = os.path.splitext(path)
+ if not(os.path.exists(path)):
+ writer.warn("warning: path '%s' does not exist, ignoring." % path)
+ continue
+ #state.filename = path
+ if os.path.isdir(path):
+ files = sorted([os.path.join(path, f) for f in os.listdir(path)])
+ state = parse_paths(writer, state, files)
+ elif extension in [".tar", ".tgz", ".gz"]:
+ if extension == ".gz":
+ root, extension = os.path.splitext(root)
+ if extension != ".tar":
+ writer.warn("warning: can only handle zipped tar files, not zipped '%s'-files; ignoring" % extension)
+ continue
+ tf = None
+ try:
+ writer.status("parsing '%s'" % path)
+ tf = tarfile.open(path, 'r:*')
+ for name in tf.getnames():
+ state = _do_parse(writer, state, name, tf.extractfile(name))
+ except tarfile.ReadError as error:
+ raise ParseError("error: could not read tarfile '%s': %s." % (path, error))
+ finally:
+ if tf != None:
+ tf.close()
+ else:
+ state = parse_file(writer, state, path)
+ return state
+
+def split_res(res, options):
+ """ Split the res into n pieces """
+ res_list = []
+ if options.num > 1:
+ s_list = sorted(res.start.keys())
+ frag_size = len(s_list) / float(options.num)
+ # Need the top value
+ if frag_size > int(frag_size):
+ frag_size = int(frag_size + 1)
+ else:
+ frag_size = int(frag_size)
+
+ start = 0
+ end = frag_size
+ while start < end:
+ state = Trace(None, [], None)
+ if options.full_time:
+ state.min = min(res.start.keys())
+ state.max = max(res.end.keys())
+ for i in range(start, end):
+ # Add this line for reference
+ #state.add_process(pn + ":" + task, start, end)
+ for p in res.start[s_list[i]]:
+ state.add_process(p, s_list[i], res.processes[p][1])
+ start = end
+ end = end + frag_size
+ if end > len(s_list):
+ end = len(s_list)
+ res_list.append(state)
+ else:
+ res_list.append(res)
+ return res_list
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/process_tree.py b/poky/scripts/pybootchartgui/pybootchartgui/process_tree.py
new file mode 100644
index 000000000..cf88110b1
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/process_tree.py
@@ -0,0 +1,292 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+class ProcessTree:
+ """ProcessTree encapsulates a process tree. The tree is built from log files
+ retrieved during the boot process. When building the process tree, it is
+ pruned and merged in order to be able to visualize it in a comprehensible
+ manner.
+
+ The following pruning techniques are used:
+
+ * idle processes that keep running during the last process sample
+ (which is a heuristic for a background processes) are removed,
+ * short-lived processes (i.e. processes that only live for the
+ duration of two samples or less) are removed,
+ * the processes used by the boot logger are removed,
+ * exploders (i.e. processes that are known to spawn huge meaningless
+ process subtrees) have their subtrees merged together,
+ * siblings (i.e. processes with the same command line living
+ concurrently -- thread heuristic) are merged together,
+ * process runs (unary trees with processes sharing the command line)
+ are merged together.
+
+ """
+ LOGGER_PROC = 'bootchart-colle'
+ EXPLODER_PROCESSES = set(['hwup'])
+
+ def __init__(self, writer, kernel, psstats, sample_period,
+ monitoredApp, prune, idle, taskstats,
+ accurate_parentage, for_testing = False):
+ self.writer = writer
+ self.process_tree = []
+ self.taskstats = taskstats
+ if psstats is None:
+ process_list = kernel
+ elif kernel is None:
+ process_list = psstats.process_map.values()
+ else:
+ process_list = list(kernel) + list(psstats.process_map.values())
+ self.process_list = sorted(process_list, key = lambda p: p.pid)
+ self.sample_period = sample_period
+
+ self.build()
+ if not accurate_parentage:
+ self.update_ppids_for_daemons(self.process_list)
+
+ self.start_time = self.get_start_time(self.process_tree)
+ self.end_time = self.get_end_time(self.process_tree)
+ self.duration = self.end_time - self.start_time
+ self.idle = idle
+
+ if for_testing:
+ return
+
+ removed = self.merge_logger(self.process_tree, self.LOGGER_PROC, monitoredApp, False)
+ writer.status("merged %i logger processes" % removed)
+
+ if prune:
+ p_processes = self.prune(self.process_tree, None)
+ p_exploders = self.merge_exploders(self.process_tree, self.EXPLODER_PROCESSES)
+ p_threads = self.merge_siblings(self.process_tree)
+ p_runs = self.merge_runs(self.process_tree)
+ writer.status("pruned %i process, %i exploders, %i threads, and %i runs" % (p_processes, p_exploders, p_threads, p_runs))
+
+ self.sort(self.process_tree)
+
+ self.start_time = self.get_start_time(self.process_tree)
+ self.end_time = self.get_end_time(self.process_tree)
+ self.duration = self.end_time - self.start_time
+
+ self.num_proc = self.num_nodes(self.process_tree)
+
+ def build(self):
+ """Build the process tree from the list of top samples."""
+ self.process_tree = []
+ for proc in self.process_list:
+ if not proc.parent:
+ self.process_tree.append(proc)
+ else:
+ proc.parent.child_list.append(proc)
+
+ def sort(self, process_subtree):
+ """Sort process tree."""
+ for p in process_subtree:
+ p.child_list.sort(key = lambda p: p.pid)
+ self.sort(p.child_list)
+
+ def num_nodes(self, process_list):
+ "Counts the number of nodes in the specified process tree."""
+ nodes = 0
+ for proc in process_list:
+ nodes = nodes + self.num_nodes(proc.child_list)
+ return nodes + len(process_list)
+
+ def get_start_time(self, process_subtree):
+ """Returns the start time of the process subtree. This is the start
+ time of the earliest process.
+
+ """
+ if not process_subtree:
+ return 100000000
+ return min( [min(proc.start_time, self.get_start_time(proc.child_list)) for proc in process_subtree] )
+
+ def get_end_time(self, process_subtree):
+ """Returns the end time of the process subtree. This is the end time
+ of the last collected sample.
+
+ """
+ if not process_subtree:
+ return -100000000
+ return max( [max(proc.start_time + proc.duration, self.get_end_time(proc.child_list)) for proc in process_subtree] )
+
+ def get_max_pid(self, process_subtree):
+ """Returns the max PID found in the process tree."""
+ if not process_subtree:
+ return -100000000
+ return max( [max(proc.pid, self.get_max_pid(proc.child_list)) for proc in process_subtree] )
+
+ def update_ppids_for_daemons(self, process_list):
+ """Fedora hack: when loading the system services from rc, runuser(1)
+ is used. This sets the PPID of all daemons to 1, skewing
+ the process tree. Try to detect this and set the PPID of
+ these processes the PID of rc.
+
+ """
+ rcstartpid = -1
+ rcendpid = -1
+ rcproc = None
+ for p in process_list:
+ if p.cmd == "rc" and p.ppid // 1000 == 1:
+ rcproc = p
+ rcstartpid = p.pid
+ rcendpid = self.get_max_pid(p.child_list)
+ if rcstartpid != -1 and rcendpid != -1:
+ for p in process_list:
+ if p.pid > rcstartpid and p.pid < rcendpid and p.ppid // 1000 == 1:
+ p.ppid = rcstartpid
+ p.parent = rcproc
+ for p in process_list:
+ p.child_list = []
+ self.build()
+
+ def prune(self, process_subtree, parent):
+ """Prunes the process tree by removing idle processes and processes
+ that only live for the duration of a single top sample. Sibling
+ processes with the same command line (i.e. threads) are merged
+ together. This filters out sleepy background processes, short-lived
+ processes and bootcharts' analysis tools.
+ """
+ def is_idle_background_process_without_children(p):
+ process_end = p.start_time + p.duration
+ return not p.active and \
+ process_end >= self.start_time + self.duration and \
+ p.start_time > self.start_time and \
+ p.duration > 0.9 * self.duration and \
+ self.num_nodes(p.child_list) == 0
+
+ num_removed = 0
+ idx = 0
+ while idx < len(process_subtree):
+ p = process_subtree[idx]
+ if parent != None or len(p.child_list) == 0:
+
+ prune = False
+ if is_idle_background_process_without_children(p):
+ prune = True
+ elif p.duration <= 2 * self.sample_period:
+ # short-lived process
+ prune = True
+
+ if prune:
+ process_subtree.pop(idx)
+ for c in p.child_list:
+ process_subtree.insert(idx, c)
+ num_removed += 1
+ continue
+ else:
+ num_removed += self.prune(p.child_list, p)
+ else:
+ num_removed += self.prune(p.child_list, p)
+ idx += 1
+
+ return num_removed
+
+ def merge_logger(self, process_subtree, logger_proc, monitored_app, app_tree):
+ """Merges the logger's process subtree. The logger will typically
+ spawn lots of sleep and cat processes, thus polluting the
+ process tree.
+
+ """
+ num_removed = 0
+ for p in process_subtree:
+ is_app_tree = app_tree
+ if logger_proc == p.cmd and not app_tree:
+ is_app_tree = True
+ num_removed += self.merge_logger(p.child_list, logger_proc, monitored_app, is_app_tree)
+ # don't remove the logger itself
+ continue
+
+ if app_tree and monitored_app != None and monitored_app == p.cmd:
+ is_app_tree = False
+
+ if is_app_tree:
+ for child in p.child_list:
+ self.merge_processes(p, child)
+ num_removed += 1
+ p.child_list = []
+ else:
+ num_removed += self.merge_logger(p.child_list, logger_proc, monitored_app, is_app_tree)
+ return num_removed
+
+ def merge_exploders(self, process_subtree, processes):
+ """Merges specific process subtrees (used for processes which usually
+ spawn huge meaningless process trees).
+
+ """
+ num_removed = 0
+ for p in process_subtree:
+ if processes in processes and len(p.child_list) > 0:
+ subtreemap = self.getProcessMap(p.child_list)
+ for child in subtreemap.values():
+ self.merge_processes(p, child)
+ num_removed += len(subtreemap)
+ p.child_list = []
+ p.cmd += " (+)"
+ else:
+ num_removed += self.merge_exploders(p.child_list, processes)
+ return num_removed
+
+ def merge_siblings(self, process_subtree):
+ """Merges thread processes. Sibling processes with the same command
+ line are merged together.
+
+ """
+ num_removed = 0
+ idx = 0
+ while idx < len(process_subtree)-1:
+ p = process_subtree[idx]
+ nextp = process_subtree[idx+1]
+ if nextp.cmd == p.cmd:
+ process_subtree.pop(idx+1)
+ idx -= 1
+ num_removed += 1
+ p.child_list.extend(nextp.child_list)
+ self.merge_processes(p, nextp)
+ num_removed += self.merge_siblings(p.child_list)
+ idx += 1
+ if len(process_subtree) > 0:
+ p = process_subtree[-1]
+ num_removed += self.merge_siblings(p.child_list)
+ return num_removed
+
+ def merge_runs(self, process_subtree):
+ """Merges process runs. Single child processes which share the same
+ command line with the parent are merged.
+
+ """
+ num_removed = 0
+ idx = 0
+ while idx < len(process_subtree):
+ p = process_subtree[idx]
+ if len(p.child_list) == 1 and p.child_list[0].cmd == p.cmd:
+ child = p.child_list[0]
+ p.child_list = list(child.child_list)
+ self.merge_processes(p, child)
+ num_removed += 1
+ continue
+ num_removed += self.merge_runs(p.child_list)
+ idx += 1
+ return num_removed
+
+ def merge_processes(self, p1, p2):
+ """Merges two process' samples."""
+ p1.samples.extend(p2.samples)
+ p1.samples.sort( key = lambda p: p.time )
+ p1time = p1.start_time
+ p2time = p2.start_time
+ p1.start_time = min(p1time, p2time)
+ pendtime = max(p1time + p1.duration, p2time + p2.duration)
+ p1.duration = pendtime - p1.start_time
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/samples.py b/poky/scripts/pybootchartgui/pybootchartgui/samples.py
new file mode 100644
index 000000000..9fc309b3a
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/samples.py
@@ -0,0 +1,178 @@
+# This file is part of pybootchartgui.
+
+# pybootchartgui is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# pybootchartgui is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with pybootchartgui. If not, see <http://www.gnu.org/licenses/>.
+
+
+class DiskStatSample:
+ def __init__(self, time):
+ self.time = time
+ self.diskdata = [0, 0, 0]
+ def add_diskdata(self, new_diskdata):
+ self.diskdata = [ a + b for a, b in zip(self.diskdata, new_diskdata) ]
+
+class CPUSample:
+ def __init__(self, time, user, sys, io = 0.0, swap = 0.0):
+ self.time = time
+ self.user = user
+ self.sys = sys
+ self.io = io
+ self.swap = swap
+
+ @property
+ def cpu(self):
+ return self.user + self.sys
+
+ def __str__(self):
+ return str(self.time) + "\t" + str(self.user) + "\t" + \
+ str(self.sys) + "\t" + str(self.io) + "\t" + str (self.swap)
+
+class MemSample:
+ used_values = ('MemTotal', 'MemFree', 'Buffers', 'Cached', 'SwapTotal', 'SwapFree',)
+
+ def __init__(self, time):
+ self.time = time
+ self.records = {}
+
+ def add_value(self, name, value):
+ if name in MemSample.used_values:
+ self.records[name] = value
+
+ def valid(self):
+ keys = self.records.keys()
+ # discard incomplete samples
+ return [v for v in MemSample.used_values if v not in keys] == []
+
+class DrawMemSample:
+ """
+ Condensed version of a MemSample with exactly the values used by the drawing code.
+ Initialized either from a valid MemSample or
+ a tuple/list of buffer/used/cached/swap values.
+ """
+ def __init__(self, mem_sample):
+ self.time = mem_sample.time
+ if isinstance(mem_sample, MemSample):
+ self.buffers = mem_sample.records['MemTotal'] - mem_sample.records['MemFree']
+ self.used = mem_sample.records['MemTotal'] - mem_sample.records['MemFree'] - mem_sample.records['Buffers']
+ self.cached = mem_sample.records['Cached']
+ self.swap = mem_sample.records['SwapTotal'] - mem_sample.records['SwapFree']
+ else:
+ self.buffers, self.used, self.cached, self.swap = mem_sample
+
+class DiskSpaceSample:
+ def __init__(self, time):
+ self.time = time
+ self.records = {}
+
+ def add_value(self, name, value):
+ self.records[name] = value
+
+ def valid(self):
+ return bool(self.records)
+
+class ProcessSample:
+ def __init__(self, time, state, cpu_sample):
+ self.time = time
+ self.state = state
+ self.cpu_sample = cpu_sample
+
+ def __str__(self):
+ return str(self.time) + "\t" + str(self.state) + "\t" + str(self.cpu_sample)
+
+class ProcessStats:
+ def __init__(self, writer, process_map, sample_count, sample_period, start_time, end_time):
+ self.process_map = process_map
+ self.sample_count = sample_count
+ self.sample_period = sample_period
+ self.start_time = start_time
+ self.end_time = end_time
+ writer.info ("%d samples, avg. sample length %f" % (self.sample_count, self.sample_period))
+ writer.info ("process list size: %d" % len (self.process_map.values()))
+
+class Process:
+ def __init__(self, writer, pid, cmd, ppid, start_time):
+ self.writer = writer
+ self.pid = pid
+ self.cmd = cmd
+ self.exe = cmd
+ self.args = []
+ self.ppid = ppid
+ self.start_time = start_time
+ self.duration = 0
+ self.samples = []
+ self.parent = None
+ self.child_list = []
+
+ self.active = None
+ self.last_user_cpu_time = None
+ self.last_sys_cpu_time = None
+
+ self.last_cpu_ns = 0
+ self.last_blkio_delay_ns = 0
+ self.last_swapin_delay_ns = 0
+
+ # split this process' run - triggered by a name change
+ def split(self, writer, pid, cmd, ppid, start_time):
+ split = Process (writer, pid, cmd, ppid, start_time)
+
+ split.last_cpu_ns = self.last_cpu_ns
+ split.last_blkio_delay_ns = self.last_blkio_delay_ns
+ split.last_swapin_delay_ns = self.last_swapin_delay_ns
+
+ return split
+
+ def __str__(self):
+ return " ".join([str(self.pid), self.cmd, str(self.ppid), '[ ' + str(len(self.samples)) + ' samples ]' ])
+
+ def calc_stats(self, samplePeriod):
+ if self.samples:
+ firstSample = self.samples[0]
+ lastSample = self.samples[-1]
+ self.start_time = min(firstSample.time, self.start_time)
+ self.duration = lastSample.time - self.start_time + samplePeriod
+
+ activeCount = sum( [1 for sample in self.samples if sample.cpu_sample and sample.cpu_sample.sys + sample.cpu_sample.user + sample.cpu_sample.io > 0.0] )
+ activeCount = activeCount + sum( [1 for sample in self.samples if sample.state == 'D'] )
+ self.active = (activeCount>2)
+
+ def calc_load(self, userCpu, sysCpu, interval):
+ userCpuLoad = float(userCpu - self.last_user_cpu_time) / interval
+ sysCpuLoad = float(sysCpu - self.last_sys_cpu_time) / interval
+ cpuLoad = userCpuLoad + sysCpuLoad
+ # normalize
+ if cpuLoad > 1.0:
+ userCpuLoad = userCpuLoad / cpuLoad
+ sysCpuLoad = sysCpuLoad / cpuLoad
+ return (userCpuLoad, sysCpuLoad)
+
+ def set_parent(self, processMap):
+ if self.ppid != None:
+ self.parent = processMap.get (self.ppid)
+ if self.parent == None and self.pid // 1000 > 1 and \
+ not (self.ppid == 2000 or self.pid == 2000): # kernel threads: ppid=2
+ self.writer.warn("Missing CONFIG_PROC_EVENTS: no parent for pid '%i' ('%s') with ppid '%i'" \
+ % (self.pid,self.cmd,self.ppid))
+
+ def get_end_time(self):
+ return self.start_time + self.duration
+
+class DiskSample:
+ def __init__(self, time, read, write, util):
+ self.time = time
+ self.read = read
+ self.write = write
+ self.util = util
+ self.tput = read + write
+
+ def __str__(self):
+ return "\t".join([str(self.time), str(self.read), str(self.write), str(self.util)])
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py b/poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py
new file mode 100644
index 000000000..00fb3bf79
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/tests/parser_test.py
@@ -0,0 +1,105 @@
+import sys, os, re, struct, operator, math
+from collections import defaultdict
+import unittest
+
+sys.path.insert(0, os.getcwd())
+
+import pybootchartgui.parsing as parsing
+import pybootchartgui.main as main
+
+debug = False
+
+def floatEq(f1, f2):
+ return math.fabs(f1-f2) < 0.00001
+
+bootchart_dir = os.path.join(os.path.dirname(sys.argv[0]), '../../examples/1/')
+parser = main._mk_options_parser()
+options, args = parser.parse_args(['--q', bootchart_dir])
+writer = main._mk_writer(options)
+
+class TestBCParser(unittest.TestCase):
+
+ def setUp(self):
+ self.name = "My first unittest"
+ self.rootdir = bootchart_dir
+
+ def mk_fname(self,f):
+ return os.path.join(self.rootdir, f)
+
+ def testParseHeader(self):
+ trace = parsing.Trace(writer, args, options)
+ state = parsing.parse_file(writer, trace, self.mk_fname('header'))
+ self.assertEqual(6, len(state.headers))
+ self.assertEqual(2, parsing.get_num_cpus(state.headers))
+
+ def test_parseTimedBlocks(self):
+ trace = parsing.Trace(writer, args, options)
+ state = parsing.parse_file(writer, trace, self.mk_fname('proc_diskstats.log'))
+ self.assertEqual(141, len(state.disk_stats))
+
+ def testParseProcPsLog(self):
+ trace = parsing.Trace(writer, args, options)
+ state = parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log'))
+ samples = state.ps_stats
+ processes = samples.process_map
+ sorted_processes = [processes[k] for k in sorted(processes.keys())]
+
+ ps_data = open(self.mk_fname('extract2.proc_ps.log'))
+ for index, line in enumerate(ps_data):
+ tokens = line.split();
+ process = sorted_processes[index]
+ if debug:
+ print(tokens[0:4])
+ print(process.pid / 1000, process.cmd, process.ppid, len(process.samples))
+ print('-------------------')
+
+ self.assertEqual(tokens[0], str(process.pid // 1000))
+ self.assertEqual(tokens[1], str(process.cmd))
+ self.assertEqual(tokens[2], str(process.ppid // 1000))
+ self.assertEqual(tokens[3], str(len(process.samples)))
+ ps_data.close()
+
+ def testparseProcDiskStatLog(self):
+ trace = parsing.Trace(writer, args, options)
+ state_with_headers = parsing.parse_file(writer, trace, self.mk_fname('header'))
+ state_with_headers.headers['system.cpu'] = 'xxx (2)'
+ samples = parsing.parse_file(writer, state_with_headers, self.mk_fname('proc_diskstats.log')).disk_stats
+ self.assertEqual(141, len(samples))
+
+ diskstats_data = open(self.mk_fname('extract.proc_diskstats.log'))
+ for index, line in enumerate(diskstats_data):
+ tokens = line.split('\t')
+ sample = samples[index]
+ if debug:
+ print(line.rstrip())
+ print(sample)
+ print('-------------------')
+
+ self.assertEqual(tokens[0], str(sample.time))
+ self.assert_(floatEq(float(tokens[1]), sample.read))
+ self.assert_(floatEq(float(tokens[2]), sample.write))
+ self.assert_(floatEq(float(tokens[3]), sample.util))
+ diskstats_data.close()
+
+ def testparseProcStatLog(self):
+ trace = parsing.Trace(writer, args, options)
+ samples = parsing.parse_file(writer, trace, self.mk_fname('proc_stat.log')).cpu_stats
+ self.assertEqual(141, len(samples))
+
+ stat_data = open(self.mk_fname('extract.proc_stat.log'))
+ for index, line in enumerate(stat_data):
+ tokens = line.split('\t')
+ sample = samples[index]
+ if debug:
+ print(line.rstrip())
+ print(sample)
+ print('-------------------')
+ self.assert_(floatEq(float(tokens[0]), sample.time))
+ self.assert_(floatEq(float(tokens[1]), sample.user))
+ self.assert_(floatEq(float(tokens[2]), sample.sys))
+ self.assert_(floatEq(float(tokens[3]), sample.io))
+ stat_data.close()
+
+if __name__ == '__main__':
+ unittest.main()
+
diff --git a/poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py b/poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
new file mode 100644
index 000000000..6f46a1c03
--- /dev/null
+++ b/poky/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
@@ -0,0 +1,92 @@
+import sys
+import os
+import unittest
+
+sys.path.insert(0, os.getcwd())
+
+import pybootchartgui.parsing as parsing
+import pybootchartgui.process_tree as process_tree
+import pybootchartgui.main as main
+
+if sys.version_info >= (3, 0):
+ long = int
+
+class TestProcessTree(unittest.TestCase):
+
+ def setUp(self):
+ self.name = "Process tree unittest"
+ self.rootdir = os.path.join(os.path.dirname(sys.argv[0]), '../../examples/1/')
+
+ parser = main._mk_options_parser()
+ options, args = parser.parse_args(['--q', self.rootdir])
+ writer = main._mk_writer(options)
+ trace = parsing.Trace(writer, args, options)
+
+ parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log'))
+ trace.compile(writer)
+ self.processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, \
+ trace.ps_stats.sample_period, None, options.prune, None, None, False, for_testing = True)
+
+ def mk_fname(self,f):
+ return os.path.join(self.rootdir, f)
+
+ def flatten(self, process_tree):
+ flattened = []
+ for p in process_tree:
+ flattened.append(p)
+ flattened.extend(self.flatten(p.child_list))
+ return flattened
+
+ def checkAgainstJavaExtract(self, filename, process_tree):
+ test_data = open(filename)
+ for expected, actual in zip(test_data, self.flatten(process_tree)):
+ tokens = expected.split('\t')
+ self.assertEqual(int(tokens[0]), actual.pid // 1000)
+ self.assertEqual(tokens[1], actual.cmd)
+ self.assertEqual(long(tokens[2]), 10 * actual.start_time)
+ self.assert_(long(tokens[3]) - 10 * actual.duration < 5, "duration")
+ self.assertEqual(int(tokens[4]), len(actual.child_list))
+ self.assertEqual(int(tokens[5]), len(actual.samples))
+ test_data.close()
+
+ def testBuild(self):
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.1.log'), process_tree)
+
+ def testMergeLogger(self):
+ self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.2.log'), process_tree)
+
+ def testPrune(self):
+ self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
+ self.processtree.prune(self.processtree.process_tree, None)
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.3b.log'), process_tree)
+
+ def testMergeExploders(self):
+ self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
+ self.processtree.prune(self.processtree.process_tree, None)
+ self.processtree.merge_exploders(self.processtree.process_tree, set(['hwup']))
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.3c.log'), process_tree)
+
+ def testMergeSiblings(self):
+ self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
+ self.processtree.prune(self.processtree.process_tree, None)
+ self.processtree.merge_exploders(self.processtree.process_tree, set(['hwup']))
+ self.processtree.merge_siblings(self.processtree.process_tree)
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.3d.log'), process_tree)
+
+ def testMergeRuns(self):
+ self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
+ self.processtree.prune(self.processtree.process_tree, None)
+ self.processtree.merge_exploders(self.processtree.process_tree, set(['hwup']))
+ self.processtree.merge_siblings(self.processtree.process_tree)
+ self.processtree.merge_runs(self.processtree.process_tree)
+ process_tree = self.processtree.process_tree
+ self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.3e.log'), process_tree)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/poky/scripts/pythondeps b/poky/scripts/pythondeps
new file mode 100755
index 000000000..590b9769e
--- /dev/null
+++ b/poky/scripts/pythondeps
@@ -0,0 +1,250 @@
+#!/usr/bin/env python3
+#
+# Determine dependencies of python scripts or available python modules in a search path.
+#
+# Given the -d argument and a filename/filenames, returns the modules imported by those files.
+# Given the -d argument and a directory/directories, recurses to find all
+# python packages and modules, returns the modules imported by these.
+# Given the -p argument and a path or paths, scans that path for available python modules/packages.
+
+import argparse
+import ast
+import imp
+import logging
+import os.path
+import sys
+
+
+logger = logging.getLogger('pythondeps')
+
+suffixes = []
+for triple in imp.get_suffixes():
+ suffixes.append(triple[0])
+
+
+class PythonDepError(Exception):
+ pass
+
+
+class DependError(PythonDepError):
+ def __init__(self, path, error):
+ self.path = path
+ self.error = error
+ PythonDepError.__init__(self, error)
+
+ def __str__(self):
+ return "Failure determining dependencies of {}: {}".format(self.path, self.error)
+
+
+class ImportVisitor(ast.NodeVisitor):
+ def __init__(self):
+ self.imports = set()
+ self.importsfrom = []
+
+ def visit_Import(self, node):
+ for alias in node.names:
+ self.imports.add(alias.name)
+
+ def visit_ImportFrom(self, node):
+ self.importsfrom.append((node.module, [a.name for a in node.names], node.level))
+
+
+def walk_up(path):
+ while path:
+ yield path
+ path, _, _ = path.rpartition(os.sep)
+
+
+def get_provides(path):
+ path = os.path.realpath(path)
+
+ def get_fn_name(fn):
+ for suffix in suffixes:
+ if fn.endswith(suffix):
+ return fn[:-len(suffix)]
+
+ isdir = os.path.isdir(path)
+ if isdir:
+ pkg_path = path
+ walk_path = path
+ else:
+ pkg_path = get_fn_name(path)
+ if pkg_path is None:
+ return
+ walk_path = os.path.dirname(path)
+
+ for curpath in walk_up(walk_path):
+ if not os.path.exists(os.path.join(curpath, '__init__.py')):
+ libdir = curpath
+ break
+ else:
+ libdir = ''
+
+ package_relpath = pkg_path[len(libdir)+1:]
+ package = '.'.join(package_relpath.split(os.sep))
+ if not isdir:
+ yield package, path
+ else:
+ if os.path.exists(os.path.join(path, '__init__.py')):
+ yield package, path
+
+ for dirpath, dirnames, filenames in os.walk(path):
+ relpath = dirpath[len(path)+1:]
+ if relpath:
+ if '__init__.py' not in filenames:
+ dirnames[:] = []
+ continue
+ else:
+ context = '.'.join(relpath.split(os.sep))
+ if package:
+ context = package + '.' + context
+ yield context, dirpath
+ else:
+ context = package
+
+ for fn in filenames:
+ adjusted_fn = get_fn_name(fn)
+ if not adjusted_fn or adjusted_fn == '__init__':
+ continue
+
+ fullfn = os.path.join(dirpath, fn)
+ if context:
+ yield context + '.' + adjusted_fn, fullfn
+ else:
+ yield adjusted_fn, fullfn
+
+
+def get_code_depends(code_string, path=None, provide=None, ispkg=False):
+ try:
+ code = ast.parse(code_string, path)
+ except TypeError as exc:
+ raise DependError(path, exc)
+ except SyntaxError as exc:
+ raise DependError(path, exc)
+
+ visitor = ImportVisitor()
+ visitor.visit(code)
+ for builtin_module in sys.builtin_module_names:
+ if builtin_module in visitor.imports:
+ visitor.imports.remove(builtin_module)
+
+ if provide:
+ provide_elements = provide.split('.')
+ if ispkg:
+ provide_elements.append("__self__")
+ context = '.'.join(provide_elements[:-1])
+ package_path = os.path.dirname(path)
+ else:
+ context = None
+ package_path = None
+
+ levelzero_importsfrom = (module for module, names, level in visitor.importsfrom
+ if level == 0)
+ for module in visitor.imports | set(levelzero_importsfrom):
+ if context and path:
+ module_basepath = os.path.join(package_path, module.replace('.', '/'))
+ if os.path.exists(module_basepath):
+ # Implicit relative import
+ yield context + '.' + module, path
+ continue
+
+ for suffix in suffixes:
+ if os.path.exists(module_basepath + suffix):
+ # Implicit relative import
+ yield context + '.' + module, path
+ break
+ else:
+ yield module, path
+ else:
+ yield module, path
+
+ for module, names, level in visitor.importsfrom:
+ if level == 0:
+ continue
+ elif not provide:
+ raise DependError("Error: ImportFrom non-zero level outside of a package: {0}".format((module, names, level)), path)
+ elif level > len(provide_elements):
+ raise DependError("Error: ImportFrom level exceeds package depth: {0}".format((module, names, level)), path)
+ else:
+ context = '.'.join(provide_elements[:-level])
+ if module:
+ if context:
+ yield context + '.' + module, path
+ else:
+ yield module, path
+
+
+def get_file_depends(path):
+ try:
+ code_string = open(path, 'r').read()
+ except (OSError, IOError) as exc:
+ raise DependError(path, exc)
+
+ return get_code_depends(code_string, path)
+
+
+def get_depends_recursive(directory):
+ directory = os.path.realpath(directory)
+
+ provides = dict((v, k) for k, v in get_provides(directory))
+ for filename, provide in provides.items():
+ if os.path.isdir(filename):
+ filename = os.path.join(filename, '__init__.py')
+ ispkg = True
+ elif not filename.endswith('.py'):
+ continue
+ else:
+ ispkg = False
+
+ with open(filename, 'r') as f:
+ source = f.read()
+
+ depends = get_code_depends(source, filename, provide, ispkg)
+ for depend, by in depends:
+ yield depend, by
+
+
+def get_depends(path):
+ if os.path.isdir(path):
+ return get_depends_recursive(path)
+ else:
+ return get_file_depends(path)
+
+
+def main():
+ logging.basicConfig()
+
+ parser = argparse.ArgumentParser(description='Determine dependencies and provided packages for python scripts/modules')
+ parser.add_argument('path', nargs='+', help='full path to content to be processed')
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('-p', '--provides', action='store_true',
+ help='given a path, display the provided python modules')
+ group.add_argument('-d', '--depends', action='store_true',
+ help='given a filename, display the imported python modules')
+
+ args = parser.parse_args()
+ if args.provides:
+ modules = set()
+ for path in args.path:
+ for provide, fn in get_provides(path):
+ modules.add(provide)
+
+ for module in sorted(modules):
+ print(module)
+ elif args.depends:
+ for path in args.path:
+ try:
+ modules = get_depends(path)
+ except PythonDepError as exc:
+ logger.error(str(exc))
+ sys.exit(1)
+
+ for module, imp_by in modules:
+ print("{}\t{}".format(module, imp_by))
+ else:
+ parser.print_help()
+ sys.exit(2)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/poky/scripts/recipetool b/poky/scripts/recipetool
new file mode 100755
index 000000000..3a3c9b744
--- /dev/null
+++ b/poky/scripts/recipetool
@@ -0,0 +1,126 @@
+#!/usr/bin/env python3
+
+# Recipe creation tool
+#
+# Copyright (C) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+import os
+import argparse
+import glob
+import logging
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import argparse_oe
+logger = scriptutils.logger_create('recipetool')
+
+plugins = []
+
+def tinfoil_init(parserecipes):
+ import bb.tinfoil
+ import logging
+ tinfoil = bb.tinfoil.Tinfoil(tracking=True)
+ tinfoil.logger.setLevel(logger.getEffectiveLevel())
+ tinfoil.prepare(not parserecipes)
+ return tinfoil
+
+def main():
+
+ if not os.environ.get('BUILDDIR', ''):
+ logger.error("This script can only be run after initialising the build environment (e.g. by using oe-init-build-env)")
+ sys.exit(1)
+
+ parser = argparse_oe.ArgumentParser(description="OpenEmbedded recipe tool",
+ add_help=False,
+ epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
+ parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
+ parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
+
+ global_args, unparsed_args = parser.parse_known_args()
+
+ # Help is added here rather than via add_help=True, as we don't want it to
+ # be handled by parse_known_args()
+ parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
+ help='show this help message and exit')
+ subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
+
+ if global_args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif global_args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ import scriptpath
+ bitbakepath = scriptpath.add_bitbake_lib_path()
+ if not bitbakepath:
+ logger.error("Unable to find bitbake by searching parent directory of this script or PATH")
+ sys.exit(1)
+ logger.debug('Found bitbake path: %s' % bitbakepath)
+ scriptpath.add_oe_lib_path()
+
+ scriptutils.logger_setup_color(logger, global_args.color)
+
+ tinfoil = tinfoil_init(False)
+ try:
+ for path in (tinfoil.config_data.getVar('BBPATH').split(':')
+ + [scripts_path]):
+ pluginpath = os.path.join(path, 'lib', 'recipetool')
+ scriptutils.load_plugins(logger, plugins, pluginpath)
+
+ registered = False
+ for plugin in plugins:
+ if hasattr(plugin, 'register_commands'):
+ registered = True
+ plugin.register_commands(subparsers)
+ elif hasattr(plugin, 'register_command'):
+ # Legacy function name
+ registered = True
+ plugin.register_command(subparsers)
+ if hasattr(plugin, 'tinfoil_init'):
+ plugin.tinfoil_init(tinfoil)
+
+ if not registered:
+ logger.error("No commands registered - missing plugins?")
+ sys.exit(1)
+
+ args = parser.parse_args(unparsed_args, namespace=global_args)
+
+ try:
+ if getattr(args, 'parserecipes', False):
+ tinfoil.config_data.disableTracking()
+ tinfoil.parseRecipes()
+ tinfoil.config_data.enableTracking()
+ ret = args.func(args)
+ except bb.BBHandledException:
+ ret = 1
+ finally:
+ tinfoil.shutdown()
+
+ return ret
+
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/relocate_sdk.py b/poky/scripts/relocate_sdk.py
new file mode 100755
index 000000000..c752fa2c6
--- /dev/null
+++ b/poky/scripts/relocate_sdk.py
@@ -0,0 +1,266 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# DESCRIPTION
+# This script is called by the SDK installer script. It replaces the dynamic
+# loader path in all binaries and also fixes the SYSDIR paths/lengths and the
+# location of ld.so.cache in the dynamic loader binary
+#
+# AUTHORS
+# Laurentiu Palcu <laurentiu.palcu@intel.com>
+#
+
+import struct
+import sys
+import stat
+import os
+import re
+import errno
+
+if sys.version < '3':
+ def b(x):
+ return x
+else:
+ def b(x):
+ return x.encode(sys.getfilesystemencoding())
+
+old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
+
+def get_arch():
+ f.seek(0)
+ e_ident =f.read(16)
+ ei_mag0,ei_mag1_3,ei_class = struct.unpack("<B3sB11x", e_ident)
+
+ if (ei_mag0 != 0x7f and ei_mag1_3 != "ELF") or ei_class == 0:
+ return 0
+
+ if ei_class == 1:
+ return 32
+ elif ei_class == 2:
+ return 64
+
+def parse_elf_header():
+ global e_type, e_machine, e_version, e_entry, e_phoff, e_shoff, e_flags,\
+ e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx
+
+ f.seek(0)
+ elf_header = f.read(64)
+
+ if arch == 32:
+ # 32bit
+ hdr_fmt = "<HHILLLIHHHHHH"
+ hdr_size = 52
+ else:
+ # 64bit
+ hdr_fmt = "<HHIQQQIHHHHHH"
+ hdr_size = 64
+
+ e_type, e_machine, e_version, e_entry, e_phoff, e_shoff, e_flags,\
+ e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx =\
+ struct.unpack(hdr_fmt, elf_header[16:hdr_size])
+
+def change_interpreter(elf_file_name):
+ if arch == 32:
+ ph_fmt = "<IIIIIIII"
+ else:
+ ph_fmt = "<IIQQQQQQ"
+
+ """ look for PT_INTERP section """
+ for i in range(0,e_phnum):
+ f.seek(e_phoff + i * e_phentsize)
+ ph_hdr = f.read(e_phentsize)
+ if arch == 32:
+ # 32bit
+ p_type, p_offset, p_vaddr, p_paddr, p_filesz,\
+ p_memsz, p_flags, p_align = struct.unpack(ph_fmt, ph_hdr)
+ else:
+ # 64bit
+ p_type, p_flags, p_offset, p_vaddr, p_paddr, \
+ p_filesz, p_memsz, p_align = struct.unpack(ph_fmt, ph_hdr)
+
+ """ change interpreter """
+ if p_type == 3:
+ # PT_INTERP section
+ f.seek(p_offset)
+ # External SDKs with mixed pre-compiled binaries should not get
+ # relocated so look for some variant of /lib
+ fname = f.read(11)
+ if fname.startswith(b("/lib/")) or fname.startswith(b("/lib64/")) or \
+ fname.startswith(b("/lib32/")) or fname.startswith(b("/usr/lib32/")) or \
+ fname.startswith(b("/usr/lib32/")) or fname.startswith(b("/usr/lib64/")):
+ break
+ if p_filesz == 0:
+ break
+ if (len(new_dl_path) >= p_filesz):
+ print("ERROR: could not relocate %s, interp size = %i and %i is needed." \
+ % (elf_file_name, p_memsz, len(new_dl_path) + 1))
+ break
+ dl_path = new_dl_path + b("\0") * (p_filesz - len(new_dl_path))
+ f.seek(p_offset)
+ f.write(dl_path)
+ break
+
+def change_dl_sysdirs(elf_file_name):
+ if arch == 32:
+ sh_fmt = "<IIIIIIIIII"
+ else:
+ sh_fmt = "<IIQQQQIIQQ"
+
+ """ read section string table """
+ f.seek(e_shoff + e_shstrndx * e_shentsize)
+ sh_hdr = f.read(e_shentsize)
+ if arch == 32:
+ sh_offset, sh_size = struct.unpack("<16xII16x", sh_hdr)
+ else:
+ sh_offset, sh_size = struct.unpack("<24xQQ24x", sh_hdr)
+
+ f.seek(sh_offset)
+ sh_strtab = f.read(sh_size)
+
+ sysdirs = sysdirs_len = ""
+
+ """ change ld.so.cache path and default libs path for dynamic loader """
+ for i in range(0,e_shnum):
+ f.seek(e_shoff + i * e_shentsize)
+ sh_hdr = f.read(e_shentsize)
+
+ sh_name, sh_type, sh_flags, sh_addr, sh_offset, sh_size, sh_link,\
+ sh_info, sh_addralign, sh_entsize = struct.unpack(sh_fmt, sh_hdr)
+
+ name = sh_strtab[sh_name:sh_strtab.find(b("\0"), sh_name)]
+
+ """ look only into SHT_PROGBITS sections """
+ if sh_type == 1:
+ f.seek(sh_offset)
+ """ default library paths cannot be changed on the fly because """
+ """ the string lengths have to be changed too. """
+ if name == b(".sysdirs"):
+ sysdirs = f.read(sh_size)
+ sysdirs_off = sh_offset
+ sysdirs_sect_size = sh_size
+ elif name == b(".sysdirslen"):
+ sysdirslen = f.read(sh_size)
+ sysdirslen_off = sh_offset
+ elif name == b(".ldsocache"):
+ ldsocache_path = f.read(sh_size)
+ new_ldsocache_path = old_prefix.sub(new_prefix, ldsocache_path)
+ new_ldsocache_path = new_ldsocache_path.rstrip(b("\0"))
+ if (len(new_ldsocache_path) >= sh_size):
+ print("ERROR: could not relocate %s, .ldsocache section size = %i and %i is needed." \
+ % (elf_file_name, sh_size, len(new_ldsocache_path)))
+ sys.exit(-1)
+ # pad with zeros
+ new_ldsocache_path += b("\0") * (sh_size - len(new_ldsocache_path))
+ # write it back
+ f.seek(sh_offset)
+ f.write(new_ldsocache_path)
+ elif name == b(".gccrelocprefix"):
+ offset = 0
+ while (offset + 4096) <= sh_size:
+ path = f.read(4096)
+ new_path = old_prefix.sub(new_prefix, path)
+ new_path = new_path.rstrip(b("\0"))
+ if (len(new_path) >= 4096):
+ print("ERROR: could not relocate %s, max path size = 4096 and %i is needed." \
+ % (elf_file_name, len(new_path)))
+ sys.exit(-1)
+ # pad with zeros
+ new_path += b("\0") * (4096 - len(new_path))
+ #print "Changing %s to %s at %s" % (str(path), str(new_path), str(offset))
+ # write it back
+ f.seek(sh_offset + offset)
+ f.write(new_path)
+ offset = offset + 4096
+ if sysdirs != "" and sysdirslen != "":
+ paths = sysdirs.split(b("\0"))
+ sysdirs = b("")
+ sysdirslen = b("")
+ for path in paths:
+ """ exit the loop when we encounter first empty string """
+ if path == b(""):
+ break
+
+ new_path = old_prefix.sub(new_prefix, path)
+ sysdirs += new_path + b("\0")
+
+ if arch == 32:
+ sysdirslen += struct.pack("<L", len(new_path))
+ else:
+ sysdirslen += struct.pack("<Q", len(new_path))
+
+ """ pad with zeros """
+ sysdirs += b("\0") * (sysdirs_sect_size - len(sysdirs))
+
+ """ write the sections back """
+ f.seek(sysdirs_off)
+ f.write(sysdirs)
+ f.seek(sysdirslen_off)
+ f.write(sysdirslen)
+
+# MAIN
+if len(sys.argv) < 4:
+ sys.exit(-1)
+
+# In python > 3, strings may also contain Unicode characters. So, convert
+# them to bytes
+if sys.version_info < (3,):
+ new_prefix = sys.argv[1]
+ new_dl_path = sys.argv[2]
+else:
+ new_prefix = sys.argv[1].encode()
+ new_dl_path = sys.argv[2].encode()
+
+executables_list = sys.argv[3:]
+
+for e in executables_list:
+ perms = os.stat(e)[stat.ST_MODE]
+ if os.access(e, os.W_OK|os.R_OK):
+ perms = None
+ else:
+ os.chmod(e, perms|stat.S_IRWXU)
+
+ try:
+ f = open(e, "r+b")
+ except IOError:
+ exctype, ioex = sys.exc_info()[:2]
+ if ioex.errno == errno.ETXTBSY:
+ print("Could not open %s. File used by another process.\nPlease "\
+ "make sure you exit all processes that might use any SDK "\
+ "binaries." % e)
+ else:
+ print("Could not open %s: %s(%d)" % (e, ioex.strerror, ioex.errno))
+ sys.exit(-1)
+
+ # Save old size and do a size check at the end. Just a safety measure.
+ old_size = os.path.getsize(e)
+ if old_size >= 64:
+ arch = get_arch()
+ if arch:
+ parse_elf_header()
+ change_interpreter(e)
+ change_dl_sysdirs(e)
+
+ """ change permissions back """
+ if perms:
+ os.chmod(e, perms)
+
+ f.close()
+
+ if old_size != os.path.getsize(e):
+ print("New file size for %s is different. Looks like a relocation error!", e)
+ sys.exit(-1)
+
diff --git a/poky/scripts/rootfs_rpm-extract-postinst.awk b/poky/scripts/rootfs_rpm-extract-postinst.awk
new file mode 100644
index 000000000..8f2836b32
--- /dev/null
+++ b/poky/scripts/rootfs_rpm-extract-postinst.awk
@@ -0,0 +1,11 @@
+/Name:.*/ {
+ package = substr($0, 7)
+ next
+}
+/postinstall.*scriptlet .*/ {
+ next
+}
+{
+ print $0 >> ENVIRON["D"] "/etc/rpm-postinsts/" package ".sh"
+}
+
diff --git a/poky/scripts/rpm2cpio.sh b/poky/scripts/rpm2cpio.sh
new file mode 100755
index 000000000..cf23472ba
--- /dev/null
+++ b/poky/scripts/rpm2cpio.sh
@@ -0,0 +1,55 @@
+#!/bin/sh -efu
+
+# This file comes from rpm 4.x distribution
+
+fatal() {
+ echo "$*" >&2
+ exit 1
+}
+
+pkg="$1"
+[ -n "$pkg" -a -e "$pkg" ] ||
+ fatal "No package supplied"
+
+_dd() {
+ local o="$1"; shift
+ dd if="$pkg" skip="$o" iflag=skip_bytes status=none $*
+}
+
+calcsize() {
+ offset=$(($1 + 8))
+
+ local i b b0 b1 b2 b3 b4 b5 b6 b7
+
+ i=0
+ while [ $i -lt 8 ]; do
+ b="$(_dd $(($offset + $i)) bs=1 count=1)"
+ [ -z "$b" ] &&
+ b="0" ||
+ b="$(exec printf '%u\n' "'$b")"
+ eval "b$i=\$b"
+ i=$(($i + 1))
+ done
+
+ rsize=$((8 + ((($b0 << 24) + ($b1 << 16) + ($b2 << 8) + $b3) << 4) + ($b4 << 24) + ($b5 << 16) + ($b6 << 8) + $b7))
+ offset=$(($offset + $rsize))
+}
+
+case "$(_dd 0 bs=8 count=1)" in
+ "$(printf '\355\253\356\333')"*) ;; # '\xed\xab\xee\xdb'
+ *) fatal "File doesn't look like rpm: $pkg" ;;
+esac
+
+calcsize 96
+sigsize=$rsize
+
+calcsize $(($offset + (8 - ($sigsize % 8)) % 8))
+hdrsize=$rsize
+
+case "$(_dd $offset bs=3 count=1)" in
+ "$(printf '\102\132')"*) _dd $offset | bunzip2 ;; # '\x42\x5a'
+ "$(printf '\037\213')"*) _dd $offset | gunzip ;; # '\x1f\x8b'
+ "$(printf '\375\067')"*) _dd $offset | xzcat ;; # '\xfd\x37'
+ "$(printf '\135\000')"*) _dd $offset | unlzma ;; # '\x5d\x00'
+ *) fatal "Unrecognized rpm file: $pkg" ;;
+esac
diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu
new file mode 100755
index 000000000..d99849406
--- /dev/null
+++ b/poky/scripts/runqemu
@@ -0,0 +1,1307 @@
+#!/usr/bin/env python3
+
+# Handle running OE images standalone with QEMU
+#
+# Copyright (C) 2006-2011 Linux Foundation
+# Copyright (c) 2016 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import os
+import sys
+import logging
+import subprocess
+import re
+import fcntl
+import shutil
+import glob
+import configparser
+
+class RunQemuError(Exception):
+ """Custom exception to raise on known errors."""
+ pass
+
+class OEPathError(RunQemuError):
+ """Custom Exception to give better guidance on missing binaries"""
+ def __init__(self, message):
+ super().__init__("In order for this script to dynamically infer paths\n \
+kernels or filesystem images, you either need bitbake in your PATH\n \
+or to source oe-init-build-env before running this script.\n\n \
+Dynamic path inference can be avoided by passing a *.qemuboot.conf to\n \
+runqemu, i.e. `runqemu /path/to/my-image-name.qemuboot.conf`\n\n %s" % message)
+
+
+def create_logger():
+ logger = logging.getLogger('runqemu')
+ logger.setLevel(logging.INFO)
+
+ # create console handler and set level to debug
+ ch = logging.StreamHandler()
+ ch.setLevel(logging.DEBUG)
+
+ # create formatter
+ formatter = logging.Formatter('%(name)s - %(levelname)s - %(message)s')
+
+ # add formatter to ch
+ ch.setFormatter(formatter)
+
+ # add ch to logger
+ logger.addHandler(ch)
+
+ return logger
+
+logger = create_logger()
+
+def print_usage():
+ print("""
+Usage: you can run this script with any valid combination
+of the following environment variables (in any order):
+ KERNEL - the kernel image file to use
+ ROOTFS - the rootfs image file or nfsroot directory to use
+ DEVICE_TREE - the device tree blob to use
+ MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified)
+ Simplified QEMU command-line options can be passed with:
+ nographic - disable video console
+ serial - enable a serial console on /dev/ttyS0
+ slirp - enable user networking, no root privileges is required
+ kvm - enable KVM when running x86/x86_64 (VT-capable CPU required)
+ kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required)
+ publicvnc - enable a VNC server open to all hosts
+ audio - enable audio
+ [*/]ovmf* - OVMF firmware file or base name for booting with UEFI
+ tcpserial=<port> - specify tcp serial port number
+ biosdir=<dir> - specify custom bios dir
+ biosfilename=<filename> - specify bios filename
+ qemuparams=<xyz> - specify custom parameters to QEMU
+ bootparams=<xyz> - specify custom kernel parameters during boot
+ help, -h, --help: print this text
+ -d, --debug: Enable debug output
+ -q, --quite: Hide most output except error messages
+
+Examples:
+ runqemu
+ runqemu qemuarm
+ runqemu tmp/deploy/images/qemuarm
+ runqemu tmp/deploy/images/qemux86/<qemuboot.conf>
+ runqemu qemux86-64 core-image-sato ext4
+ runqemu qemux86-64 wic-image-minimal wic
+ runqemu path/to/bzImage-qemux86.bin path/to/nfsrootdir/ serial
+ runqemu qemux86 iso/hddimg/wic.vmdk/wic.qcow2/wic.vdi/ramfs/cpio.gz...
+ runqemu qemux86 qemuparams="-m 256"
+ runqemu qemux86 bootparams="psplash=false"
+ runqemu path/to/<image>-<machine>.wic
+ runqemu path/to/<image>-<machine>.wic.vmdk
+""")
+
+def check_tun():
+ """Check /dev/net/tun"""
+ dev_tun = '/dev/net/tun'
+ if not os.path.exists(dev_tun):
+ raise RunQemuError("TUN control device %s is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)" % dev_tun)
+
+ if not os.access(dev_tun, os.W_OK):
+ raise RunQemuError("TUN control device %s is not writable, please fix (e.g. sudo chmod 666 %s)" % (dev_tun, dev_tun))
+
+def check_libgl(qemu_bin):
+ cmd = 'ldd %s' % qemu_bin
+ logger.debug('Running %s...' % cmd)
+ need_gl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ if re.search('libGLU', need_gl):
+ # We can't run without a libGL.so
+ libgl = False
+ check_files = (('/usr/lib/libGL.so', '/usr/lib/libGLU.so'), \
+ ('/usr/lib64/libGL.so', '/usr/lib64/libGLU.so'), \
+ ('/usr/lib/*-linux-gnu/libGL.so', '/usr/lib/*-linux-gnu/libGLU.so'))
+
+ for (f1, f2) in check_files:
+ if re.search('\*', f1):
+ for g1 in glob.glob(f1):
+ if libgl:
+ break
+ if os.path.exists(g1):
+ for g2 in glob.glob(f2):
+ if os.path.exists(g2):
+ libgl = True
+ break
+ if libgl:
+ break
+ else:
+ if os.path.exists(f1) and os.path.exists(f2):
+ libgl = True
+ break
+ if not libgl:
+ logger.error("You need libGL.so and libGLU.so to exist in your library path to run the QEMU emulator.")
+ logger.error("Ubuntu package names are: libgl1-mesa-dev and libglu1-mesa-dev.")
+ logger.error("Fedora package names are: mesa-libGL-devel mesa-libGLU-devel.")
+ raise RunQemuError('%s requires libGLU, but not found' % qemu_bin)
+
+def get_first_file(cmds):
+ """Return first file found in wildcard cmds"""
+ for cmd in cmds:
+ all_files = glob.glob(cmd)
+ if all_files:
+ for f in all_files:
+ if not os.path.isdir(f):
+ return f
+ return ''
+
+def check_free_port(host, port):
+ """ Check whether the port is free or not """
+ import socket
+ from contextlib import closing
+
+ with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
+ if sock.connect_ex((host, port)) == 0:
+ # Port is open, so not free
+ return False
+ else:
+ # Port is not open, so free
+ return True
+
+class BaseConfig(object):
+ def __init__(self):
+ # The self.d saved vars from self.set(), part of them are from qemuboot.conf
+ self.d = {'QB_KERNEL_ROOT': '/dev/vda'}
+
+ # Supported env vars, add it here if a var can be got from env,
+ # and don't use os.getenv in the code.
+ self.env_vars = ('MACHINE',
+ 'ROOTFS',
+ 'KERNEL',
+ 'DEVICE_TREE',
+ 'DEPLOY_DIR_IMAGE',
+ 'OE_TMPDIR',
+ 'OECORE_NATIVE_SYSROOT',
+ )
+
+ self.qemu_opt = ''
+ self.qemu_opt_script = ''
+ self.clean_nfs_dir = False
+ self.nfs_server = ''
+ self.rootfs = ''
+ # File name(s) of a OVMF firmware file or variable store,
+ # to be added with -drive if=pflash.
+ # Found in the same places as the rootfs, with or without one of
+ # these suffices: qcow2, bin.
+ # Setting one also adds "-vga std" because that is all that
+ # OVMF supports.
+ self.ovmf_bios = []
+ self.qemuboot = ''
+ self.qbconfload = False
+ self.kernel = ''
+ self.kernel_cmdline = ''
+ self.kernel_cmdline_script = ''
+ self.bootparams = ''
+ self.dtb = ''
+ self.fstype = ''
+ self.kvm_enabled = False
+ self.vhost_enabled = False
+ self.slirp_enabled = False
+ self.nfs_instance = 0
+ self.nfs_running = False
+ self.serialstdio = False
+ self.cleantap = False
+ self.saved_stty = ''
+ self.audio_enabled = False
+ self.tcpserial_portnum = ''
+ self.custombiosdir = ''
+ self.lock = ''
+ self.lock_descriptor = ''
+ self.bitbake_e = ''
+ self.snapshot = False
+ self.fstypes = ('ext2', 'ext3', 'ext4', 'jffs2', 'nfs', 'btrfs',
+ 'cpio.gz', 'cpio', 'ramfs', 'tar.bz2', 'tar.gz')
+ self.vmtypes = ('hddimg', 'hdddirect', 'wic', 'wic.vmdk',
+ 'wic.qcow2', 'wic.vdi', 'iso')
+ self.network_device = "-device e1000,netdev=net0,mac=@MAC@"
+ # Use different mac section for tap and slirp to avoid
+ # conflicts, e.g., when one is running with tap, the other is
+ # running with slirp.
+ # The last section is dynamic, which is for avoiding conflicts,
+ # when multiple qemus are running, e.g., when multiple tap or
+ # slirp qemus are running.
+ self.mac_tap = "52:54:00:12:34:"
+ self.mac_slirp = "52:54:00:12:35:"
+
+ def acquire_lock(self, error=True):
+ logger.debug("Acquiring lockfile %s..." % self.lock)
+ try:
+ self.lock_descriptor = open(self.lock, 'w')
+ fcntl.flock(self.lock_descriptor, fcntl.LOCK_EX|fcntl.LOCK_NB)
+ except Exception as e:
+ msg = "Acquiring lockfile %s failed: %s" % (self.lock, e)
+ if error:
+ logger.error(msg)
+ else:
+ logger.info(msg)
+ if self.lock_descriptor:
+ self.lock_descriptor.close()
+ return False
+ return True
+
+ def release_lock(self):
+ fcntl.flock(self.lock_descriptor, fcntl.LOCK_UN)
+ self.lock_descriptor.close()
+ os.remove(self.lock)
+
+ def get(self, key):
+ if key in self.d:
+ return self.d.get(key)
+ elif os.getenv(key):
+ return os.getenv(key)
+ else:
+ return ''
+
+ def set(self, key, value):
+ self.d[key] = value
+
+ def is_deploy_dir_image(self, p):
+ if os.path.isdir(p):
+ if not re.search('.qemuboot.conf$', '\n'.join(os.listdir(p)), re.M):
+ logger.debug("Can't find required *.qemuboot.conf in %s" % p)
+ return False
+ if not any(map(lambda name: '-image-' in name, os.listdir(p))):
+ logger.debug("Can't find *-image-* in %s" % p)
+ return False
+ return True
+ else:
+ return False
+
+ def check_arg_fstype(self, fst):
+ """Check and set FSTYPE"""
+ if fst not in self.fstypes + self.vmtypes:
+ logger.warn("Maybe unsupported FSTYPE: %s" % fst)
+ if not self.fstype or self.fstype == fst:
+ if fst == 'ramfs':
+ fst = 'cpio.gz'
+ if fst in ('tar.bz2', 'tar.gz'):
+ fst = 'nfs'
+ self.fstype = fst
+ else:
+ raise RunQemuError("Conflicting: FSTYPE %s and %s" % (self.fstype, fst))
+
+ def set_machine_deploy_dir(self, machine, deploy_dir_image):
+ """Set MACHINE and DEPLOY_DIR_IMAGE"""
+ logger.debug('MACHINE: %s' % machine)
+ self.set("MACHINE", machine)
+ logger.debug('DEPLOY_DIR_IMAGE: %s' % deploy_dir_image)
+ self.set("DEPLOY_DIR_IMAGE", deploy_dir_image)
+
+ def check_arg_nfs(self, p):
+ if os.path.isdir(p):
+ self.rootfs = p
+ else:
+ m = re.match('(.*):(.*)', p)
+ self.nfs_server = m.group(1)
+ self.rootfs = m.group(2)
+ self.check_arg_fstype('nfs')
+
+ def check_arg_path(self, p):
+ """
+ - Check whether it is <image>.qemuboot.conf or contains <image>.qemuboot.conf
+ - Check whether is a kernel file
+ - Check whether is a image file
+ - Check whether it is a nfs dir
+ - Check whether it is a OVMF flash file
+ """
+ if p.endswith('.qemuboot.conf'):
+ self.qemuboot = p
+ self.qbconfload = True
+ elif re.search('\.bin$', p) or re.search('bzImage', p) or \
+ re.search('zImage', p) or re.search('vmlinux', p) or \
+ re.search('fitImage', p) or re.search('uImage', p):
+ self.kernel = p
+ elif os.path.exists(p) and (not os.path.isdir(p)) and '-image-' in os.path.basename(p):
+ self.rootfs = p
+ # Check filename against self.fstypes can hanlde <file>.cpio.gz,
+ # otherwise, its type would be "gz", which is incorrect.
+ fst = ""
+ for t in self.fstypes:
+ if p.endswith(t):
+ fst = t
+ break
+ if not fst:
+ m = re.search('.*\.(.*)$', self.rootfs)
+ if m:
+ fst = m.group(1)
+ if fst:
+ self.check_arg_fstype(fst)
+ qb = re.sub('\.' + fst + "$", '', self.rootfs)
+ qb = '%s%s' % (re.sub('\.rootfs$', '', qb), '.qemuboot.conf')
+ if os.path.exists(qb):
+ self.qemuboot = qb
+ self.qbconfload = True
+ else:
+ logger.warn("%s doesn't exist" % qb)
+ else:
+ raise RunQemuError("Can't find FSTYPE from: %s" % p)
+
+ elif os.path.isdir(p) or re.search(':', p) and re.search('/', p):
+ if self.is_deploy_dir_image(p):
+ logger.debug('DEPLOY_DIR_IMAGE: %s' % p)
+ self.set("DEPLOY_DIR_IMAGE", p)
+ else:
+ logger.debug("Assuming %s is an nfs rootfs" % p)
+ self.check_arg_nfs(p)
+ elif os.path.basename(p).startswith('ovmf'):
+ self.ovmf_bios.append(p)
+ else:
+ raise RunQemuError("Unknown path arg %s" % p)
+
+ def check_arg_machine(self, arg):
+ """Check whether it is a machine"""
+ if self.get('MACHINE') == arg:
+ return
+ elif self.get('MACHINE') and self.get('MACHINE') != arg:
+ raise RunQemuError("Maybe conflicted MACHINE: %s vs %s" % (self.get('MACHINE'), arg))
+ elif re.search('/', arg):
+ raise RunQemuError("Unknown arg: %s" % arg)
+
+ logger.debug('Assuming MACHINE = %s' % arg)
+
+ # if we're running under testimage, or similarly as a child
+ # of an existing bitbake invocation, we can't invoke bitbake
+ # to validate the MACHINE setting and must assume it's correct...
+ # FIXME: testimage.bbclass exports these two variables into env,
+ # are there other scenarios in which we need to support being
+ # invoked by bitbake?
+ deploy = self.get('DEPLOY_DIR_IMAGE')
+ bbchild = deploy and self.get('OE_TMPDIR')
+ if bbchild:
+ self.set_machine_deploy_dir(arg, deploy)
+ return
+ # also check whether we're running under a sourced toolchain
+ # environment file
+ if self.get('OECORE_NATIVE_SYSROOT'):
+ self.set("MACHINE", arg)
+ return
+
+ cmd = 'MACHINE=%s bitbake -e' % arg
+ logger.info('Running %s...' % cmd)
+ self.bitbake_e = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ # bitbake -e doesn't report invalid MACHINE as an error, so
+ # let's check DEPLOY_DIR_IMAGE to make sure that it is a valid
+ # MACHINE.
+ s = re.search('^DEPLOY_DIR_IMAGE="(.*)"', self.bitbake_e, re.M)
+ if s:
+ deploy_dir_image = s.group(1)
+ else:
+ raise RunQemuError("bitbake -e %s" % self.bitbake_e)
+ if self.is_deploy_dir_image(deploy_dir_image):
+ self.set_machine_deploy_dir(arg, deploy_dir_image)
+ else:
+ logger.error("%s not a directory valid DEPLOY_DIR_IMAGE" % deploy_dir_image)
+ self.set("MACHINE", arg)
+
+ def check_args(self):
+ for debug in ("-d", "--debug"):
+ if debug in sys.argv:
+ logger.setLevel(logging.DEBUG)
+ sys.argv.remove(debug)
+
+ for quiet in ("-q", "--quiet"):
+ if quiet in sys.argv:
+ logger.setLevel(logging.ERROR)
+ sys.argv.remove(quiet)
+
+ unknown_arg = ""
+ for arg in sys.argv[1:]:
+ if arg in self.fstypes + self.vmtypes:
+ self.check_arg_fstype(arg)
+ elif arg == 'nographic':
+ self.qemu_opt_script += ' -nographic'
+ self.kernel_cmdline_script += ' console=ttyS0'
+ elif arg == 'serial':
+ self.kernel_cmdline_script += ' console=ttyS0'
+ self.serialstdio = True
+ elif arg == 'audio':
+ logger.info("Enabling audio in qemu")
+ logger.info("Please install sound drivers in linux host")
+ self.audio_enabled = True
+ elif arg == 'kvm':
+ self.kvm_enabled = True
+ elif arg == 'kvm-vhost':
+ self.vhost_enabled = True
+ elif arg == 'slirp':
+ self.slirp_enabled = True
+ elif arg == 'snapshot':
+ self.snapshot = True
+ elif arg == 'publicvnc':
+ self.qemu_opt_script += ' -vnc :0'
+ elif arg.startswith('tcpserial='):
+ self.tcpserial_portnum = arg[len('tcpserial='):]
+ elif arg.startswith('biosdir='):
+ self.custombiosdir = arg[len('biosdir='):]
+ elif arg.startswith('biosfilename='):
+ self.qemu_opt_script += ' -bios %s' % arg[len('biosfilename='):]
+ elif arg.startswith('qemuparams='):
+ self.qemu_opt_script += ' %s' % arg[len('qemuparams='):]
+ elif arg.startswith('bootparams='):
+ self.bootparams = arg[len('bootparams='):]
+ elif os.path.exists(arg) or (re.search(':', arg) and re.search('/', arg)):
+ self.check_arg_path(os.path.abspath(arg))
+ elif re.search(r'-image-|-image$', arg):
+ # Lazy rootfs
+ self.rootfs = arg
+ elif arg.startswith('ovmf'):
+ self.ovmf_bios.append(arg)
+ else:
+ # At last, assume it is the MACHINE
+ if (not unknown_arg) or unknown_arg == arg:
+ unknown_arg = arg
+ else:
+ raise RunQemuError("Can't handle two unknown args: %s %s\n"
+ "Try 'runqemu help' on how to use it" % \
+ (unknown_arg, arg))
+ # Check to make sure it is a valid machine
+ if unknown_arg:
+ if self.get('MACHINE') == unknown_arg:
+ return
+ if self.get('DEPLOY_DIR_IMAGE'):
+ machine = os.path.basename(self.get('DEPLOY_DIR_IMAGE'))
+ if unknown_arg == machine:
+ self.set("MACHINE", machine)
+ return
+
+ self.check_arg_machine(unknown_arg)
+
+ if not (self.get('DEPLOY_DIR_IMAGE') or self.qbconfload):
+ self.load_bitbake_env()
+ s = re.search('^DEPLOY_DIR_IMAGE="(.*)"', self.bitbake_e, re.M)
+ if s:
+ self.set("DEPLOY_DIR_IMAGE", s.group(1))
+
+ def check_kvm(self):
+ """Check kvm and kvm-host"""
+ if not (self.kvm_enabled or self.vhost_enabled):
+ self.qemu_opt_script += ' %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU'))
+ return
+
+ if not self.get('QB_CPU_KVM'):
+ raise RunQemuError("QB_CPU_KVM is NULL, this board doesn't support kvm")
+
+ self.qemu_opt_script += ' %s %s' % (self.get('QB_MACHINE'), self.get('QB_CPU_KVM'))
+ yocto_kvm_wiki = "https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
+ yocto_paravirt_kvm_wiki = "https://wiki.yoctoproject.org/wiki/Running_an_x86_Yocto_Linux_image_under_QEMU_KVM"
+ dev_kvm = '/dev/kvm'
+ dev_vhost = '/dev/vhost-net'
+ with open('/proc/cpuinfo', 'r') as f:
+ kvm_cap = re.search('vmx|svm', "".join(f.readlines()))
+ if not kvm_cap:
+ logger.error("You are trying to enable KVM on a cpu without VT support.")
+ logger.error("Remove kvm from the command-line, or refer:")
+ raise RunQemuError(yocto_kvm_wiki)
+
+ if not os.path.exists(dev_kvm):
+ logger.error("Missing KVM device. Have you inserted kvm modules?")
+ logger.error("For further help see:")
+ raise RunQemuError(yocto_kvm_wiki)
+
+ if os.access(dev_kvm, os.W_OK|os.R_OK):
+ self.qemu_opt_script += ' -enable-kvm'
+ if self.get('MACHINE') == "qemux86":
+ # Workaround for broken APIC window on pre 4.15 host kernels which causes boot hangs
+ # See YOCTO #12301
+ # On 64 bit we use x2apic
+ self.kernel_cmdline_script += " clocksource=kvm-clock hpet=disable noapic nolapic"
+ else:
+ logger.error("You have no read or write permission on /dev/kvm.")
+ logger.error("Please change the ownership of this file as described at:")
+ raise RunQemuError(yocto_kvm_wiki)
+
+ if self.vhost_enabled:
+ if not os.path.exists(dev_vhost):
+ logger.error("Missing virtio net device. Have you inserted vhost-net module?")
+ logger.error("For further help see:")
+ raise RunQemuError(yocto_paravirt_kvm_wiki)
+
+ if not os.access(dev_kvm, os.W_OK|os.R_OK):
+ logger.error("You have no read or write permission on /dev/vhost-net.")
+ logger.error("Please change the ownership of this file as described at:")
+ raise RunQemuError(yocto_kvm_wiki)
+
+ def check_fstype(self):
+ """Check and setup FSTYPE"""
+ if not self.fstype:
+ fstype = self.get('QB_DEFAULT_FSTYPE')
+ if fstype:
+ self.fstype = fstype
+ else:
+ raise RunQemuError("FSTYPE is NULL!")
+
+ def check_rootfs(self):
+ """Check and set rootfs"""
+
+ if self.fstype == "none":
+ return
+
+ if self.get('ROOTFS'):
+ if not self.rootfs:
+ self.rootfs = self.get('ROOTFS')
+ elif self.get('ROOTFS') != self.rootfs:
+ raise RunQemuError("Maybe conflicted ROOTFS: %s vs %s" % (self.get('ROOTFS'), self.rootfs))
+
+ if self.fstype == 'nfs':
+ return
+
+ if self.rootfs and not os.path.exists(self.rootfs):
+ # Lazy rootfs
+ self.rootfs = "%s/%s-%s.%s" % (self.get('DEPLOY_DIR_IMAGE'),
+ self.rootfs, self.get('MACHINE'),
+ self.fstype)
+ elif not self.rootfs:
+ cmd_name = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_NAME'), self.fstype)
+ cmd_link = '%s/%s*.%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'), self.fstype)
+ cmds = (cmd_name, cmd_link)
+ self.rootfs = get_first_file(cmds)
+ if not self.rootfs:
+ raise RunQemuError("Failed to find rootfs: %s or %s" % cmds)
+
+ if not os.path.exists(self.rootfs):
+ raise RunQemuError("Can't find rootfs: %s" % self.rootfs)
+
+ def check_ovmf(self):
+ """Check and set full path for OVMF firmware and variable file(s)."""
+
+ for index, ovmf in enumerate(self.ovmf_bios):
+ if os.path.exists(ovmf):
+ continue
+ for suffix in ('qcow2', 'bin'):
+ path = '%s/%s.%s' % (self.get('DEPLOY_DIR_IMAGE'), ovmf, suffix)
+ if os.path.exists(path):
+ self.ovmf_bios[index] = path
+ break
+ else:
+ raise RunQemuError("Can't find OVMF firmware: %s" % ovmf)
+
+ def check_kernel(self):
+ """Check and set kernel"""
+ # The vm image doesn't need a kernel
+ if self.fstype in self.vmtypes:
+ return
+
+ # See if the user supplied a KERNEL option
+ if self.get('KERNEL'):
+ self.kernel = self.get('KERNEL')
+
+ # QB_DEFAULT_KERNEL is always a full file path
+ kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
+
+ # The user didn't want a kernel to be loaded
+ if kernel_name == "none" and not self.kernel:
+ return
+
+ deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
+ if not self.kernel:
+ kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
+ kernel_match_link = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
+ kernel_startswith = "%s/%s*" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
+ cmds = (kernel_match_name, kernel_match_link, kernel_startswith)
+ self.kernel = get_first_file(cmds)
+ if not self.kernel:
+ raise RunQemuError('KERNEL not found: %s, %s or %s' % cmds)
+
+ if not os.path.exists(self.kernel):
+ raise RunQemuError("KERNEL %s not found" % self.kernel)
+
+ def check_dtb(self):
+ """Check and set dtb"""
+ # Did the user specify a device tree?
+ if self.get('DEVICE_TREE'):
+ self.dtb = self.get('DEVICE_TREE')
+ if not os.path.exists(self.dtb):
+ raise RunQemuError('Specified DTB not found: %s' % self.dtb)
+ return
+
+ dtb = self.get('QB_DTB')
+ if dtb:
+ deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
+ cmd_match = "%s/%s" % (deploy_dir_image, dtb)
+ cmd_startswith = "%s/%s*" % (deploy_dir_image, dtb)
+ cmd_wild = "%s/*.dtb" % deploy_dir_image
+ cmds = (cmd_match, cmd_startswith, cmd_wild)
+ self.dtb = get_first_file(cmds)
+ if not os.path.exists(self.dtb):
+ raise RunQemuError('DTB not found: %s, %s or %s' % cmds)
+
+ def check_biosdir(self):
+ """Check custombiosdir"""
+ if not self.custombiosdir:
+ return
+
+ biosdir = ""
+ biosdir_native = "%s/%s" % (self.get('STAGING_DIR_NATIVE'), self.custombiosdir)
+ biosdir_host = "%s/%s" % (self.get('STAGING_DIR_HOST'), self.custombiosdir)
+ for i in (self.custombiosdir, biosdir_native, biosdir_host):
+ if os.path.isdir(i):
+ biosdir = i
+ break
+
+ if biosdir:
+ logger.debug("Assuming biosdir is: %s" % biosdir)
+ self.qemu_opt_script += ' -L %s' % biosdir
+ else:
+ logger.error("Custom BIOS directory not found. Tried: %s, %s, and %s" % (self.custombiosdir, biosdir_native, biosdir_host))
+ raise RunQemuError("Invalid custombiosdir: %s" % self.custombiosdir)
+
+ def check_mem(self):
+ s = re.search('-m +([0-9]+)', self.qemu_opt_script)
+ if s:
+ self.set('QB_MEM', '-m %s' % s.group(1))
+ elif not self.get('QB_MEM'):
+ logger.info('QB_MEM is not set, use 512M by default')
+ self.set('QB_MEM', '-m 512')
+
+ self.kernel_cmdline_script += ' mem=%s' % self.get('QB_MEM').replace('-m','').strip() + 'M'
+ self.qemu_opt_script += ' %s' % self.get('QB_MEM')
+
+ def check_tcpserial(self):
+ if self.tcpserial_portnum:
+ if self.get('QB_TCPSERIAL_OPT'):
+ self.qemu_opt_script += ' ' + self.get('QB_TCPSERIAL_OPT').replace('@PORT@', self.tcpserial_portnum)
+ else:
+ self.qemu_opt_script += ' -serial tcp:127.0.0.1:%s' % self.tcpserial_portnum
+
+ def check_and_set(self):
+ """Check configs sanity and set when needed"""
+ self.validate_paths()
+ if not self.slirp_enabled:
+ check_tun()
+ # Check audio
+ if self.audio_enabled:
+ if not self.get('QB_AUDIO_DRV'):
+ raise RunQemuError("QB_AUDIO_DRV is NULL, this board doesn't support audio")
+ if not self.get('QB_AUDIO_OPT'):
+ logger.warn('QB_AUDIO_OPT is NULL, you may need define it to make audio work')
+ else:
+ self.qemu_opt_script += ' %s' % self.get('QB_AUDIO_OPT')
+ os.putenv('QEMU_AUDIO_DRV', self.get('QB_AUDIO_DRV'))
+ else:
+ os.putenv('QEMU_AUDIO_DRV', 'none')
+
+ self.check_kvm()
+ self.check_fstype()
+ self.check_rootfs()
+ self.check_ovmf()
+ self.check_kernel()
+ self.check_dtb()
+ self.check_biosdir()
+ self.check_mem()
+ self.check_tcpserial()
+
+ def read_qemuboot(self):
+ if not self.qemuboot:
+ if self.get('DEPLOY_DIR_IMAGE'):
+ deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
+ else:
+ logger.warn("Can't find qemuboot conf file, DEPLOY_DIR_IMAGE is NULL!")
+ return
+
+ if self.rootfs and not os.path.exists(self.rootfs):
+ # Lazy rootfs
+ machine = self.get('MACHINE')
+ if not machine:
+ machine = os.path.basename(deploy_dir_image)
+ self.qemuboot = "%s/%s-%s.qemuboot.conf" % (deploy_dir_image,
+ self.rootfs, machine)
+ else:
+ cmd = 'ls -t %s/*.qemuboot.conf' % deploy_dir_image
+ logger.debug('Running %s...' % cmd)
+ try:
+ qbs = subprocess.check_output(cmd, shell=True).decode('utf-8')
+ except subprocess.CalledProcessError as err:
+ raise RunQemuError(err)
+ if qbs:
+ for qb in qbs.split():
+ # Don't use initramfs when other choices unless fstype is ramfs
+ if '-initramfs-' in os.path.basename(qb) and self.fstype != 'cpio.gz':
+ continue
+ self.qemuboot = qb
+ break
+ if not self.qemuboot:
+ # Use the first one when no choice
+ self.qemuboot = qbs.split()[0]
+ self.qbconfload = True
+
+ if not self.qemuboot:
+ # If we haven't found a .qemuboot.conf at this point it probably
+ # doesn't exist, continue without
+ return
+
+ if not os.path.exists(self.qemuboot):
+ raise RunQemuError("Failed to find %s (wrong image name or BSP does not support running under qemu?)." % self.qemuboot)
+
+ logger.debug('CONFFILE: %s' % self.qemuboot)
+
+ cf = configparser.ConfigParser()
+ cf.read(self.qemuboot)
+ for k, v in cf.items('config_bsp'):
+ k_upper = k.upper()
+ if v.startswith("../"):
+ v = os.path.abspath(os.path.dirname(self.qemuboot) + "/" + v)
+ elif v == ".":
+ v = os.path.dirname(self.qemuboot)
+ self.set(k_upper, v)
+
+ def validate_paths(self):
+ """Ensure all relevant path variables are set"""
+ # When we're started with a *.qemuboot.conf arg assume that image
+ # artefacts are relative to that file, rather than in whatever
+ # directory DEPLOY_DIR_IMAGE in the conf file points to.
+ if self.qbconfload:
+ imgdir = os.path.realpath(os.path.dirname(self.qemuboot))
+ if imgdir != os.path.realpath(self.get('DEPLOY_DIR_IMAGE')):
+ logger.info('Setting DEPLOY_DIR_IMAGE to folder containing %s (%s)' % (self.qemuboot, imgdir))
+ self.set('DEPLOY_DIR_IMAGE', imgdir)
+
+ # If the STAGING_*_NATIVE directories from the config file don't exist
+ # and we're in a sourced OE build directory try to extract the paths
+ # from `bitbake -e`
+ havenative = os.path.exists(self.get('STAGING_DIR_NATIVE')) and \
+ os.path.exists(self.get('STAGING_BINDIR_NATIVE'))
+
+ if not havenative:
+ if not self.bitbake_e:
+ self.load_bitbake_env()
+
+ if self.bitbake_e:
+ native_vars = ['STAGING_DIR_NATIVE']
+ for nv in native_vars:
+ s = re.search('^%s="(.*)"' % nv, self.bitbake_e, re.M)
+ if s and s.group(1) != self.get(nv):
+ logger.info('Overriding conf file setting of %s to %s from Bitbake environment' % (nv, s.group(1)))
+ self.set(nv, s.group(1))
+ else:
+ # when we're invoked from a running bitbake instance we won't
+ # be able to call `bitbake -e`, then try:
+ # - get OE_TMPDIR from environment and guess paths based on it
+ # - get OECORE_NATIVE_SYSROOT from environment (for sdk)
+ tmpdir = self.get('OE_TMPDIR')
+ oecore_native_sysroot = self.get('OECORE_NATIVE_SYSROOT')
+ if tmpdir:
+ logger.info('Setting STAGING_DIR_NATIVE and STAGING_BINDIR_NATIVE relative to OE_TMPDIR (%s)' % tmpdir)
+ hostos, _, _, _, machine = os.uname()
+ buildsys = '%s-%s' % (machine, hostos.lower())
+ staging_dir_native = '%s/sysroots/%s' % (tmpdir, buildsys)
+ self.set('STAGING_DIR_NATIVE', staging_dir_native)
+ elif oecore_native_sysroot:
+ logger.info('Setting STAGING_DIR_NATIVE to OECORE_NATIVE_SYSROOT (%s)' % oecore_native_sysroot)
+ self.set('STAGING_DIR_NATIVE', oecore_native_sysroot)
+ if self.get('STAGING_DIR_NATIVE'):
+ # we have to assume that STAGING_BINDIR_NATIVE is at usr/bin
+ staging_bindir_native = '%s/usr/bin' % self.get('STAGING_DIR_NATIVE')
+ logger.info('Setting STAGING_BINDIR_NATIVE to %s' % staging_bindir_native)
+ self.set('STAGING_BINDIR_NATIVE', '%s/usr/bin' % self.get('STAGING_DIR_NATIVE'))
+
+ def print_config(self):
+ logger.info('Continuing with the following parameters:\n')
+ if not self.fstype in self.vmtypes:
+ print('KERNEL: [%s]' % self.kernel)
+ if self.dtb:
+ print('DTB: [%s]' % self.dtb)
+ print('MACHINE: [%s]' % self.get('MACHINE'))
+ print('FSTYPE: [%s]' % self.fstype)
+ if self.fstype == 'nfs':
+ print('NFS_DIR: [%s]' % self.rootfs)
+ else:
+ print('ROOTFS: [%s]' % self.rootfs)
+ if self.ovmf_bios:
+ print('OVMF: %s' % self.ovmf_bios)
+ print('CONFFILE: [%s]' % self.qemuboot)
+ print('')
+
+ def setup_nfs(self):
+ if not self.nfs_server:
+ if self.slirp_enabled:
+ self.nfs_server = '10.0.2.2'
+ else:
+ self.nfs_server = '192.168.7.1'
+
+ # Figure out a new nfs_instance to allow multiple qemus running.
+ # CentOS 7.1's ps doesn't print full command line without "ww"
+ # when invoke by subprocess.Popen().
+ cmd = "ps auxww"
+ ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ pattern = '/bin/unfsd .* -i .*\.pid -e .*/exports([0-9]+) '
+ all_instances = re.findall(pattern, ps, re.M)
+ if all_instances:
+ all_instances.sort(key=int)
+ self.nfs_instance = int(all_instances.pop()) + 1
+
+ nfsd_port = 3049 + 2 * self.nfs_instance
+ mountd_port = 3048 + 2 * self.nfs_instance
+
+ # Export vars for runqemu-export-rootfs
+ export_dict = {
+ 'NFS_INSTANCE': self.nfs_instance,
+ 'NFSD_PORT': nfsd_port,
+ 'MOUNTD_PORT': mountd_port,
+ }
+ for k, v in export_dict.items():
+ # Use '%s' since they are integers
+ os.putenv(k, '%s' % v)
+
+ self.unfs_opts="nfsvers=3,port=%s,udp,mountport=%s" % (nfsd_port, mountd_port)
+
+ # Extract .tar.bz2 or .tar.bz if no nfs dir
+ if not (self.rootfs and os.path.isdir(self.rootfs)):
+ src_prefix = '%s/%s' % (self.get('DEPLOY_DIR_IMAGE'), self.get('IMAGE_LINK_NAME'))
+ dest = "%s-nfsroot" % src_prefix
+ if os.path.exists('%s.pseudo_state' % dest):
+ logger.info('Use %s as NFS_DIR' % dest)
+ self.rootfs = dest
+ else:
+ src = ""
+ src1 = '%s.tar.bz2' % src_prefix
+ src2 = '%s.tar.gz' % src_prefix
+ if os.path.exists(src1):
+ src = src1
+ elif os.path.exists(src2):
+ src = src2
+ if not src:
+ raise RunQemuError("No NFS_DIR is set, and can't find %s or %s to extract" % (src1, src2))
+ logger.info('NFS_DIR not found, extracting %s to %s' % (src, dest))
+ cmd = 'runqemu-extract-sdk %s %s' % (src, dest)
+ logger.info('Running %s...' % cmd)
+ if subprocess.call(cmd, shell=True) != 0:
+ raise RunQemuError('Failed to run %s' % cmd)
+ self.clean_nfs_dir = True
+ self.rootfs = dest
+
+ # Start the userspace NFS server
+ cmd = 'runqemu-export-rootfs start %s' % self.rootfs
+ logger.info('Running %s...' % cmd)
+ if subprocess.call(cmd, shell=True) != 0:
+ raise RunQemuError('Failed to run %s' % cmd)
+
+ self.nfs_running = True
+
+ def setup_slirp(self):
+ """Setup user networking"""
+
+ if self.fstype == 'nfs':
+ self.setup_nfs()
+ self.kernel_cmdline_script += ' ip=dhcp'
+ # Port mapping
+ hostfwd = ",hostfwd=tcp::2222-:22,hostfwd=tcp::2323-:23"
+ qb_slirp_opt_default = "-netdev user,id=net0%s,tftp=%s" % (hostfwd, self.get('DEPLOY_DIR_IMAGE'))
+ qb_slirp_opt = self.get('QB_SLIRP_OPT') or qb_slirp_opt_default
+ # Figure out the port
+ ports = re.findall('hostfwd=[^-]*:([0-9]+)-[^,-]*', qb_slirp_opt)
+ ports = [int(i) for i in ports]
+ mac = 2
+ # Find a free port to avoid conflicts
+ for p in ports[:]:
+ p_new = p
+ while not check_free_port('localhost', p_new):
+ p_new += 1
+ mac += 1
+ while p_new in ports:
+ p_new += 1
+ mac += 1
+ if p != p_new:
+ ports.append(p_new)
+ qb_slirp_opt = re.sub(':%s-' % p, ':%s-' % p_new, qb_slirp_opt)
+ logger.info("Port forward changed: %s -> %s" % (p, p_new))
+ mac = "%s%02x" % (self.mac_slirp, mac)
+ self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qb_slirp_opt))
+ # Print out port foward
+ hostfwd = re.findall('(hostfwd=[^,]*)', qb_slirp_opt)
+ if hostfwd:
+ logger.info('Port forward: %s' % ' '.join(hostfwd))
+
+ def setup_tap(self):
+ """Setup tap"""
+
+ # This file is created when runqemu-gen-tapdevs creates a bank of tap
+ # devices, indicating that the user should not bring up new ones using
+ # sudo.
+ nosudo_flag = '/etc/runqemu-nosudo'
+ self.qemuifup = shutil.which('runqemu-ifup')
+ self.qemuifdown = shutil.which('runqemu-ifdown')
+ ip = shutil.which('ip')
+ lockdir = "/tmp/qemu-tap-locks"
+
+ if not (self.qemuifup and self.qemuifdown and ip):
+ logger.error("runqemu-ifup: %s" % self.qemuifup)
+ logger.error("runqemu-ifdown: %s" % self.qemuifdown)
+ logger.error("ip: %s" % ip)
+ raise OEPathError("runqemu-ifup, runqemu-ifdown or ip not found")
+
+ if not os.path.exists(lockdir):
+ # There might be a race issue when multi runqemu processess are
+ # running at the same time.
+ try:
+ os.mkdir(lockdir)
+ os.chmod(lockdir, 0o777)
+ except FileExistsError:
+ pass
+
+ cmd = '%s link' % ip
+ logger.debug('Running %s...' % cmd)
+ ip_link = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
+ # Matches line like: 6: tap0: <foo>
+ possibles = re.findall('^[0-9]+: +(tap[0-9]+): <.*', ip_link, re.M)
+ tap = ""
+ for p in possibles:
+ lockfile = os.path.join(lockdir, p)
+ if os.path.exists('%s.skip' % lockfile):
+ logger.info('Found %s.skip, skipping %s' % (lockfile, p))
+ continue
+ self.lock = lockfile + '.lock'
+ if self.acquire_lock(error=False):
+ tap = p
+ logger.info("Using preconfigured tap device %s" % tap)
+ logger.info("If this is not intended, touch %s.skip to make runqemu skip %s." %(lockfile, tap))
+ break
+
+ if not tap:
+ if os.path.exists(nosudo_flag):
+ logger.error("Error: There are no available tap devices to use for networking,")
+ logger.error("and I see %s exists, so I am not going to try creating" % nosudo_flag)
+ raise RunQemuError("a new one with sudo.")
+
+ gid = os.getgid()
+ uid = os.getuid()
+ logger.info("Setting up tap interface under sudo")
+ cmd = 'sudo %s %s %s %s' % (self.qemuifup, uid, gid, self.bindir_native)
+ tap = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8').rstrip('\n')
+ lockfile = os.path.join(lockdir, tap)
+ self.lock = lockfile + '.lock'
+ self.acquire_lock()
+ self.cleantap = True
+ logger.debug('Created tap: %s' % tap)
+
+ if not tap:
+ logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.")
+ return 1
+ self.tap = tap
+ tapnum = int(tap[3:])
+ gateway = tapnum * 2 + 1
+ client = gateway + 1
+ if self.fstype == 'nfs':
+ self.setup_nfs()
+ netconf = "192.168.7.%s::192.168.7.%s:255.255.255.0" % (client, gateway)
+ logger.info("Network configuration: %s", netconf)
+ self.kernel_cmdline_script += " ip=%s" % netconf
+ mac = "%s%02x" % (self.mac_tap, client)
+ qb_tap_opt = self.get('QB_TAP_OPT')
+ if qb_tap_opt:
+ qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap)
+ else:
+ qemu_tap_opt = "-netdev tap,id=net0,ifname=%s,script=no,downscript=no" % (self.tap)
+
+ if self.vhost_enabled:
+ qemu_tap_opt += ',vhost=on'
+
+ self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt))
+
+ def setup_network(self):
+ if self.get('QB_NET') == 'none':
+ return
+ if sys.stdin.isatty():
+ self.saved_stty = subprocess.check_output("stty -g", shell=True).decode('utf-8')
+ self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device
+ if self.slirp_enabled:
+ self.setup_slirp()
+ else:
+ self.setup_tap()
+
+ def setup_rootfs(self):
+ if self.get('QB_ROOTFS') == 'none':
+ return
+ if 'wic.' in self.fstype:
+ self.fstype = self.fstype[4:]
+ rootfs_format = self.fstype if self.fstype in ('vmdk', 'qcow2', 'vdi') else 'raw'
+
+ qb_rootfs_opt = self.get('QB_ROOTFS_OPT')
+ if qb_rootfs_opt:
+ self.rootfs_options = qb_rootfs_opt.replace('@ROOTFS@', self.rootfs)
+ else:
+ self.rootfs_options = '-drive file=%s,if=virtio,format=%s' % (self.rootfs, rootfs_format)
+
+ if self.fstype in ('cpio.gz', 'cpio'):
+ self.kernel_cmdline = 'root=/dev/ram0 rw debugshell'
+ self.rootfs_options = '-initrd %s' % self.rootfs
+ else:
+ vm_drive = ''
+ if self.fstype in self.vmtypes:
+ if self.fstype == 'iso':
+ vm_drive = '-drive file=%s,if=virtio,media=cdrom' % self.rootfs
+ elif self.get('QB_DRIVE_TYPE'):
+ drive_type = self.get('QB_DRIVE_TYPE')
+ if drive_type.startswith("/dev/sd"):
+ logger.info('Using scsi drive')
+ vm_drive = '-drive if=none,id=hd,file=%s,format=%s -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd' \
+ % (self.rootfs, rootfs_format)
+ elif drive_type.startswith("/dev/hd"):
+ logger.info('Using ide drive')
+ vm_drive = "-drive file=%s,format=%s" % (self.rootfs, rootfs_format)
+ else:
+ # virtio might have been selected explicitly (just use it), or
+ # is used as fallback (then warn about that).
+ if not drive_type.startswith("/dev/vd"):
+ logger.warn("Unknown QB_DRIVE_TYPE: %s" % drive_type)
+ logger.warn("Failed to figure out drive type, consider define or fix QB_DRIVE_TYPE")
+ logger.warn('Trying to use virtio block drive')
+ vm_drive = '-drive if=virtio,file=%s,format=%s' % (self.rootfs, rootfs_format)
+
+ # All branches above set vm_drive.
+ self.rootfs_options = '%s -no-reboot' % vm_drive
+ self.kernel_cmdline = 'root=%s rw highres=off' % (self.get('QB_KERNEL_ROOT'))
+
+ if self.fstype == 'nfs':
+ self.rootfs_options = ''
+ k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server, os.path.abspath(self.rootfs), self.unfs_opts)
+ self.kernel_cmdline = 'root=%s rw highres=off' % k_root
+
+ if self.fstype == 'none':
+ self.rootfs_options = ''
+
+ self.set('ROOTFS_OPTIONS', self.rootfs_options)
+
+ def guess_qb_system(self):
+ """attempt to determine the appropriate qemu-system binary"""
+ mach = self.get('MACHINE')
+ if not mach:
+ search = '.*(qemux86-64|qemux86|qemuarm64|qemuarm|qemumips64|qemumips64el|qemumipsel|qemumips|qemuppc).*'
+ if self.rootfs:
+ match = re.match(search, self.rootfs)
+ if match:
+ mach = match.group(1)
+ elif self.kernel:
+ match = re.match(search, self.kernel)
+ if match:
+ mach = match.group(1)
+
+ if not mach:
+ return None
+
+ if mach == 'qemuarm':
+ qbsys = 'arm'
+ elif mach == 'qemuarm64':
+ qbsys = 'aarch64'
+ elif mach == 'qemux86':
+ qbsys = 'i386'
+ elif mach == 'qemux86-64':
+ qbsys = 'x86_64'
+ elif mach == 'qemuppc':
+ qbsys = 'ppc'
+ elif mach == 'qemumips':
+ qbsys = 'mips'
+ elif mach == 'qemumips64':
+ qbsys = 'mips64'
+ elif mach == 'qemumipsel':
+ qbsys = 'mipsel'
+ elif mach == 'qemumips64el':
+ qbsys = 'mips64el'
+ elif mach == 'qemuriscv64':
+ qbsys = 'riscv64'
+ elif mach == 'qemuriscv32':
+ qbsys = 'riscv32'
+
+ return 'qemu-system-%s' % qbsys
+
+ def setup_final(self):
+ qemu_system = self.get('QB_SYSTEM_NAME')
+ if not qemu_system:
+ qemu_system = self.guess_qb_system()
+ if not qemu_system:
+ raise RunQemuError("Failed to boot, QB_SYSTEM_NAME is NULL!")
+
+ qemu_bin = '%s/%s' % (self.bindir_native, qemu_system)
+
+ # It is possible to have qemu-native in ASSUME_PROVIDED, and it won't
+ # find QEMU in sysroot, it needs to use host's qemu.
+ if not os.path.exists(qemu_bin):
+ logger.info("QEMU binary not found in %s, trying host's QEMU" % qemu_bin)
+ for path in (os.environ['PATH'] or '').split(':'):
+ qemu_bin_tmp = os.path.join(path, qemu_system)
+ logger.info("Trying: %s" % qemu_bin_tmp)
+ if os.path.exists(qemu_bin_tmp):
+ qemu_bin = qemu_bin_tmp
+ if not os.path.isabs(qemu_bin):
+ qemu_bin = os.path.abspath(qemu_bin)
+ logger.info("Using host's QEMU: %s" % qemu_bin)
+ break
+
+ if not os.access(qemu_bin, os.X_OK):
+ raise OEPathError("No QEMU binary '%s' could be found" % qemu_bin)
+
+ check_libgl(qemu_bin)
+
+ self.qemu_opt = "%s %s %s %s" % (qemu_bin, self.get('NETWORK_CMD'), self.get('ROOTFS_OPTIONS'), self.get('QB_OPT_APPEND'))
+
+ for ovmf in self.ovmf_bios:
+ format = ovmf.rsplit('.', 1)[-1]
+ self.qemu_opt += ' -drive if=pflash,format=%s,file=%s' % (format, ovmf)
+ if self.ovmf_bios:
+ # OVMF only supports normal VGA, i.e. we need to override a -vga vmware
+ # that gets added for example for normal qemux86.
+ self.qemu_opt += ' -vga std'
+
+ self.qemu_opt += ' ' + self.qemu_opt_script
+
+ if self.snapshot:
+ self.qemu_opt += " -snapshot"
+
+ if self.serialstdio:
+ if sys.stdin.isatty():
+ subprocess.check_call("stty intr ^]", shell=True)
+ logger.info("Interrupt character is '^]'")
+
+ first_serial = ""
+ if not re.search("-nographic", self.qemu_opt):
+ first_serial = "-serial mon:vc"
+ # We always want a ttyS1. Since qemu by default adds a serial
+ # port when nodefaults is not specified, it seems that all that
+ # would be needed is to make sure a "-serial" is there. However,
+ # it appears that when "-serial" is specified, it ignores the
+ # default serial port that is normally added. So here we make
+ # sure to add two -serial if there are none. And only one if
+ # there is one -serial already.
+ serial_num = len(re.findall("-serial", self.qemu_opt))
+ if serial_num == 0:
+ self.qemu_opt += " %s %s" % (first_serial, self.get("QB_SERIAL_OPT"))
+ elif serial_num == 1:
+ self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT")
+
+ # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES),
+ # if not serial or serialtcp options was specified only ttyS0 is created
+ # and sysvinit shows an error trying to enable ttyS1:
+ # INIT: Id "S1" respawning too fast: disabled for 5 minutes
+ serial_num = len(re.findall("-serial", self.qemu_opt))
+ if serial_num == 0:
+ if re.search("-nographic", self.qemu_opt):
+ self.qemu_opt += " -serial mon:stdio -serial null"
+ else:
+ self.qemu_opt += " -serial mon:vc -serial null"
+
+ def start_qemu(self):
+ if self.kernel:
+ kernel_opts = "-kernel %s -append '%s %s %s %s'" % (self.kernel, self.kernel_cmdline,
+ self.kernel_cmdline_script, self.get('QB_KERNEL_CMDLINE_APPEND'),
+ self.bootparams)
+ if self.dtb:
+ kernel_opts += " -dtb %s" % self.dtb
+ else:
+ kernel_opts = ""
+ cmd = "%s %s" % (self.qemu_opt, kernel_opts)
+ logger.info('Running %s\n' % cmd)
+ process = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
+ if process.wait():
+ logger.error("Failed to run qemu: %s", process.stderr.read().decode())
+
+ def cleanup(self):
+ if self.cleantap:
+ cmd = 'sudo %s %s %s' % (self.qemuifdown, self.tap, self.bindir_native)
+ logger.debug('Running %s' % cmd)
+ subprocess.check_call(cmd, shell=True)
+ if self.lock_descriptor:
+ logger.info("Releasing lockfile for tap device '%s'" % self.tap)
+ self.release_lock()
+
+ if self.nfs_running:
+ logger.info("Shutting down the userspace NFS server...")
+ cmd = "runqemu-export-rootfs stop %s" % self.rootfs
+ logger.debug('Running %s' % cmd)
+ subprocess.check_call(cmd, shell=True)
+
+ if self.saved_stty:
+ cmd = "stty %s" % self.saved_stty
+ subprocess.check_call(cmd, shell=True)
+
+ if self.clean_nfs_dir:
+ logger.info('Removing %s' % self.rootfs)
+ shutil.rmtree(self.rootfs)
+ shutil.rmtree('%s.pseudo_state' % self.rootfs)
+
+ def load_bitbake_env(self, mach=None):
+ if self.bitbake_e:
+ return
+
+ bitbake = shutil.which('bitbake')
+ if not bitbake:
+ return
+
+ if not mach:
+ mach = self.get('MACHINE')
+
+ if mach:
+ cmd = 'MACHINE=%s bitbake -e' % mach
+ else:
+ cmd = 'bitbake -e'
+
+ logger.info('Running %s...' % cmd)
+ try:
+ self.bitbake_e = subprocess.check_output(cmd, shell=True).decode('utf-8')
+ except subprocess.CalledProcessError as err:
+ self.bitbake_e = ''
+ logger.warn("Couldn't run 'bitbake -e' to gather environment information:\n%s" % err.output.decode('utf-8'))
+
+ def validate_combos(self):
+ if (self.fstype in self.vmtypes) and self.kernel:
+ raise RunQemuError("%s doesn't need kernel %s!" % (self.fstype, self.kernel))
+
+ @property
+ def bindir_native(self):
+ result = self.get('STAGING_BINDIR_NATIVE')
+ if result and os.path.exists(result):
+ return result
+
+ cmd = 'bitbake qemu-helper-native -e'
+ logger.info('Running %s...' % cmd)
+ out = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ out = out.stdout.read().decode('utf-8')
+
+ match = re.search('^STAGING_BINDIR_NATIVE="(.*)"', out, re.M)
+ if match:
+ result = match.group(1)
+ if os.path.exists(result):
+ self.set('STAGING_BINDIR_NATIVE', result)
+ return result
+ raise RunQemuError("Native sysroot directory %s doesn't exist" % result)
+ else:
+ raise RunQemuError("Can't find STAGING_BINDIR_NATIVE in '%s' output" % cmd)
+
+
+def main():
+ if "help" in sys.argv or '-h' in sys.argv or '--help' in sys.argv:
+ print_usage()
+ return 0
+ try:
+ config = BaseConfig()
+ config.check_args()
+ config.read_qemuboot()
+ config.check_and_set()
+ # Check whether the combos is valid or not
+ config.validate_combos()
+ config.print_config()
+ config.setup_network()
+ config.setup_rootfs()
+ config.setup_final()
+ config.start_qemu()
+ except RunQemuError as err:
+ logger.error(err)
+ return 1
+ except Exception as err:
+ import traceback
+ traceback.print_exc()
+ return 1
+ finally:
+ print("Cleanup")
+ config.cleanup()
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/poky/scripts/runqemu-addptable2image b/poky/scripts/runqemu-addptable2image
new file mode 100755
index 000000000..f0195ad8a
--- /dev/null
+++ b/poky/scripts/runqemu-addptable2image
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# Add a partion table to an ext2 image file
+#
+# Copyright (C) 2006-2007 OpenedHand Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+IMAGE=$1
+IMAGEOUT=$2
+
+echo $IMAGE
+echo $IMAGEOUT
+
+size=`ls -l $IMAGE | awk '{ print $5}'`
+size2=`expr $size / 512 / 16 / 63`
+
+echo $size
+echo $size2
+
+# MBR Size = 512 * 63 bytes
+dd if=/dev/zero of=$IMAGEOUT count=63
+
+echo "x" > /tmp/fdisk.cmds
+echo "c" >> /tmp/fdisk.cmds
+echo "1024" >> /tmp/fdisk.cmds
+echo "h" >> /tmp/fdisk.cmds
+echo "16" >> /tmp/fdisk.cmds
+echo "r" >> /tmp/fdisk.cmds
+echo "n" >> /tmp/fdisk.cmds
+echo "p" >> /tmp/fdisk.cmds
+echo "1" >> /tmp/fdisk.cmds
+echo "1" >> /tmp/fdisk.cmds
+echo "$size2" >> /tmp/fdisk.cmds
+echo "w" >> /tmp/fdisk.cmds
+
+/sbin/fdisk $IMAGEOUT < /tmp/fdisk.cmds
+cat $IMAGE >> $IMAGEOUT
diff --git a/poky/scripts/runqemu-export-rootfs b/poky/scripts/runqemu-export-rootfs
new file mode 100755
index 000000000..70cdcdbb1
--- /dev/null
+++ b/poky/scripts/runqemu-export-rootfs
@@ -0,0 +1,156 @@
+#!/bin/bash
+#
+# Copyright (c) 2005-2009 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+usage() {
+ echo "Usage: $0 {start|stop|restart} <nfs-export-dir>"
+}
+
+if [ $# != 2 ]; then
+ usage
+ exit 1
+fi
+
+if [[ "$1" != "start" && "$1" != "stop" && "$1" != "restart" ]]; then
+ echo "Unknown command '$1'"
+ usage
+ exit 1
+fi
+
+if [ ! -d "$2" ]; then
+ echo "Error: '$2' does not exist"
+ usage
+ exit 1
+fi
+# Ensure the nfs-export-dir is an absolute path
+NFS_EXPORT_DIR=$(cd "$2" && pwd)
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+ echo "Error: Unable to find the oe-find-native-sysroot script"
+ echo "Did you forget to source your build environment setup script?"
+ exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT meta-ide-support
+
+if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/unfsd" ]; then
+ echo "Error: Unable to find unfsd binary in $OECORE_NATIVE_SYSROOT/usr/bin/"
+
+ if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
+ echo "Have you run 'bitbake meta-ide-support'?"
+ else
+ echo "This shouldn't happen - something is missing from your toolchain installation"
+ fi
+ exit 1
+fi
+
+if [ ! -d ~/.runqemu-sdk ]; then
+ mkdir -p ~/.runqemu-sdk
+fi
+
+NFS_INSTANCE=${NFS_INSTANCE:=0}
+EXPORTS=~/.runqemu-sdk/exports$NFS_INSTANCE
+RMTAB=~/.runqemu-sdk/rmtab$NFS_INSTANCE
+NFSPID=~/.runqemu-sdk/nfs$NFS_INSTANCE.pid
+MOUNTPID=~/.runqemu-sdk/mount$NFS_INSTANCE.pid
+
+PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
+PSEUDO_LOCALSTATEDIR="$NFS_EXPORT_DIR/../$(basename $NFS_EXPORT_DIR).pseudo_state"
+export PSEUDO_LOCALSTATEDIR
+
+if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then
+ echo "Error: $PSEUDO_LOCALSTATEDIR does not exist."
+ echo "Did you create the export directory using runqemu-extract-sdk?"
+ exit 1
+fi
+
+# NFS server port number
+NFSD_PORT=${NFSD_PORT:=$[ 3049 + 2 * $NFS_INSTANCE ]}
+# mountd port number
+MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]}
+
+## For debugging you would additionally add
+## --debug all
+UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -n $NFSD_PORT -m $MOUNTD_PORT"
+
+# See how we were called.
+case "$1" in
+ start)
+ PORTMAP_RUNNING=`ps -ef | grep portmap | grep -v grep`
+ RPCBIND_RUNNING=`ps -ef | grep rpcbind | grep -v grep`
+ if [[ "x$PORTMAP_RUNNING" = "x" && "x$RPCBIND_RUNNING" = "x" ]]; then
+ echo "======================================================="
+ echo "Error: neither rpcbind nor portmap appear to be running"
+ echo "Please install and start one of these services first"
+ echo "======================================================="
+ echo "Tip: for recent Ubuntu hosts, run:"
+ echo " sudo apt-get install rpcbind"
+ echo "Then add OPTIONS=\"-i -w\" to /etc/default/rpcbind and run"
+ echo " sudo service portmap restart"
+
+ exit 1
+ fi
+
+ echo "Creating exports file..."
+ echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS
+
+ echo "Starting User Mode nfsd"
+ echo " $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS"
+ $PSEUDO $PSEUDO_OPTS $OECORE_NATIVE_SYSROOT/usr/bin/unfsd $UNFSD_OPTS
+ if [ ! $? = 0 ]; then
+ echo "Error starting nfsd"
+ exit 1
+ fi
+ # Check to make sure everything started ok.
+ if [ ! -f $NFSPID ]; then
+ echo "rpc.nfsd did not start correctly"
+ exit 1
+ fi
+ ps -fp `cat $NFSPID` > /dev/null 2> /dev/null
+ if [ ! $? = 0 ]; then
+ echo "rpc.nfsd did not start correctly"
+ exit 1
+ fi
+ echo " "
+ echo "On your target please remember to add the following options for NFS"
+ echo "nfsroot=IP_ADDRESS:$NFS_EXPORT_DIR,nfsvers=3,port=$NFSD_PORT,udp,mountport=$MOUNTD_PORT"
+ ;;
+ stop)
+ if [ -f "$NFSPID" ]; then
+ echo "Stopping rpc.nfsd"
+ kill `cat $NFSPID`
+ rm -f $NFSPID
+ else
+ echo "No PID file, not stopping rpc.nfsd"
+ fi
+ if [ -f "$EXPORTS" ]; then
+ echo "Removing exports file"
+ rm -f $EXPORTS
+ fi
+ ;;
+ restart)
+ $0 stop $NFS_EXPORT_DIR
+ $0 start $NFS_EXPORT_DIR
+ if [ ! $? = 0 ]; then
+ exit 1
+ fi
+ ;;
+ *)
+ echo "$0 {start|stop|restart} <nfs-export-dir>"
+ ;;
+esac
+
+exit 0
diff --git a/poky/scripts/runqemu-extract-sdk b/poky/scripts/runqemu-extract-sdk
new file mode 100755
index 000000000..2a0dd50e0
--- /dev/null
+++ b/poky/scripts/runqemu-extract-sdk
@@ -0,0 +1,104 @@
+#!/bin/bash
+#
+# This utility extracts an SDK image tarball using pseudo, and stores
+# the pseudo database in var/pseudo within the rootfs. If you want to
+# boot QEMU using an nfsroot, you *must* use this script to create the
+# rootfs to ensure it is done correctly with pseudo.
+#
+# Copyright (c) 2010 Intel Corp.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+function usage() {
+ echo "Usage: $0 <image-tarball> <extract-dir>"
+}
+
+if [ $# -ne 2 ]; then
+ usage
+ exit 1
+fi
+
+SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot 2> /dev/null`
+if [ -z "$SYSROOT_SETUP_SCRIPT" ]; then
+ echo "Error: Unable to find the oe-find-native-sysroot script"
+ echo "Did you forget to source your build system environment setup script?"
+ exit 1
+fi
+. $SYSROOT_SETUP_SCRIPT meta-ide-support
+PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
+
+ROOTFS_TARBALL=$1
+SDK_ROOTFS_DIR=$2
+
+if [ ! -e "$ROOTFS_TARBALL" ]; then
+ echo "Error: sdk tarball '$ROOTFS_TARBALL' does not exist"
+ usage
+ exit 1
+fi
+
+# Convert SDK_ROOTFS_DIR to a full pathname
+if [[ ${SDK_ROOTFS_DIR:0:1} != "/" ]]; then
+ SDK_ROOTFS_DIR=$(readlink -f $(pwd)/$SDK_ROOTFS_DIR)
+fi
+
+TAR_OPTS=""
+if [[ "$ROOTFS_TARBALL" =~ tar\.bz2$ ]]; then
+ TAR_OPTS="--numeric-owner -xjf"
+fi
+if [[ "$ROOTFS_TARBALL" =~ tar\.gz$ ]]; then
+ TAR_OPTS="--numeric-owner -xzf"
+fi
+if [[ "$ROOTFS_TARBALL" =~ \.tar$ ]]; then
+ TAR_OPTS="--numeric-owner -xf"
+fi
+if [ -z "$TAR_OPTS" ]; then
+ echo "Error: Unable to determine sdk tarball format"
+ echo "Accepted types: .tar / .tar.gz / .tar.bz2"
+ exit 1
+fi
+
+if [ ! -d "$SDK_ROOTFS_DIR" ]; then
+ echo "Creating directory $SDK_ROOTFS_DIR"
+ mkdir -p "$SDK_ROOTFS_DIR"
+fi
+
+pseudo_state_dir="$SDK_ROOTFS_DIR/../$(basename "$SDK_ROOTFS_DIR").pseudo_state"
+pseudo_state_dir="$(readlink -f $pseudo_state_dir)"
+
+if [ -e "$pseudo_state_dir" ]; then
+ echo "Error: $pseudo_state_dir already exists!"
+ echo "Please delete the rootfs tree and pseudo directory manually"
+ echo "if this is really what you want."
+ exit 1
+fi
+
+mkdir -p "$pseudo_state_dir"
+touch "$pseudo_state_dir/pseudo.pid"
+PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
+export PSEUDO_LOCALSTATEDIR
+
+echo "Extracting rootfs tarball using pseudo..."
+echo "$PSEUDO $PSEUDO_OPTS tar -C \"$SDK_ROOTFS_DIR\" $TAR_OPTS \"$ROOTFS_TARBALL\""
+$PSEUDO $PSEUDO_OPTS tar -C "$SDK_ROOTFS_DIR" $TAR_OPTS "$ROOTFS_TARBALL"
+
+DIRCHECK=`ls -l "$SDK_ROOTFS_DIR" | wc -l`
+if [ "$DIRCHECK" -lt 5 ]; then
+ echo "Warning: I don't see many files in $SDK_ROOTFS_DIR"
+ echo "Please double-check the extraction worked as intended"
+ exit 0
+fi
+
+echo "SDK image successfully extracted to $SDK_ROOTFS_DIR"
+
+exit 0
diff --git a/poky/scripts/runqemu-gen-tapdevs b/poky/scripts/runqemu-gen-tapdevs
new file mode 100755
index 000000000..11de318c1
--- /dev/null
+++ b/poky/scripts/runqemu-gen-tapdevs
@@ -0,0 +1,108 @@
+#!/bin/bash
+#
+# Create a "bank" of tap network devices that can be used by the
+# runqemu script. This script needs to be run as root, and will
+# use the tunctl binary from the build system sysroot. Note: many Linux
+# distros these days still use an older version of tunctl which does not
+# support the group permissions option, hence the need to use the build
+# system provided version.
+#
+# Copyright (C) 2010 Intel Corp.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+usage() {
+ echo "Usage: sudo $0 <uid> <gid> <num> <staging_bindir_native>"
+ echo "Where <uid> is the numeric user id the tap devices will be owned by"
+ echo "Where <gid> is the numeric group id the tap devices will be owned by"
+ echo "<num> is the number of tap devices to create (0 to remove all)"
+ echo "<native-sysroot-basedir> is the path to the build system's native sysroot"
+ echo "e.g. $ bitbake qemu-helper-native"
+ echo "$ sudo $0 1000 1000 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin"
+ exit 1
+}
+
+if [ $EUID -ne 0 ]; then
+ echo "Error: This script must be run with root privileges"
+ exit
+fi
+
+if [ $# -ne 4 ]; then
+ echo "Error: Incorrect number of arguments"
+ usage
+fi
+
+TUID=$1
+GID=$2
+COUNT=$3
+STAGING_BINDIR_NATIVE=$4
+
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
+if [[ ! -x "$TUNCTL" || -d "$TUNCTL" ]]; then
+ echo "Error: $TUNCTL is not an executable"
+ usage
+fi
+
+SCRIPT_DIR=`dirname $0`
+RUNQEMU_IFUP="$SCRIPT_DIR/runqemu-ifup"
+if [ ! -x "$RUNQEMU_IFUP" ]; then
+ echo "Error: Unable to find the runqemu-ifup script in $SCRIPT_DIR"
+ exit 1
+fi
+
+IFCONFIG=`which ip 2> /dev/null`
+if [ -z "$IFCONFIG" ]; then
+ # Is it ever anywhere else?
+ IFCONFIG=/sbin/ip
+fi
+if [ ! -x "$IFCONFIG" ]; then
+ echo "$IFCONFIG cannot be executed"
+ exit 1
+fi
+
+if [ $COUNT -ge 0 ]; then
+ # Ensure we start with a clean slate
+ for tap in `$IFCONFIG link | grep tap | awk '{ print \$2 }' | sed s/://`; do
+ echo "Note: Destroying pre-existing tap interface $tap..."
+ $TUNCTL -d $tap
+ done
+ rm -f /etc/runqemu-nosudo
+else
+ echo "Error: Incorrect count: $COUNT"
+ exit 1
+fi
+
+if [ $COUNT -gt 0 ]; then
+ echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..."
+ for ((index=0; index < $COUNT; index++)); do
+ echo "Creating tap$index"
+ ifup=`$RUNQEMU_IFUP $TUID $GID $STAGING_BINDIR_NATIVE 2>&1`
+ if [ $? -ne 0 ]; then
+ echo "Error running tunctl: $ifup"
+ exit 1
+ fi
+ done
+
+ echo "Note: For systems running NetworkManager, it's recommended"
+ echo "Note: that the tap devices be set as unmanaged in the"
+ echo "Note: NetworkManager.conf file. Add the following lines to"
+ echo "Note: /etc/NetworkManager/NetworkManager.conf"
+ echo "[keyfile]"
+ echo "unmanaged-devices=interface-name:tap*"
+
+ # The runqemu script will check for this file, and if it exists,
+ # will use the existing bank of tap devices without creating
+ # additional ones via sudo.
+ touch /etc/runqemu-nosudo
+fi
diff --git a/poky/scripts/runqemu-ifdown b/poky/scripts/runqemu-ifdown
new file mode 100755
index 000000000..ffbc9de44
--- /dev/null
+++ b/poky/scripts/runqemu-ifdown
@@ -0,0 +1,66 @@
+#!/bin/bash
+#
+# QEMU network configuration script to bring down tap devices. This
+# utility needs to be run as root, and will use the tunctl binary
+# from the native sysroot.
+#
+# If you find yourself calling this script a lot, you can add the
+# the following to your /etc/sudoers file to be able to run this
+# command without entering your password each time:
+#
+# <my-username> ALL=NOPASSWD: /path/to/runqemu-ifup
+# <my-username> ALL=NOPASSWD: /path/to/runqemu-ifdown
+#
+# Copyright (c) 2006-2011 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+usage() {
+ echo "sudo $(basename $0) <tap-dev> <native-sysroot-basedir>"
+}
+
+if [ $EUID -ne 0 ]; then
+ echo "Error: This script (runqemu-ifdown) must be run with root privileges"
+ exit 1
+fi
+
+if [ $# -ne 2 ]; then
+ usage
+ exit 1
+fi
+
+TAP=$1
+STAGING_BINDIR_NATIVE=$2
+
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
+if [ ! -e "$TUNCTL" ]; then
+ echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
+ exit 1
+fi
+
+$TUNCTL -d $TAP
+
+# cleanup the remaining iptables rules
+IPTABLES=`which iptables 2> /dev/null`
+if [ "x$IPTABLES" = "x" ]; then
+ IPTABLES=/sbin/iptables
+fi
+if [ ! -x "$IPTABLES" ]; then
+ echo "$IPTABLES cannot be executed"
+ exit 1
+fi
+n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
+dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
+$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
+$IPTABLES -D POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32
diff --git a/poky/scripts/runqemu-ifup b/poky/scripts/runqemu-ifup
new file mode 100755
index 000000000..59a15eaa2
--- /dev/null
+++ b/poky/scripts/runqemu-ifup
@@ -0,0 +1,121 @@
+#!/bin/bash
+#
+# QEMU network interface configuration script. This utility needs to
+# be run as root, and will use the tunctl binary from a native sysroot.
+# Note: many Linux distros these days still use an older version of
+# tunctl which does not support the group permissions option, hence
+# the need to use build system's version.
+#
+# If you find yourself calling this script a lot, you can add the
+# the following to your /etc/sudoers file to be able to run this
+# command without entering your password each time:
+#
+# <my-username> ALL=NOPASSWD: /path/to/runqemu-ifup
+# <my-username> ALL=NOPASSWD: /path/to/runqemu-ifdown
+#
+# If you'd like to create a bank of tap devices at once, you should use
+# the runqemu-gen-tapdevs script instead. If tap devices are set up using
+# that script, the runqemu script will never end up calling this
+# script.
+#
+# Copyright (c) 2006-2011 Linux Foundation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+usage() {
+ echo "sudo $(basename $0) <uid> <gid> <native-sysroot-basedir>"
+}
+
+if [ $EUID -ne 0 ]; then
+ echo "Error: This script (runqemu-ifup) must be run with root privileges"
+ exit 1
+fi
+
+if [ $# -ne 3 ]; then
+ usage
+ exit 1
+fi
+
+USERID="-u $1"
+GROUP="-g $2"
+STAGING_BINDIR_NATIVE=$3
+
+TUNCTL=$STAGING_BINDIR_NATIVE/tunctl
+if [ ! -x "$TUNCTL" ]; then
+ echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native"
+ exit 1
+fi
+
+TAP=`$TUNCTL -b $GROUP 2>&1`
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+# If tunctl -g fails, try using tunctl -u, for older host kernels
+# which do not support the TUNSETGROUP ioctl
+ TAP=`$TUNCTL -b $USERID 2>&1`
+ STATUS=$?
+ if [ $STATUS -ne 0 ]; then
+ echo "tunctl failed:"
+ exit 1
+ fi
+fi
+
+IFCONFIG=`which ip 2> /dev/null`
+if [ "x$IFCONFIG" = "x" ]; then
+ # better than nothing...
+ IFCONFIG=/sbin/ip
+fi
+if [ ! -x "$IFCONFIG" ]; then
+ echo "$IFCONFIG cannot be executed"
+ exit 1
+fi
+
+IPTABLES=`which iptables 2> /dev/null`
+if [ "x$IPTABLES" = "x" ]; then
+ IPTABLES=/sbin/iptables
+fi
+if [ ! -x "$IPTABLES" ]; then
+ echo "$IPTABLES cannot be executed"
+ exit 1
+fi
+
+n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ]
+$IFCONFIG addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to set up IP addressing on $TAP"
+ exit 1
+fi
+$IFCONFIG link set dev $TAP up
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to bring up $TAP"
+ exit 1
+fi
+
+dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ]
+$IFCONFIG route add to 192.168.7.$dest dev $TAP
+STATUS=$?
+if [ $STATUS -ne 0 ]; then
+ echo "Failed to add route to 192.168.7.$dest using $TAP"
+ exit 1
+fi
+
+# setup NAT for tap0 interface to have internet access in QEMU
+$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$n/32
+$IPTABLES -A POSTROUTING -t nat -j MASQUERADE -s 192.168.7.$dest/32
+echo 1 > /proc/sys/net/ipv4/ip_forward
+echo 1 > /proc/sys/net/ipv4/conf/$TAP/proxy_arp
+$IPTABLES -P FORWARD ACCEPT
+
+echo $TAP
diff --git a/poky/scripts/runqemu.README b/poky/scripts/runqemu.README
new file mode 100644
index 000000000..da9abd7df
--- /dev/null
+++ b/poky/scripts/runqemu.README
@@ -0,0 +1,42 @@
+Using OE images with QEMU
+=========================
+
+OE-Core can generate qemu bootable kernels and images with can be used
+on a desktop system. The scripts currently support booting ARM, MIPS, PowerPC
+and x86 (32 and 64 bit) images. The scripts can be used within the OE build
+system or externaly.
+
+The runqemu script is run as:
+
+ runqemu <machine> <zimage> <filesystem>
+
+where:
+
+ <machine> is the machine/architecture to use (qemuarm/qemumips/qemuppc/qemux86/qemux86-64)
+ <zimage> is the path to a kernel (e.g. zimage-qemuarm.bin)
+ <filesystem> is the path to an ext2 image (e.g. filesystem-qemuarm.ext2) or an nfs directory
+
+If <machine> isn't specified, the script will try to detect the machine name
+from the name of the <zimage> file.
+
+If <filesystem> isn't specified, nfs booting will be assumed.
+
+When used within the build system, it will default to qemuarm, ext2 and the last kernel and
+core-image-sato-sdk image built by the build system. If an sdk image isn't present it will look
+for sato and minimal images.
+
+Full usage instructions can be seen by running the command with no options specified.
+
+
+Notes
+=====
+
+ - The scripts run qemu using sudo. Change perms on /dev/net/tun to
+ run as non root. The runqemu-gen-tapdevs script can also be used by
+ root to prepopulate the appropriate network devices.
+ - You can access the host computer at 192.168.7.1 within the image.
+ - Your qemu system will be accessible as 192.168.7.2.
+ - The script extracts the root filesystem specified under pseudo and sets up a userspace
+ NFS server to share the image over by default meaning the filesystem can be accessed by
+ both the host and guest systems.
+
diff --git a/poky/scripts/send-error-report b/poky/scripts/send-error-report
new file mode 100755
index 000000000..15b5e8491
--- /dev/null
+++ b/poky/scripts/send-error-report
@@ -0,0 +1,200 @@
+#!/usr/bin/env python3
+
+# Sends an error report (if the report-error class was enabled) to a
+# remote server.
+#
+# Copyright (C) 2013 Intel Corporation
+# Author: Andreea Proca <andreea.b.proca@intel.com>
+# Author: Michael Wood <michael.g.wood@intel.com>
+
+import urllib.request, urllib.error
+import sys
+import json
+import os
+import subprocess
+import argparse
+import logging
+
+scripts_lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib')
+sys.path.insert(0, scripts_lib_path)
+import argparse_oe
+
+version = "0.3"
+
+log = logging.getLogger("send-error-report")
+logging.basicConfig(format='%(levelname)s: %(message)s')
+
+def getPayloadLimit(url):
+ req = urllib.request.Request(url, None)
+ try:
+ response = urllib.request.urlopen(req)
+ except urllib.error.URLError as e:
+ # Use this opportunity to bail out if we can't even contact the server
+ log.error("Could not contact server: " + url)
+ log.error(e.reason)
+ sys.exit(1)
+ try:
+ ret = json.loads(response.read())
+ max_log_size = ret.get('max_log_size', 0)
+ return int(max_log_size)
+ except:
+ pass
+
+ return 0
+
+def ask_for_contactdetails():
+ print("Please enter your name and your email (optionally), they'll be saved in the file you send.")
+ username = input("Name (required): ")
+ email = input("E-mail (not required): ")
+ return username, email
+
+def edit_content(json_file_path):
+ edit = input("Review information before sending? (y/n): ")
+ if 'y' in edit or 'Y' in edit:
+ editor = os.environ.get('EDITOR', None)
+ if editor:
+ subprocess.check_call([editor, json_file_path])
+ else:
+ log.error("Please set your EDITOR value")
+ sys.exit(1)
+ return True
+ return False
+
+def prepare_data(args):
+ # attempt to get the max_log_size from the server's settings
+ max_log_size = getPayloadLimit("http://"+args.server+"/ClientPost/JSON")
+
+ if not os.path.isfile(args.error_file):
+ log.error("No data file found.")
+ sys.exit(1)
+
+ home = os.path.expanduser("~")
+ userfile = os.path.join(home, ".oe-send-error")
+
+ try:
+ with open(userfile, 'r') as userfile_fp:
+ if len(args.name) == 0:
+ args.name = userfile_fp.readline()
+ else:
+ #use empty readline to increment the fp
+ userfile_fp.readline()
+
+ if len(args.email) == 0:
+ args.email = userfile_fp.readline()
+ except:
+ pass
+
+ if args.assume_yes == True and len(args.name) == 0:
+ log.error("Name needs to be provided either via "+userfile+" or as an argument (-n).")
+ sys.exit(1)
+
+ while len(args.name) <= 0 and len(args.name) < 50:
+ print("\nName needs to be given and must not more than 50 characters.")
+ args.name, args.email = ask_for_contactdetails()
+
+ with open(userfile, 'w') as userfile_fp:
+ userfile_fp.write(args.name.strip() + "\n")
+ userfile_fp.write(args.email.strip() + "\n")
+
+ with open(args.error_file, 'r') as json_fp:
+ data = json_fp.read()
+
+ jsondata = json.loads(data)
+ jsondata['username'] = args.name.strip()
+ jsondata['email'] = args.email.strip()
+ jsondata['link_back'] = args.link_back.strip()
+ # If we got a max_log_size then use this to truncate to get the last
+ # max_log_size bytes from the end
+ if max_log_size != 0:
+ for fail in jsondata['failures']:
+ if len(fail['log']) > max_log_size:
+ print("Truncating log to allow for upload")
+ fail['log'] = fail['log'][-max_log_size:]
+
+ data = json.dumps(jsondata, indent=4, sort_keys=True)
+
+ # Write back the result which will contain all fields filled in and
+ # any post processing done on the log data
+ with open(args.error_file, "w") as json_fp:
+ if data:
+ json_fp.write(data)
+
+
+ if args.assume_yes == False and edit_content(args.error_file):
+ #We'll need to re-read the content if we edited it
+ with open(args.error_file, 'r') as json_fp:
+ data = json_fp.read()
+
+ return data.encode('utf-8')
+
+
+def send_data(data, args):
+ headers={'Content-type': 'application/json', 'User-Agent': "send-error-report/"+version}
+
+ if args.json:
+ url = "http://"+args.server+"/ClientPost/JSON/"
+ else:
+ url = "http://"+args.server+"/ClientPost/"
+
+ req = urllib.request.Request(url, data=data, headers=headers)
+ try:
+ response = urllib.request.urlopen(req)
+ except urllib.error.HTTPError as e:
+ logging.error(e.reason)
+ sys.exit(1)
+
+ print(response.read())
+
+
+if __name__ == '__main__':
+ arg_parse = argparse_oe.ArgumentParser(description="This scripts will send an error report to your specified error-report-web server.")
+
+ arg_parse.add_argument("error_file",
+ help="Generated error report file location",
+ type=str)
+
+ arg_parse.add_argument("-y",
+ "--assume-yes",
+ help="Assume yes to all queries and do not prompt",
+ action="store_true")
+
+ arg_parse.add_argument("-s",
+ "--server",
+ help="Server to send error report to",
+ type=str,
+ default="errors.yoctoproject.org")
+
+ arg_parse.add_argument("-e",
+ "--email",
+ help="Email address to be used for contact",
+ type=str,
+ default="")
+
+ arg_parse.add_argument("-n",
+ "--name",
+ help="Submitter name used to identify your error report",
+ type=str,
+ default="")
+
+ arg_parse.add_argument("-l",
+ "--link-back",
+ help="A url to link back to this build from the error report server",
+ type=str,
+ default="")
+
+ arg_parse.add_argument("-j",
+ "--json",
+ help="Return the result in json format, silences all other output",
+ action="store_true")
+
+
+
+ args = arg_parse.parse_args()
+
+ if (args.json == False):
+ print("Preparing to send errors to: "+args.server)
+
+ data = prepare_data(args)
+ send_data(data, args)
+
+ sys.exit(0)
diff --git a/poky/scripts/send-pull-request b/poky/scripts/send-pull-request
new file mode 100755
index 000000000..883deacb0
--- /dev/null
+++ b/poky/scripts/send-pull-request
@@ -0,0 +1,184 @@
+#!/bin/bash
+#
+# Copyright (c) 2010-2011, Intel Corporation.
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+# the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+#
+# This script is intended to be used to send a patch series prepared by the
+# create-pull-request script to Open Embedded and The Yocto Project, as well
+# as to related projects and layers.
+#
+
+AUTO=0
+AUTO_CL=0
+GITSOBCC="--suppress-cc=all"
+
+# Prevent environment leakage to these vars.
+unset TO
+unset CC
+unset AUTO_CC
+unset EXTRA_CC
+
+usage()
+{
+cat <<EOM
+Usage: $(basename $0) [-h] [-a] [-c] [[-t email]...] -p pull-dir
+ -a Send the cover letter to every recipient listed in Cc and
+ Signed-off-by lines found in the cover letter and the patches.
+ This option implies -c.
+ -c Expand the Cc list for the individual patches using the Cc and
+ Signed-off-by lines from the same patch.
+ -C Add extra CC to each email sent.
+ -p pull-dir Directory containing summary and patch files
+ -t email Explicitly add email to the recipients
+EOM
+}
+
+# Collect addresses from a patch into AUTO_CC
+# $1: a patch file
+harvest_recipients()
+{
+ PATCH=$1
+ export IFS=$',\n'
+ for REGX in "^[Cc][Cc]: *" "^[Ss]igned-[Oo]ff-[Bb]y: *"; do
+ for EMAIL in $(sed '/^---$/q' $PATCH | grep -e "$REGX" | sed "s/$REGX//"); do
+ if [ "${AUTO_CC/$EMAIL/}" == "$AUTO_CC" ] && [ -n "$EMAIL" ]; then
+ if [ -z "$AUTO_CC" ]; then
+ AUTO_CC=$EMAIL;
+ else
+ AUTO_CC="$AUTO_CC,$EMAIL";
+ fi
+ fi
+ done
+ done
+ unset IFS
+}
+
+# Parse and verify arguments
+while getopts "acC:hp:t:" OPT; do
+ case $OPT in
+ a)
+ AUTO=1
+ GITSOBCC="--signed-off-by-cc"
+ AUTO_CL=1
+ ;;
+ c)
+ AUTO=1
+ GITSOBCC="--signed-off-by-cc"
+ ;;
+ C)
+ EXTRA_CC="$OPTARG"
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ p)
+ PDIR=${OPTARG%/}
+ if [ ! -d $PDIR ]; then
+ echo "ERROR: pull-dir \"$PDIR\" does not exist."
+ usage
+ exit 1
+ fi
+ ;;
+ t)
+ if [ -n "$TO" ]; then
+ TO="$TO,$OPTARG"
+ else
+ TO="$OPTARG"
+ fi
+ ;;
+ esac
+done
+
+if [ -z "$PDIR" ]; then
+ echo "ERROR: you must specify a pull-dir."
+ usage
+ exit 1
+fi
+
+
+# Verify the cover letter is complete and free of tokens
+if [ -e $PDIR/0000-cover-letter.patch ]; then
+ CL="$PDIR/0000-cover-letter.patch"
+ for TOKEN in SUBJECT BLURB; do
+ grep -q "*** $TOKEN HERE ***" "$CL"
+ if [ $? -eq 0 ]; then
+ echo "ERROR: Please edit $CL and try again (Look for '*** $TOKEN HERE ***')."
+ exit 1
+ fi
+ done
+else
+ echo "WARNING: No cover letter will be sent."
+fi
+
+# Harvest emails from the generated patches and populate AUTO_CC.
+if [ $AUTO_CL -eq 1 ]; then
+ for PATCH in $PDIR/*.patch; do
+ harvest_recipients $PATCH
+ done
+fi
+
+AUTO_TO="$(git config sendemail.to)"
+if [ -n "$AUTO_TO" ]; then
+ if [ -n "$TO" ]; then
+ TO="$TO,$AUTO_TO"
+ else
+ TO="$AUTO_TO"
+ fi
+fi
+
+if [ -z "$TO" ] && [ -z "$AUTO_CC" ]; then
+ echo "ERROR: you have not specified any recipients."
+ usage
+ exit 1
+fi
+
+
+# Convert the collected addresses into git-send-email argument strings
+export IFS=$','
+GIT_TO=$(for R in $TO; do echo -n "--to='$R' "; done)
+GIT_CC=$(for R in $AUTO_CC; do echo -n "--cc='$R' "; done)
+GIT_EXTRA_CC=$(for R in $EXTRA_CC; do echo -n "--cc='$R' "; done)
+unset IFS
+
+# Handoff to git-send-email. It will perform the send confirmation.
+# Mail threading was already handled by git-format-patch in
+# create-pull-request, so we must not allow git-send-email to
+# add In-Reply-To and References headers again.
+PATCHES=$(echo $PDIR/*.patch)
+if [ $AUTO_CL -eq 1 ]; then
+ # Send the cover letter to every recipient, both specified as well as
+ # harvested. Then remove it from the patches list.
+ # --no-thread is redundant here (only sending a single message) and
+ # merely added for the sake of consistency.
+ eval "git send-email $GIT_TO $GIT_CC $GIT_EXTRA_CC --confirm=always --no-thread --suppress-cc=all $CL"
+ if [ $? -eq 1 ]; then
+ echo "ERROR: failed to send cover-letter with automatic recipients."
+ exit 1
+ fi
+ PATCHES=${PATCHES/"$CL"/}
+fi
+
+# Send the patch to the specified recipients and, if -c was specified, those git
+# finds in this specific patch.
+eval "git send-email $GIT_TO $GIT_EXTRA_CC --confirm=always --no-thread $GITSOBCC $PATCHES"
+if [ $? -eq 1 ]; then
+ echo "ERROR: failed to send patches."
+ exit 1
+fi
diff --git a/poky/scripts/sstate-cache-management.sh b/poky/scripts/sstate-cache-management.sh
new file mode 100755
index 000000000..2ab450ab5
--- /dev/null
+++ b/poky/scripts/sstate-cache-management.sh
@@ -0,0 +1,469 @@
+#!/bin/bash
+
+# Copyright (c) 2012 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+# Global vars
+cache_dir=
+confirm=
+fsym=
+total_deleted=0
+verbose=
+debug=0
+
+usage () {
+ cat << EOF
+Welcome to sstate cache management utilities.
+sstate-cache-management.sh <OPTION>
+
+Options:
+ -h, --help
+ Display this help and exit.
+
+ --cache-dir=<sstate cache dir>
+ Specify sstate cache directory, will use the environment
+ variable SSTATE_CACHE_DIR if it is not specified.
+
+ --extra-archs=<arch1>,<arch2>...<archn>
+ Specify list of architectures which should be tested, this list
+ will be extended with native arch, allarch and empty arch. The
+ script won't be trying to generate list of available archs from
+ AVAILTUNES in tune files.
+
+ --extra-layer=<layer1>,<layer2>...<layern>
+ Specify the layer which will be used for searching the archs,
+ it will search the meta and meta-* layers in the top dir by
+ default, and will search meta, meta-*, <layer1>, <layer2>,
+ ...<layern> when specified. Use "," as the separator.
+
+ This is useless for --stamps-dir or when --extra-archs is used.
+
+ -d, --remove-duplicated
+ Remove the duplicated sstate cache files of one package, only
+ the newest one will be kept. The duplicated sstate cache files
+ of one package must have the same arch, which means sstate cache
+ files with multiple archs are not considered duplicate.
+
+ Conflicts with --stamps-dir.
+
+ --stamps-dir=<dir1>,<dir2>...<dirn>
+ Specify the build directory's stamps directories, the sstate
+ cache file which IS USED by these build diretories will be KEPT,
+ other sstate cache files in cache-dir will be removed. Use ","
+ as the separator. For example:
+ --stamps-dir=build1/tmp/stamps,build2/tmp/stamps
+
+ Conflicts with --remove-duplicated.
+
+ -L, --follow-symlink
+ Remove both the symbol link and the destination file, default: no.
+
+ -y, --yes
+ Automatic yes to prompts; assume "yes" as answer to all prompts
+ and run non-interactively.
+
+ -v, --verbose
+ Explain what is being done.
+
+ -D, --debug
+ Show debug info, repeat for more debug info.
+
+EOF
+}
+
+if [ $# -lt 1 ]; then
+ usage
+ exit 0
+fi
+
+# Echo no files to remove
+no_files () {
+ echo No files to remove
+}
+
+# Echo nothing to do
+do_nothing () {
+ echo Nothing to do
+}
+
+# Read the input "y"
+read_confirm () {
+ echo "$total_deleted out of $total_files files will be removed! "
+ if [ "$confirm" != "y" ]; then
+ echo "Do you want to continue (y/n)? "
+ while read confirm; do
+ [ "$confirm" = "Y" -o "$confirm" = "y" -o "$confirm" = "n" \
+ -o "$confirm" = "N" ] && break
+ echo "Invalid input \"$confirm\", please input 'y' or 'n': "
+ done
+ else
+ echo
+ fi
+}
+
+# Print error information and exit.
+echo_error () {
+ echo "ERROR: $1" >&2
+ exit 1
+}
+
+# Generate the remove list:
+#
+# * Add .done/.siginfo to the remove list
+# * Add destination of symlink to the remove list
+#
+# $1: output file, others: sstate cache file (.tgz)
+gen_rmlist (){
+ local rmlist_file="$1"
+ shift
+ local files="$@"
+ for i in $files; do
+ echo $i >> $rmlist_file
+ # Add the ".siginfo"
+ if [ -e $i.siginfo ]; then
+ echo $i.siginfo >> $rmlist_file
+ fi
+ # Add the destination of symlink
+ if [ -L "$i" ]; then
+ if [ "$fsym" = "y" ]; then
+ dest="`readlink -e $i`"
+ if [ -n "$dest" ]; then
+ echo $dest >> $rmlist_file
+ # Remove the .siginfo when .tgz is removed
+ if [ -f "$dest.siginfo" ]; then
+ echo $dest.siginfo >> $rmlist_file
+ fi
+ fi
+ fi
+ # Add the ".tgz.done" and ".siginfo.done" (may exist in the future)
+ base_fn="${i##/*/}"
+ t_fn="$base_fn.done"
+ s_fn="$base_fn.siginfo.done"
+ for d in $t_fn $s_fn; do
+ if [ -f $cache_dir/$d ]; then
+ echo $cache_dir/$d >> $rmlist_file
+ fi
+ done
+ fi
+ done
+}
+
+# Remove the duplicated cache files for the pkg, keep the newest one
+remove_duplicated () {
+
+ local topdir
+ local oe_core_dir
+ local tunedirs
+ local all_archs
+ local all_machines
+ local ava_archs
+ local arch
+ local file_names
+ local sstate_files_list
+ local fn_tmp
+ local list_suffix=`mktemp` || exit 1
+
+ if [ -z "$extra_archs" ] ; then
+ # Find out the archs in all the layers
+ echo "Figuring out the archs in the layers ... "
+ oe_core_dir=$(dirname $(dirname $(readlink -e $0)))
+ topdir=$(dirname $oe_core_dir)
+ tunedirs="`find $topdir/meta* ${oe_core_dir}/meta* $layers -path '*/meta*/conf/machine/include' 2>/dev/null`"
+ [ -n "$tunedirs" ] || echo_error "Can't find the tune directory"
+ all_machines="`find $topdir/meta* ${oe_core_dir}/meta* $layers -path '*/meta*/conf/machine/*' -name '*.conf' 2>/dev/null | sed -e 's/.*\///' -e 's/.conf$//'`"
+ all_archs=`grep -r -h "^AVAILTUNES .*=" $tunedirs | sed -e 's/.*=//' -e 's/\"//g'`
+ fi
+
+ # Use the "_" to substitute "-", e.g., x86-64 to x86_64, but not for extra_archs which can be something like cortexa9t2-vfp-neon
+ # Sort to remove the duplicated ones
+ # Add allarch and builder arch (native)
+ builder_arch=$(uname -m)
+ all_archs="$(echo allarch $all_archs $all_machines $builder_arch \
+ | sed -e 's/-/_/g' -e 's/ /\n/g' | sort -u) $extra_archs"
+ echo "Done"
+
+ # Total number of files including sstate-, .siginfo and .done files
+ total_files=`find $cache_dir -name 'sstate*' | wc -l`
+ # Save all the sstate files in a file
+ sstate_files_list=`mktemp` || exit 1
+ find $cache_dir -name 'sstate:*:*:*:*:*:*:*.tgz*' >$sstate_files_list
+
+ echo "Figuring out the suffixes in the sstate cache dir ... "
+ sstate_suffixes="`sed 's%.*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^_]*_\([^:]*\)\.tgz.*%\1%g' $sstate_files_list | sort -u`"
+ echo "Done"
+ echo "The following suffixes have been found in the cache dir:"
+ echo $sstate_suffixes
+
+ echo "Figuring out the archs in the sstate cache dir ... "
+ # Using this SSTATE_PKGSPEC definition it's 6th colon separated field
+ # SSTATE_PKGSPEC = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
+ for arch in $all_archs; do
+ grep -q ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:$arch:[^:]*:[^:]*\.tgz$" $sstate_files_list
+ [ $? -eq 0 ] && ava_archs="$ava_archs $arch"
+ # ${builder_arch}_$arch used by toolchain sstate
+ grep -q ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:${builder_arch}_$arch:[^:]*:[^:]*\.tgz$" $sstate_files_list
+ [ $? -eq 0 ] && ava_archs="$ava_archs ${builder_arch}_$arch"
+ done
+ echo "Done"
+ echo "The following archs have been found in the cache dir:"
+ echo $ava_archs
+ echo ""
+
+ # Save the file list which needs to be removed
+ local remove_listdir=`mktemp -d` || exit 1
+ for suffix in $sstate_suffixes; do
+ if [ "$suffix" = "populate_lic" ] ; then
+ echo "Skipping populate_lic, because removing duplicates doesn't work correctly for them (use --stamps-dir instead)"
+ continue
+ fi
+ # Total number of files including .siginfo and .done files
+ total_files_suffix=`grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:_]*_$suffix\.tgz.*" $sstate_files_list | wc -l 2>/dev/null`
+ total_tgz_suffix=`grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:_]*_$suffix\.tgz$" $sstate_files_list | wc -l 2>/dev/null`
+ # Save the file list to a file, some suffix's file may not exist
+ grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:_]*_$suffix\.tgz.*" $sstate_files_list >$list_suffix 2>/dev/null
+ local deleted_tgz=0
+ local deleted_files=0
+ for ext in tgz tgz.siginfo tgz.done; do
+ echo "Figuring out the sstate:xxx_$suffix.$ext ... "
+ # Uniq BPNs
+ file_names=`for arch in $ava_archs ""; do
+ sed -ne "s%.*/sstate:\([^:]*\):[^:]*:[^:]*:[^:]*:$arch:[^:]*:[^:]*\.${ext}$%\1%p" $list_suffix
+ done | sort -u`
+
+ fn_tmp=`mktemp` || exit 1
+ rm_list="$remove_listdir/sstate:xxx_$suffix"
+ for fn in $file_names; do
+ [ -z "$verbose" ] || echo "Analyzing sstate:$fn-xxx_$suffix.${ext}"
+ for arch in $ava_archs ""; do
+ grep -h ".*/sstate:$fn:[^:]*:[^:]*:[^:]*:$arch:[^:]*:[^:]*\.${ext}$" $list_suffix >$fn_tmp
+ if [ -s $fn_tmp ] ; then
+ [ $debug -gt 1 ] && echo "Available files for $fn-$arch- with suffix $suffix.${ext}:" && cat $fn_tmp
+ # Use the modification time
+ to_del=$(ls -t $(cat $fn_tmp) | sed -n '1!p')
+ [ $debug -gt 2 ] && echo "Considering to delete: $to_del"
+ # The sstate file which is downloaded from the SSTATE_MIRROR is
+ # put in SSTATE_DIR, and there is a symlink in SSTATE_DIR/??/ to
+ # it, so filter it out from the remove list if it should not be
+ # removed.
+ to_keep=$(ls -t $(cat $fn_tmp) | sed -n '1p')
+ [ $debug -gt 2 ] && echo "Considering to keep: $to_keep"
+ for k in $to_keep; do
+ if [ -L "$k" ]; then
+ # The symlink's destination
+ k_dest="`readlink -e $k`"
+ # Maybe it is the one in cache_dir
+ k_maybe="$cache_dir/${k##/*/}"
+ # Remove it from the remove list if they are the same.
+ if [ "$k_dest" = "$k_maybe" ]; then
+ to_del="`echo $to_del | sed 's#'\"$k_maybe\"'##g'`"
+ fi
+ fi
+ done
+ rm -f $fn_tmp
+ [ $debug -gt 2 ] && echo "Decided to delete: $to_del"
+ gen_rmlist $rm_list.$ext "$to_del"
+ fi
+ done
+ done
+ done
+ deleted_tgz=`cat $rm_list.* 2>/dev/null | grep ".tgz$" | wc -l`
+ deleted_files=`cat $rm_list.* 2>/dev/null | wc -l`
+ [ "$deleted_files" -gt 0 -a $debug -gt 0 ] && cat $rm_list.*
+ echo "($deleted_tgz out of $total_tgz_suffix .tgz files for $suffix suffix will be removed or $deleted_files out of $total_files_suffix when counting also .siginfo and .done files)"
+ let total_deleted=$total_deleted+$deleted_files
+ done
+ deleted_tgz=0
+ rm_old_list=$remove_listdir/sstate-old-filenames
+ find $cache_dir -name 'sstate-*.tgz' >$rm_old_list
+ [ -s "$rm_old_list" ] && deleted_tgz=`cat $rm_old_list | grep ".tgz$" | wc -l`
+ [ -s "$rm_old_list" ] && deleted_files=`cat $rm_old_list | wc -l`
+ [ -s "$rm_old_list" -a $debug -gt 0 ] && cat $rm_old_list
+ echo "($deleted_tgz .tgz files with old sstate-* filenames will be removed or $deleted_files when counting also .siginfo and .done files)"
+ let total_deleted=$total_deleted+$deleted_files
+
+ rm -f $list_suffix
+ rm -f $sstate_files_list
+ if [ $total_deleted -gt 0 ]; then
+ read_confirm
+ if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
+ for list in `ls $remove_listdir/`; do
+ echo "Removing $list.tgz (`cat $remove_listdir/$list | wc -w` files) ... "
+ # Remove them one by one to avoid the argument list too long error
+ for i in `cat $remove_listdir/$list`; do
+ rm -f $verbose $i
+ done
+ echo "Done"
+ done
+ echo "$total_deleted files have been removed!"
+ else
+ do_nothing
+ fi
+ else
+ no_files
+ fi
+ [ -d $remove_listdir ] && rm -fr $remove_listdir
+}
+
+# Remove the sstate file by stamps dir, the file not used by the stamps dir
+# will be removed.
+rm_by_stamps (){
+
+ local cache_list=`mktemp` || exit 1
+ local keep_list=`mktemp` || exit 1
+ local rm_list=`mktemp` || exit 1
+ local sums
+ local all_sums
+
+ # Total number of files including sstate-, .siginfo and .done files
+ total_files=`find $cache_dir -type f -name 'sstate*' | wc -l`
+ # Save all the state file list to a file
+ find $cache_dir -type f -name 'sstate*' | sort -u -o $cache_list
+
+ echo "Figuring out the suffixes in the sstate cache dir ... "
+ local sstate_suffixes="`sed 's%.*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^_]*_\([^:]*\)\.tgz.*%\1%g' $cache_list | sort -u`"
+ echo "Done"
+ echo "The following suffixes have been found in the cache dir:"
+ echo $sstate_suffixes
+
+ # Figure out all the md5sums in the stamps dir.
+ echo "Figuring out all the md5sums in stamps dir ... "
+ for i in $sstate_suffixes; do
+ # There is no "\.sigdata" but "_setcene" when it is mirrored
+ # from the SSTATE_MIRRORS, use them to figure out the sum.
+ sums=`find $stamps -maxdepth 3 -name "*.do_$i.*" \
+ -o -name "*.do_${i}_setscene.*" | \
+ sed -ne 's#.*_setscene\.##p' -e 's#.*\.sigdata\.##p' | \
+ sed -e 's#\..*##' | sort -u`
+ all_sums="$all_sums $sums"
+ done
+ echo "Done"
+
+ echo "Figuring out the files which will be removed ... "
+ for i in $all_sums; do
+ grep ".*/sstate:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:${i}_.*" $cache_list >>$keep_list
+ done
+ echo "Done"
+
+ if [ -s $keep_list ]; then
+ sort -u $keep_list -o $keep_list
+ to_del=`comm -1 -3 $keep_list $cache_list`
+ gen_rmlist $rm_list "$to_del"
+ let total_deleted=`cat $rm_list | sort -u | wc -w`
+ if [ $total_deleted -gt 0 ]; then
+ [ $debug -gt 0 ] && cat $rm_list | sort -u
+ read_confirm
+ if [ "$confirm" = "y" -o "$confirm" = "Y" ]; then
+ echo "Removing sstate cache files ... ($total_deleted files)"
+ # Remove them one by one to avoid the argument list too long error
+ for i in `cat $rm_list | sort -u`; do
+ rm -f $verbose $i
+ done
+ echo "$total_deleted files have been removed"
+ else
+ do_nothing
+ fi
+ else
+ no_files
+ fi
+ else
+ echo_error "All files in cache dir will be removed! Abort!"
+ fi
+
+ rm -f $cache_list
+ rm -f $keep_list
+ rm -f $rm_list
+}
+
+# Parse arguments
+while [ -n "$1" ]; do
+ case $1 in
+ --cache-dir=*)
+ cache_dir=`echo $1 | sed -e 's#^--cache-dir=##' | xargs readlink -e`
+ [ -d "$cache_dir" ] || echo_error "Invalid argument to --cache-dir"
+ shift
+ ;;
+ --remove-duplicated|-d)
+ rm_duplicated="y"
+ shift
+ ;;
+ --yes|-y)
+ confirm="y"
+ shift
+ ;;
+ --follow-symlink|-L)
+ fsym="y"
+ shift
+ ;;
+ --extra-archs=*)
+ extra_archs=`echo $1 | sed -e 's#^--extra-archs=##' -e 's#,# #g'`
+ [ -n "$extra_archs" ] || echo_error "Invalid extra arch parameter"
+ shift
+ ;;
+ --extra-layer=*)
+ extra_layers=`echo $1 | sed -e 's#^--extra-layer=##' -e 's#,# #g'`
+ [ -n "$extra_layers" ] || echo_error "Invalid extra layer parameter"
+ for i in $extra_layers; do
+ l=`readlink -e $i`
+ if [ -d "$l" ]; then
+ layers="$layers $l"
+ else
+ echo_error "Can't find layer $i"
+ fi
+ done
+ shift
+ ;;
+ --stamps-dir=*)
+ stamps=`echo $1 | sed -e 's#^--stamps-dir=##' -e 's#,# #g'`
+ [ -n "$stamps" ] || echo_error "Invalid stamps dir $i"
+ for i in $stamps; do
+ [ -d "$i" ] || echo_error "Invalid stamps dir $i"
+ done
+ shift
+ ;;
+ --verbose|-v)
+ verbose="-v"
+ shift
+ ;;
+ --debug|-D)
+ debug=`expr $debug + 1`
+ echo "Debug level $debug"
+ shift
+ ;;
+ --help|-h)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid arguments $*"
+ echo_error "Try 'sstate-cache-management.sh -h' for more information."
+ ;;
+ esac
+done
+
+# sstate cache directory, use environment variable SSTATE_CACHE_DIR
+# if it was not specified, otherwise, error.
+[ -n "$cache_dir" ] || cache_dir=$SSTATE_CACHE_DIR
+[ -n "$cache_dir" ] || echo_error "No cache dir found!"
+[ -d "$cache_dir" ] || echo_error "Invalid cache directory \"$cache_dir\""
+
+[ -n "$rm_duplicated" -a -n "$stamps" ] && \
+ echo_error "Can not use both --remove-duplicated and --stamps-dir"
+
+[ "$rm_duplicated" = "y" ] && remove_duplicated
+[ -n "$stamps" ] && rm_by_stamps
+[ -z "$rm_duplicated" -a -z "$stamps" ] && \
+ echo "What do you want to do?"
+exit 0
diff --git a/poky/scripts/sstate-diff-machines.sh b/poky/scripts/sstate-diff-machines.sh
new file mode 100755
index 000000000..27c6a3300
--- /dev/null
+++ b/poky/scripts/sstate-diff-machines.sh
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+# Used to compare sstate checksums between MACHINES.
+# Execute script and compare generated list.M files.
+# Using bash to have PIPESTATUS variable.
+
+# It's also usefull to keep older sstate checksums
+# to be able to find out why something is rebuilding
+# after updating metadata
+
+# $ diff \
+# sstate-diff/1349348392/fake-cortexa8/list.M \
+# sstate-diff/1349348392/fake-cortexa9/list.M \
+# | wc -l
+# 538
+
+# Then to compare sigdata use something like:
+# $ ls sstate-diff/1349348392/*/armv7a-vfp-neon*/linux-libc-headers/*do_configure*sigdata*
+# sstate-diff/1349348392/fake-cortexa8/armv7a-vfp-neon-oe-linux-gnueabi/linux-libc-headers/3.4.3-r0.do_configure.sigdata.cb73b3630a7b8191e72fc469c5137025
+# sstate-diff/1349348392/fake-cortexa9/armv7a-vfp-neon-oe-linux-gnueabi/linux-libc-headers/3.4.3-r0.do_configure.sigdata.f37ada177bf99ce8af85914df22b5a0b
+# $ bitbake-diffsigs stamps.1349348392/*/armv7a-vfp-neon*/linux-libc-headers/*do_configure*sigdata*
+# basehash changed from 8d0bd67bb1da6f68717760fc3ef43171 to e869fa61426e88e9c30726ba88a1216a
+# Variable TUNE_CCARGS value changed from -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 to -march=armv7-a -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9
+
+# Global vars
+tmpdir=
+machines=
+targets=
+default_machines="qemuarm qemux86 qemux86-64"
+default_targets="core-image-base"
+analyze="N"
+
+usage () {
+ cat << EOF
+Welcome to utility to compare sstate checksums between different MACHINEs.
+$0 <OPTION>
+
+Options:
+ -h, --help
+ Display this help and exit.
+
+ --tmpdir=<tmpdir>
+ Specify tmpdir, will use the environment variable TMPDIR if it is not specified.
+ Something like /OE/oe-core/tmp-eglibc (no / at the end).
+
+ --machines=<machines>
+ List of MACHINEs separated by space, will use the environment variable MACHINES if it is not specified.
+ Default value is "qemuarm qemux86 qemux86-64".
+
+ --targets=<targets>
+ List of targets separated by space, will use the environment variable TARGETS if it is not specified.
+ Default value is "core-image-base".
+
+ --analyze
+ Show the differences between MACHINEs. It assumes:
+ * First 2 MACHINEs in --machines parameter have the same TUNE_PKGARCH
+ * Third optional MACHINE has different TUNE_PKGARCH - only native and allarch recipes are compared).
+ * Next MACHINEs are ignored
+EOF
+}
+
+# Print error information and exit.
+echo_error () {
+ echo "ERROR: $1" >&2
+ exit 1
+}
+
+while [ -n "$1" ]; do
+ case $1 in
+ --tmpdir=*)
+ tmpdir=`echo $1 | sed -e 's#^--tmpdir=##' | xargs readlink -e`
+ [ -d "$tmpdir" ] || echo_error "Invalid argument to --tmpdir"
+ shift
+ ;;
+ --machines=*)
+ machines=`echo $1 | sed -e 's#^--machines="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --targets=*)
+ targets=`echo $1 | sed -e 's#^--targets="*\([^"]*\)"*#\1#'`
+ shift
+ ;;
+ --analyze)
+ analyze="Y"
+ shift
+ ;;
+ --help|-h)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid arguments $*"
+ echo_error "Try '$0 -h' for more information."
+ ;;
+ esac
+done
+
+# tmpdir directory, use environment variable TMPDIR
+# if it was not specified, otherwise, error.
+[ -n "$tmpdir" ] || tmpdir=$TMPDIR
+[ -n "$tmpdir" ] || echo_error "No tmpdir found!"
+[ -d "$tmpdir" ] || echo_error "Invalid tmpdir \"$tmpdir\""
+[ -n "$machines" ] || machines=$MACHINES
+[ -n "$machines" ] || machines=$default_machines
+[ -n "$targets" ] || targets=$TARGETS
+[ -n "$targets" ] || targets=$default_targets
+
+OUTPUT=${tmpdir}/sstate-diff/`date "+%s"`
+declare -i RESULT=0
+
+for M in ${machines}; do
+ [ -d ${tmpdir}/stamps/ ] && find ${tmpdir}/stamps/ -name \*sigdata\* | xargs rm -f
+ mkdir -p ${OUTPUT}/${M}
+ export MACHINE=${M}
+ bitbake -S none ${targets} 2>&1 | tee -a ${OUTPUT}/${M}/log;
+ RESULT+=${PIPESTATUS[0]}
+ if ls ${tmpdir}/stamps/* >/dev/null 2>/dev/null ; then
+ cp -ra ${tmpdir}/stamps/* ${OUTPUT}/${M}
+ find ${OUTPUT}/${M} -name \*sigdata\* | sed "s#${OUTPUT}/${M}/##g" | sort > ${OUTPUT}/${M}/list
+ M_UNDERSCORE=`echo ${M} | sed 's/-/_/g'`
+ sed "s/^${M_UNDERSCORE}-/MACHINE/g" ${OUTPUT}/${M}/list | sort > ${OUTPUT}/${M}/list.M
+ find ${tmpdir}/stamps/ -name \*sigdata\* | xargs rm -f
+ else
+ printf "ERROR: no sigdata files were generated for MACHINE $M in ${tmpdir}/stamps\n";
+ fi
+done
+
+function compareSignatures() {
+ MACHINE1=$1
+ MACHINE2=$2
+ PATTERN="$3"
+ PRE_PATTERN=""
+ [ -n "${PATTERN}" ] || PRE_PATTERN="-v"
+ [ -n "${PATTERN}" ] || PATTERN="MACHINE"
+ for TASK in do_configure.sigdata do_populate_sysroot.sigdata do_package_write_ipk.sigdata; do
+ printf "\n\n === Comparing signatures for task ${TASK} between ${MACHINE1} and ${MACHINE2} ===\n" | tee -a ${OUTPUT}/signatures.${MACHINE2}.${TASK}.log
+ diff ${OUTPUT}/${MACHINE1}/list.M ${OUTPUT}/${MACHINE2}/list.M | grep ${PRE_PATTERN} "${PATTERN}" | grep ${TASK} > ${OUTPUT}/signatures.${MACHINE2}.${TASK}
+ for i in `cat ${OUTPUT}/signatures.${MACHINE2}.${TASK} | sed 's#[^/]*/\([^/]*\)/.*#\1#g' | sort -u | xargs`; do
+ [ -e ${OUTPUT}/${MACHINE1}/*/$i/*${TASK}* ] || echo "INFO: ${i} task ${TASK} doesn't exist in ${MACHINE1}" >&2
+ [ -e ${OUTPUT}/${MACHINE1}/*/$i/*${TASK}* ] || continue
+ [ -e ${OUTPUT}/${MACHINE2}/*/$i/*${TASK}* ] || echo "INFO: ${i} task ${TASK} doesn't exist in ${MACHINE2}" >&2
+ [ -e ${OUTPUT}/${MACHINE2}/*/$i/*${TASK}* ] || continue
+ printf "ERROR: $i different signature for task ${TASK} between ${MACHINE1} and ${MACHINE2}\n";
+ bitbake-diffsigs ${OUTPUT}/${MACHINE1}/*/$i/*${TASK}* ${OUTPUT}/${MACHINE2}/*/$i/*${TASK}*;
+ echo "$i" >> ${OUTPUT}/failed-recipes.log
+ echo
+ done | tee -a ${OUTPUT}/signatures.${MACHINE2}.${TASK}.log
+ # don't create empty files
+ ERRORS=`grep "^ERROR.*" ${OUTPUT}/signatures.${MACHINE2}.${TASK}.log | wc -l`
+ if [ "${ERRORS}" != "0" ] ; then
+ echo "ERROR: ${ERRORS} errors found in ${OUTPUT}/signatures.${MACHINE2}.${TASK}.log"
+ RESULT+=${ERRORS}
+ fi
+ done
+}
+
+function compareMachines() {
+ [ "$#" -ge 2 ] && compareSignatures $1 $2
+ [ "$#" -ge 3 ] && compareSignatures $1 $3 "\(^< all\)\|\(^< x86_64-linux\)\|\(^< i586-linux\)"
+}
+
+if [ "${analyze}" = "Y" ] ; then
+ compareMachines ${machines}
+fi
+
+if [ "${RESULT}" != "0" -a -f ${OUTPUT}/failed-recipes.log ] ; then
+ cat ${OUTPUT}/failed-recipes.log | sort -u >${OUTPUT}/failed-recipes.log.u && mv ${OUTPUT}/failed-recipes.log.u ${OUTPUT}/failed-recipes.log
+ echo "ERROR: ${RESULT} issues were found in these recipes: `cat ${OUTPUT}/failed-recipes.log | xargs`"
+fi
+
+echo "INFO: Output written in: ${OUTPUT}"
+exit ${RESULT}
diff --git a/poky/scripts/sstate-sysroot-cruft.sh b/poky/scripts/sstate-sysroot-cruft.sh
new file mode 100755
index 000000000..d9917f515
--- /dev/null
+++ b/poky/scripts/sstate-sysroot-cruft.sh
@@ -0,0 +1,199 @@
+#!/bin/sh
+
+# Used to find files installed in sysroot which are not tracked by sstate manifest
+
+# Global vars
+tmpdir=
+
+usage () {
+ cat << EOF
+Welcome to sysroot cruft finding utility.
+$0 <OPTION>
+
+Options:
+ -h, --help
+ Display this help and exit.
+
+ --tmpdir=<tmpdir>
+ Specify tmpdir, will use the environment variable TMPDIR if it is not specified.
+ Something like /OE/oe-core/tmp-eglibc (no / at the end).
+
+ --whitelist=<whitelist-file>
+ Text file, each line is regular expression for paths we want to ignore in resulting diff.
+ You can use diff file from the script output, if it contains only expected exceptions.
+ '#' is used as regexp delimiter, so you don't need to prefix forward slashes in paths.
+ ^ and $ is automatically added, so provide only the middle part.
+ Lines starting with '#' are ignored as comments.
+ All paths are relative to "sysroots" directory.
+ Directories don't end with forward slash.
+EOF
+}
+
+# Print error information and exit.
+echo_error () {
+ echo "ERROR: $1" >&2
+ exit 1
+}
+
+while [ -n "$1" ]; do
+ case $1 in
+ --tmpdir=*)
+ tmpdir=`echo $1 | sed -e 's#^--tmpdir=##' | xargs readlink -e`
+ [ -d "$tmpdir" ] || echo_error "Invalid argument to --tmpdir"
+ shift
+ ;;
+ --whitelist=*)
+ fwhitelist=`echo $1 | sed -e 's#^--whitelist=##' | xargs readlink -e`
+ [ -f "$fwhitelist" ] || echo_error "Invalid argument to --whitelist"
+ shift
+ ;;
+ --help|-h)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Invalid arguments $*"
+ echo_error "Try '$0 -h' for more information."
+ ;;
+ esac
+done
+
+# sstate cache directory, use environment variable TMPDIR
+# if it was not specified, otherwise, error.
+[ -n "$tmpdir" ] || tmpdir=$TMPDIR
+[ -n "$tmpdir" ] || echo_error "No tmpdir found!"
+[ -d "$tmpdir" ] || echo_error "Invalid tmpdir \"$tmpdir\""
+
+OUTPUT=${tmpdir}/sysroot.cruft.`date "+%s"`
+
+# top level directories
+WHITELIST="[^/]*"
+
+# generated by base-passwd recipe
+WHITELIST="${WHITELIST} \
+ .*/etc/group-\? \
+ .*/etc/passwd-\? \
+"
+# generated by pseudo-native
+WHITELIST="${WHITELIST} \
+ .*/var/pseudo \
+ .*/var/pseudo/[^/]* \
+"
+
+# generated by package.bbclass:SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs"
+WHITELIST="${WHITELIST} \
+ .*/shlibs \
+ .*/pkgdata \
+"
+
+# generated by python
+WHITELIST="${WHITELIST} \
+ .*\.pyc \
+ .*\.pyo \
+ .*/__pycache__ \
+"
+
+# generated by lua
+WHITELIST="${WHITELIST} \
+ .*\.luac \
+"
+
+# generated by sgml-common-native
+WHITELIST="${WHITELIST} \
+ .*/etc/sgml/sgml-docbook.bak \
+"
+
+# generated by php
+WHITELIST="${WHITELIST} \
+ .*/usr/lib/php5/php/.channels \
+ .*/usr/lib/php5/php/.channels/.* \
+ .*/usr/lib/php5/php/.registry \
+ .*/usr/lib/php5/php/.registry/.* \
+ .*/usr/lib/php5/php/.depdb \
+ .*/usr/lib/php5/php/.depdblock \
+ .*/usr/lib/php5/php/.filemap \
+ .*/usr/lib/php5/php/.lock \
+"
+
+# generated by toolchain
+WHITELIST="${WHITELIST} \
+ [^/]*-tcbootstrap/lib \
+"
+
+# generated by useradd.bbclass
+WHITELIST="${WHITELIST} \
+ [^/]*/home \
+ [^/]*/home/xuser \
+ [^/]*/home/xuser/.bashrc \
+ [^/]*/home/xuser/.profile \
+ [^/]*/home/builder \
+ [^/]*/home/builder/.bashrc \
+ [^/]*/home/builder/.profile \
+"
+
+# generated by image.py for WIC
+# introduced in oe-core commit 861ce6c5d4836df1a783be3b01d2de56117c9863
+WHITELIST="${WHITELIST} \
+ [^/]*/imgdata \
+ [^/]*/imgdata/[^/]*\.env \
+"
+
+# generated by fontcache.bbclass
+WHITELIST="${WHITELIST} \
+ .*/var/cache/fontconfig/ \
+"
+
+# created by oe.utils.write_ld_so_conf which is used from few bbclasses and recipes:
+# meta/classes/image-prelink.bbclass: oe.utils.write_ld_so_conf(d)
+# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d)
+# meta/classes/insane.bbclass: oe.utils.write_ld_so_conf(d)
+# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d)
+# meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb: oe.utils.write_ld_so_conf(d)
+# introduced in oe-core commit 7fd1d7e639c2ed7e0699937a5cb245c187b7c811
+# and more visible since added to gobject-introspection in 10e0c1a3a452baa05d160a92a54b2e33cf0fd061
+WHITELIST="${WHITELIST} \
+ [^/]*/etc/ld.so.conf \
+"
+
+SYSROOTS="`readlink -f ${tmpdir}`/sysroots/"
+
+mkdir ${OUTPUT}
+find ${tmpdir}/sstate-control -name \*.populate-sysroot\* -o -name \*.populate_sysroot\* -o -name \*.package\* | xargs cat | grep sysroots | \
+ sed 's#/$##g; s#///*#/#g' | \
+ # work around for paths ending with / for directories and multiplied // (e.g. paths to native sysroot)
+ sort | sed "s#^${SYSROOTS}##g" > ${OUTPUT}/master.list.all.txt
+sort -u ${OUTPUT}/master.list.all.txt > ${OUTPUT}/master.list.txt # -u because some directories are listed for more recipes
+find ${tmpdir}/sysroots/ | \
+ sort | sed "s#^${SYSROOTS}##g" > ${OUTPUT}/sysroot.list.txt
+
+diff ${OUTPUT}/master.list.all.txt ${OUTPUT}/master.list.txt > ${OUTPUT}/duplicates.txt
+diff ${OUTPUT}/master.list.txt ${OUTPUT}/sysroot.list.txt > ${OUTPUT}/diff.all.txt
+
+grep "^> ." ${OUTPUT}/diff.all.txt | sed 's/^> //g' > ${OUTPUT}/diff.txt
+for item in ${WHITELIST}; do
+ sed -i "\\#^${item}\$#d" ${OUTPUT}/diff.txt;
+ echo "${item}" >> ${OUTPUT}/used.whitelist.txt
+done
+
+if [ -s "$fwhitelist" ] ; then
+ cat $fwhitelist >> ${OUTPUT}/used.whitelist.txt
+ cat $fwhitelist | grep -v '^#' | while read item; do
+ sed -i "\\#^${item}\$#d" ${OUTPUT}/diff.txt;
+ done
+fi
+# too many false positives for directories
+# echo "Following files are installed in sysroot at least twice"
+# cat ${OUTPUT}/duplicates
+
+RESULT=`cat ${OUTPUT}/diff.txt | wc -l`
+
+if [ "${RESULT}" != "0" ] ; then
+ echo "ERROR: ${RESULT} issues were found."
+ echo "ERROR: Following files are installed in sysroot, but not tracked by sstate:"
+ cat ${OUTPUT}/diff.txt
+else
+ echo "INFO: All files are tracked by sstate or were explicitly ignored by this script"
+fi
+
+echo "INFO: Output written in: ${OUTPUT}"
+exit ${RESULT}
diff --git a/poky/scripts/sysroot-relativelinks.py b/poky/scripts/sysroot-relativelinks.py
new file mode 100755
index 000000000..ffe254728
--- /dev/null
+++ b/poky/scripts/sysroot-relativelinks.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+import sys
+import os
+
+# Take a sysroot directory and turn all the abolute symlinks and turn them into
+# relative ones such that the sysroot is usable within another system.
+
+if len(sys.argv) != 2:
+ print("Usage is " + sys.argv[0] + "<directory>")
+ sys.exit(1)
+
+topdir = sys.argv[1]
+topdir = os.path.abspath(topdir)
+
+def handlelink(filep, subdir):
+ link = os.readlink(filep)
+ if link[0] != "/":
+ return
+ if link.startswith(topdir):
+ return
+ #print("Replacing %s with %s for %s" % (link, topdir+link, filep))
+ print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep))
+ os.unlink(filep)
+ os.symlink(os.path.relpath(topdir+link, subdir), filep)
+
+for subdir, dirs, files in os.walk(topdir):
+ for f in dirs + files:
+ filep = os.path.join(subdir, f)
+ if os.path.islink(filep):
+ #print("Considering %s" % filep)
+ handlelink(filep, subdir)
diff --git a/poky/scripts/task-time b/poky/scripts/task-time
new file mode 100755
index 000000000..e58040a9b
--- /dev/null
+++ b/poky/scripts/task-time
@@ -0,0 +1,132 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import re
+import sys
+
+arg_parser = argparse.ArgumentParser(
+ description="""
+Reports time consumed for one or more task in a format similar to the standard
+Bash 'time' builtin. Optionally sorts tasks by real (wall-clock), user (user
+space CPU), or sys (kernel CPU) time.
+""")
+
+arg_parser.add_argument(
+ "paths",
+ metavar="path",
+ nargs="+",
+ help="""
+A path containing task buildstats. If the path is a directory, e.g.
+build/tmp/buildstats, then all task found (recursively) in it will be
+processed. If the path is a single task buildstat, e.g.
+build/tmp/buildstats/20161018083535/foo-1.0-r0/do_compile, then just that
+buildstat will be processed. Multiple paths can be specified to process all of
+them. Files whose names do not start with "do_" are ignored.
+""")
+
+arg_parser.add_argument(
+ "--sort",
+ choices=("none", "real", "user", "sys"),
+ default="none",
+ help="""
+The measurement to sort the output by. Defaults to 'none', which means to sort
+by the order paths were given on the command line. For other options, tasks are
+sorted in descending order from the highest value.
+""")
+
+args = arg_parser.parse_args()
+
+# Field names and regexes for parsing out their values from buildstat files
+field_regexes = (("elapsed", ".*Elapsed time: ([0-9.]+)"),
+ ("user", "rusage ru_utime: ([0-9.]+)"),
+ ("sys", "rusage ru_stime: ([0-9.]+)"),
+ ("child user", "Child rusage ru_utime: ([0-9.]+)"),
+ ("child sys", "Child rusage ru_stime: ([0-9.]+)"))
+
+# A list of (<path>, <dict>) tuples, where <path> is the path of a do_* task
+# buildstat file and <dict> maps fields from the file to their values
+task_infos = []
+
+def save_times_for_task(path):
+ """Saves information for the buildstat file 'path' in 'task_infos'."""
+
+ if not os.path.basename(path).startswith("do_"):
+ return
+
+ with open(path) as f:
+ fields = {}
+
+ for line in f:
+ for name, regex in field_regexes:
+ match = re.match(regex, line)
+ if match:
+ fields[name] = float(match.group(1))
+ break
+
+ # Check that all expected fields were present
+ for name, regex in field_regexes:
+ if name not in fields:
+ print("Warning: Skipping '{}' because no field matching '{}' could be found"
+ .format(path, regex),
+ file=sys.stderr)
+ return
+
+ task_infos.append((path, fields))
+
+def save_times_for_dir(path):
+ """Runs save_times_for_task() for each file in path and its subdirs, recursively."""
+
+ # Raise an exception for os.walk() errors instead of ignoring them
+ def walk_onerror(e):
+ raise e
+
+ for root, _, files in os.walk(path, onerror=walk_onerror):
+ for fname in files:
+ save_times_for_task(os.path.join(root, fname))
+
+for path in args.paths:
+ if os.path.isfile(path):
+ save_times_for_task(path)
+ else:
+ save_times_for_dir(path)
+
+def elapsed_time(task_info):
+ return task_info[1]["elapsed"]
+
+def tot_user_time(task_info):
+ return task_info[1]["user"] + task_info[1]["child user"]
+
+def tot_sys_time(task_info):
+ return task_info[1]["sys"] + task_info[1]["child sys"]
+
+if args.sort != "none":
+ sort_fn = {"real": elapsed_time, "user": tot_user_time, "sys": tot_sys_time}
+ task_infos.sort(key=sort_fn[args.sort], reverse=True)
+
+first_entry = True
+
+# Catching BrokenPipeError avoids annoying errors when the output is piped into
+# e.g. 'less' or 'head' and not completely read
+try:
+ for task_info in task_infos:
+ real = elapsed_time(task_info)
+ user = tot_user_time(task_info)
+ sys = tot_sys_time(task_info)
+
+ if not first_entry:
+ print()
+ first_entry = False
+
+ # Mimic Bash's 'time' builtin
+ print("{}:\n"
+ "real\t{}m{:.3f}s\n"
+ "user\t{}m{:.3f}s\n"
+ "sys\t{}m{:.3f}s"
+ .format(task_info[0],
+ int(real//60), real%60,
+ int(user//60), user%60,
+ int(sys//60), sys%60))
+
+except BrokenPipeError:
+ pass
diff --git a/poky/scripts/test-reexec b/poky/scripts/test-reexec
new file mode 100755
index 000000000..30e792c7d
--- /dev/null
+++ b/poky/scripts/test-reexec
@@ -0,0 +1,123 @@
+#!/bin/bash
+
+# Test Script for task re-execution
+#
+# Copyright 2012 Intel Corporation
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# DESCRIPTION
+# This script is intended to address issues for re-execution of
+# tasks. The test results are saved in ./reexeclogs. Force build
+# logs are saved with prefix "force". Build failure logs are saved with
+# prefix "failed". Log files with prefix "initial" are used to save
+# initial build logs for each recipe. Log files with prefix "clean" are
+# used to save logs of clean task after testing for a recipe is finished.
+#
+
+targets=`bitbake -s | cut -d " " -f 1`
+
+LOGS=./reexeclogs
+
+mkdir -p $LOGS
+
+# Clear sstate files for specified recipe
+function clearsstate {
+ target=$1
+
+ sstate_dir=`bitbake $target -e | grep "^SSTATE_DIR=" | cut -d "\"" -f 2`
+ sstate_pkgspec=`bitbake $target -e | grep "^SSTATE_PKGSPEC=" | cut -d "\"" -f 2`
+ sstasks=`bitbake $target -e | grep "^SSTATETASKS=" | cut -d "\"" -f 2`
+
+ for sstask in $sstasks
+ do
+ sstask=${sstask:3}
+ case $sstask in
+ populate_sysroot) sstask="populate-sysroot"
+ ;;
+ populate_lic) sstask="populate-lic"
+ ;;
+ package_write_ipk) sstask="deploy-ipk"
+ ;;
+ package_write_deb) sstask="deploy-deb"
+ ;;
+ package_write_rpm) sstask="deploy-rpm"
+ ;;
+ package) sstask="package"
+ ;;
+ deploy) sstask="deploy"
+ ;;
+ *)
+ ;;
+ esac
+
+ echo "Removing ${sstate_dir}/${sstate_pkgspec}*_${sstask}.tgz* for $target"
+ rm -rf ${sstate_dir}/${sstate_pkgspec}*_${sstask}.tgz*
+ done
+}
+
+# Function to re-execute specified task of recipe
+function testit {
+ target=$1
+ task=$2
+
+ task=`echo $task | sed 's/_setscene//'`
+
+ if [ -f $LOGS/force.$target.$task ]; then
+ return
+ fi
+
+ case $task in
+ clean|build|cleansstate|cleanall|package|cleansstate2|package_write|package_write_ipk|package_write_rpm|package_write_deb|fetch|populate_lic) return;;
+ fetchall|devshell|buildall|listtasks|checkuri|checkuriall) return;;
+ esac
+
+ echo "Attempting target $target, task $task"
+ echo "Initial build"
+ bitbake $target -c cleansstate > $LOGS/initial.$target.$task
+ bitbake $target >> $LOGS/initial.$target.$task
+ clearsstate $target >> $LOGS/initial.$target.$task
+ echo "Re-execution build"
+ bitbake $target -c $task -f > $LOGS/force.$target.$task
+ if [ "$?" != 0 ]; then
+ echo "FAILURE for $target $task"
+ cp $LOGS/force.$target.$task $LOGS/failed.$target.$task
+ bitbake $target -c clean > $LOGS/clean.$target.$task
+ else
+ bitbake $target >> $LOGS/force.$target.$task
+ if [ "$?" != 0 ]; then
+ echo "FAILURE2 for $target $task"
+ cp $LOGS/force.$target.$task $LOGS/failed.$target.$task
+ bitbake $target -c clean > $LOGS/clean.$target.$task
+ fi
+ fi
+ echo "Done"
+}
+
+# Go through the recipe list and these recipes' task list
+# Then re-execute them
+for target in $targets; do
+ # Remove log messages from bitbake output
+ case $target in
+ Summary*|WARNING*|Loading*|Loaded*|Package*|=====*) continue;;
+ esac
+ tasks=`bitbake $target -c listtasks | grep ^do_ | sed s/do_//`
+ for task in $tasks; do
+ testit $target $task
+ done
+done
+
+
diff --git a/poky/scripts/test-remote-image b/poky/scripts/test-remote-image
new file mode 100755
index 000000000..27b1cae38
--- /dev/null
+++ b/poky/scripts/test-remote-image
@@ -0,0 +1,357 @@
+#!/usr/bin/env python3
+
+# Copyright (c) 2014 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# DESCRIPTION
+# This script is used to test public autobuilder images on remote hardware.
+# The script is called from a machine that is able download the images from the remote images repository and to connect to the test hardware.
+#
+# test-remote-image --image-type core-image-sato --repo-link http://192.168.10.2/images --required-packages rpm psplash
+#
+# Translation: Build the 'rpm' and 'pslash' packages and test a remote core-image-sato image using the http://192.168.10.2/images repository.
+#
+# You can also use the '-h' option to see some help information.
+
+import os
+import sys
+import argparse
+import logging
+import shutil
+from abc import ABCMeta, abstractmethod
+
+# Add path to scripts/lib in sys.path;
+scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+
+import scriptpath
+import argparse_oe
+
+# Add meta/lib to sys.path
+scriptpath.add_oe_lib_path()
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+
+# Add all lib paths relative to BBPATH to sys.path; this is used to find and import the target controllers.
+for path in get_bb_var('BBPATH').split(":"):
+ sys.path.insert(0, os.path.abspath(os.path.join(path, 'lib')))
+
+# In order to import modules that contain target controllers, we need the bitbake libraries in sys.path .
+bitbakepath = scriptpath.add_bitbake_lib_path()
+if not bitbakepath:
+ sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+ sys.exit(1)
+
+# create a logger
+def logger_create():
+ log = logging.getLogger('hwauto')
+ log.setLevel(logging.DEBUG)
+
+ fh = logging.FileHandler(filename='hwauto.log', mode='w')
+ fh.setLevel(logging.DEBUG)
+
+ ch = logging.StreamHandler(sys.stdout)
+ ch.setLevel(logging.INFO)
+
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+ ch.setFormatter(formatter)
+
+ log.addHandler(fh)
+ log.addHandler(ch)
+
+ return log
+
+# instantiate the logger
+log = logger_create()
+
+
+# Define and return the arguments parser for the script
+def get_args_parser():
+ description = "This script is used to run automated runtime tests using remotely published image files. You should prepare the build environment just like building local images and running the tests."
+ parser = argparse_oe.ArgumentParser(description=description)
+ parser.add_argument('--image-types', required=True, action="store", nargs='*', dest="image_types", default=None, help='The image types to test(ex: core-image-minimal).')
+ parser.add_argument('--repo-link', required=True, action="store", type=str, dest="repo_link", default=None, help='The link to the remote images repository.')
+ parser.add_argument('--required-packages', required=False, action="store", nargs='*', dest="required_packages", default=None, help='Required packages for the tests. They will be built before the testing begins.')
+ parser.add_argument('--targetprofile', required=False, action="store", nargs=1, dest="targetprofile", default='AutoTargetProfile', help='The target profile to be used.')
+ parser.add_argument('--repoprofile', required=False, action="store", nargs=1, dest="repoprofile", default='PublicAB', help='The repo profile to be used.')
+ parser.add_argument('--skip-download', required=False, action="store_true", dest="skip_download", default=False, help='Skip downloading the images completely. This needs the correct files to be present in the directory specified by the target profile.')
+ return parser
+
+class BaseTargetProfile(object, metaclass=ABCMeta):
+ """
+ This class defines the meta profile for a specific target (MACHINE type + image type).
+ """
+
+ def __init__(self, image_type):
+ self.image_type = image_type
+
+ self.kernel_file = None
+ self.rootfs_file = None
+ self.manifest_file = None
+ self.extra_download_files = [] # Extra files (full name) to be downloaded. They should be situated in repo_link
+
+ # This method is used as the standard interface with the target profile classes.
+ # It returns a dictionary containing a list of files and their meaning/description.
+ def get_files_dict(self):
+ files_dict = {}
+
+ if self.kernel_file:
+ files_dict['kernel_file'] = self.kernel_file
+ else:
+ log.error('The target profile did not set a kernel file.')
+ sys.exit(1)
+
+ if self.rootfs_file:
+ files_dict['rootfs_file'] = self.rootfs_file
+ else:
+ log.error('The target profile did not set a rootfs file.')
+ sys.exit(1)
+
+ if self.manifest_file:
+ files_dict['manifest_file'] = self.manifest_file
+ else:
+ log.error('The target profile did not set a manifest file.')
+ sys.exit(1)
+
+ for idx, f in enumerate(self.extra_download_files):
+ files_dict['extra_download_file' + str(idx)] = f
+
+ return files_dict
+
+class AutoTargetProfile(BaseTargetProfile):
+
+ def __init__(self, image_type):
+ super(AutoTargetProfile, self).__init__(image_type)
+ self.image_name = get_bb_var('IMAGE_LINK_NAME', target=image_type)
+ self.kernel_type = get_bb_var('KERNEL_IMAGETYPE', target=image_type)
+ self.controller = self.get_controller()
+
+ self.set_kernel_file()
+ self.set_rootfs_file()
+ self.set_manifest_file()
+ self.set_extra_download_files()
+
+ # Get the controller object that will be used by bitbake.
+ def get_controller(self):
+ from oeqa.controllers.testtargetloader import TestTargetLoader
+
+ target_controller = get_bb_var('TEST_TARGET')
+ bbpath = get_bb_var('BBPATH').split(':')
+
+ if target_controller == "qemu":
+ from oeqa.targetcontrol import QemuTarget
+ controller = QemuTarget
+ else:
+ testtargetloader = TestTargetLoader()
+ controller = testtargetloader.get_controller_module(target_controller, bbpath)
+ return controller
+
+ def set_kernel_file(self):
+ postconfig = "QA_GET_MACHINE = \"${MACHINE}\""
+ machine = get_bb_var('QA_GET_MACHINE', postconfig=postconfig)
+ self.kernel_file = self.kernel_type + '-' + machine + '.bin'
+
+ def set_rootfs_file(self):
+ image_fstypes = get_bb_var('IMAGE_FSTYPES').split(' ')
+ # Get a matching value between target's IMAGE_FSTYPES and the image fstypes suppoerted by the target controller.
+ fstype = self.controller.match_image_fstype(d=None, image_fstypes=image_fstypes)
+ if fstype:
+ self.rootfs_file = self.image_name + '.' + fstype
+ else:
+ log.error("Could not get a compatible image fstype. Check that IMAGE_FSTYPES and the target controller's supported_image_fstypes fileds have common values.")
+ sys.exit(1)
+
+ def set_manifest_file(self):
+ self.manifest_file = self.image_name + ".manifest"
+
+ def set_extra_download_files(self):
+ self.extra_download_files = self.get_controller_extra_files()
+ if not self.extra_download_files:
+ self.extra_download_files = []
+
+ def get_controller_extra_files(self):
+ controller = self.get_controller()
+ return controller.get_extra_files()
+
+
+class BaseRepoProfile(object, metaclass=ABCMeta):
+ """
+ This class defines the meta profile for an images repository.
+ """
+
+ def __init__(self, repolink, localdir):
+ self.localdir = localdir
+ self.repolink = repolink
+
+ # The following abstract methods are the interfaces to the repository profile classes derived from this abstract class.
+
+ # This method should check the file named 'file_name' if it is different than the upstream one.
+ # Should return False if the image is the same as the upstream and True if it differs.
+ @abstractmethod
+ def check_old_file(self, file_name):
+ pass
+
+ # This method should fetch file_name and create a symlink to localname if set.
+ @abstractmethod
+ def fetch(self, file_name, localname=None):
+ pass
+
+class PublicAB(BaseRepoProfile):
+
+ def __init__(self, repolink, localdir=None):
+ super(PublicAB, self).__init__(repolink, localdir)
+ if localdir is None:
+ self.localdir = os.path.join(os.environ['BUILDDIR'], 'PublicABMirror')
+
+ # Not yet implemented. Always returning True.
+ def check_old_file(self, file_name):
+ return True
+
+ def get_repo_path(self):
+ path = '/machines/'
+
+ postconfig = "QA_GET_MACHINE = \"${MACHINE}\""
+ machine = get_bb_var('QA_GET_MACHINE', postconfig=postconfig)
+ if 'qemu' in machine:
+ path += 'qemu/'
+
+ postconfig = "QA_GET_DISTRO = \"${DISTRO}\""
+ distro = get_bb_var('QA_GET_DISTRO', postconfig=postconfig)
+ path += distro.replace('poky', machine) + '/'
+ return path
+
+
+ def fetch(self, file_name, localname=None):
+ repo_path = self.get_repo_path()
+ link = self.repolink + repo_path + file_name
+
+ self.wget(link, self.localdir, localname)
+
+ def wget(self, link, localdir, localname=None, extraargs=None):
+ wget_cmd = '/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate '
+
+ if localname:
+ wget_cmd += ' -O ' + localname + ' '
+
+ if extraargs:
+ wget_cmd += ' ' + extraargs + ' '
+
+ wget_cmd += " -P %s '%s'" % (localdir, link)
+ runCmd(wget_cmd)
+
+class HwAuto():
+
+ def __init__(self, image_types, repolink, required_packages, targetprofile, repoprofile, skip_download):
+ log.info('Initializing..')
+ self.image_types = image_types
+ self.repolink = repolink
+ self.required_packages = required_packages
+ self.targetprofile = targetprofile
+ self.repoprofile = repoprofile
+ self.skip_download = skip_download
+ self.repo = self.get_repo_profile(self.repolink)
+
+ # Get the repository profile; for now we only look inside this module.
+ def get_repo_profile(self, *args, **kwargs):
+ repo = getattr(sys.modules[__name__], self.repoprofile)(*args, **kwargs)
+ log.info("Using repo profile: %s" % repo.__class__.__name__)
+ return repo
+
+ # Get the target profile; for now we only look inside this module.
+ def get_target_profile(self, *args, **kwargs):
+ target = getattr(sys.modules[__name__], self.targetprofile)(*args, **kwargs)
+ log.info("Using target profile: %s" % target.__class__.__name__)
+ return target
+
+ # Run the testimage task on a build while redirecting DEPLOY_DIR_IMAGE to repo.localdir, where the images are downloaded.
+ def runTestimageBuild(self, image_type):
+ log.info("Running the runtime tests for %s.." % image_type)
+ postconfig = "DEPLOY_DIR_IMAGE = \"%s\"" % self.repo.localdir
+ result = bitbake("%s -c testimage" % image_type, ignore_status=True, postconfig=postconfig)
+ testimage_results = ftools.read_file(os.path.join(get_bb_var("T", image_type), "log.do_testimage"))
+ log.info('Runtime tests results for %s:' % image_type)
+ print(testimage_results)
+ return result
+
+ # Start the procedure!
+ def run(self):
+ if self.required_packages:
+ # Build the required packages for the tests
+ log.info("Building the required packages: %s ." % ', '.join(map(str, self.required_packages)))
+ result = bitbake(self.required_packages, ignore_status=True)
+ if result.status != 0:
+ log.error("Could not build required packages: %s. Output: %s" % (self.required_packages, result.output))
+ sys.exit(1)
+
+ # Build the package repository meta data.
+ log.info("Building the package index.")
+ result = bitbake("package-index", ignore_status=True)
+ if result.status != 0:
+ log.error("Could not build 'package-index'. Output: %s" % result.output)
+ sys.exit(1)
+
+ # Create the directory structure for the images to be downloaded
+ log.info("Creating directory structure %s" % self.repo.localdir)
+ if not os.path.exists(self.repo.localdir):
+ os.makedirs(self.repo.localdir)
+
+ # For each image type, download the needed files and run the tests.
+ noissuesfound = True
+ for image_type in self.image_types:
+ if self.skip_download:
+ log.info("Skipping downloading the images..")
+ else:
+ target = self.get_target_profile(image_type)
+ files_dict = target.get_files_dict()
+ log.info("Downloading files for %s" % image_type)
+ for f in files_dict:
+ if self.repo.check_old_file(files_dict[f]):
+ filepath = os.path.join(self.repo.localdir, files_dict[f])
+ if os.path.exists(filepath):
+ os.remove(filepath)
+ self.repo.fetch(files_dict[f])
+
+ result = self.runTestimageBuild(image_type)
+ if result.status != 0:
+ noissuesfound = False
+
+ if noissuesfound:
+ log.info('Finished. No issues found.')
+ else:
+ log.error('Finished. Some runtime tests have failed. Returning non-0 status code.')
+ sys.exit(1)
+
+
+
+def main():
+
+ parser = get_args_parser()
+ args = parser.parse_args()
+
+ hwauto = HwAuto(image_types=args.image_types, repolink=args.repo_link, required_packages=args.required_packages, targetprofile=args.targetprofile, repoprofile=args.repoprofile, skip_download=args.skip_download)
+
+ hwauto.run()
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/tiny/dirsize.py b/poky/scripts/tiny/dirsize.py
new file mode 100755
index 000000000..ddccc5a8c
--- /dev/null
+++ b/poky/scripts/tiny/dirsize.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# Display details of the root filesystem size, broken up by directory.
+# Allows for limiting by size to focus on the larger files.
+#
+# Author: Darren Hart <dvhart@linux.intel.com>
+#
+
+import os
+import sys
+import stat
+
+class Record:
+ def create(path):
+ r = Record(path)
+
+ s = os.lstat(path)
+ if stat.S_ISDIR(s.st_mode):
+ for p in os.listdir(path):
+ pathname = path + "/" + p
+ ss = os.lstat(pathname)
+ if not stat.S_ISLNK(ss.st_mode):
+ r.records.append(Record.create(pathname))
+ r.size += r.records[-1].size
+ r.records.sort(reverse=True)
+ else:
+ r.size = os.lstat(path).st_size
+
+ return r
+ create = staticmethod(create)
+
+ def __init__(self, path):
+ self.path = path
+ self.size = 0
+ self.records = []
+
+ def __lt__(this, that):
+ if that is None:
+ return False
+ if not isinstance(that, Record):
+ raise TypeError
+ if len(this.records) > 0 and len(that.records) == 0:
+ return False
+ if this.size > that.size:
+ return False
+ return True
+
+ def show(self, minsize):
+ total = 0
+ if self.size <= minsize:
+ return 0
+ print("%10d %s" % (self.size, self.path))
+ for r in self.records:
+ total += r.show(minsize)
+ if len(self.records) == 0:
+ total = self.size
+ return total
+
+
+def main():
+ minsize = 0
+ if len(sys.argv) == 2:
+ minsize = int(sys.argv[1])
+ rootfs = Record.create(".")
+ total = rootfs.show(minsize)
+ print("Displayed %d/%d bytes (%.2f%%)" % \
+ (total, rootfs.size, 100 * float(total) / rootfs.size))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/tiny/ksize.py b/poky/scripts/tiny/ksize.py
new file mode 100755
index 000000000..ea1ca7ff2
--- /dev/null
+++ b/poky/scripts/tiny/ksize.py
@@ -0,0 +1,170 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# Display details of the kernel build size, broken up by built-in.o. Sort
+# the objects by size. Run from the top level kernel build directory.
+#
+# Author: Darren Hart <dvhart@linux.intel.com>
+#
+
+import sys
+import getopt
+import os
+from subprocess import *
+
+def usage():
+ prog = os.path.basename(sys.argv[0])
+ print('Usage: %s [OPTION]...' % prog)
+ print(' -d, display an additional level of drivers detail')
+ print(' -h, --help display this help and exit')
+ print('')
+ print('Run %s from the top-level Linux kernel build directory.' % prog)
+
+
+class Sizes:
+ def __init__(self, glob):
+ self.title = glob
+ p = Popen("size -t " + str(glob), shell=True, stdout=PIPE, stderr=PIPE)
+ output = p.communicate()[0].splitlines()
+ if len(output) > 2:
+ sizes = output[-1].split()[0:4]
+ self.text = int(sizes[0])
+ self.data = int(sizes[1])
+ self.bss = int(sizes[2])
+ self.total = int(sizes[3])
+ else:
+ self.text = self.data = self.bss = self.total = 0
+
+ def show(self, indent=""):
+ print("%-32s %10d | %10d %10d %10d" % \
+ (indent+self.title, self.total, self.text, self.data, self.bss))
+
+
+class Report:
+ def create(filename, title, subglob=None):
+ r = Report(filename, title)
+ path = os.path.dirname(filename)
+
+ p = Popen("ls " + str(path) + "/*.o | grep -v built-in.o",
+ shell=True, stdout=PIPE, stderr=PIPE)
+ glob = ' '.join(p.communicate()[0].splitlines())
+ oreport = Report(glob, str(path) + "/*.o")
+ oreport.sizes.title = str(path) + "/*.o"
+ r.parts.append(oreport)
+
+ if subglob:
+ p = Popen("ls " + subglob, shell=True, stdout=PIPE, stderr=PIPE)
+ for f in p.communicate()[0].splitlines():
+ path = os.path.dirname(f)
+ r.parts.append(Report.create(f, path, str(path) + "/*/built-in.o"))
+ r.parts.sort(reverse=True)
+
+ for b in r.parts:
+ r.totals["total"] += b.sizes.total
+ r.totals["text"] += b.sizes.text
+ r.totals["data"] += b.sizes.data
+ r.totals["bss"] += b.sizes.bss
+
+ r.deltas["total"] = r.sizes.total - r.totals["total"]
+ r.deltas["text"] = r.sizes.text - r.totals["text"]
+ r.deltas["data"] = r.sizes.data - r.totals["data"]
+ r.deltas["bss"] = r.sizes.bss - r.totals["bss"]
+ return r
+ create = staticmethod(create)
+
+ def __init__(self, glob, title):
+ self.glob = glob
+ self.title = title
+ self.sizes = Sizes(glob)
+ self.parts = []
+ self.totals = {"total":0, "text":0, "data":0, "bss":0}
+ self.deltas = {"total":0, "text":0, "data":0, "bss":0}
+
+ def show(self, indent=""):
+ rule = str.ljust(indent, 80, '-')
+ print("%-32s %10s | %10s %10s %10s" % \
+ (indent+self.title, "total", "text", "data", "bss"))
+ print(rule)
+ self.sizes.show(indent)
+ print(rule)
+ for p in self.parts:
+ if p.sizes.total > 0:
+ p.sizes.show(indent)
+ print(rule)
+ print("%-32s %10d | %10d %10d %10d" % \
+ (indent+"sum", self.totals["total"], self.totals["text"],
+ self.totals["data"], self.totals["bss"]))
+ print("%-32s %10d | %10d %10d %10d" % \
+ (indent+"delta", self.deltas["total"], self.deltas["text"],
+ self.deltas["data"], self.deltas["bss"]))
+ print("\n")
+
+ def __lt__(this, that):
+ if that is None:
+ return 1
+ if not isinstance(that, Report):
+ raise TypeError
+ return this.sizes.total < that.sizes.total
+
+ def __cmp__(this, that):
+ if that is None:
+ return 1
+ if not isinstance(that, Report):
+ raise TypeError
+ if this.sizes.total < that.sizes.total:
+ return -1
+ if this.sizes.total > that.sizes.total:
+ return 1
+ return 0
+
+
+def main():
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "dh", ["help"])
+ except getopt.GetoptError as err:
+ print('%s' % str(err))
+ usage()
+ sys.exit(2)
+
+ driver_detail = False
+ for o, a in opts:
+ if o == '-d':
+ driver_detail = True
+ elif o in ('-h', '--help'):
+ usage()
+ sys.exit(0)
+ else:
+ assert False, "unhandled option"
+
+ glob = "arch/*/built-in.o */built-in.o"
+ vmlinux = Report.create("vmlinux", "Linux Kernel", glob)
+
+ vmlinux.show()
+ for b in vmlinux.parts:
+ if b.totals["total"] > 0 and len(b.parts) > 1:
+ b.show()
+ if b.title == "drivers" and driver_detail:
+ for d in b.parts:
+ if d.totals["total"] > 0 and len(d.parts) > 1:
+ d.show(" ")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/poky/scripts/tiny/ksum.py b/poky/scripts/tiny/ksum.py
new file mode 100755
index 000000000..d4f389215
--- /dev/null
+++ b/poky/scripts/tiny/ksum.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2016, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION 'ksum.py' generates a combined summary of vmlinux and
+# module sizes for a built kernel, as a quick tool for comparing the
+# overall effects of systemic tinification changes. Execute from the
+# base directory of the kernel build you want to summarize. Setting
+# the 'verbose' flag will display the sizes for each file included in
+# the summary.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+
+__version__ = "0.1.0"
+
+# Python Standard Library modules
+import os
+import sys
+import getopt
+from subprocess import *
+
+def usage():
+ prog = os.path.basename(sys.argv[0])
+ print('Usage: %s [OPTION]...' % prog)
+ print(' -v, display sizes for each file')
+ print(' -h, --help display this help and exit')
+ print('')
+ print('Run %s from the top-level Linux kernel build directory.' % prog)
+
+verbose = False
+
+n_ko_files = 0
+ko_file_list = []
+
+ko_text = 0
+ko_data = 0
+ko_bss = 0
+ko_total = 0
+
+vmlinux_file = ""
+vmlinux_level = 0
+
+vmlinux_text = 0
+vmlinux_data = 0
+vmlinux_bss = 0
+vmlinux_total = 0
+
+def is_vmlinux_file(filename):
+ global vmlinux_level
+ if filename == ("vmlinux") and vmlinux_level == 0:
+ vmlinux_level += 1
+ return True
+ return False
+
+def is_ko_file(filename):
+ if filename.endswith(".ko"):
+ return True
+ return False
+
+def collect_object_files():
+ print "Collecting object files recursively from %s..." % os.getcwd()
+ for dirpath, dirs, files in os.walk(os.getcwd()):
+ for filename in files:
+ if is_ko_file(filename):
+ ko_file_list.append(os.path.join(dirpath, filename))
+ elif is_vmlinux_file(filename):
+ global vmlinux_file
+ vmlinux_file = os.path.join(dirpath, filename)
+ print "Collecting object files [DONE]"
+
+def add_ko_file(filename):
+ p = Popen("size -t " + filename, shell=True, stdout=PIPE, stderr=PIPE)
+ output = p.communicate()[0].splitlines()
+ if len(output) > 2:
+ sizes = output[-1].split()[0:4]
+ if verbose:
+ print " %10d %10d %10d %10d\t" % \
+ (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+ print "%s" % filename[len(os.getcwd()) + 1:]
+ global n_ko_files, ko_text, ko_data, ko_bss, ko_total
+ ko_text += int(sizes[0])
+ ko_data += int(sizes[1])
+ ko_bss += int(sizes[2])
+ ko_total += int(sizes[3])
+ n_ko_files += 1
+
+def get_vmlinux_totals():
+ p = Popen("size -t " + vmlinux_file, shell=True, stdout=PIPE, stderr=PIPE)
+ output = p.communicate()[0].splitlines()
+ if len(output) > 2:
+ sizes = output[-1].split()[0:4]
+ if verbose:
+ print " %10d %10d %10d %10d\t" % \
+ (int(sizes[0]), int(sizes[1]), int(sizes[2]), int(sizes[3])),
+ print "%s" % vmlinux_file[len(os.getcwd()) + 1:]
+ global vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total
+ vmlinux_text += int(sizes[0])
+ vmlinux_data += int(sizes[1])
+ vmlinux_bss += int(sizes[2])
+ vmlinux_total += int(sizes[3])
+
+def sum_ko_files():
+ for ko_file in ko_file_list:
+ add_ko_file(ko_file)
+
+def main():
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "vh", ["help"])
+ except getopt.GetoptError as err:
+ print('%s' % str(err))
+ usage()
+ sys.exit(2)
+
+ for o, a in opts:
+ if o == '-v':
+ global verbose
+ verbose = True
+ elif o in ('-h', '--help'):
+ usage()
+ sys.exit(0)
+ else:
+ assert False, "unhandled option"
+
+ collect_object_files()
+ sum_ko_files()
+ get_vmlinux_totals()
+
+ print "\nTotals:"
+ print "\nvmlinux:"
+ print " text\tdata\t\tbss\t\ttotal"
+ print " %-10d\t%-10d\t%-10d\t%-10d" % \
+ (vmlinux_text, vmlinux_data, vmlinux_bss, vmlinux_total)
+ print "\nmodules (%d):" % n_ko_files
+ print " text\tdata\t\tbss\t\ttotal"
+ print " %-10d\t%-10d\t%-10d\t%-10d" % \
+ (ko_text, ko_data, ko_bss, ko_total)
+ print "\nvmlinux + modules:"
+ print " text\tdata\t\tbss\t\ttotal"
+ print " %-10d\t%-10d\t%-10d\t%-10d" % \
+ (vmlinux_text + ko_text, vmlinux_data + ko_data, \
+ vmlinux_bss + ko_bss, vmlinux_total + ko_total)
+
+if __name__ == "__main__":
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc(5)
+ sys.exit(ret)
diff --git a/poky/scripts/verify-bashisms b/poky/scripts/verify-bashisms
new file mode 100755
index 000000000..a979bd296
--- /dev/null
+++ b/poky/scripts/verify-bashisms
@@ -0,0 +1,155 @@
+#!/usr/bin/env python3
+
+import sys, os, subprocess, re, shutil
+
+whitelist = (
+ # type is supported by dash
+ 'if type systemctl >/dev/null 2>/dev/null; then',
+ 'if type systemd-tmpfiles >/dev/null 2>/dev/null; then',
+ 'type update-rc.d >/dev/null 2>/dev/null; then',
+ 'command -v',
+ # HOSTNAME is set locally
+ 'buildhistory_single_commit "$CMDLINE" "$HOSTNAME"',
+ # False-positive, match is a grep not shell expression
+ 'grep "^$groupname:[^:]*:[^:]*:\\([^,]*,\\)*$username\\(,[^,]*\\)*"',
+ # TODO verify dash's '. script args' behaviour
+ '. $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE'
+ )
+
+def is_whitelisted(s):
+ for w in whitelist:
+ if w in s:
+ return True
+ return False
+
+SCRIPT_LINENO_RE = re.compile(r' line (\d+) ')
+BASHISM_WARNING = re.compile(r'^(possible bashism in.*)$', re.MULTILINE)
+
+def process(filename, function, lineno, script):
+ import tempfile
+
+ if not script.startswith("#!"):
+ script = "#! /bin/sh\n" + script
+
+ fn = tempfile.NamedTemporaryFile(mode="w+t")
+ fn.write(script)
+ fn.flush()
+
+ try:
+ subprocess.check_output(("checkbashisms.pl", fn.name), universal_newlines=True, stderr=subprocess.STDOUT)
+ # No bashisms, so just return
+ return
+ except subprocess.CalledProcessError as e:
+ # TODO check exit code is 1
+
+ # Replace the temporary filename with the function and split it
+ output = e.output.replace(fn.name, function)
+ if not output or not output.startswith('possible bashism'):
+ # Probably starts with or contains only warnings. Dump verbatim
+ # with one space indention. Can't do the splitting and whitelist
+ # checking below.
+ return '\n'.join([filename,
+ ' Unexpected output from checkbashisms.pl'] +
+ [' ' + x for x in output.splitlines()])
+
+ # We know that the first line matches and that therefore the first
+ # list entry will be empty - skip it.
+ output = BASHISM_WARNING.split(output)[1:]
+ # Turn the output into a single string like this:
+ # /.../foobar.bb
+ # possible bashism in updatercd_postrm line 2 (type):
+ # if ${@use_updatercd(d)} && type update-rc.d >/dev/null 2>/dev/null; then
+ # ...
+ # ...
+ result = []
+ # Check the results against the whitelist
+ for message, source in zip(output[0::2], output[1::2]):
+ if not is_whitelisted(source):
+ if lineno is not None:
+ message = SCRIPT_LINENO_RE.sub(lambda m: ' line %d ' % (int(m.group(1)) + int(lineno) - 1),
+ message)
+ result.append(' ' + message.strip())
+ result.extend([' %s' % x for x in source.splitlines()])
+ if result:
+ result.insert(0, filename)
+ return '\n'.join(result)
+ else:
+ return None
+
+def get_tinfoil():
+ scripts_path = os.path.dirname(os.path.realpath(__file__))
+ lib_path = scripts_path + '/lib'
+ sys.path = sys.path + [lib_path]
+ import scriptpath
+ scriptpath.add_bitbake_lib_path()
+ import bb.tinfoil
+ tinfoil = bb.tinfoil.Tinfoil()
+ tinfoil.prepare()
+ # tinfoil.logger.setLevel(logging.WARNING)
+ return tinfoil
+
+if __name__=='__main__':
+ import argparse, shutil
+
+ parser = argparse.ArgumentParser(description='Bashim detector for shell fragments in recipes.')
+ parser.add_argument("recipes", metavar="RECIPE", nargs="*", help="recipes to check (if not specified, all will be checked)")
+ parser.add_argument("--verbose", default=False, action="store_true")
+ args = parser.parse_args()
+
+ if shutil.which("checkbashisms.pl") is None:
+ print("Cannot find checkbashisms.pl on $PATH, get it from https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl")
+ sys.exit(1)
+
+ # The order of defining the worker function,
+ # initializing the pool and connecting to the
+ # bitbake server is crucial, don't change it.
+ def func(item):
+ (filename, key, lineno), script = item
+ if args.verbose:
+ print("Scanning %s:%s" % (filename, key))
+ return process(filename, key, lineno, script)
+
+ import multiprocessing
+ pool = multiprocessing.Pool()
+
+ tinfoil = get_tinfoil()
+
+ # This is only the default configuration and should iterate over
+ # recipecaches to handle multiconfig environments
+ pkg_pn = tinfoil.cooker.recipecaches[""].pkg_pn
+
+ if args.recipes:
+ initial_pns = args.recipes
+ else:
+ initial_pns = sorted(pkg_pn)
+
+ pns = set()
+ scripts = {}
+ print("Generating scripts...")
+ for pn in initial_pns:
+ for fn in pkg_pn[pn]:
+ # There's no point checking multiple BBCLASSEXTENDed variants of the same recipe
+ # (at least in general - there is some risk that the variants contain different scripts)
+ realfn, _, _ = bb.cache.virtualfn2realfn(fn)
+ if realfn not in pns:
+ pns.add(realfn)
+ data = tinfoil.parse_recipe_file(realfn)
+ for key in data.keys():
+ if data.getVarFlag(key, "func") and not data.getVarFlag(key, "python"):
+ script = data.getVar(key, False)
+ if script:
+ filename = data.getVarFlag(key, "filename")
+ lineno = data.getVarFlag(key, "lineno")
+ # There's no point in checking a function multiple
+ # times just because different recipes include it.
+ # We identify unique scripts by file, name, and (just in case)
+ # line number.
+ attributes = (filename or realfn, key, lineno)
+ scripts.setdefault(attributes, script)
+
+
+ print("Scanning scripts...\n")
+ for result in pool.imap(func, scripts.items()):
+ if result:
+ print(result)
+ tinfoil.shutdown()
diff --git a/poky/scripts/wic b/poky/scripts/wic
new file mode 100755
index 000000000..7392bc4e7
--- /dev/null
+++ b/poky/scripts/wic
@@ -0,0 +1,542 @@
+#!/usr/bin/env python3
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2013, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# DESCRIPTION 'wic' is the OpenEmbedded Image Creator that users can
+# use to generate bootable images. Invoking it without any arguments
+# will display help screens for the 'wic' command and list the
+# available 'wic' subcommands. Invoking a subcommand without any
+# arguments will likewise display help screens for the specified
+# subcommand. Please use that interface for detailed help.
+#
+# AUTHORS
+# Tom Zanussi <tom.zanussi (at] linux.intel.com>
+#
+__version__ = "0.2.0"
+
+# Python Standard Library modules
+import os
+import sys
+import argparse
+import logging
+
+from collections import namedtuple
+from distutils import spawn
+
+# External modules
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path.insert(0, lib_path)
+import scriptpath
+scriptpath.add_oe_lib_path()
+
+# Check whether wic is running within eSDK environment
+sdkroot = scripts_path
+if os.environ.get('SDKTARGETSYSROOT'):
+ while sdkroot != '' and sdkroot != os.sep:
+ if os.path.exists(os.path.join(sdkroot, '.devtoolbase')):
+ # Set BUILDDIR for wic to work within eSDK
+ os.environ['BUILDDIR'] = sdkroot
+ # .devtoolbase only exists within eSDK
+ # If found, initialize bitbake path for eSDK environment and append to PATH
+ sdkroot = os.path.join(os.path.dirname(scripts_path), 'bitbake', 'bin')
+ os.environ['PATH'] += ":" + sdkroot
+ break
+ sdkroot = os.path.dirname(sdkroot)
+
+bitbake_exe = spawn.find_executable('bitbake')
+if bitbake_exe:
+ bitbake_path = scriptpath.add_bitbake_lib_path()
+ from bb import cookerdata
+ from bb.main import bitbake_main, BitBakeConfigParameters
+else:
+ bitbake_main = None
+
+from wic import WicError
+from wic.misc import get_bitbake_var, BB_VARS
+from wic import engine
+from wic import help as hlp
+
+
+def wic_logger():
+ """Create and convfigure wic logger."""
+ logger = logging.getLogger('wic')
+ logger.setLevel(logging.INFO)
+
+ handler = logging.StreamHandler()
+
+ formatter = logging.Formatter('%(levelname)s: %(message)s')
+ handler.setFormatter(formatter)
+
+ logger.addHandler(handler)
+
+ return logger
+
+logger = wic_logger()
+
+def rootfs_dir_to_args(krootfs_dir):
+ """
+ Get a rootfs_dir dict and serialize to string
+ """
+ rootfs_dir = ''
+ for key, val in krootfs_dir.items():
+ rootfs_dir += ' '
+ rootfs_dir += '='.join([key, val])
+ return rootfs_dir.strip()
+
+
+class RootfsArgAction(argparse.Action):
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+
+ def __call__(self, parser, namespace, value, option_string=None):
+ if not "rootfs_dir" in vars(namespace) or \
+ not type(namespace.__dict__['rootfs_dir']) is dict:
+ namespace.__dict__['rootfs_dir'] = {}
+
+ if '=' in value:
+ (key, rootfs_dir) = value.split('=')
+ else:
+ key = 'ROOTFS_DIR'
+ rootfs_dir = value
+
+ namespace.__dict__['rootfs_dir'][key] = rootfs_dir
+
+
+def wic_create_subcommand(options, usage_str):
+ """
+ Command-line handling for image creation. The real work is done
+ by image.engine.wic_create()
+ """
+ if options.build_rootfs and not bitbake_main:
+ raise WicError("Can't build rootfs as bitbake is not in the $PATH")
+
+ if not options.image_name:
+ missed = []
+ for val, opt in [(options.rootfs_dir, 'rootfs-dir'),
+ (options.bootimg_dir, 'bootimg-dir'),
+ (options.kernel_dir, 'kernel-dir'),
+ (options.native_sysroot, 'native-sysroot')]:
+ if not val:
+ missed.append(opt)
+ if missed:
+ raise WicError("The following build artifacts are not specified: %s" %
+ ", ".join(missed))
+
+ if options.image_name:
+ BB_VARS.default_image = options.image_name
+ else:
+ options.build_check = False
+
+ if options.vars_dir:
+ BB_VARS.vars_dir = options.vars_dir
+
+ if options.build_check and not engine.verify_build_env():
+ raise WicError("Couldn't verify build environment, exiting")
+
+ if options.debug:
+ logger.setLevel(logging.DEBUG)
+
+ if options.image_name:
+ if options.build_rootfs:
+ argv = ["bitbake", options.image_name]
+ if options.debug:
+ argv.append("--debug")
+
+ logger.info("Building rootfs...\n")
+ if bitbake_main(BitBakeConfigParameters(argv),
+ cookerdata.CookerConfiguration()):
+ raise WicError("bitbake exited with error")
+
+ rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
+ kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
+ bootimg_dir = get_bitbake_var("STAGING_DATADIR", options.image_name)
+
+ native_sysroot = options.native_sysroot
+ if options.vars_dir and not native_sysroot:
+ native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE", options.image_name)
+ else:
+ if options.build_rootfs:
+ raise WicError("Image name is not specified, exiting. "
+ "(Use -e/--image-name to specify it)")
+ native_sysroot = options.native_sysroot
+
+ if not options.vars_dir and (not native_sysroot or not os.path.isdir(native_sysroot)):
+ logger.info("Building wic-tools...\n")
+ if bitbake_main(BitBakeConfigParameters("bitbake wic-tools".split()),
+ cookerdata.CookerConfiguration()):
+ raise WicError("bitbake wic-tools failed")
+ native_sysroot = get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools")
+
+ if not native_sysroot:
+ raise WicError("Unable to find the location of the native tools sysroot")
+
+ wks_file = options.wks_file
+
+ if not wks_file.endswith(".wks"):
+ wks_file = engine.find_canned_image(scripts_path, wks_file)
+ if not wks_file:
+ raise WicError("No image named %s found, exiting. (Use 'wic list images' "
+ "to list available images, or specify a fully-qualified OE "
+ "kickstart (.wks) filename)" % options.wks_file)
+
+ if not options.image_name:
+ rootfs_dir = ''
+ if 'ROOTFS_DIR' in options.rootfs_dir:
+ rootfs_dir = options.rootfs_dir['ROOTFS_DIR']
+ bootimg_dir = options.bootimg_dir
+ kernel_dir = options.kernel_dir
+ native_sysroot = options.native_sysroot
+ if rootfs_dir and not os.path.isdir(rootfs_dir):
+ raise WicError("--rootfs-dir (-r) not found, exiting")
+ if not os.path.isdir(bootimg_dir):
+ raise WicError("--bootimg-dir (-b) not found, exiting")
+ if not os.path.isdir(kernel_dir):
+ raise WicError("--kernel-dir (-k) not found, exiting")
+ if not os.path.isdir(native_sysroot):
+ raise WicError("--native-sysroot (-n) not found, exiting")
+ else:
+ not_found = not_found_dir = ""
+ if not os.path.isdir(rootfs_dir):
+ (not_found, not_found_dir) = ("rootfs-dir", rootfs_dir)
+ elif not os.path.isdir(kernel_dir):
+ (not_found, not_found_dir) = ("kernel-dir", kernel_dir)
+ elif not os.path.isdir(native_sysroot):
+ (not_found, not_found_dir) = ("native-sysroot", native_sysroot)
+ if not_found:
+ if not not_found_dir:
+ not_found_dir = "Completely missing artifact - wrong image (.wks) used?"
+ logger.info("Build artifacts not found, exiting.")
+ logger.info(" (Please check that the build artifacts for the machine")
+ logger.info(" selected in local.conf actually exist and that they")
+ logger.info(" are the correct artifacts for the image (.wks file)).\n")
+ raise WicError("The artifact that couldn't be found was %s:\n %s", not_found, not_found_dir)
+
+ krootfs_dir = options.rootfs_dir
+ if krootfs_dir is None:
+ krootfs_dir = {}
+ krootfs_dir['ROOTFS_DIR'] = rootfs_dir
+
+ rootfs_dir = rootfs_dir_to_args(krootfs_dir)
+
+ logger.info("Creating image(s)...\n")
+ engine.wic_create(wks_file, rootfs_dir, bootimg_dir, kernel_dir,
+ native_sysroot, options)
+
+
+def wic_list_subcommand(args, usage_str):
+ """
+ Command-line handling for listing available images.
+ The real work is done by image.engine.wic_list()
+ """
+ if not engine.wic_list(args, scripts_path):
+ raise WicError("Bad list arguments, exiting")
+
+
+def wic_ls_subcommand(args, usage_str):
+ """
+ Command-line handling for list content of images.
+ The real work is done by engine.wic_ls()
+ """
+ engine.wic_ls(args, args.native_sysroot)
+
+def wic_cp_subcommand(args, usage_str):
+ """
+ Command-line handling for copying files/dirs to images.
+ The real work is done by engine.wic_cp()
+ """
+ engine.wic_cp(args, args.native_sysroot)
+
+def wic_rm_subcommand(args, usage_str):
+ """
+ Command-line handling for removing files/dirs from images.
+ The real work is done by engine.wic_rm()
+ """
+ engine.wic_rm(args, args.native_sysroot)
+
+def wic_write_subcommand(args, usage_str):
+ """
+ Command-line handling for writing images.
+ The real work is done by engine.wic_write()
+ """
+ engine.wic_write(args, args.native_sysroot)
+
+def wic_help_subcommand(args, usage_str):
+ """
+ Command-line handling for help subcommand to keep the current
+ structure of the function definitions.
+ """
+ pass
+
+
+def wic_help_topic_subcommand(usage_str, help_str):
+ """
+ Display function for help 'sub-subcommands'.
+ """
+ print(help_str)
+ return
+
+
+wic_help_topic_usage = """
+"""
+
+helptopics = {
+ "plugins": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_plugins_help],
+ "overview": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_overview_help],
+ "kickstart": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_kickstart_help],
+ "create": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_create_help],
+ "ls": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_ls_help],
+ "cp": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_cp_help],
+ "rm": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_rm_help],
+ "write": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_write_help],
+ "list": [wic_help_topic_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_list_help]
+}
+
+
+def wic_init_parser_create(subparser):
+ subparser.add_argument("wks_file")
+
+ subparser.add_argument("-o", "--outdir", dest="outdir", default='.',
+ help="name of directory to create image in")
+ subparser.add_argument("-e", "--image-name", dest="image_name",
+ help="name of the image to use the artifacts from "
+ "e.g. core-image-sato")
+ subparser.add_argument("-r", "--rootfs-dir", action=RootfsArgAction,
+ help="path to the /rootfs dir to use as the "
+ ".wks rootfs source")
+ subparser.add_argument("-b", "--bootimg-dir", dest="bootimg_dir",
+ help="path to the dir containing the boot artifacts "
+ "(e.g. /EFI or /syslinux dirs) to use as the "
+ ".wks bootimg source")
+ subparser.add_argument("-k", "--kernel-dir", dest="kernel_dir",
+ help="path to the dir containing the kernel to use "
+ "in the .wks bootimg")
+ subparser.add_argument("-n", "--native-sysroot", dest="native_sysroot",
+ help="path to the native sysroot containing the tools "
+ "to use to build the image")
+ subparser.add_argument("-s", "--skip-build-check", dest="build_check",
+ action="store_false", default=True, help="skip the build check")
+ subparser.add_argument("-f", "--build-rootfs", action="store_true", help="build rootfs")
+ subparser.add_argument("-c", "--compress-with", choices=("gzip", "bzip2", "xz"),
+ dest='compressor',
+ help="compress image with specified compressor")
+ subparser.add_argument("-m", "--bmap", action="store_true", help="generate .bmap")
+ subparser.add_argument("--no-fstab-update" ,action="store_true",
+ help="Do not change fstab file.")
+ subparser.add_argument("-v", "--vars", dest='vars_dir',
+ help="directory with <image>.env files that store "
+ "bitbake variables")
+ subparser.add_argument("-D", "--debug", dest="debug", action="store_true",
+ default=False, help="output debug information")
+ return
+
+
+def wic_init_parser_list(subparser):
+ subparser.add_argument("list_type",
+ help="can be 'images' or 'source-plugins' "
+ "to obtain a list. "
+ "If value is a valid .wks image file")
+ subparser.add_argument("help_for", default=[], nargs='*',
+ help="If 'list_type' is a valid .wks image file "
+ "this value can be 'help' to show the help information "
+ "defined inside the .wks file")
+ return
+
+def imgtype(arg):
+ """
+ Custom type for ArgumentParser
+ Converts path spec to named tuple: (image, partition, path)
+ """
+ image = arg
+ part = path = None
+ if ':' in image:
+ image, part = image.split(':')
+ if '/' in part:
+ part, path = part.split('/', 1)
+ if not path:
+ path = '/'
+
+ if not os.path.isfile(image):
+ err = "%s is not a regular file or symlink" % image
+ raise argparse.ArgumentTypeError(err)
+
+ return namedtuple('ImgType', 'image part path')(image, part, path)
+
+def wic_init_parser_ls(subparser):
+ subparser.add_argument("path", type=imgtype,
+ help="image spec: <image>[:<vfat partition>[<path>]]")
+ subparser.add_argument("-n", "--native-sysroot",
+ help="path to the native sysroot containing the tools")
+
+def imgpathtype(arg):
+ img = imgtype(arg)
+ if img.part is None:
+ raise argparse.ArgumentTypeError("partition number is not specified")
+ return img
+
+def wic_init_parser_cp(subparser):
+ subparser.add_argument("src",
+ help="source spec")
+ subparser.add_argument("dest", type=imgpathtype,
+ help="image spec: <image>:<vfat partition>[<path>]")
+ subparser.add_argument("-n", "--native-sysroot",
+ help="path to the native sysroot containing the tools")
+
+def wic_init_parser_rm(subparser):
+ subparser.add_argument("path", type=imgpathtype,
+ help="path: <image>:<vfat partition><path>")
+ subparser.add_argument("-n", "--native-sysroot",
+ help="path to the native sysroot containing the tools")
+
+def expandtype(rules):
+ """
+ Custom type for ArgumentParser
+ Converts expand rules to the dictionary {<partition>: size}
+ """
+ if rules == 'auto':
+ return {}
+ result = {}
+ for rule in rules.split('-'):
+ try:
+ part, size = rule.split(':')
+ except ValueError:
+ raise argparse.ArgumentTypeError("Incorrect rule format: %s" % rule)
+
+ if not part.isdigit():
+ raise argparse.ArgumentTypeError("Rule '%s': partition number must be integer" % rule)
+
+ # validate size
+ multiplier = 1
+ for suffix, mult in [('K', 1024), ('M', 1024 * 1024), ('G', 1024 * 1024 * 1024)]:
+ if size.upper().endswith(suffix):
+ multiplier = mult
+ size = size[:-1]
+ break
+ if not size.isdigit():
+ raise argparse.ArgumentTypeError("Rule '%s': size must be integer" % rule)
+
+ result[int(part)] = int(size) * multiplier
+
+ return result
+
+def wic_init_parser_write(subparser):
+ subparser.add_argument("image",
+ help="path to the wic image")
+ subparser.add_argument("target",
+ help="target file or device")
+ subparser.add_argument("-e", "--expand", type=expandtype,
+ help="expand rules: auto or <partition>:<size>[,<partition>:<size>]")
+ subparser.add_argument("-n", "--native-sysroot",
+ help="path to the native sysroot containing the tools")
+
+def wic_init_parser_help(subparser):
+ helpparsers = subparser.add_subparsers(dest='help_topic', help=hlp.wic_usage)
+ for helptopic in helptopics:
+ helpparsers.add_parser(helptopic, help=helptopics[helptopic][2])
+ return
+
+
+subcommands = {
+ "create": [wic_create_subcommand,
+ hlp.wic_create_usage,
+ hlp.wic_create_help,
+ wic_init_parser_create],
+ "list": [wic_list_subcommand,
+ hlp.wic_list_usage,
+ hlp.wic_list_help,
+ wic_init_parser_list],
+ "ls": [wic_ls_subcommand,
+ hlp.wic_ls_usage,
+ hlp.wic_ls_help,
+ wic_init_parser_ls],
+ "cp": [wic_cp_subcommand,
+ hlp.wic_cp_usage,
+ hlp.wic_cp_help,
+ wic_init_parser_cp],
+ "rm": [wic_rm_subcommand,
+ hlp.wic_rm_usage,
+ hlp.wic_rm_help,
+ wic_init_parser_rm],
+ "write": [wic_write_subcommand,
+ hlp.wic_write_usage,
+ hlp.wic_write_help,
+ wic_init_parser_write],
+ "help": [wic_help_subcommand,
+ wic_help_topic_usage,
+ hlp.wic_help_help,
+ wic_init_parser_help]
+}
+
+
+def init_parser(parser):
+ parser.add_argument("--version", action="version",
+ version="%(prog)s {version}".format(version=__version__))
+ subparsers = parser.add_subparsers(dest='command', help=hlp.wic_usage)
+ for subcmd in subcommands:
+ subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2])
+ subcommands[subcmd][3](subparser)
+
+
+def main(argv):
+ parser = argparse.ArgumentParser(
+ description="wic version %s" % __version__)
+
+ init_parser(parser)
+
+ args = parser.parse_args(argv)
+
+ if "command" in vars(args):
+ if args.command == "help":
+ if args.help_topic is None:
+ parser.print_help()
+ print()
+ print("Please specify a help topic")
+ elif args.help_topic in helptopics:
+ hlpt = helptopics[args.help_topic]
+ hlpt[0](hlpt[1], hlpt[2])
+ return 0
+
+ return hlp.invoke_subcommand(args, parser, hlp.wic_help_usage, subcommands)
+
+
+if __name__ == "__main__":
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except WicError as err:
+ print()
+ logger.error(err)
+ sys.exit(1)
diff --git a/poky/scripts/yocto-check-layer b/poky/scripts/yocto-check-layer
new file mode 100755
index 000000000..5a4fd752c
--- /dev/null
+++ b/poky/scripts/yocto-check-layer
@@ -0,0 +1,208 @@
+#!/usr/bin/env python3
+
+# Yocto Project layer checking tool
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+import os
+import sys
+import argparse
+import logging
+import time
+import signal
+import shutil
+import collections
+
+scripts_path = os.path.dirname(os.path.realpath(__file__))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+import scriptutils
+import scriptpath
+scriptpath.add_oe_lib_path()
+scriptpath.add_bitbake_lib_path()
+
+from checklayer import LayerType, detect_layers, add_layer, add_layer_dependencies, get_signatures
+from oeqa.utils.commands import get_bb_vars
+
+PROGNAME = 'yocto-check-layer'
+CASES_PATHS = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
+ 'lib', 'checklayer', 'cases')]
+logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout)
+
+def test_layer(td, layer, test_software_layer_signatures):
+ from checklayer.context import CheckLayerTestContext
+ logger.info("Starting to analyze: %s" % layer['name'])
+ logger.info("----------------------------------------------------------------------")
+
+ tc = CheckLayerTestContext(td=td, logger=logger, layer=layer, test_software_layer_signatures=test_software_layer_signatures)
+ tc.loadTests(CASES_PATHS)
+ return tc.runTests()
+
+def main():
+ parser = argparse.ArgumentParser(
+ description="Yocto Project layer checking tool",
+ add_help=False)
+ parser.add_argument('layers', metavar='LAYER_DIR', nargs='+',
+ help='Layer to check')
+ parser.add_argument('-o', '--output-log',
+ help='File to output log (optional)', action='store')
+ parser.add_argument('--dependency', nargs="+",
+ help='Layers to process for dependencies', action='store')
+ parser.add_argument('--machines', nargs="+",
+ help='List of MACHINEs to be used during testing', action='store')
+ parser.add_argument('--additional-layers', nargs="+",
+ help='List of additional layers to add during testing', action='store')
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('--with-software-layer-signature-check', action='store_true', dest='test_software_layer_signatures',
+ default=True,
+ help='check that software layers do not change signatures (on by default)')
+ group.add_argument('--without-software-layer-signature-check', action='store_false', dest='test_software_layer_signatures',
+ help='disable signature checking for software layers')
+ parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery',
+ action='store_true')
+ parser.add_argument('-d', '--debug', help='Enable debug output',
+ action='store_true')
+ parser.add_argument('-q', '--quiet', help='Print only errors',
+ action='store_true')
+
+ parser.add_argument('-h', '--help', action='help',
+ default=argparse.SUPPRESS,
+ help='show this help message and exit')
+
+ args = parser.parse_args()
+
+ if args.output_log:
+ fh = logging.FileHandler(args.output_log)
+ fh.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+ logger.addHandler(fh)
+ if args.debug:
+ logger.setLevel(logging.DEBUG)
+ elif args.quiet:
+ logger.setLevel(logging.ERROR)
+
+ if not 'BUILDDIR' in os.environ:
+ logger.error("You must source the environment before run this script.")
+ logger.error("$ source oe-init-build-env")
+ return 1
+ builddir = os.environ['BUILDDIR']
+ bblayersconf = os.path.join(builddir, 'conf', 'bblayers.conf')
+
+ layers = detect_layers(args.layers, args.no_auto)
+ if not layers:
+ logger.error("Fail to detect layers")
+ return 1
+ if args.additional_layers:
+ additional_layers = detect_layers(args.additional_layers, args.no_auto)
+ else:
+ additional_layers = []
+ if args.dependency:
+ dep_layers = detect_layers(args.dependency, args.no_auto)
+ dep_layers = dep_layers + layers
+ else:
+ dep_layers = layers
+
+ logger.info("Detected layers:")
+ for layer in layers:
+ if layer['type'] == LayerType.ERROR_BSP_DISTRO:
+ logger.error("%s: Can't be DISTRO and BSP type at the same time."\
+ " The conf/distro and conf/machine folders was found."\
+ % layer['name'])
+ layers.remove(layer)
+ elif layer['type'] == LayerType.ERROR_NO_LAYER_CONF:
+ logger.error("%s: Don't have conf/layer.conf file."\
+ % layer['name'])
+ layers.remove(layer)
+ else:
+ logger.info("%s: %s, %s" % (layer['name'], layer['type'],
+ layer['path']))
+ if not layers:
+ return 1
+
+ shutil.copyfile(bblayersconf, bblayersconf + '.backup')
+ def cleanup_bblayers(signum, frame):
+ shutil.copyfile(bblayersconf + '.backup', bblayersconf)
+ os.unlink(bblayersconf + '.backup')
+ signal.signal(signal.SIGTERM, cleanup_bblayers)
+ signal.signal(signal.SIGINT, cleanup_bblayers)
+
+ td = {}
+ results = collections.OrderedDict()
+ results_status = collections.OrderedDict()
+
+ layers_tested = 0
+ for layer in layers:
+ if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \
+ layer['type'] == LayerType.ERROR_BSP_DISTRO:
+ continue
+
+ logger.info('')
+ logger.info("Setting up for %s(%s), %s" % (layer['name'], layer['type'],
+ layer['path']))
+
+ shutil.copyfile(bblayersconf + '.backup', bblayersconf)
+
+ missing_dependencies = not add_layer_dependencies(bblayersconf, layer, dep_layers, logger)
+ if not missing_dependencies:
+ for additional_layer in additional_layers:
+ if not add_layer_dependencies(bblayersconf, additional_layer, dep_layers, logger):
+ missing_dependencies = True
+ break
+ if not add_layer_dependencies(bblayersconf, layer, dep_layers, logger) or \
+ any(map(lambda additional_layer: not add_layer_dependencies(bblayersconf, additional_layer, dep_layers, logger),
+ additional_layers)):
+ logger.info('Skipping %s due to missing dependencies.' % layer['name'])
+ results[layer['name']] = None
+ results_status[layer['name']] = 'SKIPPED (Missing dependencies)'
+ layers_tested = layers_tested + 1
+ continue
+
+ if any(map(lambda additional_layer: not add_layer(bblayersconf, additional_layer, dep_layers, logger),
+ additional_layers)):
+ logger.info('Skipping %s due to missing additional layers.' % layer['name'])
+ results[layer['name']] = None
+ results_status[layer['name']] = 'SKIPPED (Missing additional layers)'
+ layers_tested = layers_tested + 1
+ continue
+
+ logger.info('Getting initial bitbake variables ...')
+ td['bbvars'] = get_bb_vars()
+ logger.info('Getting initial signatures ...')
+ td['builddir'] = builddir
+ td['sigs'], td['tunetasks'] = get_signatures(td['builddir'])
+ td['machines'] = args.machines
+
+ if not add_layer(bblayersconf, layer, dep_layers, logger):
+ logger.info('Skipping %s ???.' % layer['name'])
+ results[layer['name']] = None
+ results_status[layer['name']] = 'SKIPPED (Unknown)'
+ layers_tested = layers_tested + 1
+ continue
+
+ result = test_layer(td, layer, args.test_software_layer_signatures)
+ results[layer['name']] = result
+ results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL'
+ layers_tested = layers_tested + 1
+
+ ret = 0
+ if layers_tested:
+ logger.info('')
+ logger.info('Summary of results:')
+ logger.info('')
+ for layer_name in results_status:
+ logger.info('%s ... %s' % (layer_name, results_status[layer_name]))
+ if not results[layer_name] or not results[layer_name].wasSuccessful():
+ ret = 2 # ret = 1 used for initialization errors
+
+ cleanup_bblayers(None, None)
+
+ return ret
+
+if __name__ == '__main__':
+ try:
+ ret = main()
+ except Exception:
+ ret = 1
+ import traceback
+ traceback.print_exc()
+ sys.exit(ret)
diff --git a/poky/scripts/yocto-check-layer-wrapper b/poky/scripts/yocto-check-layer-wrapper
new file mode 100755
index 000000000..bbf6ee176
--- /dev/null
+++ b/poky/scripts/yocto-check-layer-wrapper
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+# Yocto Project layer check tool wrapper
+#
+# Creates a temporary build directory to run the yocto-check-layer
+# script to avoid a contaminated environment.
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+if [ -z "$BUILDDIR" ]; then
+ echo "Please source oe-init-build-env before run this script."
+ exit 2
+fi
+
+# since we are using a temp directory, use the realpath for output
+# log option
+output_log=''
+while getopts o: name
+do
+ case $name in
+ o) output_log=$(realpath "$OPTARG")
+ esac
+done
+shift $(($OPTIND - 1))
+
+# generate a temp directory to run check layer script
+base_dir=$(realpath $BUILDDIR/../)
+cd $base_dir
+
+build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
+
+source oe-init-build-env $build_dir
+if [[ $output_log != '' ]]; then
+ yocto-check-layer -o "$output_log" "$*"
+else
+ yocto-check-layer "$@"
+fi
+retcode=$?
+
+rm -rf $build_dir
+
+exit $retcode